From: Andrea Bianco Date: Fri, 8 Oct 2021 15:40:45 +0000 (+0200) Subject: Built motion from commit 9cd2c391.|2.5.37 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=18e27d3b66e77f811da05d6585ee5416cda27dc5;p=motion2.git Built motion from commit 9cd2c391.|2.5.37 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ec8c8c2..f4703a8 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-08T14:21:13.958Z", + "time": "2021-10-08T15:26:29.727Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c138824..197a24f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-08T14:21:13.958Z", + "time": "2021-10-08T15:26:29.727Z", "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 05609b3..17b9c13 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 _0xfe6a=['browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','sequelize','exports','VIRTUAL','action','integration','motionbar','jscripty','urlForward'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xfe6a,0xe8));var _0xafe6=function(_0x3c122a,_0x5a268a){_0x3c122a=_0x3c122a-0x0;var _0x18ba26=_0xfe6a[_0x3c122a];return _0x18ba26;};'use strict';var Sequelize=require(_0xafe6('0x0'));module[_0xafe6('0x1')]={'name':{'type':Sequelize[_0xafe6('0x2')],'get':function(_0x19e193){return this['getDataValue'](_0xafe6('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xafe6('0x4'),_0xafe6('0x5'),_0xafe6('0x6'),_0xafe6('0x7'),_0xafe6('0x8'),_0xafe6('0x9'),'script']],'msg':_0xafe6('0xa')}},'comment':_0xafe6('0xa')},'data1':{'type':Sequelize[_0xafe6('0xb')](0x1000),'comment':_0xafe6('0xc')},'data2':{'type':Sequelize[_0xafe6('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xafe6('0xd')},'data4':{'type':Sequelize[_0xafe6('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xafe6('0xb')](0x1000),'comments':_0xafe6('0xe')},'data6':{'type':Sequelize[_0xafe6('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x6ece=['jscripty','browser','script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration','motionbar'];(function(_0xfaec3a,_0x24d075){var _0x25d7ca=function(_0x177c1f){while(--_0x177c1f){_0xfaec3a['push'](_0xfaec3a['shift']());}};_0x25d7ca(++_0x24d075);}(_0x6ece,0xbf));var _0xe6ec=function(_0x4dbe87,_0x164899){_0x4dbe87=_0x4dbe87-0x0;var _0x57e2fb=_0x6ece[_0x4dbe87];return _0x57e2fb;};'use strict';var Sequelize=require(_0xe6ec('0x0'));module[_0xe6ec('0x1')]={'name':{'type':Sequelize[_0xe6ec('0x2')],'get':function(_0x557d28){return this[_0xe6ec('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe6ec('0x4'),_0xe6ec('0x5'),_0xe6ec('0x6'),_0xe6ec('0x7'),'urlForward',_0xe6ec('0x8'),'bot',_0xe6ec('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe6ec('0xa')](0x1000),'comment':_0xe6ec('0xb')},'data2':{'type':Sequelize[_0xe6ec('0xa')](0x1000),'comment':_0xe6ec('0xc')},'data3':{'type':Sequelize[_0xe6ec('0xa')](0x1000),'comment':_0xe6ec('0xd')},'data4':{'type':Sequelize[_0xe6ec('0xa')](0x1000),'comments':_0xe6ec('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe6ec('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe6ec('0x10')],'comments':_0xe6ec('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index f79f5c8..e6cc501 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 _0x80a4=['moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','end','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','destroy','sendStatus','error','stack','send','body','Action','find','params','then','catch','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x80a4,0xdd));var _0x480a=function(_0x588cbd,_0x43b872){_0x588cbd=_0x588cbd-0x0;var _0x571e75=_0x80a4[_0x588cbd];return _0x571e75;};'use strict';var emlformat=require(_0x480a('0x0'));var rimraf=require(_0x480a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x480a('0x2'));var rp=require(_0x480a('0x3'));var moment=require(_0x480a('0x4'));var BPromise=require(_0x480a('0x5'));var Mustache=require(_0x480a('0x6'));var util=require(_0x480a('0x7'));var path=require(_0x480a('0x8'));var sox=require(_0x480a('0x9'));var csv=require('to-csv');var ejs=require(_0x480a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x480a('0xb'));var crypto=require(_0x480a('0xc'));var jsforce=require(_0x480a('0xd'));var deskjs=require(_0x480a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x480a('0xf'));var Papa=require(_0x480a('0x10'));var Redis=require('ioredis');var authService=require(_0x480a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x480a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x480a('0x13'));var config=require(_0x480a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x480a('0x15'))['db'];function respondWithStatusCode(_0x4ec475,_0x38146a){_0x38146a=_0x38146a||0xcc;return function(_0x54b5df){if(_0x54b5df){return _0x4ec475['sendStatus'](_0x38146a);}return _0x4ec475['status'](_0x38146a)[_0x480a('0x16')]();};}function respondWithResult(_0x2a0701,_0xfc4e09){_0xfc4e09=_0xfc4e09||0xc8;return function(_0x5881f4){if(_0x5881f4){return _0x2a0701['status'](_0xfc4e09)['json'](_0x5881f4);}};}function respondWithFilteredResult(_0x120754,_0x34d22f){return function(_0x4ab779){if(_0x4ab779){var _0x213ab6=typeof _0x34d22f[_0x480a('0x17')]==='undefined'&&typeof _0x34d22f[_0x480a('0x18')]===_0x480a('0x19');var _0x195a62=_0x4ab779[_0x480a('0x1a')];var _0x239c69=_0x213ab6?0x0:_0x34d22f[_0x480a('0x17')];var _0x57f058=_0x213ab6?_0x4ab779[_0x480a('0x1a')]:_0x34d22f[_0x480a('0x17')]+_0x34d22f['limit'];var _0x5a744e;if(_0x57f058>=_0x195a62){_0x57f058=_0x195a62;_0x5a744e=0xc8;}else{_0x5a744e=0xce;}_0x120754[_0x480a('0x1b')](_0x5a744e);return _0x120754['set'](_0x480a('0x1c'),_0x239c69+'-'+_0x57f058+'/'+_0x195a62)[_0x480a('0x1d')](_0x4ab779);}return null;};}function patchUpdates(_0xa00203){return function(_0x141ecf){try{jsonpatch[_0x480a('0x1e')](_0x141ecf,_0xa00203,!![]);}catch(_0x7a8df8){return BPromise[_0x480a('0x1f')](_0x7a8df8);}return _0x141ecf[_0x480a('0x20')]();};}function saveUpdates(_0x122457,_0x1d3f69){return function(_0x5ac6da){if(_0x5ac6da){return _0x5ac6da[_0x480a('0x21')](_0x122457)['then'](function(_0x39f050){return _0x39f050;});}return null;};}function removeEntity(_0x55c9b3,_0x117d44){return function(_0x21cc29){if(_0x21cc29){return _0x21cc29[_0x480a('0x22')]()['then'](function(){_0x55c9b3['status'](0xcc)[_0x480a('0x16')]();});}};}function handleEntityNotFound(_0x159b5e,_0x378e5b){return function(_0x4d6083){if(!_0x4d6083){_0x159b5e[_0x480a('0x23')](0x194);}return _0x4d6083;};}function handleError(_0x43bf7c,_0x1cd926){_0x1cd926=_0x1cd926||0x1f4;return function(_0x24b541){logger[_0x480a('0x24')](_0x24b541[_0x480a('0x25')]);if(_0x24b541['name']){delete _0x24b541['name'];}_0x43bf7c['status'](_0x1cd926)[_0x480a('0x26')](_0x24b541);};}exports[_0x480a('0x21')]=function(_0xcb7c6e,_0x530969){if(_0xcb7c6e[_0x480a('0x27')]['id']){delete _0xcb7c6e[_0x480a('0x27')]['id'];}return db[_0x480a('0x28')][_0x480a('0x29')]({'where':{'id':_0xcb7c6e[_0x480a('0x2a')]['id']}})[_0x480a('0x2b')](handleEntityNotFound(_0x530969,null))['then'](saveUpdates(_0xcb7c6e['body'],null))[_0x480a('0x2b')](respondWithResult(_0x530969,null))['catch'](handleError(_0x530969,null));};exports[_0x480a('0x22')]=function(_0x4dbfe2,_0x23e4ac){return db[_0x480a('0x28')]['find']({'where':{'id':_0x4dbfe2[_0x480a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x23e4ac,null))[_0x480a('0x2b')](removeEntity(_0x23e4ac,null))[_0x480a('0x2c')](handleError(_0x23e4ac,null));}; \ No newline at end of file +var _0x783a=['ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','Content-Range','json','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x3b52de,_0x449c69){var _0x75017c=function(_0x15321f){while(--_0x15321f){_0x3b52de['push'](_0x3b52de['shift']());}};_0x75017c(++_0x449c69);}(_0x783a,0x1de));var _0xa783=function(_0x193789,_0x178b8f){_0x193789=_0x193789-0x0;var _0xd6bf3c=_0x783a[_0x193789];return _0xd6bf3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa783('0x0'));var zipdir=require(_0xa783('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa783('0x2'));var moment=require(_0xa783('0x3'));var BPromise=require(_0xa783('0x4'));var Mustache=require(_0xa783('0x5'));var util=require(_0xa783('0x6'));var path=require(_0xa783('0x7'));var sox=require(_0xa783('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa783('0x9'));var _=require(_0xa783('0xa'));var squel=require(_0xa783('0xb'));var crypto=require('crypto');var jsforce=require(_0xa783('0xc'));var deskjs=require(_0xa783('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa783('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa783('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa783('0x10'));var utils=require(_0xa783('0x11'));var config=require(_0xa783('0x12'));var licenseUtil=require(_0xa783('0x13'));var db=require(_0xa783('0x14'))['db'];function respondWithStatusCode(_0x5b9b1b,_0x34df31){_0x34df31=_0x34df31||0xcc;return function(_0x5b721f){if(_0x5b721f){return _0x5b9b1b[_0xa783('0x15')](_0x34df31);}return _0x5b9b1b[_0xa783('0x16')](_0x34df31)['end']();};}function respondWithResult(_0x1cd211,_0x5546af){_0x5546af=_0x5546af||0xc8;return function(_0x12af5d){if(_0x12af5d){return _0x1cd211[_0xa783('0x16')](_0x5546af)['json'](_0x12af5d);}};}function respondWithFilteredResult(_0x2cd825,_0x5b54dd){return function(_0x542f51){if(_0x542f51){var _0x2d914f=typeof _0x5b54dd['offset']==='undefined'&&typeof _0x5b54dd[_0xa783('0x17')]==='undefined';var _0x282c6b=_0x542f51[_0xa783('0x18')];var _0x19ac6f=_0x2d914f?0x0:_0x5b54dd[_0xa783('0x19')];var _0x303b17=_0x2d914f?_0x542f51[_0xa783('0x18')]:_0x5b54dd[_0xa783('0x19')]+_0x5b54dd[_0xa783('0x17')];var _0x50b4e1;if(_0x303b17>=_0x282c6b){_0x303b17=_0x282c6b;_0x50b4e1=0xc8;}else{_0x50b4e1=0xce;}_0x2cd825[_0xa783('0x16')](_0x50b4e1);return _0x2cd825['set'](_0xa783('0x1a'),_0x19ac6f+'-'+_0x303b17+'/'+_0x282c6b)[_0xa783('0x1b')](_0x542f51);}return null;};}function patchUpdates(_0x7af32b){return function(_0x1aef64){try{jsonpatch['apply'](_0x1aef64,_0x7af32b,!![]);}catch(_0x43894c){return BPromise['reject'](_0x43894c);}return _0x1aef64[_0xa783('0x1c')]();};}function saveUpdates(_0x47c5fc,_0x471c6d){return function(_0x49322e){if(_0x49322e){return _0x49322e[_0xa783('0x1d')](_0x47c5fc)[_0xa783('0x1e')](function(_0x1eae1e){return _0x1eae1e;});}return null;};}function removeEntity(_0x45a3e3,_0x3d3a16){return function(_0x4a93d0){if(_0x4a93d0){return _0x4a93d0[_0xa783('0x1f')]()[_0xa783('0x1e')](function(){_0x45a3e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x385f3b,_0x26e082){return function(_0x5eb89f){if(!_0x5eb89f){_0x385f3b['sendStatus'](0x194);}return _0x5eb89f;};}function handleError(_0x5af0ad,_0x3be44c){_0x3be44c=_0x3be44c||0x1f4;return function(_0x273c6f){logger[_0xa783('0x20')](_0x273c6f[_0xa783('0x21')]);if(_0x273c6f['name']){delete _0x273c6f[_0xa783('0x22')];}_0x5af0ad[_0xa783('0x16')](_0x3be44c)[_0xa783('0x23')](_0x273c6f);};}exports[_0xa783('0x1d')]=function(_0x34e4e5,_0x405f94){if(_0x34e4e5[_0xa783('0x24')]['id']){delete _0x34e4e5['body']['id'];}return db[_0xa783('0x25')][_0xa783('0x26')]({'where':{'id':_0x34e4e5[_0xa783('0x27')]['id']}})[_0xa783('0x1e')](handleEntityNotFound(_0x405f94,null))[_0xa783('0x1e')](saveUpdates(_0x34e4e5['body'],null))[_0xa783('0x1e')](respondWithResult(_0x405f94,null))[_0xa783('0x28')](handleError(_0x405f94,null));};exports[_0xa783('0x1f')]=function(_0x107aa4,_0x2edfe0){return db[_0xa783('0x25')][_0xa783('0x26')]({'where':{'id':_0x107aa4[_0xa783('0x27')]['id']}})[_0xa783('0x1e')](handleEntityNotFound(_0x2edfe0,null))[_0xa783('0x1e')](removeEntity(_0x2edfe0,null))['catch'](handleError(_0x2edfe0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 068c628..f119847 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 _0xd878=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x5501c1,_0x34c650){var _0x18300f=function(_0x30c610){while(--_0x30c610){_0x5501c1['push'](_0x5501c1['shift']());}};_0x18300f(++_0x34c650);}(_0xd878,0x199));var _0x8d87=function(_0x36474a,_0x1e1e1e){_0x36474a=_0x36474a-0x0;var _0xe1b706=_0xd878[_0x36474a];return _0xe1b706;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var logger=require(_0x8d87('0x2'))(_0x8d87('0x3'));var moment=require(_0x8d87('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d87('0x5'));var fs=require('fs');var path=require(_0x8d87('0x6'));var rimraf=require(_0x8d87('0x7'));var config=require(_0x8d87('0x8'));var attributes=require(_0x8d87('0x9'));module[_0x8d87('0xa')]=function(_0x4f91bd,_0x392c3f){return _0x4f91bd[_0x8d87('0xb')](_0x8d87('0xc'),attributes,{'tableName':_0x8d87('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_actions','lodash','util'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xd8b4,0xca));var _0x4d8b=function(_0x206719,_0x43e3bd){_0x206719=_0x206719-0x0;var _0x13df0f=_0xd8b4[_0x206719];return _0x13df0f;};'use strict';var _=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var logger=require(_0x4d8b('0x2'))(_0x4d8b('0x3'));var moment=require(_0x4d8b('0x4'));var BPromise=require(_0x4d8b('0x5'));var rp=require(_0x4d8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d8b('0x7'));var config=require(_0x4d8b('0x8'));var attributes=require('./action.attributes');module[_0x4d8b('0x9')]=function(_0x3b4088,_0x2c94d8){return _0x3b4088[_0x4d8b('0xa')]('Action',attributes,{'tableName':_0x4d8b('0xb'),'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 15bfc75..ca504f2 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd123f7,_0x4a4a4d){var _0x1d5ce7=function(_0x4295ab){while(--_0x4295ab){_0xd123f7['push'](_0xd123f7['shift']());}};_0x1d5ce7(++_0x4a4a4d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x513d80,_0x1649db){_0x513d80=_0x513d80-0x0;var _0x174463=_0x7fbe[_0x513d80];return _0x174463;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xf494,0x1c6));var _0x4f49=function(_0x4e7528,_0x5ad3c5){_0x4e7528=_0x4e7528-0x0;var _0x52fa95=_0xf494[_0x4e7528];return _0x52fa95;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index fdeef6c..d8a02f0 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 _0x57cb=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','put','isAuthenticated','update','delete','/:id'];(function(_0x4480c6,_0x27d41a){var _0xfb8c76=function(_0x1e0d49){while(--_0x1e0d49){_0x4480c6['push'](_0x4480c6['shift']());}};_0xfb8c76(++_0x27d41a);}(_0x57cb,0x18a));var _0xb57c=function(_0x7a4b77,_0x14fd43){_0x7a4b77=_0x7a4b77-0x0;var _0x1d5449=_0x57cb[_0x7a4b77];return _0x1d5449;};'use strict';var multer=require(_0xb57c('0x0'));var util=require(_0xb57c('0x1'));var path=require(_0xb57c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb57c('0x3'));var router=express[_0xb57c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb57c('0x5'));var interaction=require(_0xb57c('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xb57c('0x7')]('/:id',auth[_0xb57c('0x8')](),controller[_0xb57c('0x9')]);router[_0xb57c('0xa')](_0xb57c('0xb'),auth[_0xb57c('0x8')](),controller[_0xb57c('0xc')]);module[_0xb57c('0xd')]=router; \ No newline at end of file +var _0xfe59=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x374f8d,_0x216545){var _0x4d486b=function(_0x478d0a){while(--_0x478d0a){_0x374f8d['push'](_0x374f8d['shift']());}};_0x4d486b(++_0x216545);}(_0xfe59,0x7e));var _0x9fe5=function(_0x53cde3,_0x214953){_0x53cde3=_0x53cde3-0x0;var _0x15905d=_0xfe59[_0x53cde3];return _0x15905d;};'use strict';var multer=require(_0x9fe5('0x0'));var util=require(_0x9fe5('0x1'));var path=require('path');var timeout=require(_0x9fe5('0x2'));var express=require('express');var router=express[_0x9fe5('0x3')]();var fs_extra=require(_0x9fe5('0x4'));var auth=require(_0x9fe5('0x5'));var interaction=require(_0x9fe5('0x6'));var config=require(_0x9fe5('0x7'));var controller=require('./action.controller');router[_0x9fe5('0x8')]('/:id',auth[_0x9fe5('0x9')](),controller[_0x9fe5('0xa')]);router[_0x9fe5('0xb')](_0x9fe5('0xc'),auth[_0x9fe5('0x9')](),controller['destroy']);module[_0x9fe5('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 10382c7..14130c0 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x65cf17,_0x43f5b9){var _0x57f96e=function(_0x209ccf){while(--_0x209ccf){_0x65cf17['push'](_0x65cf17['shift']());}};_0x57f96e(++_0x43f5b9);}(_0x814b,0x1a2));var _0xb814=function(_0xf3e4a0,_0x16a172){_0xf3e4a0=_0xf3e4a0-0x0;var _0x43f1cc=_0x814b[_0xf3e4a0];return _0x43f1cc;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x302ed6,_0x5451a8){var _0x3b42e9=function(_0x53dd54){while(--_0x53dd54){_0x302ed6['push'](_0x302ed6['shift']());}};_0x3b42e9(++_0x5451a8);}(_0xda19,0xd5));var _0x9da1=function(_0x399f1a,_0x375cf1){_0x399f1a=_0x399f1a-0x0;var _0x47f7a7=_0xda19[_0x399f1a];return _0x47f7a7;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'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 948958f..dd18009 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 _0x8695=['orderBy','order','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','right_join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','keyBy','clone','output','web','randomstring','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','savename','countTable','COUNT(*)','SELECT','MAX(%s)','HOUR(%s)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','update','UserProfileResource','then','error','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','role','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy'];(function(_0x5c0d64,_0x38ead8){var _0x1bb127=function(_0x60b7f8){while(--_0x60b7f8){_0x5c0d64['push'](_0x5c0d64['shift']());}};_0x1bb127(++_0x38ead8);}(_0x8695,0xc5));var _0x5869=function(_0x4bb32f,_0x2217e){_0x4bb32f=_0x4bb32f-0x0;var _0x2dd6e6=_0x8695[_0x4bb32f];return _0x2dd6e6;};'use strict';var emlformat=require(_0x5869('0x0'));var rimraf=require(_0x5869('0x1'));var zipdir=require(_0x5869('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5869('0x3'));var moment=require(_0x5869('0x4'));var BPromise=require(_0x5869('0x5'));var Mustache=require(_0x5869('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5869('0x7'));var csv=require(_0x5869('0x8'));var ejs=require(_0x5869('0x9'));var fs=require('fs');var fs_extra=require(_0x5869('0xa'));var _=require(_0x5869('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5869('0xc'));var toCsv=require(_0x5869('0x8'));var querystring=require('querystring');var Papa=require(_0x5869('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5869('0xe'));var as=require(_0x5869('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5869('0x10'))(_0x5869('0x11'));var utils=require(_0x5869('0x12'));var config=require(_0x5869('0x13'));var licenseUtil=require(_0x5869('0x14'));var db=require(_0x5869('0x15'))['db'];var dbH=require(_0x5869('0x15'))['dbH'];function respondWithStatusCode(_0x146d29,_0xc19b5c){_0xc19b5c=_0xc19b5c||0xcc;return function(_0x129995){if(_0x129995){return _0x146d29['sendStatus'](_0xc19b5c);}return _0x146d29[_0x5869('0x16')](_0xc19b5c)[_0x5869('0x17')]();};}function respondWithResult(_0xde7684,_0x2c1524){_0x2c1524=_0x2c1524||0xc8;return function(_0x57c7e2){if(_0x57c7e2){return _0xde7684[_0x5869('0x16')](_0x2c1524)[_0x5869('0x18')](_0x57c7e2);}};}function respondWithFilteredResult(_0x275be5,_0x37c3ea){return function(_0x3fd883){if(_0x3fd883){var _0x406632=typeof _0x37c3ea[_0x5869('0x19')]==='undefined'&&typeof _0x37c3ea[_0x5869('0x1a')]===_0x5869('0x1b');var _0x254b0b=_0x3fd883[_0x5869('0x1c')];var _0x36cb4b=_0x406632?0x0:_0x37c3ea['offset'];var _0x56aae0=_0x406632?_0x3fd883[_0x5869('0x1c')]:_0x37c3ea[_0x5869('0x19')]+_0x37c3ea[_0x5869('0x1a')];var _0x30e45d;if(_0x56aae0>=_0x254b0b){_0x56aae0=_0x254b0b;_0x30e45d=0xc8;}else{_0x30e45d=0xce;}_0x275be5[_0x5869('0x16')](_0x30e45d);return _0x275be5[_0x5869('0x1d')]('Content-Range',_0x36cb4b+'-'+_0x56aae0+'/'+_0x254b0b)['json'](_0x3fd883);}return null;};}function patchUpdates(_0x295302){return function(_0x3f572a){try{jsonpatch[_0x5869('0x1e')](_0x3f572a,_0x295302,!![]);}catch(_0xe3a646){return BPromise[_0x5869('0x1f')](_0xe3a646);}return _0x3f572a['save']();};}function saveUpdates(_0x18e222,_0x563388){return function(_0x2743f3){if(_0x2743f3){return _0x2743f3[_0x5869('0x20')](_0x18e222)['then'](function(_0x1fa0ce){return _0x1fa0ce;});}return null;};}function removeEntity(_0x596278,_0x38e013){return function(_0x2e3353){if(_0x2e3353){return _0x2e3353['destroy']()['then'](function(){var _0x1540cc=_0x2e3353['get']({'plain':!![]});var _0x5269eb='CustomReports';return db[_0x5869('0x21')]['destroy']({'where':{'type':_0x5269eb,'resourceId':_0x1540cc['id']}})['then'](function(){return _0x2e3353;});})[_0x5869('0x22')](function(){_0x596278[_0x5869('0x16')](0xcc)[_0x5869('0x17')]();});}};}function handleEntityNotFound(_0x5d49a4,_0x4e3fab){return function(_0x54c714){if(!_0x54c714){_0x5d49a4['sendStatus'](0x194);}return _0x54c714;};}function handleError(_0x1c5be4,_0x1d46b0){_0x1d46b0=_0x1d46b0||0x1f4;return function(_0x20c169){logger[_0x5869('0x23')](_0x20c169[_0x5869('0x24')]);if(_0x20c169[_0x5869('0x25')]){delete _0x20c169[_0x5869('0x25')];}_0x1c5be4[_0x5869('0x16')](_0x1d46b0)['send'](_0x20c169);};}exports[_0x5869('0x26')]=function(_0x97f6fd,_0x1f0126){var _0x26659c={},_0x5813e3={},_0x4207bc={'count':0x0,'rows':[]};var _0x7b825=_[_0x5869('0x27')](db[_0x5869('0x28')]['rawAttributes'],function(_0x2bd70e){return{'name':_0x2bd70e[_0x5869('0x29')],'type':_0x2bd70e[_0x5869('0x2a')][_0x5869('0x2b')]};});_0x5813e3[_0x5869('0x2c')]=_[_0x5869('0x27')](_0x7b825,_0x5869('0x25'));_0x5813e3[_0x5869('0x2d')]=_[_0x5869('0x2e')](_0x97f6fd[_0x5869('0x2d')]);_0x5813e3[_0x5869('0x2f')]=_[_0x5869('0x30')](_0x5813e3[_0x5869('0x2c')],_0x5813e3[_0x5869('0x2d')]);_0x26659c['attributes']=_[_0x5869('0x30')](_0x5813e3[_0x5869('0x2c')],qs[_0x5869('0x31')](_0x97f6fd[_0x5869('0x2d')][_0x5869('0x31')]));_0x26659c[_0x5869('0x32')]=_0x26659c['attributes'][_0x5869('0x33')]?_0x26659c[_0x5869('0x32')]:_0x5813e3[_0x5869('0x2c')];if(!_0x97f6fd['query'][_0x5869('0x34')](_0x5869('0x35'))){_0x26659c[_0x5869('0x1a')]=qs[_0x5869('0x1a')](_0x97f6fd[_0x5869('0x2d')]['limit']);_0x26659c[_0x5869('0x19')]=qs[_0x5869('0x19')](_0x97f6fd['query'][_0x5869('0x19')]);}_0x26659c['order']=qs[_0x5869('0x36')](_0x97f6fd[_0x5869('0x2d')]['sort']);_0x26659c[_0x5869('0x37')]=qs[_0x5869('0x2f')](_[_0x5869('0x38')](_0x97f6fd[_0x5869('0x2d')],_0x5813e3[_0x5869('0x2f')]),_0x7b825);if(_0x97f6fd['query']['filter']){_0x26659c[_0x5869('0x37')]=_[_0x5869('0x39')](_0x26659c['where'],{'$or':_['map'](_0x7b825,function(_0x43e999){if(_0x43e999['type']!=='VIRTUAL'){var _0x4afdcc={};_0x4afdcc[_0x43e999[_0x5869('0x25')]]={'$like':'%'+_0x97f6fd['query'][_0x5869('0x3a')]+'%'};return _0x4afdcc;}})});}_0x26659c=_[_0x5869('0x39')]({},_0x26659c,_0x97f6fd[_0x5869('0x3b')]);var _0x3788d4={'where':_0x26659c[_0x5869('0x37')]};return db[_0x5869('0x28')][_0x5869('0x1c')](_0x3788d4)[_0x5869('0x22')](function(_0x3d6c41){_0x4207bc[_0x5869('0x1c')]=_0x3d6c41;if(_0x97f6fd['query']['includeAll']){_0x26659c[_0x5869('0x3c')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5869('0x3d')](_0x26659c);})[_0x5869('0x22')](function(_0x216807){_0x4207bc[_0x5869('0x3e')]=_0x216807;return _0x4207bc;})[_0x5869('0x22')](respondWithFilteredResult(_0x1f0126,_0x26659c))[_0x5869('0x3f')](handleError(_0x1f0126,null));};exports[_0x5869('0x40')]=function(_0x1ed147,_0x3b0f60){var _0x5f065a={'raw':![],'where':{'id':_0x1ed147[_0x5869('0x41')]['id']}},_0x1f14f3={};_0x1f14f3[_0x5869('0x2c')]=_[_0x5869('0x2e')](db[_0x5869('0x28')][_0x5869('0x42')]);_0x1f14f3['query']=_['keys'](_0x1ed147[_0x5869('0x2d')]);_0x1f14f3[_0x5869('0x2f')]=_[_0x5869('0x30')](_0x1f14f3['model'],_0x1f14f3[_0x5869('0x2d')]);_0x5f065a['attributes']=_[_0x5869('0x30')](_0x1f14f3['model'],qs[_0x5869('0x31')](_0x1ed147[_0x5869('0x2d')][_0x5869('0x31')]));_0x5f065a[_0x5869('0x32')]=_0x5f065a['attributes'][_0x5869('0x33')]?_0x5f065a[_0x5869('0x32')]:_0x1f14f3[_0x5869('0x2c')];if(_0x1ed147[_0x5869('0x2d')][_0x5869('0x43')]){_0x5f065a[_0x5869('0x3c')]=[{'all':!![]}];}_0x5f065a=_[_0x5869('0x39')]({},_0x5f065a,_0x1ed147[_0x5869('0x3b')]);return db[_0x5869('0x28')][_0x5869('0x44')](_0x5f065a)[_0x5869('0x22')](handleEntityNotFound(_0x3b0f60,null))[_0x5869('0x22')](respondWithResult(_0x3b0f60,null))[_0x5869('0x3f')](handleError(_0x3b0f60,null));};exports[_0x5869('0x45')]=function(_0x5504f6,_0x3b4e78){return db[_0x5869('0x28')][_0x5869('0x45')](_0x5504f6[_0x5869('0x46')],{})[_0x5869('0x22')](function(_0x206768){var _0x3db872=_0x5504f6[_0x5869('0x47')][_0x5869('0x48')]({'plain':!![]});if(!_0x3db872)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3db872[_0x5869('0x49')]===_0x5869('0x47')){var _0xc8cef1=_0x206768[_0x5869('0x48')]({'plain':!![]});var _0x53c672='Reports';return db['UserProfileSection'][_0x5869('0x44')]({'where':{'name':_0x53c672,'userProfileId':_0x3db872[_0x5869('0x4a')]},'raw':!![]})[_0x5869('0x22')](function(_0x2d61aa){if(_0x2d61aa&&_0x2d61aa[_0x5869('0x4b')]===0x0){return db[_0x5869('0x21')][_0x5869('0x45')]({'name':_0xc8cef1[_0x5869('0x25')],'resourceId':_0xc8cef1['id'],'type':_0x5869('0x4c'),'sectionId':_0x2d61aa['id']},{})['then'](function(){return _0x206768;});}else{return _0x206768;}})[_0x5869('0x3f')](function(_0xd503bc){logger[_0x5869('0x23')](_0x5869('0x4d'),_0xd503bc);throw _0xd503bc;});}return _0x206768;})[_0x5869('0x22')](respondWithResult(_0x3b4e78,0xc9))[_0x5869('0x3f')](handleError(_0x3b4e78,null));};exports[_0x5869('0x20')]=function(_0x1abe9c,_0x85bec6){if(_0x1abe9c['body']['id']){delete _0x1abe9c['body']['id'];}return db['AnalyticCustomReport'][_0x5869('0x44')]({'where':{'id':_0x1abe9c[_0x5869('0x41')]['id']}})[_0x5869('0x22')](handleEntityNotFound(_0x85bec6,null))[_0x5869('0x22')](saveUpdates(_0x1abe9c['body'],null))[_0x5869('0x22')](respondWithResult(_0x85bec6,null))['catch'](handleError(_0x85bec6,null));};exports[_0x5869('0x4e')]=function(_0x55a813,_0x3f56a9){return db['AnalyticCustomReport']['find']({'where':{'id':_0x55a813[_0x5869('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f56a9,null))['then'](removeEntity(_0x3f56a9,null))[_0x5869('0x3f')](handleError(_0x3f56a9,null));};exports['preview']=function(_0xe8fb90,_0x29101b){var _0x54d34f=0xa;var _0x2431ea=['join',_0x5869('0x4f'),'right_join',_0x5869('0x50')];var _0x12b630={'SUM':_0x5869('0x51'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5869('0x52'),'MAX':'MAX(%s)','MIN':_0x5869('0x53'),'AVG':_0x5869('0x54'),'GROUP_CONCAT':_0x5869('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5869('0x56')};var _0x3949b3={'SEC_TO_TIME':_0x5869('0x57'),'DATE':_0x5869('0x58'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5869('0x59')};var _0xf505a1=function(_0x5b4b1a){return!_[_0x5869('0x5a')]([_0x5869('0x5b'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x5869('0x5c')],_0x5b4b1a);};var _0x19cddf=function(_0x508f5a){if(!_0x508f5a||!_0x508f5a['rules'][_0x5869('0x33')]){return'';}for(var _0x39d7ab='(',_0x2be7a0=0x0;_0x2be7a0<_0x508f5a[_0x5869('0x5d')][_0x5869('0x33')];_0x2be7a0+=0x1){_0x2be7a0>0x0&&(_0x39d7ab+='\x20'+_0x508f5a[_0x5869('0x5e')]+'\x20');_0x39d7ab+=_0x508f5a['rules'][_0x2be7a0][_0x5869('0x5f')]?_0x19cddf(_0x508f5a[_0x5869('0x5d')][_0x2be7a0][_0x5869('0x5f')]):_0x508f5a[_0x5869('0x5d')][_0x2be7a0][_0x5869('0x60')]+'\x20'+_0x508f5a[_0x5869('0x5d')][_0x2be7a0]['condition']+(_0xf505a1(_0x508f5a[_0x5869('0x5d')][_0x2be7a0][_0x5869('0x61')])?'\x20'+_0x508f5a[_0x5869('0x5d')][_0x2be7a0][_0x5869('0x62')]:'');}return _0x39d7ab+')';};var _0x4cb799={'where':{'id':_0xe8fb90[_0x5869('0x41')]['id']}},_0x23596f,_0x276b48,_0x1654ea,_0x99a5a,_0x28eb9d;_0x4cb799=_['merge']({},_0x4cb799,_0xe8fb90[_0x5869('0x3b')]);return db['AnalyticCustomReport'][_0x5869('0x44')](_0x4cb799)[_0x5869('0x22')](function(_0x5d1658){if(_0x5d1658){_0x23596f=_0x5d1658;return _0x5d1658[_0x5869('0x63')]();}return null;})[_0x5869('0x22')](function(_0x54c7b3){if(_0x54c7b3){if(!_0x54c7b3[_0x5869('0x33')]){throw new db[(_0x5869('0x64'))][(_0x5869('0x65'))](_0x5869('0x66'),0x193);}_0x276b48=_0x54c7b3;return db[_0x5869('0x67')][_0x5869('0x3d')]({'raw':!![]});}return null;})[_0x5869('0x22')](function(_0x3a9d9d){if(_0x3a9d9d){_0x1654ea=_['keyBy'](_0x3a9d9d,'id');var _0xfae21a;var _0x32e4f2=squel[_0x5869('0x68')]();_0x32e4f2[_0x5869('0x69')](_0x23596f[_0x5869('0x6a')]);for(var _0x1715e4=0x0;_0x1715e4<_0x276b48[_0x5869('0x33')];_0x1715e4+=0x1){_0xfae21a=_0x276b48[_0x1715e4][_0x5869('0x6b')]?_0x1654ea[_0x276b48[_0x1715e4][_0x5869('0x6b')]][_0x5869('0x6c')]:_0x276b48[_0x1715e4]['field'];_0xfae21a=_0x276b48[_0x1715e4][_0x5869('0x6d')]?_[_0x5869('0x6e')](_0x12b630[_0x276b48[_0x1715e4][_0x5869('0x6d')]],'%s',_0xfae21a):_0xfae21a;_0xfae21a=_0x276b48[_0x1715e4]['format']?_['replace'](_0x3949b3[_0x276b48[_0x1715e4][_0x5869('0x6f')]],'%s',_0xfae21a):_0xfae21a;if(_0x276b48[_0x1715e4][_0x5869('0x70')]){_0x32e4f2[_0x5869('0x5f')](_0xfae21a);}_0x276b48[_0x1715e4][_0x5869('0x71')]&&_0x32e4f2[_0x5869('0x72')](_0xfae21a,_0x276b48[_0x1715e4]['orderBy']===_0x5869('0x73')?![]:!![]);_0x32e4f2['field'](_0xfae21a,_0x276b48[_0x1715e4][_0x5869('0x74')]||_0xfae21a);}if(_0x23596f[_0x5869('0x75')]){_0x23596f[_0x5869('0x75')]=JSON['parse'](_0x23596f[_0x5869('0x75')]);for(var _0x306f05=0x0;_0x306f05<_0x23596f[_0x5869('0x75')][_0x5869('0x33')];_0x306f05+=0x1){if(_0x23596f[_0x5869('0x75')][_0x306f05]['type']&&_[_0x5869('0x5a')](_0x2431ea,_0x23596f[_0x5869('0x75')][_0x306f05][_0x5869('0x2a')])&&_0x23596f[_0x5869('0x75')][_0x306f05][_0x5869('0x76')]&&_0x23596f[_0x5869('0x75')][_0x306f05][_0x5869('0x77')]&&_0x23596f[_0x5869('0x75')][_0x306f05]['foreignKey']){_0x32e4f2[_0x23596f[_0x5869('0x75')][_0x306f05][_0x5869('0x2a')]](_0x23596f['joins'][_0x306f05][_0x5869('0x77')],null,util['format'](_0x5869('0x78'),_0x23596f[_0x5869('0x6a')],_0x23596f['joins'][_0x306f05][_0x5869('0x76')],_0x23596f['joins'][_0x306f05][_0x5869('0x77')],_0x23596f['joins'][_0x306f05][_0x5869('0x79')]));}}}if(_0x23596f[_0x5869('0x7a')]){_0x23596f[_0x5869('0x7a')]=JSON[_0x5869('0x7b')](_0x23596f[_0x5869('0x7a')]);_0x32e4f2[_0x5869('0x37')](_0x19cddf(_0x23596f[_0x5869('0x7a')]['group']));}_0x28eb9d=_0x32e4f2['clone']();_0x32e4f2['limit'](_0x54d34f);_0x32e4f2['offset'](0x0);logger[_0x5869('0x7c')](_0x5869('0x7d'),_0x32e4f2[_0x5869('0x7e')]());return dbH[_0x5869('0x7f')][_0x5869('0x2d')](_0x32e4f2[_0x5869('0x7e')](),{'type':dbH['sequelize'][_0x5869('0x80')]['SELECT']});}})['then'](respondWithResult(_0x29101b,null))[_0x5869('0x3f')](handleError(_0x29101b,null));};function runReport(_0xcf5a17,_0x8f35e5,_0x1b948c){var _0x1a0b93=_0x8f35e5[_0x5869('0x25')];var _0x346a11=0xa;var _0x5640e8=[_0x5869('0x81'),_0x5869('0x4f'),_0x5869('0x82'),_0x5869('0x50')];var _0x5d37f8={'SUM':_0x5869('0x51'),'COUNT':_0x5869('0x83'),'COUNT DISTINCT':_0x5869('0x52'),'MAX':'MAX(%s)','MIN':_0x5869('0x53'),'AVG':_0x5869('0x54'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5869('0x84'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f109={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5869('0x85'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x146a8f=function(_0x32f028){return!_['includes']([_0x5869('0x5b'),_0x5869('0x86'),_0x5869('0x87'),_0x5869('0x5c')],_0x32f028);};var _0x1d68f3=function(_0x445db4){if(!_0x445db4||!_0x445db4[_0x5869('0x5d')]['length']){return'';}for(var _0x1d0bea='(',_0x3039b1=0x0;_0x3039b1<_0x445db4[_0x5869('0x5d')]['length'];_0x3039b1+=0x1){_0x3039b1>0x0&&(_0x1d0bea+='\x20'+_0x445db4[_0x5869('0x5e')]+'\x20');_0x1d0bea+=_0x445db4[_0x5869('0x5d')][_0x3039b1]['group']?_0x1d68f3(_0x445db4[_0x5869('0x5d')][_0x3039b1][_0x5869('0x5f')]):_0x445db4[_0x5869('0x5d')][_0x3039b1][_0x5869('0x60')]+'\x20'+_0x445db4[_0x5869('0x5d')][_0x3039b1][_0x5869('0x61')]+(_0x146a8f(_0x445db4['rules'][_0x3039b1][_0x5869('0x61')])?'\x20'+_0x445db4[_0x5869('0x5d')][_0x3039b1][_0x5869('0x62')]:'');}return _0x1d0bea+')';};var _0x529efc={'where':{'id':_0xcf5a17['id']}},_0x28f318,_0x38d646,_0x2e515f,_0x3ac409,_0x22a16e;_0x529efc=_[_0x5869('0x39')]({},_0x529efc,_0x1b948c);return db[_0x5869('0x28')][_0x5869('0x44')](_0x529efc)[_0x5869('0x22')](function(_0x39ebbc){if(_0x39ebbc){_0x28f318=_0x39ebbc;return _0x39ebbc[_0x5869('0x63')]();}return null;})['then'](function(_0x9fbd44){if(_0x9fbd44){if(!_0x9fbd44['length']){throw new db['Sequelize'][(_0x5869('0x65'))](_0x5869('0x66'),0x193);}_0x38d646=_0x9fbd44;return db[_0x5869('0x67')][_0x5869('0x3d')]({'raw':!![]});}return null;})[_0x5869('0x22')](function(_0x4d081f){if(_0x4d081f){_0x2e515f=_[_0x5869('0x88')](_0x4d081f,'id');var _0x272f02;var _0x54184f=squel[_0x5869('0x68')]();_0x54184f[_0x5869('0x69')](_0x28f318[_0x5869('0x6a')]);for(var _0x50ae62=0x0;_0x50ae62<_0x38d646[_0x5869('0x33')];_0x50ae62+=0x1){_0x272f02=_0x38d646[_0x50ae62][_0x5869('0x6b')]?_0x2e515f[_0x38d646[_0x50ae62][_0x5869('0x6b')]][_0x5869('0x6c')]:_0x38d646[_0x50ae62]['field'];_0x272f02=_0x38d646[_0x50ae62][_0x5869('0x6d')]?_[_0x5869('0x6e')](_0x5d37f8[_0x38d646[_0x50ae62]['function']],'%s',_0x272f02):_0x272f02;_0x272f02=_0x38d646[_0x50ae62][_0x5869('0x6f')]?_['replace'](_0x25f109[_0x38d646[_0x50ae62]['format']],'%s',_0x272f02):_0x272f02;if(_0x38d646[_0x50ae62]['groupBy']){_0x54184f[_0x5869('0x5f')](_0x272f02);}_0x38d646[_0x50ae62][_0x5869('0x71')]&&_0x54184f[_0x5869('0x72')](_0x272f02,_0x38d646[_0x50ae62][_0x5869('0x71')]===_0x5869('0x73')?![]:!![]);_0x54184f[_0x5869('0x60')](_0x272f02,_0x38d646[_0x50ae62][_0x5869('0x74')]||_0x272f02);}if(_0x28f318['joins']){_0x28f318[_0x5869('0x75')]=JSON[_0x5869('0x7b')](_0x28f318['joins']);for(var _0x4160bd=0x0;_0x4160bd<_0x28f318[_0x5869('0x75')][_0x5869('0x33')];_0x4160bd+=0x1){if(_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x2a')]&&_['includes'](_0x5640e8,_0x28f318['joins'][_0x4160bd][_0x5869('0x2a')])&&_0x28f318[_0x5869('0x75')][_0x4160bd]['parentKey']&&_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x77')]&&_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x79')]){_0x54184f[_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x2a')]](_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x77')],null,util[_0x5869('0x6f')](_0x5869('0x78'),_0x28f318[_0x5869('0x6a')],_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x76')],_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x77')],_0x28f318[_0x5869('0x75')][_0x4160bd][_0x5869('0x79')]));}}}if(_0x28f318['conditions']){_0x28f318[_0x5869('0x7a')]=JSON[_0x5869('0x7b')](_0x28f318[_0x5869('0x7a')]);_0x54184f[_0x5869('0x37')](_0x1d68f3(_0x28f318['conditions'][_0x5869('0x5f')]));}_0x22a16e=_0x54184f[_0x5869('0x89')]();_0x54184f[_0x5869('0x1a')](_0x346a11);_0x54184f[_0x5869('0x19')](0x0);return;}})[_0x5869('0x22')](function(){if(_0x8f35e5[_0x5869('0x8a')]===_0x5869('0x8b')){return null;}var _0x379e68=_[_0x5869('0x39')](_0x8f35e5,{'name':_0x8f35e5['fullPath']||_0x8f35e5[_0x5869('0x25')]||_0x28f318[_0x5869('0x25')],'basename':_0x1a0b93,'savename':util[_0x5869('0x6f')]('%s-%s.%s',_0x8f35e5[_0x5869('0x25')]||_0x28f318['name'],require(_0x5869('0x8c'))[_0x5869('0x8d')](0x4),_0x8f35e5['output']||_0x5869('0x8e')),'reportId':_0x28f318['id'],'reportType':_0x5869('0x8f')});return db['AnalyticExtractedReport'][_0x5869('0x45')](_0x379e68,{'raw':!![]});})[_0x5869('0x22')](function(_0x552b0f){if(_0x28f318[_0x5869('0x6a')]==='cdr'){_0x22a16e['where'](_0x28f318[_0x5869('0x6a')]+_0x5869('0x90'),_0x8f35e5[_0x5869('0x91')],_0x8f35e5[_0x5869('0x92')]);}else{_0x22a16e['where'](_0x28f318[_0x5869('0x6a')]+_0x5869('0x93'),_0x8f35e5['startDate'],_0x8f35e5[_0x5869('0x92')]);}if(_0x552b0f){logger[_0x5869('0x94')]('Run\x20Query:',_0x22a16e[_0x5869('0x7e')]());require('child_process')['fork'](path[_0x5869('0x81')](__dirname,'../../components/export/',_0x552b0f[_0x5869('0x8a')]),[_0x552b0f['id'],_0x22a16e[_0x5869('0x7e')](),path['join'](__dirname,'../../files/reports',_0x552b0f[_0x5869('0x95')]),_0x1a0b93]);return _0x552b0f;}else{var _0x46262e=squel[_0x5869('0x68')]();_0x46262e['from']('('+_0x22a16e[_0x5869('0x7e')]()+')',_0x5869('0x96'));_0x46262e['field'](_0x5869('0x97'),_0x5869('0x1c'));_0x22a16e['limit'](_0x8f35e5[_0x5869('0x1a')]||_0x346a11);_0x22a16e[_0x5869('0x19')](_0x8f35e5[_0x5869('0x19')]||0x0);return dbH[_0x5869('0x7f')]['query'](_0x46262e[_0x5869('0x7e')](),{'type':dbH[_0x5869('0x7f')][_0x5869('0x80')][_0x5869('0x98')]})[_0x5869('0x22')](function(_0x388ad2){if(!_0x388ad2[_0x5869('0x33')]){_0x3ac409=0x0;}else{_0x3ac409=_0x388ad2[0x0]['count']||0x0;}return dbH[_0x5869('0x7f')][_0x5869('0x2d')](_0x22a16e[_0x5869('0x7e')](),{'type':dbH['sequelize'][_0x5869('0x80')][_0x5869('0x98')]});})[_0x5869('0x22')](function(_0x519383){return{'rows':_0x519383||[],'count':_0x3ac409};});}});}exports['run']=function(_0x3b239a,_0x5c3dec){return runReport(_0x3b239a['params'],_0x3b239a[_0x5869('0x2d')],_0x3b239a[_0x5869('0x3b')])[_0x5869('0x22')](respondWithResult(_0x5c3dec,null))[_0x5869('0x3f')](handleError(_0x5c3dec,null));};exports['runReport']=runReport;exports[_0x5869('0x2d')]=function(_0x55eea7,_0x36e269){var _0x1bb21a=0xa;var _0x4db90a=['join',_0x5869('0x4f'),_0x5869('0x82'),_0x5869('0x50')];var _0xe3239f={'SUM':_0x5869('0x51'),'COUNT':_0x5869('0x83'),'COUNT DISTINCT':_0x5869('0x52'),'MAX':_0x5869('0x99'),'MIN':_0x5869('0x53'),'AVG':_0x5869('0x54'),'GROUP_CONCAT':_0x5869('0x55'),'GROUP_CONCAT ASC':_0x5869('0x84'),'GROUP_CONCAT DESC':_0x5869('0x56')};var _0x216547={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5869('0x9a'),'ROUND':_0x5869('0x85'),'UNIX_TIMESTAMP':_0x5869('0x59')};var _0x58bd1e=function(_0x450b29){return!_[_0x5869('0x5a')]([_0x5869('0x5b'),_0x5869('0x86'),_0x5869('0x87'),_0x5869('0x5c')],_0x450b29);};var _0x26a73c=function(_0x3014fd){if(!_0x3014fd||!_0x3014fd[_0x5869('0x5d')][_0x5869('0x33')]){return'';}for(var _0x134834='(',_0x2657d1=0x0;_0x2657d1<_0x3014fd[_0x5869('0x5d')]['length'];_0x2657d1+=0x1){_0x2657d1>0x0&&(_0x134834+='\x20'+_0x3014fd[_0x5869('0x5e')]+'\x20');_0x134834+=_0x3014fd[_0x5869('0x5d')][_0x2657d1][_0x5869('0x5f')]?_0x26a73c(_0x3014fd[_0x5869('0x5d')][_0x2657d1][_0x5869('0x5f')]):_0x3014fd[_0x5869('0x5d')][_0x2657d1][_0x5869('0x60')]+'\x20'+_0x3014fd[_0x5869('0x5d')][_0x2657d1][_0x5869('0x61')]+(_0x58bd1e(_0x3014fd[_0x5869('0x5d')][_0x2657d1][_0x5869('0x61')])?'\x20'+_0x3014fd[_0x5869('0x5d')][_0x2657d1]['value']:'');}return _0x134834+')';};var _0x148e27={'where':{'id':_0x55eea7['params']['id']}},_0x37793f,_0x345e5c,_0x37a114,_0x5badfd,_0x4a5f64;_0x148e27=_[_0x5869('0x39')]({},_0x148e27,_0x55eea7[_0x5869('0x3b')]);return db[_0x5869('0x28')][_0x5869('0x44')](_0x148e27)['then'](function(_0x568609){if(_0x568609){_0x37793f=_0x568609;return _0x568609[_0x5869('0x63')]();}return null;})[_0x5869('0x22')](function(_0x1901d5){if(_0x1901d5){if(!_0x1901d5[_0x5869('0x33')]){throw new db[(_0x5869('0x64'))]['ValidationErrorItem'](_0x5869('0x66'),0x193);}_0x345e5c=_0x1901d5;return db[_0x5869('0x67')][_0x5869('0x3d')]({'raw':!![]});}return null;})[_0x5869('0x22')](function(_0x239361){if(_0x239361){_0x37a114=_[_0x5869('0x88')](_0x239361,'id');var _0x5da5ce;var _0x5a5e2d=squel['select']();_0x5a5e2d[_0x5869('0x69')](_0x37793f[_0x5869('0x6a')]);for(var _0x5289f2=0x0;_0x5289f2<_0x345e5c[_0x5869('0x33')];_0x5289f2+=0x1){_0x5da5ce=_0x345e5c[_0x5289f2][_0x5869('0x6b')]?_0x37a114[_0x345e5c[_0x5289f2][_0x5869('0x6b')]]['metric']:_0x345e5c[_0x5289f2][_0x5869('0x60')];_0x5da5ce=_0x345e5c[_0x5289f2][_0x5869('0x6d')]?_[_0x5869('0x6e')](_0xe3239f[_0x345e5c[_0x5289f2]['function']],'%s',_0x5da5ce):_0x5da5ce;_0x5da5ce=_0x345e5c[_0x5289f2][_0x5869('0x6f')]?_[_0x5869('0x6e')](_0x216547[_0x345e5c[_0x5289f2]['format']],'%s',_0x5da5ce):_0x5da5ce;if(_0x345e5c[_0x5289f2][_0x5869('0x70')]){_0x5a5e2d[_0x5869('0x5f')](_0x5da5ce);}_0x345e5c[_0x5289f2]['orderBy']&&_0x5a5e2d['order'](_0x5da5ce,_0x345e5c[_0x5289f2]['orderBy']===_0x5869('0x73')?![]:!![]);_0x5a5e2d[_0x5869('0x60')](_0x5da5ce,_0x345e5c[_0x5289f2][_0x5869('0x74')]||_0x5da5ce);}if(_0x37793f[_0x5869('0x75')]){_0x37793f[_0x5869('0x75')]=JSON['parse'](_0x37793f[_0x5869('0x75')]);for(var _0x5be988=0x0;_0x5be988<_0x37793f['joins'][_0x5869('0x33')];_0x5be988+=0x1){if(_0x37793f[_0x5869('0x75')][_0x5be988]['type']&&_[_0x5869('0x5a')](_0x4db90a,_0x37793f[_0x5869('0x75')][_0x5be988]['type'])&&_0x37793f[_0x5869('0x75')][_0x5be988]['parentKey']&&_0x37793f[_0x5869('0x75')][_0x5be988][_0x5869('0x77')]&&_0x37793f[_0x5869('0x75')][_0x5be988][_0x5869('0x79')]){_0x5a5e2d[_0x37793f[_0x5869('0x75')][_0x5be988]['type']](_0x37793f[_0x5869('0x75')][_0x5be988][_0x5869('0x77')],null,util[_0x5869('0x6f')](_0x5869('0x78'),_0x37793f[_0x5869('0x6a')],_0x37793f[_0x5869('0x75')][_0x5be988][_0x5869('0x76')],_0x37793f[_0x5869('0x75')][_0x5be988][_0x5869('0x77')],_0x37793f['joins'][_0x5be988][_0x5869('0x79')]));}}}if(_0x37793f['conditions']){_0x37793f[_0x5869('0x7a')]=JSON[_0x5869('0x7b')](_0x37793f[_0x5869('0x7a')]);_0x5a5e2d['where'](_0x26a73c(_0x37793f[_0x5869('0x7a')][_0x5869('0x5f')]));}_0x4a5f64=_0x5a5e2d[_0x5869('0x89')]();_0x5a5e2d['limit'](_0x1bb21a);_0x5a5e2d[_0x5869('0x19')](0x0);logger['debug'](_0x5869('0x7d'),_0x5a5e2d[_0x5869('0x7e')]());return dbH['sequelize']['query'](_0x5a5e2d[_0x5869('0x7e')](),{'type':dbH[_0x5869('0x7f')][_0x5869('0x80')][_0x5869('0x98')]});}})['then'](function(){return{'sql':_0x4a5f64[_0x5869('0x7e')]()};})[_0x5869('0x22')](respondWithResult(_0x36e269,null))[_0x5869('0x3f')](handleError(_0x36e269,null));}; \ No newline at end of file +var _0x10f7=['GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','Sequelize','AnalyticMetric','MetricId','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','select','countTable','COUNT(*)','run','runReport','COUNT(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','metric','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','catch','show','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','params','merge','getFields','ValidationErrorItem','findAll','keyBy','from','table','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','AVG(%s)'];(function(_0x44bdb7,_0x58b5ab){var _0xdb0274=function(_0x1381e6){while(--_0x1381e6){_0x44bdb7['push'](_0x44bdb7['shift']());}};_0xdb0274(++_0x58b5ab);}(_0x10f7,0xd0));var _0x710f=function(_0x119282,_0x14529d){_0x119282=_0x119282-0x0;var _0x24e67a=_0x10f7[_0x119282];return _0x24e67a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x710f('0x0'));var zipdir=require(_0x710f('0x1'));var jsonpatch=require(_0x710f('0x2'));var rp=require(_0x710f('0x3'));var moment=require(_0x710f('0x4'));var BPromise=require(_0x710f('0x5'));var Mustache=require(_0x710f('0x6'));var util=require('util');var path=require(_0x710f('0x7'));var sox=require('sox');var csv=require(_0x710f('0x8'));var ejs=require(_0x710f('0x9'));var fs=require('fs');var fs_extra=require(_0x710f('0xa'));var _=require(_0x710f('0xb'));var squel=require(_0x710f('0xc'));var crypto=require(_0x710f('0xd'));var jsforce=require(_0x710f('0xe'));var deskjs=require(_0x710f('0xf'));var toCsv=require(_0x710f('0x8'));var querystring=require(_0x710f('0x10'));var Papa=require(_0x710f('0x11'));var Redis=require(_0x710f('0x12'));var authService=require(_0x710f('0x13'));var qs=require(_0x710f('0x14'));var as=require(_0x710f('0x15'));var hardwareService=require(_0x710f('0x16'));var logger=require(_0x710f('0x17'))('api');var utils=require(_0x710f('0x18'));var config=require(_0x710f('0x19'));var licenseUtil=require(_0x710f('0x1a'));var db=require(_0x710f('0x1b'))['db'];var dbH=require('../../mysqldb')[_0x710f('0x1c')];function respondWithStatusCode(_0x9a751a,_0x4530e1){_0x4530e1=_0x4530e1||0xcc;return function(_0x33ced9){if(_0x33ced9){return _0x9a751a[_0x710f('0x1d')](_0x4530e1);}return _0x9a751a[_0x710f('0x1e')](_0x4530e1)['end']();};}function respondWithResult(_0x355dc4,_0x1c1710){_0x1c1710=_0x1c1710||0xc8;return function(_0x10e947){if(_0x10e947){return _0x355dc4[_0x710f('0x1e')](_0x1c1710)[_0x710f('0x1f')](_0x10e947);}};}function respondWithFilteredResult(_0x3de493,_0x421bea){return function(_0x1f4d4e){if(_0x1f4d4e){var _0x48665a=typeof _0x421bea['offset']===_0x710f('0x20')&&typeof _0x421bea[_0x710f('0x21')]===_0x710f('0x20');var _0x1509e1=_0x1f4d4e[_0x710f('0x22')];var _0x23142b=_0x48665a?0x0:_0x421bea[_0x710f('0x23')];var _0x59642e=_0x48665a?_0x1f4d4e[_0x710f('0x22')]:_0x421bea['offset']+_0x421bea[_0x710f('0x21')];var _0x5626c6;if(_0x59642e>=_0x1509e1){_0x59642e=_0x1509e1;_0x5626c6=0xc8;}else{_0x5626c6=0xce;}_0x3de493[_0x710f('0x1e')](_0x5626c6);return _0x3de493[_0x710f('0x24')](_0x710f('0x25'),_0x23142b+'-'+_0x59642e+'/'+_0x1509e1)[_0x710f('0x1f')](_0x1f4d4e);}return null;};}function patchUpdates(_0x599854){return function(_0xd5aa74){try{jsonpatch[_0x710f('0x26')](_0xd5aa74,_0x599854,!![]);}catch(_0x30c930){return BPromise[_0x710f('0x27')](_0x30c930);}return _0xd5aa74[_0x710f('0x28')]();};}function saveUpdates(_0x203abe,_0xa54fd1){return function(_0xe1692b){if(_0xe1692b){return _0xe1692b['update'](_0x203abe)[_0x710f('0x29')](function(_0x3cd575){return _0x3cd575;});}return null;};}function removeEntity(_0x51fbd1,_0x6b42ae){return function(_0x1a0b18){if(_0x1a0b18){return _0x1a0b18['destroy']()[_0x710f('0x29')](function(){var _0x4f0ebb=_0x1a0b18[_0x710f('0x2a')]({'plain':!![]});var _0x1920ac=_0x710f('0x2b');return db[_0x710f('0x2c')][_0x710f('0x2d')]({'where':{'type':_0x1920ac,'resourceId':_0x4f0ebb['id']}})[_0x710f('0x29')](function(){return _0x1a0b18;});})['then'](function(){_0x51fbd1[_0x710f('0x1e')](0xcc)[_0x710f('0x2e')]();});}};}function handleEntityNotFound(_0x4c39a6,_0x3bbcc1){return function(_0x1b843c){if(!_0x1b843c){_0x4c39a6['sendStatus'](0x194);}return _0x1b843c;};}function handleError(_0x3484dd,_0x39eab6){_0x39eab6=_0x39eab6||0x1f4;return function(_0x3c1b9f){logger[_0x710f('0x2f')](_0x3c1b9f[_0x710f('0x30')]);if(_0x3c1b9f['name']){delete _0x3c1b9f[_0x710f('0x31')];}_0x3484dd[_0x710f('0x1e')](_0x39eab6)[_0x710f('0x32')](_0x3c1b9f);};}exports[_0x710f('0x33')]=function(_0x6f8c46,_0x519f09){var _0x1fed2d={},_0x457b3f={},_0x593d66={'count':0x0,'rows':[]};var _0x151df6=_[_0x710f('0x34')](db[_0x710f('0x35')][_0x710f('0x36')],function(_0x51efaf){return{'name':_0x51efaf['fieldName'],'type':_0x51efaf[_0x710f('0x37')][_0x710f('0x38')]};});_0x457b3f[_0x710f('0x39')]=_['map'](_0x151df6,_0x710f('0x31'));_0x457b3f[_0x710f('0x3a')]=_[_0x710f('0x3b')](_0x6f8c46[_0x710f('0x3a')]);_0x457b3f[_0x710f('0x3c')]=_[_0x710f('0x3d')](_0x457b3f[_0x710f('0x39')],_0x457b3f['query']);_0x1fed2d['attributes']=_[_0x710f('0x3d')](_0x457b3f[_0x710f('0x39')],qs['fields'](_0x6f8c46['query'][_0x710f('0x3e')]));_0x1fed2d[_0x710f('0x3f')]=_0x1fed2d[_0x710f('0x3f')][_0x710f('0x40')]?_0x1fed2d[_0x710f('0x3f')]:_0x457b3f[_0x710f('0x39')];if(!_0x6f8c46[_0x710f('0x3a')][_0x710f('0x41')](_0x710f('0x42'))){_0x1fed2d[_0x710f('0x21')]=qs[_0x710f('0x21')](_0x6f8c46['query'][_0x710f('0x21')]);_0x1fed2d[_0x710f('0x23')]=qs[_0x710f('0x23')](_0x6f8c46[_0x710f('0x3a')][_0x710f('0x23')]);}_0x1fed2d['order']=qs[_0x710f('0x43')](_0x6f8c46['query'][_0x710f('0x43')]);_0x1fed2d[_0x710f('0x44')]=qs[_0x710f('0x3c')](_[_0x710f('0x45')](_0x6f8c46[_0x710f('0x3a')],_0x457b3f[_0x710f('0x3c')]),_0x151df6);if(_0x6f8c46[_0x710f('0x3a')][_0x710f('0x46')]){_0x1fed2d[_0x710f('0x44')]=_['merge'](_0x1fed2d[_0x710f('0x44')],{'$or':_[_0x710f('0x34')](_0x151df6,function(_0x130379){if(_0x130379[_0x710f('0x37')]!==_0x710f('0x47')){var _0x1071b4={};_0x1071b4[_0x130379[_0x710f('0x31')]]={'$like':'%'+_0x6f8c46[_0x710f('0x3a')][_0x710f('0x46')]+'%'};return _0x1071b4;}})});}_0x1fed2d=_['merge']({},_0x1fed2d,_0x6f8c46[_0x710f('0x48')]);var _0x256db0={'where':_0x1fed2d['where']};return db['AnalyticCustomReport'][_0x710f('0x22')](_0x256db0)[_0x710f('0x29')](function(_0x4c64fa){_0x593d66['count']=_0x4c64fa;if(_0x6f8c46[_0x710f('0x3a')]['includeAll']){_0x1fed2d[_0x710f('0x49')]=[{'all':!![]}];}return db[_0x710f('0x35')]['findAll'](_0x1fed2d);})['then'](function(_0x17bfe7){_0x593d66['rows']=_0x17bfe7;return _0x593d66;})[_0x710f('0x29')](respondWithFilteredResult(_0x519f09,_0x1fed2d))[_0x710f('0x4a')](handleError(_0x519f09,null));};exports[_0x710f('0x4b')]=function(_0x4993f8,_0x5899b1){var _0x42715b={'raw':![],'where':{'id':_0x4993f8['params']['id']}},_0x53c78a={};_0x53c78a[_0x710f('0x39')]=_[_0x710f('0x3b')](db[_0x710f('0x35')]['rawAttributes']);_0x53c78a[_0x710f('0x3a')]=_[_0x710f('0x3b')](_0x4993f8[_0x710f('0x3a')]);_0x53c78a['filters']=_[_0x710f('0x3d')](_0x53c78a[_0x710f('0x39')],_0x53c78a['query']);_0x42715b['attributes']=_[_0x710f('0x3d')](_0x53c78a[_0x710f('0x39')],qs['fields'](_0x4993f8[_0x710f('0x3a')][_0x710f('0x3e')]));_0x42715b['attributes']=_0x42715b[_0x710f('0x3f')]['length']?_0x42715b[_0x710f('0x3f')]:_0x53c78a['model'];if(_0x4993f8[_0x710f('0x3a')][_0x710f('0x4c')]){_0x42715b['include']=[{'all':!![]}];}_0x42715b=_['merge']({},_0x42715b,_0x4993f8[_0x710f('0x48')]);return db[_0x710f('0x35')][_0x710f('0x4d')](_0x42715b)['then'](handleEntityNotFound(_0x5899b1,null))[_0x710f('0x29')](respondWithResult(_0x5899b1,null))[_0x710f('0x4a')](handleError(_0x5899b1,null));};exports[_0x710f('0x4e')]=function(_0x54cb01,_0x1fbfd2){return db[_0x710f('0x35')][_0x710f('0x4e')](_0x54cb01['body'],{})[_0x710f('0x29')](function(_0xba093b){var _0x2f80b6=_0x54cb01['user'][_0x710f('0x2a')]({'plain':!![]});if(!_0x2f80b6)throw new Error(_0x710f('0x4f'));if(_0x2f80b6[_0x710f('0x50')]==='user'){var _0x4895aa=_0xba093b[_0x710f('0x2a')]({'plain':!![]});var _0x2b486e='Reports';return db[_0x710f('0x51')]['find']({'where':{'name':_0x2b486e,'userProfileId':_0x2f80b6[_0x710f('0x52')]},'raw':!![]})[_0x710f('0x29')](function(_0x5e12c8){if(_0x5e12c8&&_0x5e12c8[_0x710f('0x53')]===0x0){return db[_0x710f('0x2c')][_0x710f('0x4e')]({'name':_0x4895aa[_0x710f('0x31')],'resourceId':_0x4895aa['id'],'type':'CustomReports','sectionId':_0x5e12c8['id']},{})['then'](function(){return _0xba093b;});}else{return _0xba093b;}})[_0x710f('0x4a')](function(_0x5278de){logger[_0x710f('0x2f')](_0x710f('0x54'),_0x5278de);throw _0x5278de;});}return _0xba093b;})[_0x710f('0x29')](respondWithResult(_0x1fbfd2,0xc9))[_0x710f('0x4a')](handleError(_0x1fbfd2,null));};exports[_0x710f('0x55')]=function(_0x481b39,_0x3641d9){if(_0x481b39['body']['id']){delete _0x481b39['body']['id'];}return db[_0x710f('0x35')][_0x710f('0x4d')]({'where':{'id':_0x481b39['params']['id']}})[_0x710f('0x29')](handleEntityNotFound(_0x3641d9,null))[_0x710f('0x29')](saveUpdates(_0x481b39['body'],null))[_0x710f('0x29')](respondWithResult(_0x3641d9,null))[_0x710f('0x4a')](handleError(_0x3641d9,null));};exports[_0x710f('0x2d')]=function(_0x18cb73,_0x4941b6){return db[_0x710f('0x35')][_0x710f('0x4d')]({'where':{'id':_0x18cb73['params']['id']}})[_0x710f('0x29')](handleEntityNotFound(_0x4941b6,null))[_0x710f('0x29')](removeEntity(_0x4941b6,null))[_0x710f('0x4a')](handleError(_0x4941b6,null));};exports[_0x710f('0x56')]=function(_0x25cc5e,_0x9dd3ae){var _0xe59da9=0xa;var _0x520b1f=[_0x710f('0x57'),'left_join','right_join',_0x710f('0x58')];var _0x302bb9={'SUM':_0x710f('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x710f('0x5a'),'MAX':_0x710f('0x5b'),'MIN':_0x710f('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x710f('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x710f('0x5e')};var _0x21a6ff={'SEC_TO_TIME':_0x710f('0x5f'),'DATE':_0x710f('0x60'),'HOUR':_0x710f('0x61'),'ROUND':_0x710f('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5e7442=function(_0x280d46){return!_[_0x710f('0x63')]([_0x710f('0x64'),_0x710f('0x65'),_0x710f('0x66'),_0x710f('0x67')],_0x280d46);};var _0x4a0bf9=function(_0x279196){if(!_0x279196||!_0x279196['rules'][_0x710f('0x40')]){return'';}for(var _0xa0b81b='(',_0x496cc1=0x0;_0x496cc1<_0x279196[_0x710f('0x68')][_0x710f('0x40')];_0x496cc1+=0x1){_0x496cc1>0x0&&(_0xa0b81b+='\x20'+_0x279196['operator']+'\x20');_0xa0b81b+=_0x279196[_0x710f('0x68')][_0x496cc1]['group']?_0x4a0bf9(_0x279196[_0x710f('0x68')][_0x496cc1][_0x710f('0x69')]):_0x279196[_0x710f('0x68')][_0x496cc1]['field']+'\x20'+_0x279196[_0x710f('0x68')][_0x496cc1]['condition']+(_0x5e7442(_0x279196[_0x710f('0x68')][_0x496cc1][_0x710f('0x6a')])?'\x20'+_0x279196[_0x710f('0x68')][_0x496cc1][_0x710f('0x6b')]:'');}return _0xa0b81b+')';};var _0x88e46f={'where':{'id':_0x25cc5e[_0x710f('0x6c')]['id']}},_0x265f1c,_0x2812fc,_0x5418bb,_0x40f4b5,_0x13c5ea;_0x88e46f=_[_0x710f('0x6d')]({},_0x88e46f,_0x25cc5e[_0x710f('0x48')]);return db[_0x710f('0x35')][_0x710f('0x4d')](_0x88e46f)[_0x710f('0x29')](function(_0x5a60e7){if(_0x5a60e7){_0x265f1c=_0x5a60e7;return _0x5a60e7[_0x710f('0x6e')]();}return null;})[_0x710f('0x29')](function(_0x1390c){if(_0x1390c){if(!_0x1390c[_0x710f('0x40')]){throw new db['Sequelize'][(_0x710f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2812fc=_0x1390c;return db['AnalyticMetric'][_0x710f('0x70')]({'raw':!![]});}return null;})[_0x710f('0x29')](function(_0x4f22e3){if(_0x4f22e3){_0x5418bb=_[_0x710f('0x71')](_0x4f22e3,'id');var _0x3dcf0f;var _0x52092e=squel['select']();_0x52092e[_0x710f('0x72')](_0x265f1c[_0x710f('0x73')]);for(var _0x37e580=0x0;_0x37e580<_0x2812fc[_0x710f('0x40')];_0x37e580+=0x1){_0x3dcf0f=_0x2812fc[_0x37e580]['MetricId']?_0x5418bb[_0x2812fc[_0x37e580]['MetricId']]['metric']:_0x2812fc[_0x37e580]['field'];_0x3dcf0f=_0x2812fc[_0x37e580][_0x710f('0x74')]?_[_0x710f('0x75')](_0x302bb9[_0x2812fc[_0x37e580][_0x710f('0x74')]],'%s',_0x3dcf0f):_0x3dcf0f;_0x3dcf0f=_0x2812fc[_0x37e580][_0x710f('0x76')]?_['replace'](_0x21a6ff[_0x2812fc[_0x37e580][_0x710f('0x76')]],'%s',_0x3dcf0f):_0x3dcf0f;if(_0x2812fc[_0x37e580][_0x710f('0x77')]){_0x52092e[_0x710f('0x69')](_0x3dcf0f);}_0x2812fc[_0x37e580][_0x710f('0x78')]&&_0x52092e[_0x710f('0x79')](_0x3dcf0f,_0x2812fc[_0x37e580][_0x710f('0x78')]===_0x710f('0x7a')?![]:!![]);_0x52092e[_0x710f('0x7b')](_0x3dcf0f,_0x2812fc[_0x37e580][_0x710f('0x7c')]||_0x3dcf0f);}if(_0x265f1c[_0x710f('0x7d')]){_0x265f1c[_0x710f('0x7d')]=JSON[_0x710f('0x7e')](_0x265f1c[_0x710f('0x7d')]);for(var _0x213fef=0x0;_0x213fef<_0x265f1c[_0x710f('0x7d')][_0x710f('0x40')];_0x213fef+=0x1){if(_0x265f1c['joins'][_0x213fef][_0x710f('0x37')]&&_[_0x710f('0x63')](_0x520b1f,_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x37')])&&_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x7f')]&&_0x265f1c[_0x710f('0x7d')][_0x213fef]['foreignTable']&&_0x265f1c['joins'][_0x213fef][_0x710f('0x80')]){_0x52092e[_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x37')]](_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x81')],null,util[_0x710f('0x76')]('%s.%s\x20=\x20%s.%s',_0x265f1c['table'],_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x7f')],_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x81')],_0x265f1c[_0x710f('0x7d')][_0x213fef][_0x710f('0x80')]));}}}if(_0x265f1c[_0x710f('0x82')]){_0x265f1c[_0x710f('0x82')]=JSON['parse'](_0x265f1c[_0x710f('0x82')]);_0x52092e['where'](_0x4a0bf9(_0x265f1c['conditions'][_0x710f('0x69')]));}_0x13c5ea=_0x52092e[_0x710f('0x83')]();_0x52092e[_0x710f('0x21')](_0xe59da9);_0x52092e[_0x710f('0x23')](0x0);logger['debug'](_0x710f('0x84'),_0x52092e[_0x710f('0x85')]());return dbH['sequelize'][_0x710f('0x3a')](_0x52092e[_0x710f('0x85')](),{'type':dbH[_0x710f('0x86')][_0x710f('0x87')][_0x710f('0x88')]});}})[_0x710f('0x29')](respondWithResult(_0x9dd3ae,null))[_0x710f('0x4a')](handleError(_0x9dd3ae,null));};function runReport(_0xc5ea80,_0xc70ff8,_0x472929){var _0x5e4d1f=_0xc70ff8[_0x710f('0x31')];var _0x2fa9a0=0xa;var _0x31c91b=[_0x710f('0x57'),_0x710f('0x89'),_0x710f('0x8a'),_0x710f('0x58')];var _0x2ee577={'SUM':_0x710f('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x710f('0x5b'),'MIN':'MIN(%s)','AVG':_0x710f('0x8b'),'GROUP_CONCAT':_0x710f('0x5d'),'GROUP_CONCAT ASC':_0x710f('0x8c'),'GROUP_CONCAT DESC':_0x710f('0x5e')};var _0x5b64fc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x710f('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x710f('0x8d')};var _0x3d17f0=function(_0x556c37){return!_['includes']([_0x710f('0x64'),_0x710f('0x65'),_0x710f('0x66'),_0x710f('0x67')],_0x556c37);};var _0x2bd476=function(_0x44331e){if(!_0x44331e||!_0x44331e[_0x710f('0x68')][_0x710f('0x40')]){return'';}for(var _0x416a74='(',_0x16c56e=0x0;_0x16c56e<_0x44331e['rules'][_0x710f('0x40')];_0x16c56e+=0x1){_0x16c56e>0x0&&(_0x416a74+='\x20'+_0x44331e['operator']+'\x20');_0x416a74+=_0x44331e[_0x710f('0x68')][_0x16c56e]['group']?_0x2bd476(_0x44331e[_0x710f('0x68')][_0x16c56e][_0x710f('0x69')]):_0x44331e[_0x710f('0x68')][_0x16c56e]['field']+'\x20'+_0x44331e[_0x710f('0x68')][_0x16c56e][_0x710f('0x6a')]+(_0x3d17f0(_0x44331e[_0x710f('0x68')][_0x16c56e][_0x710f('0x6a')])?'\x20'+_0x44331e[_0x710f('0x68')][_0x16c56e][_0x710f('0x6b')]:'');}return _0x416a74+')';};var _0x508815={'where':{'id':_0xc5ea80['id']}},_0x24bb66,_0x29caa2,_0x4341e9,_0x28c638,_0x46b670;_0x508815=_['merge']({},_0x508815,_0x472929);return db[_0x710f('0x35')]['find'](_0x508815)[_0x710f('0x29')](function(_0x19b8bd){if(_0x19b8bd){_0x24bb66=_0x19b8bd;return _0x19b8bd[_0x710f('0x6e')]();}return null;})[_0x710f('0x29')](function(_0x49e109){if(_0x49e109){if(!_0x49e109[_0x710f('0x40')]){throw new db[(_0x710f('0x8e'))][(_0x710f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x29caa2=_0x49e109;return db[_0x710f('0x8f')][_0x710f('0x70')]({'raw':!![]});}return null;})[_0x710f('0x29')](function(_0x1b8729){if(_0x1b8729){_0x4341e9=_['keyBy'](_0x1b8729,'id');var _0x2ed388;var _0x1920a6=squel['select']();_0x1920a6[_0x710f('0x72')](_0x24bb66[_0x710f('0x73')]);for(var _0x178d4a=0x0;_0x178d4a<_0x29caa2[_0x710f('0x40')];_0x178d4a+=0x1){_0x2ed388=_0x29caa2[_0x178d4a][_0x710f('0x90')]?_0x4341e9[_0x29caa2[_0x178d4a][_0x710f('0x90')]]['metric']:_0x29caa2[_0x178d4a][_0x710f('0x7b')];_0x2ed388=_0x29caa2[_0x178d4a][_0x710f('0x74')]?_[_0x710f('0x75')](_0x2ee577[_0x29caa2[_0x178d4a][_0x710f('0x74')]],'%s',_0x2ed388):_0x2ed388;_0x2ed388=_0x29caa2[_0x178d4a]['format']?_[_0x710f('0x75')](_0x5b64fc[_0x29caa2[_0x178d4a]['format']],'%s',_0x2ed388):_0x2ed388;if(_0x29caa2[_0x178d4a]['groupBy']){_0x1920a6['group'](_0x2ed388);}_0x29caa2[_0x178d4a]['orderBy']&&_0x1920a6[_0x710f('0x79')](_0x2ed388,_0x29caa2[_0x178d4a][_0x710f('0x78')]===_0x710f('0x7a')?![]:!![]);_0x1920a6[_0x710f('0x7b')](_0x2ed388,_0x29caa2[_0x178d4a][_0x710f('0x7c')]||_0x2ed388);}if(_0x24bb66[_0x710f('0x7d')]){_0x24bb66[_0x710f('0x7d')]=JSON[_0x710f('0x7e')](_0x24bb66[_0x710f('0x7d')]);for(var _0x1356e9=0x0;_0x1356e9<_0x24bb66['joins'][_0x710f('0x40')];_0x1356e9+=0x1){if(_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x37')]&&_[_0x710f('0x63')](_0x31c91b,_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x37')])&&_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x7f')]&&_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x81')]&&_0x24bb66['joins'][_0x1356e9][_0x710f('0x80')]){_0x1920a6[_0x24bb66['joins'][_0x1356e9][_0x710f('0x37')]](_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x81')],null,util[_0x710f('0x76')](_0x710f('0x91'),_0x24bb66[_0x710f('0x73')],_0x24bb66[_0x710f('0x7d')][_0x1356e9]['parentKey'],_0x24bb66[_0x710f('0x7d')][_0x1356e9][_0x710f('0x81')],_0x24bb66['joins'][_0x1356e9][_0x710f('0x80')]));}}}if(_0x24bb66['conditions']){_0x24bb66[_0x710f('0x82')]=JSON['parse'](_0x24bb66[_0x710f('0x82')]);_0x1920a6['where'](_0x2bd476(_0x24bb66['conditions'][_0x710f('0x69')]));}_0x46b670=_0x1920a6[_0x710f('0x83')]();_0x1920a6[_0x710f('0x21')](_0x2fa9a0);_0x1920a6[_0x710f('0x23')](0x0);return;}})[_0x710f('0x29')](function(){if(_0xc70ff8[_0x710f('0x92')]===_0x710f('0x93')){return null;}var _0x19bff3=_[_0x710f('0x6d')](_0xc70ff8,{'name':_0xc70ff8['fullPath']||_0xc70ff8[_0x710f('0x31')]||_0x24bb66['name'],'basename':_0x5e4d1f,'savename':util['format'](_0x710f('0x94'),_0xc70ff8[_0x710f('0x31')]||_0x24bb66[_0x710f('0x31')],require(_0x710f('0x95'))[_0x710f('0x96')](0x4),_0xc70ff8['output']||_0x710f('0x97')),'reportId':_0x24bb66['id'],'reportType':_0x710f('0x98')});return db[_0x710f('0x99')][_0x710f('0x4e')](_0x19bff3,{'raw':!![]});})[_0x710f('0x29')](function(_0x3dd677){if(_0x24bb66[_0x710f('0x73')]===_0x710f('0x9a')){_0x46b670['where'](_0x24bb66[_0x710f('0x73')]+_0x710f('0x9b'),_0xc70ff8[_0x710f('0x9c')],_0xc70ff8[_0x710f('0x9d')]);}else{_0x46b670[_0x710f('0x44')](_0x24bb66[_0x710f('0x73')]+_0x710f('0x9e'),_0xc70ff8[_0x710f('0x9c')],_0xc70ff8[_0x710f('0x9d')]);}if(_0x3dd677){logger[_0x710f('0x9f')]('Run\x20Query:',_0x46b670[_0x710f('0x85')]());require(_0x710f('0xa0'))[_0x710f('0xa1')](path['join'](__dirname,_0x710f('0xa2'),_0x3dd677[_0x710f('0x92')]),[_0x3dd677['id'],_0x46b670[_0x710f('0x85')](),path['join'](__dirname,_0x710f('0xa3'),_0x3dd677['savename']),_0x5e4d1f]);return _0x3dd677;}else{var _0x3a5192=squel[_0x710f('0xa4')]();_0x3a5192[_0x710f('0x72')]('('+_0x46b670[_0x710f('0x85')]()+')',_0x710f('0xa5'));_0x3a5192['field'](_0x710f('0xa6'),'count');_0x46b670[_0x710f('0x21')](_0xc70ff8[_0x710f('0x21')]||_0x2fa9a0);_0x46b670[_0x710f('0x23')](_0xc70ff8[_0x710f('0x23')]||0x0);return dbH[_0x710f('0x86')]['query'](_0x3a5192[_0x710f('0x85')](),{'type':dbH['sequelize'][_0x710f('0x87')][_0x710f('0x88')]})[_0x710f('0x29')](function(_0x298dab){if(!_0x298dab[_0x710f('0x40')]){_0x28c638=0x0;}else{_0x28c638=_0x298dab[0x0][_0x710f('0x22')]||0x0;}return dbH[_0x710f('0x86')][_0x710f('0x3a')](_0x46b670['toString'](),{'type':dbH[_0x710f('0x86')][_0x710f('0x87')]['SELECT']});})[_0x710f('0x29')](function(_0x3e85c5){return{'rows':_0x3e85c5||[],'count':_0x28c638};});}});}exports[_0x710f('0xa7')]=function(_0x30a64a,_0x4b1524){return runReport(_0x30a64a[_0x710f('0x6c')],_0x30a64a[_0x710f('0x3a')],_0x30a64a['options'])[_0x710f('0x29')](respondWithResult(_0x4b1524,null))[_0x710f('0x4a')](handleError(_0x4b1524,null));};exports[_0x710f('0xa8')]=runReport;exports[_0x710f('0x3a')]=function(_0x3986e0,_0x4088cf){var _0x316598=0xa;var _0x1c8cf0=['join',_0x710f('0x89'),_0x710f('0x8a'),_0x710f('0x58')];var _0x52ceac={'SUM':_0x710f('0x59'),'COUNT':_0x710f('0xa9'),'COUNT DISTINCT':_0x710f('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x710f('0x5d'),'GROUP_CONCAT ASC':_0x710f('0x8c'),'GROUP_CONCAT DESC':_0x710f('0x5e')};var _0x40fca7={'SEC_TO_TIME':_0x710f('0x5f'),'DATE':_0x710f('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x710f('0x62'),'UNIX_TIMESTAMP':_0x710f('0x8d')};var _0x3c47c0=function(_0x3123c9){return!_[_0x710f('0x63')](['IS\x20NULL',_0x710f('0x65'),_0x710f('0x66'),_0x710f('0x67')],_0x3123c9);};var _0x45c954=function(_0xc3583a){if(!_0xc3583a||!_0xc3583a[_0x710f('0x68')][_0x710f('0x40')]){return'';}for(var _0x4dd34b='(',_0x5ed03f=0x0;_0x5ed03f<_0xc3583a[_0x710f('0x68')][_0x710f('0x40')];_0x5ed03f+=0x1){_0x5ed03f>0x0&&(_0x4dd34b+='\x20'+_0xc3583a[_0x710f('0xaa')]+'\x20');_0x4dd34b+=_0xc3583a[_0x710f('0x68')][_0x5ed03f][_0x710f('0x69')]?_0x45c954(_0xc3583a[_0x710f('0x68')][_0x5ed03f][_0x710f('0x69')]):_0xc3583a[_0x710f('0x68')][_0x5ed03f][_0x710f('0x7b')]+'\x20'+_0xc3583a[_0x710f('0x68')][_0x5ed03f][_0x710f('0x6a')]+(_0x3c47c0(_0xc3583a['rules'][_0x5ed03f][_0x710f('0x6a')])?'\x20'+_0xc3583a['rules'][_0x5ed03f][_0x710f('0x6b')]:'');}return _0x4dd34b+')';};var _0x2c30a0={'where':{'id':_0x3986e0[_0x710f('0x6c')]['id']}},_0x3ed9b9,_0x5f54ff,_0x2b10d6,_0x37cabb,_0x2a8b97;_0x2c30a0=_[_0x710f('0x6d')]({},_0x2c30a0,_0x3986e0[_0x710f('0x48')]);return db['AnalyticCustomReport'][_0x710f('0x4d')](_0x2c30a0)[_0x710f('0x29')](function(_0x5d2e47){if(_0x5d2e47){_0x3ed9b9=_0x5d2e47;return _0x5d2e47[_0x710f('0x6e')]();}return null;})[_0x710f('0x29')](function(_0x4a383d){if(_0x4a383d){if(!_0x4a383d['length']){throw new db[(_0x710f('0x8e'))]['ValidationErrorItem'](_0x710f('0xab'),0x193);}_0x5f54ff=_0x4a383d;return db[_0x710f('0x8f')][_0x710f('0x70')]({'raw':!![]});}return null;})[_0x710f('0x29')](function(_0x250091){if(_0x250091){_0x2b10d6=_[_0x710f('0x71')](_0x250091,'id');var _0x4e6f32;var _0x576399=squel['select']();_0x576399[_0x710f('0x72')](_0x3ed9b9[_0x710f('0x73')]);for(var _0x104070=0x0;_0x104070<_0x5f54ff[_0x710f('0x40')];_0x104070+=0x1){_0x4e6f32=_0x5f54ff[_0x104070][_0x710f('0x90')]?_0x2b10d6[_0x5f54ff[_0x104070][_0x710f('0x90')]][_0x710f('0xac')]:_0x5f54ff[_0x104070][_0x710f('0x7b')];_0x4e6f32=_0x5f54ff[_0x104070][_0x710f('0x74')]?_[_0x710f('0x75')](_0x52ceac[_0x5f54ff[_0x104070]['function']],'%s',_0x4e6f32):_0x4e6f32;_0x4e6f32=_0x5f54ff[_0x104070][_0x710f('0x76')]?_[_0x710f('0x75')](_0x40fca7[_0x5f54ff[_0x104070][_0x710f('0x76')]],'%s',_0x4e6f32):_0x4e6f32;if(_0x5f54ff[_0x104070]['groupBy']){_0x576399[_0x710f('0x69')](_0x4e6f32);}_0x5f54ff[_0x104070]['orderBy']&&_0x576399['order'](_0x4e6f32,_0x5f54ff[_0x104070]['orderBy']===_0x710f('0x7a')?![]:!![]);_0x576399['field'](_0x4e6f32,_0x5f54ff[_0x104070][_0x710f('0x7c')]||_0x4e6f32);}if(_0x3ed9b9['joins']){_0x3ed9b9['joins']=JSON[_0x710f('0x7e')](_0x3ed9b9['joins']);for(var _0x15d6d6=0x0;_0x15d6d6<_0x3ed9b9[_0x710f('0x7d')][_0x710f('0x40')];_0x15d6d6+=0x1){if(_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6][_0x710f('0x37')]&&_['includes'](_0x1c8cf0,_0x3ed9b9['joins'][_0x15d6d6][_0x710f('0x37')])&&_0x3ed9b9['joins'][_0x15d6d6][_0x710f('0x7f')]&&_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6]['foreignTable']&&_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6]['foreignKey']){_0x576399[_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6][_0x710f('0x37')]](_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6]['foreignTable'],null,util['format'](_0x710f('0x91'),_0x3ed9b9[_0x710f('0x73')],_0x3ed9b9[_0x710f('0x7d')][_0x15d6d6][_0x710f('0x7f')],_0x3ed9b9['joins'][_0x15d6d6][_0x710f('0x81')],_0x3ed9b9['joins'][_0x15d6d6][_0x710f('0x80')]));}}}if(_0x3ed9b9[_0x710f('0x82')]){_0x3ed9b9[_0x710f('0x82')]=JSON[_0x710f('0x7e')](_0x3ed9b9['conditions']);_0x576399['where'](_0x45c954(_0x3ed9b9[_0x710f('0x82')][_0x710f('0x69')]));}_0x2a8b97=_0x576399[_0x710f('0x83')]();_0x576399[_0x710f('0x21')](_0x316598);_0x576399[_0x710f('0x23')](0x0);logger[_0x710f('0xad')]('Limited\x20Query:',_0x576399[_0x710f('0x85')]());return dbH[_0x710f('0x86')][_0x710f('0x3a')](_0x576399['toString'](),{'type':dbH['sequelize'][_0x710f('0x87')][_0x710f('0x88')]});}})['then'](function(){return{'sql':_0x2a8b97[_0x710f('0x85')]()};})['then'](respondWithResult(_0x4088cf,null))['catch'](handleError(_0x4088cf,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4fe6de3..6590e01 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 _0x84d9=['AnalyticCustomReport','analytics_custom_reports','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x84d9,0x6e));var _0x984d=function(_0x400927,_0x2bf6f1){_0x400927=_0x400927-0x0;var _0x576d6e=_0x84d9[_0x400927];return _0x576d6e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x984d('0x0'));var BPromise=require('bluebird');var rp=require(_0x984d('0x1'));var fs=require('fs');var path=require(_0x984d('0x2'));var rimraf=require(_0x984d('0x3'));var config=require(_0x984d('0x4'));var attributes=require(_0x984d('0x5'));module['exports']=function(_0x5f2c76,_0x1c6443){return _0x5f2c76[_0x984d('0x6')](_0x984d('0x7'),attributes,{'tableName':_0x984d('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf37f=['util','../../config/logger','api','moment','request-promise','rimraf','exports','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x4b332a,_0x5ec2db){var _0x115a04=function(_0x422160){while(--_0x422160){_0x4b332a['push'](_0x4b332a['shift']());}};_0x115a04(++_0x5ec2db);}(_0xf37f,0xe5));var _0xff37=function(_0x26dc85,_0x125f6c){_0x26dc85=_0x26dc85-0x0;var _0x1b7ff7=_0xf37f[_0x26dc85];return _0x1b7ff7;};'use strict';var _=require(_0xff37('0x0'));var util=require(_0xff37('0x1'));var logger=require(_0xff37('0x2'))(_0xff37('0x3'));var moment=require(_0xff37('0x4'));var BPromise=require('bluebird');var rp=require(_0xff37('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff37('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xff37('0x7')]=function(_0x34f72c,_0x3e6efd){return _0x34f72c['define'](_0xff37('0x8'),attributes,{'tableName':_0xff37('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 60d96e1..2e1d664 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 _0x6ec4=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6ec4,0x9d));var _0x46ec=function(_0x2a4cc6,_0x3ed438){_0x2a4cc6=_0x2a4cc6-0x0;var _0x381547=_0x6ec4[_0x2a4cc6];return _0x381547;};'use strict';var _=require(_0x46ec('0x0'));var util=require(_0x46ec('0x1'));var moment=require(_0x46ec('0x2'));var BPromise=require(_0x46ec('0x3'));var rs=require(_0x46ec('0x4'));var fs=require('fs');var Redis=require(_0x46ec('0x5'));var db=require(_0x46ec('0x6'))['db'];var utils=require(_0x46ec('0x7'));var logger=require('../../config/logger')(_0x46ec('0x8'));var config=require(_0x46ec('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x418b0f,_0x1b7b7b,_0x136ec3){return new BPromise(function(_0x40c577,_0x2b46b1){return client[_0x46ec('0xb')](_0x418b0f,_0x136ec3)[_0x46ec('0xc')](function(_0x139972){logger[_0x46ec('0xd')](_0x46ec('0xe'),_0x1b7b7b,_0x46ec('0xf'));logger[_0x46ec('0x10')](_0x46ec('0x11'),_0x1b7b7b,_0x46ec('0xf'),JSON[_0x46ec('0x12')](_0x139972));if(_0x139972[_0x46ec('0x13')]){if(_0x139972[_0x46ec('0x13')][_0x46ec('0x14')]===0x1f4){logger['error'](_0x46ec('0xe'),_0x1b7b7b,_0x139972[_0x46ec('0x13')][_0x46ec('0x15')]);return _0x2b46b1(_0x139972[_0x46ec('0x13')][_0x46ec('0x15')]);}logger[_0x46ec('0x13')](_0x46ec('0xe'),_0x1b7b7b,_0x139972[_0x46ec('0x13')]['message']);return _0x40c577(_0x139972[_0x46ec('0x13')][_0x46ec('0x15')]);}else{logger['info'](_0x46ec('0xe'),_0x1b7b7b,'request\x20sent');_0x40c577(_0x139972[_0x46ec('0x16')][_0x46ec('0x15')]);}})[_0x46ec('0x17')](function(_0x461f9b){logger[_0x46ec('0x13')](_0x46ec('0xe'),_0x1b7b7b,_0x461f9b);_0x2b46b1(_0x461f9b);});});} \ No newline at end of file +var _0x1657=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1657,0x193));var _0x7165=function(_0x255842,_0x2f59ea){_0x255842=_0x255842-0x0;var _0x4d682f=_0x1657[_0x255842];return _0x4d682f;};'use strict';var _=require(_0x7165('0x0'));var util=require(_0x7165('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7165('0x2'));var fs=require('fs');var Redis=require(_0x7165('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7165('0x4'));var logger=require(_0x7165('0x5'))(_0x7165('0x6'));var config=require(_0x7165('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7165('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30199b,_0x228f74,_0x3525e0){return new BPromise(function(_0x1b2111,_0x314fbf){return client[_0x7165('0x9')](_0x30199b,_0x3525e0)[_0x7165('0xa')](function(_0x5bab71){logger[_0x7165('0xb')](_0x7165('0xc'),_0x228f74,_0x7165('0xd'));logger[_0x7165('0xe')](_0x7165('0xf'),_0x228f74,_0x7165('0xd'),JSON[_0x7165('0x10')](_0x5bab71));if(_0x5bab71[_0x7165('0x11')]){if(_0x5bab71[_0x7165('0x11')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x228f74,_0x5bab71[_0x7165('0x11')]['message']);return _0x314fbf(_0x5bab71[_0x7165('0x11')][_0x7165('0x12')]);}logger[_0x7165('0x11')](_0x7165('0xc'),_0x228f74,_0x5bab71['error']['message']);return _0x1b2111(_0x5bab71[_0x7165('0x11')]['message']);}else{logger[_0x7165('0xb')](_0x7165('0xc'),_0x228f74,_0x7165('0xd'));_0x1b2111(_0x5bab71['result'][_0x7165('0x12')]);}})['catch'](function(_0x4543a7){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x228f74,_0x4543a7);_0x314fbf(_0x4543a7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 35d0143..0a66383 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 _0x76e7=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','query'];(function(_0x4f201a,_0x47a8ca){var _0x4ae05e=function(_0x9d9d74){while(--_0x9d9d74){_0x4f201a['push'](_0x4f201a['shift']());}};_0x4ae05e(++_0x47a8ca);}(_0x76e7,0x96));var _0x776e=function(_0x5c638f,_0x176046){_0x5c638f=_0x5c638f-0x0;var _0x5b8b44=_0x76e7[_0x5c638f];return _0x5b8b44;};'use strict';var multer=require('multer');var util=require(_0x776e('0x0'));var path=require(_0x776e('0x1'));var timeout=require(_0x776e('0x2'));var express=require(_0x776e('0x3'));var router=express[_0x776e('0x4')]();var fs_extra=require(_0x776e('0x5'));var auth=require(_0x776e('0x6'));var interaction=require(_0x776e('0x7'));var config=require(_0x776e('0x8'));var controller=require(_0x776e('0x9'));router[_0x776e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x776e('0xa')](_0x776e('0xb'),auth[_0x776e('0xc')](),controller['show']);router[_0x776e('0xa')](_0x776e('0xd'),auth[_0x776e('0xc')](),controller[_0x776e('0xe')]);router[_0x776e('0xa')](_0x776e('0xf'),auth[_0x776e('0xc')](),controller[_0x776e('0x10')]);router['get']('/:id/query',auth[_0x776e('0xc')](),controller[_0x776e('0x11')]);router[_0x776e('0x12')]('/',auth['isAuthenticated'](),controller[_0x776e('0x13')]);router[_0x776e('0x14')](_0x776e('0xb'),auth['isAuthenticated'](),controller[_0x776e('0x15')]);router['delete']('/:id',auth[_0x776e('0xc')](),controller[_0x776e('0x16')]);module[_0x776e('0x17')]=router; \ No newline at end of file +var _0x1bfa=['query','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1bfa,0xf6));var _0xa1bf=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x1bfa[_0x4ca6a4];return _0x120555;};'use strict';var multer=require(_0xa1bf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa1bf('0x1'));var express=require(_0xa1bf('0x2'));var router=express[_0xa1bf('0x3')]();var fs_extra=require(_0xa1bf('0x4'));var auth=require(_0xa1bf('0x5'));var interaction=require(_0xa1bf('0x6'));var config=require(_0xa1bf('0x7'));var controller=require(_0xa1bf('0x8'));router['get']('/',auth[_0xa1bf('0x9')](),controller['index']);router[_0xa1bf('0xa')](_0xa1bf('0xb'),auth['isAuthenticated'](),controller[_0xa1bf('0xc')]);router['get'](_0xa1bf('0xd'),auth[_0xa1bf('0x9')](),controller[_0xa1bf('0xe')]);router[_0xa1bf('0xa')](_0xa1bf('0xf'),auth[_0xa1bf('0x9')](),controller[_0xa1bf('0x10')]);router[_0xa1bf('0xa')](_0xa1bf('0x11'),auth[_0xa1bf('0x9')](),controller[_0xa1bf('0x12')]);router[_0xa1bf('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa1bf('0x14')](_0xa1bf('0xb'),auth['isAuthenticated'](),controller[_0xa1bf('0x15')]);router[_0xa1bf('0x16')](_0xa1bf('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa1bf('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index edcfb43..a4c3744 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x104921,_0x17d0b2){var _0x269953=function(_0x322793){while(--_0x322793){_0x104921['push'](_0x104921['shift']());}};_0x269953(++_0x17d0b2);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x23e7f0,_0x5bb506){_0x23e7f0=_0x23e7f0-0x0;var _0x32b7c5=_0x3f8a[_0x23e7f0];return _0x32b7c5;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x58f4e6,_0x495f09){var _0x118074=function(_0x2dfe4f){while(--_0x2dfe4f){_0x58f4e6['push'](_0x58f4e6['shift']());}};_0x118074(++_0x495f09);}(_0xeff8,0x186));var _0x8eff=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xeff8[_0x1ca9e9];return _0x309f3c;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 07e461e..3ba7093 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x253476,_0x16b31a){_0x253476=_0x253476-0x0;var _0x134271=_0x687b[_0x253476];return _0x134271;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file +var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x3d2345,_0x1fc9ac){var _0x3d1f0f=function(_0x529e28){while(--_0x529e28){_0x3d2345['push'](_0x3d2345['shift']());}};_0x3d1f0f(++_0x1fc9ac);}(_0x2675,0x75));var _0x5267=function(_0x107f44,_0x24efc4){_0x107f44=_0x107f44-0x0;var _0x4313f6=_0x2675[_0x107f44];return _0x4313f6;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4f7d85e..98e2fbb 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 _0x0b30=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x1120dc,_0x32f786){var _0x1f8f1a=function(_0x338fed){while(--_0x338fed){_0x1120dc['push'](_0x1120dc['shift']());}};_0x1f8f1a(++_0x32f786);}(_0x0b30,0xcf));var _0x00b3=function(_0x3a8167,_0x1ca026){_0x3a8167=_0x3a8167-0x0;var _0x16fdd0=_0x0b30[_0x3a8167];return _0x16fdd0;};'use strict';var _=require(_0x00b3('0x0'));var util=require(_0x00b3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x00b3('0x2'));var BPromise=require(_0x00b3('0x3'));var rp=require(_0x00b3('0x4'));var fs=require('fs');var path=require(_0x00b3('0x5'));var rimraf=require(_0x00b3('0x6'));var config=require(_0x00b3('0x7'));var attributes=require(_0x00b3('0x8'));module[_0x00b3('0x9')]=function(_0x1c255b,_0x21d11b){return _0x1c255b[_0x00b3('0xa')](_0x00b3('0xb'),attributes,{'tableName':_0x00b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41f8=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','path','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x41f8,0xcb));var _0x841f=function(_0x56aa8f,_0x53a4b5){_0x56aa8f=_0x56aa8f-0x0;var _0x36b9b5=_0x41f8[_0x56aa8f];return _0x36b9b5;};'use strict';var _=require(_0x841f('0x0'));var util=require(_0x841f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x841f('0x2'));var rimraf=require('rimraf');var config=require(_0x841f('0x3'));var attributes=require(_0x841f('0x4'));module['exports']=function(_0x572155,_0x12070f){return _0x572155[_0x841f('0x5')](_0x841f('0x6'),attributes,{'tableName':_0x841f('0x7'),'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 38be812..37c0e41 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 _0x525f=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4e1fb1,_0x1577b3){var _0x17fbaa=function(_0x10d6c8){while(--_0x10d6c8){_0x4e1fb1['push'](_0x4e1fb1['shift']());}};_0x17fbaa(++_0x1577b3);}(_0x525f,0x84));var _0xf525=function(_0x221fd9,_0x1fec29){_0x221fd9=_0x221fd9-0x0;var _0x3ecf24=_0x525f[_0x221fd9];return _0x3ecf24;};'use strict';var _=require(_0xf525('0x0'));var util=require(_0xf525('0x1'));var moment=require(_0xf525('0x2'));var BPromise=require('bluebird');var rs=require(_0xf525('0x3'));var fs=require('fs');var Redis=require(_0xf525('0x4'));var db=require(_0xf525('0x5'))['db'];var utils=require(_0xf525('0x6'));var logger=require(_0xf525('0x7'))(_0xf525('0x8'));var config=require(_0xf525('0x9'));var jayson=require(_0xf525('0xa'));var client=jayson['client'][_0xf525('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f48c,_0x267ae3,_0x1e7a20){return new BPromise(function(_0x29e1d0,_0x46db78){return client['request'](_0x17f48c,_0x1e7a20)[_0xf525('0xc')](function(_0x1218b2){logger['info'](_0xf525('0xd'),_0x267ae3,_0xf525('0xe'));logger[_0xf525('0xf')](_0xf525('0x10'),_0x267ae3,'request\x20sent',JSON[_0xf525('0x11')](_0x1218b2));if(_0x1218b2[_0xf525('0x12')]){if(_0x1218b2[_0xf525('0x12')][_0xf525('0x13')]===0x1f4){logger[_0xf525('0x12')](_0xf525('0xd'),_0x267ae3,_0x1218b2[_0xf525('0x12')][_0xf525('0x14')]);return _0x46db78(_0x1218b2[_0xf525('0x12')]['message']);}logger[_0xf525('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x267ae3,_0x1218b2[_0xf525('0x12')][_0xf525('0x14')]);return _0x29e1d0(_0x1218b2[_0xf525('0x12')][_0xf525('0x14')]);}else{logger[_0xf525('0x15')](_0xf525('0xd'),_0x267ae3,'request\x20sent');_0x29e1d0(_0x1218b2['result'][_0xf525('0x14')]);}})['catch'](function(_0x37f729){logger['error'](_0xf525('0xd'),_0x267ae3,_0x37f729);_0x46db78(_0x37f729);});});} \ No newline at end of file +var _0xb25a=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x4ee6c9,_0x107966){var _0x5ed53f=function(_0x124305){while(--_0x124305){_0x4ee6c9['push'](_0x4ee6c9['shift']());}};_0x5ed53f(++_0x107966);}(_0xb25a,0x13d));var _0xab25=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb25a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xab25('0x0'));var util=require(_0xab25('0x1'));var moment=require(_0xab25('0x2'));var BPromise=require(_0xab25('0x3'));var rs=require(_0xab25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab25('0x5'));var logger=require(_0xab25('0x6'))('rpc');var config=require(_0xab25('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x236c68,_0x341fd6,_0x440cd6){return new BPromise(function(_0x126881,_0x57d000){return client['request'](_0x236c68,_0x440cd6)[_0xab25('0x9')](function(_0x4ee7d1){logger[_0xab25('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x341fd6,_0xab25('0xb'));logger[_0xab25('0xc')](_0xab25('0xd'),_0x341fd6,_0xab25('0xb'),JSON[_0xab25('0xe')](_0x4ee7d1));if(_0x4ee7d1[_0xab25('0xf')]){if(_0x4ee7d1['error'][_0xab25('0x10')]===0x1f4){logger[_0xab25('0xf')](_0xab25('0x11'),_0x341fd6,_0x4ee7d1[_0xab25('0xf')][_0xab25('0x12')]);return _0x57d000(_0x4ee7d1[_0xab25('0xf')][_0xab25('0x12')]);}logger[_0xab25('0xf')](_0xab25('0x11'),_0x341fd6,_0x4ee7d1[_0xab25('0xf')][_0xab25('0x12')]);return _0x126881(_0x4ee7d1[_0xab25('0xf')][_0xab25('0x12')]);}else{logger['info'](_0xab25('0x11'),_0x341fd6,_0xab25('0xb'));_0x126881(_0x4ee7d1[_0xab25('0x13')]['message']);}})[_0xab25('0x14')](function(_0x2ab96c){logger['error'](_0xab25('0x11'),_0x341fd6,_0x2ab96c);_0x57d000(_0x2ab96c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index df1b90d..942e9b4 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 _0x86ca=['show','/:id/preview','preview','/:id/run','run','query','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2d1185,_0xf80b0b){var _0x1b13e2=function(_0x203ddc){while(--_0x203ddc){_0x2d1185['push'](_0x2d1185['shift']());}};_0x1b13e2(++_0xf80b0b);}(_0x86ca,0xc3));var _0xa86c=function(_0x438325,_0x3648c7){_0x438325=_0x438325-0x0;var _0x2ecff8=_0x86ca[_0x438325];return _0x2ecff8;};'use strict';var multer=require(_0xa86c('0x0'));var util=require(_0xa86c('0x1'));var path=require(_0xa86c('0x2'));var timeout=require(_0xa86c('0x3'));var express=require('express');var router=express[_0xa86c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa86c('0x5'));var interaction=require(_0xa86c('0x6'));var config=require('../../config/environment');var controller=require(_0xa86c('0x7'));router[_0xa86c('0x8')]('/',auth[_0xa86c('0x9')](),controller[_0xa86c('0xa')]);router[_0xa86c('0x8')](_0xa86c('0xb'),auth['isAuthenticated'](),controller[_0xa86c('0xc')]);router[_0xa86c('0x8')](_0xa86c('0xd'),auth['isAuthenticated'](),controller[_0xa86c('0xe')]);router[_0xa86c('0x8')](_0xa86c('0xf'),auth[_0xa86c('0x9')](),controller[_0xa86c('0x10')]);router[_0xa86c('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0xa86c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa86c('0x12')]);router[_0xa86c('0x13')](_0xa86c('0xb'),auth[_0xa86c('0x9')](),controller[_0xa86c('0x14')]);router['delete']('/:id',auth[_0xa86c('0x9')](),controller[_0xa86c('0x15')]);module[_0xa86c('0x16')]=router; \ No newline at end of file +var _0xfbfc=['query','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0xfbfc,0x1be));var _0xcfbf=function(_0x278c49,_0x5739bb){_0x278c49=_0x278c49-0x0;var _0x5cc535=_0xfbfc[_0x278c49];return _0x5cc535;};'use strict';var multer=require(_0xcfbf('0x0'));var util=require('util');var path=require(_0xcfbf('0x1'));var timeout=require(_0xcfbf('0x2'));var express=require(_0xcfbf('0x3'));var router=express[_0xcfbf('0x4')]();var fs_extra=require(_0xcfbf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcfbf('0x6'));var controller=require(_0xcfbf('0x7'));router[_0xcfbf('0x8')]('/',auth['isAuthenticated'](),controller[_0xcfbf('0x9')]);router[_0xcfbf('0x8')](_0xcfbf('0xa'),auth[_0xcfbf('0xb')](),controller[_0xcfbf('0xc')]);router['get'](_0xcfbf('0xd'),auth[_0xcfbf('0xb')](),controller[_0xcfbf('0xe')]);router[_0xcfbf('0x8')](_0xcfbf('0xf'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0xcfbf('0xb')](),controller[_0xcfbf('0x10')]);router[_0xcfbf('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcfbf('0x12')]('/:id',auth[_0xcfbf('0xb')](),controller[_0xcfbf('0x13')]);router[_0xcfbf('0x14')](_0xcfbf('0xa'),auth['isAuthenticated'](),controller[_0xcfbf('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 3e5e213..9317bf4 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 _0x1245=['pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1245,0x1c3));var _0x5124=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1245[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5124('0x0'));module[_0x5124('0x1')]={'name':{'type':Sequelize[_0x5124('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5124('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5124('0x3')](_0x5124('0x4'),_0x5124('0x5'),_0x5124('0x6')),'allowNull':![],'defaultValue':_0x5124('0x4')},'savename':{'type':Sequelize[_0x5124('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5124('0x7')]},'endDate':{'type':Sequelize[_0x5124('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5124('0x3')](_0x5124('0x8'),_0x5124('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x5124('0xa')](0xb)[_0x5124('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb41=['exports','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0xfb41,0x1a2));var _0x1fb4=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xfb41[_0x1e91eb];return _0x2af75a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1fb4('0x0')]={'name':{'type':Sequelize[_0x1fb4('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x1fb4('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x1fb4('0x2')](_0x1fb4('0x3'),'pdf',_0x1fb4('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x1fb4('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1fb4('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x1fb4('0x1')],'defaultValue':_0x1fb4('0x6')},'type':{'type':Sequelize['ENUM'](_0x1fb4('0x7'),_0x1fb4('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x1fb4('0x9')](0xb)[_0x1fb4('0xa')]},'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 6b2bc22..31556fe 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 _0x830e=['findAll','rows','catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include'];(function(_0x35d0bc,_0x4ffa16){var _0x32de9c=function(_0x465a67){while(--_0x465a67){_0x35d0bc['push'](_0x35d0bc['shift']());}};_0x32de9c(++_0x4ffa16);}(_0x830e,0x7f));var _0xe830=function(_0x59ca47,_0x1cb30b){_0x59ca47=_0x59ca47-0x0;var _0x2a8197=_0x830e[_0x59ca47];return _0x2a8197;};'use strict';var emlformat=require(_0xe830('0x0'));var rimraf=require(_0xe830('0x1'));var zipdir=require(_0xe830('0x2'));var jsonpatch=require(_0xe830('0x3'));var rp=require(_0xe830('0x4'));var moment=require(_0xe830('0x5'));var BPromise=require(_0xe830('0x6'));var Mustache=require('mustache');var util=require(_0xe830('0x7'));var path=require('path');var sox=require(_0xe830('0x8'));var csv=require(_0xe830('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe830('0xa'));var _=require(_0xe830('0xb'));var squel=require(_0xe830('0xc'));var crypto=require(_0xe830('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe830('0xe'));var toCsv=require(_0xe830('0x9'));var querystring=require('querystring');var Papa=require(_0xe830('0xf'));var Redis=require(_0xe830('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe830('0x11'));var as=require(_0xe830('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe830('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b9968,_0x2daa5c){_0x2daa5c=_0x2daa5c||0xcc;return function(_0x47b90a){if(_0x47b90a){return _0x1b9968['sendStatus'](_0x2daa5c);}return _0x1b9968[_0xe830('0x14')](_0x2daa5c)['end']();};}function respondWithResult(_0x3cc14b,_0x1db35c){_0x1db35c=_0x1db35c||0xc8;return function(_0x116698){if(_0x116698){return _0x3cc14b[_0xe830('0x14')](_0x1db35c)['json'](_0x116698);}};}function respondWithFilteredResult(_0x58d553,_0x2b3369){return function(_0x2784b9){if(_0x2784b9){var _0x249651=typeof _0x2b3369[_0xe830('0x15')]==='undefined'&&typeof _0x2b3369[_0xe830('0x16')]===_0xe830('0x17');var _0x23c9f=_0x2784b9[_0xe830('0x18')];var _0x35c610=_0x249651?0x0:_0x2b3369['offset'];var _0x4d8598=_0x249651?_0x2784b9['count']:_0x2b3369[_0xe830('0x15')]+_0x2b3369[_0xe830('0x16')];var _0x56d3fe;if(_0x4d8598>=_0x23c9f){_0x4d8598=_0x23c9f;_0x56d3fe=0xc8;}else{_0x56d3fe=0xce;}_0x58d553['status'](_0x56d3fe);return _0x58d553[_0xe830('0x19')](_0xe830('0x1a'),_0x35c610+'-'+_0x4d8598+'/'+_0x23c9f)[_0xe830('0x1b')](_0x2784b9);}return null;};}function patchUpdates(_0xd444d1){return function(_0x1d0e69){try{jsonpatch[_0xe830('0x1c')](_0x1d0e69,_0xd444d1,!![]);}catch(_0x28a166){return BPromise[_0xe830('0x1d')](_0x28a166);}return _0x1d0e69[_0xe830('0x1e')]();};}function saveUpdates(_0x42dfd6,_0x1a2b25){return function(_0x37b9f9){if(_0x37b9f9){return _0x37b9f9['update'](_0x42dfd6)[_0xe830('0x1f')](function(_0x20e9aa){return _0x20e9aa;});}return null;};}function removeEntity(_0x1386cb,_0x3c600b){return function(_0x349f43){if(_0x349f43){return _0x349f43[_0xe830('0x20')]()[_0xe830('0x1f')](function(){var _0xbcb689=_0x349f43[_0xe830('0x21')]({'plain':!![]});var _0x1391ea=_0xe830('0x22');return db[_0xe830('0x23')][_0xe830('0x20')]({'where':{'type':_0x1391ea,'resourceId':_0xbcb689['id']}})[_0xe830('0x1f')](function(){return _0x349f43;});})['then'](function(){_0x1386cb[_0xe830('0x14')](0xcc)[_0xe830('0x24')]();});}};}function handleEntityNotFound(_0x28adc2,_0x2d9cfc){return function(_0x5707f5){if(!_0x5707f5){_0x28adc2[_0xe830('0x25')](0x194);}return _0x5707f5;};}function handleError(_0xbe2a10,_0x1b3c0c){_0x1b3c0c=_0x1b3c0c||0x1f4;return function(_0x2dee0c){logger['error'](_0x2dee0c[_0xe830('0x26')]);if(_0x2dee0c[_0xe830('0x27')]){delete _0x2dee0c[_0xe830('0x27')];}_0xbe2a10[_0xe830('0x14')](_0x1b3c0c)[_0xe830('0x28')](_0x2dee0c);};}exports[_0xe830('0x29')]=function(_0x5c3632,_0x5f1cba){var _0x1d1b5d={},_0x330622={},_0x5146de={'count':0x0,'rows':[]};var _0x327cb8=_[_0xe830('0x2a')](db[_0xe830('0x2b')][_0xe830('0x2c')],function(_0x5d52de){return{'name':_0x5d52de[_0xe830('0x2d')],'type':_0x5d52de[_0xe830('0x2e')][_0xe830('0x2f')]};});_0x330622[_0xe830('0x30')]=_[_0xe830('0x2a')](_0x327cb8,_0xe830('0x27'));_0x330622['query']=_['keys'](_0x5c3632[_0xe830('0x31')]);_0x330622['filters']=_[_0xe830('0x32')](_0x330622['model'],_0x330622[_0xe830('0x31')]);_0x1d1b5d['attributes']=_[_0xe830('0x32')](_0x330622[_0xe830('0x30')],qs[_0xe830('0x33')](_0x5c3632[_0xe830('0x31')][_0xe830('0x33')]));_0x1d1b5d['attributes']=_0x1d1b5d['attributes'][_0xe830('0x34')]?_0x1d1b5d[_0xe830('0x35')]:_0x330622[_0xe830('0x30')];if(!_0x5c3632[_0xe830('0x31')][_0xe830('0x36')](_0xe830('0x37'))){_0x1d1b5d[_0xe830('0x16')]=qs['limit'](_0x5c3632['query']['limit']);_0x1d1b5d[_0xe830('0x15')]=qs[_0xe830('0x15')](_0x5c3632[_0xe830('0x31')][_0xe830('0x15')]);}_0x1d1b5d[_0xe830('0x38')]=qs[_0xe830('0x39')](_0x5c3632[_0xe830('0x31')]['sort']);_0x1d1b5d[_0xe830('0x3a')]=qs[_0xe830('0x3b')](_['pick'](_0x5c3632[_0xe830('0x31')],_0x330622[_0xe830('0x3b')]),_0x327cb8);if(_0x5c3632['query'][_0xe830('0x3c')]){_0x1d1b5d['where']=_[_0xe830('0x3d')](_0x1d1b5d[_0xe830('0x3a')],{'$or':_[_0xe830('0x2a')](_0x327cb8,function(_0x190bbb){if(_0x190bbb[_0xe830('0x2e')]!==_0xe830('0x3e')){var _0x267316={};_0x267316[_0x190bbb['name']]={'$like':'%'+_0x5c3632[_0xe830('0x31')][_0xe830('0x3c')]+'%'};return _0x267316;}})});}_0x1d1b5d=_['merge']({},_0x1d1b5d,_0x5c3632['options']);var _0x5b9a06={'where':_0x1d1b5d[_0xe830('0x3a')]};return db[_0xe830('0x2b')]['count'](_0x5b9a06)[_0xe830('0x1f')](function(_0x2935a2){_0x5146de[_0xe830('0x18')]=_0x2935a2;if(_0x5c3632[_0xe830('0x31')][_0xe830('0x3f')]){_0x1d1b5d[_0xe830('0x40')]=[{'all':!![]}];}return db[_0xe830('0x2b')][_0xe830('0x41')](_0x1d1b5d);})[_0xe830('0x1f')](function(_0x34f1b4){_0x5146de[_0xe830('0x42')]=_0x34f1b4;return _0x5146de;})[_0xe830('0x1f')](respondWithFilteredResult(_0x5f1cba,_0x1d1b5d))[_0xe830('0x43')](handleError(_0x5f1cba,null));};exports[_0xe830('0x44')]=function(_0x39631b,_0x42fc42){var _0x45f67a={'raw':!![],'where':{'id':_0x39631b['params']['id']}},_0x18829d={};_0x18829d['model']=_[_0xe830('0x45')](db[_0xe830('0x2b')][_0xe830('0x2c')]);_0x18829d['query']=_['keys'](_0x39631b[_0xe830('0x31')]);_0x18829d[_0xe830('0x3b')]=_[_0xe830('0x32')](_0x18829d[_0xe830('0x30')],_0x18829d[_0xe830('0x31')]);_0x45f67a['attributes']=_[_0xe830('0x32')](_0x18829d[_0xe830('0x30')],qs[_0xe830('0x33')](_0x39631b[_0xe830('0x31')][_0xe830('0x33')]));_0x45f67a[_0xe830('0x35')]=_0x45f67a['attributes'][_0xe830('0x34')]?_0x45f67a[_0xe830('0x35')]:_0x18829d[_0xe830('0x30')];if(_0x39631b[_0xe830('0x31')]['includeAll']){_0x45f67a[_0xe830('0x40')]=[{'all':!![]}];}_0x45f67a=_['merge']({},_0x45f67a,_0x39631b[_0xe830('0x46')]);return db[_0xe830('0x2b')][_0xe830('0x47')](_0x45f67a)[_0xe830('0x1f')](handleEntityNotFound(_0x42fc42,null))[_0xe830('0x1f')](respondWithResult(_0x42fc42,null))['catch'](handleError(_0x42fc42,null));};exports[_0xe830('0x48')]=function(_0x932787,_0x351090){return db[_0xe830('0x2b')][_0xe830('0x48')](_0x932787[_0xe830('0x49')],{})[_0xe830('0x1f')](function(_0x186aed){var _0x49a28a=_0x932787[_0xe830('0x4a')][_0xe830('0x21')]({'plain':!![]});if(!_0x49a28a)throw new Error(_0xe830('0x4b'));if(_0x49a28a[_0xe830('0x4c')]==='user'){var _0x46e3fb=_0x186aed[_0xe830('0x21')]({'plain':!![]});var _0x4da3fc=_0xe830('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x4da3fc,'userProfileId':_0x49a28a[_0xe830('0x4d')]},'raw':!![]})[_0xe830('0x1f')](function(_0x2ea61d){if(_0x2ea61d&&_0x2ea61d[_0xe830('0x4e')]===0x0){return db[_0xe830('0x23')][_0xe830('0x48')]({'name':_0x46e3fb[_0xe830('0x27')],'resourceId':_0x46e3fb['id'],'type':_0x2ea61d[_0xe830('0x27')],'sectionId':_0x2ea61d['id']},{})[_0xe830('0x1f')](function(){return _0x186aed;});}else{return _0x186aed;}})[_0xe830('0x43')](function(_0x354826){logger[_0xe830('0x4f')](_0xe830('0x50'),_0x354826);throw _0x354826;});}return _0x186aed;})['then'](respondWithResult(_0x351090,0xc9))[_0xe830('0x43')](handleError(_0x351090,null));};exports[_0xe830('0x51')]=function(_0x5b3f54,_0x4f4e90){if(_0x5b3f54[_0xe830('0x49')]['id']){delete _0x5b3f54[_0xe830('0x49')]['id'];}return db[_0xe830('0x2b')][_0xe830('0x47')]({'where':{'id':_0x5b3f54[_0xe830('0x52')]['id']}})['then'](handleEntityNotFound(_0x4f4e90,null))['then'](saveUpdates(_0x5b3f54['body'],null))[_0xe830('0x1f')](respondWithResult(_0x4f4e90,null))[_0xe830('0x43')](handleError(_0x4f4e90,null));};exports['destroy']=function(_0x3858a9,_0x5e0a91){return db[_0xe830('0x2b')]['find']({'where':{'id':_0x3858a9[_0xe830('0x52')]['id']}})[_0xe830('0x1f')](handleEntityNotFound(_0x5e0a91,null))[_0xe830('0x1f')](removeEntity(_0x5e0a91,null))[_0xe830('0x43')](handleError(_0x5e0a91,null));};exports[_0xe830('0x53')]=function(_0x23fd01,_0x7e373b,_0x85da82){return db[_0xe830('0x2b')]['find']({'where':{'id':_0x23fd01[_0xe830('0x52')]['id']},'attributes':[_0xe830('0x27'),_0xe830('0x54'),_0xe830('0x55'),_0xe830('0x56')],'raw':!![]})[_0xe830('0x1f')](handleEntityNotFound(_0x7e373b,null))[_0xe830('0x1f')](function(_0x381438){if(_0x381438){if(!fs['existsSync'](path[_0xe830('0x57')](config[_0xe830('0x58')],_0xe830('0x59'),_0x381438[_0xe830('0x55')]))){throw new db[(_0xe830('0x5a'))]['ValidationError'](_0xe830('0x5b'));}if(_0x23fd01[_0xe830('0x31')][_0xe830('0x5c')]){return _0x7e373b[_0xe830('0x25')](0xc8);}return _0x7e373b[_0xe830('0x53')](path[_0xe830('0x57')](config[_0xe830('0x58')],_0xe830('0x59'),_0x381438[_0xe830('0x55')]),util[_0xe830('0x5d')](_0xe830('0x5e'),_0x381438[_0xe830('0x54')]||_0x381438['name'],_0x381438['output'][_0xe830('0x5f')]()));}})[_0xe830('0x43')](handleError(_0x7e373b,null));}; \ No newline at end of file +var _0xaf32=['model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','format','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','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','json','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key'];(function(_0x5c113a,_0x2b2da1){var _0x143b8e=function(_0x16d275){while(--_0x16d275){_0x5c113a['push'](_0x5c113a['shift']());}};_0x143b8e(++_0x2b2da1);}(_0xaf32,0xec));var _0x2af3=function(_0x392890,_0xb8d3dd){_0x392890=_0x392890-0x0;var _0x2b2e30=_0xaf32[_0x392890];return _0x2b2e30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2af3('0x0'));var zipdir=require(_0x2af3('0x1'));var jsonpatch=require(_0x2af3('0x2'));var rp=require(_0x2af3('0x3'));var moment=require(_0x2af3('0x4'));var BPromise=require(_0x2af3('0x5'));var Mustache=require('mustache');var util=require(_0x2af3('0x6'));var path=require(_0x2af3('0x7'));var sox=require(_0x2af3('0x8'));var csv=require('to-csv');var ejs=require(_0x2af3('0x9'));var fs=require('fs');var fs_extra=require(_0x2af3('0xa'));var _=require(_0x2af3('0xb'));var squel=require(_0x2af3('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2af3('0xd'));var toCsv=require(_0x2af3('0xe'));var querystring=require(_0x2af3('0xf'));var Papa=require(_0x2af3('0x10'));var Redis=require(_0x2af3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2af3('0x12'));var as=require(_0x2af3('0x13'));var hardwareService=require(_0x2af3('0x14'));var logger=require(_0x2af3('0x15'))(_0x2af3('0x16'));var utils=require(_0x2af3('0x17'));var config=require(_0x2af3('0x18'));var licenseUtil=require(_0x2af3('0x19'));var db=require(_0x2af3('0x1a'))['db'];function respondWithStatusCode(_0x2d49da,_0x192182){_0x192182=_0x192182||0xcc;return function(_0x135372){if(_0x135372){return _0x2d49da[_0x2af3('0x1b')](_0x192182);}return _0x2d49da[_0x2af3('0x1c')](_0x192182)['end']();};}function respondWithResult(_0x2206d0,_0x2a3b3c){_0x2a3b3c=_0x2a3b3c||0xc8;return function(_0x436d9d){if(_0x436d9d){return _0x2206d0[_0x2af3('0x1c')](_0x2a3b3c)[_0x2af3('0x1d')](_0x436d9d);}};}function respondWithFilteredResult(_0x184485,_0x14097f){return function(_0x52b414){if(_0x52b414){var _0x48b451=typeof _0x14097f['offset']==='undefined'&&typeof _0x14097f[_0x2af3('0x1e')]==='undefined';var _0x55925b=_0x52b414[_0x2af3('0x1f')];var _0x2e9927=_0x48b451?0x0:_0x14097f[_0x2af3('0x20')];var _0x5d1193=_0x48b451?_0x52b414[_0x2af3('0x1f')]:_0x14097f[_0x2af3('0x20')]+_0x14097f[_0x2af3('0x1e')];var _0x334553;if(_0x5d1193>=_0x55925b){_0x5d1193=_0x55925b;_0x334553=0xc8;}else{_0x334553=0xce;}_0x184485[_0x2af3('0x1c')](_0x334553);return _0x184485[_0x2af3('0x21')](_0x2af3('0x22'),_0x2e9927+'-'+_0x5d1193+'/'+_0x55925b)['json'](_0x52b414);}return null;};}function patchUpdates(_0x5b2ff6){return function(_0x1c514e){try{jsonpatch[_0x2af3('0x23')](_0x1c514e,_0x5b2ff6,!![]);}catch(_0x2b7b14){return BPromise[_0x2af3('0x24')](_0x2b7b14);}return _0x1c514e['save']();};}function saveUpdates(_0x4cb7ae,_0x4049eb){return function(_0x286d1c){if(_0x286d1c){return _0x286d1c[_0x2af3('0x25')](_0x4cb7ae)[_0x2af3('0x26')](function(_0x2f6455){return _0x2f6455;});}return null;};}function removeEntity(_0x4061aa,_0xe746a8){return function(_0x2f66dd){if(_0x2f66dd){return _0x2f66dd[_0x2af3('0x27')]()[_0x2af3('0x26')](function(){var _0x1bec89=_0x2f66dd[_0x2af3('0x28')]({'plain':!![]});var _0x3f8aa3='ExtractedReports';return db[_0x2af3('0x29')]['destroy']({'where':{'type':_0x3f8aa3,'resourceId':_0x1bec89['id']}})[_0x2af3('0x26')](function(){return _0x2f66dd;});})['then'](function(){_0x4061aa[_0x2af3('0x1c')](0xcc)[_0x2af3('0x2a')]();});}};}function handleEntityNotFound(_0x1ffb1c,_0x4c5400){return function(_0x4d8493){if(!_0x4d8493){_0x1ffb1c['sendStatus'](0x194);}return _0x4d8493;};}function handleError(_0x270649,_0x5bd753){_0x5bd753=_0x5bd753||0x1f4;return function(_0x133f1f){logger[_0x2af3('0x2b')](_0x133f1f[_0x2af3('0x2c')]);if(_0x133f1f['name']){delete _0x133f1f[_0x2af3('0x2d')];}_0x270649['status'](_0x5bd753)[_0x2af3('0x2e')](_0x133f1f);};}exports['index']=function(_0x45b2e1,_0x1bccf3){var _0x211c33={},_0x285eff={},_0x1b0bc6={'count':0x0,'rows':[]};var _0xcfb8d3=_['map'](db[_0x2af3('0x2f')][_0x2af3('0x30')],function(_0x47225b){return{'name':_0x47225b[_0x2af3('0x31')],'type':_0x47225b[_0x2af3('0x32')][_0x2af3('0x33')]};});_0x285eff[_0x2af3('0x34')]=_[_0x2af3('0x35')](_0xcfb8d3,_0x2af3('0x2d'));_0x285eff[_0x2af3('0x36')]=_[_0x2af3('0x37')](_0x45b2e1[_0x2af3('0x36')]);_0x285eff[_0x2af3('0x38')]=_[_0x2af3('0x39')](_0x285eff[_0x2af3('0x34')],_0x285eff[_0x2af3('0x36')]);_0x211c33[_0x2af3('0x3a')]=_[_0x2af3('0x39')](_0x285eff['model'],qs[_0x2af3('0x3b')](_0x45b2e1['query'][_0x2af3('0x3b')]));_0x211c33[_0x2af3('0x3a')]=_0x211c33['attributes'][_0x2af3('0x3c')]?_0x211c33[_0x2af3('0x3a')]:_0x285eff[_0x2af3('0x34')];if(!_0x45b2e1[_0x2af3('0x36')][_0x2af3('0x3d')]('nolimit')){_0x211c33['limit']=qs[_0x2af3('0x1e')](_0x45b2e1[_0x2af3('0x36')]['limit']);_0x211c33[_0x2af3('0x20')]=qs[_0x2af3('0x20')](_0x45b2e1[_0x2af3('0x36')][_0x2af3('0x20')]);}_0x211c33[_0x2af3('0x3e')]=qs['sort'](_0x45b2e1[_0x2af3('0x36')][_0x2af3('0x3f')]);_0x211c33[_0x2af3('0x40')]=qs['filters'](_['pick'](_0x45b2e1['query'],_0x285eff['filters']),_0xcfb8d3);if(_0x45b2e1['query'][_0x2af3('0x41')]){_0x211c33[_0x2af3('0x40')]=_[_0x2af3('0x42')](_0x211c33[_0x2af3('0x40')],{'$or':_[_0x2af3('0x35')](_0xcfb8d3,function(_0x406ff3){if(_0x406ff3[_0x2af3('0x32')]!=='VIRTUAL'){var _0x101082={};_0x101082[_0x406ff3['name']]={'$like':'%'+_0x45b2e1[_0x2af3('0x36')][_0x2af3('0x41')]+'%'};return _0x101082;}})});}_0x211c33=_[_0x2af3('0x42')]({},_0x211c33,_0x45b2e1[_0x2af3('0x43')]);var _0x1d8d2b={'where':_0x211c33[_0x2af3('0x40')]};return db[_0x2af3('0x2f')][_0x2af3('0x1f')](_0x1d8d2b)[_0x2af3('0x26')](function(_0x4f7ddf){_0x1b0bc6[_0x2af3('0x1f')]=_0x4f7ddf;if(_0x45b2e1['query'][_0x2af3('0x44')]){_0x211c33[_0x2af3('0x45')]=[{'all':!![]}];}return db[_0x2af3('0x2f')]['findAll'](_0x211c33);})[_0x2af3('0x26')](function(_0x51188e){_0x1b0bc6[_0x2af3('0x46')]=_0x51188e;return _0x1b0bc6;})['then'](respondWithFilteredResult(_0x1bccf3,_0x211c33))[_0x2af3('0x47')](handleError(_0x1bccf3,null));};exports[_0x2af3('0x48')]=function(_0x553d17,_0x287cd2){var _0x46409a={'raw':!![],'where':{'id':_0x553d17['params']['id']}},_0x1a3974={};_0x1a3974[_0x2af3('0x34')]=_['keys'](db[_0x2af3('0x2f')][_0x2af3('0x30')]);_0x1a3974[_0x2af3('0x36')]=_[_0x2af3('0x37')](_0x553d17[_0x2af3('0x36')]);_0x1a3974[_0x2af3('0x38')]=_[_0x2af3('0x39')](_0x1a3974[_0x2af3('0x34')],_0x1a3974['query']);_0x46409a[_0x2af3('0x3a')]=_[_0x2af3('0x39')](_0x1a3974[_0x2af3('0x34')],qs[_0x2af3('0x3b')](_0x553d17[_0x2af3('0x36')][_0x2af3('0x3b')]));_0x46409a['attributes']=_0x46409a[_0x2af3('0x3a')][_0x2af3('0x3c')]?_0x46409a[_0x2af3('0x3a')]:_0x1a3974[_0x2af3('0x34')];if(_0x553d17[_0x2af3('0x36')][_0x2af3('0x44')]){_0x46409a[_0x2af3('0x45')]=[{'all':!![]}];}_0x46409a=_[_0x2af3('0x42')]({},_0x46409a,_0x553d17[_0x2af3('0x43')]);return db[_0x2af3('0x2f')]['find'](_0x46409a)['then'](handleEntityNotFound(_0x287cd2,null))[_0x2af3('0x26')](respondWithResult(_0x287cd2,null))[_0x2af3('0x47')](handleError(_0x287cd2,null));};exports[_0x2af3('0x49')]=function(_0x3bd736,_0x37b33e){return db[_0x2af3('0x2f')][_0x2af3('0x49')](_0x3bd736[_0x2af3('0x4a')],{})[_0x2af3('0x26')](function(_0x5f2797){var _0x1695ea=_0x3bd736['user'][_0x2af3('0x28')]({'plain':!![]});if(!_0x1695ea)throw new Error(_0x2af3('0x4b'));if(_0x1695ea[_0x2af3('0x4c')]===_0x2af3('0x4d')){var _0xcca624=_0x5f2797[_0x2af3('0x28')]({'plain':!![]});var _0x241983=_0x2af3('0x4e');return db[_0x2af3('0x4f')][_0x2af3('0x50')]({'where':{'name':_0x241983,'userProfileId':_0x1695ea['userProfileId']},'raw':!![]})['then'](function(_0x198576){if(_0x198576&&_0x198576[_0x2af3('0x51')]===0x0){return db[_0x2af3('0x29')]['create']({'name':_0xcca624[_0x2af3('0x2d')],'resourceId':_0xcca624['id'],'type':_0x198576[_0x2af3('0x2d')],'sectionId':_0x198576['id']},{})['then'](function(){return _0x5f2797;});}else{return _0x5f2797;}})[_0x2af3('0x47')](function(_0x97be59){logger[_0x2af3('0x2b')](_0x2af3('0x52'),_0x97be59);throw _0x97be59;});}return _0x5f2797;})[_0x2af3('0x26')](respondWithResult(_0x37b33e,0xc9))[_0x2af3('0x47')](handleError(_0x37b33e,null));};exports[_0x2af3('0x25')]=function(_0x3d38a6,_0x1eb3b8){if(_0x3d38a6[_0x2af3('0x4a')]['id']){delete _0x3d38a6[_0x2af3('0x4a')]['id'];}return db[_0x2af3('0x2f')][_0x2af3('0x50')]({'where':{'id':_0x3d38a6[_0x2af3('0x53')]['id']}})[_0x2af3('0x26')](handleEntityNotFound(_0x1eb3b8,null))[_0x2af3('0x26')](saveUpdates(_0x3d38a6[_0x2af3('0x4a')],null))['then'](respondWithResult(_0x1eb3b8,null))[_0x2af3('0x47')](handleError(_0x1eb3b8,null));};exports[_0x2af3('0x27')]=function(_0x2e170f,_0x4570dc){return db['AnalyticExtractedReport'][_0x2af3('0x50')]({'where':{'id':_0x2e170f[_0x2af3('0x53')]['id']}})[_0x2af3('0x26')](handleEntityNotFound(_0x4570dc,null))['then'](removeEntity(_0x4570dc,null))[_0x2af3('0x47')](handleError(_0x4570dc,null));};exports['download']=function(_0x3f9f9b,_0x43d20f,_0xb6d0be){return db[_0x2af3('0x2f')][_0x2af3('0x50')]({'where':{'id':_0x3f9f9b['params']['id']},'attributes':[_0x2af3('0x2d'),'basename',_0x2af3('0x54'),_0x2af3('0x55')],'raw':!![]})[_0x2af3('0x26')](handleEntityNotFound(_0x43d20f,null))[_0x2af3('0x26')](function(_0x2b0b0d){if(_0x2b0b0d){if(!fs['existsSync'](path[_0x2af3('0x56')](config['root'],_0x2af3('0x57'),_0x2b0b0d['savename']))){throw new db[(_0x2af3('0x58'))][(_0x2af3('0x59'))](_0x2af3('0x5a'));}if(_0x3f9f9b[_0x2af3('0x36')]['exists']){return _0x43d20f['sendStatus'](0xc8);}return _0x43d20f[_0x2af3('0x5b')](path[_0x2af3('0x56')](config[_0x2af3('0x5c')],_0x2af3('0x57'),_0x2b0b0d[_0x2af3('0x54')]),util[_0x2af3('0x5d')]('%s.%s',_0x2b0b0d[_0x2af3('0x5e')]||_0x2b0b0d[_0x2af3('0x2d')],_0x2b0b0d[_0x2af3('0x55')][_0x2af3('0x5f')]()));}})[_0x2af3('0x47')](handleError(_0x43d20f,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 50ce0c4..793ddf9 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 _0x1daa=['request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x574a6e,_0x53046e){var _0x5d87bb=function(_0x5757a2){while(--_0x5757a2){_0x574a6e['push'](_0x574a6e['shift']());}};_0x5d87bb(++_0x53046e);}(_0x1daa,0x166));var _0xa1da=function(_0x535bcd,_0x1575af){_0x535bcd=_0x535bcd-0x0;var _0x42f269=_0x1daa[_0x535bcd];return _0x42f269;};'use strict';var _=require(_0xa1da('0x0'));var util=require(_0xa1da('0x1'));var logger=require(_0xa1da('0x2'))(_0xa1da('0x3'));var moment=require(_0xa1da('0x4'));var BPromise=require(_0xa1da('0x5'));var rp=require(_0xa1da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1da('0x7'));var config=require(_0xa1da('0x8'));var attributes=require(_0xa1da('0x9'));module[_0xa1da('0xa')]=function(_0x3ecb37,_0x4f099e){return _0x3ecb37[_0xa1da('0xb')](_0xa1da('0xc'),attributes,{'tableName':_0xa1da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb16=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','request-promise','path','rimraf','./analyticExtractedReport.attributes'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xeb16,0x161));var _0x6eb1=function(_0x190be8,_0x44e50b){_0x190be8=_0x190be8-0x0;var _0xcfd0d3=_0xeb16[_0x190be8];return _0xcfd0d3;};'use strict';var _=require(_0x6eb1('0x0'));var util=require('util');var logger=require(_0x6eb1('0x1'))(_0x6eb1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6eb1('0x3'));var fs=require('fs');var path=require(_0x6eb1('0x4'));var rimraf=require(_0x6eb1('0x5'));var config=require('../../config/environment');var attributes=require(_0x6eb1('0x6'));module[_0x6eb1('0x7')]=function(_0x4d1cbe,_0x16de17){return _0x4d1cbe['define'](_0x6eb1('0x8'),attributes,{'tableName':_0x6eb1('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 03d95fa..eaac999 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 _0xbfcc=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0x4d4d2a,_0x3ca185){var _0x464dd9=function(_0x3303e6){while(--_0x3303e6){_0x4d4d2a['push'](_0x4d4d2a['shift']());}};_0x464dd9(++_0x3ca185);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xbfcc[_0x421eeb];return _0x2c7371;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file +var _0xfc6e=['lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x108d39,_0x1be691){var _0x3494f9=function(_0x33c028){while(--_0x33c028){_0x108d39['push'](_0x108d39['shift']());}};_0x3494f9(++_0x1be691);}(_0xfc6e,0x17c));var _0xefc6=function(_0x57171b,_0xfe67c6){_0x57171b=_0x57171b-0x0;var _0x33a2c8=_0xfc6e[_0x57171b];return _0x33a2c8;};'use strict';var _=require(_0xefc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xefc6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefc6('0x2'));var db=require(_0xefc6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xefc6('0x4'))(_0xefc6('0x5'));var config=require(_0xefc6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xefc6('0x7')][_0xefc6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aa470,_0x1411b6,_0x5be2be){return new BPromise(function(_0x389b1b,_0x10e714){return client[_0xefc6('0x9')](_0x3aa470,_0x5be2be)[_0xefc6('0xa')](function(_0x1cd4cb){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1411b6,_0xefc6('0xb'));logger[_0xefc6('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1411b6,_0xefc6('0xb'),JSON['stringify'](_0x1cd4cb));if(_0x1cd4cb[_0xefc6('0xd')]){if(_0x1cd4cb[_0xefc6('0xd')][_0xefc6('0xe')]===0x1f4){logger[_0xefc6('0xd')](_0xefc6('0xf'),_0x1411b6,_0x1cd4cb[_0xefc6('0xd')][_0xefc6('0x10')]);return _0x10e714(_0x1cd4cb[_0xefc6('0xd')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1411b6,_0x1cd4cb[_0xefc6('0xd')][_0xefc6('0x10')]);return _0x389b1b(_0x1cd4cb[_0xefc6('0xd')][_0xefc6('0x10')]);}else{logger[_0xefc6('0x11')](_0xefc6('0xf'),_0x1411b6,_0xefc6('0xb'));_0x389b1b(_0x1cd4cb[_0xefc6('0x12')][_0xefc6('0x10')]);}})[_0xefc6('0x13')](function(_0x5776e1){logger[_0xefc6('0xd')](_0xefc6('0xf'),_0x1411b6,_0x5776e1);_0x10e714(_0x5776e1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c9683de..c13cd61 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 _0x390d=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id/download','post','create','/:id','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x301539,_0x40b4d8){var _0x11565c=function(_0x5923a7){while(--_0x5923a7){_0x301539['push'](_0x301539['shift']());}};_0x11565c(++_0x40b4d8);}(_0x390d,0x1f1));var _0xd390=function(_0x254c89,_0x64dc91){_0x254c89=_0x254c89-0x0;var _0x3e9c67=_0x390d[_0x254c89];return _0x3e9c67;};'use strict';var multer=require('multer');var util=require(_0xd390('0x0'));var path=require(_0xd390('0x1'));var timeout=require(_0xd390('0x2'));var express=require(_0xd390('0x3'));var router=express[_0xd390('0x4')]();var fs_extra=require(_0xd390('0x5'));var auth=require(_0xd390('0x6'));var interaction=require(_0xd390('0x7'));var config=require(_0xd390('0x8'));var controller=require(_0xd390('0x9'));router[_0xd390('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd390('0xa')]('/:id',auth[_0xd390('0xb')](),controller['show']);router['get'](_0xd390('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xd390('0xd')]('/',auth['isAuthenticated'](),controller[_0xd390('0xe')]);router['put'](_0xd390('0xf'),auth[_0xd390('0xb')](),controller[_0xd390('0x10')]);router['delete'](_0xd390('0xf'),auth['isAuthenticated'](),controller[_0xd390('0x11')]);module['exports']=router; \ No newline at end of file +var _0x35d9=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports'];(function(_0x6c2a87,_0x96f5e2){var _0x4e3681=function(_0x59c94b){while(--_0x59c94b){_0x6c2a87['push'](_0x6c2a87['shift']());}};_0x4e3681(++_0x96f5e2);}(_0x35d9,0x1db));var _0x935d=function(_0x9c0d50,_0xed98a2){_0x9c0d50=_0x9c0d50-0x0;var _0x515c2f=_0x35d9[_0x9c0d50];return _0x515c2f;};'use strict';var multer=require('multer');var util=require(_0x935d('0x0'));var path=require(_0x935d('0x1'));var timeout=require(_0x935d('0x2'));var express=require('express');var router=express[_0x935d('0x3')]();var fs_extra=require(_0x935d('0x4'));var auth=require(_0x935d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x935d('0x6'));var controller=require(_0x935d('0x7'));router['get']('/',auth[_0x935d('0x8')](),controller['index']);router['get'](_0x935d('0x9'),auth[_0x935d('0x8')](),controller['show']);router['get'](_0x935d('0xa'),auth[_0x935d('0x8')](),controller[_0x935d('0xb')]);router[_0x935d('0xc')]('/',auth[_0x935d('0x8')](),controller[_0x935d('0xd')]);router[_0x935d('0xe')]('/:id',auth[_0x935d('0x8')](),controller[_0x935d('0xf')]);router[_0x935d('0x10')](_0x935d('0x9'),auth[_0x935d('0x8')](),controller[_0x935d('0x11')]);module[_0x935d('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4585775..fb143ee 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 _0x9cdc=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3f93db,_0xafbc1f){var _0x3437e6=function(_0x2310ca){while(--_0x2310ca){_0x3f93db['push'](_0x3f93db['shift']());}};_0x3437e6(++_0xafbc1f);}(_0x9cdc,0x1f3));var _0xc9cd=function(_0x3d9a63,_0x151def){_0x3d9a63=_0x3d9a63-0x0;var _0x17424c=_0x9cdc[_0x3d9a63];return _0x17424c;};'use strict';var Sequelize=require(_0xc9cd('0x0'));module[_0xc9cd('0x1')]={'field':{'type':Sequelize[_0xc9cd('0x2')]},'alias':{'type':Sequelize[_0xc9cd('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc9cd('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc9cd('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb8c4=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x5941e1,_0x9a34c0){var _0x51ad41=function(_0x3b9068){while(--_0x3b9068){_0x5941e1['push'](_0x5941e1['shift']());}};_0x51ad41(++_0x9a34c0);}(_0xb8c4,0x140));var _0x4b8c=function(_0x2e2b45,_0x2a07e3){_0x2e2b45=_0x2e2b45-0x0;var _0x2bf3c2=_0xb8c4[_0x2e2b45];return _0x2bf3c2;};'use strict';var Sequelize=require(_0x4b8c('0x0'));module['exports']={'field':{'type':Sequelize[_0x4b8c('0x1')]},'alias':{'type':Sequelize[_0x4b8c('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x4b8c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4b8c('0x2')]},'custom':{'type':Sequelize[_0x4b8c('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 9bb7b55..602533b 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 _0x5b5d=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','AnalyticFieldReport','findAll','rows','catch','params','find','create','body','bulkCreate','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','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','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields'];(function(_0x31d325,_0x32c316){var _0x270405=function(_0x2d01d4){while(--_0x2d01d4){_0x31d325['push'](_0x31d325['shift']());}};_0x270405(++_0x32c316);}(_0x5b5d,0x10f));var _0xd5b5=function(_0x38d3f8,_0x20aed9){_0x38d3f8=_0x38d3f8-0x0;var _0x535d66=_0x5b5d[_0x38d3f8];return _0x535d66;};'use strict';var emlformat=require(_0xd5b5('0x0'));var rimraf=require(_0xd5b5('0x1'));var zipdir=require(_0xd5b5('0x2'));var jsonpatch=require(_0xd5b5('0x3'));var rp=require(_0xd5b5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd5b5('0x5'));var util=require(_0xd5b5('0x6'));var path=require(_0xd5b5('0x7'));var sox=require(_0xd5b5('0x8'));var csv=require(_0xd5b5('0x9'));var ejs=require(_0xd5b5('0xa'));var fs=require('fs');var fs_extra=require(_0xd5b5('0xb'));var _=require(_0xd5b5('0xc'));var squel=require(_0xd5b5('0xd'));var crypto=require(_0xd5b5('0xe'));var jsforce=require(_0xd5b5('0xf'));var deskjs=require(_0xd5b5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5b5('0x11'));var Redis=require(_0xd5b5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd5b5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd5b5('0x14'));var utils=require(_0xd5b5('0x15'));var config=require(_0xd5b5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5b5('0x17'))['db'];function respondWithStatusCode(_0x43dcd6,_0x39cdd4){_0x39cdd4=_0x39cdd4||0xcc;return function(_0x59ddb7){if(_0x59ddb7){return _0x43dcd6[_0xd5b5('0x18')](_0x39cdd4);}return _0x43dcd6[_0xd5b5('0x19')](_0x39cdd4)[_0xd5b5('0x1a')]();};}function respondWithResult(_0x372d4f,_0x2d0a86){_0x2d0a86=_0x2d0a86||0xc8;return function(_0x341471){if(_0x341471){return _0x372d4f['status'](_0x2d0a86)['json'](_0x341471);}};}function respondWithFilteredResult(_0x4a231e,_0x2cabfd){return function(_0x570101){if(_0x570101){var _0x3bb3cb=typeof _0x2cabfd[_0xd5b5('0x1b')]==='undefined'&&typeof _0x2cabfd[_0xd5b5('0x1c')]==='undefined';var _0x1acd7d=_0x570101['count'];var _0x2e08ed=_0x3bb3cb?0x0:_0x2cabfd['offset'];var _0x558d65=_0x3bb3cb?_0x570101['count']:_0x2cabfd['offset']+_0x2cabfd[_0xd5b5('0x1c')];var _0xf3ea04;if(_0x558d65>=_0x1acd7d){_0x558d65=_0x1acd7d;_0xf3ea04=0xc8;}else{_0xf3ea04=0xce;}_0x4a231e[_0xd5b5('0x19')](_0xf3ea04);return _0x4a231e[_0xd5b5('0x1d')](_0xd5b5('0x1e'),_0x2e08ed+'-'+_0x558d65+'/'+_0x1acd7d)[_0xd5b5('0x1f')](_0x570101);}return null;};}function patchUpdates(_0x4a4d5e){return function(_0x1185dd){try{jsonpatch[_0xd5b5('0x20')](_0x1185dd,_0x4a4d5e,!![]);}catch(_0x51d465){return BPromise[_0xd5b5('0x21')](_0x51d465);}return _0x1185dd[_0xd5b5('0x22')]();};}function saveUpdates(_0x4c5040,_0x66dc3f){return function(_0x1fdbf2){if(_0x1fdbf2){return _0x1fdbf2[_0xd5b5('0x23')](_0x4c5040)['then'](function(_0x2f371c){return _0x2f371c;});}return null;};}function removeEntity(_0x360288,_0x1e2dc8){return function(_0x2fb077){if(_0x2fb077){return _0x2fb077[_0xd5b5('0x24')]()[_0xd5b5('0x25')](function(){_0x360288['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1876ac,_0x3f2ec6){return function(_0x1ede65){if(!_0x1ede65){_0x1876ac['sendStatus'](0x194);}return _0x1ede65;};}function handleError(_0x514315,_0x5c1727){_0x5c1727=_0x5c1727||0x1f4;return function(_0x5984f1){logger[_0xd5b5('0x26')](_0x5984f1['stack']);if(_0x5984f1[_0xd5b5('0x27')]){delete _0x5984f1['name'];}_0x514315[_0xd5b5('0x19')](_0x5c1727)[_0xd5b5('0x28')](_0x5984f1);};}exports['index']=function(_0x298b7e,_0x17bb25){var _0x353e2d={},_0x5e78c3={},_0x1e97f5={'count':0x0,'rows':[]};var _0x2ec121=_[_0xd5b5('0x29')](db['AnalyticFieldReport'][_0xd5b5('0x2a')],function(_0x4dd053){return{'name':_0x4dd053[_0xd5b5('0x2b')],'type':_0x4dd053[_0xd5b5('0x2c')][_0xd5b5('0x2d')]};});_0x5e78c3['model']=_[_0xd5b5('0x29')](_0x2ec121,_0xd5b5('0x27'));_0x5e78c3[_0xd5b5('0x2e')]=_[_0xd5b5('0x2f')](_0x298b7e[_0xd5b5('0x2e')]);_0x5e78c3[_0xd5b5('0x30')]=_['intersection'](_0x5e78c3['model'],_0x5e78c3[_0xd5b5('0x2e')]);_0x353e2d[_0xd5b5('0x31')]=_[_0xd5b5('0x32')](_0x5e78c3[_0xd5b5('0x33')],qs['fields'](_0x298b7e[_0xd5b5('0x2e')][_0xd5b5('0x34')]));_0x353e2d[_0xd5b5('0x31')]=_0x353e2d[_0xd5b5('0x31')][_0xd5b5('0x35')]?_0x353e2d[_0xd5b5('0x31')]:_0x5e78c3[_0xd5b5('0x33')];if(!_0x298b7e['query'][_0xd5b5('0x36')](_0xd5b5('0x37'))){_0x353e2d['limit']=qs['limit'](_0x298b7e['query'][_0xd5b5('0x1c')]);_0x353e2d[_0xd5b5('0x1b')]=qs[_0xd5b5('0x1b')](_0x298b7e[_0xd5b5('0x2e')]['offset']);}_0x353e2d[_0xd5b5('0x38')]=qs[_0xd5b5('0x39')](_0x298b7e[_0xd5b5('0x2e')][_0xd5b5('0x39')]);_0x353e2d[_0xd5b5('0x3a')]=qs['filters'](_['pick'](_0x298b7e['query'],_0x5e78c3[_0xd5b5('0x30')]),_0x2ec121);if(_0x298b7e[_0xd5b5('0x2e')][_0xd5b5('0x3b')]){_0x353e2d[_0xd5b5('0x3a')]=_[_0xd5b5('0x3c')](_0x353e2d[_0xd5b5('0x3a')],{'$or':_[_0xd5b5('0x29')](_0x2ec121,function(_0x2b6151){if(_0x2b6151[_0xd5b5('0x2c')]!==_0xd5b5('0x3d')){var _0x2f292a={};_0x2f292a[_0x2b6151[_0xd5b5('0x27')]]={'$like':'%'+_0x298b7e['query'][_0xd5b5('0x3b')]+'%'};return _0x2f292a;}})});}_0x353e2d=_[_0xd5b5('0x3c')]({},_0x353e2d,_0x298b7e[_0xd5b5('0x3e')]);var _0x4353e0={'where':_0x353e2d['where']};return db['AnalyticFieldReport'][_0xd5b5('0x3f')](_0x4353e0)[_0xd5b5('0x25')](function(_0x3e241a){_0x1e97f5[_0xd5b5('0x3f')]=_0x3e241a;if(_0x298b7e[_0xd5b5('0x2e')][_0xd5b5('0x40')]){_0x353e2d[_0xd5b5('0x41')]=[{'all':!![]}];}return db[_0xd5b5('0x42')][_0xd5b5('0x43')](_0x353e2d);})[_0xd5b5('0x25')](function(_0x2b897f){_0x1e97f5[_0xd5b5('0x44')]=_0x2b897f;return _0x1e97f5;})['then'](respondWithFilteredResult(_0x17bb25,_0x353e2d))[_0xd5b5('0x45')](handleError(_0x17bb25,null));};exports['show']=function(_0x503cb9,_0x4a1235){var _0x45b6ce={'raw':![],'where':{'id':_0x503cb9[_0xd5b5('0x46')]['id']}},_0x51b95e={};_0x51b95e[_0xd5b5('0x33')]=_['keys'](db[_0xd5b5('0x42')][_0xd5b5('0x2a')]);_0x51b95e['query']=_['keys'](_0x503cb9[_0xd5b5('0x2e')]);_0x51b95e[_0xd5b5('0x30')]=_[_0xd5b5('0x32')](_0x51b95e[_0xd5b5('0x33')],_0x51b95e['query']);_0x45b6ce[_0xd5b5('0x31')]=_[_0xd5b5('0x32')](_0x51b95e[_0xd5b5('0x33')],qs[_0xd5b5('0x34')](_0x503cb9['query'][_0xd5b5('0x34')]));_0x45b6ce[_0xd5b5('0x31')]=_0x45b6ce[_0xd5b5('0x31')]['length']?_0x45b6ce[_0xd5b5('0x31')]:_0x51b95e[_0xd5b5('0x33')];if(_0x503cb9[_0xd5b5('0x2e')][_0xd5b5('0x40')]){_0x45b6ce['include']=[{'all':!![]}];}_0x45b6ce=_['merge']({},_0x45b6ce,_0x503cb9[_0xd5b5('0x3e')]);return db[_0xd5b5('0x42')][_0xd5b5('0x47')](_0x45b6ce)['then'](handleEntityNotFound(_0x4a1235,null))[_0xd5b5('0x25')](respondWithResult(_0x4a1235,null))[_0xd5b5('0x45')](handleError(_0x4a1235,null));};exports[_0xd5b5('0x48')]=function(_0x3463b7,_0x591805){return db['AnalyticFieldReport'][_0xd5b5('0x48')](_0x3463b7[_0xd5b5('0x49')],{})[_0xd5b5('0x25')](respondWithResult(_0x591805,0xc9))[_0xd5b5('0x45')](handleError(_0x591805,null));};exports[_0xd5b5('0x4a')]=function(_0x283eb5,_0x405650){return db[_0xd5b5('0x42')][_0xd5b5('0x4a')](_0x283eb5[_0xd5b5('0x49')],{'raw':![],'individualHooks':!![]})[_0xd5b5('0x25')](respondWithResult(_0x405650,0xc9))[_0xd5b5('0x45')](handleError(_0x405650,null));};exports[_0xd5b5('0x23')]=function(_0x3f8808,_0x166c5f){if(_0x3f8808['body']['id']){delete _0x3f8808[_0xd5b5('0x49')]['id'];}return db[_0xd5b5('0x42')][_0xd5b5('0x47')]({'where':{'id':_0x3f8808[_0xd5b5('0x46')]['id']}})[_0xd5b5('0x25')](handleEntityNotFound(_0x166c5f,null))[_0xd5b5('0x25')](saveUpdates(_0x3f8808[_0xd5b5('0x49')],null))[_0xd5b5('0x25')](respondWithResult(_0x166c5f,null))[_0xd5b5('0x45')](handleError(_0x166c5f,null));};exports['destroy']=function(_0x3cfd06,_0xddda63){return db[_0xd5b5('0x42')][_0xd5b5('0x47')]({'where':{'id':_0x3cfd06['params']['id']}})[_0xd5b5('0x25')](handleEntityNotFound(_0xddda63,null))[_0xd5b5('0x25')](removeEntity(_0xddda63,null))[_0xd5b5('0x45')](handleError(_0xddda63,null));};exports['bulkDestroy']=function(_0x7d7b7d,_0x285a14){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x7d7b7d[_0xd5b5('0x2e')][_0xd5b5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xd5b5('0x25')](respondWithResult(_0x285a14,0xcc))[_0xd5b5('0x45')](handleError(_0x285a14,null));};exports['addFields']=function(_0x4ec821,_0x5ee110,_0x13058e){return db[_0xd5b5('0x4c')][_0xd5b5('0x4d')]({'where':{'id':_0x4ec821['params']['id']}})[_0xd5b5('0x25')](handleEntityNotFound(_0x5ee110,null))['then'](function(_0x1434c6){if(_0x1434c6){return db[_0xd5b5('0x4e')][_0xd5b5('0x4f')](function(_0x23d252){return db['AnalyticFieldReport'][_0xd5b5('0x24')]({'where':{'CustomReportId':_0x4ec821[_0xd5b5('0x46')]['id']},'transaction':_0x23d252})[_0xd5b5('0x25')](function(_0x219e00){var _0x5a1245=_[_0xd5b5('0x29')](_0x4ec821['body'],function(_0x5c0d0f){delete _0x5c0d0f['id'];_0x5c0d0f[_0xd5b5('0x50')]=_0x4ec821['params']['id'];return _0x5c0d0f;});return db[_0xd5b5('0x42')]['bulkCreate'](_0x5a1245,{'transaction':_0x23d252});});})[_0xd5b5('0x25')](function(){return db['AnalyticFieldReport'][_0xd5b5('0x43')]({'where':{'CustomReportId':_0x4ec821[_0xd5b5('0x46')]['id']}});});}})['then'](respondWithResult(_0x5ee110,null))[_0xd5b5('0x45')](handleError(_0x5ee110,null));}; \ No newline at end of file +var _0xe111=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x55d1aa,_0x5ca595){var _0x52a66e=function(_0x2dbf45){while(--_0x2dbf45){_0x55d1aa['push'](_0x55d1aa['shift']());}};_0x52a66e(++_0x5ca595);}(_0xe111,0x99));var _0x1e11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe111[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1e11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e11('0x1'));var jsonpatch=require(_0x1e11('0x2'));var rp=require(_0x1e11('0x3'));var moment=require(_0x1e11('0x4'));var BPromise=require(_0x1e11('0x5'));var Mustache=require(_0x1e11('0x6'));var util=require(_0x1e11('0x7'));var path=require(_0x1e11('0x8'));var sox=require(_0x1e11('0x9'));var csv=require(_0x1e11('0xa'));var ejs=require(_0x1e11('0xb'));var fs=require('fs');var fs_extra=require(_0x1e11('0xc'));var _=require(_0x1e11('0xd'));var squel=require(_0x1e11('0xe'));var crypto=require(_0x1e11('0xf'));var jsforce=require(_0x1e11('0x10'));var deskjs=require(_0x1e11('0x11'));var toCsv=require(_0x1e11('0xa'));var querystring=require(_0x1e11('0x12'));var Papa=require(_0x1e11('0x13'));var Redis=require(_0x1e11('0x14'));var authService=require(_0x1e11('0x15'));var qs=require(_0x1e11('0x16'));var as=require(_0x1e11('0x17'));var hardwareService=require(_0x1e11('0x18'));var logger=require(_0x1e11('0x19'))(_0x1e11('0x1a'));var utils=require(_0x1e11('0x1b'));var config=require(_0x1e11('0x1c'));var licenseUtil=require(_0x1e11('0x1d'));var db=require(_0x1e11('0x1e'))['db'];function respondWithStatusCode(_0x3c77cd,_0x3a4eb5){_0x3a4eb5=_0x3a4eb5||0xcc;return function(_0x4e4fdc){if(_0x4e4fdc){return _0x3c77cd['sendStatus'](_0x3a4eb5);}return _0x3c77cd[_0x1e11('0x1f')](_0x3a4eb5)[_0x1e11('0x20')]();};}function respondWithResult(_0x2244ff,_0xc35dae){_0xc35dae=_0xc35dae||0xc8;return function(_0x2b7a19){if(_0x2b7a19){return _0x2244ff[_0x1e11('0x1f')](_0xc35dae)[_0x1e11('0x21')](_0x2b7a19);}};}function respondWithFilteredResult(_0x5a2610,_0x392316){return function(_0x5747a2){if(_0x5747a2){var _0x211676=typeof _0x392316['offset']==='undefined'&&typeof _0x392316['limit']===_0x1e11('0x22');var _0x44d068=_0x5747a2[_0x1e11('0x23')];var _0x395461=_0x211676?0x0:_0x392316[_0x1e11('0x24')];var _0x4cc41d=_0x211676?_0x5747a2[_0x1e11('0x23')]:_0x392316[_0x1e11('0x24')]+_0x392316[_0x1e11('0x25')];var _0x45370c;if(_0x4cc41d>=_0x44d068){_0x4cc41d=_0x44d068;_0x45370c=0xc8;}else{_0x45370c=0xce;}_0x5a2610['status'](_0x45370c);return _0x5a2610[_0x1e11('0x26')](_0x1e11('0x27'),_0x395461+'-'+_0x4cc41d+'/'+_0x44d068)[_0x1e11('0x21')](_0x5747a2);}return null;};}function patchUpdates(_0x1b19ed){return function(_0x29f18e){try{jsonpatch[_0x1e11('0x28')](_0x29f18e,_0x1b19ed,!![]);}catch(_0x2c7d22){return BPromise['reject'](_0x2c7d22);}return _0x29f18e[_0x1e11('0x29')]();};}function saveUpdates(_0x4019bc,_0x4a97a0){return function(_0x55e005){if(_0x55e005){return _0x55e005[_0x1e11('0x2a')](_0x4019bc)[_0x1e11('0x2b')](function(_0x7ebbc9){return _0x7ebbc9;});}return null;};}function removeEntity(_0x1e9f07,_0xefc126){return function(_0x15a589){if(_0x15a589){return _0x15a589[_0x1e11('0x2c')]()[_0x1e11('0x2b')](function(){_0x1e9f07['status'](0xcc)[_0x1e11('0x20')]();});}};}function handleEntityNotFound(_0x50b205,_0x5dc61c){return function(_0x4c7dd2){if(!_0x4c7dd2){_0x50b205[_0x1e11('0x2d')](0x194);}return _0x4c7dd2;};}function handleError(_0x39979b,_0x12fa5e){_0x12fa5e=_0x12fa5e||0x1f4;return function(_0x11a39b){logger[_0x1e11('0x2e')](_0x11a39b[_0x1e11('0x2f')]);if(_0x11a39b[_0x1e11('0x30')]){delete _0x11a39b['name'];}_0x39979b[_0x1e11('0x1f')](_0x12fa5e)[_0x1e11('0x31')](_0x11a39b);};}exports[_0x1e11('0x32')]=function(_0xd4ceb0,_0x2abb28){var _0x37ebcb={},_0x52079a={},_0x2373ff={'count':0x0,'rows':[]};var _0x2db8d1=_[_0x1e11('0x33')](db[_0x1e11('0x34')][_0x1e11('0x35')],function(_0x36317d){return{'name':_0x36317d['fieldName'],'type':_0x36317d[_0x1e11('0x36')][_0x1e11('0x37')]};});_0x52079a[_0x1e11('0x38')]=_[_0x1e11('0x33')](_0x2db8d1,'name');_0x52079a[_0x1e11('0x39')]=_[_0x1e11('0x3a')](_0xd4ceb0[_0x1e11('0x39')]);_0x52079a['filters']=_[_0x1e11('0x3b')](_0x52079a['model'],_0x52079a[_0x1e11('0x39')]);_0x37ebcb[_0x1e11('0x3c')]=_[_0x1e11('0x3b')](_0x52079a[_0x1e11('0x38')],qs[_0x1e11('0x3d')](_0xd4ceb0['query'][_0x1e11('0x3d')]));_0x37ebcb[_0x1e11('0x3c')]=_0x37ebcb[_0x1e11('0x3c')]['length']?_0x37ebcb[_0x1e11('0x3c')]:_0x52079a['model'];if(!_0xd4ceb0[_0x1e11('0x39')][_0x1e11('0x3e')]('nolimit')){_0x37ebcb['limit']=qs[_0x1e11('0x25')](_0xd4ceb0[_0x1e11('0x39')]['limit']);_0x37ebcb[_0x1e11('0x24')]=qs[_0x1e11('0x24')](_0xd4ceb0['query']['offset']);}_0x37ebcb['order']=qs[_0x1e11('0x3f')](_0xd4ceb0['query']['sort']);_0x37ebcb[_0x1e11('0x40')]=qs[_0x1e11('0x41')](_[_0x1e11('0x42')](_0xd4ceb0[_0x1e11('0x39')],_0x52079a['filters']),_0x2db8d1);if(_0xd4ceb0['query'][_0x1e11('0x43')]){_0x37ebcb[_0x1e11('0x40')]=_[_0x1e11('0x44')](_0x37ebcb[_0x1e11('0x40')],{'$or':_[_0x1e11('0x33')](_0x2db8d1,function(_0x21b96a){if(_0x21b96a['type']!==_0x1e11('0x45')){var _0x2c82a5={};_0x2c82a5[_0x21b96a[_0x1e11('0x30')]]={'$like':'%'+_0xd4ceb0[_0x1e11('0x39')]['filter']+'%'};return _0x2c82a5;}})});}_0x37ebcb=_[_0x1e11('0x44')]({},_0x37ebcb,_0xd4ceb0['options']);var _0x6bca6={'where':_0x37ebcb[_0x1e11('0x40')]};return db[_0x1e11('0x34')][_0x1e11('0x23')](_0x6bca6)[_0x1e11('0x2b')](function(_0x23f1d1){_0x2373ff['count']=_0x23f1d1;if(_0xd4ceb0['query'][_0x1e11('0x46')]){_0x37ebcb[_0x1e11('0x47')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1e11('0x48')](_0x37ebcb);})[_0x1e11('0x2b')](function(_0x7a509f){_0x2373ff['rows']=_0x7a509f;return _0x2373ff;})[_0x1e11('0x2b')](respondWithFilteredResult(_0x2abb28,_0x37ebcb))[_0x1e11('0x49')](handleError(_0x2abb28,null));};exports[_0x1e11('0x4a')]=function(_0x30d37e,_0x1cc0ce){var _0x55d442={'raw':![],'where':{'id':_0x30d37e[_0x1e11('0x4b')]['id']}},_0x298349={};_0x298349[_0x1e11('0x38')]=_['keys'](db[_0x1e11('0x34')][_0x1e11('0x35')]);_0x298349[_0x1e11('0x39')]=_[_0x1e11('0x3a')](_0x30d37e['query']);_0x298349[_0x1e11('0x41')]=_['intersection'](_0x298349[_0x1e11('0x38')],_0x298349[_0x1e11('0x39')]);_0x55d442[_0x1e11('0x3c')]=_['intersection'](_0x298349[_0x1e11('0x38')],qs[_0x1e11('0x3d')](_0x30d37e[_0x1e11('0x39')][_0x1e11('0x3d')]));_0x55d442[_0x1e11('0x3c')]=_0x55d442[_0x1e11('0x3c')][_0x1e11('0x4c')]?_0x55d442[_0x1e11('0x3c')]:_0x298349[_0x1e11('0x38')];if(_0x30d37e[_0x1e11('0x39')][_0x1e11('0x46')]){_0x55d442['include']=[{'all':!![]}];}_0x55d442=_[_0x1e11('0x44')]({},_0x55d442,_0x30d37e['options']);return db[_0x1e11('0x34')][_0x1e11('0x4d')](_0x55d442)[_0x1e11('0x2b')](handleEntityNotFound(_0x1cc0ce,null))[_0x1e11('0x2b')](respondWithResult(_0x1cc0ce,null))[_0x1e11('0x49')](handleError(_0x1cc0ce,null));};exports['create']=function(_0x54da78,_0x3d4e9e){return db[_0x1e11('0x34')][_0x1e11('0x4e')](_0x54da78[_0x1e11('0x4f')],{})[_0x1e11('0x2b')](respondWithResult(_0x3d4e9e,0xc9))[_0x1e11('0x49')](handleError(_0x3d4e9e,null));};exports[_0x1e11('0x50')]=function(_0x5919a6,_0x49c20d){return db['AnalyticFieldReport'][_0x1e11('0x50')](_0x5919a6['body'],{'raw':![],'individualHooks':!![]})[_0x1e11('0x2b')](respondWithResult(_0x49c20d,0xc9))[_0x1e11('0x49')](handleError(_0x49c20d,null));};exports[_0x1e11('0x2a')]=function(_0xc7779e,_0x429a06){if(_0xc7779e['body']['id']){delete _0xc7779e[_0x1e11('0x4f')]['id'];}return db['AnalyticFieldReport'][_0x1e11('0x4d')]({'where':{'id':_0xc7779e[_0x1e11('0x4b')]['id']}})[_0x1e11('0x2b')](handleEntityNotFound(_0x429a06,null))[_0x1e11('0x2b')](saveUpdates(_0xc7779e[_0x1e11('0x4f')],null))[_0x1e11('0x2b')](respondWithResult(_0x429a06,null))[_0x1e11('0x49')](handleError(_0x429a06,null));};exports[_0x1e11('0x2c')]=function(_0x1e9513,_0x34469e){return db['AnalyticFieldReport'][_0x1e11('0x4d')]({'where':{'id':_0x1e9513[_0x1e11('0x4b')]['id']}})[_0x1e11('0x2b')](handleEntityNotFound(_0x34469e,null))[_0x1e11('0x2b')](removeEntity(_0x34469e,null))['catch'](handleError(_0x34469e,null));};exports[_0x1e11('0x51')]=function(_0x491ae5,_0x3f8d03){return db['AnalyticFieldReport'][_0x1e11('0x2c')]({'where':{'id':_0x491ae5[_0x1e11('0x39')][_0x1e11('0x52')]||[]},'raw':![],'individualHooks':!![]})[_0x1e11('0x2b')](respondWithResult(_0x3f8d03,0xcc))[_0x1e11('0x49')](handleError(_0x3f8d03,null));};exports[_0x1e11('0x53')]=function(_0x59c46f,_0x215fc6,_0x41d393){return db[_0x1e11('0x54')][_0x1e11('0x55')]({'where':{'id':_0x59c46f[_0x1e11('0x4b')]['id']}})[_0x1e11('0x2b')](handleEntityNotFound(_0x215fc6,null))[_0x1e11('0x2b')](function(_0x45c6c5){if(_0x45c6c5){return db[_0x1e11('0x56')]['transaction'](function(_0x409f1f){return db[_0x1e11('0x34')][_0x1e11('0x2c')]({'where':{'CustomReportId':_0x59c46f[_0x1e11('0x4b')]['id']},'transaction':_0x409f1f})['then'](function(_0x3dca98){var _0x13d2cb=_[_0x1e11('0x33')](_0x59c46f[_0x1e11('0x4f')],function(_0x5f2e0c){delete _0x5f2e0c['id'];_0x5f2e0c[_0x1e11('0x57')]=_0x59c46f['params']['id'];return _0x5f2e0c;});return db[_0x1e11('0x34')][_0x1e11('0x50')](_0x13d2cb,{'transaction':_0x409f1f});});})[_0x1e11('0x2b')](function(){return db[_0x1e11('0x34')][_0x1e11('0x48')]({'where':{'CustomReportId':_0x59c46f[_0x1e11('0x4b')]['id']}});});}})[_0x1e11('0x2b')](respondWithResult(_0x215fc6,null))['catch'](handleError(_0x215fc6,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 410c78d..288a702 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 _0x13b5=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x1d9ee5,_0x102662){var _0x3924c2=function(_0x3774f9){while(--_0x3774f9){_0x1d9ee5['push'](_0x1d9ee5['shift']());}};_0x3924c2(++_0x102662);}(_0x13b5,0x1ea));var _0x513b=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x13b5[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x513b('0x0'));var util=require(_0x513b('0x1'));var logger=require(_0x513b('0x2'))(_0x513b('0x3'));var moment=require('moment');var BPromise=require(_0x513b('0x4'));var rp=require(_0x513b('0x5'));var fs=require('fs');var path=require(_0x513b('0x6'));var rimraf=require(_0x513b('0x7'));var config=require(_0x513b('0x8'));var attributes=require(_0x513b('0x9'));module['exports']=function(_0x5c1800,_0x2f6a2e){return _0x5c1800['define'](_0x513b('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a4e=['../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x7a4e,0x1a2));var _0xe7a4=function(_0xf244e0,_0x20556c){_0xf244e0=_0xf244e0-0x0;var _0xe94095=_0x7a4e[_0xf244e0];return _0xe94095;};'use strict';var _=require(_0xe7a4('0x0'));var util=require(_0xe7a4('0x1'));var logger=require(_0xe7a4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe7a4('0x3'));var rp=require(_0xe7a4('0x4'));var fs=require('fs');var path=require(_0xe7a4('0x5'));var rimraf=require('rimraf');var config=require(_0xe7a4('0x6'));var attributes=require(_0xe7a4('0x7'));module[_0xe7a4('0x8')]=function(_0x51f322,_0x49f1c5){return _0x51f322[_0xe7a4('0x9')](_0xe7a4('0xa'),attributes,{'tableName':_0xe7a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 869f918..353d089 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 _0xb166=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xb166,0x6d));var _0x6b16=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xb166[_0x502953];return _0x2fa32d;};'use strict';var _=require(_0x6b16('0x0'));var util=require(_0x6b16('0x1'));var moment=require(_0x6b16('0x2'));var BPromise=require(_0x6b16('0x3'));var rs=require(_0x6b16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b16('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6b16('0x6'));var config=require(_0x6b16('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b16('0x8')][_0x6b16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f97ca,_0x30841f,_0x461f2d){return new BPromise(function(_0x5ae6ba,_0x16662d){return client[_0x6b16('0xa')](_0x2f97ca,_0x461f2d)[_0x6b16('0xb')](function(_0x29da7c){logger[_0x6b16('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x30841f,_0x6b16('0xd'));logger[_0x6b16('0xe')](_0x6b16('0xf'),_0x30841f,'request\x20sent',JSON[_0x6b16('0x10')](_0x29da7c));if(_0x29da7c[_0x6b16('0x11')]){if(_0x29da7c['error']['code']===0x1f4){logger[_0x6b16('0x11')](_0x6b16('0x12'),_0x30841f,_0x29da7c[_0x6b16('0x11')][_0x6b16('0x13')]);return _0x16662d(_0x29da7c['error'][_0x6b16('0x13')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x30841f,_0x29da7c[_0x6b16('0x11')]['message']);return _0x5ae6ba(_0x29da7c[_0x6b16('0x11')][_0x6b16('0x13')]);}else{logger[_0x6b16('0xc')](_0x6b16('0x12'),_0x30841f,'request\x20sent');_0x5ae6ba(_0x29da7c[_0x6b16('0x14')][_0x6b16('0x13')]);}})[_0x6b16('0x15')](function(_0x397d63){logger[_0x6b16('0x11')](_0x6b16('0x12'),_0x30841f,_0x397d63);_0x16662d(_0x397d63);});});} \ No newline at end of file +var _0x054b=['then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x23e49e,_0x47a8b6){var _0x1cb7b5=function(_0x1683a2){while(--_0x1683a2){_0x23e49e['push'](_0x23e49e['shift']());}};_0x1cb7b5(++_0x47a8b6);}(_0x054b,0x1c3));var _0xb054=function(_0x1125d1,_0x277a68){_0x1125d1=_0x1125d1-0x0;var _0x3b7017=_0x054b[_0x1125d1];return _0x3b7017;};'use strict';var _=require(_0xb054('0x0'));var util=require(_0xb054('0x1'));var moment=require(_0xb054('0x2'));var BPromise=require(_0xb054('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb054('0x4'));var db=require(_0xb054('0x5'))['db'];var utils=require(_0xb054('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb054('0x7'));var client=jayson[_0xb054('0x8')][_0xb054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x320d13,_0x29bd0b,_0xcd10e3){return new BPromise(function(_0x353c1a,_0x5d659e){return client[_0xb054('0xa')](_0x320d13,_0xcd10e3)[_0xb054('0xb')](function(_0x435249){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x29bd0b,_0xb054('0xc'));logger[_0xb054('0xd')](_0xb054('0xe'),_0x29bd0b,_0xb054('0xc'),JSON[_0xb054('0xf')](_0x435249));if(_0x435249['error']){if(_0x435249[_0xb054('0x10')][_0xb054('0x11')]===0x1f4){logger[_0xb054('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29bd0b,_0x435249['error'][_0xb054('0x12')]);return _0x5d659e(_0x435249[_0xb054('0x10')][_0xb054('0x12')]);}logger['error'](_0xb054('0x13'),_0x29bd0b,_0x435249[_0xb054('0x10')]['message']);return _0x353c1a(_0x435249['error'][_0xb054('0x12')]);}else{logger['info'](_0xb054('0x13'),_0x29bd0b,'request\x20sent');_0x353c1a(_0x435249[_0xb054('0x14')][_0xb054('0x12')]);}})[_0xb054('0x15')](function(_0x4b1d47){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x29bd0b,_0x4b1d47);_0x5d659e(_0x4b1d47);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index edefa50..31011b8 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(_0x39a6f5,_0x4f0afb){var _0x1ee0a2=function(_0x3445ac){while(--_0x3445ac){_0x39a6f5['push'](_0x39a6f5['shift']());}};_0x1ee0a2(++_0x4f0afb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x18d25a,_0x3d1232){var _0x192735=function(_0x548815){while(--_0x548815){_0x18d25a['push'](_0x18d25a['shift']());}};_0x192735(++_0x3d1232);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 8c49f5f..14fd43f 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 _0xc788=['sequelize','exports','STRING','TEXT'];(function(_0x3cb626,_0x5d72a5){var _0x46d80d=function(_0x965210){while(--_0x965210){_0x3cb626['push'](_0x3cb626['shift']());}};_0x46d80d(++_0x5d72a5);}(_0xc788,0xc4));var _0x8c78=function(_0xefdc1c,_0x10f40b){_0xefdc1c=_0xefdc1c-0x0;var _0x48581c=_0xc788[_0xefdc1c];return _0x48581c;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'name':{'type':Sequelize[_0x8c78('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8c78('0x3')]},'description':{'type':Sequelize[_0x8c78('0x2')]}}; \ No newline at end of file +var _0x2547=['TEXT','exports','STRING','name'];(function(_0x10b069,_0x31290c){var _0xf909cb=function(_0x1f0eae){while(--_0x1f0eae){_0x10b069['push'](_0x10b069['shift']());}};_0xf909cb(++_0x31290c);}(_0x2547,0x1cd));var _0x7254=function(_0x15ee9c,_0x2cba01){_0x15ee9c=_0x15ee9c-0x0;var _0x8de212=_0x2547[_0x15ee9c];return _0x8de212;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![],'unique':_0x7254('0x2')},'table':{'type':Sequelize[_0x7254('0x1')]},'metric':{'type':Sequelize[_0x7254('0x3')]},'description':{'type':Sequelize[_0x7254('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 05b4622..c7ce0ac 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x5e3167,_0xf05dcd){var _0x17f61c=function(_0x19efd9){while(--_0x19efd9){_0x5e3167['push'](_0x5e3167['shift']());}};_0x17f61c(++_0xf05dcd);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x28f87e,_0x401778){_0x28f87e=_0x28f87e-0x0;var _0x166c9d=_0x9c5a[_0x28f87e];return _0x166c9d;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file +var _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d1d0392..5d86c8f 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 _0x0738=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger'];(function(_0x29ced0,_0x152d0b){var _0x1b068e=function(_0x2ff695){while(--_0x2ff695){_0x29ced0['push'](_0x29ced0['shift']());}};_0x1b068e(++_0x152d0b);}(_0x0738,0x6e));var _0x8073=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x0738[_0x267d8d];return _0x11a98f;};'use strict';var _=require(_0x8073('0x0'));var util=require('util');var logger=require(_0x8073('0x1'))(_0x8073('0x2'));var moment=require(_0x8073('0x3'));var BPromise=require(_0x8073('0x4'));var rp=require(_0x8073('0x5'));var fs=require('fs');var path=require(_0x8073('0x6'));var rimraf=require(_0x8073('0x7'));var config=require(_0x8073('0x8'));var attributes=require(_0x8073('0x9'));module[_0x8073('0xa')]=function(_0x2f90b9,_0x588057){return _0x2f90b9[_0x8073('0xb')](_0x8073('0xc'),attributes,{'tableName':_0x8073('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dee=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x2c060a,_0x1112bb){var _0x7f244=function(_0x4ac16d){while(--_0x4ac16d){_0x2c060a['push'](_0x2c060a['shift']());}};_0x7f244(++_0x1112bb);}(_0x0dee,0xf7));var _0xe0de=function(_0x4ad43a,_0xc1e7ad){_0x4ad43a=_0x4ad43a-0x0;var _0x5576f7=_0x0dee[_0x4ad43a];return _0x5576f7;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var logger=require('../../config/logger')(_0xe0de('0x2'));var moment=require('moment');var BPromise=require(_0xe0de('0x3'));var rp=require(_0xe0de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0de('0x5'));var config=require(_0xe0de('0x6'));var attributes=require(_0xe0de('0x7'));module['exports']=function(_0x2fc94c,_0x4957d7){return _0x2fc94c[_0xe0de('0x8')](_0xe0de('0x9'),attributes,{'tableName':_0xe0de('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 93a1e44..028948d 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 _0x05d1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','util','moment'];(function(_0x4de86b,_0x5eb642){var _0x306c57=function(_0x20ab50){while(--_0x20ab50){_0x4de86b['push'](_0x4de86b['shift']());}};_0x306c57(++_0x5eb642);}(_0x05d1,0xb6));var _0x105d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x05d1[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x105d('0x0'));var moment=require(_0x105d('0x1'));var BPromise=require(_0x105d('0x2'));var rs=require(_0x105d('0x3'));var fs=require('fs');var Redis=require(_0x105d('0x4'));var db=require(_0x105d('0x5'))['db'];var utils=require(_0x105d('0x6'));var logger=require('../../config/logger')(_0x105d('0x7'));var config=require(_0x105d('0x8'));var jayson=require(_0x105d('0x9'));var client=jayson[_0x105d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365ca3,_0x3bac66,_0x2151e2){return new BPromise(function(_0x557071,_0x1a26af){return client['request'](_0x365ca3,_0x2151e2)[_0x105d('0xb')](function(_0x5ae136){logger[_0x105d('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x3bac66,_0x105d('0xd'));logger[_0x105d('0xe')](_0x105d('0xf'),_0x3bac66,_0x105d('0xd'),JSON[_0x105d('0x10')](_0x5ae136));if(_0x5ae136[_0x105d('0x11')]){if(_0x5ae136[_0x105d('0x11')][_0x105d('0x12')]===0x1f4){logger[_0x105d('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x3bac66,_0x5ae136[_0x105d('0x11')][_0x105d('0x13')]);return _0x1a26af(_0x5ae136[_0x105d('0x11')][_0x105d('0x13')]);}logger[_0x105d('0x11')](_0x105d('0x14'),_0x3bac66,_0x5ae136['error'][_0x105d('0x13')]);return _0x557071(_0x5ae136['error']['message']);}else{logger[_0x105d('0xc')](_0x105d('0x14'),_0x3bac66,_0x105d('0xd'));_0x557071(_0x5ae136[_0x105d('0x15')][_0x105d('0x13')]);}})[_0x105d('0x16')](function(_0x1ac59f){logger[_0x105d('0x11')](_0x105d('0x14'),_0x3bac66,_0x1ac59f);_0x1a26af(_0x1ac59f);});});} \ No newline at end of file +var _0x1c85=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x5254a4,_0x39a978){var _0x2c6b70=function(_0x6a32ff){while(--_0x6a32ff){_0x5254a4['push'](_0x5254a4['shift']());}};_0x2c6b70(++_0x39a978);}(_0x1c85,0x15b));var _0x51c8=function(_0x1b166f,_0x4b48de){_0x1b166f=_0x1b166f-0x0;var _0x4afd9b=_0x1c85[_0x1b166f];return _0x4afd9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x51c8('0x0'));var rs=require(_0x51c8('0x1'));var fs=require('fs');var Redis=require(_0x51c8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x51c8('0x3'));var logger=require('../../config/logger')(_0x51c8('0x4'));var config=require(_0x51c8('0x5'));var jayson=require(_0x51c8('0x6'));var client=jayson[_0x51c8('0x7')][_0x51c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbef1b,_0x24a17d,_0x3c032a){return new BPromise(function(_0x3ec598,_0x480af7){return client[_0x51c8('0x9')](_0xbef1b,_0x3c032a)[_0x51c8('0xa')](function(_0x44c40a){logger[_0x51c8('0xb')](_0x51c8('0xc'),_0x24a17d,_0x51c8('0xd'));logger[_0x51c8('0xe')](_0x51c8('0xf'),_0x24a17d,_0x51c8('0xd'),JSON[_0x51c8('0x10')](_0x44c40a));if(_0x44c40a['error']){if(_0x44c40a[_0x51c8('0x11')][_0x51c8('0x12')]===0x1f4){logger['error'](_0x51c8('0xc'),_0x24a17d,_0x44c40a[_0x51c8('0x11')][_0x51c8('0x13')]);return _0x480af7(_0x44c40a[_0x51c8('0x11')][_0x51c8('0x13')]);}logger[_0x51c8('0x11')](_0x51c8('0xc'),_0x24a17d,_0x44c40a[_0x51c8('0x11')][_0x51c8('0x13')]);return _0x3ec598(_0x44c40a[_0x51c8('0x11')]['message']);}else{logger[_0x51c8('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x24a17d,_0x51c8('0xd'));_0x3ec598(_0x44c40a[_0x51c8('0x14')][_0x51c8('0x13')]);}})[_0x51c8('0x15')](function(_0x948b0c){logger[_0x51c8('0x11')](_0x51c8('0xc'),_0x24a17d,_0x948b0c);_0x480af7(_0x948b0c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f9b8901..4fec096 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 _0x1939=['show','post','create','put','update','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1891c8,_0x45b3c9){var _0xd17a4a=function(_0x51c661){while(--_0x51c661){_0x1891c8['push'](_0x1891c8['shift']());}};_0xd17a4a(++_0x45b3c9);}(_0x1939,0x1d1));var _0x9193=function(_0x39285d,_0x4e7c32){_0x39285d=_0x39285d-0x0;var _0x5b809b=_0x1939[_0x39285d];return _0x5b809b;};'use strict';var multer=require(_0x9193('0x0'));var util=require('util');var path=require(_0x9193('0x1'));var timeout=require(_0x9193('0x2'));var express=require(_0x9193('0x3'));var router=express['Router']();var fs_extra=require(_0x9193('0x4'));var auth=require(_0x9193('0x5'));var interaction=require(_0x9193('0x6'));var config=require(_0x9193('0x7'));var controller=require('./analyticMetric.controller');router[_0x9193('0x8')]('/',auth[_0x9193('0x9')](),controller['index']);router[_0x9193('0x8')](_0x9193('0xa'),auth[_0x9193('0x9')](),controller[_0x9193('0xb')]);router[_0x9193('0xc')]('/',auth['isAuthenticated'](),controller[_0x9193('0xd')]);router[_0x9193('0xe')](_0x9193('0xa'),auth[_0x9193('0x9')](),controller[_0x9193('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9193('0x10')]);module['exports']=router; \ No newline at end of file +var _0xabe8=['post','create','put','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xabe8,0x8c));var _0x8abe=function(_0x46ffcd,_0xbb8153){_0x46ffcd=_0x46ffcd-0x0;var _0xd89df6=_0xabe8[_0x46ffcd];return _0xd89df6;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abe('0x3'));var router=express[_0x8abe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8abe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8abe('0x6'));var controller=require(_0x8abe('0x7'));router[_0x8abe('0x8')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0xa')]);router['get']('/:id',auth[_0x8abe('0x9')](),controller[_0x8abe('0xb')]);router[_0x8abe('0xc')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0xd')]);router[_0x8abe('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8abe('0xf')](_0x8abe('0x10'),auth[_0x8abe('0x9')](),controller[_0x8abe('0x11')]);module[_0x8abe('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ea49c37..8c2191c 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 _0x2b2e=['exports','TEXT','sequelize'];(function(_0x244380,_0x28b8c6){var _0x34ea70=function(_0x2d3a43){while(--_0x2d3a43){_0x244380['push'](_0x244380['shift']());}};_0x34ea70(++_0x28b8c6);}(_0x2b2e,0xc8));var _0xe2b2=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2b2e[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xe2b2('0x0'));module[_0xe2b2('0x1')]={'tree':{'type':Sequelize[_0xe2b2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x849f=['exports','TEXT','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x849f,0x8c));var _0xf849=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x849f[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0xf849('0x0'));module[_0xf849('0x1')]={'tree':{'type':Sequelize[_0xf849('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 a1d267a..20e97e2 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 _0xd250=['update','then','destroy','error','name','send','index','AnalyticTreeReport','type','key','query','intersection','attributes','fields','length','model','nolimit','sort','where','filters','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x133163,_0x24d7ff){var _0x347e54=function(_0x306494){while(--_0x306494){_0x133163['push'](_0x133163['shift']());}};_0x347e54(++_0x24d7ff);}(_0xd250,0xaf));var _0x0d25=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xd250[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d25('0x0'));var zipdir=require(_0x0d25('0x1'));var jsonpatch=require(_0x0d25('0x2'));var rp=require(_0x0d25('0x3'));var moment=require(_0x0d25('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d25('0x5'));var path=require('path');var sox=require(_0x0d25('0x6'));var csv=require(_0x0d25('0x7'));var ejs=require(_0x0d25('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0d25('0x9'));var crypto=require(_0x0d25('0xa'));var jsforce=require(_0x0d25('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d25('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0d25('0xc'));var authService=require(_0x0d25('0xd'));var qs=require(_0x0d25('0xe'));var as=require(_0x0d25('0xf'));var hardwareService=require(_0x0d25('0x10'));var logger=require(_0x0d25('0x11'))('api');var utils=require(_0x0d25('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0d25('0x13'));var db=require(_0x0d25('0x14'))['db'];function respondWithStatusCode(_0x22ae05,_0x33890d){_0x33890d=_0x33890d||0xcc;return function(_0x215940){if(_0x215940){return _0x22ae05[_0x0d25('0x15')](_0x33890d);}return _0x22ae05[_0x0d25('0x16')](_0x33890d)[_0x0d25('0x17')]();};}function respondWithResult(_0xae0e93,_0x5c8e10){_0x5c8e10=_0x5c8e10||0xc8;return function(_0x1cbee4){if(_0x1cbee4){return _0xae0e93[_0x0d25('0x16')](_0x5c8e10)[_0x0d25('0x18')](_0x1cbee4);}};}function respondWithFilteredResult(_0x3d5ef8,_0xbcc8c8){return function(_0x2b7827){if(_0x2b7827){var _0x5df53b=typeof _0xbcc8c8[_0x0d25('0x19')]===_0x0d25('0x1a')&&typeof _0xbcc8c8[_0x0d25('0x1b')]==='undefined';var _0x589a84=_0x2b7827[_0x0d25('0x1c')];var _0xd17077=_0x5df53b?0x0:_0xbcc8c8[_0x0d25('0x19')];var _0x51e0c3=_0x5df53b?_0x2b7827[_0x0d25('0x1c')]:_0xbcc8c8['offset']+_0xbcc8c8[_0x0d25('0x1b')];var _0x41b3ce;if(_0x51e0c3>=_0x589a84){_0x51e0c3=_0x589a84;_0x41b3ce=0xc8;}else{_0x41b3ce=0xce;}_0x3d5ef8[_0x0d25('0x16')](_0x41b3ce);return _0x3d5ef8[_0x0d25('0x1d')](_0x0d25('0x1e'),_0xd17077+'-'+_0x51e0c3+'/'+_0x589a84)[_0x0d25('0x18')](_0x2b7827);}return null;};}function patchUpdates(_0x125860){return function(_0x3ae18d){try{jsonpatch['apply'](_0x3ae18d,_0x125860,!![]);}catch(_0x2e4e22){return BPromise['reject'](_0x2e4e22);}return _0x3ae18d[_0x0d25('0x1f')]();};}function saveUpdates(_0x4386d9,_0x1558e6){return function(_0x1555c9){if(_0x1555c9){return _0x1555c9[_0x0d25('0x20')](_0x4386d9)[_0x0d25('0x21')](function(_0x13481e){return _0x13481e;});}return null;};}function removeEntity(_0x329eaf,_0x389be5){return function(_0xff3185){if(_0xff3185){return _0xff3185[_0x0d25('0x22')]()[_0x0d25('0x21')](function(){_0x329eaf[_0x0d25('0x16')](0xcc)[_0x0d25('0x17')]();});}};}function handleEntityNotFound(_0x5ce6fb,_0x111eaa){return function(_0x1f2e45){if(!_0x1f2e45){_0x5ce6fb['sendStatus'](0x194);}return _0x1f2e45;};}function handleError(_0x1720ae,_0x429349){_0x429349=_0x429349||0x1f4;return function(_0x127ac9){logger[_0x0d25('0x23')](_0x127ac9['stack']);if(_0x127ac9[_0x0d25('0x24')]){delete _0x127ac9[_0x0d25('0x24')];}_0x1720ae[_0x0d25('0x16')](_0x429349)[_0x0d25('0x25')](_0x127ac9);};}exports[_0x0d25('0x26')]=function(_0x44cd13,_0x2c9bd8){var _0x470372={},_0x57bed3={},_0x3b08ac={'count':0x0,'rows':[]};var _0x440e1e=_['map'](db[_0x0d25('0x27')]['rawAttributes'],function(_0x30ac00){return{'name':_0x30ac00['fieldName'],'type':_0x30ac00[_0x0d25('0x28')][_0x0d25('0x29')]};});_0x57bed3['model']=_['map'](_0x440e1e,_0x0d25('0x24'));_0x57bed3[_0x0d25('0x2a')]=_['keys'](_0x44cd13[_0x0d25('0x2a')]);_0x57bed3['filters']=_[_0x0d25('0x2b')](_0x57bed3['model'],_0x57bed3[_0x0d25('0x2a')]);_0x470372[_0x0d25('0x2c')]=_[_0x0d25('0x2b')](_0x57bed3['model'],qs[_0x0d25('0x2d')](_0x44cd13[_0x0d25('0x2a')][_0x0d25('0x2d')]));_0x470372['attributes']=_0x470372[_0x0d25('0x2c')][_0x0d25('0x2e')]?_0x470372['attributes']:_0x57bed3[_0x0d25('0x2f')];if(!_0x44cd13['query']['hasOwnProperty'](_0x0d25('0x30'))){_0x470372[_0x0d25('0x1b')]=qs[_0x0d25('0x1b')](_0x44cd13[_0x0d25('0x2a')][_0x0d25('0x1b')]);_0x470372[_0x0d25('0x19')]=qs[_0x0d25('0x19')](_0x44cd13['query'][_0x0d25('0x19')]);}_0x470372['order']=qs[_0x0d25('0x31')](_0x44cd13['query'][_0x0d25('0x31')]);_0x470372[_0x0d25('0x32')]=qs[_0x0d25('0x33')](_[_0x0d25('0x34')](_0x44cd13['query'],_0x57bed3['filters']),_0x440e1e);if(_0x44cd13[_0x0d25('0x2a')][_0x0d25('0x35')]){_0x470372[_0x0d25('0x32')]=_['merge'](_0x470372[_0x0d25('0x32')],{'$or':_[_0x0d25('0x36')](_0x440e1e,function(_0x43982d){if(_0x43982d[_0x0d25('0x28')]!=='VIRTUAL'){var _0x298fab={};_0x298fab[_0x43982d[_0x0d25('0x24')]]={'$like':'%'+_0x44cd13[_0x0d25('0x2a')]['filter']+'%'};return _0x298fab;}})});}_0x470372=_[_0x0d25('0x37')]({},_0x470372,_0x44cd13[_0x0d25('0x38')]);var _0x27b934={'where':_0x470372[_0x0d25('0x32')]};return db[_0x0d25('0x27')]['count'](_0x27b934)[_0x0d25('0x21')](function(_0x32af35){_0x3b08ac[_0x0d25('0x1c')]=_0x32af35;if(_0x44cd13[_0x0d25('0x2a')][_0x0d25('0x39')]){_0x470372[_0x0d25('0x3a')]=[{'all':!![]}];}return db[_0x0d25('0x27')][_0x0d25('0x3b')](_0x470372);})[_0x0d25('0x21')](function(_0x589baa){_0x3b08ac[_0x0d25('0x3c')]=_0x589baa;return _0x3b08ac;})[_0x0d25('0x21')](respondWithFilteredResult(_0x2c9bd8,_0x470372))[_0x0d25('0x3d')](handleError(_0x2c9bd8,null));};exports[_0x0d25('0x3e')]=function(_0x32d1bd,_0x21bfdb){var _0x19fd59={'raw':!![],'where':{'id':_0x32d1bd[_0x0d25('0x3f')]['id']}},_0x55b72a={};_0x55b72a['model']=_[_0x0d25('0x40')](db[_0x0d25('0x27')][_0x0d25('0x41')]);_0x55b72a[_0x0d25('0x2a')]=_[_0x0d25('0x40')](_0x32d1bd['query']);_0x55b72a[_0x0d25('0x33')]=_[_0x0d25('0x2b')](_0x55b72a['model'],_0x55b72a[_0x0d25('0x2a')]);_0x19fd59['attributes']=_[_0x0d25('0x2b')](_0x55b72a[_0x0d25('0x2f')],qs['fields'](_0x32d1bd[_0x0d25('0x2a')][_0x0d25('0x2d')]));_0x19fd59['attributes']=_0x19fd59['attributes'][_0x0d25('0x2e')]?_0x19fd59['attributes']:_0x55b72a['model'];if(_0x32d1bd[_0x0d25('0x2a')][_0x0d25('0x39')]){_0x19fd59[_0x0d25('0x3a')]=[{'all':!![]}];}_0x19fd59=_[_0x0d25('0x37')]({},_0x19fd59,_0x32d1bd[_0x0d25('0x38')]);return db[_0x0d25('0x27')][_0x0d25('0x42')](_0x19fd59)['then'](handleEntityNotFound(_0x21bfdb,null))[_0x0d25('0x21')](respondWithResult(_0x21bfdb,null))[_0x0d25('0x3d')](handleError(_0x21bfdb,null));};exports[_0x0d25('0x43')]=function(_0x5e10b9,_0x1db0fa){return db[_0x0d25('0x27')][_0x0d25('0x43')](_0x5e10b9['body'],{})[_0x0d25('0x21')](respondWithResult(_0x1db0fa,0xc9))[_0x0d25('0x3d')](handleError(_0x1db0fa,null));};exports[_0x0d25('0x20')]=function(_0x4d05c0,_0x10d879){if(_0x4d05c0[_0x0d25('0x44')]['id']){delete _0x4d05c0[_0x0d25('0x44')]['id'];}return db['AnalyticTreeReport'][_0x0d25('0x42')]({'where':{'id':_0x4d05c0['params']['id']}})['then'](handleEntityNotFound(_0x10d879,null))['then'](saveUpdates(_0x4d05c0[_0x0d25('0x44')],null))['then'](respondWithResult(_0x10d879,null))[_0x0d25('0x3d')](handleError(_0x10d879,null));};exports[_0x0d25('0x22')]=function(_0x6206c5,_0x53f6a8){return db[_0x0d25('0x27')][_0x0d25('0x42')]({'where':{'id':_0x6206c5['params']['id']}})[_0x0d25('0x21')](handleEntityNotFound(_0x53f6a8,null))[_0x0d25('0x21')](removeEntity(_0x53f6a8,null))['catch'](handleError(_0x53f6a8,null));}; \ No newline at end of file +var _0x13d5=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','filters','query','model','fields','attributes'];(function(_0x5c43f1,_0x3b6c6a){var _0x116916=function(_0x43c85d){while(--_0x43c85d){_0x5c43f1['push'](_0x5c43f1['shift']());}};_0x116916(++_0x3b6c6a);}(_0x13d5,0x151));var _0x513d=function(_0x16947f,_0x2d04b1){_0x16947f=_0x16947f-0x0;var _0x4f52c2=_0x13d5[_0x16947f];return _0x4f52c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x513d('0x0'));var zipdir=require(_0x513d('0x1'));var jsonpatch=require(_0x513d('0x2'));var rp=require('request-promise');var moment=require(_0x513d('0x3'));var BPromise=require(_0x513d('0x4'));var Mustache=require(_0x513d('0x5'));var util=require(_0x513d('0x6'));var path=require(_0x513d('0x7'));var sox=require(_0x513d('0x8'));var csv=require('to-csv');var ejs=require(_0x513d('0x9'));var fs=require('fs');var fs_extra=require(_0x513d('0xa'));var _=require(_0x513d('0xb'));var squel=require(_0x513d('0xc'));var crypto=require(_0x513d('0xd'));var jsforce=require(_0x513d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x513d('0xf'));var querystring=require(_0x513d('0x10'));var Papa=require(_0x513d('0x11'));var Redis=require(_0x513d('0x12'));var authService=require(_0x513d('0x13'));var qs=require(_0x513d('0x14'));var as=require(_0x513d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x513d('0x16'))('api');var utils=require(_0x513d('0x17'));var config=require(_0x513d('0x18'));var licenseUtil=require(_0x513d('0x19'));var db=require(_0x513d('0x1a'))['db'];function respondWithStatusCode(_0x38bf63,_0x3faf60){_0x3faf60=_0x3faf60||0xcc;return function(_0x31cc7a){if(_0x31cc7a){return _0x38bf63['sendStatus'](_0x3faf60);}return _0x38bf63['status'](_0x3faf60)['end']();};}function respondWithResult(_0x2bfe2f,_0x5f0f5d){_0x5f0f5d=_0x5f0f5d||0xc8;return function(_0xcaf6c0){if(_0xcaf6c0){return _0x2bfe2f[_0x513d('0x1b')](_0x5f0f5d)[_0x513d('0x1c')](_0xcaf6c0);}};}function respondWithFilteredResult(_0xbc45cd,_0x57637e){return function(_0x40f017){if(_0x40f017){var _0x2a4159=typeof _0x57637e['offset']===_0x513d('0x1d')&&typeof _0x57637e[_0x513d('0x1e')]===_0x513d('0x1d');var _0x1b39da=_0x40f017[_0x513d('0x1f')];var _0x3ef6b7=_0x2a4159?0x0:_0x57637e[_0x513d('0x20')];var _0x37d404=_0x2a4159?_0x40f017[_0x513d('0x1f')]:_0x57637e[_0x513d('0x20')]+_0x57637e[_0x513d('0x1e')];var _0x450e7b;if(_0x37d404>=_0x1b39da){_0x37d404=_0x1b39da;_0x450e7b=0xc8;}else{_0x450e7b=0xce;}_0xbc45cd[_0x513d('0x1b')](_0x450e7b);return _0xbc45cd[_0x513d('0x21')](_0x513d('0x22'),_0x3ef6b7+'-'+_0x37d404+'/'+_0x1b39da)[_0x513d('0x1c')](_0x40f017);}return null;};}function patchUpdates(_0x147a91){return function(_0x5d74d8){try{jsonpatch[_0x513d('0x23')](_0x5d74d8,_0x147a91,!![]);}catch(_0x4134d8){return BPromise['reject'](_0x4134d8);}return _0x5d74d8[_0x513d('0x24')]();};}function saveUpdates(_0x36939c,_0x3bdc34){return function(_0x338f4d){if(_0x338f4d){return _0x338f4d[_0x513d('0x25')](_0x36939c)[_0x513d('0x26')](function(_0x5e17da){return _0x5e17da;});}return null;};}function removeEntity(_0x4e127e,_0x42dec0){return function(_0x539c1c){if(_0x539c1c){return _0x539c1c[_0x513d('0x27')]()[_0x513d('0x26')](function(){_0x4e127e[_0x513d('0x1b')](0xcc)[_0x513d('0x28')]();});}};}function handleEntityNotFound(_0x3f53ac,_0x1a72d8){return function(_0x31ee01){if(!_0x31ee01){_0x3f53ac[_0x513d('0x29')](0x194);}return _0x31ee01;};}function handleError(_0x35bc04,_0x5ebf8f){_0x5ebf8f=_0x5ebf8f||0x1f4;return function(_0x4f5f48){logger[_0x513d('0x2a')](_0x4f5f48[_0x513d('0x2b')]);if(_0x4f5f48['name']){delete _0x4f5f48[_0x513d('0x2c')];}_0x35bc04[_0x513d('0x1b')](_0x5ebf8f)[_0x513d('0x2d')](_0x4f5f48);};}exports['index']=function(_0x57edfd,_0x148987){var _0x3768bb={},_0x44e30d={},_0x160865={'count':0x0,'rows':[]};var _0x4dfd58=_[_0x513d('0x2e')](db[_0x513d('0x2f')][_0x513d('0x30')],function(_0x49470b){return{'name':_0x49470b[_0x513d('0x31')],'type':_0x49470b[_0x513d('0x32')][_0x513d('0x33')]};});_0x44e30d['model']=_[_0x513d('0x2e')](_0x4dfd58,'name');_0x44e30d['query']=_[_0x513d('0x34')](_0x57edfd['query']);_0x44e30d[_0x513d('0x35')]=_['intersection'](_0x44e30d['model'],_0x44e30d[_0x513d('0x36')]);_0x3768bb['attributes']=_['intersection'](_0x44e30d[_0x513d('0x37')],qs[_0x513d('0x38')](_0x57edfd['query'][_0x513d('0x38')]));_0x3768bb['attributes']=_0x3768bb[_0x513d('0x39')][_0x513d('0x3a')]?_0x3768bb[_0x513d('0x39')]:_0x44e30d[_0x513d('0x37')];if(!_0x57edfd[_0x513d('0x36')][_0x513d('0x3b')](_0x513d('0x3c'))){_0x3768bb[_0x513d('0x1e')]=qs[_0x513d('0x1e')](_0x57edfd[_0x513d('0x36')]['limit']);_0x3768bb[_0x513d('0x20')]=qs[_0x513d('0x20')](_0x57edfd['query'][_0x513d('0x20')]);}_0x3768bb[_0x513d('0x3d')]=qs['sort'](_0x57edfd['query'][_0x513d('0x3e')]);_0x3768bb[_0x513d('0x3f')]=qs[_0x513d('0x35')](_[_0x513d('0x40')](_0x57edfd[_0x513d('0x36')],_0x44e30d['filters']),_0x4dfd58);if(_0x57edfd['query'][_0x513d('0x41')]){_0x3768bb[_0x513d('0x3f')]=_[_0x513d('0x42')](_0x3768bb['where'],{'$or':_[_0x513d('0x2e')](_0x4dfd58,function(_0x3d48c2){if(_0x3d48c2['type']!==_0x513d('0x43')){var _0x1f3822={};_0x1f3822[_0x3d48c2[_0x513d('0x2c')]]={'$like':'%'+_0x57edfd[_0x513d('0x36')][_0x513d('0x41')]+'%'};return _0x1f3822;}})});}_0x3768bb=_['merge']({},_0x3768bb,_0x57edfd[_0x513d('0x44')]);var _0x49547a={'where':_0x3768bb[_0x513d('0x3f')]};return db['AnalyticTreeReport']['count'](_0x49547a)['then'](function(_0x4eab88){_0x160865[_0x513d('0x1f')]=_0x4eab88;if(_0x57edfd['query'][_0x513d('0x45')]){_0x3768bb[_0x513d('0x46')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x513d('0x47')](_0x3768bb);})['then'](function(_0x35b0d7){_0x160865['rows']=_0x35b0d7;return _0x160865;})[_0x513d('0x26')](respondWithFilteredResult(_0x148987,_0x3768bb))[_0x513d('0x48')](handleError(_0x148987,null));};exports[_0x513d('0x49')]=function(_0x413df6,_0x5bab57){var _0x16d934={'raw':!![],'where':{'id':_0x413df6[_0x513d('0x4a')]['id']}},_0x53946a={};_0x53946a['model']=_[_0x513d('0x34')](db[_0x513d('0x2f')][_0x513d('0x30')]);_0x53946a[_0x513d('0x36')]=_[_0x513d('0x34')](_0x413df6[_0x513d('0x36')]);_0x53946a[_0x513d('0x35')]=_[_0x513d('0x4b')](_0x53946a[_0x513d('0x37')],_0x53946a[_0x513d('0x36')]);_0x16d934[_0x513d('0x39')]=_[_0x513d('0x4b')](_0x53946a[_0x513d('0x37')],qs['fields'](_0x413df6[_0x513d('0x36')][_0x513d('0x38')]));_0x16d934['attributes']=_0x16d934[_0x513d('0x39')][_0x513d('0x3a')]?_0x16d934[_0x513d('0x39')]:_0x53946a[_0x513d('0x37')];if(_0x413df6[_0x513d('0x36')]['includeAll']){_0x16d934['include']=[{'all':!![]}];}_0x16d934=_['merge']({},_0x16d934,_0x413df6[_0x513d('0x44')]);return db[_0x513d('0x2f')][_0x513d('0x4c')](_0x16d934)['then'](handleEntityNotFound(_0x5bab57,null))['then'](respondWithResult(_0x5bab57,null))[_0x513d('0x48')](handleError(_0x5bab57,null));};exports[_0x513d('0x4d')]=function(_0x299b53,_0x22c38c){return db[_0x513d('0x2f')]['create'](_0x299b53[_0x513d('0x4e')],{})[_0x513d('0x26')](respondWithResult(_0x22c38c,0xc9))['catch'](handleError(_0x22c38c,null));};exports[_0x513d('0x25')]=function(_0x5dffaf,_0x3ceab9){if(_0x5dffaf['body']['id']){delete _0x5dffaf[_0x513d('0x4e')]['id'];}return db[_0x513d('0x2f')][_0x513d('0x4c')]({'where':{'id':_0x5dffaf[_0x513d('0x4a')]['id']}})[_0x513d('0x26')](handleEntityNotFound(_0x3ceab9,null))['then'](saveUpdates(_0x5dffaf['body'],null))[_0x513d('0x26')](respondWithResult(_0x3ceab9,null))[_0x513d('0x48')](handleError(_0x3ceab9,null));};exports[_0x513d('0x27')]=function(_0x2a9365,_0x19c999){return db['AnalyticTreeReport']['find']({'where':{'id':_0x2a9365[_0x513d('0x4a')]['id']}})[_0x513d('0x26')](handleEntityNotFound(_0x19c999,null))[_0x513d('0x26')](removeEntity(_0x19c999,null))[_0x513d('0x48')](handleError(_0x19c999,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index c38c363..27b625d 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 _0x45b9=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','lodash','util'];(function(_0x1cb60b,_0xc04507){var _0x5cacd2=function(_0x2f9fe9){while(--_0x2f9fe9){_0x1cb60b['push'](_0x1cb60b['shift']());}};_0x5cacd2(++_0xc04507);}(_0x45b9,0x10c));var _0x945b=function(_0x451429,_0x5540dc){_0x451429=_0x451429-0x0;var _0x688119=_0x45b9[_0x451429];return _0x688119;};'use strict';var _=require(_0x945b('0x0'));var util=require(_0x945b('0x1'));var logger=require(_0x945b('0x2'))(_0x945b('0x3'));var moment=require(_0x945b('0x4'));var BPromise=require(_0x945b('0x5'));var rp=require(_0x945b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x945b('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5ca049,_0x4ba4d6){return _0x5ca049[_0x945b('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde30=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xde30,0x1c3));var _0x0de3=function(_0x4d36c8,_0x3fe2b6){_0x4d36c8=_0x4d36c8-0x0;var _0x5526bd=_0xde30[_0x4d36c8];return _0x5526bd;};'use strict';var _=require(_0x0de3('0x0'));var util=require('util');var logger=require(_0x0de3('0x1'))(_0x0de3('0x2'));var moment=require(_0x0de3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0de3('0x4'));var config=require(_0x0de3('0x5'));var attributes=require(_0x0de3('0x6'));module[_0x0de3('0x7')]=function(_0x53da15,_0x861b7d){return _0x53da15[_0x0de3('0x8')](_0x0de3('0x9'),attributes,{'tableName':_0x0de3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 68076a7..3b32e23 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e0dc6,_0x408e08){var _0x62f3e3=function(_0x42c2df){while(--_0x42c2df){_0x2e0dc6['push'](_0x2e0dc6['shift']());}};_0x62f3e3(++_0x408e08);}(_0x5f2f,0x73));var _0xf5f2=function(_0x457491,_0x53428d){_0x457491=_0x457491-0x0;var _0x15db5e=_0x5f2f[_0x457491];return _0x15db5e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x2ca4e1,_0xffc43c){_0x2ca4e1=_0x2ca4e1-0x0;var _0x1d8431=_0x7a54[_0x2ca4e1];return _0x1d8431;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 1c713d3..d6db367 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 _0xac95=['get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x6cbd24,_0x33fb45){var _0x3fe37f=function(_0x1ad909){while(--_0x1ad909){_0x6cbd24['push'](_0x6cbd24['shift']());}};_0x3fe37f(++_0x33fb45);}(_0xac95,0x173));var _0x5ac9=function(_0x5d8c95,_0x5e72c2){_0x5d8c95=_0x5d8c95-0x0;var _0x2d5999=_0xac95[_0x5d8c95];return _0x2d5999;};'use strict';var multer=require(_0x5ac9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5ac9('0x1'));var express=require(_0x5ac9('0x2'));var router=express[_0x5ac9('0x3')]();var fs_extra=require(_0x5ac9('0x4'));var auth=require(_0x5ac9('0x5'));var interaction=require(_0x5ac9('0x6'));var config=require(_0x5ac9('0x7'));var controller=require(_0x5ac9('0x8'));router[_0x5ac9('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ac9('0xa')]);router[_0x5ac9('0x9')](_0x5ac9('0xb'),auth[_0x5ac9('0xc')](),controller['show']);router[_0x5ac9('0xd')]('/',auth[_0x5ac9('0xc')](),controller[_0x5ac9('0xe')]);router[_0x5ac9('0xf')](_0x5ac9('0xb'),auth[_0x5ac9('0xc')](),controller[_0x5ac9('0x10')]);router[_0x5ac9('0x11')]('/:id',auth[_0x5ac9('0xc')](),controller[_0x5ac9('0x12')]);module[_0x5ac9('0x13')]=router; \ No newline at end of file +var _0x37a4=['put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x208c15,_0x4ce1e6){var _0x4d21ee=function(_0x37bf51){while(--_0x37bf51){_0x208c15['push'](_0x208c15['shift']());}};_0x4d21ee(++_0x4ce1e6);}(_0x37a4,0x16d));var _0x437a=function(_0x359b6f,_0x635a86){_0x359b6f=_0x359b6f-0x0;var _0x27976d=_0x37a4[_0x359b6f];return _0x27976d;};'use strict';var multer=require(_0x437a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x437a('0x1'));var express=require('express');var router=express[_0x437a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x437a('0x3'));var interaction=require(_0x437a('0x4'));var config=require(_0x437a('0x5'));var controller=require(_0x437a('0x6'));router[_0x437a('0x7')]('/',auth[_0x437a('0x8')](),controller[_0x437a('0x9')]);router[_0x437a('0x7')]('/:id',auth[_0x437a('0x8')](),controller[_0x437a('0xa')]);router[_0x437a('0xb')]('/',auth[_0x437a('0x8')](),controller[_0x437a('0xc')]);router[_0x437a('0xd')]('/:id',auth[_0x437a('0x8')](),controller[_0x437a('0xe')]);router[_0x437a('0xf')]('/:id',auth[_0x437a('0x8')](),controller[_0x437a('0x10')]);module[_0x437a('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a0b3c50..eca58f7 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 _0xf194=['STRING','sequelize','exports'];(function(_0x40c3ab,_0xfffd72){var _0x3b601e=function(_0x54c2d7){while(--_0x54c2d7){_0x40c3ab['push'](_0x40c3ab['shift']());}};_0x3b601e(++_0xfffd72);}(_0xf194,0x91));var _0x4f19=function(_0x35d4da,_0x2685f2){_0x35d4da=_0x35d4da-0x0;var _0x26f31e=_0xf194[_0x35d4da];return _0x26f31e;};'use strict';var Sequelize=require(_0x4f19('0x0'));module[_0x4f19('0x1')]={'name':{'type':Sequelize[_0x4f19('0x2')]},'basename':{'type':Sequelize[_0x4f19('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcdd0=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xcdd0[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x0cdd('0x0'));module[_0x0cdd('0x1')]={'name':{'type':Sequelize[_0x0cdd('0x2')]},'basename':{'type':Sequelize[_0x0cdd('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 451cc42..17bde09 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 _0xd704=['root','offline-chat/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','name','send','map','Attachment','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','VIRTUAL','merge','where','include','rows','show','params','rawAttributes','includeAll','options','find','catch','clone','get','omit','updatedAt','body','createdAt','create','originalname','filename','file','mimetype','download','findOne','join'];(function(_0x41094d,_0x4ca21d){var _0x503ee1=function(_0x7e4dac){while(--_0x7e4dac){_0x41094d['push'](_0x41094d['shift']());}};_0x503ee1(++_0x4ca21d);}(_0xd704,0x102));var _0x4d70=function(_0xb0f0f6,_0x4b07aa){_0xb0f0f6=_0xb0f0f6-0x0;var _0x3ac360=_0xd704[_0xb0f0f6];return _0x3ac360;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d70('0x0'));var zipdir=require(_0x4d70('0x1'));var jsonpatch=require(_0x4d70('0x2'));var rp=require(_0x4d70('0x3'));var moment=require(_0x4d70('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d70('0x5'));var util=require(_0x4d70('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d70('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d70('0x8'));var squel=require(_0x4d70('0x9'));var crypto=require(_0x4d70('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d70('0xb'));var querystring=require(_0x4d70('0xc'));var Papa=require(_0x4d70('0xd'));var Redis=require(_0x4d70('0xe'));var authService=require(_0x4d70('0xf'));var qs=require(_0x4d70('0x10'));var as=require(_0x4d70('0x11'));var hardwareService=require(_0x4d70('0x12'));var logger=require(_0x4d70('0x13'))(_0x4d70('0x14'));var utils=require('../../config/utils');var config=require(_0x4d70('0x15'));var licenseUtil=require(_0x4d70('0x16'));var db=require(_0x4d70('0x17'))['db'];function respondWithStatusCode(_0x3a94c3,_0x1a30f4){_0x1a30f4=_0x1a30f4||0xcc;return function(_0x300bcb){if(_0x300bcb){return _0x3a94c3[_0x4d70('0x18')](_0x1a30f4);}return _0x3a94c3[_0x4d70('0x19')](_0x1a30f4)[_0x4d70('0x1a')]();};}function respondWithResult(_0xf9ae1,_0x1cc9f4){_0x1cc9f4=_0x1cc9f4||0xc8;return function(_0x4cfe77){if(_0x4cfe77){return _0xf9ae1['status'](_0x1cc9f4)[_0x4d70('0x1b')](_0x4cfe77);}};}function respondWithFilteredResult(_0x2e03cd,_0x1febdf){return function(_0x42172a){if(_0x42172a){var _0x1d9353=typeof _0x1febdf[_0x4d70('0x1c')]===_0x4d70('0x1d')&&typeof _0x1febdf[_0x4d70('0x1e')]==='undefined';var _0x59a40b=_0x42172a['count'];var _0x2f147c=_0x1d9353?0x0:_0x1febdf[_0x4d70('0x1c')];var _0x36e0b9=_0x1d9353?_0x42172a[_0x4d70('0x1f')]:_0x1febdf[_0x4d70('0x1c')]+_0x1febdf[_0x4d70('0x1e')];var _0x4e9379;if(_0x36e0b9>=_0x59a40b){_0x36e0b9=_0x59a40b;_0x4e9379=0xc8;}else{_0x4e9379=0xce;}_0x2e03cd[_0x4d70('0x19')](_0x4e9379);return _0x2e03cd[_0x4d70('0x20')](_0x4d70('0x21'),_0x2f147c+'-'+_0x36e0b9+'/'+_0x59a40b)[_0x4d70('0x1b')](_0x42172a);}return null;};}function patchUpdates(_0x2814d7){return function(_0x56b472){try{jsonpatch['apply'](_0x56b472,_0x2814d7,!![]);}catch(_0x4926a5){return BPromise[_0x4d70('0x22')](_0x4926a5);}return _0x56b472['save']();};}function saveUpdates(_0x1c04fd,_0x246d0f){return function(_0x32b418){if(_0x32b418){return _0x32b418['update'](_0x1c04fd)[_0x4d70('0x23')](function(_0x5cf2f7){return _0x5cf2f7;});}return null;};}function removeEntity(_0x4cf1f2,_0x50a42b){return function(_0x1c903b){if(_0x1c903b){return _0x1c903b[_0x4d70('0x24')]()[_0x4d70('0x23')](function(){_0x4cf1f2[_0x4d70('0x19')](0xcc)[_0x4d70('0x1a')]();});}};}function handleEntityNotFound(_0x6006ad,_0x2616f2){return function(_0x22d9ba){if(!_0x22d9ba){_0x6006ad[_0x4d70('0x18')](0x194);}return _0x22d9ba;};}function handleError(_0x2743d5,_0x52c0be){_0x52c0be=_0x52c0be||0x1f4;return function(_0x5ca9cb){logger['error'](_0x5ca9cb['stack']);if(_0x5ca9cb[_0x4d70('0x25')]){delete _0x5ca9cb[_0x4d70('0x25')];}_0x2743d5[_0x4d70('0x19')](_0x52c0be)[_0x4d70('0x26')](_0x5ca9cb);};}exports['index']=function(_0x2b900a,_0xe656af){var _0x1c9066={},_0x4ec08a={},_0x1bfa50={'count':0x0,'rows':[]};var _0xea7d28=_[_0x4d70('0x27')](db[_0x4d70('0x28')]['rawAttributes'],function(_0x2f5099){return{'name':_0x2f5099[_0x4d70('0x29')],'type':_0x2f5099[_0x4d70('0x2a')]['key']};});_0x4ec08a['model']=_[_0x4d70('0x27')](_0xea7d28,_0x4d70('0x25'));_0x4ec08a[_0x4d70('0x2b')]=_[_0x4d70('0x2c')](_0x2b900a[_0x4d70('0x2b')]);_0x4ec08a[_0x4d70('0x2d')]=_[_0x4d70('0x2e')](_0x4ec08a['model'],_0x4ec08a[_0x4d70('0x2b')]);_0x1c9066[_0x4d70('0x2f')]=_[_0x4d70('0x2e')](_0x4ec08a[_0x4d70('0x30')],qs['fields'](_0x2b900a[_0x4d70('0x2b')][_0x4d70('0x31')]));_0x1c9066['attributes']=_0x1c9066[_0x4d70('0x2f')][_0x4d70('0x32')]?_0x1c9066[_0x4d70('0x2f')]:_0x4ec08a[_0x4d70('0x30')];if(!_0x2b900a[_0x4d70('0x2b')]['hasOwnProperty'](_0x4d70('0x33'))){_0x1c9066[_0x4d70('0x1e')]=qs[_0x4d70('0x1e')](_0x2b900a['query'][_0x4d70('0x1e')]);_0x1c9066[_0x4d70('0x1c')]=qs[_0x4d70('0x1c')](_0x2b900a['query'][_0x4d70('0x1c')]);}_0x1c9066[_0x4d70('0x34')]=qs['sort'](_0x2b900a[_0x4d70('0x2b')][_0x4d70('0x35')]);_0x1c9066['where']=qs[_0x4d70('0x2d')](_[_0x4d70('0x36')](_0x2b900a[_0x4d70('0x2b')],_0x4ec08a[_0x4d70('0x2d')]),_0xea7d28);if(_0x2b900a[_0x4d70('0x2b')][_0x4d70('0x37')]){_0x1c9066['where']=_['merge'](_0x1c9066['where'],{'$or':_[_0x4d70('0x27')](_0xea7d28,function(_0x31f731){if(_0x31f731[_0x4d70('0x2a')]!==_0x4d70('0x38')){var _0x3005e1={};_0x3005e1[_0x31f731[_0x4d70('0x25')]]={'$like':'%'+_0x2b900a[_0x4d70('0x2b')][_0x4d70('0x37')]+'%'};return _0x3005e1;}})});}_0x1c9066=_[_0x4d70('0x39')]({},_0x1c9066,_0x2b900a['options']);var _0x5b43fb={'where':_0x1c9066[_0x4d70('0x3a')]};return db[_0x4d70('0x28')][_0x4d70('0x1f')](_0x5b43fb)['then'](function(_0xe60639){_0x1bfa50[_0x4d70('0x1f')]=_0xe60639;if(_0x2b900a[_0x4d70('0x2b')]['includeAll']){_0x1c9066[_0x4d70('0x3b')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1c9066);})[_0x4d70('0x23')](function(_0x59e696){_0x1bfa50[_0x4d70('0x3c')]=_0x59e696;return _0x1bfa50;})[_0x4d70('0x23')](respondWithFilteredResult(_0xe656af,_0x1c9066))['catch'](handleError(_0xe656af,null));};exports[_0x4d70('0x3d')]=function(_0x391ea8,_0x147728){var _0x992290={'raw':!![],'where':{'id':_0x391ea8[_0x4d70('0x3e')]['id']}},_0x5b7503={};_0x5b7503['model']=_[_0x4d70('0x2c')](db[_0x4d70('0x28')][_0x4d70('0x3f')]);_0x5b7503[_0x4d70('0x2b')]=_['keys'](_0x391ea8[_0x4d70('0x2b')]);_0x5b7503[_0x4d70('0x2d')]=_['intersection'](_0x5b7503[_0x4d70('0x30')],_0x5b7503['query']);_0x992290['attributes']=_[_0x4d70('0x2e')](_0x5b7503[_0x4d70('0x30')],qs[_0x4d70('0x31')](_0x391ea8['query'][_0x4d70('0x31')]));_0x992290['attributes']=_0x992290[_0x4d70('0x2f')]['length']?_0x992290[_0x4d70('0x2f')]:_0x5b7503[_0x4d70('0x30')];if(_0x391ea8[_0x4d70('0x2b')][_0x4d70('0x40')]){_0x992290[_0x4d70('0x3b')]=[{'all':!![]}];}_0x992290=_[_0x4d70('0x39')]({},_0x992290,_0x391ea8[_0x4d70('0x41')]);return db[_0x4d70('0x28')][_0x4d70('0x42')](_0x992290)['then'](handleEntityNotFound(_0x147728,null))['then'](respondWithResult(_0x147728,null))[_0x4d70('0x43')](handleError(_0x147728,null));};exports[_0x4d70('0x44')]=function(_0x28116a,_0xb06b3){var _0x48e431={'where':{'id':_0x28116a[_0x4d70('0x3e')]['id']}},_0xd15280={};_0xd15280[_0x4d70('0x30')]=_['keys'](db[_0x4d70('0x28')][_0x4d70('0x3f')]);_0x48e431[_0x4d70('0x2f')]=_['intersection'](_0xd15280['model'],qs[_0x4d70('0x31')](_0x28116a[_0x4d70('0x2b')][_0x4d70('0x31')]));_0x48e431[_0x4d70('0x2f')]=_0x48e431[_0x4d70('0x2f')]['length']?_0x48e431[_0x4d70('0x2f')]:_0xd15280[_0x4d70('0x30')];if(_0x28116a[_0x4d70('0x2b')]['includeAll']){_0x48e431['include']=[{'all':!![]}];}_0x48e431=_[_0x4d70('0x39')]({},_0x48e431,_0x28116a[_0x4d70('0x41')]);return db['Attachment'][_0x4d70('0x42')](_0x48e431)[_0x4d70('0x23')](handleEntityNotFound(_0xb06b3,null))[_0x4d70('0x23')](function(_0x286bf9){if(_0x286bf9){var _0x22a6d=_0x286bf9[_0x4d70('0x45')]({'plain':!![]});_0x22a6d=qs[_0x4d70('0x46')](_0x22a6d,['id','createdAt',_0x4d70('0x47')]);_0x28116a['body']=_[_0x4d70('0x46')](_0x28116a[_0x4d70('0x48')],['id',_0x4d70('0x49'),_0x4d70('0x47')]);return db[_0x4d70('0x28')][_0x4d70('0x4a')](_['merge'](_0x22a6d,_0x28116a[_0x4d70('0x48')]),{'include':_0x28116a[_0x4d70('0x2b')][_0x4d70('0x40')]?[{'all':!![]}]:undefined});}})[_0x4d70('0x23')](respondWithResult(_0xb06b3,0xc9))[_0x4d70('0x43')](handleError(_0xb06b3,null));};exports['update']=function(_0x492ead,_0x42075c){if(_0x492ead[_0x4d70('0x48')]['id']){delete _0x492ead[_0x4d70('0x48')]['id'];}return db[_0x4d70('0x28')][_0x4d70('0x42')]({'where':{'id':_0x492ead[_0x4d70('0x3e')]['id']}})[_0x4d70('0x23')](handleEntityNotFound(_0x42075c,null))[_0x4d70('0x23')](saveUpdates(_0x492ead[_0x4d70('0x48')],null))[_0x4d70('0x23')](respondWithResult(_0x42075c,null))[_0x4d70('0x43')](handleError(_0x42075c,null));};exports[_0x4d70('0x24')]=function(_0x1745a2,_0x5c6325){return db[_0x4d70('0x28')][_0x4d70('0x42')]({'where':{'id':_0x1745a2[_0x4d70('0x3e')]['id']}})[_0x4d70('0x23')](handleEntityNotFound(_0x5c6325,null))[_0x4d70('0x23')](removeEntity(_0x5c6325,null))[_0x4d70('0x43')](handleError(_0x5c6325,null));};exports[_0x4d70('0x4a')]=function(_0x170b71,_0x1ae5fe,_0x5eacb5){_0x170b71['body'][_0x4d70('0x25')]=_0x170b71['file'][_0x4d70('0x4b')];_0x170b71['body']['basename']=_0x170b71['file'][_0x4d70('0x4c')];_0x170b71[_0x4d70('0x48')][_0x4d70('0x2a')]=_0x170b71[_0x4d70('0x4d')][_0x4d70('0x4e')];return db['Attachment'][_0x4d70('0x4a')](_0x170b71['body'])[_0x4d70('0x23')](respondWithResult(_0x1ae5fe,0xc9))['catch'](handleError(_0x1ae5fe,null));};exports[_0x4d70('0x4f')]=function(_0x54536e,_0x3ff833,_0x24c610){return db['Attachment'][_0x4d70('0x50')]({'where':{'id':_0x54536e['params']['id']},'raw':!![]})[_0x4d70('0x23')](handleEntityNotFound(_0x3ff833,null))['then'](function(_0x211296){if(_0x211296){var _0x42481d=_0x211296['ChatOfflineMessageId']!==null;var _0x298401=path[_0x4d70('0x51')](config[_0x4d70('0x52')],'server/files/attachments/');if(_0x42481d){_0x298401=path[_0x4d70('0x51')](_0x298401,_0x4d70('0x53'));}var _0x1de520=path[_0x4d70('0x51')](_0x298401,_0x211296[_0x4d70('0x54')]);return _0x3ff833[_0x4d70('0x4f')](_0x1de520);}})['catch'](handleError(_0x3ff833,null));}; \ No newline at end of file +var _0x9135=['index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','attributes','find','catch','clone','get','omit','updatedAt','body','createdAt','create','update','originalname','basename','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','send'];(function(_0x5e6392,_0x57a986){var _0x516cc4=function(_0x316813){while(--_0x316813){_0x5e6392['push'](_0x5e6392['shift']());}};_0x516cc4(++_0x57a986);}(_0x9135,0x8c));var _0x5913=function(_0x5d332a,_0x4e23a8){_0x5d332a=_0x5d332a-0x0;var _0xba84a6=_0x9135[_0x5d332a];return _0xba84a6;};'use strict';var emlformat=require(_0x5913('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5913('0x1'));var moment=require(_0x5913('0x2'));var BPromise=require(_0x5913('0x3'));var Mustache=require(_0x5913('0x4'));var util=require(_0x5913('0x5'));var path=require(_0x5913('0x6'));var sox=require(_0x5913('0x7'));var csv=require('to-csv');var ejs=require(_0x5913('0x8'));var fs=require('fs');var fs_extra=require(_0x5913('0x9'));var _=require(_0x5913('0xa'));var squel=require(_0x5913('0xb'));var crypto=require(_0x5913('0xc'));var jsforce=require(_0x5913('0xd'));var deskjs=require(_0x5913('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5913('0xf'));var Papa=require(_0x5913('0x10'));var Redis=require('ioredis');var authService=require(_0x5913('0x11'));var qs=require(_0x5913('0x12'));var as=require(_0x5913('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5913('0x14'));var utils=require(_0x5913('0x15'));var config=require(_0x5913('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb7b631,_0x1d2591){_0x1d2591=_0x1d2591||0xcc;return function(_0x2ce20f){if(_0x2ce20f){return _0xb7b631[_0x5913('0x17')](_0x1d2591);}return _0xb7b631[_0x5913('0x18')](_0x1d2591)[_0x5913('0x19')]();};}function respondWithResult(_0x5f5568,_0x20eb25){_0x20eb25=_0x20eb25||0xc8;return function(_0x214df1){if(_0x214df1){return _0x5f5568['status'](_0x20eb25)['json'](_0x214df1);}};}function respondWithFilteredResult(_0x43648c,_0x4849c7){return function(_0x189b16){if(_0x189b16){var _0x42e07a=typeof _0x4849c7[_0x5913('0x1a')]==='undefined'&&typeof _0x4849c7[_0x5913('0x1b')]===_0x5913('0x1c');var _0x58e8f2=_0x189b16[_0x5913('0x1d')];var _0xddd8f4=_0x42e07a?0x0:_0x4849c7[_0x5913('0x1a')];var _0x24b208=_0x42e07a?_0x189b16[_0x5913('0x1d')]:_0x4849c7['offset']+_0x4849c7[_0x5913('0x1b')];var _0x3d7f8d;if(_0x24b208>=_0x58e8f2){_0x24b208=_0x58e8f2;_0x3d7f8d=0xc8;}else{_0x3d7f8d=0xce;}_0x43648c[_0x5913('0x18')](_0x3d7f8d);return _0x43648c[_0x5913('0x1e')](_0x5913('0x1f'),_0xddd8f4+'-'+_0x24b208+'/'+_0x58e8f2)[_0x5913('0x20')](_0x189b16);}return null;};}function patchUpdates(_0x2d6110){return function(_0x1c76dd){try{jsonpatch[_0x5913('0x21')](_0x1c76dd,_0x2d6110,!![]);}catch(_0x2b7957){return BPromise[_0x5913('0x22')](_0x2b7957);}return _0x1c76dd['save']();};}function saveUpdates(_0x480e6e,_0x5bdf27){return function(_0x5876bb){if(_0x5876bb){return _0x5876bb['update'](_0x480e6e)[_0x5913('0x23')](function(_0x486d3a){return _0x486d3a;});}return null;};}function removeEntity(_0x529acc,_0x34a153){return function(_0x2b8f02){if(_0x2b8f02){return _0x2b8f02[_0x5913('0x24')]()[_0x5913('0x23')](function(){_0x529acc[_0x5913('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50bc61,_0x24f45f){return function(_0x2312fe){if(!_0x2312fe){_0x50bc61[_0x5913('0x17')](0x194);}return _0x2312fe;};}function handleError(_0x3fd7b3,_0x2fdea1){_0x2fdea1=_0x2fdea1||0x1f4;return function(_0x10a8a9){logger['error'](_0x10a8a9[_0x5913('0x25')]);if(_0x10a8a9[_0x5913('0x26')]){delete _0x10a8a9[_0x5913('0x26')];}_0x3fd7b3[_0x5913('0x18')](_0x2fdea1)[_0x5913('0x27')](_0x10a8a9);};}exports[_0x5913('0x28')]=function(_0x361bcd,_0x39262f){var _0x2b8fe3={},_0x28f9ac={},_0x172a31={'count':0x0,'rows':[]};var _0x43c860=_[_0x5913('0x29')](db[_0x5913('0x2a')][_0x5913('0x2b')],function(_0x4f5b50){return{'name':_0x4f5b50[_0x5913('0x2c')],'type':_0x4f5b50[_0x5913('0x2d')][_0x5913('0x2e')]};});_0x28f9ac[_0x5913('0x2f')]=_[_0x5913('0x29')](_0x43c860,_0x5913('0x26'));_0x28f9ac[_0x5913('0x30')]=_[_0x5913('0x31')](_0x361bcd[_0x5913('0x30')]);_0x28f9ac['filters']=_['intersection'](_0x28f9ac[_0x5913('0x2f')],_0x28f9ac['query']);_0x2b8fe3['attributes']=_['intersection'](_0x28f9ac['model'],qs[_0x5913('0x32')](_0x361bcd['query'][_0x5913('0x32')]));_0x2b8fe3['attributes']=_0x2b8fe3['attributes'][_0x5913('0x33')]?_0x2b8fe3['attributes']:_0x28f9ac[_0x5913('0x2f')];if(!_0x361bcd[_0x5913('0x30')][_0x5913('0x34')](_0x5913('0x35'))){_0x2b8fe3[_0x5913('0x1b')]=qs[_0x5913('0x1b')](_0x361bcd[_0x5913('0x30')][_0x5913('0x1b')]);_0x2b8fe3[_0x5913('0x1a')]=qs[_0x5913('0x1a')](_0x361bcd[_0x5913('0x30')][_0x5913('0x1a')]);}_0x2b8fe3['order']=qs[_0x5913('0x36')](_0x361bcd[_0x5913('0x30')]['sort']);_0x2b8fe3[_0x5913('0x37')]=qs[_0x5913('0x38')](_['pick'](_0x361bcd[_0x5913('0x30')],_0x28f9ac[_0x5913('0x38')]),_0x43c860);if(_0x361bcd[_0x5913('0x30')][_0x5913('0x39')]){_0x2b8fe3['where']=_[_0x5913('0x3a')](_0x2b8fe3[_0x5913('0x37')],{'$or':_[_0x5913('0x29')](_0x43c860,function(_0x3d44a6){if(_0x3d44a6[_0x5913('0x2d')]!==_0x5913('0x3b')){var _0x450cb1={};_0x450cb1[_0x3d44a6[_0x5913('0x26')]]={'$like':'%'+_0x361bcd[_0x5913('0x30')]['filter']+'%'};return _0x450cb1;}})});}_0x2b8fe3=_[_0x5913('0x3a')]({},_0x2b8fe3,_0x361bcd[_0x5913('0x3c')]);var _0x5a9759={'where':_0x2b8fe3['where']};return db['Attachment'][_0x5913('0x1d')](_0x5a9759)[_0x5913('0x23')](function(_0x2824bd){_0x172a31[_0x5913('0x1d')]=_0x2824bd;if(_0x361bcd[_0x5913('0x30')][_0x5913('0x3d')]){_0x2b8fe3[_0x5913('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x2b8fe3);})['then'](function(_0x146ef3){_0x172a31[_0x5913('0x3f')]=_0x146ef3;return _0x172a31;})[_0x5913('0x23')](respondWithFilteredResult(_0x39262f,_0x2b8fe3))['catch'](handleError(_0x39262f,null));};exports[_0x5913('0x40')]=function(_0xfad12c,_0x32c28f){var _0x48975f={'raw':!![],'where':{'id':_0xfad12c[_0x5913('0x41')]['id']}},_0x180b26={};_0x180b26[_0x5913('0x2f')]=_[_0x5913('0x31')](db[_0x5913('0x2a')]['rawAttributes']);_0x180b26[_0x5913('0x30')]=_[_0x5913('0x31')](_0xfad12c[_0x5913('0x30')]);_0x180b26[_0x5913('0x38')]=_[_0x5913('0x42')](_0x180b26[_0x5913('0x2f')],_0x180b26[_0x5913('0x30')]);_0x48975f[_0x5913('0x43')]=_[_0x5913('0x42')](_0x180b26[_0x5913('0x2f')],qs[_0x5913('0x32')](_0xfad12c[_0x5913('0x30')][_0x5913('0x32')]));_0x48975f[_0x5913('0x43')]=_0x48975f[_0x5913('0x43')]['length']?_0x48975f[_0x5913('0x43')]:_0x180b26[_0x5913('0x2f')];if(_0xfad12c['query'][_0x5913('0x3d')]){_0x48975f[_0x5913('0x3e')]=[{'all':!![]}];}_0x48975f=_[_0x5913('0x3a')]({},_0x48975f,_0xfad12c[_0x5913('0x3c')]);return db['Attachment'][_0x5913('0x44')](_0x48975f)[_0x5913('0x23')](handleEntityNotFound(_0x32c28f,null))[_0x5913('0x23')](respondWithResult(_0x32c28f,null))[_0x5913('0x45')](handleError(_0x32c28f,null));};exports[_0x5913('0x46')]=function(_0x4f481d,_0x378296){var _0x3d82e2={'where':{'id':_0x4f481d['params']['id']}},_0x80ee7e={};_0x80ee7e[_0x5913('0x2f')]=_['keys'](db['Attachment']['rawAttributes']);_0x3d82e2[_0x5913('0x43')]=_[_0x5913('0x42')](_0x80ee7e[_0x5913('0x2f')],qs[_0x5913('0x32')](_0x4f481d[_0x5913('0x30')][_0x5913('0x32')]));_0x3d82e2[_0x5913('0x43')]=_0x3d82e2[_0x5913('0x43')]['length']?_0x3d82e2[_0x5913('0x43')]:_0x80ee7e['model'];if(_0x4f481d[_0x5913('0x30')][_0x5913('0x3d')]){_0x3d82e2[_0x5913('0x3e')]=[{'all':!![]}];}_0x3d82e2=_['merge']({},_0x3d82e2,_0x4f481d[_0x5913('0x3c')]);return db[_0x5913('0x2a')][_0x5913('0x44')](_0x3d82e2)['then'](handleEntityNotFound(_0x378296,null))[_0x5913('0x23')](function(_0x3d4374){if(_0x3d4374){var _0x4e029a=_0x3d4374[_0x5913('0x47')]({'plain':!![]});_0x4e029a=qs[_0x5913('0x48')](_0x4e029a,['id','createdAt',_0x5913('0x49')]);_0x4f481d[_0x5913('0x4a')]=_[_0x5913('0x48')](_0x4f481d[_0x5913('0x4a')],['id',_0x5913('0x4b'),_0x5913('0x49')]);return db['Attachment'][_0x5913('0x4c')](_[_0x5913('0x3a')](_0x4e029a,_0x4f481d[_0x5913('0x4a')]),{'include':_0x4f481d['query'][_0x5913('0x3d')]?[{'all':!![]}]:undefined});}})[_0x5913('0x23')](respondWithResult(_0x378296,0xc9))[_0x5913('0x45')](handleError(_0x378296,null));};exports[_0x5913('0x4d')]=function(_0x3205f0,_0x188cba){if(_0x3205f0[_0x5913('0x4a')]['id']){delete _0x3205f0[_0x5913('0x4a')]['id'];}return db[_0x5913('0x2a')][_0x5913('0x44')]({'where':{'id':_0x3205f0[_0x5913('0x41')]['id']}})['then'](handleEntityNotFound(_0x188cba,null))[_0x5913('0x23')](saveUpdates(_0x3205f0[_0x5913('0x4a')],null))['then'](respondWithResult(_0x188cba,null))['catch'](handleError(_0x188cba,null));};exports[_0x5913('0x24')]=function(_0x26da2a,_0x192664){return db[_0x5913('0x2a')][_0x5913('0x44')]({'where':{'id':_0x26da2a[_0x5913('0x41')]['id']}})[_0x5913('0x23')](handleEntityNotFound(_0x192664,null))[_0x5913('0x23')](removeEntity(_0x192664,null))['catch'](handleError(_0x192664,null));};exports[_0x5913('0x4c')]=function(_0x1123d3,_0x4716d6,_0x2d3a61){_0x1123d3[_0x5913('0x4a')]['name']=_0x1123d3['file'][_0x5913('0x4e')];_0x1123d3[_0x5913('0x4a')][_0x5913('0x4f')]=_0x1123d3[_0x5913('0x50')][_0x5913('0x51')];_0x1123d3[_0x5913('0x4a')][_0x5913('0x2d')]=_0x1123d3[_0x5913('0x50')][_0x5913('0x52')];return db[_0x5913('0x2a')]['create'](_0x1123d3[_0x5913('0x4a')])[_0x5913('0x23')](respondWithResult(_0x4716d6,0xc9))[_0x5913('0x45')](handleError(_0x4716d6,null));};exports['download']=function(_0x12691f,_0xef2cb3,_0x3cfabb){return db['Attachment'][_0x5913('0x53')]({'where':{'id':_0x12691f[_0x5913('0x41')]['id']},'raw':!![]})[_0x5913('0x23')](handleEntityNotFound(_0xef2cb3,null))['then'](function(_0x39aa30){if(_0x39aa30){var _0x1b4b3a=_0x39aa30[_0x5913('0x54')]!==null;var _0xf64924=path[_0x5913('0x55')](config[_0x5913('0x56')],_0x5913('0x57'));if(_0x1b4b3a){_0xf64924=path[_0x5913('0x55')](_0xf64924,_0x5913('0x58'));}var _0x422979=path[_0x5913('0x55')](_0xf64924,_0x39aa30[_0x5913('0x4f')]);return _0xef2cb3[_0x5913('0x59')](_0x422979);}})[_0x5913('0x45')](handleError(_0xef2cb3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a3a12c7..01a06f6 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 _0x6f81=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Attachment','attachments','lodash'];(function(_0x12b394,_0x21cd6e){var _0x3a3545=function(_0x2d2d5b){while(--_0x2d2d5b){_0x12b394['push'](_0x12b394['shift']());}};_0x3a3545(++_0x21cd6e);}(_0x6f81,0x13e));var _0x16f8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x6f81[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x16f8('0x0'));var util=require(_0x16f8('0x1'));var logger=require('../../config/logger')(_0x16f8('0x2'));var moment=require(_0x16f8('0x3'));var BPromise=require(_0x16f8('0x4'));var rp=require(_0x16f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16f8('0x6'));var config=require(_0x16f8('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x55c407,_0xd0b5f6){return _0x55c407[_0x16f8('0x8')](_0x16f8('0x9'),attributes,{'tableName':_0x16f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aad=['./attachment.attributes','exports','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1aad,0x19b));var _0xd1aa=function(_0x2813fa,_0x3211d4){_0x2813fa=_0x2813fa-0x0;var _0x8a2acb=_0x1aad[_0x2813fa];return _0x8a2acb;};'use strict';var _=require(_0xd1aa('0x0'));var util=require(_0xd1aa('0x1'));var logger=require(_0xd1aa('0x2'))('api');var moment=require(_0xd1aa('0x3'));var BPromise=require(_0xd1aa('0x4'));var rp=require(_0xd1aa('0x5'));var fs=require('fs');var path=require(_0xd1aa('0x6'));var rimraf=require(_0xd1aa('0x7'));var config=require(_0xd1aa('0x8'));var attributes=require(_0xd1aa('0x9'));module[_0xd1aa('0xa')]=function(_0x285308,_0x4823d7){return _0x285308['define']('Attachment',attributes,{'tableName':_0xd1aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 69b20bd..8949a42 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 _0x80d9=['code','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x195871,_0x4a0f1e){var _0x57a24c=function(_0x5e2e39){while(--_0x5e2e39){_0x195871['push'](_0x195871['shift']());}};_0x57a24c(++_0x4a0f1e);}(_0x80d9,0x15c));var _0x980d=function(_0x472257,_0x5aa307){_0x472257=_0x472257-0x0;var _0x13eaaf=_0x80d9[_0x472257];return _0x13eaaf;};'use strict';var _=require(_0x980d('0x0'));var util=require('util');var moment=require(_0x980d('0x1'));var BPromise=require(_0x980d('0x2'));var rs=require(_0x980d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x980d('0x4'))['db'];var utils=require(_0x980d('0x5'));var logger=require(_0x980d('0x6'))(_0x980d('0x7'));var config=require(_0x980d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x980d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50854e,_0x5d9eb0,_0x7e96f7){return new BPromise(function(_0x758fc3,_0x2b8e2c){return client[_0x980d('0xa')](_0x50854e,_0x7e96f7)[_0x980d('0xb')](function(_0xef5778){logger[_0x980d('0xc')]('Attachment,\x20%s,\x20%s',_0x5d9eb0,'request\x20sent');logger['debug'](_0x980d('0xd'),_0x5d9eb0,_0x980d('0xe'),JSON['stringify'](_0xef5778));if(_0xef5778[_0x980d('0xf')]){if(_0xef5778['error'][_0x980d('0x10')]===0x1f4){logger['error'](_0x980d('0x11'),_0x5d9eb0,_0xef5778[_0x980d('0xf')][_0x980d('0x12')]);return _0x2b8e2c(_0xef5778[_0x980d('0xf')][_0x980d('0x12')]);}logger[_0x980d('0xf')](_0x980d('0x11'),_0x5d9eb0,_0xef5778[_0x980d('0xf')]['message']);return _0x758fc3(_0xef5778[_0x980d('0xf')][_0x980d('0x12')]);}else{logger[_0x980d('0xc')](_0x980d('0x11'),_0x5d9eb0,_0x980d('0xe'));_0x758fc3(_0xef5778[_0x980d('0x13')]['message']);}})[_0x980d('0x14')](function(_0x393ae2){logger['error'](_0x980d('0x11'),_0x5d9eb0,_0x393ae2);_0x2b8e2c(_0x393ae2);});});}exports['CreateAttachment']=function(_0x23f64c){var _0x1bc7e4=this;return new Promise(function(_0x39192b,_0x3c06c5){return db[_0x980d('0x15')][_0x980d('0x16')](_0x23f64c[_0x980d('0x17')],{'raw':_0x23f64c[_0x980d('0x18')]?_0x23f64c[_0x980d('0x18')][_0x980d('0x19')]===undefined?!![]:![]:!![]})[_0x980d('0xb')](function(_0x550741){logger['info'](_0x980d('0x1a'),_0x23f64c);logger['debug']('CreateAttachment',_0x23f64c,JSON[_0x980d('0x1b')](_0x550741));_0x39192b(_0x550741);})[_0x980d('0x14')](function(_0x45d698){logger[_0x980d('0xf')]('CreateAttachment',_0x45d698['message'],_0x23f64c);_0x3c06c5(_0x1bc7e4[_0x980d('0xf')](0x1f4,_0x45d698['message']));});});}; \ No newline at end of file +var _0x6b19=['client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateAttachment','create','options','raw','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3eac94,_0x2a7c9e){var _0x330c45=function(_0x239665){while(--_0x239665){_0x3eac94['push'](_0x3eac94['shift']());}};_0x330c45(++_0x2a7c9e);}(_0x6b19,0xe8));var _0x96b1=function(_0x451699,_0x259731){_0x451699=_0x451699-0x0;var _0x5efbad=_0x6b19[_0x451699];return _0x5efbad;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});}exports[_0x96b1('0x13')]=function(_0x38478c){var _0x2b192a=this;return new Promise(function(_0x19972b,_0x212b31){return db['Attachment'][_0x96b1('0x14')](_0x38478c['body'],{'raw':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')][_0x96b1('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0xc5dc95){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x38478c);logger['debug'](_0x96b1('0x13'),_0x38478c,JSON[_0x96b1('0x17')](_0xc5dc95));_0x19972b(_0xc5dc95);})[_0x96b1('0x12')](function(_0x18594b){logger['error'](_0x96b1('0x13'),_0x18594b[_0x96b1('0x10')],_0x38478c);_0x212b31(_0x2b192a[_0x96b1('0xf')](0x1f4,_0x18594b['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 0ebb4d0..b859983 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x55e8ac,_0x17fe49){_0x55e8ac=_0x55e8ac-0x0;var _0x2672fd=_0xdb28[_0x55e8ac];return _0x2672fd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x0b0e,0x187));var _0xe0b0=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0b0e[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d4a3a4c..fa60d85 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 _0xc949=['baseDN','domain','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','disabled','blockedAt','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','ActiveDirectory\x20Not\x20Configured','status','send','message','login','ad-local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','use','passport','Strategy','moment','activedirectory2','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','username','password'];(function(_0x52eb7b,_0x29ace1){var _0x1ce7a9=function(_0x2dfe1c){while(--_0x2dfe1c){_0x52eb7b['push'](_0x52eb7b['shift']());}};_0x1ce7a9(++_0x29ace1);}(_0xc949,0x181));var _0x9c94=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc949[_0x110c3d];return _0x226d67;};'use strict';var passport=require(_0x9c94('0x0'));var LocalStrategy=require('passport-local')[_0x9c94('0x1')];var moment=require(_0x9c94('0x2'));var ActiveDirectory=require(_0x9c94('0x3'));var db=require(_0x9c94('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9c94('0x5'));var config=require(_0x9c94('0x6'));var logger=require('../../config/logger')(_0x9c94('0x7'));function ActiveDirectoryAuthenticate(_0x1b60a1,_0x46d560,_0x1357ac,_0x57fcd7){var _0xf373e,_0x360e7b;if(config[_0x9c94('0x8')]&&config[_0x9c94('0x8')][_0x9c94('0x9')]&&config[_0x9c94('0x8')][_0x9c94('0xa')]&&config[_0x9c94('0x8')][_0x9c94('0xb')]&&config[_0x9c94('0x8')]['url']&&config[_0x9c94('0x8')][_0x9c94('0xc')]){var _0x14c4ae=new ActiveDirectory(config[_0x9c94('0x8')]);return db[_0x9c94('0xd')][_0x9c94('0xe')]({'where':{'id':0x1},'attributes':[_0x9c94('0xf'),_0x9c94('0x10')],'raw':!![]})[_0x9c94('0x11')](function(_0x1e326f){_0xf373e=_0x1e326f;return _0x1b60a1[_0x9c94('0xe')]({'attributes':['id',_0x9c94('0x12'),_0x9c94('0xa'),_0x9c94('0x13'),'role',_0x9c94('0x14'),'blocked',_0x9c94('0x15'),_0x9c94('0x16')],'where':{'name':_0x46d560,'role':{'$or':['admin',_0x9c94('0x17'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0xf4054e){if(!_0xf4054e||_0xf4054e&&_0xf4054e['name']!==_0x46d560){throw new Error(_0x9c94('0x18'));}else{_0x360e7b=_0xf4054e;return _0x360e7b;}})[_0x9c94('0x11')](function(){var _0x4d9266=_0x360e7b[_0x9c94('0x12')]+'@'+config[_0x9c94('0x8')][_0x9c94('0xc')];_0x14c4ae[_0x9c94('0x19')](_0x4d9266,_0x1357ac,function(_0x16ef2c,_0xfbcc7c){if(_0x16ef2c){return _0x57fcd7(_0x16ef2c);}else if(!_0xfbcc7c){if(_0x360e7b){if(_0x360e7b[_0x9c94('0x14')]){return _0x57fcd7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0xf373e[_0x9c94('0x10')]>0x0){if(_0x360e7b[_0x9c94('0x1a')]){if(moment(_0x360e7b['blockedAt'])[_0x9c94('0x1b')](_0xf373e[_0x9c94('0x10')],_0x9c94('0x1c'))>moment()){return _0x57fcd7(_0x9c94('0x18'));}else{return utils[_0x9c94('0x1d')](_0x360e7b,0x0,![],null)[_0x9c94('0x11')](function(){return utils[_0x9c94('0x1e')](_0x360e7b);})[_0x9c94('0x11')](function(){return _0x57fcd7(null,_0x360e7b);});}}else{return utils[_0x9c94('0x1e')](_0x360e7b)[_0x9c94('0x11')](function(){return _0x57fcd7(null,_0x360e7b);});}}else{return utils[_0x9c94('0x1e')](_0x360e7b)[_0x9c94('0x11')](function(){return _0x57fcd7(null,_0x360e7b);});}}}});})[_0x9c94('0x1f')](function(_0x8c0b7f){return _0x57fcd7(null,![],_0x8c0b7f);});}else{logger['error'](_0x9c94('0x20'));}}function handleError(_0x2cdbf1,_0x5c2647,_0x102130){return _0x2cdbf1[_0x9c94('0x21')](_0x5c2647||0x1f4)[_0x9c94('0x22')]({'message':_0x102130?_0x102130[_0x9c94('0x23')]||_0x102130:''});}exports[_0x9c94('0x24')]=function(_0x4dd38e,_0xc18230,_0x45cf4d){passport['authenticate'](_0x9c94('0x25'),function(_0x4cfb9c,_0xa5df6f,_0x14d41b){var _0x330bd4=_0x4cfb9c||_0x14d41b;if(_0x330bd4){return handleError(_0xc18230,0x191,_0x330bd4);}if(!_0xa5df6f){return handleError(_0xc18230,0x194,{'message':_0x9c94('0x26')});}else{var _0x1581c0={'payload':{'id':_0xa5df6f['id'],'role':_0xa5df6f[_0x9c94('0x27')]},'options':{'expiresIn':0x15180}};return authService[_0x9c94('0x28')](_0x1581c0)['then'](function(_0x5a6b1c){_0xc18230[_0x9c94('0x29')]({'id':_0xa5df6f['id'],'token':_0x5a6b1c,'statusCall':'','isAlreadyLogged':_0xa5df6f[_0x9c94('0x2a')]});});}})(_0x4dd38e,_0xc18230,_0x45cf4d);};passport[_0x9c94('0x2b')]('ad-login',new LocalStrategy({'usernameField':_0x9c94('0x12'),'passwordField':'password'},function(_0x356ee8,_0x4592e5,_0x1fd8ab){return ActiveDirectoryAuthenticate(db['User'],_0x356ee8,_0x4592e5,_0x1fd8ab);})); \ No newline at end of file +var _0x49c4=['user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','domain','authenticate','disabled','minutes','clearBlockUser','getLicense','catch','error','status','send','message','login','ad-local','signToken','json','online','use','ad-login','User','passport','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','activedirectory','username','password','baseDN','url','blockDuration','then','findOne','role','blocked','blockedAt','loginAttempts','admin'];(function(_0xdcb25e,_0x57240d){var _0x509830=function(_0xa5bc59){while(--_0xa5bc59){_0xdcb25e['push'](_0xdcb25e['shift']());}};_0x509830(++_0x57240d);}(_0x49c4,0x9b));var _0x449c=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x49c4[_0x3ff085];return _0x2b68c3;};'use strict';var passport=require(_0x449c('0x0'));var LocalStrategy=require('passport-local')[_0x449c('0x1')];var moment=require(_0x449c('0x2'));var ActiveDirectory=require(_0x449c('0x3'));var db=require(_0x449c('0x4'))['db'];var authService=require(_0x449c('0x5'));var utils=require(_0x449c('0x6'));var config=require(_0x449c('0x7'));var logger=require('../../config/logger')('api');function ActiveDirectoryAuthenticate(_0x98afc0,_0x442e56,_0x12586c,_0x2db09a){var _0x3e7c19,_0x43cb0e;if(config[_0x449c('0x8')]&&config[_0x449c('0x8')][_0x449c('0x9')]&&config[_0x449c('0x8')][_0x449c('0xa')]&&config[_0x449c('0x8')][_0x449c('0xb')]&&config[_0x449c('0x8')][_0x449c('0xc')]&&config['activedirectory']['domain']){var _0x168d50=new ActiveDirectory(config[_0x449c('0x8')]);return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x449c('0xd')],'raw':!![]})[_0x449c('0xe')](function(_0x181570){_0x3e7c19=_0x181570;return _0x98afc0[_0x449c('0xf')]({'attributes':['id','name',_0x449c('0xa'),'salt',_0x449c('0x10'),'disabled',_0x449c('0x11'),_0x449c('0x12'),_0x449c('0x13')],'where':{'name':_0x442e56,'role':{'$or':[_0x449c('0x14'),_0x449c('0x15'),_0x449c('0x16')]},'adSsoEnabled':!![]}});})[_0x449c('0xe')](function(_0x634564){if(!_0x634564||_0x634564&&_0x634564[_0x449c('0x17')]!==_0x442e56){throw new Error(_0x449c('0x18'));}else{_0x43cb0e=_0x634564;return _0x43cb0e;}})['then'](function(){var _0x4312d9=_0x43cb0e[_0x449c('0x17')]+'@'+config[_0x449c('0x8')][_0x449c('0x19')];_0x168d50[_0x449c('0x1a')](_0x4312d9,_0x12586c,function(_0x524821,_0x41e52a){if(_0x524821){return _0x2db09a(_0x524821);}else if(!_0x41e52a){if(_0x43cb0e){if(_0x43cb0e[_0x449c('0x1b')]){return _0x2db09a(_0x449c('0x18'));}else if(_0x3e7c19[_0x449c('0xd')]>0x0){if(_0x43cb0e[_0x449c('0x11')]){if(moment(_0x43cb0e[_0x449c('0x12')])['add'](_0x3e7c19[_0x449c('0xd')],_0x449c('0x1c'))>moment()){return _0x2db09a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x449c('0x1d')](_0x43cb0e,0x0,![],null)[_0x449c('0xe')](function(){return utils[_0x449c('0x1e')](_0x43cb0e);})[_0x449c('0xe')](function(){return _0x2db09a(null,_0x43cb0e);});}}else{return utils[_0x449c('0x1e')](_0x43cb0e)[_0x449c('0xe')](function(){return _0x2db09a(null,_0x43cb0e);});}}else{return utils['getLicense'](_0x43cb0e)[_0x449c('0xe')](function(){return _0x2db09a(null,_0x43cb0e);});}}}});})[_0x449c('0x1f')](function(_0x4f06b3){return _0x2db09a(null,![],_0x4f06b3);});}else{logger[_0x449c('0x20')]('ActiveDirectory\x20Not\x20Configured');}}function handleError(_0x47808d,_0x47c13d,_0x325305){return _0x47808d[_0x449c('0x21')](_0x47c13d||0x1f4)[_0x449c('0x22')]({'message':_0x325305?_0x325305[_0x449c('0x23')]||_0x325305:''});}exports[_0x449c('0x24')]=function(_0x3d8c69,_0x30581e,_0x9cfd5){passport[_0x449c('0x1a')](_0x449c('0x25'),function(_0xb85ce1,_0x29e836,_0x431ce0){var _0x52c0f5=_0xb85ce1||_0x431ce0;if(_0x52c0f5){return handleError(_0x30581e,0x191,_0x52c0f5);}if(!_0x29e836){return handleError(_0x30581e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x390ada={'payload':{'id':_0x29e836['id'],'role':_0x29e836[_0x449c('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x449c('0x26')](_0x390ada)[_0x449c('0xe')](function(_0x2e9903){_0x30581e[_0x449c('0x27')]({'id':_0x29e836['id'],'token':_0x2e9903,'statusCall':'','isAlreadyLogged':_0x29e836[_0x449c('0x28')]});});}})(_0x3d8c69,_0x30581e,_0x9cfd5);};passport[_0x449c('0x29')](_0x449c('0x2a'),new LocalStrategy({'usernameField':_0x449c('0x17'),'passwordField':_0x449c('0xa')},function(_0x35d405,_0x40f0f1,_0x1d0c30){return ActiveDirectoryAuthenticate(db[_0x449c('0x2b')],_0x35d405,_0x40f0f1,_0x1d0c30);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 34a58cf..97ecf64 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 _0x03a1=['express','Router','login','exports'];(function(_0x460ea3,_0x42970b){var _0x1b6b53=function(_0x2a6476){while(--_0x2a6476){_0x460ea3['push'](_0x460ea3['shift']());}};_0x1b6b53(++_0x42970b);}(_0x03a1,0x70));var _0x103a=function(_0xabe630,_0x51228d){_0xabe630=_0xabe630-0x0;var _0x568ed5=_0x03a1[_0xabe630];return _0x568ed5;};'use strict';var express=require(_0x103a('0x0'));var router=express[_0x103a('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x103a('0x2')]);module[_0x103a('0x3')]=router; \ No newline at end of file +var _0x3970=['express','post','login','exports'];(function(_0x2a6edf,_0x35ca4d){var _0x2b563a=function(_0x15063f){while(--_0x15063f){_0x2a6edf['push'](_0x2a6edf['shift']());}};_0x2b563a(++_0x35ca4d);}(_0x3970,0x8c));var _0x0397=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0x3970[_0x195577];return _0x13c367;};'use strict';var express=require(_0x0397('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x0397('0x1')]('/',controller[_0x0397('0x2')]);module[_0x0397('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 3997f2f..c173346 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(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7a54,0x106));var _0x47a5=function(_0x31ceb7,_0x10a9b4){_0x31ceb7=_0x31ceb7-0x0;var _0x2da749=_0x7a54[_0x31ceb7];return _0x2da749;};'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(_0x30a952,_0x39ee8){var _0x2b1e57=function(_0x39d3f1){while(--_0x39d3f1){_0x30a952['push'](_0x30a952['shift']());}};_0x2b1e57(++_0x39ee8);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 7ffdba9..2279365 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 _0x6a03=['setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','get','login','/callback','isMiddleware'];(function(_0x38d70a,_0x4f9b8b){var _0x27694c=function(_0x4bc4cc){while(--_0x4bc4cc){_0x38d70a['push'](_0x38d70a['shift']());}};_0x27694c(++_0x4f9b8b);}(_0x6a03,0x19f));var _0x36a0=function(_0xdf950,_0x17cc6f){_0xdf950=_0xdf950-0x0;var _0x70ff3f=_0x6a03[_0xdf950];return _0x70ff3f;};'use strict';var express=require(_0x36a0('0x0'));var passport=require(_0x36a0('0x1'));var router=express['Router']();var controller=require(_0x36a0('0x2'));var userController=require(_0x36a0('0x3'));var authService=require('../../components/auth/service');router[_0x36a0('0x4')]('/',controller[_0x36a0('0x5')]);router['get'](_0x36a0('0x6'),controller['callback'],authService[_0x36a0('0x7')],userController['login'],authService[_0x36a0('0x8')]);module['exports']=router; \ No newline at end of file +var _0xe1e4=['setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xe1e4,0x18e));var _0x4e1e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe1e4[_0x2dadb9];return _0x2f0097;};'use strict';var express=require(_0x4e1e('0x0'));var passport=require(_0x4e1e('0x1'));var router=express['Router']();var controller=require(_0x4e1e('0x2'));var userController=require(_0x4e1e('0x3'));var authService=require(_0x4e1e('0x4'));router[_0x4e1e('0x5')]('/',controller[_0x4e1e('0x6')]);router[_0x4e1e('0x5')](_0x4e1e('0x7'),controller[_0x4e1e('0x8')],authService[_0x4e1e('0x9')],userController[_0x4e1e('0x6')],authService[_0x4e1e('0xa')]);module[_0x4e1e('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 7f1e7c3..2b9c9fd 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 _0x072a=['authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','params','token','Setting','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','../../mysqldb','../../config/utils','client','http','allowedLoginAttempts','blockDuration','findOne','name','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure'];(function(_0xc5574f,_0x1d3887){var _0x12f7cb=function(_0xbb418e){while(--_0xbb418e){_0xc5574f['push'](_0xc5574f['shift']());}};_0x12f7cb(++_0x1d3887);}(_0x072a,0xd0));var _0xa072=function(_0x2050e4,_0x19c8bb){_0x2050e4=_0x2050e4-0x0;var _0x45a804=_0x072a[_0x2050e4];return _0x45a804;};'use strict';var util=require(_0xa072('0x0'));var passport=require(_0xa072('0x1'));var LocalStrategy=require(_0xa072('0x2'))[_0xa072('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0xa072('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xa072('0x5'));var client=jayson[_0xa072('0x6')][_0xa072('0x7')]({'port':0x232b});function localAuthenticate(_0x46bba8,_0x280f1f,_0x3a327c,_0x562c7f){var _0x5e1982,_0x1efcde;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa072('0x8'),_0xa072('0x9')],'raw':!![]})['then'](function(_0xe32da5){_0x5e1982=_0xe32da5;return _0x46bba8[_0xa072('0xa')]({'attributes':['id',_0xa072('0xb'),'password','salt','role','disabled',_0xa072('0xc'),'blockedAt',_0xa072('0xd')],'where':{'name':_0x280f1f,'role':{'$or':[_0xa072('0xe'),_0xa072('0xf'),_0xa072('0x10')]}}});})[_0xa072('0x11')](function(_0xa3b77c){if(!_0xa3b77c||_0xa3b77c&&_0xa3b77c['name']!==_0x280f1f){throw new Error(_0xa072('0x12'));}else{_0x1efcde=_0xa3b77c;return _0x1efcde;}})[_0xa072('0x11')](function(){_0x1efcde['authenticate'](_0x3a327c,function(_0x690b87,_0x29e0df){var _0x5cbdf3=_0x1efcde[_0xa072('0xd')]+0x1;if(_0x690b87){return _0x562c7f(_0x690b87);}else if(!_0x29e0df){if(_0x1efcde[_0xa072('0x13')]){return _0x562c7f(null,![],{'message':_0xa072('0x12')});}else if(_0x5e1982[_0xa072('0x8')]>0x0){if(_0x1efcde[_0xa072('0xc')]){if(_0x5e1982['blockDuration']>0x0){if(moment(_0x1efcde[_0xa072('0x14')])['add'](_0x5e1982['blockDuration'],_0xa072('0x15'))>moment()){return _0x562c7f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa072('0x16')](_0x1efcde,_0x5cbdf3,![],null)[_0xa072('0x11')](function(){return _0x562c7f(null,![],{'message':_0xa072('0x12')});});}}else{return _0x562c7f(null,![],{'message':_0xa072('0x12')});}}else{if(_0x5cbdf3>=_0x5e1982['allowedLoginAttempts']){return utils[_0xa072('0x16')](_0x1efcde,0x0,!![],moment())['then'](function(){return _0x562c7f(null,![],{'message':_0xa072('0x12')});});}else{return utils[_0xa072('0x16')](_0x1efcde,_0x5cbdf3,![],null)['then'](function(){return _0x562c7f(null,![],{'message':_0xa072('0x12')});});}}}else{return _0x562c7f(null,![],{'message':_0xa072('0x12')});}}else{if(_0x1efcde[_0xa072('0x13')]){return _0x562c7f(null,![],{'message':_0xa072('0x12')});}else if(_0x5e1982[_0xa072('0x8')]>0x0){if(_0x1efcde[_0xa072('0xc')]){if(_0x5e1982['blockDuration']>0x0){if(moment(_0x1efcde[_0xa072('0x14')])[_0xa072('0x17')](_0x5e1982['blockDuration'],'minutes')>moment()){return _0x562c7f(null,![],{'message':_0xa072('0x12')});}else{return utils[_0xa072('0x16')](_0x1efcde,0x0,![],null)[_0xa072('0x11')](function(){return utils['getLicense'](_0x1efcde);})[_0xa072('0x11')](function(){return _0x562c7f(null,_0x1efcde);});}}else{return _0x562c7f(null,![],{'message':_0xa072('0x12')});}}else{return utils[_0xa072('0x16')](_0x1efcde,0x0,![],null)[_0xa072('0x11')](function(){return utils[_0xa072('0x18')](_0x1efcde);})[_0xa072('0x11')](function(){return _0x562c7f(null,_0x1efcde);})[_0xa072('0x19')](function(_0x16249d){return _0x562c7f(null,![],_0x16249d);});}}else{if(_0x1efcde['blocked']){return _0x562c7f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa072('0x18')](_0x1efcde)[_0xa072('0x11')](function(){return _0x562c7f(null,_0x1efcde);});}}}});})[_0xa072('0x19')](function(_0x27c962){return _0x562c7f(null,![],_0x27c962);});}function sendServiceMail(_0x330a7a){return db[_0xa072('0x1a')][_0xa072('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xa072('0xb'),_0xa072('0x1c')],'include':[{'model':db[_0xa072('0x1d')],'as':_0xa072('0x1e')}]})[_0xa072('0x11')](function(_0x585981){if(!_0x585981){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4b86d2={'tls':{'rejectUnauthorized':![]}};if(_0x585981[_0xa072('0x1e')][_0xa072('0x1f')]){_0x4b86d2['service']=_0x585981['Smtp'][_0xa072('0x1f')];}else{_0x4b86d2['host']=_0x585981[_0xa072('0x1e')][_0xa072('0x20')];_0x4b86d2[_0xa072('0x21')]=_0x585981[_0xa072('0x1e')][_0xa072('0x21')];_0x4b86d2['secure']=_0x585981['Smtp'][_0xa072('0x22')];}if(_0x585981[_0xa072('0x1e')][_0xa072('0x23')]){_0x4b86d2[_0xa072('0x24')]={'user':_0x585981[_0xa072('0x1e')][_0xa072('0xf')],'pass':_0x585981[_0xa072('0x1e')][_0xa072('0x25')]};}var _0x12572b={'account':_0x4b86d2,'message':_[_0xa072('0x26')]({'from':util[_0xa072('0x27')](_0xa072('0x28'),_0x585981[_0xa072('0xb')],_0x585981[_0xa072('0x1c')]||_0x585981[_0xa072('0x1e')][_0xa072('0xf')])},_0x330a7a)};return client[_0xa072('0x29')]('SendMail',_0x12572b);})[_0xa072('0x11')](function(_0x1fccce){if(_0x1fccce['error']){throw new Error(util[_0xa072('0x27')](_0xa072('0x2a'),_0x1fccce['error'][_0xa072('0x2b')]||JSON[_0xa072('0x2c')](_0x1fccce[_0xa072('0x2d')])));}return!![];});}function handleError(_0x4939b6,_0x582978,_0x4ca080){return _0x4939b6[_0xa072('0x2e')](_0x582978||0x1f4)[_0xa072('0x2f')]({'message':_0x4ca080?_0x4ca080[_0xa072('0x2b')]||_0x4ca080:''});}exports['login']=function(_0x43db61,_0x30d6bb,_0x15d76c){passport[_0xa072('0x30')]('local-login',function(_0x5a85b4,_0x582269,_0x1a3c7e){var _0x5409ca=_0x5a85b4||_0x1a3c7e;if(_0x5409ca){return handleError(_0x30d6bb,0x191,_0x5409ca);}if(!_0x582269){return handleError(_0x30d6bb,0x194,{'message':_0xa072('0x31')});}else{var _0x5d20bb={'payload':{'id':_0x582269['id'],'role':_0x582269[_0xa072('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0xa072('0x33')](_0x5d20bb)['then'](function(_0x2107b0){_0x30d6bb[_0xa072('0x34')]({'id':_0x582269['id'],'token':_0x2107b0,'statusCall':'','isAlreadyLogged':_0x582269[_0xa072('0x35')]});});}})(_0x43db61,_0x30d6bb,_0x15d76c);};exports['forgot']=function(_0x4bf9c8,_0x4a1d92,_0x1358dd){if(!_0x4bf9c8[_0xa072('0x36')][_0xa072('0x1c')]){return handleError(_0x4a1d92,0x1f4,{'message':_0xa072('0x37')});}var _0x3b2ff5=rs['generate']();_0x4bf9c8['body']['email']=_0x4bf9c8[_0xa072('0x36')][_0xa072('0x1c')]['trim']()[_0xa072('0x38')]();var _0x4718c3;return db['Setting'][_0xa072('0xa')]({'where':{'id':0x1},'attributes':[_0xa072('0x8'),_0xa072('0x9')],'raw':!![]})[_0xa072('0x11')](function(_0x19a1fe){_0x4718c3=_0x19a1fe;return db[_0xa072('0x39')][_0xa072('0x1b')]({'where':{'email':_0x4bf9c8[_0xa072('0x36')][_0xa072('0x1c')]}});})[_0xa072('0x11')](function(_0x28bd91){if(!_0x28bd91){throw new Error(_0xa072('0x3a'));}if(_0x28bd91['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x28bd91[_0xa072('0xc')]){if(moment(_0x28bd91[_0xa072('0x14')])[_0xa072('0x17')](_0x4718c3[_0xa072('0x9')],'minutes')>moment()){throw new Error(_0xa072('0x3b'));}else{_0x28bd91['blocked']=![];_0x28bd91[_0xa072('0x14')]=null;}}_0x28bd91['resetPasswordToken']=_0x3b2ff5;_0x28bd91[_0xa072('0x3c')]=Date[_0xa072('0x3d')]()+0x36ee80;return _0x28bd91[_0xa072('0x3e')]();})[_0xa072('0x11')](function(){return sendServiceMail({'to':_0x4bf9c8['body'][_0xa072('0x1c')],'subject':_0xa072('0x3f'),'text':_0xa072('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xa072('0x41')+_0x4bf9c8[_0xa072('0x42')][_0xa072('0x20')]+_0xa072('0x43')+_0x3b2ff5+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa072('0x11')](function(){_0x4a1d92[_0xa072('0x2e')](0xc8)[_0xa072('0x2f')]({'message':_0xa072('0x44')});})[_0xa072('0x19')](function(_0x57b7eb){return handleError(_0x4a1d92,0x1f4,_0x57b7eb);});};exports['reset']=function(_0xee22cd,_0x3c79d8,_0x225ca2){return db['User']['find']({'where':{'resetPasswordToken':_0xee22cd[_0xa072('0x45')][_0xa072('0x46')],'resetPasswordExpires':{'$gt':Date[_0xa072('0x3d')]()}}})[_0xa072('0x11')](function(_0x31ff3f){if(!_0x31ff3f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xa072('0x47')][_0xa072('0xa')]({'attributes':['id',_0xa072('0x48'),'enforcePasswordHistory',_0xa072('0x49')]})[_0xa072('0x11')](function(_0x2b7d08){if(_0x2b7d08[_0xa072('0x48')])authService[_0xa072('0x4a')](_0xee22cd[_0xa072('0x36')][_0xa072('0x4b')]);if(!_0x2b7d08[_0xa072('0x4c')]||!_0x31ff3f['previousPasswords'])return _0x31ff3f;authService['validatePasswordHistory'](_0xee22cd[_0xa072('0x36')][_0xa072('0x4b')],_0x31ff3f[_0xa072('0x4d')],_0x2b7d08[_0xa072('0x49')]);return _0x31ff3f;})[_0xa072('0x11')](function(){_0x31ff3f[_0xa072('0x4b')]=_0xee22cd[_0xa072('0x36')][_0xa072('0x4b')];_0x31ff3f[_0xa072('0x4e')]=null;_0x31ff3f[_0xa072('0x3c')]=null;return _0x31ff3f[_0xa072('0x3e')]();});})[_0xa072('0x11')](function(){_0x3c79d8[_0xa072('0x2e')](0xc8)[_0xa072('0x2f')]({'message':_0xa072('0x4f')});})['catch'](function(_0x57f7bc){return handleError(_0x3c79d8,0x1f4,_0x57f7bc);});};passport[_0xa072('0x50')]('local-login',new LocalStrategy({'usernameField':_0xa072('0xb'),'passwordField':_0xa072('0x4b')},function(_0x256b60,_0x1a10f2,_0x2e5c4d){return localAuthenticate(db['User'],_0x256b60,_0x1a10f2,_0x2e5c4d);})); \ No newline at end of file +var _0x7f0e=['MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/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.','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x7f0e,0x8e));var _0xe7f0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7f0e[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xe7f0('0x0'));var passport=require(_0xe7f0('0x1'));var LocalStrategy=require(_0xe7f0('0x2'))[_0xe7f0('0x3')];var jayson=require(_0xe7f0('0x4'));var _=require(_0xe7f0('0x5'));var rs=require(_0xe7f0('0x6'));var moment=require(_0xe7f0('0x7'));var db=require('../../mysqldb')['db'];var authService=require(_0xe7f0('0x8'));var utils=require(_0xe7f0('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x5938e3,_0x475954,_0x50fb09,_0x5c0286){var _0x1359bb,_0x2e2db6;return db[_0xe7f0('0xa')][_0xe7f0('0xb')]({'where':{'id':0x1},'attributes':[_0xe7f0('0xc'),_0xe7f0('0xd')],'raw':!![]})[_0xe7f0('0xe')](function(_0x1e10cc){_0x1359bb=_0x1e10cc;return _0x5938e3[_0xe7f0('0xb')]({'attributes':['id',_0xe7f0('0xf'),_0xe7f0('0x10'),_0xe7f0('0x11'),_0xe7f0('0x12'),_0xe7f0('0x13'),'blocked',_0xe7f0('0x14'),_0xe7f0('0x15')],'where':{'name':_0x475954,'role':{'$or':[_0xe7f0('0x16'),_0xe7f0('0x17'),_0xe7f0('0x18')]}}});})[_0xe7f0('0xe')](function(_0x26f59f){if(!_0x26f59f||_0x26f59f&&_0x26f59f[_0xe7f0('0xf')]!==_0x475954){throw new Error(_0xe7f0('0x19'));}else{_0x2e2db6=_0x26f59f;return _0x2e2db6;}})[_0xe7f0('0xe')](function(){_0x2e2db6['authenticate'](_0x50fb09,function(_0x3b5d96,_0x1ba0b4){var _0x2d9c8d=_0x2e2db6['loginAttempts']+0x1;if(_0x3b5d96){return _0x5c0286(_0x3b5d96);}else if(!_0x1ba0b4){if(_0x2e2db6[_0xe7f0('0x13')]){return _0x5c0286(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1359bb['allowedLoginAttempts']>0x0){if(_0x2e2db6[_0xe7f0('0x1a')]){if(_0x1359bb[_0xe7f0('0xd')]>0x0){if(moment(_0x2e2db6[_0xe7f0('0x14')])[_0xe7f0('0x1b')](_0x1359bb[_0xe7f0('0xd')],_0xe7f0('0x1c'))>moment()){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});}else{return utils[_0xe7f0('0x1d')](_0x2e2db6,_0x2d9c8d,![],null)[_0xe7f0('0xe')](function(){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});});}}else{return _0x5c0286(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2d9c8d>=_0x1359bb[_0xe7f0('0xc')]){return utils['clearBlockUser'](_0x2e2db6,0x0,!![],moment())[_0xe7f0('0xe')](function(){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});});}else{return utils[_0xe7f0('0x1d')](_0x2e2db6,_0x2d9c8d,![],null)[_0xe7f0('0xe')](function(){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});});}}}else{return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});}}else{if(_0x2e2db6[_0xe7f0('0x13')]){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});}else if(_0x1359bb[_0xe7f0('0xc')]>0x0){if(_0x2e2db6[_0xe7f0('0x1a')]){if(_0x1359bb[_0xe7f0('0xd')]>0x0){if(moment(_0x2e2db6['blockedAt'])[_0xe7f0('0x1b')](_0x1359bb[_0xe7f0('0xd')],_0xe7f0('0x1c'))>moment()){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});}else{return utils[_0xe7f0('0x1d')](_0x2e2db6,0x0,![],null)['then'](function(){return utils[_0xe7f0('0x1e')](_0x2e2db6);})[_0xe7f0('0xe')](function(){return _0x5c0286(null,_0x2e2db6);});}}else{return _0x5c0286(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe7f0('0x1d')](_0x2e2db6,0x0,![],null)['then'](function(){return utils[_0xe7f0('0x1e')](_0x2e2db6);})[_0xe7f0('0xe')](function(){return _0x5c0286(null,_0x2e2db6);})[_0xe7f0('0x1f')](function(_0x3104cf){return _0x5c0286(null,![],_0x3104cf);});}}else{if(_0x2e2db6[_0xe7f0('0x1a')]){return _0x5c0286(null,![],{'message':_0xe7f0('0x19')});}else{return utils['getLicense'](_0x2e2db6)[_0xe7f0('0xe')](function(){return _0x5c0286(null,_0x2e2db6);});}}}});})[_0xe7f0('0x1f')](function(_0x508df7){return _0x5c0286(null,![],_0x508df7);});}function sendServiceMail(_0x170daf){return db[_0xe7f0('0x20')][_0xe7f0('0x21')]({'where':{'service':!![]},'attributes':['id',_0xe7f0('0xf'),'email'],'include':[{'model':db[_0xe7f0('0x22')],'as':_0xe7f0('0x23')}]})[_0xe7f0('0xe')](function(_0x2c048c){if(!_0x2c048c){throw new Error(_0xe7f0('0x24'));}var _0x535b1a={'tls':{'rejectUnauthorized':![]}};if(_0x2c048c[_0xe7f0('0x23')]['service']){_0x535b1a['service']=_0x2c048c['Smtp']['service'];}else{_0x535b1a[_0xe7f0('0x25')]=_0x2c048c[_0xe7f0('0x23')][_0xe7f0('0x25')];_0x535b1a[_0xe7f0('0x26')]=_0x2c048c['Smtp'][_0xe7f0('0x26')];_0x535b1a[_0xe7f0('0x27')]=_0x2c048c[_0xe7f0('0x23')][_0xe7f0('0x27')];}if(_0x2c048c[_0xe7f0('0x23')][_0xe7f0('0x28')]){_0x535b1a[_0xe7f0('0x29')]={'user':_0x2c048c[_0xe7f0('0x23')][_0xe7f0('0x17')],'pass':_0x2c048c[_0xe7f0('0x23')]['pass']};}var _0xf07fa6={'account':_0x535b1a,'message':_['merge']({'from':util[_0xe7f0('0x2a')](_0xe7f0('0x2b'),_0x2c048c[_0xe7f0('0xf')],_0x2c048c[_0xe7f0('0x2c')]||_0x2c048c[_0xe7f0('0x23')][_0xe7f0('0x17')])},_0x170daf)};return client[_0xe7f0('0x2d')](_0xe7f0('0x2e'),_0xf07fa6);})[_0xe7f0('0xe')](function(_0xbd833c){if(_0xbd833c[_0xe7f0('0x2f')]){throw new Error(util[_0xe7f0('0x2a')](_0xe7f0('0x30'),_0xbd833c[_0xe7f0('0x2f')]['message']||JSON[_0xe7f0('0x31')](_0xbd833c[_0xe7f0('0x2f')])));}return!![];});}function handleError(_0x3a07ba,_0x58282d,_0x59335d){return _0x3a07ba['status'](_0x58282d||0x1f4)[_0xe7f0('0x32')]({'message':_0x59335d?_0x59335d[_0xe7f0('0x33')]||_0x59335d:''});}exports[_0xe7f0('0x34')]=function(_0x52f690,_0x27146e,_0x1216ae){passport['authenticate'](_0xe7f0('0x35'),function(_0x2cd42a,_0x5c9bb3,_0x4bf019){var _0x2569fb=_0x2cd42a||_0x4bf019;if(_0x2569fb){return handleError(_0x27146e,0x191,_0x2569fb);}if(!_0x5c9bb3){return handleError(_0x27146e,0x194,{'message':_0xe7f0('0x36')});}else{var _0x2a292c={'payload':{'id':_0x5c9bb3['id'],'role':_0x5c9bb3['role']},'options':{'expiresIn':0x15180}};return authService[_0xe7f0('0x37')](_0x2a292c)[_0xe7f0('0xe')](function(_0x1689a6){_0x27146e['json']({'id':_0x5c9bb3['id'],'token':_0x1689a6,'statusCall':'','isAlreadyLogged':_0x5c9bb3[_0xe7f0('0x38')]});});}})(_0x52f690,_0x27146e,_0x1216ae);};exports['forgot']=function(_0x44ce10,_0x2dbc4c,_0x468674){if(!_0x44ce10['body']['email']){return handleError(_0x2dbc4c,0x1f4,{'message':_0xe7f0('0x39')});}var _0x29ba30=rs[_0xe7f0('0x3a')]();_0x44ce10[_0xe7f0('0x3b')][_0xe7f0('0x2c')]=_0x44ce10[_0xe7f0('0x3b')][_0xe7f0('0x2c')][_0xe7f0('0x3c')]()[_0xe7f0('0x3d')]();var _0x29948c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xe7f0('0xc'),_0xe7f0('0xd')],'raw':!![]})[_0xe7f0('0xe')](function(_0x4a75e3){_0x29948c=_0x4a75e3;return db[_0xe7f0('0x3e')][_0xe7f0('0x21')]({'where':{'email':_0x44ce10[_0xe7f0('0x3b')][_0xe7f0('0x2c')]}});})[_0xe7f0('0xe')](function(_0x3ec4ee){if(!_0x3ec4ee){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3ec4ee[_0xe7f0('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3ec4ee['blocked']){if(moment(_0x3ec4ee[_0xe7f0('0x14')])['add'](_0x29948c[_0xe7f0('0xd')],'minutes')>moment()){throw new Error(_0xe7f0('0x3f'));}else{_0x3ec4ee[_0xe7f0('0x1a')]=![];_0x3ec4ee[_0xe7f0('0x14')]=null;}}_0x3ec4ee[_0xe7f0('0x40')]=_0x29ba30;_0x3ec4ee[_0xe7f0('0x41')]=Date[_0xe7f0('0x42')]()+0x36ee80;return _0x3ec4ee[_0xe7f0('0x43')]();})[_0xe7f0('0xe')](function(){return sendServiceMail({'to':_0x44ce10[_0xe7f0('0x3b')][_0xe7f0('0x2c')],'subject':_0xe7f0('0x44'),'text':_0xe7f0('0x45')+_0xe7f0('0x46')+_0xe7f0('0x47')+_0x44ce10['headers']['host']+_0xe7f0('0x48')+_0x29ba30+'\x0a\x0a'+_0xe7f0('0x49')});})[_0xe7f0('0xe')](function(){_0x2dbc4c[_0xe7f0('0x4a')](0xc8)['send']({'message':_0xe7f0('0x4b')});})[_0xe7f0('0x1f')](function(_0x5e73c8){return handleError(_0x2dbc4c,0x1f4,_0x5e73c8);});};exports[_0xe7f0('0x4c')]=function(_0xe3f57c,_0x3be699,_0x19bb9c){return db[_0xe7f0('0x3e')][_0xe7f0('0x21')]({'where':{'resetPasswordToken':_0xe3f57c[_0xe7f0('0x4d')][_0xe7f0('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xe7f0('0x42')]()}}})[_0xe7f0('0xe')](function(_0x15e6ec){if(!_0x15e6ec){throw new Error(_0xe7f0('0x4f'));}return db['Setting'][_0xe7f0('0xb')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xe7f0('0x50')]})[_0xe7f0('0xe')](function(_0x3a96cd){if(_0x3a96cd[_0xe7f0('0x51')])authService[_0xe7f0('0x52')](_0xe3f57c[_0xe7f0('0x3b')][_0xe7f0('0x10')]);if(!_0x3a96cd[_0xe7f0('0x53')]||!_0x15e6ec[_0xe7f0('0x54')])return _0x15e6ec;authService[_0xe7f0('0x55')](_0xe3f57c[_0xe7f0('0x3b')][_0xe7f0('0x10')],_0x15e6ec['previousPasswords'],_0x3a96cd[_0xe7f0('0x50')]);return _0x15e6ec;})[_0xe7f0('0xe')](function(){_0x15e6ec[_0xe7f0('0x10')]=_0xe3f57c['body'][_0xe7f0('0x10')];_0x15e6ec['resetPasswordToken']=null;_0x15e6ec[_0xe7f0('0x41')]=null;return _0x15e6ec['save']();});})['then'](function(){_0x3be699[_0xe7f0('0x4a')](0xc8)[_0xe7f0('0x32')]({'message':_0xe7f0('0x56')});})[_0xe7f0('0x1f')](function(_0x28c68c){return handleError(_0x3be699,0x1f4,_0x28c68c);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xe7f0('0x10')},function(_0x6e6586,_0x14520e,_0x5e4a4a){return localAuthenticate(db[_0xe7f0('0x3e')],_0x6e6586,_0x14520e,_0x5e4a4a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index aeaa057..4e99e32 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 _0x1925=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x9b7417,_0x26743e){var _0x56ed4b=function(_0x934b90){while(--_0x934b90){_0x9b7417['push'](_0x9b7417['shift']());}};_0x56ed4b(++_0x26743e);}(_0x1925,0x7b));var _0x5192=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x1925[_0x5b561d];return _0x431060;};'use strict';var express=require('express');var router=express[_0x5192('0x0')]();var controller=require(_0x5192('0x1'));router[_0x5192('0x2')]('/',controller[_0x5192('0x3')]);router['post'](_0x5192('0x4'),controller[_0x5192('0x5')]);router[_0x5192('0x2')](_0x5192('0x6'),controller[_0x5192('0x7')]);module[_0x5192('0x8')]=router; \ No newline at end of file +var _0x98f3=['/forgot','/reset/:token','exports','express','Router','./authLocal.controller','post'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x98f3,0x122));var _0x398f=function(_0x17558f,_0x42f9f5){_0x17558f=_0x17558f-0x0;var _0x4a81a5=_0x98f3[_0x17558f];return _0x4a81a5;};'use strict';var express=require(_0x398f('0x0'));var router=express[_0x398f('0x1')]();var controller=require(_0x398f('0x2'));router[_0x398f('0x3')]('/',controller['login']);router[_0x398f('0x3')](_0x398f('0x4'),controller['forgot']);router['post'](_0x398f('0x5'),controller['reset']);module[_0x398f('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index eacdabd..c224ce1 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 _0x5733=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x1ee7a7,_0x2478b0){var _0x291a52=function(_0x54718c){while(--_0x54718c){_0x1ee7a7['push'](_0x1ee7a7['shift']());}};_0x291a52(++_0x2478b0);}(_0x5733,0xfe));var _0x3573=function(_0x27204a,_0x4bcf5d){_0x27204a=_0x27204a-0x0;var _0x31faac=_0x5733[_0x27204a];return _0x31faac;};'use strict';var Sequelize=require('sequelize');module[_0x3573('0x0')]={'name':{'type':Sequelize[_0x3573('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3573('0x1')]},'description':{'type':Sequelize[_0x3573('0x1')]},'status':{'type':Sequelize[_0x3573('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3573('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x7f20=['STRING','exports'];(function(_0x5ccc4a,_0x4a5768){var _0x1aaf83=function(_0x158f6d){while(--_0x158f6d){_0x5ccc4a['push'](_0x5ccc4a['shift']());}};_0x1aaf83(++_0x4a5768);}(_0x7f20,0xcd));var _0x07f2=function(_0x58e4e8,_0x28dac0){_0x58e4e8=_0x58e4e8-0x0;var _0x17cd94=_0x7f20[_0x58e4e8];return _0x17cd94;};'use strict';var Sequelize=require('sequelize');module[_0x07f2('0x0')]={'name':{'type':Sequelize[_0x07f2('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x07f2('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 27d0627..bdb36bc 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 _0xde33=['count','limit','Content-Range','json','apply','reject','destroy','then','error','stack','name','map','Automation','rawAttributes','type','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','includeAll','include','findAll','rows','show','params','keys','fields','options','find','catch','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','merge','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x3e98b6,_0x39ad0e){var _0x1cc143=function(_0x8f2836){while(--_0x8f2836){_0x3e98b6['push'](_0x3e98b6['shift']());}};_0x1cc143(++_0x39ad0e);}(_0xde33,0x1d2));var _0x3de3=function(_0x293398,_0x33a246){_0x293398=_0x293398-0x0;var _0x5f4e57=_0xde33[_0x293398];return _0x5f4e57;};'use strict';var emlformat=require(_0x3de3('0x0'));var rimraf=require(_0x3de3('0x1'));var zipdir=require(_0x3de3('0x2'));var jsonpatch=require(_0x3de3('0x3'));var rp=require('request-promise');var moment=require(_0x3de3('0x4'));var BPromise=require(_0x3de3('0x5'));var Mustache=require(_0x3de3('0x6'));var util=require(_0x3de3('0x7'));var path=require(_0x3de3('0x8'));var sox=require(_0x3de3('0x9'));var csv=require('to-csv');var ejs=require(_0x3de3('0xa'));var fs=require('fs');var fs_extra=require(_0x3de3('0xb'));var _=require('lodash');var squel=require(_0x3de3('0xc'));var crypto=require(_0x3de3('0xd'));var jsforce=require(_0x3de3('0xe'));var deskjs=require(_0x3de3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3de3('0x10'));var Papa=require(_0x3de3('0x11'));var Redis=require(_0x3de3('0x12'));var authService=require(_0x3de3('0x13'));var qs=require(_0x3de3('0x14'));var as=require(_0x3de3('0x15'));var hardwareService=require(_0x3de3('0x16'));var logger=require(_0x3de3('0x17'))('api');var utils=require(_0x3de3('0x18'));var config=require(_0x3de3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3de3('0x1a'))['db'];function respondWithStatusCode(_0x544fef,_0x7d7034){_0x7d7034=_0x7d7034||0xcc;return function(_0x85d231){if(_0x85d231){return _0x544fef[_0x3de3('0x1b')](_0x7d7034);}return _0x544fef[_0x3de3('0x1c')](_0x7d7034)[_0x3de3('0x1d')]();};}function respondWithResult(_0x53b17b,_0x5a0336){_0x5a0336=_0x5a0336||0xc8;return function(_0x753897){if(_0x753897){return _0x53b17b[_0x3de3('0x1c')](_0x5a0336)['json'](_0x753897);}};}function respondWithFilteredResult(_0x48cb4d,_0x5cd1be){return function(_0x325912){if(_0x325912){var _0x1333aa=typeof _0x5cd1be[_0x3de3('0x1e')]===_0x3de3('0x1f')&&typeof _0x5cd1be['limit']===_0x3de3('0x1f');var _0xf7f829=_0x325912[_0x3de3('0x20')];var _0x28baf7=_0x1333aa?0x0:_0x5cd1be[_0x3de3('0x1e')];var _0x2283cf=_0x1333aa?_0x325912[_0x3de3('0x20')]:_0x5cd1be['offset']+_0x5cd1be[_0x3de3('0x21')];var _0x589660;if(_0x2283cf>=_0xf7f829){_0x2283cf=_0xf7f829;_0x589660=0xc8;}else{_0x589660=0xce;}_0x48cb4d[_0x3de3('0x1c')](_0x589660);return _0x48cb4d['set'](_0x3de3('0x22'),_0x28baf7+'-'+_0x2283cf+'/'+_0xf7f829)[_0x3de3('0x23')](_0x325912);}return null;};}function patchUpdates(_0xade68c){return function(_0x5e9306){try{jsonpatch[_0x3de3('0x24')](_0x5e9306,_0xade68c,!![]);}catch(_0x37f0b8){return BPromise[_0x3de3('0x25')](_0x37f0b8);}return _0x5e9306['save']();};}function saveUpdates(_0x388898,_0x2bf2b6){return function(_0x285e17){if(_0x285e17){return _0x285e17['update'](_0x388898)['then'](function(_0x16cc3f){return _0x16cc3f;});}return null;};}function removeEntity(_0x399f1,_0xc389a2){return function(_0x436977){if(_0x436977){return _0x436977[_0x3de3('0x26')]()[_0x3de3('0x27')](function(){_0x399f1['status'](0xcc)[_0x3de3('0x1d')]();});}};}function handleEntityNotFound(_0x56da9c,_0xd882db){return function(_0x369161){if(!_0x369161){_0x56da9c[_0x3de3('0x1b')](0x194);}return _0x369161;};}function handleError(_0x3cf342,_0x381ba9){_0x381ba9=_0x381ba9||0x1f4;return function(_0x363dd5){logger[_0x3de3('0x28')](_0x363dd5[_0x3de3('0x29')]);if(_0x363dd5['name']){delete _0x363dd5[_0x3de3('0x2a')];}_0x3cf342[_0x3de3('0x1c')](_0x381ba9)['send'](_0x363dd5);};}exports['index']=function(_0x4e8618,_0xe4c00){var _0x5024c2={},_0xff75b9={},_0x130e89={'count':0x0,'rows':[]};var _0x385082=_[_0x3de3('0x2b')](db[_0x3de3('0x2c')][_0x3de3('0x2d')],function(_0x2e24d3){return{'name':_0x2e24d3['fieldName'],'type':_0x2e24d3[_0x3de3('0x2e')]['key']};});_0xff75b9[_0x3de3('0x2f')]=_['map'](_0x385082,_0x3de3('0x2a'));_0xff75b9['query']=_['keys'](_0x4e8618['query']);_0xff75b9[_0x3de3('0x30')]=_[_0x3de3('0x31')](_0xff75b9[_0x3de3('0x2f')],_0xff75b9[_0x3de3('0x32')]);_0x5024c2[_0x3de3('0x33')]=_[_0x3de3('0x31')](_0xff75b9['model'],qs['fields'](_0x4e8618[_0x3de3('0x32')]['fields']));_0x5024c2[_0x3de3('0x33')]=_0x5024c2['attributes'][_0x3de3('0x34')]?_0x5024c2['attributes']:_0xff75b9[_0x3de3('0x2f')];if(!_0x4e8618[_0x3de3('0x32')][_0x3de3('0x35')](_0x3de3('0x36'))){_0x5024c2['limit']=qs[_0x3de3('0x21')](_0x4e8618[_0x3de3('0x32')][_0x3de3('0x21')]);_0x5024c2['offset']=qs[_0x3de3('0x1e')](_0x4e8618[_0x3de3('0x32')][_0x3de3('0x1e')]);}_0x5024c2[_0x3de3('0x37')]=qs['sort'](_0x4e8618[_0x3de3('0x32')][_0x3de3('0x38')]);_0x5024c2[_0x3de3('0x39')]=qs['filters'](_['pick'](_0x4e8618['query'],_0xff75b9[_0x3de3('0x30')]),_0x385082);if(_0x4e8618[_0x3de3('0x32')]['filter']){_0x5024c2['where']=_['merge'](_0x5024c2[_0x3de3('0x39')],{'$or':_[_0x3de3('0x2b')](_0x385082,function(_0x36449d){if(_0x36449d['type']!=='VIRTUAL'){var _0x44dfe3={};_0x44dfe3[_0x36449d['name']]={'$like':'%'+_0x4e8618['query'][_0x3de3('0x3a')]+'%'};return _0x44dfe3;}})});}_0x5024c2=_['merge']({},_0x5024c2,_0x4e8618['options']);var _0x1ad592={'where':_0x5024c2[_0x3de3('0x39')]};return db[_0x3de3('0x2c')][_0x3de3('0x20')](_0x1ad592)[_0x3de3('0x27')](function(_0x1c8118){_0x130e89[_0x3de3('0x20')]=_0x1c8118;if(_0x4e8618[_0x3de3('0x32')][_0x3de3('0x3b')]){_0x5024c2[_0x3de3('0x3c')]=[{'all':!![]}];}return db['Automation'][_0x3de3('0x3d')](_0x5024c2);})[_0x3de3('0x27')](function(_0x3919c3){_0x130e89[_0x3de3('0x3e')]=_0x3919c3;return _0x130e89;})[_0x3de3('0x27')](respondWithFilteredResult(_0xe4c00,_0x5024c2))['catch'](handleError(_0xe4c00,null));};exports[_0x3de3('0x3f')]=function(_0x98a419,_0x5ce19c){var _0x19ece4={'raw':![],'where':{'id':_0x98a419[_0x3de3('0x40')]['id']}},_0x336a15={};_0x336a15[_0x3de3('0x2f')]=_['keys'](db[_0x3de3('0x2c')][_0x3de3('0x2d')]);_0x336a15['query']=_[_0x3de3('0x41')](_0x98a419[_0x3de3('0x32')]);_0x336a15['filters']=_[_0x3de3('0x31')](_0x336a15[_0x3de3('0x2f')],_0x336a15[_0x3de3('0x32')]);_0x19ece4[_0x3de3('0x33')]=_[_0x3de3('0x31')](_0x336a15[_0x3de3('0x2f')],qs[_0x3de3('0x42')](_0x98a419[_0x3de3('0x32')][_0x3de3('0x42')]));_0x19ece4[_0x3de3('0x33')]=_0x19ece4['attributes'][_0x3de3('0x34')]?_0x19ece4[_0x3de3('0x33')]:_0x336a15['model'];if(_0x98a419[_0x3de3('0x32')]['includeAll']){_0x19ece4[_0x3de3('0x3c')]=[{'all':!![]}];}_0x19ece4=_['merge']({},_0x19ece4,_0x98a419[_0x3de3('0x43')]);return db[_0x3de3('0x2c')][_0x3de3('0x44')](_0x19ece4)['then'](handleEntityNotFound(_0x5ce19c,null))[_0x3de3('0x27')](respondWithResult(_0x5ce19c,null))[_0x3de3('0x45')](handleError(_0x5ce19c,null));};exports[_0x3de3('0x46')]=function(_0x3af801,_0x564c65){return db[_0x3de3('0x2c')][_0x3de3('0x46')](_0x3af801[_0x3de3('0x47')],{})['then'](respondWithResult(_0x564c65,0xc9))[_0x3de3('0x45')](handleError(_0x564c65,null));};exports[_0x3de3('0x48')]=function(_0x469ac5,_0x3d9ddd){if(_0x469ac5[_0x3de3('0x47')]['id']){delete _0x469ac5['body']['id'];}return db[_0x3de3('0x2c')][_0x3de3('0x44')]({'where':{'id':_0x469ac5[_0x3de3('0x40')]['id']}})[_0x3de3('0x27')](handleEntityNotFound(_0x3d9ddd,null))[_0x3de3('0x27')](saveUpdates(_0x469ac5['body'],null))[_0x3de3('0x27')](respondWithResult(_0x3d9ddd,null))[_0x3de3('0x45')](handleError(_0x3d9ddd,null));};exports[_0x3de3('0x26')]=function(_0x3ede5d,_0x15e221){return db[_0x3de3('0x2c')][_0x3de3('0x44')]({'where':{'id':_0x3ede5d[_0x3de3('0x40')]['id']}})[_0x3de3('0x27')](handleEntityNotFound(_0x15e221,null))[_0x3de3('0x27')](removeEntity(_0x15e221,null))[_0x3de3('0x45')](handleError(_0x15e221,null));};exports[_0x3de3('0x49')]=function(_0x54bf7f,_0x66cf65,_0x34c137){return db[_0x3de3('0x4a')][_0x3de3('0x44')]({'where':{'id':_0x54bf7f['params']['id']}})[_0x3de3('0x27')](handleEntityNotFound(_0x66cf65,null))[_0x3de3('0x27')](function(_0x3c26b7){if(_0x3c26b7){return _0x3c26b7['addConditions'](_0x54bf7f[_0x3de3('0x47')][_0x3de3('0x4b')],_[_0x3de3('0x4c')](_0x54bf7f['body'],[_0x3de3('0x4b'),'id'])||{});}})[_0x3de3('0x27')](respondWithResult(_0x66cf65,null))[_0x3de3('0x45')](handleError(_0x66cf65,null));};exports[_0x3de3('0x4d')]=function(_0x31c506,_0x362df6,_0x298c14){var _0x405f53={};var _0x36847e={};var _0x46da23;var _0x40b6e0;return db['Automation'][_0x3de3('0x4e')]({'where':{'id':_0x31c506[_0x3de3('0x40')]['id']}})['then'](handleEntityNotFound(_0x362df6,null))[_0x3de3('0x27')](function(_0x1e4355){if(_0x1e4355){_0x46da23=_0x1e4355;_0x36847e[_0x3de3('0x2f')]=_[_0x3de3('0x41')](db[_0x3de3('0x4a')][_0x3de3('0x2d')]);_0x36847e[_0x3de3('0x32')]=_[_0x3de3('0x41')](_0x31c506[_0x3de3('0x32')]);_0x36847e[_0x3de3('0x30')]=_[_0x3de3('0x31')](_0x36847e[_0x3de3('0x2f')],_0x36847e[_0x3de3('0x32')]);_0x405f53[_0x3de3('0x33')]=_['intersection'](_0x36847e['model'],qs[_0x3de3('0x42')](_0x31c506[_0x3de3('0x32')][_0x3de3('0x42')]));_0x405f53[_0x3de3('0x33')]=_0x405f53[_0x3de3('0x33')][_0x3de3('0x34')]?_0x405f53[_0x3de3('0x33')]:_0x36847e[_0x3de3('0x2f')];_0x405f53[_0x3de3('0x37')]=qs[_0x3de3('0x38')](_0x31c506['query'][_0x3de3('0x38')]);_0x405f53['where']=qs['filters'](_['pick'](_0x31c506['query'],_0x36847e[_0x3de3('0x30')]));if(_0x31c506[_0x3de3('0x32')][_0x3de3('0x3a')]){_0x405f53[_0x3de3('0x39')]=_[_0x3de3('0x4f')](_0x405f53[_0x3de3('0x39')],{'$or':_[_0x3de3('0x2b')](_0x405f53['attributes'],function(_0x46fcd9){var _0x2b823a={};_0x2b823a[_0x46fcd9]={'$like':'%'+_0x31c506[_0x3de3('0x32')]['filter']+'%'};return _0x2b823a;})});}_0x405f53=_['merge']({},_0x405f53,_0x31c506['options']);return _0x46da23['getConditions'](_0x405f53);}})[_0x3de3('0x27')](function(_0x582058){if(_0x582058){_0x40b6e0=_0x582058[_0x3de3('0x34')];if(!_0x31c506[_0x3de3('0x32')]['hasOwnProperty']('nolimit')){_0x405f53['limit']=qs[_0x3de3('0x21')](_0x31c506['query'][_0x3de3('0x21')]);_0x405f53[_0x3de3('0x1e')]=qs[_0x3de3('0x1e')](_0x31c506[_0x3de3('0x32')][_0x3de3('0x1e')]);}return _0x46da23[_0x3de3('0x4d')](_0x405f53);}})[_0x3de3('0x27')](function(_0xe93070){if(_0xe93070){return _0xe93070?{'count':_0x40b6e0,'rows':_0xe93070}:null;}})[_0x3de3('0x27')](respondWithResult(_0x362df6,null))[_0x3de3('0x45')](handleError(_0x362df6,null));};exports[_0x3de3('0x50')]=function(_0x4bcb5a,_0x116b3,_0x3a642f){return db[_0x3de3('0x51')][_0x3de3('0x44')]({'where':{'id':_0x4bcb5a[_0x3de3('0x40')]['id']}})[_0x3de3('0x27')](handleEntityNotFound(_0x116b3,null))[_0x3de3('0x27')](function(_0x4f6159){if(_0x4f6159){return _0x4f6159[_0x3de3('0x50')](_0x4bcb5a['body']['ids'],_[_0x3de3('0x4c')](_0x4bcb5a['body'],['ids','id'])||{});}})[_0x3de3('0x27')](respondWithResult(_0x116b3,null))[_0x3de3('0x45')](handleError(_0x116b3,null));};exports[_0x3de3('0x52')]=function(_0x4470ac,_0x3b6900,_0x14ce17){var _0x10c3af={};var _0x4a2ad2={};var _0x4055fd;var _0x16fa97;return db['Automation'][_0x3de3('0x4e')]({'where':{'id':_0x4470ac[_0x3de3('0x40')]['id']}})[_0x3de3('0x27')](handleEntityNotFound(_0x3b6900,null))[_0x3de3('0x27')](function(_0x1b96a3){if(_0x1b96a3){_0x4055fd=_0x1b96a3;_0x4a2ad2[_0x3de3('0x2f')]=_[_0x3de3('0x41')](db['Action']['rawAttributes']);_0x4a2ad2[_0x3de3('0x32')]=_[_0x3de3('0x41')](_0x4470ac[_0x3de3('0x32')]);_0x4a2ad2['filters']=_[_0x3de3('0x31')](_0x4a2ad2[_0x3de3('0x2f')],_0x4a2ad2['query']);_0x10c3af['attributes']=_[_0x3de3('0x31')](_0x4a2ad2['model'],qs['fields'](_0x4470ac[_0x3de3('0x32')][_0x3de3('0x42')]));_0x10c3af[_0x3de3('0x33')]=_0x10c3af[_0x3de3('0x33')][_0x3de3('0x34')]?_0x10c3af['attributes']:_0x4a2ad2[_0x3de3('0x2f')];_0x10c3af[_0x3de3('0x37')]=qs['sort'](_0x4470ac[_0x3de3('0x32')][_0x3de3('0x38')]);_0x10c3af['where']=qs[_0x3de3('0x30')](_['pick'](_0x4470ac[_0x3de3('0x32')],_0x4a2ad2[_0x3de3('0x30')]));if(_0x4470ac[_0x3de3('0x32')]['filter']){_0x10c3af['where']=_[_0x3de3('0x4f')](_0x10c3af['where'],{'$or':_[_0x3de3('0x2b')](_0x10c3af[_0x3de3('0x33')],function(_0x206bd7){var _0x2f1d96={};_0x2f1d96[_0x206bd7]={'$like':'%'+_0x4470ac['query'][_0x3de3('0x3a')]+'%'};return _0x2f1d96;})});}_0x10c3af=_['merge']({},_0x10c3af,_0x4470ac[_0x3de3('0x43')]);return _0x4055fd['getActions'](_0x10c3af);}})[_0x3de3('0x27')](function(_0x1ef2fb){if(_0x1ef2fb){_0x16fa97=_0x1ef2fb[_0x3de3('0x34')];if(!_0x4470ac[_0x3de3('0x32')][_0x3de3('0x35')]('nolimit')){_0x10c3af['limit']=qs[_0x3de3('0x21')](_0x4470ac[_0x3de3('0x32')][_0x3de3('0x21')]);_0x10c3af[_0x3de3('0x1e')]=qs[_0x3de3('0x1e')](_0x4470ac[_0x3de3('0x32')][_0x3de3('0x1e')]);}return _0x4055fd['getActions'](_0x10c3af);}})[_0x3de3('0x27')](function(_0x588e88){if(_0x588e88){return _0x588e88?{'count':_0x16fa97,'rows':_0x588e88}:null;}})['then'](respondWithResult(_0x3b6900,null))['catch'](handleError(_0x3b6900,null));}; \ No newline at end of file +var _0xb5e2=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','Condition','addConditions','ids','getConditions','findOne','pick','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','fs-extra','lodash'];(function(_0x386d3a,_0x361715){var _0x2cee02=function(_0x5d2989){while(--_0x5d2989){_0x386d3a['push'](_0x386d3a['shift']());}};_0x2cee02(++_0x361715);}(_0xb5e2,0x9a));var _0x2b5e=function(_0x39f05d,_0x5c1937){_0x39f05d=_0x39f05d-0x0;var _0x1a341d=_0xb5e2[_0x39f05d];return _0x1a341d;};'use strict';var emlformat=require(_0x2b5e('0x0'));var rimraf=require(_0x2b5e('0x1'));var zipdir=require(_0x2b5e('0x2'));var jsonpatch=require(_0x2b5e('0x3'));var rp=require(_0x2b5e('0x4'));var moment=require('moment');var BPromise=require(_0x2b5e('0x5'));var Mustache=require(_0x2b5e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2b5e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b5e('0x8'));var _=require(_0x2b5e('0x9'));var squel=require(_0x2b5e('0xa'));var crypto=require(_0x2b5e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2b5e('0xc'));var toCsv=require(_0x2b5e('0x7'));var querystring=require(_0x2b5e('0xd'));var Papa=require(_0x2b5e('0xe'));var Redis=require('ioredis');var authService=require(_0x2b5e('0xf'));var qs=require(_0x2b5e('0x10'));var as=require(_0x2b5e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b5e('0x12'))(_0x2b5e('0x13'));var utils=require(_0x2b5e('0x14'));var config=require(_0x2b5e('0x15'));var licenseUtil=require(_0x2b5e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x355940,_0xb8ccf4){_0xb8ccf4=_0xb8ccf4||0xcc;return function(_0x578619){if(_0x578619){return _0x355940[_0x2b5e('0x17')](_0xb8ccf4);}return _0x355940['status'](_0xb8ccf4)[_0x2b5e('0x18')]();};}function respondWithResult(_0x3ef7c7,_0x4a6d3a){_0x4a6d3a=_0x4a6d3a||0xc8;return function(_0x2e85ca){if(_0x2e85ca){return _0x3ef7c7[_0x2b5e('0x19')](_0x4a6d3a)[_0x2b5e('0x1a')](_0x2e85ca);}};}function respondWithFilteredResult(_0x54ea20,_0x385282){return function(_0x28be55){if(_0x28be55){var _0x3de70c=typeof _0x385282[_0x2b5e('0x1b')]===_0x2b5e('0x1c')&&typeof _0x385282['limit']===_0x2b5e('0x1c');var _0x40e76e=_0x28be55[_0x2b5e('0x1d')];var _0x5dd0c3=_0x3de70c?0x0:_0x385282[_0x2b5e('0x1b')];var _0x1079f4=_0x3de70c?_0x28be55[_0x2b5e('0x1d')]:_0x385282[_0x2b5e('0x1b')]+_0x385282[_0x2b5e('0x1e')];var _0x3d154e;if(_0x1079f4>=_0x40e76e){_0x1079f4=_0x40e76e;_0x3d154e=0xc8;}else{_0x3d154e=0xce;}_0x54ea20[_0x2b5e('0x19')](_0x3d154e);return _0x54ea20[_0x2b5e('0x1f')](_0x2b5e('0x20'),_0x5dd0c3+'-'+_0x1079f4+'/'+_0x40e76e)[_0x2b5e('0x1a')](_0x28be55);}return null;};}function patchUpdates(_0x3e8066){return function(_0x280b5a){try{jsonpatch[_0x2b5e('0x21')](_0x280b5a,_0x3e8066,!![]);}catch(_0x2b9fa6){return BPromise[_0x2b5e('0x22')](_0x2b9fa6);}return _0x280b5a[_0x2b5e('0x23')]();};}function saveUpdates(_0x2f1a9b,_0x278c64){return function(_0x995e1b){if(_0x995e1b){return _0x995e1b[_0x2b5e('0x24')](_0x2f1a9b)[_0x2b5e('0x25')](function(_0x500b1b){return _0x500b1b;});}return null;};}function removeEntity(_0x32c126,_0x5bcdd6){return function(_0x4b0be9){if(_0x4b0be9){return _0x4b0be9[_0x2b5e('0x26')]()['then'](function(){_0x32c126['status'](0xcc)[_0x2b5e('0x18')]();});}};}function handleEntityNotFound(_0x55abf6,_0x436ab3){return function(_0x50d31c){if(!_0x50d31c){_0x55abf6[_0x2b5e('0x17')](0x194);}return _0x50d31c;};}function handleError(_0x37827b,_0x894d05){_0x894d05=_0x894d05||0x1f4;return function(_0x19b327){logger[_0x2b5e('0x27')](_0x19b327['stack']);if(_0x19b327[_0x2b5e('0x28')]){delete _0x19b327[_0x2b5e('0x28')];}_0x37827b['status'](_0x894d05)[_0x2b5e('0x29')](_0x19b327);};}exports[_0x2b5e('0x2a')]=function(_0x510b4f,_0x4f38a9){var _0x8af263={},_0x54f6d6={},_0x2a4136={'count':0x0,'rows':[]};var _0x1f6183=_[_0x2b5e('0x2b')](db[_0x2b5e('0x2c')][_0x2b5e('0x2d')],function(_0x2d1096){return{'name':_0x2d1096['fieldName'],'type':_0x2d1096[_0x2b5e('0x2e')][_0x2b5e('0x2f')]};});_0x54f6d6[_0x2b5e('0x30')]=_[_0x2b5e('0x2b')](_0x1f6183,_0x2b5e('0x28'));_0x54f6d6[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0x510b4f[_0x2b5e('0x31')]);_0x54f6d6[_0x2b5e('0x33')]=_[_0x2b5e('0x34')](_0x54f6d6[_0x2b5e('0x30')],_0x54f6d6[_0x2b5e('0x31')]);_0x8af263['attributes']=_[_0x2b5e('0x34')](_0x54f6d6['model'],qs[_0x2b5e('0x35')](_0x510b4f[_0x2b5e('0x31')][_0x2b5e('0x35')]));_0x8af263[_0x2b5e('0x36')]=_0x8af263[_0x2b5e('0x36')]['length']?_0x8af263['attributes']:_0x54f6d6[_0x2b5e('0x30')];if(!_0x510b4f['query'][_0x2b5e('0x37')](_0x2b5e('0x38'))){_0x8af263[_0x2b5e('0x1e')]=qs[_0x2b5e('0x1e')](_0x510b4f[_0x2b5e('0x31')]['limit']);_0x8af263[_0x2b5e('0x1b')]=qs['offset'](_0x510b4f[_0x2b5e('0x31')][_0x2b5e('0x1b')]);}_0x8af263[_0x2b5e('0x39')]=qs[_0x2b5e('0x3a')](_0x510b4f['query']['sort']);_0x8af263['where']=qs[_0x2b5e('0x33')](_['pick'](_0x510b4f[_0x2b5e('0x31')],_0x54f6d6[_0x2b5e('0x33')]),_0x1f6183);if(_0x510b4f['query']['filter']){_0x8af263[_0x2b5e('0x3b')]=_[_0x2b5e('0x3c')](_0x8af263['where'],{'$or':_[_0x2b5e('0x2b')](_0x1f6183,function(_0x218085){if(_0x218085[_0x2b5e('0x2e')]!=='VIRTUAL'){var _0x4792b2={};_0x4792b2[_0x218085['name']]={'$like':'%'+_0x510b4f[_0x2b5e('0x31')][_0x2b5e('0x3d')]+'%'};return _0x4792b2;}})});}_0x8af263=_['merge']({},_0x8af263,_0x510b4f[_0x2b5e('0x3e')]);var _0x16dfc9={'where':_0x8af263[_0x2b5e('0x3b')]};return db[_0x2b5e('0x2c')][_0x2b5e('0x1d')](_0x16dfc9)[_0x2b5e('0x25')](function(_0x34c761){_0x2a4136[_0x2b5e('0x1d')]=_0x34c761;if(_0x510b4f[_0x2b5e('0x31')][_0x2b5e('0x3f')]){_0x8af263['include']=[{'all':!![]}];}return db[_0x2b5e('0x2c')][_0x2b5e('0x40')](_0x8af263);})[_0x2b5e('0x25')](function(_0x5d5868){_0x2a4136[_0x2b5e('0x41')]=_0x5d5868;return _0x2a4136;})['then'](respondWithFilteredResult(_0x4f38a9,_0x8af263))[_0x2b5e('0x42')](handleError(_0x4f38a9,null));};exports[_0x2b5e('0x43')]=function(_0x3586c6,_0x30c1ea){var _0x1b8811={'raw':![],'where':{'id':_0x3586c6[_0x2b5e('0x44')]['id']}},_0xee656d={};_0xee656d[_0x2b5e('0x30')]=_[_0x2b5e('0x32')](db[_0x2b5e('0x2c')][_0x2b5e('0x2d')]);_0xee656d[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0x3586c6[_0x2b5e('0x31')]);_0xee656d[_0x2b5e('0x33')]=_[_0x2b5e('0x34')](_0xee656d[_0x2b5e('0x30')],_0xee656d[_0x2b5e('0x31')]);_0x1b8811[_0x2b5e('0x36')]=_[_0x2b5e('0x34')](_0xee656d[_0x2b5e('0x30')],qs['fields'](_0x3586c6['query'][_0x2b5e('0x35')]));_0x1b8811[_0x2b5e('0x36')]=_0x1b8811[_0x2b5e('0x36')][_0x2b5e('0x45')]?_0x1b8811[_0x2b5e('0x36')]:_0xee656d[_0x2b5e('0x30')];if(_0x3586c6[_0x2b5e('0x31')]['includeAll']){_0x1b8811['include']=[{'all':!![]}];}_0x1b8811=_[_0x2b5e('0x3c')]({},_0x1b8811,_0x3586c6[_0x2b5e('0x3e')]);return db[_0x2b5e('0x2c')][_0x2b5e('0x46')](_0x1b8811)[_0x2b5e('0x25')](handleEntityNotFound(_0x30c1ea,null))[_0x2b5e('0x25')](respondWithResult(_0x30c1ea,null))['catch'](handleError(_0x30c1ea,null));};exports[_0x2b5e('0x47')]=function(_0x4f07fb,_0x1535f1){return db[_0x2b5e('0x2c')]['create'](_0x4f07fb[_0x2b5e('0x48')],{})[_0x2b5e('0x25')](respondWithResult(_0x1535f1,0xc9))[_0x2b5e('0x42')](handleError(_0x1535f1,null));};exports[_0x2b5e('0x24')]=function(_0x372d91,_0xb26b10){if(_0x372d91[_0x2b5e('0x48')]['id']){delete _0x372d91[_0x2b5e('0x48')]['id'];}return db[_0x2b5e('0x2c')][_0x2b5e('0x46')]({'where':{'id':_0x372d91[_0x2b5e('0x44')]['id']}})[_0x2b5e('0x25')](handleEntityNotFound(_0xb26b10,null))[_0x2b5e('0x25')](saveUpdates(_0x372d91['body'],null))[_0x2b5e('0x25')](respondWithResult(_0xb26b10,null))[_0x2b5e('0x42')](handleError(_0xb26b10,null));};exports[_0x2b5e('0x26')]=function(_0xfc5c8e,_0x35f9b5){return db[_0x2b5e('0x2c')][_0x2b5e('0x46')]({'where':{'id':_0xfc5c8e[_0x2b5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x35f9b5,null))[_0x2b5e('0x25')](removeEntity(_0x35f9b5,null))[_0x2b5e('0x42')](handleError(_0x35f9b5,null));};exports['addConditions']=function(_0x1713ca,_0x1aa2b0,_0x1073b0){return db[_0x2b5e('0x49')][_0x2b5e('0x46')]({'where':{'id':_0x1713ca[_0x2b5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1aa2b0,null))[_0x2b5e('0x25')](function(_0x5b9431){if(_0x5b9431){return _0x5b9431[_0x2b5e('0x4a')](_0x1713ca[_0x2b5e('0x48')]['ids'],_['omit'](_0x1713ca[_0x2b5e('0x48')],[_0x2b5e('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1aa2b0,null))[_0x2b5e('0x42')](handleError(_0x1aa2b0,null));};exports[_0x2b5e('0x4c')]=function(_0xc38b70,_0x4b135c,_0x4c38eb){var _0xeaffe9={};var _0x41fe68={};var _0x3d18e1;var _0x41250d;return db[_0x2b5e('0x2c')][_0x2b5e('0x4d')]({'where':{'id':_0xc38b70[_0x2b5e('0x44')]['id']}})[_0x2b5e('0x25')](handleEntityNotFound(_0x4b135c,null))['then'](function(_0x58382e){if(_0x58382e){_0x3d18e1=_0x58382e;_0x41fe68[_0x2b5e('0x30')]=_[_0x2b5e('0x32')](db[_0x2b5e('0x49')][_0x2b5e('0x2d')]);_0x41fe68[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0xc38b70['query']);_0x41fe68[_0x2b5e('0x33')]=_[_0x2b5e('0x34')](_0x41fe68[_0x2b5e('0x30')],_0x41fe68[_0x2b5e('0x31')]);_0xeaffe9['attributes']=_[_0x2b5e('0x34')](_0x41fe68[_0x2b5e('0x30')],qs[_0x2b5e('0x35')](_0xc38b70[_0x2b5e('0x31')][_0x2b5e('0x35')]));_0xeaffe9[_0x2b5e('0x36')]=_0xeaffe9[_0x2b5e('0x36')][_0x2b5e('0x45')]?_0xeaffe9['attributes']:_0x41fe68['model'];_0xeaffe9[_0x2b5e('0x39')]=qs[_0x2b5e('0x3a')](_0xc38b70[_0x2b5e('0x31')]['sort']);_0xeaffe9[_0x2b5e('0x3b')]=qs[_0x2b5e('0x33')](_[_0x2b5e('0x4e')](_0xc38b70[_0x2b5e('0x31')],_0x41fe68[_0x2b5e('0x33')]));if(_0xc38b70[_0x2b5e('0x31')][_0x2b5e('0x3d')]){_0xeaffe9['where']=_[_0x2b5e('0x3c')](_0xeaffe9[_0x2b5e('0x3b')],{'$or':_[_0x2b5e('0x2b')](_0xeaffe9[_0x2b5e('0x36')],function(_0x5b70e0){var _0x5ef7f7={};_0x5ef7f7[_0x5b70e0]={'$like':'%'+_0xc38b70[_0x2b5e('0x31')][_0x2b5e('0x3d')]+'%'};return _0x5ef7f7;})});}_0xeaffe9=_['merge']({},_0xeaffe9,_0xc38b70['options']);return _0x3d18e1[_0x2b5e('0x4c')](_0xeaffe9);}})[_0x2b5e('0x25')](function(_0x28f943){if(_0x28f943){_0x41250d=_0x28f943[_0x2b5e('0x45')];if(!_0xc38b70[_0x2b5e('0x31')][_0x2b5e('0x37')](_0x2b5e('0x38'))){_0xeaffe9[_0x2b5e('0x1e')]=qs['limit'](_0xc38b70[_0x2b5e('0x31')]['limit']);_0xeaffe9[_0x2b5e('0x1b')]=qs[_0x2b5e('0x1b')](_0xc38b70[_0x2b5e('0x31')]['offset']);}return _0x3d18e1['getConditions'](_0xeaffe9);}})[_0x2b5e('0x25')](function(_0x514f00){if(_0x514f00){return _0x514f00?{'count':_0x41250d,'rows':_0x514f00}:null;}})[_0x2b5e('0x25')](respondWithResult(_0x4b135c,null))[_0x2b5e('0x42')](handleError(_0x4b135c,null));};exports[_0x2b5e('0x4f')]=function(_0xe2dce7,_0x2f226b,_0xeec28a){return db['Action'][_0x2b5e('0x46')]({'where':{'id':_0xe2dce7[_0x2b5e('0x44')]['id']}})[_0x2b5e('0x25')](handleEntityNotFound(_0x2f226b,null))[_0x2b5e('0x25')](function(_0x286439){if(_0x286439){return _0x286439[_0x2b5e('0x4f')](_0xe2dce7[_0x2b5e('0x48')]['ids'],_['omit'](_0xe2dce7[_0x2b5e('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x2f226b,null))['catch'](handleError(_0x2f226b,null));};exports['getActions']=function(_0xaf8eaa,_0x28780,_0x4f5c25){var _0x270b24={};var _0x661b59={};var _0x3a777b;var _0x3598f3;return db[_0x2b5e('0x2c')]['findOne']({'where':{'id':_0xaf8eaa[_0x2b5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x28780,null))[_0x2b5e('0x25')](function(_0x1c6eb2){if(_0x1c6eb2){_0x3a777b=_0x1c6eb2;_0x661b59[_0x2b5e('0x30')]=_[_0x2b5e('0x32')](db[_0x2b5e('0x50')][_0x2b5e('0x2d')]);_0x661b59[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0xaf8eaa[_0x2b5e('0x31')]);_0x661b59[_0x2b5e('0x33')]=_[_0x2b5e('0x34')](_0x661b59['model'],_0x661b59[_0x2b5e('0x31')]);_0x270b24[_0x2b5e('0x36')]=_['intersection'](_0x661b59[_0x2b5e('0x30')],qs[_0x2b5e('0x35')](_0xaf8eaa[_0x2b5e('0x31')][_0x2b5e('0x35')]));_0x270b24['attributes']=_0x270b24[_0x2b5e('0x36')][_0x2b5e('0x45')]?_0x270b24[_0x2b5e('0x36')]:_0x661b59[_0x2b5e('0x30')];_0x270b24['order']=qs[_0x2b5e('0x3a')](_0xaf8eaa[_0x2b5e('0x31')][_0x2b5e('0x3a')]);_0x270b24[_0x2b5e('0x3b')]=qs[_0x2b5e('0x33')](_[_0x2b5e('0x4e')](_0xaf8eaa[_0x2b5e('0x31')],_0x661b59[_0x2b5e('0x33')]));if(_0xaf8eaa[_0x2b5e('0x31')][_0x2b5e('0x3d')]){_0x270b24[_0x2b5e('0x3b')]=_['merge'](_0x270b24[_0x2b5e('0x3b')],{'$or':_['map'](_0x270b24['attributes'],function(_0x3f799c){var _0x3c40b2={};_0x3c40b2[_0x3f799c]={'$like':'%'+_0xaf8eaa[_0x2b5e('0x31')][_0x2b5e('0x3d')]+'%'};return _0x3c40b2;})});}_0x270b24=_[_0x2b5e('0x3c')]({},_0x270b24,_0xaf8eaa[_0x2b5e('0x3e')]);return _0x3a777b[_0x2b5e('0x51')](_0x270b24);}})[_0x2b5e('0x25')](function(_0xbe930d){if(_0xbe930d){_0x3598f3=_0xbe930d[_0x2b5e('0x45')];if(!_0xaf8eaa['query'][_0x2b5e('0x37')](_0x2b5e('0x38'))){_0x270b24[_0x2b5e('0x1e')]=qs[_0x2b5e('0x1e')](_0xaf8eaa[_0x2b5e('0x31')]['limit']);_0x270b24['offset']=qs[_0x2b5e('0x1b')](_0xaf8eaa[_0x2b5e('0x31')][_0x2b5e('0x1b')]);}return _0x3a777b['getActions'](_0x270b24);}})[_0x2b5e('0x25')](function(_0x5ba561){if(_0x5ba561){return _0x5ba561?{'count':_0x3598f3,'rows':_0x5ba561}:null;}})[_0x2b5e('0x25')](respondWithResult(_0x28780,null))[_0x2b5e('0x42')](handleError(_0x28780,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a75f384..8ffea1e 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 _0xc089=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations','lodash','util','../../config/logger','api'];(function(_0x11273e,_0x3821a6){var _0x1e8616=function(_0x439d86){while(--_0x439d86){_0x11273e['push'](_0x11273e['shift']());}};_0x1e8616(++_0x3821a6);}(_0xc089,0x1ac));var _0x9c08=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc089[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x9c08('0x0'));var util=require(_0x9c08('0x1'));var logger=require(_0x9c08('0x2'))(_0x9c08('0x3'));var moment=require('moment');var BPromise=require(_0x9c08('0x4'));var rp=require(_0x9c08('0x5'));var fs=require('fs');var path=require(_0x9c08('0x6'));var rimraf=require(_0x9c08('0x7'));var config=require(_0x9c08('0x8'));var attributes=require(_0x9c08('0x9'));module[_0x9c08('0xa')]=function(_0x2cbc43,_0x95e2b1){return _0x2cbc43['define']('Automation',attributes,{'tableName':_0x9c08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78dc=['tools_automations','lodash','util','bluebird','request-promise','rimraf','./automation.attributes','exports','Automation'];(function(_0x37e1ab,_0x285225){var _0x14c4ce=function(_0x14258f){while(--_0x14258f){_0x37e1ab['push'](_0x37e1ab['shift']());}};_0x14c4ce(++_0x285225);}(_0x78dc,0x121));var _0xc78d=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x78dc[_0x5f46e7];return _0x567e95;};'use strict';var _=require(_0xc78d('0x0'));var util=require(_0xc78d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc78d('0x2'));var rp=require(_0xc78d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc78d('0x4'));var config=require('../../config/environment');var attributes=require(_0xc78d('0x5'));module[_0xc78d('0x6')]=function(_0x56cead,_0x4503be){return _0x56cead['define'](_0xc78d('0x7'),attributes,{'tableName':_0xc78d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index df2e2da..6e65d49 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x20d22c,_0x37b153){var _0x5c5b53=function(_0x40c88c){while(--_0x40c88c){_0x20d22c['push'](_0x20d22c['shift']());}};_0x5c5b53(++_0x37b153);}(_0xb10b,0x12a));var _0xbb10=function(_0x3af770,_0x1a957a){_0x3af770=_0x3af770-0x0;var _0x42c9a9=_0xb10b[_0x3af770];return _0x42c9a9;};'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);});});} \ No newline at end of file +var _0x0b0e=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19cb1a,_0x4ce1b2){_0x19cb1a=_0x19cb1a-0x0;var _0x399650=_0x0b0e[_0x19cb1a];return _0x399650;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Automation,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0e1db84..83ac06d 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 _0xd4b6=['express','fs-extra','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1e2269,_0x8c8b7b){var _0xba8307=function(_0x434dec){while(--_0x434dec){_0x1e2269['push'](_0x1e2269['shift']());}};_0xba8307(++_0x8c8b7b);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x324c1d,_0x269967){_0x324c1d=_0x324c1d-0x0;var _0x127718=_0xd4b6[_0x324c1d];return _0x127718;};'use strict';var multer=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var path=require('path');var timeout=require(_0x6d4b('0x2'));var express=require(_0x6d4b('0x3'));var router=express['Router']();var fs_extra=require(_0x6d4b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d4b('0x5'));router[_0x6d4b('0x6')]('/',auth[_0x6d4b('0x7')](),controller['index']);router[_0x6d4b('0x6')](_0x6d4b('0x8'),auth[_0x6d4b('0x7')](),controller[_0x6d4b('0x9')]);router['get'](_0x6d4b('0xa'),auth[_0x6d4b('0x7')](),controller[_0x6d4b('0xb')]);router[_0x6d4b('0x6')]('/:id/actions',auth[_0x6d4b('0x7')](),controller[_0x6d4b('0xc')]);router[_0x6d4b('0xd')]('/',auth[_0x6d4b('0x7')](),controller[_0x6d4b('0xe')]);router[_0x6d4b('0xd')](_0x6d4b('0xa'),auth['isAuthenticated'](),controller[_0x6d4b('0xf')]);router[_0x6d4b('0xd')](_0x6d4b('0x10'),auth['isAuthenticated'](),controller[_0x6d4b('0x11')]);router[_0x6d4b('0x12')](_0x6d4b('0x8'),auth[_0x6d4b('0x7')](),controller[_0x6d4b('0x13')]);router[_0x6d4b('0x14')](_0x6d4b('0x8'),auth[_0x6d4b('0x7')](),controller[_0x6d4b('0x15')]);module[_0x6d4b('0x16')]=router; \ No newline at end of file +var _0x5f86=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','addConditions','/:id/actions','update','delete','destroy','exports','util','express','Router'];(function(_0x3f8f17,_0x567d62){var _0x2aa559=function(_0x52a165){while(--_0x52a165){_0x3f8f17['push'](_0x3f8f17['shift']());}};_0x2aa559(++_0x567d62);}(_0x5f86,0x81));var _0x65f8=function(_0x1ed180,_0x157dcf){_0x1ed180=_0x1ed180-0x0;var _0x5adf32=_0x5f86[_0x1ed180];return _0x5adf32;};'use strict';var multer=require('multer');var util=require(_0x65f8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65f8('0x1'));var router=express[_0x65f8('0x2')]();var fs_extra=require(_0x65f8('0x3'));var auth=require(_0x65f8('0x4'));var interaction=require(_0x65f8('0x5'));var config=require(_0x65f8('0x6'));var controller=require(_0x65f8('0x7'));router[_0x65f8('0x8')]('/',auth[_0x65f8('0x9')](),controller[_0x65f8('0xa')]);router[_0x65f8('0x8')](_0x65f8('0xb'),auth[_0x65f8('0x9')](),controller[_0x65f8('0xc')]);router[_0x65f8('0x8')](_0x65f8('0xd'),auth[_0x65f8('0x9')](),controller[_0x65f8('0xe')]);router[_0x65f8('0x8')]('/:id/actions',auth[_0x65f8('0x9')](),controller['getActions']);router[_0x65f8('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x65f8('0xf')](_0x65f8('0xd'),auth[_0x65f8('0x9')](),controller[_0x65f8('0x10')]);router[_0x65f8('0xf')](_0x65f8('0x11'),auth[_0x65f8('0x9')](),controller['addActions']);router['put']('/:id',auth[_0x65f8('0x9')](),controller[_0x65f8('0x12')]);router[_0x65f8('0x13')](_0x65f8('0xb'),auth[_0x65f8('0x9')](),controller[_0x65f8('0x14')]);module[_0x65f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f837fee..8d6b651 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 _0x7dd1=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x2c0b32,_0x2c9527){var _0x486cf5=function(_0x106a78){while(--_0x106a78){_0x2c0b32['push'](_0x2c0b32['shift']());}};_0x486cf5(++_0x2c9527);}(_0x7dd1,0x169));var _0x17dd=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7dd1[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x17dd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x17dd('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x17dd('0x2')](_0x17dd('0x3')),'allowNull':![],'defaultValue':_0x17dd('0x3')},'description':{'type':Sequelize[_0x17dd('0x4')]},'active':{'type':Sequelize[_0x17dd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x17dd('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x17dd('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x17dd('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x17dd('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17dd('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x17dd('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x17dd('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x17dd('0x4')],'defaultValue':_0x17dd('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x17dd('0x2')](_0x17dd('0xe'),_0x17dd('0xf'),_0x17dd('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x17dd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x17dd('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x17dd('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x17dd('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x17dd('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x17dd('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x17dd('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x17dd('0x8')](0x9)[_0x17dd('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x17dd('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x17dd('0x8')](0x9)[_0x17dd('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x17dd('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x17dd('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x17dd('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x17dd('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x17dd('0x8')](0x5)[_0x17dd('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x17dd('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x17dd('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x17dd('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x17dd('0x2')](_0x17dd('0x1a'),_0x17dd('0x1b')),'defaultValue':_0x17dd('0x1a')},'dialPrefix':{'type':Sequelize[_0x17dd('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x17dd('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x17dd('0x1c')},'dialCutDigit':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x17dd('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17dd('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17dd('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17dd('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)[_0x17dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)[_0x17dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x17dd('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17dd('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x17dd('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17dd('0x25')}}; \ No newline at end of file +var _0x2fc4=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2fc4,0x9e));var _0x42fc=function(_0x4ce005,_0x3ef482){_0x4ce005=_0x4ce005-0x0;var _0x3ea8d1=_0x2fc4[_0x4ce005];return _0x3ea8d1;};'use strict';var Sequelize=require(_0x42fc('0x0'));module[_0x42fc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x42fc('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x42fc('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x42fc('0x4')},'description':{'type':Sequelize[_0x42fc('0x5')]},'active':{'type':Sequelize[_0x42fc('0x6')],'defaultValue':0x0,'comment':_0x42fc('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x42fc('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x42fc('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x42fc('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x42fc('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42fc('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x42fc('0xa')](0x5)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x42fc('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x42fc('0xa')](0x5)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42fc('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x42fc('0xc')},'dialTimezone':{'type':Sequelize[_0x42fc('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x42fc('0x5')],'defaultValue':_0x42fc('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x42fc('0x3')](_0x42fc('0xe'),_0x42fc('0xf'),_0x42fc('0x10')),'defaultValue':_0x42fc('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x42fc('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x42fc('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x42fc('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x42fc('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x42fc('0xa')](0x9)[_0x42fc('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x42fc('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x42fc('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x42fc('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x42fc('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x42fc('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x42fc('0xa')](0x9)[_0x42fc('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x42fc('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x42fc('0xa')](0x9)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x42fc('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x42fc('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x42fc('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x42fc('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x42fc('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x42fc('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x42fc('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x42fc('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42fc('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42fc('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'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':_0x42fc('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42fc('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x42fc('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42fc('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)[_0x42fc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42fc('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x42fc('0xa')](0x5)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x42fc('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42fc('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x42fc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42fc('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 55139d8..2fa0730 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 _0x3b64=['set','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','Campaign','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','scheduledAt','ContactId','field','phone','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x19399e,_0x55c912){var _0x98a7d=function(_0x507bc5){while(--_0x507bc5){_0x19399e['push'](_0x19399e['shift']());}};_0x98a7d(++_0x55c912);}(_0x3b64,0xf0));var _0x43b6=function(_0x191cc6,_0x141c4d){_0x191cc6=_0x191cc6-0x0;var _0x3fa1d9=_0x3b64[_0x191cc6];return _0x3fa1d9;};'use strict';var emlformat=require(_0x43b6('0x0'));var rimraf=require(_0x43b6('0x1'));var zipdir=require(_0x43b6('0x2'));var jsonpatch=require(_0x43b6('0x3'));var rp=require(_0x43b6('0x4'));var moment=require(_0x43b6('0x5'));var BPromise=require(_0x43b6('0x6'));var Mustache=require('mustache');var util=require(_0x43b6('0x7'));var path=require(_0x43b6('0x8'));var sox=require(_0x43b6('0x9'));var csv=require(_0x43b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43b6('0xb'));var _=require(_0x43b6('0xc'));var squel=require(_0x43b6('0xd'));var crypto=require(_0x43b6('0xe'));var jsforce=require(_0x43b6('0xf'));var deskjs=require(_0x43b6('0x10'));var toCsv=require(_0x43b6('0xa'));var querystring=require('querystring');var Papa=require(_0x43b6('0x11'));var Redis=require(_0x43b6('0x12'));var authService=require(_0x43b6('0x13'));var qs=require(_0x43b6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43b6('0x15'));var logger=require(_0x43b6('0x16'))(_0x43b6('0x17'));var utils=require('../../config/utils');var config=require(_0x43b6('0x18'));var licenseUtil=require(_0x43b6('0x19'));var db=require(_0x43b6('0x1a'))['db'];function respondWithStatusCode(_0x1f3d36,_0x5b8cdb){_0x5b8cdb=_0x5b8cdb||0xcc;return function(_0x3cdc6e){if(_0x3cdc6e){return _0x1f3d36['sendStatus'](_0x5b8cdb);}return _0x1f3d36[_0x43b6('0x1b')](_0x5b8cdb)[_0x43b6('0x1c')]();};}function respondWithResult(_0x2565fd,_0x4f5a05){_0x4f5a05=_0x4f5a05||0xc8;return function(_0x55e66e){if(_0x55e66e){return _0x2565fd['status'](_0x4f5a05)[_0x43b6('0x1d')](_0x55e66e);}};}function respondWithFilteredResult(_0x5d092b,_0x5a2f88){return function(_0x37cac6){if(_0x37cac6){var _0xfae63=typeof _0x5a2f88[_0x43b6('0x1e')]===_0x43b6('0x1f')&&typeof _0x5a2f88[_0x43b6('0x20')]===_0x43b6('0x1f');var _0x2bd2e8=_0x37cac6['count'];var _0x347067=_0xfae63?0x0:_0x5a2f88[_0x43b6('0x1e')];var _0xcb7d0e=_0xfae63?_0x37cac6[_0x43b6('0x21')]:_0x5a2f88['offset']+_0x5a2f88[_0x43b6('0x20')];var _0x597a3c;if(_0xcb7d0e>=_0x2bd2e8){_0xcb7d0e=_0x2bd2e8;_0x597a3c=0xc8;}else{_0x597a3c=0xce;}_0x5d092b[_0x43b6('0x1b')](_0x597a3c);return _0x5d092b[_0x43b6('0x22')]('Content-Range',_0x347067+'-'+_0xcb7d0e+'/'+_0x2bd2e8)['json'](_0x37cac6);}return null;};}function patchUpdates(_0x128dc4){return function(_0x46a44c){try{jsonpatch[_0x43b6('0x23')](_0x46a44c,_0x128dc4,!![]);}catch(_0x32461e){return BPromise['reject'](_0x32461e);}return _0x46a44c[_0x43b6('0x24')]();};}function saveUpdates(_0x19e90e,_0xde59c5){return function(_0x47491f){if(_0x47491f){return _0x47491f[_0x43b6('0x25')](_0x19e90e)[_0x43b6('0x26')](function(_0x2380f4){return _0x2380f4;});}return null;};}function removeEntity(_0x113a1c,_0x2e3f6b){return function(_0x238081){if(_0x238081){return _0x238081[_0x43b6('0x27')]()[_0x43b6('0x26')](function(){var _0x13b741=_0x238081[_0x43b6('0x28')]({'plain':!![]});var _0x1a6088='IvrCampaigns';return db[_0x43b6('0x29')][_0x43b6('0x27')]({'where':{'type':_0x1a6088,'resourceId':_0x13b741['id']}})['then'](function(){return _0x238081;});})[_0x43b6('0x26')](function(){_0x113a1c[_0x43b6('0x1b')](0xcc)[_0x43b6('0x1c')]();});}};}function handleEntityNotFound(_0x47721f,_0x5e13c0){return function(_0x1167cf){if(!_0x1167cf){_0x47721f[_0x43b6('0x2a')](0x194);}return _0x1167cf;};}function handleError(_0x46c6e7,_0x3df895){_0x3df895=_0x3df895||0x1f4;return function(_0x4dfd75){logger[_0x43b6('0x2b')](_0x4dfd75[_0x43b6('0x2c')]);if(_0x4dfd75[_0x43b6('0x2d')]){delete _0x4dfd75[_0x43b6('0x2d')];}_0x46c6e7[_0x43b6('0x1b')](_0x3df895)[_0x43b6('0x2e')](_0x4dfd75);};}exports['index']=function(_0x57d015,_0x3dce50){var _0x466930={},_0x188ca6={},_0x530387={'count':0x0,'rows':[]};var _0x585495=_['map'](db[_0x43b6('0x2f')][_0x43b6('0x30')],function(_0x135899){return{'name':_0x135899[_0x43b6('0x31')],'type':_0x135899[_0x43b6('0x32')]['key']};});_0x188ca6[_0x43b6('0x33')]=_[_0x43b6('0x34')](_0x585495,_0x43b6('0x2d'));_0x188ca6['query']=_[_0x43b6('0x35')](_0x57d015[_0x43b6('0x36')]);_0x188ca6[_0x43b6('0x37')]=_[_0x43b6('0x38')](_0x188ca6['model'],_0x188ca6[_0x43b6('0x36')]);_0x466930['attributes']=_[_0x43b6('0x38')](_0x188ca6[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x57d015[_0x43b6('0x36')][_0x43b6('0x39')]));_0x466930[_0x43b6('0x3a')]=_0x466930[_0x43b6('0x3a')][_0x43b6('0x3b')]?_0x466930[_0x43b6('0x3a')]:_0x188ca6[_0x43b6('0x33')];if(!_0x57d015['query'][_0x43b6('0x3c')](_0x43b6('0x3d'))){_0x466930['limit']=qs['limit'](_0x57d015[_0x43b6('0x36')][_0x43b6('0x20')]);_0x466930['offset']=qs[_0x43b6('0x1e')](_0x57d015[_0x43b6('0x36')][_0x43b6('0x1e')]);}_0x466930['order']=qs[_0x43b6('0x3e')](_0x57d015[_0x43b6('0x36')][_0x43b6('0x3e')]);_0x466930[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x57d015[_0x43b6('0x36')],_0x188ca6['filters']),_0x585495);if(_0x57d015[_0x43b6('0x36')][_0x43b6('0x41')]){_0x466930[_0x43b6('0x3f')]=_[_0x43b6('0x42')](_0x466930[_0x43b6('0x3f')],{'$or':_[_0x43b6('0x34')](_0x585495,function(_0x1761d3){if(_0x1761d3[_0x43b6('0x32')]!=='VIRTUAL'){var _0x2fdd59={};_0x2fdd59[_0x1761d3[_0x43b6('0x2d')]]={'$like':'%'+_0x57d015[_0x43b6('0x36')][_0x43b6('0x41')]+'%'};return _0x2fdd59;}})});}_0x466930=_[_0x43b6('0x42')]({},_0x466930,_0x57d015['options']);var _0x5de99a={'where':_0x466930[_0x43b6('0x3f')]};return db[_0x43b6('0x2f')]['count'](_0x5de99a)[_0x43b6('0x26')](function(_0xbc14c7){_0x530387[_0x43b6('0x21')]=_0xbc14c7;if(_0x57d015['query'][_0x43b6('0x43')]){_0x466930[_0x43b6('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x43b6('0x45')](_0x466930);})[_0x43b6('0x26')](function(_0x2ab6c8){_0x530387[_0x43b6('0x46')]=_0x2ab6c8;return _0x530387;})[_0x43b6('0x26')](respondWithFilteredResult(_0x3dce50,_0x466930))['catch'](handleError(_0x3dce50,null));};exports[_0x43b6('0x47')]=function(_0x3334fc,_0x3c49a5){var _0x1f5014={'raw':![],'where':{'id':_0x3334fc[_0x43b6('0x48')]['id']}},_0x4579f7={};_0x4579f7[_0x43b6('0x33')]=_['keys'](db[_0x43b6('0x2f')][_0x43b6('0x30')]);_0x4579f7[_0x43b6('0x36')]=_[_0x43b6('0x35')](_0x3334fc['query']);_0x4579f7[_0x43b6('0x37')]=_[_0x43b6('0x38')](_0x4579f7[_0x43b6('0x33')],_0x4579f7['query']);_0x1f5014[_0x43b6('0x3a')]=_[_0x43b6('0x38')](_0x4579f7['model'],qs[_0x43b6('0x39')](_0x3334fc[_0x43b6('0x36')][_0x43b6('0x39')]));_0x1f5014[_0x43b6('0x3a')]=_0x1f5014[_0x43b6('0x3a')][_0x43b6('0x3b')]?_0x1f5014[_0x43b6('0x3a')]:_0x4579f7['model'];if(_0x3334fc[_0x43b6('0x36')][_0x43b6('0x43')]){_0x1f5014[_0x43b6('0x44')]=[{'all':!![]}];}_0x1f5014=_[_0x43b6('0x42')]({},_0x1f5014,_0x3334fc[_0x43b6('0x49')]);return db['Campaign'][_0x43b6('0x4a')](_0x1f5014)[_0x43b6('0x26')](handleEntityNotFound(_0x3c49a5,null))[_0x43b6('0x26')](respondWithResult(_0x3c49a5,null))[_0x43b6('0x4b')](handleError(_0x3c49a5,null));};exports[_0x43b6('0x4c')]=function(_0x216831,_0xd201b8){return db[_0x43b6('0x2f')][_0x43b6('0x4c')](_0x216831[_0x43b6('0x4d')],{})[_0x43b6('0x26')](function(_0x80c384){var _0x5b393b=_0x216831[_0x43b6('0x4e')][_0x43b6('0x28')]({'plain':!![]});if(!_0x5b393b)throw new Error(_0x43b6('0x4f'));if(_0x5b393b[_0x43b6('0x50')]===_0x43b6('0x4e')){var _0x1e1cfa=_0x80c384['get']({'plain':!![]});var _0xc57826=_0x43b6('0x51');return db[_0x43b6('0x52')][_0x43b6('0x4a')]({'where':{'name':_0xc57826,'userProfileId':_0x5b393b[_0x43b6('0x53')]},'raw':!![]})[_0x43b6('0x26')](function(_0x553c9c){if(_0x553c9c&&_0x553c9c[_0x43b6('0x54')]===0x0){return db[_0x43b6('0x29')][_0x43b6('0x4c')]({'name':_0x1e1cfa[_0x43b6('0x2d')],'resourceId':_0x1e1cfa['id'],'type':_0x553c9c[_0x43b6('0x2d')],'sectionId':_0x553c9c['id']},{})[_0x43b6('0x26')](function(){return _0x80c384;});}else{return _0x80c384;}})[_0x43b6('0x4b')](function(_0x25ca2b){logger[_0x43b6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25ca2b);throw _0x25ca2b;});}return _0x80c384;})['then'](respondWithResult(_0xd201b8,0xc9))[_0x43b6('0x4b')](handleError(_0xd201b8,null));};exports[_0x43b6('0x55')]=function(_0x339643,_0x1517be){var _0x7e685f={'where':{'id':_0x339643[_0x43b6('0x48')]['id']}},_0x444455={};_0x444455[_0x43b6('0x33')]=_[_0x43b6('0x35')](db[_0x43b6('0x2f')][_0x43b6('0x30')]);_0x7e685f['attributes']=_[_0x43b6('0x38')](_0x444455[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x339643[_0x43b6('0x36')]['fields']));_0x7e685f['attributes']=_0x7e685f[_0x43b6('0x3a')]['length']?_0x7e685f[_0x43b6('0x3a')]:_0x444455[_0x43b6('0x33')];if(_0x339643['query']['includeAll']){_0x7e685f[_0x43b6('0x44')]=[{'all':!![]}];}_0x7e685f=_[_0x43b6('0x42')]({},_0x7e685f,_0x339643['options']);return db['Campaign'][_0x43b6('0x4a')](_0x7e685f)[_0x43b6('0x26')](handleEntityNotFound(_0x1517be,null))[_0x43b6('0x26')](function(_0x1b5748){if(_0x1b5748){var _0x47a418=_0x1b5748['get']({'plain':!![]});_0x47a418=qs[_0x43b6('0x56')](_0x47a418,['id','createdAt','updatedAt']);_0x339643['body']=_[_0x43b6('0x56')](_0x339643[_0x43b6('0x4d')],['id',_0x43b6('0x57'),_0x43b6('0x58')]);return db[_0x43b6('0x2f')][_0x43b6('0x4c')](_[_0x43b6('0x42')](_0x47a418,_0x339643[_0x43b6('0x4d')]),{'include':_0x339643[_0x43b6('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x39d8f2){var _0x39c5e1=_0x339643[_0x43b6('0x4e')][_0x43b6('0x28')]({'plain':!![]});if(!_0x39c5e1)throw new Error(_0x43b6('0x4f'));if(_0x39c5e1[_0x43b6('0x50')]===_0x43b6('0x4e')){var _0xb85ee=_0x39d8f2[_0x43b6('0x28')]({'plain':!![]});var _0x14345f='IvrCampaigns';return db['UserProfileSection'][_0x43b6('0x4a')]({'where':{'name':_0x14345f,'userProfileId':_0x39c5e1[_0x43b6('0x53')]},'raw':!![]})[_0x43b6('0x26')](function(_0x466d6e){if(_0x466d6e&&_0x466d6e[_0x43b6('0x54')]===0x0){return db[_0x43b6('0x29')]['create']({'name':_0xb85ee[_0x43b6('0x2d')],'resourceId':_0xb85ee['id'],'type':_0x466d6e[_0x43b6('0x2d')],'sectionId':_0x466d6e['id']},{})['then'](function(){return _0x39d8f2;});}else{return _0x39d8f2;}})[_0x43b6('0x4b')](function(_0x3bbd0d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bbd0d);throw _0x3bbd0d;});}return _0x39d8f2;});}})[_0x43b6('0x26')](respondWithResult(_0x1517be,0xc9))['catch'](handleError(_0x1517be,null));};exports[_0x43b6('0x25')]=function(_0x3312cc,_0x189390){if(_0x3312cc[_0x43b6('0x4d')]['id']){delete _0x3312cc[_0x43b6('0x4d')]['id'];}return db['Campaign']['find']({'where':{'id':_0x3312cc[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x189390,null))['then'](saveUpdates(_0x3312cc[_0x43b6('0x4d')],null))['then'](respondWithResult(_0x189390,null))['catch'](handleError(_0x189390,null));};exports[_0x43b6('0x27')]=function(_0x16155f,_0x21ba9b){return db[_0x43b6('0x2f')][_0x43b6('0x4a')]({'where':{'id':_0x16155f[_0x43b6('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ba9b,null))[_0x43b6('0x26')](removeEntity(_0x21ba9b,null))[_0x43b6('0x4b')](handleError(_0x21ba9b,null));};exports[_0x43b6('0x59')]=function(_0x519dbb,_0x441222,_0x51b301){var _0x182b2c={'raw':!![],'where':{}};var _0x177c20={};var _0x24277a={'count':0x0,'rows':[]};return db[_0x43b6('0x2f')][_0x43b6('0x5a')]({'where':{'id':_0x519dbb[_0x43b6('0x48')]['id']}})['then'](handleEntityNotFound(_0x441222,null))[_0x43b6('0x26')](function(_0x2f2578){if(_0x2f2578){_0x177c20[_0x43b6('0x33')]=_[_0x43b6('0x35')](db[_0x43b6('0x5b')][_0x43b6('0x30')]);_0x177c20[_0x43b6('0x36')]=_[_0x43b6('0x35')](_0x519dbb['query']);_0x177c20['filters']=_['intersection'](_0x177c20[_0x43b6('0x33')],_0x177c20[_0x43b6('0x36')]);_0x182b2c[_0x43b6('0x3a')]=_['intersection'](_0x177c20[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x519dbb['query']['fields']));_0x182b2c[_0x43b6('0x3a')]=_0x182b2c[_0x43b6('0x3a')][_0x43b6('0x3b')]?_0x182b2c[_0x43b6('0x3a')]:_0x177c20['model'];if(!_0x519dbb[_0x43b6('0x36')][_0x43b6('0x3c')]('nolimit')){_0x182b2c[_0x43b6('0x20')]=qs[_0x43b6('0x20')](_0x519dbb[_0x43b6('0x36')][_0x43b6('0x20')]);_0x182b2c['offset']=qs['offset'](_0x519dbb[_0x43b6('0x36')][_0x43b6('0x1e')]);}_0x182b2c[_0x43b6('0x5c')]=qs[_0x43b6('0x3e')](_0x519dbb[_0x43b6('0x36')]['sort']);_0x182b2c[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x519dbb['query'],_0x177c20['filters']));_0x182b2c['where'][_0x43b6('0x5d')]=_0x2f2578['id'];if(_0x519dbb['query'][_0x43b6('0x41')]){_0x182b2c[_0x43b6('0x3f')]=_[_0x43b6('0x42')](_0x182b2c[_0x43b6('0x3f')],{'$or':_[_0x43b6('0x34')](_0x182b2c['attributes'],function(_0x2803f9){var _0x5b44ff={};_0x5b44ff[_0x2803f9]={'$like':'%'+_0x519dbb[_0x43b6('0x36')][_0x43b6('0x41')]+'%'};return _0x5b44ff;})});}_0x182b2c=_[_0x43b6('0x42')]({},_0x182b2c,_0x519dbb[_0x43b6('0x49')]);return db[_0x43b6('0x5b')][_0x43b6('0x21')]({'where':_0x182b2c[_0x43b6('0x3f')]})[_0x43b6('0x26')](function(_0xf54b75){_0x24277a['count']=_0xf54b75;if(_0x519dbb[_0x43b6('0x36')][_0x43b6('0x43')]){_0x182b2c[_0x43b6('0x44')]=[{'all':!![]}];}return db[_0x43b6('0x5b')][_0x43b6('0x45')](_0x182b2c);})[_0x43b6('0x26')](function(_0x98225e){_0x24277a[_0x43b6('0x46')]=_0x98225e;return _0x24277a;});}})[_0x43b6('0x26')](respondWithFilteredResult(_0x441222,_0x182b2c))[_0x43b6('0x4b')](handleError(_0x441222,null));};exports[_0x43b6('0x5e')]=function(_0x30d357,_0x520f13,_0x12a9cf){var _0xbaea02={'raw':!![],'where':{}};var _0x3b7b7b={};var _0x2c24f3={'count':0x0,'rows':[]};return db[_0x43b6('0x2f')]['findOne']({'where':{'id':_0x30d357[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x520f13,null))[_0x43b6('0x26')](function(_0x3233d3){if(_0x3233d3){_0x3b7b7b[_0x43b6('0x33')]=_[_0x43b6('0x35')](db[_0x43b6('0x5f')][_0x43b6('0x30')]);_0x3b7b7b['query']=_[_0x43b6('0x35')](_0x30d357['query']);_0x3b7b7b[_0x43b6('0x37')]=_['intersection'](_0x3b7b7b[_0x43b6('0x33')],_0x3b7b7b['query']);_0xbaea02['attributes']=_[_0x43b6('0x38')](_0x3b7b7b[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x30d357[_0x43b6('0x36')][_0x43b6('0x39')]));_0xbaea02['attributes']=_0xbaea02['attributes'][_0x43b6('0x3b')]?_0xbaea02['attributes']:_0x3b7b7b[_0x43b6('0x33')];if(!_0x30d357[_0x43b6('0x36')]['hasOwnProperty']('nolimit')){_0xbaea02['limit']=qs[_0x43b6('0x20')](_0x30d357[_0x43b6('0x36')][_0x43b6('0x20')]);_0xbaea02[_0x43b6('0x1e')]=qs[_0x43b6('0x1e')](_0x30d357[_0x43b6('0x36')][_0x43b6('0x1e')]);}_0xbaea02['order']=qs[_0x43b6('0x3e')](_0x30d357[_0x43b6('0x36')][_0x43b6('0x3e')]);_0xbaea02[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x30d357[_0x43b6('0x36')],_0x3b7b7b[_0x43b6('0x37')]));_0xbaea02['where']['CampaignId']=_0x3233d3['id'];if(_0x30d357[_0x43b6('0x36')][_0x43b6('0x41')]){_0xbaea02[_0x43b6('0x3f')]=_['merge'](_0xbaea02['where'],{'$or':_[_0x43b6('0x34')](_0xbaea02[_0x43b6('0x3a')],function(_0x2bd398){var _0x2f2652={};_0x2f2652[_0x2bd398]={'$like':'%'+_0x30d357[_0x43b6('0x36')][_0x43b6('0x41')]+'%'};return _0x2f2652;})});}_0xbaea02=_[_0x43b6('0x42')]({},_0xbaea02,_0x30d357[_0x43b6('0x49')]);return db[_0x43b6('0x5f')][_0x43b6('0x21')]({'where':_0xbaea02[_0x43b6('0x3f')]})[_0x43b6('0x26')](function(_0x4d3214){_0x2c24f3[_0x43b6('0x21')]=_0x4d3214;if(_0x30d357[_0x43b6('0x36')][_0x43b6('0x43')]){_0xbaea02['include']=[{'all':!![]}];}return db[_0x43b6('0x5f')][_0x43b6('0x45')](_0xbaea02);})[_0x43b6('0x26')](function(_0x676bf4){_0x2c24f3['rows']=_0x676bf4;return _0x2c24f3;});}})[_0x43b6('0x26')](respondWithFilteredResult(_0x520f13,_0xbaea02))[_0x43b6('0x4b')](handleError(_0x520f13,null));};exports['getHopperFinals']=function(_0x3abb1d,_0x3bc2c9,_0x311de3){var _0x455d5e={'raw':!![],'where':{}};var _0x9cc7ad={};var _0x1b642e={'count':0x0,'rows':[]};return db[_0x43b6('0x2f')][_0x43b6('0x5a')]({'where':{'id':_0x3abb1d[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x3bc2c9,null))[_0x43b6('0x26')](function(_0x41a7aa){if(_0x41a7aa){_0x9cc7ad['model']=_[_0x43b6('0x35')](db['CmHopperFinal'][_0x43b6('0x30')]);_0x9cc7ad[_0x43b6('0x36')]=_[_0x43b6('0x35')](_0x3abb1d[_0x43b6('0x36')]);_0x9cc7ad[_0x43b6('0x37')]=_[_0x43b6('0x38')](_0x9cc7ad[_0x43b6('0x33')],_0x9cc7ad[_0x43b6('0x36')]);_0x455d5e['attributes']=_[_0x43b6('0x38')](_0x9cc7ad[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x3abb1d['query'][_0x43b6('0x39')]));_0x455d5e['attributes']=_0x455d5e['attributes'][_0x43b6('0x3b')]?_0x455d5e[_0x43b6('0x3a')]:_0x9cc7ad['model'];if(!_0x3abb1d[_0x43b6('0x36')]['hasOwnProperty'](_0x43b6('0x3d'))){_0x455d5e['limit']=qs['limit'](_0x3abb1d[_0x43b6('0x36')][_0x43b6('0x20')]);_0x455d5e[_0x43b6('0x1e')]=qs['offset'](_0x3abb1d[_0x43b6('0x36')]['offset']);}_0x455d5e['order']=qs['sort'](_0x3abb1d[_0x43b6('0x36')][_0x43b6('0x3e')]);_0x455d5e[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x3abb1d[_0x43b6('0x36')],_0x9cc7ad[_0x43b6('0x37')]));_0x455d5e[_0x43b6('0x3f')][_0x43b6('0x5d')]=_0x41a7aa['id'];if(_0x3abb1d[_0x43b6('0x36')][_0x43b6('0x41')]){_0x455d5e['where']=_[_0x43b6('0x42')](_0x455d5e['where'],{'$or':_[_0x43b6('0x34')](_0x455d5e[_0x43b6('0x3a')],function(_0x6513c0){var _0x2b0a1b={};_0x2b0a1b[_0x6513c0]={'$like':'%'+_0x3abb1d[_0x43b6('0x36')][_0x43b6('0x41')]+'%'};return _0x2b0a1b;})});}_0x455d5e=_[_0x43b6('0x42')]({},_0x455d5e,_0x3abb1d[_0x43b6('0x49')]);return db[_0x43b6('0x60')][_0x43b6('0x21')]({'where':_0x455d5e[_0x43b6('0x3f')]})[_0x43b6('0x26')](function(_0x3414a2){_0x1b642e[_0x43b6('0x21')]=_0x3414a2;if(_0x3abb1d[_0x43b6('0x36')][_0x43b6('0x43')]){_0x455d5e[_0x43b6('0x44')]=[{'all':!![]}];}return db[_0x43b6('0x60')]['findAll'](_0x455d5e);})[_0x43b6('0x26')](function(_0x1eae1a){_0x1b642e[_0x43b6('0x46')]=_0x1eae1a;return _0x1b642e;});}})[_0x43b6('0x26')](respondWithFilteredResult(_0x3bc2c9,_0x455d5e))[_0x43b6('0x4b')](handleError(_0x3bc2c9,null));};exports[_0x43b6('0x61')]=function(_0x7dfd2b,_0x492a1d,_0x1cb3d3){var _0x5973ad={'raw':!![],'where':{}};var _0x115f0f={};var _0x5d9d47={'count':0x0,'rows':[]};return db[_0x43b6('0x2f')][_0x43b6('0x5a')]({'where':{'id':_0x7dfd2b[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x492a1d,null))[_0x43b6('0x26')](function(_0x33210c){if(_0x33210c){_0x115f0f[_0x43b6('0x33')]=_['keys'](db[_0x43b6('0x62')][_0x43b6('0x30')]);_0x115f0f[_0x43b6('0x36')]=_[_0x43b6('0x35')](_0x7dfd2b[_0x43b6('0x36')]);_0x115f0f[_0x43b6('0x37')]=_[_0x43b6('0x38')](_0x115f0f[_0x43b6('0x33')],_0x115f0f['query']);_0x5973ad[_0x43b6('0x3a')]=_[_0x43b6('0x38')](_0x115f0f['model'],qs[_0x43b6('0x39')](_0x7dfd2b[_0x43b6('0x36')][_0x43b6('0x39')]));_0x5973ad[_0x43b6('0x3a')]=_0x5973ad[_0x43b6('0x3a')]['length']?_0x5973ad[_0x43b6('0x3a')]:_0x115f0f['model'];if(!_0x7dfd2b[_0x43b6('0x36')][_0x43b6('0x3c')](_0x43b6('0x3d'))){_0x5973ad[_0x43b6('0x20')]=qs[_0x43b6('0x20')](_0x7dfd2b[_0x43b6('0x36')][_0x43b6('0x20')]);_0x5973ad[_0x43b6('0x1e')]=qs[_0x43b6('0x1e')](_0x7dfd2b[_0x43b6('0x36')]['offset']);}_0x5973ad[_0x43b6('0x5c')]=qs[_0x43b6('0x3e')](_0x7dfd2b[_0x43b6('0x36')]['sort']);_0x5973ad[_0x43b6('0x3f')]=qs['filters'](_['pick'](_0x7dfd2b['query'],_0x115f0f['filters']));_0x5973ad[_0x43b6('0x3f')][_0x43b6('0x5d')]=_0x33210c['id'];if(_0x7dfd2b[_0x43b6('0x36')]['filter']){_0x5973ad[_0x43b6('0x3f')]=_[_0x43b6('0x42')](_0x5973ad['where'],{'$or':_[_0x43b6('0x34')](_0x5973ad[_0x43b6('0x3a')],function(_0x56048c){var _0x54e350={};_0x54e350[_0x56048c]={'$like':'%'+_0x7dfd2b[_0x43b6('0x36')]['filter']+'%'};return _0x54e350;})});}_0x5973ad=_['merge']({},_0x5973ad,_0x7dfd2b[_0x43b6('0x49')]);return db['CmHopperBlack'][_0x43b6('0x21')]({'where':_0x5973ad[_0x43b6('0x3f')]})[_0x43b6('0x26')](function(_0xdfd76d){_0x5d9d47[_0x43b6('0x21')]=_0xdfd76d;if(_0x7dfd2b[_0x43b6('0x36')]['includeAll']){_0x5973ad[_0x43b6('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x43b6('0x45')](_0x5973ad);})['then'](function(_0xcbc15e){_0x5d9d47[_0x43b6('0x46')]=_0xcbc15e;return _0x5d9d47;});}})[_0x43b6('0x26')](respondWithFilteredResult(_0x492a1d,_0x5973ad))['catch'](handleError(_0x492a1d,null));};exports[_0x43b6('0x63')]=function(_0x15b435,_0x5e86c3,_0x3e0822){var _0x388536={};var _0xe7fad7={};var _0x433437;var _0x69cf82;return db['Campaign']['findOne']({'where':{'id':_0x15b435['params']['id']}})['then'](handleEntityNotFound(_0x5e86c3,null))[_0x43b6('0x26')](function(_0x53d1ce){if(_0x53d1ce){_0x433437=_0x53d1ce;_0xe7fad7[_0x43b6('0x33')]=_[_0x43b6('0x35')](db[_0x43b6('0x64')]['rawAttributes']);_0xe7fad7[_0x43b6('0x36')]=_['keys'](_0x15b435['query']);_0xe7fad7['filters']=_['intersection'](_0xe7fad7[_0x43b6('0x33')],_0xe7fad7[_0x43b6('0x36')]);_0x388536[_0x43b6('0x3a')]=_[_0x43b6('0x38')](_0xe7fad7['model'],qs['fields'](_0x15b435['query']['fields']));_0x388536[_0x43b6('0x3a')]=_0x388536['attributes']['length']?_0x388536[_0x43b6('0x3a')]:_0xe7fad7[_0x43b6('0x33')];_0x388536[_0x43b6('0x5c')]=qs['sort'](_0x15b435[_0x43b6('0x36')][_0x43b6('0x3e')]);_0x388536[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x15b435[_0x43b6('0x36')],_0xe7fad7[_0x43b6('0x37')]));if(_0x15b435[_0x43b6('0x36')]['filter']){_0x388536[_0x43b6('0x3f')]=_[_0x43b6('0x42')](_0x388536[_0x43b6('0x3f')],{'$or':_[_0x43b6('0x34')](_0x388536['attributes'],function(_0x59ba3e){var _0x58aa9b={};_0x58aa9b[_0x59ba3e]={'$like':'%'+_0x15b435['query'][_0x43b6('0x41')]+'%'};return _0x58aa9b;})});}_0x388536=_['merge']({},_0x388536,_0x15b435[_0x43b6('0x49')]);return _0x433437[_0x43b6('0x63')](_0x388536);}})['then'](function(_0x31eeac){if(_0x31eeac){_0x69cf82=_0x31eeac[_0x43b6('0x3b')];if(!_0x15b435[_0x43b6('0x36')][_0x43b6('0x3c')](_0x43b6('0x3d'))){_0x388536['limit']=qs[_0x43b6('0x20')](_0x15b435[_0x43b6('0x36')][_0x43b6('0x20')]);_0x388536[_0x43b6('0x1e')]=qs[_0x43b6('0x1e')](_0x15b435[_0x43b6('0x36')][_0x43b6('0x1e')]);}return _0x433437['getLists'](_0x388536);}})[_0x43b6('0x26')](function(_0x2b1f08){if(_0x2b1f08){return _0x2b1f08?{'count':_0x69cf82,'rows':_0x2b1f08}:null;}})['then'](respondWithResult(_0x5e86c3,null))['catch'](handleError(_0x5e86c3,null));};exports[_0x43b6('0x65')]=function(_0x518dc6,_0x538576,_0x4304b3){var _0x53de39,_0x1d700f;return db[_0x43b6('0x2f')][_0x43b6('0x4a')]({'where':{'id':_0x518dc6['params']['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x538576,null))[_0x43b6('0x26')](function(_0x4ff823){if(_0x4ff823){_0x1d700f=_0x4ff823;return _0x4ff823['addLists'](_0x518dc6[_0x43b6('0x4d')][_0x43b6('0x66')],_['omit'](_0x518dc6[_0x43b6('0x4d')],[_0x43b6('0x66'),'id'])||{});}return null;})[_0x43b6('0x67')](function(_0x2fea41){var _0x42b727;_0x53de39=_0x2fea41||[];var _0xcb3910=[];if(_0x2fea41){for(var _0xb2e0e0=0x0;_0xb2e0e0<_0x2fea41[_0x43b6('0x3b')];_0xb2e0e0+=0x1){var _0x44739d=_0x2fea41[_0xb2e0e0]['get']({'plain':!![]});_0x1d700f['dialCheckDuplicateType']=_0x518dc6[_0x43b6('0x4d')][_0x43b6('0x68')]?_0x518dc6['body'][_0x43b6('0x68')]:_0x1d700f[_0x43b6('0x68')];switch(_0x1d700f[_0x43b6('0x68')]){case _0x43b6('0x69'):_0x42b727=squel[_0x43b6('0x6a')]()['into']('cm_hopper')[_0x43b6('0x6b')](['phone',_0x43b6('0x6c'),_0x43b6('0x6d'),'ListId','CampaignId','createdAt',_0x43b6('0x58')],squel['select']()[_0x43b6('0x6e')](_0x43b6('0x6f'),_0x43b6('0x6f'))[_0x43b6('0x6e')](_0x43b6('0x70'),_0x43b6('0x6c'))['field']('id','ContactId')[_0x43b6('0x6e')](_0x44739d[_0x43b6('0x71')][_0x43b6('0x72')](),_0x43b6('0x73'))[_0x43b6('0x6e')](_0x518dc6['params']['id']['toString'](),_0x43b6('0x5d'))['field']('NOW()',_0x43b6('0x57'))['field'](_0x43b6('0x70'),_0x43b6('0x58'))[_0x43b6('0x74')](_0x43b6('0x75'))['where'](_0x43b6('0x76'))[_0x43b6('0x3f')](_0x43b6('0x77'),_0x44739d[_0x43b6('0x71')][_0x43b6('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x43b6('0x3f')](_0x43b6('0x78'),squel[_0x43b6('0x79')]()[_0x43b6('0x6e')]('COALESCE(calleridnum,\x27\x27)')[_0x43b6('0x74')](_0x43b6('0x7a'))[_0x43b6('0x3f')]('CampaignId\x20=\x20?',_0x518dc6[_0x43b6('0x48')]['id']['toString']()))[_0x43b6('0x3f')](_0x43b6('0x78'),squel[_0x43b6('0x79')]()['field'](_0x43b6('0x7b'))['from'](_0x43b6('0x7c'))[_0x43b6('0x3f')](_0x43b6('0x7d'),_0x518dc6[_0x43b6('0x48')]['id'][_0x43b6('0x72')]())))['toString']();break;case _0x43b6('0x7e'):_0x42b727=squel['insert']()[_0x43b6('0x7f')](_0x43b6('0x7c'))[_0x43b6('0x6b')]([_0x43b6('0x6f'),'scheduledAt',_0x43b6('0x6d'),'ListId',_0x43b6('0x5d'),_0x43b6('0x57'),_0x43b6('0x58')],squel[_0x43b6('0x79')]()[_0x43b6('0x6e')](_0x43b6('0x6f'),'phone')[_0x43b6('0x6e')]('NOW()',_0x43b6('0x6c'))[_0x43b6('0x6e')]('id',_0x43b6('0x6d'))[_0x43b6('0x6e')](_0x44739d[_0x43b6('0x71')][_0x43b6('0x72')](),'ListId')[_0x43b6('0x6e')](_0x518dc6['params']['id'][_0x43b6('0x72')](),_0x43b6('0x5d'))['field'](_0x43b6('0x70'),_0x43b6('0x57'))[_0x43b6('0x6e')](_0x43b6('0x70'),_0x43b6('0x58'))['from'](_0x43b6('0x75'))['where'](_0x43b6('0x76'))['where'](_0x43b6('0x77'),_0x44739d[_0x43b6('0x71')]['toString']())[_0x43b6('0x3f')](_0x43b6('0x80'))[_0x43b6('0x3f')](_0x43b6('0x78'),squel[_0x43b6('0x79')]()[_0x43b6('0x6e')](_0x43b6('0x7b'))[_0x43b6('0x74')]('cm_hopper')[_0x43b6('0x3f')](_0x43b6('0x7d'),_0x518dc6[_0x43b6('0x48')]['id']['toString']())))['toString']();break;default:_0x42b727=squel['insert']()[_0x43b6('0x7f')](_0x43b6('0x7c'))[_0x43b6('0x6b')]([_0x43b6('0x6f'),_0x43b6('0x6c'),_0x43b6('0x6d'),_0x43b6('0x73'),_0x43b6('0x5d'),_0x43b6('0x57'),'updatedAt'],squel[_0x43b6('0x79')]()[_0x43b6('0x6e')](_0x43b6('0x6f'),'phone')[_0x43b6('0x6e')]('NOW()',_0x43b6('0x6c'))[_0x43b6('0x6e')]('id',_0x43b6('0x6d'))[_0x43b6('0x6e')](_0x44739d[_0x43b6('0x71')][_0x43b6('0x72')](),_0x43b6('0x73'))[_0x43b6('0x6e')](_0x518dc6[_0x43b6('0x48')]['id'][_0x43b6('0x72')](),_0x43b6('0x5d'))[_0x43b6('0x6e')]('NOW()',_0x43b6('0x57'))[_0x43b6('0x6e')](_0x43b6('0x70'),_0x43b6('0x58'))[_0x43b6('0x74')](_0x43b6('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x43b6('0x3f')](_0x43b6('0x77'),_0x44739d[_0x43b6('0x71')][_0x43b6('0x72')]())['where'](_0x43b6('0x80')))[_0x43b6('0x72')]();}_0xcb3910[_0x43b6('0x81')](db[_0x43b6('0x82')][_0x43b6('0x36')](_0x42b727));}return BPromise[_0x43b6('0x83')](_0xcb3910);}})['then'](function(){return _0x53de39;})['then'](respondWithResult(_0x538576,null))[_0x43b6('0x4b')](handleError(_0x538576,null));};exports[_0x43b6('0x84')]=function(_0x1d10cd,_0x42726e,_0x16ae4e){return db[_0x43b6('0x2f')][_0x43b6('0x4a')]({'where':{'id':_0x1d10cd[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x42726e,null))['then'](function(_0x3a7716){if(_0x3a7716){return _0x3a7716[_0x43b6('0x84')](_0x1d10cd[_0x43b6('0x36')][_0x43b6('0x66')]);}})[_0x43b6('0x26')](function(_0xb58e76){if(_0xb58e76){return db[_0x43b6('0x5b')][_0x43b6('0x27')]({'where':{'ListId':_0x1d10cd[_0x43b6('0x36')][_0x43b6('0x66')],'CampaignId':_0x1d10cd[_0x43b6('0x48')]['id']}})['then'](function(){return _0xb58e76;});}})[_0x43b6('0x26')](respondWithStatusCode(_0x42726e,null))[_0x43b6('0x4b')](handleError(_0x42726e,null));};exports[_0x43b6('0x85')]=function(_0x47eba8,_0x450748,_0x37690b){var _0x4c0762={};var _0x2dccbf={};var _0x5f3eba;var _0x1e4814;return db[_0x43b6('0x2f')][_0x43b6('0x5a')]({'where':{'id':_0x47eba8[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](handleEntityNotFound(_0x450748,null))[_0x43b6('0x26')](function(_0x1043a9){if(_0x1043a9){_0x5f3eba=_0x1043a9;_0x2dccbf[_0x43b6('0x33')]=_['keys'](db[_0x43b6('0x64')][_0x43b6('0x30')]);_0x2dccbf[_0x43b6('0x36')]=_[_0x43b6('0x35')](_0x47eba8[_0x43b6('0x36')]);_0x2dccbf[_0x43b6('0x37')]=_[_0x43b6('0x38')](_0x2dccbf[_0x43b6('0x33')],_0x2dccbf[_0x43b6('0x36')]);_0x4c0762[_0x43b6('0x3a')]=_[_0x43b6('0x38')](_0x2dccbf[_0x43b6('0x33')],qs[_0x43b6('0x39')](_0x47eba8[_0x43b6('0x36')]['fields']));_0x4c0762[_0x43b6('0x3a')]=_0x4c0762[_0x43b6('0x3a')][_0x43b6('0x3b')]?_0x4c0762[_0x43b6('0x3a')]:_0x2dccbf[_0x43b6('0x33')];_0x4c0762[_0x43b6('0x5c')]=qs[_0x43b6('0x3e')](_0x47eba8['query']['sort']);_0x4c0762[_0x43b6('0x3f')]=qs[_0x43b6('0x37')](_[_0x43b6('0x40')](_0x47eba8['query'],_0x2dccbf[_0x43b6('0x37')]));if(_0x47eba8[_0x43b6('0x36')][_0x43b6('0x41')]){_0x4c0762[_0x43b6('0x3f')]=_[_0x43b6('0x42')](_0x4c0762['where'],{'$or':_[_0x43b6('0x34')](_0x4c0762[_0x43b6('0x3a')],function(_0xebbfbd){var _0x447098={};_0x447098[_0xebbfbd]={'$like':'%'+_0x47eba8[_0x43b6('0x36')][_0x43b6('0x41')]+'%'};return _0x447098;})});}_0x4c0762=_[_0x43b6('0x42')]({},_0x4c0762,_0x47eba8['options']);return _0x5f3eba[_0x43b6('0x85')](_0x4c0762);}})[_0x43b6('0x26')](function(_0x3e6786){if(_0x3e6786){_0x1e4814=_0x3e6786[_0x43b6('0x3b')];if(!_0x47eba8['query'][_0x43b6('0x3c')]('nolimit')){_0x4c0762[_0x43b6('0x20')]=qs['limit'](_0x47eba8[_0x43b6('0x36')][_0x43b6('0x20')]);_0x4c0762[_0x43b6('0x1e')]=qs['offset'](_0x47eba8['query'][_0x43b6('0x1e')]);}return _0x5f3eba[_0x43b6('0x85')](_0x4c0762);}})[_0x43b6('0x26')](function(_0xf1453){if(_0xf1453){return _0xf1453?{'count':_0x1e4814,'rows':_0xf1453}:null;}})[_0x43b6('0x26')](respondWithResult(_0x450748,null))[_0x43b6('0x4b')](handleError(_0x450748,null));};exports[_0x43b6('0x86')]=function(_0x5d7e9a,_0xc6d5d7,_0x113665){var _0x261bba,_0x1a344e;return db[_0x43b6('0x2f')][_0x43b6('0x4a')]({'where':{'id':_0x5d7e9a[_0x43b6('0x48')]['id']}})['then'](handleEntityNotFound(_0xc6d5d7,null))[_0x43b6('0x26')](function(_0x17c980){if(_0x17c980){_0x1a344e=_0x17c980;return _0x17c980[_0x43b6('0x86')](_0x5d7e9a['body'][_0x43b6('0x66')],_['omit'](_0x5d7e9a[_0x43b6('0x4d')],['ids','id'])||{});}return null;})['spread'](function(_0x10bc7c){var _0x2f6f5c;_0x261bba=_0x10bc7c||[];var _0x2c25c1=[];if(_0x10bc7c){for(var _0x457492=0x0;_0x457492<_0x10bc7c['length'];_0x457492+=0x1){var _0x144f47=_0x10bc7c[_0x457492][_0x43b6('0x28')]({'plain':!![]});_0x2f6f5c=squel[_0x43b6('0x6a')]()[_0x43b6('0x7f')](_0x43b6('0x87'))['fromQuery']([_0x43b6('0x6f'),_0x43b6('0x6d'),_0x43b6('0x73'),'CampaignId',_0x43b6('0x57'),'updatedAt'],squel['select']()[_0x43b6('0x6e')](_0x43b6('0x6f'),_0x43b6('0x6f'))['field']('id',_0x43b6('0x6d'))[_0x43b6('0x6e')](_0x144f47[_0x43b6('0x71')][_0x43b6('0x72')](),_0x43b6('0x73'))['field'](_0x5d7e9a['params']['id']['toString'](),_0x43b6('0x5d'))[_0x43b6('0x6e')](_0x43b6('0x70'),_0x43b6('0x57'))['field'](_0x43b6('0x70'),_0x43b6('0x58'))['from'](_0x43b6('0x75'))['where'](_0x43b6('0x76'))['where']('ListId\x20=\x20?',_0x144f47[_0x43b6('0x71')]['toString']())['where'](_0x43b6('0x80')))[_0x43b6('0x72')]();_0x2c25c1[_0x43b6('0x81')](db[_0x43b6('0x82')][_0x43b6('0x36')](_0x2f6f5c));}return BPromise['all'](_0x2c25c1);}})[_0x43b6('0x26')](function(){return _0x261bba;})[_0x43b6('0x26')](respondWithResult(_0xc6d5d7,null))[_0x43b6('0x4b')](handleError(_0xc6d5d7,null));};exports[_0x43b6('0x88')]=function(_0x1e4ead,_0x3abe33,_0x1d72df){return db[_0x43b6('0x2f')][_0x43b6('0x4a')]({'where':{'id':_0x1e4ead['params']['id']}})['then'](handleEntityNotFound(_0x3abe33,null))['then'](function(_0x1a9e36){if(_0x1a9e36){return _0x1a9e36[_0x43b6('0x88')](_0x1e4ead[_0x43b6('0x36')][_0x43b6('0x66')]);}})['then'](function(_0x10cf76){if(_0x10cf76){return db[_0x43b6('0x62')]['destroy']({'where':{'ListId':_0x1e4ead[_0x43b6('0x36')]['ids'],'CampaignId':_0x1e4ead[_0x43b6('0x48')]['id']}})[_0x43b6('0x26')](function(){return _0x10cf76;});}})['then'](respondWithStatusCode(_0x3abe33,null))[_0x43b6('0x4b')](handleError(_0x3abe33,null));}; \ No newline at end of file +var _0xf9dd=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','fields','options','find','create','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','autoAssociation','error','getHoppers','findOne','CmHopper','hasOwnProperty','findAll','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select','CmListId','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x338b2f,_0xecf627){var _0x1b600a=function(_0x558366){while(--_0x558366){_0x338b2f['push'](_0x338b2f['shift']());}};_0x1b600a(++_0xecf627);}(_0xf9dd,0xf2));var _0xdf9d=function(_0x4dc194,_0x212537){_0x4dc194=_0x4dc194-0x0;var _0x511b88=_0xf9dd[_0x4dc194];return _0x511b88;};'use strict';var emlformat=require(_0xdf9d('0x0'));var rimraf=require(_0xdf9d('0x1'));var zipdir=require(_0xdf9d('0x2'));var jsonpatch=require(_0xdf9d('0x3'));var rp=require(_0xdf9d('0x4'));var moment=require(_0xdf9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf9d('0x6'));var util=require(_0xdf9d('0x7'));var path=require(_0xdf9d('0x8'));var sox=require(_0xdf9d('0x9'));var csv=require(_0xdf9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf9d('0xb'));var _=require(_0xdf9d('0xc'));var squel=require(_0xdf9d('0xd'));var crypto=require(_0xdf9d('0xe'));var jsforce=require(_0xdf9d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdf9d('0xa'));var querystring=require(_0xdf9d('0x10'));var Papa=require('papaparse');var Redis=require(_0xdf9d('0x11'));var authService=require(_0xdf9d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdf9d('0x13'));var hardwareService=require(_0xdf9d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xdf9d('0x15'));var config=require(_0xdf9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf9d('0x17'))['db'];function respondWithStatusCode(_0x2e00a6,_0x3ea49e){_0x3ea49e=_0x3ea49e||0xcc;return function(_0x2f14dc){if(_0x2f14dc){return _0x2e00a6[_0xdf9d('0x18')](_0x3ea49e);}return _0x2e00a6[_0xdf9d('0x19')](_0x3ea49e)[_0xdf9d('0x1a')]();};}function respondWithResult(_0x2e3807,_0x36924f){_0x36924f=_0x36924f||0xc8;return function(_0x4816cd){if(_0x4816cd){return _0x2e3807[_0xdf9d('0x19')](_0x36924f)[_0xdf9d('0x1b')](_0x4816cd);}};}function respondWithFilteredResult(_0x4c2f68,_0x5cbddc){return function(_0x5871c4){if(_0x5871c4){var _0x126e6e=typeof _0x5cbddc[_0xdf9d('0x1c')]===_0xdf9d('0x1d')&&typeof _0x5cbddc[_0xdf9d('0x1e')]===_0xdf9d('0x1d');var _0x18a794=_0x5871c4[_0xdf9d('0x1f')];var _0x39df8e=_0x126e6e?0x0:_0x5cbddc['offset'];var _0x52778a=_0x126e6e?_0x5871c4[_0xdf9d('0x1f')]:_0x5cbddc[_0xdf9d('0x1c')]+_0x5cbddc[_0xdf9d('0x1e')];var _0x1fbc96;if(_0x52778a>=_0x18a794){_0x52778a=_0x18a794;_0x1fbc96=0xc8;}else{_0x1fbc96=0xce;}_0x4c2f68['status'](_0x1fbc96);return _0x4c2f68['set'](_0xdf9d('0x20'),_0x39df8e+'-'+_0x52778a+'/'+_0x18a794)[_0xdf9d('0x1b')](_0x5871c4);}return null;};}function patchUpdates(_0x34ef72){return function(_0x40c1b5){try{jsonpatch[_0xdf9d('0x21')](_0x40c1b5,_0x34ef72,!![]);}catch(_0x288912){return BPromise['reject'](_0x288912);}return _0x40c1b5[_0xdf9d('0x22')]();};}function saveUpdates(_0x43256a,_0xcabcf5){return function(_0x39415d){if(_0x39415d){return _0x39415d[_0xdf9d('0x23')](_0x43256a)[_0xdf9d('0x24')](function(_0x25b5f5){return _0x25b5f5;});}return null;};}function removeEntity(_0x1b1fc0,_0x57eff3){return function(_0x57eaf2){if(_0x57eaf2){return _0x57eaf2[_0xdf9d('0x25')]()[_0xdf9d('0x24')](function(){var _0x544cad=_0x57eaf2[_0xdf9d('0x26')]({'plain':!![]});var _0x107077='IvrCampaigns';return db[_0xdf9d('0x27')][_0xdf9d('0x25')]({'where':{'type':_0x107077,'resourceId':_0x544cad['id']}})['then'](function(){return _0x57eaf2;});})[_0xdf9d('0x24')](function(){_0x1b1fc0[_0xdf9d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415703,_0x4e6cf4){return function(_0x153c18){if(!_0x153c18){_0x415703[_0xdf9d('0x18')](0x194);}return _0x153c18;};}function handleError(_0x3adee3,_0x989282){_0x989282=_0x989282||0x1f4;return function(_0x3b9358){logger['error'](_0x3b9358[_0xdf9d('0x28')]);if(_0x3b9358[_0xdf9d('0x29')]){delete _0x3b9358[_0xdf9d('0x29')];}_0x3adee3[_0xdf9d('0x19')](_0x989282)[_0xdf9d('0x2a')](_0x3b9358);};}exports[_0xdf9d('0x2b')]=function(_0x42d714,_0x52e280){var _0x28c592={},_0xf2294f={},_0x8c5c5f={'count':0x0,'rows':[]};var _0x584f0c=_['map'](db[_0xdf9d('0x2c')][_0xdf9d('0x2d')],function(_0x3a5620){return{'name':_0x3a5620['fieldName'],'type':_0x3a5620[_0xdf9d('0x2e')][_0xdf9d('0x2f')]};});_0xf2294f[_0xdf9d('0x30')]=_[_0xdf9d('0x31')](_0x584f0c,_0xdf9d('0x29'));_0xf2294f[_0xdf9d('0x32')]=_[_0xdf9d('0x33')](_0x42d714[_0xdf9d('0x32')]);_0xf2294f[_0xdf9d('0x34')]=_[_0xdf9d('0x35')](_0xf2294f[_0xdf9d('0x30')],_0xf2294f[_0xdf9d('0x32')]);_0x28c592['attributes']=_[_0xdf9d('0x35')](_0xf2294f[_0xdf9d('0x30')],qs['fields'](_0x42d714[_0xdf9d('0x32')]['fields']));_0x28c592[_0xdf9d('0x36')]=_0x28c592[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x28c592[_0xdf9d('0x36')]:_0xf2294f[_0xdf9d('0x30')];if(!_0x42d714[_0xdf9d('0x32')]['hasOwnProperty'](_0xdf9d('0x38'))){_0x28c592[_0xdf9d('0x1e')]=qs[_0xdf9d('0x1e')](_0x42d714[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0x28c592[_0xdf9d('0x1c')]=qs[_0xdf9d('0x1c')](_0x42d714['query']['offset']);}_0x28c592[_0xdf9d('0x39')]=qs['sort'](_0x42d714[_0xdf9d('0x32')][_0xdf9d('0x3a')]);_0x28c592[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x42d714[_0xdf9d('0x32')],_0xf2294f[_0xdf9d('0x34')]),_0x584f0c);if(_0x42d714['query'][_0xdf9d('0x3d')]){_0x28c592[_0xdf9d('0x3b')]=_['merge'](_0x28c592[_0xdf9d('0x3b')],{'$or':_[_0xdf9d('0x31')](_0x584f0c,function(_0x260155){if(_0x260155[_0xdf9d('0x2e')]!==_0xdf9d('0x3e')){var _0x2b6058={};_0x2b6058[_0x260155[_0xdf9d('0x29')]]={'$like':'%'+_0x42d714['query'][_0xdf9d('0x3d')]+'%'};return _0x2b6058;}})});}_0x28c592=_[_0xdf9d('0x3f')]({},_0x28c592,_0x42d714['options']);var _0x13569b={'where':_0x28c592['where']};return db[_0xdf9d('0x2c')][_0xdf9d('0x1f')](_0x13569b)[_0xdf9d('0x24')](function(_0xc76a98){_0x8c5c5f[_0xdf9d('0x1f')]=_0xc76a98;if(_0x42d714['query'][_0xdf9d('0x40')]){_0x28c592[_0xdf9d('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x28c592);})['then'](function(_0xa2efad){_0x8c5c5f[_0xdf9d('0x42')]=_0xa2efad;return _0x8c5c5f;})[_0xdf9d('0x24')](respondWithFilteredResult(_0x52e280,_0x28c592))['catch'](handleError(_0x52e280,null));};exports['show']=function(_0x2888aa,_0xc61237){var _0x59c2c6={'raw':![],'where':{'id':_0x2888aa['params']['id']}},_0x45823e={};_0x45823e[_0xdf9d('0x30')]=_[_0xdf9d('0x33')](db[_0xdf9d('0x2c')][_0xdf9d('0x2d')]);_0x45823e[_0xdf9d('0x32')]=_['keys'](_0x2888aa[_0xdf9d('0x32')]);_0x45823e[_0xdf9d('0x34')]=_['intersection'](_0x45823e[_0xdf9d('0x30')],_0x45823e[_0xdf9d('0x32')]);_0x59c2c6['attributes']=_[_0xdf9d('0x35')](_0x45823e['model'],qs['fields'](_0x2888aa['query'][_0xdf9d('0x43')]));_0x59c2c6['attributes']=_0x59c2c6[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x59c2c6[_0xdf9d('0x36')]:_0x45823e[_0xdf9d('0x30')];if(_0x2888aa['query'][_0xdf9d('0x40')]){_0x59c2c6['include']=[{'all':!![]}];}_0x59c2c6=_[_0xdf9d('0x3f')]({},_0x59c2c6,_0x2888aa[_0xdf9d('0x44')]);return db[_0xdf9d('0x2c')][_0xdf9d('0x45')](_0x59c2c6)['then'](handleEntityNotFound(_0xc61237,null))[_0xdf9d('0x24')](respondWithResult(_0xc61237,null))['catch'](handleError(_0xc61237,null));};exports[_0xdf9d('0x46')]=function(_0x2356b4,_0x3fe027){return db[_0xdf9d('0x2c')][_0xdf9d('0x46')](_0x2356b4['body'],{})[_0xdf9d('0x24')](function(_0x5e6e32){var _0xb297ff=_0x2356b4[_0xdf9d('0x47')][_0xdf9d('0x26')]({'plain':!![]});if(!_0xb297ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb297ff['role']===_0xdf9d('0x47')){var _0x58c810=_0x5e6e32[_0xdf9d('0x26')]({'plain':!![]});var _0x428584='IvrCampaigns';return db[_0xdf9d('0x48')]['find']({'where':{'name':_0x428584,'userProfileId':_0xb297ff[_0xdf9d('0x49')]},'raw':!![]})['then'](function(_0x5d4849){if(_0x5d4849&&_0x5d4849['autoAssociation']===0x0){return db[_0xdf9d('0x27')][_0xdf9d('0x46')]({'name':_0x58c810[_0xdf9d('0x29')],'resourceId':_0x58c810['id'],'type':_0x5d4849[_0xdf9d('0x29')],'sectionId':_0x5d4849['id']},{})[_0xdf9d('0x24')](function(){return _0x5e6e32;});}else{return _0x5e6e32;}})[_0xdf9d('0x4a')](function(_0x5a1fe0){logger['error'](_0xdf9d('0x4b'),_0x5a1fe0);throw _0x5a1fe0;});}return _0x5e6e32;})[_0xdf9d('0x24')](respondWithResult(_0x3fe027,0xc9))[_0xdf9d('0x4a')](handleError(_0x3fe027,null));};exports[_0xdf9d('0x4c')]=function(_0x509013,_0x23b5a7){var _0x4d3f7c={'where':{'id':_0x509013[_0xdf9d('0x4d')]['id']}},_0x3d9b0d={};_0x3d9b0d[_0xdf9d('0x30')]=_[_0xdf9d('0x33')](db['Campaign'][_0xdf9d('0x2d')]);_0x4d3f7c['attributes']=_[_0xdf9d('0x35')](_0x3d9b0d['model'],qs[_0xdf9d('0x43')](_0x509013[_0xdf9d('0x32')][_0xdf9d('0x43')]));_0x4d3f7c[_0xdf9d('0x36')]=_0x4d3f7c['attributes'][_0xdf9d('0x37')]?_0x4d3f7c[_0xdf9d('0x36')]:_0x3d9b0d[_0xdf9d('0x30')];if(_0x509013[_0xdf9d('0x32')][_0xdf9d('0x40')]){_0x4d3f7c[_0xdf9d('0x41')]=[{'all':!![]}];}_0x4d3f7c=_[_0xdf9d('0x3f')]({},_0x4d3f7c,_0x509013['options']);return db['Campaign'][_0xdf9d('0x45')](_0x4d3f7c)['then'](handleEntityNotFound(_0x23b5a7,null))[_0xdf9d('0x24')](function(_0x2e94e4){if(_0x2e94e4){var _0x18fba3=_0x2e94e4['get']({'plain':!![]});_0x18fba3=qs[_0xdf9d('0x4e')](_0x18fba3,['id',_0xdf9d('0x4f'),_0xdf9d('0x50')]);_0x509013[_0xdf9d('0x51')]=_[_0xdf9d('0x4e')](_0x509013[_0xdf9d('0x51')],['id','createdAt','updatedAt']);return db[_0xdf9d('0x2c')]['create'](_[_0xdf9d('0x3f')](_0x18fba3,_0x509013[_0xdf9d('0x51')]),{'include':_0x509013[_0xdf9d('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x463e3e){var _0x4677af=_0x509013[_0xdf9d('0x47')][_0xdf9d('0x26')]({'plain':!![]});if(!_0x4677af)throw new Error(_0xdf9d('0x52'));if(_0x4677af['role']===_0xdf9d('0x47')){var _0x5b30fe=_0x463e3e[_0xdf9d('0x26')]({'plain':!![]});var _0x16af54=_0xdf9d('0x53');return db[_0xdf9d('0x48')][_0xdf9d('0x45')]({'where':{'name':_0x16af54,'userProfileId':_0x4677af[_0xdf9d('0x49')]},'raw':!![]})['then'](function(_0x2ac80a){if(_0x2ac80a&&_0x2ac80a[_0xdf9d('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b30fe['name'],'resourceId':_0x5b30fe['id'],'type':_0x2ac80a['name'],'sectionId':_0x2ac80a['id']},{})[_0xdf9d('0x24')](function(){return _0x463e3e;});}else{return _0x463e3e;}})['catch'](function(_0x48333f){logger[_0xdf9d('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48333f);throw _0x48333f;});}return _0x463e3e;});}})[_0xdf9d('0x24')](respondWithResult(_0x23b5a7,0xc9))[_0xdf9d('0x4a')](handleError(_0x23b5a7,null));};exports['update']=function(_0x4efa1b,_0x4557e4){if(_0x4efa1b[_0xdf9d('0x51')]['id']){delete _0x4efa1b['body']['id'];}return db[_0xdf9d('0x2c')][_0xdf9d('0x45')]({'where':{'id':_0x4efa1b[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x4557e4,null))[_0xdf9d('0x24')](saveUpdates(_0x4efa1b['body'],null))[_0xdf9d('0x24')](respondWithResult(_0x4557e4,null))['catch'](handleError(_0x4557e4,null));};exports[_0xdf9d('0x25')]=function(_0x239d95,_0x4607c3){return db[_0xdf9d('0x2c')][_0xdf9d('0x45')]({'where':{'id':_0x239d95[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x4607c3,null))[_0xdf9d('0x24')](removeEntity(_0x4607c3,null))['catch'](handleError(_0x4607c3,null));};exports[_0xdf9d('0x56')]=function(_0x2c30c7,_0x5bd561,_0x375889){var _0x3aae65={'raw':!![],'where':{}};var _0xaf1832={};var _0x31d977={'count':0x0,'rows':[]};return db[_0xdf9d('0x2c')][_0xdf9d('0x57')]({'where':{'id':_0x2c30c7[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x5bd561,null))['then'](function(_0x5e81b9){if(_0x5e81b9){_0xaf1832[_0xdf9d('0x30')]=_['keys'](db[_0xdf9d('0x58')][_0xdf9d('0x2d')]);_0xaf1832['query']=_[_0xdf9d('0x33')](_0x2c30c7['query']);_0xaf1832[_0xdf9d('0x34')]=_[_0xdf9d('0x35')](_0xaf1832[_0xdf9d('0x30')],_0xaf1832[_0xdf9d('0x32')]);_0x3aae65[_0xdf9d('0x36')]=_['intersection'](_0xaf1832[_0xdf9d('0x30')],qs['fields'](_0x2c30c7[_0xdf9d('0x32')]['fields']));_0x3aae65[_0xdf9d('0x36')]=_0x3aae65[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x3aae65['attributes']:_0xaf1832[_0xdf9d('0x30')];if(!_0x2c30c7[_0xdf9d('0x32')][_0xdf9d('0x59')](_0xdf9d('0x38'))){_0x3aae65[_0xdf9d('0x1e')]=qs[_0xdf9d('0x1e')](_0x2c30c7[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0x3aae65[_0xdf9d('0x1c')]=qs[_0xdf9d('0x1c')](_0x2c30c7[_0xdf9d('0x32')]['offset']);}_0x3aae65[_0xdf9d('0x39')]=qs[_0xdf9d('0x3a')](_0x2c30c7[_0xdf9d('0x32')][_0xdf9d('0x3a')]);_0x3aae65[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x2c30c7[_0xdf9d('0x32')],_0xaf1832[_0xdf9d('0x34')]));_0x3aae65[_0xdf9d('0x3b')]['CampaignId']=_0x5e81b9['id'];if(_0x2c30c7[_0xdf9d('0x32')][_0xdf9d('0x3d')]){_0x3aae65[_0xdf9d('0x3b')]=_['merge'](_0x3aae65[_0xdf9d('0x3b')],{'$or':_[_0xdf9d('0x31')](_0x3aae65[_0xdf9d('0x36')],function(_0x47ab6c){var _0x2aa862={};_0x2aa862[_0x47ab6c]={'$like':'%'+_0x2c30c7['query']['filter']+'%'};return _0x2aa862;})});}_0x3aae65=_[_0xdf9d('0x3f')]({},_0x3aae65,_0x2c30c7[_0xdf9d('0x44')]);return db[_0xdf9d('0x58')]['count']({'where':_0x3aae65[_0xdf9d('0x3b')]})[_0xdf9d('0x24')](function(_0x2bfc10){_0x31d977['count']=_0x2bfc10;if(_0x2c30c7['query']['includeAll']){_0x3aae65['include']=[{'all':!![]}];}return db[_0xdf9d('0x58')][_0xdf9d('0x5a')](_0x3aae65);})[_0xdf9d('0x24')](function(_0x382905){_0x31d977[_0xdf9d('0x42')]=_0x382905;return _0x31d977;});}})[_0xdf9d('0x24')](respondWithFilteredResult(_0x5bd561,_0x3aae65))[_0xdf9d('0x4a')](handleError(_0x5bd561,null));};exports['getHopperHistories']=function(_0x471015,_0x5db3f6,_0x56aca0){var _0x286b59={'raw':!![],'where':{}};var _0x399650={};var _0xf72a27={'count':0x0,'rows':[]};return db[_0xdf9d('0x2c')][_0xdf9d('0x57')]({'where':{'id':_0x471015[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x5db3f6,null))[_0xdf9d('0x24')](function(_0x399a60){if(_0x399a60){_0x399650['model']=_[_0xdf9d('0x33')](db[_0xdf9d('0x5b')][_0xdf9d('0x2d')]);_0x399650[_0xdf9d('0x32')]=_[_0xdf9d('0x33')](_0x471015['query']);_0x399650['filters']=_[_0xdf9d('0x35')](_0x399650[_0xdf9d('0x30')],_0x399650[_0xdf9d('0x32')]);_0x286b59[_0xdf9d('0x36')]=_[_0xdf9d('0x35')](_0x399650['model'],qs[_0xdf9d('0x43')](_0x471015[_0xdf9d('0x32')]['fields']));_0x286b59['attributes']=_0x286b59[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x286b59[_0xdf9d('0x36')]:_0x399650['model'];if(!_0x471015[_0xdf9d('0x32')][_0xdf9d('0x59')](_0xdf9d('0x38'))){_0x286b59[_0xdf9d('0x1e')]=qs['limit'](_0x471015[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0x286b59['offset']=qs[_0xdf9d('0x1c')](_0x471015[_0xdf9d('0x32')][_0xdf9d('0x1c')]);}_0x286b59[_0xdf9d('0x39')]=qs['sort'](_0x471015['query'][_0xdf9d('0x3a')]);_0x286b59[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x471015[_0xdf9d('0x32')],_0x399650[_0xdf9d('0x34')]));_0x286b59['where'][_0xdf9d('0x5c')]=_0x399a60['id'];if(_0x471015[_0xdf9d('0x32')]['filter']){_0x286b59[_0xdf9d('0x3b')]=_[_0xdf9d('0x3f')](_0x286b59['where'],{'$or':_[_0xdf9d('0x31')](_0x286b59['attributes'],function(_0xbef1c0){var _0x1c4110={};_0x1c4110[_0xbef1c0]={'$like':'%'+_0x471015[_0xdf9d('0x32')][_0xdf9d('0x3d')]+'%'};return _0x1c4110;})});}_0x286b59=_[_0xdf9d('0x3f')]({},_0x286b59,_0x471015[_0xdf9d('0x44')]);return db[_0xdf9d('0x5b')]['count']({'where':_0x286b59[_0xdf9d('0x3b')]})[_0xdf9d('0x24')](function(_0x31de17){_0xf72a27[_0xdf9d('0x1f')]=_0x31de17;if(_0x471015[_0xdf9d('0x32')]['includeAll']){_0x286b59[_0xdf9d('0x41')]=[{'all':!![]}];}return db[_0xdf9d('0x5b')][_0xdf9d('0x5a')](_0x286b59);})[_0xdf9d('0x24')](function(_0x526b96){_0xf72a27[_0xdf9d('0x42')]=_0x526b96;return _0xf72a27;});}})['then'](respondWithFilteredResult(_0x5db3f6,_0x286b59))[_0xdf9d('0x4a')](handleError(_0x5db3f6,null));};exports['getHopperFinals']=function(_0x5286c4,_0x2a6f61,_0x5cf8ef){var _0x89eb9d={'raw':!![],'where':{}};var _0x3fa608={};var _0x55f557={'count':0x0,'rows':[]};return db[_0xdf9d('0x2c')]['findOne']({'where':{'id':_0x5286c4['params']['id']}})['then'](handleEntityNotFound(_0x2a6f61,null))[_0xdf9d('0x24')](function(_0x5870ea){if(_0x5870ea){_0x3fa608[_0xdf9d('0x30')]=_['keys'](db[_0xdf9d('0x5d')]['rawAttributes']);_0x3fa608[_0xdf9d('0x32')]=_[_0xdf9d('0x33')](_0x5286c4[_0xdf9d('0x32')]);_0x3fa608['filters']=_['intersection'](_0x3fa608[_0xdf9d('0x30')],_0x3fa608[_0xdf9d('0x32')]);_0x89eb9d[_0xdf9d('0x36')]=_[_0xdf9d('0x35')](_0x3fa608['model'],qs[_0xdf9d('0x43')](_0x5286c4['query'][_0xdf9d('0x43')]));_0x89eb9d[_0xdf9d('0x36')]=_0x89eb9d[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x89eb9d['attributes']:_0x3fa608[_0xdf9d('0x30')];if(!_0x5286c4['query'][_0xdf9d('0x59')]('nolimit')){_0x89eb9d[_0xdf9d('0x1e')]=qs[_0xdf9d('0x1e')](_0x5286c4[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0x89eb9d[_0xdf9d('0x1c')]=qs[_0xdf9d('0x1c')](_0x5286c4[_0xdf9d('0x32')]['offset']);}_0x89eb9d[_0xdf9d('0x39')]=qs[_0xdf9d('0x3a')](_0x5286c4[_0xdf9d('0x32')][_0xdf9d('0x3a')]);_0x89eb9d[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x5286c4[_0xdf9d('0x32')],_0x3fa608[_0xdf9d('0x34')]));_0x89eb9d[_0xdf9d('0x3b')][_0xdf9d('0x5c')]=_0x5870ea['id'];if(_0x5286c4[_0xdf9d('0x32')]['filter']){_0x89eb9d[_0xdf9d('0x3b')]=_[_0xdf9d('0x3f')](_0x89eb9d[_0xdf9d('0x3b')],{'$or':_[_0xdf9d('0x31')](_0x89eb9d[_0xdf9d('0x36')],function(_0x3f3cdc){var _0x4c8eaa={};_0x4c8eaa[_0x3f3cdc]={'$like':'%'+_0x5286c4[_0xdf9d('0x32')][_0xdf9d('0x3d')]+'%'};return _0x4c8eaa;})});}_0x89eb9d=_[_0xdf9d('0x3f')]({},_0x89eb9d,_0x5286c4[_0xdf9d('0x44')]);return db[_0xdf9d('0x5d')][_0xdf9d('0x1f')]({'where':_0x89eb9d[_0xdf9d('0x3b')]})[_0xdf9d('0x24')](function(_0x5798b2){_0x55f557[_0xdf9d('0x1f')]=_0x5798b2;if(_0x5286c4[_0xdf9d('0x32')][_0xdf9d('0x40')]){_0x89eb9d[_0xdf9d('0x41')]=[{'all':!![]}];}return db[_0xdf9d('0x5d')][_0xdf9d('0x5a')](_0x89eb9d);})['then'](function(_0x398c3d){_0x55f557[_0xdf9d('0x42')]=_0x398c3d;return _0x55f557;});}})[_0xdf9d('0x24')](respondWithFilteredResult(_0x2a6f61,_0x89eb9d))[_0xdf9d('0x4a')](handleError(_0x2a6f61,null));};exports[_0xdf9d('0x5e')]=function(_0x143c57,_0x3ed08e,_0x2eccc3){var _0x3d5d43={'raw':!![],'where':{}};var _0x1c6b96={};var _0x4a3bef={'count':0x0,'rows':[]};return db[_0xdf9d('0x2c')][_0xdf9d('0x57')]({'where':{'id':_0x143c57[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x3ed08e,null))[_0xdf9d('0x24')](function(_0xbb57db){if(_0xbb57db){_0x1c6b96['model']=_[_0xdf9d('0x33')](db[_0xdf9d('0x5f')][_0xdf9d('0x2d')]);_0x1c6b96[_0xdf9d('0x32')]=_[_0xdf9d('0x33')](_0x143c57['query']);_0x1c6b96['filters']=_['intersection'](_0x1c6b96[_0xdf9d('0x30')],_0x1c6b96['query']);_0x3d5d43[_0xdf9d('0x36')]=_[_0xdf9d('0x35')](_0x1c6b96[_0xdf9d('0x30')],qs[_0xdf9d('0x43')](_0x143c57[_0xdf9d('0x32')]['fields']));_0x3d5d43[_0xdf9d('0x36')]=_0x3d5d43[_0xdf9d('0x36')][_0xdf9d('0x37')]?_0x3d5d43['attributes']:_0x1c6b96[_0xdf9d('0x30')];if(!_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x59')](_0xdf9d('0x38'))){_0x3d5d43['limit']=qs['limit'](_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0x3d5d43[_0xdf9d('0x1c')]=qs['offset'](_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x1c')]);}_0x3d5d43[_0xdf9d('0x39')]=qs[_0xdf9d('0x3a')](_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x3a')]);_0x3d5d43[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x143c57['query'],_0x1c6b96[_0xdf9d('0x34')]));_0x3d5d43[_0xdf9d('0x3b')][_0xdf9d('0x5c')]=_0xbb57db['id'];if(_0x143c57['query'][_0xdf9d('0x3d')]){_0x3d5d43[_0xdf9d('0x3b')]=_[_0xdf9d('0x3f')](_0x3d5d43[_0xdf9d('0x3b')],{'$or':_['map'](_0x3d5d43[_0xdf9d('0x36')],function(_0xbf4338){var _0xc7aba6={};_0xc7aba6[_0xbf4338]={'$like':'%'+_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x3d')]+'%'};return _0xc7aba6;})});}_0x3d5d43=_[_0xdf9d('0x3f')]({},_0x3d5d43,_0x143c57[_0xdf9d('0x44')]);return db[_0xdf9d('0x5f')]['count']({'where':_0x3d5d43[_0xdf9d('0x3b')]})['then'](function(_0x4227cf){_0x4a3bef[_0xdf9d('0x1f')]=_0x4227cf;if(_0x143c57[_0xdf9d('0x32')][_0xdf9d('0x40')]){_0x3d5d43[_0xdf9d('0x41')]=[{'all':!![]}];}return db[_0xdf9d('0x5f')][_0xdf9d('0x5a')](_0x3d5d43);})['then'](function(_0xe2cc82){_0x4a3bef['rows']=_0xe2cc82;return _0x4a3bef;});}})[_0xdf9d('0x24')](respondWithFilteredResult(_0x3ed08e,_0x3d5d43))[_0xdf9d('0x4a')](handleError(_0x3ed08e,null));};exports[_0xdf9d('0x60')]=function(_0x475349,_0x1455a1,_0x15cfc7){var _0x1454e3={};var _0x15e2f2={};var _0x15efa7;var _0x5d6992;return db[_0xdf9d('0x2c')][_0xdf9d('0x57')]({'where':{'id':_0x475349[_0xdf9d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1455a1,null))[_0xdf9d('0x24')](function(_0x3a36f2){if(_0x3a36f2){_0x15efa7=_0x3a36f2;_0x15e2f2[_0xdf9d('0x30')]=_['keys'](db[_0xdf9d('0x61')][_0xdf9d('0x2d')]);_0x15e2f2[_0xdf9d('0x32')]=_[_0xdf9d('0x33')](_0x475349[_0xdf9d('0x32')]);_0x15e2f2[_0xdf9d('0x34')]=_[_0xdf9d('0x35')](_0x15e2f2['model'],_0x15e2f2[_0xdf9d('0x32')]);_0x1454e3['attributes']=_[_0xdf9d('0x35')](_0x15e2f2[_0xdf9d('0x30')],qs[_0xdf9d('0x43')](_0x475349['query'][_0xdf9d('0x43')]));_0x1454e3[_0xdf9d('0x36')]=_0x1454e3[_0xdf9d('0x36')]['length']?_0x1454e3['attributes']:_0x15e2f2[_0xdf9d('0x30')];_0x1454e3[_0xdf9d('0x39')]=qs[_0xdf9d('0x3a')](_0x475349['query'][_0xdf9d('0x3a')]);_0x1454e3[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x475349[_0xdf9d('0x32')],_0x15e2f2['filters']));if(_0x475349['query']['filter']){_0x1454e3[_0xdf9d('0x3b')]=_[_0xdf9d('0x3f')](_0x1454e3[_0xdf9d('0x3b')],{'$or':_['map'](_0x1454e3[_0xdf9d('0x36')],function(_0x304633){var _0x39a230={};_0x39a230[_0x304633]={'$like':'%'+_0x475349[_0xdf9d('0x32')][_0xdf9d('0x3d')]+'%'};return _0x39a230;})});}_0x1454e3=_[_0xdf9d('0x3f')]({},_0x1454e3,_0x475349[_0xdf9d('0x44')]);return _0x15efa7[_0xdf9d('0x60')](_0x1454e3);}})[_0xdf9d('0x24')](function(_0xf1e9a2){if(_0xf1e9a2){_0x5d6992=_0xf1e9a2[_0xdf9d('0x37')];if(!_0x475349['query'][_0xdf9d('0x59')](_0xdf9d('0x38'))){_0x1454e3[_0xdf9d('0x1e')]=qs['limit'](_0x475349[_0xdf9d('0x32')]['limit']);_0x1454e3[_0xdf9d('0x1c')]=qs['offset'](_0x475349[_0xdf9d('0x32')][_0xdf9d('0x1c')]);}return _0x15efa7[_0xdf9d('0x60')](_0x1454e3);}})['then'](function(_0xaf62ea){if(_0xaf62ea){return _0xaf62ea?{'count':_0x5d6992,'rows':_0xaf62ea}:null;}})[_0xdf9d('0x24')](respondWithResult(_0x1455a1,null))[_0xdf9d('0x4a')](handleError(_0x1455a1,null));};exports[_0xdf9d('0x62')]=function(_0x26f41f,_0x55e192,_0x5af332){var _0x44a98f,_0x5f2a5c;return db[_0xdf9d('0x2c')][_0xdf9d('0x45')]({'where':{'id':_0x26f41f[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x55e192,null))[_0xdf9d('0x24')](function(_0xb4ce59){if(_0xb4ce59){_0x5f2a5c=_0xb4ce59;return _0xb4ce59[_0xdf9d('0x62')](_0x26f41f[_0xdf9d('0x51')][_0xdf9d('0x63')],_['omit'](_0x26f41f['body'],[_0xdf9d('0x63'),'id'])||{});}return null;})[_0xdf9d('0x64')](function(_0x222d0f){var _0x2d836d;_0x44a98f=_0x222d0f||[];var _0x19310b=[];if(_0x222d0f){for(var _0x11f5c9=0x0;_0x11f5c9<_0x222d0f[_0xdf9d('0x37')];_0x11f5c9+=0x1){var _0x45eff2=_0x222d0f[_0x11f5c9][_0xdf9d('0x26')]({'plain':!![]});_0x5f2a5c[_0xdf9d('0x65')]=_0x26f41f[_0xdf9d('0x51')]['dialCheckDuplicateType']?_0x26f41f[_0xdf9d('0x51')]['dialCheckDuplicateType']:_0x5f2a5c[_0xdf9d('0x65')];switch(_0x5f2a5c[_0xdf9d('0x65')]){case _0xdf9d('0x66'):_0x2d836d=squel[_0xdf9d('0x67')]()[_0xdf9d('0x68')](_0xdf9d('0x69'))[_0xdf9d('0x6a')]([_0xdf9d('0x6b'),_0xdf9d('0x6c'),_0xdf9d('0x6d'),_0xdf9d('0x6e'),_0xdf9d('0x5c'),_0xdf9d('0x4f'),_0xdf9d('0x50')],squel['select']()[_0xdf9d('0x6f')](_0xdf9d('0x6b'),'phone')['field']('NOW()',_0xdf9d('0x6c'))[_0xdf9d('0x6f')]('id','ContactId')[_0xdf9d('0x6f')](_0x45eff2['CmListId'][_0xdf9d('0x70')](),_0xdf9d('0x6e'))[_0xdf9d('0x6f')](_0x26f41f['params']['id']['toString'](),'CampaignId')[_0xdf9d('0x6f')](_0xdf9d('0x71'),'createdAt')[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x50'))[_0xdf9d('0x72')](_0xdf9d('0x73'))[_0xdf9d('0x3b')](_0xdf9d('0x74'))['where'](_0xdf9d('0x75'),_0x45eff2['CmListId'][_0xdf9d('0x70')]())['where'](_0xdf9d('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdf9d('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xdf9d('0x72')](_0xdf9d('0x77'))[_0xdf9d('0x3b')](_0xdf9d('0x78'),_0x26f41f['params']['id'][_0xdf9d('0x70')]()))[_0xdf9d('0x3b')](_0xdf9d('0x79'),squel['select']()[_0xdf9d('0x6f')](_0xdf9d('0x7a'))[_0xdf9d('0x72')](_0xdf9d('0x69'))[_0xdf9d('0x3b')](_0xdf9d('0x78'),_0x26f41f[_0xdf9d('0x4d')]['id'][_0xdf9d('0x70')]())))[_0xdf9d('0x70')]();break;case _0xdf9d('0x7b'):_0x2d836d=squel[_0xdf9d('0x67')]()[_0xdf9d('0x68')](_0xdf9d('0x69'))[_0xdf9d('0x6a')]([_0xdf9d('0x6b'),_0xdf9d('0x6c'),_0xdf9d('0x6d'),'ListId',_0xdf9d('0x5c'),_0xdf9d('0x4f'),_0xdf9d('0x50')],squel[_0xdf9d('0x7c')]()[_0xdf9d('0x6f')]('phone','phone')[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x6c'))['field']('id',_0xdf9d('0x6d'))[_0xdf9d('0x6f')](_0x45eff2['CmListId']['toString'](),'ListId')[_0xdf9d('0x6f')](_0x26f41f[_0xdf9d('0x4d')]['id'][_0xdf9d('0x70')](),_0xdf9d('0x5c'))[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x4f'))[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x50'))[_0xdf9d('0x72')](_0xdf9d('0x73'))[_0xdf9d('0x3b')](_0xdf9d('0x74'))['where']('ListId\x20=\x20?',_0x45eff2['CmListId'][_0xdf9d('0x70')]())[_0xdf9d('0x3b')](_0xdf9d('0x76'))[_0xdf9d('0x3b')](_0xdf9d('0x79'),squel['select']()[_0xdf9d('0x6f')](_0xdf9d('0x7a'))[_0xdf9d('0x72')](_0xdf9d('0x69'))[_0xdf9d('0x3b')](_0xdf9d('0x78'),_0x26f41f[_0xdf9d('0x4d')]['id'][_0xdf9d('0x70')]())))[_0xdf9d('0x70')]();break;default:_0x2d836d=squel[_0xdf9d('0x67')]()[_0xdf9d('0x68')]('cm_hopper')[_0xdf9d('0x6a')]([_0xdf9d('0x6b'),_0xdf9d('0x6c'),'ContactId',_0xdf9d('0x6e'),_0xdf9d('0x5c'),_0xdf9d('0x4f'),_0xdf9d('0x50')],squel['select']()[_0xdf9d('0x6f')](_0xdf9d('0x6b'),_0xdf9d('0x6b'))[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x6c'))[_0xdf9d('0x6f')]('id','ContactId')['field'](_0x45eff2[_0xdf9d('0x7d')][_0xdf9d('0x70')](),_0xdf9d('0x6e'))[_0xdf9d('0x6f')](_0x26f41f[_0xdf9d('0x4d')]['id']['toString'](),_0xdf9d('0x5c'))[_0xdf9d('0x6f')](_0xdf9d('0x71'),'createdAt')[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x50'))[_0xdf9d('0x72')](_0xdf9d('0x73'))[_0xdf9d('0x3b')](_0xdf9d('0x74'))[_0xdf9d('0x3b')](_0xdf9d('0x75'),_0x45eff2[_0xdf9d('0x7d')]['toString']())[_0xdf9d('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xdf9d('0x70')]();}_0x19310b[_0xdf9d('0x7e')](db[_0xdf9d('0x7f')][_0xdf9d('0x32')](_0x2d836d));}return BPromise[_0xdf9d('0x80')](_0x19310b);}})[_0xdf9d('0x24')](function(){return _0x44a98f;})[_0xdf9d('0x24')](respondWithResult(_0x55e192,null))['catch'](handleError(_0x55e192,null));};exports[_0xdf9d('0x81')]=function(_0x6f43be,_0x343bf7,_0xaef4d6){return db[_0xdf9d('0x2c')]['find']({'where':{'id':_0x6f43be[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x343bf7,null))[_0xdf9d('0x24')](function(_0x5dea8b){if(_0x5dea8b){return _0x5dea8b[_0xdf9d('0x81')](_0x6f43be[_0xdf9d('0x32')][_0xdf9d('0x63')]);}})[_0xdf9d('0x24')](function(_0x7f0c1c){if(_0x7f0c1c){return db[_0xdf9d('0x58')]['destroy']({'where':{'ListId':_0x6f43be[_0xdf9d('0x32')][_0xdf9d('0x63')],'CampaignId':_0x6f43be[_0xdf9d('0x4d')]['id']}})['then'](function(){return _0x7f0c1c;});}})['then'](respondWithStatusCode(_0x343bf7,null))[_0xdf9d('0x4a')](handleError(_0x343bf7,null));};exports[_0xdf9d('0x82')]=function(_0x492fe2,_0x4089e3,_0x4d13aa){var _0xca6895={};var _0x1be7c0={};var _0x270d6f;var _0x5aac8e;return db[_0xdf9d('0x2c')]['findOne']({'where':{'id':_0x492fe2[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x4089e3,null))['then'](function(_0x4b8b10){if(_0x4b8b10){_0x270d6f=_0x4b8b10;_0x1be7c0[_0xdf9d('0x30')]=_['keys'](db[_0xdf9d('0x61')]['rawAttributes']);_0x1be7c0['query']=_['keys'](_0x492fe2['query']);_0x1be7c0[_0xdf9d('0x34')]=_['intersection'](_0x1be7c0[_0xdf9d('0x30')],_0x1be7c0[_0xdf9d('0x32')]);_0xca6895[_0xdf9d('0x36')]=_[_0xdf9d('0x35')](_0x1be7c0[_0xdf9d('0x30')],qs[_0xdf9d('0x43')](_0x492fe2[_0xdf9d('0x32')]['fields']));_0xca6895[_0xdf9d('0x36')]=_0xca6895['attributes'][_0xdf9d('0x37')]?_0xca6895['attributes']:_0x1be7c0[_0xdf9d('0x30')];_0xca6895[_0xdf9d('0x39')]=qs[_0xdf9d('0x3a')](_0x492fe2['query']['sort']);_0xca6895[_0xdf9d('0x3b')]=qs[_0xdf9d('0x34')](_[_0xdf9d('0x3c')](_0x492fe2[_0xdf9d('0x32')],_0x1be7c0[_0xdf9d('0x34')]));if(_0x492fe2[_0xdf9d('0x32')][_0xdf9d('0x3d')]){_0xca6895[_0xdf9d('0x3b')]=_[_0xdf9d('0x3f')](_0xca6895[_0xdf9d('0x3b')],{'$or':_[_0xdf9d('0x31')](_0xca6895['attributes'],function(_0xe3ea8a){var _0x495fa1={};_0x495fa1[_0xe3ea8a]={'$like':'%'+_0x492fe2[_0xdf9d('0x32')][_0xdf9d('0x3d')]+'%'};return _0x495fa1;})});}_0xca6895=_['merge']({},_0xca6895,_0x492fe2['options']);return _0x270d6f[_0xdf9d('0x82')](_0xca6895);}})[_0xdf9d('0x24')](function(_0x4d5b4e){if(_0x4d5b4e){_0x5aac8e=_0x4d5b4e[_0xdf9d('0x37')];if(!_0x492fe2[_0xdf9d('0x32')][_0xdf9d('0x59')](_0xdf9d('0x38'))){_0xca6895[_0xdf9d('0x1e')]=qs['limit'](_0x492fe2[_0xdf9d('0x32')][_0xdf9d('0x1e')]);_0xca6895[_0xdf9d('0x1c')]=qs[_0xdf9d('0x1c')](_0x492fe2[_0xdf9d('0x32')][_0xdf9d('0x1c')]);}return _0x270d6f[_0xdf9d('0x82')](_0xca6895);}})['then'](function(_0x58f188){if(_0x58f188){return _0x58f188?{'count':_0x5aac8e,'rows':_0x58f188}:null;}})[_0xdf9d('0x24')](respondWithResult(_0x4089e3,null))[_0xdf9d('0x4a')](handleError(_0x4089e3,null));};exports[_0xdf9d('0x83')]=function(_0x368c4c,_0x547101,_0x556fd3){var _0x435b21,_0x1f2699;return db[_0xdf9d('0x2c')][_0xdf9d('0x45')]({'where':{'id':_0x368c4c[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x547101,null))['then'](function(_0x97daed){if(_0x97daed){_0x1f2699=_0x97daed;return _0x97daed[_0xdf9d('0x83')](_0x368c4c[_0xdf9d('0x51')][_0xdf9d('0x63')],_['omit'](_0x368c4c[_0xdf9d('0x51')],[_0xdf9d('0x63'),'id'])||{});}return null;})[_0xdf9d('0x64')](function(_0xb84156){var _0x25ffde;_0x435b21=_0xb84156||[];var _0x5c1d39=[];if(_0xb84156){for(var _0x400b5c=0x0;_0x400b5c<_0xb84156[_0xdf9d('0x37')];_0x400b5c+=0x1){var _0x2f4112=_0xb84156[_0x400b5c][_0xdf9d('0x26')]({'plain':!![]});_0x25ffde=squel[_0xdf9d('0x67')]()[_0xdf9d('0x68')]('cm_hopper_black')[_0xdf9d('0x6a')]([_0xdf9d('0x6b'),_0xdf9d('0x6d'),_0xdf9d('0x6e'),_0xdf9d('0x5c'),_0xdf9d('0x4f'),_0xdf9d('0x50')],squel[_0xdf9d('0x7c')]()['field'](_0xdf9d('0x6b'),_0xdf9d('0x6b'))[_0xdf9d('0x6f')]('id',_0xdf9d('0x6d'))['field'](_0x2f4112[_0xdf9d('0x7d')][_0xdf9d('0x70')](),'ListId')['field'](_0x368c4c['params']['id'][_0xdf9d('0x70')](),_0xdf9d('0x5c'))['field']('NOW()',_0xdf9d('0x4f'))[_0xdf9d('0x6f')](_0xdf9d('0x71'),_0xdf9d('0x50'))[_0xdf9d('0x72')](_0xdf9d('0x73'))[_0xdf9d('0x3b')](_0xdf9d('0x74'))[_0xdf9d('0x3b')]('ListId\x20=\x20?',_0x2f4112[_0xdf9d('0x7d')]['toString']())[_0xdf9d('0x3b')](_0xdf9d('0x76')))[_0xdf9d('0x70')]();_0x5c1d39[_0xdf9d('0x7e')](db['sequelize'][_0xdf9d('0x32')](_0x25ffde));}return BPromise[_0xdf9d('0x80')](_0x5c1d39);}})[_0xdf9d('0x24')](function(){return _0x435b21;})[_0xdf9d('0x24')](respondWithResult(_0x547101,null))['catch'](handleError(_0x547101,null));};exports[_0xdf9d('0x84')]=function(_0xaf37c4,_0x4dc5db,_0x3e53fa){return db[_0xdf9d('0x2c')]['find']({'where':{'id':_0xaf37c4['params']['id']}})[_0xdf9d('0x24')](handleEntityNotFound(_0x4dc5db,null))['then'](function(_0x42003b){if(_0x42003b){return _0x42003b[_0xdf9d('0x84')](_0xaf37c4[_0xdf9d('0x32')][_0xdf9d('0x63')]);}})[_0xdf9d('0x24')](function(_0xf212d0){if(_0xf212d0){return db[_0xdf9d('0x5f')]['destroy']({'where':{'ListId':_0xaf37c4[_0xdf9d('0x32')][_0xdf9d('0x63')],'CampaignId':_0xaf37c4[_0xdf9d('0x4d')]['id']}})[_0xdf9d('0x24')](function(){return _0xf212d0;});}})[_0xdf9d('0x24')](respondWithStatusCode(_0x4dc5db,null))['catch'](handleError(_0x4dc5db,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 896b21b..61bd228 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 96e5d4d..1647407 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 _0x6611=['jayson/promise','client','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','options','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e0dea,_0x49ee27){var _0x1be568=function(_0x3b2dd2){while(--_0x3b2dd2){_0x3e0dea['push'](_0x3e0dea['shift']());}};_0x1be568(++_0x49ee27);}(_0x6611,0xdd));var _0x1661=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6611[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var moment=require(_0x1661('0x1'));var BPromise=require(_0x1661('0x2'));var rs=require(_0x1661('0x3'));var fs=require('fs');var Redis=require(_0x1661('0x4'));var db=require(_0x1661('0x5'))['db'];var utils=require(_0x1661('0x6'));var logger=require(_0x1661('0x7'))(_0x1661('0x8'));var config=require(_0x1661('0x9'));var jayson=require(_0x1661('0xa'));var client=jayson[_0x1661('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516d22,_0x3f32f3,_0x3be60f){return new BPromise(function(_0x57e4b8,_0x49d57a){return client[_0x1661('0xc')](_0x516d22,_0x3be60f)[_0x1661('0xd')](function(_0x28026e){logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,_0x1661('0x10'));logger[_0x1661('0x11')](_0x1661('0x12'),_0x3f32f3,'request\x20sent',JSON[_0x1661('0x13')](_0x28026e));if(_0x28026e[_0x1661('0x14')]){if(_0x28026e['error'][_0x1661('0x15')]===0x1f4){logger['error'](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x49d57a(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x57e4b8(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}else{logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,'request\x20sent');_0x57e4b8(_0x28026e['result'][_0x1661('0x16')]);}})[_0x1661('0x17')](function(_0x55ef62){logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x55ef62);_0x49d57a(_0x55ef62);});});}exports[_0x1661('0x18')]=function(_0x1110e3){var _0x4edbfc=this;return new Promise(function(_0xcab4a,_0x55fd5d){return db[_0x1661('0x19')]['findAll']({'raw':_0x1110e3[_0x1661('0x1a')]?_0x1110e3[_0x1661('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1110e3[_0x1661('0x1a')]?_0x1110e3['options'][_0x1661('0x1b')]||null:null,'attributes':_0x1110e3[_0x1661('0x1a')]?_0x1110e3[_0x1661('0x1a')][_0x1661('0x1c')]||null:null,'limit':_0x1110e3[_0x1661('0x1a')]?_0x1110e3[_0x1661('0x1a')][_0x1661('0x1d')]||null:null,'include':_0x1110e3['options']?_0x1110e3['options'][_0x1661('0x1e')]?_[_0x1661('0x1f')](_0x1110e3[_0x1661('0x1a')][_0x1661('0x1e')],function(_0x38c00c){return{'model':db[_0x38c00c['model']],'as':_0x38c00c['as'],'attributes':_0x38c00c[_0x1661('0x1c')],'include':_0x38c00c['include']?_[_0x1661('0x1f')](_0x38c00c[_0x1661('0x1e')],function(_0x118f81){return{'model':db[_0x118f81[_0x1661('0x20')]],'as':_0x118f81['as'],'attributes':_0x118f81['attributes'],'include':_0x118f81[_0x1661('0x1e')]?_[_0x1661('0x1f')](_0x118f81[_0x1661('0x1e')],function(_0x53e919){return{'model':db[_0x53e919[_0x1661('0x20')]],'as':_0x53e919['as'],'attributes':_0x53e919[_0x1661('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a9e9){logger['info'](_0x1661('0x18'),_0x1110e3);logger[_0x1661('0x11')](_0x1661('0x18'),_0x1110e3,JSON[_0x1661('0x13')](_0x19a9e9));_0xcab4a(_0x19a9e9);})[_0x1661('0x17')](function(_0x3eb848){logger[_0x1661('0x14')](_0x1661('0x18'),_0x3eb848['message'],_0x1110e3);_0x55fd5d(_0x4edbfc[_0x1661('0x14')](0x1f4,_0x3eb848[_0x1661('0x16')]));});});}; \ No newline at end of file +var _0x1df5=['raw','where','attributes','include','map','model','GetCampaign','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','options'];(function(_0x3c47a2,_0x210863){var _0x42a3e0=function(_0x1f2a17){while(--_0x1f2a17){_0x3c47a2['push'](_0x3c47a2['shift']());}};_0x42a3e0(++_0x210863);}(_0x1df5,0xfd));var _0x51df=function(_0x5808dd,_0x1ed9a2){_0x5808dd=_0x5808dd-0x0;var _0x568f20=_0x1df5[_0x5808dd];return _0x568f20;};'use strict';var _=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var moment=require(_0x51df('0x2'));var BPromise=require(_0x51df('0x3'));var rs=require(_0x51df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51df('0x5'))['db'];var utils=require(_0x51df('0x6'));var logger=require(_0x51df('0x7'))(_0x51df('0x8'));var config=require(_0x51df('0x9'));var jayson=require(_0x51df('0xa'));var client=jayson[_0x51df('0xb')][_0x51df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50961e,_0x1316c2,_0x53b879){return new BPromise(function(_0x42a74a,_0x3e7952){return client[_0x51df('0xd')](_0x50961e,_0x53b879)[_0x51df('0xe')](function(_0x7e1410){logger[_0x51df('0xf')](_0x51df('0x10'),_0x1316c2,_0x51df('0x11'));logger['debug'](_0x51df('0x12'),_0x1316c2,_0x51df('0x11'),JSON[_0x51df('0x13')](_0x7e1410));if(_0x7e1410[_0x51df('0x14')]){if(_0x7e1410[_0x51df('0x14')][_0x51df('0x15')]===0x1f4){logger[_0x51df('0x14')](_0x51df('0x10'),_0x1316c2,_0x7e1410[_0x51df('0x14')][_0x51df('0x16')]);return _0x3e7952(_0x7e1410[_0x51df('0x14')][_0x51df('0x16')]);}logger[_0x51df('0x14')](_0x51df('0x10'),_0x1316c2,_0x7e1410[_0x51df('0x14')]['message']);return _0x42a74a(_0x7e1410[_0x51df('0x14')][_0x51df('0x16')]);}else{logger['info'](_0x51df('0x10'),_0x1316c2,_0x51df('0x11'));_0x42a74a(_0x7e1410[_0x51df('0x17')]['message']);}})[_0x51df('0x18')](function(_0x353a81){logger[_0x51df('0x14')](_0x51df('0x10'),_0x1316c2,_0x353a81);_0x3e7952(_0x353a81);});});}exports['GetCampaign']=function(_0x1bdba3){var _0x3e24e7=this;return new Promise(function(_0x5cd515,_0x49470b){return db[_0x51df('0x19')]['findAll']({'raw':_0x1bdba3[_0x51df('0x1a')]?_0x1bdba3[_0x51df('0x1a')][_0x51df('0x1b')]===undefined?!![]:![]:!![],'where':_0x1bdba3[_0x51df('0x1a')]?_0x1bdba3['options'][_0x51df('0x1c')]||null:null,'attributes':_0x1bdba3[_0x51df('0x1a')]?_0x1bdba3['options'][_0x51df('0x1d')]||null:null,'limit':_0x1bdba3['options']?_0x1bdba3[_0x51df('0x1a')]['limit']||null:null,'include':_0x1bdba3['options']?_0x1bdba3[_0x51df('0x1a')][_0x51df('0x1e')]?_[_0x51df('0x1f')](_0x1bdba3[_0x51df('0x1a')][_0x51df('0x1e')],function(_0x105475){return{'model':db[_0x105475[_0x51df('0x20')]],'as':_0x105475['as'],'attributes':_0x105475[_0x51df('0x1d')],'include':_0x105475[_0x51df('0x1e')]?_[_0x51df('0x1f')](_0x105475[_0x51df('0x1e')],function(_0x17e807){return{'model':db[_0x17e807[_0x51df('0x20')]],'as':_0x17e807['as'],'attributes':_0x17e807[_0x51df('0x1d')],'include':_0x17e807[_0x51df('0x1e')]?_[_0x51df('0x1f')](_0x17e807[_0x51df('0x1e')],function(_0x417942){return{'model':db[_0x417942[_0x51df('0x20')]],'as':_0x417942['as'],'attributes':_0x417942[_0x51df('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b71b){logger[_0x51df('0xf')](_0x51df('0x21'),_0x1bdba3);logger[_0x51df('0x22')](_0x51df('0x21'),_0x1bdba3,JSON[_0x51df('0x13')](_0x53b71b));_0x5cd515(_0x53b71b);})['catch'](function(_0x4bf243){logger[_0x51df('0x14')](_0x51df('0x21'),_0x4bf243[_0x51df('0x16')],_0x1bdba3);_0x49470b(_0x3e24e7[_0x51df('0x14')](0x1f4,_0x4bf243[_0x51df('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index fca0b3f..2981c4f 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 _0xcb83=['clone','post','addLists','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x374e9b,_0x4e6baa){_0x374e9b=_0x374e9b-0x0;var _0x969b88=_0xcb83[_0x374e9b];return _0x969b88;};'use strict';var multer=require(_0x3cb8('0x0'));var util=require('util');var path=require(_0x3cb8('0x1'));var timeout=require(_0x3cb8('0x2'));var express=require(_0x3cb8('0x3'));var router=express[_0x3cb8('0x4')]();var fs_extra=require(_0x3cb8('0x5'));var auth=require(_0x3cb8('0x6'));var interaction=require(_0x3cb8('0x7'));var config=require(_0x3cb8('0x8'));var controller=require(_0x3cb8('0x9'));router[_0x3cb8('0xa')]('/',auth['isAuthenticated'](),controller[_0x3cb8('0xb')]);router[_0x3cb8('0xa')](_0x3cb8('0xc'),auth['isAuthenticated'](),controller[_0x3cb8('0xd')]);router[_0x3cb8('0xa')](_0x3cb8('0xe'),auth[_0x3cb8('0xf')](),controller[_0x3cb8('0x10')]);router[_0x3cb8('0xa')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x3cb8('0x11')]);router['get'](_0x3cb8('0x12'),auth[_0x3cb8('0xf')](),controller[_0x3cb8('0x13')]);router[_0x3cb8('0xa')](_0x3cb8('0x14'),auth[_0x3cb8('0xf')](),controller[_0x3cb8('0x15')]);router['get'](_0x3cb8('0x16'),auth[_0x3cb8('0xf')](),controller[_0x3cb8('0x17')]);router[_0x3cb8('0xa')](_0x3cb8('0x18'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x3cb8('0x19')]);router['post'](_0x3cb8('0x1a'),auth[_0x3cb8('0xf')](),controller[_0x3cb8('0x1b')]);router[_0x3cb8('0x1c')](_0x3cb8('0x16'),auth['isAuthenticated'](),controller[_0x3cb8('0x1d')]);router[_0x3cb8('0x1c')](_0x3cb8('0x18'),auth[_0x3cb8('0xf')](),controller['addBlackLists']);router['put'](_0x3cb8('0xc'),auth[_0x3cb8('0xf')](),controller['update']);router['delete']('/:id',auth[_0x3cb8('0xf')](),controller['destroy']);router[_0x3cb8('0x1e')](_0x3cb8('0x16'),auth[_0x3cb8('0xf')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x3cb8('0xf')](),controller['removeBlackLists']);module[_0x3cb8('0x1f')]=router; \ No newline at end of file +var _0x2911=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','exports'];(function(_0x4a1c68,_0x712102){var _0x25bcf5=function(_0x57148b){while(--_0x57148b){_0x4a1c68['push'](_0x4a1c68['shift']());}};_0x25bcf5(++_0x712102);}(_0x2911,0x90));var _0x1291=function(_0xb919ba,_0x4dcfb9){_0xb919ba=_0xb919ba-0x0;var _0x2bf094=_0x2911[_0xb919ba];return _0x2bf094;};'use strict';var multer=require(_0x1291('0x0'));var util=require(_0x1291('0x1'));var path=require(_0x1291('0x2'));var timeout=require(_0x1291('0x3'));var express=require(_0x1291('0x4'));var router=express[_0x1291('0x5')]();var fs_extra=require(_0x1291('0x6'));var auth=require(_0x1291('0x7'));var interaction=require(_0x1291('0x8'));var config=require('../../config/environment');var controller=require(_0x1291('0x9'));router[_0x1291('0xa')]('/',auth[_0x1291('0xb')](),controller[_0x1291('0xc')]);router[_0x1291('0xa')](_0x1291('0xd'),auth[_0x1291('0xb')](),controller[_0x1291('0xe')]);router[_0x1291('0xa')](_0x1291('0xf'),auth['isAuthenticated'](),controller[_0x1291('0x10')]);router[_0x1291('0xa')](_0x1291('0x11'),auth[_0x1291('0xb')](),controller[_0x1291('0x12')]);router['get'](_0x1291('0x13'),auth['isAuthenticated'](),controller[_0x1291('0x14')]);router['get']('/:id/hopper_black',auth[_0x1291('0xb')](),controller[_0x1291('0x15')]);router[_0x1291('0xa')](_0x1291('0x16'),auth[_0x1291('0xb')](),controller[_0x1291('0x17')]);router[_0x1291('0xa')](_0x1291('0x18'),auth[_0x1291('0xb')](),controller[_0x1291('0x19')]);router[_0x1291('0x1a')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1291('0x1b'),auth[_0x1291('0xb')](),controller[_0x1291('0x1c')]);router[_0x1291('0x1a')](_0x1291('0x16'),auth[_0x1291('0xb')](),controller[_0x1291('0x1d')]);router[_0x1291('0x1a')](_0x1291('0x18'),auth['isAuthenticated'](),controller[_0x1291('0x1e')]);router[_0x1291('0x1f')](_0x1291('0xd'),auth[_0x1291('0xb')](),controller[_0x1291('0x20')]);router[_0x1291('0x21')](_0x1291('0xd'),auth['isAuthenticated'](),controller[_0x1291('0x22')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0x1291('0x21')]('/:id/blacklists',auth[_0x1291('0xb')](),controller['removeBlackLists']);module[_0x1291('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c8934e9..4801dcd 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 _0x8afc=['STRING','VIRTUAL','sequelize','exports'];(function(_0x3bf212,_0x1a3211){var _0x26d447=function(_0x1fbdb5){while(--_0x1fbdb5){_0x3bf212['push'](_0x3bf212['shift']());}};_0x26d447(++_0x1a3211);}(_0x8afc,0x15e));var _0xc8af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8afc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8af('0x0'));module[_0xc8af('0x1')]={'key':{'type':Sequelize[_0xc8af('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xc8af('0x2')]},'name':{'type':Sequelize[_0xc8af('0x3')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0x49cc=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x23b5b6,_0x88ba37){var _0x20392d=function(_0x1c0398){while(--_0x1c0398){_0x23b5b6['push'](_0x23b5b6['shift']());}};_0x20392d(++_0x88ba37);}(_0x49cc,0x83));var _0xc49c=function(_0x144435,_0x2a4829){_0x144435=_0x144435-0x0;var _0xc90fee=_0x49cc[_0x144435];return _0xc90fee;};'use strict';var Sequelize=require(_0xc49c('0x0'));module[_0xc49c('0x1')]={'key':{'type':Sequelize[_0xc49c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xc49c('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xc49c('0x2')]},'name':{'type':Sequelize[_0xc49c('0x4')],'get':function(){return this[_0xc49c('0x5')](_0xc49c('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 2ac5751..8ebfd9e 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 _0x2b86=['ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x183ca4,_0x1026fb){var _0x1d68d2=function(_0x366018){while(--_0x366018){_0x183ca4['push'](_0x183ca4['shift']());}};_0x1d68d2(++_0x1026fb);}(_0x2b86,0x9c));var _0x62b8=function(_0x57a06b,_0x4f16f6){_0x57a06b=_0x57a06b-0x0;var _0x54bc30=_0x2b86[_0x57a06b];return _0x54bc30;};'use strict';var emlformat=require(_0x62b8('0x0'));var rimraf=require(_0x62b8('0x1'));var zipdir=require(_0x62b8('0x2'));var jsonpatch=require(_0x62b8('0x3'));var rp=require(_0x62b8('0x4'));var moment=require(_0x62b8('0x5'));var BPromise=require(_0x62b8('0x6'));var Mustache=require(_0x62b8('0x7'));var util=require('util');var path=require(_0x62b8('0x8'));var sox=require(_0x62b8('0x9'));var csv=require('to-csv');var ejs=require(_0x62b8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62b8('0xb'));var squel=require(_0x62b8('0xc'));var crypto=require(_0x62b8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x62b8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x62b8('0xf'));var Papa=require('papaparse');var Redis=require(_0x62b8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x62b8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62b8('0x12'))(_0x62b8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x62b8('0x14'));var db=require(_0x62b8('0x15'))['db'];function respondWithStatusCode(_0x4f859c,_0x4256f2){_0x4256f2=_0x4256f2||0xcc;return function(_0x43ad93){if(_0x43ad93){return _0x4f859c[_0x62b8('0x16')](_0x4256f2);}return _0x4f859c[_0x62b8('0x17')](_0x4256f2)['end']();};}function respondWithResult(_0x4f75e6,_0x5cf8f1){_0x5cf8f1=_0x5cf8f1||0xc8;return function(_0x97f106){if(_0x97f106){return _0x4f75e6[_0x62b8('0x17')](_0x5cf8f1)['json'](_0x97f106);}};}function respondWithFilteredResult(_0x522f19,_0x2a6607){return function(_0x47617b){if(_0x47617b){var _0x175cbc=typeof _0x2a6607[_0x62b8('0x18')]===_0x62b8('0x19')&&typeof _0x2a6607[_0x62b8('0x1a')]==='undefined';var _0x58e28a=_0x47617b[_0x62b8('0x1b')];var _0x57e7cc=_0x175cbc?0x0:_0x2a6607[_0x62b8('0x18')];var _0x1a5338=_0x175cbc?_0x47617b['count']:_0x2a6607[_0x62b8('0x18')]+_0x2a6607[_0x62b8('0x1a')];var _0x270079;if(_0x1a5338>=_0x58e28a){_0x1a5338=_0x58e28a;_0x270079=0xc8;}else{_0x270079=0xce;}_0x522f19[_0x62b8('0x17')](_0x270079);return _0x522f19['set'](_0x62b8('0x1c'),_0x57e7cc+'-'+_0x1a5338+'/'+_0x58e28a)[_0x62b8('0x1d')](_0x47617b);}return null;};}function patchUpdates(_0x53ce5c){return function(_0x101f99){try{jsonpatch[_0x62b8('0x1e')](_0x101f99,_0x53ce5c,!![]);}catch(_0x4d638f){return BPromise['reject'](_0x4d638f);}return _0x101f99[_0x62b8('0x1f')]();};}function saveUpdates(_0x4dec9d,_0x557cd3){return function(_0x34ae21){if(_0x34ae21){return _0x34ae21['update'](_0x4dec9d)[_0x62b8('0x20')](function(_0x492d1f){return _0x492d1f;});}return null;};}function removeEntity(_0x63b246,_0x49d495){return function(_0x5bfe33){if(_0x5bfe33){return _0x5bfe33[_0x62b8('0x21')]()['then'](function(){var _0x58464f=_0x5bfe33[_0x62b8('0x22')]({'plain':!![]});var _0x253b70=_0x62b8('0x23');return db['UserProfileResource'][_0x62b8('0x21')]({'where':{'type':_0x253b70,'resourceId':_0x58464f['id']}})[_0x62b8('0x20')](function(){return _0x5bfe33;});})[_0x62b8('0x20')](function(){_0x63b246[_0x62b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10a699,_0x64b345){return function(_0xcfc0a6){if(!_0xcfc0a6){_0x10a699[_0x62b8('0x16')](0x194);}return _0xcfc0a6;};}function handleError(_0x3c6b3a,_0x338c97){_0x338c97=_0x338c97||0x1f4;return function(_0x2a9f26){logger[_0x62b8('0x24')](_0x2a9f26[_0x62b8('0x25')]);if(_0x2a9f26[_0x62b8('0x26')]){delete _0x2a9f26[_0x62b8('0x26')];}_0x3c6b3a[_0x62b8('0x17')](_0x338c97)[_0x62b8('0x27')](_0x2a9f26);};}exports[_0x62b8('0x28')]=function(_0x5588ce,_0x5f055e){var _0x521a85={},_0x2b5782={},_0x12355b={'count':0x0,'rows':[]};var _0x423308=_[_0x62b8('0x29')](db[_0x62b8('0x2a')][_0x62b8('0x2b')],function(_0x4ada98){return{'name':_0x4ada98['fieldName'],'type':_0x4ada98['type'][_0x62b8('0x2c')]};});_0x2b5782[_0x62b8('0x2d')]=_[_0x62b8('0x29')](_0x423308,_0x62b8('0x26'));_0x2b5782[_0x62b8('0x2e')]=_['keys'](_0x5588ce[_0x62b8('0x2e')]);_0x2b5782[_0x62b8('0x2f')]=_['intersection'](_0x2b5782[_0x62b8('0x2d')],_0x2b5782[_0x62b8('0x2e')]);_0x521a85[_0x62b8('0x30')]=_[_0x62b8('0x31')](_0x2b5782[_0x62b8('0x2d')],qs[_0x62b8('0x32')](_0x5588ce[_0x62b8('0x2e')][_0x62b8('0x32')]));_0x521a85['attributes']=_0x521a85[_0x62b8('0x30')][_0x62b8('0x33')]?_0x521a85[_0x62b8('0x30')]:_0x2b5782[_0x62b8('0x2d')];if(!_0x5588ce[_0x62b8('0x2e')][_0x62b8('0x34')](_0x62b8('0x35'))){_0x521a85[_0x62b8('0x1a')]=qs['limit'](_0x5588ce[_0x62b8('0x2e')][_0x62b8('0x1a')]);_0x521a85[_0x62b8('0x18')]=qs['offset'](_0x5588ce[_0x62b8('0x2e')][_0x62b8('0x18')]);}_0x521a85['order']=qs[_0x62b8('0x36')](_0x5588ce[_0x62b8('0x2e')]['sort']);_0x521a85[_0x62b8('0x37')]=qs[_0x62b8('0x2f')](_[_0x62b8('0x38')](_0x5588ce[_0x62b8('0x2e')],_0x2b5782['filters']),_0x423308);if(_0x5588ce['query'][_0x62b8('0x39')]){_0x521a85['where']=_[_0x62b8('0x3a')](_0x521a85[_0x62b8('0x37')],{'$or':[{'key':{'$like':'%'+_0x5588ce['query']['filter']+'%'}},{'value':{'$like':'%'+_0x5588ce['query'][_0x62b8('0x39')]+'%'}}]});}_0x521a85=_['merge']({},_0x521a85,_0x5588ce[_0x62b8('0x3b')]);var _0x5198dc={'where':_0x521a85[_0x62b8('0x37')]};return db[_0x62b8('0x2a')]['count'](_0x5198dc)[_0x62b8('0x20')](function(_0x5723e4){_0x12355b[_0x62b8('0x1b')]=_0x5723e4;if(_0x5588ce['query'][_0x62b8('0x3c')]){_0x521a85[_0x62b8('0x3d')]=[{'all':!![]}];}return db[_0x62b8('0x2a')][_0x62b8('0x3e')](_0x521a85);})['then'](function(_0x21f60d){_0x12355b[_0x62b8('0x3f')]=_0x21f60d;return _0x12355b;})[_0x62b8('0x20')](respondWithFilteredResult(_0x5f055e,_0x521a85))[_0x62b8('0x40')](handleError(_0x5f055e,null));};exports[_0x62b8('0x41')]=function(_0x463dcf,_0x52ffb7){var _0x411858={'raw':!![],'where':{'id':_0x463dcf[_0x62b8('0x42')]['id']}},_0x3d4861={};_0x3d4861[_0x62b8('0x2d')]=_[_0x62b8('0x43')](db[_0x62b8('0x2a')][_0x62b8('0x2b')]);_0x3d4861[_0x62b8('0x2e')]=_[_0x62b8('0x43')](_0x463dcf['query']);_0x3d4861[_0x62b8('0x2f')]=_['intersection'](_0x3d4861[_0x62b8('0x2d')],_0x3d4861[_0x62b8('0x2e')]);_0x411858[_0x62b8('0x30')]=_[_0x62b8('0x31')](_0x3d4861['model'],qs[_0x62b8('0x32')](_0x463dcf[_0x62b8('0x2e')][_0x62b8('0x32')]));_0x411858[_0x62b8('0x30')]=_0x411858['attributes'][_0x62b8('0x33')]?_0x411858[_0x62b8('0x30')]:_0x3d4861['model'];if(_0x463dcf[_0x62b8('0x2e')]['includeAll']){_0x411858['include']=[{'all':!![]}];}_0x411858=_[_0x62b8('0x3a')]({},_0x411858,_0x463dcf['options']);return db['CannedAnswer'][_0x62b8('0x44')](_0x411858)[_0x62b8('0x20')](handleEntityNotFound(_0x52ffb7,null))[_0x62b8('0x20')](respondWithResult(_0x52ffb7,null))[_0x62b8('0x40')](handleError(_0x52ffb7,null));};exports['update']=function(_0x39f1dc,_0x19e09f){if(_0x39f1dc[_0x62b8('0x45')]['id']){delete _0x39f1dc[_0x62b8('0x45')]['id'];}return db[_0x62b8('0x2a')]['find']({'where':{'id':_0x39f1dc[_0x62b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x19e09f,null))[_0x62b8('0x20')](saveUpdates(_0x39f1dc[_0x62b8('0x45')],null))[_0x62b8('0x20')](respondWithResult(_0x19e09f,null))['catch'](handleError(_0x19e09f,null));};exports[_0x62b8('0x21')]=function(_0x4ac201,_0x1bf5f4){return db['CannedAnswer'][_0x62b8('0x44')]({'where':{'id':_0x4ac201[_0x62b8('0x42')]['id']}})[_0x62b8('0x20')](handleEntityNotFound(_0x1bf5f4,null))[_0x62b8('0x20')](removeEntity(_0x1bf5f4,null))[_0x62b8('0x40')](handleError(_0x1bf5f4,null));};exports['create']=function(_0x10d2e3,_0x4afd64){var _0x7af00a={'key':_0x10d2e3[_0x62b8('0x45')][_0x62b8('0x2c')]};if(_0x10d2e3[_0x62b8('0x45')]['MailAccountId']){_0x7af00a[_0x62b8('0x46')]=_0x10d2e3['body'][_0x62b8('0x46')];}else if(_0x10d2e3[_0x62b8('0x45')][_0x62b8('0x47')]){_0x7af00a[_0x62b8('0x47')]=_0x10d2e3['body'][_0x62b8('0x47')];}else if(_0x10d2e3[_0x62b8('0x45')]['OpenchannelAccountId']){_0x7af00a[_0x62b8('0x48')]=_0x10d2e3[_0x62b8('0x45')][_0x62b8('0x48')];}else if(_0x10d2e3[_0x62b8('0x45')][_0x62b8('0x49')]){_0x7af00a['ChatWebsiteId']=_0x10d2e3[_0x62b8('0x45')]['ChatWebsiteId'];}return db[_0x62b8('0x2a')]['find']({'where':_0x7af00a})['then'](function(_0x4c4a14){if(_0x4c4a14){throw new db['Sequelize'][(_0x62b8('0x4a'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x62b8('0x2a')]['create'](_0x10d2e3[_0x62b8('0x45')]);})['then'](function(_0x2bcc00){var _0x5cabbf=_0x10d2e3[_0x62b8('0x4b')][_0x62b8('0x22')]({'plain':!![]});if(!_0x5cabbf)throw new Error(_0x62b8('0x4c'));if(_0x5cabbf[_0x62b8('0x4d')]===_0x62b8('0x4b')){var _0x11e9b0=_0x2bcc00[_0x62b8('0x22')]({'plain':!![]});return db[_0x62b8('0x4e')][_0x62b8('0x44')]({'where':{'name':_0x62b8('0x23'),'userProfileId':_0x5cabbf[_0x62b8('0x4f')]},'raw':!![]})[_0x62b8('0x20')](function(_0x5ddce8){if(_0x5ddce8&&_0x5ddce8[_0x62b8('0x50')]===0x0){return db['UserProfileResource'][_0x62b8('0x51')]({'name':_0x11e9b0['name'],'resourceId':_0x11e9b0['id'],'type':_0x5ddce8['name'],'sectionId':_0x5ddce8['id']},{})[_0x62b8('0x20')](function(){return _0x2bcc00;});}else{return _0x2bcc00;}})[_0x62b8('0x40')](function(_0x3f054f){logger[_0x62b8('0x24')](_0x62b8('0x52'),_0x3f054f);throw _0x3f054f;});}return _0x2bcc00;})[_0x62b8('0x20')](respondWithResult(_0x4afd64,0xc9))['catch'](handleError(_0x4afd64,null));}; \ No newline at end of file +var _0xbbb7=['error','stack','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus'];(function(_0x32d537,_0x580e46){var _0x2ec857=function(_0x38ff38){while(--_0x38ff38){_0x32d537['push'](_0x32d537['shift']());}};_0x2ec857(++_0x580e46);}(_0xbbb7,0x14b));var _0x7bbb=function(_0x24b8e7,_0x93f854){_0x24b8e7=_0x24b8e7-0x0;var _0x4f3b7c=_0xbbb7[_0x24b8e7];return _0x4f3b7c;};'use strict';var emlformat=require(_0x7bbb('0x0'));var rimraf=require(_0x7bbb('0x1'));var zipdir=require(_0x7bbb('0x2'));var jsonpatch=require(_0x7bbb('0x3'));var rp=require(_0x7bbb('0x4'));var moment=require(_0x7bbb('0x5'));var BPromise=require(_0x7bbb('0x6'));var Mustache=require(_0x7bbb('0x7'));var util=require(_0x7bbb('0x8'));var path=require(_0x7bbb('0x9'));var sox=require(_0x7bbb('0xa'));var csv=require(_0x7bbb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bbb('0xc'));var _=require(_0x7bbb('0xd'));var squel=require(_0x7bbb('0xe'));var crypto=require(_0x7bbb('0xf'));var jsforce=require(_0x7bbb('0x10'));var deskjs=require(_0x7bbb('0x11'));var toCsv=require(_0x7bbb('0xb'));var querystring=require(_0x7bbb('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7bbb('0x13'));var qs=require(_0x7bbb('0x14'));var as=require(_0x7bbb('0x15'));var hardwareService=require(_0x7bbb('0x16'));var logger=require(_0x7bbb('0x17'))(_0x7bbb('0x18'));var utils=require(_0x7bbb('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7bbb('0x1a'));var db=require(_0x7bbb('0x1b'))['db'];function respondWithStatusCode(_0x29ca7b,_0x575c0b){_0x575c0b=_0x575c0b||0xcc;return function(_0x3cb95e){if(_0x3cb95e){return _0x29ca7b['sendStatus'](_0x575c0b);}return _0x29ca7b[_0x7bbb('0x1c')](_0x575c0b)[_0x7bbb('0x1d')]();};}function respondWithResult(_0x17017a,_0x32d103){_0x32d103=_0x32d103||0xc8;return function(_0x3e3b39){if(_0x3e3b39){return _0x17017a[_0x7bbb('0x1c')](_0x32d103)[_0x7bbb('0x1e')](_0x3e3b39);}};}function respondWithFilteredResult(_0x1963b3,_0x552b19){return function(_0xa0815f){if(_0xa0815f){var _0x831eb2=typeof _0x552b19[_0x7bbb('0x1f')]===_0x7bbb('0x20')&&typeof _0x552b19[_0x7bbb('0x21')]===_0x7bbb('0x20');var _0x3d6adf=_0xa0815f['count'];var _0x2c7ba1=_0x831eb2?0x0:_0x552b19[_0x7bbb('0x1f')];var _0xdeddfa=_0x831eb2?_0xa0815f[_0x7bbb('0x22')]:_0x552b19[_0x7bbb('0x1f')]+_0x552b19[_0x7bbb('0x21')];var _0x119aa8;if(_0xdeddfa>=_0x3d6adf){_0xdeddfa=_0x3d6adf;_0x119aa8=0xc8;}else{_0x119aa8=0xce;}_0x1963b3[_0x7bbb('0x1c')](_0x119aa8);return _0x1963b3[_0x7bbb('0x23')]('Content-Range',_0x2c7ba1+'-'+_0xdeddfa+'/'+_0x3d6adf)[_0x7bbb('0x1e')](_0xa0815f);}return null;};}function patchUpdates(_0x31656f){return function(_0x2379e0){try{jsonpatch[_0x7bbb('0x24')](_0x2379e0,_0x31656f,!![]);}catch(_0x4cd857){return BPromise[_0x7bbb('0x25')](_0x4cd857);}return _0x2379e0['save']();};}function saveUpdates(_0x2f6e9d,_0x5daf6f){return function(_0x35acf8){if(_0x35acf8){return _0x35acf8[_0x7bbb('0x26')](_0x2f6e9d)[_0x7bbb('0x27')](function(_0x33329f){return _0x33329f;});}return null;};}function removeEntity(_0x42c7ec,_0x43c043){return function(_0x53dbab){if(_0x53dbab){return _0x53dbab[_0x7bbb('0x28')]()[_0x7bbb('0x27')](function(){var _0x46412c=_0x53dbab[_0x7bbb('0x29')]({'plain':!![]});var _0x2e2f53=_0x7bbb('0x2a');return db[_0x7bbb('0x2b')][_0x7bbb('0x28')]({'where':{'type':_0x2e2f53,'resourceId':_0x46412c['id']}})[_0x7bbb('0x27')](function(){return _0x53dbab;});})[_0x7bbb('0x27')](function(){_0x42c7ec[_0x7bbb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2022f9,_0x16c8a5){return function(_0xe73cda){if(!_0xe73cda){_0x2022f9[_0x7bbb('0x2c')](0x194);}return _0xe73cda;};}function handleError(_0x55cf17,_0x3fc93a){_0x3fc93a=_0x3fc93a||0x1f4;return function(_0xa75dfd){logger[_0x7bbb('0x2d')](_0xa75dfd[_0x7bbb('0x2e')]);if(_0xa75dfd[_0x7bbb('0x2f')]){delete _0xa75dfd['name'];}_0x55cf17[_0x7bbb('0x1c')](_0x3fc93a)[_0x7bbb('0x30')](_0xa75dfd);};}exports[_0x7bbb('0x31')]=function(_0x12ddda,_0x134404){var _0x5b7430={},_0x29de2d={},_0x22b3de={'count':0x0,'rows':[]};var _0x3f9d85=_['map'](db['CannedAnswer'][_0x7bbb('0x32')],function(_0x39f993){return{'name':_0x39f993['fieldName'],'type':_0x39f993[_0x7bbb('0x33')]['key']};});_0x29de2d[_0x7bbb('0x34')]=_[_0x7bbb('0x35')](_0x3f9d85,_0x7bbb('0x2f'));_0x29de2d['query']=_[_0x7bbb('0x36')](_0x12ddda[_0x7bbb('0x37')]);_0x29de2d[_0x7bbb('0x38')]=_[_0x7bbb('0x39')](_0x29de2d[_0x7bbb('0x34')],_0x29de2d[_0x7bbb('0x37')]);_0x5b7430[_0x7bbb('0x3a')]=_['intersection'](_0x29de2d[_0x7bbb('0x34')],qs['fields'](_0x12ddda[_0x7bbb('0x37')][_0x7bbb('0x3b')]));_0x5b7430[_0x7bbb('0x3a')]=_0x5b7430[_0x7bbb('0x3a')][_0x7bbb('0x3c')]?_0x5b7430[_0x7bbb('0x3a')]:_0x29de2d['model'];if(!_0x12ddda['query'][_0x7bbb('0x3d')]('nolimit')){_0x5b7430['limit']=qs[_0x7bbb('0x21')](_0x12ddda['query']['limit']);_0x5b7430[_0x7bbb('0x1f')]=qs[_0x7bbb('0x1f')](_0x12ddda[_0x7bbb('0x37')][_0x7bbb('0x1f')]);}_0x5b7430[_0x7bbb('0x3e')]=qs[_0x7bbb('0x3f')](_0x12ddda['query'][_0x7bbb('0x3f')]);_0x5b7430[_0x7bbb('0x40')]=qs[_0x7bbb('0x38')](_[_0x7bbb('0x41')](_0x12ddda[_0x7bbb('0x37')],_0x29de2d[_0x7bbb('0x38')]),_0x3f9d85);if(_0x12ddda[_0x7bbb('0x37')][_0x7bbb('0x42')]){_0x5b7430[_0x7bbb('0x40')]=_[_0x7bbb('0x43')](_0x5b7430['where'],{'$or':[{'key':{'$like':'%'+_0x12ddda[_0x7bbb('0x37')]['filter']+'%'}},{'value':{'$like':'%'+_0x12ddda[_0x7bbb('0x37')]['filter']+'%'}}]});}_0x5b7430=_[_0x7bbb('0x43')]({},_0x5b7430,_0x12ddda[_0x7bbb('0x44')]);var _0x3fcea1={'where':_0x5b7430[_0x7bbb('0x40')]};return db[_0x7bbb('0x45')]['count'](_0x3fcea1)['then'](function(_0x4f5e24){_0x22b3de[_0x7bbb('0x22')]=_0x4f5e24;if(_0x12ddda['query'][_0x7bbb('0x46')]){_0x5b7430['include']=[{'all':!![]}];}return db[_0x7bbb('0x45')][_0x7bbb('0x47')](_0x5b7430);})[_0x7bbb('0x27')](function(_0x4e63a7){_0x22b3de[_0x7bbb('0x48')]=_0x4e63a7;return _0x22b3de;})['then'](respondWithFilteredResult(_0x134404,_0x5b7430))[_0x7bbb('0x49')](handleError(_0x134404,null));};exports[_0x7bbb('0x4a')]=function(_0x3a2149,_0x5d4b4c){var _0x82f57={'raw':!![],'where':{'id':_0x3a2149[_0x7bbb('0x4b')]['id']}},_0x2db49d={};_0x2db49d['model']=_['keys'](db[_0x7bbb('0x45')][_0x7bbb('0x32')]);_0x2db49d[_0x7bbb('0x37')]=_[_0x7bbb('0x36')](_0x3a2149[_0x7bbb('0x37')]);_0x2db49d[_0x7bbb('0x38')]=_[_0x7bbb('0x39')](_0x2db49d['model'],_0x2db49d['query']);_0x82f57[_0x7bbb('0x3a')]=_[_0x7bbb('0x39')](_0x2db49d[_0x7bbb('0x34')],qs[_0x7bbb('0x3b')](_0x3a2149[_0x7bbb('0x37')][_0x7bbb('0x3b')]));_0x82f57[_0x7bbb('0x3a')]=_0x82f57['attributes']['length']?_0x82f57[_0x7bbb('0x3a')]:_0x2db49d[_0x7bbb('0x34')];if(_0x3a2149[_0x7bbb('0x37')][_0x7bbb('0x46')]){_0x82f57[_0x7bbb('0x4c')]=[{'all':!![]}];}_0x82f57=_[_0x7bbb('0x43')]({},_0x82f57,_0x3a2149[_0x7bbb('0x44')]);return db[_0x7bbb('0x45')][_0x7bbb('0x4d')](_0x82f57)['then'](handleEntityNotFound(_0x5d4b4c,null))[_0x7bbb('0x27')](respondWithResult(_0x5d4b4c,null))['catch'](handleError(_0x5d4b4c,null));};exports['update']=function(_0x417adc,_0x58c466){if(_0x417adc[_0x7bbb('0x4e')]['id']){delete _0x417adc[_0x7bbb('0x4e')]['id'];}return db['CannedAnswer'][_0x7bbb('0x4d')]({'where':{'id':_0x417adc[_0x7bbb('0x4b')]['id']}})[_0x7bbb('0x27')](handleEntityNotFound(_0x58c466,null))[_0x7bbb('0x27')](saveUpdates(_0x417adc['body'],null))[_0x7bbb('0x27')](respondWithResult(_0x58c466,null))[_0x7bbb('0x49')](handleError(_0x58c466,null));};exports['destroy']=function(_0x26653f,_0x52a59f){return db[_0x7bbb('0x45')][_0x7bbb('0x4d')]({'where':{'id':_0x26653f['params']['id']}})[_0x7bbb('0x27')](handleEntityNotFound(_0x52a59f,null))['then'](removeEntity(_0x52a59f,null))[_0x7bbb('0x49')](handleError(_0x52a59f,null));};exports[_0x7bbb('0x4f')]=function(_0x4c0c0c,_0x1ab2a3){var _0x49264f={'key':_0x4c0c0c[_0x7bbb('0x4e')][_0x7bbb('0x50')]};if(_0x4c0c0c['body'][_0x7bbb('0x51')]){_0x49264f['MailAccountId']=_0x4c0c0c['body']['MailAccountId'];}else if(_0x4c0c0c[_0x7bbb('0x4e')]['SmsAccountId']){_0x49264f[_0x7bbb('0x52')]=_0x4c0c0c['body'][_0x7bbb('0x52')];}else if(_0x4c0c0c['body'][_0x7bbb('0x53')]){_0x49264f[_0x7bbb('0x53')]=_0x4c0c0c[_0x7bbb('0x4e')]['OpenchannelAccountId'];}else if(_0x4c0c0c[_0x7bbb('0x4e')][_0x7bbb('0x54')]){_0x49264f[_0x7bbb('0x54')]=_0x4c0c0c[_0x7bbb('0x4e')][_0x7bbb('0x54')];}return db[_0x7bbb('0x45')][_0x7bbb('0x4d')]({'where':_0x49264f})['then'](function(_0x4fcc87){if(_0x4fcc87){throw new db[(_0x7bbb('0x55'))][(_0x7bbb('0x56'))](_0x7bbb('0x57'));}return db[_0x7bbb('0x45')][_0x7bbb('0x4f')](_0x4c0c0c[_0x7bbb('0x4e')]);})[_0x7bbb('0x27')](function(_0xe38ee2){var _0x3eb1b1=_0x4c0c0c[_0x7bbb('0x58')][_0x7bbb('0x29')]({'plain':!![]});if(!_0x3eb1b1)throw new Error(_0x7bbb('0x59'));if(_0x3eb1b1[_0x7bbb('0x5a')]===_0x7bbb('0x58')){var _0x19f7be=_0xe38ee2[_0x7bbb('0x29')]({'plain':!![]});return db[_0x7bbb('0x5b')][_0x7bbb('0x4d')]({'where':{'name':_0x7bbb('0x2a'),'userProfileId':_0x3eb1b1['userProfileId']},'raw':!![]})[_0x7bbb('0x27')](function(_0x20908d){if(_0x20908d&&_0x20908d[_0x7bbb('0x5c')]===0x0){return db[_0x7bbb('0x2b')]['create']({'name':_0x19f7be[_0x7bbb('0x2f')],'resourceId':_0x19f7be['id'],'type':_0x20908d[_0x7bbb('0x2f')],'sectionId':_0x20908d['id']},{})[_0x7bbb('0x27')](function(){return _0xe38ee2;});}else{return _0xe38ee2;}})[_0x7bbb('0x49')](function(_0x8dff6f){logger[_0x7bbb('0x2d')](_0x7bbb('0x5d'),_0x8dff6f);throw _0x8dff6f;});}return _0xe38ee2;})[_0x7bbb('0x27')](respondWithResult(_0x1ab2a3,0xc9))[_0x7bbb('0x49')](handleError(_0x1ab2a3,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index c5bb0ef..d7a4900 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 _0x3f70=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1cb894,_0x2c6975){var _0x2739fa=function(_0x36d695){while(--_0x36d695){_0x1cb894['push'](_0x1cb894['shift']());}};_0x2739fa(++_0x2c6975);}(_0x3f70,0x10a));var _0x03f7=function(_0x5c4d3e,_0x1ca349){_0x5c4d3e=_0x5c4d3e-0x0;var _0x4f75df=_0x3f70[_0x5c4d3e];return _0x4f75df;};'use strict';var _=require(_0x03f7('0x0'));var util=require(_0x03f7('0x1'));var logger=require(_0x03f7('0x2'))(_0x03f7('0x3'));var moment=require(_0x03f7('0x4'));var BPromise=require('bluebird');var rp=require(_0x03f7('0x5'));var fs=require('fs');var path=require(_0x03f7('0x6'));var rimraf=require(_0x03f7('0x7'));var config=require('../../config/environment');var attributes=require(_0x03f7('0x8'));module['exports']=function(_0x10b6fc,_0x3b7f0a){return _0x10b6fc[_0x03f7('0x9')](_0x03f7('0xa'),attributes,{'tableName':_0x03f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03f7('0xc'),'collate':_0x03f7('0xd')});}; \ No newline at end of file +var _0x5c22=['../../config/logger','api','moment','request-promise','path','../../config/environment','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x5c22,0x196));var _0x25c2=function(_0xf0a43d,_0x3ae2e8){_0xf0a43d=_0xf0a43d-0x0;var _0x42d963=_0x5c22[_0xf0a43d];return _0x42d963;};'use strict';var _=require(_0x25c2('0x0'));var util=require(_0x25c2('0x1'));var logger=require(_0x25c2('0x2'))(_0x25c2('0x3'));var moment=require(_0x25c2('0x4'));var BPromise=require('bluebird');var rp=require(_0x25c2('0x5'));var fs=require('fs');var path=require(_0x25c2('0x6'));var rimraf=require('rimraf');var config=require(_0x25c2('0x7'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x2035ff,_0x25b8cb){return _0x2035ff['define'](_0x25c2('0x8'),attributes,{'tableName':_0x25c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25c2('0xa'),'collate':_0x25c2('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index acde7a6..006b038 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(_0x4589ac,_0xa0ed07){var _0x5619ed=function(_0x439336){while(--_0x439336){_0x4589ac['push'](_0x4589ac['shift']());}};_0x5619ed(++_0xa0ed07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x3c8166,_0x8e6bc9){var _0x52be2f=function(_0x470870){while(--_0x470870){_0x3c8166['push'](_0x3c8166['shift']());}};_0x52be2f(++_0x8e6bc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 258bd43..b44250c 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 _0xb88b=['./cannedAnswer.controller','isAuthenticated','/:id','post','create','put','update','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e8722,_0x1622e0){var _0x4e53b3=function(_0x511c31){while(--_0x511c31){_0x5e8722['push'](_0x5e8722['shift']());}};_0x4e53b3(++_0x1622e0);}(_0xb88b,0x112));var _0xbb88=function(_0x420675,_0x28b835){_0x420675=_0x420675-0x0;var _0x30eb5d=_0xb88b[_0x420675];return _0x30eb5d;};'use strict';var multer=require('multer');var util=require(_0xbb88('0x0'));var path=require('path');var timeout=require(_0xbb88('0x1'));var express=require(_0xbb88('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb88('0x3'));var interaction=require(_0xbb88('0x4'));var config=require(_0xbb88('0x5'));var controller=require(_0xbb88('0x6'));router['get']('/',auth[_0xbb88('0x7')](),controller['index']);router['get'](_0xbb88('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xbb88('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb88('0xa')]);router[_0xbb88('0xb')](_0xbb88('0x8'),auth['isAuthenticated'](),controller[_0xbb88('0xc')]);router['delete']('/:id',auth[_0xbb88('0x7')](),controller['destroy']);module[_0xbb88('0xd')]=router; \ No newline at end of file +var _0x2e77=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0x2e77,0x1a7));var _0x72e7=function(_0x32249b,_0x11874c){_0x32249b=_0x32249b-0x0;var _0x28c472=_0x2e77[_0x32249b];return _0x28c472;};'use strict';var multer=require(_0x72e7('0x0'));var util=require(_0x72e7('0x1'));var path=require(_0x72e7('0x2'));var timeout=require(_0x72e7('0x3'));var express=require(_0x72e7('0x4'));var router=express[_0x72e7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72e7('0x6'));var config=require(_0x72e7('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x72e7('0x8')]('/:id',auth[_0x72e7('0x9')](),controller[_0x72e7('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x72e7('0xb')]);router['put']('/:id',auth[_0x72e7('0x9')](),controller[_0x72e7('0xc')]);router[_0x72e7('0xd')](_0x72e7('0xe'),auth[_0x72e7('0x9')](),controller[_0x72e7('0xf')]);module[_0x72e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b34f4bc..2706e36 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 _0xb7f1=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xa4f6c8,_0x1b46b5){var _0x6a7a39=function(_0x222ab5){while(--_0x222ab5){_0xa4f6c8['push'](_0xa4f6c8['shift']());}};_0x6a7a39(++_0x1b46b5);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x159637,_0x5796f0){_0x159637=_0x159637-0x0;var _0x470b10=_0xb7f1[_0x159637];return _0x470b10;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x1b7f('0x0')],'allowNull':![],'defaultValue':_0x1b7f('0x1')},'clid':{'type':Sequelize[_0x1b7f('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x1b7f('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x1b7f('0x2')]},'lastapp':{'type':Sequelize[_0x1b7f('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1b7f('0x2')]},'amaflags':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1b7f('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1b7f('0x2')]},'linkedid':{'type':Sequelize[_0x1b7f('0x2')]},'sequence':{'type':Sequelize[_0x1b7f('0x2')]},'peeraccount':{'type':Sequelize[_0x1b7f('0x2')]},'type':{'type':Sequelize[_0x1b7f('0x2')]},'tag':{'type':Sequelize[_0x1b7f('0x2')]}}; \ No newline at end of file +var _0x05e2=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x3565ff,_0x33ed7a){var _0x166c75=function(_0x4ca45e){while(--_0x4ca45e){_0x3565ff['push'](_0x3565ff['shift']());}};_0x166c75(++_0x33ed7a);}(_0x05e2,0x116));var _0x205e=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x05e2[_0x318840];return _0x223da4;};'use strict';var Sequelize=require(_0x205e('0x0'));module[_0x205e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x205e('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x205e('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x205e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x205e('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x205e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x205e('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x205e('0x3')]},'userfield':{'type':Sequelize[_0x205e('0x3')]},'uniqueid':{'type':Sequelize[_0x205e('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x205e('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x205e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e951ce8..6488ff0 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 _0x43fd=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','Content-Range','json','reject','save','update','then','stack','name','send','Cdr','rawAttributes','fieldName','model','map','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x45eb51,_0x15f24d){var _0x4c67a1=function(_0x365a04){while(--_0x365a04){_0x45eb51['push'](_0x45eb51['shift']());}};_0x4c67a1(++_0x15f24d);}(_0x43fd,0x1ec));var _0xd43f=function(_0x371c95,_0x22749a){_0x371c95=_0x371c95-0x0;var _0x53a0b9=_0x43fd[_0x371c95];return _0x53a0b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd43f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd43f('0x1'));var moment=require(_0xd43f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd43f('0x3'));var util=require('util');var path=require(_0xd43f('0x4'));var sox=require(_0xd43f('0x5'));var csv=require(_0xd43f('0x6'));var ejs=require(_0xd43f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd43f('0x8'));var squel=require(_0xd43f('0x9'));var crypto=require(_0xd43f('0xa'));var jsforce=require(_0xd43f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd43f('0x6'));var querystring=require(_0xd43f('0xc'));var Papa=require('papaparse');var Redis=require(_0xd43f('0xd'));var authService=require(_0xd43f('0xe'));var qs=require(_0xd43f('0xf'));var as=require(_0xd43f('0x10'));var hardwareService=require(_0xd43f('0x11'));var logger=require('../../config/logger')(_0xd43f('0x12'));var utils=require(_0xd43f('0x13'));var config=require(_0xd43f('0x14'));var licenseUtil=require(_0xd43f('0x15'));var db=require(_0xd43f('0x16'))['db'];function respondWithStatusCode(_0x396916,_0x22f057){_0x22f057=_0x22f057||0xcc;return function(_0x1a72f1){if(_0x1a72f1){return _0x396916[_0xd43f('0x17')](_0x22f057);}return _0x396916[_0xd43f('0x18')](_0x22f057)[_0xd43f('0x19')]();};}function respondWithResult(_0x504568,_0x3d979d){_0x3d979d=_0x3d979d||0xc8;return function(_0x922f49){if(_0x922f49){return _0x504568[_0xd43f('0x18')](_0x3d979d)['json'](_0x922f49);}};}function respondWithFilteredResult(_0x4c576e,_0x4a2b49){return function(_0x1c729a){if(_0x1c729a){var _0x3ca2d4=typeof _0x4a2b49['offset']===_0xd43f('0x1a')&&typeof _0x4a2b49[_0xd43f('0x1b')]==='undefined';var _0x5ced70=_0x1c729a['count'];var _0x54bbcd=_0x3ca2d4?0x0:_0x4a2b49[_0xd43f('0x1c')];var _0x19784f=_0x3ca2d4?_0x1c729a['count']:_0x4a2b49[_0xd43f('0x1c')]+_0x4a2b49[_0xd43f('0x1b')];var _0x18b862;if(_0x19784f>=_0x5ced70){_0x19784f=_0x5ced70;_0x18b862=0xc8;}else{_0x18b862=0xce;}_0x4c576e[_0xd43f('0x18')](_0x18b862);return _0x4c576e['set'](_0xd43f('0x1d'),_0x54bbcd+'-'+_0x19784f+'/'+_0x5ced70)[_0xd43f('0x1e')](_0x1c729a);}return null;};}function patchUpdates(_0xb37d52){return function(_0x564261){try{jsonpatch['apply'](_0x564261,_0xb37d52,!![]);}catch(_0x5683dc){return BPromise[_0xd43f('0x1f')](_0x5683dc);}return _0x564261[_0xd43f('0x20')]();};}function saveUpdates(_0x2c1ba9,_0x399cb8){return function(_0x3b1094){if(_0x3b1094){return _0x3b1094[_0xd43f('0x21')](_0x2c1ba9)[_0xd43f('0x22')](function(_0x5a5c10){return _0x5a5c10;});}return null;};}function removeEntity(_0x262023,_0x4a1d8b){return function(_0x352102){if(_0x352102){return _0x352102['destroy']()['then'](function(){_0x262023[_0xd43f('0x18')](0xcc)[_0xd43f('0x19')]();});}};}function handleEntityNotFound(_0x2a9ce4,_0x2a38f6){return function(_0x35acd0){if(!_0x35acd0){_0x2a9ce4[_0xd43f('0x17')](0x194);}return _0x35acd0;};}function handleError(_0x2563c0,_0xc2e3da){_0xc2e3da=_0xc2e3da||0x1f4;return function(_0x2dcbf2){logger['error'](_0x2dcbf2[_0xd43f('0x23')]);if(_0x2dcbf2[_0xd43f('0x24')]){delete _0x2dcbf2[_0xd43f('0x24')];}_0x2563c0[_0xd43f('0x18')](_0xc2e3da)[_0xd43f('0x25')](_0x2dcbf2);};}exports['index']=function(_0x161540,_0x7b6761){var _0x285b86={},_0x1dd81f={},_0x1ee70d={'count':0x0,'rows':[]};var _0x5a7580=_['map'](db[_0xd43f('0x26')][_0xd43f('0x27')],function(_0x5efbbd){return{'name':_0x5efbbd[_0xd43f('0x28')],'type':_0x5efbbd['type']['key']};});_0x1dd81f[_0xd43f('0x29')]=_[_0xd43f('0x2a')](_0x5a7580,_0xd43f('0x24'));_0x1dd81f['query']=_[_0xd43f('0x2b')](_0x161540[_0xd43f('0x2c')]);_0x1dd81f['filters']=_['intersection'](_0x1dd81f[_0xd43f('0x29')],_0x1dd81f[_0xd43f('0x2c')]);_0x285b86[_0xd43f('0x2d')]=_[_0xd43f('0x2e')](_0x1dd81f['model'],qs[_0xd43f('0x2f')](_0x161540[_0xd43f('0x2c')][_0xd43f('0x2f')]));_0x285b86[_0xd43f('0x2d')]=_0x285b86[_0xd43f('0x2d')][_0xd43f('0x30')]?_0x285b86[_0xd43f('0x2d')]:_0x1dd81f['model'];if(!_0x161540[_0xd43f('0x2c')]['hasOwnProperty'](_0xd43f('0x31'))){_0x285b86[_0xd43f('0x1b')]=qs[_0xd43f('0x1b')](_0x161540['query'][_0xd43f('0x1b')]);_0x285b86[_0xd43f('0x1c')]=qs['offset'](_0x161540[_0xd43f('0x2c')][_0xd43f('0x1c')]);}_0x285b86[_0xd43f('0x32')]=qs['sort'](_0x161540[_0xd43f('0x2c')][_0xd43f('0x33')]);_0x285b86[_0xd43f('0x34')]=qs[_0xd43f('0x35')](_[_0xd43f('0x36')](_0x161540['query'],_0x1dd81f[_0xd43f('0x35')]),_0x5a7580);if(_0x161540['query'][_0xd43f('0x37')]){_0x285b86[_0xd43f('0x34')]=_[_0xd43f('0x38')](_0x285b86['where'],{'$or':_[_0xd43f('0x2a')](_0x5a7580,function(_0x428da4){if(_0x428da4['type']!==_0xd43f('0x39')){var _0x53c8bf={};_0x53c8bf[_0x428da4['name']]={'$like':'%'+_0x161540[_0xd43f('0x2c')]['filter']+'%'};return _0x53c8bf;}})});}_0x285b86=_['merge']({},_0x285b86,_0x161540[_0xd43f('0x3a')]);var _0x57c338={'where':_0x285b86['where']};return db[_0xd43f('0x26')][_0xd43f('0x3b')](_0x57c338)[_0xd43f('0x22')](function(_0x92b404){_0x1ee70d[_0xd43f('0x3b')]=_0x92b404;if(_0x161540['query'][_0xd43f('0x3c')]){_0x285b86[_0xd43f('0x3d')]=[{'all':!![]}];}return db[_0xd43f('0x26')][_0xd43f('0x3e')](_0x285b86);})[_0xd43f('0x22')](function(_0x3ab035){_0x1ee70d[_0xd43f('0x3f')]=_0x3ab035;return _0x1ee70d;})[_0xd43f('0x22')](respondWithFilteredResult(_0x7b6761,_0x285b86))[_0xd43f('0x40')](handleError(_0x7b6761,null));};exports[_0xd43f('0x41')]=function(_0x37f496,_0x5105d2){var _0x3c23cd={'raw':!![],'where':{'id':_0x37f496['params']['id']}},_0x33c4b5={};_0x33c4b5['model']=_[_0xd43f('0x2b')](db[_0xd43f('0x26')][_0xd43f('0x27')]);_0x33c4b5['query']=_[_0xd43f('0x2b')](_0x37f496[_0xd43f('0x2c')]);_0x33c4b5[_0xd43f('0x35')]=_[_0xd43f('0x2e')](_0x33c4b5['model'],_0x33c4b5['query']);_0x3c23cd[_0xd43f('0x2d')]=_[_0xd43f('0x2e')](_0x33c4b5[_0xd43f('0x29')],qs['fields'](_0x37f496[_0xd43f('0x2c')][_0xd43f('0x2f')]));_0x3c23cd[_0xd43f('0x2d')]=_0x3c23cd[_0xd43f('0x2d')][_0xd43f('0x30')]?_0x3c23cd[_0xd43f('0x2d')]:_0x33c4b5[_0xd43f('0x29')];if(_0x37f496[_0xd43f('0x2c')]['includeAll']){_0x3c23cd[_0xd43f('0x3d')]=[{'all':!![]}];}_0x3c23cd=_[_0xd43f('0x38')]({},_0x3c23cd,_0x37f496[_0xd43f('0x3a')]);return db[_0xd43f('0x26')][_0xd43f('0x42')](_0x3c23cd)[_0xd43f('0x22')](handleEntityNotFound(_0x5105d2,null))[_0xd43f('0x22')](respondWithResult(_0x5105d2,null))[_0xd43f('0x40')](handleError(_0x5105d2,null));};exports[_0xd43f('0x43')]=function(_0x32537a,_0x3a17fe){return db['Cdr'][_0xd43f('0x43')](_0x32537a[_0xd43f('0x44')],{})[_0xd43f('0x22')](respondWithResult(_0x3a17fe,0xc9))[_0xd43f('0x40')](handleError(_0x3a17fe,null));};exports[_0xd43f('0x21')]=function(_0x4763b7,_0x54eaa2){if(_0x4763b7[_0xd43f('0x44')]['id']){delete _0x4763b7['body']['id'];}return db[_0xd43f('0x26')]['find']({'where':{'id':_0x4763b7[_0xd43f('0x45')]['id']}})[_0xd43f('0x22')](handleEntityNotFound(_0x54eaa2,null))[_0xd43f('0x22')](saveUpdates(_0x4763b7[_0xd43f('0x44')],null))[_0xd43f('0x22')](respondWithResult(_0x54eaa2,null))[_0xd43f('0x40')](handleError(_0x54eaa2,null));};exports[_0xd43f('0x46')]=function(_0x31b9cc,_0x1f7b2f){return db['Cdr'][_0xd43f('0x42')]({'where':{'id':_0x31b9cc[_0xd43f('0x45')]['id']}})[_0xd43f('0x22')](handleEntityNotFound(_0x1f7b2f,null))[_0xd43f('0x22')](removeEntity(_0x1f7b2f,null))[_0xd43f('0x40')](handleError(_0x1f7b2f,null));};exports[_0xd43f('0x47')]=function(_0x39bee7,_0x3489f9){return db[_0xd43f('0x26')][_0xd43f('0x47')]()[_0xd43f('0x22')](respondWithResult(_0x3489f9,null))['catch'](handleError(_0x3489f9,null));}; \ No newline at end of file +var _0x6334=['ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','catch','show','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x1d3c6c,_0x56562e){var _0x3c215b=function(_0x4b4c39){while(--_0x4b4c39){_0x1d3c6c['push'](_0x1d3c6c['shift']());}};_0x3c215b(++_0x56562e);}(_0x6334,0x119));var _0x4633=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0x6334[_0x5ecff9];return _0x5e1415;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require(_0x4633('0x1'));var zipdir=require(_0x4633('0x2'));var jsonpatch=require(_0x4633('0x3'));var rp=require(_0x4633('0x4'));var moment=require(_0x4633('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4633('0x6'));var util=require(_0x4633('0x7'));var path=require(_0x4633('0x8'));var sox=require(_0x4633('0x9'));var csv=require(_0x4633('0xa'));var ejs=require(_0x4633('0xb'));var fs=require('fs');var fs_extra=require(_0x4633('0xc'));var _=require('lodash');var squel=require(_0x4633('0xd'));var crypto=require('crypto');var jsforce=require(_0x4633('0xe'));var deskjs=require(_0x4633('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4633('0x10'));var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4633('0x13'));var as=require(_0x4633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x15'))(_0x4633('0x16'));var utils=require(_0x4633('0x17'));var config=require(_0x4633('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4633('0x19'))['db'];function respondWithStatusCode(_0xad405,_0x438e87){_0x438e87=_0x438e87||0xcc;return function(_0x48e92c){if(_0x48e92c){return _0xad405['sendStatus'](_0x438e87);}return _0xad405['status'](_0x438e87)[_0x4633('0x1a')]();};}function respondWithResult(_0x1fd00c,_0x579229){_0x579229=_0x579229||0xc8;return function(_0x52955e){if(_0x52955e){return _0x1fd00c[_0x4633('0x1b')](_0x579229)['json'](_0x52955e);}};}function respondWithFilteredResult(_0xcdffcc,_0x33b6e7){return function(_0x2e2dc3){if(_0x2e2dc3){var _0x11fef9=typeof _0x33b6e7['offset']===_0x4633('0x1c')&&typeof _0x33b6e7[_0x4633('0x1d')]===_0x4633('0x1c');var _0x4ffad5=_0x2e2dc3[_0x4633('0x1e')];var _0x37e536=_0x11fef9?0x0:_0x33b6e7[_0x4633('0x1f')];var _0x2ad562=_0x11fef9?_0x2e2dc3[_0x4633('0x1e')]:_0x33b6e7['offset']+_0x33b6e7[_0x4633('0x1d')];var _0xfe3446;if(_0x2ad562>=_0x4ffad5){_0x2ad562=_0x4ffad5;_0xfe3446=0xc8;}else{_0xfe3446=0xce;}_0xcdffcc['status'](_0xfe3446);return _0xcdffcc['set'](_0x4633('0x20'),_0x37e536+'-'+_0x2ad562+'/'+_0x4ffad5)['json'](_0x2e2dc3);}return null;};}function patchUpdates(_0x35e2ad){return function(_0x5b5011){try{jsonpatch['apply'](_0x5b5011,_0x35e2ad,!![]);}catch(_0x109472){return BPromise[_0x4633('0x21')](_0x109472);}return _0x5b5011[_0x4633('0x22')]();};}function saveUpdates(_0x604f3d,_0xd1fcc6){return function(_0x2d46f7){if(_0x2d46f7){return _0x2d46f7['update'](_0x604f3d)[_0x4633('0x23')](function(_0x562e26){return _0x562e26;});}return null;};}function removeEntity(_0x22d9c1,_0xcfac3f){return function(_0xe77cfc){if(_0xe77cfc){return _0xe77cfc[_0x4633('0x24')]()[_0x4633('0x23')](function(){_0x22d9c1['status'](0xcc)[_0x4633('0x1a')]();});}};}function handleEntityNotFound(_0x399220,_0x37e3c4){return function(_0x13ec10){if(!_0x13ec10){_0x399220[_0x4633('0x25')](0x194);}return _0x13ec10;};}function handleError(_0x471d13,_0x1ba1ed){_0x1ba1ed=_0x1ba1ed||0x1f4;return function(_0x368582){logger[_0x4633('0x26')](_0x368582[_0x4633('0x27')]);if(_0x368582[_0x4633('0x28')]){delete _0x368582[_0x4633('0x28')];}_0x471d13[_0x4633('0x1b')](_0x1ba1ed)[_0x4633('0x29')](_0x368582);};}exports[_0x4633('0x2a')]=function(_0x3f03aa,_0x20ca8b){var _0x139e5e={},_0x5de12a={},_0x197aa6={'count':0x0,'rows':[]};var _0x101371=_[_0x4633('0x2b')](db[_0x4633('0x2c')][_0x4633('0x2d')],function(_0x182e12){return{'name':_0x182e12['fieldName'],'type':_0x182e12[_0x4633('0x2e')]['key']};});_0x5de12a[_0x4633('0x2f')]=_[_0x4633('0x2b')](_0x101371,_0x4633('0x28'));_0x5de12a[_0x4633('0x30')]=_[_0x4633('0x31')](_0x3f03aa[_0x4633('0x30')]);_0x5de12a[_0x4633('0x32')]=_[_0x4633('0x33')](_0x5de12a[_0x4633('0x2f')],_0x5de12a[_0x4633('0x30')]);_0x139e5e[_0x4633('0x34')]=_[_0x4633('0x33')](_0x5de12a[_0x4633('0x2f')],qs[_0x4633('0x35')](_0x3f03aa['query']['fields']));_0x139e5e[_0x4633('0x34')]=_0x139e5e[_0x4633('0x34')]['length']?_0x139e5e[_0x4633('0x34')]:_0x5de12a[_0x4633('0x2f')];if(!_0x3f03aa[_0x4633('0x30')][_0x4633('0x36')]('nolimit')){_0x139e5e[_0x4633('0x1d')]=qs['limit'](_0x3f03aa[_0x4633('0x30')][_0x4633('0x1d')]);_0x139e5e[_0x4633('0x1f')]=qs[_0x4633('0x1f')](_0x3f03aa[_0x4633('0x30')][_0x4633('0x1f')]);}_0x139e5e[_0x4633('0x37')]=qs[_0x4633('0x38')](_0x3f03aa['query'][_0x4633('0x38')]);_0x139e5e[_0x4633('0x39')]=qs['filters'](_[_0x4633('0x3a')](_0x3f03aa[_0x4633('0x30')],_0x5de12a[_0x4633('0x32')]),_0x101371);if(_0x3f03aa[_0x4633('0x30')]['filter']){_0x139e5e['where']=_[_0x4633('0x3b')](_0x139e5e['where'],{'$or':_['map'](_0x101371,function(_0x464533){if(_0x464533['type']!=='VIRTUAL'){var _0x1aaf65={};_0x1aaf65[_0x464533[_0x4633('0x28')]]={'$like':'%'+_0x3f03aa[_0x4633('0x30')][_0x4633('0x3c')]+'%'};return _0x1aaf65;}})});}_0x139e5e=_[_0x4633('0x3b')]({},_0x139e5e,_0x3f03aa['options']);var _0x6873d0={'where':_0x139e5e['where']};return db[_0x4633('0x2c')][_0x4633('0x1e')](_0x6873d0)[_0x4633('0x23')](function(_0x402708){_0x197aa6['count']=_0x402708;if(_0x3f03aa[_0x4633('0x30')]['includeAll']){_0x139e5e[_0x4633('0x3d')]=[{'all':!![]}];}return db[_0x4633('0x2c')][_0x4633('0x3e')](_0x139e5e);})[_0x4633('0x23')](function(_0x350e46){_0x197aa6['rows']=_0x350e46;return _0x197aa6;})['then'](respondWithFilteredResult(_0x20ca8b,_0x139e5e))[_0x4633('0x3f')](handleError(_0x20ca8b,null));};exports[_0x4633('0x40')]=function(_0x8b0d9,_0xf51de3){var _0x45fe39={'raw':!![],'where':{'id':_0x8b0d9[_0x4633('0x41')]['id']}},_0x53669c={};_0x53669c['model']=_[_0x4633('0x31')](db['Cdr'][_0x4633('0x2d')]);_0x53669c['query']=_[_0x4633('0x31')](_0x8b0d9[_0x4633('0x30')]);_0x53669c[_0x4633('0x32')]=_[_0x4633('0x33')](_0x53669c[_0x4633('0x2f')],_0x53669c[_0x4633('0x30')]);_0x45fe39[_0x4633('0x34')]=_[_0x4633('0x33')](_0x53669c[_0x4633('0x2f')],qs[_0x4633('0x35')](_0x8b0d9[_0x4633('0x30')][_0x4633('0x35')]));_0x45fe39[_0x4633('0x34')]=_0x45fe39[_0x4633('0x34')][_0x4633('0x42')]?_0x45fe39[_0x4633('0x34')]:_0x53669c[_0x4633('0x2f')];if(_0x8b0d9[_0x4633('0x30')][_0x4633('0x43')]){_0x45fe39[_0x4633('0x3d')]=[{'all':!![]}];}_0x45fe39=_[_0x4633('0x3b')]({},_0x45fe39,_0x8b0d9['options']);return db['Cdr'][_0x4633('0x44')](_0x45fe39)['then'](handleEntityNotFound(_0xf51de3,null))['then'](respondWithResult(_0xf51de3,null))['catch'](handleError(_0xf51de3,null));};exports[_0x4633('0x45')]=function(_0x5dec28,_0x5cb4cc){return db[_0x4633('0x2c')][_0x4633('0x45')](_0x5dec28[_0x4633('0x46')],{})[_0x4633('0x23')](respondWithResult(_0x5cb4cc,0xc9))[_0x4633('0x3f')](handleError(_0x5cb4cc,null));};exports[_0x4633('0x47')]=function(_0x4d3cf4,_0x4ca3d6){if(_0x4d3cf4['body']['id']){delete _0x4d3cf4[_0x4633('0x46')]['id'];}return db[_0x4633('0x2c')][_0x4633('0x44')]({'where':{'id':_0x4d3cf4['params']['id']}})[_0x4633('0x23')](handleEntityNotFound(_0x4ca3d6,null))[_0x4633('0x23')](saveUpdates(_0x4d3cf4['body'],null))[_0x4633('0x23')](respondWithResult(_0x4ca3d6,null))[_0x4633('0x3f')](handleError(_0x4ca3d6,null));};exports[_0x4633('0x24')]=function(_0x4c5367,_0x47e03a){return db[_0x4633('0x2c')][_0x4633('0x44')]({'where':{'id':_0x4c5367[_0x4633('0x41')]['id']}})[_0x4633('0x23')](handleEntityNotFound(_0x47e03a,null))[_0x4633('0x23')](removeEntity(_0x47e03a,null))['catch'](handleError(_0x47e03a,null));};exports[_0x4633('0x48')]=function(_0xf812ca,_0x2108b3){return db[_0x4633('0x2c')][_0x4633('0x48')]()[_0x4633('0x23')](respondWithResult(_0x2108b3,null))['catch'](handleError(_0x2108b3,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6f49223..8a0220a 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(_0x3929dc,_0x5a395a){var _0x2df969=function(_0x58fde7){while(--_0x58fde7){_0x3929dc['push'](_0x3929dc['shift']());}};_0x2df969(++_0x5a395a);}(_0x7a54,0x106));var _0x47a5=function(_0x1a052a,_0x4f2504){_0x1a052a=_0x1a052a-0x0;var _0x4c51b5=_0x7a54[_0x1a052a];return _0x4c51b5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x78fa92,_0x58b005){var _0x19da5f=function(_0x228c73){while(--_0x228c73){_0x78fa92['push'](_0x78fa92['shift']());}};_0x19da5f(++_0x58b005);}(_0x7a54,0x106));var _0x47a5=function(_0x2cce36,_0x4ab861){_0x2cce36=_0x2cce36-0x0;var _0x2d09e5=_0x7a54[_0x2cce36];return _0x2d09e5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1e5ff25..ea45389 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 _0x4625=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x289139,_0x1332ea){var _0xe24e28=function(_0xc0d6e5){while(--_0xc0d6e5){_0x289139['push'](_0x289139['shift']());}};_0xe24e28(++_0x1332ea);}(_0x4625,0xd1));var _0x5462=function(_0x59b78c,_0x594ec8){_0x59b78c=_0x59b78c-0x0;var _0x5d3fac=_0x4625[_0x59b78c];return _0x5d3fac;};'use strict';var _=require(_0x5462('0x0'));var util=require(_0x5462('0x1'));var moment=require(_0x5462('0x2'));var BPromise=require(_0x5462('0x3'));var rs=require(_0x5462('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5462('0x5'));var logger=require(_0x5462('0x6'))(_0x5462('0x7'));var config=require(_0x5462('0x8'));var jayson=require(_0x5462('0x9'));var client=jayson[_0x5462('0xa')][_0x5462('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208646,_0x305514,_0x19a2d4){return new BPromise(function(_0x3fc74c,_0x314e20){return client[_0x5462('0xc')](_0x208646,_0x19a2d4)[_0x5462('0xd')](function(_0x5eeb33){logger[_0x5462('0xe')](_0x5462('0xf'),_0x305514,'request\x20sent');logger[_0x5462('0x10')](_0x5462('0x11'),_0x305514,_0x5462('0x12'),JSON[_0x5462('0x13')](_0x5eeb33));if(_0x5eeb33[_0x5462('0x14')]){if(_0x5eeb33[_0x5462('0x14')][_0x5462('0x15')]===0x1f4){logger['error'](_0x5462('0xf'),_0x305514,_0x5eeb33['error'][_0x5462('0x16')]);return _0x314e20(_0x5eeb33['error'][_0x5462('0x16')]);}logger[_0x5462('0x14')](_0x5462('0xf'),_0x305514,_0x5eeb33[_0x5462('0x14')][_0x5462('0x16')]);return _0x3fc74c(_0x5eeb33[_0x5462('0x14')][_0x5462('0x16')]);}else{logger[_0x5462('0xe')](_0x5462('0xf'),_0x305514,_0x5462('0x12'));_0x3fc74c(_0x5eeb33[_0x5462('0x17')]['message']);}})['catch'](function(_0x57d882){logger['error'](_0x5462('0xf'),_0x305514,_0x57d882);_0x314e20(_0x57d882);});});} \ No newline at end of file +var _0x300e=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x52ed77,_0x44102b){var _0xd01250=function(_0x45275b){while(--_0x45275b){_0x52ed77['push'](_0x52ed77['shift']());}};_0xd01250(++_0x44102b);}(_0x300e,0x71));var _0xe300=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x300e[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xe300('0x0'));var util=require(_0xe300('0x1'));var moment=require('moment');var BPromise=require(_0xe300('0x2'));var rs=require(_0xe300('0x3'));var fs=require('fs');var Redis=require(_0xe300('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe300('0x5'));var config=require(_0xe300('0x6'));var jayson=require(_0xe300('0x7'));var client=jayson[_0xe300('0x8')][_0xe300('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6e75b1,_0x1619c3,_0x226d7c){return new BPromise(function(_0x266ba2,_0x2e0943){return client[_0xe300('0xa')](_0x6e75b1,_0x226d7c)[_0xe300('0xb')](function(_0x14b49a){logger[_0xe300('0xc')](_0xe300('0xd'),_0x1619c3,_0xe300('0xe'));logger[_0xe300('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1619c3,_0xe300('0xe'),JSON[_0xe300('0x10')](_0x14b49a));if(_0x14b49a['error']){if(_0x14b49a[_0xe300('0x11')][_0xe300('0x12')]===0x1f4){logger[_0xe300('0x11')](_0xe300('0xd'),_0x1619c3,_0x14b49a[_0xe300('0x11')][_0xe300('0x13')]);return _0x2e0943(_0x14b49a['error'][_0xe300('0x13')]);}logger[_0xe300('0x11')](_0xe300('0xd'),_0x1619c3,_0x14b49a[_0xe300('0x11')][_0xe300('0x13')]);return _0x266ba2(_0x14b49a[_0xe300('0x11')]['message']);}else{logger[_0xe300('0xc')](_0xe300('0xd'),_0x1619c3,_0xe300('0xe'));_0x266ba2(_0x14b49a['result'][_0xe300('0x13')]);}})[_0xe300('0x14')](function(_0x58f0f6){logger[_0xe300('0x11')](_0xe300('0xd'),_0x1619c3,_0x58f0f6);_0x2e0943(_0x58f0f6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0c9a574..f0b43f4 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x29a08d,_0x551eca){var _0x10fc1a=function(_0x4a2117){while(--_0x4a2117){_0x29a08d['push'](_0x29a08d['shift']());}};_0x10fc1a(++_0x551eca);}(_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 799a06c..29624a9 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 _0x7d7f=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0x30ac8a,_0x3f1b4a){var _0x517ef0=function(_0x201310){while(--_0x201310){_0x30ac8a['push'](_0x30ac8a['shift']());}};_0x517ef0(++_0x3f1b4a);}(_0x7d7f,0xb2));var _0xf7d7=function(_0x32a6a4,_0x1a434c){_0x32a6a4=_0x32a6a4-0x0;var _0x2083d9=_0x7d7f[_0x32a6a4];return _0x2083d9;};'use strict';var Sequelize=require(_0xf7d7('0x0'));module[_0xf7d7('0x1')]={'priority':{'type':Sequelize[_0xf7d7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf7d7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf7d7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf7d7('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5bc5=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x2bd0d7,_0x158fb3){var _0x3f3d78=function(_0x204a96){while(--_0x204a96){_0x2bd0d7['push'](_0x2bd0d7['shift']());}};_0x3f3d78(++_0x158fb3);}(_0x5bc5,0x104));var _0x55bc=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x5bc5[_0x4e697a];return _0x88850c;};'use strict';var Sequelize=require(_0x55bc('0x0'));module[_0x55bc('0x1')]={'priority':{'type':Sequelize[_0x55bc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x55bc('0x3')],'allowNull':![],'defaultValue':_0x55bc('0x4')},'appdata':{'type':Sequelize[_0x55bc('0x5')]()},'description':{'type':Sequelize[_0x55bc('0x3')]},'interval':{'type':Sequelize[_0x55bc('0x3')],'defaultValue':_0x55bc('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ca7882d..23a9102 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 _0xc817=['bluebird','mustache','util','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','keys','intersection','query','attributes','fields','include','merge','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0xba4839,_0x575d37){var _0x1969c8=function(_0x23846f){while(--_0x23846f){_0xba4839['push'](_0xba4839['shift']());}};_0x1969c8(++_0x575d37);}(_0xc817,0x75));var _0x7c81=function(_0x20df2b,_0x5dfbfe){_0x20df2b=_0x20df2b-0x0;var _0x1851b8=_0xc817[_0x20df2b];return _0x1851b8;};'use strict';var emlformat=require(_0x7c81('0x0'));var rimraf=require(_0x7c81('0x1'));var zipdir=require(_0x7c81('0x2'));var jsonpatch=require(_0x7c81('0x3'));var rp=require('request-promise');var moment=require(_0x7c81('0x4'));var BPromise=require(_0x7c81('0x5'));var Mustache=require(_0x7c81('0x6'));var util=require(_0x7c81('0x7'));var path=require(_0x7c81('0x8'));var sox=require(_0x7c81('0x9'));var csv=require('to-csv');var ejs=require(_0x7c81('0xa'));var fs=require('fs');var fs_extra=require(_0x7c81('0xb'));var _=require('lodash');var squel=require(_0x7c81('0xc'));var crypto=require(_0x7c81('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c81('0xe'));var toCsv=require(_0x7c81('0xf'));var querystring=require(_0x7c81('0x10'));var Papa=require(_0x7c81('0x11'));var Redis=require(_0x7c81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7c81('0x13'));var as=require(_0x7c81('0x14'));var hardwareService=require(_0x7c81('0x15'));var logger=require(_0x7c81('0x16'))(_0x7c81('0x17'));var utils=require(_0x7c81('0x18'));var config=require(_0x7c81('0x19'));var licenseUtil=require(_0x7c81('0x1a'));var db=require(_0x7c81('0x1b'))['db'];function respondWithStatusCode(_0x1f7771,_0xe463e){_0xe463e=_0xe463e||0xcc;return function(_0x1f7b5c){if(_0x1f7b5c){return _0x1f7771[_0x7c81('0x1c')](_0xe463e);}return _0x1f7771[_0x7c81('0x1d')](_0xe463e)[_0x7c81('0x1e')]();};}function respondWithResult(_0xebb73,_0x9362c4){_0x9362c4=_0x9362c4||0xc8;return function(_0x1abf26){if(_0x1abf26){return _0xebb73[_0x7c81('0x1d')](_0x9362c4)['json'](_0x1abf26);}};}function respondWithFilteredResult(_0x439b1c,_0x18aefa){return function(_0x2f3de2){if(_0x2f3de2){var _0x1021f8=typeof _0x18aefa[_0x7c81('0x1f')]===_0x7c81('0x20')&&typeof _0x18aefa[_0x7c81('0x21')]===_0x7c81('0x20');var _0x266bb0=_0x2f3de2['count'];var _0x14cce5=_0x1021f8?0x0:_0x18aefa[_0x7c81('0x1f')];var _0xfd62e=_0x1021f8?_0x2f3de2[_0x7c81('0x22')]:_0x18aefa['offset']+_0x18aefa[_0x7c81('0x21')];var _0x2e2b44;if(_0xfd62e>=_0x266bb0){_0xfd62e=_0x266bb0;_0x2e2b44=0xc8;}else{_0x2e2b44=0xce;}_0x439b1c[_0x7c81('0x1d')](_0x2e2b44);return _0x439b1c[_0x7c81('0x23')](_0x7c81('0x24'),_0x14cce5+'-'+_0xfd62e+'/'+_0x266bb0)['json'](_0x2f3de2);}return null;};}function patchUpdates(_0x679b81){return function(_0x1a9cee){try{jsonpatch[_0x7c81('0x25')](_0x1a9cee,_0x679b81,!![]);}catch(_0x35761d){return BPromise[_0x7c81('0x26')](_0x35761d);}return _0x1a9cee['save']();};}function saveUpdates(_0x887753,_0x198390){return function(_0x4704e9){if(_0x4704e9){return _0x4704e9[_0x7c81('0x27')](_0x887753)['then'](function(_0x3bdca5){return _0x3bdca5;});}return null;};}function removeEntity(_0x53bdb2,_0x4ecf3b){return function(_0x53f49c){if(_0x53f49c){return _0x53f49c[_0x7c81('0x28')]()['then'](function(){_0x53bdb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x349b5c,_0x5e707e){return function(_0x23de92){if(!_0x23de92){_0x349b5c[_0x7c81('0x1c')](0x194);}return _0x23de92;};}function handleError(_0x2e166f,_0x596d69){_0x596d69=_0x596d69||0x1f4;return function(_0xaedec){logger[_0x7c81('0x29')](_0xaedec[_0x7c81('0x2a')]);if(_0xaedec[_0x7c81('0x2b')]){delete _0xaedec[_0x7c81('0x2b')];}_0x2e166f[_0x7c81('0x1d')](_0x596d69)['send'](_0xaedec);};}exports[_0x7c81('0x2c')]=function(_0x5c8206,_0x2089c4){var _0x4f00be={'raw':!![],'where':{'id':_0x5c8206[_0x7c81('0x2d')]['id']}},_0x32c30f={};_0x32c30f[_0x7c81('0x2e')]=_['keys'](db[_0x7c81('0x2f')][_0x7c81('0x30')]);_0x32c30f['query']=_[_0x7c81('0x31')](_0x5c8206['query']);_0x32c30f['filters']=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],_0x32c30f[_0x7c81('0x33')]);_0x4f00be[_0x7c81('0x34')]=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],qs[_0x7c81('0x35')](_0x5c8206[_0x7c81('0x33')]['fields']));_0x4f00be[_0x7c81('0x34')]=_0x4f00be[_0x7c81('0x34')]['length']?_0x4f00be[_0x7c81('0x34')]:_0x32c30f[_0x7c81('0x2e')];if(_0x5c8206[_0x7c81('0x33')]['includeAll']){_0x4f00be[_0x7c81('0x36')]=[{'all':!![]}];}_0x4f00be=_[_0x7c81('0x37')]({},_0x4f00be,_0x5c8206[_0x7c81('0x38')]);return db[_0x7c81('0x2f')][_0x7c81('0x39')](_0x4f00be)[_0x7c81('0x3a')](handleEntityNotFound(_0x2089c4,null))[_0x7c81('0x3a')](respondWithResult(_0x2089c4,null))[_0x7c81('0x3b')](handleError(_0x2089c4,null));};exports[_0x7c81('0x27')]=function(_0x2dcef6,_0x3a5351){if(_0x2dcef6[_0x7c81('0x3c')]['id']){delete _0x2dcef6[_0x7c81('0x3c')]['id'];}return db['ChatApplication'][_0x7c81('0x39')]({'where':{'id':_0x2dcef6[_0x7c81('0x2d')]['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x3a5351,null))[_0x7c81('0x3a')](saveUpdates(_0x2dcef6[_0x7c81('0x3c')],null))['then'](respondWithResult(_0x3a5351,null))['catch'](handleError(_0x3a5351,null));};exports[_0x7c81('0x28')]=function(_0x3bcd76,_0x397a61){return db[_0x7c81('0x2f')][_0x7c81('0x39')]({'where':{'id':_0x3bcd76['params']['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x397a61,null))[_0x7c81('0x3a')](removeEntity(_0x397a61,null))[_0x7c81('0x3b')](handleError(_0x397a61,null));}; \ No newline at end of file +var _0x0834=['fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','reject','save','then','end','error','stack','name','send','show','params','ChatApplication','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','includeAll','merge','options','find','catch','body','destroy','zip-dir'];(function(_0x4d3e97,_0x749913){var _0x3147d7=function(_0x250599){while(--_0x250599){_0x4d3e97['push'](_0x4d3e97['shift']());}};_0x3147d7(++_0x749913);}(_0x0834,0x18e));var _0x4083=function(_0x1e29da,_0x59de16){_0x1e29da=_0x1e29da-0x0;var _0xdeadb7=_0x0834[_0x1e29da];return _0xdeadb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4083('0x0'));var jsonpatch=require(_0x4083('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4083('0x2'));var util=require(_0x4083('0x3'));var path=require('path');var sox=require(_0x4083('0x4'));var csv=require(_0x4083('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4083('0x6'));var _=require('lodash');var squel=require(_0x4083('0x7'));var crypto=require(_0x4083('0x8'));var jsforce=require(_0x4083('0x9'));var deskjs=require(_0x4083('0xa'));var toCsv=require(_0x4083('0x5'));var querystring=require(_0x4083('0xb'));var Papa=require(_0x4083('0xc'));var Redis=require(_0x4083('0xd'));var authService=require(_0x4083('0xe'));var qs=require(_0x4083('0xf'));var as=require(_0x4083('0x10'));var hardwareService=require(_0x4083('0x11'));var logger=require(_0x4083('0x12'))(_0x4083('0x13'));var utils=require(_0x4083('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4083('0x15'))['db'];function respondWithStatusCode(_0x3dfd39,_0x4e6fb2){_0x4e6fb2=_0x4e6fb2||0xcc;return function(_0x2a24ac){if(_0x2a24ac){return _0x3dfd39[_0x4083('0x16')](_0x4e6fb2);}return _0x3dfd39[_0x4083('0x17')](_0x4e6fb2)['end']();};}function respondWithResult(_0x4bef74,_0xb5badb){_0xb5badb=_0xb5badb||0xc8;return function(_0x392f82){if(_0x392f82){return _0x4bef74['status'](_0xb5badb)[_0x4083('0x18')](_0x392f82);}};}function respondWithFilteredResult(_0x316e54,_0xc7c267){return function(_0x146632){if(_0x146632){var _0x38757d=typeof _0xc7c267['offset']===_0x4083('0x19')&&typeof _0xc7c267[_0x4083('0x1a')]===_0x4083('0x19');var _0x2658b0=_0x146632['count'];var _0x4e7d59=_0x38757d?0x0:_0xc7c267['offset'];var _0xafda0c=_0x38757d?_0x146632[_0x4083('0x1b')]:_0xc7c267['offset']+_0xc7c267[_0x4083('0x1a')];var _0x4a16dc;if(_0xafda0c>=_0x2658b0){_0xafda0c=_0x2658b0;_0x4a16dc=0xc8;}else{_0x4a16dc=0xce;}_0x316e54[_0x4083('0x17')](_0x4a16dc);return _0x316e54[_0x4083('0x1c')](_0x4083('0x1d'),_0x4e7d59+'-'+_0xafda0c+'/'+_0x2658b0)[_0x4083('0x18')](_0x146632);}return null;};}function patchUpdates(_0x4b32e9){return function(_0x3b29b1){try{jsonpatch['apply'](_0x3b29b1,_0x4b32e9,!![]);}catch(_0x3d8045){return BPromise[_0x4083('0x1e')](_0x3d8045);}return _0x3b29b1[_0x4083('0x1f')]();};}function saveUpdates(_0x94d72c,_0x5d7461){return function(_0x328efe){if(_0x328efe){return _0x328efe['update'](_0x94d72c)[_0x4083('0x20')](function(_0x3f990d){return _0x3f990d;});}return null;};}function removeEntity(_0x577a80,_0x52a440){return function(_0x3ce623){if(_0x3ce623){return _0x3ce623['destroy']()['then'](function(){_0x577a80['status'](0xcc)[_0x4083('0x21')]();});}};}function handleEntityNotFound(_0xb2fbb5,_0x3d2eef){return function(_0x5ea88e){if(!_0x5ea88e){_0xb2fbb5[_0x4083('0x16')](0x194);}return _0x5ea88e;};}function handleError(_0x357694,_0xa2690a){_0xa2690a=_0xa2690a||0x1f4;return function(_0x552534){logger[_0x4083('0x22')](_0x552534[_0x4083('0x23')]);if(_0x552534['name']){delete _0x552534[_0x4083('0x24')];}_0x357694[_0x4083('0x17')](_0xa2690a)[_0x4083('0x25')](_0x552534);};}exports[_0x4083('0x26')]=function(_0xdf4d9e,_0x1a8ab0){var _0x13cc00={'raw':!![],'where':{'id':_0xdf4d9e[_0x4083('0x27')]['id']}},_0x1534e9={};_0x1534e9['model']=_['keys'](db[_0x4083('0x28')][_0x4083('0x29')]);_0x1534e9[_0x4083('0x2a')]=_[_0x4083('0x2b')](_0xdf4d9e[_0x4083('0x2a')]);_0x1534e9[_0x4083('0x2c')]=_['intersection'](_0x1534e9[_0x4083('0x2d')],_0x1534e9[_0x4083('0x2a')]);_0x13cc00[_0x4083('0x2e')]=_[_0x4083('0x2f')](_0x1534e9[_0x4083('0x2d')],qs[_0x4083('0x30')](_0xdf4d9e['query'][_0x4083('0x30')]));_0x13cc00[_0x4083('0x2e')]=_0x13cc00[_0x4083('0x2e')][_0x4083('0x31')]?_0x13cc00[_0x4083('0x2e')]:_0x1534e9[_0x4083('0x2d')];if(_0xdf4d9e['query'][_0x4083('0x32')]){_0x13cc00['include']=[{'all':!![]}];}_0x13cc00=_[_0x4083('0x33')]({},_0x13cc00,_0xdf4d9e[_0x4083('0x34')]);return db['ChatApplication'][_0x4083('0x35')](_0x13cc00)[_0x4083('0x20')](handleEntityNotFound(_0x1a8ab0,null))[_0x4083('0x20')](respondWithResult(_0x1a8ab0,null))[_0x4083('0x36')](handleError(_0x1a8ab0,null));};exports['update']=function(_0x4cfac3,_0x2e7bbd){if(_0x4cfac3[_0x4083('0x37')]['id']){delete _0x4cfac3['body']['id'];}return db[_0x4083('0x28')]['find']({'where':{'id':_0x4cfac3[_0x4083('0x27')]['id']}})['then'](handleEntityNotFound(_0x2e7bbd,null))['then'](saveUpdates(_0x4cfac3['body'],null))[_0x4083('0x20')](respondWithResult(_0x2e7bbd,null))[_0x4083('0x36')](handleError(_0x2e7bbd,null));};exports[_0x4083('0x38')]=function(_0x6533ee,_0x363e81){return db['ChatApplication']['find']({'where':{'id':_0x6533ee[_0x4083('0x27')]['id']}})[_0x4083('0x20')](handleEntityNotFound(_0x363e81,null))['then'](removeEntity(_0x363e81,null))[_0x4083('0x36')](handleError(_0x363e81,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 35031ae..aca93be 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 _0x1849=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x41c44d,_0x31d1eb){var _0x5e00f5=function(_0x235c98){while(--_0x235c98){_0x41c44d['push'](_0x41c44d['shift']());}};_0x5e00f5(++_0x31d1eb);}(_0x1849,0x7e));var _0x9184=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1849[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9184('0x0'));var util=require(_0x9184('0x1'));var logger=require(_0x9184('0x2'))(_0x9184('0x3'));var moment=require(_0x9184('0x4'));var BPromise=require(_0x9184('0x5'));var rp=require(_0x9184('0x6'));var fs=require('fs');var path=require(_0x9184('0x7'));var rimraf=require('rimraf');var config=require(_0x9184('0x8'));var attributes=require(_0x9184('0x9'));module[_0x9184('0xa')]=function(_0x1ba972,_0x2c9c51){return _0x1ba972[_0x9184('0xb')](_0x9184('0xc'),attributes,{'tableName':_0x9184('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9184('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x946e=['ChatApplication','utf8mb4','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0x946e,0x1d0));var _0xe946=function(_0x403cbb,_0x117019){_0x403cbb=_0x403cbb-0x0;var _0x566496=_0x946e[_0x403cbb];return _0x566496;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var logger=require(_0xe946('0x1'))('api');var moment=require(_0xe946('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe946('0x3'));var rimraf=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var attributes=require(_0xe946('0x6'));module[_0xe946('0x7')]=function(_0x49224a,_0x123d0c){return _0x49224a[_0xe946('0x8')](_0xe946('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe946('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8d7cafd..0e2c2f1 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 _0x8c0e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8c0e,0x1b7));var _0xe8c0=function(_0x4c16aa,_0x20af4b){_0x4c16aa=_0x4c16aa-0x0;var _0x475649=_0x8c0e[_0x4c16aa];return _0x475649;};'use strict';var _=require(_0xe8c0('0x0'));var util=require(_0xe8c0('0x1'));var moment=require('moment');var BPromise=require(_0xe8c0('0x2'));var rs=require(_0xe8c0('0x3'));var fs=require('fs');var Redis=require(_0xe8c0('0x4'));var db=require(_0xe8c0('0x5'))['db'];var utils=require(_0xe8c0('0x6'));var logger=require(_0xe8c0('0x7'))(_0xe8c0('0x8'));var config=require(_0xe8c0('0x9'));var jayson=require(_0xe8c0('0xa'));var client=jayson[_0xe8c0('0xb')][_0xe8c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a9384,_0x5d83f1,_0x279dfd){return new BPromise(function(_0x4fa146,_0x47f5b3){return client[_0xe8c0('0xd')](_0x3a9384,_0x279dfd)[_0xe8c0('0xe')](function(_0x4243c9){logger[_0xe8c0('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5d83f1,_0xe8c0('0x10'));logger[_0xe8c0('0x11')](_0xe8c0('0x12'),_0x5d83f1,_0xe8c0('0x10'),JSON[_0xe8c0('0x13')](_0x4243c9));if(_0x4243c9['error']){if(_0x4243c9[_0xe8c0('0x14')][_0xe8c0('0x15')]===0x1f4){logger[_0xe8c0('0x14')](_0xe8c0('0x16'),_0x5d83f1,_0x4243c9[_0xe8c0('0x14')][_0xe8c0('0x17')]);return _0x47f5b3(_0x4243c9[_0xe8c0('0x14')][_0xe8c0('0x17')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x5d83f1,_0x4243c9['error'][_0xe8c0('0x17')]);return _0x4fa146(_0x4243c9[_0xe8c0('0x14')][_0xe8c0('0x17')]);}else{logger['info'](_0xe8c0('0x16'),_0x5d83f1,_0xe8c0('0x10'));_0x4fa146(_0x4243c9[_0xe8c0('0x18')]['message']);}})[_0xe8c0('0x19')](function(_0xd1d60c){logger[_0xe8c0('0x14')]('ChatApplication,\x20%s,\x20%s',_0x5d83f1,_0xd1d60c);_0x47f5b3(_0xd1d60c);});});} \ No newline at end of file +var _0x4842=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x4842,0x109));var _0x2484=function(_0x4e660a,_0x286309){_0x4e660a=_0x4e660a-0x0;var _0x58ddd2=_0x4842[_0x4e660a];return _0x58ddd2;};'use strict';var _=require('lodash');var util=require(_0x2484('0x0'));var moment=require(_0x2484('0x1'));var BPromise=require('bluebird');var rs=require(_0x2484('0x2'));var fs=require('fs');var Redis=require(_0x2484('0x3'));var db=require(_0x2484('0x4'))['db'];var utils=require(_0x2484('0x5'));var logger=require(_0x2484('0x6'))(_0x2484('0x7'));var config=require(_0x2484('0x8'));var jayson=require(_0x2484('0x9'));var client=jayson[_0x2484('0xa')][_0x2484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x521d74,_0x28d337,_0x26cb0d){return new BPromise(function(_0xb649e1,_0x228150){return client[_0x2484('0xc')](_0x521d74,_0x26cb0d)['then'](function(_0x37bcba){logger[_0x2484('0xd')](_0x2484('0xe'),_0x28d337,'request\x20sent');logger[_0x2484('0xf')](_0x2484('0x10'),_0x28d337,_0x2484('0x11'),JSON[_0x2484('0x12')](_0x37bcba));if(_0x37bcba['error']){if(_0x37bcba[_0x2484('0x13')][_0x2484('0x14')]===0x1f4){logger[_0x2484('0x13')](_0x2484('0xe'),_0x28d337,_0x37bcba[_0x2484('0x13')][_0x2484('0x15')]);return _0x228150(_0x37bcba[_0x2484('0x13')][_0x2484('0x15')]);}logger[_0x2484('0x13')](_0x2484('0xe'),_0x28d337,_0x37bcba[_0x2484('0x13')]['message']);return _0xb649e1(_0x37bcba[_0x2484('0x13')][_0x2484('0x15')]);}else{logger[_0x2484('0xd')](_0x2484('0xe'),_0x28d337,_0x2484('0x11'));_0xb649e1(_0x37bcba[_0x2484('0x16')][_0x2484('0x15')]);}})[_0x2484('0x17')](function(_0x3e2d0a){logger[_0x2484('0x13')](_0x2484('0xe'),_0x28d337,_0x3e2d0a);_0x228150(_0x3e2d0a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 40615f1..2143253 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 _0x4c82=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4c82,0x75));var _0x24c8=function(_0x3c6c1b,_0x82a1e4){_0x3c6c1b=_0x3c6c1b-0x0;var _0x15170e=_0x4c82[_0x3c6c1b];return _0x15170e;};'use strict';var multer=require('multer');var util=require(_0x24c8('0x0'));var path=require(_0x24c8('0x1'));var timeout=require(_0x24c8('0x2'));var express=require(_0x24c8('0x3'));var router=express[_0x24c8('0x4')]();var fs_extra=require(_0x24c8('0x5'));var auth=require(_0x24c8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x24c8('0x7'));router['get'](_0x24c8('0x8'),auth[_0x24c8('0x9')](),controller[_0x24c8('0xa')]);router[_0x24c8('0xb')](_0x24c8('0x8'),auth['isAuthenticated'](),controller[_0x24c8('0xc')]);router[_0x24c8('0xd')](_0x24c8('0x8'),auth[_0x24c8('0x9')](),controller[_0x24c8('0xe')]);module[_0x24c8('0xf')]=router; \ No newline at end of file +var _0x3fa9=['path','express','Router','fs-extra','./chatApplication.controller','get','/:id','show','put','isAuthenticated','delete','destroy','exports','multer','util'];(function(_0x4c36ba,_0x1466e7){var _0x5c0548=function(_0x319035){while(--_0x319035){_0x4c36ba['push'](_0x4c36ba['shift']());}};_0x5c0548(++_0x1466e7);}(_0x3fa9,0x1b1));var _0x93fa=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x3fa9[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x93fa('0x0'));var util=require(_0x93fa('0x1'));var path=require(_0x93fa('0x2'));var timeout=require('connect-timeout');var express=require(_0x93fa('0x3'));var router=express[_0x93fa('0x4')]();var fs_extra=require(_0x93fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x93fa('0x6'));router[_0x93fa('0x7')](_0x93fa('0x8'),auth['isAuthenticated'](),controller[_0x93fa('0x9')]);router[_0x93fa('0xa')](_0x93fa('0x8'),auth[_0x93fa('0xb')](),controller['update']);router[_0x93fa('0xc')](_0x93fa('0x8'),auth[_0x93fa('0xb')](),controller[_0x93fa('0xd')]);module[_0x93fa('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index eea86d0..4259019 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 _0xbeba=['STRING','BOOLEAN','sequelize','exports'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xbeba,0xb6));var _0xabeb=function(_0x155068,_0x34a222){_0x155068=_0x155068-0x0;var _0x56f669=_0xbeba[_0x155068];return _0x56f669;};'use strict';var Sequelize=require(_0xabeb('0x0'));module[_0xabeb('0x1')]={'name':{'type':Sequelize[_0xabeb('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xabeb('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1f6f=['exports','STRING','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1f6f,0x1a6));var _0xf1f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1f6f[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xf1f6('0x0'));module[_0xf1f6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf1f6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3a2acc3..864e8e3 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 _0x6ec9=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','order','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x53338d,_0x5503b7){var _0x48a97a=function(_0x129427){while(--_0x129427){_0x53338d['push'](_0x53338d['shift']());}};_0x48a97a(++_0x5503b7);}(_0x6ec9,0x12b));var _0x96ec=function(_0x19077e,_0x1ae7cd){_0x19077e=_0x19077e-0x0;var _0x440fc3=_0x6ec9[_0x19077e];return _0x440fc3;};'use strict';var emlformat=require(_0x96ec('0x0'));var rimraf=require(_0x96ec('0x1'));var zipdir=require(_0x96ec('0x2'));var jsonpatch=require(_0x96ec('0x3'));var rp=require(_0x96ec('0x4'));var moment=require(_0x96ec('0x5'));var BPromise=require(_0x96ec('0x6'));var Mustache=require(_0x96ec('0x7'));var util=require(_0x96ec('0x8'));var path=require('path');var sox=require(_0x96ec('0x9'));var csv=require(_0x96ec('0xa'));var ejs=require(_0x96ec('0xb'));var fs=require('fs');var fs_extra=require(_0x96ec('0xc'));var _=require('lodash');var squel=require(_0x96ec('0xd'));var crypto=require(_0x96ec('0xe'));var jsforce=require(_0x96ec('0xf'));var deskjs=require(_0x96ec('0x10'));var toCsv=require('to-csv');var querystring=require(_0x96ec('0x11'));var Papa=require('papaparse');var Redis=require(_0x96ec('0x12'));var authService=require(_0x96ec('0x13'));var qs=require(_0x96ec('0x14'));var as=require(_0x96ec('0x15'));var hardwareService=require(_0x96ec('0x16'));var logger=require(_0x96ec('0x17'))(_0x96ec('0x18'));var utils=require(_0x96ec('0x19'));var config=require(_0x96ec('0x1a'));var licenseUtil=require(_0x96ec('0x1b'));var db=require(_0x96ec('0x1c'))['db'];config['redis']=_[_0x96ec('0x1d')](config[_0x96ec('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96ec('0x1e')]));require('./chatGroup.socket')[_0x96ec('0x1f')](socket);function respondWithStatusCode(_0x2404a7,_0x1160d3){_0x1160d3=_0x1160d3||0xcc;return function(_0x1f3251){if(_0x1f3251){return _0x2404a7[_0x96ec('0x20')](_0x1160d3);}return _0x2404a7[_0x96ec('0x21')](_0x1160d3)['end']();};}function respondWithResult(_0x5e597e,_0x2e49a8){_0x2e49a8=_0x2e49a8||0xc8;return function(_0x1f58d7){if(_0x1f58d7){return _0x5e597e['status'](_0x2e49a8)[_0x96ec('0x22')](_0x1f58d7);}};}function respondWithFilteredResult(_0x5dafca,_0x5ecb83){return function(_0xf39213){if(_0xf39213){var _0x36df66=typeof _0x5ecb83[_0x96ec('0x23')]===_0x96ec('0x24')&&typeof _0x5ecb83['limit']===_0x96ec('0x24');var _0x231aa1=_0xf39213[_0x96ec('0x25')];var _0x2bbcf1=_0x36df66?0x0:_0x5ecb83[_0x96ec('0x23')];var _0x22cf16=_0x36df66?_0xf39213['count']:_0x5ecb83[_0x96ec('0x23')]+_0x5ecb83[_0x96ec('0x26')];var _0x9b3e4c;if(_0x22cf16>=_0x231aa1){_0x22cf16=_0x231aa1;_0x9b3e4c=0xc8;}else{_0x9b3e4c=0xce;}_0x5dafca[_0x96ec('0x21')](_0x9b3e4c);return _0x5dafca[_0x96ec('0x27')](_0x96ec('0x28'),_0x2bbcf1+'-'+_0x22cf16+'/'+_0x231aa1)['json'](_0xf39213);}return null;};}function patchUpdates(_0x327bc4){return function(_0x447efb){try{jsonpatch[_0x96ec('0x29')](_0x447efb,_0x327bc4,!![]);}catch(_0x5c725b){return BPromise[_0x96ec('0x2a')](_0x5c725b);}return _0x447efb[_0x96ec('0x2b')]();};}function saveUpdates(_0x33413c,_0x40b847){return function(_0x158d0d){if(_0x158d0d){return _0x158d0d[_0x96ec('0x2c')](_0x33413c)['then'](function(_0x42cec2){return _0x42cec2;});}return null;};}function removeEntity(_0x4e4cbd,_0x479573){return function(_0x47fd9b){if(_0x47fd9b){return _0x47fd9b[_0x96ec('0x2d')]()[_0x96ec('0x2e')](function(){_0x4e4cbd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb80206,_0x23c7b8){return function(_0x3d20fc){if(!_0x3d20fc){_0xb80206[_0x96ec('0x20')](0x194);}return _0x3d20fc;};}function handleError(_0x502f0a,_0x5d528d){_0x5d528d=_0x5d528d||0x1f4;return function(_0x3cc78d){logger['error'](_0x3cc78d[_0x96ec('0x2f')]);if(_0x3cc78d['name']){delete _0x3cc78d[_0x96ec('0x30')];}_0x502f0a['status'](_0x5d528d)['send'](_0x3cc78d);};}exports[_0x96ec('0x31')]=function(_0x3a8cea,_0x4c1251){var _0x49938a={},_0x6ac0dc={},_0x2bc04e={'count':0x0,'rows':[]};var _0x35a915=_[_0x96ec('0x32')](db[_0x96ec('0x33')]['rawAttributes'],function(_0x1db018){return{'name':_0x1db018[_0x96ec('0x34')],'type':_0x1db018[_0x96ec('0x35')][_0x96ec('0x36')]};});_0x6ac0dc[_0x96ec('0x37')]=_[_0x96ec('0x32')](_0x35a915,_0x96ec('0x30'));_0x6ac0dc[_0x96ec('0x38')]=_[_0x96ec('0x39')](_0x3a8cea[_0x96ec('0x38')]);_0x6ac0dc[_0x96ec('0x3a')]=_[_0x96ec('0x3b')](_0x6ac0dc[_0x96ec('0x37')],_0x6ac0dc[_0x96ec('0x38')]);_0x49938a[_0x96ec('0x3c')]=_[_0x96ec('0x3b')](_0x6ac0dc[_0x96ec('0x37')],qs[_0x96ec('0x3d')](_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x3d')]));_0x49938a['attributes']=_0x49938a[_0x96ec('0x3c')]['length']?_0x49938a[_0x96ec('0x3c')]:_0x6ac0dc['model'];if(!_0x3a8cea['query']['hasOwnProperty'](_0x96ec('0x3e'))){_0x49938a[_0x96ec('0x26')]=qs['limit'](_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x26')]);_0x49938a[_0x96ec('0x23')]=qs[_0x96ec('0x23')](_0x3a8cea[_0x96ec('0x38')]['offset']);}_0x49938a['order']=qs[_0x96ec('0x3f')](_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x3f')]);_0x49938a[_0x96ec('0x40')]=qs[_0x96ec('0x3a')](_[_0x96ec('0x41')](_0x3a8cea['query'],_0x6ac0dc[_0x96ec('0x3a')]),_0x35a915);if(_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x42')]){_0x49938a['where']=_['merge'](_0x49938a[_0x96ec('0x40')],{'$or':_[_0x96ec('0x32')](_0x35a915,function(_0x21ea68){if(_0x21ea68[_0x96ec('0x35')]!=='VIRTUAL'){var _0x6fdfb2={};_0x6fdfb2[_0x21ea68[_0x96ec('0x30')]]={'$like':'%'+_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x42')]+'%'};return _0x6fdfb2;}})});}_0x49938a=_[_0x96ec('0x43')]({},_0x49938a,_0x3a8cea[_0x96ec('0x44')]);var _0x4bd05f={'where':_0x49938a[_0x96ec('0x40')]};return db[_0x96ec('0x33')][_0x96ec('0x25')](_0x4bd05f)[_0x96ec('0x2e')](function(_0xe84b0){_0x2bc04e[_0x96ec('0x25')]=_0xe84b0;if(_0x3a8cea[_0x96ec('0x38')][_0x96ec('0x45')]){_0x49938a[_0x96ec('0x46')]=[{'all':!![]}];}return db[_0x96ec('0x33')][_0x96ec('0x47')](_0x49938a);})[_0x96ec('0x2e')](function(_0x13975b){_0x2bc04e[_0x96ec('0x48')]=_0x13975b;return _0x2bc04e;})[_0x96ec('0x2e')](respondWithFilteredResult(_0x4c1251,_0x49938a))[_0x96ec('0x49')](handleError(_0x4c1251,null));};exports[_0x96ec('0x4a')]=function(_0x52768f,_0x270dc5){var _0x4e45b5={'raw':!![],'where':{'id':_0x52768f['params']['id']}},_0x4397a5={};_0x4397a5[_0x96ec('0x37')]=_[_0x96ec('0x39')](db[_0x96ec('0x33')][_0x96ec('0x4b')]);_0x4397a5[_0x96ec('0x38')]=_['keys'](_0x52768f[_0x96ec('0x38')]);_0x4397a5[_0x96ec('0x3a')]=_[_0x96ec('0x3b')](_0x4397a5['model'],_0x4397a5[_0x96ec('0x38')]);_0x4e45b5[_0x96ec('0x3c')]=_[_0x96ec('0x3b')](_0x4397a5[_0x96ec('0x37')],qs[_0x96ec('0x3d')](_0x52768f[_0x96ec('0x38')]['fields']));_0x4e45b5[_0x96ec('0x3c')]=_0x4e45b5[_0x96ec('0x3c')][_0x96ec('0x4c')]?_0x4e45b5['attributes']:_0x4397a5[_0x96ec('0x37')];if(_0x52768f['query']['includeAll']){_0x4e45b5[_0x96ec('0x46')]=[{'all':!![]}];}_0x4e45b5=_[_0x96ec('0x43')]({},_0x4e45b5,_0x52768f['options']);return db[_0x96ec('0x33')][_0x96ec('0x4d')](_0x4e45b5)[_0x96ec('0x2e')](handleEntityNotFound(_0x270dc5,null))[_0x96ec('0x2e')](respondWithResult(_0x270dc5,null))[_0x96ec('0x49')](handleError(_0x270dc5,null));};exports[_0x96ec('0x4e')]=function(_0x474e4c,_0x40cbad){return db[_0x96ec('0x33')][_0x96ec('0x4e')](_0x474e4c[_0x96ec('0x4f')],{})[_0x96ec('0x2e')](respondWithResult(_0x40cbad,0xc9))[_0x96ec('0x49')](handleError(_0x40cbad,null));};exports['update']=function(_0x153aad,_0x230225){if(_0x153aad[_0x96ec('0x4f')]['id']){delete _0x153aad[_0x96ec('0x4f')]['id'];}return db[_0x96ec('0x33')][_0x96ec('0x4d')]({'where':{'id':_0x153aad['params']['id']}})[_0x96ec('0x2e')](handleEntityNotFound(_0x230225,null))['then'](saveUpdates(_0x153aad[_0x96ec('0x4f')],null))[_0x96ec('0x2e')](respondWithResult(_0x230225,null))[_0x96ec('0x49')](handleError(_0x230225,null));};exports['destroy']=function(_0x3c5691,_0x468a33){return db[_0x96ec('0x33')]['find']({'where':{'id':_0x3c5691[_0x96ec('0x50')]['id']}})[_0x96ec('0x2e')](handleEntityNotFound(_0x468a33,null))['then'](removeEntity(_0x468a33,null))[_0x96ec('0x49')](handleError(_0x468a33,null));};exports[_0x96ec('0x51')]=function(_0x1ff548,_0x592a73){return db[_0x96ec('0x33')][_0x96ec('0x51')]()[_0x96ec('0x2e')](respondWithResult(_0x592a73,null))[_0x96ec('0x49')](handleError(_0x592a73,null));};exports[_0x96ec('0x52')]=function(_0x3172de,_0x2edb46,_0x35f8f2){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x3172de[_0x96ec('0x50')]['id'],'ToId':_0x3172de[_0x96ec('0x53')]['id'],'read':![]}})[_0x96ec('0x2e')](function(_0x575567){return{'id':_[_0x96ec('0x54')](_0x3172de[_0x96ec('0x50')]['id']),'count':_0x575567};})['then'](respondWithResult(_0x2edb46,null))[_0x96ec('0x49')](handleError(_0x2edb46,null));};exports[_0x96ec('0x55')]=function(_0x5b2866,_0x3ebcb6,_0x5c5089){return db[_0x96ec('0x33')][_0x96ec('0x4d')]({'where':{'id':_0x5b2866[_0x96ec('0x50')]['id']}})[_0x96ec('0x2e')](handleEntityNotFound(_0x3ebcb6,null))[_0x96ec('0x2e')](function(_0x9c1961){if(_0x9c1961){return _0x9c1961[_0x96ec('0x55')](_0x5b2866['body'][_0x96ec('0x56')],_[_0x96ec('0x57')](_0x5b2866['body'],['ids','id'])||{});}})[_0x96ec('0x2e')](respondWithResult(_0x3ebcb6,null))[_0x96ec('0x49')](handleError(_0x3ebcb6,null));};exports[_0x96ec('0x58')]=function(_0x4deadc,_0x57cb40,_0xa81f01){var _0x3c4086={};var _0x126702={};var _0x451ac6;var _0xce830e;return db['ChatGroup'][_0x96ec('0x59')]({'where':{'id':_0x4deadc[_0x96ec('0x50')]['id']}})['then'](handleEntityNotFound(_0x57cb40,null))['then'](function(_0x5a4b04){if(_0x5a4b04){_0x451ac6=_0x5a4b04;_0x126702['model']=_[_0x96ec('0x39')](db['User']['rawAttributes']);_0x126702[_0x96ec('0x38')]=_[_0x96ec('0x39')](_0x4deadc['query']);_0x126702[_0x96ec('0x3a')]=_[_0x96ec('0x3b')](_0x126702[_0x96ec('0x37')],_0x126702[_0x96ec('0x38')]);_0x3c4086[_0x96ec('0x3c')]=_['intersection'](_0x126702[_0x96ec('0x37')],qs[_0x96ec('0x3d')](_0x4deadc['query'][_0x96ec('0x3d')]));_0x3c4086[_0x96ec('0x3c')]=_0x3c4086['attributes'][_0x96ec('0x4c')]?_0x3c4086['attributes']:_0x126702['model'];_0x3c4086[_0x96ec('0x5a')]=qs[_0x96ec('0x3f')](_0x4deadc[_0x96ec('0x38')][_0x96ec('0x3f')]);_0x3c4086[_0x96ec('0x40')]=qs[_0x96ec('0x3a')](_[_0x96ec('0x41')](_0x4deadc[_0x96ec('0x38')],_0x126702[_0x96ec('0x3a')]));if(_0x4deadc['query']['filter']){_0x3c4086[_0x96ec('0x40')]=_[_0x96ec('0x43')](_0x3c4086[_0x96ec('0x40')],{'$or':_[_0x96ec('0x32')](_0x3c4086[_0x96ec('0x3c')],function(_0x55d263){var _0x1b7b50={};_0x1b7b50[_0x55d263]={'$like':'%'+_0x4deadc[_0x96ec('0x38')][_0x96ec('0x42')]+'%'};return _0x1b7b50;})});}_0x3c4086=_[_0x96ec('0x43')]({},_0x3c4086,_0x4deadc[_0x96ec('0x44')]);return _0x451ac6[_0x96ec('0x58')](_0x3c4086);}})['then'](function(_0x5917bb){if(_0x5917bb){_0xce830e=_0x5917bb[_0x96ec('0x4c')];if(!_0x4deadc['query'][_0x96ec('0x5b')](_0x96ec('0x3e'))){_0x3c4086[_0x96ec('0x26')]=qs[_0x96ec('0x26')](_0x4deadc[_0x96ec('0x38')][_0x96ec('0x26')]);_0x3c4086[_0x96ec('0x23')]=qs[_0x96ec('0x23')](_0x4deadc['query'][_0x96ec('0x23')]);}return _0x451ac6['getMembers'](_0x3c4086);}})['then'](function(_0x44f9b9){if(_0x44f9b9){return _0x44f9b9?{'count':_0xce830e,'rows':_0x44f9b9}:null;}})['then'](respondWithResult(_0x57cb40,null))['catch'](handleError(_0x57cb40,null));};exports[_0x96ec('0x5c')]=function(_0x1674f6,_0x10c2b9,_0x11fc62){return db[_0x96ec('0x33')][_0x96ec('0x4d')]({'where':{'id':_0x1674f6['params']['id']}})['then'](handleEntityNotFound(_0x10c2b9,null))['then'](function(_0xd52586){if(_0xd52586){return _0xd52586[_0x96ec('0x5c')](_0x1674f6[_0x96ec('0x38')][_0x96ec('0x56')]);}})[_0x96ec('0x2e')](respondWithStatusCode(_0x10c2b9,null))[_0x96ec('0x49')](handleError(_0x10c2b9,null));};exports[_0x96ec('0x5d')]=function(_0x2c4f21,_0x1b7b24,_0x1b8218){if(_0x2c4f21[_0x96ec('0x4f')]['id']){delete _0x2c4f21[_0x96ec('0x4f')]['id'];}return db[_0x96ec('0x33')][_0x96ec('0x4d')]({'where':{'id':_0x2c4f21[_0x96ec('0x50')]['id']}})[_0x96ec('0x2e')](handleEntityNotFound(_0x1b7b24,null))[_0x96ec('0x2e')](function(_0x518ee9){if(_0x518ee9){_0x2c4f21['body'][_0x96ec('0x5e')]=_0x518ee9['id'];return db[_0x96ec('0x5f')][_0x96ec('0x4e')](_0x2c4f21[_0x96ec('0x4f')]);}})['then'](respondWithResult(_0x1b7b24,null))[_0x96ec('0x49')](handleError(_0x1b7b24,null));};exports[_0x96ec('0x60')]=function(_0x1065bc,_0xcf38ec,_0x25e54d){var _0x25483d={};var _0x2f555d={};var _0x4ca9d8;var _0x954f61;return db[_0x96ec('0x33')]['findOne']({'where':{'id':_0x1065bc[_0x96ec('0x50')]['id']}})[_0x96ec('0x2e')](handleEntityNotFound(_0xcf38ec,null))[_0x96ec('0x2e')](function(_0x4b46b9){if(_0x4b46b9){_0x4ca9d8=_0x4b46b9;_0x2f555d[_0x96ec('0x37')]=_[_0x96ec('0x39')](db[_0x96ec('0x5f')][_0x96ec('0x4b')]);_0x2f555d[_0x96ec('0x38')]=_[_0x96ec('0x39')](_0x1065bc[_0x96ec('0x38')]);_0x2f555d[_0x96ec('0x3a')]=_['intersection'](_0x2f555d[_0x96ec('0x37')],_0x2f555d['query']);_0x25483d[_0x96ec('0x3c')]=_[_0x96ec('0x3b')](_0x2f555d[_0x96ec('0x37')],qs[_0x96ec('0x3d')](_0x1065bc[_0x96ec('0x38')]['fields']));_0x25483d[_0x96ec('0x3c')]=_0x25483d[_0x96ec('0x3c')]['length']?_0x25483d['attributes']:_0x2f555d[_0x96ec('0x37')];_0x25483d[_0x96ec('0x5a')]=qs[_0x96ec('0x3f')](_0x1065bc['query'][_0x96ec('0x3f')]);_0x25483d[_0x96ec('0x40')]=qs[_0x96ec('0x3a')](_[_0x96ec('0x41')](_0x1065bc[_0x96ec('0x38')],_0x2f555d[_0x96ec('0x3a')]));if(_0x1065bc['query'][_0x96ec('0x42')]){_0x25483d[_0x96ec('0x40')]=_[_0x96ec('0x43')](_0x25483d[_0x96ec('0x40')],{'$or':_['map'](_0x25483d[_0x96ec('0x3c')],function(_0x4b5b38){var _0x284145={};_0x284145[_0x4b5b38]={'$like':'%'+_0x1065bc[_0x96ec('0x38')]['filter']+'%'};return _0x284145;})});}if(_0x1065bc[_0x96ec('0x38')][_0x96ec('0x61')]){var _0x4e981f=_0x1065bc[_0x96ec('0x38')][_0x96ec('0x61')][_0x96ec('0x62')](',');var _0x196e28={};_0x196e28[_0x4e981f[0x0]]={'$gte':moment(_0x4e981f[0x1])[_0x96ec('0x63')](_0x96ec('0x64'))};_0x25483d[_0x96ec('0x40')]=_[_0x96ec('0x43')](_0x25483d[_0x96ec('0x40')],_0x196e28);}_0x25483d=_[_0x96ec('0x43')]({},_0x25483d,_0x1065bc[_0x96ec('0x44')]);return _0x4ca9d8[_0x96ec('0x60')](_0x25483d);}})[_0x96ec('0x2e')](function(_0x2fb775){if(_0x2fb775){_0x954f61=_0x2fb775[_0x96ec('0x4c')];if(!_0x1065bc[_0x96ec('0x38')][_0x96ec('0x5b')](_0x96ec('0x3e'))){_0x25483d['limit']=qs['limit'](_0x1065bc['query']['limit']);_0x25483d['offset']=qs[_0x96ec('0x23')](_0x1065bc[_0x96ec('0x38')][_0x96ec('0x23')]);}return _0x4ca9d8[_0x96ec('0x60')](_0x25483d);}})[_0x96ec('0x2e')](function(_0x3e751b){if(_0x3e751b){return _0x3e751b?{'count':_0x954f61,'rows':_0x3e751b}:null;}})['then'](respondWithResult(_0xcf38ec,null))[_0x96ec('0x49')](handleError(_0xcf38ec,null));}; \ No newline at end of file +var _0xcf86=['findAll','rows','catch','show','include','body','update','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','create','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','ChatGroup','includeAll'];(function(_0x1b2bc7,_0x409e8f){var _0xc2a50=function(_0x490992){while(--_0x490992){_0x1b2bc7['push'](_0x1b2bc7['shift']());}};_0xc2a50(++_0x409e8f);}(_0xcf86,0xdf));var _0x6cf8=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcf86[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x6cf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cf8('0x1'));var jsonpatch=require(_0x6cf8('0x2'));var rp=require(_0x6cf8('0x3'));var moment=require(_0x6cf8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf8('0x5'));var path=require('path');var sox=require(_0x6cf8('0x6'));var csv=require(_0x6cf8('0x7'));var ejs=require(_0x6cf8('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf8('0x9'));var _=require(_0x6cf8('0xa'));var squel=require(_0x6cf8('0xb'));var crypto=require(_0x6cf8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6cf8('0xd'));var toCsv=require(_0x6cf8('0x7'));var querystring=require('querystring');var Papa=require(_0x6cf8('0xe'));var Redis=require(_0x6cf8('0xf'));var authService=require(_0x6cf8('0x10'));var qs=require(_0x6cf8('0x11'));var as=require(_0x6cf8('0x12'));var hardwareService=require(_0x6cf8('0x13'));var logger=require(_0x6cf8('0x14'))(_0x6cf8('0x15'));var utils=require(_0x6cf8('0x16'));var config=require(_0x6cf8('0x17'));var licenseUtil=require(_0x6cf8('0x18'));var db=require(_0x6cf8('0x19'))['db'];config[_0x6cf8('0x1a')]=_[_0x6cf8('0x1b')](config[_0x6cf8('0x1a')],{'host':_0x6cf8('0x1c'),'port':0x18eb});var socket=require(_0x6cf8('0x1d'))(new Redis(config[_0x6cf8('0x1a')]));require(_0x6cf8('0x1e'))[_0x6cf8('0x1f')](socket);function respondWithStatusCode(_0x17b6c2,_0x20891e){_0x20891e=_0x20891e||0xcc;return function(_0x27c196){if(_0x27c196){return _0x17b6c2[_0x6cf8('0x20')](_0x20891e);}return _0x17b6c2[_0x6cf8('0x21')](_0x20891e)[_0x6cf8('0x22')]();};}function respondWithResult(_0x3eb247,_0x160008){_0x160008=_0x160008||0xc8;return function(_0x3afab9){if(_0x3afab9){return _0x3eb247[_0x6cf8('0x21')](_0x160008)[_0x6cf8('0x23')](_0x3afab9);}};}function respondWithFilteredResult(_0x2ca572,_0x2bc8e8){return function(_0x351495){if(_0x351495){var _0x21217b=typeof _0x2bc8e8[_0x6cf8('0x24')]===_0x6cf8('0x25')&&typeof _0x2bc8e8['limit']===_0x6cf8('0x25');var _0x182eb8=_0x351495[_0x6cf8('0x26')];var _0x20ded3=_0x21217b?0x0:_0x2bc8e8[_0x6cf8('0x24')];var _0xcb260b=_0x21217b?_0x351495['count']:_0x2bc8e8[_0x6cf8('0x24')]+_0x2bc8e8[_0x6cf8('0x27')];var _0x472035;if(_0xcb260b>=_0x182eb8){_0xcb260b=_0x182eb8;_0x472035=0xc8;}else{_0x472035=0xce;}_0x2ca572[_0x6cf8('0x21')](_0x472035);return _0x2ca572[_0x6cf8('0x28')](_0x6cf8('0x29'),_0x20ded3+'-'+_0xcb260b+'/'+_0x182eb8)['json'](_0x351495);}return null;};}function patchUpdates(_0x3883a7){return function(_0x2d674e){try{jsonpatch['apply'](_0x2d674e,_0x3883a7,!![]);}catch(_0x4feb89){return BPromise[_0x6cf8('0x2a')](_0x4feb89);}return _0x2d674e['save']();};}function saveUpdates(_0x443eeb,_0x6d7b6d){return function(_0x57ea0e){if(_0x57ea0e){return _0x57ea0e['update'](_0x443eeb)[_0x6cf8('0x2b')](function(_0x2307c9){return _0x2307c9;});}return null;};}function removeEntity(_0x1e865b,_0x53505c){return function(_0x5332ef){if(_0x5332ef){return _0x5332ef[_0x6cf8('0x2c')]()['then'](function(){_0x1e865b[_0x6cf8('0x21')](0xcc)[_0x6cf8('0x22')]();});}};}function handleEntityNotFound(_0x196c0a,_0xc4cbce){return function(_0x3b4d2c){if(!_0x3b4d2c){_0x196c0a['sendStatus'](0x194);}return _0x3b4d2c;};}function handleError(_0x109365,_0x3069f1){_0x3069f1=_0x3069f1||0x1f4;return function(_0x57c717){logger[_0x6cf8('0x2d')](_0x57c717[_0x6cf8('0x2e')]);if(_0x57c717[_0x6cf8('0x2f')]){delete _0x57c717[_0x6cf8('0x2f')];}_0x109365[_0x6cf8('0x21')](_0x3069f1)[_0x6cf8('0x30')](_0x57c717);};}exports['index']=function(_0x2cde13,_0x5a7d1d){var _0x426000={},_0x3948f5={},_0x49a815={'count':0x0,'rows':[]};var _0x484836=_['map'](db['ChatGroup'][_0x6cf8('0x31')],function(_0x27aff2){return{'name':_0x27aff2['fieldName'],'type':_0x27aff2[_0x6cf8('0x32')][_0x6cf8('0x33')]};});_0x3948f5[_0x6cf8('0x34')]=_[_0x6cf8('0x35')](_0x484836,_0x6cf8('0x2f'));_0x3948f5[_0x6cf8('0x36')]=_[_0x6cf8('0x37')](_0x2cde13['query']);_0x3948f5[_0x6cf8('0x38')]=_['intersection'](_0x3948f5['model'],_0x3948f5['query']);_0x426000['attributes']=_[_0x6cf8('0x39')](_0x3948f5[_0x6cf8('0x34')],qs['fields'](_0x2cde13[_0x6cf8('0x36')][_0x6cf8('0x3a')]));_0x426000[_0x6cf8('0x3b')]=_0x426000[_0x6cf8('0x3b')][_0x6cf8('0x3c')]?_0x426000[_0x6cf8('0x3b')]:_0x3948f5[_0x6cf8('0x34')];if(!_0x2cde13[_0x6cf8('0x36')]['hasOwnProperty'](_0x6cf8('0x3d'))){_0x426000[_0x6cf8('0x27')]=qs[_0x6cf8('0x27')](_0x2cde13[_0x6cf8('0x36')][_0x6cf8('0x27')]);_0x426000[_0x6cf8('0x24')]=qs[_0x6cf8('0x24')](_0x2cde13[_0x6cf8('0x36')][_0x6cf8('0x24')]);}_0x426000[_0x6cf8('0x3e')]=qs[_0x6cf8('0x3f')](_0x2cde13[_0x6cf8('0x36')][_0x6cf8('0x3f')]);_0x426000[_0x6cf8('0x40')]=qs[_0x6cf8('0x38')](_[_0x6cf8('0x41')](_0x2cde13['query'],_0x3948f5['filters']),_0x484836);if(_0x2cde13['query'][_0x6cf8('0x42')]){_0x426000['where']=_[_0x6cf8('0x43')](_0x426000[_0x6cf8('0x40')],{'$or':_[_0x6cf8('0x35')](_0x484836,function(_0x3d4bb5){if(_0x3d4bb5[_0x6cf8('0x32')]!=='VIRTUAL'){var _0xd37fb1={};_0xd37fb1[_0x3d4bb5['name']]={'$like':'%'+_0x2cde13[_0x6cf8('0x36')]['filter']+'%'};return _0xd37fb1;}})});}_0x426000=_['merge']({},_0x426000,_0x2cde13[_0x6cf8('0x44')]);var _0x40a16a={'where':_0x426000['where']};return db[_0x6cf8('0x45')][_0x6cf8('0x26')](_0x40a16a)[_0x6cf8('0x2b')](function(_0xdcf2f){_0x49a815[_0x6cf8('0x26')]=_0xdcf2f;if(_0x2cde13[_0x6cf8('0x36')][_0x6cf8('0x46')]){_0x426000['include']=[{'all':!![]}];}return db[_0x6cf8('0x45')][_0x6cf8('0x47')](_0x426000);})[_0x6cf8('0x2b')](function(_0x338f05){_0x49a815[_0x6cf8('0x48')]=_0x338f05;return _0x49a815;})[_0x6cf8('0x2b')](respondWithFilteredResult(_0x5a7d1d,_0x426000))[_0x6cf8('0x49')](handleError(_0x5a7d1d,null));};exports[_0x6cf8('0x4a')]=function(_0x24ac22,_0x7ca880){var _0x18bc32={'raw':!![],'where':{'id':_0x24ac22['params']['id']}},_0x44826c={};_0x44826c[_0x6cf8('0x34')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x44826c[_0x6cf8('0x36')]=_[_0x6cf8('0x37')](_0x24ac22[_0x6cf8('0x36')]);_0x44826c['filters']=_[_0x6cf8('0x39')](_0x44826c['model'],_0x44826c['query']);_0x18bc32[_0x6cf8('0x3b')]=_['intersection'](_0x44826c[_0x6cf8('0x34')],qs['fields'](_0x24ac22['query'][_0x6cf8('0x3a')]));_0x18bc32['attributes']=_0x18bc32['attributes'][_0x6cf8('0x3c')]?_0x18bc32[_0x6cf8('0x3b')]:_0x44826c[_0x6cf8('0x34')];if(_0x24ac22[_0x6cf8('0x36')][_0x6cf8('0x46')]){_0x18bc32[_0x6cf8('0x4b')]=[{'all':!![]}];}_0x18bc32=_[_0x6cf8('0x43')]({},_0x18bc32,_0x24ac22[_0x6cf8('0x44')]);return db[_0x6cf8('0x45')]['find'](_0x18bc32)[_0x6cf8('0x2b')](handleEntityNotFound(_0x7ca880,null))['then'](respondWithResult(_0x7ca880,null))['catch'](handleError(_0x7ca880,null));};exports['create']=function(_0x5dfc82,_0x49d3ea){return db[_0x6cf8('0x45')]['create'](_0x5dfc82[_0x6cf8('0x4c')],{})[_0x6cf8('0x2b')](respondWithResult(_0x49d3ea,0xc9))[_0x6cf8('0x49')](handleError(_0x49d3ea,null));};exports[_0x6cf8('0x4d')]=function(_0xeb986d,_0x168af8){if(_0xeb986d[_0x6cf8('0x4c')]['id']){delete _0xeb986d['body']['id'];}return db['ChatGroup'][_0x6cf8('0x4e')]({'where':{'id':_0xeb986d[_0x6cf8('0x4f')]['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x168af8,null))[_0x6cf8('0x2b')](saveUpdates(_0xeb986d[_0x6cf8('0x4c')],null))['then'](respondWithResult(_0x168af8,null))[_0x6cf8('0x49')](handleError(_0x168af8,null));};exports[_0x6cf8('0x2c')]=function(_0x48c16f,_0x16cace){return db[_0x6cf8('0x45')][_0x6cf8('0x4e')]({'where':{'id':_0x48c16f[_0x6cf8('0x4f')]['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x16cace,null))['then'](removeEntity(_0x16cace,null))[_0x6cf8('0x49')](handleError(_0x16cace,null));};exports[_0x6cf8('0x50')]=function(_0x4fa956,_0x522865){return db['ChatGroup'][_0x6cf8('0x50')]()[_0x6cf8('0x2b')](respondWithResult(_0x522865,null))[_0x6cf8('0x49')](handleError(_0x522865,null));};exports[_0x6cf8('0x51')]=function(_0x3c7f8c,_0x12adf9,_0x1c2a9b){return db[_0x6cf8('0x52')][_0x6cf8('0x26')]({'where':{'ChatGroupId':_0x3c7f8c[_0x6cf8('0x4f')]['id'],'ToId':_0x3c7f8c[_0x6cf8('0x53')]['id'],'read':![]}})[_0x6cf8('0x2b')](function(_0x466383){return{'id':_[_0x6cf8('0x54')](_0x3c7f8c['params']['id']),'count':_0x466383};})[_0x6cf8('0x2b')](respondWithResult(_0x12adf9,null))[_0x6cf8('0x49')](handleError(_0x12adf9,null));};exports['addMembers']=function(_0x423e6d,_0x2bab77,_0x18323d){return db[_0x6cf8('0x45')][_0x6cf8('0x4e')]({'where':{'id':_0x423e6d['params']['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x2bab77,null))[_0x6cf8('0x2b')](function(_0x4897c6){if(_0x4897c6){return _0x4897c6[_0x6cf8('0x55')](_0x423e6d[_0x6cf8('0x4c')][_0x6cf8('0x56')],_[_0x6cf8('0x57')](_0x423e6d[_0x6cf8('0x4c')],[_0x6cf8('0x56'),'id'])||{});}})['then'](respondWithResult(_0x2bab77,null))[_0x6cf8('0x49')](handleError(_0x2bab77,null));};exports[_0x6cf8('0x58')]=function(_0x3aa49d,_0x196d4d,_0xcda2ea){var _0x54cd81={};var _0x358022={};var _0x13cc46;var _0x2e83e7;return db['ChatGroup']['findOne']({'where':{'id':_0x3aa49d[_0x6cf8('0x4f')]['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x196d4d,null))[_0x6cf8('0x2b')](function(_0x4808d3){if(_0x4808d3){_0x13cc46=_0x4808d3;_0x358022['model']=_['keys'](db[_0x6cf8('0x59')][_0x6cf8('0x31')]);_0x358022[_0x6cf8('0x36')]=_[_0x6cf8('0x37')](_0x3aa49d[_0x6cf8('0x36')]);_0x358022['filters']=_[_0x6cf8('0x39')](_0x358022[_0x6cf8('0x34')],_0x358022[_0x6cf8('0x36')]);_0x54cd81[_0x6cf8('0x3b')]=_[_0x6cf8('0x39')](_0x358022['model'],qs[_0x6cf8('0x3a')](_0x3aa49d['query']['fields']));_0x54cd81[_0x6cf8('0x3b')]=_0x54cd81['attributes']['length']?_0x54cd81[_0x6cf8('0x3b')]:_0x358022[_0x6cf8('0x34')];_0x54cd81[_0x6cf8('0x3e')]=qs[_0x6cf8('0x3f')](_0x3aa49d[_0x6cf8('0x36')]['sort']);_0x54cd81[_0x6cf8('0x40')]=qs['filters'](_[_0x6cf8('0x41')](_0x3aa49d['query'],_0x358022[_0x6cf8('0x38')]));if(_0x3aa49d['query']['filter']){_0x54cd81['where']=_[_0x6cf8('0x43')](_0x54cd81[_0x6cf8('0x40')],{'$or':_[_0x6cf8('0x35')](_0x54cd81[_0x6cf8('0x3b')],function(_0x44a2bd){var _0x414ab8={};_0x414ab8[_0x44a2bd]={'$like':'%'+_0x3aa49d[_0x6cf8('0x36')][_0x6cf8('0x42')]+'%'};return _0x414ab8;})});}_0x54cd81=_[_0x6cf8('0x43')]({},_0x54cd81,_0x3aa49d[_0x6cf8('0x44')]);return _0x13cc46[_0x6cf8('0x58')](_0x54cd81);}})[_0x6cf8('0x2b')](function(_0x8aa9f9){if(_0x8aa9f9){_0x2e83e7=_0x8aa9f9[_0x6cf8('0x3c')];if(!_0x3aa49d['query']['hasOwnProperty'](_0x6cf8('0x3d'))){_0x54cd81[_0x6cf8('0x27')]=qs[_0x6cf8('0x27')](_0x3aa49d[_0x6cf8('0x36')][_0x6cf8('0x27')]);_0x54cd81[_0x6cf8('0x24')]=qs[_0x6cf8('0x24')](_0x3aa49d[_0x6cf8('0x36')]['offset']);}return _0x13cc46['getMembers'](_0x54cd81);}})[_0x6cf8('0x2b')](function(_0x424174){if(_0x424174){return _0x424174?{'count':_0x2e83e7,'rows':_0x424174}:null;}})[_0x6cf8('0x2b')](respondWithResult(_0x196d4d,null))[_0x6cf8('0x49')](handleError(_0x196d4d,null));};exports[_0x6cf8('0x5a')]=function(_0x9c3dd7,_0x227465,_0x543919){return db[_0x6cf8('0x45')][_0x6cf8('0x4e')]({'where':{'id':_0x9c3dd7[_0x6cf8('0x4f')]['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x227465,null))[_0x6cf8('0x2b')](function(_0x885b96){if(_0x885b96){return _0x885b96[_0x6cf8('0x5a')](_0x9c3dd7[_0x6cf8('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x227465,null))[_0x6cf8('0x49')](handleError(_0x227465,null));};exports[_0x6cf8('0x5b')]=function(_0x40170b,_0xdeff73,_0x183c20){if(_0x40170b[_0x6cf8('0x4c')]['id']){delete _0x40170b[_0x6cf8('0x4c')]['id'];}return db[_0x6cf8('0x45')][_0x6cf8('0x4e')]({'where':{'id':_0x40170b[_0x6cf8('0x4f')]['id']}})['then'](handleEntityNotFound(_0xdeff73,null))[_0x6cf8('0x2b')](function(_0x45dd20){if(_0x45dd20){_0x40170b[_0x6cf8('0x4c')][_0x6cf8('0x5c')]=_0x45dd20['id'];return db[_0x6cf8('0x52')][_0x6cf8('0x5d')](_0x40170b['body']);}})[_0x6cf8('0x2b')](respondWithResult(_0xdeff73,null))['catch'](handleError(_0xdeff73,null));};exports['getMessages']=function(_0x49c045,_0x57eb74,_0x5b053c){var _0x53b908={};var _0x1dd32f={};var _0x46899c;var _0xb32ce9;return db[_0x6cf8('0x45')]['findOne']({'where':{'id':_0x49c045[_0x6cf8('0x4f')]['id']}})[_0x6cf8('0x2b')](handleEntityNotFound(_0x57eb74,null))[_0x6cf8('0x2b')](function(_0x51047b){if(_0x51047b){_0x46899c=_0x51047b;_0x1dd32f[_0x6cf8('0x34')]=_[_0x6cf8('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x1dd32f[_0x6cf8('0x36')]=_[_0x6cf8('0x37')](_0x49c045[_0x6cf8('0x36')]);_0x1dd32f[_0x6cf8('0x38')]=_[_0x6cf8('0x39')](_0x1dd32f[_0x6cf8('0x34')],_0x1dd32f[_0x6cf8('0x36')]);_0x53b908[_0x6cf8('0x3b')]=_['intersection'](_0x1dd32f[_0x6cf8('0x34')],qs[_0x6cf8('0x3a')](_0x49c045['query'][_0x6cf8('0x3a')]));_0x53b908['attributes']=_0x53b908[_0x6cf8('0x3b')][_0x6cf8('0x3c')]?_0x53b908['attributes']:_0x1dd32f['model'];_0x53b908[_0x6cf8('0x3e')]=qs[_0x6cf8('0x3f')](_0x49c045[_0x6cf8('0x36')][_0x6cf8('0x3f')]);_0x53b908[_0x6cf8('0x40')]=qs[_0x6cf8('0x38')](_[_0x6cf8('0x41')](_0x49c045['query'],_0x1dd32f[_0x6cf8('0x38')]));if(_0x49c045['query'][_0x6cf8('0x42')]){_0x53b908[_0x6cf8('0x40')]=_['merge'](_0x53b908['where'],{'$or':_[_0x6cf8('0x35')](_0x53b908[_0x6cf8('0x3b')],function(_0x3d17ca){var _0x5111ae={};_0x5111ae[_0x3d17ca]={'$like':'%'+_0x49c045[_0x6cf8('0x36')][_0x6cf8('0x42')]+'%'};return _0x5111ae;})});}if(_0x49c045[_0x6cf8('0x36')][_0x6cf8('0x5e')]){var _0x3d3867=_0x49c045[_0x6cf8('0x36')][_0x6cf8('0x5e')]['split'](',');var _0x55675d={};_0x55675d[_0x3d3867[0x0]]={'$gte':moment(_0x3d3867[0x1])[_0x6cf8('0x5f')](_0x6cf8('0x60'))};_0x53b908[_0x6cf8('0x40')]=_[_0x6cf8('0x43')](_0x53b908[_0x6cf8('0x40')],_0x55675d);}_0x53b908=_[_0x6cf8('0x43')]({},_0x53b908,_0x49c045[_0x6cf8('0x44')]);return _0x46899c[_0x6cf8('0x61')](_0x53b908);}})[_0x6cf8('0x2b')](function(_0xd24313){if(_0xd24313){_0xb32ce9=_0xd24313[_0x6cf8('0x3c')];if(!_0x49c045['query']['hasOwnProperty'](_0x6cf8('0x3d'))){_0x53b908[_0x6cf8('0x27')]=qs[_0x6cf8('0x27')](_0x49c045['query'][_0x6cf8('0x27')]);_0x53b908[_0x6cf8('0x24')]=qs[_0x6cf8('0x24')](_0x49c045[_0x6cf8('0x36')][_0x6cf8('0x24')]);}return _0x46899c[_0x6cf8('0x61')](_0x53b908);}})[_0x6cf8('0x2b')](function(_0x170a9a){if(_0x170a9a){return _0x170a9a?{'count':_0xb32ce9,'rows':_0x170a9a}:null;}})[_0x6cf8('0x2b')](respondWithResult(_0x57eb74,null))['catch'](handleError(_0x57eb74,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 61284e3..f3a7a7c 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 _0x8cb8=['setMaxListeners','remove','emit','exports','../../mysqldb'];(function(_0x3d4417,_0x479af9){var _0x56c435=function(_0x3470ec){while(--_0x3470ec){_0x3d4417['push'](_0x3d4417['shift']());}};_0x56c435(++_0x479af9);}(_0x8cb8,0x1da));var _0x88cb=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0x8cb8[_0x20beae];return _0xf5725;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x88cb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x88cb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x88cb('0x2')};function emitEvent(_0x34501e){return function(_0x3d0714,_0x535248,_0x5298d8){ChatGroupEvents[_0x88cb('0x3')](_0x34501e+':'+_0x3d0714['id'],_0x3d0714);ChatGroupEvents[_0x88cb('0x3')](_0x34501e,_0x3d0714);_0x5298d8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x88cb('0x4')]=ChatGroupEvents; \ No newline at end of file +var _0xa280=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa280,0xc4));var _0x0a28=function(_0x5c703d,_0x23f1e2){_0x5c703d=_0x5c703d-0x0;var _0x1905cb=_0xa280[_0x5c703d];return _0x1905cb;};'use strict';var EventEmitter=require(_0x0a28('0x0'));var ChatGroup=require(_0x0a28('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0a28('0x2')](0x0);var events={'afterCreate':_0x0a28('0x3'),'afterUpdate':_0x0a28('0x4'),'afterDestroy':_0x0a28('0x5')};function emitEvent(_0x937d8c){return function(_0x3054f1,_0x39026f,_0x4682fa){ChatGroupEvents[_0x0a28('0x6')](_0x937d8c+':'+_0x3054f1['id'],_0x3054f1);ChatGroupEvents[_0x0a28('0x6')](_0x937d8c,_0x3054f1);_0x4682fa(null);};}for(var e in events){if(events[_0x0a28('0x7')](e)){var event=events[e];ChatGroup[_0x0a28('0x8')](e,emitEvent(event));}}module[_0x0a28('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 7cc9f79..afea7d1 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 _0x46ec=['util','../../config/logger','api','bluebird','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x2a207a,_0x5979cb){var _0x360ab0=function(_0xbb3bf7){while(--_0xbb3bf7){_0x2a207a['push'](_0x2a207a['shift']());}};_0x360ab0(++_0x5979cb);}(_0x46ec,0x12b));var _0xc46e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc46e('0x0'));var util=require(_0xc46e('0x1'));var logger=require(_0xc46e('0x2'))(_0xc46e('0x3'));var moment=require('moment');var BPromise=require(_0xc46e('0x4'));var rp=require(_0xc46e('0x5'));var fs=require('fs');var path=require(_0xc46e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc46e('0x7'));module[_0xc46e('0x8')]=function(_0x34a06a,_0x23a36f){return _0x34a06a[_0xc46e('0x9')](_0xc46e('0xa'),attributes,{'tableName':_0xc46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7972=['rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7972,0x10e));var _0x2797=function(_0x41df87,_0x47be87){_0x41df87=_0x41df87-0x0;var _0x4c56eb=_0x7972[_0x41df87];return _0x4c56eb;};'use strict';var _=require(_0x2797('0x0'));var util=require(_0x2797('0x1'));var logger=require(_0x2797('0x2'))('api');var moment=require(_0x2797('0x3'));var BPromise=require('bluebird');var rp=require(_0x2797('0x4'));var fs=require('fs');var path=require(_0x2797('0x5'));var rimraf=require(_0x2797('0x6'));var config=require(_0x2797('0x7'));var attributes=require('./chatGroup.attributes');module[_0x2797('0x8')]=function(_0x2050a4,_0x41b9aa){return _0x2050a4[_0x2797('0x9')](_0x2797('0xa'),attributes,{'tableName':_0x2797('0xb'),'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 1cdfc4e..8031f9c 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 _0xc903=['then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xc903,0x177));var _0x3c90=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0xc903[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0x3c90('0x0'));var util=require('util');var moment=require(_0x3c90('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c90('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c90('0x3'));var logger=require('../../config/logger')(_0x3c90('0x4'));var config=require(_0x3c90('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3c90('0x6')][_0x3c90('0x7')]({'port':0x232a});config[_0x3c90('0x8')]=_[_0x3c90('0x9')](config[_0x3c90('0x8')],{'host':_0x3c90('0xa'),'port':0x18eb});var socket=require(_0x3c90('0xb'))(new Redis(config[_0x3c90('0x8')]));require(_0x3c90('0xc'))[_0x3c90('0xd')](socket);function respondWithRpcPromise(_0x4b0623,_0x53a284,_0x4984be){return new BPromise(function(_0x54f29b,_0x36f1c2){return client[_0x3c90('0xe')](_0x4b0623,_0x4984be)[_0x3c90('0xf')](function(_0x39f57a){logger['info'](_0x3c90('0x10'),_0x53a284,_0x3c90('0x11'));logger[_0x3c90('0x12')](_0x3c90('0x13'),_0x53a284,_0x3c90('0x11'),JSON[_0x3c90('0x14')](_0x39f57a));if(_0x39f57a[_0x3c90('0x15')]){if(_0x39f57a[_0x3c90('0x15')]['code']===0x1f4){logger[_0x3c90('0x15')](_0x3c90('0x10'),_0x53a284,_0x39f57a[_0x3c90('0x15')][_0x3c90('0x16')]);return _0x36f1c2(_0x39f57a['error'][_0x3c90('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x53a284,_0x39f57a['error']['message']);return _0x54f29b(_0x39f57a[_0x3c90('0x15')][_0x3c90('0x16')]);}else{logger[_0x3c90('0x17')](_0x3c90('0x10'),_0x53a284,'request\x20sent');_0x54f29b(_0x39f57a[_0x3c90('0x18')][_0x3c90('0x16')]);}})[_0x3c90('0x19')](function(_0x2f37f7){logger[_0x3c90('0x15')]('ChatGroup,\x20%s,\x20%s',_0x53a284,_0x2f37f7);_0x36f1c2(_0x2f37f7);});});} \ No newline at end of file +var _0x94b1=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x4b346d,_0x1e2469){var _0x3045c1=function(_0x3fc122){while(--_0x3fc122){_0x4b346d['push'](_0x4b346d['shift']());}};_0x3045c1(++_0x1e2469);}(_0x94b1,0x102));var _0x194b=function(_0x21c225,_0x531849){_0x21c225=_0x21c225-0x0;var _0x539351=_0x94b1[_0x21c225];return _0x539351;};'use strict';var _=require('lodash');var util=require(_0x194b('0x0'));var moment=require('moment');var BPromise=require(_0x194b('0x1'));var rs=require(_0x194b('0x2'));var fs=require('fs');var Redis=require(_0x194b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x194b('0x4'));var logger=require(_0x194b('0x5'))(_0x194b('0x6'));var config=require(_0x194b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x194b('0x8')][_0x194b('0x9')]({'port':0x232a});config['redis']=_[_0x194b('0xa')](config[_0x194b('0xb')],{'host':_0x194b('0xc'),'port':0x18eb});var socket=require(_0x194b('0xd'))(new Redis(config[_0x194b('0xb')]));require(_0x194b('0xe'))[_0x194b('0xf')](socket);function respondWithRpcPromise(_0x129924,_0x38be0a,_0x4f4736){return new BPromise(function(_0x17767b,_0x67a553){return client[_0x194b('0x10')](_0x129924,_0x4f4736)['then'](function(_0x1852b8){logger[_0x194b('0x11')](_0x194b('0x12'),_0x38be0a,_0x194b('0x13'));logger[_0x194b('0x14')](_0x194b('0x15'),_0x38be0a,_0x194b('0x13'),JSON[_0x194b('0x16')](_0x1852b8));if(_0x1852b8[_0x194b('0x17')]){if(_0x1852b8[_0x194b('0x17')][_0x194b('0x18')]===0x1f4){logger[_0x194b('0x17')](_0x194b('0x12'),_0x38be0a,_0x1852b8[_0x194b('0x17')][_0x194b('0x19')]);return _0x67a553(_0x1852b8[_0x194b('0x17')][_0x194b('0x19')]);}logger[_0x194b('0x17')](_0x194b('0x12'),_0x38be0a,_0x1852b8[_0x194b('0x17')][_0x194b('0x19')]);return _0x17767b(_0x1852b8['error']['message']);}else{logger[_0x194b('0x11')](_0x194b('0x12'),_0x38be0a,_0x194b('0x13'));_0x17767b(_0x1852b8[_0x194b('0x1a')][_0x194b('0x19')]);}})[_0x194b('0x1b')](function(_0x1cc1fc){logger[_0x194b('0x17')]('ChatGroup,\x20%s,\x20%s',_0x38be0a,_0x1cc1fc);_0x67a553(_0x1cc1fc);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d188c53..3440216 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 _0x78ec=['removeListener','register','length','chatGroup:','save','remove','emit'];(function(_0x5252f0,_0x3a034f){var _0x3d7a1c=function(_0x26fcd2){while(--_0x26fcd2){_0x5252f0['push'](_0x5252f0['shift']());}};_0x3d7a1c(++_0x3a034f);}(_0x78ec,0x115));var _0xc78e=function(_0x66c0b9,_0x385155){_0x66c0b9=_0x66c0b9-0x0;var _0x1e3668=_0x78ec[_0x66c0b9];return _0x1e3668;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc78e('0x0'),_0xc78e('0x1'),'update'];function createListener(_0x3d796a,_0x180f94){return function(_0xc192bc){_0x180f94[_0xc78e('0x2')](_0x3d796a,_0xc192bc);};}function removeListener(_0x52b80c,_0x590af4){return function(){ChatGroupEvents[_0xc78e('0x3')](_0x52b80c,_0x590af4);};}exports[_0xc78e('0x4')]=function(_0x494069){for(var _0x54c6aa=0x0,_0x2e23dd=events[_0xc78e('0x5')];_0x54c6aa<_0x2e23dd;_0x54c6aa++){var _0x3da443=events[_0x54c6aa];var _0xdc9beb=createListener(_0xc78e('0x6')+_0x3da443,_0x494069);ChatGroupEvents['on'](_0x3da443,_0xdc9beb);}}; \ No newline at end of file +var _0xf6fc=['emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x386dcf,_0x102e99){var _0x3d9f55=function(_0x3499c7){while(--_0x3499c7){_0x386dcf['push'](_0x386dcf['shift']());}};_0x3d9f55(++_0x102e99);}(_0xf6fc,0x1a3));var _0xcf6f=function(_0xd97c92,_0x2f9f92){_0xd97c92=_0xd97c92-0x0;var _0x3e1a5b=_0xf6fc[_0xd97c92];return _0x3e1a5b;};'use strict';var ChatGroupEvents=require(_0xcf6f('0x0'));var events=['save','remove','update'];function createListener(_0x2f4f97,_0x2d4cb4){return function(_0x4b28a7){_0x2d4cb4[_0xcf6f('0x1')](_0x2f4f97,_0x4b28a7);};}function removeListener(_0x263c8b,_0x3c4069){return function(){ChatGroupEvents[_0xcf6f('0x2')](_0x263c8b,_0x3c4069);};}exports['register']=function(_0x350ffe){for(var _0x5c6998=0x0,_0x66b2b0=events[_0xcf6f('0x3')];_0x5c6998<_0x66b2b0;_0x5c6998++){var _0x4a84a8=events[_0x5c6998];var _0x409471=createListener(_0xcf6f('0x4')+_0x4a84a8,_0x350ffe);ChatGroupEvents['on'](_0x4a84a8,_0x409471);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ca679c6..46b7e62 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 _0xbc54=['getUnread','getMembers','getMessages','create','post','addMembers','addMessage','put','update','delete','/:id/members','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xbc54,0x1bf));var _0x4bc5=function(_0x4d8af0,_0x5ea52f){_0x4d8af0=_0x4d8af0-0x0;var _0x562c02=_0xbc54[_0x4d8af0];return _0x562c02;};'use strict';var multer=require(_0x4bc5('0x0'));var util=require(_0x4bc5('0x1'));var path=require(_0x4bc5('0x2'));var timeout=require(_0x4bc5('0x3'));var express=require(_0x4bc5('0x4'));var router=express[_0x4bc5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4bc5('0x6'));var config=require(_0x4bc5('0x7'));var controller=require(_0x4bc5('0x8'));router[_0x4bc5('0x9')]('/',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0xb')]);router['get'](_0x4bc5('0xc'),auth[_0x4bc5('0xa')](),controller[_0x4bc5('0xd')]);router[_0x4bc5('0x9')](_0x4bc5('0xe'),auth[_0x4bc5('0xa')](),controller[_0x4bc5('0xf')]);router[_0x4bc5('0x9')](_0x4bc5('0x10'),auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x11')]);router[_0x4bc5('0x9')]('/:id/members',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x12')]);router[_0x4bc5('0x9')]('/:id/messages',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x13')]);router['post']('/',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x14')]);router[_0x4bc5('0x15')]('/:id/members',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x16')]);router[_0x4bc5('0x15')]('/:id/messages',auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x17')]);router[_0x4bc5('0x18')](_0x4bc5('0xe'),auth[_0x4bc5('0xa')](),controller[_0x4bc5('0x19')]);router[_0x4bc5('0x1a')](_0x4bc5('0xe'),auth[_0x4bc5('0xa')](),controller['destroy']);router['delete'](_0x4bc5('0x1b'),auth[_0x4bc5('0xa')](),controller['removeMembers']);module[_0x4bc5('0x1c')]=router; \ No newline at end of file +var _0xb303=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show','get','getUnread','/:id/members','getMembers','getMessages','post','create','/:id/messages','put','update','delete','destroy','removeMembers','multer'];(function(_0x5a5ffc,_0xc56a5f){var _0xbef3f0=function(_0x1b13a1){while(--_0x1b13a1){_0x5a5ffc['push'](_0x5a5ffc['shift']());}};_0xbef3f0(++_0xc56a5f);}(_0xb303,0x6f));var _0x3b30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb303[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3b30('0x0'));var util=require(_0x3b30('0x1'));var path=require(_0x3b30('0x2'));var timeout=require(_0x3b30('0x3'));var express=require(_0x3b30('0x4'));var router=express[_0x3b30('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3b30('0x6'));var interaction=require(_0x3b30('0x7'));var config=require(_0x3b30('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x3b30('0x9')](),controller[_0x3b30('0xa')]);router['get'](_0x3b30('0xb'),auth[_0x3b30('0x9')](),controller[_0x3b30('0xc')]);router['get'](_0x3b30('0xd'),auth['isAuthenticated'](),controller[_0x3b30('0xe')]);router[_0x3b30('0xf')]('/:id/unread',auth[_0x3b30('0x9')](),controller[_0x3b30('0x10')]);router[_0x3b30('0xf')](_0x3b30('0x11'),auth[_0x3b30('0x9')](),controller[_0x3b30('0x12')]);router['get']('/:id/messages',auth[_0x3b30('0x9')](),controller[_0x3b30('0x13')]);router[_0x3b30('0x14')]('/',auth[_0x3b30('0x9')](),controller[_0x3b30('0x15')]);router['post'](_0x3b30('0x11'),auth[_0x3b30('0x9')](),controller['addMembers']);router['post'](_0x3b30('0x16'),auth[_0x3b30('0x9')](),controller['addMessage']);router[_0x3b30('0x17')](_0x3b30('0xd'),auth[_0x3b30('0x9')](),controller[_0x3b30('0x18')]);router[_0x3b30('0x19')](_0x3b30('0xd'),auth[_0x3b30('0x9')](),controller[_0x3b30('0x1a')]);router[_0x3b30('0x19')]('/:id/members',auth['isAuthenticated'](),controller[_0x3b30('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cb0524b..dda4f27 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 _0x8caf=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','BOOLEAN'];(function(_0x43daf6,_0x4e9808){var _0x43ee0c=function(_0x1b0120){while(--_0x1b0120){_0x43daf6['push'](_0x43daf6['shift']());}};_0x43ee0c(++_0x4e9808);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x272700,_0x525483){_0x272700=_0x272700-0x0;var _0x3927a4=_0x8caf[_0x272700];return _0x3927a4;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'closed':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf8ca('0x2')]},'ratingType':{'type':Sequelize[_0xf8ca('0x3')](_0xf8ca('0x4'),_0xf8ca('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf8ca('0x6')]},'pathTranscript':{'type':Sequelize[_0xf8ca('0x6')]},'mailTranscript':{'type':Sequelize[_0xf8ca('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf8ca('0x8')]},'disposition':{'type':Sequelize[_0xf8ca('0x7')]},'secondDisposition':{'type':Sequelize[_0xf8ca('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf8ca('0x7')]},'browserName':{'type':Sequelize[_0xf8ca('0x7')]},'browserVersion':{'type':Sequelize[_0xf8ca('0x7')]},'osName':{'type':Sequelize[_0xf8ca('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf8ca('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xf8ca('0x6')]},'customerIp':{'type':Sequelize[_0xf8ca('0x7')]},'formData':{'type':Sequelize[_0xf8ca('0x6')](_0xf8ca('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf8ca('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf8ca('0x3')]('in',_0xf8ca('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf8ca('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf8ca('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xb2af=['TEXT','DATE','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2af,0xd2));var _0xfb2a=function(_0x49636d,_0x1b97a1){_0x49636d=_0x49636d-0x0;var _0x3a3ca2=_0xb2af[_0x49636d];return _0x3a3ca2;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'closed':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xfb2a('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xfb2a('0x4'),_0xfb2a('0x5')),'defaultValue':_0xfb2a('0x4')},'ratingMessage':{'type':Sequelize[_0xfb2a('0x6')]},'pathTranscript':{'type':Sequelize[_0xfb2a('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfb2a('0x7')]},'disposition':{'type':Sequelize[_0xfb2a('0x8')]},'secondDisposition':{'type':Sequelize[_0xfb2a('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfb2a('0x8')]},'browserName':{'type':Sequelize[_0xfb2a('0x8')]},'browserVersion':{'type':Sequelize[_0xfb2a('0x8')]},'osName':{'type':Sequelize[_0xfb2a('0x8')]},'osVersion':{'type':Sequelize[_0xfb2a('0x8')]},'deviceModel':{'type':Sequelize[_0xfb2a('0x8')]},'deviceVendor':{'type':Sequelize[_0xfb2a('0x8')]},'deviceType':{'type':Sequelize[_0xfb2a('0x8')]},'referer':{'type':Sequelize[_0xfb2a('0x6')]},'customerIp':{'type':Sequelize[_0xfb2a('0x8')]},'formData':{'type':Sequelize[_0xfb2a('0x6')](_0xfb2a('0x9'))},'read1stAt':{'type':Sequelize[_0xfb2a('0x7')]},'lastMsgAt':{'type':Sequelize[_0xfb2a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xfb2a('0xa')]('in',_0xfb2a('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 32aa94d..75755e2 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 _0x8603=['Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','Attachment','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','render','contact','agent','interaction','account','Users','fullname','Tags','TagIds','split','push','catch','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','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','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','customUpdate','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','mimetype','attachmentDownload'];(function(_0x59123d,_0x1fc4ee){var _0x1a057f=function(_0x2058d8){while(--_0x2058d8){_0x59123d['push'](_0x59123d['shift']());}};_0x1a057f(++_0x1fc4ee);}(_0x8603,0x190));var _0x3860=function(_0x1c5b1a,_0x3db3fe){_0x1c5b1a=_0x1c5b1a-0x0;var _0x351b48=_0x8603[_0x1c5b1a];return _0x351b48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3860('0x10'));var hardwareService=require(_0x3860('0x11'));var logger=require('../../config/logger')(_0x3860('0x12'));var utils=require(_0x3860('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3860('0x14'));var db=require(_0x3860('0x15'))['db'];config[_0x3860('0x16')]=_[_0x3860('0x17')](config[_0x3860('0x16')],{'host':_0x3860('0x18'),'port':0x18eb});var socket=require(_0x3860('0x19'))(new Redis(config[_0x3860('0x16')]));require(_0x3860('0x1a'))[_0x3860('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232b});var client9004=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1055b3,_0xfa0c9a,_0x2d8a3a,_0x378305){return new BPromise(function(_0x311fdb,_0x3c0d91){var _0x3e51b4=_0x378305||client;return _0x3e51b4[_0x3860('0x1e')](_0x1055b3,_0x2d8a3a)['then'](function(_0x4863bd){logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));logger['debug'](_0x3860('0x22'),_0xfa0c9a,_0x3860('0x21'),JSON[_0x3860('0x23')](_0x4863bd));if(_0x4863bd[_0x3860('0x24')]){if(_0x4863bd[_0x3860('0x24')][_0x3860('0x25')]===0x1f4){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);return _0x3c0d91(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')]['message']);return _0x311fdb(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}else{logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));_0x311fdb(_0x4863bd['result'][_0x3860('0x26')]);}})['catch'](function(_0x577750){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x577750);_0x3c0d91(_0x577750);});});}function respondWithStatusCode(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0xcc;return function(_0x5f42d5){if(_0x5f42d5){return _0x54b5ec[_0x3860('0x27')](_0x4d9a90);}return _0x54b5ec[_0x3860('0x28')](_0x4d9a90)[_0x3860('0x29')]();};}function respondWithResult(_0x371f3a,_0x9332a5){_0x9332a5=_0x9332a5||0xc8;return function(_0x228d34){if(_0x228d34){return _0x371f3a['status'](_0x9332a5)['json'](_0x228d34);}};}function respondWithFilteredResult(_0x389bd0,_0x1f1809){return function(_0x5a9af2){if(_0x5a9af2){var _0x2551f4=typeof _0x1f1809[_0x3860('0x2a')]===_0x3860('0x2b')&&typeof _0x1f1809[_0x3860('0x2c')]===_0x3860('0x2b');var _0x4bbae9=_0x5a9af2[_0x3860('0x2d')];var _0xf624ba=_0x2551f4?0x0:_0x1f1809[_0x3860('0x2a')];var _0x4bd90c=_0x2551f4?_0x5a9af2[_0x3860('0x2d')]:_0x1f1809['offset']+_0x1f1809[_0x3860('0x2c')];var _0x4825f0;if(_0x4bd90c>=_0x4bbae9){_0x4bd90c=_0x4bbae9;_0x4825f0=0xc8;}else{_0x4825f0=0xce;}_0x389bd0[_0x3860('0x28')](_0x4825f0);return _0x389bd0[_0x3860('0x2e')](_0x3860('0x2f'),_0xf624ba+'-'+_0x4bd90c+'/'+_0x4bbae9)['json'](_0x5a9af2);}return null;};}function patchUpdates(_0x39c751){return function(_0x451b0c){try{jsonpatch['apply'](_0x451b0c,_0x39c751,!![]);}catch(_0x1c94cc){return BPromise['reject'](_0x1c94cc);}return _0x451b0c[_0x3860('0x30')]();};}function saveUpdates(_0x3a577a,_0x35185c){return function(_0x2fc231){if(_0x2fc231){return _0x2fc231[_0x3860('0x31')](_0x3a577a)[_0x3860('0x32')](function(_0x1d3fd0){return _0x1d3fd0;});}return null;};}function removeEntity(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(_0x396ccf){return _0x396ccf['destroy']()[_0x3860('0x32')](function(){_0x4d30bc[_0x3860('0x28')](0xcc)[_0x3860('0x29')]();});}};}function handleEntityNotFound(_0x5af661,_0x523cc1){return function(_0x285b1b){if(!_0x285b1b){_0x5af661[_0x3860('0x27')](0x194);}return _0x285b1b;};}function handleError(_0x3abf18,_0xa921ed){_0xa921ed=_0xa921ed||0x1f4;return function(_0x59271f){logger['error'](_0x59271f[_0x3860('0x33')]);if(_0x59271f[_0x3860('0x34')]){delete _0x59271f[_0x3860('0x34')];}_0x3abf18[_0x3860('0x28')](_0xa921ed)[_0x3860('0x35')](_0x59271f);};}function getMustacheRender(_0x4df2a9,_0x424424){return Mustache[_0x3860('0x36')](_0x4df2a9,_['merge'](_0x424424['body'],{'contact':_0x424424[_0x3860('0x37')],'message':_0x424424[_0x3860('0x26')],'agent':_0x424424[_0x3860('0x38')],'interaction':_0x424424[_0x3860('0x39')],'account':_0x424424[_0x3860('0x3a')]}))||'';}function getInteractionUsers(_0x592311,_0x28f04d){return new BPromise(function(_0x510aef,_0x112600){try{if(_0x28f04d[_0x592311['id']]){_0x592311[_0x3860('0x3b')]=_['map'](_0x28f04d[_0x592311['id']],function(_0x36d9bd){return{'id':_0x36d9bd['id'],'fullname':_0x36d9bd[_0x3860('0x3c')]};});}}catch(_0x4f3303){_0x112600(_0x4f3303);}_0x510aef(_0x592311);});}function getInteractionTags(_0x1ef9aa,_0xc7d34d){return new BPromise(function(_0x15bd2c,_0xf346e){try{if(_0x1ef9aa['TagIds']){_0x1ef9aa[_0x3860('0x3d')]=[];_0x1ef9aa[_0x3860('0x3e')][_0x3860('0x3f')](',')['forEach'](function(_0x3a87e5){_0x1ef9aa['Tags'][_0x3860('0x40')](_0xc7d34d[_0x3a87e5]);});}delete _0x1ef9aa[_0x3860('0x3e')];}catch(_0x405bfc){_0xf346e(_0x405bfc);}_0x15bd2c(_0x1ef9aa);});}function updateChatInteraction(_0x3f613f,_0x2220c8,_0x3f4216){return new BPromise(function(_0x4e0a44,_0xbbbf01){return getInteractionUsers(_0x3f613f,_0x3f4216)[_0x3860('0x32')](function(_0x5dc78f){return getInteractionTags(_0x5dc78f,_0x2220c8);})['then'](function(_0x2938d4){_0x4e0a44(_0x2938d4);})[_0x3860('0x41')](function(_0x4f2f53){_0xbbbf01(_0x4f2f53);});});}exports[_0x3860('0x42')]=function(_0x30d8eb,_0x4c6c23){var _0xa6791a={},_0x56a650={},_0x392dc3={'count':0x0,'rows':[]};var _0x37e5c3=_[_0x3860('0x43')](db[_0x3860('0x44')][_0x3860('0x45')],function(_0x15ebbd){return{'name':_0x15ebbd[_0x3860('0x46')],'type':_0x15ebbd[_0x3860('0x47')][_0x3860('0x48')]};});_0x56a650[_0x3860('0x49')]=_[_0x3860('0x43')](_0x37e5c3,'name');_0x56a650[_0x3860('0x4a')]=_['keys'](_0x30d8eb[_0x3860('0x4a')]);_0x56a650[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],_0x56a650[_0x3860('0x4a')]);_0xa6791a[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],qs['fields'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x4e')]));_0xa6791a[_0x3860('0x4d')]=_0xa6791a['attributes'][_0x3860('0x4f')]?_0xa6791a[_0x3860('0x4d')]:_0x56a650[_0x3860('0x49')];if(!_0x30d8eb[_0x3860('0x4a')]['hasOwnProperty']('nolimit')){_0xa6791a[_0x3860('0x2c')]=qs['limit'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x2c')]);_0xa6791a[_0x3860('0x2a')]=qs['offset'](_0x30d8eb[_0x3860('0x4a')]['offset']);}_0xa6791a[_0x3860('0x50')]=qs['sort'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x51')]);_0xa6791a[_0x3860('0x52')]=qs['filters'](_['pick'](_0x30d8eb[_0x3860('0x4a')],_0x56a650[_0x3860('0x4b')]),_0x37e5c3);var _0x478dd9=[];var _0x3910f5=squel['select']()[_0x3860('0x53')]('id')[_0x3860('0x53')](_0x3860('0x34'))[_0x3860('0x53')](_0x3860('0x54'))[_0x3860('0x55')](_0x3860('0x56'));var _0x5a9987=squel[_0x3860('0x57')]()[_0x3860('0x53')](_0x3860('0x58'))[_0x3860('0x53')](_0x3860('0x59'))[_0x3860('0x53')]('ui.ChatInteractionId')[_0x3860('0x55')](_0x3860('0x5a'),'ui')[_0x3860('0x5b')](_0x3860('0x5c'),'u',_0x3860('0x5d'));var _0x1e2b5d=squel[_0x3860('0x57')]()[_0x3860('0x55')]('chat_interactions','i')[_0x3860('0x5b')](_0x3860('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3860('0x5b')](_0x3860('0x5c'),'o',_0x3860('0x5f'))['left_join'](_0x3860('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3860('0x5b')](_0x3860('0x61'),'me',_0x3860('0x62'))[_0x3860('0x5b')](_0x3860('0x63'),'it',_0x3860('0x64'))[_0x3860('0x5b')](_0x3860('0x56'),'t',_0x3860('0x65'));var _0x151492=squel[_0x3860('0x66')]();var _0x2bac24=[];var _0x58147d=squel['expr']();var _0x5111e0;if(_0x30d8eb[_0x3860('0x4a')]['search']){_0x5111e0=as['parseSearch'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x67')]);var _0x2ff440=_0x5111e0[_0x3860('0x68')];for(var _0x3d6c17=0x0;_0x3d6c17<_0x5111e0[_0x3860('0x69')]['length'];_0x3d6c17++){var _0x49ec68=_0x5111e0['conditions'][_0x3d6c17];var _0x1d6c70='i';var _0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,['name',_0x49ec68[_0x3860('0x53')]]);if(!_0x1c1da4){switch(_0x49ec68['field']){case _0x3860('0x6b'):if(_0x49ec68[_0x3860('0x6c')]==0x1){_0x1e2b5d['having']('`'+_0x49ec68[_0x3860('0x53')]+_0x3860('0x6d'));}else{_0x1e2b5d[_0x3860('0x6e')]('`'+_0x49ec68[_0x3860('0x53')]+'`\x20>\x200');}break;case _0x3860('0x6f'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){if(_0x49ec68['value']['split']('\x20')[_0x3860('0x4f')]>0x1){_0x151492[_0x2ff440](_0x3860('0x72'),qs[_0x3860('0x73')](_0x49ec68[_0x3860('0x6c')]),null);}else{var _0x28a8b4='%'+_0x49ec68[_0x3860('0x6c')]+'%';_0x151492[_0x2ff440]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x28a8b4,_0x28a8b4,_0x28a8b4);}}else{_0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,[_0x3860('0x34'),'ContactId']);_0x49ec68[_0x3860('0x53')]=_0x3860('0x74');_0x3427a5=as[_0x3860('0x75')](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x77'):var _0x27e5ab=_0x49ec68[_0x3860('0x6c')][_0x3860('0x3f')](',')['map'](function(_0x1ae31b){return Number(_0x1ae31b);});_0x27e5ab[_0x3860('0x78')](function(_0x1c33dc){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c33dc+',%');});_0x2bac24=_['union'](_0x2bac24,_0x27e5ab);break;case _0x3860('0x79'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){_0x151492[_0x2ff440](_0x3860('0x7a'),'%'+_0x49ec68[_0x3860('0x6c')]+'%',null);}else{_0x1c1da4=_['find'](_0x37e5c3,['name',_0x3860('0x7b')]);_0x49ec68[_0x3860('0x53')]='UserId';_0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5['value'][_0x3860('0x7c')],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x7d'):_0x3427a5=as['buildExpression']('me',null,_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);break;}}else{var _0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5['text'],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);}}}else{var _0x49c356=_(_0x30d8eb[_0x3860('0x4a')])[_0x3860('0x7e')]()[_0x3860('0x43')](function(_0x2fd2f4){return _[_0x3860('0x7f')](_0x37e5c3,[_0x3860('0x34'),_0x2fd2f4])?_0x2fd2f4:undefined;})['compact']()[_0x3860('0x6c')]();if(!_[_0x3860('0x80')](_0x49c356)){_0x49c356[_0x3860('0x78')](function(_0x5d7cc4){if(_0x5d7cc4===_0x3860('0x81')){_0x1e2b5d['where'](_0x3860('0x82'),[][_0x3860('0x83')](_0x30d8eb['query'][_0x5d7cc4]));}else if(_0x5d7cc4===_0x3860('0x84')){var _0x2cd731=JSON[_0x3860('0x85')](_0x30d8eb['query'][_0x5d7cc4])['$gte'];var _0x5a282a=JSON['parse'](_0x30d8eb[_0x3860('0x4a')][_0x5d7cc4])[_0x3860('0x86')];_0x1e2b5d[_0x3860('0x52')](_0x3860('0x87'),_0x2cd731,_0x5a282a);}else{if(_0x30d8eb['query'][_0x5d7cc4]==='null'){_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x88'));}else{_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x89'),_0x30d8eb['query'][_0x5d7cc4]);}}});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8a')]){if(_0x30d8eb['query']['read']==0x1){_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8b'));}else{_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8c'));}}if(_0x30d8eb['query']['tag']){_0x2bac24=_[_0x3860('0x8d')](_0x30d8eb['query'][_0x3860('0x8e')])?_0x30d8eb[_0x3860('0x4a')]['tag']:new Array(_0x30d8eb['query']['tag']);_0x2bac24[_0x3860('0x78')](function(_0x36116e){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36116e+',%');});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]){var _0x2351fe=_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x3860('0x90')](/'/g,'\x27\x27');if(qs[_0x3860('0x91')](_0x2351fe)){_0x151492['or'](_0x3860('0x92'),_0x2351fe+'%');}else{_0x151492['or'](_0x3860('0x93'),qs[_0x3860('0x73')](_0x2351fe))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2351fe+'%');}}}_0x1e2b5d[_0x3860('0x52')](_0x151492);_0x1e2b5d[_0x3860('0x94')](_0x3860('0x95'));var _0x41ee6f={'type':db[_0x3860('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x196c50=_0x1e2b5d[_0x3860('0x97')]();_0x196c50[_0x3860('0x53')](_0x3860('0x95'));_0x196c50[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));if(_0xa6791a['order']){_0xa6791a[_0x3860('0x50')][_0x3860('0x78')](function(_0x58eddd){var _0x1ff95b=_0x58eddd[0x0]===_0x3860('0x99')?_0x58eddd[0x0]:'i.'+_0x58eddd[0x0];_0x1e2b5d[_0x3860('0x50')](_0x1ff95b,_0x58eddd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3860('0x80')](_0x2bac24)){_0x1e2b5d[_0x3860('0x6e')](_0x58147d);_0x196c50['where'](_0x3860('0x9a'),_0x2bac24);}BPromise['resolve']()[_0x3860('0x32')](function(){if(!_0x5111e0){if(_0x30d8eb[_0x3860('0x4a')]['ChatWebsiteId'])return;_0x196c50[_0x3860('0x52')](_0x3860('0x9b'));_0x1e2b5d[_0x3860('0x52')](_0x3860('0x9b'));return;}if(_0x30d8eb[_0x3860('0x9c')]['role']!==_0x3860('0x38'))return;return _0x30d8eb[_0x3860('0x9c')][_0x3860('0x9d')]({'attributes':['id'],'raw':!![]})[_0x3860('0x32')](function(_0x3c9837){if(_['isEmpty'](_0x3c9837)){_0x196c50['where'](_0x3860('0x9e'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x196c50[_0x3860('0x52')](_0x3860('0x82'),_[_0x3860('0x43')](_0x3c9837,'id'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3860('0x43')](_0x3c9837,'id'));}});})['then'](function(){if(_0x30d8eb[_0x3860('0x9c')][_0x3860('0x9f')]===_0x3860('0x38')&&!_0x5111e0&&!_0x30d8eb[_0x3860('0x4a')][_0x3860('0x81')])return[];return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x196c50['toString'](),_0x41ee6f);})[_0x3860('0x32')](function(_0x47396d){_0x392dc3['count']=_0x47396d['length'];if(_0x392dc3['count']===0x0)return[];return db['sequelize'][_0x3860('0x4a')](_0x3910f5[_0x3860('0xa1')](),_0x41ee6f)[_0x3860('0x32')](function(_0x1482cd){_0x478dd9=_[_0x3860('0xa2')](_0x1482cd,'id');_0x41ee6f=_[_0x3860('0xa3')](_0x41ee6f,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30d8eb[_0x3860('0x4a')]['fields']){_0xa6791a[_0x3860('0x4d')][_0x3860('0x78')](function(_0x897ea0){_0x1e2b5d[_0x3860('0x53')]('i.'+_0x897ea0);});}else{_0x1e2b5d[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa4'),_0x3860('0xa5'));_0x1e2b5d[_0x3860('0x53')]('a.mandatoryDisposition',_0x3860('0xa6'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa7'),'contactName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa8'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa9'),'Contact.firstName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaa'),_0x3860('0xab'));_0x1e2b5d['field'](_0x3860('0xac'),_0x3860('0xad'));_0x1e2b5d[_0x3860('0x53')]('c.phone',_0x3860('0xae'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaf'),'Contact.mobile');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xb0'),_0x3860('0xb1'));_0x1e2b5d['field'](_0x3860('0xb2'),_0x3860('0xb3'));_0x1e2b5d[_0x3860('0x53')]('o.internal',_0x3860('0xb4'));_0x1e2b5d['field'](_0x3860('0xb5'),'TagIds');}if(_0xa6791a[_0x3860('0x2c')])_0x1e2b5d[_0x3860('0x2c')](_0xa6791a[_0x3860('0x2c')]);if(_0xa6791a[_0x3860('0x2a')])_0x1e2b5d[_0x3860('0x2a')](_0xa6791a[_0x3860('0x2a')]);return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x1e2b5d[_0x3860('0xa1')](),_0x41ee6f);})[_0x3860('0x32')](function(_0x10b4e8){if(_0x10b4e8[_0x3860('0x4f')]>0x0)_0x5a9987[_0x3860('0x52')](_0x3860('0xb6'),_[_0x3860('0x43')](_0x10b4e8,'id'));return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x5a9987[_0x3860('0xa1')](),_0x41ee6f)['then'](function(_0x37575b){var _0x1d6d2b=_[_0x3860('0xb7')](_0x37575b,_0x3860('0xb8'));var _0x3e6bf8=[];_0x10b4e8[_0x3860('0x78')](function(_0xffe2a1){_0x3e6bf8[_0x3860('0x40')](updateChatInteraction(_0xffe2a1,_0x478dd9,_0x1d6d2b));});return BPromise[_0x3860('0xb9')](_0x3e6bf8);});});})[_0x3860('0x32')](function(_0x3b932d){_0x392dc3['rows']=_0x3b932d;return _0x392dc3;})[_0x3860('0x32')](respondWithFilteredResult(_0x4c6c23,_0xa6791a))[_0x3860('0x41')](handleError(_0x4c6c23,null));};exports[_0x3860('0xba')]=function(_0x6334ca,_0x4a929e){var _0x1a1994={'raw':![],'where':{'id':_0x6334ca[_0x3860('0xbb')]['id']}},_0x2ece36={};_0x2ece36[_0x3860('0x49')]=_['keys'](db[_0x3860('0x44')]['rawAttributes']);_0x2ece36['query']=_[_0x3860('0x7e')](_0x6334ca[_0x3860('0x4a')]);_0x2ece36[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],_0x2ece36[_0x3860('0x4a')]);_0x1a1994[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x6334ca[_0x3860('0x4a')][_0x3860('0x4e')]));_0x1a1994[_0x3860('0x4d')]=_0x1a1994['attributes'][_0x3860('0x4f')]?_0x1a1994['attributes']:_0x2ece36[_0x3860('0x49')];if(_0x6334ca[_0x3860('0x4a')]['includeAll']){_0x1a1994[_0x3860('0xbc')]=[{'all':!![]}];}_0x1a1994=_[_0x3860('0xa3')]({},_0x1a1994,_0x6334ca[_0x3860('0xbd')]);return db[_0x3860('0x44')][_0x3860('0x6a')](_0x1a1994)[_0x3860('0x32')](handleEntityNotFound(_0x4a929e,null))[_0x3860('0x32')](respondWithResult(_0x4a929e,null))['catch'](handleError(_0x4a929e,null));};exports[_0x3860('0xbe')]=function(_0x6d1819,_0x9e1682){return db[_0x3860('0x44')][_0x3860('0xbe')](_0x6d1819['body'],{})[_0x3860('0x32')](respondWithResult(_0x9e1682,0xc9))['catch'](handleError(_0x9e1682,null));};exports['update']=function(_0x56af8c,_0x1059a4){if(_0x56af8c[_0x3860('0x7d')]['id']){delete _0x56af8c[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x56af8c[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x1059a4,null))[_0x3860('0x32')](saveUpdates(_0x56af8c['body'],null))[_0x3860('0x32')](respondWithResult(_0x1059a4,null))[_0x3860('0x41')](handleError(_0x1059a4,null));};exports['destroy']=function(_0x490884,_0x4428eb){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x490884['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4428eb,null))['then'](removeEntity(_0x4428eb,null))[_0x3860('0x41')](handleError(_0x4428eb,null));};exports['describe']=function(_0x41fd53,_0xf91fc2){return db['ChatInteraction'][_0x3860('0xbf')]()[_0x3860('0x32')](respondWithResult(_0xf91fc2,null))['catch'](handleError(_0xf91fc2,null));};exports[_0x3860('0xc0')]=function(_0x398bc1,_0x3312c4){var _0x501519=_0x398bc1[_0x3860('0xbb')]['id'];var _0x47fba5;var _0x3e3dac;var _0x18b845;return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x501519}})[_0x3860('0x32')](function(_0x2b1dc1){_0x47fba5=_0x2b1dc1;return db[_0x3860('0xc2')][_0x3860('0xc1')]({'where':{'id':_0x2b1dc1['ChatWebsiteId']},'attributes':['id',_0x3860('0xc3'),_0x3860('0xc4'),'vidaooTopic','vidaooNote',_0x3860('0xc5')],'raw':!![]});})['then'](function(_0xe27f6b){if(_0xe27f6b&&_0xe27f6b[_0x3860('0xc3')]&&_0xe27f6b['vidaooEscalation']){_0x3e3dac=_0xe27f6b;var _0x1041bf={'interaction':{'id':_0x501519},'agent':{'id':_0x398bc1['user']['id'],'name':_0x398bc1[_0x3860('0x9c')]['name'],'fullname':_0x398bc1[_0x3860('0x9c')][_0x3860('0x3c')],'email':_0x398bc1[_0x3860('0x9c')][_0x3860('0xc6')]},'contact':_0x398bc1['body'][_0x3860('0x37')],'account':_0x398bc1[_0x3860('0x7d')][_0x3860('0x3a')]};var _0x1e1baf={'rejectUnauthorized':![],'method':'POST','url':_0x3860('0xc7'),'headers':{'X-APIKEY':_0xe27f6b[_0x3860('0xc3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x398bc1['user'][_0x3860('0xc6')]],'buttons':null,'topic':_0x3e3dac[_0x3860('0xc8')],'note':_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xca')])?null:getMustacheRender(_0x3e3dac['vidaooNote'],_0x1041bf),'metadata':null},'redirect':_0x3860('0xcb'),'json':!![]};try{if(!_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xc5')])){var _0x1ce6e6=getMustacheRender(_0x3e3dac['vidaooMetadata'],_0x1041bf);var _0x1df44=JSON['parse'](_0x1ce6e6);_0x1e1baf['body']['metadata']=_0x1df44;}}catch(_0x15b53f){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1e1baf);}else{throw new db[(_0x3860('0x96'))]['ValidationError'](_0x3860('0xcd'));}})[_0x3860('0x32')](function(_0x21c052){_0x18b845=_0x21c052;if(_0x18b845['id']){var _0x3a920b={'body':_0x18b845['join_url'],'ChatWebsiteId':_0x3e3dac['id'],'ChatInteractionId':_0x47fba5['id'],'direction':_0x3860('0xce'),'UserId':_0x398bc1[_0x3860('0x9c')]['id']};return db[_0x3860('0xcf')]['create'](_0x3a920b,{});}else{throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x47fba5['updateAttributes']({'vidaooSessionId':_0x18b845['id']});})['then'](respondWithResult(_0x3312c4,null))[_0x3860('0x41')](handleError(_0x3312c4,null));};exports[_0x3860('0xd0')]=function(_0x2a09a2,_0x266347){if(_0x2a09a2[_0x3860('0x7d')]['id']){delete _0x2a09a2[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')]['find']({'where':{'id':_0x2a09a2['params']['id']},'include':[{'model':db['CmContact'],'as':_0x3860('0x6f')}]})[_0x3860('0x32')](handleEntityNotFound(_0x266347,null))[_0x3860('0x32')](saveUpdates(_0x2a09a2['body'],null))[_0x3860('0x32')](respondWithResult(_0x266347,null))['catch'](handleError(_0x266347,null));};exports['abandon']=function(_0x5f0700,_0x46f630,_0x505ba2){if(_0x5f0700['body']['id']){delete _0x5f0700[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x5f0700[_0x3860('0xbb')]['id']}})['then'](function(_0x53392b){if(!_0x53392b){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3860('0xd1'),0x194,'entity\x20not\x20found');_0x46f630['sendStatus'](0x194);}else{if(_0x53392b[_0x3860('0x7b')]){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))](_0x3860('0xd2'));}}return _0x53392b;})['then'](function(_0x6e541d){if(_0x6e541d){return _0x6e541d[_0x3860('0x31')]({'closed':_0x5f0700[_0x3860('0x7d')][_0x3860('0xd3')],'disposition':_0x5f0700['body']['disposition']})[_0x3860('0x32')](function(_0x55c19c){return _0x55c19c;});}})[_0x3860('0x32')](function(_0x4ab85d){return respondWithRpcPromise(_0x3860('0xd4'),_0x3860('0xd1'),_0x5f0700[_0x3860('0x7d')],client9004);})[_0x3860('0x32')](respondWithResult(_0x46f630,null))[_0x3860('0x41')](handleError(_0x46f630,null));};exports['attachmentUpload']=function(_0x5d3c4d,_0x5e3c54,_0x39e855){_0x5d3c4d[_0x3860('0x7d')][_0x3860('0x34')]=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd6')];_0x5d3c4d['body'][_0x3860('0xd7')]=_0x5d3c4d[_0x3860('0xd5')]['filename'];_0x5d3c4d[_0x3860('0x7d')]['type']=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd8')];return db['Attachment'][_0x3860('0xbe')](_0x5d3c4d[_0x3860('0x7d')])[_0x3860('0x32')](respondWithResult(_0x5e3c54,0xc9))[_0x3860('0x41')](handleError(_0x5e3c54,null));};exports[_0x3860('0xd9')]=function(_0x3e2dfc,_0x135e84,_0x199bbc){return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc[_0x3860('0xbb')]['id']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null))['then'](function(_0x369a4b){if(_0x369a4b){if(_0x369a4b['closed']){return _0x135e84[_0x3860('0x28')](0x193)['json']({'status':0x193,'message':_0x3860('0xda')});}return db['Attachment'][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc['query']['attachId']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null));}})[_0x3860('0x32')](function(_0xa152b4){if(_0xa152b4){var _0x28931d=_0xa152b4[_0x3860('0xdb')]!==null;var _0x5e65a2=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xde'));if(_0x28931d){_0x5e65a2=path[_0x3860('0xdc')](_0x5e65a2,_0x3860('0xdf'));}var _0x268658=path['join'](_0x5e65a2,_0xa152b4[_0x3860('0xd7')]);return _0x135e84['download'](_0x268658);}})[_0x3860('0x41')](handleError(_0x135e84,null));};exports[_0x3860('0xe0')]=function(_0x118c4e,_0x471da9){var _0x244ceb=null;var _0x24f8a6=null;var _0x532349=null;var _0x17fa12=null;if(_0x118c4e[_0x3860('0x7d')]['id']){delete _0x118c4e[_0x3860('0x7d')]['id'];}if(_0x118c4e[_0x3860('0x7d')]['mailTranscript']){_0x17fa12=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xe1'),util[_0x3860('0xe2')](_0x3860('0xe3'),Date[_0x3860('0xe4')]()));_0x118c4e['body'][_0x3860('0xe5')]=_0x17fa12;}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x118c4e[_0x3860('0xbb')]['id']},'include':[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x471da9,null))[_0x3860('0x32')](saveUpdates(_0x118c4e[_0x3860('0x7d')],null))['then'](function(_0x276828){if(_0x276828){_0x244ceb=_0x276828;return db[_0x3860('0xc2')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x81')]}});}})[_0x3860('0x32')](function(_0x1740d0){if(_0x1740d0){_0x532349=_0x1740d0;return db[_0x3860('0xe7')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x74')]}});}})[_0x3860('0x32')](function(_0x975c7f){if(_0x975c7f){_0x24f8a6=_0x975c7f;if(_0x17fa12){var _0x23207b=null;for(var _0x1a1366=0x1;_0x1a1366<_0x244ceb[_0x3860('0xe6')][_0x3860('0x4f')];++_0x1a1366){_0x23207b=_0x244ceb['Messages'][_0x1a1366];var _0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');var _0x1290e7=_0x118c4e[_0x3860('0x7d')]['customer']||util[_0x3860('0xe2')](_0x3860('0xe8'),_0x3860('0xeb'),_0x23207b['ContactId']);switch(_0x532349[_0x3860('0xec')]){case _0x3860('0xed'):_0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');break;case _0x3860('0xee'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0xef')]||_0x23207b['User'][_0x3860('0x3c')]:_0x3860('0xea');break;case _0x3860('0xf0'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0x3c')]:_0x3860('0xea');break;default:_0x56566c=_0x23207b[_0x3860('0x7b')]?util['format']('%s%d',_0x532349[_0x3860('0xe9')],_0x23207b['UserId']):_0x3860('0xea');}var _0x15314d=util[_0x3860('0xe2')](_0x3860('0xf1'),moment(_0x23207b[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0xf2')),_0x23207b[_0x3860('0xf3')]==='in'?_0x1290e7:_0x56566c,_0x23207b['body']);if(!_0x23207b[_0x3860('0xf4')]){fs[_0x3860('0xf5')](_0x17fa12,_0x15314d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3860('0xf6')],'as':'Smtp','raw':!![]}]});}}})[_0x3860('0x32')](function(_0x2bf644){if(_0x2bf644&&_0x2bf644[_0x3860('0xf7')]&&_0x118c4e[_0x3860('0x7d')]){var _0xd95981={'tls':{'rejectUnauthorized':![]}};if(_0x2bf644[_0x3860('0xf7')][_0x3860('0xf8')]){_0xd95981[_0x3860('0xf8')]=_0x2bf644['Smtp']['service'];}else{_0xd95981[_0x3860('0xf9')]=_0x2bf644['Smtp'][_0x3860('0xf9')];_0xd95981[_0x3860('0xfa')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfa')];_0xd95981[_0x3860('0xfb')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfb')];}if(_0x2bf644['Smtp']['authentication']){_0xd95981[_0x3860('0xfc')]={'user':_0x2bf644[_0x3860('0xf7')][_0x3860('0x9c')],'pass':_0x2bf644['Smtp'][_0x3860('0xfd')]};}return respondWithRpcPromise(_0x3860('0xfe'),_0x3860('0xff'),{'account':_0xd95981,'message':{'from':util['format'](_0x3860('0x100'),_0x2bf644[_0x3860('0x34')],_0x2bf644['email']||_0x2bf644['Smtp']['user']),'to':_0x118c4e['body']['mailTranscript'],'subject':_0x3860('0x101'),'text':util[_0x3860('0xe2')](_0x3860('0x102'),_0x118c4e[_0x3860('0x7d')][_0x3860('0x103')]),'attachments':[{'path':_0x17fa12}]}})['then'](function(){return _0x244ceb;})[_0x3860('0x41')](function(_0x5235e){console['error'](_0x5235e);});}else{return _0x244ceb;}})[_0x3860('0x32')](respondWithStatusCode(_0x471da9,0xc8))[_0x3860('0x41')](handleError(_0x471da9,null));};exports[_0x3860('0x104')]=function(_0x38cdf1,_0x4ab7b2,_0x4c8a10){return db['ChatMessage'][_0x3860('0x6a')]({'where':{'id':_0x38cdf1['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4ab7b2,null))[_0x3860('0x32')](function(_0x2adf67){if(_0x2adf67){return _0x2adf67[_0x3860('0x104')](_0x38cdf1[_0x3860('0x7d')][_0x3860('0x105')],_[_0x3860('0x106')](_0x38cdf1[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{});}})[_0x3860('0x32')](respondWithResult(_0x4ab7b2,null))[_0x3860('0x41')](handleError(_0x4ab7b2,null));};exports[_0x3860('0x107')]=function(_0x173790,_0x20d0d2,_0x8d3ad7){var _0xf1e9ab={'raw':![],'where':{}};var _0xcf350b={};var _0x1348e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x173790['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x20d0d2,null))[_0x3860('0x32')](function(_0x11d0ab){if(_0x11d0ab){_0xcf350b[_0x3860('0x49')]=_[_0x3860('0x7e')](db[_0x3860('0xcf')][_0x3860('0x45')]);_0xcf350b[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x173790['query']);_0xcf350b[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],_0xcf350b[_0x3860('0x4a')]);_0xf1e9ab[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],qs['fields'](_0x173790[_0x3860('0x4a')][_0x3860('0x4e')]));_0xf1e9ab[_0x3860('0x4d')]=_0xf1e9ab['attributes'][_0x3860('0x4f')]?_0xf1e9ab[_0x3860('0x4d')]:_0xcf350b[_0x3860('0x49')];if(!_0x173790['query']['hasOwnProperty'](_0x3860('0x108'))){_0xf1e9ab[_0x3860('0x2c')]=qs['limit'](_0x173790[_0x3860('0x4a')]['limit']);_0xf1e9ab[_0x3860('0x2a')]=qs[_0x3860('0x2a')](_0x173790['query'][_0x3860('0x2a')]);}_0xf1e9ab['order']=qs[_0x3860('0x51')](_0x173790[_0x3860('0x4a')][_0x3860('0x51')]);_0xf1e9ab[_0x3860('0x52')]=qs[_0x3860('0x4b')](_[_0x3860('0x109')](_0x173790[_0x3860('0x4a')],_0xcf350b['filters']));_0xf1e9ab[_0x3860('0x52')]['ChatInteractionId']=_0x11d0ab['id'];if(_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]){_0xf1e9ab['where']=_['merge'](_0xf1e9ab[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0xf1e9ab[_0x3860('0x4d')],function(_0x234f93){var _0x5ed001={};_0x5ed001[_0x234f93]={'$like':'%'+_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]+'%'};return _0x5ed001;})});}if(_0x173790[_0x3860('0x4a')]['$gte']){var _0x1ac962=_0x173790[_0x3860('0x4a')]['$gte'][_0x3860('0x3f')](',');var _0x35dbfe={};_0x35dbfe[_0x1ac962[0x0]]={'$gte':moment(_0x1ac962[0x1])[_0x3860('0xe2')](_0x3860('0x10a'))};_0xf1e9ab[_0x3860('0x52')]=_[_0x3860('0xa3')](_0xf1e9ab[_0x3860('0x52')],_0x35dbfe);}_0xf1e9ab=_['merge']({},_0xf1e9ab,_0x173790[_0x3860('0xbd')]);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0xf1e9ab[_0x3860('0x52')]})[_0x3860('0x32')](function(_0x54ebd7){_0x1348e0[_0x3860('0x2d')]=_0x54ebd7;if(_0x173790[_0x3860('0x4a')][_0x3860('0x10b')]){_0xf1e9ab[_0x3860('0xbc')]=[{'all':!![]}];}return db[_0x3860('0xcf')][_0x3860('0x10c')](_0xf1e9ab);})['then'](function(_0x16457e){_0x1348e0[_0x3860('0x10d')]=_0x16457e;return _0x1348e0;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x20d0d2,_0xf1e9ab))[_0x3860('0x41')](handleError(_0x20d0d2,null));};exports[_0x3860('0x10e')]=function(_0x2b6605,_0x11409b,_0x187e3b){var _0x4fb4f3={'where':{}},_0x21b179={},_0x28b7a2={'count':0x0,'rows':[]};return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x2b6605[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x11409b,null))[_0x3860('0x32')](function(_0x2ca2e7){if(_0x2ca2e7){_0x21b179[_0x3860('0x49')]=_['keys'](db[_0x3860('0xcf')][_0x3860('0x45')]);_0x21b179[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x2b6605[_0x3860('0x4a')]);_0x21b179[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],_0x21b179[_0x3860('0x4a')]);_0x4fb4f3[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x4e')]));_0x4fb4f3['attributes']=_0x4fb4f3[_0x3860('0x4d')][_0x3860('0x4f')]?_0x4fb4f3[_0x3860('0x4d')]:_0x21b179[_0x3860('0x49')];if(!_0x2b6605[_0x3860('0x4a')][_0x3860('0x10f')](_0x3860('0x108'))){_0x4fb4f3[_0x3860('0x2c')]=qs[_0x3860('0x2c')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x2c')]);_0x4fb4f3[_0x3860('0x2a')]=qs['offset'](_0x2b6605[_0x3860('0x4a')]['offset']);}_0x4fb4f3[_0x3860('0x50')]=qs['sort'](_0x2b6605[_0x3860('0x4a')]['sort']);_0x4fb4f3[_0x3860('0x52')]=qs[_0x3860('0x4b')](_['pick'](_0x2b6605[_0x3860('0x4a')],_0x21b179[_0x3860('0x4b')]));_0x4fb4f3[_0x3860('0x52')][_0x3860('0xb8')]=_0x2ca2e7['id'];if(_0x2b6605[_0x3860('0x4a')]['filter']){_0x4fb4f3['where']=_[_0x3860('0xa3')](_0x4fb4f3[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0x4fb4f3[_0x3860('0x4d')],function(_0x31a537){var _0x438121={};_0x438121[_0x31a537]={'$like':'%'+_0x2b6605[_0x3860('0x4a')]['filter']+'%'};return _0x438121;})});}_0x4fb4f3[_0x3860('0x52')]['secret']=![];if(_0x2b6605[_0x3860('0x4a')]['id']){_0x4fb4f3[_0x3860('0x52')]['id']={'$gt':_0x2b6605[_0x3860('0x4a')]['id']};}_0x4fb4f3=_[_0x3860('0xa3')]({},_0x4fb4f3,_0x2b6605['options']);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0x4fb4f3['where']})[_0x3860('0x32')](function(_0x4d4366){_0x28b7a2[_0x3860('0x2d')]=_0x4d4366;_0x4fb4f3[_0x3860('0xbc')]=[];if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x110')]){_0x4fb4f3[_0x3860('0xbc')][_0x3860('0x40')]({'model':db[_0x3860('0x79')],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c'),'alias']});}if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x10b')]){_0x4fb4f3[_0x3860('0xbc')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4fb4f3);})['then'](function(_0x39c52e){_0x28b7a2[_0x3860('0x10d')]=_0x39c52e;return _0x28b7a2;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x11409b,_0x4fb4f3))[_0x3860('0x41')](handleError(_0x11409b,null));};exports[_0x3860('0x111')]=function(_0x185040,_0x14cef9,_0x5e1ed4){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x185040[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x14cef9,null))['then'](function(_0xbc013a){if(_0xbc013a){return _0xbc013a[_0x3860('0x112')](_0x185040['body'][_0x3860('0x105')],_[_0x3860('0x106')](_0x185040[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{})[_0x3860('0x113')](function(){return db[_0x3860('0x77')][_0x3860('0x10c')]({'attributes':['id',_0x3860('0x34'),_0x3860('0x54')],'where':{'id':_0x185040[_0x3860('0x7d')][_0x3860('0x105')]}});})[_0x3860('0x32')](function(_0x57f603){socket['emit'](_0x3860('0x114'),{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]});return{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]};});}})[_0x3860('0x32')](respondWithResult(_0x14cef9,null))[_0x3860('0x41')](handleError(_0x14cef9,null));};exports[_0x3860('0x115')]=function(_0x2e2ff3,_0x27c591,_0x8b9a7a){return db['ChatInteraction'][_0x3860('0x6a')]({'where':{'id':_0x2e2ff3[_0x3860('0xbb')]['id']}})['then'](handleEntityNotFound(_0x27c591,null))[_0x3860('0x32')](function(_0x5ecd57){if(_0x5ecd57){return _0x5ecd57['removeTags'](_0x2e2ff3['query'][_0x3860('0x105')]);}})[_0x3860('0x32')](respondWithStatusCode(_0x27c591,null))[_0x3860('0x41')](handleError(_0x27c591,null));};exports[_0x3860('0x116')]=function(_0x39524a,_0xa0492b){var _0x4d44de=moment()[_0x3860('0x117')]()[_0x3860('0xa1')]();var _0x1dcd01=path['join'](config[_0x3860('0xdd')],_0x3860('0x118'),_0x3860('0x119'),'tmp');var _0x198422=path['join'](config[_0x3860('0xdd')],'server',_0x3860('0x119'),_0x3860('0x11a'));var _0x1a97c1=path[_0x3860('0xdc')](_0x1dcd01,_0x4d44de);var _0x4cc748=util[_0x3860('0xe2')]('transcript-%d-%s.zip',_0x39524a[_0x3860('0xbb')]['id'],_0x4d44de);var _0x18fd61=path['join'](_0x1dcd01,_0x4cc748);var _0x39eb63=[];_0x39eb63[_0x3860('0x40')]({'model':db['User'],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c')],'raw':!![]});_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0xe7')],'as':_0x3860('0x6f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x39524a[_0x3860('0x4a')]['attachments']){_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0x11b')],'as':'Attachment','raw':!![]});}var _0x134dfd=[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'attributes':['id','body',_0x3860('0x84'),'direction','secret','read'],'include':_0x39eb63}];_0x134dfd['push']({'model':db['ChatWebsite'],'as':_0x3860('0x11c'),'attributes':['id',_0x3860('0x34')]});_0x134dfd['push']({'model':db[_0x3860('0x79')],'as':_0x3860('0x11d'),'attributes':['id',_0x3860('0x3c')]});return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x39524a[_0x3860('0xbb')]['id']},'include':_0x134dfd})[_0x3860('0x32')](handleEntityNotFound(_0xa0492b,null))['then'](function(_0x2fe51b){if(_0x2fe51b){var _0x51bf5a=_0x2fe51b['get']({'plain':!![]});fs[_0x3860('0x11e')](_0x1a97c1);var _0x33abf1={'channel':_0x3860('0x11f'),'account':_0x51bf5a[_0x3860('0x11c')][_0x3860('0x34')],'agent':_0x51bf5a['Owner']?_0x51bf5a[_0x3860('0x11d')]['fullname']:_0x3860('0x120'),'createdAt':moment(_0x51bf5a['createdAt'])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'closedAt':_0x51bf5a[_0x3860('0xd3')]?moment(_0x51bf5a[_0x3860('0x121')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')]():'','disposition':_0x51bf5a[_0x3860('0x122')],'chatInfo':{'browser':_0x51bf5a['browserName'],'os':_0x51bf5a[_0x3860('0x123')],'referer':_0x51bf5a[_0x3860('0x124')],'customerIp':_0x51bf5a[_0x3860('0x125')],'customerPort':_0x51bf5a[_0x3860('0x126')]?_0x51bf5a[_0x3860('0x126')]:'N.A.'},'messages':_(_0x51bf5a[_0x3860('0xe6')])[_0x3860('0x127')]()['filter']({'secret':![]})['map'](function(_0x5b23d2){if(_0x5b23d2[_0x3860('0x11b')]){var _0x409781=path[_0x3860('0xdc')](_0x198422,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')]);if(fs[_0x3860('0x128')](_0x409781)){fs[_0x3860('0x129')](_0x409781)[_0x3860('0x12a')](fs[_0x3860('0x12b')](path[_0x3860('0xdc')](_0x1a97c1,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')])));}}return{'date':moment(_0x5b23d2[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'sender':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?_0x5b23d2[_0x3860('0x79')]?_0x5b23d2['User'][_0x3860('0x3c')]:_0x3860('0xea'):_0x5b23d2[_0x3860('0x6f')]['firstName']+(_0x5b23d2[_0x3860('0x6f')][_0x3860('0x12c')]?'\x20'+_0x5b23d2['Contact'][_0x3860('0x12c')]:''),'body':_0x5b23d2['Attachment']?_0x5b23d2['Attachment'][_0x3860('0xd7')]:_0x5b23d2[_0x3860('0x7d')],'direction':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?'A':'C','secret':_0x5b23d2[_0x3860('0xf4')],'read':_0x5b23d2[_0x3860('0x8a')],'attachment':_0x5b23d2['Attachment']};})[_0x3860('0x6c')]()};return ejs[_0x3860('0x12d')](path[_0x3860('0xdc')](config['root'],_0x3860('0x118'),_0x3860('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x33abf1})[_0x3860('0x32')](function(_0x5c5755){var _0x5dfb3b=path[_0x3860('0xdc')](_0x1a97c1,_0x3860('0x12f')+_0x51bf5a['id']+'-'+_0x4d44de+_0x3860('0x130'));var _0x1eba76={'path':_0x5dfb3b,'channel':'Chat','interactionId':_0x51bf5a['id']};return pdf[_0x3860('0x131')](_0x5c5755,_0x1eba76);})['then'](function(){return new BPromise(function(_0x34ad82,_0x44ac65){zipdir(_0x1a97c1,{'saveTo':_0x18fd61},function(_0x43cc98,_0xd9ff70){if(_0x43cc98)return _0x44ac65(_0x43cc98);return _0x34ad82(_0xd9ff70);});})['then'](function(){return new BPromise(function(_0x52e611,_0x4ccefa){rimraf(_0x1a97c1,function(_0x2c90b){if(_0x2c90b)_0x4ccefa(_0x2c90b);return _0x52e611();});});})[_0x3860('0x32')](function(){return _0xa0492b[_0x3860('0x116')](_0x18fd61,_0x4cc748,function(_0x3046f4){if(_0x3046f4){console[_0x3860('0x132')](_0x3860('0x133'),_0x3046f4);}else{fs[_0x3860('0x134')](_0x18fd61);}});});});}else{return _0xa0492b['sendStatus'](0xc8);}})[_0x3860('0x41')](handleError(_0xa0492b,null));}; \ No newline at end of file +var _0x4024=['ChatInteractionId','push','all','rows','show','params','include','options','create','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','hasOwnProperty','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Chat','Owner','N.A.','closed','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','sendStatus','name','render','merge','agent','interaction','account','Users','TagIds','Tags','split','forEach','catch','map','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','text','body','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy'];(function(_0x48722f,_0x5a4e6e){var _0x224f73=function(_0x34598c){while(--_0x34598c){_0x48722f['push'](_0x48722f['shift']());}};_0x224f73(++_0x5a4e6e);}(_0x4024,0x89));var _0x4402=function(_0xcbc7d0,_0x4ad63c){_0xcbc7d0=_0xcbc7d0-0x0;var _0x37b8c6=_0x4024[_0xcbc7d0];return _0x37b8c6;};'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 pdf=require(_0x4402('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4402('0xf'))(_0x4402('0x10'));var utils=require('../../config/utils');var config=require(_0x4402('0x11'));var licenseUtil=require(_0x4402('0x12'));var db=require(_0x4402('0x13'))['db'];config['redis']=_[_0x4402('0x14')](config[_0x4402('0x15')],{'host':_0x4402('0x16'),'port':0x18eb});var socket=require(_0x4402('0x17'))(new Redis(config[_0x4402('0x15')]));require(_0x4402('0x18'))[_0x4402('0x19')](socket);var jayson=require(_0x4402('0x1a'));var client=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232b});var client9004=jayson[_0x4402('0x1b')][_0x4402('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2a2ce8,_0x19fe7b,_0xfd9853,_0x30c390){return new BPromise(function(_0x399c24,_0x25e88b){var _0x186c22=_0x30c390||client;return _0x186c22[_0x4402('0x1d')](_0x2a2ce8,_0xfd9853)['then'](function(_0x494389){logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,'request\x20sent');logger[_0x4402('0x20')](_0x4402('0x21'),_0x19fe7b,'request\x20sent',JSON[_0x4402('0x22')](_0x494389));if(_0x494389['error']){if(_0x494389['error'][_0x4402('0x23')]===0x1f4){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389['error'][_0x4402('0x25')]);return _0x25e88b(_0x494389['error']['message']);}logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x494389[_0x4402('0x24')][_0x4402('0x25')]);return _0x399c24(_0x494389[_0x4402('0x24')][_0x4402('0x25')]);}else{logger[_0x4402('0x1e')](_0x4402('0x1f'),_0x19fe7b,_0x4402('0x26'));_0x399c24(_0x494389['result'][_0x4402('0x25')]);}})['catch'](function(_0x3733cd){logger[_0x4402('0x24')](_0x4402('0x1f'),_0x19fe7b,_0x3733cd);_0x25e88b(_0x3733cd);});});}function respondWithStatusCode(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0xcc;return function(_0x15c19f){if(_0x15c19f){return _0x211424['sendStatus'](_0x5a43d0);}return _0x211424['status'](_0x5a43d0)[_0x4402('0x27')]();};}function respondWithResult(_0x395e49,_0x327d60){_0x327d60=_0x327d60||0xc8;return function(_0xabf61b){if(_0xabf61b){return _0x395e49[_0x4402('0x28')](_0x327d60)['json'](_0xabf61b);}};}function respondWithFilteredResult(_0x41de44,_0x52e625){return function(_0x71da2f){if(_0x71da2f){var _0x1e2340=typeof _0x52e625[_0x4402('0x29')]==='undefined'&&typeof _0x52e625[_0x4402('0x2a')]===_0x4402('0x2b');var _0x316239=_0x71da2f[_0x4402('0x2c')];var _0x2526d1=_0x1e2340?0x0:_0x52e625[_0x4402('0x29')];var _0x1189b8=_0x1e2340?_0x71da2f[_0x4402('0x2c')]:_0x52e625[_0x4402('0x29')]+_0x52e625[_0x4402('0x2a')];var _0xcea26b;if(_0x1189b8>=_0x316239){_0x1189b8=_0x316239;_0xcea26b=0xc8;}else{_0xcea26b=0xce;}_0x41de44['status'](_0xcea26b);return _0x41de44[_0x4402('0x2d')]('Content-Range',_0x2526d1+'-'+_0x1189b8+'/'+_0x316239)[_0x4402('0x2e')](_0x71da2f);}return null;};}function patchUpdates(_0x554096){return function(_0x2dea0f){try{jsonpatch[_0x4402('0x2f')](_0x2dea0f,_0x554096,!![]);}catch(_0x145003){return BPromise[_0x4402('0x30')](_0x145003);}return _0x2dea0f[_0x4402('0x31')]();};}function saveUpdates(_0x480781,_0x3a60af){return function(_0x3fa7ae){if(_0x3fa7ae){return _0x3fa7ae[_0x4402('0x32')](_0x480781)['then'](function(_0x331c75){return _0x331c75;});}return null;};}function removeEntity(_0x3383e3,_0x535e1d){return function(_0x2db1fe){if(_0x2db1fe){return _0x2db1fe[_0x4402('0x33')]()[_0x4402('0x34')](function(){_0x3383e3[_0x4402('0x28')](0xcc)[_0x4402('0x27')]();});}};}function handleEntityNotFound(_0x235f30,_0x1e67ac){return function(_0x6e9fb7){if(!_0x6e9fb7){_0x235f30[_0x4402('0x35')](0x194);}return _0x6e9fb7;};}function handleError(_0x5c819a,_0x2995b6){_0x2995b6=_0x2995b6||0x1f4;return function(_0x28fee8){logger[_0x4402('0x24')](_0x28fee8['stack']);if(_0x28fee8[_0x4402('0x36')]){delete _0x28fee8[_0x4402('0x36')];}_0x5c819a['status'](_0x2995b6)['send'](_0x28fee8);};}function getMustacheRender(_0x2b9d51,_0x5b7c2e){return Mustache[_0x4402('0x37')](_0x2b9d51,_[_0x4402('0x38')](_0x5b7c2e['body'],{'contact':_0x5b7c2e['contact'],'message':_0x5b7c2e['message'],'agent':_0x5b7c2e[_0x4402('0x39')],'interaction':_0x5b7c2e[_0x4402('0x3a')],'account':_0x5b7c2e[_0x4402('0x3b')]}))||'';}function getInteractionUsers(_0x3fd8ce,_0x52af0d){return new BPromise(function(_0x20579c,_0x7d5f2a){try{if(_0x52af0d[_0x3fd8ce['id']]){_0x3fd8ce[_0x4402('0x3c')]=_['map'](_0x52af0d[_0x3fd8ce['id']],function(_0x2b92b7){return{'id':_0x2b92b7['id'],'fullname':_0x2b92b7['fullname']};});}}catch(_0x6e328a){_0x7d5f2a(_0x6e328a);}_0x20579c(_0x3fd8ce);});}function getInteractionTags(_0x3ef31d,_0x5c74b1){return new BPromise(function(_0x16ef2e,_0x529526){try{if(_0x3ef31d[_0x4402('0x3d')]){_0x3ef31d[_0x4402('0x3e')]=[];_0x3ef31d['TagIds'][_0x4402('0x3f')](',')[_0x4402('0x40')](function(_0x250f09){_0x3ef31d[_0x4402('0x3e')]['push'](_0x5c74b1[_0x250f09]);});}delete _0x3ef31d['TagIds'];}catch(_0x2cda0a){_0x529526(_0x2cda0a);}_0x16ef2e(_0x3ef31d);});}function updateChatInteraction(_0x47a3a3,_0x3a589b,_0x2a6d78){return new BPromise(function(_0xb9cf85,_0x2e2391){return getInteractionUsers(_0x47a3a3,_0x2a6d78)[_0x4402('0x34')](function(_0x455a62){return getInteractionTags(_0x455a62,_0x3a589b);})[_0x4402('0x34')](function(_0x390169){_0xb9cf85(_0x390169);})[_0x4402('0x41')](function(_0x42812b){_0x2e2391(_0x42812b);});});}exports['index']=function(_0x14b94b,_0x3236fc){var _0x5e7872={},_0x214eec={},_0x370878={'count':0x0,'rows':[]};var _0x50552a=_[_0x4402('0x42')](db[_0x4402('0x43')][_0x4402('0x44')],function(_0x3278fc){return{'name':_0x3278fc[_0x4402('0x45')],'type':_0x3278fc['type'][_0x4402('0x46')]};});_0x214eec[_0x4402('0x47')]=_[_0x4402('0x42')](_0x50552a,_0x4402('0x36'));_0x214eec[_0x4402('0x48')]=_[_0x4402('0x49')](_0x14b94b[_0x4402('0x48')]);_0x214eec[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x214eec[_0x4402('0x47')],_0x214eec[_0x4402('0x48')]);_0x5e7872['attributes']=_[_0x4402('0x4b')](_0x214eec['model'],qs[_0x4402('0x4c')](_0x14b94b[_0x4402('0x48')]['fields']));_0x5e7872[_0x4402('0x4d')]=_0x5e7872[_0x4402('0x4d')][_0x4402('0x4e')]?_0x5e7872[_0x4402('0x4d')]:_0x214eec[_0x4402('0x47')];if(!_0x14b94b[_0x4402('0x48')]['hasOwnProperty'](_0x4402('0x4f'))){_0x5e7872[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x14b94b[_0x4402('0x48')][_0x4402('0x2a')]);_0x5e7872[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x14b94b[_0x4402('0x48')][_0x4402('0x29')]);}_0x5e7872['order']=qs['sort'](_0x14b94b['query']['sort']);_0x5e7872[_0x4402('0x50')]=qs[_0x4402('0x4a')](_[_0x4402('0x51')](_0x14b94b[_0x4402('0x48')],_0x214eec['filters']),_0x50552a);var _0x169bb2=[];var _0x12d6de=squel[_0x4402('0x52')]()[_0x4402('0x53')]('id')[_0x4402('0x53')](_0x4402('0x36'))[_0x4402('0x53')]('color')[_0x4402('0x54')](_0x4402('0x55'));var _0x38e6d1=squel[_0x4402('0x52')]()[_0x4402('0x53')](_0x4402('0x56'))['field'](_0x4402('0x57'))[_0x4402('0x53')](_0x4402('0x58'))[_0x4402('0x54')](_0x4402('0x59'),'ui')[_0x4402('0x5a')](_0x4402('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x48e138=squel[_0x4402('0x52')]()[_0x4402('0x54')](_0x4402('0x5c'),'i')['left_join']('cm_contacts','c',_0x4402('0x5d'))[_0x4402('0x5a')](_0x4402('0x5b'),'o',_0x4402('0x5e'))[_0x4402('0x5a')](_0x4402('0x5f'),'a',_0x4402('0x60'))[_0x4402('0x5a')](_0x4402('0x61'),'me',_0x4402('0x62'))[_0x4402('0x5a')](_0x4402('0x63'),'it',_0x4402('0x64'))['left_join'](_0x4402('0x55'),'t','t.id\x20=\x20it.TagId');var _0xe4530a=squel['expr']();var _0x3fb9f0=[];var _0x1e5891=squel[_0x4402('0x65')]();var _0x31e36c;if(_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]){_0x31e36c=as['parseSearch'](_0x14b94b[_0x4402('0x48')][_0x4402('0x66')]);var _0xa390ce=_0x31e36c[_0x4402('0x67')];for(var _0xb341ab=0x0;_0xb341ab<_0x31e36c['conditions'][_0x4402('0x4e')];_0xb341ab++){var _0x31d993=_0x31e36c[_0x4402('0x68')][_0xb341ab];var _0xc15c0b='i';var _0x309077=_[_0x4402('0x69')](_0x50552a,[_0x4402('0x36'),_0x31d993[_0x4402('0x53')]]);if(!_0x309077){switch(_0x31d993['field']){case _0x4402('0x6a'):if(_0x31d993[_0x4402('0x6b')]==0x1){_0x48e138['having']('`'+_0x31d993[_0x4402('0x53')]+_0x4402('0x6c'));}else{_0x48e138['having']('`'+_0x31d993['field']+_0x4402('0x6d'));}break;case _0x4402('0x6e'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){if(_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')]('\x20')[_0x4402('0x4e')]>0x1){_0xe4530a[_0xa390ce]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4402('0x70')](_0x31d993[_0x4402('0x6b')]),null);}else{var _0xdde09f='%'+_0x31d993['value']+'%';_0xe4530a[_0xa390ce](_0x4402('0x71'),_0xdde09f,_0xdde09f,_0xdde09f);}}else{_0x309077=_[_0x4402('0x69')](_0x50552a,['name','ContactId']);_0x31d993[_0x4402('0x53')]='ContactId';_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553['text'],_0x53e553['value'][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x75'):var _0x4ac95e=_0x31d993[_0x4402('0x6b')][_0x4402('0x3f')](',')[_0x4402('0x42')](function(_0x168095){return Number(_0x168095);});_0x4ac95e[_0x4402('0x40')](function(_0x26b1ad){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x26b1ad+',%');});_0x3fb9f0=_['union'](_0x3fb9f0,_0x4ac95e);break;case _0x4402('0x77'):if(_0x31d993[_0x4402('0x6f')]==='$substring'){_0xe4530a[_0xa390ce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x31d993[_0x4402('0x6b')]+'%',null);}else{_0x309077=_['find'](_0x50552a,[_0x4402('0x36'),'UserId']);_0x31d993[_0x4402('0x53')]=_0x4402('0x78');_0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);}break;case _0x4402('0x7a'):_0x53e553=as[_0x4402('0x72')]('me',null,_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553[_0x4402('0x6b')][_0x4402('0x74')],_0x53e553[_0x4402('0x6b')][_0x4402('0x27')]);break;}}else{var _0x53e553=as[_0x4402('0x72')](_0xc15c0b,_0x309077[_0x4402('0x73')],_0x31d993);_0xe4530a[_0xa390ce](_0x53e553[_0x4402('0x79')],_0x53e553['value'][_0x4402('0x74')],_0x53e553['value'][_0x4402('0x27')]);}}}else{var _0x1b1147=_(_0x14b94b[_0x4402('0x48')])[_0x4402('0x49')]()['map'](function(_0xac8513){return _['some'](_0x50552a,[_0x4402('0x36'),_0xac8513])?_0xac8513:undefined;})[_0x4402('0x7b')]()[_0x4402('0x6b')]();if(!_['isEmpty'](_0x1b1147)){_0x1b1147[_0x4402('0x40')](function(_0x4c98eb){if(_0x4c98eb===_0x4402('0x7c')){_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),[][_0x4402('0x7e')](_0x14b94b[_0x4402('0x48')][_0x4c98eb]));}else if(_0x4c98eb===_0x4402('0x7f')){var _0x19b427=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])['$gte'];var _0x44d806=JSON[_0x4402('0x80')](_0x14b94b[_0x4402('0x48')][_0x4c98eb])[_0x4402('0x81')];_0x48e138[_0x4402('0x50')](_0x4402('0x82'),_0x19b427,_0x44d806);}else{if(_0x14b94b[_0x4402('0x48')][_0x4c98eb]===_0x4402('0x83')){_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+'\x20IS\x20NULL');}else{_0x48e138[_0x4402('0x50')]('i.'+_0x4c98eb+_0x4402('0x84'),_0x14b94b[_0x4402('0x48')][_0x4c98eb]);}}});}if(_0x14b94b['query'][_0x4402('0x85')]){if(_0x14b94b['query'][_0x4402('0x85')]==0x1){_0x48e138['having'](_0x4402('0x86'));}else{_0x48e138[_0x4402('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x14b94b[_0x4402('0x48')]['tag']){_0x3fb9f0=_[_0x4402('0x88')](_0x14b94b[_0x4402('0x48')]['tag'])?_0x14b94b[_0x4402('0x48')][_0x4402('0x89')]:new Array(_0x14b94b['query'][_0x4402('0x89')]);_0x3fb9f0[_0x4402('0x40')](function(_0x4f0915){_0x1e5891['or'](_0x4402('0x76'),'%,'+_0x4f0915+',%');});}if(_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')]){var _0x12b834=_0x14b94b[_0x4402('0x48')][_0x4402('0x8a')][_0x4402('0x8b')]('\x5c','\x5c\x5c')[_0x4402('0x8b')](/'/g,'\x27\x27');if(qs[_0x4402('0x8c')](_0x12b834)){_0xe4530a['or'](_0x4402('0x8d'),_0x12b834+'%');}else{_0xe4530a['or'](_0x4402('0x8e'),qs[_0x4402('0x70')](_0x12b834))['or'](_0x4402('0x8f'),_0x12b834+'%');}}}_0x48e138[_0x4402('0x50')](_0xe4530a);_0x48e138['group'](_0x4402('0x90'));var _0xc3914e={'type':db['Sequelize'][_0x4402('0x91')]['SELECT'],'raw':!![]};var _0x2c7ff5=_0x48e138[_0x4402('0x92')]();_0x2c7ff5[_0x4402('0x53')]('i.id');_0x2c7ff5[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));if(_0x5e7872['order']){_0x5e7872[_0x4402('0x94')][_0x4402('0x40')](function(_0x179eb4){var _0x1a0a6f=_0x179eb4[0x0]==='contactName'?_0x179eb4[0x0]:'i.'+_0x179eb4[0x0];_0x48e138[_0x4402('0x94')](_0x1a0a6f,_0x179eb4[0x1]===_0x4402('0x95')?![]:!![]);});}if(!_[_0x4402('0x96')](_0x3fb9f0)){_0x48e138[_0x4402('0x87')](_0x1e5891);_0x2c7ff5[_0x4402('0x50')](_0x4402('0x97'),_0x3fb9f0);}BPromise[_0x4402('0x98')]()[_0x4402('0x34')](function(){if(!_0x31e36c){if(_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return;_0x2c7ff5[_0x4402('0x50')](_0x4402('0x99'));_0x48e138[_0x4402('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x14b94b[_0x4402('0x9a')][_0x4402('0x9b')]!==_0x4402('0x39'))return;return _0x14b94b[_0x4402('0x9a')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x284b52){if(_[_0x4402('0x96')](_0x284b52)){_0x2c7ff5[_0x4402('0x50')](_0x4402('0x9c'));_0x48e138['where'](_0x4402('0x9c'));}else{_0x2c7ff5[_0x4402('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x4402('0x42')](_0x284b52,'id'));_0x48e138[_0x4402('0x50')](_0x4402('0x7d'),_[_0x4402('0x42')](_0x284b52,'id'));}});})[_0x4402('0x34')](function(){if(_0x14b94b['user'][_0x4402('0x9b')]===_0x4402('0x39')&&!_0x31e36c&&!_0x14b94b[_0x4402('0x48')][_0x4402('0x7c')])return[];return db[_0x4402('0x9d')][_0x4402('0x48')](_0x2c7ff5[_0x4402('0x9e')](),_0xc3914e);})['then'](function(_0x218640){_0x370878[_0x4402('0x2c')]=_0x218640[_0x4402('0x4e')];if(_0x370878[_0x4402('0x2c')]===0x0)return[];return db[_0x4402('0x9d')]['query'](_0x12d6de[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x572e21){_0x169bb2=_[_0x4402('0x9f')](_0x572e21,'id');_0xc3914e=_['merge'](_0xc3914e,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b94b[_0x4402('0x48')]['fields']){_0x5e7872[_0x4402('0x4d')]['forEach'](function(_0x51e85d){_0x48e138[_0x4402('0x53')]('i.'+_0x51e85d);});}else{_0x48e138[_0x4402('0x53')](_0x4402('0x93'),_0x4402('0x6a'));_0x48e138[_0x4402('0x53')](_0x4402('0xa0'),'Account.key');_0x48e138[_0x4402('0x53')](_0x4402('0xa1'),'Account.mandatoryDisposition');_0x48e138[_0x4402('0x53')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x48e138[_0x4402('0x53')]('i.*');_0x48e138[_0x4402('0x53')](_0x4402('0xa2'),_0x4402('0xa3'));_0x48e138[_0x4402('0x53')](_0x4402('0xa4'),'Contact.lastName');_0x48e138['field'](_0x4402('0xa5'),_0x4402('0xa6'));_0x48e138['field'](_0x4402('0xa7'),_0x4402('0xa8'));_0x48e138[_0x4402('0x53')](_0x4402('0xa9'),_0x4402('0xaa'));_0x48e138[_0x4402('0x53')]('c.fax','Contact.fax');_0x48e138[_0x4402('0x53')](_0x4402('0xab'),_0x4402('0xac'));_0x48e138[_0x4402('0x53')](_0x4402('0xad'),_0x4402('0xae'));_0x48e138['field'](_0x4402('0xaf'),_0x4402('0x3d'));}if(_0x5e7872[_0x4402('0x2a')])_0x48e138[_0x4402('0x2a')](_0x5e7872[_0x4402('0x2a')]);if(_0x5e7872['offset'])_0x48e138[_0x4402('0x29')](_0x5e7872[_0x4402('0x29')]);return db[_0x4402('0x9d')][_0x4402('0x48')](_0x48e138[_0x4402('0x9e')](),_0xc3914e);})[_0x4402('0x34')](function(_0x518b0b){if(_0x518b0b['length']>0x0)_0x38e6d1[_0x4402('0x50')]('ui.ChatInteractionId\x20IN\x20?',_[_0x4402('0x42')](_0x518b0b,'id'));return db[_0x4402('0x9d')][_0x4402('0x48')](_0x38e6d1[_0x4402('0x9e')](),_0xc3914e)[_0x4402('0x34')](function(_0x25b3ee){var _0x70bdbd=_[_0x4402('0xb0')](_0x25b3ee,_0x4402('0xb1'));var _0x23306f=[];_0x518b0b[_0x4402('0x40')](function(_0x425a1b){_0x23306f[_0x4402('0xb2')](updateChatInteraction(_0x425a1b,_0x169bb2,_0x70bdbd));});return BPromise[_0x4402('0xb3')](_0x23306f);});});})[_0x4402('0x34')](function(_0x1ba5a1){_0x370878[_0x4402('0xb4')]=_0x1ba5a1;return _0x370878;})[_0x4402('0x34')](respondWithFilteredResult(_0x3236fc,_0x5e7872))[_0x4402('0x41')](handleError(_0x3236fc,null));};exports[_0x4402('0xb5')]=function(_0xe37b11,_0x385b8e){var _0x418070={'raw':![],'where':{'id':_0xe37b11[_0x4402('0xb6')]['id']}},_0x47a76a={};_0x47a76a[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0x43')][_0x4402('0x44')]);_0x47a76a[_0x4402('0x48')]=_['keys'](_0xe37b11['query']);_0x47a76a[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x47a76a[_0x4402('0x47')],_0x47a76a['query']);_0x418070['attributes']=_['intersection'](_0x47a76a['model'],qs[_0x4402('0x4c')](_0xe37b11[_0x4402('0x48')][_0x4402('0x4c')]));_0x418070['attributes']=_0x418070[_0x4402('0x4d')][_0x4402('0x4e')]?_0x418070[_0x4402('0x4d')]:_0x47a76a['model'];if(_0xe37b11[_0x4402('0x48')]['includeAll']){_0x418070[_0x4402('0xb7')]=[{'all':!![]}];}_0x418070=_[_0x4402('0x38')]({},_0x418070,_0xe37b11[_0x4402('0xb8')]);return db[_0x4402('0x43')][_0x4402('0x69')](_0x418070)[_0x4402('0x34')](handleEntityNotFound(_0x385b8e,null))['then'](respondWithResult(_0x385b8e,null))[_0x4402('0x41')](handleError(_0x385b8e,null));};exports[_0x4402('0xb9')]=function(_0x3ac6b9,_0x55c3fd){return db[_0x4402('0x43')]['create'](_0x3ac6b9[_0x4402('0x7a')],{})[_0x4402('0x34')](respondWithResult(_0x55c3fd,0xc9))[_0x4402('0x41')](handleError(_0x55c3fd,null));};exports[_0x4402('0x32')]=function(_0x54d6dc,_0x91c49){if(_0x54d6dc[_0x4402('0x7a')]['id']){delete _0x54d6dc[_0x4402('0x7a')]['id'];}return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x54d6dc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x91c49,null))[_0x4402('0x34')](saveUpdates(_0x54d6dc['body'],null))['then'](respondWithResult(_0x91c49,null))['catch'](handleError(_0x91c49,null));};exports[_0x4402('0x33')]=function(_0x42b774,_0x246ff2){return db[_0x4402('0x43')]['find']({'where':{'id':_0x42b774[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x246ff2,null))[_0x4402('0x34')](removeEntity(_0x246ff2,null))[_0x4402('0x41')](handleError(_0x246ff2,null));};exports['describe']=function(_0x2a3361,_0x2949ce){return db[_0x4402('0x43')]['describe']()['then'](respondWithResult(_0x2949ce,null))['catch'](handleError(_0x2949ce,null));};exports[_0x4402('0xba')]=function(_0x48bf30,_0x17c5c2){var _0x35c16f=_0x48bf30[_0x4402('0xb6')]['id'];var _0x117911;var _0x87ae2a;var _0xd604a5;return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x35c16f}})[_0x4402('0x34')](function(_0x423f83){_0x117911=_0x423f83;return db[_0x4402('0xbc')][_0x4402('0xbb')]({'where':{'id':_0x423f83[_0x4402('0x7c')]},'attributes':['id',_0x4402('0xbd'),'vidaooEscalation',_0x4402('0xbe'),_0x4402('0xbf'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x57fd83){if(_0x57fd83&&_0x57fd83[_0x4402('0xbd')]&&_0x57fd83['vidaooEscalation']){_0x87ae2a=_0x57fd83;var _0x47aa8b={'interaction':{'id':_0x35c16f},'agent':{'id':_0x48bf30[_0x4402('0x9a')]['id'],'name':_0x48bf30[_0x4402('0x9a')]['name'],'fullname':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc0')],'email':_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]},'contact':_0x48bf30['body'][_0x4402('0xc2')],'account':_0x48bf30[_0x4402('0x7a')][_0x4402('0x3b')]};var _0x286500={'rejectUnauthorized':![],'method':_0x4402('0xc3'),'url':_0x4402('0xc4'),'headers':{'X-APIKEY':_0x57fd83[_0x4402('0xbd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x48bf30[_0x4402('0x9a')][_0x4402('0xc1')]],'buttons':null,'topic':_0x87ae2a['vidaooTopic'],'note':_[_0x4402('0xc5')](_0x87ae2a[_0x4402('0xbf')])?null:getMustacheRender(_0x87ae2a[_0x4402('0xbf')],_0x47aa8b),'metadata':null},'redirect':_0x4402('0xc6'),'json':!![]};try{if(!_['isNull'](_0x87ae2a[_0x4402('0xc7')])){var _0x4bf0ff=getMustacheRender(_0x87ae2a[_0x4402('0xc7')],_0x47aa8b);var _0x29ffd4=JSON['parse'](_0x4bf0ff);_0x286500['body'][_0x4402('0xc8')]=_0x29ffd4;}}catch(_0x173f64){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xcb'));}return rp(_0x286500);}else{throw new db[(_0x4402('0xc9'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x4402('0x34')](function(_0x54e61e){_0xd604a5=_0x54e61e;if(_0xd604a5['id']){var _0xc47081={'body':_0xd604a5[_0x4402('0xcc')],'ChatWebsiteId':_0x87ae2a['id'],'ChatInteractionId':_0x117911['id'],'direction':_0x4402('0xcd'),'UserId':_0x48bf30[_0x4402('0x9a')]['id']};return db['ChatMessage'][_0x4402('0xb9')](_0xc47081,{});}else{throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))](_0x4402('0xce'));}})[_0x4402('0x34')](function(){return _0x117911[_0x4402('0xcf')]({'vidaooSessionId':_0xd604a5['id']});})['then'](respondWithResult(_0x17c5c2,null))['catch'](handleError(_0x17c5c2,null));};exports[_0x4402('0xd0')]=function(_0x5a768b,_0x38d7b5){if(_0x5a768b[_0x4402('0x7a')]['id']){delete _0x5a768b['body']['id'];}return db[_0x4402('0x43')]['find']({'where':{'id':_0x5a768b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e')}]})['then'](handleEntityNotFound(_0x38d7b5,null))[_0x4402('0x34')](saveUpdates(_0x5a768b['body'],null))[_0x4402('0x34')](respondWithResult(_0x38d7b5,null))[_0x4402('0x41')](handleError(_0x38d7b5,null));};exports[_0x4402('0xd2')]=function(_0x1fc790,_0xaaf390,_0x53be9e){if(_0x1fc790['body']['id']){delete _0x1fc790[_0x4402('0x7a')]['id'];}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x1fc790[_0x4402('0xb6')]['id']}})['then'](function(_0x50d453){if(!_0x50d453){logger[_0x4402('0x24')](_0x4402('0xd3'),_0x4402('0xd2'),0x194,_0x4402('0xd4'));_0xaaf390[_0x4402('0x35')](0x194);}else{if(_0x50d453[_0x4402('0x78')]){throw new db[(_0x4402('0xc9'))][(_0x4402('0xca'))]('Interaction\x20already\x20assigned');}}return _0x50d453;})['then'](function(_0xf3be9){if(_0xf3be9){return _0xf3be9[_0x4402('0x32')]({'closed':_0x1fc790[_0x4402('0x7a')]['closed'],'disposition':_0x1fc790[_0x4402('0x7a')]['disposition']})[_0x4402('0x34')](function(_0x1237a3){return _0x1237a3;});}})[_0x4402('0x34')](function(_0x4a0fd9){return respondWithRpcPromise(_0x4402('0xd5'),_0x4402('0xd2'),_0x1fc790['body'],client9004);})[_0x4402('0x34')](respondWithResult(_0xaaf390,null))[_0x4402('0x41')](handleError(_0xaaf390,null));};exports[_0x4402('0xd6')]=function(_0x8c436d,_0x15e9d3,_0xa0d1ee){_0x8c436d[_0x4402('0x7a')][_0x4402('0x36')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xd8')];_0x8c436d[_0x4402('0x7a')][_0x4402('0xd9')]=_0x8c436d['file'][_0x4402('0xda')];_0x8c436d[_0x4402('0x7a')][_0x4402('0x73')]=_0x8c436d[_0x4402('0xd7')][_0x4402('0xdb')];return db[_0x4402('0xdc')][_0x4402('0xb9')](_0x8c436d[_0x4402('0x7a')])[_0x4402('0x34')](respondWithResult(_0x15e9d3,0xc9))['catch'](handleError(_0x15e9d3,null));};exports[_0x4402('0xdd')]=function(_0x113451,_0x338e97,_0x4c6d4e){return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x113451['params']['id']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null))[_0x4402('0x34')](function(_0x491a8e){if(_0x491a8e){if(_0x491a8e['closed']){return _0x338e97[_0x4402('0x28')](0x193)[_0x4402('0x2e')]({'status':0x193,'message':_0x4402('0xde')});}return db[_0x4402('0xdc')]['findOne']({'where':{'id':_0x113451[_0x4402('0x48')]['attachId']},'raw':!![]})[_0x4402('0x34')](handleEntityNotFound(_0x338e97,null));}})[_0x4402('0x34')](function(_0x171672){if(_0x171672){var _0xdbd1c8=_0x171672[_0x4402('0xdf')]!==null;var _0x5d190e=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0xe2'));if(_0xdbd1c8){_0x5d190e=path[_0x4402('0xe0')](_0x5d190e,_0x4402('0xe3'));}var _0x23de88=path[_0x4402('0xe0')](_0x5d190e,_0x171672[_0x4402('0xd9')]);return _0x338e97[_0x4402('0xe4')](_0x23de88);}})[_0x4402('0x41')](handleError(_0x338e97,null));};exports[_0x4402('0xe5')]=function(_0x55274b,_0x2afc41){var _0x1c5cad=null;var _0x3b8f77=null;var _0x2b3b75=null;var _0x1ba411=null;if(_0x55274b[_0x4402('0x7a')]['id']){delete _0x55274b[_0x4402('0x7a')]['id'];}if(_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]){_0x1ba411=path[_0x4402('0xe0')](config['root'],_0x4402('0xe7'),util[_0x4402('0xe8')](_0x4402('0xe9'),Date['now']()));_0x55274b[_0x4402('0x7a')][_0x4402('0xea')]=_0x1ba411;}return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x55274b[_0x4402('0xb6')]['id']},'include':[{'model':db[_0x4402('0xeb')],'as':_0x4402('0xec'),'include':[{'model':db[_0x4402('0x77')],'as':_0x4402('0x77')}]}]})[_0x4402('0x34')](handleEntityNotFound(_0x2afc41,null))[_0x4402('0x34')](saveUpdates(_0x55274b[_0x4402('0x7a')],null))[_0x4402('0x34')](function(_0x2d86c7){if(_0x2d86c7){_0x1c5cad=_0x2d86c7;return db['ChatWebsite'][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0x7c')]}});}})[_0x4402('0x34')](function(_0x47837e){if(_0x47837e){_0x2b3b75=_0x47837e;return db[_0x4402('0xd1')][_0x4402('0x69')]({'where':{'id':_0x1c5cad[_0x4402('0xed')]}});}})[_0x4402('0x34')](function(_0x259c23){if(_0x259c23){_0x3b8f77=_0x259c23;if(_0x1ba411){var _0x535d83=null;for(var _0x2f3d6e=0x1;_0x2f3d6e<_0x1c5cad['Messages'][_0x4402('0x4e')];++_0x2f3d6e){_0x535d83=_0x1c5cad[_0x4402('0xec')][_0x2f3d6e];var _0x395d17=_0x535d83[_0x4402('0x78')]?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83[_0x4402('0x78')]):_0x4402('0xf0');var _0x51bdf7=_0x55274b[_0x4402('0x7a')]['customer']||util[_0x4402('0xe8')](_0x4402('0xee'),_0x4402('0xf1'),_0x535d83[_0x4402('0xed')]);switch(_0x2b3b75[_0x4402('0xf2')]){case _0x4402('0xf3'):_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')]('%s%d',_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');break;case _0x4402('0xf4'):_0x395d17=_0x535d83[_0x4402('0x78')]?_0x535d83[_0x4402('0x77')][_0x4402('0xf5')]||_0x535d83[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0');break;case _0x4402('0xf6'):_0x395d17=_0x535d83['UserId']?_0x535d83[_0x4402('0x77')]['fullname']:'System';break;default:_0x395d17=_0x535d83['UserId']?util[_0x4402('0xe8')](_0x4402('0xee'),_0x2b3b75[_0x4402('0xef')],_0x535d83['UserId']):_0x4402('0xf0');}var _0x1accec=util[_0x4402('0xe8')](_0x4402('0xf7'),moment(_0x535d83[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0xf8')),_0x535d83[_0x4402('0xf9')]==='in'?_0x51bdf7:_0x395d17,_0x535d83[_0x4402('0x7a')]);if(!_0x535d83[_0x4402('0xfa')]){fs[_0x4402('0xfb')](_0x1ba411,_0x1accec);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4402('0xfc')],'as':_0x4402('0xfd'),'raw':!![]}]});}}})[_0x4402('0x34')](function(_0x23dbb4){if(_0x23dbb4&&_0x23dbb4[_0x4402('0xfd')]&&_0x55274b['body']){var _0x494b72={'tls':{'rejectUnauthorized':![]}};if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')]){_0x494b72[_0x4402('0xfe')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xfe')];}else{_0x494b72[_0x4402('0xff')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0xff')];_0x494b72[_0x4402('0x100')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x100')];_0x494b72[_0x4402('0x101')]=_0x23dbb4[_0x4402('0xfd')][_0x4402('0x101')];}if(_0x23dbb4[_0x4402('0xfd')][_0x4402('0x102')]){_0x494b72[_0x4402('0x103')]={'user':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')],'pass':_0x23dbb4[_0x4402('0xfd')][_0x4402('0x104')]};}return respondWithRpcPromise(_0x4402('0x105'),_0x4402('0x106'),{'account':_0x494b72,'message':{'from':util[_0x4402('0xe8')](_0x4402('0x107'),_0x23dbb4[_0x4402('0x36')],_0x23dbb4['email']||_0x23dbb4[_0x4402('0xfd')][_0x4402('0x9a')]),'to':_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')],'subject':_0x4402('0x108'),'text':util[_0x4402('0xe8')](_0x4402('0x109'),_0x55274b[_0x4402('0x7a')][_0x4402('0xe6')]),'attachments':[{'path':_0x1ba411}]}})['then'](function(){return _0x1c5cad;})[_0x4402('0x41')](function(_0x3ba561){console[_0x4402('0x24')](_0x3ba561);});}else{return _0x1c5cad;}})[_0x4402('0x34')](respondWithStatusCode(_0x2afc41,0xc8))[_0x4402('0x41')](handleError(_0x2afc41,null));};exports[_0x4402('0x10a')]=function(_0x10f917,_0x1155d1,_0x17c1ee){return db['ChatMessage'][_0x4402('0x69')]({'where':{'id':_0x10f917[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1155d1,null))[_0x4402('0x34')](function(_0x37ea8d){if(_0x37ea8d){return _0x37ea8d[_0x4402('0x10a')](_0x10f917[_0x4402('0x7a')]['ids'],_[_0x4402('0x10b')](_0x10f917[_0x4402('0x7a')],['ids','id'])||{});}})[_0x4402('0x34')](respondWithResult(_0x1155d1,null))[_0x4402('0x41')](handleError(_0x1155d1,null));};exports[_0x4402('0x10c')]=function(_0x3e78da,_0x1bf636,_0x44b095){var _0x2433a1={'raw':![],'where':{}};var _0x4069cf={};var _0x7be513={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x3e78da[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x1bf636,null))[_0x4402('0x34')](function(_0x1f2219){if(_0x1f2219){_0x4069cf[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x4069cf[_0x4402('0x48')]=_[_0x4402('0x49')](_0x3e78da[_0x4402('0x48')]);_0x4069cf[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],_0x4069cf[_0x4402('0x48')]);_0x2433a1[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x4069cf[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x3e78da[_0x4402('0x48')]['fields']));_0x2433a1[_0x4402('0x4d')]=_0x2433a1['attributes']['length']?_0x2433a1[_0x4402('0x4d')]:_0x4069cf[_0x4402('0x47')];if(!_0x3e78da[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x2433a1['limit']=qs[_0x4402('0x2a')](_0x3e78da[_0x4402('0x48')][_0x4402('0x2a')]);_0x2433a1['offset']=qs[_0x4402('0x29')](_0x3e78da[_0x4402('0x48')][_0x4402('0x29')]);}_0x2433a1[_0x4402('0x94')]=qs['sort'](_0x3e78da[_0x4402('0x48')][_0x4402('0x10e')]);_0x2433a1['where']=qs['filters'](_['pick'](_0x3e78da['query'],_0x4069cf[_0x4402('0x4a')]));_0x2433a1[_0x4402('0x50')][_0x4402('0xb1')]=_0x1f2219['id'];if(_0x3e78da['query'][_0x4402('0x8a')]){_0x2433a1[_0x4402('0x50')]=_[_0x4402('0x38')](_0x2433a1['where'],{'$or':_[_0x4402('0x42')](_0x2433a1[_0x4402('0x4d')],function(_0x2466a1){var _0x55ed20={};_0x55ed20[_0x2466a1]={'$like':'%'+_0x3e78da[_0x4402('0x48')][_0x4402('0x8a')]+'%'};return _0x55ed20;})});}if(_0x3e78da['query'][_0x4402('0x10f')]){var _0x335d93=_0x3e78da[_0x4402('0x48')][_0x4402('0x10f')]['split'](',');var _0x3aebf6={};_0x3aebf6[_0x335d93[0x0]]={'$gte':moment(_0x335d93[0x1])['format'](_0x4402('0x110'))};_0x2433a1['where']=_['merge'](_0x2433a1[_0x4402('0x50')],_0x3aebf6);}_0x2433a1=_[_0x4402('0x38')]({},_0x2433a1,_0x3e78da[_0x4402('0xb8')]);return db[_0x4402('0xeb')][_0x4402('0x2c')]({'where':_0x2433a1[_0x4402('0x50')]})[_0x4402('0x34')](function(_0x87e1c){_0x7be513['count']=_0x87e1c;if(_0x3e78da[_0x4402('0x48')][_0x4402('0x111')]){_0x2433a1[_0x4402('0xb7')]=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x2433a1);})['then'](function(_0x20b540){_0x7be513['rows']=_0x20b540;return _0x7be513;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x1bf636,_0x2433a1))[_0x4402('0x41')](handleError(_0x1bf636,null));};exports[_0x4402('0x113')]=function(_0x516583,_0x182827,_0x284292){var _0x579bab={'where':{}},_0x30cdd6={},_0x1ac943={'count':0x0,'rows':[]};return db[_0x4402('0x43')][_0x4402('0xbb')]({'where':{'id':_0x516583[_0x4402('0xb6')]['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x182827,null))[_0x4402('0x34')](function(_0xe8f398){if(_0xe8f398){_0x30cdd6[_0x4402('0x47')]=_[_0x4402('0x49')](db[_0x4402('0xeb')][_0x4402('0x44')]);_0x30cdd6[_0x4402('0x48')]=_[_0x4402('0x49')](_0x516583['query']);_0x30cdd6[_0x4402('0x4a')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],_0x30cdd6[_0x4402('0x48')]);_0x579bab[_0x4402('0x4d')]=_[_0x4402('0x4b')](_0x30cdd6[_0x4402('0x47')],qs[_0x4402('0x4c')](_0x516583['query'][_0x4402('0x4c')]));_0x579bab[_0x4402('0x4d')]=_0x579bab[_0x4402('0x4d')]['length']?_0x579bab[_0x4402('0x4d')]:_0x30cdd6[_0x4402('0x47')];if(!_0x516583[_0x4402('0x48')][_0x4402('0x10d')](_0x4402('0x4f'))){_0x579bab[_0x4402('0x2a')]=qs[_0x4402('0x2a')](_0x516583['query']['limit']);_0x579bab[_0x4402('0x29')]=qs[_0x4402('0x29')](_0x516583[_0x4402('0x48')][_0x4402('0x29')]);}_0x579bab[_0x4402('0x94')]=qs['sort'](_0x516583[_0x4402('0x48')][_0x4402('0x10e')]);_0x579bab[_0x4402('0x50')]=qs['filters'](_[_0x4402('0x51')](_0x516583['query'],_0x30cdd6[_0x4402('0x4a')]));_0x579bab[_0x4402('0x50')][_0x4402('0xb1')]=_0xe8f398['id'];if(_0x516583[_0x4402('0x48')]['filter']){_0x579bab[_0x4402('0x50')]=_[_0x4402('0x38')](_0x579bab[_0x4402('0x50')],{'$or':_[_0x4402('0x42')](_0x579bab[_0x4402('0x4d')],function(_0x3adad4){var _0x207b70={};_0x207b70[_0x3adad4]={'$like':'%'+_0x516583['query']['filter']+'%'};return _0x207b70;})});}_0x579bab[_0x4402('0x50')][_0x4402('0xfa')]=![];if(_0x516583[_0x4402('0x48')]['id']){_0x579bab['where']['id']={'$gt':_0x516583[_0x4402('0x48')]['id']};}_0x579bab=_[_0x4402('0x38')]({},_0x579bab,_0x516583[_0x4402('0xb8')]);return db['ChatMessage'][_0x4402('0x2c')]({'where':_0x579bab['where']})[_0x4402('0x34')](function(_0x2903fd){_0x1ac943[_0x4402('0x2c')]=_0x2903fd;_0x579bab['include']=[];if(_0x516583[_0x4402('0x48')][_0x4402('0x114')]){_0x579bab['include']['push']({'model':db['User'],'as':'User','attributes':['id',_0x4402('0xc0'),'alias']});}if(_0x516583['query'][_0x4402('0x111')]){_0x579bab['include']=[{'all':!![]}];}return db[_0x4402('0xeb')][_0x4402('0x112')](_0x579bab);})['then'](function(_0x230904){_0x1ac943[_0x4402('0xb4')]=_0x230904;return _0x1ac943;});}})[_0x4402('0x34')](respondWithFilteredResult(_0x182827,_0x579bab))['catch'](handleError(_0x182827,null));};exports[_0x4402('0x115')]=function(_0x5f42bc,_0x50999c,_0xc4375e){return db['ChatInteraction'][_0x4402('0x69')]({'where':{'id':_0x5f42bc['params']['id']}})[_0x4402('0x34')](handleEntityNotFound(_0x50999c,null))[_0x4402('0x34')](function(_0x21a6d2){if(_0x21a6d2){return _0x21a6d2[_0x4402('0x116')](_0x5f42bc[_0x4402('0x7a')][_0x4402('0x117')],_[_0x4402('0x10b')](_0x5f42bc[_0x4402('0x7a')],[_0x4402('0x117'),'id'])||{})[_0x4402('0x118')](function(){return db[_0x4402('0x75')][_0x4402('0x112')]({'attributes':['id',_0x4402('0x36'),_0x4402('0x119')],'where':{'id':_0x5f42bc[_0x4402('0x7a')]['ids']}});})[_0x4402('0x34')](function(_0x132621){socket[_0x4402('0x11a')](_0x4402('0x11b'),{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]});return{'id':Number(_0x5f42bc[_0x4402('0xb6')]['id']),'tags':_0x132621||[]};});}})[_0x4402('0x34')](respondWithResult(_0x50999c,null))[_0x4402('0x41')](handleError(_0x50999c,null));};exports[_0x4402('0x11c')]=function(_0x4e0ae2,_0x21e2c8,_0x1845d8){return db[_0x4402('0x43')]['find']({'where':{'id':_0x4e0ae2[_0x4402('0xb6')]['id']}})['then'](handleEntityNotFound(_0x21e2c8,null))[_0x4402('0x34')](function(_0x424e93){if(_0x424e93){return _0x424e93[_0x4402('0x11c')](_0x4e0ae2[_0x4402('0x48')]['ids']);}})[_0x4402('0x34')](respondWithStatusCode(_0x21e2c8,null))['catch'](handleError(_0x21e2c8,null));};exports[_0x4402('0xe4')]=function(_0x4cb0bf,_0x2a586e){var _0x5325a7=moment()[_0x4402('0x11d')]()['toString']();var _0x157060=path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x120'));var _0x2ead56=path[_0x4402('0xe0')](config['root'],_0x4402('0x11e'),_0x4402('0x11f'),_0x4402('0x121'));var _0x31d19c=path[_0x4402('0xe0')](_0x157060,_0x5325a7);var _0x1675b2=util[_0x4402('0xe8')](_0x4402('0x122'),_0x4cb0bf['params']['id'],_0x5325a7);var _0xe5e2f3=path[_0x4402('0xe0')](_0x157060,_0x1675b2);var _0x22c8a1=[];_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':_0x4402('0x77'),'attributes':['id',_0x4402('0xc0')],'raw':!![]});_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xd1')],'as':_0x4402('0x6e'),'attributes':['id',_0x4402('0x123'),'lastName'],'raw':!![]});if(_0x4cb0bf[_0x4402('0x48')]['attachments']){_0x22c8a1[_0x4402('0xb2')]({'model':db[_0x4402('0xdc')],'as':_0x4402('0xdc'),'raw':!![]});}var _0x177297=[{'model':db['ChatMessage'],'as':_0x4402('0xec'),'attributes':['id','body',_0x4402('0x7f'),'direction',_0x4402('0xfa'),_0x4402('0x85')],'include':_0x22c8a1}];_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0xbc')],'as':_0x4402('0x124'),'attributes':['id',_0x4402('0x36')]});_0x177297[_0x4402('0xb2')]({'model':db[_0x4402('0x77')],'as':'Owner','attributes':['id',_0x4402('0xc0')]});return db[_0x4402('0x43')][_0x4402('0x69')]({'where':{'id':_0x4cb0bf[_0x4402('0xb6')]['id']},'include':_0x177297})[_0x4402('0x34')](handleEntityNotFound(_0x2a586e,null))[_0x4402('0x34')](function(_0x140207){if(_0x140207){var _0x1d2478=_0x140207[_0x4402('0x125')]({'plain':!![]});fs[_0x4402('0x126')](_0x31d19c);var _0x286a77={'channel':_0x4402('0x127'),'account':_0x1d2478[_0x4402('0x124')][_0x4402('0x36')],'agent':_0x1d2478['Owner']?_0x1d2478[_0x4402('0x128')][_0x4402('0xc0')]:_0x4402('0x129'),'createdAt':moment(_0x1d2478[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'closedAt':_0x1d2478[_0x4402('0x12a')]?moment(_0x1d2478['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4402('0x9e')]():'','disposition':_0x1d2478['disposition'],'chatInfo':{'browser':_0x1d2478[_0x4402('0x12b')],'os':_0x1d2478['osName'],'referer':_0x1d2478[_0x4402('0x12c')],'customerIp':_0x1d2478[_0x4402('0x12d')],'customerPort':_0x1d2478[_0x4402('0x12e')]?_0x1d2478['customerPort']:_0x4402('0x129')},'messages':_(_0x1d2478[_0x4402('0xec')])[_0x4402('0x12f')]()[_0x4402('0x8a')]({'secret':![]})['map'](function(_0x633496){if(_0x633496[_0x4402('0xdc')]){var _0x5862a7=path[_0x4402('0xe0')](_0x2ead56,_0x633496['Attachment'][_0x4402('0xd9')]);if(fs[_0x4402('0x130')](_0x5862a7)){fs[_0x4402('0x131')](_0x5862a7)[_0x4402('0x132')](fs[_0x4402('0x133')](path[_0x4402('0xe0')](_0x31d19c,_0x633496[_0x4402('0xdc')][_0x4402('0xd9')])));}}return{'date':moment(_0x633496[_0x4402('0x7f')])[_0x4402('0xe8')](_0x4402('0x110'))[_0x4402('0x9e')](),'sender':_0x633496['direction']===_0x4402('0xcd')?_0x633496[_0x4402('0x77')]?_0x633496[_0x4402('0x77')][_0x4402('0xc0')]:_0x4402('0xf0'):_0x633496['Contact'][_0x4402('0x123')]+(_0x633496[_0x4402('0x6e')][_0x4402('0x134')]?'\x20'+_0x633496[_0x4402('0x6e')][_0x4402('0x134')]:''),'body':_0x633496[_0x4402('0xdc')]?_0x633496[_0x4402('0xdc')]['basename']:_0x633496[_0x4402('0x7a')],'direction':_0x633496['direction']===_0x4402('0xcd')?'A':'C','secret':_0x633496[_0x4402('0xfa')],'read':_0x633496[_0x4402('0x85')],'attachment':_0x633496['Attachment']};})[_0x4402('0x6b')]()};return ejs[_0x4402('0x135')](path[_0x4402('0xe0')](config[_0x4402('0xe1')],_0x4402('0x11e'),'views','downloadInteraction.ejs'),{'interaction':_0x286a77})['then'](function(_0x5b8cd8){var _0x3fc6b3=path[_0x4402('0xe0')](_0x31d19c,'transcript-'+_0x1d2478['id']+'-'+_0x5325a7+_0x4402('0x136'));var _0x15bbe1={'path':_0x3fc6b3,'channel':_0x4402('0x127'),'interactionId':_0x1d2478['id']};return pdf[_0x4402('0x137')](_0x5b8cd8,_0x15bbe1);})[_0x4402('0x34')](function(){return new BPromise(function(_0x303680,_0x281eaa){zipdir(_0x31d19c,{'saveTo':_0xe5e2f3},function(_0x1baf42,_0x3d743e){if(_0x1baf42)return _0x281eaa(_0x1baf42);return _0x303680(_0x3d743e);});})[_0x4402('0x34')](function(){return new BPromise(function(_0x5ad41f,_0xbeb577){rimraf(_0x31d19c,function(_0x8c8f01){if(_0x8c8f01)_0xbeb577(_0x8c8f01);return _0x5ad41f();});});})[_0x4402('0x34')](function(){return _0x2a586e[_0x4402('0xe4')](_0xe5e2f3,_0x1675b2,function(_0xc36aed){if(_0xc36aed){console['log'](_0x4402('0x138'),_0xc36aed);}else{fs[_0x4402('0x139')](_0xe5e2f3);}});});});}else{return _0x2a586e[_0x4402('0x35')](0xc8);}})[_0x4402('0x41')](handleError(_0x2a586e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 7147a4e..3db70b3 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 _0x977b=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','emit','catch'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x977b,0x198));var _0xb977=function(_0x33ea16,_0x2cb34b){_0x33ea16=_0x33ea16-0x0;var _0x14c8cc=_0x977b[_0x33ea16];return _0x14c8cc;};'use strict';var EventEmitter=require(_0xb977('0x0'));var ChatInteraction=require(_0xb977('0x1'))['db'][_0xb977('0x2')];var ChatMessage=require(_0xb977('0x1'))['db'][_0xb977('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb977('0x4')](0x0);var events={'afterCreate':_0xb977('0x5'),'afterUpdate':'update','afterDestroy':_0xb977('0x6')};function emitEvent(_0x43d4d9){return function(_0x3a3245,_0x1118ba,_0x32f085){_0x3a3245[_0xb977('0x7')]({'attributes':['id'],'raw':!![]})[_0xb977('0x8')](function(_0x469616){_0x3a3245[_0xb977('0x9')]('Users',_0x469616['map'](function(_0x27a514){return{'id':_0x27a514['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3a3245['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb977('0x8')](function(_0x593b14){_0x3a3245['setDataValue']('unreadMessages',_0x593b14['length']);ChatInteractionEvents[_0xb977('0xa')](_0x43d4d9+':'+_0x3a3245['id'],_0x3a3245);ChatInteractionEvents[_0xb977('0xa')](_0x43d4d9,_0x3a3245);_0x32f085(null);})[_0xb977('0xb')](_0x32f085(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xb977('0xc')](e,emitEvent(event));}}module[_0xb977('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xcb0d=['emit','catch','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x2df61f,_0x2d6a48){var _0x185960=function(_0x500069){while(--_0x500069){_0x2df61f['push'](_0x2df61f['shift']());}};_0x185960(++_0x2d6a48);}(_0xcb0d,0x183));var _0xdcb0=function(_0xbe41ba,_0x384563){_0xbe41ba=_0xbe41ba-0x0;var _0x2c2085=_0xcb0d[_0xbe41ba];return _0x2c2085;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdcb0('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xdcb0('0x0'))['db'][_0xdcb0('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdcb0('0x2')](0x0);var events={'afterCreate':_0xdcb0('0x3'),'afterUpdate':_0xdcb0('0x4'),'afterDestroy':_0xdcb0('0x5')};function emitEvent(_0x3001ea){return function(_0x30629e,_0x38409f,_0x135544){_0x30629e[_0xdcb0('0x6')]({'attributes':['id'],'raw':!![]})[_0xdcb0('0x7')](function(_0x1cb494){_0x30629e[_0xdcb0('0x8')]('Users',_0x1cb494[_0xdcb0('0x9')](function(_0x20c6f2){return{'id':_0x20c6f2['id']};}));return ChatMessage[_0xdcb0('0xa')]({'where':{'ChatInteractionId':_0x30629e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdcb0('0x7')](function(_0x10d75b){_0x30629e[_0xdcb0('0x8')](_0xdcb0('0xb'),_0x10d75b[_0xdcb0('0xc')]);ChatInteractionEvents[_0xdcb0('0xd')](_0x3001ea+':'+_0x30629e['id'],_0x30629e);ChatInteractionEvents[_0xdcb0('0xd')](_0x3001ea,_0x30629e);_0x135544(null);})[_0xdcb0('0xe')](_0x135544(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdcb0('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d70ede7..456d76c 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 _0x29bc=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x29bc,0x1cb));var _0xc29b=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x29bc[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require(_0xc29b('0x0'));var logger=require(_0xc29b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc29b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc29b('0x3'));var config=require(_0xc29b('0x4'));var attributes=require(_0xc29b('0x5'));module['exports']=function(_0xa218a5,_0x1f7089){return _0xa218a5['define'](_0xc29b('0x6'),attributes,{'tableName':_0xc29b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13db0e,_0x4876a5,_0x41fc34){if(_0x13db0e[_0xc29b('0x8')](_0xc29b('0x9'))){_0x13db0e[_0xc29b('0xa')]=moment()[_0xc29b('0xb')](_0xc29b('0xc'));}_0x41fc34(null,_0x13db0e);}},'charset':_0xc29b('0xd'),'collate':_0xc29b('0xe')});}; \ No newline at end of file +var _0x891f=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x891f,0xc0));var _0xf891=function(_0x367514,_0x4bd3e6){_0x367514=_0x367514-0x0;var _0x4562d8=_0x891f[_0x367514];return _0x4562d8;};'use strict';var _=require(_0xf891('0x0'));var util=require(_0xf891('0x1'));var logger=require(_0xf891('0x2'))(_0xf891('0x3'));var moment=require(_0xf891('0x4'));var BPromise=require(_0xf891('0x5'));var rp=require(_0xf891('0x6'));var fs=require('fs');var path=require(_0xf891('0x7'));var rimraf=require('rimraf');var config=require(_0xf891('0x8'));var attributes=require(_0xf891('0x9'));module[_0xf891('0xa')]=function(_0x51b153,_0x37e777){return _0x51b153[_0xf891('0xb')](_0xf891('0xc'),attributes,{'tableName':_0xf891('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d0d57,_0x184505,_0x248fdd){if(_0x1d0d57[_0xf891('0xe')](_0xf891('0xf'))){_0x1d0d57[_0xf891('0x10')]=moment()['format'](_0xf891('0x11'));}_0x248fdd(null,_0x1d0d57);}},'charset':_0xf891('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 20f03c5..5d5453a 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 _0x2b54=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','AddTagsToChatInteraction','where','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x15da11,_0x9c2009){var _0x50c433=function(_0x278f77){while(--_0x278f77){_0x15da11['push'](_0x15da11['shift']());}};_0x50c433(++_0x9c2009);}(_0x2b54,0x15a));var _0x42b5=function(_0x4be2c1,_0x8afb2d){_0x4be2c1=_0x4be2c1-0x0;var _0x2445b7=_0x2b54[_0x4be2c1];return _0x2445b7;};'use strict';var _=require(_0x42b5('0x0'));var util=require(_0x42b5('0x1'));var moment=require(_0x42b5('0x2'));var BPromise=require(_0x42b5('0x3'));var rs=require(_0x42b5('0x4'));var fs=require('fs');var Redis=require(_0x42b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42b5('0x6'));var logger=require(_0x42b5('0x7'))(_0x42b5('0x8'));var config=require(_0x42b5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x42b5('0xa')][_0x42b5('0xb')]({'port':0x232a});config[_0x42b5('0xc')]=_[_0x42b5('0xd')](config['redis'],{'host':_0x42b5('0xe'),'port':0x18eb});var socket=require(_0x42b5('0xf'))(new Redis(config[_0x42b5('0xc')]));require(_0x42b5('0x10'))[_0x42b5('0x11')](socket);function respondWithRpcPromise(_0x5d5f4b,_0x59dd2f,_0x24bcdf){return new BPromise(function(_0x3a4044,_0x506a39){return client[_0x42b5('0x12')](_0x5d5f4b,_0x24bcdf)[_0x42b5('0x13')](function(_0x19a971){logger[_0x42b5('0x14')](_0x42b5('0x15'),_0x59dd2f,'request\x20sent');logger[_0x42b5('0x16')](_0x42b5('0x17'),_0x59dd2f,_0x42b5('0x18'),JSON[_0x42b5('0x19')](_0x19a971));if(_0x19a971['error']){if(_0x19a971[_0x42b5('0x1a')][_0x42b5('0x1b')]===0x1f4){logger[_0x42b5('0x1a')](_0x42b5('0x15'),_0x59dd2f,_0x19a971['error'][_0x42b5('0x1c')]);return _0x506a39(_0x19a971['error']['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x59dd2f,_0x19a971['error']['message']);return _0x3a4044(_0x19a971[_0x42b5('0x1a')]['message']);}else{logger[_0x42b5('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x59dd2f,_0x42b5('0x18'));_0x3a4044(_0x19a971[_0x42b5('0x1d')][_0x42b5('0x1c')]);}})[_0x42b5('0x1e')](function(_0x15eb2c){logger[_0x42b5('0x1a')](_0x42b5('0x15'),_0x59dd2f,_0x15eb2c);_0x506a39(_0x15eb2c);});});}exports[_0x42b5('0x1f')]=function(_0x4b1cd7){var _0x3fdd25=this;return new Promise(function(_0x4f773f,_0x10e295){return db[_0x42b5('0x20')][_0x42b5('0x21')](_0x4b1cd7['body'],{'raw':_0x4b1cd7[_0x42b5('0x22')]?_0x4b1cd7[_0x42b5('0x22')][_0x42b5('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1cd7[_0x42b5('0x22')]?_0x4b1cd7['options']['where']||null:null,'attributes':_0x4b1cd7[_0x42b5('0x22')]?_0x4b1cd7[_0x42b5('0x22')]['attributes']||null:null,'limit':_0x4b1cd7[_0x42b5('0x22')]?_0x4b1cd7[_0x42b5('0x22')]['limit']||null:null})[_0x42b5('0x13')](function(_0x1deef6){logger[_0x42b5('0x14')](_0x42b5('0x1f'),_0x4b1cd7);logger[_0x42b5('0x16')](_0x42b5('0x1f'),_0x4b1cd7,JSON[_0x42b5('0x19')](_0x1deef6));_0x4f773f(_0x1deef6);})[_0x42b5('0x1e')](function(_0x136bbf){logger[_0x42b5('0x1a')](_0x42b5('0x1f'),_0x136bbf[_0x42b5('0x1c')],_0x4b1cd7);_0x10e295(_0x3fdd25[_0x42b5('0x1a')](0x1f4,_0x136bbf[_0x42b5('0x1c')]));});});};exports[_0x42b5('0x24')]=function(_0x853279){return new Promise(function(_0x5e1a8d,_0x4b38c7){return db[_0x42b5('0x20')]['find']({'where':_0x853279[_0x42b5('0x22')]?_0x853279[_0x42b5('0x22')][_0x42b5('0x25')]||null:null})['then'](function(_0x3a0dd5){if(_0x3a0dd5){return _0x3a0dd5[_0x42b5('0x26')](_0x853279[_0x42b5('0x27')][_0x42b5('0x28')],_[_0x42b5('0x29')](_0x853279[_0x42b5('0x27')],['ids','id'])||{});}})[_0x42b5('0x2a')](function(_0x233a49){logger[_0x42b5('0x14')](_0x42b5('0x2b'),_0x853279);logger[_0x42b5('0x16')](_0x42b5('0x2b'),_0x853279,JSON[_0x42b5('0x19')](_0x233a49));_0x5e1a8d(_0x233a49);})[_0x42b5('0x1e')](function(_0x2cd528){logger[_0x42b5('0x1a')](_0x42b5('0x2b'),_0x2cd528['message'],_0x853279);_0x4b38c7(_this[_0x42b5('0x1a')](0x1f4,_0x2cd528[_0x42b5('0x1c')]));});});}; \ No newline at end of file +var _0xacc4=['AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread'];(function(_0x1802a6,_0x265405){var _0x38a7cc=function(_0xd88ee){while(--_0xd88ee){_0x1802a6['push'](_0x1802a6['shift']());}};_0x38a7cc(++_0x265405);}(_0xacc4,0x18d));var _0x4acc=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0xacc4[_0x397f37];return _0x31cae6;};'use strict';var _=require('lodash');var util=require(_0x4acc('0x0'));var moment=require(_0x4acc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4acc('0x2'));var fs=require('fs');var Redis=require(_0x4acc('0x3'));var db=require(_0x4acc('0x4'))['db'];var utils=require(_0x4acc('0x5'));var logger=require(_0x4acc('0x6'))(_0x4acc('0x7'));var config=require(_0x4acc('0x8'));var jayson=require(_0x4acc('0x9'));var client=jayson[_0x4acc('0xa')][_0x4acc('0xb')]({'port':0x232a});config[_0x4acc('0xc')]=_[_0x4acc('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4acc('0xe'))(new Redis(config[_0x4acc('0xc')]));require(_0x4acc('0xf'))[_0x4acc('0x10')](socket);function respondWithRpcPromise(_0x3c02d7,_0x1b9d41,_0x3dc991){return new BPromise(function(_0x36c7a1,_0x1097d5){return client[_0x4acc('0x11')](_0x3c02d7,_0x3dc991)['then'](function(_0x434e8b){logger[_0x4acc('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1b9d41,_0x4acc('0x13'));logger[_0x4acc('0x14')](_0x4acc('0x15'),_0x1b9d41,_0x4acc('0x13'),JSON[_0x4acc('0x16')](_0x434e8b));if(_0x434e8b[_0x4acc('0x17')]){if(_0x434e8b['error'][_0x4acc('0x18')]===0x1f4){logger[_0x4acc('0x17')](_0x4acc('0x19'),_0x1b9d41,_0x434e8b[_0x4acc('0x17')]['message']);return _0x1097d5(_0x434e8b[_0x4acc('0x17')][_0x4acc('0x1a')]);}logger[_0x4acc('0x17')](_0x4acc('0x19'),_0x1b9d41,_0x434e8b['error'][_0x4acc('0x1a')]);return _0x36c7a1(_0x434e8b[_0x4acc('0x17')][_0x4acc('0x1a')]);}else{logger[_0x4acc('0x12')](_0x4acc('0x19'),_0x1b9d41,_0x4acc('0x13'));_0x36c7a1(_0x434e8b[_0x4acc('0x1b')][_0x4acc('0x1a')]);}})[_0x4acc('0x1c')](function(_0x7386a6){logger[_0x4acc('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1b9d41,_0x7386a6);_0x1097d5(_0x7386a6);});});}exports[_0x4acc('0x1d')]=function(_0x323822){var _0x4c630d=this;return new Promise(function(_0x3acaf1,_0xde3d12){return db[_0x4acc('0x1e')]['update'](_0x323822[_0x4acc('0x1f')],{'raw':_0x323822[_0x4acc('0x20')]?_0x323822[_0x4acc('0x20')][_0x4acc('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323822[_0x4acc('0x20')]?_0x323822['options']['where']||null:null,'attributes':_0x323822[_0x4acc('0x20')]?_0x323822[_0x4acc('0x20')]['attributes']||null:null,'limit':_0x323822[_0x4acc('0x20')]?_0x323822[_0x4acc('0x20')][_0x4acc('0x22')]||null:null})[_0x4acc('0x23')](function(_0x469e71){logger['info'](_0x4acc('0x1d'),_0x323822);logger[_0x4acc('0x14')]('UpdateChatInteraction',_0x323822,JSON['stringify'](_0x469e71));_0x3acaf1(_0x469e71);})[_0x4acc('0x1c')](function(_0x389a25){logger[_0x4acc('0x17')](_0x4acc('0x1d'),_0x389a25['message'],_0x323822);_0xde3d12(_0x4c630d[_0x4acc('0x17')](0x1f4,_0x389a25['message']));});});};exports[_0x4acc('0x24')]=function(_0xdaaf0a){return new Promise(function(_0x1097ba,_0x2b8950){return db[_0x4acc('0x1e')][_0x4acc('0x25')]({'where':_0xdaaf0a['options']?_0xdaaf0a[_0x4acc('0x20')][_0x4acc('0x26')]||null:null})[_0x4acc('0x23')](function(_0x3d76f4){if(_0x3d76f4){return _0x3d76f4[_0x4acc('0x27')](_0xdaaf0a[_0x4acc('0x1f')][_0x4acc('0x28')],_[_0x4acc('0x29')](_0xdaaf0a['body'],['ids','id'])||{});}})[_0x4acc('0x2a')](function(_0xdd3b71){logger[_0x4acc('0x12')](_0x4acc('0x2b'),_0xdaaf0a);logger['debug'](_0x4acc('0x2b'),_0xdaaf0a,JSON['stringify'](_0xdd3b71));_0x1097ba(_0xdd3b71);})[_0x4acc('0x1c')](function(_0x3d8063){logger['error'](_0x4acc('0x2b'),_0x3d8063['message'],_0xdaaf0a);_0x2b8950(_this['error'](0x1f4,_0x3d8063[_0x4acc('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8bb5ae7..1dff9dd 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 _0x5ede=['length','chatInteraction:','./chatInteraction.events','update','emit','removeListener'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x5ede,0x13a));var _0xe5ed=function(_0x417ead,_0x2670d2){_0x417ead=_0x417ead-0x0;var _0x2ec8f4=_0x5ede[_0x417ead];return _0x2ec8f4;};'use strict';var ChatInteractionEvents=require(_0xe5ed('0x0'));var events=['save','remove',_0xe5ed('0x1')];function createListener(_0x28eca7,_0x51dbaf){return function(_0x9aba4e){_0x51dbaf[_0xe5ed('0x2')](_0x28eca7,_0x9aba4e);};}function removeListener(_0x2e8b4f,_0x1580e5){return function(){ChatInteractionEvents[_0xe5ed('0x3')](_0x2e8b4f,_0x1580e5);};}exports['register']=function(_0x4f5ca3){for(var _0x5d4543=0x0,_0x346b02=events[_0xe5ed('0x4')];_0x5d4543<_0x346b02;_0x5d4543++){var _0x19f4e6=events[_0x5d4543];var _0x3e3879=createListener(_0xe5ed('0x5')+_0x19f4e6,_0x4f5ca3);ChatInteractionEvents['on'](_0x19f4e6,_0x3e3879);}}; \ No newline at end of file +var _0x0700=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','register','length'];(function(_0xcce45,_0xc934d9){var _0x498119=function(_0x56b3c1){while(--_0x56b3c1){_0xcce45['push'](_0xcce45['shift']());}};_0x498119(++_0xc934d9);}(_0x0700,0x81));var _0x0070=function(_0x33791b,_0x13b183){_0x33791b=_0x33791b-0x0;var _0x1bfa30=_0x0700[_0x33791b];return _0x1bfa30;};'use strict';var ChatInteractionEvents=require(_0x0070('0x0'));var events=[_0x0070('0x1'),_0x0070('0x2'),_0x0070('0x3')];function createListener(_0x3e0b17,_0x4c4f96){return function(_0x2ac1be){_0x4c4f96['emit'](_0x3e0b17,_0x2ac1be);};}function removeListener(_0x1a2d9e,_0xbd9e71){return function(){ChatInteractionEvents[_0x0070('0x4')](_0x1a2d9e,_0xbd9e71);};}exports[_0x0070('0x5')]=function(_0x5c5976){for(var _0x5a5daa=0x0,_0x10f651=events[_0x0070('0x6')];_0x5a5daa<_0x10f651;_0x5a5daa++){var _0x158b1f=events[_0x5a5daa];var _0x1b884e=createListener(_0x0070('0x7')+_0x158b1f,_0x5c5976);ChatInteractionEvents['on'](_0x158b1f,_0x1b884e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 110271d..4e6bac0 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 _0x573e=['/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace'];(function(_0x38e275,_0x2cb559){var _0x3f3c6b=function(_0x38b7e0){while(--_0x38b7e0){_0x38e275['push'](_0x38e275['shift']());}};_0x3f3c6b(++_0x2cb559);}(_0x573e,0x12d));var _0xe573=function(_0x23c847,_0xc1b937){_0x23c847=_0x23c847-0x0;var _0x4fd9c5=_0x573e[_0x23c847];return _0x4fd9c5;};'use strict';var multer=require(_0xe573('0x0'));var util=require(_0xe573('0x1'));var path=require(_0xe573('0x2'));var timeout=require('connect-timeout');var express=require(_0xe573('0x3'));var router=express['Router']();var fs_extra=require(_0xe573('0x4'));var auth=require(_0xe573('0x5'));var interaction=require(_0xe573('0x6'));var config=require(_0xe573('0x7'));var controller=require(_0xe573('0x8'));router[_0xe573('0x9')]('/',auth[_0xe573('0xa')](),controller[_0xe573('0xb')]);router[_0xe573('0x9')](_0xe573('0xc'),auth[_0xe573('0xa')](),controller[_0xe573('0xd')]);router['get'](_0xe573('0xe'),auth[_0xe573('0xf')](),controller[_0xe573('0x10')]);router['get'](_0xe573('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe573('0x12')]);router['get'](_0xe573('0x13'),auth[_0xe573('0xa')](),controller[_0xe573('0x14')]);router['get']('/:id/my_messages',auth[_0xe573('0xf')](),controller[_0xe573('0x15')]);router['get']('/:id/download',auth[_0xe573('0xa')](),controller[_0xe573('0x16')]);router[_0xe573('0x17')]('/',auth['isAuthenticated'](),controller[_0xe573('0x18')]);router[_0xe573('0x17')](_0xe573('0x19'),auth[_0xe573('0xa')](),controller[_0xe573('0x1a')]);var upload=multer({'storage':multer[_0xe573('0x1b')]({'destination':function(_0x4fb7e3,_0x5be5d9,_0x1e4f46){_0x1e4f46(null,path[_0xe573('0x1c')](config[_0xe573('0x1d')],_0xe573('0x1e')));},'filename':function(_0x4dfab4,_0x54d099,_0x3de0ba){_0x3de0ba(null,util[_0xe573('0x1f')](_0xe573('0x20'),Date[_0xe573('0x21')](),_0x54d099['originalname'][_0xe573('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xe573('0x23'),upload[_0xe573('0x24')]('file'),controller[_0xe573('0x25')]);router[_0xe573('0x17')](_0xe573('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xe573('0x26')]);router[_0xe573('0x17')](_0xe573('0x27'),auth[_0xe573('0xa')](),interaction['tracked']('chat',_0xe573('0x28')),controller[_0xe573('0x29')]);router[_0xe573('0x2a')]('/:id',auth[_0xe573('0xa')](),interaction[_0xe573('0x2b')](_0xe573('0x2c'),_0xe573('0x2d')),controller[_0xe573('0x2e')]);router[_0xe573('0x2a')](_0xe573('0x2f'),controller['customUpdate']);router['put'](_0xe573('0x30'),auth['isChatInteractionAuthorized'](),controller[_0xe573('0x31')]);router[_0xe573('0x2a')](_0xe573('0x32'),controller[_0xe573('0x33')]);router[_0xe573('0x34')](_0xe573('0xe'),auth[_0xe573('0xa')](),interaction['tracked'](_0xe573('0x2c'),_0xe573('0x35')),controller[_0xe573('0x36')]);router['delete'](_0xe573('0x27'),auth['isAuthenticated'](),controller['removeTags']);module[_0xe573('0x37')]=router; \ No newline at end of file +var _0x49e3=['abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','put','tracked','chatinteraction:update','/:id/custom_update','/:id/abandon'];(function(_0x40d810,_0x46414d){var _0xfe2966=function(_0x456795){while(--_0x456795){_0x40d810['push'](_0x40d810['shift']());}};_0xfe2966(++_0x46414d);}(_0x49e3,0x107));var _0x349e=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x49e3[_0x30c649];return _0x3edfb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x349e('0x0'));var timeout=require(_0x349e('0x1'));var express=require(_0x349e('0x2'));var router=express[_0x349e('0x3')]();var fs_extra=require(_0x349e('0x4'));var auth=require(_0x349e('0x5'));var interaction=require(_0x349e('0x6'));var config=require(_0x349e('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x349e('0x8')](),controller[_0x349e('0x9')]);router[_0x349e('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x349e('0xb')]);router[_0x349e('0xa')](_0x349e('0xc'),auth[_0x349e('0xd')](),controller[_0x349e('0xe')]);router[_0x349e('0xa')]('/:id/attachment_download',auth[_0x349e('0xd')](),controller[_0x349e('0xf')]);router['get'](_0x349e('0x10'),auth[_0x349e('0x8')](),controller[_0x349e('0x11')]);router[_0x349e('0xa')](_0x349e('0x12'),auth[_0x349e('0xd')](),controller[_0x349e('0x13')]);router[_0x349e('0xa')](_0x349e('0x14'),auth['isAuthenticated'](),controller[_0x349e('0x15')]);router[_0x349e('0x16')]('/',auth[_0x349e('0x8')](),controller['create']);router[_0x349e('0x16')](_0x349e('0x17'),auth['isAuthenticated'](),controller[_0x349e('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4dfc51,_0x53b476,_0x53f200){_0x53f200(null,path[_0x349e('0x19')](config[_0x349e('0x1a')],'server/files/attachments/'));},'filename':function(_0x5caacc,_0x4153b0,_0x4045e4){_0x4045e4(null,util['format'](_0x349e('0x1b'),Date[_0x349e('0x1c')](),_0x4153b0[_0x349e('0x1d')][_0x349e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x349e('0x16')](_0x349e('0x1f'),upload['single'](_0x349e('0x20')),controller[_0x349e('0x21')]);router[_0x349e('0x16')](_0x349e('0x10'),auth[_0x349e('0xd')](),controller[_0x349e('0x22')]);router[_0x349e('0x16')](_0x349e('0x23'),auth[_0x349e('0x8')](),interaction['tracked'](_0x349e('0x24'),'chatinteraction:addtags'),controller[_0x349e('0x25')]);router[_0x349e('0x26')](_0x349e('0xc'),auth[_0x349e('0x8')](),interaction[_0x349e('0x27')](_0x349e('0x24'),_0x349e('0x28')),controller['update']);router['put'](_0x349e('0x29'),controller['customUpdate']);router[_0x349e('0x26')](_0x349e('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x349e('0x2b')]);router[_0x349e('0x26')](_0x349e('0x2c'),controller[_0x349e('0x2d')]);router[_0x349e('0x2e')](_0x349e('0xc'),auth[_0x349e('0x8')](),interaction[_0x349e('0x27')](_0x349e('0x24'),_0x349e('0x2f')),controller[_0x349e('0x30')]);router[_0x349e('0x2e')]('/:id/tags',auth[_0x349e('0x8')](),controller[_0x349e('0x31')]);module[_0x349e('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 1d37269..7ace6fe 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 _0x3201=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3201,0x187));var _0x1320=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x3201[_0x595604];return _0x1466f3;};'use strict';var Sequelize=require('sequelize');module[_0x1320('0x0')]={'body':{'type':Sequelize[_0x1320('0x1')](_0x1320('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1320('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1320('0x4')]}}; \ No newline at end of file +var _0xdea2=['exports','TEXT','medium','INTEGER','sequelize'];(function(_0x20f4af,_0x4163e6){var _0x20b7ed=function(_0x6defaa){while(--_0x6defaa){_0x20f4af['push'](_0x20f4af['shift']());}};_0x20b7ed(++_0x4163e6);}(_0xdea2,0x108));var _0x2dea=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xdea2[_0x215dc8];return _0x583ea3;};'use strict';var Sequelize=require(_0x2dea('0x0'));module[_0x2dea('0x1')]={'body':{'type':Sequelize[_0x2dea('0x2')](_0x2dea('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2dea('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4436ea3..71511be 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 _0xdc54=['read','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','stack','send','index','ChatInternalMessage','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueues','get','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages'];(function(_0x4e4c92,_0x3cde62){var _0x5acf9e=function(_0x1196dc){while(--_0x1196dc){_0x4e4c92['push'](_0x4e4c92['shift']());}};_0x5acf9e(++_0x3cde62);}(_0xdc54,0xdb));var _0x4dc5=function(_0x4a7f0b,_0x5030fe){_0x4a7f0b=_0x4a7f0b-0x0;var _0xcf45ad=_0xdc54[_0x4a7f0b];return _0xcf45ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4dc5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4dc5('0x1'));var rp=require(_0x4dc5('0x2'));var moment=require(_0x4dc5('0x3'));var BPromise=require(_0x4dc5('0x4'));var Mustache=require(_0x4dc5('0x5'));var util=require(_0x4dc5('0x6'));var path=require(_0x4dc5('0x7'));var sox=require(_0x4dc5('0x8'));var csv=require(_0x4dc5('0x9'));var ejs=require(_0x4dc5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4dc5('0xb'));var squel=require(_0x4dc5('0xc'));var crypto=require(_0x4dc5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4dc5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4dc5('0xf'));var Papa=require(_0x4dc5('0x10'));var Redis=require(_0x4dc5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4dc5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4dc5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4dc5('0x14'))['db'];config['redis']=_[_0x4dc5('0x15')](config[_0x4dc5('0x16')],{'host':_0x4dc5('0x17'),'port':0x18eb});var socket=require(_0x4dc5('0x18'))(new Redis(config[_0x4dc5('0x16')]));require(_0x4dc5('0x19'))[_0x4dc5('0x1a')](socket);function respondWithStatusCode(_0x147cee,_0x32dbd7){_0x32dbd7=_0x32dbd7||0xcc;return function(_0x5e0244){if(_0x5e0244){return _0x147cee[_0x4dc5('0x1b')](_0x32dbd7);}return _0x147cee[_0x4dc5('0x1c')](_0x32dbd7)[_0x4dc5('0x1d')]();};}function respondWithResult(_0x186958,_0x37e631){_0x37e631=_0x37e631||0xc8;return function(_0x551537){if(_0x551537){return _0x186958[_0x4dc5('0x1c')](_0x37e631)['json'](_0x551537);}};}function respondWithFilteredResult(_0x3c452d,_0xd973c6){return function(_0x207f3b){if(_0x207f3b){var _0x3888df=typeof _0xd973c6['offset']===_0x4dc5('0x1e')&&typeof _0xd973c6[_0x4dc5('0x1f')]==='undefined';var _0x55edff=_0x207f3b[_0x4dc5('0x20')];var _0x146a4d=_0x3888df?0x0:_0xd973c6[_0x4dc5('0x21')];var _0x4ac92d=_0x3888df?_0x207f3b['count']:_0xd973c6[_0x4dc5('0x21')]+_0xd973c6[_0x4dc5('0x1f')];var _0x146dfd;if(_0x4ac92d>=_0x55edff){_0x4ac92d=_0x55edff;_0x146dfd=0xc8;}else{_0x146dfd=0xce;}_0x3c452d[_0x4dc5('0x1c')](_0x146dfd);return _0x3c452d[_0x4dc5('0x22')](_0x4dc5('0x23'),_0x146a4d+'-'+_0x4ac92d+'/'+_0x55edff)['json'](_0x207f3b);}return null;};}function patchUpdates(_0x363b1b){return function(_0x151cf4){try{jsonpatch['apply'](_0x151cf4,_0x363b1b,!![]);}catch(_0x50e147){return BPromise[_0x4dc5('0x24')](_0x50e147);}return _0x151cf4['save']();};}function saveUpdates(_0x69e3c,_0x101bbb){return function(_0x53e000){if(_0x53e000){return _0x53e000[_0x4dc5('0x25')](_0x69e3c)[_0x4dc5('0x26')](function(_0x57c83e){return _0x57c83e;});}return null;};}function removeEntity(_0x591ef5,_0x4f7884){return function(_0x4d52b0){if(_0x4d52b0){return _0x4d52b0[_0x4dc5('0x27')]()[_0x4dc5('0x26')](function(){_0x591ef5[_0x4dc5('0x1c')](0xcc)[_0x4dc5('0x1d')]();});}};}function handleEntityNotFound(_0x52ef08,_0x185fd2){return function(_0xe6d624){if(!_0xe6d624){_0x52ef08[_0x4dc5('0x1b')](0x194);}return _0xe6d624;};}function handleError(_0xd3d152,_0x50a238){_0x50a238=_0x50a238||0x1f4;return function(_0x5a517b){logger['error'](_0x5a517b[_0x4dc5('0x28')]);if(_0x5a517b['name']){delete _0x5a517b['name'];}_0xd3d152[_0x4dc5('0x1c')](_0x50a238)[_0x4dc5('0x29')](_0x5a517b);};}exports[_0x4dc5('0x2a')]=function(_0x44b431,_0x16ab51){var _0x14b64b={},_0x587b13={},_0x2d0342={'count':0x0,'rows':[]};var _0x1209d8=_['map'](db[_0x4dc5('0x2b')]['rawAttributes'],function(_0x5d3799){return{'name':_0x5d3799['fieldName'],'type':_0x5d3799[_0x4dc5('0x2c')][_0x4dc5('0x2d')]};});_0x587b13[_0x4dc5('0x2e')]=_[_0x4dc5('0x2f')](_0x1209d8,_0x4dc5('0x30'));_0x587b13[_0x4dc5('0x31')]=_[_0x4dc5('0x32')](_0x44b431[_0x4dc5('0x31')]);_0x587b13[_0x4dc5('0x33')]=_['intersection'](_0x587b13[_0x4dc5('0x2e')],_0x587b13[_0x4dc5('0x31')]);_0x14b64b[_0x4dc5('0x34')]=_[_0x4dc5('0x35')](_0x587b13[_0x4dc5('0x2e')],qs[_0x4dc5('0x36')](_0x44b431[_0x4dc5('0x31')][_0x4dc5('0x36')]));_0x14b64b[_0x4dc5('0x34')]=_0x14b64b[_0x4dc5('0x34')][_0x4dc5('0x37')]?_0x14b64b[_0x4dc5('0x34')]:_0x587b13['model'];if(!_0x44b431[_0x4dc5('0x31')][_0x4dc5('0x38')](_0x4dc5('0x39'))){_0x14b64b['limit']=qs[_0x4dc5('0x1f')](_0x44b431['query'][_0x4dc5('0x1f')]);_0x14b64b['offset']=qs[_0x4dc5('0x21')](_0x44b431['query'][_0x4dc5('0x21')]);}_0x14b64b[_0x4dc5('0x3a')]=qs[_0x4dc5('0x3b')](_0x44b431['query'][_0x4dc5('0x3b')]);_0x14b64b['where']=qs[_0x4dc5('0x33')](_[_0x4dc5('0x3c')](_0x44b431[_0x4dc5('0x31')],_0x587b13[_0x4dc5('0x33')]),_0x1209d8);if(_0x44b431[_0x4dc5('0x31')][_0x4dc5('0x3d')]){_0x14b64b[_0x4dc5('0x3e')]=_[_0x4dc5('0x3f')](_0x14b64b[_0x4dc5('0x3e')],{'$or':_['map'](_0x1209d8,function(_0x25c21d){if(_0x25c21d[_0x4dc5('0x2c')]!==_0x4dc5('0x40')){var _0xad1a9={};_0xad1a9[_0x25c21d[_0x4dc5('0x30')]]={'$like':'%'+_0x44b431[_0x4dc5('0x31')]['filter']+'%'};return _0xad1a9;}})});}_0x14b64b=_[_0x4dc5('0x3f')]({},_0x14b64b,_0x44b431[_0x4dc5('0x41')]);var _0x4152a7={'where':_0x14b64b[_0x4dc5('0x3e')]};return db[_0x4dc5('0x2b')]['count'](_0x4152a7)[_0x4dc5('0x26')](function(_0x3c1685){_0x2d0342['count']=_0x3c1685;if(_0x44b431[_0x4dc5('0x31')][_0x4dc5('0x42')]){_0x14b64b[_0x4dc5('0x43')]=[{'all':!![]}];}return db[_0x4dc5('0x2b')]['findAll'](_0x14b64b);})['then'](function(_0x25e31f){_0x2d0342[_0x4dc5('0x44')]=_0x25e31f;return _0x2d0342;})[_0x4dc5('0x26')](respondWithFilteredResult(_0x16ab51,_0x14b64b))[_0x4dc5('0x45')](handleError(_0x16ab51,null));};exports[_0x4dc5('0x46')]=function(_0x59a648,_0x48898d){var _0xcdd841={'raw':!![],'where':{'id':_0x59a648[_0x4dc5('0x47')]['id']}},_0x320815={};_0x320815[_0x4dc5('0x2e')]=_['keys'](db[_0x4dc5('0x2b')][_0x4dc5('0x48')]);_0x320815[_0x4dc5('0x31')]=_['keys'](_0x59a648['query']);_0x320815[_0x4dc5('0x33')]=_['intersection'](_0x320815['model'],_0x320815[_0x4dc5('0x31')]);_0xcdd841['attributes']=_[_0x4dc5('0x35')](_0x320815[_0x4dc5('0x2e')],qs['fields'](_0x59a648[_0x4dc5('0x31')]['fields']));_0xcdd841['attributes']=_0xcdd841['attributes'][_0x4dc5('0x37')]?_0xcdd841[_0x4dc5('0x34')]:_0x320815['model'];if(_0x59a648[_0x4dc5('0x31')]['includeAll']){_0xcdd841['include']=[{'all':!![]}];}_0xcdd841=_[_0x4dc5('0x3f')]({},_0xcdd841,_0x59a648[_0x4dc5('0x41')]);return db[_0x4dc5('0x2b')][_0x4dc5('0x49')](_0xcdd841)['then'](handleEntityNotFound(_0x48898d,null))[_0x4dc5('0x26')](respondWithResult(_0x48898d,null))[_0x4dc5('0x45')](handleError(_0x48898d,null));};exports[_0x4dc5('0x4a')]=function(_0x639e03,_0x5e7c21){return db[_0x4dc5('0x2b')][_0x4dc5('0x4a')](_0x639e03['body'],{})['then'](respondWithResult(_0x5e7c21,0xc9))[_0x4dc5('0x45')](handleError(_0x5e7c21,null));};exports[_0x4dc5('0x25')]=function(_0x3655b8,_0x5d0fbd){if(_0x3655b8['body']['id']){delete _0x3655b8[_0x4dc5('0x4b')]['id'];}return db[_0x4dc5('0x2b')][_0x4dc5('0x49')]({'where':{'id':_0x3655b8['params']['id']}})[_0x4dc5('0x26')](handleEntityNotFound(_0x5d0fbd,null))[_0x4dc5('0x26')](saveUpdates(_0x3655b8[_0x4dc5('0x4b')],null))['then'](respondWithResult(_0x5d0fbd,null))[_0x4dc5('0x45')](handleError(_0x5d0fbd,null));};exports[_0x4dc5('0x27')]=function(_0x24d3b5,_0x305099){return db[_0x4dc5('0x2b')][_0x4dc5('0x49')]({'where':{'id':_0x24d3b5['params']['id']}})[_0x4dc5('0x26')](handleEntityNotFound(_0x305099,null))[_0x4dc5('0x26')](removeEntity(_0x305099,null))[_0x4dc5('0x45')](handleError(_0x305099,null));};exports['describe']=function(_0x4516dc,_0x6752b0){return db['ChatInternalMessage'][_0x4dc5('0x4c')]()[_0x4dc5('0x26')](respondWithResult(_0x6752b0,null))[_0x4dc5('0x45')](handleError(_0x6752b0,null));};function wrapUser(_0x49c506){return function(_0x38a949){var _0x4b27a3=_0x49c506['get']({'plain':!![]});_0x4b27a3['messages']=[];if(_0x38a949){_0x4b27a3['lastMessageAt']=_0x38a949[_0x4dc5('0x4d')];_0x4b27a3['lastMessage']=_0x38a949;}else{_0x4b27a3[_0x4dc5('0x4e')]=moment(0x0)[_0x4dc5('0x4f')](_0x4dc5('0x50'));_0x4b27a3[_0x4dc5('0x51')]={};}return _0x4b27a3;};}exports[_0x4dc5('0x52')]=function(_0xe2aa61,_0x343608,_0x2ab69b){var _0x25e189=[];return db[_0x4dc5('0x53')]['findAll']({'where':{'role':[_0x4dc5('0x54'),_0x4dc5('0x55'),_0x4dc5('0x56')]},'attributes':['id',_0x4dc5('0x57'),'name','role',_0x4dc5('0x58'),_0x4dc5('0x59'),_0x4dc5('0x5a'),'lastLoginAt',_0x4dc5('0x5b'),_0x4dc5('0x5c')],'order':qs[_0x4dc5('0x3b')](_0x4dc5('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x4dc5('0x5e'),'attributes':['id','name',_0x4dc5('0x2c')],'through':{'attributes':[]}}]})[_0x4dc5('0x26')](function(_0xa9c25b){if(_0xa9c25b){var _0x293492=_0xe2aa61[_0x4dc5('0x56')][_0x4dc5('0x5f')]({'plain':!![]});if(!_0x293492)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293492[_0x4dc5('0x60')]===_0x4dc5('0x56')){return db[_0x4dc5('0x61')]['find']({'where':{'name':_0x4dc5('0x62'),'userProfileId':_0x293492[_0x4dc5('0x63')]},'raw':!![]})[_0x4dc5('0x26')](function(_0x350e75){if(_0x350e75){if(_0x350e75[_0x4dc5('0x64')]===0x0){return db[_0x4dc5('0x65')]['findAll']({'where':{'sectionId':_0x350e75['id']},'raw':!![]})[_0x4dc5('0x26')](function(_0x30384c){var _0x5c2247=[];if(_[_0x4dc5('0x66')](_0x30384c)){_0x5c2247=_[_0x4dc5('0x3d')](_0xa9c25b,function(_0x276380){if(_0x276380[_0x4dc5('0x60')]!==_0x4dc5('0x54')){return _0x276380;}});return _0x5c2247;}else{for(var _0x4ff4c3=0x0;_0x4ff4c3<_0xa9c25b[_0x4dc5('0x37')];_0x4ff4c3++){var _0x4b0fc2=_0xa9c25b[_0x4ff4c3];if(_0x4b0fc2[_0x4dc5('0x60')]==='agent'){var _0x3a09ac=_[_0x4dc5('0x49')](_0x30384c,function(_0x534055){return _0x534055['resourceId']===_0x4b0fc2['id'];});if(_0x3a09ac)_0x5c2247[_0x4dc5('0x67')](_0x4b0fc2);}else{_0x5c2247['push'](_0x4b0fc2);}}return _0x5c2247;}});}else{return _0xa9c25b;}}else{var _0x414a6b=_['filter'](_0xa9c25b,function(_0x4545b1){if(_0x4545b1['role']!==_0x4dc5('0x54')){return _0x4545b1;}});return _0x414a6b;}});}else{return _0xa9c25b;}}})[_0x4dc5('0x26')](function(_0x49c300){var _0x27a247=[];if(_0x49c300){_0x25e189=_0x49c300;for(var _0x43c341=0x0;_0x43c341<_0x49c300[_0x4dc5('0x37')];_0x43c341+=0x1){_0x25e189[_0x43c341][_0x4dc5('0x68')]=[];_0x27a247[_0x4dc5('0x67')](db[_0x4dc5('0x2b')][_0x4dc5('0x49')]({'where':{'FromId':[_0xe2aa61['user']['id'],_0x49c300[_0x43c341]['id']],'ToId':[_0xe2aa61[_0x4dc5('0x56')]['id'],_0x49c300[_0x43c341]['id']],'ChatGroupId':null},'attributes':['id',_0x4dc5('0x4d'),'FromId','ToId',_0x4dc5('0x69'),_0x4dc5('0x4b')],'order':qs[_0x4dc5('0x3b')](_0x4dc5('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4dc5('0x26')](wrapUser(_0x49c300[_0x43c341])));}return BPromise[_0x4dc5('0x6b')](_0x27a247);}return[];})[_0x4dc5('0x26')](function(_0x43df19){return{'rows':_0x43df19,'count':_0x43df19[_0x4dc5('0x37')]};})[_0x4dc5('0x26')](respondWithResult(_0x343608,null))[_0x4dc5('0x45')](handleError(_0x343608,null));}; \ No newline at end of file +var _0x7300=['admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','findAll','push','read','-createdAt','all','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ChatInternalMessage','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent'];(function(_0x489d5f,_0x1fe5a9){var _0x128c2d=function(_0x4eea00){while(--_0x4eea00){_0x489d5f['push'](_0x489d5f['shift']());}};_0x128c2d(++_0x1fe5a9);}(_0x7300,0x1dd));var _0x0730=function(_0x4349e2,_0x37b263){_0x4349e2=_0x4349e2-0x0;var _0x409354=_0x7300[_0x4349e2];return _0x409354;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0730('0x0'));var zipdir=require(_0x0730('0x1'));var jsonpatch=require(_0x0730('0x2'));var rp=require(_0x0730('0x3'));var moment=require(_0x0730('0x4'));var BPromise=require(_0x0730('0x5'));var Mustache=require(_0x0730('0x6'));var util=require(_0x0730('0x7'));var path=require(_0x0730('0x8'));var sox=require(_0x0730('0x9'));var csv=require(_0x0730('0xa'));var ejs=require(_0x0730('0xb'));var fs=require('fs');var fs_extra=require(_0x0730('0xc'));var _=require(_0x0730('0xd'));var squel=require('squel');var crypto=require(_0x0730('0xe'));var jsforce=require(_0x0730('0xf'));var deskjs=require(_0x0730('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0730('0x11'));var Papa=require(_0x0730('0x12'));var Redis=require(_0x0730('0x13'));var authService=require(_0x0730('0x14'));var qs=require(_0x0730('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0730('0x16'));var logger=require(_0x0730('0x17'))(_0x0730('0x18'));var utils=require(_0x0730('0x19'));var config=require(_0x0730('0x1a'));var licenseUtil=require(_0x0730('0x1b'));var db=require(_0x0730('0x1c'))['db'];config[_0x0730('0x1d')]=_[_0x0730('0x1e')](config['redis'],{'host':_0x0730('0x1f'),'port':0x18eb});var socket=require(_0x0730('0x20'))(new Redis(config[_0x0730('0x1d')]));require(_0x0730('0x21'))[_0x0730('0x22')](socket);function respondWithStatusCode(_0x12b7a3,_0x27c4bd){_0x27c4bd=_0x27c4bd||0xcc;return function(_0x32dc29){if(_0x32dc29){return _0x12b7a3[_0x0730('0x23')](_0x27c4bd);}return _0x12b7a3['status'](_0x27c4bd)['end']();};}function respondWithResult(_0x3600e0,_0x3a53e8){_0x3a53e8=_0x3a53e8||0xc8;return function(_0x257d67){if(_0x257d67){return _0x3600e0[_0x0730('0x24')](_0x3a53e8)['json'](_0x257d67);}};}function respondWithFilteredResult(_0x1c048d,_0x5f4608){return function(_0x377294){if(_0x377294){var _0x4f0c29=typeof _0x5f4608[_0x0730('0x25')]===_0x0730('0x26')&&typeof _0x5f4608['limit']==='undefined';var _0x240d2a=_0x377294[_0x0730('0x27')];var _0x39cfb7=_0x4f0c29?0x0:_0x5f4608[_0x0730('0x25')];var _0x57e32b=_0x4f0c29?_0x377294[_0x0730('0x27')]:_0x5f4608[_0x0730('0x25')]+_0x5f4608[_0x0730('0x28')];var _0x3ce13e;if(_0x57e32b>=_0x240d2a){_0x57e32b=_0x240d2a;_0x3ce13e=0xc8;}else{_0x3ce13e=0xce;}_0x1c048d[_0x0730('0x24')](_0x3ce13e);return _0x1c048d[_0x0730('0x29')](_0x0730('0x2a'),_0x39cfb7+'-'+_0x57e32b+'/'+_0x240d2a)[_0x0730('0x2b')](_0x377294);}return null;};}function patchUpdates(_0x153b37){return function(_0x1491b2){try{jsonpatch['apply'](_0x1491b2,_0x153b37,!![]);}catch(_0xba7f34){return BPromise['reject'](_0xba7f34);}return _0x1491b2[_0x0730('0x2c')]();};}function saveUpdates(_0x27a07b,_0x4be4f1){return function(_0x2e7ca5){if(_0x2e7ca5){return _0x2e7ca5[_0x0730('0x2d')](_0x27a07b)[_0x0730('0x2e')](function(_0x1eaa5b){return _0x1eaa5b;});}return null;};}function removeEntity(_0x60a6d8,_0x542ab1){return function(_0x48c534){if(_0x48c534){return _0x48c534[_0x0730('0x2f')]()[_0x0730('0x2e')](function(){_0x60a6d8[_0x0730('0x24')](0xcc)[_0x0730('0x30')]();});}};}function handleEntityNotFound(_0x1a6444,_0x442e9f){return function(_0x55c107){if(!_0x55c107){_0x1a6444[_0x0730('0x23')](0x194);}return _0x55c107;};}function handleError(_0x28cf13,_0x5d9bb9){_0x5d9bb9=_0x5d9bb9||0x1f4;return function(_0x4aa287){logger[_0x0730('0x31')](_0x4aa287[_0x0730('0x32')]);if(_0x4aa287[_0x0730('0x33')]){delete _0x4aa287[_0x0730('0x33')];}_0x28cf13['status'](_0x5d9bb9)['send'](_0x4aa287);};}exports[_0x0730('0x34')]=function(_0x1f6d15,_0x401be8){var _0x3407ed={},_0x4b14a4={},_0x8f9831={'count':0x0,'rows':[]};var _0x235bc7=_[_0x0730('0x35')](db['ChatInternalMessage'][_0x0730('0x36')],function(_0x7a534f){return{'name':_0x7a534f[_0x0730('0x37')],'type':_0x7a534f[_0x0730('0x38')][_0x0730('0x39')]};});_0x4b14a4[_0x0730('0x3a')]=_[_0x0730('0x35')](_0x235bc7,_0x0730('0x33'));_0x4b14a4[_0x0730('0x3b')]=_[_0x0730('0x3c')](_0x1f6d15[_0x0730('0x3b')]);_0x4b14a4[_0x0730('0x3d')]=_['intersection'](_0x4b14a4[_0x0730('0x3a')],_0x4b14a4['query']);_0x3407ed[_0x0730('0x3e')]=_['intersection'](_0x4b14a4[_0x0730('0x3a')],qs[_0x0730('0x3f')](_0x1f6d15[_0x0730('0x3b')][_0x0730('0x3f')]));_0x3407ed[_0x0730('0x3e')]=_0x3407ed[_0x0730('0x3e')]['length']?_0x3407ed[_0x0730('0x3e')]:_0x4b14a4[_0x0730('0x3a')];if(!_0x1f6d15[_0x0730('0x3b')][_0x0730('0x40')](_0x0730('0x41'))){_0x3407ed['limit']=qs[_0x0730('0x28')](_0x1f6d15[_0x0730('0x3b')]['limit']);_0x3407ed['offset']=qs[_0x0730('0x25')](_0x1f6d15['query'][_0x0730('0x25')]);}_0x3407ed[_0x0730('0x42')]=qs[_0x0730('0x43')](_0x1f6d15[_0x0730('0x3b')][_0x0730('0x43')]);_0x3407ed[_0x0730('0x44')]=qs[_0x0730('0x3d')](_['pick'](_0x1f6d15[_0x0730('0x3b')],_0x4b14a4[_0x0730('0x3d')]),_0x235bc7);if(_0x1f6d15['query'][_0x0730('0x45')]){_0x3407ed['where']=_[_0x0730('0x46')](_0x3407ed[_0x0730('0x44')],{'$or':_[_0x0730('0x35')](_0x235bc7,function(_0x15d560){if(_0x15d560[_0x0730('0x38')]!=='VIRTUAL'){var _0x4bc6b1={};_0x4bc6b1[_0x15d560[_0x0730('0x33')]]={'$like':'%'+_0x1f6d15[_0x0730('0x3b')][_0x0730('0x45')]+'%'};return _0x4bc6b1;}})});}_0x3407ed=_[_0x0730('0x46')]({},_0x3407ed,_0x1f6d15[_0x0730('0x47')]);var _0x480f49={'where':_0x3407ed['where']};return db[_0x0730('0x48')][_0x0730('0x27')](_0x480f49)[_0x0730('0x2e')](function(_0x4d5b00){_0x8f9831[_0x0730('0x27')]=_0x4d5b00;if(_0x1f6d15[_0x0730('0x3b')][_0x0730('0x49')]){_0x3407ed[_0x0730('0x4a')]=[{'all':!![]}];}return db[_0x0730('0x48')]['findAll'](_0x3407ed);})[_0x0730('0x2e')](function(_0x142b8d){_0x8f9831[_0x0730('0x4b')]=_0x142b8d;return _0x8f9831;})[_0x0730('0x2e')](respondWithFilteredResult(_0x401be8,_0x3407ed))[_0x0730('0x4c')](handleError(_0x401be8,null));};exports[_0x0730('0x4d')]=function(_0x22b9bb,_0x111a25){var _0xd823dd={'raw':!![],'where':{'id':_0x22b9bb[_0x0730('0x4e')]['id']}},_0x1ca8a2={};_0x1ca8a2[_0x0730('0x3a')]=_[_0x0730('0x3c')](db[_0x0730('0x48')][_0x0730('0x36')]);_0x1ca8a2['query']=_[_0x0730('0x3c')](_0x22b9bb['query']);_0x1ca8a2[_0x0730('0x3d')]=_[_0x0730('0x4f')](_0x1ca8a2['model'],_0x1ca8a2[_0x0730('0x3b')]);_0xd823dd[_0x0730('0x3e')]=_[_0x0730('0x4f')](_0x1ca8a2[_0x0730('0x3a')],qs['fields'](_0x22b9bb[_0x0730('0x3b')][_0x0730('0x3f')]));_0xd823dd[_0x0730('0x3e')]=_0xd823dd[_0x0730('0x3e')][_0x0730('0x50')]?_0xd823dd[_0x0730('0x3e')]:_0x1ca8a2[_0x0730('0x3a')];if(_0x22b9bb['query'][_0x0730('0x49')]){_0xd823dd[_0x0730('0x4a')]=[{'all':!![]}];}_0xd823dd=_[_0x0730('0x46')]({},_0xd823dd,_0x22b9bb[_0x0730('0x47')]);return db['ChatInternalMessage'][_0x0730('0x51')](_0xd823dd)['then'](handleEntityNotFound(_0x111a25,null))['then'](respondWithResult(_0x111a25,null))[_0x0730('0x4c')](handleError(_0x111a25,null));};exports['create']=function(_0x97998e,_0x2d30c4){return db[_0x0730('0x48')][_0x0730('0x52')](_0x97998e[_0x0730('0x53')],{})[_0x0730('0x2e')](respondWithResult(_0x2d30c4,0xc9))[_0x0730('0x4c')](handleError(_0x2d30c4,null));};exports['update']=function(_0x5de313,_0x508e29){if(_0x5de313[_0x0730('0x53')]['id']){delete _0x5de313[_0x0730('0x53')]['id'];}return db[_0x0730('0x48')]['find']({'where':{'id':_0x5de313['params']['id']}})[_0x0730('0x2e')](handleEntityNotFound(_0x508e29,null))[_0x0730('0x2e')](saveUpdates(_0x5de313[_0x0730('0x53')],null))[_0x0730('0x2e')](respondWithResult(_0x508e29,null))['catch'](handleError(_0x508e29,null));};exports[_0x0730('0x2f')]=function(_0x5e87f0,_0x37c2db){return db['ChatInternalMessage']['find']({'where':{'id':_0x5e87f0[_0x0730('0x4e')]['id']}})[_0x0730('0x2e')](handleEntityNotFound(_0x37c2db,null))[_0x0730('0x2e')](removeEntity(_0x37c2db,null))['catch'](handleError(_0x37c2db,null));};exports[_0x0730('0x54')]=function(_0x3aeb10,_0x5577dc){return db[_0x0730('0x48')][_0x0730('0x54')]()['then'](respondWithResult(_0x5577dc,null))[_0x0730('0x4c')](handleError(_0x5577dc,null));};function wrapUser(_0x3582d2){return function(_0x409f2f){var _0x24887e=_0x3582d2['get']({'plain':!![]});_0x24887e[_0x0730('0x55')]=[];if(_0x409f2f){_0x24887e[_0x0730('0x56')]=_0x409f2f[_0x0730('0x57')];_0x24887e[_0x0730('0x58')]=_0x409f2f;}else{_0x24887e[_0x0730('0x56')]=moment(0x0)[_0x0730('0x59')](_0x0730('0x5a'));_0x24887e['lastMessage']={};}return _0x24887e;};}exports['getUsers']=function(_0x4b77ad,_0x20d58c,_0x4ab07c){var _0x905f9d=[];return db[_0x0730('0x5b')]['findAll']({'where':{'role':[_0x0730('0x5c'),_0x0730('0x5d'),_0x0730('0x5e')]},'attributes':['id',_0x0730('0x5f'),_0x0730('0x33'),_0x0730('0x60'),_0x0730('0x61'),'internal','online',_0x0730('0x62'),_0x0730('0x63'),_0x0730('0x64')],'order':qs['sort'](_0x0730('0x65')),'include':[{'model':db[_0x0730('0x66')],'as':'VoiceQueues','attributes':['id',_0x0730('0x33'),'type'],'through':{'attributes':[]}}]})[_0x0730('0x2e')](function(_0x989bfb){if(_0x989bfb){var _0x534e7e=_0x4b77ad['user'][_0x0730('0x67')]({'plain':!![]});if(!_0x534e7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x534e7e[_0x0730('0x60')]===_0x0730('0x5e')){return db[_0x0730('0x68')][_0x0730('0x51')]({'where':{'name':_0x0730('0x69'),'userProfileId':_0x534e7e[_0x0730('0x6a')]},'raw':!![]})[_0x0730('0x2e')](function(_0x4cf0c0){if(_0x4cf0c0){if(_0x4cf0c0[_0x0730('0x6b')]===0x0){return db[_0x0730('0x6c')][_0x0730('0x6d')]({'where':{'sectionId':_0x4cf0c0['id']},'raw':!![]})['then'](function(_0x343555){var _0x4d9b19=[];if(_['isEmpty'](_0x343555)){_0x4d9b19=_[_0x0730('0x45')](_0x989bfb,function(_0x170cc2){if(_0x170cc2['role']!==_0x0730('0x5c')){return _0x170cc2;}});return _0x4d9b19;}else{for(var _0x5b77fe=0x0;_0x5b77fe<_0x989bfb[_0x0730('0x50')];_0x5b77fe++){var _0x1c0d77=_0x989bfb[_0x5b77fe];if(_0x1c0d77[_0x0730('0x60')]===_0x0730('0x5c')){var _0x298c1f=_['find'](_0x343555,function(_0x222d34){return _0x222d34['resourceId']===_0x1c0d77['id'];});if(_0x298c1f)_0x4d9b19[_0x0730('0x6e')](_0x1c0d77);}else{_0x4d9b19['push'](_0x1c0d77);}}return _0x4d9b19;}});}else{return _0x989bfb;}}else{var _0x1f1809=_['filter'](_0x989bfb,function(_0x482aee){if(_0x482aee[_0x0730('0x60')]!==_0x0730('0x5c')){return _0x482aee;}});return _0x1f1809;}});}else{return _0x989bfb;}}})[_0x0730('0x2e')](function(_0x5c7cd8){var _0x1d1c73=[];if(_0x5c7cd8){_0x905f9d=_0x5c7cd8;for(var _0x1beb5a=0x0;_0x1beb5a<_0x5c7cd8[_0x0730('0x50')];_0x1beb5a+=0x1){_0x905f9d[_0x1beb5a]['messages']=[];_0x1d1c73['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x4b77ad[_0x0730('0x5e')]['id'],_0x5c7cd8[_0x1beb5a]['id']],'ToId':[_0x4b77ad[_0x0730('0x5e')]['id'],_0x5c7cd8[_0x1beb5a]['id']],'ChatGroupId':null},'attributes':['id',_0x0730('0x57'),'FromId','ToId',_0x0730('0x6f'),_0x0730('0x53')],'order':qs[_0x0730('0x43')](_0x0730('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0730('0x2e')](wrapUser(_0x5c7cd8[_0x1beb5a])));}return BPromise[_0x0730('0x71')](_0x1d1c73);}return[];})[_0x0730('0x2e')](function(_0x5b4a7b){return{'rows':_0x5b4a7b,'count':_0x5b4a7b[_0x0730('0x50')]};})[_0x0730('0x2e')](respondWithResult(_0x20d58c,null))[_0x0730('0x4c')](handleError(_0x20d58c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a8328f7..1f3f0e0 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 _0xa71d=['events','../../mysqldb','save','update','remove','emit','exports'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0xa71d,0xbd));var _0xda71=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xa71d[_0x1b7368];return _0x25d54c;};'use strict';var EventEmitter=require(_0xda71('0x0'));var ChatInternalMessage=require(_0xda71('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda71('0x2'),'afterUpdate':_0xda71('0x3'),'afterDestroy':_0xda71('0x4')};function emitEvent(_0xf8db67){return function(_0x2e7648,_0x2fd854,_0x1fdea2){ChatInternalMessageEvents[_0xda71('0x5')](_0xf8db67+':'+_0x2e7648['id'],_0x2e7648);ChatInternalMessageEvents['emit'](_0xf8db67,_0x2e7648);_0x1fdea2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xda71('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xfa6b=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xfa6b,0x91));var _0xbfa6=function(_0x1536e0,_0x43938b){_0x1536e0=_0x1536e0-0x0;var _0x399072=_0xfa6b[_0x1536e0];return _0x399072;};'use strict';var EventEmitter=require(_0xbfa6('0x0'));var ChatInternalMessage=require(_0xbfa6('0x1'))['db'][_0xbfa6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbfa6('0x3')](0x0);var events={'afterCreate':_0xbfa6('0x4'),'afterUpdate':_0xbfa6('0x5'),'afterDestroy':_0xbfa6('0x6')};function emitEvent(_0x371e1a){return function(_0x255e92,_0x444d12,_0x2c6857){ChatInternalMessageEvents[_0xbfa6('0x7')](_0x371e1a+':'+_0x255e92['id'],_0x255e92);ChatInternalMessageEvents[_0xbfa6('0x7')](_0x371e1a,_0x255e92);_0x2c6857(null);};}for(var e in events){if(events[_0xbfa6('0x8')](e)){var event=events[e];ChatInternalMessage[_0xbfa6('0x9')](e,emitEvent(event));}}module[_0xbfa6('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c904f18..1da7190 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 _0x6e64=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x3a7d31,_0x2264a5){var _0x28065f=function(_0x48c61b){while(--_0x48c61b){_0x3a7d31['push'](_0x3a7d31['shift']());}};_0x28065f(++_0x2264a5);}(_0x6e64,0x10e));var _0x46e6=function(_0x1a2349,_0x1861ae){_0x1a2349=_0x1a2349-0x0;var _0x1d9273=_0x6e64[_0x1a2349];return _0x1d9273;};'use strict';var _=require(_0x46e6('0x0'));var util=require('util');var logger=require(_0x46e6('0x1'))(_0x46e6('0x2'));var moment=require('moment');var BPromise=require(_0x46e6('0x3'));var rp=require(_0x46e6('0x4'));var fs=require('fs');var path=require(_0x46e6('0x5'));var rimraf=require(_0x46e6('0x6'));var config=require(_0x46e6('0x7'));var attributes=require(_0x46e6('0x8'));module[_0x46e6('0x9')]=function(_0x2747db,_0x221cdd){return _0x2747db[_0x46e6('0xa')](_0x46e6('0xb'),attributes,{'tableName':_0x46e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x46e6('0xd')});}; \ No newline at end of file +var _0xa5bc=['bluebird','request-promise','path','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x39ff0c,_0x2069c7){var _0x5c4ca6=function(_0xa4ffba){while(--_0xa4ffba){_0x39ff0c['push'](_0x39ff0c['shift']());}};_0x5c4ca6(++_0x2069c7);}(_0xa5bc,0x64));var _0xca5b=function(_0x53c6c8,_0x585334){_0x53c6c8=_0x53c6c8-0x0;var _0x2638b6=_0xa5bc[_0x53c6c8];return _0x2638b6;};'use strict';var _=require(_0xca5b('0x0'));var util=require(_0xca5b('0x1'));var logger=require(_0xca5b('0x2'))(_0xca5b('0x3'));var moment=require(_0xca5b('0x4'));var BPromise=require(_0xca5b('0x5'));var rp=require(_0xca5b('0x6'));var fs=require('fs');var path=require(_0xca5b('0x7'));var rimraf=require('rimraf');var config=require(_0xca5b('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xca5b('0x9')]=function(_0x3f1c17,_0x5ad9ad){return _0x3f1c17[_0xca5b('0xa')](_0xca5b('0xb'),attributes,{'tableName':_0xca5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca5b('0xd'),'collate':_0xca5b('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index cc40c97..ba34600 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 _0xd9fe=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x34bb5c,_0x1264d5){var _0x34f238=function(_0x2f71d3){while(--_0x2f71d3){_0x34bb5c['push'](_0x34bb5c['shift']());}};_0x34f238(++_0x1264d5);}(_0xd9fe,0x1a0));var _0xed9f=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd9fe[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xed9f('0x0'));var util=require(_0xed9f('0x1'));var moment=require(_0xed9f('0x2'));var BPromise=require(_0xed9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed9f('0x4'));var db=require(_0xed9f('0x5'))['db'];var utils=require(_0xed9f('0x6'));var logger=require('../../config/logger')(_0xed9f('0x7'));var config=require(_0xed9f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed9f('0x9')]({'port':0x232a});config[_0xed9f('0xa')]=_[_0xed9f('0xb')](config[_0xed9f('0xa')],{'host':_0xed9f('0xc'),'port':0x18eb});var socket=require(_0xed9f('0xd'))(new Redis(config[_0xed9f('0xa')]));require(_0xed9f('0xe'))['register'](socket);function respondWithRpcPromise(_0x43584f,_0x31c012,_0xf49677){return new BPromise(function(_0x14ca84,_0x2200f3){return client[_0xed9f('0xf')](_0x43584f,_0xf49677)[_0xed9f('0x10')](function(_0x461d1e){logger['info'](_0xed9f('0x11'),_0x31c012,'request\x20sent');logger[_0xed9f('0x12')](_0xed9f('0x13'),_0x31c012,_0xed9f('0x14'),JSON[_0xed9f('0x15')](_0x461d1e));if(_0x461d1e[_0xed9f('0x16')]){if(_0x461d1e['error']['code']===0x1f4){logger[_0xed9f('0x16')](_0xed9f('0x11'),_0x31c012,_0x461d1e[_0xed9f('0x16')][_0xed9f('0x17')]);return _0x2200f3(_0x461d1e[_0xed9f('0x16')][_0xed9f('0x17')]);}logger[_0xed9f('0x16')](_0xed9f('0x11'),_0x31c012,_0x461d1e['error'][_0xed9f('0x17')]);return _0x14ca84(_0x461d1e['error'][_0xed9f('0x17')]);}else{logger[_0xed9f('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x31c012,'request\x20sent');_0x14ca84(_0x461d1e[_0xed9f('0x19')]['message']);}})['catch'](function(_0xd6f9b0){logger[_0xed9f('0x16')](_0xed9f('0x11'),_0x31c012,_0xd6f9b0);_0x2200f3(_0xd6f9b0);});});} \ No newline at end of file +var _0xbc1c=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','request\x20sent','debug','stringify','code','ChatInternalMessage,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x94edda,_0x55140d){var _0x216b09=function(_0xc03813){while(--_0xc03813){_0x94edda['push'](_0x94edda['shift']());}};_0x216b09(++_0x55140d);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0xbc1c[_0x45c981];return _0x4f62c8;};'use strict';var _=require('lodash');var util=require(_0xcbc1('0x0'));var moment=require('moment');var BPromise=require(_0xcbc1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbc1('0x2'));var db=require(_0xcbc1('0x3'))['db'];var utils=require(_0xcbc1('0x4'));var logger=require(_0xcbc1('0x5'))('rpc');var config=require(_0xcbc1('0x6'));var jayson=require(_0xcbc1('0x7'));var client=jayson[_0xcbc1('0x8')][_0xcbc1('0x9')]({'port':0x232a});config[_0xcbc1('0xa')]=_[_0xcbc1('0xb')](config['redis'],{'host':_0xcbc1('0xc'),'port':0x18eb});var socket=require(_0xcbc1('0xd'))(new Redis(config[_0xcbc1('0xa')]));require(_0xcbc1('0xe'))[_0xcbc1('0xf')](socket);function respondWithRpcPromise(_0x1491a4,_0x563124,_0x413820){return new BPromise(function(_0x4addfb,_0x3c051e){return client[_0xcbc1('0x10')](_0x1491a4,_0x413820)['then'](function(_0x48d068){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x563124,_0xcbc1('0x11'));logger[_0xcbc1('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x563124,_0xcbc1('0x11'),JSON[_0xcbc1('0x13')](_0x48d068));if(_0x48d068['error']){if(_0x48d068['error'][_0xcbc1('0x14')]===0x1f4){logger['error'](_0xcbc1('0x15'),_0x563124,_0x48d068[_0xcbc1('0x16')][_0xcbc1('0x17')]);return _0x3c051e(_0x48d068[_0xcbc1('0x16')][_0xcbc1('0x17')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x563124,_0x48d068['error'][_0xcbc1('0x17')]);return _0x4addfb(_0x48d068[_0xcbc1('0x16')][_0xcbc1('0x17')]);}else{logger[_0xcbc1('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x563124,_0xcbc1('0x11'));_0x4addfb(_0x48d068[_0xcbc1('0x19')][_0xcbc1('0x17')]);}})[_0xcbc1('0x1a')](function(_0x268fac){logger[_0xcbc1('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x563124,_0x268fac);_0x3c051e(_0x268fac);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 35c8b9d..a8f9978 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 _0xbda1=['./chatInternalMessage.events','save','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0xbda1,0x80));var _0x1bda=function(_0x146c6f,_0x5d4aa1){_0x146c6f=_0x146c6f-0x0;var _0x33fa1d=_0xbda1[_0x146c6f];return _0x33fa1d;};'use strict';var ChatInternalMessageEvents=require(_0x1bda('0x0'));var events=[_0x1bda('0x1'),_0x1bda('0x2'),_0x1bda('0x3')];function createListener(_0x474020,_0x5be2ae){return function(_0x372af8){_0x5be2ae[_0x1bda('0x4')](_0x474020,_0x372af8);};}function removeListener(_0x1bc0a9,_0x5ecaee){return function(){ChatInternalMessageEvents['removeListener'](_0x1bc0a9,_0x5ecaee);};}exports[_0x1bda('0x5')]=function(_0x1f35e9){for(var _0x2e06b7=0x0,_0x15dad2=events[_0x1bda('0x6')];_0x2e06b7<_0x15dad2;_0x2e06b7++){var _0x50c2e9=events[_0x2e06b7];var _0x5326e9=createListener(_0x1bda('0x7')+_0x50c2e9,_0x1f35e9);ChatInternalMessageEvents['on'](_0x50c2e9,_0x5326e9);}}; \ No newline at end of file +var _0x3bcb=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3bcb,0x74));var _0xb3bc=function(_0x508acd,_0x852c77){_0x508acd=_0x508acd-0x0;var _0x4e8524=_0x3bcb[_0x508acd];return _0x4e8524;};'use strict';var ChatInternalMessageEvents=require(_0xb3bc('0x0'));var events=[_0xb3bc('0x1'),_0xb3bc('0x2'),'update'];function createListener(_0x3933ec,_0x39ed39){return function(_0x562776){_0x39ed39[_0xb3bc('0x3')](_0x3933ec,_0x562776);};}function removeListener(_0xccd143,_0xea643){return function(){ChatInternalMessageEvents[_0xb3bc('0x4')](_0xccd143,_0xea643);};}exports[_0xb3bc('0x5')]=function(_0x342df5){for(var _0x5b0721=0x0,_0x3e620c=events[_0xb3bc('0x6')];_0x5b0721<_0x3e620c;_0x5b0721++){var _0x89e34a=events[_0x5b0721];var _0x3df436=createListener(_0xb3bc('0x7')+_0x89e34a,_0x342df5);ChatInternalMessageEvents['on'](_0x89e34a,_0x3df436);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3ef2c85..150dfbb 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 _0xd8d0=['fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','/:id','post','create','put','delete','destroy','multer','path','express','Router'];(function(_0x356b04,_0xbd9cf3){var _0x38fc9c=function(_0x318704){while(--_0x318704){_0x356b04['push'](_0x356b04['shift']());}};_0x38fc9c(++_0xbd9cf3);}(_0xd8d0,0x1dc));var _0x0d8d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd8d0[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0x0d8d('0x0'));var util=require('util');var path=require(_0x0d8d('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d8d('0x2'));var router=express[_0x0d8d('0x3')]();var fs_extra=require(_0x0d8d('0x4'));var auth=require(_0x0d8d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0d8d('0x6'));var controller=require(_0x0d8d('0x7'));router['get']('/',auth[_0x0d8d('0x8')](),controller[_0x0d8d('0x9')]);router[_0x0d8d('0xa')](_0x0d8d('0xb'),auth[_0x0d8d('0x8')](),controller[_0x0d8d('0xc')]);router[_0x0d8d('0xa')](_0x0d8d('0xd'),auth[_0x0d8d('0x8')](),controller['getUsers']);router['get'](_0x0d8d('0xe'),auth[_0x0d8d('0x8')](),controller['show']);router[_0x0d8d('0xf')]('/',auth[_0x0d8d('0x8')](),controller[_0x0d8d('0x10')]);router[_0x0d8d('0x11')](_0x0d8d('0xe'),controller['update']);router[_0x0d8d('0x12')](_0x0d8d('0xe'),auth['isAuthenticated'](),controller[_0x0d8d('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa4db=['isAuthenticated','index','get','/describe','describe','/users','/:id','show','post','create','put','update','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller'];(function(_0x4a00ee,_0x598cbd){var _0x4d6d8f=function(_0x56e346){while(--_0x56e346){_0x4a00ee['push'](_0x4a00ee['shift']());}};_0x4d6d8f(++_0x598cbd);}(_0xa4db,0x139));var _0xba4d=function(_0x295104,_0x165bd8){_0x295104=_0x295104-0x0;var _0x1dee6b=_0xa4db[_0x295104];return _0x1dee6b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xba4d('0x0'));var express=require(_0xba4d('0x1'));var router=express[_0xba4d('0x2')]();var fs_extra=require(_0xba4d('0x3'));var auth=require(_0xba4d('0x4'));var interaction=require(_0xba4d('0x5'));var config=require('../../config/environment');var controller=require(_0xba4d('0x6'));router['get']('/',auth[_0xba4d('0x7')](),controller[_0xba4d('0x8')]);router[_0xba4d('0x9')](_0xba4d('0xa'),auth[_0xba4d('0x7')](),controller[_0xba4d('0xb')]);router[_0xba4d('0x9')](_0xba4d('0xc'),auth[_0xba4d('0x7')](),controller['getUsers']);router[_0xba4d('0x9')](_0xba4d('0xd'),auth[_0xba4d('0x7')](),controller[_0xba4d('0xe')]);router[_0xba4d('0xf')]('/',auth[_0xba4d('0x7')](),controller[_0xba4d('0x10')]);router[_0xba4d('0x11')](_0xba4d('0xd'),controller[_0xba4d('0x12')]);router[_0xba4d('0x13')](_0xba4d('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index ce71c44..8ae6c67 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 _0xe605=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x52938e,_0x43612b){var _0x3a81dd=function(_0x1c33d5){while(--_0x1c33d5){_0x52938e['push'](_0x52938e['shift']());}};_0x3a81dd(++_0x43612b);}(_0xe605,0x92));var _0x5e60=function(_0x399a84,_0xbaeadd){_0x399a84=_0x399a84-0x0;var _0x1a6611=_0xe605[_0x399a84];return _0x1a6611;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5e60('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e60('0x4')]('in',_0x5e60('0x5')),'defaultValue':_0x5e60('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5e60('0x6')]},'providerName':{'type':Sequelize[_0x5e60('0x7')]},'providerResponse':{'type':Sequelize[_0x5e60('0x8')]}}; \ No newline at end of file +var _0x065e=['ENUM','DATE','STRING','sequelize','BOOLEAN'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x065e,0x1a7));var _0xe065=function(_0x4ab98e,_0x1c9ce1){_0x4ab98e=_0x4ab98e-0x0;var _0x17945b=_0x065e[_0x4ab98e];return _0x17945b;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe065('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe065('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe065('0x3')]},'providerName':{'type':Sequelize[_0xe065('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7e8fc70..df28c53 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 _0x55e6=['register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','show','params','includeAll','include','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','Sequelize','contact','User','email','manual','SIP/%s','channel','motionChannel','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','fullname','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x1878f0,_0x4f033f){var _0x21e1a3=function(_0x1a718e){while(--_0x1a718e){_0x1878f0['push'](_0x1878f0['shift']());}};_0x21e1a3(++_0x4f033f);}(_0x55e6,0x175));var _0x655e=function(_0x5eb120,_0xb1668){_0x5eb120=_0x5eb120-0x0;var _0x440b62=_0x55e6[_0x5eb120];return _0x440b62;};'use strict';var emlformat=require(_0x655e('0x0'));var rimraf=require(_0x655e('0x1'));var zipdir=require(_0x655e('0x2'));var jsonpatch=require(_0x655e('0x3'));var rp=require(_0x655e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x655e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x655e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x655e('0x7'));var _=require('lodash');var squel=require(_0x655e('0x8'));var crypto=require(_0x655e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x655e('0xa'));var toCsv=require(_0x655e('0x6'));var querystring=require('querystring');var Papa=require(_0x655e('0xb'));var Redis=require(_0x655e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x655e('0xd'));var as=require(_0x655e('0xe'));var hardwareService=require(_0x655e('0xf'));var logger=require(_0x655e('0x10'))('api');var utils=require(_0x655e('0x11'));var config=require(_0x655e('0x12'));var licenseUtil=require(_0x655e('0x13'));var db=require(_0x655e('0x14'))['db'];config[_0x655e('0x15')]=_[_0x655e('0x16')](config['redis'],{'host':_0x655e('0x17'),'port':0x18eb});var socket=require(_0x655e('0x18'))(new Redis(config['redis']));require(_0x655e('0x19'))[_0x655e('0x1a')](socket);var jayson=require(_0x655e('0x1b'));var client=jayson[_0x655e('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x655e('0x1c')][_0x655e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3ca3c5,_0xb8bf24,_0x54705c,_0x12a21d){return new BPromise(function(_0x20cb62,_0x5eb8ed){var _0x136c71=_0x12a21d||client;return _0x136c71[_0x655e('0x1e')](_0x3ca3c5,_0x54705c)[_0x655e('0x1f')](function(_0x179b2e){logger[_0x655e('0x20')](_0x655e('0x21'),_0xb8bf24,_0x655e('0x22'));logger[_0x655e('0x23')](_0x655e('0x24'),_0xb8bf24,_0x655e('0x22'),JSON[_0x655e('0x25')](_0x179b2e));if(_0x179b2e[_0x655e('0x26')]){if(_0x179b2e['error'][_0x655e('0x27')]===0x1f4){logger[_0x655e('0x26')]('ChatMessage,\x20%s,\x20%s',_0xb8bf24,_0x179b2e[_0x655e('0x26')][_0x655e('0x28')]);return _0x5eb8ed(_0x179b2e[_0x655e('0x26')][_0x655e('0x28')]);}logger[_0x655e('0x26')](_0x655e('0x21'),_0xb8bf24,_0x179b2e[_0x655e('0x26')][_0x655e('0x28')]);return _0x20cb62(_0x179b2e['error'][_0x655e('0x28')]);}else{logger[_0x655e('0x20')]('ChatMessage,\x20%s,\x20%s',_0xb8bf24,'request\x20sent');_0x20cb62(_0x179b2e[_0x655e('0x29')][_0x655e('0x28')]);}})[_0x655e('0x2a')](function(_0xc4d1b4){logger[_0x655e('0x26')](_0x655e('0x21'),_0xb8bf24,_0xc4d1b4);_0x5eb8ed(_0xc4d1b4);});});}function respondWithStatusCode(_0x2d5ddd,_0x55a28a){_0x55a28a=_0x55a28a||0xcc;return function(_0x5b1030){if(_0x5b1030){return _0x2d5ddd[_0x655e('0x2b')](_0x55a28a);}return _0x2d5ddd[_0x655e('0x2c')](_0x55a28a)[_0x655e('0x2d')]();};}function respondWithResult(_0x2b2b11,_0x45959e){_0x45959e=_0x45959e||0xc8;return function(_0x229328){if(_0x229328){return _0x2b2b11[_0x655e('0x2c')](_0x45959e)[_0x655e('0x2e')](_0x229328);}};}function respondWithFilteredResult(_0x1373e7,_0xba1185){return function(_0x537519){if(_0x537519){var _0x19d135=typeof _0xba1185[_0x655e('0x2f')]===_0x655e('0x30')&&typeof _0xba1185['limit']===_0x655e('0x30');var _0x44b1c7=_0x537519[_0x655e('0x31')];var _0x18e984=_0x19d135?0x0:_0xba1185[_0x655e('0x2f')];var _0x1a0a68=_0x19d135?_0x537519[_0x655e('0x31')]:_0xba1185[_0x655e('0x2f')]+_0xba1185[_0x655e('0x32')];var _0x28ddc4;if(_0x1a0a68>=_0x44b1c7){_0x1a0a68=_0x44b1c7;_0x28ddc4=0xc8;}else{_0x28ddc4=0xce;}_0x1373e7[_0x655e('0x2c')](_0x28ddc4);return _0x1373e7[_0x655e('0x33')](_0x655e('0x34'),_0x18e984+'-'+_0x1a0a68+'/'+_0x44b1c7)[_0x655e('0x2e')](_0x537519);}return null;};}function patchUpdates(_0x39c570){return function(_0x2ca72e){try{jsonpatch[_0x655e('0x35')](_0x2ca72e,_0x39c570,!![]);}catch(_0x24aba2){return BPromise[_0x655e('0x36')](_0x24aba2);}return _0x2ca72e[_0x655e('0x37')]();};}function saveUpdates(_0x3ca602,_0xbb3d95){return function(_0x40073d){if(_0x40073d){return _0x40073d[_0x655e('0x38')](_0x3ca602)['then'](function(_0xb0f4e2){return _0xb0f4e2;});}return null;};}function removeEntity(_0x53b86e,_0x593641){return function(_0x584cc4){if(_0x584cc4){return _0x584cc4[_0x655e('0x39')]()[_0x655e('0x1f')](function(){_0x53b86e[_0x655e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ddaa,_0x1e125b){return function(_0x1eb59b){if(!_0x1eb59b){_0x19ddaa[_0x655e('0x2b')](0x194);}return _0x1eb59b;};}function handleError(_0x2258f3,_0x42ffb2){_0x42ffb2=_0x42ffb2||0x1f4;return function(_0x15d864){logger[_0x655e('0x26')](_0x15d864[_0x655e('0x3a')]);if(_0x15d864['name']){delete _0x15d864['name'];}_0x2258f3[_0x655e('0x2c')](_0x42ffb2)[_0x655e('0x3b')](_0x15d864);};}exports[_0x655e('0x3c')]=function(_0x3f9d0a,_0x16c2ff){var _0x17aac7={},_0x5a6bd8={},_0x4c3fc9={'count':0x0,'rows':[]};var _0x28f1ce=_[_0x655e('0x3d')](db[_0x655e('0x3e')][_0x655e('0x3f')],function(_0x30fcbf){return{'name':_0x30fcbf[_0x655e('0x40')],'type':_0x30fcbf[_0x655e('0x41')][_0x655e('0x42')]};});_0x5a6bd8['model']=_['map'](_0x28f1ce,_0x655e('0x43'));_0x5a6bd8[_0x655e('0x44')]=_[_0x655e('0x45')](_0x3f9d0a[_0x655e('0x44')]);_0x5a6bd8[_0x655e('0x46')]=_['intersection'](_0x5a6bd8['model'],_0x5a6bd8['query']);_0x17aac7[_0x655e('0x47')]=_[_0x655e('0x48')](_0x5a6bd8[_0x655e('0x49')],qs[_0x655e('0x4a')](_0x3f9d0a['query']['fields']));_0x17aac7[_0x655e('0x47')]=_0x17aac7[_0x655e('0x47')]['length']?_0x17aac7['attributes']:_0x5a6bd8[_0x655e('0x49')];if(!_0x3f9d0a[_0x655e('0x44')][_0x655e('0x4b')](_0x655e('0x4c'))){_0x17aac7[_0x655e('0x32')]=qs[_0x655e('0x32')](_0x3f9d0a['query'][_0x655e('0x32')]);_0x17aac7['offset']=qs[_0x655e('0x2f')](_0x3f9d0a[_0x655e('0x44')]['offset']);}_0x17aac7[_0x655e('0x4d')]=qs[_0x655e('0x4e')](_0x3f9d0a[_0x655e('0x44')][_0x655e('0x4e')]);_0x17aac7[_0x655e('0x4f')]=qs[_0x655e('0x46')](_[_0x655e('0x50')](_0x3f9d0a['query'],_0x5a6bd8['filters']),_0x28f1ce);if(_0x3f9d0a[_0x655e('0x44')][_0x655e('0x51')]){_0x17aac7[_0x655e('0x4f')]=_[_0x655e('0x52')](_0x17aac7['where'],{'$or':_[_0x655e('0x3d')](_0x28f1ce,function(_0x30e2fc){if(_0x30e2fc[_0x655e('0x41')]!=='VIRTUAL'){var _0x3b8702={};_0x3b8702[_0x30e2fc[_0x655e('0x43')]]={'$like':'%'+_0x3f9d0a[_0x655e('0x44')][_0x655e('0x51')]+'%'};return _0x3b8702;}})});}_0x17aac7=_[_0x655e('0x52')]({},_0x17aac7,_0x3f9d0a[_0x655e('0x53')]);var _0x291e8a={'where':_0x17aac7[_0x655e('0x4f')]};return db[_0x655e('0x3e')][_0x655e('0x31')](_0x291e8a)[_0x655e('0x1f')](function(_0x34d2a0){_0x4c3fc9['count']=_0x34d2a0;if(_0x3f9d0a[_0x655e('0x44')]['includeAll']){_0x17aac7['include']=[{'all':!![]}];}return db[_0x655e('0x3e')][_0x655e('0x54')](_0x17aac7);})[_0x655e('0x1f')](function(_0x3d1562){_0x4c3fc9[_0x655e('0x55')]=_0x3d1562;return _0x4c3fc9;})['then'](respondWithFilteredResult(_0x16c2ff,_0x17aac7))[_0x655e('0x2a')](handleError(_0x16c2ff,null));};exports[_0x655e('0x56')]=function(_0x1291d8,_0x3fcacf){var _0x22d972={'raw':!![],'where':{'id':_0x1291d8[_0x655e('0x57')]['id']}},_0x3c3934={};_0x3c3934[_0x655e('0x49')]=_['keys'](db[_0x655e('0x3e')][_0x655e('0x3f')]);_0x3c3934[_0x655e('0x44')]=_[_0x655e('0x45')](_0x1291d8[_0x655e('0x44')]);_0x3c3934['filters']=_[_0x655e('0x48')](_0x3c3934[_0x655e('0x49')],_0x3c3934[_0x655e('0x44')]);_0x22d972[_0x655e('0x47')]=_[_0x655e('0x48')](_0x3c3934[_0x655e('0x49')],qs[_0x655e('0x4a')](_0x1291d8[_0x655e('0x44')][_0x655e('0x4a')]));_0x22d972[_0x655e('0x47')]=_0x22d972['attributes']['length']?_0x22d972[_0x655e('0x47')]:_0x3c3934[_0x655e('0x49')];if(_0x1291d8[_0x655e('0x44')][_0x655e('0x58')]){_0x22d972[_0x655e('0x59')]=[{'all':!![]}];}_0x22d972=_[_0x655e('0x52')]({},_0x22d972,_0x1291d8[_0x655e('0x53')]);return db[_0x655e('0x3e')][_0x655e('0x5a')](_0x22d972)[_0x655e('0x1f')](handleEntityNotFound(_0x3fcacf,null))['then'](respondWithResult(_0x3fcacf,null))[_0x655e('0x2a')](handleError(_0x3fcacf,null));};exports['create']=function(_0xcf4693,_0x8fa8da){return db['ChatMessage'][_0x655e('0x5b')](_0xcf4693[_0x655e('0x5c')],{})[_0x655e('0x1f')](respondWithResult(_0x8fa8da,0xc9))['catch'](handleError(_0x8fa8da,null));};exports['update']=function(_0x54738a,_0x817367){if(_0x54738a[_0x655e('0x5c')]['id']){delete _0x54738a['body']['id'];}return db[_0x655e('0x3e')][_0x655e('0x5a')]({'where':{'id':_0x54738a[_0x655e('0x57')]['id']}})[_0x655e('0x1f')](handleEntityNotFound(_0x817367,null))[_0x655e('0x1f')](saveUpdates(_0x54738a['body'],null))['then'](respondWithResult(_0x817367,null))[_0x655e('0x2a')](handleError(_0x817367,null));};exports['destroy']=function(_0xd30b4c,_0x502854){return db[_0x655e('0x3e')][_0x655e('0x5a')]({'where':{'id':_0xd30b4c[_0x655e('0x57')]['id']}})[_0x655e('0x1f')](handleEntityNotFound(_0x502854,null))[_0x655e('0x1f')](removeEntity(_0x502854,null))[_0x655e('0x2a')](handleError(_0x502854,null));};exports[_0x655e('0x5d')]=function(_0x1dfd87,_0x2b65fa){return db[_0x655e('0x3e')][_0x655e('0x5d')]()[_0x655e('0x1f')](respondWithResult(_0x2b65fa,null))[_0x655e('0x2a')](handleError(_0x2b65fa,null));};var interaction_log=require('../../config/logger')(_0x655e('0x5e'));exports['accept']=function(_0x3c1b74,_0x3f2c77,_0x2e4546){var _0x3bbca5={'agent':{},'channel':_0x655e('0x5f')};if(_0x3c1b74[_0x655e('0x5c')]['id']){delete _0x3c1b74[_0x655e('0x5c')]['id'];}_0x3c1b74['body'][_0x655e('0x60')]=!![];_0x3c1b74[_0x655e('0x5c')][_0x655e('0x61')]=moment()[_0x655e('0x62')](_0x655e('0x63'));_0x3c1b74['body']['UserId']=_0x3c1b74[_0x655e('0x5c')][_0x655e('0x64')]||_0x3c1b74[_0x655e('0x65')]['id'];_0x3bbca5[_0x655e('0x66')]['id']=_0x3c1b74['body']['UserId'];return db[_0x655e('0x3e')][_0x655e('0x5a')]({'where':{'id':_0x3c1b74[_0x655e('0x57')]['id'],'UserId':null}})[_0x655e('0x1f')](handleEntityNotFound(_0x3f2c77,null))[_0x655e('0x1f')](saveUpdates(_0x3c1b74[_0x655e('0x5c')],null))[_0x655e('0x1f')](function(_0x2da6f5){if(_0x2da6f5){_0x3bbca5[_0x655e('0x28')]=_0x2da6f5[_0x655e('0x67')]({'plain':!![]});return db[_0x655e('0x68')][_0x655e('0x5a')]({'where':{'id':_0x2da6f5[_0x655e('0x69')]}});}return null;})[_0x655e('0x1f')](handleEntityNotFound(_0x3f2c77,null))[_0x655e('0x1f')](function(_0x48bd3d){if(_0x48bd3d){return _0x48bd3d[_0x655e('0x38')]({'UserId':_0x3c1b74['body'][_0x655e('0x64')],'read1stAt':_[_0x655e('0x6a')](_0x48bd3d[_0x655e('0x6b')])?moment()[_0x655e('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x655e('0x1f')](function(_0x144419){if(_0x144419){_0x3bbca5[_0x655e('0x6c')]=_0x144419['get']({'plain':!![]});interaction_log['info'](_0x655e('0x6d'),_0x3c1b74[_0x655e('0x65')]['id'],_0x3c1b74['user'][_0x655e('0x43')],_0x3c1b74['user'][_0x655e('0x6e')],_0x3bbca5[_0x655e('0x6c')]['id'],_0x3c1b74[_0x655e('0x5c')]?JSON[_0x655e('0x25')](_0x3c1b74['body']):_0x655e('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3bbca5);}return null;})[_0x655e('0x1f')](function(_0x1c6c2f){var _0x4f470a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c6c2f[_0x655e('0x28')][_0x655e('0x70')];return db[_0x655e('0x71')][_0x655e('0x44')](_0x4f470a,{'type':db[_0x655e('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x655e('0x1f')](function(_0x5a9e00){return _0x5a9e00;});})[_0x655e('0x1f')](function(_0x24a49d){if(_0x24a49d){_0x3bbca5[_0x655e('0x28')][_0x655e('0x73')]=_0x24a49d[0x0];if(!_0x3c1b74[_0x655e('0x5c')][_0x655e('0x64')])return;return db[_0x655e('0x74')][_0x655e('0x5a')]({'where':{'id':_0x3c1b74[_0x655e('0x5c')][_0x655e('0x64')],'role':_0x655e('0x66')},'attributes':['id',_0x655e('0x43'),'fullname',_0x655e('0x75'),'internal'],'raw':!![]});}return null;})[_0x655e('0x1f')](function(_0x29caec){if(!_0x29caec)return null;_0x3bbca5[_0x655e('0x28')][_0x655e('0x66')]=_0x29caec;return _0x3bbca5;})[_0x655e('0x1f')](function(_0xa01d61){if(_0xa01d61){if(_0x3c1b74['body'][_0x655e('0x76')]){_0x3bbca5['message']['interface']=util[_0x655e('0x62')](_0x655e('0x77'),_0x3c1b74[_0x655e('0x65')][_0x655e('0x43')]);_0x3bbca5[_0x655e('0x28')]['channel']=_0x3bbca5[_0x655e('0x78')];_0x3bbca5['message'][_0x655e('0x79')]=_0x3bbca5[_0x655e('0x78')];_0x3bbca5['message']['event']=_0x655e('0x7a');return respondWithRpcPromise(_0x655e('0x7b'),_0x655e('0x7b'),{'event':'acceptmessage','message':_[_0x655e('0x52')](_0x3bbca5[_0x655e('0x28')],JSON[_0x655e('0x7c')](_0x3bbca5['interaction'][_0x655e('0x7d')]))},client9002)[_0x655e('0x1f')](function(){return _0x3bbca5;});}return _0x3bbca5;}return null;})[_0x655e('0x1f')](respondWithResult(_0x3f2c77,null))['catch'](handleError(_0x3f2c77,null));};var interaction_log=require(_0x655e('0x10'))(_0x655e('0x5e'));exports[_0x655e('0x36')]=function(_0x5c0ec2,_0xb0f0f1,_0x5c968e){var _0x49a936={'agent':{},'channel':'chat'};if(_0x5c0ec2[_0x655e('0x5c')]['id']){delete _0x5c0ec2[_0x655e('0x5c')]['id'];}_0x5c0ec2[_0x655e('0x5c')]['UserId']=_0x5c0ec2[_0x655e('0x5c')]['UserId']||_0x5c0ec2[_0x655e('0x65')]['id'];_0x49a936['agent']['id']=_0x5c0ec2['body'][_0x655e('0x64')];return db[_0x655e('0x3e')]['find']({'where':{'id':_0x5c0ec2[_0x655e('0x57')]['id'],'UserId':null}})[_0x655e('0x1f')](handleEntityNotFound(_0xb0f0f1,null))[_0x655e('0x1f')](function(_0x53c2ca){if(_0x53c2ca){_0x49a936['message']=_0x53c2ca['get']({'plain':!![]});return db['ChatInteraction'][_0x655e('0x5a')]({'where':{'id':_0x53c2ca['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xb0f0f1,null))[_0x655e('0x1f')](function(_0x505680){if(_0x505680){_0x49a936[_0x655e('0x6c')]=_0x505680[_0x655e('0x67')]({'plain':!![]});interaction_log['info'](_0x655e('0x7e'),_0x5c0ec2['user']['id'],_0x5c0ec2[_0x655e('0x65')]['name'],_0x5c0ec2[_0x655e('0x65')][_0x655e('0x6e')],_0x49a936[_0x655e('0x6c')]['id'],_0x5c0ec2[_0x655e('0x5c')]?JSON[_0x655e('0x25')](_0x5c0ec2[_0x655e('0x5c')]):_0x655e('0x6f'));return respondWithRpcPromise(_0x655e('0x7f'),'rejectMessage',_0x49a936);}return null;})['then'](function(_0x4adef4){var _0x3758b0=_0x655e('0x80')+_0x4adef4['message'][_0x655e('0x70')];return db[_0x655e('0x71')][_0x655e('0x44')](_0x3758b0,{'type':db[_0x655e('0x72')][_0x655e('0x81')]['SELECT'],'raw':!![]})[_0x655e('0x1f')](function(_0x5c187b){return _0x5c187b;});})[_0x655e('0x1f')](function(_0x30229f){if(_0x30229f){_0x49a936[_0x655e('0x28')][_0x655e('0x73')]=_0x30229f[0x0];if(!_0x5c0ec2[_0x655e('0x5c')][_0x655e('0x64')])return;return db['User'][_0x655e('0x5a')]({'where':{'id':_0x5c0ec2[_0x655e('0x5c')][_0x655e('0x64')],'role':_0x655e('0x66')},'attributes':['id','name',_0x655e('0x82'),_0x655e('0x75'),_0x655e('0x83')],'raw':!![]});}return null;})[_0x655e('0x1f')](function(_0x4d053b){if(!_0x4d053b)return null;_0x49a936[_0x655e('0x28')][_0x655e('0x66')]=_0x4d053b;return _0x49a936;})[_0x655e('0x1f')](function(_0x5e3da1){if(_0x5e3da1){_0x5e3da1[_0x655e('0x28')]['interface']=util['format'](_0x655e('0x77'),_0x5c0ec2['user'][_0x655e('0x43')]);_0x5e3da1[_0x655e('0x28')][_0x655e('0x78')]=_0x49a936[_0x655e('0x78')];_0x5e3da1[_0x655e('0x28')][_0x655e('0x79')]=_0x49a936[_0x655e('0x78')];_0x5e3da1[_0x655e('0x28')]['event']='reject';respondWithRpcPromise(_0x655e('0x7b'),'EventManager',{'event':_0x655e('0x84'),'message':_[_0x655e('0x52')](_0x49a936['message'],JSON[_0x655e('0x7c')](_0x49a936[_0x655e('0x6c')]['formData']))},client9002);return _0x49a936;}return null;})[_0x655e('0x1f')](respondWithResult(_0xb0f0f1,null))[_0x655e('0x2a')](handleError(_0xb0f0f1,null));}; \ No newline at end of file +var _0x6f2a=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','stack','name','send','index','map','ChatMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','rawAttributes','find','create','body','destroy','describe','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','role','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','contact','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','User','email','rejectmessage','parse','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x54b25c,_0x9e4c3){var _0x3a9ee1=function(_0x2f530d){while(--_0x2f530d){_0x54b25c['push'](_0x54b25c['shift']());}};_0x3a9ee1(++_0x9e4c3);}(_0x6f2a,0x17a));var _0xa6f2=function(_0x3746f1,_0x1df3c3){_0x3746f1=_0x3746f1-0x0;var _0x3dd18a=_0x6f2a[_0x3746f1];return _0x3dd18a;};'use strict';var emlformat=require(_0xa6f2('0x0'));var rimraf=require(_0xa6f2('0x1'));var zipdir=require(_0xa6f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6f2('0x3'));var BPromise=require(_0xa6f2('0x4'));var Mustache=require(_0xa6f2('0x5'));var util=require(_0xa6f2('0x6'));var path=require(_0xa6f2('0x7'));var sox=require(_0xa6f2('0x8'));var csv=require(_0xa6f2('0x9'));var ejs=require(_0xa6f2('0xa'));var fs=require('fs');var fs_extra=require(_0xa6f2('0xb'));var _=require(_0xa6f2('0xc'));var squel=require(_0xa6f2('0xd'));var crypto=require(_0xa6f2('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa6f2('0x9'));var querystring=require(_0xa6f2('0xf'));var Papa=require(_0xa6f2('0x10'));var Redis=require(_0xa6f2('0x11'));var authService=require(_0xa6f2('0x12'));var qs=require(_0xa6f2('0x13'));var as=require(_0xa6f2('0x14'));var hardwareService=require(_0xa6f2('0x15'));var logger=require(_0xa6f2('0x16'))('api');var utils=require(_0xa6f2('0x17'));var config=require(_0xa6f2('0x18'));var licenseUtil=require(_0xa6f2('0x19'));var db=require(_0xa6f2('0x1a'))['db'];config[_0xa6f2('0x1b')]=_[_0xa6f2('0x1c')](config[_0xa6f2('0x1b')],{'host':_0xa6f2('0x1d'),'port':0x18eb});var socket=require(_0xa6f2('0x1e'))(new Redis(config[_0xa6f2('0x1b')]));require(_0xa6f2('0x1f'))['register'](socket);var jayson=require(_0xa6f2('0x20'));var client=jayson[_0xa6f2('0x21')][_0xa6f2('0x22')]({'port':0x232c});var client9002=jayson[_0xa6f2('0x21')][_0xa6f2('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4c1655,_0x49ba4d,_0x211d0b,_0x88f432){return new BPromise(function(_0x321752,_0x2d4395){var _0xb6a2f=_0x88f432||client;return _0xb6a2f['request'](_0x4c1655,_0x211d0b)[_0xa6f2('0x23')](function(_0x6ed10b){logger['info']('ChatMessage,\x20%s,\x20%s',_0x49ba4d,_0xa6f2('0x24'));logger[_0xa6f2('0x25')](_0xa6f2('0x26'),_0x49ba4d,_0xa6f2('0x24'),JSON[_0xa6f2('0x27')](_0x6ed10b));if(_0x6ed10b[_0xa6f2('0x28')]){if(_0x6ed10b[_0xa6f2('0x28')]['code']===0x1f4){logger[_0xa6f2('0x28')](_0xa6f2('0x29'),_0x49ba4d,_0x6ed10b[_0xa6f2('0x28')][_0xa6f2('0x2a')]);return _0x2d4395(_0x6ed10b[_0xa6f2('0x28')]['message']);}logger['error'](_0xa6f2('0x29'),_0x49ba4d,_0x6ed10b['error'][_0xa6f2('0x2a')]);return _0x321752(_0x6ed10b[_0xa6f2('0x28')][_0xa6f2('0x2a')]);}else{logger['info'](_0xa6f2('0x29'),_0x49ba4d,'request\x20sent');_0x321752(_0x6ed10b[_0xa6f2('0x2b')]['message']);}})[_0xa6f2('0x2c')](function(_0x57d6b0){logger[_0xa6f2('0x28')]('ChatMessage,\x20%s,\x20%s',_0x49ba4d,_0x57d6b0);_0x2d4395(_0x57d6b0);});});}function respondWithStatusCode(_0x35f56e,_0x3a9f04){_0x3a9f04=_0x3a9f04||0xcc;return function(_0x4e5dbb){if(_0x4e5dbb){return _0x35f56e[_0xa6f2('0x2d')](_0x3a9f04);}return _0x35f56e['status'](_0x3a9f04)[_0xa6f2('0x2e')]();};}function respondWithResult(_0xd59016,_0x1aabfb){_0x1aabfb=_0x1aabfb||0xc8;return function(_0x204549){if(_0x204549){return _0xd59016[_0xa6f2('0x2f')](_0x1aabfb)[_0xa6f2('0x30')](_0x204549);}};}function respondWithFilteredResult(_0x533559,_0x410f66){return function(_0x5d0038){if(_0x5d0038){var _0x61acf=typeof _0x410f66[_0xa6f2('0x31')]===_0xa6f2('0x32')&&typeof _0x410f66['limit']==='undefined';var _0x111cd0=_0x5d0038[_0xa6f2('0x33')];var _0xc11096=_0x61acf?0x0:_0x410f66[_0xa6f2('0x31')];var _0x386af2=_0x61acf?_0x5d0038[_0xa6f2('0x33')]:_0x410f66[_0xa6f2('0x31')]+_0x410f66[_0xa6f2('0x34')];var _0x304aa2;if(_0x386af2>=_0x111cd0){_0x386af2=_0x111cd0;_0x304aa2=0xc8;}else{_0x304aa2=0xce;}_0x533559[_0xa6f2('0x2f')](_0x304aa2);return _0x533559[_0xa6f2('0x35')](_0xa6f2('0x36'),_0xc11096+'-'+_0x386af2+'/'+_0x111cd0)['json'](_0x5d0038);}return null;};}function patchUpdates(_0x216675){return function(_0x1d862d){try{jsonpatch[_0xa6f2('0x37')](_0x1d862d,_0x216675,!![]);}catch(_0x283a30){return BPromise[_0xa6f2('0x38')](_0x283a30);}return _0x1d862d[_0xa6f2('0x39')]();};}function saveUpdates(_0x5d3917,_0x3d1b97){return function(_0x1e8220){if(_0x1e8220){return _0x1e8220['update'](_0x5d3917)[_0xa6f2('0x23')](function(_0x5d2610){return _0x5d2610;});}return null;};}function removeEntity(_0xc94a22,_0x1ed876){return function(_0xc7d1f7){if(_0xc7d1f7){return _0xc7d1f7['destroy']()[_0xa6f2('0x23')](function(){_0xc94a22[_0xa6f2('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ff3a,_0x2df9a8){return function(_0x830179){if(!_0x830179){_0x20ff3a[_0xa6f2('0x2d')](0x194);}return _0x830179;};}function handleError(_0x34d7bd,_0x56ffd0){_0x56ffd0=_0x56ffd0||0x1f4;return function(_0x17b989){logger['error'](_0x17b989[_0xa6f2('0x3a')]);if(_0x17b989[_0xa6f2('0x3b')]){delete _0x17b989['name'];}_0x34d7bd['status'](_0x56ffd0)[_0xa6f2('0x3c')](_0x17b989);};}exports[_0xa6f2('0x3d')]=function(_0x29ab73,_0x46e319){var _0x12f16a={},_0x3ae876={},_0x56d1e8={'count':0x0,'rows':[]};var _0x2fefdd=_[_0xa6f2('0x3e')](db[_0xa6f2('0x3f')]['rawAttributes'],function(_0x406a88){return{'name':_0x406a88[_0xa6f2('0x40')],'type':_0x406a88[_0xa6f2('0x41')][_0xa6f2('0x42')]};});_0x3ae876['model']=_['map'](_0x2fefdd,_0xa6f2('0x3b'));_0x3ae876[_0xa6f2('0x43')]=_[_0xa6f2('0x44')](_0x29ab73[_0xa6f2('0x43')]);_0x3ae876[_0xa6f2('0x45')]=_[_0xa6f2('0x46')](_0x3ae876[_0xa6f2('0x47')],_0x3ae876[_0xa6f2('0x43')]);_0x12f16a[_0xa6f2('0x48')]=_['intersection'](_0x3ae876[_0xa6f2('0x47')],qs['fields'](_0x29ab73[_0xa6f2('0x43')][_0xa6f2('0x49')]));_0x12f16a[_0xa6f2('0x48')]=_0x12f16a[_0xa6f2('0x48')][_0xa6f2('0x4a')]?_0x12f16a[_0xa6f2('0x48')]:_0x3ae876['model'];if(!_0x29ab73[_0xa6f2('0x43')]['hasOwnProperty'](_0xa6f2('0x4b'))){_0x12f16a[_0xa6f2('0x34')]=qs[_0xa6f2('0x34')](_0x29ab73['query']['limit']);_0x12f16a[_0xa6f2('0x31')]=qs[_0xa6f2('0x31')](_0x29ab73['query'][_0xa6f2('0x31')]);}_0x12f16a['order']=qs[_0xa6f2('0x4c')](_0x29ab73[_0xa6f2('0x43')]['sort']);_0x12f16a[_0xa6f2('0x4d')]=qs[_0xa6f2('0x45')](_[_0xa6f2('0x4e')](_0x29ab73['query'],_0x3ae876[_0xa6f2('0x45')]),_0x2fefdd);if(_0x29ab73['query']['filter']){_0x12f16a['where']=_[_0xa6f2('0x4f')](_0x12f16a[_0xa6f2('0x4d')],{'$or':_[_0xa6f2('0x3e')](_0x2fefdd,function(_0x1acaf1){if(_0x1acaf1[_0xa6f2('0x41')]!==_0xa6f2('0x50')){var _0x462dd9={};_0x462dd9[_0x1acaf1[_0xa6f2('0x3b')]]={'$like':'%'+_0x29ab73[_0xa6f2('0x43')][_0xa6f2('0x51')]+'%'};return _0x462dd9;}})});}_0x12f16a=_[_0xa6f2('0x4f')]({},_0x12f16a,_0x29ab73[_0xa6f2('0x52')]);var _0x2bcfd1={'where':_0x12f16a[_0xa6f2('0x4d')]};return db[_0xa6f2('0x3f')]['count'](_0x2bcfd1)[_0xa6f2('0x23')](function(_0x5abbcd){_0x56d1e8[_0xa6f2('0x33')]=_0x5abbcd;if(_0x29ab73['query']['includeAll']){_0x12f16a[_0xa6f2('0x53')]=[{'all':!![]}];}return db[_0xa6f2('0x3f')]['findAll'](_0x12f16a);})[_0xa6f2('0x23')](function(_0x3d46f5){_0x56d1e8['rows']=_0x3d46f5;return _0x56d1e8;})[_0xa6f2('0x23')](respondWithFilteredResult(_0x46e319,_0x12f16a))[_0xa6f2('0x2c')](handleError(_0x46e319,null));};exports[_0xa6f2('0x54')]=function(_0x15634d,_0x1cc886){var _0x5bc799={'raw':!![],'where':{'id':_0x15634d[_0xa6f2('0x55')]['id']}},_0x4a0792={};_0x4a0792[_0xa6f2('0x47')]=_[_0xa6f2('0x44')](db['ChatMessage'][_0xa6f2('0x56')]);_0x4a0792['query']=_['keys'](_0x15634d['query']);_0x4a0792[_0xa6f2('0x45')]=_[_0xa6f2('0x46')](_0x4a0792[_0xa6f2('0x47')],_0x4a0792['query']);_0x5bc799[_0xa6f2('0x48')]=_[_0xa6f2('0x46')](_0x4a0792[_0xa6f2('0x47')],qs['fields'](_0x15634d[_0xa6f2('0x43')][_0xa6f2('0x49')]));_0x5bc799['attributes']=_0x5bc799[_0xa6f2('0x48')][_0xa6f2('0x4a')]?_0x5bc799['attributes']:_0x4a0792[_0xa6f2('0x47')];if(_0x15634d['query']['includeAll']){_0x5bc799['include']=[{'all':!![]}];}_0x5bc799=_['merge']({},_0x5bc799,_0x15634d[_0xa6f2('0x52')]);return db[_0xa6f2('0x3f')][_0xa6f2('0x57')](_0x5bc799)['then'](handleEntityNotFound(_0x1cc886,null))[_0xa6f2('0x23')](respondWithResult(_0x1cc886,null))[_0xa6f2('0x2c')](handleError(_0x1cc886,null));};exports[_0xa6f2('0x58')]=function(_0x350c9f,_0x45b21e){return db[_0xa6f2('0x3f')]['create'](_0x350c9f[_0xa6f2('0x59')],{})[_0xa6f2('0x23')](respondWithResult(_0x45b21e,0xc9))[_0xa6f2('0x2c')](handleError(_0x45b21e,null));};exports['update']=function(_0x35d964,_0x49b33e){if(_0x35d964[_0xa6f2('0x59')]['id']){delete _0x35d964['body']['id'];}return db[_0xa6f2('0x3f')][_0xa6f2('0x57')]({'where':{'id':_0x35d964[_0xa6f2('0x55')]['id']}})['then'](handleEntityNotFound(_0x49b33e,null))[_0xa6f2('0x23')](saveUpdates(_0x35d964['body'],null))[_0xa6f2('0x23')](respondWithResult(_0x49b33e,null))[_0xa6f2('0x2c')](handleError(_0x49b33e,null));};exports[_0xa6f2('0x5a')]=function(_0x1a081d,_0x1f016e){return db[_0xa6f2('0x3f')]['find']({'where':{'id':_0x1a081d['params']['id']}})[_0xa6f2('0x23')](handleEntityNotFound(_0x1f016e,null))[_0xa6f2('0x23')](removeEntity(_0x1f016e,null))[_0xa6f2('0x2c')](handleError(_0x1f016e,null));};exports[_0xa6f2('0x5b')]=function(_0x5d901a,_0xce2c21){return db[_0xa6f2('0x3f')][_0xa6f2('0x5b')]()[_0xa6f2('0x23')](respondWithResult(_0xce2c21,null))[_0xa6f2('0x2c')](handleError(_0xce2c21,null));};var interaction_log=require(_0xa6f2('0x16'))('chat-interactions');exports[_0xa6f2('0x5c')]=function(_0x2a7de5,_0x2e2fcc,_0x5c8fd6){var _0x4fdfe3={'agent':{},'channel':_0xa6f2('0x5d')};if(_0x2a7de5['body']['id']){delete _0x2a7de5[_0xa6f2('0x59')]['id'];}_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x5e')]=!![];_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x5f')]=moment()[_0xa6f2('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x61')]=_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x61')]||_0x2a7de5[_0xa6f2('0x62')]['id'];_0x4fdfe3[_0xa6f2('0x63')]['id']=_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x61')];return db[_0xa6f2('0x3f')]['find']({'where':{'id':_0x2a7de5['params']['id'],'UserId':null}})[_0xa6f2('0x23')](handleEntityNotFound(_0x2e2fcc,null))['then'](saveUpdates(_0x2a7de5[_0xa6f2('0x59')],null))[_0xa6f2('0x23')](function(_0x4060aa){if(_0x4060aa){_0x4fdfe3[_0xa6f2('0x2a')]=_0x4060aa[_0xa6f2('0x64')]({'plain':!![]});return db['ChatInteraction'][_0xa6f2('0x57')]({'where':{'id':_0x4060aa[_0xa6f2('0x65')]}});}return null;})[_0xa6f2('0x23')](handleEntityNotFound(_0x2e2fcc,null))[_0xa6f2('0x23')](function(_0x39283e){if(_0x39283e){return _0x39283e['update']({'UserId':_0x2a7de5[_0xa6f2('0x59')]['UserId'],'read1stAt':_[_0xa6f2('0x66')](_0x39283e[_0xa6f2('0x67')])?moment()[_0xa6f2('0x60')](_0xa6f2('0x68')):undefined});}return null;})['then'](function(_0x5e67f1){if(_0x5e67f1){_0x4fdfe3[_0xa6f2('0x69')]=_0x5e67f1[_0xa6f2('0x64')]({'plain':!![]});interaction_log[_0xa6f2('0x6a')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a7de5[_0xa6f2('0x62')]['id'],_0x2a7de5[_0xa6f2('0x62')][_0xa6f2('0x3b')],_0x2a7de5['user'][_0xa6f2('0x6b')],_0x4fdfe3['interaction']['id'],_0x2a7de5['body']?JSON[_0xa6f2('0x27')](_0x2a7de5[_0xa6f2('0x59')]):_0xa6f2('0x6c'));return respondWithRpcPromise(_0xa6f2('0x6d'),_0xa6f2('0x6e'),_0x4fdfe3);}return null;})[_0xa6f2('0x23')](function(_0x23e807){var _0x2907c4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x23e807['message']['ContactId'];return db['sequelize'][_0xa6f2('0x43')](_0x2907c4,{'type':db[_0xa6f2('0x6f')][_0xa6f2('0x70')][_0xa6f2('0x71')],'raw':!![]})[_0xa6f2('0x23')](function(_0x4f140c){return _0x4f140c;});})['then'](function(_0x2f2768){if(_0x2f2768){_0x4fdfe3[_0xa6f2('0x2a')][_0xa6f2('0x72')]=_0x2f2768[0x0];if(!_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x61')])return;return db['User']['find']({'where':{'id':_0x2a7de5['body'][_0xa6f2('0x61')],'role':'agent'},'attributes':['id',_0xa6f2('0x3b'),'fullname','email',_0xa6f2('0x73')],'raw':!![]});}return null;})[_0xa6f2('0x23')](function(_0x255530){if(!_0x255530)return null;_0x4fdfe3[_0xa6f2('0x2a')][_0xa6f2('0x63')]=_0x255530;return _0x4fdfe3;})[_0xa6f2('0x23')](function(_0x366b06){if(_0x366b06){if(_0x2a7de5[_0xa6f2('0x59')][_0xa6f2('0x74')]){_0x4fdfe3[_0xa6f2('0x2a')][_0xa6f2('0x75')]=util[_0xa6f2('0x60')](_0xa6f2('0x76'),_0x2a7de5[_0xa6f2('0x62')]['name']);_0x4fdfe3[_0xa6f2('0x2a')][_0xa6f2('0x77')]=_0x4fdfe3[_0xa6f2('0x77')];_0x4fdfe3[_0xa6f2('0x2a')][_0xa6f2('0x78')]=_0x4fdfe3[_0xa6f2('0x77')];_0x4fdfe3['message'][_0xa6f2('0x79')]=_0xa6f2('0x5c');return respondWithRpcPromise('EventManager',_0xa6f2('0x7a'),{'event':_0xa6f2('0x7b'),'message':_['merge'](_0x4fdfe3['message'],JSON['parse'](_0x4fdfe3[_0xa6f2('0x69')][_0xa6f2('0x7c')]))},client9002)[_0xa6f2('0x23')](function(){return _0x4fdfe3;});}return _0x4fdfe3;}return null;})[_0xa6f2('0x23')](respondWithResult(_0x2e2fcc,null))[_0xa6f2('0x2c')](handleError(_0x2e2fcc,null));};var interaction_log=require(_0xa6f2('0x16'))(_0xa6f2('0x7d'));exports[_0xa6f2('0x38')]=function(_0xb901b4,_0x3fddd4,_0x1dea39){var _0x4eafc0={'agent':{},'channel':_0xa6f2('0x5d')};if(_0xb901b4[_0xa6f2('0x59')]['id']){delete _0xb901b4['body']['id'];}_0xb901b4[_0xa6f2('0x59')][_0xa6f2('0x61')]=_0xb901b4['body'][_0xa6f2('0x61')]||_0xb901b4[_0xa6f2('0x62')]['id'];_0x4eafc0['agent']['id']=_0xb901b4['body'][_0xa6f2('0x61')];return db['ChatMessage'][_0xa6f2('0x57')]({'where':{'id':_0xb901b4[_0xa6f2('0x55')]['id'],'UserId':null}})[_0xa6f2('0x23')](handleEntityNotFound(_0x3fddd4,null))['then'](function(_0xc50ae6){if(_0xc50ae6){_0x4eafc0[_0xa6f2('0x2a')]=_0xc50ae6['get']({'plain':!![]});return db[_0xa6f2('0x7e')][_0xa6f2('0x57')]({'where':{'id':_0xc50ae6[_0xa6f2('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3fddd4,null))[_0xa6f2('0x23')](function(_0xe74adb){if(_0xe74adb){_0x4eafc0[_0xa6f2('0x69')]=_0xe74adb[_0xa6f2('0x64')]({'plain':!![]});interaction_log[_0xa6f2('0x6a')](_0xa6f2('0x7f'),_0xb901b4[_0xa6f2('0x62')]['id'],_0xb901b4['user'][_0xa6f2('0x3b')],_0xb901b4['user'][_0xa6f2('0x6b')],_0x4eafc0['interaction']['id'],_0xb901b4['body']?JSON[_0xa6f2('0x27')](_0xb901b4['body']):_0xa6f2('0x6c'));return respondWithRpcPromise('RejectMessage',_0xa6f2('0x80'),_0x4eafc0);}return null;})[_0xa6f2('0x23')](function(_0x47d298){var _0x45c608=_0xa6f2('0x81')+_0x47d298['message'][_0xa6f2('0x82')];return db['sequelize'][_0xa6f2('0x43')](_0x45c608,{'type':db['Sequelize'][_0xa6f2('0x70')][_0xa6f2('0x71')],'raw':!![]})[_0xa6f2('0x23')](function(_0x108995){return _0x108995;});})['then'](function(_0x2237e3){if(_0x2237e3){_0x4eafc0[_0xa6f2('0x2a')][_0xa6f2('0x72')]=_0x2237e3[0x0];if(!_0xb901b4[_0xa6f2('0x59')][_0xa6f2('0x61')])return;return db[_0xa6f2('0x83')]['find']({'where':{'id':_0xb901b4[_0xa6f2('0x59')][_0xa6f2('0x61')],'role':'agent'},'attributes':['id','name','fullname',_0xa6f2('0x84'),_0xa6f2('0x73')],'raw':!![]});}return null;})['then'](function(_0x2845c2){if(!_0x2845c2)return null;_0x4eafc0[_0xa6f2('0x2a')]['agent']=_0x2845c2;return _0x4eafc0;})[_0xa6f2('0x23')](function(_0x57369f){if(_0x57369f){_0x57369f[_0xa6f2('0x2a')][_0xa6f2('0x75')]=util[_0xa6f2('0x60')](_0xa6f2('0x76'),_0xb901b4['user']['name']);_0x57369f[_0xa6f2('0x2a')]['channel']=_0x4eafc0['channel'];_0x57369f[_0xa6f2('0x2a')][_0xa6f2('0x78')]=_0x4eafc0[_0xa6f2('0x77')];_0x57369f[_0xa6f2('0x2a')][_0xa6f2('0x79')]=_0xa6f2('0x38');respondWithRpcPromise(_0xa6f2('0x7a'),_0xa6f2('0x7a'),{'event':_0xa6f2('0x85'),'message':_[_0xa6f2('0x4f')](_0x4eafc0[_0xa6f2('0x2a')],JSON[_0xa6f2('0x86')](_0x4eafc0[_0xa6f2('0x69')][_0xa6f2('0x7c')]))},client9002);return _0x4eafc0;}return null;})[_0xa6f2('0x23')](respondWithResult(_0x3fddd4,null))[_0xa6f2('0x2c')](handleError(_0x3fddd4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index dc95977..2c45c25 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 _0x3390=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3390,0xa4));var _0x0339=function(_0x15be2c,_0x5e2cf2){_0x15be2c=_0x15be2c-0x0;var _0x4a9ff4=_0x3390[_0x15be2c];return _0x4a9ff4;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0339('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0339('0x1')](0x0);var events={'afterCreate':_0x0339('0x2'),'afterUpdate':_0x0339('0x3'),'afterDestroy':_0x0339('0x4')};function emitEvent(_0x987f6a){return function(_0x1753bb,_0x7399db,_0x1a0075){ChatMessageEvents['emit'](_0x987f6a+':'+_0x1753bb['id'],_0x1753bb);ChatMessageEvents[_0x0339('0x5')](_0x987f6a,_0x1753bb);_0x1a0075(null);};}for(var e in events){if(events[_0x0339('0x6')](e)){var event=events[e];ChatMessage[_0x0339('0x7')](e,emitEvent(event));}}module[_0x0339('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xf457=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x24c7c7,_0x2df9b0){var _0x251892=function(_0xb3847f){while(--_0xb3847f){_0x24c7c7['push'](_0x24c7c7['shift']());}};_0x251892(++_0x2df9b0);}(_0xf457,0xeb));var _0x7f45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf457[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x7f45('0x0'));var ChatMessage=require(_0x7f45('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7f45('0x2')](0x0);var events={'afterCreate':_0x7f45('0x3'),'afterUpdate':_0x7f45('0x4'),'afterDestroy':_0x7f45('0x5')};function emitEvent(_0x3a4b20){return function(_0x45a147,_0x3feb72,_0x12d856){ChatMessageEvents[_0x7f45('0x6')](_0x3a4b20+':'+_0x45a147['id'],_0x45a147);ChatMessageEvents[_0x7f45('0x6')](_0x3a4b20,_0x45a147);_0x12d856(null);};}for(var e in events){if(events[_0x7f45('0x7')](e)){var event=events[e];ChatMessage[_0x7f45('0x8')](e,emitEvent(event));}}module[_0x7f45('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index bedeb54..49253c2 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 _0xdc6f=['util','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1b0bcc,_0x4af3f1){var _0x497cf9=function(_0x3f8306){while(--_0x3f8306){_0x1b0bcc['push'](_0x1b0bcc['shift']());}};_0x497cf9(++_0x4af3f1);}(_0xdc6f,0x1ca));var _0xfdc6=function(_0x19ee96,_0x48b7d5){_0x19ee96=_0x19ee96-0x0;var _0x57aaf0=_0xdc6f[_0x19ee96];return _0x57aaf0;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfdc6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdc6('0x3'));var rimraf=require(_0xfdc6('0x4'));var config=require(_0xfdc6('0x5'));var attributes=require(_0xfdc6('0x6'));module[_0xfdc6('0x7')]=function(_0x2503c8,_0x4d90ae){return _0x2503c8['define'](_0xfdc6('0x8'),attributes,{'tableName':_0xfdc6('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xfdc6('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x359f51,_0x175922,_0x5798e1){var _0x5e2902=_0x2503c8[_0xfdc6('0xb')];var _0x5d2f4c=_0x359f51[_0xfdc6('0xc')]({'plain':!![]});if(_0x5d2f4c[_0xfdc6('0xd')][_0xfdc6('0xe')]()==='in'||_0x5d2f4c[_0xfdc6('0xd')][_0xfdc6('0xe')]()===_0xfdc6('0xf')&&!_0x5d2f4c[_0xfdc6('0x10')]&&!_[_0xfdc6('0x11')](_0x5d2f4c['UserId'])){_0x5e2902[_0xfdc6('0x12')][_0xfdc6('0x13')]({'where':{'id':_0x5d2f4c[_0xfdc6('0x14')]}})[_0xfdc6('0x15')](function(_0x2effd2){if(_0x2effd2){_0x2effd2[_0xfdc6('0x16')]({'lastMsgAt':_0x5d2f4c[_0xfdc6('0x17')],'lastMsgDirection':_0x5d2f4c[_0xfdc6('0xd')][_0xfdc6('0xe')]()});}})[_0xfdc6('0x18')](function(_0x1910fc){console['error'](_0x1910fc);});}_0x5798e1();}},'charset':_0xfdc6('0x19'),'collate':_0xfdc6('0x1a')});}; \ No newline at end of file +var _0x2d9e=['moment','bluebird','request-promise','./chatMessage.attributes','exports','chat_messages','body','models','get','direction','out','isNil','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x18849b,_0x530b07){var _0x23b2df=function(_0x582c14){while(--_0x582c14){_0x18849b['push'](_0x18849b['shift']());}};_0x23b2df(++_0x530b07);}(_0x2d9e,0x97));var _0xe2d9=function(_0xbb02a6,_0x2b3f2c){_0xbb02a6=_0xbb02a6-0x0;var _0x4d7739=_0x2d9e[_0xbb02a6];return _0x4d7739;};'use strict';var _=require(_0xe2d9('0x0'));var util=require('util');var logger=require(_0xe2d9('0x1'))(_0xe2d9('0x2'));var moment=require(_0xe2d9('0x3'));var BPromise=require(_0xe2d9('0x4'));var rp=require(_0xe2d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe2d9('0x6'));module[_0xe2d9('0x7')]=function(_0x367be4,_0x3d4326){return _0x367be4['define']('ChatMessage',attributes,{'tableName':_0xe2d9('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe2d9('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42a017,_0x34be27,_0x4410d3){var _0x59c4d0=_0x367be4[_0xe2d9('0xa')];var _0x598886=_0x42a017[_0xe2d9('0xb')]({'plain':!![]});if(_0x598886[_0xe2d9('0xc')]['toLowerCase']()==='in'||_0x598886[_0xe2d9('0xc')]['toLowerCase']()===_0xe2d9('0xd')&&!_0x598886['secret']&&!_[_0xe2d9('0xe')](_0x598886['UserId'])){_0x59c4d0[_0xe2d9('0xf')][_0xe2d9('0x10')]({'where':{'id':_0x598886['ChatInteractionId']}})[_0xe2d9('0x11')](function(_0x423087){if(_0x423087){_0x423087[_0xe2d9('0x12')]({'lastMsgAt':_0x598886[_0xe2d9('0x13')],'lastMsgDirection':_0x598886[_0xe2d9('0xc')]['toLowerCase']()});}})[_0xe2d9('0x14')](function(_0x454dad){console['error'](_0x454dad);});}_0x4410d3();}},'charset':'utf8mb4','collate':_0xe2d9('0x15')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 9321adf..00bfd6a 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 _0x78b4=['./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter'];(function(_0x4ea970,_0x4378de){var _0x50193e=function(_0x3d14ba){while(--_0x3d14ba){_0x4ea970['push'](_0x4ea970['shift']());}};_0x50193e(++_0x4378de);}(_0x78b4,0x73));var _0x478b=function(_0x6dbc36,_0x52d168){_0x6dbc36=_0x6dbc36-0x0;var _0x526858=_0x78b4[_0x6dbc36];return _0x526858;};'use strict';var _=require(_0x478b('0x0'));var util=require(_0x478b('0x1'));var moment=require(_0x478b('0x2'));var BPromise=require(_0x478b('0x3'));var rs=require(_0x478b('0x4'));var fs=require('fs');var Redis=require(_0x478b('0x5'));var db=require(_0x478b('0x6'))['db'];var utils=require(_0x478b('0x7'));var logger=require(_0x478b('0x8'))(_0x478b('0x9'));var config=require(_0x478b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x478b('0xb')]=_['defaults'](config[_0x478b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x478b('0xc'))(new Redis(config['redis']));require(_0x478b('0xd'))[_0x478b('0xe')](socket);function respondWithRpcPromise(_0x1052d9,_0x1b2b8b,_0x252f75){return new BPromise(function(_0x490344,_0x25877f){return client[_0x478b('0xf')](_0x1052d9,_0x252f75)[_0x478b('0x10')](function(_0x3c9709){logger['info'](_0x478b('0x11'),_0x1b2b8b,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1b2b8b,_0x478b('0x12'),JSON['stringify'](_0x3c9709));if(_0x3c9709[_0x478b('0x13')]){if(_0x3c9709[_0x478b('0x13')][_0x478b('0x14')]===0x1f4){logger[_0x478b('0x13')](_0x478b('0x11'),_0x1b2b8b,_0x3c9709[_0x478b('0x13')][_0x478b('0x15')]);return _0x25877f(_0x3c9709['error']['message']);}logger[_0x478b('0x13')](_0x478b('0x11'),_0x1b2b8b,_0x3c9709['error']['message']);return _0x490344(_0x3c9709['error'][_0x478b('0x15')]);}else{logger[_0x478b('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1b2b8b,_0x478b('0x12'));_0x490344(_0x3c9709[_0x478b('0x17')][_0x478b('0x15')]);}})[_0x478b('0x18')](function(_0x1c2d67){logger[_0x478b('0x13')](_0x478b('0x11'),_0x1b2b8b,_0x1c2d67);_0x25877f(_0x1c2d67);});});}exports[_0x478b('0x19')]=function(_0x558440){var _0x493e3d=this;return new Promise(function(_0x32d7da,_0x5756ce){return db['ChatMessage'][_0x478b('0x1a')](_0x558440[_0x478b('0x1b')],{'raw':_0x558440[_0x478b('0x1c')]?_0x558440[_0x478b('0x1c')][_0x478b('0x1d')]===undefined?!![]:![]:!![]})[_0x478b('0x10')](function(_0x2d0406){logger[_0x478b('0x16')]('CreateChatMessage',_0x558440);logger[_0x478b('0x1e')](_0x478b('0x19'),_0x558440,JSON[_0x478b('0x1f')](_0x2d0406));_0x32d7da(_0x2d0406);})[_0x478b('0x18')](function(_0x570069){logger['error'](_0x478b('0x19'),_0x570069[_0x478b('0x15')],_0x558440);_0x5756ce(_0x493e3d[_0x478b('0x13')](0x1f4,_0x570069[_0x478b('0x15')]));});});}; \ No newline at end of file +var _0x89a6=['debug','error','code','message','catch','CreateChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x44b912,_0x1e9fc1){var _0x49f5a2=function(_0x286d35){while(--_0x286d35){_0x44b912['push'](_0x44b912['shift']());}};_0x49f5a2(++_0x1e9fc1);}(_0x89a6,0x6a));var _0x689a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89a6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x689a('0x0'));var util=require(_0x689a('0x1'));var moment=require(_0x689a('0x2'));var BPromise=require(_0x689a('0x3'));var rs=require(_0x689a('0x4'));var fs=require('fs');var Redis=require(_0x689a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x689a('0x6'));var logger=require(_0x689a('0x7'))(_0x689a('0x8'));var config=require(_0x689a('0x9'));var jayson=require(_0x689a('0xa'));var client=jayson[_0x689a('0xb')][_0x689a('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x689a('0xd')],{'host':_0x689a('0xe'),'port':0x18eb});var socket=require(_0x689a('0xf'))(new Redis(config[_0x689a('0xd')]));require('./chatMessage.socket')[_0x689a('0x10')](socket);function respondWithRpcPromise(_0x54812f,_0x511eb9,_0x1bcbcd){return new BPromise(function(_0x503887,_0x2947f3){return client[_0x689a('0x11')](_0x54812f,_0x1bcbcd)[_0x689a('0x12')](function(_0x743fc4){logger[_0x689a('0x13')](_0x689a('0x14'),_0x511eb9,_0x689a('0x15'));logger[_0x689a('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x511eb9,_0x689a('0x15'),JSON['stringify'](_0x743fc4));if(_0x743fc4[_0x689a('0x17')]){if(_0x743fc4[_0x689a('0x17')][_0x689a('0x18')]===0x1f4){logger['error'](_0x689a('0x14'),_0x511eb9,_0x743fc4[_0x689a('0x17')][_0x689a('0x19')]);return _0x2947f3(_0x743fc4[_0x689a('0x17')][_0x689a('0x19')]);}logger['error'](_0x689a('0x14'),_0x511eb9,_0x743fc4['error'][_0x689a('0x19')]);return _0x503887(_0x743fc4[_0x689a('0x17')]['message']);}else{logger[_0x689a('0x13')](_0x689a('0x14'),_0x511eb9,_0x689a('0x15'));_0x503887(_0x743fc4['result'][_0x689a('0x19')]);}})[_0x689a('0x1a')](function(_0x421ffa){logger[_0x689a('0x17')](_0x689a('0x14'),_0x511eb9,_0x421ffa);_0x2947f3(_0x421ffa);});});}exports[_0x689a('0x1b')]=function(_0x1514a2){var _0x2f9826=this;return new Promise(function(_0x3e494e,_0x7eb3){return db['ChatMessage'][_0x689a('0x1c')](_0x1514a2[_0x689a('0x1d')],{'raw':_0x1514a2[_0x689a('0x1e')]?_0x1514a2[_0x689a('0x1e')][_0x689a('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xad65f5){logger[_0x689a('0x13')]('CreateChatMessage',_0x1514a2);logger[_0x689a('0x16')](_0x689a('0x1b'),_0x1514a2,JSON['stringify'](_0xad65f5));_0x3e494e(_0xad65f5);})[_0x689a('0x1a')](function(_0x471b6e){logger[_0x689a('0x17')](_0x689a('0x1b'),_0x471b6e[_0x689a('0x19')],_0x1514a2);_0x7eb3(_0x2f9826['error'](0x1f4,_0x471b6e[_0x689a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index e7c8507..8bcea34 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 _0x0e76=['emit','register','length','chatMessage:','./chatMessage.events','update'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0x0e76,0xc4));var _0x60e7=function(_0x1777e4,_0x38b4f8){_0x1777e4=_0x1777e4-0x0;var _0x21ecac=_0x0e76[_0x1777e4];return _0x21ecac;};'use strict';var ChatMessageEvents=require(_0x60e7('0x0'));var events=['save','remove',_0x60e7('0x1')];function createListener(_0x4d71bb,_0x21402c){return function(_0x6f8f6e){_0x21402c[_0x60e7('0x2')](_0x4d71bb,_0x6f8f6e);};}function removeListener(_0xd3886,_0x2f1ad1){return function(){ChatMessageEvents['removeListener'](_0xd3886,_0x2f1ad1);};}exports[_0x60e7('0x3')]=function(_0x35b628){for(var _0x1fb45c=0x0,_0xba29ef=events[_0x60e7('0x4')];_0x1fb45c<_0xba29ef;_0x1fb45c++){var _0x194535=events[_0x1fb45c];var _0x4a15f2=createListener(_0x60e7('0x5')+_0x194535,_0x35b628);ChatMessageEvents['on'](_0x194535,_0x4a15f2);}}; \ No newline at end of file +var _0x446c=['./chatMessage.events','save','remove','update','emit','chatMessage:'];(function(_0x4c99d0,_0x1febe1){var _0x5e541f=function(_0x6a83e5){while(--_0x6a83e5){_0x4c99d0['push'](_0x4c99d0['shift']());}};_0x5e541f(++_0x1febe1);}(_0x446c,0x156));var _0xc446=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x446c[_0x18b191];return _0x43e146;};'use strict';var ChatMessageEvents=require(_0xc446('0x0'));var events=[_0xc446('0x1'),_0xc446('0x2'),_0xc446('0x3')];function createListener(_0x48222e,_0x303cd0){return function(_0x2136f6){_0x303cd0[_0xc446('0x4')](_0x48222e,_0x2136f6);};}function removeListener(_0x570a67,_0x10047a){return function(){ChatMessageEvents['removeListener'](_0x570a67,_0x10047a);};}exports['register']=function(_0x115a9e){for(var _0x235050=0x0,_0x578895=events['length'];_0x235050<_0x578895;_0x235050++){var _0x2eea75=events[_0x235050];var _0x3e9e70=createListener(_0xc446('0x5')+_0x2eea75,_0x115a9e);ChatMessageEvents['on'](_0x2eea75,_0x3e9e70);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 39c02ee..be1c845 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 _0xe241=['create','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/:id','show','tracked','chat'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe241,0x14d));var _0x1e24=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xe241[_0x5a9c0c];return _0x53c77d;};'use strict';var multer=require(_0x1e24('0x0'));var util=require(_0x1e24('0x1'));var path=require(_0x1e24('0x2'));var timeout=require(_0x1e24('0x3'));var express=require(_0x1e24('0x4'));var router=express[_0x1e24('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1e24('0x6'));var interaction=require(_0x1e24('0x7'));var config=require(_0x1e24('0x8'));var controller=require(_0x1e24('0x9'));router['get']('/',auth[_0x1e24('0xa')](),controller[_0x1e24('0xb')]);router[_0x1e24('0xc')]('/describe',auth[_0x1e24('0xa')](),controller['describe']);router[_0x1e24('0xc')](_0x1e24('0xd'),auth[_0x1e24('0xa')](),controller[_0x1e24('0xe')]);router['post']('/',auth[_0x1e24('0xa')](),interaction[_0x1e24('0xf')](_0x1e24('0x10'),'chatmessage:create'),controller[_0x1e24('0x11')]);router[_0x1e24('0x12')](_0x1e24('0xd'),controller[_0x1e24('0x13')]);router[_0x1e24('0x12')]('/:id/accept',auth[_0x1e24('0xa')](),controller[_0x1e24('0x14')]);router[_0x1e24('0x12')](_0x1e24('0x15'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x16')]);router['delete'](_0x1e24('0xd'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x17')]);module[_0x1e24('0x18')]=router; \ No newline at end of file +var _0x8625=['multer','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','index','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0x8625,0x120));var _0x5862=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x8625[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x5862('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5862('0x1'));var router=express[_0x5862('0x2')]();var fs_extra=require(_0x5862('0x3'));var auth=require(_0x5862('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5862('0x5'));router[_0x5862('0x6')]('/',auth['isAuthenticated'](),controller[_0x5862('0x7')]);router[_0x5862('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x5862('0x8')]);router[_0x5862('0x6')](_0x5862('0x9'),auth[_0x5862('0xa')](),controller[_0x5862('0xb')]);router[_0x5862('0xc')]('/',auth['isAuthenticated'](),interaction[_0x5862('0xd')]('chat',_0x5862('0xe')),controller[_0x5862('0xf')]);router[_0x5862('0x10')](_0x5862('0x9'),controller[_0x5862('0x11')]);router['put'](_0x5862('0x12'),auth[_0x5862('0xa')](),controller[_0x5862('0x13')]);router['put'](_0x5862('0x14'),auth[_0x5862('0xa')](),controller[_0x5862('0x15')]);router[_0x5862('0x16')](_0x5862('0x9'),auth[_0x5862('0xa')](),controller['destroy']);module[_0x5862('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 5bb62d7..c54eade 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 _0xd60b=['exports','TEXT','medium'];(function(_0x207410,_0x45e49a){var _0xa8a72e=function(_0x47bf5f){while(--_0x47bf5f){_0x207410['push'](_0x207410['shift']());}};_0xa8a72e(++_0x45e49a);}(_0xd60b,0x141));var _0xbd60=function(_0x205e5c,_0x578e9b){_0x205e5c=_0x205e5c-0x0;var _0x2b2043=_0xd60b[_0x205e5c];return _0x2b2043;};'use strict';var Sequelize=require('sequelize');module[_0xbd60('0x0')]={'body':{'type':Sequelize[_0xbd60('0x1')](_0xbd60('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x916e=['medium','sequelize','TEXT'];(function(_0xcccad0,_0x3ce6e1){var _0x7f32f0=function(_0x643d){while(--_0x643d){_0xcccad0['push'](_0xcccad0['shift']());}};_0x7f32f0(++_0x3ce6e1);}(_0x916e,0x100));var _0xe916=function(_0x41c4aa,_0x339e34){_0x41c4aa=_0x41c4aa-0x0;var _0x1f6e70=_0x916e[_0x41c4aa];return _0x1f6e70;};'use strict';var Sequelize=require(_0xe916('0x0'));module['exports']={'body':{'type':Sequelize[_0xe916('0x1')](_0xe916('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9f553d7..a16283c 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(_0x1bc0d8,_0xb4e262){var _0x3cc563=function(_0x11492f){while(--_0x11492f){_0x1bc0d8['push'](_0x1bc0d8['shift']());}};_0x3cc563(++_0xb4e262);}(_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){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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7a54,0x106));var _0x47a5=function(_0x36e1bd,_0xc12b9e){_0x36e1bd=_0x36e1bd-0x0;var _0x33194c=_0x7a54[_0x36e1bd];return _0x33194c;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 803e0b1..9aad513 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 _0x3e6e=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','utf8mb4'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x3e6e,0x17b));var _0xe3e6=function(_0x478d7b,_0x594eed){_0x478d7b=_0x478d7b-0x0;var _0x5c3c15=_0x3e6e[_0x478d7b];return _0x5c3c15;};'use strict';var _=require(_0xe3e6('0x0'));var util=require(_0xe3e6('0x1'));var logger=require(_0xe3e6('0x2'))(_0xe3e6('0x3'));var moment=require(_0xe3e6('0x4'));var BPromise=require(_0xe3e6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3e6('0x6'));var rimraf=require(_0xe3e6('0x7'));var config=require(_0xe3e6('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0xe3e6('0x9')]=function(_0x1a1e6c,_0x2603ca){return _0x1a1e6c[_0xe3e6('0xa')](_0xe3e6('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3e6('0xc'),'collate':_0xe3e6('0xd')});}; \ No newline at end of file +var _0x6fc5=['moment','bluebird','path','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x6fc5,0x1eb));var _0x56fc=function(_0x533dd4,_0x5dbb36){_0x533dd4=_0x533dd4-0x0;var _0x30dcb8=_0x6fc5[_0x533dd4];return _0x30dcb8;};'use strict';var _=require(_0x56fc('0x0'));var util=require(_0x56fc('0x1'));var logger=require('../../config/logger')(_0x56fc('0x2'));var moment=require(_0x56fc('0x3'));var BPromise=require(_0x56fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56fc('0x5'));var rimraf=require('rimraf');var config=require(_0x56fc('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x56fc('0x7')]=function(_0x4e7a61,_0x5253a0){return _0x4e7a61[_0x56fc('0x8')](_0x56fc('0x9'),attributes,{'tableName':_0x56fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56fc('0xb'),'collate':_0x56fc('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 1139abe..acbccb5 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 _0xee5c=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x50af93,_0xa5631c){var _0x38a728=function(_0x2d3dfd){while(--_0x2d3dfd){_0x50af93['push'](_0x50af93['shift']());}};_0x38a728(++_0xa5631c);}(_0xee5c,0xcd));var _0xcee5=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xee5c[_0x245afe];return _0x4eefde;};'use strict';var _=require(_0xcee5('0x0'));var util=require(_0xcee5('0x1'));var moment=require('moment');var BPromise=require(_0xcee5('0x2'));var rs=require(_0xcee5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcee5('0x4'))['db'];var utils=require(_0xcee5('0x5'));var logger=require(_0xcee5('0x6'))(_0xcee5('0x7'));var config=require(_0xcee5('0x8'));var jayson=require(_0xcee5('0x9'));var client=jayson[_0xcee5('0xa')][_0xcee5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b5a8e,_0xa2caf5,_0x47c8a0){return new BPromise(function(_0xf6f9ea,_0x3da0bf){return client[_0xcee5('0xc')](_0x4b5a8e,_0x47c8a0)['then'](function(_0x3c2765){logger[_0xcee5('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa2caf5,_0xcee5('0xe'));logger[_0xcee5('0xf')](_0xcee5('0x10'),_0xa2caf5,_0xcee5('0xe'),JSON[_0xcee5('0x11')](_0x3c2765));if(_0x3c2765[_0xcee5('0x12')]){if(_0x3c2765[_0xcee5('0x12')]['code']===0x1f4){logger[_0xcee5('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa2caf5,_0x3c2765[_0xcee5('0x12')][_0xcee5('0x13')]);return _0x3da0bf(_0x3c2765['error'][_0xcee5('0x13')]);}logger[_0xcee5('0x12')](_0xcee5('0x14'),_0xa2caf5,_0x3c2765[_0xcee5('0x12')][_0xcee5('0x13')]);return _0xf6f9ea(_0x3c2765[_0xcee5('0x12')][_0xcee5('0x13')]);}else{logger['info'](_0xcee5('0x14'),_0xa2caf5,_0xcee5('0xe'));_0xf6f9ea(_0x3c2765[_0xcee5('0x15')]['message']);}})[_0xcee5('0x16')](function(_0x43df75){logger[_0xcee5('0x12')](_0xcee5('0x14'),_0xa2caf5,_0x43df75);_0x3da0bf(_0x43df75);});});} \ No newline at end of file +var _0x5562=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x353acc,_0x10c8b3){var _0x372c9a=function(_0x12ec84){while(--_0x12ec84){_0x353acc['push'](_0x353acc['shift']());}};_0x372c9a(++_0x10c8b3);}(_0x5562,0x8b));var _0x2556=function(_0x11a741,_0x1e7097){_0x11a741=_0x11a741-0x0;var _0xa466f6=_0x5562[_0x11a741];return _0xa466f6;};'use strict';var _=require(_0x2556('0x0'));var util=require(_0x2556('0x1'));var moment=require(_0x2556('0x2'));var BPromise=require(_0x2556('0x3'));var rs=require(_0x2556('0x4'));var fs=require('fs');var Redis=require(_0x2556('0x5'));var db=require(_0x2556('0x6'))['db'];var utils=require(_0x2556('0x7'));var logger=require(_0x2556('0x8'))(_0x2556('0x9'));var config=require('../../config/environment');var jayson=require(_0x2556('0xa'));var client=jayson[_0x2556('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45ad14,_0xfa7c05,_0x106e36){return new BPromise(function(_0x1d5a4d,_0x55b63b){return client[_0x2556('0xc')](_0x45ad14,_0x106e36)[_0x2556('0xd')](function(_0x2a6617){logger[_0x2556('0xe')](_0x2556('0xf'),_0xfa7c05,_0x2556('0x10'));logger[_0x2556('0x11')](_0x2556('0x12'),_0xfa7c05,_0x2556('0x10'),JSON['stringify'](_0x2a6617));if(_0x2a6617['error']){if(_0x2a6617[_0x2556('0x13')][_0x2556('0x14')]===0x1f4){logger[_0x2556('0x13')](_0x2556('0xf'),_0xfa7c05,_0x2a6617[_0x2556('0x13')][_0x2556('0x15')]);return _0x55b63b(_0x2a6617[_0x2556('0x13')][_0x2556('0x15')]);}logger[_0x2556('0x13')](_0x2556('0xf'),_0xfa7c05,_0x2a6617['error'][_0x2556('0x15')]);return _0x1d5a4d(_0x2a6617[_0x2556('0x13')][_0x2556('0x15')]);}else{logger[_0x2556('0xe')](_0x2556('0xf'),_0xfa7c05,_0x2556('0x10'));_0x1d5a4d(_0x2a6617[_0x2556('0x16')][_0x2556('0x15')]);}})['catch'](function(_0x46c92a){logger[_0x2556('0x13')](_0x2556('0xf'),_0xfa7c05,_0x46c92a);_0x55b63b(_0x46c92a);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c8459b5..fc832f3 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 _0xb509=['update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','post','put'];(function(_0x45835a,_0xea3c83){var _0x4cf332=function(_0x3c1dcc){while(--_0x3c1dcc){_0x45835a['push'](_0x45835a['shift']());}};_0x4cf332(++_0xea3c83);}(_0xb509,0x156));var _0x9b50=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xb509[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0x9b50('0x0'));var util=require(_0x9b50('0x1'));var path=require('path');var timeout=require(_0x9b50('0x2'));var express=require(_0x9b50('0x3'));var router=express[_0x9b50('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b50('0x5'));var interaction=require(_0x9b50('0x6'));var config=require('../../config/environment');var controller=require(_0x9b50('0x7'));router[_0x9b50('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b50('0x9')]);router['get']('/describe',auth[_0x9b50('0xa')](),controller[_0x9b50('0xb')]);router[_0x9b50('0x8')](_0x9b50('0xc'),auth[_0x9b50('0xa')](),controller['show']);router[_0x9b50('0xd')]('/',auth[_0x9b50('0xa')](),controller['create']);router[_0x9b50('0xe')](_0x9b50('0xc'),auth[_0x9b50('0xa')](),controller[_0x9b50('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9b50('0x10')]=router; \ No newline at end of file +var _0x3389=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x20006a,_0x30e3a9){var _0x5e26ac=function(_0x16ca0a){while(--_0x16ca0a){_0x20006a['push'](_0x20006a['shift']());}};_0x5e26ac(++_0x30e3a9);}(_0x3389,0x1ce));var _0x9338=function(_0x6cba0,_0x3fc7f0){_0x6cba0=_0x6cba0-0x0;var _0x1e1a6d=_0x3389[_0x6cba0];return _0x1e1a6d;};'use strict';var multer=require(_0x9338('0x0'));var util=require('util');var path=require(_0x9338('0x1'));var timeout=require(_0x9338('0x2'));var express=require(_0x9338('0x3'));var router=express[_0x9338('0x4')]();var fs_extra=require(_0x9338('0x5'));var auth=require(_0x9338('0x6'));var interaction=require(_0x9338('0x7'));var config=require(_0x9338('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x9338('0x9')]('/',auth[_0x9338('0xa')](),controller[_0x9338('0xb')]);router[_0x9338('0x9')](_0x9338('0xc'),auth[_0x9338('0xa')](),controller['describe']);router['get'](_0x9338('0xd'),auth[_0x9338('0xa')](),controller[_0x9338('0xe')]);router[_0x9338('0xf')]('/',auth[_0x9338('0xa')](),controller[_0x9338('0x10')]);router[_0x9338('0x11')](_0x9338('0xd'),auth[_0x9338('0xa')](),controller[_0x9338('0x12')]);router[_0x9338('0x13')](_0x9338('0xd'),auth[_0x9338('0xa')](),controller[_0x9338('0x14')]);module[_0x9338('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 2148960..2a51ce1 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 _0x7b56=['mouseOver','timeout','INTEGER','exports','STRING','ENUM'];(function(_0x5c42b1,_0x45e32f){var _0xd0137d=function(_0x2b5c65){while(--_0x2b5c65){_0x5c42b1['push'](_0x5c42b1['shift']());}};_0xd0137d(++_0x45e32f);}(_0x7b56,0x1b3));var _0x67b5=function(_0x54e72d,_0x45fa23){_0x54e72d=_0x54e72d-0x0;var _0x54f6af=_0x7b56[_0x54e72d];return _0x54f6af;};'use strict';var Sequelize=require('sequelize');module[_0x67b5('0x0')]={'name':{'type':Sequelize[_0x67b5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x67b5('0x2')](_0x67b5('0x3'),_0x67b5('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x67b5('0x1')]},'timeout':{'type':Sequelize[_0x67b5('0x5')]}}; \ No newline at end of file +var _0x50d6=['INTEGER','STRING','ENUM','mouseOver','timeout'];(function(_0x454d07,_0x17aa08){var _0x4e0a61=function(_0x54dd3c){while(--_0x54dd3c){_0x454d07['push'](_0x454d07['shift']());}};_0x4e0a61(++_0x17aa08);}(_0x50d6,0x1dc));var _0x650d=function(_0x1d7cc3,_0x5dfffe){_0x1d7cc3=_0x1d7cc3-0x0;var _0x4468ae=_0x50d6[_0x1d7cc3];return _0x4468ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x650d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x650d('0x1')](_0x650d('0x2'),_0x650d('0x3')),'defaultValue':_0x650d('0x2')},'selector':{'type':Sequelize[_0x650d('0x0')]},'timeout':{'type':Sequelize[_0x650d('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 816d1eb..efcba99 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 _0x00b3=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','show','params','model','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','merge','options','find','catch','ChatProactiveAction','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3e6775,_0x548f27){var _0x30c838=function(_0x3d8e4c){while(--_0x3d8e4c){_0x3e6775['push'](_0x3e6775['shift']());}};_0x30c838(++_0x548f27);}(_0x00b3,0x97));var _0x300b=function(_0x59d356,_0x49e201){_0x59d356=_0x59d356-0x0;var _0x399479=_0x00b3[_0x59d356];return _0x399479;};'use strict';var emlformat=require(_0x300b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x300b('0x1'));var rp=require(_0x300b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x300b('0x3'));var util=require(_0x300b('0x4'));var path=require(_0x300b('0x5'));var sox=require('sox');var csv=require(_0x300b('0x6'));var ejs=require(_0x300b('0x7'));var fs=require('fs');var fs_extra=require(_0x300b('0x8'));var _=require(_0x300b('0x9'));var squel=require(_0x300b('0xa'));var crypto=require(_0x300b('0xb'));var jsforce=require(_0x300b('0xc'));var deskjs=require(_0x300b('0xd'));var toCsv=require(_0x300b('0x6'));var querystring=require(_0x300b('0xe'));var Papa=require(_0x300b('0xf'));var Redis=require(_0x300b('0x10'));var authService=require(_0x300b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x300b('0x12'));var hardwareService=require(_0x300b('0x13'));var logger=require(_0x300b('0x14'))('api');var utils=require(_0x300b('0x15'));var config=require(_0x300b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12da4c,_0x51b8fc){_0x51b8fc=_0x51b8fc||0xcc;return function(_0x12b3b0){if(_0x12b3b0){return _0x12da4c[_0x300b('0x17')](_0x51b8fc);}return _0x12da4c[_0x300b('0x18')](_0x51b8fc)[_0x300b('0x19')]();};}function respondWithResult(_0x3c9f85,_0x1edb37){_0x1edb37=_0x1edb37||0xc8;return function(_0x5c507b){if(_0x5c507b){return _0x3c9f85['status'](_0x1edb37)[_0x300b('0x1a')](_0x5c507b);}};}function respondWithFilteredResult(_0x29f231,_0x14cba0){return function(_0x19ac43){if(_0x19ac43){var _0x349a29=typeof _0x14cba0[_0x300b('0x1b')]===_0x300b('0x1c')&&typeof _0x14cba0[_0x300b('0x1d')]==='undefined';var _0x41cde4=_0x19ac43[_0x300b('0x1e')];var _0x5b812f=_0x349a29?0x0:_0x14cba0[_0x300b('0x1b')];var _0x2fe0db=_0x349a29?_0x19ac43[_0x300b('0x1e')]:_0x14cba0[_0x300b('0x1b')]+_0x14cba0['limit'];var _0x1c79d7;if(_0x2fe0db>=_0x41cde4){_0x2fe0db=_0x41cde4;_0x1c79d7=0xc8;}else{_0x1c79d7=0xce;}_0x29f231[_0x300b('0x18')](_0x1c79d7);return _0x29f231[_0x300b('0x1f')](_0x300b('0x20'),_0x5b812f+'-'+_0x2fe0db+'/'+_0x41cde4)['json'](_0x19ac43);}return null;};}function patchUpdates(_0x57f111){return function(_0x5d60c0){try{jsonpatch['apply'](_0x5d60c0,_0x57f111,!![]);}catch(_0x7853ee){return BPromise[_0x300b('0x21')](_0x7853ee);}return _0x5d60c0[_0x300b('0x22')]();};}function saveUpdates(_0x466d2e,_0x5e7937){return function(_0x2724de){if(_0x2724de){return _0x2724de[_0x300b('0x23')](_0x466d2e)[_0x300b('0x24')](function(_0x3b4eee){return _0x3b4eee;});}return null;};}function removeEntity(_0x3a87d7,_0x5e4093){return function(_0x105982){if(_0x105982){return _0x105982[_0x300b('0x25')]()[_0x300b('0x24')](function(){_0x3a87d7[_0x300b('0x18')](0xcc)[_0x300b('0x19')]();});}};}function handleEntityNotFound(_0x473bfd,_0x21b8cf){return function(_0xa913e8){if(!_0xa913e8){_0x473bfd[_0x300b('0x17')](0x194);}return _0xa913e8;};}function handleError(_0x59cecc,_0x5385e6){_0x5385e6=_0x5385e6||0x1f4;return function(_0xaa84aa){logger['error'](_0xaa84aa[_0x300b('0x26')]);if(_0xaa84aa[_0x300b('0x27')]){delete _0xaa84aa[_0x300b('0x27')];}_0x59cecc[_0x300b('0x18')](_0x5385e6)['send'](_0xaa84aa);};}exports[_0x300b('0x28')]=function(_0xb2cf4d,_0x4fcf53){var _0x9eb721={'raw':!![],'where':{'id':_0xb2cf4d[_0x300b('0x29')]['id']}},_0x1cff38={};_0x1cff38[_0x300b('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x300b('0x2b')]);_0x1cff38[_0x300b('0x2c')]=_[_0x300b('0x2d')](_0xb2cf4d['query']);_0x1cff38['filters']=_[_0x300b('0x2e')](_0x1cff38[_0x300b('0x2a')],_0x1cff38[_0x300b('0x2c')]);_0x9eb721[_0x300b('0x2f')]=_[_0x300b('0x2e')](_0x1cff38[_0x300b('0x2a')],qs['fields'](_0xb2cf4d[_0x300b('0x2c')][_0x300b('0x30')]));_0x9eb721[_0x300b('0x2f')]=_0x9eb721[_0x300b('0x2f')][_0x300b('0x31')]?_0x9eb721['attributes']:_0x1cff38['model'];if(_0xb2cf4d[_0x300b('0x2c')][_0x300b('0x32')]){_0x9eb721['include']=[{'all':!![]}];}_0x9eb721=_[_0x300b('0x33')]({},_0x9eb721,_0xb2cf4d[_0x300b('0x34')]);return db['ChatProactiveAction'][_0x300b('0x35')](_0x9eb721)['then'](handleEntityNotFound(_0x4fcf53,null))[_0x300b('0x24')](respondWithResult(_0x4fcf53,null))[_0x300b('0x36')](handleError(_0x4fcf53,null));};exports['create']=function(_0x32e17b,_0x1398a3){return db[_0x300b('0x37')][_0x300b('0x38')](_0x32e17b[_0x300b('0x39')],{})[_0x300b('0x24')](respondWithResult(_0x1398a3,0xc9))[_0x300b('0x36')](handleError(_0x1398a3,null));};exports[_0x300b('0x23')]=function(_0xe296fb,_0x3128ec){if(_0xe296fb[_0x300b('0x39')]['id']){delete _0xe296fb[_0x300b('0x39')]['id'];}return db['ChatProactiveAction'][_0x300b('0x35')]({'where':{'id':_0xe296fb['params']['id']}})['then'](handleEntityNotFound(_0x3128ec,null))[_0x300b('0x24')](saveUpdates(_0xe296fb[_0x300b('0x39')],null))['then'](respondWithResult(_0x3128ec,null))[_0x300b('0x36')](handleError(_0x3128ec,null));};exports['destroy']=function(_0x1c68b4,_0x42b8ff){return db['ChatProactiveAction'][_0x300b('0x35')]({'where':{'id':_0x1c68b4[_0x300b('0x29')]['id']}})[_0x300b('0x24')](handleEntityNotFound(_0x42b8ff,null))[_0x300b('0x24')](removeEntity(_0x42b8ff,null))[_0x300b('0x36')](handleError(_0x42b8ff,null));}; \ No newline at end of file +var _0x2029=['sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','show','params','model','keys','ChatProactiveAction','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5e3062,_0x1ab8cd){var _0x103354=function(_0x19b220){while(--_0x19b220){_0x5e3062['push'](_0x5e3062['shift']());}};_0x103354(++_0x1ab8cd);}(_0x2029,0x171));var _0x9202=function(_0x596bf2,_0x3ce472){_0x596bf2=_0x596bf2-0x0;var _0x21bf73=_0x2029[_0x596bf2];return _0x21bf73;};'use strict';var emlformat=require(_0x9202('0x0'));var rimraf=require(_0x9202('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9202('0x2'));var rp=require(_0x9202('0x3'));var moment=require(_0x9202('0x4'));var BPromise=require(_0x9202('0x5'));var Mustache=require(_0x9202('0x6'));var util=require(_0x9202('0x7'));var path=require(_0x9202('0x8'));var sox=require(_0x9202('0x9'));var csv=require(_0x9202('0xa'));var ejs=require(_0x9202('0xb'));var fs=require('fs');var fs_extra=require(_0x9202('0xc'));var _=require(_0x9202('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9202('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9202('0xa'));var querystring=require(_0x9202('0xf'));var Papa=require('papaparse');var Redis=require(_0x9202('0x10'));var authService=require(_0x9202('0x11'));var qs=require(_0x9202('0x12'));var as=require(_0x9202('0x13'));var hardwareService=require(_0x9202('0x14'));var logger=require(_0x9202('0x15'))(_0x9202('0x16'));var utils=require(_0x9202('0x17'));var config=require(_0x9202('0x18'));var licenseUtil=require(_0x9202('0x19'));var db=require(_0x9202('0x1a'))['db'];function respondWithStatusCode(_0x38e2f5,_0x2624d6){_0x2624d6=_0x2624d6||0xcc;return function(_0x946c29){if(_0x946c29){return _0x38e2f5[_0x9202('0x1b')](_0x2624d6);}return _0x38e2f5[_0x9202('0x1c')](_0x2624d6)[_0x9202('0x1d')]();};}function respondWithResult(_0x597e0f,_0x45cec7){_0x45cec7=_0x45cec7||0xc8;return function(_0x24e8fe){if(_0x24e8fe){return _0x597e0f[_0x9202('0x1c')](_0x45cec7)[_0x9202('0x1e')](_0x24e8fe);}};}function respondWithFilteredResult(_0x24e938,_0x141a17){return function(_0x1ca7a3){if(_0x1ca7a3){var _0x1bb4c1=typeof _0x141a17[_0x9202('0x1f')]===_0x9202('0x20')&&typeof _0x141a17['limit']===_0x9202('0x20');var _0x1c3243=_0x1ca7a3[_0x9202('0x21')];var _0x1222b6=_0x1bb4c1?0x0:_0x141a17[_0x9202('0x1f')];var _0x1aad83=_0x1bb4c1?_0x1ca7a3[_0x9202('0x21')]:_0x141a17[_0x9202('0x1f')]+_0x141a17[_0x9202('0x22')];var _0x5c6d53;if(_0x1aad83>=_0x1c3243){_0x1aad83=_0x1c3243;_0x5c6d53=0xc8;}else{_0x5c6d53=0xce;}_0x24e938['status'](_0x5c6d53);return _0x24e938[_0x9202('0x23')](_0x9202('0x24'),_0x1222b6+'-'+_0x1aad83+'/'+_0x1c3243)[_0x9202('0x1e')](_0x1ca7a3);}return null;};}function patchUpdates(_0x10a556){return function(_0x520f98){try{jsonpatch[_0x9202('0x25')](_0x520f98,_0x10a556,!![]);}catch(_0x54548c){return BPromise[_0x9202('0x26')](_0x54548c);}return _0x520f98[_0x9202('0x27')]();};}function saveUpdates(_0x57585e,_0x41e19d){return function(_0x4ba6f2){if(_0x4ba6f2){return _0x4ba6f2[_0x9202('0x28')](_0x57585e)[_0x9202('0x29')](function(_0x11c059){return _0x11c059;});}return null;};}function removeEntity(_0x35fbf8,_0x2cdeb8){return function(_0xf535c6){if(_0xf535c6){return _0xf535c6[_0x9202('0x2a')]()['then'](function(){_0x35fbf8[_0x9202('0x1c')](0xcc)[_0x9202('0x1d')]();});}};}function handleEntityNotFound(_0x2dab50,_0x2f4988){return function(_0x3e722a){if(!_0x3e722a){_0x2dab50[_0x9202('0x1b')](0x194);}return _0x3e722a;};}function handleError(_0x547328,_0x42756e){_0x42756e=_0x42756e||0x1f4;return function(_0x2484ef){logger[_0x9202('0x2b')](_0x2484ef['stack']);if(_0x2484ef['name']){delete _0x2484ef['name'];}_0x547328[_0x9202('0x1c')](_0x42756e)[_0x9202('0x2c')](_0x2484ef);};}exports[_0x9202('0x2d')]=function(_0x5459a0,_0x195589){var _0x5e9ca2={'raw':!![],'where':{'id':_0x5459a0[_0x9202('0x2e')]['id']}},_0x35186d={};_0x35186d[_0x9202('0x2f')]=_[_0x9202('0x30')](db[_0x9202('0x31')]['rawAttributes']);_0x35186d[_0x9202('0x32')]=_['keys'](_0x5459a0[_0x9202('0x32')]);_0x35186d[_0x9202('0x33')]=_['intersection'](_0x35186d['model'],_0x35186d['query']);_0x5e9ca2[_0x9202('0x34')]=_[_0x9202('0x35')](_0x35186d[_0x9202('0x2f')],qs[_0x9202('0x36')](_0x5459a0['query'][_0x9202('0x36')]));_0x5e9ca2[_0x9202('0x34')]=_0x5e9ca2[_0x9202('0x34')]['length']?_0x5e9ca2[_0x9202('0x34')]:_0x35186d[_0x9202('0x2f')];if(_0x5459a0[_0x9202('0x32')][_0x9202('0x37')]){_0x5e9ca2[_0x9202('0x38')]=[{'all':!![]}];}_0x5e9ca2=_[_0x9202('0x39')]({},_0x5e9ca2,_0x5459a0[_0x9202('0x3a')]);return db[_0x9202('0x31')][_0x9202('0x3b')](_0x5e9ca2)[_0x9202('0x29')](handleEntityNotFound(_0x195589,null))[_0x9202('0x29')](respondWithResult(_0x195589,null))[_0x9202('0x3c')](handleError(_0x195589,null));};exports[_0x9202('0x3d')]=function(_0x571d96,_0x227f47){return db[_0x9202('0x31')]['create'](_0x571d96[_0x9202('0x3e')],{})['then'](respondWithResult(_0x227f47,0xc9))[_0x9202('0x3c')](handleError(_0x227f47,null));};exports[_0x9202('0x28')]=function(_0x3308e4,_0x3c4c1f){if(_0x3308e4[_0x9202('0x3e')]['id']){delete _0x3308e4['body']['id'];}return db[_0x9202('0x31')]['find']({'where':{'id':_0x3308e4[_0x9202('0x2e')]['id']}})[_0x9202('0x29')](handleEntityNotFound(_0x3c4c1f,null))[_0x9202('0x29')](saveUpdates(_0x3308e4[_0x9202('0x3e')],null))['then'](respondWithResult(_0x3c4c1f,null))['catch'](handleError(_0x3c4c1f,null));};exports['destroy']=function(_0x2260b1,_0x40ee01){return db[_0x9202('0x31')][_0x9202('0x3b')]({'where':{'id':_0x2260b1[_0x9202('0x2e')]['id']}})['then'](handleEntityNotFound(_0x40ee01,null))[_0x9202('0x29')](removeEntity(_0x40ee01,null))[_0x9202('0x3c')](handleError(_0x40ee01,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 425a90c..7f81ab0 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 _0x5b46=['../../config/logger','moment','bluebird','path','rimraf','exports','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x1348bc,_0x344bb9){var _0x1d306f=function(_0x3642ff){while(--_0x3642ff){_0x1348bc['push'](_0x1348bc['shift']());}};_0x1d306f(++_0x344bb9);}(_0x5b46,0x1ca));var _0x65b4=function(_0x20e99c,_0x186f65){_0x20e99c=_0x20e99c-0x0;var _0x17ade5=_0x5b46[_0x20e99c];return _0x17ade5;};'use strict';var _=require('lodash');var util=require(_0x65b4('0x0'));var logger=require(_0x65b4('0x1'))('api');var moment=require(_0x65b4('0x2'));var BPromise=require(_0x65b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65b4('0x4'));var rimraf=require(_0x65b4('0x5'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x65b4('0x6')]=function(_0x261acd,_0x1680f0){return _0x261acd['define'](_0x65b4('0x7'),attributes,{'tableName':_0x65b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbce8=['../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54cc28,_0x1f0eac){var _0x1adbe6=function(_0x1ea4a9){while(--_0x1ea4a9){_0x54cc28['push'](_0x54cc28['shift']());}};_0x1adbe6(++_0x1f0eac);}(_0xbce8,0x1be));var _0x8bce=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0xbce8[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0x8bce('0x0'));var util=require(_0x8bce('0x1'));var logger=require(_0x8bce('0x2'))(_0x8bce('0x3'));var moment=require(_0x8bce('0x4'));var BPromise=require(_0x8bce('0x5'));var rp=require(_0x8bce('0x6'));var fs=require('fs');var path=require(_0x8bce('0x7'));var rimraf=require(_0x8bce('0x8'));var config=require(_0x8bce('0x9'));var attributes=require(_0x8bce('0xa'));module[_0x8bce('0xb')]=function(_0x4d7c21,_0x1c6cfd){return _0x4d7c21['define'](_0x8bce('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 b70326a..8df43fb 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 _0x3743=['error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3743,0x8a));var _0x3374=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0x3743[_0x54a761];return _0x37d1da;};'use strict';var _=require('lodash');var util=require(_0x3374('0x0'));var moment=require(_0x3374('0x1'));var BPromise=require(_0x3374('0x2'));var rs=require(_0x3374('0x3'));var fs=require('fs');var Redis=require(_0x3374('0x4'));var db=require(_0x3374('0x5'))['db'];var utils=require(_0x3374('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3374('0x7'));var jayson=require(_0x3374('0x8'));var client=jayson[_0x3374('0x9')][_0x3374('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a7c27,_0x34ee3e,_0x4a98ed){return new BPromise(function(_0xb13a97,_0x440b1c){return client[_0x3374('0xb')](_0x4a7c27,_0x4a98ed)['then'](function(_0x1e0f33){logger['info'](_0x3374('0xc'),_0x34ee3e,_0x3374('0xd'));logger['debug'](_0x3374('0xe'),_0x34ee3e,_0x3374('0xd'),JSON[_0x3374('0xf')](_0x1e0f33));if(_0x1e0f33[_0x3374('0x10')]){if(_0x1e0f33[_0x3374('0x10')][_0x3374('0x11')]===0x1f4){logger[_0x3374('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x34ee3e,_0x1e0f33[_0x3374('0x10')][_0x3374('0x12')]);return _0x440b1c(_0x1e0f33[_0x3374('0x10')]['message']);}logger[_0x3374('0x10')](_0x3374('0xc'),_0x34ee3e,_0x1e0f33[_0x3374('0x10')][_0x3374('0x12')]);return _0xb13a97(_0x1e0f33['error'][_0x3374('0x12')]);}else{logger[_0x3374('0x13')](_0x3374('0xc'),_0x34ee3e,_0x3374('0xd'));_0xb13a97(_0x1e0f33[_0x3374('0x14')][_0x3374('0x12')]);}})[_0x3374('0x15')](function(_0x5d0bb2){logger[_0x3374('0x10')](_0x3374('0xc'),_0x34ee3e,_0x5d0bb2);_0x440b1c(_0x5d0bb2);});});} \ No newline at end of file +var _0x970c=['client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ed383,_0x5cd212){var _0x135bf3=function(_0x3096e4){while(--_0x3096e4){_0x4ed383['push'](_0x4ed383['shift']());}};_0x135bf3(++_0x5cd212);}(_0x970c,0xce));var _0xc970=function(_0x342038,_0x19c2ee){_0x342038=_0x342038-0x0;var _0x13aa30=_0x970c[_0x342038];return _0x13aa30;};'use strict';var _=require(_0xc970('0x0'));var util=require('util');var moment=require(_0xc970('0x1'));var BPromise=require(_0xc970('0x2'));var rs=require(_0xc970('0x3'));var fs=require('fs');var Redis=require(_0xc970('0x4'));var db=require(_0xc970('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc970('0x6'))(_0xc970('0x7'));var config=require(_0xc970('0x8'));var jayson=require(_0xc970('0x9'));var client=jayson[_0xc970('0xa')][_0xc970('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44da5d,_0x55b499,_0x13a9ce){return new BPromise(function(_0x37e129,_0x22e0c7){return client[_0xc970('0xc')](_0x44da5d,_0x13a9ce)[_0xc970('0xd')](function(_0x18555c){logger[_0xc970('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x55b499,'request\x20sent');logger[_0xc970('0xf')](_0xc970('0x10'),_0x55b499,_0xc970('0x11'),JSON['stringify'](_0x18555c));if(_0x18555c['error']){if(_0x18555c[_0xc970('0x12')][_0xc970('0x13')]===0x1f4){logger['error'](_0xc970('0x14'),_0x55b499,_0x18555c[_0xc970('0x12')][_0xc970('0x15')]);return _0x22e0c7(_0x18555c['error'][_0xc970('0x15')]);}logger[_0xc970('0x12')](_0xc970('0x14'),_0x55b499,_0x18555c[_0xc970('0x12')]['message']);return _0x37e129(_0x18555c[_0xc970('0x12')][_0xc970('0x15')]);}else{logger[_0xc970('0xe')](_0xc970('0x14'),_0x55b499,_0xc970('0x11'));_0x37e129(_0x18555c[_0xc970('0x16')][_0xc970('0x15')]);}})[_0xc970('0x17')](function(_0xbfb7d1){logger[_0xc970('0x12')](_0xc970('0x14'),_0x55b499,_0xbfb7d1);_0x22e0c7(_0xbfb7d1);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index eddf110..ff9fae7 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 _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x12db5b,_0x17dec0){var _0xf0f483=function(_0x37a8e6){while(--_0x37a8e6){_0x12db5b['push'](_0x12db5b['shift']());}};_0xf0f483(++_0x17dec0);}(_0xed1f,0x6a));var _0xfed1=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xed1f[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x17b8a9,_0x3bbf58){var _0x4add80=function(_0x683126){while(--_0x683126){_0x17b8a9['push'](_0x17b8a9['shift']());}};_0x4add80(++_0x3bbf58);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 9601d89..6e9f10f 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 _0x751a=['ENUM','rrmemory','sequelize','name','STRING','INTEGER'];(function(_0x4b84cd,_0x544959){var _0x360de2=function(_0x5a74e0){while(--_0x5a74e0){_0x4b84cd['push'](_0x4b84cd['shift']());}};_0x360de2(++_0x544959);}(_0x751a,0x194));var _0xa751=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x751a[_0x420b24];return _0x4da552;};'use strict';var Sequelize=require(_0xa751('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa751('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa751('0x2')]},'timeout':{'type':Sequelize[_0xa751('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa751('0x4')](_0xa751('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x1582=['beepall','sequelize','STRING','name','INTEGER','rrmemory'];(function(_0x3a4838,_0x5eb63c){var _0x10fc53=function(_0x23e650){while(--_0x23e650){_0x3a4838['push'](_0x3a4838['shift']());}};_0x10fc53(++_0x5eb63c);}(_0x1582,0x9d));var _0x2158=function(_0x32e2f3,_0x5c9fe7){_0x32e2f3=_0x32e2f3-0x0;var _0xcc7735=_0x1582[_0x32e2f3];return _0xcc7735;};'use strict';var Sequelize=require(_0x2158('0x0'));module['exports']={'name':{'type':Sequelize[_0x2158('0x1')],'unique':_0x2158('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2158('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2158('0x4'),_0x2158('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f0a7432..b26e0a4 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 _0xefcd=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','show','params','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserChatQueue','rawAttributes','nolimit','ChatQueueId','findAll','User','findAndCountAll','agent','createdAt','rows','format','%s/%s','SIP','chatPause','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x1bf181,_0x58dab5){var _0x4cedef=function(_0x471fe4){while(--_0x471fe4){_0x1bf181['push'](_0x1bf181['shift']());}};_0x4cedef(++_0x58dab5);}(_0xefcd,0x1c1));var _0xdefc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xefcd[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xdefc('0x0'));var rimraf=require(_0xdefc('0x1'));var zipdir=require(_0xdefc('0x2'));var jsonpatch=require(_0xdefc('0x3'));var rp=require(_0xdefc('0x4'));var moment=require('moment');var BPromise=require(_0xdefc('0x5'));var Mustache=require('mustache');var util=require(_0xdefc('0x6'));var path=require('path');var sox=require(_0xdefc('0x7'));var csv=require(_0xdefc('0x8'));var ejs=require(_0xdefc('0x9'));var fs=require('fs');var fs_extra=require(_0xdefc('0xa'));var _=require(_0xdefc('0xb'));var squel=require(_0xdefc('0xc'));var crypto=require(_0xdefc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdefc('0xe'));var Papa=require(_0xdefc('0xf'));var Redis=require(_0xdefc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdefc('0x11'));var as=require(_0xdefc('0x12'));var hardwareService=require(_0xdefc('0x13'));var logger=require(_0xdefc('0x14'))(_0xdefc('0x15'));var utils=require(_0xdefc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdefc('0x17'));var db=require('../../mysqldb')['db'];config[_0xdefc('0x18')]=_[_0xdefc('0x19')](config['redis'],{'host':_0xdefc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdefc('0x18')]));require(_0xdefc('0x1b'))[_0xdefc('0x1c')](socket);var jayson=require(_0xdefc('0x1d'));var client=jayson[_0xdefc('0x1e')][_0xdefc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x191bc6,_0x55a5c7,_0xf77ba5,_0x3a4985){return new BPromise(function(_0x470e93,_0x38e3f5){var _0x58de56=_0x3a4985||client;return _0x58de56[_0xdefc('0x20')](_0x191bc6,_0xf77ba5)[_0xdefc('0x21')](function(_0x33e887){logger[_0xdefc('0x22')](_0xdefc('0x23'),_0x55a5c7,_0xdefc('0x24'));logger[_0xdefc('0x25')](_0xdefc('0x26'),_0x55a5c7,_0xdefc('0x24'),JSON[_0xdefc('0x27')](_0x33e887));if(_0x33e887[_0xdefc('0x28')]){if(_0x33e887['error'][_0xdefc('0x29')]===0x1f4){logger[_0xdefc('0x28')](_0xdefc('0x23'),_0x55a5c7,_0x33e887[_0xdefc('0x28')]['message']);return _0x38e3f5(_0x33e887[_0xdefc('0x28')][_0xdefc('0x2a')]);}logger[_0xdefc('0x28')](_0xdefc('0x23'),_0x55a5c7,_0x33e887[_0xdefc('0x28')][_0xdefc('0x2a')]);return _0x470e93(_0x33e887[_0xdefc('0x28')][_0xdefc('0x2a')]);}else{logger[_0xdefc('0x22')](_0xdefc('0x23'),_0x55a5c7,_0xdefc('0x24'));_0x470e93(_0x33e887[_0xdefc('0x2b')][_0xdefc('0x2a')]);}})[_0xdefc('0x2c')](function(_0x33b985){logger[_0xdefc('0x28')]('ChatQueue,\x20%s,\x20%s',_0x55a5c7,_0x33b985);_0x38e3f5(_0x33b985);});});}function respondWithStatusCode(_0x4dbb11,_0x5d984c){_0x5d984c=_0x5d984c||0xcc;return function(_0x8e9748){if(_0x8e9748){return _0x4dbb11[_0xdefc('0x2d')](_0x5d984c);}return _0x4dbb11[_0xdefc('0x2e')](_0x5d984c)[_0xdefc('0x2f')]();};}function respondWithResult(_0x281e81,_0x15bfcb){_0x15bfcb=_0x15bfcb||0xc8;return function(_0x4f254a){if(_0x4f254a){return _0x281e81['status'](_0x15bfcb)[_0xdefc('0x30')](_0x4f254a);}};}function respondWithFilteredResult(_0x2fe0c6,_0xa0c77c){return function(_0x4c8b73){if(_0x4c8b73){var _0xdce4a6=typeof _0xa0c77c[_0xdefc('0x31')]===_0xdefc('0x32')&&typeof _0xa0c77c[_0xdefc('0x33')]==='undefined';var _0x56baa4=_0x4c8b73['count'];var _0x484323=_0xdce4a6?0x0:_0xa0c77c[_0xdefc('0x31')];var _0x133057=_0xdce4a6?_0x4c8b73[_0xdefc('0x34')]:_0xa0c77c[_0xdefc('0x31')]+_0xa0c77c[_0xdefc('0x33')];var _0x405875;if(_0x133057>=_0x56baa4){_0x133057=_0x56baa4;_0x405875=0xc8;}else{_0x405875=0xce;}_0x2fe0c6['status'](_0x405875);return _0x2fe0c6[_0xdefc('0x35')](_0xdefc('0x36'),_0x484323+'-'+_0x133057+'/'+_0x56baa4)[_0xdefc('0x30')](_0x4c8b73);}return null;};}function patchUpdates(_0x513235){return function(_0x5df253){try{jsonpatch[_0xdefc('0x37')](_0x5df253,_0x513235,!![]);}catch(_0x2f296d){return BPromise[_0xdefc('0x38')](_0x2f296d);}return _0x5df253[_0xdefc('0x39')]();};}function saveUpdates(_0xf47c72,_0x125048){return function(_0x23f508){if(_0x23f508){return _0x23f508['update'](_0xf47c72)[_0xdefc('0x21')](function(_0x1b890c){return _0x1b890c;});}return null;};}function removeEntity(_0xbab6cc,_0x5b895c){return function(_0x47bb3f){if(_0x47bb3f){return _0x47bb3f[_0xdefc('0x3a')]()[_0xdefc('0x21')](function(){var _0x164ac0=_0x47bb3f[_0xdefc('0x3b')]({'plain':!![]});var _0x23cd5b=_0xdefc('0x3c');return db[_0xdefc('0x3d')]['destroy']({'where':{'type':_0x23cd5b,'resourceId':_0x164ac0['id']}})[_0xdefc('0x21')](function(){return _0x47bb3f;});})[_0xdefc('0x21')](function(){_0xbab6cc[_0xdefc('0x2e')](0xcc)[_0xdefc('0x2f')]();});}};}function handleEntityNotFound(_0x5cc6c4,_0x25b753){return function(_0x40ab5d){if(!_0x40ab5d){_0x5cc6c4['sendStatus'](0x194);}return _0x40ab5d;};}function handleError(_0x2e23e8,_0x2267d1){_0x2267d1=_0x2267d1||0x1f4;return function(_0x4089fe){logger[_0xdefc('0x28')](_0x4089fe[_0xdefc('0x3e')]);if(_0x4089fe[_0xdefc('0x3f')]){delete _0x4089fe['name'];}_0x2e23e8[_0xdefc('0x2e')](_0x2267d1)[_0xdefc('0x40')](_0x4089fe);};}exports['index']=function(_0x410034,_0x2c699c){var _0x1ab0ac={},_0x3c3cac={},_0xb204dd={'count':0x0,'rows':[]};var _0x20769d=_[_0xdefc('0x41')](db[_0xdefc('0x42')]['rawAttributes'],function(_0x5e35ec){return{'name':_0x5e35ec['fieldName'],'type':_0x5e35ec[_0xdefc('0x43')][_0xdefc('0x44')]};});_0x3c3cac[_0xdefc('0x45')]=_['map'](_0x20769d,_0xdefc('0x3f'));_0x3c3cac[_0xdefc('0x46')]=_['keys'](_0x410034[_0xdefc('0x46')]);_0x3c3cac[_0xdefc('0x47')]=_[_0xdefc('0x48')](_0x3c3cac[_0xdefc('0x45')],_0x3c3cac['query']);_0x1ab0ac[_0xdefc('0x49')]=_[_0xdefc('0x48')](_0x3c3cac[_0xdefc('0x45')],qs[_0xdefc('0x4a')](_0x410034[_0xdefc('0x46')][_0xdefc('0x4a')]));_0x1ab0ac[_0xdefc('0x49')]=_0x1ab0ac[_0xdefc('0x49')][_0xdefc('0x4b')]?_0x1ab0ac[_0xdefc('0x49')]:_0x3c3cac['model'];if(!_0x410034[_0xdefc('0x46')][_0xdefc('0x4c')]('nolimit')){_0x1ab0ac[_0xdefc('0x33')]=qs['limit'](_0x410034[_0xdefc('0x46')][_0xdefc('0x33')]);_0x1ab0ac['offset']=qs[_0xdefc('0x31')](_0x410034['query'][_0xdefc('0x31')]);}_0x1ab0ac[_0xdefc('0x4d')]=qs[_0xdefc('0x4e')](_0x410034['query'][_0xdefc('0x4e')]);_0x1ab0ac[_0xdefc('0x4f')]=qs[_0xdefc('0x47')](_[_0xdefc('0x50')](_0x410034['query'],_0x3c3cac[_0xdefc('0x47')]),_0x20769d);if(_0x410034[_0xdefc('0x46')][_0xdefc('0x51')]){_0x1ab0ac[_0xdefc('0x4f')]=_[_0xdefc('0x52')](_0x1ab0ac[_0xdefc('0x4f')],{'$or':_['map'](_0x20769d,function(_0x29fffb){if(_0x29fffb[_0xdefc('0x43')]!==_0xdefc('0x53')){var _0x544488={};_0x544488[_0x29fffb[_0xdefc('0x3f')]]={'$like':'%'+_0x410034[_0xdefc('0x46')][_0xdefc('0x51')]+'%'};return _0x544488;}})});}_0x1ab0ac=_[_0xdefc('0x52')]({},_0x1ab0ac,_0x410034['options']);var _0x18d330={'where':_0x1ab0ac[_0xdefc('0x4f')]};return db[_0xdefc('0x42')]['count'](_0x18d330)[_0xdefc('0x21')](function(_0xb0f4e7){_0xb204dd[_0xdefc('0x34')]=_0xb0f4e7;if(_0x410034[_0xdefc('0x46')][_0xdefc('0x54')]){_0x1ab0ac['include']=[{'all':!![]}];}return db[_0xdefc('0x42')]['findAll'](_0x1ab0ac);})[_0xdefc('0x21')](function(_0x1905c6){_0xb204dd['rows']=_0x1905c6;return _0xb204dd;})[_0xdefc('0x21')](respondWithFilteredResult(_0x2c699c,_0x1ab0ac))['catch'](handleError(_0x2c699c,null));};exports[_0xdefc('0x55')]=function(_0x21491b,_0x39491f){var _0x4d5794={'raw':!![],'where':{'id':_0x21491b[_0xdefc('0x56')]['id']}},_0x282dba={};_0x282dba['model']=_[_0xdefc('0x57')](db[_0xdefc('0x42')]['rawAttributes']);_0x282dba[_0xdefc('0x46')]=_[_0xdefc('0x57')](_0x21491b[_0xdefc('0x46')]);_0x282dba[_0xdefc('0x47')]=_[_0xdefc('0x48')](_0x282dba[_0xdefc('0x45')],_0x282dba[_0xdefc('0x46')]);_0x4d5794[_0xdefc('0x49')]=_['intersection'](_0x282dba[_0xdefc('0x45')],qs[_0xdefc('0x4a')](_0x21491b[_0xdefc('0x46')][_0xdefc('0x4a')]));_0x4d5794[_0xdefc('0x49')]=_0x4d5794[_0xdefc('0x49')][_0xdefc('0x4b')]?_0x4d5794[_0xdefc('0x49')]:_0x282dba[_0xdefc('0x45')];if(_0x21491b[_0xdefc('0x46')]['includeAll']){_0x4d5794['include']=[{'all':!![]}];}_0x4d5794=_['merge']({},_0x4d5794,_0x21491b[_0xdefc('0x58')]);return db[_0xdefc('0x42')][_0xdefc('0x59')](_0x4d5794)['then'](handleEntityNotFound(_0x39491f,null))[_0xdefc('0x21')](respondWithResult(_0x39491f,null))[_0xdefc('0x2c')](handleError(_0x39491f,null));};exports[_0xdefc('0x5a')]=function(_0xb54e9a,_0x1f14c6){return db['ChatQueue'][_0xdefc('0x5a')](_0xb54e9a[_0xdefc('0x5b')],{})[_0xdefc('0x21')](function(_0x20bb69){var _0x4577d4=_0xb54e9a[_0xdefc('0x5c')][_0xdefc('0x3b')]({'plain':!![]});if(!_0x4577d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4577d4[_0xdefc('0x5d')]===_0xdefc('0x5c')){var _0xea6152=_0x20bb69['get']({'plain':!![]});var _0x2d281c=_0xdefc('0x3c');return db[_0xdefc('0x5e')][_0xdefc('0x59')]({'where':{'name':_0x2d281c,'userProfileId':_0x4577d4[_0xdefc('0x5f')]},'raw':!![]})[_0xdefc('0x21')](function(_0x1875f6){if(_0x1875f6&&_0x1875f6[_0xdefc('0x60')]===0x0){return db[_0xdefc('0x3d')][_0xdefc('0x5a')]({'name':_0xea6152['name'],'resourceId':_0xea6152['id'],'type':_0x1875f6[_0xdefc('0x3f')],'sectionId':_0x1875f6['id']},{})[_0xdefc('0x21')](function(){return _0x20bb69;});}else{return _0x20bb69;}})[_0xdefc('0x2c')](function(_0x52b36f){logger[_0xdefc('0x28')](_0xdefc('0x61'),_0x52b36f);throw _0x52b36f;});}return _0x20bb69;})[_0xdefc('0x21')](respondWithResult(_0x1f14c6,0xc9))['catch'](handleError(_0x1f14c6,null));};exports[_0xdefc('0x62')]=function(_0x2430e4,_0x25701c){if(_0x2430e4[_0xdefc('0x5b')]['id']){delete _0x2430e4['body']['id'];}return db[_0xdefc('0x42')]['find']({'where':{'id':_0x2430e4[_0xdefc('0x56')]['id']}})[_0xdefc('0x21')](handleEntityNotFound(_0x25701c,null))[_0xdefc('0x21')](saveUpdates(_0x2430e4[_0xdefc('0x5b')],null))[_0xdefc('0x21')](respondWithResult(_0x25701c,null))[_0xdefc('0x2c')](handleError(_0x25701c,null));};exports[_0xdefc('0x3a')]=function(_0x50422f,_0x5a574a){return db[_0xdefc('0x42')][_0xdefc('0x59')]({'where':{'id':_0x50422f[_0xdefc('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a574a,null))[_0xdefc('0x21')](removeEntity(_0x5a574a,null))[_0xdefc('0x2c')](handleError(_0x5a574a,null));};exports[_0xdefc('0x63')]=function(_0x58d01e,_0x8ff5dd){return db['ChatQueue'][_0xdefc('0x63')]()[_0xdefc('0x21')](respondWithResult(_0x8ff5dd,null))['catch'](handleError(_0x8ff5dd,null));};exports['getMembers']=function(_0x5072d6,_0x43f374,_0x330206){var _0xa54269={'raw':!![],'where':{}},_0x1f7da3={},_0x2ba704;return db['ChatQueue']['findOne']({'where':{'id':_0x5072d6[_0xdefc('0x56')]['id']}})['then'](handleEntityNotFound(_0x43f374,null))['then'](function(_0x39d1e7){if(_0x39d1e7){_0x2ba704=_0x39d1e7[_0xdefc('0x3b')]({'plain':!![]});_0x1f7da3[_0xdefc('0x45')]=_[_0xdefc('0x57')](db[_0xdefc('0x64')][_0xdefc('0x65')]);_0x1f7da3['query']=_[_0xdefc('0x57')](_0x5072d6['query']);_0x1f7da3['filters']=_[_0xdefc('0x48')](_0x1f7da3['model'],_0x1f7da3[_0xdefc('0x46')]);_0xa54269[_0xdefc('0x49')]=_[_0xdefc('0x48')](_0x1f7da3[_0xdefc('0x45')],qs[_0xdefc('0x4a')](_0x5072d6[_0xdefc('0x46')][_0xdefc('0x4a')]));_0xa54269['attributes']=_0xa54269['attributes']['length']?_0xa54269[_0xdefc('0x49')]:_0x1f7da3[_0xdefc('0x45')];if(!_0x5072d6[_0xdefc('0x46')]['hasOwnProperty'](_0xdefc('0x66'))){_0xa54269[_0xdefc('0x33')]=qs[_0xdefc('0x33')](_0x5072d6[_0xdefc('0x46')]['limit']);_0xa54269['offset']=qs['offset'](_0x5072d6[_0xdefc('0x46')][_0xdefc('0x31')]);}_0xa54269[_0xdefc('0x4d')]=qs[_0xdefc('0x4e')](_0x5072d6[_0xdefc('0x46')][_0xdefc('0x4e')]);_0xa54269[_0xdefc('0x4f')]=qs[_0xdefc('0x47')](_[_0xdefc('0x50')](_0x5072d6[_0xdefc('0x46')],_0x1f7da3[_0xdefc('0x47')]));_0xa54269['where'][_0xdefc('0x67')]=_0x39d1e7['id'];if(_0x5072d6[_0xdefc('0x46')][_0xdefc('0x51')]){_0xa54269[_0xdefc('0x4f')]=_[_0xdefc('0x52')](_0xa54269[_0xdefc('0x4f')],{'$or':_[_0xdefc('0x41')](_0xa54269[_0xdefc('0x49')],function(_0xb7cf39){var _0x524ded={};_0x524ded[_0xb7cf39]={'$like':'%'+_0x5072d6[_0xdefc('0x46')]['filter']+'%'};return _0x524ded;})});}_0xa54269=_['merge']({},_0xa54269,_0x5072d6[_0xdefc('0x58')]);return db[_0xdefc('0x64')][_0xdefc('0x68')](_0xa54269);}})['then'](function(_0x1397fe){if(_0x1397fe){return db[_0xdefc('0x69')][_0xdefc('0x6a')]({'where':{'id':_[_0xdefc('0x41')](_0x1397fe,'UserId'),'role':_0xdefc('0x6b')},'attributes':['id','name','chatPause','updatedAt',_0xdefc('0x6c')]});}})[_0xdefc('0x21')](function(_0x5eef19){if(_0x5eef19){return{'count':_0x5eef19[_0xdefc('0x34')],'rows':_[_0xdefc('0x41')](_0x5eef19[_0xdefc('0x6d')],function(_0x3b6338){return{'membername':_0x3b6338['name'],'UserId':_0x3b6338['id'],'queue_name':_0x2ba704[_0xdefc('0x3f')],'ChatQueueId':_0x2ba704['id'],'interface':util[_0xdefc('0x6e')](_0xdefc('0x6f'),_0xdefc('0x70'),_0x3b6338['name']),'penalty':0x0,'paused':_0x3b6338[_0xdefc('0x71')],'createdAt':_0x3b6338[_0xdefc('0x6c')],'updatedAt':_0x3b6338['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdefc('0x21')](respondWithFilteredResult(_0x43f374,_0xa54269))[_0xdefc('0x2c')](handleError(_0x43f374,null));};exports[_0xdefc('0x72')]=function(_0x489ff7,_0x531ffc,_0x152b0b){var _0x496c45={};var _0x406adf={};var _0x4b133c;var _0x561d6b;return db[_0xdefc('0x42')][_0xdefc('0x73')]({'where':{'id':_0x489ff7[_0xdefc('0x56')]['id']}})['then'](handleEntityNotFound(_0x531ffc,null))['then'](function(_0x51fefd){if(_0x51fefd){_0x4b133c=_0x51fefd;_0x406adf[_0xdefc('0x45')]=_[_0xdefc('0x57')](db['Team'][_0xdefc('0x65')]);_0x406adf[_0xdefc('0x46')]=_[_0xdefc('0x57')](_0x489ff7['query']);_0x406adf[_0xdefc('0x47')]=_['intersection'](_0x406adf['model'],_0x406adf[_0xdefc('0x46')]);_0x496c45[_0xdefc('0x49')]=_['intersection'](_0x406adf['model'],qs[_0xdefc('0x4a')](_0x489ff7[_0xdefc('0x46')][_0xdefc('0x4a')]));_0x496c45[_0xdefc('0x49')]=_0x496c45[_0xdefc('0x49')]['length']?_0x496c45['attributes']:_0x406adf['model'];_0x496c45[_0xdefc('0x4d')]=qs[_0xdefc('0x4e')](_0x489ff7[_0xdefc('0x46')]['sort']);_0x496c45[_0xdefc('0x4f')]=qs[_0xdefc('0x47')](_[_0xdefc('0x50')](_0x489ff7[_0xdefc('0x46')],_0x406adf[_0xdefc('0x47')]));if(_0x489ff7[_0xdefc('0x46')][_0xdefc('0x51')]){_0x496c45[_0xdefc('0x4f')]=_['merge'](_0x496c45[_0xdefc('0x4f')],{'$or':_[_0xdefc('0x41')](_0x496c45['attributes'],function(_0x571b03){var _0x36a77b={};_0x36a77b[_0x571b03]={'$like':'%'+_0x489ff7[_0xdefc('0x46')][_0xdefc('0x51')]+'%'};return _0x36a77b;})});}_0x496c45=_['merge']({},_0x496c45,_0x489ff7[_0xdefc('0x58')]);return _0x4b133c[_0xdefc('0x72')](_0x496c45);}})[_0xdefc('0x21')](function(_0x42cb10){if(_0x42cb10){_0x561d6b=_0x42cb10[_0xdefc('0x4b')];if(!_0x489ff7['query'][_0xdefc('0x4c')]('nolimit')){_0x496c45[_0xdefc('0x33')]=qs[_0xdefc('0x33')](_0x489ff7['query']['limit']);_0x496c45[_0xdefc('0x31')]=qs[_0xdefc('0x31')](_0x489ff7['query'][_0xdefc('0x31')]);}return _0x4b133c[_0xdefc('0x72')](_0x496c45);}})[_0xdefc('0x21')](function(_0x526093){if(_0x526093){return _0x526093?{'count':_0x561d6b,'rows':_0x526093}:null;}})[_0xdefc('0x21')](respondWithResult(_0x531ffc,null))[_0xdefc('0x2c')](handleError(_0x531ffc,null));};exports[_0xdefc('0x74')]=function(_0x147d30,_0x3091fd,_0x2586f9){var _0x252f20=_0x147d30[_0xdefc('0x5b')][_0xdefc('0x75')];return db[_0xdefc('0x76')][_0xdefc('0x68')]({'where':{'id':_0x252f20},'attributes':['id'],'include':[{'model':db[_0xdefc('0x69')],'as':_0xdefc('0x77'),'attributes':['id',_0xdefc('0x3f'),_0xdefc('0x78'),_0xdefc('0x79'),_0xdefc('0x7a')],'raw':!![]}]})[_0xdefc('0x21')](function(_0x52a43d){if(_0x52a43d){var _0x4dbabd=_[_0xdefc('0x7b')](_0x52a43d,function(_0x3e5c81){var _0x2e5915=_0x3e5c81['get']({'plain':!![]});return _0x2e5915['Agents'];});return db[_0xdefc('0x42')][_0xdefc('0x59')]({'where':{'id':_0x147d30[_0xdefc('0x56')]['id']}})[_0xdefc('0x21')](function(_0x438d3e){return db[_0xdefc('0x7c')][_0xdefc('0x7d')](function(_0xb628b3){return _0x438d3e['addTeams'](_0x252f20,{'transaction':_0xb628b3})[_0xdefc('0x21')](function(){return BPromise['each'](_0x4dbabd,function(_0x5e57ea){return db[_0xdefc('0x64')][_0xdefc('0x7e')]({'where':{'UserId':_0x5e57ea['id'],'ChatQueueId':_0x147d30['params']['id']},'transaction':_0xb628b3});});})[_0xdefc('0x21')](function(){_0x4dbabd[_0xdefc('0x7f')](function(_0x1b6544){socket[_0xdefc('0x80')]('userChatQueue:save',{'UserId':_0x1b6544['id'],'ChatQueueId':_0x438d3e['id']});});});});});}})[_0xdefc('0x21')](respondWithStatusCode(_0x3091fd,null))[_0xdefc('0x2c')](handleError(_0x3091fd,null));};exports[_0xdefc('0x81')]=function(_0x3177fb,_0x4e7e31,_0x15d50e){return db[_0xdefc('0x76')][_0xdefc('0x68')]({'where':{'id':_0x3177fb[_0xdefc('0x46')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdefc('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdefc('0x21')](handleEntityNotFound(_0x4e7e31,null))[_0xdefc('0x21')](function(_0xfb562){var _0x5786e6=_[_0xdefc('0x41')](_0xfb562,'id');var _0x28dfbb=[];var _0x3508d3=[];var _0xb7ae88=squel[_0xdefc('0x82')]();_0xb7ae88['field'](_0xdefc('0x83'))['from'](_0xdefc('0x84'),'tq')[_0xdefc('0x85')](_0xdefc('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdefc('0x4f')](_0xdefc('0x87'),_0x3177fb[_0xdefc('0x56')]['id']);for(var _0x2b2719=0x0;_0x2b2719<_0xfb562[_0xdefc('0x4b')];_0x2b2719+=0x1){let _0x25be02=_0xfb562[_0x2b2719];for(var _0x54c1bc=0x0;_0x54c1bc<_0x25be02[_0xdefc('0x77')][_0xdefc('0x4b')];_0x54c1bc+=0x1){let _0x4acc27=_0x25be02[_0xdefc('0x77')][_0x54c1bc];var _0x1872f4=_0xb7ae88['clone']();_0x1872f4['where']('ut.UserId\x20=\x20?',_0x4acc27['id']);_0x3508d3[_0xdefc('0x88')](db['sequelize'][_0xdefc('0x46')](_0x1872f4[_0xdefc('0x89')](),{'type':db[_0xdefc('0x7c')][_0xdefc('0x8a')][_0xdefc('0x8b')]})['then'](function(_0x1b6973){if(_0x1b6973['length']===0x1){return _0x4acc27['id'];}else{var _0x87ed48=_['every'](_[_0xdefc('0x41')](_0x1b6973,_0xdefc('0x8c')),function(_0x393dcd){return _['includes'](_0x5786e6,_0x393dcd);});if(_0x87ed48){return _0x4acc27['id'];}}}));}}return BPromise['all'](_0x3508d3)[_0xdefc('0x21')](function(_0x32919d){_0x28dfbb=_(_0x28dfbb)[_0xdefc('0x8d')](_0x32919d)['compact']()[_0xdefc('0x8e')]();return db[_0xdefc('0x42')][_0xdefc('0x59')]({'where':{'id':_0x3177fb[_0xdefc('0x56')]['id']}})[_0xdefc('0x21')](function(_0x1d9824){return db[_0xdefc('0x7c')][_0xdefc('0x7d')](function(_0x3f5061){return _0x1d9824[_0xdefc('0x81')](_0x3177fb[_0xdefc('0x46')][_0xdefc('0x75')],{'transaction':_0x3f5061})[_0xdefc('0x21')](function(){if(!_[_0xdefc('0x8f')](_0x28dfbb)){return _0x1d9824[_0xdefc('0x90')](_0x28dfbb,{'transaction':_0x3f5061});}})[_0xdefc('0x21')](function(){_0x28dfbb['forEach'](function(_0x1e4a74){socket[_0xdefc('0x80')](_0xdefc('0x91'),{'UserId':_0x1e4a74,'ChatQueueId':_0x1d9824['id']});});});});});});})[_0xdefc('0x21')](respondWithStatusCode(_0x4e7e31,null))[_0xdefc('0x2c')](handleError(_0x4e7e31,null));};exports[_0xdefc('0x92')]=function(_0x996b3,_0x3c0c59,_0x2d142a){return db[_0xdefc('0x42')][_0xdefc('0x59')]({'where':{'id':_0x996b3[_0xdefc('0x56')]['id']}})[_0xdefc('0x21')](handleEntityNotFound(_0x3c0c59,null))['then'](function(_0xdfb215){if(_0xdfb215){return _0xdfb215[_0xdefc('0x92')](_0x996b3[_0xdefc('0x5b')][_0xdefc('0x75')],_[_0xdefc('0x93')](_0x996b3[_0xdefc('0x5b')],[_0xdefc('0x75'),'id'])||{})[_0xdefc('0x94')](function(_0x472c5d){for(var _0x457152=0x0;_0x457152<_0x996b3[_0xdefc('0x5b')][_0xdefc('0x75')][_0xdefc('0x4b')];_0x457152+=0x1){socket[_0xdefc('0x80')](_0xdefc('0x95'),{'UserId':Number(_0x996b3[_0xdefc('0x5b')][_0xdefc('0x75')][_0x457152]),'ChatQueueId':Number(_0x996b3[_0xdefc('0x56')]['id'])});}return _0x472c5d;});}})[_0xdefc('0x21')](respondWithResult(_0x3c0c59,null))[_0xdefc('0x2c')](handleError(_0x3c0c59,null));};exports[_0xdefc('0x90')]=function(_0x36f4fd,_0xa58137,_0x3571a9){return db[_0xdefc('0x42')]['find']({'where':{'id':_0x36f4fd['params']['id']}})[_0xdefc('0x21')](handleEntityNotFound(_0xa58137,null))[_0xdefc('0x21')](function(_0x47fffc){if(_0x47fffc){return _0x47fffc['removeAgents'](_0x36f4fd[_0xdefc('0x46')][_0xdefc('0x75')])[_0xdefc('0x21')](function(){if(_[_0xdefc('0x96')](_0x36f4fd[_0xdefc('0x46')][_0xdefc('0x75')])){for(var _0x16d4ac=0x0;_0x16d4ac<_0x36f4fd['query'][_0xdefc('0x75')]['length'];_0x16d4ac+=0x1){socket[_0xdefc('0x80')]('userChatQueue:remove',{'UserId':Number(_0x36f4fd[_0xdefc('0x46')]['ids'][_0x16d4ac]),'ChatQueueId':Number(_0x36f4fd[_0xdefc('0x56')]['id'])});}}else{socket[_0xdefc('0x80')]('userChatQueue:remove',{'UserId':Number(_0x36f4fd['query'][_0xdefc('0x75')]),'ChatQueueId':Number(_0x36f4fd[_0xdefc('0x56')]['id'])});}});}})[_0xdefc('0x21')](respondWithStatusCode(_0xa58137,null))[_0xdefc('0x2c')](handleError(_0xa58137,null));};exports[_0xdefc('0x97')]=function(_0x15a4a5,_0x4b08c0,_0x8a32ff){var _0x266f38={};var _0x11e5ac={};var _0x338eb1;var _0x24f01b;return db['ChatQueue'][_0xdefc('0x73')]({'where':{'id':_0x15a4a5['params']['id']}})[_0xdefc('0x21')](handleEntityNotFound(_0x4b08c0,null))['then'](function(_0x39a436){if(_0x39a436){_0x338eb1=_0x39a436;_0x11e5ac[_0xdefc('0x45')]=_['keys'](db[_0xdefc('0x69')][_0xdefc('0x65')]);_0x11e5ac['query']=_['keys'](_0x15a4a5[_0xdefc('0x46')]);_0x11e5ac[_0xdefc('0x47')]=_[_0xdefc('0x48')](_0x11e5ac[_0xdefc('0x45')],_0x11e5ac['query']);_0x266f38[_0xdefc('0x49')]=_[_0xdefc('0x48')](_0x11e5ac[_0xdefc('0x45')],qs[_0xdefc('0x4a')](_0x15a4a5[_0xdefc('0x46')][_0xdefc('0x4a')]));_0x266f38[_0xdefc('0x49')]=_0x266f38[_0xdefc('0x49')][_0xdefc('0x4b')]?_0x266f38[_0xdefc('0x49')]:_0x11e5ac[_0xdefc('0x45')];_0x266f38[_0xdefc('0x4d')]=qs['sort'](_0x15a4a5[_0xdefc('0x46')][_0xdefc('0x4e')]);_0x266f38['where']=qs[_0xdefc('0x47')](_[_0xdefc('0x50')](_0x15a4a5['query'],_0x11e5ac[_0xdefc('0x47')]));if(_0x15a4a5[_0xdefc('0x46')][_0xdefc('0x51')]){_0x266f38[_0xdefc('0x4f')]=_['merge'](_0x266f38[_0xdefc('0x4f')],{'$or':_[_0xdefc('0x41')](_0x266f38['attributes'],function(_0x13f961){var _0x176879={};_0x176879[_0x13f961]={'$like':'%'+_0x15a4a5[_0xdefc('0x46')][_0xdefc('0x51')]+'%'};return _0x176879;})});}_0x266f38=_[_0xdefc('0x52')]({},_0x266f38,_0x15a4a5[_0xdefc('0x58')]);return _0x338eb1[_0xdefc('0x97')](_0x266f38);}})['then'](function(_0xee0113){if(_0xee0113){_0x24f01b=_0xee0113[_0xdefc('0x4b')];if(!_0x15a4a5[_0xdefc('0x46')][_0xdefc('0x4c')](_0xdefc('0x66'))){_0x266f38['limit']=qs[_0xdefc('0x33')](_0x15a4a5['query'][_0xdefc('0x33')]);_0x266f38[_0xdefc('0x31')]=qs[_0xdefc('0x31')](_0x15a4a5[_0xdefc('0x46')]['offset']);}return _0x338eb1[_0xdefc('0x97')](_0x266f38);}})['then'](function(_0x540d7f){if(_0x540d7f){return _0x540d7f?{'count':_0x24f01b,'rows':_0x540d7f}:null;}})[_0xdefc('0x21')](respondWithResult(_0x4b08c0,null))[_0xdefc('0x2c')](handleError(_0x4b08c0,null));}; \ No newline at end of file +var _0x0e75=['error','code','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length','nolimit','sort','pick','filters','filter','where','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','order','getTeams','body','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','forEach','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','emit','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','./chatQueue.socket','jayson/promise','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6a5b83,_0x570d24){var _0x1174cd=function(_0x449428){while(--_0x449428){_0x6a5b83['push'](_0x6a5b83['shift']());}};_0x1174cd(++_0x570d24);}(_0x0e75,0x111));var _0x50e7=function(_0x806c9f,_0x3c9e4b){_0x806c9f=_0x806c9f-0x0;var _0x3781fa=_0x0e75[_0x806c9f];return _0x3781fa;};'use strict';var emlformat=require(_0x50e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50e7('0x1'));var rp=require(_0x50e7('0x2'));var moment=require(_0x50e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x50e7('0x4'));var util=require('util');var path=require(_0x50e7('0x5'));var sox=require(_0x50e7('0x6'));var csv=require(_0x50e7('0x7'));var ejs=require(_0x50e7('0x8'));var fs=require('fs');var fs_extra=require(_0x50e7('0x9'));var _=require(_0x50e7('0xa'));var squel=require(_0x50e7('0xb'));var crypto=require(_0x50e7('0xc'));var jsforce=require(_0x50e7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x50e7('0x7'));var querystring=require(_0x50e7('0xe'));var Papa=require(_0x50e7('0xf'));var Redis=require(_0x50e7('0x10'));var authService=require(_0x50e7('0x11'));var qs=require(_0x50e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50e7('0x13'));var logger=require(_0x50e7('0x14'))(_0x50e7('0x15'));var utils=require(_0x50e7('0x16'));var config=require(_0x50e7('0x17'));var licenseUtil=require(_0x50e7('0x18'));var db=require(_0x50e7('0x19'))['db'];config[_0x50e7('0x1a')]=_[_0x50e7('0x1b')](config[_0x50e7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50e7('0x1a')]));require(_0x50e7('0x1c'))['register'](socket);var jayson=require(_0x50e7('0x1d'));var client=jayson['client'][_0x50e7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2607c8,_0xac53dd,_0x224f8a,_0x3bbefa){return new BPromise(function(_0x31cffb,_0x561477){var _0x55f288=_0x3bbefa||client;return _0x55f288['request'](_0x2607c8,_0x224f8a)['then'](function(_0x1f3ddc){logger[_0x50e7('0x1f')](_0x50e7('0x20'),_0xac53dd,_0x50e7('0x21'));logger[_0x50e7('0x22')](_0x50e7('0x23'),_0xac53dd,_0x50e7('0x21'),JSON[_0x50e7('0x24')](_0x1f3ddc));if(_0x1f3ddc[_0x50e7('0x25')]){if(_0x1f3ddc[_0x50e7('0x25')][_0x50e7('0x26')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0xac53dd,_0x1f3ddc[_0x50e7('0x25')][_0x50e7('0x27')]);return _0x561477(_0x1f3ddc['error']['message']);}logger[_0x50e7('0x25')]('ChatQueue,\x20%s,\x20%s',_0xac53dd,_0x1f3ddc['error'][_0x50e7('0x27')]);return _0x31cffb(_0x1f3ddc[_0x50e7('0x25')][_0x50e7('0x27')]);}else{logger[_0x50e7('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xac53dd,'request\x20sent');_0x31cffb(_0x1f3ddc[_0x50e7('0x28')][_0x50e7('0x27')]);}})[_0x50e7('0x29')](function(_0x73a33f){logger['error'](_0x50e7('0x20'),_0xac53dd,_0x73a33f);_0x561477(_0x73a33f);});});}function respondWithStatusCode(_0x1cbc7b,_0x379d05){_0x379d05=_0x379d05||0xcc;return function(_0x132191){if(_0x132191){return _0x1cbc7b['sendStatus'](_0x379d05);}return _0x1cbc7b[_0x50e7('0x2a')](_0x379d05)[_0x50e7('0x2b')]();};}function respondWithResult(_0x50088a,_0x4019f8){_0x4019f8=_0x4019f8||0xc8;return function(_0x3d8c2f){if(_0x3d8c2f){return _0x50088a[_0x50e7('0x2a')](_0x4019f8)['json'](_0x3d8c2f);}};}function respondWithFilteredResult(_0x3c4bfc,_0x16d981){return function(_0x410b71){if(_0x410b71){var _0x5247c0=typeof _0x16d981[_0x50e7('0x2c')]===_0x50e7('0x2d')&&typeof _0x16d981['limit']==='undefined';var _0x113cf6=_0x410b71[_0x50e7('0x2e')];var _0x5825db=_0x5247c0?0x0:_0x16d981[_0x50e7('0x2c')];var _0x36d3aa=_0x5247c0?_0x410b71[_0x50e7('0x2e')]:_0x16d981[_0x50e7('0x2c')]+_0x16d981[_0x50e7('0x2f')];var _0x158606;if(_0x36d3aa>=_0x113cf6){_0x36d3aa=_0x113cf6;_0x158606=0xc8;}else{_0x158606=0xce;}_0x3c4bfc[_0x50e7('0x2a')](_0x158606);return _0x3c4bfc[_0x50e7('0x30')](_0x50e7('0x31'),_0x5825db+'-'+_0x36d3aa+'/'+_0x113cf6)[_0x50e7('0x32')](_0x410b71);}return null;};}function patchUpdates(_0x4763d4){return function(_0x9e9eda){try{jsonpatch[_0x50e7('0x33')](_0x9e9eda,_0x4763d4,!![]);}catch(_0x4df2d0){return BPromise[_0x50e7('0x34')](_0x4df2d0);}return _0x9e9eda[_0x50e7('0x35')]();};}function saveUpdates(_0x51c602,_0xb272fb){return function(_0x361cc7){if(_0x361cc7){return _0x361cc7['update'](_0x51c602)['then'](function(_0x46182d){return _0x46182d;});}return null;};}function removeEntity(_0x51a31e,_0xbb621b){return function(_0x5317cd){if(_0x5317cd){return _0x5317cd[_0x50e7('0x36')]()[_0x50e7('0x37')](function(){var _0x327d69=_0x5317cd[_0x50e7('0x38')]({'plain':!![]});var _0x46a8fe=_0x50e7('0x39');return db[_0x50e7('0x3a')][_0x50e7('0x36')]({'where':{'type':_0x46a8fe,'resourceId':_0x327d69['id']}})[_0x50e7('0x37')](function(){return _0x5317cd;});})['then'](function(){_0x51a31e[_0x50e7('0x2a')](0xcc)[_0x50e7('0x2b')]();});}};}function handleEntityNotFound(_0x4609fc,_0x43d90c){return function(_0x320d8e){if(!_0x320d8e){_0x4609fc[_0x50e7('0x3b')](0x194);}return _0x320d8e;};}function handleError(_0x341d37,_0x24610e){_0x24610e=_0x24610e||0x1f4;return function(_0x261188){logger[_0x50e7('0x25')](_0x261188[_0x50e7('0x3c')]);if(_0x261188['name']){delete _0x261188[_0x50e7('0x3d')];}_0x341d37[_0x50e7('0x2a')](_0x24610e)[_0x50e7('0x3e')](_0x261188);};}exports[_0x50e7('0x3f')]=function(_0xfdc0a5,_0x45f1f6){var _0x3cbfcb={},_0x4b228d={},_0x406428={'count':0x0,'rows':[]};var _0x16e90d=_[_0x50e7('0x40')](db[_0x50e7('0x41')][_0x50e7('0x42')],function(_0x3665e8){return{'name':_0x3665e8[_0x50e7('0x43')],'type':_0x3665e8[_0x50e7('0x44')]['key']};});_0x4b228d['model']=_['map'](_0x16e90d,_0x50e7('0x3d'));_0x4b228d[_0x50e7('0x45')]=_['keys'](_0xfdc0a5[_0x50e7('0x45')]);_0x4b228d['filters']=_[_0x50e7('0x46')](_0x4b228d[_0x50e7('0x47')],_0x4b228d[_0x50e7('0x45')]);_0x3cbfcb['attributes']=_[_0x50e7('0x46')](_0x4b228d[_0x50e7('0x47')],qs[_0x50e7('0x48')](_0xfdc0a5['query'][_0x50e7('0x48')]));_0x3cbfcb[_0x50e7('0x49')]=_0x3cbfcb[_0x50e7('0x49')][_0x50e7('0x4a')]?_0x3cbfcb[_0x50e7('0x49')]:_0x4b228d[_0x50e7('0x47')];if(!_0xfdc0a5[_0x50e7('0x45')]['hasOwnProperty'](_0x50e7('0x4b'))){_0x3cbfcb[_0x50e7('0x2f')]=qs[_0x50e7('0x2f')](_0xfdc0a5[_0x50e7('0x45')]['limit']);_0x3cbfcb[_0x50e7('0x2c')]=qs['offset'](_0xfdc0a5['query']['offset']);}_0x3cbfcb['order']=qs[_0x50e7('0x4c')](_0xfdc0a5[_0x50e7('0x45')][_0x50e7('0x4c')]);_0x3cbfcb['where']=qs['filters'](_[_0x50e7('0x4d')](_0xfdc0a5[_0x50e7('0x45')],_0x4b228d[_0x50e7('0x4e')]),_0x16e90d);if(_0xfdc0a5[_0x50e7('0x45')][_0x50e7('0x4f')]){_0x3cbfcb[_0x50e7('0x50')]=_[_0x50e7('0x51')](_0x3cbfcb[_0x50e7('0x50')],{'$or':_[_0x50e7('0x40')](_0x16e90d,function(_0x45deed){if(_0x45deed[_0x50e7('0x44')]!=='VIRTUAL'){var _0xf0e3ba={};_0xf0e3ba[_0x45deed['name']]={'$like':'%'+_0xfdc0a5[_0x50e7('0x45')][_0x50e7('0x4f')]+'%'};return _0xf0e3ba;}})});}_0x3cbfcb=_[_0x50e7('0x51')]({},_0x3cbfcb,_0xfdc0a5['options']);var _0x5c1b63={'where':_0x3cbfcb[_0x50e7('0x50')]};return db[_0x50e7('0x41')][_0x50e7('0x2e')](_0x5c1b63)[_0x50e7('0x37')](function(_0x1be743){_0x406428['count']=_0x1be743;if(_0xfdc0a5[_0x50e7('0x45')][_0x50e7('0x52')]){_0x3cbfcb[_0x50e7('0x53')]=[{'all':!![]}];}return db[_0x50e7('0x41')][_0x50e7('0x54')](_0x3cbfcb);})[_0x50e7('0x37')](function(_0x33b0ba){_0x406428[_0x50e7('0x55')]=_0x33b0ba;return _0x406428;})[_0x50e7('0x37')](respondWithFilteredResult(_0x45f1f6,_0x3cbfcb))[_0x50e7('0x29')](handleError(_0x45f1f6,null));};exports[_0x50e7('0x56')]=function(_0x29fa0a,_0x4e126f){var _0x2f73b0={'raw':!![],'where':{'id':_0x29fa0a[_0x50e7('0x57')]['id']}},_0x2291b8={};_0x2291b8[_0x50e7('0x47')]=_[_0x50e7('0x58')](db['ChatQueue'][_0x50e7('0x42')]);_0x2291b8[_0x50e7('0x45')]=_[_0x50e7('0x58')](_0x29fa0a[_0x50e7('0x45')]);_0x2291b8[_0x50e7('0x4e')]=_[_0x50e7('0x46')](_0x2291b8[_0x50e7('0x47')],_0x2291b8['query']);_0x2f73b0['attributes']=_[_0x50e7('0x46')](_0x2291b8['model'],qs[_0x50e7('0x48')](_0x29fa0a[_0x50e7('0x45')]['fields']));_0x2f73b0[_0x50e7('0x49')]=_0x2f73b0[_0x50e7('0x49')]['length']?_0x2f73b0[_0x50e7('0x49')]:_0x2291b8[_0x50e7('0x47')];if(_0x29fa0a['query'][_0x50e7('0x52')]){_0x2f73b0[_0x50e7('0x53')]=[{'all':!![]}];}_0x2f73b0=_[_0x50e7('0x51')]({},_0x2f73b0,_0x29fa0a[_0x50e7('0x59')]);return db[_0x50e7('0x41')][_0x50e7('0x5a')](_0x2f73b0)[_0x50e7('0x37')](handleEntityNotFound(_0x4e126f,null))[_0x50e7('0x37')](respondWithResult(_0x4e126f,null))['catch'](handleError(_0x4e126f,null));};exports[_0x50e7('0x5b')]=function(_0x3276d8,_0x542e2c){return db[_0x50e7('0x41')]['create'](_0x3276d8['body'],{})['then'](function(_0x487bc8){var _0x39a16d=_0x3276d8[_0x50e7('0x5c')][_0x50e7('0x38')]({'plain':!![]});if(!_0x39a16d)throw new Error(_0x50e7('0x5d'));if(_0x39a16d[_0x50e7('0x5e')]===_0x50e7('0x5c')){var _0x302546=_0x487bc8[_0x50e7('0x38')]({'plain':!![]});var _0xc021ad=_0x50e7('0x39');return db[_0x50e7('0x5f')][_0x50e7('0x5a')]({'where':{'name':_0xc021ad,'userProfileId':_0x39a16d[_0x50e7('0x60')]},'raw':!![]})[_0x50e7('0x37')](function(_0x567b30){if(_0x567b30&&_0x567b30[_0x50e7('0x61')]===0x0){return db['UserProfileResource'][_0x50e7('0x5b')]({'name':_0x302546[_0x50e7('0x3d')],'resourceId':_0x302546['id'],'type':_0x567b30[_0x50e7('0x3d')],'sectionId':_0x567b30['id']},{})['then'](function(){return _0x487bc8;});}else{return _0x487bc8;}})[_0x50e7('0x29')](function(_0x499f84){logger['error'](_0x50e7('0x62'),_0x499f84);throw _0x499f84;});}return _0x487bc8;})[_0x50e7('0x37')](respondWithResult(_0x542e2c,0xc9))[_0x50e7('0x29')](handleError(_0x542e2c,null));};exports[_0x50e7('0x63')]=function(_0x4d816d,_0x22e5a4){if(_0x4d816d['body']['id']){delete _0x4d816d['body']['id'];}return db[_0x50e7('0x41')][_0x50e7('0x5a')]({'where':{'id':_0x4d816d[_0x50e7('0x57')]['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0x22e5a4,null))[_0x50e7('0x37')](saveUpdates(_0x4d816d['body'],null))[_0x50e7('0x37')](respondWithResult(_0x22e5a4,null))[_0x50e7('0x29')](handleError(_0x22e5a4,null));};exports['destroy']=function(_0x3cebfd,_0x2e5137){return db[_0x50e7('0x41')]['find']({'where':{'id':_0x3cebfd[_0x50e7('0x57')]['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0x2e5137,null))[_0x50e7('0x37')](removeEntity(_0x2e5137,null))['catch'](handleError(_0x2e5137,null));};exports[_0x50e7('0x64')]=function(_0x2c2c02,_0x3e0739){return db[_0x50e7('0x41')][_0x50e7('0x64')]()['then'](respondWithResult(_0x3e0739,null))['catch'](handleError(_0x3e0739,null));};exports['getMembers']=function(_0x33fac3,_0xddd2bc,_0x48d86a){var _0x9d55f9={'raw':!![],'where':{}},_0x3400d5={},_0x37a6ad;return db[_0x50e7('0x41')][_0x50e7('0x65')]({'where':{'id':_0x33fac3[_0x50e7('0x57')]['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0xddd2bc,null))[_0x50e7('0x37')](function(_0x572b45){if(_0x572b45){_0x37a6ad=_0x572b45[_0x50e7('0x38')]({'plain':!![]});_0x3400d5[_0x50e7('0x47')]=_[_0x50e7('0x58')](db[_0x50e7('0x66')]['rawAttributes']);_0x3400d5['query']=_[_0x50e7('0x58')](_0x33fac3[_0x50e7('0x45')]);_0x3400d5[_0x50e7('0x4e')]=_[_0x50e7('0x46')](_0x3400d5[_0x50e7('0x47')],_0x3400d5['query']);_0x9d55f9[_0x50e7('0x49')]=_[_0x50e7('0x46')](_0x3400d5['model'],qs[_0x50e7('0x48')](_0x33fac3[_0x50e7('0x45')][_0x50e7('0x48')]));_0x9d55f9['attributes']=_0x9d55f9[_0x50e7('0x49')]['length']?_0x9d55f9['attributes']:_0x3400d5[_0x50e7('0x47')];if(!_0x33fac3['query'][_0x50e7('0x67')](_0x50e7('0x4b'))){_0x9d55f9[_0x50e7('0x2f')]=qs['limit'](_0x33fac3['query']['limit']);_0x9d55f9[_0x50e7('0x2c')]=qs[_0x50e7('0x2c')](_0x33fac3[_0x50e7('0x45')][_0x50e7('0x2c')]);}_0x9d55f9['order']=qs[_0x50e7('0x4c')](_0x33fac3[_0x50e7('0x45')]['sort']);_0x9d55f9[_0x50e7('0x50')]=qs[_0x50e7('0x4e')](_[_0x50e7('0x4d')](_0x33fac3['query'],_0x3400d5[_0x50e7('0x4e')]));_0x9d55f9[_0x50e7('0x50')][_0x50e7('0x68')]=_0x572b45['id'];if(_0x33fac3['query'][_0x50e7('0x4f')]){_0x9d55f9['where']=_[_0x50e7('0x51')](_0x9d55f9[_0x50e7('0x50')],{'$or':_[_0x50e7('0x40')](_0x9d55f9[_0x50e7('0x49')],function(_0x5b43bf){var _0x503636={};_0x503636[_0x5b43bf]={'$like':'%'+_0x33fac3['query'][_0x50e7('0x4f')]+'%'};return _0x503636;})});}_0x9d55f9=_[_0x50e7('0x51')]({},_0x9d55f9,_0x33fac3[_0x50e7('0x59')]);return db[_0x50e7('0x66')][_0x50e7('0x54')](_0x9d55f9);}})[_0x50e7('0x37')](function(_0x5d5631){if(_0x5d5631){return db['User'][_0x50e7('0x69')]({'where':{'id':_[_0x50e7('0x40')](_0x5d5631,_0x50e7('0x6a')),'role':_0x50e7('0x6b')},'attributes':['id',_0x50e7('0x3d'),_0x50e7('0x6c'),_0x50e7('0x6d'),'createdAt']});}})[_0x50e7('0x37')](function(_0x4cd27b){if(_0x4cd27b){return{'count':_0x4cd27b[_0x50e7('0x2e')],'rows':_['map'](_0x4cd27b[_0x50e7('0x55')],function(_0x54fc59){return{'membername':_0x54fc59[_0x50e7('0x3d')],'UserId':_0x54fc59['id'],'queue_name':_0x37a6ad[_0x50e7('0x3d')],'ChatQueueId':_0x37a6ad['id'],'interface':util[_0x50e7('0x6e')](_0x50e7('0x6f'),_0x50e7('0x70'),_0x54fc59[_0x50e7('0x3d')]),'penalty':0x0,'paused':_0x54fc59[_0x50e7('0x6c')],'createdAt':_0x54fc59[_0x50e7('0x71')],'updatedAt':_0x54fc59[_0x50e7('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x50e7('0x37')](respondWithFilteredResult(_0xddd2bc,_0x9d55f9))['catch'](handleError(_0xddd2bc,null));};exports['getTeams']=function(_0x10de9d,_0x31cd84,_0x1c5847){var _0x36644f={};var _0x3ea197={};var _0x1b4e3b;var _0x404e88;return db[_0x50e7('0x41')][_0x50e7('0x65')]({'where':{'id':_0x10de9d[_0x50e7('0x57')]['id']}})['then'](handleEntityNotFound(_0x31cd84,null))[_0x50e7('0x37')](function(_0x5825bf){if(_0x5825bf){_0x1b4e3b=_0x5825bf;_0x3ea197[_0x50e7('0x47')]=_[_0x50e7('0x58')](db[_0x50e7('0x72')][_0x50e7('0x42')]);_0x3ea197[_0x50e7('0x45')]=_[_0x50e7('0x58')](_0x10de9d[_0x50e7('0x45')]);_0x3ea197['filters']=_[_0x50e7('0x46')](_0x3ea197[_0x50e7('0x47')],_0x3ea197['query']);_0x36644f[_0x50e7('0x49')]=_['intersection'](_0x3ea197[_0x50e7('0x47')],qs[_0x50e7('0x48')](_0x10de9d[_0x50e7('0x45')][_0x50e7('0x48')]));_0x36644f[_0x50e7('0x49')]=_0x36644f['attributes'][_0x50e7('0x4a')]?_0x36644f[_0x50e7('0x49')]:_0x3ea197[_0x50e7('0x47')];_0x36644f[_0x50e7('0x73')]=qs[_0x50e7('0x4c')](_0x10de9d[_0x50e7('0x45')][_0x50e7('0x4c')]);_0x36644f[_0x50e7('0x50')]=qs[_0x50e7('0x4e')](_[_0x50e7('0x4d')](_0x10de9d['query'],_0x3ea197[_0x50e7('0x4e')]));if(_0x10de9d[_0x50e7('0x45')][_0x50e7('0x4f')]){_0x36644f[_0x50e7('0x50')]=_[_0x50e7('0x51')](_0x36644f[_0x50e7('0x50')],{'$or':_['map'](_0x36644f[_0x50e7('0x49')],function(_0x140fb8){var _0x266717={};_0x266717[_0x140fb8]={'$like':'%'+_0x10de9d['query']['filter']+'%'};return _0x266717;})});}_0x36644f=_[_0x50e7('0x51')]({},_0x36644f,_0x10de9d[_0x50e7('0x59')]);return _0x1b4e3b['getTeams'](_0x36644f);}})[_0x50e7('0x37')](function(_0x66103d){if(_0x66103d){_0x404e88=_0x66103d[_0x50e7('0x4a')];if(!_0x10de9d[_0x50e7('0x45')]['hasOwnProperty']('nolimit')){_0x36644f[_0x50e7('0x2f')]=qs[_0x50e7('0x2f')](_0x10de9d[_0x50e7('0x45')][_0x50e7('0x2f')]);_0x36644f[_0x50e7('0x2c')]=qs['offset'](_0x10de9d[_0x50e7('0x45')][_0x50e7('0x2c')]);}return _0x1b4e3b[_0x50e7('0x74')](_0x36644f);}})[_0x50e7('0x37')](function(_0x2e89eb){if(_0x2e89eb){return _0x2e89eb?{'count':_0x404e88,'rows':_0x2e89eb}:null;}})[_0x50e7('0x37')](respondWithResult(_0x31cd84,null))['catch'](handleError(_0x31cd84,null));};exports['addTeams']=function(_0x3e3f92,_0x2a4fbe,_0x5ed202){var _0x234d9c=_0x3e3f92[_0x50e7('0x75')][_0x50e7('0x76')];return db['Team'][_0x50e7('0x54')]({'where':{'id':_0x234d9c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x50e7('0x77'),'attributes':['id',_0x50e7('0x3d'),_0x50e7('0x78'),_0x50e7('0x79'),_0x50e7('0x7a')],'raw':!![]}]})[_0x50e7('0x37')](function(_0x151fbb){if(_0x151fbb){var _0x33ccac=_[_0x50e7('0x7b')](_0x151fbb,function(_0x2455e2){var _0x22b06b=_0x2455e2[_0x50e7('0x38')]({'plain':!![]});return _0x22b06b[_0x50e7('0x77')];});return db[_0x50e7('0x41')][_0x50e7('0x5a')]({'where':{'id':_0x3e3f92['params']['id']}})[_0x50e7('0x37')](function(_0x15ddd2){return db['sequelize'][_0x50e7('0x7c')](function(_0x27b80b){return _0x15ddd2[_0x50e7('0x7d')](_0x234d9c,{'transaction':_0x27b80b})[_0x50e7('0x37')](function(){return BPromise['each'](_0x33ccac,function(_0x1b3060){return db[_0x50e7('0x66')]['findOrCreate']({'where':{'UserId':_0x1b3060['id'],'ChatQueueId':_0x3e3f92[_0x50e7('0x57')]['id']},'transaction':_0x27b80b});});})['then'](function(){_0x33ccac[_0x50e7('0x7e')](function(_0x31ede5){socket['emit'](_0x50e7('0x7f'),{'UserId':_0x31ede5['id'],'ChatQueueId':_0x15ddd2['id']});});});});});}})['then'](respondWithStatusCode(_0x2a4fbe,null))[_0x50e7('0x29')](handleError(_0x2a4fbe,null));};exports[_0x50e7('0x80')]=function(_0x285106,_0x393128,_0x5e37b4){return db[_0x50e7('0x72')]['findAll']({'where':{'id':_0x285106[_0x50e7('0x45')][_0x50e7('0x76')]},'attributes':['id'],'include':[{'model':db[_0x50e7('0x81')],'as':_0x50e7('0x77'),'attributes':['id'],'raw':!![]}]})[_0x50e7('0x37')](handleEntityNotFound(_0x393128,null))[_0x50e7('0x37')](function(_0x1ab939){var _0x4834cc=_[_0x50e7('0x40')](_0x1ab939,'id');var _0x1d36a8=[];var _0x6bd09b=[];var _0x1e85f4=squel[_0x50e7('0x82')]();_0x1e85f4[_0x50e7('0x83')](_0x50e7('0x84'))[_0x50e7('0x85')](_0x50e7('0x86'),'tq')[_0x50e7('0x87')](_0x50e7('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x50e7('0x89'),_0x285106[_0x50e7('0x57')]['id']);for(var _0x26b3b4=0x0;_0x26b3b4<_0x1ab939[_0x50e7('0x4a')];_0x26b3b4+=0x1){let _0x2668f5=_0x1ab939[_0x26b3b4];for(var _0x4caef0=0x0;_0x4caef0<_0x2668f5[_0x50e7('0x77')][_0x50e7('0x4a')];_0x4caef0+=0x1){let _0x1502df=_0x2668f5[_0x50e7('0x77')][_0x4caef0];var _0x13484e=_0x1e85f4['clone']();_0x13484e['where'](_0x50e7('0x8a'),_0x1502df['id']);_0x6bd09b[_0x50e7('0x8b')](db[_0x50e7('0x8c')][_0x50e7('0x45')](_0x13484e[_0x50e7('0x8d')](),{'type':db['sequelize']['QueryTypes'][_0x50e7('0x8e')]})['then'](function(_0xda4313){if(_0xda4313['length']===0x1){return _0x1502df['id'];}else{var _0x23d3b8=_[_0x50e7('0x8f')](_[_0x50e7('0x40')](_0xda4313,_0x50e7('0x90')),function(_0x2613da){return _[_0x50e7('0x91')](_0x4834cc,_0x2613da);});if(_0x23d3b8){return _0x1502df['id'];}}}));}}return BPromise[_0x50e7('0x92')](_0x6bd09b)['then'](function(_0x47362a){_0x1d36a8=_(_0x1d36a8)['union'](_0x47362a)['compact']()['value']();return db[_0x50e7('0x41')]['find']({'where':{'id':_0x285106[_0x50e7('0x57')]['id']}})[_0x50e7('0x37')](function(_0x4c1be3){return db[_0x50e7('0x8c')]['transaction'](function(_0x55a920){return _0x4c1be3['removeTeams'](_0x285106[_0x50e7('0x45')][_0x50e7('0x76')],{'transaction':_0x55a920})[_0x50e7('0x37')](function(){if(!_[_0x50e7('0x93')](_0x1d36a8)){return _0x4c1be3[_0x50e7('0x94')](_0x1d36a8,{'transaction':_0x55a920});}})['then'](function(){_0x1d36a8[_0x50e7('0x7e')](function(_0x3dbe06){socket['emit'](_0x50e7('0x95'),{'UserId':_0x3dbe06,'ChatQueueId':_0x4c1be3['id']});});});});});});})[_0x50e7('0x37')](respondWithStatusCode(_0x393128,null))['catch'](handleError(_0x393128,null));};exports[_0x50e7('0x96')]=function(_0x2d928b,_0x488fff,_0x4e85db){return db['ChatQueue'][_0x50e7('0x5a')]({'where':{'id':_0x2d928b['params']['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0x488fff,null))[_0x50e7('0x37')](function(_0x2929d5){if(_0x2929d5){return _0x2929d5[_0x50e7('0x96')](_0x2d928b[_0x50e7('0x75')]['ids'],_['omit'](_0x2d928b[_0x50e7('0x75')],['ids','id'])||{})[_0x50e7('0x97')](function(_0x4b5c86){for(var _0x55d50a=0x0;_0x55d50a<_0x2d928b[_0x50e7('0x75')]['ids'][_0x50e7('0x4a')];_0x55d50a+=0x1){socket[_0x50e7('0x98')](_0x50e7('0x7f'),{'UserId':Number(_0x2d928b[_0x50e7('0x75')]['ids'][_0x55d50a]),'ChatQueueId':Number(_0x2d928b['params']['id'])});}return _0x4b5c86;});}})[_0x50e7('0x37')](respondWithResult(_0x488fff,null))[_0x50e7('0x29')](handleError(_0x488fff,null));};exports[_0x50e7('0x94')]=function(_0x4545a4,_0x29bc86,_0x2600e9){return db[_0x50e7('0x41')][_0x50e7('0x5a')]({'where':{'id':_0x4545a4['params']['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0x29bc86,null))[_0x50e7('0x37')](function(_0x46b424){if(_0x46b424){return _0x46b424[_0x50e7('0x94')](_0x4545a4[_0x50e7('0x45')][_0x50e7('0x76')])['then'](function(){if(_[_0x50e7('0x99')](_0x4545a4[_0x50e7('0x45')][_0x50e7('0x76')])){for(var _0x4ccd47=0x0;_0x4ccd47<_0x4545a4[_0x50e7('0x45')]['ids'][_0x50e7('0x4a')];_0x4ccd47+=0x1){socket[_0x50e7('0x98')](_0x50e7('0x95'),{'UserId':Number(_0x4545a4[_0x50e7('0x45')][_0x50e7('0x76')][_0x4ccd47]),'ChatQueueId':Number(_0x4545a4[_0x50e7('0x57')]['id'])});}}else{socket[_0x50e7('0x98')](_0x50e7('0x95'),{'UserId':Number(_0x4545a4[_0x50e7('0x45')]['ids']),'ChatQueueId':Number(_0x4545a4[_0x50e7('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x29bc86,null))[_0x50e7('0x29')](handleError(_0x29bc86,null));};exports[_0x50e7('0x9a')]=function(_0x2fbd42,_0x409a1a,_0x5380ca){var _0x458ae5={};var _0x2867e6={};var _0x4989e0;var _0x50571a;return db[_0x50e7('0x41')]['findOne']({'where':{'id':_0x2fbd42[_0x50e7('0x57')]['id']}})[_0x50e7('0x37')](handleEntityNotFound(_0x409a1a,null))[_0x50e7('0x37')](function(_0x37369b){if(_0x37369b){_0x4989e0=_0x37369b;_0x2867e6['model']=_[_0x50e7('0x58')](db[_0x50e7('0x81')][_0x50e7('0x42')]);_0x2867e6[_0x50e7('0x45')]=_['keys'](_0x2fbd42[_0x50e7('0x45')]);_0x2867e6[_0x50e7('0x4e')]=_[_0x50e7('0x46')](_0x2867e6[_0x50e7('0x47')],_0x2867e6[_0x50e7('0x45')]);_0x458ae5[_0x50e7('0x49')]=_['intersection'](_0x2867e6['model'],qs[_0x50e7('0x48')](_0x2fbd42[_0x50e7('0x45')][_0x50e7('0x48')]));_0x458ae5[_0x50e7('0x49')]=_0x458ae5[_0x50e7('0x49')][_0x50e7('0x4a')]?_0x458ae5[_0x50e7('0x49')]:_0x2867e6['model'];_0x458ae5[_0x50e7('0x73')]=qs[_0x50e7('0x4c')](_0x2fbd42['query'][_0x50e7('0x4c')]);_0x458ae5[_0x50e7('0x50')]=qs['filters'](_['pick'](_0x2fbd42[_0x50e7('0x45')],_0x2867e6[_0x50e7('0x4e')]));if(_0x2fbd42[_0x50e7('0x45')][_0x50e7('0x4f')]){_0x458ae5[_0x50e7('0x50')]=_['merge'](_0x458ae5[_0x50e7('0x50')],{'$or':_[_0x50e7('0x40')](_0x458ae5[_0x50e7('0x49')],function(_0xaf280f){var _0x5983fa={};_0x5983fa[_0xaf280f]={'$like':'%'+_0x2fbd42[_0x50e7('0x45')]['filter']+'%'};return _0x5983fa;})});}_0x458ae5=_[_0x50e7('0x51')]({},_0x458ae5,_0x2fbd42[_0x50e7('0x59')]);return _0x4989e0[_0x50e7('0x9a')](_0x458ae5);}})[_0x50e7('0x37')](function(_0xbe7b2c){if(_0xbe7b2c){_0x50571a=_0xbe7b2c[_0x50e7('0x4a')];if(!_0x2fbd42[_0x50e7('0x45')]['hasOwnProperty'](_0x50e7('0x4b'))){_0x458ae5[_0x50e7('0x2f')]=qs[_0x50e7('0x2f')](_0x2fbd42[_0x50e7('0x45')][_0x50e7('0x2f')]);_0x458ae5[_0x50e7('0x2c')]=qs[_0x50e7('0x2c')](_0x2fbd42[_0x50e7('0x45')][_0x50e7('0x2c')]);}return _0x4989e0[_0x50e7('0x9a')](_0x458ae5);}})[_0x50e7('0x37')](function(_0x428a5d){if(_0x428a5d){return _0x428a5d?{'count':_0x50571a,'rows':_0x428a5d}:null;}})[_0x50e7('0x37')](respondWithResult(_0x409a1a,null))[_0x50e7('0x29')](handleError(_0x409a1a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ac56583..1b760d4 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 _0xbd19=['update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','save'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0xbd19,0x9c));var _0x9bd1=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xbd19[_0x1762b4];return _0x29beda;};'use strict';var EventEmitter=require(_0x9bd1('0x0'));var ChatQueue=require(_0x9bd1('0x1'))['db'][_0x9bd1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9bd1('0x3'),'afterUpdate':_0x9bd1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5387ed){return function(_0x1334d1,_0x195477,_0x5d3570){ChatQueueEvents['emit'](_0x5387ed+':'+_0x1334d1['id'],_0x1334d1);ChatQueueEvents[_0x9bd1('0x5')](_0x5387ed,_0x1334d1);_0x5d3570(null);};}for(var e in events){if(events[_0x9bd1('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9bd1('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xb89a=['update','remove','emit','hasOwnProperty','exports','events','ChatQueue','setMaxListeners','save'];(function(_0x418fd8,_0xf30fde){var _0x384d42=function(_0x5f3cb0){while(--_0x5f3cb0){_0x418fd8['push'](_0x418fd8['shift']());}};_0x384d42(++_0xf30fde);}(_0xb89a,0x17f));var _0xab89=function(_0x1ed511,_0x5bd8f0){_0x1ed511=_0x1ed511-0x0;var _0x32ab7b=_0xb89a[_0x1ed511];return _0x32ab7b;};'use strict';var EventEmitter=require(_0xab89('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xab89('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xab89('0x2')](0x0);var events={'afterCreate':_0xab89('0x3'),'afterUpdate':_0xab89('0x4'),'afterDestroy':_0xab89('0x5')};function emitEvent(_0x36fe78){return function(_0x4741a8,_0x4a0241,_0x40de42){ChatQueueEvents[_0xab89('0x6')](_0x36fe78+':'+_0x4741a8['id'],_0x4741a8);ChatQueueEvents[_0xab89('0x6')](_0x36fe78,_0x4741a8);_0x40de42(null);};}for(var e in events){if(events[_0xab89('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xab89('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 11830a2..1688b41 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 _0xf3d0=['api','bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util'];(function(_0x55b8ea,_0x423435){var _0x416105=function(_0x192d9a){while(--_0x192d9a){_0x55b8ea['push'](_0x55b8ea['shift']());}};_0x416105(++_0x423435);}(_0xf3d0,0x170));var _0x0f3d=function(_0x19e8b5,_0x5ad4d1){_0x19e8b5=_0x19e8b5-0x0;var _0x1be01b=_0xf3d0[_0x19e8b5];return _0x1be01b;};'use strict';var _=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var logger=require('../../config/logger')(_0x0f3d('0x2'));var moment=require('moment');var BPromise=require(_0x0f3d('0x3'));var rp=require(_0x0f3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f3d('0x5'));var attributes=require(_0x0f3d('0x6'));module[_0x0f3d('0x7')]=function(_0x1698a3,_0x30aa3b){return _0x1698a3[_0x0f3d('0x8')](_0x0f3d('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc84b=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define'];(function(_0x4c2565,_0x2ea447){var _0x47e36b=function(_0x1f230f){while(--_0x1f230f){_0x4c2565['push'](_0x4c2565['shift']());}};_0x47e36b(++_0x2ea447);}(_0xc84b,0x1a6));var _0xbc84=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xc84b[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xbc84('0x0'));var util=require(_0xbc84('0x1'));var logger=require('../../config/logger')(_0xbc84('0x2'));var moment=require(_0xbc84('0x3'));var BPromise=require(_0xbc84('0x4'));var rp=require(_0xbc84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc84('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc84('0x7'));module[_0xbc84('0x8')]=function(_0xc8ecde,_0x19c4ec){return _0xc8ecde[_0xbc84('0x9')](_0xbc84('0xa'),attributes,{'tableName':_0xbc84('0xb'),'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 b216f77..d9121ab 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 _0x9822=['http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','map','stringify','ShowChatQueue','model','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9822,0x93));var _0x2982=function(_0x13d08f,_0x199fb4){_0x13d08f=_0x13d08f-0x0;var _0x104008=_0x9822[_0x13d08f];return _0x104008;};'use strict';var _=require(_0x2982('0x0'));var util=require(_0x2982('0x1'));var moment=require(_0x2982('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2982('0x3'))['db'];var utils=require(_0x2982('0x4'));var logger=require(_0x2982('0x5'))(_0x2982('0x6'));var config=require(_0x2982('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2982('0x8')][_0x2982('0x9')]({'port':0x232a});config['redis']=_[_0x2982('0xa')](config[_0x2982('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2982('0xc'))(new Redis(config[_0x2982('0xb')]));require(_0x2982('0xd'))[_0x2982('0xe')](socket);function respondWithRpcPromise(_0x4a31e0,_0x45277b,_0x587aa7){return new BPromise(function(_0x14f568,_0x31aed9){return client[_0x2982('0xf')](_0x4a31e0,_0x587aa7)[_0x2982('0x10')](function(_0x4954ba){logger[_0x2982('0x11')](_0x2982('0x12'),_0x45277b,_0x2982('0x13'));logger[_0x2982('0x14')](_0x2982('0x15'),_0x45277b,_0x2982('0x13'),JSON['stringify'](_0x4954ba));if(_0x4954ba[_0x2982('0x16')]){if(_0x4954ba[_0x2982('0x16')][_0x2982('0x17')]===0x1f4){logger[_0x2982('0x16')](_0x2982('0x12'),_0x45277b,_0x4954ba[_0x2982('0x16')][_0x2982('0x18')]);return _0x31aed9(_0x4954ba['error'][_0x2982('0x18')]);}logger['error'](_0x2982('0x12'),_0x45277b,_0x4954ba[_0x2982('0x16')][_0x2982('0x18')]);return _0x14f568(_0x4954ba['error'][_0x2982('0x18')]);}else{logger[_0x2982('0x11')](_0x2982('0x12'),_0x45277b,_0x2982('0x13'));_0x14f568(_0x4954ba[_0x2982('0x19')][_0x2982('0x18')]);}})[_0x2982('0x1a')](function(_0x4f5508){logger['error'](_0x2982('0x12'),_0x45277b,_0x4f5508);_0x31aed9(_0x4f5508);});});}exports[_0x2982('0x1b')]=function(_0x12d233){var _0x2a3dc7=this;return new Promise(function(_0x44ac29,_0x11d712){return db[_0x2982('0x1c')][_0x2982('0x1d')]({'raw':_0x12d233['options']?_0x12d233['options'][_0x2982('0x1e')]===undefined?!![]:![]:!![],'where':_0x12d233[_0x2982('0x1f')]?_0x12d233[_0x2982('0x1f')][_0x2982('0x20')]||null:null,'attributes':_0x12d233[_0x2982('0x1f')]?_0x12d233[_0x2982('0x1f')][_0x2982('0x21')]||null:null,'limit':_0x12d233['options']?_0x12d233[_0x2982('0x1f')]['limit']||null:null,'include':_0x12d233[_0x2982('0x1f')]?_0x12d233[_0x2982('0x1f')][_0x2982('0x22')]?_[_0x2982('0x23')](_0x12d233['options']['include'],function(_0x225b2f){return{'model':db[_0x225b2f['model']],'as':_0x225b2f['as'],'attributes':_0x225b2f[_0x2982('0x21')],'include':_0x225b2f[_0x2982('0x22')]?_[_0x2982('0x23')](_0x225b2f['include'],function(_0x5952f6){return{'model':db[_0x5952f6['model']],'as':_0x5952f6['as'],'attributes':_0x5952f6[_0x2982('0x21')],'include':_0x5952f6[_0x2982('0x22')]?_[_0x2982('0x23')](_0x5952f6[_0x2982('0x22')],function(_0x271f70){return{'model':db[_0x271f70['model']],'as':_0x271f70['as'],'attributes':_0x271f70[_0x2982('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2982('0x10')](function(_0x15146a){logger['info'](_0x2982('0x1b'),_0x12d233);logger['debug'](_0x2982('0x1b'),_0x12d233,JSON[_0x2982('0x24')](_0x15146a));_0x44ac29(_0x15146a);})[_0x2982('0x1a')](function(_0x34206e){logger[_0x2982('0x16')](_0x2982('0x1b'),_0x34206e['message'],_0x12d233);_0x11d712(_0x2a3dc7[_0x2982('0x16')](0x1f4,_0x34206e['message']));});});};exports[_0x2982('0x25')]=function(_0x1c15fd){var _0x3abe3f=this;return new Promise(function(_0x420c5d,_0x4b35a7){return db[_0x2982('0x1c')]['find']({'raw':_0x1c15fd[_0x2982('0x1f')]?_0x1c15fd[_0x2982('0x1f')][_0x2982('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c15fd[_0x2982('0x1f')]?_0x1c15fd[_0x2982('0x1f')][_0x2982('0x20')]||null:null,'attributes':_0x1c15fd[_0x2982('0x1f')]?_0x1c15fd[_0x2982('0x1f')][_0x2982('0x21')]||null:null,'include':_0x1c15fd[_0x2982('0x1f')]?_0x1c15fd[_0x2982('0x1f')][_0x2982('0x22')]?_[_0x2982('0x23')](_0x1c15fd[_0x2982('0x1f')]['include'],function(_0xebbf0c){return{'model':db[_0xebbf0c[_0x2982('0x26')]],'as':_0xebbf0c['as'],'attributes':_0xebbf0c['attributes'],'include':_0xebbf0c[_0x2982('0x22')]?_['map'](_0xebbf0c['include'],function(_0x171f39){return{'model':db[_0x171f39[_0x2982('0x26')]],'as':_0x171f39['as'],'attributes':_0x171f39[_0x2982('0x21')],'include':_0x171f39[_0x2982('0x22')]?_[_0x2982('0x23')](_0x171f39[_0x2982('0x22')],function(_0x36f048){return{'model':db[_0x36f048[_0x2982('0x26')]],'as':_0x36f048['as'],'attributes':_0x36f048['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a09e8){logger[_0x2982('0x11')](_0x2982('0x25'),_0x1c15fd);logger[_0x2982('0x14')]('ShowChatQueue',_0x1c15fd,JSON[_0x2982('0x24')](_0x4a09e8));_0x420c5d(_0x4a09e8);})['catch'](function(_0x1c5296){logger[_0x2982('0x16')]('ShowChatQueue',_0x1c5296[_0x2982('0x18')],_0x1c15fd);_0x4b35a7(_0x3abe3f[_0x2982('0x16')](0x1f4,_0x1c5296[_0x2982('0x18')]));});});}; \ No newline at end of file +var _0x94d2=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x94d2,0x1cd));var _0x294d=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x94d2[_0x4996d5];return _0x4793f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x294d('0xa')],{'host':_0x294d('0xb'),'port':0x18eb});var socket=require(_0x294d('0xc'))(new Redis(config[_0x294d('0xa')]));require(_0x294d('0xd'))['register'](socket);function respondWithRpcPromise(_0x7931bb,_0x297494,_0x53d5f5){return new BPromise(function(_0x20af48,_0x18fde9){return client['request'](_0x7931bb,_0x53d5f5)['then'](function(_0x165330){logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,'request\x20sent');logger[_0x294d('0x10')](_0x294d('0x11'),_0x297494,_0x294d('0x12'),JSON[_0x294d('0x13')](_0x165330));if(_0x165330['error']){if(_0x165330[_0x294d('0x14')]['code']===0x1f4){logger['error'](_0x294d('0xf'),_0x297494,_0x165330[_0x294d('0x14')][_0x294d('0x15')]);return _0x18fde9(_0x165330[_0x294d('0x14')]['message']);}logger[_0x294d('0x14')]('ChatQueue,\x20%s,\x20%s',_0x297494,_0x165330['error']['message']);return _0x20af48(_0x165330['error'][_0x294d('0x15')]);}else{logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,_0x294d('0x12'));_0x20af48(_0x165330[_0x294d('0x16')][_0x294d('0x15')]);}})[_0x294d('0x17')](function(_0x9a7c6a){logger['error'](_0x294d('0xf'),_0x297494,_0x9a7c6a);_0x18fde9(_0x9a7c6a);});});}exports[_0x294d('0x18')]=function(_0x578e13){var _0xa9338a=this;return new Promise(function(_0x19cee1,_0x429da3){return db[_0x294d('0x19')][_0x294d('0x1a')]({'raw':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1c')]===undefined?!![]:![]:!![],'where':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1d')]||null:null,'attributes':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1e')]||null:null,'limit':_0x578e13[_0x294d('0x1b')]?_0x578e13['options']['limit']||null:null,'include':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1f')]?_[_0x294d('0x20')](_0x578e13[_0x294d('0x1b')][_0x294d('0x1f')],function(_0x4da072){return{'model':db[_0x4da072[_0x294d('0x21')]],'as':_0x4da072['as'],'attributes':_0x4da072['attributes'],'include':_0x4da072[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x4da072[_0x294d('0x1f')],function(_0x1f2dd7){return{'model':db[_0x1f2dd7[_0x294d('0x21')]],'as':_0x1f2dd7['as'],'attributes':_0x1f2dd7[_0x294d('0x1e')],'include':_0x1f2dd7[_0x294d('0x1f')]?_['map'](_0x1f2dd7[_0x294d('0x1f')],function(_0x2b2072){return{'model':db[_0x2b2072[_0x294d('0x21')]],'as':_0x2b2072['as'],'attributes':_0x2b2072[_0x294d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x294d('0x22')](function(_0x338cc1){logger[_0x294d('0xe')](_0x294d('0x18'),_0x578e13);logger['debug'](_0x294d('0x18'),_0x578e13,JSON[_0x294d('0x13')](_0x338cc1));_0x19cee1(_0x338cc1);})[_0x294d('0x17')](function(_0x3cf02d){logger['error']('GetChatQueue',_0x3cf02d[_0x294d('0x15')],_0x578e13);_0x429da3(_0xa9338a[_0x294d('0x14')](0x1f4,_0x3cf02d[_0x294d('0x15')]));});});};exports[_0x294d('0x23')]=function(_0x395ed8){var _0x15353d=this;return new Promise(function(_0x1e445f,_0x16c3e1){return db[_0x294d('0x19')]['find']({'raw':_0x395ed8[_0x294d('0x1b')]?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1c')]===undefined?!![]:![]:!![],'where':_0x395ed8['options']?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1d')]||null:null,'attributes':_0x395ed8['options']?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1e')]||null:null,'include':_0x395ed8['options']?_0x395ed8['options'][_0x294d('0x1f')]?_[_0x294d('0x20')](_0x395ed8[_0x294d('0x1b')]['include'],function(_0x37aa78){return{'model':db[_0x37aa78[_0x294d('0x21')]],'as':_0x37aa78['as'],'attributes':_0x37aa78[_0x294d('0x1e')],'include':_0x37aa78[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x37aa78[_0x294d('0x1f')],function(_0x2b70e3){return{'model':db[_0x2b70e3[_0x294d('0x21')]],'as':_0x2b70e3['as'],'attributes':_0x2b70e3[_0x294d('0x1e')],'include':_0x2b70e3[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x2b70e3[_0x294d('0x1f')],function(_0x496941){return{'model':db[_0x496941[_0x294d('0x21')]],'as':_0x496941['as'],'attributes':_0x496941[_0x294d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x294d('0x22')](function(_0x538381){logger[_0x294d('0xe')](_0x294d('0x23'),_0x395ed8);logger[_0x294d('0x10')](_0x294d('0x23'),_0x395ed8,JSON['stringify'](_0x538381));_0x1e445f(_0x538381);})[_0x294d('0x17')](function(_0x22066a){logger[_0x294d('0x14')]('ShowChatQueue',_0x22066a[_0x294d('0x15')],_0x395ed8);_0x16c3e1(_0x15353d[_0x294d('0x14')](0x1f4,_0x22066a[_0x294d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e1e46c0..902895d 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 _0x0b78=['removeListener','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b78,0x1ad));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var ChatQueueEvents=require(_0x80b7('0x0'));var events=[_0x80b7('0x1'),'remove',_0x80b7('0x2')];function createListener(_0x4f55ab,_0x4bffac){return function(_0x261012){_0x4bffac['emit'](_0x4f55ab,_0x261012);};}function removeListener(_0x6a187e,_0x89d4d7){return function(){ChatQueueEvents[_0x80b7('0x3')](_0x6a187e,_0x89d4d7);};}exports['register']=function(_0x49bc7f){for(var _0x167ddd=0x0,_0x584401=events[_0x80b7('0x4')];_0x167ddd<_0x584401;_0x167ddd++){var _0x122ebe=events[_0x167ddd];var _0x3c248d=createListener(_0x80b7('0x5')+_0x122ebe,_0x49bc7f);ChatQueueEvents['on'](_0x122ebe,_0x3c248d);}}; \ No newline at end of file +var _0xb4e6=['removeListener','register','./chatQueue.events','remove','update','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xb4e6[_0xdea41a];return _0x15d0d8;};'use strict';var ChatQueueEvents=require(_0x6b4e('0x0'));var events=['save',_0x6b4e('0x1'),_0x6b4e('0x2')];function createListener(_0x365912,_0x25ffcb){return function(_0x44e781){_0x25ffcb[_0x6b4e('0x3')](_0x365912,_0x44e781);};}function removeListener(_0x1929b8,_0x52313b){return function(){ChatQueueEvents[_0x6b4e('0x4')](_0x1929b8,_0x52313b);};}exports[_0x6b4e('0x5')]=function(_0x1f67a2){for(var _0x49de51=0x0,_0xd3138f=events['length'];_0x49de51<_0xd3138f;_0x49de51++){var _0x4f00be=events[_0x49de51];var _0x2311d9=createListener('chatQueue:'+_0x4f00be,_0x1f67a2);ChatQueueEvents['on'](_0x4f00be,_0x2311d9);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 10888eb..85c5928 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 _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(_0x5e4fe3,_0x26d7b0){var _0x3f3595=function(_0x5e89d3){while(--_0x5e89d3){_0x5e4fe3['push'](_0x5e4fe3['shift']());}};_0x3f3595(++_0x26d7b0);}(_0xe14b,0x93));var _0xbe14=function(_0x7fc3bc,_0x32e792){_0x7fc3bc=_0x7fc3bc-0x0;var _0x8134d5=_0xe14b[_0x7fc3bc];return _0x8134d5;};'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 +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x1820aa,_0x1dc480){var _0x2cd876=function(_0x51da1f){while(--_0x51da1f){_0x1820aa['push'](_0x1820aa['shift']());}};_0x2cd876(++_0x1dc480);}(_0x55ca,0x126));var _0xa55c=function(_0x3d71a3,_0x3a33b7){_0x3d71a3=_0x3d71a3-0x0;var _0x5bb3ab=_0x55ca[_0x3d71a3];return _0x5bb3ab;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('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 22d1ad4..7b55af8 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 _0x6c03=['STRING','DATE','moment','sequelize','exports'];(function(_0x48e6f1,_0x1bd3e8){var _0x154ae1=function(_0x253b58){while(--_0x253b58){_0x48e6f1['push'](_0x48e6f1['shift']());}};_0x154ae1(++_0x1bd3e8);}(_0x6c03,0x98));var _0x36c0=function(_0x1007f4,_0x5d85ea){_0x1007f4=_0x1007f4-0x0;var _0x3e7182=_0x6c03[_0x1007f4];return _0x3e7182;};'use strict';var moment=require(_0x36c0('0x0'));var Sequelize=require(_0x36c0('0x1'));module[_0x36c0('0x2')]={'uniqueid':{'type':Sequelize[_0x36c0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x36c0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x36c0('0x4')]},'acceptAt':{'type':Sequelize[_0x36c0('0x4')]},'exitAt':{'type':Sequelize[_0x36c0('0x4')]},'reason':{'type':Sequelize[_0x36c0('0x3')]}}; \ No newline at end of file +var _0xa50d=['sequelize','exports','STRING','DATE','moment'];(function(_0x21dc73,_0x3dd7a3){var _0x296135=function(_0x576042){while(--_0x576042){_0x21dc73['push'](_0x21dc73['shift']());}};_0x296135(++_0x3dd7a3);}(_0xa50d,0x86));var _0xda50=function(_0x26e0c5,_0xb24454){_0x26e0c5=_0x26e0c5-0x0;var _0x4877e7=_0xa50d[_0x26e0c5];return _0x4877e7;};'use strict';var moment=require(_0xda50('0x0'));var Sequelize=require(_0xda50('0x1'));module[_0xda50('0x2')]={'uniqueid':{'type':Sequelize[_0xda50('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xda50('0x3')]},'joinAt':{'type':Sequelize[_0xda50('0x4')]},'leaveAt':{'type':Sequelize[_0xda50('0x4')]},'acceptAt':{'type':Sequelize[_0xda50('0x4')]},'exitAt':{'type':Sequelize[_0xda50('0x4')]},'reason':{'type':Sequelize[_0xda50('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index cb25b99..a0a5536 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 _0x5031=['name','send','index','map','rawAttributes','fieldName','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','find','catch','create','ChatQueueReport','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack'];(function(_0x19a673,_0x36befd){var _0x3d893d=function(_0xa287ea){while(--_0xa287ea){_0x19a673['push'](_0x19a673['shift']());}};_0x3d893d(++_0x36befd);}(_0x5031,0x144));var _0x1503=function(_0x243c7f,_0x45be84){_0x243c7f=_0x243c7f-0x0;var _0x1faeb9=_0x5031[_0x243c7f];return _0x1faeb9;};'use strict';var emlformat=require(_0x1503('0x0'));var rimraf=require(_0x1503('0x1'));var zipdir=require(_0x1503('0x2'));var jsonpatch=require(_0x1503('0x3'));var rp=require(_0x1503('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1503('0x5'));var util=require(_0x1503('0x6'));var path=require(_0x1503('0x7'));var sox=require(_0x1503('0x8'));var csv=require(_0x1503('0x9'));var ejs=require(_0x1503('0xa'));var fs=require('fs');var fs_extra=require(_0x1503('0xb'));var _=require(_0x1503('0xc'));var squel=require(_0x1503('0xd'));var crypto=require('crypto');var jsforce=require(_0x1503('0xe'));var deskjs=require(_0x1503('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1503('0x10'));var Papa=require(_0x1503('0x11'));var Redis=require(_0x1503('0x12'));var authService=require(_0x1503('0x13'));var qs=require(_0x1503('0x14'));var as=require(_0x1503('0x15'));var hardwareService=require(_0x1503('0x16'));var logger=require(_0x1503('0x17'))(_0x1503('0x18'));var utils=require(_0x1503('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1503('0x1a'));var db=require(_0x1503('0x1b'))['db'];function respondWithStatusCode(_0x178564,_0x3431be){_0x3431be=_0x3431be||0xcc;return function(_0x3fd873){if(_0x3fd873){return _0x178564['sendStatus'](_0x3431be);}return _0x178564[_0x1503('0x1c')](_0x3431be)[_0x1503('0x1d')]();};}function respondWithResult(_0x1f5753,_0x8395f){_0x8395f=_0x8395f||0xc8;return function(_0x3ab7c2){if(_0x3ab7c2){return _0x1f5753[_0x1503('0x1c')](_0x8395f)[_0x1503('0x1e')](_0x3ab7c2);}};}function respondWithFilteredResult(_0xf8d9c1,_0x4405a8){return function(_0x1e35b2){if(_0x1e35b2){var _0x38868d=typeof _0x4405a8[_0x1503('0x1f')]===_0x1503('0x20')&&typeof _0x4405a8[_0x1503('0x21')]===_0x1503('0x20');var _0x15bcf0=_0x1e35b2[_0x1503('0x22')];var _0x3dc3c5=_0x38868d?0x0:_0x4405a8[_0x1503('0x1f')];var _0x4c7390=_0x38868d?_0x1e35b2[_0x1503('0x22')]:_0x4405a8[_0x1503('0x1f')]+_0x4405a8[_0x1503('0x21')];var _0x2e83aa;if(_0x4c7390>=_0x15bcf0){_0x4c7390=_0x15bcf0;_0x2e83aa=0xc8;}else{_0x2e83aa=0xce;}_0xf8d9c1[_0x1503('0x1c')](_0x2e83aa);return _0xf8d9c1['set']('Content-Range',_0x3dc3c5+'-'+_0x4c7390+'/'+_0x15bcf0)['json'](_0x1e35b2);}return null;};}function patchUpdates(_0x57a7ea){return function(_0x3ac90b){try{jsonpatch[_0x1503('0x23')](_0x3ac90b,_0x57a7ea,!![]);}catch(_0x2fc15b){return BPromise[_0x1503('0x24')](_0x2fc15b);}return _0x3ac90b['save']();};}function saveUpdates(_0xcf9963,_0x3b9835){return function(_0x13e757){if(_0x13e757){return _0x13e757[_0x1503('0x25')](_0xcf9963)[_0x1503('0x26')](function(_0x68d82){return _0x68d82;});}return null;};}function removeEntity(_0x13db4e,_0xde9620){return function(_0x8cc216){if(_0x8cc216){return _0x8cc216['destroy']()[_0x1503('0x26')](function(){_0x13db4e['status'](0xcc)[_0x1503('0x1d')]();});}};}function handleEntityNotFound(_0x2e8ee1,_0x136413){return function(_0x223cf2){if(!_0x223cf2){_0x2e8ee1['sendStatus'](0x194);}return _0x223cf2;};}function handleError(_0x346f55,_0x2057bd){_0x2057bd=_0x2057bd||0x1f4;return function(_0x1116b0){logger[_0x1503('0x27')](_0x1116b0[_0x1503('0x28')]);if(_0x1116b0[_0x1503('0x29')]){delete _0x1116b0['name'];}_0x346f55[_0x1503('0x1c')](_0x2057bd)[_0x1503('0x2a')](_0x1116b0);};}exports[_0x1503('0x2b')]=function(_0xc5ccef,_0x339a11){var _0xcdb7ea={},_0x3e7b2b={},_0x2cb8fa={'count':0x0,'rows':[]};var _0x13ec48=_[_0x1503('0x2c')](db['ChatQueueReport'][_0x1503('0x2d')],function(_0x1ea152){return{'name':_0x1ea152[_0x1503('0x2e')],'type':_0x1ea152['type']['key']};});_0x3e7b2b['model']=_[_0x1503('0x2c')](_0x13ec48,'name');_0x3e7b2b['query']=_[_0x1503('0x2f')](_0xc5ccef[_0x1503('0x30')]);_0x3e7b2b[_0x1503('0x31')]=_[_0x1503('0x32')](_0x3e7b2b['model'],_0x3e7b2b[_0x1503('0x30')]);_0xcdb7ea['attributes']=_[_0x1503('0x32')](_0x3e7b2b[_0x1503('0x33')],qs[_0x1503('0x34')](_0xc5ccef[_0x1503('0x30')]['fields']));_0xcdb7ea[_0x1503('0x35')]=_0xcdb7ea[_0x1503('0x35')]['length']?_0xcdb7ea[_0x1503('0x35')]:_0x3e7b2b[_0x1503('0x33')];if(!_0xc5ccef['query'][_0x1503('0x36')](_0x1503('0x37'))){_0xcdb7ea[_0x1503('0x21')]=qs[_0x1503('0x21')](_0xc5ccef['query'][_0x1503('0x21')]);_0xcdb7ea[_0x1503('0x1f')]=qs[_0x1503('0x1f')](_0xc5ccef[_0x1503('0x30')][_0x1503('0x1f')]);}_0xcdb7ea['order']=qs[_0x1503('0x38')](_0xc5ccef[_0x1503('0x30')]['sort']);_0xcdb7ea[_0x1503('0x39')]=qs[_0x1503('0x31')](_[_0x1503('0x3a')](_0xc5ccef[_0x1503('0x30')],_0x3e7b2b['filters']),_0x13ec48);if(_0xc5ccef['query'][_0x1503('0x3b')]){_0xcdb7ea[_0x1503('0x39')]=_[_0x1503('0x3c')](_0xcdb7ea[_0x1503('0x39')],{'$or':_[_0x1503('0x2c')](_0x13ec48,function(_0x162d8d){if(_0x162d8d[_0x1503('0x3d')]!==_0x1503('0x3e')){var _0x410a38={};_0x410a38[_0x162d8d[_0x1503('0x29')]]={'$like':'%'+_0xc5ccef[_0x1503('0x30')][_0x1503('0x3b')]+'%'};return _0x410a38;}})});}_0xcdb7ea=_[_0x1503('0x3c')]({},_0xcdb7ea,_0xc5ccef[_0x1503('0x3f')]);var _0x264e54={'where':_0xcdb7ea[_0x1503('0x39')]};return db['ChatQueueReport']['count'](_0x264e54)[_0x1503('0x26')](function(_0xd2feb9){_0x2cb8fa[_0x1503('0x22')]=_0xd2feb9;if(_0xc5ccef[_0x1503('0x30')][_0x1503('0x40')]){_0xcdb7ea[_0x1503('0x41')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0xcdb7ea);})[_0x1503('0x26')](function(_0x21128b){_0x2cb8fa['rows']=_0x21128b;return _0x2cb8fa;})[_0x1503('0x26')](respondWithFilteredResult(_0x339a11,_0xcdb7ea))['catch'](handleError(_0x339a11,null));};exports[_0x1503('0x42')]=function(_0x3aa5ca,_0x501340){var _0x54722c={'raw':!![],'where':{'id':_0x3aa5ca[_0x1503('0x43')]['id']}},_0x3a1501={};_0x3a1501['model']=_[_0x1503('0x2f')](db['ChatQueueReport']['rawAttributes']);_0x3a1501[_0x1503('0x30')]=_['keys'](_0x3aa5ca[_0x1503('0x30')]);_0x3a1501[_0x1503('0x31')]=_[_0x1503('0x32')](_0x3a1501[_0x1503('0x33')],_0x3a1501[_0x1503('0x30')]);_0x54722c[_0x1503('0x35')]=_[_0x1503('0x32')](_0x3a1501['model'],qs['fields'](_0x3aa5ca[_0x1503('0x30')][_0x1503('0x34')]));_0x54722c['attributes']=_0x54722c[_0x1503('0x35')]['length']?_0x54722c[_0x1503('0x35')]:_0x3a1501[_0x1503('0x33')];if(_0x3aa5ca[_0x1503('0x30')][_0x1503('0x40')]){_0x54722c[_0x1503('0x41')]=[{'all':!![]}];}_0x54722c=_[_0x1503('0x3c')]({},_0x54722c,_0x3aa5ca[_0x1503('0x3f')]);return db['ChatQueueReport'][_0x1503('0x44')](_0x54722c)[_0x1503('0x26')](handleEntityNotFound(_0x501340,null))[_0x1503('0x26')](respondWithResult(_0x501340,null))[_0x1503('0x45')](handleError(_0x501340,null));};exports[_0x1503('0x46')]=function(_0xd968c1,_0xa9d898){return db[_0x1503('0x47')][_0x1503('0x46')](_0xd968c1[_0x1503('0x48')],{})[_0x1503('0x26')](respondWithResult(_0xa9d898,0xc9))[_0x1503('0x45')](handleError(_0xa9d898,null));};exports[_0x1503('0x25')]=function(_0x581061,_0x416d3b){if(_0x581061[_0x1503('0x48')]['id']){delete _0x581061['body']['id'];}return db['ChatQueueReport'][_0x1503('0x44')]({'where':{'id':_0x581061[_0x1503('0x43')]['id']}})[_0x1503('0x26')](handleEntityNotFound(_0x416d3b,null))[_0x1503('0x26')](saveUpdates(_0x581061[_0x1503('0x48')],null))[_0x1503('0x26')](respondWithResult(_0x416d3b,null))[_0x1503('0x45')](handleError(_0x416d3b,null));};exports['destroy']=function(_0x269bb6,_0x37113e){return db[_0x1503('0x47')][_0x1503('0x44')]({'where':{'id':_0x269bb6[_0x1503('0x43')]['id']}})[_0x1503('0x26')](handleEntityNotFound(_0x37113e,null))[_0x1503('0x26')](removeEntity(_0x37113e,null))[_0x1503('0x45')](handleError(_0x37113e,null));};exports['describe']=function(_0x41b628,_0x5b7884){return db[_0x1503('0x47')]['describe']()[_0x1503('0x26')](respondWithResult(_0x5b7884,null))[_0x1503('0x45')](handleError(_0x5b7884,null));}; \ No newline at end of file +var _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','ChatQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x23c3f4,_0x24f0b3){var _0x82f0f1=function(_0x1071d6){while(--_0x1071d6){_0x23c3f4['push'](_0x23c3f4['shift']());}};_0x82f0f1(++_0x24f0b3);}(_0x4c60,0xc1));var _0x04c6=function(_0x38bee5,_0x3c97e7){_0x38bee5=_0x38bee5-0x0;var _0x1c35b3=_0x4c60[_0x38bee5];return _0x1c35b3;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['ChatQueueReport'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['ChatQueueReport'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['ChatQueueReport'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['ChatQueueReport'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index ad73f50..6155de8 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x30947d,_0x4cb661){var _0xfadaab=function(_0x280b14){while(--_0x280b14){_0x30947d['push'](_0x30947d['shift']());}};_0xfadaab(++_0x4cb661);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0xcb91[_0x33554b];return _0x256954;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3d89ce,_0x5d5e4b){var _0x494a2e=function(_0x1222b8){while(--_0x1222b8){_0x3d89ce['push'](_0x3d89ce['shift']());}};_0x494a2e(++_0x5d5e4b);}(_0xb10b,0x12a));var _0xbb10=function(_0x425a95,_0x2743b6){_0x425a95=_0x425a95-0x0;var _0x270c10=_0xb10b[_0x425a95];return _0x270c10;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('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 19ff0a2..7b582b4 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 _0x987f=['../../mysqldb','../../config/utils','rpc','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','body','options','UpdateChatQueueReport','raw','where','attributes','limit','catch','lodash','moment','bluebird'];(function(_0x3ffe9d,_0x3bf76d){var _0x37eb59=function(_0x3fa9da){while(--_0x3fa9da){_0x3ffe9d['push'](_0x3ffe9d['shift']());}};_0x37eb59(++_0x3bf76d);}(_0x987f,0x169));var _0xf987=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x987f[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0xf987('0x0'));var util=require('util');var moment=require(_0xf987('0x1'));var BPromise=require(_0xf987('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf987('0x3'))['db'];var utils=require(_0xf987('0x4'));var logger=require('../../config/logger')(_0xf987('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf987('0x6')][_0xf987('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45bfe6,_0x58e651,_0x1ba4bd){return new BPromise(function(_0x2bc3d2,_0xd83c97){return client['request'](_0x45bfe6,_0x1ba4bd)[_0xf987('0x8')](function(_0x51dd26){logger[_0xf987('0x9')](_0xf987('0xa'),_0x58e651,_0xf987('0xb'));logger[_0xf987('0xc')](_0xf987('0xd'),_0x58e651,_0xf987('0xb'),JSON[_0xf987('0xe')](_0x51dd26));if(_0x51dd26[_0xf987('0xf')]){if(_0x51dd26[_0xf987('0xf')][_0xf987('0x10')]===0x1f4){logger['error'](_0xf987('0xa'),_0x58e651,_0x51dd26[_0xf987('0xf')][_0xf987('0x11')]);return _0xd83c97(_0x51dd26['error'][_0xf987('0x11')]);}logger[_0xf987('0xf')](_0xf987('0xa'),_0x58e651,_0x51dd26[_0xf987('0xf')][_0xf987('0x11')]);return _0x2bc3d2(_0x51dd26[_0xf987('0xf')]['message']);}else{logger[_0xf987('0x9')](_0xf987('0xa'),_0x58e651,_0xf987('0xb'));_0x2bc3d2(_0x51dd26['result'][_0xf987('0x11')]);}})['catch'](function(_0x5332eb){logger[_0xf987('0xf')](_0xf987('0xa'),_0x58e651,_0x5332eb);_0xd83c97(_0x5332eb);});});}exports[_0xf987('0x12')]=function(_0x135f2e){var _0x10bad2=this;return new Promise(function(_0x4476ef,_0x3c088a){return db[_0xf987('0x13')]['create'](_0x135f2e[_0xf987('0x14')],{'raw':_0x135f2e[_0xf987('0x15')]?_0x135f2e[_0xf987('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf987('0x8')](function(_0x2bdc96){logger['info']('CreateChatQueueReport',_0x135f2e);logger[_0xf987('0xc')](_0xf987('0x12'),_0x135f2e,JSON[_0xf987('0xe')](_0x2bdc96));_0x4476ef(_0x2bdc96);})['catch'](function(_0x2ce105){logger[_0xf987('0xf')]('CreateChatQueueReport',_0x2ce105['message'],_0x135f2e);_0x3c088a(_0x10bad2['error'](0x1f4,_0x2ce105[_0xf987('0x11')]));});});};exports[_0xf987('0x16')]=function(_0x3ed91c){var _0x1a002a=this;return new Promise(function(_0xea0093,_0x395b22){return db['ChatQueueReport']['update'](_0x3ed91c[_0xf987('0x14')],{'raw':_0x3ed91c[_0xf987('0x15')]?_0x3ed91c['options'][_0xf987('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed91c[_0xf987('0x15')]?_0x3ed91c[_0xf987('0x15')][_0xf987('0x18')]||null:null,'attributes':_0x3ed91c[_0xf987('0x15')]?_0x3ed91c['options'][_0xf987('0x19')]||null:null,'limit':_0x3ed91c[_0xf987('0x15')]?_0x3ed91c[_0xf987('0x15')][_0xf987('0x1a')]||null:null})[_0xf987('0x8')](function(_0x418e61){logger[_0xf987('0x9')](_0xf987('0x16'),_0x3ed91c);logger['debug'](_0xf987('0x16'),_0x3ed91c,JSON[_0xf987('0xe')](_0x418e61));_0xea0093(_0x418e61);})[_0xf987('0x1b')](function(_0x446745){logger[_0xf987('0xf')](_0xf987('0x16'),_0x446745['message'],_0x3ed91c);_0x395b22(_0x1a002a[_0xf987('0xf')](0x1f4,_0x446745['message']));});});}; \ No newline at end of file +var _0x8c9a=['../../config/logger','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CreateChatQueueReport','ChatQueueReport','create','options','then','debug','UpdateChatQueueReport','update','body','raw','where','attributes','limit','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x1f11dd,_0xf2be6b){var _0x5b5d9a=function(_0x1ff2d0){while(--_0x1ff2d0){_0x1f11dd['push'](_0x1f11dd['shift']());}};_0x5b5d9a(++_0xf2be6b);}(_0x8c9a,0x1bb));var _0xa8c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c9a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa8c9('0x0'));var util=require(_0xa8c9('0x1'));var moment=require(_0xa8c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8c9('0x3'));var db=require(_0xa8c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8c9('0x5'))(_0xa8c9('0x6'));var config=require(_0xa8c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa8c9('0x8')][_0xa8c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22be3c,_0xbd3ef7,_0x5aa4e4){return new BPromise(function(_0x3f84d6,_0x2498e1){return client[_0xa8c9('0xa')](_0x22be3c,_0x5aa4e4)['then'](function(_0x510254){logger[_0xa8c9('0xb')](_0xa8c9('0xc'),_0xbd3ef7,'request\x20sent');logger['debug'](_0xa8c9('0xd'),_0xbd3ef7,_0xa8c9('0xe'),JSON[_0xa8c9('0xf')](_0x510254));if(_0x510254['error']){if(_0x510254[_0xa8c9('0x10')]['code']===0x1f4){logger[_0xa8c9('0x10')](_0xa8c9('0xc'),_0xbd3ef7,_0x510254[_0xa8c9('0x10')][_0xa8c9('0x11')]);return _0x2498e1(_0x510254['error'][_0xa8c9('0x11')]);}logger[_0xa8c9('0x10')](_0xa8c9('0xc'),_0xbd3ef7,_0x510254['error'][_0xa8c9('0x11')]);return _0x3f84d6(_0x510254['error'][_0xa8c9('0x11')]);}else{logger[_0xa8c9('0xb')](_0xa8c9('0xc'),_0xbd3ef7,'request\x20sent');_0x3f84d6(_0x510254['result']['message']);}})['catch'](function(_0x3d0668){logger['error'](_0xa8c9('0xc'),_0xbd3ef7,_0x3d0668);_0x2498e1(_0x3d0668);});});}exports[_0xa8c9('0x12')]=function(_0x5da3f5){var _0xcb73a=this;return new Promise(function(_0x237d31,_0x4b91b8){return db[_0xa8c9('0x13')][_0xa8c9('0x14')](_0x5da3f5['body'],{'raw':_0x5da3f5[_0xa8c9('0x15')]?_0x5da3f5[_0xa8c9('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xa8c9('0x16')](function(_0x5f254b){logger['info'](_0xa8c9('0x12'),_0x5da3f5);logger[_0xa8c9('0x17')](_0xa8c9('0x12'),_0x5da3f5,JSON['stringify'](_0x5f254b));_0x237d31(_0x5f254b);})['catch'](function(_0x2b7389){logger[_0xa8c9('0x10')](_0xa8c9('0x12'),_0x2b7389[_0xa8c9('0x11')],_0x5da3f5);_0x4b91b8(_0xcb73a['error'](0x1f4,_0x2b7389[_0xa8c9('0x11')]));});});};exports[_0xa8c9('0x18')]=function(_0xc9097a){var _0xf07602=this;return new Promise(function(_0x1cbd61,_0x29a787){return db['ChatQueueReport'][_0xa8c9('0x19')](_0xc9097a[_0xa8c9('0x1a')],{'raw':_0xc9097a[_0xa8c9('0x15')]?_0xc9097a[_0xa8c9('0x15')][_0xa8c9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9097a[_0xa8c9('0x15')]?_0xc9097a['options'][_0xa8c9('0x1c')]||null:null,'attributes':_0xc9097a[_0xa8c9('0x15')]?_0xc9097a[_0xa8c9('0x15')][_0xa8c9('0x1d')]||null:null,'limit':_0xc9097a[_0xa8c9('0x15')]?_0xc9097a[_0xa8c9('0x15')][_0xa8c9('0x1e')]||null:null})[_0xa8c9('0x16')](function(_0xc578eb){logger[_0xa8c9('0xb')](_0xa8c9('0x18'),_0xc9097a);logger[_0xa8c9('0x17')](_0xa8c9('0x18'),_0xc9097a,JSON[_0xa8c9('0xf')](_0xc578eb));_0x1cbd61(_0xc578eb);})[_0xa8c9('0x1f')](function(_0x261cad){logger[_0xa8c9('0x10')](_0xa8c9('0x18'),_0x261cad[_0xa8c9('0x11')],_0xc9097a);_0x29a787(_0xf07602[_0xa8c9('0x10')](0x1f4,_0x261cad[_0xa8c9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index bd3a40b..779ed09 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 _0x17ce=['./chatQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x17ce,0x107));var _0xe17c=function(_0x1fffe0,_0x261085){_0x1fffe0=_0x1fffe0-0x0;var _0x80eb97=_0x17ce[_0x1fffe0];return _0x80eb97;};'use strict';var multer=require(_0xe17c('0x0'));var util=require(_0xe17c('0x1'));var path=require(_0xe17c('0x2'));var timeout=require(_0xe17c('0x3'));var express=require(_0xe17c('0x4'));var router=express[_0xe17c('0x5')]();var fs_extra=require(_0xe17c('0x6'));var auth=require(_0xe17c('0x7'));var interaction=require(_0xe17c('0x8'));var config=require(_0xe17c('0x9'));var controller=require(_0xe17c('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe17c('0xb')]('/describe',auth[_0xe17c('0xc')](),controller[_0xe17c('0xd')]);router['get'](_0xe17c('0xe'),auth[_0xe17c('0xc')](),controller[_0xe17c('0xf')]);router[_0xe17c('0x10')]('/',auth['isAuthenticated'](),controller[_0xe17c('0x11')]);router['put'](_0xe17c('0xe'),auth['isAuthenticated'](),controller[_0xe17c('0x12')]);router['delete']('/:id',auth[_0xe17c('0xc')](),controller[_0xe17c('0x13')]);module[_0xe17c('0x14')]=router; \ No newline at end of file +var _0xc55f=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xc55f,0x153));var _0xfc55=function(_0x313ebc,_0x4ff73e){_0x313ebc=_0x313ebc-0x0;var _0x1947eb=_0xc55f[_0x313ebc];return _0x1947eb;};'use strict';var multer=require(_0xfc55('0x0'));var util=require(_0xfc55('0x1'));var path=require(_0xfc55('0x2'));var timeout=require(_0xfc55('0x3'));var express=require(_0xfc55('0x4'));var router=express[_0xfc55('0x5')]();var fs_extra=require(_0xfc55('0x6'));var auth=require(_0xfc55('0x7'));var interaction=require(_0xfc55('0x8'));var config=require(_0xfc55('0x9'));var controller=require(_0xfc55('0xa'));router[_0xfc55('0xb')]('/',auth[_0xfc55('0xc')](),controller[_0xfc55('0xd')]);router[_0xfc55('0xb')](_0xfc55('0xe'),auth[_0xfc55('0xc')](),controller[_0xfc55('0xf')]);router[_0xfc55('0xb')](_0xfc55('0x10'),auth[_0xfc55('0xc')](),controller[_0xfc55('0x11')]);router[_0xfc55('0x12')]('/',auth[_0xfc55('0xc')](),controller['create']);router[_0xfc55('0x13')](_0xfc55('0x10'),auth[_0xfc55('0xc')](),controller[_0xfc55('0x14')]);router[_0xfc55('0x15')](_0xfc55('0x10'),auth[_0xfc55('0xc')](),controller[_0xfc55('0x16')]);module[_0xfc55('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 9f84dc9..3d1ea6b 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3428a7,_0x1ba2d0){var _0x298c3b=function(_0xd7691a){while(--_0xd7691a){_0x3428a7['push'](_0x3428a7['shift']());}};_0x298c3b(++_0x1ba2d0);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ddc8a,_0x4b7504){_0x1ddc8a=_0x1ddc8a-0x0;var _0x3f0e91=_0xedd9[_0x1ddc8a];return _0x3f0e91;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2c8df0,_0x32e64b){var _0x5753b1=function(_0x279686){while(--_0x279686){_0x2c8df0['push'](_0x2c8df0['shift']());}};_0x5753b1(++_0x32e64b);}(_0x54ef,0x112));var _0xf54e=function(_0x5179f8,_0x54da07){_0x5179f8=_0x5179f8-0x0;var _0x3c60ef=_0x54ef[_0x5179f8];return _0x3c60ef;};'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 diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 96c3bc1..93f9ef1 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 _0x7c2d=['reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','ChatTransferReport','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x4e997d,_0x36b324){var _0x193b78=function(_0x51a707){while(--_0x51a707){_0x4e997d['push'](_0x4e997d['shift']());}};_0x193b78(++_0x36b324);}(_0x7c2d,0x1a1));var _0xd7c2=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x7c2d[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xd7c2('0x0'));var rimraf=require(_0xd7c2('0x1'));var zipdir=require(_0xd7c2('0x2'));var jsonpatch=require(_0xd7c2('0x3'));var rp=require(_0xd7c2('0x4'));var moment=require(_0xd7c2('0x5'));var BPromise=require(_0xd7c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd7c2('0x7'));var csv=require(_0xd7c2('0x8'));var ejs=require(_0xd7c2('0x9'));var fs=require('fs');var fs_extra=require(_0xd7c2('0xa'));var _=require(_0xd7c2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd7c2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd7c2('0x8'));var querystring=require(_0xd7c2('0xd'));var Papa=require(_0xd7c2('0xe'));var Redis=require(_0xd7c2('0xf'));var authService=require(_0xd7c2('0x10'));var qs=require(_0xd7c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7c2('0x12'));var logger=require(_0xd7c2('0x13'))(_0xd7c2('0x14'));var utils=require(_0xd7c2('0x15'));var config=require(_0xd7c2('0x16'));var licenseUtil=require(_0xd7c2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178485,_0x33f95a){_0x33f95a=_0x33f95a||0xcc;return function(_0x1edad){if(_0x1edad){return _0x178485['sendStatus'](_0x33f95a);}return _0x178485[_0xd7c2('0x18')](_0x33f95a)[_0xd7c2('0x19')]();};}function respondWithResult(_0x271d03,_0x3b4bd2){_0x3b4bd2=_0x3b4bd2||0xc8;return function(_0x4024d6){if(_0x4024d6){return _0x271d03['status'](_0x3b4bd2)[_0xd7c2('0x1a')](_0x4024d6);}};}function respondWithFilteredResult(_0x257d5a,_0x4053e0){return function(_0x2cadcb){if(_0x2cadcb){var _0x7388fa=typeof _0x4053e0['offset']===_0xd7c2('0x1b')&&typeof _0x4053e0[_0xd7c2('0x1c')]===_0xd7c2('0x1b');var _0x225ff8=_0x2cadcb[_0xd7c2('0x1d')];var _0x46a336=_0x7388fa?0x0:_0x4053e0[_0xd7c2('0x1e')];var _0x43b6f3=_0x7388fa?_0x2cadcb[_0xd7c2('0x1d')]:_0x4053e0[_0xd7c2('0x1e')]+_0x4053e0['limit'];var _0x49174a;if(_0x43b6f3>=_0x225ff8){_0x43b6f3=_0x225ff8;_0x49174a=0xc8;}else{_0x49174a=0xce;}_0x257d5a['status'](_0x49174a);return _0x257d5a['set'](_0xd7c2('0x1f'),_0x46a336+'-'+_0x43b6f3+'/'+_0x225ff8)[_0xd7c2('0x1a')](_0x2cadcb);}return null;};}function patchUpdates(_0x42479c){return function(_0x1a8f4f){try{jsonpatch[_0xd7c2('0x20')](_0x1a8f4f,_0x42479c,!![]);}catch(_0x3f43e8){return BPromise[_0xd7c2('0x21')](_0x3f43e8);}return _0x1a8f4f['save']();};}function saveUpdates(_0x254c54,_0x2b3e8b){return function(_0x26241e){if(_0x26241e){return _0x26241e[_0xd7c2('0x22')](_0x254c54)[_0xd7c2('0x23')](function(_0x63649){return _0x63649;});}return null;};}function removeEntity(_0x5d8706,_0x5651bf){return function(_0x56e56a){if(_0x56e56a){return _0x56e56a[_0xd7c2('0x24')]()[_0xd7c2('0x23')](function(){_0x5d8706['status'](0xcc)[_0xd7c2('0x19')]();});}};}function handleEntityNotFound(_0x4a5f07,_0x2df72d){return function(_0x5b486d){if(!_0x5b486d){_0x4a5f07['sendStatus'](0x194);}return _0x5b486d;};}function handleError(_0x33a87f,_0x178579){_0x178579=_0x178579||0x1f4;return function(_0x298aa2){logger[_0xd7c2('0x25')](_0x298aa2[_0xd7c2('0x26')]);if(_0x298aa2['name']){delete _0x298aa2[_0xd7c2('0x27')];}_0x33a87f[_0xd7c2('0x18')](_0x178579)[_0xd7c2('0x28')](_0x298aa2);};}exports[_0xd7c2('0x29')]=function(_0x1e9abf,_0x4a85a9){var _0x2b82b3={},_0x5d99f2={},_0x2441a4={'count':0x0,'rows':[]};var _0x49fc3c=_[_0xd7c2('0x2a')](db['ChatTransferReport'][_0xd7c2('0x2b')],function(_0x1bf382){return{'name':_0x1bf382['fieldName'],'type':_0x1bf382[_0xd7c2('0x2c')][_0xd7c2('0x2d')]};});_0x5d99f2[_0xd7c2('0x2e')]=_[_0xd7c2('0x2a')](_0x49fc3c,'name');_0x5d99f2[_0xd7c2('0x2f')]=_[_0xd7c2('0x30')](_0x1e9abf['query']);_0x5d99f2[_0xd7c2('0x31')]=_[_0xd7c2('0x32')](_0x5d99f2[_0xd7c2('0x2e')],_0x5d99f2[_0xd7c2('0x2f')]);_0x2b82b3[_0xd7c2('0x33')]=_[_0xd7c2('0x32')](_0x5d99f2['model'],qs[_0xd7c2('0x34')](_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x34')]));_0x2b82b3[_0xd7c2('0x33')]=_0x2b82b3[_0xd7c2('0x33')][_0xd7c2('0x35')]?_0x2b82b3['attributes']:_0x5d99f2[_0xd7c2('0x2e')];if(!_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x36')](_0xd7c2('0x37'))){_0x2b82b3['limit']=qs['limit'](_0x1e9abf['query']['limit']);_0x2b82b3[_0xd7c2('0x1e')]=qs[_0xd7c2('0x1e')](_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x1e')]);}_0x2b82b3['order']=qs[_0xd7c2('0x38')](_0x1e9abf['query'][_0xd7c2('0x38')]);_0x2b82b3['where']=qs[_0xd7c2('0x31')](_[_0xd7c2('0x39')](_0x1e9abf[_0xd7c2('0x2f')],_0x5d99f2[_0xd7c2('0x31')]),_0x49fc3c);if(_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x3a')]){_0x2b82b3[_0xd7c2('0x3b')]=_[_0xd7c2('0x3c')](_0x2b82b3[_0xd7c2('0x3b')],{'$or':_[_0xd7c2('0x2a')](_0x49fc3c,function(_0x282dcc){if(_0x282dcc['type']!==_0xd7c2('0x3d')){var _0x572b9b={};_0x572b9b[_0x282dcc['name']]={'$like':'%'+_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x3a')]+'%'};return _0x572b9b;}})});}_0x2b82b3=_['merge']({},_0x2b82b3,_0x1e9abf[_0xd7c2('0x3e')]);var _0x4d627d={'where':_0x2b82b3[_0xd7c2('0x3b')]};return db['ChatTransferReport'][_0xd7c2('0x1d')](_0x4d627d)[_0xd7c2('0x23')](function(_0x4fb9e1){_0x2441a4[_0xd7c2('0x1d')]=_0x4fb9e1;if(_0x1e9abf[_0xd7c2('0x2f')][_0xd7c2('0x3f')]){_0x2b82b3[_0xd7c2('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xd7c2('0x41')](_0x2b82b3);})[_0xd7c2('0x23')](function(_0x41c105){_0x2441a4[_0xd7c2('0x42')]=_0x41c105;return _0x2441a4;})[_0xd7c2('0x23')](respondWithFilteredResult(_0x4a85a9,_0x2b82b3))[_0xd7c2('0x43')](handleError(_0x4a85a9,null));};exports[_0xd7c2('0x44')]=function(_0x4548da,_0xf3e08){var _0x15026d={'raw':!![],'where':{'id':_0x4548da[_0xd7c2('0x45')]['id']}},_0x1155fa={};_0x1155fa[_0xd7c2('0x2e')]=_['keys'](db[_0xd7c2('0x46')][_0xd7c2('0x2b')]);_0x1155fa['query']=_['keys'](_0x4548da[_0xd7c2('0x2f')]);_0x1155fa[_0xd7c2('0x31')]=_[_0xd7c2('0x32')](_0x1155fa[_0xd7c2('0x2e')],_0x1155fa['query']);_0x15026d['attributes']=_['intersection'](_0x1155fa[_0xd7c2('0x2e')],qs['fields'](_0x4548da[_0xd7c2('0x2f')][_0xd7c2('0x34')]));_0x15026d[_0xd7c2('0x33')]=_0x15026d['attributes']['length']?_0x15026d[_0xd7c2('0x33')]:_0x1155fa['model'];if(_0x4548da[_0xd7c2('0x2f')]['includeAll']){_0x15026d[_0xd7c2('0x40')]=[{'all':!![]}];}_0x15026d=_[_0xd7c2('0x3c')]({},_0x15026d,_0x4548da[_0xd7c2('0x3e')]);return db[_0xd7c2('0x46')][_0xd7c2('0x47')](_0x15026d)[_0xd7c2('0x23')](handleEntityNotFound(_0xf3e08,null))['then'](respondWithResult(_0xf3e08,null))['catch'](handleError(_0xf3e08,null));};exports[_0xd7c2('0x48')]=function(_0x2f12b8,_0x17f65d){return db[_0xd7c2('0x46')][_0xd7c2('0x48')](_0x2f12b8[_0xd7c2('0x49')],{})[_0xd7c2('0x23')](respondWithResult(_0x17f65d,0xc9))['catch'](handleError(_0x17f65d,null));};exports[_0xd7c2('0x22')]=function(_0x5ba13a,_0x42cb59){if(_0x5ba13a[_0xd7c2('0x49')]['id']){delete _0x5ba13a[_0xd7c2('0x49')]['id'];}return db[_0xd7c2('0x46')][_0xd7c2('0x47')]({'where':{'id':_0x5ba13a[_0xd7c2('0x45')]['id']}})[_0xd7c2('0x23')](handleEntityNotFound(_0x42cb59,null))[_0xd7c2('0x23')](saveUpdates(_0x5ba13a[_0xd7c2('0x49')],null))[_0xd7c2('0x23')](respondWithResult(_0x42cb59,null))[_0xd7c2('0x43')](handleError(_0x42cb59,null));};exports['destroy']=function(_0x13d65d,_0x29c6db){return db[_0xd7c2('0x46')][_0xd7c2('0x47')]({'where':{'id':_0x13d65d[_0xd7c2('0x45')]['id']}})[_0xd7c2('0x23')](handleEntityNotFound(_0x29c6db,null))[_0xd7c2('0x23')](removeEntity(_0x29c6db,null))[_0xd7c2('0x43')](handleError(_0x29c6db,null));};exports[_0xd7c2('0x4a')]=function(_0x35e11d,_0x881917){return db[_0xd7c2('0x46')][_0xd7c2('0x4a')]()[_0xd7c2('0x23')](respondWithResult(_0x881917,null))[_0xd7c2('0x43')](handleError(_0x881917,null));}; \ No newline at end of file +var _0xaa23=['util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x4209fa,_0x49166f){var _0x59ca42=function(_0x1e86f5){while(--_0x1e86f5){_0x4209fa['push'](_0x4209fa['shift']());}};_0x59ca42(++_0x49166f);}(_0xaa23,0x16d));var _0x3aa2=function(_0x4e64b7,_0x12f8fa){_0x4e64b7=_0x4e64b7-0x0;var _0x3e9500=_0xaa23[_0x4e64b7];return _0x3e9500;};'use strict';var emlformat=require(_0x3aa2('0x0'));var rimraf=require(_0x3aa2('0x1'));var zipdir=require(_0x3aa2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3aa2('0x3'));var moment=require(_0x3aa2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3aa2('0x5'));var path=require(_0x3aa2('0x6'));var sox=require(_0x3aa2('0x7'));var csv=require(_0x3aa2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3aa2('0x9'));var crypto=require(_0x3aa2('0xa'));var jsforce=require(_0x3aa2('0xb'));var deskjs=require(_0x3aa2('0xc'));var toCsv=require(_0x3aa2('0x8'));var querystring=require(_0x3aa2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3aa2('0xe'));var qs=require(_0x3aa2('0xf'));var as=require(_0x3aa2('0x10'));var hardwareService=require(_0x3aa2('0x11'));var logger=require('../../config/logger')(_0x3aa2('0x12'));var utils=require(_0x3aa2('0x13'));var config=require(_0x3aa2('0x14'));var licenseUtil=require(_0x3aa2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217095,_0x474813){_0x474813=_0x474813||0xcc;return function(_0x2bd6c4){if(_0x2bd6c4){return _0x217095[_0x3aa2('0x16')](_0x474813);}return _0x217095[_0x3aa2('0x17')](_0x474813)[_0x3aa2('0x18')]();};}function respondWithResult(_0x297bf8,_0x44ca5e){_0x44ca5e=_0x44ca5e||0xc8;return function(_0x40f8d2){if(_0x40f8d2){return _0x297bf8[_0x3aa2('0x17')](_0x44ca5e)[_0x3aa2('0x19')](_0x40f8d2);}};}function respondWithFilteredResult(_0xc76741,_0x1c3d0c){return function(_0x3e8e02){if(_0x3e8e02){var _0x295d64=typeof _0x1c3d0c[_0x3aa2('0x1a')]===_0x3aa2('0x1b')&&typeof _0x1c3d0c[_0x3aa2('0x1c')]===_0x3aa2('0x1b');var _0x96e1cb=_0x3e8e02['count'];var _0x2f8e6c=_0x295d64?0x0:_0x1c3d0c[_0x3aa2('0x1a')];var _0x5cca92=_0x295d64?_0x3e8e02[_0x3aa2('0x1d')]:_0x1c3d0c[_0x3aa2('0x1a')]+_0x1c3d0c['limit'];var _0x18cbb0;if(_0x5cca92>=_0x96e1cb){_0x5cca92=_0x96e1cb;_0x18cbb0=0xc8;}else{_0x18cbb0=0xce;}_0xc76741[_0x3aa2('0x17')](_0x18cbb0);return _0xc76741['set'](_0x3aa2('0x1e'),_0x2f8e6c+'-'+_0x5cca92+'/'+_0x96e1cb)[_0x3aa2('0x19')](_0x3e8e02);}return null;};}function patchUpdates(_0x4c2d48){return function(_0x4fc48c){try{jsonpatch[_0x3aa2('0x1f')](_0x4fc48c,_0x4c2d48,!![]);}catch(_0x40e190){return BPromise[_0x3aa2('0x20')](_0x40e190);}return _0x4fc48c['save']();};}function saveUpdates(_0x195359,_0x28fe63){return function(_0x5ae061){if(_0x5ae061){return _0x5ae061[_0x3aa2('0x21')](_0x195359)[_0x3aa2('0x22')](function(_0xef7dab){return _0xef7dab;});}return null;};}function removeEntity(_0x57620c,_0xeec9ef){return function(_0x4d844f){if(_0x4d844f){return _0x4d844f[_0x3aa2('0x23')]()[_0x3aa2('0x22')](function(){_0x57620c[_0x3aa2('0x17')](0xcc)[_0x3aa2('0x18')]();});}};}function handleEntityNotFound(_0x4afbc3,_0x1992ab){return function(_0x3179fd){if(!_0x3179fd){_0x4afbc3['sendStatus'](0x194);}return _0x3179fd;};}function handleError(_0x33e06c,_0x5f42d9){_0x5f42d9=_0x5f42d9||0x1f4;return function(_0x7f23b2){logger[_0x3aa2('0x24')](_0x7f23b2[_0x3aa2('0x25')]);if(_0x7f23b2['name']){delete _0x7f23b2['name'];}_0x33e06c[_0x3aa2('0x17')](_0x5f42d9)[_0x3aa2('0x26')](_0x7f23b2);};}exports[_0x3aa2('0x27')]=function(_0x2cd45c,_0x3c60f5){var _0x1c8f6e={},_0x3db57d={},_0x44d1a9={'count':0x0,'rows':[]};var _0x171cf1=_[_0x3aa2('0x28')](db[_0x3aa2('0x29')][_0x3aa2('0x2a')],function(_0x180b6a){return{'name':_0x180b6a[_0x3aa2('0x2b')],'type':_0x180b6a[_0x3aa2('0x2c')]['key']};});_0x3db57d['model']=_[_0x3aa2('0x28')](_0x171cf1,'name');_0x3db57d[_0x3aa2('0x2d')]=_[_0x3aa2('0x2e')](_0x2cd45c[_0x3aa2('0x2d')]);_0x3db57d[_0x3aa2('0x2f')]=_[_0x3aa2('0x30')](_0x3db57d[_0x3aa2('0x31')],_0x3db57d[_0x3aa2('0x2d')]);_0x1c8f6e['attributes']=_['intersection'](_0x3db57d[_0x3aa2('0x31')],qs[_0x3aa2('0x32')](_0x2cd45c[_0x3aa2('0x2d')][_0x3aa2('0x32')]));_0x1c8f6e[_0x3aa2('0x33')]=_0x1c8f6e['attributes'][_0x3aa2('0x34')]?_0x1c8f6e['attributes']:_0x3db57d['model'];if(!_0x2cd45c['query'][_0x3aa2('0x35')](_0x3aa2('0x36'))){_0x1c8f6e[_0x3aa2('0x1c')]=qs[_0x3aa2('0x1c')](_0x2cd45c['query'][_0x3aa2('0x1c')]);_0x1c8f6e[_0x3aa2('0x1a')]=qs[_0x3aa2('0x1a')](_0x2cd45c[_0x3aa2('0x2d')][_0x3aa2('0x1a')]);}_0x1c8f6e[_0x3aa2('0x37')]=qs[_0x3aa2('0x38')](_0x2cd45c[_0x3aa2('0x2d')][_0x3aa2('0x38')]);_0x1c8f6e[_0x3aa2('0x39')]=qs['filters'](_[_0x3aa2('0x3a')](_0x2cd45c[_0x3aa2('0x2d')],_0x3db57d['filters']),_0x171cf1);if(_0x2cd45c[_0x3aa2('0x2d')][_0x3aa2('0x3b')]){_0x1c8f6e[_0x3aa2('0x39')]=_[_0x3aa2('0x3c')](_0x1c8f6e[_0x3aa2('0x39')],{'$or':_[_0x3aa2('0x28')](_0x171cf1,function(_0x4f152f){if(_0x4f152f[_0x3aa2('0x2c')]!==_0x3aa2('0x3d')){var _0x37654b={};_0x37654b[_0x4f152f['name']]={'$like':'%'+_0x2cd45c[_0x3aa2('0x2d')][_0x3aa2('0x3b')]+'%'};return _0x37654b;}})});}_0x1c8f6e=_[_0x3aa2('0x3c')]({},_0x1c8f6e,_0x2cd45c[_0x3aa2('0x3e')]);var _0x514442={'where':_0x1c8f6e['where']};return db[_0x3aa2('0x29')][_0x3aa2('0x1d')](_0x514442)[_0x3aa2('0x22')](function(_0x275274){_0x44d1a9[_0x3aa2('0x1d')]=_0x275274;if(_0x2cd45c['query'][_0x3aa2('0x3f')]){_0x1c8f6e[_0x3aa2('0x40')]=[{'all':!![]}];}return db[_0x3aa2('0x29')][_0x3aa2('0x41')](_0x1c8f6e);})['then'](function(_0x5d699d){_0x44d1a9[_0x3aa2('0x42')]=_0x5d699d;return _0x44d1a9;})[_0x3aa2('0x22')](respondWithFilteredResult(_0x3c60f5,_0x1c8f6e))['catch'](handleError(_0x3c60f5,null));};exports[_0x3aa2('0x43')]=function(_0x21afad,_0x141d76){var _0x3106e5={'raw':!![],'where':{'id':_0x21afad[_0x3aa2('0x44')]['id']}},_0xd5c884={};_0xd5c884['model']=_[_0x3aa2('0x2e')](db[_0x3aa2('0x29')][_0x3aa2('0x2a')]);_0xd5c884[_0x3aa2('0x2d')]=_['keys'](_0x21afad[_0x3aa2('0x2d')]);_0xd5c884[_0x3aa2('0x2f')]=_[_0x3aa2('0x30')](_0xd5c884[_0x3aa2('0x31')],_0xd5c884['query']);_0x3106e5[_0x3aa2('0x33')]=_[_0x3aa2('0x30')](_0xd5c884[_0x3aa2('0x31')],qs['fields'](_0x21afad[_0x3aa2('0x2d')]['fields']));_0x3106e5['attributes']=_0x3106e5[_0x3aa2('0x33')][_0x3aa2('0x34')]?_0x3106e5[_0x3aa2('0x33')]:_0xd5c884[_0x3aa2('0x31')];if(_0x21afad[_0x3aa2('0x2d')]['includeAll']){_0x3106e5[_0x3aa2('0x40')]=[{'all':!![]}];}_0x3106e5=_[_0x3aa2('0x3c')]({},_0x3106e5,_0x21afad[_0x3aa2('0x3e')]);return db[_0x3aa2('0x29')][_0x3aa2('0x45')](_0x3106e5)[_0x3aa2('0x22')](handleEntityNotFound(_0x141d76,null))[_0x3aa2('0x22')](respondWithResult(_0x141d76,null))['catch'](handleError(_0x141d76,null));};exports[_0x3aa2('0x46')]=function(_0x39489f,_0xc38ae3){return db[_0x3aa2('0x29')][_0x3aa2('0x46')](_0x39489f[_0x3aa2('0x47')],{})['then'](respondWithResult(_0xc38ae3,0xc9))[_0x3aa2('0x48')](handleError(_0xc38ae3,null));};exports[_0x3aa2('0x21')]=function(_0x2d3e3e,_0x43f090){if(_0x2d3e3e[_0x3aa2('0x47')]['id']){delete _0x2d3e3e[_0x3aa2('0x47')]['id'];}return db[_0x3aa2('0x29')][_0x3aa2('0x45')]({'where':{'id':_0x2d3e3e['params']['id']}})[_0x3aa2('0x22')](handleEntityNotFound(_0x43f090,null))[_0x3aa2('0x22')](saveUpdates(_0x2d3e3e[_0x3aa2('0x47')],null))[_0x3aa2('0x22')](respondWithResult(_0x43f090,null))['catch'](handleError(_0x43f090,null));};exports[_0x3aa2('0x23')]=function(_0x4627b9,_0x2acccd){return db['ChatTransferReport'][_0x3aa2('0x45')]({'where':{'id':_0x4627b9['params']['id']}})['then'](handleEntityNotFound(_0x2acccd,null))[_0x3aa2('0x22')](removeEntity(_0x2acccd,null))[_0x3aa2('0x48')](handleError(_0x2acccd,null));};exports[_0x3aa2('0x49')]=function(_0x1c37ac,_0x58e209){return db[_0x3aa2('0x29')][_0x3aa2('0x49')]()[_0x3aa2('0x22')](respondWithResult(_0x58e209,null))['catch'](handleError(_0x58e209,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2010c0b..02544d6 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 _0x99e2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','uniqueid','lodash','../../config/logger'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0x99e2,0x132));var _0x299e=function(_0x31ee4f,_0x4b9cdd){_0x31ee4f=_0x31ee4f-0x0;var _0x5a4446=_0x99e2[_0x31ee4f];return _0x5a4446;};'use strict';var _=require(_0x299e('0x0'));var util=require('util');var logger=require(_0x299e('0x1'))(_0x299e('0x2'));var moment=require(_0x299e('0x3'));var BPromise=require(_0x299e('0x4'));var rp=require(_0x299e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x299e('0x6'));var config=require(_0x299e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x299e('0x8')]=function(_0x473d57,_0x51493d){return _0x473d57[_0x299e('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x299e('0xa'),'fields':[_0x299e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3198=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x3198,0x97));var _0x8319=function(_0x5b1ac6,_0x5ee4ae){_0x5b1ac6=_0x5b1ac6-0x0;var _0x4baf42=_0x3198[_0x5b1ac6];return _0x4baf42;};'use strict';var _=require(_0x8319('0x0'));var util=require(_0x8319('0x1'));var logger=require(_0x8319('0x2'))(_0x8319('0x3'));var moment=require(_0x8319('0x4'));var BPromise=require(_0x8319('0x5'));var rp=require(_0x8319('0x6'));var fs=require('fs');var path=require(_0x8319('0x7'));var rimraf=require(_0x8319('0x8'));var config=require(_0x8319('0x9'));var attributes=require(_0x8319('0xa'));module['exports']=function(_0x30a016,_0x341236){return _0x30a016[_0x8319('0xb')](_0x8319('0xc'),attributes,{'tableName':_0x8319('0xd'),'paranoid':![],'indexes':[{'name':_0x8319('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 4368ed8..bee65f1 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 _0x0f2b=['rpc','../../config/environment','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a4061,_0x57aa2a){var _0x51814c=function(_0x195295){while(--_0x195295){_0x3a4061['push'](_0x3a4061['shift']());}};_0x51814c(++_0x57aa2a);}(_0x0f2b,0x18a));var _0xb0f2=function(_0x318054,_0x516efd){_0x318054=_0x318054-0x0;var _0x19a6ae=_0x0f2b[_0x318054];return _0x19a6ae;};'use strict';var _=require('lodash');var util=require(_0xb0f2('0x0'));var moment=require(_0xb0f2('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0f2('0x3'))['db'];var utils=require(_0xb0f2('0x4'));var logger=require(_0xb0f2('0x5'))(_0xb0f2('0x6'));var config=require(_0xb0f2('0x7'));var jayson=require(_0xb0f2('0x8'));var client=jayson[_0xb0f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a9e9b,_0x2f7421,_0x409d40){return new BPromise(function(_0x5de5ad,_0x2de29d){return client[_0xb0f2('0xa')](_0x4a9e9b,_0x409d40)['then'](function(_0x18c3fe){logger[_0xb0f2('0xb')](_0xb0f2('0xc'),_0x2f7421,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2f7421,_0xb0f2('0xd'),JSON[_0xb0f2('0xe')](_0x18c3fe));if(_0x18c3fe[_0xb0f2('0xf')]){if(_0x18c3fe[_0xb0f2('0xf')][_0xb0f2('0x10')]===0x1f4){logger[_0xb0f2('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2f7421,_0x18c3fe['error'][_0xb0f2('0x11')]);return _0x2de29d(_0x18c3fe[_0xb0f2('0xf')][_0xb0f2('0x11')]);}logger[_0xb0f2('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2f7421,_0x18c3fe[_0xb0f2('0xf')][_0xb0f2('0x11')]);return _0x5de5ad(_0x18c3fe[_0xb0f2('0xf')]['message']);}else{logger[_0xb0f2('0xb')](_0xb0f2('0xc'),_0x2f7421,_0xb0f2('0xd'));_0x5de5ad(_0x18c3fe[_0xb0f2('0x12')][_0xb0f2('0x11')]);}})[_0xb0f2('0x13')](function(_0x55a864){logger[_0xb0f2('0xf')](_0xb0f2('0xc'),_0x2f7421,_0x55a864);_0x2de29d(_0x55a864);});});} \ No newline at end of file +var _0xb688=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x1e1f17,_0x4bd574){var _0x465b52=function(_0x46accd){while(--_0x46accd){_0x1e1f17['push'](_0x1e1f17['shift']());}};_0x465b52(++_0x4bd574);}(_0xb688,0xef));var _0x8b68=function(_0x8b770b,_0x16be3f){_0x8b770b=_0x8b770b-0x0;var _0x5b3e4=_0xb688[_0x8b770b];return _0x5b3e4;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require(_0x8b68('0x6'));var logger=require(_0x8b68('0x7'))(_0x8b68('0x8'));var config=require(_0x8b68('0x9'));var jayson=require(_0x8b68('0xa'));var client=jayson['client'][_0x8b68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3494d4,_0x5172d4,_0x2ccf7b){return new BPromise(function(_0x1cd6e6,_0x178afd){return client[_0x8b68('0xc')](_0x3494d4,_0x2ccf7b)[_0x8b68('0xd')](function(_0xd28546){logger[_0x8b68('0xe')](_0x8b68('0xf'),_0x5172d4,_0x8b68('0x10'));logger[_0x8b68('0x11')](_0x8b68('0x12'),_0x5172d4,_0x8b68('0x10'),JSON[_0x8b68('0x13')](_0xd28546));if(_0xd28546[_0x8b68('0x14')]){if(_0xd28546[_0x8b68('0x14')][_0x8b68('0x15')]===0x1f4){logger['error'](_0x8b68('0xf'),_0x5172d4,_0xd28546['error'][_0x8b68('0x16')]);return _0x178afd(_0xd28546[_0x8b68('0x14')][_0x8b68('0x16')]);}logger[_0x8b68('0x14')](_0x8b68('0xf'),_0x5172d4,_0xd28546['error'][_0x8b68('0x16')]);return _0x1cd6e6(_0xd28546[_0x8b68('0x14')][_0x8b68('0x16')]);}else{logger[_0x8b68('0xe')](_0x8b68('0xf'),_0x5172d4,_0x8b68('0x10'));_0x1cd6e6(_0xd28546['result'][_0x8b68('0x16')]);}})[_0x8b68('0x17')](function(_0x20feab){logger[_0x8b68('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x5172d4,_0x20feab);_0x178afd(_0x20feab);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 52a59ac..bad6fbb 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 _0x23a8=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put'];(function(_0x41e96f,_0x9a3af0){var _0x443675=function(_0x5a3356){while(--_0x5a3356){_0x41e96f['push'](_0x41e96f['shift']());}};_0x443675(++_0x9a3af0);}(_0x23a8,0x17e));var _0x823a=function(_0x552cac,_0x3ab512){_0x552cac=_0x552cac-0x0;var _0x3405b4=_0x23a8[_0x552cac];return _0x3405b4;};'use strict';var multer=require(_0x823a('0x0'));var util=require(_0x823a('0x1'));var path=require(_0x823a('0x2'));var timeout=require(_0x823a('0x3'));var express=require('express');var router=express[_0x823a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x823a('0x5'));var interaction=require(_0x823a('0x6'));var config=require(_0x823a('0x7'));var controller=require(_0x823a('0x8'));router[_0x823a('0x9')]('/',auth['isAuthenticated'](),controller[_0x823a('0xa')]);router[_0x823a('0x9')](_0x823a('0xb'),auth[_0x823a('0xc')](),controller[_0x823a('0xd')]);router['get'](_0x823a('0xe'),auth[_0x823a('0xc')](),controller['show']);router[_0x823a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x823a('0x10')](_0x823a('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x823a('0x11')](_0x823a('0xe'),auth[_0x823a('0xc')](),controller[_0x823a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5b6b=['get','isAuthenticated','index','describe','/:id','show','create','put','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x24f906,_0x397c5e){var _0x173cf4=function(_0x4021aa){while(--_0x4021aa){_0x24f906['push'](_0x24f906['shift']());}};_0x173cf4(++_0x397c5e);}(_0x5b6b,0xe7));var _0xb5b6=function(_0x563770,_0x67abb6){_0x563770=_0x563770-0x0;var _0x49e000=_0x5b6b[_0x563770];return _0x49e000;};'use strict';var multer=require(_0xb5b6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb5b6('0x1'));var express=require(_0xb5b6('0x2'));var router=express[_0xb5b6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb5b6('0x4'));var config=require(_0xb5b6('0x5'));var controller=require(_0xb5b6('0x6'));router[_0xb5b6('0x7')]('/',auth[_0xb5b6('0x8')](),controller[_0xb5b6('0x9')]);router[_0xb5b6('0x7')]('/describe',auth[_0xb5b6('0x8')](),controller[_0xb5b6('0xa')]);router['get'](_0xb5b6('0xb'),auth[_0xb5b6('0x8')](),controller[_0xb5b6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5b6('0xd')]);router[_0xb5b6('0xe')](_0xb5b6('0xb'),auth[_0xb5b6('0x8')](),controller['update']);router[_0xb5b6('0xf')]('/:id',auth[_0xb5b6('0x8')](),controller['destroy']);module[_0xb5b6('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 03c818a..843c7fb 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 _0xf1b4=['Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','rounded','squared','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','ENUM','thumb','star','TEXT','stringify','input','name','text','onlineForm','getDataValue','setDataValue','textarea'];(function(_0x57fd40,_0x9de24f){var _0x52bb76=function(_0x55f232){while(--_0x55f232){_0x57fd40['push'](_0x57fd40['shift']());}};_0x52bb76(++_0x9de24f);}(_0xf1b4,0xc4));var _0x4f1b=function(_0x143897,_0x321c60){_0x143897=_0x143897-0x0;var _0x1496c1=_0xf1b4[_0x143897];return _0x1496c1;};'use strict';var Sequelize=require(_0x4f1b('0x0'));var rs=require(_0x4f1b('0x1'));module[_0x4f1b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x4f1b('0x3')]},'mapKey':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x4')},'key':{'type':Sequelize[_0x4f1b('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x4f1b('0x5')},'customerAlias':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4f1b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4f1b('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4f1b('0x3')],'allowNull':![],'defaultValue':_0x4f1b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4f1b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4f1b('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x4f1b('0x9'),_0x4f1b('0xa')),'defaultValue':_0x4f1b('0x9')},'header_online':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0xb')},'offline_chat_button':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0xc')},'header_offline':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4f1b('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4f1b('0xf')},'closingMessage':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x10')},'closingMessageButton':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4f1b('0x11')]('star',_0x4f1b('0x12')),'defaultValue':_0x4f1b('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x4f1b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4f1b('0x14')],'defaultValue':function(){return JSON[_0x4f1b('0x15')]({'items':[{'type':_0x4f1b('0x16'),'variable':null,'config':{'placeholder':_0x4f1b('0x17'),'type':_0x4f1b('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x4f1b('0x16'),'props':{'title':_0x4f1b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4f1b('0x4'),'type':_0x4f1b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x4f1b('0x19'))?JSON['parse'](this[_0x4f1b('0x1a')](_0x4f1b('0x19'))):{};},'set':function(_0x53f9c2){return this[_0x4f1b('0x1b')](_0x4f1b('0x19'),JSON[_0x4f1b('0x15')](_0x53f9c2));}},'offlineForm':{'type':Sequelize[_0x4f1b('0x14')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x4f1b('0x16'),'props':{'title':_0x4f1b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4f1b('0x4'),'type':_0x4f1b('0x4')},'variable':null},{'type':_0x4f1b('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0x4f1b('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x4f1b('0x1e'))?JSON[_0x4f1b('0x1f')](this['getDataValue'](_0x4f1b('0x1e'))):{};},'set':function(_0x371b44){return this[_0x4f1b('0x1b')](_0x4f1b('0x1e'),JSON[_0x4f1b('0x15')](_0x371b44));}},'token':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':function(){return rs[_0x4f1b('0x20')]();}},'autoclose':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4f1b('0x3')]},'forwardOffline':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4f1b('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4f1b('0x21')},'waitingMessage':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x24')},'sendUnmanaged':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4f1b('0x14')]},'showAgentAvatar':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4f1b('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4f1b('0x25');}},'notificationSound':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4f1b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4f1b('0x3')],'defaultValue':_0x4f1b('0x27')},'verticalAlignment':{'type':Sequelize[_0x4f1b('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x4f1b('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f1b('0x8')],'comment':_0x4f1b('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![],'comment':_0x4f1b('0x29'),'set':function(_0x5e1d89){if(!_0x5e1d89)this['setDataValue'](_0x4f1b('0x2a'),null);this[_0x4f1b('0x1b')]('mandatoryDisposition',_0x5e1d89);}},'vidaooEscalation':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4f1b('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4f1b('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4f1b('0x2c');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4f1b('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4f1b('0x14')]}}; \ No newline at end of file +var _0x9e59=['Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','getDataValue','parse','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','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:','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x9e59,0x19a));var _0x99e5=function(_0x31d35c,_0x154bb3){_0x31d35c=_0x31d35c-0x0;var _0x5b574e=_0x9e59[_0x31d35c];return _0x5b574e;};'use strict';var Sequelize=require(_0x99e5('0x0'));var rs=require(_0x99e5('0x1'));module[_0x99e5('0x2')]={'name':{'type':Sequelize[_0x99e5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x99e5('0x3')],'allowNull':![],'unique':_0x99e5('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x5')},'mapKeyOffline':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x99e5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x99e5('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x99e5('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x99e5('0x3')]},'animation':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x99e5('0xa')]('rounded',_0x99e5('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x99e5('0xd')},'offline_chat_button':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0xe')},'header_offline':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x99e5('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x99e5('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x99e5('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x13')},'closingMessageButton':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x99e5('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x99e5('0x15')},'ratingType':{'type':Sequelize[_0x99e5('0xa')]('star','thumb'),'defaultValue':_0x99e5('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x99e5('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x99e5('0x10')],'defaultValue':function(){return JSON[_0x99e5('0x17')]({'items':[{'type':_0x99e5('0x18'),'variable':null,'config':{'placeholder':_0x99e5('0x19'),'type':_0x99e5('0x1a'),'required':!![]},'props':{'title':_0x99e5('0x19'),'helpText':''}},{'type':_0x99e5('0x18'),'props':{'title':_0x99e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x99e5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x99e5('0x1b')]('onlineForm')?JSON[_0x99e5('0x1c')](this[_0x99e5('0x1b')](_0x99e5('0x1d'))):{};},'set':function(_0x5c2ef0){return this['setDataValue']('onlineForm',JSON[_0x99e5('0x17')](_0x5c2ef0));}},'offlineForm':{'type':Sequelize[_0x99e5('0x10')],'defaultValue':function(){return JSON[_0x99e5('0x17')]({'items':[{'type':_0x99e5('0x18'),'props':{'title':_0x99e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x99e5('0x5'),'type':_0x99e5('0x5')},'variable':null},{'type':_0x99e5('0x1e'),'config':{'placeholder':_0x99e5('0x1f')},'props':{'title':'Comments','helpText':_0x99e5('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x99e5('0x1b')](_0x99e5('0x21'))?JSON[_0x99e5('0x1c')](this['getDataValue'](_0x99e5('0x21'))):{};},'set':function(_0x319d67){return this[_0x99e5('0x22')](_0x99e5('0x21'),JSON['stringify'](_0x319d67));}},'token':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':function(){return rs[_0x99e5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x99e5('0x3')]},'forwardOffline':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x25')},'offlineMessageBody':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x14')},'sendUnmanaged':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x99e5('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x99e5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x99e5('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x99e5('0x28')},'verticalAlignment':{'type':Sequelize[_0x99e5('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':_0x99e5('0x29')},'defaultTitle':{'type':Sequelize[_0x99e5('0x3')]},'customerAvatar':{'type':Sequelize[_0x99e5('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x99e5('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x99e5('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x99e5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x99e5('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x99e5('0x8')],'comment':_0x99e5('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x99e5('0x2c'),'set':function(_0x36d4fb){if(!_0x36d4fb)this[_0x99e5('0x22')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x36d4fb);}},'vidaooEscalation':{'type':Sequelize[_0x99e5('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x99e5('0x3')]},'vidaooTopic':{'type':Sequelize[_0x99e5('0x3')],'allowNull':![],'defaultValue':_0x99e5('0x2d')},'vidaooNote':{'type':Sequelize[_0x99e5('0x3')],'defaultValue':function(){return _0x99e5('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x99e5('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x99e5('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 72cf9fb..c470df6 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 _0x5753=['addAgents','omit','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','account','applications','Applications','list','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','internal','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','virtual','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','ChatApplication','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachment'];(function(_0x1d1e34,_0x5123f8){var _0x508990=function(_0xb15553){while(--_0xb15553){_0x1d1e34['push'](_0x1d1e34['shift']());}};_0x508990(++_0x5123f8);}(_0x5753,0x13a));var _0x3575=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5753[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x3575('0x0'));var rimraf=require(_0x3575('0x1'));var zipdir=require(_0x3575('0x2'));var jsonpatch=require(_0x3575('0x3'));var rp=require('request-promise');var moment=require(_0x3575('0x4'));var BPromise=require(_0x3575('0x5'));var Mustache=require('mustache');var util=require(_0x3575('0x6'));var path=require('path');var sox=require(_0x3575('0x7'));var csv=require(_0x3575('0x8'));var ejs=require(_0x3575('0x9'));var fs=require('fs');var fs_extra=require(_0x3575('0xa'));var _=require(_0x3575('0xb'));var squel=require(_0x3575('0xc'));var crypto=require(_0x3575('0xd'));var jsforce=require(_0x3575('0xe'));var deskjs=require(_0x3575('0xf'));var toCsv=require(_0x3575('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3575('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3575('0x11'));var as=require(_0x3575('0x12'));var hardwareService=require(_0x3575('0x13'));var logger=require(_0x3575('0x14'))(_0x3575('0x15'));var utils=require(_0x3575('0x16'));var config=require(_0x3575('0x17'));var licenseUtil=require(_0x3575('0x18'));var db=require(_0x3575('0x19'))['db'];config['redis']=_[_0x3575('0x1a')](config[_0x3575('0x1b')],{'host':_0x3575('0x1c'),'port':0x18eb});var socket=require(_0x3575('0x1d'))(new Redis(config['redis']));require(_0x3575('0x1e'))[_0x3575('0x1f')](socket);var jayson=require(_0x3575('0x20'));var client=jayson[_0x3575('0x21')][_0x3575('0x22')]({'port':0x232c});var client9002=jayson[_0x3575('0x21')][_0x3575('0x22')]({'port':0x232a});var client9003=jayson[_0x3575('0x21')][_0x3575('0x22')]({'port':0x232b});var client9001=jayson[_0x3575('0x21')][_0x3575('0x22')]({'port':0x2329});function respondWithRpcPromise(_0x2e21d0,_0x4d47bb,_0x4d9d67,_0x55355f){return new BPromise(function(_0x262db5,_0x3a1c85){var _0x2d3490=_0x55355f||client;return _0x2d3490[_0x3575('0x23')](_0x2e21d0,_0x4d9d67)[_0x3575('0x24')](function(_0x1cd67c){logger[_0x3575('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x4d47bb,_0x3575('0x26'));logger[_0x3575('0x27')](_0x3575('0x28'),_0x4d47bb,'request\x20sent',JSON[_0x3575('0x29')](_0x1cd67c));if(_0x1cd67c['error']){if(_0x1cd67c[_0x3575('0x2a')]['code']===0x1f4){logger[_0x3575('0x2a')](_0x3575('0x2b'),_0x4d47bb,_0x1cd67c[_0x3575('0x2a')][_0x3575('0x2c')]);return _0x3a1c85(_0x1cd67c['error'][_0x3575('0x2c')]);}logger[_0x3575('0x2a')](_0x3575('0x2b'),_0x4d47bb,_0x1cd67c[_0x3575('0x2a')]['message']);return _0x262db5(_0x1cd67c[_0x3575('0x2a')][_0x3575('0x2c')]);}else{logger[_0x3575('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x4d47bb,_0x3575('0x26'));_0x262db5(_0x1cd67c[_0x3575('0x2d')][_0x3575('0x2c')]);}})[_0x3575('0x2e')](function(_0x33844d){logger[_0x3575('0x2a')](_0x3575('0x2b'),_0x4d47bb,_0x33844d);_0x3a1c85(_0x33844d);});});}function respondWithStatusCode(_0x4de8f6,_0x251ba6){_0x251ba6=_0x251ba6||0xcc;return function(_0x52addf){if(_0x52addf){return _0x4de8f6[_0x3575('0x2f')](_0x251ba6);}return _0x4de8f6[_0x3575('0x30')](_0x251ba6)[_0x3575('0x31')]();};}function respondWithResult(_0x44243d,_0x42ee7a){_0x42ee7a=_0x42ee7a||0xc8;return function(_0x4f4b8f){if(_0x4f4b8f){return _0x44243d[_0x3575('0x30')](_0x42ee7a)[_0x3575('0x32')](_0x4f4b8f);}};}function respondWithFilteredResult(_0x4d0ff,_0xc5eb94){return function(_0x5704d5){if(_0x5704d5){var _0xc639b7=typeof _0xc5eb94[_0x3575('0x33')]===_0x3575('0x34')&&typeof _0xc5eb94['limit']===_0x3575('0x34');var _0x57c852=_0x5704d5['count'];var _0x23eabe=_0xc639b7?0x0:_0xc5eb94['offset'];var _0x44756d=_0xc639b7?_0x5704d5[_0x3575('0x35')]:_0xc5eb94[_0x3575('0x33')]+_0xc5eb94[_0x3575('0x36')];var _0x34b8b4;if(_0x44756d>=_0x57c852){_0x44756d=_0x57c852;_0x34b8b4=0xc8;}else{_0x34b8b4=0xce;}_0x4d0ff[_0x3575('0x30')](_0x34b8b4);return _0x4d0ff['set']('Content-Range',_0x23eabe+'-'+_0x44756d+'/'+_0x57c852)[_0x3575('0x32')](_0x5704d5);}return null;};}function patchUpdates(_0x2e3e64){return function(_0xbb8c68){try{jsonpatch[_0x3575('0x37')](_0xbb8c68,_0x2e3e64,!![]);}catch(_0x41d40d){return BPromise[_0x3575('0x38')](_0x41d40d);}return _0xbb8c68['save']();};}function saveUpdates(_0x8da049,_0x3679dd){return function(_0x43b706){if(_0x43b706){return _0x43b706['update'](_0x8da049)[_0x3575('0x24')](function(_0x5d76eb){return _0x5d76eb;});}return null;};}function removeEntity(_0x298847,_0x3072a4){return function(_0xf52faf){if(_0xf52faf){return _0xf52faf[_0x3575('0x39')]()[_0x3575('0x24')](function(){var _0x34e2e3=_0xf52faf[_0x3575('0x3a')]({'plain':!![]});var _0x3c343f=_0x3575('0x3b');return db[_0x3575('0x3c')][_0x3575('0x39')]({'where':{'type':_0x3c343f,'resourceId':_0x34e2e3['id']}})[_0x3575('0x24')](function(){return _0xf52faf;});})[_0x3575('0x24')](function(){_0x298847['status'](0xcc)[_0x3575('0x31')]();});}};}function handleEntityNotFound(_0x52d214,_0x31d920){return function(_0xb2b7ef){if(!_0xb2b7ef){_0x52d214['sendStatus'](0x194);}return _0xb2b7ef;};}function handleError(_0x3006a0,_0x43ef67){_0x43ef67=_0x43ef67||0x1f4;return function(_0x30c66e){logger['error'](_0x30c66e[_0x3575('0x3d')]);if(_0x30c66e['name']){delete _0x30c66e[_0x3575('0x3e')];}_0x3006a0[_0x3575('0x30')](_0x43ef67)[_0x3575('0x3f')](_0x30c66e);};}exports[_0x3575('0x40')]=function(_0x1f6bf2,_0x4546ab){var _0x438b34={'include':[{'model':db[_0x3575('0x41')],'as':_0x3575('0x42')}]},_0x338be3={},_0x34d525={'count':0x0,'rows':[]};var _0x25feaf=_[_0x3575('0x43')](db[_0x3575('0x44')][_0x3575('0x45')],function(_0x5408e2){return{'name':_0x5408e2[_0x3575('0x46')],'type':_0x5408e2['type'][_0x3575('0x47')]};});_0x338be3['model']=_['map'](_0x25feaf,_0x3575('0x3e'));_0x338be3[_0x3575('0x48')]=_[_0x3575('0x49')](_0x1f6bf2['query']);_0x338be3[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x338be3[_0x3575('0x4c')],_0x338be3[_0x3575('0x48')]);_0x438b34[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x338be3[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x1f6bf2['query']['fields']));_0x438b34[_0x3575('0x4d')]=_0x438b34[_0x3575('0x4d')]['length']?_0x438b34['attributes']:_0x338be3[_0x3575('0x4c')];if(!_0x1f6bf2[_0x3575('0x48')]['hasOwnProperty'](_0x3575('0x4f'))){_0x438b34[_0x3575('0x36')]=qs['limit'](_0x1f6bf2['query'][_0x3575('0x36')]);_0x438b34['offset']=qs[_0x3575('0x33')](_0x1f6bf2[_0x3575('0x48')][_0x3575('0x33')]);}_0x438b34[_0x3575('0x50')]=qs[_0x3575('0x51')](_0x1f6bf2[_0x3575('0x48')]['sort']);_0x438b34[_0x3575('0x52')]=qs[_0x3575('0x4a')](_[_0x3575('0x53')](_0x1f6bf2[_0x3575('0x48')],_0x338be3[_0x3575('0x4a')]),_0x25feaf);if(_0x1f6bf2[_0x3575('0x48')][_0x3575('0x54')]){_0x438b34[_0x3575('0x52')]=_[_0x3575('0x55')](_0x438b34[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x25feaf,function(_0x1d631a){if(_0x1d631a[_0x3575('0x56')]!=='VIRTUAL'){var _0x26b2ed={};_0x26b2ed[_0x1d631a[_0x3575('0x3e')]]={'$like':'%'+_0x1f6bf2['query']['filter']+'%'};return _0x26b2ed;}})});}_0x438b34=_['merge']({},_0x438b34,_0x1f6bf2[_0x3575('0x57')]);var _0x55036d={'where':_0x438b34[_0x3575('0x52')]};return db[_0x3575('0x44')]['count'](_0x55036d)[_0x3575('0x24')](function(_0x160963){_0x34d525[_0x3575('0x35')]=_0x160963;if(_0x1f6bf2[_0x3575('0x48')][_0x3575('0x58')]){_0x438b34[_0x3575('0x59')]=[{'all':!![]}];}return db['ChatWebsite'][_0x3575('0x5a')](_0x438b34);})[_0x3575('0x24')](function(_0x5c0962){_0x34d525['rows']=_0x5c0962;return _0x34d525;})[_0x3575('0x24')](respondWithFilteredResult(_0x4546ab,_0x438b34))[_0x3575('0x2e')](handleError(_0x4546ab,null));};exports[_0x3575('0x5b')]=function(_0x5515c6,_0x5e4812){var _0x3de913={'raw':![],'where':{'id':_0x5515c6[_0x3575('0x5c')]['id']},'include':[{'model':db[_0x3575('0x41')],'as':'mandatoryDispositionPause'}]},_0x109e47={};_0x109e47['model']=_[_0x3575('0x49')](db[_0x3575('0x44')][_0x3575('0x45')]);_0x109e47[_0x3575('0x48')]=_[_0x3575('0x49')](_0x5515c6[_0x3575('0x48')]);_0x109e47[_0x3575('0x4a')]=_['intersection'](_0x109e47[_0x3575('0x4c')],_0x109e47[_0x3575('0x48')]);_0x3de913['attributes']=_[_0x3575('0x4b')](_0x109e47[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x5515c6[_0x3575('0x48')][_0x3575('0x4e')]));_0x3de913[_0x3575('0x4d')]=_0x3de913[_0x3575('0x4d')][_0x3575('0x5d')]?_0x3de913['attributes']:_0x109e47['model'];if(_0x5515c6[_0x3575('0x48')]['includeAll']){_0x3de913[_0x3575('0x59')]=[{'all':!![]}];}_0x3de913=_['merge']({},_0x3de913,_0x5515c6[_0x3575('0x57')]);return db[_0x3575('0x44')][_0x3575('0x5e')](_0x3de913)[_0x3575('0x24')](handleEntityNotFound(_0x5e4812,null))['then'](respondWithResult(_0x5e4812,null))['catch'](handleError(_0x5e4812,null));};exports['create']=function(_0x54ca06,_0x3d21c1){return db[_0x3575('0x44')][_0x3575('0x5f')](_0x54ca06[_0x3575('0x60')],{})[_0x3575('0x24')](function(_0x3cf889){var _0x53740f=_0x54ca06['user']['get']({'plain':!![]});if(!_0x53740f)throw new Error(_0x3575('0x61'));if(_0x53740f[_0x3575('0x62')]===_0x3575('0x63')){var _0xe2e69=_0x3cf889[_0x3575('0x3a')]({'plain':!![]});var _0x164da8='ChatWebsites';return db[_0x3575('0x64')]['find']({'where':{'name':_0x164da8,'userProfileId':_0x53740f[_0x3575('0x65')]},'raw':!![]})[_0x3575('0x24')](function(_0x171aa6){if(_0x171aa6&&_0x171aa6['autoAssociation']===0x0){return db[_0x3575('0x3c')][_0x3575('0x5f')]({'name':_0xe2e69['name'],'resourceId':_0xe2e69['id'],'type':_0x171aa6['name'],'sectionId':_0x171aa6['id']},{})[_0x3575('0x24')](function(){return _0x3cf889;});}else{return _0x3cf889;}})[_0x3575('0x2e')](function(_0x545e36){logger[_0x3575('0x2a')](_0x3575('0x66'),_0x545e36);throw _0x545e36;});}return _0x3cf889;})[_0x3575('0x24')](respondWithResult(_0x3d21c1,0xc9))[_0x3575('0x2e')](handleError(_0x3d21c1,null));};exports[_0x3575('0x67')]=function(_0x22cd00,_0x9ad7ea){if(_0x22cd00[_0x3575('0x60')]['id']){delete _0x22cd00[_0x3575('0x60')]['id'];}return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x22cd00[_0x3575('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x3575('0x42')}]})[_0x3575('0x24')](handleEntityNotFound(_0x9ad7ea,null))[_0x3575('0x24')](saveUpdates(_0x22cd00['body'],null))[_0x3575('0x24')](respondWithResult(_0x9ad7ea,null))[_0x3575('0x2e')](handleError(_0x9ad7ea,null));};exports[_0x3575('0x39')]=function(_0x337931,_0x610851){return db['ChatWebsite'][_0x3575('0x5e')]({'where':{'id':_0x337931['params']['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x610851,null))[_0x3575('0x24')](removeEntity(_0x610851,null))[_0x3575('0x2e')](handleError(_0x610851,null));};exports[_0x3575('0x68')]=function(_0x2ab559,_0x345148){return db['ChatWebsite'][_0x3575('0x68')]()[_0x3575('0x24')](respondWithResult(_0x345148,null))['catch'](handleError(_0x345148,null));};exports[_0x3575('0x69')]=function(_0x592aef,_0x20a7d3,_0x5d986c){if(_0x592aef[_0x3575('0x60')]['id']){delete _0x592aef['body']['id'];}return db[_0x3575('0x44')]['find']({'where':{'id':_0x592aef[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x20a7d3,null))[_0x3575('0x24')](function(_0x36ee0a){if(_0x36ee0a){_0x592aef['body'][_0x3575('0x6a')]=_0x36ee0a['id'];return db[_0x3575('0x6b')][_0x3575('0x5f')](_0x592aef[_0x3575('0x60')]);}})[_0x3575('0x24')](respondWithResult(_0x20a7d3,null))[_0x3575('0x2e')](handleError(_0x20a7d3,null));};exports[_0x3575('0x6c')]=function(_0x479145,_0x20bf83,_0x54d0ae){var _0x554e71={'raw':![],'where':{}};var _0x5a1d46={};var _0xabbfe0={'count':0x0,'rows':[]};return db[_0x3575('0x44')][_0x3575('0x6d')]({'where':{'id':_0x479145[_0x3575('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20bf83,null))[_0x3575('0x24')](function(_0x327140){if(_0x327140){_0x5a1d46[_0x3575('0x4c')]=_[_0x3575('0x49')](db[_0x3575('0x6b')][_0x3575('0x45')]);_0x5a1d46['query']=_[_0x3575('0x49')](_0x479145['query']);_0x5a1d46[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x5a1d46[_0x3575('0x4c')],_0x5a1d46[_0x3575('0x48')]);_0x554e71[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x5a1d46[_0x3575('0x4c')],qs['fields'](_0x479145['query'][_0x3575('0x4e')]));_0x554e71['attributes']=_0x554e71[_0x3575('0x4d')][_0x3575('0x5d')]?_0x554e71[_0x3575('0x4d')]:_0x5a1d46['model'];if(!_0x479145[_0x3575('0x48')]['hasOwnProperty'](_0x3575('0x4f'))){_0x554e71[_0x3575('0x36')]=qs['limit'](_0x479145[_0x3575('0x48')][_0x3575('0x36')]);_0x554e71[_0x3575('0x33')]=qs[_0x3575('0x33')](_0x479145[_0x3575('0x48')][_0x3575('0x33')]);}_0x554e71[_0x3575('0x50')]=qs[_0x3575('0x51')](_0x479145[_0x3575('0x48')][_0x3575('0x51')]);_0x554e71[_0x3575('0x52')]=qs['filters'](_[_0x3575('0x53')](_0x479145['query'],_0x5a1d46['filters']));_0x554e71[_0x3575('0x52')]['ChatWebsiteId']=_0x327140['id'];if(_0x479145[_0x3575('0x48')][_0x3575('0x54')]){_0x554e71['where']=_[_0x3575('0x55')](_0x554e71[_0x3575('0x52')],{'$or':_['map'](_0x554e71['attributes'],function(_0x1b1253){var _0x1910a0={};_0x1910a0[_0x1b1253]={'$like':'%'+_0x479145[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0x1910a0;})});}_0x554e71=_[_0x3575('0x55')]({},_0x554e71,_0x479145[_0x3575('0x57')]);return db['Disposition'][_0x3575('0x35')]({'where':_0x554e71['where']})['then'](function(_0x4ec9fd){_0xabbfe0[_0x3575('0x35')]=_0x4ec9fd;if(_0x479145[_0x3575('0x48')][_0x3575('0x58')]){_0x554e71['include']=[{'all':!![]}];}return db[_0x3575('0x6b')][_0x3575('0x5a')](_0x554e71);})['then'](function(_0x12a851){_0xabbfe0[_0x3575('0x6e')]=_0x12a851;return _0xabbfe0;});}})[_0x3575('0x24')](respondWithFilteredResult(_0x20bf83,_0x554e71))[_0x3575('0x2e')](handleError(_0x20bf83,null));};exports['removeDispositions']=function(_0x57ed4e,_0x31f870,_0x17f6df){return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x57ed4e[_0x3575('0x5c')]['id']}})['then'](handleEntityNotFound(_0x31f870,null))['then'](function(_0x19f3e5){if(_0x19f3e5){return _0x19f3e5[_0x3575('0x6f')](_0x57ed4e[_0x3575('0x48')]['ids']);}})[_0x3575('0x24')](respondWithStatusCode(_0x31f870,null))[_0x3575('0x2e')](handleError(_0x31f870,null));};exports['addAnswer']=function(_0x19cce1,_0x15daf6,_0x47aff6){if(_0x19cce1[_0x3575('0x60')]['id']){delete _0x19cce1['body']['id'];}return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x19cce1[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x15daf6,null))[_0x3575('0x24')](function(_0x546658){if(_0x546658){_0x19cce1[_0x3575('0x60')]['ChatWebsiteId']=_0x546658['id'];return db[_0x3575('0x70')][_0x3575('0x5f')](_0x19cce1[_0x3575('0x60')]);}})[_0x3575('0x24')](respondWithResult(_0x15daf6,null))[_0x3575('0x2e')](handleError(_0x15daf6,null));};exports[_0x3575('0x71')]=function(_0x3c97b8,_0x5c4196,_0x338636){var _0x304cfb={'raw':![],'where':{}};var _0x304fc5={};var _0x253a8b={'count':0x0,'rows':[]};return db[_0x3575('0x44')]['findOne']({'where':{'id':_0x3c97b8[_0x3575('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5c4196,null))[_0x3575('0x24')](function(_0x51921f){if(_0x51921f){_0x304fc5[_0x3575('0x4c')]=_['keys'](db[_0x3575('0x70')][_0x3575('0x45')]);_0x304fc5[_0x3575('0x48')]=_[_0x3575('0x49')](_0x3c97b8['query']);_0x304fc5[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x304fc5['model'],_0x304fc5['query']);_0x304cfb[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x304fc5[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x3c97b8['query'][_0x3575('0x4e')]));_0x304cfb['attributes']=_0x304cfb['attributes'][_0x3575('0x5d')]?_0x304cfb['attributes']:_0x304fc5[_0x3575('0x4c')];if(!_0x3c97b8[_0x3575('0x48')][_0x3575('0x72')](_0x3575('0x4f'))){_0x304cfb[_0x3575('0x36')]=qs[_0x3575('0x36')](_0x3c97b8[_0x3575('0x48')][_0x3575('0x36')]);_0x304cfb[_0x3575('0x33')]=qs[_0x3575('0x33')](_0x3c97b8[_0x3575('0x48')]['offset']);}_0x304cfb['order']=qs[_0x3575('0x51')](_0x3c97b8['query']['sort']);_0x304cfb[_0x3575('0x52')]=qs[_0x3575('0x4a')](_['pick'](_0x3c97b8[_0x3575('0x48')],_0x304fc5[_0x3575('0x4a')]));_0x304cfb[_0x3575('0x52')][_0x3575('0x6a')]=_0x51921f['id'];if(_0x3c97b8['query'][_0x3575('0x54')]){_0x304cfb[_0x3575('0x52')]=_['merge'](_0x304cfb[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x304cfb[_0x3575('0x4d')],function(_0x5eb149){var _0x4fd4d5={};_0x4fd4d5[_0x5eb149]={'$like':'%'+_0x3c97b8[_0x3575('0x48')]['filter']+'%'};return _0x4fd4d5;})});}_0x304cfb=_[_0x3575('0x55')]({},_0x304cfb,_0x3c97b8[_0x3575('0x57')]);return db[_0x3575('0x70')][_0x3575('0x35')]({'where':_0x304cfb[_0x3575('0x52')]})[_0x3575('0x24')](function(_0x55bc20){_0x253a8b[_0x3575('0x35')]=_0x55bc20;if(_0x3c97b8[_0x3575('0x48')][_0x3575('0x58')]){_0x304cfb[_0x3575('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3575('0x5a')](_0x304cfb);})[_0x3575('0x24')](function(_0x14e8da){_0x253a8b[_0x3575('0x6e')]=_0x14e8da;return _0x253a8b;});}})[_0x3575('0x24')](respondWithFilteredResult(_0x5c4196,_0x304cfb))[_0x3575('0x2e')](handleError(_0x5c4196,null));};exports[_0x3575('0x73')]=function(_0x4059c7,_0x792248,_0x59f5d4){return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x4059c7[_0x3575('0x5c')]['id']}})['then'](handleEntityNotFound(_0x792248,null))['then'](function(_0x2a8ff1){if(_0x2a8ff1){return _0x2a8ff1[_0x3575('0x73')](_0x4059c7[_0x3575('0x48')][_0x3575('0x74')]);}})['then'](respondWithStatusCode(_0x792248,null))[_0x3575('0x2e')](handleError(_0x792248,null));};exports['addLogo']=function(_0x1c113f,_0x17d323,_0x172e4e){_0x1c113f[_0x3575('0x60')][_0x3575('0x75')]=_0x1c113f['file'][_0x3575('0x76')];return db['ChatWebsite']['find']({'where':{'id':_0x1c113f['params']['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x17d323,null))[_0x3575('0x24')](saveUpdates(_0x1c113f[_0x3575('0x60')],null))[_0x3575('0x24')](respondWithResult(_0x17d323,null))[_0x3575('0x2e')](handleError(_0x17d323,null));};exports[_0x3575('0x77')]=function(_0xe314ae,_0x197a44,_0x4d0680){_0xe314ae[_0x3575('0x60')][_0x3575('0x78')]=_0xe314ae[_0x3575('0x79')][_0x3575('0x76')];return db[_0x3575('0x44')]['find']({'where':{'id':_0xe314ae[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x197a44,null))[_0x3575('0x24')](saveUpdates(_0xe314ae[_0x3575('0x60')],null))[_0x3575('0x24')](respondWithResult(_0x197a44,null))[_0x3575('0x2e')](handleError(_0x197a44,null));};exports['addCustomerAvatar']=function(_0x40b467,_0x87b624,_0x39d194){_0x40b467[_0x3575('0x60')]['customerAvatar']=_0x40b467[_0x3575('0x79')][_0x3575('0x76')];return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x40b467[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x87b624,null))[_0x3575('0x24')](saveUpdates(_0x40b467['body'],null))[_0x3575('0x24')](respondWithResult(_0x87b624,null))[_0x3575('0x2e')](handleError(_0x87b624,null));};exports[_0x3575('0x7a')]=function(_0xaa11af,_0x143caa,_0x26b308){_0xaa11af[_0x3575('0x60')][_0x3575('0x7b')]=_0xaa11af['file'][_0x3575('0x76')];return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0xaa11af[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x143caa,null))[_0x3575('0x24')](saveUpdates(_0xaa11af[_0x3575('0x60')],null))[_0x3575('0x24')](respondWithResult(_0x143caa,null))[_0x3575('0x2e')](handleError(_0x143caa,null));};exports[_0x3575('0x7c')]=function(_0x52ebea,_0x48253b,_0x24bf64){var _0x36ab8a=path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x7f'));var _0x9a4259={'where':{'id':_0x52ebea['params']['id']},'attributes':['id',_0x3575('0x75')],'raw':!![]};var _0xc41f13=![];return require(_0x3575('0x18'))[_0x3575('0x80')]()['then'](function(_0x4cca76){if(_0x4cca76){_0xc41f13=_0x4cca76[_0x3575('0x81')];}})['then'](function(){return db[_0x3575('0x44')][_0x3575('0x5e')](_0x9a4259);})[_0x3575('0x24')](handleEntityNotFound(_0x48253b,null))['then'](function(_0x31c41e){if(_0x31c41e){if(!_[_0x3575('0x82')](_0x31c41e[_0x3575('0x75')])){if(fs[_0x3575('0x83')](path['join'](config[_0x3575('0x7e')],_0x3575('0x84'),_0x31c41e[_0x3575('0x75')]))&&_0xc41f13){_0x36ab8a=path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x84'),_0x31c41e[_0x3575('0x75')]);}}return _0x48253b[_0x3575('0x85')](_0x36ab8a);}})[_0x3575('0x2e')](handleError(_0x48253b,null));};exports[_0x3575('0x86')]=function(_0x2a698d,_0x161c79,_0x55577a){var _0x217de2=path['join'](config[_0x3575('0x7e')],_0x3575('0x87'));var _0x21b2eb={'where':{'id':_0x2a698d[_0x3575('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3575('0x44')]['find'](_0x21b2eb)['then'](handleEntityNotFound(_0x161c79,null))[_0x3575('0x24')](function(_0x5b602a){if(_0x5b602a){if(!_[_0x3575('0x82')](_0x5b602a[_0x3575('0x78')])){if(fs[_0x3575('0x83')](path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x88'),_0x5b602a[_0x3575('0x78')]))){_0x217de2=path[_0x3575('0x7d')](config['root'],'server/files/images/avatars/',_0x5b602a[_0x3575('0x78')]);}}return _0x161c79['download'](_0x217de2);}})[_0x3575('0x2e')](handleError(_0x161c79,null));};exports[_0x3575('0x89')]=function(_0x267d33,_0x1808c5,_0x4d267e){var _0x1c05ba=path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x8a'));var _0x38aee7={'where':{'id':_0x267d33['params']['id']},'attributes':['id',_0x3575('0x8b'),_0x3575('0x8c')],'raw':!![]};return db[_0x3575('0x44')][_0x3575('0x5e')](_0x38aee7)['then'](handleEntityNotFound(_0x1808c5,null))[_0x3575('0x24')](function(_0x339a83){if(_0x339a83){if(!_[_0x3575('0x82')](_0x339a83['customerAvatar'])){if(fs[_0x3575('0x83')](path[_0x3575('0x7d')](config['root'],'server/files/images/avatars/',_0x339a83['customerAvatar']))&&_0x339a83[_0x3575('0x8c')]){_0x1c05ba=path[_0x3575('0x7d')](config[_0x3575('0x7e')],'server/files/images/avatars/',_0x339a83[_0x3575('0x8b')]);}}return _0x1808c5[_0x3575('0x85')](_0x1c05ba);}})[_0x3575('0x2e')](handleError(_0x1808c5,null));};exports['getSystemAvatar']=function(_0x1bef15,_0x2e143c,_0x3d8fcd){var _0x14ec55=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0xd8053f={'where':{'id':_0x1bef15[_0x3575('0x5c')]['id']},'attributes':['id',_0x3575('0x7b')],'raw':!![]};return db['ChatWebsite'][_0x3575('0x5e')](_0xd8053f)[_0x3575('0x24')](handleEntityNotFound(_0x2e143c,null))[_0x3575('0x24')](function(_0x2e3418){if(_0x2e3418){if(!_[_0x3575('0x82')](_0x2e3418['systemAvatar'])){if(fs[_0x3575('0x83')](path[_0x3575('0x7d')](config['root'],_0x3575('0x88'),_0x2e3418[_0x3575('0x7b')]))){_0x14ec55=path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x88'),_0x2e3418['systemAvatar']);}}return _0x2e143c['download'](_0x14ec55);}})['catch'](handleError(_0x2e143c,null));};exports['notify']=function(_0x50553f,_0x476a81,_0x4d31f6){var _0x4d7a40=require(_0x3575('0x8d'));var _0x2cb829=new _0x4d7a40();var _0x39450f=_0x2cb829[_0x3575('0x8e')](_0x50553f[_0x3575('0x8f')][_0x3575('0x90')])[_0x3575('0x91')]();var _0x228834={'body':_0x50553f[_0x3575('0x60')],'channel':_0x3575('0x92')};var _0x1c6e3c=[];var _0x5b5fc2=[];var _0xb69050={};var _0x3201df=![];return db[_0x3575('0x93')][_0x3575('0x68')]()[_0x3575('0x24')](function(_0x2c8aea){if(!_0x2c8aea){throw new db[(_0x3575('0x94'))]['ValidationError'](_0x3575('0x95'));}_0x1c6e3c=_[_0x3575('0x96')](_['keys'](_0x2c8aea),[_0x3575('0x97'),'updatedAt']);_0x5b5fc2=_[_0x3575('0x96')](_['keys'](_0x2c8aea),[_0x3575('0x97'),_0x3575('0x98'),_0x3575('0x99'),_0x3575('0x9a')]);if(_0x50553f[_0x3575('0x60')]['id']){delete _0x50553f[_0x3575('0x60')]['id'];}if(_[_0x3575('0x82')](_0x50553f[_0x3575('0x60')]['from'])){throw new db[(_0x3575('0x94'))]['ValidationError'](_0x3575('0x9b'));}if(_[_0x3575('0x82')](_0x50553f[_0x3575('0x60')][_0x3575('0x60')])||_0x50553f[_0x3575('0x60')][_0x3575('0x60')]===''){throw new db['Sequelize'][(_0x3575('0x9c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3575('0x82')](_0x50553f['body'][_0x3575('0x9d')])){throw new db[(_0x3575('0x94'))][(_0x3575('0x9c'))](_0x3575('0x9e')+_0x5b5fc2);}if(!_[_0x3575('0x9f')](_0x5b5fc2,_0x50553f['body']['mapKey'])){throw new db[(_0x3575('0x94'))][(_0x3575('0x9c'))](_0x3575('0xa0')+_0x5b5fc2);}_0xb69050[_0x50553f[_0x3575('0x60')][_0x3575('0x9d')]]=_0x50553f[_0x3575('0x60')][_0x3575('0xa1')];})['then'](function(){return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x50553f[_0x3575('0x5c')]['id']},'include':[{'model':db[_0x3575('0xa2')],'as':_0x3575('0xa3'),'include':[{'model':db[_0x3575('0x93')],'as':_0x3575('0xa4'),'where':_0xb69050,'limit':0x1,'order':[['updatedAt',_0x3575('0xa5')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3575('0x24')](handleEntityNotFound(_0x476a81,null))[_0x3575('0x24')](function(_0x2c95ec){if(_0x2c95ec&&_0x2c95ec[_0x3575('0xa3')]){_0x228834[_0x3575('0xa6')]=_0x2c95ec;_0x228834[_0x3575('0xa7')]=_0x2c95ec[_0x3575('0xa8')];_0x228834[_0x3575('0xa9')]=_0x2c95ec[_0x3575('0xa3')];_0x228834[_0x3575('0xa7')]=_['orderBy'](_0x228834[_0x3575('0xa7')],[_0x3575('0xaa')],['asc']);if(_0x228834[_0x3575('0xa6')][_0x3575('0xa8')]){delete _0x228834[_0x3575('0xa6')]['Applications'];}if(_0x228834[_0x3575('0xa6')][_0x3575('0xa3')]&&_0x228834[_0x3575('0xa6')][_0x3575('0xa3')]['Contacts']['length']){return _0x228834[_0x3575('0xa6')]['List'][_0x3575('0xa4')][0x0];}var _0x38ed47=_[_0x3575('0x1a')](_0x50553f[_0x3575('0x60')],{'firstName':_0x50553f[_0x3575('0x60')]['from'],'ListId':_0x2c95ec[_0x3575('0x9a')]});_0x38ed47[_0x50553f[_0x3575('0x60')]['mapKey']]=_0x50553f[_0x3575('0x60')][_0x3575('0xa1')];return db[_0x3575('0x93')][_0x3575('0x5f')](_0x38ed47,{'fields':_0x1c6e3c,'raw':!![]});}})[_0x3575('0x24')](handleEntityNotFound(_0x476a81,null))[_0x3575('0x24')](function(_0x476b94){_0x228834[_0x3575('0xab')]=_0x476b94;var _0x4aecc9=_0x50553f[_0x3575('0x60')][_0x3575('0xac')];if(_0x50553f[_0x3575('0x8f')]['cf-connecting-ip']){_0x4aecc9=_0x50553f[_0x3575('0x8f')][_0x3575('0xad')];}else if(_0x50553f['headers'][_0x3575('0xae')]){_0x4aecc9=_[_0x3575('0xaf')](_0x50553f[_0x3575('0x8f')]['x-forwarded-for']['split'](','));}if(_0x476b94){var _0x326a11={'ContactId':_0x476b94['id'],'ChatWebsiteId':_0x50553f[_0x3575('0x5c')]['id'],'from':(_0x476b94[_0x3575('0xb0')]||'')+'\x20'+(_0x476b94[_0x3575('0xb1')]||''),'customerIp':_0x4aecc9,'customerPort':_0x50553f[_0x3575('0x8f')]['x-real-port']?_0x50553f[_0x3575('0x8f')][_0x3575('0xb2')]:null,'referer':_0x50553f[_0x3575('0x60')][_0x3575('0xb3')],'browserName':_0x39450f[_0x3575('0xb4')][_0x3575('0x3e')]&&_0x39450f['browser'][_0x3575('0xb5')]?util[_0x3575('0xb6')]('%s\x20%s',_0x39450f[_0x3575('0xb4')][_0x3575('0x3e')],_0x39450f[_0x3575('0xb4')][_0x3575('0xb5')]):_0x3575('0xb7'),'browserVersion':_0x39450f[_0x3575('0xb4')]['version']||_0x3575('0xb7'),'osName':util[_0x3575('0xb6')](_0x3575('0xb8'),_0x39450f['os'][_0x3575('0x3e')],_0x39450f['os'][_0x3575('0xb5')]),'osVersion':_0x39450f['os'][_0x3575('0xb5')],'deviceModel':_0x39450f[_0x3575('0xb9')][_0x3575('0x4c')]&&_0x39450f[_0x3575('0xb9')][_0x3575('0xba')]?util[_0x3575('0xb6')](_0x3575('0xbb'),_0x39450f[_0x3575('0xb9')][_0x3575('0x4c')],_0x39450f[_0x3575('0xb9')][_0x3575('0xba')],_0x39450f[_0x3575('0xb9')][_0x3575('0x56')]):null,'deviceVendor':_0x39450f[_0x3575('0xb9')][_0x3575('0xba')],'deviceType':_0x39450f[_0x3575('0xb9')][_0x3575('0x56')],'formData':JSON['stringify'](_0x50553f[_0x3575('0x60')])};var _0x168a33={'ChatWebsiteId':_0x50553f['params']['id'],'closed':![]};if(_0x50553f[_0x3575('0x60')][_0x3575('0xbc')]){_0x168a33[_0x3575('0xbc')]=_0x50553f[_0x3575('0x60')][_0x3575('0xbc')];return db[_0x3575('0xbd')]['find']({'where':_0x168a33})[_0x3575('0x24')](function(_0x3d75bc){if(_0x3d75bc){return[_0x3d75bc,![]];}_0x326a11[_0x3575('0xbc')]=_0x50553f['body'][_0x3575('0xbc')];_0x326a11[_0x3575('0xbe')]=_0x50553f['body']['externalUrl'];return db['ChatInteraction']['create'](_0x326a11)['then'](function(_0x3ceb56){return[_0x3ceb56,!![]];});});}_0x168a33[_0x3575('0xbf')]=_0x476b94['id'];if(_0x50553f['body'][_0x3575('0xc0')]&&_0x50553f['body']['interaction']['id']){_0x168a33['id']=_0x50553f[_0x3575('0x60')][_0x3575('0xc0')]['id'];return db[_0x3575('0xbd')][_0x3575('0x5e')]({'where':_0x168a33})[_0x3575('0x24')](function(_0x5c2a2e){if(_0x5c2a2e){return[_0x5c2a2e,![]];}return db[_0x3575('0xbd')][_0x3575('0x5f')](_0x326a11)[_0x3575('0x24')](function(_0x1ac1b1){return[_0x1ac1b1,!![]];});});}return db[_0x3575('0xbd')][_0x3575('0x5f')](_0x326a11)['then'](function(_0x4ede84){return[_0x4ede84,!![]];});}})['spread'](function(_0x4c1467,_0x59bead){if(_0x4c1467){_0x3201df=_0x59bead;if(!_0x59bead){var _0x583729={'from':(_0x228834[_0x3575('0xab')][_0x3575('0xb0')]||'')+'\x20'+(_0x228834[_0x3575('0xab')][_0x3575('0xb1')]||'')};if(_0x50553f[_0x3575('0x60')]['threadId']&&_0x50553f['body']['messageId']&&_0x50553f[_0x3575('0x60')][_0x3575('0xbc')]!=_0x50553f[_0x3575('0x60')][_0x3575('0xc1')]){_0x583729[_0x3575('0xbc')]=_0x50553f[_0x3575('0x60')]['messageId'];}return _0x4c1467[_0x3575('0x67')](_0x583729);}else{return _0x4c1467;}}})[_0x3575('0x24')](function(_0x1224db){_0x228834[_0x3575('0xc0')]=_0x1224db[_0x3575('0x3a')]({'plain':!![]});_0x228834[_0x3575('0xc0')][_0x3575('0xc2')]=_0x3201df;if(_0x228834[_0x3575('0xc0')][_0x3575('0xc2')]){if(_0x228834[_0x3575('0xa6')]['autoclose']){_0x228834[_0x3575('0xa7')][_0x3575('0xc3')]({'id':0x0,'priority':_0x228834[_0x3575('0xa7')]['length']+0x1,'app':_0x3575('0xc4'),'appdata':_0x3575('0xc5'),'interval':_0x3575('0xc6')});}}return db[_0x3575('0xc7')][_0x3575('0x5f')]({'body':_0x50553f[_0x3575('0x60')][_0x3575('0x60')],'ChatWebsiteId':_0x50553f[_0x3575('0x5c')]['id'],'ChatInteractionId':_0x1224db['id'],'direction':'in','ContactId':_0x228834[_0x3575('0xab')]['id'],'AttachmentId':_0x50553f[_0x3575('0x60')][_0x3575('0xc8')]});})[_0x3575('0x24')](function(_0x3b35c7){_0x228834[_0x3575('0x2c')]=_0x3b35c7;if(_0x228834[_0x3575('0xc0')][_0x3575('0xc9')]){return db[_0x3575('0xca')][_0x3575('0x5e')]({'attributes':['id',_0x3575('0x3e')],'where':{'id':_0x228834[_0x3575('0xc0')][_0x3575('0xc9')]}})[_0x3575('0x24')](function(_0x4820fe){if(_0x4820fe){_0x228834['applications'][_0x3575('0xcb')]({'id':0x0,'priority':0x0,'app':_0x3575('0xcc'),'appdata':_0x4820fe[_0x3575('0x3e')]+','+(_0x228834[_0x3575('0xa6')][_0x3575('0xcd')]||0xa),'interval':_0x3575('0xc6')});_0x228834['forcedOwnership']=!![];}return respondWithRpcPromise(_0x3575('0xce'),_0x3575('0xcf'),_0x228834);});}return respondWithRpcPromise(_0x3575('0xce'),_0x3575('0xcf'),_0x228834);})[_0x3575('0x24')](function(_0x533eae){respondWithRpcPromise(_0x3575('0xd0'),_0x3575('0xd0'),{'event':_0x3575('0xd1'),'message':_0x533eae},client9002);return _0x533eae;})['then'](respondWithResult(_0x476a81,null))[_0x3575('0x2e')](handleError(_0x476a81,null));};exports[_0x3575('0xd2')]=function(_0x4cc4d0,_0x27fd80,_0x2366cc){var _0x210397,_0x4666e8,_0x1c323b;var _0x135ea1=[];var _0x21ecfb=[];var _0x410889={};var _0x4ecea1=_0x4cc4d0[_0x3575('0xd3')]||[];var _0x213e07=[];var _0x474f30;return db[_0x3575('0x93')][_0x3575('0x68')]()['then'](function(_0x3c5b12){if(!_0x3c5b12){throw new db[(_0x3575('0x94'))]['ValidationError'](_0x3575('0x95'));}_0x21ecfb=_[_0x3575('0x96')](_[_0x3575('0x49')](_0x3c5b12),[_0x3575('0x97'),_0x3575('0x98')]);_0x135ea1=_[_0x3575('0x96')](_[_0x3575('0x49')](_0x3c5b12),[_0x3575('0x97'),'updatedAt','CompanyId',_0x3575('0x9a')]);if(_0x4cc4d0[_0x3575('0x60')]['id']){delete _0x4cc4d0['body']['id'];}if(_[_0x3575('0x82')](_0x4cc4d0['body'][_0x3575('0xa1')])){throw _0x27fd80['status'](0x1f4)['send'](new db[(_0x3575('0x94'))][(_0x3575('0x9c'))](_0x3575('0x9b')));}if(_[_0x3575('0x82')](_0x4cc4d0[_0x3575('0x60')][_0x3575('0x60')])||_0x4cc4d0[_0x3575('0x60')][_0x3575('0x60')]===''){throw _0x27fd80['status'](0x1f4)[_0x3575('0x3f')](new db['Sequelize'][(_0x3575('0x9c'))](_0x3575('0xd4')));}if(_[_0x3575('0x82')](_0x4cc4d0['body'][_0x3575('0xd5')])){throw _0x27fd80[_0x3575('0x30')](0x1f4)[_0x3575('0x3f')](new db['Sequelize'][(_0x3575('0x9c'))](_0x3575('0xd6')+_0x135ea1));}if(!_['includes'](_0x135ea1,_0x4cc4d0[_0x3575('0x60')][_0x3575('0xd5')])){throw _0x27fd80['status'](0x1f4)[_0x3575('0x3f')](new db[(_0x3575('0x94'))]['ValidationError'](_0x3575('0xd7')+_0x135ea1));}_0x410889[_0x4cc4d0[_0x3575('0x60')]['mapKeyOffline']]=_0x4cc4d0[_0x3575('0x60')][_0x3575('0xa1')];})['then'](function(){return db[_0x3575('0x44')]['find']({'where':{'id':_0x4cc4d0['params']['id']},'include':[{'model':db[_0x3575('0xa2')],'as':_0x3575('0xa3')},{'model':db['MailAccount'],'as':_0x3575('0xd8')}]});})[_0x3575('0x24')](handleEntityNotFound(_0x27fd80,null))[_0x3575('0x24')](function(_0x169f9f){if(_0x169f9f&&_0x169f9f['List']){_0x4666e8=_0x169f9f;var _0x328186=_['defaults'](_0x4cc4d0['body'],{'firstName':_0x4cc4d0[_0x3575('0x60')][_0x3575('0xa1')],'phone':_0x4cc4d0['body'][_0x3575('0xa1')],'ListId':_0x169f9f[_0x3575('0x9a')]});_0x328186[_0x4cc4d0[_0x3575('0x60')][_0x3575('0xd5')]]=_0x4cc4d0[_0x3575('0x60')][_0x3575('0xa1')];return db[_0x3575('0x93')][_0x3575('0xd9')]({'where':_0x410889,'defaults':_0x328186});}})[_0x3575('0xda')](function(_0x216b5f){if(_0x216b5f){_0x1c323b=_0x216b5f;var _0x2bd7ad=fs[_0x3575('0xdb')](path[_0x3575('0x7d')](config[_0x3575('0x7e')],'server/files/templates/chatOfflineMessage.ejs'),_0x3575('0xdc'));var _0x1954a7=ejs[_0x3575('0xdd')](_0x2bd7ad,{'body':_[_0x3575('0xde')](_0x4cc4d0['body']['body']),'bodyTitle':_0x4666e8['offlineMessageBody']});return db[_0x3575('0xdf')][_0x3575('0x5f')]({'body':_0x1954a7,'ContactId':_0x216b5f['id'],'ChatWebsiteId':_0x4666e8['id']});}})['then'](function(_0x20f945){_0x474f30=_0x20f945;if(_0x4ecea1[_0x3575('0x5d')]){var _0x1e8785=_0x4ecea1['map'](function(_0x5d38ce){return{'name':_0x5d38ce[_0x3575('0xe0')],'basename':_0x5d38ce[_0x3575('0x76')],'type':_0x5d38ce[_0x3575('0xe1')],'ChatOfflineMessageId':_0x20f945['id']};});_0x213e07=_0x1e8785['map'](_0x117c1b=>{var _0x44686={'filename':_0x117c1b['name'],'path':path[_0x3575('0x7d')](config[_0x3575('0x7e')],'server',_0x3575('0xd3'),'attachments',_0x3575('0xe2'),_0x117c1b[_0x3575('0xe3')])};return _0x44686;});if(!_0x4666e8['openNewInteraction']){return db['sequelize'][_0x3575('0xe4')](function(_0x4f393d){return db['Attachment']['bulkCreate'](_0x1e8785,{'transaction':_0x4f393d});});}}})[_0x3575('0x24')](function(){if(_0x474f30){_0x210397=_0x474f30;return db[_0x3575('0xd8')][_0x3575('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x3575('0xe5')],'as':_0x3575('0xe6'),'raw':!![]}]});}})['then'](function(_0x3683eb){if(_0x3683eb&&_0x3683eb[_0x3575('0xe6')]&&_0x4666e8[_0x3575('0xe7')]&&_0x4666e8[_0x3575('0xe8')]){var _0x211f14={'tls':{'rejectUnauthorized':![]}};if(_0x3683eb[_0x3575('0xe6')][_0x3575('0xe9')]){_0x211f14[_0x3575('0xe9')]=_0x3683eb[_0x3575('0xe6')][_0x3575('0xe9')];}else{_0x211f14[_0x3575('0xea')]=_0x3683eb['Smtp'][_0x3575('0xea')];_0x211f14['port']=_0x3683eb[_0x3575('0xe6')][_0x3575('0xeb')];_0x211f14[_0x3575('0xec')]=_0x3683eb['Smtp'][_0x3575('0xec')];}if(_0x3683eb[_0x3575('0xe6')]['authentication']){_0x211f14[_0x3575('0xed')]={'user':_0x3683eb[_0x3575('0xe6')][_0x3575('0x63')],'pass':_0x3683eb[_0x3575('0xe6')][_0x3575('0xee')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x211f14,'message':{'from':util[_0x3575('0xb6')](_0x3575('0xef'),_0x3683eb[_0x3575('0x3e')],_0x3683eb[_0x3575('0xf0')]||_0x3683eb[_0x3575('0xe6')]['user']),'to':_0x4666e8[_0x3575('0xe8')],'subject':_0x4666e8[_0x3575('0xf1')],'html':_0x210397[_0x3575('0x60')],'attachments':_0x213e07}},client9003)[_0x3575('0x24')](function(){return _0x210397;})[_0x3575('0x2e')](function(_0x16f880){console[_0x3575('0x2a')](_0x16f880);});}})[_0x3575('0x24')](function(){if(_0x4666e8&&_0x4666e8[_0x3575('0xf2')]&&_0x4666e8[_0x3575('0xf3')]){var _0x3e18d6=[];if(_0x4ecea1[_0x3575('0x5d')]){_0x3e18d6=_0x4ecea1[_0x3575('0x43')](function(_0x35fde5){return{'name':_0x35fde5[_0x3575('0xe0')],'basename':_0x35fde5[_0x3575('0x76')],'type':_0x35fde5['mimetype'],'ChatOfflineMessageId':_0x474f30['id']};});}var _0x249316;if(!_[_0x3575('0x82')](_0x4666e8[_0x3575('0xf4')])){var _0x142c5b=_[_0x3575('0x43')](_0x4cc4d0['body'],function(_0x22ebc1){return _0x22ebc1;});var _0x4210fd=_[_0x3575('0xf5')](_0x142c5b)[0x0];var _0x397d52=_[_0x3575('0xf6')](_0x4210fd,function(_0xc8e83d){return _0xc8e83d;});_0x249316=_0x397d52[0x1][_0x4666e8[_0x3575('0xf4')]];}var _0x2026fb={'from':_0x1c323b[_0x3575('0xf0')],'firstName':_0x1c323b[_0x3575('0xb0')],'lastName':_0x1c323b['lastName'],'mapKey':_0x3575('0xf0'),'message':{'from':_0x1c323b[_0x3575('0xf0')],'to':_0x4666e8[_0x3575('0xd8')][_0x3575('0xf0')],'cc':'','subject':_[_0x3575('0x82')](_0x249316)?_0x4666e8['offlineMessageSubject']:_0x249316,'messageId':'','sentAt':new Date(),'attach':_0x3e18d6[_0x3575('0x5d')],'attachments':_0x3e18d6,'originChannel':_0x3575('0xf7'),'ChatWebsiteId':_0x4666e8['id'],'ChatOfflineMessageId':_0x210397['id'],'originTo':_0x4666e8[_0x3575('0xd8')][_0x3575('0xf0')]},'body':_0x210397['body']};var _0x40c38f={'account':{'id':_0x4666e8['MailAccountId']},'body':_0x2026fb,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x40c38f,client9001)['then'](function(){return _0x210397;})[_0x3575('0x2e')](function(_0x3902a9){console[_0x3575('0x2a')](_0x3902a9);});}return;})[_0x3575('0x24')](function(){if(_0x210397){return _0x210397;}})[_0x3575('0x24')](respondWithResult(_0x27fd80,null))[_0x3575('0x2e')](function(_0x356c73){console['error']('catch',_0x356c73);for(var _0xd3bf0f of _0x4ecea1){var _0x489730=path['join'](config[_0x3575('0x7e')],_0x3575('0xf8'),_0x3575('0xd3'),'attachments',_0x3575('0xe2'),_0xd3bf0f[_0x3575('0x76')]);fs_extra[_0x3575('0xf9')](_0x489730)[_0x3575('0x2e')](function(_0x260f17){console[_0x3575('0x2a')](_0x3575('0xfa'),_0x489730,_0x260f17);});}});};exports['addInteraction']=function(_0x4c00e9,_0xd967c7,_0x5c3f1c){return db['ChatInteraction'][_0x3575('0x5e')]({'where':{'id':_0x4c00e9[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0xd967c7,null))[_0x3575('0x24')](function(_0x1871e5){if(_0x1871e5){return _0x1871e5[_0x3575('0xfb')](_0x4c00e9[_0x3575('0x60')][_0x3575('0x74')],_['omit'](_0x4c00e9[_0x3575('0x60')],[_0x3575('0x74'),'id'])||{});}})[_0x3575('0x24')](respondWithResult(_0xd967c7,null))[_0x3575('0x2e')](handleError(_0xd967c7,null));};exports[_0x3575('0xfc')]=function(_0x1272ae,_0x1b3c50,_0x472e2e){var _0x389b02={'raw':![],'where':{}};var _0x483086={};var _0xae7d03={'count':0x0,'rows':[]};return db[_0x3575('0x44')][_0x3575('0x6d')]({'where':{'id':_0x1272ae[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x1b3c50,null))['then'](function(_0x411872){if(_0x411872){_0x483086[_0x3575('0x4c')]=_[_0x3575('0x49')](db['ChatInteraction'][_0x3575('0x45')]);_0x483086['query']=_[_0x3575('0x49')](_0x1272ae['query']);_0x483086[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x483086['model'],_0x483086[_0x3575('0x48')]);_0x389b02['attributes']=_[_0x3575('0x4b')](_0x483086[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x1272ae[_0x3575('0x48')][_0x3575('0x4e')]));_0x389b02[_0x3575('0x4d')]=_0x389b02[_0x3575('0x4d')][_0x3575('0x5d')]?_0x389b02[_0x3575('0x4d')]:_0x483086[_0x3575('0x4c')];if(!_0x1272ae[_0x3575('0x48')][_0x3575('0x72')]('nolimit')){_0x389b02[_0x3575('0x36')]=qs['limit'](_0x1272ae['query'][_0x3575('0x36')]);_0x389b02[_0x3575('0x33')]=qs['offset'](_0x1272ae[_0x3575('0x48')][_0x3575('0x33')]);}_0x389b02[_0x3575('0x50')]=qs['sort'](_0x1272ae[_0x3575('0x48')][_0x3575('0x51')]);_0x389b02[_0x3575('0x52')]=qs['filters'](_['pick'](_0x1272ae[_0x3575('0x48')],_0x483086[_0x3575('0x4a')]));_0x389b02[_0x3575('0x52')][_0x3575('0x6a')]=_0x411872['id'];if(_0x1272ae[_0x3575('0x48')][_0x3575('0x54')]){_0x389b02['where']=_[_0x3575('0x55')](_0x389b02[_0x3575('0x52')],{'$or':_['map'](_0x389b02[_0x3575('0x4d')],function(_0x219fdb){var _0x37fbef={};_0x37fbef[_0x219fdb]={'$like':'%'+_0x1272ae[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0x37fbef;})});}_0x389b02=_[_0x3575('0x55')]({},_0x389b02,_0x1272ae['options']);return db['ChatInteraction']['count']({'where':_0x389b02[_0x3575('0x52')]})[_0x3575('0x24')](function(_0x5efe2e){_0xae7d03[_0x3575('0x35')]=_0x5efe2e;if(_0x1272ae[_0x3575('0x48')][_0x3575('0x58')]){_0x389b02[_0x3575('0x59')]=[{'model':db[_0x3575('0x93')],'as':_0x3575('0xfd'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3575('0x3e'),_0x3575('0xfe'),_0x3575('0xff')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3575('0x3e'),_0x3575('0x100')],'where':_0x1272ae['query'][_0x3575('0x101')]?{'id':_0x1272ae[_0x3575('0x48')]['tag']}:undefined,'required':_0x1272ae['query'][_0x3575('0x101')]?!![]:![]}];}return db[_0x3575('0xbd')][_0x3575('0x5a')](_0x389b02);})[_0x3575('0x24')](function(_0x15732b){_0xae7d03[_0x3575('0x6e')]=_0x15732b;return _0xae7d03;});}})[_0x3575('0x24')](respondWithFilteredResult(_0x1b3c50,_0x389b02))[_0x3575('0x2e')](handleError(_0x1b3c50,null));};function iftimePromise(_0x3974f2,_0x1222d7){return respondWithRpcPromise(_0x3575('0x102'),_0x3575('0x103'),{'command':_0x1222d7[_0x3575('0x104')]?util[_0x3575('0xb6')](_0x3575('0x105'),_0x3974f2[_0x3575('0x106')],_0x1222d7[_0x3575('0x104')]):util[_0x3575('0xb6')]('iftime\x20%s',_0x3974f2['interval'])},client9002)[_0x3575('0x24')](function(_0x196018){var _0x55433a=_0x196018&&_0x196018['indexOf'](_0x3575('0x107'))>=0x0?!![]:![];logger[_0x3575('0x25')](_0x3575('0x108'),_0x1222d7['id'],_0x3974f2['id'],_0x3974f2[_0x3575('0x106')],_0x55433a?'ONLINE':_0x3575('0x109'),_0x1222d7[_0x3575('0x104')]?_0x1222d7[_0x3575('0x104')]:_0x3575('0x10a'));return _0x55433a;})[_0x3575('0x2e')](function(_0x291bf4){logger[_0x3575('0x2a')](_0x3575('0x108'),_0x1222d7['id'],_0x3974f2['id'],_0x3974f2['interval'],util[_0x3575('0x10b')](_0x291bf4,{'showHidden':![],'depth':null}),_0x1222d7[_0x3575('0x104')]?_0x1222d7['timezone']:_0x3575('0x10a'));return![];});}exports[_0x3575('0x103')]=function(_0x1614e3,_0x337166,_0x50443a){var _0xa1e3c3=0x0;var _0x4f5586=0x0;var _0x2deeff=![];var _0x4a5053;var _0x51e51;return db[_0x3575('0x44')]['find']({'where':{'id':_0x1614e3[_0x3575('0x5c')]['id']},'include':[{'model':db[_0x3575('0x10c')],'as':'Interval','include':[{'model':db[_0x3575('0x10c')],'as':'Intervals','attributes':['id',_0x3575('0x106')],'raw':!![]}]}]})[_0x3575('0x24')](handleEntityNotFound(_0x337166,null))[_0x3575('0x24')](function(_0x3b01dc){if(_0x3b01dc){_0x4a5053=_0x3b01dc;return _0x3b01dc['getProactiveActions']({'raw':!![]});}})[_0x3575('0x24')](function(_0x3f69cd){if(_0x4a5053){if(_0x3f69cd){_0x51e51=_0x3f69cd;}}return require(_0x3575('0x18'))[_0x3575('0x80')]();})[_0x3575('0x24')](function(_0x5e975c){if(_0x5e975c){_0x4f5586=_0x5e975c[_0x3575('0x10d')];_0x2deeff=_0x5e975c[_0x3575('0x81')];}})['then'](function(){return db[_0x3575('0xbd')][_0x3575('0x35')]({'where':{'closed':![]}});})[_0x3575('0x24')](function(_0x5ef514){_0xa1e3c3=_0x5ef514;if(_0x4f5586&&_0x5ef514>_0x4f5586){return db['License'][_0x3575('0x6d')]({'where':{'id':0x1}})[_0x3575('0x24')](function(_0x569b70){if(_0x569b70){_0x569b70[_0x3575('0x10e')](_0x3575('0x10f'));}});}})[_0x3575('0x24')](function(){if(_0x4a5053[_0x3575('0x10c')]&&_0x4a5053['Interval'][_0x3575('0x110')]){var _0x3e33c5=[];for(var _0x3ada19=0x0;_0x3ada19<_0x4a5053['Interval'][_0x3575('0x110')]['length'];_0x3ada19++){var _0x57f0e0=_0x4a5053[_0x3575('0x10c')][_0x3575('0x110')][_0x3ada19][_0x3575('0x3a')]({'plain':!![]});_0x3e33c5[_0x3575('0xc3')](iftimePromise(_0x57f0e0,_0x4a5053));}return BPromise[_0x3575('0x111')](_0x3e33c5)[_0x3575('0x24')](function(_0x45539c){return _[_0x3575('0x112')](_0x45539c);});}else{return!![];}})[_0x3575('0x24')](function(_0x5b0ba9){var _0x518590=fs['readFileSync'](path[_0x3575('0x7d')](config[_0x3575('0x7e')],_0x3575('0x113')),'utf8');var _0xf00e65={'remote':_0x4a5053[_0x3575('0x114')],'query':querystring[_0x3575('0x29')](_['merge'](_0x4a5053[_0x3575('0x3a')]({'plain':!![]}),{'customerIp':_0x1614e3['headers'][_0x3575('0xae')]||_0x1614e3['headers']['x-real-ip']||_0x1614e3[_0x3575('0x115')][_0x3575('0x116')]||_0x1614e3['ip'],'referer':_0x1614e3[_0x3575('0x8f')][_0x3575('0xb3')],'openedInteractions':_0xa1e3c3,'maxInteractions':_0x4f5586,'virtual':_0x2deeff[_0x3575('0x10d')],'online':_0x5b0ba9,'custom':_0x2deeff}))[_0x3575('0x117')](/'/g,'\x5c\x27')};_0x337166[_0x3575('0x3f')](ejs['render'](Mustache[_0x3575('0xdd')](_0x518590,_0xf00e65),{'proactiveActions':_0x51e51,'alignment':_0x4a5053[_0x3575('0x118')],'verticalAlignment':_0x4a5053[_0x3575('0x119')],'div_color':_0x4a5053[_0x3575('0x100')],'text_color':_0x4a5053[_0x3575('0x11a')],'button_color':_0x4a5053['color_button'],'background_color':_0x4a5053[_0x3575('0x11b')]}));})['catch'](handleError(_0x337166,null));};exports[_0x3575('0x11c')]=function(_0x13d28b,_0x335db1,_0x55d54e){return db[_0x3575('0x44')][_0x3575('0x6d')]({'where':{'id':_0x13d28b[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x335db1,null))[_0x3575('0x24')](function(_0x5eb58c){if(_0x5eb58c){return db[_0x3575('0x11d')][_0x3575('0xe4')](function(_0x84009e){return db[_0x3575('0x11e')][_0x3575('0x39')]({'where':{'ChatWebsiteId':_0x13d28b[_0x3575('0x5c')]['id']},'transaction':_0x84009e})[_0x3575('0x24')](function(_0x54f28e){var _0x510dc0=_[_0x3575('0x43')](_0x13d28b['body'],function(_0x3b3c5c){_0x3b3c5c['ChatWebsiteId']=_0x13d28b[_0x3575('0x5c')]['id'];return _0x3b3c5c;});return db['ChatApplication'][_0x3575('0x11f')](_0x510dc0,{'transaction':_0x84009e});});})[_0x3575('0x24')](function(){return db[_0x3575('0x11e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x13d28b[_0x3575('0x5c')]['id']},'order':_0x3575('0xaa')});});}})['then'](respondWithResult(_0x335db1,null))['catch'](handleError(_0x335db1,null));};exports[_0x3575('0x120')]=function(_0x5767fa,_0x292aaa,_0x20b708){var _0x27abb8={};var _0x4f7cf0={};var _0x3b361;var _0x573e61;return db['ChatWebsite'][_0x3575('0x6d')]({'where':{'id':_0x5767fa[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x292aaa,null))[_0x3575('0x24')](function(_0x5713d2){if(_0x5713d2){_0x3b361=_0x5713d2;_0x4f7cf0[_0x3575('0x4c')]=_[_0x3575('0x49')](db[_0x3575('0x11e')]['rawAttributes']);_0x4f7cf0[_0x3575('0x48')]=_['keys'](_0x5767fa['query']);_0x4f7cf0[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x4f7cf0[_0x3575('0x4c')],_0x4f7cf0[_0x3575('0x48')]);_0x27abb8[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x4f7cf0[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x5767fa[_0x3575('0x48')]['fields']));_0x27abb8[_0x3575('0x4d')]=_0x27abb8[_0x3575('0x4d')][_0x3575('0x5d')]?_0x27abb8[_0x3575('0x4d')]:_0x4f7cf0[_0x3575('0x4c')];_0x27abb8[_0x3575('0x50')]=qs[_0x3575('0x51')](_0x5767fa[_0x3575('0x48')][_0x3575('0x51')]);_0x27abb8[_0x3575('0x52')]=qs[_0x3575('0x4a')](_['pick'](_0x5767fa[_0x3575('0x48')],_0x4f7cf0[_0x3575('0x4a')]));if(_0x5767fa[_0x3575('0x48')][_0x3575('0x54')]){_0x27abb8[_0x3575('0x52')]=_['merge'](_0x27abb8[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x27abb8[_0x3575('0x4d')],function(_0x133b18){var _0x2e29f5={};_0x2e29f5[_0x133b18]={'$like':'%'+_0x5767fa[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0x2e29f5;})});}_0x27abb8=_['merge']({},_0x27abb8,_0x5767fa[_0x3575('0x57')]);return _0x3b361[_0x3575('0x120')](_0x27abb8);}})[_0x3575('0x24')](function(_0x411a39){if(_0x411a39){_0x573e61=_0x411a39['length'];if(!_0x5767fa[_0x3575('0x48')][_0x3575('0x72')](_0x3575('0x4f'))){_0x27abb8[_0x3575('0x36')]=qs[_0x3575('0x36')](_0x5767fa[_0x3575('0x48')]['limit']);_0x27abb8['offset']=qs[_0x3575('0x33')](_0x5767fa[_0x3575('0x48')][_0x3575('0x33')]);}return _0x3b361[_0x3575('0x120')](_0x27abb8);}})[_0x3575('0x24')](function(_0x5cc68a){if(_0x5cc68a){return _0x5cc68a?{'count':_0x573e61,'rows':_0x5cc68a}:null;}})[_0x3575('0x24')](respondWithResult(_0x292aaa,null))[_0x3575('0x2e')](handleError(_0x292aaa,null));};exports[_0x3575('0x121')]=function(_0x403f1e,_0x5e8cd4,_0x3b2622){return db[_0x3575('0x122')][_0x3575('0x5e')]({'where':{'id':_0x403f1e[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x5e8cd4,null))[_0x3575('0x24')](function(_0x3be68b){if(_0x3be68b){return _0x3be68b['addProactiveActions'](_0x403f1e[_0x3575('0x60')][_0x3575('0x74')],_['omit'](_0x403f1e['body'],[_0x3575('0x74'),'id'])||{});}})[_0x3575('0x24')](respondWithResult(_0x5e8cd4,null))[_0x3575('0x2e')](handleError(_0x5e8cd4,null));};exports[_0x3575('0x123')]=function(_0x1ed3d7,_0x2c7204,_0x534333){var _0x5955f5={};var _0x123ad2={};var _0x11042a;var _0xc5561f;return db[_0x3575('0x44')][_0x3575('0x6d')]({'where':{'id':_0x1ed3d7[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x2c7204,null))[_0x3575('0x24')](function(_0x54d71a){if(_0x54d71a){_0x11042a=_0x54d71a;_0x123ad2[_0x3575('0x4c')]=_[_0x3575('0x49')](db[_0x3575('0x124')]['rawAttributes']);_0x123ad2['query']=_[_0x3575('0x49')](_0x1ed3d7[_0x3575('0x48')]);_0x123ad2[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x123ad2['model'],_0x123ad2[_0x3575('0x48')]);_0x5955f5['attributes']=_[_0x3575('0x4b')](_0x123ad2[_0x3575('0x4c')],qs[_0x3575('0x4e')](_0x1ed3d7[_0x3575('0x48')][_0x3575('0x4e')]));_0x5955f5[_0x3575('0x4d')]=_0x5955f5[_0x3575('0x4d')][_0x3575('0x5d')]?_0x5955f5['attributes']:_0x123ad2['model'];_0x5955f5[_0x3575('0x50')]=qs[_0x3575('0x51')](_0x1ed3d7['query'][_0x3575('0x51')]);_0x5955f5['where']=qs[_0x3575('0x4a')](_['pick'](_0x1ed3d7[_0x3575('0x48')],_0x123ad2[_0x3575('0x4a')]));if(_0x1ed3d7[_0x3575('0x48')]['filter']){_0x5955f5[_0x3575('0x52')]=_[_0x3575('0x55')](_0x5955f5[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x5955f5[_0x3575('0x4d')],function(_0x2e3da5){var _0x3aedc4={};_0x3aedc4[_0x2e3da5]={'$like':'%'+_0x1ed3d7[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0x3aedc4;})});}_0x5955f5=_['merge']({},_0x5955f5,_0x1ed3d7[_0x3575('0x57')]);return _0x11042a[_0x3575('0x123')](_0x5955f5);}})['then'](function(_0xe435b0){if(_0xe435b0){_0xc5561f=_0xe435b0[_0x3575('0x5d')];if(!_0x1ed3d7[_0x3575('0x48')][_0x3575('0x72')](_0x3575('0x4f'))){_0x5955f5[_0x3575('0x36')]=qs['limit'](_0x1ed3d7[_0x3575('0x48')][_0x3575('0x36')]);_0x5955f5[_0x3575('0x33')]=qs[_0x3575('0x33')](_0x1ed3d7['query'][_0x3575('0x33')]);}return _0x11042a[_0x3575('0x123')](_0x5955f5);}})[_0x3575('0x24')](function(_0x313616){if(_0x313616){return _0x313616?{'count':_0xc5561f,'rows':_0x313616}:null;}})[_0x3575('0x24')](respondWithResult(_0x2c7204,null))[_0x3575('0x2e')](handleError(_0x2c7204,null));};exports[_0x3575('0x125')]=function(_0x367161,_0x15b4ba,_0x27c84b){var _0x3a97f9=_0x367161[_0x3575('0x48')][_0x3575('0x126')]==='false'?_0x3575('0x127'):'onlineForm';return db['ChatWebsite'][_0x3575('0x5e')]({'attributes':['id',_0x3a97f9],'where':{'id':_0x367161[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x15b4ba,null))[_0x3575('0x24')](function(_0x490f52){if(_0x490f52){var _0x20ad4a=_0x490f52[_0x3a97f9];var _0x38b63e=_0x20ad4a&&_0x20ad4a['items']?_0x20ad4a[_0x3575('0x128')]:[];_0x15b4ba[_0x3575('0x3f')]({'fromKey':_[_0x3575('0x82')](_0x20ad4a[_0x3575('0x129')])?undefined:_0x20ad4a[_0x3575('0x129')],'count':_0x38b63e[_0x3575('0x5d')],'rows':_0x38b63e});}})[_0x3575('0x2e')](handleError(_0x15b4ba,null));};exports[_0x3575('0x12a')]=function(_0x44ea8a,_0x3329d9,_0x152c9f){var _0x568893={'raw':![],'where':{}};var _0x5f0f8e={};var _0x48e05d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3575('0x6d')]({'where':{'id':_0x44ea8a['params']['id']}})['then'](handleEntityNotFound(_0x3329d9,null))[_0x3575('0x24')](function(_0x4d89e2){if(_0x4d89e2){_0x5f0f8e['model']=_[_0x3575('0x49')](db[_0x3575('0xdf')][_0x3575('0x45')]);_0x5f0f8e['query']=_['keys'](_0x44ea8a[_0x3575('0x48')]);_0x5f0f8e[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x5f0f8e[_0x3575('0x4c')],_0x5f0f8e['query']);_0x568893[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x5f0f8e[_0x3575('0x4c')],qs['fields'](_0x44ea8a['query'][_0x3575('0x4e')]));_0x568893['attributes']=_0x568893[_0x3575('0x4d')][_0x3575('0x5d')]?_0x568893['attributes']:_0x5f0f8e['model'];if(!_0x44ea8a['query']['hasOwnProperty']('nolimit')){_0x568893[_0x3575('0x36')]=qs[_0x3575('0x36')](_0x44ea8a[_0x3575('0x48')]['limit']);_0x568893[_0x3575('0x33')]=qs[_0x3575('0x33')](_0x44ea8a[_0x3575('0x48')][_0x3575('0x33')]);}_0x568893[_0x3575('0x50')]=qs[_0x3575('0x51')](_0x44ea8a[_0x3575('0x48')][_0x3575('0x51')]);_0x568893[_0x3575('0x52')]=qs[_0x3575('0x4a')](_['pick'](_0x44ea8a['query'],_0x5f0f8e['filters']));_0x568893[_0x3575('0x52')][_0x3575('0x6a')]=_0x4d89e2['id'];if(_0x44ea8a[_0x3575('0x48')][_0x3575('0x54')]){_0x568893[_0x3575('0x52')]=_[_0x3575('0x55')](_0x568893[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x568893['attributes'],function(_0x222d76){var _0xafa04d={};_0xafa04d[_0x222d76]={'$like':'%'+_0x44ea8a[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0xafa04d;})});}_0x568893=_['merge']({},_0x568893,_0x44ea8a[_0x3575('0x57')]);return db[_0x3575('0xdf')][_0x3575('0x35')]({'where':_0x568893['where']})[_0x3575('0x24')](function(_0x4dbc93){_0x48e05d[_0x3575('0x35')]=_0x4dbc93;if(_0x44ea8a[_0x3575('0x48')][_0x3575('0x58')]){_0x568893['include']=[{'all':!![]}];}else{_0x568893[_0x3575('0x59')]=[{'model':db['CmContact'],'as':_0x3575('0xfd'),'required':![]},{'model':db[_0x3575('0x12b')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x568893);})[_0x3575('0x24')](function(_0x1f6c04){_0x48e05d[_0x3575('0x6e')]=_0x1f6c04;return _0x48e05d;});}})[_0x3575('0x24')](respondWithFilteredResult(_0x3329d9,_0x568893))[_0x3575('0x2e')](handleError(_0x3329d9,null));};exports['addAgents']=function(_0x1674ef,_0x461293,_0x4e7522){return db[_0x3575('0x44')][_0x3575('0x5e')]({'where':{'id':_0x1674ef[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x461293,null))['then'](function(_0x4afde6){if(_0x4afde6){return _0x4afde6[_0x3575('0x12c')](_0x1674ef[_0x3575('0x60')][_0x3575('0x74')],_[_0x3575('0x12d')](_0x1674ef[_0x3575('0x60')],[_0x3575('0x74'),'id'])||{})[_0x3575('0xda')](function(_0x4ba691){for(var _0x4e53f3=0x0;_0x4e53f3<_0x1674ef[_0x3575('0x60')][_0x3575('0x74')]['length'];_0x4e53f3+=0x1){socket[_0x3575('0x12e')]('userChatWebsite:save',{'UserId':Number(_0x1674ef[_0x3575('0x60')][_0x3575('0x74')][_0x4e53f3]),'ChatWebsiteId':Number(_0x1674ef[_0x3575('0x5c')]['id'])});}return _0x4ba691;});}})[_0x3575('0x24')](respondWithResult(_0x461293,null))[_0x3575('0x2e')](handleError(_0x461293,null));};exports['removeAgents']=function(_0x2f9708,_0xc40bf,_0x47cc76){return db[_0x3575('0x44')]['find']({'where':{'id':_0x2f9708['params']['id']}})[_0x3575('0x24')](handleEntityNotFound(_0xc40bf,null))[_0x3575('0x24')](function(_0x401ace){if(_0x401ace){return _0x401ace[_0x3575('0x12f')](_0x2f9708[_0x3575('0x48')][_0x3575('0x74')])['then'](function(){if(_[_0x3575('0x130')](_0x2f9708['query'][_0x3575('0x74')])){for(var _0x1cfc30=0x0;_0x1cfc30<_0x2f9708['query'][_0x3575('0x74')]['length'];_0x1cfc30+=0x1){socket[_0x3575('0x12e')](_0x3575('0x131'),{'UserId':Number(_0x2f9708[_0x3575('0x48')][_0x3575('0x74')][_0x1cfc30]),'ChatWebsiteId':Number(_0x2f9708[_0x3575('0x5c')]['id'])});}}else{socket[_0x3575('0x12e')]('userChatWebsite:remove',{'UserId':Number(_0x2f9708[_0x3575('0x48')]['ids']),'ChatWebsiteId':Number(_0x2f9708['params']['id'])});}});}})[_0x3575('0x24')](respondWithStatusCode(_0xc40bf,null))['catch'](handleError(_0xc40bf,null));};exports[_0x3575('0x132')]=function(_0xdeb8ff,_0x195c8c,_0x5026b5){var _0x30c3d9={};var _0x461f65={};var _0x33d218;var _0x3d6036;return db['ChatWebsite'][_0x3575('0x6d')]({'where':{'id':_0xdeb8ff[_0x3575('0x5c')]['id']}})[_0x3575('0x24')](handleEntityNotFound(_0x195c8c,null))[_0x3575('0x24')](function(_0x3fde55){if(_0x3fde55){_0x33d218=_0x3fde55;_0x461f65['model']=_[_0x3575('0x49')](db['User'][_0x3575('0x45')]);_0x461f65[_0x3575('0x48')]=_[_0x3575('0x49')](_0xdeb8ff['query']);_0x461f65[_0x3575('0x4a')]=_[_0x3575('0x4b')](_0x461f65[_0x3575('0x4c')],_0x461f65['query']);_0x30c3d9[_0x3575('0x4d')]=_[_0x3575('0x4b')](_0x461f65['model'],qs[_0x3575('0x4e')](_0xdeb8ff[_0x3575('0x48')][_0x3575('0x4e')]));_0x30c3d9[_0x3575('0x4d')]=_0x30c3d9[_0x3575('0x4d')][_0x3575('0x5d')]?_0x30c3d9['attributes']:_0x461f65[_0x3575('0x4c')];_0x30c3d9[_0x3575('0x50')]=qs[_0x3575('0x51')](_0xdeb8ff['query'][_0x3575('0x51')]);_0x30c3d9['where']=qs['filters'](_[_0x3575('0x53')](_0xdeb8ff['query'],_0x461f65[_0x3575('0x4a')]));if(_0xdeb8ff[_0x3575('0x48')][_0x3575('0x54')]){_0x30c3d9[_0x3575('0x52')]=_['merge'](_0x30c3d9[_0x3575('0x52')],{'$or':_[_0x3575('0x43')](_0x30c3d9[_0x3575('0x4d')],function(_0x2f4526){var _0x3f8c3a={};_0x3f8c3a[_0x2f4526]={'$like':'%'+_0xdeb8ff[_0x3575('0x48')][_0x3575('0x54')]+'%'};return _0x3f8c3a;})});}_0x30c3d9=_[_0x3575('0x55')]({},_0x30c3d9,_0xdeb8ff[_0x3575('0x57')]);return _0x33d218[_0x3575('0x132')](_0x30c3d9);}})[_0x3575('0x24')](function(_0x124825){if(_0x124825){_0x3d6036=_0x124825['length'];if(!_0xdeb8ff['query'][_0x3575('0x72')]('nolimit')){_0x30c3d9[_0x3575('0x36')]=qs[_0x3575('0x36')](_0xdeb8ff[_0x3575('0x48')][_0x3575('0x36')]);_0x30c3d9['offset']=qs[_0x3575('0x33')](_0xdeb8ff[_0x3575('0x48')]['offset']);}return _0x33d218[_0x3575('0x132')](_0x30c3d9);}})[_0x3575('0x24')](function(_0x106c1f){if(_0x106c1f){return _0x106c1f?{'count':_0x3d6036,'rows':_0x106c1f}:null;}})[_0x3575('0x24')](respondWithResult(_0x195c8c,null))[_0x3575('0x2e')](handleError(_0x195c8c,null));}; \ No newline at end of file +var _0xad82=['EventManager','offline','files','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','originalname','mimetype','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','color','tag','getSnippet','iftime\x20%s,%s','timezone','interval','indexOf','true','info','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','addApplications','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','where','options','rows','show','params','keys','includeAll','include','find','create','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','sort','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','existsSync','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','ChatApplication','Applications','List','account','applications','list','orderBy','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','%s\x20%s','version','unknown','device','vendor','format','type','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad82,0x195));var _0x2ad8=function(_0x3c4016,_0x2e220f){_0x3c4016=_0x3c4016-0x0;var _0x3cebbd=_0xad82[_0x3c4016];return _0x3cebbd;};'use strict';var emlformat=require(_0x2ad8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ad8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ad8('0x2'));var moment=require(_0x2ad8('0x3'));var BPromise=require(_0x2ad8('0x4'));var Mustache=require(_0x2ad8('0x5'));var util=require(_0x2ad8('0x6'));var path=require('path');var sox=require(_0x2ad8('0x7'));var csv=require('to-csv');var ejs=require(_0x2ad8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ad8('0x9'));var squel=require(_0x2ad8('0xa'));var crypto=require(_0x2ad8('0xb'));var jsforce=require(_0x2ad8('0xc'));var deskjs=require(_0x2ad8('0xd'));var toCsv=require(_0x2ad8('0xe'));var querystring=require('querystring');var Papa=require(_0x2ad8('0xf'));var Redis=require('ioredis');var authService=require(_0x2ad8('0x10'));var qs=require(_0x2ad8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ad8('0x12'));var logger=require(_0x2ad8('0x13'))('api');var utils=require(_0x2ad8('0x14'));var config=require(_0x2ad8('0x15'));var licenseUtil=require(_0x2ad8('0x16'));var db=require(_0x2ad8('0x17'))['db'];config[_0x2ad8('0x18')]=_[_0x2ad8('0x19')](config['redis'],{'host':_0x2ad8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ad8('0x18')]));require(_0x2ad8('0x1b'))[_0x2ad8('0x1c')](socket);var jayson=require(_0x2ad8('0x1d'));var client=jayson[_0x2ad8('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x2ad8('0x1e')][_0x2ad8('0x1f')]({'port':0x232a});var client9003=jayson['client'][_0x2ad8('0x1f')]({'port':0x232b});var client9001=jayson[_0x2ad8('0x1e')][_0x2ad8('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x4c75cb,_0x15e6b3,_0x29e108,_0x4088d4){return new BPromise(function(_0x1fc3d5,_0x430c28){var _0x3bb5de=_0x4088d4||client;return _0x3bb5de[_0x2ad8('0x20')](_0x4c75cb,_0x29e108)['then'](function(_0xd4a7b1){logger['info'](_0x2ad8('0x21'),_0x15e6b3,_0x2ad8('0x22'));logger['debug'](_0x2ad8('0x23'),_0x15e6b3,_0x2ad8('0x22'),JSON['stringify'](_0xd4a7b1));if(_0xd4a7b1['error']){if(_0xd4a7b1[_0x2ad8('0x24')][_0x2ad8('0x25')]===0x1f4){logger[_0x2ad8('0x24')](_0x2ad8('0x21'),_0x15e6b3,_0xd4a7b1[_0x2ad8('0x24')]['message']);return _0x430c28(_0xd4a7b1[_0x2ad8('0x24')][_0x2ad8('0x26')]);}logger[_0x2ad8('0x24')](_0x2ad8('0x21'),_0x15e6b3,_0xd4a7b1[_0x2ad8('0x24')][_0x2ad8('0x26')]);return _0x1fc3d5(_0xd4a7b1[_0x2ad8('0x24')][_0x2ad8('0x26')]);}else{logger['info'](_0x2ad8('0x21'),_0x15e6b3,_0x2ad8('0x22'));_0x1fc3d5(_0xd4a7b1['result'][_0x2ad8('0x26')]);}})[_0x2ad8('0x27')](function(_0x4c6f41){logger[_0x2ad8('0x24')](_0x2ad8('0x21'),_0x15e6b3,_0x4c6f41);_0x430c28(_0x4c6f41);});});}function respondWithStatusCode(_0x58165b,_0x2fbda4){_0x2fbda4=_0x2fbda4||0xcc;return function(_0x2607c0){if(_0x2607c0){return _0x58165b[_0x2ad8('0x28')](_0x2fbda4);}return _0x58165b[_0x2ad8('0x29')](_0x2fbda4)['end']();};}function respondWithResult(_0xf8a8fd,_0x51c2bf){_0x51c2bf=_0x51c2bf||0xc8;return function(_0x13416d){if(_0x13416d){return _0xf8a8fd[_0x2ad8('0x29')](_0x51c2bf)[_0x2ad8('0x2a')](_0x13416d);}};}function respondWithFilteredResult(_0x2aa11f,_0x2caf7d){return function(_0x1825eb){if(_0x1825eb){var _0x227033=typeof _0x2caf7d[_0x2ad8('0x2b')]===_0x2ad8('0x2c')&&typeof _0x2caf7d[_0x2ad8('0x2d')]===_0x2ad8('0x2c');var _0x42b425=_0x1825eb[_0x2ad8('0x2e')];var _0x2761bc=_0x227033?0x0:_0x2caf7d[_0x2ad8('0x2b')];var _0x4d9b9e=_0x227033?_0x1825eb[_0x2ad8('0x2e')]:_0x2caf7d[_0x2ad8('0x2b')]+_0x2caf7d['limit'];var _0x3d035d;if(_0x4d9b9e>=_0x42b425){_0x4d9b9e=_0x42b425;_0x3d035d=0xc8;}else{_0x3d035d=0xce;}_0x2aa11f[_0x2ad8('0x29')](_0x3d035d);return _0x2aa11f[_0x2ad8('0x2f')](_0x2ad8('0x30'),_0x2761bc+'-'+_0x4d9b9e+'/'+_0x42b425)[_0x2ad8('0x2a')](_0x1825eb);}return null;};}function patchUpdates(_0x2ce9b7){return function(_0x28e4b7){try{jsonpatch[_0x2ad8('0x31')](_0x28e4b7,_0x2ce9b7,!![]);}catch(_0x57db79){return BPromise[_0x2ad8('0x32')](_0x57db79);}return _0x28e4b7[_0x2ad8('0x33')]();};}function saveUpdates(_0xc2a81e,_0x45c3e4){return function(_0x38aea6){if(_0x38aea6){return _0x38aea6[_0x2ad8('0x34')](_0xc2a81e)['then'](function(_0x8386cc){return _0x8386cc;});}return null;};}function removeEntity(_0x5de165,_0x2606bd){return function(_0x208824){if(_0x208824){return _0x208824[_0x2ad8('0x35')]()[_0x2ad8('0x36')](function(){var _0x12fa8c=_0x208824[_0x2ad8('0x37')]({'plain':!![]});var _0x5afce6=_0x2ad8('0x38');return db[_0x2ad8('0x39')][_0x2ad8('0x35')]({'where':{'type':_0x5afce6,'resourceId':_0x12fa8c['id']}})[_0x2ad8('0x36')](function(){return _0x208824;});})['then'](function(){_0x5de165[_0x2ad8('0x29')](0xcc)[_0x2ad8('0x3a')]();});}};}function handleEntityNotFound(_0x5121d2,_0x32dd3e){return function(_0x3ca950){if(!_0x3ca950){_0x5121d2['sendStatus'](0x194);}return _0x3ca950;};}function handleError(_0x355e96,_0x2dc1b9){_0x2dc1b9=_0x2dc1b9||0x1f4;return function(_0x53d352){logger[_0x2ad8('0x24')](_0x53d352[_0x2ad8('0x3b')]);if(_0x53d352[_0x2ad8('0x3c')]){delete _0x53d352['name'];}_0x355e96[_0x2ad8('0x29')](_0x2dc1b9)[_0x2ad8('0x3d')](_0x53d352);};}exports['index']=function(_0x29fddb,_0x28d3b2){var _0x47e570={'include':[{'model':db[_0x2ad8('0x3e')],'as':_0x2ad8('0x3f')}]},_0x117065={},_0x251380={'count':0x0,'rows':[]};var _0x51f6d3=_[_0x2ad8('0x40')](db[_0x2ad8('0x41')][_0x2ad8('0x42')],function(_0x44512f){return{'name':_0x44512f['fieldName'],'type':_0x44512f['type']['key']};});_0x117065['model']=_[_0x2ad8('0x40')](_0x51f6d3,_0x2ad8('0x3c'));_0x117065['query']=_['keys'](_0x29fddb['query']);_0x117065['filters']=_[_0x2ad8('0x43')](_0x117065[_0x2ad8('0x44')],_0x117065[_0x2ad8('0x45')]);_0x47e570[_0x2ad8('0x46')]=_[_0x2ad8('0x43')](_0x117065[_0x2ad8('0x44')],qs['fields'](_0x29fddb[_0x2ad8('0x45')][_0x2ad8('0x47')]));_0x47e570['attributes']=_0x47e570[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x47e570[_0x2ad8('0x46')]:_0x117065[_0x2ad8('0x44')];if(!_0x29fddb[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0x47e570[_0x2ad8('0x2d')]=qs[_0x2ad8('0x2d')](_0x29fddb[_0x2ad8('0x45')]['limit']);_0x47e570[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x29fddb[_0x2ad8('0x45')]['offset']);}_0x47e570[_0x2ad8('0x4b')]=qs['sort'](_0x29fddb[_0x2ad8('0x45')]['sort']);_0x47e570['where']=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x29fddb[_0x2ad8('0x45')],_0x117065[_0x2ad8('0x4c')]),_0x51f6d3);if(_0x29fddb[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x47e570['where']=_[_0x2ad8('0x4f')](_0x47e570[_0x2ad8('0x50')],{'$or':_['map'](_0x51f6d3,function(_0x56803c){if(_0x56803c['type']!=='VIRTUAL'){var _0x44b9c9={};_0x44b9c9[_0x56803c[_0x2ad8('0x3c')]]={'$like':'%'+_0x29fddb[_0x2ad8('0x45')][_0x2ad8('0x4e')]+'%'};return _0x44b9c9;}})});}_0x47e570=_[_0x2ad8('0x4f')]({},_0x47e570,_0x29fddb[_0x2ad8('0x51')]);var _0x33e1fa={'where':_0x47e570['where']};return db[_0x2ad8('0x41')][_0x2ad8('0x2e')](_0x33e1fa)[_0x2ad8('0x36')](function(_0x1ac69b){_0x251380['count']=_0x1ac69b;if(_0x29fddb[_0x2ad8('0x45')]['includeAll']){_0x47e570['include']=[{'all':!![]}];}return db[_0x2ad8('0x41')]['findAll'](_0x47e570);})[_0x2ad8('0x36')](function(_0x2ba1a5){_0x251380[_0x2ad8('0x52')]=_0x2ba1a5;return _0x251380;})[_0x2ad8('0x36')](respondWithFilteredResult(_0x28d3b2,_0x47e570))[_0x2ad8('0x27')](handleError(_0x28d3b2,null));};exports[_0x2ad8('0x53')]=function(_0x599acc,_0x54d8a8){var _0xf5a8c1={'raw':![],'where':{'id':_0x599acc[_0x2ad8('0x54')]['id']},'include':[{'model':db[_0x2ad8('0x3e')],'as':_0x2ad8('0x3f')}]},_0x4ab261={};_0x4ab261[_0x2ad8('0x44')]=_[_0x2ad8('0x55')](db[_0x2ad8('0x41')][_0x2ad8('0x42')]);_0x4ab261[_0x2ad8('0x45')]=_[_0x2ad8('0x55')](_0x599acc[_0x2ad8('0x45')]);_0x4ab261[_0x2ad8('0x4c')]=_[_0x2ad8('0x43')](_0x4ab261[_0x2ad8('0x44')],_0x4ab261[_0x2ad8('0x45')]);_0xf5a8c1[_0x2ad8('0x46')]=_['intersection'](_0x4ab261[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x599acc[_0x2ad8('0x45')][_0x2ad8('0x47')]));_0xf5a8c1[_0x2ad8('0x46')]=_0xf5a8c1[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0xf5a8c1[_0x2ad8('0x46')]:_0x4ab261['model'];if(_0x599acc[_0x2ad8('0x45')][_0x2ad8('0x56')]){_0xf5a8c1[_0x2ad8('0x57')]=[{'all':!![]}];}_0xf5a8c1=_['merge']({},_0xf5a8c1,_0x599acc['options']);return db[_0x2ad8('0x41')][_0x2ad8('0x58')](_0xf5a8c1)['then'](handleEntityNotFound(_0x54d8a8,null))[_0x2ad8('0x36')](respondWithResult(_0x54d8a8,null))[_0x2ad8('0x27')](handleError(_0x54d8a8,null));};exports[_0x2ad8('0x59')]=function(_0x1181d4,_0x2c860e){return db[_0x2ad8('0x41')]['create'](_0x1181d4[_0x2ad8('0x5a')],{})[_0x2ad8('0x36')](function(_0xeaf2fc){var _0x6008c0=_0x1181d4['user'][_0x2ad8('0x37')]({'plain':!![]});if(!_0x6008c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6008c0[_0x2ad8('0x5b')]===_0x2ad8('0x5c')){var _0x4d9a94=_0xeaf2fc[_0x2ad8('0x37')]({'plain':!![]});var _0xed2350='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0xed2350,'userProfileId':_0x6008c0[_0x2ad8('0x5d')]},'raw':!![]})[_0x2ad8('0x36')](function(_0x20e030){if(_0x20e030&&_0x20e030['autoAssociation']===0x0){return db['UserProfileResource'][_0x2ad8('0x59')]({'name':_0x4d9a94['name'],'resourceId':_0x4d9a94['id'],'type':_0x20e030[_0x2ad8('0x3c')],'sectionId':_0x20e030['id']},{})[_0x2ad8('0x36')](function(){return _0xeaf2fc;});}else{return _0xeaf2fc;}})[_0x2ad8('0x27')](function(_0x5c148e){logger[_0x2ad8('0x24')](_0x2ad8('0x5e'),_0x5c148e);throw _0x5c148e;});}return _0xeaf2fc;})[_0x2ad8('0x36')](respondWithResult(_0x2c860e,0xc9))['catch'](handleError(_0x2c860e,null));};exports[_0x2ad8('0x34')]=function(_0x8b1e7c,_0x324efd){if(_0x8b1e7c[_0x2ad8('0x5a')]['id']){delete _0x8b1e7c[_0x2ad8('0x5a')]['id'];}return db['ChatWebsite'][_0x2ad8('0x58')]({'where':{'id':_0x8b1e7c['params']['id']},'include':[{'model':db[_0x2ad8('0x3e')],'as':_0x2ad8('0x3f')}]})['then'](handleEntityNotFound(_0x324efd,null))[_0x2ad8('0x36')](saveUpdates(_0x8b1e7c[_0x2ad8('0x5a')],null))[_0x2ad8('0x36')](respondWithResult(_0x324efd,null))[_0x2ad8('0x27')](handleError(_0x324efd,null));};exports[_0x2ad8('0x35')]=function(_0x299aca,_0x38da2f){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x299aca[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x38da2f,null))[_0x2ad8('0x36')](removeEntity(_0x38da2f,null))[_0x2ad8('0x27')](handleError(_0x38da2f,null));};exports[_0x2ad8('0x5f')]=function(_0x5043fd,_0x3db0e8){return db[_0x2ad8('0x41')][_0x2ad8('0x5f')]()[_0x2ad8('0x36')](respondWithResult(_0x3db0e8,null))[_0x2ad8('0x27')](handleError(_0x3db0e8,null));};exports[_0x2ad8('0x60')]=function(_0x11448d,_0x3ac088,_0x4f308f){if(_0x11448d['body']['id']){delete _0x11448d['body']['id'];}return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x11448d[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x3ac088,null))[_0x2ad8('0x36')](function(_0x3818ef){if(_0x3818ef){_0x11448d[_0x2ad8('0x5a')]['ChatWebsiteId']=_0x3818ef['id'];return db[_0x2ad8('0x61')][_0x2ad8('0x59')](_0x11448d[_0x2ad8('0x5a')]);}})[_0x2ad8('0x36')](respondWithResult(_0x3ac088,null))['catch'](handleError(_0x3ac088,null));};exports[_0x2ad8('0x62')]=function(_0x4b7f36,_0x3315e2,_0x23fdbc){var _0x9526fe={'raw':![],'where':{}};var _0x50f0ab={};var _0x5b2bbf={'count':0x0,'rows':[]};return db[_0x2ad8('0x41')][_0x2ad8('0x63')]({'where':{'id':_0x4b7f36[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x3315e2,null))[_0x2ad8('0x36')](function(_0x56f49e){if(_0x56f49e){_0x50f0ab[_0x2ad8('0x44')]=_['keys'](db[_0x2ad8('0x61')][_0x2ad8('0x42')]);_0x50f0ab[_0x2ad8('0x45')]=_['keys'](_0x4b7f36[_0x2ad8('0x45')]);_0x50f0ab[_0x2ad8('0x4c')]=_[_0x2ad8('0x43')](_0x50f0ab[_0x2ad8('0x44')],_0x50f0ab[_0x2ad8('0x45')]);_0x9526fe['attributes']=_[_0x2ad8('0x43')](_0x50f0ab[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x4b7f36['query'][_0x2ad8('0x47')]));_0x9526fe['attributes']=_0x9526fe[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x9526fe[_0x2ad8('0x46')]:_0x50f0ab['model'];if(!_0x4b7f36[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0x9526fe[_0x2ad8('0x2d')]=qs['limit'](_0x4b7f36[_0x2ad8('0x45')][_0x2ad8('0x2d')]);_0x9526fe[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x4b7f36['query'][_0x2ad8('0x2b')]);}_0x9526fe[_0x2ad8('0x4b')]=qs['sort'](_0x4b7f36['query'][_0x2ad8('0x64')]);_0x9526fe[_0x2ad8('0x50')]=qs['filters'](_[_0x2ad8('0x4d')](_0x4b7f36['query'],_0x50f0ab[_0x2ad8('0x4c')]));_0x9526fe[_0x2ad8('0x50')][_0x2ad8('0x65')]=_0x56f49e['id'];if(_0x4b7f36[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x9526fe[_0x2ad8('0x50')]=_[_0x2ad8('0x4f')](_0x9526fe[_0x2ad8('0x50')],{'$or':_[_0x2ad8('0x40')](_0x9526fe[_0x2ad8('0x46')],function(_0x33d767){var _0x3dfdd4={};_0x3dfdd4[_0x33d767]={'$like':'%'+_0x4b7f36[_0x2ad8('0x45')]['filter']+'%'};return _0x3dfdd4;})});}_0x9526fe=_['merge']({},_0x9526fe,_0x4b7f36[_0x2ad8('0x51')]);return db[_0x2ad8('0x61')]['count']({'where':_0x9526fe['where']})['then'](function(_0x3b8d7a){_0x5b2bbf[_0x2ad8('0x2e')]=_0x3b8d7a;if(_0x4b7f36[_0x2ad8('0x45')][_0x2ad8('0x56')]){_0x9526fe[_0x2ad8('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x2ad8('0x66')](_0x9526fe);})[_0x2ad8('0x36')](function(_0x29d42a){_0x5b2bbf[_0x2ad8('0x52')]=_0x29d42a;return _0x5b2bbf;});}})[_0x2ad8('0x36')](respondWithFilteredResult(_0x3315e2,_0x9526fe))['catch'](handleError(_0x3315e2,null));};exports[_0x2ad8('0x67')]=function(_0x11baae,_0x280e09,_0x57c5de){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x11baae[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x280e09,null))[_0x2ad8('0x36')](function(_0x4b526a){if(_0x4b526a){return _0x4b526a['removeDispositions'](_0x11baae[_0x2ad8('0x45')][_0x2ad8('0x68')]);}})[_0x2ad8('0x36')](respondWithStatusCode(_0x280e09,null))[_0x2ad8('0x27')](handleError(_0x280e09,null));};exports[_0x2ad8('0x69')]=function(_0x3d1245,_0x2d5053,_0xa1d0fb){if(_0x3d1245[_0x2ad8('0x5a')]['id']){delete _0x3d1245[_0x2ad8('0x5a')]['id'];}return db[_0x2ad8('0x41')]['find']({'where':{'id':_0x3d1245[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x2d5053,null))[_0x2ad8('0x36')](function(_0x40eca2){if(_0x40eca2){_0x3d1245[_0x2ad8('0x5a')][_0x2ad8('0x65')]=_0x40eca2['id'];return db[_0x2ad8('0x6a')][_0x2ad8('0x59')](_0x3d1245[_0x2ad8('0x5a')]);}})['then'](respondWithResult(_0x2d5053,null))[_0x2ad8('0x27')](handleError(_0x2d5053,null));};exports[_0x2ad8('0x6b')]=function(_0x1c2ee2,_0x30607c,_0x2ff0d8){var _0x3bd4be={'raw':![],'where':{}};var _0x2c4b25={};var _0x26cf15={'count':0x0,'rows':[]};return db[_0x2ad8('0x41')]['findOne']({'where':{'id':_0x1c2ee2[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x30607c,null))[_0x2ad8('0x36')](function(_0xe02e90){if(_0xe02e90){_0x2c4b25[_0x2ad8('0x44')]=_[_0x2ad8('0x55')](db[_0x2ad8('0x6a')]['rawAttributes']);_0x2c4b25[_0x2ad8('0x45')]=_['keys'](_0x1c2ee2[_0x2ad8('0x45')]);_0x2c4b25['filters']=_[_0x2ad8('0x43')](_0x2c4b25[_0x2ad8('0x44')],_0x2c4b25[_0x2ad8('0x45')]);_0x3bd4be[_0x2ad8('0x46')]=_['intersection'](_0x2c4b25['model'],qs[_0x2ad8('0x47')](_0x1c2ee2[_0x2ad8('0x45')]['fields']));_0x3bd4be[_0x2ad8('0x46')]=_0x3bd4be[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x3bd4be['attributes']:_0x2c4b25[_0x2ad8('0x44')];if(!_0x1c2ee2[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0x3bd4be['limit']=qs['limit'](_0x1c2ee2[_0x2ad8('0x45')][_0x2ad8('0x2d')]);_0x3bd4be['offset']=qs[_0x2ad8('0x2b')](_0x1c2ee2[_0x2ad8('0x45')][_0x2ad8('0x2b')]);}_0x3bd4be[_0x2ad8('0x4b')]=qs[_0x2ad8('0x64')](_0x1c2ee2[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0x3bd4be['where']=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x1c2ee2[_0x2ad8('0x45')],_0x2c4b25[_0x2ad8('0x4c')]));_0x3bd4be[_0x2ad8('0x50')][_0x2ad8('0x65')]=_0xe02e90['id'];if(_0x1c2ee2['query'][_0x2ad8('0x4e')]){_0x3bd4be[_0x2ad8('0x50')]=_[_0x2ad8('0x4f')](_0x3bd4be['where'],{'$or':_[_0x2ad8('0x40')](_0x3bd4be[_0x2ad8('0x46')],function(_0x5b3143){var _0x5c4745={};_0x5c4745[_0x5b3143]={'$like':'%'+_0x1c2ee2[_0x2ad8('0x45')]['filter']+'%'};return _0x5c4745;})});}_0x3bd4be=_[_0x2ad8('0x4f')]({},_0x3bd4be,_0x1c2ee2[_0x2ad8('0x51')]);return db[_0x2ad8('0x6a')][_0x2ad8('0x2e')]({'where':_0x3bd4be[_0x2ad8('0x50')]})['then'](function(_0x445ce3){_0x26cf15[_0x2ad8('0x2e')]=_0x445ce3;if(_0x1c2ee2[_0x2ad8('0x45')][_0x2ad8('0x56')]){_0x3bd4be[_0x2ad8('0x57')]=[{'all':!![]}];}return db[_0x2ad8('0x6a')][_0x2ad8('0x66')](_0x3bd4be);})[_0x2ad8('0x36')](function(_0x1eaa1a){_0x26cf15[_0x2ad8('0x52')]=_0x1eaa1a;return _0x26cf15;});}})['then'](respondWithFilteredResult(_0x30607c,_0x3bd4be))['catch'](handleError(_0x30607c,null));};exports[_0x2ad8('0x6c')]=function(_0x42cedc,_0x36a905,_0x58acce){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x42cedc[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x36a905,null))[_0x2ad8('0x36')](function(_0x844ea5){if(_0x844ea5){return _0x844ea5[_0x2ad8('0x6c')](_0x42cedc[_0x2ad8('0x45')][_0x2ad8('0x68')]);}})[_0x2ad8('0x36')](respondWithStatusCode(_0x36a905,null))[_0x2ad8('0x27')](handleError(_0x36a905,null));};exports['addLogo']=function(_0xa11eb0,_0x887986,_0x5cd4e9){_0xa11eb0[_0x2ad8('0x5a')][_0x2ad8('0x6d')]=_0xa11eb0[_0x2ad8('0x6e')]['filename'];return db[_0x2ad8('0x41')]['find']({'where':{'id':_0xa11eb0[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x887986,null))[_0x2ad8('0x36')](saveUpdates(_0xa11eb0[_0x2ad8('0x5a')],null))[_0x2ad8('0x36')](respondWithResult(_0x887986,null))['catch'](handleError(_0x887986,null));};exports[_0x2ad8('0x6f')]=function(_0xa313d0,_0x47ec67,_0x224190){_0xa313d0[_0x2ad8('0x5a')][_0x2ad8('0x70')]=_0xa313d0['file'][_0x2ad8('0x71')];return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0xa313d0[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x47ec67,null))[_0x2ad8('0x36')](saveUpdates(_0xa313d0[_0x2ad8('0x5a')],null))[_0x2ad8('0x36')](respondWithResult(_0x47ec67,null))[_0x2ad8('0x27')](handleError(_0x47ec67,null));};exports[_0x2ad8('0x72')]=function(_0x10f84a,_0x5bc9bb,_0x38fef6){_0x10f84a[_0x2ad8('0x5a')][_0x2ad8('0x73')]=_0x10f84a[_0x2ad8('0x6e')][_0x2ad8('0x71')];return db[_0x2ad8('0x41')]['find']({'where':{'id':_0x10f84a[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x5bc9bb,null))[_0x2ad8('0x36')](saveUpdates(_0x10f84a[_0x2ad8('0x5a')],null))['then'](respondWithResult(_0x5bc9bb,null))['catch'](handleError(_0x5bc9bb,null));};exports[_0x2ad8('0x74')]=function(_0x9cb381,_0xd0ba5c,_0x3f58aa){_0x9cb381[_0x2ad8('0x5a')][_0x2ad8('0x75')]=_0x9cb381[_0x2ad8('0x6e')][_0x2ad8('0x71')];return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x9cb381[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0xd0ba5c,null))[_0x2ad8('0x36')](saveUpdates(_0x9cb381[_0x2ad8('0x5a')],null))[_0x2ad8('0x36')](respondWithResult(_0xd0ba5c,null))['catch'](handleError(_0xd0ba5c,null));};exports[_0x2ad8('0x76')]=function(_0x276c42,_0x14b171,_0x571db4){var _0x461ab4=path['join'](config[_0x2ad8('0x77')],_0x2ad8('0x78'));var _0x1bf4a3={'where':{'id':_0x276c42['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2de627=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x525467){if(_0x525467){_0x2de627=_0x525467[_0x2ad8('0x79')];}})[_0x2ad8('0x36')](function(){return db[_0x2ad8('0x41')][_0x2ad8('0x58')](_0x1bf4a3);})['then'](handleEntityNotFound(_0x14b171,null))[_0x2ad8('0x36')](function(_0x1a947c){if(_0x1a947c){if(!_[_0x2ad8('0x7a')](_0x1a947c[_0x2ad8('0x6d')])){if(fs['existsSync'](path['join'](config[_0x2ad8('0x77')],_0x2ad8('0x7b'),_0x1a947c[_0x2ad8('0x6d')]))&&_0x2de627){_0x461ab4=path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x7b'),_0x1a947c[_0x2ad8('0x6d')]);}}return _0x14b171[_0x2ad8('0x7d')](_0x461ab4);}})[_0x2ad8('0x27')](handleError(_0x14b171,null));};exports[_0x2ad8('0x7e')]=function(_0x3e5bad,_0x4cea44,_0x514c1f){var _0x12689e=path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x7f'));var _0x2ea527={'where':{'id':_0x3e5bad[_0x2ad8('0x54')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2ad8('0x41')][_0x2ad8('0x58')](_0x2ea527)[_0x2ad8('0x36')](handleEntityNotFound(_0x4cea44,null))[_0x2ad8('0x36')](function(_0x322425){if(_0x322425){if(!_[_0x2ad8('0x7a')](_0x322425[_0x2ad8('0x70')])){if(fs['existsSync'](path['join'](config['root'],_0x2ad8('0x80'),_0x322425[_0x2ad8('0x70')]))){_0x12689e=path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x80'),_0x322425['agentAvatar']);}}return _0x4cea44[_0x2ad8('0x7d')](_0x12689e);}})['catch'](handleError(_0x4cea44,null));};exports[_0x2ad8('0x81')]=function(_0x232f9d,_0x25f53d,_0x3da2b9){var _0x2b081f=path[_0x2ad8('0x7c')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x193eb0={'where':{'id':_0x232f9d[_0x2ad8('0x54')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x2ad8('0x41')][_0x2ad8('0x58')](_0x193eb0)[_0x2ad8('0x36')](handleEntityNotFound(_0x25f53d,null))[_0x2ad8('0x36')](function(_0x38551f){if(_0x38551f){if(!_['isNil'](_0x38551f[_0x2ad8('0x73')])){if(fs[_0x2ad8('0x82')](path[_0x2ad8('0x7c')](config['root'],_0x2ad8('0x80'),_0x38551f[_0x2ad8('0x73')]))&&_0x38551f[_0x2ad8('0x83')]){_0x2b081f=path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x80'),_0x38551f['customerAvatar']);}}return _0x25f53d[_0x2ad8('0x7d')](_0x2b081f);}})[_0x2ad8('0x27')](handleError(_0x25f53d,null));};exports[_0x2ad8('0x84')]=function(_0x16ddd8,_0x2573c6,_0x282459){var _0x1becc6=path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],'server/files/images/avatars/system_avatar.png');var _0x2cb07d={'where':{'id':_0x16ddd8['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x2ad8('0x41')]['find'](_0x2cb07d)[_0x2ad8('0x36')](handleEntityNotFound(_0x2573c6,null))[_0x2ad8('0x36')](function(_0x45e609){if(_0x45e609){if(!_[_0x2ad8('0x7a')](_0x45e609[_0x2ad8('0x75')])){if(fs['existsSync'](path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x80'),_0x45e609[_0x2ad8('0x75')]))){_0x1becc6=path['join'](config['root'],_0x2ad8('0x80'),_0x45e609['systemAvatar']);}}return _0x2573c6['download'](_0x1becc6);}})['catch'](handleError(_0x2573c6,null));};exports[_0x2ad8('0x85')]=function(_0x37a426,_0x2b3aad,_0x1837f6){var _0x9547ac=require(_0x2ad8('0x86'));var _0x4d005a=new _0x9547ac();var _0x5c4456=_0x4d005a[_0x2ad8('0x87')](_0x37a426[_0x2ad8('0x88')][_0x2ad8('0x89')])['getResult']();var _0xb7e852={'body':_0x37a426[_0x2ad8('0x5a')],'channel':_0x2ad8('0x8a')};var _0x33814a=[];var _0x149f24=[];var _0x1f55e9={};var _0x44e058=![];return db[_0x2ad8('0x8b')]['describe']()[_0x2ad8('0x36')](function(_0x503727){if(!_0x503727){throw new db[(_0x2ad8('0x8c'))]['ValidationError'](_0x2ad8('0x8d'));}_0x33814a=_[_0x2ad8('0x8e')](_[_0x2ad8('0x55')](_0x503727),[_0x2ad8('0x8f'),_0x2ad8('0x90')]);_0x149f24=_[_0x2ad8('0x8e')](_[_0x2ad8('0x55')](_0x503727),[_0x2ad8('0x8f'),'updatedAt',_0x2ad8('0x91'),_0x2ad8('0x92')]);if(_0x37a426[_0x2ad8('0x5a')]['id']){delete _0x37a426['body']['id'];}if(_[_0x2ad8('0x7a')](_0x37a426[_0x2ad8('0x5a')]['from'])){throw new db[(_0x2ad8('0x8c'))][(_0x2ad8('0x93'))](_0x2ad8('0x94'));}if(_[_0x2ad8('0x7a')](_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x5a')])||_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x5a')]===''){throw new db[(_0x2ad8('0x8c'))][(_0x2ad8('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x95')])){throw new db[(_0x2ad8('0x8c'))]['ValidationError'](_0x2ad8('0x96')+_0x149f24);}if(!_[_0x2ad8('0x97')](_0x149f24,_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x95')])){throw new db[(_0x2ad8('0x8c'))]['ValidationError'](_0x2ad8('0x98')+_0x149f24);}_0x1f55e9[_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x95')]]=_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x99')];})[_0x2ad8('0x36')](function(){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x37a426[_0x2ad8('0x54')]['id']},'include':[{'model':db[_0x2ad8('0x9a')],'as':'List','include':[{'model':db[_0x2ad8('0x8b')],'as':'Contacts','where':_0x1f55e9,'limit':0x1,'order':[[_0x2ad8('0x90'),'DESC']]}]},{'model':db[_0x2ad8('0x9b')],'as':_0x2ad8('0x9c')}]});})[_0x2ad8('0x36')](handleEntityNotFound(_0x2b3aad,null))[_0x2ad8('0x36')](function(_0xb8544f){if(_0xb8544f&&_0xb8544f[_0x2ad8('0x9d')]){_0xb7e852[_0x2ad8('0x9e')]=_0xb8544f;_0xb7e852[_0x2ad8('0x9f')]=_0xb8544f[_0x2ad8('0x9c')];_0xb7e852[_0x2ad8('0xa0')]=_0xb8544f['List'];_0xb7e852['applications']=_[_0x2ad8('0xa1')](_0xb7e852['applications'],['priority'],[_0x2ad8('0xa2')]);if(_0xb7e852[_0x2ad8('0x9e')][_0x2ad8('0x9c')]){delete _0xb7e852[_0x2ad8('0x9e')][_0x2ad8('0x9c')];}if(_0xb7e852['account']['List']&&_0xb7e852[_0x2ad8('0x9e')][_0x2ad8('0x9d')][_0x2ad8('0xa3')]['length']){return _0xb7e852[_0x2ad8('0x9e')]['List'][_0x2ad8('0xa3')][0x0];}var _0x1ebf1b=_[_0x2ad8('0x19')](_0x37a426['body'],{'firstName':_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x99')],'ListId':_0xb8544f[_0x2ad8('0x92')]});_0x1ebf1b[_0x37a426[_0x2ad8('0x5a')]['mapKey']]=_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0x99')];return db[_0x2ad8('0x8b')][_0x2ad8('0x59')](_0x1ebf1b,{'fields':_0x33814a,'raw':!![]});}})[_0x2ad8('0x36')](handleEntityNotFound(_0x2b3aad,null))[_0x2ad8('0x36')](function(_0x51f9c9){_0xb7e852[_0x2ad8('0xa4')]=_0x51f9c9;var _0x170438=_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xa5')];if(_0x37a426[_0x2ad8('0x88')][_0x2ad8('0xa6')]){_0x170438=_0x37a426[_0x2ad8('0x88')][_0x2ad8('0xa6')];}else if(_0x37a426['headers'][_0x2ad8('0xa7')]){_0x170438=_[_0x2ad8('0xa8')](_0x37a426['headers']['x-forwarded-for'][_0x2ad8('0xa9')](','));}if(_0x51f9c9){var _0x2706dd={'ContactId':_0x51f9c9['id'],'ChatWebsiteId':_0x37a426['params']['id'],'from':(_0x51f9c9[_0x2ad8('0xaa')]||'')+'\x20'+(_0x51f9c9['lastName']||''),'customerIp':_0x170438,'customerPort':_0x37a426[_0x2ad8('0x88')][_0x2ad8('0xab')]?_0x37a426['headers'][_0x2ad8('0xab')]:null,'referer':_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xac')],'browserName':_0x5c4456[_0x2ad8('0xad')][_0x2ad8('0x3c')]&&_0x5c4456[_0x2ad8('0xad')]['version']?util['format'](_0x2ad8('0xae'),_0x5c4456[_0x2ad8('0xad')][_0x2ad8('0x3c')],_0x5c4456[_0x2ad8('0xad')][_0x2ad8('0xaf')]):_0x2ad8('0xb0'),'browserVersion':_0x5c4456[_0x2ad8('0xad')]['version']||_0x2ad8('0xb0'),'osName':util['format'](_0x2ad8('0xae'),_0x5c4456['os'][_0x2ad8('0x3c')],_0x5c4456['os']['version']),'osVersion':_0x5c4456['os'][_0x2ad8('0xaf')],'deviceModel':_0x5c4456['device'][_0x2ad8('0x44')]&&_0x5c4456[_0x2ad8('0xb1')][_0x2ad8('0xb2')]?util[_0x2ad8('0xb3')]('%s\x20%s\x20%s',_0x5c4456[_0x2ad8('0xb1')][_0x2ad8('0x44')],_0x5c4456['device'][_0x2ad8('0xb2')],_0x5c4456['device'][_0x2ad8('0xb4')]):null,'deviceVendor':_0x5c4456['device'][_0x2ad8('0xb2')],'deviceType':_0x5c4456[_0x2ad8('0xb1')]['type'],'formData':JSON[_0x2ad8('0xb5')](_0x37a426[_0x2ad8('0x5a')])};var _0x9c330b={'ChatWebsiteId':_0x37a426[_0x2ad8('0x54')]['id'],'closed':![]};if(_0x37a426['body'][_0x2ad8('0xb6')]){_0x9c330b[_0x2ad8('0xb6')]=_0x37a426['body'][_0x2ad8('0xb6')];return db[_0x2ad8('0xb7')][_0x2ad8('0x58')]({'where':_0x9c330b})[_0x2ad8('0x36')](function(_0x5b9bee){if(_0x5b9bee){return[_0x5b9bee,![]];}_0x2706dd[_0x2ad8('0xb6')]=_0x37a426['body'][_0x2ad8('0xb6')];_0x2706dd[_0x2ad8('0xb8')]=_0x37a426['body'][_0x2ad8('0xb8')];return db[_0x2ad8('0xb7')]['create'](_0x2706dd)[_0x2ad8('0x36')](function(_0x162f47){return[_0x162f47,!![]];});});}_0x9c330b[_0x2ad8('0xb9')]=_0x51f9c9['id'];if(_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xba')]&&_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xba')]['id']){_0x9c330b['id']=_0x37a426['body']['interaction']['id'];return db['ChatInteraction'][_0x2ad8('0x58')]({'where':_0x9c330b})['then'](function(_0x13f5ec){if(_0x13f5ec){return[_0x13f5ec,![]];}return db[_0x2ad8('0xb7')]['create'](_0x2706dd)[_0x2ad8('0x36')](function(_0x10f9fe){return[_0x10f9fe,!![]];});});}return db[_0x2ad8('0xb7')]['create'](_0x2706dd)[_0x2ad8('0x36')](function(_0x46ceb7){return[_0x46ceb7,!![]];});}})[_0x2ad8('0xbb')](function(_0x5168fc,_0x4078a1){if(_0x5168fc){_0x44e058=_0x4078a1;if(!_0x4078a1){var _0xf34979={'from':(_0xb7e852['contact'][_0x2ad8('0xaa')]||'')+'\x20'+(_0xb7e852[_0x2ad8('0xa4')][_0x2ad8('0xbc')]||'')};if(_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xb6')]&&_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xbd')]&&_0x37a426[_0x2ad8('0x5a')]['threadId']!=_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xbd')]){_0xf34979['threadId']=_0x37a426[_0x2ad8('0x5a')][_0x2ad8('0xbd')];}return _0x5168fc['update'](_0xf34979);}else{return _0x5168fc;}}})[_0x2ad8('0x36')](function(_0x460279){_0xb7e852[_0x2ad8('0xba')]=_0x460279[_0x2ad8('0x37')]({'plain':!![]});_0xb7e852[_0x2ad8('0xba')][_0x2ad8('0xbe')]=_0x44e058;if(_0xb7e852[_0x2ad8('0xba')][_0x2ad8('0xbe')]){if(_0xb7e852[_0x2ad8('0x9e')][_0x2ad8('0xbf')]){_0xb7e852['applications']['push']({'id':0x0,'priority':_0xb7e852[_0x2ad8('0x9f')][_0x2ad8('0x48')]+0x1,'app':_0x2ad8('0xc0'),'appdata':_0x2ad8('0xc1'),'interval':_0x2ad8('0xc2')});}}return db[_0x2ad8('0xc3')]['create']({'body':_0x37a426['body'][_0x2ad8('0x5a')],'ChatWebsiteId':_0x37a426[_0x2ad8('0x54')]['id'],'ChatInteractionId':_0x460279['id'],'direction':'in','ContactId':_0xb7e852[_0x2ad8('0xa4')]['id'],'AttachmentId':_0x37a426[_0x2ad8('0x5a')]['AttachmentId']});})['then'](function(_0x567bff){_0xb7e852['message']=_0x567bff;if(_0xb7e852[_0x2ad8('0xba')][_0x2ad8('0xc4')]){return db['User']['find']({'attributes':['id',_0x2ad8('0x3c')],'where':{'id':_0xb7e852[_0x2ad8('0xba')][_0x2ad8('0xc4')]}})[_0x2ad8('0x36')](function(_0x416427){if(_0x416427){_0xb7e852['applications'][_0x2ad8('0xc5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x416427['name']+','+(_0xb7e852[_0x2ad8('0x9e')][_0x2ad8('0xc6')]||0xa),'interval':_0x2ad8('0xc2')});_0xb7e852[_0x2ad8('0xc7')]=!![];}return respondWithRpcPromise('Start',_0x2ad8('0xc8'),_0xb7e852);});}return respondWithRpcPromise('Start',_0x2ad8('0xc8'),_0xb7e852);})[_0x2ad8('0x36')](function(_0x1889df){respondWithRpcPromise(_0x2ad8('0xc9'),_0x2ad8('0xc9'),{'event':_0x2ad8('0x85'),'message':_0x1889df},client9002);return _0x1889df;})[_0x2ad8('0x36')](respondWithResult(_0x2b3aad,null))[_0x2ad8('0x27')](handleError(_0x2b3aad,null));};exports[_0x2ad8('0xca')]=function(_0x37edde,_0x21b4a6,_0x3f0ed3){var _0x2ff08e,_0x32f33d,_0x5e9887;var _0x361da0=[];var _0x540f3c=[];var _0x4e1600={};var _0x28d3dc=_0x37edde[_0x2ad8('0xcb')]||[];var _0x56575e=[];var _0x1df734;return db[_0x2ad8('0x8b')][_0x2ad8('0x5f')]()[_0x2ad8('0x36')](function(_0x473ed7){if(!_0x473ed7){throw new db[(_0x2ad8('0x8c'))][(_0x2ad8('0x93'))](_0x2ad8('0x8d'));}_0x540f3c=_[_0x2ad8('0x8e')](_['keys'](_0x473ed7),[_0x2ad8('0x8f'),'updatedAt']);_0x361da0=_[_0x2ad8('0x8e')](_['keys'](_0x473ed7),[_0x2ad8('0x8f'),_0x2ad8('0x90'),_0x2ad8('0x91'),_0x2ad8('0x92')]);if(_0x37edde[_0x2ad8('0x5a')]['id']){delete _0x37edde[_0x2ad8('0x5a')]['id'];}if(_[_0x2ad8('0x7a')](_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x99')])){throw _0x21b4a6['status'](0x1f4)['send'](new db[(_0x2ad8('0x8c'))][(_0x2ad8('0x93'))]('from\x20is\x20mandatory'));}if(_[_0x2ad8('0x7a')](_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x5a')])||_0x37edde[_0x2ad8('0x5a')]['body']===''){throw _0x21b4a6[_0x2ad8('0x29')](0x1f4)[_0x2ad8('0x3d')](new db[(_0x2ad8('0x8c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2ad8('0x7a')](_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0xcc')])){throw _0x21b4a6[_0x2ad8('0x29')](0x1f4)[_0x2ad8('0x3d')](new db['Sequelize'][(_0x2ad8('0x93'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x361da0));}if(!_[_0x2ad8('0x97')](_0x361da0,_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0xcc')])){throw _0x21b4a6['status'](0x1f4)[_0x2ad8('0x3d')](new db[(_0x2ad8('0x8c'))][(_0x2ad8('0x93'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x361da0));}_0x4e1600[_0x37edde['body'][_0x2ad8('0xcc')]]=_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x99')];})[_0x2ad8('0x36')](function(){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x37edde['params']['id']},'include':[{'model':db[_0x2ad8('0x9a')],'as':_0x2ad8('0x9d')},{'model':db[_0x2ad8('0xcd')],'as':_0x2ad8('0xcd')}]});})[_0x2ad8('0x36')](handleEntityNotFound(_0x21b4a6,null))[_0x2ad8('0x36')](function(_0x58ea6a){if(_0x58ea6a&&_0x58ea6a[_0x2ad8('0x9d')]){_0x32f33d=_0x58ea6a;var _0x38c7be=_[_0x2ad8('0x19')](_0x37edde[_0x2ad8('0x5a')],{'firstName':_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x99')],'phone':_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x99')],'ListId':_0x58ea6a[_0x2ad8('0x92')]});_0x38c7be[_0x37edde['body'][_0x2ad8('0xcc')]]=_0x37edde[_0x2ad8('0x5a')][_0x2ad8('0x99')];return db[_0x2ad8('0x8b')][_0x2ad8('0xce')]({'where':_0x4e1600,'defaults':_0x38c7be});}})[_0x2ad8('0xbb')](function(_0x332d86){if(_0x332d86){_0x5e9887=_0x332d86;var _0x3efb6f=fs[_0x2ad8('0xcf')](path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],'server/files/templates/chatOfflineMessage.ejs'),_0x2ad8('0xd0'));var _0x575128=ejs[_0x2ad8('0xd1')](_0x3efb6f,{'body':_[_0x2ad8('0xd2')](_0x37edde[_0x2ad8('0x5a')]['body']),'bodyTitle':_0x32f33d[_0x2ad8('0xd3')]});return db['ChatOfflineMessage'][_0x2ad8('0x59')]({'body':_0x575128,'ContactId':_0x332d86['id'],'ChatWebsiteId':_0x32f33d['id']});}})['then'](function(_0x2bc34b){_0x1df734=_0x2bc34b;if(_0x28d3dc[_0x2ad8('0x48')]){var _0x2fc3ff=_0x28d3dc['map'](function(_0x2f4181){return{'name':_0x2f4181['originalname'],'basename':_0x2f4181['filename'],'type':_0x2f4181['mimetype'],'ChatOfflineMessageId':_0x2bc34b['id']};});_0x56575e=_0x2fc3ff['map'](_0xc90fd8=>{var _0x52c06d={'filename':_0xc90fd8[_0x2ad8('0x3c')],'path':path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0xd4'),_0x2ad8('0xcb'),_0x2ad8('0xd5'),_0x2ad8('0xd6'),_0xc90fd8[_0x2ad8('0xd7')])};return _0x52c06d;});if(!_0x32f33d[_0x2ad8('0xd8')]){return db[_0x2ad8('0xd9')][_0x2ad8('0xda')](function(_0x516871){return db[_0x2ad8('0xdb')]['bulkCreate'](_0x2fc3ff,{'transaction':_0x516871});});}}})[_0x2ad8('0x36')](function(){if(_0x1df734){_0x2ff08e=_0x1df734;return db[_0x2ad8('0xcd')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2ad8('0xdc'),'raw':!![]}]});}})[_0x2ad8('0x36')](function(_0x59bfd7){if(_0x59bfd7&&_0x59bfd7[_0x2ad8('0xdc')]&&_0x32f33d[_0x2ad8('0xdd')]&&_0x32f33d[_0x2ad8('0xde')]){var _0x449c3c={'tls':{'rejectUnauthorized':![]}};if(_0x59bfd7['Smtp'][_0x2ad8('0xdf')]){_0x449c3c[_0x2ad8('0xdf')]=_0x59bfd7[_0x2ad8('0xdc')][_0x2ad8('0xdf')];}else{_0x449c3c['host']=_0x59bfd7[_0x2ad8('0xdc')][_0x2ad8('0xe0')];_0x449c3c[_0x2ad8('0xe1')]=_0x59bfd7[_0x2ad8('0xdc')]['port'];_0x449c3c[_0x2ad8('0xe2')]=_0x59bfd7[_0x2ad8('0xdc')][_0x2ad8('0xe2')];}if(_0x59bfd7['Smtp'][_0x2ad8('0xe3')]){_0x449c3c[_0x2ad8('0xe4')]={'user':_0x59bfd7[_0x2ad8('0xdc')][_0x2ad8('0x5c')],'pass':_0x59bfd7['Smtp'][_0x2ad8('0xe5')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x449c3c,'message':{'from':util[_0x2ad8('0xb3')](_0x2ad8('0xe6'),_0x59bfd7[_0x2ad8('0x3c')],_0x59bfd7[_0x2ad8('0xe7')]||_0x59bfd7[_0x2ad8('0xdc')]['user']),'to':_0x32f33d[_0x2ad8('0xde')],'subject':_0x32f33d[_0x2ad8('0xe8')],'html':_0x2ff08e[_0x2ad8('0x5a')],'attachments':_0x56575e}},client9003)[_0x2ad8('0x36')](function(){return _0x2ff08e;})[_0x2ad8('0x27')](function(_0x59524f){console[_0x2ad8('0x24')](_0x59524f);});}})[_0x2ad8('0x36')](function(){if(_0x32f33d&&_0x32f33d['openNewInteraction']&&_0x32f33d['MailAccountId']){var _0xde5b14=[];if(_0x28d3dc[_0x2ad8('0x48')]){_0xde5b14=_0x28d3dc[_0x2ad8('0x40')](function(_0x2ab642){return{'name':_0x2ab642[_0x2ad8('0xe9')],'basename':_0x2ab642['filename'],'type':_0x2ab642[_0x2ad8('0xea')],'ChatOfflineMessageId':_0x1df734['id']};});}var _0x13fdf7;if(!_['isNil'](_0x32f33d[_0x2ad8('0xeb')])){var _0xcc992a=_[_0x2ad8('0x40')](_0x37edde[_0x2ad8('0x5a')],function(_0x461066){return _0x461066;});var _0x26c02c=_[_0x2ad8('0xec')](_0xcc992a)[0x0];var _0x3de75d=_['mapValues'](_0x26c02c,function(_0x2a4f98){return _0x2a4f98;});_0x13fdf7=_0x3de75d[0x1][_0x32f33d[_0x2ad8('0xeb')]];}var _0x15cdcd={'from':_0x5e9887[_0x2ad8('0xe7')],'firstName':_0x5e9887[_0x2ad8('0xaa')],'lastName':_0x5e9887[_0x2ad8('0xbc')],'mapKey':_0x2ad8('0xe7'),'message':{'from':_0x5e9887[_0x2ad8('0xe7')],'to':_0x32f33d[_0x2ad8('0xcd')][_0x2ad8('0xe7')],'cc':'','subject':_['isNil'](_0x13fdf7)?_0x32f33d[_0x2ad8('0xe8')]:_0x13fdf7,'messageId':'','sentAt':new Date(),'attach':_0xde5b14['length'],'attachments':_0xde5b14,'originChannel':_0x2ad8('0xed'),'ChatWebsiteId':_0x32f33d['id'],'ChatOfflineMessageId':_0x2ff08e['id'],'originTo':_0x32f33d['MailAccount']['email']},'body':_0x2ff08e['body']};var _0x2b5ee6={'account':{'id':_0x32f33d[_0x2ad8('0xee')]},'body':_0x15cdcd,'log':_0x2ad8('0xef')};return respondWithRpcPromise(_0x2ad8('0xef'),_0x2ad8('0xf0'),_0x2b5ee6,client9001)[_0x2ad8('0x36')](function(){return _0x2ff08e;})[_0x2ad8('0x27')](function(_0x163cc9){console[_0x2ad8('0x24')](_0x163cc9);});}return;})[_0x2ad8('0x36')](function(){if(_0x2ff08e){return _0x2ff08e;}})['then'](respondWithResult(_0x21b4a6,null))[_0x2ad8('0x27')](function(_0x341411){console['error'](_0x2ad8('0x27'),_0x341411);for(var _0x524bed of _0x28d3dc){var _0x2ef250=path['join'](config[_0x2ad8('0x77')],_0x2ad8('0xd4'),_0x2ad8('0xcb'),_0x2ad8('0xd5'),'offline-chat',_0x524bed[_0x2ad8('0x71')]);fs_extra[_0x2ad8('0xf1')](_0x2ef250)[_0x2ad8('0x27')](function(_0x2d2b01){console[_0x2ad8('0x24')](_0x2ad8('0xf2'),_0x2ef250,_0x2d2b01);});}});};exports[_0x2ad8('0xf3')]=function(_0x43564f,_0x562dab,_0x50efdb){return db[_0x2ad8('0xb7')]['find']({'where':{'id':_0x43564f[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x562dab,null))[_0x2ad8('0x36')](function(_0x78e3e){if(_0x78e3e){return _0x78e3e['addInteraction'](_0x43564f['body'][_0x2ad8('0x68')],_[_0x2ad8('0xf4')](_0x43564f['body'],[_0x2ad8('0x68'),'id'])||{});}})[_0x2ad8('0x36')](respondWithResult(_0x562dab,null))['catch'](handleError(_0x562dab,null));};exports[_0x2ad8('0xf5')]=function(_0x346a71,_0x19ddf3,_0x4ae50c){var _0x21dcbe={'raw':![],'where':{}};var _0x27483a={};var _0xfa7896={'count':0x0,'rows':[]};return db[_0x2ad8('0x41')][_0x2ad8('0x63')]({'where':{'id':_0x346a71[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x19ddf3,null))[_0x2ad8('0x36')](function(_0x4698f){if(_0x4698f){_0x27483a[_0x2ad8('0x44')]=_[_0x2ad8('0x55')](db[_0x2ad8('0xb7')][_0x2ad8('0x42')]);_0x27483a[_0x2ad8('0x45')]=_[_0x2ad8('0x55')](_0x346a71[_0x2ad8('0x45')]);_0x27483a['filters']=_[_0x2ad8('0x43')](_0x27483a['model'],_0x27483a[_0x2ad8('0x45')]);_0x21dcbe[_0x2ad8('0x46')]=_[_0x2ad8('0x43')](_0x27483a[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x346a71[_0x2ad8('0x45')]['fields']));_0x21dcbe[_0x2ad8('0x46')]=_0x21dcbe[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x21dcbe['attributes']:_0x27483a[_0x2ad8('0x44')];if(!_0x346a71[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0x21dcbe[_0x2ad8('0x2d')]=qs[_0x2ad8('0x2d')](_0x346a71['query'][_0x2ad8('0x2d')]);_0x21dcbe[_0x2ad8('0x2b')]=qs['offset'](_0x346a71['query'][_0x2ad8('0x2b')]);}_0x21dcbe[_0x2ad8('0x4b')]=qs[_0x2ad8('0x64')](_0x346a71[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0x21dcbe[_0x2ad8('0x50')]=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x346a71[_0x2ad8('0x45')],_0x27483a['filters']));_0x21dcbe['where'][_0x2ad8('0x65')]=_0x4698f['id'];if(_0x346a71[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x21dcbe[_0x2ad8('0x50')]=_['merge'](_0x21dcbe[_0x2ad8('0x50')],{'$or':_[_0x2ad8('0x40')](_0x21dcbe[_0x2ad8('0x46')],function(_0x15bcf0){var _0x5813e4={};_0x5813e4[_0x15bcf0]={'$like':'%'+_0x346a71[_0x2ad8('0x45')][_0x2ad8('0x4e')]+'%'};return _0x5813e4;})});}_0x21dcbe=_[_0x2ad8('0x4f')]({},_0x21dcbe,_0x346a71[_0x2ad8('0x51')]);return db[_0x2ad8('0xb7')][_0x2ad8('0x2e')]({'where':_0x21dcbe['where']})['then'](function(_0x3c551b){_0xfa7896[_0x2ad8('0x2e')]=_0x3c551b;if(_0x346a71['query'][_0x2ad8('0x56')]){_0x21dcbe[_0x2ad8('0x57')]=[{'model':db[_0x2ad8('0x8b')],'as':_0x2ad8('0xf6'),'required':![]},{'model':db[_0x2ad8('0xf7')],'as':_0x2ad8('0xf8'),'attributes':[_0x2ad8('0x3c'),_0x2ad8('0xf9'),_0x2ad8('0xfa')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x2ad8('0x3c'),_0x2ad8('0xfb')],'where':_0x346a71[_0x2ad8('0x45')][_0x2ad8('0xfc')]?{'id':_0x346a71[_0x2ad8('0x45')][_0x2ad8('0xfc')]}:undefined,'required':_0x346a71[_0x2ad8('0x45')][_0x2ad8('0xfc')]?!![]:![]}];}return db[_0x2ad8('0xb7')][_0x2ad8('0x66')](_0x21dcbe);})['then'](function(_0x1c70c4){_0xfa7896[_0x2ad8('0x52')]=_0x1c70c4;return _0xfa7896;});}})[_0x2ad8('0x36')](respondWithFilteredResult(_0x19ddf3,_0x21dcbe))[_0x2ad8('0x27')](handleError(_0x19ddf3,null));};function iftimePromise(_0x1bec96,_0x3436ae){return respondWithRpcPromise('Command',_0x2ad8('0xfd'),{'command':_0x3436ae['timezone']?util[_0x2ad8('0xb3')](_0x2ad8('0xfe'),_0x1bec96['interval'],_0x3436ae[_0x2ad8('0xff')]):util[_0x2ad8('0xb3')]('iftime\x20%s',_0x1bec96[_0x2ad8('0x100')])},client9002)[_0x2ad8('0x36')](function(_0x11531a){var _0xa4676a=_0x11531a&&_0x11531a[_0x2ad8('0x101')](_0x2ad8('0x102'))>=0x0?!![]:![];logger[_0x2ad8('0x103')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3436ae['id'],_0x1bec96['id'],_0x1bec96[_0x2ad8('0x100')],_0xa4676a?'ONLINE':_0x2ad8('0x104'),_0x3436ae['timezone']?_0x3436ae['timezone']:_0x2ad8('0x105'));return _0xa4676a;})['catch'](function(_0x57ec36){logger[_0x2ad8('0x24')](_0x2ad8('0x106'),_0x3436ae['id'],_0x1bec96['id'],_0x1bec96['interval'],util[_0x2ad8('0x107')](_0x57ec36,{'showHidden':![],'depth':null}),_0x3436ae['timezone']?_0x3436ae[_0x2ad8('0xff')]:_0x2ad8('0x105'));return![];});}exports[_0x2ad8('0xfd')]=function(_0x345a17,_0x48f75f,_0x1451b4){var _0x4687ec=0x0;var _0x205983=0x0;var _0x36d5ac=![];var _0x45d05b;var _0x5c427f;return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x345a17[_0x2ad8('0x54')]['id']},'include':[{'model':db[_0x2ad8('0x108')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x2ad8('0x100')],'raw':!![]}]}]})[_0x2ad8('0x36')](handleEntityNotFound(_0x48f75f,null))[_0x2ad8('0x36')](function(_0x42a360){if(_0x42a360){_0x45d05b=_0x42a360;return _0x42a360[_0x2ad8('0x109')]({'raw':!![]});}})['then'](function(_0x1bf30d){if(_0x45d05b){if(_0x1bf30d){_0x5c427f=_0x1bf30d;}}return require('../../config/license/util')['getLicense']();})[_0x2ad8('0x36')](function(_0x3a64f5){if(_0x3a64f5){_0x205983=_0x3a64f5[_0x2ad8('0x10a')];_0x36d5ac=_0x3a64f5[_0x2ad8('0x79')];}})['then'](function(){return db[_0x2ad8('0xb7')][_0x2ad8('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x2e11d7){_0x4687ec=_0x2e11d7;if(_0x205983&&_0x2e11d7>_0x205983){return db[_0x2ad8('0x10b')][_0x2ad8('0x63')]({'where':{'id':0x1}})[_0x2ad8('0x36')](function(_0x4cfc32){if(_0x4cfc32){_0x4cfc32[_0x2ad8('0x10c')](_0x2ad8('0x10d'));}});}})[_0x2ad8('0x36')](function(){if(_0x45d05b['Interval']&&_0x45d05b[_0x2ad8('0x108')][_0x2ad8('0x10e')]){var _0x5c3c55=[];for(var _0x4daee3=0x0;_0x4daee3<_0x45d05b[_0x2ad8('0x108')][_0x2ad8('0x10e')]['length'];_0x4daee3++){var _0x423517=_0x45d05b[_0x2ad8('0x108')][_0x2ad8('0x10e')][_0x4daee3][_0x2ad8('0x37')]({'plain':!![]});_0x5c3c55['push'](iftimePromise(_0x423517,_0x45d05b));}return BPromise[_0x2ad8('0x10f')](_0x5c3c55)['then'](function(_0x20402f){return _[_0x2ad8('0x110')](_0x20402f);});}else{return!![];}})[_0x2ad8('0x36')](function(_0x5beeed){var _0x50611b=fs['readFileSync'](path[_0x2ad8('0x7c')](config[_0x2ad8('0x77')],_0x2ad8('0x111')),_0x2ad8('0xd0'));var _0x10052c={'remote':_0x45d05b[_0x2ad8('0x112')],'query':querystring['stringify'](_[_0x2ad8('0x4f')](_0x45d05b[_0x2ad8('0x37')]({'plain':!![]}),{'customerIp':_0x345a17[_0x2ad8('0x88')][_0x2ad8('0xa7')]||_0x345a17[_0x2ad8('0x88')][_0x2ad8('0x113')]||_0x345a17['connection'][_0x2ad8('0x114')]||_0x345a17['ip'],'referer':_0x345a17[_0x2ad8('0x88')][_0x2ad8('0xac')],'openedInteractions':_0x4687ec,'maxInteractions':_0x205983,'virtual':_0x36d5ac[_0x2ad8('0x10a')],'online':_0x5beeed,'custom':_0x36d5ac}))[_0x2ad8('0x115')](/'/g,'\x5c\x27')};_0x48f75f[_0x2ad8('0x3d')](ejs[_0x2ad8('0xd1')](Mustache[_0x2ad8('0xd1')](_0x50611b,_0x10052c),{'proactiveActions':_0x5c427f,'alignment':_0x45d05b[_0x2ad8('0x116')],'verticalAlignment':_0x45d05b[_0x2ad8('0x117')],'div_color':_0x45d05b['color'],'text_color':_0x45d05b[_0x2ad8('0x118')],'button_color':_0x45d05b['color_button'],'background_color':_0x45d05b['backgroundColor']}));})[_0x2ad8('0x27')](handleError(_0x48f75f,null));};exports[_0x2ad8('0x119')]=function(_0x1c0b23,_0x133885,_0x30d64d){return db[_0x2ad8('0x41')]['findOne']({'where':{'id':_0x1c0b23[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x133885,null))[_0x2ad8('0x36')](function(_0x304618){if(_0x304618){return db[_0x2ad8('0xd9')]['transaction'](function(_0x77ce1f){return db[_0x2ad8('0x9b')][_0x2ad8('0x35')]({'where':{'ChatWebsiteId':_0x1c0b23[_0x2ad8('0x54')]['id']},'transaction':_0x77ce1f})[_0x2ad8('0x36')](function(_0x48b377){var _0x13c741=_[_0x2ad8('0x40')](_0x1c0b23['body'],function(_0x5ef9e2){_0x5ef9e2[_0x2ad8('0x65')]=_0x1c0b23['params']['id'];return _0x5ef9e2;});return db[_0x2ad8('0x9b')][_0x2ad8('0x11a')](_0x13c741,{'transaction':_0x77ce1f});});})[_0x2ad8('0x36')](function(){return db['ChatApplication'][_0x2ad8('0x11b')]({'where':{'ChatWebsiteId':_0x1c0b23[_0x2ad8('0x54')]['id']},'order':_0x2ad8('0x11c')});});}})[_0x2ad8('0x36')](respondWithResult(_0x133885,null))[_0x2ad8('0x27')](handleError(_0x133885,null));};exports['getApplications']=function(_0x1088c6,_0x38aa7d,_0xaf2a3c){var _0x2b0bdc={};var _0x435ee6={};var _0x238204;var _0x2bf118;return db[_0x2ad8('0x41')]['findOne']({'where':{'id':_0x1088c6[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x38aa7d,null))['then'](function(_0x412630){if(_0x412630){_0x238204=_0x412630;_0x435ee6[_0x2ad8('0x44')]=_[_0x2ad8('0x55')](db[_0x2ad8('0x9b')][_0x2ad8('0x42')]);_0x435ee6['query']=_[_0x2ad8('0x55')](_0x1088c6[_0x2ad8('0x45')]);_0x435ee6[_0x2ad8('0x4c')]=_[_0x2ad8('0x43')](_0x435ee6[_0x2ad8('0x44')],_0x435ee6['query']);_0x2b0bdc[_0x2ad8('0x46')]=_[_0x2ad8('0x43')](_0x435ee6[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x1088c6[_0x2ad8('0x45')]['fields']));_0x2b0bdc['attributes']=_0x2b0bdc[_0x2ad8('0x46')]['length']?_0x2b0bdc[_0x2ad8('0x46')]:_0x435ee6[_0x2ad8('0x44')];_0x2b0bdc[_0x2ad8('0x4b')]=qs[_0x2ad8('0x64')](_0x1088c6[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0x2b0bdc[_0x2ad8('0x50')]=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x1088c6[_0x2ad8('0x45')],_0x435ee6[_0x2ad8('0x4c')]));if(_0x1088c6[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x2b0bdc['where']=_['merge'](_0x2b0bdc[_0x2ad8('0x50')],{'$or':_[_0x2ad8('0x40')](_0x2b0bdc[_0x2ad8('0x46')],function(_0x33381b){var _0x254026={};_0x254026[_0x33381b]={'$like':'%'+_0x1088c6[_0x2ad8('0x45')]['filter']+'%'};return _0x254026;})});}_0x2b0bdc=_[_0x2ad8('0x4f')]({},_0x2b0bdc,_0x1088c6[_0x2ad8('0x51')]);return _0x238204[_0x2ad8('0x11d')](_0x2b0bdc);}})[_0x2ad8('0x36')](function(_0x12c993){if(_0x12c993){_0x2bf118=_0x12c993[_0x2ad8('0x48')];if(!_0x1088c6[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0x2b0bdc[_0x2ad8('0x2d')]=qs[_0x2ad8('0x2d')](_0x1088c6[_0x2ad8('0x45')][_0x2ad8('0x2d')]);_0x2b0bdc[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x1088c6[_0x2ad8('0x45')][_0x2ad8('0x2b')]);}return _0x238204[_0x2ad8('0x11d')](_0x2b0bdc);}})[_0x2ad8('0x36')](function(_0x2148f9){if(_0x2148f9){return _0x2148f9?{'count':_0x2bf118,'rows':_0x2148f9}:null;}})[_0x2ad8('0x36')](respondWithResult(_0x38aa7d,null))[_0x2ad8('0x27')](handleError(_0x38aa7d,null));};exports[_0x2ad8('0x11e')]=function(_0x477b3d,_0x2a7357,_0x3f7b47){return db['chatProactiveAction'][_0x2ad8('0x58')]({'where':{'id':_0x477b3d[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x2a7357,null))[_0x2ad8('0x36')](function(_0x516bcf){if(_0x516bcf){return _0x516bcf[_0x2ad8('0x11e')](_0x477b3d['body'][_0x2ad8('0x68')],_[_0x2ad8('0xf4')](_0x477b3d[_0x2ad8('0x5a')],['ids','id'])||{});}})['then'](respondWithResult(_0x2a7357,null))['catch'](handleError(_0x2a7357,null));};exports[_0x2ad8('0x109')]=function(_0x396f27,_0x1fa714,_0x5a9d2c){var _0x45293a={};var _0x4e769f={};var _0x2f0142;var _0x57b7a;return db[_0x2ad8('0x41')][_0x2ad8('0x63')]({'where':{'id':_0x396f27[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x1fa714,null))[_0x2ad8('0x36')](function(_0x405a3a){if(_0x405a3a){_0x2f0142=_0x405a3a;_0x4e769f[_0x2ad8('0x44')]=_['keys'](db[_0x2ad8('0x11f')][_0x2ad8('0x42')]);_0x4e769f[_0x2ad8('0x45')]=_[_0x2ad8('0x55')](_0x396f27[_0x2ad8('0x45')]);_0x4e769f['filters']=_[_0x2ad8('0x43')](_0x4e769f[_0x2ad8('0x44')],_0x4e769f['query']);_0x45293a[_0x2ad8('0x46')]=_[_0x2ad8('0x43')](_0x4e769f[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x396f27[_0x2ad8('0x45')][_0x2ad8('0x47')]));_0x45293a['attributes']=_0x45293a[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x45293a[_0x2ad8('0x46')]:_0x4e769f[_0x2ad8('0x44')];_0x45293a['order']=qs['sort'](_0x396f27[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0x45293a[_0x2ad8('0x50')]=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x396f27['query'],_0x4e769f[_0x2ad8('0x4c')]));if(_0x396f27[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x45293a[_0x2ad8('0x50')]=_[_0x2ad8('0x4f')](_0x45293a[_0x2ad8('0x50')],{'$or':_[_0x2ad8('0x40')](_0x45293a[_0x2ad8('0x46')],function(_0x4274da){var _0x1936fb={};_0x1936fb[_0x4274da]={'$like':'%'+_0x396f27['query'][_0x2ad8('0x4e')]+'%'};return _0x1936fb;})});}_0x45293a=_[_0x2ad8('0x4f')]({},_0x45293a,_0x396f27[_0x2ad8('0x51')]);return _0x2f0142[_0x2ad8('0x109')](_0x45293a);}})[_0x2ad8('0x36')](function(_0x31bdc6){if(_0x31bdc6){_0x57b7a=_0x31bdc6[_0x2ad8('0x48')];if(!_0x396f27[_0x2ad8('0x45')][_0x2ad8('0x49')]('nolimit')){_0x45293a[_0x2ad8('0x2d')]=qs[_0x2ad8('0x2d')](_0x396f27[_0x2ad8('0x45')]['limit']);_0x45293a[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x396f27[_0x2ad8('0x45')][_0x2ad8('0x2b')]);}return _0x2f0142[_0x2ad8('0x109')](_0x45293a);}})[_0x2ad8('0x36')](function(_0x11f96a){if(_0x11f96a){return _0x11f96a?{'count':_0x57b7a,'rows':_0x11f96a}:null;}})[_0x2ad8('0x36')](respondWithResult(_0x1fa714,null))['catch'](handleError(_0x1fa714,null));};exports[_0x2ad8('0x120')]=function(_0x1979d4,_0x1ff33c,_0x25ffd3){var _0x3b8ace=_0x1979d4[_0x2ad8('0x45')][_0x2ad8('0x121')]===_0x2ad8('0x122')?_0x2ad8('0x123'):_0x2ad8('0x124');return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'attributes':['id',_0x3b8ace],'where':{'id':_0x1979d4[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ff33c,null))[_0x2ad8('0x36')](function(_0x3eb7b6){if(_0x3eb7b6){var _0x2c3f7c=_0x3eb7b6[_0x3b8ace];var _0x37ac2c=_0x2c3f7c&&_0x2c3f7c['items']?_0x2c3f7c['items']:[];_0x1ff33c['send']({'fromKey':_[_0x2ad8('0x7a')](_0x2c3f7c[_0x2ad8('0x125')])?undefined:_0x2c3f7c['fromKey'],'count':_0x37ac2c[_0x2ad8('0x48')],'rows':_0x37ac2c});}})[_0x2ad8('0x27')](handleError(_0x1ff33c,null));};exports[_0x2ad8('0x126')]=function(_0x256a6c,_0x1eed19,_0x328e23){var _0x56d1f3={'raw':![],'where':{}};var _0x11f760={};var _0x44d1d4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2ad8('0x63')]({'where':{'id':_0x256a6c[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x1eed19,null))[_0x2ad8('0x36')](function(_0x256285){if(_0x256285){_0x11f760[_0x2ad8('0x44')]=_[_0x2ad8('0x55')](db[_0x2ad8('0x127')][_0x2ad8('0x42')]);_0x11f760['query']=_[_0x2ad8('0x55')](_0x256a6c[_0x2ad8('0x45')]);_0x11f760[_0x2ad8('0x4c')]=_[_0x2ad8('0x43')](_0x11f760[_0x2ad8('0x44')],_0x11f760[_0x2ad8('0x45')]);_0x56d1f3[_0x2ad8('0x46')]=_[_0x2ad8('0x43')](_0x11f760[_0x2ad8('0x44')],qs[_0x2ad8('0x47')](_0x256a6c[_0x2ad8('0x45')]['fields']));_0x56d1f3[_0x2ad8('0x46')]=_0x56d1f3[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0x56d1f3[_0x2ad8('0x46')]:_0x11f760[_0x2ad8('0x44')];if(!_0x256a6c[_0x2ad8('0x45')]['hasOwnProperty'](_0x2ad8('0x4a'))){_0x56d1f3['limit']=qs['limit'](_0x256a6c[_0x2ad8('0x45')][_0x2ad8('0x2d')]);_0x56d1f3[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x256a6c[_0x2ad8('0x45')][_0x2ad8('0x2b')]);}_0x56d1f3[_0x2ad8('0x4b')]=qs['sort'](_0x256a6c[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0x56d1f3['where']=qs[_0x2ad8('0x4c')](_[_0x2ad8('0x4d')](_0x256a6c[_0x2ad8('0x45')],_0x11f760[_0x2ad8('0x4c')]));_0x56d1f3[_0x2ad8('0x50')][_0x2ad8('0x65')]=_0x256285['id'];if(_0x256a6c[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0x56d1f3[_0x2ad8('0x50')]=_[_0x2ad8('0x4f')](_0x56d1f3[_0x2ad8('0x50')],{'$or':_[_0x2ad8('0x40')](_0x56d1f3[_0x2ad8('0x46')],function(_0x4378cf){var _0x2b4856={};_0x2b4856[_0x4378cf]={'$like':'%'+_0x256a6c['query'][_0x2ad8('0x4e')]+'%'};return _0x2b4856;})});}_0x56d1f3=_['merge']({},_0x56d1f3,_0x256a6c[_0x2ad8('0x51')]);return db[_0x2ad8('0x127')][_0x2ad8('0x2e')]({'where':_0x56d1f3[_0x2ad8('0x50')]})[_0x2ad8('0x36')](function(_0x2cd7d9){_0x44d1d4[_0x2ad8('0x2e')]=_0x2cd7d9;if(_0x256a6c[_0x2ad8('0x45')]['includeAll']){_0x56d1f3['include']=[{'all':!![]}];}else{_0x56d1f3[_0x2ad8('0x57')]=[{'model':db[_0x2ad8('0x8b')],'as':_0x2ad8('0xf6'),'required':![]},{'model':db[_0x2ad8('0xdb')],'as':_0x2ad8('0x128'),'required':![]}];}return db[_0x2ad8('0x127')][_0x2ad8('0x66')](_0x56d1f3);})['then'](function(_0x5ab842){_0x44d1d4[_0x2ad8('0x52')]=_0x5ab842;return _0x44d1d4;});}})['then'](respondWithFilteredResult(_0x1eed19,_0x56d1f3))[_0x2ad8('0x27')](handleError(_0x1eed19,null));};exports[_0x2ad8('0x129')]=function(_0x1baa23,_0x19f480,_0x156421){return db['ChatWebsite'][_0x2ad8('0x58')]({'where':{'id':_0x1baa23[_0x2ad8('0x54')]['id']}})['then'](handleEntityNotFound(_0x19f480,null))[_0x2ad8('0x36')](function(_0x4ebb2c){if(_0x4ebb2c){return _0x4ebb2c[_0x2ad8('0x129')](_0x1baa23[_0x2ad8('0x5a')][_0x2ad8('0x68')],_['omit'](_0x1baa23[_0x2ad8('0x5a')],['ids','id'])||{})[_0x2ad8('0xbb')](function(_0x5cb8b0){for(var _0x37013a=0x0;_0x37013a<_0x1baa23['body'][_0x2ad8('0x68')][_0x2ad8('0x48')];_0x37013a+=0x1){socket[_0x2ad8('0x12a')]('userChatWebsite:save',{'UserId':Number(_0x1baa23[_0x2ad8('0x5a')][_0x2ad8('0x68')][_0x37013a]),'ChatWebsiteId':Number(_0x1baa23['params']['id'])});}return _0x5cb8b0;});}})['then'](respondWithResult(_0x19f480,null))[_0x2ad8('0x27')](handleError(_0x19f480,null));};exports[_0x2ad8('0x12b')]=function(_0x538350,_0x2ebdf1,_0x4bf89b){return db[_0x2ad8('0x41')][_0x2ad8('0x58')]({'where':{'id':_0x538350[_0x2ad8('0x54')]['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x2ebdf1,null))['then'](function(_0x47a317){if(_0x47a317){return _0x47a317[_0x2ad8('0x12b')](_0x538350['query'][_0x2ad8('0x68')])[_0x2ad8('0x36')](function(){if(_[_0x2ad8('0x12c')](_0x538350['query']['ids'])){for(var _0x35f9e7=0x0;_0x35f9e7<_0x538350[_0x2ad8('0x45')][_0x2ad8('0x68')]['length'];_0x35f9e7+=0x1){socket[_0x2ad8('0x12a')](_0x2ad8('0x12d'),{'UserId':Number(_0x538350[_0x2ad8('0x45')][_0x2ad8('0x68')][_0x35f9e7]),'ChatWebsiteId':Number(_0x538350[_0x2ad8('0x54')]['id'])});}}else{socket['emit'](_0x2ad8('0x12d'),{'UserId':Number(_0x538350[_0x2ad8('0x45')][_0x2ad8('0x68')]),'ChatWebsiteId':Number(_0x538350['params']['id'])});}});}})[_0x2ad8('0x36')](respondWithStatusCode(_0x2ebdf1,null))[_0x2ad8('0x27')](handleError(_0x2ebdf1,null));};exports[_0x2ad8('0x12e')]=function(_0x323806,_0x9490db,_0x306448){var _0xed8f22={};var _0x359527={};var _0x4c9182;var _0xf8f44a;return db[_0x2ad8('0x41')][_0x2ad8('0x63')]({'where':{'id':_0x323806['params']['id']}})[_0x2ad8('0x36')](handleEntityNotFound(_0x9490db,null))[_0x2ad8('0x36')](function(_0x47398b){if(_0x47398b){_0x4c9182=_0x47398b;_0x359527['model']=_[_0x2ad8('0x55')](db['User'][_0x2ad8('0x42')]);_0x359527[_0x2ad8('0x45')]=_[_0x2ad8('0x55')](_0x323806[_0x2ad8('0x45')]);_0x359527[_0x2ad8('0x4c')]=_['intersection'](_0x359527[_0x2ad8('0x44')],_0x359527[_0x2ad8('0x45')]);_0xed8f22['attributes']=_['intersection'](_0x359527['model'],qs[_0x2ad8('0x47')](_0x323806[_0x2ad8('0x45')][_0x2ad8('0x47')]));_0xed8f22[_0x2ad8('0x46')]=_0xed8f22[_0x2ad8('0x46')][_0x2ad8('0x48')]?_0xed8f22['attributes']:_0x359527[_0x2ad8('0x44')];_0xed8f22[_0x2ad8('0x4b')]=qs[_0x2ad8('0x64')](_0x323806[_0x2ad8('0x45')][_0x2ad8('0x64')]);_0xed8f22[_0x2ad8('0x50')]=qs['filters'](_[_0x2ad8('0x4d')](_0x323806['query'],_0x359527[_0x2ad8('0x4c')]));if(_0x323806[_0x2ad8('0x45')][_0x2ad8('0x4e')]){_0xed8f22[_0x2ad8('0x50')]=_[_0x2ad8('0x4f')](_0xed8f22['where'],{'$or':_[_0x2ad8('0x40')](_0xed8f22[_0x2ad8('0x46')],function(_0x39721e){var _0x529774={};_0x529774[_0x39721e]={'$like':'%'+_0x323806[_0x2ad8('0x45')][_0x2ad8('0x4e')]+'%'};return _0x529774;})});}_0xed8f22=_['merge']({},_0xed8f22,_0x323806[_0x2ad8('0x51')]);return _0x4c9182['getAgents'](_0xed8f22);}})[_0x2ad8('0x36')](function(_0x58ae2e){if(_0x58ae2e){_0xf8f44a=_0x58ae2e['length'];if(!_0x323806[_0x2ad8('0x45')][_0x2ad8('0x49')](_0x2ad8('0x4a'))){_0xed8f22['limit']=qs[_0x2ad8('0x2d')](_0x323806['query'][_0x2ad8('0x2d')]);_0xed8f22[_0x2ad8('0x2b')]=qs[_0x2ad8('0x2b')](_0x323806[_0x2ad8('0x45')][_0x2ad8('0x2b')]);}return _0x4c9182[_0x2ad8('0x12e')](_0xed8f22);}})[_0x2ad8('0x36')](function(_0x2f439e){if(_0x2f439e){return _0x2f439e?{'count':_0xf8f44a,'rows':_0x2f439e}:null;}})[_0x2ad8('0x36')](respondWithResult(_0x9490db,null))[_0x2ad8('0x27')](handleError(_0x9490db,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 33ed16d..096374b 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 _0xf041=['update','emit','hook','exports','ChatWebsite','setMaxListeners','save'];(function(_0x825659,_0x4173e9){var _0x278309=function(_0x400940){while(--_0x400940){_0x825659['push'](_0x825659['shift']());}};_0x278309(++_0x4173e9);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1f04('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1f04('0x1')](0x0);var events={'afterCreate':_0x1f04('0x2'),'afterUpdate':_0x1f04('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4348a1){return function(_0x5445a0,_0x3b2d57,_0x5b3961){ChatWebsiteEvents['emit'](_0x4348a1+':'+_0x5445a0['id'],_0x5445a0);ChatWebsiteEvents[_0x1f04('0x4')](_0x4348a1,_0x5445a0);_0x5b3961(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1f04('0x5')](e,emitEvent(event));}}module[_0x1f04('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x46cb=['update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save'];(function(_0x5a6fa0,_0x5675fc){var _0x43229b=function(_0x5d6dea){while(--_0x5d6dea){_0x5a6fa0['push'](_0x5a6fa0['shift']());}};_0x43229b(++_0x5675fc);}(_0x46cb,0xd6));var _0xb46c=function(_0x11afe7,_0x2dcbae){_0x11afe7=_0x11afe7-0x0;var _0x2967b5=_0x46cb[_0x11afe7];return _0x2967b5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb46c('0x0')](0x0);var events={'afterCreate':_0xb46c('0x1'),'afterUpdate':_0xb46c('0x2'),'afterDestroy':_0xb46c('0x3')};function emitEvent(_0x409dfd){return function(_0x2aab0a,_0x2a6e97,_0x65e78a){ChatWebsiteEvents[_0xb46c('0x4')](_0x409dfd+':'+_0x2aab0a['id'],_0x2aab0a);ChatWebsiteEvents[_0xb46c('0x4')](_0x409dfd,_0x2aab0a);_0x65e78a(null);};}for(var e in events){if(events[_0xb46c('0x5')](e)){var event=events[e];ChatWebsite[_0xb46c('0x6')](e,emitEvent(event));}}module[_0xb46c('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 722c4a5..065bd91 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 _0x244c=['path','rimraf','../../config/environment','exports','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a8f30,_0x3c5a40){var _0x2869db=function(_0x184640){while(--_0x184640){_0x4a8f30['push'](_0x4a8f30['shift']());}};_0x2869db(++_0x3c5a40);}(_0x244c,0x1a9));var _0xc244=function(_0x55263a,_0x235232){_0x55263a=_0x55263a-0x0;var _0x31330e=_0x244c[_0x55263a];return _0x31330e;};'use strict';var _=require(_0xc244('0x0'));var util=require(_0xc244('0x1'));var logger=require(_0xc244('0x2'))(_0xc244('0x3'));var moment=require(_0xc244('0x4'));var BPromise=require(_0xc244('0x5'));var rp=require(_0xc244('0x6'));var fs=require('fs');var path=require(_0xc244('0x7'));var rimraf=require(_0xc244('0x8'));var config=require(_0xc244('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xc244('0xa')]=function(_0x11ac62,_0x538ec7){return _0x11ac62['define']('ChatWebsite',attributes,{'tableName':_0xc244('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f4a=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x512f04,_0x46cbb6){var _0x5a05c6=function(_0x2fb1d7){while(--_0x2fb1d7){_0x512f04['push'](_0x512f04['shift']());}};_0x5a05c6(++_0x46cbb6);}(_0x3f4a,0x1db));var _0xa3f4=function(_0x447608,_0x5a2180){_0x447608=_0x447608-0x0;var _0x204280=_0x3f4a[_0x447608];return _0x204280;};'use strict';var _=require(_0xa3f4('0x0'));var util=require('util');var logger=require(_0xa3f4('0x1'))(_0xa3f4('0x2'));var moment=require(_0xa3f4('0x3'));var BPromise=require(_0xa3f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa3f4('0x5'));var config=require(_0xa3f4('0x6'));var attributes=require(_0xa3f4('0x7'));module[_0xa3f4('0x8')]=function(_0x279726,_0x47d9b4){return _0x279726[_0xa3f4('0x9')](_0xa3f4('0xa'),attributes,{'tableName':_0xa3f4('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 24fd355..5072ff6 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 _0xe73e=['http','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise'];(function(_0x309e74,_0x393d8a){var _0x499650=function(_0x1d5d96){while(--_0x1d5d96){_0x309e74['push'](_0x309e74['shift']());}};_0x499650(++_0x393d8a);}(_0xe73e,0x84));var _0xee73=function(_0xe934ed,_0x4434eb){_0xe934ed=_0xe934ed-0x0;var _0x292523=_0xe73e[_0xe934ed];return _0x292523;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee73('0x0'));var BPromise=require(_0xee73('0x1'));var rs=require(_0xee73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee73('0x3'));var logger=require(_0xee73('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee73('0x5'));var client=jayson['client'][_0xee73('0x6')]({'port':0x232a});config['redis']=_[_0xee73('0x7')](config[_0xee73('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xee73('0x9'))(new Redis(config[_0xee73('0x8')]));require(_0xee73('0xa'))[_0xee73('0xb')](socket);function respondWithRpcPromise(_0x2610c7,_0x2030a1,_0x18b63b){return new BPromise(function(_0x8ccf2e,_0x3a64cc){return client['request'](_0x2610c7,_0x18b63b)[_0xee73('0xc')](function(_0x11cd94){logger[_0xee73('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x2030a1,'request\x20sent');logger['debug'](_0xee73('0xe'),_0x2030a1,_0xee73('0xf'),JSON[_0xee73('0x10')](_0x11cd94));if(_0x11cd94[_0xee73('0x11')]){if(_0x11cd94[_0xee73('0x11')][_0xee73('0x12')]===0x1f4){logger[_0xee73('0x11')](_0xee73('0x13'),_0x2030a1,_0x11cd94[_0xee73('0x11')]['message']);return _0x3a64cc(_0x11cd94[_0xee73('0x11')][_0xee73('0x14')]);}logger[_0xee73('0x11')](_0xee73('0x13'),_0x2030a1,_0x11cd94['error']['message']);return _0x8ccf2e(_0x11cd94[_0xee73('0x11')][_0xee73('0x14')]);}else{logger[_0xee73('0xd')](_0xee73('0x13'),_0x2030a1,_0xee73('0xf'));_0x8ccf2e(_0x11cd94[_0xee73('0x15')][_0xee73('0x14')]);}})[_0xee73('0x16')](function(_0x5ede12){logger[_0xee73('0x11')](_0xee73('0x13'),_0x2030a1,_0x5ede12);_0x3a64cc(_0x5ede12);});});} \ No newline at end of file +var _0x27e7=['rpc','../../config/environment','client','redis','socket.io-emitter','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x586785,_0xcc58db){var _0x467e96=function(_0x44c899){while(--_0x44c899){_0x586785['push'](_0x586785['shift']());}};_0x467e96(++_0xcc58db);}(_0x27e7,0x13d));var _0x727e=function(_0x4afd9e,_0x4656ed){_0x4afd9e=_0x4afd9e-0x0;var _0xee23bd=_0x27e7[_0x4afd9e];return _0xee23bd;};'use strict';var _=require(_0x727e('0x0'));var util=require(_0x727e('0x1'));var moment=require(_0x727e('0x2'));var BPromise=require(_0x727e('0x3'));var rs=require(_0x727e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x727e('0x5'))['db'];var utils=require(_0x727e('0x6'));var logger=require(_0x727e('0x7'))(_0x727e('0x8'));var config=require(_0x727e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x727e('0xa')]['http']({'port':0x232a});config[_0x727e('0xb')]=_['defaults'](config[_0x727e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x727e('0xc'))(new Redis(config[_0x727e('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x325c96,_0xe2dbe0,_0x3433ca){return new BPromise(function(_0x330390,_0x2eb223){return client[_0x727e('0xd')](_0x325c96,_0x3433ca)[_0x727e('0xe')](function(_0x3d815b){logger[_0x727e('0xf')](_0x727e('0x10'),_0xe2dbe0,_0x727e('0x11'));logger[_0x727e('0x12')](_0x727e('0x13'),_0xe2dbe0,'request\x20sent',JSON[_0x727e('0x14')](_0x3d815b));if(_0x3d815b[_0x727e('0x15')]){if(_0x3d815b[_0x727e('0x15')][_0x727e('0x16')]===0x1f4){logger[_0x727e('0x15')](_0x727e('0x10'),_0xe2dbe0,_0x3d815b[_0x727e('0x15')][_0x727e('0x17')]);return _0x2eb223(_0x3d815b['error'][_0x727e('0x17')]);}logger['error'](_0x727e('0x10'),_0xe2dbe0,_0x3d815b['error'][_0x727e('0x17')]);return _0x330390(_0x3d815b[_0x727e('0x15')][_0x727e('0x17')]);}else{logger[_0x727e('0xf')](_0x727e('0x10'),_0xe2dbe0,_0x727e('0x11'));_0x330390(_0x3d815b[_0x727e('0x18')][_0x727e('0x17')]);}})['catch'](function(_0x3a3bc7){logger['error'](_0x727e('0x10'),_0xe2dbe0,_0x3a3bc7);_0x2eb223(_0x3a3bc7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7233eea..eb28de0 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 _0x4023=['remove','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x37f93e,_0x2d0c95){var _0x2c6c4f=function(_0x5518c9){while(--_0x5518c9){_0x37f93e['push'](_0x37f93e['shift']());}};_0x2c6c4f(++_0x2d0c95);}(_0x4023,0x16a));var _0x3402=function(_0x354de8,_0x2b857){_0x354de8=_0x354de8-0x0;var _0x337f50=_0x4023[_0x354de8];return _0x337f50;};'use strict';var ChatWebsiteEvents=require(_0x3402('0x0'));var events=[_0x3402('0x1'),_0x3402('0x2'),'update'];function createListener(_0x28f220,_0x3f9bc2){return function(_0x11c26b){_0x3f9bc2[_0x3402('0x3')](_0x28f220,_0x11c26b);};}function removeListener(_0x27fe2b,_0x538d64){return function(){ChatWebsiteEvents[_0x3402('0x4')](_0x27fe2b,_0x538d64);};}exports['register']=function(_0x2a60d5){for(var _0x349361=0x0,_0x80bec2=events[_0x3402('0x5')];_0x349361<_0x80bec2;_0x349361++){var _0xfa59eb=events[_0x349361];var _0x368a50=createListener(_0x3402('0x6')+_0xfa59eb,_0x2a60d5);ChatWebsiteEvents['on'](_0xfa59eb,_0x368a50);}}; \ No newline at end of file +var _0x02ed=['update','removeListener','./chatWebsite.events','save','remove'];(function(_0x24ba77,_0x78b442){var _0x283705=function(_0x2fb15a){while(--_0x2fb15a){_0x24ba77['push'](_0x24ba77['shift']());}};_0x283705(++_0x78b442);}(_0x02ed,0xf7));var _0xd02e=function(_0x24b63c,_0x2e0bad){_0x24b63c=_0x24b63c-0x0;var _0x28ad88=_0x02ed[_0x24b63c];return _0x28ad88;};'use strict';var ChatWebsiteEvents=require(_0xd02e('0x0'));var events=[_0xd02e('0x1'),_0xd02e('0x2'),_0xd02e('0x3')];function createListener(_0x57153d,_0x41d35e){return function(_0x418f8b){_0x41d35e['emit'](_0x57153d,_0x418f8b);};}function removeListener(_0x4f18e8,_0x233dad){return function(){ChatWebsiteEvents[_0xd02e('0x4')](_0x4f18e8,_0x233dad);};}exports['register']=function(_0x2ec1d7){for(var _0x247f8f=0x0,_0x455d31=events['length'];_0x247f8f<_0x455d31;_0x247f8f++){var _0x2df852=events[_0x247f8f];var _0x2ed033=createListener('chatWebsite:'+_0x2df852,_0x2ec1d7);ChatWebsiteEvents['on'](_0x2df852,_0x2ed033);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2306871..9dbf888 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 _0xe401=['format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','offline','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','/:id','show','isAuthenticated','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','join','root'];(function(_0x3ea501,_0x56b5e0){var _0xdbfd46=function(_0x14be9b){while(--_0x14be9b){_0x3ea501['push'](_0x3ea501['shift']());}};_0xdbfd46(++_0x56b5e0);}(_0xe401,0x142));var _0x1e40=function(_0x5e4b35,_0x4d0efd){_0x5e4b35=_0x5e4b35-0x0;var _0x220bde=_0xe401[_0x5e4b35];return _0x220bde;};'use strict';var multer=require(_0x1e40('0x0'));var util=require(_0x1e40('0x1'));var path=require(_0x1e40('0x2'));var timeout=require(_0x1e40('0x3'));var express=require(_0x1e40('0x4'));var router=express[_0x1e40('0x5')]();var fs_extra=require(_0x1e40('0x6'));var auth=require(_0x1e40('0x7'));var interaction=require(_0x1e40('0x8'));var config=require(_0x1e40('0x9'));var controller=require(_0x1e40('0xa'));router[_0x1e40('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e40('0xc')]);router[_0x1e40('0xb')](_0x1e40('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x1e40('0xb')](_0x1e40('0xe'),auth['isAuthenticated'](),controller[_0x1e40('0xf')]);router[_0x1e40('0xb')]('/:id/dispositions',auth[_0x1e40('0x10')](),controller['getDispositions']);router[_0x1e40('0xb')]('/:id/canned_answers',auth[_0x1e40('0x10')](),controller[_0x1e40('0x11')]);router['get'](_0x1e40('0x12'),controller[_0x1e40('0x13')]);router[_0x1e40('0xb')](_0x1e40('0x14'),controller[_0x1e40('0x15')]);router[_0x1e40('0xb')](_0x1e40('0x16'),controller[_0x1e40('0x17')]);router[_0x1e40('0xb')]('/:id/system_avatar',controller[_0x1e40('0x18')]);router[_0x1e40('0xb')](_0x1e40('0x19'),auth[_0x1e40('0x10')](),controller['getInteractions']);router[_0x1e40('0xb')](_0x1e40('0x1a'),controller[_0x1e40('0x1b')]);router[_0x1e40('0xb')](_0x1e40('0x1c'),auth[_0x1e40('0x10')](),controller['getApplications']);router[_0x1e40('0xb')](_0x1e40('0x1d'),auth[_0x1e40('0x10')](),controller[_0x1e40('0x1e')]);router['get'](_0x1e40('0x1f'),controller[_0x1e40('0x20')]);router[_0x1e40('0xb')](_0x1e40('0x21'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x1e40('0xb')](_0x1e40('0x22'),auth[_0x1e40('0x10')](),controller['getAgents']);router[_0x1e40('0x23')]('/',auth[_0x1e40('0x10')](),controller[_0x1e40('0x24')]);router[_0x1e40('0x23')](_0x1e40('0x25'),auth['isAuthenticated'](),controller[_0x1e40('0x26')]);router['post'](_0x1e40('0x27'),auth[_0x1e40('0x10')](),controller[_0x1e40('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4372e5,_0x1634e7,_0x14b545){_0x14b545(null,path[_0x1e40('0x29')](config[_0x1e40('0x2a')],'server/files/images/logos/'));},'filename':function(_0xd6de30,_0x26b787,_0x24daff){_0x24daff(null,util[_0x1e40('0x2b')]('%s-%s',Date[_0x1e40('0x2c')](),_0x26b787[_0x1e40('0x2d')]));}})});router[_0x1e40('0x23')](_0x1e40('0x12'),upload[_0x1e40('0x2e')](_0x1e40('0x2f')),controller[_0x1e40('0x30')]);var upload=multer({'storage':multer[_0x1e40('0x31')]({'destination':function(_0x1c1e52,_0x8e2f51,_0x4dcdcd){_0x4dcdcd(null,path[_0x1e40('0x29')](config[_0x1e40('0x2a')],_0x1e40('0x32')));},'filename':function(_0x117d10,_0x329549,_0x335564){_0x335564(null,util[_0x1e40('0x2b')](_0x1e40('0x33'),Date[_0x1e40('0x2c')](),_0x329549['originalname']));}})});router[_0x1e40('0x23')](_0x1e40('0x14'),upload[_0x1e40('0x2e')](_0x1e40('0x2f')),controller[_0x1e40('0x34')]);var upload=multer({'storage':multer[_0x1e40('0x31')]({'destination':function(_0x2244d1,_0x74a19f,_0x42159d){_0x42159d(null,path['join'](config[_0x1e40('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x5ab1aa,_0x292add,_0x5ef495){_0x5ef495(null,util[_0x1e40('0x2b')](_0x1e40('0x33'),Date[_0x1e40('0x2c')](),_0x292add[_0x1e40('0x2d')]));}})});router['post'](_0x1e40('0x16'),upload[_0x1e40('0x2e')](_0x1e40('0x2f')),controller[_0x1e40('0x35')]);var upload=multer({'storage':multer[_0x1e40('0x31')]({'destination':function(_0x40aaf1,_0x1bbe1a,_0xb183aa){_0xb183aa(null,path[_0x1e40('0x29')](config['root'],_0x1e40('0x32')));},'filename':function(_0x5ab47e,_0x4ebc91,_0x5a600e){_0x5a600e(null,util[_0x1e40('0x2b')](_0x1e40('0x33'),Date[_0x1e40('0x2c')](),_0x4ebc91[_0x1e40('0x2d')]));}})});router['post'](_0x1e40('0x36'),upload[_0x1e40('0x2e')]('file'),controller['addSystemAvatar']);router['post'](_0x1e40('0x37'),controller[_0x1e40('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x1e40('0x31')]({'destination':function(_0x26a0d0,_0x40c453,_0xacf29d){const _0x21247b=path[_0x1e40('0x29')](config[_0x1e40('0x2a')],_0x1e40('0x39'),_0x1e40('0x3a'),'offline-chat');fs_extra[_0x1e40('0x3b')](_0x21247b,function(){_0xacf29d(null,_0x21247b);});},'filename':function(_0x505a9f,_0x1d59df,_0x166512){const _0x46053b=_0x1d59df[_0x1e40('0x2d')][_0x1e40('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x481701=path[_0x1e40('0x3d')](_0x46053b);const _0x3f5b35=Date['now']()+'-'+_0x46053b[_0x1e40('0x3c')](_0x481701,'')+_0x481701;_0x166512(null,_0x3f5b35);}})});router[_0x1e40('0x23')]('/:id/offline',offlineUploadMulter[_0x1e40('0x3e')](),controller[_0x1e40('0x3f')]);router[_0x1e40('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x1e40('0x23')](_0x1e40('0x1c'),auth[_0x1e40('0x10')](),controller[_0x1e40('0x40')]);router[_0x1e40('0x23')](_0x1e40('0x1d'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x1e40('0x23')](_0x1e40('0x22'),auth['isAuthenticated'](),controller[_0x1e40('0x41')]);router[_0x1e40('0x42')]('/:id',auth[_0x1e40('0x10')](),controller[_0x1e40('0x43')]);router[_0x1e40('0x44')](_0x1e40('0xe'),auth[_0x1e40('0x10')](),controller[_0x1e40('0x45')]);router[_0x1e40('0x44')](_0x1e40('0x25'),auth['isAuthenticated'](),controller[_0x1e40('0x46')]);router[_0x1e40('0x44')](_0x1e40('0x27'),auth[_0x1e40('0x10')](),controller['removeAnswers']);router['delete'](_0x1e40('0x22'),auth[_0x1e40('0x10')](),controller[_0x1e40('0x47')]);module[_0x1e40('0x48')]=router; \ No newline at end of file +var _0x31ae=['getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','format','now','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','replace','extname','/:id/offline','any','addInteraction','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','index','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x31ae,0x107));var _0xe31a=function(_0xc8a337,_0x52062b){_0xc8a337=_0xc8a337-0x0;var _0x4d3d9b=_0x31ae[_0xc8a337];return _0x4d3d9b;};'use strict';var multer=require('multer');var util=require(_0xe31a('0x0'));var path=require(_0xe31a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe31a('0x2')]();var fs_extra=require(_0xe31a('0x3'));var auth=require(_0xe31a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe31a('0x5'));var controller=require(_0xe31a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe31a('0x7')]);router[_0xe31a('0x8')](_0xe31a('0x9'),auth[_0xe31a('0xa')](),controller[_0xe31a('0xb')]);router['get']('/:id',auth[_0xe31a('0xa')](),controller[_0xe31a('0xc')]);router['get'](_0xe31a('0xd'),auth[_0xe31a('0xa')](),controller[_0xe31a('0xe')]);router['get'](_0xe31a('0xf'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x10')]);router[_0xe31a('0x8')](_0xe31a('0x11'),controller[_0xe31a('0x12')]);router[_0xe31a('0x8')](_0xe31a('0x13'),controller[_0xe31a('0x14')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xe31a('0x8')]('/:id/system_avatar',controller[_0xe31a('0x15')]);router[_0xe31a('0x8')](_0xe31a('0x16'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x17')]);router[_0xe31a('0x8')](_0xe31a('0x18'),controller['getSnippet']);router['get'](_0xe31a('0x19'),auth['isAuthenticated'](),controller[_0xe31a('0x1a')]);router[_0xe31a('0x8')](_0xe31a('0x1b'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x1c')]);router[_0xe31a('0x8')](_0xe31a('0x1d'),controller[_0xe31a('0x1e')]);router[_0xe31a('0x8')](_0xe31a('0x1f'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0xe31a('0x20'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x21')]);router[_0xe31a('0x22')]('/',auth['isAuthenticated'](),controller[_0xe31a('0x23')]);router[_0xe31a('0x22')]('/:id/dispositions',auth[_0xe31a('0xa')](),controller[_0xe31a('0x24')]);router[_0xe31a('0x22')](_0xe31a('0xf'),auth['isAuthenticated'](),controller[_0xe31a('0x25')]);var upload=multer({'storage':multer[_0xe31a('0x26')]({'destination':function(_0xd0770d,_0x10dfe4,_0x4d8fb5){_0x4d8fb5(null,path[_0xe31a('0x27')](config[_0xe31a('0x28')],_0xe31a('0x29')));},'filename':function(_0x1b7a35,_0x49a970,_0x11e298){_0x11e298(null,util['format'](_0xe31a('0x2a'),Date['now'](),_0x49a970[_0xe31a('0x2b')]));}})});router[_0xe31a('0x22')]('/:id/logo',upload[_0xe31a('0x2c')](_0xe31a('0x2d')),controller[_0xe31a('0x2e')]);var upload=multer({'storage':multer[_0xe31a('0x26')]({'destination':function(_0x4965c6,_0x310344,_0x2021b9){_0x2021b9(null,path[_0xe31a('0x27')](config[_0xe31a('0x28')],_0xe31a('0x2f')));},'filename':function(_0x3a4e34,_0x1f46df,_0x24ee32){_0x24ee32(null,util[_0xe31a('0x30')](_0xe31a('0x2a'),Date['now'](),_0x1f46df['originalname']));}})});router[_0xe31a('0x22')](_0xe31a('0x13'),upload[_0xe31a('0x2c')](_0xe31a('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xe31a('0x26')]({'destination':function(_0x338367,_0x11a2d4,_0x57e47e){_0x57e47e(null,path[_0xe31a('0x27')](config[_0xe31a('0x28')],_0xe31a('0x2f')));},'filename':function(_0x42b1ec,_0x263147,_0xb77af1){_0xb77af1(null,util['format'](_0xe31a('0x2a'),Date[_0xe31a('0x31')](),_0x263147[_0xe31a('0x2b')]));}})});router[_0xe31a('0x22')](_0xe31a('0x32'),upload[_0xe31a('0x2c')](_0xe31a('0x2d')),controller[_0xe31a('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43d24e,_0x5ea03a,_0x5e6faf){_0x5e6faf(null,path[_0xe31a('0x27')](config[_0xe31a('0x28')],_0xe31a('0x2f')));},'filename':function(_0xc19978,_0x29b70e,_0x4d5167){_0x4d5167(null,util[_0xe31a('0x30')](_0xe31a('0x2a'),Date[_0xe31a('0x31')](),_0x29b70e[_0xe31a('0x2b')]));}})});router[_0xe31a('0x22')]('/:id/system_avatar',upload[_0xe31a('0x2c')]('file'),controller[_0xe31a('0x34')]);router[_0xe31a('0x22')]('/:id/notify',controller[_0xe31a('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xe31a('0x26')]({'destination':function(_0x387227,_0x4cb83,_0x1eff98){const _0x50668b=path[_0xe31a('0x27')](config[_0xe31a('0x28')],_0xe31a('0x36'),'attachments',_0xe31a('0x37'));fs_extra['ensureDir'](_0x50668b,function(){_0x1eff98(null,_0x50668b);});},'filename':function(_0x17d493,_0x547f1c,_0x209193){const _0x3d77f8=_0x547f1c[_0xe31a('0x2b')][_0xe31a('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51507e=path[_0xe31a('0x39')](_0x3d77f8);const _0x2b5b97=Date[_0xe31a('0x31')]()+'-'+_0x3d77f8['replace'](_0x51507e,'')+_0x51507e;_0x209193(null,_0x2b5b97);}})});router[_0xe31a('0x22')](_0xe31a('0x3a'),offlineUploadMulter[_0xe31a('0x3b')](),controller['offline']);router[_0xe31a('0x22')](_0xe31a('0x16'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x3c')]);router[_0xe31a('0x22')](_0xe31a('0x19'),auth[_0xe31a('0xa')](),controller['addApplications']);router[_0xe31a('0x22')](_0xe31a('0x1b'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x3d')]);router[_0xe31a('0x22')](_0xe31a('0x20'),auth[_0xe31a('0xa')](),controller['addAgents']);router[_0xe31a('0x3e')](_0xe31a('0x3f'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x40')]);router[_0xe31a('0x41')](_0xe31a('0x3f'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x42')]);router[_0xe31a('0x41')](_0xe31a('0xd'),auth[_0xe31a('0xa')](),controller[_0xe31a('0x43')]);router[_0xe31a('0x41')]('/:id/canned_answers',auth[_0xe31a('0xa')](),controller[_0xe31a('0x44')]);router[_0xe31a('0x41')](_0xe31a('0x20'),auth['isAuthenticated'](),controller[_0xe31a('0x45')]);module[_0xe31a('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dcd03b9..5ee701c 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 _0x1c23=['Google','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0xb3f72c,_0x55ab4e){var _0x23501e=function(_0x4065e6){while(--_0x4065e6){_0xb3f72c['push'](_0xb3f72c['shift']());}};_0x23501e(++_0x55ab4e);}(_0x1c23,0x1d5));var _0x31c2=function(_0x1f6255,_0x4f72c6){_0x1f6255=_0x1f6255-0x0;var _0x15f694=_0x1c23[_0x1f6255];return _0x15f694;};'use strict';var Sequelize=require(_0x31c2('0x0'));module[_0x31c2('0x1')]={'name':{'type':Sequelize[_0x31c2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x31c2('0x3')](_0x31c2('0x4'),_0x31c2('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x31c2('0x2')]}}; \ No newline at end of file +var _0xb182=['ENUM','exports','STRING'];(function(_0x2386fd,_0x4805c7){var _0x3874aa=function(_0x4b037b){while(--_0x4b037b){_0x2386fd['push'](_0x2386fd['shift']());}};_0x3874aa(++_0x4805c7);}(_0xb182,0x121));var _0x2b18=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xb182[_0x39e283];return _0x7de89f;};'use strict';var Sequelize=require('sequelize');module[_0x2b18('0x0')]={'name':{'type':Sequelize[_0x2b18('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2b18('0x2')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2b18('0x1')]},'data2':{'type':Sequelize[_0x2b18('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index d54294d..352fbd9 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x507cea,_0xaf5f4c){var _0x3dbe24=function(_0x41c646){while(--_0x41c646){_0x507cea['push'](_0x507cea['shift']());}};_0x3dbe24(++_0xaf5f4c);}(_0xdb28,0x106));var _0x8db2=function(_0x567cf9,_0x383e28){_0x567cf9=_0x567cf9-0x0;var _0x38a8f0=_0xdb28[_0x567cf9];return _0x38a8f0;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x1829c7,_0x34b9e0){var _0x2a76b6=function(_0x29cd21){while(--_0x29cd21){_0x1829c7['push'](_0x1829c7['shift']());}};_0x2a76b6(++_0x34b9e0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x0b0e[_0x3d8ba1];return _0x87804e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 6c7411c..d513310 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 _0xf2ce=['api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util'];(function(_0x84864,_0x22be90){var _0x3fd48d=function(_0x48fd0c){while(--_0x48fd0c){_0x84864['push'](_0x84864['shift']());}};_0x3fd48d(++_0x22be90);}(_0xf2ce,0x17e));var _0xef2c=function(_0x18164a,_0x57ecd1){_0x18164a=_0x18164a-0x0;var _0x16de85=_0xf2ce[_0x18164a];return _0x16de85;};'use strict';var _=require(_0xef2c('0x0'));var util=require(_0xef2c('0x1'));var logger=require('../../config/logger')(_0xef2c('0x2'));var moment=require(_0xef2c('0x3'));var BPromise=require(_0xef2c('0x4'));var rp=require(_0xef2c('0x5'));var fs=require('fs');var path=require(_0xef2c('0x6'));var rimraf=require('rimraf');var config=require(_0xef2c('0x7'));var attributes=require(_0xef2c('0x8'));module[_0xef2c('0x9')]=function(_0xb3204b,_0x49f09d){return _0xb3204b['define'](_0xef2c('0xa'),attributes,{'tableName':_0xef2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf692=['moment','request-promise','path','rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x1e0e7c,_0x297584){var _0x4fb91d=function(_0x24493a){while(--_0x24493a){_0x1e0e7c['push'](_0x1e0e7c['shift']());}};_0x4fb91d(++_0x297584);}(_0xf692,0x173));var _0x2f69=function(_0x50a954,_0x4161e6){_0x50a954=_0x50a954-0x0;var _0x1db1be=_0xf692[_0x50a954];return _0x1db1be;};'use strict';var _=require(_0x2f69('0x0'));var util=require(_0x2f69('0x1'));var logger=require(_0x2f69('0x2'))('api');var moment=require(_0x2f69('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f69('0x4'));var fs=require('fs');var path=require(_0x2f69('0x5'));var rimraf=require(_0x2f69('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f69('0x7'));module['exports']=function(_0x5bd5c8,_0x521bd5){return _0x5bd5c8[_0x2f69('0x8')](_0x2f69('0x9'),attributes,{'tableName':_0x2f69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 28a0cfa..aeb6ff3 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 _0x8a9a=['rpc','../../config/environment','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2ccbf4,_0x3d3d2f){var _0x2841af=function(_0xb48df8){while(--_0xb48df8){_0x2ccbf4['push'](_0x2ccbf4['shift']());}};_0x2841af(++_0x3d3d2f);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x8a9a[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a2bc,_0x4a091d,_0x1b4873){return new BPromise(function(_0x129e9f,_0x1477b0){return client[_0xa8a9('0xc')](_0x24a2bc,_0x1b4873)[_0xa8a9('0xd')](function(_0x4ebe24){logger[_0xa8a9('0xe')](_0xa8a9('0xf'),_0x4a091d,'request\x20sent');logger[_0xa8a9('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'),JSON[_0xa8a9('0x12')](_0x4ebe24));if(_0x4ebe24['error']){if(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x14')]===0x1f4){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);return _0x1477b0(_0x4ebe24['error'][_0xa8a9('0x15')]);}logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24['error']['message']);return _0x129e9f(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);}else{logger[_0xa8a9('0xe')]('CloudProvider,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'));_0x129e9f(_0x4ebe24[_0xa8a9('0x16')]['message']);}})['catch'](function(_0x1039c9){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x1039c9);_0x1477b0(_0x1039c9);});});} \ No newline at end of file +var _0x084b=['message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2a3943,_0x4f4589){var _0x2ec19c=function(_0x399b05){while(--_0x399b05){_0x2a3943['push'](_0x2a3943['shift']());}};_0x2ec19c(++_0x4f4589);}(_0x084b,0xd5));var _0xb084=function(_0x510d77,_0x2fac0b){_0x510d77=_0x510d77-0x0;var _0x1d2f01=_0x084b[_0x510d77];return _0x1d2f01;};'use strict';var _=require(_0xb084('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb084('0x1'));var fs=require('fs');var Redis=require(_0xb084('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb084('0x3'));var logger=require(_0xb084('0x4'))(_0xb084('0x5'));var config=require('../../config/environment');var jayson=require(_0xb084('0x6'));var client=jayson['client'][_0xb084('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x449c7a,_0x275c8c,_0x4b69ad){return new BPromise(function(_0x4f45d2,_0x18a300){return client[_0xb084('0x8')](_0x449c7a,_0x4b69ad)[_0xb084('0x9')](function(_0xec1e0d){logger[_0xb084('0xa')](_0xb084('0xb'),_0x275c8c,_0xb084('0xc'));logger[_0xb084('0xd')](_0xb084('0xe'),_0x275c8c,_0xb084('0xc'),JSON[_0xb084('0xf')](_0xec1e0d));if(_0xec1e0d[_0xb084('0x10')]){if(_0xec1e0d[_0xb084('0x10')][_0xb084('0x11')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x275c8c,_0xec1e0d[_0xb084('0x10')]['message']);return _0x18a300(_0xec1e0d['error'][_0xb084('0x12')]);}logger[_0xb084('0x10')]('CloudProvider,\x20%s,\x20%s',_0x275c8c,_0xec1e0d['error'][_0xb084('0x12')]);return _0x4f45d2(_0xec1e0d[_0xb084('0x10')][_0xb084('0x12')]);}else{logger[_0xb084('0xa')](_0xb084('0xb'),_0x275c8c,'request\x20sent');_0x4f45d2(_0xec1e0d[_0xb084('0x13')][_0xb084('0x12')]);}})[_0xb084('0x14')](function(_0xbcdb1f){logger[_0xb084('0x10')](_0xb084('0xb'),_0x275c8c,_0xbcdb1f);_0x18a300(_0xbcdb1f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index d197a17..de19de3 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 _0x1798=['show','post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x572246,_0x31c860){var _0x53ff43=function(_0x386a78){while(--_0x386a78){_0x572246['push'](_0x572246['shift']());}};_0x53ff43(++_0x31c860);}(_0x1798,0xa7));var _0x8179=function(_0x5331de,_0xa9db37){_0x5331de=_0x5331de-0x0;var _0x388553=_0x1798[_0x5331de];return _0x388553;};'use strict';var multer=require(_0x8179('0x0'));var util=require(_0x8179('0x1'));var path=require(_0x8179('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8179('0x3')]();var fs_extra=require(_0x8179('0x4'));var auth=require(_0x8179('0x5'));var interaction=require(_0x8179('0x6'));var config=require(_0x8179('0x7'));var controller=require(_0x8179('0x8'));router[_0x8179('0x9')]('/',auth[_0x8179('0xa')](),controller[_0x8179('0xb')]);router[_0x8179('0x9')](_0x8179('0xc'),auth[_0x8179('0xa')](),controller[_0x8179('0xd')]);router[_0x8179('0xe')]('/',auth[_0x8179('0xa')](),controller[_0x8179('0xf')]);router[_0x8179('0x10')](_0x8179('0xc'),auth[_0x8179('0xa')](),controller[_0x8179('0x11')]);router['delete'](_0x8179('0xc'),auth['isAuthenticated'](),controller[_0x8179('0x12')]);module[_0x8179('0x13')]=router; \ No newline at end of file +var _0x3a15=['create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post'];(function(_0x4cd441,_0x5bd834){var _0x237210=function(_0x4dd63a){while(--_0x4dd63a){_0x4cd441['push'](_0x4cd441['shift']());}};_0x237210(++_0x5bd834);}(_0x3a15,0xba));var _0x53a1=function(_0x50a40f,_0x348dd1){_0x50a40f=_0x50a40f-0x0;var _0x256146=_0x3a15[_0x50a40f];return _0x256146;};'use strict';var multer=require(_0x53a1('0x0'));var util=require(_0x53a1('0x1'));var path=require(_0x53a1('0x2'));var timeout=require(_0x53a1('0x3'));var express=require(_0x53a1('0x4'));var router=express['Router']();var fs_extra=require(_0x53a1('0x5'));var auth=require(_0x53a1('0x6'));var interaction=require(_0x53a1('0x7'));var config=require(_0x53a1('0x8'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x53a1('0x9')](),controller[_0x53a1('0xa')]);router[_0x53a1('0xb')]('/:id',auth[_0x53a1('0x9')](),controller[_0x53a1('0xc')]);router[_0x53a1('0xd')]('/',auth[_0x53a1('0x9')](),controller[_0x53a1('0xe')]);router[_0x53a1('0xf')](_0x53a1('0x10'),auth['isAuthenticated'](),controller[_0x53a1('0x11')]);router['delete']('/:id',auth[_0x53a1('0x9')](),controller[_0x53a1('0x12')]);module[_0x53a1('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 13fb110..828b91a 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 _0xd0b2=['STRING','name','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0b2,0x96));var _0x2d0b=function(_0x1432ca,_0x52c1eb){_0x1432ca=_0x1432ca-0x0;var _0x2cdb8b=_0xd0b2[_0x1432ca];return _0x2cdb8b;};'use strict';var Sequelize=require(_0x2d0b('0x0'));module[_0x2d0b('0x1')]={'name':{'type':Sequelize[_0x2d0b('0x2')],'unique':_0x2d0b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2d0b('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2d0b('0x2')]},'fax':{'type':Sequelize[_0x2d0b('0x2')]},'type':{'type':Sequelize[_0x2d0b('0x2')]},'street':{'type':Sequelize[_0x2d0b('0x2')]},'postalCode':{'type':Sequelize[_0x2d0b('0x2')]},'city':{'type':Sequelize[_0x2d0b('0x2')]},'country':{'type':Sequelize[_0x2d0b('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2d0b('0x2')]},'sPostalCode':{'type':Sequelize[_0x2d0b('0x2')]},'sCity':{'type':Sequelize[_0x2d0b('0x2')]},'sCountry':{'type':Sequelize[_0x2d0b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac22=['exports','STRING','name'];(function(_0x3504a0,_0x3f770f){var _0x3dfca3=function(_0x5adf34){while(--_0x5adf34){_0x3504a0['push'](_0x3504a0['shift']());}};_0x3dfca3(++_0x3f770f);}(_0xac22,0x138));var _0x2ac2=function(_0x20f49d,_0x49a49b){_0x20f49d=_0x20f49d-0x0;var _0x1a5dcb=_0xac22[_0x20f49d];return _0x1a5dcb;};'use strict';var Sequelize=require('sequelize');module[_0x2ac2('0x0')]={'name':{'type':Sequelize[_0x2ac2('0x1')],'unique':_0x2ac2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2ac2('0x1')]},'companyId':{'type':Sequelize[_0x2ac2('0x1')]},'website':{'type':Sequelize[_0x2ac2('0x1')]},'phone':{'type':Sequelize[_0x2ac2('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2ac2('0x1')]},'street':{'type':Sequelize[_0x2ac2('0x1')]},'postalCode':{'type':Sequelize[_0x2ac2('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2ac2('0x1')]},'email':{'type':Sequelize[_0x2ac2('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2ac2('0x1')]},'sPostalCode':{'type':Sequelize[_0x2ac2('0x1')]},'sCity':{'type':Sequelize[_0x2ac2('0x1')]},'sCountry':{'type':Sequelize[_0x2ac2('0x1')]},'description':{'type':Sequelize[_0x2ac2('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f6021a6..dfb24dc 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 _0x093f=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId'];(function(_0x45ab8e,_0x3a42f0){var _0x2ea076=function(_0x528edd){while(--_0x528edd){_0x45ab8e['push'](_0x45ab8e['shift']());}};_0x2ea076(++_0x3a42f0);}(_0x093f,0x16e));var _0xf093=function(_0xaa976,_0x2d271b){_0xaa976=_0xaa976-0x0;var _0x27c7d4=_0x093f[_0xaa976];return _0x27c7d4;};'use strict';var emlformat=require(_0xf093('0x0'));var rimraf=require(_0xf093('0x1'));var zipdir=require(_0xf093('0x2'));var jsonpatch=require(_0xf093('0x3'));var rp=require(_0xf093('0x4'));var moment=require('moment');var BPromise=require(_0xf093('0x5'));var Mustache=require(_0xf093('0x6'));var util=require(_0xf093('0x7'));var path=require('path');var sox=require(_0xf093('0x8'));var csv=require(_0xf093('0x9'));var ejs=require(_0xf093('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf093('0xb'));var crypto=require(_0xf093('0xc'));var jsforce=require(_0xf093('0xd'));var deskjs=require(_0xf093('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf093('0xf'));var Papa=require(_0xf093('0x10'));var Redis=require(_0xf093('0x11'));var authService=require(_0xf093('0x12'));var qs=require(_0xf093('0x13'));var as=require(_0xf093('0x14'));var hardwareService=require(_0xf093('0x15'));var logger=require(_0xf093('0x16'))(_0xf093('0x17'));var utils=require(_0xf093('0x18'));var config=require(_0xf093('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf093('0x1a'))['db'];function respondWithStatusCode(_0x3146d5,_0x336f79){_0x336f79=_0x336f79||0xcc;return function(_0x27ffdb){if(_0x27ffdb){return _0x3146d5[_0xf093('0x1b')](_0x336f79);}return _0x3146d5[_0xf093('0x1c')](_0x336f79)[_0xf093('0x1d')]();};}function respondWithResult(_0x541d5e,_0x3e698d){_0x3e698d=_0x3e698d||0xc8;return function(_0x2ea6c2){if(_0x2ea6c2){return _0x541d5e[_0xf093('0x1c')](_0x3e698d)[_0xf093('0x1e')](_0x2ea6c2);}};}function respondWithFilteredResult(_0x4fd225,_0xe4c3cb){return function(_0x3da525){if(_0x3da525){var _0x5d579d=typeof _0xe4c3cb['offset']===_0xf093('0x1f')&&typeof _0xe4c3cb[_0xf093('0x20')]==='undefined';var _0x5621db=_0x3da525[_0xf093('0x21')];var _0x479dbf=_0x5d579d?0x0:_0xe4c3cb[_0xf093('0x22')];var _0x6ba943=_0x5d579d?_0x3da525['count']:_0xe4c3cb[_0xf093('0x22')]+_0xe4c3cb[_0xf093('0x20')];var _0x112c94;if(_0x6ba943>=_0x5621db){_0x6ba943=_0x5621db;_0x112c94=0xc8;}else{_0x112c94=0xce;}_0x4fd225['status'](_0x112c94);return _0x4fd225[_0xf093('0x23')]('Content-Range',_0x479dbf+'-'+_0x6ba943+'/'+_0x5621db)[_0xf093('0x1e')](_0x3da525);}return null;};}function patchUpdates(_0x403d42){return function(_0x1d242){try{jsonpatch[_0xf093('0x24')](_0x1d242,_0x403d42,!![]);}catch(_0x211e21){return BPromise[_0xf093('0x25')](_0x211e21);}return _0x1d242[_0xf093('0x26')]();};}function saveUpdates(_0x19dcf5,_0x33e9a2){return function(_0x575cf5){if(_0x575cf5){return _0x575cf5[_0xf093('0x27')](_0x19dcf5)[_0xf093('0x28')](function(_0x5661b2){return _0x5661b2;});}return null;};}function removeEntity(_0x16ddc2,_0x53bc7e){return function(_0x5874b4){if(_0x5874b4){return _0x5874b4[_0xf093('0x29')]()[_0xf093('0x28')](function(){var _0x3d2922=_0x5874b4[_0xf093('0x2a')]({'plain':!![]});var _0x2c425f=_0xf093('0x2b');return db[_0xf093('0x2c')]['destroy']({'where':{'type':_0x2c425f,'resourceId':_0x3d2922['id']}})[_0xf093('0x28')](function(){return _0x5874b4;});})[_0xf093('0x28')](function(){_0x16ddc2[_0xf093('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7473,_0x3a33e8){return function(_0x3c6e64){if(!_0x3c6e64){_0x3b7473[_0xf093('0x1b')](0x194);}return _0x3c6e64;};}function handleError(_0x57df58,_0x4392d9){_0x4392d9=_0x4392d9||0x1f4;return function(_0x81d2dd){logger[_0xf093('0x2d')](_0x81d2dd['stack']);if(_0x81d2dd[_0xf093('0x2e')]){delete _0x81d2dd['name'];}_0x57df58['status'](_0x4392d9)[_0xf093('0x2f')](_0x81d2dd);};}exports[_0xf093('0x30')]=function(_0xe9a981,_0x3a8430){var _0x2b8dc3={},_0x1296a7={},_0x28e338={'count':0x0,'rows':[]};return db[_0xf093('0x31')][_0xf093('0x32')]()['then'](function(_0xb413bf){_0x1296a7['model']=_[_0xf093('0x33')](_0xb413bf);_0x1296a7['query']=_[_0xf093('0x33')](_0xe9a981['query']);_0x1296a7[_0xf093('0x34')]=_[_0xf093('0x35')](_0x1296a7[_0xf093('0x36')],_0x1296a7['query']);_0x2b8dc3[_0xf093('0x37')]=_['intersection'](_0x1296a7[_0xf093('0x36')],qs[_0xf093('0x38')](_0xe9a981[_0xf093('0x39')][_0xf093('0x38')]));_0x2b8dc3['attributes']=_0x2b8dc3['attributes']['length']?_0x2b8dc3[_0xf093('0x37')]:_0x1296a7[_0xf093('0x36')];if(!_0xe9a981['query'][_0xf093('0x3a')]('nolimit')){_0x2b8dc3[_0xf093('0x20')]=qs[_0xf093('0x20')](_0xe9a981[_0xf093('0x39')][_0xf093('0x20')]);_0x2b8dc3['offset']=qs['offset'](_0xe9a981[_0xf093('0x39')][_0xf093('0x22')]);}_0x2b8dc3[_0xf093('0x3b')]=qs[_0xf093('0x3c')](_0xe9a981[_0xf093('0x39')][_0xf093('0x3c')]);_0x2b8dc3[_0xf093('0x3d')]=qs['filters'](_[_0xf093('0x3e')](_0xe9a981[_0xf093('0x39')],_0x1296a7[_0xf093('0x34')]),_0xb413bf);if(_0xe9a981[_0xf093('0x39')][_0xf093('0x3f')]){_0x2b8dc3[_0xf093('0x3d')]=_[_0xf093('0x40')](_0x2b8dc3['where'],{'$or':_[_0xf093('0x41')](_0x2b8dc3[_0xf093('0x37')],function(_0x1e87ec){var _0x564eaa={};_0x564eaa[_0x1e87ec]={'$like':'%'+_0xe9a981[_0xf093('0x39')][_0xf093('0x3f')]+'%'};return _0x564eaa;})});}_0x2b8dc3=_[_0xf093('0x40')]({},_0x2b8dc3,_0xe9a981[_0xf093('0x42')]);var _0x4cf396={'where':_0x2b8dc3[_0xf093('0x3d')]};return db['CmCompany']['count'](_0x4cf396)['then'](function(_0x35e0d7){_0x28e338[_0xf093('0x21')]=_0x35e0d7;if(_0xe9a981[_0xf093('0x39')]['includeAll']){_0x2b8dc3[_0xf093('0x43')]=[{'all':!![]}];}return db[_0xf093('0x31')][_0xf093('0x44')](_0x2b8dc3);})[_0xf093('0x28')](function(_0x2b1af7){_0x28e338['rows']=_0x2b1af7;return _0x28e338;})[_0xf093('0x28')](respondWithFilteredResult(_0x3a8430,_0x2b8dc3))[_0xf093('0x45')](handleError(_0x3a8430,null));})[_0xf093('0x45')](handleError(_0x3a8430,null));};exports[_0xf093('0x46')]=function(_0x3e48aa,_0x79c85d){var _0x307ec6={'raw':![],'where':{'id':_0x3e48aa[_0xf093('0x47')]['id']}},_0x1e9dd5={};_0x1e9dd5['model']=_[_0xf093('0x33')](db[_0xf093('0x31')][_0xf093('0x48')]);_0x1e9dd5[_0xf093('0x39')]=_[_0xf093('0x33')](_0x3e48aa[_0xf093('0x39')]);_0x1e9dd5['filters']=_['intersection'](_0x1e9dd5[_0xf093('0x36')],_0x1e9dd5[_0xf093('0x39')]);_0x307ec6[_0xf093('0x37')]=_['intersection'](_0x1e9dd5[_0xf093('0x36')],qs[_0xf093('0x38')](_0x3e48aa[_0xf093('0x39')][_0xf093('0x38')]));_0x307ec6[_0xf093('0x37')]=_0x307ec6['attributes']['length']?_0x307ec6['attributes']:_0x1e9dd5[_0xf093('0x36')];if(_0x3e48aa[_0xf093('0x39')]['includeAll']){_0x307ec6['include']=[{'all':!![]}];}_0x307ec6=_['merge']({},_0x307ec6,_0x3e48aa[_0xf093('0x42')]);return db[_0xf093('0x31')][_0xf093('0x49')](_0x307ec6)[_0xf093('0x28')](handleEntityNotFound(_0x79c85d,null))['then'](respondWithResult(_0x79c85d,null))[_0xf093('0x45')](handleError(_0x79c85d,null));};exports[_0xf093('0x4a')]=function(_0x39e0cd,_0x387a92){return db['CmCompany']['create'](_0x39e0cd[_0xf093('0x4b')],{})['then'](function(_0x2646df){var _0x19d8aa=_0x39e0cd[_0xf093('0x4c')][_0xf093('0x2a')]({'plain':!![]});if(!_0x19d8aa)throw new Error(_0xf093('0x4d'));if(_0x19d8aa['role']==='user'){var _0x25e3a8=_0x2646df[_0xf093('0x2a')]({'plain':!![]});var _0x28af63=_0xf093('0x2b');return db['UserProfileSection'][_0xf093('0x49')]({'where':{'name':_0x28af63,'userProfileId':_0x19d8aa[_0xf093('0x4e')]},'raw':!![]})[_0xf093('0x28')](function(_0x14b5c4){if(_0x14b5c4&&_0x14b5c4[_0xf093('0x4f')]===0x0){return db[_0xf093('0x2c')]['create']({'name':_0x25e3a8['name'],'resourceId':_0x25e3a8['id'],'type':_0x14b5c4[_0xf093('0x2e')],'sectionId':_0x14b5c4['id']},{})[_0xf093('0x28')](function(){return _0x2646df;});}else{return _0x2646df;}})[_0xf093('0x45')](function(_0x4c76a6){logger[_0xf093('0x2d')](_0xf093('0x50'),_0x4c76a6);throw _0x4c76a6;});}return _0x2646df;})['then'](respondWithResult(_0x387a92,0xc9))['catch'](handleError(_0x387a92,null));};exports[_0xf093('0x27')]=function(_0xcb27c7,_0x3529e5){if(_0xcb27c7[_0xf093('0x4b')]['id']){delete _0xcb27c7[_0xf093('0x4b')]['id'];}return db[_0xf093('0x31')]['find']({'where':{'id':_0xcb27c7['params']['id']}})['then'](handleEntityNotFound(_0x3529e5,null))[_0xf093('0x28')](saveUpdates(_0xcb27c7['body'],null))[_0xf093('0x28')](respondWithResult(_0x3529e5,null))['catch'](handleError(_0x3529e5,null));};exports[_0xf093('0x29')]=function(_0x455daa,_0x54fb84){return db[_0xf093('0x31')][_0xf093('0x49')]({'where':{'id':_0x455daa[_0xf093('0x47')]['id']}})[_0xf093('0x28')](handleEntityNotFound(_0x54fb84,null))['then'](removeEntity(_0x54fb84,null))['catch'](handleError(_0x54fb84,null));};exports[_0xf093('0x32')]=function(_0x4d1f06,_0x36ad95){return db['CmCompany'][_0xf093('0x32')]()[_0xf093('0x28')](respondWithResult(_0x36ad95,null))[_0xf093('0x45')](handleError(_0x36ad95,null));};exports[_0xf093('0x51')]=function(_0x243c79,_0xfdf77e,_0x33ad83){return db[_0xf093('0x52')][_0xf093('0x49')]({'where':{'id':_0x243c79[_0xf093('0x47')]['id']}})[_0xf093('0x28')](handleEntityNotFound(_0xfdf77e,null))[_0xf093('0x28')](function(_0x5106fb){if(_0x5106fb){return _0x5106fb['addContacts'](_0x243c79[_0xf093('0x4b')]['ids'],_[_0xf093('0x53')](_0x243c79[_0xf093('0x4b')],[_0xf093('0x54'),'id'])||{});}})['then'](respondWithResult(_0xfdf77e,null))[_0xf093('0x45')](handleError(_0xfdf77e,null));};exports[_0xf093('0x55')]=function(_0x5e1364,_0x3ad2a9,_0x20e7d7){var _0x21d241={};var _0x35c6da={};var _0x5d9881;var _0x3f86d5;return db[_0xf093('0x31')][_0xf093('0x56')]({'where':{'id':_0x5e1364['params']['id']}})[_0xf093('0x28')](handleEntityNotFound(_0x3ad2a9,null))[_0xf093('0x28')](function(_0x4578ed){if(_0x4578ed){_0x5d9881=_0x4578ed;_0x35c6da['model']=_[_0xf093('0x33')](db[_0xf093('0x52')][_0xf093('0x48')]);_0x35c6da[_0xf093('0x39')]=_['keys'](_0x5e1364[_0xf093('0x39')]);_0x35c6da['filters']=_[_0xf093('0x35')](_0x35c6da[_0xf093('0x36')],_0x35c6da[_0xf093('0x39')]);_0x21d241[_0xf093('0x37')]=_[_0xf093('0x35')](_0x35c6da[_0xf093('0x36')],qs[_0xf093('0x38')](_0x5e1364[_0xf093('0x39')]['fields']));_0x21d241[_0xf093('0x37')]=_0x21d241[_0xf093('0x37')]['length']?_0x21d241[_0xf093('0x37')]:_0x35c6da[_0xf093('0x36')];_0x21d241[_0xf093('0x3b')]=qs[_0xf093('0x3c')](_0x5e1364[_0xf093('0x39')]['sort']);_0x21d241[_0xf093('0x3d')]=qs[_0xf093('0x34')](_[_0xf093('0x3e')](_0x5e1364[_0xf093('0x39')],_0x35c6da[_0xf093('0x34')]));if(_0x5e1364[_0xf093('0x39')][_0xf093('0x3f')]){_0x21d241['where']=_[_0xf093('0x40')](_0x21d241[_0xf093('0x3d')],{'$or':_[_0xf093('0x41')](_0x21d241[_0xf093('0x37')],function(_0x386c4e){var _0x598c27={};_0x598c27[_0x386c4e]={'$like':'%'+_0x5e1364[_0xf093('0x39')]['filter']+'%'};return _0x598c27;})});}_0x21d241=_['merge']({},_0x21d241,_0x5e1364[_0xf093('0x42')]);return _0x5d9881[_0xf093('0x55')](_0x21d241);}})[_0xf093('0x28')](function(_0x4ecdde){if(_0x4ecdde){_0x3f86d5=_0x4ecdde[_0xf093('0x57')];if(!_0x5e1364[_0xf093('0x39')][_0xf093('0x3a')](_0xf093('0x58'))){_0x21d241[_0xf093('0x20')]=qs[_0xf093('0x20')](_0x5e1364['query'][_0xf093('0x20')]);_0x21d241['offset']=qs[_0xf093('0x22')](_0x5e1364[_0xf093('0x39')][_0xf093('0x22')]);}return _0x5d9881[_0xf093('0x55')](_0x21d241);}})[_0xf093('0x28')](function(_0x1fe8cb){if(_0x1fe8cb){return _0x1fe8cb?{'count':_0x3f86d5,'rows':_0x1fe8cb}:null;}})[_0xf093('0x28')](respondWithResult(_0x3ad2a9,null))[_0xf093('0x45')](handleError(_0x3ad2a9,null));}; \ No newline at end of file +var _0x894f=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','rawAttributes','eml-format','rimraf','zip-dir'];(function(_0x627162,_0x508b4f){var _0x521cc5=function(_0x30d02){while(--_0x30d02){_0x627162['push'](_0x627162['shift']());}};_0x521cc5(++_0x508b4f);}(_0x894f,0x1ba));var _0xf894=function(_0x3c754e,_0x39581c){_0x3c754e=_0x3c754e-0x0;var _0x574259=_0x894f[_0x3c754e];return _0x574259;};'use strict';var emlformat=require(_0xf894('0x0'));var rimraf=require(_0xf894('0x1'));var zipdir=require(_0xf894('0x2'));var jsonpatch=require(_0xf894('0x3'));var rp=require(_0xf894('0x4'));var moment=require(_0xf894('0x5'));var BPromise=require(_0xf894('0x6'));var Mustache=require(_0xf894('0x7'));var util=require(_0xf894('0x8'));var path=require(_0xf894('0x9'));var sox=require(_0xf894('0xa'));var csv=require(_0xf894('0xb'));var ejs=require(_0xf894('0xc'));var fs=require('fs');var fs_extra=require(_0xf894('0xd'));var _=require(_0xf894('0xe'));var squel=require(_0xf894('0xf'));var crypto=require(_0xf894('0x10'));var jsforce=require(_0xf894('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf894('0x12'));var Redis=require(_0xf894('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf894('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf894('0x15'));var logger=require(_0xf894('0x16'))('api');var utils=require(_0xf894('0x17'));var config=require(_0xf894('0x18'));var licenseUtil=require(_0xf894('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9e50,_0xda23a3){_0xda23a3=_0xda23a3||0xcc;return function(_0xfdb43f){if(_0xfdb43f){return _0x5d9e50[_0xf894('0x1a')](_0xda23a3);}return _0x5d9e50[_0xf894('0x1b')](_0xda23a3)[_0xf894('0x1c')]();};}function respondWithResult(_0x4b9be7,_0x3d56e7){_0x3d56e7=_0x3d56e7||0xc8;return function(_0x20c177){if(_0x20c177){return _0x4b9be7[_0xf894('0x1b')](_0x3d56e7)['json'](_0x20c177);}};}function respondWithFilteredResult(_0xff8645,_0x1bc525){return function(_0x22e4aa){if(_0x22e4aa){var _0x1afae5=typeof _0x1bc525[_0xf894('0x1d')]===_0xf894('0x1e')&&typeof _0x1bc525[_0xf894('0x1f')]==='undefined';var _0x19b71e=_0x22e4aa[_0xf894('0x20')];var _0x4465ab=_0x1afae5?0x0:_0x1bc525[_0xf894('0x1d')];var _0x32d84c=_0x1afae5?_0x22e4aa[_0xf894('0x20')]:_0x1bc525[_0xf894('0x1d')]+_0x1bc525['limit'];var _0x1add3b;if(_0x32d84c>=_0x19b71e){_0x32d84c=_0x19b71e;_0x1add3b=0xc8;}else{_0x1add3b=0xce;}_0xff8645[_0xf894('0x1b')](_0x1add3b);return _0xff8645['set'](_0xf894('0x21'),_0x4465ab+'-'+_0x32d84c+'/'+_0x19b71e)[_0xf894('0x22')](_0x22e4aa);}return null;};}function patchUpdates(_0x500f52){return function(_0x131e70){try{jsonpatch[_0xf894('0x23')](_0x131e70,_0x500f52,!![]);}catch(_0x3f88a8){return BPromise[_0xf894('0x24')](_0x3f88a8);}return _0x131e70[_0xf894('0x25')]();};}function saveUpdates(_0x43b4e7,_0x46f351){return function(_0x4f0fd9){if(_0x4f0fd9){return _0x4f0fd9[_0xf894('0x26')](_0x43b4e7)[_0xf894('0x27')](function(_0x292bbe){return _0x292bbe;});}return null;};}function removeEntity(_0x54145b,_0x1d18dc){return function(_0x28bf7f){if(_0x28bf7f){return _0x28bf7f[_0xf894('0x28')]()[_0xf894('0x27')](function(){var _0x30a32c=_0x28bf7f[_0xf894('0x29')]({'plain':!![]});var _0x117060=_0xf894('0x2a');return db[_0xf894('0x2b')][_0xf894('0x28')]({'where':{'type':_0x117060,'resourceId':_0x30a32c['id']}})[_0xf894('0x27')](function(){return _0x28bf7f;});})['then'](function(){_0x54145b[_0xf894('0x1b')](0xcc)[_0xf894('0x1c')]();});}};}function handleEntityNotFound(_0x56ad97,_0x4c7bbd){return function(_0x5f0445){if(!_0x5f0445){_0x56ad97[_0xf894('0x1a')](0x194);}return _0x5f0445;};}function handleError(_0x1ea6d0,_0xa7c4a9){_0xa7c4a9=_0xa7c4a9||0x1f4;return function(_0x2db017){logger[_0xf894('0x2c')](_0x2db017[_0xf894('0x2d')]);if(_0x2db017[_0xf894('0x2e')]){delete _0x2db017['name'];}_0x1ea6d0['status'](_0xa7c4a9)[_0xf894('0x2f')](_0x2db017);};}exports[_0xf894('0x30')]=function(_0x457e97,_0x3ad249){var _0x1dcb9e={},_0x1e21f9={},_0x1a5f85={'count':0x0,'rows':[]};return db[_0xf894('0x31')][_0xf894('0x32')]()[_0xf894('0x27')](function(_0x38ba69){_0x1e21f9[_0xf894('0x33')]=_[_0xf894('0x34')](_0x38ba69);_0x1e21f9[_0xf894('0x35')]=_[_0xf894('0x34')](_0x457e97[_0xf894('0x35')]);_0x1e21f9[_0xf894('0x36')]=_[_0xf894('0x37')](_0x1e21f9['model'],_0x1e21f9['query']);_0x1dcb9e[_0xf894('0x38')]=_[_0xf894('0x37')](_0x1e21f9['model'],qs['fields'](_0x457e97[_0xf894('0x35')][_0xf894('0x39')]));_0x1dcb9e['attributes']=_0x1dcb9e[_0xf894('0x38')][_0xf894('0x3a')]?_0x1dcb9e[_0xf894('0x38')]:_0x1e21f9[_0xf894('0x33')];if(!_0x457e97[_0xf894('0x35')][_0xf894('0x3b')](_0xf894('0x3c'))){_0x1dcb9e[_0xf894('0x1f')]=qs[_0xf894('0x1f')](_0x457e97[_0xf894('0x35')]['limit']);_0x1dcb9e[_0xf894('0x1d')]=qs[_0xf894('0x1d')](_0x457e97[_0xf894('0x35')][_0xf894('0x1d')]);}_0x1dcb9e[_0xf894('0x3d')]=qs['sort'](_0x457e97[_0xf894('0x35')][_0xf894('0x3e')]);_0x1dcb9e[_0xf894('0x3f')]=qs[_0xf894('0x36')](_[_0xf894('0x40')](_0x457e97[_0xf894('0x35')],_0x1e21f9['filters']),_0x38ba69);if(_0x457e97[_0xf894('0x35')][_0xf894('0x41')]){_0x1dcb9e[_0xf894('0x3f')]=_[_0xf894('0x42')](_0x1dcb9e['where'],{'$or':_[_0xf894('0x43')](_0x1dcb9e[_0xf894('0x38')],function(_0xba60c4){var _0x591858={};_0x591858[_0xba60c4]={'$like':'%'+_0x457e97[_0xf894('0x35')][_0xf894('0x41')]+'%'};return _0x591858;})});}_0x1dcb9e=_[_0xf894('0x42')]({},_0x1dcb9e,_0x457e97[_0xf894('0x44')]);var _0x178cb3={'where':_0x1dcb9e[_0xf894('0x3f')]};return db['CmCompany'][_0xf894('0x20')](_0x178cb3)['then'](function(_0x139c9f){_0x1a5f85[_0xf894('0x20')]=_0x139c9f;if(_0x457e97[_0xf894('0x35')][_0xf894('0x45')]){_0x1dcb9e[_0xf894('0x46')]=[{'all':!![]}];}return db[_0xf894('0x31')][_0xf894('0x47')](_0x1dcb9e);})[_0xf894('0x27')](function(_0x43965c){_0x1a5f85[_0xf894('0x48')]=_0x43965c;return _0x1a5f85;})[_0xf894('0x27')](respondWithFilteredResult(_0x3ad249,_0x1dcb9e))[_0xf894('0x49')](handleError(_0x3ad249,null));})['catch'](handleError(_0x3ad249,null));};exports[_0xf894('0x4a')]=function(_0x321608,_0x17df01){var _0x5d58c0={'raw':![],'where':{'id':_0x321608['params']['id']}},_0x423ac5={};_0x423ac5[_0xf894('0x33')]=_[_0xf894('0x34')](db[_0xf894('0x31')]['rawAttributes']);_0x423ac5[_0xf894('0x35')]=_['keys'](_0x321608[_0xf894('0x35')]);_0x423ac5['filters']=_['intersection'](_0x423ac5[_0xf894('0x33')],_0x423ac5['query']);_0x5d58c0[_0xf894('0x38')]=_[_0xf894('0x37')](_0x423ac5[_0xf894('0x33')],qs['fields'](_0x321608[_0xf894('0x35')]['fields']));_0x5d58c0['attributes']=_0x5d58c0[_0xf894('0x38')][_0xf894('0x3a')]?_0x5d58c0[_0xf894('0x38')]:_0x423ac5[_0xf894('0x33')];if(_0x321608[_0xf894('0x35')][_0xf894('0x45')]){_0x5d58c0[_0xf894('0x46')]=[{'all':!![]}];}_0x5d58c0=_[_0xf894('0x42')]({},_0x5d58c0,_0x321608[_0xf894('0x44')]);return db[_0xf894('0x31')][_0xf894('0x4b')](_0x5d58c0)['then'](handleEntityNotFound(_0x17df01,null))[_0xf894('0x27')](respondWithResult(_0x17df01,null))['catch'](handleError(_0x17df01,null));};exports['create']=function(_0x49ae1d,_0x215859){return db[_0xf894('0x31')]['create'](_0x49ae1d[_0xf894('0x4c')],{})[_0xf894('0x27')](function(_0xa447ad){var _0x201bee=_0x49ae1d[_0xf894('0x4d')][_0xf894('0x29')]({'plain':!![]});if(!_0x201bee)throw new Error(_0xf894('0x4e'));if(_0x201bee[_0xf894('0x4f')]===_0xf894('0x4d')){var _0x1b06f7=_0xa447ad[_0xf894('0x29')]({'plain':!![]});var _0x4613b1='Companies';return db['UserProfileSection']['find']({'where':{'name':_0x4613b1,'userProfileId':_0x201bee['userProfileId']},'raw':!![]})[_0xf894('0x27')](function(_0x2aa0db){if(_0x2aa0db&&_0x2aa0db[_0xf894('0x50')]===0x0){return db[_0xf894('0x2b')]['create']({'name':_0x1b06f7[_0xf894('0x2e')],'resourceId':_0x1b06f7['id'],'type':_0x2aa0db[_0xf894('0x2e')],'sectionId':_0x2aa0db['id']},{})['then'](function(){return _0xa447ad;});}else{return _0xa447ad;}})[_0xf894('0x49')](function(_0x3bee47){logger[_0xf894('0x2c')](_0xf894('0x51'),_0x3bee47);throw _0x3bee47;});}return _0xa447ad;})['then'](respondWithResult(_0x215859,0xc9))[_0xf894('0x49')](handleError(_0x215859,null));};exports[_0xf894('0x26')]=function(_0x246e42,_0x43d3ad){if(_0x246e42[_0xf894('0x4c')]['id']){delete _0x246e42['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x246e42['params']['id']}})[_0xf894('0x27')](handleEntityNotFound(_0x43d3ad,null))['then'](saveUpdates(_0x246e42[_0xf894('0x4c')],null))[_0xf894('0x27')](respondWithResult(_0x43d3ad,null))[_0xf894('0x49')](handleError(_0x43d3ad,null));};exports[_0xf894('0x28')]=function(_0x506381,_0x29c950){return db[_0xf894('0x31')]['find']({'where':{'id':_0x506381[_0xf894('0x52')]['id']}})[_0xf894('0x27')](handleEntityNotFound(_0x29c950,null))[_0xf894('0x27')](removeEntity(_0x29c950,null))['catch'](handleError(_0x29c950,null));};exports[_0xf894('0x32')]=function(_0x318330,_0x2c95bf){return db[_0xf894('0x31')][_0xf894('0x32')]()[_0xf894('0x27')](respondWithResult(_0x2c95bf,null))['catch'](handleError(_0x2c95bf,null));};exports[_0xf894('0x53')]=function(_0x1d11c9,_0x36ecd8,_0x4d2fd5){return db[_0xf894('0x54')]['find']({'where':{'id':_0x1d11c9['params']['id']}})[_0xf894('0x27')](handleEntityNotFound(_0x36ecd8,null))['then'](function(_0x359425){if(_0x359425){return _0x359425[_0xf894('0x53')](_0x1d11c9[_0xf894('0x4c')]['ids'],_[_0xf894('0x55')](_0x1d11c9[_0xf894('0x4c')],[_0xf894('0x56'),'id'])||{});}})[_0xf894('0x27')](respondWithResult(_0x36ecd8,null))[_0xf894('0x49')](handleError(_0x36ecd8,null));};exports[_0xf894('0x57')]=function(_0x1e371d,_0x416c8d,_0xc1dadd){var _0x17266e={};var _0x2b5403={};var _0x4b3df5;var _0xf80ba5;return db[_0xf894('0x31')]['findOne']({'where':{'id':_0x1e371d[_0xf894('0x52')]['id']}})[_0xf894('0x27')](handleEntityNotFound(_0x416c8d,null))[_0xf894('0x27')](function(_0xa9e20e){if(_0xa9e20e){_0x4b3df5=_0xa9e20e;_0x2b5403['model']=_[_0xf894('0x34')](db[_0xf894('0x54')][_0xf894('0x58')]);_0x2b5403[_0xf894('0x35')]=_['keys'](_0x1e371d[_0xf894('0x35')]);_0x2b5403[_0xf894('0x36')]=_[_0xf894('0x37')](_0x2b5403['model'],_0x2b5403[_0xf894('0x35')]);_0x17266e[_0xf894('0x38')]=_[_0xf894('0x37')](_0x2b5403[_0xf894('0x33')],qs[_0xf894('0x39')](_0x1e371d['query']['fields']));_0x17266e[_0xf894('0x38')]=_0x17266e['attributes']['length']?_0x17266e[_0xf894('0x38')]:_0x2b5403[_0xf894('0x33')];_0x17266e[_0xf894('0x3d')]=qs[_0xf894('0x3e')](_0x1e371d[_0xf894('0x35')][_0xf894('0x3e')]);_0x17266e[_0xf894('0x3f')]=qs[_0xf894('0x36')](_[_0xf894('0x40')](_0x1e371d[_0xf894('0x35')],_0x2b5403['filters']));if(_0x1e371d[_0xf894('0x35')][_0xf894('0x41')]){_0x17266e[_0xf894('0x3f')]=_[_0xf894('0x42')](_0x17266e[_0xf894('0x3f')],{'$or':_[_0xf894('0x43')](_0x17266e['attributes'],function(_0x1a2913){var _0x5629d6={};_0x5629d6[_0x1a2913]={'$like':'%'+_0x1e371d['query'][_0xf894('0x41')]+'%'};return _0x5629d6;})});}_0x17266e=_[_0xf894('0x42')]({},_0x17266e,_0x1e371d['options']);return _0x4b3df5[_0xf894('0x57')](_0x17266e);}})[_0xf894('0x27')](function(_0x2a4b60){if(_0x2a4b60){_0xf80ba5=_0x2a4b60[_0xf894('0x3a')];if(!_0x1e371d[_0xf894('0x35')][_0xf894('0x3b')](_0xf894('0x3c'))){_0x17266e[_0xf894('0x1f')]=qs[_0xf894('0x1f')](_0x1e371d[_0xf894('0x35')][_0xf894('0x1f')]);_0x17266e['offset']=qs[_0xf894('0x1d')](_0x1e371d[_0xf894('0x35')][_0xf894('0x1d')]);}return _0x4b3df5[_0xf894('0x57')](_0x17266e);}})[_0xf894('0x27')](function(_0x12999d){if(_0x12999d){return _0x12999d?{'count':_0xf80ba5,'rows':_0x12999d}:null;}})['then'](respondWithResult(_0x416c8d,null))[_0xf894('0x49')](handleError(_0x416c8d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 1e91e2d..1fbffed 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 _0xbd33=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xbd33,0x76));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3bd3('0x0'));var util=require(_0x3bd3('0x1'));var logger=require(_0x3bd3('0x2'))(_0x3bd3('0x3'));var moment=require(_0x3bd3('0x4'));var BPromise=require(_0x3bd3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bd3('0x6'));var rimraf=require(_0x3bd3('0x7'));var config=require(_0x3bd3('0x8'));var attributes=require(_0x3bd3('0x9'));module[_0x3bd3('0xa')]=function(_0x5d8b42,_0x4750bf){return _0x5d8b42[_0x3bd3('0xb')](_0x3bd3('0xc'),attributes,{'tableName':_0x3bd3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9e9=['CmCompany','cm_companies','lodash','../../config/logger','api','bluebird','path','../../config/environment','./cmCompany.attributes','exports'];(function(_0x770eb2,_0x1854d4){var _0x3fe383=function(_0x54d9c7){while(--_0x54d9c7){_0x770eb2['push'](_0x770eb2['shift']());}};_0x3fe383(++_0x1854d4);}(_0xb9e9,0x70));var _0x9b9e=function(_0x28a133,_0x336e70){_0x28a133=_0x28a133-0x0;var _0x27c2d7=_0xb9e9[_0x28a133];return _0x27c2d7;};'use strict';var _=require(_0x9b9e('0x0'));var util=require('util');var logger=require(_0x9b9e('0x1'))(_0x9b9e('0x2'));var moment=require('moment');var BPromise=require(_0x9b9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b9e('0x4'));var rimraf=require('rimraf');var config=require(_0x9b9e('0x5'));var attributes=require(_0x9b9e('0x6'));module[_0x9b9e('0x7')]=function(_0x2f9485,_0x3b44fd){return _0x2f9485['define'](_0x9b9e('0x8'),attributes,{'tableName':_0x9b9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 0f48fe5..2625b6c 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 _0x329e=['stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x329e,0x1d3));var _0xe329=function(_0x536bcf,_0x3da8c3){_0x536bcf=_0x536bcf-0x0;var _0x24be59=_0x329e[_0x536bcf];return _0x24be59;};'use strict';var _=require('lodash');var util=require(_0xe329('0x0'));var moment=require('moment');var BPromise=require(_0xe329('0x1'));var rs=require(_0xe329('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe329('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe329('0x4'))(_0xe329('0x5'));var config=require(_0xe329('0x6'));var jayson=require(_0xe329('0x7'));var client=jayson[_0xe329('0x8')][_0xe329('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a907,_0x515371,_0x240026){return new BPromise(function(_0x48d59a,_0x1b3477){return client[_0xe329('0xa')](_0x29a907,_0x240026)[_0xe329('0xb')](function(_0x248dde){logger['info'](_0xe329('0xc'),_0x515371,_0xe329('0xd'));logger[_0xe329('0xe')](_0xe329('0xf'),_0x515371,_0xe329('0xd'),JSON[_0xe329('0x10')](_0x248dde));if(_0x248dde[_0xe329('0x11')]){if(_0x248dde['error'][_0xe329('0x12')]===0x1f4){logger[_0xe329('0x11')]('CmCompany,\x20%s,\x20%s',_0x515371,_0x248dde[_0xe329('0x11')][_0xe329('0x13')]);return _0x1b3477(_0x248dde[_0xe329('0x11')][_0xe329('0x13')]);}logger[_0xe329('0x11')](_0xe329('0xc'),_0x515371,_0x248dde['error'][_0xe329('0x13')]);return _0x48d59a(_0x248dde[_0xe329('0x11')]['message']);}else{logger[_0xe329('0x14')](_0xe329('0xc'),_0x515371,_0xe329('0xd'));_0x48d59a(_0x248dde[_0xe329('0x15')]['message']);}})[_0xe329('0x16')](function(_0x2746b8){logger[_0xe329('0x11')](_0xe329('0xc'),_0x515371,_0x2746b8);_0x1b3477(_0x2746b8);});});} \ No newline at end of file +var _0x189f=['randomstring','../../mysqldb','../../config/utils','../../config/environment','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x21e2a5,_0x49508c){var _0x20c38b=function(_0x40a793){while(--_0x40a793){_0x21e2a5['push'](_0x21e2a5['shift']());}};_0x20c38b(++_0x49508c);}(_0x189f,0xfd));var _0xf189=function(_0x3fbeb7,_0x316335){_0x3fbeb7=_0x3fbeb7-0x0;var _0x4dcb89=_0x189f[_0x3fbeb7];return _0x4dcb89;};'use strict';var _=require('lodash');var util=require(_0xf189('0x0'));var moment=require(_0xf189('0x1'));var BPromise=require('bluebird');var rs=require(_0xf189('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf189('0x3'))['db'];var utils=require(_0xf189('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf189('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeb66c6,_0xe33bb6,_0x14b49c){return new BPromise(function(_0x5db305,_0x5226dc){return client['request'](_0xeb66c6,_0x14b49c)['then'](function(_0x22a05b){logger[_0xf189('0x6')](_0xf189('0x7'),_0xe33bb6,'request\x20sent');logger[_0xf189('0x8')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xe33bb6,_0xf189('0x9'),JSON[_0xf189('0xa')](_0x22a05b));if(_0x22a05b[_0xf189('0xb')]){if(_0x22a05b[_0xf189('0xb')][_0xf189('0xc')]===0x1f4){logger[_0xf189('0xb')]('CmCompany,\x20%s,\x20%s',_0xe33bb6,_0x22a05b[_0xf189('0xb')]['message']);return _0x5226dc(_0x22a05b[_0xf189('0xb')]['message']);}logger[_0xf189('0xb')](_0xf189('0x7'),_0xe33bb6,_0x22a05b[_0xf189('0xb')][_0xf189('0xd')]);return _0x5db305(_0x22a05b[_0xf189('0xb')][_0xf189('0xd')]);}else{logger[_0xf189('0x6')](_0xf189('0x7'),_0xe33bb6,'request\x20sent');_0x5db305(_0x22a05b[_0xf189('0xe')][_0xf189('0xd')]);}})['catch'](function(_0x1923f8){logger[_0xf189('0xb')](_0xf189('0x7'),_0xe33bb6,_0x1923f8);_0x5226dc(_0x1923f8);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 58063c5..b89e468 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 _0x1ba3=['path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','getContacts','post','create','/:id/contacts','addContacts','put','update','destroy','multer','util'];(function(_0x5a58ba,_0x7cecd7){var _0x58dc46=function(_0x3c9f34){while(--_0x3c9f34){_0x5a58ba['push'](_0x5a58ba['shift']());}};_0x58dc46(++_0x7cecd7);}(_0x1ba3,0x154));var _0x31ba=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x1ba3[_0x1064bc];return _0x5edc45;};'use strict';var multer=require(_0x31ba('0x0'));var util=require(_0x31ba('0x1'));var path=require(_0x31ba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x31ba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x31ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x31ba('0x5'));var controller=require('./cmCompany.controller');router[_0x31ba('0x6')]('/',auth[_0x31ba('0x7')](),controller[_0x31ba('0x8')]);router[_0x31ba('0x6')](_0x31ba('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x31ba('0x6')](_0x31ba('0xa'),auth[_0x31ba('0x7')](),controller['show']);router['get']('/:id/contacts',auth[_0x31ba('0x7')](),controller[_0x31ba('0xb')]);router[_0x31ba('0xc')]('/',auth[_0x31ba('0x7')](),controller[_0x31ba('0xd')]);router['post'](_0x31ba('0xe'),auth[_0x31ba('0x7')](),controller[_0x31ba('0xf')]);router[_0x31ba('0x10')](_0x31ba('0xa'),auth[_0x31ba('0x7')](),controller[_0x31ba('0x11')]);router['delete'](_0x31ba('0xa'),auth['isAuthenticated'](),controller[_0x31ba('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc1f3=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x177a2e,_0x411570){var _0x13ba4c=function(_0x41a412){while(--_0x41a412){_0x177a2e['push'](_0x177a2e['shift']());}};_0x13ba4c(++_0x411570);}(_0xc1f3,0x76));var _0x3c1f=function(_0x29226c,_0x26cbef){_0x29226c=_0x29226c-0x0;var _0x2b83bd=_0xc1f3[_0x29226c];return _0x2b83bd;};'use strict';var multer=require(_0x3c1f('0x0'));var util=require(_0x3c1f('0x1'));var path=require('path');var timeout=require(_0x3c1f('0x2'));var express=require(_0x3c1f('0x3'));var router=express[_0x3c1f('0x4')]();var fs_extra=require(_0x3c1f('0x5'));var auth=require(_0x3c1f('0x6'));var interaction=require(_0x3c1f('0x7'));var config=require(_0x3c1f('0x8'));var controller=require(_0x3c1f('0x9'));router[_0x3c1f('0xa')]('/',auth[_0x3c1f('0xb')](),controller[_0x3c1f('0xc')]);router['get'](_0x3c1f('0xd'),auth[_0x3c1f('0xb')](),controller[_0x3c1f('0xe')]);router[_0x3c1f('0xa')](_0x3c1f('0xf'),auth[_0x3c1f('0xb')](),controller[_0x3c1f('0x10')]);router[_0x3c1f('0xa')]('/:id/contacts',auth[_0x3c1f('0xb')](),controller[_0x3c1f('0x11')]);router[_0x3c1f('0x12')]('/',auth['isAuthenticated'](),controller[_0x3c1f('0x13')]);router[_0x3c1f('0x12')]('/:id/contacts',auth[_0x3c1f('0xb')](),controller[_0x3c1f('0x14')]);router[_0x3c1f('0x15')](_0x3c1f('0xf'),auth['isAuthenticated'](),controller[_0x3c1f('0x16')]);router[_0x3c1f('0x17')](_0x3c1f('0xf'),auth[_0x3c1f('0xb')](),controller['destroy']);module[_0x3c1f('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 398bd8c..c050222 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 _0x7afa=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x18a9df,_0x3fe970){var _0x700b79=function(_0x122be4){while(--_0x122be4){_0x18a9df['push'](_0x18a9df['shift']());}};_0x700b79(++_0x3fe970);}(_0x7afa,0xd5));var _0xa7af=function(_0x1dec63,_0x1b23fe){_0x1dec63=_0x1dec63-0x0;var _0x4487a7=_0x7afa[_0x1dec63];return _0x4487a7;};'use strict';var _=require(_0xa7af('0x0'));var Sequelize=require(_0xa7af('0x1'));module[_0xa7af('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa7af('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa7af('0x3')]},'city':{'type':Sequelize[_0xa7af('0x3')]},'country':{'type':Sequelize[_0xa7af('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa7af('0x3')]},'mobile':{'type':Sequelize[_0xa7af('0x3')]},'fax':{'type':Sequelize[_0xa7af('0x3')]},'email':{'type':Sequelize[_0xa7af('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa7af('0x3')]},'twitter':{'type':Sequelize[_0xa7af('0x3')]},'skype':{'type':Sequelize[_0xa7af('0x3')]},'teams':{'type':Sequelize[_0xa7af('0x3')]},'viber':{'type':Sequelize[_0xa7af('0x3')]},'line':{'type':Sequelize[_0xa7af('0x3')]},'wechat':{'type':Sequelize[_0xa7af('0x3')]},'telegram':{'type':Sequelize[_0xa7af('0x3')]},'UserId':{'type':Sequelize[_0xa7af('0x4')]},'priority':{'type':Sequelize[_0xa7af('0x4')](0x2)[_0xa7af('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa7af('0x6')],'defaultValue':Sequelize[_0xa7af('0x7')]}}; \ No newline at end of file +var _0x196b=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x717ff8,_0x15ce89){var _0x2bc1d8=function(_0x1736d6){while(--_0x1736d6){_0x717ff8['push'](_0x717ff8['shift']());}};_0x2bc1d8(++_0x15ce89);}(_0x196b,0x182));var _0xb196=function(_0x140948,_0x132a44){_0x140948=_0x140948-0x0;var _0x75b903=_0x196b[_0x140948];return _0x75b903;};'use strict';var _=require(_0xb196('0x0'));var Sequelize=require(_0xb196('0x1'));module[_0xb196('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xb196('0x3')]},'street':{'type':Sequelize[_0xb196('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb196('0x3')]},'country':{'type':Sequelize[_0xb196('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb196('0x3')]},'description':{'type':Sequelize[_0xb196('0x4')]},'phone':{'type':Sequelize[_0xb196('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb196('0x3')]},'email':{'type':Sequelize[_0xb196('0x3')]},'url':{'type':Sequelize[_0xb196('0x3')]},'facebook':{'type':Sequelize[_0xb196('0x3')]},'fb_data':{'type':Sequelize[_0xb196('0x3')]},'twitter':{'type':Sequelize[_0xb196('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xb196('0x3')]},'viber':{'type':Sequelize[_0xb196('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xb196('0x3')]},'telegram':{'type':Sequelize[_0xb196('0x3')]},'UserId':{'type':Sequelize[_0xb196('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb196('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb196('0x7')],'defaultValue':Sequelize[_0xb196('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a5d3c43..bc48781 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 _0x8c2c=['tags','columnName','displayName','CmCustomField','findAll','custom','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','duplicates','$or','spread','show','$and','omit','pickBy','format','cf_%d','table','id\x20=\x20?','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_values','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','mail','chat','sms','openchannel','fax','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','alias','fullname','startCase','Website','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','findAndCountAll','sortBy','reverse','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','set','json','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','push','findOne','all','length','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','ListId','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','user','role','some','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','agent','sequelize','toString','count','keyBy','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8c2c,0x92));var _0xc8c2=function(_0x1429c7,_0x5a19f5){_0x1429c7=_0x1429c7-0x0;var _0x188e1f=_0x8c2c[_0x1429c7];return _0x188e1f;};'use strict';var moment=require('moment');var BPromise=require(_0xc8c2('0x0'));var util=require(_0xc8c2('0x1'));var path=require(_0xc8c2('0x2'));var fs=require('fs');var _=require(_0xc8c2('0x3'));var squel=require(_0xc8c2('0x4'));var Papa=require(_0xc8c2('0x5'));var Redis=require(_0xc8c2('0x6'));var qs=require(_0xc8c2('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0xc8c2('0x8'));var config=require(_0xc8c2('0x9'));var db=require(_0xc8c2('0xa'))['db'];config[_0xc8c2('0xb')]=_[_0xc8c2('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc8c2('0xd'))(new Redis(config['redis']));require(_0xc8c2('0xe'))[_0xc8c2('0xf')](socket);function respondWithResult(_0x4f552c,_0x14b4a9){_0x14b4a9=_0x14b4a9||0xc8;return function(_0x585d46){if(_0x585d46){return _0x4f552c[_0xc8c2('0x10')](_0x14b4a9)['json'](_0x585d46);}};}function respondWithFilteredResult(_0x3707cd,_0x3ac9dd){return function(_0x1a422f){if(_0x1a422f){var _0x13384b=typeof _0x3ac9dd[_0xc8c2('0x11')]===_0xc8c2('0x12')&&typeof _0x3ac9dd[_0xc8c2('0x13')]===_0xc8c2('0x12');var _0x134221=_0x1a422f['count'];var _0x970fa=_0x13384b?0x0:_0x3ac9dd[_0xc8c2('0x11')];var _0x1dedd8=_0x13384b?_0x1a422f['count']:_0x3ac9dd['offset']+_0x3ac9dd[_0xc8c2('0x13')];var _0x3cfaa9;if(_0x1dedd8>=_0x134221){_0x1dedd8=_0x134221;_0x3cfaa9=0xc8;}else{_0x3cfaa9=0xce;}_0x3707cd['status'](_0x3cfaa9);return _0x3707cd[_0xc8c2('0x14')]('Content-Range',_0x970fa+'-'+_0x1dedd8+'/'+_0x134221)[_0xc8c2('0x15')](_0x1a422f);}return null;};}function saveUpdates(_0x5d2116){return function(_0x53f204){if(_0x53f204){return _0x53f204['update'](_0x5d2116)[_0xc8c2('0x16')](function(_0x2661ca){return _0x2661ca;});}return null;};}function removeEntity(_0x8b7831){return function(_0x24f16e){if(_0x24f16e){return _0x24f16e[_0xc8c2('0x17')]()[_0xc8c2('0x16')](function(){_0x8b7831[_0xc8c2('0x10')](0xcc)[_0xc8c2('0x18')]();});}};}function handleEntityNotFound(_0x5cc697){return function(_0x31341d){if(!_0x31341d){_0x5cc697[_0xc8c2('0x19')](0x194);}return _0x31341d;};}function handleError(_0x56b08d,_0x15a316){_0x15a316=_0x15a316||0x1f4;return function(_0x446266){logger[_0xc8c2('0x1a')](_0x446266[_0xc8c2('0x1b')]);if(_0x446266[_0xc8c2('0x1c')]){delete _0x446266[_0xc8c2('0x1c')];}_0x56b08d[_0xc8c2('0x10')](_0x15a316)[_0xc8c2('0x1d')](_0x446266);};}exports[_0xc8c2('0x1e')]=function(_0x433fbc,_0x59b638){var _0x164053={},_0x1633c0={},_0x3e2f22={'count':0x0,'rows':[]};return db[_0xc8c2('0x1f')][_0xc8c2('0x20')]()[_0xc8c2('0x16')](function(_0x2860a4){var _0x4d40d4=[];for(var _0xec22c3=0x0;_0xec22c30x1){_0x12f7be['or'](_0xc8c2('0x62'),qs[_0xc8c2('0x63')](_0x3edff4),null);}else{if(qs['isNumeric'](_0x3edff4)){_0x12f7be['or'](_0xc8c2('0x64'),_0x3edff4+'%');_0x12f7be['or'](_0xc8c2('0x65'),_0x3edff4+'%');_0x12f7be['or']('c.mobile\x20LIKE\x20?',_0x3edff4+'%');_0x12f7be['or']('c.fax\x20LIKE\x20?',_0x3edff4+'%');}else if(qs[_0xc8c2('0x66')](_0x3edff4)){_0x12f7be['or'](_0xc8c2('0x67'),_0x3edff4+'%');}else{_0x12f7be['or'](_0xc8c2('0x68'),'%'+_0x3edff4+'%');_0x12f7be['or'](_0xc8c2('0x69'),'%'+_0x3edff4+'%');_0x12f7be['or'](_0xc8c2('0x67'),'%'+_0x3edff4+'%');}}}}_0xb05f88[_0xc8c2('0x34')](_0x12f7be);_0xb05f88[_0xc8c2('0x6a')](_0xc8c2('0x6b'));var _0x20cb13={'type':db[_0xc8c2('0x6c')][_0xc8c2('0x6d')]['SELECT'],'raw':!![]};var _0x3f041e=_0xb05f88[_0xc8c2('0x6e')]()['field'](_0xc8c2('0x6b'));if(_0x164053['order']){_0x164053[_0xc8c2('0x32')][_0xc8c2('0x4d')](function(_0x399c1b){_0xb05f88[_0xc8c2('0x32')]('c.'+_0x399c1b[0x0],_0x399c1b[0x1]===_0xc8c2('0x6f')?![]:!![]);});}if(!_[_0xc8c2('0x70')](_0x328141)){_0xb05f88[_0xc8c2('0x71')](_0xf457d4);_0x3f041e[_0xc8c2('0x34')](_0xc8c2('0x72'),_0x328141);}BPromise[_0xc8c2('0x73')]()[_0xc8c2('0x16')](function(){if(!_0x2687aa)return;if(_0x433fbc[_0xc8c2('0x74')][_0xc8c2('0x75')]!=='agent')return;if(!_[_0xc8c2('0x76')](_0x2687aa[_0xc8c2('0x47')],[_0xc8c2('0x37'),'User'])){return _0x433fbc[_0xc8c2('0x74')]['getLists']({'attributes':['id'],'raw':!![]})[_0xc8c2('0x16')](function(_0x3c0adb){if(_[_0xc8c2('0x70')](_0x3c0adb)){_0x3f041e[_0xc8c2('0x34')](_0xc8c2('0x77'));_0xb05f88['where'](_0xc8c2('0x77'));}else{_0x3f041e[_0xc8c2('0x34')](_0xc8c2('0x78'),_[_0xc8c2('0x4c')](_0x3c0adb,'id'));_0xb05f88['where'](_0xc8c2('0x78'),_['map'](_0x3c0adb,'id'));}});}})[_0xc8c2('0x16')](function(){if(_0x433fbc[_0xc8c2('0x74')]['role']===_0xc8c2('0x79')&&!_0x2687aa&&!_0x433fbc[_0xc8c2('0x2b')][_0xc8c2('0x5c')])return[];return db[_0xc8c2('0x7a')][_0xc8c2('0x2b')](_0x3f041e[_0xc8c2('0x7b')](),_0x20cb13);})[_0xc8c2('0x16')](function(_0x263bdb){_0x3e2f22[_0xc8c2('0x7c')]=_0x263bdb['length'];if(_0x3e2f22[_0xc8c2('0x7c')]===0x0)return[];return db[_0xc8c2('0x7a')][_0xc8c2('0x2b')](_0x22a90c['toString'](),_0x20cb13)['then'](function(_0x75ebb1){_0x33dd54=_[_0xc8c2('0x7d')](_0x75ebb1,'id');_0x20cb13=_[_0xc8c2('0x7e')](_0x20cb13,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x433fbc[_0xc8c2('0x2b')][_0xc8c2('0x2e')]){_0x164053[_0xc8c2('0x2f')]['forEach'](function(_0x3355fb){_0xb05f88[_0xc8c2('0x37')]('c.'+_0x3355fb);});}else{_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x6b'));_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x7f'));_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x80'));_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x81'));_0xb05f88[_0xc8c2('0x37')]('c.mobile');_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x82'));_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x83'));_0xb05f88[_0xc8c2('0x37')]('c.ListId');_0xb05f88[_0xc8c2('0x37')]('c.createdAt');_0xb05f88[_0xc8c2('0x37')]('c.deletedAt');_0xb05f88[_0xc8c2('0x37')]('c.CompanyId');_0xb05f88[_0xc8c2('0x37')](_0xc8c2('0x84'),'TagIds');}if(_0x164053[_0xc8c2('0x13')])_0xb05f88[_0xc8c2('0x13')](_0x164053[_0xc8c2('0x13')]);if(_0x164053['offset'])_0xb05f88[_0xc8c2('0x11')](_0x164053['offset']);return db[_0xc8c2('0x7a')][_0xc8c2('0x2b')](_0xb05f88[_0xc8c2('0x7b')](),_0x20cb13);});})[_0xc8c2('0x16')](function(_0x3e247a){_0x3e247a['forEach'](function(_0x59d45b){if(_0x59d45b[_0xc8c2('0x85')]){_0x59d45b[_0xc8c2('0x86')]=[];_0x59d45b[_0xc8c2('0x85')][_0xc8c2('0x4b')](',')[_0xc8c2('0x4d')](function(_0xd45d74){_0x59d45b[_0xc8c2('0x86')]['push'](_0x33dd54[_0xd45d74]);});}delete _0x59d45b['TagIds'];});_0x3e2f22[_0xc8c2('0x87')]=_0x3e247a;return _0x3e2f22;})[_0xc8c2('0x16')](respondWithFilteredResult(_0x59b638,_0x164053));})[_0xc8c2('0x88')](handleError(_0x59b638,null));};exports[_0xc8c2('0x17')]=function(_0x33ee90,_0x16363f){return db[_0xc8c2('0x1f')]['find']({'where':{'id':_0x33ee90[_0xc8c2('0x89')]['id']}})[_0xc8c2('0x16')](handleEntityNotFound(_0x16363f,null))[_0xc8c2('0x16')](removeEntity(_0x16363f,null))['catch'](handleError(_0x16363f,null));};exports['describe']=function(_0x128fa3,_0x678dad){return db[_0xc8c2('0x1f')][_0xc8c2('0x20')]()[_0xc8c2('0x16')](function(_0x3a60eb){delete _0x3a60eb[_0xc8c2('0x8a')];for(var _0x415046=0x0;_0x415046=_0x40d98f){_0x501273=_0x40d98f;_0x2f5764=0xc8;}else{_0x2f5764=0xce;}_0x231b4d[_0x2fcd('0x10')](_0x2f5764);return _0x231b4d[_0x2fcd('0x16')](_0x2fcd('0x17'),_0x48e9bb+'-'+_0x501273+'/'+_0x40d98f)['json'](_0x38bd86);}return null;};}function saveUpdates(_0x2e7002){return function(_0x12b6bf){if(_0x12b6bf){return _0x12b6bf[_0x2fcd('0x18')](_0x2e7002)[_0x2fcd('0x19')](function(_0x49039f){return _0x49039f;});}return null;};}function removeEntity(_0x215c9d){return function(_0x16c0aa){if(_0x16c0aa){return _0x16c0aa['destroy']()[_0x2fcd('0x19')](function(){_0x215c9d['status'](0xcc)[_0x2fcd('0x1a')]();});}};}function handleEntityNotFound(_0x285622){return function(_0x20cf54){if(!_0x20cf54){_0x285622[_0x2fcd('0x1b')](0x194);}return _0x20cf54;};}function handleError(_0x25f9f2,_0x1965e5){_0x1965e5=_0x1965e5||0x1f4;return function(_0x36eeab){logger[_0x2fcd('0x1c')](_0x36eeab['stack']);if(_0x36eeab[_0x2fcd('0x1d')]){delete _0x36eeab['name'];}_0x25f9f2[_0x2fcd('0x10')](_0x1965e5)[_0x2fcd('0x1e')](_0x36eeab);};}exports[_0x2fcd('0x1f')]=function(_0x264814,_0x161b65){var _0x16e5c7={},_0x7dbfac={},_0x2db6b5={'count':0x0,'rows':[]};return db[_0x2fcd('0x20')][_0x2fcd('0x21')]()[_0x2fcd('0x19')](function(_0x4704f0){var _0x285e20=[];for(var _0x509202=0x0;_0x5092020x1){_0x38fd58['or'](_0x2fcd('0x5f'),qs[_0x2fcd('0x60')](_0x315d99),null);}else{if(qs[_0x2fcd('0x61')](_0x315d99)){_0x38fd58['or']('c.id\x20LIKE\x20?',_0x315d99+'%');_0x38fd58['or']('c.phone\x20LIKE\x20?',_0x315d99+'%');_0x38fd58['or']('c.mobile\x20LIKE\x20?',_0x315d99+'%');_0x38fd58['or'](_0x2fcd('0x62'),_0x315d99+'%');}else if(qs[_0x2fcd('0x63')](_0x315d99)){_0x38fd58['or'](_0x2fcd('0x64'),_0x315d99+'%');}else{_0x38fd58['or'](_0x2fcd('0x65'),'%'+_0x315d99+'%');_0x38fd58['or'](_0x2fcd('0x66'),'%'+_0x315d99+'%');_0x38fd58['or']('c.email\x20LIKE\x20?','%'+_0x315d99+'%');}}}}_0x44a929[_0x2fcd('0x3c')](_0x38fd58);_0x44a929[_0x2fcd('0x67')](_0x2fcd('0x68'));var _0x295b36={'type':db['Sequelize'][_0x2fcd('0x69')]['SELECT'],'raw':!![]};var _0x1f501f=_0x44a929['clone']()[_0x2fcd('0x33')](_0x2fcd('0x68'));if(_0x16e5c7[_0x2fcd('0x2f')]){_0x16e5c7[_0x2fcd('0x2f')][_0x2fcd('0x48')](function(_0x45c9b7){_0x44a929['order']('c.'+_0x45c9b7[0x0],_0x45c9b7[0x1]===_0x2fcd('0x6a')?![]:!![]);});}if(!_[_0x2fcd('0x58')](_0x43afc0)){_0x44a929[_0x2fcd('0x6b')](_0x2aa699);_0x1f501f['where'](_0x2fcd('0x6c'),_0x43afc0);}BPromise[_0x2fcd('0x6d')]()['then'](function(){if(!_0xfe6779)return;if(_0x264814['user'][_0x2fcd('0x6e')]!==_0x2fcd('0x6f'))return;if(!_[_0x2fcd('0x70')](_0xfe6779['conditions'],[_0x2fcd('0x33'),_0x2fcd('0x71')])){return _0x264814[_0x2fcd('0x72')]['getLists']({'attributes':['id'],'raw':!![]})[_0x2fcd('0x19')](function(_0x15de64){if(_[_0x2fcd('0x58')](_0x15de64)){_0x1f501f[_0x2fcd('0x3c')](_0x2fcd('0x73'));_0x44a929[_0x2fcd('0x3c')](_0x2fcd('0x73'));}else{_0x1f501f['where'](_0x2fcd('0x5a'),_[_0x2fcd('0x47')](_0x15de64,'id'));_0x44a929['where']('c.ListId\x20IN\x20?',_[_0x2fcd('0x47')](_0x15de64,'id'));}});}})[_0x2fcd('0x19')](function(){if(_0x264814[_0x2fcd('0x72')][_0x2fcd('0x6e')]===_0x2fcd('0x6f')&&!_0xfe6779&&!_0x264814[_0x2fcd('0x2a')]['ListId'])return[];return db['sequelize'][_0x2fcd('0x2a')](_0x1f501f[_0x2fcd('0x74')](),_0x295b36);})[_0x2fcd('0x19')](function(_0x2f7230){_0x2db6b5['count']=_0x2f7230[_0x2fcd('0x23')];if(_0x2db6b5['count']===0x0)return[];return db['sequelize'][_0x2fcd('0x2a')](_0xb032a[_0x2fcd('0x74')](),_0x295b36)[_0x2fcd('0x19')](function(_0x3bfd9e){_0x1dd8af=_[_0x2fcd('0x75')](_0x3bfd9e,'id');_0x295b36=_[_0x2fcd('0x76')](_0x295b36,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x264814[_0x2fcd('0x2a')][_0x2fcd('0x2c')]){_0x16e5c7[_0x2fcd('0x2b')][_0x2fcd('0x48')](function(_0x26a06c){_0x44a929[_0x2fcd('0x33')]('c.'+_0x26a06c);});}else{_0x44a929[_0x2fcd('0x33')]('c.id');_0x44a929[_0x2fcd('0x33')]('c.firstName');_0x44a929[_0x2fcd('0x33')]('c.lastName');_0x44a929[_0x2fcd('0x33')](_0x2fcd('0x77'));_0x44a929['field'](_0x2fcd('0x78'));_0x44a929[_0x2fcd('0x33')]('c.fax');_0x44a929[_0x2fcd('0x33')](_0x2fcd('0x79'));_0x44a929[_0x2fcd('0x33')](_0x2fcd('0x7a'));_0x44a929[_0x2fcd('0x33')]('c.createdAt');_0x44a929[_0x2fcd('0x33')](_0x2fcd('0x7b'));_0x44a929[_0x2fcd('0x33')](_0x2fcd('0x7c'));_0x44a929[_0x2fcd('0x33')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2fcd('0x7d'));}if(_0x16e5c7[_0x2fcd('0x13')])_0x44a929[_0x2fcd('0x13')](_0x16e5c7[_0x2fcd('0x13')]);if(_0x16e5c7[_0x2fcd('0x15')])_0x44a929[_0x2fcd('0x15')](_0x16e5c7[_0x2fcd('0x15')]);return db['sequelize'][_0x2fcd('0x2a')](_0x44a929[_0x2fcd('0x74')](),_0x295b36);});})['then'](function(_0x5f46aa){_0x5f46aa[_0x2fcd('0x48')](function(_0x343eff){if(_0x343eff['TagIds']){_0x343eff['Tags']=[];_0x343eff[_0x2fcd('0x7d')][_0x2fcd('0x46')](',')[_0x2fcd('0x48')](function(_0x2f171e){_0x343eff[_0x2fcd('0x7e')][_0x2fcd('0x57')](_0x1dd8af[_0x2f171e]);});}delete _0x343eff[_0x2fcd('0x7d')];});_0x2db6b5[_0x2fcd('0x7f')]=_0x5f46aa;return _0x2db6b5;})['then'](respondWithFilteredResult(_0x161b65,_0x16e5c7));})[_0x2fcd('0x80')](handleError(_0x161b65,null));};exports[_0x2fcd('0x81')]=function(_0x5bf645,_0x493ec3){return db['CmContact'][_0x2fcd('0x43')]({'where':{'id':_0x5bf645['params']['id']}})['then'](handleEntityNotFound(_0x493ec3,null))[_0x2fcd('0x19')](removeEntity(_0x493ec3,null))['catch'](handleError(_0x493ec3,null));};exports[_0x2fcd('0x21')]=function(_0x1b6db4,_0x190d9d){return db[_0x2fcd('0x20')][_0x2fcd('0x21')]()[_0x2fcd('0x19')](function(_0x550761){delete _0x550761[_0x2fcd('0x82')];for(var _0x1394c3=0x0;_0x1394c3{}\s\\|]/g,'-');_0x42cde3(null,util['format'](_0x79b9('0x23'),path[_0x79b9('0x24')](_0xbf32f4[_0x79b9('0x21')],path['extname'](_0xbf32f4[_0x79b9('0x21')])),Date[_0x79b9('0x25')](),path['extname'](_0xbf32f4[_0x79b9('0x21')])));}})});router[_0x79b9('0x1a')]('/csv',upload['single'](_0x79b9('0x26')),controller[_0x79b9('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12b28a,_0x2d1f86,_0x3ab551){_0x3ab551(null,path[_0x79b9('0x1f')](config[_0x79b9('0x20')],'server/files/tmp'));},'filename':function(_0x4b40af,_0x20190e,_0x2cc96f){_0x20190e[_0x79b9('0x21')]=_0x20190e[_0x79b9('0x21')][_0x79b9('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2cc96f(null,util[_0x79b9('0x28')]('%s-%s%s',path[_0x79b9('0x24')](_0x20190e[_0x79b9('0x21')],path['extname'](_0x20190e['originalname'])),Date[_0x79b9('0x25')](),path['extname'](_0x20190e[_0x79b9('0x21')])));}})});router[_0x79b9('0x1a')]('/upload',upload[_0x79b9('0x29')](_0x79b9('0x26')),controller['upload']);router[_0x79b9('0x1a')]('/upload/:id',auth['isAuthenticated'](),controller['import']);router['put'](_0x79b9('0x2a'),auth[_0x79b9('0x9')](),controller[_0x79b9('0x2b')]);router[_0x79b9('0x2c')](_0x79b9('0x2a'),auth['isAuthenticated'](),controller[_0x79b9('0x2d')]);module['exports']=router; \ No newline at end of file +var _0xaa2c=['update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','single','file','uploadCsv','now','/upload','/upload/:id','put'];(function(_0x1a33fd,_0x2890b0){var _0x38cec3=function(_0x1466f9){while(--_0x1466f9){_0x1a33fd['push'](_0x1a33fd['shift']());}};_0x38cec3(++_0x2890b0);}(_0xaa2c,0x19b));var _0xcaa2=function(_0x4da5b2,_0x44b94b){_0x4da5b2=_0x4da5b2-0x0;var _0x5b3289=_0xaa2c[_0x4da5b2];return _0x5b3289;};'use strict';var multer=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var path=require('path');var timeout=require(_0xcaa2('0x2'));var express=require(_0xcaa2('0x3'));var router=express['Router']();var fs_extra=require(_0xcaa2('0x4'));var auth=require(_0xcaa2('0x5'));var interaction=require(_0xcaa2('0x6'));var config=require(_0xcaa2('0x7'));var controller=require(_0xcaa2('0x8'));router[_0xcaa2('0x9')]('/',auth[_0xcaa2('0xa')](),controller[_0xcaa2('0xb')]);router[_0xcaa2('0x9')](_0xcaa2('0xc'),auth[_0xcaa2('0xa')](),controller[_0xcaa2('0xd')]);router[_0xcaa2('0x9')](_0xcaa2('0xe'),auth['isAuthenticated'](),controller[_0xcaa2('0xf')]);router[_0xcaa2('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0xcaa2('0x10')]);router[_0xcaa2('0x9')](_0xcaa2('0x11'),auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x12')]);router[_0xcaa2('0x9')](_0xcaa2('0x13'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xcaa2('0x9')]('/:id/hopper_finals',auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x14')]);router['get']('/:id/jscripty_sessions',auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x15')]);router[_0xcaa2('0x9')](_0xcaa2('0x16'),auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x17')]);router[_0xcaa2('0x18')](_0xcaa2('0x19'),auth['isAuthenticated'](),controller[_0xcaa2('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcaa2('0x1b')]);router[_0xcaa2('0x18')](_0xcaa2('0x1c'),auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x1d')]);router[_0xcaa2('0x18')](_0xcaa2('0x1e'),auth[_0xcaa2('0xa')](),controller[_0xcaa2('0x1f')]);var upload=multer({'storage':multer[_0xcaa2('0x20')]({'destination':function(_0x1d29ae,_0x5a150c,_0x919e07){_0x919e07(null,path['join'](config[_0xcaa2('0x21')],_0xcaa2('0x22')));},'filename':function(_0x23739b,_0x4f70b0,_0x4d4fdf){_0x4f70b0[_0xcaa2('0x23')]=_0x4f70b0[_0xcaa2('0x23')][_0xcaa2('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d4fdf(null,util[_0xcaa2('0x25')](_0xcaa2('0x26'),path[_0xcaa2('0x27')](_0x4f70b0['originalname'],path[_0xcaa2('0x28')](_0x4f70b0[_0xcaa2('0x23')])),Date['now'](),path['extname'](_0x4f70b0[_0xcaa2('0x23')])));}})});router['post']('/csv',upload[_0xcaa2('0x29')](_0xcaa2('0x2a')),controller[_0xcaa2('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2bdf90,_0xd2b246,_0x17c253){_0x17c253(null,path['join'](config['root'],_0xcaa2('0x22')));},'filename':function(_0x43ebc4,_0x5c40a0,_0x142170){_0x5c40a0[_0xcaa2('0x23')]=_0x5c40a0[_0xcaa2('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x142170(null,util['format'](_0xcaa2('0x26'),path[_0xcaa2('0x27')](_0x5c40a0['originalname'],path[_0xcaa2('0x28')](_0x5c40a0[_0xcaa2('0x23')])),Date[_0xcaa2('0x2c')](),path[_0xcaa2('0x28')](_0x5c40a0['originalname'])));}})});router[_0xcaa2('0x18')](_0xcaa2('0x2d'),upload[_0xcaa2('0x29')](_0xcaa2('0x2a')),controller['upload']);router['post'](_0xcaa2('0x2e'),auth[_0xcaa2('0xa')](),controller['import']);router[_0xcaa2('0x2f')](_0xcaa2('0xe'),auth['isAuthenticated'](),controller[_0xcaa2('0x30')]);router['delete'](_0xcaa2('0xe'),auth['isAuthenticated'](),controller[_0xcaa2('0x31')]);module[_0xcaa2('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index bf51c70..3f79e67 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 _0x9ac6=['type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','getDataValue','long'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9ac6,0x80));var _0x69ac=function(_0x343d48,_0x35eb64){_0x343d48=_0x343d48-0x0;var _0x5e9991=_0x9ac6[_0x343d48];return _0x5e9991;};'use strict';var Sequelize=require(_0x69ac('0x0'));var _=require(_0x69ac('0x1'));module[_0x69ac('0x2')]={'name':{'type':Sequelize[_0x69ac('0x3')],'get':function(_0x500043){return this['getDataValue'](_0x69ac('0x4'));}},'alias':{'type':Sequelize[_0x69ac('0x5')],'allowNull':![],'set':function(_0x5872fc){this['setDataValue']('alias',_0x5872fc?_0x5872fc:this[_0x69ac('0x6')]('name'));}},'type':{'type':Sequelize[_0x69ac('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x69ac('0x7')),'get':function(){if(this[_0x69ac('0x6')](_0x69ac('0x8'))===_0x69ac('0x9')){return JSON[_0x69ac('0xa')](this['getDataValue'](_0x69ac('0xb')));}else{return this[_0x69ac('0x6')](_0x69ac('0xb'));}},'set':function(_0x2f3ffa){if(Array[_0x69ac('0xc')](_0x2f3ffa)){this[_0x69ac('0xd')](_0x69ac('0xb'),JSON[_0x69ac('0xe')](_0x2f3ffa));}else{this[_0x69ac('0xd')]('values',_0x2f3ffa);}}},'required':{'type':Sequelize[_0x69ac('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x69ac('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x69ac('0x10'))}}; \ No newline at end of file +var _0xac48=['select','parse','values','stringify','BOOLEAN','ENUM','sequelize','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xac48,0x1d7));var _0x8ac4=function(_0x1cf741,_0x500e62){_0x1cf741=_0x1cf741-0x0;var _0x2453a6=_0xac48[_0x1cf741];return _0x2453a6;};'use strict';var Sequelize=require(_0x8ac4('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x8ac4('0x1')],'get':function(_0x1cda6b){return this[_0x8ac4('0x2')](_0x8ac4('0x3'));}},'alias':{'type':Sequelize[_0x8ac4('0x4')],'allowNull':![],'set':function(_0x3debf2){this[_0x8ac4('0x5')]('alias',_0x3debf2?_0x3debf2:this[_0x8ac4('0x2')]('name'));}},'type':{'type':Sequelize[_0x8ac4('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x8ac4('0x6')](_0x8ac4('0x7')),'get':function(){if(this[_0x8ac4('0x2')](_0x8ac4('0x8'))===_0x8ac4('0x9')){return JSON[_0x8ac4('0xa')](this[_0x8ac4('0x2')]('values'));}else{return this[_0x8ac4('0x2')](_0x8ac4('0xb'));}},'set':function(_0x2ed0f6){if(Array['isArray'](_0x2ed0f6)){this['setDataValue'](_0x8ac4('0xb'),JSON[_0x8ac4('0xc')](_0x2ed0f6));}else{this[_0x8ac4('0x5')](_0x8ac4('0xb'),_0x2ed0f6);}}},'required':{'type':Sequelize[_0x8ac4('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8ac4('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8ac4('0xe')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 0a906a1..92a107b 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 _0x8605=['options','count','includeAll','rows','params','find','catch','body','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','apply','save','update','then','destroy','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter'];(function(_0x3dd76d,_0x4d1c5f){var _0x2abc3c=function(_0x467c5d){while(--_0x467c5d){_0x3dd76d['push'](_0x3dd76d['shift']());}};_0x2abc3c(++_0x4d1c5f);}(_0x8605,0x71));var _0x5860=function(_0x5009d8,_0x4e3552){_0x5009d8=_0x5009d8-0x0;var _0x13cd20=_0x8605[_0x5009d8];return _0x13cd20;};'use strict';var emlformat=require(_0x5860('0x0'));var rimraf=require(_0x5860('0x1'));var zipdir=require(_0x5860('0x2'));var jsonpatch=require(_0x5860('0x3'));var rp=require(_0x5860('0x4'));var moment=require('moment');var BPromise=require(_0x5860('0x5'));var Mustache=require(_0x5860('0x6'));var util=require(_0x5860('0x7'));var path=require(_0x5860('0x8'));var sox=require(_0x5860('0x9'));var csv=require(_0x5860('0xa'));var ejs=require(_0x5860('0xb'));var fs=require('fs');var fs_extra=require(_0x5860('0xc'));var _=require(_0x5860('0xd'));var squel=require(_0x5860('0xe'));var crypto=require(_0x5860('0xf'));var jsforce=require(_0x5860('0x10'));var deskjs=require(_0x5860('0x11'));var toCsv=require(_0x5860('0xa'));var querystring=require(_0x5860('0x12'));var Papa=require(_0x5860('0x13'));var Redis=require(_0x5860('0x14'));var authService=require(_0x5860('0x15'));var qs=require(_0x5860('0x16'));var as=require(_0x5860('0x17'));var hardwareService=require(_0x5860('0x18'));var logger=require(_0x5860('0x19'))(_0x5860('0x1a'));var utils=require('../../config/utils');var config=require(_0x5860('0x1b'));var licenseUtil=require(_0x5860('0x1c'));var db=require(_0x5860('0x1d'))['db'];function respondWithStatusCode(_0x116340,_0x4ea776){_0x4ea776=_0x4ea776||0xcc;return function(_0xf3f48d){if(_0xf3f48d){return _0x116340[_0x5860('0x1e')](_0x4ea776);}return _0x116340[_0x5860('0x1f')](_0x4ea776)['end']();};}function respondWithResult(_0x70bf10,_0x1b325a){_0x1b325a=_0x1b325a||0xc8;return function(_0x364e42){if(_0x364e42){return _0x70bf10[_0x5860('0x1f')](_0x1b325a)[_0x5860('0x20')](_0x364e42);}};}function respondWithFilteredResult(_0x114bf0,_0x2cbb59){return function(_0x74e0d5){if(_0x74e0d5){var _0x12d4f1=typeof _0x2cbb59[_0x5860('0x21')]===_0x5860('0x22')&&typeof _0x2cbb59['limit']==='undefined';var _0x478dc4=_0x74e0d5['count'];var _0x28a30e=_0x12d4f1?0x0:_0x2cbb59['offset'];var _0x1ce1f8=_0x12d4f1?_0x74e0d5['count']:_0x2cbb59['offset']+_0x2cbb59['limit'];var _0x1b193a;if(_0x1ce1f8>=_0x478dc4){_0x1ce1f8=_0x478dc4;_0x1b193a=0xc8;}else{_0x1b193a=0xce;}_0x114bf0['status'](_0x1b193a);return _0x114bf0['set']('Content-Range',_0x28a30e+'-'+_0x1ce1f8+'/'+_0x478dc4)[_0x5860('0x20')](_0x74e0d5);}return null;};}function patchUpdates(_0x24a472){return function(_0x52e058){try{jsonpatch[_0x5860('0x23')](_0x52e058,_0x24a472,!![]);}catch(_0x291027){return BPromise['reject'](_0x291027);}return _0x52e058[_0x5860('0x24')]();};}function saveUpdates(_0x254f07,_0x11f204){return function(_0x4ec0c7){if(_0x4ec0c7){return _0x4ec0c7[_0x5860('0x25')](_0x254f07)[_0x5860('0x26')](function(_0x2ad4b9){return _0x2ad4b9;});}return null;};}function removeEntity(_0x26a50e,_0x470295){return function(_0x2f4df2){if(_0x2f4df2){return _0x2f4df2[_0x5860('0x27')]()['then'](function(){_0x26a50e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dfd9,_0x525a4d){return function(_0x4aad57){if(!_0x4aad57){_0x41dfd9[_0x5860('0x1e')](0x194);}return _0x4aad57;};}function handleError(_0x3455d7,_0x2fe248){_0x2fe248=_0x2fe248||0x1f4;return function(_0xf86b0b){logger['error'](_0xf86b0b[_0x5860('0x28')]);if(_0xf86b0b[_0x5860('0x29')]){delete _0xf86b0b[_0x5860('0x29')];}_0x3455d7[_0x5860('0x1f')](_0x2fe248)[_0x5860('0x2a')](_0xf86b0b);};}exports[_0x5860('0x2b')]=function(_0x104ab0,_0x421276){var _0x478d34={},_0x44d8fc={},_0x79d519={'count':0x0,'rows':[]};var _0x3b3baa=_[_0x5860('0x2c')](db[_0x5860('0x2d')][_0x5860('0x2e')],function(_0x437cdf){return{'name':_0x437cdf[_0x5860('0x2f')],'type':_0x437cdf[_0x5860('0x30')][_0x5860('0x31')]};});_0x44d8fc['model']=_[_0x5860('0x32')](_[_0x5860('0x2c')](_0x3b3baa,_0x5860('0x29')),[_0x5860('0x29')]);_0x44d8fc[_0x5860('0x33')]=_[_0x5860('0x34')](_0x104ab0[_0x5860('0x33')]);_0x44d8fc[_0x5860('0x35')]=_[_0x5860('0x36')](_0x44d8fc['model'],_0x44d8fc[_0x5860('0x33')]);_0x478d34[_0x5860('0x37')]=_[_0x5860('0x36')](_0x44d8fc[_0x5860('0x38')],qs[_0x5860('0x39')](_0x104ab0[_0x5860('0x33')][_0x5860('0x39')]));_0x478d34[_0x5860('0x37')]=_0x478d34[_0x5860('0x37')][_0x5860('0x3a')]?_0x478d34['attributes']:_0x44d8fc[_0x5860('0x38')];if(!_0x104ab0['query'][_0x5860('0x3b')](_0x5860('0x3c'))){_0x478d34[_0x5860('0x3d')]=qs[_0x5860('0x3d')](_0x104ab0[_0x5860('0x33')][_0x5860('0x3d')]);_0x478d34[_0x5860('0x21')]=qs[_0x5860('0x21')](_0x104ab0[_0x5860('0x33')]['offset']);}_0x478d34[_0x5860('0x3e')]=qs[_0x5860('0x3f')](_0x104ab0['query'][_0x5860('0x3f')]);_0x478d34['where']=qs[_0x5860('0x35')](_[_0x5860('0x40')](_0x104ab0[_0x5860('0x33')],_0x44d8fc[_0x5860('0x35')]),_0x3b3baa);if(_0x104ab0[_0x5860('0x33')]['filter']){_0x478d34[_0x5860('0x41')]=_[_0x5860('0x42')](_0x478d34['where'],{'$or':_[_0x5860('0x2c')](_0x3b3baa,function(_0x393d18){if(_0x393d18['type']!==_0x5860('0x43')){var _0x3342cd={};_0x3342cd[_0x393d18[_0x5860('0x29')]]={'$like':'%'+_0x104ab0[_0x5860('0x33')][_0x5860('0x44')]+'%'};return _0x3342cd;}})});}_0x478d34=_[_0x5860('0x42')]({},_0x478d34,_0x104ab0[_0x5860('0x45')]);var _0x4860a8={'where':_0x478d34[_0x5860('0x41')]};return db[_0x5860('0x2d')]['count'](_0x4860a8)[_0x5860('0x26')](function(_0x259ca6){_0x79d519[_0x5860('0x46')]=_0x259ca6;if(_0x104ab0[_0x5860('0x33')][_0x5860('0x47')]){_0x478d34['include']=[{'all':!![]}];}return db[_0x5860('0x2d')]['findAll'](_0x478d34);})[_0x5860('0x26')](function(_0x98ec94){_0x79d519[_0x5860('0x48')]=_0x98ec94;return _0x79d519;})[_0x5860('0x26')](respondWithFilteredResult(_0x421276,_0x478d34))['catch'](handleError(_0x421276,null));};exports['show']=function(_0x1bc7af,_0x5c3134){var _0x3b3c7f={'raw':!![],'where':{'id':_0x1bc7af[_0x5860('0x49')]['id']}},_0x3399ce={};_0x3399ce[_0x5860('0x38')]=_[_0x5860('0x34')](db[_0x5860('0x2d')]['rawAttributes']);_0x3399ce[_0x5860('0x33')]=_['keys'](_0x1bc7af[_0x5860('0x33')]);_0x3399ce['filters']=_[_0x5860('0x36')](_0x3399ce[_0x5860('0x38')],_0x3399ce[_0x5860('0x33')]);_0x3b3c7f['attributes']=_['intersection'](_0x3399ce[_0x5860('0x38')],qs['fields'](_0x1bc7af[_0x5860('0x33')][_0x5860('0x39')]));_0x3b3c7f[_0x5860('0x37')]=_0x3b3c7f['attributes'][_0x5860('0x3a')]?_0x3b3c7f[_0x5860('0x37')]:_0x3399ce['model'];if(_0x1bc7af[_0x5860('0x33')][_0x5860('0x47')]){_0x3b3c7f['include']=[{'all':!![]}];}_0x3b3c7f=_[_0x5860('0x42')]({},_0x3b3c7f,_0x1bc7af['options']);return db[_0x5860('0x2d')][_0x5860('0x4a')](_0x3b3c7f)['then'](handleEntityNotFound(_0x5c3134,null))[_0x5860('0x26')](respondWithResult(_0x5c3134,null))[_0x5860('0x4b')](handleError(_0x5c3134,null));};exports[_0x5860('0x25')]=function(_0x33ebee,_0x438f71){if(_0x33ebee[_0x5860('0x4c')]['id']){delete _0x33ebee[_0x5860('0x4c')]['id'];}return db[_0x5860('0x2d')][_0x5860('0x4a')]({'where':{'id':_0x33ebee[_0x5860('0x49')]['id']}})[_0x5860('0x26')](handleEntityNotFound(_0x438f71,null))[_0x5860('0x26')](saveUpdates(_0x33ebee[_0x5860('0x4c')],null))[_0x5860('0x26')](respondWithResult(_0x438f71,null))['catch'](handleError(_0x438f71,null));};exports[_0x5860('0x27')]=function(_0x5d9ffa,_0x37a30b){return db['CmCustomField'][_0x5860('0x4a')]({'where':{'id':_0x5d9ffa[_0x5860('0x49')]['id']}})[_0x5860('0x26')](handleEntityNotFound(_0x37a30b,null))[_0x5860('0x26')](removeEntity(_0x37a30b,null))[_0x5860('0x4b')](handleError(_0x37a30b,null));};exports['create']=function(_0x3e7efd,_0x299b28){var _0x2485ef;return db[_0x5860('0x4d')][_0x5860('0x4e')](function(_0x26485f){return db[_0x5860('0x2d')][_0x5860('0x4f')](_0x3e7efd[_0x5860('0x4c')],{'transaction':_0x26485f})[_0x5860('0x26')](function(_0x286c4e){_0x2485ef=_0x286c4e;var _0x4fa1c4={'type':db[_0x5860('0x50')][_0x5860('0x51')],'transaction':_0x26485f};switch(_0x3e7efd[_0x5860('0x4c')][_0x5860('0x30')]){case _0x5860('0x52'):_0x4fa1c4[_0x5860('0x30')]=db['Sequelize']['TEXT'];break;case _0x5860('0x53'):_0x4fa1c4[_0x5860('0x30')]=db[_0x5860('0x50')][_0x5860('0x54')];break;case _0x5860('0x55'):_0x4fa1c4[_0x5860('0x30')]=db[_0x5860('0x50')]['BOOLEAN'];_0x4fa1c4[_0x5860('0x56')]=![];break;default:}return db['sequelize'][_0x5860('0x57')][_0x5860('0x58')]('cm_contacts',util[_0x5860('0x59')](_0x5860('0x5a'),_0x2485ef['id']),_0x4fa1c4);})['then'](function(){return _0x2485ef;});})[_0x5860('0x26')](respondWithResult(_0x299b28,0xc9))[_0x5860('0x4b')](handleError(_0x299b28,null));}; \ No newline at end of file +var _0xb6cc=['switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','index','rawAttributes','fieldName','model','differenceBy','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','CmCustomField','includeAll','include','rows','catch','params','keys','options','find','body','create','text','Sequelize','TEXT','INTEGER'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0xb6cc,0x14f));var _0xcb6c=function(_0x5aee10,_0x56f9b4){_0x5aee10=_0x5aee10-0x0;var _0xe4f2e7=_0xb6cc[_0x5aee10];return _0xe4f2e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb6c('0x0'));var zipdir=require(_0xcb6c('0x1'));var jsonpatch=require(_0xcb6c('0x2'));var rp=require(_0xcb6c('0x3'));var moment=require(_0xcb6c('0x4'));var BPromise=require(_0xcb6c('0x5'));var Mustache=require(_0xcb6c('0x6'));var util=require(_0xcb6c('0x7'));var path=require('path');var sox=require(_0xcb6c('0x8'));var csv=require('to-csv');var ejs=require(_0xcb6c('0x9'));var fs=require('fs');var fs_extra=require(_0xcb6c('0xa'));var _=require(_0xcb6c('0xb'));var squel=require(_0xcb6c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb6c('0xe'));var Papa=require(_0xcb6c('0xf'));var Redis=require('ioredis');var authService=require(_0xcb6c('0x10'));var qs=require(_0xcb6c('0x11'));var as=require(_0xcb6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb6c('0x13'))(_0xcb6c('0x14'));var utils=require(_0xcb6c('0x15'));var config=require(_0xcb6c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb6c('0x17'))['db'];function respondWithStatusCode(_0x353781,_0x38be66){_0x38be66=_0x38be66||0xcc;return function(_0x181c6d){if(_0x181c6d){return _0x353781[_0xcb6c('0x18')](_0x38be66);}return _0x353781[_0xcb6c('0x19')](_0x38be66)['end']();};}function respondWithResult(_0x1c137b,_0x54883a){_0x54883a=_0x54883a||0xc8;return function(_0x3aefa5){if(_0x3aefa5){return _0x1c137b[_0xcb6c('0x19')](_0x54883a)['json'](_0x3aefa5);}};}function respondWithFilteredResult(_0x51f918,_0x698d2){return function(_0x31d19e){if(_0x31d19e){var _0x3ecaba=typeof _0x698d2[_0xcb6c('0x1a')]===_0xcb6c('0x1b')&&typeof _0x698d2[_0xcb6c('0x1c')]===_0xcb6c('0x1b');var _0x194e3c=_0x31d19e[_0xcb6c('0x1d')];var _0x240688=_0x3ecaba?0x0:_0x698d2[_0xcb6c('0x1a')];var _0x11edb4=_0x3ecaba?_0x31d19e[_0xcb6c('0x1d')]:_0x698d2[_0xcb6c('0x1a')]+_0x698d2[_0xcb6c('0x1c')];var _0x3b5681;if(_0x11edb4>=_0x194e3c){_0x11edb4=_0x194e3c;_0x3b5681=0xc8;}else{_0x3b5681=0xce;}_0x51f918['status'](_0x3b5681);return _0x51f918[_0xcb6c('0x1e')](_0xcb6c('0x1f'),_0x240688+'-'+_0x11edb4+'/'+_0x194e3c)[_0xcb6c('0x20')](_0x31d19e);}return null;};}function patchUpdates(_0x226b21){return function(_0xab8c5b){try{jsonpatch[_0xcb6c('0x21')](_0xab8c5b,_0x226b21,!![]);}catch(_0xa3b035){return BPromise[_0xcb6c('0x22')](_0xa3b035);}return _0xab8c5b[_0xcb6c('0x23')]();};}function saveUpdates(_0x4efaf3,_0x1003f6){return function(_0x68a9a9){if(_0x68a9a9){return _0x68a9a9[_0xcb6c('0x24')](_0x4efaf3)[_0xcb6c('0x25')](function(_0x3b3bda){return _0x3b3bda;});}return null;};}function removeEntity(_0x3da327,_0x2cab98){return function(_0x1809f8){if(_0x1809f8){return _0x1809f8[_0xcb6c('0x26')]()[_0xcb6c('0x25')](function(){_0x3da327[_0xcb6c('0x19')](0xcc)[_0xcb6c('0x27')]();});}};}function handleEntityNotFound(_0x2b7ab2,_0x5a24fd){return function(_0x1c6f0d){if(!_0x1c6f0d){_0x2b7ab2['sendStatus'](0x194);}return _0x1c6f0d;};}function handleError(_0x51cd85,_0x4c52b9){_0x4c52b9=_0x4c52b9||0x1f4;return function(_0x24a15a){logger['error'](_0x24a15a['stack']);if(_0x24a15a[_0xcb6c('0x28')]){delete _0x24a15a[_0xcb6c('0x28')];}_0x51cd85[_0xcb6c('0x19')](_0x4c52b9)['send'](_0x24a15a);};}exports[_0xcb6c('0x29')]=function(_0x31f4bc,_0x4cb79b){var _0x465086={},_0x36e5c1={},_0x2f5574={'count':0x0,'rows':[]};var _0x745913=_['map'](db['CmCustomField'][_0xcb6c('0x2a')],function(_0x2adb54){return{'name':_0x2adb54[_0xcb6c('0x2b')],'type':_0x2adb54['type']['key']};});_0x36e5c1[_0xcb6c('0x2c')]=_[_0xcb6c('0x2d')](_[_0xcb6c('0x2e')](_0x745913,_0xcb6c('0x28')),[_0xcb6c('0x28')]);_0x36e5c1[_0xcb6c('0x2f')]=_['keys'](_0x31f4bc[_0xcb6c('0x2f')]);_0x36e5c1[_0xcb6c('0x30')]=_[_0xcb6c('0x31')](_0x36e5c1[_0xcb6c('0x2c')],_0x36e5c1[_0xcb6c('0x2f')]);_0x465086[_0xcb6c('0x32')]=_['intersection'](_0x36e5c1[_0xcb6c('0x2c')],qs['fields'](_0x31f4bc[_0xcb6c('0x2f')][_0xcb6c('0x33')]));_0x465086[_0xcb6c('0x32')]=_0x465086[_0xcb6c('0x32')][_0xcb6c('0x34')]?_0x465086[_0xcb6c('0x32')]:_0x36e5c1[_0xcb6c('0x2c')];if(!_0x31f4bc[_0xcb6c('0x2f')]['hasOwnProperty'](_0xcb6c('0x35'))){_0x465086['limit']=qs[_0xcb6c('0x1c')](_0x31f4bc[_0xcb6c('0x2f')][_0xcb6c('0x1c')]);_0x465086['offset']=qs[_0xcb6c('0x1a')](_0x31f4bc[_0xcb6c('0x2f')][_0xcb6c('0x1a')]);}_0x465086['order']=qs['sort'](_0x31f4bc[_0xcb6c('0x2f')][_0xcb6c('0x36')]);_0x465086[_0xcb6c('0x37')]=qs[_0xcb6c('0x30')](_['pick'](_0x31f4bc[_0xcb6c('0x2f')],_0x36e5c1[_0xcb6c('0x30')]),_0x745913);if(_0x31f4bc['query'][_0xcb6c('0x38')]){_0x465086[_0xcb6c('0x37')]=_[_0xcb6c('0x39')](_0x465086[_0xcb6c('0x37')],{'$or':_[_0xcb6c('0x2e')](_0x745913,function(_0x48cb21){if(_0x48cb21[_0xcb6c('0x3a')]!==_0xcb6c('0x3b')){var _0x3c43af={};_0x3c43af[_0x48cb21[_0xcb6c('0x28')]]={'$like':'%'+_0x31f4bc['query'][_0xcb6c('0x38')]+'%'};return _0x3c43af;}})});}_0x465086=_[_0xcb6c('0x39')]({},_0x465086,_0x31f4bc['options']);var _0x17df9f={'where':_0x465086['where']};return db[_0xcb6c('0x3c')][_0xcb6c('0x1d')](_0x17df9f)['then'](function(_0x1027ac){_0x2f5574[_0xcb6c('0x1d')]=_0x1027ac;if(_0x31f4bc[_0xcb6c('0x2f')][_0xcb6c('0x3d')]){_0x465086[_0xcb6c('0x3e')]=[{'all':!![]}];}return db[_0xcb6c('0x3c')]['findAll'](_0x465086);})['then'](function(_0x6a61b2){_0x2f5574[_0xcb6c('0x3f')]=_0x6a61b2;return _0x2f5574;})['then'](respondWithFilteredResult(_0x4cb79b,_0x465086))[_0xcb6c('0x40')](handleError(_0x4cb79b,null));};exports['show']=function(_0x132e8e,_0x40f7c0){var _0x5e0fbd={'raw':!![],'where':{'id':_0x132e8e[_0xcb6c('0x41')]['id']}},_0x10f235={};_0x10f235[_0xcb6c('0x2c')]=_[_0xcb6c('0x42')](db[_0xcb6c('0x3c')][_0xcb6c('0x2a')]);_0x10f235[_0xcb6c('0x2f')]=_[_0xcb6c('0x42')](_0x132e8e[_0xcb6c('0x2f')]);_0x10f235['filters']=_[_0xcb6c('0x31')](_0x10f235['model'],_0x10f235[_0xcb6c('0x2f')]);_0x5e0fbd[_0xcb6c('0x32')]=_['intersection'](_0x10f235[_0xcb6c('0x2c')],qs['fields'](_0x132e8e['query'][_0xcb6c('0x33')]));_0x5e0fbd['attributes']=_0x5e0fbd[_0xcb6c('0x32')][_0xcb6c('0x34')]?_0x5e0fbd[_0xcb6c('0x32')]:_0x10f235[_0xcb6c('0x2c')];if(_0x132e8e[_0xcb6c('0x2f')][_0xcb6c('0x3d')]){_0x5e0fbd[_0xcb6c('0x3e')]=[{'all':!![]}];}_0x5e0fbd=_[_0xcb6c('0x39')]({},_0x5e0fbd,_0x132e8e[_0xcb6c('0x43')]);return db[_0xcb6c('0x3c')][_0xcb6c('0x44')](_0x5e0fbd)[_0xcb6c('0x25')](handleEntityNotFound(_0x40f7c0,null))[_0xcb6c('0x25')](respondWithResult(_0x40f7c0,null))[_0xcb6c('0x40')](handleError(_0x40f7c0,null));};exports[_0xcb6c('0x24')]=function(_0x4e41a2,_0x3cac7c){if(_0x4e41a2[_0xcb6c('0x45')]['id']){delete _0x4e41a2[_0xcb6c('0x45')]['id'];}return db[_0xcb6c('0x3c')][_0xcb6c('0x44')]({'where':{'id':_0x4e41a2[_0xcb6c('0x41')]['id']}})['then'](handleEntityNotFound(_0x3cac7c,null))[_0xcb6c('0x25')](saveUpdates(_0x4e41a2['body'],null))[_0xcb6c('0x25')](respondWithResult(_0x3cac7c,null))[_0xcb6c('0x40')](handleError(_0x3cac7c,null));};exports['destroy']=function(_0x527f22,_0x3947fb){return db[_0xcb6c('0x3c')][_0xcb6c('0x44')]({'where':{'id':_0x527f22[_0xcb6c('0x41')]['id']}})[_0xcb6c('0x25')](handleEntityNotFound(_0x3947fb,null))['then'](removeEntity(_0x3947fb,null))[_0xcb6c('0x40')](handleError(_0x3947fb,null));};exports[_0xcb6c('0x46')]=function(_0x265a52,_0x5d23aa){var _0x52ed6b;return db['sequelize']['transaction'](function(_0x5f5ad2){return db[_0xcb6c('0x3c')][_0xcb6c('0x46')](_0x265a52[_0xcb6c('0x45')],{'transaction':_0x5f5ad2})['then'](function(_0x4d27c9){_0x52ed6b=_0x4d27c9;var _0x51dad7={'type':db['Sequelize']['TEXT'],'transaction':_0x5f5ad2};switch(_0x265a52[_0xcb6c('0x45')][_0xcb6c('0x3a')]){case _0xcb6c('0x47'):_0x51dad7[_0xcb6c('0x3a')]=db[_0xcb6c('0x48')][_0xcb6c('0x49')];break;case'number':_0x51dad7[_0xcb6c('0x3a')]=db[_0xcb6c('0x48')][_0xcb6c('0x4a')];break;case _0xcb6c('0x4b'):_0x51dad7[_0xcb6c('0x3a')]=db['Sequelize']['BOOLEAN'];_0x51dad7[_0xcb6c('0x4c')]=![];break;default:}return db[_0xcb6c('0x4d')][_0xcb6c('0x4e')][_0xcb6c('0x4f')](_0xcb6c('0x50'),util[_0xcb6c('0x51')]('cf_%d',_0x52ed6b['id']),_0x51dad7);})['then'](function(){return _0x52ed6b;});})[_0xcb6c('0x25')](respondWithResult(_0x5d23aa,0xc9))[_0xcb6c('0x40')](handleError(_0x5d23aa,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e6cf8b5..995fa66 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 _0x6b63=['./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b63,0x73));var _0x36b6=function(_0xbf07f7,_0x3c8e6e){_0xbf07f7=_0xbf07f7-0x0;var _0x85f010=_0x6b63[_0xbf07f7];return _0x85f010;};'use strict';var _=require(_0x36b6('0x0'));var util=require(_0x36b6('0x1'));var logger=require('../../config/logger')(_0x36b6('0x2'));var moment=require(_0x36b6('0x3'));var BPromise=require('bluebird');var rp=require(_0x36b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36b6('0x5'));module[_0x36b6('0x6')]=function(_0x4a532d,_0x34531c){return _0x4a532d[_0x36b6('0x7')](_0x36b6('0x8'),attributes,{'tableName':_0x36b6('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x248c=['define','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0xc03f9f,_0x4f2c8d){var _0x977380=function(_0x5e699d){while(--_0x5e699d){_0xc03f9f['push'](_0xc03f9f['shift']());}};_0x977380(++_0x4f2c8d);}(_0x248c,0x118));var _0xc248=function(_0x550c4a,_0x3f33e7){_0x550c4a=_0x550c4a-0x0;var _0x3b43a4=_0x248c[_0x550c4a];return _0x3b43a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc248('0x0'))('api');var moment=require(_0xc248('0x1'));var BPromise=require(_0xc248('0x2'));var rp=require(_0xc248('0x3'));var fs=require('fs');var path=require(_0xc248('0x4'));var rimraf=require(_0xc248('0x5'));var config=require(_0xc248('0x6'));var attributes=require(_0xc248('0x7'));module['exports']=function(_0x3e3fb4,_0x578b54){return _0x3e3fb4[_0xc248('0x8')]('CmCustomField',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 9b22aea..bf0fc69 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 _0xdd44=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x565e1f,_0x8f94fc){var _0x19a9c1=function(_0x47b5f3){while(--_0x47b5f3){_0x565e1f['push'](_0x565e1f['shift']());}};_0x19a9c1(++_0x8f94fc);}(_0xdd44,0xa8));var _0x4dd4=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xdd44[_0x529f1c];return _0x4d57ab;};'use strict';var _=require(_0x4dd4('0x0'));var util=require(_0x4dd4('0x1'));var moment=require(_0x4dd4('0x2'));var BPromise=require(_0x4dd4('0x3'));var rs=require(_0x4dd4('0x4'));var fs=require('fs');var Redis=require(_0x4dd4('0x5'));var db=require(_0x4dd4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4dd4('0x7'))(_0x4dd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x4dd4('0x9'));var client=jayson[_0x4dd4('0xa')][_0x4dd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce284,_0x54f46c,_0x2ef44a){return new BPromise(function(_0x4b9b7f,_0xc063a2){return client[_0x4dd4('0xc')](_0x4ce284,_0x2ef44a)[_0x4dd4('0xd')](function(_0x40d376){logger[_0x4dd4('0xe')](_0x4dd4('0xf'),_0x54f46c,_0x4dd4('0x10'));logger[_0x4dd4('0x11')](_0x4dd4('0x12'),_0x54f46c,_0x4dd4('0x10'),JSON[_0x4dd4('0x13')](_0x40d376));if(_0x40d376[_0x4dd4('0x14')]){if(_0x40d376[_0x4dd4('0x14')][_0x4dd4('0x15')]===0x1f4){logger[_0x4dd4('0x14')](_0x4dd4('0xf'),_0x54f46c,_0x40d376[_0x4dd4('0x14')]['message']);return _0xc063a2(_0x40d376[_0x4dd4('0x14')][_0x4dd4('0x16')]);}logger[_0x4dd4('0x14')](_0x4dd4('0xf'),_0x54f46c,_0x40d376[_0x4dd4('0x14')][_0x4dd4('0x16')]);return _0x4b9b7f(_0x40d376[_0x4dd4('0x14')][_0x4dd4('0x16')]);}else{logger[_0x4dd4('0xe')](_0x4dd4('0xf'),_0x54f46c,_0x4dd4('0x10'));_0x4b9b7f(_0x40d376[_0x4dd4('0x17')][_0x4dd4('0x16')]);}})[_0x4dd4('0x18')](function(_0x369ff4){logger[_0x4dd4('0x14')](_0x4dd4('0xf'),_0x54f46c,_0x369ff4);_0xc063a2(_0x369ff4);});});} \ No newline at end of file +var _0x87de=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x87de,0x67));var _0xe87d=function(_0x490635,_0x3b9016){_0x490635=_0x490635-0x0;var _0x427559=_0x87de[_0x490635];return _0x427559;};'use strict';var _=require('lodash');var util=require(_0xe87d('0x0'));var moment=require(_0xe87d('0x1'));var BPromise=require(_0xe87d('0x2'));var rs=require(_0xe87d('0x3'));var fs=require('fs');var Redis=require(_0xe87d('0x4'));var db=require(_0xe87d('0x5'))['db'];var utils=require(_0xe87d('0x6'));var logger=require(_0xe87d('0x7'))('rpc');var config=require(_0xe87d('0x8'));var jayson=require(_0xe87d('0x9'));var client=jayson[_0xe87d('0xa')][_0xe87d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x503555,_0x145cd9,_0x46e7ad){return new BPromise(function(_0xb4cbcd,_0x9e3e18){return client['request'](_0x503555,_0x46e7ad)[_0xe87d('0xc')](function(_0x1e70c9){logger[_0xe87d('0xd')](_0xe87d('0xe'),_0x145cd9,_0xe87d('0xf'));logger[_0xe87d('0x10')](_0xe87d('0x11'),_0x145cd9,_0xe87d('0xf'),JSON[_0xe87d('0x12')](_0x1e70c9));if(_0x1e70c9[_0xe87d('0x13')]){if(_0x1e70c9[_0xe87d('0x13')]['code']===0x1f4){logger[_0xe87d('0x13')](_0xe87d('0xe'),_0x145cd9,_0x1e70c9[_0xe87d('0x13')][_0xe87d('0x14')]);return _0x9e3e18(_0x1e70c9[_0xe87d('0x13')][_0xe87d('0x14')]);}logger[_0xe87d('0x13')]('CmCustomField,\x20%s,\x20%s',_0x145cd9,_0x1e70c9[_0xe87d('0x13')]['message']);return _0xb4cbcd(_0x1e70c9[_0xe87d('0x13')]['message']);}else{logger[_0xe87d('0xd')](_0xe87d('0xe'),_0x145cd9,_0xe87d('0xf'));_0xb4cbcd(_0x1e70c9['result'][_0xe87d('0x14')]);}})[_0xe87d('0x15')](function(_0x58fe71){logger['error'](_0xe87d('0xe'),_0x145cd9,_0x58fe71);_0x9e3e18(_0x58fe71);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 7f82a17..0829c16 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 _0x3821=['./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x14e909,_0x55299f){var _0x2fdd3b=function(_0x9427ae){while(--_0x9427ae){_0x14e909['push'](_0x14e909['shift']());}};_0x2fdd3b(++_0x55299f);}(_0x3821,0xf7));var _0x1382=function(_0x1b9650,_0x1fd3eb){_0x1b9650=_0x1b9650-0x0;var _0x1683a2=_0x3821[_0x1b9650];return _0x1683a2;};'use strict';var multer=require(_0x1382('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1382('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1382('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1382('0x3'));var config=require(_0x1382('0x4'));var controller=require(_0x1382('0x5'));router[_0x1382('0x6')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0x8')]);router[_0x1382('0x6')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0xa')]);router[_0x1382('0xb')]('/',auth['isAuthenticated'](),controller[_0x1382('0xc')]);router[_0x1382('0xd')](_0x1382('0x9'),auth['isAuthenticated'](),controller[_0x1382('0xe')]);router[_0x1382('0xf')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0x10')]);module[_0x1382('0x11')]=router; \ No newline at end of file +var _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1b9451,_0xff9f89){var _0x1698e5=function(_0x14e236){while(--_0x14e236){_0x1b9451['push'](_0x1b9451['shift']());}};_0x1698e5(++_0xff9f89);}(_0x4fd7,0xe6));var _0x74fd=function(_0x2e2d39,_0x40ea9e){_0x2e2d39=_0x2e2d39-0x0;var _0x1f06ed=_0x4fd7[_0x2e2d39];return _0x1f06ed;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./cmCustomField.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index c276ffe..08fa91a 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 _0x3681=['exports','STRING','DATE','format','INTEGER','BOOLEAN','contactListQueue','moment'];(function(_0x49c064,_0x520c94){var _0x15fa6f=function(_0x5da5da){while(--_0x5da5da){_0x49c064['push'](_0x49c064['shift']());}};_0x15fa6f(++_0x520c94);}(_0x3681,0xe7));var _0x1368=function(_0xa05d32,_0x248491){_0xa05d32=_0xa05d32-0x0;var _0x535dd1=_0x3681[_0xa05d32];return _0x535dd1;};'use strict';var moment=require(_0x1368('0x0'));var Sequelize=require('sequelize');module[_0x1368('0x1')]={'phone':{'type':Sequelize[_0x1368('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1368('0x3')],'defaultValue':moment()[_0x1368('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1368('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1368('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1368('0x3')]},'priority':{'type':Sequelize[_0x1368('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1368('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1368('0x5')],'unique':_0x1368('0x7')},'ListId':{'type':Sequelize[_0x1368('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1368('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1368('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x067c=['INTEGER','STRING','UNSIGNED','contactListQueue','moment','exports','BOOLEAN','DATE','format'];(function(_0x1781f9,_0x5c36a3){var _0x4bd468=function(_0x3d3efb){while(--_0x3d3efb){_0x1781f9['push'](_0x1781f9['shift']());}};_0x4bd468(++_0x5c36a3);}(_0x067c,0x8b));var _0xc067=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x067c[_0x87506e];return _0x5496a4;};'use strict';var moment=require(_0xc067('0x0'));var Sequelize=require('sequelize');module[_0xc067('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xc067('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc067('0x3')],'defaultValue':moment()[_0xc067('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc067('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc067('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc067('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc067('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc067('0x5')],'unique':_0xc067('0x8')},'ListId':{'type':Sequelize[_0xc067('0x5')],'unique':_0xc067('0x8')},'UserId':{'type':Sequelize[_0xc067('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xc067('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc067('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 29e2ad6..db96ddd 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 _0xc034=['create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','filter','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList','List','Queue','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$overlap','$contains','$contained','$any','fields','attributes','length','sort','pick','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xc034,0x170));var _0x4c03=function(_0x352990,_0x3b692f){_0x352990=_0x352990-0x0;var _0x551c5d=_0xc034[_0x352990];return _0x551c5d;};'use strict';var emlformat=require(_0x4c03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c03('0x1'));var jsonpatch=require(_0x4c03('0x2'));var rp=require(_0x4c03('0x3'));var moment=require(_0x4c03('0x4'));var BPromise=require(_0x4c03('0x5'));var Mustache=require(_0x4c03('0x6'));var util=require(_0x4c03('0x7'));var path=require(_0x4c03('0x8'));var sox=require(_0x4c03('0x9'));var csv=require(_0x4c03('0xa'));var ejs=require(_0x4c03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c03('0xc'));var squel=require(_0x4c03('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c03('0xa'));var querystring=require(_0x4c03('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4c03('0xf'));var as=require(_0x4c03('0x10'));var hardwareService=require(_0x4c03('0x11'));var logger=require(_0x4c03('0x12'))(_0x4c03('0x13'));var utils=require(_0x4c03('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4c03('0x15'));var db=require(_0x4c03('0x16'))['db'];function respondWithStatusCode(_0xe10085,_0x40b35e){_0x40b35e=_0x40b35e||0xcc;return function(_0x4f7d7b){if(_0x4f7d7b){return _0xe10085[_0x4c03('0x17')](_0x40b35e);}return _0xe10085[_0x4c03('0x18')](_0x40b35e)[_0x4c03('0x19')]();};}function respondWithResult(_0x1fb46f,_0x2081d8){_0x2081d8=_0x2081d8||0xc8;return function(_0x28a696){if(_0x28a696){return _0x1fb46f[_0x4c03('0x18')](_0x2081d8)['json'](_0x28a696);}};}function respondWithFilteredResult(_0x2d5512,_0x4b4232){return function(_0x429bc3){if(_0x429bc3){var _0xc59477=typeof _0x4b4232[_0x4c03('0x1a')]==='undefined'&&typeof _0x4b4232[_0x4c03('0x1b')]===_0x4c03('0x1c');var _0x39fdd6=_0x429bc3[_0x4c03('0x1d')];var _0x5bc41b=_0xc59477?0x0:_0x4b4232[_0x4c03('0x1a')];var _0x2b8900=_0xc59477?_0x429bc3[_0x4c03('0x1d')]:_0x4b4232[_0x4c03('0x1a')]+_0x4b4232['limit'];var _0x23f971;if(_0x2b8900>=_0x39fdd6){_0x2b8900=_0x39fdd6;_0x23f971=0xc8;}else{_0x23f971=0xce;}_0x2d5512[_0x4c03('0x18')](_0x23f971);return _0x2d5512[_0x4c03('0x1e')](_0x4c03('0x1f'),_0x5bc41b+'-'+_0x2b8900+'/'+_0x39fdd6)[_0x4c03('0x20')](_0x429bc3);}return null;};}function patchUpdates(_0x45046a){return function(_0x2f5b29){try{jsonpatch['apply'](_0x2f5b29,_0x45046a,!![]);}catch(_0x444a14){return BPromise[_0x4c03('0x21')](_0x444a14);}return _0x2f5b29['save']();};}function saveUpdates(_0x546c8c,_0x4ce212){return function(_0x42cc4b){if(_0x42cc4b){return _0x42cc4b[_0x4c03('0x22')](_0x546c8c)[_0x4c03('0x23')](function(_0x3ead7b){return _0x3ead7b;});}return null;};}function removeEntity(_0x4251d8,_0x5a55f6){return function(_0x2a19ff){if(_0x2a19ff){return _0x2a19ff[_0x4c03('0x24')]()[_0x4c03('0x23')](function(){_0x4251d8['status'](0xcc)[_0x4c03('0x19')]();});}};}function handleEntityNotFound(_0x20ab2e,_0x4f337a){return function(_0x44fb02){if(!_0x44fb02){_0x20ab2e['sendStatus'](0x194);}return _0x44fb02;};}function handleError(_0x5d85ba,_0x42a883){_0x42a883=_0x42a883||0x1f4;return function(_0xe571c7){logger[_0x4c03('0x25')](_0xe571c7[_0x4c03('0x26')]);if(_0xe571c7[_0x4c03('0x27')]){delete _0xe571c7['name'];}_0x5d85ba['status'](_0x42a883)[_0x4c03('0x28')](_0xe571c7);};}exports[_0x4c03('0x29')]=function(_0x3068ab,_0x41a0ed){var _0x25180c={},_0x103191={},_0x2f7528={'count':0x0,'rows':[]};var _0x5cab83=_[_0x4c03('0x2a')](db[_0x4c03('0x2b')][_0x4c03('0x2c')],function(_0x2f638a){return{'name':_0x2f638a[_0x4c03('0x2d')],'type':_0x2f638a[_0x4c03('0x2e')][_0x4c03('0x2f')]};});_0x103191[_0x4c03('0x30')]=_[_0x4c03('0x2a')](_0x5cab83,_0x4c03('0x27'));_0x103191['query']=_[_0x4c03('0x31')](_0x3068ab[_0x4c03('0x32')]);_0x103191[_0x4c03('0x33')]=_[_0x4c03('0x34')](_0x103191[_0x4c03('0x30')],_0x103191['query']);_0x103191['filters']=_[_0x4c03('0x35')](_0x103191[_0x4c03('0x33')],[_0x4c03('0x36'),_0x4c03('0x37'),_0x4c03('0x38'),_0x4c03('0x39'),_0x4c03('0x3a'),_0x4c03('0x3b'),_0x4c03('0x3c'),_0x4c03('0x3d'),'$not',_0x4c03('0x3e'),_0x4c03('0x3f'),_0x4c03('0x40'),_0x4c03('0x41'),_0x4c03('0x42'),_0x4c03('0x43'),'$iLike','$notILike',_0x4c03('0x42'),_0x4c03('0x44'),_0x4c03('0x45'),_0x4c03('0x46'),_0x4c03('0x47')]);_0x25180c['attributes']=_['intersection'](_0x103191[_0x4c03('0x30')],qs[_0x4c03('0x48')](_0x3068ab['query'][_0x4c03('0x48')]));_0x25180c['attributes']=_0x25180c[_0x4c03('0x49')][_0x4c03('0x4a')]?_0x25180c[_0x4c03('0x49')]:_0x103191['model'];if(!_0x3068ab[_0x4c03('0x32')]['hasOwnProperty']('nolimit')){_0x25180c[_0x4c03('0x1b')]=qs[_0x4c03('0x1b')](_0x3068ab[_0x4c03('0x32')][_0x4c03('0x1b')]);_0x25180c['offset']=qs['offset'](_0x3068ab['query']['offset']);}_0x25180c['order']=qs['sort'](_0x3068ab[_0x4c03('0x32')][_0x4c03('0x4b')]);_0x25180c['where']=qs[_0x4c03('0x33')](_[_0x4c03('0x4c')](_0x3068ab[_0x4c03('0x32')],_0x103191['filters']),_0x5cab83);if(_0x3068ab['query']['filter']){_0x25180c['where']=_['merge'](_0x25180c[_0x4c03('0x4d')],{'$or':_[_0x4c03('0x2a')](_0x5cab83,function(_0x590fde){if(_0x590fde[_0x4c03('0x2e')]!=='VIRTUAL'){var _0x415523={};_0x415523[_0x590fde[_0x4c03('0x27')]]={'$like':'%'+_0x3068ab[_0x4c03('0x32')]['filter']+'%'};return _0x415523;}})});}_0x25180c=_['merge']({},_0x25180c,_0x3068ab[_0x4c03('0x4e')]);var _0x4b18c5={'where':_0x25180c[_0x4c03('0x4d')]};return db[_0x4c03('0x2b')][_0x4c03('0x1d')](_0x4b18c5)[_0x4c03('0x23')](function(_0x32217d){_0x2f7528[_0x4c03('0x1d')]=_0x32217d;if(_0x3068ab[_0x4c03('0x32')][_0x4c03('0x4f')]){_0x25180c[_0x4c03('0x50')]=[{'all':!![]}];}return db[_0x4c03('0x2b')][_0x4c03('0x51')](_0x25180c);})['then'](function(_0x4ea817){_0x2f7528[_0x4c03('0x52')]=_0x4ea817;return _0x2f7528;})['then'](respondWithFilteredResult(_0x41a0ed,_0x25180c))[_0x4c03('0x53')](handleError(_0x41a0ed,null));};exports[_0x4c03('0x54')]=function(_0x30583a,_0x2f2bee){var _0x1f75d4={'raw':!![],'where':{'id':_0x30583a[_0x4c03('0x55')]['id']}},_0x3616f5={};_0x3616f5[_0x4c03('0x30')]=_[_0x4c03('0x31')](db['CmHopper'][_0x4c03('0x2c')]);_0x3616f5[_0x4c03('0x32')]=_[_0x4c03('0x31')](_0x30583a[_0x4c03('0x32')]);_0x3616f5['filters']=_[_0x4c03('0x34')](_0x3616f5[_0x4c03('0x30')],_0x3616f5[_0x4c03('0x32')]);_0x1f75d4[_0x4c03('0x49')]=_[_0x4c03('0x34')](_0x3616f5[_0x4c03('0x30')],qs[_0x4c03('0x48')](_0x30583a[_0x4c03('0x32')][_0x4c03('0x48')]));_0x1f75d4[_0x4c03('0x49')]=_0x1f75d4[_0x4c03('0x49')]['length']?_0x1f75d4['attributes']:_0x3616f5[_0x4c03('0x30')];if(_0x30583a[_0x4c03('0x32')][_0x4c03('0x4f')]){_0x1f75d4[_0x4c03('0x50')]=[{'all':!![]}];}_0x1f75d4=_[_0x4c03('0x56')]({},_0x1f75d4,_0x30583a['options']);return db[_0x4c03('0x2b')][_0x4c03('0x57')](_0x1f75d4)['then'](handleEntityNotFound(_0x2f2bee,null))[_0x4c03('0x23')](respondWithResult(_0x2f2bee,null))['catch'](handleError(_0x2f2bee,null));};exports['create']=function(_0x2daf58,_0x3c8910){return db[_0x4c03('0x2b')][_0x4c03('0x58')](_0x2daf58[_0x4c03('0x59')],{})[_0x4c03('0x23')](respondWithResult(_0x3c8910,0xc9))[_0x4c03('0x53')](handleError(_0x3c8910,null));};exports[_0x4c03('0x22')]=function(_0x5ae519,_0x31b0a4){if(_0x5ae519[_0x4c03('0x59')]['id']){delete _0x5ae519[_0x4c03('0x59')]['id'];}return db[_0x4c03('0x2b')]['find']({'where':{'id':_0x5ae519[_0x4c03('0x55')]['id']}})[_0x4c03('0x23')](handleEntityNotFound(_0x31b0a4,null))[_0x4c03('0x23')](saveUpdates(_0x5ae519['body'],null))[_0x4c03('0x23')](respondWithResult(_0x31b0a4,null))[_0x4c03('0x53')](handleError(_0x31b0a4,null));};exports[_0x4c03('0x5a')]=function(_0x106ff1,_0x2a2ec1){return db[_0x4c03('0x2b')]['describe']()['then'](respondWithResult(_0x2a2ec1,null))[_0x4c03('0x53')](handleError(_0x2a2ec1,null));};exports[_0x4c03('0x24')]=function(_0x23a5c6,_0x4fa5cc){var _0x8fb85f;return db[_0x4c03('0x2b')][_0x4c03('0x57')]({'where':{'id':_0x23a5c6[_0x4c03('0x55')]['id']}})[_0x4c03('0x23')](handleEntityNotFound(_0x4fa5cc,null))['then'](function(_0x2411d3){if(_0x2411d3){return _0x2411d3[_0x4c03('0x24')]()['then'](function(_0x4eecd6){return _0x4eecd6;});}})[_0x4c03('0x23')](function(_0x1bd923){_0x8fb85f=_0x1bd923;if(_0x1bd923){if(_0x1bd923['VoiceQueueId']||_0x1bd923[_0x4c03('0x5b')]){return db[_0x1bd923[_0x4c03('0x5c')]?_0x4c03('0x5d'):_0x4c03('0x5e')][_0x4c03('0x57')]({'where':{'id':_0x1bd923[_0x4c03('0x5c')]?_0x1bd923['VoiceQueueId']:_0x1bd923['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x5deb33){var _0x4f4fd0={};if(_0x5deb33){_[_0x4c03('0x56')](_0x4f4fd0,_[_0x4c03('0x5f')](_0x8fb85f[_0x4c03('0x60')],[_0x4c03('0x61'),_0x4c03('0x62'),'id']));_0x4f4fd0[_0x4c03('0x63')]=0x15;_0x4f4fd0[_0x4c03('0x64')]=_0x4c03('0x65');_0x4f4fd0[_0x4c03('0x66')]=_0x5deb33[_0x4c03('0x27')];_0x4f4fd0[_0x4c03('0x67')]=_0x23a5c6['user'][_0x4c03('0x27')];_0x4f4fd0['UserId']=_0x23a5c6[_0x4c03('0x68')]['id'];_0x4f4fd0['deleted']=!![];_0x4f4fd0[_0x4c03('0x69')]=moment()[_0x4c03('0x6a')](_0x4c03('0x6b'));_0x4f4fd0[_0x4c03('0x6c')]=_0x8fb85f['phone'];_0x4f4fd0[_0x4c03('0x6d')]=_0x8fb85f['VoiceQueueId']?_0x4c03('0x6e'):_0x4c03('0x6f');return db[_0x4c03('0x70')]['find']({'where':{'id':_0x4f4fd0[_0x4c03('0x71')]},'attributes':[_0x4c03('0x72'),'lastName']})[_0x4c03('0x23')](function(_0x1d2c79){if(!_[_0x4c03('0x73')](_0x4fa5cc)&&!_['isNil'](_0x1d2c79[_0x4c03('0x72')])){_0x4f4fd0[_0x4c03('0x74')]=_0x1d2c79[_0x4c03('0x72')];if(!_[_0x4c03('0x73')](_0x1d2c79['lastName'])){_0x4f4fd0[_0x4c03('0x74')]+='\x20'+_0x1d2c79['lastName'];}}})['finally'](function(){return db[_0x4c03('0x75')][_0x4c03('0x58')](_0x4f4fd0);});}})['then'](function(){return _0x4fa5cc[_0x4c03('0x18')](0xcc)[_0x4c03('0x19')]();})[_0x4c03('0x53')](handleError(_0x4fa5cc,null));};exports[_0x4c03('0x76')]=function(_0x400e69,_0x7387a6,_0x2bfb03){var _0x212d61=[];return db[_0x4c03('0x70')][_0x4c03('0x5a')]()[_0x4c03('0x23')](function(_0x440827){_0x212d61=_[_0x4c03('0x31')](_0x440827);return _0x400e69['user'][_0x4c03('0x77')]({'where':{'type':_0x4c03('0x78'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4c03('0x79'),_0x4c03('0x7a')],'raw':!![]});})[_0x4c03('0x23')](function(_0x15a90d){if(_0x15a90d&&_0x15a90d[_0x4c03('0x4a')]){return db['sequelize'][_0x4c03('0x7b')](function(_0x22ced1){var _0xd9953a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x4c03('0x6b'))},'VoiceQueueId':{'$in':_[_0x4c03('0x2a')](_0x15a90d,'id')},'$or':[{'UserId':null},{'UserId':_0x400e69[_0x4c03('0x68')]['id']}]};var _0x15311b={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x15a90d)[_0x4c03('0x7c')]([_0x4c03('0x7a'),0x0])[_0x4c03('0x2a')]('id')[_0x4c03('0x7d')]()},'$or':[{'UserId':null},{'UserId':_0x400e69[_0x4c03('0x68')]['id']}]};var _0xe9c1b0={'$or':[_0xd9953a,_0x15311b]};var _0x16cf17=[];if(_0x400e69[_0x4c03('0x59')][_0x4c03('0x7e')]&&_0x400e69[_0x4c03('0x59')][_0x4c03('0x7e')]==='prev'){if(!_[_0x4c03('0x7f')](_0x400e69[_0x4c03('0x59')][_0x4c03('0x80')])){_0xe9c1b0['id']={'$in':_0x400e69[_0x4c03('0x59')][_0x4c03('0x80')]};}_0x16cf17=[[_0x4c03('0x81'),_0x4c03('0x82')],[_0x4c03('0x83'),_0x15a90d[0x0][_0x4c03('0x79')]===_0x4c03('0x82')?'DESC':_0x4c03('0x82')],db[_0x4c03('0x84')]['literal'](_0x4c03('0x85')),['id',_0x4c03('0x86')]];}else{if(!_['isEmpty'](_0x400e69[_0x4c03('0x59')][_0x4c03('0x80')])){_0xe9c1b0['id']={'$notIn':_0x400e69[_0x4c03('0x59')]['hopperIds']};}_0x16cf17=[[_0x4c03('0x81'),_0x4c03('0x86')],[_0x4c03('0x83'),_0x15a90d[0x0][_0x4c03('0x79')]],db[_0x4c03('0x84')][_0x4c03('0x87')](_0x4c03('0x88')),['id',_0x4c03('0x82')]];}return db[_0x4c03('0x2b')][_0x4c03('0x89')]({'attributes':['id',_0x4c03('0x8a'),_0x4c03('0x8b')],'where':_0xe9c1b0,'order':_0x16cf17,'transaction':_0x22ced1,'lock':_0x22ced1[_0x4c03('0x8c')][_0x4c03('0x8d')],'include':[{'model':db[_0x4c03('0x70')],'as':_0x4c03('0x8e'),'attributes':_0x212d61,'include':[{'model':db['CmCompany'],'as':_0x4c03('0x8f'),'attributes':['id',_0x4c03('0x27')]}]},{'model':db[_0x4c03('0x90')],'as':_0x4c03('0x91'),'attributes':['id',_0x4c03('0x27')]},{'model':db[_0x4c03('0x5d')],'as':_0x4c03('0x92'),'attributes':['id',_0x4c03('0x27'),'dialActive']}]})[_0x4c03('0x23')](function(_0x2619f0){if(_0x2619f0){return _0x2619f0['update']({'UserId':_0x400e69[_0x4c03('0x68')]['id']},{'transaction':_0x22ced1});}});});}})[_0x4c03('0x23')](handleEntityNotFound(_0x7387a6,null))[_0x4c03('0x23')](respondWithResult(_0x7387a6,null))[_0x4c03('0x53')](handleError(_0x7387a6,null));};exports[_0x4c03('0x93')]=function(_0x504c09,_0x393a0b,_0x4c3e84){return _0x504c09['user'][_0x4c03('0x77')]({'where':{'type':_0x4c03('0x78'),'dialActive':!![],'dialMethod':_0x4c03('0x94')},'attributes':['id'],'raw':!![]})['then'](function(_0x33c3b7){if(_0x33c3b7&&_0x33c3b7['length']){return db[_0x4c03('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4c03('0x6a')](_0x4c03('0x6b'))},'VoiceQueueId':{'$in':_[_0x4c03('0x2a')](_0x33c3b7,'id')},'$or':[{'UserId':null},{'UserId':_0x504c09[_0x4c03('0x68')]['id']}]}});}return 0x0;})[_0x4c03('0x23')](function(_0x271c20){if(!_['isNil'](_0x271c20)&&_[_0x4c03('0x95')](_0x271c20)){return _0x393a0b[_0x4c03('0x18')](0xc8)['json']({'contacts':_0x271c20});}else{logger[_0x4c03('0x25')](_0x4c03('0x96'),_0x4c03('0x93'),0x194,_0x4c03('0x97'));_0x393a0b['sendStatus'](0x194);}})['catch'](handleError(_0x393a0b,null));}; \ No newline at end of file +var _0xb6f9=['finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopper','rawAttributes','type','model','keys','query','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','dataValues','createdAt','updatedAt','state','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb6f9,0x146));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9b6f('0x0'));var rimraf=require(_0x9b6f('0x1'));var zipdir=require(_0x9b6f('0x2'));var jsonpatch=require(_0x9b6f('0x3'));var rp=require('request-promise');var moment=require(_0x9b6f('0x4'));var BPromise=require(_0x9b6f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b6f('0x6'));var sox=require('sox');var csv=require(_0x9b6f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b6f('0x8'));var _=require(_0x9b6f('0x9'));var squel=require('squel');var crypto=require(_0x9b6f('0xa'));var jsforce=require(_0x9b6f('0xb'));var deskjs=require(_0x9b6f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b6f('0xd'));var Redis=require(_0x9b6f('0xe'));var authService=require(_0x9b6f('0xf'));var qs=require(_0x9b6f('0x10'));var as=require(_0x9b6f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b6f('0x12'))(_0x9b6f('0x13'));var utils=require('../../config/utils');var config=require(_0x9b6f('0x14'));var licenseUtil=require(_0x9b6f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb7e6eb,_0x38b4d8){_0x38b4d8=_0x38b4d8||0xcc;return function(_0x49c7a3){if(_0x49c7a3){return _0xb7e6eb[_0x9b6f('0x16')](_0x38b4d8);}return _0xb7e6eb[_0x9b6f('0x17')](_0x38b4d8)['end']();};}function respondWithResult(_0x4258f4,_0x4e0597){_0x4e0597=_0x4e0597||0xc8;return function(_0x3044cb){if(_0x3044cb){return _0x4258f4[_0x9b6f('0x17')](_0x4e0597)[_0x9b6f('0x18')](_0x3044cb);}};}function respondWithFilteredResult(_0x4f4395,_0x152e1b){return function(_0x5ca67f){if(_0x5ca67f){var _0x2ae6bd=typeof _0x152e1b[_0x9b6f('0x19')]===_0x9b6f('0x1a')&&typeof _0x152e1b[_0x9b6f('0x1b')]===_0x9b6f('0x1a');var _0x39d252=_0x5ca67f['count'];var _0x3628b7=_0x2ae6bd?0x0:_0x152e1b[_0x9b6f('0x19')];var _0x25aabf=_0x2ae6bd?_0x5ca67f[_0x9b6f('0x1c')]:_0x152e1b[_0x9b6f('0x19')]+_0x152e1b[_0x9b6f('0x1b')];var _0x1288a2;if(_0x25aabf>=_0x39d252){_0x25aabf=_0x39d252;_0x1288a2=0xc8;}else{_0x1288a2=0xce;}_0x4f4395['status'](_0x1288a2);return _0x4f4395['set'](_0x9b6f('0x1d'),_0x3628b7+'-'+_0x25aabf+'/'+_0x39d252)[_0x9b6f('0x18')](_0x5ca67f);}return null;};}function patchUpdates(_0x2c9f49){return function(_0x541f12){try{jsonpatch[_0x9b6f('0x1e')](_0x541f12,_0x2c9f49,!![]);}catch(_0x3b31b1){return BPromise[_0x9b6f('0x1f')](_0x3b31b1);}return _0x541f12[_0x9b6f('0x20')]();};}function saveUpdates(_0x186a9f,_0x4a04e8){return function(_0x577029){if(_0x577029){return _0x577029[_0x9b6f('0x21')](_0x186a9f)[_0x9b6f('0x22')](function(_0x2e4b1b){return _0x2e4b1b;});}return null;};}function removeEntity(_0x1abd21,_0x28d300){return function(_0x4e162c){if(_0x4e162c){return _0x4e162c['destroy']()[_0x9b6f('0x22')](function(){_0x1abd21[_0x9b6f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x156283,_0x16d7a0){return function(_0x22a1ad){if(!_0x22a1ad){_0x156283[_0x9b6f('0x16')](0x194);}return _0x22a1ad;};}function handleError(_0x281d1e,_0x50caab){_0x50caab=_0x50caab||0x1f4;return function(_0x316d02){logger[_0x9b6f('0x23')](_0x316d02[_0x9b6f('0x24')]);if(_0x316d02[_0x9b6f('0x25')]){delete _0x316d02[_0x9b6f('0x25')];}_0x281d1e[_0x9b6f('0x17')](_0x50caab)[_0x9b6f('0x26')](_0x316d02);};}exports[_0x9b6f('0x27')]=function(_0x5afeac,_0x3da96b){var _0x375baf={},_0xa8212f={},_0x2bb765={'count':0x0,'rows':[]};var _0x1794f3=_[_0x9b6f('0x28')](db[_0x9b6f('0x29')][_0x9b6f('0x2a')],function(_0x5d35da){return{'name':_0x5d35da['fieldName'],'type':_0x5d35da[_0x9b6f('0x2b')]['key']};});_0xa8212f[_0x9b6f('0x2c')]=_[_0x9b6f('0x28')](_0x1794f3,_0x9b6f('0x25'));_0xa8212f['query']=_[_0x9b6f('0x2d')](_0x5afeac[_0x9b6f('0x2e')]);_0xa8212f[_0x9b6f('0x2f')]=_[_0x9b6f('0x30')](_0xa8212f[_0x9b6f('0x2c')],_0xa8212f[_0x9b6f('0x2e')]);_0xa8212f[_0x9b6f('0x2f')]=_[_0x9b6f('0x31')](_0xa8212f[_0x9b6f('0x2f')],[_0x9b6f('0x32'),_0x9b6f('0x33'),_0x9b6f('0x34'),'$gte',_0x9b6f('0x35'),_0x9b6f('0x36'),_0x9b6f('0x37'),_0x9b6f('0x38'),'$not',_0x9b6f('0x39'),_0x9b6f('0x3a'),_0x9b6f('0x3b'),_0x9b6f('0x3c'),_0x9b6f('0x3d'),_0x9b6f('0x3e'),_0x9b6f('0x3f'),_0x9b6f('0x40'),_0x9b6f('0x3d'),_0x9b6f('0x41'),_0x9b6f('0x42'),_0x9b6f('0x43'),'$any']);_0x375baf[_0x9b6f('0x44')]=_[_0x9b6f('0x30')](_0xa8212f['model'],qs[_0x9b6f('0x45')](_0x5afeac[_0x9b6f('0x2e')][_0x9b6f('0x45')]));_0x375baf[_0x9b6f('0x44')]=_0x375baf[_0x9b6f('0x44')][_0x9b6f('0x46')]?_0x375baf[_0x9b6f('0x44')]:_0xa8212f[_0x9b6f('0x2c')];if(!_0x5afeac[_0x9b6f('0x2e')][_0x9b6f('0x47')]('nolimit')){_0x375baf['limit']=qs['limit'](_0x5afeac['query'][_0x9b6f('0x1b')]);_0x375baf[_0x9b6f('0x19')]=qs['offset'](_0x5afeac['query'][_0x9b6f('0x19')]);}_0x375baf[_0x9b6f('0x48')]=qs['sort'](_0x5afeac[_0x9b6f('0x2e')][_0x9b6f('0x49')]);_0x375baf['where']=qs[_0x9b6f('0x2f')](_[_0x9b6f('0x4a')](_0x5afeac[_0x9b6f('0x2e')],_0xa8212f[_0x9b6f('0x2f')]),_0x1794f3);if(_0x5afeac[_0x9b6f('0x2e')][_0x9b6f('0x4b')]){_0x375baf['where']=_[_0x9b6f('0x4c')](_0x375baf[_0x9b6f('0x4d')],{'$or':_[_0x9b6f('0x28')](_0x1794f3,function(_0x1963e3){if(_0x1963e3[_0x9b6f('0x2b')]!==_0x9b6f('0x4e')){var _0x5bd02d={};_0x5bd02d[_0x1963e3[_0x9b6f('0x25')]]={'$like':'%'+_0x5afeac[_0x9b6f('0x2e')]['filter']+'%'};return _0x5bd02d;}})});}_0x375baf=_[_0x9b6f('0x4c')]({},_0x375baf,_0x5afeac['options']);var _0x32a216={'where':_0x375baf[_0x9b6f('0x4d')]};return db[_0x9b6f('0x29')][_0x9b6f('0x1c')](_0x32a216)[_0x9b6f('0x22')](function(_0x5dd8a2){_0x2bb765['count']=_0x5dd8a2;if(_0x5afeac[_0x9b6f('0x2e')][_0x9b6f('0x4f')]){_0x375baf[_0x9b6f('0x50')]=[{'all':!![]}];}return db[_0x9b6f('0x29')][_0x9b6f('0x51')](_0x375baf);})[_0x9b6f('0x22')](function(_0x3d9ade){_0x2bb765['rows']=_0x3d9ade;return _0x2bb765;})[_0x9b6f('0x22')](respondWithFilteredResult(_0x3da96b,_0x375baf))[_0x9b6f('0x52')](handleError(_0x3da96b,null));};exports['show']=function(_0xfc2cda,_0x4bef28){var _0x14b924={'raw':!![],'where':{'id':_0xfc2cda['params']['id']}},_0x36ac38={};_0x36ac38['model']=_[_0x9b6f('0x2d')](db['CmHopper'][_0x9b6f('0x2a')]);_0x36ac38[_0x9b6f('0x2e')]=_[_0x9b6f('0x2d')](_0xfc2cda[_0x9b6f('0x2e')]);_0x36ac38[_0x9b6f('0x2f')]=_[_0x9b6f('0x30')](_0x36ac38[_0x9b6f('0x2c')],_0x36ac38[_0x9b6f('0x2e')]);_0x14b924[_0x9b6f('0x44')]=_[_0x9b6f('0x30')](_0x36ac38['model'],qs[_0x9b6f('0x45')](_0xfc2cda[_0x9b6f('0x2e')][_0x9b6f('0x45')]));_0x14b924['attributes']=_0x14b924[_0x9b6f('0x44')]['length']?_0x14b924[_0x9b6f('0x44')]:_0x36ac38[_0x9b6f('0x2c')];if(_0xfc2cda['query'][_0x9b6f('0x4f')]){_0x14b924[_0x9b6f('0x50')]=[{'all':!![]}];}_0x14b924=_[_0x9b6f('0x4c')]({},_0x14b924,_0xfc2cda['options']);return db['CmHopper'][_0x9b6f('0x53')](_0x14b924)[_0x9b6f('0x22')](handleEntityNotFound(_0x4bef28,null))[_0x9b6f('0x22')](respondWithResult(_0x4bef28,null))[_0x9b6f('0x52')](handleError(_0x4bef28,null));};exports[_0x9b6f('0x54')]=function(_0x30f4ab,_0x1b1776){return db[_0x9b6f('0x29')]['create'](_0x30f4ab['body'],{})[_0x9b6f('0x22')](respondWithResult(_0x1b1776,0xc9))[_0x9b6f('0x52')](handleError(_0x1b1776,null));};exports[_0x9b6f('0x21')]=function(_0x44f3f8,_0x3a633b){if(_0x44f3f8[_0x9b6f('0x55')]['id']){delete _0x44f3f8[_0x9b6f('0x55')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x44f3f8[_0x9b6f('0x56')]['id']}})[_0x9b6f('0x22')](handleEntityNotFound(_0x3a633b,null))[_0x9b6f('0x22')](saveUpdates(_0x44f3f8[_0x9b6f('0x55')],null))['then'](respondWithResult(_0x3a633b,null))[_0x9b6f('0x52')](handleError(_0x3a633b,null));};exports['describe']=function(_0x22485b,_0x472549){return db['CmHopper'][_0x9b6f('0x57')]()[_0x9b6f('0x22')](respondWithResult(_0x472549,null))['catch'](handleError(_0x472549,null));};exports[_0x9b6f('0x58')]=function(_0x4ce200,_0x556659){var _0x4c81b4;return db[_0x9b6f('0x29')][_0x9b6f('0x53')]({'where':{'id':_0x4ce200['params']['id']}})[_0x9b6f('0x22')](handleEntityNotFound(_0x556659,null))[_0x9b6f('0x22')](function(_0x4f0199){if(_0x4f0199){return _0x4f0199[_0x9b6f('0x58')]()['then'](function(_0x37c716){return _0x37c716;});}})[_0x9b6f('0x22')](function(_0x302949){_0x4c81b4=_0x302949;if(_0x302949){if(_0x302949[_0x9b6f('0x59')]||_0x302949['CampaignId']){return db[_0x302949[_0x9b6f('0x59')]?'VoiceQueue':'Campaign'][_0x9b6f('0x53')]({'where':{'id':_0x302949[_0x9b6f('0x59')]?_0x302949[_0x9b6f('0x59')]:_0x302949[_0x9b6f('0x5a')]},'attributes':['id',_0x9b6f('0x25')],'raw':!![]});}}})['then'](function(_0x8580bd){var _0x1cdbdc={};if(_0x8580bd){_[_0x9b6f('0x4c')](_0x1cdbdc,_['omit'](_0x4c81b4[_0x9b6f('0x5b')],[_0x9b6f('0x5c'),_0x9b6f('0x5d'),'id']));_0x1cdbdc[_0x9b6f('0x5e')]=0x15;_0x1cdbdc['statedesc']='deleted';_0x1cdbdc[_0x9b6f('0x5f')]=_0x8580bd[_0x9b6f('0x25')];_0x1cdbdc[_0x9b6f('0x60')]=_0x4ce200[_0x9b6f('0x61')]['name'];_0x1cdbdc[_0x9b6f('0x62')]=_0x4ce200[_0x9b6f('0x61')]['id'];_0x1cdbdc['deleted']=!![];_0x1cdbdc[_0x9b6f('0x63')]=moment()[_0x9b6f('0x64')](_0x9b6f('0x65'));_0x1cdbdc[_0x9b6f('0x66')]=_0x4c81b4[_0x9b6f('0x67')];_0x1cdbdc['campaigntype']=_0x4c81b4[_0x9b6f('0x59')]?_0x9b6f('0x68'):_0x9b6f('0x69');return db[_0x9b6f('0x6a')][_0x9b6f('0x53')]({'where':{'id':_0x1cdbdc[_0x9b6f('0x6b')]},'attributes':['firstName',_0x9b6f('0x6c')]})[_0x9b6f('0x22')](function(_0x4a01cd){if(!_[_0x9b6f('0x6d')](_0x556659)&&!_['isNil'](_0x4a01cd[_0x9b6f('0x6e')])){_0x1cdbdc[_0x9b6f('0x6f')]=_0x4a01cd['firstName'];if(!_[_0x9b6f('0x6d')](_0x4a01cd[_0x9b6f('0x6c')])){_0x1cdbdc[_0x9b6f('0x6f')]+='\x20'+_0x4a01cd[_0x9b6f('0x6c')];}}})[_0x9b6f('0x70')](function(){return db[_0x9b6f('0x71')][_0x9b6f('0x54')](_0x1cdbdc);});}})['then'](function(){return _0x556659[_0x9b6f('0x17')](0xcc)[_0x9b6f('0x72')]();})[_0x9b6f('0x52')](handleError(_0x556659,null));};exports[_0x9b6f('0x73')]=function(_0x2b399a,_0x5b2f9e,_0x464c44){var _0x1508bb=[];return db['CmContact'][_0x9b6f('0x57')]()['then'](function(_0x281cb6){_0x1508bb=_[_0x9b6f('0x2d')](_0x281cb6);return _0x2b399a[_0x9b6f('0x61')][_0x9b6f('0x74')]({'where':{'type':_0x9b6f('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9b6f('0x76'),_0x9b6f('0x77')],'raw':!![]});})['then'](function(_0x3874fe){if(_0x3874fe&&_0x3874fe['length']){return db[_0x9b6f('0x78')]['transaction'](function(_0x26c43e){var _0x4bec15={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9b6f('0x64')](_0x9b6f('0x65'))},'VoiceQueueId':{'$in':_[_0x9b6f('0x28')](_0x3874fe,'id')},'$or':[{'UserId':null},{'UserId':_0x2b399a[_0x9b6f('0x61')]['id']}]};var _0x541d0f={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3874fe)[_0x9b6f('0x4b')]([_0x9b6f('0x77'),0x0])[_0x9b6f('0x28')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2b399a['user']['id']}]};var _0x49f706={'$or':[_0x4bec15,_0x541d0f]};var _0x2ea88c=[];if(_0x2b399a[_0x9b6f('0x55')][_0x9b6f('0x79')]&&_0x2b399a[_0x9b6f('0x55')][_0x9b6f('0x79')]===_0x9b6f('0x7a')){if(!_['isEmpty'](_0x2b399a[_0x9b6f('0x55')][_0x9b6f('0x7b')])){_0x49f706['id']={'$in':_0x2b399a[_0x9b6f('0x55')][_0x9b6f('0x7b')]};}_0x2ea88c=[[_0x9b6f('0x7c'),_0x9b6f('0x7d')],[_0x9b6f('0x7e'),_0x3874fe[0x0]['dialOrderByScheduledAt']===_0x9b6f('0x7d')?_0x9b6f('0x7f'):'ASC'],db[_0x9b6f('0x78')][_0x9b6f('0x80')](_0x9b6f('0x81')),['id',_0x9b6f('0x7f')]];}else{if(!_[_0x9b6f('0x82')](_0x2b399a[_0x9b6f('0x55')][_0x9b6f('0x7b')])){_0x49f706['id']={'$notIn':_0x2b399a[_0x9b6f('0x55')]['hopperIds']};}_0x2ea88c=[['priority','DESC'],[_0x9b6f('0x7e'),_0x3874fe[0x0][_0x9b6f('0x76')]],db[_0x9b6f('0x78')][_0x9b6f('0x80')](_0x9b6f('0x83')),['id',_0x9b6f('0x7d')]];}return db[_0x9b6f('0x29')][_0x9b6f('0x84')]({'attributes':['id',_0x9b6f('0x85'),_0x9b6f('0x86')],'where':_0x49f706,'order':_0x2ea88c,'transaction':_0x26c43e,'lock':_0x26c43e['LOCK'][_0x9b6f('0x87')],'include':[{'model':db[_0x9b6f('0x6a')],'as':'Contact','attributes':_0x1508bb,'include':[{'model':db[_0x9b6f('0x88')],'as':_0x9b6f('0x89'),'attributes':['id','name']}]},{'model':db[_0x9b6f('0x8a')],'as':_0x9b6f('0x8b'),'attributes':['id',_0x9b6f('0x25')]},{'model':db[_0x9b6f('0x8c')],'as':_0x9b6f('0x8d'),'attributes':['id',_0x9b6f('0x25'),_0x9b6f('0x8e')]}]})[_0x9b6f('0x22')](function(_0x114c04){if(_0x114c04){return _0x114c04[_0x9b6f('0x21')]({'UserId':_0x2b399a['user']['id']},{'transaction':_0x26c43e});}});});}})[_0x9b6f('0x22')](handleEntityNotFound(_0x5b2f9e,null))[_0x9b6f('0x22')](respondWithResult(_0x5b2f9e,null))[_0x9b6f('0x52')](handleError(_0x5b2f9e,null));};exports[_0x9b6f('0x8f')]=function(_0x3b6779,_0x376782,_0x167acf){return _0x3b6779[_0x9b6f('0x61')][_0x9b6f('0x74')]({'where':{'type':_0x9b6f('0x75'),'dialActive':!![],'dialMethod':_0x9b6f('0x90')},'attributes':['id'],'raw':!![]})[_0x9b6f('0x22')](function(_0x4fe3b5){if(_0x4fe3b5&&_0x4fe3b5[_0x9b6f('0x46')]){return db[_0x9b6f('0x29')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9b6f('0x65'))},'VoiceQueueId':{'$in':_[_0x9b6f('0x28')](_0x4fe3b5,'id')},'$or':[{'UserId':null},{'UserId':_0x3b6779[_0x9b6f('0x61')]['id']}]}});}return 0x0;})[_0x9b6f('0x22')](function(_0x555fba){if(!_[_0x9b6f('0x6d')](_0x555fba)&&_['isNumber'](_0x555fba)){return _0x376782[_0x9b6f('0x17')](0xc8)[_0x9b6f('0x18')]({'contacts':_0x555fba});}else{logger['error'](_0x9b6f('0x91'),_0x9b6f('0x8f'),0x194,'entity\x20not\x20found');_0x376782[_0x9b6f('0x16')](0x194);}})['catch'](handleError(_0x376782,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 4554ef7..7666c47 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 _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5f5919,_0x439a87){var _0x4b122b=function(_0x367f74){while(--_0x367f74){_0x5f5919['push'](_0x5f5919['shift']());}};_0x4b122b(++_0x439a87);}(_0x524e,0x15e));var _0xe524=function(_0x5d88ba,_0x5f218e){_0x5d88ba=_0x5d88ba-0x0;var _0x32e6bf=_0x524e[_0x5d88ba];return _0x32e6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x10b2d5,_0x5a7743){var _0x14b8d1=function(_0x3b888c){while(--_0x3b888c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x14b8d1(++_0x5a7743);}(_0xba34,0x119));var _0x4ba3=function(_0x29efa9,_0x43fcb4){_0x29efa9=_0x29efa9-0x0;var _0x2c219f=_0xba34[_0x29efa9];return _0x2c219f;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 28b23c1..edbea2e 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 _0x7abf=['limit','include','model','map','debug','find','raw','info','ShowCmHopper','CreateCmHopper','catch','UpdateCmHopper','update','body','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','User','Agent','length','UserId','push','includes','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','all','GetCmHopperPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','CmHopper,\x20%s,\x20%s','result','GetCmHopper','CmHopper','findAll','options','where','attributes'];(function(_0x50d7c7,_0x3cef1d){var _0x5cb0f5=function(_0x3c157c){while(--_0x3c157c){_0x50d7c7['push'](_0x50d7c7['shift']());}};_0x5cb0f5(++_0x3cef1d);}(_0x7abf,0xb6));var _0xf7ab=function(_0x3ae3b3,_0x2a1da7){_0x3ae3b3=_0x3ae3b3-0x0;var _0x392edc=_0x7abf[_0x3ae3b3];return _0x392edc;};'use strict';var _=require('lodash');var util=require(_0xf7ab('0x0'));var moment=require(_0xf7ab('0x1'));var BPromise=require(_0xf7ab('0x2'));var rs=require(_0xf7ab('0x3'));var fs=require('fs');var Redis=require(_0xf7ab('0x4'));var db=require(_0xf7ab('0x5'))['db'];var utils=require(_0xf7ab('0x6'));var logger=require(_0xf7ab('0x7'))(_0xf7ab('0x8'));var config=require(_0xf7ab('0x9'));var jayson=require(_0xf7ab('0xa'));var client=jayson[_0xf7ab('0xb')][_0xf7ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e9ca1,_0x4ecc7e,_0x778c0c){return new BPromise(function(_0x1297e8,_0x2a007b){return client[_0xf7ab('0xd')](_0x5e9ca1,_0x778c0c)[_0xf7ab('0xe')](function(_0x48084a){logger['info']('CmHopper,\x20%s,\x20%s',_0x4ecc7e,_0xf7ab('0xf'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x4ecc7e,_0xf7ab('0xf'),JSON[_0xf7ab('0x10')](_0x48084a));if(_0x48084a['error']){if(_0x48084a[_0xf7ab('0x11')][_0xf7ab('0x12')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x4ecc7e,_0x48084a[_0xf7ab('0x11')][_0xf7ab('0x13')]);return _0x2a007b(_0x48084a[_0xf7ab('0x11')][_0xf7ab('0x13')]);}logger[_0xf7ab('0x11')]('CmHopper,\x20%s,\x20%s',_0x4ecc7e,_0x48084a[_0xf7ab('0x11')][_0xf7ab('0x13')]);return _0x1297e8(_0x48084a[_0xf7ab('0x11')][_0xf7ab('0x13')]);}else{logger['info'](_0xf7ab('0x14'),_0x4ecc7e,'request\x20sent');_0x1297e8(_0x48084a[_0xf7ab('0x15')]['message']);}})['catch'](function(_0x5b6309){logger[_0xf7ab('0x11')]('CmHopper,\x20%s,\x20%s',_0x4ecc7e,_0x5b6309);_0x2a007b(_0x5b6309);});});}exports[_0xf7ab('0x16')]=function(_0x2661a7){var _0x27a628=this;return new Promise(function(_0x161417,_0x51cfee){return db[_0xf7ab('0x17')][_0xf7ab('0x18')]({'raw':_0x2661a7['options']?_0x2661a7[_0xf7ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2661a7[_0xf7ab('0x19')]?_0x2661a7[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null,'attributes':_0x2661a7[_0xf7ab('0x19')]?_0x2661a7[_0xf7ab('0x19')][_0xf7ab('0x1b')]||null:null,'limit':_0x2661a7[_0xf7ab('0x19')]?_0x2661a7[_0xf7ab('0x19')][_0xf7ab('0x1c')]||null:null,'include':_0x2661a7[_0xf7ab('0x19')]?_0x2661a7[_0xf7ab('0x19')][_0xf7ab('0x1d')]?_['map'](_0x2661a7[_0xf7ab('0x19')]['include'],function(_0x137e04){return{'model':db[_0x137e04[_0xf7ab('0x1e')]],'as':_0x137e04['as'],'attributes':_0x137e04[_0xf7ab('0x1b')],'include':_0x137e04[_0xf7ab('0x1d')]?_['map'](_0x137e04[_0xf7ab('0x1d')],function(_0xf35602){return{'model':db[_0xf35602['model']],'as':_0xf35602['as'],'attributes':_0xf35602[_0xf7ab('0x1b')],'include':_0xf35602['include']?_[_0xf7ab('0x1f')](_0xf35602[_0xf7ab('0x1d')],function(_0x23da23){return{'model':db[_0x23da23[_0xf7ab('0x1e')]],'as':_0x23da23['as'],'attributes':_0x23da23[_0xf7ab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30c226){logger['info']('GetCmHopper',_0x2661a7);logger[_0xf7ab('0x20')](_0xf7ab('0x16'),_0x2661a7,JSON['stringify'](_0x30c226));_0x161417(_0x30c226);})['catch'](function(_0x6a7d13){logger[_0xf7ab('0x11')](_0xf7ab('0x16'),_0x6a7d13[_0xf7ab('0x13')],_0x2661a7);_0x51cfee(_0x27a628[_0xf7ab('0x11')](0x1f4,_0x6a7d13[_0xf7ab('0x13')]));});});};exports['ShowCmHopper']=function(_0x5214db){var _0x4e330e=this;return new Promise(function(_0x32aef1,_0x19f00c){return db[_0xf7ab('0x17')][_0xf7ab('0x21')]({'raw':_0x5214db[_0xf7ab('0x19')]?_0x5214db[_0xf7ab('0x19')][_0xf7ab('0x22')]===undefined?!![]:![]:!![],'where':_0x5214db[_0xf7ab('0x19')]?_0x5214db[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null,'attributes':_0x5214db[_0xf7ab('0x19')]?_0x5214db[_0xf7ab('0x19')][_0xf7ab('0x1b')]||null:null,'include':_0x5214db[_0xf7ab('0x19')]?_0x5214db['options']['include']?_[_0xf7ab('0x1f')](_0x5214db[_0xf7ab('0x19')][_0xf7ab('0x1d')],function(_0xcff1e6){return{'model':db[_0xcff1e6['model']],'as':_0xcff1e6['as'],'attributes':_0xcff1e6[_0xf7ab('0x1b')],'include':_0xcff1e6[_0xf7ab('0x1d')]?_[_0xf7ab('0x1f')](_0xcff1e6[_0xf7ab('0x1d')],function(_0x32139c){return{'model':db[_0x32139c[_0xf7ab('0x1e')]],'as':_0x32139c['as'],'attributes':_0x32139c[_0xf7ab('0x1b')],'include':_0x32139c['include']?_[_0xf7ab('0x1f')](_0x32139c[_0xf7ab('0x1d')],function(_0x1fb0d3){return{'model':db[_0x1fb0d3[_0xf7ab('0x1e')]],'as':_0x1fb0d3['as'],'attributes':_0x1fb0d3[_0xf7ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7ab('0xe')](function(_0xee7e04){logger[_0xf7ab('0x23')]('ShowCmHopper',_0x5214db);logger[_0xf7ab('0x20')](_0xf7ab('0x24'),_0x5214db,JSON[_0xf7ab('0x10')](_0xee7e04));_0x32aef1(_0xee7e04);})['catch'](function(_0x28464b){logger[_0xf7ab('0x11')](_0xf7ab('0x24'),_0x28464b['message'],_0x5214db);_0x19f00c(_0x4e330e[_0xf7ab('0x11')](0x1f4,_0x28464b[_0xf7ab('0x13')]));});});};exports[_0xf7ab('0x25')]=function(_0x2d6b60){var _0x3e292c=this;return new Promise(function(_0x40089b,_0x24f8ea){return db[_0xf7ab('0x17')]['create'](_0x2d6b60['body'],{'raw':_0x2d6b60[_0xf7ab('0x19')]?_0x2d6b60['options'][_0xf7ab('0x22')]===undefined?!![]:![]:!![]})[_0xf7ab('0xe')](function(_0x212172){logger[_0xf7ab('0x23')](_0xf7ab('0x25'),_0x2d6b60);logger[_0xf7ab('0x20')](_0xf7ab('0x25'),_0x2d6b60,JSON[_0xf7ab('0x10')](_0x212172));_0x40089b(_0x212172);})[_0xf7ab('0x26')](function(_0x5d4d51){logger[_0xf7ab('0x11')](_0xf7ab('0x25'),_0x5d4d51[_0xf7ab('0x13')],_0x2d6b60);_0x24f8ea(_0x3e292c[_0xf7ab('0x11')](0x1f4,_0x5d4d51[_0xf7ab('0x13')]));});});};exports[_0xf7ab('0x27')]=function(_0x28918e){var _0x543fce=this;return new Promise(function(_0x15aa32,_0xef7b45){return db['CmHopper'][_0xf7ab('0x28')](_0x28918e[_0xf7ab('0x29')],{'raw':_0x28918e['options']?_0x28918e[_0xf7ab('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28918e[_0xf7ab('0x19')]?_0x28918e[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null,'attributes':_0x28918e[_0xf7ab('0x19')]?_0x28918e[_0xf7ab('0x19')][_0xf7ab('0x1b')]||null:null,'limit':_0x28918e[_0xf7ab('0x19')]?_0x28918e['options'][_0xf7ab('0x1c')]||null:null})[_0xf7ab('0xe')](function(_0x11233e){logger['info'](_0xf7ab('0x27'),_0x28918e);logger['debug'](_0xf7ab('0x27'),_0x28918e,JSON['stringify'](_0x11233e));_0x15aa32(_0x11233e);})[_0xf7ab('0x26')](function(_0x9ec872){logger[_0xf7ab('0x11')]('UpdateCmHopper',_0x9ec872[_0xf7ab('0x13')],_0x28918e);_0xef7b45(_0x543fce[_0xf7ab('0x11')](0x1f4,_0x9ec872[_0xf7ab('0x13')]));});});};exports['DestroyCmHopper']=function(_0xc0d33f){var _0x540a91=this;return new Promise(function(_0x46367,_0x3dd126){return db[_0xf7ab('0x17')][_0xf7ab('0x2a')]({'where':_0xc0d33f[_0xf7ab('0x19')]?_0xc0d33f[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null})[_0xf7ab('0xe')](function(_0x8b0fee){logger[_0xf7ab('0x23')](_0xf7ab('0x2b'),_0xc0d33f);logger['debug'](_0xf7ab('0x2b'),_0xc0d33f,JSON[_0xf7ab('0x10')](_0x8b0fee));_0x46367(_0x8b0fee);})[_0xf7ab('0x26')](function(_0x5c80bb){logger[_0xf7ab('0x11')]('DestroyCmHopper',_0x5c80bb['message'],_0xc0d33f);_0x3dd126(_0x540a91[_0xf7ab('0x11')](0x1f4,_0x5c80bb[_0xf7ab('0x13')]));});});};exports[_0xf7ab('0x2c')]=function(_0x423f8f){var _0x9520c7=this;return new Promise(function(_0x5c6aa2,_0x2a54c9){return db[_0xf7ab('0x2d')][_0xf7ab('0x2e')]()[_0xf7ab('0xe')](function(_0x24d4da){return db[_0xf7ab('0x2f')][_0xf7ab('0x30')](function(_0xfcb7a2){return db['CmHopper'][_0xf7ab('0x18')]({'where':_0x423f8f[_0xf7ab('0x19')]?_0x423f8f[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null,'attributes':_0x423f8f[_0xf7ab('0x19')]?_0x423f8f[_0xf7ab('0x19')]['attributes']||null:null,'limit':_0x423f8f['options']?_0x423f8f[_0xf7ab('0x19')][_0xf7ab('0x1c')]||null:null,'order':_0x423f8f[_0xf7ab('0x19')]?_0x423f8f['options']['order']||null:null,'transaction':_0xfcb7a2,'lock':_0xfcb7a2[_0xf7ab('0x31')][_0xf7ab('0x32')],'include':[{'model':db[_0xf7ab('0x2d')],'as':'Contact','attributes':_['keys'](_0x24d4da)},{'model':db[_0xf7ab('0x33')],'as':_0xf7ab('0x34'),'attributes':['id','name','voicePause']}]})[_0xf7ab('0xe')](function(_0x40ebe7){var _0x3218ac=[];var _0x1b4b43=[];for(var _0x15ae64=0x0;_0x15ae64<_0x40ebe7[_0xf7ab('0x35')];_0x15ae64+=0x1){var _0xf7d69f=_0x40ebe7[_0x15ae64][_0xf7ab('0x36')];if(_0xf7d69f===null){_0x3218ac[_0xf7ab('0x37')](_0x40ebe7[_0x15ae64][_0xf7ab('0x28')](_0x423f8f[_0xf7ab('0x29')],{'transaction':_0xfcb7a2}));}else if(!_0x1b4b43[_0xf7ab('0x38')](_0xf7d69f)){_0x1b4b43[_0xf7ab('0x37')](_0xf7d69f);_0x3218ac['push'](_0x40ebe7[_0x15ae64][_0xf7ab('0x28')](_0x423f8f[_0xf7ab('0x29')],{'transaction':_0xfcb7a2}));}}return BPromise['all'](_0x3218ac);});})[_0xf7ab('0xe')](function(_0x114cc3){logger[_0xf7ab('0x23')](_0xf7ab('0x2c'),_0x423f8f);logger[_0xf7ab('0x20')]('GetContactDialer',_0x423f8f,JSON[_0xf7ab('0x10')](_0x114cc3));_0x5c6aa2(_0x114cc3);})[_0xf7ab('0x26')](function(_0x420eac){logger[_0xf7ab('0x11')]('GetContactDialer',_0x420eac[_0xf7ab('0x13')],_0x423f8f);_0x2a54c9(_0x9520c7[_0xf7ab('0x11')](0x1f4,_0x420eac[_0xf7ab('0x13')]));});});});};exports[_0xf7ab('0x39')]=function(_0x128191){var _0x32c129=this;return new Promise(function(_0x27037a,_0xe86ee2){return db[_0xf7ab('0x2f')][_0xf7ab('0x30')](function(_0x30a238){return db[_0xf7ab('0x3a')]['create'](_0x128191[_0xf7ab('0x29')],{'raw':_0x128191['options']?_0x128191[_0xf7ab('0x19')][_0xf7ab('0x22')]===undefined?!![]:![]:!![],'transaction':_0x30a238})[_0xf7ab('0xe')](function(){return db[_0xf7ab('0x17')][_0xf7ab('0x2a')]({'where':_0x128191[_0xf7ab('0x19')]?_0x128191['options'][_0xf7ab('0x1a')]||null:null,'transaction':_0x30a238});});})[_0xf7ab('0xe')](function(_0x57ae77){logger[_0xf7ab('0x23')]('MoveContactManagedDialer',_0x128191);logger[_0xf7ab('0x20')](_0xf7ab('0x39'),_0x128191,JSON[_0xf7ab('0x10')](_0x57ae77));_0x27037a(_0x57ae77);})['catch'](function(_0x3da542){logger[_0xf7ab('0x11')]('MoveContactManagedDialer',_0x3da542[_0xf7ab('0x13')],_0x128191);_0xe86ee2(_0x32c129['error'](0x1f4,_0x3da542['message']));});});};exports[_0xf7ab('0x3b')]=function(_0x31be51){var _0x3bbfd6=this;return new Promise(function(_0x56806c,_0x462083){return db[_0xf7ab('0x17')][_0xf7ab('0x18')]({'raw':_0x31be51[_0xf7ab('0x19')]?_0x31be51[_0xf7ab('0x19')][_0xf7ab('0x22')]===undefined?!![]:![]:!![],'where':_0x31be51[_0xf7ab('0x19')]?_0x31be51['options'][_0xf7ab('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf7ab('0x3c'),db['sequelize']['fn']('IF',db[_0xf7ab('0x2f')][_0xf7ab('0x3d')]('`scheduledat`\x20>=\x20'+util[_0xf7ab('0x3e')](_0xf7ab('0x3f'),moment()[_0xf7ab('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xf7ab('0x40')))),_0xf7ab('0x41')]]})[_0xf7ab('0xe')](function(_0x3839bd){logger[_0xf7ab('0x23')](_0xf7ab('0x3b'),_0x31be51);logger[_0xf7ab('0x20')](_0xf7ab('0x3b'),_0x31be51,JSON[_0xf7ab('0x10')](_0x3839bd));_0x56806c(_0x3839bd);})[_0xf7ab('0x26')](function(_0xd03d55){logger[_0xf7ab('0x11')]('CountReScheduled',_0xd03d55['message'],_0x31be51);_0x462083(_0x3bbfd6['error'](0x1f4,_0xd03d55[_0xf7ab('0x13')]));});});};exports[_0xf7ab('0x42')]=function(_0x185300){var _0x110ff1=this;return new Promise(function(_0x59fd3b,_0x3d5409){return db['CmContact'][_0xf7ab('0x2e')]()['then'](function(_0x51b317){return db['sequelize'][_0xf7ab('0x30')](function(_0x4400f5){return db[_0xf7ab('0x17')][_0xf7ab('0x18')]({'where':_0x185300[_0xf7ab('0x19')]?_0x185300[_0xf7ab('0x19')][_0xf7ab('0x1a')]||null:null,'attributes':_0x185300[_0xf7ab('0x19')]?_0x185300[_0xf7ab('0x19')][_0xf7ab('0x1b')]||null:null,'limit':0x1,'order':_0x185300[_0xf7ab('0x19')]?_0x185300[_0xf7ab('0x19')][_0xf7ab('0x43')]||null:null,'group':db[_0xf7ab('0x17')]['UserId'],'transaction':_0x4400f5,'lock':_0x4400f5[_0xf7ab('0x31')][_0xf7ab('0x32')],'include':_0x185300[_0xf7ab('0x19')]?_0x185300[_0xf7ab('0x19')][_0xf7ab('0x1d')]?_[_0xf7ab('0x1f')](_0x185300['options'][_0xf7ab('0x1d')],function(_0x395660){return{'model':db[_0x395660[_0xf7ab('0x1e')]],'as':_0x395660['as'],'attributes':_0x395660[_0xf7ab('0x1b')],'include':_0x395660[_0xf7ab('0x1d')]?_[_0xf7ab('0x1f')](_0x395660['include'],function(_0x4ffc37){return{'model':db[_0x4ffc37[_0xf7ab('0x1e')]],'as':_0x4ffc37['as'],'attributes':_0x4ffc37[_0xf7ab('0x1b')],'include':_0x4ffc37['include']?_['map'](_0x4ffc37[_0xf7ab('0x1d')],function(_0x5cd280){return{'model':db[_0x5cd280[_0xf7ab('0x1e')]],'as':_0x5cd280['as'],'attributes':_0x5cd280[_0xf7ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7ab('0xe')](function(_0xac2e2c){var _0x2d9bcb=[];for(var _0x4a8c3c=0x0;_0x4a8c3c<_0xac2e2c['length'];_0x4a8c3c+=0x1){_0x2d9bcb[_0xf7ab('0x37')](_0xac2e2c[_0x4a8c3c][_0xf7ab('0x28')](_0x185300[_0xf7ab('0x29')],{'transaction':_0x4400f5}));}return BPromise[_0xf7ab('0x44')](_0x2d9bcb);});})[_0xf7ab('0xe')](function(_0x9ebd50){logger['info'](_0xf7ab('0x42'),_0x185300);logger[_0xf7ab('0x20')](_0xf7ab('0x42'),_0x185300,JSON[_0xf7ab('0x10')](_0x9ebd50));_0x59fd3b(_0x9ebd50);})[_0xf7ab('0x26')](function(_0x4b471f){logger['error'](_0xf7ab('0x42'),_0x4b471f[_0xf7ab('0x13')],_0x185300);_0x3d5409(_0x110ff1[_0xf7ab('0x11')](0x1f4,_0x4b471f['message']));});});});};exports[_0xf7ab('0x45')]=function(_0xdb57ce){var _0x4aca63=this;return new Promise(function(_0x31cbae,_0x5aff47){db['CmContact'][_0xf7ab('0x2e')]()[_0xf7ab('0xe')](function(_0x1f9392){return db['CmHopper'][_0xf7ab('0x18')]({'raw':_0xdb57ce['options']?_0xdb57ce[_0xf7ab('0x19')][_0xf7ab('0x22')]===undefined?!![]:![]:!![],'where':_0xdb57ce[_0xf7ab('0x19')]?_0xdb57ce[_0xf7ab('0x19')]['where']||null:null,'attributes':_0xdb57ce['options']?_0xdb57ce[_0xf7ab('0x19')][_0xf7ab('0x1b')]||null:null,'limit':_0xdb57ce[_0xf7ab('0x19')]?_0xdb57ce['options'][_0xf7ab('0x1c')]||null:null,'include':_0xdb57ce[_0xf7ab('0x19')]?_0xdb57ce[_0xf7ab('0x19')][_0xf7ab('0x1d')]?_['map'](_0xdb57ce[_0xf7ab('0x19')][_0xf7ab('0x1d')],function(_0x539365){return{'model':db[_0x539365['model']],'as':_0x539365['as'],'attributes':_0x539365['as']==='Contact'?_['keys'](_0x1f9392):_0x539365['attributes'],'include':_0x539365[_0xf7ab('0x1d')]?_['map'](_0x539365[_0xf7ab('0x1d')],function(_0x3af339){return{'model':db[_0x3af339[_0xf7ab('0x1e')]],'as':_0x3af339['as'],'attributes':_0x3af339[_0xf7ab('0x1b')],'include':_0x3af339[_0xf7ab('0x1d')]?_[_0xf7ab('0x1f')](_0x3af339['include'],function(_0x4eec88){return{'model':db[_0x4eec88[_0xf7ab('0x1e')]],'as':_0x4eec88['as'],'attributes':_0x4eec88[_0xf7ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7ab('0xe')](function(_0x20cd67){logger[_0xf7ab('0x23')](_0xf7ab('0x16'),_0xdb57ce);logger['debug'](_0xf7ab('0x16'),_0xdb57ce,JSON['stringify'](_0x20cd67));_0x31cbae(_0x20cd67);})[_0xf7ab('0x26')](function(_0x42ebd6){logger[_0xf7ab('0x11')](_0xf7ab('0x16'),_0x42ebd6[_0xf7ab('0x13')],_0xdb57ce);_0x5aff47(_0x4aca63['error'](0x1f4,_0x42ebd6[_0xf7ab('0x13')]));});});});}; \ No newline at end of file +var _0x0ac8=['voicePause','length','UserId','push','includes','update','all','GetContactDialer','transaction','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CmContact','LOCK','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopper','findAll','options','raw','attributes','include','map','model','GetCmHopper','stringify','find','where','ShowCmHopper','CreateCmHopper','create','body','debug','UpdateCmHopper','limit','DestroyCmHopper','destroy','describe','order','UPDATE','keys','User','name'];(function(_0x1a90fc,_0x1f232f){var _0x48c470=function(_0x4c6f69){while(--_0x4c6f69){_0x1a90fc['push'](_0x1a90fc['shift']());}};_0x48c470(++_0x1f232f);}(_0x0ac8,0xab));var _0x80ac=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x0ac8[_0x5a905e];return _0x4124d6;};'use strict';var _=require(_0x80ac('0x0'));var util=require('util');var moment=require(_0x80ac('0x1'));var BPromise=require(_0x80ac('0x2'));var rs=require(_0x80ac('0x3'));var fs=require('fs');var Redis=require(_0x80ac('0x4'));var db=require(_0x80ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ac('0x6'))('rpc');var config=require(_0x80ac('0x7'));var jayson=require(_0x80ac('0x8'));var client=jayson[_0x80ac('0x9')][_0x80ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527238,_0x1c8c72,_0x193371){return new BPromise(function(_0x53f26c,_0x5ba97e){return client[_0x80ac('0xb')](_0x527238,_0x193371)[_0x80ac('0xc')](function(_0x42861d){logger[_0x80ac('0xd')](_0x80ac('0xe'),_0x1c8c72,_0x80ac('0xf'));logger['debug'](_0x80ac('0x10'),_0x1c8c72,_0x80ac('0xf'),JSON['stringify'](_0x42861d));if(_0x42861d[_0x80ac('0x11')]){if(_0x42861d['error']['code']===0x1f4){logger[_0x80ac('0x11')](_0x80ac('0xe'),_0x1c8c72,_0x42861d[_0x80ac('0x11')][_0x80ac('0x12')]);return _0x5ba97e(_0x42861d[_0x80ac('0x11')][_0x80ac('0x12')]);}logger['error'](_0x80ac('0xe'),_0x1c8c72,_0x42861d[_0x80ac('0x11')]['message']);return _0x53f26c(_0x42861d['error'][_0x80ac('0x12')]);}else{logger['info'](_0x80ac('0xe'),_0x1c8c72,_0x80ac('0xf'));_0x53f26c(_0x42861d[_0x80ac('0x13')]['message']);}})[_0x80ac('0x14')](function(_0x308f8f){logger[_0x80ac('0x11')](_0x80ac('0xe'),_0x1c8c72,_0x308f8f);_0x5ba97e(_0x308f8f);});});}exports['GetCmHopper']=function(_0x254eca){var _0x1820c9=this;return new Promise(function(_0x504ccf,_0x127700){return db[_0x80ac('0x15')][_0x80ac('0x16')]({'raw':_0x254eca[_0x80ac('0x17')]?_0x254eca[_0x80ac('0x17')][_0x80ac('0x18')]===undefined?!![]:![]:!![],'where':_0x254eca[_0x80ac('0x17')]?_0x254eca['options']['where']||null:null,'attributes':_0x254eca['options']?_0x254eca[_0x80ac('0x17')][_0x80ac('0x19')]||null:null,'limit':_0x254eca['options']?_0x254eca[_0x80ac('0x17')]['limit']||null:null,'include':_0x254eca['options']?_0x254eca[_0x80ac('0x17')][_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x254eca[_0x80ac('0x17')]['include'],function(_0x1abe64){return{'model':db[_0x1abe64['model']],'as':_0x1abe64['as'],'attributes':_0x1abe64[_0x80ac('0x19')],'include':_0x1abe64[_0x80ac('0x1a')]?_['map'](_0x1abe64[_0x80ac('0x1a')],function(_0x37c3d6){return{'model':db[_0x37c3d6[_0x80ac('0x1c')]],'as':_0x37c3d6['as'],'attributes':_0x37c3d6[_0x80ac('0x19')],'include':_0x37c3d6[_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x37c3d6[_0x80ac('0x1a')],function(_0x316bab){return{'model':db[_0x316bab[_0x80ac('0x1c')]],'as':_0x316bab['as'],'attributes':_0x316bab[_0x80ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x80ac('0xc')](function(_0x20a475){logger[_0x80ac('0xd')](_0x80ac('0x1d'),_0x254eca);logger['debug'](_0x80ac('0x1d'),_0x254eca,JSON[_0x80ac('0x1e')](_0x20a475));_0x504ccf(_0x20a475);})[_0x80ac('0x14')](function(_0x208e40){logger[_0x80ac('0x11')](_0x80ac('0x1d'),_0x208e40[_0x80ac('0x12')],_0x254eca);_0x127700(_0x1820c9[_0x80ac('0x11')](0x1f4,_0x208e40[_0x80ac('0x12')]));});});};exports['ShowCmHopper']=function(_0x781443){var _0xebe48c=this;return new Promise(function(_0x13b041,_0x2978df){return db[_0x80ac('0x15')][_0x80ac('0x1f')]({'raw':_0x781443[_0x80ac('0x17')]?_0x781443[_0x80ac('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x781443[_0x80ac('0x17')]?_0x781443[_0x80ac('0x17')][_0x80ac('0x20')]||null:null,'attributes':_0x781443[_0x80ac('0x17')]?_0x781443['options'][_0x80ac('0x19')]||null:null,'include':_0x781443['options']?_0x781443[_0x80ac('0x17')]['include']?_['map'](_0x781443[_0x80ac('0x17')][_0x80ac('0x1a')],function(_0x34e5eb){return{'model':db[_0x34e5eb[_0x80ac('0x1c')]],'as':_0x34e5eb['as'],'attributes':_0x34e5eb['attributes'],'include':_0x34e5eb[_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x34e5eb[_0x80ac('0x1a')],function(_0x15dbcb){return{'model':db[_0x15dbcb[_0x80ac('0x1c')]],'as':_0x15dbcb['as'],'attributes':_0x15dbcb[_0x80ac('0x19')],'include':_0x15dbcb['include']?_['map'](_0x15dbcb[_0x80ac('0x1a')],function(_0x18dec2){return{'model':db[_0x18dec2['model']],'as':_0x18dec2['as'],'attributes':_0x18dec2[_0x80ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x80ac('0xc')](function(_0x42830c){logger[_0x80ac('0xd')](_0x80ac('0x21'),_0x781443);logger['debug'](_0x80ac('0x21'),_0x781443,JSON[_0x80ac('0x1e')](_0x42830c));_0x13b041(_0x42830c);})['catch'](function(_0x3c41de){logger['error'](_0x80ac('0x21'),_0x3c41de[_0x80ac('0x12')],_0x781443);_0x2978df(_0xebe48c[_0x80ac('0x11')](0x1f4,_0x3c41de[_0x80ac('0x12')]));});});};exports[_0x80ac('0x22')]=function(_0x47f2fb){var _0x179573=this;return new Promise(function(_0x50b01d,_0x400550){return db['CmHopper'][_0x80ac('0x23')](_0x47f2fb[_0x80ac('0x24')],{'raw':_0x47f2fb[_0x80ac('0x17')]?_0x47f2fb[_0x80ac('0x17')][_0x80ac('0x18')]===undefined?!![]:![]:!![]})[_0x80ac('0xc')](function(_0x2fcc3d){logger[_0x80ac('0xd')]('CreateCmHopper',_0x47f2fb);logger[_0x80ac('0x25')](_0x80ac('0x22'),_0x47f2fb,JSON[_0x80ac('0x1e')](_0x2fcc3d));_0x50b01d(_0x2fcc3d);})[_0x80ac('0x14')](function(_0x255a69){logger[_0x80ac('0x11')](_0x80ac('0x22'),_0x255a69[_0x80ac('0x12')],_0x47f2fb);_0x400550(_0x179573[_0x80ac('0x11')](0x1f4,_0x255a69[_0x80ac('0x12')]));});});};exports[_0x80ac('0x26')]=function(_0x4ed580){var _0x2d196b=this;return new Promise(function(_0x5f3edb,_0x189418){return db[_0x80ac('0x15')]['update'](_0x4ed580[_0x80ac('0x24')],{'raw':_0x4ed580[_0x80ac('0x17')]?_0x4ed580[_0x80ac('0x17')][_0x80ac('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed580[_0x80ac('0x17')]?_0x4ed580['options'][_0x80ac('0x20')]||null:null,'attributes':_0x4ed580[_0x80ac('0x17')]?_0x4ed580[_0x80ac('0x17')][_0x80ac('0x19')]||null:null,'limit':_0x4ed580[_0x80ac('0x17')]?_0x4ed580[_0x80ac('0x17')][_0x80ac('0x27')]||null:null})['then'](function(_0x36cfa0){logger[_0x80ac('0xd')]('UpdateCmHopper',_0x4ed580);logger[_0x80ac('0x25')](_0x80ac('0x26'),_0x4ed580,JSON[_0x80ac('0x1e')](_0x36cfa0));_0x5f3edb(_0x36cfa0);})['catch'](function(_0x3639ea){logger[_0x80ac('0x11')](_0x80ac('0x26'),_0x3639ea['message'],_0x4ed580);_0x189418(_0x2d196b[_0x80ac('0x11')](0x1f4,_0x3639ea[_0x80ac('0x12')]));});});};exports[_0x80ac('0x28')]=function(_0x3d381d){var _0x3004dd=this;return new Promise(function(_0x157e1e,_0x185502){return db[_0x80ac('0x15')][_0x80ac('0x29')]({'where':_0x3d381d['options']?_0x3d381d[_0x80ac('0x17')][_0x80ac('0x20')]||null:null})[_0x80ac('0xc')](function(_0x1a8880){logger['info'](_0x80ac('0x28'),_0x3d381d);logger[_0x80ac('0x25')](_0x80ac('0x28'),_0x3d381d,JSON[_0x80ac('0x1e')](_0x1a8880));_0x157e1e(_0x1a8880);})[_0x80ac('0x14')](function(_0x1e96ff){logger[_0x80ac('0x11')](_0x80ac('0x28'),_0x1e96ff['message'],_0x3d381d);_0x185502(_0x3004dd['error'](0x1f4,_0x1e96ff[_0x80ac('0x12')]));});});};exports['GetContactDialer']=function(_0x3be13a){var _0x2fa5c2=this;return new Promise(function(_0x6a9263,_0x4080ba){return db['CmContact'][_0x80ac('0x2a')]()[_0x80ac('0xc')](function(_0x157ed2){return db['sequelize']['transaction'](function(_0x24d988){return db[_0x80ac('0x15')][_0x80ac('0x16')]({'where':_0x3be13a[_0x80ac('0x17')]?_0x3be13a[_0x80ac('0x17')][_0x80ac('0x20')]||null:null,'attributes':_0x3be13a[_0x80ac('0x17')]?_0x3be13a[_0x80ac('0x17')][_0x80ac('0x19')]||null:null,'limit':_0x3be13a[_0x80ac('0x17')]?_0x3be13a[_0x80ac('0x17')][_0x80ac('0x27')]||null:null,'order':_0x3be13a['options']?_0x3be13a[_0x80ac('0x17')][_0x80ac('0x2b')]||null:null,'transaction':_0x24d988,'lock':_0x24d988['LOCK'][_0x80ac('0x2c')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x80ac('0x2d')](_0x157ed2)},{'model':db[_0x80ac('0x2e')],'as':'Agent','attributes':['id',_0x80ac('0x2f'),_0x80ac('0x30')]}]})[_0x80ac('0xc')](function(_0xd2edbe){var _0xaa1871=[];var _0x4f9b93=[];for(var _0x23ecfc=0x0;_0x23ecfc<_0xd2edbe[_0x80ac('0x31')];_0x23ecfc+=0x1){var _0x2da1ac=_0xd2edbe[_0x23ecfc][_0x80ac('0x32')];if(_0x2da1ac===null){_0xaa1871[_0x80ac('0x33')](_0xd2edbe[_0x23ecfc]['update'](_0x3be13a['body'],{'transaction':_0x24d988}));}else if(!_0x4f9b93[_0x80ac('0x34')](_0x2da1ac)){_0x4f9b93[_0x80ac('0x33')](_0x2da1ac);_0xaa1871['push'](_0xd2edbe[_0x23ecfc][_0x80ac('0x35')](_0x3be13a[_0x80ac('0x24')],{'transaction':_0x24d988}));}}return BPromise[_0x80ac('0x36')](_0xaa1871);});})['then'](function(_0xf8bd46){logger['info'](_0x80ac('0x37'),_0x3be13a);logger[_0x80ac('0x25')](_0x80ac('0x37'),_0x3be13a,JSON[_0x80ac('0x1e')](_0xf8bd46));_0x6a9263(_0xf8bd46);})[_0x80ac('0x14')](function(_0x8027cb){logger['error'](_0x80ac('0x37'),_0x8027cb[_0x80ac('0x12')],_0x3be13a);_0x4080ba(_0x2fa5c2[_0x80ac('0x11')](0x1f4,_0x8027cb['message']));});});});};exports['MoveContactManagedDialer']=function(_0xb7a86b){var _0x5a2547=this;return new Promise(function(_0x589386,_0x16754b){return db['sequelize'][_0x80ac('0x38')](function(_0x46ca52){return db[_0x80ac('0x39')][_0x80ac('0x23')](_0xb7a86b[_0x80ac('0x24')],{'raw':_0xb7a86b[_0x80ac('0x17')]?_0xb7a86b[_0x80ac('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x46ca52})[_0x80ac('0xc')](function(){return db[_0x80ac('0x15')]['destroy']({'where':_0xb7a86b['options']?_0xb7a86b['options'][_0x80ac('0x20')]||null:null,'transaction':_0x46ca52});});})['then'](function(_0x26894c){logger['info']('MoveContactManagedDialer',_0xb7a86b);logger[_0x80ac('0x25')](_0x80ac('0x3a'),_0xb7a86b,JSON[_0x80ac('0x1e')](_0x26894c));_0x589386(_0x26894c);})[_0x80ac('0x14')](function(_0x15326b){logger[_0x80ac('0x11')]('MoveContactManagedDialer',_0x15326b[_0x80ac('0x12')],_0xb7a86b);_0x16754b(_0x5a2547[_0x80ac('0x11')](0x1f4,_0x15326b[_0x80ac('0x12')]));});});};exports[_0x80ac('0x3b')]=function(_0x47a9fb){var _0x2d50dc=this;return new Promise(function(_0x324341,_0x3ed213){return db[_0x80ac('0x15')]['findAll']({'raw':_0x47a9fb[_0x80ac('0x17')]?_0x47a9fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x47a9fb[_0x80ac('0x17')]?_0x47a9fb[_0x80ac('0x17')]['where']||null:null,'attributes':[[db[_0x80ac('0x3c')]['fn'](_0x80ac('0x3d'),db[_0x80ac('0x3c')]['fn']('IF',db[_0x80ac('0x3c')][_0x80ac('0x3e')](_0x80ac('0x3f')+util[_0x80ac('0x40')](_0x80ac('0x41'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x80ac('0x42')))),_0x80ac('0x43')]]})['then'](function(_0x40c796){logger['info'](_0x80ac('0x3b'),_0x47a9fb);logger[_0x80ac('0x25')](_0x80ac('0x3b'),_0x47a9fb,JSON['stringify'](_0x40c796));_0x324341(_0x40c796);})[_0x80ac('0x14')](function(_0x1a4cb7){logger[_0x80ac('0x11')](_0x80ac('0x3b'),_0x1a4cb7['message'],_0x47a9fb);_0x3ed213(_0x2d50dc[_0x80ac('0x11')](0x1f4,_0x1a4cb7['message']));});});};exports['GetContactRecallMe']=function(_0x17df70){var _0x24f03d=this;return new Promise(function(_0x2d7639,_0x2ee144){return db[_0x80ac('0x44')][_0x80ac('0x2a')]()[_0x80ac('0xc')](function(_0x5e315d){return db[_0x80ac('0x3c')][_0x80ac('0x38')](function(_0x419f7b){return db[_0x80ac('0x15')][_0x80ac('0x16')]({'where':_0x17df70['options']?_0x17df70['options'][_0x80ac('0x20')]||null:null,'attributes':_0x17df70[_0x80ac('0x17')]?_0x17df70[_0x80ac('0x17')][_0x80ac('0x19')]||null:null,'limit':0x1,'order':_0x17df70[_0x80ac('0x17')]?_0x17df70['options'][_0x80ac('0x2b')]||null:null,'group':db[_0x80ac('0x15')][_0x80ac('0x32')],'transaction':_0x419f7b,'lock':_0x419f7b[_0x80ac('0x45')][_0x80ac('0x2c')],'include':_0x17df70[_0x80ac('0x17')]?_0x17df70[_0x80ac('0x17')][_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x17df70[_0x80ac('0x17')][_0x80ac('0x1a')],function(_0x5e9dad){return{'model':db[_0x5e9dad['model']],'as':_0x5e9dad['as'],'attributes':_0x5e9dad[_0x80ac('0x19')],'include':_0x5e9dad[_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x5e9dad[_0x80ac('0x1a')],function(_0x4d62c8){return{'model':db[_0x4d62c8[_0x80ac('0x1c')]],'as':_0x4d62c8['as'],'attributes':_0x4d62c8[_0x80ac('0x19')],'include':_0x4d62c8[_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x4d62c8[_0x80ac('0x1a')],function(_0x4ffd31){return{'model':db[_0x4ffd31[_0x80ac('0x1c')]],'as':_0x4ffd31['as'],'attributes':_0x4ffd31[_0x80ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x80ac('0xc')](function(_0x3a14a2){var _0x129d13=[];for(var _0x3216e6=0x0;_0x3216e6<_0x3a14a2[_0x80ac('0x31')];_0x3216e6+=0x1){_0x129d13[_0x80ac('0x33')](_0x3a14a2[_0x3216e6][_0x80ac('0x35')](_0x17df70[_0x80ac('0x24')],{'transaction':_0x419f7b}));}return BPromise['all'](_0x129d13);});})[_0x80ac('0xc')](function(_0x38df63){logger[_0x80ac('0xd')](_0x80ac('0x46'),_0x17df70);logger['debug']('GetContactRecallMe',_0x17df70,JSON[_0x80ac('0x1e')](_0x38df63));_0x2d7639(_0x38df63);})[_0x80ac('0x14')](function(_0x41276f){logger['error'](_0x80ac('0x46'),_0x41276f[_0x80ac('0x12')],_0x17df70);_0x2ee144(_0x24f03d[_0x80ac('0x11')](0x1f4,_0x41276f['message']));});});});};exports[_0x80ac('0x47')]=function(_0x4fe4b6){var _0x11f7cc=this;return new Promise(function(_0x4b80fa,_0x906481){db[_0x80ac('0x44')][_0x80ac('0x2a')]()['then'](function(_0x506369){return db[_0x80ac('0x15')]['findAll']({'raw':_0x4fe4b6['options']?_0x4fe4b6[_0x80ac('0x17')][_0x80ac('0x18')]===undefined?!![]:![]:!![],'where':_0x4fe4b6[_0x80ac('0x17')]?_0x4fe4b6[_0x80ac('0x17')][_0x80ac('0x20')]||null:null,'attributes':_0x4fe4b6[_0x80ac('0x17')]?_0x4fe4b6[_0x80ac('0x17')][_0x80ac('0x19')]||null:null,'limit':_0x4fe4b6[_0x80ac('0x17')]?_0x4fe4b6[_0x80ac('0x17')]['limit']||null:null,'include':_0x4fe4b6[_0x80ac('0x17')]?_0x4fe4b6[_0x80ac('0x17')][_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x4fe4b6['options'][_0x80ac('0x1a')],function(_0x2a8786){return{'model':db[_0x2a8786[_0x80ac('0x1c')]],'as':_0x2a8786['as'],'attributes':_0x2a8786['as']===_0x80ac('0x48')?_[_0x80ac('0x2d')](_0x506369):_0x2a8786[_0x80ac('0x19')],'include':_0x2a8786[_0x80ac('0x1a')]?_[_0x80ac('0x1b')](_0x2a8786[_0x80ac('0x1a')],function(_0x1b90fd){return{'model':db[_0x1b90fd[_0x80ac('0x1c')]],'as':_0x1b90fd['as'],'attributes':_0x1b90fd[_0x80ac('0x19')],'include':_0x1b90fd['include']?_[_0x80ac('0x1b')](_0x1b90fd[_0x80ac('0x1a')],function(_0x462777){return{'model':db[_0x462777['model']],'as':_0x462777['as'],'attributes':_0x462777['attributes']};}):[]};}):[]};}):[]:[]})[_0x80ac('0xc')](function(_0x96f8ed){logger[_0x80ac('0xd')](_0x80ac('0x1d'),_0x4fe4b6);logger[_0x80ac('0x25')](_0x80ac('0x1d'),_0x4fe4b6,JSON[_0x80ac('0x1e')](_0x96f8ed));_0x4b80fa(_0x96f8ed);})[_0x80ac('0x14')](function(_0x40d7d9){logger[_0x80ac('0x11')]('GetCmHopper',_0x40d7d9[_0x80ac('0x12')],_0x4fe4b6);_0x906481(_0x11f7cc[_0x80ac('0x11')](0x1f4,_0x40d7d9[_0x80ac('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a504cff..32f20e1 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 _0x968c=['fs-extra','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','post','create','getPreview','put','/:id','update','destroy','exports','multer','util','Router'];(function(_0x370cb3,_0x1384b1){var _0x26eafd=function(_0x39e37a){while(--_0x39e37a){_0x370cb3['push'](_0x370cb3['shift']());}};_0x26eafd(++_0x1384b1);}(_0x968c,0xd9));var _0xc968=function(_0x4410b3,_0x3a09e3){_0x4410b3=_0x4410b3-0x0;var _0x3cf4a5=_0x968c[_0x4410b3];return _0x3cf4a5;};'use strict';var multer=require(_0xc968('0x0'));var util=require(_0xc968('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc968('0x2')]();var fs_extra=require(_0xc968('0x3'));var auth=require(_0xc968('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc968('0x5'));router[_0xc968('0x6')]('/',auth[_0xc968('0x7')](),controller[_0xc968('0x8')]);router[_0xc968('0x6')](_0xc968('0x9'),auth[_0xc968('0x7')](),controller[_0xc968('0xa')]);router[_0xc968('0x6')]('/opencontacts',auth['isAuthenticated'](),controller[_0xc968('0xb')]);router[_0xc968('0x6')]('/:id',auth[_0xc968('0x7')](),controller['show']);router[_0xc968('0xc')]('/',auth[_0xc968('0x7')](),controller[_0xc968('0xd')]);router['post']('/preview',auth[_0xc968('0x7')](),controller[_0xc968('0xe')]);router[_0xc968('0xf')](_0xc968('0x10'),auth[_0xc968('0x7')](),controller[_0xc968('0x11')]);router['delete'](_0xc968('0x10'),auth[_0xc968('0x7')](),controller[_0xc968('0x12')]);module[_0xc968('0x13')]=router; \ No newline at end of file +var _0x6471=['path','express','Router','fs-extra','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','create','getPreview','put','update','delete','destroy','exports','multer'];(function(_0x82e1cf,_0x53ed04){var _0x4c9bed=function(_0x4fbc66){while(--_0x4fbc66){_0x82e1cf['push'](_0x82e1cf['shift']());}};_0x4c9bed(++_0x53ed04);}(_0x6471,0x77));var _0x1647=function(_0x415e5e,_0x17c8f5){_0x415e5e=_0x415e5e-0x0;var _0x48f4de=_0x6471[_0x415e5e];return _0x48f4de;};'use strict';var multer=require(_0x1647('0x0'));var util=require('util');var path=require(_0x1647('0x1'));var timeout=require('connect-timeout');var express=require(_0x1647('0x2'));var router=express[_0x1647('0x3')]();var fs_extra=require(_0x1647('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1647('0x5'));var config=require('../../config/environment');var controller=require(_0x1647('0x6'));router[_0x1647('0x7')]('/',auth['isAuthenticated'](),controller[_0x1647('0x8')]);router[_0x1647('0x7')](_0x1647('0x9'),auth[_0x1647('0xa')](),controller[_0x1647('0xb')]);router[_0x1647('0x7')](_0x1647('0xc'),auth[_0x1647('0xa')](),controller[_0x1647('0xd')]);router[_0x1647('0x7')](_0x1647('0xe'),auth[_0x1647('0xa')](),controller[_0x1647('0xf')]);router[_0x1647('0x10')]('/',auth['isAuthenticated'](),controller[_0x1647('0x11')]);router[_0x1647('0x10')]('/preview',auth['isAuthenticated'](),controller[_0x1647('0x12')]);router[_0x1647('0x13')](_0x1647('0xe'),auth[_0x1647('0xa')](),controller[_0x1647('0x14')]);router[_0x1647('0x15')](_0x1647('0xe'),auth[_0x1647('0xa')](),controller[_0x1647('0x16')]);module[_0x1647('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 81aa593..16b6527 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 _0x63f1=['sequelize','STRING','contactListQueue','INTEGER','moment'];(function(_0x56ab45,_0x282dfd){var _0x5a27c5=function(_0x2a040e){while(--_0x2a040e){_0x56ab45['push'](_0x56ab45['shift']());}};_0x5a27c5(++_0x282dfd);}(_0x63f1,0x1da));var _0x163f=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x63f1[_0x25e7cb];return _0x375d92;};'use strict';var moment=require(_0x163f('0x0'));var Sequelize=require(_0x163f('0x1'));module['exports']={'phone':{'type':Sequelize[_0x163f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x163f('0x3')},'ListId':{'type':Sequelize[_0x163f('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x163f('0x4')],'unique':_0x163f('0x3')}}; \ No newline at end of file +var _0x8786=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8786,0x7a));var _0x6878=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8786[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0x6878('0x0'));var Sequelize=require(_0x6878('0x1'));module[_0x6878('0x2')]={'phone':{'type':Sequelize[_0x6878('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6878('0x4')],'unique':_0x6878('0x5')},'ListId':{'type':Sequelize[_0x6878('0x4')],'unique':_0x6878('0x5')},'VoiceQueueId':{'type':Sequelize[_0x6878('0x4')],'unique':_0x6878('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 00b18b5..c28e970 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 _0x4fe5=['index','map','CmHopperBlack','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','merge','find','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send'];(function(_0x44466d,_0x39a777){var _0x50e7fe=function(_0x135c72){while(--_0x135c72){_0x44466d['push'](_0x44466d['shift']());}};_0x50e7fe(++_0x39a777);}(_0x4fe5,0x171));var _0x54fe=function(_0x5d237e,_0x78f5a5){_0x5d237e=_0x5d237e-0x0;var _0x2fc84d=_0x4fe5[_0x5d237e];return _0x2fc84d;};'use strict';var emlformat=require(_0x54fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54fe('0x1'));var rp=require(_0x54fe('0x2'));var moment=require(_0x54fe('0x3'));var BPromise=require(_0x54fe('0x4'));var Mustache=require('mustache');var util=require(_0x54fe('0x5'));var path=require(_0x54fe('0x6'));var sox=require('sox');var csv=require(_0x54fe('0x7'));var ejs=require(_0x54fe('0x8'));var fs=require('fs');var fs_extra=require(_0x54fe('0x9'));var _=require(_0x54fe('0xa'));var squel=require(_0x54fe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x54fe('0xc'));var toCsv=require('to-csv');var querystring=require(_0x54fe('0xd'));var Papa=require(_0x54fe('0xe'));var Redis=require(_0x54fe('0xf'));var authService=require(_0x54fe('0x10'));var qs=require(_0x54fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54fe('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x54fe('0x13'));var config=require(_0x54fe('0x14'));var licenseUtil=require(_0x54fe('0x15'));var db=require(_0x54fe('0x16'))['db'];function respondWithStatusCode(_0x39fe34,_0x11c319){_0x11c319=_0x11c319||0xcc;return function(_0x58087d){if(_0x58087d){return _0x39fe34[_0x54fe('0x17')](_0x11c319);}return _0x39fe34[_0x54fe('0x18')](_0x11c319)['end']();};}function respondWithResult(_0x1f0012,_0x5db1b4){_0x5db1b4=_0x5db1b4||0xc8;return function(_0x15c8cf){if(_0x15c8cf){return _0x1f0012[_0x54fe('0x18')](_0x5db1b4)['json'](_0x15c8cf);}};}function respondWithFilteredResult(_0x46311f,_0x4b86fc){return function(_0x3fb619){if(_0x3fb619){var _0x3567b4=typeof _0x4b86fc['offset']===_0x54fe('0x19')&&typeof _0x4b86fc[_0x54fe('0x1a')]==='undefined';var _0x5d97cc=_0x3fb619['count'];var _0x1266d0=_0x3567b4?0x0:_0x4b86fc[_0x54fe('0x1b')];var _0x2d6d1a=_0x3567b4?_0x3fb619[_0x54fe('0x1c')]:_0x4b86fc[_0x54fe('0x1b')]+_0x4b86fc[_0x54fe('0x1a')];var _0x5da41d;if(_0x2d6d1a>=_0x5d97cc){_0x2d6d1a=_0x5d97cc;_0x5da41d=0xc8;}else{_0x5da41d=0xce;}_0x46311f[_0x54fe('0x18')](_0x5da41d);return _0x46311f['set'](_0x54fe('0x1d'),_0x1266d0+'-'+_0x2d6d1a+'/'+_0x5d97cc)[_0x54fe('0x1e')](_0x3fb619);}return null;};}function patchUpdates(_0x14ec31){return function(_0x302941){try{jsonpatch[_0x54fe('0x1f')](_0x302941,_0x14ec31,!![]);}catch(_0x455d2c){return BPromise[_0x54fe('0x20')](_0x455d2c);}return _0x302941[_0x54fe('0x21')]();};}function saveUpdates(_0x3f8b14,_0x4ca441){return function(_0x7f7f08){if(_0x7f7f08){return _0x7f7f08[_0x54fe('0x22')](_0x3f8b14)[_0x54fe('0x23')](function(_0x462e00){return _0x462e00;});}return null;};}function removeEntity(_0x26ad8f,_0x2ef820){return function(_0x38b39b){if(_0x38b39b){return _0x38b39b[_0x54fe('0x24')]()['then'](function(){_0x26ad8f[_0x54fe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446242,_0x171184){return function(_0x74642a){if(!_0x74642a){_0x446242[_0x54fe('0x17')](0x194);}return _0x74642a;};}function handleError(_0x160955,_0x5aa075){_0x5aa075=_0x5aa075||0x1f4;return function(_0xfe7369){logger['error'](_0xfe7369['stack']);if(_0xfe7369[_0x54fe('0x25')]){delete _0xfe7369['name'];}_0x160955[_0x54fe('0x18')](_0x5aa075)[_0x54fe('0x26')](_0xfe7369);};}exports[_0x54fe('0x27')]=function(_0x57be74,_0x48a18a){var _0xfb2f16={},_0x20b317={},_0x447e5c={'count':0x0,'rows':[]};var _0x577b32=_[_0x54fe('0x28')](db[_0x54fe('0x29')]['rawAttributes'],function(_0x12b605){return{'name':_0x12b605[_0x54fe('0x2a')],'type':_0x12b605['type'][_0x54fe('0x2b')]};});_0x20b317[_0x54fe('0x2c')]=_[_0x54fe('0x28')](_0x577b32,_0x54fe('0x25'));_0x20b317[_0x54fe('0x2d')]=_['keys'](_0x57be74['query']);_0x20b317[_0x54fe('0x2e')]=_[_0x54fe('0x2f')](_0x20b317[_0x54fe('0x2c')],_0x20b317[_0x54fe('0x2d')]);_0xfb2f16[_0x54fe('0x30')]=_[_0x54fe('0x2f')](_0x20b317[_0x54fe('0x2c')],qs['fields'](_0x57be74['query'][_0x54fe('0x31')]));_0xfb2f16[_0x54fe('0x30')]=_0xfb2f16['attributes'][_0x54fe('0x32')]?_0xfb2f16['attributes']:_0x20b317[_0x54fe('0x2c')];if(!_0x57be74[_0x54fe('0x2d')][_0x54fe('0x33')]('nolimit')){_0xfb2f16[_0x54fe('0x1a')]=qs[_0x54fe('0x1a')](_0x57be74[_0x54fe('0x2d')][_0x54fe('0x1a')]);_0xfb2f16[_0x54fe('0x1b')]=qs['offset'](_0x57be74[_0x54fe('0x2d')]['offset']);}_0xfb2f16[_0x54fe('0x34')]=qs[_0x54fe('0x35')](_0x57be74[_0x54fe('0x2d')]['sort']);_0xfb2f16[_0x54fe('0x36')]=qs[_0x54fe('0x2e')](_['pick'](_0x57be74[_0x54fe('0x2d')],_0x20b317[_0x54fe('0x2e')]),_0x577b32);if(_0x57be74[_0x54fe('0x2d')][_0x54fe('0x37')]){_0xfb2f16[_0x54fe('0x36')]=_['merge'](_0xfb2f16[_0x54fe('0x36')],{'$or':_['map'](_0x577b32,function(_0x343836){if(_0x343836['type']!==_0x54fe('0x38')){var _0x17d270={};_0x17d270[_0x343836[_0x54fe('0x25')]]={'$like':'%'+_0x57be74['query']['filter']+'%'};return _0x17d270;}})});}_0xfb2f16=_['merge']({},_0xfb2f16,_0x57be74[_0x54fe('0x39')]);var _0x1f9452={'where':_0xfb2f16['where']};return db['CmHopperBlack'][_0x54fe('0x1c')](_0x1f9452)[_0x54fe('0x23')](function(_0x49adf7){_0x447e5c[_0x54fe('0x1c')]=_0x49adf7;if(_0x57be74['query'][_0x54fe('0x3a')]){_0xfb2f16[_0x54fe('0x3b')]=[{'all':!![]}];}return db[_0x54fe('0x29')][_0x54fe('0x3c')](_0xfb2f16);})['then'](function(_0x85aa69){_0x447e5c['rows']=_0x85aa69;return _0x447e5c;})['then'](respondWithFilteredResult(_0x48a18a,_0xfb2f16))[_0x54fe('0x3d')](handleError(_0x48a18a,null));};exports['show']=function(_0x447359,_0x67956){var _0x326dd4={'raw':!![],'where':{'id':_0x447359[_0x54fe('0x3e')]['id']}},_0x55c8b3={};_0x55c8b3['model']=_[_0x54fe('0x3f')](db[_0x54fe('0x29')]['rawAttributes']);_0x55c8b3[_0x54fe('0x2d')]=_[_0x54fe('0x3f')](_0x447359[_0x54fe('0x2d')]);_0x55c8b3[_0x54fe('0x2e')]=_[_0x54fe('0x2f')](_0x55c8b3[_0x54fe('0x2c')],_0x55c8b3[_0x54fe('0x2d')]);_0x326dd4[_0x54fe('0x30')]=_[_0x54fe('0x2f')](_0x55c8b3[_0x54fe('0x2c')],qs[_0x54fe('0x31')](_0x447359['query']['fields']));_0x326dd4[_0x54fe('0x30')]=_0x326dd4[_0x54fe('0x30')][_0x54fe('0x32')]?_0x326dd4[_0x54fe('0x30')]:_0x55c8b3['model'];if(_0x447359[_0x54fe('0x2d')][_0x54fe('0x3a')]){_0x326dd4[_0x54fe('0x3b')]=[{'all':!![]}];}_0x326dd4=_[_0x54fe('0x40')]({},_0x326dd4,_0x447359[_0x54fe('0x39')]);return db['CmHopperBlack'][_0x54fe('0x41')](_0x326dd4)[_0x54fe('0x23')](handleEntityNotFound(_0x67956,null))[_0x54fe('0x23')](respondWithResult(_0x67956,null))[_0x54fe('0x3d')](handleError(_0x67956,null));};exports[_0x54fe('0x22')]=function(_0x902741,_0x5ce310){if(_0x902741['body']['id']){delete _0x902741[_0x54fe('0x42')]['id'];}return db[_0x54fe('0x29')][_0x54fe('0x41')]({'where':{'id':_0x902741[_0x54fe('0x3e')]['id']}})[_0x54fe('0x23')](handleEntityNotFound(_0x5ce310,null))['then'](saveUpdates(_0x902741[_0x54fe('0x42')],null))[_0x54fe('0x23')](respondWithResult(_0x5ce310,null))[_0x54fe('0x3d')](handleError(_0x5ce310,null));};exports[_0x54fe('0x24')]=function(_0x51b4c8,_0x4f0133){return db[_0x54fe('0x29')][_0x54fe('0x41')]({'where':{'id':_0x51b4c8[_0x54fe('0x3e')]['id']}})[_0x54fe('0x23')](handleEntityNotFound(_0x4f0133,null))[_0x54fe('0x23')](removeEntity(_0x4f0133,null))[_0x54fe('0x3d')](handleError(_0x4f0133,null));};exports[_0x54fe('0x43')]=function(_0x4cef50,_0x1600dd){return db[_0x54fe('0x29')][_0x54fe('0x43')]()['then'](respondWithResult(_0x1600dd,null))['catch'](handleError(_0x1600dd,null));}; \ No newline at end of file +var _0x04f3=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','CmHopperBlack','includeAll','rows','catch','show','include','options','find','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3777ea,_0x480dff){var _0x108277=function(_0x3205c2){while(--_0x3205c2){_0x3777ea['push'](_0x3777ea['shift']());}};_0x108277(++_0x480dff);}(_0x04f3,0x7e));var _0x304f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x04f3[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x304f('0x0'));var rimraf=require(_0x304f('0x1'));var zipdir=require(_0x304f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x304f('0x3'));var moment=require(_0x304f('0x4'));var BPromise=require(_0x304f('0x5'));var Mustache=require(_0x304f('0x6'));var util=require(_0x304f('0x7'));var path=require(_0x304f('0x8'));var sox=require(_0x304f('0x9'));var csv=require(_0x304f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x304f('0xb'));var _=require(_0x304f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x304f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x304f('0xa'));var querystring=require(_0x304f('0xe'));var Papa=require(_0x304f('0xf'));var Redis=require(_0x304f('0x10'));var authService=require(_0x304f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x304f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x304f('0x13'))(_0x304f('0x14'));var utils=require(_0x304f('0x15'));var config=require(_0x304f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x304f('0x17'))['db'];function respondWithStatusCode(_0x17f495,_0x1546de){_0x1546de=_0x1546de||0xcc;return function(_0x41df51){if(_0x41df51){return _0x17f495['sendStatus'](_0x1546de);}return _0x17f495['status'](_0x1546de)[_0x304f('0x18')]();};}function respondWithResult(_0x14fc7a,_0x3f41c8){_0x3f41c8=_0x3f41c8||0xc8;return function(_0x1c728c){if(_0x1c728c){return _0x14fc7a[_0x304f('0x19')](_0x3f41c8)['json'](_0x1c728c);}};}function respondWithFilteredResult(_0xcf4cc,_0xf25efe){return function(_0x726c85){if(_0x726c85){var _0x4c2e70=typeof _0xf25efe['offset']===_0x304f('0x1a')&&typeof _0xf25efe[_0x304f('0x1b')]===_0x304f('0x1a');var _0x181966=_0x726c85[_0x304f('0x1c')];var _0x2f8b51=_0x4c2e70?0x0:_0xf25efe[_0x304f('0x1d')];var _0x7a760=_0x4c2e70?_0x726c85[_0x304f('0x1c')]:_0xf25efe[_0x304f('0x1d')]+_0xf25efe[_0x304f('0x1b')];var _0x45a800;if(_0x7a760>=_0x181966){_0x7a760=_0x181966;_0x45a800=0xc8;}else{_0x45a800=0xce;}_0xcf4cc['status'](_0x45a800);return _0xcf4cc['set']('Content-Range',_0x2f8b51+'-'+_0x7a760+'/'+_0x181966)['json'](_0x726c85);}return null;};}function patchUpdates(_0x5763bd){return function(_0x13225b){try{jsonpatch[_0x304f('0x1e')](_0x13225b,_0x5763bd,!![]);}catch(_0x81f640){return BPromise[_0x304f('0x1f')](_0x81f640);}return _0x13225b[_0x304f('0x20')]();};}function saveUpdates(_0x5b911c,_0xca82d3){return function(_0x2a27bf){if(_0x2a27bf){return _0x2a27bf[_0x304f('0x21')](_0x5b911c)[_0x304f('0x22')](function(_0x64bff8){return _0x64bff8;});}return null;};}function removeEntity(_0x4748ba,_0x590b0a){return function(_0x167ccd){if(_0x167ccd){return _0x167ccd[_0x304f('0x23')]()['then'](function(){_0x4748ba[_0x304f('0x19')](0xcc)[_0x304f('0x18')]();});}};}function handleEntityNotFound(_0x44a72e,_0x7c1e3c){return function(_0xd65d84){if(!_0xd65d84){_0x44a72e[_0x304f('0x24')](0x194);}return _0xd65d84;};}function handleError(_0x5b1461,_0x1428f3){_0x1428f3=_0x1428f3||0x1f4;return function(_0xc37449){logger[_0x304f('0x25')](_0xc37449['stack']);if(_0xc37449[_0x304f('0x26')]){delete _0xc37449[_0x304f('0x26')];}_0x5b1461['status'](_0x1428f3)[_0x304f('0x27')](_0xc37449);};}exports[_0x304f('0x28')]=function(_0x45505b,_0x4c9574){var _0x545a2e={},_0x2bab17={},_0x4af1af={'count':0x0,'rows':[]};var _0x2e456d=_[_0x304f('0x29')](db['CmHopperBlack'][_0x304f('0x2a')],function(_0x2fc89b){return{'name':_0x2fc89b['fieldName'],'type':_0x2fc89b['type']['key']};});_0x2bab17[_0x304f('0x2b')]=_[_0x304f('0x29')](_0x2e456d,_0x304f('0x26'));_0x2bab17[_0x304f('0x2c')]=_[_0x304f('0x2d')](_0x45505b[_0x304f('0x2c')]);_0x2bab17[_0x304f('0x2e')]=_['intersection'](_0x2bab17[_0x304f('0x2b')],_0x2bab17[_0x304f('0x2c')]);_0x545a2e['attributes']=_[_0x304f('0x2f')](_0x2bab17[_0x304f('0x2b')],qs['fields'](_0x45505b[_0x304f('0x2c')][_0x304f('0x30')]));_0x545a2e[_0x304f('0x31')]=_0x545a2e[_0x304f('0x31')][_0x304f('0x32')]?_0x545a2e['attributes']:_0x2bab17[_0x304f('0x2b')];if(!_0x45505b[_0x304f('0x2c')][_0x304f('0x33')](_0x304f('0x34'))){_0x545a2e[_0x304f('0x1b')]=qs['limit'](_0x45505b['query']['limit']);_0x545a2e[_0x304f('0x1d')]=qs[_0x304f('0x1d')](_0x45505b[_0x304f('0x2c')][_0x304f('0x1d')]);}_0x545a2e[_0x304f('0x35')]=qs[_0x304f('0x36')](_0x45505b[_0x304f('0x2c')][_0x304f('0x36')]);_0x545a2e[_0x304f('0x37')]=qs[_0x304f('0x2e')](_[_0x304f('0x38')](_0x45505b[_0x304f('0x2c')],_0x2bab17[_0x304f('0x2e')]),_0x2e456d);if(_0x45505b[_0x304f('0x2c')][_0x304f('0x39')]){_0x545a2e['where']=_[_0x304f('0x3a')](_0x545a2e['where'],{'$or':_[_0x304f('0x29')](_0x2e456d,function(_0x3ab35e){if(_0x3ab35e[_0x304f('0x3b')]!==_0x304f('0x3c')){var _0x59f88c={};_0x59f88c[_0x3ab35e[_0x304f('0x26')]]={'$like':'%'+_0x45505b['query'][_0x304f('0x39')]+'%'};return _0x59f88c;}})});}_0x545a2e=_[_0x304f('0x3a')]({},_0x545a2e,_0x45505b['options']);var _0x391eeb={'where':_0x545a2e[_0x304f('0x37')]};return db[_0x304f('0x3d')][_0x304f('0x1c')](_0x391eeb)[_0x304f('0x22')](function(_0xec446c){_0x4af1af[_0x304f('0x1c')]=_0xec446c;if(_0x45505b[_0x304f('0x2c')][_0x304f('0x3e')]){_0x545a2e['include']=[{'all':!![]}];}return db[_0x304f('0x3d')]['findAll'](_0x545a2e);})[_0x304f('0x22')](function(_0x258a38){_0x4af1af[_0x304f('0x3f')]=_0x258a38;return _0x4af1af;})['then'](respondWithFilteredResult(_0x4c9574,_0x545a2e))[_0x304f('0x40')](handleError(_0x4c9574,null));};exports[_0x304f('0x41')]=function(_0x24c286,_0x21027f){var _0x33173f={'raw':!![],'where':{'id':_0x24c286['params']['id']}},_0x161ac3={};_0x161ac3[_0x304f('0x2b')]=_[_0x304f('0x2d')](db[_0x304f('0x3d')][_0x304f('0x2a')]);_0x161ac3['query']=_[_0x304f('0x2d')](_0x24c286['query']);_0x161ac3[_0x304f('0x2e')]=_[_0x304f('0x2f')](_0x161ac3[_0x304f('0x2b')],_0x161ac3[_0x304f('0x2c')]);_0x33173f[_0x304f('0x31')]=_[_0x304f('0x2f')](_0x161ac3[_0x304f('0x2b')],qs[_0x304f('0x30')](_0x24c286[_0x304f('0x2c')][_0x304f('0x30')]));_0x33173f['attributes']=_0x33173f['attributes'][_0x304f('0x32')]?_0x33173f[_0x304f('0x31')]:_0x161ac3[_0x304f('0x2b')];if(_0x24c286[_0x304f('0x2c')][_0x304f('0x3e')]){_0x33173f[_0x304f('0x42')]=[{'all':!![]}];}_0x33173f=_[_0x304f('0x3a')]({},_0x33173f,_0x24c286[_0x304f('0x43')]);return db['CmHopperBlack'][_0x304f('0x44')](_0x33173f)[_0x304f('0x22')](handleEntityNotFound(_0x21027f,null))['then'](respondWithResult(_0x21027f,null))[_0x304f('0x40')](handleError(_0x21027f,null));};exports[_0x304f('0x21')]=function(_0x560cdb,_0x4ba37e){if(_0x560cdb[_0x304f('0x45')]['id']){delete _0x560cdb[_0x304f('0x45')]['id'];}return db[_0x304f('0x3d')][_0x304f('0x44')]({'where':{'id':_0x560cdb[_0x304f('0x46')]['id']}})[_0x304f('0x22')](handleEntityNotFound(_0x4ba37e,null))[_0x304f('0x22')](saveUpdates(_0x560cdb[_0x304f('0x45')],null))[_0x304f('0x22')](respondWithResult(_0x4ba37e,null))[_0x304f('0x40')](handleError(_0x4ba37e,null));};exports[_0x304f('0x23')]=function(_0x50a967,_0x43dd3a){return db[_0x304f('0x3d')][_0x304f('0x44')]({'where':{'id':_0x50a967['params']['id']}})[_0x304f('0x22')](handleEntityNotFound(_0x43dd3a,null))['then'](removeEntity(_0x43dd3a,null))[_0x304f('0x40')](handleError(_0x43dd3a,null));};exports['describe']=function(_0x5b7ae1,_0x3c0c8e){return db[_0x304f('0x3d')][_0x304f('0x47')]()[_0x304f('0x22')](respondWithResult(_0x3c0c8e,null))[_0x304f('0x40')](handleError(_0x3c0c8e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1fdb5d0..3e07ff1 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 _0x82c9=['define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x2222b1,_0x4863c9){var _0x583842=function(_0xf5d579){while(--_0xf5d579){_0x2222b1['push'](_0x2222b1['shift']());}};_0x583842(++_0x4863c9);}(_0x82c9,0x199));var _0x982c=function(_0x37c427,_0x503499){_0x37c427=_0x37c427-0x0;var _0x5a5c29=_0x82c9[_0x37c427];return _0x5a5c29;};'use strict';var _=require(_0x982c('0x0'));var util=require(_0x982c('0x1'));var logger=require('../../config/logger')(_0x982c('0x2'));var moment=require(_0x982c('0x3'));var BPromise=require(_0x982c('0x4'));var rp=require(_0x982c('0x5'));var fs=require('fs');var path=require(_0x982c('0x6'));var rimraf=require(_0x982c('0x7'));var config=require(_0x982c('0x8'));var attributes=require(_0x982c('0x9'));module[_0x982c('0xa')]=function(_0x24e10e,_0x5a807b){return _0x24e10e[_0x982c('0xb')](_0x982c('0xc'),attributes,{'tableName':_0x982c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4372=['cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','CmHopperBlack'];(function(_0x1e749e,_0x4e377c){var _0x150cab=function(_0x34e0f4){while(--_0x34e0f4){_0x1e749e['push'](_0x1e749e['shift']());}};_0x150cab(++_0x4e377c);}(_0x4372,0xfd));var _0x2437=function(_0x2d1371,_0x43aef7){_0x2d1371=_0x2d1371-0x0;var _0xf17680=_0x4372[_0x2d1371];return _0xf17680;};'use strict';var _=require(_0x2437('0x0'));var util=require(_0x2437('0x1'));var logger=require(_0x2437('0x2'))(_0x2437('0x3'));var moment=require(_0x2437('0x4'));var BPromise=require(_0x2437('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2437('0x6'));var rimraf=require('rimraf');var config=require(_0x2437('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x2437('0x8')]=function(_0x3540c7,_0x5dfd76){return _0x3540c7[_0x2437('0x9')](_0x2437('0xa'),attributes,{'tableName':_0x2437('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 2a33a67..e85d82c 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 _0xa9f0=['request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','include','map','model','UpdateCmHopperBlack','update','where','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x106fd2,_0x2dba5b){var _0x3016a3=function(_0x54d026){while(--_0x54d026){_0x106fd2['push'](_0x106fd2['shift']());}};_0x3016a3(++_0x2dba5b);}(_0xa9f0,0x67));var _0x0a9f=function(_0x1d3f26,_0x36d87b){_0x1d3f26=_0x1d3f26-0x0;var _0x2af2e9=_0xa9f0[_0x1d3f26];return _0x2af2e9;};'use strict';var _=require(_0x0a9f('0x0'));var util=require(_0x0a9f('0x1'));var moment=require(_0x0a9f('0x2'));var BPromise=require(_0x0a9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a9f('0x4'))['db'];var utils=require(_0x0a9f('0x5'));var logger=require('../../config/logger')(_0x0a9f('0x6'));var config=require(_0x0a9f('0x7'));var jayson=require(_0x0a9f('0x8'));var client=jayson[_0x0a9f('0x9')][_0x0a9f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a97d,_0x1d2262,_0x4db653){return new BPromise(function(_0x57de9e,_0x4b91c1){return client[_0x0a9f('0xb')](_0x18a97d,_0x4db653)[_0x0a9f('0xc')](function(_0x445f70){logger['info'](_0x0a9f('0xd'),_0x1d2262,_0x0a9f('0xe'));logger[_0x0a9f('0xf')](_0x0a9f('0x10'),_0x1d2262,_0x0a9f('0xe'),JSON[_0x0a9f('0x11')](_0x445f70));if(_0x445f70[_0x0a9f('0x12')]){if(_0x445f70['error'][_0x0a9f('0x13')]===0x1f4){logger[_0x0a9f('0x12')](_0x0a9f('0xd'),_0x1d2262,_0x445f70[_0x0a9f('0x12')][_0x0a9f('0x14')]);return _0x4b91c1(_0x445f70[_0x0a9f('0x12')][_0x0a9f('0x14')]);}logger[_0x0a9f('0x12')](_0x0a9f('0xd'),_0x1d2262,_0x445f70[_0x0a9f('0x12')][_0x0a9f('0x14')]);return _0x57de9e(_0x445f70[_0x0a9f('0x12')][_0x0a9f('0x14')]);}else{logger[_0x0a9f('0x15')](_0x0a9f('0xd'),_0x1d2262,_0x0a9f('0xe'));_0x57de9e(_0x445f70[_0x0a9f('0x16')][_0x0a9f('0x14')]);}})[_0x0a9f('0x17')](function(_0x457b04){logger[_0x0a9f('0x12')](_0x0a9f('0xd'),_0x1d2262,_0x457b04);_0x4b91c1(_0x457b04);});});}exports[_0x0a9f('0x18')]=function(_0x38271c){var _0x1f580e=this;return new Promise(function(_0x25d81e,_0x239a78){return db[_0x0a9f('0x19')][_0x0a9f('0x1a')]({'raw':_0x38271c[_0x0a9f('0x1b')]?_0x38271c['options'][_0x0a9f('0x1c')]===undefined?!![]:![]:!![],'where':_0x38271c[_0x0a9f('0x1b')]?_0x38271c['options']['where']||null:null,'attributes':_0x38271c[_0x0a9f('0x1b')]?_0x38271c['options'][_0x0a9f('0x1d')]||null:null,'limit':_0x38271c[_0x0a9f('0x1b')]?_0x38271c[_0x0a9f('0x1b')]['limit']||null:null,'include':_0x38271c['options']?_0x38271c['options'][_0x0a9f('0x1e')]?_[_0x0a9f('0x1f')](_0x38271c[_0x0a9f('0x1b')][_0x0a9f('0x1e')],function(_0x2383ac){return{'model':db[_0x2383ac[_0x0a9f('0x20')]],'as':_0x2383ac['as'],'attributes':_0x2383ac[_0x0a9f('0x1d')],'include':_0x2383ac[_0x0a9f('0x1e')]?_['map'](_0x2383ac['include'],function(_0x3afed3){return{'model':db[_0x3afed3[_0x0a9f('0x20')]],'as':_0x3afed3['as'],'attributes':_0x3afed3['attributes'],'include':_0x3afed3[_0x0a9f('0x1e')]?_[_0x0a9f('0x1f')](_0x3afed3[_0x0a9f('0x1e')],function(_0xedf354){return{'model':db[_0xedf354[_0x0a9f('0x20')]],'as':_0xedf354['as'],'attributes':_0xedf354[_0x0a9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0a9f('0xc')](function(_0x4e8dda){logger[_0x0a9f('0x15')](_0x0a9f('0x18'),_0x38271c);logger[_0x0a9f('0xf')]('GetCmHopperBlack',_0x38271c,JSON['stringify'](_0x4e8dda));_0x25d81e(_0x4e8dda);})['catch'](function(_0x2672ba){logger[_0x0a9f('0x12')](_0x0a9f('0x18'),_0x2672ba[_0x0a9f('0x14')],_0x38271c);_0x239a78(_0x1f580e[_0x0a9f('0x12')](0x1f4,_0x2672ba['message']));});});};exports[_0x0a9f('0x21')]=function(_0x499546){var _0x4293f5=this;return new Promise(function(_0x2efdaf,_0x12f583){return db[_0x0a9f('0x19')][_0x0a9f('0x22')](_0x499546['body'],{'raw':_0x499546[_0x0a9f('0x1b')]?_0x499546['options'][_0x0a9f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x499546[_0x0a9f('0x1b')]?_0x499546['options'][_0x0a9f('0x23')]||null:null,'attributes':_0x499546[_0x0a9f('0x1b')]?_0x499546[_0x0a9f('0x1b')][_0x0a9f('0x1d')]||null:null,'limit':_0x499546[_0x0a9f('0x1b')]?_0x499546[_0x0a9f('0x1b')]['limit']||null:null})[_0x0a9f('0xc')](function(_0x538035){logger[_0x0a9f('0x15')]('UpdateCmHopperBlack',_0x499546);logger[_0x0a9f('0xf')](_0x0a9f('0x21'),_0x499546,JSON[_0x0a9f('0x11')](_0x538035));_0x2efdaf(_0x538035);})[_0x0a9f('0x17')](function(_0x5cdb15){logger[_0x0a9f('0x12')](_0x0a9f('0x21'),_0x5cdb15[_0x0a9f('0x14')],_0x499546);_0x12f583(_0x4293f5[_0x0a9f('0x12')](0x1f4,_0x5cdb15[_0x0a9f('0x14')]));});});};exports[_0x0a9f('0x24')]=function(_0x39c74e){var _0x2b837d=this;return new Promise(function(_0x58a532,_0x4e77e8){return db[_0x0a9f('0x19')][_0x0a9f('0x25')]({'where':_0x39c74e[_0x0a9f('0x1b')]?_0x39c74e[_0x0a9f('0x1b')][_0x0a9f('0x23')]||null:null})[_0x0a9f('0xc')](function(_0x149aea){logger[_0x0a9f('0x15')](_0x0a9f('0x24'),_0x39c74e);logger[_0x0a9f('0xf')](_0x0a9f('0x24'),_0x39c74e,JSON[_0x0a9f('0x11')](_0x149aea));_0x58a532(_0x149aea);})['catch'](function(_0x106818){logger[_0x0a9f('0x12')](_0x0a9f('0x24'),_0x106818[_0x0a9f('0x14')],_0x39c74e);_0x4e77e8(_0x2b837d[_0x0a9f('0x12')](0x1f4,_0x106818['message']));});});}; \ No newline at end of file +var _0x5ae0=['result','catch','CmHopperBlack','options','where','attributes','limit','include','map','model','then','GetCmHopperBlack','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x19674a,_0x51e745){var _0x1bbb33=function(_0x57e6ca){while(--_0x57e6ca){_0x19674a['push'](_0x19674a['shift']());}};_0x1bbb33(++_0x51e745);}(_0x5ae0,0xf0));var _0x05ae=function(_0x294acd,_0x1b22f3){_0x294acd=_0x294acd-0x0;var _0x2e14cf=_0x5ae0[_0x294acd];return _0x2e14cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05ae('0x0'));var BPromise=require('bluebird');var rs=require(_0x05ae('0x1'));var fs=require('fs');var Redis=require(_0x05ae('0x2'));var db=require(_0x05ae('0x3'))['db'];var utils=require(_0x05ae('0x4'));var logger=require('../../config/logger')(_0x05ae('0x5'));var config=require(_0x05ae('0x6'));var jayson=require(_0x05ae('0x7'));var client=jayson[_0x05ae('0x8')][_0x05ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51a04a,_0x4c66a3,_0x40d99d){return new BPromise(function(_0x167653,_0x499741){return client['request'](_0x51a04a,_0x40d99d)['then'](function(_0x5bfe3a){logger[_0x05ae('0xa')](_0x05ae('0xb'),_0x4c66a3,_0x05ae('0xc'));logger[_0x05ae('0xd')](_0x05ae('0xe'),_0x4c66a3,_0x05ae('0xc'),JSON[_0x05ae('0xf')](_0x5bfe3a));if(_0x5bfe3a[_0x05ae('0x10')]){if(_0x5bfe3a['error'][_0x05ae('0x11')]===0x1f4){logger[_0x05ae('0x10')](_0x05ae('0xb'),_0x4c66a3,_0x5bfe3a[_0x05ae('0x10')]['message']);return _0x499741(_0x5bfe3a[_0x05ae('0x10')][_0x05ae('0x12')]);}logger[_0x05ae('0x10')](_0x05ae('0xb'),_0x4c66a3,_0x5bfe3a['error'][_0x05ae('0x12')]);return _0x167653(_0x5bfe3a['error'][_0x05ae('0x12')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4c66a3,_0x05ae('0xc'));_0x167653(_0x5bfe3a[_0x05ae('0x13')][_0x05ae('0x12')]);}})[_0x05ae('0x14')](function(_0x3938ee){logger[_0x05ae('0x10')](_0x05ae('0xb'),_0x4c66a3,_0x3938ee);_0x499741(_0x3938ee);});});}exports['GetCmHopperBlack']=function(_0x3af1eb){var _0x84686=this;return new Promise(function(_0x105587,_0x5195eb){return db[_0x05ae('0x15')]['findAll']({'raw':_0x3af1eb[_0x05ae('0x16')]?_0x3af1eb[_0x05ae('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3af1eb[_0x05ae('0x16')]?_0x3af1eb['options'][_0x05ae('0x17')]||null:null,'attributes':_0x3af1eb[_0x05ae('0x16')]?_0x3af1eb[_0x05ae('0x16')][_0x05ae('0x18')]||null:null,'limit':_0x3af1eb[_0x05ae('0x16')]?_0x3af1eb['options'][_0x05ae('0x19')]||null:null,'include':_0x3af1eb[_0x05ae('0x16')]?_0x3af1eb['options'][_0x05ae('0x1a')]?_[_0x05ae('0x1b')](_0x3af1eb['options'][_0x05ae('0x1a')],function(_0x176381){return{'model':db[_0x176381['model']],'as':_0x176381['as'],'attributes':_0x176381[_0x05ae('0x18')],'include':_0x176381[_0x05ae('0x1a')]?_[_0x05ae('0x1b')](_0x176381['include'],function(_0xa7c2d9){return{'model':db[_0xa7c2d9[_0x05ae('0x1c')]],'as':_0xa7c2d9['as'],'attributes':_0xa7c2d9[_0x05ae('0x18')],'include':_0xa7c2d9['include']?_[_0x05ae('0x1b')](_0xa7c2d9['include'],function(_0x378060){return{'model':db[_0x378060['model']],'as':_0x378060['as'],'attributes':_0x378060[_0x05ae('0x18')]};}):[]};}):[]};}):[]:[]})[_0x05ae('0x1d')](function(_0x10c50f){logger[_0x05ae('0xa')](_0x05ae('0x1e'),_0x3af1eb);logger[_0x05ae('0xd')](_0x05ae('0x1e'),_0x3af1eb,JSON[_0x05ae('0xf')](_0x10c50f));_0x105587(_0x10c50f);})[_0x05ae('0x14')](function(_0x3e44e3){logger[_0x05ae('0x10')](_0x05ae('0x1e'),_0x3e44e3[_0x05ae('0x12')],_0x3af1eb);_0x5195eb(_0x84686[_0x05ae('0x10')](0x1f4,_0x3e44e3[_0x05ae('0x12')]));});});};exports[_0x05ae('0x1f')]=function(_0x460a7d){var _0x3ab3aa=this;return new Promise(function(_0x2e4b3d,_0x496de8){return db[_0x05ae('0x15')][_0x05ae('0x20')](_0x460a7d[_0x05ae('0x21')],{'raw':_0x460a7d[_0x05ae('0x16')]?_0x460a7d[_0x05ae('0x16')][_0x05ae('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460a7d[_0x05ae('0x16')]?_0x460a7d['options'][_0x05ae('0x17')]||null:null,'attributes':_0x460a7d[_0x05ae('0x16')]?_0x460a7d[_0x05ae('0x16')][_0x05ae('0x18')]||null:null,'limit':_0x460a7d[_0x05ae('0x16')]?_0x460a7d[_0x05ae('0x16')][_0x05ae('0x19')]||null:null})[_0x05ae('0x1d')](function(_0xe750a7){logger[_0x05ae('0xa')](_0x05ae('0x1f'),_0x460a7d);logger['debug'](_0x05ae('0x1f'),_0x460a7d,JSON[_0x05ae('0xf')](_0xe750a7));_0x2e4b3d(_0xe750a7);})['catch'](function(_0x8edc4e){logger[_0x05ae('0x10')](_0x05ae('0x1f'),_0x8edc4e[_0x05ae('0x12')],_0x460a7d);_0x496de8(_0x3ab3aa['error'](0x1f4,_0x8edc4e['message']));});});};exports[_0x05ae('0x23')]=function(_0x2fabe4){var _0x1db819=this;return new Promise(function(_0x181914,_0x44d9d2){return db[_0x05ae('0x15')][_0x05ae('0x24')]({'where':_0x2fabe4[_0x05ae('0x16')]?_0x2fabe4[_0x05ae('0x16')][_0x05ae('0x17')]||null:null})[_0x05ae('0x1d')](function(_0x19b26a){logger['info'](_0x05ae('0x23'),_0x2fabe4);logger[_0x05ae('0xd')](_0x05ae('0x23'),_0x2fabe4,JSON['stringify'](_0x19b26a));_0x181914(_0x19b26a);})[_0x05ae('0x14')](function(_0x40d8a7){logger[_0x05ae('0x10')]('DestroyCmHopperBlack',_0x40d8a7[_0x05ae('0x12')],_0x2fabe4);_0x44d9d2(_0x1db819[_0x05ae('0x10')](0x1f4,_0x40d8a7['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index f9ae7b0..45d2f06 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x781d=['isAuthenticated','index','/describe','describe','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0xe')](_0xd781('0xf'),auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd781('0x12')]);module[_0xd781('0x13')]=router; \ No newline at end of file +var _0x8f9d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id','show','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['put']('/:id',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0x10')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);module[_0xd8f9('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 3bfeb07..839e267 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 _0x1d16=['getDataValue','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x5ddf33,_0x49a55c){var _0x4f1348=function(_0x1d97df){while(--_0x1d97df){_0x5ddf33['push'](_0x5ddf33['shift']());}};_0x4f1348(++_0x49a55c);}(_0x1d16,0x13e));var _0x61d1=function(_0x5e3191,_0x47fe85){_0x5e3191=_0x5e3191-0x0;var _0xc8d5e6=_0x1d16[_0x5e3191];return _0xc8d5e6;};'use strict';var Sequelize=require(_0x61d1('0x0'));var moment=require(_0x61d1('0x1'));module[_0x61d1('0x2')]={'state':{'type':Sequelize[_0x61d1('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x61d1('0x4')]},'scheduledat':{'type':Sequelize[_0x61d1('0x5')]},'countbusyretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x61d1('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x61d1('0x4')]},'calleridnum':{'type':Sequelize[_0x61d1('0x4')]},'calleridname':{'type':Sequelize[_0x61d1('0x4')]},'starttime':{'type':Sequelize[_0x61d1('0x5')]},'responsetime':{'type':Sequelize[_0x61d1('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x61d1('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x61d1('0x4')]},'campaign':{'type':Sequelize[_0x61d1('0x4')]},'campaigntype':{'type':Sequelize[_0x61d1('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x61d1('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x61d1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x61d1('0x4')]},'dispositionat':{'type':Sequelize[_0x61d1('0x5')],'set':function(_0x4496b2){var _0x19d76d=this[_0x61d1('0x6')]('endtime');if(_0x19d76d&&_0x4496b2){this[_0x61d1('0x7')]('followuptime',moment(_0x4496b2)[_0x61d1('0x8')](moment(_0x19d76d),_0x61d1('0x9')));}return this[_0x61d1('0x7')](_0x61d1('0xa'),_0x4496b2);}},'amd':{'type':Sequelize[_0x61d1('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x61d1('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x61d1('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x61d1('0x5')]},'callback':{'type':Sequelize[_0x61d1('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x61d1('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x61d1('0x5')]},'deleted':{'type':Sequelize[_0x61d1('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x61d1('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x61d1('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x012b=['dispositionat','BOOLEAN','sequelize','moment','DATE','INTEGER','STRING','getDataValue','endtime','diff','seconds','setDataValue'];(function(_0x32517f,_0x11a1d3){var _0x1e51b7=function(_0x214b5b){while(--_0x214b5b){_0x32517f['push'](_0x32517f['shift']());}};_0x1e51b7(++_0x11a1d3);}(_0x012b,0x122));var _0xb012=function(_0x5636dc,_0x41e3cb){_0x5636dc=_0x5636dc-0x0;var _0x1547bc=_0x012b[_0x5636dc];return _0x1547bc;};'use strict';var Sequelize=require(_0xb012('0x0'));var moment=require(_0xb012('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb012('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb012('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xb012('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb012('0x4')]},'calleridnum':{'type':Sequelize[_0xb012('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb012('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb012('0x2')]},'endtime':{'type':Sequelize[_0xb012('0x2')]},'ringtime':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb012('0x4')]},'campaign':{'type':Sequelize[_0xb012('0x4')]},'campaigntype':{'type':Sequelize[_0xb012('0x4')]},'membername':{'type':Sequelize[_0xb012('0x4')]},'reason':{'type':Sequelize[_0xb012('0x4')]},'disposition':{'type':Sequelize[_0xb012('0x4')]},'secondDisposition':{'type':Sequelize[_0xb012('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4626fc){var _0x4f6bc4=this[_0xb012('0x5')](_0xb012('0x6'));if(_0x4f6bc4&&_0x4626fc){this['setDataValue']('followuptime',moment(_0x4626fc)[_0xb012('0x7')](moment(_0x4f6bc4),_0xb012('0x8')));}return this[_0xb012('0x9')](_0xb012('0xa'),_0x4626fc);}},'amd':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb012('0x2')]},'callback':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb012('0x2')]},'deleted':{'type':Sequelize[_0xb012('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb012('0x2')]},'recallme':{'type':Sequelize[_0xb012('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb012('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index fbc727c..489b093 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 _0x2542=['Content-Range','apply','update','then','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','abandonedContacts','VoiceQueue','into','fromQuery','phone','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','scheduledAt','ContactId','ANY_VALUE(ListId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','cm_hopper','state\x20=\x204','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x14d9fe,_0x170843){var _0x59911b=function(_0x3fa92f){while(--_0x3fa92f){_0x14d9fe['push'](_0x14d9fe['shift']());}};_0x59911b(++_0x170843);}(_0x2542,0x169));var _0x2254=function(_0x116577,_0x4e104f){_0x116577=_0x116577-0x0;var _0x3d8d3e=_0x2542[_0x116577];return _0x3d8d3e;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['CmHopperFinal'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['describe']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')]()[_0x2254('0x26')](respondWithResult(_0x405eb2,null))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x438922,_0x3ac691){if(_0x438922[_0x2254('0x4b')]['uniqueid']){delete _0x438922[_0x2254('0x4b')][_0x2254('0x4c')];}return db['CmHopperFinal'][_0x2254('0x49')]({'where':{'uniqueid':_0x438922[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x3ac691,null))[_0x2254('0x26')](saveUpdates(_0x438922['body'],null))[_0x2254('0x26')](respondWithResult(_0x3ac691,null))[_0x2254('0x45')](handleError(_0x3ac691,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26d01a,_0x3f0670,_0x23014b){return db[_0x2254('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x26d01a[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2254('0x4f')](_0x2254('0x50')))),'noSuchContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x51')))),_0x2254('0x52')],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x55')))),_0x2254('0x56')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x59')))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x3f0670,null))[_0x2254('0x26')](respondWithResult(_0x3f0670,null))[_0x2254('0x45')](handleError(_0x3f0670,null));};exports[_0x2254('0x5b')]=function(_0x399ba2,_0x179cf1,_0x5b8909){return db[_0x2254('0x2c')][_0x2254('0x43')]({'raw':![],'where':{'CampaignId':_0x399ba2[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x50')))),_0x2254('0x5c')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x2254('0x5d')))),_0x2254('0x5e')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x2254('0x56')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x2254('0x5f')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x179cf1,null))['then'](respondWithResult(_0x179cf1,null))[_0x2254('0x45')](handleError(_0x179cf1,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7075b1,_0x516595,_0x3cbd35){return db[_0x2254('0x60')]['find']({'where':{'id':_0x7075b1[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x516595,null))[_0x2254('0x26')](function(_0x3e6070){var _0x38294d;if(_0x3e6070){_0x38294d=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),'scheduledAt','ContactId',_0x2254('0x64'),_0x2254('0x65'),_0x2254('0x66'),_0x2254('0x67')],squel['select']()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')]('NOW()',_0x2254('0x6a'))[_0x2254('0x68')]('ANY_VALUE(ContactId)',_0x2254('0x6b'))['field'](_0x2254('0x6c'),'ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x2254('0x65'))['field'](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),_0x2254('0x67'))[_0x2254('0x6e')](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x70'),_0x7075b1['params']['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x7075b1[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')](_0x2254('0x75'),squel[_0x2254('0x76')]()['field'](_0x2254('0x63'))[_0x2254('0x6e')]('cm_hopper')[_0x2254('0x3b')]('VoiceQueueId\x20=\x20?',_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]()))['where'](_0x2254('0x75'),squel['select']()[_0x2254('0x68')](_0x2254('0x77'))[_0x2254('0x6e')](_0x2254('0x6f'))['where'](_0x2254('0x70'),_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')]('state\x20=\x204'))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x38294d);}return[];})['then'](respondWithResult(_0x516595,null))['catch'](handleError(_0x516595,null));};exports[_0x2254('0x79')]=function(_0x2f3650,_0x1a3fd9,_0x3058d9){return db[_0x2254('0x7a')][_0x2254('0x49')]({'where':{'id':_0x2f3650[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x1a3fd9,null))[_0x2254('0x26')](function(_0x5df20f){var _0x10c44;if(_0x5df20f){_0x10c44=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),_0x2254('0x6a'),'ContactId',_0x2254('0x64'),_0x2254('0x7b'),_0x2254('0x66'),_0x2254('0x67')],squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x6a'))[_0x2254('0x68')](_0x2254('0x7c'),'ContactId')[_0x2254('0x68')]('ANY_VALUE(ListId)',_0x2254('0x64'))[_0x2254('0x68')](_0x2254('0x7d'),_0x2254('0x7b'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),'updatedAt')[_0x2254('0x6e')]('cm_hopper_final')[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x2f3650[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x2254('0x68')]('phone')[_0x2254('0x6e')](_0x2254('0x7f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]()))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x77'))['from'](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x80')))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x10c44);}return[];})['then'](respondWithResult(_0x1a3fd9,null))['catch'](handleError(_0x1a3fd9,null));};exports[_0x2254('0x81')]=function(_0x54339e,_0x226c19,_0x10645f){return db[_0x2254('0x82')][_0x2254('0x83')]({'where':{'VoiceQueueId':_0x54339e[_0x2254('0x4b')][_0x2254('0x65')],'CampaignId':_0x54339e[_0x2254('0x4b')][_0x2254('0x7b')],'ContactId':_0x54339e['body']['ContactId']}})[_0x2254('0x26')](handleEntityNotFound(_0x226c19,null))[_0x2254('0x26')](function(_0x1e8617){if(_0x1e8617){return _0x1e8617;}return null;})[_0x2254('0x26')](respondWithResult(_0x226c19,null))[_0x2254('0x45')](handleError(_0x226c19,null));}; \ No newline at end of file +var _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x326f,0xd1));var _0xf326=function(_0x45e249,_0x2ee801){_0x45e249=_0x45e249-0x0;var _0x187a86=_0x326f[_0x45e249];return _0x187a86;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 3ea4caf..b7f6084 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 _0xc9cb=['bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0xc9cb,0x1db));var _0xbc9c=function(_0x322423,_0x424ddb){_0x322423=_0x322423-0x0;var _0x320148=_0xc9cb[_0x322423];return _0x320148;};'use strict';var _=require(_0xbc9c('0x0'));var util=require(_0xbc9c('0x1'));var logger=require(_0xbc9c('0x2'))(_0xbc9c('0x3'));var moment=require(_0xbc9c('0x4'));var BPromise=require(_0xbc9c('0x5'));var rp=require(_0xbc9c('0x6'));var fs=require('fs');var path=require(_0xbc9c('0x7'));var rimraf=require('rimraf');var config=require(_0xbc9c('0x8'));var attributes=require(_0xbc9c('0x9'));module[_0xbc9c('0xa')]=function(_0x328a1e,_0x11b85c){return _0x328a1e[_0xbc9c('0xb')](_0xbc9c('0xc'),attributes,{'tableName':_0xbc9c('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbc9c('0xe')]},{'name':_0xbc9c('0xf'),'fields':[_0xbc9c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7510=['api','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger'];(function(_0xa17984,_0x2ef849){var _0x477f29=function(_0x437d1a){while(--_0x437d1a){_0xa17984['push'](_0xa17984['shift']());}};_0x477f29(++_0x2ef849);}(_0x7510,0x136));var _0x0751=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7510[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0751('0x0'));var logger=require(_0x0751('0x1'))(_0x0751('0x2'));var moment=require('moment');var BPromise=require(_0x0751('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0751('0x4'));var rimraf=require(_0x0751('0x5'));var config=require(_0x0751('0x6'));var attributes=require(_0x0751('0x7'));module[_0x0751('0x8')]=function(_0x3a5b32,_0x47e187){return _0x3a5b32['define'](_0x0751('0x9'),attributes,{'tableName':_0x0751('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x0751('0xb')]},{'name':_0x0751('0xc'),'fields':[_0x0751('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 45e181e..154bed2 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(_0x22cec6,_0x4db8d4){var _0x53bb0d=function(_0x2d8938){while(--_0x2d8938){_0x22cec6['push'](_0x22cec6['shift']());}};_0x53bb0d(++_0x4db8d4);}(_0x7a54,0x106));var _0x47a5=function(_0x531245,_0x574a03){_0x531245=_0x531245-0x0;var _0x5c4f53=_0x7a54[_0x531245];return _0x5c4f53;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x70e090,_0x436d10){var _0x42006b=function(_0x252052){while(--_0x252052){_0x70e090['push'](_0x70e090['shift']());}};_0x42006b(++_0x436d10);}(_0x7a54,0x106));var _0x47a5=function(_0x28f048,_0x15572a){_0x28f048=_0x28f048-0x0;var _0x9244=_0x7a54[_0x28f048];return _0x9244;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 794ab6b..9a82a34 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 _0x1f59=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','util','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','get','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x3c2ad9,_0x16d086){var _0x4123b6=function(_0x2f989b){while(--_0x2f989b){_0x3c2ad9['push'](_0x3c2ad9['shift']());}};_0x4123b6(++_0x16d086);}(_0x1f59,0xef));var _0x91f5=function(_0x4f7a20,_0x3800f1){_0x4f7a20=_0x4f7a20-0x0;var _0x5db26e=_0x1f59[_0x4f7a20];return _0x5db26e;};'use strict';var multer=require('multer');var util=require(_0x91f5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x91f5('0x1'));var router=express['Router']();var fs_extra=require(_0x91f5('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x91f5('0x3'));var config=require(_0x91f5('0x4'));var controller=require(_0x91f5('0x5'));router['get']('/',auth[_0x91f5('0x6')](),controller[_0x91f5('0x7')]);router['get'](_0x91f5('0x8'),auth[_0x91f5('0x6')](),controller[_0x91f5('0x9')]);router[_0x91f5('0xa')](_0x91f5('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x91f5('0xc'),auth[_0x91f5('0x6')](),controller[_0x91f5('0xd')]);router[_0x91f5('0xa')](_0x91f5('0xe'),auth[_0x91f5('0x6')](),controller[_0x91f5('0xf')]);router[_0x91f5('0x10')](_0x91f5('0x11'),auth['isAuthenticated'](),controller[_0x91f5('0x12')]);router[_0x91f5('0x10')]('/voice/campaign/moveContacts/:id',auth[_0x91f5('0x6')](),controller[_0x91f5('0x13')]);router[_0x91f5('0x10')]('/checkContactHopper',auth[_0x91f5('0x6')](),controller[_0x91f5('0x14')]);router[_0x91f5('0x15')](_0x91f5('0xb'),auth[_0x91f5('0x6')](),controller[_0x91f5('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7156=['post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','util','path','express','Router','fs-extra','../../components/auth/service','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x47b3ea,_0x2b9bb2){var _0x425bb5=function(_0x4e48d4){while(--_0x4e48d4){_0x47b3ea['push'](_0x47b3ea['shift']());}};_0x425bb5(++_0x2b9bb2);}(_0x7156,0x122));var _0x6715=function(_0x356b49,_0x431c31){_0x356b49=_0x356b49-0x0;var _0x436455=_0x7156[_0x356b49];return _0x436455;};'use strict';var multer=require('multer');var util=require(_0x6715('0x0'));var path=require(_0x6715('0x1'));var timeout=require('connect-timeout');var express=require(_0x6715('0x2'));var router=express[_0x6715('0x3')]();var fs_extra=require(_0x6715('0x4'));var auth=require(_0x6715('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6715('0x6'));router[_0x6715('0x7')]('/',auth[_0x6715('0x8')](),controller['index']);router[_0x6715('0x7')](_0x6715('0x9'),auth[_0x6715('0x8')](),controller[_0x6715('0xa')]);router['get'](_0x6715('0xb'),auth[_0x6715('0x8')](),controller[_0x6715('0xc')]);router['get'](_0x6715('0xd'),auth[_0x6715('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router['get']('/campaign/countAttributes/:id',auth[_0x6715('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x6715('0xe')](_0x6715('0xf'),auth[_0x6715('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x6715('0xe')](_0x6715('0x10'),auth[_0x6715('0x8')](),controller[_0x6715('0x11')]);router[_0x6715('0xe')](_0x6715('0x12'),auth[_0x6715('0x8')](),controller['checkContactHopper']);router['put']('/:id',auth[_0x6715('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 467988d..ec08ebf 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 _0x68d9=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x394988,_0x4a0079){var _0x380395=function(_0x4d7f7d){while(--_0x4d7f7d){_0x394988['push'](_0x394988['shift']());}};_0x380395(++_0x4a0079);}(_0x68d9,0x1c9));var _0x968d=function(_0x496e2d,_0x12b58e){_0x496e2d=_0x496e2d-0x0;var _0x5924d1=_0x68d9[_0x496e2d];return _0x5924d1;};'use strict';var Sequelize=require(_0x968d('0x0'));module[_0x968d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x968d('0x2')]},'scheduledat':{'type':Sequelize[_0x968d('0x3')]},'countbusyretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x968d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x968d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x968d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x968d('0x2')]},'starttime':{'type':Sequelize[_0x968d('0x3')]},'responsetime':{'type':Sequelize[_0x968d('0x3')]},'answertime':{'type':Sequelize[_0x968d('0x3')]},'droptime':{'type':Sequelize[_0x968d('0x3')]},'endtime':{'type':Sequelize[_0x968d('0x3')]},'ringtime':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x968d('0x2')]},'campaign':{'type':Sequelize[_0x968d('0x2')]},'campaigntype':{'type':Sequelize[_0x968d('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x968d('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x968d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x968d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x968d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x968d('0x3')]},'recallme':{'type':Sequelize[_0x968d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x968d('0x3')]},'edited':{'type':Sequelize[_0x968d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x968d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa018=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x7e6e36,_0x3a9e69){var _0x303da6=function(_0x20625f){while(--_0x20625f){_0x7e6e36['push'](_0x7e6e36['shift']());}};_0x303da6(++_0x3a9e69);}(_0xa018,0xf7));var _0x8a01=function(_0x2ce566,_0x3ce369){_0x2ce566=_0x2ce566-0x0;var _0x5d5400=_0xa018[_0x2ce566];return _0x5d5400;};'use strict';var Sequelize=require(_0x8a01('0x0'));module[_0x8a01('0x1')]={'state':{'type':Sequelize[_0x8a01('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x8a01('0x3')]},'countbusyretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x8a01('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8a01('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8a01('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8a01('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8a01('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8a01('0x4')]},'campaign':{'type':Sequelize[_0x8a01('0x4')]},'campaigntype':{'type':Sequelize[_0x8a01('0x4')]},'membername':{'type':Sequelize[_0x8a01('0x4')]},'reason':{'type':Sequelize[_0x8a01('0x4')]},'amd':{'type':Sequelize[_0x8a01('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8a01('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8a01('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8a01('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8a01('0x3')]},'edited':{'type':Sequelize[_0x8a01('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 7b7e44e..eb20fb5 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 _0xf29e=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','stack','name','send','index','CmHopperHistory','rawAttributes','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','describe','uniqueid','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0xd40359,_0x19fec0){var _0x24988d=function(_0x3b7d4e){while(--_0x3b7d4e){_0xd40359['push'](_0xd40359['shift']());}};_0x24988d(++_0x19fec0);}(_0xf29e,0x88));var _0xef29=function(_0x4d9a30,_0x275a59){_0x4d9a30=_0x4d9a30-0x0;var _0xd5295=_0xf29e[_0x4d9a30];return _0xd5295;};'use strict';var emlformat=require(_0xef29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef29('0x1'));var jsonpatch=require(_0xef29('0x2'));var rp=require(_0xef29('0x3'));var moment=require(_0xef29('0x4'));var BPromise=require(_0xef29('0x5'));var Mustache=require(_0xef29('0x6'));var util=require(_0xef29('0x7'));var path=require(_0xef29('0x8'));var sox=require(_0xef29('0x9'));var csv=require(_0xef29('0xa'));var ejs=require(_0xef29('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef29('0xc'));var squel=require(_0xef29('0xd'));var crypto=require(_0xef29('0xe'));var jsforce=require(_0xef29('0xf'));var deskjs=require(_0xef29('0x10'));var toCsv=require(_0xef29('0xa'));var querystring=require(_0xef29('0x11'));var Papa=require(_0xef29('0x12'));var Redis=require(_0xef29('0x13'));var authService=require(_0xef29('0x14'));var qs=require(_0xef29('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef29('0x16'));var utils=require(_0xef29('0x17'));var config=require(_0xef29('0x18'));var licenseUtil=require(_0xef29('0x19'));var db=require(_0xef29('0x1a'))['db'];function respondWithStatusCode(_0x34860f,_0x4ef6bd){_0x4ef6bd=_0x4ef6bd||0xcc;return function(_0x350f7e){if(_0x350f7e){return _0x34860f[_0xef29('0x1b')](_0x4ef6bd);}return _0x34860f[_0xef29('0x1c')](_0x4ef6bd)[_0xef29('0x1d')]();};}function respondWithResult(_0x4c11b8,_0x62785a){_0x62785a=_0x62785a||0xc8;return function(_0x3f0337){if(_0x3f0337){return _0x4c11b8[_0xef29('0x1c')](_0x62785a)[_0xef29('0x1e')](_0x3f0337);}};}function respondWithFilteredResult(_0x217f9a,_0x58726f){return function(_0x4cc483){if(_0x4cc483){var _0x2fe398=typeof _0x58726f['offset']==='undefined'&&typeof _0x58726f[_0xef29('0x1f')]===_0xef29('0x20');var _0x232d68=_0x4cc483[_0xef29('0x21')];var _0x3585bd=_0x2fe398?0x0:_0x58726f[_0xef29('0x22')];var _0x1fee1f=_0x2fe398?_0x4cc483[_0xef29('0x21')]:_0x58726f[_0xef29('0x22')]+_0x58726f[_0xef29('0x1f')];var _0x395b8f;if(_0x1fee1f>=_0x232d68){_0x1fee1f=_0x232d68;_0x395b8f=0xc8;}else{_0x395b8f=0xce;}_0x217f9a['status'](_0x395b8f);return _0x217f9a[_0xef29('0x23')]('Content-Range',_0x3585bd+'-'+_0x1fee1f+'/'+_0x232d68)['json'](_0x4cc483);}return null;};}function patchUpdates(_0x9499ca){return function(_0x5c6b0c){try{jsonpatch[_0xef29('0x24')](_0x5c6b0c,_0x9499ca,!![]);}catch(_0x992129){return BPromise[_0xef29('0x25')](_0x992129);}return _0x5c6b0c[_0xef29('0x26')]();};}function saveUpdates(_0x2c01ee,_0x40e556){return function(_0x5bd1c8){if(_0x5bd1c8){return _0x5bd1c8[_0xef29('0x27')](_0x2c01ee)[_0xef29('0x28')](function(_0x20939c){return _0x20939c;});}return null;};}function removeEntity(_0x2da02,_0x5e5909){return function(_0x556cf9){if(_0x556cf9){return _0x556cf9['destroy']()[_0xef29('0x28')](function(){_0x2da02[_0xef29('0x1c')](0xcc)[_0xef29('0x1d')]();});}};}function handleEntityNotFound(_0x4d9159,_0x3d18ed){return function(_0x366103){if(!_0x366103){_0x4d9159[_0xef29('0x1b')](0x194);}return _0x366103;};}function handleError(_0x1385bc,_0x1534f9){_0x1534f9=_0x1534f9||0x1f4;return function(_0x30079f){logger['error'](_0x30079f[_0xef29('0x29')]);if(_0x30079f[_0xef29('0x2a')]){delete _0x30079f[_0xef29('0x2a')];}_0x1385bc[_0xef29('0x1c')](_0x1534f9)[_0xef29('0x2b')](_0x30079f);};}exports[_0xef29('0x2c')]=function(_0x4bcd9a,_0xbf95f2){var _0x515828={},_0x588a6e={},_0x231645={'count':0x0,'rows':[]};var _0x3d2540=_['map'](db[_0xef29('0x2d')][_0xef29('0x2e')],function(_0x16e6ce){return{'name':_0x16e6ce['fieldName'],'type':_0x16e6ce['type']['key']};});_0x588a6e[_0xef29('0x2f')]=_[_0xef29('0x30')](_0x3d2540,_0xef29('0x2a'));_0x588a6e[_0xef29('0x31')]=_['keys'](_0x4bcd9a['query']);_0x588a6e[_0xef29('0x32')]=_[_0xef29('0x33')](_0x588a6e['model'],_0x588a6e[_0xef29('0x31')]);_0x515828[_0xef29('0x34')]=_['intersection'](_0x588a6e[_0xef29('0x2f')],qs[_0xef29('0x35')](_0x4bcd9a[_0xef29('0x31')][_0xef29('0x35')]));_0x515828[_0xef29('0x34')]=_0x515828[_0xef29('0x34')][_0xef29('0x36')]?_0x515828[_0xef29('0x34')]:_0x588a6e['model'];if(!_0x4bcd9a[_0xef29('0x31')][_0xef29('0x37')]('nolimit')){_0x515828[_0xef29('0x1f')]=qs[_0xef29('0x1f')](_0x4bcd9a[_0xef29('0x31')][_0xef29('0x1f')]);_0x515828['offset']=qs[_0xef29('0x22')](_0x4bcd9a[_0xef29('0x31')]['offset']);}_0x515828['order']=qs[_0xef29('0x38')](_0x4bcd9a[_0xef29('0x31')][_0xef29('0x38')]);_0x515828[_0xef29('0x39')]=qs[_0xef29('0x32')](_['pick'](_0x4bcd9a[_0xef29('0x31')],_0x588a6e[_0xef29('0x32')]),_0x3d2540);if(_0x4bcd9a['query'][_0xef29('0x3a')]){_0x515828[_0xef29('0x39')]=_[_0xef29('0x3b')](_0x515828[_0xef29('0x39')],{'$or':_['map'](_0x3d2540,function(_0x40fa81){if(_0x40fa81['type']!=='VIRTUAL'){var _0x23d002={};_0x23d002[_0x40fa81['name']]={'$like':'%'+_0x4bcd9a[_0xef29('0x31')][_0xef29('0x3a')]+'%'};return _0x23d002;}})});}_0x515828=_[_0xef29('0x3b')]({},_0x515828,_0x4bcd9a[_0xef29('0x3c')]);var _0x4f9658={'where':_0x515828[_0xef29('0x39')]};return db['CmHopperHistory']['count'](_0x4f9658)['then'](function(_0x1b090f){_0x231645[_0xef29('0x21')]=_0x1b090f;if(_0x4bcd9a['query'][_0xef29('0x3d')]){_0x515828[_0xef29('0x3e')]=[{'all':!![]}];}return db[_0xef29('0x2d')][_0xef29('0x3f')](_0x515828);})[_0xef29('0x28')](function(_0x30bb95){_0x231645[_0xef29('0x40')]=_0x30bb95;return _0x231645;})[_0xef29('0x28')](respondWithFilteredResult(_0xbf95f2,_0x515828))[_0xef29('0x41')](handleError(_0xbf95f2,null));};exports[_0xef29('0x42')]=function(_0x520eb3,_0x2210f2){var _0x46d18f={'raw':!![],'where':{'id':_0x520eb3[_0xef29('0x43')]['id']}},_0x100cc0={};_0x100cc0['model']=_[_0xef29('0x44')](db[_0xef29('0x2d')]['rawAttributes']);_0x100cc0[_0xef29('0x31')]=_['keys'](_0x520eb3[_0xef29('0x31')]);_0x100cc0[_0xef29('0x32')]=_[_0xef29('0x33')](_0x100cc0['model'],_0x100cc0[_0xef29('0x31')]);_0x46d18f['attributes']=_['intersection'](_0x100cc0[_0xef29('0x2f')],qs['fields'](_0x520eb3['query'][_0xef29('0x35')]));_0x46d18f[_0xef29('0x34')]=_0x46d18f[_0xef29('0x34')][_0xef29('0x36')]?_0x46d18f[_0xef29('0x34')]:_0x100cc0[_0xef29('0x2f')];if(_0x520eb3[_0xef29('0x31')][_0xef29('0x3d')]){_0x46d18f[_0xef29('0x3e')]=[{'all':!![]}];}_0x46d18f=_[_0xef29('0x3b')]({},_0x46d18f,_0x520eb3[_0xef29('0x3c')]);return db[_0xef29('0x2d')]['find'](_0x46d18f)[_0xef29('0x28')](handleEntityNotFound(_0x2210f2,null))[_0xef29('0x28')](respondWithResult(_0x2210f2,null))['catch'](handleError(_0x2210f2,null));};exports['create']=function(_0x3f6dcd,_0x2b3f51){return db['CmHopperHistory'][_0xef29('0x45')](_0x3f6dcd['body'],{})[_0xef29('0x28')](respondWithResult(_0x2b3f51,0xc9))[_0xef29('0x41')](handleError(_0x2b3f51,null));};exports['describe']=function(_0x1b4019,_0x279454){return db[_0xef29('0x2d')][_0xef29('0x46')]()[_0xef29('0x28')](respondWithResult(_0x279454,null))[_0xef29('0x41')](handleError(_0x279454,null));};exports[_0xef29('0x27')]=function(_0x811e97,_0x433872){if(_0x811e97['body'][_0xef29('0x47')]){delete _0x811e97[_0xef29('0x48')][_0xef29('0x47')];}return db['CmHopperHistory'][_0xef29('0x49')]({'where':{'uniqueid':_0x811e97[_0xef29('0x43')]['id']}})[_0xef29('0x28')](handleEntityNotFound(_0x433872,null))['then'](saveUpdates(_0x811e97[_0xef29('0x48')],null))['then'](respondWithResult(_0x433872,null))['catch'](handleError(_0x433872,null));}; \ No newline at end of file +var _0x9d85=['stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','sendStatus','error'];(function(_0x2729cd,_0x462966){var _0x1c259=function(_0x51f3a4){while(--_0x51f3a4){_0x2729cd['push'](_0x2729cd['shift']());}};_0x1c259(++_0x462966);}(_0x9d85,0x153));var _0x59d8=function(_0x3e0646,_0x5b2e0b){_0x3e0646=_0x3e0646-0x0;var _0x2565b1=_0x9d85[_0x3e0646];return _0x2565b1;};'use strict';var emlformat=require(_0x59d8('0x0'));var rimraf=require(_0x59d8('0x1'));var zipdir=require(_0x59d8('0x2'));var jsonpatch=require(_0x59d8('0x3'));var rp=require(_0x59d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x59d8('0x5'));var util=require(_0x59d8('0x6'));var path=require(_0x59d8('0x7'));var sox=require('sox');var csv=require(_0x59d8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59d8('0x9'));var _=require(_0x59d8('0xa'));var squel=require(_0x59d8('0xb'));var crypto=require('crypto');var jsforce=require(_0x59d8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x59d8('0x8'));var querystring=require(_0x59d8('0xd'));var Papa=require(_0x59d8('0xe'));var Redis=require(_0x59d8('0xf'));var authService=require(_0x59d8('0x10'));var qs=require(_0x59d8('0x11'));var as=require(_0x59d8('0x12'));var hardwareService=require(_0x59d8('0x13'));var logger=require(_0x59d8('0x14'))(_0x59d8('0x15'));var utils=require(_0x59d8('0x16'));var config=require(_0x59d8('0x17'));var licenseUtil=require(_0x59d8('0x18'));var db=require(_0x59d8('0x19'))['db'];function respondWithStatusCode(_0xf5abb7,_0x79fd50){_0x79fd50=_0x79fd50||0xcc;return function(_0xfead59){if(_0xfead59){return _0xf5abb7['sendStatus'](_0x79fd50);}return _0xf5abb7[_0x59d8('0x1a')](_0x79fd50)[_0x59d8('0x1b')]();};}function respondWithResult(_0x457e5e,_0x6a18fd){_0x6a18fd=_0x6a18fd||0xc8;return function(_0x3bf37d){if(_0x3bf37d){return _0x457e5e['status'](_0x6a18fd)[_0x59d8('0x1c')](_0x3bf37d);}};}function respondWithFilteredResult(_0xc06398,_0x561e3d){return function(_0x68ec74){if(_0x68ec74){var _0x243a57=typeof _0x561e3d[_0x59d8('0x1d')]===_0x59d8('0x1e')&&typeof _0x561e3d[_0x59d8('0x1f')]===_0x59d8('0x1e');var _0x30f4ec=_0x68ec74[_0x59d8('0x20')];var _0x1ffcbc=_0x243a57?0x0:_0x561e3d[_0x59d8('0x1d')];var _0x130b55=_0x243a57?_0x68ec74[_0x59d8('0x20')]:_0x561e3d[_0x59d8('0x1d')]+_0x561e3d[_0x59d8('0x1f')];var _0x429d84;if(_0x130b55>=_0x30f4ec){_0x130b55=_0x30f4ec;_0x429d84=0xc8;}else{_0x429d84=0xce;}_0xc06398[_0x59d8('0x1a')](_0x429d84);return _0xc06398[_0x59d8('0x21')]('Content-Range',_0x1ffcbc+'-'+_0x130b55+'/'+_0x30f4ec)['json'](_0x68ec74);}return null;};}function patchUpdates(_0x1b77f0){return function(_0x33cf98){try{jsonpatch[_0x59d8('0x22')](_0x33cf98,_0x1b77f0,!![]);}catch(_0x4260ec){return BPromise['reject'](_0x4260ec);}return _0x33cf98[_0x59d8('0x23')]();};}function saveUpdates(_0x1692a0,_0x1201f4){return function(_0xfa471b){if(_0xfa471b){return _0xfa471b[_0x59d8('0x24')](_0x1692a0)['then'](function(_0x3d483c){return _0x3d483c;});}return null;};}function removeEntity(_0x1d81fa,_0x1854cd){return function(_0xf7e3c5){if(_0xf7e3c5){return _0xf7e3c5[_0x59d8('0x25')]()[_0x59d8('0x26')](function(){_0x1d81fa[_0x59d8('0x1a')](0xcc)[_0x59d8('0x1b')]();});}};}function handleEntityNotFound(_0x5a5135,_0x8f212d){return function(_0x1b3a1a){if(!_0x1b3a1a){_0x5a5135[_0x59d8('0x27')](0x194);}return _0x1b3a1a;};}function handleError(_0x4406c0,_0x4fdd1f){_0x4fdd1f=_0x4fdd1f||0x1f4;return function(_0x1a6d32){logger[_0x59d8('0x28')](_0x1a6d32[_0x59d8('0x29')]);if(_0x1a6d32[_0x59d8('0x2a')]){delete _0x1a6d32[_0x59d8('0x2a')];}_0x4406c0['status'](_0x4fdd1f)[_0x59d8('0x2b')](_0x1a6d32);};}exports['index']=function(_0x2c27d3,_0x1522f5){var _0x194a5a={},_0x4ad068={},_0x380fef={'count':0x0,'rows':[]};var _0x455d7c=_[_0x59d8('0x2c')](db[_0x59d8('0x2d')][_0x59d8('0x2e')],function(_0x14c2bf){return{'name':_0x14c2bf[_0x59d8('0x2f')],'type':_0x14c2bf[_0x59d8('0x30')]['key']};});_0x4ad068[_0x59d8('0x31')]=_[_0x59d8('0x2c')](_0x455d7c,_0x59d8('0x2a'));_0x4ad068[_0x59d8('0x32')]=_[_0x59d8('0x33')](_0x2c27d3['query']);_0x4ad068[_0x59d8('0x34')]=_[_0x59d8('0x35')](_0x4ad068[_0x59d8('0x31')],_0x4ad068['query']);_0x194a5a[_0x59d8('0x36')]=_[_0x59d8('0x35')](_0x4ad068[_0x59d8('0x31')],qs[_0x59d8('0x37')](_0x2c27d3[_0x59d8('0x32')][_0x59d8('0x37')]));_0x194a5a[_0x59d8('0x36')]=_0x194a5a['attributes'][_0x59d8('0x38')]?_0x194a5a['attributes']:_0x4ad068['model'];if(!_0x2c27d3[_0x59d8('0x32')][_0x59d8('0x39')](_0x59d8('0x3a'))){_0x194a5a[_0x59d8('0x1f')]=qs[_0x59d8('0x1f')](_0x2c27d3['query'][_0x59d8('0x1f')]);_0x194a5a[_0x59d8('0x1d')]=qs[_0x59d8('0x1d')](_0x2c27d3['query'][_0x59d8('0x1d')]);}_0x194a5a['order']=qs[_0x59d8('0x3b')](_0x2c27d3['query'][_0x59d8('0x3b')]);_0x194a5a[_0x59d8('0x3c')]=qs[_0x59d8('0x34')](_[_0x59d8('0x3d')](_0x2c27d3['query'],_0x4ad068[_0x59d8('0x34')]),_0x455d7c);if(_0x2c27d3[_0x59d8('0x32')][_0x59d8('0x3e')]){_0x194a5a[_0x59d8('0x3c')]=_[_0x59d8('0x3f')](_0x194a5a[_0x59d8('0x3c')],{'$or':_[_0x59d8('0x2c')](_0x455d7c,function(_0x35c66c){if(_0x35c66c[_0x59d8('0x30')]!==_0x59d8('0x40')){var _0x4df79b={};_0x4df79b[_0x35c66c[_0x59d8('0x2a')]]={'$like':'%'+_0x2c27d3['query'][_0x59d8('0x3e')]+'%'};return _0x4df79b;}})});}_0x194a5a=_[_0x59d8('0x3f')]({},_0x194a5a,_0x2c27d3[_0x59d8('0x41')]);var _0x3c177e={'where':_0x194a5a[_0x59d8('0x3c')]};return db[_0x59d8('0x2d')][_0x59d8('0x20')](_0x3c177e)['then'](function(_0x4b7fd5){_0x380fef[_0x59d8('0x20')]=_0x4b7fd5;if(_0x2c27d3[_0x59d8('0x32')]['includeAll']){_0x194a5a[_0x59d8('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x59d8('0x43')](_0x194a5a);})[_0x59d8('0x26')](function(_0x1b1d0a){_0x380fef[_0x59d8('0x44')]=_0x1b1d0a;return _0x380fef;})[_0x59d8('0x26')](respondWithFilteredResult(_0x1522f5,_0x194a5a))[_0x59d8('0x45')](handleError(_0x1522f5,null));};exports['show']=function(_0x4b70ce,_0x50dbde){var _0xee1a4b={'raw':!![],'where':{'id':_0x4b70ce['params']['id']}},_0x1a9555={};_0x1a9555[_0x59d8('0x31')]=_[_0x59d8('0x33')](db[_0x59d8('0x2d')][_0x59d8('0x2e')]);_0x1a9555['query']=_[_0x59d8('0x33')](_0x4b70ce[_0x59d8('0x32')]);_0x1a9555[_0x59d8('0x34')]=_[_0x59d8('0x35')](_0x1a9555['model'],_0x1a9555[_0x59d8('0x32')]);_0xee1a4b[_0x59d8('0x36')]=_['intersection'](_0x1a9555[_0x59d8('0x31')],qs[_0x59d8('0x37')](_0x4b70ce['query'][_0x59d8('0x37')]));_0xee1a4b[_0x59d8('0x36')]=_0xee1a4b[_0x59d8('0x36')][_0x59d8('0x38')]?_0xee1a4b['attributes']:_0x1a9555[_0x59d8('0x31')];if(_0x4b70ce[_0x59d8('0x32')][_0x59d8('0x46')]){_0xee1a4b[_0x59d8('0x42')]=[{'all':!![]}];}_0xee1a4b=_['merge']({},_0xee1a4b,_0x4b70ce[_0x59d8('0x41')]);return db[_0x59d8('0x2d')][_0x59d8('0x47')](_0xee1a4b)['then'](handleEntityNotFound(_0x50dbde,null))['then'](respondWithResult(_0x50dbde,null))[_0x59d8('0x45')](handleError(_0x50dbde,null));};exports[_0x59d8('0x48')]=function(_0x414a85,_0x3b4a5d){return db[_0x59d8('0x2d')][_0x59d8('0x48')](_0x414a85['body'],{})[_0x59d8('0x26')](respondWithResult(_0x3b4a5d,0xc9))['catch'](handleError(_0x3b4a5d,null));};exports['describe']=function(_0x1280df,_0x209e64){return db['CmHopperHistory']['describe']()[_0x59d8('0x26')](respondWithResult(_0x209e64,null))['catch'](handleError(_0x209e64,null));};exports[_0x59d8('0x24')]=function(_0x2165e0,_0x23618b){if(_0x2165e0[_0x59d8('0x49')][_0x59d8('0x4a')]){delete _0x2165e0[_0x59d8('0x49')][_0x59d8('0x4a')];}return db[_0x59d8('0x2d')][_0x59d8('0x47')]({'where':{'uniqueid':_0x2165e0[_0x59d8('0x4b')]['id']}})[_0x59d8('0x26')](handleEntityNotFound(_0x23618b,null))[_0x59d8('0x26')](saveUpdates(_0x2165e0[_0x59d8('0x49')],null))['then'](respondWithResult(_0x23618b,null))[_0x59d8('0x45')](handleError(_0x23618b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index dc83c56..ee750eb 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 _0x731b=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x731b,0xf7));var _0xb731=function(_0x1f55d2,_0x167529){_0x1f55d2=_0x1f55d2-0x0;var _0x26622c=_0x731b[_0x1f55d2];return _0x26622c;};'use strict';var _=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var logger=require('../../config/logger')(_0xb731('0x2'));var moment=require(_0xb731('0x3'));var BPromise=require(_0xb731('0x4'));var rp=require(_0xb731('0x5'));var fs=require('fs');var path=require(_0xb731('0x6'));var rimraf=require(_0xb731('0x7'));var config=require('../../config/environment');var attributes=require(_0xb731('0x8'));module[_0xb731('0x9')]=function(_0x40b673,_0xd6b442){return _0x40b673[_0xb731('0xa')](_0xb731('0xb'),attributes,{'tableName':_0xb731('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb731('0xd')]},{'name':_0xb731('0xe'),'fields':[_0xb731('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7374=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x76b00b,_0x26e939){var _0xc8e4a=function(_0xb16025){while(--_0xb16025){_0x76b00b['push'](_0x76b00b['shift']());}};_0xc8e4a(++_0x26e939);}(_0x7374,0x1b9));var _0x4737=function(_0x262061,_0x4acf7d){_0x262061=_0x262061-0x0;var _0xd5327e=_0x7374[_0x262061];return _0xd5327e;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x4737('0xb'),'fields':[_0x4737('0xb')]},{'name':_0x4737('0xc'),'fields':[_0x4737('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8d083a4..86d6ebd 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 _0xc368=['debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrAnswerCallsDay','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0x59e9ff,_0x5080c3){var _0xa71d5e=function(_0x7d1718){while(--_0x7d1718){_0x59e9ff['push'](_0x59e9ff['shift']());}};_0xa71d5e(++_0x5080c3);}(_0xc368,0x7b));var _0x8c36=function(_0x4f6a4e,_0x3c740a){_0x4f6a4e=_0x4f6a4e-0x0;var _0x3b2d91=_0xc368[_0x4f6a4e];return _0x3b2d91;};'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']('CmHopperHistory,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('CmHopperHistory,\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);});});}exports['CreateCmHopperHistory']=function(_0x2be9b0){var _0x46ae6e=this;return new Promise(function(_0x47832a,_0x2d5e5b){return db[_0x8c36('0x16')]['create'](_0x2be9b0[_0x8c36('0x17')],{'raw':_0x2be9b0[_0x8c36('0x18')]?_0x2be9b0[_0x8c36('0x18')][_0x8c36('0x19')]===undefined?!![]:![]:!![]})[_0x8c36('0xb')](function(_0x2b07ad){logger[_0x8c36('0x13')](_0x8c36('0x1a'),_0x2be9b0);logger[_0x8c36('0xd')](_0x8c36('0x1a'),_0x2be9b0,JSON[_0x8c36('0xe')](_0x2b07ad));_0x47832a(_0x2b07ad);})[_0x8c36('0x15')](function(_0x46645d){logger['error']('CreateCmHopperHistory',_0x46645d['message'],_0x2be9b0);_0x2d5e5b(_0x46ae6e['error'](0x1f4,_0x46645d[_0x8c36('0x12')]));});});};exports[_0x8c36('0x1b')]=function(_0x2088aa){var _0x2c9e9a=this;return new Promise(function(_0x127aae,_0x27c0df){return db['CmHopperHistory'][_0x8c36('0x1c')]({'raw':_0x2088aa['options']?_0x2088aa[_0x8c36('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2088aa[_0x8c36('0x18')]?_0x2088aa[_0x8c36('0x18')][_0x8c36('0x1d')]||null:null,'attributes':[[db[_0x8c36('0x1e')]['fn']('COUNT',db['sequelize'][_0x8c36('0x1f')]('id')),_0x8c36('0x20')],[db['sequelize']['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal'](_0x8c36('0x21')))),_0x8c36('0x22')],[db[_0x8c36('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x24')))),_0x8c36('0x25')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x27')))),_0x8c36('0x28')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x29'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x2a')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x2b')))),_0x8c36('0x2c')]]})[_0x8c36('0xb')](function(_0xc3f5b4){logger['info'](_0x8c36('0x1b'),_0x2088aa);logger['debug'](_0x8c36('0x1b'),_0x2088aa,JSON['stringify'](_0xc3f5b4));_0x127aae(_0xc3f5b4);})[_0x8c36('0x15')](function(_0x2c876e){logger[_0x8c36('0xf')]('AvgHandleTime',_0x2c876e[_0x8c36('0x12')],_0x2088aa);_0x27c0df(_0x2c9e9a[_0x8c36('0xf')](0x1f4,_0x2c876e[_0x8c36('0x12')]));});});};exports[_0x8c36('0x2d')]=function(_0x3d548f){var _0x12421b=this;return new Promise(function(_0x1a4c3e,_0x334b02){return db[_0x8c36('0x16')][_0x8c36('0x1c')]({'raw':_0x3d548f[_0x8c36('0x18')]?_0x3d548f[_0x8c36('0x18')][_0x8c36('0x19')]===undefined?!![]:![]:!![],'where':_0x3d548f[_0x8c36('0x18')]?_0x3d548f[_0x8c36('0x18')][_0x8c36('0x1d')]||null:null,'attributes':[[_0x8c36('0x2e'),'name'],[db[_0x8c36('0x1e')]['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x2f')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x8c36('0x30')],[db['sequelize']['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x21')))),_0x8c36('0x31')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')]('`state`\x20=\x205,\x201,\x20null'))),_0x8c36('0x32')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal'](_0x8c36('0x33')))),_0x8c36('0x34')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal'](_0x8c36('0x35')))),_0x8c36('0x36')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x8c36('0x37')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x38')))),_0x8c36('0x39')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x8c36('0x3a')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db['sequelize'][_0x8c36('0x23')](_0x8c36('0x3b')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x3c')))),_0x8c36('0x3d')],[db[_0x8c36('0x1e')]['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x3e')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')][_0x8c36('0x23')](_0x8c36('0x3f')))),_0x8c36('0x3d')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db[_0x8c36('0x1e')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x8c36('0x40')]],'group':['campaign']})['then'](function(_0x9955bc){logger['info'](_0x8c36('0x2d'),_0x3d548f);logger[_0x8c36('0xd')]('GetVoiceQueueHopperHistory',_0x3d548f,JSON[_0x8c36('0xe')](_0x9955bc));_0x1a4c3e(_0x9955bc);})['catch'](function(_0x31fbde){logger[_0x8c36('0xf')](_0x8c36('0x2d'),_0x31fbde['message'],_0x3d548f);_0x334b02(_0x12421b[_0x8c36('0xf')](0x1f4,_0x31fbde[_0x8c36('0x12')]));});});};exports[_0x8c36('0x41')]=function(_0x339d01){var _0x206b35=this;return new Promise(function(_0x1505f3,_0x242d1a){return db[_0x8c36('0x16')][_0x8c36('0x1c')]({'raw':_0x339d01['options']?_0x339d01['options']['raw']===undefined?!![]:![]:!![],'where':_0x339d01[_0x8c36('0x18')]?_0x339d01['options']['where']||null:null,'attributes':[[_0x8c36('0x2e'),_0x8c36('0x42')],[db[_0x8c36('0x1e')]['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['col']('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x8c36('0x26'),db[_0x8c36('0x1e')]['fn']('IF',db['sequelize'][_0x8c36('0x23')](_0x8c36('0x21')))),_0x8c36('0x43')]],'group':[_0x8c36('0x2e')]})[_0x8c36('0xb')](function(_0x1094f9){logger[_0x8c36('0x13')](_0x8c36('0x41'),_0x339d01);logger[_0x8c36('0xd')]('GetCampaignHopperHistory',_0x339d01,JSON['stringify'](_0x1094f9));_0x1505f3(_0x1094f9);})['catch'](function(_0x2c82c0){logger[_0x8c36('0xf')](_0x8c36('0x41'),_0x2c82c0[_0x8c36('0x12')],_0x339d01);_0x242d1a(_0x206b35[_0x8c36('0xf')](0x1f4,_0x2c82c0[_0x8c36('0x12')]));});});}; \ No newline at end of file +var _0xd634=['`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','findAll','raw','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','create','options','then','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG'];(function(_0xb62a18,_0x11bd8b){var _0x4d0dd8=function(_0x6c94cd){while(--_0x6c94cd){_0xb62a18['push'](_0xb62a18['shift']());}};_0x4d0dd8(++_0x11bd8b);}(_0xd634,0x151));var _0x4d63=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0xd634[_0x16337a];return _0x422365;};'use strict';var _=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var moment=require(_0x4d63('0x2'));var BPromise=require(_0x4d63('0x3'));var rs=require(_0x4d63('0x4'));var fs=require('fs');var Redis=require(_0x4d63('0x5'));var db=require(_0x4d63('0x6'))['db'];var utils=require(_0x4d63('0x7'));var logger=require(_0x4d63('0x8'))(_0x4d63('0x9'));var config=require('../../config/environment');var jayson=require(_0x4d63('0xa'));var client=jayson[_0x4d63('0xb')][_0x4d63('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a28b8,_0x42c748,_0x3578d0){return new BPromise(function(_0x269b6b,_0x1421d0){return client['request'](_0x1a28b8,_0x3578d0)['then'](function(_0x16c4dc){logger['info'](_0x4d63('0xd'),_0x42c748,_0x4d63('0xe'));logger[_0x4d63('0xf')](_0x4d63('0x10'),_0x42c748,'request\x20sent',JSON[_0x4d63('0x11')](_0x16c4dc));if(_0x16c4dc['error']){if(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x13')]===0x1f4){logger['error'](_0x4d63('0xd'),_0x42c748,_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);return _0x1421d0(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);}logger[_0x4d63('0x12')](_0x4d63('0xd'),_0x42c748,_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);return _0x269b6b(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);}else{logger[_0x4d63('0x15')](_0x4d63('0xd'),_0x42c748,'request\x20sent');_0x269b6b(_0x16c4dc[_0x4d63('0x16')][_0x4d63('0x14')]);}})[_0x4d63('0x17')](function(_0x3ed512){logger[_0x4d63('0x12')](_0x4d63('0xd'),_0x42c748,_0x3ed512);_0x1421d0(_0x3ed512);});});}exports[_0x4d63('0x18')]=function(_0x20f810){var _0x413050=this;return new Promise(function(_0x603dc3,_0x3922a3){return db['CmHopperHistory'][_0x4d63('0x19')](_0x20f810['body'],{'raw':_0x20f810['options']?_0x20f810[_0x4d63('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4d63('0x1b')](function(_0x230af4){logger[_0x4d63('0x15')](_0x4d63('0x18'),_0x20f810);logger['debug'](_0x4d63('0x18'),_0x20f810,JSON[_0x4d63('0x11')](_0x230af4));_0x603dc3(_0x230af4);})[_0x4d63('0x17')](function(_0x2b9ad6){logger[_0x4d63('0x12')](_0x4d63('0x18'),_0x2b9ad6[_0x4d63('0x14')],_0x20f810);_0x3922a3(_0x413050['error'](0x1f4,_0x2b9ad6[_0x4d63('0x14')]));});});};exports[_0x4d63('0x1c')]=function(_0x5c6777){var _0x1fd6e3=this;return new Promise(function(_0x1b2414,_0x671dcf){return db['CmHopperHistory']['findAll']({'raw':_0x5c6777[_0x4d63('0x1a')]?_0x5c6777[_0x4d63('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5c6777[_0x4d63('0x1a')]?_0x5c6777[_0x4d63('0x1a')]['where']||null:null,'attributes':[[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')][_0x4d63('0x1f')]('id')),_0x4d63('0x20')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x4d63('0x22')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x4d63('0x23')],[db['sequelize']['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')]['literal'](_0x4d63('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x25'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')]['literal'](_0x4d63('0x26')))),_0x4d63('0x27')],[db[_0x4d63('0x1d')]['fn']('AVG',db[_0x4d63('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x4d63('0x28')))),_0x4d63('0x29')]]})['then'](function(_0x372230){logger[_0x4d63('0x15')](_0x4d63('0x1c'),_0x5c6777);logger[_0x4d63('0xf')](_0x4d63('0x1c'),_0x5c6777,JSON['stringify'](_0x372230));_0x1b2414(_0x372230);})[_0x4d63('0x17')](function(_0x4292e9){logger[_0x4d63('0x12')]('AvgHandleTime',_0x4292e9[_0x4d63('0x14')],_0x5c6777);_0x671dcf(_0x1fd6e3[_0x4d63('0x12')](0x1f4,_0x4292e9['message']));});});};exports[_0x4d63('0x2a')]=function(_0x197a3d){var _0x3acf82=this;return new Promise(function(_0x5b7c24,_0x210200){return db[_0x4d63('0x2b')][_0x4d63('0x2c')]({'raw':_0x197a3d[_0x4d63('0x1a')]?_0x197a3d['options'][_0x4d63('0x2d')]===undefined?!![]:![]:!![],'where':_0x197a3d[_0x4d63('0x1a')]?_0x197a3d['options']['where']||null:null,'attributes':[[_0x4d63('0x2e'),'name'],[db[_0x4d63('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x2f')))),_0x4d63('0x30')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db['sequelize'][_0x4d63('0x21')](_0x4d63('0x31')))),_0x4d63('0x32')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x33')))),_0x4d63('0x34')],[db['sequelize']['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x4d63('0x35')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db['sequelize'][_0x4d63('0x21')](_0x4d63('0x36')))),_0x4d63('0x37')],[db[_0x4d63('0x1d')]['fn']('COUNT',db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x38')))),_0x4d63('0x39')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x3a')))),_0x4d63('0x3b')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db['sequelize']['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x3c')))),_0x4d63('0x3d')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x3e')))),_0x4d63('0x3f')],[db[_0x4d63('0x1d')]['fn']('COUNT',db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x40')))),_0x4d63('0x41')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x42')))),_0x4d63('0x43')],[db[_0x4d63('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x44')))),_0x4d63('0x45')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db['sequelize'][_0x4d63('0x21')](_0x4d63('0x46')))),'outboundRejectCallsDay'],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')]['fn']('IF',db[_0x4d63('0x1d')][_0x4d63('0x21')](_0x4d63('0x47')))),'outboundReCallsDay']],'group':[_0x4d63('0x2e')]})[_0x4d63('0x1b')](function(_0x3a5d6f){logger['info'](_0x4d63('0x2a'),_0x197a3d);logger['debug']('GetVoiceQueueHopperHistory',_0x197a3d,JSON[_0x4d63('0x11')](_0x3a5d6f));_0x5b7c24(_0x3a5d6f);})[_0x4d63('0x17')](function(_0x24160f){logger[_0x4d63('0x12')](_0x4d63('0x2a'),_0x24160f[_0x4d63('0x14')],_0x197a3d);_0x210200(_0x3acf82[_0x4d63('0x12')](0x1f4,_0x24160f[_0x4d63('0x14')]));});});};exports[_0x4d63('0x48')]=function(_0x9728b2){var _0x15c5af=this;return new Promise(function(_0x370fea,_0x244150){return db[_0x4d63('0x2b')][_0x4d63('0x2c')]({'raw':_0x9728b2[_0x4d63('0x1a')]?_0x9728b2[_0x4d63('0x1a')][_0x4d63('0x2d')]===undefined?!![]:![]:!![],'where':_0x9728b2[_0x4d63('0x1a')]?_0x9728b2[_0x4d63('0x1a')]['where']||null:null,'attributes':[[_0x4d63('0x2e'),_0x4d63('0x49')],[db[_0x4d63('0x1d')]['fn'](_0x4d63('0x1e'),db[_0x4d63('0x1d')][_0x4d63('0x1f')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0x4d63('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x4d63('0x33')))),_0x4d63('0x4a')]],'group':[_0x4d63('0x2e')]})['then'](function(_0x24932f){logger[_0x4d63('0x15')](_0x4d63('0x48'),_0x9728b2);logger[_0x4d63('0xf')](_0x4d63('0x48'),_0x9728b2,JSON['stringify'](_0x24932f));_0x370fea(_0x24932f);})[_0x4d63('0x17')](function(_0x3d05df){logger[_0x4d63('0x12')](_0x4d63('0x48'),_0x3d05df[_0x4d63('0x14')],_0x9728b2);_0x244150(_0x15c5af['error'](0x1f4,_0x3d05df['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 15c98fe..408bd6f 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 _0xca7f=['isAuthenticated','post','create','put','update','multer','path','express','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id'];(function(_0x156882,_0x2785a5){var _0x1895d9=function(_0x331f29){while(--_0x331f29){_0x156882['push'](_0x156882['shift']());}};_0x1895d9(++_0x2785a5);}(_0xca7f,0x11d));var _0xfca7=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xca7f[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xfca7('0x0'));var util=require('util');var path=require(_0xfca7('0x1'));var timeout=require('connect-timeout');var express=require(_0xfca7('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfca7('0x3'));var config=require(_0xfca7('0x4'));var controller=require('./cmHopperHistory.controller');router[_0xfca7('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfca7('0x5')](_0xfca7('0x6'),auth['isAuthenticated'](),controller[_0xfca7('0x7')]);router[_0xfca7('0x5')](_0xfca7('0x8'),auth[_0xfca7('0x9')](),controller['show']);router[_0xfca7('0xa')]('/',auth[_0xfca7('0x9')](),controller[_0xfca7('0xb')]);router[_0xfca7('0xc')](_0xfca7('0x8'),auth[_0xfca7('0x9')](),controller[_0xfca7('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1db3=['isAuthenticated','/describe','/:id','show','post','create','update','exports','multer','express','Router','../../components/interaction/service','./cmHopperHistory.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db3,0x174));var _0x31db=function(_0x2bd658,_0x533adf){_0x2bd658=_0x2bd658-0x0;var _0x211ac2=_0x1db3[_0x2bd658];return _0x211ac2;};'use strict';var multer=require(_0x31db('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x31db('0x1'));var router=express[_0x31db('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x31db('0x3'));var config=require('../../config/environment');var controller=require(_0x31db('0x4'));router[_0x31db('0x5')]('/',auth[_0x31db('0x6')](),controller['index']);router[_0x31db('0x5')](_0x31db('0x7'),auth[_0x31db('0x6')](),controller['describe']);router[_0x31db('0x5')](_0x31db('0x8'),auth['isAuthenticated'](),controller[_0x31db('0x9')]);router[_0x31db('0xa')]('/',auth[_0x31db('0x6')](),controller[_0x31db('0xb')]);router['put']('/:id',auth[_0x31db('0x6')](),controller[_0x31db('0xc')]);module[_0x31db('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 4602ddd..3a90936 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 _0x8ebf=['sequelize','exports','STRING'];(function(_0x23cc91,_0x477071){var _0x112ef8=function(_0x5c42e8){while(--_0x5c42e8){_0x23cc91['push'](_0x23cc91['shift']());}};_0x112ef8(++_0x477071);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x8ebf[_0x16771d];return _0x386f11;};'use strict';var Sequelize=require(_0xf8eb('0x0'));module[_0xf8eb('0x1')]={'name':{'type':Sequelize[_0xf8eb('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf8eb('0x2')]},'dialPrefix':{'type':Sequelize[_0xf8eb('0x2')]}}; \ No newline at end of file +var _0xe8f7=['STRING','name','sequelize'];(function(_0x4a81ff,_0x510cf4){var _0x3079cd=function(_0x3c47c3){while(--_0x3c47c3){_0x4a81ff['push'](_0x4a81ff['shift']());}};_0x3079cd(++_0x510cf4);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e8f('0x1')],'unique':_0x7e8f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7e8f('0x1')]},'dialPrefix':{'type':Sequelize[_0x7e8f('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 6d1834a..bef2add 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 _0x7ca5=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','order','ListId','removeDispositions','addContacts','CmContact','tags','isArray','join','push','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','format','getContactsCsv','CustomFields','raw','getContacts','now','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','CmList','includeAll','include','findAll','rows','show','params','length','options','find'];(function(_0x362e87,_0x38d17c){var _0x334244=function(_0x24feb8){while(--_0x24feb8){_0x362e87['push'](_0x362e87['shift']());}};_0x334244(++_0x38d17c);}(_0x7ca5,0x1f2));var _0x57ca=function(_0x2987c1,_0x186899){_0x2987c1=_0x2987c1-0x0;var _0x4a5735=_0x7ca5[_0x2987c1];return _0x4a5735;};'use strict';var emlformat=require(_0x57ca('0x0'));var rimraf=require(_0x57ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57ca('0x2'));var rp=require(_0x57ca('0x3'));var moment=require('moment');var BPromise=require(_0x57ca('0x4'));var Mustache=require('mustache');var util=require(_0x57ca('0x5'));var path=require('path');var sox=require(_0x57ca('0x6'));var csv=require(_0x57ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57ca('0x8'));var _=require(_0x57ca('0x9'));var squel=require('squel');var crypto=require(_0x57ca('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x57ca('0xb'));var toCsv=require(_0x57ca('0x7'));var querystring=require(_0x57ca('0xc'));var Papa=require(_0x57ca('0xd'));var Redis=require(_0x57ca('0xe'));var authService=require(_0x57ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x57ca('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57ca('0x11'))(_0x57ca('0x12'));var utils=require(_0x57ca('0x13'));var config=require(_0x57ca('0x14'));var licenseUtil=require(_0x57ca('0x15'));var db=require(_0x57ca('0x16'))['db'];config[_0x57ca('0x17')]=_['defaults'](config['redis'],{'host':_0x57ca('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57ca('0x17')]));require(_0x57ca('0x19'))['register'](socket);function respondWithStatusCode(_0x4cc57a,_0xbf5503){_0xbf5503=_0xbf5503||0xcc;return function(_0x28fe8a){if(_0x28fe8a){return _0x4cc57a[_0x57ca('0x1a')](_0xbf5503);}return _0x4cc57a[_0x57ca('0x1b')](_0xbf5503)[_0x57ca('0x1c')]();};}function respondWithResult(_0x5e65dd,_0x46375c){_0x46375c=_0x46375c||0xc8;return function(_0x528ab1){if(_0x528ab1){return _0x5e65dd[_0x57ca('0x1b')](_0x46375c)[_0x57ca('0x1d')](_0x528ab1);}};}function respondWithFilteredResult(_0x55579f,_0x473bee){return function(_0x335bbc){if(_0x335bbc){var _0x24e2cb=typeof _0x473bee['offset']===_0x57ca('0x1e')&&typeof _0x473bee[_0x57ca('0x1f')]==='undefined';var _0xae965a=_0x335bbc[_0x57ca('0x20')];var _0x40a181=_0x24e2cb?0x0:_0x473bee[_0x57ca('0x21')];var _0x246376=_0x24e2cb?_0x335bbc[_0x57ca('0x20')]:_0x473bee['offset']+_0x473bee['limit'];var _0x5cb6fd;if(_0x246376>=_0xae965a){_0x246376=_0xae965a;_0x5cb6fd=0xc8;}else{_0x5cb6fd=0xce;}_0x55579f[_0x57ca('0x1b')](_0x5cb6fd);return _0x55579f['set'](_0x57ca('0x22'),_0x40a181+'-'+_0x246376+'/'+_0xae965a)[_0x57ca('0x1d')](_0x335bbc);}return null;};}function patchUpdates(_0x4ea4e9){return function(_0x47053e){try{jsonpatch[_0x57ca('0x23')](_0x47053e,_0x4ea4e9,!![]);}catch(_0x2c5f07){return BPromise[_0x57ca('0x24')](_0x2c5f07);}return _0x47053e[_0x57ca('0x25')]();};}function saveUpdates(_0x45d596,_0x4c7017){return function(_0x125d3d){if(_0x125d3d){return _0x125d3d[_0x57ca('0x26')](_0x45d596)[_0x57ca('0x27')](function(_0x86a20a){return _0x86a20a;});}return null;};}function removeEntity(_0x55a9bd,_0x284408){return function(_0x30dc67){if(_0x30dc67){return _0x30dc67[_0x57ca('0x28')]()[_0x57ca('0x27')](function(){var _0x3f47ad=_0x30dc67[_0x57ca('0x29')]({'plain':!![]});var _0x3ea013=_0x57ca('0x2a');return db[_0x57ca('0x2b')][_0x57ca('0x28')]({'where':{'type':_0x3ea013,'resourceId':_0x3f47ad['id']}})[_0x57ca('0x27')](function(){return _0x30dc67;});})[_0x57ca('0x27')](function(){_0x55a9bd[_0x57ca('0x1b')](0xcc)[_0x57ca('0x1c')]();});}};}function handleEntityNotFound(_0x1909bd,_0x3f8f5e){return function(_0x4d9e60){if(!_0x4d9e60){_0x1909bd[_0x57ca('0x1a')](0x194);}return _0x4d9e60;};}function handleError(_0xc20b92,_0x1db955){_0x1db955=_0x1db955||0x1f4;return function(_0x463f29){logger[_0x57ca('0x2c')](_0x463f29[_0x57ca('0x2d')]);if(_0x463f29[_0x57ca('0x2e')]){delete _0x463f29[_0x57ca('0x2e')];}_0xc20b92[_0x57ca('0x1b')](_0x1db955)[_0x57ca('0x2f')](_0x463f29);};}exports[_0x57ca('0x30')]=function(_0x17804f,_0x42b3b2){var _0x4d0fe3={},_0x534b86={},_0x1d6193={'count':0x0,'rows':[]};var _0x39fd52=_[_0x57ca('0x31')](db['CmList'][_0x57ca('0x32')],function(_0x19d439){return{'name':_0x19d439[_0x57ca('0x33')],'type':_0x19d439[_0x57ca('0x34')][_0x57ca('0x35')]};});_0x534b86[_0x57ca('0x36')]=_[_0x57ca('0x31')](_0x39fd52,_0x57ca('0x2e'));_0x534b86[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0x17804f[_0x57ca('0x37')]);_0x534b86[_0x57ca('0x39')]=_[_0x57ca('0x3a')](_0x534b86[_0x57ca('0x36')],_0x534b86[_0x57ca('0x37')]);_0x4d0fe3[_0x57ca('0x3b')]=_[_0x57ca('0x3a')](_0x534b86[_0x57ca('0x36')],qs[_0x57ca('0x3c')](_0x17804f[_0x57ca('0x37')][_0x57ca('0x3c')]));_0x4d0fe3['attributes']=_0x4d0fe3[_0x57ca('0x3b')]['length']?_0x4d0fe3['attributes']:_0x534b86[_0x57ca('0x36')];if(!_0x17804f[_0x57ca('0x37')][_0x57ca('0x3d')]('nolimit')){_0x4d0fe3['limit']=qs[_0x57ca('0x1f')](_0x17804f[_0x57ca('0x37')]['limit']);_0x4d0fe3[_0x57ca('0x21')]=qs[_0x57ca('0x21')](_0x17804f[_0x57ca('0x37')]['offset']);}_0x4d0fe3['order']=qs[_0x57ca('0x3e')](_0x17804f[_0x57ca('0x37')]['sort']);_0x4d0fe3['where']=qs[_0x57ca('0x39')](_[_0x57ca('0x3f')](_0x17804f['query'],_0x534b86[_0x57ca('0x39')]),_0x39fd52);if(_0x17804f['query'][_0x57ca('0x40')]){_0x4d0fe3[_0x57ca('0x41')]=_[_0x57ca('0x42')](_0x4d0fe3['where'],{'$or':_[_0x57ca('0x31')](_0x39fd52,function(_0x4a162c){if(_0x4a162c[_0x57ca('0x34')]!==_0x57ca('0x43')){var _0x4e0f04={};_0x4e0f04[_0x4a162c[_0x57ca('0x2e')]]={'$like':'%'+_0x17804f[_0x57ca('0x37')][_0x57ca('0x40')]+'%'};return _0x4e0f04;}})});}_0x4d0fe3=_[_0x57ca('0x42')]({},_0x4d0fe3,_0x17804f['options']);var _0x29fdc6={'where':_0x4d0fe3['where']};return db[_0x57ca('0x44')][_0x57ca('0x20')](_0x29fdc6)[_0x57ca('0x27')](function(_0x5e240e){_0x1d6193['count']=_0x5e240e;if(_0x17804f[_0x57ca('0x37')][_0x57ca('0x45')]){_0x4d0fe3[_0x57ca('0x46')]=[{'all':!![]}];}return db[_0x57ca('0x44')][_0x57ca('0x47')](_0x4d0fe3);})[_0x57ca('0x27')](function(_0x242f7f){_0x1d6193[_0x57ca('0x48')]=_0x242f7f;return _0x1d6193;})[_0x57ca('0x27')](respondWithFilteredResult(_0x42b3b2,_0x4d0fe3))['catch'](handleError(_0x42b3b2,null));};exports[_0x57ca('0x49')]=function(_0xa6c861,_0xc31739){var _0x2709a0={'raw':![],'where':{'id':_0xa6c861[_0x57ca('0x4a')]['id']}},_0x7259={};_0x7259[_0x57ca('0x36')]=_[_0x57ca('0x38')](db['CmList'][_0x57ca('0x32')]);_0x7259[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0xa6c861[_0x57ca('0x37')]);_0x7259[_0x57ca('0x39')]=_[_0x57ca('0x3a')](_0x7259[_0x57ca('0x36')],_0x7259[_0x57ca('0x37')]);_0x2709a0[_0x57ca('0x3b')]=_[_0x57ca('0x3a')](_0x7259[_0x57ca('0x36')],qs[_0x57ca('0x3c')](_0xa6c861['query'][_0x57ca('0x3c')]));_0x2709a0[_0x57ca('0x3b')]=_0x2709a0[_0x57ca('0x3b')][_0x57ca('0x4b')]?_0x2709a0['attributes']:_0x7259['model'];if(_0xa6c861[_0x57ca('0x37')][_0x57ca('0x45')]){_0x2709a0[_0x57ca('0x46')]=[{'all':!![]}];}_0x2709a0=_[_0x57ca('0x42')]({},_0x2709a0,_0xa6c861[_0x57ca('0x4c')]);return db[_0x57ca('0x44')][_0x57ca('0x4d')](_0x2709a0)[_0x57ca('0x27')](handleEntityNotFound(_0xc31739,null))[_0x57ca('0x27')](respondWithResult(_0xc31739,null))['catch'](handleError(_0xc31739,null));};exports[_0x57ca('0x4e')]=function(_0x5b5bbc,_0x5dae7d){return db[_0x57ca('0x44')][_0x57ca('0x4e')](_0x5b5bbc[_0x57ca('0x4f')],{})[_0x57ca('0x27')](function(_0xad4363){var _0x484dfe=_0x5b5bbc[_0x57ca('0x50')][_0x57ca('0x29')]({'plain':!![]});if(!_0x484dfe)throw new Error(_0x57ca('0x51'));if(_0x484dfe['role']===_0x57ca('0x50')){var _0x5510c9=_0xad4363[_0x57ca('0x29')]({'plain':!![]});var _0x2af645=_0x57ca('0x2a');return db[_0x57ca('0x52')][_0x57ca('0x4d')]({'where':{'name':_0x2af645,'userProfileId':_0x484dfe[_0x57ca('0x53')]},'raw':!![]})['then'](function(_0xb2fce5){if(_0xb2fce5&&_0xb2fce5[_0x57ca('0x54')]===0x0){return db[_0x57ca('0x2b')][_0x57ca('0x4e')]({'name':_0x5510c9[_0x57ca('0x2e')],'resourceId':_0x5510c9['id'],'type':_0xb2fce5[_0x57ca('0x2e')],'sectionId':_0xb2fce5['id']},{})['then'](function(){return _0xad4363;});}else{return _0xad4363;}})['catch'](function(_0x194d91){logger[_0x57ca('0x2c')](_0x57ca('0x55'),_0x194d91);throw _0x194d91;});}return _0xad4363;})[_0x57ca('0x27')](respondWithResult(_0x5dae7d,0xc9))[_0x57ca('0x56')](handleError(_0x5dae7d,null));};exports[_0x57ca('0x26')]=function(_0x5965b0,_0x1c1802){if(_0x5965b0['body']['id']){delete _0x5965b0[_0x57ca('0x4f')]['id'];}return db[_0x57ca('0x44')][_0x57ca('0x4d')]({'where':{'id':_0x5965b0[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0x1c1802,null))['then'](saveUpdates(_0x5965b0['body'],null))[_0x57ca('0x27')](respondWithResult(_0x1c1802,null))[_0x57ca('0x56')](handleError(_0x1c1802,null));};exports[_0x57ca('0x28')]=function(_0x47c1b9,_0xf6dab2){return db[_0x57ca('0x44')][_0x57ca('0x4d')]({'where':{'id':_0x47c1b9[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0xf6dab2,null))[_0x57ca('0x27')](removeEntity(_0xf6dab2,null))[_0x57ca('0x56')](handleError(_0xf6dab2,null));};exports[_0x57ca('0x57')]=function(_0x40588a,_0x45d750){return db[_0x57ca('0x44')]['describe']()[_0x57ca('0x27')](respondWithResult(_0x45d750,null))[_0x57ca('0x56')](handleError(_0x45d750,null));};exports[_0x57ca('0x58')]=function(_0x520fa4,_0x4361dc,_0xc8e32){if(_0x520fa4[_0x57ca('0x4f')]['id']){delete _0x520fa4[_0x57ca('0x4f')]['id'];}return db[_0x57ca('0x44')][_0x57ca('0x4d')]({'where':{'id':_0x520fa4[_0x57ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4361dc,null))['then'](function(_0x228f64){if(_0x228f64){_0x520fa4[_0x57ca('0x4f')]['ListId']=_0x228f64['id'];return db[_0x57ca('0x59')]['create'](_0x520fa4['body']);}})[_0x57ca('0x27')](respondWithResult(_0x4361dc,null))[_0x57ca('0x56')](handleError(_0x4361dc,null));};exports[_0x57ca('0x5a')]=function(_0x491bde,_0x19065d,_0x543cd7){var _0x184e49={'raw':![],'where':{}};var _0x21dfa8={};var _0x939021={'count':0x0,'rows':[]};return db[_0x57ca('0x44')][_0x57ca('0x5b')]({'where':{'id':_0x491bde['params']['id']}})['then'](handleEntityNotFound(_0x19065d,null))['then'](function(_0x1cb26b){if(_0x1cb26b){_0x21dfa8['model']=_[_0x57ca('0x38')](db[_0x57ca('0x59')]['rawAttributes']);_0x21dfa8[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0x491bde[_0x57ca('0x37')]);_0x21dfa8[_0x57ca('0x39')]=_[_0x57ca('0x3a')](_0x21dfa8[_0x57ca('0x36')],_0x21dfa8['query']);_0x184e49['attributes']=_['intersection'](_0x21dfa8[_0x57ca('0x36')],qs[_0x57ca('0x3c')](_0x491bde[_0x57ca('0x37')]['fields']));_0x184e49[_0x57ca('0x3b')]=_0x184e49['attributes'][_0x57ca('0x4b')]?_0x184e49['attributes']:_0x21dfa8[_0x57ca('0x36')];if(!_0x491bde['query'][_0x57ca('0x3d')](_0x57ca('0x5c'))){_0x184e49['limit']=qs[_0x57ca('0x1f')](_0x491bde[_0x57ca('0x37')][_0x57ca('0x1f')]);_0x184e49[_0x57ca('0x21')]=qs[_0x57ca('0x21')](_0x491bde['query'][_0x57ca('0x21')]);}_0x184e49[_0x57ca('0x5d')]=qs[_0x57ca('0x3e')](_0x491bde[_0x57ca('0x37')][_0x57ca('0x3e')]);_0x184e49[_0x57ca('0x41')]=qs[_0x57ca('0x39')](_[_0x57ca('0x3f')](_0x491bde[_0x57ca('0x37')],_0x21dfa8[_0x57ca('0x39')]));_0x184e49[_0x57ca('0x41')][_0x57ca('0x5e')]=_0x1cb26b['id'];if(_0x491bde[_0x57ca('0x37')][_0x57ca('0x40')]){_0x184e49[_0x57ca('0x41')]=_['merge'](_0x184e49[_0x57ca('0x41')],{'$or':_[_0x57ca('0x31')](_0x184e49[_0x57ca('0x3b')],function(_0x50fdf2){var _0x25d6e0={};_0x25d6e0[_0x50fdf2]={'$like':'%'+_0x491bde[_0x57ca('0x37')][_0x57ca('0x40')]+'%'};return _0x25d6e0;})});}_0x184e49=_['merge']({},_0x184e49,_0x491bde[_0x57ca('0x4c')]);return db[_0x57ca('0x59')]['count']({'where':_0x184e49[_0x57ca('0x41')]})['then'](function(_0x2f6803){_0x939021[_0x57ca('0x20')]=_0x2f6803;if(_0x491bde[_0x57ca('0x37')][_0x57ca('0x45')]){_0x184e49[_0x57ca('0x46')]=[{'all':!![]}];}return db[_0x57ca('0x59')][_0x57ca('0x47')](_0x184e49);})['then'](function(_0x20b52d){_0x939021[_0x57ca('0x48')]=_0x20b52d;return _0x939021;});}})[_0x57ca('0x27')](respondWithFilteredResult(_0x19065d,_0x184e49))['catch'](handleError(_0x19065d,null));};exports[_0x57ca('0x5f')]=function(_0x2cf8b5,_0x1650e3,_0x40a143){return db[_0x57ca('0x44')]['find']({'where':{'id':_0x2cf8b5[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0x1650e3,null))[_0x57ca('0x27')](function(_0x35281f){if(_0x35281f){return _0x35281f[_0x57ca('0x5f')](_0x2cf8b5[_0x57ca('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x1650e3,null))[_0x57ca('0x56')](handleError(_0x1650e3,null));};exports[_0x57ca('0x60')]=function(_0x248382,_0x3728d7,_0x5202fb){return db[_0x57ca('0x44')]['find']({'where':{'id':_0x248382[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0x3728d7,null))['then'](function(_0x1746c2){if(_0x1746c2){var _0x646846=[];var _0x205448={'success':[],'errors':[]};return db[_0x57ca('0x61')][_0x57ca('0x57')]()['then'](function(_0x904b8a){if(_0x248382['body'][_0x57ca('0x62')]&&_[_0x57ca('0x63')](_0x248382[_0x57ca('0x4f')][_0x57ca('0x62')])){if(_0x248382[_0x57ca('0x4f')][_0x57ca('0x62')][_0x57ca('0x4b')]){_0x248382[_0x57ca('0x4f')]['tags']=_0x248382['body'][_0x57ca('0x62')][_0x57ca('0x64')](';')+';';}else{_0x248382[_0x57ca('0x4f')][_0x57ca('0x62')]=null;}}else{_0x248382[_0x57ca('0x4f')][_0x57ca('0x62')]=null;}if(_0x248382[_0x57ca('0x4f')]&&_[_0x57ca('0x63')](_0x248382[_0x57ca('0x4f')])){for(var _0x312997=0x0;_0x312997<_0x248382['body']['length'];_0x312997+=0x1){_0x248382[_0x57ca('0x4f')][_0x312997]['ListId']=_0x248382['params']['id'];_0x646846[_0x57ca('0x65')](_0x248382['body'][_0x312997]);}return BPromise['each'](_0x646846,function(_0x106783){return db[_0x57ca('0x61')][_0x57ca('0x4e')](_['omit'](_0x106783,[_0x57ca('0x66'),'id'])||{},{'fields':_[_0x57ca('0x38')](_0x904b8a),'raw':!![]})['then'](function(_0x4ae331){_0x205448[_0x57ca('0x67')]['push'](_0x4ae331[_0x57ca('0x68')]);})[_0x57ca('0x56')](function(_0x337f7f){_0x205448[_0x57ca('0x69')]['push']({'data':_0x106783,'error':_0x337f7f[_0x57ca('0x6a')]});});})[_0x57ca('0x27')](function(_0x54b299){return _0x205448;})[_0x57ca('0x56')](function(_0x4cc2e2){return _0x4cc2e2;});}else{_0x3728d7['status'](0x190)['json']({'message':_0x57ca('0x6b')});}});}})[_0x57ca('0x27')](respondWithResult(_0x3728d7,null))[_0x57ca('0x56')](handleError(_0x3728d7,null));};exports['getContacts']=function(_0x385ade,_0x5debd4,_0x19b08e){var _0x5f585d;return db['CmList']['find']({'where':{'id':_0x385ade['params']['id']},'include':[{'model':db[_0x57ca('0x6c')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x5debd4,null))[_0x57ca('0x27')](function(_0xefa03){if(_0xefa03){_0x5f585d=_0xefa03;return db[_0x57ca('0x61')][_0x57ca('0x32')];}})[_0x57ca('0x27')](function(_0x145039){if(_0x145039){var _0x4bcb90={};var _0x35cb37={};_0x35cb37['model']=_['concat'](_['keys'](_0x145039),_['map'](_0x5f585d['CustomFields'],function(_0x484203){return util[_0x57ca('0x6d')]('cf_%d',_0x484203['id']);}));_0x35cb37['query']=_[_0x57ca('0x38')](_0x385ade[_0x57ca('0x37')]);_0x35cb37[_0x57ca('0x39')]=_[_0x57ca('0x3a')](_0x35cb37[_0x57ca('0x36')],_0x35cb37[_0x57ca('0x37')]);_0x4bcb90['attributes']=_[_0x57ca('0x3a')](_0x35cb37[_0x57ca('0x36')],qs[_0x57ca('0x3c')](_0x385ade[_0x57ca('0x37')][_0x57ca('0x3c')]));_0x4bcb90[_0x57ca('0x3b')]=_0x4bcb90[_0x57ca('0x3b')][_0x57ca('0x4b')]?_0x4bcb90['attributes']:_0x35cb37['model'];if(!_0x385ade[_0x57ca('0x37')][_0x57ca('0x3d')](_0x57ca('0x5c'))){_0x4bcb90['limit']=qs['limit'](_0x385ade[_0x57ca('0x37')][_0x57ca('0x1f')]);_0x4bcb90['offset']=qs['offset'](_0x385ade[_0x57ca('0x37')][_0x57ca('0x21')]);}_0x4bcb90[_0x57ca('0x5d')]=qs[_0x57ca('0x3e')](_0x385ade[_0x57ca('0x37')][_0x57ca('0x3e')]);_0x4bcb90[_0x57ca('0x41')]=qs[_0x57ca('0x39')](_[_0x57ca('0x3f')](_0x385ade[_0x57ca('0x37')],_0x35cb37['filters']));_0x4bcb90['raw']=!![];if(_0x385ade[_0x57ca('0x37')][_0x57ca('0x40')]){_0x4bcb90[_0x57ca('0x41')]=_[_0x57ca('0x42')](_0x4bcb90[_0x57ca('0x41')],{'$or':_[_0x57ca('0x31')](_0x4bcb90[_0x57ca('0x3b')],function(_0x1ccf13){var _0x1743dc={};_0x1743dc[_0x1ccf13]={'$like':'%'+_0x385ade[_0x57ca('0x37')][_0x57ca('0x40')]+'%'};return _0x1743dc;})});}_0x4bcb90=_[_0x57ca('0x42')]({},_0x4bcb90,_0x385ade[_0x57ca('0x4c')]);return _0x5f585d['getContacts'](_0x4bcb90);}})[_0x57ca('0x27')](respondWithResult(_0x5debd4,null))[_0x57ca('0x56')](handleError(_0x5debd4,null));};exports[_0x57ca('0x6e')]=function(_0x12e77c,_0x108f91,_0x34390e){var _0x2b909d;return db[_0x57ca('0x44')]['find']({'where':{'id':_0x12e77c[_0x57ca('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x57ca('0x27')](handleEntityNotFound(_0x108f91,null))[_0x57ca('0x27')](function(_0x441b42){if(_0x441b42){_0x2b909d=_0x441b42;return db[_0x57ca('0x61')]['rawAttributes'];}})[_0x57ca('0x27')](function(_0x599363){if(_0x599363){var _0x602b83={};var _0x1171fb={};_0x1171fb[_0x57ca('0x36')]=_['concat'](_[_0x57ca('0x38')](_0x599363),_[_0x57ca('0x31')](_0x2b909d[_0x57ca('0x6f')],function(_0xc9b586){return util[_0x57ca('0x6d')]('cf_%d',_0xc9b586['id']);}));_0x1171fb[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0x12e77c[_0x57ca('0x37')]);_0x1171fb[_0x57ca('0x39')]=_[_0x57ca('0x3a')](_0x1171fb[_0x57ca('0x36')],_0x1171fb[_0x57ca('0x37')]);_0x602b83['attributes']=_[_0x57ca('0x3a')](_0x1171fb['model'],qs[_0x57ca('0x3c')](_0x12e77c[_0x57ca('0x37')][_0x57ca('0x3c')]));_0x602b83[_0x57ca('0x3b')]=_0x602b83[_0x57ca('0x3b')]['length']?_0x602b83[_0x57ca('0x3b')]:_0x1171fb[_0x57ca('0x36')];if(!_0x12e77c[_0x57ca('0x37')]['hasOwnProperty']('nolimit')){_0x602b83[_0x57ca('0x1f')]=qs[_0x57ca('0x1f')](_0x12e77c['query'][_0x57ca('0x1f')]);_0x602b83[_0x57ca('0x21')]=qs[_0x57ca('0x21')](_0x12e77c[_0x57ca('0x37')]['offset']);}_0x602b83['order']=qs[_0x57ca('0x3e')](_0x12e77c['query'][_0x57ca('0x3e')]);_0x602b83[_0x57ca('0x41')]=qs[_0x57ca('0x39')](_[_0x57ca('0x3f')](_0x12e77c[_0x57ca('0x37')],_0x1171fb[_0x57ca('0x39')]));_0x602b83[_0x57ca('0x70')]=!![];if(_0x12e77c[_0x57ca('0x37')]['filter']){_0x602b83[_0x57ca('0x41')]=_[_0x57ca('0x42')](_0x602b83[_0x57ca('0x41')],{'$or':_[_0x57ca('0x31')](_0x602b83['attributes'],function(_0x3c4038){var _0x5f3451={};_0x5f3451[_0x3c4038]={'$like':'%'+_0x12e77c[_0x57ca('0x37')][_0x57ca('0x40')]+'%'};return _0x5f3451;})});}_0x602b83=_['merge']({},_0x602b83,_0x12e77c['options']);return _0x2b909d[_0x57ca('0x71')](_0x602b83);}})['then'](function(_0x5c1bed){if(!_['isEmpty'](_0x5c1bed)){var _0x529c5d=toCsv(_0x5c1bed);var _0x2a4837=Date[_0x57ca('0x72')]();fs[_0x57ca('0x73')](util[_0x57ca('0x6d')](_0x57ca('0x74'),_0x2b909d['id'],_0x2a4837),_0x529c5d);_0x108f91['setHeader']('Content-disposition',_0x57ca('0x75')+util['format'](_0x57ca('0x76'),_0x2b909d['id'],_0x2a4837));_0x108f91['setHeader'](_0x57ca('0x77'),_0x57ca('0x78'));return _0x108f91[_0x57ca('0x79')](util[_0x57ca('0x6d')]('/tmp/list_%d_%s.csv',_0x2b909d['id'],_0x2a4837));}else{return _0x108f91[_0x57ca('0x1a')](0xcc);}})['catch'](handleError(_0x108f91,null));};exports[_0x57ca('0x7a')]=function(_0x290d06,_0x24442c,_0x4b528b){var _0x54ba9e;delete _0x290d06[_0x57ca('0x4f')]['id'];return db[_0x57ca('0x44')]['findOne']({'where':{'id':_0x290d06[_0x57ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24442c,null))[_0x57ca('0x27')](function(_0x5b8b97){if(_0x5b8b97){return db['sequelize']['transaction'](function(_0x109c3f){return db[_0x57ca('0x6c')][_0x57ca('0x4e')](_0x290d06['body'],{'transaction':_0x109c3f})[_0x57ca('0x27')](function(_0x27c7da){_0x54ba9e=_0x27c7da;return _0x5b8b97[_0x57ca('0x7b')](_0x27c7da,{'transaction':_0x109c3f});})[_0x57ca('0x27')](function(){var _0x4741de={'type':db[_0x57ca('0x7c')]['TEXT'],'transaction':_0x109c3f};switch(_0x290d06[_0x57ca('0x4f')][_0x57ca('0x34')]){case _0x57ca('0x7d'):_0x4741de['type']=db[_0x57ca('0x7c')][_0x57ca('0x7e')];break;case _0x57ca('0x7f'):_0x4741de[_0x57ca('0x34')]=db[_0x57ca('0x7c')][_0x57ca('0x80')];break;case _0x57ca('0x81'):_0x4741de[_0x57ca('0x34')]=db['Sequelize'][_0x57ca('0x82')];_0x4741de[_0x57ca('0x83')]=![];break;default:}return db[_0x57ca('0x84')][_0x57ca('0x85')]['addColumn'](_0x57ca('0x86'),util[_0x57ca('0x6d')]('cf_%s',_0x54ba9e['id']),_0x4741de);})['then'](function(){return _0x54ba9e;});});}})[_0x57ca('0x27')](respondWithResult(_0x24442c,null))[_0x57ca('0x56')](handleError(_0x24442c,null));};exports[_0x57ca('0x87')]=function(_0x3d69b9,_0x37c77c,_0x4f580f){var _0x6dd21a={};var _0x5a7031={};var _0x3e9591;var _0x2334e3;return db[_0x57ca('0x44')][_0x57ca('0x5b')]({'where':{'id':_0x3d69b9['params']['id']}})['then'](handleEntityNotFound(_0x37c77c,null))[_0x57ca('0x27')](function(_0x2437c1){if(_0x2437c1){_0x3e9591=_0x2437c1;_0x5a7031[_0x57ca('0x36')]=_[_0x57ca('0x38')](db[_0x57ca('0x6c')][_0x57ca('0x32')]);_0x5a7031[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0x3d69b9['query']);_0x5a7031[_0x57ca('0x39')]=_['intersection'](_0x5a7031[_0x57ca('0x36')],_0x5a7031[_0x57ca('0x37')]);_0x6dd21a[_0x57ca('0x3b')]=_[_0x57ca('0x3a')](_0x5a7031[_0x57ca('0x36')],qs['fields'](_0x3d69b9[_0x57ca('0x37')][_0x57ca('0x3c')]));_0x6dd21a['attributes']=_0x6dd21a[_0x57ca('0x3b')]['length']?_0x6dd21a[_0x57ca('0x3b')]:_0x5a7031[_0x57ca('0x36')];_0x6dd21a[_0x57ca('0x5d')]=qs['sort'](_0x3d69b9[_0x57ca('0x37')][_0x57ca('0x3e')]);_0x6dd21a[_0x57ca('0x41')]=qs[_0x57ca('0x39')](_['pick'](_0x3d69b9[_0x57ca('0x37')],_0x5a7031[_0x57ca('0x39')]));_0x6dd21a['where']=_[_0x57ca('0x42')](_0x6dd21a[_0x57ca('0x41')],{'$or':[{'ListId':_0x2437c1['id']},{'ListId':null}]});if(_0x3d69b9['query']['filter']){_0x6dd21a[_0x57ca('0x41')]=_['merge'](_0x6dd21a[_0x57ca('0x41')],{'$or':_[_0x57ca('0x31')](_0x6dd21a[_0x57ca('0x3b')],function(_0x428a62){var _0x32fda8={};_0x32fda8[_0x428a62]={'$like':'%'+_0x3d69b9['query'][_0x57ca('0x40')]+'%'};return _0x32fda8;})});}_0x6dd21a=_[_0x57ca('0x42')]({},_0x6dd21a,_0x3d69b9['options']);return db[_0x57ca('0x6c')]['findAndCountAll'](_0x6dd21a);}})[_0x57ca('0x27')](respondWithResult(_0x37c77c,null))[_0x57ca('0x56')](handleError(_0x37c77c,null));};exports[_0x57ca('0x88')]=function(_0x20f872,_0xaee823,_0x134a05){return db[_0x57ca('0x44')][_0x57ca('0x4d')]({'where':{'id':_0x20f872[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0xaee823,null))[_0x57ca('0x27')](function(_0x43e173){if(_0x43e173){return _0x43e173[_0x57ca('0x88')](_0x20f872[_0x57ca('0x4f')][_0x57ca('0x66')],_['omit'](_0x20f872[_0x57ca('0x4f')],[_0x57ca('0x66'),'id'])||{})[_0x57ca('0x89')](function(_0xb2dc6d){for(var _0x1f7a9b=0x0;_0x1f7a9b<_0x20f872['body'][_0x57ca('0x66')][_0x57ca('0x4b')];_0x1f7a9b+=0x1){socket[_0x57ca('0x8a')](_0x57ca('0x8b'),{'UserId':Number(_0x20f872[_0x57ca('0x4f')]['ids'][_0x1f7a9b]),'CmListId':Number(_0x20f872[_0x57ca('0x4a')]['id'])});}return _0xb2dc6d;});}})[_0x57ca('0x27')](respondWithResult(_0xaee823,null))[_0x57ca('0x56')](handleError(_0xaee823,null));};exports[_0x57ca('0x8c')]=function(_0x206eeb,_0x155f9a,_0x18cebb){return db[_0x57ca('0x44')][_0x57ca('0x4d')]({'where':{'id':_0x206eeb[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0x155f9a,null))[_0x57ca('0x27')](function(_0x4644af){if(_0x4644af){return _0x4644af['removeAgents'](_0x206eeb['query'][_0x57ca('0x66')])[_0x57ca('0x27')](function(){if(_[_0x57ca('0x63')](_0x206eeb[_0x57ca('0x37')][_0x57ca('0x66')])){for(var _0x38573c=0x0;_0x38573c<_0x206eeb[_0x57ca('0x37')][_0x57ca('0x66')][_0x57ca('0x4b')];_0x38573c+=0x1){socket[_0x57ca('0x8a')](_0x57ca('0x8d'),{'UserId':Number(_0x206eeb[_0x57ca('0x37')][_0x57ca('0x66')][_0x38573c]),'CmListId':Number(_0x206eeb[_0x57ca('0x4a')]['id'])});}}else{socket[_0x57ca('0x8a')]('userCmList:remove',{'UserId':Number(_0x206eeb['query'][_0x57ca('0x66')]),'CmListId':Number(_0x206eeb[_0x57ca('0x4a')]['id'])});}});}})[_0x57ca('0x27')](respondWithStatusCode(_0x155f9a,null))['catch'](handleError(_0x155f9a,null));};exports[_0x57ca('0x8e')]=function(_0x21298c,_0x354df9,_0x2eaed3){var _0x55066e={};var _0x31f4e2={};var _0x276ee0;var _0x35f68f;return db[_0x57ca('0x44')]['findOne']({'where':{'id':_0x21298c[_0x57ca('0x4a')]['id']}})[_0x57ca('0x27')](handleEntityNotFound(_0x354df9,null))[_0x57ca('0x27')](function(_0x34beb2){if(_0x34beb2){_0x276ee0=_0x34beb2;_0x31f4e2[_0x57ca('0x36')]=_[_0x57ca('0x38')](db[_0x57ca('0x8f')][_0x57ca('0x32')]);_0x31f4e2[_0x57ca('0x37')]=_[_0x57ca('0x38')](_0x21298c['query']);_0x31f4e2[_0x57ca('0x39')]=_['intersection'](_0x31f4e2['model'],_0x31f4e2[_0x57ca('0x37')]);_0x55066e[_0x57ca('0x3b')]=_[_0x57ca('0x3a')](_0x31f4e2[_0x57ca('0x36')],qs[_0x57ca('0x3c')](_0x21298c[_0x57ca('0x37')]['fields']));_0x55066e[_0x57ca('0x3b')]=_0x55066e[_0x57ca('0x3b')]['length']?_0x55066e[_0x57ca('0x3b')]:_0x31f4e2[_0x57ca('0x36')];_0x55066e[_0x57ca('0x5d')]=qs[_0x57ca('0x3e')](_0x21298c[_0x57ca('0x37')]['sort']);_0x55066e[_0x57ca('0x41')]=qs[_0x57ca('0x39')](_[_0x57ca('0x3f')](_0x21298c['query'],_0x31f4e2[_0x57ca('0x39')]));if(_0x21298c[_0x57ca('0x37')][_0x57ca('0x40')]){_0x55066e[_0x57ca('0x41')]=_[_0x57ca('0x42')](_0x55066e[_0x57ca('0x41')],{'$or':_[_0x57ca('0x31')](_0x55066e[_0x57ca('0x3b')],function(_0x437ff4){var _0x4337b5={};_0x4337b5[_0x437ff4]={'$like':'%'+_0x21298c[_0x57ca('0x37')]['filter']+'%'};return _0x4337b5;})});}_0x55066e=_[_0x57ca('0x42')]({},_0x55066e,_0x21298c[_0x57ca('0x4c')]);return _0x276ee0[_0x57ca('0x8e')](_0x55066e);}})[_0x57ca('0x27')](function(_0x10fc68){if(_0x10fc68){_0x35f68f=_0x10fc68[_0x57ca('0x4b')];if(!_0x21298c[_0x57ca('0x37')][_0x57ca('0x3d')](_0x57ca('0x5c'))){_0x55066e[_0x57ca('0x1f')]=qs[_0x57ca('0x1f')](_0x21298c[_0x57ca('0x37')][_0x57ca('0x1f')]);_0x55066e['offset']=qs[_0x57ca('0x21')](_0x21298c['query'][_0x57ca('0x21')]);}return _0x276ee0[_0x57ca('0x8e')](_0x55066e);}})['then'](function(_0x5ad1e1){if(_0x5ad1e1){return _0x5ad1e1?{'count':_0x35f68f,'rows':_0x5ad1e1}:null;}})[_0x57ca('0x27')](respondWithResult(_0x354df9,null))[_0x57ca('0x56')](handleError(_0x354df9,null));}; \ No newline at end of file +var _0xe763=['include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addContacts','CmContact','tags','isArray','push','each','omit','ids','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmList'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe763,0xce));var _0x3e76=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0xe763[_0x4b33d1];return _0x9e7221;};'use strict';var emlformat=require(_0x3e76('0x0'));var rimraf=require(_0x3e76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e76('0x2'));var rp=require(_0x3e76('0x3'));var moment=require(_0x3e76('0x4'));var BPromise=require(_0x3e76('0x5'));var Mustache=require(_0x3e76('0x6'));var util=require(_0x3e76('0x7'));var path=require('path');var sox=require(_0x3e76('0x8'));var csv=require('to-csv');var ejs=require(_0x3e76('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e76('0xa'));var squel=require(_0x3e76('0xb'));var crypto=require(_0x3e76('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e76('0xd'));var toCsv=require(_0x3e76('0xe'));var querystring=require('querystring');var Papa=require(_0x3e76('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e76('0x10'));var as=require(_0x3e76('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e76('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e76('0x13'));var db=require('../../mysqldb')['db'];config[_0x3e76('0x14')]=_['defaults'](config[_0x3e76('0x14')],{'host':_0x3e76('0x15'),'port':0x18eb});var socket=require(_0x3e76('0x16'))(new Redis(config[_0x3e76('0x14')]));require(_0x3e76('0x17'))[_0x3e76('0x18')](socket);function respondWithStatusCode(_0x3560d2,_0x5e4e80){_0x5e4e80=_0x5e4e80||0xcc;return function(_0x15df86){if(_0x15df86){return _0x3560d2[_0x3e76('0x19')](_0x5e4e80);}return _0x3560d2[_0x3e76('0x1a')](_0x5e4e80)[_0x3e76('0x1b')]();};}function respondWithResult(_0xd15191,_0x2f14dd){_0x2f14dd=_0x2f14dd||0xc8;return function(_0x344917){if(_0x344917){return _0xd15191[_0x3e76('0x1a')](_0x2f14dd)['json'](_0x344917);}};}function respondWithFilteredResult(_0x5eab78,_0x257111){return function(_0x2d10a7){if(_0x2d10a7){var _0x594a5c=typeof _0x257111[_0x3e76('0x1c')]===_0x3e76('0x1d')&&typeof _0x257111[_0x3e76('0x1e')]===_0x3e76('0x1d');var _0x30ee12=_0x2d10a7[_0x3e76('0x1f')];var _0x24c885=_0x594a5c?0x0:_0x257111[_0x3e76('0x1c')];var _0x5327cd=_0x594a5c?_0x2d10a7['count']:_0x257111[_0x3e76('0x1c')]+_0x257111['limit'];var _0x1d48c8;if(_0x5327cd>=_0x30ee12){_0x5327cd=_0x30ee12;_0x1d48c8=0xc8;}else{_0x1d48c8=0xce;}_0x5eab78[_0x3e76('0x1a')](_0x1d48c8);return _0x5eab78[_0x3e76('0x20')]('Content-Range',_0x24c885+'-'+_0x5327cd+'/'+_0x30ee12)[_0x3e76('0x21')](_0x2d10a7);}return null;};}function patchUpdates(_0x254fb0){return function(_0x1b5f14){try{jsonpatch[_0x3e76('0x22')](_0x1b5f14,_0x254fb0,!![]);}catch(_0x41b1c1){return BPromise[_0x3e76('0x23')](_0x41b1c1);}return _0x1b5f14[_0x3e76('0x24')]();};}function saveUpdates(_0x3e7b5b,_0x318ed0){return function(_0x472981){if(_0x472981){return _0x472981[_0x3e76('0x25')](_0x3e7b5b)['then'](function(_0x325199){return _0x325199;});}return null;};}function removeEntity(_0x599c36,_0x1b4a73){return function(_0x2dbd9e){if(_0x2dbd9e){return _0x2dbd9e[_0x3e76('0x26')]()[_0x3e76('0x27')](function(){var _0x15b918=_0x2dbd9e[_0x3e76('0x28')]({'plain':!![]});var _0x4f0b7b=_0x3e76('0x29');return db[_0x3e76('0x2a')][_0x3e76('0x26')]({'where':{'type':_0x4f0b7b,'resourceId':_0x15b918['id']}})['then'](function(){return _0x2dbd9e;});})[_0x3e76('0x27')](function(){_0x599c36[_0x3e76('0x1a')](0xcc)[_0x3e76('0x1b')]();});}};}function handleEntityNotFound(_0x2cc8b2,_0x13e638){return function(_0x307544){if(!_0x307544){_0x2cc8b2[_0x3e76('0x19')](0x194);}return _0x307544;};}function handleError(_0x5a160c,_0x4a253d){_0x4a253d=_0x4a253d||0x1f4;return function(_0x190c3f){logger[_0x3e76('0x2b')](_0x190c3f[_0x3e76('0x2c')]);if(_0x190c3f[_0x3e76('0x2d')]){delete _0x190c3f[_0x3e76('0x2d')];}_0x5a160c[_0x3e76('0x1a')](_0x4a253d)['send'](_0x190c3f);};}exports[_0x3e76('0x2e')]=function(_0x4e6dd2,_0x5abeca){var _0x11638c={},_0x556c16={},_0xf866f1={'count':0x0,'rows':[]};var _0x382020=_[_0x3e76('0x2f')](db['CmList'][_0x3e76('0x30')],function(_0x1faa63){return{'name':_0x1faa63[_0x3e76('0x31')],'type':_0x1faa63[_0x3e76('0x32')][_0x3e76('0x33')]};});_0x556c16['model']=_['map'](_0x382020,'name');_0x556c16[_0x3e76('0x34')]=_[_0x3e76('0x35')](_0x4e6dd2['query']);_0x556c16['filters']=_['intersection'](_0x556c16['model'],_0x556c16['query']);_0x11638c[_0x3e76('0x36')]=_[_0x3e76('0x37')](_0x556c16[_0x3e76('0x38')],qs['fields'](_0x4e6dd2['query'][_0x3e76('0x39')]));_0x11638c['attributes']=_0x11638c['attributes'][_0x3e76('0x3a')]?_0x11638c[_0x3e76('0x36')]:_0x556c16[_0x3e76('0x38')];if(!_0x4e6dd2[_0x3e76('0x34')]['hasOwnProperty'](_0x3e76('0x3b'))){_0x11638c[_0x3e76('0x1e')]=qs[_0x3e76('0x1e')](_0x4e6dd2[_0x3e76('0x34')]['limit']);_0x11638c[_0x3e76('0x1c')]=qs[_0x3e76('0x1c')](_0x4e6dd2['query'][_0x3e76('0x1c')]);}_0x11638c[_0x3e76('0x3c')]=qs[_0x3e76('0x3d')](_0x4e6dd2['query'][_0x3e76('0x3d')]);_0x11638c[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_[_0x3e76('0x40')](_0x4e6dd2[_0x3e76('0x34')],_0x556c16[_0x3e76('0x3f')]),_0x382020);if(_0x4e6dd2[_0x3e76('0x34')][_0x3e76('0x41')]){_0x11638c[_0x3e76('0x3e')]=_[_0x3e76('0x42')](_0x11638c[_0x3e76('0x3e')],{'$or':_[_0x3e76('0x2f')](_0x382020,function(_0x41644a){if(_0x41644a[_0x3e76('0x32')]!==_0x3e76('0x43')){var _0x376c21={};_0x376c21[_0x41644a[_0x3e76('0x2d')]]={'$like':'%'+_0x4e6dd2[_0x3e76('0x34')][_0x3e76('0x41')]+'%'};return _0x376c21;}})});}_0x11638c=_[_0x3e76('0x42')]({},_0x11638c,_0x4e6dd2[_0x3e76('0x44')]);var _0x18c7be={'where':_0x11638c[_0x3e76('0x3e')]};return db[_0x3e76('0x45')][_0x3e76('0x1f')](_0x18c7be)[_0x3e76('0x27')](function(_0x58b41f){_0xf866f1[_0x3e76('0x1f')]=_0x58b41f;if(_0x4e6dd2['query']['includeAll']){_0x11638c[_0x3e76('0x46')]=[{'all':!![]}];}return db['CmList'][_0x3e76('0x47')](_0x11638c);})[_0x3e76('0x27')](function(_0x56e063){_0xf866f1[_0x3e76('0x48')]=_0x56e063;return _0xf866f1;})[_0x3e76('0x27')](respondWithFilteredResult(_0x5abeca,_0x11638c))[_0x3e76('0x49')](handleError(_0x5abeca,null));};exports[_0x3e76('0x4a')]=function(_0xdb417a,_0x828561){var _0x3513d9={'raw':![],'where':{'id':_0xdb417a[_0x3e76('0x4b')]['id']}},_0x5b6732={};_0x5b6732['model']=_[_0x3e76('0x35')](db[_0x3e76('0x45')]['rawAttributes']);_0x5b6732[_0x3e76('0x34')]=_['keys'](_0xdb417a[_0x3e76('0x34')]);_0x5b6732[_0x3e76('0x3f')]=_[_0x3e76('0x37')](_0x5b6732[_0x3e76('0x38')],_0x5b6732['query']);_0x3513d9[_0x3e76('0x36')]=_['intersection'](_0x5b6732[_0x3e76('0x38')],qs['fields'](_0xdb417a[_0x3e76('0x34')]['fields']));_0x3513d9[_0x3e76('0x36')]=_0x3513d9['attributes']['length']?_0x3513d9[_0x3e76('0x36')]:_0x5b6732[_0x3e76('0x38')];if(_0xdb417a['query'][_0x3e76('0x4c')]){_0x3513d9[_0x3e76('0x46')]=[{'all':!![]}];}_0x3513d9=_[_0x3e76('0x42')]({},_0x3513d9,_0xdb417a[_0x3e76('0x44')]);return db['CmList'][_0x3e76('0x4d')](_0x3513d9)['then'](handleEntityNotFound(_0x828561,null))['then'](respondWithResult(_0x828561,null))[_0x3e76('0x49')](handleError(_0x828561,null));};exports['create']=function(_0x3c7fd3,_0x410b74){return db[_0x3e76('0x45')][_0x3e76('0x4e')](_0x3c7fd3[_0x3e76('0x4f')],{})[_0x3e76('0x27')](function(_0x1f286c){var _0x4e7479=_0x3c7fd3['user']['get']({'plain':!![]});if(!_0x4e7479)throw new Error(_0x3e76('0x50'));if(_0x4e7479[_0x3e76('0x51')]===_0x3e76('0x52')){var _0x3434f5=_0x1f286c['get']({'plain':!![]});var _0x149b2a=_0x3e76('0x29');return db[_0x3e76('0x53')]['find']({'where':{'name':_0x149b2a,'userProfileId':_0x4e7479[_0x3e76('0x54')]},'raw':!![]})['then'](function(_0x339d21){if(_0x339d21&&_0x339d21['autoAssociation']===0x0){return db[_0x3e76('0x2a')]['create']({'name':_0x3434f5[_0x3e76('0x2d')],'resourceId':_0x3434f5['id'],'type':_0x339d21[_0x3e76('0x2d')],'sectionId':_0x339d21['id']},{})['then'](function(){return _0x1f286c;});}else{return _0x1f286c;}})[_0x3e76('0x49')](function(_0x52272c){logger['error'](_0x3e76('0x55'),_0x52272c);throw _0x52272c;});}return _0x1f286c;})[_0x3e76('0x27')](respondWithResult(_0x410b74,0xc9))[_0x3e76('0x49')](handleError(_0x410b74,null));};exports['update']=function(_0x3ee160,_0x57f180){if(_0x3ee160[_0x3e76('0x4f')]['id']){delete _0x3ee160[_0x3e76('0x4f')]['id'];}return db[_0x3e76('0x45')][_0x3e76('0x4d')]({'where':{'id':_0x3ee160[_0x3e76('0x4b')]['id']}})[_0x3e76('0x27')](handleEntityNotFound(_0x57f180,null))[_0x3e76('0x27')](saveUpdates(_0x3ee160[_0x3e76('0x4f')],null))[_0x3e76('0x27')](respondWithResult(_0x57f180,null))[_0x3e76('0x49')](handleError(_0x57f180,null));};exports[_0x3e76('0x26')]=function(_0x16a4ed,_0x412654){return db['CmList'][_0x3e76('0x4d')]({'where':{'id':_0x16a4ed[_0x3e76('0x4b')]['id']}})[_0x3e76('0x27')](handleEntityNotFound(_0x412654,null))[_0x3e76('0x27')](removeEntity(_0x412654,null))[_0x3e76('0x49')](handleError(_0x412654,null));};exports['describe']=function(_0x6eaefa,_0x392216){return db[_0x3e76('0x45')][_0x3e76('0x56')]()['then'](respondWithResult(_0x392216,null))[_0x3e76('0x49')](handleError(_0x392216,null));};exports[_0x3e76('0x57')]=function(_0x4b665d,_0xb8d07b,_0x4996a8){if(_0x4b665d['body']['id']){delete _0x4b665d['body']['id'];}return db[_0x3e76('0x45')][_0x3e76('0x4d')]({'where':{'id':_0x4b665d[_0x3e76('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb8d07b,null))['then'](function(_0x49667d){if(_0x49667d){_0x4b665d[_0x3e76('0x4f')][_0x3e76('0x58')]=_0x49667d['id'];return db[_0x3e76('0x59')][_0x3e76('0x4e')](_0x4b665d['body']);}})[_0x3e76('0x27')](respondWithResult(_0xb8d07b,null))[_0x3e76('0x49')](handleError(_0xb8d07b,null));};exports[_0x3e76('0x5a')]=function(_0x4cf511,_0xcb6954,_0xb819b6){var _0x292a79={'raw':![],'where':{}};var _0x418796={};var _0x5d0dbd={'count':0x0,'rows':[]};return db[_0x3e76('0x45')][_0x3e76('0x5b')]({'where':{'id':_0x4cf511['params']['id']}})['then'](handleEntityNotFound(_0xcb6954,null))[_0x3e76('0x27')](function(_0x39b538){if(_0x39b538){_0x418796[_0x3e76('0x38')]=_[_0x3e76('0x35')](db[_0x3e76('0x59')][_0x3e76('0x30')]);_0x418796[_0x3e76('0x34')]=_['keys'](_0x4cf511['query']);_0x418796[_0x3e76('0x3f')]=_[_0x3e76('0x37')](_0x418796[_0x3e76('0x38')],_0x418796[_0x3e76('0x34')]);_0x292a79[_0x3e76('0x36')]=_[_0x3e76('0x37')](_0x418796['model'],qs[_0x3e76('0x39')](_0x4cf511[_0x3e76('0x34')][_0x3e76('0x39')]));_0x292a79[_0x3e76('0x36')]=_0x292a79[_0x3e76('0x36')][_0x3e76('0x3a')]?_0x292a79[_0x3e76('0x36')]:_0x418796[_0x3e76('0x38')];if(!_0x4cf511[_0x3e76('0x34')][_0x3e76('0x5c')](_0x3e76('0x3b'))){_0x292a79[_0x3e76('0x1e')]=qs[_0x3e76('0x1e')](_0x4cf511[_0x3e76('0x34')][_0x3e76('0x1e')]);_0x292a79['offset']=qs['offset'](_0x4cf511[_0x3e76('0x34')][_0x3e76('0x1c')]);}_0x292a79[_0x3e76('0x3c')]=qs[_0x3e76('0x3d')](_0x4cf511['query'][_0x3e76('0x3d')]);_0x292a79[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_['pick'](_0x4cf511[_0x3e76('0x34')],_0x418796[_0x3e76('0x3f')]));_0x292a79[_0x3e76('0x3e')][_0x3e76('0x58')]=_0x39b538['id'];if(_0x4cf511[_0x3e76('0x34')]['filter']){_0x292a79[_0x3e76('0x3e')]=_[_0x3e76('0x42')](_0x292a79[_0x3e76('0x3e')],{'$or':_[_0x3e76('0x2f')](_0x292a79[_0x3e76('0x36')],function(_0x51ffbd){var _0x55c124={};_0x55c124[_0x51ffbd]={'$like':'%'+_0x4cf511[_0x3e76('0x34')][_0x3e76('0x41')]+'%'};return _0x55c124;})});}_0x292a79=_['merge']({},_0x292a79,_0x4cf511[_0x3e76('0x44')]);return db[_0x3e76('0x59')][_0x3e76('0x1f')]({'where':_0x292a79['where']})[_0x3e76('0x27')](function(_0x3c3661){_0x5d0dbd['count']=_0x3c3661;if(_0x4cf511[_0x3e76('0x34')][_0x3e76('0x4c')]){_0x292a79[_0x3e76('0x46')]=[{'all':!![]}];}return db[_0x3e76('0x59')][_0x3e76('0x47')](_0x292a79);})[_0x3e76('0x27')](function(_0x1c9b80){_0x5d0dbd[_0x3e76('0x48')]=_0x1c9b80;return _0x5d0dbd;});}})['then'](respondWithFilteredResult(_0xcb6954,_0x292a79))[_0x3e76('0x49')](handleError(_0xcb6954,null));};exports[_0x3e76('0x5d')]=function(_0xf1abd5,_0x436db5,_0x27385e){return db[_0x3e76('0x45')][_0x3e76('0x4d')]({'where':{'id':_0xf1abd5[_0x3e76('0x4b')]['id']}})[_0x3e76('0x27')](handleEntityNotFound(_0x436db5,null))['then'](function(_0x35d34f){if(_0x35d34f){return _0x35d34f[_0x3e76('0x5d')](_0xf1abd5['query']['ids']);}})[_0x3e76('0x27')](respondWithStatusCode(_0x436db5,null))[_0x3e76('0x49')](handleError(_0x436db5,null));};exports[_0x3e76('0x5e')]=function(_0x106dc8,_0x509f2e,_0x43ea66){return db[_0x3e76('0x45')][_0x3e76('0x4d')]({'where':{'id':_0x106dc8[_0x3e76('0x4b')]['id']}})[_0x3e76('0x27')](handleEntityNotFound(_0x509f2e,null))[_0x3e76('0x27')](function(_0x142683){if(_0x142683){var _0x2da1e5=[];var _0x45c293={'success':[],'errors':[]};return db[_0x3e76('0x5f')][_0x3e76('0x56')]()[_0x3e76('0x27')](function(_0x2ea235){if(_0x106dc8[_0x3e76('0x4f')][_0x3e76('0x60')]&&_[_0x3e76('0x61')](_0x106dc8[_0x3e76('0x4f')][_0x3e76('0x60')])){if(_0x106dc8['body'][_0x3e76('0x60')][_0x3e76('0x3a')]){_0x106dc8[_0x3e76('0x4f')]['tags']=_0x106dc8['body'][_0x3e76('0x60')]['join'](';')+';';}else{_0x106dc8[_0x3e76('0x4f')]['tags']=null;}}else{_0x106dc8[_0x3e76('0x4f')][_0x3e76('0x60')]=null;}if(_0x106dc8['body']&&_['isArray'](_0x106dc8['body'])){for(var _0x21f8fe=0x0;_0x21f8fe<_0x106dc8[_0x3e76('0x4f')][_0x3e76('0x3a')];_0x21f8fe+=0x1){_0x106dc8[_0x3e76('0x4f')][_0x21f8fe][_0x3e76('0x58')]=_0x106dc8['params']['id'];_0x2da1e5[_0x3e76('0x62')](_0x106dc8[_0x3e76('0x4f')][_0x21f8fe]);}return BPromise[_0x3e76('0x63')](_0x2da1e5,function(_0x39fe70){return db[_0x3e76('0x5f')][_0x3e76('0x4e')](_[_0x3e76('0x64')](_0x39fe70,[_0x3e76('0x65'),'id'])||{},{'fields':_[_0x3e76('0x35')](_0x2ea235),'raw':!![]})[_0x3e76('0x27')](function(_0x1c303e){_0x45c293['success'][_0x3e76('0x62')](_0x1c303e[_0x3e76('0x66')]);})['catch'](function(_0x3d8fce){_0x45c293[_0x3e76('0x67')][_0x3e76('0x62')]({'data':_0x39fe70,'error':_0x3d8fce['message']});});})[_0x3e76('0x27')](function(_0x323794){return _0x45c293;})[_0x3e76('0x49')](function(_0x29f551){return _0x29f551;});}else{_0x509f2e[_0x3e76('0x1a')](0x190)['json']({'message':_0x3e76('0x68')});}});}})['then'](respondWithResult(_0x509f2e,null))[_0x3e76('0x49')](handleError(_0x509f2e,null));};exports[_0x3e76('0x69')]=function(_0x278b5b,_0x2cd8a0,_0x46c446){var _0x4fffe8;return db[_0x3e76('0x45')]['find']({'where':{'id':_0x278b5b[_0x3e76('0x4b')]['id']},'include':[{'model':db[_0x3e76('0x6a')],'as':_0x3e76('0x6b')}]})[_0x3e76('0x27')](handleEntityNotFound(_0x2cd8a0,null))['then'](function(_0x2a853d){if(_0x2a853d){_0x4fffe8=_0x2a853d;return db[_0x3e76('0x5f')]['rawAttributes'];}})['then'](function(_0x57bd0e){if(_0x57bd0e){var _0x3f2a8f={};var _0x1b608={};_0x1b608[_0x3e76('0x38')]=_[_0x3e76('0x6c')](_[_0x3e76('0x35')](_0x57bd0e),_['map'](_0x4fffe8['CustomFields'],function(_0x3c6c58){return util[_0x3e76('0x6d')](_0x3e76('0x6e'),_0x3c6c58['id']);}));_0x1b608[_0x3e76('0x34')]=_[_0x3e76('0x35')](_0x278b5b[_0x3e76('0x34')]);_0x1b608[_0x3e76('0x3f')]=_[_0x3e76('0x37')](_0x1b608['model'],_0x1b608[_0x3e76('0x34')]);_0x3f2a8f['attributes']=_[_0x3e76('0x37')](_0x1b608['model'],qs[_0x3e76('0x39')](_0x278b5b[_0x3e76('0x34')]['fields']));_0x3f2a8f[_0x3e76('0x36')]=_0x3f2a8f[_0x3e76('0x36')][_0x3e76('0x3a')]?_0x3f2a8f['attributes']:_0x1b608[_0x3e76('0x38')];if(!_0x278b5b['query'][_0x3e76('0x5c')]('nolimit')){_0x3f2a8f[_0x3e76('0x1e')]=qs[_0x3e76('0x1e')](_0x278b5b['query'][_0x3e76('0x1e')]);_0x3f2a8f[_0x3e76('0x1c')]=qs['offset'](_0x278b5b[_0x3e76('0x34')]['offset']);}_0x3f2a8f[_0x3e76('0x3c')]=qs['sort'](_0x278b5b[_0x3e76('0x34')][_0x3e76('0x3d')]);_0x3f2a8f[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_[_0x3e76('0x40')](_0x278b5b[_0x3e76('0x34')],_0x1b608['filters']));_0x3f2a8f[_0x3e76('0x6f')]=!![];if(_0x278b5b[_0x3e76('0x34')][_0x3e76('0x41')]){_0x3f2a8f[_0x3e76('0x3e')]=_['merge'](_0x3f2a8f['where'],{'$or':_[_0x3e76('0x2f')](_0x3f2a8f[_0x3e76('0x36')],function(_0x5116c4){var _0x4b47d3={};_0x4b47d3[_0x5116c4]={'$like':'%'+_0x278b5b[_0x3e76('0x34')][_0x3e76('0x41')]+'%'};return _0x4b47d3;})});}_0x3f2a8f=_[_0x3e76('0x42')]({},_0x3f2a8f,_0x278b5b[_0x3e76('0x44')]);return _0x4fffe8['getContacts'](_0x3f2a8f);}})[_0x3e76('0x27')](respondWithResult(_0x2cd8a0,null))[_0x3e76('0x49')](handleError(_0x2cd8a0,null));};exports[_0x3e76('0x70')]=function(_0x49e5e5,_0x325ddc,_0xdf2814){var _0x3b51a7;return db['CmList'][_0x3e76('0x4d')]({'where':{'id':_0x49e5e5[_0x3e76('0x4b')]['id']},'include':[{'model':db[_0x3e76('0x6a')],'as':_0x3e76('0x6b')}]})['then'](handleEntityNotFound(_0x325ddc,null))[_0x3e76('0x27')](function(_0x33f96f){if(_0x33f96f){_0x3b51a7=_0x33f96f;return db[_0x3e76('0x5f')][_0x3e76('0x30')];}})[_0x3e76('0x27')](function(_0x222958){if(_0x222958){var _0x107d94={};var _0x39192a={};_0x39192a['model']=_[_0x3e76('0x6c')](_[_0x3e76('0x35')](_0x222958),_['map'](_0x3b51a7[_0x3e76('0x6b')],function(_0x462f2e){return util['format'](_0x3e76('0x6e'),_0x462f2e['id']);}));_0x39192a[_0x3e76('0x34')]=_[_0x3e76('0x35')](_0x49e5e5[_0x3e76('0x34')]);_0x39192a[_0x3e76('0x3f')]=_['intersection'](_0x39192a[_0x3e76('0x38')],_0x39192a[_0x3e76('0x34')]);_0x107d94[_0x3e76('0x36')]=_[_0x3e76('0x37')](_0x39192a[_0x3e76('0x38')],qs[_0x3e76('0x39')](_0x49e5e5[_0x3e76('0x34')][_0x3e76('0x39')]));_0x107d94['attributes']=_0x107d94['attributes'][_0x3e76('0x3a')]?_0x107d94['attributes']:_0x39192a[_0x3e76('0x38')];if(!_0x49e5e5['query'][_0x3e76('0x5c')](_0x3e76('0x3b'))){_0x107d94[_0x3e76('0x1e')]=qs['limit'](_0x49e5e5[_0x3e76('0x34')]['limit']);_0x107d94['offset']=qs[_0x3e76('0x1c')](_0x49e5e5[_0x3e76('0x34')][_0x3e76('0x1c')]);}_0x107d94['order']=qs[_0x3e76('0x3d')](_0x49e5e5[_0x3e76('0x34')][_0x3e76('0x3d')]);_0x107d94[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_[_0x3e76('0x40')](_0x49e5e5[_0x3e76('0x34')],_0x39192a[_0x3e76('0x3f')]));_0x107d94[_0x3e76('0x6f')]=!![];if(_0x49e5e5[_0x3e76('0x34')][_0x3e76('0x41')]){_0x107d94[_0x3e76('0x3e')]=_['merge'](_0x107d94[_0x3e76('0x3e')],{'$or':_[_0x3e76('0x2f')](_0x107d94[_0x3e76('0x36')],function(_0x4c0133){var _0x54248d={};_0x54248d[_0x4c0133]={'$like':'%'+_0x49e5e5[_0x3e76('0x34')]['filter']+'%'};return _0x54248d;})});}_0x107d94=_[_0x3e76('0x42')]({},_0x107d94,_0x49e5e5['options']);return _0x3b51a7[_0x3e76('0x69')](_0x107d94);}})[_0x3e76('0x27')](function(_0x1352a2){if(!_['isEmpty'](_0x1352a2)){var _0x44da62=toCsv(_0x1352a2);var _0x429178=Date[_0x3e76('0x71')]();fs['writeFileSync'](util[_0x3e76('0x6d')](_0x3e76('0x72'),_0x3b51a7['id'],_0x429178),_0x44da62);_0x325ddc[_0x3e76('0x73')](_0x3e76('0x74'),_0x3e76('0x75')+util[_0x3e76('0x6d')](_0x3e76('0x76'),_0x3b51a7['id'],_0x429178));_0x325ddc[_0x3e76('0x73')](_0x3e76('0x77'),'text/csv');return _0x325ddc['download'](util['format'](_0x3e76('0x72'),_0x3b51a7['id'],_0x429178));}else{return _0x325ddc[_0x3e76('0x19')](0xcc);}})[_0x3e76('0x49')](handleError(_0x325ddc,null));};exports['addCustomField']=function(_0x4201df,_0x5668f1,_0x594511){var _0x3cdd3b;delete _0x4201df[_0x3e76('0x4f')]['id'];return db[_0x3e76('0x45')]['findOne']({'where':{'id':_0x4201df[_0x3e76('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5668f1,null))[_0x3e76('0x27')](function(_0x3287ed){if(_0x3287ed){return db['sequelize']['transaction'](function(_0x1ca43e){return db[_0x3e76('0x6a')][_0x3e76('0x4e')](_0x4201df['body'],{'transaction':_0x1ca43e})[_0x3e76('0x27')](function(_0x3561f5){_0x3cdd3b=_0x3561f5;return _0x3287ed[_0x3e76('0x78')](_0x3561f5,{'transaction':_0x1ca43e});})[_0x3e76('0x27')](function(){var _0x3bd934={'type':db[_0x3e76('0x79')][_0x3e76('0x7a')],'transaction':_0x1ca43e};switch(_0x4201df[_0x3e76('0x4f')][_0x3e76('0x32')]){case _0x3e76('0x7b'):_0x3bd934[_0x3e76('0x32')]=db[_0x3e76('0x79')][_0x3e76('0x7a')];break;case _0x3e76('0x7c'):_0x3bd934['type']=db['Sequelize'][_0x3e76('0x7d')];break;case _0x3e76('0x7e'):_0x3bd934[_0x3e76('0x32')]=db[_0x3e76('0x79')][_0x3e76('0x7f')];_0x3bd934[_0x3e76('0x80')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x3e76('0x81'),util[_0x3e76('0x6d')](_0x3e76('0x82'),_0x3cdd3b['id']),_0x3bd934);})[_0x3e76('0x27')](function(){return _0x3cdd3b;});});}})[_0x3e76('0x27')](respondWithResult(_0x5668f1,null))['catch'](handleError(_0x5668f1,null));};exports['getCustomFields']=function(_0x8b2271,_0x3aca14,_0x2bdba6){var _0x4818af={};var _0x8a6f5={};var _0x21cade;var _0x147587;return db[_0x3e76('0x45')][_0x3e76('0x5b')]({'where':{'id':_0x8b2271[_0x3e76('0x4b')]['id']}})[_0x3e76('0x27')](handleEntityNotFound(_0x3aca14,null))[_0x3e76('0x27')](function(_0x4133e8){if(_0x4133e8){_0x21cade=_0x4133e8;_0x8a6f5[_0x3e76('0x38')]=_[_0x3e76('0x35')](db[_0x3e76('0x6a')][_0x3e76('0x30')]);_0x8a6f5[_0x3e76('0x34')]=_[_0x3e76('0x35')](_0x8b2271[_0x3e76('0x34')]);_0x8a6f5[_0x3e76('0x3f')]=_[_0x3e76('0x37')](_0x8a6f5[_0x3e76('0x38')],_0x8a6f5['query']);_0x4818af[_0x3e76('0x36')]=_['intersection'](_0x8a6f5[_0x3e76('0x38')],qs[_0x3e76('0x39')](_0x8b2271[_0x3e76('0x34')][_0x3e76('0x39')]));_0x4818af[_0x3e76('0x36')]=_0x4818af[_0x3e76('0x36')][_0x3e76('0x3a')]?_0x4818af[_0x3e76('0x36')]:_0x8a6f5['model'];_0x4818af[_0x3e76('0x3c')]=qs[_0x3e76('0x3d')](_0x8b2271[_0x3e76('0x34')]['sort']);_0x4818af[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_['pick'](_0x8b2271[_0x3e76('0x34')],_0x8a6f5[_0x3e76('0x3f')]));_0x4818af[_0x3e76('0x3e')]=_[_0x3e76('0x42')](_0x4818af[_0x3e76('0x3e')],{'$or':[{'ListId':_0x4133e8['id']},{'ListId':null}]});if(_0x8b2271[_0x3e76('0x34')][_0x3e76('0x41')]){_0x4818af[_0x3e76('0x3e')]=_[_0x3e76('0x42')](_0x4818af[_0x3e76('0x3e')],{'$or':_[_0x3e76('0x2f')](_0x4818af[_0x3e76('0x36')],function(_0xb064e3){var _0x231aa4={};_0x231aa4[_0xb064e3]={'$like':'%'+_0x8b2271[_0x3e76('0x34')][_0x3e76('0x41')]+'%'};return _0x231aa4;})});}_0x4818af=_[_0x3e76('0x42')]({},_0x4818af,_0x8b2271['options']);return db['CmCustomField'][_0x3e76('0x83')](_0x4818af);}})[_0x3e76('0x27')](respondWithResult(_0x3aca14,null))['catch'](handleError(_0x3aca14,null));};exports[_0x3e76('0x84')]=function(_0x116ca2,_0x3338a5,_0x2034d3){return db[_0x3e76('0x45')]['find']({'where':{'id':_0x116ca2['params']['id']}})['then'](handleEntityNotFound(_0x3338a5,null))[_0x3e76('0x27')](function(_0x2a4215){if(_0x2a4215){return _0x2a4215[_0x3e76('0x84')](_0x116ca2[_0x3e76('0x4f')]['ids'],_[_0x3e76('0x64')](_0x116ca2[_0x3e76('0x4f')],['ids','id'])||{})[_0x3e76('0x85')](function(_0x31ff6b){for(var _0x58d286=0x0;_0x58d286<_0x116ca2[_0x3e76('0x4f')][_0x3e76('0x65')][_0x3e76('0x3a')];_0x58d286+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x116ca2[_0x3e76('0x4f')]['ids'][_0x58d286]),'CmListId':Number(_0x116ca2[_0x3e76('0x4b')]['id'])});}return _0x31ff6b;});}})[_0x3e76('0x27')](respondWithResult(_0x3338a5,null))[_0x3e76('0x49')](handleError(_0x3338a5,null));};exports[_0x3e76('0x86')]=function(_0x323f18,_0x4b00e5,_0x2d92fb){return db[_0x3e76('0x45')][_0x3e76('0x4d')]({'where':{'id':_0x323f18['params']['id']}})['then'](handleEntityNotFound(_0x4b00e5,null))[_0x3e76('0x27')](function(_0x1e4943){if(_0x1e4943){return _0x1e4943['removeAgents'](_0x323f18[_0x3e76('0x34')][_0x3e76('0x65')])[_0x3e76('0x27')](function(){if(_['isArray'](_0x323f18[_0x3e76('0x34')][_0x3e76('0x65')])){for(var _0xa4069a=0x0;_0xa4069a<_0x323f18[_0x3e76('0x34')][_0x3e76('0x65')][_0x3e76('0x3a')];_0xa4069a+=0x1){socket[_0x3e76('0x87')](_0x3e76('0x88'),{'UserId':Number(_0x323f18[_0x3e76('0x34')][_0x3e76('0x65')][_0xa4069a]),'CmListId':Number(_0x323f18[_0x3e76('0x4b')]['id'])});}}else{socket[_0x3e76('0x87')](_0x3e76('0x88'),{'UserId':Number(_0x323f18['query']['ids']),'CmListId':Number(_0x323f18[_0x3e76('0x4b')]['id'])});}});}})[_0x3e76('0x27')](respondWithStatusCode(_0x4b00e5,null))['catch'](handleError(_0x4b00e5,null));};exports[_0x3e76('0x89')]=function(_0x420b86,_0x1776f7,_0x2428ff){var _0x2583a4={};var _0x108c82={};var _0x317ddb;var _0x40819c;return db[_0x3e76('0x45')][_0x3e76('0x5b')]({'where':{'id':_0x420b86['params']['id']}})['then'](handleEntityNotFound(_0x1776f7,null))[_0x3e76('0x27')](function(_0x2a7e42){if(_0x2a7e42){_0x317ddb=_0x2a7e42;_0x108c82[_0x3e76('0x38')]=_[_0x3e76('0x35')](db['User'][_0x3e76('0x30')]);_0x108c82[_0x3e76('0x34')]=_[_0x3e76('0x35')](_0x420b86[_0x3e76('0x34')]);_0x108c82['filters']=_[_0x3e76('0x37')](_0x108c82['model'],_0x108c82[_0x3e76('0x34')]);_0x2583a4[_0x3e76('0x36')]=_[_0x3e76('0x37')](_0x108c82[_0x3e76('0x38')],qs[_0x3e76('0x39')](_0x420b86['query']['fields']));_0x2583a4[_0x3e76('0x36')]=_0x2583a4['attributes']['length']?_0x2583a4[_0x3e76('0x36')]:_0x108c82[_0x3e76('0x38')];_0x2583a4[_0x3e76('0x3c')]=qs['sort'](_0x420b86['query']['sort']);_0x2583a4[_0x3e76('0x3e')]=qs[_0x3e76('0x3f')](_[_0x3e76('0x40')](_0x420b86['query'],_0x108c82['filters']));if(_0x420b86[_0x3e76('0x34')][_0x3e76('0x41')]){_0x2583a4[_0x3e76('0x3e')]=_[_0x3e76('0x42')](_0x2583a4[_0x3e76('0x3e')],{'$or':_['map'](_0x2583a4[_0x3e76('0x36')],function(_0x460933){var _0x2cf80b={};_0x2cf80b[_0x460933]={'$like':'%'+_0x420b86['query']['filter']+'%'};return _0x2cf80b;})});}_0x2583a4=_[_0x3e76('0x42')]({},_0x2583a4,_0x420b86[_0x3e76('0x44')]);return _0x317ddb[_0x3e76('0x89')](_0x2583a4);}})[_0x3e76('0x27')](function(_0xb37599){if(_0xb37599){_0x40819c=_0xb37599[_0x3e76('0x3a')];if(!_0x420b86[_0x3e76('0x34')][_0x3e76('0x5c')]('nolimit')){_0x2583a4[_0x3e76('0x1e')]=qs[_0x3e76('0x1e')](_0x420b86[_0x3e76('0x34')]['limit']);_0x2583a4[_0x3e76('0x1c')]=qs[_0x3e76('0x1c')](_0x420b86['query'][_0x3e76('0x1c')]);}return _0x317ddb[_0x3e76('0x89')](_0x2583a4);}})['then'](function(_0x15787e){if(_0x15787e){return _0x15787e?{'count':_0x40819c,'rows':_0x15787e}:null;}})[_0x3e76('0x27')](respondWithResult(_0x1776f7,null))[_0x3e76('0x49')](handleError(_0x1776f7,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 41323df..33c2d7b 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x474035,_0x41e639){var _0x1b58e0=function(_0x91b15c){while(--_0x91b15c){_0x474035['push'](_0x474035['shift']());}};_0x1b58e0(++_0x41e639);}(_0x814b,0x1a2));var _0xb814=function(_0x32be62,_0x22e6fd){_0x32be62=_0x32be62-0x0;var _0x1a37e9=_0x814b[_0x32be62];return _0x1a37e9;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x113de5,_0x19be9a){var _0x274e21=function(_0x2d6a39){while(--_0x2d6a39){_0x113de5['push'](_0x113de5['shift']());}};_0x274e21(++_0x19be9a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 59ce631..32ac3c6 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 _0xf3cd=['path','rimraf','../../config/environment','exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x377c23,_0x389792){var _0x411425=function(_0x155bc1){while(--_0x155bc1){_0x377c23['push'](_0x377c23['shift']());}};_0x411425(++_0x389792);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5a16f7,_0x15e545){_0x5a16f7=_0x5a16f7-0x0;var _0x5cb364=_0xf3cd[_0x5a16f7];return _0x5cb364;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./cmList.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0x23d61d,_0x3efda9){var _0x2ce990=function(_0x17e6a1){while(--_0x17e6a1){_0x23d61d['push'](_0x23d61d['shift']());}};_0x2ce990(++_0x3efda9);}(_0x41bb,0xc5));var _0xb41b=function(_0x58d618,_0xc639f6){_0x58d618=_0x58d618-0x0;var _0x1d0090=_0x41bb[_0x58d618];return _0x1d0090;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 0bcd9c1..53d05b1 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 _0x06d9=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment'];(function(_0x3aed6b,_0x10d63e){var _0x50cc84=function(_0x4e352d){while(--_0x4e352d){_0x3aed6b['push'](_0x3aed6b['shift']());}};_0x50cc84(++_0x10d63e);}(_0x06d9,0xc5));var _0x906d=function(_0x59fe86,_0x2d7145){_0x59fe86=_0x59fe86-0x0;var _0x4aa693=_0x06d9[_0x59fe86];return _0x4aa693;};'use strict';var _=require(_0x906d('0x0'));var util=require(_0x906d('0x1'));var moment=require(_0x906d('0x2'));var BPromise=require(_0x906d('0x3'));var rs=require(_0x906d('0x4'));var fs=require('fs');var Redis=require(_0x906d('0x5'));var db=require(_0x906d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x906d('0x7'));var config=require(_0x906d('0x8'));var jayson=require(_0x906d('0x9'));var client=jayson['client'][_0x906d('0xa')]({'port':0x232a});config[_0x906d('0xb')]=_[_0x906d('0xc')](config[_0x906d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x906d('0xd'))(new Redis(config['redis']));require('./cmList.socket')[_0x906d('0xe')](socket);function respondWithRpcPromise(_0x337a48,_0x366aac,_0x1d1ccf){return new BPromise(function(_0x445be7,_0x24178b){return client[_0x906d('0xf')](_0x337a48,_0x1d1ccf)[_0x906d('0x10')](function(_0x10ffb0){logger[_0x906d('0x11')](_0x906d('0x12'),_0x366aac,_0x906d('0x13'));logger[_0x906d('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x366aac,_0x906d('0x13'),JSON[_0x906d('0x15')](_0x10ffb0));if(_0x10ffb0['error']){if(_0x10ffb0[_0x906d('0x16')][_0x906d('0x17')]===0x1f4){logger[_0x906d('0x16')](_0x906d('0x12'),_0x366aac,_0x10ffb0[_0x906d('0x16')]['message']);return _0x24178b(_0x10ffb0[_0x906d('0x16')]['message']);}logger['error'](_0x906d('0x12'),_0x366aac,_0x10ffb0[_0x906d('0x16')]['message']);return _0x445be7(_0x10ffb0[_0x906d('0x16')]['message']);}else{logger[_0x906d('0x11')]('CmList,\x20%s,\x20%s',_0x366aac,_0x906d('0x13'));_0x445be7(_0x10ffb0['result'][_0x906d('0x18')]);}})['catch'](function(_0x113efa){logger[_0x906d('0x16')]('CmList,\x20%s,\x20%s',_0x366aac,_0x113efa);_0x24178b(_0x113efa);});});} \ No newline at end of file +var _0x4d8a=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x285296,_0x232b32){var _0x1a2c99=function(_0x24dd5e){while(--_0x24dd5e){_0x285296['push'](_0x285296['shift']());}};_0x1a2c99(++_0x232b32);}(_0x4d8a,0x154));var _0xa4d8=function(_0x2a9b96,_0x110ff5){_0x2a9b96=_0x2a9b96-0x0;var _0x18afcb=_0x4d8a[_0x2a9b96];return _0x18afcb;};'use strict';var _=require(_0xa4d8('0x0'));var util=require(_0xa4d8('0x1'));var moment=require(_0xa4d8('0x2'));var BPromise=require(_0xa4d8('0x3'));var rs=require(_0xa4d8('0x4'));var fs=require('fs');var Redis=require(_0xa4d8('0x5'));var db=require(_0xa4d8('0x6'))['db'];var utils=require(_0xa4d8('0x7'));var logger=require(_0xa4d8('0x8'))(_0xa4d8('0x9'));var config=require('../../config/environment');var jayson=require(_0xa4d8('0xa'));var client=jayson[_0xa4d8('0xb')][_0xa4d8('0xc')]({'port':0x232a});config[_0xa4d8('0xd')]=_[_0xa4d8('0xe')](config[_0xa4d8('0xd')],{'host':_0xa4d8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa4d8('0x10'))['register'](socket);function respondWithRpcPromise(_0x624481,_0x41f3da,_0x4063a8){return new BPromise(function(_0xbb8ea8,_0x20e90e){return client[_0xa4d8('0x11')](_0x624481,_0x4063a8)[_0xa4d8('0x12')](function(_0x34334d){logger[_0xa4d8('0x13')](_0xa4d8('0x14'),_0x41f3da,_0xa4d8('0x15'));logger[_0xa4d8('0x16')](_0xa4d8('0x17'),_0x41f3da,'request\x20sent',JSON['stringify'](_0x34334d));if(_0x34334d[_0xa4d8('0x18')]){if(_0x34334d[_0xa4d8('0x18')]['code']===0x1f4){logger[_0xa4d8('0x18')](_0xa4d8('0x14'),_0x41f3da,_0x34334d['error']['message']);return _0x20e90e(_0x34334d['error'][_0xa4d8('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x41f3da,_0x34334d[_0xa4d8('0x18')][_0xa4d8('0x19')]);return _0xbb8ea8(_0x34334d[_0xa4d8('0x18')][_0xa4d8('0x19')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x41f3da,_0xa4d8('0x15'));_0xbb8ea8(_0x34334d[_0xa4d8('0x1a')][_0xa4d8('0x19')]);}})[_0xa4d8('0x1b')](function(_0x33ac30){logger[_0xa4d8('0x18')](_0xa4d8('0x14'),_0x41f3da,_0x33ac30);_0x20e90e(_0x33ac30);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 28f5fe3..b736e52 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 _0x17b8=['removeListener','length','cmList:','./cmList.events','remove','update','emit'];(function(_0x154c59,_0x1343e0){var _0x562a80=function(_0xe479cd){while(--_0xe479cd){_0x154c59['push'](_0x154c59['shift']());}};_0x562a80(++_0x1343e0);}(_0x17b8,0xc7));var _0x817b=function(_0x357be4,_0x3bc32f){_0x357be4=_0x357be4-0x0;var _0xa8b73d=_0x17b8[_0x357be4];return _0xa8b73d;};'use strict';var CmListEvents=require(_0x817b('0x0'));var events=['save',_0x817b('0x1'),_0x817b('0x2')];function createListener(_0x2309a4,_0x1f5ec7){return function(_0x5136a0){_0x1f5ec7[_0x817b('0x3')](_0x2309a4,_0x5136a0);};}function removeListener(_0x5c2eec,_0x5175f1){return function(){CmListEvents[_0x817b('0x4')](_0x5c2eec,_0x5175f1);};}exports['register']=function(_0xed5aab){for(var _0x20b753=0x0,_0x2ac903=events[_0x817b('0x5')];_0x20b753<_0x2ac903;_0x20b753++){var _0x418508=events[_0x20b753];var _0x24217a=createListener(_0x817b('0x6')+_0x418508,_0xed5aab);CmListEvents['on'](_0x418508,_0x24217a);}}; \ No newline at end of file +var _0x6ca1=['removeListener','register','cmList:','./cmList.events','save','remove','emit'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x6ca1,0x13e));var _0x16ca=function(_0x3441f6,_0x274e15){_0x3441f6=_0x3441f6-0x0;var _0x4fb44d=_0x6ca1[_0x3441f6];return _0x4fb44d;};'use strict';var CmListEvents=require(_0x16ca('0x0'));var events=[_0x16ca('0x1'),_0x16ca('0x2'),'update'];function createListener(_0x529255,_0x2ee694){return function(_0xb150e3){_0x2ee694[_0x16ca('0x3')](_0x529255,_0xb150e3);};}function removeListener(_0x5cc6d,_0x311a5d){return function(){CmListEvents[_0x16ca('0x4')](_0x5cc6d,_0x311a5d);};}exports[_0x16ca('0x5')]=function(_0x16f31a){for(var _0x34da8e=0x0,_0x4c2a0c=events['length'];_0x34da8e<_0x4c2a0c;_0x34da8e++){var _0x19dc33=events[_0x34da8e];var _0x3764b6=createListener(_0x16ca('0x6')+_0x19dc33,_0x16f31a);CmListEvents['on'](_0x19dc33,_0x3764b6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index bf1e7f5..bd55b96 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 _0x1fed=['/:id/contacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions'];(function(_0x41b010,_0x35a3fd){var _0x439a1e=function(_0x167657){while(--_0x167657){_0x41b010['push'](_0x41b010['shift']());}};_0x439a1e(++_0x35a3fd);}(_0x1fed,0xbd));var _0xd1fe=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0x1fed[_0xc4966b];return _0x1802bb;};'use strict';var multer=require('multer');var util=require(_0xd1fe('0x0'));var path=require('path');var timeout=require(_0xd1fe('0x1'));var express=require('express');var router=express[_0xd1fe('0x2')]();var fs_extra=require(_0xd1fe('0x3'));var auth=require(_0xd1fe('0x4'));var interaction=require(_0xd1fe('0x5'));var config=require(_0xd1fe('0x6'));var controller=require('./cmList.controller');router[_0xd1fe('0x7')]('/',auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x9')]);router['get'](_0xd1fe('0xa'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0xb')]);router[_0xd1fe('0x7')](_0xd1fe('0xc'),auth[_0xd1fe('0x8')](),controller['show']);router[_0xd1fe('0x7')](_0xd1fe('0xd'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0xe')]);router[_0xd1fe('0x7')](_0xd1fe('0xf'),auth[_0xd1fe('0x8')](),controller['getContacts']);router[_0xd1fe('0x7')]('/:id/contacts/csv',auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x10')]);router[_0xd1fe('0x7')](_0xd1fe('0x11'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x12')]);router[_0xd1fe('0x7')](_0xd1fe('0x13'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x14')]);router[_0xd1fe('0x15')]('/',auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x16')]);router[_0xd1fe('0x15')](_0xd1fe('0xd'),auth['isAuthenticated'](),controller[_0xd1fe('0x17')]);router[_0xd1fe('0x15')](_0xd1fe('0xf'),auth['isAuthenticated'](),controller[_0xd1fe('0x18')]);router[_0xd1fe('0x15')](_0xd1fe('0x11'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x19')]);router[_0xd1fe('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xd1fe('0x1a')]);router[_0xd1fe('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xd1fe('0x1c')]);router[_0xd1fe('0x1d')](_0xd1fe('0xc'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x1e')]);router[_0xd1fe('0x1d')](_0xd1fe('0xd'),auth[_0xd1fe('0x8')](),controller[_0xd1fe('0x1f')]);router['delete'](_0xd1fe('0x13'),auth['isAuthenticated'](),controller[_0xd1fe('0x20')]);module[_0xd1fe('0x21')]=router; \ No newline at end of file +var _0x1cd9=['index','get','/describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','/:id/users','getAgents','post','create','addDisposition','addContacts','addAgents','put','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated'];(function(_0x4b7389,_0x367042){var _0x13f0b6=function(_0x33d120){while(--_0x33d120){_0x4b7389['push'](_0x4b7389['shift']());}};_0x13f0b6(++_0x367042);}(_0x1cd9,0x1c8));var _0x91cd=function(_0x3c8c55,_0x276b0a){_0x3c8c55=_0x3c8c55-0x0;var _0x22710b=_0x1cd9[_0x3c8c55];return _0x22710b;};'use strict';var multer=require(_0x91cd('0x0'));var util=require(_0x91cd('0x1'));var path=require(_0x91cd('0x2'));var timeout=require(_0x91cd('0x3'));var express=require(_0x91cd('0x4'));var router=express['Router']();var fs_extra=require(_0x91cd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x91cd('0x6'));var controller=require('./cmList.controller');router['get']('/',auth[_0x91cd('0x7')](),controller[_0x91cd('0x8')]);router[_0x91cd('0x9')](_0x91cd('0xa'),auth[_0x91cd('0x7')](),controller['describe']);router[_0x91cd('0x9')](_0x91cd('0xb'),auth[_0x91cd('0x7')](),controller[_0x91cd('0xc')]);router[_0x91cd('0x9')](_0x91cd('0xd'),auth[_0x91cd('0x7')](),controller['getDispositions']);router[_0x91cd('0x9')](_0x91cd('0xe'),auth['isAuthenticated'](),controller[_0x91cd('0xf')]);router[_0x91cd('0x9')](_0x91cd('0x10'),auth[_0x91cd('0x7')](),controller['getContactsCsv']);router[_0x91cd('0x9')](_0x91cd('0x11'),auth[_0x91cd('0x7')](),controller['getCustomFields']);router[_0x91cd('0x9')](_0x91cd('0x12'),auth[_0x91cd('0x7')](),controller[_0x91cd('0x13')]);router[_0x91cd('0x14')]('/',auth[_0x91cd('0x7')](),controller[_0x91cd('0x15')]);router[_0x91cd('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x91cd('0x16')]);router[_0x91cd('0x14')](_0x91cd('0xe'),auth['isAuthenticated'](),controller[_0x91cd('0x17')]);router[_0x91cd('0x14')]('/:id/fields',auth[_0x91cd('0x7')](),controller['addCustomField']);router['post'](_0x91cd('0x12'),auth[_0x91cd('0x7')](),controller[_0x91cd('0x18')]);router[_0x91cd('0x19')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x91cd('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x91cd('0x1a')](_0x91cd('0xd'),auth[_0x91cd('0x7')](),controller[_0x91cd('0x1b')]);router[_0x91cd('0x1a')](_0x91cd('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x91cd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index aa18715..80e2d38 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 _0x1777=['getDataValue','STRING'];(function(_0x184e3a,_0x23c634){var _0x2cc8af=function(_0x44be84){while(--_0x44be84){_0x184e3a['push'](_0x184e3a['shift']());}};_0x2cc8af(++_0x23c634);}(_0x1777,0xb8));var _0x7177=function(_0x5c5104,_0x1f483d){_0x5c5104=_0x5c5104-0x0;var _0x3fd096=_0x1777[_0x5c5104];return _0x3fd096;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x26e98c){return this[_0x7177('0x0')]('field');}},'field':{'type':Sequelize[_0x7177('0x1')],'allowNull':![]},'operator':{'type':Sequelize[_0x7177('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7177('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbc94=['sequelize','STRING'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0xbc94,0x19a));var _0x4bc9=function(_0x2de630,_0x534adc){_0x2de630=_0x2de630-0x0;var _0x35259e=_0xbc94[_0x2de630];return _0x35259e;};'use strict';var Sequelize=require(_0x4bc9('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x407a83){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x4bc9('0x1')],'allowNull':![]},'operator':{'type':Sequelize[_0x4bc9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x4bc9('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6e73cde..a5e1dbc 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(_0x3df0f4,_0x3125f3){var _0x915c43=function(_0x203060){while(--_0x203060){_0x3df0f4['push'](_0x3df0f4['shift']());}};_0x915c43(++_0x3125f3);}(_0x7a54,0x106));var _0x47a5=function(_0x39003d,_0x5816e9){_0x39003d=_0x39003d-0x0;var _0x92ba00=_0x7a54[_0x39003d];return _0x92ba00;};'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(_0x45a437,_0x11115b){var _0x19737e=function(_0x38be33){while(--_0x38be33){_0x45a437['push'](_0x45a437['shift']());}};_0x19737e(++_0x11115b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 4b6f060..b305d44 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 _0x1e0a=['lodash','util','api','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x2d4362,_0x22d8c8){var _0x3e8de8=function(_0x596838){while(--_0x596838){_0x2d4362['push'](_0x2d4362['shift']());}};_0x3e8de8(++_0x22d8c8);}(_0x1e0a,0xe6));var _0xa1e0=function(_0x472b9c,_0x870755){_0x472b9c=_0x472b9c-0x0;var _0x4fb294=_0x1e0a[_0x472b9c];return _0x4fb294;};'use strict';var _=require(_0xa1e0('0x0'));var util=require(_0xa1e0('0x1'));var logger=require('../../config/logger')(_0xa1e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa1e0('0x3'));var fs=require('fs');var path=require(_0xa1e0('0x4'));var rimraf=require('rimraf');var config=require(_0xa1e0('0x5'));var attributes=require(_0xa1e0('0x6'));module[_0xa1e0('0x7')]=function(_0x73c13b,_0x172bcf){return _0x73c13b[_0xa1e0('0x8')](_0xa1e0('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08e3=['request-promise','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x233417,_0xd8c964){var _0x167c17=function(_0x3794dd){while(--_0x3794dd){_0x233417['push'](_0x233417['shift']());}};_0x167c17(++_0xd8c964);}(_0x08e3,0x13a));var _0x308e=function(_0x218d1b,_0x5cf934){_0x218d1b=_0x218d1b-0x0;var _0x405ad0=_0x08e3[_0x218d1b];return _0x405ad0;};'use strict';var _=require(_0x308e('0x0'));var util=require('util');var logger=require(_0x308e('0x1'))(_0x308e('0x2'));var moment=require(_0x308e('0x3'));var BPromise=require(_0x308e('0x4'));var rp=require(_0x308e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x308e('0x6'));module[_0x308e('0x7')]=function(_0x23bcef,_0x7d1001){return _0x23bcef[_0x308e('0x8')](_0x308e('0x9'),attributes,{'tableName':_0x308e('0xa'),'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 48c3709..8683d18 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 _0x0d33=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x544af6,_0x4f33bf){var _0x1f41a9=function(_0x52a4a8){while(--_0x52a4a8){_0x544af6['push'](_0x544af6['shift']());}};_0x1f41a9(++_0x4f33bf);}(_0x0d33,0x15c));var _0x30d3=function(_0x441480,_0xf0c6e4){_0x441480=_0x441480-0x0;var _0x11b8b8=_0x0d33[_0x441480];return _0x11b8b8;};'use strict';var _=require('lodash');var util=require(_0x30d3('0x0'));var moment=require(_0x30d3('0x1'));var BPromise=require(_0x30d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x30d3('0x3'));var logger=require('../../config/logger')(_0x30d3('0x4'));var config=require('../../config/environment');var jayson=require(_0x30d3('0x5'));var client=jayson[_0x30d3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdcc5,_0x29d77f,_0x22b5e1){return new BPromise(function(_0x4198da,_0x3f38dd){return client[_0x30d3('0x7')](_0x1cdcc5,_0x22b5e1)[_0x30d3('0x8')](function(_0x38a0ca){logger[_0x30d3('0x9')](_0x30d3('0xa'),_0x29d77f,_0x30d3('0xb'));logger[_0x30d3('0xc')](_0x30d3('0xd'),_0x29d77f,_0x30d3('0xb'),JSON[_0x30d3('0xe')](_0x38a0ca));if(_0x38a0ca[_0x30d3('0xf')]){if(_0x38a0ca[_0x30d3('0xf')][_0x30d3('0x10')]===0x1f4){logger[_0x30d3('0xf')](_0x30d3('0xa'),_0x29d77f,_0x38a0ca[_0x30d3('0xf')][_0x30d3('0x11')]);return _0x3f38dd(_0x38a0ca[_0x30d3('0xf')]['message']);}logger[_0x30d3('0xf')]('Condition,\x20%s,\x20%s',_0x29d77f,_0x38a0ca[_0x30d3('0xf')][_0x30d3('0x11')]);return _0x4198da(_0x38a0ca[_0x30d3('0xf')][_0x30d3('0x11')]);}else{logger[_0x30d3('0x9')]('Condition,\x20%s,\x20%s',_0x29d77f,'request\x20sent');_0x4198da(_0x38a0ca[_0x30d3('0x12')][_0x30d3('0x11')]);}})['catch'](function(_0x36631){logger[_0x30d3('0xf')](_0x30d3('0xa'),_0x29d77f,_0x36631);_0x3f38dd(_0x36631);});});} \ No newline at end of file +var _0xe080=['../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe080,0x116));var _0x0e08=function(_0x1faff3,_0x415888){_0x1faff3=_0x1faff3-0x0;var _0x1e73a9=_0xe080[_0x1faff3];return _0x1e73a9;};'use strict';var _=require('lodash');var util=require(_0x0e08('0x0'));var moment=require(_0x0e08('0x1'));var BPromise=require(_0x0e08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e08('0x3'));var db=require(_0x0e08('0x4'))['db'];var utils=require(_0x0e08('0x5'));var logger=require(_0x0e08('0x6'))(_0x0e08('0x7'));var config=require(_0x0e08('0x8'));var jayson=require(_0x0e08('0x9'));var client=jayson[_0x0e08('0xa')][_0x0e08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398637,_0x3fe933,_0x1330d7){return new BPromise(function(_0x5bcc2b,_0x20ffe7){return client[_0x0e08('0xc')](_0x398637,_0x1330d7)[_0x0e08('0xd')](function(_0x7cd354){logger[_0x0e08('0xe')](_0x0e08('0xf'),_0x3fe933,_0x0e08('0x10'));logger['debug'](_0x0e08('0x11'),_0x3fe933,_0x0e08('0x10'),JSON['stringify'](_0x7cd354));if(_0x7cd354[_0x0e08('0x12')]){if(_0x7cd354[_0x0e08('0x12')]['code']===0x1f4){logger[_0x0e08('0x12')]('Condition,\x20%s,\x20%s',_0x3fe933,_0x7cd354[_0x0e08('0x12')][_0x0e08('0x13')]);return _0x20ffe7(_0x7cd354[_0x0e08('0x12')][_0x0e08('0x13')]);}logger[_0x0e08('0x12')](_0x0e08('0xf'),_0x3fe933,_0x7cd354[_0x0e08('0x12')][_0x0e08('0x13')]);return _0x5bcc2b(_0x7cd354[_0x0e08('0x12')][_0x0e08('0x13')]);}else{logger['info'](_0x0e08('0xf'),_0x3fe933,_0x0e08('0x10'));_0x5bcc2b(_0x7cd354[_0x0e08('0x14')]['message']);}})[_0x0e08('0x15')](function(_0x2f18b5){logger[_0x0e08('0x12')]('Condition,\x20%s,\x20%s',_0x3fe933,_0x2f18b5);_0x20ffe7(_0x2f18b5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 65f5c7e..aee944a 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 _0x1763=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x3759c9,_0x51a965){var _0x309d02=function(_0x2c6367){while(--_0x2c6367){_0x3759c9['push'](_0x3759c9['shift']());}};_0x309d02(++_0x51a965);}(_0x1763,0x128));var _0x3176=function(_0x3333a1,_0x4b2abc){_0x3333a1=_0x3333a1-0x0;var _0x16ce77=_0x1763[_0x3333a1];return _0x16ce77;};'use strict';var multer=require(_0x3176('0x0'));var util=require(_0x3176('0x1'));var path=require('path');var timeout=require(_0x3176('0x2'));var express=require(_0x3176('0x3'));var router=express[_0x3176('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3176('0x5'));var interaction=require(_0x3176('0x6'));var config=require(_0x3176('0x7'));var controller=require('./condition.controller');router['put']('/:id',auth[_0x3176('0x8')](),controller['update']);router[_0x3176('0x9')](_0x3176('0xa'),auth[_0x3176('0x8')](),controller[_0x3176('0xb')]);module[_0x3176('0xc')]=router; \ No newline at end of file +var _0x3250=['../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3250,0xbe));var _0x0325=function(_0x453889,_0x2c24ac){_0x453889=_0x453889-0x0;var _0x410b8a=_0x3250[_0x453889];return _0x410b8a;};'use strict';var multer=require(_0x0325('0x0'));var util=require(_0x0325('0x1'));var path=require(_0x0325('0x2'));var timeout=require('connect-timeout');var express=require(_0x0325('0x3'));var router=express[_0x0325('0x4')]();var fs_extra=require(_0x0325('0x5'));var auth=require(_0x0325('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0325('0x7'));var controller=require('./condition.controller');router['put'](_0x0325('0x8'),auth[_0x0325('0x9')](),controller[_0x0325('0xa')]);router[_0x0325('0xb')](_0x0325('0x8'),auth[_0x0325('0x9')](),controller[_0x0325('0xc')]);module[_0x0325('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index dad057f..0ccb2e9 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x142e37,_0x53d525){var _0x267ccd=function(_0x354591){while(--_0x354591){_0x142e37['push'](_0x142e37['shift']());}};_0x267ccd(++_0x53d525);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x117643,_0x2b3351){var _0x4f9ce1=function(_0x3500b8){while(--_0x3500b8){_0x117643['push'](_0x117643['shift']());}};_0x4f9ce1(++_0x2b3351);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3147cb2..97bddd6 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 _0x21a1=['VIRTUAL','Dashboard','includeAll','rows','show','params','fields','find','catch','create','user','role','CustomDashboards','userProfileId','autoAssociation','UserProfileResource','error','clone','intersection','include','omit','body','createdAt','updatedAt','attrUrl','attrs','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','stack','name','index','rawAttributes','type','key','map','query','keys','filters','model','length','attributes','order','sort','where','pick','filter','merge'];(function(_0x2b8549,_0x28f62a){var _0x337bc8=function(_0x3560d4){while(--_0x3560d4){_0x2b8549['push'](_0x2b8549['shift']());}};_0x337bc8(++_0x28f62a);}(_0x21a1,0x18d));var _0x121a=function(_0x19f3e5,_0x1c099e){_0x19f3e5=_0x19f3e5-0x0;var _0x5cd24e=_0x21a1[_0x19f3e5];return _0x5cd24e;};'use strict';var emlformat=require(_0x121a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x121a('0x1'));var jsonpatch=require(_0x121a('0x2'));var rp=require(_0x121a('0x3'));var moment=require(_0x121a('0x4'));var BPromise=require(_0x121a('0x5'));var Mustache=require(_0x121a('0x6'));var util=require(_0x121a('0x7'));var path=require('path');var sox=require(_0x121a('0x8'));var csv=require(_0x121a('0x9'));var ejs=require(_0x121a('0xa'));var fs=require('fs');var fs_extra=require(_0x121a('0xb'));var _=require(_0x121a('0xc'));var squel=require(_0x121a('0xd'));var crypto=require(_0x121a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x121a('0xf'));var toCsv=require(_0x121a('0x9'));var querystring=require(_0x121a('0x10'));var Papa=require(_0x121a('0x11'));var Redis=require(_0x121a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x121a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x121a('0x14'))('api');var utils=require(_0x121a('0x15'));var config=require(_0x121a('0x16'));var licenseUtil=require(_0x121a('0x17'));var db=require(_0x121a('0x18'))['db'];config[_0x121a('0x19')]=_[_0x121a('0x1a')](config[_0x121a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x121a('0x1b'))(new Redis(config[_0x121a('0x19')]));require(_0x121a('0x1c'))[_0x121a('0x1d')](socket);function respondWithStatusCode(_0xef5b61,_0x261cfb){_0x261cfb=_0x261cfb||0xcc;return function(_0x4b558f){if(_0x4b558f){return _0xef5b61[_0x121a('0x1e')](_0x261cfb);}return _0xef5b61['status'](_0x261cfb)['end']();};}function respondWithResult(_0x1580e6,_0x37cf7c){_0x37cf7c=_0x37cf7c||0xc8;return function(_0x3a5ed0){if(_0x3a5ed0){return _0x1580e6[_0x121a('0x1f')](_0x37cf7c)[_0x121a('0x20')](_0x3a5ed0);}};}function respondWithFilteredResult(_0x108b34,_0x46825a){return function(_0x4dc29e){if(_0x4dc29e){var _0x1a34ed=typeof _0x46825a[_0x121a('0x21')]===_0x121a('0x22')&&typeof _0x46825a[_0x121a('0x23')]===_0x121a('0x22');var _0x2bc8e3=_0x4dc29e[_0x121a('0x24')];var _0x6ae0b8=_0x1a34ed?0x0:_0x46825a[_0x121a('0x21')];var _0x2a9803=_0x1a34ed?_0x4dc29e[_0x121a('0x24')]:_0x46825a['offset']+_0x46825a[_0x121a('0x23')];var _0x415f43;if(_0x2a9803>=_0x2bc8e3){_0x2a9803=_0x2bc8e3;_0x415f43=0xc8;}else{_0x415f43=0xce;}_0x108b34[_0x121a('0x1f')](_0x415f43);return _0x108b34[_0x121a('0x25')](_0x121a('0x26'),_0x6ae0b8+'-'+_0x2a9803+'/'+_0x2bc8e3)['json'](_0x4dc29e);}return null;};}function patchUpdates(_0x6d45c5){return function(_0xa467fc){try{jsonpatch[_0x121a('0x27')](_0xa467fc,_0x6d45c5,!![]);}catch(_0x55ca29){return BPromise['reject'](_0x55ca29);}return _0xa467fc['save']();};}function saveUpdates(_0x1769f5,_0x12771f){return function(_0x541c8f){if(_0x541c8f){return _0x541c8f[_0x121a('0x28')](_0x1769f5)[_0x121a('0x29')](function(_0x7a88dc){return _0x7a88dc;});}return null;};}function removeEntity(_0x38a164,_0x2d4c0e){return function(_0x24cc50){if(_0x24cc50){return _0x24cc50[_0x121a('0x2a')]()[_0x121a('0x29')](function(){var _0x48a4b1=_0x24cc50[_0x121a('0x2b')]({'plain':!![]});var _0x4db208='CustomDashboards';return db['UserProfileResource'][_0x121a('0x2a')]({'where':{'type':_0x4db208,'resourceId':_0x48a4b1['id']}})[_0x121a('0x29')](function(){return _0x24cc50;});})['then'](function(){_0x38a164[_0x121a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8afa,_0x73f941){return function(_0x4f9bd7){if(!_0x4f9bd7){_0x5b8afa[_0x121a('0x1e')](0x194);}return _0x4f9bd7;};}function handleError(_0x516a49,_0x1f71d2){_0x1f71d2=_0x1f71d2||0x1f4;return function(_0x55f948){logger['error'](_0x55f948[_0x121a('0x2c')]);if(_0x55f948[_0x121a('0x2d')]){delete _0x55f948['name'];}_0x516a49[_0x121a('0x1f')](_0x1f71d2)['send'](_0x55f948);};}exports[_0x121a('0x2e')]=function(_0x2422af,_0x1be81e){var _0x42d412={},_0x5e31d2={},_0x502497={'count':0x0,'rows':[]};var _0x434270=_['map'](db['Dashboard'][_0x121a('0x2f')],function(_0x28cde5){return{'name':_0x28cde5['fieldName'],'type':_0x28cde5[_0x121a('0x30')][_0x121a('0x31')]};});_0x5e31d2['model']=_[_0x121a('0x32')](_0x434270,_0x121a('0x2d'));_0x5e31d2[_0x121a('0x33')]=_[_0x121a('0x34')](_0x2422af['query']);_0x5e31d2[_0x121a('0x35')]=_['intersection'](_0x5e31d2[_0x121a('0x36')],_0x5e31d2[_0x121a('0x33')]);_0x42d412['attributes']=_['intersection'](_0x5e31d2['model'],qs['fields'](_0x2422af['query']['fields']));_0x42d412['attributes']=_0x42d412['attributes'][_0x121a('0x37')]?_0x42d412[_0x121a('0x38')]:_0x5e31d2['model'];if(!_0x2422af[_0x121a('0x33')]['hasOwnProperty']('nolimit')){_0x42d412['limit']=qs[_0x121a('0x23')](_0x2422af[_0x121a('0x33')][_0x121a('0x23')]);_0x42d412[_0x121a('0x21')]=qs[_0x121a('0x21')](_0x2422af[_0x121a('0x33')][_0x121a('0x21')]);}_0x42d412[_0x121a('0x39')]=qs['sort'](_0x2422af[_0x121a('0x33')][_0x121a('0x3a')]);_0x42d412[_0x121a('0x3b')]=qs[_0x121a('0x35')](_[_0x121a('0x3c')](_0x2422af['query'],_0x5e31d2[_0x121a('0x35')]),_0x434270);if(_0x2422af['query'][_0x121a('0x3d')]){_0x42d412[_0x121a('0x3b')]=_[_0x121a('0x3e')](_0x42d412[_0x121a('0x3b')],{'$or':_[_0x121a('0x32')](_0x434270,function(_0x429730){if(_0x429730[_0x121a('0x30')]!==_0x121a('0x3f')){var _0x5bde68={};_0x5bde68[_0x429730['name']]={'$like':'%'+_0x2422af[_0x121a('0x33')][_0x121a('0x3d')]+'%'};return _0x5bde68;}})});}_0x42d412=_[_0x121a('0x3e')]({},_0x42d412,_0x2422af['options']);var _0x3a8c75={'where':_0x42d412['where']};return db[_0x121a('0x40')]['count'](_0x3a8c75)['then'](function(_0x53e7ae){_0x502497[_0x121a('0x24')]=_0x53e7ae;if(_0x2422af[_0x121a('0x33')][_0x121a('0x41')]){_0x42d412['include']=[{'all':!![]}];}return db[_0x121a('0x40')]['findAll'](_0x42d412);})['then'](function(_0x1d1a53){_0x502497[_0x121a('0x42')]=_0x1d1a53;return _0x502497;})[_0x121a('0x29')](respondWithFilteredResult(_0x1be81e,_0x42d412))['catch'](handleError(_0x1be81e,null));};exports[_0x121a('0x43')]=function(_0x5170ea,_0x56b775){var _0x5abe79={'raw':![],'where':{'id':_0x5170ea[_0x121a('0x44')]['id']}},_0x4baa3e={};_0x4baa3e['model']=_['keys'](db['Dashboard'][_0x121a('0x2f')]);_0x4baa3e[_0x121a('0x33')]=_[_0x121a('0x34')](_0x5170ea[_0x121a('0x33')]);_0x4baa3e[_0x121a('0x35')]=_['intersection'](_0x4baa3e[_0x121a('0x36')],_0x4baa3e[_0x121a('0x33')]);_0x5abe79[_0x121a('0x38')]=_['intersection'](_0x4baa3e[_0x121a('0x36')],qs[_0x121a('0x45')](_0x5170ea[_0x121a('0x33')][_0x121a('0x45')]));_0x5abe79[_0x121a('0x38')]=_0x5abe79['attributes']['length']?_0x5abe79['attributes']:_0x4baa3e['model'];if(_0x5170ea[_0x121a('0x33')][_0x121a('0x41')]){_0x5abe79['include']=[{'all':!![]}];}_0x5abe79=_['merge']({},_0x5abe79,_0x5170ea['options']);return db[_0x121a('0x40')][_0x121a('0x46')](_0x5abe79)['then'](handleEntityNotFound(_0x56b775,null))['then'](respondWithResult(_0x56b775,null))[_0x121a('0x47')](handleError(_0x56b775,null));};exports[_0x121a('0x48')]=function(_0x1708e7,_0x2eaf6d){return db[_0x121a('0x40')][_0x121a('0x48')](_0x1708e7['body'],{})['then'](function(_0x46c05f){var _0x58542e=_0x1708e7[_0x121a('0x49')][_0x121a('0x2b')]({'plain':!![]});if(!_0x58542e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58542e[_0x121a('0x4a')]===_0x121a('0x49')){var _0x1c2a34=_0x46c05f['get']({'plain':!![]});var _0x5db39c=_0x121a('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x5db39c,'userProfileId':_0x58542e[_0x121a('0x4c')]},'raw':!![]})['then'](function(_0x17a6e1){if(_0x17a6e1&&_0x17a6e1[_0x121a('0x4d')]===0x0){return db[_0x121a('0x4e')]['create']({'name':_0x1c2a34['name'],'resourceId':_0x1c2a34['id'],'type':_0x17a6e1['name'],'sectionId':_0x17a6e1['id']},{})[_0x121a('0x29')](function(){return _0x46c05f;});}else{return _0x46c05f;}})[_0x121a('0x47')](function(_0x132019){logger[_0x121a('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x132019);throw _0x132019;});}return _0x46c05f;})[_0x121a('0x29')](respondWithResult(_0x2eaf6d,0xc9))[_0x121a('0x47')](handleError(_0x2eaf6d,null));};exports[_0x121a('0x50')]=function(_0x1b9928,_0x2f9ec0){var _0x12ad60={'where':{'id':_0x1b9928[_0x121a('0x44')]['id']}},_0x31dfff={};_0x31dfff[_0x121a('0x36')]=_[_0x121a('0x34')](db['Dashboard'][_0x121a('0x2f')]);_0x12ad60[_0x121a('0x38')]=_[_0x121a('0x51')](_0x31dfff[_0x121a('0x36')],qs['fields'](_0x1b9928[_0x121a('0x33')][_0x121a('0x45')]));_0x12ad60['attributes']=_0x12ad60['attributes'][_0x121a('0x37')]?_0x12ad60[_0x121a('0x38')]:_0x31dfff[_0x121a('0x36')];if(_0x1b9928[_0x121a('0x33')][_0x121a('0x41')]){_0x12ad60[_0x121a('0x52')]=[{'all':!![]}];}_0x12ad60=_[_0x121a('0x3e')]({},_0x12ad60,_0x1b9928['options']);return db[_0x121a('0x40')][_0x121a('0x46')](_0x12ad60)[_0x121a('0x29')](handleEntityNotFound(_0x2f9ec0,null))[_0x121a('0x29')](function(_0x3570cf){if(_0x3570cf){var _0x3d0f6a=_0x3570cf[_0x121a('0x2b')]({'plain':!![]});_0x3d0f6a=qs['omit'](_0x3d0f6a,['id','createdAt','updatedAt']);_0x1b9928['body']=_[_0x121a('0x53')](_0x1b9928[_0x121a('0x54')],['id',_0x121a('0x55'),_0x121a('0x56')]);return db[_0x121a('0x40')][_0x121a('0x48')](_[_0x121a('0x3e')](_0x3d0f6a,_0x1b9928[_0x121a('0x54')]),{'include':_0x1b9928[_0x121a('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x121a('0x29')](function(_0x23e195){var _0x58f86d=_0x1b9928[_0x121a('0x49')][_0x121a('0x2b')]({'plain':!![]});if(!_0x58f86d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58f86d['role']===_0x121a('0x49')){var _0x31c750=_0x23e195['get']({'plain':!![]});var _0x98d3bc=_0x121a('0x4b');return db['UserProfileSection'][_0x121a('0x46')]({'where':{'name':_0x98d3bc,'userProfileId':_0x58f86d[_0x121a('0x4c')]},'raw':!![]})[_0x121a('0x29')](function(_0x334c98){if(_0x334c98&&_0x334c98['autoAssociation']===0x0){return db['UserProfileResource'][_0x121a('0x48')]({'name':_0x31c750[_0x121a('0x2d')],'resourceId':_0x31c750['id'],'type':_0x334c98[_0x121a('0x2d')],'sectionId':_0x334c98['id']},{})[_0x121a('0x29')](function(){return _0x23e195;});}else{return _0x23e195;}})['catch'](function(_0x5e4a02){logger[_0x121a('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e4a02);throw _0x5e4a02;});}return _0x23e195;});}})[_0x121a('0x29')](respondWithResult(_0x2f9ec0,0xc9))['catch'](handleError(_0x2f9ec0,null));};exports[_0x121a('0x28')]=function(_0xdc9bfa,_0x19e560){if(_0xdc9bfa['body']['id']){delete _0xdc9bfa[_0x121a('0x54')]['id'];}return db[_0x121a('0x40')][_0x121a('0x46')]({'where':{'id':_0xdc9bfa[_0x121a('0x44')]['id']}})['then'](handleEntityNotFound(_0x19e560,null))[_0x121a('0x29')](saveUpdates(_0xdc9bfa[_0x121a('0x54')],null))[_0x121a('0x29')](respondWithResult(_0x19e560,null))[_0x121a('0x47')](handleError(_0x19e560,null));};exports[_0x121a('0x2a')]=function(_0x272d98,_0x20d5af){return db[_0x121a('0x40')][_0x121a('0x46')]({'where':{'id':_0x272d98['params']['id']}})[_0x121a('0x29')](handleEntityNotFound(_0x20d5af,null))[_0x121a('0x29')](removeEntity(_0x20d5af,null))[_0x121a('0x47')](handleError(_0x20d5af,null));};function widgetAttributes(_0x38e085){try{switch(_0x38e085[_0x121a('0x30')]){case'iframe':return[{'name':_0x121a('0x57'),'value':_0x38e085[_0x121a('0x57')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x0]?_0x38e085[_0x121a('0x58')][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x38e085[_0x121a('0x59')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x0]?_0x38e085[_0x121a('0x58')][0x0]['value']:undefined)||''}];case _0x121a('0x5a'):return[{'name':_0x121a('0x5b'),'value':_0x38e085[_0x121a('0x5b')]||(_0x38e085['attrs']&&_0x38e085[_0x121a('0x58')][0x0]?_0x38e085[_0x121a('0x58')][0x0][_0x121a('0x5c')]:undefined)||_0x121a('0x5d')},{'name':_0x121a('0x5e'),'value':_0x38e085[_0x121a('0x5e')]||(_0x38e085['attrs']&&_0x38e085[_0x121a('0x58')][0x1]?_0x38e085[_0x121a('0x58')][0x1]['value']:undefined)||_0x121a('0x5f')},{'name':_0x121a('0x60'),'value':_0x38e085[_0x121a('0x60')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x2]?_0x38e085[_0x121a('0x58')][0x2][_0x121a('0x5c')]:undefined)||0xc}];case _0x121a('0x61'):return[{'name':_0x121a('0x62'),'value':_0x38e085[_0x121a('0x62')]||(_0x38e085['attrs']&&_0x38e085['attrs'][0x0]?_0x38e085['attrs'][0x0][_0x121a('0x5c')]:undefined)||_0x121a('0x63')},{'name':_0x121a('0x64'),'value':_0x38e085[_0x121a('0x64')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x1]?_0x38e085['attrs'][0x1][_0x121a('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x38e085[_0x121a('0x60')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x2]?_0x38e085[_0x121a('0x58')][0x2][_0x121a('0x5c')]:undefined)||0x14}];case _0x121a('0x65'):case'pie-chart':return[{'name':_0x121a('0x66'),'value':_0x38e085[_0x121a('0x66')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x0]?_0x38e085[_0x121a('0x58')][0x0][_0x121a('0x5c')]:undefined)||_0x121a('0x63')},{'name':'attrSerie2','value':_0x38e085[_0x121a('0x67')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x1]?_0x38e085[_0x121a('0x58')][0x1]['value']:undefined)||null},{'name':_0x121a('0x68'),'value':_0x38e085[_0x121a('0x68')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x2]?_0x38e085['attrs'][0x2][_0x121a('0x5c')]:undefined)||null},{'name':_0x121a('0x64'),'value':_0x38e085[_0x121a('0x64')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085['attrs'][0x3]?_0x38e085[_0x121a('0x58')][0x3][_0x121a('0x5c')]:undefined)||[]}];case'web-report':return[{'name':_0x121a('0x69'),'type':_0x38e085[_0x121a('0x6a')]||(_0x38e085['attrs']&&_0x38e085['attrs'][0x0]?_0x38e085[_0x121a('0x58')][0x0][_0x121a('0x30')]:undefined)||null,'value':_0x38e085[_0x121a('0x69')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085[_0x121a('0x58')][0x0]?_0x38e085['attrs'][0x0][_0x121a('0x5c')]:undefined)||null},{'name':_0x121a('0x6b'),'value':_0x38e085[_0x121a('0x6b')]||(_0x38e085[_0x121a('0x58')]&&_0x38e085['attrs'][0x1]?_0x38e085[_0x121a('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5ab46a){logger['error'](_0x121a('0x6c'),JSON[_0x121a('0x6d')](_0x5ab46a));return[];}}exports['addItem']=function(_0x2a9644,_0x593a48,_0x3952ac){if(_0x2a9644[_0x121a('0x54')]['id']){delete _0x2a9644[_0x121a('0x54')]['id'];}return db[_0x121a('0x40')][_0x121a('0x46')]({'where':{'id':_0x2a9644['params']['id']}})[_0x121a('0x29')](handleEntityNotFound(_0x593a48,null))[_0x121a('0x29')](function(_0x764c5d){if(_0x764c5d){_0x2a9644[_0x121a('0x54')][_0x121a('0x6e')]=_0x764c5d['id'];_0x2a9644['body'][_0x121a('0x58')]=widgetAttributes(_0x2a9644[_0x121a('0x54')]);return db[_0x121a('0x6f')][_0x121a('0x48')](_0x2a9644['body']);}})[_0x121a('0x29')](respondWithResult(_0x593a48,null))[_0x121a('0x47')](handleError(_0x593a48,null));};exports[_0x121a('0x70')]=function(_0x508904,_0x47127e,_0x3602e7){var _0xb3b2f6={};var _0x2bee9f={};var _0x4aa30b;var _0x593dca;return db[_0x121a('0x40')]['findOne']({'where':{'id':_0x508904[_0x121a('0x44')]['id']}})['then'](handleEntityNotFound(_0x47127e,null))[_0x121a('0x29')](function(_0x464b4c){if(_0x464b4c){_0x4aa30b=_0x464b4c;_0x2bee9f[_0x121a('0x36')]=_[_0x121a('0x34')](db['DashboardItem']['rawAttributes']);_0x2bee9f[_0x121a('0x33')]=_[_0x121a('0x34')](_0x508904[_0x121a('0x33')]);_0x2bee9f[_0x121a('0x35')]=_[_0x121a('0x51')](_0x2bee9f['model'],_0x2bee9f[_0x121a('0x33')]);_0xb3b2f6[_0x121a('0x38')]=_[_0x121a('0x51')](_0x2bee9f[_0x121a('0x36')],qs[_0x121a('0x45')](_0x508904['query'][_0x121a('0x45')]));_0xb3b2f6[_0x121a('0x38')]=_0xb3b2f6['attributes']['length']?_0xb3b2f6[_0x121a('0x38')]:_0x2bee9f[_0x121a('0x36')];_0xb3b2f6['order']=qs[_0x121a('0x3a')](_0x508904['query'][_0x121a('0x3a')]);_0xb3b2f6[_0x121a('0x3b')]=qs['filters'](_[_0x121a('0x3c')](_0x508904[_0x121a('0x33')],_0x2bee9f[_0x121a('0x35')]));if(_0x508904['query'][_0x121a('0x3d')]){_0xb3b2f6['where']=_['merge'](_0xb3b2f6[_0x121a('0x3b')],{'$or':_[_0x121a('0x32')](_0xb3b2f6[_0x121a('0x38')],function(_0x3891f1){var _0x26488b={};_0x26488b[_0x3891f1]={'$like':'%'+_0x508904[_0x121a('0x33')]['filter']+'%'};return _0x26488b;})});}_0xb3b2f6=_[_0x121a('0x3e')]({},_0xb3b2f6,_0x508904['options']);return _0x4aa30b[_0x121a('0x70')](_0xb3b2f6);}})[_0x121a('0x29')](function(_0x13ba89){if(_0x13ba89){_0x593dca=_0x13ba89[_0x121a('0x37')];if(!_0x508904[_0x121a('0x33')][_0x121a('0x71')](_0x121a('0x72'))){_0xb3b2f6[_0x121a('0x23')]=qs['limit'](_0x508904['query'][_0x121a('0x23')]);_0xb3b2f6[_0x121a('0x21')]=qs[_0x121a('0x21')](_0x508904[_0x121a('0x33')][_0x121a('0x21')]);}return _0x4aa30b[_0x121a('0x70')](_0xb3b2f6);}})['then'](function(_0x236256){if(_0x236256){return _0x236256?{'count':_0x593dca,'rows':_0x236256}:null;}})[_0x121a('0x29')](respondWithResult(_0x47127e,null))[_0x121a('0x47')](handleError(_0x47127e,null));}; \ No newline at end of file +var _0x6431=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','clone','omit','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','CustomDashboards','destroy','sendStatus','name','send','index','map','Dashboard','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','rows','params','include','catch','create'];(function(_0x55883b,_0xc9a549){var _0x2430ca=function(_0xdc4758){while(--_0xdc4758){_0x55883b['push'](_0x55883b['shift']());}};_0x2430ca(++_0xc9a549);}(_0x6431,0xa2));var _0x1643=function(_0x3a9758,_0x5e54c3){_0x3a9758=_0x3a9758-0x0;var _0x57bde8=_0x6431[_0x3a9758];return _0x57bde8;};'use strict';var emlformat=require(_0x1643('0x0'));var rimraf=require(_0x1643('0x1'));var zipdir=require(_0x1643('0x2'));var jsonpatch=require(_0x1643('0x3'));var rp=require(_0x1643('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1643('0x5'));var util=require(_0x1643('0x6'));var path=require(_0x1643('0x7'));var sox=require(_0x1643('0x8'));var csv=require(_0x1643('0x9'));var ejs=require(_0x1643('0xa'));var fs=require('fs');var fs_extra=require(_0x1643('0xb'));var _=require(_0x1643('0xc'));var squel=require('squel');var crypto=require(_0x1643('0xd'));var jsforce=require(_0x1643('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1643('0x9'));var querystring=require(_0x1643('0xf'));var Papa=require(_0x1643('0x10'));var Redis=require('ioredis');var authService=require(_0x1643('0x11'));var qs=require(_0x1643('0x12'));var as=require(_0x1643('0x13'));var hardwareService=require(_0x1643('0x14'));var logger=require('../../config/logger')(_0x1643('0x15'));var utils=require(_0x1643('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1643('0x17'));var db=require(_0x1643('0x18'))['db'];config[_0x1643('0x19')]=_[_0x1643('0x1a')](config[_0x1643('0x19')],{'host':_0x1643('0x1b'),'port':0x18eb});var socket=require(_0x1643('0x1c'))(new Redis(config[_0x1643('0x19')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x151b06,_0x2f6c89){_0x2f6c89=_0x2f6c89||0xcc;return function(_0x4b1623){if(_0x4b1623){return _0x151b06['sendStatus'](_0x2f6c89);}return _0x151b06['status'](_0x2f6c89)[_0x1643('0x1d')]();};}function respondWithResult(_0x1381d7,_0x475952){_0x475952=_0x475952||0xc8;return function(_0x375a38){if(_0x375a38){return _0x1381d7[_0x1643('0x1e')](_0x475952)[_0x1643('0x1f')](_0x375a38);}};}function respondWithFilteredResult(_0x9766e1,_0x2a565b){return function(_0x4c7561){if(_0x4c7561){var _0x390be5=typeof _0x2a565b[_0x1643('0x20')]===_0x1643('0x21')&&typeof _0x2a565b[_0x1643('0x22')]===_0x1643('0x21');var _0x56e973=_0x4c7561[_0x1643('0x23')];var _0x5745a3=_0x390be5?0x0:_0x2a565b[_0x1643('0x20')];var _0x4c78e1=_0x390be5?_0x4c7561[_0x1643('0x23')]:_0x2a565b['offset']+_0x2a565b[_0x1643('0x22')];var _0x5ab397;if(_0x4c78e1>=_0x56e973){_0x4c78e1=_0x56e973;_0x5ab397=0xc8;}else{_0x5ab397=0xce;}_0x9766e1[_0x1643('0x1e')](_0x5ab397);return _0x9766e1['set'](_0x1643('0x24'),_0x5745a3+'-'+_0x4c78e1+'/'+_0x56e973)[_0x1643('0x1f')](_0x4c7561);}return null;};}function patchUpdates(_0x4f83ca){return function(_0x5dc5dd){try{jsonpatch[_0x1643('0x25')](_0x5dc5dd,_0x4f83ca,!![]);}catch(_0x319e34){return BPromise[_0x1643('0x26')](_0x319e34);}return _0x5dc5dd['save']();};}function saveUpdates(_0xbf673d,_0xfc87e8){return function(_0x255e22){if(_0x255e22){return _0x255e22[_0x1643('0x27')](_0xbf673d)[_0x1643('0x28')](function(_0x423618){return _0x423618;});}return null;};}function removeEntity(_0x41e6b2,_0x2b3012){return function(_0x1087c9){if(_0x1087c9){return _0x1087c9['destroy']()[_0x1643('0x28')](function(){var _0x330fe5=_0x1087c9[_0x1643('0x29')]({'plain':!![]});var _0x1a0f1b=_0x1643('0x2a');return db['UserProfileResource'][_0x1643('0x2b')]({'where':{'type':_0x1a0f1b,'resourceId':_0x330fe5['id']}})[_0x1643('0x28')](function(){return _0x1087c9;});})[_0x1643('0x28')](function(){_0x41e6b2['status'](0xcc)[_0x1643('0x1d')]();});}};}function handleEntityNotFound(_0x9d1a3c,_0x2691f5){return function(_0x3eb921){if(!_0x3eb921){_0x9d1a3c[_0x1643('0x2c')](0x194);}return _0x3eb921;};}function handleError(_0x355ff4,_0x2ebad1){_0x2ebad1=_0x2ebad1||0x1f4;return function(_0x515afd){logger['error'](_0x515afd['stack']);if(_0x515afd[_0x1643('0x2d')]){delete _0x515afd[_0x1643('0x2d')];}_0x355ff4['status'](_0x2ebad1)[_0x1643('0x2e')](_0x515afd);};}exports[_0x1643('0x2f')]=function(_0x9b3427,_0x1f0ba9){var _0x1e1bb3={},_0x5490ee={},_0x5cae76={'count':0x0,'rows':[]};var _0x2bb8c7=_[_0x1643('0x30')](db[_0x1643('0x31')][_0x1643('0x32')],function(_0x595293){return{'name':_0x595293['fieldName'],'type':_0x595293['type'][_0x1643('0x33')]};});_0x5490ee[_0x1643('0x34')]=_[_0x1643('0x30')](_0x2bb8c7,_0x1643('0x2d'));_0x5490ee['query']=_[_0x1643('0x35')](_0x9b3427[_0x1643('0x36')]);_0x5490ee['filters']=_[_0x1643('0x37')](_0x5490ee[_0x1643('0x34')],_0x5490ee[_0x1643('0x36')]);_0x1e1bb3[_0x1643('0x38')]=_[_0x1643('0x37')](_0x5490ee[_0x1643('0x34')],qs[_0x1643('0x39')](_0x9b3427['query'][_0x1643('0x39')]));_0x1e1bb3[_0x1643('0x38')]=_0x1e1bb3[_0x1643('0x38')][_0x1643('0x3a')]?_0x1e1bb3[_0x1643('0x38')]:_0x5490ee[_0x1643('0x34')];if(!_0x9b3427[_0x1643('0x36')][_0x1643('0x3b')]('nolimit')){_0x1e1bb3[_0x1643('0x22')]=qs[_0x1643('0x22')](_0x9b3427[_0x1643('0x36')][_0x1643('0x22')]);_0x1e1bb3[_0x1643('0x20')]=qs[_0x1643('0x20')](_0x9b3427[_0x1643('0x36')][_0x1643('0x20')]);}_0x1e1bb3[_0x1643('0x3c')]=qs[_0x1643('0x3d')](_0x9b3427[_0x1643('0x36')][_0x1643('0x3d')]);_0x1e1bb3[_0x1643('0x3e')]=qs[_0x1643('0x3f')](_[_0x1643('0x40')](_0x9b3427[_0x1643('0x36')],_0x5490ee[_0x1643('0x3f')]),_0x2bb8c7);if(_0x9b3427[_0x1643('0x36')][_0x1643('0x41')]){_0x1e1bb3['where']=_[_0x1643('0x42')](_0x1e1bb3[_0x1643('0x3e')],{'$or':_[_0x1643('0x30')](_0x2bb8c7,function(_0x2d6d12){if(_0x2d6d12[_0x1643('0x43')]!=='VIRTUAL'){var _0x2054b4={};_0x2054b4[_0x2d6d12[_0x1643('0x2d')]]={'$like':'%'+_0x9b3427[_0x1643('0x36')][_0x1643('0x41')]+'%'};return _0x2054b4;}})});}_0x1e1bb3=_[_0x1643('0x42')]({},_0x1e1bb3,_0x9b3427[_0x1643('0x44')]);var _0x353fec={'where':_0x1e1bb3[_0x1643('0x3e')]};return db['Dashboard'][_0x1643('0x23')](_0x353fec)[_0x1643('0x28')](function(_0x2d14cb){_0x5cae76[_0x1643('0x23')]=_0x2d14cb;if(_0x9b3427['query'][_0x1643('0x45')]){_0x1e1bb3['include']=[{'all':!![]}];}return db[_0x1643('0x31')][_0x1643('0x46')](_0x1e1bb3);})['then'](function(_0x40c09e){_0x5cae76[_0x1643('0x47')]=_0x40c09e;return _0x5cae76;})[_0x1643('0x28')](respondWithFilteredResult(_0x1f0ba9,_0x1e1bb3))['catch'](handleError(_0x1f0ba9,null));};exports['show']=function(_0x3b1a44,_0x4a3efd){var _0x387354={'raw':![],'where':{'id':_0x3b1a44[_0x1643('0x48')]['id']}},_0x2172b4={};_0x2172b4['model']=_[_0x1643('0x35')](db[_0x1643('0x31')][_0x1643('0x32')]);_0x2172b4['query']=_[_0x1643('0x35')](_0x3b1a44[_0x1643('0x36')]);_0x2172b4[_0x1643('0x3f')]=_[_0x1643('0x37')](_0x2172b4[_0x1643('0x34')],_0x2172b4['query']);_0x387354[_0x1643('0x38')]=_[_0x1643('0x37')](_0x2172b4[_0x1643('0x34')],qs['fields'](_0x3b1a44[_0x1643('0x36')]['fields']));_0x387354[_0x1643('0x38')]=_0x387354[_0x1643('0x38')][_0x1643('0x3a')]?_0x387354[_0x1643('0x38')]:_0x2172b4[_0x1643('0x34')];if(_0x3b1a44[_0x1643('0x36')][_0x1643('0x45')]){_0x387354[_0x1643('0x49')]=[{'all':!![]}];}_0x387354=_[_0x1643('0x42')]({},_0x387354,_0x3b1a44['options']);return db['Dashboard']['find'](_0x387354)[_0x1643('0x28')](handleEntityNotFound(_0x4a3efd,null))['then'](respondWithResult(_0x4a3efd,null))[_0x1643('0x4a')](handleError(_0x4a3efd,null));};exports[_0x1643('0x4b')]=function(_0x32d8a1,_0x2d8f20){return db[_0x1643('0x31')]['create'](_0x32d8a1[_0x1643('0x4c')],{})[_0x1643('0x28')](function(_0x1322a5){var _0xab7889=_0x32d8a1[_0x1643('0x4d')][_0x1643('0x29')]({'plain':!![]});if(!_0xab7889)throw new Error(_0x1643('0x4e'));if(_0xab7889[_0x1643('0x4f')]==='user'){var _0x228d5f=_0x1322a5['get']({'plain':!![]});var _0xaa9b43='CustomDashboards';return db[_0x1643('0x50')][_0x1643('0x51')]({'where':{'name':_0xaa9b43,'userProfileId':_0xab7889[_0x1643('0x52')]},'raw':!![]})['then'](function(_0x5bdb7b){if(_0x5bdb7b&&_0x5bdb7b[_0x1643('0x53')]===0x0){return db[_0x1643('0x54')][_0x1643('0x4b')]({'name':_0x228d5f[_0x1643('0x2d')],'resourceId':_0x228d5f['id'],'type':_0x5bdb7b[_0x1643('0x2d')],'sectionId':_0x5bdb7b['id']},{})[_0x1643('0x28')](function(){return _0x1322a5;});}else{return _0x1322a5;}})[_0x1643('0x4a')](function(_0x1a2c26){logger[_0x1643('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a2c26);throw _0x1a2c26;});}return _0x1322a5;})['then'](respondWithResult(_0x2d8f20,0xc9))[_0x1643('0x4a')](handleError(_0x2d8f20,null));};exports[_0x1643('0x56')]=function(_0x1d3e57,_0x210ee9){var _0x220e7a={'where':{'id':_0x1d3e57[_0x1643('0x48')]['id']}},_0x593714={};_0x593714[_0x1643('0x34')]=_[_0x1643('0x35')](db[_0x1643('0x31')]['rawAttributes']);_0x220e7a[_0x1643('0x38')]=_[_0x1643('0x37')](_0x593714[_0x1643('0x34')],qs[_0x1643('0x39')](_0x1d3e57[_0x1643('0x36')][_0x1643('0x39')]));_0x220e7a[_0x1643('0x38')]=_0x220e7a[_0x1643('0x38')][_0x1643('0x3a')]?_0x220e7a[_0x1643('0x38')]:_0x593714[_0x1643('0x34')];if(_0x1d3e57[_0x1643('0x36')][_0x1643('0x45')]){_0x220e7a[_0x1643('0x49')]=[{'all':!![]}];}_0x220e7a=_['merge']({},_0x220e7a,_0x1d3e57[_0x1643('0x44')]);return db['Dashboard']['find'](_0x220e7a)[_0x1643('0x28')](handleEntityNotFound(_0x210ee9,null))['then'](function(_0xc4a1e0){if(_0xc4a1e0){var _0x344a51=_0xc4a1e0['get']({'plain':!![]});_0x344a51=qs[_0x1643('0x57')](_0x344a51,['id','createdAt',_0x1643('0x58')]);_0x1d3e57[_0x1643('0x4c')]=_['omit'](_0x1d3e57[_0x1643('0x4c')],['id',_0x1643('0x59'),'updatedAt']);return db[_0x1643('0x31')]['create'](_[_0x1643('0x42')](_0x344a51,_0x1d3e57[_0x1643('0x4c')]),{'include':_0x1d3e57['query'][_0x1643('0x45')]?[{'all':!![]}]:undefined})[_0x1643('0x28')](function(_0x11c1a1){var _0x1036e3=_0x1d3e57[_0x1643('0x4d')][_0x1643('0x29')]({'plain':!![]});if(!_0x1036e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1036e3[_0x1643('0x4f')]===_0x1643('0x4d')){var _0x4d693b=_0x11c1a1['get']({'plain':!![]});var _0x164dad=_0x1643('0x2a');return db[_0x1643('0x50')][_0x1643('0x51')]({'where':{'name':_0x164dad,'userProfileId':_0x1036e3['userProfileId']},'raw':!![]})[_0x1643('0x28')](function(_0x50c931){if(_0x50c931&&_0x50c931['autoAssociation']===0x0){return db[_0x1643('0x54')]['create']({'name':_0x4d693b[_0x1643('0x2d')],'resourceId':_0x4d693b['id'],'type':_0x50c931[_0x1643('0x2d')],'sectionId':_0x50c931['id']},{})[_0x1643('0x28')](function(){return _0x11c1a1;});}else{return _0x11c1a1;}})['catch'](function(_0xa7aef4){logger[_0x1643('0x55')](_0x1643('0x5a'),_0xa7aef4);throw _0xa7aef4;});}return _0x11c1a1;});}})[_0x1643('0x28')](respondWithResult(_0x210ee9,0xc9))[_0x1643('0x4a')](handleError(_0x210ee9,null));};exports[_0x1643('0x27')]=function(_0x5d39d4,_0x788420){if(_0x5d39d4[_0x1643('0x4c')]['id']){delete _0x5d39d4[_0x1643('0x4c')]['id'];}return db[_0x1643('0x31')]['find']({'where':{'id':_0x5d39d4[_0x1643('0x48')]['id']}})[_0x1643('0x28')](handleEntityNotFound(_0x788420,null))[_0x1643('0x28')](saveUpdates(_0x5d39d4[_0x1643('0x4c')],null))[_0x1643('0x28')](respondWithResult(_0x788420,null))[_0x1643('0x4a')](handleError(_0x788420,null));};exports['destroy']=function(_0x15d06e,_0x4fc615){return db[_0x1643('0x31')]['find']({'where':{'id':_0x15d06e['params']['id']}})['then'](handleEntityNotFound(_0x4fc615,null))['then'](removeEntity(_0x4fc615,null))[_0x1643('0x4a')](handleError(_0x4fc615,null));};function widgetAttributes(_0x566420){try{switch(_0x566420[_0x1643('0x43')]){case _0x1643('0x5b'):return[{'name':'attrUrl','value':_0x566420[_0x1643('0x5c')]||(_0x566420['attrs']&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420['attrs'][0x0][_0x1643('0x5e')]:undefined)||'https://'}];case _0x1643('0x5f'):return[{'name':'attrPath','value':_0x566420[_0x1643('0x60')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420[_0x1643('0x5d')][0x0][_0x1643('0x5e')]:undefined)||''}];case _0x1643('0x61'):return[{'name':'attrHourFormat','value':_0x566420[_0x1643('0x62')]||(_0x566420[_0x1643('0x5d')]&&_0x566420['attrs'][0x0]?_0x566420[_0x1643('0x5d')][0x0][_0x1643('0x5e')]:undefined)||_0x1643('0x63')},{'name':_0x1643('0x64'),'value':_0x566420[_0x1643('0x64')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x1]?_0x566420['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x1643('0x65'),'value':_0x566420[_0x1643('0x65')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x2]?_0x566420[_0x1643('0x5d')][0x2][_0x1643('0x5e')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x566420[_0x1643('0x66')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420[_0x1643('0x5d')][0x0][_0x1643('0x5e')]:undefined)||_0x1643('0x67')},{'name':_0x1643('0x68'),'value':_0x566420[_0x1643('0x68')]||(_0x566420['attrs']&&_0x566420[_0x1643('0x5d')][0x1]?_0x566420[_0x1643('0x5d')][0x1][_0x1643('0x5e')]:undefined)||[]},{'name':_0x1643('0x65'),'value':_0x566420['attrFontSize']||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x2]?_0x566420[_0x1643('0x5d')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x1643('0x69'):return[{'name':_0x1643('0x6a'),'value':_0x566420[_0x1643('0x6a')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420[_0x1643('0x5d')][0x0][_0x1643('0x5e')]:undefined)||_0x1643('0x67')},{'name':_0x1643('0x6b'),'value':_0x566420[_0x1643('0x6b')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x1]?_0x566420[_0x1643('0x5d')][0x1][_0x1643('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x566420[_0x1643('0x6c')]||(_0x566420['attrs']&&_0x566420[_0x1643('0x5d')][0x2]?_0x566420['attrs'][0x2][_0x1643('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x566420['attrVoiceQueues']||(_0x566420['attrs']&&_0x566420[_0x1643('0x5d')][0x3]?_0x566420[_0x1643('0x5d')][0x3][_0x1643('0x5e')]:undefined)||[]}];case _0x1643('0x6d'):return[{'name':_0x1643('0x6e'),'type':_0x566420[_0x1643('0x6f')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420[_0x1643('0x5d')][0x0]['type']:undefined)||null,'value':_0x566420[_0x1643('0x6e')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x0]?_0x566420['attrs'][0x0][_0x1643('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x566420[_0x1643('0x70')]||(_0x566420[_0x1643('0x5d')]&&_0x566420[_0x1643('0x5d')][0x1]?_0x566420[_0x1643('0x5d')][0x1][_0x1643('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x4ad71e){logger[_0x1643('0x55')](_0x1643('0x71'),JSON['stringify'](_0x4ad71e));return[];}}exports[_0x1643('0x72')]=function(_0x49a93a,_0x2c94dc,_0x589b0a){if(_0x49a93a[_0x1643('0x4c')]['id']){delete _0x49a93a['body']['id'];}return db['Dashboard'][_0x1643('0x51')]({'where':{'id':_0x49a93a[_0x1643('0x48')]['id']}})[_0x1643('0x28')](handleEntityNotFound(_0x2c94dc,null))['then'](function(_0x83badf){if(_0x83badf){_0x49a93a[_0x1643('0x4c')][_0x1643('0x73')]=_0x83badf['id'];_0x49a93a[_0x1643('0x4c')]['attrs']=widgetAttributes(_0x49a93a[_0x1643('0x4c')]);return db[_0x1643('0x74')][_0x1643('0x4b')](_0x49a93a['body']);}})[_0x1643('0x28')](respondWithResult(_0x2c94dc,null))['catch'](handleError(_0x2c94dc,null));};exports[_0x1643('0x75')]=function(_0x8d55bc,_0x3be0d9,_0x372b6b){var _0x4cd720={};var _0x237e47={};var _0x5b9d9b;var _0x164d53;return db['Dashboard'][_0x1643('0x76')]({'where':{'id':_0x8d55bc[_0x1643('0x48')]['id']}})[_0x1643('0x28')](handleEntityNotFound(_0x3be0d9,null))[_0x1643('0x28')](function(_0xd8db32){if(_0xd8db32){_0x5b9d9b=_0xd8db32;_0x237e47['model']=_[_0x1643('0x35')](db[_0x1643('0x74')][_0x1643('0x32')]);_0x237e47[_0x1643('0x36')]=_[_0x1643('0x35')](_0x8d55bc[_0x1643('0x36')]);_0x237e47[_0x1643('0x3f')]=_[_0x1643('0x37')](_0x237e47[_0x1643('0x34')],_0x237e47[_0x1643('0x36')]);_0x4cd720[_0x1643('0x38')]=_[_0x1643('0x37')](_0x237e47[_0x1643('0x34')],qs[_0x1643('0x39')](_0x8d55bc[_0x1643('0x36')][_0x1643('0x39')]));_0x4cd720[_0x1643('0x38')]=_0x4cd720['attributes']['length']?_0x4cd720['attributes']:_0x237e47[_0x1643('0x34')];_0x4cd720[_0x1643('0x3c')]=qs[_0x1643('0x3d')](_0x8d55bc[_0x1643('0x36')][_0x1643('0x3d')]);_0x4cd720[_0x1643('0x3e')]=qs[_0x1643('0x3f')](_[_0x1643('0x40')](_0x8d55bc[_0x1643('0x36')],_0x237e47[_0x1643('0x3f')]));if(_0x8d55bc[_0x1643('0x36')]['filter']){_0x4cd720[_0x1643('0x3e')]=_[_0x1643('0x42')](_0x4cd720['where'],{'$or':_[_0x1643('0x30')](_0x4cd720['attributes'],function(_0x14ff02){var _0x32221f={};_0x32221f[_0x14ff02]={'$like':'%'+_0x8d55bc[_0x1643('0x36')]['filter']+'%'};return _0x32221f;})});}_0x4cd720=_['merge']({},_0x4cd720,_0x8d55bc[_0x1643('0x44')]);return _0x5b9d9b[_0x1643('0x75')](_0x4cd720);}})[_0x1643('0x28')](function(_0x3f2797){if(_0x3f2797){_0x164d53=_0x3f2797[_0x1643('0x3a')];if(!_0x8d55bc[_0x1643('0x36')][_0x1643('0x3b')]('nolimit')){_0x4cd720[_0x1643('0x22')]=qs[_0x1643('0x22')](_0x8d55bc[_0x1643('0x36')]['limit']);_0x4cd720[_0x1643('0x20')]=qs[_0x1643('0x20')](_0x8d55bc[_0x1643('0x36')][_0x1643('0x20')]);}return _0x5b9d9b[_0x1643('0x75')](_0x4cd720);}})[_0x1643('0x28')](function(_0x4be426){if(_0x4be426){return _0x4be426?{'count':_0x164d53,'rows':_0x4be426}:null;}})[_0x1643('0x28')](respondWithResult(_0x3be0d9,null))[_0x1643('0x4a')](handleError(_0x3be0d9,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 8eb4bee..0453b81 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 _0x5785=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x5785,0x119));var _0x5578=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x5785[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require(_0x5578('0x0'));var Dashboard=require(_0x5578('0x1'))['db'][_0x5578('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5578('0x3')](0x0);var events={'afterCreate':_0x5578('0x4'),'afterUpdate':'update','afterDestroy':_0x5578('0x5')};function emitEvent(_0x2a3b8a){return function(_0x1af5f6,_0x8c7841,_0x3112c5){DashboardEvents[_0x5578('0x6')](_0x2a3b8a+':'+_0x1af5f6['id'],_0x1af5f6);DashboardEvents[_0x5578('0x6')](_0x2a3b8a,_0x1af5f6);_0x3112c5(null);};}for(var e in events){if(events[_0x5578('0x7')](e)){var event=events[e];Dashboard[_0x5578('0x8')](e,emitEvent(event));}}module[_0x5578('0x9')]=DashboardEvents; \ No newline at end of file +var _0x49ca=['hook','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49ca,0x129));var _0xa49c=function(_0x79cf27,_0x2d42ab){_0x79cf27=_0x79cf27-0x0;var _0x5729a4=_0x49ca[_0x79cf27];return _0x5729a4;};'use strict';var EventEmitter=require(_0xa49c('0x0'));var Dashboard=require(_0xa49c('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa49c('0x2'),'afterUpdate':_0xa49c('0x3'),'afterDestroy':_0xa49c('0x4')};function emitEvent(_0x4ae018){return function(_0x4c1346,_0x3f1b7a,_0x1089f6){DashboardEvents[_0xa49c('0x5')](_0x4ae018+':'+_0x4c1346['id'],_0x4c1346);DashboardEvents['emit'](_0x4ae018,_0x4c1346);_0x1089f6(null);};}for(var e in events){if(events[_0xa49c('0x6')](e)){var event=events[e];Dashboard[_0xa49c('0x7')](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 e4bd49d..770a72d 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 _0x753e=['api','moment','bluebird','request-promise','path','rimraf','./dashboard.attributes','Dashboard','dashboards','lodash','util','../../config/logger'];(function(_0x38750a,_0x316de4){var _0x92e34a=function(_0x4f83e1){while(--_0x4f83e1){_0x38750a['push'](_0x38750a['shift']());}};_0x92e34a(++_0x316de4);}(_0x753e,0x99));var _0xe753=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x753e[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var logger=require(_0xe753('0x2'))(_0xe753('0x3'));var moment=require(_0xe753('0x4'));var BPromise=require(_0xe753('0x5'));var rp=require(_0xe753('0x6'));var fs=require('fs');var path=require(_0xe753('0x7'));var rimraf=require(_0xe753('0x8'));var config=require('../../config/environment');var attributes=require(_0xe753('0x9'));module['exports']=function(_0x27b134,_0x325074){return _0x27b134['define'](_0xe753('0xa'),attributes,{'tableName':_0xe753('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41b8=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x571019,_0x5ae624){var _0x394c05=function(_0x51abfc){while(--_0x51abfc){_0x571019['push'](_0x571019['shift']());}};_0x394c05(++_0x5ae624);}(_0x41b8,0xc6));var _0x841b=function(_0x11e239,_0x3cfa93){_0x11e239=_0x11e239-0x0;var _0x4b1ee8=_0x41b8[_0x11e239];return _0x4b1ee8;};'use strict';var _=require(_0x841b('0x0'));var util=require(_0x841b('0x1'));var logger=require(_0x841b('0x2'))(_0x841b('0x3'));var moment=require(_0x841b('0x4'));var BPromise=require(_0x841b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x841b('0x6'));var config=require(_0x841b('0x7'));var attributes=require(_0x841b('0x8'));module['exports']=function(_0x262de8,_0x5db63a){return _0x262de8[_0x841b('0x9')](_0x841b('0xa'),attributes,{'tableName':_0x841b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index d2aef51..8e1cb69 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 _0x13f6=['http','redis','socket.io-emitter','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x13f6,0x6a));var _0x613f=function(_0x26546c,_0x1f52c2){_0x26546c=_0x26546c-0x0;var _0x45fa97=_0x13f6[_0x26546c];return _0x45fa97;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x613f('0x0'));var BPromise=require(_0x613f('0x1'));var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require(_0x613f('0x5'));var logger=require('../../config/logger')(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require(_0x613f('0x8'));var client=jayson['client'][_0x613f('0x9')]({'port':0x232a});config[_0x613f('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0xb'))(new Redis(config[_0x613f('0xa')]));require(_0x613f('0xc'))['register'](socket);function respondWithRpcPromise(_0x1a5e07,_0xcbda5a,_0x1f816c){return new BPromise(function(_0x40acfa,_0x18f128){return client['request'](_0x1a5e07,_0x1f816c)[_0x613f('0xd')](function(_0x344846){logger[_0x613f('0xe')](_0x613f('0xf'),_0xcbda5a,_0x613f('0x10'));logger[_0x613f('0x11')](_0x613f('0x12'),_0xcbda5a,_0x613f('0x10'),JSON[_0x613f('0x13')](_0x344846));if(_0x344846['error']){if(_0x344846[_0x613f('0x14')]['code']===0x1f4){logger['error'](_0x613f('0xf'),_0xcbda5a,_0x344846[_0x613f('0x14')][_0x613f('0x15')]);return _0x18f128(_0x344846['error'][_0x613f('0x15')]);}logger['error'](_0x613f('0xf'),_0xcbda5a,_0x344846[_0x613f('0x14')][_0x613f('0x15')]);return _0x40acfa(_0x344846[_0x613f('0x14')]['message']);}else{logger[_0x613f('0xe')]('Dashboard,\x20%s,\x20%s',_0xcbda5a,'request\x20sent');_0x40acfa(_0x344846[_0x613f('0x16')]['message']);}})['catch'](function(_0x1d1150){logger[_0x613f('0x14')]('Dashboard,\x20%s,\x20%s',_0xcbda5a,_0x1d1150);_0x18f128(_0x1d1150);});});} \ No newline at end of file +var _0x7c1f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x423fe6,_0x1b3eac){var _0x18a15e=function(_0x4d81cd){while(--_0x4d81cd){_0x423fe6['push'](_0x423fe6['shift']());}};_0x18a15e(++_0x1b3eac);}(_0x7c1f,0x65));var _0xf7c1=function(_0x415740,_0x1386a3){_0x415740=_0x415740-0x0;var _0x15272a=_0x7c1f[_0x415740];return _0x15272a;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf7c1('0x3'));var fs=require('fs');var Redis=require(_0xf7c1('0x4'));var db=require(_0xf7c1('0x5'))['db'];var utils=require(_0xf7c1('0x6'));var logger=require(_0xf7c1('0x7'))(_0xf7c1('0x8'));var config=require(_0xf7c1('0x9'));var jayson=require(_0xf7c1('0xa'));var client=jayson[_0xf7c1('0xb')][_0xf7c1('0xc')]({'port':0x232a});config[_0xf7c1('0xd')]=_[_0xf7c1('0xe')](config[_0xf7c1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7c1('0xf'))(new Redis(config[_0xf7c1('0xd')]));require('./dashboard.socket')[_0xf7c1('0x10')](socket);function respondWithRpcPromise(_0x1614ee,_0x26cc36,_0x56b687){return new BPromise(function(_0x10a226,_0x32b7e4){return client[_0xf7c1('0x11')](_0x1614ee,_0x56b687)['then'](function(_0x42b936){logger[_0xf7c1('0x12')](_0xf7c1('0x13'),_0x26cc36,'request\x20sent');logger['debug'](_0xf7c1('0x14'),_0x26cc36,_0xf7c1('0x15'),JSON['stringify'](_0x42b936));if(_0x42b936[_0xf7c1('0x16')]){if(_0x42b936['error'][_0xf7c1('0x17')]===0x1f4){logger[_0xf7c1('0x16')]('Dashboard,\x20%s,\x20%s',_0x26cc36,_0x42b936[_0xf7c1('0x16')][_0xf7c1('0x18')]);return _0x32b7e4(_0x42b936[_0xf7c1('0x16')]['message']);}logger[_0xf7c1('0x16')]('Dashboard,\x20%s,\x20%s',_0x26cc36,_0x42b936[_0xf7c1('0x16')][_0xf7c1('0x18')]);return _0x10a226(_0x42b936['error']['message']);}else{logger[_0xf7c1('0x12')](_0xf7c1('0x13'),_0x26cc36,_0xf7c1('0x15'));_0x10a226(_0x42b936[_0xf7c1('0x19')][_0xf7c1('0x18')]);}})[_0xf7c1('0x1a')](function(_0x3d3e5e){logger[_0xf7c1('0x16')](_0xf7c1('0x13'),_0x26cc36,_0x3d3e5e);_0x32b7e4(_0x3d3e5e);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 496f1f0..4caeaf2 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 _0xe925=['update','emit','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xe925,0x11d));var _0x5e92=function(_0xbe138c,_0x546f6e){_0xbe138c=_0xbe138c-0x0;var _0x279dad=_0xe925[_0xbe138c];return _0x279dad;};'use strict';var DashboardEvents=require(_0x5e92('0x0'));var events=[_0x5e92('0x1'),_0x5e92('0x2'),_0x5e92('0x3')];function createListener(_0x482322,_0x3bd4c9){return function(_0xf9942a){_0x3bd4c9[_0x5e92('0x4')](_0x482322,_0xf9942a);};}function removeListener(_0x1df0b5,_0xcb561d){return function(){DashboardEvents['removeListener'](_0x1df0b5,_0xcb561d);};}exports[_0x5e92('0x5')]=function(_0x3d3f0d){for(var _0x5ae83e=0x0,_0x496a5c=events[_0x5e92('0x6')];_0x5ae83e<_0x496a5c;_0x5ae83e++){var _0x32d60a=events[_0x5ae83e];var _0x28f469=createListener(_0x5e92('0x7')+_0x32d60a,_0x3d3f0d);DashboardEvents['on'](_0x32d60a,_0x28f469);}}; \ No newline at end of file +var _0xa682=['register','length','dashboard:','./dashboard.events','save','update'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0xa682,0xc3));var _0x2a68=function(_0x124a46,_0x55e602){_0x124a46=_0x124a46-0x0;var _0x346ce9=_0xa682[_0x124a46];return _0x346ce9;};'use strict';var DashboardEvents=require(_0x2a68('0x0'));var events=[_0x2a68('0x1'),'remove',_0x2a68('0x2')];function createListener(_0x469385,_0x1de46c){return function(_0x4ed9ac){_0x1de46c['emit'](_0x469385,_0x4ed9ac);};}function removeListener(_0x3def86,_0x4b7dc2){return function(){DashboardEvents['removeListener'](_0x3def86,_0x4b7dc2);};}exports[_0x2a68('0x3')]=function(_0x3b6052){for(var _0x411823=0x0,_0x304f51=events[_0x2a68('0x4')];_0x411823<_0x304f51;_0x411823++){var _0x1d6755=events[_0x411823];var _0x3618ed=createListener(_0x2a68('0x5')+_0x1d6755,_0x3b6052);DashboardEvents['on'](_0x1d6755,_0x3618ed);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index c1376a0..e54b457 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 _0x480c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','getItems','post','clone','put','/:id','update','delete','destroy','exports','multer','util','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x480c,0x1a1));var _0xc480=function(_0x3f946b,_0xbd1ebe){_0x3f946b=_0x3f946b-0x0;var _0x2a2ea1=_0x480c[_0x3f946b];return _0x2a2ea1;};'use strict';var multer=require(_0xc480('0x0'));var util=require(_0xc480('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc480('0x2'));var router=express[_0xc480('0x3')]();var fs_extra=require(_0xc480('0x4'));var auth=require(_0xc480('0x5'));var interaction=require(_0xc480('0x6'));var config=require(_0xc480('0x7'));var controller=require(_0xc480('0x8'));router['get']('/',auth[_0xc480('0x9')](),controller[_0xc480('0xa')]);router[_0xc480('0xb')]('/:id',auth[_0xc480('0x9')](),controller['show']);router['get']('/:id/items',auth[_0xc480('0x9')](),controller[_0xc480('0xc')]);router[_0xc480('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc480('0xd')]('/:id/clone',auth[_0xc480('0x9')](),controller[_0xc480('0xe')]);router['post']('/:id/items',auth[_0xc480('0x9')](),controller['addItem']);router[_0xc480('0xf')](_0xc480('0x10'),auth[_0xc480('0x9')](),controller[_0xc480('0x11')]);router[_0xc480('0x12')](_0xc480('0x10'),auth[_0xc480('0x9')](),controller[_0xc480('0x13')]);module[_0xc480('0x14')]=router; \ No newline at end of file +var _0x6f83=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','show','/:id/items','getItems','post','create','/:id/clone','put','delete','/:id','destroy','exports'];(function(_0x5a925d,_0x2bc654){var _0x8d350c=function(_0x168662){while(--_0x168662){_0x5a925d['push'](_0x5a925d['shift']());}};_0x8d350c(++_0x2bc654);}(_0x6f83,0x154));var _0x36f8=function(_0x8ef0c0,_0x1bed30){_0x8ef0c0=_0x8ef0c0-0x0;var _0x43ca52=_0x6f83[_0x8ef0c0];return _0x43ca52;};'use strict';var multer=require('multer');var util=require(_0x36f8('0x0'));var path=require('path');var timeout=require(_0x36f8('0x1'));var express=require(_0x36f8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x36f8('0x3'));var interaction=require(_0x36f8('0x4'));var config=require('../../config/environment');var controller=require(_0x36f8('0x5'));router['get']('/',auth[_0x36f8('0x6')](),controller[_0x36f8('0x7')]);router[_0x36f8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x36f8('0x9')]);router[_0x36f8('0x8')](_0x36f8('0xa'),auth[_0x36f8('0x6')](),controller[_0x36f8('0xb')]);router[_0x36f8('0xc')]('/',auth[_0x36f8('0x6')](),controller[_0x36f8('0xd')]);router['post'](_0x36f8('0xe'),auth[_0x36f8('0x6')](),controller['clone']);router[_0x36f8('0xc')](_0x36f8('0xa'),auth[_0x36f8('0x6')](),controller['addItem']);router[_0x36f8('0xf')]('/:id',auth[_0x36f8('0x6')](),controller['update']);router[_0x36f8('0x10')](_0x36f8('0x11'),auth[_0x36f8('0x6')](),controller[_0x36f8('0x12')]);module[_0x36f8('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3fdbe4c..a30ce40 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 _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x287aba,_0x2b05a3){var _0x25d2ea=function(_0x1652c2){while(--_0x1652c2){_0x287aba['push'](_0x287aba['shift']());}};_0x25d2ea(++_0x2b05a3);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x455e72,_0xc76ee7){_0x455e72=_0x455e72-0x0;var _0x28c1aa=_0xc1c6[_0x455e72];return _0x28c1aa;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xf494=['squel','lodash','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xf494,0x1c6));var _0x4f49=function(_0x19089e,_0x2c6e20){_0x19089e=_0x19089e-0x0;var _0x1cc010=_0xf494[_0x19089e];return _0x1cc010;};'use strict';var Sequelize=require(_0x4f49('0x0'));var squel=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));module['exports']={'title':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4f49('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5')),'get':function(){try{return JSON[_0x4f49('0x6')](this[_0x4f49('0x7')](_0x4f49('0x8')));}catch(_0x790e8b){return[];}},'set':function(_0xc5e778){try{this[_0x4f49('0x9')](_0x4f49('0x8'),JSON['stringify'](_0xc5e778));}catch(_0x58e9a0){this[_0x4f49('0x9')](_0x4f49('0x8'),JSON[_0x4f49('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4f49('0xb')]},'col':{'type':Sequelize[_0x4f49('0xb')]},'background':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':_0x4f49('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x4f49('0xb')],'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 b516791..347fcaf 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 _0x88c0=['../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','send','show','params','model','keys','DashboardItem','query','intersection','attributes','fields','length','includeAll','merge','options','catch','find','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','type','error','widgetAttributes:\x20%s','body','create','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3b7d92,_0x26bb9a){var _0x315fbb=function(_0x46844b){while(--_0x46844b){_0x3b7d92['push'](_0x3b7d92['shift']());}};_0x315fbb(++_0x26bb9a);}(_0x88c0,0x149));var _0x088c=function(_0x3d7322,_0x2b9a3d){_0x3d7322=_0x3d7322-0x0;var _0x568e92=_0x88c0[_0x3d7322];return _0x568e92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x088c('0x0'));var zipdir=require(_0x088c('0x1'));var jsonpatch=require(_0x088c('0x2'));var rp=require(_0x088c('0x3'));var moment=require(_0x088c('0x4'));var BPromise=require(_0x088c('0x5'));var Mustache=require('mustache');var util=require(_0x088c('0x6'));var path=require(_0x088c('0x7'));var sox=require('sox');var csv=require(_0x088c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x088c('0x9'));var _=require(_0x088c('0xa'));var squel=require(_0x088c('0xb'));var crypto=require(_0x088c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x088c('0xd'));var toCsv=require(_0x088c('0x8'));var querystring=require(_0x088c('0xe'));var Papa=require('papaparse');var Redis=require(_0x088c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088c('0x10'));var as=require(_0x088c('0x11'));var hardwareService=require(_0x088c('0x12'));var logger=require(_0x088c('0x13'))('api');var utils=require(_0x088c('0x14'));var config=require(_0x088c('0x15'));var licenseUtil=require(_0x088c('0x16'));var db=require(_0x088c('0x17'))['db'];config[_0x088c('0x18')]=_[_0x088c('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x088c('0x1a'))(new Redis(config[_0x088c('0x18')]));require(_0x088c('0x1b'))[_0x088c('0x1c')](socket);function respondWithStatusCode(_0x349a95,_0x4ac2ad){_0x4ac2ad=_0x4ac2ad||0xcc;return function(_0x26b52d){if(_0x26b52d){return _0x349a95[_0x088c('0x1d')](_0x4ac2ad);}return _0x349a95['status'](_0x4ac2ad)['end']();};}function respondWithResult(_0x28e421,_0x1849b2){_0x1849b2=_0x1849b2||0xc8;return function(_0x39f0e0){if(_0x39f0e0){return _0x28e421[_0x088c('0x1e')](_0x1849b2)['json'](_0x39f0e0);}};}function respondWithFilteredResult(_0x14f3e1,_0x1d5121){return function(_0x3802c7){if(_0x3802c7){var _0x50f8e1=typeof _0x1d5121[_0x088c('0x1f')]==='undefined'&&typeof _0x1d5121[_0x088c('0x20')]===_0x088c('0x21');var _0xfe4c74=_0x3802c7[_0x088c('0x22')];var _0x1cdfc7=_0x50f8e1?0x0:_0x1d5121['offset'];var _0x3b6572=_0x50f8e1?_0x3802c7[_0x088c('0x22')]:_0x1d5121[_0x088c('0x1f')]+_0x1d5121[_0x088c('0x20')];var _0x129d25;if(_0x3b6572>=_0xfe4c74){_0x3b6572=_0xfe4c74;_0x129d25=0xc8;}else{_0x129d25=0xce;}_0x14f3e1[_0x088c('0x1e')](_0x129d25);return _0x14f3e1[_0x088c('0x23')](_0x088c('0x24'),_0x1cdfc7+'-'+_0x3b6572+'/'+_0xfe4c74)[_0x088c('0x25')](_0x3802c7);}return null;};}function patchUpdates(_0x53447a){return function(_0x1a178e){try{jsonpatch['apply'](_0x1a178e,_0x53447a,!![]);}catch(_0x57527b){return BPromise[_0x088c('0x26')](_0x57527b);}return _0x1a178e[_0x088c('0x27')]();};}function saveUpdates(_0x514b74,_0x2c28c0){return function(_0x5eb801){if(_0x5eb801){return _0x5eb801[_0x088c('0x28')](_0x514b74)[_0x088c('0x29')](function(_0x12bf94){return _0x12bf94;});}return null;};}function removeEntity(_0x18a5a9,_0x3d308a){return function(_0x7944df){if(_0x7944df){return _0x7944df[_0x088c('0x2a')]()[_0x088c('0x29')](function(){_0x18a5a9['status'](0xcc)[_0x088c('0x2b')]();});}};}function handleEntityNotFound(_0x523c5a,_0x22c844){return function(_0x506f65){if(!_0x506f65){_0x523c5a['sendStatus'](0x194);}return _0x506f65;};}function handleError(_0x4a3db2,_0x26b4fc){_0x26b4fc=_0x26b4fc||0x1f4;return function(_0x2c8150){logger['error'](_0x2c8150[_0x088c('0x2c')]);if(_0x2c8150[_0x088c('0x2d')]){delete _0x2c8150[_0x088c('0x2d')];}_0x4a3db2[_0x088c('0x1e')](_0x26b4fc)[_0x088c('0x2e')](_0x2c8150);};}exports[_0x088c('0x2f')]=function(_0x3dbb88,_0x282865){var _0x20cfb0={'raw':![],'where':{'id':_0x3dbb88[_0x088c('0x30')]['id']}},_0x273e1a={};_0x273e1a[_0x088c('0x31')]=_[_0x088c('0x32')](db[_0x088c('0x33')]['rawAttributes']);_0x273e1a[_0x088c('0x34')]=_[_0x088c('0x32')](_0x3dbb88[_0x088c('0x34')]);_0x273e1a['filters']=_[_0x088c('0x35')](_0x273e1a[_0x088c('0x31')],_0x273e1a[_0x088c('0x34')]);_0x20cfb0[_0x088c('0x36')]=_[_0x088c('0x35')](_0x273e1a[_0x088c('0x31')],qs[_0x088c('0x37')](_0x3dbb88[_0x088c('0x34')][_0x088c('0x37')]));_0x20cfb0['attributes']=_0x20cfb0[_0x088c('0x36')][_0x088c('0x38')]?_0x20cfb0[_0x088c('0x36')]:_0x273e1a['model'];if(_0x3dbb88[_0x088c('0x34')][_0x088c('0x39')]){_0x20cfb0['include']=[{'all':!![]}];}_0x20cfb0=_[_0x088c('0x3a')]({},_0x20cfb0,_0x3dbb88[_0x088c('0x3b')]);return db[_0x088c('0x33')]['find'](_0x20cfb0)[_0x088c('0x29')](handleEntityNotFound(_0x282865,null))[_0x088c('0x29')](respondWithResult(_0x282865,null))[_0x088c('0x3c')](handleError(_0x282865,null));};exports[_0x088c('0x2a')]=function(_0x4d54ce,_0x29dced){return db[_0x088c('0x33')][_0x088c('0x3d')]({'where':{'id':_0x4d54ce[_0x088c('0x30')]['id']}})['then'](handleEntityNotFound(_0x29dced,null))[_0x088c('0x29')](removeEntity(_0x29dced,null))[_0x088c('0x3c')](handleError(_0x29dced,null));};function widgetAttributes(_0x1c45d8){try{switch(_0x1c45d8['type']){case'iframe':return[{'name':'attrUrl','value':_0x1c45d8['attrUrl']||(_0x1c45d8['attrs']&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8[_0x088c('0x3e')][0x0][_0x088c('0x3f')]:undefined)||'https://'}];case _0x088c('0x40'):return[{'name':'attrPath','value':_0x1c45d8[_0x088c('0x41')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8[_0x088c('0x3e')][0x0][_0x088c('0x3f')]:undefined)||''}];case _0x088c('0x42'):return[{'name':_0x088c('0x43'),'value':_0x1c45d8[_0x088c('0x43')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8[_0x088c('0x3e')][0x0][_0x088c('0x3f')]:undefined)||_0x088c('0x44')},{'name':'attrTimezone','value':_0x1c45d8[_0x088c('0x45')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x1]?_0x1c45d8[_0x088c('0x3e')][0x1][_0x088c('0x3f')]:undefined)||_0x088c('0x46')},{'name':_0x088c('0x47'),'value':_0x1c45d8[_0x088c('0x47')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x2]?_0x1c45d8['attrs'][0x2][_0x088c('0x3f')]:undefined)||0xc}];case _0x088c('0x48'):return[{'name':_0x088c('0x49'),'value':_0x1c45d8['attrMetric']||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8[_0x088c('0x3e')][0x0][_0x088c('0x3f')]:undefined)||_0x088c('0x4a')},{'name':_0x088c('0x4b'),'value':_0x1c45d8[_0x088c('0x4b')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x1]?_0x1c45d8[_0x088c('0x3e')][0x1][_0x088c('0x3f')]:undefined)||[]},{'name':_0x088c('0x47'),'value':_0x1c45d8[_0x088c('0x47')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8['attrs'][0x2]?_0x1c45d8['attrs'][0x2]['value']:undefined)||0x14}];case _0x088c('0x4c'):case _0x088c('0x4d'):return[{'name':_0x088c('0x4e'),'value':_0x1c45d8[_0x088c('0x4e')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8['attrs'][0x0]?_0x1c45d8['attrs'][0x0][_0x088c('0x3f')]:undefined)||_0x088c('0x4a')},{'name':_0x088c('0x4f'),'value':_0x1c45d8[_0x088c('0x4f')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x1]?_0x1c45d8['attrs'][0x1][_0x088c('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x1c45d8['attrSerie3']||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8['attrs'][0x2]?_0x1c45d8['attrs'][0x2][_0x088c('0x3f')]:undefined)||null},{'name':_0x088c('0x4b'),'value':_0x1c45d8[_0x088c('0x4b')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8['attrs'][0x3]?_0x1c45d8[_0x088c('0x3e')][0x3][_0x088c('0x3f')]:undefined)||[]}];case _0x088c('0x50'):return[{'name':_0x088c('0x51'),'type':_0x1c45d8[_0x088c('0x52')]||(_0x1c45d8['attrs']&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8['attrs'][0x0][_0x088c('0x53')]:undefined)||null,'value':_0x1c45d8[_0x088c('0x51')]||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x0]?_0x1c45d8[_0x088c('0x3e')][0x0][_0x088c('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x1c45d8['attrRefresh']||(_0x1c45d8[_0x088c('0x3e')]&&_0x1c45d8[_0x088c('0x3e')][0x1]?_0x1c45d8[_0x088c('0x3e')][0x1][_0x088c('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5cf928){logger[_0x088c('0x54')](_0x088c('0x55'),JSON['stringify'](_0x5cf928));return[];}}exports['create']=function(_0x4b74e2,_0x3dfbb1){if(_0x4b74e2[_0x088c('0x56')]){_0x4b74e2[_0x088c('0x56')]['attrs']=widgetAttributes(_0x4b74e2[_0x088c('0x56')]);}return db[_0x088c('0x33')][_0x088c('0x57')](_0x4b74e2[_0x088c('0x56')],{})['then'](respondWithResult(_0x3dfbb1,0xc9))[_0x088c('0x3c')](handleError(_0x3dfbb1,null));};exports[_0x088c('0x28')]=function(_0x404b02,_0x38efb5){if(_0x404b02[_0x088c('0x56')]['id']){delete _0x404b02['body']['id'];}_0x404b02[_0x088c('0x56')][_0x088c('0x3e')]=widgetAttributes(_0x404b02[_0x088c('0x56')]);return db[_0x088c('0x33')][_0x088c('0x3d')]({'where':{'id':_0x404b02[_0x088c('0x30')]['id']}})[_0x088c('0x29')](handleEntityNotFound(_0x38efb5,null))[_0x088c('0x29')](saveUpdates(_0x404b02[_0x088c('0x56')],null))['then'](respondWithResult(_0x38efb5,null))[_0x088c('0x3c')](handleError(_0x38efb5,null));}; \ No newline at end of file +var _0xfa38=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','error','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','merge','options','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrTimezone','attrFontSize','counter','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x56ffc2,_0x2b8979){var _0x9137d2=function(_0x3af9d8){while(--_0x3af9d8){_0x56ffc2['push'](_0x56ffc2['shift']());}};_0x9137d2(++_0x2b8979);}(_0xfa38,0x97));var _0x8fa3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa38[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x8fa3('0x0'));var rimraf=require(_0x8fa3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8fa3('0x2'));var moment=require(_0x8fa3('0x3'));var BPromise=require(_0x8fa3('0x4'));var Mustache=require(_0x8fa3('0x5'));var util=require('util');var path=require(_0x8fa3('0x6'));var sox=require(_0x8fa3('0x7'));var csv=require(_0x8fa3('0x8'));var ejs=require(_0x8fa3('0x9'));var fs=require('fs');var fs_extra=require(_0x8fa3('0xa'));var _=require(_0x8fa3('0xb'));var squel=require(_0x8fa3('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fa3('0xd'));var deskjs=require(_0x8fa3('0xe'));var toCsv=require(_0x8fa3('0x8'));var querystring=require(_0x8fa3('0xf'));var Papa=require(_0x8fa3('0x10'));var Redis=require(_0x8fa3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8fa3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fa3('0x13'));var logger=require('../../config/logger')(_0x8fa3('0x14'));var utils=require(_0x8fa3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8fa3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8fa3('0x17')](config[_0x8fa3('0x18')],{'host':_0x8fa3('0x19'),'port':0x18eb});var socket=require(_0x8fa3('0x1a'))(new Redis(config[_0x8fa3('0x18')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x1a5db0,_0x39e528){_0x39e528=_0x39e528||0xcc;return function(_0x43c8d3){if(_0x43c8d3){return _0x1a5db0[_0x8fa3('0x1b')](_0x39e528);}return _0x1a5db0[_0x8fa3('0x1c')](_0x39e528)[_0x8fa3('0x1d')]();};}function respondWithResult(_0x3cae50,_0x1d438d){_0x1d438d=_0x1d438d||0xc8;return function(_0x16e97e){if(_0x16e97e){return _0x3cae50['status'](_0x1d438d)[_0x8fa3('0x1e')](_0x16e97e);}};}function respondWithFilteredResult(_0x2b8b92,_0x44340c){return function(_0x7027e4){if(_0x7027e4){var _0x406eee=typeof _0x44340c[_0x8fa3('0x1f')]==='undefined'&&typeof _0x44340c['limit']===_0x8fa3('0x20');var _0x47347e=_0x7027e4[_0x8fa3('0x21')];var _0x256f5a=_0x406eee?0x0:_0x44340c[_0x8fa3('0x1f')];var _0x19c024=_0x406eee?_0x7027e4['count']:_0x44340c['offset']+_0x44340c['limit'];var _0x518501;if(_0x19c024>=_0x47347e){_0x19c024=_0x47347e;_0x518501=0xc8;}else{_0x518501=0xce;}_0x2b8b92['status'](_0x518501);return _0x2b8b92[_0x8fa3('0x22')](_0x8fa3('0x23'),_0x256f5a+'-'+_0x19c024+'/'+_0x47347e)[_0x8fa3('0x1e')](_0x7027e4);}return null;};}function patchUpdates(_0x4494b9){return function(_0x2b5122){try{jsonpatch['apply'](_0x2b5122,_0x4494b9,!![]);}catch(_0x3009ff){return BPromise['reject'](_0x3009ff);}return _0x2b5122['save']();};}function saveUpdates(_0x139383,_0x5a43a8){return function(_0x23b266){if(_0x23b266){return _0x23b266[_0x8fa3('0x24')](_0x139383)[_0x8fa3('0x25')](function(_0xa652ab){return _0xa652ab;});}return null;};}function removeEntity(_0x28b8ef,_0x27b95c){return function(_0x51788e){if(_0x51788e){return _0x51788e['destroy']()['then'](function(){_0x28b8ef[_0x8fa3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1a5e,_0x424d09){return function(_0x1902ba){if(!_0x1902ba){_0x4e1a5e[_0x8fa3('0x1b')](0x194);}return _0x1902ba;};}function handleError(_0x1768a1,_0x23c684){_0x23c684=_0x23c684||0x1f4;return function(_0x34762b){logger[_0x8fa3('0x26')](_0x34762b['stack']);if(_0x34762b[_0x8fa3('0x27')]){delete _0x34762b[_0x8fa3('0x27')];}_0x1768a1[_0x8fa3('0x1c')](_0x23c684)[_0x8fa3('0x28')](_0x34762b);};}exports[_0x8fa3('0x29')]=function(_0x506cee,_0x42dd6e){var _0x4b1a5d={'raw':![],'where':{'id':_0x506cee[_0x8fa3('0x2a')]['id']}},_0x5e4017={};_0x5e4017['model']=_[_0x8fa3('0x2b')](db[_0x8fa3('0x2c')][_0x8fa3('0x2d')]);_0x5e4017[_0x8fa3('0x2e')]=_[_0x8fa3('0x2b')](_0x506cee[_0x8fa3('0x2e')]);_0x5e4017[_0x8fa3('0x2f')]=_[_0x8fa3('0x30')](_0x5e4017[_0x8fa3('0x31')],_0x5e4017[_0x8fa3('0x2e')]);_0x4b1a5d['attributes']=_[_0x8fa3('0x30')](_0x5e4017[_0x8fa3('0x31')],qs[_0x8fa3('0x32')](_0x506cee[_0x8fa3('0x2e')][_0x8fa3('0x32')]));_0x4b1a5d[_0x8fa3('0x33')]=_0x4b1a5d[_0x8fa3('0x33')]['length']?_0x4b1a5d['attributes']:_0x5e4017[_0x8fa3('0x31')];if(_0x506cee[_0x8fa3('0x2e')][_0x8fa3('0x34')]){_0x4b1a5d[_0x8fa3('0x35')]=[{'all':!![]}];}_0x4b1a5d=_[_0x8fa3('0x36')]({},_0x4b1a5d,_0x506cee[_0x8fa3('0x37')]);return db[_0x8fa3('0x2c')]['find'](_0x4b1a5d)['then'](handleEntityNotFound(_0x42dd6e,null))['then'](respondWithResult(_0x42dd6e,null))[_0x8fa3('0x38')](handleError(_0x42dd6e,null));};exports[_0x8fa3('0x39')]=function(_0x5bc17a,_0x54e525){return db['DashboardItem']['find']({'where':{'id':_0x5bc17a[_0x8fa3('0x2a')]['id']}})[_0x8fa3('0x25')](handleEntityNotFound(_0x54e525,null))[_0x8fa3('0x25')](removeEntity(_0x54e525,null))[_0x8fa3('0x38')](handleError(_0x54e525,null));};function widgetAttributes(_0x1296a0){try{switch(_0x1296a0[_0x8fa3('0x3a')]){case _0x8fa3('0x3b'):return[{'name':_0x8fa3('0x3c'),'value':_0x1296a0[_0x8fa3('0x3c')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x0]?_0x1296a0[_0x8fa3('0x3d')][0x0][_0x8fa3('0x3e')]:undefined)||_0x8fa3('0x3f')}];case _0x8fa3('0x40'):return[{'name':'attrPath','value':_0x1296a0[_0x8fa3('0x41')]||(_0x1296a0['attrs']&&_0x1296a0[_0x8fa3('0x3d')][0x0]?_0x1296a0[_0x8fa3('0x3d')][0x0][_0x8fa3('0x3e')]:undefined)||''}];case _0x8fa3('0x42'):return[{'name':'attrHourFormat','value':_0x1296a0['attrHourFormat']||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x0]?_0x1296a0[_0x8fa3('0x3d')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x8fa3('0x43'),'value':_0x1296a0[_0x8fa3('0x43')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x1]?_0x1296a0[_0x8fa3('0x3d')][0x1]['value']:undefined)||'0.00'},{'name':_0x8fa3('0x44'),'value':_0x1296a0[_0x8fa3('0x44')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0['attrs'][0x2]?_0x1296a0['attrs'][0x2][_0x8fa3('0x3e')]:undefined)||0xc}];case _0x8fa3('0x45'):return[{'name':'attrMetric','value':_0x1296a0['attrMetric']||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x0]?_0x1296a0[_0x8fa3('0x3d')][0x0][_0x8fa3('0x3e')]:undefined)||'total'},{'name':_0x8fa3('0x46'),'value':_0x1296a0['attrVoiceQueues']||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x1]?_0x1296a0[_0x8fa3('0x3d')][0x1][_0x8fa3('0x3e')]:undefined)||[]},{'name':_0x8fa3('0x44'),'value':_0x1296a0[_0x8fa3('0x44')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x2]?_0x1296a0[_0x8fa3('0x3d')][0x2][_0x8fa3('0x3e')]:undefined)||0x14}];case _0x8fa3('0x47'):case _0x8fa3('0x48'):return[{'name':_0x8fa3('0x49'),'value':_0x1296a0[_0x8fa3('0x49')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0['attrs'][0x0]?_0x1296a0['attrs'][0x0][_0x8fa3('0x3e')]:undefined)||'total'},{'name':'attrSerie2','value':_0x1296a0[_0x8fa3('0x4a')]||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x1]?_0x1296a0[_0x8fa3('0x3d')][0x1][_0x8fa3('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x1296a0['attrSerie3']||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0['attrs'][0x2]?_0x1296a0[_0x8fa3('0x3d')][0x2][_0x8fa3('0x3e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1296a0['attrVoiceQueues']||(_0x1296a0[_0x8fa3('0x3d')]&&_0x1296a0[_0x8fa3('0x3d')][0x3]?_0x1296a0[_0x8fa3('0x3d')][0x3][_0x8fa3('0x3e')]:undefined)||[]}];case _0x8fa3('0x4b'):return[{'name':_0x8fa3('0x4c'),'type':_0x1296a0[_0x8fa3('0x4d')]||(_0x1296a0['attrs']&&_0x1296a0['attrs'][0x0]?_0x1296a0['attrs'][0x0]['type']:undefined)||null,'value':_0x1296a0['attrReport']||(_0x1296a0['attrs']&&_0x1296a0['attrs'][0x0]?_0x1296a0['attrs'][0x0]['value']:undefined)||null},{'name':_0x8fa3('0x4e'),'value':_0x1296a0['attrRefresh']||(_0x1296a0['attrs']&&_0x1296a0[_0x8fa3('0x3d')][0x1]?_0x1296a0['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x434b53){logger[_0x8fa3('0x26')]('widgetAttributes:\x20%s',JSON['stringify'](_0x434b53));return[];}}exports[_0x8fa3('0x4f')]=function(_0x32b9e7,_0x3b40c8){if(_0x32b9e7[_0x8fa3('0x50')]){_0x32b9e7[_0x8fa3('0x50')]['attrs']=widgetAttributes(_0x32b9e7[_0x8fa3('0x50')]);}return db[_0x8fa3('0x2c')]['create'](_0x32b9e7[_0x8fa3('0x50')],{})['then'](respondWithResult(_0x3b40c8,0xc9))[_0x8fa3('0x38')](handleError(_0x3b40c8,null));};exports['update']=function(_0x20cef,_0x5164fb){if(_0x20cef[_0x8fa3('0x50')]['id']){delete _0x20cef['body']['id'];}_0x20cef['body']['attrs']=widgetAttributes(_0x20cef[_0x8fa3('0x50')]);return db['DashboardItem'][_0x8fa3('0x51')]({'where':{'id':_0x20cef[_0x8fa3('0x2a')]['id']}})[_0x8fa3('0x25')](handleEntityNotFound(_0x5164fb,null))[_0x8fa3('0x25')](saveUpdates(_0x20cef[_0x8fa3('0x50')],null))[_0x8fa3('0x25')](respondWithResult(_0x5164fb,null))[_0x8fa3('0x38')](handleError(_0x5164fb,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2ea4f01..b9f43f8 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 _0x041d=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4ebdf4,_0x57d47f){var _0x18d1c1=function(_0x83f2a0){while(--_0x83f2a0){_0x4ebdf4['push'](_0x4ebdf4['shift']());}};_0x18d1c1(++_0x57d47f);}(_0x041d,0x185));var _0xd041=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x041d[_0x1203f];return _0x365f0a;};'use strict';var EventEmitter=require(_0xd041('0x0'));var DashboardItem=require(_0xd041('0x1'))['db'][_0xd041('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd041('0x3')](0x0);var events={'afterCreate':_0xd041('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13f3f5){return function(_0x5bde89,_0x14fff8,_0x4573c7){DashboardItemEvents['emit'](_0x13f3f5+':'+_0x5bde89['id'],_0x5bde89);DashboardItemEvents[_0xd041('0x5')](_0x13f3f5,_0x5bde89);_0x4573c7(null);};}for(var e in events){if(events[_0xd041('0x6')](e)){var event=events[e];DashboardItem[_0xd041('0x7')](e,emitEvent(event));}}module[_0xd041('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x71db=['events','../../mysqldb','update','emit','hasOwnProperty','hook','exports'];(function(_0x5d793d,_0x1b151a){var _0x25716e=function(_0x3effd0){while(--_0x3effd0){_0x5d793d['push'](_0x5d793d['shift']());}};_0x25716e(++_0x1b151a);}(_0x71db,0xee));var _0xb71d=function(_0x44feb5,_0x3f7964){_0x44feb5=_0x44feb5-0x0;var _0x45e3b8=_0x71db[_0x44feb5];return _0x45e3b8;};'use strict';var EventEmitter=require(_0xb71d('0x0'));var DashboardItem=require(_0xb71d('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb71d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4aa961){return function(_0x4302c3,_0x150ca2,_0x5cfc7e){DashboardItemEvents[_0xb71d('0x3')](_0x4aa961+':'+_0x4302c3['id'],_0x4302c3);DashboardItemEvents[_0xb71d('0x3')](_0x4aa961,_0x4302c3);_0x5cfc7e(null);};}for(var e in events){if(events[_0xb71d('0x4')](e)){var event=events[e];DashboardItem[_0xb71d('0x5')](e,emitEvent(event));}}module[_0xb71d('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b3c9e2b..5bc4614 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 _0x0637=['bluebird','request-promise','path','./dashboardItem.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x0637,0x7e));var _0x7063=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0637[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7063('0x0'));var util=require('util');var logger=require(_0x7063('0x1'))(_0x7063('0x2'));var moment=require(_0x7063('0x3'));var BPromise=require(_0x7063('0x4'));var rp=require(_0x7063('0x5'));var fs=require('fs');var path=require(_0x7063('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7063('0x7'));module[_0x7063('0x8')]=function(_0x4b8552,_0x11e9f){return _0x4b8552[_0x7063('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81e2=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','DashboardItem','dashboard_items','lodash','util'];(function(_0x465716,_0x34cdc6){var _0x59e6a3=function(_0x27a7ef){while(--_0x27a7ef){_0x465716['push'](_0x465716['shift']());}};_0x59e6a3(++_0x34cdc6);}(_0x81e2,0x1c1));var _0x281e=function(_0x583218,_0x35f235){_0x583218=_0x583218-0x0;var _0x5bf253=_0x81e2[_0x583218];return _0x5bf253;};'use strict';var _=require(_0x281e('0x0'));var util=require(_0x281e('0x1'));var logger=require(_0x281e('0x2'))('api');var moment=require(_0x281e('0x3'));var BPromise=require('bluebird');var rp=require(_0x281e('0x4'));var fs=require('fs');var path=require(_0x281e('0x5'));var rimraf=require(_0x281e('0x6'));var config=require(_0x281e('0x7'));var attributes=require(_0x281e('0x8'));module['exports']=function(_0x43a586,_0x8f5860){return _0x43a586['define'](_0x281e('0x9'),attributes,{'tableName':_0x281e('0xa'),'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 9706c09..62ae192 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 _0xb9f9=['stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0xb9f9,0x7f));var _0x9b9f=function(_0x1faf57,_0x1587b5){_0x1faf57=_0x1faf57-0x0;var _0x1957ae=_0xb9f9[_0x1faf57];return _0x1957ae;};'use strict';var _=require(_0x9b9f('0x0'));var util=require(_0x9b9f('0x1'));var moment=require('moment');var BPromise=require(_0x9b9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b9f('0x3'));var logger=require(_0x9b9f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9b9f('0x5'));var client=jayson['client'][_0x9b9f('0x6')]({'port':0x232a});config[_0x9b9f('0x7')]=_[_0x9b9f('0x8')](config[_0x9b9f('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b9f('0x7')]));require(_0x9b9f('0x9'))[_0x9b9f('0xa')](socket);function respondWithRpcPromise(_0x5d838a,_0x5da33b,_0x1ab80e){return new BPromise(function(_0x2accac,_0x444f32){return client[_0x9b9f('0xb')](_0x5d838a,_0x1ab80e)[_0x9b9f('0xc')](function(_0x29e57d){logger['info'](_0x9b9f('0xd'),_0x5da33b,_0x9b9f('0xe'));logger[_0x9b9f('0xf')](_0x9b9f('0x10'),_0x5da33b,_0x9b9f('0xe'),JSON[_0x9b9f('0x11')](_0x29e57d));if(_0x29e57d[_0x9b9f('0x12')]){if(_0x29e57d[_0x9b9f('0x12')][_0x9b9f('0x13')]===0x1f4){logger['error'](_0x9b9f('0xd'),_0x5da33b,_0x29e57d[_0x9b9f('0x12')][_0x9b9f('0x14')]);return _0x444f32(_0x29e57d[_0x9b9f('0x12')]['message']);}logger[_0x9b9f('0x12')](_0x9b9f('0xd'),_0x5da33b,_0x29e57d['error'][_0x9b9f('0x14')]);return _0x2accac(_0x29e57d[_0x9b9f('0x12')][_0x9b9f('0x14')]);}else{logger[_0x9b9f('0x15')]('DashboardItem,\x20%s,\x20%s',_0x5da33b,_0x9b9f('0xe'));_0x2accac(_0x29e57d[_0x9b9f('0x16')][_0x9b9f('0x14')]);}})[_0x9b9f('0x17')](function(_0x280265){logger[_0x9b9f('0x12')](_0x9b9f('0xd'),_0x5da33b,_0x280265);_0x444f32(_0x280265);});});} \ No newline at end of file +var _0x6ea7=['stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x54e3be,_0x753e4d){var _0x3f4f75=function(_0x5af579){while(--_0x5af579){_0x54e3be['push'](_0x54e3be['shift']());}};_0x3f4f75(++_0x753e4d);}(_0x6ea7,0xe6));var _0x76ea=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6ea7[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x76ea('0x0'));var util=require(_0x76ea('0x1'));var moment=require(_0x76ea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76ea('0x3'));var db=require(_0x76ea('0x4'))['db'];var utils=require(_0x76ea('0x5'));var logger=require(_0x76ea('0x6'))(_0x76ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x76ea('0x8'));var client=jayson[_0x76ea('0x9')][_0x76ea('0xa')]({'port':0x232a});config[_0x76ea('0xb')]=_[_0x76ea('0xc')](config[_0x76ea('0xb')],{'host':_0x76ea('0xd'),'port':0x18eb});var socket=require(_0x76ea('0xe'))(new Redis(config['redis']));require(_0x76ea('0xf'))[_0x76ea('0x10')](socket);function respondWithRpcPromise(_0x6bf2c0,_0x24bd80,_0x4e9dd7){return new BPromise(function(_0x65e7eb,_0x5dc949){return client[_0x76ea('0x11')](_0x6bf2c0,_0x4e9dd7)['then'](function(_0x24b420){logger[_0x76ea('0x12')](_0x76ea('0x13'),_0x24bd80,_0x76ea('0x14'));logger[_0x76ea('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x24bd80,_0x76ea('0x14'),JSON[_0x76ea('0x16')](_0x24b420));if(_0x24b420[_0x76ea('0x17')]){if(_0x24b420[_0x76ea('0x17')][_0x76ea('0x18')]===0x1f4){logger[_0x76ea('0x17')]('DashboardItem,\x20%s,\x20%s',_0x24bd80,_0x24b420[_0x76ea('0x17')][_0x76ea('0x19')]);return _0x5dc949(_0x24b420[_0x76ea('0x17')][_0x76ea('0x19')]);}logger[_0x76ea('0x17')](_0x76ea('0x13'),_0x24bd80,_0x24b420[_0x76ea('0x17')][_0x76ea('0x19')]);return _0x65e7eb(_0x24b420[_0x76ea('0x17')]['message']);}else{logger[_0x76ea('0x12')](_0x76ea('0x13'),_0x24bd80,_0x76ea('0x14'));_0x65e7eb(_0x24b420[_0x76ea('0x1a')][_0x76ea('0x19')]);}})[_0x76ea('0x1b')](function(_0x133bab){logger[_0x76ea('0x17')](_0x76ea('0x13'),_0x24bd80,_0x133bab);_0x5dc949(_0x133bab);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 447a4ee..21ceac5 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 _0xf539=['length','dashboardItem:','./dashboardItem.events','save','emit','removeListener','register'];(function(_0x409650,_0x22d369){var _0x58292b=function(_0x1d592d){while(--_0x1d592d){_0x409650['push'](_0x409650['shift']());}};_0x58292b(++_0x22d369);}(_0xf539,0x1d0));var _0x9f53=function(_0x253d23,_0x1c1a69){_0x253d23=_0x253d23-0x0;var _0x34a6f6=_0xf539[_0x253d23];return _0x34a6f6;};'use strict';var DashboardItemEvents=require(_0x9f53('0x0'));var events=[_0x9f53('0x1'),'remove','update'];function createListener(_0x26c013,_0xccda0d){return function(_0x562935){_0xccda0d[_0x9f53('0x2')](_0x26c013,_0x562935);};}function removeListener(_0x489e8c,_0x1a1d74){return function(){DashboardItemEvents[_0x9f53('0x3')](_0x489e8c,_0x1a1d74);};}exports[_0x9f53('0x4')]=function(_0x590b1e){for(var _0x2dd885=0x0,_0x3235cd=events[_0x9f53('0x5')];_0x2dd885<_0x3235cd;_0x2dd885++){var _0x43cfb8=events[_0x2dd885];var _0x29829a=createListener(_0x9f53('0x6')+_0x43cfb8,_0x590b1e);DashboardItemEvents['on'](_0x43cfb8,_0x29829a);}}; \ No newline at end of file +var _0x7ae7=['update','removeListener','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x57ee40,_0xf4324b){var _0x1ae60d=function(_0x248ef1){while(--_0x248ef1){_0x57ee40['push'](_0x57ee40['shift']());}};_0x1ae60d(++_0xf4324b);}(_0x7ae7,0x14e));var _0x77ae=function(_0x3c9c23,_0x2ba2ac){_0x3c9c23=_0x3c9c23-0x0;var _0x1bc438=_0x7ae7[_0x3c9c23];return _0x1bc438;};'use strict';var DashboardItemEvents=require(_0x77ae('0x0'));var events=[_0x77ae('0x1'),'remove',_0x77ae('0x2')];function createListener(_0x26337c,_0xf18028){return function(_0x1c87c4){_0xf18028['emit'](_0x26337c,_0x1c87c4);};}function removeListener(_0x2192a4,_0x50b18c){return function(){DashboardItemEvents[_0x77ae('0x3')](_0x2192a4,_0x50b18c);};}exports['register']=function(_0x4b51c2){for(var _0xcb43e5=0x0,_0xbf765=events[_0x77ae('0x4')];_0xcb43e5<_0xbf765;_0xcb43e5++){var _0x2ce71f=events[_0xcb43e5];var _0x2476ba=createListener(_0x77ae('0x5')+_0x2ce71f,_0x4b51c2);DashboardItemEvents['on'](_0x2ce71f,_0x2476ba);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 67bc4fb..0f2e030 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 _0x5844=['/:id','isAuthenticated','show','create','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x186891,_0xb3e1a7){var _0x391b36=function(_0x30bc65){while(--_0x30bc65){_0x186891['push'](_0x186891['shift']());}};_0x391b36(++_0xb3e1a7);}(_0x5844,0x157));var _0x4584=function(_0x426716,_0x3e56cc){_0x426716=_0x426716-0x0;var _0x23dbda=_0x5844[_0x426716];return _0x23dbda;};'use strict';var multer=require(_0x4584('0x0'));var util=require(_0x4584('0x1'));var path=require('path');var timeout=require(_0x4584('0x2'));var express=require(_0x4584('0x3'));var router=express['Router']();var fs_extra=require(_0x4584('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4584('0x5'));var config=require(_0x4584('0x6'));var controller=require(_0x4584('0x7'));router[_0x4584('0x8')](_0x4584('0x9'),auth[_0x4584('0xa')](),controller[_0x4584('0xb')]);router['post']('/',auth[_0x4584('0xa')](),controller[_0x4584('0xc')]);router[_0x4584('0xd')](_0x4584('0x9'),auth[_0x4584('0xa')](),controller['update']);router[_0x4584('0xe')](_0x4584('0x9'),auth[_0x4584('0xa')](),controller['destroy']);module[_0x4584('0xf')]=router; \ No newline at end of file +var _0x6119=['get','/:id','isAuthenticated','show','post','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x6119,0x1e5));var _0x9611=function(_0x229e6f,_0x230ff7){_0x229e6f=_0x229e6f-0x0;var _0x4caa30=_0x6119[_0x229e6f];return _0x4caa30;};'use strict';var multer=require('multer');var util=require(_0x9611('0x0'));var path=require(_0x9611('0x1'));var timeout=require(_0x9611('0x2'));var express=require('express');var router=express[_0x9611('0x3')]();var fs_extra=require(_0x9611('0x4'));var auth=require(_0x9611('0x5'));var interaction=require(_0x9611('0x6'));var config=require(_0x9611('0x7'));var controller=require('./dashboardItem.controller');router[_0x9611('0x8')](_0x9611('0x9'),auth[_0x9611('0xa')](),controller[_0x9611('0xb')]);router[_0x9611('0xc')]('/',auth[_0x9611('0xa')](),controller['create']);router['put'](_0x9611('0x9'),auth[_0x9611('0xa')](),controller[_0x9611('0xd')]);router[_0x9611('0xe')]('/:id',auth[_0x9611('0xa')](),controller[_0x9611('0xf')]);module[_0x9611('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d208174..001de5b 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 _0x2896=['second','third','sequelize','STRING','ENUM','first'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2896,0x1c4));var _0x6289=function(_0x126ddf,_0x4be360){_0x126ddf=_0x126ddf-0x0;var _0x187349=_0x2896[_0x126ddf];return _0x187349;};'use strict';var Sequelize=require(_0x6289('0x0'));module['exports']={'name':{'type':Sequelize[_0x6289('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x6289('0x2')](_0x6289('0x3'),_0x6289('0x4'),_0x6289('0x5')),'allowNull':![],'defaultValue':_0x6289('0x3')},'description':{'type':Sequelize[_0x6289('0x1')]}}; \ No newline at end of file +var _0x0b2b=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x58e1b0,_0x64e502){var _0x321c27=function(_0x5df3e0){while(--_0x5df3e0){_0x58e1b0['push'](_0x58e1b0['shift']());}};_0x321c27(++_0x64e502);}(_0x0b2b,0x117));var _0xb0b2=function(_0x4325e6,_0x23dcc9){_0x4325e6=_0x4325e6-0x0;var _0x4b9d0c=_0x0b2b[_0x4325e6];return _0x4b9d0c;};'use strict';var Sequelize=require(_0xb0b2('0x0'));module[_0xb0b2('0x1')]={'name':{'type':Sequelize[_0xb0b2('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xb0b2('0x3')](_0xb0b2('0x4'),_0xb0b2('0x5'),_0xb0b2('0x6')),'allowNull':![],'defaultValue':_0xb0b2('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 ca6b123..cafac1b 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 _0xc7e1=['where','VIRTUAL','filter','options','include','catch','show','params','includeAll','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge'];(function(_0x463994,_0x4df18c){var _0x561d3f=function(_0x2759db){while(--_0x2759db){_0x463994['push'](_0x463994['shift']());}};_0x561d3f(++_0x4df18c);}(_0xc7e1,0x15d));var _0x1c7e=function(_0x91e602,_0x5cf351){_0x91e602=_0x91e602-0x0;var _0x2cb42d=_0xc7e1[_0x91e602];return _0x2cb42d;};'use strict';var emlformat=require(_0x1c7e('0x0'));var rimraf=require(_0x1c7e('0x1'));var zipdir=require(_0x1c7e('0x2'));var jsonpatch=require(_0x1c7e('0x3'));var rp=require(_0x1c7e('0x4'));var moment=require(_0x1c7e('0x5'));var BPromise=require(_0x1c7e('0x6'));var Mustache=require('mustache');var util=require(_0x1c7e('0x7'));var path=require(_0x1c7e('0x8'));var sox=require(_0x1c7e('0x9'));var csv=require(_0x1c7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c7e('0xb'));var _=require(_0x1c7e('0xc'));var squel=require(_0x1c7e('0xd'));var crypto=require('crypto');var jsforce=require(_0x1c7e('0xe'));var deskjs=require(_0x1c7e('0xf'));var toCsv=require(_0x1c7e('0xa'));var querystring=require(_0x1c7e('0x10'));var Papa=require(_0x1c7e('0x11'));var Redis=require(_0x1c7e('0x12'));var authService=require(_0x1c7e('0x13'));var qs=require(_0x1c7e('0x14'));var as=require(_0x1c7e('0x15'));var hardwareService=require(_0x1c7e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1c7e('0x17'));var config=require(_0x1c7e('0x18'));var licenseUtil=require(_0x1c7e('0x19'));var db=require(_0x1c7e('0x1a'))['db'];function respondWithStatusCode(_0x3a5480,_0x58fa67){_0x58fa67=_0x58fa67||0xcc;return function(_0x2cee5e){if(_0x2cee5e){return _0x3a5480[_0x1c7e('0x1b')](_0x58fa67);}return _0x3a5480[_0x1c7e('0x1c')](_0x58fa67)[_0x1c7e('0x1d')]();};}function respondWithResult(_0x5db1d0,_0x350a5a){_0x350a5a=_0x350a5a||0xc8;return function(_0x2e6f9e){if(_0x2e6f9e){return _0x5db1d0[_0x1c7e('0x1c')](_0x350a5a)[_0x1c7e('0x1e')](_0x2e6f9e);}};}function respondWithFilteredResult(_0x24fe6d,_0x3ad177){return function(_0x47ab29){if(_0x47ab29){var _0x3bbc76=typeof _0x3ad177['offset']===_0x1c7e('0x1f')&&typeof _0x3ad177[_0x1c7e('0x20')]===_0x1c7e('0x1f');var _0x8c4d3a=_0x47ab29['count'];var _0x1d21ee=_0x3bbc76?0x0:_0x3ad177[_0x1c7e('0x21')];var _0x109e09=_0x3bbc76?_0x47ab29[_0x1c7e('0x22')]:_0x3ad177[_0x1c7e('0x21')]+_0x3ad177['limit'];var _0x21566e;if(_0x109e09>=_0x8c4d3a){_0x109e09=_0x8c4d3a;_0x21566e=0xc8;}else{_0x21566e=0xce;}_0x24fe6d[_0x1c7e('0x1c')](_0x21566e);return _0x24fe6d[_0x1c7e('0x23')](_0x1c7e('0x24'),_0x1d21ee+'-'+_0x109e09+'/'+_0x8c4d3a)[_0x1c7e('0x1e')](_0x47ab29);}return null;};}function patchUpdates(_0x329509){return function(_0x2e117b){try{jsonpatch[_0x1c7e('0x25')](_0x2e117b,_0x329509,!![]);}catch(_0x56498a){return BPromise['reject'](_0x56498a);}return _0x2e117b[_0x1c7e('0x26')]();};}function saveUpdates(_0x4106b4,_0x22aedf){return function(_0x5983c9){if(_0x5983c9){return _0x5983c9['update'](_0x4106b4)[_0x1c7e('0x27')](function(_0x5eeeba){return _0x5eeeba;});}return null;};}function removeEntity(_0xe5cb4d,_0x5e53f2){return function(_0x42a7e4){if(_0x42a7e4){return _0x42a7e4['destroy']()[_0x1c7e('0x27')](function(){var _0x299662=_0x42a7e4[_0x1c7e('0x28')]({'plain':!![]});var _0x30c4ff=_0x1c7e('0x29');return db[_0x1c7e('0x2a')]['destroy']({'where':{'type':_0x30c4ff,'resourceId':_0x299662['id']}})[_0x1c7e('0x27')](function(){return _0x42a7e4;});})[_0x1c7e('0x27')](function(){_0xe5cb4d[_0x1c7e('0x1c')](0xcc)[_0x1c7e('0x1d')]();});}};}function handleEntityNotFound(_0x15169f,_0x30f207){return function(_0x10c388){if(!_0x10c388){_0x15169f['sendStatus'](0x194);}return _0x10c388;};}function handleError(_0x4879c9,_0x4eba2f){_0x4eba2f=_0x4eba2f||0x1f4;return function(_0xb6a4cf){logger[_0x1c7e('0x2b')](_0xb6a4cf['stack']);if(_0xb6a4cf[_0x1c7e('0x2c')]){delete _0xb6a4cf['name'];}_0x4879c9[_0x1c7e('0x1c')](_0x4eba2f)[_0x1c7e('0x2d')](_0xb6a4cf);};}exports[_0x1c7e('0x2e')]=function(_0x4f7236,_0x18d0ca){var _0x3f6091={},_0x4b82c1={},_0x3d3c06={'count':0x0,'rows':[]};var _0x34d65a=_[_0x1c7e('0x2f')](db[_0x1c7e('0x30')][_0x1c7e('0x31')],function(_0x3e52ff){return{'name':_0x3e52ff['fieldName'],'type':_0x3e52ff[_0x1c7e('0x32')][_0x1c7e('0x33')]};});_0x4b82c1[_0x1c7e('0x34')]=_[_0x1c7e('0x2f')](_0x34d65a,_0x1c7e('0x2c'));_0x4b82c1[_0x1c7e('0x35')]=_[_0x1c7e('0x36')](_0x4f7236[_0x1c7e('0x35')]);_0x4b82c1[_0x1c7e('0x37')]=_[_0x1c7e('0x38')](_0x4b82c1['model'],_0x4b82c1[_0x1c7e('0x35')]);_0x3f6091[_0x1c7e('0x39')]=_[_0x1c7e('0x38')](_0x4b82c1['model'],qs['fields'](_0x4f7236[_0x1c7e('0x35')][_0x1c7e('0x3a')]));_0x3f6091['attributes']=_0x3f6091[_0x1c7e('0x39')][_0x1c7e('0x3b')]?_0x3f6091[_0x1c7e('0x39')]:_0x4b82c1['model'];if(!_0x4f7236['query'][_0x1c7e('0x3c')](_0x1c7e('0x3d'))){_0x3f6091['limit']=qs[_0x1c7e('0x20')](_0x4f7236['query'][_0x1c7e('0x20')]);_0x3f6091[_0x1c7e('0x21')]=qs[_0x1c7e('0x21')](_0x4f7236[_0x1c7e('0x35')]['offset']);}_0x3f6091[_0x1c7e('0x3e')]=qs['sort'](_0x4f7236[_0x1c7e('0x35')][_0x1c7e('0x3f')]);_0x3f6091['where']=qs[_0x1c7e('0x37')](_[_0x1c7e('0x40')](_0x4f7236['query'],_0x4b82c1[_0x1c7e('0x37')]),_0x34d65a);if(_0x4f7236[_0x1c7e('0x35')]['filter']){_0x3f6091['where']=_[_0x1c7e('0x41')](_0x3f6091[_0x1c7e('0x42')],{'$or':_['map'](_0x34d65a,function(_0x4a0405){if(_0x4a0405[_0x1c7e('0x32')]!==_0x1c7e('0x43')){var _0x21c3c1={};_0x21c3c1[_0x4a0405[_0x1c7e('0x2c')]]={'$like':'%'+_0x4f7236['query'][_0x1c7e('0x44')]+'%'};return _0x21c3c1;}})});}_0x3f6091=_['merge']({},_0x3f6091,_0x4f7236[_0x1c7e('0x45')]);var _0x46d11b={'where':_0x3f6091[_0x1c7e('0x42')]};return db['Disposition'][_0x1c7e('0x22')](_0x46d11b)[_0x1c7e('0x27')](function(_0x8fbe3d){_0x3d3c06[_0x1c7e('0x22')]=_0x8fbe3d;if(_0x4f7236[_0x1c7e('0x35')]['includeAll']){_0x3f6091[_0x1c7e('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3f6091);})[_0x1c7e('0x27')](function(_0x4e91d7){_0x3d3c06['rows']=_0x4e91d7;return _0x3d3c06;})[_0x1c7e('0x27')](respondWithFilteredResult(_0x18d0ca,_0x3f6091))[_0x1c7e('0x47')](handleError(_0x18d0ca,null));};exports[_0x1c7e('0x48')]=function(_0x5ccb72,_0x4a36ee){var _0x273b78={'raw':!![],'where':{'id':_0x5ccb72[_0x1c7e('0x49')]['id']}},_0x16127e={};_0x16127e[_0x1c7e('0x34')]=_[_0x1c7e('0x36')](db[_0x1c7e('0x30')][_0x1c7e('0x31')]);_0x16127e[_0x1c7e('0x35')]=_[_0x1c7e('0x36')](_0x5ccb72['query']);_0x16127e[_0x1c7e('0x37')]=_[_0x1c7e('0x38')](_0x16127e[_0x1c7e('0x34')],_0x16127e[_0x1c7e('0x35')]);_0x273b78[_0x1c7e('0x39')]=_[_0x1c7e('0x38')](_0x16127e[_0x1c7e('0x34')],qs[_0x1c7e('0x3a')](_0x5ccb72[_0x1c7e('0x35')][_0x1c7e('0x3a')]));_0x273b78[_0x1c7e('0x39')]=_0x273b78[_0x1c7e('0x39')]['length']?_0x273b78[_0x1c7e('0x39')]:_0x16127e[_0x1c7e('0x34')];if(_0x5ccb72[_0x1c7e('0x35')][_0x1c7e('0x4a')]){_0x273b78[_0x1c7e('0x46')]=[{'all':!![]}];}_0x273b78=_[_0x1c7e('0x41')]({},_0x273b78,_0x5ccb72[_0x1c7e('0x45')]);return db[_0x1c7e('0x30')][_0x1c7e('0x4b')](_0x273b78)['then'](handleEntityNotFound(_0x4a36ee,null))['then'](respondWithResult(_0x4a36ee,null))[_0x1c7e('0x47')](handleError(_0x4a36ee,null));};exports[_0x1c7e('0x4c')]=function(_0x1763e1,_0xaadb91){return db[_0x1c7e('0x30')][_0x1c7e('0x4c')](_0x1763e1['body'],{})[_0x1c7e('0x27')](function(_0x13e4c6){var _0x147bdd=_0x1763e1[_0x1c7e('0x4d')]['get']({'plain':!![]});if(!_0x147bdd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x147bdd['role']==='user'){var _0x43b18a=_0x13e4c6[_0x1c7e('0x28')]({'plain':!![]});var _0x203b1e=_0x1c7e('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x203b1e,'userProfileId':_0x147bdd[_0x1c7e('0x4e')]},'raw':!![]})[_0x1c7e('0x27')](function(_0x2fece3){if(_0x2fece3&&_0x2fece3[_0x1c7e('0x4f')]===0x0){return db[_0x1c7e('0x2a')]['create']({'name':_0x43b18a[_0x1c7e('0x2c')],'resourceId':_0x43b18a['id'],'type':_0x2fece3[_0x1c7e('0x2c')],'sectionId':_0x2fece3['id']},{})[_0x1c7e('0x27')](function(){return _0x13e4c6;});}else{return _0x13e4c6;}})[_0x1c7e('0x47')](function(_0x2284ac){logger[_0x1c7e('0x2b')](_0x1c7e('0x50'),_0x2284ac);throw _0x2284ac;});}return _0x13e4c6;})[_0x1c7e('0x27')](respondWithResult(_0xaadb91,0xc9))[_0x1c7e('0x47')](handleError(_0xaadb91,null));};exports[_0x1c7e('0x51')]=function(_0x5d51a3,_0x3abdab){if(_0x5d51a3['body']['id']){delete _0x5d51a3[_0x1c7e('0x52')]['id'];}return db[_0x1c7e('0x30')][_0x1c7e('0x4b')]({'where':{'id':_0x5d51a3[_0x1c7e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3abdab,null))[_0x1c7e('0x27')](saveUpdates(_0x5d51a3[_0x1c7e('0x52')],null))[_0x1c7e('0x27')](respondWithResult(_0x3abdab,null))[_0x1c7e('0x47')](handleError(_0x3abdab,null));};exports['destroy']=function(_0x363c03,_0x57fe11){return db[_0x1c7e('0x30')][_0x1c7e('0x4b')]({'where':{'id':_0x363c03[_0x1c7e('0x49')]['id']}})[_0x1c7e('0x27')](handleEntityNotFound(_0x57fe11,null))[_0x1c7e('0x27')](removeEntity(_0x57fe11,null))[_0x1c7e('0x47')](handleError(_0x57fe11,null));}; \ No newline at end of file +var _0xed5c=['fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','zip-dir','request-promise','moment','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Dispositions','UserProfileResource','stack','name','send','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','attributes'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xed5c,0x13f));var _0xced5=function(_0x7e646c,_0x4cc599){_0x7e646c=_0x7e646c-0x0;var _0x4b8299=_0xed5c[_0x7e646c];return _0x4b8299;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xced5('0x0'));var zipdir=require(_0xced5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xced5('0x2'));var moment=require(_0xced5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xced5('0x4'));var path=require(_0xced5('0x5'));var sox=require('sox');var csv=require(_0xced5('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xced5('0x7'));var squel=require(_0xced5('0x8'));var crypto=require(_0xced5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xced5('0xa'));var toCsv=require(_0xced5('0x6'));var querystring=require(_0xced5('0xb'));var Papa=require('papaparse');var Redis=require(_0xced5('0xc'));var authService=require(_0xced5('0xd'));var qs=require(_0xced5('0xe'));var as=require(_0xced5('0xf'));var hardwareService=require(_0xced5('0x10'));var logger=require(_0xced5('0x11'))(_0xced5('0x12'));var utils=require(_0xced5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12a7c9,_0x22b9cd){_0x22b9cd=_0x22b9cd||0xcc;return function(_0x357fbf){if(_0x357fbf){return _0x12a7c9[_0xced5('0x15')](_0x22b9cd);}return _0x12a7c9[_0xced5('0x16')](_0x22b9cd)[_0xced5('0x17')]();};}function respondWithResult(_0x4da592,_0x4c1cf4){_0x4c1cf4=_0x4c1cf4||0xc8;return function(_0x4bb3a4){if(_0x4bb3a4){return _0x4da592[_0xced5('0x16')](_0x4c1cf4)[_0xced5('0x18')](_0x4bb3a4);}};}function respondWithFilteredResult(_0x327126,_0x3e1c13){return function(_0x3fd66e){if(_0x3fd66e){var _0x5f0827=typeof _0x3e1c13[_0xced5('0x19')]===_0xced5('0x1a')&&typeof _0x3e1c13[_0xced5('0x1b')]==='undefined';var _0x1406a3=_0x3fd66e['count'];var _0x4a8f6c=_0x5f0827?0x0:_0x3e1c13[_0xced5('0x19')];var _0xed0529=_0x5f0827?_0x3fd66e[_0xced5('0x1c')]:_0x3e1c13[_0xced5('0x19')]+_0x3e1c13[_0xced5('0x1b')];var _0x49ff74;if(_0xed0529>=_0x1406a3){_0xed0529=_0x1406a3;_0x49ff74=0xc8;}else{_0x49ff74=0xce;}_0x327126['status'](_0x49ff74);return _0x327126[_0xced5('0x1d')](_0xced5('0x1e'),_0x4a8f6c+'-'+_0xed0529+'/'+_0x1406a3)[_0xced5('0x18')](_0x3fd66e);}return null;};}function patchUpdates(_0x299f5a){return function(_0x5a280b){try{jsonpatch[_0xced5('0x1f')](_0x5a280b,_0x299f5a,!![]);}catch(_0x186e44){return BPromise['reject'](_0x186e44);}return _0x5a280b[_0xced5('0x20')]();};}function saveUpdates(_0x21dd61,_0x5559d7){return function(_0x54e535){if(_0x54e535){return _0x54e535[_0xced5('0x21')](_0x21dd61)[_0xced5('0x22')](function(_0x27ae9e){return _0x27ae9e;});}return null;};}function removeEntity(_0x5dd171,_0x33ae3d){return function(_0x3edc98){if(_0x3edc98){return _0x3edc98['destroy']()['then'](function(){var _0x1a7b19=_0x3edc98[_0xced5('0x23')]({'plain':!![]});var _0xcc13c1=_0xced5('0x24');return db[_0xced5('0x25')]['destroy']({'where':{'type':_0xcc13c1,'resourceId':_0x1a7b19['id']}})['then'](function(){return _0x3edc98;});})[_0xced5('0x22')](function(){_0x5dd171[_0xced5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d672,_0x1c82fd){return function(_0x58c1a0){if(!_0x58c1a0){_0x54d672[_0xced5('0x15')](0x194);}return _0x58c1a0;};}function handleError(_0x3d6827,_0x148d4a){_0x148d4a=_0x148d4a||0x1f4;return function(_0x754056){logger['error'](_0x754056[_0xced5('0x26')]);if(_0x754056[_0xced5('0x27')]){delete _0x754056[_0xced5('0x27')];}_0x3d6827[_0xced5('0x16')](_0x148d4a)[_0xced5('0x28')](_0x754056);};}exports['index']=function(_0x2f017e,_0x1538bf){var _0x47e274={},_0x4f962d={},_0x50b1ce={'count':0x0,'rows':[]};var _0x310b0a=_[_0xced5('0x29')](db[_0xced5('0x2a')][_0xced5('0x2b')],function(_0x50ba44){return{'name':_0x50ba44['fieldName'],'type':_0x50ba44[_0xced5('0x2c')][_0xced5('0x2d')]};});_0x4f962d[_0xced5('0x2e')]=_[_0xced5('0x29')](_0x310b0a,_0xced5('0x27'));_0x4f962d[_0xced5('0x2f')]=_['keys'](_0x2f017e['query']);_0x4f962d[_0xced5('0x30')]=_[_0xced5('0x31')](_0x4f962d[_0xced5('0x2e')],_0x4f962d[_0xced5('0x2f')]);_0x47e274[_0xced5('0x32')]=_[_0xced5('0x31')](_0x4f962d[_0xced5('0x2e')],qs[_0xced5('0x33')](_0x2f017e[_0xced5('0x2f')][_0xced5('0x33')]));_0x47e274[_0xced5('0x32')]=_0x47e274[_0xced5('0x32')][_0xced5('0x34')]?_0x47e274['attributes']:_0x4f962d['model'];if(!_0x2f017e['query'][_0xced5('0x35')]('nolimit')){_0x47e274[_0xced5('0x1b')]=qs['limit'](_0x2f017e[_0xced5('0x2f')][_0xced5('0x1b')]);_0x47e274[_0xced5('0x19')]=qs[_0xced5('0x19')](_0x2f017e[_0xced5('0x2f')][_0xced5('0x19')]);}_0x47e274['order']=qs[_0xced5('0x36')](_0x2f017e[_0xced5('0x2f')]['sort']);_0x47e274[_0xced5('0x37')]=qs['filters'](_['pick'](_0x2f017e[_0xced5('0x2f')],_0x4f962d[_0xced5('0x30')]),_0x310b0a);if(_0x2f017e[_0xced5('0x2f')][_0xced5('0x38')]){_0x47e274[_0xced5('0x37')]=_[_0xced5('0x39')](_0x47e274['where'],{'$or':_[_0xced5('0x29')](_0x310b0a,function(_0xcd8197){if(_0xcd8197[_0xced5('0x2c')]!=='VIRTUAL'){var _0x444b5c={};_0x444b5c[_0xcd8197['name']]={'$like':'%'+_0x2f017e[_0xced5('0x2f')][_0xced5('0x38')]+'%'};return _0x444b5c;}})});}_0x47e274=_[_0xced5('0x39')]({},_0x47e274,_0x2f017e[_0xced5('0x3a')]);var _0x5c1fbd={'where':_0x47e274[_0xced5('0x37')]};return db['Disposition'][_0xced5('0x1c')](_0x5c1fbd)[_0xced5('0x22')](function(_0xb4e3a1){_0x50b1ce[_0xced5('0x1c')]=_0xb4e3a1;if(_0x2f017e[_0xced5('0x2f')][_0xced5('0x3b')]){_0x47e274[_0xced5('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0xced5('0x3d')](_0x47e274);})['then'](function(_0x411b31){_0x50b1ce[_0xced5('0x3e')]=_0x411b31;return _0x50b1ce;})[_0xced5('0x22')](respondWithFilteredResult(_0x1538bf,_0x47e274))[_0xced5('0x3f')](handleError(_0x1538bf,null));};exports[_0xced5('0x40')]=function(_0x1ca533,_0x53fe95){var _0x44b5d6={'raw':!![],'where':{'id':_0x1ca533[_0xced5('0x41')]['id']}},_0x451178={};_0x451178[_0xced5('0x2e')]=_[_0xced5('0x42')](db[_0xced5('0x2a')][_0xced5('0x2b')]);_0x451178[_0xced5('0x2f')]=_[_0xced5('0x42')](_0x1ca533[_0xced5('0x2f')]);_0x451178[_0xced5('0x30')]=_[_0xced5('0x31')](_0x451178[_0xced5('0x2e')],_0x451178['query']);_0x44b5d6[_0xced5('0x32')]=_[_0xced5('0x31')](_0x451178[_0xced5('0x2e')],qs[_0xced5('0x33')](_0x1ca533[_0xced5('0x2f')]['fields']));_0x44b5d6['attributes']=_0x44b5d6[_0xced5('0x32')][_0xced5('0x34')]?_0x44b5d6['attributes']:_0x451178['model'];if(_0x1ca533[_0xced5('0x2f')][_0xced5('0x3b')]){_0x44b5d6[_0xced5('0x3c')]=[{'all':!![]}];}_0x44b5d6=_[_0xced5('0x39')]({},_0x44b5d6,_0x1ca533['options']);return db[_0xced5('0x2a')][_0xced5('0x43')](_0x44b5d6)[_0xced5('0x22')](handleEntityNotFound(_0x53fe95,null))['then'](respondWithResult(_0x53fe95,null))['catch'](handleError(_0x53fe95,null));};exports[_0xced5('0x44')]=function(_0x9e61ff,_0x2046ad){return db[_0xced5('0x2a')]['create'](_0x9e61ff[_0xced5('0x45')],{})[_0xced5('0x22')](function(_0x28f07e){var _0x370dcf=_0x9e61ff['user'][_0xced5('0x23')]({'plain':!![]});if(!_0x370dcf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370dcf['role']==='user'){var _0x5002ea=_0x28f07e[_0xced5('0x23')]({'plain':!![]});var _0x88add4=_0xced5('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x88add4,'userProfileId':_0x370dcf['userProfileId']},'raw':!![]})[_0xced5('0x22')](function(_0x338d5d){if(_0x338d5d&&_0x338d5d[_0xced5('0x46')]===0x0){return db[_0xced5('0x25')]['create']({'name':_0x5002ea[_0xced5('0x27')],'resourceId':_0x5002ea['id'],'type':_0x338d5d[_0xced5('0x27')],'sectionId':_0x338d5d['id']},{})[_0xced5('0x22')](function(){return _0x28f07e;});}else{return _0x28f07e;}})[_0xced5('0x3f')](function(_0x518a85){logger[_0xced5('0x47')](_0xced5('0x48'),_0x518a85);throw _0x518a85;});}return _0x28f07e;})[_0xced5('0x22')](respondWithResult(_0x2046ad,0xc9))[_0xced5('0x3f')](handleError(_0x2046ad,null));};exports[_0xced5('0x21')]=function(_0x520d1c,_0x8c00f4){if(_0x520d1c[_0xced5('0x45')]['id']){delete _0x520d1c[_0xced5('0x45')]['id'];}return db['Disposition'][_0xced5('0x43')]({'where':{'id':_0x520d1c[_0xced5('0x41')]['id']}})[_0xced5('0x22')](handleEntityNotFound(_0x8c00f4,null))[_0xced5('0x22')](saveUpdates(_0x520d1c[_0xced5('0x45')],null))[_0xced5('0x22')](respondWithResult(_0x8c00f4,null))[_0xced5('0x3f')](handleError(_0x8c00f4,null));};exports[_0xced5('0x49')]=function(_0x25f151,_0x4eefad){return db[_0xced5('0x2a')][_0xced5('0x43')]({'where':{'id':_0x25f151['params']['id']}})[_0xced5('0x22')](handleEntityNotFound(_0x4eefad,null))['then'](removeEntity(_0x4eefad,null))[_0xced5('0x3f')](handleError(_0x4eefad,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 116ae48..15d5df7 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 _0x547f=['name','ListId','name_chat','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','Disposition','tools_dispositions','name_voice'];(function(_0x42eb05,_0x17cc43){var _0x321674=function(_0x5bb186){while(--_0x5bb186){_0x42eb05['push'](_0x42eb05['shift']());}};_0x321674(++_0x17cc43);}(_0x547f,0x195));var _0xf547=function(_0x18760a,_0xd49c7c){_0x18760a=_0x18760a-0x0;var _0x301f41=_0x547f[_0x18760a];return _0x301f41;};'use strict';var _=require(_0xf547('0x0'));var util=require(_0xf547('0x1'));var logger=require(_0xf547('0x2'))(_0xf547('0x3'));var moment=require('moment');var BPromise=require(_0xf547('0x4'));var rp=require(_0xf547('0x5'));var fs=require('fs');var path=require(_0xf547('0x6'));var rimraf=require(_0xf547('0x7'));var config=require(_0xf547('0x8'));var attributes=require(_0xf547('0x9'));module['exports']=function(_0x1a8637,_0x28ae1d){return _0x1a8637['define'](_0xf547('0xa'),attributes,{'tableName':_0xf547('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf547('0xc'),'fields':[_0xf547('0xd'),_0xf547('0xe')]},{'unique':!![],'name':_0xf547('0xf'),'fields':[_0xf547('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0xf547('0x10'),'fields':[_0xf547('0xd'),_0xf547('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0xf547('0xd'),_0xf547('0x12')]},{'unique':!![],'name':_0xf547('0x13'),'fields':[_0xf547('0xd'),_0xf547('0x14')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xf547('0xd'),_0xf547('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x281c=['MailAccountId','name_sms','name_fax','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x281c,0x82));var _0xc281=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x281c[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xc281('0x0'));var util=require(_0xc281('0x1'));var logger=require(_0xc281('0x2'))(_0xc281('0x3'));var moment=require(_0xc281('0x4'));var BPromise=require(_0xc281('0x5'));var rp=require(_0xc281('0x6'));var fs=require('fs');var path=require(_0xc281('0x7'));var rimraf=require(_0xc281('0x8'));var config=require(_0xc281('0x9'));var attributes=require('./disposition.attributes');module['exports']=function(_0x8ab202,_0xdd459e){return _0x8ab202['define'](_0xc281('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xc281('0xb'),'fields':[_0xc281('0xc'),_0xc281('0xd')]},{'unique':!![],'name':_0xc281('0xe'),'fields':['name',_0xc281('0xf')]},{'unique':!![],'name':_0xc281('0x10'),'fields':[_0xc281('0xc'),_0xc281('0x11')]},{'unique':!![],'name':_0xc281('0x12'),'fields':[_0xc281('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xc281('0x13'),'fields':[_0xc281('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xc281('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xc281('0xc'),_0xc281('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e2ef1c7..c67624e 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(_0x1c12e9,_0x520c34){var _0x4054c5=function(_0x25da8d){while(--_0x25da8d){_0x1c12e9['push'](_0x1c12e9['shift']());}};_0x4054c5(++_0x520c34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x5ba8e3,_0x36dc5d){var _0x349269=function(_0x30b44d){while(--_0x30b44d){_0x5ba8e3['push'](_0x5ba8e3['shift']());}};_0x349269(++_0x36dc5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 8ea3665..3092e18 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 _0x8537=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','update','delete','destroy'];(function(_0x3b7901,_0x45cda9){var _0x2914bf=function(_0xe0a4e4){while(--_0xe0a4e4){_0x3b7901['push'](_0x3b7901['shift']());}};_0x2914bf(++_0x45cda9);}(_0x8537,0x1c2));var _0x7853=function(_0x22e9d5,_0x2ff0ad){_0x22e9d5=_0x22e9d5-0x0;var _0x367501=_0x8537[_0x22e9d5];return _0x367501;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7853('0x0'));var timeout=require(_0x7853('0x1'));var express=require(_0x7853('0x2'));var router=express['Router']();var fs_extra=require(_0x7853('0x3'));var auth=require(_0x7853('0x4'));var interaction=require(_0x7853('0x5'));var config=require(_0x7853('0x6'));var controller=require(_0x7853('0x7'));router[_0x7853('0x8')]('/',auth[_0x7853('0x9')](),controller[_0x7853('0xa')]);router[_0x7853('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7853('0xb')]);router[_0x7853('0xc')]('/',auth[_0x7853('0x9')](),controller[_0x7853('0xd')]);router[_0x7853('0xe')]('/:id',auth[_0x7853('0x9')](),controller[_0x7853('0xf')]);router[_0x7853('0x10')]('/:id',auth[_0x7853('0x9')](),controller[_0x7853('0x11')]);module['exports']=router; \ No newline at end of file +var _0x72eb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x72eb,0x15d));var _0xb72e=function(_0x2e119b,_0x140fe5){_0x2e119b=_0x2e119b-0x0;var _0x5b9cec=_0x72eb[_0x2e119b];return _0x5b9cec;};'use strict';var multer=require('multer');var util=require(_0xb72e('0x0'));var path=require(_0xb72e('0x1'));var timeout=require(_0xb72e('0x2'));var express=require('express');var router=express[_0xb72e('0x3')]();var fs_extra=require(_0xb72e('0x4'));var auth=require(_0xb72e('0x5'));var interaction=require(_0xb72e('0x6'));var config=require(_0xb72e('0x7'));var controller=require('./disposition.controller');router[_0xb72e('0x8')]('/',auth[_0xb72e('0x9')](),controller['index']);router[_0xb72e('0x8')](_0xb72e('0xa'),auth[_0xb72e('0x9')](),controller[_0xb72e('0xb')]);router['post']('/',auth[_0xb72e('0x9')](),controller['create']);router[_0xb72e('0xc')](_0xb72e('0xa'),auth[_0xb72e('0x9')](),controller['update']);router[_0xb72e('0xd')](_0xb72e('0xa'),auth[_0xb72e('0x9')](),controller[_0xb72e('0xe')]);module[_0xb72e('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1947613..df262d2 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 _0x43a5=['4800','v17,v27,v29','INTEGER','SIP','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400'];(function(_0x7192c4,_0xaa0a9b){var _0x553863=function(_0x5e2e2b){while(--_0x5e2e2b){_0x7192c4['push'](_0x7192c4['shift']());}};_0x553863(++_0xaa0a9b);}(_0x43a5,0x12a));var _0x543a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x43a5[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x543a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x543a('0x1')](_0x543a('0x2'),'no'),'defaultValue':_0x543a('0x2')},'headerinfo':{'type':Sequelize[_0x543a('0x0')],'defaultValue':_0x543a('0x3')},'localstationid':{'type':Sequelize[_0x543a('0x0')],'unique':_0x543a('0x4')},'minrate':{'type':Sequelize[_0x543a('0x1')](_0x543a('0x5'),'4800',_0x543a('0x6'),_0x543a('0x7'),_0x543a('0x8'),_0x543a('0x9')),'defaultValue':_0x543a('0xa')},'maxrate':{'type':Sequelize[_0x543a('0x1')](_0x543a('0x5'),_0x543a('0xa'),_0x543a('0x6'),'9600',_0x543a('0x8'),_0x543a('0x9')),'defaultValue':_0x543a('0x9')},'modem':{'type':Sequelize[_0x543a('0x0')],'defaultValue':_0x543a('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x543a('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x543a('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x543a('0xd'),'IAX','DADHI',_0x543a('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x543a('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x543a('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x543a('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x543a('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x543a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x543a('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x543a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x543a('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x543a('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x543a('0x12'),'set':function(_0x1594cf){if(!_0x1594cf)this[_0x543a('0x13')](_0x543a('0x14'),null);this[_0x543a('0x13')](_0x543a('0x15'),_0x1594cf);}}}; \ No newline at end of file +var _0xdede=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','4800','12000','v17,v27,v29','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xdede,0xeb));var _0xeded=function(_0x51b74e,_0x3c9057){_0x51b74e=_0x51b74e-0x0;var _0x45214f=_0xdede[_0x51b74e];return _0x45214f;};'use strict';var Sequelize=require(_0xeded('0x0'));module[_0xeded('0x1')]={'name':{'type':Sequelize[_0xeded('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeded('0x2')]},'ecm':{'type':Sequelize[_0xeded('0x3')](_0xeded('0x4'),'no'),'defaultValue':_0xeded('0x4')},'headerinfo':{'type':Sequelize[_0xeded('0x2')],'defaultValue':_0xeded('0x5')},'localstationid':{'type':Sequelize[_0xeded('0x2')],'unique':_0xeded('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xeded('0x7'),'4800',_0xeded('0x8'),_0xeded('0x9'),'12000','14400'),'defaultValue':_0xeded('0xa')},'maxrate':{'type':Sequelize[_0xeded('0x3')](_0xeded('0x7'),_0xeded('0xa'),_0xeded('0x8'),_0xeded('0x9'),_0xeded('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xeded('0x2')],'defaultValue':_0xeded('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xeded('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xeded('0x3')](_0xeded('0xd'),_0xeded('0xe'),'DADHI','KHOMP'),'defaultValue':_0xeded('0xd')},'key':{'type':Sequelize[_0xeded('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeded('0xf')],'defaultValue':function(){return _0xeded('0x10');}},'notificationSound':{'type':Sequelize[_0xeded('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeded('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeded('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeded('0x12')],'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[_0xeded('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0xeded('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xeded('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x48cfd3){if(!_0x48cfd3)this[_0xeded('0x14')](_0xeded('0x15'),null);this[_0xeded('0x14')](_0xeded('0x16'),_0x48cfd3);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3eaef3c..857623e 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 _0xa1e2=['merge','VIRTUAL','options','FaxAccount','includeAll','include','rows','params','keys','rawAttributes','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','FaxAccountId','findAll','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','ids','omit','getInteractions','FaxInteraction','CmContact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','gateway','headerinfo','minrate','modem','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','key','TrunkId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','FaxAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x6a23aa,_0x3797ab){var _0x5ad153=function(_0xee6112){while(--_0xee6112){_0x6a23aa['push'](_0x6a23aa['shift']());}};_0x5ad153(++_0x3797ab);}(_0xa1e2,0x71));var _0x2a1e=function(_0x11e636,_0x3d00c4){_0x11e636=_0x11e636-0x0;var _0x52211b=_0xa1e2[_0x11e636];return _0x52211b;};'use strict';var emlformat=require(_0x2a1e('0x0'));var rimraf=require(_0x2a1e('0x1'));var zipdir=require(_0x2a1e('0x2'));var jsonpatch=require(_0x2a1e('0x3'));var rp=require(_0x2a1e('0x4'));var moment=require(_0x2a1e('0x5'));var BPromise=require(_0x2a1e('0x6'));var Mustache=require('mustache');var util=require(_0x2a1e('0x7'));var path=require(_0x2a1e('0x8'));var sox=require(_0x2a1e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a1e('0xa'));var _=require(_0x2a1e('0xb'));var squel=require(_0x2a1e('0xc'));var crypto=require(_0x2a1e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2a1e('0xe'));var toCsv=require(_0x2a1e('0xf'));var querystring=require(_0x2a1e('0x10'));var Papa=require(_0x2a1e('0x11'));var Redis=require('ioredis');var authService=require(_0x2a1e('0x12'));var qs=require(_0x2a1e('0x13'));var as=require(_0x2a1e('0x14'));var hardwareService=require(_0x2a1e('0x15'));var logger=require(_0x2a1e('0x16'))(_0x2a1e('0x17'));var utils=require(_0x2a1e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2a1e('0x19'));var db=require(_0x2a1e('0x1a'))['db'];config[_0x2a1e('0x1b')]=_[_0x2a1e('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2a1e('0x1d'))(new Redis(config[_0x2a1e('0x1b')]));require(_0x2a1e('0x1e'))[_0x2a1e('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a1e('0x20')][_0x2a1e('0x21')]({'port':0x232c});var client9002=jayson[_0x2a1e('0x20')][_0x2a1e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xa87d58,_0xa7dfa7,_0x56130d,_0x9f484b){return new BPromise(function(_0x2ebf86,_0x5d83d8){var _0x45e8ca=_0x9f484b||client;return _0x45e8ca['request'](_0xa87d58,_0x56130d)[_0x2a1e('0x22')](function(_0x217923){logger[_0x2a1e('0x23')](_0x2a1e('0x24'),_0xa7dfa7,_0x2a1e('0x25'));logger[_0x2a1e('0x26')](_0x2a1e('0x27'),_0xa7dfa7,_0x2a1e('0x25'),JSON['stringify'](_0x217923));if(_0x217923[_0x2a1e('0x28')]){if(_0x217923[_0x2a1e('0x28')][_0x2a1e('0x29')]===0x1f4){logger[_0x2a1e('0x28')](_0x2a1e('0x24'),_0xa7dfa7,_0x217923[_0x2a1e('0x28')]['message']);return _0x5d83d8(_0x217923['error']['message']);}logger[_0x2a1e('0x28')]('FaxAccount,\x20%s,\x20%s',_0xa7dfa7,_0x217923[_0x2a1e('0x28')][_0x2a1e('0x2a')]);return _0x2ebf86(_0x217923['error'][_0x2a1e('0x2a')]);}else{logger[_0x2a1e('0x23')]('FaxAccount,\x20%s,\x20%s',_0xa7dfa7,'request\x20sent');_0x2ebf86(_0x217923[_0x2a1e('0x2b')][_0x2a1e('0x2a')]);}})[_0x2a1e('0x2c')](function(_0x3a42c3){logger[_0x2a1e('0x28')](_0x2a1e('0x24'),_0xa7dfa7,_0x3a42c3);_0x5d83d8(_0x3a42c3);});});}function respondWithStatusCode(_0x3407a2,_0x1b868d){_0x1b868d=_0x1b868d||0xcc;return function(_0x3e42a7){if(_0x3e42a7){return _0x3407a2[_0x2a1e('0x2d')](_0x1b868d);}return _0x3407a2['status'](_0x1b868d)['end']();};}function respondWithResult(_0x3f09c6,_0x42791e){_0x42791e=_0x42791e||0xc8;return function(_0x488ed1){if(_0x488ed1){return _0x3f09c6[_0x2a1e('0x2e')](_0x42791e)[_0x2a1e('0x2f')](_0x488ed1);}};}function respondWithFilteredResult(_0x4e3902,_0x19c7d7){return function(_0x469f25){if(_0x469f25){var _0x221724=typeof _0x19c7d7['offset']===_0x2a1e('0x30')&&typeof _0x19c7d7[_0x2a1e('0x31')]===_0x2a1e('0x30');var _0x56ff55=_0x469f25[_0x2a1e('0x32')];var _0x15d662=_0x221724?0x0:_0x19c7d7['offset'];var _0x593083=_0x221724?_0x469f25[_0x2a1e('0x32')]:_0x19c7d7[_0x2a1e('0x33')]+_0x19c7d7[_0x2a1e('0x31')];var _0x41ad9e;if(_0x593083>=_0x56ff55){_0x593083=_0x56ff55;_0x41ad9e=0xc8;}else{_0x41ad9e=0xce;}_0x4e3902[_0x2a1e('0x2e')](_0x41ad9e);return _0x4e3902[_0x2a1e('0x34')](_0x2a1e('0x35'),_0x15d662+'-'+_0x593083+'/'+_0x56ff55)[_0x2a1e('0x2f')](_0x469f25);}return null;};}function patchUpdates(_0x90eb1c){return function(_0x2d34f9){try{jsonpatch[_0x2a1e('0x36')](_0x2d34f9,_0x90eb1c,!![]);}catch(_0x1a6151){return BPromise['reject'](_0x1a6151);}return _0x2d34f9[_0x2a1e('0x37')]();};}function saveUpdates(_0x537483,_0x33fa33){return function(_0x3157af){if(_0x3157af){return _0x3157af[_0x2a1e('0x38')](_0x537483)['then'](function(_0x14033a){return _0x14033a;});}return null;};}function removeEntity(_0x5b5bb1,_0xfd70d1){return function(_0x224ab2){if(_0x224ab2){return _0x224ab2[_0x2a1e('0x39')]()[_0x2a1e('0x22')](function(){var _0x402c6d=_0x224ab2['get']({'plain':!![]});var _0x58c30a=_0x2a1e('0x3a');return db['UserProfileResource'][_0x2a1e('0x39')]({'where':{'type':_0x58c30a,'resourceId':_0x402c6d['id']}})[_0x2a1e('0x22')](function(){return _0x224ab2;});})[_0x2a1e('0x22')](function(){_0x5b5bb1[_0x2a1e('0x2e')](0xcc)[_0x2a1e('0x3b')]();});}};}function handleEntityNotFound(_0x583c4c,_0x322b42){return function(_0xbf1341){if(!_0xbf1341){_0x583c4c['sendStatus'](0x194);}return _0xbf1341;};}function handleError(_0x18e543,_0x52f060){_0x52f060=_0x52f060||0x1f4;return function(_0xca5cfc){logger['error'](_0xca5cfc[_0x2a1e('0x3c')]);if(_0xca5cfc[_0x2a1e('0x3d')]){delete _0xca5cfc[_0x2a1e('0x3d')];}_0x18e543[_0x2a1e('0x2e')](_0x52f060)[_0x2a1e('0x3e')](_0xca5cfc);};}exports[_0x2a1e('0x3f')]=function(_0x2caccd,_0x2bc1e9){var _0x23ebfa={'include':[{'model':db[_0x2a1e('0x40')],'as':_0x2a1e('0x41')}]},_0x358cda={},_0x558e9c={'count':0x0,'rows':[]};var _0x20a884=_[_0x2a1e('0x42')](db['FaxAccount']['rawAttributes'],function(_0x7ffb79){return{'name':_0x7ffb79[_0x2a1e('0x43')],'type':_0x7ffb79[_0x2a1e('0x44')]['key']};});_0x358cda['model']=_[_0x2a1e('0x42')](_0x20a884,_0x2a1e('0x3d'));_0x358cda[_0x2a1e('0x45')]=_['keys'](_0x2caccd['query']);_0x358cda[_0x2a1e('0x46')]=_[_0x2a1e('0x47')](_0x358cda[_0x2a1e('0x48')],_0x358cda[_0x2a1e('0x45')]);_0x23ebfa[_0x2a1e('0x49')]=_['intersection'](_0x358cda[_0x2a1e('0x48')],qs['fields'](_0x2caccd[_0x2a1e('0x45')]['fields']));_0x23ebfa[_0x2a1e('0x49')]=_0x23ebfa[_0x2a1e('0x49')][_0x2a1e('0x4a')]?_0x23ebfa[_0x2a1e('0x49')]:_0x358cda[_0x2a1e('0x48')];if(!_0x2caccd['query'][_0x2a1e('0x4b')](_0x2a1e('0x4c'))){_0x23ebfa[_0x2a1e('0x31')]=qs['limit'](_0x2caccd[_0x2a1e('0x45')]['limit']);_0x23ebfa['offset']=qs['offset'](_0x2caccd[_0x2a1e('0x45')]['offset']);}_0x23ebfa[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x2caccd[_0x2a1e('0x45')]['sort']);_0x23ebfa[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_[_0x2a1e('0x50')](_0x2caccd[_0x2a1e('0x45')],_0x358cda['filters']),_0x20a884);if(_0x2caccd[_0x2a1e('0x45')][_0x2a1e('0x51')]){_0x23ebfa[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0x23ebfa['where'],{'$or':_[_0x2a1e('0x42')](_0x20a884,function(_0x5e2256){if(_0x5e2256['type']!==_0x2a1e('0x53')){var _0x5e7dca={};_0x5e7dca[_0x5e2256[_0x2a1e('0x3d')]]={'$like':'%'+_0x2caccd[_0x2a1e('0x45')]['filter']+'%'};return _0x5e7dca;}})});}_0x23ebfa=_[_0x2a1e('0x52')]({},_0x23ebfa,_0x2caccd[_0x2a1e('0x54')]);var _0x1198cf={'where':_0x23ebfa[_0x2a1e('0x4f')]};return db[_0x2a1e('0x55')][_0x2a1e('0x32')](_0x1198cf)['then'](function(_0x4addf2){_0x558e9c[_0x2a1e('0x32')]=_0x4addf2;if(_0x2caccd['query'][_0x2a1e('0x56')]){_0x23ebfa[_0x2a1e('0x57')]=[{'all':!![]}];}return db[_0x2a1e('0x55')]['findAll'](_0x23ebfa);})[_0x2a1e('0x22')](function(_0x369c93){_0x558e9c[_0x2a1e('0x58')]=_0x369c93;return _0x558e9c;})[_0x2a1e('0x22')](respondWithFilteredResult(_0x2bc1e9,_0x23ebfa))[_0x2a1e('0x2c')](handleError(_0x2bc1e9,null));};exports['show']=function(_0x4277dd,_0x3eef79){var _0x421b3a={'raw':![],'where':{'id':_0x4277dd[_0x2a1e('0x59')]['id']},'include':[{'model':db[_0x2a1e('0x40')],'as':_0x2a1e('0x41')}]},_0x4ce768={};_0x4ce768[_0x2a1e('0x48')]=_[_0x2a1e('0x5a')](db[_0x2a1e('0x55')][_0x2a1e('0x5b')]);_0x4ce768[_0x2a1e('0x45')]=_[_0x2a1e('0x5a')](_0x4277dd[_0x2a1e('0x45')]);_0x4ce768['filters']=_[_0x2a1e('0x47')](_0x4ce768[_0x2a1e('0x48')],_0x4ce768[_0x2a1e('0x45')]);_0x421b3a[_0x2a1e('0x49')]=_[_0x2a1e('0x47')](_0x4ce768['model'],qs['fields'](_0x4277dd[_0x2a1e('0x45')][_0x2a1e('0x5c')]));_0x421b3a[_0x2a1e('0x49')]=_0x421b3a['attributes'][_0x2a1e('0x4a')]?_0x421b3a[_0x2a1e('0x49')]:_0x4ce768[_0x2a1e('0x48')];if(_0x4277dd['query']['includeAll']){_0x421b3a[_0x2a1e('0x57')]=[{'all':!![]}];}_0x421b3a=_[_0x2a1e('0x52')]({},_0x421b3a,_0x4277dd[_0x2a1e('0x54')]);return db['FaxAccount'][_0x2a1e('0x5d')](_0x421b3a)['then'](handleEntityNotFound(_0x3eef79,null))[_0x2a1e('0x22')](respondWithResult(_0x3eef79,null))[_0x2a1e('0x2c')](handleError(_0x3eef79,null));};exports[_0x2a1e('0x5e')]=function(_0x2eb16b,_0x12220b){return db[_0x2a1e('0x55')]['create'](_0x2eb16b[_0x2a1e('0x5f')],{})[_0x2a1e('0x22')](function(_0x50323){var _0x1cebac=_0x2eb16b['user'][_0x2a1e('0x60')]({'plain':!![]});if(!_0x1cebac)throw new Error(_0x2a1e('0x61'));if(_0x1cebac[_0x2a1e('0x62')]===_0x2a1e('0x63')){var _0x55f2f5=_0x50323[_0x2a1e('0x60')]({'plain':!![]});var _0x40d3f7=_0x2a1e('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x40d3f7,'userProfileId':_0x1cebac[_0x2a1e('0x64')]},'raw':!![]})['then'](function(_0x450f97){if(_0x450f97&&_0x450f97[_0x2a1e('0x65')]===0x0){return db[_0x2a1e('0x66')][_0x2a1e('0x5e')]({'name':_0x55f2f5[_0x2a1e('0x3d')],'resourceId':_0x55f2f5['id'],'type':_0x450f97['name'],'sectionId':_0x450f97['id']},{})['then'](function(){return _0x50323;});}else{return _0x50323;}})[_0x2a1e('0x2c')](function(_0x5c9c88){logger[_0x2a1e('0x28')](_0x2a1e('0x67'),_0x5c9c88);throw _0x5c9c88;});}return _0x50323;})['then'](respondWithResult(_0x12220b,0xc9))['catch'](handleError(_0x12220b,null));};exports[_0x2a1e('0x38')]=function(_0x582d67,_0x48c3bf){if(_0x582d67[_0x2a1e('0x5f')]['id']){delete _0x582d67[_0x2a1e('0x5f')]['id'];}return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x582d67['params']['id']},'include':[{'model':db[_0x2a1e('0x40')],'as':_0x2a1e('0x41')}]})[_0x2a1e('0x22')](handleEntityNotFound(_0x48c3bf,null))[_0x2a1e('0x22')](saveUpdates(_0x582d67[_0x2a1e('0x5f')],null))[_0x2a1e('0x22')](respondWithResult(_0x48c3bf,null))['catch'](handleError(_0x48c3bf,null));};exports[_0x2a1e('0x39')]=function(_0xc5cf6c,_0x481170){return db[_0x2a1e('0x55')]['find']({'where':{'id':_0xc5cf6c[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x481170,null))[_0x2a1e('0x22')](removeEntity(_0x481170,null))[_0x2a1e('0x2c')](handleError(_0x481170,null));};exports[_0x2a1e('0x68')]=function(_0x17340c,_0x3e564d){return db[_0x2a1e('0x55')][_0x2a1e('0x68')]()['then'](respondWithResult(_0x3e564d,null))[_0x2a1e('0x2c')](handleError(_0x3e564d,null));};exports[_0x2a1e('0x69')]=function(_0x3091e2,_0x481398,_0x1172e8){if(_0x3091e2['body']['id']){delete _0x3091e2[_0x2a1e('0x5f')]['id'];}return db[_0x2a1e('0x55')]['find']({'where':{'id':_0x3091e2['params']['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x481398,null))[_0x2a1e('0x22')](function(_0x46b2aa){if(_0x46b2aa){_0x3091e2[_0x2a1e('0x5f')]['FaxAccountId']=_0x46b2aa['id'];return db[_0x2a1e('0x6a')][_0x2a1e('0x5e')](_0x3091e2[_0x2a1e('0x5f')]);}})[_0x2a1e('0x22')](respondWithResult(_0x481398,null))['catch'](handleError(_0x481398,null));};exports[_0x2a1e('0x6b')]=function(_0x1e3008,_0x369f73,_0xe5c7a2){var _0xd827f0={'raw':![],'where':{}};var _0x17d0e3={};var _0xbcc96a={'count':0x0,'rows':[]};return db[_0x2a1e('0x55')]['findOne']({'where':{'id':_0x1e3008[_0x2a1e('0x59')]['id']}})['then'](handleEntityNotFound(_0x369f73,null))[_0x2a1e('0x22')](function(_0x5ba40b){if(_0x5ba40b){_0x17d0e3[_0x2a1e('0x48')]=_[_0x2a1e('0x5a')](db[_0x2a1e('0x6a')][_0x2a1e('0x5b')]);_0x17d0e3[_0x2a1e('0x45')]=_['keys'](_0x1e3008[_0x2a1e('0x45')]);_0x17d0e3[_0x2a1e('0x46')]=_[_0x2a1e('0x47')](_0x17d0e3[_0x2a1e('0x48')],_0x17d0e3[_0x2a1e('0x45')]);_0xd827f0[_0x2a1e('0x49')]=_['intersection'](_0x17d0e3['model'],qs['fields'](_0x1e3008[_0x2a1e('0x45')][_0x2a1e('0x5c')]));_0xd827f0[_0x2a1e('0x49')]=_0xd827f0[_0x2a1e('0x49')][_0x2a1e('0x4a')]?_0xd827f0['attributes']:_0x17d0e3['model'];if(!_0x1e3008[_0x2a1e('0x45')][_0x2a1e('0x4b')](_0x2a1e('0x4c'))){_0xd827f0['limit']=qs[_0x2a1e('0x31')](_0x1e3008['query'][_0x2a1e('0x31')]);_0xd827f0['offset']=qs[_0x2a1e('0x33')](_0x1e3008[_0x2a1e('0x45')][_0x2a1e('0x33')]);}_0xd827f0[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x1e3008[_0x2a1e('0x45')][_0x2a1e('0x4e')]);_0xd827f0[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_[_0x2a1e('0x50')](_0x1e3008['query'],_0x17d0e3[_0x2a1e('0x46')]));_0xd827f0[_0x2a1e('0x4f')][_0x2a1e('0x6c')]=_0x5ba40b['id'];if(_0x1e3008[_0x2a1e('0x45')]['filter']){_0xd827f0[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0xd827f0[_0x2a1e('0x4f')],{'$or':_['map'](_0xd827f0[_0x2a1e('0x49')],function(_0x306350){var _0x5c29a0={};_0x5c29a0[_0x306350]={'$like':'%'+_0x1e3008[_0x2a1e('0x45')][_0x2a1e('0x51')]+'%'};return _0x5c29a0;})});}_0xd827f0=_['merge']({},_0xd827f0,_0x1e3008[_0x2a1e('0x54')]);return db[_0x2a1e('0x6a')]['count']({'where':_0xd827f0[_0x2a1e('0x4f')]})['then'](function(_0x3fb666){_0xbcc96a['count']=_0x3fb666;if(_0x1e3008[_0x2a1e('0x45')]['includeAll']){_0xd827f0[_0x2a1e('0x57')]=[{'all':!![]}];}return db[_0x2a1e('0x6a')][_0x2a1e('0x6d')](_0xd827f0);})[_0x2a1e('0x22')](function(_0x4ccaa0){_0xbcc96a[_0x2a1e('0x58')]=_0x4ccaa0;return _0xbcc96a;});}})[_0x2a1e('0x22')](respondWithFilteredResult(_0x369f73,_0xd827f0))[_0x2a1e('0x2c')](handleError(_0x369f73,null));};exports[_0x2a1e('0x6e')]=function(_0x4d5d66,_0x41799c,_0x38e032){return db[_0x2a1e('0x55')]['find']({'where':{'id':_0x4d5d66[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x41799c,null))[_0x2a1e('0x22')](function(_0x2833ca){if(_0x2833ca){return _0x2833ca[_0x2a1e('0x6e')](_0x4d5d66[_0x2a1e('0x45')]['ids']);}})[_0x2a1e('0x22')](respondWithStatusCode(_0x41799c,null))['catch'](handleError(_0x41799c,null));};exports['addAnswer']=function(_0x23053c,_0x396791,_0x33d4eb){if(_0x23053c[_0x2a1e('0x5f')]['id']){delete _0x23053c[_0x2a1e('0x5f')]['id'];}return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x23053c['params']['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x396791,null))[_0x2a1e('0x22')](function(_0xac52bd){if(_0xac52bd){_0x23053c[_0x2a1e('0x5f')][_0x2a1e('0x6c')]=_0xac52bd['id'];return db[_0x2a1e('0x6f')][_0x2a1e('0x5e')](_0x23053c[_0x2a1e('0x5f')]);}})[_0x2a1e('0x22')](respondWithResult(_0x396791,null))[_0x2a1e('0x2c')](handleError(_0x396791,null));};exports[_0x2a1e('0x70')]=function(_0x1cd165,_0x560ffe,_0x36b907){var _0x569667={'raw':![],'where':{}};var _0x41afb7={};var _0x12e7d2={'count':0x0,'rows':[]};return db[_0x2a1e('0x55')][_0x2a1e('0x71')]({'where':{'id':_0x1cd165[_0x2a1e('0x59')]['id']}})['then'](handleEntityNotFound(_0x560ffe,null))[_0x2a1e('0x22')](function(_0x3b65f8){if(_0x3b65f8){_0x41afb7['model']=_[_0x2a1e('0x5a')](db[_0x2a1e('0x6f')][_0x2a1e('0x5b')]);_0x41afb7[_0x2a1e('0x45')]=_[_0x2a1e('0x5a')](_0x1cd165[_0x2a1e('0x45')]);_0x41afb7[_0x2a1e('0x46')]=_['intersection'](_0x41afb7['model'],_0x41afb7[_0x2a1e('0x45')]);_0x569667[_0x2a1e('0x49')]=_[_0x2a1e('0x47')](_0x41afb7[_0x2a1e('0x48')],qs[_0x2a1e('0x5c')](_0x1cd165[_0x2a1e('0x45')][_0x2a1e('0x5c')]));_0x569667[_0x2a1e('0x49')]=_0x569667[_0x2a1e('0x49')][_0x2a1e('0x4a')]?_0x569667[_0x2a1e('0x49')]:_0x41afb7[_0x2a1e('0x48')];if(!_0x1cd165['query']['hasOwnProperty'](_0x2a1e('0x4c'))){_0x569667['limit']=qs[_0x2a1e('0x31')](_0x1cd165[_0x2a1e('0x45')][_0x2a1e('0x31')]);_0x569667['offset']=qs[_0x2a1e('0x33')](_0x1cd165[_0x2a1e('0x45')]['offset']);}_0x569667[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x1cd165[_0x2a1e('0x45')][_0x2a1e('0x4e')]);_0x569667[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_[_0x2a1e('0x50')](_0x1cd165[_0x2a1e('0x45')],_0x41afb7[_0x2a1e('0x46')]));_0x569667[_0x2a1e('0x4f')][_0x2a1e('0x6c')]=_0x3b65f8['id'];if(_0x1cd165[_0x2a1e('0x45')]['filter']){_0x569667['where']=_[_0x2a1e('0x52')](_0x569667['where'],{'$or':_[_0x2a1e('0x42')](_0x569667[_0x2a1e('0x49')],function(_0xae7949){var _0x2c8275={};_0x2c8275[_0xae7949]={'$like':'%'+_0x1cd165[_0x2a1e('0x45')]['filter']+'%'};return _0x2c8275;})});}_0x569667=_['merge']({},_0x569667,_0x1cd165[_0x2a1e('0x54')]);return db[_0x2a1e('0x6f')][_0x2a1e('0x32')]({'where':_0x569667[_0x2a1e('0x4f')]})[_0x2a1e('0x22')](function(_0xf4c97b){_0x12e7d2[_0x2a1e('0x32')]=_0xf4c97b;if(_0x1cd165[_0x2a1e('0x45')][_0x2a1e('0x56')]){_0x569667[_0x2a1e('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2a1e('0x6d')](_0x569667);})[_0x2a1e('0x22')](function(_0x24360f){_0x12e7d2['rows']=_0x24360f;return _0x12e7d2;});}})[_0x2a1e('0x22')](respondWithFilteredResult(_0x560ffe,_0x569667))[_0x2a1e('0x2c')](handleError(_0x560ffe,null));};exports[_0x2a1e('0x72')]=function(_0x40e77c,_0x2f5d24,_0x5e83e2){return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x40e77c['params']['id']}})['then'](handleEntityNotFound(_0x2f5d24,null))[_0x2a1e('0x22')](function(_0xe100f5){if(_0xe100f5){return _0xe100f5[_0x2a1e('0x72')](_0x40e77c['query']['ids']);}})[_0x2a1e('0x22')](respondWithStatusCode(_0x2f5d24,null))[_0x2a1e('0x2c')](handleError(_0x2f5d24,null));};exports[_0x2a1e('0x73')]=function(_0x877137,_0x24b140,_0x105e04){return db['FaxInteraction'][_0x2a1e('0x5d')]({'where':{'id':_0x877137[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x24b140,null))['then'](function(_0x16d189){if(_0x16d189){return _0x16d189['addInteraction'](_0x877137['body'][_0x2a1e('0x74')],_[_0x2a1e('0x75')](_0x877137[_0x2a1e('0x5f')],[_0x2a1e('0x74'),'id'])||{});}})[_0x2a1e('0x22')](respondWithResult(_0x24b140,null))[_0x2a1e('0x2c')](handleError(_0x24b140,null));};exports[_0x2a1e('0x76')]=function(_0x8b453e,_0x5c4580,_0x3bc623){var _0x37bee2={'raw':![],'where':{}};var _0x18a6ef={};var _0x197248={'count':0x0,'rows':[]};return db[_0x2a1e('0x55')]['findOne']({'where':{'id':_0x8b453e['params']['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x5c4580,null))['then'](function(_0x54fb31){if(_0x54fb31){_0x18a6ef['model']=_[_0x2a1e('0x5a')](db[_0x2a1e('0x77')]['rawAttributes']);_0x18a6ef[_0x2a1e('0x45')]=_[_0x2a1e('0x5a')](_0x8b453e[_0x2a1e('0x45')]);_0x18a6ef[_0x2a1e('0x46')]=_[_0x2a1e('0x47')](_0x18a6ef['model'],_0x18a6ef['query']);_0x37bee2[_0x2a1e('0x49')]=_['intersection'](_0x18a6ef['model'],qs[_0x2a1e('0x5c')](_0x8b453e['query'][_0x2a1e('0x5c')]));_0x37bee2[_0x2a1e('0x49')]=_0x37bee2[_0x2a1e('0x49')]['length']?_0x37bee2[_0x2a1e('0x49')]:_0x18a6ef[_0x2a1e('0x48')];if(!_0x8b453e[_0x2a1e('0x45')][_0x2a1e('0x4b')]('nolimit')){_0x37bee2[_0x2a1e('0x31')]=qs[_0x2a1e('0x31')](_0x8b453e[_0x2a1e('0x45')]['limit']);_0x37bee2['offset']=qs[_0x2a1e('0x33')](_0x8b453e[_0x2a1e('0x45')]['offset']);}_0x37bee2[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x8b453e[_0x2a1e('0x45')]['sort']);_0x37bee2[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_['pick'](_0x8b453e[_0x2a1e('0x45')],_0x18a6ef[_0x2a1e('0x46')]));_0x37bee2['where']['FaxAccountId']=_0x54fb31['id'];if(_0x8b453e[_0x2a1e('0x45')][_0x2a1e('0x51')]){_0x37bee2[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0x37bee2[_0x2a1e('0x4f')],{'$or':_[_0x2a1e('0x42')](_0x37bee2[_0x2a1e('0x49')],function(_0x59720b){var _0x196c8c={};_0x196c8c[_0x59720b]={'$like':'%'+_0x8b453e[_0x2a1e('0x45')]['filter']+'%'};return _0x196c8c;})});}_0x37bee2=_[_0x2a1e('0x52')]({},_0x37bee2,_0x8b453e[_0x2a1e('0x54')]);return db['FaxInteraction'][_0x2a1e('0x32')]({'where':_0x37bee2[_0x2a1e('0x4f')]})[_0x2a1e('0x22')](function(_0x53af64){_0x197248[_0x2a1e('0x32')]=_0x53af64;if(_0x8b453e[_0x2a1e('0x45')][_0x2a1e('0x56')]){_0x37bee2[_0x2a1e('0x57')]=[{'model':db[_0x2a1e('0x78')],'as':'Contact','required':![]},{'model':db[_0x2a1e('0x79')],'as':_0x2a1e('0x7a'),'attributes':['name',_0x2a1e('0x7b'),'internal'],'required':![]},{'model':db[_0x2a1e('0x7c')],'as':_0x2a1e('0x7d'),'attributes':['id','name','color'],'where':_0x8b453e[_0x2a1e('0x45')]['tag']?{'id':_0x8b453e[_0x2a1e('0x45')][_0x2a1e('0x7e')]}:undefined,'required':_0x8b453e['query'][_0x2a1e('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x2a1e('0x6d')](_0x37bee2);})['then'](function(_0x156fa0){_0x197248[_0x2a1e('0x58')]=_0x156fa0;return _0x197248;});}})[_0x2a1e('0x22')](respondWithFilteredResult(_0x5c4580,_0x37bee2))[_0x2a1e('0x2c')](handleError(_0x5c4580,null));};exports[_0x2a1e('0x7f')]=function(_0x511d32,_0x212f1d,_0x1aadd3){return db['FaxAccount'][_0x2a1e('0x71')]({'where':{'id':_0x511d32['params']['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x212f1d,null))[_0x2a1e('0x22')](function(_0x3f97df){if(_0x3f97df){return db[_0x2a1e('0x80')][_0x2a1e('0x81')](function(_0x4ae516){return db[_0x2a1e('0x82')][_0x2a1e('0x39')]({'where':{'FaxAccountId':_0x511d32[_0x2a1e('0x59')]['id']},'transaction':_0x4ae516})['then'](function(_0xbb5bc3){var _0x2e0bae=_['map'](_0x511d32[_0x2a1e('0x5f')],function(_0x17fa7e){_0x17fa7e['FaxAccountId']=_0x511d32[_0x2a1e('0x59')]['id'];return _0x17fa7e;});return db['FaxApplication'][_0x2a1e('0x83')](_0x2e0bae,{'transaction':_0x4ae516});});})[_0x2a1e('0x22')](function(){return db['FaxApplication'][_0x2a1e('0x84')]({'where':{'FaxAccountId':_0x511d32['params']['id']},'order':'priority'});});}})[_0x2a1e('0x22')](respondWithResult(_0x212f1d,null))[_0x2a1e('0x2c')](handleError(_0x212f1d,null));};exports[_0x2a1e('0x85')]=function(_0x1b5f77,_0x5b8b2d,_0x513edb){var _0x1160f3={};var _0x344f80={};var _0xb8c922;var _0x2d8c50;return db['FaxAccount'][_0x2a1e('0x71')]({'where':{'id':_0x1b5f77[_0x2a1e('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b8b2d,null))[_0x2a1e('0x22')](function(_0x2ed6c2){if(_0x2ed6c2){_0xb8c922=_0x2ed6c2;_0x344f80[_0x2a1e('0x48')]=_[_0x2a1e('0x5a')](db[_0x2a1e('0x82')][_0x2a1e('0x5b')]);_0x344f80[_0x2a1e('0x45')]=_[_0x2a1e('0x5a')](_0x1b5f77[_0x2a1e('0x45')]);_0x344f80[_0x2a1e('0x46')]=_[_0x2a1e('0x47')](_0x344f80[_0x2a1e('0x48')],_0x344f80['query']);_0x1160f3[_0x2a1e('0x49')]=_[_0x2a1e('0x47')](_0x344f80['model'],qs[_0x2a1e('0x5c')](_0x1b5f77[_0x2a1e('0x45')][_0x2a1e('0x5c')]));_0x1160f3[_0x2a1e('0x49')]=_0x1160f3['attributes'][_0x2a1e('0x4a')]?_0x1160f3[_0x2a1e('0x49')]:_0x344f80[_0x2a1e('0x48')];_0x1160f3[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x1b5f77[_0x2a1e('0x45')][_0x2a1e('0x4e')]);_0x1160f3[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_[_0x2a1e('0x50')](_0x1b5f77['query'],_0x344f80[_0x2a1e('0x46')]));if(_0x1b5f77[_0x2a1e('0x45')][_0x2a1e('0x51')]){_0x1160f3[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0x1160f3[_0x2a1e('0x4f')],{'$or':_[_0x2a1e('0x42')](_0x1160f3[_0x2a1e('0x49')],function(_0x444be3){var _0x1a9e45={};_0x1a9e45[_0x444be3]={'$like':'%'+_0x1b5f77['query']['filter']+'%'};return _0x1a9e45;})});}_0x1160f3=_[_0x2a1e('0x52')]({},_0x1160f3,_0x1b5f77['options']);return _0xb8c922[_0x2a1e('0x85')](_0x1160f3);}})['then'](function(_0x4ab294){if(_0x4ab294){_0x2d8c50=_0x4ab294[_0x2a1e('0x4a')];if(!_0x1b5f77['query'][_0x2a1e('0x4b')](_0x2a1e('0x4c'))){_0x1160f3[_0x2a1e('0x31')]=qs[_0x2a1e('0x31')](_0x1b5f77[_0x2a1e('0x45')][_0x2a1e('0x31')]);_0x1160f3[_0x2a1e('0x33')]=qs[_0x2a1e('0x33')](_0x1b5f77[_0x2a1e('0x45')][_0x2a1e('0x33')]);}return _0xb8c922[_0x2a1e('0x85')](_0x1160f3);}})['then'](function(_0x472dfc){if(_0x472dfc){return _0x472dfc?{'count':_0x2d8c50,'rows':_0x472dfc}:null;}})[_0x2a1e('0x22')](respondWithResult(_0x5b8b2d,null))['catch'](handleError(_0x5b8b2d,null));};function Extension(_0x492a42,_0xc066a1,_0x48cb94,_0x5174df){this[_0x2a1e('0x86')]=_0x2a1e('0x87');this[_0x2a1e('0x88')]=_0x492a42[_0x2a1e('0x89')];this['app']=_0x5174df;this[_0x2a1e('0x44')]=_0x2a1e('0x8a');this[_0x2a1e('0x8b')]=_0x2a1e('0x8c');this[_0x2a1e('0x6c')]=_0x492a42['id'];this[_0x2a1e('0x8d')]=_0xc066a1;this[_0x2a1e('0x8e')]=_0x48cb94;}function createExtensionsReciveFax(_0x30f792){var _0x1aab31=0x1;var _0x2c4e4f=[];_0x2c4e4f[_0x2a1e('0x8f')](new Extension(_0x30f792,_0x1aab31,'',_0x2a1e('0x90')));_0x1aab31+=0x1;_0x2c4e4f['push'](new Extension(_0x30f792,_0x1aab31,_0x2a1e('0x91'),'Set'));_0x1aab31+=0x1;for(var _0x1c9db1 in _0x30f792){if(_0x30f792['hasOwnProperty'](_0x1c9db1)&&(_0x1c9db1==='ecm'||_0x1c9db1==='localstationid'||_0x1c9db1===_0x2a1e('0x92')||_0x1c9db1==='faxdetect'||_0x1c9db1===_0x2a1e('0x93')||_0x1c9db1==='maxrate'||_0x1c9db1===_0x2a1e('0x94')||_0x1c9db1===_0x2a1e('0x95')||_0x1c9db1==='t38timeout')){_0x2c4e4f[_0x2a1e('0x8f')](new Extension(_0x30f792,_0x1aab31,_0x2a1e('0x96')+_0x1c9db1+')='+_0x30f792[_0x1c9db1],_0x2a1e('0x97')));_0x1aab31+=0x1;}}_0x2c4e4f[_0x2a1e('0x8f')](new Extension(_0x30f792,_0x1aab31,'6',_0x2a1e('0x98')));_0x1aab31+=0x1;_0x2c4e4f[_0x2a1e('0x8f')](new Extension(_0x30f792,_0x1aab31,_0x2a1e('0x99'),_0x2a1e('0x9a')));_0x1aab31=0x0;return _0x2c4e4f;}exports[_0x2a1e('0x9b')]=function(_0x1d928,_0x10f095,_0x336c94){var _0x4c72a3;return db['sequelize'][_0x2a1e('0x81')](function(_0xa49135){return db[_0x2a1e('0x55')]['create'](_0x1d928[_0x2a1e('0x5f')],{'transaction':_0xa49135})['then'](function(_0xda6ac9){_0x4c72a3=_0xda6ac9['get']({'plain':!![]});return db[_0x2a1e('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x4c72a3),{'transaction':_0xa49135});});})[_0x2a1e('0x22')](function(){return _0x4c72a3;})[_0x2a1e('0x22')](respondWithResult(_0x10f095,null))[_0x2a1e('0x2c')](handleError(_0x10f095,null));};exports['updateAccountApplications']=function(_0x2f8f92,_0x3088a4,_0x53e163){var _0x344095;return db[_0x2a1e('0x80')][_0x2a1e('0x81')](function(_0x2e751b){return db['FaxAccount'][_0x2a1e('0x38')](_0x2f8f92[_0x2a1e('0x5f')],{'where':{'id':_0x2f8f92[_0x2a1e('0x5f')]['id']},'transaction':_0x2e751b})[_0x2a1e('0x22')](function(_0xce12cd){return db[_0x2a1e('0x9c')]['destroy']({'where':{'FaxAccountId':_0x2f8f92[_0x2a1e('0x5f')]['id']},'transaction':_0x2e751b})[_0x2a1e('0x22')](function(_0x5e9a07){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x2a1e('0x75')](_0x2f8f92[_0x2a1e('0x5f')],[_0x2a1e('0x9d'),_0x2a1e('0x9e'),'createdAt','updatedAt',_0x2a1e('0x9f'),'ListId'])),{'transaction':_0x2e751b});});});})[_0x2a1e('0x22')](function(){return db[_0x2a1e('0x55')][_0x2a1e('0xa0')](_0x2f8f92[_0x2a1e('0x5f')]['id']);})[_0x2a1e('0x22')](respondWithResult(_0x3088a4,null))['catch'](handleError(_0x3088a4,null));};exports['getMessages']=function(_0x2b58dd,_0x434cc0,_0x464a61){var _0x259190={'raw':!![],'where':{}};var _0x470191={};var _0x52d7ce={'count':0x0,'rows':[]};return db[_0x2a1e('0x55')][_0x2a1e('0x71')]({'where':{'id':_0x2b58dd[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x434cc0,null))['then'](function(_0x59b8c6){if(_0x59b8c6){_0x470191[_0x2a1e('0x48')]=_[_0x2a1e('0x5a')](db[_0x2a1e('0xa1')][_0x2a1e('0x5b')]);_0x470191['query']=_[_0x2a1e('0x5a')](_0x2b58dd[_0x2a1e('0x45')]);_0x470191[_0x2a1e('0x46')]=_[_0x2a1e('0x47')](_0x470191[_0x2a1e('0x48')],_0x470191[_0x2a1e('0x45')]);_0x259190[_0x2a1e('0x49')]=_[_0x2a1e('0x47')](_0x470191[_0x2a1e('0x48')],qs[_0x2a1e('0x5c')](_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0x5c')]));_0x259190[_0x2a1e('0x49')]=_0x259190['attributes'][_0x2a1e('0x4a')]?_0x259190['attributes']:_0x470191[_0x2a1e('0x48')];if(!_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0x4b')]('nolimit')){_0x259190[_0x2a1e('0x31')]=qs[_0x2a1e('0x31')](_0x2b58dd['query'][_0x2a1e('0x31')]);_0x259190[_0x2a1e('0x33')]=qs[_0x2a1e('0x33')](_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0x33')]);}_0x259190[_0x2a1e('0x4d')]=qs[_0x2a1e('0x4e')](_0x2b58dd[_0x2a1e('0x45')]['sort']);_0x259190[_0x2a1e('0x4f')]=qs[_0x2a1e('0x46')](_[_0x2a1e('0x50')](_0x2b58dd[_0x2a1e('0x45')],_0x470191[_0x2a1e('0x46')]));_0x259190[_0x2a1e('0x4f')][_0x2a1e('0x6c')]=_0x59b8c6['id'];if(_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0x51')]){_0x259190[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0x259190['where'],{'$or':_[_0x2a1e('0x42')](_0x259190['attributes'],function(_0x553b55){var _0x1fdeef={};_0x1fdeef[_0x553b55]={'$like':'%'+_0x2b58dd['query'][_0x2a1e('0x51')]+'%'};return _0x1fdeef;})});}if(_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0xa2')]){var _0x2d0e76=_0x2b58dd[_0x2a1e('0x45')]['$gte']['split'](',');var _0x41dab2={};_0x41dab2[_0x2d0e76[0x0]]={'$gte':moment(_0x2d0e76[0x1])[_0x2a1e('0xa3')](_0x2a1e('0xa4'))};_0x259190[_0x2a1e('0x4f')]=_['merge'](_0x259190[_0x2a1e('0x4f')],_0x41dab2);}_0x259190=_[_0x2a1e('0x52')]({},_0x259190,_0x2b58dd[_0x2a1e('0x54')]);return db['FaxMessage'][_0x2a1e('0x32')]({'where':_0x259190['where']})[_0x2a1e('0x22')](function(_0x5d4f6f){_0x52d7ce['count']=_0x5d4f6f;if(_0x2b58dd[_0x2a1e('0x45')][_0x2a1e('0x56')]){_0x259190[_0x2a1e('0x57')]=[{'all':!![]}];}return db[_0x2a1e('0xa1')]['findAll'](_0x259190);})[_0x2a1e('0x22')](function(_0x5b9bf9){_0x52d7ce[_0x2a1e('0x58')]=_0x5b9bf9;return _0x52d7ce;});}})['then'](respondWithFilteredResult(_0x434cc0,_0x259190))[_0x2a1e('0x2c')](handleError(_0x434cc0,null));};exports[_0x2a1e('0x3e')]=function(_0x4ac9b5,_0x31531b,_0x4d739a){var _0x236a9a,_0x1e975c={},_0x4a32ea;if(_0x4ac9b5['body']['to']){_0x4a32ea=_0x4ac9b5['body']['to'][0x0];}return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x4ac9b5[_0x2a1e('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x2a1e('0xa5'),'include':[{'model':db[_0x2a1e('0x78')],'as':_0x2a1e('0xa6'),'where':{'fax':_0x4a32ea},'limit':0x1,'order':[['updatedAt',_0x2a1e('0xa7')]]}]}]})[_0x2a1e('0x22')](handleEntityNotFound(_0x31531b,null))[_0x2a1e('0x22')](function(_0x3ba185){_0x236a9a=_0x3ba185;if(_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')]&&_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][_0x2a1e('0x4a')]){for(var _0x1a7689=0x0;_0x1a7689<_0x4ac9b5['body']['attachments']['length'];_0x1a7689+=0x1){_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][_0x1a7689]={'filename':_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][_0x1a7689]['name'],'id':_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][_0x1a7689]['id'],'path':path[_0x2a1e('0xa9')](config[_0x2a1e('0xaa')],_0x2a1e('0xab'),_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][_0x1a7689][_0x2a1e('0xac')])};}}return respondWithRpcPromise(_0x2a1e('0xad'),_0x2a1e('0xad'),{'FaxAccountId':_[_0x2a1e('0xae')](_0x4ac9b5['params']['id'])?undefined:_0x4ac9b5[_0x2a1e('0x59')]['id'],'path':_[_0x2a1e('0xae')](_0x4ac9b5['body'][_0x2a1e('0xa8')][0x0][_0x2a1e('0x8')])?undefined:_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][0x0]['path'],'fax':_[_0x2a1e('0xae')](_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0])?undefined:_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0]},client9002);})[_0x2a1e('0x22')](function(){if(_0x236a9a){if(_['isNil'](_0x4ac9b5['body'][_0x2a1e('0xaf')])){_0x4ac9b5['body'][_0x2a1e('0xaf')]=util[_0x2a1e('0xa3')](_0x2a1e('0xb0'),_0x236a9a['name'],_0x236a9a[_0x2a1e('0xb1')]);}if(_0x236a9a['List']){if(_0x236a9a[_0x2a1e('0xa5')]['Contacts'][_0x2a1e('0x4a')]){return _0x236a9a[_0x2a1e('0xa5')][_0x2a1e('0xa6')][0x0];}else{return db[_0x2a1e('0x78')][_0x2a1e('0x5e')](_[_0x2a1e('0x1c')](_0x4ac9b5['body'],{'firstName':_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0],'phone':_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0],'fax':_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0],'ListId':_0x236a9a[_0x2a1e('0xb2')]}));}}else{throw new Error(_0x2a1e('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x388ace){if(_0x388ace){return db[_0x2a1e('0x77')][_0x2a1e('0x5d')]({'where':{'ContactId':_0x388ace['id'],'closed':![],'FaxAccountId':_0x236a9a['id']}})[_0x2a1e('0x22')](function(_0x4390ee){if(_0x4390ee){return[_0x4390ee,![]];}return db[_0x2a1e('0x77')][_0x2a1e('0x5e')]({'UserId':_0x4ac9b5[_0x2a1e('0x63')]['id'],'ContactId':_0x388ace['id'],'FaxAccountId':_0x236a9a['id'],'fax':_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0],'firstMsgDirection':_0x2a1e('0xb4'),'Messages':[_['merge'](_0x4ac9b5[_0x2a1e('0x5f')],{'read':![],'body':_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][0x0][_0x2a1e('0xb5')],'FaxAccountId':_0x236a9a['id'],'UserId':_0x4ac9b5[_0x2a1e('0x63')]['id'],'ContactId':_0x388ace['id'],'AttachmentId':_0x4ac9b5['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x2a1e('0x22')](function(_0x568386){return[_0x568386,!![]];});});}else{throw new Error(_0x2a1e('0xb6'));}})[_0x2a1e('0xb7')](function(_0x310d3f,_0x9502fe){if(_0x9502fe){return _0x310d3f;}return db[_0x2a1e('0xa1')][_0x2a1e('0x5e')]({'direction':'out','read':![],'body':_0x4ac9b5[_0x2a1e('0x5f')]['attachments'][0x0][_0x2a1e('0xb5')],'FaxAccountId':_0x236a9a['id'],'FaxInteractionId':_0x310d3f['id'],'UserId':_0x4ac9b5[_0x2a1e('0x63')]['id'],'ContactId':_0x310d3f[_0x2a1e('0xb8')],'AttachmentId':_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][0x0]['id']})[_0x2a1e('0x22')](function(_0x5a6d21){_0x310d3f[_0x2a1e('0xb9')][_0x2a1e('0xba')]=[];_0x310d3f[_0x2a1e('0xb9')]['Messages'][_0x2a1e('0x8f')](_0x5a6d21[_0x2a1e('0xb9')]);return _0x310d3f;});})[_0x2a1e('0x22')](function(_0x4e660f){respondWithRpcPromise(_0x2a1e('0xbb'),'SendFax',{'FaxAccountId':_['isNil'](_0x4ac9b5[_0x2a1e('0x59')]['id'])?undefined:_0x4ac9b5[_0x2a1e('0x59')]['id'],'path':_['isNil'](_0x4ac9b5[_0x2a1e('0x5f')]['attachments'][0x0]['path'])?undefined:_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][0x0][_0x2a1e('0x8')],'fax':_[_0x2a1e('0xae')](_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0])?undefined:_0x4ac9b5[_0x2a1e('0x5f')]['to'][0x0],'AttachmentId':_0x4ac9b5[_0x2a1e('0x5f')][_0x2a1e('0xa8')][0x0]['id']},client9002)[_0x2a1e('0x22')](function(_0x351732){logger[_0x2a1e('0x23')]('SendFaxRpc,\x20%s',_0x351732);})[_0x2a1e('0x2c')](function(_0x2ca359){logger['info'](_0x2a1e('0xbc'),_0x2ca359);});return _0x4e660f;})[_0x2a1e('0x22')](respondWithResult(_0x31531b,null))[_0x2a1e('0x2c')](handleError(_0x31531b,null));};exports[_0x2a1e('0xbd')]=function(_0x878349,_0x1c3cc4,_0x2accdd){return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x878349[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x1c3cc4,null))['then'](function(_0x15442a){if(_0x15442a){return _0x15442a[_0x2a1e('0xbd')](_0x878349[_0x2a1e('0x5f')]['ids'],_[_0x2a1e('0x75')](_0x878349[_0x2a1e('0x5f')],[_0x2a1e('0x74'),'id'])||{})['spread'](function(_0x1e841a){for(var _0x5761df=0x0;_0x5761df<_0x878349[_0x2a1e('0x5f')]['ids'][_0x2a1e('0x4a')];_0x5761df+=0x1){socket['emit'](_0x2a1e('0xbe'),{'UserId':Number(_0x878349['body'][_0x2a1e('0x74')][_0x5761df]),'FaxAccountId':Number(_0x878349[_0x2a1e('0x59')]['id'])});}return _0x1e841a;});}})['then'](respondWithResult(_0x1c3cc4,null))[_0x2a1e('0x2c')](handleError(_0x1c3cc4,null));};exports[_0x2a1e('0xbf')]=function(_0x4b1bd3,_0x2f4f93,_0x2ddbf5){return db[_0x2a1e('0x55')][_0x2a1e('0x5d')]({'where':{'id':_0x4b1bd3[_0x2a1e('0x59')]['id']}})[_0x2a1e('0x22')](handleEntityNotFound(_0x2f4f93,null))['then'](function(_0x2b82ad){if(_0x2b82ad){return _0x2b82ad[_0x2a1e('0xbf')](_0x4b1bd3['query'][_0x2a1e('0x74')])[_0x2a1e('0x22')](function(){if(_['isArray'](_0x4b1bd3[_0x2a1e('0x45')][_0x2a1e('0x74')])){for(var _0x3ecdd2=0x0;_0x3ecdd2<_0x4b1bd3[_0x2a1e('0x45')][_0x2a1e('0x74')][_0x2a1e('0x4a')];_0x3ecdd2+=0x1){socket[_0x2a1e('0xc0')](_0x2a1e('0xc1'),{'UserId':Number(_0x4b1bd3[_0x2a1e('0x45')][_0x2a1e('0x74')][_0x3ecdd2]),'FaxAccountId':Number(_0x4b1bd3['params']['id'])});}}else{socket[_0x2a1e('0xc0')](_0x2a1e('0xc1'),{'UserId':Number(_0x4b1bd3[_0x2a1e('0x45')]['ids']),'FaxAccountId':Number(_0x4b1bd3[_0x2a1e('0x59')]['id'])});}});}})[_0x2a1e('0x22')](respondWithStatusCode(_0x2f4f93,null))[_0x2a1e('0x2c')](handleError(_0x2f4f93,null));};exports['getAgents']=function(_0x8646c2,_0x7141af,_0x589219){var _0x5b317e={};var _0x46ea1b={};var _0x49b31c;var _0x3bcd1a;return db[_0x2a1e('0x55')][_0x2a1e('0x71')]({'where':{'id':_0x8646c2[_0x2a1e('0x59')]['id']}})['then'](handleEntityNotFound(_0x7141af,null))[_0x2a1e('0x22')](function(_0x26c232){if(_0x26c232){_0x49b31c=_0x26c232;_0x46ea1b[_0x2a1e('0x48')]=_['keys'](db[_0x2a1e('0x79')]['rawAttributes']);_0x46ea1b[_0x2a1e('0x45')]=_['keys'](_0x8646c2['query']);_0x46ea1b[_0x2a1e('0x46')]=_['intersection'](_0x46ea1b['model'],_0x46ea1b['query']);_0x5b317e[_0x2a1e('0x49')]=_[_0x2a1e('0x47')](_0x46ea1b[_0x2a1e('0x48')],qs[_0x2a1e('0x5c')](_0x8646c2[_0x2a1e('0x45')]['fields']));_0x5b317e['attributes']=_0x5b317e['attributes']['length']?_0x5b317e[_0x2a1e('0x49')]:_0x46ea1b[_0x2a1e('0x48')];_0x5b317e['order']=qs[_0x2a1e('0x4e')](_0x8646c2['query'][_0x2a1e('0x4e')]);_0x5b317e['where']=qs[_0x2a1e('0x46')](_['pick'](_0x8646c2['query'],_0x46ea1b[_0x2a1e('0x46')]));if(_0x8646c2[_0x2a1e('0x45')][_0x2a1e('0x51')]){_0x5b317e[_0x2a1e('0x4f')]=_[_0x2a1e('0x52')](_0x5b317e[_0x2a1e('0x4f')],{'$or':_[_0x2a1e('0x42')](_0x5b317e[_0x2a1e('0x49')],function(_0x45fe0d){var _0x25badf={};_0x25badf[_0x45fe0d]={'$like':'%'+_0x8646c2[_0x2a1e('0x45')]['filter']+'%'};return _0x25badf;})});}_0x5b317e=_[_0x2a1e('0x52')]({},_0x5b317e,_0x8646c2['options']);return _0x49b31c[_0x2a1e('0xc2')](_0x5b317e);}})[_0x2a1e('0x22')](function(_0x28951d){if(_0x28951d){_0x3bcd1a=_0x28951d[_0x2a1e('0x4a')];if(!_0x8646c2[_0x2a1e('0x45')][_0x2a1e('0x4b')](_0x2a1e('0x4c'))){_0x5b317e['limit']=qs[_0x2a1e('0x31')](_0x8646c2[_0x2a1e('0x45')]['limit']);_0x5b317e[_0x2a1e('0x33')]=qs['offset'](_0x8646c2[_0x2a1e('0x45')][_0x2a1e('0x33')]);}return _0x49b31c[_0x2a1e('0xc2')](_0x5b317e);}})[_0x2a1e('0x22')](function(_0x297b1d){if(_0x297b1d){return _0x297b1d?{'count':_0x3bcd1a,'rows':_0x297b1d}:null;}})[_0x2a1e('0x22')](respondWithResult(_0x7141af,null))[_0x2a1e('0x2c')](handleError(_0x7141af,null));}; \ No newline at end of file +var _0x434d=['stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','sendStatus','stack','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','split','format','CmList','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56a94b,_0x4459bc){var _0x341cdb=function(_0x21eaf9){while(--_0x21eaf9){_0x56a94b['push'](_0x56a94b['shift']());}};_0x341cdb(++_0x4459bc);}(_0x434d,0x169));var _0xd434=function(_0x28a67d,_0x38c357){_0x28a67d=_0x28a67d-0x0;var _0x3711aa=_0x434d[_0x28a67d];return _0x3711aa;};'use strict';var emlformat=require(_0xd434('0x0'));var rimraf=require(_0xd434('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd434('0x2'));var rp=require(_0xd434('0x3'));var moment=require(_0xd434('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd434('0x5'));var util=require(_0xd434('0x6'));var path=require(_0xd434('0x7'));var sox=require('sox');var csv=require(_0xd434('0x8'));var ejs=require(_0xd434('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd434('0xa'));var squel=require(_0xd434('0xb'));var crypto=require(_0xd434('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd434('0x8'));var querystring=require(_0xd434('0xd'));var Papa=require(_0xd434('0xe'));var Redis=require('ioredis');var authService=require(_0xd434('0xf'));var qs=require(_0xd434('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd434('0x11'));var utils=require(_0xd434('0x12'));var config=require(_0xd434('0x13'));var licenseUtil=require(_0xd434('0x14'));var db=require(_0xd434('0x15'))['db'];config[_0xd434('0x16')]=_[_0xd434('0x17')](config[_0xd434('0x16')],{'host':_0xd434('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0xd434('0x19')](socket);var jayson=require(_0xd434('0x1a'));var client=jayson[_0xd434('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xd434('0x1b')][_0xd434('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4f1c85,_0x29e419,_0x320831,_0x20ca54){return new BPromise(function(_0xb7d5f1,_0x4105ca){var _0x4f3190=_0x20ca54||client;return _0x4f3190[_0xd434('0x1d')](_0x4f1c85,_0x320831)[_0xd434('0x1e')](function(_0x102af2){logger[_0xd434('0x1f')](_0xd434('0x20'),_0x29e419,_0xd434('0x21'));logger[_0xd434('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x29e419,'request\x20sent',JSON[_0xd434('0x23')](_0x102af2));if(_0x102af2[_0xd434('0x24')]){if(_0x102af2[_0xd434('0x24')][_0xd434('0x25')]===0x1f4){logger[_0xd434('0x24')](_0xd434('0x20'),_0x29e419,_0x102af2[_0xd434('0x24')][_0xd434('0x26')]);return _0x4105ca(_0x102af2[_0xd434('0x24')][_0xd434('0x26')]);}logger[_0xd434('0x24')](_0xd434('0x20'),_0x29e419,_0x102af2[_0xd434('0x24')]['message']);return _0xb7d5f1(_0x102af2[_0xd434('0x24')]['message']);}else{logger[_0xd434('0x1f')](_0xd434('0x20'),_0x29e419,_0xd434('0x21'));_0xb7d5f1(_0x102af2[_0xd434('0x27')][_0xd434('0x26')]);}})[_0xd434('0x28')](function(_0x3cbe3c){logger[_0xd434('0x24')](_0xd434('0x20'),_0x29e419,_0x3cbe3c);_0x4105ca(_0x3cbe3c);});});}function respondWithStatusCode(_0x53e80d,_0x5e5f1e){_0x5e5f1e=_0x5e5f1e||0xcc;return function(_0x2ecd41){if(_0x2ecd41){return _0x53e80d['sendStatus'](_0x5e5f1e);}return _0x53e80d['status'](_0x5e5f1e)['end']();};}function respondWithResult(_0x5ac07e,_0x11f36a){_0x11f36a=_0x11f36a||0xc8;return function(_0x44ec27){if(_0x44ec27){return _0x5ac07e[_0xd434('0x29')](_0x11f36a)[_0xd434('0x2a')](_0x44ec27);}};}function respondWithFilteredResult(_0x4a7b9e,_0x4f3492){return function(_0x17a9e6){if(_0x17a9e6){var _0x3a5727=typeof _0x4f3492[_0xd434('0x2b')]===_0xd434('0x2c')&&typeof _0x4f3492[_0xd434('0x2d')]===_0xd434('0x2c');var _0x422921=_0x17a9e6[_0xd434('0x2e')];var _0xf92281=_0x3a5727?0x0:_0x4f3492[_0xd434('0x2b')];var _0x172f51=_0x3a5727?_0x17a9e6['count']:_0x4f3492['offset']+_0x4f3492[_0xd434('0x2d')];var _0x43b57d;if(_0x172f51>=_0x422921){_0x172f51=_0x422921;_0x43b57d=0xc8;}else{_0x43b57d=0xce;}_0x4a7b9e[_0xd434('0x29')](_0x43b57d);return _0x4a7b9e[_0xd434('0x2f')](_0xd434('0x30'),_0xf92281+'-'+_0x172f51+'/'+_0x422921)[_0xd434('0x2a')](_0x17a9e6);}return null;};}function patchUpdates(_0x38adcb){return function(_0x4a5342){try{jsonpatch[_0xd434('0x31')](_0x4a5342,_0x38adcb,!![]);}catch(_0x1b1a50){return BPromise[_0xd434('0x32')](_0x1b1a50);}return _0x4a5342[_0xd434('0x33')]();};}function saveUpdates(_0x1cee6f,_0x1ecc39){return function(_0x529741){if(_0x529741){return _0x529741[_0xd434('0x34')](_0x1cee6f)['then'](function(_0x5590f){return _0x5590f;});}return null;};}function removeEntity(_0x55548f,_0x2e87ee){return function(_0x417f2d){if(_0x417f2d){return _0x417f2d[_0xd434('0x35')]()[_0xd434('0x1e')](function(){var _0x1f87b9=_0x417f2d['get']({'plain':!![]});var _0x56c513='FaxAccounts';return db[_0xd434('0x36')]['destroy']({'where':{'type':_0x56c513,'resourceId':_0x1f87b9['id']}})[_0xd434('0x1e')](function(){return _0x417f2d;});})[_0xd434('0x1e')](function(){_0x55548f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5af608,_0x2dc288){return function(_0x30ef09){if(!_0x30ef09){_0x5af608[_0xd434('0x37')](0x194);}return _0x30ef09;};}function handleError(_0x347c9d,_0x28822e){_0x28822e=_0x28822e||0x1f4;return function(_0x533aa9){logger[_0xd434('0x24')](_0x533aa9[_0xd434('0x38')]);if(_0x533aa9['name']){delete _0x533aa9['name'];}_0x347c9d['status'](_0x28822e)[_0xd434('0x39')](_0x533aa9);};}exports[_0xd434('0x3a')]=function(_0x4a0c95,_0x4cedac){var _0x10e27b={'include':[{'model':db['Pause'],'as':_0xd434('0x3b')}]},_0x37db0b={},_0x9a1217={'count':0x0,'rows':[]};var _0x3a8396=_[_0xd434('0x3c')](db['FaxAccount'][_0xd434('0x3d')],function(_0x59c5a4){return{'name':_0x59c5a4[_0xd434('0x3e')],'type':_0x59c5a4[_0xd434('0x3f')]['key']};});_0x37db0b[_0xd434('0x40')]=_[_0xd434('0x3c')](_0x3a8396,_0xd434('0x41'));_0x37db0b[_0xd434('0x42')]=_[_0xd434('0x43')](_0x4a0c95[_0xd434('0x42')]);_0x37db0b[_0xd434('0x44')]=_[_0xd434('0x45')](_0x37db0b['model'],_0x37db0b[_0xd434('0x42')]);_0x10e27b[_0xd434('0x46')]=_[_0xd434('0x45')](_0x37db0b['model'],qs['fields'](_0x4a0c95[_0xd434('0x42')][_0xd434('0x47')]));_0x10e27b[_0xd434('0x46')]=_0x10e27b['attributes']['length']?_0x10e27b[_0xd434('0x46')]:_0x37db0b[_0xd434('0x40')];if(!_0x4a0c95[_0xd434('0x42')][_0xd434('0x48')](_0xd434('0x49'))){_0x10e27b[_0xd434('0x2d')]=qs[_0xd434('0x2d')](_0x4a0c95[_0xd434('0x42')][_0xd434('0x2d')]);_0x10e27b[_0xd434('0x2b')]=qs['offset'](_0x4a0c95[_0xd434('0x42')][_0xd434('0x2b')]);}_0x10e27b[_0xd434('0x4a')]=qs['sort'](_0x4a0c95[_0xd434('0x42')][_0xd434('0x4b')]);_0x10e27b[_0xd434('0x4c')]=qs[_0xd434('0x44')](_[_0xd434('0x4d')](_0x4a0c95[_0xd434('0x42')],_0x37db0b[_0xd434('0x44')]),_0x3a8396);if(_0x4a0c95[_0xd434('0x42')][_0xd434('0x4e')]){_0x10e27b['where']=_[_0xd434('0x4f')](_0x10e27b[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x3a8396,function(_0x2996cf){if(_0x2996cf[_0xd434('0x3f')]!==_0xd434('0x50')){var _0x64514e={};_0x64514e[_0x2996cf[_0xd434('0x41')]]={'$like':'%'+_0x4a0c95['query'][_0xd434('0x4e')]+'%'};return _0x64514e;}})});}_0x10e27b=_[_0xd434('0x4f')]({},_0x10e27b,_0x4a0c95[_0xd434('0x51')]);var _0xf1bd23={'where':_0x10e27b[_0xd434('0x4c')]};return db[_0xd434('0x52')][_0xd434('0x2e')](_0xf1bd23)[_0xd434('0x1e')](function(_0x631397){_0x9a1217[_0xd434('0x2e')]=_0x631397;if(_0x4a0c95[_0xd434('0x42')][_0xd434('0x53')]){_0x10e27b[_0xd434('0x54')]=[{'all':!![]}];}return db[_0xd434('0x52')][_0xd434('0x55')](_0x10e27b);})[_0xd434('0x1e')](function(_0x3db8fb){_0x9a1217[_0xd434('0x56')]=_0x3db8fb;return _0x9a1217;})['then'](respondWithFilteredResult(_0x4cedac,_0x10e27b))[_0xd434('0x28')](handleError(_0x4cedac,null));};exports[_0xd434('0x57')]=function(_0x2c7bd6,_0xf6801e){var _0x56c0fe={'raw':![],'where':{'id':_0x2c7bd6[_0xd434('0x58')]['id']},'include':[{'model':db[_0xd434('0x59')],'as':_0xd434('0x3b')}]},_0x3f94d6={};_0x3f94d6[_0xd434('0x40')]=_[_0xd434('0x43')](db[_0xd434('0x52')][_0xd434('0x3d')]);_0x3f94d6[_0xd434('0x42')]=_['keys'](_0x2c7bd6['query']);_0x3f94d6[_0xd434('0x44')]=_[_0xd434('0x45')](_0x3f94d6['model'],_0x3f94d6[_0xd434('0x42')]);_0x56c0fe[_0xd434('0x46')]=_[_0xd434('0x45')](_0x3f94d6[_0xd434('0x40')],qs[_0xd434('0x47')](_0x2c7bd6[_0xd434('0x42')][_0xd434('0x47')]));_0x56c0fe[_0xd434('0x46')]=_0x56c0fe[_0xd434('0x46')][_0xd434('0x5a')]?_0x56c0fe[_0xd434('0x46')]:_0x3f94d6[_0xd434('0x40')];if(_0x2c7bd6[_0xd434('0x42')][_0xd434('0x53')]){_0x56c0fe[_0xd434('0x54')]=[{'all':!![]}];}_0x56c0fe=_[_0xd434('0x4f')]({},_0x56c0fe,_0x2c7bd6['options']);return db[_0xd434('0x52')][_0xd434('0x5b')](_0x56c0fe)['then'](handleEntityNotFound(_0xf6801e,null))[_0xd434('0x1e')](respondWithResult(_0xf6801e,null))['catch'](handleError(_0xf6801e,null));};exports[_0xd434('0x5c')]=function(_0x4dd527,_0x48b280){return db[_0xd434('0x52')][_0xd434('0x5c')](_0x4dd527[_0xd434('0x5d')],{})[_0xd434('0x1e')](function(_0x1495cd){var _0x45fe6e=_0x4dd527[_0xd434('0x5e')][_0xd434('0x5f')]({'plain':!![]});if(!_0x45fe6e)throw new Error(_0xd434('0x60'));if(_0x45fe6e['role']===_0xd434('0x5e')){var _0x874b2d=_0x1495cd[_0xd434('0x5f')]({'plain':!![]});var _0x480c00=_0xd434('0x61');return db[_0xd434('0x62')][_0xd434('0x5b')]({'where':{'name':_0x480c00,'userProfileId':_0x45fe6e[_0xd434('0x63')]},'raw':!![]})[_0xd434('0x1e')](function(_0x3542b6){if(_0x3542b6&&_0x3542b6[_0xd434('0x64')]===0x0){return db[_0xd434('0x36')]['create']({'name':_0x874b2d[_0xd434('0x41')],'resourceId':_0x874b2d['id'],'type':_0x3542b6[_0xd434('0x41')],'sectionId':_0x3542b6['id']},{})[_0xd434('0x1e')](function(){return _0x1495cd;});}else{return _0x1495cd;}})[_0xd434('0x28')](function(_0x8fe75){logger['error'](_0xd434('0x65'),_0x8fe75);throw _0x8fe75;});}return _0x1495cd;})[_0xd434('0x1e')](respondWithResult(_0x48b280,0xc9))['catch'](handleError(_0x48b280,null));};exports[_0xd434('0x34')]=function(_0x320604,_0x217d4e){if(_0x320604[_0xd434('0x5d')]['id']){delete _0x320604[_0xd434('0x5d')]['id'];}return db['FaxAccount'][_0xd434('0x5b')]({'where':{'id':_0x320604[_0xd434('0x58')]['id']},'include':[{'model':db[_0xd434('0x59')],'as':_0xd434('0x3b')}]})['then'](handleEntityNotFound(_0x217d4e,null))[_0xd434('0x1e')](saveUpdates(_0x320604[_0xd434('0x5d')],null))[_0xd434('0x1e')](respondWithResult(_0x217d4e,null))[_0xd434('0x28')](handleError(_0x217d4e,null));};exports[_0xd434('0x35')]=function(_0x7160cc,_0x4ada54){return db[_0xd434('0x52')][_0xd434('0x5b')]({'where':{'id':_0x7160cc['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x4ada54,null))[_0xd434('0x1e')](removeEntity(_0x4ada54,null))['catch'](handleError(_0x4ada54,null));};exports[_0xd434('0x66')]=function(_0x4bb9c4,_0x2f0e4f){return db[_0xd434('0x52')]['describe']()['then'](respondWithResult(_0x2f0e4f,null))[_0xd434('0x28')](handleError(_0x2f0e4f,null));};exports['addDisposition']=function(_0x166b65,_0x282c06,_0x562923){if(_0x166b65[_0xd434('0x5d')]['id']){delete _0x166b65[_0xd434('0x5d')]['id'];}return db['FaxAccount'][_0xd434('0x5b')]({'where':{'id':_0x166b65['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x282c06,null))[_0xd434('0x1e')](function(_0x41ab2b){if(_0x41ab2b){_0x166b65[_0xd434('0x5d')]['FaxAccountId']=_0x41ab2b['id'];return db[_0xd434('0x67')][_0xd434('0x5c')](_0x166b65[_0xd434('0x5d')]);}})[_0xd434('0x1e')](respondWithResult(_0x282c06,null))[_0xd434('0x28')](handleError(_0x282c06,null));};exports[_0xd434('0x68')]=function(_0x52eec4,_0x42a9d1,_0x445e7b){var _0x1935df={'raw':![],'where':{}};var _0x208b71={};var _0x15d0e7={'count':0x0,'rows':[]};return db[_0xd434('0x52')]['findOne']({'where':{'id':_0x52eec4[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x42a9d1,null))['then'](function(_0x110ecf){if(_0x110ecf){_0x208b71['model']=_[_0xd434('0x43')](db['Disposition'][_0xd434('0x3d')]);_0x208b71[_0xd434('0x42')]=_[_0xd434('0x43')](_0x52eec4[_0xd434('0x42')]);_0x208b71[_0xd434('0x44')]=_[_0xd434('0x45')](_0x208b71[_0xd434('0x40')],_0x208b71[_0xd434('0x42')]);_0x1935df['attributes']=_[_0xd434('0x45')](_0x208b71['model'],qs[_0xd434('0x47')](_0x52eec4[_0xd434('0x42')]['fields']));_0x1935df[_0xd434('0x46')]=_0x1935df[_0xd434('0x46')][_0xd434('0x5a')]?_0x1935df[_0xd434('0x46')]:_0x208b71[_0xd434('0x40')];if(!_0x52eec4[_0xd434('0x42')][_0xd434('0x48')](_0xd434('0x49'))){_0x1935df[_0xd434('0x2d')]=qs['limit'](_0x52eec4[_0xd434('0x42')][_0xd434('0x2d')]);_0x1935df['offset']=qs[_0xd434('0x2b')](_0x52eec4[_0xd434('0x42')][_0xd434('0x2b')]);}_0x1935df['order']=qs['sort'](_0x52eec4[_0xd434('0x42')][_0xd434('0x4b')]);_0x1935df[_0xd434('0x4c')]=qs[_0xd434('0x44')](_[_0xd434('0x4d')](_0x52eec4[_0xd434('0x42')],_0x208b71[_0xd434('0x44')]));_0x1935df[_0xd434('0x4c')][_0xd434('0x69')]=_0x110ecf['id'];if(_0x52eec4[_0xd434('0x42')][_0xd434('0x4e')]){_0x1935df['where']=_[_0xd434('0x4f')](_0x1935df[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x1935df[_0xd434('0x46')],function(_0xc02669){var _0x437618={};_0x437618[_0xc02669]={'$like':'%'+_0x52eec4[_0xd434('0x42')][_0xd434('0x4e')]+'%'};return _0x437618;})});}_0x1935df=_[_0xd434('0x4f')]({},_0x1935df,_0x52eec4[_0xd434('0x51')]);return db[_0xd434('0x67')][_0xd434('0x2e')]({'where':_0x1935df['where']})[_0xd434('0x1e')](function(_0x1e3102){_0x15d0e7['count']=_0x1e3102;if(_0x52eec4[_0xd434('0x42')][_0xd434('0x53')]){_0x1935df[_0xd434('0x54')]=[{'all':!![]}];}return db[_0xd434('0x67')][_0xd434('0x55')](_0x1935df);})[_0xd434('0x1e')](function(_0x36438a){_0x15d0e7[_0xd434('0x56')]=_0x36438a;return _0x15d0e7;});}})['then'](respondWithFilteredResult(_0x42a9d1,_0x1935df))[_0xd434('0x28')](handleError(_0x42a9d1,null));};exports['removeDispositions']=function(_0x3193cf,_0x2eb36e,_0x515a8c){return db['FaxAccount'][_0xd434('0x5b')]({'where':{'id':_0x3193cf['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x2eb36e,null))[_0xd434('0x1e')](function(_0x4322cc){if(_0x4322cc){return _0x4322cc[_0xd434('0x6a')](_0x3193cf[_0xd434('0x42')][_0xd434('0x6b')]);}})[_0xd434('0x1e')](respondWithStatusCode(_0x2eb36e,null))['catch'](handleError(_0x2eb36e,null));};exports[_0xd434('0x6c')]=function(_0x38f120,_0x3c0062,_0x18bf55){if(_0x38f120[_0xd434('0x5d')]['id']){delete _0x38f120[_0xd434('0x5d')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x38f120[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x3c0062,null))[_0xd434('0x1e')](function(_0x56fa7b){if(_0x56fa7b){_0x38f120['body'][_0xd434('0x69')]=_0x56fa7b['id'];return db[_0xd434('0x6d')]['create'](_0x38f120[_0xd434('0x5d')]);}})[_0xd434('0x1e')](respondWithResult(_0x3c0062,null))[_0xd434('0x28')](handleError(_0x3c0062,null));};exports[_0xd434('0x6e')]=function(_0x322e8d,_0x5c4ff9,_0x2e2759){var _0x526611={'raw':![],'where':{}};var _0x5383ea={};var _0x496e92={'count':0x0,'rows':[]};return db[_0xd434('0x52')][_0xd434('0x6f')]({'where':{'id':_0x322e8d['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x5c4ff9,null))[_0xd434('0x1e')](function(_0x304917){if(_0x304917){_0x5383ea[_0xd434('0x40')]=_[_0xd434('0x43')](db[_0xd434('0x6d')][_0xd434('0x3d')]);_0x5383ea[_0xd434('0x42')]=_[_0xd434('0x43')](_0x322e8d[_0xd434('0x42')]);_0x5383ea[_0xd434('0x44')]=_['intersection'](_0x5383ea[_0xd434('0x40')],_0x5383ea[_0xd434('0x42')]);_0x526611[_0xd434('0x46')]=_[_0xd434('0x45')](_0x5383ea[_0xd434('0x40')],qs[_0xd434('0x47')](_0x322e8d[_0xd434('0x42')]['fields']));_0x526611[_0xd434('0x46')]=_0x526611[_0xd434('0x46')][_0xd434('0x5a')]?_0x526611[_0xd434('0x46')]:_0x5383ea['model'];if(!_0x322e8d[_0xd434('0x42')][_0xd434('0x48')](_0xd434('0x49'))){_0x526611[_0xd434('0x2d')]=qs[_0xd434('0x2d')](_0x322e8d[_0xd434('0x42')]['limit']);_0x526611[_0xd434('0x2b')]=qs[_0xd434('0x2b')](_0x322e8d[_0xd434('0x42')][_0xd434('0x2b')]);}_0x526611['order']=qs[_0xd434('0x4b')](_0x322e8d[_0xd434('0x42')][_0xd434('0x4b')]);_0x526611[_0xd434('0x4c')]=qs[_0xd434('0x44')](_[_0xd434('0x4d')](_0x322e8d[_0xd434('0x42')],_0x5383ea[_0xd434('0x44')]));_0x526611[_0xd434('0x4c')][_0xd434('0x69')]=_0x304917['id'];if(_0x322e8d[_0xd434('0x42')][_0xd434('0x4e')]){_0x526611[_0xd434('0x4c')]=_['merge'](_0x526611['where'],{'$or':_[_0xd434('0x3c')](_0x526611['attributes'],function(_0x32ee48){var _0x35042c={};_0x35042c[_0x32ee48]={'$like':'%'+_0x322e8d['query'][_0xd434('0x4e')]+'%'};return _0x35042c;})});}_0x526611=_[_0xd434('0x4f')]({},_0x526611,_0x322e8d[_0xd434('0x51')]);return db['CannedAnswer'][_0xd434('0x2e')]({'where':_0x526611[_0xd434('0x4c')]})['then'](function(_0xc5af0b){_0x496e92[_0xd434('0x2e')]=_0xc5af0b;if(_0x322e8d[_0xd434('0x42')][_0xd434('0x53')]){_0x526611[_0xd434('0x54')]=[{'all':!![]}];}return db[_0xd434('0x6d')][_0xd434('0x55')](_0x526611);})[_0xd434('0x1e')](function(_0x18b66b){_0x496e92[_0xd434('0x56')]=_0x18b66b;return _0x496e92;});}})[_0xd434('0x1e')](respondWithFilteredResult(_0x5c4ff9,_0x526611))[_0xd434('0x28')](handleError(_0x5c4ff9,null));};exports[_0xd434('0x70')]=function(_0x45e8ce,_0x11e426,_0x2e53df){return db[_0xd434('0x52')][_0xd434('0x5b')]({'where':{'id':_0x45e8ce[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x11e426,null))[_0xd434('0x1e')](function(_0x3085f2){if(_0x3085f2){return _0x3085f2[_0xd434('0x70')](_0x45e8ce['query'][_0xd434('0x6b')]);}})[_0xd434('0x1e')](respondWithStatusCode(_0x11e426,null))[_0xd434('0x28')](handleError(_0x11e426,null));};exports[_0xd434('0x71')]=function(_0x96c6f9,_0x1cc2ae,_0x2bc677){return db[_0xd434('0x72')]['find']({'where':{'id':_0x96c6f9[_0xd434('0x58')]['id']}})['then'](handleEntityNotFound(_0x1cc2ae,null))[_0xd434('0x1e')](function(_0x5f4067){if(_0x5f4067){return _0x5f4067['addInteraction'](_0x96c6f9[_0xd434('0x5d')][_0xd434('0x6b')],_[_0xd434('0x73')](_0x96c6f9[_0xd434('0x5d')],[_0xd434('0x6b'),'id'])||{});}})[_0xd434('0x1e')](respondWithResult(_0x1cc2ae,null))[_0xd434('0x28')](handleError(_0x1cc2ae,null));};exports[_0xd434('0x74')]=function(_0x437568,_0x5ce9ec,_0x3ff671){var _0x1cdef2={'raw':![],'where':{}};var _0x13aa90={};var _0x2be20a={'count':0x0,'rows':[]};return db[_0xd434('0x52')][_0xd434('0x6f')]({'where':{'id':_0x437568['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x5ce9ec,null))[_0xd434('0x1e')](function(_0x2f62df){if(_0x2f62df){_0x13aa90['model']=_['keys'](db[_0xd434('0x72')][_0xd434('0x3d')]);_0x13aa90[_0xd434('0x42')]=_[_0xd434('0x43')](_0x437568[_0xd434('0x42')]);_0x13aa90['filters']=_['intersection'](_0x13aa90[_0xd434('0x40')],_0x13aa90[_0xd434('0x42')]);_0x1cdef2[_0xd434('0x46')]=_['intersection'](_0x13aa90[_0xd434('0x40')],qs['fields'](_0x437568['query'][_0xd434('0x47')]));_0x1cdef2[_0xd434('0x46')]=_0x1cdef2[_0xd434('0x46')][_0xd434('0x5a')]?_0x1cdef2[_0xd434('0x46')]:_0x13aa90['model'];if(!_0x437568[_0xd434('0x42')][_0xd434('0x48')](_0xd434('0x49'))){_0x1cdef2[_0xd434('0x2d')]=qs[_0xd434('0x2d')](_0x437568[_0xd434('0x42')][_0xd434('0x2d')]);_0x1cdef2[_0xd434('0x2b')]=qs[_0xd434('0x2b')](_0x437568[_0xd434('0x42')][_0xd434('0x2b')]);}_0x1cdef2[_0xd434('0x4a')]=qs[_0xd434('0x4b')](_0x437568[_0xd434('0x42')][_0xd434('0x4b')]);_0x1cdef2['where']=qs['filters'](_['pick'](_0x437568[_0xd434('0x42')],_0x13aa90[_0xd434('0x44')]));_0x1cdef2['where'][_0xd434('0x69')]=_0x2f62df['id'];if(_0x437568[_0xd434('0x42')][_0xd434('0x4e')]){_0x1cdef2[_0xd434('0x4c')]=_[_0xd434('0x4f')](_0x1cdef2[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x1cdef2['attributes'],function(_0x28616f){var _0x4e6cb8={};_0x4e6cb8[_0x28616f]={'$like':'%'+_0x437568[_0xd434('0x42')][_0xd434('0x4e')]+'%'};return _0x4e6cb8;})});}_0x1cdef2=_[_0xd434('0x4f')]({},_0x1cdef2,_0x437568['options']);return db[_0xd434('0x72')][_0xd434('0x2e')]({'where':_0x1cdef2['where']})['then'](function(_0xe5ea05){_0x2be20a[_0xd434('0x2e')]=_0xe5ea05;if(_0x437568['query'][_0xd434('0x53')]){_0x1cdef2[_0xd434('0x54')]=[{'model':db[_0xd434('0x75')],'as':_0xd434('0x76'),'required':![]},{'model':db[_0xd434('0x77')],'as':_0xd434('0x78'),'attributes':[_0xd434('0x41'),_0xd434('0x79'),'internal'],'required':![]},{'model':db[_0xd434('0x7a')],'as':_0xd434('0x7b'),'attributes':['id','name','color'],'where':_0x437568[_0xd434('0x42')][_0xd434('0x7c')]?{'id':_0x437568['query']['tag']}:undefined,'required':_0x437568[_0xd434('0x42')][_0xd434('0x7c')]?!![]:![]}];}return db[_0xd434('0x72')][_0xd434('0x55')](_0x1cdef2);})[_0xd434('0x1e')](function(_0xa59e1b){_0x2be20a[_0xd434('0x56')]=_0xa59e1b;return _0x2be20a;});}})[_0xd434('0x1e')](respondWithFilteredResult(_0x5ce9ec,_0x1cdef2))[_0xd434('0x28')](handleError(_0x5ce9ec,null));};exports['addApplications']=function(_0x4b491b,_0x1bfd5d,_0x2a93f2){return db[_0xd434('0x52')]['findOne']({'where':{'id':_0x4b491b[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x1bfd5d,null))['then'](function(_0x1fa33a){if(_0x1fa33a){return db[_0xd434('0x7d')]['transaction'](function(_0x4b27ac){return db['FaxApplication'][_0xd434('0x35')]({'where':{'FaxAccountId':_0x4b491b[_0xd434('0x58')]['id']},'transaction':_0x4b27ac})[_0xd434('0x1e')](function(_0x13a6b4){var _0x22b0b8=_[_0xd434('0x3c')](_0x4b491b[_0xd434('0x5d')],function(_0x3c004b){_0x3c004b[_0xd434('0x69')]=_0x4b491b[_0xd434('0x58')]['id'];return _0x3c004b;});return db[_0xd434('0x7e')][_0xd434('0x7f')](_0x22b0b8,{'transaction':_0x4b27ac});});})['then'](function(){return db[_0xd434('0x7e')][_0xd434('0x80')]({'where':{'FaxAccountId':_0x4b491b[_0xd434('0x58')]['id']},'order':_0xd434('0x81')});});}})[_0xd434('0x1e')](respondWithResult(_0x1bfd5d,null))[_0xd434('0x28')](handleError(_0x1bfd5d,null));};exports[_0xd434('0x82')]=function(_0x5c44b2,_0x1613bc,_0x34129e){var _0x3042cd={};var _0x2d07c9={};var _0x746553;var _0x585c4c;return db[_0xd434('0x52')][_0xd434('0x6f')]({'where':{'id':_0x5c44b2[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x1613bc,null))[_0xd434('0x1e')](function(_0x2c7aea){if(_0x2c7aea){_0x746553=_0x2c7aea;_0x2d07c9[_0xd434('0x40')]=_[_0xd434('0x43')](db[_0xd434('0x7e')]['rawAttributes']);_0x2d07c9[_0xd434('0x42')]=_['keys'](_0x5c44b2[_0xd434('0x42')]);_0x2d07c9['filters']=_[_0xd434('0x45')](_0x2d07c9['model'],_0x2d07c9[_0xd434('0x42')]);_0x3042cd[_0xd434('0x46')]=_[_0xd434('0x45')](_0x2d07c9[_0xd434('0x40')],qs['fields'](_0x5c44b2[_0xd434('0x42')]['fields']));_0x3042cd[_0xd434('0x46')]=_0x3042cd[_0xd434('0x46')][_0xd434('0x5a')]?_0x3042cd[_0xd434('0x46')]:_0x2d07c9[_0xd434('0x40')];_0x3042cd[_0xd434('0x4a')]=qs[_0xd434('0x4b')](_0x5c44b2[_0xd434('0x42')][_0xd434('0x4b')]);_0x3042cd[_0xd434('0x4c')]=qs['filters'](_[_0xd434('0x4d')](_0x5c44b2[_0xd434('0x42')],_0x2d07c9['filters']));if(_0x5c44b2[_0xd434('0x42')][_0xd434('0x4e')]){_0x3042cd[_0xd434('0x4c')]=_[_0xd434('0x4f')](_0x3042cd[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x3042cd[_0xd434('0x46')],function(_0x5f057e){var _0x419ccf={};_0x419ccf[_0x5f057e]={'$like':'%'+_0x5c44b2[_0xd434('0x42')][_0xd434('0x4e')]+'%'};return _0x419ccf;})});}_0x3042cd=_[_0xd434('0x4f')]({},_0x3042cd,_0x5c44b2[_0xd434('0x51')]);return _0x746553[_0xd434('0x82')](_0x3042cd);}})[_0xd434('0x1e')](function(_0x3c7ae7){if(_0x3c7ae7){_0x585c4c=_0x3c7ae7[_0xd434('0x5a')];if(!_0x5c44b2[_0xd434('0x42')]['hasOwnProperty'](_0xd434('0x49'))){_0x3042cd[_0xd434('0x2d')]=qs[_0xd434('0x2d')](_0x5c44b2[_0xd434('0x42')][_0xd434('0x2d')]);_0x3042cd[_0xd434('0x2b')]=qs[_0xd434('0x2b')](_0x5c44b2['query'][_0xd434('0x2b')]);}return _0x746553[_0xd434('0x82')](_0x3042cd);}})[_0xd434('0x1e')](function(_0x426733){if(_0x426733){return _0x426733?{'count':_0x585c4c,'rows':_0x426733}:null;}})[_0xd434('0x1e')](respondWithResult(_0x1613bc,null))[_0xd434('0x28')](handleError(_0x1613bc,null));};function Extension(_0xf58a21,_0x1b3b86,_0x4eb5bc,_0x205195){this[_0xd434('0x83')]=_0xd434('0x84');this[_0xd434('0x85')]=_0xf58a21['localstationid'];this[_0xd434('0x86')]=_0x205195;this[_0xd434('0x3f')]=_0xd434('0x87');this[_0xd434('0x88')]='Fax\x20Extension';this[_0xd434('0x69')]=_0xf58a21['id'];this[_0xd434('0x81')]=_0x1b3b86;this[_0xd434('0x89')]=_0x4eb5bc;}function createExtensionsReciveFax(_0x355cb3){var _0x283cd2=0x1;var _0xebc7dd=[];_0xebc7dd[_0xd434('0x8a')](new Extension(_0x355cb3,_0x283cd2,'',_0xd434('0x8b')));_0x283cd2+=0x1;_0xebc7dd[_0xd434('0x8a')](new Extension(_0x355cb3,_0x283cd2,_0xd434('0x8c'),_0xd434('0x8d')));_0x283cd2+=0x1;for(var _0x540e3a in _0x355cb3){if(_0x355cb3['hasOwnProperty'](_0x540e3a)&&(_0x540e3a===_0xd434('0x8e')||_0x540e3a==='localstationid'||_0x540e3a===_0xd434('0x8f')||_0x540e3a===_0xd434('0x90')||_0x540e3a==='headerinfo'||_0x540e3a===_0xd434('0x91')||_0x540e3a===_0xd434('0x92')||_0x540e3a===_0xd434('0x93')||_0x540e3a===_0xd434('0x94'))){_0xebc7dd[_0xd434('0x8a')](new Extension(_0x355cb3,_0x283cd2,_0xd434('0x95')+_0x540e3a+')='+_0x355cb3[_0x540e3a],_0xd434('0x8d')));_0x283cd2+=0x1;}}_0xebc7dd[_0xd434('0x8a')](new Extension(_0x355cb3,_0x283cd2,'6',_0xd434('0x96')));_0x283cd2+=0x1;_0xebc7dd[_0xd434('0x8a')](new Extension(_0x355cb3,_0x283cd2,_0xd434('0x97'),_0xd434('0x98')));_0x283cd2=0x0;return _0xebc7dd;}exports[_0xd434('0x99')]=function(_0x13d7bc,_0x2062a4,_0x40768b){var _0x31cfae;return db[_0xd434('0x7d')][_0xd434('0x9a')](function(_0x50ff93){return db[_0xd434('0x52')][_0xd434('0x5c')](_0x13d7bc[_0xd434('0x5d')],{'transaction':_0x50ff93})[_0xd434('0x1e')](function(_0x173957){_0x31cfae=_0x173957['get']({'plain':!![]});return db['VoiceExtension'][_0xd434('0x7f')](createExtensionsReciveFax(_0x31cfae),{'transaction':_0x50ff93});});})[_0xd434('0x1e')](function(){return _0x31cfae;})['then'](respondWithResult(_0x2062a4,null))[_0xd434('0x28')](handleError(_0x2062a4,null));};exports[_0xd434('0x9b')]=function(_0x54c292,_0x429914,_0x1a9be8){var _0x2499a7;return db[_0xd434('0x7d')][_0xd434('0x9a')](function(_0x3d8fe6){return db[_0xd434('0x52')][_0xd434('0x34')](_0x54c292[_0xd434('0x5d')],{'where':{'id':_0x54c292[_0xd434('0x5d')]['id']},'transaction':_0x3d8fe6})[_0xd434('0x1e')](function(_0x251f6f){return db[_0xd434('0x9c')][_0xd434('0x35')]({'where':{'FaxAccountId':_0x54c292[_0xd434('0x5d')]['id']},'transaction':_0x3d8fe6})[_0xd434('0x1e')](function(_0x2867a9){return db[_0xd434('0x9c')][_0xd434('0x7f')](createExtensionsReciveFax(_['omit'](_0x54c292[_0xd434('0x5d')],[_0xd434('0x9d'),_0xd434('0x9e'),_0xd434('0x9f'),_0xd434('0xa0'),_0xd434('0xa1'),_0xd434('0xa2')])),{'transaction':_0x3d8fe6});});});})['then'](function(){return db[_0xd434('0x52')]['findById'](_0x54c292[_0xd434('0x5d')]['id']);})[_0xd434('0x1e')](respondWithResult(_0x429914,null))[_0xd434('0x28')](handleError(_0x429914,null));};exports[_0xd434('0xa3')]=function(_0x1cc6a3,_0x366a0d,_0x330692){var _0x3f9449={'raw':!![],'where':{}};var _0x3acc70={};var _0x2a0d64={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd434('0x6f')]({'where':{'id':_0x1cc6a3['params']['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x366a0d,null))[_0xd434('0x1e')](function(_0x44a2e4){if(_0x44a2e4){_0x3acc70['model']=_['keys'](db[_0xd434('0xa4')][_0xd434('0x3d')]);_0x3acc70[_0xd434('0x42')]=_['keys'](_0x1cc6a3[_0xd434('0x42')]);_0x3acc70[_0xd434('0x44')]=_['intersection'](_0x3acc70[_0xd434('0x40')],_0x3acc70['query']);_0x3f9449['attributes']=_[_0xd434('0x45')](_0x3acc70['model'],qs[_0xd434('0x47')](_0x1cc6a3['query'][_0xd434('0x47')]));_0x3f9449[_0xd434('0x46')]=_0x3f9449[_0xd434('0x46')][_0xd434('0x5a')]?_0x3f9449[_0xd434('0x46')]:_0x3acc70[_0xd434('0x40')];if(!_0x1cc6a3[_0xd434('0x42')]['hasOwnProperty'](_0xd434('0x49'))){_0x3f9449[_0xd434('0x2d')]=qs[_0xd434('0x2d')](_0x1cc6a3[_0xd434('0x42')][_0xd434('0x2d')]);_0x3f9449[_0xd434('0x2b')]=qs['offset'](_0x1cc6a3['query'][_0xd434('0x2b')]);}_0x3f9449['order']=qs['sort'](_0x1cc6a3[_0xd434('0x42')][_0xd434('0x4b')]);_0x3f9449[_0xd434('0x4c')]=qs['filters'](_[_0xd434('0x4d')](_0x1cc6a3[_0xd434('0x42')],_0x3acc70[_0xd434('0x44')]));_0x3f9449[_0xd434('0x4c')][_0xd434('0x69')]=_0x44a2e4['id'];if(_0x1cc6a3[_0xd434('0x42')][_0xd434('0x4e')]){_0x3f9449[_0xd434('0x4c')]=_['merge'](_0x3f9449[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x3f9449['attributes'],function(_0x49360b){var _0x493ffe={};_0x493ffe[_0x49360b]={'$like':'%'+_0x1cc6a3[_0xd434('0x42')][_0xd434('0x4e')]+'%'};return _0x493ffe;})});}if(_0x1cc6a3['query']['$gte']){var _0x2834ca=_0x1cc6a3[_0xd434('0x42')]['$gte'][_0xd434('0xa5')](',');var _0x3dfa3b={};_0x3dfa3b[_0x2834ca[0x0]]={'$gte':moment(_0x2834ca[0x1])[_0xd434('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3f9449['where']=_[_0xd434('0x4f')](_0x3f9449['where'],_0x3dfa3b);}_0x3f9449=_[_0xd434('0x4f')]({},_0x3f9449,_0x1cc6a3[_0xd434('0x51')]);return db[_0xd434('0xa4')][_0xd434('0x2e')]({'where':_0x3f9449[_0xd434('0x4c')]})['then'](function(_0x4c3581){_0x2a0d64['count']=_0x4c3581;if(_0x1cc6a3[_0xd434('0x42')][_0xd434('0x53')]){_0x3f9449[_0xd434('0x54')]=[{'all':!![]}];}return db[_0xd434('0xa4')][_0xd434('0x55')](_0x3f9449);})[_0xd434('0x1e')](function(_0x56e6cc){_0x2a0d64[_0xd434('0x56')]=_0x56e6cc;return _0x2a0d64;});}})[_0xd434('0x1e')](respondWithFilteredResult(_0x366a0d,_0x3f9449))['catch'](handleError(_0x366a0d,null));};exports['send']=function(_0x51be5a,_0x2f3820,_0x168a2c){var _0x5f259e,_0x166f43={},_0x17571c;if(_0x51be5a[_0xd434('0x5d')]['to']){_0x17571c=_0x51be5a['body']['to'][0x0];}return db[_0xd434('0x52')][_0xd434('0x5b')]({'where':{'id':_0x51be5a[_0xd434('0x58')]['id']},'include':[{'model':db[_0xd434('0xa7')],'as':'List','include':[{'model':db[_0xd434('0x75')],'as':'Contacts','where':{'fax':_0x17571c},'limit':0x1,'order':[[_0xd434('0xa0'),_0xd434('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x2f3820,null))['then'](function(_0xa9707b){_0x5f259e=_0xa9707b;if(_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')]&&_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][_0xd434('0x5a')]){for(var _0x321e8b=0x0;_0x321e8b<_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][_0xd434('0x5a')];_0x321e8b+=0x1){_0x51be5a['body'][_0xd434('0xa9')][_0x321e8b]={'filename':_0x51be5a['body'][_0xd434('0xa9')][_0x321e8b][_0xd434('0x41')],'id':_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][_0x321e8b]['id'],'path':path[_0xd434('0xaa')](config['root'],_0xd434('0xab'),_0x51be5a['body'][_0xd434('0xa9')][_0x321e8b][_0xd434('0xac')])};}}return respondWithRpcPromise(_0xd434('0xad'),'CheckAfterSend',{'FaxAccountId':_[_0xd434('0xae')](_0x51be5a['params']['id'])?undefined:_0x51be5a[_0xd434('0x58')]['id'],'path':_['isNil'](_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0][_0xd434('0x7')])?undefined:_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0][_0xd434('0x7')],'fax':_[_0xd434('0xae')](_0x51be5a[_0xd434('0x5d')]['to'][0x0])?undefined:_0x51be5a['body']['to'][0x0]},client9002);})[_0xd434('0x1e')](function(){if(_0x5f259e){if(_[_0xd434('0xae')](_0x51be5a[_0xd434('0x5d')][_0xd434('0xaf')])){_0x51be5a[_0xd434('0x5d')][_0xd434('0xaf')]=util['format'](_0xd434('0xb0'),_0x5f259e['name'],_0x5f259e[_0xd434('0xb1')]);}if(_0x5f259e[_0xd434('0xb2')]){if(_0x5f259e['List'][_0xd434('0xb3')][_0xd434('0x5a')]){return _0x5f259e[_0xd434('0xb2')]['Contacts'][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x51be5a['body'],{'firstName':_0x51be5a[_0xd434('0x5d')]['to'][0x0],'phone':_0x51be5a[_0xd434('0x5d')]['to'][0x0],'fax':_0x51be5a['body']['to'][0x0],'ListId':_0x5f259e[_0xd434('0xa2')]}));}}else{throw new Error(_0xd434('0xb4'));}}else{throw new Error(_0xd434('0xb5'));}})['then'](function(_0x52bc00){if(_0x52bc00){return db[_0xd434('0x72')][_0xd434('0x5b')]({'where':{'ContactId':_0x52bc00['id'],'closed':![],'FaxAccountId':_0x5f259e['id']}})[_0xd434('0x1e')](function(_0x31e978){if(_0x31e978){return[_0x31e978,![]];}return db[_0xd434('0x72')][_0xd434('0x5c')]({'UserId':_0x51be5a[_0xd434('0x5e')]['id'],'ContactId':_0x52bc00['id'],'FaxAccountId':_0x5f259e['id'],'fax':_0x51be5a[_0xd434('0x5d')]['to'][0x0],'firstMsgDirection':_0xd434('0xb6'),'Messages':[_[_0xd434('0x4f')](_0x51be5a['body'],{'read':![],'body':_0x51be5a[_0xd434('0x5d')]['attachments'][0x0][_0xd434('0xb7')],'FaxAccountId':_0x5f259e['id'],'UserId':_0x51be5a[_0xd434('0x5e')]['id'],'ContactId':_0x52bc00['id'],'AttachmentId':_0x51be5a[_0xd434('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd434('0xa4')],'as':_0xd434('0xb8')}]})['then'](function(_0x5f2988){return[_0x5f2988,!![]];});});}else{throw new Error(_0xd434('0xb9'));}})[_0xd434('0xba')](function(_0x6c03e4,_0x38b4d4){if(_0x38b4d4){return _0x6c03e4;}return db[_0xd434('0xa4')]['create']({'direction':_0xd434('0xb6'),'read':![],'body':_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0]['filename'],'FaxAccountId':_0x5f259e['id'],'FaxInteractionId':_0x6c03e4['id'],'UserId':_0x51be5a[_0xd434('0x5e')]['id'],'ContactId':_0x6c03e4[_0xd434('0xbb')],'AttachmentId':_0x51be5a[_0xd434('0x5d')]['attachments'][0x0]['id']})['then'](function(_0x310e7c){_0x6c03e4[_0xd434('0xbc')][_0xd434('0xb8')]=[];_0x6c03e4[_0xd434('0xbc')][_0xd434('0xb8')][_0xd434('0x8a')](_0x310e7c['dataValues']);return _0x6c03e4;});})['then'](function(_0x17cd57){respondWithRpcPromise(_0xd434('0xbd'),_0xd434('0xbd'),{'FaxAccountId':_[_0xd434('0xae')](_0x51be5a[_0xd434('0x58')]['id'])?undefined:_0x51be5a['params']['id'],'path':_[_0xd434('0xae')](_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0]['path'])?undefined:_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0][_0xd434('0x7')],'fax':_[_0xd434('0xae')](_0x51be5a[_0xd434('0x5d')]['to'][0x0])?undefined:_0x51be5a['body']['to'][0x0],'AttachmentId':_0x51be5a[_0xd434('0x5d')][_0xd434('0xa9')][0x0]['id']},client9002)[_0xd434('0x1e')](function(_0x546f87){logger['info'](_0xd434('0xbe'),_0x546f87);})[_0xd434('0x28')](function(_0x2af901){logger[_0xd434('0x1f')](_0xd434('0xbe'),_0x2af901);});return _0x17cd57;})[_0xd434('0x1e')](respondWithResult(_0x2f3820,null))['catch'](handleError(_0x2f3820,null));};exports[_0xd434('0xbf')]=function(_0x3aa5ca,_0x5b4571,_0x4b8c21){return db[_0xd434('0x52')][_0xd434('0x5b')]({'where':{'id':_0x3aa5ca[_0xd434('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b4571,null))['then'](function(_0x33d44c){if(_0x33d44c){return _0x33d44c[_0xd434('0xbf')](_0x3aa5ca[_0xd434('0x5d')][_0xd434('0x6b')],_['omit'](_0x3aa5ca[_0xd434('0x5d')],[_0xd434('0x6b'),'id'])||{})[_0xd434('0xba')](function(_0x5bb74c){for(var _0x46850b=0x0;_0x46850b<_0x3aa5ca[_0xd434('0x5d')]['ids'][_0xd434('0x5a')];_0x46850b+=0x1){socket['emit'](_0xd434('0xc0'),{'UserId':Number(_0x3aa5ca[_0xd434('0x5d')]['ids'][_0x46850b]),'FaxAccountId':Number(_0x3aa5ca['params']['id'])});}return _0x5bb74c;});}})['then'](respondWithResult(_0x5b4571,null))['catch'](handleError(_0x5b4571,null));};exports[_0xd434('0xc1')]=function(_0x4f16c8,_0x19fdab,_0xf86360){return db[_0xd434('0x52')][_0xd434('0x5b')]({'where':{'id':_0x4f16c8[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x19fdab,null))[_0xd434('0x1e')](function(_0x2f2c91){if(_0x2f2c91){return _0x2f2c91[_0xd434('0xc1')](_0x4f16c8[_0xd434('0x42')][_0xd434('0x6b')])['then'](function(){if(_[_0xd434('0xc2')](_0x4f16c8[_0xd434('0x42')][_0xd434('0x6b')])){for(var _0x51f85a=0x0;_0x51f85a<_0x4f16c8[_0xd434('0x42')][_0xd434('0x6b')][_0xd434('0x5a')];_0x51f85a+=0x1){socket[_0xd434('0xc3')](_0xd434('0xc4'),{'UserId':Number(_0x4f16c8[_0xd434('0x42')][_0xd434('0x6b')][_0x51f85a]),'FaxAccountId':Number(_0x4f16c8[_0xd434('0x58')]['id'])});}}else{socket[_0xd434('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x4f16c8[_0xd434('0x42')][_0xd434('0x6b')]),'FaxAccountId':Number(_0x4f16c8['params']['id'])});}});}})[_0xd434('0x1e')](respondWithStatusCode(_0x19fdab,null))[_0xd434('0x28')](handleError(_0x19fdab,null));};exports['getAgents']=function(_0x1269e0,_0x417a7d,_0x36a0ff){var _0x4e0e68={};var _0x347651={};var _0x5f2d36;var _0x3c859d;return db['FaxAccount'][_0xd434('0x6f')]({'where':{'id':_0x1269e0[_0xd434('0x58')]['id']}})[_0xd434('0x1e')](handleEntityNotFound(_0x417a7d,null))[_0xd434('0x1e')](function(_0x2f47f1){if(_0x2f47f1){_0x5f2d36=_0x2f47f1;_0x347651['model']=_['keys'](db[_0xd434('0x77')][_0xd434('0x3d')]);_0x347651['query']=_['keys'](_0x1269e0['query']);_0x347651[_0xd434('0x44')]=_[_0xd434('0x45')](_0x347651[_0xd434('0x40')],_0x347651[_0xd434('0x42')]);_0x4e0e68['attributes']=_['intersection'](_0x347651[_0xd434('0x40')],qs[_0xd434('0x47')](_0x1269e0[_0xd434('0x42')][_0xd434('0x47')]));_0x4e0e68[_0xd434('0x46')]=_0x4e0e68['attributes'][_0xd434('0x5a')]?_0x4e0e68[_0xd434('0x46')]:_0x347651[_0xd434('0x40')];_0x4e0e68[_0xd434('0x4a')]=qs['sort'](_0x1269e0[_0xd434('0x42')][_0xd434('0x4b')]);_0x4e0e68[_0xd434('0x4c')]=qs[_0xd434('0x44')](_[_0xd434('0x4d')](_0x1269e0['query'],_0x347651[_0xd434('0x44')]));if(_0x1269e0[_0xd434('0x42')]['filter']){_0x4e0e68['where']=_[_0xd434('0x4f')](_0x4e0e68[_0xd434('0x4c')],{'$or':_[_0xd434('0x3c')](_0x4e0e68['attributes'],function(_0x45073c){var _0x18fce8={};_0x18fce8[_0x45073c]={'$like':'%'+_0x1269e0[_0xd434('0x42')][_0xd434('0x4e')]+'%'};return _0x18fce8;})});}_0x4e0e68=_[_0xd434('0x4f')]({},_0x4e0e68,_0x1269e0[_0xd434('0x51')]);return _0x5f2d36[_0xd434('0xc5')](_0x4e0e68);}})['then'](function(_0x79985c){if(_0x79985c){_0x3c859d=_0x79985c[_0xd434('0x5a')];if(!_0x1269e0['query'][_0xd434('0x48')](_0xd434('0x49'))){_0x4e0e68[_0xd434('0x2d')]=qs['limit'](_0x1269e0[_0xd434('0x42')][_0xd434('0x2d')]);_0x4e0e68['offset']=qs[_0xd434('0x2b')](_0x1269e0[_0xd434('0x42')][_0xd434('0x2b')]);}return _0x5f2d36['getAgents'](_0x4e0e68);}})[_0xd434('0x1e')](function(_0xe5038b){if(_0xe5038b){return _0xe5038b?{'count':_0x3c859d,'rows':_0xe5038b}:null;}})['then'](respondWithResult(_0x417a7d,null))[_0xd434('0x28')](handleError(_0x417a7d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 80ac552..786f735 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 _0x81d4=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x1619aa,_0x46e0c8){var _0x30750f=function(_0x44dc5a){while(--_0x44dc5a){_0x1619aa['push'](_0x1619aa['shift']());}};_0x30750f(++_0x46e0c8);}(_0x81d4,0x1ca));var _0x481d=function(_0x1067a9,_0x5b8436){_0x1067a9=_0x1067a9-0x0;var _0xc2153a=_0x81d4[_0x1067a9];return _0xc2153a;};'use strict';var EventEmitter=require(_0x481d('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x481d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x481d('0x2')](0x0);var events={'afterCreate':_0x481d('0x3'),'afterUpdate':_0x481d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7ea4bf){return function(_0x46714d,_0xc8fb4b,_0x34a0f2){FaxAccountEvents['emit'](_0x7ea4bf+':'+_0x46714d['id'],_0x46714d);FaxAccountEvents[_0x481d('0x5')](_0x7ea4bf,_0x46714d);_0x34a0f2(null);};}for(var e in events){if(events[_0x481d('0x6')](e)){var event=events[e];FaxAccount[_0x481d('0x7')](e,emitEvent(event));}}module[_0x481d('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x5296=['events','FaxAccount','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0xe6fc3e,_0x30579d){var _0x5aa228=function(_0x1380a3){while(--_0x1380a3){_0xe6fc3e['push'](_0xe6fc3e['shift']());}};_0x5aa228(++_0x30579d);}(_0x5296,0x1a4));var _0x6529=function(_0x1d5811,_0x4e44c3){_0x1d5811=_0x1d5811-0x0;var _0x22bc6d=_0x5296[_0x1d5811];return _0x22bc6d;};'use strict';var EventEmitter=require(_0x6529('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x6529('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6529('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6529('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b95c1){return function(_0xcbef1d,_0x1416b4,_0x29c91a){FaxAccountEvents[_0x6529('0x4')](_0x2b95c1+':'+_0xcbef1d['id'],_0xcbef1d);FaxAccountEvents['emit'](_0x2b95c1,_0xcbef1d);_0x29c91a(null);};}for(var e in events){if(events[_0x6529('0x5')](e)){var event=events[e];FaxAccount[_0x6529('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 69d2dfb..21bbb92 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 _0xadc7=['define','api','request-promise','path','rimraf'];(function(_0x5dd7be,_0x1d7d6d){var _0x31a9c2=function(_0x28f8a4){while(--_0x28f8a4){_0x5dd7be['push'](_0x5dd7be['shift']());}};_0x31a9c2(++_0x1d7d6d);}(_0xadc7,0x128));var _0x7adc=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xadc7[_0xe45118];return _0x15e15d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7adc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7adc('0x1'));var fs=require('fs');var path=require(_0x7adc('0x2'));var rimraf=require(_0x7adc('0x3'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x5d36f8,_0x30248c){return _0x5d36f8[_0x7adc('0x4')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x845d=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x551783,_0xc1e908){var _0x39083a=function(_0x1e8814){while(--_0x1e8814){_0x551783['push'](_0x551783['shift']());}};_0x39083a(++_0xc1e908);}(_0x845d,0x174));var _0xd845=function(_0x175e6d,_0xc07d9c){_0x175e6d=_0x175e6d-0x0;var _0x1015bb=_0x845d[_0x175e6d];return _0x1015bb;};'use strict';var _=require(_0xd845('0x0'));var util=require(_0xd845('0x1'));var logger=require(_0xd845('0x2'))('api');var moment=require(_0xd845('0x3'));var BPromise=require(_0xd845('0x4'));var rp=require(_0xd845('0x5'));var fs=require('fs');var path=require(_0xd845('0x6'));var rimraf=require(_0xd845('0x7'));var config=require(_0xd845('0x8'));var attributes=require(_0xd845('0x9'));module[_0xd845('0xa')]=function(_0x5bdba5,_0x1f8305){return _0x5bdba5[_0xd845('0xb')](_0xd845('0xc'),attributes,{'tableName':_0xd845('0xd'),'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 0843cc5..68e487a 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 _0xacca=['fax','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','length','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','created','interaction','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','redis','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetFaxAccount','findAll','options','where','attributes','limit','include','model','map','NotifyFaxAccount','body'];(function(_0x2ae479,_0x1dd45c){var _0xa22d28=function(_0x4869f4){while(--_0x4869f4){_0x2ae479['push'](_0x2ae479['shift']());}};_0xa22d28(++_0x1dd45c);}(_0xacca,0x8d));var _0xaacc=function(_0x4dd8b4,_0x3b95dc){_0x4dd8b4=_0x4dd8b4-0x0;var _0x1d7f84=_0xacca[_0x4dd8b4];return _0x1d7f84;};'use strict';var _=require(_0xaacc('0x0'));var util=require('util');var moment=require(_0xaacc('0x1'));var BPromise=require(_0xaacc('0x2'));var rs=require(_0xaacc('0x3'));var fs=require('fs');var Redis=require(_0xaacc('0x4'));var db=require(_0xaacc('0x5'))['db'];var utils=require(_0xaacc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xaacc('0x7'));var jayson=require(_0xaacc('0x8'));var client=jayson[_0xaacc('0x9')]['http']({'port':0x232c});config['redis']=_[_0xaacc('0xa')](config['redis'],{'host':_0xaacc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaacc('0xc')]));require('./faxAccount.socket')[_0xaacc('0xd')](socket);function respondWithRpcPromise(_0x462cae,_0x37d4b1,_0x56895a){return new BPromise(function(_0xeb67d9,_0x55c1b0){return client[_0xaacc('0xe')](_0x462cae,_0x56895a)[_0xaacc('0xf')](function(_0x68953f){logger[_0xaacc('0x10')](_0xaacc('0x11'),_0x37d4b1,_0xaacc('0x12'));logger[_0xaacc('0x13')](_0xaacc('0x14'),_0x37d4b1,'request\x20sent',JSON[_0xaacc('0x15')](_0x68953f));if(_0x68953f[_0xaacc('0x16')]){if(_0x68953f[_0xaacc('0x16')]['code']===0x1f4){logger[_0xaacc('0x16')]('FaxAccount,\x20%s,\x20%s',_0x37d4b1,_0x68953f[_0xaacc('0x16')][_0xaacc('0x17')]);return _0x55c1b0(_0x68953f['error'][_0xaacc('0x17')]);}logger[_0xaacc('0x16')](_0xaacc('0x11'),_0x37d4b1,_0x68953f[_0xaacc('0x16')]['message']);return _0xeb67d9(_0x68953f['error'][_0xaacc('0x17')]);}else{logger[_0xaacc('0x10')](_0xaacc('0x11'),_0x37d4b1,'request\x20sent');_0xeb67d9(_0x68953f['result'][_0xaacc('0x17')]);}})['catch'](function(_0x150e35){logger['error']('FaxAccount,\x20%s,\x20%s',_0x37d4b1,_0x150e35);_0x55c1b0(_0x150e35);});});}exports[_0xaacc('0x18')]=function(_0x4b0e3e){var _0x3692e0=this;return new Promise(function(_0x57459d,_0x579e7e){return db['FaxAccount'][_0xaacc('0x19')]({'raw':_0x4b0e3e['options']?_0x4b0e3e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b0e3e[_0xaacc('0x1a')]?_0x4b0e3e[_0xaacc('0x1a')][_0xaacc('0x1b')]||null:null,'attributes':_0x4b0e3e[_0xaacc('0x1a')]?_0x4b0e3e[_0xaacc('0x1a')][_0xaacc('0x1c')]||null:null,'limit':_0x4b0e3e[_0xaacc('0x1a')]?_0x4b0e3e[_0xaacc('0x1a')][_0xaacc('0x1d')]||null:null,'include':_0x4b0e3e[_0xaacc('0x1a')]?_0x4b0e3e[_0xaacc('0x1a')][_0xaacc('0x1e')]?_['map'](_0x4b0e3e[_0xaacc('0x1a')]['include'],function(_0xc62825){return{'model':db[_0xc62825['model']],'as':_0xc62825['as'],'attributes':_0xc62825[_0xaacc('0x1c')],'include':_0xc62825['include']?_['map'](_0xc62825[_0xaacc('0x1e')],function(_0x28046c){return{'model':db[_0x28046c[_0xaacc('0x1f')]],'as':_0x28046c['as'],'attributes':_0x28046c[_0xaacc('0x1c')],'include':_0x28046c[_0xaacc('0x1e')]?_[_0xaacc('0x20')](_0x28046c[_0xaacc('0x1e')],function(_0x1f58fa){return{'model':db[_0x1f58fa[_0xaacc('0x1f')]],'as':_0x1f58fa['as'],'attributes':_0x1f58fa[_0xaacc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaacc('0xf')](function(_0x3945d0){logger[_0xaacc('0x10')](_0xaacc('0x18'),_0x4b0e3e);logger[_0xaacc('0x13')](_0xaacc('0x18'),_0x4b0e3e,JSON[_0xaacc('0x15')](_0x3945d0));_0x57459d(_0x3945d0);})['catch'](function(_0x5d56f5){logger[_0xaacc('0x16')](_0xaacc('0x18'),_0x5d56f5[_0xaacc('0x17')],_0x4b0e3e);_0x579e7e(_0x3692e0[_0xaacc('0x16')](0x1f4,_0x5d56f5[_0xaacc('0x17')]));});});};exports[_0xaacc('0x21')]=function(_0x360fed,_0x2dae6c,_0x18194d){var _0x501da2=this;return new Promise(function(_0x4cf78d,_0x5dddc9){var _0x199bd6={'body':_0x360fed[_0xaacc('0x22')],'channel':_0xaacc('0x23')};var _0x11e57a=[];var _0x514d63=[];var _0x2347d8={};return db[_0xaacc('0x24')]['describe']()[_0xaacc('0xf')](function(_0x535ea6){if(!_0x535ea6){throw new db['Sequelize'][(_0xaacc('0x25'))](_0xaacc('0x26'));}_0x11e57a=_[_0xaacc('0x27')](_['keys'](_0x535ea6),[_0xaacc('0x28'),_0xaacc('0x29')]);_0x514d63=_[_0xaacc('0x27')](_[_0xaacc('0x2a')](_0x535ea6),['createdAt',_0xaacc('0x29'),_0xaacc('0x2b'),'ListId']);if(_0x360fed[_0xaacc('0x22')]['id']){delete _0x360fed[_0xaacc('0x22')]['id'];}if(_[_0xaacc('0x2c')](_0x360fed[_0xaacc('0x22')][_0xaacc('0x2d')])){throw new db[(_0xaacc('0x2e'))][(_0xaacc('0x25'))](_0xaacc('0x2f'));}if(_['isNil'](_0x360fed[_0xaacc('0x22')][_0xaacc('0x22')])||_0x360fed['body'][_0xaacc('0x22')]===''){throw new db[(_0xaacc('0x2e'))][(_0xaacc('0x25'))](_0xaacc('0x30'));}if(_[_0xaacc('0x2c')](_0x360fed[_0xaacc('0x22')][_0xaacc('0x31')])){throw new db['Sequelize'][(_0xaacc('0x25'))](_0xaacc('0x32')+_0x514d63);}if(!_[_0xaacc('0x33')](_0x514d63,_0x360fed[_0xaacc('0x22')][_0xaacc('0x31')])){throw new db[(_0xaacc('0x2e'))][(_0xaacc('0x25'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x514d63);}_0x2347d8[_0x360fed['body']['mapKey']]=_0x360fed[_0xaacc('0x22')][_0xaacc('0x2d')];})['then'](function(){return db[_0xaacc('0x34')][_0xaacc('0x35')]({'where':{'id':_0x360fed[_0xaacc('0x36')]['id']},'include':[{'model':db[_0xaacc('0x37')],'as':_0xaacc('0x38'),'include':[{'model':db[_0xaacc('0x24')],'as':_0xaacc('0x39'),'where':_0x2347d8,'limit':0x1,'order':[[_0xaacc('0x29'),_0xaacc('0x3a')]]}]},{'model':db[_0xaacc('0x3b')],'as':_0xaacc('0x3c')}]});})[_0xaacc('0xf')](function(_0x44b50e){if(_0x44b50e&&_0x44b50e[_0xaacc('0x38')]){var _0x1a77d9=_0x44b50e[_0xaacc('0x3d')]({'plain':!![]});_0x199bd6['account']=_0x1a77d9;_0x199bd6[_0xaacc('0x3e')]=_0x1a77d9[_0xaacc('0x3c')];_0x199bd6[_0xaacc('0x3f')]=_0x1a77d9[_0xaacc('0x38')];_0x199bd6[_0xaacc('0x3e')]=_[_0xaacc('0x40')](_0x199bd6[_0xaacc('0x3e')],[_0xaacc('0x41')],['asc']);if(_0x199bd6[_0xaacc('0x36')][_0xaacc('0x3c')]){delete _0x199bd6[_0xaacc('0x36')][_0xaacc('0x3c')];}if(_0x199bd6[_0xaacc('0x36')]['List']&&_0x199bd6[_0xaacc('0x36')]['List'][_0xaacc('0x39')][_0xaacc('0x42')]){return _0x199bd6[_0xaacc('0x36')][_0xaacc('0x38')][_0xaacc('0x39')][0x0];}var _0x28f4ff=_[_0xaacc('0xa')](_0x360fed[_0xaacc('0x22')],{'firstName':_0x360fed[_0xaacc('0x22')][_0xaacc('0x2d')],'ListId':_0x1a77d9[_0xaacc('0x43')]});_0x28f4ff[_0x360fed[_0xaacc('0x22')][_0xaacc('0x31')]]=_0x360fed['body'][_0xaacc('0x2d')];return db[_0xaacc('0x24')]['create'](_0x28f4ff,{'fields':_0x11e57a,'raw':!![]});}})[_0xaacc('0xf')](function(_0x15a81e){_0x199bd6[_0xaacc('0x44')]=_0x15a81e;if(_0x15a81e){var _0x4a66b0={'ContactId':_0x15a81e['id'],'FaxAccountId':_0x360fed[_0xaacc('0x36')]['id'],'fax':_0x15a81e['fax']};return db[_0xaacc('0x45')]['find']({'where':{'ContactId':_0x15a81e['id'],'closed':![],'FaxAccountId':_0x360fed[_0xaacc('0x36')]['id']}})[_0xaacc('0xf')](function(_0x2f6baa){if(_0x2f6baa){return[_0x2f6baa,![]];}return db[_0xaacc('0x45')][_0xaacc('0x46')](_0x4a66b0)[_0xaacc('0xf')](function(_0x5d496b){return[_0x5d496b,!![]];});});}else{throw new Error(_0xaacc('0x47'));}})[_0xaacc('0x48')](function(_0xe11d2a,_0x551235){var _0x34e197=_0xe11d2a['get']({'plain':!![]});if(_0x551235){if(_0x199bd6['account'][_0xaacc('0x49')]){_0x199bd6[_0xaacc('0x3e')][_0xaacc('0x4a')]({'id':0x0,'priority':_0x199bd6['applications'][_0xaacc('0x42')]+0x1,'app':_0xaacc('0x4b'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x34e197[_0xaacc('0x4c')]=!![];}else{_0x34e197[_0xaacc('0x4c')]=![];}_0x199bd6[_0xaacc('0x4d')]=_0x34e197;return db['FaxMessage']['create']({'body':_0x360fed[_0xaacc('0x22')][_0xaacc('0x22')],'FaxAccountId':_0x360fed[_0xaacc('0x36')]['id'],'FaxInteractionId':_0xe11d2a['id'],'direction':'in','ContactId':_0xe11d2a[_0xaacc('0x4e')],'AttachmentId':_0x360fed[_0xaacc('0x22')][_0xaacc('0x4f')]});})[_0xaacc('0xf')](function(_0x598821){_0x199bd6['message']=_0x598821;if(_0x199bd6[_0xaacc('0x4d')][_0xaacc('0x50')]){return db[_0xaacc('0x51')][_0xaacc('0x35')]({'attributes':['id','name'],'where':{'id':_0x199bd6[_0xaacc('0x4d')][_0xaacc('0x50')]}})[_0xaacc('0xf')](function(_0x5133d9){if(_0x5133d9){_0x199bd6[_0xaacc('0x3e')][_0xaacc('0x52')]({'id':0x0,'priority':0x0,'app':_0xaacc('0x53'),'appdata':_0x5133d9['name']+','+(_0x199bd6[_0xaacc('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0xaacc('0x54')});}return respondWithRpcPromise(_0xaacc('0x55'),_0xaacc('0x56'),_0x199bd6);});}return respondWithRpcPromise('Start',_0xaacc('0x56'),_0x199bd6);})[_0xaacc('0xf')](function(_0x272156){_0x4cf78d(_0x272156);})[_0xaacc('0x57')](function(_0x1c3f69){_0x5dddc9(_0x501da2[_0xaacc('0x16')](0x1f4,_0x1c3f69[_0xaacc('0x17')]));});});}; \ No newline at end of file +var _0xc272=['list','orderBy','priority','asc','defaults','ListId','from','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','limit','include','map','attributes','model','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','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','List','Contacts','DESC','FaxApplication','Applications','get','account','applications'];(function(_0x2a2bbf,_0x10f06a){var _0x48fd8a=function(_0x1ca2c7){while(--_0x1ca2c7){_0x2a2bbf['push'](_0x2a2bbf['shift']());}};_0x48fd8a(++_0x10f06a);}(_0xc272,0x19a));var _0x2c27=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xc272[_0x4b2cc6];return _0x3e0b08;};'use strict';var _=require(_0x2c27('0x0'));var util=require(_0x2c27('0x1'));var moment=require(_0x2c27('0x2'));var BPromise=require(_0x2c27('0x3'));var rs=require(_0x2c27('0x4'));var fs=require('fs');var Redis=require(_0x2c27('0x5'));var db=require(_0x2c27('0x6'))['db'];var utils=require(_0x2c27('0x7'));var logger=require(_0x2c27('0x8'))('rpc');var config=require(_0x2c27('0x9'));var jayson=require(_0x2c27('0xa'));var client=jayson[_0x2c27('0xb')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x2c27('0xc')],{'host':_0x2c27('0xd'),'port':0x18eb});var socket=require(_0x2c27('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x2c27('0xf')](socket);function respondWithRpcPromise(_0x270d03,_0x47c456,_0x5c0c89){return new BPromise(function(_0x280594,_0x3015a0){return client[_0x2c27('0x10')](_0x270d03,_0x5c0c89)[_0x2c27('0x11')](function(_0xacaa3){logger[_0x2c27('0x12')](_0x2c27('0x13'),_0x47c456,_0x2c27('0x14'));logger[_0x2c27('0x15')](_0x2c27('0x16'),_0x47c456,'request\x20sent',JSON[_0x2c27('0x17')](_0xacaa3));if(_0xacaa3['error']){if(_0xacaa3[_0x2c27('0x18')][_0x2c27('0x19')]===0x1f4){logger[_0x2c27('0x18')]('FaxAccount,\x20%s,\x20%s',_0x47c456,_0xacaa3[_0x2c27('0x18')][_0x2c27('0x1a')]);return _0x3015a0(_0xacaa3[_0x2c27('0x18')][_0x2c27('0x1a')]);}logger[_0x2c27('0x18')]('FaxAccount,\x20%s,\x20%s',_0x47c456,_0xacaa3[_0x2c27('0x18')][_0x2c27('0x1a')]);return _0x280594(_0xacaa3[_0x2c27('0x18')][_0x2c27('0x1a')]);}else{logger['info'](_0x2c27('0x13'),_0x47c456,_0x2c27('0x14'));_0x280594(_0xacaa3[_0x2c27('0x1b')][_0x2c27('0x1a')]);}})[_0x2c27('0x1c')](function(_0x289561){logger[_0x2c27('0x18')](_0x2c27('0x13'),_0x47c456,_0x289561);_0x3015a0(_0x289561);});});}exports[_0x2c27('0x1d')]=function(_0x3da5af){var _0x493e2a=this;return new Promise(function(_0x442c54,_0x4614be){return db[_0x2c27('0x1e')][_0x2c27('0x1f')]({'raw':_0x3da5af[_0x2c27('0x20')]?_0x3da5af[_0x2c27('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3da5af['options']?_0x3da5af['options']['where']||null:null,'attributes':_0x3da5af[_0x2c27('0x20')]?_0x3da5af[_0x2c27('0x20')]['attributes']||null:null,'limit':_0x3da5af[_0x2c27('0x20')]?_0x3da5af[_0x2c27('0x20')][_0x2c27('0x21')]||null:null,'include':_0x3da5af[_0x2c27('0x20')]?_0x3da5af[_0x2c27('0x20')][_0x2c27('0x22')]?_[_0x2c27('0x23')](_0x3da5af['options'][_0x2c27('0x22')],function(_0x79e7f2){return{'model':db[_0x79e7f2['model']],'as':_0x79e7f2['as'],'attributes':_0x79e7f2[_0x2c27('0x24')],'include':_0x79e7f2['include']?_[_0x2c27('0x23')](_0x79e7f2[_0x2c27('0x22')],function(_0x30dfb9){return{'model':db[_0x30dfb9[_0x2c27('0x25')]],'as':_0x30dfb9['as'],'attributes':_0x30dfb9[_0x2c27('0x24')],'include':_0x30dfb9[_0x2c27('0x22')]?_[_0x2c27('0x23')](_0x30dfb9[_0x2c27('0x22')],function(_0x186eec){return{'model':db[_0x186eec[_0x2c27('0x25')]],'as':_0x186eec['as'],'attributes':_0x186eec[_0x2c27('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cd743){logger[_0x2c27('0x12')]('GetFaxAccount',_0x3da5af);logger['debug'](_0x2c27('0x1d'),_0x3da5af,JSON[_0x2c27('0x17')](_0x4cd743));_0x442c54(_0x4cd743);})[_0x2c27('0x1c')](function(_0x4c243d){logger[_0x2c27('0x18')](_0x2c27('0x1d'),_0x4c243d[_0x2c27('0x1a')],_0x3da5af);_0x4614be(_0x493e2a['error'](0x1f4,_0x4c243d[_0x2c27('0x1a')]));});});};exports[_0x2c27('0x26')]=function(_0x49e43a,_0x1a008b,_0x4c2d2d){var _0x3892d2=this;return new Promise(function(_0x2c6951,_0x86c095){var _0x1a553e={'body':_0x49e43a[_0x2c27('0x27')],'channel':_0x2c27('0x28')};var _0x54fd26=[];var _0x4b9b06=[];var _0x351206={};return db[_0x2c27('0x29')][_0x2c27('0x2a')]()[_0x2c27('0x11')](function(_0x3b08c0){if(!_0x3b08c0){throw new db['Sequelize'][(_0x2c27('0x2b'))](_0x2c27('0x2c'));}_0x54fd26=_[_0x2c27('0x2d')](_[_0x2c27('0x2e')](_0x3b08c0),[_0x2c27('0x2f'),_0x2c27('0x30')]);_0x4b9b06=_[_0x2c27('0x2d')](_[_0x2c27('0x2e')](_0x3b08c0),[_0x2c27('0x2f'),_0x2c27('0x30'),_0x2c27('0x31'),'ListId']);if(_0x49e43a[_0x2c27('0x27')]['id']){delete _0x49e43a[_0x2c27('0x27')]['id'];}if(_[_0x2c27('0x32')](_0x49e43a[_0x2c27('0x27')]['from'])){throw new db[(_0x2c27('0x33'))][(_0x2c27('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x2c27('0x32')](_0x49e43a[_0x2c27('0x27')]['body'])||_0x49e43a['body'][_0x2c27('0x27')]===''){throw new db['Sequelize'][(_0x2c27('0x2b'))](_0x2c27('0x34'));}if(_[_0x2c27('0x32')](_0x49e43a['body'][_0x2c27('0x35')])){throw new db['Sequelize'][(_0x2c27('0x2b'))](_0x2c27('0x36')+_0x4b9b06);}if(!_['includes'](_0x4b9b06,_0x49e43a[_0x2c27('0x27')][_0x2c27('0x35')])){throw new db[(_0x2c27('0x33'))][(_0x2c27('0x2b'))](_0x2c27('0x37')+_0x4b9b06);}_0x351206[_0x49e43a[_0x2c27('0x27')][_0x2c27('0x35')]]=_0x49e43a[_0x2c27('0x27')]['from'];})[_0x2c27('0x11')](function(){return db['FaxAccount']['find']({'where':{'id':_0x49e43a['account']['id']},'include':[{'model':db[_0x2c27('0x38')],'as':_0x2c27('0x39'),'include':[{'model':db[_0x2c27('0x29')],'as':_0x2c27('0x3a'),'where':_0x351206,'limit':0x1,'order':[[_0x2c27('0x30'),_0x2c27('0x3b')]]}]},{'model':db[_0x2c27('0x3c')],'as':_0x2c27('0x3d')}]});})[_0x2c27('0x11')](function(_0x3b7d89){if(_0x3b7d89&&_0x3b7d89[_0x2c27('0x39')]){var _0x570d51=_0x3b7d89[_0x2c27('0x3e')]({'plain':!![]});_0x1a553e[_0x2c27('0x3f')]=_0x570d51;_0x1a553e[_0x2c27('0x40')]=_0x570d51['Applications'];_0x1a553e[_0x2c27('0x41')]=_0x570d51[_0x2c27('0x39')];_0x1a553e['applications']=_[_0x2c27('0x42')](_0x1a553e[_0x2c27('0x40')],[_0x2c27('0x43')],[_0x2c27('0x44')]);if(_0x1a553e['account'][_0x2c27('0x3d')]){delete _0x1a553e[_0x2c27('0x3f')]['Applications'];}if(_0x1a553e[_0x2c27('0x3f')][_0x2c27('0x39')]&&_0x1a553e[_0x2c27('0x3f')][_0x2c27('0x39')][_0x2c27('0x3a')]['length']){return _0x1a553e[_0x2c27('0x3f')][_0x2c27('0x39')]['Contacts'][0x0];}var _0x1a3190=_[_0x2c27('0x45')](_0x49e43a[_0x2c27('0x27')],{'firstName':_0x49e43a[_0x2c27('0x27')]['from'],'ListId':_0x570d51[_0x2c27('0x46')]});_0x1a3190[_0x49e43a[_0x2c27('0x27')][_0x2c27('0x35')]]=_0x49e43a[_0x2c27('0x27')][_0x2c27('0x47')];return db[_0x2c27('0x29')][_0x2c27('0x48')](_0x1a3190,{'fields':_0x54fd26,'raw':!![]});}})[_0x2c27('0x11')](function(_0x4e412d){_0x1a553e[_0x2c27('0x49')]=_0x4e412d;if(_0x4e412d){var _0x3d40ad={'ContactId':_0x4e412d['id'],'FaxAccountId':_0x49e43a['account']['id'],'fax':_0x4e412d[_0x2c27('0x28')]};return db[_0x2c27('0x4a')][_0x2c27('0x4b')]({'where':{'ContactId':_0x4e412d['id'],'closed':![],'FaxAccountId':_0x49e43a['account']['id']}})[_0x2c27('0x11')](function(_0x50a3ed){if(_0x50a3ed){return[_0x50a3ed,![]];}return db[_0x2c27('0x4a')]['create'](_0x3d40ad)[_0x2c27('0x11')](function(_0x46a55f){return[_0x46a55f,!![]];});});}else{throw new Error(_0x2c27('0x4c'));}})[_0x2c27('0x4d')](function(_0x474c70,_0x2dc8ef){var _0x64852=_0x474c70[_0x2c27('0x3e')]({'plain':!![]});if(_0x2dc8ef){if(_0x1a553e[_0x2c27('0x3f')][_0x2c27('0x4e')]){_0x1a553e[_0x2c27('0x40')][_0x2c27('0x4f')]({'id':0x0,'priority':_0x1a553e[_0x2c27('0x40')][_0x2c27('0x50')]+0x1,'app':_0x2c27('0x51'),'appdata':_0x2c27('0x52'),'interval':_0x2c27('0x53')});}_0x64852[_0x2c27('0x54')]=!![];}else{_0x64852[_0x2c27('0x54')]=![];}_0x1a553e['interaction']=_0x64852;return db[_0x2c27('0x55')][_0x2c27('0x48')]({'body':_0x49e43a[_0x2c27('0x27')][_0x2c27('0x27')],'FaxAccountId':_0x49e43a[_0x2c27('0x3f')]['id'],'FaxInteractionId':_0x474c70['id'],'direction':'in','ContactId':_0x474c70[_0x2c27('0x56')],'AttachmentId':_0x49e43a['body'][_0x2c27('0x57')]});})[_0x2c27('0x11')](function(_0x2a0437){_0x1a553e[_0x2c27('0x1a')]=_0x2a0437;if(_0x1a553e[_0x2c27('0x58')]['UserId']){return db[_0x2c27('0x59')][_0x2c27('0x4b')]({'attributes':['id',_0x2c27('0x5a')],'where':{'id':_0x1a553e[_0x2c27('0x58')]['UserId']}})['then'](function(_0x15d2be){if(_0x15d2be){_0x1a553e['applications'][_0x2c27('0x5b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x15d2be[_0x2c27('0x5a')]+','+(_0x1a553e[_0x2c27('0x3f')][_0x2c27('0x5c')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2c27('0x5d'),_0x2c27('0x5e'),_0x1a553e);});}return respondWithRpcPromise(_0x2c27('0x5d'),_0x2c27('0x5e'),_0x1a553e);})[_0x2c27('0x11')](function(_0x22c9b5){_0x2c6951(_0x22c9b5);})[_0x2c27('0x1c')](function(_0x1ce8d5){_0x86c095(_0x3892d2[_0x2c27('0x18')](0x1f4,_0x1ce8d5[_0x2c27('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 539dc35..9d8aeb4 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 _0x5613=['removeListener','register','faxAccount:','./faxAccount.events','save','update','emit'];(function(_0x250b8b,_0x1d3b34){var _0x458585=function(_0x53147d){while(--_0x53147d){_0x250b8b['push'](_0x250b8b['shift']());}};_0x458585(++_0x1d3b34);}(_0x5613,0xc7));var _0x3561=function(_0x4adba1,_0x4a62e7){_0x4adba1=_0x4adba1-0x0;var _0x5b2fe6=_0x5613[_0x4adba1];return _0x5b2fe6;};'use strict';var FaxAccountEvents=require(_0x3561('0x0'));var events=[_0x3561('0x1'),'remove',_0x3561('0x2')];function createListener(_0x22b353,_0x391918){return function(_0x3ea65b){_0x391918[_0x3561('0x3')](_0x22b353,_0x3ea65b);};}function removeListener(_0x492e4c,_0x36321e){return function(){FaxAccountEvents[_0x3561('0x4')](_0x492e4c,_0x36321e);};}exports[_0x3561('0x5')]=function(_0xeadba2){for(var _0x2bfef4=0x0,_0x4b8186=events['length'];_0x2bfef4<_0x4b8186;_0x2bfef4++){var _0x3f86ad=events[_0x2bfef4];var _0x591158=createListener(_0x3561('0x6')+_0x3f86ad,_0xeadba2);FaxAccountEvents['on'](_0x3f86ad,_0x591158);}}; \ No newline at end of file +var _0xfa4b=['register','length','faxAccount:','save','remove','emit'];(function(_0x431ac5,_0x5e319f){var _0x235779=function(_0x44cbed){while(--_0x44cbed){_0x431ac5['push'](_0x431ac5['shift']());}};_0x235779(++_0x5e319f);}(_0xfa4b,0xd5));var _0xbfa4=function(_0xfc749d,_0x558576){_0xfc749d=_0xfc749d-0x0;var _0xa7495a=_0xfa4b[_0xfc749d];return _0xa7495a;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xbfa4('0x0'),_0xbfa4('0x1'),'update'];function createListener(_0x30667f,_0x8d3362){return function(_0x4fd55e){_0x8d3362[_0xbfa4('0x2')](_0x30667f,_0x4fd55e);};}function removeListener(_0x1ee1d4,_0x1333ea){return function(){FaxAccountEvents['removeListener'](_0x1ee1d4,_0x1333ea);};}exports[_0xbfa4('0x3')]=function(_0x127508){for(var _0x38902a=0x0,_0x309f7f=events[_0xbfa4('0x4')];_0x38902a<_0x309f7f;_0x38902a++){var _0xb8df09=events[_0x38902a];var _0x295445=createListener(_0xbfa4('0x5')+_0xb8df09,_0x127508);FaxAccountEvents['on'](_0xb8df09,_0x295445);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d830fea..8babae1 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(_0x351f8c,_0x20bf49){var _0x1bffff=function(_0x41f168){while(--_0x41f168){_0x351f8c['push'](_0x351f8c['shift']());}};_0x1bffff(++_0x20bf49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x292b2d,_0x38fb08){var _0x492116=function(_0x280403){while(--_0x280403){_0x292b2d['push'](_0x292b2d['shift']());}};_0x492116(++_0x38fb08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 32e92de..8082d99 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 _0x23af=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x23d2a0,_0x516174){var _0x409e80=function(_0x432940){while(--_0x432940){_0x23d2a0['push'](_0x23d2a0['shift']());}};_0x409e80(++_0x516174);}(_0x23af,0x127));var _0xf23a=function(_0x3a4259,_0x65050){_0x3a4259=_0x3a4259-0x0;var _0x15d48c=_0x23af[_0x3a4259];return _0x15d48c;};'use strict';var Sequelize=require(_0xf23a('0x0'));module[_0xf23a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![],'defaultValue':_0xf23a('0x3')},'appdata':{'type':Sequelize[_0xf23a('0x4')]()},'description':{'type':Sequelize[_0xf23a('0x2')]},'interval':{'type':Sequelize[_0xf23a('0x2')],'defaultValue':_0xf23a('0x5')}}; \ No newline at end of file +var _0xbdf3=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x39d174,_0x1d2287){var _0x487dcf=function(_0x240c6d){while(--_0x240c6d){_0x39d174['push'](_0x39d174['shift']());}};_0x487dcf(++_0x1d2287);}(_0xbdf3,0x17a));var _0x3bdf=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0xbdf3[_0x27604f];return _0x40d189;};'use strict';var Sequelize=require(_0x3bdf('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3bdf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3bdf('0x2')],'allowNull':![],'defaultValue':_0x3bdf('0x3')},'appdata':{'type':Sequelize[_0x3bdf('0x4')]()},'description':{'type':Sequelize[_0x3bdf('0x2')]},'interval':{'type':Sequelize[_0x3bdf('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6b12b69..79dacd2 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 _0xc501=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','FaxApplication','count','includeAll','findAll','rows','catch','show','params','keys','length','include','options','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc501,0x1c4));var _0x1c50=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xc501[_0x43aee5];return _0x76d1d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c50('0x0'));var zipdir=require(_0x1c50('0x1'));var jsonpatch=require(_0x1c50('0x2'));var rp=require(_0x1c50('0x3'));var moment=require(_0x1c50('0x4'));var BPromise=require(_0x1c50('0x5'));var Mustache=require('mustache');var util=require(_0x1c50('0x6'));var path=require(_0x1c50('0x7'));var sox=require(_0x1c50('0x8'));var csv=require(_0x1c50('0x9'));var ejs=require(_0x1c50('0xa'));var fs=require('fs');var fs_extra=require(_0x1c50('0xb'));var _=require(_0x1c50('0xc'));var squel=require('squel');var crypto=require(_0x1c50('0xd'));var jsforce=require(_0x1c50('0xe'));var deskjs=require(_0x1c50('0xf'));var toCsv=require(_0x1c50('0x9'));var querystring=require(_0x1c50('0x10'));var Papa=require(_0x1c50('0x11'));var Redis=require(_0x1c50('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1c50('0x13'));var as=require(_0x1c50('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c50('0x15'))('api');var utils=require(_0x1c50('0x16'));var config=require(_0x1c50('0x17'));var licenseUtil=require(_0x1c50('0x18'));var db=require(_0x1c50('0x19'))['db'];function respondWithStatusCode(_0x132c03,_0xbb8b8b){_0xbb8b8b=_0xbb8b8b||0xcc;return function(_0x3502ae){if(_0x3502ae){return _0x132c03[_0x1c50('0x1a')](_0xbb8b8b);}return _0x132c03[_0x1c50('0x1b')](_0xbb8b8b)['end']();};}function respondWithResult(_0xc6ee27,_0x227674){_0x227674=_0x227674||0xc8;return function(_0x1084d8){if(_0x1084d8){return _0xc6ee27[_0x1c50('0x1b')](_0x227674)[_0x1c50('0x1c')](_0x1084d8);}};}function respondWithFilteredResult(_0x4a72cd,_0xaf14c3){return function(_0x4da306){if(_0x4da306){var _0x588863=typeof _0xaf14c3[_0x1c50('0x1d')]===_0x1c50('0x1e')&&typeof _0xaf14c3[_0x1c50('0x1f')]===_0x1c50('0x1e');var _0xf65c3d=_0x4da306['count'];var _0x5139c0=_0x588863?0x0:_0xaf14c3[_0x1c50('0x1d')];var _0x1bdfc6=_0x588863?_0x4da306['count']:_0xaf14c3['offset']+_0xaf14c3[_0x1c50('0x1f')];var _0x25e68f;if(_0x1bdfc6>=_0xf65c3d){_0x1bdfc6=_0xf65c3d;_0x25e68f=0xc8;}else{_0x25e68f=0xce;}_0x4a72cd[_0x1c50('0x1b')](_0x25e68f);return _0x4a72cd[_0x1c50('0x20')](_0x1c50('0x21'),_0x5139c0+'-'+_0x1bdfc6+'/'+_0xf65c3d)[_0x1c50('0x1c')](_0x4da306);}return null;};}function patchUpdates(_0x5371c5){return function(_0x3d397d){try{jsonpatch['apply'](_0x3d397d,_0x5371c5,!![]);}catch(_0x2efe9f){return BPromise[_0x1c50('0x22')](_0x2efe9f);}return _0x3d397d[_0x1c50('0x23')]();};}function saveUpdates(_0x3b6936,_0x43d044){return function(_0x3d6bce){if(_0x3d6bce){return _0x3d6bce[_0x1c50('0x24')](_0x3b6936)[_0x1c50('0x25')](function(_0x126b53){return _0x126b53;});}return null;};}function removeEntity(_0xcd97ba,_0x20c0d1){return function(_0x4ec29d){if(_0x4ec29d){return _0x4ec29d['destroy']()['then'](function(){_0xcd97ba[_0x1c50('0x1b')](0xcc)[_0x1c50('0x26')]();});}};}function handleEntityNotFound(_0x2d2c42,_0x3c02c9){return function(_0x5d8b65){if(!_0x5d8b65){_0x2d2c42['sendStatus'](0x194);}return _0x5d8b65;};}function handleError(_0x1be680,_0x4b9c71){_0x4b9c71=_0x4b9c71||0x1f4;return function(_0x430c28){logger[_0x1c50('0x27')](_0x430c28['stack']);if(_0x430c28[_0x1c50('0x28')]){delete _0x430c28[_0x1c50('0x28')];}_0x1be680['status'](_0x4b9c71)[_0x1c50('0x29')](_0x430c28);};}exports[_0x1c50('0x2a')]=function(_0x296499,_0x2198f3){var _0x4b6655={},_0x321f73={},_0x37b9da={'count':0x0,'rows':[]};var _0x19165c=_[_0x1c50('0x2b')](db['FaxApplication'][_0x1c50('0x2c')],function(_0x1b00f8){return{'name':_0x1b00f8[_0x1c50('0x2d')],'type':_0x1b00f8['type'][_0x1c50('0x2e')]};});_0x321f73[_0x1c50('0x2f')]=_['map'](_0x19165c,_0x1c50('0x28'));_0x321f73[_0x1c50('0x30')]=_['keys'](_0x296499[_0x1c50('0x30')]);_0x321f73[_0x1c50('0x31')]=_[_0x1c50('0x32')](_0x321f73[_0x1c50('0x2f')],_0x321f73['query']);_0x4b6655[_0x1c50('0x33')]=_[_0x1c50('0x32')](_0x321f73['model'],qs[_0x1c50('0x34')](_0x296499['query'][_0x1c50('0x34')]));_0x4b6655[_0x1c50('0x33')]=_0x4b6655[_0x1c50('0x33')]['length']?_0x4b6655[_0x1c50('0x33')]:_0x321f73[_0x1c50('0x2f')];if(!_0x296499[_0x1c50('0x30')][_0x1c50('0x35')](_0x1c50('0x36'))){_0x4b6655[_0x1c50('0x1f')]=qs[_0x1c50('0x1f')](_0x296499[_0x1c50('0x30')]['limit']);_0x4b6655[_0x1c50('0x1d')]=qs[_0x1c50('0x1d')](_0x296499['query']['offset']);}_0x4b6655['order']=qs[_0x1c50('0x37')](_0x296499[_0x1c50('0x30')][_0x1c50('0x37')]);_0x4b6655[_0x1c50('0x38')]=qs[_0x1c50('0x31')](_[_0x1c50('0x39')](_0x296499[_0x1c50('0x30')],_0x321f73['filters']),_0x19165c);if(_0x296499[_0x1c50('0x30')][_0x1c50('0x3a')]){_0x4b6655[_0x1c50('0x38')]=_[_0x1c50('0x3b')](_0x4b6655[_0x1c50('0x38')],{'$or':_[_0x1c50('0x2b')](_0x19165c,function(_0x47dc55){if(_0x47dc55[_0x1c50('0x3c')]!==_0x1c50('0x3d')){var _0x25802d={};_0x25802d[_0x47dc55[_0x1c50('0x28')]]={'$like':'%'+_0x296499['query'][_0x1c50('0x3a')]+'%'};return _0x25802d;}})});}_0x4b6655=_[_0x1c50('0x3b')]({},_0x4b6655,_0x296499['options']);var _0x3566d8={'where':_0x4b6655[_0x1c50('0x38')]};return db[_0x1c50('0x3e')][_0x1c50('0x3f')](_0x3566d8)[_0x1c50('0x25')](function(_0xe02af6){_0x37b9da[_0x1c50('0x3f')]=_0xe02af6;if(_0x296499[_0x1c50('0x30')][_0x1c50('0x40')]){_0x4b6655['include']=[{'all':!![]}];}return db[_0x1c50('0x3e')][_0x1c50('0x41')](_0x4b6655);})[_0x1c50('0x25')](function(_0x4d2916){_0x37b9da[_0x1c50('0x42')]=_0x4d2916;return _0x37b9da;})[_0x1c50('0x25')](respondWithFilteredResult(_0x2198f3,_0x4b6655))[_0x1c50('0x43')](handleError(_0x2198f3,null));};exports[_0x1c50('0x44')]=function(_0x2744a4,_0x1a13ac){var _0x3091c0={'raw':!![],'where':{'id':_0x2744a4[_0x1c50('0x45')]['id']}},_0x1c49a3={};_0x1c49a3['model']=_[_0x1c50('0x46')](db[_0x1c50('0x3e')][_0x1c50('0x2c')]);_0x1c49a3[_0x1c50('0x30')]=_[_0x1c50('0x46')](_0x2744a4['query']);_0x1c49a3['filters']=_[_0x1c50('0x32')](_0x1c49a3[_0x1c50('0x2f')],_0x1c49a3[_0x1c50('0x30')]);_0x3091c0[_0x1c50('0x33')]=_[_0x1c50('0x32')](_0x1c49a3['model'],qs['fields'](_0x2744a4[_0x1c50('0x30')][_0x1c50('0x34')]));_0x3091c0['attributes']=_0x3091c0[_0x1c50('0x33')][_0x1c50('0x47')]?_0x3091c0[_0x1c50('0x33')]:_0x1c49a3[_0x1c50('0x2f')];if(_0x2744a4[_0x1c50('0x30')][_0x1c50('0x40')]){_0x3091c0[_0x1c50('0x48')]=[{'all':!![]}];}_0x3091c0=_[_0x1c50('0x3b')]({},_0x3091c0,_0x2744a4[_0x1c50('0x49')]);return db['FaxApplication'][_0x1c50('0x4a')](_0x3091c0)[_0x1c50('0x25')](handleEntityNotFound(_0x1a13ac,null))[_0x1c50('0x25')](respondWithResult(_0x1a13ac,null))[_0x1c50('0x43')](handleError(_0x1a13ac,null));};exports[_0x1c50('0x4b')]=function(_0x1ace02,_0x227469){return db[_0x1c50('0x3e')]['create'](_0x1ace02['body'],{})[_0x1c50('0x25')](respondWithResult(_0x227469,0xc9))[_0x1c50('0x43')](handleError(_0x227469,null));};exports[_0x1c50('0x24')]=function(_0x3d1315,_0x3099d3){if(_0x3d1315[_0x1c50('0x4c')]['id']){delete _0x3d1315['body']['id'];}return db[_0x1c50('0x3e')][_0x1c50('0x4a')]({'where':{'id':_0x3d1315[_0x1c50('0x45')]['id']}})['then'](handleEntityNotFound(_0x3099d3,null))[_0x1c50('0x25')](saveUpdates(_0x3d1315[_0x1c50('0x4c')],null))[_0x1c50('0x25')](respondWithResult(_0x3099d3,null))['catch'](handleError(_0x3099d3,null));};exports[_0x1c50('0x4d')]=function(_0x4adbf1,_0x6b7479){return db['FaxApplication'][_0x1c50('0x4a')]({'where':{'id':_0x4adbf1[_0x1c50('0x45')]['id']}})[_0x1c50('0x25')](handleEntityNotFound(_0x6b7479,null))[_0x1c50('0x25')](removeEntity(_0x6b7479,null))[_0x1c50('0x43')](handleError(_0x6b7479,null));}; \ No newline at end of file +var _0x9f1b=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys'];(function(_0x41fa8e,_0x5ca04f){var _0x538ac8=function(_0x2405ec){while(--_0x2405ec){_0x41fa8e['push'](_0x41fa8e['shift']());}};_0x538ac8(++_0x5ca04f);}(_0x9f1b,0x1ce));var _0xb9f1=function(_0x8a4016,_0x55d199){_0x8a4016=_0x8a4016-0x0;var _0x11aa2a=_0x9f1b[_0x8a4016];return _0x11aa2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9f1('0x0'));var zipdir=require(_0xb9f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9f1('0x2'));var moment=require(_0xb9f1('0x3'));var BPromise=require(_0xb9f1('0x4'));var Mustache=require('mustache');var util=require(_0xb9f1('0x5'));var path=require('path');var sox=require(_0xb9f1('0x6'));var csv=require(_0xb9f1('0x7'));var ejs=require(_0xb9f1('0x8'));var fs=require('fs');var fs_extra=require(_0xb9f1('0x9'));var _=require(_0xb9f1('0xa'));var squel=require(_0xb9f1('0xb'));var crypto=require(_0xb9f1('0xc'));var jsforce=require(_0xb9f1('0xd'));var deskjs=require(_0xb9f1('0xe'));var toCsv=require(_0xb9f1('0x7'));var querystring=require(_0xb9f1('0xf'));var Papa=require(_0xb9f1('0x10'));var Redis=require(_0xb9f1('0x11'));var authService=require(_0xb9f1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb9f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9f1('0x14'))(_0xb9f1('0x15'));var utils=require(_0xb9f1('0x16'));var config=require(_0xb9f1('0x17'));var licenseUtil=require(_0xb9f1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cfe8f,_0x178a47){_0x178a47=_0x178a47||0xcc;return function(_0x28e7bb){if(_0x28e7bb){return _0x3cfe8f['sendStatus'](_0x178a47);}return _0x3cfe8f[_0xb9f1('0x19')](_0x178a47)[_0xb9f1('0x1a')]();};}function respondWithResult(_0x1708a0,_0x4b85c3){_0x4b85c3=_0x4b85c3||0xc8;return function(_0x3b2238){if(_0x3b2238){return _0x1708a0[_0xb9f1('0x19')](_0x4b85c3)[_0xb9f1('0x1b')](_0x3b2238);}};}function respondWithFilteredResult(_0x1af995,_0x50a11e){return function(_0x2335af){if(_0x2335af){var _0x4aef65=typeof _0x50a11e[_0xb9f1('0x1c')]===_0xb9f1('0x1d')&&typeof _0x50a11e[_0xb9f1('0x1e')]===_0xb9f1('0x1d');var _0x49fea7=_0x2335af['count'];var _0x50128e=_0x4aef65?0x0:_0x50a11e[_0xb9f1('0x1c')];var _0x1b3ddc=_0x4aef65?_0x2335af[_0xb9f1('0x1f')]:_0x50a11e[_0xb9f1('0x1c')]+_0x50a11e[_0xb9f1('0x1e')];var _0x287ede;if(_0x1b3ddc>=_0x49fea7){_0x1b3ddc=_0x49fea7;_0x287ede=0xc8;}else{_0x287ede=0xce;}_0x1af995[_0xb9f1('0x19')](_0x287ede);return _0x1af995['set']('Content-Range',_0x50128e+'-'+_0x1b3ddc+'/'+_0x49fea7)[_0xb9f1('0x1b')](_0x2335af);}return null;};}function patchUpdates(_0x4f2d6a){return function(_0x26dcd8){try{jsonpatch['apply'](_0x26dcd8,_0x4f2d6a,!![]);}catch(_0x404749){return BPromise['reject'](_0x404749);}return _0x26dcd8[_0xb9f1('0x20')]();};}function saveUpdates(_0x26ad7b,_0x21744e){return function(_0x473577){if(_0x473577){return _0x473577[_0xb9f1('0x21')](_0x26ad7b)[_0xb9f1('0x22')](function(_0x2b32a1){return _0x2b32a1;});}return null;};}function removeEntity(_0x5b5d72,_0x4565a6){return function(_0x9cea9){if(_0x9cea9){return _0x9cea9[_0xb9f1('0x23')]()['then'](function(){_0x5b5d72['status'](0xcc)[_0xb9f1('0x1a')]();});}};}function handleEntityNotFound(_0x45a837,_0x5bc109){return function(_0x3676e0){if(!_0x3676e0){_0x45a837['sendStatus'](0x194);}return _0x3676e0;};}function handleError(_0x2731f6,_0x3db750){_0x3db750=_0x3db750||0x1f4;return function(_0x106dce){logger[_0xb9f1('0x24')](_0x106dce[_0xb9f1('0x25')]);if(_0x106dce[_0xb9f1('0x26')]){delete _0x106dce[_0xb9f1('0x26')];}_0x2731f6[_0xb9f1('0x19')](_0x3db750)[_0xb9f1('0x27')](_0x106dce);};}exports[_0xb9f1('0x28')]=function(_0x33eaa1,_0x490e6b){var _0x58d3e5={},_0x47f9e0={},_0x2a9bcb={'count':0x0,'rows':[]};var _0x25aff6=_[_0xb9f1('0x29')](db[_0xb9f1('0x2a')][_0xb9f1('0x2b')],function(_0x49324d){return{'name':_0x49324d[_0xb9f1('0x2c')],'type':_0x49324d[_0xb9f1('0x2d')][_0xb9f1('0x2e')]};});_0x47f9e0[_0xb9f1('0x2f')]=_[_0xb9f1('0x29')](_0x25aff6,_0xb9f1('0x26'));_0x47f9e0['query']=_[_0xb9f1('0x30')](_0x33eaa1[_0xb9f1('0x31')]);_0x47f9e0[_0xb9f1('0x32')]=_[_0xb9f1('0x33')](_0x47f9e0['model'],_0x47f9e0[_0xb9f1('0x31')]);_0x58d3e5[_0xb9f1('0x34')]=_[_0xb9f1('0x33')](_0x47f9e0[_0xb9f1('0x2f')],qs[_0xb9f1('0x35')](_0x33eaa1['query'][_0xb9f1('0x35')]));_0x58d3e5[_0xb9f1('0x34')]=_0x58d3e5['attributes'][_0xb9f1('0x36')]?_0x58d3e5['attributes']:_0x47f9e0[_0xb9f1('0x2f')];if(!_0x33eaa1[_0xb9f1('0x31')][_0xb9f1('0x37')](_0xb9f1('0x38'))){_0x58d3e5[_0xb9f1('0x1e')]=qs[_0xb9f1('0x1e')](_0x33eaa1[_0xb9f1('0x31')]['limit']);_0x58d3e5['offset']=qs[_0xb9f1('0x1c')](_0x33eaa1[_0xb9f1('0x31')][_0xb9f1('0x1c')]);}_0x58d3e5[_0xb9f1('0x39')]=qs['sort'](_0x33eaa1[_0xb9f1('0x31')]['sort']);_0x58d3e5[_0xb9f1('0x3a')]=qs[_0xb9f1('0x32')](_[_0xb9f1('0x3b')](_0x33eaa1[_0xb9f1('0x31')],_0x47f9e0[_0xb9f1('0x32')]),_0x25aff6);if(_0x33eaa1[_0xb9f1('0x31')][_0xb9f1('0x3c')]){_0x58d3e5[_0xb9f1('0x3a')]=_['merge'](_0x58d3e5['where'],{'$or':_[_0xb9f1('0x29')](_0x25aff6,function(_0x26bc74){if(_0x26bc74[_0xb9f1('0x2d')]!=='VIRTUAL'){var _0x4e8c27={};_0x4e8c27[_0x26bc74['name']]={'$like':'%'+_0x33eaa1[_0xb9f1('0x31')][_0xb9f1('0x3c')]+'%'};return _0x4e8c27;}})});}_0x58d3e5=_['merge']({},_0x58d3e5,_0x33eaa1[_0xb9f1('0x3d')]);var _0x3bce39={'where':_0x58d3e5[_0xb9f1('0x3a')]};return db[_0xb9f1('0x2a')]['count'](_0x3bce39)[_0xb9f1('0x22')](function(_0x2268bd){_0x2a9bcb[_0xb9f1('0x1f')]=_0x2268bd;if(_0x33eaa1[_0xb9f1('0x31')][_0xb9f1('0x3e')]){_0x58d3e5[_0xb9f1('0x3f')]=[{'all':!![]}];}return db[_0xb9f1('0x2a')][_0xb9f1('0x40')](_0x58d3e5);})[_0xb9f1('0x22')](function(_0x238422){_0x2a9bcb[_0xb9f1('0x41')]=_0x238422;return _0x2a9bcb;})[_0xb9f1('0x22')](respondWithFilteredResult(_0x490e6b,_0x58d3e5))[_0xb9f1('0x42')](handleError(_0x490e6b,null));};exports[_0xb9f1('0x43')]=function(_0x1fbe17,_0x1317e9){var _0x829861={'raw':!![],'where':{'id':_0x1fbe17[_0xb9f1('0x44')]['id']}},_0xb3bec6={};_0xb3bec6[_0xb9f1('0x2f')]=_[_0xb9f1('0x30')](db['FaxApplication']['rawAttributes']);_0xb3bec6['query']=_[_0xb9f1('0x30')](_0x1fbe17['query']);_0xb3bec6[_0xb9f1('0x32')]=_['intersection'](_0xb3bec6[_0xb9f1('0x2f')],_0xb3bec6['query']);_0x829861[_0xb9f1('0x34')]=_['intersection'](_0xb3bec6['model'],qs['fields'](_0x1fbe17[_0xb9f1('0x31')][_0xb9f1('0x35')]));_0x829861[_0xb9f1('0x34')]=_0x829861['attributes']['length']?_0x829861['attributes']:_0xb3bec6[_0xb9f1('0x2f')];if(_0x1fbe17[_0xb9f1('0x31')]['includeAll']){_0x829861[_0xb9f1('0x3f')]=[{'all':!![]}];}_0x829861=_[_0xb9f1('0x45')]({},_0x829861,_0x1fbe17[_0xb9f1('0x3d')]);return db[_0xb9f1('0x2a')][_0xb9f1('0x46')](_0x829861)[_0xb9f1('0x22')](handleEntityNotFound(_0x1317e9,null))[_0xb9f1('0x22')](respondWithResult(_0x1317e9,null))['catch'](handleError(_0x1317e9,null));};exports[_0xb9f1('0x47')]=function(_0x4af715,_0xc2f1ac){return db[_0xb9f1('0x2a')]['create'](_0x4af715[_0xb9f1('0x48')],{})['then'](respondWithResult(_0xc2f1ac,0xc9))[_0xb9f1('0x42')](handleError(_0xc2f1ac,null));};exports[_0xb9f1('0x21')]=function(_0x5f0073,_0x49b8c2){if(_0x5f0073[_0xb9f1('0x48')]['id']){delete _0x5f0073['body']['id'];}return db[_0xb9f1('0x2a')][_0xb9f1('0x46')]({'where':{'id':_0x5f0073['params']['id']}})[_0xb9f1('0x22')](handleEntityNotFound(_0x49b8c2,null))['then'](saveUpdates(_0x5f0073['body'],null))[_0xb9f1('0x22')](respondWithResult(_0x49b8c2,null))[_0xb9f1('0x42')](handleError(_0x49b8c2,null));};exports['destroy']=function(_0x5d462e,_0x22d088){return db[_0xb9f1('0x2a')][_0xb9f1('0x46')]({'where':{'id':_0x5d462e['params']['id']}})[_0xb9f1('0x22')](handleEntityNotFound(_0x22d088,null))[_0xb9f1('0x22')](removeEntity(_0x22d088,null))[_0xb9f1('0x42')](handleError(_0x22d088,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e6a07c9..b381aa5 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 _0x50db=['bluebird','request-promise','rimraf','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','moment'];(function(_0x2eaa0d,_0x43c788){var _0x572055=function(_0x57c719){while(--_0x57c719){_0x2eaa0d['push'](_0x2eaa0d['shift']());}};_0x572055(++_0x43c788);}(_0x50db,0x11e));var _0xb50d=function(_0x8f6f7a,_0x53e38b){_0x8f6f7a=_0x8f6f7a-0x0;var _0x2ce96a=_0x50db[_0x8f6f7a];return _0x2ce96a;};'use strict';var _=require('lodash');var util=require(_0xb50d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb50d('0x1'));var BPromise=require(_0xb50d('0x2'));var rp=require(_0xb50d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb50d('0x4'));var config=require('../../config/environment');var attributes=require(_0xb50d('0x5'));module[_0xb50d('0x6')]=function(_0x44ac9d,_0x2b2aa3){return _0x44ac9d[_0xb50d('0x7')](_0xb50d('0x8'),attributes,{'tableName':_0xb50d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb50d('0xa'),'collate':_0xb50d('0xb')});}; \ No newline at end of file +var _0x6028=['path','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6028,0xa2));var _0x8602=function(_0x5d5310,_0x4b7d2c){_0x5d5310=_0x5d5310-0x0;var _0x177094=_0x6028[_0x5d5310];return _0x177094;};'use strict';var _=require(_0x8602('0x0'));var util=require(_0x8602('0x1'));var logger=require(_0x8602('0x2'))(_0x8602('0x3'));var moment=require('moment');var BPromise=require(_0x8602('0x4'));var rp=require(_0x8602('0x5'));var fs=require('fs');var path=require(_0x8602('0x6'));var rimraf=require(_0x8602('0x7'));var config=require('../../config/environment');var attributes=require(_0x8602('0x8'));module['exports']=function(_0x43b727,_0x4be271){return _0x43b727[_0x8602('0x9')](_0x8602('0xa'),attributes,{'tableName':_0x8602('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8602('0xc'),'collate':_0x8602('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index f970d07..dd6ee48 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 _0x7c06=['FaxApplication,\x20%s,\x20%s,\x20%s','error','message','info','catch','update','body','options','attributes','limit','UpdateFaxApplication','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x55c842,_0x90ee02){var _0x2dc2c4=function(_0x5eb36e){while(--_0x5eb36e){_0x55c842['push'](_0x55c842['shift']());}};_0x2dc2c4(++_0x90ee02);}(_0x7c06,0x8e));var _0x67c0=function(_0x1d0a84,_0x5b74c0){_0x1d0a84=_0x1d0a84-0x0;var _0xc51c70=_0x7c06[_0x1d0a84];return _0xc51c70;};'use strict';var _=require('lodash');var util=require(_0x67c0('0x0'));var moment=require(_0x67c0('0x1'));var BPromise=require(_0x67c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67c0('0x4'));var logger=require(_0x67c0('0x5'))('rpc');var config=require(_0x67c0('0x6'));var jayson=require(_0x67c0('0x7'));var client=jayson[_0x67c0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ed4d1,_0x557cc,_0x3654dc){return new BPromise(function(_0x5dec92,_0x13a430){return client[_0x67c0('0x9')](_0x3ed4d1,_0x3654dc)[_0x67c0('0xa')](function(_0x18b521){logger['info'](_0x67c0('0xb'),_0x557cc,_0x67c0('0xc'));logger[_0x67c0('0xd')](_0x67c0('0xe'),_0x557cc,'request\x20sent',JSON['stringify'](_0x18b521));if(_0x18b521[_0x67c0('0xf')]){if(_0x18b521[_0x67c0('0xf')]['code']===0x1f4){logger[_0x67c0('0xf')]('FaxApplication,\x20%s,\x20%s',_0x557cc,_0x18b521[_0x67c0('0xf')][_0x67c0('0x10')]);return _0x13a430(_0x18b521[_0x67c0('0xf')]['message']);}logger[_0x67c0('0xf')](_0x67c0('0xb'),_0x557cc,_0x18b521[_0x67c0('0xf')][_0x67c0('0x10')]);return _0x5dec92(_0x18b521[_0x67c0('0xf')][_0x67c0('0x10')]);}else{logger[_0x67c0('0x11')](_0x67c0('0xb'),_0x557cc,_0x67c0('0xc'));_0x5dec92(_0x18b521['result'][_0x67c0('0x10')]);}})[_0x67c0('0x12')](function(_0x3e42d2){logger[_0x67c0('0xf')](_0x67c0('0xb'),_0x557cc,_0x3e42d2);_0x13a430(_0x3e42d2);});});}exports['UpdateFaxApplication']=function(_0x328a9f){var _0x43d653=this;return new Promise(function(_0x4a42c7,_0x6d8002){return db['FaxApplication'][_0x67c0('0x13')](_0x328a9f[_0x67c0('0x14')],{'raw':_0x328a9f['options']?_0x328a9f[_0x67c0('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x328a9f[_0x67c0('0x15')]?_0x328a9f[_0x67c0('0x15')]['where']||null:null,'attributes':_0x328a9f[_0x67c0('0x15')]?_0x328a9f[_0x67c0('0x15')][_0x67c0('0x16')]||null:null,'limit':_0x328a9f['options']?_0x328a9f[_0x67c0('0x15')][_0x67c0('0x17')]||null:null})[_0x67c0('0xa')](function(_0x201df8){logger[_0x67c0('0x11')]('UpdateFaxApplication',_0x328a9f);logger['debug'](_0x67c0('0x18'),_0x328a9f,JSON[_0x67c0('0x19')](_0x201df8));_0x4a42c7(_0x201df8);})[_0x67c0('0x12')](function(_0x5d0ab2){logger['error'](_0x67c0('0x18'),_0x5d0ab2[_0x67c0('0x10')],_0x328a9f);_0x6d8002(_0x43d653[_0x67c0('0xf')](0x1f4,_0x5d0ab2[_0x67c0('0x10')]));});});}; \ No newline at end of file +var _0xfa11=['where','attributes','stringify','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxApplication','FaxApplication','body','options'];(function(_0x1f48ce,_0x8cf90e){var _0x3c0f88=function(_0x519f10){while(--_0x519f10){_0x1f48ce['push'](_0x1f48ce['shift']());}};_0x3c0f88(++_0x8cf90e);}(_0xfa11,0xba));var _0x1fa1=function(_0x5edf49,_0x4448d1){_0x5edf49=_0x5edf49-0x0;var _0x392b7f=_0xfa11[_0x5edf49];return _0x392b7f;};'use strict';var _=require(_0x1fa1('0x0'));var util=require(_0x1fa1('0x1'));var moment=require(_0x1fa1('0x2'));var BPromise=require(_0x1fa1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1fa1('0x4'));var logger=require(_0x1fa1('0x5'))('rpc');var config=require(_0x1fa1('0x6'));var jayson=require(_0x1fa1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2d05,_0x4f8fc6,_0x30e1fb){return new BPromise(function(_0x3d7212,_0x1ead97){return client[_0x1fa1('0x8')](_0x2a2d05,_0x30e1fb)[_0x1fa1('0x9')](function(_0x492212){logger[_0x1fa1('0xa')](_0x1fa1('0xb'),_0x4f8fc6,_0x1fa1('0xc'));logger[_0x1fa1('0xd')](_0x1fa1('0xe'),_0x4f8fc6,_0x1fa1('0xc'),JSON['stringify'](_0x492212));if(_0x492212['error']){if(_0x492212[_0x1fa1('0xf')][_0x1fa1('0x10')]===0x1f4){logger[_0x1fa1('0xf')](_0x1fa1('0xb'),_0x4f8fc6,_0x492212[_0x1fa1('0xf')]['message']);return _0x1ead97(_0x492212['error'][_0x1fa1('0x11')]);}logger[_0x1fa1('0xf')](_0x1fa1('0xb'),_0x4f8fc6,_0x492212[_0x1fa1('0xf')][_0x1fa1('0x11')]);return _0x3d7212(_0x492212[_0x1fa1('0xf')][_0x1fa1('0x11')]);}else{logger[_0x1fa1('0xa')](_0x1fa1('0xb'),_0x4f8fc6,_0x1fa1('0xc'));_0x3d7212(_0x492212['result'][_0x1fa1('0x11')]);}})['catch'](function(_0x3c5f4f){logger[_0x1fa1('0xf')](_0x1fa1('0xb'),_0x4f8fc6,_0x3c5f4f);_0x1ead97(_0x3c5f4f);});});}exports[_0x1fa1('0x12')]=function(_0xcdfdfd){var _0x39e466=this;return new Promise(function(_0x544c2a,_0x19f4b1){return db[_0x1fa1('0x13')]['update'](_0xcdfdfd[_0x1fa1('0x14')],{'raw':_0xcdfdfd['options']?_0xcdfdfd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcdfdfd[_0x1fa1('0x15')]?_0xcdfdfd['options'][_0x1fa1('0x16')]||null:null,'attributes':_0xcdfdfd['options']?_0xcdfdfd['options'][_0x1fa1('0x17')]||null:null,'limit':_0xcdfdfd[_0x1fa1('0x15')]?_0xcdfdfd['options']['limit']||null:null})['then'](function(_0x51c887){logger[_0x1fa1('0xa')](_0x1fa1('0x12'),_0xcdfdfd);logger[_0x1fa1('0xd')](_0x1fa1('0x12'),_0xcdfdfd,JSON[_0x1fa1('0x18')](_0x51c887));_0x544c2a(_0x51c887);})[_0x1fa1('0x19')](function(_0x112c4b){logger[_0x1fa1('0xf')](_0x1fa1('0x12'),_0x112c4b[_0x1fa1('0x11')],_0xcdfdfd);_0x19f4b1(_0x39e466[_0x1fa1('0xf')](0x1f4,_0x112c4b[_0x1fa1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e3c9579..c9d9143 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 _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xb688,0xcf));var _0x8b68=function(_0x32fed1,_0x2a4e00){_0x32fed1=_0x32fed1-0x0;var _0x278aea=_0xb688[_0x32fed1];return _0x278aea;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x2fa5d0,_0x4391fa){var _0x97a867=function(_0x2f352a){while(--_0x2f352a){_0x2fa5d0['push'](_0x2fa5d0['shift']());}};_0x97a867(++_0x4391fa);}(_0xd4a2,0x173));var _0x2d4a=function(_0x54270e,_0x319845){_0x54270e=_0x54270e-0x0;var _0x556a7d=_0xd4a2[_0x54270e];return _0x556a7d;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 10242f9..9bf9e31 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 _0x0a68=['sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x2f4152,_0x12cca5){var _0x51b471=function(_0x36cbfc){while(--_0x36cbfc){_0x2f4152['push'](_0x2f4152['shift']());}};_0x51b471(++_0x12cca5);}(_0x0a68,0xd2));var _0x80a6=function(_0x2390ec,_0x58fe1d){_0x2390ec=_0x2390ec-0x0;var _0x3a8986=_0x0a68[_0x2390ec];return _0x3a8986;};'use strict';var Sequelize=require(_0x80a6('0x0'));module[_0x80a6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x80a6('0x2')]},'disposition':{'type':Sequelize[_0x80a6('0x3')]},'secondDisposition':{'type':Sequelize[_0x80a6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x80a6('0x3')]},'note':{'type':Sequelize[_0x80a6('0x3')]},'read1stAt':{'type':Sequelize[_0x80a6('0x2')]},'fax':{'type':Sequelize[_0x80a6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x80a6('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x80a6('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x80a6('0x4')]('in',_0x80a6('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf67c=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0xf67c,0x19a));var _0xcf67=function(_0x510c1b,_0x39162f){_0x510c1b=_0x510c1b-0x0;var _0x1e321c=_0xf67c[_0x510c1b];return _0x1e321c;};'use strict';var Sequelize=require(_0xcf67('0x0'));module[_0xcf67('0x1')]={'closed':{'type':Sequelize[_0xcf67('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcf67('0x3')]},'disposition':{'type':Sequelize[_0xcf67('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcf67('0x4')]},'note':{'type':Sequelize[_0xcf67('0x4')]},'read1stAt':{'type':Sequelize[_0xcf67('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xcf67('0x5')]('in',_0xcf67('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcf67('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xcf67('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 3772746..69598f7 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 _0xa5cf=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','DESC','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','spread','Tag','findAll','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','createReadStream','createWriteStream','basename','resolve','log','err','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','catch','index','map','FaxInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','union','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa5cf,0x121));var _0xfa5c=function(_0x551c3a,_0x12b1cc){_0x551c3a=_0x551c3a-0x0;var _0x5a4ba4=_0xa5cf[_0x551c3a];return _0x5a4ba4;};'use strict';var emlformat=require(_0xfa5c('0x0'));var rimraf=require(_0xfa5c('0x1'));var zipdir=require(_0xfa5c('0x2'));var jsonpatch=require(_0xfa5c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfa5c('0x4'));var Mustache=require('mustache');var util=require(_0xfa5c('0x5'));var path=require(_0xfa5c('0x6'));var sox=require(_0xfa5c('0x7'));var csv=require(_0xfa5c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa5c('0x9'));var _=require('lodash');var squel=require(_0xfa5c('0xa'));var crypto=require(_0xfa5c('0xb'));var jsforce=require(_0xfa5c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa5c('0xd'));var Papa=require(_0xfa5c('0xe'));var Redis=require(_0xfa5c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfa5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa5c('0x11'))(_0xfa5c('0x12'));var utils=require(_0xfa5c('0x13'));var config=require(_0xfa5c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa5c('0x15'))['db'];config[_0xfa5c('0x16')]=_['defaults'](config[_0xfa5c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa5c('0x17'))(new Redis(config[_0xfa5c('0x16')]));require(_0xfa5c('0x18'))[_0xfa5c('0x19')](socket);function respondWithStatusCode(_0x3656af,_0x17d6d5){_0x17d6d5=_0x17d6d5||0xcc;return function(_0x5c5da9){if(_0x5c5da9){return _0x3656af['sendStatus'](_0x17d6d5);}return _0x3656af[_0xfa5c('0x1a')](_0x17d6d5)[_0xfa5c('0x1b')]();};}function respondWithResult(_0xf70608,_0x1f4c07){_0x1f4c07=_0x1f4c07||0xc8;return function(_0x42e928){if(_0x42e928){return _0xf70608[_0xfa5c('0x1a')](_0x1f4c07)[_0xfa5c('0x1c')](_0x42e928);}};}function respondWithFilteredResult(_0x21ef54,_0x429a57){return function(_0x5b5312){if(_0x5b5312){var _0x9fff0d=typeof _0x429a57[_0xfa5c('0x1d')]==='undefined'&&typeof _0x429a57[_0xfa5c('0x1e')]===_0xfa5c('0x1f');var _0x49b93b=_0x5b5312[_0xfa5c('0x20')];var _0x4cba84=_0x9fff0d?0x0:_0x429a57['offset'];var _0xaf3c93=_0x9fff0d?_0x5b5312[_0xfa5c('0x20')]:_0x429a57['offset']+_0x429a57['limit'];var _0x5dde62;if(_0xaf3c93>=_0x49b93b){_0xaf3c93=_0x49b93b;_0x5dde62=0xc8;}else{_0x5dde62=0xce;}_0x21ef54[_0xfa5c('0x1a')](_0x5dde62);return _0x21ef54[_0xfa5c('0x21')]('Content-Range',_0x4cba84+'-'+_0xaf3c93+'/'+_0x49b93b)[_0xfa5c('0x1c')](_0x5b5312);}return null;};}function patchUpdates(_0x3f3377){return function(_0x30dc88){try{jsonpatch[_0xfa5c('0x22')](_0x30dc88,_0x3f3377,!![]);}catch(_0x414912){return BPromise[_0xfa5c('0x23')](_0x414912);}return _0x30dc88[_0xfa5c('0x24')]();};}function saveUpdates(_0x12c8fe,_0x32911f){return function(_0x418b97){if(_0x418b97){return _0x418b97[_0xfa5c('0x25')](_0x12c8fe)[_0xfa5c('0x26')](function(_0x58bbe4){return _0x58bbe4;});}return null;};}function removeEntity(_0x457e25,_0x3d806b){return function(_0xa73680){if(_0xa73680){return _0xa73680['destroy']()['then'](function(){_0x457e25[_0xfa5c('0x1a')](0xcc)[_0xfa5c('0x1b')]();});}};}function handleEntityNotFound(_0x1ac107,_0x2b12dc){return function(_0x2d56ca){if(!_0x2d56ca){_0x1ac107[_0xfa5c('0x27')](0x194);}return _0x2d56ca;};}function handleError(_0x1dab25,_0xed3a10){_0xed3a10=_0xed3a10||0x1f4;return function(_0x46b81c){logger[_0xfa5c('0x28')](_0x46b81c[_0xfa5c('0x29')]);if(_0x46b81c[_0xfa5c('0x2a')]){delete _0x46b81c[_0xfa5c('0x2a')];}_0x1dab25['status'](_0xed3a10)[_0xfa5c('0x2b')](_0x46b81c);};}function getInteractionUsers(_0x4a6811,_0x3f3288){return new BPromise(function(_0x4bc74d,_0x76178a){try{if(_0x3f3288[_0x4a6811['id']]){_0x4a6811[_0xfa5c('0x2c')]=_['map'](_0x3f3288[_0x4a6811['id']],function(_0x5319a6){return{'id':_0x5319a6['id'],'fullname':_0x5319a6[_0xfa5c('0x2d')]};});}}catch(_0x2bb516){_0x76178a(_0x2bb516);}_0x4bc74d(_0x4a6811);});}function getInteractionTags(_0x4be7b3,_0x291232){return new BPromise(function(_0x158859,_0x2da707){try{if(_0x4be7b3[_0xfa5c('0x2e')]){_0x4be7b3['Tags']=[];_0x4be7b3[_0xfa5c('0x2e')][_0xfa5c('0x2f')](',')[_0xfa5c('0x30')](function(_0x489c2e){_0x4be7b3[_0xfa5c('0x31')][_0xfa5c('0x32')](_0x291232[_0x489c2e]);});}delete _0x4be7b3['TagIds'];}catch(_0x4c93d2){_0x2da707(_0x4c93d2);}_0x158859(_0x4be7b3);});}function updateFaxInteraction(_0x1a23ee,_0x2cdb63,_0x3426b1){return new BPromise(function(_0xa7ccaf,_0x4d023a){return getInteractionUsers(_0x1a23ee,_0x3426b1)[_0xfa5c('0x26')](function(_0x4de240){return getInteractionTags(_0x4de240,_0x2cdb63);})[_0xfa5c('0x26')](function(_0x109c0d){_0xa7ccaf(_0x109c0d);})[_0xfa5c('0x33')](function(_0xef88d8){_0x4d023a(_0xef88d8);});});}exports[_0xfa5c('0x34')]=function(_0x446d4f,_0x139578){var _0xbca0a1={},_0x465177={},_0x3ec076={'count':0x0,'rows':[]};var _0x287953=_[_0xfa5c('0x35')](db[_0xfa5c('0x36')][_0xfa5c('0x37')],function(_0x59660a){return{'name':_0x59660a['fieldName'],'type':_0x59660a[_0xfa5c('0x38')][_0xfa5c('0x39')]};});_0x465177[_0xfa5c('0x3a')]=_[_0xfa5c('0x35')](_0x287953,_0xfa5c('0x2a'));_0x465177[_0xfa5c('0x3b')]=_[_0xfa5c('0x3c')](_0x446d4f[_0xfa5c('0x3b')]);_0x465177['filters']=_[_0xfa5c('0x3d')](_0x465177[_0xfa5c('0x3a')],_0x465177[_0xfa5c('0x3b')]);_0xbca0a1[_0xfa5c('0x3e')]=_['intersection'](_0x465177[_0xfa5c('0x3a')],qs[_0xfa5c('0x3f')](_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x3f')]));_0xbca0a1[_0xfa5c('0x3e')]=_0xbca0a1[_0xfa5c('0x3e')][_0xfa5c('0x40')]?_0xbca0a1[_0xfa5c('0x3e')]:_0x465177['model'];if(!_0x446d4f[_0xfa5c('0x3b')]['hasOwnProperty'](_0xfa5c('0x41'))){_0xbca0a1[_0xfa5c('0x1e')]=qs[_0xfa5c('0x1e')](_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x1e')]);_0xbca0a1[_0xfa5c('0x1d')]=qs[_0xfa5c('0x1d')](_0x446d4f['query'][_0xfa5c('0x1d')]);}_0xbca0a1[_0xfa5c('0x42')]=qs[_0xfa5c('0x43')](_0x446d4f[_0xfa5c('0x3b')]['sort']);_0xbca0a1[_0xfa5c('0x44')]=qs[_0xfa5c('0x45')](_['pick'](_0x446d4f[_0xfa5c('0x3b')],_0x465177[_0xfa5c('0x45')]),_0x287953);var _0x376ed6=[];var _0x24639c=squel[_0xfa5c('0x46')]()[_0xfa5c('0x47')]('id')[_0xfa5c('0x47')](_0xfa5c('0x2a'))['field'](_0xfa5c('0x48'))[_0xfa5c('0x49')](_0xfa5c('0x4a'));var _0x5d60d0=squel[_0xfa5c('0x46')]()[_0xfa5c('0x47')](_0xfa5c('0x4b'))[_0xfa5c('0x47')](_0xfa5c('0x4c'))[_0xfa5c('0x47')](_0xfa5c('0x4d'))[_0xfa5c('0x49')]('user_has_fax_interactions','ui')[_0xfa5c('0x4e')](_0xfa5c('0x4f'),'u',_0xfa5c('0x50'));var _0x4b3464=squel[_0xfa5c('0x46')]()[_0xfa5c('0x49')](_0xfa5c('0x51'),'i')[_0xfa5c('0x4e')](_0xfa5c('0x52'),'c',_0xfa5c('0x53'))[_0xfa5c('0x4e')](_0xfa5c('0x4f'),'o','o.id\x20=\x20i.UserId')[_0xfa5c('0x4e')](_0xfa5c('0x54'),'a',_0xfa5c('0x55'))[_0xfa5c('0x4e')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0xfa5c('0x4e')](_0xfa5c('0x56'),'it',_0xfa5c('0x57'))[_0xfa5c('0x4e')](_0xfa5c('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x12a563=squel[_0xfa5c('0x58')]();var _0x2eeab8=[];var _0x30537f=squel[_0xfa5c('0x58')]();var _0x341b28;if(_0x446d4f['query'][_0xfa5c('0x59')]){_0x341b28=as[_0xfa5c('0x5a')](_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x59')]);var _0x4906f7=_0x341b28['sqlOperator'];for(var _0x122828=0x0;_0x122828<_0x341b28[_0xfa5c('0x5b')][_0xfa5c('0x40')];_0x122828++){var _0x37cd84=_0x341b28[_0xfa5c('0x5b')][_0x122828];var _0x3ce050='i';var _0x440574=_['find'](_0x287953,['name',_0x37cd84[_0xfa5c('0x47')]]);if(!_0x440574){switch(_0x37cd84[_0xfa5c('0x47')]){case _0xfa5c('0x5c'):if(_0x37cd84[_0xfa5c('0x5d')]==0x1){_0x4b3464[_0xfa5c('0x5e')]('`'+_0x37cd84[_0xfa5c('0x47')]+_0xfa5c('0x5f'));}else{_0x4b3464[_0xfa5c('0x5e')]('`'+_0x37cd84[_0xfa5c('0x47')]+_0xfa5c('0x60'));}break;case _0xfa5c('0x61'):if(_0x37cd84[_0xfa5c('0x62')]===_0xfa5c('0x63')){if(_0x37cd84[_0xfa5c('0x5d')][_0xfa5c('0x2f')]('\x20')[_0xfa5c('0x40')]>0x1){_0x12a563[_0x4906f7](_0xfa5c('0x64'),qs['getFullTextValue'](_0x37cd84[_0xfa5c('0x5d')]),null);}else{var _0x5322d5='%'+_0x37cd84['value']+'%';_0x12a563[_0x4906f7](_0xfa5c('0x65'),_0x5322d5,_0x5322d5,_0x5322d5);}}else{_0x440574=_[_0xfa5c('0x66')](_0x287953,[_0xfa5c('0x2a'),_0xfa5c('0x67')]);_0x37cd84[_0xfa5c('0x47')]='ContactId';_0x17ff30=as[_0xfa5c('0x68')](_0x3ce050,_0x440574[_0xfa5c('0x38')],_0x37cd84);_0x12a563[_0x4906f7](_0x17ff30[_0xfa5c('0x69')],_0x17ff30[_0xfa5c('0x5d')][_0xfa5c('0x6a')],_0x17ff30[_0xfa5c('0x5d')]['end']);}break;case'Tag':var _0x4539be=_0x37cd84['value']['split'](',')[_0xfa5c('0x35')](function(_0x1e8e0f){return Number(_0x1e8e0f);});_0x4539be['forEach'](function(_0x3378dc){_0x30537f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3378dc+',%');});_0x2eeab8=_[_0xfa5c('0x6b')](_0x2eeab8,_0x4539be);break;case'User':if(_0x37cd84[_0xfa5c('0x62')]===_0xfa5c('0x63')){_0x12a563[_0x4906f7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x37cd84['value']+'%',null);}else{_0x440574=_[_0xfa5c('0x66')](_0x287953,[_0xfa5c('0x2a'),_0xfa5c('0x6c')]);_0x37cd84[_0xfa5c('0x47')]=_0xfa5c('0x6c');_0x17ff30=as[_0xfa5c('0x68')](_0x3ce050,_0x440574[_0xfa5c('0x38')],_0x37cd84);_0x12a563[_0x4906f7](_0x17ff30[_0xfa5c('0x69')],_0x17ff30['value'][_0xfa5c('0x6a')],_0x17ff30[_0xfa5c('0x5d')][_0xfa5c('0x1b')]);}break;case _0xfa5c('0x6d'):_0x17ff30=as[_0xfa5c('0x68')]('me',null,_0x37cd84);_0x12a563[_0x4906f7](_0x17ff30[_0xfa5c('0x69')],_0x17ff30[_0xfa5c('0x5d')][_0xfa5c('0x6a')],_0x17ff30['value'][_0xfa5c('0x1b')]);break;}}else{var _0x17ff30=as[_0xfa5c('0x68')](_0x3ce050,_0x440574['type'],_0x37cd84);_0x12a563[_0x4906f7](_0x17ff30[_0xfa5c('0x69')],_0x17ff30[_0xfa5c('0x5d')][_0xfa5c('0x6a')],_0x17ff30['value'][_0xfa5c('0x1b')]);}}}else{var _0x54e425=_(_0x446d4f['query'])[_0xfa5c('0x3c')]()['map'](function(_0x5b76a6){return _[_0xfa5c('0x6e')](_0x287953,[_0xfa5c('0x2a'),_0x5b76a6])?_0x5b76a6:undefined;})[_0xfa5c('0x6f')]()['value']();if(!_[_0xfa5c('0x70')](_0x54e425)){_0x54e425['forEach'](function(_0x4932ec){if(_0x4932ec===_0xfa5c('0x71')){_0x4b3464['where'](_0xfa5c('0x72'),[][_0xfa5c('0x73')](_0x446d4f[_0xfa5c('0x3b')][_0x4932ec]));}else if(_0x4932ec===_0xfa5c('0x74')){var _0x1f57fa=JSON[_0xfa5c('0x75')](_0x446d4f[_0xfa5c('0x3b')][_0x4932ec])[_0xfa5c('0x76')];var _0x95a3da=JSON[_0xfa5c('0x75')](_0x446d4f['query'][_0x4932ec])[_0xfa5c('0x77')];_0x4b3464[_0xfa5c('0x44')](_0xfa5c('0x78'),_0x1f57fa,_0x95a3da);}else{if(_0x446d4f[_0xfa5c('0x3b')][_0x4932ec]==='null'){_0x4b3464[_0xfa5c('0x44')]('i.'+_0x4932ec+_0xfa5c('0x79'));}else{_0x4b3464[_0xfa5c('0x44')]('i.'+_0x4932ec+'\x20=\x20?',_0x446d4f[_0xfa5c('0x3b')][_0x4932ec]);}}});}if(_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x7a')]){if(_0x446d4f['query']['read']==0x1){_0x4b3464[_0xfa5c('0x5e')](_0xfa5c('0x7b'));}else{_0x4b3464[_0xfa5c('0x5e')](_0xfa5c('0x7c'));}}if(_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x7d')]){_0x2eeab8=_[_0xfa5c('0x7e')](_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x7d')])?_0x446d4f[_0xfa5c('0x3b')]['tag']:new Array(_0x446d4f['query']['tag']);_0x2eeab8[_0xfa5c('0x30')](function(_0x3915c7){_0x30537f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3915c7+',%');});}if(_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x7f')]){var _0x21f34d=_0x446d4f[_0xfa5c('0x3b')]['filter'][_0xfa5c('0x80')]('\x5c','\x5c\x5c')[_0xfa5c('0x80')](/'/g,'\x27\x27');if(qs[_0xfa5c('0x81')](_0x21f34d)){_0x12a563['or']('i.id\x20LIKE\x20?',_0x21f34d+'%')['or'](_0xfa5c('0x82'),_0x21f34d+'%');}_0x12a563['or'](_0xfa5c('0x83'),_0x21f34d+'%');}}_0x4b3464[_0xfa5c('0x44')](_0x12a563);_0x4b3464[_0xfa5c('0x84')](_0xfa5c('0x85'));var _0x4bc18d={'type':db[_0xfa5c('0x86')][_0xfa5c('0x87')][_0xfa5c('0x88')],'raw':!![]};var _0x13919b=_0x4b3464['clone']();_0x13919b['field']('i.id');_0x13919b[_0xfa5c('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfa5c('0x5c'));if(_0xbca0a1[_0xfa5c('0x42')]){_0xbca0a1[_0xfa5c('0x42')][_0xfa5c('0x30')](function(_0x8a4d2d){var _0x115bac=_0x8a4d2d[0x0]==='contactName'?_0x8a4d2d[0x0]:'i.'+_0x8a4d2d[0x0];_0x4b3464['order'](_0x115bac,_0x8a4d2d[0x1]===_0xfa5c('0x89')?![]:!![]);});}if(!_[_0xfa5c('0x70')](_0x2eeab8)){_0x4b3464[_0xfa5c('0x5e')](_0x30537f);_0x13919b[_0xfa5c('0x44')]('t.id\x20IN\x20?',_0x2eeab8);}BPromise['resolve']()[_0xfa5c('0x26')](function(){if(!_0x341b28){if(_0x446d4f['query'][_0xfa5c('0x71')])return;_0x13919b[_0xfa5c('0x44')](_0xfa5c('0x8a'));_0x4b3464['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x446d4f[_0xfa5c('0x8b')][_0xfa5c('0x8c')]!==_0xfa5c('0x8d'))return;return _0x446d4f[_0xfa5c('0x8b')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xfa5c('0x26')](function(_0x3e9c21){if(_['isEmpty'](_0x3e9c21)){_0x13919b[_0xfa5c('0x44')](_0xfa5c('0x8e'));_0x4b3464[_0xfa5c('0x44')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x13919b[_0xfa5c('0x44')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x3e9c21,'id'));_0x4b3464[_0xfa5c('0x44')](_0xfa5c('0x72'),_[_0xfa5c('0x35')](_0x3e9c21,'id'));}});})[_0xfa5c('0x26')](function(){if(_0x446d4f[_0xfa5c('0x8b')][_0xfa5c('0x8c')]===_0xfa5c('0x8d')&&!_0x341b28&&!_0x446d4f[_0xfa5c('0x3b')]['FaxAccountId'])return[];return db['sequelize'][_0xfa5c('0x3b')](_0x13919b['toString'](),_0x4bc18d);})[_0xfa5c('0x26')](function(_0x4c492c){_0x3ec076['count']=_0x4c492c[_0xfa5c('0x40')];if(_0x3ec076[_0xfa5c('0x20')]===0x0)return[];return db[_0xfa5c('0x8f')][_0xfa5c('0x3b')](_0x24639c[_0xfa5c('0x90')](),_0x4bc18d)[_0xfa5c('0x26')](function(_0xc22452){_0x376ed6=_['keyBy'](_0xc22452,'id');_0x4bc18d=_[_0xfa5c('0x91')](_0x4bc18d,{'model':db[_0xfa5c('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x446d4f[_0xfa5c('0x3b')][_0xfa5c('0x3f')]){_0xbca0a1[_0xfa5c('0x3e')][_0xfa5c('0x30')](function(_0x70aa45){_0x4b3464[_0xfa5c('0x47')]('i.'+_0x70aa45);});}else{_0x4b3464[_0xfa5c('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4b3464[_0xfa5c('0x47')]('a.key',_0xfa5c('0x92'));_0x4b3464['field'](_0xfa5c('0x93'),_0xfa5c('0x94'));_0x4b3464[_0xfa5c('0x47')](_0xfa5c('0x95'),_0xfa5c('0x96'));_0x4b3464[_0xfa5c('0x47')](_0xfa5c('0x97'));_0x4b3464[_0xfa5c('0x47')](_0xfa5c('0x98'),_0xfa5c('0x99'));_0x4b3464[_0xfa5c('0x47')](_0xfa5c('0x9a'),_0xfa5c('0x9b'));_0x4b3464[_0xfa5c('0x47')]('c.email',_0xfa5c('0x9c'));_0x4b3464['field'](_0xfa5c('0x9d'),_0xfa5c('0x9e'));_0x4b3464[_0xfa5c('0x47')]('c.mobile',_0xfa5c('0x9f'));_0x4b3464['field'](_0xfa5c('0xa0'),_0xfa5c('0xa1'));_0x4b3464['field'](_0xfa5c('0xa2'),_0xfa5c('0xa3'));_0x4b3464['field'](_0xfa5c('0xa4'),'Owner.internal');_0x4b3464[_0xfa5c('0x47')](_0xfa5c('0xa5'),_0xfa5c('0x2e'));}if(_0xbca0a1[_0xfa5c('0x1e')])_0x4b3464[_0xfa5c('0x1e')](_0xbca0a1[_0xfa5c('0x1e')]);if(_0xbca0a1['offset'])_0x4b3464['offset'](_0xbca0a1[_0xfa5c('0x1d')]);return db[_0xfa5c('0x8f')][_0xfa5c('0x3b')](_0x4b3464[_0xfa5c('0x90')](),_0x4bc18d);})[_0xfa5c('0x26')](function(_0x50caf7){if(_0x50caf7[_0xfa5c('0x40')]>0x0)_0x5d60d0['where'](_0xfa5c('0xa6'),_[_0xfa5c('0x35')](_0x50caf7,'id'));return db[_0xfa5c('0x8f')]['query'](_0x5d60d0[_0xfa5c('0x90')](),_0x4bc18d)[_0xfa5c('0x26')](function(_0x4b088f){var _0x3e31d2=_[_0xfa5c('0xa7')](_0x4b088f,_0xfa5c('0xa8'));var _0x362dc5=[];_0x50caf7[_0xfa5c('0x30')](function(_0x45de49){_0x362dc5[_0xfa5c('0x32')](updateFaxInteraction(_0x45de49,_0x376ed6,_0x3e31d2));});return BPromise['all'](_0x362dc5);});});})[_0xfa5c('0x26')](function(_0x135ca2){_0x3ec076[_0xfa5c('0xa9')]=_0x135ca2;return _0x3ec076;})[_0xfa5c('0x26')](respondWithFilteredResult(_0x139578,_0xbca0a1))['catch'](handleError(_0x139578,null));};exports[_0xfa5c('0xaa')]=function(_0x5b9663,_0x53033f){var _0x24bb4b={'raw':![],'where':{'id':_0x5b9663[_0xfa5c('0xab')]['id']}},_0x55bc03={};_0x55bc03[_0xfa5c('0x3a')]=_['keys'](db[_0xfa5c('0x36')]['rawAttributes']);_0x55bc03['query']=_[_0xfa5c('0x3c')](_0x5b9663[_0xfa5c('0x3b')]);_0x55bc03[_0xfa5c('0x45')]=_[_0xfa5c('0x3d')](_0x55bc03['model'],_0x55bc03[_0xfa5c('0x3b')]);_0x24bb4b[_0xfa5c('0x3e')]=_[_0xfa5c('0x3d')](_0x55bc03[_0xfa5c('0x3a')],qs['fields'](_0x5b9663['query']['fields']));_0x24bb4b[_0xfa5c('0x3e')]=_0x24bb4b[_0xfa5c('0x3e')][_0xfa5c('0x40')]?_0x24bb4b[_0xfa5c('0x3e')]:_0x55bc03[_0xfa5c('0x3a')];if(_0x5b9663[_0xfa5c('0x3b')]['includeAll']){_0x24bb4b[_0xfa5c('0xac')]=[{'all':!![]}];}_0x24bb4b=_[_0xfa5c('0x91')]({},_0x24bb4b,_0x5b9663[_0xfa5c('0xad')]);return db[_0xfa5c('0x36')][_0xfa5c('0x66')](_0x24bb4b)['then'](handleEntityNotFound(_0x53033f,null))[_0xfa5c('0x26')](respondWithResult(_0x53033f,null))[_0xfa5c('0x33')](handleError(_0x53033f,null));};exports[_0xfa5c('0xae')]=function(_0xd664ab,_0x39f7c7){return db[_0xfa5c('0x36')][_0xfa5c('0xae')](_0xd664ab[_0xfa5c('0x6d')],{})['then'](respondWithResult(_0x39f7c7,0xc9))[_0xfa5c('0x33')](handleError(_0x39f7c7,null));};exports[_0xfa5c('0x25')]=function(_0x2c8a90,_0x3053bd){if(_0x2c8a90[_0xfa5c('0x6d')]['id']){delete _0x2c8a90[_0xfa5c('0x6d')]['id'];}return db[_0xfa5c('0x36')][_0xfa5c('0x66')]({'where':{'id':_0x2c8a90[_0xfa5c('0xab')]['id']}})[_0xfa5c('0x26')](handleEntityNotFound(_0x3053bd,null))[_0xfa5c('0x26')](saveUpdates(_0x2c8a90[_0xfa5c('0x6d')],null))[_0xfa5c('0x26')](respondWithResult(_0x3053bd,null))[_0xfa5c('0x33')](handleError(_0x3053bd,null));};exports[_0xfa5c('0xaf')]=function(_0x136777,_0xfb3d01){return db['FaxInteraction'][_0xfa5c('0x66')]({'where':{'id':_0x136777[_0xfa5c('0xab')]['id']}})['then'](handleEntityNotFound(_0xfb3d01,null))['then'](removeEntity(_0xfb3d01,null))[_0xfa5c('0x33')](handleError(_0xfb3d01,null));};exports[_0xfa5c('0xb0')]=function(_0x38ef8a,_0x13a4e4){return db[_0xfa5c('0x36')][_0xfa5c('0xb0')]()[_0xfa5c('0x26')](respondWithResult(_0x13a4e4,null))['catch'](handleError(_0x13a4e4,null));};exports[_0xfa5c('0xb1')]=function(_0x5e99b1,_0x590177,_0x4e1ea2){return db[_0xfa5c('0xb2')][_0xfa5c('0x66')]({'where':{'id':_0x5e99b1['params']['id']}})['then'](handleEntityNotFound(_0x590177,null))[_0xfa5c('0x26')](function(_0x992292){if(_0x992292){return _0x992292[_0xfa5c('0xb1')](_0x5e99b1[_0xfa5c('0x6d')][_0xfa5c('0xb3')],_[_0xfa5c('0xb4')](_0x5e99b1[_0xfa5c('0x6d')],[_0xfa5c('0xb3'),'id'])||{});}})[_0xfa5c('0x26')](respondWithResult(_0x590177,null))[_0xfa5c('0x33')](handleError(_0x590177,null));};exports['getMessages']=function(_0x52b8b7,_0x3636cc,_0x51a513){var _0x424738={'raw':![],'where':{}};var _0x426397={};var _0x422001={'count':0x0,'rows':[]};return db[_0xfa5c('0x36')]['findOne']({'where':{'id':_0x52b8b7['params']['id']}})[_0xfa5c('0x26')](handleEntityNotFound(_0x3636cc,null))[_0xfa5c('0x26')](function(_0x56167e){if(_0x56167e){_0x426397['model']=_[_0xfa5c('0x3c')](db[_0xfa5c('0xb2')][_0xfa5c('0x37')]);_0x426397[_0xfa5c('0x3b')]=_[_0xfa5c('0x3c')](_0x52b8b7[_0xfa5c('0x3b')]);_0x426397[_0xfa5c('0x45')]=_[_0xfa5c('0x3d')](_0x426397[_0xfa5c('0x3a')],_0x426397[_0xfa5c('0x3b')]);_0x424738[_0xfa5c('0x3e')]=_['intersection'](_0x426397[_0xfa5c('0x3a')],qs[_0xfa5c('0x3f')](_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0x3f')]));_0x424738['attributes']=_0x424738[_0xfa5c('0x3e')][_0xfa5c('0x40')]?_0x424738[_0xfa5c('0x3e')]:_0x426397[_0xfa5c('0x3a')];if(!_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0xb5')](_0xfa5c('0x41'))){_0x424738[_0xfa5c('0x1e')]=qs[_0xfa5c('0x1e')](_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0x1e')]);_0x424738[_0xfa5c('0x1d')]=qs[_0xfa5c('0x1d')](_0x52b8b7['query']['offset']);}_0x424738[_0xfa5c('0x42')]=qs['sort'](_0x52b8b7['query'][_0xfa5c('0x43')]);_0x424738['where']=qs['filters'](_[_0xfa5c('0xb6')](_0x52b8b7[_0xfa5c('0x3b')],_0x426397['filters']));_0x424738[_0xfa5c('0x44')][_0xfa5c('0xa8')]=_0x56167e['id'];if(_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0x7f')]){_0x424738[_0xfa5c('0x44')]=_[_0xfa5c('0x91')](_0x424738['where'],{'$or':_[_0xfa5c('0x35')](_0x424738[_0xfa5c('0x3e')],function(_0x26db00){var _0x49c803={};_0x49c803[_0x26db00]={'$like':'%'+_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0x7f')]+'%'};return _0x49c803;})});}if(_0x52b8b7['query'][_0xfa5c('0x76')]){var _0x56e5f8=_0x52b8b7['query'][_0xfa5c('0x76')][_0xfa5c('0x2f')](',');var _0x203d8e={};_0x203d8e[_0x56e5f8[0x0]]={'$gte':moment(_0x56e5f8[0x1])[_0xfa5c('0xb7')](_0xfa5c('0xb8'))};_0x424738['where']=_[_0xfa5c('0x91')](_0x424738[_0xfa5c('0x44')],_0x203d8e);}_0x424738=_[_0xfa5c('0x91')]({},_0x424738,_0x52b8b7[_0xfa5c('0xad')]);return db[_0xfa5c('0xb2')][_0xfa5c('0x20')]({'where':_0x424738['where']})[_0xfa5c('0x26')](function(_0x2bc99b){_0x422001[_0xfa5c('0x20')]=_0x2bc99b;if(_0x52b8b7[_0xfa5c('0x3b')][_0xfa5c('0xb9')]){_0x424738[_0xfa5c('0xac')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x424738);})[_0xfa5c('0x26')](function(_0x4b05d2){_0x422001[_0xfa5c('0xa9')]=_0x4b05d2;return _0x422001;});}})['then'](respondWithFilteredResult(_0x3636cc,_0x424738))[_0xfa5c('0x33')](handleError(_0x3636cc,null));};exports[_0xfa5c('0xba')]=function(_0x476c33,_0x5ceadd,_0xba5826){return db['FaxInteraction']['find']({'where':{'id':_0x476c33[_0xfa5c('0xab')]['id']}})[_0xfa5c('0x26')](handleEntityNotFound(_0x5ceadd,null))[_0xfa5c('0x26')](function(_0x2cadfb){if(_0x2cadfb){return _0x2cadfb['setTags'](_0x476c33[_0xfa5c('0x6d')]['ids'],_['omit'](_0x476c33['body'],[_0xfa5c('0xb3'),'id'])||{})[_0xfa5c('0xbb')](function(){return db[_0xfa5c('0xbc')][_0xfa5c('0xbd')]({'attributes':['id',_0xfa5c('0x2a'),_0xfa5c('0x48')],'where':{'id':_0x476c33['body']['ids']}});})[_0xfa5c('0x26')](function(_0x120f76){socket['emit']('faxInteractionTags:save',{'id':Number(_0x476c33[_0xfa5c('0xab')]['id']),'tags':_0x120f76||[]});return{'id':Number(_0x476c33['params']['id']),'tags':_0x120f76||[]};});}})['then'](respondWithResult(_0x5ceadd,null))[_0xfa5c('0x33')](handleError(_0x5ceadd,null));};exports[_0xfa5c('0xbe')]=function(_0x42e8cc,_0x8496a1,_0x276131){return db[_0xfa5c('0x36')][_0xfa5c('0x66')]({'where':{'id':_0x42e8cc[_0xfa5c('0xab')]['id']}})['then'](handleEntityNotFound(_0x8496a1,null))['then'](function(_0x9f169e){if(_0x9f169e){return _0x9f169e[_0xfa5c('0xbe')](_0x42e8cc[_0xfa5c('0x3b')][_0xfa5c('0xb3')]);}})['then'](respondWithStatusCode(_0x8496a1,null))[_0xfa5c('0x33')](handleError(_0x8496a1,null));};exports[_0xfa5c('0xbf')]=function(_0xa0e214,_0x46b4b8){var _0x892d34=moment()[_0xfa5c('0xc0')]()['toString']();var _0x4c3acf=path[_0xfa5c('0xc1')](config[_0xfa5c('0xc2')],_0xfa5c('0xc3'),_0xfa5c('0xc4'),_0xfa5c('0xc5'));var _0x1d210b=path[_0xfa5c('0xc1')](config[_0xfa5c('0xc2')],_0xfa5c('0xc3'),_0xfa5c('0xc4'),_0xfa5c('0xc6'));var _0x571757=path[_0xfa5c('0xc1')](_0x4c3acf,_0x892d34);var _0x3b8b4d=util[_0xfa5c('0xb7')](_0xfa5c('0xc7'),_0xa0e214[_0xfa5c('0xab')]['id'],_0x892d34);var _0x4dd41f=path[_0xfa5c('0xc1')](_0x4c3acf,_0x3b8b4d);var _0x2cca16=[];_0x2cca16[_0xfa5c('0x32')]({'model':db[_0xfa5c('0xc8')],'as':'Attachment','raw':!![]});var _0xb4691a=[{'model':db[_0xfa5c('0xb2')],'as':_0xfa5c('0xc9'),'attributes':['id',_0xfa5c('0x6d'),_0xfa5c('0x74')],'include':_0x2cca16}];return db[_0xfa5c('0x36')][_0xfa5c('0x66')]({'where':{'id':_0xa0e214[_0xfa5c('0xab')]['id']},'include':_0xb4691a})[_0xfa5c('0x26')](handleEntityNotFound(_0x46b4b8,null))[_0xfa5c('0x26')](function(_0x2550b7){if(_0x2550b7&&_0x2550b7[_0xfa5c('0xc9')]){var _0x23ef78=_0x2550b7[_0xfa5c('0xca')]({'plain':!![]});fs[_0xfa5c('0xcb')](_0x571757);for(var _0x161a6c=0x0;_0x161a6c<_0x23ef78[_0xfa5c('0xc9')][_0xfa5c('0x40')];_0x161a6c++){var _0x134eba=_0x23ef78[_0xfa5c('0xc9')][_0x161a6c][_0xfa5c('0xc8')];if(_0x134eba){var _0x1ce69d=path[_0xfa5c('0xc1')](_0x1d210b,_0x134eba['basename']);if(fs['existsSync'](_0x1ce69d)){fs[_0xfa5c('0xcc')](_0x1ce69d)['pipe'](fs[_0xfa5c('0xcd')](path['join'](_0x571757,_0x134eba[_0xfa5c('0xce')])));}}}return BPromise[_0xfa5c('0xcf')]()[_0xfa5c('0x26')](function(){return new BPromise(function(_0x21d135,_0x518e94){zipdir(_0x571757,{'saveTo':_0x4dd41f},function(_0x1c5164,_0x3dbdeb){if(_0x1c5164)return _0x518e94(_0x1c5164);return _0x21d135(_0x3dbdeb);});})[_0xfa5c('0x26')](function(){return new BPromise(function(_0x1be33c,_0x3b1127){rimraf(_0x571757,function(_0x52fea1){if(_0x52fea1)_0x3b1127(_0x52fea1);return _0x1be33c();});});})[_0xfa5c('0x26')](function(){return _0x46b4b8[_0xfa5c('0xbf')](_0x4dd41f,_0x3b8b4d,function(_0x314590){if(_0x314590){console[_0xfa5c('0xd0')](_0xfa5c('0xd1'),_0x314590);}else{fs['unlinkSync'](_0x4dd41f);}});});});}else{return _0x46b4b8[_0xfa5c('0x27')](0xc8);}})[_0xfa5c('0x33')](handleError(_0x46b4b8,null));}; \ No newline at end of file +var _0x2c1b=['describe','FaxMessage','addMessage','ids','omit','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','Messages','mkdirSync','basename','createReadStream','createWriteStream','log','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','Users','TagIds','Tags','split','push','catch','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','length','toString','keyBy','merge','FaxInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','body','update'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x2c1b,0x1c7));var _0xb2c1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x2c1b[_0x35da42];return _0x370035;};'use strict';var emlformat=require(_0xb2c1('0x0'));var rimraf=require(_0xb2c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2c1('0x2'));var rp=require(_0xb2c1('0x3'));var moment=require(_0xb2c1('0x4'));var BPromise=require(_0xb2c1('0x5'));var Mustache=require(_0xb2c1('0x6'));var util=require(_0xb2c1('0x7'));var path=require('path');var sox=require(_0xb2c1('0x8'));var csv=require(_0xb2c1('0x9'));var ejs=require(_0xb2c1('0xa'));var fs=require('fs');var fs_extra=require(_0xb2c1('0xb'));var _=require(_0xb2c1('0xc'));var squel=require(_0xb2c1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb2c1('0xe'));var deskjs=require(_0xb2c1('0xf'));var toCsv=require(_0xb2c1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb2c1('0x10'));var authService=require(_0xb2c1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb2c1('0x12'));var logger=require(_0xb2c1('0x13'))(_0xb2c1('0x14'));var utils=require(_0xb2c1('0x15'));var config=require(_0xb2c1('0x16'));var licenseUtil=require(_0xb2c1('0x17'));var db=require(_0xb2c1('0x18'))['db'];config[_0xb2c1('0x19')]=_['defaults'](config[_0xb2c1('0x19')],{'host':_0xb2c1('0x1a'),'port':0x18eb});var socket=require(_0xb2c1('0x1b'))(new Redis(config[_0xb2c1('0x19')]));require(_0xb2c1('0x1c'))['register'](socket);function respondWithStatusCode(_0x2648f5,_0x5d5285){_0x5d5285=_0x5d5285||0xcc;return function(_0x3b44dd){if(_0x3b44dd){return _0x2648f5['sendStatus'](_0x5d5285);}return _0x2648f5[_0xb2c1('0x1d')](_0x5d5285)[_0xb2c1('0x1e')]();};}function respondWithResult(_0x5c74e5,_0x1f1590){_0x1f1590=_0x1f1590||0xc8;return function(_0xb353e9){if(_0xb353e9){return _0x5c74e5[_0xb2c1('0x1d')](_0x1f1590)['json'](_0xb353e9);}};}function respondWithFilteredResult(_0x4f6729,_0x2cc1fe){return function(_0x4fcf79){if(_0x4fcf79){var _0x595ca1=typeof _0x2cc1fe[_0xb2c1('0x1f')]===_0xb2c1('0x20')&&typeof _0x2cc1fe[_0xb2c1('0x21')]===_0xb2c1('0x20');var _0x4a97fe=_0x4fcf79['count'];var _0xe45fff=_0x595ca1?0x0:_0x2cc1fe[_0xb2c1('0x1f')];var _0x330d0c=_0x595ca1?_0x4fcf79[_0xb2c1('0x22')]:_0x2cc1fe[_0xb2c1('0x1f')]+_0x2cc1fe['limit'];var _0x1ffb84;if(_0x330d0c>=_0x4a97fe){_0x330d0c=_0x4a97fe;_0x1ffb84=0xc8;}else{_0x1ffb84=0xce;}_0x4f6729[_0xb2c1('0x1d')](_0x1ffb84);return _0x4f6729[_0xb2c1('0x23')](_0xb2c1('0x24'),_0xe45fff+'-'+_0x330d0c+'/'+_0x4a97fe)[_0xb2c1('0x25')](_0x4fcf79);}return null;};}function patchUpdates(_0x45393c){return function(_0x481d04){try{jsonpatch[_0xb2c1('0x26')](_0x481d04,_0x45393c,!![]);}catch(_0x44ecd8){return BPromise[_0xb2c1('0x27')](_0x44ecd8);}return _0x481d04['save']();};}function saveUpdates(_0x4ab942,_0xc3fc1f){return function(_0x475d4e){if(_0x475d4e){return _0x475d4e['update'](_0x4ab942)[_0xb2c1('0x28')](function(_0x2ec97d){return _0x2ec97d;});}return null;};}function removeEntity(_0x10ad71,_0x115383){return function(_0x43f6e9){if(_0x43f6e9){return _0x43f6e9[_0xb2c1('0x29')]()[_0xb2c1('0x28')](function(){_0x10ad71[_0xb2c1('0x1d')](0xcc)[_0xb2c1('0x1e')]();});}};}function handleEntityNotFound(_0x5583d5,_0x2cee42){return function(_0x121d8f){if(!_0x121d8f){_0x5583d5[_0xb2c1('0x2a')](0x194);}return _0x121d8f;};}function handleError(_0x1075ee,_0x41fe6f){_0x41fe6f=_0x41fe6f||0x1f4;return function(_0x4c0119){logger[_0xb2c1('0x2b')](_0x4c0119[_0xb2c1('0x2c')]);if(_0x4c0119['name']){delete _0x4c0119[_0xb2c1('0x2d')];}_0x1075ee['status'](_0x41fe6f)[_0xb2c1('0x2e')](_0x4c0119);};}function getInteractionUsers(_0x5e50fc,_0x82a630){return new BPromise(function(_0x5d9ca0,_0x2a9ee1){try{if(_0x82a630[_0x5e50fc['id']]){_0x5e50fc[_0xb2c1('0x2f')]=_['map'](_0x82a630[_0x5e50fc['id']],function(_0x33161c){return{'id':_0x33161c['id'],'fullname':_0x33161c['fullname']};});}}catch(_0x2b8c19){_0x2a9ee1(_0x2b8c19);}_0x5d9ca0(_0x5e50fc);});}function getInteractionTags(_0x506428,_0x36e7d2){return new BPromise(function(_0x3e2e6d,_0x4e4edb){try{if(_0x506428[_0xb2c1('0x30')]){_0x506428[_0xb2c1('0x31')]=[];_0x506428[_0xb2c1('0x30')][_0xb2c1('0x32')](',')['forEach'](function(_0x2fab86){_0x506428['Tags'][_0xb2c1('0x33')](_0x36e7d2[_0x2fab86]);});}delete _0x506428[_0xb2c1('0x30')];}catch(_0x2342b8){_0x4e4edb(_0x2342b8);}_0x3e2e6d(_0x506428);});}function updateFaxInteraction(_0xed0c43,_0x582f10,_0x37023b){return new BPromise(function(_0x4dc0e6,_0x258661){return getInteractionUsers(_0xed0c43,_0x37023b)['then'](function(_0x1fae24){return getInteractionTags(_0x1fae24,_0x582f10);})[_0xb2c1('0x28')](function(_0x7aaca8){_0x4dc0e6(_0x7aaca8);})[_0xb2c1('0x34')](function(_0x3083a0){_0x258661(_0x3083a0);});});}exports[_0xb2c1('0x35')]=function(_0x12d731,_0x3233b2){var _0x2ee014={},_0x3b1949={},_0x187c41={'count':0x0,'rows':[]};var _0x3fd507=_[_0xb2c1('0x36')](db['FaxInteraction'][_0xb2c1('0x37')],function(_0x19972a){return{'name':_0x19972a[_0xb2c1('0x38')],'type':_0x19972a[_0xb2c1('0x39')]['key']};});_0x3b1949[_0xb2c1('0x3a')]=_[_0xb2c1('0x36')](_0x3fd507,'name');_0x3b1949[_0xb2c1('0x3b')]=_['keys'](_0x12d731[_0xb2c1('0x3b')]);_0x3b1949[_0xb2c1('0x3c')]=_[_0xb2c1('0x3d')](_0x3b1949['model'],_0x3b1949['query']);_0x2ee014[_0xb2c1('0x3e')]=_[_0xb2c1('0x3d')](_0x3b1949['model'],qs[_0xb2c1('0x3f')](_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x3f')]));_0x2ee014[_0xb2c1('0x3e')]=_0x2ee014['attributes']['length']?_0x2ee014[_0xb2c1('0x3e')]:_0x3b1949[_0xb2c1('0x3a')];if(!_0x12d731['query']['hasOwnProperty'](_0xb2c1('0x40'))){_0x2ee014[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x12d731['query'][_0xb2c1('0x21')]);_0x2ee014[_0xb2c1('0x1f')]=qs[_0xb2c1('0x1f')](_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x1f')]);}_0x2ee014[_0xb2c1('0x41')]=qs[_0xb2c1('0x42')](_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x42')]);_0x2ee014[_0xb2c1('0x43')]=qs[_0xb2c1('0x3c')](_[_0xb2c1('0x44')](_0x12d731[_0xb2c1('0x3b')],_0x3b1949[_0xb2c1('0x3c')]),_0x3fd507);var _0x208f64=[];var _0x39b5d0=squel[_0xb2c1('0x45')]()[_0xb2c1('0x46')]('id')['field'](_0xb2c1('0x2d'))['field'](_0xb2c1('0x47'))[_0xb2c1('0x48')](_0xb2c1('0x49'));var _0x540c56=squel[_0xb2c1('0x45')]()[_0xb2c1('0x46')](_0xb2c1('0x4a'))[_0xb2c1('0x46')](_0xb2c1('0x4b'))[_0xb2c1('0x46')](_0xb2c1('0x4c'))[_0xb2c1('0x48')](_0xb2c1('0x4d'),'ui')[_0xb2c1('0x4e')]('users','u',_0xb2c1('0x4f'));var _0x25e903=squel[_0xb2c1('0x45')]()[_0xb2c1('0x48')](_0xb2c1('0x50'),'i')['left_join'](_0xb2c1('0x51'),'c',_0xb2c1('0x52'))['left_join'](_0xb2c1('0x53'),'o','o.id\x20=\x20i.UserId')[_0xb2c1('0x4e')](_0xb2c1('0x54'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xb2c1('0x55'),'me',_0xb2c1('0x56'))[_0xb2c1('0x4e')](_0xb2c1('0x57'),'it',_0xb2c1('0x58'))[_0xb2c1('0x4e')](_0xb2c1('0x49'),'t',_0xb2c1('0x59'));var _0x1ace20=squel['expr']();var _0x4c8b34=[];var _0x151489=squel['expr']();var _0x1d8099;if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x5a')]){_0x1d8099=as['parseSearch'](_0x12d731[_0xb2c1('0x3b')]['search']);var _0x2912c3=_0x1d8099[_0xb2c1('0x5b')];for(var _0xcf89a2=0x0;_0xcf89a2<_0x1d8099[_0xb2c1('0x5c')]['length'];_0xcf89a2++){var _0xc4533d=_0x1d8099[_0xb2c1('0x5c')][_0xcf89a2];var _0x317588='i';var _0x29cdfe=_[_0xb2c1('0x5d')](_0x3fd507,[_0xb2c1('0x2d'),_0xc4533d[_0xb2c1('0x46')]]);if(!_0x29cdfe){switch(_0xc4533d[_0xb2c1('0x46')]){case _0xb2c1('0x5e'):if(_0xc4533d[_0xb2c1('0x5f')]==0x1){_0x25e903[_0xb2c1('0x60')]('`'+_0xc4533d[_0xb2c1('0x46')]+'`\x20=\x200');}else{_0x25e903[_0xb2c1('0x60')]('`'+_0xc4533d[_0xb2c1('0x46')]+_0xb2c1('0x61'));}break;case _0xb2c1('0x62'):if(_0xc4533d[_0xb2c1('0x63')]===_0xb2c1('0x64')){if(_0xc4533d['value'][_0xb2c1('0x32')]('\x20')['length']>0x1){_0x1ace20[_0x2912c3](_0xb2c1('0x65'),qs[_0xb2c1('0x66')](_0xc4533d[_0xb2c1('0x5f')]),null);}else{var _0x57f22a='%'+_0xc4533d[_0xb2c1('0x5f')]+'%';_0x1ace20[_0x2912c3](_0xb2c1('0x67'),_0x57f22a,_0x57f22a,_0x57f22a);}}else{_0x29cdfe=_['find'](_0x3fd507,[_0xb2c1('0x2d'),_0xb2c1('0x68')]);_0xc4533d[_0xb2c1('0x46')]=_0xb2c1('0x68');_0x47adba=as[_0xb2c1('0x69')](_0x317588,_0x29cdfe[_0xb2c1('0x39')],_0xc4533d);_0x1ace20[_0x2912c3](_0x47adba[_0xb2c1('0x6a')],_0x47adba[_0xb2c1('0x5f')][_0xb2c1('0x6b')],_0x47adba[_0xb2c1('0x5f')]['end']);}break;case _0xb2c1('0x6c'):var _0x49a590=_0xc4533d['value'][_0xb2c1('0x32')](',')[_0xb2c1('0x36')](function(_0x2f9e63){return Number(_0x2f9e63);});_0x49a590['forEach'](function(_0x1ad34e){_0x151489['or'](_0xb2c1('0x6d'),'%,'+_0x1ad34e+',%');});_0x4c8b34=_[_0xb2c1('0x6e')](_0x4c8b34,_0x49a590);break;case _0xb2c1('0x6f'):if(_0xc4533d[_0xb2c1('0x63')]==='$substring'){_0x1ace20[_0x2912c3](_0xb2c1('0x70'),'%'+_0xc4533d[_0xb2c1('0x5f')]+'%',null);}else{_0x29cdfe=_[_0xb2c1('0x5d')](_0x3fd507,['name',_0xb2c1('0x71')]);_0xc4533d[_0xb2c1('0x46')]=_0xb2c1('0x71');_0x47adba=as[_0xb2c1('0x69')](_0x317588,_0x29cdfe[_0xb2c1('0x39')],_0xc4533d);_0x1ace20[_0x2912c3](_0x47adba[_0xb2c1('0x6a')],_0x47adba[_0xb2c1('0x5f')][_0xb2c1('0x6b')],_0x47adba[_0xb2c1('0x5f')][_0xb2c1('0x1e')]);}break;case'body':_0x47adba=as['buildExpression']('me',null,_0xc4533d);_0x1ace20[_0x2912c3](_0x47adba[_0xb2c1('0x6a')],_0x47adba[_0xb2c1('0x5f')][_0xb2c1('0x6b')],_0x47adba[_0xb2c1('0x5f')]['end']);break;}}else{var _0x47adba=as['buildExpression'](_0x317588,_0x29cdfe[_0xb2c1('0x39')],_0xc4533d);_0x1ace20[_0x2912c3](_0x47adba[_0xb2c1('0x6a')],_0x47adba[_0xb2c1('0x5f')]['start'],_0x47adba['value']['end']);}}}else{var _0x2a6f6a=_(_0x12d731[_0xb2c1('0x3b')])[_0xb2c1('0x72')]()[_0xb2c1('0x36')](function(_0x379d8a){return _[_0xb2c1('0x73')](_0x3fd507,[_0xb2c1('0x2d'),_0x379d8a])?_0x379d8a:undefined;})[_0xb2c1('0x74')]()['value']();if(!_[_0xb2c1('0x75')](_0x2a6f6a)){_0x2a6f6a[_0xb2c1('0x76')](function(_0x1f88a4){if(_0x1f88a4===_0xb2c1('0x77')){_0x25e903[_0xb2c1('0x43')](_0xb2c1('0x78'),[][_0xb2c1('0x79')](_0x12d731[_0xb2c1('0x3b')][_0x1f88a4]));}else if(_0x1f88a4===_0xb2c1('0x7a')){var _0x2f59d9=JSON[_0xb2c1('0x7b')](_0x12d731[_0xb2c1('0x3b')][_0x1f88a4])[_0xb2c1('0x7c')];var _0x457223=JSON[_0xb2c1('0x7b')](_0x12d731[_0xb2c1('0x3b')][_0x1f88a4])['$lte'];_0x25e903['where'](_0xb2c1('0x7d'),_0x2f59d9,_0x457223);}else{if(_0x12d731[_0xb2c1('0x3b')][_0x1f88a4]===_0xb2c1('0x7e')){_0x25e903[_0xb2c1('0x43')]('i.'+_0x1f88a4+_0xb2c1('0x7f'));}else{_0x25e903[_0xb2c1('0x43')]('i.'+_0x1f88a4+_0xb2c1('0x80'),_0x12d731[_0xb2c1('0x3b')][_0x1f88a4]);}}});}if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x81')]){if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x81')]==0x1){_0x25e903['having'](_0xb2c1('0x82'));}else{_0x25e903[_0xb2c1('0x60')](_0xb2c1('0x83'));}}if(_0x12d731[_0xb2c1('0x3b')]['tag']){_0x4c8b34=_['isArray'](_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x84')])?_0x12d731[_0xb2c1('0x3b')]['tag']:new Array(_0x12d731['query'][_0xb2c1('0x84')]);_0x4c8b34[_0xb2c1('0x76')](function(_0x1cd1b0){_0x151489['or'](_0xb2c1('0x6d'),'%,'+_0x1cd1b0+',%');});}if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x85')]){var _0x54f7e2=_0x12d731[_0xb2c1('0x3b')]['filter'][_0xb2c1('0x86')]('\x5c','\x5c\x5c')[_0xb2c1('0x86')](/'/g,'\x27\x27');if(qs[_0xb2c1('0x87')](_0x54f7e2)){_0x1ace20['or']('i.id\x20LIKE\x20?',_0x54f7e2+'%')['or'](_0xb2c1('0x88'),_0x54f7e2+'%');}_0x1ace20['or'](_0xb2c1('0x89'),_0x54f7e2+'%');}}_0x25e903[_0xb2c1('0x43')](_0x1ace20);_0x25e903['group'](_0xb2c1('0x8a'));var _0x3d9865={'type':db['Sequelize'][_0xb2c1('0x8b')][_0xb2c1('0x8c')],'raw':!![]};var _0x53e755=_0x25e903[_0xb2c1('0x8d')]();_0x53e755[_0xb2c1('0x46')]('i.id');_0x53e755[_0xb2c1('0x46')](_0xb2c1('0x8e'),_0xb2c1('0x5e'));if(_0x2ee014[_0xb2c1('0x41')]){_0x2ee014['order'][_0xb2c1('0x76')](function(_0x47bef1){var _0x503e1f=_0x47bef1[0x0]===_0xb2c1('0x8f')?_0x47bef1[0x0]:'i.'+_0x47bef1[0x0];_0x25e903[_0xb2c1('0x41')](_0x503e1f,_0x47bef1[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb2c1('0x75')](_0x4c8b34)){_0x25e903['having'](_0x151489);_0x53e755[_0xb2c1('0x43')]('t.id\x20IN\x20?',_0x4c8b34);}BPromise[_0xb2c1('0x90')]()['then'](function(){if(!_0x1d8099){if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x77')])return;_0x53e755[_0xb2c1('0x43')](_0xb2c1('0x91'));_0x25e903['where'](_0xb2c1('0x91'));return;}if(_0x12d731[_0xb2c1('0x92')][_0xb2c1('0x93')]!==_0xb2c1('0x94'))return;return _0x12d731['user'][_0xb2c1('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38dfdc){if(_['isEmpty'](_0x38dfdc)){_0x53e755[_0xb2c1('0x43')](_0xb2c1('0x96'));_0x25e903[_0xb2c1('0x43')](_0xb2c1('0x96'));}else{_0x53e755['where'](_0xb2c1('0x78'),_[_0xb2c1('0x36')](_0x38dfdc,'id'));_0x25e903[_0xb2c1('0x43')]('i.FaxAccountId\x20IN\x20?',_[_0xb2c1('0x36')](_0x38dfdc,'id'));}});})[_0xb2c1('0x28')](function(){if(_0x12d731['user'][_0xb2c1('0x93')]===_0xb2c1('0x94')&&!_0x1d8099&&!_0x12d731[_0xb2c1('0x3b')]['FaxAccountId'])return[];return db[_0xb2c1('0x97')]['query'](_0x53e755['toString'](),_0x3d9865);})[_0xb2c1('0x28')](function(_0x4b745d){_0x187c41[_0xb2c1('0x22')]=_0x4b745d[_0xb2c1('0x98')];if(_0x187c41['count']===0x0)return[];return db['sequelize'][_0xb2c1('0x3b')](_0x39b5d0[_0xb2c1('0x99')](),_0x3d9865)[_0xb2c1('0x28')](function(_0x135cbe){_0x208f64=_[_0xb2c1('0x9a')](_0x135cbe,'id');_0x3d9865=_[_0xb2c1('0x9b')](_0x3d9865,{'model':db[_0xb2c1('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12d731[_0xb2c1('0x3b')][_0xb2c1('0x3f')]){_0x2ee014[_0xb2c1('0x3e')][_0xb2c1('0x76')](function(_0x382d9e){_0x25e903['field']('i.'+_0x382d9e);});}else{_0x25e903[_0xb2c1('0x46')](_0xb2c1('0x8e'),_0xb2c1('0x5e'));_0x25e903[_0xb2c1('0x46')](_0xb2c1('0x9d'),_0xb2c1('0x9e'));_0x25e903[_0xb2c1('0x46')]('a.mandatoryDisposition',_0xb2c1('0x9f'));_0x25e903[_0xb2c1('0x46')](_0xb2c1('0xa0'),'contactName');_0x25e903[_0xb2c1('0x46')](_0xb2c1('0xa1'));_0x25e903['field'](_0xb2c1('0xa2'),_0xb2c1('0xa3'));_0x25e903[_0xb2c1('0x46')]('c.lastName',_0xb2c1('0xa4'));_0x25e903['field'](_0xb2c1('0xa5'),_0xb2c1('0xa6'));_0x25e903[_0xb2c1('0x46')]('c.phone',_0xb2c1('0xa7'));_0x25e903[_0xb2c1('0x46')]('c.mobile',_0xb2c1('0xa8'));_0x25e903[_0xb2c1('0x46')]('c.fax',_0xb2c1('0xa9'));_0x25e903['field'](_0xb2c1('0xaa'),_0xb2c1('0xab'));_0x25e903[_0xb2c1('0x46')]('o.internal',_0xb2c1('0xac'));_0x25e903[_0xb2c1('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2ee014[_0xb2c1('0x21')])_0x25e903[_0xb2c1('0x21')](_0x2ee014['limit']);if(_0x2ee014[_0xb2c1('0x1f')])_0x25e903[_0xb2c1('0x1f')](_0x2ee014[_0xb2c1('0x1f')]);return db[_0xb2c1('0x97')]['query'](_0x25e903[_0xb2c1('0x99')](),_0x3d9865);})[_0xb2c1('0x28')](function(_0x2daf61){if(_0x2daf61['length']>0x0)_0x540c56[_0xb2c1('0x43')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x2daf61,'id'));return db[_0xb2c1('0x97')][_0xb2c1('0x3b')](_0x540c56[_0xb2c1('0x99')](),_0x3d9865)[_0xb2c1('0x28')](function(_0x21d725){var _0xd2e37d=_[_0xb2c1('0xad')](_0x21d725,_0xb2c1('0xae'));var _0x24abcc=[];_0x2daf61[_0xb2c1('0x76')](function(_0x2f78a6){_0x24abcc[_0xb2c1('0x33')](updateFaxInteraction(_0x2f78a6,_0x208f64,_0xd2e37d));});return BPromise[_0xb2c1('0xaf')](_0x24abcc);});});})['then'](function(_0x556a0a){_0x187c41[_0xb2c1('0xb0')]=_0x556a0a;return _0x187c41;})['then'](respondWithFilteredResult(_0x3233b2,_0x2ee014))[_0xb2c1('0x34')](handleError(_0x3233b2,null));};exports[_0xb2c1('0xb1')]=function(_0x21d5df,_0x240704){var _0x5dd83b={'raw':![],'where':{'id':_0x21d5df[_0xb2c1('0xb2')]['id']}},_0x1ff946={};_0x1ff946['model']=_[_0xb2c1('0x72')](db[_0xb2c1('0x9c')][_0xb2c1('0x37')]);_0x1ff946[_0xb2c1('0x3b')]=_[_0xb2c1('0x72')](_0x21d5df['query']);_0x1ff946[_0xb2c1('0x3c')]=_[_0xb2c1('0x3d')](_0x1ff946[_0xb2c1('0x3a')],_0x1ff946[_0xb2c1('0x3b')]);_0x5dd83b[_0xb2c1('0x3e')]=_['intersection'](_0x1ff946[_0xb2c1('0x3a')],qs[_0xb2c1('0x3f')](_0x21d5df[_0xb2c1('0x3b')][_0xb2c1('0x3f')]));_0x5dd83b[_0xb2c1('0x3e')]=_0x5dd83b['attributes'][_0xb2c1('0x98')]?_0x5dd83b['attributes']:_0x1ff946[_0xb2c1('0x3a')];if(_0x21d5df[_0xb2c1('0x3b')]['includeAll']){_0x5dd83b[_0xb2c1('0xb3')]=[{'all':!![]}];}_0x5dd83b=_[_0xb2c1('0x9b')]({},_0x5dd83b,_0x21d5df[_0xb2c1('0xb4')]);return db[_0xb2c1('0x9c')][_0xb2c1('0x5d')](_0x5dd83b)[_0xb2c1('0x28')](handleEntityNotFound(_0x240704,null))[_0xb2c1('0x28')](respondWithResult(_0x240704,null))[_0xb2c1('0x34')](handleError(_0x240704,null));};exports[_0xb2c1('0xb5')]=function(_0x40797d,_0xd42084){return db[_0xb2c1('0x9c')]['create'](_0x40797d[_0xb2c1('0xb6')],{})[_0xb2c1('0x28')](respondWithResult(_0xd42084,0xc9))['catch'](handleError(_0xd42084,null));};exports[_0xb2c1('0xb7')]=function(_0x10820a,_0x4e38e4){if(_0x10820a[_0xb2c1('0xb6')]['id']){delete _0x10820a[_0xb2c1('0xb6')]['id'];}return db[_0xb2c1('0x9c')][_0xb2c1('0x5d')]({'where':{'id':_0x10820a[_0xb2c1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4e38e4,null))['then'](saveUpdates(_0x10820a[_0xb2c1('0xb6')],null))[_0xb2c1('0x28')](respondWithResult(_0x4e38e4,null))[_0xb2c1('0x34')](handleError(_0x4e38e4,null));};exports['destroy']=function(_0x20ea85,_0x499e31){return db['FaxInteraction'][_0xb2c1('0x5d')]({'where':{'id':_0x20ea85[_0xb2c1('0xb2')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x499e31,null))[_0xb2c1('0x28')](removeEntity(_0x499e31,null))[_0xb2c1('0x34')](handleError(_0x499e31,null));};exports[_0xb2c1('0xb8')]=function(_0x529b4d,_0x88ac4b){return db['FaxInteraction']['describe']()[_0xb2c1('0x28')](respondWithResult(_0x88ac4b,null))['catch'](handleError(_0x88ac4b,null));};exports['addMessage']=function(_0x4cff16,_0x4d666a,_0x40fb8d){return db[_0xb2c1('0xb9')][_0xb2c1('0x5d')]({'where':{'id':_0x4cff16[_0xb2c1('0xb2')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x4d666a,null))[_0xb2c1('0x28')](function(_0x4c42d2){if(_0x4c42d2){return _0x4c42d2[_0xb2c1('0xba')](_0x4cff16[_0xb2c1('0xb6')][_0xb2c1('0xbb')],_[_0xb2c1('0xbc')](_0x4cff16[_0xb2c1('0xb6')],[_0xb2c1('0xbb'),'id'])||{});}})[_0xb2c1('0x28')](respondWithResult(_0x4d666a,null))[_0xb2c1('0x34')](handleError(_0x4d666a,null));};exports['getMessages']=function(_0x2f2198,_0x1ef15b,_0x41024f){var _0x6418fb={'raw':![],'where':{}};var _0x24b112={};var _0x513554={'count':0x0,'rows':[]};return db[_0xb2c1('0x9c')]['findOne']({'where':{'id':_0x2f2198[_0xb2c1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x1ef15b,null))[_0xb2c1('0x28')](function(_0xa37501){if(_0xa37501){_0x24b112[_0xb2c1('0x3a')]=_['keys'](db[_0xb2c1('0xb9')][_0xb2c1('0x37')]);_0x24b112[_0xb2c1('0x3b')]=_[_0xb2c1('0x72')](_0x2f2198[_0xb2c1('0x3b')]);_0x24b112[_0xb2c1('0x3c')]=_[_0xb2c1('0x3d')](_0x24b112[_0xb2c1('0x3a')],_0x24b112[_0xb2c1('0x3b')]);_0x6418fb[_0xb2c1('0x3e')]=_[_0xb2c1('0x3d')](_0x24b112[_0xb2c1('0x3a')],qs[_0xb2c1('0x3f')](_0x2f2198['query'][_0xb2c1('0x3f')]));_0x6418fb[_0xb2c1('0x3e')]=_0x6418fb[_0xb2c1('0x3e')][_0xb2c1('0x98')]?_0x6418fb[_0xb2c1('0x3e')]:_0x24b112[_0xb2c1('0x3a')];if(!_0x2f2198['query'][_0xb2c1('0xbd')](_0xb2c1('0x40'))){_0x6418fb[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x2f2198[_0xb2c1('0x3b')][_0xb2c1('0x21')]);_0x6418fb[_0xb2c1('0x1f')]=qs[_0xb2c1('0x1f')](_0x2f2198['query'][_0xb2c1('0x1f')]);}_0x6418fb[_0xb2c1('0x41')]=qs[_0xb2c1('0x42')](_0x2f2198[_0xb2c1('0x3b')][_0xb2c1('0x42')]);_0x6418fb[_0xb2c1('0x43')]=qs[_0xb2c1('0x3c')](_[_0xb2c1('0x44')](_0x2f2198['query'],_0x24b112[_0xb2c1('0x3c')]));_0x6418fb['where']['FaxInteractionId']=_0xa37501['id'];if(_0x2f2198[_0xb2c1('0x3b')]['filter']){_0x6418fb[_0xb2c1('0x43')]=_[_0xb2c1('0x9b')](_0x6418fb[_0xb2c1('0x43')],{'$or':_['map'](_0x6418fb[_0xb2c1('0x3e')],function(_0x3bd973){var _0x81b056={};_0x81b056[_0x3bd973]={'$like':'%'+_0x2f2198['query'][_0xb2c1('0x85')]+'%'};return _0x81b056;})});}if(_0x2f2198[_0xb2c1('0x3b')]['$gte']){var _0x5a0a4b=_0x2f2198['query'][_0xb2c1('0x7c')][_0xb2c1('0x32')](',');var _0x49b89a={};_0x49b89a[_0x5a0a4b[0x0]]={'$gte':moment(_0x5a0a4b[0x1])[_0xb2c1('0xbe')](_0xb2c1('0xbf'))};_0x6418fb[_0xb2c1('0x43')]=_[_0xb2c1('0x9b')](_0x6418fb[_0xb2c1('0x43')],_0x49b89a);}_0x6418fb=_[_0xb2c1('0x9b')]({},_0x6418fb,_0x2f2198[_0xb2c1('0xb4')]);return db['FaxMessage'][_0xb2c1('0x22')]({'where':_0x6418fb['where']})[_0xb2c1('0x28')](function(_0x184ce9){_0x513554['count']=_0x184ce9;if(_0x2f2198[_0xb2c1('0x3b')][_0xb2c1('0xc0')]){_0x6418fb[_0xb2c1('0xb3')]=[{'all':!![]}];}return db[_0xb2c1('0xb9')][_0xb2c1('0xc1')](_0x6418fb);})[_0xb2c1('0x28')](function(_0x1e5ca2){_0x513554['rows']=_0x1e5ca2;return _0x513554;});}})[_0xb2c1('0x28')](respondWithFilteredResult(_0x1ef15b,_0x6418fb))[_0xb2c1('0x34')](handleError(_0x1ef15b,null));};exports['addTags']=function(_0x33be71,_0x3a81a5,_0x11b0b3){return db[_0xb2c1('0x9c')][_0xb2c1('0x5d')]({'where':{'id':_0x33be71[_0xb2c1('0xb2')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x3a81a5,null))['then'](function(_0x1869e4){if(_0x1869e4){return _0x1869e4[_0xb2c1('0xc2')](_0x33be71['body'][_0xb2c1('0xbb')],_[_0xb2c1('0xbc')](_0x33be71[_0xb2c1('0xb6')],['ids','id'])||{})[_0xb2c1('0xc3')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb2c1('0x2d'),_0xb2c1('0x47')],'where':{'id':_0x33be71[_0xb2c1('0xb6')][_0xb2c1('0xbb')]}});})[_0xb2c1('0x28')](function(_0x2fd57d){socket[_0xb2c1('0xc4')](_0xb2c1('0xc5'),{'id':Number(_0x33be71[_0xb2c1('0xb2')]['id']),'tags':_0x2fd57d||[]});return{'id':Number(_0x33be71['params']['id']),'tags':_0x2fd57d||[]};});}})[_0xb2c1('0x28')](respondWithResult(_0x3a81a5,null))['catch'](handleError(_0x3a81a5,null));};exports[_0xb2c1('0xc6')]=function(_0x43f2de,_0xcd5fed,_0x53e681){return db[_0xb2c1('0x9c')][_0xb2c1('0x5d')]({'where':{'id':_0x43f2de[_0xb2c1('0xb2')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0xcd5fed,null))[_0xb2c1('0x28')](function(_0x1f763e){if(_0x1f763e){return _0x1f763e[_0xb2c1('0xc6')](_0x43f2de[_0xb2c1('0x3b')][_0xb2c1('0xbb')]);}})[_0xb2c1('0x28')](respondWithStatusCode(_0xcd5fed,null))[_0xb2c1('0x34')](handleError(_0xcd5fed,null));};exports[_0xb2c1('0xc7')]=function(_0x4f755d,_0x229f7d){var _0x5ecd71=moment()[_0xb2c1('0xc8')]()[_0xb2c1('0x99')]();var _0x55510c=path[_0xb2c1('0xc9')](config[_0xb2c1('0xca')],'server',_0xb2c1('0xcb'),_0xb2c1('0xcc'));var _0x36dfaf=path[_0xb2c1('0xc9')](config[_0xb2c1('0xca')],'server','files',_0xb2c1('0xcd'));var _0x1558bf=path[_0xb2c1('0xc9')](_0x55510c,_0x5ecd71);var _0x3d6bb0=util['format'](_0xb2c1('0xce'),_0x4f755d[_0xb2c1('0xb2')]['id'],_0x5ecd71);var _0xd7251a=path['join'](_0x55510c,_0x3d6bb0);var _0x5a7495=[];_0x5a7495[_0xb2c1('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x5db6a1=[{'model':db[_0xb2c1('0xb9')],'as':'Messages','attributes':['id','body',_0xb2c1('0x7a')],'include':_0x5a7495}];return db[_0xb2c1('0x9c')][_0xb2c1('0x5d')]({'where':{'id':_0x4f755d['params']['id']},'include':_0x5db6a1})[_0xb2c1('0x28')](handleEntityNotFound(_0x229f7d,null))[_0xb2c1('0x28')](function(_0x3033a8){if(_0x3033a8&&_0x3033a8[_0xb2c1('0xcf')]){var _0x5d17cd=_0x3033a8['get']({'plain':!![]});fs[_0xb2c1('0xd0')](_0x1558bf);for(var _0x42e148=0x0;_0x42e148<_0x5d17cd[_0xb2c1('0xcf')][_0xb2c1('0x98')];_0x42e148++){var _0x5a71eb=_0x5d17cd['Messages'][_0x42e148]['Attachment'];if(_0x5a71eb){var _0x262163=path[_0xb2c1('0xc9')](_0x36dfaf,_0x5a71eb[_0xb2c1('0xd1')]);if(fs['existsSync'](_0x262163)){fs[_0xb2c1('0xd2')](_0x262163)['pipe'](fs[_0xb2c1('0xd3')](path[_0xb2c1('0xc9')](_0x1558bf,_0x5a71eb[_0xb2c1('0xd1')])));}}}return BPromise[_0xb2c1('0x90')]()['then'](function(){return new BPromise(function(_0xda02d0,_0x4c98af){zipdir(_0x1558bf,{'saveTo':_0xd7251a},function(_0x43459b,_0x28bf49){if(_0x43459b)return _0x4c98af(_0x43459b);return _0xda02d0(_0x28bf49);});})[_0xb2c1('0x28')](function(){return new BPromise(function(_0x49fbe2,_0x25ff56){rimraf(_0x1558bf,function(_0x425c4f){if(_0x425c4f)_0x25ff56(_0x425c4f);return _0x49fbe2();});});})[_0xb2c1('0x28')](function(){return _0x229f7d[_0xb2c1('0xc7')](_0xd7251a,_0x3d6bb0,function(_0x47ffe9){if(_0x47ffe9){console[_0xb2c1('0xd4')]('err',_0x47ffe9);}else{fs['unlinkSync'](_0xd7251a);}});});});}else{return _0x229f7d[_0xb2c1('0x2a')](0xc8);}})[_0xb2c1('0x34')](handleError(_0x229f7d,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 01c9c22..13d1ab8 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 _0x3712=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','update','remove','getUsers','then','setDataValue','map'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x3712,0xe6));var _0x2371=function(_0x33c42e,_0x170930){_0x33c42e=_0x33c42e-0x0;var _0xfddb2b=_0x3712[_0x33c42e];return _0xfddb2b;};'use strict';var EventEmitter=require(_0x2371('0x0'));var FaxInteraction=require(_0x2371('0x1'))['db'][_0x2371('0x2')];var FaxMessage=require(_0x2371('0x1'))['db'][_0x2371('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2371('0x4'),'afterDestroy':_0x2371('0x5')};function emitEvent(_0x44889e){return function(_0x32fcd8,_0x2604ee,_0x4a74ad){_0x32fcd8[_0x2371('0x6')]({'attributes':['id'],'raw':!![]})[_0x2371('0x7')](function(_0x2f1ab2){_0x32fcd8[_0x2371('0x8')]('Users',_0x2f1ab2[_0x2371('0x9')](function(_0x4288c3){return{'id':_0x4288c3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x32fcd8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2371('0x7')](function(_0x536723){_0x32fcd8[_0x2371('0x8')]('unreadMessages',_0x536723[_0x2371('0xa')]);FaxInteractionEvents[_0x2371('0xb')](_0x44889e+':'+_0x32fcd8['id'],_0x32fcd8);FaxInteractionEvents[_0x2371('0xb')](_0x44889e,_0x32fcd8);_0x4a74ad(null);})['catch'](_0x4a74ad(null));};}for(var e in events){if(events[_0x2371('0xc')](e)){var event=events[e];FaxInteraction[_0x2371('0xd')](e,emitEvent(event));}}module[_0x2371('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x9739=['getUsers','then','setDataValue','Users','map','findAll','emit','catch','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0xf73076,_0x471012){var _0x2d0063=function(_0x1bb80e){while(--_0x1bb80e){_0xf73076['push'](_0xf73076['shift']());}};_0x2d0063(++_0x471012);}(_0x9739,0xf9));var _0x9973=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x9739[_0x31c5e9];return _0x517a8d;};'use strict';var EventEmitter=require(_0x9973('0x0'));var FaxInteraction=require(_0x9973('0x1'))['db'][_0x9973('0x2')];var FaxMessage=require(_0x9973('0x1'))['db'][_0x9973('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9973('0x4')](0x0);var events={'afterCreate':_0x9973('0x5'),'afterUpdate':_0x9973('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1ba083){return function(_0x2f4ff4,_0x211b3c,_0x558f5e){_0x2f4ff4[_0x9973('0x7')]({'attributes':['id'],'raw':!![]})[_0x9973('0x8')](function(_0x3f9b21){_0x2f4ff4[_0x9973('0x9')](_0x9973('0xa'),_0x3f9b21[_0x9973('0xb')](function(_0x3f6830){return{'id':_0x3f6830['id']};}));return FaxMessage[_0x9973('0xc')]({'where':{'FaxInteractionId':_0x2f4ff4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9973('0x8')](function(_0x3eca58){_0x2f4ff4[_0x9973('0x9')]('unreadMessages',_0x3eca58['length']);FaxInteractionEvents[_0x9973('0xd')](_0x1ba083+':'+_0x2f4ff4['id'],_0x2f4ff4);FaxInteractionEvents[_0x9973('0xd')](_0x1ba083,_0x2f4ff4);_0x558f5e(null);})[_0x9973('0xe')](_0x558f5e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9973('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 2f185fd..1497d3f 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 _0x6cac=['../../config/environment','./faxInteraction.attributes','exports','fax_interactions','closed','closedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x310b31,_0x59f486){var _0x106f13=function(_0x5aecd0){while(--_0x5aecd0){_0x310b31['push'](_0x310b31['shift']());}};_0x106f13(++_0x59f486);}(_0x6cac,0xe7));var _0xc6ca=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6cac[_0x432682];return _0x463d05;};'use strict';var _=require(_0xc6ca('0x0'));var util=require('util');var logger=require(_0xc6ca('0x1'))(_0xc6ca('0x2'));var moment=require(_0xc6ca('0x3'));var BPromise=require(_0xc6ca('0x4'));var rp=require(_0xc6ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6ca('0x6'));var config=require(_0xc6ca('0x7'));var attributes=require(_0xc6ca('0x8'));module[_0xc6ca('0x9')]=function(_0x3081be,_0x41f84e){return _0x3081be['define']('FaxInteraction',attributes,{'tableName':_0xc6ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14511b,_0x32051d,_0x3a1001){if(_0x14511b['changed'](_0xc6ca('0xb'))){_0x14511b[_0xc6ca('0xc')]=moment()[_0xc6ca('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3a1001(null,_0x14511b);}}});}; \ No newline at end of file +var _0xec18=['rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xec18,0x12a));var _0x8ec1=function(_0x4fee7a,_0x181b5d){_0x4fee7a=_0x4fee7a-0x0;var _0x3064bc=_0xec18[_0x4fee7a];return _0x3064bc;};'use strict';var _=require('lodash');var util=require(_0x8ec1('0x0'));var logger=require(_0x8ec1('0x1'))(_0x8ec1('0x2'));var moment=require('moment');var BPromise=require(_0x8ec1('0x3'));var rp=require(_0x8ec1('0x4'));var fs=require('fs');var path=require(_0x8ec1('0x5'));var rimraf=require(_0x8ec1('0x6'));var config=require(_0x8ec1('0x7'));var attributes=require(_0x8ec1('0x8'));module[_0x8ec1('0x9')]=function(_0x5b2b75,_0x8fdcda){return _0x5b2b75[_0x8ec1('0xa')](_0x8ec1('0xb'),attributes,{'tableName':_0x8ec1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a2df5,_0x4a0b3d,_0x247543){if(_0x5a2df5[_0x8ec1('0xd')](_0x8ec1('0xe'))){_0x5a2df5['closedAt']=moment()['format'](_0x8ec1('0xf'));}_0x247543(null,_0x5a2df5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 323a8bd..57226e6 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 _0x1c06=['localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','limit','info','stringify','FaxInteraction','find','addTags','omit','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x1c06,0x198));var _0x61c0=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x1c06[_0xd02def];return _0x2e8374;};'use strict';var _=require(_0x61c0('0x0'));var util=require('util');var moment=require(_0x61c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x61c0('0x2'));var fs=require('fs');var Redis=require(_0x61c0('0x3'));var db=require(_0x61c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x61c0('0x5'))(_0x61c0('0x6'));var config=require(_0x61c0('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x61c0('0x8')]=_[_0x61c0('0x9')](config[_0x61c0('0x8')],{'host':_0x61c0('0xa'),'port':0x18eb});var socket=require(_0x61c0('0xb'))(new Redis(config['redis']));require(_0x61c0('0xc'))[_0x61c0('0xd')](socket);function respondWithRpcPromise(_0x71d0f8,_0x50bbd8,_0xfba69b){return new BPromise(function(_0x58399c,_0x546827){return client[_0x61c0('0xe')](_0x71d0f8,_0xfba69b)[_0x61c0('0xf')](function(_0x3a6ddd){logger['info'](_0x61c0('0x10'),_0x50bbd8,_0x61c0('0x11'));logger[_0x61c0('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x50bbd8,'request\x20sent',JSON['stringify'](_0x3a6ddd));if(_0x3a6ddd[_0x61c0('0x13')]){if(_0x3a6ddd[_0x61c0('0x13')]['code']===0x1f4){logger[_0x61c0('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x50bbd8,_0x3a6ddd[_0x61c0('0x13')][_0x61c0('0x14')]);return _0x546827(_0x3a6ddd[_0x61c0('0x13')][_0x61c0('0x14')]);}logger[_0x61c0('0x13')](_0x61c0('0x10'),_0x50bbd8,_0x3a6ddd['error']['message']);return _0x58399c(_0x3a6ddd[_0x61c0('0x13')][_0x61c0('0x14')]);}else{logger['info'](_0x61c0('0x10'),_0x50bbd8,'request\x20sent');_0x58399c(_0x3a6ddd['result'][_0x61c0('0x14')]);}})[_0x61c0('0x15')](function(_0x4ab27b){logger['error'](_0x61c0('0x10'),_0x50bbd8,_0x4ab27b);_0x546827(_0x4ab27b);});});}exports[_0x61c0('0x16')]=function(_0x28da72){var _0x334de9=this;return new Promise(function(_0x3c65a3,_0x265cf2){return db['FaxInteraction'][_0x61c0('0x17')](_0x28da72[_0x61c0('0x18')],{'raw':_0x28da72[_0x61c0('0x19')]?_0x28da72['options'][_0x61c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28da72[_0x61c0('0x19')]?_0x28da72[_0x61c0('0x19')][_0x61c0('0x1b')]||null:null,'attributes':_0x28da72[_0x61c0('0x19')]?_0x28da72[_0x61c0('0x19')][_0x61c0('0x1c')]||null:null,'limit':_0x28da72[_0x61c0('0x19')]?_0x28da72[_0x61c0('0x19')][_0x61c0('0x1d')]||null:null})['then'](function(_0x24493e){logger[_0x61c0('0x1e')](_0x61c0('0x16'),_0x28da72);logger[_0x61c0('0x12')](_0x61c0('0x16'),_0x28da72,JSON[_0x61c0('0x1f')](_0x24493e));_0x3c65a3(_0x24493e);})[_0x61c0('0x15')](function(_0x3767b8){logger[_0x61c0('0x13')](_0x61c0('0x16'),_0x3767b8[_0x61c0('0x14')],_0x28da72);_0x265cf2(_0x334de9['error'](0x1f4,_0x3767b8['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x1362c0){return new Promise(function(_0x40b7c9,_0x4dc744){return db[_0x61c0('0x20')][_0x61c0('0x21')]({'where':_0x1362c0[_0x61c0('0x19')]?_0x1362c0[_0x61c0('0x19')][_0x61c0('0x1b')]||null:null})[_0x61c0('0xf')](function(_0x2444d1){if(_0x2444d1){return _0x2444d1[_0x61c0('0x22')](_0x1362c0[_0x61c0('0x18')]['ids'],_[_0x61c0('0x23')](_0x1362c0[_0x61c0('0x18')],[_0x61c0('0x24'),'id'])||{});}})['spread'](function(_0x276a03){logger[_0x61c0('0x1e')](_0x61c0('0x25'),_0x1362c0);logger[_0x61c0('0x12')](_0x61c0('0x25'),_0x1362c0,JSON[_0x61c0('0x1f')](_0x276a03));_0x40b7c9(_0x276a03);})[_0x61c0('0x15')](function(_0x30fa5c){logger['error']('AddTags',_0x30fa5c['message'],_0x1362c0);_0x4dc744(_this[_0x61c0('0x13')](0x1f4,_0x30fa5c[_0x61c0('0x14')]));});});}; \ No newline at end of file +var _0xcf99=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','update','options','raw','where','attributes','limit','catch','FaxInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xcf99,0x11c));var _0x9cf9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf99[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9cf9('0x0'));var util=require(_0x9cf9('0x1'));var moment=require('moment');var BPromise=require(_0x9cf9('0x2'));var rs=require(_0x9cf9('0x3'));var fs=require('fs');var Redis=require(_0x9cf9('0x4'));var db=require(_0x9cf9('0x5'))['db'];var utils=require(_0x9cf9('0x6'));var logger=require(_0x9cf9('0x7'))(_0x9cf9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9cf9('0x9')][_0x9cf9('0xa')]({'port':0x232a});config[_0x9cf9('0xb')]=_[_0x9cf9('0xc')](config[_0x9cf9('0xb')],{'host':_0x9cf9('0xd'),'port':0x18eb});var socket=require(_0x9cf9('0xe'))(new Redis(config[_0x9cf9('0xb')]));require(_0x9cf9('0xf'))[_0x9cf9('0x10')](socket);function respondWithRpcPromise(_0xe2aa17,_0xc07fd1,_0xfb920b){return new BPromise(function(_0x472608,_0xb8f27){return client[_0x9cf9('0x11')](_0xe2aa17,_0xfb920b)[_0x9cf9('0x12')](function(_0x526b5a){logger[_0x9cf9('0x13')](_0x9cf9('0x14'),_0xc07fd1,_0x9cf9('0x15'));logger[_0x9cf9('0x16')](_0x9cf9('0x17'),_0xc07fd1,_0x9cf9('0x15'),JSON[_0x9cf9('0x18')](_0x526b5a));if(_0x526b5a[_0x9cf9('0x19')]){if(_0x526b5a[_0x9cf9('0x19')][_0x9cf9('0x1a')]===0x1f4){logger[_0x9cf9('0x19')](_0x9cf9('0x14'),_0xc07fd1,_0x526b5a[_0x9cf9('0x19')]['message']);return _0xb8f27(_0x526b5a[_0x9cf9('0x19')][_0x9cf9('0x1b')]);}logger['error'](_0x9cf9('0x14'),_0xc07fd1,_0x526b5a['error']['message']);return _0x472608(_0x526b5a[_0x9cf9('0x19')][_0x9cf9('0x1b')]);}else{logger[_0x9cf9('0x13')]('FaxInteraction,\x20%s,\x20%s',_0xc07fd1,'request\x20sent');_0x472608(_0x526b5a[_0x9cf9('0x1c')][_0x9cf9('0x1b')]);}})['catch'](function(_0x224890){logger[_0x9cf9('0x19')](_0x9cf9('0x14'),_0xc07fd1,_0x224890);_0xb8f27(_0x224890);});});}exports['UpdateFaxInteraction']=function(_0x4c118a){var _0x14dc8a=this;return new Promise(function(_0x3d464c,_0x480c74){return db['FaxInteraction'][_0x9cf9('0x1d')](_0x4c118a['body'],{'raw':_0x4c118a[_0x9cf9('0x1e')]?_0x4c118a[_0x9cf9('0x1e')][_0x9cf9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c118a[_0x9cf9('0x1e')]?_0x4c118a[_0x9cf9('0x1e')][_0x9cf9('0x20')]||null:null,'attributes':_0x4c118a[_0x9cf9('0x1e')]?_0x4c118a[_0x9cf9('0x1e')][_0x9cf9('0x21')]||null:null,'limit':_0x4c118a[_0x9cf9('0x1e')]?_0x4c118a[_0x9cf9('0x1e')][_0x9cf9('0x22')]||null:null})['then'](function(_0xf21c2c){logger[_0x9cf9('0x13')]('UpdateFaxInteraction',_0x4c118a);logger[_0x9cf9('0x16')]('UpdateFaxInteraction',_0x4c118a,JSON[_0x9cf9('0x18')](_0xf21c2c));_0x3d464c(_0xf21c2c);})[_0x9cf9('0x23')](function(_0x4a6cce){logger[_0x9cf9('0x19')]('UpdateFaxInteraction',_0x4a6cce[_0x9cf9('0x1b')],_0x4c118a);_0x480c74(_0x14dc8a['error'](0x1f4,_0x4a6cce['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x2b6886){return new Promise(function(_0x1a47d1,_0x4fc7bf){return db[_0x9cf9('0x24')][_0x9cf9('0x25')]({'where':_0x2b6886[_0x9cf9('0x1e')]?_0x2b6886[_0x9cf9('0x1e')][_0x9cf9('0x20')]||null:null})[_0x9cf9('0x12')](function(_0xc8b718){if(_0xc8b718){return _0xc8b718[_0x9cf9('0x26')](_0x2b6886[_0x9cf9('0x27')][_0x9cf9('0x28')],_[_0x9cf9('0x29')](_0x2b6886['body'],[_0x9cf9('0x28'),'id'])||{});}})['spread'](function(_0x47e48c){logger[_0x9cf9('0x13')](_0x9cf9('0x2a'),_0x2b6886);logger[_0x9cf9('0x16')]('AddTags',_0x2b6886,JSON[_0x9cf9('0x18')](_0x47e48c));_0x1a47d1(_0x47e48c);})[_0x9cf9('0x23')](function(_0x8a18f2){logger['error'](_0x9cf9('0x2a'),_0x8a18f2[_0x9cf9('0x1b')],_0x2b6886);_0x4fc7bf(_this[_0x9cf9('0x19')](0x1f4,_0x8a18f2[_0x9cf9('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d2de7ea..82b023e 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 _0x7b50=['remove','removeListener','register','length','faxInteraction:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b50,0x11f));var _0x07b5=function(_0x2e7efb,_0x19bb29){_0x2e7efb=_0x2e7efb-0x0;var _0x47c614=_0x7b50[_0x2e7efb];return _0x47c614;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x07b5('0x0'),_0x07b5('0x1'),'update'];function createListener(_0x132ebd,_0x19f3ec){return function(_0x3789a1){_0x19f3ec['emit'](_0x132ebd,_0x3789a1);};}function removeListener(_0x288f70,_0x3933c3){return function(){FaxInteractionEvents[_0x07b5('0x2')](_0x288f70,_0x3933c3);};}exports[_0x07b5('0x3')]=function(_0x59ff4a){for(var _0x24f7bb=0x0,_0x4b4367=events[_0x07b5('0x4')];_0x24f7bb<_0x4b4367;_0x24f7bb++){var _0x4a1b2c=events[_0x24f7bb];var _0x16d55b=createListener(_0x07b5('0x5')+_0x4a1b2c,_0x59ff4a);FaxInteractionEvents['on'](_0x4a1b2c,_0x16d55b);}}; \ No newline at end of file +var _0x660c=['removeListener','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x2bebc8,_0x2595ee){var _0x5eb85c=function(_0x36ae73){while(--_0x36ae73){_0x2bebc8['push'](_0x2bebc8['shift']());}};_0x5eb85c(++_0x2595ee);}(_0x660c,0x183));var _0xc660=function(_0x264c01,_0x2be203){_0x264c01=_0x264c01-0x0;var _0x28f999=_0x660c[_0x264c01];return _0x28f999;};'use strict';var FaxInteractionEvents=require(_0xc660('0x0'));var events=[_0xc660('0x1'),_0xc660('0x2'),_0xc660('0x3')];function createListener(_0x4f9ec5,_0x21c30d){return function(_0x4f2998){_0x21c30d[_0xc660('0x4')](_0x4f9ec5,_0x4f2998);};}function removeListener(_0x27302f,_0x433c1c){return function(){FaxInteractionEvents[_0xc660('0x5')](_0x27302f,_0x433c1c);};}exports['register']=function(_0x5cac03){for(var _0x3e280e=0x0,_0x10116a=events[_0xc660('0x6')];_0x3e280e<_0x10116a;_0x3e280e++){var _0x9f109a=events[_0x3e280e];var _0x264cde=createListener(_0xc660('0x7')+_0x9f109a,_0x5cac03);FaxInteractionEvents['on'](_0x9f109a,_0x264cde);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b3c989e..b2c0dcd 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 _0x5057=['show','/:id/messages','/:id/download','download','post','create','/:id/tags','fax','addTags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2a26da,_0x3dfca3){var _0x59fc7f=function(_0x46c223){while(--_0x46c223){_0x2a26da['push'](_0x2a26da['shift']());}};_0x59fc7f(++_0x3dfca3);}(_0x5057,0x151));var _0x7505=function(_0x36e963,_0x61d1f9){_0x36e963=_0x36e963-0x0;var _0x5e4971=_0x5057[_0x36e963];return _0x5e4971;};'use strict';var multer=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var path=require(_0x7505('0x2'));var timeout=require('connect-timeout');var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require(_0x7505('0x5'));var auth=require(_0x7505('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7505('0x7'));var controller=require(_0x7505('0x8'));router['get']('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0xb')](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router['get'](_0x7505('0xe'),auth['isAuthenticated'](),controller[_0x7505('0xf')]);router[_0x7505('0xb')](_0x7505('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7505('0xb')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/',auth['isAuthenticated'](),controller[_0x7505('0x14')]);router[_0x7505('0x13')]('/:id/messages',auth[_0x7505('0x9')](),controller['addMessage']);router[_0x7505('0x13')](_0x7505('0x15'),auth[_0x7505('0x9')](),interaction['tracked'](_0x7505('0x16'),'faxinteraction:addtags'),controller[_0x7505('0x17')]);router['put'](_0x7505('0xe'),auth['isAuthenticated'](),interaction[_0x7505('0x18')]('fax',_0x7505('0x19')),controller[_0x7505('0x1a')]);router[_0x7505('0x1b')](_0x7505('0xe'),auth[_0x7505('0x9')](),interaction['tracked'](_0x7505('0x16'),_0x7505('0x1c')),controller[_0x7505('0x1d')]);router[_0x7505('0x1b')](_0x7505('0x15'),auth[_0x7505('0x9')](),controller[_0x7505('0x1e')]);module[_0x7505('0x1f')]=router; \ No newline at end of file +var _0x0817=['/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','getMessages'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x0817,0x139));var _0x7081=function(_0x36b8de,_0x303609){_0x36b8de=_0x36b8de-0x0;var _0x249a23=_0x0817[_0x36b8de];return _0x249a23;};'use strict';var multer=require(_0x7081('0x0'));var util=require(_0x7081('0x1'));var path=require(_0x7081('0x2'));var timeout=require(_0x7081('0x3'));var express=require(_0x7081('0x4'));var router=express[_0x7081('0x5')]();var fs_extra=require(_0x7081('0x6'));var auth=require(_0x7081('0x7'));var interaction=require(_0x7081('0x8'));var config=require(_0x7081('0x9'));var controller=require('./faxInteraction.controller');router[_0x7081('0xa')]('/',auth[_0x7081('0xb')](),controller[_0x7081('0xc')]);router[_0x7081('0xa')](_0x7081('0xd'),auth[_0x7081('0xb')](),controller[_0x7081('0xe')]);router[_0x7081('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7081('0xf')]);router[_0x7081('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x7081('0x10')]);router[_0x7081('0xa')](_0x7081('0x11'),auth[_0x7081('0xb')](),controller[_0x7081('0x12')]);router[_0x7081('0x13')]('/',auth[_0x7081('0xb')](),controller['create']);router[_0x7081('0x13')]('/:id/messages',auth[_0x7081('0xb')](),controller[_0x7081('0x14')]);router[_0x7081('0x13')](_0x7081('0x15'),auth['isAuthenticated'](),interaction[_0x7081('0x16')](_0x7081('0x17'),_0x7081('0x18')),controller[_0x7081('0x19')]);router[_0x7081('0x1a')](_0x7081('0x1b'),auth[_0x7081('0xb')](),interaction['tracked'](_0x7081('0x17'),'faxinteraction:update'),controller[_0x7081('0x1c')]);router[_0x7081('0x1d')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x7081('0x17'),_0x7081('0x1e')),controller[_0x7081('0x1f')]);router[_0x7081('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x7081('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 a946c39..dcac6da 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 _0xfa2f=['out','DATE','TEXT','BOOLEAN','ENUM'];(function(_0x59592b,_0x4f8248){var _0x2dfe13=function(_0xbde8fd){while(--_0xbde8fd){_0x59592b['push'](_0x59592b['shift']());}};_0x2dfe13(++_0x4f8248);}(_0xfa2f,0xe8));var _0xffa2=function(_0x7d8aed,_0xd2ef6e){_0x7d8aed=_0x7d8aed-0x0;var _0x3b3cf5=_0xfa2f[_0x7d8aed];return _0x3b3cf5;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xffa2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xffa2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xffa2('0x2')]('in',_0xffa2('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xffa2('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xffa2('0x4')]}}; \ No newline at end of file +var _0xde64=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x481a94,_0x4c1fea){var _0x2a9026=function(_0x235903){while(--_0x235903){_0x481a94['push'](_0x481a94['shift']());}};_0x2a9026(++_0x4c1fea);}(_0xde64,0x17c));var _0x4de6=function(_0xc51073,_0x44bc3b){_0xc51073=_0xc51073-0x0;var _0x52b201=_0xde64[_0xc51073];return _0x52b201;};'use strict';var Sequelize=require(_0x4de6('0x0'));module[_0x4de6('0x1')]={'body':{'type':Sequelize[_0x4de6('0x2')](_0x4de6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4de6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4de6('0x5')]('in','out'),'defaultValue':_0x4de6('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4de6('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 082014f..7b4cc8f 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 _0xa95e=['attachments','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','FaxMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','update','body','describe','fax-interactions','accept','fax','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','QueryTypes','fullname','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files'];(function(_0x48fdf3,_0x3e3ceb){var _0x8b8b9e=function(_0x4fc273){while(--_0x4fc273){_0x48fdf3['push'](_0x48fdf3['shift']());}};_0x8b8b9e(++_0x3e3ceb);}(_0xa95e,0x94));var _0xea95=function(_0x5010f1,_0x41d688){_0x5010f1=_0x5010f1-0x0;var _0x2194a4=_0xa95e[_0x5010f1];return _0x2194a4;};'use strict';var emlformat=require(_0xea95('0x0'));var rimraf=require(_0xea95('0x1'));var zipdir=require(_0xea95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xea95('0x3'));var BPromise=require(_0xea95('0x4'));var Mustache=require(_0xea95('0x5'));var util=require(_0xea95('0x6'));var path=require(_0xea95('0x7'));var sox=require('sox');var csv=require(_0xea95('0x8'));var ejs=require(_0xea95('0x9'));var fs=require('fs');var fs_extra=require(_0xea95('0xa'));var _=require(_0xea95('0xb'));var squel=require('squel');var crypto=require(_0xea95('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea95('0xd'));var toCsv=require(_0xea95('0x8'));var querystring=require('querystring');var Papa=require(_0xea95('0xe'));var Redis=require(_0xea95('0xf'));var authService=require(_0xea95('0x10'));var qs=require(_0xea95('0x11'));var as=require(_0xea95('0x12'));var hardwareService=require(_0xea95('0x13'));var logger=require('../../config/logger')(_0xea95('0x14'));var utils=require(_0xea95('0x15'));var config=require(_0xea95('0x16'));var licenseUtil=require(_0xea95('0x17'));var db=require(_0xea95('0x18'))['db'];config[_0xea95('0x19')]=_[_0xea95('0x1a')](config[_0xea95('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xea95('0x1b'))(new Redis(config[_0xea95('0x19')]));require(_0xea95('0x1c'))[_0xea95('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xea95('0x1e')][_0xea95('0x1f')]({'port':0x232c});var client9002=jayson[_0xea95('0x1e')][_0xea95('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x357db0,_0x3d9946,_0x4a7d96,_0x5e354b){return new BPromise(function(_0x135b9b,_0x356eda){var _0x5ae5e6=_0x5e354b||client;return _0x5ae5e6[_0xea95('0x20')](_0x357db0,_0x4a7d96)['then'](function(_0x2da676){logger[_0xea95('0x21')](_0xea95('0x22'),_0x3d9946,_0xea95('0x23'));logger['debug'](_0xea95('0x24'),_0x3d9946,_0xea95('0x23'),JSON['stringify'](_0x2da676));if(_0x2da676[_0xea95('0x25')]){if(_0x2da676[_0xea95('0x25')][_0xea95('0x26')]===0x1f4){logger[_0xea95('0x25')](_0xea95('0x22'),_0x3d9946,_0x2da676[_0xea95('0x25')][_0xea95('0x27')]);return _0x356eda(_0x2da676[_0xea95('0x25')]['message']);}logger[_0xea95('0x25')](_0xea95('0x22'),_0x3d9946,_0x2da676[_0xea95('0x25')][_0xea95('0x27')]);return _0x135b9b(_0x2da676[_0xea95('0x25')][_0xea95('0x27')]);}else{logger[_0xea95('0x21')](_0xea95('0x22'),_0x3d9946,'request\x20sent');_0x135b9b(_0x2da676[_0xea95('0x28')][_0xea95('0x27')]);}})[_0xea95('0x29')](function(_0x8334d6){logger[_0xea95('0x25')](_0xea95('0x22'),_0x3d9946,_0x8334d6);_0x356eda(_0x8334d6);});});}function respondWithStatusCode(_0x1526db,_0x5a931b){_0x5a931b=_0x5a931b||0xcc;return function(_0x212c25){if(_0x212c25){return _0x1526db[_0xea95('0x2a')](_0x5a931b);}return _0x1526db[_0xea95('0x2b')](_0x5a931b)[_0xea95('0x2c')]();};}function respondWithResult(_0x491efb,_0x2db1a3){_0x2db1a3=_0x2db1a3||0xc8;return function(_0x20e0e3){if(_0x20e0e3){return _0x491efb[_0xea95('0x2b')](_0x2db1a3)[_0xea95('0x2d')](_0x20e0e3);}};}function respondWithFilteredResult(_0xa107e4,_0x15ce70){return function(_0x2bd700){if(_0x2bd700){var _0x458ca2=typeof _0x15ce70[_0xea95('0x2e')]===_0xea95('0x2f')&&typeof _0x15ce70[_0xea95('0x30')]===_0xea95('0x2f');var _0x216ec0=_0x2bd700[_0xea95('0x31')];var _0xb4b084=_0x458ca2?0x0:_0x15ce70['offset'];var _0x3ab7ad=_0x458ca2?_0x2bd700[_0xea95('0x31')]:_0x15ce70[_0xea95('0x2e')]+_0x15ce70['limit'];var _0x56c872;if(_0x3ab7ad>=_0x216ec0){_0x3ab7ad=_0x216ec0;_0x56c872=0xc8;}else{_0x56c872=0xce;}_0xa107e4['status'](_0x56c872);return _0xa107e4[_0xea95('0x32')](_0xea95('0x33'),_0xb4b084+'-'+_0x3ab7ad+'/'+_0x216ec0)[_0xea95('0x2d')](_0x2bd700);}return null;};}function patchUpdates(_0x13ec50){return function(_0x2a9d1f){try{jsonpatch[_0xea95('0x34')](_0x2a9d1f,_0x13ec50,!![]);}catch(_0x7397d5){return BPromise[_0xea95('0x35')](_0x7397d5);}return _0x2a9d1f[_0xea95('0x36')]();};}function saveUpdates(_0x49abc9,_0x3827d4){return function(_0x40f0ff){if(_0x40f0ff){return _0x40f0ff['update'](_0x49abc9)[_0xea95('0x37')](function(_0x3a6e6c){return _0x3a6e6c;});}return null;};}function removeEntity(_0x1c4164,_0x1d10ba){return function(_0x5cb866){if(_0x5cb866){return _0x5cb866[_0xea95('0x38')]()[_0xea95('0x37')](function(){_0x1c4164[_0xea95('0x2b')](0xcc)[_0xea95('0x2c')]();});}};}function handleEntityNotFound(_0x2b5fe3,_0x4776e3){return function(_0x50d5a0){if(!_0x50d5a0){_0x2b5fe3[_0xea95('0x2a')](0x194);}return _0x50d5a0;};}function handleError(_0x192d44,_0x48dd4a){_0x48dd4a=_0x48dd4a||0x1f4;return function(_0x227262){logger[_0xea95('0x25')](_0x227262[_0xea95('0x39')]);if(_0x227262[_0xea95('0x3a')]){delete _0x227262['name'];}_0x192d44[_0xea95('0x2b')](_0x48dd4a)[_0xea95('0x3b')](_0x227262);};}exports['index']=function(_0xbe073a,_0x1b1248){var _0x270aff={},_0x3ae177={},_0x5e06ce={'count':0x0,'rows':[]};var _0x48c2f1=_[_0xea95('0x3c')](db[_0xea95('0x3d')][_0xea95('0x3e')],function(_0xeb8caa){return{'name':_0xeb8caa[_0xea95('0x3f')],'type':_0xeb8caa['type']['key']};});_0x3ae177[_0xea95('0x40')]=_[_0xea95('0x3c')](_0x48c2f1,_0xea95('0x3a'));_0x3ae177['query']=_[_0xea95('0x41')](_0xbe073a[_0xea95('0x42')]);_0x3ae177[_0xea95('0x43')]=_[_0xea95('0x44')](_0x3ae177[_0xea95('0x40')],_0x3ae177[_0xea95('0x42')]);_0x270aff[_0xea95('0x45')]=_[_0xea95('0x44')](_0x3ae177[_0xea95('0x40')],qs[_0xea95('0x46')](_0xbe073a[_0xea95('0x42')]['fields']));_0x270aff['attributes']=_0x270aff[_0xea95('0x45')]['length']?_0x270aff['attributes']:_0x3ae177['model'];if(!_0xbe073a['query'][_0xea95('0x47')](_0xea95('0x48'))){_0x270aff[_0xea95('0x30')]=qs[_0xea95('0x30')](_0xbe073a[_0xea95('0x42')][_0xea95('0x30')]);_0x270aff[_0xea95('0x2e')]=qs[_0xea95('0x2e')](_0xbe073a[_0xea95('0x42')][_0xea95('0x2e')]);}_0x270aff[_0xea95('0x49')]=qs[_0xea95('0x4a')](_0xbe073a[_0xea95('0x42')][_0xea95('0x4a')]);_0x270aff[_0xea95('0x4b')]=qs[_0xea95('0x43')](_[_0xea95('0x4c')](_0xbe073a[_0xea95('0x42')],_0x3ae177['filters']),_0x48c2f1);if(_0xbe073a[_0xea95('0x42')]['filter']){_0x270aff[_0xea95('0x4b')]=_[_0xea95('0x4d')](_0x270aff['where'],{'$or':_[_0xea95('0x3c')](_0x48c2f1,function(_0x4ed882){if(_0x4ed882[_0xea95('0x4e')]!==_0xea95('0x4f')){var _0x16015a={};_0x16015a[_0x4ed882[_0xea95('0x3a')]]={'$like':'%'+_0xbe073a[_0xea95('0x42')][_0xea95('0x50')]+'%'};return _0x16015a;}})});}_0x270aff=_[_0xea95('0x4d')]({},_0x270aff,_0xbe073a[_0xea95('0x51')]);var _0x56617f={'where':_0x270aff[_0xea95('0x4b')]};return db[_0xea95('0x3d')]['count'](_0x56617f)['then'](function(_0x41d63b){_0x5e06ce[_0xea95('0x31')]=_0x41d63b;if(_0xbe073a[_0xea95('0x42')][_0xea95('0x52')]){_0x270aff[_0xea95('0x53')]=[{'all':!![]}];}return db[_0xea95('0x3d')][_0xea95('0x54')](_0x270aff);})[_0xea95('0x37')](function(_0x29fb35){_0x5e06ce[_0xea95('0x55')]=_0x29fb35;return _0x5e06ce;})[_0xea95('0x37')](respondWithFilteredResult(_0x1b1248,_0x270aff))[_0xea95('0x29')](handleError(_0x1b1248,null));};exports['show']=function(_0x48b76e,_0x5b025e){var _0x431186={'raw':!![],'where':{'id':_0x48b76e[_0xea95('0x56')]['id']}},_0x25f4f1={};_0x25f4f1[_0xea95('0x40')]=_[_0xea95('0x41')](db[_0xea95('0x3d')][_0xea95('0x3e')]);_0x25f4f1['query']=_['keys'](_0x48b76e[_0xea95('0x42')]);_0x25f4f1[_0xea95('0x43')]=_[_0xea95('0x44')](_0x25f4f1[_0xea95('0x40')],_0x25f4f1[_0xea95('0x42')]);_0x431186[_0xea95('0x45')]=_[_0xea95('0x44')](_0x25f4f1[_0xea95('0x40')],qs['fields'](_0x48b76e[_0xea95('0x42')]['fields']));_0x431186[_0xea95('0x45')]=_0x431186['attributes'][_0xea95('0x57')]?_0x431186[_0xea95('0x45')]:_0x25f4f1['model'];if(_0x48b76e[_0xea95('0x42')][_0xea95('0x52')]){_0x431186[_0xea95('0x53')]=[{'all':!![]}];}_0x431186=_[_0xea95('0x4d')]({},_0x431186,_0x48b76e['options']);return db[_0xea95('0x3d')][_0xea95('0x58')](_0x431186)[_0xea95('0x37')](handleEntityNotFound(_0x5b025e,null))[_0xea95('0x37')](respondWithResult(_0x5b025e,null))['catch'](handleError(_0x5b025e,null));};exports[_0xea95('0x59')]=function(_0x2126f9,_0x59ce61){if(_0x2126f9['body']['id']){delete _0x2126f9[_0xea95('0x5a')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x2126f9[_0xea95('0x56')]['id']}})[_0xea95('0x37')](handleEntityNotFound(_0x59ce61,null))[_0xea95('0x37')](saveUpdates(_0x2126f9[_0xea95('0x5a')],null))['then'](respondWithResult(_0x59ce61,null))[_0xea95('0x29')](handleError(_0x59ce61,null));};exports[_0xea95('0x38')]=function(_0x21df70,_0x3d7b4a){return db['FaxMessage'][_0xea95('0x58')]({'where':{'id':_0x21df70[_0xea95('0x56')]['id']}})[_0xea95('0x37')](handleEntityNotFound(_0x3d7b4a,null))['then'](removeEntity(_0x3d7b4a,null))[_0xea95('0x29')](handleError(_0x3d7b4a,null));};exports[_0xea95('0x5b')]=function(_0x20a5ee,_0x47b1b0){return db[_0xea95('0x3d')][_0xea95('0x5b')]()[_0xea95('0x37')](respondWithResult(_0x47b1b0,null))['catch'](handleError(_0x47b1b0,null));};var interaction_log=require('../../config/logger')(_0xea95('0x5c'));exports[_0xea95('0x5d')]=function(_0x4e2e15,_0x4384e6,_0x108830){var _0x47b791={'agent':{},'channel':_0xea95('0x5e')};if(_0x4e2e15[_0xea95('0x5a')]['id']){delete _0x4e2e15['body']['id'];}_0x4e2e15[_0xea95('0x5a')]['read']=!![];_0x4e2e15['body'][_0xea95('0x5f')]=moment()[_0xea95('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e2e15[_0xea95('0x5a')][_0xea95('0x61')]=_0x4e2e15['body'][_0xea95('0x61')]||_0x4e2e15[_0xea95('0x62')]['id'];_0x47b791[_0xea95('0x63')]['id']=_0x4e2e15['body'][_0xea95('0x61')];return db[_0xea95('0x3d')][_0xea95('0x58')]({'where':{'id':_0x4e2e15[_0xea95('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4384e6,null))[_0xea95('0x37')](saveUpdates(_0x4e2e15[_0xea95('0x5a')],null))[_0xea95('0x37')](function(_0x3acbb2){if(_0x3acbb2){_0x47b791[_0xea95('0x27')]=_0x3acbb2[_0xea95('0x64')]({'plain':!![]});return db[_0xea95('0x65')][_0xea95('0x58')]({'where':{'id':_0x3acbb2[_0xea95('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4384e6,null))[_0xea95('0x37')](function(_0x53d600){if(_0x53d600){return _0x53d600[_0xea95('0x59')]({'UserId':_0x4e2e15[_0xea95('0x5a')][_0xea95('0x61')],'read1stAt':_[_0xea95('0x67')](_0x53d600[_0xea95('0x68')])?moment()['format'](_0xea95('0x69')):undefined});}return null;})['then'](function(_0x3bf73a){if(_0x3bf73a){_0x47b791[_0xea95('0x6a')]=_0x3bf73a[_0xea95('0x64')]({'plain':!![]});interaction_log[_0xea95('0x21')](_0xea95('0x6b'),_0x4e2e15[_0xea95('0x62')]['id'],_0x4e2e15[_0xea95('0x62')]['name'],_0x4e2e15[_0xea95('0x62')]['role'],_0x47b791['interaction']['id'],_0x4e2e15[_0xea95('0x5a')]?JSON['stringify'](_0x4e2e15['body']):'null');return respondWithRpcPromise(_0xea95('0x6c'),'acceptMessage',_0x47b791);}return null;})[_0xea95('0x37')](function(_0x22f2b1){var _0x467a66=_0xea95('0x6d')+_0x22f2b1[_0xea95('0x27')]['ContactId'];return db[_0xea95('0x6e')][_0xea95('0x42')](_0x467a66,{'type':db[_0xea95('0x6f')]['QueryTypes'][_0xea95('0x70')],'raw':!![]})[_0xea95('0x37')](function(_0x3d4717){return _0x3d4717;});})['then'](function(_0x5beb15){if(_0x5beb15){_0x47b791['message'][_0xea95('0x71')]=_0x5beb15[0x0];if(!_0x4e2e15[_0xea95('0x5a')][_0xea95('0x61')])return;return db['User'][_0xea95('0x58')]({'where':{'id':_0x4e2e15[_0xea95('0x5a')][_0xea95('0x61')],'role':_0xea95('0x63')},'attributes':['id',_0xea95('0x3a'),'fullname',_0xea95('0x72'),_0xea95('0x73')],'raw':!![]});}return null;})[_0xea95('0x37')](function(_0x7fcef1){if(!_0x7fcef1)return null;_0x47b791['message'][_0xea95('0x63')]=_0x7fcef1;return _0x47b791;})[_0xea95('0x37')](function(_0x24fb1c){if(_0x24fb1c){if(_0x4e2e15['body'][_0xea95('0x74')]){_0x47b791['message'][_0xea95('0x75')]=util[_0xea95('0x60')](_0xea95('0x76'),_0x4e2e15[_0xea95('0x62')][_0xea95('0x3a')]);_0x47b791[_0xea95('0x27')][_0xea95('0x77')]=_0x47b791[_0xea95('0x77')];_0x47b791['message'][_0xea95('0x78')]=_0x47b791[_0xea95('0x77')];_0x47b791[_0xea95('0x27')][_0xea95('0x79')]=_0xea95('0x5d');return respondWithRpcPromise(_0xea95('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x47b791[_0xea95('0x27')]},client9002)[_0xea95('0x37')](function(){return _0x47b791;});}return _0x47b791;}return null;})[_0xea95('0x37')](respondWithResult(_0x4384e6,null))[_0xea95('0x29')](handleError(_0x4384e6,null));};var interaction_log=require(_0xea95('0x7b'))(_0xea95('0x5c'));exports['reject']=function(_0xf55294,_0x3a3ac2,_0x2d8408){var _0x18107b={'agent':{},'channel':'fax'};if(_0xf55294[_0xea95('0x5a')]['id']){delete _0xf55294['body']['id'];}_0xf55294[_0xea95('0x5a')]['UserId']=_0xf55294['body'][_0xea95('0x61')]||_0xf55294[_0xea95('0x62')]['id'];_0x18107b[_0xea95('0x63')]['id']=_0xf55294[_0xea95('0x5a')][_0xea95('0x61')];return db[_0xea95('0x3d')][_0xea95('0x58')]({'where':{'id':_0xf55294[_0xea95('0x56')]['id'],'UserId':null}})[_0xea95('0x37')](handleEntityNotFound(_0x3a3ac2,null))['then'](function(_0x33db4d){if(_0x33db4d){_0x18107b[_0xea95('0x27')]=_0x33db4d[_0xea95('0x64')]({'plain':!![]});return db[_0xea95('0x65')]['find']({'where':{'id':_0x33db4d['FaxInteractionId']}});}return null;})[_0xea95('0x37')](handleEntityNotFound(_0x3a3ac2,null))[_0xea95('0x37')](function(_0xb4e4f5){if(_0xb4e4f5){_0x18107b[_0xea95('0x6a')]=_0xb4e4f5[_0xea95('0x64')]({'plain':!![]});interaction_log[_0xea95('0x21')](_0xea95('0x7c'),_0xf55294['user']['id'],_0xf55294[_0xea95('0x62')][_0xea95('0x3a')],_0xf55294['user']['role'],_0x18107b[_0xea95('0x6a')]['id'],_0xf55294['body']?JSON[_0xea95('0x7d')](_0xf55294[_0xea95('0x5a')]):_0xea95('0x7e'));return respondWithRpcPromise('RejectMessage',_0xea95('0x7f'),_0x18107b);}return null;})[_0xea95('0x37')](function(_0x18087){var _0x157d3f=_0xea95('0x6d')+_0x18087[_0xea95('0x27')]['ContactId'];return db[_0xea95('0x6e')]['query'](_0x157d3f,{'type':db['Sequelize'][_0xea95('0x80')][_0xea95('0x70')],'raw':!![]})[_0xea95('0x37')](function(_0xb0db38){return _0xb0db38;});})[_0xea95('0x37')](function(_0x34b37a){if(_0x34b37a){_0x18107b[_0xea95('0x27')]['contact']=_0x34b37a[0x0];if(!_0xf55294[_0xea95('0x5a')][_0xea95('0x61')])return;return db['User']['find']({'where':{'id':_0xf55294[_0xea95('0x5a')][_0xea95('0x61')],'role':_0xea95('0x63')},'attributes':['id',_0xea95('0x3a'),_0xea95('0x81'),'email',_0xea95('0x73')],'raw':!![]});}return null;})[_0xea95('0x37')](function(_0x5650f4){if(!_0x5650f4)return null;_0x18107b[_0xea95('0x27')][_0xea95('0x63')]=_0x5650f4;return _0x18107b;})[_0xea95('0x37')](function(_0x15f54d){if(_0x15f54d){_0x15f54d['message'][_0xea95('0x75')]=util[_0xea95('0x60')](_0xea95('0x76'),_0xf55294[_0xea95('0x62')][_0xea95('0x3a')]);_0x15f54d[_0xea95('0x27')][_0xea95('0x77')]=_0x18107b[_0xea95('0x77')];_0x15f54d[_0xea95('0x27')][_0xea95('0x78')]=_0x18107b[_0xea95('0x77')];_0x15f54d['message'][_0xea95('0x79')]='reject';respondWithRpcPromise(_0xea95('0x7a'),'EventManager',{'event':_0xea95('0x82'),'message':_0x15f54d[_0xea95('0x27')]},client9002);return _0x18107b;}return null;})[_0xea95('0x37')](respondWithResult(_0x3a3ac2,null))[_0xea95('0x29')](handleError(_0x3a3ac2,null));};exports[_0xea95('0x83')]=function(_0x4f6328,_0xa3b2){var _0x39e660;return db[_0xea95('0x3d')][_0xea95('0x83')](_0x4f6328[_0xea95('0x5a')],{})[_0xea95('0x37')](function(_0x415b93){_0x39e660=_0x415b93;return db[_0xea95('0x84')][_0xea95('0x85')]({'where':{'id':_0x39e660[_0xea95('0x86')]}});})[_0xea95('0x37')](function(_0x87516c){if(_[_0xea95('0x67')](_0x87516c)){return;}else{_0x39e660[_0xea95('0x5e')]=_0x87516c[_0xea95('0x5e')];return db[_0xea95('0x87')][_0xea95('0x85')]({'where':{'id':_0x39e660[_0xea95('0x88')]}});}})[_0xea95('0x37')](function(_0x4d5a84){return respondWithRpcPromise(_0xea95('0x89'),_0xea95('0x89'),{'FaxAccountId':_[_0xea95('0x67')](_0x4f6328[_0xea95('0x5a')])?undefined:_0x4f6328[_0xea95('0x5a')][_0xea95('0x8a')],'path':_[_0xea95('0x67')](_0x4d5a84)?undefined:util[_0xea95('0x60')](_0xea95('0x8b'),_0x4d5a84[_0xea95('0x8c')]),'fax':_[_0xea95('0x67')](_0x39e660[_0xea95('0x5e')])?undefined:_0x39e660[_0xea95('0x5e')],'AttachmentId':_0x39e660[_0xea95('0x88')]},client9002);})[_0xea95('0x37')](respondWithResult(_0xa3b2,0xc9))[_0xea95('0x29')](handleError(_0xa3b2,null));};exports['download']=function(_0x196f46,_0x4cfa41){var _0x3c344b=path[_0xea95('0x8d')](config['root'],_0xea95('0x8e'),_0xea95('0x8f'),_0xea95('0x90'));return db['FaxMessage'][_0xea95('0x58')]({'where':{'id':_0x196f46[_0xea95('0x56')]['id']},'include':[{'model':db[_0xea95('0x87')],'as':'Attachment'}]})[_0xea95('0x37')](handleEntityNotFound(_0x4cfa41,null))[_0xea95('0x37')](function(_0x4f5c0d){if(_0x4f5c0d){return _0x4cfa41[_0xea95('0x91')](path[_0xea95('0x8d')](_0x3c344b,_0x4f5c0d['Attachment']['basename']));}})['catch'](handleError(_0x4cfa41,null));}; \ No newline at end of file +var _0x90d1=['isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','server','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','localhost','redis','./faxMessage.socket','client','http','request','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','merge','where','map','VIRTUAL','options','FaxMessage','findAll','catch','show','keys','rawAttributes','length','include','find','body','params','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','read1stAt','interaction','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','RejectMessage','rejectMessage','User','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax'];(function(_0x35f1d0,_0x2741bd){var _0x2ab802=function(_0x416c33){while(--_0x416c33){_0x35f1d0['push'](_0x35f1d0['shift']());}};_0x2ab802(++_0x2741bd);}(_0x90d1,0x121));var _0x190d=function(_0x42653f,_0x531aed){_0x42653f=_0x42653f-0x0;var _0x55185f=_0x90d1[_0x42653f];return _0x55185f;};'use strict';var emlformat=require(_0x190d('0x0'));var rimraf=require(_0x190d('0x1'));var zipdir=require(_0x190d('0x2'));var jsonpatch=require(_0x190d('0x3'));var rp=require('request-promise');var moment=require(_0x190d('0x4'));var BPromise=require(_0x190d('0x5'));var Mustache=require(_0x190d('0x6'));var util=require(_0x190d('0x7'));var path=require(_0x190d('0x8'));var sox=require(_0x190d('0x9'));var csv=require(_0x190d('0xa'));var ejs=require(_0x190d('0xb'));var fs=require('fs');var fs_extra=require(_0x190d('0xc'));var _=require(_0x190d('0xd'));var squel=require(_0x190d('0xe'));var crypto=require(_0x190d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x190d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x190d('0x11'));var Papa=require(_0x190d('0x12'));var Redis=require(_0x190d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x190d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x190d('0x15'))(_0x190d('0x16'));var utils=require(_0x190d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x190d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x190d('0x19')]));require(_0x190d('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x190d('0x1b')][_0x190d('0x1c')]({'port':0x232c});var client9002=jayson[_0x190d('0x1b')][_0x190d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3936bc,_0x3cb7bb,_0x631c07,_0x3d30a9){return new BPromise(function(_0xa0f0ea,_0x234780){var _0xbedca=_0x3d30a9||client;return _0xbedca[_0x190d('0x1d')](_0x3936bc,_0x631c07)['then'](function(_0x485fba){logger[_0x190d('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3cb7bb,'request\x20sent');logger[_0x190d('0x1f')](_0x190d('0x20'),_0x3cb7bb,'request\x20sent',JSON['stringify'](_0x485fba));if(_0x485fba[_0x190d('0x21')]){if(_0x485fba['error'][_0x190d('0x22')]===0x1f4){logger[_0x190d('0x21')](_0x190d('0x23'),_0x3cb7bb,_0x485fba['error']['message']);return _0x234780(_0x485fba[_0x190d('0x21')][_0x190d('0x24')]);}logger[_0x190d('0x21')](_0x190d('0x23'),_0x3cb7bb,_0x485fba[_0x190d('0x21')]['message']);return _0xa0f0ea(_0x485fba['error'][_0x190d('0x24')]);}else{logger[_0x190d('0x1e')](_0x190d('0x23'),_0x3cb7bb,_0x190d('0x25'));_0xa0f0ea(_0x485fba[_0x190d('0x26')][_0x190d('0x24')]);}})['catch'](function(_0x5277e1){logger['error'](_0x190d('0x23'),_0x3cb7bb,_0x5277e1);_0x234780(_0x5277e1);});});}function respondWithStatusCode(_0x501766,_0xf279af){_0xf279af=_0xf279af||0xcc;return function(_0x2ffe7c){if(_0x2ffe7c){return _0x501766[_0x190d('0x27')](_0xf279af);}return _0x501766[_0x190d('0x28')](_0xf279af)['end']();};}function respondWithResult(_0x5cf240,_0x3437fa){_0x3437fa=_0x3437fa||0xc8;return function(_0x94fad){if(_0x94fad){return _0x5cf240[_0x190d('0x28')](_0x3437fa)[_0x190d('0x29')](_0x94fad);}};}function respondWithFilteredResult(_0x3bb40b,_0x5966f2){return function(_0x42673f){if(_0x42673f){var _0x41ef1f=typeof _0x5966f2['offset']==='undefined'&&typeof _0x5966f2['limit']===_0x190d('0x2a');var _0x1cc5be=_0x42673f[_0x190d('0x2b')];var _0xec838e=_0x41ef1f?0x0:_0x5966f2[_0x190d('0x2c')];var _0x1d4c54=_0x41ef1f?_0x42673f[_0x190d('0x2b')]:_0x5966f2[_0x190d('0x2c')]+_0x5966f2['limit'];var _0x37e1d1;if(_0x1d4c54>=_0x1cc5be){_0x1d4c54=_0x1cc5be;_0x37e1d1=0xc8;}else{_0x37e1d1=0xce;}_0x3bb40b['status'](_0x37e1d1);return _0x3bb40b['set'](_0x190d('0x2d'),_0xec838e+'-'+_0x1d4c54+'/'+_0x1cc5be)['json'](_0x42673f);}return null;};}function patchUpdates(_0x230c2f){return function(_0x1690cc){try{jsonpatch[_0x190d('0x2e')](_0x1690cc,_0x230c2f,!![]);}catch(_0xd934cd){return BPromise[_0x190d('0x2f')](_0xd934cd);}return _0x1690cc[_0x190d('0x30')]();};}function saveUpdates(_0x50f0a3,_0x627d27){return function(_0x385b8c){if(_0x385b8c){return _0x385b8c[_0x190d('0x31')](_0x50f0a3)[_0x190d('0x32')](function(_0x2f6d98){return _0x2f6d98;});}return null;};}function removeEntity(_0x2437a1,_0x5661b0){return function(_0x435ec3){if(_0x435ec3){return _0x435ec3[_0x190d('0x33')]()[_0x190d('0x32')](function(){_0x2437a1['status'](0xcc)[_0x190d('0x34')]();});}};}function handleEntityNotFound(_0x501442,_0x5516d1){return function(_0x52aa91){if(!_0x52aa91){_0x501442[_0x190d('0x27')](0x194);}return _0x52aa91;};}function handleError(_0x548261,_0x486754){_0x486754=_0x486754||0x1f4;return function(_0x424c7d){logger['error'](_0x424c7d[_0x190d('0x35')]);if(_0x424c7d[_0x190d('0x36')]){delete _0x424c7d['name'];}_0x548261[_0x190d('0x28')](_0x486754)[_0x190d('0x37')](_0x424c7d);};}exports[_0x190d('0x38')]=function(_0x4c4839,_0x14518e){var _0x37b864={},_0x318426={},_0x596da0={'count':0x0,'rows':[]};var _0x403a5d=_['map'](db['FaxMessage']['rawAttributes'],function(_0xfdf7af){return{'name':_0xfdf7af[_0x190d('0x39')],'type':_0xfdf7af[_0x190d('0x3a')][_0x190d('0x3b')]};});_0x318426[_0x190d('0x3c')]=_['map'](_0x403a5d,_0x190d('0x36'));_0x318426['query']=_['keys'](_0x4c4839[_0x190d('0x3d')]);_0x318426['filters']=_[_0x190d('0x3e')](_0x318426[_0x190d('0x3c')],_0x318426[_0x190d('0x3d')]);_0x37b864['attributes']=_[_0x190d('0x3e')](_0x318426['model'],qs[_0x190d('0x3f')](_0x4c4839[_0x190d('0x3d')][_0x190d('0x3f')]));_0x37b864[_0x190d('0x40')]=_0x37b864[_0x190d('0x40')]['length']?_0x37b864[_0x190d('0x40')]:_0x318426['model'];if(!_0x4c4839[_0x190d('0x3d')][_0x190d('0x41')](_0x190d('0x42'))){_0x37b864[_0x190d('0x43')]=qs[_0x190d('0x43')](_0x4c4839[_0x190d('0x3d')][_0x190d('0x43')]);_0x37b864[_0x190d('0x2c')]=qs[_0x190d('0x2c')](_0x4c4839[_0x190d('0x3d')][_0x190d('0x2c')]);}_0x37b864[_0x190d('0x44')]=qs['sort'](_0x4c4839[_0x190d('0x3d')][_0x190d('0x45')]);_0x37b864['where']=qs['filters'](_[_0x190d('0x46')](_0x4c4839[_0x190d('0x3d')],_0x318426[_0x190d('0x47')]),_0x403a5d);if(_0x4c4839[_0x190d('0x3d')][_0x190d('0x48')]){_0x37b864['where']=_[_0x190d('0x49')](_0x37b864[_0x190d('0x4a')],{'$or':_[_0x190d('0x4b')](_0x403a5d,function(_0x311e33){if(_0x311e33[_0x190d('0x3a')]!==_0x190d('0x4c')){var _0x47e751={};_0x47e751[_0x311e33[_0x190d('0x36')]]={'$like':'%'+_0x4c4839[_0x190d('0x3d')]['filter']+'%'};return _0x47e751;}})});}_0x37b864=_['merge']({},_0x37b864,_0x4c4839[_0x190d('0x4d')]);var _0x50d723={'where':_0x37b864['where']};return db[_0x190d('0x4e')][_0x190d('0x2b')](_0x50d723)[_0x190d('0x32')](function(_0x406ef7){_0x596da0['count']=_0x406ef7;if(_0x4c4839[_0x190d('0x3d')]['includeAll']){_0x37b864['include']=[{'all':!![]}];}return db[_0x190d('0x4e')][_0x190d('0x4f')](_0x37b864);})[_0x190d('0x32')](function(_0x5003e4){_0x596da0['rows']=_0x5003e4;return _0x596da0;})[_0x190d('0x32')](respondWithFilteredResult(_0x14518e,_0x37b864))[_0x190d('0x50')](handleError(_0x14518e,null));};exports[_0x190d('0x51')]=function(_0x20e09d,_0x200211){var _0x5afae9={'raw':!![],'where':{'id':_0x20e09d['params']['id']}},_0x58b859={};_0x58b859['model']=_[_0x190d('0x52')](db[_0x190d('0x4e')][_0x190d('0x53')]);_0x58b859[_0x190d('0x3d')]=_[_0x190d('0x52')](_0x20e09d[_0x190d('0x3d')]);_0x58b859[_0x190d('0x47')]=_[_0x190d('0x3e')](_0x58b859[_0x190d('0x3c')],_0x58b859[_0x190d('0x3d')]);_0x5afae9[_0x190d('0x40')]=_[_0x190d('0x3e')](_0x58b859[_0x190d('0x3c')],qs['fields'](_0x20e09d[_0x190d('0x3d')][_0x190d('0x3f')]));_0x5afae9[_0x190d('0x40')]=_0x5afae9[_0x190d('0x40')][_0x190d('0x54')]?_0x5afae9[_0x190d('0x40')]:_0x58b859['model'];if(_0x20e09d[_0x190d('0x3d')]['includeAll']){_0x5afae9[_0x190d('0x55')]=[{'all':!![]}];}_0x5afae9=_[_0x190d('0x49')]({},_0x5afae9,_0x20e09d[_0x190d('0x4d')]);return db[_0x190d('0x4e')][_0x190d('0x56')](_0x5afae9)['then'](handleEntityNotFound(_0x200211,null))[_0x190d('0x32')](respondWithResult(_0x200211,null))[_0x190d('0x50')](handleError(_0x200211,null));};exports[_0x190d('0x31')]=function(_0x5135a0,_0x2ff967){if(_0x5135a0['body']['id']){delete _0x5135a0[_0x190d('0x57')]['id'];}return db[_0x190d('0x4e')][_0x190d('0x56')]({'where':{'id':_0x5135a0[_0x190d('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ff967,null))[_0x190d('0x32')](saveUpdates(_0x5135a0[_0x190d('0x57')],null))[_0x190d('0x32')](respondWithResult(_0x2ff967,null))[_0x190d('0x50')](handleError(_0x2ff967,null));};exports[_0x190d('0x33')]=function(_0x69bb37,_0x2dcc95){return db[_0x190d('0x4e')][_0x190d('0x56')]({'where':{'id':_0x69bb37[_0x190d('0x58')]['id']}})[_0x190d('0x32')](handleEntityNotFound(_0x2dcc95,null))[_0x190d('0x32')](removeEntity(_0x2dcc95,null))[_0x190d('0x50')](handleError(_0x2dcc95,null));};exports[_0x190d('0x59')]=function(_0x5811d2,_0x3ade4a){return db[_0x190d('0x4e')][_0x190d('0x59')]()[_0x190d('0x32')](respondWithResult(_0x3ade4a,null))[_0x190d('0x50')](handleError(_0x3ade4a,null));};var interaction_log=require(_0x190d('0x15'))(_0x190d('0x5a'));exports[_0x190d('0x5b')]=function(_0x993cef,_0x52b87a,_0xcd39e2){var _0x207fbf={'agent':{},'channel':_0x190d('0x5c')};if(_0x993cef[_0x190d('0x57')]['id']){delete _0x993cef[_0x190d('0x57')]['id'];}_0x993cef[_0x190d('0x57')][_0x190d('0x5d')]=!![];_0x993cef['body'][_0x190d('0x5e')]=moment()[_0x190d('0x5f')](_0x190d('0x60'));_0x993cef[_0x190d('0x57')][_0x190d('0x61')]=_0x993cef[_0x190d('0x57')][_0x190d('0x61')]||_0x993cef[_0x190d('0x62')]['id'];_0x207fbf['agent']['id']=_0x993cef[_0x190d('0x57')][_0x190d('0x61')];return db[_0x190d('0x4e')][_0x190d('0x56')]({'where':{'id':_0x993cef[_0x190d('0x58')]['id'],'UserId':null}})[_0x190d('0x32')](handleEntityNotFound(_0x52b87a,null))[_0x190d('0x32')](saveUpdates(_0x993cef[_0x190d('0x57')],null))['then'](function(_0x7570fe){if(_0x7570fe){_0x207fbf[_0x190d('0x24')]=_0x7570fe[_0x190d('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x7570fe[_0x190d('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x52b87a,null))[_0x190d('0x32')](function(_0x3f3914){if(_0x3f3914){return _0x3f3914[_0x190d('0x31')]({'UserId':_0x993cef['body'][_0x190d('0x61')],'read1stAt':_['isNil'](_0x3f3914[_0x190d('0x65')])?moment()[_0x190d('0x5f')](_0x190d('0x60')):undefined});}return null;})['then'](function(_0x30a026){if(_0x30a026){_0x207fbf[_0x190d('0x66')]=_0x30a026[_0x190d('0x63')]({'plain':!![]});interaction_log[_0x190d('0x1e')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x993cef['user']['id'],_0x993cef[_0x190d('0x62')][_0x190d('0x36')],_0x993cef['user'][_0x190d('0x67')],_0x207fbf[_0x190d('0x66')]['id'],_0x993cef[_0x190d('0x57')]?JSON[_0x190d('0x68')](_0x993cef[_0x190d('0x57')]):'null');return respondWithRpcPromise(_0x190d('0x69'),_0x190d('0x6a'),_0x207fbf);}return null;})[_0x190d('0x32')](function(_0x4a6ffd){var _0x30d966=_0x190d('0x6b')+_0x4a6ffd[_0x190d('0x24')][_0x190d('0x6c')];return db[_0x190d('0x6d')][_0x190d('0x3d')](_0x30d966,{'type':db[_0x190d('0x6e')][_0x190d('0x6f')][_0x190d('0x70')],'raw':!![]})['then'](function(_0x150b22){return _0x150b22;});})['then'](function(_0x5f18d6){if(_0x5f18d6){_0x207fbf[_0x190d('0x24')][_0x190d('0x71')]=_0x5f18d6[0x0];if(!_0x993cef[_0x190d('0x57')][_0x190d('0x61')])return;return db['User'][_0x190d('0x56')]({'where':{'id':_0x993cef['body'][_0x190d('0x61')],'role':'agent'},'attributes':['id',_0x190d('0x36'),_0x190d('0x72'),_0x190d('0x73'),_0x190d('0x74')],'raw':!![]});}return null;})[_0x190d('0x32')](function(_0x4a43bc){if(!_0x4a43bc)return null;_0x207fbf[_0x190d('0x24')][_0x190d('0x75')]=_0x4a43bc;return _0x207fbf;})[_0x190d('0x32')](function(_0x23e042){if(_0x23e042){if(_0x993cef[_0x190d('0x57')][_0x190d('0x76')]){_0x207fbf[_0x190d('0x24')][_0x190d('0x77')]=util[_0x190d('0x5f')](_0x190d('0x78'),_0x993cef[_0x190d('0x62')][_0x190d('0x36')]);_0x207fbf['message'][_0x190d('0x79')]=_0x207fbf[_0x190d('0x79')];_0x207fbf[_0x190d('0x24')][_0x190d('0x7a')]=_0x207fbf[_0x190d('0x79')];_0x207fbf['message'][_0x190d('0x7b')]='accept';return respondWithRpcPromise(_0x190d('0x7c'),'EventManager',{'event':_0x190d('0x7d'),'message':_0x207fbf[_0x190d('0x24')]},client9002)[_0x190d('0x32')](function(){return _0x207fbf;});}return _0x207fbf;}return null;})[_0x190d('0x32')](respondWithResult(_0x52b87a,null))[_0x190d('0x50')](handleError(_0x52b87a,null));};var interaction_log=require(_0x190d('0x15'))('fax-interactions');exports[_0x190d('0x2f')]=function(_0x43effc,_0x1855b2,_0x1430d9){var _0x19784d={'agent':{},'channel':_0x190d('0x5c')};if(_0x43effc[_0x190d('0x57')]['id']){delete _0x43effc[_0x190d('0x57')]['id'];}_0x43effc[_0x190d('0x57')]['UserId']=_0x43effc['body'][_0x190d('0x61')]||_0x43effc[_0x190d('0x62')]['id'];_0x19784d[_0x190d('0x75')]['id']=_0x43effc[_0x190d('0x57')]['UserId'];return db['FaxMessage'][_0x190d('0x56')]({'where':{'id':_0x43effc[_0x190d('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1855b2,null))[_0x190d('0x32')](function(_0x3d1805){if(_0x3d1805){_0x19784d[_0x190d('0x24')]=_0x3d1805[_0x190d('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x3d1805[_0x190d('0x64')]}});}return null;})[_0x190d('0x32')](handleEntityNotFound(_0x1855b2,null))[_0x190d('0x32')](function(_0x4fdcc8){if(_0x4fdcc8){_0x19784d['interaction']=_0x4fdcc8[_0x190d('0x63')]({'plain':!![]});interaction_log[_0x190d('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43effc['user']['id'],_0x43effc[_0x190d('0x62')][_0x190d('0x36')],_0x43effc['user'][_0x190d('0x67')],_0x19784d[_0x190d('0x66')]['id'],_0x43effc[_0x190d('0x57')]?JSON[_0x190d('0x68')](_0x43effc[_0x190d('0x57')]):_0x190d('0x7e'));return respondWithRpcPromise(_0x190d('0x7f'),_0x190d('0x80'),_0x19784d);}return null;})[_0x190d('0x32')](function(_0x1241b5){var _0x551bfe=_0x190d('0x6b')+_0x1241b5[_0x190d('0x24')]['ContactId'];return db['sequelize'][_0x190d('0x3d')](_0x551bfe,{'type':db['Sequelize'][_0x190d('0x6f')][_0x190d('0x70')],'raw':!![]})[_0x190d('0x32')](function(_0x19ff07){return _0x19ff07;});})[_0x190d('0x32')](function(_0x3af01e){if(_0x3af01e){_0x19784d[_0x190d('0x24')]['contact']=_0x3af01e[0x0];if(!_0x43effc[_0x190d('0x57')][_0x190d('0x61')])return;return db[_0x190d('0x81')]['find']({'where':{'id':_0x43effc[_0x190d('0x57')][_0x190d('0x61')],'role':_0x190d('0x75')},'attributes':['id',_0x190d('0x36'),'fullname',_0x190d('0x73'),_0x190d('0x74')],'raw':!![]});}return null;})[_0x190d('0x32')](function(_0x290cb3){if(!_0x290cb3)return null;_0x19784d[_0x190d('0x24')]['agent']=_0x290cb3;return _0x19784d;})['then'](function(_0x476f1c){if(_0x476f1c){_0x476f1c[_0x190d('0x24')][_0x190d('0x77')]=util[_0x190d('0x5f')](_0x190d('0x78'),_0x43effc[_0x190d('0x62')]['name']);_0x476f1c[_0x190d('0x24')][_0x190d('0x79')]=_0x19784d['channel'];_0x476f1c[_0x190d('0x24')][_0x190d('0x7a')]=_0x19784d[_0x190d('0x79')];_0x476f1c[_0x190d('0x24')][_0x190d('0x7b')]=_0x190d('0x2f');respondWithRpcPromise('EventManager',_0x190d('0x7c'),{'event':_0x190d('0x82'),'message':_0x476f1c[_0x190d('0x24')]},client9002);return _0x19784d;}return null;})[_0x190d('0x32')](respondWithResult(_0x1855b2,null))[_0x190d('0x50')](handleError(_0x1855b2,null));};exports[_0x190d('0x83')]=function(_0x56419e,_0x1a15b0){var _0x59e1e1;return db[_0x190d('0x4e')][_0x190d('0x83')](_0x56419e[_0x190d('0x57')],{})[_0x190d('0x32')](function(_0x3d6b85){_0x59e1e1=_0x3d6b85;return db[_0x190d('0x84')][_0x190d('0x85')]({'where':{'id':_0x59e1e1[_0x190d('0x6c')]}});})[_0x190d('0x32')](function(_0xed8297){if(_['isNil'](_0xed8297)){return;}else{_0x59e1e1[_0x190d('0x5c')]=_0xed8297[_0x190d('0x5c')];return db[_0x190d('0x86')]['findOne']({'where':{'id':_0x59e1e1[_0x190d('0x87')]}});}})[_0x190d('0x32')](function(_0x29dbf2){return respondWithRpcPromise(_0x190d('0x88'),_0x190d('0x88'),{'FaxAccountId':_[_0x190d('0x89')](_0x56419e[_0x190d('0x57')])?undefined:_0x56419e[_0x190d('0x57')][_0x190d('0x8a')],'path':_['isNil'](_0x29dbf2)?undefined:util[_0x190d('0x5f')](_0x190d('0x8b'),_0x29dbf2[_0x190d('0x8c')]),'fax':_['isNil'](_0x59e1e1[_0x190d('0x5c')])?undefined:_0x59e1e1[_0x190d('0x5c')],'AttachmentId':_0x59e1e1[_0x190d('0x87')]},client9002);})[_0x190d('0x32')](respondWithResult(_0x1a15b0,0xc9))[_0x190d('0x50')](handleError(_0x1a15b0,null));};exports['download']=function(_0x12689f,_0x3ec739){var _0x192ebf=path['join'](config['root'],_0x190d('0x8d'),'files','attachments');return db['FaxMessage'][_0x190d('0x56')]({'where':{'id':_0x12689f[_0x190d('0x58')]['id']},'include':[{'model':db[_0x190d('0x86')],'as':_0x190d('0x86')}]})[_0x190d('0x32')](handleEntityNotFound(_0x3ec739,null))['then'](function(_0x16567a){if(_0x16567a){return _0x3ec739['download'](path['join'](_0x192ebf,_0x16567a[_0x190d('0x86')][_0x190d('0x8c')]));}})['catch'](handleError(_0x3ec739,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b3a0f97..b98ba3e 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 _0x1c75=['emit','hasOwnProperty','hook','events','save','update','remove'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x1c75,0xce));var _0x51c7=function(_0x9ace37,_0x4d1159){_0x9ace37=_0x9ace37-0x0;var _0x23ecc0=_0x1c75[_0x9ace37];return _0x23ecc0;};'use strict';var EventEmitter=require(_0x51c7('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51c7('0x1'),'afterUpdate':_0x51c7('0x2'),'afterDestroy':_0x51c7('0x3')};function emitEvent(_0x1760f6){return function(_0xf1dc95,_0x1fc6c4,_0x17e359){FaxMessageEvents[_0x51c7('0x4')](_0x1760f6+':'+_0xf1dc95['id'],_0xf1dc95);FaxMessageEvents[_0x51c7('0x4')](_0x1760f6,_0xf1dc95);_0x17e359(null);};}for(var e in events){if(events[_0x51c7('0x5')](e)){var event=events[e];FaxMessage[_0x51c7('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x8daf=['save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x8daf,0x15c));var _0xf8da=function(_0x2ec650,_0x24b011){_0x2ec650=_0x2ec650-0x0;var _0xdb00de=_0x8daf[_0x2ec650];return _0xdb00de;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8da('0x0'),'afterUpdate':_0xf8da('0x1'),'afterDestroy':'remove'};function emitEvent(_0x3a62fe){return function(_0x109758,_0x258561,_0x3357f6){FaxMessageEvents[_0xf8da('0x2')](_0x3a62fe+':'+_0x109758['id'],_0x109758);FaxMessageEvents[_0xf8da('0x2')](_0x3a62fe,_0x109758);_0x3357f6(null);};}for(var e in events){if(events[_0xf8da('0x3')](e)){var event=events[e];FaxMessage[_0xf8da('0x4')](e,emitEvent(event));}}module[_0xf8da('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0387b1d..2ffe8c5 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 _0x4f98=['toLowerCase','secret','isNil','UserId','FaxInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxMessage','fax_messages','fti_fax_messages','models','direction'];(function(_0x3d6907,_0x2f08fb){var _0x2ab3aa=function(_0x5f2f01){while(--_0x5f2f01){_0x3d6907['push'](_0x3d6907['shift']());}};_0x2ab3aa(++_0x2f08fb);}(_0x4f98,0x1b3));var _0x84f9=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x4f98[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x84f9('0x0'));var util=require(_0x84f9('0x1'));var logger=require(_0x84f9('0x2'))(_0x84f9('0x3'));var moment=require(_0x84f9('0x4'));var BPromise=require(_0x84f9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84f9('0x6'));var rimraf=require(_0x84f9('0x7'));var config=require(_0x84f9('0x8'));var attributes=require('./faxMessage.attributes');module[_0x84f9('0x9')]=function(_0x51f9e7,_0x2614e2){return _0x51f9e7['define'](_0x84f9('0xa'),attributes,{'tableName':_0x84f9('0xb'),'paranoid':![],'indexes':[{'name':_0x84f9('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30463d,_0x2799c5,_0xbd8401){var _0x3419a8=_0x51f9e7[_0x84f9('0xd')];var _0x27b92d=_0x30463d['get']({'plain':!![]});if(_0x27b92d['direction']['toLowerCase']()==='in'||_0x27b92d[_0x84f9('0xe')][_0x84f9('0xf')]()==='out'&&!_0x27b92d[_0x84f9('0x10')]&&!_[_0x84f9('0x11')](_0x27b92d[_0x84f9('0x12')])){_0x3419a8['FaxInteraction']['findOne']({'where':{'id':_0x27b92d[_0x84f9('0x13')]}})[_0x84f9('0x14')](function(_0x67930e){if(_0x67930e){_0x67930e[_0x84f9('0x15')]({'lastMsgAt':_0x27b92d['createdAt'],'lastMsgDirection':_0x27b92d[_0x84f9('0xe')][_0x84f9('0xf')]()});}})[_0x84f9('0x16')](function(_0x57d223){console['error'](_0x57d223);});}_0xbd8401();}},'charset':_0x84f9('0x17'),'collate':_0x84f9('0x18')});}; \ No newline at end of file +var _0xbdbb=['direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get'];(function(_0x5612c5,_0x389dbc){var _0xa17ebc=function(_0x33078e){while(--_0x33078e){_0x5612c5['push'](_0x5612c5['shift']());}};_0xa17ebc(++_0x389dbc);}(_0xbdbb,0x12f));var _0xbbdb=function(_0x16d7a6,_0x4dac64){_0x16d7a6=_0x16d7a6-0x0;var _0x397bc1=_0xbdbb[_0x16d7a6];return _0x397bc1;};'use strict';var _=require('lodash');var util=require(_0xbbdb('0x0'));var logger=require(_0xbbdb('0x1'))('api');var moment=require(_0xbbdb('0x2'));var BPromise=require(_0xbbdb('0x3'));var rp=require(_0xbbdb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbbdb('0x5'));var attributes=require(_0xbbdb('0x6'));module[_0xbbdb('0x7')]=function(_0x2a84a9,_0x3a5c8d){return _0x2a84a9[_0xbbdb('0x8')](_0xbbdb('0x9'),attributes,{'tableName':_0xbbdb('0xa'),'paranoid':![],'indexes':[{'name':_0xbbdb('0xb'),'fields':[_0xbbdb('0xc')],'type':_0xbbdb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54225d,_0x1c9750,_0x27f2c8){var _0x34fe8a=_0x2a84a9[_0xbbdb('0xe')];var _0x356c7f=_0x54225d[_0xbbdb('0xf')]({'plain':!![]});if(_0x356c7f[_0xbbdb('0x10')][_0xbbdb('0x11')]()==='in'||_0x356c7f['direction'][_0xbbdb('0x11')]()===_0xbbdb('0x12')&&!_0x356c7f[_0xbbdb('0x13')]&&!_[_0xbbdb('0x14')](_0x356c7f[_0xbbdb('0x15')])){_0x34fe8a[_0xbbdb('0x16')]['findOne']({'where':{'id':_0x356c7f[_0xbbdb('0x17')]}})[_0xbbdb('0x18')](function(_0x2e00d3){if(_0x2e00d3){_0x2e00d3['update']({'lastMsgAt':_0x356c7f[_0xbbdb('0x19')],'lastMsgDirection':_0x356c7f[_0xbbdb('0x10')][_0xbbdb('0x11')]()});}})[_0xbbdb('0x1a')](function(_0x4e4577){console[_0xbbdb('0x1b')](_0x4e4577);});}_0x27f2c8();}},'charset':'utf8mb4','collate':_0xbbdb('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 99474b3..3fe0513 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 _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e08f4,_0x1b5d91){var _0x48d37e=function(_0xa7474b){while(--_0xa7474b){_0x1e08f4['push'](_0x1e08f4['shift']());}};_0x48d37e(++_0x1b5d91);}(_0x84ab,0x12f));var _0xb84a=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x84ab[_0xb8cfbe];return _0x227d51;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xed1f,0x6a));var _0xfed1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xed1f[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 59c0098..0518a01 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 _0x914a=['emit','removeListener','length','faxMessage:','remove'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0x914a,0x95));var _0xa914=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x914a[_0x1e381c];return _0x9b5ea9;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xa914('0x0'),'update'];function createListener(_0x2b196b,_0xe032ad){return function(_0x1ccc49){_0xe032ad[_0xa914('0x1')](_0x2b196b,_0x1ccc49);};}function removeListener(_0x44ce56,_0x18dfb5){return function(){FaxMessageEvents[_0xa914('0x2')](_0x44ce56,_0x18dfb5);};}exports['register']=function(_0x27ef83){for(var _0x510d6f=0x0,_0x1c907b=events[_0xa914('0x3')];_0x510d6f<_0x1c907b;_0x510d6f++){var _0x2eebd3=events[_0x510d6f];var _0x5dd069=createListener(_0xa914('0x4')+_0x2eebd3,_0x27ef83);FaxMessageEvents['on'](_0x2eebd3,_0x5dd069);}}; \ No newline at end of file +var _0x5359=['update','emit','register','faxMessage:','./faxMessage.events','save','remove'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x5359,0xb3));var _0x9535=function(_0x50deb6,_0x4ba0ff){_0x50deb6=_0x50deb6-0x0;var _0x10ca63=_0x5359[_0x50deb6];return _0x10ca63;};'use strict';var FaxMessageEvents=require(_0x9535('0x0'));var events=[_0x9535('0x1'),_0x9535('0x2'),_0x9535('0x3')];function createListener(_0x1b734b,_0x32172d){return function(_0x42b5b2){_0x32172d[_0x9535('0x4')](_0x1b734b,_0x42b5b2);};}function removeListener(_0x224781,_0x55e7c7){return function(){FaxMessageEvents['removeListener'](_0x224781,_0x55e7c7);};}exports[_0x9535('0x5')]=function(_0x5cd18c){for(var _0x5aea38=0x0,_0x471d31=events['length'];_0x5aea38<_0x471d31;_0x5aea38++){var _0x13965a=events[_0x5aea38];var _0x50d22c=createListener(_0x9535('0x6')+_0x13965a,_0x5cd18c);FaxMessageEvents['on'](_0x13965a,_0x50d22c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b181995..b905e24 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 _0x16d2=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x16d2,0x123));var _0x216d=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x16d2[_0x408d22];return _0x58effd;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['download']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),interaction[_0x216d('0x13')](_0x216d('0x14'),_0x216d('0x15')),controller[_0x216d('0x16')]);router[_0x216d('0x17')](_0x216d('0xf'),auth['isAuthenticated'](),controller[_0x216d('0x18')]);router['put'](_0x216d('0x19'),auth[_0x216d('0xb')](),controller['accept']);router[_0x216d('0x17')](_0x216d('0x1a'),auth['isAuthenticated'](),controller[_0x216d('0x1b')]);router['delete'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x1c')]);module[_0x216d('0x1d')]=router; \ No newline at end of file +var _0x2547=['/:id/download','download','post','tracked','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x2547,0x1cd));var _0x7254=function(_0x1a1bf1,_0x20db4e){_0x1a1bf1=_0x1a1bf1-0x0;var _0x213bc3=_0x2547[_0x1a1bf1];return _0x213bc3;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),interaction[_0x7254('0x12')]('fax',_0x7254('0x13')),controller['create']);router[_0x7254('0x14')]('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0x15')]);router[_0x7254('0x14')](_0x7254('0x16'),auth[_0x7254('0xa')](),controller[_0x7254('0x17')]);router[_0x7254('0x14')](_0x7254('0x18'),auth[_0x7254('0xa')](),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),controller['destroy']);module[_0x7254('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 6824a2a..d89bf54 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 _0x59fd=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x371cce,_0x5633ba){var _0x608ddc=function(_0xf1bdec){while(--_0xf1bdec){_0x371cce['push'](_0x371cce['shift']());}};_0x608ddc(++_0x5633ba);}(_0x59fd,0x1f3));var _0xd59f=function(_0x5ea5dc,_0x5bb243){_0x5ea5dc=_0x5ea5dc-0x0;var _0x5a814e=_0x59fd[_0x5ea5dc];return _0x5a814e;};'use strict';var Sequelize=require(_0xd59f('0x0'));module[_0xd59f('0x1')]={'name':{'type':Sequelize[_0xd59f('0x2')],'unique':_0xd59f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd59f('0x2')]},'timeout':{'type':Sequelize[_0xd59f('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd59f('0x5')](_0xd59f('0x6'),_0xd59f('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd59f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x419f=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x3a4625,_0x1d4731){var _0x49ba05=function(_0x5f3b84){while(--_0x5f3b84){_0x3a4625['push'](_0x3a4625['shift']());}};_0x49ba05(++_0x1d4731);}(_0x419f,0x176));var _0xf419=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x419f[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xf419('0x0'));module[_0xf419('0x1')]={'name':{'type':Sequelize[_0xf419('0x2')],'unique':_0xf419('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf419('0x2')]},'timeout':{'type':Sequelize[_0xf419('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf419('0x5'),'beepall',_0xf419('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf419('0x4')],'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 c9372d5..be0ae89 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 _0x3fae=['getAgents','eml-format','zip-dir','request-promise','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','get','UserProfileResource','error','name','index','map','FaxQueue','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','type','VIRTUAL','merge','include','findAll','rows','show','params','keys','rawAttributes','length','options','find','catch','create','body','user','role','FaxQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','order','pick','FaxQueueId','UserFaxQueue','User','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','transaction','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray'];(function(_0x427bef,_0x265fbe){var _0x27b42f=function(_0x770b99){while(--_0x770b99){_0x427bef['push'](_0x427bef['shift']());}};_0x27b42f(++_0x265fbe);}(_0x3fae,0x199));var _0xe3fa=function(_0x23a70d,_0x2825ae){_0x23a70d=_0x23a70d-0x0;var _0x12395f=_0x3fae[_0x23a70d];return _0x12395f;};'use strict';var emlformat=require(_0xe3fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3fa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe3fa('0x3'));var fs=require('fs');var fs_extra=require(_0xe3fa('0x4'));var _=require('lodash');var squel=require(_0xe3fa('0x5'));var crypto=require(_0xe3fa('0x6'));var jsforce=require(_0xe3fa('0x7'));var deskjs=require(_0xe3fa('0x8'));var toCsv=require(_0xe3fa('0x9'));var querystring=require(_0xe3fa('0xa'));var Papa=require(_0xe3fa('0xb'));var Redis=require(_0xe3fa('0xc'));var authService=require(_0xe3fa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe3fa('0xe'));var hardwareService=require(_0xe3fa('0xf'));var logger=require(_0xe3fa('0x10'))(_0xe3fa('0x11'));var utils=require(_0xe3fa('0x12'));var config=require(_0xe3fa('0x13'));var licenseUtil=require(_0xe3fa('0x14'));var db=require(_0xe3fa('0x15'))['db'];config[_0xe3fa('0x16')]=_[_0xe3fa('0x17')](config[_0xe3fa('0x16')],{'host':_0xe3fa('0x18'),'port':0x18eb});var socket=require(_0xe3fa('0x19'))(new Redis(config['redis']));require(_0xe3fa('0x1a'))[_0xe3fa('0x1b')](socket);function respondWithStatusCode(_0x2865d1,_0x1f1c99){_0x1f1c99=_0x1f1c99||0xcc;return function(_0x203435){if(_0x203435){return _0x2865d1[_0xe3fa('0x1c')](_0x1f1c99);}return _0x2865d1[_0xe3fa('0x1d')](_0x1f1c99)[_0xe3fa('0x1e')]();};}function respondWithResult(_0x3a1c3f,_0x2fe9c7){_0x2fe9c7=_0x2fe9c7||0xc8;return function(_0x3844b7){if(_0x3844b7){return _0x3a1c3f[_0xe3fa('0x1d')](_0x2fe9c7)['json'](_0x3844b7);}};}function respondWithFilteredResult(_0x580497,_0x4ee0ba){return function(_0x4777a0){if(_0x4777a0){var _0x5cb29e=typeof _0x4ee0ba['offset']===_0xe3fa('0x1f')&&typeof _0x4ee0ba[_0xe3fa('0x20')]===_0xe3fa('0x1f');var _0x3028b6=_0x4777a0[_0xe3fa('0x21')];var _0x5ad45a=_0x5cb29e?0x0:_0x4ee0ba[_0xe3fa('0x22')];var _0x42ac63=_0x5cb29e?_0x4777a0[_0xe3fa('0x21')]:_0x4ee0ba[_0xe3fa('0x22')]+_0x4ee0ba['limit'];var _0xa11c4c;if(_0x42ac63>=_0x3028b6){_0x42ac63=_0x3028b6;_0xa11c4c=0xc8;}else{_0xa11c4c=0xce;}_0x580497[_0xe3fa('0x1d')](_0xa11c4c);return _0x580497[_0xe3fa('0x23')](_0xe3fa('0x24'),_0x5ad45a+'-'+_0x42ac63+'/'+_0x3028b6)[_0xe3fa('0x25')](_0x4777a0);}return null;};}function patchUpdates(_0x18e58e){return function(_0xbf514){try{jsonpatch[_0xe3fa('0x26')](_0xbf514,_0x18e58e,!![]);}catch(_0x590598){return BPromise['reject'](_0x590598);}return _0xbf514[_0xe3fa('0x27')]();};}function saveUpdates(_0x1e13d1,_0x29276b){return function(_0x4317bc){if(_0x4317bc){return _0x4317bc[_0xe3fa('0x28')](_0x1e13d1)['then'](function(_0x247293){return _0x247293;});}return null;};}function removeEntity(_0x1e063e,_0x65cb6f){return function(_0x1de519){if(_0x1de519){return _0x1de519[_0xe3fa('0x29')]()[_0xe3fa('0x2a')](function(){var _0x4097bb=_0x1de519[_0xe3fa('0x2b')]({'plain':!![]});var _0x38e12c='FaxQueues';return db[_0xe3fa('0x2c')][_0xe3fa('0x29')]({'where':{'type':_0x38e12c,'resourceId':_0x4097bb['id']}})[_0xe3fa('0x2a')](function(){return _0x1de519;});})[_0xe3fa('0x2a')](function(){_0x1e063e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x885175,_0x24e0e2){return function(_0xa7e3b3){if(!_0xa7e3b3){_0x885175[_0xe3fa('0x1c')](0x194);}return _0xa7e3b3;};}function handleError(_0x30ce06,_0xb7e06b){_0xb7e06b=_0xb7e06b||0x1f4;return function(_0x2679b3){logger[_0xe3fa('0x2d')](_0x2679b3['stack']);if(_0x2679b3['name']){delete _0x2679b3[_0xe3fa('0x2e')];}_0x30ce06[_0xe3fa('0x1d')](_0xb7e06b)['send'](_0x2679b3);};}exports[_0xe3fa('0x2f')]=function(_0x355adf,_0x38a277){var _0x1c64c5={},_0x2fc211={},_0x2750a2={'count':0x0,'rows':[]};var _0x26dcca=_[_0xe3fa('0x30')](db[_0xe3fa('0x31')]['rawAttributes'],function(_0x3dda90){return{'name':_0x3dda90[_0xe3fa('0x32')],'type':_0x3dda90['type']['key']};});_0x2fc211[_0xe3fa('0x33')]=_[_0xe3fa('0x30')](_0x26dcca,'name');_0x2fc211[_0xe3fa('0x34')]=_['keys'](_0x355adf['query']);_0x2fc211['filters']=_[_0xe3fa('0x35')](_0x2fc211[_0xe3fa('0x33')],_0x2fc211['query']);_0x1c64c5[_0xe3fa('0x36')]=_[_0xe3fa('0x35')](_0x2fc211[_0xe3fa('0x33')],qs['fields'](_0x355adf[_0xe3fa('0x34')][_0xe3fa('0x37')]));_0x1c64c5['attributes']=_0x1c64c5['attributes']['length']?_0x1c64c5[_0xe3fa('0x36')]:_0x2fc211[_0xe3fa('0x33')];if(!_0x355adf[_0xe3fa('0x34')][_0xe3fa('0x38')](_0xe3fa('0x39'))){_0x1c64c5[_0xe3fa('0x20')]=qs[_0xe3fa('0x20')](_0x355adf['query'][_0xe3fa('0x20')]);_0x1c64c5['offset']=qs[_0xe3fa('0x22')](_0x355adf[_0xe3fa('0x34')]['offset']);}_0x1c64c5['order']=qs[_0xe3fa('0x3a')](_0x355adf[_0xe3fa('0x34')][_0xe3fa('0x3a')]);_0x1c64c5['where']=qs['filters'](_['pick'](_0x355adf[_0xe3fa('0x34')],_0x2fc211[_0xe3fa('0x3b')]),_0x26dcca);if(_0x355adf[_0xe3fa('0x34')][_0xe3fa('0x3c')]){_0x1c64c5[_0xe3fa('0x3d')]=_['merge'](_0x1c64c5[_0xe3fa('0x3d')],{'$or':_[_0xe3fa('0x30')](_0x26dcca,function(_0x1c9ce9){if(_0x1c9ce9[_0xe3fa('0x3e')]!==_0xe3fa('0x3f')){var _0x46706e={};_0x46706e[_0x1c9ce9[_0xe3fa('0x2e')]]={'$like':'%'+_0x355adf[_0xe3fa('0x34')][_0xe3fa('0x3c')]+'%'};return _0x46706e;}})});}_0x1c64c5=_[_0xe3fa('0x40')]({},_0x1c64c5,_0x355adf['options']);var _0x1d16c0={'where':_0x1c64c5['where']};return db[_0xe3fa('0x31')][_0xe3fa('0x21')](_0x1d16c0)['then'](function(_0xf0176e){_0x2750a2[_0xe3fa('0x21')]=_0xf0176e;if(_0x355adf['query']['includeAll']){_0x1c64c5[_0xe3fa('0x41')]=[{'all':!![]}];}return db[_0xe3fa('0x31')][_0xe3fa('0x42')](_0x1c64c5);})['then'](function(_0x3114b1){_0x2750a2[_0xe3fa('0x43')]=_0x3114b1;return _0x2750a2;})[_0xe3fa('0x2a')](respondWithFilteredResult(_0x38a277,_0x1c64c5))['catch'](handleError(_0x38a277,null));};exports[_0xe3fa('0x44')]=function(_0x5cbe22,_0x41f0f6){var _0x495dbc={'raw':!![],'where':{'id':_0x5cbe22[_0xe3fa('0x45')]['id']}},_0x17f124={};_0x17f124[_0xe3fa('0x33')]=_[_0xe3fa('0x46')](db[_0xe3fa('0x31')][_0xe3fa('0x47')]);_0x17f124[_0xe3fa('0x34')]=_[_0xe3fa('0x46')](_0x5cbe22[_0xe3fa('0x34')]);_0x17f124[_0xe3fa('0x3b')]=_[_0xe3fa('0x35')](_0x17f124[_0xe3fa('0x33')],_0x17f124[_0xe3fa('0x34')]);_0x495dbc['attributes']=_[_0xe3fa('0x35')](_0x17f124['model'],qs[_0xe3fa('0x37')](_0x5cbe22[_0xe3fa('0x34')][_0xe3fa('0x37')]));_0x495dbc[_0xe3fa('0x36')]=_0x495dbc[_0xe3fa('0x36')][_0xe3fa('0x48')]?_0x495dbc[_0xe3fa('0x36')]:_0x17f124['model'];if(_0x5cbe22[_0xe3fa('0x34')]['includeAll']){_0x495dbc[_0xe3fa('0x41')]=[{'all':!![]}];}_0x495dbc=_[_0xe3fa('0x40')]({},_0x495dbc,_0x5cbe22[_0xe3fa('0x49')]);return db[_0xe3fa('0x31')][_0xe3fa('0x4a')](_0x495dbc)[_0xe3fa('0x2a')](handleEntityNotFound(_0x41f0f6,null))[_0xe3fa('0x2a')](respondWithResult(_0x41f0f6,null))[_0xe3fa('0x4b')](handleError(_0x41f0f6,null));};exports[_0xe3fa('0x4c')]=function(_0x22a321,_0x34f317){return db[_0xe3fa('0x31')]['create'](_0x22a321[_0xe3fa('0x4d')],{})[_0xe3fa('0x2a')](function(_0x201131){var _0x1ecb04=_0x22a321[_0xe3fa('0x4e')][_0xe3fa('0x2b')]({'plain':!![]});if(!_0x1ecb04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ecb04[_0xe3fa('0x4f')]===_0xe3fa('0x4e')){var _0x1c636f=_0x201131[_0xe3fa('0x2b')]({'plain':!![]});var _0x699cfa=_0xe3fa('0x50');return db['UserProfileSection'][_0xe3fa('0x4a')]({'where':{'name':_0x699cfa,'userProfileId':_0x1ecb04[_0xe3fa('0x51')]},'raw':!![]})[_0xe3fa('0x2a')](function(_0x120393){if(_0x120393&&_0x120393[_0xe3fa('0x52')]===0x0){return db['UserProfileResource'][_0xe3fa('0x4c')]({'name':_0x1c636f[_0xe3fa('0x2e')],'resourceId':_0x1c636f['id'],'type':_0x120393[_0xe3fa('0x2e')],'sectionId':_0x120393['id']},{})['then'](function(){return _0x201131;});}else{return _0x201131;}})['catch'](function(_0x5d12b6){logger[_0xe3fa('0x2d')](_0xe3fa('0x53'),_0x5d12b6);throw _0x5d12b6;});}return _0x201131;})[_0xe3fa('0x2a')](respondWithResult(_0x34f317,0xc9))[_0xe3fa('0x4b')](handleError(_0x34f317,null));};exports[_0xe3fa('0x28')]=function(_0x1665cb,_0xc95d10){if(_0x1665cb[_0xe3fa('0x4d')]['id']){delete _0x1665cb[_0xe3fa('0x4d')]['id'];}return db[_0xe3fa('0x31')][_0xe3fa('0x4a')]({'where':{'id':_0x1665cb['params']['id']}})[_0xe3fa('0x2a')](handleEntityNotFound(_0xc95d10,null))[_0xe3fa('0x2a')](saveUpdates(_0x1665cb[_0xe3fa('0x4d')],null))[_0xe3fa('0x2a')](respondWithResult(_0xc95d10,null))[_0xe3fa('0x4b')](handleError(_0xc95d10,null));};exports['destroy']=function(_0x2392ac,_0x3c4350){return db[_0xe3fa('0x31')][_0xe3fa('0x4a')]({'where':{'id':_0x2392ac['params']['id']}})[_0xe3fa('0x2a')](handleEntityNotFound(_0x3c4350,null))['then'](removeEntity(_0x3c4350,null))[_0xe3fa('0x4b')](handleError(_0x3c4350,null));};exports['describe']=function(_0xa6a24b,_0x4e27d7){return db[_0xe3fa('0x31')]['describe']()[_0xe3fa('0x2a')](respondWithResult(_0x4e27d7,null))[_0xe3fa('0x4b')](handleError(_0x4e27d7,null));};exports[_0xe3fa('0x54')]=function(_0xc8cfcd,_0x547b80,_0x57e602){var _0x36f6b8={'raw':!![],'where':{}},_0x200e99={},_0x4a4c23;return db[_0xe3fa('0x31')]['findOne']({'where':{'id':_0xc8cfcd[_0xe3fa('0x45')]['id']}})[_0xe3fa('0x2a')](handleEntityNotFound(_0x547b80,null))[_0xe3fa('0x2a')](function(_0x530be4){if(_0x530be4){_0x4a4c23=_0x530be4[_0xe3fa('0x2b')]({'plain':!![]});_0x200e99[_0xe3fa('0x33')]=_['keys'](db['UserFaxQueue'][_0xe3fa('0x47')]);_0x200e99['query']=_[_0xe3fa('0x46')](_0xc8cfcd['query']);_0x200e99[_0xe3fa('0x3b')]=_[_0xe3fa('0x35')](_0x200e99[_0xe3fa('0x33')],_0x200e99['query']);_0x36f6b8[_0xe3fa('0x36')]=_[_0xe3fa('0x35')](_0x200e99[_0xe3fa('0x33')],qs[_0xe3fa('0x37')](_0xc8cfcd['query'][_0xe3fa('0x37')]));_0x36f6b8[_0xe3fa('0x36')]=_0x36f6b8[_0xe3fa('0x36')][_0xe3fa('0x48')]?_0x36f6b8[_0xe3fa('0x36')]:_0x200e99[_0xe3fa('0x33')];if(!_0xc8cfcd[_0xe3fa('0x34')][_0xe3fa('0x38')](_0xe3fa('0x39'))){_0x36f6b8['limit']=qs['limit'](_0xc8cfcd['query'][_0xe3fa('0x20')]);_0x36f6b8['offset']=qs[_0xe3fa('0x22')](_0xc8cfcd[_0xe3fa('0x34')][_0xe3fa('0x22')]);}_0x36f6b8[_0xe3fa('0x55')]=qs[_0xe3fa('0x3a')](_0xc8cfcd[_0xe3fa('0x34')][_0xe3fa('0x3a')]);_0x36f6b8[_0xe3fa('0x3d')]=qs['filters'](_[_0xe3fa('0x56')](_0xc8cfcd[_0xe3fa('0x34')],_0x200e99[_0xe3fa('0x3b')]));_0x36f6b8[_0xe3fa('0x3d')][_0xe3fa('0x57')]=_0x530be4['id'];if(_0xc8cfcd['query']['filter']){_0x36f6b8['where']=_[_0xe3fa('0x40')](_0x36f6b8[_0xe3fa('0x3d')],{'$or':_['map'](_0x36f6b8['attributes'],function(_0x4dc6a8){var _0xc2014={};_0xc2014[_0x4dc6a8]={'$like':'%'+_0xc8cfcd[_0xe3fa('0x34')][_0xe3fa('0x3c')]+'%'};return _0xc2014;})});}_0x36f6b8=_[_0xe3fa('0x40')]({},_0x36f6b8,_0xc8cfcd[_0xe3fa('0x49')]);return db[_0xe3fa('0x58')][_0xe3fa('0x42')](_0x36f6b8);}})['then'](function(_0x29f1ef){if(_0x29f1ef){return db[_0xe3fa('0x59')]['findAndCountAll']({'where':{'id':_[_0xe3fa('0x30')](_0x29f1ef,'UserId'),'role':_0xe3fa('0x5a')},'attributes':['id',_0xe3fa('0x2e'),_0xe3fa('0x5b'),_0xe3fa('0x5c'),_0xe3fa('0x5d')]});}})[_0xe3fa('0x2a')](function(_0x390ee3){if(_0x390ee3){return{'count':_0x390ee3[_0xe3fa('0x21')],'rows':_[_0xe3fa('0x30')](_0x390ee3[_0xe3fa('0x43')],function(_0x43d2e5){return{'membername':_0x43d2e5[_0xe3fa('0x2e')],'UserId':_0x43d2e5['id'],'queue_name':_0x4a4c23[_0xe3fa('0x2e')],'FaxQueueId':_0x4a4c23['id'],'interface':util[_0xe3fa('0x5e')](_0xe3fa('0x5f'),_0xe3fa('0x60'),_0x43d2e5['name']),'penalty':0x0,'paused':_0x43d2e5[_0xe3fa('0x5b')],'createdAt':_0x43d2e5[_0xe3fa('0x5d')],'updatedAt':_0x43d2e5[_0xe3fa('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x547b80,_0x36f6b8))['catch'](handleError(_0x547b80,null));};exports[_0xe3fa('0x61')]=function(_0x4cb3ff,_0x242ca7,_0x46f750){var _0x45753c={};var _0x95c38a={};var _0x516397;var _0x1c31fc;return db[_0xe3fa('0x31')][_0xe3fa('0x62')]({'where':{'id':_0x4cb3ff[_0xe3fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x242ca7,null))[_0xe3fa('0x2a')](function(_0x284458){if(_0x284458){_0x516397=_0x284458;_0x95c38a[_0xe3fa('0x33')]=_[_0xe3fa('0x46')](db[_0xe3fa('0x63')][_0xe3fa('0x47')]);_0x95c38a[_0xe3fa('0x34')]=_[_0xe3fa('0x46')](_0x4cb3ff[_0xe3fa('0x34')]);_0x95c38a[_0xe3fa('0x3b')]=_['intersection'](_0x95c38a[_0xe3fa('0x33')],_0x95c38a[_0xe3fa('0x34')]);_0x45753c[_0xe3fa('0x36')]=_[_0xe3fa('0x35')](_0x95c38a[_0xe3fa('0x33')],qs[_0xe3fa('0x37')](_0x4cb3ff[_0xe3fa('0x34')]['fields']));_0x45753c[_0xe3fa('0x36')]=_0x45753c[_0xe3fa('0x36')][_0xe3fa('0x48')]?_0x45753c[_0xe3fa('0x36')]:_0x95c38a[_0xe3fa('0x33')];_0x45753c[_0xe3fa('0x55')]=qs[_0xe3fa('0x3a')](_0x4cb3ff[_0xe3fa('0x34')]['sort']);_0x45753c['where']=qs[_0xe3fa('0x3b')](_['pick'](_0x4cb3ff[_0xe3fa('0x34')],_0x95c38a[_0xe3fa('0x3b')]));if(_0x4cb3ff[_0xe3fa('0x34')][_0xe3fa('0x3c')]){_0x45753c[_0xe3fa('0x3d')]=_[_0xe3fa('0x40')](_0x45753c[_0xe3fa('0x3d')],{'$or':_['map'](_0x45753c[_0xe3fa('0x36')],function(_0x5d2631){var _0x1e1f94={};_0x1e1f94[_0x5d2631]={'$like':'%'+_0x4cb3ff[_0xe3fa('0x34')]['filter']+'%'};return _0x1e1f94;})});}_0x45753c=_['merge']({},_0x45753c,_0x4cb3ff[_0xe3fa('0x49')]);return _0x516397[_0xe3fa('0x61')](_0x45753c);}})[_0xe3fa('0x2a')](function(_0x40d8e2){if(_0x40d8e2){_0x1c31fc=_0x40d8e2[_0xe3fa('0x48')];if(!_0x4cb3ff[_0xe3fa('0x34')][_0xe3fa('0x38')]('nolimit')){_0x45753c[_0xe3fa('0x20')]=qs[_0xe3fa('0x20')](_0x4cb3ff['query'][_0xe3fa('0x20')]);_0x45753c[_0xe3fa('0x22')]=qs[_0xe3fa('0x22')](_0x4cb3ff['query'][_0xe3fa('0x22')]);}return _0x516397['getTeams'](_0x45753c);}})[_0xe3fa('0x2a')](function(_0x2f9878){if(_0x2f9878){return _0x2f9878?{'count':_0x1c31fc,'rows':_0x2f9878}:null;}})[_0xe3fa('0x2a')](respondWithResult(_0x242ca7,null))[_0xe3fa('0x4b')](handleError(_0x242ca7,null));};exports[_0xe3fa('0x64')]=function(_0x1b99c4,_0xc94541,_0x368a6a){var _0x1c6d91=_0x1b99c4[_0xe3fa('0x4d')][_0xe3fa('0x65')];return db[_0xe3fa('0x63')][_0xe3fa('0x42')]({'where':{'id':_0x1c6d91},'attributes':['id'],'include':[{'model':db[_0xe3fa('0x59')],'as':_0xe3fa('0x66'),'attributes':['id','name',_0xe3fa('0x67'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1a4acf){if(_0x1a4acf){var _0x1d000e=_['flatMap'](_0x1a4acf,function(_0x16e6ba){var _0x19a0b1=_0x16e6ba[_0xe3fa('0x2b')]({'plain':!![]});return _0x19a0b1['Agents'];});return db[_0xe3fa('0x31')][_0xe3fa('0x4a')]({'where':{'id':_0x1b99c4['params']['id']}})[_0xe3fa('0x2a')](function(_0x5e70dd){return db['sequelize'][_0xe3fa('0x68')](function(_0x10f359){return _0x5e70dd['addTeams'](_0x1c6d91,{'transaction':_0x10f359})[_0xe3fa('0x2a')](function(){return BPromise['each'](_0x1d000e,function(_0xf23c03){return db['UserFaxQueue'][_0xe3fa('0x69')]({'where':{'UserId':_0xf23c03['id'],'FaxQueueId':_0x1b99c4['params']['id']},'transaction':_0x10f359});});})[_0xe3fa('0x2a')](function(){_0x1d000e[_0xe3fa('0x6a')](function(_0x3c2273){socket[_0xe3fa('0x6b')]('userFaxQueue:save',{'UserId':_0x3c2273['id'],'FaxQueueId':_0x5e70dd['id']});});});});});}})[_0xe3fa('0x2a')](respondWithStatusCode(_0xc94541,null))['catch'](handleError(_0xc94541,null));};exports[_0xe3fa('0x6c')]=function(_0x355504,_0x1a38ee,_0x1da6ab){return db[_0xe3fa('0x63')][_0xe3fa('0x42')]({'where':{'id':_0x355504['query'][_0xe3fa('0x65')]},'attributes':['id'],'include':[{'model':db[_0xe3fa('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe3fa('0x2a')](handleEntityNotFound(_0x1a38ee,null))[_0xe3fa('0x2a')](function(_0x1ae079){var _0x1d51b5=_[_0xe3fa('0x30')](_0x1ae079,'id');var _0x22ca0b=[];var _0x1ef0e7=[];var _0x43d3de=squel['select']();_0x43d3de[_0xe3fa('0x6d')](_0xe3fa('0x6e'))[_0xe3fa('0x6f')](_0xe3fa('0x70'),'tq')[_0xe3fa('0x71')]('user_has_teams','ut',_0xe3fa('0x72'))[_0xe3fa('0x3d')]('FaxQueueId\x20=\x20?',_0x355504[_0xe3fa('0x45')]['id']);for(var _0x34df25=0x0;_0x34df25<_0x1ae079[_0xe3fa('0x48')];_0x34df25+=0x1){let _0x5b4862=_0x1ae079[_0x34df25];for(var _0x151c23=0x0;_0x151c23<_0x5b4862['Agents'][_0xe3fa('0x48')];_0x151c23+=0x1){let _0x36703d=_0x5b4862[_0xe3fa('0x66')][_0x151c23];var _0x4324ad=_0x43d3de[_0xe3fa('0x73')]();_0x4324ad[_0xe3fa('0x3d')](_0xe3fa('0x74'),_0x36703d['id']);_0x1ef0e7['push'](db['sequelize'][_0xe3fa('0x34')](_0x4324ad[_0xe3fa('0x75')](),{'type':db[_0xe3fa('0x76')][_0xe3fa('0x77')][_0xe3fa('0x78')]})['then'](function(_0x2ef0b2){if(_0x2ef0b2[_0xe3fa('0x48')]===0x1){return _0x36703d['id'];}else{var _0x23f57f=_[_0xe3fa('0x79')](_[_0xe3fa('0x30')](_0x2ef0b2,_0xe3fa('0x7a')),function(_0x48dcaf){return _['includes'](_0x1d51b5,_0x48dcaf);});if(_0x23f57f){return _0x36703d['id'];}}}));}}return BPromise[_0xe3fa('0x7b')](_0x1ef0e7)['then'](function(_0x4cf0b1){_0x22ca0b=_(_0x22ca0b)[_0xe3fa('0x7c')](_0x4cf0b1)[_0xe3fa('0x7d')]()[_0xe3fa('0x7e')]();return db['FaxQueue'][_0xe3fa('0x4a')]({'where':{'id':_0x355504[_0xe3fa('0x45')]['id']}})['then'](function(_0x48a80e){return db[_0xe3fa('0x76')][_0xe3fa('0x68')](function(_0xad2096){return _0x48a80e[_0xe3fa('0x6c')](_0x355504[_0xe3fa('0x34')][_0xe3fa('0x65')],{'transaction':_0xad2096})[_0xe3fa('0x2a')](function(){if(!_[_0xe3fa('0x7f')](_0x22ca0b)){return _0x48a80e[_0xe3fa('0x80')](_0x22ca0b,{'transaction':_0xad2096});}})[_0xe3fa('0x2a')](function(){_0x22ca0b[_0xe3fa('0x6a')](function(_0x2bf2b2){socket[_0xe3fa('0x6b')](_0xe3fa('0x81'),{'UserId':_0x2bf2b2,'FaxQueueId':_0x48a80e['id']});});});});});});})[_0xe3fa('0x2a')](respondWithStatusCode(_0x1a38ee,null))[_0xe3fa('0x4b')](handleError(_0x1a38ee,null));};exports[_0xe3fa('0x82')]=function(_0xf587e2,_0xb2e65d,_0x1a2f6c){return db[_0xe3fa('0x31')][_0xe3fa('0x4a')]({'where':{'id':_0xf587e2['params']['id']}})['then'](handleEntityNotFound(_0xb2e65d,null))[_0xe3fa('0x2a')](function(_0x42e3fb){if(_0x42e3fb){return _0x42e3fb[_0xe3fa('0x82')](_0xf587e2[_0xe3fa('0x4d')]['ids'],_[_0xe3fa('0x83')](_0xf587e2['body'],[_0xe3fa('0x65'),'id'])||{})[_0xe3fa('0x84')](function(_0x5746d1){for(var _0x13aed8=0x0;_0x13aed8<_0xf587e2[_0xe3fa('0x4d')][_0xe3fa('0x65')][_0xe3fa('0x48')];_0x13aed8+=0x1){socket[_0xe3fa('0x6b')](_0xe3fa('0x85'),{'UserId':Number(_0xf587e2[_0xe3fa('0x4d')][_0xe3fa('0x65')][_0x13aed8]),'FaxQueueId':Number(_0xf587e2[_0xe3fa('0x45')]['id'])});}return _0x5746d1;});}})[_0xe3fa('0x2a')](respondWithResult(_0xb2e65d,null))[_0xe3fa('0x4b')](handleError(_0xb2e65d,null));};exports[_0xe3fa('0x80')]=function(_0x4b2a1e,_0x15110c,_0x38b538){return db[_0xe3fa('0x31')][_0xe3fa('0x4a')]({'where':{'id':_0x4b2a1e[_0xe3fa('0x45')]['id']}})[_0xe3fa('0x2a')](handleEntityNotFound(_0x15110c,null))[_0xe3fa('0x2a')](function(_0x9cbf27){if(_0x9cbf27){return _0x9cbf27['removeAgents'](_0x4b2a1e[_0xe3fa('0x34')][_0xe3fa('0x65')])[_0xe3fa('0x2a')](function(){if(_[_0xe3fa('0x86')](_0x4b2a1e[_0xe3fa('0x34')][_0xe3fa('0x65')])){for(var _0x163c91=0x0;_0x163c91<_0x4b2a1e[_0xe3fa('0x34')][_0xe3fa('0x65')]['length'];_0x163c91+=0x1){socket[_0xe3fa('0x6b')](_0xe3fa('0x81'),{'UserId':Number(_0x4b2a1e['query'][_0xe3fa('0x65')][_0x163c91]),'FaxQueueId':Number(_0x4b2a1e[_0xe3fa('0x45')]['id'])});}}else{socket[_0xe3fa('0x6b')](_0xe3fa('0x81'),{'UserId':Number(_0x4b2a1e[_0xe3fa('0x34')][_0xe3fa('0x65')]),'FaxQueueId':Number(_0x4b2a1e[_0xe3fa('0x45')]['id'])});}});}})[_0xe3fa('0x2a')](respondWithStatusCode(_0x15110c,null))[_0xe3fa('0x4b')](handleError(_0x15110c,null));};exports[_0xe3fa('0x87')]=function(_0x232fbd,_0x21fecd,_0x2ab7ba){var _0x443dd1={};var _0x3cbf99={};var _0x1b70f9;var _0x5d1091;return db[_0xe3fa('0x31')][_0xe3fa('0x62')]({'where':{'id':_0x232fbd[_0xe3fa('0x45')]['id']}})[_0xe3fa('0x2a')](handleEntityNotFound(_0x21fecd,null))[_0xe3fa('0x2a')](function(_0x1ea4ff){if(_0x1ea4ff){_0x1b70f9=_0x1ea4ff;_0x3cbf99[_0xe3fa('0x33')]=_[_0xe3fa('0x46')](db[_0xe3fa('0x59')][_0xe3fa('0x47')]);_0x3cbf99[_0xe3fa('0x34')]=_[_0xe3fa('0x46')](_0x232fbd[_0xe3fa('0x34')]);_0x3cbf99[_0xe3fa('0x3b')]=_['intersection'](_0x3cbf99['model'],_0x3cbf99['query']);_0x443dd1[_0xe3fa('0x36')]=_[_0xe3fa('0x35')](_0x3cbf99[_0xe3fa('0x33')],qs[_0xe3fa('0x37')](_0x232fbd['query'][_0xe3fa('0x37')]));_0x443dd1[_0xe3fa('0x36')]=_0x443dd1['attributes'][_0xe3fa('0x48')]?_0x443dd1[_0xe3fa('0x36')]:_0x3cbf99['model'];_0x443dd1[_0xe3fa('0x55')]=qs[_0xe3fa('0x3a')](_0x232fbd['query'][_0xe3fa('0x3a')]);_0x443dd1[_0xe3fa('0x3d')]=qs[_0xe3fa('0x3b')](_[_0xe3fa('0x56')](_0x232fbd['query'],_0x3cbf99[_0xe3fa('0x3b')]));if(_0x232fbd[_0xe3fa('0x34')]['filter']){_0x443dd1[_0xe3fa('0x3d')]=_['merge'](_0x443dd1['where'],{'$or':_[_0xe3fa('0x30')](_0x443dd1['attributes'],function(_0x5da652){var _0x513d14={};_0x513d14[_0x5da652]={'$like':'%'+_0x232fbd['query'][_0xe3fa('0x3c')]+'%'};return _0x513d14;})});}_0x443dd1=_[_0xe3fa('0x40')]({},_0x443dd1,_0x232fbd[_0xe3fa('0x49')]);return _0x1b70f9['getAgents'](_0x443dd1);}})[_0xe3fa('0x2a')](function(_0xe04406){if(_0xe04406){_0x5d1091=_0xe04406['length'];if(!_0x232fbd[_0xe3fa('0x34')]['hasOwnProperty']('nolimit')){_0x443dd1[_0xe3fa('0x20')]=qs[_0xe3fa('0x20')](_0x232fbd[_0xe3fa('0x34')][_0xe3fa('0x20')]);_0x443dd1[_0xe3fa('0x22')]=qs['offset'](_0x232fbd[_0xe3fa('0x34')][_0xe3fa('0x22')]);}return _0x1b70f9[_0xe3fa('0x87')](_0x443dd1);}})['then'](function(_0x302e33){if(_0x302e33){return _0x302e33?{'count':_0x5d1091,'rows':_0x302e33}:null;}})['then'](respondWithResult(_0x21fecd,null))[_0xe3fa('0x4b')](handleError(_0x21fecd,null));}; \ No newline at end of file +var _0xde5a=['from','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','compact','userFaxQueue:remove','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserFaxQueue','nolimit','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','faxPause','Team','getTeams','addTeams','ids','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','Agents','select','field','tq.TeamId'];(function(_0x1d0428,_0x1696da){var _0x1a447f=function(_0x563175){while(--_0x563175){_0x1d0428['push'](_0x1d0428['shift']());}};_0x1a447f(++_0x1696da);}(_0xde5a,0x95));var _0xade5=function(_0x5ac3b8,_0x4cfaea){_0x5ac3b8=_0x5ac3b8-0x0;var _0x646606=_0xde5a[_0x5ac3b8];return _0x646606;};'use strict';var emlformat=require(_0xade5('0x0'));var rimraf=require(_0xade5('0x1'));var zipdir=require(_0xade5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xade5('0x3'));var moment=require(_0xade5('0x4'));var BPromise=require(_0xade5('0x5'));var Mustache=require(_0xade5('0x6'));var util=require(_0xade5('0x7'));var path=require(_0xade5('0x8'));var sox=require(_0xade5('0x9'));var csv=require(_0xade5('0xa'));var ejs=require(_0xade5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xade5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xade5('0xd'));var deskjs=require(_0xade5('0xe'));var toCsv=require(_0xade5('0xa'));var querystring=require(_0xade5('0xf'));var Papa=require(_0xade5('0x10'));var Redis=require('ioredis');var authService=require(_0xade5('0x11'));var qs=require(_0xade5('0x12'));var as=require(_0xade5('0x13'));var hardwareService=require(_0xade5('0x14'));var logger=require('../../config/logger')(_0xade5('0x15'));var utils=require(_0xade5('0x16'));var config=require(_0xade5('0x17'));var licenseUtil=require(_0xade5('0x18'));var db=require('../../mysqldb')['db'];config[_0xade5('0x19')]=_[_0xade5('0x1a')](config[_0xade5('0x19')],{'host':_0xade5('0x1b'),'port':0x18eb});var socket=require(_0xade5('0x1c'))(new Redis(config['redis']));require(_0xade5('0x1d'))['register'](socket);function respondWithStatusCode(_0x56305d,_0x1c0129){_0x1c0129=_0x1c0129||0xcc;return function(_0x442b8b){if(_0x442b8b){return _0x56305d[_0xade5('0x1e')](_0x1c0129);}return _0x56305d[_0xade5('0x1f')](_0x1c0129)[_0xade5('0x20')]();};}function respondWithResult(_0x4d6388,_0x57968a){_0x57968a=_0x57968a||0xc8;return function(_0x25f1ef){if(_0x25f1ef){return _0x4d6388['status'](_0x57968a)[_0xade5('0x21')](_0x25f1ef);}};}function respondWithFilteredResult(_0x5a66f4,_0x5107e8){return function(_0x368b46){if(_0x368b46){var _0x664fe1=typeof _0x5107e8[_0xade5('0x22')]==='undefined'&&typeof _0x5107e8[_0xade5('0x23')]==='undefined';var _0x365635=_0x368b46[_0xade5('0x24')];var _0x3b8885=_0x664fe1?0x0:_0x5107e8[_0xade5('0x22')];var _0x1e42ce=_0x664fe1?_0x368b46['count']:_0x5107e8['offset']+_0x5107e8['limit'];var _0x4250ed;if(_0x1e42ce>=_0x365635){_0x1e42ce=_0x365635;_0x4250ed=0xc8;}else{_0x4250ed=0xce;}_0x5a66f4[_0xade5('0x1f')](_0x4250ed);return _0x5a66f4[_0xade5('0x25')](_0xade5('0x26'),_0x3b8885+'-'+_0x1e42ce+'/'+_0x365635)[_0xade5('0x21')](_0x368b46);}return null;};}function patchUpdates(_0x4b65e3){return function(_0x20e12f){try{jsonpatch['apply'](_0x20e12f,_0x4b65e3,!![]);}catch(_0x55e5c4){return BPromise[_0xade5('0x27')](_0x55e5c4);}return _0x20e12f['save']();};}function saveUpdates(_0x568275,_0x315d1d){return function(_0x37cf11){if(_0x37cf11){return _0x37cf11['update'](_0x568275)[_0xade5('0x28')](function(_0x3d402c){return _0x3d402c;});}return null;};}function removeEntity(_0x1af4f8,_0x1d81e1){return function(_0x1fc8f8){if(_0x1fc8f8){return _0x1fc8f8[_0xade5('0x29')]()[_0xade5('0x28')](function(){var _0x1de0b4=_0x1fc8f8[_0xade5('0x2a')]({'plain':!![]});var _0x77e386=_0xade5('0x2b');return db[_0xade5('0x2c')][_0xade5('0x29')]({'where':{'type':_0x77e386,'resourceId':_0x1de0b4['id']}})[_0xade5('0x28')](function(){return _0x1fc8f8;});})[_0xade5('0x28')](function(){_0x1af4f8[_0xade5('0x1f')](0xcc)[_0xade5('0x20')]();});}};}function handleEntityNotFound(_0x40309e,_0x3fea5f){return function(_0x2e84c5){if(!_0x2e84c5){_0x40309e['sendStatus'](0x194);}return _0x2e84c5;};}function handleError(_0x19241b,_0x270d55){_0x270d55=_0x270d55||0x1f4;return function(_0x5d06e1){logger[_0xade5('0x2d')](_0x5d06e1[_0xade5('0x2e')]);if(_0x5d06e1[_0xade5('0x2f')]){delete _0x5d06e1[_0xade5('0x2f')];}_0x19241b['status'](_0x270d55)[_0xade5('0x30')](_0x5d06e1);};}exports[_0xade5('0x31')]=function(_0x406a9a,_0x37e385){var _0x2f7f4e={},_0x812c8c={},_0x170b7f={'count':0x0,'rows':[]};var _0x3b19fc=_['map'](db[_0xade5('0x32')][_0xade5('0x33')],function(_0x2414f4){return{'name':_0x2414f4['fieldName'],'type':_0x2414f4[_0xade5('0x34')]['key']};});_0x812c8c[_0xade5('0x35')]=_[_0xade5('0x36')](_0x3b19fc,'name');_0x812c8c[_0xade5('0x37')]=_[_0xade5('0x38')](_0x406a9a['query']);_0x812c8c[_0xade5('0x39')]=_['intersection'](_0x812c8c[_0xade5('0x35')],_0x812c8c[_0xade5('0x37')]);_0x2f7f4e[_0xade5('0x3a')]=_[_0xade5('0x3b')](_0x812c8c['model'],qs[_0xade5('0x3c')](_0x406a9a[_0xade5('0x37')][_0xade5('0x3c')]));_0x2f7f4e[_0xade5('0x3a')]=_0x2f7f4e[_0xade5('0x3a')][_0xade5('0x3d')]?_0x2f7f4e[_0xade5('0x3a')]:_0x812c8c[_0xade5('0x35')];if(!_0x406a9a['query'][_0xade5('0x3e')]('nolimit')){_0x2f7f4e[_0xade5('0x23')]=qs['limit'](_0x406a9a[_0xade5('0x37')]['limit']);_0x2f7f4e['offset']=qs[_0xade5('0x22')](_0x406a9a[_0xade5('0x37')][_0xade5('0x22')]);}_0x2f7f4e[_0xade5('0x3f')]=qs['sort'](_0x406a9a[_0xade5('0x37')][_0xade5('0x40')]);_0x2f7f4e[_0xade5('0x41')]=qs[_0xade5('0x39')](_[_0xade5('0x42')](_0x406a9a[_0xade5('0x37')],_0x812c8c['filters']),_0x3b19fc);if(_0x406a9a[_0xade5('0x37')][_0xade5('0x43')]){_0x2f7f4e[_0xade5('0x41')]=_[_0xade5('0x44')](_0x2f7f4e['where'],{'$or':_[_0xade5('0x36')](_0x3b19fc,function(_0x5e8433){if(_0x5e8433['type']!==_0xade5('0x45')){var _0x2f8333={};_0x2f8333[_0x5e8433[_0xade5('0x2f')]]={'$like':'%'+_0x406a9a['query']['filter']+'%'};return _0x2f8333;}})});}_0x2f7f4e=_['merge']({},_0x2f7f4e,_0x406a9a[_0xade5('0x46')]);var _0x49778a={'where':_0x2f7f4e[_0xade5('0x41')]};return db[_0xade5('0x32')]['count'](_0x49778a)[_0xade5('0x28')](function(_0x1275cf){_0x170b7f[_0xade5('0x24')]=_0x1275cf;if(_0x406a9a[_0xade5('0x37')][_0xade5('0x47')]){_0x2f7f4e[_0xade5('0x48')]=[{'all':!![]}];}return db[_0xade5('0x32')][_0xade5('0x49')](_0x2f7f4e);})[_0xade5('0x28')](function(_0x426a75){_0x170b7f[_0xade5('0x4a')]=_0x426a75;return _0x170b7f;})['then'](respondWithFilteredResult(_0x37e385,_0x2f7f4e))[_0xade5('0x4b')](handleError(_0x37e385,null));};exports['show']=function(_0x49a34f,_0x3e983d){var _0x3572d2={'raw':!![],'where':{'id':_0x49a34f[_0xade5('0x4c')]['id']}},_0x1d5b3b={};_0x1d5b3b[_0xade5('0x35')]=_['keys'](db[_0xade5('0x32')][_0xade5('0x33')]);_0x1d5b3b[_0xade5('0x37')]=_[_0xade5('0x38')](_0x49a34f[_0xade5('0x37')]);_0x1d5b3b[_0xade5('0x39')]=_[_0xade5('0x3b')](_0x1d5b3b[_0xade5('0x35')],_0x1d5b3b[_0xade5('0x37')]);_0x3572d2['attributes']=_[_0xade5('0x3b')](_0x1d5b3b[_0xade5('0x35')],qs[_0xade5('0x3c')](_0x49a34f[_0xade5('0x37')][_0xade5('0x3c')]));_0x3572d2[_0xade5('0x3a')]=_0x3572d2[_0xade5('0x3a')][_0xade5('0x3d')]?_0x3572d2[_0xade5('0x3a')]:_0x1d5b3b[_0xade5('0x35')];if(_0x49a34f[_0xade5('0x37')]['includeAll']){_0x3572d2[_0xade5('0x48')]=[{'all':!![]}];}_0x3572d2=_[_0xade5('0x44')]({},_0x3572d2,_0x49a34f[_0xade5('0x46')]);return db[_0xade5('0x32')][_0xade5('0x4d')](_0x3572d2)[_0xade5('0x28')](handleEntityNotFound(_0x3e983d,null))[_0xade5('0x28')](respondWithResult(_0x3e983d,null))['catch'](handleError(_0x3e983d,null));};exports[_0xade5('0x4e')]=function(_0x5daef5,_0x2e2a75){return db['FaxQueue'][_0xade5('0x4e')](_0x5daef5[_0xade5('0x4f')],{})['then'](function(_0x4d9990){var _0x47d9e9=_0x5daef5[_0xade5('0x50')]['get']({'plain':!![]});if(!_0x47d9e9)throw new Error(_0xade5('0x51'));if(_0x47d9e9[_0xade5('0x52')]===_0xade5('0x50')){var _0x34e17b=_0x4d9990[_0xade5('0x2a')]({'plain':!![]});var _0x240cb9=_0xade5('0x2b');return db[_0xade5('0x53')][_0xade5('0x4d')]({'where':{'name':_0x240cb9,'userProfileId':_0x47d9e9['userProfileId']},'raw':!![]})[_0xade5('0x28')](function(_0x5454b6){if(_0x5454b6&&_0x5454b6[_0xade5('0x54')]===0x0){return db[_0xade5('0x2c')][_0xade5('0x4e')]({'name':_0x34e17b[_0xade5('0x2f')],'resourceId':_0x34e17b['id'],'type':_0x5454b6[_0xade5('0x2f')],'sectionId':_0x5454b6['id']},{})[_0xade5('0x28')](function(){return _0x4d9990;});}else{return _0x4d9990;}})[_0xade5('0x4b')](function(_0x202c6f){logger[_0xade5('0x2d')](_0xade5('0x55'),_0x202c6f);throw _0x202c6f;});}return _0x4d9990;})[_0xade5('0x28')](respondWithResult(_0x2e2a75,0xc9))[_0xade5('0x4b')](handleError(_0x2e2a75,null));};exports['update']=function(_0x6e794b,_0x28e8fa){if(_0x6e794b[_0xade5('0x4f')]['id']){delete _0x6e794b[_0xade5('0x4f')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x6e794b[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x28e8fa,null))[_0xade5('0x28')](saveUpdates(_0x6e794b['body'],null))[_0xade5('0x28')](respondWithResult(_0x28e8fa,null))['catch'](handleError(_0x28e8fa,null));};exports[_0xade5('0x29')]=function(_0x2f7177,_0x4f480e){return db[_0xade5('0x32')][_0xade5('0x4d')]({'where':{'id':_0x2f7177['params']['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x4f480e,null))[_0xade5('0x28')](removeEntity(_0x4f480e,null))[_0xade5('0x4b')](handleError(_0x4f480e,null));};exports['describe']=function(_0xb2d20c,_0x106a70){return db[_0xade5('0x32')]['describe']()['then'](respondWithResult(_0x106a70,null))[_0xade5('0x4b')](handleError(_0x106a70,null));};exports[_0xade5('0x56')]=function(_0x128b95,_0x5a00bc,_0x2f296d){var _0x1a37ed={'raw':!![],'where':{}},_0x179ceb={},_0x2c0ebd;return db['FaxQueue'][_0xade5('0x57')]({'where':{'id':_0x128b95['params']['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x5a00bc,null))[_0xade5('0x28')](function(_0x46bbae){if(_0x46bbae){_0x2c0ebd=_0x46bbae['get']({'plain':!![]});_0x179ceb[_0xade5('0x35')]=_[_0xade5('0x38')](db[_0xade5('0x58')]['rawAttributes']);_0x179ceb[_0xade5('0x37')]=_[_0xade5('0x38')](_0x128b95['query']);_0x179ceb['filters']=_[_0xade5('0x3b')](_0x179ceb[_0xade5('0x35')],_0x179ceb[_0xade5('0x37')]);_0x1a37ed[_0xade5('0x3a')]=_[_0xade5('0x3b')](_0x179ceb[_0xade5('0x35')],qs[_0xade5('0x3c')](_0x128b95['query']['fields']));_0x1a37ed[_0xade5('0x3a')]=_0x1a37ed[_0xade5('0x3a')][_0xade5('0x3d')]?_0x1a37ed['attributes']:_0x179ceb[_0xade5('0x35')];if(!_0x128b95['query'][_0xade5('0x3e')](_0xade5('0x59'))){_0x1a37ed[_0xade5('0x23')]=qs[_0xade5('0x23')](_0x128b95[_0xade5('0x37')][_0xade5('0x23')]);_0x1a37ed[_0xade5('0x22')]=qs[_0xade5('0x22')](_0x128b95[_0xade5('0x37')][_0xade5('0x22')]);}_0x1a37ed['order']=qs['sort'](_0x128b95[_0xade5('0x37')][_0xade5('0x40')]);_0x1a37ed[_0xade5('0x41')]=qs['filters'](_[_0xade5('0x42')](_0x128b95[_0xade5('0x37')],_0x179ceb[_0xade5('0x39')]));_0x1a37ed[_0xade5('0x41')]['FaxQueueId']=_0x46bbae['id'];if(_0x128b95[_0xade5('0x37')]['filter']){_0x1a37ed[_0xade5('0x41')]=_[_0xade5('0x44')](_0x1a37ed['where'],{'$or':_['map'](_0x1a37ed['attributes'],function(_0x546bc4){var _0x70117={};_0x70117[_0x546bc4]={'$like':'%'+_0x128b95[_0xade5('0x37')][_0xade5('0x43')]+'%'};return _0x70117;})});}_0x1a37ed=_[_0xade5('0x44')]({},_0x1a37ed,_0x128b95[_0xade5('0x46')]);return db[_0xade5('0x58')]['findAll'](_0x1a37ed);}})['then'](function(_0x5a0240){if(_0x5a0240){return db['User'][_0xade5('0x5a')]({'where':{'id':_[_0xade5('0x36')](_0x5a0240,'UserId'),'role':_0xade5('0x5b')},'attributes':['id',_0xade5('0x2f'),'faxPause',_0xade5('0x5c'),_0xade5('0x5d')]});}})[_0xade5('0x28')](function(_0x330bd5){if(_0x330bd5){return{'count':_0x330bd5[_0xade5('0x24')],'rows':_[_0xade5('0x36')](_0x330bd5[_0xade5('0x4a')],function(_0x197391){return{'membername':_0x197391[_0xade5('0x2f')],'UserId':_0x197391['id'],'queue_name':_0x2c0ebd['name'],'FaxQueueId':_0x2c0ebd['id'],'interface':util[_0xade5('0x5e')](_0xade5('0x5f'),'SIP',_0x197391[_0xade5('0x2f')]),'penalty':0x0,'paused':_0x197391[_0xade5('0x60')],'createdAt':_0x197391['createdAt'],'updatedAt':_0x197391[_0xade5('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xade5('0x28')](respondWithFilteredResult(_0x5a00bc,_0x1a37ed))['catch'](handleError(_0x5a00bc,null));};exports['getTeams']=function(_0x321d15,_0x1e539b,_0x53c295){var _0x150977={};var _0x198fce={};var _0x476a26;var _0x179c10;return db[_0xade5('0x32')][_0xade5('0x57')]({'where':{'id':_0x321d15[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x1e539b,null))['then'](function(_0x575993){if(_0x575993){_0x476a26=_0x575993;_0x198fce[_0xade5('0x35')]=_[_0xade5('0x38')](db[_0xade5('0x61')][_0xade5('0x33')]);_0x198fce[_0xade5('0x37')]=_[_0xade5('0x38')](_0x321d15['query']);_0x198fce[_0xade5('0x39')]=_[_0xade5('0x3b')](_0x198fce[_0xade5('0x35')],_0x198fce[_0xade5('0x37')]);_0x150977[_0xade5('0x3a')]=_[_0xade5('0x3b')](_0x198fce['model'],qs['fields'](_0x321d15[_0xade5('0x37')][_0xade5('0x3c')]));_0x150977[_0xade5('0x3a')]=_0x150977[_0xade5('0x3a')][_0xade5('0x3d')]?_0x150977['attributes']:_0x198fce[_0xade5('0x35')];_0x150977[_0xade5('0x3f')]=qs[_0xade5('0x40')](_0x321d15[_0xade5('0x37')][_0xade5('0x40')]);_0x150977[_0xade5('0x41')]=qs[_0xade5('0x39')](_[_0xade5('0x42')](_0x321d15[_0xade5('0x37')],_0x198fce[_0xade5('0x39')]));if(_0x321d15[_0xade5('0x37')][_0xade5('0x43')]){_0x150977['where']=_[_0xade5('0x44')](_0x150977[_0xade5('0x41')],{'$or':_[_0xade5('0x36')](_0x150977[_0xade5('0x3a')],function(_0x43aa3f){var _0x19517f={};_0x19517f[_0x43aa3f]={'$like':'%'+_0x321d15[_0xade5('0x37')][_0xade5('0x43')]+'%'};return _0x19517f;})});}_0x150977=_['merge']({},_0x150977,_0x321d15[_0xade5('0x46')]);return _0x476a26[_0xade5('0x62')](_0x150977);}})[_0xade5('0x28')](function(_0x54d640){if(_0x54d640){_0x179c10=_0x54d640[_0xade5('0x3d')];if(!_0x321d15['query'][_0xade5('0x3e')](_0xade5('0x59'))){_0x150977[_0xade5('0x23')]=qs[_0xade5('0x23')](_0x321d15[_0xade5('0x37')][_0xade5('0x23')]);_0x150977['offset']=qs['offset'](_0x321d15[_0xade5('0x37')][_0xade5('0x22')]);}return _0x476a26[_0xade5('0x62')](_0x150977);}})[_0xade5('0x28')](function(_0x2c3071){if(_0x2c3071){return _0x2c3071?{'count':_0x179c10,'rows':_0x2c3071}:null;}})[_0xade5('0x28')](respondWithResult(_0x1e539b,null))['catch'](handleError(_0x1e539b,null));};exports[_0xade5('0x63')]=function(_0x309850,_0x144cf0,_0x59ea99){var _0x4e9b60=_0x309850[_0xade5('0x4f')][_0xade5('0x64')];return db[_0xade5('0x61')][_0xade5('0x49')]({'where':{'id':_0x4e9b60},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xade5('0x65'),_0xade5('0x66'),_0xade5('0x67')],'raw':!![]}]})[_0xade5('0x28')](function(_0x38530b){if(_0x38530b){var _0x2c3864=_['flatMap'](_0x38530b,function(_0x46f938){var _0x5af6fa=_0x46f938['get']({'plain':!![]});return _0x5af6fa['Agents'];});return db[_0xade5('0x32')][_0xade5('0x4d')]({'where':{'id':_0x309850['params']['id']}})[_0xade5('0x28')](function(_0x445d63){return db[_0xade5('0x68')][_0xade5('0x69')](function(_0x2119c8){return _0x445d63[_0xade5('0x63')](_0x4e9b60,{'transaction':_0x2119c8})[_0xade5('0x28')](function(){return BPromise[_0xade5('0x6a')](_0x2c3864,function(_0x5cc92b){return db['UserFaxQueue'][_0xade5('0x6b')]({'where':{'UserId':_0x5cc92b['id'],'FaxQueueId':_0x309850['params']['id']},'transaction':_0x2119c8});});})[_0xade5('0x28')](function(){_0x2c3864[_0xade5('0x6c')](function(_0x505967){socket[_0xade5('0x6d')](_0xade5('0x6e'),{'UserId':_0x505967['id'],'FaxQueueId':_0x445d63['id']});});});});});}})[_0xade5('0x28')](respondWithStatusCode(_0x144cf0,null))[_0xade5('0x4b')](handleError(_0x144cf0,null));};exports[_0xade5('0x6f')]=function(_0x36d7d8,_0x4e6e3f,_0x2ce91d){return db[_0xade5('0x61')][_0xade5('0x49')]({'where':{'id':_0x36d7d8[_0xade5('0x37')][_0xade5('0x64')]},'attributes':['id'],'include':[{'model':db[_0xade5('0x70')],'as':_0xade5('0x71'),'attributes':['id'],'raw':!![]}]})[_0xade5('0x28')](handleEntityNotFound(_0x4e6e3f,null))[_0xade5('0x28')](function(_0x198694){var _0x18f1e8=_[_0xade5('0x36')](_0x198694,'id');var _0x219d8a=[];var _0x1a17f6=[];var _0xacca96=squel[_0xade5('0x72')]();_0xacca96[_0xade5('0x73')](_0xade5('0x74'))[_0xade5('0x75')]('team_has_fax_queues','tq')['join']('user_has_teams','ut',_0xade5('0x76'))[_0xade5('0x41')](_0xade5('0x77'),_0x36d7d8[_0xade5('0x4c')]['id']);for(var _0x2b957b=0x0;_0x2b957b<_0x198694['length'];_0x2b957b+=0x1){let _0x30015d=_0x198694[_0x2b957b];for(var _0x3bb44e=0x0;_0x3bb44e<_0x30015d['Agents'][_0xade5('0x3d')];_0x3bb44e+=0x1){let _0x15f853=_0x30015d[_0xade5('0x71')][_0x3bb44e];var _0x191a9c=_0xacca96[_0xade5('0x78')]();_0x191a9c[_0xade5('0x41')]('ut.UserId\x20=\x20?',_0x15f853['id']);_0x1a17f6['push'](db[_0xade5('0x68')]['query'](_0x191a9c['toString'](),{'type':db[_0xade5('0x68')][_0xade5('0x79')]['SELECT']})['then'](function(_0x575012){if(_0x575012[_0xade5('0x3d')]===0x1){return _0x15f853['id'];}else{var _0x21f969=_[_0xade5('0x7a')](_['map'](_0x575012,_0xade5('0x7b')),function(_0x27da00){return _[_0xade5('0x7c')](_0x18f1e8,_0x27da00);});if(_0x21f969){return _0x15f853['id'];}}}));}}return BPromise[_0xade5('0x7d')](_0x1a17f6)[_0xade5('0x28')](function(_0xf411fc){_0x219d8a=_(_0x219d8a)[_0xade5('0x7e')](_0xf411fc)[_0xade5('0x7f')]()['value']();return db[_0xade5('0x32')]['find']({'where':{'id':_0x36d7d8[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](function(_0xac6fac){return db[_0xade5('0x68')]['transaction'](function(_0x2261f0){return _0xac6fac[_0xade5('0x6f')](_0x36d7d8[_0xade5('0x37')]['ids'],{'transaction':_0x2261f0})['then'](function(){if(!_['isEmpty'](_0x219d8a)){return _0xac6fac['removeAgents'](_0x219d8a,{'transaction':_0x2261f0});}})[_0xade5('0x28')](function(){_0x219d8a['forEach'](function(_0x762918){socket[_0xade5('0x6d')](_0xade5('0x80'),{'UserId':_0x762918,'FaxQueueId':_0xac6fac['id']});});});});});});})['then'](respondWithStatusCode(_0x4e6e3f,null))[_0xade5('0x4b')](handleError(_0x4e6e3f,null));};exports['addAgents']=function(_0x2a1374,_0x50ff51,_0x2b0946){return db[_0xade5('0x32')]['find']({'where':{'id':_0x2a1374[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x50ff51,null))['then'](function(_0x146bf3){if(_0x146bf3){return _0x146bf3['addAgents'](_0x2a1374[_0xade5('0x4f')][_0xade5('0x64')],_[_0xade5('0x81')](_0x2a1374[_0xade5('0x4f')],[_0xade5('0x64'),'id'])||{})['spread'](function(_0x335665){for(var _0x3b9c4b=0x0;_0x3b9c4b<_0x2a1374[_0xade5('0x4f')][_0xade5('0x64')]['length'];_0x3b9c4b+=0x1){socket[_0xade5('0x6d')](_0xade5('0x6e'),{'UserId':Number(_0x2a1374[_0xade5('0x4f')][_0xade5('0x64')][_0x3b9c4b]),'FaxQueueId':Number(_0x2a1374[_0xade5('0x4c')]['id'])});}return _0x335665;});}})[_0xade5('0x28')](respondWithResult(_0x50ff51,null))[_0xade5('0x4b')](handleError(_0x50ff51,null));};exports[_0xade5('0x82')]=function(_0x3ab0cb,_0x1d6541,_0x40e9c7){return db['FaxQueue'][_0xade5('0x4d')]({'where':{'id':_0x3ab0cb[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x1d6541,null))[_0xade5('0x28')](function(_0x3f06a8){if(_0x3f06a8){return _0x3f06a8[_0xade5('0x82')](_0x3ab0cb[_0xade5('0x37')][_0xade5('0x64')])['then'](function(){if(_[_0xade5('0x83')](_0x3ab0cb['query']['ids'])){for(var _0x489d72=0x0;_0x489d72<_0x3ab0cb['query'][_0xade5('0x64')][_0xade5('0x3d')];_0x489d72+=0x1){socket['emit'](_0xade5('0x80'),{'UserId':Number(_0x3ab0cb[_0xade5('0x37')]['ids'][_0x489d72]),'FaxQueueId':Number(_0x3ab0cb[_0xade5('0x4c')]['id'])});}}else{socket[_0xade5('0x6d')](_0xade5('0x80'),{'UserId':Number(_0x3ab0cb['query']['ids']),'FaxQueueId':Number(_0x3ab0cb['params']['id'])});}});}})[_0xade5('0x28')](respondWithStatusCode(_0x1d6541,null))[_0xade5('0x4b')](handleError(_0x1d6541,null));};exports[_0xade5('0x84')]=function(_0x22447f,_0x369ca7,_0x546331){var _0x173313={};var _0x1dcd07={};var _0x3a7d09;var _0x1c9dbc;return db[_0xade5('0x32')][_0xade5('0x57')]({'where':{'id':_0x22447f[_0xade5('0x4c')]['id']}})[_0xade5('0x28')](handleEntityNotFound(_0x369ca7,null))[_0xade5('0x28')](function(_0x31db9b){if(_0x31db9b){_0x3a7d09=_0x31db9b;_0x1dcd07[_0xade5('0x35')]=_[_0xade5('0x38')](db[_0xade5('0x70')]['rawAttributes']);_0x1dcd07[_0xade5('0x37')]=_[_0xade5('0x38')](_0x22447f[_0xade5('0x37')]);_0x1dcd07[_0xade5('0x39')]=_[_0xade5('0x3b')](_0x1dcd07[_0xade5('0x35')],_0x1dcd07[_0xade5('0x37')]);_0x173313[_0xade5('0x3a')]=_[_0xade5('0x3b')](_0x1dcd07[_0xade5('0x35')],qs[_0xade5('0x3c')](_0x22447f[_0xade5('0x37')][_0xade5('0x3c')]));_0x173313['attributes']=_0x173313[_0xade5('0x3a')]['length']?_0x173313['attributes']:_0x1dcd07['model'];_0x173313[_0xade5('0x3f')]=qs[_0xade5('0x40')](_0x22447f[_0xade5('0x37')][_0xade5('0x40')]);_0x173313['where']=qs['filters'](_[_0xade5('0x42')](_0x22447f['query'],_0x1dcd07[_0xade5('0x39')]));if(_0x22447f[_0xade5('0x37')][_0xade5('0x43')]){_0x173313[_0xade5('0x41')]=_['merge'](_0x173313[_0xade5('0x41')],{'$or':_[_0xade5('0x36')](_0x173313['attributes'],function(_0x1d2872){var _0x9c9852={};_0x9c9852[_0x1d2872]={'$like':'%'+_0x22447f[_0xade5('0x37')][_0xade5('0x43')]+'%'};return _0x9c9852;})});}_0x173313=_[_0xade5('0x44')]({},_0x173313,_0x22447f[_0xade5('0x46')]);return _0x3a7d09[_0xade5('0x84')](_0x173313);}})[_0xade5('0x28')](function(_0xad1921){if(_0xad1921){_0x1c9dbc=_0xad1921[_0xade5('0x3d')];if(!_0x22447f[_0xade5('0x37')][_0xade5('0x3e')](_0xade5('0x59'))){_0x173313[_0xade5('0x23')]=qs[_0xade5('0x23')](_0x22447f[_0xade5('0x37')]['limit']);_0x173313[_0xade5('0x22')]=qs[_0xade5('0x22')](_0x22447f[_0xade5('0x37')][_0xade5('0x22')]);}return _0x3a7d09[_0xade5('0x84')](_0x173313);}})[_0xade5('0x28')](function(_0xcf8bbc){if(_0xcf8bbc){return _0xcf8bbc?{'count':_0x1c9dbc,'rows':_0xcf8bbc}:null;}})['then'](respondWithResult(_0x369ca7,null))[_0xade5('0x4b')](handleError(_0x369ca7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 60d9d46..f5350db 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 _0xf7f3=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x53a675,_0xfbe1cb){var _0x45e888=function(_0x54d0f6){while(--_0x54d0f6){_0x53a675['push'](_0x53a675['shift']());}};_0x45e888(++_0xfbe1cb);}(_0xf7f3,0xbe));var _0x3f7f=function(_0x3d32fd,_0x5bc2e7){_0x3d32fd=_0x3d32fd-0x0;var _0x3be501=_0xf7f3[_0x3d32fd];return _0x3be501;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3f7f('0x0'))['db'][_0x3f7f('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3f7f('0x2')](0x0);var events={'afterCreate':_0x3f7f('0x3'),'afterUpdate':_0x3f7f('0x4'),'afterDestroy':_0x3f7f('0x5')};function emitEvent(_0x38f646){return function(_0x433f1e,_0x25371e,_0x16cc1d){FaxQueueEvents['emit'](_0x38f646+':'+_0x433f1e['id'],_0x433f1e);FaxQueueEvents[_0x3f7f('0x6')](_0x38f646,_0x433f1e);_0x16cc1d(null);};}for(var e in events){if(events[_0x3f7f('0x7')](e)){var event=events[e];FaxQueue[_0x3f7f('0x8')](e,emitEvent(event));}}module[_0x3f7f('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xb2c2=['events','../../mysqldb','FaxQueue','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1b7ba7,_0x5f1a2a){var _0xc7ab78=function(_0x37ed77){while(--_0x37ed77){_0x1b7ba7['push'](_0x1b7ba7['shift']());}};_0xc7ab78(++_0x5f1a2a);}(_0xb2c2,0x1d4));var _0x2b2c=function(_0x28fe94,_0x120b9b){_0x28fe94=_0x28fe94-0x0;var _0x3560da=_0xb2c2[_0x28fe94];return _0x3560da;};'use strict';var EventEmitter=require(_0x2b2c('0x0'));var FaxQueue=require(_0x2b2c('0x1'))['db'][_0x2b2c('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2b2c('0x3'),'afterUpdate':_0x2b2c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x471b43){return function(_0x32d934,_0xa691a5,_0x4490cd){FaxQueueEvents[_0x2b2c('0x5')](_0x471b43+':'+_0x32d934['id'],_0x32d934);FaxQueueEvents['emit'](_0x471b43,_0x32d934);_0x4490cd(null);};}for(var e in events){if(events[_0x2b2c('0x6')](e)){var event=events[e];FaxQueue[_0x2b2c('0x7')](e,emitEvent(event));}}module[_0x2b2c('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f2403bd..bb852ab 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 _0x4c28=['path','rimraf','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x41d7d0,_0x2bc0e0){var _0x4945a1=function(_0x5f4196){while(--_0x5f4196){_0x41d7d0['push'](_0x41d7d0['shift']());}};_0x4945a1(++_0x2bc0e0);}(_0x4c28,0xed));var _0x84c2=function(_0x59f885,_0x3239cc){_0x59f885=_0x59f885-0x0;var _0x51762c=_0x4c28[_0x59f885];return _0x51762c;};'use strict';var _=require(_0x84c2('0x0'));var util=require('util');var logger=require(_0x84c2('0x1'))(_0x84c2('0x2'));var moment=require(_0x84c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x84c2('0x4'));var fs=require('fs');var path=require(_0x84c2('0x5'));var rimraf=require(_0x84c2('0x6'));var config=require('../../config/environment');var attributes=require(_0x84c2('0x7'));module[_0x84c2('0x8')]=function(_0x20c2c3,_0x10e960){return _0x20c2c3[_0x84c2('0x9')]('FaxQueue',attributes,{'tableName':_0x84c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45ad=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1de3b3,_0x36bf8c){var _0x9a6b06=function(_0xbb8936){while(--_0xbb8936){_0x1de3b3['push'](_0x1de3b3['shift']());}};_0x9a6b06(++_0x36bf8c);}(_0x45ad,0x1f2));var _0xd45a=function(_0x115d8d,_0xacde78){_0x115d8d=_0x115d8d-0x0;var _0x250c76=_0x45ad[_0x115d8d];return _0x250c76;};'use strict';var _=require(_0xd45a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd45a('0x1'));var moment=require(_0xd45a('0x2'));var BPromise=require(_0xd45a('0x3'));var rp=require(_0xd45a('0x4'));var fs=require('fs');var path=require(_0xd45a('0x5'));var rimraf=require(_0xd45a('0x6'));var config=require(_0xd45a('0x7'));var attributes=require(_0xd45a('0x8'));module[_0xd45a('0x9')]=function(_0x242e69,_0x2c7627){return _0x242e69[_0xd45a('0xa')]('FaxQueue',attributes,{'tableName':_0xd45a('0xb'),'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 a6e08a8..cfd2885 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 _0x3279=['ShowFaxQueue','FaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x4a1d5e,_0x2f7f95){var _0x45726c=function(_0x2fb0ac){while(--_0x2fb0ac){_0x4a1d5e['push'](_0x4a1d5e['shift']());}};_0x45726c(++_0x2f7f95);}(_0x3279,0xca));var _0x9327=function(_0x8eccbc,_0x57f162){_0x8eccbc=_0x8eccbc-0x0;var _0x19185a=_0x3279[_0x8eccbc];return _0x19185a;};'use strict';var _=require(_0x9327('0x0'));var util=require(_0x9327('0x1'));var moment=require(_0x9327('0x2'));var BPromise=require(_0x9327('0x3'));var rs=require(_0x9327('0x4'));var fs=require('fs');var Redis=require(_0x9327('0x5'));var db=require(_0x9327('0x6'))['db'];var utils=require(_0x9327('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9327('0x8'));var jayson=require(_0x9327('0x9'));var client=jayson['client'][_0x9327('0xa')]({'port':0x232a});config[_0x9327('0xb')]=_[_0x9327('0xc')](config[_0x9327('0xb')],{'host':_0x9327('0xd'),'port':0x18eb});var socket=require(_0x9327('0xe'))(new Redis(config[_0x9327('0xb')]));require('./faxQueue.socket')[_0x9327('0xf')](socket);function respondWithRpcPromise(_0x121f56,_0xb17c84,_0x50592b){return new BPromise(function(_0x5c6d28,_0x4d98f5){return client[_0x9327('0x10')](_0x121f56,_0x50592b)[_0x9327('0x11')](function(_0x18d196){logger[_0x9327('0x12')](_0x9327('0x13'),_0xb17c84,'request\x20sent');logger[_0x9327('0x14')](_0x9327('0x15'),_0xb17c84,_0x9327('0x16'),JSON[_0x9327('0x17')](_0x18d196));if(_0x18d196['error']){if(_0x18d196['error']['code']===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0xb17c84,_0x18d196[_0x9327('0x18')][_0x9327('0x19')]);return _0x4d98f5(_0x18d196[_0x9327('0x18')]['message']);}logger[_0x9327('0x18')]('FaxQueue,\x20%s,\x20%s',_0xb17c84,_0x18d196[_0x9327('0x18')]['message']);return _0x5c6d28(_0x18d196[_0x9327('0x18')][_0x9327('0x19')]);}else{logger['info'](_0x9327('0x13'),_0xb17c84,_0x9327('0x16'));_0x5c6d28(_0x18d196[_0x9327('0x1a')][_0x9327('0x19')]);}})[_0x9327('0x1b')](function(_0x3b57df){logger[_0x9327('0x18')](_0x9327('0x13'),_0xb17c84,_0x3b57df);_0x4d98f5(_0x3b57df);});});}exports[_0x9327('0x1c')]=function(_0x5589aa){var _0x22c805=this;return new Promise(function(_0x4557c3,_0x15901f){return db['FaxQueue'][_0x9327('0x1d')]({'raw':_0x5589aa[_0x9327('0x1e')]?_0x5589aa[_0x9327('0x1e')][_0x9327('0x1f')]===undefined?!![]:![]:!![],'where':_0x5589aa[_0x9327('0x1e')]?_0x5589aa['options'][_0x9327('0x20')]||null:null,'attributes':_0x5589aa[_0x9327('0x1e')]?_0x5589aa[_0x9327('0x1e')][_0x9327('0x21')]||null:null,'limit':_0x5589aa[_0x9327('0x1e')]?_0x5589aa['options'][_0x9327('0x22')]||null:null,'include':_0x5589aa[_0x9327('0x1e')]?_0x5589aa[_0x9327('0x1e')]['include']?_[_0x9327('0x23')](_0x5589aa['options'][_0x9327('0x24')],function(_0x14cbca){return{'model':db[_0x14cbca[_0x9327('0x25')]],'as':_0x14cbca['as'],'attributes':_0x14cbca[_0x9327('0x21')],'include':_0x14cbca[_0x9327('0x24')]?_[_0x9327('0x23')](_0x14cbca[_0x9327('0x24')],function(_0x421e68){return{'model':db[_0x421e68['model']],'as':_0x421e68['as'],'attributes':_0x421e68[_0x9327('0x21')],'include':_0x421e68[_0x9327('0x24')]?_[_0x9327('0x23')](_0x421e68['include'],function(_0x405be3){return{'model':db[_0x405be3['model']],'as':_0x405be3['as'],'attributes':_0x405be3[_0x9327('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9327('0x11')](function(_0x26dae9){logger[_0x9327('0x12')]('GetFaxQueue',_0x5589aa);logger[_0x9327('0x14')](_0x9327('0x1c'),_0x5589aa,JSON[_0x9327('0x17')](_0x26dae9));_0x4557c3(_0x26dae9);})['catch'](function(_0x5738f4){logger[_0x9327('0x18')]('GetFaxQueue',_0x5738f4['message'],_0x5589aa);_0x15901f(_0x22c805['error'](0x1f4,_0x5738f4[_0x9327('0x19')]));});});};exports[_0x9327('0x26')]=function(_0x59f7de){var _0x519fe2=this;return new Promise(function(_0xa43819,_0x1ab0a3){return db[_0x9327('0x27')]['find']({'raw':_0x59f7de[_0x9327('0x1e')]?_0x59f7de[_0x9327('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7de[_0x9327('0x1e')]?_0x59f7de['options'][_0x9327('0x20')]||null:null,'attributes':_0x59f7de[_0x9327('0x1e')]?_0x59f7de['options'][_0x9327('0x21')]||null:null,'include':_0x59f7de[_0x9327('0x1e')]?_0x59f7de[_0x9327('0x1e')][_0x9327('0x24')]?_[_0x9327('0x23')](_0x59f7de[_0x9327('0x1e')]['include'],function(_0x45b7a0){return{'model':db[_0x45b7a0[_0x9327('0x25')]],'as':_0x45b7a0['as'],'attributes':_0x45b7a0[_0x9327('0x21')],'include':_0x45b7a0[_0x9327('0x24')]?_[_0x9327('0x23')](_0x45b7a0['include'],function(_0x3fcb6f){return{'model':db[_0x3fcb6f[_0x9327('0x25')]],'as':_0x3fcb6f['as'],'attributes':_0x3fcb6f[_0x9327('0x21')],'include':_0x3fcb6f[_0x9327('0x24')]?_[_0x9327('0x23')](_0x3fcb6f[_0x9327('0x24')],function(_0x44714f){return{'model':db[_0x44714f[_0x9327('0x25')]],'as':_0x44714f['as'],'attributes':_0x44714f[_0x9327('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9327('0x11')](function(_0x491d14){logger['info'](_0x9327('0x26'),_0x59f7de);logger['debug'](_0x9327('0x26'),_0x59f7de,JSON['stringify'](_0x491d14));_0xa43819(_0x491d14);})[_0x9327('0x1b')](function(_0x2e2a99){logger[_0x9327('0x18')](_0x9327('0x26'),_0x2e2a99[_0x9327('0x19')],_0x59f7de);_0x1ab0a3(_0x519fe2[_0x9327('0x18')](0x1f4,_0x2e2a99['message']));});});}; \ No newline at end of file +var _0xa36a=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFaxQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x264eeb,_0xc05998){var _0xa45c83=function(_0x2a82d9){while(--_0x2a82d9){_0x264eeb['push'](_0x264eeb['shift']());}};_0xa45c83(++_0xc05998);}(_0xa36a,0x143));var _0xaa36=function(_0x2598b2,_0x3e099a){_0x2598b2=_0x2598b2-0x0;var _0x1c1bb9=_0xa36a[_0x2598b2];return _0x1c1bb9;};'use strict';var _=require('lodash');var util=require(_0xaa36('0x0'));var moment=require('moment');var BPromise=require(_0xaa36('0x1'));var rs=require(_0xaa36('0x2'));var fs=require('fs');var Redis=require(_0xaa36('0x3'));var db=require(_0xaa36('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa36('0x5'))(_0xaa36('0x6'));var config=require(_0xaa36('0x7'));var jayson=require(_0xaa36('0x8'));var client=jayson['client'][_0xaa36('0x9')]({'port':0x232a});config['redis']=_[_0xaa36('0xa')](config[_0xaa36('0xb')],{'host':_0xaa36('0xc'),'port':0x18eb});var socket=require(_0xaa36('0xd'))(new Redis(config['redis']));require(_0xaa36('0xe'))[_0xaa36('0xf')](socket);function respondWithRpcPromise(_0x30a263,_0x5474a6,_0x1a95c1){return new BPromise(function(_0x20c4de,_0x1967bb){return client['request'](_0x30a263,_0x1a95c1)[_0xaa36('0x10')](function(_0x6d9511){logger[_0xaa36('0x11')](_0xaa36('0x12'),_0x5474a6,_0xaa36('0x13'));logger['debug'](_0xaa36('0x14'),_0x5474a6,_0xaa36('0x13'),JSON[_0xaa36('0x15')](_0x6d9511));if(_0x6d9511[_0xaa36('0x16')]){if(_0x6d9511[_0xaa36('0x16')][_0xaa36('0x17')]===0x1f4){logger[_0xaa36('0x16')](_0xaa36('0x12'),_0x5474a6,_0x6d9511[_0xaa36('0x16')][_0xaa36('0x18')]);return _0x1967bb(_0x6d9511['error'][_0xaa36('0x18')]);}logger[_0xaa36('0x16')](_0xaa36('0x12'),_0x5474a6,_0x6d9511[_0xaa36('0x16')][_0xaa36('0x18')]);return _0x20c4de(_0x6d9511[_0xaa36('0x16')][_0xaa36('0x18')]);}else{logger[_0xaa36('0x11')](_0xaa36('0x12'),_0x5474a6,_0xaa36('0x13'));_0x20c4de(_0x6d9511[_0xaa36('0x19')]['message']);}})[_0xaa36('0x1a')](function(_0x391768){logger[_0xaa36('0x16')]('FaxQueue,\x20%s,\x20%s',_0x5474a6,_0x391768);_0x1967bb(_0x391768);});});}exports[_0xaa36('0x1b')]=function(_0x4bd4dc){var _0x354886=this;return new Promise(function(_0x315e47,_0x48f85f){return db[_0xaa36('0x1c')][_0xaa36('0x1d')]({'raw':_0x4bd4dc['options']?_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x1f')]===undefined?!![]:![]:!![],'where':_0x4bd4dc[_0xaa36('0x1e')]?_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x20')]||null:null,'attributes':_0x4bd4dc['options']?_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x21')]||null:null,'limit':_0x4bd4dc[_0xaa36('0x1e')]?_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x22')]||null:null,'include':_0x4bd4dc[_0xaa36('0x1e')]?_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x23')]?_[_0xaa36('0x24')](_0x4bd4dc[_0xaa36('0x1e')][_0xaa36('0x23')],function(_0x32c0aa){return{'model':db[_0x32c0aa['model']],'as':_0x32c0aa['as'],'attributes':_0x32c0aa[_0xaa36('0x21')],'include':_0x32c0aa[_0xaa36('0x23')]?_['map'](_0x32c0aa[_0xaa36('0x23')],function(_0x3ba17d){return{'model':db[_0x3ba17d[_0xaa36('0x25')]],'as':_0x3ba17d['as'],'attributes':_0x3ba17d[_0xaa36('0x21')],'include':_0x3ba17d[_0xaa36('0x23')]?_['map'](_0x3ba17d[_0xaa36('0x23')],function(_0x39d806){return{'model':db[_0x39d806[_0xaa36('0x25')]],'as':_0x39d806['as'],'attributes':_0x39d806[_0xaa36('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaa36('0x10')](function(_0x18084f){logger[_0xaa36('0x11')](_0xaa36('0x1b'),_0x4bd4dc);logger[_0xaa36('0x26')](_0xaa36('0x1b'),_0x4bd4dc,JSON[_0xaa36('0x15')](_0x18084f));_0x315e47(_0x18084f);})[_0xaa36('0x1a')](function(_0xa3a72e){logger[_0xaa36('0x16')](_0xaa36('0x1b'),_0xa3a72e[_0xaa36('0x18')],_0x4bd4dc);_0x48f85f(_0x354886[_0xaa36('0x16')](0x1f4,_0xa3a72e[_0xaa36('0x18')]));});});};exports[_0xaa36('0x27')]=function(_0x5c26f6){var _0x5bb0f6=this;return new Promise(function(_0x2685f5,_0x160380){return db[_0xaa36('0x1c')][_0xaa36('0x28')]({'raw':_0x5c26f6['options']?_0x5c26f6['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c26f6['options']?_0x5c26f6['options'][_0xaa36('0x20')]||null:null,'attributes':_0x5c26f6[_0xaa36('0x1e')]?_0x5c26f6['options'][_0xaa36('0x21')]||null:null,'include':_0x5c26f6[_0xaa36('0x1e')]?_0x5c26f6[_0xaa36('0x1e')][_0xaa36('0x23')]?_[_0xaa36('0x24')](_0x5c26f6[_0xaa36('0x1e')][_0xaa36('0x23')],function(_0x3d5ebb){return{'model':db[_0x3d5ebb[_0xaa36('0x25')]],'as':_0x3d5ebb['as'],'attributes':_0x3d5ebb['attributes'],'include':_0x3d5ebb['include']?_[_0xaa36('0x24')](_0x3d5ebb[_0xaa36('0x23')],function(_0x12e6d4){return{'model':db[_0x12e6d4[_0xaa36('0x25')]],'as':_0x12e6d4['as'],'attributes':_0x12e6d4[_0xaa36('0x21')],'include':_0x12e6d4['include']?_[_0xaa36('0x24')](_0x12e6d4[_0xaa36('0x23')],function(_0x5828ba){return{'model':db[_0x5828ba[_0xaa36('0x25')]],'as':_0x5828ba['as'],'attributes':_0x5828ba[_0xaa36('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaa36('0x10')](function(_0x39903d){logger['info'](_0xaa36('0x27'),_0x5c26f6);logger['debug'](_0xaa36('0x27'),_0x5c26f6,JSON[_0xaa36('0x15')](_0x39903d));_0x2685f5(_0x39903d);})['catch'](function(_0x5abfed){logger['error'](_0xaa36('0x27'),_0x5abfed[_0xaa36('0x18')],_0x5c26f6);_0x160380(_0x5bb0f6[_0xaa36('0x16')](0x1f4,_0x5abfed[_0xaa36('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 6c57465..91498e2 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 _0xf19f=['./faxQueue.events','remove','update','register','length'];(function(_0x2c65f7,_0x1f2c3a){var _0x415fc1=function(_0x367a75){while(--_0x367a75){_0x2c65f7['push'](_0x2c65f7['shift']());}};_0x415fc1(++_0x1f2c3a);}(_0xf19f,0xcd));var _0xff19=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xf19f[_0x561771];return _0x54d16e;};'use strict';var FaxQueueEvents=require(_0xff19('0x0'));var events=['save',_0xff19('0x1'),_0xff19('0x2')];function createListener(_0x2a6939,_0x37ac35){return function(_0x2f78c5){_0x37ac35['emit'](_0x2a6939,_0x2f78c5);};}function removeListener(_0x5a5ddd,_0x2617f6){return function(){FaxQueueEvents['removeListener'](_0x5a5ddd,_0x2617f6);};}exports[_0xff19('0x3')]=function(_0xfd25be){for(var _0x63aa75=0x0,_0x1e5cbf=events[_0xff19('0x4')];_0x63aa75<_0x1e5cbf;_0x63aa75++){var _0x39d6c0=events[_0x63aa75];var _0x59270e=createListener('faxQueue:'+_0x39d6c0,_0xfd25be);FaxQueueEvents['on'](_0x39d6c0,_0x59270e);}}; \ No newline at end of file +var _0x42f0=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x42f0,0x1b4));var _0x042f=function(_0x5b46be,_0x1b24f1){_0x5b46be=_0x5b46be-0x0;var _0xb01664=_0x42f0[_0x5b46be];return _0xb01664;};'use strict';var FaxQueueEvents=require(_0x042f('0x0'));var events=[_0x042f('0x1'),_0x042f('0x2'),_0x042f('0x3')];function createListener(_0x3f5f7d,_0x3bd9e8){return function(_0x1856c1){_0x3bd9e8[_0x042f('0x4')](_0x3f5f7d,_0x1856c1);};}function removeListener(_0x49e418,_0x339e9c){return function(){FaxQueueEvents[_0x042f('0x5')](_0x49e418,_0x339e9c);};}exports[_0x042f('0x6')]=function(_0x225e13){for(var _0x38a588=0x0,_0x2c4151=events[_0x042f('0x7')];_0x38a588<_0x2c4151;_0x38a588++){var _0x4a4418=events[_0x38a588];var _0x2b74da=createListener(_0x042f('0x8')+_0x4a4418,_0x225e13);FaxQueueEvents['on'](_0x4a4418,_0x2b74da);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 12dfff5..766168d 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 _0xf494=['delete','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','update'];(function(_0x517d2a,_0x30675e){var _0x41bdef=function(_0x26cf96){while(--_0x26cf96){_0x517d2a['push'](_0x517d2a['shift']());}};_0x41bdef(++_0x30675e);}(_0xf494,0x1c6));var _0x4f49=function(_0x39fee2,_0x68cec5){_0x39fee2=_0x39fee2-0x0;var _0x3d3794=_0xf494[_0x39fee2];return _0x3d3794;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getMembers']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['post']('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x14')]);router[_0x4f49('0x15')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x16')]);router[_0x4f49('0x15')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x17')]);router[_0x4f49('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x19')]);router[_0x4f49('0x1a')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x1b')]);router[_0x4f49('0x1a')](_0x4f49('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x1c')]);module[_0x4f49('0x1d')]=router; \ No newline at end of file +var _0x8506=['addTeams','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8506,0xe8));var _0x6850=function(_0x10b5e8,_0x142620){_0x10b5e8=_0x10b5e8-0x0;var _0x2fe76e=_0x8506[_0x10b5e8];return _0x2fe76e;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6850('0x3'));var interaction=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var controller=require('./faxQueue.controller');router[_0x6850('0x6')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0x8')]);router[_0x6850('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6850('0x6')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller['show']);router['get'](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xb')]);router[_0x6850('0x6')](_0x6850('0xc'),auth['isAuthenticated'](),controller[_0x6850('0xd')]);router[_0x6850('0x6')](_0x6850('0xe'),auth[_0x6850('0x7')](),controller[_0x6850('0xf')]);router[_0x6850('0x10')]('/',auth['isAuthenticated'](),controller[_0x6850('0x11')]);router[_0x6850('0x10')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x12')]);router[_0x6850('0x10')]('/:id/users',auth[_0x6850('0x7')](),controller['addAgents']);router[_0x6850('0x13')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x14')]);router[_0x6850('0x15')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x16')]);router[_0x6850('0x15')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x17')]);router[_0x6850('0x15')](_0x6850('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x6850('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 06da8b6..332f448 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 _0xd4cc=['exports','STRING','DATE','moment','sequelize'];(function(_0x3bcc56,_0x14138d){var _0x5e687c=function(_0x58d90d){while(--_0x58d90d){_0x3bcc56['push'](_0x3bcc56['shift']());}};_0x5e687c(++_0x14138d);}(_0xd4cc,0xb7));var _0xcd4c=function(_0x55a73a,_0x58db07){_0x55a73a=_0x55a73a-0x0;var _0x2a30ff=_0xd4cc[_0x55a73a];return _0x2a30ff;};'use strict';var moment=require(_0xcd4c('0x0'));var Sequelize=require(_0xcd4c('0x1'));module[_0xcd4c('0x2')]={'uniqueid':{'type':Sequelize[_0xcd4c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcd4c('0x3')]},'joinAt':{'type':Sequelize[_0xcd4c('0x4')]},'leaveAt':{'type':Sequelize[_0xcd4c('0x4')]},'acceptAt':{'type':Sequelize[_0xcd4c('0x4')]},'exitAt':{'type':Sequelize[_0xcd4c('0x4')]},'reason':{'type':Sequelize[_0xcd4c('0x3')]}}; \ No newline at end of file +var _0x4d54=['moment','sequelize','exports','STRING','DATE'];(function(_0x1f1283,_0x1bea3b){var _0x205041=function(_0x3f8fe4){while(--_0x3f8fe4){_0x1f1283['push'](_0x1f1283['shift']());}};_0x205041(++_0x1bea3b);}(_0x4d54,0xf5));var _0x44d5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d54[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x44d5('0x0'));var Sequelize=require(_0x44d5('0x1'));module[_0x44d5('0x2')]={'uniqueid':{'type':Sequelize[_0x44d5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x44d5('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x44d5('0x4')]},'exitAt':{'type':Sequelize[_0x44d5('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 406a269..9122b9f 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 _0xd820=['merge','includeAll','include','rows','params','keys','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x20099a,_0x2bf584){var _0x2c3649=function(_0x3c2f4b){while(--_0x3c2f4b){_0x20099a['push'](_0x20099a['shift']());}};_0x2c3649(++_0x2bf584);}(_0xd820,0x16f));var _0x0d82=function(_0x3ad1fb,_0x4e4423){_0x3ad1fb=_0x3ad1fb-0x0;var _0x3ffe3f=_0xd820[_0x3ad1fb];return _0x3ffe3f;};'use strict';var emlformat=require(_0x0d82('0x0'));var rimraf=require(_0x0d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d82('0x2'));var rp=require(_0x0d82('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d82('0x4'));var util=require(_0x0d82('0x5'));var path=require(_0x0d82('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d82('0x7'));var fs=require('fs');var fs_extra=require(_0x0d82('0x8'));var _=require(_0x0d82('0x9'));var squel=require(_0x0d82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d82('0xb'));var deskjs=require(_0x0d82('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d82('0xd'));var Redis=require(_0x0d82('0xe'));var authService=require(_0x0d82('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d82('0x10'));var logger=require(_0x0d82('0x11'))(_0x0d82('0x12'));var utils=require(_0x0d82('0x13'));var config=require(_0x0d82('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x851dbc,_0x7fdd7a){_0x7fdd7a=_0x7fdd7a||0xcc;return function(_0x103e1d){if(_0x103e1d){return _0x851dbc['sendStatus'](_0x7fdd7a);}return _0x851dbc[_0x0d82('0x15')](_0x7fdd7a)[_0x0d82('0x16')]();};}function respondWithResult(_0x8fe5e1,_0x3ad9dd){_0x3ad9dd=_0x3ad9dd||0xc8;return function(_0x288020){if(_0x288020){return _0x8fe5e1[_0x0d82('0x15')](_0x3ad9dd)[_0x0d82('0x17')](_0x288020);}};}function respondWithFilteredResult(_0x39c982,_0x2b2d47){return function(_0x55415f){if(_0x55415f){var _0x1e9024=typeof _0x2b2d47['offset']===_0x0d82('0x18')&&typeof _0x2b2d47['limit']===_0x0d82('0x18');var _0x31397a=_0x55415f[_0x0d82('0x19')];var _0x3383d8=_0x1e9024?0x0:_0x2b2d47[_0x0d82('0x1a')];var _0x16f941=_0x1e9024?_0x55415f[_0x0d82('0x19')]:_0x2b2d47[_0x0d82('0x1a')]+_0x2b2d47[_0x0d82('0x1b')];var _0x1007be;if(_0x16f941>=_0x31397a){_0x16f941=_0x31397a;_0x1007be=0xc8;}else{_0x1007be=0xce;}_0x39c982[_0x0d82('0x15')](_0x1007be);return _0x39c982[_0x0d82('0x1c')](_0x0d82('0x1d'),_0x3383d8+'-'+_0x16f941+'/'+_0x31397a)[_0x0d82('0x17')](_0x55415f);}return null;};}function patchUpdates(_0x5a0e1c){return function(_0x517997){try{jsonpatch[_0x0d82('0x1e')](_0x517997,_0x5a0e1c,!![]);}catch(_0x365404){return BPromise[_0x0d82('0x1f')](_0x365404);}return _0x517997['save']();};}function saveUpdates(_0x5def00,_0x2e332d){return function(_0x20d5eb){if(_0x20d5eb){return _0x20d5eb[_0x0d82('0x20')](_0x5def00)[_0x0d82('0x21')](function(_0x1f99ba){return _0x1f99ba;});}return null;};}function removeEntity(_0x18c248,_0x4a2d4d){return function(_0xb04794){if(_0xb04794){return _0xb04794[_0x0d82('0x22')]()[_0x0d82('0x21')](function(){_0x18c248['status'](0xcc)[_0x0d82('0x16')]();});}};}function handleEntityNotFound(_0x105c9a,_0x35a614){return function(_0x51b5a1){if(!_0x51b5a1){_0x105c9a[_0x0d82('0x23')](0x194);}return _0x51b5a1;};}function handleError(_0x10737d,_0xa636f0){_0xa636f0=_0xa636f0||0x1f4;return function(_0x5b3307){logger[_0x0d82('0x24')](_0x5b3307[_0x0d82('0x25')]);if(_0x5b3307[_0x0d82('0x26')]){delete _0x5b3307[_0x0d82('0x26')];}_0x10737d[_0x0d82('0x15')](_0xa636f0)[_0x0d82('0x27')](_0x5b3307);};}exports['index']=function(_0x5fd0dd,_0x15bc2b){var _0x43f679={},_0xf08815={},_0x548f33={'count':0x0,'rows':[]};var _0x465cd6=_[_0x0d82('0x28')](db[_0x0d82('0x29')][_0x0d82('0x2a')],function(_0x30477f){return{'name':_0x30477f[_0x0d82('0x2b')],'type':_0x30477f[_0x0d82('0x2c')]['key']};});_0xf08815[_0x0d82('0x2d')]=_[_0x0d82('0x28')](_0x465cd6,'name');_0xf08815[_0x0d82('0x2e')]=_['keys'](_0x5fd0dd[_0x0d82('0x2e')]);_0xf08815[_0x0d82('0x2f')]=_[_0x0d82('0x30')](_0xf08815['model'],_0xf08815[_0x0d82('0x2e')]);_0x43f679[_0x0d82('0x31')]=_[_0x0d82('0x30')](_0xf08815['model'],qs[_0x0d82('0x32')](_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x32')]));_0x43f679['attributes']=_0x43f679[_0x0d82('0x31')][_0x0d82('0x33')]?_0x43f679['attributes']:_0xf08815[_0x0d82('0x2d')];if(!_0x5fd0dd['query'][_0x0d82('0x34')](_0x0d82('0x35'))){_0x43f679[_0x0d82('0x1b')]=qs[_0x0d82('0x1b')](_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x1b')]);_0x43f679[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x1a')]);}_0x43f679[_0x0d82('0x36')]=qs[_0x0d82('0x37')](_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x37')]);_0x43f679[_0x0d82('0x38')]=qs[_0x0d82('0x2f')](_[_0x0d82('0x39')](_0x5fd0dd[_0x0d82('0x2e')],_0xf08815[_0x0d82('0x2f')]),_0x465cd6);if(_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x3a')]){_0x43f679['where']=_[_0x0d82('0x3b')](_0x43f679['where'],{'$or':_[_0x0d82('0x28')](_0x465cd6,function(_0x200f21){if(_0x200f21[_0x0d82('0x2c')]!=='VIRTUAL'){var _0x5467ce={};_0x5467ce[_0x200f21[_0x0d82('0x26')]]={'$like':'%'+_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x3a')]+'%'};return _0x5467ce;}})});}_0x43f679=_[_0x0d82('0x3b')]({},_0x43f679,_0x5fd0dd['options']);var _0x417640={'where':_0x43f679['where']};return db[_0x0d82('0x29')][_0x0d82('0x19')](_0x417640)[_0x0d82('0x21')](function(_0x482702){_0x548f33[_0x0d82('0x19')]=_0x482702;if(_0x5fd0dd[_0x0d82('0x2e')][_0x0d82('0x3c')]){_0x43f679[_0x0d82('0x3d')]=[{'all':!![]}];}return db[_0x0d82('0x29')]['findAll'](_0x43f679);})[_0x0d82('0x21')](function(_0x244db0){_0x548f33[_0x0d82('0x3e')]=_0x244db0;return _0x548f33;})[_0x0d82('0x21')](respondWithFilteredResult(_0x15bc2b,_0x43f679))['catch'](handleError(_0x15bc2b,null));};exports['show']=function(_0x23a069,_0x11a462){var _0x5d4b63={'raw':!![],'where':{'id':_0x23a069[_0x0d82('0x3f')]['id']}},_0x45e109={};_0x45e109['model']=_[_0x0d82('0x40')](db[_0x0d82('0x29')]['rawAttributes']);_0x45e109[_0x0d82('0x2e')]=_[_0x0d82('0x40')](_0x23a069[_0x0d82('0x2e')]);_0x45e109[_0x0d82('0x2f')]=_['intersection'](_0x45e109['model'],_0x45e109['query']);_0x5d4b63[_0x0d82('0x31')]=_[_0x0d82('0x30')](_0x45e109['model'],qs['fields'](_0x23a069[_0x0d82('0x2e')]['fields']));_0x5d4b63[_0x0d82('0x31')]=_0x5d4b63['attributes'][_0x0d82('0x33')]?_0x5d4b63[_0x0d82('0x31')]:_0x45e109[_0x0d82('0x2d')];if(_0x23a069['query'][_0x0d82('0x3c')]){_0x5d4b63[_0x0d82('0x3d')]=[{'all':!![]}];}_0x5d4b63=_[_0x0d82('0x3b')]({},_0x5d4b63,_0x23a069[_0x0d82('0x41')]);return db['FaxQueueReport'][_0x0d82('0x42')](_0x5d4b63)[_0x0d82('0x21')](handleEntityNotFound(_0x11a462,null))[_0x0d82('0x21')](respondWithResult(_0x11a462,null))[_0x0d82('0x43')](handleError(_0x11a462,null));};exports[_0x0d82('0x44')]=function(_0x5e855c,_0x3978f5){return db[_0x0d82('0x29')][_0x0d82('0x44')](_0x5e855c['body'],{})[_0x0d82('0x21')](respondWithResult(_0x3978f5,0xc9))[_0x0d82('0x43')](handleError(_0x3978f5,null));};exports[_0x0d82('0x20')]=function(_0x7dff5a,_0x55461e){if(_0x7dff5a[_0x0d82('0x45')]['id']){delete _0x7dff5a['body']['id'];}return db[_0x0d82('0x29')]['find']({'where':{'id':_0x7dff5a[_0x0d82('0x3f')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x55461e,null))['then'](saveUpdates(_0x7dff5a['body'],null))['then'](respondWithResult(_0x55461e,null))[_0x0d82('0x43')](handleError(_0x55461e,null));};exports['destroy']=function(_0x2475b1,_0x2370d8){return db[_0x0d82('0x29')]['find']({'where':{'id':_0x2475b1[_0x0d82('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2370d8,null))[_0x0d82('0x21')](removeEntity(_0x2370d8,null))[_0x0d82('0x43')](handleError(_0x2370d8,null));};exports[_0x0d82('0x46')]=function(_0x474f55,_0xc4d1bc){return db[_0x0d82('0x29')]['describe']()['then'](respondWithResult(_0xc4d1bc,null))['catch'](handleError(_0xc4d1bc,null));}; \ No newline at end of file +var _0x8e63=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name','send','index','map','FaxQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment'];(function(_0xbb08ed,_0x20d1ac){var _0x3ad4cb=function(_0x372ca2){while(--_0x372ca2){_0xbb08ed['push'](_0xbb08ed['shift']());}};_0x3ad4cb(++_0x20d1ac);}(_0x8e63,0x7c));var _0x38e6=function(_0x40ae48,_0x548019){_0x40ae48=_0x40ae48-0x0;var _0x44f942=_0x8e63[_0x40ae48];return _0x44f942;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38e6('0x1'));var moment=require(_0x38e6('0x2'));var BPromise=require(_0x38e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e6('0x4'));var sox=require(_0x38e6('0x5'));var csv=require(_0x38e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e6('0x7'));var _=require(_0x38e6('0x8'));var squel=require(_0x38e6('0x9'));var crypto=require(_0x38e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38e6('0x6'));var querystring=require(_0x38e6('0xb'));var Papa=require(_0x38e6('0xc'));var Redis=require(_0x38e6('0xd'));var authService=require(_0x38e6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e6('0xf'));var logger=require('../../config/logger')(_0x38e6('0x10'));var utils=require('../../config/utils');var config=require(_0x38e6('0x11'));var licenseUtil=require(_0x38e6('0x12'));var db=require(_0x38e6('0x13'))['db'];function respondWithStatusCode(_0x14d2cf,_0x2e2585){_0x2e2585=_0x2e2585||0xcc;return function(_0x57c207){if(_0x57c207){return _0x14d2cf[_0x38e6('0x14')](_0x2e2585);}return _0x14d2cf[_0x38e6('0x15')](_0x2e2585)['end']();};}function respondWithResult(_0x1fcdeb,_0xfd7f2){_0xfd7f2=_0xfd7f2||0xc8;return function(_0x229f18){if(_0x229f18){return _0x1fcdeb[_0x38e6('0x15')](_0xfd7f2)[_0x38e6('0x16')](_0x229f18);}};}function respondWithFilteredResult(_0x46b525,_0x55208f){return function(_0x279688){if(_0x279688){var _0x36a263=typeof _0x55208f[_0x38e6('0x17')]===_0x38e6('0x18')&&typeof _0x55208f[_0x38e6('0x19')]==='undefined';var _0x91997a=_0x279688['count'];var _0x800418=_0x36a263?0x0:_0x55208f[_0x38e6('0x17')];var _0x57ded4=_0x36a263?_0x279688[_0x38e6('0x1a')]:_0x55208f['offset']+_0x55208f[_0x38e6('0x19')];var _0x521453;if(_0x57ded4>=_0x91997a){_0x57ded4=_0x91997a;_0x521453=0xc8;}else{_0x521453=0xce;}_0x46b525[_0x38e6('0x15')](_0x521453);return _0x46b525[_0x38e6('0x1b')](_0x38e6('0x1c'),_0x800418+'-'+_0x57ded4+'/'+_0x91997a)[_0x38e6('0x16')](_0x279688);}return null;};}function patchUpdates(_0x3f1d54){return function(_0x41bb24){try{jsonpatch['apply'](_0x41bb24,_0x3f1d54,!![]);}catch(_0x5f3f67){return BPromise['reject'](_0x5f3f67);}return _0x41bb24[_0x38e6('0x1d')]();};}function saveUpdates(_0x58dc63,_0x4a82f6){return function(_0x2d995f){if(_0x2d995f){return _0x2d995f[_0x38e6('0x1e')](_0x58dc63)[_0x38e6('0x1f')](function(_0x2a8a11){return _0x2a8a11;});}return null;};}function removeEntity(_0x5f5ab2,_0x140fc3){return function(_0x4530a7){if(_0x4530a7){return _0x4530a7[_0x38e6('0x20')]()['then'](function(){_0x5f5ab2[_0x38e6('0x15')](0xcc)[_0x38e6('0x21')]();});}};}function handleEntityNotFound(_0x24e3d6,_0x9bc0b0){return function(_0x106424){if(!_0x106424){_0x24e3d6[_0x38e6('0x14')](0x194);}return _0x106424;};}function handleError(_0x179145,_0x167b28){_0x167b28=_0x167b28||0x1f4;return function(_0x4a261a){logger[_0x38e6('0x22')](_0x4a261a['stack']);if(_0x4a261a[_0x38e6('0x23')]){delete _0x4a261a[_0x38e6('0x23')];}_0x179145[_0x38e6('0x15')](_0x167b28)[_0x38e6('0x24')](_0x4a261a);};}exports[_0x38e6('0x25')]=function(_0x1afc04,_0x1d4a1b){var _0x5a4912={},_0xe93f18={},_0x1980a4={'count':0x0,'rows':[]};var _0x48f5a2=_[_0x38e6('0x26')](db[_0x38e6('0x27')]['rawAttributes'],function(_0x468310){return{'name':_0x468310[_0x38e6('0x28')],'type':_0x468310[_0x38e6('0x29')][_0x38e6('0x2a')]};});_0xe93f18[_0x38e6('0x2b')]=_[_0x38e6('0x26')](_0x48f5a2,_0x38e6('0x23'));_0xe93f18['query']=_[_0x38e6('0x2c')](_0x1afc04[_0x38e6('0x2d')]);_0xe93f18[_0x38e6('0x2e')]=_[_0x38e6('0x2f')](_0xe93f18[_0x38e6('0x2b')],_0xe93f18[_0x38e6('0x2d')]);_0x5a4912[_0x38e6('0x30')]=_['intersection'](_0xe93f18[_0x38e6('0x2b')],qs[_0x38e6('0x31')](_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x31')]));_0x5a4912[_0x38e6('0x30')]=_0x5a4912[_0x38e6('0x30')][_0x38e6('0x32')]?_0x5a4912['attributes']:_0xe93f18[_0x38e6('0x2b')];if(!_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x33')](_0x38e6('0x34'))){_0x5a4912['limit']=qs[_0x38e6('0x19')](_0x1afc04[_0x38e6('0x2d')]['limit']);_0x5a4912[_0x38e6('0x17')]=qs[_0x38e6('0x17')](_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x17')]);}_0x5a4912['order']=qs[_0x38e6('0x35')](_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x35')]);_0x5a4912[_0x38e6('0x36')]=qs['filters'](_[_0x38e6('0x37')](_0x1afc04[_0x38e6('0x2d')],_0xe93f18[_0x38e6('0x2e')]),_0x48f5a2);if(_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x38')]){_0x5a4912[_0x38e6('0x36')]=_[_0x38e6('0x39')](_0x5a4912['where'],{'$or':_[_0x38e6('0x26')](_0x48f5a2,function(_0x3ac91f){if(_0x3ac91f['type']!=='VIRTUAL'){var _0x3b1eb9={};_0x3b1eb9[_0x3ac91f[_0x38e6('0x23')]]={'$like':'%'+_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x38')]+'%'};return _0x3b1eb9;}})});}_0x5a4912=_[_0x38e6('0x39')]({},_0x5a4912,_0x1afc04[_0x38e6('0x3a')]);var _0x1c80eb={'where':_0x5a4912[_0x38e6('0x36')]};return db[_0x38e6('0x27')][_0x38e6('0x1a')](_0x1c80eb)['then'](function(_0x1e2e3f){_0x1980a4[_0x38e6('0x1a')]=_0x1e2e3f;if(_0x1afc04[_0x38e6('0x2d')][_0x38e6('0x3b')]){_0x5a4912[_0x38e6('0x3c')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x38e6('0x3d')](_0x5a4912);})['then'](function(_0x7a8077){_0x1980a4[_0x38e6('0x3e')]=_0x7a8077;return _0x1980a4;})[_0x38e6('0x1f')](respondWithFilteredResult(_0x1d4a1b,_0x5a4912))[_0x38e6('0x3f')](handleError(_0x1d4a1b,null));};exports[_0x38e6('0x40')]=function(_0x557a25,_0x44e6af){var _0x3166fb={'raw':!![],'where':{'id':_0x557a25[_0x38e6('0x41')]['id']}},_0x5f4ae3={};_0x5f4ae3[_0x38e6('0x2b')]=_[_0x38e6('0x2c')](db['FaxQueueReport'][_0x38e6('0x42')]);_0x5f4ae3[_0x38e6('0x2d')]=_['keys'](_0x557a25[_0x38e6('0x2d')]);_0x5f4ae3[_0x38e6('0x2e')]=_[_0x38e6('0x2f')](_0x5f4ae3[_0x38e6('0x2b')],_0x5f4ae3[_0x38e6('0x2d')]);_0x3166fb['attributes']=_[_0x38e6('0x2f')](_0x5f4ae3['model'],qs[_0x38e6('0x31')](_0x557a25[_0x38e6('0x2d')]['fields']));_0x3166fb[_0x38e6('0x30')]=_0x3166fb[_0x38e6('0x30')]['length']?_0x3166fb[_0x38e6('0x30')]:_0x5f4ae3[_0x38e6('0x2b')];if(_0x557a25[_0x38e6('0x2d')]['includeAll']){_0x3166fb[_0x38e6('0x3c')]=[{'all':!![]}];}_0x3166fb=_[_0x38e6('0x39')]({},_0x3166fb,_0x557a25[_0x38e6('0x3a')]);return db['FaxQueueReport']['find'](_0x3166fb)[_0x38e6('0x1f')](handleEntityNotFound(_0x44e6af,null))[_0x38e6('0x1f')](respondWithResult(_0x44e6af,null))['catch'](handleError(_0x44e6af,null));};exports[_0x38e6('0x43')]=function(_0x191de3,_0x2eadb4){return db[_0x38e6('0x27')][_0x38e6('0x43')](_0x191de3[_0x38e6('0x44')],{})[_0x38e6('0x1f')](respondWithResult(_0x2eadb4,0xc9))['catch'](handleError(_0x2eadb4,null));};exports['update']=function(_0x447808,_0x5d1e7b){if(_0x447808[_0x38e6('0x44')]['id']){delete _0x447808[_0x38e6('0x44')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x447808[_0x38e6('0x41')]['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x5d1e7b,null))['then'](saveUpdates(_0x447808[_0x38e6('0x44')],null))['then'](respondWithResult(_0x5d1e7b,null))['catch'](handleError(_0x5d1e7b,null));};exports[_0x38e6('0x20')]=function(_0x432179,_0x385de7){return db[_0x38e6('0x27')][_0x38e6('0x45')]({'where':{'id':_0x432179['params']['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x385de7,null))[_0x38e6('0x1f')](removeEntity(_0x385de7,null))[_0x38e6('0x3f')](handleError(_0x385de7,null));};exports[_0x38e6('0x46')]=function(_0x15f2c1,_0x361ff6){return db[_0x38e6('0x27')]['describe']()['then'](respondWithResult(_0x361ff6,null))['catch'](handleError(_0x361ff6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index ea1e880..ced0943 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(_0xd9e76f,_0xfb2785){var _0xb4d95e=function(_0x169f9f){while(--_0x169f9f){_0xd9e76f['push'](_0xd9e76f['shift']());}};_0xb4d95e(++_0xfb2785);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e27ba,_0x46b120){_0x3e27ba=_0x3e27ba-0x0;var _0x10b3f2=_0x5fab[_0x3e27ba];return _0x10b3f2;};'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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x3993bd,_0x9995cd){var _0x3571bc=function(_0x269cff){while(--_0x269cff){_0x3993bd['push'](_0x3993bd['shift']());}};_0x3571bc(++_0x9995cd);}(_0xf494,0x1c6));var _0x4f49=function(_0x418af0,_0x13c39c){_0x418af0=_0x418af0-0x0;var _0x41d4b2=_0xf494[_0x418af0];return _0x41d4b2;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 3d4c30f..ccb733a 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 _0x0c2a=['code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','FaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x553ab7,_0x25afeb){var _0x530030=function(_0x533c0d){while(--_0x533c0d){_0x553ab7['push'](_0x553ab7['shift']());}};_0x530030(++_0x25afeb);}(_0x0c2a,0x76));var _0xa0c2=function(_0x4f5b60,_0x2800ca){_0x4f5b60=_0x4f5b60-0x0;var _0x5bc233=_0x0c2a[_0x4f5b60];return _0x5bc233;};'use strict';var _=require('lodash');var util=require(_0xa0c2('0x0'));var moment=require(_0xa0c2('0x1'));var BPromise=require(_0xa0c2('0x2'));var rs=require(_0xa0c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0c2('0x4'))['db'];var utils=require(_0xa0c2('0x5'));var logger=require(_0xa0c2('0x6'))(_0xa0c2('0x7'));var config=require(_0xa0c2('0x8'));var jayson=require(_0xa0c2('0x9'));var client=jayson['client'][_0xa0c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5873d7,_0x13d1c3,_0x2025a8){return new BPromise(function(_0x443a3f,_0x1154e4){return client['request'](_0x5873d7,_0x2025a8)['then'](function(_0x13bf49){logger[_0xa0c2('0xb')](_0xa0c2('0xc'),_0x13d1c3,_0xa0c2('0xd'));logger[_0xa0c2('0xe')](_0xa0c2('0xf'),_0x13d1c3,'request\x20sent',JSON[_0xa0c2('0x10')](_0x13bf49));if(_0x13bf49['error']){if(_0x13bf49[_0xa0c2('0x11')][_0xa0c2('0x12')]===0x1f4){logger['error'](_0xa0c2('0xc'),_0x13d1c3,_0x13bf49['error'][_0xa0c2('0x13')]);return _0x1154e4(_0x13bf49[_0xa0c2('0x11')]['message']);}logger['error'](_0xa0c2('0xc'),_0x13d1c3,_0x13bf49['error'][_0xa0c2('0x13')]);return _0x443a3f(_0x13bf49[_0xa0c2('0x11')][_0xa0c2('0x13')]);}else{logger[_0xa0c2('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x13d1c3,_0xa0c2('0xd'));_0x443a3f(_0x13bf49[_0xa0c2('0x14')][_0xa0c2('0x13')]);}})[_0xa0c2('0x15')](function(_0x3f17df){logger['error'](_0xa0c2('0xc'),_0x13d1c3,_0x3f17df);_0x1154e4(_0x3f17df);});});}exports[_0xa0c2('0x16')]=function(_0xf6369b){var _0x576fca=this;return new Promise(function(_0x2c55d1,_0x2a016a){return db['FaxQueueReport'][_0xa0c2('0x17')](_0xf6369b[_0xa0c2('0x18')],{'raw':_0xf6369b[_0xa0c2('0x19')]?_0xf6369b[_0xa0c2('0x19')][_0xa0c2('0x1a')]===undefined?!![]:![]:!![]})[_0xa0c2('0x1b')](function(_0x133f9a){logger[_0xa0c2('0xb')](_0xa0c2('0x16'),_0xf6369b);logger['debug'](_0xa0c2('0x16'),_0xf6369b,JSON[_0xa0c2('0x10')](_0x133f9a));_0x2c55d1(_0x133f9a);})[_0xa0c2('0x15')](function(_0x204e48){logger[_0xa0c2('0x11')](_0xa0c2('0x16'),_0x204e48[_0xa0c2('0x13')],_0xf6369b);_0x2a016a(_0x576fca[_0xa0c2('0x11')](0x1f4,_0x204e48[_0xa0c2('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0xd317a6){var _0x5453f6=this;return new Promise(function(_0x4a77d3,_0x5e6626){return db[_0xa0c2('0x1c')][_0xa0c2('0x1d')](_0xd317a6[_0xa0c2('0x18')],{'raw':_0xd317a6[_0xa0c2('0x19')]?_0xd317a6[_0xa0c2('0x19')][_0xa0c2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd317a6[_0xa0c2('0x19')]?_0xd317a6['options'][_0xa0c2('0x1e')]||null:null,'attributes':_0xd317a6[_0xa0c2('0x19')]?_0xd317a6[_0xa0c2('0x19')][_0xa0c2('0x1f')]||null:null,'limit':_0xd317a6[_0xa0c2('0x19')]?_0xd317a6[_0xa0c2('0x19')][_0xa0c2('0x20')]||null:null})['then'](function(_0xcac903){logger[_0xa0c2('0xb')](_0xa0c2('0x21'),_0xd317a6);logger[_0xa0c2('0xe')](_0xa0c2('0x21'),_0xd317a6,JSON[_0xa0c2('0x10')](_0xcac903));_0x4a77d3(_0xcac903);})[_0xa0c2('0x15')](function(_0x2af446){logger[_0xa0c2('0x11')](_0xa0c2('0x21'),_0x2af446[_0xa0c2('0x13')],_0xd317a6);_0x5e6626(_0x5453f6[_0xa0c2('0x11')](0x1f4,_0x2af446[_0xa0c2('0x13')]));});});}; \ No newline at end of file +var _0x3b03=['update','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','UpdateFaxQueueReport'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x3b03,0x119));var _0x33b0=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x3b03[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x33b0('0x0'));var util=require(_0x33b0('0x1'));var moment=require(_0x33b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x33b0('0x3'));var fs=require('fs');var Redis=require(_0x33b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x33b0('0x5'));var logger=require(_0x33b0('0x6'))(_0x33b0('0x7'));var config=require(_0x33b0('0x8'));var jayson=require(_0x33b0('0x9'));var client=jayson[_0x33b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad181,_0x51f122,_0x3ddfff){return new BPromise(function(_0x12106a,_0x5dc528){return client[_0x33b0('0xb')](_0x3ad181,_0x3ddfff)[_0x33b0('0xc')](function(_0x4e289f){logger[_0x33b0('0xd')](_0x33b0('0xe'),_0x51f122,_0x33b0('0xf'));logger[_0x33b0('0x10')](_0x33b0('0x11'),_0x51f122,'request\x20sent',JSON['stringify'](_0x4e289f));if(_0x4e289f[_0x33b0('0x12')]){if(_0x4e289f[_0x33b0('0x12')]['code']===0x1f4){logger['error'](_0x33b0('0xe'),_0x51f122,_0x4e289f[_0x33b0('0x12')][_0x33b0('0x13')]);return _0x5dc528(_0x4e289f[_0x33b0('0x12')][_0x33b0('0x13')]);}logger[_0x33b0('0x12')](_0x33b0('0xe'),_0x51f122,_0x4e289f['error'][_0x33b0('0x13')]);return _0x12106a(_0x4e289f[_0x33b0('0x12')][_0x33b0('0x13')]);}else{logger[_0x33b0('0xd')](_0x33b0('0xe'),_0x51f122,_0x33b0('0xf'));_0x12106a(_0x4e289f['result'][_0x33b0('0x13')]);}})[_0x33b0('0x14')](function(_0x23b7ce){logger[_0x33b0('0x12')](_0x33b0('0xe'),_0x51f122,_0x23b7ce);_0x5dc528(_0x23b7ce);});});}exports[_0x33b0('0x15')]=function(_0x34985d){var _0x1ef0a1=this;return new Promise(function(_0x6121b,_0x58a10f){return db[_0x33b0('0x16')][_0x33b0('0x17')](_0x34985d[_0x33b0('0x18')],{'raw':_0x34985d[_0x33b0('0x19')]?_0x34985d[_0x33b0('0x19')][_0x33b0('0x1a')]===undefined?!![]:![]:!![]})[_0x33b0('0xc')](function(_0x11abaf){logger[_0x33b0('0xd')](_0x33b0('0x15'),_0x34985d);logger[_0x33b0('0x10')]('CreateFaxQueueReport',_0x34985d,JSON[_0x33b0('0x1b')](_0x11abaf));_0x6121b(_0x11abaf);})['catch'](function(_0x2b4423){logger[_0x33b0('0x12')]('CreateFaxQueueReport',_0x2b4423[_0x33b0('0x13')],_0x34985d);_0x58a10f(_0x1ef0a1[_0x33b0('0x12')](0x1f4,_0x2b4423['message']));});});};exports[_0x33b0('0x1c')]=function(_0xb86799){var _0x2bf843=this;return new Promise(function(_0x3cb028,_0x50529c){return db['FaxQueueReport'][_0x33b0('0x1d')](_0xb86799['body'],{'raw':_0xb86799[_0x33b0('0x19')]?_0xb86799[_0x33b0('0x19')][_0x33b0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb86799[_0x33b0('0x19')]?_0xb86799[_0x33b0('0x19')]['where']||null:null,'attributes':_0xb86799[_0x33b0('0x19')]?_0xb86799[_0x33b0('0x19')][_0x33b0('0x1e')]||null:null,'limit':_0xb86799[_0x33b0('0x19')]?_0xb86799['options']['limit']||null:null})[_0x33b0('0xc')](function(_0x1c4eed){logger[_0x33b0('0xd')](_0x33b0('0x1c'),_0xb86799);logger[_0x33b0('0x10')](_0x33b0('0x1c'),_0xb86799,JSON['stringify'](_0x1c4eed));_0x3cb028(_0x1c4eed);})['catch'](function(_0x6ba37e){logger[_0x33b0('0x12')]('UpdateFaxQueueReport',_0x6ba37e[_0x33b0('0x13')],_0xb86799);_0x50529c(_0x2bf843[_0x33b0('0x12')](0x1f4,_0x6ba37e[_0x33b0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3ad7554..32c88c8 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 _0x5c7c=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x141dd8,_0x4e88bc){var _0x12ad4b=function(_0x2d636b){while(--_0x2d636b){_0x141dd8['push'](_0x141dd8['shift']());}};_0x12ad4b(++_0x4e88bc);}(_0x5c7c,0xce));var _0xc5c7=function(_0x481366,_0x41e46b){_0x481366=_0x481366-0x0;var _0x229649=_0x5c7c[_0x481366];return _0x229649;};'use strict';var multer=require(_0xc5c7('0x0'));var util=require(_0xc5c7('0x1'));var path=require(_0xc5c7('0x2'));var timeout=require(_0xc5c7('0x3'));var express=require('express');var router=express[_0xc5c7('0x4')]();var fs_extra=require(_0xc5c7('0x5'));var auth=require(_0xc5c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc5c7('0x7'));var controller=require(_0xc5c7('0x8'));router[_0xc5c7('0x9')]('/',auth['isAuthenticated'](),controller[_0xc5c7('0xa')]);router[_0xc5c7('0x9')](_0xc5c7('0xb'),auth[_0xc5c7('0xc')](),controller[_0xc5c7('0xd')]);router[_0xc5c7('0x9')](_0xc5c7('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc5c7('0xf')]('/',auth[_0xc5c7('0xc')](),controller[_0xc5c7('0x10')]);router['put'](_0xc5c7('0xe'),auth[_0xc5c7('0xc')](),controller[_0xc5c7('0x11')]);router[_0xc5c7('0x12')]('/:id',auth[_0xc5c7('0xc')](),controller[_0xc5c7('0x13')]);module[_0xc5c7('0x14')]=router; \ No newline at end of file +var _0x4af6=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x36c6aa,_0x1dce31){var _0x5b59f7=function(_0x15390a){while(--_0x15390a){_0x36c6aa['push'](_0x36c6aa['shift']());}};_0x5b59f7(++_0x1dce31);}(_0x4af6,0x91));var _0x64af=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4af6[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x64af('0x0'));var path=require(_0x64af('0x1'));var timeout=require(_0x64af('0x2'));var express=require(_0x64af('0x3'));var router=express[_0x64af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x64af('0x5'));var interaction=require(_0x64af('0x6'));var config=require(_0x64af('0x7'));var controller=require(_0x64af('0x8'));router[_0x64af('0x9')]('/',auth[_0x64af('0xa')](),controller[_0x64af('0xb')]);router[_0x64af('0x9')]('/describe',auth[_0x64af('0xa')](),controller['describe']);router['get'](_0x64af('0xc'),auth['isAuthenticated'](),controller[_0x64af('0xd')]);router[_0x64af('0xe')]('/',auth[_0x64af('0xa')](),controller[_0x64af('0xf')]);router[_0x64af('0x10')]('/:id',auth[_0x64af('0xa')](),controller[_0x64af('0x11')]);router['delete'](_0x64af('0xc'),auth[_0x64af('0xa')](),controller[_0x64af('0x12')]);module[_0x64af('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4c907f9..870ff35 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2a234b,_0x49b637){var _0x494377=function(_0x3f0dbb){while(--_0x3f0dbb){_0x2a234b['push'](_0x2a234b['shift']());}};_0x494377(++_0x49b637);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e70c4,_0x5b21a1){_0x5e70c4=_0x5e70c4-0x0;var _0x51680e=_0xf4eb[_0x5e70c4];return _0x51680e;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3a6eed,_0x4e7d2e){var _0x4ddb7b=function(_0x53383c){while(--_0x53383c){_0x3a6eed['push'](_0x3a6eed['shift']());}};_0x4ddb7b(++_0x4e7d2e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x38516b,_0x50e798){_0x38516b=_0x38516b-0x0;var _0x277930=_0xf4eb[_0x38516b];return _0x277930;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f2e05c8..c307582 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 _0xff87=['VIRTUAL','filter','merge','where','include','findAll','rows','show','params','includeAll','options','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick'];(function(_0x18309d,_0x18bfa0){var _0x5518df=function(_0x5cb332){while(--_0x5cb332){_0x18309d['push'](_0x18309d['shift']());}};_0x5518df(++_0x18bfa0);}(_0xff87,0x1de));var _0x7ff8=function(_0x13f2ec,_0x407206){_0x13f2ec=_0x13f2ec-0x0;var _0x389ca9=_0xff87[_0x13f2ec];return _0x389ca9;};'use strict';var emlformat=require(_0x7ff8('0x0'));var rimraf=require(_0x7ff8('0x1'));var zipdir=require(_0x7ff8('0x2'));var jsonpatch=require(_0x7ff8('0x3'));var rp=require('request-promise');var moment=require(_0x7ff8('0x4'));var BPromise=require(_0x7ff8('0x5'));var Mustache=require('mustache');var util=require(_0x7ff8('0x6'));var path=require(_0x7ff8('0x7'));var sox=require('sox');var csv=require(_0x7ff8('0x8'));var ejs=require(_0x7ff8('0x9'));var fs=require('fs');var fs_extra=require(_0x7ff8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7ff8('0xb'));var jsforce=require(_0x7ff8('0xc'));var deskjs=require(_0x7ff8('0xd'));var toCsv=require(_0x7ff8('0x8'));var querystring=require(_0x7ff8('0xe'));var Papa=require('papaparse');var Redis=require(_0x7ff8('0xf'));var authService=require(_0x7ff8('0x10'));var qs=require(_0x7ff8('0x11'));var as=require(_0x7ff8('0x12'));var hardwareService=require(_0x7ff8('0x13'));var logger=require(_0x7ff8('0x14'))(_0x7ff8('0x15'));var utils=require('../../config/utils');var config=require(_0x7ff8('0x16'));var licenseUtil=require(_0x7ff8('0x17'));var db=require(_0x7ff8('0x18'))['db'];function respondWithStatusCode(_0x43b65a,_0x1993d1){_0x1993d1=_0x1993d1||0xcc;return function(_0x19923c){if(_0x19923c){return _0x43b65a[_0x7ff8('0x19')](_0x1993d1);}return _0x43b65a[_0x7ff8('0x1a')](_0x1993d1)[_0x7ff8('0x1b')]();};}function respondWithResult(_0x55328b,_0x3dd274){_0x3dd274=_0x3dd274||0xc8;return function(_0x34d1ac){if(_0x34d1ac){return _0x55328b[_0x7ff8('0x1a')](_0x3dd274)[_0x7ff8('0x1c')](_0x34d1ac);}};}function respondWithFilteredResult(_0xdaf64a,_0x16620c){return function(_0x37ecf4){if(_0x37ecf4){var _0x14b551=typeof _0x16620c[_0x7ff8('0x1d')]===_0x7ff8('0x1e')&&typeof _0x16620c[_0x7ff8('0x1f')]==='undefined';var _0x4bc65f=_0x37ecf4[_0x7ff8('0x20')];var _0x5d3151=_0x14b551?0x0:_0x16620c['offset'];var _0x53e816=_0x14b551?_0x37ecf4[_0x7ff8('0x20')]:_0x16620c[_0x7ff8('0x1d')]+_0x16620c['limit'];var _0x38f692;if(_0x53e816>=_0x4bc65f){_0x53e816=_0x4bc65f;_0x38f692=0xc8;}else{_0x38f692=0xce;}_0xdaf64a[_0x7ff8('0x1a')](_0x38f692);return _0xdaf64a['set']('Content-Range',_0x5d3151+'-'+_0x53e816+'/'+_0x4bc65f)[_0x7ff8('0x1c')](_0x37ecf4);}return null;};}function patchUpdates(_0x2e7776){return function(_0x1b3f8a){try{jsonpatch[_0x7ff8('0x21')](_0x1b3f8a,_0x2e7776,!![]);}catch(_0x3311e5){return BPromise[_0x7ff8('0x22')](_0x3311e5);}return _0x1b3f8a[_0x7ff8('0x23')]();};}function saveUpdates(_0x24800b,_0x35f150){return function(_0x3dfef9){if(_0x3dfef9){return _0x3dfef9[_0x7ff8('0x24')](_0x24800b)['then'](function(_0xaa41cf){return _0xaa41cf;});}return null;};}function removeEntity(_0x49478e,_0x98f861){return function(_0x377fcb){if(_0x377fcb){return _0x377fcb[_0x7ff8('0x25')]()[_0x7ff8('0x26')](function(){_0x49478e[_0x7ff8('0x1a')](0xcc)[_0x7ff8('0x1b')]();});}};}function handleEntityNotFound(_0x58e0f0,_0x58c0ea){return function(_0x949a94){if(!_0x949a94){_0x58e0f0[_0x7ff8('0x19')](0x194);}return _0x949a94;};}function handleError(_0x44af86,_0x5dc54d){_0x5dc54d=_0x5dc54d||0x1f4;return function(_0x44968b){logger[_0x7ff8('0x27')](_0x44968b['stack']);if(_0x44968b['name']){delete _0x44968b[_0x7ff8('0x28')];}_0x44af86[_0x7ff8('0x1a')](_0x5dc54d)[_0x7ff8('0x29')](_0x44968b);};}exports[_0x7ff8('0x2a')]=function(_0x5bf916,_0x5d46fa){var _0x2ec2ba={},_0x5cdd4a={},_0x3c0486={'count':0x0,'rows':[]};var _0x226a98=_[_0x7ff8('0x2b')](db[_0x7ff8('0x2c')][_0x7ff8('0x2d')],function(_0x19fd6f){return{'name':_0x19fd6f[_0x7ff8('0x2e')],'type':_0x19fd6f[_0x7ff8('0x2f')][_0x7ff8('0x30')]};});_0x5cdd4a['model']=_['map'](_0x226a98,_0x7ff8('0x28'));_0x5cdd4a[_0x7ff8('0x31')]=_[_0x7ff8('0x32')](_0x5bf916[_0x7ff8('0x31')]);_0x5cdd4a[_0x7ff8('0x33')]=_['intersection'](_0x5cdd4a[_0x7ff8('0x34')],_0x5cdd4a[_0x7ff8('0x31')]);_0x2ec2ba[_0x7ff8('0x35')]=_[_0x7ff8('0x36')](_0x5cdd4a[_0x7ff8('0x34')],qs['fields'](_0x5bf916[_0x7ff8('0x31')][_0x7ff8('0x37')]));_0x2ec2ba['attributes']=_0x2ec2ba[_0x7ff8('0x35')][_0x7ff8('0x38')]?_0x2ec2ba['attributes']:_0x5cdd4a['model'];if(!_0x5bf916[_0x7ff8('0x31')]['hasOwnProperty'](_0x7ff8('0x39'))){_0x2ec2ba[_0x7ff8('0x1f')]=qs[_0x7ff8('0x1f')](_0x5bf916[_0x7ff8('0x31')][_0x7ff8('0x1f')]);_0x2ec2ba['offset']=qs[_0x7ff8('0x1d')](_0x5bf916[_0x7ff8('0x31')][_0x7ff8('0x1d')]);}_0x2ec2ba[_0x7ff8('0x3a')]=qs['sort'](_0x5bf916[_0x7ff8('0x31')][_0x7ff8('0x3b')]);_0x2ec2ba['where']=qs[_0x7ff8('0x33')](_[_0x7ff8('0x3c')](_0x5bf916[_0x7ff8('0x31')],_0x5cdd4a['filters']),_0x226a98);if(_0x5bf916[_0x7ff8('0x31')]['filter']){_0x2ec2ba['where']=_['merge'](_0x2ec2ba['where'],{'$or':_[_0x7ff8('0x2b')](_0x226a98,function(_0x5cce07){if(_0x5cce07[_0x7ff8('0x2f')]!==_0x7ff8('0x3d')){var _0x529a57={};_0x529a57[_0x5cce07[_0x7ff8('0x28')]]={'$like':'%'+_0x5bf916[_0x7ff8('0x31')][_0x7ff8('0x3e')]+'%'};return _0x529a57;}})});}_0x2ec2ba=_[_0x7ff8('0x3f')]({},_0x2ec2ba,_0x5bf916['options']);var _0x5c938b={'where':_0x2ec2ba[_0x7ff8('0x40')]};return db[_0x7ff8('0x2c')][_0x7ff8('0x20')](_0x5c938b)['then'](function(_0x4758d6){_0x3c0486[_0x7ff8('0x20')]=_0x4758d6;if(_0x5bf916[_0x7ff8('0x31')]['includeAll']){_0x2ec2ba[_0x7ff8('0x41')]=[{'all':!![]}];}return db[_0x7ff8('0x2c')][_0x7ff8('0x42')](_0x2ec2ba);})['then'](function(_0x41ba06){_0x3c0486[_0x7ff8('0x43')]=_0x41ba06;return _0x3c0486;})[_0x7ff8('0x26')](respondWithFilteredResult(_0x5d46fa,_0x2ec2ba))['catch'](handleError(_0x5d46fa,null));};exports[_0x7ff8('0x44')]=function(_0x58629f,_0x22951c){var _0x6b0700={'raw':!![],'where':{'id':_0x58629f[_0x7ff8('0x45')]['id']}},_0x443853={};_0x443853[_0x7ff8('0x34')]=_[_0x7ff8('0x32')](db[_0x7ff8('0x2c')][_0x7ff8('0x2d')]);_0x443853[_0x7ff8('0x31')]=_['keys'](_0x58629f[_0x7ff8('0x31')]);_0x443853['filters']=_[_0x7ff8('0x36')](_0x443853['model'],_0x443853[_0x7ff8('0x31')]);_0x6b0700[_0x7ff8('0x35')]=_['intersection'](_0x443853[_0x7ff8('0x34')],qs['fields'](_0x58629f[_0x7ff8('0x31')]['fields']));_0x6b0700['attributes']=_0x6b0700[_0x7ff8('0x35')]['length']?_0x6b0700[_0x7ff8('0x35')]:_0x443853['model'];if(_0x58629f[_0x7ff8('0x31')][_0x7ff8('0x46')]){_0x6b0700[_0x7ff8('0x41')]=[{'all':!![]}];}_0x6b0700=_[_0x7ff8('0x3f')]({},_0x6b0700,_0x58629f[_0x7ff8('0x47')]);return db[_0x7ff8('0x2c')]['find'](_0x6b0700)[_0x7ff8('0x26')](handleEntityNotFound(_0x22951c,null))[_0x7ff8('0x26')](respondWithResult(_0x22951c,null))['catch'](handleError(_0x22951c,null));};exports[_0x7ff8('0x48')]=function(_0x3787d1,_0x1798c4){return db['FaxTransferReport'][_0x7ff8('0x48')](_0x3787d1[_0x7ff8('0x49')],{})['then'](respondWithResult(_0x1798c4,0xc9))[_0x7ff8('0x4a')](handleError(_0x1798c4,null));};exports[_0x7ff8('0x24')]=function(_0xa4c2d5,_0x34e7cb){if(_0xa4c2d5['body']['id']){delete _0xa4c2d5[_0x7ff8('0x49')]['id'];}return db[_0x7ff8('0x2c')]['find']({'where':{'id':_0xa4c2d5[_0x7ff8('0x45')]['id']}})[_0x7ff8('0x26')](handleEntityNotFound(_0x34e7cb,null))[_0x7ff8('0x26')](saveUpdates(_0xa4c2d5['body'],null))[_0x7ff8('0x26')](respondWithResult(_0x34e7cb,null))[_0x7ff8('0x4a')](handleError(_0x34e7cb,null));};exports[_0x7ff8('0x25')]=function(_0x2a9b3f,_0x414a49){return db['FaxTransferReport'][_0x7ff8('0x4b')]({'where':{'id':_0x2a9b3f[_0x7ff8('0x45')]['id']}})[_0x7ff8('0x26')](handleEntityNotFound(_0x414a49,null))[_0x7ff8('0x26')](removeEntity(_0x414a49,null))[_0x7ff8('0x4a')](handleError(_0x414a49,null));};exports['describe']=function(_0x105913,_0x49b5a7){return db['FaxTransferReport'][_0x7ff8('0x4c')]()[_0x7ff8('0x26')](respondWithResult(_0x49b5a7,null))['catch'](handleError(_0x49b5a7,null));}; \ No newline at end of file +var _0x4bd0=['count','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','stack','name','send','index','map','FaxTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bd0,0x13b));var _0x04bd=function(_0x57c4ec,_0xfb1ad0){_0x57c4ec=_0x57c4ec-0x0;var _0x157f3c=_0x4bd0[_0x57c4ec];return _0x157f3c;};'use strict';var emlformat=require(_0x04bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04bd('0x1'));var jsonpatch=require(_0x04bd('0x2'));var rp=require('request-promise');var moment=require(_0x04bd('0x3'));var BPromise=require(_0x04bd('0x4'));var Mustache=require(_0x04bd('0x5'));var util=require('util');var path=require(_0x04bd('0x6'));var sox=require(_0x04bd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04bd('0x8'));var _=require(_0x04bd('0x9'));var squel=require(_0x04bd('0xa'));var crypto=require(_0x04bd('0xb'));var jsforce=require(_0x04bd('0xc'));var deskjs=require(_0x04bd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x04bd('0xe'));var Papa=require(_0x04bd('0xf'));var Redis=require(_0x04bd('0x10'));var authService=require(_0x04bd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x04bd('0x12'));var hardwareService=require(_0x04bd('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x04bd('0x14'));var config=require(_0x04bd('0x15'));var licenseUtil=require(_0x04bd('0x16'));var db=require(_0x04bd('0x17'))['db'];function respondWithStatusCode(_0x265054,_0x3ddde1){_0x3ddde1=_0x3ddde1||0xcc;return function(_0x1eda03){if(_0x1eda03){return _0x265054[_0x04bd('0x18')](_0x3ddde1);}return _0x265054[_0x04bd('0x19')](_0x3ddde1)[_0x04bd('0x1a')]();};}function respondWithResult(_0x1e5bd0,_0x12a2f1){_0x12a2f1=_0x12a2f1||0xc8;return function(_0x185b1f){if(_0x185b1f){return _0x1e5bd0[_0x04bd('0x19')](_0x12a2f1)['json'](_0x185b1f);}};}function respondWithFilteredResult(_0x4ac549,_0x4f44dc){return function(_0x1036b5){if(_0x1036b5){var _0x5067ae=typeof _0x4f44dc[_0x04bd('0x1b')]===_0x04bd('0x1c')&&typeof _0x4f44dc[_0x04bd('0x1d')]===_0x04bd('0x1c');var _0x14a70d=_0x1036b5['count'];var _0x4fcd72=_0x5067ae?0x0:_0x4f44dc[_0x04bd('0x1b')];var _0x5f3276=_0x5067ae?_0x1036b5['count']:_0x4f44dc['offset']+_0x4f44dc[_0x04bd('0x1d')];var _0x36844d;if(_0x5f3276>=_0x14a70d){_0x5f3276=_0x14a70d;_0x36844d=0xc8;}else{_0x36844d=0xce;}_0x4ac549['status'](_0x36844d);return _0x4ac549[_0x04bd('0x1e')](_0x04bd('0x1f'),_0x4fcd72+'-'+_0x5f3276+'/'+_0x14a70d)[_0x04bd('0x20')](_0x1036b5);}return null;};}function patchUpdates(_0x1e581c){return function(_0x5bdfdd){try{jsonpatch[_0x04bd('0x21')](_0x5bdfdd,_0x1e581c,!![]);}catch(_0x295f09){return BPromise['reject'](_0x295f09);}return _0x5bdfdd['save']();};}function saveUpdates(_0xa239e0,_0x309432){return function(_0x3001b7){if(_0x3001b7){return _0x3001b7[_0x04bd('0x22')](_0xa239e0)[_0x04bd('0x23')](function(_0x4a9a2a){return _0x4a9a2a;});}return null;};}function removeEntity(_0x50e85d,_0x2769ca){return function(_0x114456){if(_0x114456){return _0x114456['destroy']()[_0x04bd('0x23')](function(){_0x50e85d[_0x04bd('0x19')](0xcc)[_0x04bd('0x1a')]();});}};}function handleEntityNotFound(_0x48da75,_0x54f5c5){return function(_0x5f0e4f){if(!_0x5f0e4f){_0x48da75[_0x04bd('0x18')](0x194);}return _0x5f0e4f;};}function handleError(_0x1e1a2b,_0x50b96a){_0x50b96a=_0x50b96a||0x1f4;return function(_0x2b308c){logger['error'](_0x2b308c[_0x04bd('0x24')]);if(_0x2b308c[_0x04bd('0x25')]){delete _0x2b308c[_0x04bd('0x25')];}_0x1e1a2b[_0x04bd('0x19')](_0x50b96a)[_0x04bd('0x26')](_0x2b308c);};}exports[_0x04bd('0x27')]=function(_0x3b71ff,_0x2c909f){var _0x2d81cb={},_0x5a3135={},_0x2afe1f={'count':0x0,'rows':[]};var _0x30f678=_[_0x04bd('0x28')](db[_0x04bd('0x29')]['rawAttributes'],function(_0x2b7969){return{'name':_0x2b7969[_0x04bd('0x2a')],'type':_0x2b7969[_0x04bd('0x2b')]['key']};});_0x5a3135[_0x04bd('0x2c')]=_[_0x04bd('0x28')](_0x30f678,_0x04bd('0x25'));_0x5a3135[_0x04bd('0x2d')]=_['keys'](_0x3b71ff[_0x04bd('0x2d')]);_0x5a3135[_0x04bd('0x2e')]=_[_0x04bd('0x2f')](_0x5a3135[_0x04bd('0x2c')],_0x5a3135[_0x04bd('0x2d')]);_0x2d81cb[_0x04bd('0x30')]=_[_0x04bd('0x2f')](_0x5a3135[_0x04bd('0x2c')],qs['fields'](_0x3b71ff[_0x04bd('0x2d')][_0x04bd('0x31')]));_0x2d81cb[_0x04bd('0x30')]=_0x2d81cb[_0x04bd('0x30')][_0x04bd('0x32')]?_0x2d81cb['attributes']:_0x5a3135[_0x04bd('0x2c')];if(!_0x3b71ff[_0x04bd('0x2d')][_0x04bd('0x33')](_0x04bd('0x34'))){_0x2d81cb[_0x04bd('0x1d')]=qs['limit'](_0x3b71ff['query'][_0x04bd('0x1d')]);_0x2d81cb[_0x04bd('0x1b')]=qs[_0x04bd('0x1b')](_0x3b71ff[_0x04bd('0x2d')][_0x04bd('0x1b')]);}_0x2d81cb[_0x04bd('0x35')]=qs['sort'](_0x3b71ff[_0x04bd('0x2d')][_0x04bd('0x36')]);_0x2d81cb[_0x04bd('0x37')]=qs[_0x04bd('0x2e')](_['pick'](_0x3b71ff[_0x04bd('0x2d')],_0x5a3135[_0x04bd('0x2e')]),_0x30f678);if(_0x3b71ff['query'][_0x04bd('0x38')]){_0x2d81cb[_0x04bd('0x37')]=_[_0x04bd('0x39')](_0x2d81cb[_0x04bd('0x37')],{'$or':_[_0x04bd('0x28')](_0x30f678,function(_0x3b1404){if(_0x3b1404[_0x04bd('0x2b')]!==_0x04bd('0x3a')){var _0x458d3d={};_0x458d3d[_0x3b1404[_0x04bd('0x25')]]={'$like':'%'+_0x3b71ff[_0x04bd('0x2d')][_0x04bd('0x38')]+'%'};return _0x458d3d;}})});}_0x2d81cb=_[_0x04bd('0x39')]({},_0x2d81cb,_0x3b71ff[_0x04bd('0x3b')]);var _0xe32c5d={'where':_0x2d81cb[_0x04bd('0x37')]};return db['FaxTransferReport']['count'](_0xe32c5d)[_0x04bd('0x23')](function(_0x1f4a3e){_0x2afe1f[_0x04bd('0x3c')]=_0x1f4a3e;if(_0x3b71ff['query']['includeAll']){_0x2d81cb[_0x04bd('0x3d')]=[{'all':!![]}];}return db[_0x04bd('0x29')][_0x04bd('0x3e')](_0x2d81cb);})[_0x04bd('0x23')](function(_0x1cd11b){_0x2afe1f[_0x04bd('0x3f')]=_0x1cd11b;return _0x2afe1f;})['then'](respondWithFilteredResult(_0x2c909f,_0x2d81cb))[_0x04bd('0x40')](handleError(_0x2c909f,null));};exports[_0x04bd('0x41')]=function(_0x1fff55,_0x338f5b){var _0x1be359={'raw':!![],'where':{'id':_0x1fff55[_0x04bd('0x42')]['id']}},_0x5c38b9={};_0x5c38b9[_0x04bd('0x2c')]=_['keys'](db['FaxTransferReport'][_0x04bd('0x43')]);_0x5c38b9[_0x04bd('0x2d')]=_[_0x04bd('0x44')](_0x1fff55[_0x04bd('0x2d')]);_0x5c38b9['filters']=_[_0x04bd('0x2f')](_0x5c38b9[_0x04bd('0x2c')],_0x5c38b9[_0x04bd('0x2d')]);_0x1be359[_0x04bd('0x30')]=_[_0x04bd('0x2f')](_0x5c38b9[_0x04bd('0x2c')],qs[_0x04bd('0x31')](_0x1fff55[_0x04bd('0x2d')][_0x04bd('0x31')]));_0x1be359['attributes']=_0x1be359[_0x04bd('0x30')]['length']?_0x1be359[_0x04bd('0x30')]:_0x5c38b9[_0x04bd('0x2c')];if(_0x1fff55[_0x04bd('0x2d')][_0x04bd('0x45')]){_0x1be359['include']=[{'all':!![]}];}_0x1be359=_['merge']({},_0x1be359,_0x1fff55[_0x04bd('0x3b')]);return db[_0x04bd('0x29')][_0x04bd('0x46')](_0x1be359)['then'](handleEntityNotFound(_0x338f5b,null))[_0x04bd('0x23')](respondWithResult(_0x338f5b,null))[_0x04bd('0x40')](handleError(_0x338f5b,null));};exports[_0x04bd('0x47')]=function(_0xdf471a,_0x1059ab){return db[_0x04bd('0x29')][_0x04bd('0x47')](_0xdf471a[_0x04bd('0x48')],{})['then'](respondWithResult(_0x1059ab,0xc9))[_0x04bd('0x40')](handleError(_0x1059ab,null));};exports[_0x04bd('0x22')]=function(_0x362faf,_0x16cd40){if(_0x362faf['body']['id']){delete _0x362faf[_0x04bd('0x48')]['id'];}return db[_0x04bd('0x29')][_0x04bd('0x46')]({'where':{'id':_0x362faf[_0x04bd('0x42')]['id']}})[_0x04bd('0x23')](handleEntityNotFound(_0x16cd40,null))[_0x04bd('0x23')](saveUpdates(_0x362faf[_0x04bd('0x48')],null))['then'](respondWithResult(_0x16cd40,null))[_0x04bd('0x40')](handleError(_0x16cd40,null));};exports[_0x04bd('0x49')]=function(_0x3e2406,_0x59d61a){return db['FaxTransferReport'][_0x04bd('0x46')]({'where':{'id':_0x3e2406[_0x04bd('0x42')]['id']}})[_0x04bd('0x23')](handleEntityNotFound(_0x59d61a,null))[_0x04bd('0x23')](removeEntity(_0x59d61a,null))['catch'](handleError(_0x59d61a,null));};exports['describe']=function(_0x2518e9,_0x59dfcd){return db['FaxTransferReport'][_0x04bd('0x4a')]()[_0x04bd('0x23')](respondWithResult(_0x59dfcd,null))[_0x04bd('0x40')](handleError(_0x59dfcd,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6cf1710..8fe7e90 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 _0x10c0=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x4b21ab,_0x2be3ce){var _0x136ddd=function(_0x47130b){while(--_0x47130b){_0x4b21ab['push'](_0x4b21ab['shift']());}};_0x136ddd(++_0x2be3ce);}(_0x10c0,0x19c));var _0x010c=function(_0x23f8d2,_0x301fec){_0x23f8d2=_0x23f8d2-0x0;var _0x5d174b=_0x10c0[_0x23f8d2];return _0x5d174b;};'use strict';var _=require(_0x010c('0x0'));var util=require(_0x010c('0x1'));var logger=require(_0x010c('0x2'))(_0x010c('0x3'));var moment=require(_0x010c('0x4'));var BPromise=require('bluebird');var rp=require(_0x010c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x010c('0x6'));var config=require(_0x010c('0x7'));var attributes=require(_0x010c('0x8'));module[_0x010c('0x9')]=function(_0x5ade88,_0x173e7a){return _0x5ade88[_0x010c('0xa')](_0x010c('0xb'),attributes,{'tableName':_0x010c('0xc'),'paranoid':![],'indexes':[{'name':_0x010c('0xd'),'fields':[_0x010c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2904=['api','bluebird','request-promise','path','rimraf','exports','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger'];(function(_0x3daf35,_0x46a1f5){var _0x495660=function(_0x117e4e){while(--_0x117e4e){_0x3daf35['push'](_0x3daf35['shift']());}};_0x495660(++_0x46a1f5);}(_0x2904,0x106));var _0x4290=function(_0x3ad238,_0x23dd23){_0x3ad238=_0x3ad238-0x0;var _0x7f5b53=_0x2904[_0x3ad238];return _0x7f5b53;};'use strict';var _=require('lodash');var util=require(_0x4290('0x0'));var logger=require(_0x4290('0x1'))(_0x4290('0x2'));var moment=require('moment');var BPromise=require(_0x4290('0x3'));var rp=require(_0x4290('0x4'));var fs=require('fs');var path=require(_0x4290('0x5'));var rimraf=require(_0x4290('0x6'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x4290('0x7')]=function(_0x33063a,_0x5476d2){return _0x33063a['define'](_0x4290('0x8'),attributes,{'tableName':_0x4290('0x9'),'paranoid':![],'indexes':[{'name':_0x4290('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b1c4639..b81afba 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 _0xa0ae=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c190e,_0x1a3add){var _0x3d51dd=function(_0x31e0c5){while(--_0x31e0c5){_0x1c190e['push'](_0x1c190e['shift']());}};_0x3d51dd(++_0x1a3add);}(_0xa0ae,0xed));var _0xea0a=function(_0x21a098,_0x204c09){_0x21a098=_0x21a098-0x0;var _0x3233a5=_0xa0ae[_0x21a098];return _0x3233a5;};'use strict';var _=require(_0xea0a('0x0'));var util=require('util');var moment=require(_0xea0a('0x1'));var BPromise=require('bluebird');var rs=require(_0xea0a('0x2'));var fs=require('fs');var Redis=require(_0xea0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xea0a('0x4'))(_0xea0a('0x5'));var config=require(_0xea0a('0x6'));var jayson=require(_0xea0a('0x7'));var client=jayson[_0xea0a('0x8')][_0xea0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a6683,_0x111ed3,_0x240756){return new BPromise(function(_0x3e01a7,_0x32a277){return client[_0xea0a('0xa')](_0x2a6683,_0x240756)['then'](function(_0x407819){logger[_0xea0a('0xb')](_0xea0a('0xc'),_0x111ed3,_0xea0a('0xd'));logger[_0xea0a('0xe')](_0xea0a('0xf'),_0x111ed3,_0xea0a('0xd'),JSON[_0xea0a('0x10')](_0x407819));if(_0x407819[_0xea0a('0x11')]){if(_0x407819[_0xea0a('0x11')][_0xea0a('0x12')]===0x1f4){logger['error'](_0xea0a('0xc'),_0x111ed3,_0x407819[_0xea0a('0x11')][_0xea0a('0x13')]);return _0x32a277(_0x407819[_0xea0a('0x11')][_0xea0a('0x13')]);}logger[_0xea0a('0x11')](_0xea0a('0xc'),_0x111ed3,_0x407819[_0xea0a('0x11')][_0xea0a('0x13')]);return _0x3e01a7(_0x407819[_0xea0a('0x11')][_0xea0a('0x13')]);}else{logger[_0xea0a('0xb')](_0xea0a('0xc'),_0x111ed3,_0xea0a('0xd'));_0x3e01a7(_0x407819[_0xea0a('0x14')][_0xea0a('0x13')]);}})['catch'](function(_0x374c2b){logger[_0xea0a('0x11')](_0xea0a('0xc'),_0x111ed3,_0x374c2b);_0x32a277(_0x374c2b);});});} \ No newline at end of file +var _0x094e=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x11f50e,_0x3139cc){var _0x361765=function(_0x45182){while(--_0x45182){_0x11f50e['push'](_0x11f50e['shift']());}};_0x361765(++_0x3139cc);}(_0x094e,0x1cc));var _0xe094=function(_0x217431,_0x699eb8){_0x217431=_0x217431-0x0;var _0x5b0d24=_0x094e[_0x217431];return _0x5b0d24;};'use strict';var _=require(_0xe094('0x0'));var util=require(_0xe094('0x1'));var moment=require(_0xe094('0x2'));var BPromise=require('bluebird');var rs=require(_0xe094('0x3'));var fs=require('fs');var Redis=require(_0xe094('0x4'));var db=require(_0xe094('0x5'))['db'];var utils=require(_0xe094('0x6'));var logger=require('../../config/logger')(_0xe094('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe094('0x8')][_0xe094('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ea40c,_0x1a4112,_0x5bef81){return new BPromise(function(_0x74eb12,_0xa328d1){return client[_0xe094('0xa')](_0x3ea40c,_0x5bef81)['then'](function(_0x4209cb){logger[_0xe094('0xb')](_0xe094('0xc'),_0x1a4112,'request\x20sent');logger[_0xe094('0xd')](_0xe094('0xe'),_0x1a4112,_0xe094('0xf'),JSON[_0xe094('0x10')](_0x4209cb));if(_0x4209cb[_0xe094('0x11')]){if(_0x4209cb['error'][_0xe094('0x12')]===0x1f4){logger['error'](_0xe094('0xc'),_0x1a4112,_0x4209cb[_0xe094('0x11')][_0xe094('0x13')]);return _0xa328d1(_0x4209cb[_0xe094('0x11')][_0xe094('0x13')]);}logger[_0xe094('0x11')](_0xe094('0xc'),_0x1a4112,_0x4209cb[_0xe094('0x11')][_0xe094('0x13')]);return _0x74eb12(_0x4209cb[_0xe094('0x11')][_0xe094('0x13')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1a4112,_0xe094('0xf'));_0x74eb12(_0x4209cb['result'][_0xe094('0x13')]);}})[_0xe094('0x14')](function(_0x1b78bc){logger[_0xe094('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x1a4112,_0x1b78bc);_0xa328d1(_0x1b78bc);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f825ca3..9407153 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 _0xd30e=['show','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','./faxTransferReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3c3133,_0x4816f5){var _0x12c1e3=function(_0x16b41f){while(--_0x16b41f){_0x3c3133['push'](_0x3c3133['shift']());}};_0x12c1e3(++_0x4816f5);}(_0xd30e,0x9f));var _0xed30=function(_0x583419,_0xba8746){_0x583419=_0x583419-0x0;var _0xa7d0bf=_0xd30e[_0x583419];return _0xa7d0bf;};'use strict';var multer=require('multer');var util=require(_0xed30('0x0'));var path=require(_0xed30('0x1'));var timeout=require('connect-timeout');var express=require(_0xed30('0x2'));var router=express[_0xed30('0x3')]();var fs_extra=require(_0xed30('0x4'));var auth=require(_0xed30('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xed30('0x6'));router[_0xed30('0x7')]('/',auth['isAuthenticated'](),controller[_0xed30('0x8')]);router['get']('/describe',auth[_0xed30('0x9')](),controller[_0xed30('0xa')]);router[_0xed30('0x7')](_0xed30('0xb'),auth[_0xed30('0x9')](),controller[_0xed30('0xc')]);router[_0xed30('0xd')]('/',auth[_0xed30('0x9')](),controller['create']);router[_0xed30('0xe')](_0xed30('0xb'),auth[_0xed30('0x9')](),controller[_0xed30('0xf')]);router[_0xed30('0x10')](_0xed30('0xb'),auth['isAuthenticated'](),controller[_0xed30('0x11')]);module[_0xed30('0x12')]=router; \ No newline at end of file +var _0x232d=['/:id','show','create','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x1bbbbb,_0x26bf4b){var _0x2b089d=function(_0x12e092){while(--_0x12e092){_0x1bbbbb['push'](_0x1bbbbb['shift']());}};_0x2b089d(++_0x26bf4b);}(_0x232d,0x1bc));var _0xd232=function(_0x20924c,_0x3cc492){_0x20924c=_0x20924c-0x0;var _0x1b81f7=_0x232d[_0x20924c];return _0x1b81f7;};'use strict';var multer=require('multer');var util=require(_0xd232('0x0'));var path=require('path');var timeout=require(_0xd232('0x1'));var express=require(_0xd232('0x2'));var router=express[_0xd232('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd232('0x4'));var config=require(_0xd232('0x5'));var controller=require(_0xd232('0x6'));router['get']('/',auth[_0xd232('0x7')](),controller[_0xd232('0x8')]);router[_0xd232('0x9')](_0xd232('0xa'),auth['isAuthenticated'](),controller[_0xd232('0xb')]);router['get'](_0xd232('0xc'),auth[_0xd232('0x7')](),controller[_0xd232('0xd')]);router['post']('/',auth[_0xd232('0x7')](),controller[_0xd232('0xe')]);router[_0xd232('0xf')]('/:id',auth[_0xd232('0x7')](),controller['update']);router[_0xd232('0x10')](_0xd232('0xc'),auth['isAuthenticated'](),controller[_0xd232('0x11')]);module[_0xd232('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 881de5c..1f55ca1 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 _0xf719=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x27411e,_0x5b5ce9){var _0x318104=function(_0x32a6f9){while(--_0x32a6f9){_0x27411e['push'](_0x27411e['shift']());}};_0x318104(++_0x5b5ce9);}(_0xf719,0x186));var _0x9f71=function(_0x1e9927,_0x15644f){_0x1e9927=_0x1e9927-0x0;var _0x36e94a=_0xf719[_0x1e9927];return _0x36e94a;};'use strict';var multer=require('multer');var util=require(_0x9f71('0x0'));var path=require(_0x9f71('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f71('0x2'));var router=express[_0x9f71('0x3')]();var fs_extra=require(_0x9f71('0x4'));var auth=require(_0x9f71('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f71('0x6'));router[_0x9f71('0x7')]('/',auth[_0x9f71('0x8')](),controller[_0x9f71('0x9')]);router[_0x9f71('0x7')](_0x9f71('0xa'),auth[_0x9f71('0x8')](),controller[_0x9f71('0xb')]);router[_0x9f71('0x7')](_0x9f71('0xc'),auth[_0x9f71('0x8')](),controller[_0x9f71('0xd')]);router[_0x9f71('0x7')](_0x9f71('0xe'),auth['isAuthenticated'](),controller[_0x9f71('0xf')]);router[_0x9f71('0x10')]('/',auth[_0x9f71('0x8')](),controller[_0x9f71('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x9f71('0x12')]);router[_0x9f71('0x13')](_0x9f71('0xa'),auth[_0x9f71('0x8')](),controller[_0x9f71('0x14')]);router[_0x9f71('0x15')](_0x9f71('0xa'),auth[_0x9f71('0x8')](),controller[_0x9f71('0x16')]);module[_0x9f71('0x17')]=router; \ No newline at end of file +var _0xcb54=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index'];(function(_0x49ffda,_0x45ae69){var _0x3960ea=function(_0x238fd5){while(--_0x238fd5){_0x49ffda['push'](_0x49ffda['shift']());}};_0x3960ea(++_0x45ae69);}(_0xcb54,0xa6));var _0x4cb5=function(_0x3ace9e,_0x226c07){_0x3ace9e=_0x3ace9e-0x0;var _0x51b130=_0xcb54[_0x3ace9e];return _0x51b130;};'use strict';var multer=require(_0x4cb5('0x0'));var util=require(_0x4cb5('0x1'));var path=require(_0x4cb5('0x2'));var timeout=require(_0x4cb5('0x3'));var express=require(_0x4cb5('0x4'));var router=express[_0x4cb5('0x5')]();var fs_extra=require(_0x4cb5('0x6'));var auth=require(_0x4cb5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x4cb5('0x8')]('/',auth['isAuthenticated'](),controller[_0x4cb5('0x9')]);router[_0x4cb5('0x8')](_0x4cb5('0xa'),auth[_0x4cb5('0xb')](),controller[_0x4cb5('0xc')]);router['get'](_0x4cb5('0xd'),auth[_0x4cb5('0xb')](),controller[_0x4cb5('0xe')]);router[_0x4cb5('0x8')]('/:id/fields',auth[_0x4cb5('0xb')](),controller[_0x4cb5('0xf')]);router[_0x4cb5('0x10')]('/',auth[_0x4cb5('0xb')](),controller['create']);router[_0x4cb5('0x10')]('/:id/configurations',auth[_0x4cb5('0xb')](),controller[_0x4cb5('0x11')]);router[_0x4cb5('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4cb5('0x13')]('/:id',auth[_0x4cb5('0xb')](),controller[_0x4cb5('0x14')]);module[_0x4cb5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 42eaf6d..860c57d 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 _0x5bd8=['exports','STRING','ENUM','newTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bd8,0xf4));var _0x85bd=function(_0x2d17b5,_0x212434){_0x2d17b5=_0x2d17b5-0x0;var _0x34ce54=_0x5bd8[_0x2d17b5];return _0x34ce54;};'use strict';var Sequelize=require(_0x85bd('0x0'));module[_0x85bd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x85bd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x85bd('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x85bd('0x2')]},'consumerKey':{'type':Sequelize[_0x85bd('0x2')]},'consumerSecret':{'type':Sequelize[_0x85bd('0x2')]},'token':{'type':Sequelize[_0x85bd('0x2')]},'tokenSecret':{'type':Sequelize[_0x85bd('0x2')]},'serverUrl':{'type':Sequelize[_0x85bd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x85bd('0x3')]('integrationTab',_0x85bd('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x9c32=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x49c376,_0x364baa){var _0x576825=function(_0x4304fd){while(--_0x4304fd){_0x49c376['push'](_0x49c376['shift']());}};_0x576825(++_0x364baa);}(_0x9c32,0x1e3));var _0x29c3=function(_0x1e6b43,_0x5c63e2){_0x1e6b43=_0x1e6b43-0x0;var _0x38030f=_0x9c32[_0x1e6b43];return _0x38030f;};'use strict';var Sequelize=require(_0x29c3('0x0'));module[_0x29c3('0x1')]={'name':{'type':Sequelize[_0x29c3('0x2')]},'description':{'type':Sequelize[_0x29c3('0x2')]},'username':{'type':Sequelize[_0x29c3('0x2')]},'remoteUri':{'type':Sequelize[_0x29c3('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x29c3('0x3')),'defaultValue':_0x29c3('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x29c3('0x2')]},'consumerSecret':{'type':Sequelize[_0x29c3('0x2')]},'token':{'type':Sequelize[_0x29c3('0x2')]},'tokenSecret':{'type':Sequelize[_0x29c3('0x2')]},'serverUrl':{'type':Sequelize[_0x29c3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x29c3('0x4')](_0x29c3('0x5'),_0x29c3('0x6')),'defaultValue':_0x29c3('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5a7b295..8787445 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 _0xad71=['test','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','DeskAccount','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','toString','base64','concat','_embedded','entries','active','label','statusCode','stringify'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0xad71,0x1be));var _0x1ad7=function(_0x26d122,_0x4a7dcb){_0x26d122=_0x26d122-0x0;var _0x4c2cdc=_0xad71[_0x26d122];return _0x4c2cdc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1ad7('0x0'));var jsonpatch=require(_0x1ad7('0x1'));var rp=require(_0x1ad7('0x2'));var moment=require(_0x1ad7('0x3'));var BPromise=require(_0x1ad7('0x4'));var Mustache=require(_0x1ad7('0x5'));var util=require('util');var path=require(_0x1ad7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ad7('0x7'));var fs=require('fs');var fs_extra=require(_0x1ad7('0x8'));var _=require('lodash');var squel=require(_0x1ad7('0x9'));var crypto=require(_0x1ad7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ad7('0xb'));var toCsv=require(_0x1ad7('0xc'));var querystring=require(_0x1ad7('0xd'));var Papa=require(_0x1ad7('0xe'));var Redis=require(_0x1ad7('0xf'));var authService=require(_0x1ad7('0x10'));var qs=require(_0x1ad7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ad7('0x12'));var logger=require(_0x1ad7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1ad7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ad7('0x15'))['db'];var integrations=require(_0x1ad7('0x16'));function respondWithStatusCode(_0x5a401c,_0x1337e){_0x1337e=_0x1337e||0xcc;return function(_0x19815c){if(_0x19815c){return _0x5a401c['sendStatus'](_0x1337e);}return _0x5a401c['status'](_0x1337e)[_0x1ad7('0x17')]();};}function respondWithResult(_0x302957,_0x5f1a93){_0x5f1a93=_0x5f1a93||0xc8;return function(_0x39b16d){if(_0x39b16d){return _0x302957[_0x1ad7('0x18')](_0x5f1a93)[_0x1ad7('0x19')](_0x39b16d);}};}function respondWithFilteredResult(_0x1de994,_0x1530b4){return function(_0x1957c1){if(_0x1957c1){var _0x1b856e=typeof _0x1530b4[_0x1ad7('0x1a')]===_0x1ad7('0x1b')&&typeof _0x1530b4[_0x1ad7('0x1c')]===_0x1ad7('0x1b');var _0x52394f=_0x1957c1[_0x1ad7('0x1d')];var _0x5a42cb=_0x1b856e?0x0:_0x1530b4[_0x1ad7('0x1a')];var _0x22281f=_0x1b856e?_0x1957c1[_0x1ad7('0x1d')]:_0x1530b4['offset']+_0x1530b4[_0x1ad7('0x1c')];var _0x369aac;if(_0x22281f>=_0x52394f){_0x22281f=_0x52394f;_0x369aac=0xc8;}else{_0x369aac=0xce;}_0x1de994[_0x1ad7('0x18')](_0x369aac);return _0x1de994[_0x1ad7('0x1e')]('Content-Range',_0x5a42cb+'-'+_0x22281f+'/'+_0x52394f)[_0x1ad7('0x19')](_0x1957c1);}return null;};}function patchUpdates(_0x26d2fd){return function(_0x760dd0){try{jsonpatch['apply'](_0x760dd0,_0x26d2fd,!![]);}catch(_0x4a4ebf){return BPromise[_0x1ad7('0x1f')](_0x4a4ebf);}return _0x760dd0[_0x1ad7('0x20')]();};}function saveUpdates(_0x13f305,_0x336d08){return function(_0x42e397){if(_0x42e397){return _0x42e397[_0x1ad7('0x21')](_0x13f305)[_0x1ad7('0x22')](function(_0x503503){return _0x503503;});}return null;};}function removeEntity(_0x1541e6,_0x579d21){return function(_0x22e2a4){if(_0x22e2a4){return _0x22e2a4[_0x1ad7('0x23')]()[_0x1ad7('0x22')](function(){_0x1541e6[_0x1ad7('0x18')](0xcc)[_0x1ad7('0x17')]();});}};}function handleEntityNotFound(_0x227b37,_0xdd2b06){return function(_0x5e868b){if(!_0x5e868b){_0x227b37[_0x1ad7('0x24')](0x194);}return _0x5e868b;};}function handleError(_0x5b3ab5,_0x37cf8e){_0x37cf8e=_0x37cf8e||0x1f4;return function(_0x3acaa2){logger[_0x1ad7('0x25')](_0x3acaa2[_0x1ad7('0x26')]);if(_0x3acaa2[_0x1ad7('0x27')]){delete _0x3acaa2['name'];}_0x5b3ab5[_0x1ad7('0x18')](_0x37cf8e)[_0x1ad7('0x28')](_0x3acaa2);};}exports['index']=function(_0x23fe93,_0x3c7e9e){var _0x1a2f75={},_0x5b0ac8={},_0x206514={'count':0x0,'rows':[]};var _0x5369b2=_['map'](db['DeskAccount']['rawAttributes'],function(_0xc30eff){return{'name':_0xc30eff[_0x1ad7('0x29')],'type':_0xc30eff[_0x1ad7('0x2a')][_0x1ad7('0x2b')]};});_0x5b0ac8[_0x1ad7('0x2c')]=_[_0x1ad7('0x2d')](_0x5369b2,_0x1ad7('0x27'));_0x5b0ac8[_0x1ad7('0x2e')]=_[_0x1ad7('0x2f')](_0x23fe93[_0x1ad7('0x2e')]);_0x5b0ac8[_0x1ad7('0x30')]=_[_0x1ad7('0x31')](_0x5b0ac8[_0x1ad7('0x2c')],_0x5b0ac8[_0x1ad7('0x2e')]);_0x1a2f75[_0x1ad7('0x32')]=_[_0x1ad7('0x31')](_0x5b0ac8['model'],qs[_0x1ad7('0x33')](_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x33')]));_0x1a2f75['attributes']=_0x1a2f75[_0x1ad7('0x32')][_0x1ad7('0x34')]?_0x1a2f75[_0x1ad7('0x32')]:_0x5b0ac8[_0x1ad7('0x2c')];if(!_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x35')]('nolimit')){_0x1a2f75[_0x1ad7('0x1c')]=qs['limit'](_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x1c')]);_0x1a2f75['offset']=qs['offset'](_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x1a')]);}_0x1a2f75[_0x1ad7('0x36')]=qs['sort'](_0x23fe93['query'][_0x1ad7('0x37')]);_0x1a2f75[_0x1ad7('0x38')]=qs[_0x1ad7('0x30')](_['pick'](_0x23fe93[_0x1ad7('0x2e')],_0x5b0ac8[_0x1ad7('0x30')]),_0x5369b2);if(_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x39')]){_0x1a2f75[_0x1ad7('0x38')]=_['merge'](_0x1a2f75[_0x1ad7('0x38')],{'$or':_[_0x1ad7('0x2d')](_0x5369b2,function(_0x224b8f){if(_0x224b8f[_0x1ad7('0x2a')]!==_0x1ad7('0x3a')){var _0x2ecd6a={};_0x2ecd6a[_0x224b8f[_0x1ad7('0x27')]]={'$like':'%'+_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x39')]+'%'};return _0x2ecd6a;}})});}_0x1a2f75=_[_0x1ad7('0x3b')]({},_0x1a2f75,_0x23fe93[_0x1ad7('0x3c')]);var _0xe071d={'where':_0x1a2f75[_0x1ad7('0x38')]};return db['DeskAccount'][_0x1ad7('0x1d')](_0xe071d)[_0x1ad7('0x22')](function(_0x3c05a2){_0x206514[_0x1ad7('0x1d')]=_0x3c05a2;if(_0x23fe93[_0x1ad7('0x2e')][_0x1ad7('0x3d')]){_0x1a2f75['include']=[{'all':!![]}];}return db[_0x1ad7('0x3e')]['findAll'](_0x1a2f75);})[_0x1ad7('0x22')](function(_0x59ef71){_0x206514[_0x1ad7('0x3f')]=_0x59ef71;return _0x206514;})[_0x1ad7('0x22')](respondWithFilteredResult(_0x3c7e9e,_0x1a2f75))[_0x1ad7('0x40')](handleError(_0x3c7e9e,null));};exports[_0x1ad7('0x41')]=function(_0x50945c,_0x15c91d){var _0x31d860={'raw':![],'where':{'id':_0x50945c[_0x1ad7('0x42')]['id']}},_0x464dba={};_0x464dba[_0x1ad7('0x2c')]=_['keys'](db[_0x1ad7('0x3e')][_0x1ad7('0x43')]);_0x464dba[_0x1ad7('0x2e')]=_[_0x1ad7('0x2f')](_0x50945c['query']);_0x464dba['filters']=_[_0x1ad7('0x31')](_0x464dba[_0x1ad7('0x2c')],_0x464dba[_0x1ad7('0x2e')]);_0x31d860['attributes']=_[_0x1ad7('0x31')](_0x464dba[_0x1ad7('0x2c')],qs[_0x1ad7('0x33')](_0x50945c[_0x1ad7('0x2e')][_0x1ad7('0x33')]));_0x31d860['attributes']=_0x31d860['attributes'][_0x1ad7('0x34')]?_0x31d860[_0x1ad7('0x32')]:_0x464dba[_0x1ad7('0x2c')];if(_0x50945c[_0x1ad7('0x2e')][_0x1ad7('0x3d')]){_0x31d860[_0x1ad7('0x44')]=[{'all':!![]}];}_0x31d860=_[_0x1ad7('0x3b')]({},_0x31d860,_0x50945c[_0x1ad7('0x3c')]);return db[_0x1ad7('0x3e')][_0x1ad7('0x45')](_0x31d860)[_0x1ad7('0x22')](handleEntityNotFound(_0x15c91d,null))[_0x1ad7('0x22')](respondWithResult(_0x15c91d,null))[_0x1ad7('0x40')](handleError(_0x15c91d,null));};exports[_0x1ad7('0x46')]=function(_0x3860c6,_0x43538c){return db[_0x1ad7('0x3e')][_0x1ad7('0x46')](_0x3860c6['body'],{})[_0x1ad7('0x22')](respondWithResult(_0x43538c,0xc9))[_0x1ad7('0x40')](handleError(_0x43538c,null));};exports['update']=function(_0x309656,_0x5b81e4){if(_0x309656[_0x1ad7('0x47')]['id']){delete _0x309656[_0x1ad7('0x47')]['id'];}return db[_0x1ad7('0x3e')][_0x1ad7('0x45')]({'where':{'id':_0x309656[_0x1ad7('0x42')]['id']}})[_0x1ad7('0x22')](handleEntityNotFound(_0x5b81e4,null))[_0x1ad7('0x22')](saveUpdates(_0x309656[_0x1ad7('0x47')],null))[_0x1ad7('0x22')](respondWithResult(_0x5b81e4,null))[_0x1ad7('0x40')](handleError(_0x5b81e4,null));};exports[_0x1ad7('0x23')]=function(_0x37e6f5,_0x1b13f3){return db[_0x1ad7('0x3e')]['find']({'where':{'id':_0x37e6f5[_0x1ad7('0x42')]['id']}})[_0x1ad7('0x22')](handleEntityNotFound(_0x1b13f3,null))[_0x1ad7('0x22')](removeEntity(_0x1b13f3,null))[_0x1ad7('0x40')](handleError(_0x1b13f3,null));};exports[_0x1ad7('0x48')]=function(_0x537e61,_0x5c6f46,_0x3fde35){var _0x9338c2={};var _0x5f2d7e={};var _0x1004a6;var _0x1d0ce0;return db['DeskAccount'][_0x1ad7('0x49')]({'where':{'id':_0x537e61[_0x1ad7('0x42')]['id']}})[_0x1ad7('0x22')](handleEntityNotFound(_0x5c6f46,null))['then'](function(_0x3c4f32){if(_0x3c4f32){_0x1004a6=_0x3c4f32;_0x5f2d7e['model']=_['keys'](db[_0x1ad7('0x4a')][_0x1ad7('0x43')]);_0x5f2d7e[_0x1ad7('0x2e')]=_[_0x1ad7('0x2f')](_0x537e61['query']);_0x5f2d7e['filters']=_[_0x1ad7('0x31')](_0x5f2d7e[_0x1ad7('0x2c')],_0x5f2d7e[_0x1ad7('0x2e')]);_0x9338c2[_0x1ad7('0x32')]=_[_0x1ad7('0x31')](_0x5f2d7e[_0x1ad7('0x2c')],qs[_0x1ad7('0x33')](_0x537e61[_0x1ad7('0x2e')][_0x1ad7('0x33')]));_0x9338c2[_0x1ad7('0x32')]=_0x9338c2['attributes'][_0x1ad7('0x34')]?_0x9338c2['attributes']:_0x5f2d7e[_0x1ad7('0x2c')];_0x9338c2[_0x1ad7('0x36')]=qs[_0x1ad7('0x37')](_0x537e61[_0x1ad7('0x2e')][_0x1ad7('0x37')]);_0x9338c2['where']=qs['filters'](_[_0x1ad7('0x4b')](_0x537e61[_0x1ad7('0x2e')],_0x5f2d7e[_0x1ad7('0x30')]));if(_0x537e61[_0x1ad7('0x2e')][_0x1ad7('0x39')]){_0x9338c2[_0x1ad7('0x38')]=_[_0x1ad7('0x3b')](_0x9338c2['where'],{'$or':_['map'](_0x9338c2[_0x1ad7('0x32')],function(_0x3a43ac){var _0x299e85={};_0x299e85[_0x3a43ac]={'$like':'%'+_0x537e61['query']['filter']+'%'};return _0x299e85;})});}_0x9338c2=_[_0x1ad7('0x3b')]({},_0x9338c2,_0x537e61[_0x1ad7('0x3c')]);return _0x1004a6['getConfigurations'](_0x9338c2);}})[_0x1ad7('0x22')](function(_0x50addd){if(_0x50addd){_0x1d0ce0=_0x50addd[_0x1ad7('0x34')];if(!_0x537e61[_0x1ad7('0x2e')][_0x1ad7('0x35')]('nolimit')){_0x9338c2[_0x1ad7('0x1c')]=qs[_0x1ad7('0x1c')](_0x537e61[_0x1ad7('0x2e')]['limit']);_0x9338c2['offset']=qs[_0x1ad7('0x1a')](_0x537e61['query'][_0x1ad7('0x1a')]);}return _0x1004a6['getConfigurations'](_0x9338c2);}})['then'](function(_0x5214b6){if(_0x5214b6){return _0x5214b6?{'count':_0x1d0ce0,'rows':_0x5214b6}:null;}})['then'](respondWithResult(_0x5c6f46,null))[_0x1ad7('0x40')](handleError(_0x5c6f46,null));};exports[_0x1ad7('0x4c')]=function(_0x4ada4e,_0x253b10,_0x523a2d){if(_0x4ada4e[_0x1ad7('0x47')]['id']){delete _0x4ada4e[_0x1ad7('0x47')]['id'];}return db['DeskAccount'][_0x1ad7('0x49')]({'where':{'id':_0x4ada4e[_0x1ad7('0x42')]['id']}})[_0x1ad7('0x22')](handleEntityNotFound(_0x253b10,null))[_0x1ad7('0x22')](function(_0x34d99a){if(_0x34d99a){_0x4ada4e[_0x1ad7('0x47')]['AccountId']=_0x34d99a['id'];_0x4ada4e[_0x1ad7('0x47')][_0x1ad7('0x4d')]=integrations[_0x1ad7('0x4e')](_0x4ada4e['body'][_0x1ad7('0x4f')],_0x4ada4e['body']['type']);_0x4ada4e[_0x1ad7('0x47')][_0x1ad7('0x50')]=integrations[_0x1ad7('0x51')](_0x4ada4e[_0x1ad7('0x47')][_0x1ad7('0x4f')],_0x4ada4e[_0x1ad7('0x47')]['type']);return db[_0x1ad7('0x4a')][_0x1ad7('0x46')](_0x4ada4e['body'],{'include':[{'model':db[_0x1ad7('0x52')],'as':_0x1ad7('0x4d')},{'model':db['DeskField'],'as':_0x1ad7('0x50')}]});}return null;})[_0x1ad7('0x22')](respondWithResult(_0x253b10,null))[_0x1ad7('0x40')](handleError(_0x253b10,null));};exports[_0x1ad7('0x53')]=function(_0x5485de,_0x369a5,_0x1849ba){var _0x4e0ad4=[{'name':_0x1ad7('0x54'),'label':_0x1ad7('0x54'),'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 _0x962512='';return db[_0x1ad7('0x3e')][_0x1ad7('0x49')]({'where':{'id':_0x5485de['params']['id']},'attributes':['id',_0x1ad7('0x55'),_0x1ad7('0x56'),_0x1ad7('0x57'),_0x1ad7('0x58'),_0x1ad7('0x59'),_0x1ad7('0x5a'),_0x1ad7('0x5b'),_0x1ad7('0x5c')]})[_0x1ad7('0x22')](handleEntityNotFound(_0x369a5,null))['then'](function(_0x63130d){if(_0x63130d){_0x962512=_0x63130d[_0x1ad7('0x55')];var _0xc7cb75=_0x962512[_0x1ad7('0x5d')](-0x1);if(_0xc7cb75==='/'){_0x962512=_0x962512['substring'](0x0,_0x962512[_0x1ad7('0x5e')](_0xc7cb75));}var _0x177305={'method':_0x1ad7('0x5f'),'uri':util[_0x1ad7('0x60')](_0x1ad7('0x61'),_0x962512),'headers':{'Content-Type':_0x1ad7('0x62'),'Accept':_0x1ad7('0x62')},'json':!![]};if(_0x63130d[_0x1ad7('0x56')]===_0x1ad7('0x63')){_0x177305['headers']['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x1ad7('0x60')]('%s:%s',_0x63130d[_0x1ad7('0x57')],_0x63130d['password']))[_0x1ad7('0x64')](_0x1ad7('0x65')));}return rp(_0x177305)[_0x1ad7('0x22')](function(_0x2b72be){return _0x4e0ad4[_0x1ad7('0x66')](_[_0x1ad7('0x2d')](_0x2b72be[_0x1ad7('0x67')][_0x1ad7('0x68')],function(_0xea2d96){return{'id':_0xea2d96[_0x1ad7('0x27')],'name':_0xea2d96[_0x1ad7('0x27')],'type':_0xea2d96['type'],'active':_0xea2d96[_0x1ad7('0x69')],'label':_0xea2d96[_0x1ad7('0x6a')],'custom':!![]};}));});}})[_0x1ad7('0x22')](function(_0x10bb0c){return{'count':_0x10bb0c[_0x1ad7('0x34')],'rows':_0x10bb0c};})[_0x1ad7('0x22')](respondWithResult(_0x369a5,null))[_0x1ad7('0x40')](function(_0xf2b043){var _0xcd50c3=_0x5485de[_0x1ad7('0x2e')]['test']?0x1f4:_0xf2b043[_0x1ad7('0x6b')]||0x1f4;logger[_0x1ad7('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x1ad7('0x53'),_0xcd50c3,JSON[_0x1ad7('0x6c')](_0xf2b043));delete _0xf2b043[_0x1ad7('0x27')];if(_0xcd50c3===0x191){_0xcd50c3=0x190;}_0x369a5[_0x1ad7('0x18')](_0xcd50c3)['send'](_0x5485de['query'][_0x1ad7('0x6d')]?{'message':_0x1ad7('0x6e'),'statusCode':_0xf2b043[_0x1ad7('0x6b')]}:_0xf2b043);});}; \ No newline at end of file +var _0x5fd1=['../../config/license/hardware','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','update','body','find','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','password','toString','base64','concat','_embedded','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','../../components/auth/service'];(function(_0x400aac,_0x5cc34d){var _0x55d799=function(_0x12ff49){while(--_0x12ff49){_0x400aac['push'](_0x400aac['shift']());}};_0x55d799(++_0x5cc34d);}(_0x5fd1,0xc6));var _0x15fd=function(_0x8524c0,_0x5af8fd){_0x8524c0=_0x8524c0-0x0;var _0x5d1ea5=_0x5fd1[_0x8524c0];return _0x5d1ea5;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require(_0x15fd('0x1'));var zipdir=require(_0x15fd('0x2'));var jsonpatch=require(_0x15fd('0x3'));var rp=require(_0x15fd('0x4'));var moment=require(_0x15fd('0x5'));var BPromise=require(_0x15fd('0x6'));var Mustache=require(_0x15fd('0x7'));var util=require('util');var path=require(_0x15fd('0x8'));var sox=require(_0x15fd('0x9'));var csv=require(_0x15fd('0xa'));var ejs=require(_0x15fd('0xb'));var fs=require('fs');var fs_extra=require(_0x15fd('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x15fd('0xd'));var deskjs=require(_0x15fd('0xe'));var toCsv=require(_0x15fd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15fd('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x15fd('0x11'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x339147,_0x4e7b58){_0x4e7b58=_0x4e7b58||0xcc;return function(_0x31025a){if(_0x31025a){return _0x339147['sendStatus'](_0x4e7b58);}return _0x339147['status'](_0x4e7b58)[_0x15fd('0x12')]();};}function respondWithResult(_0xc70259,_0x75e7d0){_0x75e7d0=_0x75e7d0||0xc8;return function(_0x1d40ec){if(_0x1d40ec){return _0xc70259[_0x15fd('0x13')](_0x75e7d0)[_0x15fd('0x14')](_0x1d40ec);}};}function respondWithFilteredResult(_0x1944d3,_0x33a8e9){return function(_0x1607ef){if(_0x1607ef){var _0x518c14=typeof _0x33a8e9[_0x15fd('0x15')]===_0x15fd('0x16')&&typeof _0x33a8e9[_0x15fd('0x17')]===_0x15fd('0x16');var _0x43ffac=_0x1607ef[_0x15fd('0x18')];var _0xa94883=_0x518c14?0x0:_0x33a8e9[_0x15fd('0x15')];var _0x31bfee=_0x518c14?_0x1607ef['count']:_0x33a8e9[_0x15fd('0x15')]+_0x33a8e9[_0x15fd('0x17')];var _0x4c3087;if(_0x31bfee>=_0x43ffac){_0x31bfee=_0x43ffac;_0x4c3087=0xc8;}else{_0x4c3087=0xce;}_0x1944d3[_0x15fd('0x13')](_0x4c3087);return _0x1944d3[_0x15fd('0x19')](_0x15fd('0x1a'),_0xa94883+'-'+_0x31bfee+'/'+_0x43ffac)[_0x15fd('0x14')](_0x1607ef);}return null;};}function patchUpdates(_0x16f2d0){return function(_0x21fb5c){try{jsonpatch[_0x15fd('0x1b')](_0x21fb5c,_0x16f2d0,!![]);}catch(_0x460145){return BPromise[_0x15fd('0x1c')](_0x460145);}return _0x21fb5c[_0x15fd('0x1d')]();};}function saveUpdates(_0x3fe993,_0x2b0f92){return function(_0x260a74){if(_0x260a74){return _0x260a74['update'](_0x3fe993)['then'](function(_0x41866c){return _0x41866c;});}return null;};}function removeEntity(_0x590e4e,_0x23b3ab){return function(_0xb9f735){if(_0xb9f735){return _0xb9f735[_0x15fd('0x1e')]()[_0x15fd('0x1f')](function(){_0x590e4e[_0x15fd('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2f53,_0x1dea51){return function(_0x11f957){if(!_0x11f957){_0x4b2f53[_0x15fd('0x20')](0x194);}return _0x11f957;};}function handleError(_0x9dcb95,_0x508d59){_0x508d59=_0x508d59||0x1f4;return function(_0x24ad85){logger[_0x15fd('0x21')](_0x24ad85['stack']);if(_0x24ad85[_0x15fd('0x22')]){delete _0x24ad85[_0x15fd('0x22')];}_0x9dcb95[_0x15fd('0x13')](_0x508d59)[_0x15fd('0x23')](_0x24ad85);};}exports[_0x15fd('0x24')]=function(_0x37d638,_0x80418e){var _0x35d52c={},_0x3a91ba={},_0x27209b={'count':0x0,'rows':[]};var _0x54b705=_[_0x15fd('0x25')](db[_0x15fd('0x26')]['rawAttributes'],function(_0x1fb2f7){return{'name':_0x1fb2f7[_0x15fd('0x27')],'type':_0x1fb2f7[_0x15fd('0x28')][_0x15fd('0x29')]};});_0x3a91ba[_0x15fd('0x2a')]=_[_0x15fd('0x25')](_0x54b705,_0x15fd('0x22'));_0x3a91ba[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x37d638[_0x15fd('0x2b')]);_0x3a91ba[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x3a91ba['model'],_0x3a91ba[_0x15fd('0x2b')]);_0x35d52c[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x3a91ba[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x37d638[_0x15fd('0x2b')][_0x15fd('0x30')]));_0x35d52c[_0x15fd('0x2f')]=_0x35d52c[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x35d52c[_0x15fd('0x2f')]:_0x3a91ba[_0x15fd('0x2a')];if(!_0x37d638[_0x15fd('0x2b')][_0x15fd('0x32')](_0x15fd('0x33'))){_0x35d52c[_0x15fd('0x17')]=qs[_0x15fd('0x17')](_0x37d638[_0x15fd('0x2b')]['limit']);_0x35d52c[_0x15fd('0x15')]=qs[_0x15fd('0x15')](_0x37d638[_0x15fd('0x2b')][_0x15fd('0x15')]);}_0x35d52c[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x37d638[_0x15fd('0x2b')]['sort']);_0x35d52c[_0x15fd('0x36')]=qs[_0x15fd('0x2d')](_['pick'](_0x37d638[_0x15fd('0x2b')],_0x3a91ba['filters']),_0x54b705);if(_0x37d638[_0x15fd('0x2b')]['filter']){_0x35d52c['where']=_[_0x15fd('0x37')](_0x35d52c[_0x15fd('0x36')],{'$or':_[_0x15fd('0x25')](_0x54b705,function(_0x5dca52){if(_0x5dca52[_0x15fd('0x28')]!=='VIRTUAL'){var _0x43e368={};_0x43e368[_0x5dca52[_0x15fd('0x22')]]={'$like':'%'+_0x37d638[_0x15fd('0x2b')][_0x15fd('0x38')]+'%'};return _0x43e368;}})});}_0x35d52c=_[_0x15fd('0x37')]({},_0x35d52c,_0x37d638[_0x15fd('0x39')]);var _0x141a7c={'where':_0x35d52c['where']};return db[_0x15fd('0x26')]['count'](_0x141a7c)[_0x15fd('0x1f')](function(_0x171e55){_0x27209b[_0x15fd('0x18')]=_0x171e55;if(_0x37d638['query']['includeAll']){_0x35d52c[_0x15fd('0x3a')]=[{'all':!![]}];}return db[_0x15fd('0x26')][_0x15fd('0x3b')](_0x35d52c);})['then'](function(_0x14b1f0){_0x27209b[_0x15fd('0x3c')]=_0x14b1f0;return _0x27209b;})['then'](respondWithFilteredResult(_0x80418e,_0x35d52c))[_0x15fd('0x3d')](handleError(_0x80418e,null));};exports[_0x15fd('0x3e')]=function(_0x57b0fb,_0xe6de34){var _0x1d9b33={'raw':![],'where':{'id':_0x57b0fb[_0x15fd('0x3f')]['id']}},_0x1a6a5c={};_0x1a6a5c[_0x15fd('0x2a')]=_[_0x15fd('0x2c')](db[_0x15fd('0x26')][_0x15fd('0x40')]);_0x1a6a5c[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x57b0fb['query']);_0x1a6a5c[_0x15fd('0x2d')]=_['intersection'](_0x1a6a5c[_0x15fd('0x2a')],_0x1a6a5c['query']);_0x1d9b33['attributes']=_[_0x15fd('0x2e')](_0x1a6a5c['model'],qs[_0x15fd('0x30')](_0x57b0fb[_0x15fd('0x2b')][_0x15fd('0x30')]));_0x1d9b33['attributes']=_0x1d9b33['attributes'][_0x15fd('0x31')]?_0x1d9b33[_0x15fd('0x2f')]:_0x1a6a5c['model'];if(_0x57b0fb[_0x15fd('0x2b')][_0x15fd('0x41')]){_0x1d9b33[_0x15fd('0x3a')]=[{'all':!![]}];}_0x1d9b33=_[_0x15fd('0x37')]({},_0x1d9b33,_0x57b0fb[_0x15fd('0x39')]);return db['DeskAccount']['find'](_0x1d9b33)['then'](handleEntityNotFound(_0xe6de34,null))[_0x15fd('0x1f')](respondWithResult(_0xe6de34,null))['catch'](handleError(_0xe6de34,null));};exports['create']=function(_0x4ad1bf,_0x123e7b){return db['DeskAccount'][_0x15fd('0x42')](_0x4ad1bf['body'],{})[_0x15fd('0x1f')](respondWithResult(_0x123e7b,0xc9))['catch'](handleError(_0x123e7b,null));};exports[_0x15fd('0x43')]=function(_0x2cf2c6,_0x323d83){if(_0x2cf2c6[_0x15fd('0x44')]['id']){delete _0x2cf2c6['body']['id'];}return db[_0x15fd('0x26')]['find']({'where':{'id':_0x2cf2c6[_0x15fd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x323d83,null))[_0x15fd('0x1f')](saveUpdates(_0x2cf2c6[_0x15fd('0x44')],null))['then'](respondWithResult(_0x323d83,null))[_0x15fd('0x3d')](handleError(_0x323d83,null));};exports[_0x15fd('0x1e')]=function(_0x3538e9,_0x5036b6){return db[_0x15fd('0x26')][_0x15fd('0x45')]({'where':{'id':_0x3538e9[_0x15fd('0x3f')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x5036b6,null))[_0x15fd('0x1f')](removeEntity(_0x5036b6,null))['catch'](handleError(_0x5036b6,null));};exports[_0x15fd('0x46')]=function(_0x2c053c,_0x542466,_0x1ad7f5){var _0x552730={};var _0x1d5699={};var _0x2694eb;var _0x331084;return db[_0x15fd('0x26')][_0x15fd('0x47')]({'where':{'id':_0x2c053c[_0x15fd('0x3f')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x542466,null))['then'](function(_0x1f5bf7){if(_0x1f5bf7){_0x2694eb=_0x1f5bf7;_0x1d5699[_0x15fd('0x2a')]=_[_0x15fd('0x2c')](db['DeskConfiguration'][_0x15fd('0x40')]);_0x1d5699[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x2c053c[_0x15fd('0x2b')]);_0x1d5699['filters']=_[_0x15fd('0x2e')](_0x1d5699[_0x15fd('0x2a')],_0x1d5699[_0x15fd('0x2b')]);_0x552730[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x1d5699[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x2c053c[_0x15fd('0x2b')][_0x15fd('0x30')]));_0x552730[_0x15fd('0x2f')]=_0x552730[_0x15fd('0x2f')]['length']?_0x552730['attributes']:_0x1d5699[_0x15fd('0x2a')];_0x552730['order']=qs[_0x15fd('0x35')](_0x2c053c[_0x15fd('0x2b')][_0x15fd('0x35')]);_0x552730[_0x15fd('0x36')]=qs[_0x15fd('0x2d')](_[_0x15fd('0x48')](_0x2c053c['query'],_0x1d5699[_0x15fd('0x2d')]));if(_0x2c053c[_0x15fd('0x2b')][_0x15fd('0x38')]){_0x552730['where']=_[_0x15fd('0x37')](_0x552730['where'],{'$or':_['map'](_0x552730[_0x15fd('0x2f')],function(_0x45393f){var _0x52da6={};_0x52da6[_0x45393f]={'$like':'%'+_0x2c053c[_0x15fd('0x2b')]['filter']+'%'};return _0x52da6;})});}_0x552730=_[_0x15fd('0x37')]({},_0x552730,_0x2c053c[_0x15fd('0x39')]);return _0x2694eb[_0x15fd('0x46')](_0x552730);}})['then'](function(_0x19d7a4){if(_0x19d7a4){_0x331084=_0x19d7a4['length'];if(!_0x2c053c[_0x15fd('0x2b')]['hasOwnProperty']('nolimit')){_0x552730[_0x15fd('0x17')]=qs[_0x15fd('0x17')](_0x2c053c[_0x15fd('0x2b')][_0x15fd('0x17')]);_0x552730[_0x15fd('0x15')]=qs['offset'](_0x2c053c[_0x15fd('0x2b')][_0x15fd('0x15')]);}return _0x2694eb[_0x15fd('0x46')](_0x552730);}})[_0x15fd('0x1f')](function(_0x4ec305){if(_0x4ec305){return _0x4ec305?{'count':_0x331084,'rows':_0x4ec305}:null;}})[_0x15fd('0x1f')](respondWithResult(_0x542466,null))[_0x15fd('0x3d')](handleError(_0x542466,null));};exports[_0x15fd('0x49')]=function(_0x5567ed,_0x8f618e,_0x2d09c7){if(_0x5567ed[_0x15fd('0x44')]['id']){delete _0x5567ed[_0x15fd('0x44')]['id'];}return db[_0x15fd('0x26')][_0x15fd('0x47')]({'where':{'id':_0x5567ed['params']['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x8f618e,null))['then'](function(_0xbd1f6e){if(_0xbd1f6e){_0x5567ed[_0x15fd('0x44')][_0x15fd('0x4a')]=_0xbd1f6e['id'];_0x5567ed[_0x15fd('0x44')][_0x15fd('0x4b')]=integrations[_0x15fd('0x4c')](_0x5567ed[_0x15fd('0x44')]['channel'],_0x5567ed[_0x15fd('0x44')][_0x15fd('0x28')]);_0x5567ed[_0x15fd('0x44')][_0x15fd('0x4d')]=integrations['getDescriptions'](_0x5567ed[_0x15fd('0x44')]['channel'],_0x5567ed['body'][_0x15fd('0x28')]);return db[_0x15fd('0x4e')][_0x15fd('0x42')](_0x5567ed[_0x15fd('0x44')],{'include':[{'model':db[_0x15fd('0x4f')],'as':_0x15fd('0x4b')},{'model':db[_0x15fd('0x4f')],'as':_0x15fd('0x4d')}]});}return null;})[_0x15fd('0x1f')](respondWithResult(_0x8f618e,null))['catch'](handleError(_0x8f618e,null));};exports[_0x15fd('0x50')]=function(_0x2770cb,_0x47b304,_0x483309){var _0x17ea58=[{'name':_0x15fd('0x51'),'label':_0x15fd('0x51'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x9396ca='';return db[_0x15fd('0x26')][_0x15fd('0x47')]({'where':{'id':_0x2770cb[_0x15fd('0x3f')]['id']},'attributes':['id',_0x15fd('0x52'),_0x15fd('0x53'),_0x15fd('0x54'),'password',_0x15fd('0x55'),'consumerSecret',_0x15fd('0x56'),_0x15fd('0x57')]})[_0x15fd('0x1f')](handleEntityNotFound(_0x47b304,null))[_0x15fd('0x1f')](function(_0x756499){if(_0x756499){_0x9396ca=_0x756499[_0x15fd('0x52')];var _0x5a7900=_0x9396ca[_0x15fd('0x58')](-0x1);if(_0x5a7900==='/'){_0x9396ca=_0x9396ca['substring'](0x0,_0x9396ca[_0x15fd('0x59')](_0x5a7900));}var _0x16c27f={'method':_0x15fd('0x5a'),'uri':util[_0x15fd('0x5b')](_0x15fd('0x5c'),_0x9396ca),'headers':{'Content-Type':_0x15fd('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x756499[_0x15fd('0x53')]===_0x15fd('0x5e')){_0x16c27f[_0x15fd('0x5f')]['Authorization']=util[_0x15fd('0x5b')](_0x15fd('0x60'),new Buffer(util[_0x15fd('0x5b')]('%s:%s',_0x756499['username'],_0x756499[_0x15fd('0x61')]))[_0x15fd('0x62')](_0x15fd('0x63')));}return rp(_0x16c27f)[_0x15fd('0x1f')](function(_0x5b83f0){return _0x17ea58[_0x15fd('0x64')](_[_0x15fd('0x25')](_0x5b83f0[_0x15fd('0x65')]['entries'],function(_0x5e899c){return{'id':_0x5e899c[_0x15fd('0x22')],'name':_0x5e899c[_0x15fd('0x22')],'type':_0x5e899c[_0x15fd('0x28')],'active':_0x5e899c['active'],'label':_0x5e899c[_0x15fd('0x66')],'custom':!![]};}));});}})[_0x15fd('0x1f')](function(_0x136696){return{'count':_0x136696[_0x15fd('0x31')],'rows':_0x136696};})[_0x15fd('0x1f')](respondWithResult(_0x47b304,null))[_0x15fd('0x3d')](function(_0x32da48){var _0x444176=_0x2770cb['query']['test']?0x1f4:_0x32da48[_0x15fd('0x67')]||0x1f4;logger[_0x15fd('0x21')](_0x15fd('0x68'),'getFields',_0x444176,JSON[_0x15fd('0x69')](_0x32da48));delete _0x32da48['name'];if(_0x444176===0x191){_0x444176=0x190;}_0x47b304[_0x15fd('0x13')](_0x444176)[_0x15fd('0x23')](_0x2770cb[_0x15fd('0x2b')]['test']?{'message':_0x15fd('0x6a'),'statusCode':_0x32da48[_0x15fd('0x67')]}:_0x32da48);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index a9ae2dd..c802c87 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 _0xfaaa=['util','../../config/logger','moment','path','exports','define','lodash'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xfaaa,0x117));var _0xafaa=function(_0x54cb33,_0x32bb2e){_0x54cb33=_0x54cb33-0x0;var _0xa11864=_0xfaaa[_0x54cb33];return _0xa11864;};'use strict';var _=require(_0xafaa('0x0'));var util=require(_0xafaa('0x1'));var logger=require(_0xafaa('0x2'))('api');var moment=require(_0xafaa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xafaa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xafaa('0x5')]=function(_0x48b7b0,_0x50d4e3){return _0x48b7b0[_0xafaa('0x6')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcff=['moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbcff,0x172));var _0xfbcf=function(_0x2b349c,_0x246811){_0x2b349c=_0x2b349c-0x0;var _0x937c84=_0xbcff[_0x2b349c];return _0x937c84;};'use strict';var _=require('lodash');var util=require(_0xfbcf('0x0'));var logger=require('../../config/logger')(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require(_0xfbcf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbcf('0x4'));var rimraf=require(_0xfbcf('0x5'));var config=require(_0xfbcf('0x6'));var attributes=require(_0xfbcf('0x7'));var integrations=require(_0xfbcf('0x8'));module[_0xfbcf('0x9')]=function(_0x5a8158,_0x29b6c8){return _0x5a8158['define'](_0xfbcf('0xa'),attributes,{'tableName':_0xfbcf('0xb'),'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 755f01c..7446c71 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 _0x5a8c=['find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','DeskAccount','findAll','options','where','include','map','model','attributes','GetDeskAccount','ShowDeskAccount'];(function(_0x16acc6,_0x3dd9ae){var _0x2970f1=function(_0x40e0ad){while(--_0x40e0ad){_0x16acc6['push'](_0x16acc6['shift']());}};_0x2970f1(++_0x3dd9ae);}(_0x5a8c,0x86));var _0xc5a8=function(_0x3edd2d,_0x91dcb2){_0x3edd2d=_0x3edd2d-0x0;var _0x4e5484=_0x5a8c[_0x3edd2d];return _0x4e5484;};'use strict';var _=require(_0xc5a8('0x0'));var util=require('util');var moment=require(_0xc5a8('0x1'));var BPromise=require(_0xc5a8('0x2'));var rs=require(_0xc5a8('0x3'));var fs=require('fs');var Redis=require(_0xc5a8('0x4'));var db=require(_0xc5a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5a8('0x6'));var config=require(_0xc5a8('0x7'));var jayson=require(_0xc5a8('0x8'));var client=jayson[_0xc5a8('0x9')][_0xc5a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49b109,_0x776644,_0x4f8b00){return new BPromise(function(_0x326d47,_0x298408){return client['request'](_0x49b109,_0x4f8b00)[_0xc5a8('0xb')](function(_0x20ed8e){logger['info'](_0xc5a8('0xc'),_0x776644,_0xc5a8('0xd'));logger[_0xc5a8('0xe')](_0xc5a8('0xf'),_0x776644,_0xc5a8('0xd'),JSON[_0xc5a8('0x10')](_0x20ed8e));if(_0x20ed8e[_0xc5a8('0x11')]){if(_0x20ed8e[_0xc5a8('0x11')]['code']===0x1f4){logger[_0xc5a8('0x11')]('DeskAccount,\x20%s,\x20%s',_0x776644,_0x20ed8e[_0xc5a8('0x11')]['message']);return _0x298408(_0x20ed8e['error'][_0xc5a8('0x12')]);}logger[_0xc5a8('0x11')](_0xc5a8('0xc'),_0x776644,_0x20ed8e[_0xc5a8('0x11')][_0xc5a8('0x12')]);return _0x326d47(_0x20ed8e[_0xc5a8('0x11')]['message']);}else{logger['info'](_0xc5a8('0xc'),_0x776644,_0xc5a8('0xd'));_0x326d47(_0x20ed8e[_0xc5a8('0x13')][_0xc5a8('0x12')]);}})[_0xc5a8('0x14')](function(_0x127567){logger[_0xc5a8('0x11')](_0xc5a8('0xc'),_0x776644,_0x127567);_0x298408(_0x127567);});});}exports['GetDeskAccount']=function(_0x225cff){var _0x1d83a8=this;return new Promise(function(_0x2df3ad,_0x50c428){return db[_0xc5a8('0x15')][_0xc5a8('0x16')]({'raw':_0x225cff[_0xc5a8('0x17')]?_0x225cff[_0xc5a8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x225cff['options']?_0x225cff[_0xc5a8('0x17')][_0xc5a8('0x18')]||null:null,'attributes':_0x225cff[_0xc5a8('0x17')]?_0x225cff[_0xc5a8('0x17')]['attributes']||null:null,'limit':_0x225cff[_0xc5a8('0x17')]?_0x225cff['options']['limit']||null:null,'include':_0x225cff[_0xc5a8('0x17')]?_0x225cff[_0xc5a8('0x17')][_0xc5a8('0x19')]?_[_0xc5a8('0x1a')](_0x225cff[_0xc5a8('0x17')]['include'],function(_0x177f91){return{'model':db[_0x177f91[_0xc5a8('0x1b')]],'as':_0x177f91['as'],'attributes':_0x177f91['attributes'],'include':_0x177f91[_0xc5a8('0x19')]?_[_0xc5a8('0x1a')](_0x177f91[_0xc5a8('0x19')],function(_0x382b7e){return{'model':db[_0x382b7e[_0xc5a8('0x1b')]],'as':_0x382b7e['as'],'attributes':_0x382b7e[_0xc5a8('0x1c')],'include':_0x382b7e[_0xc5a8('0x19')]?_[_0xc5a8('0x1a')](_0x382b7e[_0xc5a8('0x19')],function(_0x54fbeb){return{'model':db[_0x54fbeb[_0xc5a8('0x1b')]],'as':_0x54fbeb['as'],'attributes':_0x54fbeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5a8('0xb')](function(_0x5590d2){logger['info']('GetDeskAccount',_0x225cff);logger['debug'](_0xc5a8('0x1d'),_0x225cff,JSON['stringify'](_0x5590d2));_0x2df3ad(_0x5590d2);})[_0xc5a8('0x14')](function(_0x33e973){logger['error'](_0xc5a8('0x1d'),_0x33e973[_0xc5a8('0x12')],_0x225cff);_0x50c428(_0x1d83a8['error'](0x1f4,_0x33e973[_0xc5a8('0x12')]));});});};exports[_0xc5a8('0x1e')]=function(_0x373460){var _0x17bc5a=this;return new Promise(function(_0xecb92c,_0x21f508){return db[_0xc5a8('0x15')][_0xc5a8('0x1f')]({'raw':_0x373460[_0xc5a8('0x17')]?_0x373460[_0xc5a8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x373460[_0xc5a8('0x17')]?_0x373460[_0xc5a8('0x17')]['where']||null:null,'attributes':_0x373460['options']?_0x373460['options']['attributes']||null:null,'include':_0x373460[_0xc5a8('0x17')]?_0x373460[_0xc5a8('0x17')][_0xc5a8('0x19')]?_[_0xc5a8('0x1a')](_0x373460[_0xc5a8('0x17')]['include'],function(_0x4b2c7a){return{'model':db[_0x4b2c7a[_0xc5a8('0x1b')]],'as':_0x4b2c7a['as'],'attributes':_0x4b2c7a[_0xc5a8('0x1c')],'include':_0x4b2c7a[_0xc5a8('0x19')]?_[_0xc5a8('0x1a')](_0x4b2c7a[_0xc5a8('0x19')],function(_0x448c61){return{'model':db[_0x448c61[_0xc5a8('0x1b')]],'as':_0x448c61['as'],'attributes':_0x448c61[_0xc5a8('0x1c')],'include':_0x448c61[_0xc5a8('0x19')]?_['map'](_0x448c61['include'],function(_0x1fd7f7){return{'model':db[_0x1fd7f7[_0xc5a8('0x1b')]],'as':_0x1fd7f7['as'],'attributes':_0x1fd7f7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5a8('0xb')](function(_0x1a9671){logger[_0xc5a8('0x20')]('ShowDeskAccount',_0x373460);logger[_0xc5a8('0xe')](_0xc5a8('0x1e'),_0x373460,JSON[_0xc5a8('0x10')](_0x1a9671));_0xecb92c(_0x1a9671);})['catch'](function(_0x2ee19f){logger[_0xc5a8('0x11')](_0xc5a8('0x1e'),_0x2ee19f['message'],_0x373460);_0x21f508(_0x17bc5a[_0xc5a8('0x11')](0x1f4,_0x2ee19f['message']));});});}; \ No newline at end of file +var _0x3630=['request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','DeskAccount','findAll','options','raw','attributes','limit','include','model','map','GetDeskAccount','ShowDeskAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3630,0x66));var _0x0363=function(_0x37933c,_0x49c84d){_0x37933c=_0x37933c-0x0;var _0x6fc619=_0x3630[_0x37933c];return _0x6fc619;};'use strict';var _=require(_0x0363('0x0'));var util=require('util');var moment=require(_0x0363('0x1'));var BPromise=require(_0x0363('0x2'));var rs=require(_0x0363('0x3'));var fs=require('fs');var Redis=require(_0x0363('0x4'));var db=require(_0x0363('0x5'))['db'];var utils=require(_0x0363('0x6'));var logger=require(_0x0363('0x7'))(_0x0363('0x8'));var config=require(_0x0363('0x9'));var jayson=require(_0x0363('0xa'));var client=jayson['client'][_0x0363('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10e424,_0xe82a5c,_0x22b98d){return new BPromise(function(_0x2587c7,_0x4ed0cd){return client[_0x0363('0xc')](_0x10e424,_0x22b98d)[_0x0363('0xd')](function(_0x406ae8){logger['info'](_0x0363('0xe'),_0xe82a5c,_0x0363('0xf'));logger[_0x0363('0x10')](_0x0363('0x11'),_0xe82a5c,_0x0363('0xf'),JSON[_0x0363('0x12')](_0x406ae8));if(_0x406ae8['error']){if(_0x406ae8['error'][_0x0363('0x13')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0xe82a5c,_0x406ae8['error'][_0x0363('0x14')]);return _0x4ed0cd(_0x406ae8[_0x0363('0x15')][_0x0363('0x14')]);}logger[_0x0363('0x15')](_0x0363('0xe'),_0xe82a5c,_0x406ae8['error'][_0x0363('0x14')]);return _0x2587c7(_0x406ae8['error'][_0x0363('0x14')]);}else{logger[_0x0363('0x16')]('DeskAccount,\x20%s,\x20%s',_0xe82a5c,_0x0363('0xf'));_0x2587c7(_0x406ae8[_0x0363('0x17')]['message']);}})[_0x0363('0x18')](function(_0x384339){logger[_0x0363('0x15')](_0x0363('0xe'),_0xe82a5c,_0x384339);_0x4ed0cd(_0x384339);});});}exports['GetDeskAccount']=function(_0x45c427){var _0x4dc8f2=this;return new Promise(function(_0x429cb8,_0x1768f){return db[_0x0363('0x19')][_0x0363('0x1a')]({'raw':_0x45c427[_0x0363('0x1b')]?_0x45c427['options'][_0x0363('0x1c')]===undefined?!![]:![]:!![],'where':_0x45c427[_0x0363('0x1b')]?_0x45c427['options']['where']||null:null,'attributes':_0x45c427[_0x0363('0x1b')]?_0x45c427[_0x0363('0x1b')][_0x0363('0x1d')]||null:null,'limit':_0x45c427[_0x0363('0x1b')]?_0x45c427[_0x0363('0x1b')][_0x0363('0x1e')]||null:null,'include':_0x45c427['options']?_0x45c427[_0x0363('0x1b')][_0x0363('0x1f')]?_['map'](_0x45c427[_0x0363('0x1b')][_0x0363('0x1f')],function(_0x52a8ba){return{'model':db[_0x52a8ba[_0x0363('0x20')]],'as':_0x52a8ba['as'],'attributes':_0x52a8ba['attributes'],'include':_0x52a8ba[_0x0363('0x1f')]?_[_0x0363('0x21')](_0x52a8ba[_0x0363('0x1f')],function(_0x1108d9){return{'model':db[_0x1108d9[_0x0363('0x20')]],'as':_0x1108d9['as'],'attributes':_0x1108d9[_0x0363('0x1d')],'include':_0x1108d9[_0x0363('0x1f')]?_[_0x0363('0x21')](_0x1108d9[_0x0363('0x1f')],function(_0x2a2950){return{'model':db[_0x2a2950['model']],'as':_0x2a2950['as'],'attributes':_0x2a2950[_0x0363('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0363('0xd')](function(_0x13bf7e){logger[_0x0363('0x16')](_0x0363('0x22'),_0x45c427);logger['debug'](_0x0363('0x22'),_0x45c427,JSON[_0x0363('0x12')](_0x13bf7e));_0x429cb8(_0x13bf7e);})[_0x0363('0x18')](function(_0x3affc3){logger[_0x0363('0x15')](_0x0363('0x22'),_0x3affc3[_0x0363('0x14')],_0x45c427);_0x1768f(_0x4dc8f2[_0x0363('0x15')](0x1f4,_0x3affc3[_0x0363('0x14')]));});});};exports[_0x0363('0x23')]=function(_0x1da3e7){var _0x484a25=this;return new Promise(function(_0x5c3d16,_0x5741eb){return db[_0x0363('0x19')][_0x0363('0x24')]({'raw':_0x1da3e7['options']?_0x1da3e7[_0x0363('0x1b')][_0x0363('0x1c')]===undefined?!![]:![]:!![],'where':_0x1da3e7[_0x0363('0x1b')]?_0x1da3e7['options'][_0x0363('0x25')]||null:null,'attributes':_0x1da3e7['options']?_0x1da3e7['options']['attributes']||null:null,'include':_0x1da3e7[_0x0363('0x1b')]?_0x1da3e7[_0x0363('0x1b')][_0x0363('0x1f')]?_['map'](_0x1da3e7[_0x0363('0x1b')][_0x0363('0x1f')],function(_0x1a1d24){return{'model':db[_0x1a1d24[_0x0363('0x20')]],'as':_0x1a1d24['as'],'attributes':_0x1a1d24[_0x0363('0x1d')],'include':_0x1a1d24[_0x0363('0x1f')]?_['map'](_0x1a1d24[_0x0363('0x1f')],function(_0x36ef60){return{'model':db[_0x36ef60[_0x0363('0x20')]],'as':_0x36ef60['as'],'attributes':_0x36ef60['attributes'],'include':_0x36ef60[_0x0363('0x1f')]?_[_0x0363('0x21')](_0x36ef60[_0x0363('0x1f')],function(_0x162eff){return{'model':db[_0x162eff[_0x0363('0x20')]],'as':_0x162eff['as'],'attributes':_0x162eff[_0x0363('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d63a6){logger['info']('ShowDeskAccount',_0x1da3e7);logger['debug'](_0x0363('0x23'),_0x1da3e7,JSON[_0x0363('0x12')](_0x2d63a6));_0x5c3d16(_0x2d63a6);})[_0x0363('0x18')](function(_0x4247e8){logger['error'](_0x0363('0x23'),_0x4247e8[_0x0363('0x14')],_0x1da3e7);_0x5741eb(_0x484a25[_0x0363('0x15')](0x1f4,_0x4247e8[_0x0363('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 55c7b1f..401cd82 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 _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(_0x43bf13,_0x2267d6){var _0x251a26=function(_0x5f3e61){while(--_0x5f3e61){_0x43bf13['push'](_0x43bf13['shift']());}};_0x251a26(++_0x2267d6);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'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 +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(_0x4c3cd8,_0x3cf4d){var _0x342680=function(_0x33e79b){while(--_0x33e79b){_0x4c3cd8['push'](_0x4c3cd8['shift']());}};_0x342680(++_0x3cf4d);}(_0x7217,0x19e));var _0x7721=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x7217[_0x29b609];return _0x54c952;};'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 01541f5..5b76ecb 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 _0x0609=['exports','STRING'];(function(_0x1866c6,_0x540e49){var _0x390d15=function(_0x299945){while(--_0x299945){_0x1866c6['push'](_0x1866c6['shift']());}};_0x390d15(++_0x540e49);}(_0x0609,0x7c));var _0x9060=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0609[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x9060('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9060('0x1')]}}; \ No newline at end of file +var _0x6a25=['exports','STRING','sequelize'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0x6a25,0x110));var _0x56a2=function(_0x2259ea,_0x3326bc){_0x2259ea=_0x2259ea-0x0;var _0x83e551=_0x6a25[_0x2259ea];return _0x83e551;};'use strict';var Sequelize=require(_0x56a2('0x0'));module[_0x56a2('0x1')]={'name':{'type':Sequelize[_0x56a2('0x2')]},'description':{'type':Sequelize[_0x56a2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 25e152b..6d69ecb 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 _0x865e=['pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','filters','includeAll','find','body','update','getFields','DeskField','order','nolimit','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../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','apply','reject','save','destroy','then','end','error','stack','name','send','index','DeskConfiguration','fieldName','type','key','map','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','sort','where'];(function(_0x2d3f17,_0x4791e3){var _0x4703f7=function(_0x35b01c){while(--_0x35b01c){_0x2d3f17['push'](_0x2d3f17['shift']());}};_0x4703f7(++_0x4791e3);}(_0x865e,0x6d));var _0xe865=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x865e[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0xe865('0x0'));var rimraf=require(_0xe865('0x1'));var zipdir=require(_0xe865('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe865('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe865('0x4'));var util=require(_0xe865('0x5'));var path=require(_0xe865('0x6'));var sox=require(_0xe865('0x7'));var csv=require(_0xe865('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe865('0x9'));var _=require(_0xe865('0xa'));var squel=require(_0xe865('0xb'));var crypto=require(_0xe865('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe865('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe865('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe865('0xf'));var qs=require(_0xe865('0x10'));var as=require(_0xe865('0x11'));var hardwareService=require(_0xe865('0x12'));var logger=require(_0xe865('0x13'))(_0xe865('0x14'));var utils=require(_0xe865('0x15'));var config=require(_0xe865('0x16'));var licenseUtil=require(_0xe865('0x17'));var db=require(_0xe865('0x18'))['db'];function respondWithStatusCode(_0x57867f,_0x10c10a){_0x10c10a=_0x10c10a||0xcc;return function(_0x4feca6){if(_0x4feca6){return _0x57867f[_0xe865('0x19')](_0x10c10a);}return _0x57867f[_0xe865('0x1a')](_0x10c10a)['end']();};}function respondWithResult(_0x3c5866,_0x3b5bef){_0x3b5bef=_0x3b5bef||0xc8;return function(_0x11109b){if(_0x11109b){return _0x3c5866[_0xe865('0x1a')](_0x3b5bef)[_0xe865('0x1b')](_0x11109b);}};}function respondWithFilteredResult(_0x2dc482,_0x208363){return function(_0x309fc6){if(_0x309fc6){var _0x52db17=typeof _0x208363[_0xe865('0x1c')]==='undefined'&&typeof _0x208363[_0xe865('0x1d')]===_0xe865('0x1e');var _0xd6574e=_0x309fc6[_0xe865('0x1f')];var _0xe1894f=_0x52db17?0x0:_0x208363[_0xe865('0x1c')];var _0x1fd73e=_0x52db17?_0x309fc6[_0xe865('0x1f')]:_0x208363[_0xe865('0x1c')]+_0x208363['limit'];var _0x4998e3;if(_0x1fd73e>=_0xd6574e){_0x1fd73e=_0xd6574e;_0x4998e3=0xc8;}else{_0x4998e3=0xce;}_0x2dc482[_0xe865('0x1a')](_0x4998e3);return _0x2dc482[_0xe865('0x20')]('Content-Range',_0xe1894f+'-'+_0x1fd73e+'/'+_0xd6574e)['json'](_0x309fc6);}return null;};}function patchUpdates(_0x214cdf){return function(_0x838e1a){try{jsonpatch[_0xe865('0x21')](_0x838e1a,_0x214cdf,!![]);}catch(_0x6fd30){return BPromise[_0xe865('0x22')](_0x6fd30);}return _0x838e1a[_0xe865('0x23')]();};}function saveUpdates(_0x2ff6c2,_0x50b653){return function(_0xc41716){if(_0xc41716){return _0xc41716['update'](_0x2ff6c2)['then'](function(_0x258932){return _0x258932;});}return null;};}function removeEntity(_0x2bb312,_0x36d188){return function(_0x13d886){if(_0x13d886){return _0x13d886[_0xe865('0x24')]()[_0xe865('0x25')](function(){_0x2bb312['status'](0xcc)[_0xe865('0x26')]();});}};}function handleEntityNotFound(_0x1bf01e,_0x46e47f){return function(_0x180214){if(!_0x180214){_0x1bf01e['sendStatus'](0x194);}return _0x180214;};}function handleError(_0x1cd52c,_0x449db1){_0x449db1=_0x449db1||0x1f4;return function(_0x552783){logger[_0xe865('0x27')](_0x552783[_0xe865('0x28')]);if(_0x552783['name']){delete _0x552783[_0xe865('0x29')];}_0x1cd52c[_0xe865('0x1a')](_0x449db1)[_0xe865('0x2a')](_0x552783);};}exports[_0xe865('0x2b')]=function(_0x3f74a5,_0x25e8ec){var _0x5dc9ef={},_0x101dae={},_0x8b9545={'count':0x0,'rows':[]};var _0xdb0c0d=_['map'](db[_0xe865('0x2c')]['rawAttributes'],function(_0x338530){return{'name':_0x338530[_0xe865('0x2d')],'type':_0x338530[_0xe865('0x2e')][_0xe865('0x2f')]};});_0x101dae['model']=_[_0xe865('0x30')](_0xdb0c0d,_0xe865('0x29'));_0x101dae['query']=_[_0xe865('0x31')](_0x3f74a5[_0xe865('0x32')]);_0x101dae['filters']=_[_0xe865('0x33')](_0x101dae['model'],_0x101dae[_0xe865('0x32')]);_0x5dc9ef[_0xe865('0x34')]=_[_0xe865('0x33')](_0x101dae['model'],qs[_0xe865('0x35')](_0x3f74a5[_0xe865('0x32')][_0xe865('0x35')]));_0x5dc9ef[_0xe865('0x34')]=_0x5dc9ef['attributes'][_0xe865('0x36')]?_0x5dc9ef['attributes']:_0x101dae[_0xe865('0x37')];if(!_0x3f74a5['query'][_0xe865('0x38')]('nolimit')){_0x5dc9ef['limit']=qs[_0xe865('0x1d')](_0x3f74a5[_0xe865('0x32')][_0xe865('0x1d')]);_0x5dc9ef[_0xe865('0x1c')]=qs[_0xe865('0x1c')](_0x3f74a5['query'][_0xe865('0x1c')]);}_0x5dc9ef['order']=qs['sort'](_0x3f74a5[_0xe865('0x32')][_0xe865('0x39')]);_0x5dc9ef[_0xe865('0x3a')]=qs['filters'](_[_0xe865('0x3b')](_0x3f74a5[_0xe865('0x32')],_0x101dae['filters']),_0xdb0c0d);if(_0x3f74a5['query'][_0xe865('0x3c')]){_0x5dc9ef[_0xe865('0x3a')]=_['merge'](_0x5dc9ef[_0xe865('0x3a')],{'$or':_[_0xe865('0x30')](_0xdb0c0d,function(_0xf184df){if(_0xf184df[_0xe865('0x2e')]!==_0xe865('0x3d')){var _0x7bd42c={};_0x7bd42c[_0xf184df[_0xe865('0x29')]]={'$like':'%'+_0x3f74a5[_0xe865('0x32')][_0xe865('0x3c')]+'%'};return _0x7bd42c;}})});}_0x5dc9ef=_[_0xe865('0x3e')]({},_0x5dc9ef,_0x3f74a5[_0xe865('0x3f')]);var _0x75128e={'where':_0x5dc9ef['where']};return db['DeskConfiguration'][_0xe865('0x1f')](_0x75128e)[_0xe865('0x25')](function(_0x6eb566){_0x8b9545[_0xe865('0x1f')]=_0x6eb566;if(_0x3f74a5['query']['includeAll']){_0x5dc9ef['include']=[{'all':!![]}];}return db[_0xe865('0x2c')][_0xe865('0x40')](_0x5dc9ef);})[_0xe865('0x25')](function(_0x36d2fa){_0x8b9545[_0xe865('0x41')]=_0x36d2fa;return _0x8b9545;})['then'](respondWithFilteredResult(_0x25e8ec,_0x5dc9ef))[_0xe865('0x42')](handleError(_0x25e8ec,null));};exports['show']=function(_0x3575b1,_0x19cba3){var _0x9ec64b={'raw':![],'where':{'id':_0x3575b1[_0xe865('0x43')]['id']}},_0x48da8a={};_0x48da8a['model']=_['keys'](db['DeskConfiguration'][_0xe865('0x44')]);_0x48da8a[_0xe865('0x32')]=_['keys'](_0x3575b1[_0xe865('0x32')]);_0x48da8a[_0xe865('0x45')]=_[_0xe865('0x33')](_0x48da8a[_0xe865('0x37')],_0x48da8a['query']);_0x9ec64b[_0xe865('0x34')]=_['intersection'](_0x48da8a['model'],qs['fields'](_0x3575b1[_0xe865('0x32')][_0xe865('0x35')]));_0x9ec64b['attributes']=_0x9ec64b[_0xe865('0x34')]['length']?_0x9ec64b['attributes']:_0x48da8a[_0xe865('0x37')];if(_0x3575b1[_0xe865('0x32')][_0xe865('0x46')]){_0x9ec64b['include']=[{'all':!![]}];}_0x9ec64b=_['merge']({},_0x9ec64b,_0x3575b1[_0xe865('0x3f')]);return db[_0xe865('0x2c')][_0xe865('0x47')](_0x9ec64b)[_0xe865('0x25')](handleEntityNotFound(_0x19cba3,null))[_0xe865('0x25')](respondWithResult(_0x19cba3,null))[_0xe865('0x42')](handleError(_0x19cba3,null));};exports['create']=function(_0x337808,_0x22cbc7){return db[_0xe865('0x2c')]['create'](_0x337808[_0xe865('0x48')],{})['then'](respondWithResult(_0x22cbc7,0xc9))[_0xe865('0x42')](handleError(_0x22cbc7,null));};exports[_0xe865('0x49')]=function(_0x20aba4,_0x40f23c){if(_0x20aba4[_0xe865('0x48')]['id']){delete _0x20aba4['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x20aba4[_0xe865('0x43')]['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x40f23c,null))[_0xe865('0x25')](saveUpdates(_0x20aba4[_0xe865('0x48')],null))[_0xe865('0x25')](respondWithResult(_0x40f23c,null))[_0xe865('0x42')](handleError(_0x40f23c,null));};exports[_0xe865('0x24')]=function(_0x59812b,_0x29b812){return db['DeskConfiguration']['find']({'where':{'id':_0x59812b['params']['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x29b812,null))[_0xe865('0x25')](removeEntity(_0x29b812,null))[_0xe865('0x42')](handleError(_0x29b812,null));};exports[_0xe865('0x4a')]=function(_0x3ab74c,_0x931c7,_0x396a74){var _0x1d515a={};var _0x5027c5={};var _0x642415;var _0x3287bc;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3ab74c[_0xe865('0x43')]['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x931c7,null))[_0xe865('0x25')](function(_0x904aa){if(_0x904aa){_0x642415=_0x904aa;_0x5027c5[_0xe865('0x37')]=_['keys'](db[_0xe865('0x4b')][_0xe865('0x44')]);_0x5027c5['query']=_[_0xe865('0x31')](_0x3ab74c['query']);_0x5027c5[_0xe865('0x45')]=_[_0xe865('0x33')](_0x5027c5['model'],_0x5027c5['query']);_0x1d515a['attributes']=_['intersection'](_0x5027c5[_0xe865('0x37')],qs['fields'](_0x3ab74c['query']['fields']));_0x1d515a[_0xe865('0x34')]=_0x1d515a[_0xe865('0x34')][_0xe865('0x36')]?_0x1d515a[_0xe865('0x34')]:_0x5027c5['model'];_0x1d515a[_0xe865('0x4c')]=qs['sort'](_0x3ab74c[_0xe865('0x32')][_0xe865('0x39')]);_0x1d515a[_0xe865('0x3a')]=qs[_0xe865('0x45')](_[_0xe865('0x3b')](_0x3ab74c[_0xe865('0x32')],_0x5027c5[_0xe865('0x45')]));if(_0x3ab74c[_0xe865('0x32')][_0xe865('0x3c')]){_0x1d515a[_0xe865('0x3a')]=_[_0xe865('0x3e')](_0x1d515a['where'],{'$or':_[_0xe865('0x30')](_0x1d515a['attributes'],function(_0x5b424f){var _0x5e373b={};_0x5e373b[_0x5b424f]={'$like':'%'+_0x3ab74c['query'][_0xe865('0x3c')]+'%'};return _0x5e373b;})});}_0x1d515a=_[_0xe865('0x3e')]({},_0x1d515a,_0x3ab74c['options']);return _0x642415[_0xe865('0x4a')](_0x1d515a);}})[_0xe865('0x25')](function(_0x39a46f){if(_0x39a46f){_0x3287bc=_0x39a46f[_0xe865('0x36')];if(!_0x3ab74c[_0xe865('0x32')]['hasOwnProperty'](_0xe865('0x4d'))){_0x1d515a[_0xe865('0x1d')]=qs[_0xe865('0x1d')](_0x3ab74c[_0xe865('0x32')][_0xe865('0x1d')]);_0x1d515a['offset']=qs[_0xe865('0x1c')](_0x3ab74c['query'][_0xe865('0x1c')]);}return _0x642415[_0xe865('0x4a')](_0x1d515a);}})[_0xe865('0x25')](function(_0x1d8a09){if(_0x1d8a09){return _0x1d8a09?{'count':_0x3287bc,'rows':_0x1d8a09}:null;}})[_0xe865('0x25')](respondWithResult(_0x931c7,null))[_0xe865('0x42')](handleError(_0x931c7,null));};exports['getSubjects']=function(_0x2d1d97,_0x2ef670,_0x1b60bf){var _0x16adb2={};var _0x597763={};var _0x36917e;var _0xcfd5d9;return db['DeskConfiguration'][_0xe865('0x4e')]({'where':{'id':_0x2d1d97[_0xe865('0x43')]['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x2ef670,null))[_0xe865('0x25')](function(_0x4fa623){if(_0x4fa623){_0x36917e=_0x4fa623;_0x597763[_0xe865('0x37')]=_['keys'](db[_0xe865('0x4b')][_0xe865('0x44')]);_0x597763[_0xe865('0x32')]=_['keys'](_0x2d1d97[_0xe865('0x32')]);_0x597763[_0xe865('0x45')]=_['intersection'](_0x597763['model'],_0x597763[_0xe865('0x32')]);_0x16adb2[_0xe865('0x34')]=_[_0xe865('0x33')](_0x597763[_0xe865('0x37')],qs[_0xe865('0x35')](_0x2d1d97['query'][_0xe865('0x35')]));_0x16adb2[_0xe865('0x34')]=_0x16adb2[_0xe865('0x34')][_0xe865('0x36')]?_0x16adb2['attributes']:_0x597763[_0xe865('0x37')];_0x16adb2['order']=qs[_0xe865('0x39')](_0x2d1d97[_0xe865('0x32')][_0xe865('0x39')]);_0x16adb2['where']=qs['filters'](_[_0xe865('0x3b')](_0x2d1d97[_0xe865('0x32')],_0x597763[_0xe865('0x45')]));if(_0x2d1d97[_0xe865('0x32')][_0xe865('0x3c')]){_0x16adb2[_0xe865('0x3a')]=_[_0xe865('0x3e')](_0x16adb2[_0xe865('0x3a')],{'$or':_['map'](_0x16adb2[_0xe865('0x34')],function(_0x1bab72){var _0x26be14={};_0x26be14[_0x1bab72]={'$like':'%'+_0x2d1d97[_0xe865('0x32')][_0xe865('0x3c')]+'%'};return _0x26be14;})});}_0x16adb2=_['merge']({},_0x16adb2,_0x2d1d97[_0xe865('0x3f')]);return _0x36917e[_0xe865('0x4f')](_0x16adb2);}})[_0xe865('0x25')](function(_0x885358){if(_0x885358){_0xcfd5d9=_0x885358[_0xe865('0x36')];if(!_0x2d1d97['query'][_0xe865('0x38')](_0xe865('0x4d'))){_0x16adb2[_0xe865('0x1d')]=qs['limit'](_0x2d1d97[_0xe865('0x32')][_0xe865('0x1d')]);_0x16adb2['offset']=qs[_0xe865('0x1c')](_0x2d1d97[_0xe865('0x32')]['offset']);}return _0x36917e[_0xe865('0x4f')](_0x16adb2);}})[_0xe865('0x25')](function(_0x14c6aa){if(_0x14c6aa){return _0x14c6aa?{'count':_0xcfd5d9,'rows':_0x14c6aa}:null;}})[_0xe865('0x25')](respondWithResult(_0x2ef670,null))[_0xe865('0x42')](handleError(_0x2ef670,null));};exports['getDescriptions']=function(_0x2224d6,_0x5f55eb,_0x3b8069){var _0x39951c={};var _0x4e20d2={};var _0x2a886a;var _0x2de0d3;return db[_0xe865('0x2c')][_0xe865('0x4e')]({'where':{'id':_0x2224d6[_0xe865('0x43')]['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x5f55eb,null))[_0xe865('0x25')](function(_0x5bb648){if(_0x5bb648){_0x2a886a=_0x5bb648;_0x4e20d2[_0xe865('0x37')]=_[_0xe865('0x31')](db[_0xe865('0x4b')][_0xe865('0x44')]);_0x4e20d2['query']=_[_0xe865('0x31')](_0x2224d6['query']);_0x4e20d2[_0xe865('0x45')]=_[_0xe865('0x33')](_0x4e20d2['model'],_0x4e20d2['query']);_0x39951c[_0xe865('0x34')]=_[_0xe865('0x33')](_0x4e20d2[_0xe865('0x37')],qs[_0xe865('0x35')](_0x2224d6[_0xe865('0x32')][_0xe865('0x35')]));_0x39951c[_0xe865('0x34')]=_0x39951c[_0xe865('0x34')]['length']?_0x39951c[_0xe865('0x34')]:_0x4e20d2[_0xe865('0x37')];_0x39951c['order']=qs['sort'](_0x2224d6[_0xe865('0x32')]['sort']);_0x39951c['where']=qs['filters'](_['pick'](_0x2224d6['query'],_0x4e20d2[_0xe865('0x45')]));if(_0x2224d6[_0xe865('0x32')][_0xe865('0x3c')]){_0x39951c[_0xe865('0x3a')]=_['merge'](_0x39951c[_0xe865('0x3a')],{'$or':_[_0xe865('0x30')](_0x39951c[_0xe865('0x34')],function(_0x33513d){var _0x3a3ee6={};_0x3a3ee6[_0x33513d]={'$like':'%'+_0x2224d6[_0xe865('0x32')][_0xe865('0x3c')]+'%'};return _0x3a3ee6;})});}_0x39951c=_[_0xe865('0x3e')]({},_0x39951c,_0x2224d6[_0xe865('0x3f')]);return _0x2a886a[_0xe865('0x50')](_0x39951c);}})[_0xe865('0x25')](function(_0x36f1b5){if(_0x36f1b5){_0x2de0d3=_0x36f1b5[_0xe865('0x36')];if(!_0x2224d6[_0xe865('0x32')][_0xe865('0x38')](_0xe865('0x4d'))){_0x39951c[_0xe865('0x1d')]=qs[_0xe865('0x1d')](_0x2224d6['query'][_0xe865('0x1d')]);_0x39951c[_0xe865('0x1c')]=qs[_0xe865('0x1c')](_0x2224d6[_0xe865('0x32')][_0xe865('0x1c')]);}return _0x2a886a['getDescriptions'](_0x39951c);}})[_0xe865('0x25')](function(_0x526376){if(_0x526376){return _0x526376?{'count':_0x2de0d3,'rows':_0x526376}:null;}})[_0xe865('0x25')](respondWithResult(_0x5f55eb,null))[_0xe865('0x42')](handleError(_0x5f55eb,null));};exports[_0xe865('0x51')]=function(_0x786557,_0x993e6d,_0x513909){var _0x418e8a={};var _0x5044bd={};var _0x143286;var _0x1cbe29;return db['DeskConfiguration'][_0xe865('0x4e')]({'where':{'id':_0x786557[_0xe865('0x43')]['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x993e6d,null))[_0xe865('0x25')](function(_0x1d67f8){if(_0x1d67f8){_0x143286=_0x1d67f8;_0x5044bd['model']=_[_0xe865('0x31')](db[_0xe865('0x52')][_0xe865('0x44')]);_0x5044bd['query']=_[_0xe865('0x31')](_0x786557[_0xe865('0x32')]);_0x5044bd['filters']=_[_0xe865('0x33')](_0x5044bd[_0xe865('0x37')],_0x5044bd[_0xe865('0x32')]);_0x418e8a['attributes']=_[_0xe865('0x33')](_0x5044bd[_0xe865('0x37')],qs['fields'](_0x786557[_0xe865('0x32')][_0xe865('0x35')]));_0x418e8a[_0xe865('0x34')]=_0x418e8a[_0xe865('0x34')][_0xe865('0x36')]?_0x418e8a[_0xe865('0x34')]:_0x5044bd[_0xe865('0x37')];_0x418e8a['order']=qs[_0xe865('0x39')](_0x786557[_0xe865('0x32')][_0xe865('0x39')]);_0x418e8a[_0xe865('0x3a')]=qs[_0xe865('0x45')](_[_0xe865('0x3b')](_0x786557[_0xe865('0x32')],_0x5044bd[_0xe865('0x45')]));if(_0x786557[_0xe865('0x32')]['filter']){_0x418e8a[_0xe865('0x3a')]=_['merge'](_0x418e8a[_0xe865('0x3a')],{'$or':_['map'](_0x418e8a['attributes'],function(_0x446dc4){var _0x10ee5b={};_0x10ee5b[_0x446dc4]={'$like':'%'+_0x786557[_0xe865('0x32')][_0xe865('0x3c')]+'%'};return _0x10ee5b;})});}_0x418e8a=_['merge']({},_0x418e8a,_0x786557[_0xe865('0x3f')]);return _0x143286[_0xe865('0x51')](_0x418e8a);}})['then'](function(_0x11f891){if(_0x11f891){_0x1cbe29=_0x11f891[_0xe865('0x36')];if(!_0x786557['query'][_0xe865('0x38')](_0xe865('0x4d'))){_0x418e8a[_0xe865('0x1d')]=qs[_0xe865('0x1d')](_0x786557[_0xe865('0x32')]['limit']);_0x418e8a[_0xe865('0x1c')]=qs[_0xe865('0x1c')](_0x786557[_0xe865('0x32')][_0xe865('0x1c')]);}return _0x143286[_0xe865('0x51')](_0x418e8a);}})[_0xe865('0x25')](function(_0x1b69f2){if(_0x1b69f2){return _0x1b69f2?{'count':_0x1cbe29,'rows':_0x1b69f2}:null;}})[_0xe865('0x25')](respondWithResult(_0x993e6d,null))['catch'](handleError(_0x993e6d,null));};exports[_0xe865('0x53')]=function(_0x75e220,_0x79cc6f,_0x5d6b2e){if(_0x75e220[_0xe865('0x48')]['id']){delete _0x75e220[_0xe865('0x48')]['id'];}return db[_0xe865('0x2c')]['findOne']({'where':{'id':_0x75e220['params']['id']}})[_0xe865('0x25')](handleEntityNotFound(_0x79cc6f,null))[_0xe865('0x25')](function(_0x104fe1){if(_0x104fe1){return _0x104fe1[_0xe865('0x53')](_0x75e220[_0xe865('0x48')]['ids']||[]);}return null;})[_0xe865('0x25')](respondWithResult(_0x79cc6f,null))[_0xe865('0x42')](handleError(_0x79cc6f,null));}; \ No newline at end of file +var _0x2148=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','map'];(function(_0x50b5a6,_0x1ccca2){var _0x5801eb=function(_0x5d774c){while(--_0x5d774c){_0x50b5a6['push'](_0x50b5a6['shift']());}};_0x5801eb(++_0x1ccca2);}(_0x2148,0x179));var _0x8214=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0x2148[_0x1d211b];return _0x47c88b;};'use strict';var emlformat=require(_0x8214('0x0'));var rimraf=require(_0x8214('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8214('0x2'));var moment=require('moment');var BPromise=require(_0x8214('0x3'));var Mustache=require(_0x8214('0x4'));var util=require(_0x8214('0x5'));var path=require(_0x8214('0x6'));var sox=require('sox');var csv=require(_0x8214('0x7'));var ejs=require(_0x8214('0x8'));var fs=require('fs');var fs_extra=require(_0x8214('0x9'));var _=require(_0x8214('0xa'));var squel=require(_0x8214('0xb'));var crypto=require(_0x8214('0xc'));var jsforce=require(_0x8214('0xd'));var deskjs=require(_0x8214('0xe'));var toCsv=require(_0x8214('0x7'));var querystring=require(_0x8214('0xf'));var Papa=require(_0x8214('0x10'));var Redis=require(_0x8214('0x11'));var authService=require(_0x8214('0x12'));var qs=require(_0x8214('0x13'));var as=require(_0x8214('0x14'));var hardwareService=require(_0x8214('0x15'));var logger=require(_0x8214('0x16'))(_0x8214('0x17'));var utils=require(_0x8214('0x18'));var config=require(_0x8214('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8214('0x1a'))['db'];function respondWithStatusCode(_0x160384,_0x39e8a0){_0x39e8a0=_0x39e8a0||0xcc;return function(_0x2f428c){if(_0x2f428c){return _0x160384[_0x8214('0x1b')](_0x39e8a0);}return _0x160384['status'](_0x39e8a0)[_0x8214('0x1c')]();};}function respondWithResult(_0x4a1692,_0x13c774){_0x13c774=_0x13c774||0xc8;return function(_0x3ae059){if(_0x3ae059){return _0x4a1692[_0x8214('0x1d')](_0x13c774)['json'](_0x3ae059);}};}function respondWithFilteredResult(_0x3c4841,_0x3e8fc9){return function(_0x81e482){if(_0x81e482){var _0x4f9187=typeof _0x3e8fc9[_0x8214('0x1e')]===_0x8214('0x1f')&&typeof _0x3e8fc9[_0x8214('0x20')]===_0x8214('0x1f');var _0x320f45=_0x81e482[_0x8214('0x21')];var _0x2b6eb9=_0x4f9187?0x0:_0x3e8fc9[_0x8214('0x1e')];var _0xfe3718=_0x4f9187?_0x81e482['count']:_0x3e8fc9[_0x8214('0x1e')]+_0x3e8fc9[_0x8214('0x20')];var _0x4470e8;if(_0xfe3718>=_0x320f45){_0xfe3718=_0x320f45;_0x4470e8=0xc8;}else{_0x4470e8=0xce;}_0x3c4841[_0x8214('0x1d')](_0x4470e8);return _0x3c4841[_0x8214('0x22')](_0x8214('0x23'),_0x2b6eb9+'-'+_0xfe3718+'/'+_0x320f45)[_0x8214('0x24')](_0x81e482);}return null;};}function patchUpdates(_0x31661c){return function(_0x10c6bd){try{jsonpatch[_0x8214('0x25')](_0x10c6bd,_0x31661c,!![]);}catch(_0xa4f3d2){return BPromise['reject'](_0xa4f3d2);}return _0x10c6bd[_0x8214('0x26')]();};}function saveUpdates(_0x126344,_0x524a8e){return function(_0x4cc5db){if(_0x4cc5db){return _0x4cc5db[_0x8214('0x27')](_0x126344)[_0x8214('0x28')](function(_0x18bb24){return _0x18bb24;});}return null;};}function removeEntity(_0x54b142,_0x596f11){return function(_0x4e6b58){if(_0x4e6b58){return _0x4e6b58[_0x8214('0x29')]()[_0x8214('0x28')](function(){_0x54b142[_0x8214('0x1d')](0xcc)[_0x8214('0x1c')]();});}};}function handleEntityNotFound(_0x540f2a,_0x1bce0c){return function(_0x44b165){if(!_0x44b165){_0x540f2a[_0x8214('0x1b')](0x194);}return _0x44b165;};}function handleError(_0x2127f2,_0x3c783e){_0x3c783e=_0x3c783e||0x1f4;return function(_0x144e46){logger[_0x8214('0x2a')](_0x144e46[_0x8214('0x2b')]);if(_0x144e46[_0x8214('0x2c')]){delete _0x144e46[_0x8214('0x2c')];}_0x2127f2[_0x8214('0x1d')](_0x3c783e)[_0x8214('0x2d')](_0x144e46);};}exports['index']=function(_0x486bdc,_0x120637){var _0x4efd3d={},_0x583939={},_0x495b6b={'count':0x0,'rows':[]};var _0x19de2c=_['map'](db[_0x8214('0x2e')][_0x8214('0x2f')],function(_0xa16eb){return{'name':_0xa16eb[_0x8214('0x30')],'type':_0xa16eb[_0x8214('0x31')][_0x8214('0x32')]};});_0x583939['model']=_['map'](_0x19de2c,_0x8214('0x2c'));_0x583939['query']=_[_0x8214('0x33')](_0x486bdc[_0x8214('0x34')]);_0x583939['filters']=_[_0x8214('0x35')](_0x583939[_0x8214('0x36')],_0x583939['query']);_0x4efd3d[_0x8214('0x37')]=_['intersection'](_0x583939['model'],qs[_0x8214('0x38')](_0x486bdc[_0x8214('0x34')][_0x8214('0x38')]));_0x4efd3d[_0x8214('0x37')]=_0x4efd3d[_0x8214('0x37')][_0x8214('0x39')]?_0x4efd3d[_0x8214('0x37')]:_0x583939[_0x8214('0x36')];if(!_0x486bdc[_0x8214('0x34')][_0x8214('0x3a')](_0x8214('0x3b'))){_0x4efd3d[_0x8214('0x20')]=qs[_0x8214('0x20')](_0x486bdc[_0x8214('0x34')][_0x8214('0x20')]);_0x4efd3d[_0x8214('0x1e')]=qs[_0x8214('0x1e')](_0x486bdc[_0x8214('0x34')]['offset']);}_0x4efd3d[_0x8214('0x3c')]=qs[_0x8214('0x3d')](_0x486bdc[_0x8214('0x34')][_0x8214('0x3d')]);_0x4efd3d['where']=qs['filters'](_[_0x8214('0x3e')](_0x486bdc[_0x8214('0x34')],_0x583939[_0x8214('0x3f')]),_0x19de2c);if(_0x486bdc['query'][_0x8214('0x40')]){_0x4efd3d[_0x8214('0x41')]=_[_0x8214('0x42')](_0x4efd3d[_0x8214('0x41')],{'$or':_[_0x8214('0x43')](_0x19de2c,function(_0x35ebc1){if(_0x35ebc1[_0x8214('0x31')]!==_0x8214('0x44')){var _0x31ee22={};_0x31ee22[_0x35ebc1[_0x8214('0x2c')]]={'$like':'%'+_0x486bdc[_0x8214('0x34')][_0x8214('0x40')]+'%'};return _0x31ee22;}})});}_0x4efd3d=_['merge']({},_0x4efd3d,_0x486bdc[_0x8214('0x45')]);var _0x56d5f6={'where':_0x4efd3d['where']};return db[_0x8214('0x2e')]['count'](_0x56d5f6)[_0x8214('0x28')](function(_0x28a0c1){_0x495b6b['count']=_0x28a0c1;if(_0x486bdc['query'][_0x8214('0x46')]){_0x4efd3d[_0x8214('0x47')]=[{'all':!![]}];}return db[_0x8214('0x2e')][_0x8214('0x48')](_0x4efd3d);})[_0x8214('0x28')](function(_0x525252){_0x495b6b[_0x8214('0x49')]=_0x525252;return _0x495b6b;})[_0x8214('0x28')](respondWithFilteredResult(_0x120637,_0x4efd3d))[_0x8214('0x4a')](handleError(_0x120637,null));};exports[_0x8214('0x4b')]=function(_0x3b258a,_0x418e5d){var _0x38d902={'raw':![],'where':{'id':_0x3b258a[_0x8214('0x4c')]['id']}},_0x28a6e8={};_0x28a6e8['model']=_['keys'](db[_0x8214('0x2e')][_0x8214('0x2f')]);_0x28a6e8[_0x8214('0x34')]=_['keys'](_0x3b258a[_0x8214('0x34')]);_0x28a6e8[_0x8214('0x3f')]=_[_0x8214('0x35')](_0x28a6e8['model'],_0x28a6e8[_0x8214('0x34')]);_0x38d902['attributes']=_[_0x8214('0x35')](_0x28a6e8[_0x8214('0x36')],qs[_0x8214('0x38')](_0x3b258a[_0x8214('0x34')]['fields']));_0x38d902['attributes']=_0x38d902[_0x8214('0x37')][_0x8214('0x39')]?_0x38d902['attributes']:_0x28a6e8[_0x8214('0x36')];if(_0x3b258a['query']['includeAll']){_0x38d902[_0x8214('0x47')]=[{'all':!![]}];}_0x38d902=_[_0x8214('0x42')]({},_0x38d902,_0x3b258a[_0x8214('0x45')]);return db[_0x8214('0x2e')][_0x8214('0x4d')](_0x38d902)[_0x8214('0x28')](handleEntityNotFound(_0x418e5d,null))['then'](respondWithResult(_0x418e5d,null))[_0x8214('0x4a')](handleError(_0x418e5d,null));};exports[_0x8214('0x4e')]=function(_0x47e13c,_0xc61985){return db[_0x8214('0x2e')]['create'](_0x47e13c[_0x8214('0x4f')],{})[_0x8214('0x28')](respondWithResult(_0xc61985,0xc9))['catch'](handleError(_0xc61985,null));};exports['update']=function(_0x21f336,_0x13c07f){if(_0x21f336['body']['id']){delete _0x21f336['body']['id'];}return db['DeskConfiguration'][_0x8214('0x4d')]({'where':{'id':_0x21f336[_0x8214('0x4c')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x13c07f,null))['then'](saveUpdates(_0x21f336['body'],null))[_0x8214('0x28')](respondWithResult(_0x13c07f,null))[_0x8214('0x4a')](handleError(_0x13c07f,null));};exports[_0x8214('0x29')]=function(_0x58a7de,_0xee01a3){return db['DeskConfiguration']['find']({'where':{'id':_0x58a7de[_0x8214('0x4c')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0xee01a3,null))[_0x8214('0x28')](removeEntity(_0xee01a3,null))[_0x8214('0x4a')](handleError(_0xee01a3,null));};exports[_0x8214('0x50')]=function(_0x304221,_0x1906f7,_0x46081d){var _0x58b1ff={};var _0x244645={};var _0x499282;var _0x5a73c1;return db[_0x8214('0x2e')][_0x8214('0x51')]({'where':{'id':_0x304221[_0x8214('0x4c')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x1906f7,null))[_0x8214('0x28')](function(_0xbb9f47){if(_0xbb9f47){_0x499282=_0xbb9f47;_0x244645['model']=_[_0x8214('0x33')](db[_0x8214('0x52')][_0x8214('0x2f')]);_0x244645[_0x8214('0x34')]=_[_0x8214('0x33')](_0x304221['query']);_0x244645[_0x8214('0x3f')]=_['intersection'](_0x244645[_0x8214('0x36')],_0x244645[_0x8214('0x34')]);_0x58b1ff['attributes']=_[_0x8214('0x35')](_0x244645[_0x8214('0x36')],qs['fields'](_0x304221[_0x8214('0x34')][_0x8214('0x38')]));_0x58b1ff[_0x8214('0x37')]=_0x58b1ff[_0x8214('0x37')][_0x8214('0x39')]?_0x58b1ff['attributes']:_0x244645[_0x8214('0x36')];_0x58b1ff[_0x8214('0x3c')]=qs['sort'](_0x304221[_0x8214('0x34')][_0x8214('0x3d')]);_0x58b1ff[_0x8214('0x41')]=qs[_0x8214('0x3f')](_[_0x8214('0x3e')](_0x304221['query'],_0x244645[_0x8214('0x3f')]));if(_0x304221[_0x8214('0x34')][_0x8214('0x40')]){_0x58b1ff[_0x8214('0x41')]=_[_0x8214('0x42')](_0x58b1ff[_0x8214('0x41')],{'$or':_[_0x8214('0x43')](_0x58b1ff[_0x8214('0x37')],function(_0x3ac444){var _0x55acd6={};_0x55acd6[_0x3ac444]={'$like':'%'+_0x304221[_0x8214('0x34')][_0x8214('0x40')]+'%'};return _0x55acd6;})});}_0x58b1ff=_[_0x8214('0x42')]({},_0x58b1ff,_0x304221[_0x8214('0x45')]);return _0x499282['getFields'](_0x58b1ff);}})[_0x8214('0x28')](function(_0x44c7ef){if(_0x44c7ef){_0x5a73c1=_0x44c7ef[_0x8214('0x39')];if(!_0x304221[_0x8214('0x34')][_0x8214('0x3a')](_0x8214('0x3b'))){_0x58b1ff[_0x8214('0x20')]=qs[_0x8214('0x20')](_0x304221[_0x8214('0x34')][_0x8214('0x20')]);_0x58b1ff[_0x8214('0x1e')]=qs[_0x8214('0x1e')](_0x304221[_0x8214('0x34')][_0x8214('0x1e')]);}return _0x499282[_0x8214('0x50')](_0x58b1ff);}})[_0x8214('0x28')](function(_0x1e2c50){if(_0x1e2c50){return _0x1e2c50?{'count':_0x5a73c1,'rows':_0x1e2c50}:null;}})[_0x8214('0x28')](respondWithResult(_0x1906f7,null))[_0x8214('0x4a')](handleError(_0x1906f7,null));};exports['getSubjects']=function(_0x157ff7,_0x20cac0,_0x4aebfa){var _0x20d50d={};var _0x52df31={};var _0x656c0a;var _0x5f515f;return db[_0x8214('0x2e')][_0x8214('0x51')]({'where':{'id':_0x157ff7['params']['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x20cac0,null))[_0x8214('0x28')](function(_0x25d2bd){if(_0x25d2bd){_0x656c0a=_0x25d2bd;_0x52df31['model']=_[_0x8214('0x33')](db[_0x8214('0x52')][_0x8214('0x2f')]);_0x52df31[_0x8214('0x34')]=_[_0x8214('0x33')](_0x157ff7[_0x8214('0x34')]);_0x52df31[_0x8214('0x3f')]=_[_0x8214('0x35')](_0x52df31[_0x8214('0x36')],_0x52df31['query']);_0x20d50d[_0x8214('0x37')]=_['intersection'](_0x52df31['model'],qs[_0x8214('0x38')](_0x157ff7[_0x8214('0x34')][_0x8214('0x38')]));_0x20d50d['attributes']=_0x20d50d[_0x8214('0x37')][_0x8214('0x39')]?_0x20d50d[_0x8214('0x37')]:_0x52df31[_0x8214('0x36')];_0x20d50d[_0x8214('0x3c')]=qs['sort'](_0x157ff7[_0x8214('0x34')]['sort']);_0x20d50d[_0x8214('0x41')]=qs[_0x8214('0x3f')](_[_0x8214('0x3e')](_0x157ff7['query'],_0x52df31[_0x8214('0x3f')]));if(_0x157ff7['query'][_0x8214('0x40')]){_0x20d50d[_0x8214('0x41')]=_[_0x8214('0x42')](_0x20d50d[_0x8214('0x41')],{'$or':_[_0x8214('0x43')](_0x20d50d[_0x8214('0x37')],function(_0x329a32){var _0x22be7b={};_0x22be7b[_0x329a32]={'$like':'%'+_0x157ff7['query'][_0x8214('0x40')]+'%'};return _0x22be7b;})});}_0x20d50d=_[_0x8214('0x42')]({},_0x20d50d,_0x157ff7[_0x8214('0x45')]);return _0x656c0a[_0x8214('0x53')](_0x20d50d);}})[_0x8214('0x28')](function(_0x79a2d1){if(_0x79a2d1){_0x5f515f=_0x79a2d1['length'];if(!_0x157ff7[_0x8214('0x34')][_0x8214('0x3a')]('nolimit')){_0x20d50d[_0x8214('0x20')]=qs[_0x8214('0x20')](_0x157ff7['query'][_0x8214('0x20')]);_0x20d50d[_0x8214('0x1e')]=qs[_0x8214('0x1e')](_0x157ff7[_0x8214('0x34')][_0x8214('0x1e')]);}return _0x656c0a['getSubjects'](_0x20d50d);}})[_0x8214('0x28')](function(_0x1fbdc5){if(_0x1fbdc5){return _0x1fbdc5?{'count':_0x5f515f,'rows':_0x1fbdc5}:null;}})['then'](respondWithResult(_0x20cac0,null))['catch'](handleError(_0x20cac0,null));};exports[_0x8214('0x54')]=function(_0x391c7f,_0x43d160,_0x460373){var _0x555dce={};var _0x37f715={};var _0x63e5ec;var _0x2daf78;return db['DeskConfiguration'][_0x8214('0x51')]({'where':{'id':_0x391c7f[_0x8214('0x4c')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x43d160,null))[_0x8214('0x28')](function(_0x2a0db5){if(_0x2a0db5){_0x63e5ec=_0x2a0db5;_0x37f715[_0x8214('0x36')]=_[_0x8214('0x33')](db[_0x8214('0x52')][_0x8214('0x2f')]);_0x37f715[_0x8214('0x34')]=_['keys'](_0x391c7f['query']);_0x37f715[_0x8214('0x3f')]=_[_0x8214('0x35')](_0x37f715[_0x8214('0x36')],_0x37f715[_0x8214('0x34')]);_0x555dce[_0x8214('0x37')]=_[_0x8214('0x35')](_0x37f715[_0x8214('0x36')],qs[_0x8214('0x38')](_0x391c7f['query'][_0x8214('0x38')]));_0x555dce[_0x8214('0x37')]=_0x555dce['attributes'][_0x8214('0x39')]?_0x555dce[_0x8214('0x37')]:_0x37f715[_0x8214('0x36')];_0x555dce['order']=qs[_0x8214('0x3d')](_0x391c7f['query'][_0x8214('0x3d')]);_0x555dce[_0x8214('0x41')]=qs[_0x8214('0x3f')](_[_0x8214('0x3e')](_0x391c7f[_0x8214('0x34')],_0x37f715[_0x8214('0x3f')]));if(_0x391c7f['query'][_0x8214('0x40')]){_0x555dce['where']=_[_0x8214('0x42')](_0x555dce[_0x8214('0x41')],{'$or':_[_0x8214('0x43')](_0x555dce['attributes'],function(_0x3279f3){var _0x2e540a={};_0x2e540a[_0x3279f3]={'$like':'%'+_0x391c7f[_0x8214('0x34')]['filter']+'%'};return _0x2e540a;})});}_0x555dce=_[_0x8214('0x42')]({},_0x555dce,_0x391c7f[_0x8214('0x45')]);return _0x63e5ec[_0x8214('0x54')](_0x555dce);}})['then'](function(_0x12a3cf){if(_0x12a3cf){_0x2daf78=_0x12a3cf[_0x8214('0x39')];if(!_0x391c7f[_0x8214('0x34')][_0x8214('0x3a')]('nolimit')){_0x555dce[_0x8214('0x20')]=qs['limit'](_0x391c7f[_0x8214('0x34')][_0x8214('0x20')]);_0x555dce[_0x8214('0x1e')]=qs[_0x8214('0x1e')](_0x391c7f[_0x8214('0x34')]['offset']);}return _0x63e5ec[_0x8214('0x54')](_0x555dce);}})[_0x8214('0x28')](function(_0x1772c9){if(_0x1772c9){return _0x1772c9?{'count':_0x2daf78,'rows':_0x1772c9}:null;}})[_0x8214('0x28')](respondWithResult(_0x43d160,null))[_0x8214('0x4a')](handleError(_0x43d160,null));};exports['getTags']=function(_0x5e395e,_0x1371c9,_0xd80c48){var _0x23c416={};var _0x578dbc={};var _0x5d8071;var _0x261725;return db[_0x8214('0x2e')][_0x8214('0x51')]({'where':{'id':_0x5e395e['params']['id']}})['then'](handleEntityNotFound(_0x1371c9,null))['then'](function(_0x40549b){if(_0x40549b){_0x5d8071=_0x40549b;_0x578dbc[_0x8214('0x36')]=_[_0x8214('0x33')](db[_0x8214('0x55')][_0x8214('0x2f')]);_0x578dbc[_0x8214('0x34')]=_[_0x8214('0x33')](_0x5e395e['query']);_0x578dbc[_0x8214('0x3f')]=_[_0x8214('0x35')](_0x578dbc[_0x8214('0x36')],_0x578dbc[_0x8214('0x34')]);_0x23c416[_0x8214('0x37')]=_['intersection'](_0x578dbc[_0x8214('0x36')],qs[_0x8214('0x38')](_0x5e395e[_0x8214('0x34')][_0x8214('0x38')]));_0x23c416['attributes']=_0x23c416[_0x8214('0x37')][_0x8214('0x39')]?_0x23c416[_0x8214('0x37')]:_0x578dbc['model'];_0x23c416[_0x8214('0x3c')]=qs[_0x8214('0x3d')](_0x5e395e['query']['sort']);_0x23c416[_0x8214('0x41')]=qs[_0x8214('0x3f')](_[_0x8214('0x3e')](_0x5e395e[_0x8214('0x34')],_0x578dbc[_0x8214('0x3f')]));if(_0x5e395e[_0x8214('0x34')][_0x8214('0x40')]){_0x23c416[_0x8214('0x41')]=_['merge'](_0x23c416[_0x8214('0x41')],{'$or':_['map'](_0x23c416[_0x8214('0x37')],function(_0x59f382){var _0x25b3ff={};_0x25b3ff[_0x59f382]={'$like':'%'+_0x5e395e['query']['filter']+'%'};return _0x25b3ff;})});}_0x23c416=_[_0x8214('0x42')]({},_0x23c416,_0x5e395e[_0x8214('0x45')]);return _0x5d8071[_0x8214('0x56')](_0x23c416);}})[_0x8214('0x28')](function(_0x563614){if(_0x563614){_0x261725=_0x563614[_0x8214('0x39')];if(!_0x5e395e[_0x8214('0x34')][_0x8214('0x3a')](_0x8214('0x3b'))){_0x23c416['limit']=qs[_0x8214('0x20')](_0x5e395e[_0x8214('0x34')][_0x8214('0x20')]);_0x23c416[_0x8214('0x1e')]=qs['offset'](_0x5e395e[_0x8214('0x34')][_0x8214('0x1e')]);}return _0x5d8071['getTags'](_0x23c416);}})['then'](function(_0x3dbf34){if(_0x3dbf34){return _0x3dbf34?{'count':_0x261725,'rows':_0x3dbf34}:null;}})[_0x8214('0x28')](respondWithResult(_0x1371c9,null))[_0x8214('0x4a')](handleError(_0x1371c9,null));};exports[_0x8214('0x57')]=function(_0x39170c,_0x3de3ca,_0x1ca4ba){if(_0x39170c[_0x8214('0x4f')]['id']){delete _0x39170c[_0x8214('0x4f')]['id'];}return db[_0x8214('0x2e')][_0x8214('0x51')]({'where':{'id':_0x39170c[_0x8214('0x4c')]['id']}})[_0x8214('0x28')](handleEntityNotFound(_0x3de3ca,null))[_0x8214('0x28')](function(_0x42d9d1){if(_0x42d9d1){return _0x42d9d1[_0x8214('0x57')](_0x39170c['body'][_0x8214('0x58')]||[]);}return null;})[_0x8214('0x28')](respondWithResult(_0x3de3ca,null))[_0x8214('0x4a')](handleError(_0x3de3ca,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5595405..77f1590 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 _0x73bd=['moment','bluebird','path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api'];(function(_0x374ec1,_0x4ee2b5){var _0x1b379f=function(_0x3784e7){while(--_0x3784e7){_0x374ec1['push'](_0x374ec1['shift']());}};_0x1b379f(++_0x4ee2b5);}(_0x73bd,0x6b));var _0xd73b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x73bd[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd73b('0x0'));var util=require('util');var logger=require(_0xd73b('0x1'))(_0xd73b('0x2'));var moment=require(_0xd73b('0x3'));var BPromise=require(_0xd73b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd73b('0x5'));var rimraf=require(_0xd73b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd73b('0x7'));module['exports']=function(_0x58a62a,_0x2282bf){return _0x58a62a[_0xd73b('0x8')](_0xd73b('0x9'),attributes,{'tableName':_0xd73b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe66f=['define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xe66f,0x14d));var _0xfe66=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe66f[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xfe66('0x0'));var util=require(_0xfe66('0x1'));var logger=require(_0xfe66('0x2'))(_0xfe66('0x3'));var moment=require(_0xfe66('0x4'));var BPromise=require(_0xfe66('0x5'));var rp=require(_0xfe66('0x6'));var fs=require('fs');var path=require(_0xfe66('0x7'));var rimraf=require(_0xfe66('0x8'));var config=require(_0xfe66('0x9'));var attributes=require(_0xfe66('0xa'));module[_0xfe66('0xb')]=function(_0x7ade44,_0x5ad795){return _0x7ade44[_0xfe66('0xc')](_0xfe66('0xd'),attributes,{'tableName':_0xfe66('0xe'),'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 24815ef..df67af7 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 _0x4c8c=['../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x4c8c,0x1b3));var _0xc4c8=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x4c8c[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0xc4c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc4c8('0x1'));var rs=require(_0xc4c8('0x2'));var fs=require('fs');var Redis=require(_0xc4c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4c8('0x4'));var logger=require(_0xc4c8('0x5'))('rpc');var config=require(_0xc4c8('0x6'));var jayson=require(_0xc4c8('0x7'));var client=jayson['client'][_0xc4c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bee88,_0xb2b749,_0x4056ef){return new BPromise(function(_0x592ed9,_0x134144){return client[_0xc4c8('0x9')](_0x1bee88,_0x4056ef)['then'](function(_0x2b4513){logger[_0xc4c8('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0xb2b749,_0xc4c8('0xb'));logger[_0xc4c8('0xc')](_0xc4c8('0xd'),_0xb2b749,_0xc4c8('0xb'),JSON[_0xc4c8('0xe')](_0x2b4513));if(_0x2b4513[_0xc4c8('0xf')]){if(_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x10')]===0x1f4){logger[_0xc4c8('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0xb2b749,_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);return _0x134144(_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);}logger[_0xc4c8('0xf')](_0xc4c8('0x12'),_0xb2b749,_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);return _0x592ed9(_0x2b4513[_0xc4c8('0xf')]['message']);}else{logger[_0xc4c8('0xa')](_0xc4c8('0x12'),_0xb2b749,_0xc4c8('0xb'));_0x592ed9(_0x2b4513['result']['message']);}})[_0xc4c8('0x13')](function(_0x7fe08f){logger['error'](_0xc4c8('0x12'),_0xb2b749,_0x7fe08f);_0x134144(_0x7fe08f);});});} \ No newline at end of file +var _0xdf92=['code','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1889de,_0x4a69ad){var _0x161942=function(_0x146049){while(--_0x146049){_0x1889de['push'](_0x1889de['shift']());}};_0x161942(++_0x4a69ad);}(_0xdf92,0x10c));var _0x2df9=function(_0x1ec801,_0x26ff02){_0x1ec801=_0x1ec801-0x0;var _0x399b96=_0xdf92[_0x1ec801];return _0x399b96;};'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);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index b25f50d..9224cdd 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 _0xa3a6=['post','put','/:id','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x4f3522,_0x3e9fb){var _0x5b4de7=function(_0x176d69){while(--_0x176d69){_0x4f3522['push'](_0x4f3522['shift']());}};_0x5b4de7(++_0x3e9fb);}(_0xa3a6,0xd1));var _0x6a3a=function(_0x1166ff,_0x24ae09){_0x1166ff=_0x1166ff-0x0;var _0x169437=_0xa3a6[_0x1166ff];return _0x169437;};'use strict';var multer=require(_0x6a3a('0x0'));var util=require(_0x6a3a('0x1'));var path=require('path');var timeout=require(_0x6a3a('0x2'));var express=require(_0x6a3a('0x3'));var router=express[_0x6a3a('0x4')]();var fs_extra=require(_0x6a3a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3a('0x6'));var config=require(_0x6a3a('0x7'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x6a3a('0x8')](),controller[_0x6a3a('0x9')]);router[_0x6a3a('0xa')]('/:id',auth[_0x6a3a('0x8')](),controller[_0x6a3a('0xb')]);router[_0x6a3a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6a3a('0xd')](_0x6a3a('0xe'),auth['isAuthenticated'](),controller[_0x6a3a('0xf')]);router['delete'](_0x6a3a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x6a3a('0x10')]=router; \ No newline at end of file +var _0x312d=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x312d,0x14d));var _0xd312=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x312d[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xd312('0x0'));var util=require(_0xd312('0x1'));var path=require(_0xd312('0x2'));var timeout=require(_0xd312('0x3'));var express=require(_0xd312('0x4'));var router=express[_0xd312('0x5')]();var fs_extra=require(_0xd312('0x6'));var auth=require(_0xd312('0x7'));var interaction=require(_0xd312('0x8'));var config=require(_0xd312('0x9'));var controller=require('./intDeskField.controller');router[_0xd312('0xa')]('/',auth[_0xd312('0xb')](),controller['index']);router[_0xd312('0xa')](_0xd312('0xc'),auth['isAuthenticated'](),controller[_0xd312('0xd')]);router[_0xd312('0xe')]('/',auth[_0xd312('0xb')](),controller[_0xd312('0xf')]);router[_0xd312('0x10')](_0xd312('0xc'),auth[_0xd312('0xb')](),controller['update']);router['delete']('/:id',auth[_0xd312('0xb')](),controller[_0xd312('0x11')]);module[_0xd312('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 61c5cc8..c19cf07 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 _0x9f18=['string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','exports'];(function(_0x128f59,_0x2fa715){var _0x33615a=function(_0x2cef6a){while(--_0x2cef6a){_0x128f59['push'](_0x128f59['shift']());}};_0x33615a(++_0x2fa715);}(_0x9f18,0x6b));var _0x89f1=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0x9f18[_0x3f7598];return _0x51fb16;};'use strict';var Sequelize=require('sequelize');module[_0x89f1('0x0')]={'type':{'type':Sequelize['ENUM'](_0x89f1('0x1'),_0x89f1('0x2'),'customVariable',_0x89f1('0x3'),_0x89f1('0x4')),'defaultValue':_0x89f1('0x1')},'content':{'type':Sequelize[_0x89f1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x89f1('0x6')]('string',_0x89f1('0x2'),_0x89f1('0x7'))},'keyContent':{'type':Sequelize[_0x89f1('0x5')]},'idField':{'type':Sequelize[_0x89f1('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x89f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x89f1('0x5')]}}; \ No newline at end of file +var _0x87a1=['customVariable','keyValue','picklist','STRING','string','ENUM','variable'];(function(_0x1d54a9,_0x56b434){var _0x1ef14b=function(_0x5c5898){while(--_0x5c5898){_0x1d54a9['push'](_0x1d54a9['shift']());}};_0x1ef14b(++_0x56b434);}(_0x87a1,0x178));var _0x187a=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x87a1[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x187a('0x0')]('string',_0x187a('0x1'),_0x187a('0x2'),_0x187a('0x3'),_0x187a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x187a('0x5')]},'key':{'type':Sequelize[_0x187a('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x187a('0x6'),_0x187a('0x1'),_0x187a('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x187a('0x5')]},'nameField':{'type':Sequelize[_0x187a('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x187a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index dae7fd9..332b757 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 _0x02a7=['save','update','then','destroy','end','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','reject'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0x02a7,0x7a));var _0x702a=function(_0x1fd120,_0x275507){_0x1fd120=_0x1fd120-0x0;var _0x295358=_0x02a7[_0x1fd120];return _0x295358;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x702a('0x1'));var moment=require(_0x702a('0x2'));var BPromise=require(_0x702a('0x3'));var Mustache=require(_0x702a('0x4'));var util=require(_0x702a('0x5'));var path=require(_0x702a('0x6'));var sox=require(_0x702a('0x7'));var csv=require('to-csv');var ejs=require(_0x702a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702a('0x9'));var squel=require(_0x702a('0xa'));var crypto=require(_0x702a('0xb'));var jsforce=require(_0x702a('0xc'));var deskjs=require(_0x702a('0xd'));var toCsv=require(_0x702a('0xe'));var querystring=require(_0x702a('0xf'));var Papa=require('papaparse');var Redis=require(_0x702a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x702a('0x11'));var hardwareService=require(_0x702a('0x12'));var logger=require(_0x702a('0x13'))(_0x702a('0x14'));var utils=require('../../config/utils');var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require(_0x702a('0x17'))['db'];function respondWithStatusCode(_0x221b35,_0x4688d1){_0x4688d1=_0x4688d1||0xcc;return function(_0x75455){if(_0x75455){return _0x221b35[_0x702a('0x18')](_0x4688d1);}return _0x221b35['status'](_0x4688d1)['end']();};}function respondWithResult(_0x38139d,_0x57f5fc){_0x57f5fc=_0x57f5fc||0xc8;return function(_0x576cf8){if(_0x576cf8){return _0x38139d['status'](_0x57f5fc)['json'](_0x576cf8);}};}function respondWithFilteredResult(_0x5c768d,_0x44f7fd){return function(_0x3c9770){if(_0x3c9770){var _0xa124dd=typeof _0x44f7fd['offset']==='undefined'&&typeof _0x44f7fd['limit']===_0x702a('0x19');var _0x469cb2=_0x3c9770[_0x702a('0x1a')];var _0x492cfb=_0xa124dd?0x0:_0x44f7fd[_0x702a('0x1b')];var _0x5ec1b3=_0xa124dd?_0x3c9770[_0x702a('0x1a')]:_0x44f7fd[_0x702a('0x1b')]+_0x44f7fd['limit'];var _0x4f8b29;if(_0x5ec1b3>=_0x469cb2){_0x5ec1b3=_0x469cb2;_0x4f8b29=0xc8;}else{_0x4f8b29=0xce;}_0x5c768d[_0x702a('0x1c')](_0x4f8b29);return _0x5c768d[_0x702a('0x1d')](_0x702a('0x1e'),_0x492cfb+'-'+_0x5ec1b3+'/'+_0x469cb2)[_0x702a('0x1f')](_0x3c9770);}return null;};}function patchUpdates(_0x332254){return function(_0x3152bf){try{jsonpatch[_0x702a('0x20')](_0x3152bf,_0x332254,!![]);}catch(_0x3a4add){return BPromise[_0x702a('0x21')](_0x3a4add);}return _0x3152bf[_0x702a('0x22')]();};}function saveUpdates(_0x47d0f5,_0x1ecd28){return function(_0x3d213c){if(_0x3d213c){return _0x3d213c[_0x702a('0x23')](_0x47d0f5)[_0x702a('0x24')](function(_0x1d6dae){return _0x1d6dae;});}return null;};}function removeEntity(_0x466b74,_0x2aede0){return function(_0x156212){if(_0x156212){return _0x156212[_0x702a('0x25')]()['then'](function(){_0x466b74[_0x702a('0x1c')](0xcc)[_0x702a('0x26')]();});}};}function handleEntityNotFound(_0x57add6,_0xf08699){return function(_0x1a9fbf){if(!_0x1a9fbf){_0x57add6[_0x702a('0x18')](0x194);}return _0x1a9fbf;};}function handleError(_0xf6b463,_0x3d4ed0){_0x3d4ed0=_0x3d4ed0||0x1f4;return function(_0x2eff20){logger['error'](_0x2eff20[_0x702a('0x27')]);if(_0x2eff20[_0x702a('0x28')]){delete _0x2eff20['name'];}_0xf6b463[_0x702a('0x1c')](_0x3d4ed0)[_0x702a('0x29')](_0x2eff20);};}exports[_0x702a('0x2a')]=function(_0x21ba99,_0x1973c7){var _0xa0877a={},_0x1596a8={},_0x5c6da4={'count':0x0,'rows':[]};var _0x2d7044=_[_0x702a('0x2b')](db[_0x702a('0x2c')][_0x702a('0x2d')],function(_0x511e7e){return{'name':_0x511e7e[_0x702a('0x2e')],'type':_0x511e7e['type'][_0x702a('0x2f')]};});_0x1596a8[_0x702a('0x30')]=_['map'](_0x2d7044,'name');_0x1596a8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x21ba99['query']);_0x1596a8[_0x702a('0x33')]=_['intersection'](_0x1596a8['model'],_0x1596a8[_0x702a('0x31')]);_0xa0877a[_0x702a('0x34')]=_[_0x702a('0x35')](_0x1596a8['model'],qs[_0x702a('0x36')](_0x21ba99[_0x702a('0x31')][_0x702a('0x36')]));_0xa0877a[_0x702a('0x34')]=_0xa0877a[_0x702a('0x34')][_0x702a('0x37')]?_0xa0877a[_0x702a('0x34')]:_0x1596a8[_0x702a('0x30')];if(!_0x21ba99[_0x702a('0x31')][_0x702a('0x38')](_0x702a('0x39'))){_0xa0877a[_0x702a('0x3a')]=qs[_0x702a('0x3a')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3a')]);_0xa0877a[_0x702a('0x1b')]=qs[_0x702a('0x1b')](_0x21ba99[_0x702a('0x31')]['offset']);}_0xa0877a[_0x702a('0x3b')]=qs[_0x702a('0x3c')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3c')]);_0xa0877a[_0x702a('0x3d')]=qs[_0x702a('0x33')](_[_0x702a('0x3e')](_0x21ba99[_0x702a('0x31')],_0x1596a8['filters']),_0x2d7044);if(_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]){_0xa0877a[_0x702a('0x3d')]=_[_0x702a('0x40')](_0xa0877a[_0x702a('0x3d')],{'$or':_[_0x702a('0x2b')](_0x2d7044,function(_0x3bc107){if(_0x3bc107[_0x702a('0x41')]!==_0x702a('0x42')){var _0x10fee4={};_0x10fee4[_0x3bc107[_0x702a('0x28')]]={'$like':'%'+_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]+'%'};return _0x10fee4;}})});}_0xa0877a=_[_0x702a('0x40')]({},_0xa0877a,_0x21ba99['options']);var _0x252b54={'where':_0xa0877a[_0x702a('0x3d')]};return db[_0x702a('0x2c')]['count'](_0x252b54)[_0x702a('0x24')](function(_0x202425){_0x5c6da4[_0x702a('0x1a')]=_0x202425;if(_0x21ba99[_0x702a('0x31')][_0x702a('0x43')]){_0xa0877a[_0x702a('0x44')]=[{'all':!![]}];}return db['DeskField'][_0x702a('0x45')](_0xa0877a);})[_0x702a('0x24')](function(_0x34a26f){_0x5c6da4[_0x702a('0x46')]=_0x34a26f;return _0x5c6da4;})[_0x702a('0x24')](respondWithFilteredResult(_0x1973c7,_0xa0877a))[_0x702a('0x47')](handleError(_0x1973c7,null));};exports[_0x702a('0x48')]=function(_0x275262,_0x5a67df){var _0x41a7ab={'raw':!![],'where':{'id':_0x275262[_0x702a('0x49')]['id']}},_0x5dc8f8={};_0x5dc8f8[_0x702a('0x30')]=_[_0x702a('0x32')](db['DeskField'][_0x702a('0x2d')]);_0x5dc8f8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x275262[_0x702a('0x31')]);_0x5dc8f8[_0x702a('0x33')]=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],_0x5dc8f8['query']);_0x41a7ab['attributes']=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],qs['fields'](_0x275262['query']['fields']));_0x41a7ab[_0x702a('0x34')]=_0x41a7ab[_0x702a('0x34')][_0x702a('0x37')]?_0x41a7ab[_0x702a('0x34')]:_0x5dc8f8[_0x702a('0x30')];if(_0x275262[_0x702a('0x31')][_0x702a('0x43')]){_0x41a7ab[_0x702a('0x44')]=[{'all':!![]}];}_0x41a7ab=_[_0x702a('0x40')]({},_0x41a7ab,_0x275262[_0x702a('0x4a')]);return db[_0x702a('0x2c')][_0x702a('0x4b')](_0x41a7ab)[_0x702a('0x24')](handleEntityNotFound(_0x5a67df,null))['then'](respondWithResult(_0x5a67df,null))['catch'](handleError(_0x5a67df,null));};exports[_0x702a('0x4c')]=function(_0x919678,_0x5a1cdf){return db[_0x702a('0x2c')][_0x702a('0x4c')](_0x919678['body'],{})[_0x702a('0x24')](respondWithResult(_0x5a1cdf,0xc9))[_0x702a('0x47')](handleError(_0x5a1cdf,null));};exports[_0x702a('0x23')]=function(_0x55e380,_0x3b1bba){if(_0x55e380[_0x702a('0x4d')]['id']){delete _0x55e380['body']['id'];}return db[_0x702a('0x2c')][_0x702a('0x4b')]({'where':{'id':_0x55e380['params']['id']}})[_0x702a('0x24')](handleEntityNotFound(_0x3b1bba,null))[_0x702a('0x24')](saveUpdates(_0x55e380[_0x702a('0x4d')],null))[_0x702a('0x24')](respondWithResult(_0x3b1bba,null))[_0x702a('0x47')](handleError(_0x3b1bba,null));};exports[_0x702a('0x25')]=function(_0xee9f8d,_0xbf2b99){return db[_0x702a('0x2c')]['find']({'where':{'id':_0xee9f8d[_0x702a('0x49')]['id']}})[_0x702a('0x24')](handleEntityNotFound(_0xbf2b99,null))[_0x702a('0x24')](removeEntity(_0xbf2b99,null))[_0x702a('0x47')](handleError(_0xbf2b99,null));}; \ No newline at end of file +var _0xa777=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','fields','create','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','intersection','length','attributes','hasOwnProperty','order'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa777,0x102));var _0x7a77=function(_0x1bd18e,_0x15a849){_0x1bd18e=_0x1bd18e-0x0;var _0x322d76=_0xa777[_0x1bd18e];return _0x322d76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a77('0x0'));var zipdir=require(_0x7a77('0x1'));var jsonpatch=require(_0x7a77('0x2'));var rp=require(_0x7a77('0x3'));var moment=require(_0x7a77('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a77('0x5'));var util=require(_0x7a77('0x6'));var path=require(_0x7a77('0x7'));var sox=require(_0x7a77('0x8'));var csv=require(_0x7a77('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a77('0xa'));var _=require(_0x7a77('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a77('0xc'));var deskjs=require(_0x7a77('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a77('0xe'));var Papa=require(_0x7a77('0xf'));var Redis=require(_0x7a77('0x10'));var authService=require(_0x7a77('0x11'));var qs=require(_0x7a77('0x12'));var as=require(_0x7a77('0x13'));var hardwareService=require(_0x7a77('0x14'));var logger=require(_0x7a77('0x15'))('api');var utils=require(_0x7a77('0x16'));var config=require(_0x7a77('0x17'));var licenseUtil=require(_0x7a77('0x18'));var db=require(_0x7a77('0x19'))['db'];function respondWithStatusCode(_0x2331d6,_0x4881d0){_0x4881d0=_0x4881d0||0xcc;return function(_0x35b3d3){if(_0x35b3d3){return _0x2331d6['sendStatus'](_0x4881d0);}return _0x2331d6[_0x7a77('0x1a')](_0x4881d0)[_0x7a77('0x1b')]();};}function respondWithResult(_0x4e11ea,_0x424d6e){_0x424d6e=_0x424d6e||0xc8;return function(_0x1af6d9){if(_0x1af6d9){return _0x4e11ea['status'](_0x424d6e)[_0x7a77('0x1c')](_0x1af6d9);}};}function respondWithFilteredResult(_0x361e30,_0x152398){return function(_0x3547db){if(_0x3547db){var _0x4f36d3=typeof _0x152398['offset']===_0x7a77('0x1d')&&typeof _0x152398['limit']==='undefined';var _0x51c288=_0x3547db[_0x7a77('0x1e')];var _0x51b6a0=_0x4f36d3?0x0:_0x152398[_0x7a77('0x1f')];var _0x4d0405=_0x4f36d3?_0x3547db[_0x7a77('0x1e')]:_0x152398[_0x7a77('0x1f')]+_0x152398[_0x7a77('0x20')];var _0x50f327;if(_0x4d0405>=_0x51c288){_0x4d0405=_0x51c288;_0x50f327=0xc8;}else{_0x50f327=0xce;}_0x361e30[_0x7a77('0x1a')](_0x50f327);return _0x361e30[_0x7a77('0x21')](_0x7a77('0x22'),_0x51b6a0+'-'+_0x4d0405+'/'+_0x51c288)[_0x7a77('0x1c')](_0x3547db);}return null;};}function patchUpdates(_0x15b568){return function(_0x2299bf){try{jsonpatch[_0x7a77('0x23')](_0x2299bf,_0x15b568,!![]);}catch(_0x195fda){return BPromise[_0x7a77('0x24')](_0x195fda);}return _0x2299bf[_0x7a77('0x25')]();};}function saveUpdates(_0x46cfa7,_0x17d91a){return function(_0x23be00){if(_0x23be00){return _0x23be00[_0x7a77('0x26')](_0x46cfa7)[_0x7a77('0x27')](function(_0x4e5f1d){return _0x4e5f1d;});}return null;};}function removeEntity(_0x599212,_0x178269){return function(_0x5e2018){if(_0x5e2018){return _0x5e2018['destroy']()[_0x7a77('0x27')](function(){_0x599212[_0x7a77('0x1a')](0xcc)[_0x7a77('0x1b')]();});}};}function handleEntityNotFound(_0x4dba0d,_0x5dbd4b){return function(_0x329c31){if(!_0x329c31){_0x4dba0d[_0x7a77('0x28')](0x194);}return _0x329c31;};}function handleError(_0x1dea01,_0x24a532){_0x24a532=_0x24a532||0x1f4;return function(_0x3d9c2c){logger[_0x7a77('0x29')](_0x3d9c2c[_0x7a77('0x2a')]);if(_0x3d9c2c[_0x7a77('0x2b')]){delete _0x3d9c2c['name'];}_0x1dea01['status'](_0x24a532)['send'](_0x3d9c2c);};}exports[_0x7a77('0x2c')]=function(_0x36a7c8,_0x443824){var _0x49ffe7={},_0x333a6e={},_0x50e3e0={'count':0x0,'rows':[]};var _0x13c695=_[_0x7a77('0x2d')](db[_0x7a77('0x2e')][_0x7a77('0x2f')],function(_0x219068){return{'name':_0x219068[_0x7a77('0x30')],'type':_0x219068[_0x7a77('0x31')][_0x7a77('0x32')]};});_0x333a6e[_0x7a77('0x33')]=_['map'](_0x13c695,_0x7a77('0x2b'));_0x333a6e[_0x7a77('0x34')]=_['keys'](_0x36a7c8[_0x7a77('0x34')]);_0x333a6e['filters']=_[_0x7a77('0x35')](_0x333a6e[_0x7a77('0x33')],_0x333a6e[_0x7a77('0x34')]);_0x49ffe7['attributes']=_['intersection'](_0x333a6e['model'],qs['fields'](_0x36a7c8[_0x7a77('0x34')]['fields']));_0x49ffe7['attributes']=_0x49ffe7['attributes'][_0x7a77('0x36')]?_0x49ffe7[_0x7a77('0x37')]:_0x333a6e[_0x7a77('0x33')];if(!_0x36a7c8[_0x7a77('0x34')][_0x7a77('0x38')]('nolimit')){_0x49ffe7['limit']=qs[_0x7a77('0x20')](_0x36a7c8[_0x7a77('0x34')]['limit']);_0x49ffe7[_0x7a77('0x1f')]=qs[_0x7a77('0x1f')](_0x36a7c8['query'][_0x7a77('0x1f')]);}_0x49ffe7[_0x7a77('0x39')]=qs[_0x7a77('0x3a')](_0x36a7c8[_0x7a77('0x34')][_0x7a77('0x3a')]);_0x49ffe7[_0x7a77('0x3b')]=qs[_0x7a77('0x3c')](_[_0x7a77('0x3d')](_0x36a7c8[_0x7a77('0x34')],_0x333a6e[_0x7a77('0x3c')]),_0x13c695);if(_0x36a7c8[_0x7a77('0x34')][_0x7a77('0x3e')]){_0x49ffe7[_0x7a77('0x3b')]=_[_0x7a77('0x3f')](_0x49ffe7['where'],{'$or':_[_0x7a77('0x2d')](_0x13c695,function(_0x1f73b2){if(_0x1f73b2[_0x7a77('0x31')]!==_0x7a77('0x40')){var _0x209094={};_0x209094[_0x1f73b2['name']]={'$like':'%'+_0x36a7c8[_0x7a77('0x34')]['filter']+'%'};return _0x209094;}})});}_0x49ffe7=_[_0x7a77('0x3f')]({},_0x49ffe7,_0x36a7c8[_0x7a77('0x41')]);var _0x48b1a5={'where':_0x49ffe7[_0x7a77('0x3b')]};return db['DeskField'][_0x7a77('0x1e')](_0x48b1a5)['then'](function(_0x1b930f){_0x50e3e0[_0x7a77('0x1e')]=_0x1b930f;if(_0x36a7c8[_0x7a77('0x34')][_0x7a77('0x42')]){_0x49ffe7[_0x7a77('0x43')]=[{'all':!![]}];}return db['DeskField'][_0x7a77('0x44')](_0x49ffe7);})[_0x7a77('0x27')](function(_0x20d8cb){_0x50e3e0[_0x7a77('0x45')]=_0x20d8cb;return _0x50e3e0;})[_0x7a77('0x27')](respondWithFilteredResult(_0x443824,_0x49ffe7))[_0x7a77('0x46')](handleError(_0x443824,null));};exports[_0x7a77('0x47')]=function(_0x46c946,_0x3e2563){var _0x28730e={'raw':!![],'where':{'id':_0x46c946['params']['id']}},_0x301982={};_0x301982[_0x7a77('0x33')]=_[_0x7a77('0x48')](db['DeskField'][_0x7a77('0x2f')]);_0x301982[_0x7a77('0x34')]=_['keys'](_0x46c946[_0x7a77('0x34')]);_0x301982[_0x7a77('0x3c')]=_[_0x7a77('0x35')](_0x301982[_0x7a77('0x33')],_0x301982[_0x7a77('0x34')]);_0x28730e[_0x7a77('0x37')]=_['intersection'](_0x301982['model'],qs[_0x7a77('0x49')](_0x46c946['query'][_0x7a77('0x49')]));_0x28730e[_0x7a77('0x37')]=_0x28730e[_0x7a77('0x37')][_0x7a77('0x36')]?_0x28730e[_0x7a77('0x37')]:_0x301982[_0x7a77('0x33')];if(_0x46c946[_0x7a77('0x34')][_0x7a77('0x42')]){_0x28730e['include']=[{'all':!![]}];}_0x28730e=_[_0x7a77('0x3f')]({},_0x28730e,_0x46c946[_0x7a77('0x41')]);return db[_0x7a77('0x2e')]['find'](_0x28730e)['then'](handleEntityNotFound(_0x3e2563,null))[_0x7a77('0x27')](respondWithResult(_0x3e2563,null))[_0x7a77('0x46')](handleError(_0x3e2563,null));};exports[_0x7a77('0x4a')]=function(_0x202931,_0xdcb831){return db['DeskField'][_0x7a77('0x4a')](_0x202931[_0x7a77('0x4b')],{})[_0x7a77('0x27')](respondWithResult(_0xdcb831,0xc9))[_0x7a77('0x46')](handleError(_0xdcb831,null));};exports[_0x7a77('0x26')]=function(_0x1516a5,_0x47c98c){if(_0x1516a5[_0x7a77('0x4b')]['id']){delete _0x1516a5[_0x7a77('0x4b')]['id'];}return db['DeskField'][_0x7a77('0x4c')]({'where':{'id':_0x1516a5[_0x7a77('0x4d')]['id']}})[_0x7a77('0x27')](handleEntityNotFound(_0x47c98c,null))[_0x7a77('0x27')](saveUpdates(_0x1516a5[_0x7a77('0x4b')],null))['then'](respondWithResult(_0x47c98c,null))['catch'](handleError(_0x47c98c,null));};exports[_0x7a77('0x4e')]=function(_0x1125a7,_0x141387){return db[_0x7a77('0x2e')][_0x7a77('0x4c')]({'where':{'id':_0x1125a7[_0x7a77('0x4d')]['id']}})[_0x7a77('0x27')](handleEntityNotFound(_0x141387,null))[_0x7a77('0x27')](removeEntity(_0x141387,null))['catch'](handleError(_0x141387,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 64bde94..02e9443 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 _0x9623=['../../config/environment','./intDeskField.attributes','exports','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x9623,0x77));var _0x3962=function(_0x457f0a,_0x1c9dc2){_0x457f0a=_0x457f0a-0x0;var _0x22753b=_0x9623[_0x457f0a];return _0x22753b;};'use strict';var _=require('lodash');var util=require(_0x3962('0x0'));var logger=require(_0x3962('0x1'))(_0x3962('0x2'));var moment=require(_0x3962('0x3'));var BPromise=require(_0x3962('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3962('0x5'));var rimraf=require(_0x3962('0x6'));var config=require(_0x3962('0x7'));var attributes=require(_0x3962('0x8'));module[_0x3962('0x9')]=function(_0x18e803,_0x16fba2){return _0x18e803['define']('DeskField',attributes,{'tableName':_0x3962('0xa'),'paranoid':![],'indexes':[{'name':_0x3962('0xb'),'fields':[_0x3962('0xc'),_0x3962('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bd5=['request-promise','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x1dbbe1,_0x2270bd){var _0x4c34d1=function(_0x376ec2){while(--_0x376ec2){_0x1dbbe1['push'](_0x1dbbe1['shift']());}};_0x4c34d1(++_0x2270bd);}(_0x6bd5,0x1d7));var _0x56bd=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x6bd5[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x56bd('0x0'));var util=require(_0x56bd('0x1'));var logger=require(_0x56bd('0x2'))(_0x56bd('0x3'));var moment=require('moment');var BPromise=require(_0x56bd('0x4'));var rp=require(_0x56bd('0x5'));var fs=require('fs');var path=require(_0x56bd('0x6'));var rimraf=require(_0x56bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x56bd('0x8'));module['exports']=function(_0x55f618,_0x280e38){return _0x55f618[_0x56bd('0x9')](_0x56bd('0xa'),attributes,{'tableName':_0x56bd('0xb'),'paranoid':![],'indexes':[{'name':_0x56bd('0xc'),'fields':['idField',_0x56bd('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 19c737b..1528681 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 _0x9adf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','bluebird','randomstring'];(function(_0xb5744c,_0x260ee1){var _0x2b7824=function(_0x45d403){while(--_0x45d403){_0xb5744c['push'](_0xb5744c['shift']());}};_0x2b7824(++_0x260ee1);}(_0x9adf,0x10e));var _0xf9ad=function(_0x1b2f27,_0x499b97){_0x1b2f27=_0x1b2f27-0x0;var _0x1a8e6b=_0x9adf[_0x1b2f27];return _0x1a8e6b;};'use strict';var _=require('lodash');var util=require(_0xf9ad('0x0'));var moment=require('moment');var BPromise=require(_0xf9ad('0x1'));var rs=require(_0xf9ad('0x2'));var fs=require('fs');var Redis=require(_0xf9ad('0x3'));var db=require(_0xf9ad('0x4'))['db'];var utils=require(_0xf9ad('0x5'));var logger=require(_0xf9ad('0x6'))(_0xf9ad('0x7'));var config=require(_0xf9ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf9ad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x320233,_0x326129){return new BPromise(function(_0x3fff37,_0xc4c10b){return client[_0xf9ad('0xa')](_0x4eb087,_0x326129)['then'](function(_0x2680ce){logger['info'](_0xf9ad('0xb'),_0x320233,_0xf9ad('0xc'));logger[_0xf9ad('0xd')](_0xf9ad('0xe'),_0x320233,_0xf9ad('0xc'),JSON[_0xf9ad('0xf')](_0x2680ce));if(_0x2680ce['error']){if(_0x2680ce['error']['code']===0x1f4){logger[_0xf9ad('0x10')](_0xf9ad('0xb'),_0x320233,_0x2680ce[_0xf9ad('0x10')][_0xf9ad('0x11')]);return _0xc4c10b(_0x2680ce[_0xf9ad('0x10')][_0xf9ad('0x11')]);}logger[_0xf9ad('0x10')](_0xf9ad('0xb'),_0x320233,_0x2680ce[_0xf9ad('0x10')][_0xf9ad('0x11')]);return _0x3fff37(_0x2680ce[_0xf9ad('0x10')]['message']);}else{logger[_0xf9ad('0x12')](_0xf9ad('0xb'),_0x320233,_0xf9ad('0xc'));_0x3fff37(_0x2680ce[_0xf9ad('0x13')][_0xf9ad('0x11')]);}})[_0xf9ad('0x14')](function(_0x1683a9){logger[_0xf9ad('0x10')](_0xf9ad('0xb'),_0x320233,_0x1683a9);_0xc4c10b(_0x1683a9);});});} \ No newline at end of file +var _0x65a3=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch'];(function(_0x3fbe9d,_0x36f8fb){var _0x343c9b=function(_0x13815a){while(--_0x13815a){_0x3fbe9d['push'](_0x3fbe9d['shift']());}};_0x343c9b(++_0x36f8fb);}(_0x65a3,0x1ce));var _0x365a=function(_0x4a02a2,_0x5a0a22){_0x4a02a2=_0x4a02a2-0x0;var _0xee3052=_0x65a3[_0x4a02a2];return _0xee3052;};'use strict';var _=require('lodash');var util=require(_0x365a('0x0'));var moment=require(_0x365a('0x1'));var BPromise=require('bluebird');var rs=require(_0x365a('0x2'));var fs=require('fs');var Redis=require(_0x365a('0x3'));var db=require(_0x365a('0x4'))['db'];var utils=require(_0x365a('0x5'));var logger=require(_0x365a('0x6'))(_0x365a('0x7'));var config=require(_0x365a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x365a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x293387,_0x5910e0,_0x3bdfdd){return new BPromise(function(_0x440c10,_0x363e71){return client[_0x365a('0xa')](_0x293387,_0x3bdfdd)[_0x365a('0xb')](function(_0x14eda1){logger[_0x365a('0xc')]('DeskField,\x20%s,\x20%s',_0x5910e0,_0x365a('0xd'));logger['debug'](_0x365a('0xe'),_0x5910e0,_0x365a('0xd'),JSON[_0x365a('0xf')](_0x14eda1));if(_0x14eda1[_0x365a('0x10')]){if(_0x14eda1['error'][_0x365a('0x11')]===0x1f4){logger['error'](_0x365a('0x12'),_0x5910e0,_0x14eda1[_0x365a('0x10')][_0x365a('0x13')]);return _0x363e71(_0x14eda1[_0x365a('0x10')][_0x365a('0x13')]);}logger['error'](_0x365a('0x12'),_0x5910e0,_0x14eda1['error']['message']);return _0x440c10(_0x14eda1[_0x365a('0x10')][_0x365a('0x13')]);}else{logger['info'](_0x365a('0x12'),_0x5910e0,_0x365a('0xd'));_0x440c10(_0x14eda1['result']['message']);}})[_0x365a('0x14')](function(_0x4de883){logger[_0x365a('0x10')](_0x365a('0x12'),_0x5910e0,_0x4de883);_0x363e71(_0x4de883);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a348911..100b8d4 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 _0x0aca=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0aca,0x6c));var _0xa0ac=function(_0x35c5b7,_0x513f34){_0x35c5b7=_0x35c5b7-0x0;var _0x114645=_0x0aca[_0x35c5b7];return _0x114645;};'use strict';var multer=require(_0xa0ac('0x0'));var util=require(_0xa0ac('0x1'));var path=require(_0xa0ac('0x2'));var timeout=require(_0xa0ac('0x3'));var express=require(_0xa0ac('0x4'));var router=express[_0xa0ac('0x5')]();var fs_extra=require(_0xa0ac('0x6'));var auth=require(_0xa0ac('0x7'));var interaction=require(_0xa0ac('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xa0ac('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0ac('0xa'),auth['isAuthenticated'](),controller[_0xa0ac('0xb')]);router[_0xa0ac('0x9')](_0xa0ac('0xc'),auth[_0xa0ac('0xd')](),controller[_0xa0ac('0xe')]);router[_0xa0ac('0x9')](_0xa0ac('0xf'),auth[_0xa0ac('0xd')](),controller[_0xa0ac('0x10')]);router[_0xa0ac('0x11')]('/',auth[_0xa0ac('0xd')](),controller[_0xa0ac('0x12')]);router[_0xa0ac('0x11')]('/:id/configurations',auth[_0xa0ac('0xd')](),controller[_0xa0ac('0x13')]);router['put'](_0xa0ac('0xa'),auth[_0xa0ac('0xd')](),controller['update']);router['delete']('/:id',auth[_0xa0ac('0xd')](),controller[_0xa0ac('0x14')]);module[_0xa0ac('0x15')]=router; \ No newline at end of file +var _0x805f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','util','path','connect-timeout'];(function(_0x34ec47,_0x9f1d35){var _0x1e8c65=function(_0x29ba0f){while(--_0x29ba0f){_0x34ec47['push'](_0x34ec47['shift']());}};_0x1e8c65(++_0x9f1d35);}(_0x805f,0x7a));var _0xf805=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x805f[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xf805('0x0'));var path=require(_0xf805('0x1'));var timeout=require(_0xf805('0x2'));var express=require(_0xf805('0x3'));var router=express[_0xf805('0x4')]();var fs_extra=require(_0xf805('0x5'));var auth=require(_0xf805('0x6'));var interaction=require(_0xf805('0x7'));var config=require(_0xf805('0x8'));var controller=require(_0xf805('0x9'));router[_0xf805('0xa')]('/',auth[_0xf805('0xb')](),controller[_0xf805('0xc')]);router[_0xf805('0xa')](_0xf805('0xd'),auth[_0xf805('0xb')](),controller['show']);router['get'](_0xf805('0xe'),auth[_0xf805('0xb')](),controller[_0xf805('0xf')]);router[_0xf805('0xa')](_0xf805('0x10'),auth[_0xf805('0xb')](),controller[_0xf805('0x11')]);router[_0xf805('0x12')]('/',auth[_0xf805('0xb')](),controller[_0xf805('0x13')]);router[_0xf805('0x12')](_0xf805('0xe'),auth[_0xf805('0xb')](),controller[_0xf805('0x14')]);router[_0xf805('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf805('0x16')]);router[_0xf805('0x17')]('/:id',auth[_0xf805('0xb')](),controller['destroy']);module[_0xf805('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 5de3c1e..0b56a04 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 _0x92f8=['exports','STRING'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x92f8,0xe4));var _0x892f=function(_0x104506,_0x1677de){_0x104506=_0x104506-0x0;var _0xe969fe=_0x92f8[_0x104506];return _0xe969fe;};'use strict';var Sequelize=require('sequelize');module[_0x892f('0x0')]={'name':{'type':Sequelize[_0x892f('0x1')]},'username':{'type':Sequelize[_0x892f('0x1')]},'password':{'type':Sequelize[_0x892f('0x1')]},'remoteUri':{'type':Sequelize[_0x892f('0x1')]},'tenantId':{'type':Sequelize[_0x892f('0x1')]},'clientId':{'type':Sequelize[_0x892f('0x1')]},'clientSecret':{'type':Sequelize[_0x892f('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x892f('0x1')]}}; \ No newline at end of file +var _0x4367=['STRING','exports'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x4367,0x1f3));var _0x7436=function(_0x276f5b,_0x5cb495){_0x276f5b=_0x276f5b-0x0;var _0x4e6f40=_0x4367[_0x276f5b];return _0x4e6f40;};'use strict';var Sequelize=require('sequelize');module[_0x7436('0x0')]={'name':{'type':Sequelize[_0x7436('0x1')]},'username':{'type':Sequelize[_0x7436('0x1')]},'password':{'type':Sequelize[_0x7436('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x7436('0x1')]},'clientId':{'type':Sequelize[_0x7436('0x1')]},'clientSecret':{'type':Sequelize[_0x7436('0x1')]},'serverUrl':{'type':Sequelize[_0x7436('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7436('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 3c24da0..bef77bf 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 _0x8a28=['POST','/oauth2/token','clientId','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','MetadataId','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','send','test',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','Label','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','params','length','includeAll','include','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','tenantId','clientSecret','substring','lastIndexOf','format'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x8a28,0xfd));var _0x88a2=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x8a28[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x88a2('0x0'));var rimraf=require(_0x88a2('0x1'));var zipdir=require(_0x88a2('0x2'));var jsonpatch=require(_0x88a2('0x3'));var rp=require(_0x88a2('0x4'));var moment=require(_0x88a2('0x5'));var BPromise=require(_0x88a2('0x6'));var Mustache=require(_0x88a2('0x7'));var util=require('util');var path=require(_0x88a2('0x8'));var sox=require(_0x88a2('0x9'));var csv=require(_0x88a2('0xa'));var ejs=require(_0x88a2('0xb'));var fs=require('fs');var fs_extra=require(_0x88a2('0xc'));var _=require('lodash');var squel=require(_0x88a2('0xd'));var crypto=require('crypto');var jsforce=require(_0x88a2('0xe'));var deskjs=require(_0x88a2('0xf'));var toCsv=require(_0x88a2('0xa'));var querystring=require(_0x88a2('0x10'));var Papa=require(_0x88a2('0x11'));var Redis=require(_0x88a2('0x12'));var authService=require(_0x88a2('0x13'));var qs=require(_0x88a2('0x14'));var as=require(_0x88a2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x88a2('0x16'));var utils=require(_0x88a2('0x17'));var config=require(_0x88a2('0x18'));var licenseUtil=require(_0x88a2('0x19'));var db=require(_0x88a2('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x210a52,_0x1a4056){_0x1a4056=_0x1a4056||0xcc;return function(_0x367a7d){if(_0x367a7d){return _0x210a52[_0x88a2('0x1b')](_0x1a4056);}return _0x210a52['status'](_0x1a4056)[_0x88a2('0x1c')]();};}function respondWithResult(_0x407ef0,_0x3b83ce){_0x3b83ce=_0x3b83ce||0xc8;return function(_0x59801e){if(_0x59801e){return _0x407ef0[_0x88a2('0x1d')](_0x3b83ce)[_0x88a2('0x1e')](_0x59801e);}};}function respondWithFilteredResult(_0x462b7b,_0x42facc){return function(_0x1beccd){if(_0x1beccd){var _0x209d30=typeof _0x42facc[_0x88a2('0x1f')]===_0x88a2('0x20')&&typeof _0x42facc[_0x88a2('0x21')]===_0x88a2('0x20');var _0x235b75=_0x1beccd[_0x88a2('0x22')];var _0x188f6a=_0x209d30?0x0:_0x42facc[_0x88a2('0x1f')];var _0x34d34a=_0x209d30?_0x1beccd[_0x88a2('0x22')]:_0x42facc[_0x88a2('0x1f')]+_0x42facc[_0x88a2('0x21')];var _0x4b72d1;if(_0x34d34a>=_0x235b75){_0x34d34a=_0x235b75;_0x4b72d1=0xc8;}else{_0x4b72d1=0xce;}_0x462b7b[_0x88a2('0x1d')](_0x4b72d1);return _0x462b7b[_0x88a2('0x23')]('Content-Range',_0x188f6a+'-'+_0x34d34a+'/'+_0x235b75)['json'](_0x1beccd);}return null;};}function patchUpdates(_0x7a054c){return function(_0x222038){try{jsonpatch[_0x88a2('0x24')](_0x222038,_0x7a054c,!![]);}catch(_0x20aef3){return BPromise[_0x88a2('0x25')](_0x20aef3);}return _0x222038['save']();};}function saveUpdates(_0x3b6401,_0xda54c4){return function(_0x36cc2c){if(_0x36cc2c){return _0x36cc2c[_0x88a2('0x26')](_0x3b6401)['then'](function(_0x1f104c){return _0x1f104c;});}return null;};}function removeEntity(_0x527744,_0x5bbd79){return function(_0x26a3a6){if(_0x26a3a6){return _0x26a3a6[_0x88a2('0x27')]()['then'](function(){_0x527744['status'](0xcc)[_0x88a2('0x1c')]();});}};}function handleEntityNotFound(_0xac4afe,_0x5be767){return function(_0x42ae5b){if(!_0x42ae5b){_0xac4afe[_0x88a2('0x1b')](0x194);}return _0x42ae5b;};}function handleError(_0x2ba881,_0x2474fc){_0x2474fc=_0x2474fc||0x1f4;return function(_0x54873b){logger[_0x88a2('0x28')](_0x54873b['stack']);if(_0x54873b[_0x88a2('0x29')]){delete _0x54873b[_0x88a2('0x29')];}_0x2ba881[_0x88a2('0x1d')](_0x2474fc)['send'](_0x54873b);};}exports[_0x88a2('0x2a')]=function(_0x3eca1a,_0x4c441a){var _0x21bd1b={},_0x537a8f={},_0x541cd0={'count':0x0,'rows':[]};var _0x5c0ff9=_[_0x88a2('0x2b')](db[_0x88a2('0x2c')][_0x88a2('0x2d')],function(_0x66300d){return{'name':_0x66300d[_0x88a2('0x2e')],'type':_0x66300d[_0x88a2('0x2f')]['key']};});_0x537a8f[_0x88a2('0x30')]=_[_0x88a2('0x2b')](_0x5c0ff9,_0x88a2('0x29'));_0x537a8f[_0x88a2('0x31')]=_[_0x88a2('0x32')](_0x3eca1a[_0x88a2('0x31')]);_0x537a8f[_0x88a2('0x33')]=_[_0x88a2('0x34')](_0x537a8f[_0x88a2('0x30')],_0x537a8f[_0x88a2('0x31')]);_0x21bd1b['attributes']=_['intersection'](_0x537a8f[_0x88a2('0x30')],qs[_0x88a2('0x35')](_0x3eca1a[_0x88a2('0x31')]['fields']));_0x21bd1b[_0x88a2('0x36')]=_0x21bd1b[_0x88a2('0x36')]['length']?_0x21bd1b[_0x88a2('0x36')]:_0x537a8f[_0x88a2('0x30')];if(!_0x3eca1a[_0x88a2('0x31')]['hasOwnProperty']('nolimit')){_0x21bd1b[_0x88a2('0x21')]=qs[_0x88a2('0x21')](_0x3eca1a['query'][_0x88a2('0x21')]);_0x21bd1b[_0x88a2('0x1f')]=qs[_0x88a2('0x1f')](_0x3eca1a[_0x88a2('0x31')][_0x88a2('0x1f')]);}_0x21bd1b[_0x88a2('0x37')]=qs[_0x88a2('0x38')](_0x3eca1a[_0x88a2('0x31')]['sort']);_0x21bd1b[_0x88a2('0x39')]=qs[_0x88a2('0x33')](_['pick'](_0x3eca1a[_0x88a2('0x31')],_0x537a8f[_0x88a2('0x33')]),_0x5c0ff9);if(_0x3eca1a[_0x88a2('0x31')][_0x88a2('0x3a')]){_0x21bd1b[_0x88a2('0x39')]=_[_0x88a2('0x3b')](_0x21bd1b[_0x88a2('0x39')],{'$or':_[_0x88a2('0x2b')](_0x5c0ff9,function(_0x246b97){if(_0x246b97[_0x88a2('0x2f')]!==_0x88a2('0x3c')){var _0x367fbe={};_0x367fbe[_0x246b97[_0x88a2('0x29')]]={'$like':'%'+_0x3eca1a[_0x88a2('0x31')][_0x88a2('0x3a')]+'%'};return _0x367fbe;}})});}_0x21bd1b=_[_0x88a2('0x3b')]({},_0x21bd1b,_0x3eca1a[_0x88a2('0x3d')]);var _0x23cdc2={'where':_0x21bd1b[_0x88a2('0x39')]};return db[_0x88a2('0x2c')][_0x88a2('0x22')](_0x23cdc2)[_0x88a2('0x3e')](function(_0x139c20){_0x541cd0[_0x88a2('0x22')]=_0x139c20;if(_0x3eca1a[_0x88a2('0x31')]['includeAll']){_0x21bd1b['include']=[{'all':!![]}];}return db[_0x88a2('0x2c')][_0x88a2('0x3f')](_0x21bd1b);})['then'](function(_0x11e426){_0x541cd0[_0x88a2('0x40')]=_0x11e426;return _0x541cd0;})[_0x88a2('0x3e')](respondWithFilteredResult(_0x4c441a,_0x21bd1b))[_0x88a2('0x41')](handleError(_0x4c441a,null));};exports[_0x88a2('0x42')]=function(_0x33a5c7,_0x4d9726){var _0x23f8c8={'raw':![],'where':{'id':_0x33a5c7[_0x88a2('0x43')]['id']}},_0x2c3742={};_0x2c3742['model']=_[_0x88a2('0x32')](db[_0x88a2('0x2c')][_0x88a2('0x2d')]);_0x2c3742[_0x88a2('0x31')]=_['keys'](_0x33a5c7[_0x88a2('0x31')]);_0x2c3742[_0x88a2('0x33')]=_[_0x88a2('0x34')](_0x2c3742[_0x88a2('0x30')],_0x2c3742[_0x88a2('0x31')]);_0x23f8c8[_0x88a2('0x36')]=_[_0x88a2('0x34')](_0x2c3742[_0x88a2('0x30')],qs[_0x88a2('0x35')](_0x33a5c7[_0x88a2('0x31')][_0x88a2('0x35')]));_0x23f8c8[_0x88a2('0x36')]=_0x23f8c8[_0x88a2('0x36')][_0x88a2('0x44')]?_0x23f8c8[_0x88a2('0x36')]:_0x2c3742[_0x88a2('0x30')];if(_0x33a5c7[_0x88a2('0x31')][_0x88a2('0x45')]){_0x23f8c8[_0x88a2('0x46')]=[{'all':!![]}];}_0x23f8c8=_[_0x88a2('0x3b')]({},_0x23f8c8,_0x33a5c7['options']);return db[_0x88a2('0x2c')]['find'](_0x23f8c8)[_0x88a2('0x3e')](handleEntityNotFound(_0x4d9726,null))['then'](respondWithResult(_0x4d9726,null))[_0x88a2('0x41')](handleError(_0x4d9726,null));};exports[_0x88a2('0x47')]=function(_0x1c5e6b,_0x37319d){return db[_0x88a2('0x2c')][_0x88a2('0x47')](_0x1c5e6b[_0x88a2('0x48')],{})[_0x88a2('0x3e')](respondWithResult(_0x37319d,0xc9))['catch'](handleError(_0x37319d,null));};exports[_0x88a2('0x26')]=function(_0x1cc256,_0x5b1f66){if(_0x1cc256[_0x88a2('0x48')]['id']){delete _0x1cc256['body']['id'];}return db[_0x88a2('0x2c')]['find']({'where':{'id':_0x1cc256[_0x88a2('0x43')]['id']}})[_0x88a2('0x3e')](handleEntityNotFound(_0x5b1f66,null))[_0x88a2('0x3e')](saveUpdates(_0x1cc256[_0x88a2('0x48')],null))[_0x88a2('0x3e')](respondWithResult(_0x5b1f66,null))[_0x88a2('0x41')](handleError(_0x5b1f66,null));};exports[_0x88a2('0x27')]=function(_0x2fbdf4,_0x2cf43b){return db[_0x88a2('0x2c')][_0x88a2('0x49')]({'where':{'id':_0x2fbdf4[_0x88a2('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cf43b,null))['then'](removeEntity(_0x2cf43b,null))[_0x88a2('0x41')](handleError(_0x2cf43b,null));};exports[_0x88a2('0x4a')]=function(_0x20f198,_0xf1e241,_0x35924e){var _0x575365={};var _0x2bc03d={};var _0x4793ee;var _0x4ee8e1;return db[_0x88a2('0x2c')][_0x88a2('0x4b')]({'where':{'id':_0x20f198['params']['id']}})[_0x88a2('0x3e')](handleEntityNotFound(_0xf1e241,null))['then'](function(_0x363f8d){if(_0x363f8d){_0x4793ee=_0x363f8d;_0x2bc03d[_0x88a2('0x30')]=_[_0x88a2('0x32')](db[_0x88a2('0x4c')][_0x88a2('0x2d')]);_0x2bc03d[_0x88a2('0x31')]=_['keys'](_0x20f198[_0x88a2('0x31')]);_0x2bc03d[_0x88a2('0x33')]=_[_0x88a2('0x34')](_0x2bc03d['model'],_0x2bc03d[_0x88a2('0x31')]);_0x575365[_0x88a2('0x36')]=_['intersection'](_0x2bc03d[_0x88a2('0x30')],qs[_0x88a2('0x35')](_0x20f198['query']['fields']));_0x575365[_0x88a2('0x36')]=_0x575365[_0x88a2('0x36')]['length']?_0x575365[_0x88a2('0x36')]:_0x2bc03d[_0x88a2('0x30')];_0x575365[_0x88a2('0x37')]=qs[_0x88a2('0x38')](_0x20f198[_0x88a2('0x31')][_0x88a2('0x38')]);_0x575365[_0x88a2('0x39')]=qs['filters'](_[_0x88a2('0x4d')](_0x20f198[_0x88a2('0x31')],_0x2bc03d[_0x88a2('0x33')]));if(_0x20f198['query']['filter']){_0x575365['where']=_[_0x88a2('0x3b')](_0x575365[_0x88a2('0x39')],{'$or':_[_0x88a2('0x2b')](_0x575365['attributes'],function(_0x3aba26){var _0x2870c5={};_0x2870c5[_0x3aba26]={'$like':'%'+_0x20f198[_0x88a2('0x31')][_0x88a2('0x3a')]+'%'};return _0x2870c5;})});}_0x575365=_[_0x88a2('0x3b')]({},_0x575365,_0x20f198[_0x88a2('0x3d')]);return _0x4793ee['getConfigurations'](_0x575365);}})['then'](function(_0x29371a){if(_0x29371a){_0x4ee8e1=_0x29371a['length'];if(!_0x20f198['query'][_0x88a2('0x4e')](_0x88a2('0x4f'))){_0x575365[_0x88a2('0x21')]=qs[_0x88a2('0x21')](_0x20f198[_0x88a2('0x31')]['limit']);_0x575365['offset']=qs[_0x88a2('0x1f')](_0x20f198[_0x88a2('0x31')][_0x88a2('0x1f')]);}return _0x4793ee[_0x88a2('0x4a')](_0x575365);}})[_0x88a2('0x3e')](function(_0xb99aaa){if(_0xb99aaa){return _0xb99aaa?{'count':_0x4ee8e1,'rows':_0xb99aaa}:null;}})[_0x88a2('0x3e')](respondWithResult(_0xf1e241,null))[_0x88a2('0x41')](handleError(_0xf1e241,null));};exports[_0x88a2('0x50')]=function(_0x485489,_0x541172,_0x31dfd6){if(_0x485489[_0x88a2('0x48')]['id']){delete _0x485489['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x485489[_0x88a2('0x43')]['id']}})[_0x88a2('0x3e')](handleEntityNotFound(_0x541172,null))[_0x88a2('0x3e')](function(_0x30e413){if(_0x30e413){_0x485489['body'][_0x88a2('0x51')]=_0x30e413['id'];_0x485489[_0x88a2('0x48')][_0x88a2('0x52')]=integrations[_0x88a2('0x53')](_0x485489[_0x88a2('0x48')][_0x88a2('0x54')],_0x485489[_0x88a2('0x48')]['type']);_0x485489['body'][_0x88a2('0x55')]=integrations['getDescriptions'](_0x485489['body'][_0x88a2('0x54')],_0x485489[_0x88a2('0x48')][_0x88a2('0x2f')]);return db[_0x88a2('0x4c')][_0x88a2('0x47')](_0x485489['body'],{'include':[{'model':db[_0x88a2('0x56')],'as':'Subjects'},{'model':db[_0x88a2('0x56')],'as':'Descriptions'}]});}return null;})[_0x88a2('0x3e')](respondWithResult(_0x541172,null))['catch'](handleError(_0x541172,null));};exports[_0x88a2('0x57')]=function(_0x2738ff,_0xa88d31,_0x34873b){var _0xcdbd8=_0x2738ff[_0x88a2('0x31')][_0x88a2('0x58')];var _0x1d6efb=_0xcdbd8===_0x88a2('0x59')?_0x88a2('0x5a'):'PhoneCall';var _0x4784be='';var _0x10ab73='';var _0x4efe3f='';var _0x69a1b1='';var _0x5d8ee1='';var _0x5bf331='';var _0x38c900='';var _0x3a0e3='';var _0x1b6673=[_0x88a2('0x5b'),_0x88a2('0x5c'),_0x88a2('0x5d'),'ownerid',_0x88a2('0x5e'),_0x88a2('0x5f'),_0x88a2('0x60'),_0x88a2('0x61'),'directioncode','phonecall_activity_parties'];var _0x3afcf7=[_0x88a2('0x62'),'accountidyominame',_0x88a2('0x63'),_0x88a2('0x64'),_0x88a2('0x65'),_0x88a2('0x66'),'contractdetailidname',_0x88a2('0x67'),_0x88a2('0x68'),_0x88a2('0x69'),_0x88a2('0x6a'),'createdbyyominame',_0x88a2('0x6b'),'createdonbehalfbyname',_0x88a2('0x6c'),_0x88a2('0x6d'),_0x88a2('0x6e'),'customeridyominame',_0x88a2('0x6f'),_0x88a2('0x70'),'entityimage_timestamp',_0x88a2('0x71'),_0x88a2('0x72'),_0x88a2('0x73'),_0x88a2('0x74'),_0x88a2('0x75'),_0x88a2('0x76'),_0x88a2('0x77'),_0x88a2('0x78'),'lastonholdtime',_0x88a2('0x79'),_0x88a2('0x7a'),_0x88a2('0x7b'),_0x88a2('0x7c'),'modifiedbyyominame',_0x88a2('0x7d'),_0x88a2('0x7e'),_0x88a2('0x7f'),_0x88a2('0x80'),_0x88a2('0x81'),_0x88a2('0x82'),_0x88a2('0x83'),_0x88a2('0x84'),_0x88a2('0x85'),_0x88a2('0x86'),'owneridyominame',_0x88a2('0x87'),_0x88a2('0x88'),_0x88a2('0x89'),_0x88a2('0x8a'),_0x88a2('0x8b'),_0x88a2('0x8c'),_0x88a2('0x8d'),'resolvebykpiidname',_0x88a2('0x8e'),_0x88a2('0x8f'),'responsiblecontactidyominame',_0x88a2('0x90'),_0x88a2('0x91'),'slaname',_0x88a2('0x92'),_0x88a2('0x93'),_0x88a2('0x94'),_0x88a2('0x95'),_0x88a2('0x96'),'timezoneruleversionnumber',_0x88a2('0x97'),'traversedpath',_0x88a2('0x98'),_0x88a2('0x99')];var _0x10f921=_0x1b6673[_0x88a2('0x9a')](_0x3afcf7);return db[_0x88a2('0x2c')][_0x88a2('0x4b')]({'where':{'id':_0x2738ff[_0x88a2('0x43')]['id']},'attributes':['id','username',_0x88a2('0x9b'),'remoteUri',_0x88a2('0x9c'),'clientId',_0x88a2('0x9d')]})['then'](handleEntityNotFound(_0xa88d31,null))[_0x88a2('0x3e')](function(_0x41c5c5){if(_0x41c5c5){_0x3a0e3=_0x41c5c5['remoteUri'];var _0x5a5d47=_0x3a0e3['slice'](-0x1);if(_0x5a5d47==='/'){_0x3a0e3=_0x3a0e3[_0x88a2('0x9e')](0x0,_0x3a0e3[_0x88a2('0x9f')](_0x5a5d47));}_0x38c900=util[_0x88a2('0xa0')]('%s/api/data/v9.0/',_0x3a0e3);var _0x226c1d={'method':_0x88a2('0xa1'),'uri':'https://login.microsoftonline.com/'+_0x41c5c5[_0x88a2('0x9c')]+_0x88a2('0xa2'),'form':{'client_id':_0x41c5c5[_0x88a2('0xa3')],'resource':_0x3a0e3,'username':_0x41c5c5[_0x88a2('0xa4')],'password':_0x41c5c5['password'],'grant_type':_0x88a2('0x9b'),'client_secret':_0x41c5c5[_0x88a2('0x9d')]},'json':!![]};return rp(_0x226c1d);}})['then'](function(_0x20c93e){_0x5bf331=_0x20c93e[_0x88a2('0xa5')];var _0x23ef5d={'method':_0x88a2('0xa6'),'uri':encodeURI(_0x38c900+_0x88a2('0xa7')+_0x1d6efb+'\x27'),'headers':{'Authorization':_0x88a2('0xa8')+_0x5bf331,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23ef5d);})[_0x88a2('0x3e')](function(_0x2b6191){var _0x2643e4=_0x2b6191['value'][0x0];var _0x7257ef=_0x2643e4['MetadataId'];var _0x43f4f5={'method':'GET','uri':_0x38c900+'EntityDefinitions('+_0x7257ef+_0x88a2('0xa9'),'headers':{'Authorization':_0x88a2('0xa8')+_0x5bf331,'If-None-Match':null,'OData-Version':_0x88a2('0xaa')},'json':!![]};return rp(_0x43f4f5);})[_0x88a2('0x3e')](function(_0x341806){_0x4784be=_0x341806;_0x10ab73=_0x4784be[_0x88a2('0xab')];_0x10ab73=_[_0x88a2('0xac')](_0x10ab73,function(_0x3e9639){return!_0x10f921[_0x88a2('0xad')](_0x3e9639[_0x88a2('0xae')]);});var _0x52af83=[];var _0x58d7fd=[];_0x10ab73[_0x88a2('0xaf')](function(_0x19db1e){if(_0x19db1e[_0x88a2('0xb0')]){var _0x57eb36=_0x19db1e['@odata.type'][_0x88a2('0x9e')](_0x19db1e['@odata.type'][_0x88a2('0x9f')]('.')+0x1);if(_0x57eb36==='PicklistAttributeMetadata'){_0x52af83['push'](getSelectList(_0x38c900,_0xcdbd8,_0x58d7fd,_0x4784be[_0x88a2('0xb1')],_0x19db1e[_0x88a2('0xb1')],_0x5bf331));}}});return Promise[_0x88a2('0xb2')](_0x52af83);})[_0x88a2('0x3e')](function(_0x25b582){_0x4efe3f=_0x25b582[0x0];var _0x5695c6=[];var _0x3af89e=[];_0x10ab73[_0x88a2('0xaf')](function(_0x16d34){if(!_[_0x88a2('0xb3')](_0x16d34[_0x88a2('0xb0')])){var _0x5cbb04=_0x16d34[_0x88a2('0xb0')][_0x88a2('0x9e')](_0x16d34[_0x88a2('0xb0')]['lastIndexOf']('.')+0x1);if(_0x5cbb04===_0x88a2('0xb4')){_0x5695c6[_0x88a2('0xb5')](getBooleanList(_0x38c900,_0xcdbd8,_0x3af89e,_0x4784be[_0x88a2('0xb1')],_0x16d34[_0x88a2('0xb1')],_0x5bf331));}}});return Promise[_0x88a2('0xb2')](_0x5695c6);})[_0x88a2('0x3e')](function(_0x456cb0){_0x69a1b1=_0x456cb0[0x0];var _0x279353=[];var _0x18ee1c=[];_0x10ab73[_0x88a2('0xaf')](function(_0x514672){if(_0x514672['@odata.type']){var _0x5af355=_0x514672['@odata.type'][_0x88a2('0x9e')](_0x514672[_0x88a2('0xb0')][_0x88a2('0x9f')]('.')+0x1);if(_0x5af355===_0x88a2('0xb6')||_0x5af355===_0x88a2('0xb7')||_0x5af355==='BigIntAttributeMetadata'||_0x5af355==='IntegerAttributeMetadata'||_0x5af355===_0x88a2('0xb8')||_0x5af355===_0x88a2('0xb9')||_0x5af355==='StatusAttributeMetadata'||_0x5af355===_0x88a2('0xba')||_0x5af355==='StateAttributeMetadata'||_0x5af355===_0x88a2('0xbb')){_0x279353[_0x88a2('0xb5')](getInputList(_0x38c900,_0xcdbd8,_0x5af355,_0x18ee1c,_0x4784be[_0x88a2('0xb1')],_0x514672[_0x88a2('0xb1')],_0x5bf331));}}});return Promise[_0x88a2('0xb2')](_0x279353);})['then'](function(_0x1f36ba){_0x5d8ee1=_0x1f36ba[0x0];var _0x679bd=_0x4efe3f[_0x88a2('0x9a')](_0x69a1b1)[_0x88a2('0x9a')](_0x5d8ee1);var _0x195b57={'count':_0x679bd[_0x88a2('0x44')],'rows':_0x679bd};return _0x195b57;})[_0x88a2('0x3e')](respondWithResult(_0xa88d31,null))['catch'](function(_0x3980bf){var _0x5271ae=_0x2738ff[_0x88a2('0x31')]['test']?0x1f4:_0x3980bf[_0x88a2('0xbc')]||0x1f4;logger[_0x88a2('0x28')](_0x3980bf['stack']);delete _0x3980bf[_0x88a2('0x29')];if(_0x5271ae===0x191){_0x5271ae=0x190;}_0xa88d31[_0x88a2('0x1d')](_0x5271ae)[_0x88a2('0xbd')](_0x2738ff[_0x88a2('0x31')][_0x88a2('0xbe')]?{'message':'Wrong\x20credentials','statusCode':_0x3980bf[_0x88a2('0xbc')]}:_0x3980bf);});};function getSelectList(_0x250525,_0x187df1,_0x5bd1e5,_0x3f33dc,_0x22b0b7,_0x321ce1){var _0x5dca9c={'method':_0x88a2('0xa6'),'uri':_0x250525+'EntityDefinitions('+_0x3f33dc+_0x88a2('0xbf')+_0x22b0b7+_0x88a2('0xc0')+_0x88a2('0xc1'),'headers':{'Authorization':_0x88a2('0xa8')+_0x321ce1,'If-None-Match':null,'OData-Version':_0x88a2('0xaa')},'json':!![]};return rp(_0x5dca9c)['then'](function(_0x29c955){var _0x29f2f8=[];var _0x36b2c2=_0x29c955[_0x88a2('0xc2')][_0x88a2('0xc3')];_0x36b2c2[_0x88a2('0xaf')](function(_0xba8588){_0x29f2f8[_0x88a2('0xb5')]({'name':_0xba8588['Label'][_0x88a2('0xc4')]['Label'],'value':String(_0xba8588[_0x88a2('0xc5')])});});var _0x28a1f5={'id':_0x187df1+'_'+_0x29c955[_0x88a2('0xae')],'name':_0x29c955[_0x88a2('0xc6')]['UserLocalizedLabel'][_0x88a2('0xc7')],'custom':![],'options':_0x29f2f8};_0x5bd1e5[_0x88a2('0xb5')](_0x28a1f5);return _0x5bd1e5;});}function getBooleanList(_0x57e9ec,_0x5b8e37,_0x55ed93,_0x4359f9,_0x1304df,_0x3f8294){var _0xdd1a47={'method':_0x88a2('0xa6'),'uri':_0x57e9ec+_0x88a2('0xc8')+_0x4359f9+_0x88a2('0xbf')+_0x1304df+_0x88a2('0xc9'),'headers':{'Authorization':_0x88a2('0xa8')+_0x3f8294,'If-None-Match':null,'OData-Version':_0x88a2('0xaa')},'json':!![]};return rp(_0xdd1a47)[_0x88a2('0x3e')](function(_0x534422){var _0x2f4c6d=[];_0x2f4c6d[_0x88a2('0xb5')]({'name':_0x534422[_0x88a2('0xc2')][_0x88a2('0xca')][_0x88a2('0xc7')]['UserLocalizedLabel'][_0x88a2('0xc7')],'value':_0x88a2('0xcb')},{'name':_0x534422[_0x88a2('0xc2')][_0x88a2('0xcc')][_0x88a2('0xc7')][_0x88a2('0xc4')][_0x88a2('0xc7')],'value':'false'});var _0xdfcd8c={'id':_0x5b8e37+'_'+_0x534422[_0x88a2('0xae')],'name':_0x534422[_0x88a2('0xc6')][_0x88a2('0xc4')][_0x88a2('0xc7')],'custom':![],'options':_0x2f4c6d};_0x55ed93[_0x88a2('0xb5')](_0xdfcd8c);return _0x55ed93;});}function getInputList(_0x4d60b9,_0x2354bc,_0x6b5b30,_0x21bb51,_0x3e2710,_0x294a7b,_0x185eba){var _0x55949a={'method':_0x88a2('0xa6'),'uri':_0x4d60b9+_0x88a2('0xc8')+_0x3e2710+_0x88a2('0xbf')+_0x294a7b+_0x88a2('0xcd')+_0x6b5b30+_0x88a2('0xce'),'headers':{'Authorization':'Bearer\x20'+_0x185eba,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x55949a)[_0x88a2('0x3e')](function(_0x3369f8){var _0x2642fe={'id':_0x2354bc+'_'+_0x3369f8[_0x88a2('0xae')],'name':_0x3369f8['DisplayName'][_0x88a2('0xc4')]?_0x3369f8[_0x88a2('0xc6')][_0x88a2('0xc4')]['Label']:_0x3369f8[_0x88a2('0xae')],'custom':![],'options':[]};_0x21bb51[_0x88a2('0xb5')](_0x2642fe);return _0x21bb51;});} \ No newline at end of file +var _0xe1f0=['all','@odata.type','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','error','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','Bearer\x20','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','Dynamics365Account','includeAll','include','findAll','show','params','create','body','catch','find','getConfigurations','findOne','Dynamics365Configuration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','incident','PhoneCall','description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','LogicalName','forEach','PicklistAttributeMetadata','push'];(function(_0xb95121,_0x4908ea){var _0x108ce5=function(_0x22e2fe){while(--_0x22e2fe){_0xb95121['push'](_0xb95121['shift']());}};_0x108ce5(++_0x4908ea);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x5db89a,_0x214a3a){_0x5db89a=_0x5db89a-0x0;var _0x532134=_0xe1f0[_0x5db89a];return _0x532134;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e1f('0x0'));var zipdir=require(_0x0e1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e1f('0x2'));var moment=require(_0x0e1f('0x3'));var BPromise=require(_0x0e1f('0x4'));var Mustache=require('mustache');var util=require(_0x0e1f('0x5'));var path=require(_0x0e1f('0x6'));var sox=require(_0x0e1f('0x7'));var csv=require('to-csv');var ejs=require(_0x0e1f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e1f('0x9'));var squel=require(_0x0e1f('0xa'));var crypto=require(_0x0e1f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0e1f('0xc'));var querystring=require(_0x0e1f('0xd'));var Papa=require('papaparse');var Redis=require(_0x0e1f('0xe'));var authService=require(_0x0e1f('0xf'));var qs=require(_0x0e1f('0x10'));var as=require(_0x0e1f('0x11'));var hardwareService=require(_0x0e1f('0x12'));var logger=require(_0x0e1f('0x13'))(_0x0e1f('0x14'));var utils=require(_0x0e1f('0x15'));var config=require(_0x0e1f('0x16'));var licenseUtil=require(_0x0e1f('0x17'));var db=require(_0x0e1f('0x18'))['db'];var integrations=require(_0x0e1f('0x19'));function respondWithStatusCode(_0x5bef5e,_0x443a14){_0x443a14=_0x443a14||0xcc;return function(_0x3ef5f9){if(_0x3ef5f9){return _0x5bef5e[_0x0e1f('0x1a')](_0x443a14);}return _0x5bef5e[_0x0e1f('0x1b')](_0x443a14)[_0x0e1f('0x1c')]();};}function respondWithResult(_0x5164b0,_0x358263){_0x358263=_0x358263||0xc8;return function(_0x202cfb){if(_0x202cfb){return _0x5164b0[_0x0e1f('0x1b')](_0x358263)[_0x0e1f('0x1d')](_0x202cfb);}};}function respondWithFilteredResult(_0x581310,_0x3088a6){return function(_0x15940f){if(_0x15940f){var _0x4a7d49=typeof _0x3088a6[_0x0e1f('0x1e')]===_0x0e1f('0x1f')&&typeof _0x3088a6[_0x0e1f('0x20')]===_0x0e1f('0x1f');var _0x2a964e=_0x15940f[_0x0e1f('0x21')];var _0x1a1893=_0x4a7d49?0x0:_0x3088a6['offset'];var _0x1dd150=_0x4a7d49?_0x15940f[_0x0e1f('0x21')]:_0x3088a6[_0x0e1f('0x1e')]+_0x3088a6[_0x0e1f('0x20')];var _0x3c10bc;if(_0x1dd150>=_0x2a964e){_0x1dd150=_0x2a964e;_0x3c10bc=0xc8;}else{_0x3c10bc=0xce;}_0x581310[_0x0e1f('0x1b')](_0x3c10bc);return _0x581310[_0x0e1f('0x22')]('Content-Range',_0x1a1893+'-'+_0x1dd150+'/'+_0x2a964e)[_0x0e1f('0x1d')](_0x15940f);}return null;};}function patchUpdates(_0x5c3159){return function(_0x59eb2c){try{jsonpatch['apply'](_0x59eb2c,_0x5c3159,!![]);}catch(_0x4424d8){return BPromise[_0x0e1f('0x23')](_0x4424d8);}return _0x59eb2c[_0x0e1f('0x24')]();};}function saveUpdates(_0x58c44b,_0xe85c23){return function(_0x40311d){if(_0x40311d){return _0x40311d[_0x0e1f('0x25')](_0x58c44b)['then'](function(_0xf6066){return _0xf6066;});}return null;};}function removeEntity(_0x103dc5,_0x376e6a){return function(_0x1a1af5){if(_0x1a1af5){return _0x1a1af5[_0x0e1f('0x26')]()[_0x0e1f('0x27')](function(){_0x103dc5[_0x0e1f('0x1b')](0xcc)[_0x0e1f('0x1c')]();});}};}function handleEntityNotFound(_0x5445ff,_0x9b7441){return function(_0x79c32){if(!_0x79c32){_0x5445ff[_0x0e1f('0x1a')](0x194);}return _0x79c32;};}function handleError(_0x58b54a,_0x50d850){_0x50d850=_0x50d850||0x1f4;return function(_0x31ef6c){logger['error'](_0x31ef6c[_0x0e1f('0x28')]);if(_0x31ef6c['name']){delete _0x31ef6c[_0x0e1f('0x29')];}_0x58b54a[_0x0e1f('0x1b')](_0x50d850)['send'](_0x31ef6c);};}exports['index']=function(_0xca6afa,_0x2a551e){var _0x3e6b26={},_0xb15a2b={},_0x1099bf={'count':0x0,'rows':[]};var _0x535917=_[_0x0e1f('0x2a')](db['Dynamics365Account'][_0x0e1f('0x2b')],function(_0x1d8f83){return{'name':_0x1d8f83[_0x0e1f('0x2c')],'type':_0x1d8f83[_0x0e1f('0x2d')][_0x0e1f('0x2e')]};});_0xb15a2b[_0x0e1f('0x2f')]=_['map'](_0x535917,_0x0e1f('0x29'));_0xb15a2b[_0x0e1f('0x30')]=_[_0x0e1f('0x31')](_0xca6afa[_0x0e1f('0x30')]);_0xb15a2b['filters']=_['intersection'](_0xb15a2b[_0x0e1f('0x2f')],_0xb15a2b[_0x0e1f('0x30')]);_0x3e6b26['attributes']=_[_0x0e1f('0x32')](_0xb15a2b[_0x0e1f('0x2f')],qs[_0x0e1f('0x33')](_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x33')]));_0x3e6b26[_0x0e1f('0x34')]=_0x3e6b26[_0x0e1f('0x34')][_0x0e1f('0x35')]?_0x3e6b26[_0x0e1f('0x34')]:_0xb15a2b[_0x0e1f('0x2f')];if(!_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x36')](_0x0e1f('0x37'))){_0x3e6b26[_0x0e1f('0x20')]=qs[_0x0e1f('0x20')](_0xca6afa['query'][_0x0e1f('0x20')]);_0x3e6b26[_0x0e1f('0x1e')]=qs[_0x0e1f('0x1e')](_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x1e')]);}_0x3e6b26['order']=qs['sort'](_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x38')]);_0x3e6b26[_0x0e1f('0x39')]=qs[_0x0e1f('0x3a')](_['pick'](_0xca6afa[_0x0e1f('0x30')],_0xb15a2b['filters']),_0x535917);if(_0xca6afa[_0x0e1f('0x30')]['filter']){_0x3e6b26[_0x0e1f('0x39')]=_[_0x0e1f('0x3b')](_0x3e6b26[_0x0e1f('0x39')],{'$or':_[_0x0e1f('0x2a')](_0x535917,function(_0x5b30a7){if(_0x5b30a7[_0x0e1f('0x2d')]!=='VIRTUAL'){var _0x2eafb9={};_0x2eafb9[_0x5b30a7[_0x0e1f('0x29')]]={'$like':'%'+_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x3c')]+'%'};return _0x2eafb9;}})});}_0x3e6b26=_[_0x0e1f('0x3b')]({},_0x3e6b26,_0xca6afa[_0x0e1f('0x3d')]);var _0x3291d0={'where':_0x3e6b26[_0x0e1f('0x39')]};return db[_0x0e1f('0x3e')]['count'](_0x3291d0)['then'](function(_0x4ff945){_0x1099bf[_0x0e1f('0x21')]=_0x4ff945;if(_0xca6afa[_0x0e1f('0x30')][_0x0e1f('0x3f')]){_0x3e6b26[_0x0e1f('0x40')]=[{'all':!![]}];}return db[_0x0e1f('0x3e')][_0x0e1f('0x41')](_0x3e6b26);})['then'](function(_0xa92820){_0x1099bf['rows']=_0xa92820;return _0x1099bf;})['then'](respondWithFilteredResult(_0x2a551e,_0x3e6b26))['catch'](handleError(_0x2a551e,null));};exports[_0x0e1f('0x42')]=function(_0x149b18,_0x33d057){var _0x4a81f5={'raw':![],'where':{'id':_0x149b18[_0x0e1f('0x43')]['id']}},_0xaf4da1={};_0xaf4da1[_0x0e1f('0x2f')]=_[_0x0e1f('0x31')](db[_0x0e1f('0x3e')][_0x0e1f('0x2b')]);_0xaf4da1['query']=_['keys'](_0x149b18[_0x0e1f('0x30')]);_0xaf4da1['filters']=_[_0x0e1f('0x32')](_0xaf4da1[_0x0e1f('0x2f')],_0xaf4da1[_0x0e1f('0x30')]);_0x4a81f5[_0x0e1f('0x34')]=_['intersection'](_0xaf4da1[_0x0e1f('0x2f')],qs[_0x0e1f('0x33')](_0x149b18[_0x0e1f('0x30')][_0x0e1f('0x33')]));_0x4a81f5[_0x0e1f('0x34')]=_0x4a81f5['attributes']['length']?_0x4a81f5[_0x0e1f('0x34')]:_0xaf4da1[_0x0e1f('0x2f')];if(_0x149b18[_0x0e1f('0x30')][_0x0e1f('0x3f')]){_0x4a81f5[_0x0e1f('0x40')]=[{'all':!![]}];}_0x4a81f5=_['merge']({},_0x4a81f5,_0x149b18['options']);return db[_0x0e1f('0x3e')]['find'](_0x4a81f5)['then'](handleEntityNotFound(_0x33d057,null))['then'](respondWithResult(_0x33d057,null))['catch'](handleError(_0x33d057,null));};exports[_0x0e1f('0x44')]=function(_0x3fc5a8,_0x15c251){return db[_0x0e1f('0x3e')][_0x0e1f('0x44')](_0x3fc5a8[_0x0e1f('0x45')],{})[_0x0e1f('0x27')](respondWithResult(_0x15c251,0xc9))['catch'](handleError(_0x15c251,null));};exports[_0x0e1f('0x25')]=function(_0x5990cf,_0x1a2291){if(_0x5990cf[_0x0e1f('0x45')]['id']){delete _0x5990cf[_0x0e1f('0x45')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x5990cf[_0x0e1f('0x43')]['id']}})[_0x0e1f('0x27')](handleEntityNotFound(_0x1a2291,null))[_0x0e1f('0x27')](saveUpdates(_0x5990cf[_0x0e1f('0x45')],null))[_0x0e1f('0x27')](respondWithResult(_0x1a2291,null))[_0x0e1f('0x46')](handleError(_0x1a2291,null));};exports[_0x0e1f('0x26')]=function(_0x426d69,_0x410add){return db[_0x0e1f('0x3e')][_0x0e1f('0x47')]({'where':{'id':_0x426d69[_0x0e1f('0x43')]['id']}})['then'](handleEntityNotFound(_0x410add,null))[_0x0e1f('0x27')](removeEntity(_0x410add,null))['catch'](handleError(_0x410add,null));};exports[_0x0e1f('0x48')]=function(_0x38976d,_0x49cf1a,_0x484521){var _0x405196={};var _0x329196={};var _0xd4fcc0;var _0x375c5c;return db[_0x0e1f('0x3e')][_0x0e1f('0x49')]({'where':{'id':_0x38976d['params']['id']}})[_0x0e1f('0x27')](handleEntityNotFound(_0x49cf1a,null))[_0x0e1f('0x27')](function(_0x350166){if(_0x350166){_0xd4fcc0=_0x350166;_0x329196[_0x0e1f('0x2f')]=_[_0x0e1f('0x31')](db[_0x0e1f('0x4a')][_0x0e1f('0x2b')]);_0x329196[_0x0e1f('0x30')]=_[_0x0e1f('0x31')](_0x38976d[_0x0e1f('0x30')]);_0x329196[_0x0e1f('0x3a')]=_[_0x0e1f('0x32')](_0x329196[_0x0e1f('0x2f')],_0x329196[_0x0e1f('0x30')]);_0x405196[_0x0e1f('0x34')]=_['intersection'](_0x329196[_0x0e1f('0x2f')],qs['fields'](_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x33')]));_0x405196['attributes']=_0x405196[_0x0e1f('0x34')][_0x0e1f('0x35')]?_0x405196[_0x0e1f('0x34')]:_0x329196['model'];_0x405196[_0x0e1f('0x4b')]=qs[_0x0e1f('0x38')](_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x38')]);_0x405196['where']=qs['filters'](_[_0x0e1f('0x4c')](_0x38976d[_0x0e1f('0x30')],_0x329196[_0x0e1f('0x3a')]));if(_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x3c')]){_0x405196[_0x0e1f('0x39')]=_[_0x0e1f('0x3b')](_0x405196[_0x0e1f('0x39')],{'$or':_[_0x0e1f('0x2a')](_0x405196[_0x0e1f('0x34')],function(_0x33a432){var _0xd96fdb={};_0xd96fdb[_0x33a432]={'$like':'%'+_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x3c')]+'%'};return _0xd96fdb;})});}_0x405196=_[_0x0e1f('0x3b')]({},_0x405196,_0x38976d[_0x0e1f('0x3d')]);return _0xd4fcc0['getConfigurations'](_0x405196);}})[_0x0e1f('0x27')](function(_0x57fcda){if(_0x57fcda){_0x375c5c=_0x57fcda[_0x0e1f('0x35')];if(!_0x38976d[_0x0e1f('0x30')]['hasOwnProperty'](_0x0e1f('0x37'))){_0x405196[_0x0e1f('0x20')]=qs[_0x0e1f('0x20')](_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x20')]);_0x405196['offset']=qs[_0x0e1f('0x1e')](_0x38976d[_0x0e1f('0x30')][_0x0e1f('0x1e')]);}return _0xd4fcc0['getConfigurations'](_0x405196);}})[_0x0e1f('0x27')](function(_0x14f33a){if(_0x14f33a){return _0x14f33a?{'count':_0x375c5c,'rows':_0x14f33a}:null;}})[_0x0e1f('0x27')](respondWithResult(_0x49cf1a,null))[_0x0e1f('0x46')](handleError(_0x49cf1a,null));};exports[_0x0e1f('0x4d')]=function(_0x186b13,_0x241f64,_0x522c86){if(_0x186b13[_0x0e1f('0x45')]['id']){delete _0x186b13[_0x0e1f('0x45')]['id'];}return db[_0x0e1f('0x3e')][_0x0e1f('0x49')]({'where':{'id':_0x186b13[_0x0e1f('0x43')]['id']}})['then'](handleEntityNotFound(_0x241f64,null))[_0x0e1f('0x27')](function(_0x1bb0bd){if(_0x1bb0bd){_0x186b13[_0x0e1f('0x45')][_0x0e1f('0x4e')]=_0x1bb0bd['id'];_0x186b13[_0x0e1f('0x45')][_0x0e1f('0x4f')]=integrations[_0x0e1f('0x50')](_0x186b13['body'][_0x0e1f('0x51')],_0x186b13[_0x0e1f('0x45')]['type']);_0x186b13['body']['Descriptions']=integrations[_0x0e1f('0x52')](_0x186b13[_0x0e1f('0x45')][_0x0e1f('0x51')],_0x186b13['body'][_0x0e1f('0x2d')]);return db[_0x0e1f('0x4a')][_0x0e1f('0x44')](_0x186b13[_0x0e1f('0x45')],{'include':[{'model':db[_0x0e1f('0x53')],'as':_0x0e1f('0x4f')},{'model':db[_0x0e1f('0x53')],'as':_0x0e1f('0x54')}]});}return null;})[_0x0e1f('0x27')](respondWithResult(_0x241f64,null))['catch'](handleError(_0x241f64,null));};exports[_0x0e1f('0x55')]=function(_0x31cf47,_0x61e5e,_0x54de94){var _0x15ce37=_0x31cf47[_0x0e1f('0x30')][_0x0e1f('0x56')];var _0x5922e0=_0x15ce37===_0x0e1f('0x57')?'Incident':_0x0e1f('0x58');var _0x414593='';var _0x568b2c='';var _0x3266cb='';var _0x4fc447='';var _0x150639='';var _0x44ac18='';var _0x350126='';var _0x32d201='';var _0x142a34=['title',_0x0e1f('0x59'),_0x0e1f('0x5a'),'ownerid','caseorigincode',_0x0e1f('0x5b'),_0x0e1f('0x5c'),_0x0e1f('0x5d'),_0x0e1f('0x5e'),_0x0e1f('0x5f')];var _0x475de4=[_0x0e1f('0x60'),_0x0e1f('0x61'),_0x0e1f('0x62'),_0x0e1f('0x63'),_0x0e1f('0x64'),_0x0e1f('0x65'),_0x0e1f('0x66'),_0x0e1f('0x67'),_0x0e1f('0x68'),_0x0e1f('0x69'),_0x0e1f('0x6a'),_0x0e1f('0x6b'),_0x0e1f('0x6c'),'createdonbehalfbyname',_0x0e1f('0x6d'),'customeridname',_0x0e1f('0x6e'),_0x0e1f('0x6f'),_0x0e1f('0x70'),_0x0e1f('0x71'),_0x0e1f('0x72'),_0x0e1f('0x73'),'escalatedon',_0x0e1f('0x74'),_0x0e1f('0x75'),_0x0e1f('0x76'),_0x0e1f('0x77'),_0x0e1f('0x78'),_0x0e1f('0x79'),_0x0e1f('0x7a'),_0x0e1f('0x7b'),_0x0e1f('0x7c'),_0x0e1f('0x7d'),'modifiedbyname',_0x0e1f('0x7e'),_0x0e1f('0x7f'),_0x0e1f('0x80'),_0x0e1f('0x81'),'msdyn_incidenttypename',_0x0e1f('0x82'),'numberofchildincidents',_0x0e1f('0x83'),_0x0e1f('0x84'),_0x0e1f('0x85'),_0x0e1f('0x86'),_0x0e1f('0x87'),_0x0e1f('0x88'),_0x0e1f('0x89'),_0x0e1f('0x8a'),_0x0e1f('0x8b'),'productidname',_0x0e1f('0x8c'),_0x0e1f('0x8d'),'resolvebykpiidname',_0x0e1f('0x8e'),_0x0e1f('0x8f'),_0x0e1f('0x90'),_0x0e1f('0x91'),_0x0e1f('0x92'),_0x0e1f('0x93'),_0x0e1f('0x94'),_0x0e1f('0x95'),_0x0e1f('0x96'),'subjectidname',_0x0e1f('0x97'),_0x0e1f('0x98'),_0x0e1f('0x99'),_0x0e1f('0x9a'),_0x0e1f('0x9b'),_0x0e1f('0x9c')];var _0x480f84=_0x142a34['concat'](_0x475de4);return db['Dynamics365Account'][_0x0e1f('0x49')]({'where':{'id':_0x31cf47[_0x0e1f('0x43')]['id']},'attributes':['id',_0x0e1f('0x9d'),_0x0e1f('0x9e'),_0x0e1f('0x9f'),_0x0e1f('0xa0'),_0x0e1f('0xa1'),'clientSecret']})[_0x0e1f('0x27')](handleEntityNotFound(_0x61e5e,null))[_0x0e1f('0x27')](function(_0x5ab21f){if(_0x5ab21f){_0x32d201=_0x5ab21f[_0x0e1f('0x9f')];var _0x5cd474=_0x32d201[_0x0e1f('0xa2')](-0x1);if(_0x5cd474==='/'){_0x32d201=_0x32d201[_0x0e1f('0xa3')](0x0,_0x32d201[_0x0e1f('0xa4')](_0x5cd474));}_0x350126=util[_0x0e1f('0xa5')]('%s/api/data/v9.0/',_0x32d201);var _0x522947={'method':_0x0e1f('0xa6'),'uri':_0x0e1f('0xa7')+_0x5ab21f[_0x0e1f('0xa0')]+_0x0e1f('0xa8'),'form':{'client_id':_0x5ab21f[_0x0e1f('0xa1')],'resource':_0x32d201,'username':_0x5ab21f['username'],'password':_0x5ab21f[_0x0e1f('0x9e')],'grant_type':_0x0e1f('0x9e'),'client_secret':_0x5ab21f[_0x0e1f('0xa9')]},'json':!![]};return rp(_0x522947);}})[_0x0e1f('0x27')](function(_0x413fd9){_0x44ac18=_0x413fd9[_0x0e1f('0xaa')];var _0x4a263d={'method':_0x0e1f('0xab'),'uri':encodeURI(_0x350126+_0x0e1f('0xac')+_0x5922e0+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x44ac18,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4a263d);})[_0x0e1f('0x27')](function(_0x26a9c3){var _0x1ef04f=_0x26a9c3['value'][0x0];var _0x56fe87=_0x1ef04f[_0x0e1f('0xad')];var _0x332d56={'method':_0x0e1f('0xab'),'uri':_0x350126+_0x0e1f('0xae')+_0x56fe87+_0x0e1f('0xaf'),'headers':{'Authorization':'Bearer\x20'+_0x44ac18,'If-None-Match':null,'OData-Version':_0x0e1f('0xb0')},'json':!![]};return rp(_0x332d56);})['then'](function(_0x5a196b){_0x414593=_0x5a196b;_0x568b2c=_0x414593[_0x0e1f('0xb1')];_0x568b2c=_[_0x0e1f('0xb2')](_0x568b2c,function(_0x28ef4a){return!_0x480f84['includes'](_0x28ef4a[_0x0e1f('0xb3')]);});var _0x14ee71=[];var _0x43f655=[];_0x568b2c[_0x0e1f('0xb4')](function(_0x46aa17){if(_0x46aa17['@odata.type']){var _0x46dcfe=_0x46aa17['@odata.type'][_0x0e1f('0xa3')](_0x46aa17['@odata.type'][_0x0e1f('0xa4')]('.')+0x1);if(_0x46dcfe===_0x0e1f('0xb5')){_0x14ee71[_0x0e1f('0xb6')](getSelectList(_0x350126,_0x15ce37,_0x43f655,_0x414593['MetadataId'],_0x46aa17[_0x0e1f('0xad')],_0x44ac18));}}});return Promise[_0x0e1f('0xb7')](_0x14ee71);})[_0x0e1f('0x27')](function(_0x32c971){_0x3266cb=_0x32c971[0x0];var _0x441818=[];var _0x2a8e94=[];_0x568b2c[_0x0e1f('0xb4')](function(_0x3d86fc){if(!_['isNil'](_0x3d86fc['@odata.type'])){var _0x1c9930=_0x3d86fc['@odata.type']['substring'](_0x3d86fc[_0x0e1f('0xb8')][_0x0e1f('0xa4')]('.')+0x1);if(_0x1c9930===_0x0e1f('0xb9')){_0x441818['push'](getBooleanList(_0x350126,_0x15ce37,_0x2a8e94,_0x414593[_0x0e1f('0xad')],_0x3d86fc[_0x0e1f('0xad')],_0x44ac18));}}});return Promise[_0x0e1f('0xb7')](_0x441818);})[_0x0e1f('0x27')](function(_0x23e9d1){_0x4fc447=_0x23e9d1[0x0];var _0xce306e=[];var _0x53ff99=[];_0x568b2c[_0x0e1f('0xb4')](function(_0x2669a2){if(_0x2669a2[_0x0e1f('0xb8')]){var _0x2b47e6=_0x2669a2[_0x0e1f('0xb8')][_0x0e1f('0xa3')](_0x2669a2['@odata.type'][_0x0e1f('0xa4')]('.')+0x1);if(_0x2b47e6==='StringAttributeMetadata'||_0x2b47e6===_0x0e1f('0xba')||_0x2b47e6===_0x0e1f('0xbb')||_0x2b47e6==='IntegerAttributeMetadata'||_0x2b47e6==='MemoAttributeMetadata'||_0x2b47e6==='DateTimeAttributeMetadata'||_0x2b47e6==='StatusAttributeMetadata'||_0x2b47e6===_0x0e1f('0xbc')||_0x2b47e6===_0x0e1f('0xbd')||_0x2b47e6===_0x0e1f('0xbe')){_0xce306e['push'](getInputList(_0x350126,_0x15ce37,_0x2b47e6,_0x53ff99,_0x414593[_0x0e1f('0xad')],_0x2669a2[_0x0e1f('0xad')],_0x44ac18));}}});return Promise[_0x0e1f('0xb7')](_0xce306e);})['then'](function(_0x33a357){_0x150639=_0x33a357[0x0];var _0x5c28fe=_0x3266cb[_0x0e1f('0xbf')](_0x4fc447)[_0x0e1f('0xbf')](_0x150639);var _0x2bcf79={'count':_0x5c28fe['length'],'rows':_0x5c28fe};return _0x2bcf79;})[_0x0e1f('0x27')](respondWithResult(_0x61e5e,null))[_0x0e1f('0x46')](function(_0xe39057){var _0x14b8c6=_0x31cf47[_0x0e1f('0x30')]['test']?0x1f4:_0xe39057[_0x0e1f('0xc0')]||0x1f4;logger[_0x0e1f('0xc1')](_0xe39057[_0x0e1f('0x28')]);delete _0xe39057[_0x0e1f('0x29')];if(_0x14b8c6===0x191){_0x14b8c6=0x190;}_0x61e5e[_0x0e1f('0x1b')](_0x14b8c6)[_0x0e1f('0xc2')](_0x31cf47[_0x0e1f('0x30')]['test']?{'message':_0x0e1f('0xc3'),'statusCode':_0xe39057[_0x0e1f('0xc0')]}:_0xe39057);});};function getSelectList(_0x812f86,_0x22d919,_0x4f2752,_0xe041b9,_0x268400,_0x54bdaa){var _0x418a7d={'method':_0x0e1f('0xab'),'uri':_0x812f86+_0x0e1f('0xae')+_0xe041b9+_0x0e1f('0xc4')+_0x268400+_0x0e1f('0xc5')+_0x0e1f('0xc6'),'headers':{'Authorization':'Bearer\x20'+_0x54bdaa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x418a7d)[_0x0e1f('0x27')](function(_0x1b207b){var _0x3db9d4=[];var _0x539538=_0x1b207b[_0x0e1f('0xc7')][_0x0e1f('0xc8')];_0x539538[_0x0e1f('0xb4')](function(_0x271714){_0x3db9d4['push']({'name':_0x271714[_0x0e1f('0xc9')]['UserLocalizedLabel'][_0x0e1f('0xc9')],'value':String(_0x271714['Value'])});});var _0x324410={'id':_0x22d919+'_'+_0x1b207b[_0x0e1f('0xb3')],'name':_0x1b207b[_0x0e1f('0xca')]['UserLocalizedLabel'][_0x0e1f('0xc9')],'custom':![],'options':_0x3db9d4};_0x4f2752[_0x0e1f('0xb6')](_0x324410);return _0x4f2752;});}function getBooleanList(_0x4a2a91,_0xb56d6b,_0x5263e9,_0x53d67c,_0x772d62,_0x1a98b9){var _0x4acaf9={'method':_0x0e1f('0xab'),'uri':_0x4a2a91+_0x0e1f('0xae')+_0x53d67c+_0x0e1f('0xc4')+_0x772d62+_0x0e1f('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x1a98b9,'If-None-Match':null,'OData-Version':_0x0e1f('0xb0')},'json':!![]};return rp(_0x4acaf9)[_0x0e1f('0x27')](function(_0x3fc91c){var _0x10dca7=[];_0x10dca7['push']({'name':_0x3fc91c[_0x0e1f('0xc7')][_0x0e1f('0xcc')]['Label'][_0x0e1f('0xcd')][_0x0e1f('0xc9')],'value':_0x0e1f('0xce')},{'name':_0x3fc91c[_0x0e1f('0xc7')]['FalseOption'][_0x0e1f('0xc9')][_0x0e1f('0xcd')]['Label'],'value':_0x0e1f('0xcf')});var _0x3f096b={'id':_0xb56d6b+'_'+_0x3fc91c['LogicalName'],'name':_0x3fc91c['DisplayName'][_0x0e1f('0xcd')]['Label'],'custom':![],'options':_0x10dca7};_0x5263e9['push'](_0x3f096b);return _0x5263e9;});}function getInputList(_0x476fb5,_0x4d0593,_0x12f86a,_0x3a25c0,_0x47245e,_0x2da97e,_0x40a4af){var _0x21f8d4={'method':'GET','uri':_0x476fb5+'EntityDefinitions('+_0x47245e+_0x0e1f('0xc4')+_0x2da97e+_0x0e1f('0xd0')+_0x12f86a+_0x0e1f('0xd1'),'headers':{'Authorization':_0x0e1f('0xd2')+_0x40a4af,'If-None-Match':null,'OData-Version':_0x0e1f('0xb0')},'json':!![]};return rp(_0x21f8d4)[_0x0e1f('0x27')](function(_0x46067a){var _0x4c7404={'id':_0x4d0593+'_'+_0x46067a[_0x0e1f('0xb3')],'name':_0x46067a[_0x0e1f('0xca')][_0x0e1f('0xcd')]?_0x46067a['DisplayName'][_0x0e1f('0xcd')][_0x0e1f('0xc9')]:_0x46067a[_0x0e1f('0xb3')],'custom':![],'options':[]};_0x3a25c0['push'](_0x4c7404);return _0x3a25c0;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 16f1b9f..bc3a256 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_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 +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18611f,_0x55b128){var _0x20d0fc=function(_0x2aa43d){while(--_0x2aa43d){_0x18611f['push'](_0x18611f['shift']());}};_0x20d0fc(++_0x55b128);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 156356e..64cf8ec 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 _0x34bb=['findAll','options','raw','where','attributes','limit','include','map','model','find','ShowDynamics365Account','debug','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetDynamics365Account','Dynamics365Account'];(function(_0x3a8d99,_0x1c1851){var _0x28e805=function(_0x180f7e){while(--_0x180f7e){_0x3a8d99['push'](_0x3a8d99['shift']());}};_0x28e805(++_0x1c1851);}(_0x34bb,0x160));var _0xb34b=function(_0x5f326e,_0x551ccd){_0x5f326e=_0x5f326e-0x0;var _0x20123b=_0x34bb[_0x5f326e];return _0x20123b;};'use strict';var _=require(_0xb34b('0x0'));var util=require(_0xb34b('0x1'));var moment=require('moment');var BPromise=require(_0xb34b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb34b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb34b('0x4'));var logger=require(_0xb34b('0x5'))(_0xb34b('0x6'));var config=require(_0xb34b('0x7'));var jayson=require(_0xb34b('0x8'));var client=jayson[_0xb34b('0x9')][_0xb34b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xff546e,_0x4bf565,_0xc51c73){return new BPromise(function(_0x34c418,_0x327059){return client[_0xb34b('0xb')](_0xff546e,_0xc51c73)[_0xb34b('0xc')](function(_0x1a9b47){logger[_0xb34b('0xd')](_0xb34b('0xe'),_0x4bf565,_0xb34b('0xf'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4bf565,_0xb34b('0xf'),JSON[_0xb34b('0x10')](_0x1a9b47));if(_0x1a9b47['error']){if(_0x1a9b47[_0xb34b('0x11')]['code']===0x1f4){logger[_0xb34b('0x11')](_0xb34b('0xe'),_0x4bf565,_0x1a9b47[_0xb34b('0x11')][_0xb34b('0x12')]);return _0x327059(_0x1a9b47[_0xb34b('0x11')][_0xb34b('0x12')]);}logger[_0xb34b('0x11')](_0xb34b('0xe'),_0x4bf565,_0x1a9b47[_0xb34b('0x11')]['message']);return _0x34c418(_0x1a9b47['error']['message']);}else{logger[_0xb34b('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x4bf565,_0xb34b('0xf'));_0x34c418(_0x1a9b47['result'][_0xb34b('0x12')]);}})[_0xb34b('0x13')](function(_0x3281a8){logger[_0xb34b('0x11')](_0xb34b('0xe'),_0x4bf565,_0x3281a8);_0x327059(_0x3281a8);});});}exports[_0xb34b('0x14')]=function(_0x5b8af7){var _0x1ca897=this;return new Promise(function(_0x6f0f64,_0x20fe88){return db[_0xb34b('0x15')][_0xb34b('0x16')]({'raw':_0x5b8af7[_0xb34b('0x17')]?_0x5b8af7[_0xb34b('0x17')][_0xb34b('0x18')]===undefined?!![]:![]:!![],'where':_0x5b8af7[_0xb34b('0x17')]?_0x5b8af7[_0xb34b('0x17')][_0xb34b('0x19')]||null:null,'attributes':_0x5b8af7[_0xb34b('0x17')]?_0x5b8af7[_0xb34b('0x17')][_0xb34b('0x1a')]||null:null,'limit':_0x5b8af7[_0xb34b('0x17')]?_0x5b8af7[_0xb34b('0x17')][_0xb34b('0x1b')]||null:null,'include':_0x5b8af7[_0xb34b('0x17')]?_0x5b8af7[_0xb34b('0x17')][_0xb34b('0x1c')]?_[_0xb34b('0x1d')](_0x5b8af7['options']['include'],function(_0x55efd8){return{'model':db[_0x55efd8[_0xb34b('0x1e')]],'as':_0x55efd8['as'],'attributes':_0x55efd8[_0xb34b('0x1a')],'include':_0x55efd8[_0xb34b('0x1c')]?_[_0xb34b('0x1d')](_0x55efd8[_0xb34b('0x1c')],function(_0x43950a){return{'model':db[_0x43950a['model']],'as':_0x43950a['as'],'attributes':_0x43950a[_0xb34b('0x1a')],'include':_0x43950a[_0xb34b('0x1c')]?_[_0xb34b('0x1d')](_0x43950a[_0xb34b('0x1c')],function(_0x193fe1){return{'model':db[_0x193fe1[_0xb34b('0x1e')]],'as':_0x193fe1['as'],'attributes':_0x193fe1[_0xb34b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb34b('0xc')](function(_0x3d4c99){logger[_0xb34b('0xd')](_0xb34b('0x14'),_0x5b8af7);logger['debug'](_0xb34b('0x14'),_0x5b8af7,JSON[_0xb34b('0x10')](_0x3d4c99));_0x6f0f64(_0x3d4c99);})['catch'](function(_0x5d483c){logger[_0xb34b('0x11')]('GetDynamics365Account',_0x5d483c[_0xb34b('0x12')],_0x5b8af7);_0x20fe88(_0x1ca897[_0xb34b('0x11')](0x1f4,_0x5d483c[_0xb34b('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x4a17f2){var _0x191328=this;return new Promise(function(_0x3a74ab,_0x19b837){return db[_0xb34b('0x15')][_0xb34b('0x1f')]({'raw':_0x4a17f2[_0xb34b('0x17')]?_0x4a17f2['options'][_0xb34b('0x18')]===undefined?!![]:![]:!![],'where':_0x4a17f2[_0xb34b('0x17')]?_0x4a17f2[_0xb34b('0x17')]['where']||null:null,'attributes':_0x4a17f2[_0xb34b('0x17')]?_0x4a17f2[_0xb34b('0x17')]['attributes']||null:null,'include':_0x4a17f2['options']?_0x4a17f2[_0xb34b('0x17')][_0xb34b('0x1c')]?_[_0xb34b('0x1d')](_0x4a17f2[_0xb34b('0x17')][_0xb34b('0x1c')],function(_0x1e22fa){return{'model':db[_0x1e22fa[_0xb34b('0x1e')]],'as':_0x1e22fa['as'],'attributes':_0x1e22fa[_0xb34b('0x1a')],'include':_0x1e22fa[_0xb34b('0x1c')]?_[_0xb34b('0x1d')](_0x1e22fa[_0xb34b('0x1c')],function(_0x561463){return{'model':db[_0x561463[_0xb34b('0x1e')]],'as':_0x561463['as'],'attributes':_0x561463[_0xb34b('0x1a')],'include':_0x561463['include']?_['map'](_0x561463['include'],function(_0x5aa591){return{'model':db[_0x5aa591[_0xb34b('0x1e')]],'as':_0x5aa591['as'],'attributes':_0x5aa591[_0xb34b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e6496){logger[_0xb34b('0xd')](_0xb34b('0x20'),_0x4a17f2);logger[_0xb34b('0x21')](_0xb34b('0x20'),_0x4a17f2,JSON[_0xb34b('0x10')](_0x4e6496));_0x3a74ab(_0x4e6496);})['catch'](function(_0xcca0c8){logger[_0xb34b('0x11')](_0xb34b('0x20'),_0xcca0c8[_0xb34b('0x12')],_0x4a17f2);_0x19b837(_0x191328[_0xb34b('0x11')](0x1f4,_0xcca0c8['message']));});});}; \ No newline at end of file +var _0x28f7=['message','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','map','model','stringify','ShowDynamics365Account','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x101383,_0x5bd543){var _0x46cfe9=function(_0x7e308a){while(--_0x7e308a){_0x101383['push'](_0x101383['shift']());}};_0x46cfe9(++_0x5bd543);}(_0x28f7,0x144));var _0x728f=function(_0x104511,_0x36386d){_0x104511=_0x104511-0x0;var _0x26fa19=_0x28f7[_0x104511];return _0x26fa19;};'use strict';var _=require(_0x728f('0x0'));var util=require('util');var moment=require(_0x728f('0x1'));var BPromise=require(_0x728f('0x2'));var rs=require(_0x728f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x728f('0x4'));var logger=require('../../config/logger')(_0x728f('0x5'));var config=require('../../config/environment');var jayson=require(_0x728f('0x6'));var client=jayson[_0x728f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2238a5,_0x220477,_0x4d3798){return new BPromise(function(_0x4c34d5,_0x54b4ff){return client[_0x728f('0x8')](_0x2238a5,_0x4d3798)[_0x728f('0x9')](function(_0x35bdf){logger[_0x728f('0xa')](_0x728f('0xb'),_0x220477,_0x728f('0xc'));logger[_0x728f('0xd')](_0x728f('0xe'),_0x220477,_0x728f('0xc'),JSON['stringify'](_0x35bdf));if(_0x35bdf['error']){if(_0x35bdf[_0x728f('0xf')][_0x728f('0x10')]===0x1f4){logger[_0x728f('0xf')](_0x728f('0xb'),_0x220477,_0x35bdf[_0x728f('0xf')][_0x728f('0x11')]);return _0x54b4ff(_0x35bdf[_0x728f('0xf')]['message']);}logger[_0x728f('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x220477,_0x35bdf[_0x728f('0xf')][_0x728f('0x11')]);return _0x4c34d5(_0x35bdf[_0x728f('0xf')]['message']);}else{logger[_0x728f('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x220477,_0x728f('0xc'));_0x4c34d5(_0x35bdf[_0x728f('0x12')][_0x728f('0x11')]);}})[_0x728f('0x13')](function(_0x23b299){logger[_0x728f('0xf')](_0x728f('0xb'),_0x220477,_0x23b299);_0x54b4ff(_0x23b299);});});}exports[_0x728f('0x14')]=function(_0x4871a7){var _0xca2fa6=this;return new Promise(function(_0x24d7e5,_0x20d1b){return db[_0x728f('0x15')]['findAll']({'raw':_0x4871a7[_0x728f('0x16')]?_0x4871a7[_0x728f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4871a7[_0x728f('0x16')]?_0x4871a7[_0x728f('0x16')][_0x728f('0x17')]||null:null,'attributes':_0x4871a7[_0x728f('0x16')]?_0x4871a7[_0x728f('0x16')][_0x728f('0x18')]||null:null,'limit':_0x4871a7['options']?_0x4871a7[_0x728f('0x16')][_0x728f('0x19')]||null:null,'include':_0x4871a7[_0x728f('0x16')]?_0x4871a7[_0x728f('0x16')][_0x728f('0x1a')]?_[_0x728f('0x1b')](_0x4871a7['options'][_0x728f('0x1a')],function(_0x68ec09){return{'model':db[_0x68ec09[_0x728f('0x1c')]],'as':_0x68ec09['as'],'attributes':_0x68ec09[_0x728f('0x18')],'include':_0x68ec09[_0x728f('0x1a')]?_['map'](_0x68ec09[_0x728f('0x1a')],function(_0x22ccc1){return{'model':db[_0x22ccc1[_0x728f('0x1c')]],'as':_0x22ccc1['as'],'attributes':_0x22ccc1['attributes'],'include':_0x22ccc1[_0x728f('0x1a')]?_['map'](_0x22ccc1[_0x728f('0x1a')],function(_0x451606){return{'model':db[_0x451606['model']],'as':_0x451606['as'],'attributes':_0x451606[_0x728f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1352ea){logger[_0x728f('0xa')](_0x728f('0x14'),_0x4871a7);logger[_0x728f('0xd')](_0x728f('0x14'),_0x4871a7,JSON[_0x728f('0x1d')](_0x1352ea));_0x24d7e5(_0x1352ea);})[_0x728f('0x13')](function(_0x508e0f){logger['error'](_0x728f('0x14'),_0x508e0f['message'],_0x4871a7);_0x20d1b(_0xca2fa6[_0x728f('0xf')](0x1f4,_0x508e0f[_0x728f('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x572217){var _0x5088d4=this;return new Promise(function(_0xd682aa,_0x2b7f34){return db[_0x728f('0x15')]['find']({'raw':_0x572217['options']?_0x572217[_0x728f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x572217['options']?_0x572217['options'][_0x728f('0x17')]||null:null,'attributes':_0x572217[_0x728f('0x16')]?_0x572217[_0x728f('0x16')]['attributes']||null:null,'include':_0x572217[_0x728f('0x16')]?_0x572217['options'][_0x728f('0x1a')]?_['map'](_0x572217[_0x728f('0x16')][_0x728f('0x1a')],function(_0x475ed6){return{'model':db[_0x475ed6['model']],'as':_0x475ed6['as'],'attributes':_0x475ed6[_0x728f('0x18')],'include':_0x475ed6[_0x728f('0x1a')]?_[_0x728f('0x1b')](_0x475ed6[_0x728f('0x1a')],function(_0x4cd120){return{'model':db[_0x4cd120[_0x728f('0x1c')]],'as':_0x4cd120['as'],'attributes':_0x4cd120[_0x728f('0x18')],'include':_0x4cd120[_0x728f('0x1a')]?_['map'](_0x4cd120[_0x728f('0x1a')],function(_0x4ceb8a){return{'model':db[_0x4ceb8a[_0x728f('0x1c')]],'as':_0x4ceb8a['as'],'attributes':_0x4ceb8a[_0x728f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x728f('0x9')](function(_0x2d1a53){logger[_0x728f('0xa')]('ShowDynamics365Account',_0x572217);logger[_0x728f('0xd')](_0x728f('0x1e'),_0x572217,JSON[_0x728f('0x1d')](_0x2d1a53));_0xd682aa(_0x2d1a53);})[_0x728f('0x13')](function(_0x47a3c1){logger[_0x728f('0xf')](_0x728f('0x1e'),_0x47a3c1[_0x728f('0x11')],_0x572217);_0x2b7f34(_0x5088d4['error'](0x1f4,_0x47a3c1['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0d7bae0..eca255d 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 _0x03be=['index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x57f5a3,_0x3768f5){var _0x32774d=function(_0x5f092e){while(--_0x5f092e){_0x57f5a3['push'](_0x57f5a3['shift']());}};_0x32774d(++_0x3768f5);}(_0x03be,0xe8));var _0xe03b=function(_0xdf1e8e,_0x168ec1){_0xdf1e8e=_0xdf1e8e-0x0;var _0x463576=_0x03be[_0xdf1e8e];return _0x463576;};'use strict';var multer=require(_0xe03b('0x0'));var util=require(_0xe03b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe03b('0x2'));var router=express[_0xe03b('0x3')]();var fs_extra=require(_0xe03b('0x4'));var auth=require(_0xe03b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe03b('0x6'));var controller=require(_0xe03b('0x7'));router[_0xe03b('0x8')]('/',auth[_0xe03b('0x9')](),controller[_0xe03b('0xa')]);router[_0xe03b('0x8')](_0xe03b('0xb'),auth[_0xe03b('0x9')](),controller['show']);router['get'](_0xe03b('0xc'),auth[_0xe03b('0x9')](),controller[_0xe03b('0xd')]);router[_0xe03b('0x8')](_0xe03b('0xe'),auth[_0xe03b('0x9')](),controller[_0xe03b('0xf')]);router[_0xe03b('0x8')](_0xe03b('0x10'),auth[_0xe03b('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xe03b('0x9')](),controller[_0xe03b('0x11')]);router[_0xe03b('0x12')](_0xe03b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe03b('0x13')](_0xe03b('0xb'),auth[_0xe03b('0x9')](),controller[_0xe03b('0x14')]);module[_0xe03b('0x15')]=router; \ No newline at end of file +var _0x27de=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./intDynamics365Configuration.controller','isAuthenticated','index','get'];(function(_0x5b148b,_0x328e12){var _0x2ef8c0=function(_0x4c4774){while(--_0x4c4774){_0x5b148b['push'](_0x5b148b['shift']());}};_0x2ef8c0(++_0x328e12);}(_0x27de,0x1b0));var _0xe27d=function(_0xadd133,_0x1bb157){_0xadd133=_0xadd133-0x0;var _0x4e3944=_0x27de[_0xadd133];return _0x4e3944;};'use strict';var multer=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var path=require('path');var timeout=require(_0xe27d('0x2'));var express=require('express');var router=express[_0xe27d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe27d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe27d('0x5'));router['get']('/',auth[_0xe27d('0x6')](),controller[_0xe27d('0x7')]);router[_0xe27d('0x8')]('/:id',auth[_0xe27d('0x6')](),controller[_0xe27d('0x9')]);router[_0xe27d('0x8')](_0xe27d('0xa'),auth[_0xe27d('0x6')](),controller[_0xe27d('0xb')]);router[_0xe27d('0x8')](_0xe27d('0xc'),auth[_0xe27d('0x6')](),controller[_0xe27d('0xd')]);router[_0xe27d('0x8')]('/:id/descriptions',auth[_0xe27d('0x6')](),controller[_0xe27d('0xe')]);router[_0xe27d('0xf')]('/',auth[_0xe27d('0x6')](),controller['create']);router[_0xe27d('0x10')](_0xe27d('0x11'),auth[_0xe27d('0x6')](),controller['update']);router[_0xe27d('0x12')]('/:id',auth[_0xe27d('0x6')](),controller[_0xe27d('0x13')]);module[_0xe27d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2b6e8fc..b01f02d 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 _0xbb3a=['phonecall','sequelize','exports','STRING'];(function(_0x43cd9f,_0x57d758){var _0x5cf244=function(_0xb0bd94){while(--_0xb0bd94){_0x43cd9f['push'](_0x43cd9f['shift']());}};_0x5cf244(++_0x57d758);}(_0xbb3a,0xed));var _0xabb3=function(_0x338c94,_0x3b27f9){_0x338c94=_0x338c94-0x0;var _0x3fa464=_0xbb3a[_0x338c94];return _0x3fa464;};'use strict';var Sequelize=require(_0xabb3('0x0'));module[_0xabb3('0x1')]={'name':{'type':Sequelize[_0xabb3('0x2')]},'description':{'type':Sequelize[_0xabb3('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0xabb3('0x3')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x7f22=['exports','STRING','incident','phonecall'];(function(_0x33e9fb,_0x1b4845){var _0x47ce20=function(_0xb45c49){while(--_0xb45c49){_0x33e9fb['push'](_0x33e9fb['shift']());}};_0x47ce20(++_0x1b4845);}(_0x7f22,0x1d8));var _0x27f2=function(_0x4c4342,_0x27f566){_0x4c4342=_0x4c4342-0x0;var _0x2ad900=_0x7f22[_0x4c4342];return _0x2ad900;};'use strict';var Sequelize=require('sequelize');module[_0x27f2('0x0')]={'name':{'type':Sequelize[_0x27f2('0x1')]},'description':{'type':Sequelize[_0x27f2('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x27f2('0x2'),_0x27f2('0x3')),'defaultValue':_0x27f2('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5a5f30d..5d93648 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 _0xfae9=['VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','Dynamics365Field','getSubjects','findOne','getDescriptions','options','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x580256,_0x3110ed){var _0x34e885=function(_0x2e2bd3){while(--_0x2e2bd3){_0x580256['push'](_0x580256['shift']());}};_0x34e885(++_0x3110ed);}(_0xfae9,0x1f0));var _0x9fae=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xfae9[_0x37e886];return _0x57c5cd;};'use strict';var emlformat=require(_0x9fae('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fae('0x1'));var rp=require(_0x9fae('0x2'));var moment=require(_0x9fae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9fae('0x4'));var util=require(_0x9fae('0x5'));var path=require(_0x9fae('0x6'));var sox=require('sox');var csv=require(_0x9fae('0x7'));var ejs=require(_0x9fae('0x8'));var fs=require('fs');var fs_extra=require(_0x9fae('0x9'));var _=require(_0x9fae('0xa'));var squel=require('squel');var crypto=require(_0x9fae('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9fae('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9fae('0xd'));var Papa=require(_0x9fae('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9fae('0xf'));var as=require(_0x9fae('0x10'));var hardwareService=require(_0x9fae('0x11'));var logger=require(_0x9fae('0x12'))(_0x9fae('0x13'));var utils=require(_0x9fae('0x14'));var config=require(_0x9fae('0x15'));var licenseUtil=require(_0x9fae('0x16'));var db=require(_0x9fae('0x17'))['db'];function respondWithStatusCode(_0xa5ed93,_0x370853){_0x370853=_0x370853||0xcc;return function(_0x5c7004){if(_0x5c7004){return _0xa5ed93['sendStatus'](_0x370853);}return _0xa5ed93[_0x9fae('0x18')](_0x370853)['end']();};}function respondWithResult(_0xc5e799,_0x1cf63f){_0x1cf63f=_0x1cf63f||0xc8;return function(_0x269917){if(_0x269917){return _0xc5e799[_0x9fae('0x18')](_0x1cf63f)['json'](_0x269917);}};}function respondWithFilteredResult(_0x5081bc,_0x4ea041){return function(_0x284824){if(_0x284824){var _0xa50647=typeof _0x4ea041[_0x9fae('0x19')]==='undefined'&&typeof _0x4ea041['limit']==='undefined';var _0x29bc7d=_0x284824[_0x9fae('0x1a')];var _0x4060a6=_0xa50647?0x0:_0x4ea041[_0x9fae('0x19')];var _0xe05ddb=_0xa50647?_0x284824[_0x9fae('0x1a')]:_0x4ea041[_0x9fae('0x19')]+_0x4ea041[_0x9fae('0x1b')];var _0x2f1472;if(_0xe05ddb>=_0x29bc7d){_0xe05ddb=_0x29bc7d;_0x2f1472=0xc8;}else{_0x2f1472=0xce;}_0x5081bc[_0x9fae('0x18')](_0x2f1472);return _0x5081bc[_0x9fae('0x1c')](_0x9fae('0x1d'),_0x4060a6+'-'+_0xe05ddb+'/'+_0x29bc7d)[_0x9fae('0x1e')](_0x284824);}return null;};}function patchUpdates(_0x4fb0ca){return function(_0x7a43da){try{jsonpatch[_0x9fae('0x1f')](_0x7a43da,_0x4fb0ca,!![]);}catch(_0x109ffc){return BPromise[_0x9fae('0x20')](_0x109ffc);}return _0x7a43da[_0x9fae('0x21')]();};}function saveUpdates(_0x1663e3,_0x1276ca){return function(_0xe8ef8b){if(_0xe8ef8b){return _0xe8ef8b[_0x9fae('0x22')](_0x1663e3)[_0x9fae('0x23')](function(_0x394d90){return _0x394d90;});}return null;};}function removeEntity(_0x33e3f9,_0x445423){return function(_0x4c4f66){if(_0x4c4f66){return _0x4c4f66[_0x9fae('0x24')]()['then'](function(){_0x33e3f9['status'](0xcc)[_0x9fae('0x25')]();});}};}function handleEntityNotFound(_0x12fd43,_0x3be79d){return function(_0x53af3f){if(!_0x53af3f){_0x12fd43[_0x9fae('0x26')](0x194);}return _0x53af3f;};}function handleError(_0x47f0b2,_0x82ba74){_0x82ba74=_0x82ba74||0x1f4;return function(_0x1f2903){logger[_0x9fae('0x27')](_0x1f2903['stack']);if(_0x1f2903[_0x9fae('0x28')]){delete _0x1f2903[_0x9fae('0x28')];}_0x47f0b2[_0x9fae('0x18')](_0x82ba74)[_0x9fae('0x29')](_0x1f2903);};}exports['index']=function(_0x2d2e5d,_0x43d729){var _0xc224da={},_0x11b1b9={},_0x534f3b={'count':0x0,'rows':[]};var _0x48b82a=_[_0x9fae('0x2a')](db[_0x9fae('0x2b')][_0x9fae('0x2c')],function(_0x2d9db0){return{'name':_0x2d9db0[_0x9fae('0x2d')],'type':_0x2d9db0[_0x9fae('0x2e')][_0x9fae('0x2f')]};});_0x11b1b9[_0x9fae('0x30')]=_[_0x9fae('0x2a')](_0x48b82a,_0x9fae('0x28'));_0x11b1b9[_0x9fae('0x31')]=_[_0x9fae('0x32')](_0x2d2e5d[_0x9fae('0x31')]);_0x11b1b9[_0x9fae('0x33')]=_[_0x9fae('0x34')](_0x11b1b9['model'],_0x11b1b9['query']);_0xc224da['attributes']=_['intersection'](_0x11b1b9[_0x9fae('0x30')],qs[_0x9fae('0x35')](_0x2d2e5d['query'][_0x9fae('0x35')]));_0xc224da[_0x9fae('0x36')]=_0xc224da[_0x9fae('0x36')][_0x9fae('0x37')]?_0xc224da[_0x9fae('0x36')]:_0x11b1b9[_0x9fae('0x30')];if(!_0x2d2e5d[_0x9fae('0x31')][_0x9fae('0x38')](_0x9fae('0x39'))){_0xc224da['limit']=qs[_0x9fae('0x1b')](_0x2d2e5d[_0x9fae('0x31')][_0x9fae('0x1b')]);_0xc224da['offset']=qs['offset'](_0x2d2e5d[_0x9fae('0x31')]['offset']);}_0xc224da[_0x9fae('0x3a')]=qs[_0x9fae('0x3b')](_0x2d2e5d[_0x9fae('0x31')]['sort']);_0xc224da['where']=qs[_0x9fae('0x33')](_[_0x9fae('0x3c')](_0x2d2e5d[_0x9fae('0x31')],_0x11b1b9[_0x9fae('0x33')]),_0x48b82a);if(_0x2d2e5d['query'][_0x9fae('0x3d')]){_0xc224da[_0x9fae('0x3e')]=_[_0x9fae('0x3f')](_0xc224da[_0x9fae('0x3e')],{'$or':_['map'](_0x48b82a,function(_0x3ecb44){if(_0x3ecb44[_0x9fae('0x2e')]!==_0x9fae('0x40')){var _0x5b0cf2={};_0x5b0cf2[_0x3ecb44[_0x9fae('0x28')]]={'$like':'%'+_0x2d2e5d['query']['filter']+'%'};return _0x5b0cf2;}})});}_0xc224da=_[_0x9fae('0x3f')]({},_0xc224da,_0x2d2e5d['options']);var _0x468089={'where':_0xc224da[_0x9fae('0x3e')]};return db[_0x9fae('0x2b')][_0x9fae('0x1a')](_0x468089)['then'](function(_0x5f065a){_0x534f3b[_0x9fae('0x1a')]=_0x5f065a;if(_0x2d2e5d['query'][_0x9fae('0x41')]){_0xc224da[_0x9fae('0x42')]=[{'all':!![]}];}return db[_0x9fae('0x2b')][_0x9fae('0x43')](_0xc224da);})[_0x9fae('0x23')](function(_0x44b23d){_0x534f3b[_0x9fae('0x44')]=_0x44b23d;return _0x534f3b;})[_0x9fae('0x23')](respondWithFilteredResult(_0x43d729,_0xc224da))[_0x9fae('0x45')](handleError(_0x43d729,null));};exports['show']=function(_0x47d498,_0x3f87e3){var _0x5f4825={'raw':![],'where':{'id':_0x47d498[_0x9fae('0x46')]['id']}},_0x49ac40={};_0x49ac40['model']=_[_0x9fae('0x32')](db[_0x9fae('0x2b')][_0x9fae('0x2c')]);_0x49ac40['query']=_['keys'](_0x47d498[_0x9fae('0x31')]);_0x49ac40['filters']=_[_0x9fae('0x34')](_0x49ac40[_0x9fae('0x30')],_0x49ac40[_0x9fae('0x31')]);_0x5f4825[_0x9fae('0x36')]=_[_0x9fae('0x34')](_0x49ac40[_0x9fae('0x30')],qs['fields'](_0x47d498[_0x9fae('0x31')][_0x9fae('0x35')]));_0x5f4825[_0x9fae('0x36')]=_0x5f4825['attributes'][_0x9fae('0x37')]?_0x5f4825[_0x9fae('0x36')]:_0x49ac40[_0x9fae('0x30')];if(_0x47d498[_0x9fae('0x31')][_0x9fae('0x41')]){_0x5f4825[_0x9fae('0x42')]=[{'all':!![]}];}_0x5f4825=_[_0x9fae('0x3f')]({},_0x5f4825,_0x47d498['options']);return db[_0x9fae('0x2b')][_0x9fae('0x47')](_0x5f4825)['then'](handleEntityNotFound(_0x3f87e3,null))[_0x9fae('0x23')](respondWithResult(_0x3f87e3,null))['catch'](handleError(_0x3f87e3,null));};exports[_0x9fae('0x48')]=function(_0x227f47,_0x1fb8be){return db[_0x9fae('0x2b')][_0x9fae('0x48')](_0x227f47[_0x9fae('0x49')],{})[_0x9fae('0x23')](respondWithResult(_0x1fb8be,0xc9))[_0x9fae('0x45')](handleError(_0x1fb8be,null));};exports['update']=function(_0x47b684,_0xba1652){if(_0x47b684[_0x9fae('0x49')]['id']){delete _0x47b684['body']['id'];}return db[_0x9fae('0x2b')][_0x9fae('0x47')]({'where':{'id':_0x47b684[_0x9fae('0x46')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0xba1652,null))[_0x9fae('0x23')](saveUpdates(_0x47b684[_0x9fae('0x49')],null))['then'](respondWithResult(_0xba1652,null))['catch'](handleError(_0xba1652,null));};exports[_0x9fae('0x24')]=function(_0x34ff02,_0x8186fb){return db[_0x9fae('0x2b')]['find']({'where':{'id':_0x34ff02[_0x9fae('0x46')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x8186fb,null))[_0x9fae('0x23')](removeEntity(_0x8186fb,null))['catch'](handleError(_0x8186fb,null));};exports[_0x9fae('0x4a')]=function(_0x5e03f9,_0x406471,_0x3079a3){var _0x22c1f3={};var _0x354728={};var _0x4399ec;var _0x5bcc08;return db[_0x9fae('0x2b')]['findOne']({'where':{'id':_0x5e03f9[_0x9fae('0x46')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x406471,null))[_0x9fae('0x23')](function(_0x555a63){if(_0x555a63){_0x4399ec=_0x555a63;_0x354728[_0x9fae('0x30')]=_['keys'](db[_0x9fae('0x4b')][_0x9fae('0x2c')]);_0x354728['query']=_[_0x9fae('0x32')](_0x5e03f9[_0x9fae('0x31')]);_0x354728['filters']=_[_0x9fae('0x34')](_0x354728[_0x9fae('0x30')],_0x354728['query']);_0x22c1f3[_0x9fae('0x36')]=_[_0x9fae('0x34')](_0x354728[_0x9fae('0x30')],qs[_0x9fae('0x35')](_0x5e03f9['query']['fields']));_0x22c1f3['attributes']=_0x22c1f3[_0x9fae('0x36')]['length']?_0x22c1f3[_0x9fae('0x36')]:_0x354728[_0x9fae('0x30')];_0x22c1f3[_0x9fae('0x3a')]=qs[_0x9fae('0x3b')](_0x5e03f9[_0x9fae('0x31')][_0x9fae('0x3b')]);_0x22c1f3[_0x9fae('0x3e')]=qs[_0x9fae('0x33')](_[_0x9fae('0x3c')](_0x5e03f9[_0x9fae('0x31')],_0x354728[_0x9fae('0x33')]));if(_0x5e03f9[_0x9fae('0x31')][_0x9fae('0x3d')]){_0x22c1f3[_0x9fae('0x3e')]=_[_0x9fae('0x3f')](_0x22c1f3[_0x9fae('0x3e')],{'$or':_[_0x9fae('0x2a')](_0x22c1f3[_0x9fae('0x36')],function(_0x1d5e7a){var _0x4efffb={};_0x4efffb[_0x1d5e7a]={'$like':'%'+_0x5e03f9['query'][_0x9fae('0x3d')]+'%'};return _0x4efffb;})});}_0x22c1f3=_['merge']({},_0x22c1f3,_0x5e03f9['options']);return _0x4399ec[_0x9fae('0x4a')](_0x22c1f3);}})[_0x9fae('0x23')](function(_0x18f746){if(_0x18f746){_0x5bcc08=_0x18f746['length'];if(!_0x5e03f9['query'][_0x9fae('0x38')](_0x9fae('0x39'))){_0x22c1f3[_0x9fae('0x1b')]=qs['limit'](_0x5e03f9['query'][_0x9fae('0x1b')]);_0x22c1f3['offset']=qs[_0x9fae('0x19')](_0x5e03f9['query'][_0x9fae('0x19')]);}return _0x4399ec[_0x9fae('0x4a')](_0x22c1f3);}})['then'](function(_0x4138db){if(_0x4138db){return _0x4138db?{'count':_0x5bcc08,'rows':_0x4138db}:null;}})[_0x9fae('0x23')](respondWithResult(_0x406471,null))['catch'](handleError(_0x406471,null));};exports[_0x9fae('0x4c')]=function(_0x21ea4b,_0x19d9ce,_0x576a3c){var _0x4d26be={};var _0x599f7c={};var _0x5a5026;var _0x28d002;return db[_0x9fae('0x2b')][_0x9fae('0x4d')]({'where':{'id':_0x21ea4b['params']['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x19d9ce,null))['then'](function(_0x1a1c6d){if(_0x1a1c6d){_0x5a5026=_0x1a1c6d;_0x599f7c[_0x9fae('0x30')]=_[_0x9fae('0x32')](db[_0x9fae('0x4b')][_0x9fae('0x2c')]);_0x599f7c['query']=_['keys'](_0x21ea4b[_0x9fae('0x31')]);_0x599f7c[_0x9fae('0x33')]=_[_0x9fae('0x34')](_0x599f7c[_0x9fae('0x30')],_0x599f7c[_0x9fae('0x31')]);_0x4d26be['attributes']=_[_0x9fae('0x34')](_0x599f7c[_0x9fae('0x30')],qs['fields'](_0x21ea4b[_0x9fae('0x31')][_0x9fae('0x35')]));_0x4d26be['attributes']=_0x4d26be['attributes']['length']?_0x4d26be[_0x9fae('0x36')]:_0x599f7c['model'];_0x4d26be[_0x9fae('0x3a')]=qs[_0x9fae('0x3b')](_0x21ea4b[_0x9fae('0x31')][_0x9fae('0x3b')]);_0x4d26be[_0x9fae('0x3e')]=qs[_0x9fae('0x33')](_[_0x9fae('0x3c')](_0x21ea4b['query'],_0x599f7c['filters']));if(_0x21ea4b[_0x9fae('0x31')]['filter']){_0x4d26be[_0x9fae('0x3e')]=_[_0x9fae('0x3f')](_0x4d26be['where'],{'$or':_[_0x9fae('0x2a')](_0x4d26be['attributes'],function(_0x16869d){var _0x5229c5={};_0x5229c5[_0x16869d]={'$like':'%'+_0x21ea4b['query'][_0x9fae('0x3d')]+'%'};return _0x5229c5;})});}_0x4d26be=_[_0x9fae('0x3f')]({},_0x4d26be,_0x21ea4b['options']);return _0x5a5026[_0x9fae('0x4c')](_0x4d26be);}})['then'](function(_0x586d81){if(_0x586d81){_0x28d002=_0x586d81['length'];if(!_0x21ea4b['query'][_0x9fae('0x38')]('nolimit')){_0x4d26be['limit']=qs['limit'](_0x21ea4b[_0x9fae('0x31')][_0x9fae('0x1b')]);_0x4d26be[_0x9fae('0x19')]=qs[_0x9fae('0x19')](_0x21ea4b['query']['offset']);}return _0x5a5026[_0x9fae('0x4c')](_0x4d26be);}})[_0x9fae('0x23')](function(_0x143244){if(_0x143244){return _0x143244?{'count':_0x28d002,'rows':_0x143244}:null;}})[_0x9fae('0x23')](respondWithResult(_0x19d9ce,null))[_0x9fae('0x45')](handleError(_0x19d9ce,null));};exports[_0x9fae('0x4e')]=function(_0x93546c,_0x15ffe8,_0x4ce008){var _0x36b1a0={};var _0x3d4478={};var _0x11caaf;var _0x35c436;return db['Dynamics365Configuration'][_0x9fae('0x4d')]({'where':{'id':_0x93546c['params']['id']}})['then'](handleEntityNotFound(_0x15ffe8,null))[_0x9fae('0x23')](function(_0x4c3d90){if(_0x4c3d90){_0x11caaf=_0x4c3d90;_0x3d4478[_0x9fae('0x30')]=_[_0x9fae('0x32')](db[_0x9fae('0x4b')][_0x9fae('0x2c')]);_0x3d4478[_0x9fae('0x31')]=_[_0x9fae('0x32')](_0x93546c[_0x9fae('0x31')]);_0x3d4478[_0x9fae('0x33')]=_['intersection'](_0x3d4478[_0x9fae('0x30')],_0x3d4478['query']);_0x36b1a0[_0x9fae('0x36')]=_[_0x9fae('0x34')](_0x3d4478[_0x9fae('0x30')],qs[_0x9fae('0x35')](_0x93546c[_0x9fae('0x31')][_0x9fae('0x35')]));_0x36b1a0[_0x9fae('0x36')]=_0x36b1a0[_0x9fae('0x36')][_0x9fae('0x37')]?_0x36b1a0[_0x9fae('0x36')]:_0x3d4478[_0x9fae('0x30')];_0x36b1a0[_0x9fae('0x3a')]=qs[_0x9fae('0x3b')](_0x93546c['query'][_0x9fae('0x3b')]);_0x36b1a0[_0x9fae('0x3e')]=qs[_0x9fae('0x33')](_[_0x9fae('0x3c')](_0x93546c[_0x9fae('0x31')],_0x3d4478[_0x9fae('0x33')]));if(_0x93546c[_0x9fae('0x31')][_0x9fae('0x3d')]){_0x36b1a0[_0x9fae('0x3e')]=_[_0x9fae('0x3f')](_0x36b1a0[_0x9fae('0x3e')],{'$or':_[_0x9fae('0x2a')](_0x36b1a0[_0x9fae('0x36')],function(_0x130259){var _0x25e4db={};_0x25e4db[_0x130259]={'$like':'%'+_0x93546c['query']['filter']+'%'};return _0x25e4db;})});}_0x36b1a0=_[_0x9fae('0x3f')]({},_0x36b1a0,_0x93546c[_0x9fae('0x4f')]);return _0x11caaf[_0x9fae('0x4e')](_0x36b1a0);}})['then'](function(_0x44ef8b){if(_0x44ef8b){_0x35c436=_0x44ef8b[_0x9fae('0x37')];if(!_0x93546c[_0x9fae('0x31')]['hasOwnProperty']('nolimit')){_0x36b1a0[_0x9fae('0x1b')]=qs['limit'](_0x93546c[_0x9fae('0x31')][_0x9fae('0x1b')]);_0x36b1a0[_0x9fae('0x19')]=qs[_0x9fae('0x19')](_0x93546c[_0x9fae('0x31')]['offset']);}return _0x11caaf['getDescriptions'](_0x36b1a0);}})[_0x9fae('0x23')](function(_0x4c9057){if(_0x4c9057){return _0x4c9057?{'count':_0x35c436,'rows':_0x4c9057}:null;}})[_0x9fae('0x23')](respondWithResult(_0x15ffe8,null))[_0x9fae('0x45')](handleError(_0x15ffe8,null));}; \ No newline at end of file +var _0x067a=['apply','save','update','destroy','then','error','name','send','index','Dynamics365Configuration','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getFields','order','pick','Dynamics365Field','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x1cf41d,_0x220141){var _0x470492=function(_0xf8488a){while(--_0xf8488a){_0x1cf41d['push'](_0x1cf41d['shift']());}};_0x470492(++_0x220141);}(_0x067a,0x1ce));var _0xa067=function(_0x36c928,_0x551a4c){_0x36c928=_0x36c928-0x0;var _0x12ebd8=_0x067a[_0x36c928];return _0x12ebd8;};'use strict';var emlformat=require(_0xa067('0x0'));var rimraf=require(_0xa067('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa067('0x2'));var rp=require(_0xa067('0x3'));var moment=require(_0xa067('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa067('0x5'));var util=require(_0xa067('0x6'));var path=require(_0xa067('0x7'));var sox=require(_0xa067('0x8'));var csv=require(_0xa067('0x9'));var ejs=require(_0xa067('0xa'));var fs=require('fs');var fs_extra=require(_0xa067('0xb'));var _=require(_0xa067('0xc'));var squel=require(_0xa067('0xd'));var crypto=require(_0xa067('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa067('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa067('0x10'));var Papa=require(_0xa067('0x11'));var Redis=require(_0xa067('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa067('0x13'));var as=require(_0xa067('0x14'));var hardwareService=require(_0xa067('0x15'));var logger=require(_0xa067('0x16'))(_0xa067('0x17'));var utils=require('../../config/utils');var config=require(_0xa067('0x18'));var licenseUtil=require(_0xa067('0x19'));var db=require(_0xa067('0x1a'))['db'];function respondWithStatusCode(_0x5447f8,_0x4e2087){_0x4e2087=_0x4e2087||0xcc;return function(_0x4cc6bb){if(_0x4cc6bb){return _0x5447f8[_0xa067('0x1b')](_0x4e2087);}return _0x5447f8['status'](_0x4e2087)[_0xa067('0x1c')]();};}function respondWithResult(_0x29487d,_0x1922f2){_0x1922f2=_0x1922f2||0xc8;return function(_0x4f91c6){if(_0x4f91c6){return _0x29487d[_0xa067('0x1d')](_0x1922f2)[_0xa067('0x1e')](_0x4f91c6);}};}function respondWithFilteredResult(_0x57c3b2,_0x2d57a1){return function(_0xc564ad){if(_0xc564ad){var _0x3f1c81=typeof _0x2d57a1[_0xa067('0x1f')]==='undefined'&&typeof _0x2d57a1[_0xa067('0x20')]===_0xa067('0x21');var _0x1f6e1b=_0xc564ad[_0xa067('0x22')];var _0x598926=_0x3f1c81?0x0:_0x2d57a1[_0xa067('0x1f')];var _0xc53ef3=_0x3f1c81?_0xc564ad[_0xa067('0x22')]:_0x2d57a1[_0xa067('0x1f')]+_0x2d57a1[_0xa067('0x20')];var _0x23ba74;if(_0xc53ef3>=_0x1f6e1b){_0xc53ef3=_0x1f6e1b;_0x23ba74=0xc8;}else{_0x23ba74=0xce;}_0x57c3b2[_0xa067('0x1d')](_0x23ba74);return _0x57c3b2[_0xa067('0x23')]('Content-Range',_0x598926+'-'+_0xc53ef3+'/'+_0x1f6e1b)[_0xa067('0x1e')](_0xc564ad);}return null;};}function patchUpdates(_0x3e2731){return function(_0x135b56){try{jsonpatch[_0xa067('0x24')](_0x135b56,_0x3e2731,!![]);}catch(_0x384532){return BPromise['reject'](_0x384532);}return _0x135b56[_0xa067('0x25')]();};}function saveUpdates(_0x341820,_0x1ff1cf){return function(_0x3966bb){if(_0x3966bb){return _0x3966bb[_0xa067('0x26')](_0x341820)['then'](function(_0x40b046){return _0x40b046;});}return null;};}function removeEntity(_0x15ed5f,_0x4984d6){return function(_0x838347){if(_0x838347){return _0x838347[_0xa067('0x27')]()[_0xa067('0x28')](function(){_0x15ed5f[_0xa067('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c212,_0x470fc5){return function(_0x3e4aa8){if(!_0x3e4aa8){_0x33c212[_0xa067('0x1b')](0x194);}return _0x3e4aa8;};}function handleError(_0x441e65,_0x1b3c53){_0x1b3c53=_0x1b3c53||0x1f4;return function(_0x1b76d5){logger[_0xa067('0x29')](_0x1b76d5['stack']);if(_0x1b76d5[_0xa067('0x2a')]){delete _0x1b76d5[_0xa067('0x2a')];}_0x441e65[_0xa067('0x1d')](_0x1b3c53)[_0xa067('0x2b')](_0x1b76d5);};}exports[_0xa067('0x2c')]=function(_0x590b79,_0x3e5caf){var _0x8d7596={},_0x1ffa16={},_0x2c23f4={'count':0x0,'rows':[]};var _0x3d4b79=_['map'](db[_0xa067('0x2d')][_0xa067('0x2e')],function(_0x4d3163){return{'name':_0x4d3163['fieldName'],'type':_0x4d3163['type'][_0xa067('0x2f')]};});_0x1ffa16['model']=_[_0xa067('0x30')](_0x3d4b79,_0xa067('0x2a'));_0x1ffa16[_0xa067('0x31')]=_[_0xa067('0x32')](_0x590b79['query']);_0x1ffa16[_0xa067('0x33')]=_[_0xa067('0x34')](_0x1ffa16[_0xa067('0x35')],_0x1ffa16[_0xa067('0x31')]);_0x8d7596['attributes']=_[_0xa067('0x34')](_0x1ffa16[_0xa067('0x35')],qs[_0xa067('0x36')](_0x590b79['query'][_0xa067('0x36')]));_0x8d7596[_0xa067('0x37')]=_0x8d7596[_0xa067('0x37')][_0xa067('0x38')]?_0x8d7596[_0xa067('0x37')]:_0x1ffa16[_0xa067('0x35')];if(!_0x590b79[_0xa067('0x31')][_0xa067('0x39')](_0xa067('0x3a'))){_0x8d7596[_0xa067('0x20')]=qs['limit'](_0x590b79[_0xa067('0x31')][_0xa067('0x20')]);_0x8d7596[_0xa067('0x1f')]=qs[_0xa067('0x1f')](_0x590b79[_0xa067('0x31')]['offset']);}_0x8d7596['order']=qs[_0xa067('0x3b')](_0x590b79[_0xa067('0x31')][_0xa067('0x3b')]);_0x8d7596[_0xa067('0x3c')]=qs[_0xa067('0x33')](_['pick'](_0x590b79[_0xa067('0x31')],_0x1ffa16[_0xa067('0x33')]),_0x3d4b79);if(_0x590b79[_0xa067('0x31')][_0xa067('0x3d')]){_0x8d7596['where']=_[_0xa067('0x3e')](_0x8d7596[_0xa067('0x3c')],{'$or':_['map'](_0x3d4b79,function(_0x52bb0d){if(_0x52bb0d[_0xa067('0x3f')]!==_0xa067('0x40')){var _0x3a2aae={};_0x3a2aae[_0x52bb0d[_0xa067('0x2a')]]={'$like':'%'+_0x590b79[_0xa067('0x31')]['filter']+'%'};return _0x3a2aae;}})});}_0x8d7596=_[_0xa067('0x3e')]({},_0x8d7596,_0x590b79[_0xa067('0x41')]);var _0x53a0ab={'where':_0x8d7596[_0xa067('0x3c')]};return db[_0xa067('0x2d')][_0xa067('0x22')](_0x53a0ab)[_0xa067('0x28')](function(_0x5d2053){_0x2c23f4[_0xa067('0x22')]=_0x5d2053;if(_0x590b79[_0xa067('0x31')][_0xa067('0x42')]){_0x8d7596['include']=[{'all':!![]}];}return db[_0xa067('0x2d')][_0xa067('0x43')](_0x8d7596);})[_0xa067('0x28')](function(_0x55a59c){_0x2c23f4[_0xa067('0x44')]=_0x55a59c;return _0x2c23f4;})[_0xa067('0x28')](respondWithFilteredResult(_0x3e5caf,_0x8d7596))[_0xa067('0x45')](handleError(_0x3e5caf,null));};exports[_0xa067('0x46')]=function(_0x17dc01,_0x115f03){var _0x1ad7f7={'raw':![],'where':{'id':_0x17dc01['params']['id']}},_0x19d328={};_0x19d328['model']=_[_0xa067('0x32')](db['Dynamics365Configuration'][_0xa067('0x2e')]);_0x19d328[_0xa067('0x31')]=_[_0xa067('0x32')](_0x17dc01['query']);_0x19d328['filters']=_[_0xa067('0x34')](_0x19d328['model'],_0x19d328[_0xa067('0x31')]);_0x1ad7f7[_0xa067('0x37')]=_[_0xa067('0x34')](_0x19d328[_0xa067('0x35')],qs[_0xa067('0x36')](_0x17dc01['query'][_0xa067('0x36')]));_0x1ad7f7[_0xa067('0x37')]=_0x1ad7f7[_0xa067('0x37')][_0xa067('0x38')]?_0x1ad7f7['attributes']:_0x19d328[_0xa067('0x35')];if(_0x17dc01[_0xa067('0x31')][_0xa067('0x42')]){_0x1ad7f7[_0xa067('0x47')]=[{'all':!![]}];}_0x1ad7f7=_[_0xa067('0x3e')]({},_0x1ad7f7,_0x17dc01[_0xa067('0x41')]);return db[_0xa067('0x2d')][_0xa067('0x48')](_0x1ad7f7)['then'](handleEntityNotFound(_0x115f03,null))['then'](respondWithResult(_0x115f03,null))[_0xa067('0x45')](handleError(_0x115f03,null));};exports[_0xa067('0x49')]=function(_0x57e3ea,_0x124a6c){return db['Dynamics365Configuration']['create'](_0x57e3ea[_0xa067('0x4a')],{})[_0xa067('0x28')](respondWithResult(_0x124a6c,0xc9))[_0xa067('0x45')](handleError(_0x124a6c,null));};exports[_0xa067('0x26')]=function(_0x54f8ef,_0xa671ae){if(_0x54f8ef[_0xa067('0x4a')]['id']){delete _0x54f8ef[_0xa067('0x4a')]['id'];}return db[_0xa067('0x2d')][_0xa067('0x48')]({'where':{'id':_0x54f8ef[_0xa067('0x4b')]['id']}})[_0xa067('0x28')](handleEntityNotFound(_0xa671ae,null))['then'](saveUpdates(_0x54f8ef[_0xa067('0x4a')],null))[_0xa067('0x28')](respondWithResult(_0xa671ae,null))['catch'](handleError(_0xa671ae,null));};exports[_0xa067('0x27')]=function(_0x3e977c,_0x308cf7){return db[_0xa067('0x2d')][_0xa067('0x48')]({'where':{'id':_0x3e977c[_0xa067('0x4b')]['id']}})[_0xa067('0x28')](handleEntityNotFound(_0x308cf7,null))[_0xa067('0x28')](removeEntity(_0x308cf7,null))[_0xa067('0x45')](handleError(_0x308cf7,null));};exports[_0xa067('0x4c')]=function(_0x59083d,_0x41397e,_0x23ccc1){var _0x7aa7d8={};var _0x1cedff={};var _0x58a98c;var _0x302db1;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x59083d[_0xa067('0x4b')]['id']}})[_0xa067('0x28')](handleEntityNotFound(_0x41397e,null))[_0xa067('0x28')](function(_0x422298){if(_0x422298){_0x58a98c=_0x422298;_0x1cedff['model']=_[_0xa067('0x32')](db['Dynamics365Field'][_0xa067('0x2e')]);_0x1cedff[_0xa067('0x31')]=_[_0xa067('0x32')](_0x59083d[_0xa067('0x31')]);_0x1cedff[_0xa067('0x33')]=_[_0xa067('0x34')](_0x1cedff[_0xa067('0x35')],_0x1cedff[_0xa067('0x31')]);_0x7aa7d8[_0xa067('0x37')]=_[_0xa067('0x34')](_0x1cedff[_0xa067('0x35')],qs['fields'](_0x59083d[_0xa067('0x31')]['fields']));_0x7aa7d8[_0xa067('0x37')]=_0x7aa7d8['attributes'][_0xa067('0x38')]?_0x7aa7d8[_0xa067('0x37')]:_0x1cedff['model'];_0x7aa7d8[_0xa067('0x4d')]=qs[_0xa067('0x3b')](_0x59083d[_0xa067('0x31')][_0xa067('0x3b')]);_0x7aa7d8[_0xa067('0x3c')]=qs['filters'](_[_0xa067('0x4e')](_0x59083d[_0xa067('0x31')],_0x1cedff[_0xa067('0x33')]));if(_0x59083d[_0xa067('0x31')][_0xa067('0x3d')]){_0x7aa7d8['where']=_[_0xa067('0x3e')](_0x7aa7d8[_0xa067('0x3c')],{'$or':_[_0xa067('0x30')](_0x7aa7d8[_0xa067('0x37')],function(_0x400db0){var _0x24befd={};_0x24befd[_0x400db0]={'$like':'%'+_0x59083d['query'][_0xa067('0x3d')]+'%'};return _0x24befd;})});}_0x7aa7d8=_[_0xa067('0x3e')]({},_0x7aa7d8,_0x59083d[_0xa067('0x41')]);return _0x58a98c['getFields'](_0x7aa7d8);}})[_0xa067('0x28')](function(_0x5f0d0e){if(_0x5f0d0e){_0x302db1=_0x5f0d0e[_0xa067('0x38')];if(!_0x59083d[_0xa067('0x31')][_0xa067('0x39')](_0xa067('0x3a'))){_0x7aa7d8[_0xa067('0x20')]=qs[_0xa067('0x20')](_0x59083d['query'][_0xa067('0x20')]);_0x7aa7d8[_0xa067('0x1f')]=qs['offset'](_0x59083d[_0xa067('0x31')][_0xa067('0x1f')]);}return _0x58a98c[_0xa067('0x4c')](_0x7aa7d8);}})[_0xa067('0x28')](function(_0x4ae4c9){if(_0x4ae4c9){return _0x4ae4c9?{'count':_0x302db1,'rows':_0x4ae4c9}:null;}})['then'](respondWithResult(_0x41397e,null))[_0xa067('0x45')](handleError(_0x41397e,null));};exports['getSubjects']=function(_0x1ebb5e,_0x48b90e,_0x32ce04){var _0x2ee6f0={};var _0x25820a={};var _0x55130e;var _0x3e801d;return db[_0xa067('0x2d')]['findOne']({'where':{'id':_0x1ebb5e[_0xa067('0x4b')]['id']}})[_0xa067('0x28')](handleEntityNotFound(_0x48b90e,null))[_0xa067('0x28')](function(_0x273112){if(_0x273112){_0x55130e=_0x273112;_0x25820a[_0xa067('0x35')]=_[_0xa067('0x32')](db[_0xa067('0x4f')][_0xa067('0x2e')]);_0x25820a[_0xa067('0x31')]=_['keys'](_0x1ebb5e[_0xa067('0x31')]);_0x25820a[_0xa067('0x33')]=_[_0xa067('0x34')](_0x25820a[_0xa067('0x35')],_0x25820a[_0xa067('0x31')]);_0x2ee6f0[_0xa067('0x37')]=_[_0xa067('0x34')](_0x25820a['model'],qs['fields'](_0x1ebb5e[_0xa067('0x31')][_0xa067('0x36')]));_0x2ee6f0['attributes']=_0x2ee6f0[_0xa067('0x37')]['length']?_0x2ee6f0[_0xa067('0x37')]:_0x25820a['model'];_0x2ee6f0['order']=qs['sort'](_0x1ebb5e[_0xa067('0x31')][_0xa067('0x3b')]);_0x2ee6f0[_0xa067('0x3c')]=qs['filters'](_[_0xa067('0x4e')](_0x1ebb5e[_0xa067('0x31')],_0x25820a[_0xa067('0x33')]));if(_0x1ebb5e[_0xa067('0x31')][_0xa067('0x3d')]){_0x2ee6f0[_0xa067('0x3c')]=_[_0xa067('0x3e')](_0x2ee6f0[_0xa067('0x3c')],{'$or':_[_0xa067('0x30')](_0x2ee6f0[_0xa067('0x37')],function(_0x426269){var _0x46249d={};_0x46249d[_0x426269]={'$like':'%'+_0x1ebb5e['query'][_0xa067('0x3d')]+'%'};return _0x46249d;})});}_0x2ee6f0=_['merge']({},_0x2ee6f0,_0x1ebb5e[_0xa067('0x41')]);return _0x55130e['getSubjects'](_0x2ee6f0);}})['then'](function(_0x4bdd39){if(_0x4bdd39){_0x3e801d=_0x4bdd39[_0xa067('0x38')];if(!_0x1ebb5e[_0xa067('0x31')]['hasOwnProperty'](_0xa067('0x3a'))){_0x2ee6f0['limit']=qs[_0xa067('0x20')](_0x1ebb5e[_0xa067('0x31')]['limit']);_0x2ee6f0[_0xa067('0x1f')]=qs[_0xa067('0x1f')](_0x1ebb5e[_0xa067('0x31')]['offset']);}return _0x55130e[_0xa067('0x50')](_0x2ee6f0);}})['then'](function(_0x170fc7){if(_0x170fc7){return _0x170fc7?{'count':_0x3e801d,'rows':_0x170fc7}:null;}})[_0xa067('0x28')](respondWithResult(_0x48b90e,null))[_0xa067('0x45')](handleError(_0x48b90e,null));};exports[_0xa067('0x51')]=function(_0x2ad691,_0x3d39a1,_0x10c8e0){var _0x4c7c9b={};var _0x16c825={};var _0x2eee0f;var _0x46ac3f;return db[_0xa067('0x2d')][_0xa067('0x52')]({'where':{'id':_0x2ad691['params']['id']}})[_0xa067('0x28')](handleEntityNotFound(_0x3d39a1,null))['then'](function(_0x17ca39){if(_0x17ca39){_0x2eee0f=_0x17ca39;_0x16c825[_0xa067('0x35')]=_['keys'](db[_0xa067('0x4f')][_0xa067('0x2e')]);_0x16c825['query']=_[_0xa067('0x32')](_0x2ad691[_0xa067('0x31')]);_0x16c825[_0xa067('0x33')]=_[_0xa067('0x34')](_0x16c825[_0xa067('0x35')],_0x16c825['query']);_0x4c7c9b[_0xa067('0x37')]=_[_0xa067('0x34')](_0x16c825[_0xa067('0x35')],qs[_0xa067('0x36')](_0x2ad691[_0xa067('0x31')]['fields']));_0x4c7c9b['attributes']=_0x4c7c9b[_0xa067('0x37')][_0xa067('0x38')]?_0x4c7c9b[_0xa067('0x37')]:_0x16c825[_0xa067('0x35')];_0x4c7c9b[_0xa067('0x4d')]=qs[_0xa067('0x3b')](_0x2ad691[_0xa067('0x31')]['sort']);_0x4c7c9b[_0xa067('0x3c')]=qs[_0xa067('0x33')](_[_0xa067('0x4e')](_0x2ad691[_0xa067('0x31')],_0x16c825[_0xa067('0x33')]));if(_0x2ad691[_0xa067('0x31')][_0xa067('0x3d')]){_0x4c7c9b[_0xa067('0x3c')]=_[_0xa067('0x3e')](_0x4c7c9b[_0xa067('0x3c')],{'$or':_['map'](_0x4c7c9b[_0xa067('0x37')],function(_0x23f549){var _0x40cd4b={};_0x40cd4b[_0x23f549]={'$like':'%'+_0x2ad691[_0xa067('0x31')][_0xa067('0x3d')]+'%'};return _0x40cd4b;})});}_0x4c7c9b=_['merge']({},_0x4c7c9b,_0x2ad691['options']);return _0x2eee0f[_0xa067('0x51')](_0x4c7c9b);}})[_0xa067('0x28')](function(_0x48cac5){if(_0x48cac5){_0x46ac3f=_0x48cac5[_0xa067('0x38')];if(!_0x2ad691[_0xa067('0x31')][_0xa067('0x39')](_0xa067('0x3a'))){_0x4c7c9b[_0xa067('0x20')]=qs['limit'](_0x2ad691[_0xa067('0x31')][_0xa067('0x20')]);_0x4c7c9b[_0xa067('0x1f')]=qs[_0xa067('0x1f')](_0x2ad691[_0xa067('0x31')][_0xa067('0x1f')]);}return _0x2eee0f[_0xa067('0x51')](_0x4c7c9b);}})[_0xa067('0x28')](function(_0x1f3c6b){if(_0x1f3c6b){return _0x1f3c6b?{'count':_0x46ac3f,'rows':_0x1f3c6b}:null;}})[_0xa067('0x28')](respondWithResult(_0x3d39a1,null))['catch'](handleError(_0x3d39a1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 47fad0c..7ce7344 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xe2bf84,_0x3eeed5){var _0x2fce53=function(_0x2e65e5){while(--_0x2e65e5){_0xe2bf84['push'](_0xe2bf84['shift']());}};_0x2fce53(++_0x3eeed5);}(_0xdace,0xc5));var _0xedac=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xdace[_0x2f3848];return _0x102668;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x1e3216,_0x4717b3){var _0x20af31=function(_0x357319){while(--_0x357319){_0x1e3216['push'](_0x1e3216['shift']());}};_0x20af31(++_0x4717b3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3e1950,_0x5fb0fe){_0x3e1950=_0x3e1950-0x0;var _0x28c924=_0x9bde[_0x3e1950];return _0x28c924;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 09a4eea..739e414 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 _0x6038=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3f85a0,_0x29b121){var _0x3cb9ee=function(_0x4a4b94){while(--_0x4a4b94){_0x3f85a0['push'](_0x3f85a0['shift']());}};_0x3cb9ee(++_0x29b121);}(_0x6038,0x127));var _0x8603=function(_0xf9cdbe,_0x1a692c){_0xf9cdbe=_0xf9cdbe-0x0;var _0x47b102=_0x6038[_0xf9cdbe];return _0x47b102;};'use strict';var _=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var moment=require(_0x8603('0x2'));var BPromise=require(_0x8603('0x3'));var rs=require(_0x8603('0x4'));var fs=require('fs');var Redis=require(_0x8603('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8603('0x6'))(_0x8603('0x7'));var config=require(_0x8603('0x8'));var jayson=require(_0x8603('0x9'));var client=jayson[_0x8603('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7bd1b4,_0x1cd82b,_0x4c12ec){return new BPromise(function(_0x4d67f8,_0x3c2adb){return client['request'](_0x7bd1b4,_0x4c12ec)[_0x8603('0xb')](function(_0x20d36e){logger[_0x8603('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1cd82b,_0x8603('0xd'));logger['debug'](_0x8603('0xe'),_0x1cd82b,'request\x20sent',JSON['stringify'](_0x20d36e));if(_0x20d36e['error']){if(_0x20d36e[_0x8603('0xf')]['code']===0x1f4){logger['error'](_0x8603('0x10'),_0x1cd82b,_0x20d36e[_0x8603('0xf')][_0x8603('0x11')]);return _0x3c2adb(_0x20d36e[_0x8603('0xf')][_0x8603('0x11')]);}logger[_0x8603('0xf')](_0x8603('0x10'),_0x1cd82b,_0x20d36e['error']['message']);return _0x4d67f8(_0x20d36e[_0x8603('0xf')]['message']);}else{logger[_0x8603('0xc')](_0x8603('0x10'),_0x1cd82b,'request\x20sent');_0x4d67f8(_0x20d36e[_0x8603('0x12')]['message']);}})[_0x8603('0x13')](function(_0x5ba885){logger[_0x8603('0xf')](_0x8603('0x10'),_0x1cd82b,_0x5ba885);_0x3c2adb(_0x5ba885);});});} \ No newline at end of file +var _0xddb8=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xddb8,0x117));var _0x8ddb=function(_0x5ae4c9,_0x48ab22){_0x5ae4c9=_0x5ae4c9-0x0;var _0x54963e=_0xddb8[_0x5ae4c9];return _0x54963e;};'use strict';var _=require(_0x8ddb('0x0'));var util=require(_0x8ddb('0x1'));var moment=require('moment');var BPromise=require(_0x8ddb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ddb('0x3'));var db=require(_0x8ddb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ddb('0x5'));var config=require(_0x8ddb('0x6'));var jayson=require(_0x8ddb('0x7'));var client=jayson[_0x8ddb('0x8')][_0x8ddb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41991d,_0x2f7a17,_0x10d2c9){return new BPromise(function(_0x28a7e1,_0x4db991){return client[_0x8ddb('0xa')](_0x41991d,_0x10d2c9)['then'](function(_0x51ca17){logger[_0x8ddb('0xb')](_0x8ddb('0xc'),_0x2f7a17,_0x8ddb('0xd'));logger[_0x8ddb('0xe')](_0x8ddb('0xf'),_0x2f7a17,'request\x20sent',JSON[_0x8ddb('0x10')](_0x51ca17));if(_0x51ca17['error']){if(_0x51ca17[_0x8ddb('0x11')]['code']===0x1f4){logger[_0x8ddb('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2f7a17,_0x51ca17[_0x8ddb('0x11')][_0x8ddb('0x12')]);return _0x4db991(_0x51ca17[_0x8ddb('0x11')][_0x8ddb('0x12')]);}logger[_0x8ddb('0x11')](_0x8ddb('0xc'),_0x2f7a17,_0x51ca17[_0x8ddb('0x11')][_0x8ddb('0x12')]);return _0x28a7e1(_0x51ca17['error'][_0x8ddb('0x12')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2f7a17,'request\x20sent');_0x28a7e1(_0x51ca17['result']['message']);}})[_0x8ddb('0x13')](function(_0x340f5e){logger['error'](_0x8ddb('0xc'),_0x2f7a17,_0x340f5e);_0x4db991(_0x340f5e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 0c42920..97f103f 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 _0xc464=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy'];(function(_0x1994b0,_0xc9aedb){var _0x4e8009=function(_0x20d35a){while(--_0x20d35a){_0x1994b0['push'](_0x1994b0['shift']());}};_0x4e8009(++_0xc9aedb);}(_0xc464,0xab));var _0x4c46=function(_0x3f79eb,_0x2c9370){_0x3f79eb=_0x3f79eb-0x0;var _0x5bbefe=_0xc464[_0x3f79eb];return _0x5bbefe;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4c46('0x0'));var express=require(_0x4c46('0x1'));var router=express[_0x4c46('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4c46('0x3'));var interaction=require(_0x4c46('0x4'));var config=require(_0x4c46('0x5'));var controller=require(_0x4c46('0x6'));router['get']('/',auth[_0x4c46('0x7')](),controller[_0x4c46('0x8')]);router[_0x4c46('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4c46('0xa')]);router[_0x4c46('0xb')]('/',auth[_0x4c46('0x7')](),controller['create']);router['put'](_0x4c46('0xc'),auth[_0x4c46('0x7')](),controller[_0x4c46('0xd')]);router[_0x4c46('0xe')](_0x4c46('0xc'),auth[_0x4c46('0x7')](),controller[_0x4c46('0xf')]);module[_0x4c46('0x10')]=router; \ No newline at end of file +var _0x7afc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27417a,_0x501ed9){var _0x5b8247=function(_0x36016e){while(--_0x36016e){_0x27417a['push'](_0x27417a['shift']());}};_0x5b8247(++_0x501ed9);}(_0x7afc,0x70));var _0xc7af=function(_0x3ee5cd,_0x3023f6){_0x3ee5cd=_0x3ee5cd-0x0;var _0x593fa4=_0x7afc[_0x3ee5cd];return _0x593fa4;};'use strict';var multer=require(_0xc7af('0x0'));var util=require(_0xc7af('0x1'));var path=require(_0xc7af('0x2'));var timeout=require(_0xc7af('0x3'));var express=require(_0xc7af('0x4'));var router=express[_0xc7af('0x5')]();var fs_extra=require(_0xc7af('0x6'));var auth=require(_0xc7af('0x7'));var interaction=require(_0xc7af('0x8'));var config=require(_0xc7af('0x9'));var controller=require(_0xc7af('0xa'));router['get']('/',auth[_0xc7af('0xb')](),controller[_0xc7af('0xc')]);router[_0xc7af('0xd')](_0xc7af('0xe'),auth[_0xc7af('0xb')](),controller[_0xc7af('0xf')]);router[_0xc7af('0x10')]('/',auth[_0xc7af('0xb')](),controller[_0xc7af('0x11')]);router[_0xc7af('0x12')](_0xc7af('0xe'),auth[_0xc7af('0xb')](),controller[_0xc7af('0x13')]);router[_0xc7af('0x14')]('/:id',auth[_0xc7af('0xb')](),controller[_0xc7af('0x15')]);module[_0xc7af('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index b7ad11a..c375924 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 _0xe1d7=['STRING','string','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x55c072,_0xc15413){var _0x48087b=function(_0x1b2a38){while(--_0x1b2a38){_0x55c072['push'](_0x55c072['shift']());}};_0x48087b(++_0xc15413);}(_0xe1d7,0xa5));var _0x7e1d=function(_0x1a663e,_0x357c47){_0x1a663e=_0x1a663e-0x0;var _0x4055ab=_0xe1d7[_0x1a663e];return _0x4055ab;};'use strict';var Sequelize=require('sequelize');module[_0x7e1d('0x0')]={'type':{'type':Sequelize[_0x7e1d('0x1')]('string',_0x7e1d('0x2'),_0x7e1d('0x3'),_0x7e1d('0x4'),_0x7e1d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7e1d('0x6')]},'key':{'type':Sequelize[_0x7e1d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x7e1d('0x7'),_0x7e1d('0x2'),_0x7e1d('0x3'))},'keyContent':{'type':Sequelize[_0x7e1d('0x6')]},'idField':{'type':Sequelize[_0x7e1d('0x6')]},'nameField':{'type':Sequelize[_0x7e1d('0x6')]},'customField':{'type':Sequelize[_0x7e1d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7e1d('0x6')]}}; \ No newline at end of file +var _0x60ee=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x4894d9,_0x33a0b5){var _0x4ec2ea=function(_0x35051f){while(--_0x35051f){_0x4894d9['push'](_0x4894d9['shift']());}};_0x4ec2ea(++_0x33a0b5);}(_0x60ee,0x17e));var _0xe60e=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x60ee[_0xea35d1];return _0x1d7a7c;};'use strict';var Sequelize=require(_0xe60e('0x0'));module[_0xe60e('0x1')]={'type':{'type':Sequelize[_0xe60e('0x2')]('string',_0xe60e('0x3'),'customVariable',_0xe60e('0x4'),_0xe60e('0x5')),'defaultValue':_0xe60e('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe60e('0x7')]},'keyType':{'type':Sequelize[_0xe60e('0x2')](_0xe60e('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xe60e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe60e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe60e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e5ef660..99c3070 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 _0x575d=['end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','include','findAll','rows','catch','show','params','includeAll','options','find','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x56c15f,_0x1824bb){var _0x555dac=function(_0x426736){while(--_0x426736){_0x56c15f['push'](_0x56c15f['shift']());}};_0x555dac(++_0x1824bb);}(_0x575d,0x1e8));var _0xd575=function(_0x2a49f0,_0x21c051){_0x2a49f0=_0x2a49f0-0x0;var _0x467f03=_0x575d[_0x2a49f0];return _0x467f03;};'use strict';var emlformat=require(_0xd575('0x0'));var rimraf=require(_0xd575('0x1'));var zipdir=require(_0xd575('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd575('0x3'));var moment=require(_0xd575('0x4'));var BPromise=require(_0xd575('0x5'));var Mustache=require(_0xd575('0x6'));var util=require(_0xd575('0x7'));var path=require(_0xd575('0x8'));var sox=require(_0xd575('0x9'));var csv=require(_0xd575('0xa'));var ejs=require(_0xd575('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd575('0xc'));var crypto=require(_0xd575('0xd'));var jsforce=require(_0xd575('0xe'));var deskjs=require(_0xd575('0xf'));var toCsv=require(_0xd575('0xa'));var querystring=require(_0xd575('0x10'));var Papa=require(_0xd575('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd575('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd575('0x13'))(_0xd575('0x14'));var utils=require(_0xd575('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd575('0x16'))['db'];function respondWithStatusCode(_0x24d552,_0x72c777){_0x72c777=_0x72c777||0xcc;return function(_0x6edb90){if(_0x6edb90){return _0x24d552['sendStatus'](_0x72c777);}return _0x24d552['status'](_0x72c777)[_0xd575('0x17')]();};}function respondWithResult(_0x189c16,_0x264147){_0x264147=_0x264147||0xc8;return function(_0x26b3b0){if(_0x26b3b0){return _0x189c16[_0xd575('0x18')](_0x264147)[_0xd575('0x19')](_0x26b3b0);}};}function respondWithFilteredResult(_0x532e35,_0x5942b2){return function(_0x5f4096){if(_0x5f4096){var _0x2d11b4=typeof _0x5942b2[_0xd575('0x1a')]===_0xd575('0x1b')&&typeof _0x5942b2[_0xd575('0x1c')]==='undefined';var _0x2d9869=_0x5f4096[_0xd575('0x1d')];var _0x449a84=_0x2d11b4?0x0:_0x5942b2[_0xd575('0x1a')];var _0x531f4d=_0x2d11b4?_0x5f4096['count']:_0x5942b2[_0xd575('0x1a')]+_0x5942b2[_0xd575('0x1c')];var _0x925a94;if(_0x531f4d>=_0x2d9869){_0x531f4d=_0x2d9869;_0x925a94=0xc8;}else{_0x925a94=0xce;}_0x532e35[_0xd575('0x18')](_0x925a94);return _0x532e35['set'](_0xd575('0x1e'),_0x449a84+'-'+_0x531f4d+'/'+_0x2d9869)['json'](_0x5f4096);}return null;};}function patchUpdates(_0x50c304){return function(_0x72e9ff){try{jsonpatch[_0xd575('0x1f')](_0x72e9ff,_0x50c304,!![]);}catch(_0x5bf96c){return BPromise['reject'](_0x5bf96c);}return _0x72e9ff[_0xd575('0x20')]();};}function saveUpdates(_0x4a66c2,_0xaa08fe){return function(_0x5c4494){if(_0x5c4494){return _0x5c4494[_0xd575('0x21')](_0x4a66c2)[_0xd575('0x22')](function(_0x16fd16){return _0x16fd16;});}return null;};}function removeEntity(_0x36beb0,_0x140dc9){return function(_0x1d43ba){if(_0x1d43ba){return _0x1d43ba['destroy']()[_0xd575('0x22')](function(){_0x36beb0[_0xd575('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d129,_0x380298){return function(_0x3e8757){if(!_0x3e8757){_0x40d129[_0xd575('0x23')](0x194);}return _0x3e8757;};}function handleError(_0x46edad,_0x1e3631){_0x1e3631=_0x1e3631||0x1f4;return function(_0x7f4b02){logger[_0xd575('0x24')](_0x7f4b02[_0xd575('0x25')]);if(_0x7f4b02[_0xd575('0x26')]){delete _0x7f4b02[_0xd575('0x26')];}_0x46edad[_0xd575('0x18')](_0x1e3631)[_0xd575('0x27')](_0x7f4b02);};}exports[_0xd575('0x28')]=function(_0x5c1691,_0x4c4668){var _0x325a93={},_0x46abf2={},_0x3a0a58={'count':0x0,'rows':[]};var _0x7479fe=_['map'](db[_0xd575('0x29')][_0xd575('0x2a')],function(_0x5f427a){return{'name':_0x5f427a[_0xd575('0x2b')],'type':_0x5f427a[_0xd575('0x2c')][_0xd575('0x2d')]};});_0x46abf2[_0xd575('0x2e')]=_['map'](_0x7479fe,_0xd575('0x26'));_0x46abf2[_0xd575('0x2f')]=_[_0xd575('0x30')](_0x5c1691['query']);_0x46abf2[_0xd575('0x31')]=_[_0xd575('0x32')](_0x46abf2[_0xd575('0x2e')],_0x46abf2['query']);_0x325a93[_0xd575('0x33')]=_[_0xd575('0x32')](_0x46abf2['model'],qs[_0xd575('0x34')](_0x5c1691[_0xd575('0x2f')][_0xd575('0x34')]));_0x325a93['attributes']=_0x325a93[_0xd575('0x33')][_0xd575('0x35')]?_0x325a93[_0xd575('0x33')]:_0x46abf2[_0xd575('0x2e')];if(!_0x5c1691[_0xd575('0x2f')][_0xd575('0x36')](_0xd575('0x37'))){_0x325a93[_0xd575('0x1c')]=qs[_0xd575('0x1c')](_0x5c1691[_0xd575('0x2f')][_0xd575('0x1c')]);_0x325a93[_0xd575('0x1a')]=qs['offset'](_0x5c1691[_0xd575('0x2f')][_0xd575('0x1a')]);}_0x325a93[_0xd575('0x38')]=qs[_0xd575('0x39')](_0x5c1691[_0xd575('0x2f')][_0xd575('0x39')]);_0x325a93[_0xd575('0x3a')]=qs[_0xd575('0x31')](_['pick'](_0x5c1691[_0xd575('0x2f')],_0x46abf2[_0xd575('0x31')]),_0x7479fe);if(_0x5c1691[_0xd575('0x2f')][_0xd575('0x3b')]){_0x325a93[_0xd575('0x3a')]=_[_0xd575('0x3c')](_0x325a93['where'],{'$or':_[_0xd575('0x3d')](_0x7479fe,function(_0x45a119){if(_0x45a119[_0xd575('0x2c')]!=='VIRTUAL'){var _0x109094={};_0x109094[_0x45a119['name']]={'$like':'%'+_0x5c1691[_0xd575('0x2f')][_0xd575('0x3b')]+'%'};return _0x109094;}})});}_0x325a93=_[_0xd575('0x3c')]({},_0x325a93,_0x5c1691['options']);var _0x4bb9ae={'where':_0x325a93[_0xd575('0x3a')]};return db[_0xd575('0x29')][_0xd575('0x1d')](_0x4bb9ae)[_0xd575('0x22')](function(_0x2d3508){_0x3a0a58[_0xd575('0x1d')]=_0x2d3508;if(_0x5c1691[_0xd575('0x2f')]['includeAll']){_0x325a93[_0xd575('0x3e')]=[{'all':!![]}];}return db[_0xd575('0x29')][_0xd575('0x3f')](_0x325a93);})['then'](function(_0x32430c){_0x3a0a58[_0xd575('0x40')]=_0x32430c;return _0x3a0a58;})[_0xd575('0x22')](respondWithFilteredResult(_0x4c4668,_0x325a93))[_0xd575('0x41')](handleError(_0x4c4668,null));};exports[_0xd575('0x42')]=function(_0x47e40d,_0x2b5d65){var _0x5cea37={'raw':!![],'where':{'id':_0x47e40d[_0xd575('0x43')]['id']}},_0x5e9d1f={};_0x5e9d1f[_0xd575('0x2e')]=_[_0xd575('0x30')](db[_0xd575('0x29')][_0xd575('0x2a')]);_0x5e9d1f['query']=_[_0xd575('0x30')](_0x47e40d[_0xd575('0x2f')]);_0x5e9d1f[_0xd575('0x31')]=_[_0xd575('0x32')](_0x5e9d1f[_0xd575('0x2e')],_0x5e9d1f['query']);_0x5cea37['attributes']=_[_0xd575('0x32')](_0x5e9d1f[_0xd575('0x2e')],qs[_0xd575('0x34')](_0x47e40d[_0xd575('0x2f')]['fields']));_0x5cea37[_0xd575('0x33')]=_0x5cea37[_0xd575('0x33')]['length']?_0x5cea37['attributes']:_0x5e9d1f[_0xd575('0x2e')];if(_0x47e40d[_0xd575('0x2f')][_0xd575('0x44')]){_0x5cea37[_0xd575('0x3e')]=[{'all':!![]}];}_0x5cea37=_[_0xd575('0x3c')]({},_0x5cea37,_0x47e40d[_0xd575('0x45')]);return db[_0xd575('0x29')][_0xd575('0x46')](_0x5cea37)[_0xd575('0x22')](handleEntityNotFound(_0x2b5d65,null))[_0xd575('0x22')](respondWithResult(_0x2b5d65,null))[_0xd575('0x41')](handleError(_0x2b5d65,null));};exports['create']=function(_0x57f1d9,_0x438e3a){return db['Dynamics365Field']['create'](_0x57f1d9[_0xd575('0x47')],{})[_0xd575('0x22')](respondWithResult(_0x438e3a,0xc9))[_0xd575('0x41')](handleError(_0x438e3a,null));};exports[_0xd575('0x21')]=function(_0x13fe3f,_0x370b81){if(_0x13fe3f['body']['id']){delete _0x13fe3f[_0xd575('0x47')]['id'];}return db['Dynamics365Field'][_0xd575('0x46')]({'where':{'id':_0x13fe3f[_0xd575('0x43')]['id']}})[_0xd575('0x22')](handleEntityNotFound(_0x370b81,null))[_0xd575('0x22')](saveUpdates(_0x13fe3f[_0xd575('0x47')],null))[_0xd575('0x22')](respondWithResult(_0x370b81,null))[_0xd575('0x41')](handleError(_0x370b81,null));};exports[_0xd575('0x48')]=function(_0xad920d,_0x44b02e){return db['Dynamics365Field'][_0xd575('0x46')]({'where':{'id':_0xad920d['params']['id']}})[_0xd575('0x22')](handleEntityNotFound(_0x44b02e,null))[_0xd575('0x22')](removeEntity(_0x44b02e,null))['catch'](handleError(_0x44b02e,null));}; \ No newline at end of file +var _0x405a=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x405a,0x129));var _0xa405=function(_0x507056,_0xe16b72){_0x507056=_0x507056-0x0;var _0x4eaecc=_0x405a[_0x507056];return _0x4eaecc;};'use strict';var emlformat=require(_0xa405('0x0'));var rimraf=require(_0xa405('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa405('0x2'));var rp=require(_0xa405('0x3'));var moment=require(_0xa405('0x4'));var BPromise=require(_0xa405('0x5'));var Mustache=require(_0xa405('0x6'));var util=require(_0xa405('0x7'));var path=require(_0xa405('0x8'));var sox=require(_0xa405('0x9'));var csv=require(_0xa405('0xa'));var ejs=require(_0xa405('0xb'));var fs=require('fs');var fs_extra=require(_0xa405('0xc'));var _=require(_0xa405('0xd'));var squel=require(_0xa405('0xe'));var crypto=require('crypto');var jsforce=require(_0xa405('0xf'));var deskjs=require(_0xa405('0x10'));var toCsv=require(_0xa405('0xa'));var querystring=require(_0xa405('0x11'));var Papa=require(_0xa405('0x12'));var Redis=require(_0xa405('0x13'));var authService=require(_0xa405('0x14'));var qs=require(_0xa405('0x15'));var as=require(_0xa405('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa405('0x17'))('api');var utils=require(_0xa405('0x18'));var config=require(_0xa405('0x19'));var licenseUtil=require(_0xa405('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12011b,_0x43baa2){_0x43baa2=_0x43baa2||0xcc;return function(_0x4709f9){if(_0x4709f9){return _0x12011b[_0xa405('0x1b')](_0x43baa2);}return _0x12011b[_0xa405('0x1c')](_0x43baa2)[_0xa405('0x1d')]();};}function respondWithResult(_0x450f69,_0x6e1edb){_0x6e1edb=_0x6e1edb||0xc8;return function(_0x182486){if(_0x182486){return _0x450f69[_0xa405('0x1c')](_0x6e1edb)[_0xa405('0x1e')](_0x182486);}};}function respondWithFilteredResult(_0x4a45be,_0x490ef5){return function(_0x2c9311){if(_0x2c9311){var _0x343c6b=typeof _0x490ef5['offset']===_0xa405('0x1f')&&typeof _0x490ef5[_0xa405('0x20')]===_0xa405('0x1f');var _0x3f8982=_0x2c9311['count'];var _0x3e1b1a=_0x343c6b?0x0:_0x490ef5[_0xa405('0x21')];var _0x49c612=_0x343c6b?_0x2c9311[_0xa405('0x22')]:_0x490ef5[_0xa405('0x21')]+_0x490ef5[_0xa405('0x20')];var _0x4e1eee;if(_0x49c612>=_0x3f8982){_0x49c612=_0x3f8982;_0x4e1eee=0xc8;}else{_0x4e1eee=0xce;}_0x4a45be[_0xa405('0x1c')](_0x4e1eee);return _0x4a45be[_0xa405('0x23')](_0xa405('0x24'),_0x3e1b1a+'-'+_0x49c612+'/'+_0x3f8982)[_0xa405('0x1e')](_0x2c9311);}return null;};}function patchUpdates(_0x43b07a){return function(_0x3de2d1){try{jsonpatch[_0xa405('0x25')](_0x3de2d1,_0x43b07a,!![]);}catch(_0x10674d){return BPromise[_0xa405('0x26')](_0x10674d);}return _0x3de2d1[_0xa405('0x27')]();};}function saveUpdates(_0x112375,_0x118064){return function(_0x388c3a){if(_0x388c3a){return _0x388c3a[_0xa405('0x28')](_0x112375)['then'](function(_0x30afa4){return _0x30afa4;});}return null;};}function removeEntity(_0x13d2d5,_0x4437bb){return function(_0x2159d2){if(_0x2159d2){return _0x2159d2[_0xa405('0x29')]()[_0xa405('0x2a')](function(){_0x13d2d5[_0xa405('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5117e8,_0x3ed48b){return function(_0x1aedf1){if(!_0x1aedf1){_0x5117e8[_0xa405('0x1b')](0x194);}return _0x1aedf1;};}function handleError(_0x3701e7,_0x5682ca){_0x5682ca=_0x5682ca||0x1f4;return function(_0x2e791a){logger[_0xa405('0x2b')](_0x2e791a[_0xa405('0x2c')]);if(_0x2e791a[_0xa405('0x2d')]){delete _0x2e791a[_0xa405('0x2d')];}_0x3701e7['status'](_0x5682ca)[_0xa405('0x2e')](_0x2e791a);};}exports[_0xa405('0x2f')]=function(_0x5a427d,_0x228999){var _0x432c23={},_0x57bcea={},_0x4f9817={'count':0x0,'rows':[]};var _0x623d31=_[_0xa405('0x30')](db[_0xa405('0x31')][_0xa405('0x32')],function(_0x208e34){return{'name':_0x208e34[_0xa405('0x33')],'type':_0x208e34[_0xa405('0x34')][_0xa405('0x35')]};});_0x57bcea['model']=_['map'](_0x623d31,_0xa405('0x2d'));_0x57bcea['query']=_[_0xa405('0x36')](_0x5a427d[_0xa405('0x37')]);_0x57bcea['filters']=_[_0xa405('0x38')](_0x57bcea[_0xa405('0x39')],_0x57bcea['query']);_0x432c23[_0xa405('0x3a')]=_[_0xa405('0x38')](_0x57bcea[_0xa405('0x39')],qs[_0xa405('0x3b')](_0x5a427d[_0xa405('0x37')]['fields']));_0x432c23[_0xa405('0x3a')]=_0x432c23[_0xa405('0x3a')][_0xa405('0x3c')]?_0x432c23[_0xa405('0x3a')]:_0x57bcea[_0xa405('0x39')];if(!_0x5a427d[_0xa405('0x37')][_0xa405('0x3d')](_0xa405('0x3e'))){_0x432c23[_0xa405('0x20')]=qs[_0xa405('0x20')](_0x5a427d[_0xa405('0x37')][_0xa405('0x20')]);_0x432c23[_0xa405('0x21')]=qs[_0xa405('0x21')](_0x5a427d[_0xa405('0x37')][_0xa405('0x21')]);}_0x432c23[_0xa405('0x3f')]=qs[_0xa405('0x40')](_0x5a427d[_0xa405('0x37')]['sort']);_0x432c23[_0xa405('0x41')]=qs[_0xa405('0x42')](_['pick'](_0x5a427d[_0xa405('0x37')],_0x57bcea[_0xa405('0x42')]),_0x623d31);if(_0x5a427d['query'][_0xa405('0x43')]){_0x432c23[_0xa405('0x41')]=_[_0xa405('0x44')](_0x432c23[_0xa405('0x41')],{'$or':_[_0xa405('0x30')](_0x623d31,function(_0x58ce7d){if(_0x58ce7d[_0xa405('0x34')]!=='VIRTUAL'){var _0x250e9c={};_0x250e9c[_0x58ce7d[_0xa405('0x2d')]]={'$like':'%'+_0x5a427d[_0xa405('0x37')]['filter']+'%'};return _0x250e9c;}})});}_0x432c23=_[_0xa405('0x44')]({},_0x432c23,_0x5a427d[_0xa405('0x45')]);var _0x2142ed={'where':_0x432c23[_0xa405('0x41')]};return db['Dynamics365Field']['count'](_0x2142ed)[_0xa405('0x2a')](function(_0x6e5672){_0x4f9817[_0xa405('0x22')]=_0x6e5672;if(_0x5a427d[_0xa405('0x37')][_0xa405('0x46')]){_0x432c23[_0xa405('0x47')]=[{'all':!![]}];}return db[_0xa405('0x31')][_0xa405('0x48')](_0x432c23);})[_0xa405('0x2a')](function(_0x33a6a4){_0x4f9817[_0xa405('0x49')]=_0x33a6a4;return _0x4f9817;})['then'](respondWithFilteredResult(_0x228999,_0x432c23))[_0xa405('0x4a')](handleError(_0x228999,null));};exports[_0xa405('0x4b')]=function(_0x15cff0,_0x2c4eec){var _0xdae622={'raw':!![],'where':{'id':_0x15cff0[_0xa405('0x4c')]['id']}},_0x5f2d08={};_0x5f2d08[_0xa405('0x39')]=_['keys'](db[_0xa405('0x31')][_0xa405('0x32')]);_0x5f2d08[_0xa405('0x37')]=_[_0xa405('0x36')](_0x15cff0['query']);_0x5f2d08['filters']=_[_0xa405('0x38')](_0x5f2d08[_0xa405('0x39')],_0x5f2d08[_0xa405('0x37')]);_0xdae622['attributes']=_[_0xa405('0x38')](_0x5f2d08[_0xa405('0x39')],qs[_0xa405('0x3b')](_0x15cff0[_0xa405('0x37')][_0xa405('0x3b')]));_0xdae622[_0xa405('0x3a')]=_0xdae622[_0xa405('0x3a')][_0xa405('0x3c')]?_0xdae622[_0xa405('0x3a')]:_0x5f2d08[_0xa405('0x39')];if(_0x15cff0[_0xa405('0x37')]['includeAll']){_0xdae622[_0xa405('0x47')]=[{'all':!![]}];}_0xdae622=_[_0xa405('0x44')]({},_0xdae622,_0x15cff0[_0xa405('0x45')]);return db[_0xa405('0x31')]['find'](_0xdae622)['then'](handleEntityNotFound(_0x2c4eec,null))[_0xa405('0x2a')](respondWithResult(_0x2c4eec,null))[_0xa405('0x4a')](handleError(_0x2c4eec,null));};exports[_0xa405('0x4d')]=function(_0x3f2bca,_0x5ddacd){return db[_0xa405('0x31')][_0xa405('0x4d')](_0x3f2bca[_0xa405('0x4e')],{})[_0xa405('0x2a')](respondWithResult(_0x5ddacd,0xc9))['catch'](handleError(_0x5ddacd,null));};exports[_0xa405('0x28')]=function(_0x16095e,_0x49a457){if(_0x16095e[_0xa405('0x4e')]['id']){delete _0x16095e[_0xa405('0x4e')]['id'];}return db[_0xa405('0x31')][_0xa405('0x4f')]({'where':{'id':_0x16095e['params']['id']}})[_0xa405('0x2a')](handleEntityNotFound(_0x49a457,null))[_0xa405('0x2a')](saveUpdates(_0x16095e['body'],null))[_0xa405('0x2a')](respondWithResult(_0x49a457,null))[_0xa405('0x4a')](handleError(_0x49a457,null));};exports['destroy']=function(_0x1f7d8e,_0xd1eef4){return db[_0xa405('0x31')]['find']({'where':{'id':_0x1f7d8e[_0xa405('0x4c')]['id']}})[_0xa405('0x2a')](handleEntityNotFound(_0xd1eef4,null))['then'](removeEntity(_0xd1eef4,null))[_0xa405('0x4a')](handleError(_0xd1eef4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index be08de8..ae2ed77 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 _0xfa01=['rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','bluebird','request-promise'];(function(_0x419057,_0x4ebec4){var _0x596f86=function(_0x2f82cd){while(--_0x2f82cd){_0x419057['push'](_0x419057['shift']());}};_0x596f86(++_0x4ebec4);}(_0xfa01,0x19e));var _0x1fa0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfa01[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1fa0('0x0'));var util=require(_0x1fa0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1fa0('0x2'));var rp=require(_0x1fa0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa0('0x4'));var config=require(_0x1fa0('0x5'));var attributes=require(_0x1fa0('0x6'));module['exports']=function(_0x2b32ce,_0x51aa22){return _0x2b32ce['define'](_0x1fa0('0x7'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1fa0('0x8'),'fields':[_0x1fa0('0x9'),_0x1fa0('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8131=['util','../../config/logger','request-promise','rimraf','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','FieldId','lodash'];(function(_0x1eeb45,_0x526bf0){var _0x541ed5=function(_0x588dff){while(--_0x588dff){_0x1eeb45['push'](_0x1eeb45['shift']());}};_0x541ed5(++_0x526bf0);}(_0x8131,0x182));var _0x1813=function(_0x55dcb8,_0xa7e8b2){_0x55dcb8=_0x55dcb8-0x0;var _0x3559bb=_0x8131[_0x55dcb8];return _0x3559bb;};'use strict';var _=require(_0x1813('0x0'));var util=require(_0x1813('0x1'));var logger=require(_0x1813('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1813('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1813('0x4'));var config=require('../../config/environment');var attributes=require(_0x1813('0x5'));module['exports']=function(_0x5956c9,_0x45d205){return _0x5956c9['define'](_0x1813('0x6'),attributes,{'tableName':_0x1813('0x7'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x1813('0x8')],'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 e7a17fa..e6b751d 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 _0xbd36=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch'];(function(_0x4835d9,_0x2a37a2){var _0x9ad61a=function(_0x4ed89a){while(--_0x4ed89a){_0x4835d9['push'](_0x4835d9['shift']());}};_0x9ad61a(++_0x2a37a2);}(_0xbd36,0x150));var _0x6bd3=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xbd36[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var moment=require(_0x6bd3('0x2'));var BPromise=require(_0x6bd3('0x3'));var rs=require(_0x6bd3('0x4'));var fs=require('fs');var Redis=require(_0x6bd3('0x5'));var db=require(_0x6bd3('0x6'))['db'];var utils=require(_0x6bd3('0x7'));var logger=require(_0x6bd3('0x8'))(_0x6bd3('0x9'));var config=require(_0x6bd3('0xa'));var jayson=require(_0x6bd3('0xb'));var client=jayson['client'][_0x6bd3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x109eac,_0x1289db,_0x201297){return new BPromise(function(_0x531082,_0x4ec4e8){return client['request'](_0x109eac,_0x201297)[_0x6bd3('0xd')](function(_0x4ba9d6){logger[_0x6bd3('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x1289db,_0x6bd3('0xf'));logger[_0x6bd3('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1289db,_0x6bd3('0xf'),JSON[_0x6bd3('0x11')](_0x4ba9d6));if(_0x4ba9d6[_0x6bd3('0x12')]){if(_0x4ba9d6[_0x6bd3('0x12')][_0x6bd3('0x13')]===0x1f4){logger['error'](_0x6bd3('0x14'),_0x1289db,_0x4ba9d6[_0x6bd3('0x12')][_0x6bd3('0x15')]);return _0x4ec4e8(_0x4ba9d6[_0x6bd3('0x12')][_0x6bd3('0x15')]);}logger[_0x6bd3('0x12')](_0x6bd3('0x14'),_0x1289db,_0x4ba9d6[_0x6bd3('0x12')][_0x6bd3('0x15')]);return _0x531082(_0x4ba9d6[_0x6bd3('0x12')][_0x6bd3('0x15')]);}else{logger[_0x6bd3('0xe')](_0x6bd3('0x14'),_0x1289db,_0x6bd3('0xf'));_0x531082(_0x4ba9d6[_0x6bd3('0x16')]['message']);}})[_0x6bd3('0x17')](function(_0x59e2f4){logger['error'](_0x6bd3('0x14'),_0x1289db,_0x59e2f4);_0x4ec4e8(_0x59e2f4);});});} \ No newline at end of file +var _0xd0bd=['request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xd0bd,0xf1));var _0xdd0b=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xd0bd[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd0b('0x0'));var BPromise=require(_0xdd0b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd0b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd0b('0x3'));var config=require(_0xdd0b('0x4'));var jayson=require(_0xdd0b('0x5'));var client=jayson[_0xdd0b('0x6')][_0xdd0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e9260,_0x32e9ce,_0x2ee399){return new BPromise(function(_0x3e2df5,_0x3dae79){return client['request'](_0x5e9260,_0x2ee399)[_0xdd0b('0x8')](function(_0x1ef36d){logger[_0xdd0b('0x9')](_0xdd0b('0xa'),_0x32e9ce,_0xdd0b('0xb'));logger[_0xdd0b('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x32e9ce,_0xdd0b('0xb'),JSON[_0xdd0b('0xd')](_0x1ef36d));if(_0x1ef36d[_0xdd0b('0xe')]){if(_0x1ef36d[_0xdd0b('0xe')][_0xdd0b('0xf')]===0x1f4){logger[_0xdd0b('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x32e9ce,_0x1ef36d[_0xdd0b('0xe')]['message']);return _0x3dae79(_0x1ef36d[_0xdd0b('0xe')]['message']);}logger[_0xdd0b('0xe')](_0xdd0b('0xa'),_0x32e9ce,_0x1ef36d[_0xdd0b('0xe')][_0xdd0b('0x10')]);return _0x3e2df5(_0x1ef36d['error'][_0xdd0b('0x10')]);}else{logger['info'](_0xdd0b('0xa'),_0x32e9ce,_0xdd0b('0xb'));_0x3e2df5(_0x1ef36d['result'][_0xdd0b('0x10')]);}})[_0xdd0b('0x11')](function(_0x385a44){logger[_0xdd0b('0xe')](_0xdd0b('0xa'),_0x32e9ce,_0x385a44);_0x3dae79(_0x385a44);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f5e8181..3128562 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 _0x073d=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put'];(function(_0x2c18fa,_0x511682){var _0x59f661=function(_0x6d1de1){while(--_0x6d1de1){_0x2c18fa['push'](_0x2c18fa['shift']());}};_0x59f661(++_0x511682);}(_0x073d,0x17b));var _0xd073=function(_0x5cd675,_0x352cca){_0x5cd675=_0x5cd675-0x0;var _0x2379b0=_0x073d[_0x5cd675];return _0x2379b0;};'use strict';var multer=require('multer');var util=require(_0xd073('0x0'));var path=require(_0xd073('0x1'));var timeout=require('connect-timeout');var express=require(_0xd073('0x2'));var router=express[_0xd073('0x3')]();var fs_extra=require(_0xd073('0x4'));var auth=require(_0xd073('0x5'));var interaction=require(_0xd073('0x6'));var config=require(_0xd073('0x7'));var controller=require(_0xd073('0x8'));router[_0xd073('0x9')]('/',auth[_0xd073('0xa')](),controller[_0xd073('0xb')]);router[_0xd073('0x9')](_0xd073('0xc'),auth[_0xd073('0xa')](),controller[_0xd073('0xd')]);router[_0xd073('0x9')]('/:id/configurations',auth[_0xd073('0xa')](),controller[_0xd073('0xe')]);router['get'](_0xd073('0xf'),auth[_0xd073('0xa')](),controller[_0xd073('0x10')]);router[_0xd073('0x11')]('/',auth['isAuthenticated'](),controller[_0xd073('0x12')]);router[_0xd073('0x11')](_0xd073('0x13'),auth[_0xd073('0xa')](),controller['addConfiguration']);router[_0xd073('0x14')](_0xd073('0xc'),auth[_0xd073('0xa')](),controller[_0xd073('0x15')]);router[_0xd073('0x16')](_0xd073('0xc'),auth['isAuthenticated'](),controller[_0xd073('0x17')]);module[_0xd073('0x18')]=router; \ No newline at end of file +var _0x9db2=['../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','connect-timeout','express','Router','fs-extra'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9db2,0x96));var _0x29db=function(_0xf852,_0x4ddd76){_0xf852=_0xf852-0x0;var _0x5b2550=_0x9db2[_0xf852];return _0x5b2550;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x29db('0x0'));var express=require(_0x29db('0x1'));var router=express[_0x29db('0x2')]();var fs_extra=require(_0x29db('0x3'));var auth=require(_0x29db('0x4'));var interaction=require(_0x29db('0x5'));var config=require('../../config/environment');var controller=require(_0x29db('0x6'));router[_0x29db('0x7')]('/',auth[_0x29db('0x8')](),controller[_0x29db('0x9')]);router[_0x29db('0x7')](_0x29db('0xa'),auth[_0x29db('0x8')](),controller[_0x29db('0xb')]);router['get'](_0x29db('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x29db('0x7')](_0x29db('0xd'),auth[_0x29db('0x8')](),controller[_0x29db('0xe')]);router['post']('/',auth[_0x29db('0x8')](),controller[_0x29db('0xf')]);router[_0x29db('0x10')](_0x29db('0xc'),auth[_0x29db('0x8')](),controller[_0x29db('0x11')]);router[_0x29db('0x12')](_0x29db('0xa'),auth[_0x29db('0x8')](),controller[_0x29db('0x13')]);router[_0x29db('0x14')]('/:id',auth[_0x29db('0x8')](),controller[_0x29db('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 e868ce2..18f6959 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 _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x5eb7e4,_0x45a2ce){var _0x22f268=function(_0x160995){while(--_0x160995){_0x5eb7e4['push'](_0x5eb7e4['shift']());}};_0x22f268(++_0x45a2ce);}(_0xd824,0xc2));var _0x4d82=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd824[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb145=['STRING','username','remoteUri','exports'];(function(_0x54aea3,_0xae7d81){var _0x21ae46=function(_0xe16dbc){while(--_0xe16dbc){_0x54aea3['push'](_0x54aea3['shift']());}};_0x21ae46(++_0xae7d81);}(_0xb145,0xa3));var _0x5b14=function(_0x20da31,_0x32d86d){_0x20da31=_0x20da31-0x0;var _0x5dd0a6=_0xb145[_0x20da31];return _0x5dd0a6;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e0cbe7c..5230ed1 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 _0x3176=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','FreshdeskAccount','includeAll','include','catch','show','params','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','pick','options','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','substring','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode'];(function(_0x366195,_0x50da84){var _0xf37646=function(_0x53a253){while(--_0x53a253){_0x366195['push'](_0x366195['shift']());}};_0xf37646(++_0x50da84);}(_0x3176,0x1d8));var _0x6317=function(_0x44fbfb,_0x2f9aea){_0x44fbfb=_0x44fbfb-0x0;var _0x7fa274=_0x3176[_0x44fbfb];return _0x7fa274;};'use strict';var emlformat=require(_0x6317('0x0'));var rimraf=require(_0x6317('0x1'));var zipdir=require(_0x6317('0x2'));var jsonpatch=require(_0x6317('0x3'));var rp=require(_0x6317('0x4'));var moment=require(_0x6317('0x5'));var BPromise=require(_0x6317('0x6'));var Mustache=require(_0x6317('0x7'));var util=require(_0x6317('0x8'));var path=require(_0x6317('0x9'));var sox=require(_0x6317('0xa'));var csv=require(_0x6317('0xb'));var ejs=require(_0x6317('0xc'));var fs=require('fs');var fs_extra=require(_0x6317('0xd'));var _=require(_0x6317('0xe'));var squel=require(_0x6317('0xf'));var crypto=require('crypto');var jsforce=require(_0x6317('0x10'));var deskjs=require(_0x6317('0x11'));var toCsv=require(_0x6317('0xb'));var querystring=require('querystring');var Papa=require(_0x6317('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6317('0x13'));var as=require(_0x6317('0x14'));var hardwareService=require(_0x6317('0x15'));var logger=require(_0x6317('0x16'))(_0x6317('0x17'));var utils=require('../../config/utils');var config=require(_0x6317('0x18'));var licenseUtil=require(_0x6317('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6317('0x1a'));function respondWithStatusCode(_0x3f64fb,_0x4aa69f){_0x4aa69f=_0x4aa69f||0xcc;return function(_0x375498){if(_0x375498){return _0x3f64fb[_0x6317('0x1b')](_0x4aa69f);}return _0x3f64fb['status'](_0x4aa69f)[_0x6317('0x1c')]();};}function respondWithResult(_0x1fba31,_0x32ad4a){_0x32ad4a=_0x32ad4a||0xc8;return function(_0x42f2f8){if(_0x42f2f8){return _0x1fba31[_0x6317('0x1d')](_0x32ad4a)['json'](_0x42f2f8);}};}function respondWithFilteredResult(_0x54e857,_0x560b77){return function(_0x1b42b3){if(_0x1b42b3){var _0x55b86a=typeof _0x560b77['offset']===_0x6317('0x1e')&&typeof _0x560b77['limit']==='undefined';var _0x35caff=_0x1b42b3[_0x6317('0x1f')];var _0x4ad386=_0x55b86a?0x0:_0x560b77[_0x6317('0x20')];var _0x519851=_0x55b86a?_0x1b42b3[_0x6317('0x1f')]:_0x560b77[_0x6317('0x20')]+_0x560b77[_0x6317('0x21')];var _0x3e4332;if(_0x519851>=_0x35caff){_0x519851=_0x35caff;_0x3e4332=0xc8;}else{_0x3e4332=0xce;}_0x54e857['status'](_0x3e4332);return _0x54e857[_0x6317('0x22')](_0x6317('0x23'),_0x4ad386+'-'+_0x519851+'/'+_0x35caff)[_0x6317('0x24')](_0x1b42b3);}return null;};}function patchUpdates(_0x3687d1){return function(_0x18e081){try{jsonpatch[_0x6317('0x25')](_0x18e081,_0x3687d1,!![]);}catch(_0x8ba880){return BPromise[_0x6317('0x26')](_0x8ba880);}return _0x18e081[_0x6317('0x27')]();};}function saveUpdates(_0x1e9b7e,_0x4b8b11){return function(_0x2bb861){if(_0x2bb861){return _0x2bb861['update'](_0x1e9b7e)[_0x6317('0x28')](function(_0x4a2e3e){return _0x4a2e3e;});}return null;};}function removeEntity(_0x2b7669,_0x2a36ee){return function(_0x2ef902){if(_0x2ef902){return _0x2ef902[_0x6317('0x29')]()[_0x6317('0x28')](function(){_0x2b7669['status'](0xcc)[_0x6317('0x1c')]();});}};}function handleEntityNotFound(_0x14b136,_0x4db284){return function(_0x57739a){if(!_0x57739a){_0x14b136[_0x6317('0x1b')](0x194);}return _0x57739a;};}function handleError(_0x2b4416,_0x2ca4e7){_0x2ca4e7=_0x2ca4e7||0x1f4;return function(_0x329543){logger[_0x6317('0x2a')](_0x329543[_0x6317('0x2b')]);if(_0x329543[_0x6317('0x2c')]){delete _0x329543['name'];}_0x2b4416[_0x6317('0x1d')](_0x2ca4e7)[_0x6317('0x2d')](_0x329543);};}exports[_0x6317('0x2e')]=function(_0x5538d8,_0x343e56){var _0x1a3f96={},_0x5b3f8f={},_0x4e1a27={'count':0x0,'rows':[]};var _0x642246=_[_0x6317('0x2f')](db['FreshdeskAccount'][_0x6317('0x30')],function(_0x1fd2ff){return{'name':_0x1fd2ff[_0x6317('0x31')],'type':_0x1fd2ff[_0x6317('0x32')][_0x6317('0x33')]};});_0x5b3f8f[_0x6317('0x34')]=_[_0x6317('0x2f')](_0x642246,_0x6317('0x2c'));_0x5b3f8f[_0x6317('0x35')]=_[_0x6317('0x36')](_0x5538d8[_0x6317('0x35')]);_0x5b3f8f[_0x6317('0x37')]=_['intersection'](_0x5b3f8f[_0x6317('0x34')],_0x5b3f8f['query']);_0x1a3f96[_0x6317('0x38')]=_[_0x6317('0x39')](_0x5b3f8f[_0x6317('0x34')],qs[_0x6317('0x3a')](_0x5538d8[_0x6317('0x35')][_0x6317('0x3a')]));_0x1a3f96[_0x6317('0x38')]=_0x1a3f96[_0x6317('0x38')][_0x6317('0x3b')]?_0x1a3f96[_0x6317('0x38')]:_0x5b3f8f[_0x6317('0x34')];if(!_0x5538d8['query'][_0x6317('0x3c')](_0x6317('0x3d'))){_0x1a3f96[_0x6317('0x21')]=qs[_0x6317('0x21')](_0x5538d8[_0x6317('0x35')][_0x6317('0x21')]);_0x1a3f96[_0x6317('0x20')]=qs[_0x6317('0x20')](_0x5538d8['query'][_0x6317('0x20')]);}_0x1a3f96[_0x6317('0x3e')]=qs['sort'](_0x5538d8[_0x6317('0x35')][_0x6317('0x3f')]);_0x1a3f96[_0x6317('0x40')]=qs[_0x6317('0x37')](_['pick'](_0x5538d8[_0x6317('0x35')],_0x5b3f8f[_0x6317('0x37')]),_0x642246);if(_0x5538d8['query'][_0x6317('0x41')]){_0x1a3f96[_0x6317('0x40')]=_[_0x6317('0x42')](_0x1a3f96[_0x6317('0x40')],{'$or':_[_0x6317('0x2f')](_0x642246,function(_0x2296a3){if(_0x2296a3[_0x6317('0x32')]!=='VIRTUAL'){var _0x5336bd={};_0x5336bd[_0x2296a3[_0x6317('0x2c')]]={'$like':'%'+_0x5538d8[_0x6317('0x35')][_0x6317('0x41')]+'%'};return _0x5336bd;}})});}_0x1a3f96=_[_0x6317('0x42')]({},_0x1a3f96,_0x5538d8['options']);var _0x155669={'where':_0x1a3f96[_0x6317('0x40')]};return db[_0x6317('0x43')][_0x6317('0x1f')](_0x155669)[_0x6317('0x28')](function(_0x4879e6){_0x4e1a27[_0x6317('0x1f')]=_0x4879e6;if(_0x5538d8[_0x6317('0x35')][_0x6317('0x44')]){_0x1a3f96[_0x6317('0x45')]=[{'all':!![]}];}return db[_0x6317('0x43')]['findAll'](_0x1a3f96);})[_0x6317('0x28')](function(_0x9fd484){_0x4e1a27['rows']=_0x9fd484;return _0x4e1a27;})[_0x6317('0x28')](respondWithFilteredResult(_0x343e56,_0x1a3f96))[_0x6317('0x46')](handleError(_0x343e56,null));};exports[_0x6317('0x47')]=function(_0x81bea6,_0x2d3690){var _0x282240={'raw':![],'where':{'id':_0x81bea6[_0x6317('0x48')]['id']}},_0x31a704={};_0x31a704[_0x6317('0x34')]=_[_0x6317('0x36')](db[_0x6317('0x43')]['rawAttributes']);_0x31a704[_0x6317('0x35')]=_['keys'](_0x81bea6[_0x6317('0x35')]);_0x31a704[_0x6317('0x37')]=_[_0x6317('0x39')](_0x31a704[_0x6317('0x34')],_0x31a704[_0x6317('0x35')]);_0x282240[_0x6317('0x38')]=_[_0x6317('0x39')](_0x31a704[_0x6317('0x34')],qs[_0x6317('0x3a')](_0x81bea6[_0x6317('0x35')][_0x6317('0x3a')]));_0x282240[_0x6317('0x38')]=_0x282240[_0x6317('0x38')][_0x6317('0x3b')]?_0x282240[_0x6317('0x38')]:_0x31a704[_0x6317('0x34')];if(_0x81bea6['query'][_0x6317('0x44')]){_0x282240[_0x6317('0x45')]=[{'all':!![]}];}_0x282240=_[_0x6317('0x42')]({},_0x282240,_0x81bea6['options']);return db['FreshdeskAccount'][_0x6317('0x49')](_0x282240)[_0x6317('0x28')](handleEntityNotFound(_0x2d3690,null))['then'](respondWithResult(_0x2d3690,null))[_0x6317('0x46')](handleError(_0x2d3690,null));};exports[_0x6317('0x4a')]=function(_0x6ff69c,_0x4b3efb){return db[_0x6317('0x43')][_0x6317('0x4a')](_0x6ff69c[_0x6317('0x4b')],{})[_0x6317('0x28')](respondWithResult(_0x4b3efb,0xc9))[_0x6317('0x46')](handleError(_0x4b3efb,null));};exports[_0x6317('0x4c')]=function(_0x238e59,_0x3fe735){if(_0x238e59['body']['id']){delete _0x238e59['body']['id'];}return db[_0x6317('0x43')][_0x6317('0x49')]({'where':{'id':_0x238e59['params']['id']}})['then'](handleEntityNotFound(_0x3fe735,null))['then'](saveUpdates(_0x238e59[_0x6317('0x4b')],null))[_0x6317('0x28')](respondWithResult(_0x3fe735,null))[_0x6317('0x46')](handleError(_0x3fe735,null));};exports[_0x6317('0x29')]=function(_0x37b673,_0x1403a4){return db[_0x6317('0x43')][_0x6317('0x49')]({'where':{'id':_0x37b673[_0x6317('0x48')]['id']}})[_0x6317('0x28')](handleEntityNotFound(_0x1403a4,null))[_0x6317('0x28')](removeEntity(_0x1403a4,null))[_0x6317('0x46')](handleError(_0x1403a4,null));};exports[_0x6317('0x4d')]=function(_0x92e80d,_0x27db7b,_0x364700){var _0x3df23d={};var _0x4b2d79={};var _0x34fb93;var _0x55554b;return db[_0x6317('0x43')][_0x6317('0x4e')]({'where':{'id':_0x92e80d['params']['id']}})[_0x6317('0x28')](handleEntityNotFound(_0x27db7b,null))[_0x6317('0x28')](function(_0xdf561f){if(_0xdf561f){_0x34fb93=_0xdf561f;_0x4b2d79[_0x6317('0x34')]=_[_0x6317('0x36')](db[_0x6317('0x4f')]['rawAttributes']);_0x4b2d79['query']=_[_0x6317('0x36')](_0x92e80d[_0x6317('0x35')]);_0x4b2d79[_0x6317('0x37')]=_[_0x6317('0x39')](_0x4b2d79[_0x6317('0x34')],_0x4b2d79[_0x6317('0x35')]);_0x3df23d['attributes']=_['intersection'](_0x4b2d79['model'],qs[_0x6317('0x3a')](_0x92e80d['query'][_0x6317('0x3a')]));_0x3df23d['attributes']=_0x3df23d['attributes'][_0x6317('0x3b')]?_0x3df23d['attributes']:_0x4b2d79[_0x6317('0x34')];_0x3df23d[_0x6317('0x3e')]=qs['sort'](_0x92e80d[_0x6317('0x35')][_0x6317('0x3f')]);_0x3df23d[_0x6317('0x40')]=qs[_0x6317('0x37')](_[_0x6317('0x50')](_0x92e80d[_0x6317('0x35')],_0x4b2d79[_0x6317('0x37')]));if(_0x92e80d[_0x6317('0x35')][_0x6317('0x41')]){_0x3df23d['where']=_['merge'](_0x3df23d[_0x6317('0x40')],{'$or':_['map'](_0x3df23d[_0x6317('0x38')],function(_0x46581b){var _0x17c34c={};_0x17c34c[_0x46581b]={'$like':'%'+_0x92e80d[_0x6317('0x35')][_0x6317('0x41')]+'%'};return _0x17c34c;})});}_0x3df23d=_[_0x6317('0x42')]({},_0x3df23d,_0x92e80d[_0x6317('0x51')]);return _0x34fb93[_0x6317('0x4d')](_0x3df23d);}})[_0x6317('0x28')](function(_0x348265){if(_0x348265){_0x55554b=_0x348265[_0x6317('0x3b')];if(!_0x92e80d[_0x6317('0x35')][_0x6317('0x3c')](_0x6317('0x3d'))){_0x3df23d[_0x6317('0x21')]=qs[_0x6317('0x21')](_0x92e80d[_0x6317('0x35')][_0x6317('0x21')]);_0x3df23d[_0x6317('0x20')]=qs[_0x6317('0x20')](_0x92e80d[_0x6317('0x35')]['offset']);}return _0x34fb93[_0x6317('0x4d')](_0x3df23d);}})[_0x6317('0x28')](function(_0x90ebc){if(_0x90ebc){return _0x90ebc?{'count':_0x55554b,'rows':_0x90ebc}:null;}})[_0x6317('0x28')](respondWithResult(_0x27db7b,null))['catch'](handleError(_0x27db7b,null));};exports['addConfiguration']=function(_0x5f4b35,_0xd9ea92,_0x49df77){if(_0x5f4b35[_0x6317('0x4b')]['id']){delete _0x5f4b35[_0x6317('0x4b')]['id'];}return db['FreshdeskAccount'][_0x6317('0x4e')]({'where':{'id':_0x5f4b35[_0x6317('0x48')]['id']}})[_0x6317('0x28')](handleEntityNotFound(_0xd9ea92,null))[_0x6317('0x28')](function(_0x4c06cb){if(_0x4c06cb){_0x5f4b35[_0x6317('0x4b')][_0x6317('0x52')]=_0x4c06cb['id'];_0x5f4b35[_0x6317('0x4b')][_0x6317('0x53')]=integrations[_0x6317('0x54')](_0x5f4b35[_0x6317('0x4b')][_0x6317('0x55')],_0x5f4b35[_0x6317('0x4b')][_0x6317('0x32')]);_0x5f4b35[_0x6317('0x4b')]['Descriptions']=integrations[_0x6317('0x56')](_0x5f4b35['body'][_0x6317('0x55')],_0x5f4b35[_0x6317('0x4b')][_0x6317('0x32')]);return db[_0x6317('0x4f')][_0x6317('0x4a')](_0x5f4b35[_0x6317('0x4b')],{'include':[{'model':db[_0x6317('0x57')],'as':_0x6317('0x53')},{'model':db[_0x6317('0x57')],'as':_0x6317('0x58')}]});}return null;})[_0x6317('0x28')](respondWithResult(_0xd9ea92,null))[_0x6317('0x46')](handleError(_0xd9ea92,null));};exports[_0x6317('0x59')]=function(_0x52fada,_0x3b85b1,_0x4f0fea){var _0x460e20='';return db[_0x6317('0x43')]['findOne']({'where':{'id':_0x52fada[_0x6317('0x48')]['id']},'attributes':['id','remoteUri',_0x6317('0x5a')]})[_0x6317('0x28')](handleEntityNotFound(_0x3b85b1,null))[_0x6317('0x28')](function(_0x4495de){if(_0x4495de){_0x460e20=_0x4495de['remoteUri'];var _0x4c17c8=_0x460e20['slice'](-0x1);if(_0x4c17c8==='/'){_0x460e20=_0x460e20[_0x6317('0x5b')](0x0,_0x460e20[_0x6317('0x5c')](_0x4c17c8));}return rp({'method':_0x6317('0x5d'),'uri':util['format']('%s/%s',_0x460e20,_0x6317('0x5e')),'headers':{'Authorization':util[_0x6317('0x5f')](_0x6317('0x60'),new Buffer(util[_0x6317('0x5f')](_0x6317('0x61'),_0x4495de['apiKey']))[_0x6317('0x62')]('base64'))},'json':!![]});}})['then'](function(_0x1ea3b0){if(_0x1ea3b0){var _0x3bf3c0=[_0x6317('0x63'),_0x6317('0x64'),_0x6317('0x65'),_0x6317('0x66'),_0x6317('0x1d'),_0x6317('0x67'),_0x6317('0x68'),_0x6317('0x69'),_0x6317('0x6a'),'group',_0x6317('0x6b')];_['remove'](_0x1ea3b0,function(_0x245582){return _0x3bf3c0[_0x6317('0x6c')](_0x245582[_0x6317('0x2c')])||!_0x245582[_0x6317('0x6d')]&&_0x245582[_0x6317('0x32')]!=='custom_text'&&_0x245582[_0x6317('0x32')]!==_0x6317('0x6e');});return{'count':_0x1ea3b0[_0x6317('0x3b')],'rows':_[_0x6317('0x2f')](_0x1ea3b0,function(_0x396df1){return{'id':_0x396df1['name'],'name':_0x396df1[_0x6317('0x6f')],'custom':!_0x396df1[_0x6317('0x6d')],'options':_0x396df1[_0x6317('0x70')]?_[_0x6317('0x2f')](_0x396df1[_0x6317('0x70')],function(_0xf3fa70){return{'name':_[_0x6317('0x71')](_0xf3fa70),'value':_0xf3fa70};}):[]};})};}})['then'](respondWithResult(_0x3b85b1,null))[_0x6317('0x46')](function(_0x255905){var _0x58b01d=_0x52fada[_0x6317('0x35')]['test']?0x1f4:_0x255905['statusCode']||0x1f4;logger[_0x6317('0x2a')](_0x6317('0x72'),'getFields',_0x58b01d,JSON['stringify'](_0x255905));delete _0x255905[_0x6317('0x2c')];if(_0x58b01d===0x191){_0x58b01d=0x190;}_0x3b85b1[_0x6317('0x1d')](_0x58b01d)[_0x6317('0x2d')](_0x52fada[_0x6317('0x35')][_0x6317('0x73')]?{'message':_0x6317('0x74'),'statusCode':_0x255905[_0x6317('0x75')]}:_0x255905);});}; \ No newline at end of file +var _0x82b0=['priority','source','group','company','remove','default','custom_dropdown','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','update','body','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','getSubjects','channel','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','subject','agent','description'];(function(_0x1b1125,_0x1f9364){var _0x42a2d6=function(_0x29b385){while(--_0x29b385){_0x1b1125['push'](_0x1b1125['shift']());}};_0x42a2d6(++_0x1f9364);}(_0x82b0,0x81));var _0x082b=function(_0x6622a2,_0x401a17){_0x6622a2=_0x6622a2-0x0;var _0x52252e=_0x82b0[_0x6622a2];return _0x52252e;};'use strict';var emlformat=require(_0x082b('0x0'));var rimraf=require(_0x082b('0x1'));var zipdir=require(_0x082b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var Mustache=require(_0x082b('0x6'));var util=require('util');var path=require(_0x082b('0x7'));var sox=require(_0x082b('0x8'));var csv=require(_0x082b('0x9'));var ejs=require(_0x082b('0xa'));var fs=require('fs');var fs_extra=require(_0x082b('0xb'));var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0x9'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var as=require(_0x082b('0x15'));var hardwareService=require(_0x082b('0x16'));var logger=require(_0x082b('0x17'))(_0x082b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082b('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c1f9d,_0x324251){_0x324251=_0x324251||0xcc;return function(_0x535946){if(_0x535946){return _0x1c1f9d[_0x082b('0x1a')](_0x324251);}return _0x1c1f9d[_0x082b('0x1b')](_0x324251)[_0x082b('0x1c')]();};}function respondWithResult(_0x1f0c32,_0x40e206){_0x40e206=_0x40e206||0xc8;return function(_0x4d7ad9){if(_0x4d7ad9){return _0x1f0c32[_0x082b('0x1b')](_0x40e206)[_0x082b('0x1d')](_0x4d7ad9);}};}function respondWithFilteredResult(_0x49db08,_0x2c4f86){return function(_0x588d8a){if(_0x588d8a){var _0xb373c9=typeof _0x2c4f86[_0x082b('0x1e')]==='undefined'&&typeof _0x2c4f86[_0x082b('0x1f')]===_0x082b('0x20');var _0x2442d1=_0x588d8a[_0x082b('0x21')];var _0x4adfc6=_0xb373c9?0x0:_0x2c4f86[_0x082b('0x1e')];var _0x2d5cbc=_0xb373c9?_0x588d8a[_0x082b('0x21')]:_0x2c4f86[_0x082b('0x1e')]+_0x2c4f86[_0x082b('0x1f')];var _0x1f403a;if(_0x2d5cbc>=_0x2442d1){_0x2d5cbc=_0x2442d1;_0x1f403a=0xc8;}else{_0x1f403a=0xce;}_0x49db08[_0x082b('0x1b')](_0x1f403a);return _0x49db08[_0x082b('0x22')]('Content-Range',_0x4adfc6+'-'+_0x2d5cbc+'/'+_0x2442d1)[_0x082b('0x1d')](_0x588d8a);}return null;};}function patchUpdates(_0x2fffc3){return function(_0x36683e){try{jsonpatch['apply'](_0x36683e,_0x2fffc3,!![]);}catch(_0x3c0b03){return BPromise[_0x082b('0x23')](_0x3c0b03);}return _0x36683e[_0x082b('0x24')]();};}function saveUpdates(_0x56fbd2,_0x47c0d9){return function(_0x47454f){if(_0x47454f){return _0x47454f['update'](_0x56fbd2)['then'](function(_0x3ae657){return _0x3ae657;});}return null;};}function removeEntity(_0xaa7eb,_0x271340){return function(_0x376d0a){if(_0x376d0a){return _0x376d0a[_0x082b('0x25')]()['then'](function(){_0xaa7eb[_0x082b('0x1b')](0xcc)[_0x082b('0x1c')]();});}};}function handleEntityNotFound(_0x40d737,_0x1082bf){return function(_0x20d85b){if(!_0x20d85b){_0x40d737[_0x082b('0x1a')](0x194);}return _0x20d85b;};}function handleError(_0x1b6dfc,_0x4e30e8){_0x4e30e8=_0x4e30e8||0x1f4;return function(_0x20ff4a){logger['error'](_0x20ff4a[_0x082b('0x26')]);if(_0x20ff4a['name']){delete _0x20ff4a[_0x082b('0x27')];}_0x1b6dfc[_0x082b('0x1b')](_0x4e30e8)['send'](_0x20ff4a);};}exports[_0x082b('0x28')]=function(_0x4b172b,_0x228a5a){var _0x55d059={},_0x528e52={},_0x25dcaf={'count':0x0,'rows':[]};var _0x1f8ce4=_[_0x082b('0x29')](db[_0x082b('0x2a')][_0x082b('0x2b')],function(_0x3194d5){return{'name':_0x3194d5[_0x082b('0x2c')],'type':_0x3194d5[_0x082b('0x2d')][_0x082b('0x2e')]};});_0x528e52[_0x082b('0x2f')]=_[_0x082b('0x29')](_0x1f8ce4,'name');_0x528e52[_0x082b('0x30')]=_[_0x082b('0x31')](_0x4b172b[_0x082b('0x30')]);_0x528e52[_0x082b('0x32')]=_[_0x082b('0x33')](_0x528e52['model'],_0x528e52['query']);_0x55d059[_0x082b('0x34')]=_[_0x082b('0x33')](_0x528e52['model'],qs[_0x082b('0x35')](_0x4b172b[_0x082b('0x30')]['fields']));_0x55d059[_0x082b('0x34')]=_0x55d059['attributes'][_0x082b('0x36')]?_0x55d059[_0x082b('0x34')]:_0x528e52['model'];if(!_0x4b172b[_0x082b('0x30')][_0x082b('0x37')](_0x082b('0x38'))){_0x55d059[_0x082b('0x1f')]=qs[_0x082b('0x1f')](_0x4b172b['query'][_0x082b('0x1f')]);_0x55d059['offset']=qs[_0x082b('0x1e')](_0x4b172b[_0x082b('0x30')][_0x082b('0x1e')]);}_0x55d059[_0x082b('0x39')]=qs[_0x082b('0x3a')](_0x4b172b[_0x082b('0x30')][_0x082b('0x3a')]);_0x55d059[_0x082b('0x3b')]=qs['filters'](_[_0x082b('0x3c')](_0x4b172b[_0x082b('0x30')],_0x528e52['filters']),_0x1f8ce4);if(_0x4b172b[_0x082b('0x30')][_0x082b('0x3d')]){_0x55d059[_0x082b('0x3b')]=_[_0x082b('0x3e')](_0x55d059[_0x082b('0x3b')],{'$or':_[_0x082b('0x29')](_0x1f8ce4,function(_0xe01d7a){if(_0xe01d7a[_0x082b('0x2d')]!=='VIRTUAL'){var _0x31832d={};_0x31832d[_0xe01d7a[_0x082b('0x27')]]={'$like':'%'+_0x4b172b[_0x082b('0x30')][_0x082b('0x3d')]+'%'};return _0x31832d;}})});}_0x55d059=_['merge']({},_0x55d059,_0x4b172b[_0x082b('0x3f')]);var _0xa22d4e={'where':_0x55d059[_0x082b('0x3b')]};return db[_0x082b('0x2a')][_0x082b('0x21')](_0xa22d4e)['then'](function(_0x436e50){_0x25dcaf[_0x082b('0x21')]=_0x436e50;if(_0x4b172b['query'][_0x082b('0x40')]){_0x55d059[_0x082b('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x082b('0x42')](_0x55d059);})[_0x082b('0x43')](function(_0x22cea5){_0x25dcaf[_0x082b('0x44')]=_0x22cea5;return _0x25dcaf;})[_0x082b('0x43')](respondWithFilteredResult(_0x228a5a,_0x55d059))[_0x082b('0x45')](handleError(_0x228a5a,null));};exports[_0x082b('0x46')]=function(_0x2b9257,_0x26c958){var _0x5ed239={'raw':![],'where':{'id':_0x2b9257[_0x082b('0x47')]['id']}},_0xe8c120={};_0xe8c120[_0x082b('0x2f')]=_[_0x082b('0x31')](db['FreshdeskAccount'][_0x082b('0x2b')]);_0xe8c120[_0x082b('0x30')]=_[_0x082b('0x31')](_0x2b9257['query']);_0xe8c120[_0x082b('0x32')]=_[_0x082b('0x33')](_0xe8c120[_0x082b('0x2f')],_0xe8c120[_0x082b('0x30')]);_0x5ed239[_0x082b('0x34')]=_[_0x082b('0x33')](_0xe8c120['model'],qs[_0x082b('0x35')](_0x2b9257[_0x082b('0x30')][_0x082b('0x35')]));_0x5ed239[_0x082b('0x34')]=_0x5ed239[_0x082b('0x34')][_0x082b('0x36')]?_0x5ed239[_0x082b('0x34')]:_0xe8c120[_0x082b('0x2f')];if(_0x2b9257['query'][_0x082b('0x40')]){_0x5ed239[_0x082b('0x41')]=[{'all':!![]}];}_0x5ed239=_[_0x082b('0x3e')]({},_0x5ed239,_0x2b9257['options']);return db[_0x082b('0x2a')][_0x082b('0x48')](_0x5ed239)['then'](handleEntityNotFound(_0x26c958,null))[_0x082b('0x43')](respondWithResult(_0x26c958,null))['catch'](handleError(_0x26c958,null));};exports[_0x082b('0x49')]=function(_0x5d238e,_0x1f1b8f){return db['FreshdeskAccount'][_0x082b('0x49')](_0x5d238e['body'],{})[_0x082b('0x43')](respondWithResult(_0x1f1b8f,0xc9))['catch'](handleError(_0x1f1b8f,null));};exports[_0x082b('0x4a')]=function(_0x518f6b,_0x46d5b1){if(_0x518f6b[_0x082b('0x4b')]['id']){delete _0x518f6b[_0x082b('0x4b')]['id'];}return db[_0x082b('0x2a')][_0x082b('0x48')]({'where':{'id':_0x518f6b[_0x082b('0x47')]['id']}})[_0x082b('0x43')](handleEntityNotFound(_0x46d5b1,null))['then'](saveUpdates(_0x518f6b[_0x082b('0x4b')],null))[_0x082b('0x43')](respondWithResult(_0x46d5b1,null))[_0x082b('0x45')](handleError(_0x46d5b1,null));};exports['destroy']=function(_0x221b13,_0x41d21c){return db[_0x082b('0x2a')][_0x082b('0x48')]({'where':{'id':_0x221b13[_0x082b('0x47')]['id']}})[_0x082b('0x43')](handleEntityNotFound(_0x41d21c,null))[_0x082b('0x43')](removeEntity(_0x41d21c,null))['catch'](handleError(_0x41d21c,null));};exports['getConfigurations']=function(_0xbcbd1d,_0x4a484b,_0x28751c){var _0x39bcd1={};var _0x1e76a3={};var _0x53ebc1;var _0x4a48f8;return db['FreshdeskAccount']['findOne']({'where':{'id':_0xbcbd1d[_0x082b('0x47')]['id']}})[_0x082b('0x43')](handleEntityNotFound(_0x4a484b,null))['then'](function(_0x397f3d){if(_0x397f3d){_0x53ebc1=_0x397f3d;_0x1e76a3[_0x082b('0x2f')]=_[_0x082b('0x31')](db[_0x082b('0x4c')]['rawAttributes']);_0x1e76a3[_0x082b('0x30')]=_[_0x082b('0x31')](_0xbcbd1d[_0x082b('0x30')]);_0x1e76a3[_0x082b('0x32')]=_[_0x082b('0x33')](_0x1e76a3['model'],_0x1e76a3[_0x082b('0x30')]);_0x39bcd1[_0x082b('0x34')]=_['intersection'](_0x1e76a3[_0x082b('0x2f')],qs[_0x082b('0x35')](_0xbcbd1d['query'][_0x082b('0x35')]));_0x39bcd1['attributes']=_0x39bcd1[_0x082b('0x34')][_0x082b('0x36')]?_0x39bcd1['attributes']:_0x1e76a3[_0x082b('0x2f')];_0x39bcd1['order']=qs[_0x082b('0x3a')](_0xbcbd1d[_0x082b('0x30')]['sort']);_0x39bcd1['where']=qs['filters'](_[_0x082b('0x3c')](_0xbcbd1d[_0x082b('0x30')],_0x1e76a3[_0x082b('0x32')]));if(_0xbcbd1d[_0x082b('0x30')][_0x082b('0x3d')]){_0x39bcd1[_0x082b('0x3b')]=_[_0x082b('0x3e')](_0x39bcd1[_0x082b('0x3b')],{'$or':_['map'](_0x39bcd1[_0x082b('0x34')],function(_0x195328){var _0x5b3122={};_0x5b3122[_0x195328]={'$like':'%'+_0xbcbd1d[_0x082b('0x30')][_0x082b('0x3d')]+'%'};return _0x5b3122;})});}_0x39bcd1=_[_0x082b('0x3e')]({},_0x39bcd1,_0xbcbd1d[_0x082b('0x3f')]);return _0x53ebc1[_0x082b('0x4d')](_0x39bcd1);}})[_0x082b('0x43')](function(_0x76db84){if(_0x76db84){_0x4a48f8=_0x76db84['length'];if(!_0xbcbd1d[_0x082b('0x30')][_0x082b('0x37')]('nolimit')){_0x39bcd1[_0x082b('0x1f')]=qs[_0x082b('0x1f')](_0xbcbd1d['query']['limit']);_0x39bcd1[_0x082b('0x1e')]=qs[_0x082b('0x1e')](_0xbcbd1d[_0x082b('0x30')][_0x082b('0x1e')]);}return _0x53ebc1['getConfigurations'](_0x39bcd1);}})[_0x082b('0x43')](function(_0x24ac98){if(_0x24ac98){return _0x24ac98?{'count':_0x4a48f8,'rows':_0x24ac98}:null;}})['then'](respondWithResult(_0x4a484b,null))[_0x082b('0x45')](handleError(_0x4a484b,null));};exports[_0x082b('0x4e')]=function(_0x6c21f8,_0x36b87d,_0x49928b){if(_0x6c21f8[_0x082b('0x4b')]['id']){delete _0x6c21f8[_0x082b('0x4b')]['id'];}return db[_0x082b('0x2a')][_0x082b('0x4f')]({'where':{'id':_0x6c21f8[_0x082b('0x47')]['id']}})[_0x082b('0x43')](handleEntityNotFound(_0x36b87d,null))[_0x082b('0x43')](function(_0x80ae28){if(_0x80ae28){_0x6c21f8[_0x082b('0x4b')]['AccountId']=_0x80ae28['id'];_0x6c21f8[_0x082b('0x4b')]['Subjects']=integrations[_0x082b('0x50')](_0x6c21f8[_0x082b('0x4b')]['channel'],_0x6c21f8[_0x082b('0x4b')]['type']);_0x6c21f8['body']['Descriptions']=integrations['getDescriptions'](_0x6c21f8[_0x082b('0x4b')][_0x082b('0x51')],_0x6c21f8[_0x082b('0x4b')][_0x082b('0x2d')]);return db[_0x082b('0x4c')][_0x082b('0x49')](_0x6c21f8['body'],{'include':[{'model':db[_0x082b('0x52')],'as':_0x082b('0x53')},{'model':db['FreshdeskField'],'as':_0x082b('0x54')}]});}return null;})[_0x082b('0x43')](respondWithResult(_0x36b87d,null))[_0x082b('0x45')](handleError(_0x36b87d,null));};exports[_0x082b('0x55')]=function(_0x42619a,_0x16ae26,_0x358899){var _0x15a397='';return db[_0x082b('0x2a')][_0x082b('0x4f')]({'where':{'id':_0x42619a['params']['id']},'attributes':['id',_0x082b('0x56'),'apiKey']})[_0x082b('0x43')](handleEntityNotFound(_0x16ae26,null))[_0x082b('0x43')](function(_0x473686){if(_0x473686){_0x15a397=_0x473686[_0x082b('0x56')];var _0x7a6c6f=_0x15a397[_0x082b('0x57')](-0x1);if(_0x7a6c6f==='/'){_0x15a397=_0x15a397['substring'](0x0,_0x15a397[_0x082b('0x58')](_0x7a6c6f));}return rp({'method':_0x082b('0x59'),'uri':util[_0x082b('0x5a')](_0x082b('0x5b'),_0x15a397,_0x082b('0x5c')),'headers':{'Authorization':util[_0x082b('0x5a')](_0x082b('0x5d'),new Buffer(util['format'](_0x082b('0x5e'),_0x473686[_0x082b('0x5f')]))['toString']('base64'))},'json':!![]});}})[_0x082b('0x43')](function(_0x3f7ae7){if(_0x3f7ae7){var _0x57fcef=['requester',_0x082b('0x60'),_0x082b('0x61'),_0x082b('0x62'),_0x082b('0x1b'),_0x082b('0x63'),'group',_0x082b('0x64'),'ticket_type',_0x082b('0x65'),_0x082b('0x66')];_[_0x082b('0x67')](_0x3f7ae7,function(_0x3a3300){return _0x57fcef['includes'](_0x3a3300[_0x082b('0x27')])||!_0x3a3300[_0x082b('0x68')]&&_0x3a3300['type']!=='custom_text'&&_0x3a3300[_0x082b('0x2d')]!==_0x082b('0x69');});return{'count':_0x3f7ae7['length'],'rows':_['map'](_0x3f7ae7,function(_0x32f4cb){return{'id':_0x32f4cb[_0x082b('0x27')],'name':_0x32f4cb['label'],'custom':!_0x32f4cb[_0x082b('0x68')],'options':_0x32f4cb[_0x082b('0x6a')]?_[_0x082b('0x29')](_0x32f4cb[_0x082b('0x6a')],function(_0x2903b4){return{'name':_[_0x082b('0x6b')](_0x2903b4),'value':_0x2903b4};}):[]};})};}})[_0x082b('0x43')](respondWithResult(_0x16ae26,null))[_0x082b('0x45')](function(_0x3e872d){var _0x55d724=_0x42619a[_0x082b('0x30')][_0x082b('0x6c')]?0x1f4:_0x3e872d[_0x082b('0x6d')]||0x1f4;logger[_0x082b('0x6e')](_0x082b('0x6f'),_0x082b('0x55'),_0x55d724,JSON['stringify'](_0x3e872d));delete _0x3e872d[_0x082b('0x27')];if(_0x55d724===0x191){_0x55d724=0x190;}_0x16ae26[_0x082b('0x1b')](_0x55d724)[_0x082b('0x70')](_0x42619a[_0x082b('0x30')][_0x082b('0x6c')]?{'message':_0x082b('0x71'),'statusCode':_0x3e872d['statusCode']}:_0x3e872d);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a3d66d8..e2508ee 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 _0x0696=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0696,0x1e6));var _0x6069=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x0696[_0x170772];return _0x3ef69c;};'use strict';var _=require(_0x6069('0x0'));var util=require(_0x6069('0x1'));var logger=require(_0x6069('0x2'))(_0x6069('0x3'));var moment=require(_0x6069('0x4'));var BPromise=require(_0x6069('0x5'));var rp=require(_0x6069('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6069('0x7'));var config=require(_0x6069('0x8'));var attributes=require(_0x6069('0x9'));var integrations=require(_0x6069('0xa'));module[_0x6069('0xb')]=function(_0x260811,_0x51c92c){return _0x260811['define'](_0x6069('0xc'),attributes,{'tableName':_0x6069('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eab=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','bluebird','path','rimraf','../../config/environment'];(function(_0x325607,_0x5314cf){var _0x1b9003=function(_0x39d760){while(--_0x39d760){_0x325607['push'](_0x325607['shift']());}};_0x1b9003(++_0x5314cf);}(_0x0eab,0x17b));var _0xb0ea=function(_0x1cad63,_0x598184){_0x1cad63=_0x1cad63-0x0;var _0x5f4760=_0x0eab[_0x1cad63];return _0x5f4760;};'use strict';var _=require(_0xb0ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0ea('0x1'));var moment=require('moment');var BPromise=require(_0xb0ea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0ea('0x3'));var rimraf=require(_0xb0ea('0x4'));var config=require(_0xb0ea('0x5'));var attributes=require(_0xb0ea('0x6'));var integrations=require(_0xb0ea('0x7'));module['exports']=function(_0x2d4ed8,_0x55ebea){return _0x2d4ed8[_0xb0ea('0x8')](_0xb0ea('0x9'),attributes,{'tableName':_0xb0ea('0xa'),'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 eeb7108..8a43646 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 _0x2a2f=['FreshdeskAccount','findAll','options','include','map','model','attributes','debug','ShowFreshdeskAccount','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x2a2f,0x1c6));var _0xf2a2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2a2f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf2a2('0x0'));var util=require(_0xf2a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2a2('0x2'));var fs=require('fs');var Redis=require(_0xf2a2('0x3'));var db=require(_0xf2a2('0x4'))['db'];var utils=require(_0xf2a2('0x5'));var logger=require(_0xf2a2('0x6'))(_0xf2a2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf2a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x374313,_0x273acc,_0x3b1aa6){return new BPromise(function(_0x4f4bda,_0x1aef52){return client[_0xf2a2('0x9')](_0x374313,_0x3b1aa6)[_0xf2a2('0xa')](function(_0x1ea26b){logger[_0xf2a2('0xb')](_0xf2a2('0xc'),_0x273acc,_0xf2a2('0xd'));logger['debug'](_0xf2a2('0xe'),_0x273acc,'request\x20sent',JSON[_0xf2a2('0xf')](_0x1ea26b));if(_0x1ea26b[_0xf2a2('0x10')]){if(_0x1ea26b[_0xf2a2('0x10')][_0xf2a2('0x11')]===0x1f4){logger[_0xf2a2('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x273acc,_0x1ea26b['error'][_0xf2a2('0x12')]);return _0x1aef52(_0x1ea26b[_0xf2a2('0x10')]['message']);}logger[_0xf2a2('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x273acc,_0x1ea26b[_0xf2a2('0x10')][_0xf2a2('0x12')]);return _0x4f4bda(_0x1ea26b['error'][_0xf2a2('0x12')]);}else{logger[_0xf2a2('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x273acc,_0xf2a2('0xd'));_0x4f4bda(_0x1ea26b[_0xf2a2('0x13')]['message']);}})[_0xf2a2('0x14')](function(_0x317fb0){logger[_0xf2a2('0x10')](_0xf2a2('0xc'),_0x273acc,_0x317fb0);_0x1aef52(_0x317fb0);});});}exports[_0xf2a2('0x15')]=function(_0x2200f3){var _0x304c4b=this;return new Promise(function(_0xd85846,_0x2cd9a2){return db[_0xf2a2('0x16')][_0xf2a2('0x17')]({'raw':_0x2200f3[_0xf2a2('0x18')]?_0x2200f3[_0xf2a2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2200f3['options']?_0x2200f3[_0xf2a2('0x18')]['where']||null:null,'attributes':_0x2200f3[_0xf2a2('0x18')]?_0x2200f3['options']['attributes']||null:null,'limit':_0x2200f3['options']?_0x2200f3['options']['limit']||null:null,'include':_0x2200f3[_0xf2a2('0x18')]?_0x2200f3[_0xf2a2('0x18')][_0xf2a2('0x19')]?_[_0xf2a2('0x1a')](_0x2200f3[_0xf2a2('0x18')]['include'],function(_0x257a78){return{'model':db[_0x257a78['model']],'as':_0x257a78['as'],'attributes':_0x257a78['attributes'],'include':_0x257a78[_0xf2a2('0x19')]?_[_0xf2a2('0x1a')](_0x257a78['include'],function(_0x246b21){return{'model':db[_0x246b21[_0xf2a2('0x1b')]],'as':_0x246b21['as'],'attributes':_0x246b21[_0xf2a2('0x1c')],'include':_0x246b21['include']?_[_0xf2a2('0x1a')](_0x246b21['include'],function(_0x43b4fc){return{'model':db[_0x43b4fc[_0xf2a2('0x1b')]],'as':_0x43b4fc['as'],'attributes':_0x43b4fc['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2a2('0xa')](function(_0x8bda7){logger[_0xf2a2('0xb')](_0xf2a2('0x15'),_0x2200f3);logger[_0xf2a2('0x1d')](_0xf2a2('0x15'),_0x2200f3,JSON['stringify'](_0x8bda7));_0xd85846(_0x8bda7);})['catch'](function(_0x5b66a3){logger[_0xf2a2('0x10')](_0xf2a2('0x15'),_0x5b66a3[_0xf2a2('0x12')],_0x2200f3);_0x2cd9a2(_0x304c4b[_0xf2a2('0x10')](0x1f4,_0x5b66a3[_0xf2a2('0x12')]));});});};exports[_0xf2a2('0x1e')]=function(_0x38f6bb){var _0x8da1ab=this;return new Promise(function(_0x47818a,_0x5305ba){return db[_0xf2a2('0x16')][_0xf2a2('0x1f')]({'raw':_0x38f6bb[_0xf2a2('0x18')]?_0x38f6bb[_0xf2a2('0x18')][_0xf2a2('0x20')]===undefined?!![]:![]:!![],'where':_0x38f6bb['options']?_0x38f6bb[_0xf2a2('0x18')][_0xf2a2('0x21')]||null:null,'attributes':_0x38f6bb['options']?_0x38f6bb[_0xf2a2('0x18')][_0xf2a2('0x1c')]||null:null,'include':_0x38f6bb['options']?_0x38f6bb[_0xf2a2('0x18')][_0xf2a2('0x19')]?_[_0xf2a2('0x1a')](_0x38f6bb['options']['include'],function(_0x17d048){return{'model':db[_0x17d048[_0xf2a2('0x1b')]],'as':_0x17d048['as'],'attributes':_0x17d048[_0xf2a2('0x1c')],'include':_0x17d048[_0xf2a2('0x19')]?_['map'](_0x17d048[_0xf2a2('0x19')],function(_0x56add9){return{'model':db[_0x56add9[_0xf2a2('0x1b')]],'as':_0x56add9['as'],'attributes':_0x56add9[_0xf2a2('0x1c')],'include':_0x56add9['include']?_[_0xf2a2('0x1a')](_0x56add9[_0xf2a2('0x19')],function(_0x3899fa){return{'model':db[_0x3899fa['model']],'as':_0x3899fa['as'],'attributes':_0x3899fa[_0xf2a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf2a2('0xa')](function(_0x2eedb0){logger[_0xf2a2('0xb')](_0xf2a2('0x1e'),_0x38f6bb);logger[_0xf2a2('0x1d')]('ShowFreshdeskAccount',_0x38f6bb,JSON[_0xf2a2('0xf')](_0x2eedb0));_0x47818a(_0x2eedb0);})[_0xf2a2('0x14')](function(_0x33a785){logger['error'](_0xf2a2('0x1e'),_0x33a785['message'],_0x38f6bb);_0x5305ba(_0x8da1ab[_0xf2a2('0x10')](0x1f4,_0x33a785['message']));});});}; \ No newline at end of file +var _0x28a2=['model','then','GetFreshdeskAccount','FreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','include','map'];(function(_0x5656d0,_0x4f5620){var _0x22ba99=function(_0x1d381d){while(--_0x1d381d){_0x5656d0['push'](_0x5656d0['shift']());}};_0x22ba99(++_0x4f5620);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var moment=require(_0x228a('0x2'));var BPromise=require(_0x228a('0x3'));var rs=require(_0x228a('0x4'));var fs=require('fs');var Redis=require(_0x228a('0x5'));var db=require(_0x228a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x228a('0x7'))('rpc');var config=require(_0x228a('0x8'));var jayson=require(_0x228a('0x9'));var client=jayson[_0x228a('0xa')][_0x228a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100a6a,_0x484c54,_0x270d15){return new BPromise(function(_0x7767ab,_0x105317){return client[_0x228a('0xc')](_0x100a6a,_0x270d15)['then'](function(_0x34f427){logger[_0x228a('0xd')](_0x228a('0xe'),_0x484c54,_0x228a('0xf'));logger[_0x228a('0x10')](_0x228a('0x11'),_0x484c54,_0x228a('0xf'),JSON[_0x228a('0x12')](_0x34f427));if(_0x34f427['error']){if(_0x34f427['error']['code']===0x1f4){logger[_0x228a('0x13')](_0x228a('0xe'),_0x484c54,_0x34f427[_0x228a('0x13')][_0x228a('0x14')]);return _0x105317(_0x34f427[_0x228a('0x13')]['message']);}logger[_0x228a('0x13')](_0x228a('0xe'),_0x484c54,_0x34f427[_0x228a('0x13')]['message']);return _0x7767ab(_0x34f427['error'][_0x228a('0x14')]);}else{logger[_0x228a('0xd')](_0x228a('0xe'),_0x484c54,_0x228a('0xf'));_0x7767ab(_0x34f427[_0x228a('0x15')][_0x228a('0x14')]);}})[_0x228a('0x16')](function(_0x40c8de){logger['error'](_0x228a('0xe'),_0x484c54,_0x40c8de);_0x105317(_0x40c8de);});});}exports['GetFreshdeskAccount']=function(_0x2f71ad){var _0x2c764e=this;return new Promise(function(_0x16c281,_0x18004e){return db['FreshdeskAccount']['findAll']({'raw':_0x2f71ad[_0x228a('0x17')]?_0x2f71ad[_0x228a('0x17')][_0x228a('0x18')]===undefined?!![]:![]:!![],'where':_0x2f71ad[_0x228a('0x17')]?_0x2f71ad[_0x228a('0x17')][_0x228a('0x19')]||null:null,'attributes':_0x2f71ad[_0x228a('0x17')]?_0x2f71ad[_0x228a('0x17')][_0x228a('0x1a')]||null:null,'limit':_0x2f71ad['options']?_0x2f71ad[_0x228a('0x17')]['limit']||null:null,'include':_0x2f71ad[_0x228a('0x17')]?_0x2f71ad['options'][_0x228a('0x1b')]?_[_0x228a('0x1c')](_0x2f71ad[_0x228a('0x17')][_0x228a('0x1b')],function(_0x1c2b93){return{'model':db[_0x1c2b93[_0x228a('0x1d')]],'as':_0x1c2b93['as'],'attributes':_0x1c2b93[_0x228a('0x1a')],'include':_0x1c2b93[_0x228a('0x1b')]?_[_0x228a('0x1c')](_0x1c2b93[_0x228a('0x1b')],function(_0x40a2b7){return{'model':db[_0x40a2b7['model']],'as':_0x40a2b7['as'],'attributes':_0x40a2b7['attributes'],'include':_0x40a2b7[_0x228a('0x1b')]?_[_0x228a('0x1c')](_0x40a2b7[_0x228a('0x1b')],function(_0x4c893e){return{'model':db[_0x4c893e[_0x228a('0x1d')]],'as':_0x4c893e['as'],'attributes':_0x4c893e[_0x228a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x228a('0x1e')](function(_0x574820){logger['info']('GetFreshdeskAccount',_0x2f71ad);logger[_0x228a('0x10')](_0x228a('0x1f'),_0x2f71ad,JSON['stringify'](_0x574820));_0x16c281(_0x574820);})[_0x228a('0x16')](function(_0x4065e0){logger['error']('GetFreshdeskAccount',_0x4065e0[_0x228a('0x14')],_0x2f71ad);_0x18004e(_0x2c764e[_0x228a('0x13')](0x1f4,_0x4065e0['message']));});});};exports['ShowFreshdeskAccount']=function(_0x20cb70){var _0x58eb46=this;return new Promise(function(_0x2811f1,_0x79dd28){return db[_0x228a('0x20')][_0x228a('0x21')]({'raw':_0x20cb70['options']?_0x20cb70[_0x228a('0x17')][_0x228a('0x18')]===undefined?!![]:![]:!![],'where':_0x20cb70['options']?_0x20cb70[_0x228a('0x17')][_0x228a('0x19')]||null:null,'attributes':_0x20cb70[_0x228a('0x17')]?_0x20cb70[_0x228a('0x17')][_0x228a('0x1a')]||null:null,'include':_0x20cb70[_0x228a('0x17')]?_0x20cb70[_0x228a('0x17')][_0x228a('0x1b')]?_[_0x228a('0x1c')](_0x20cb70[_0x228a('0x17')]['include'],function(_0x2b07bb){return{'model':db[_0x2b07bb[_0x228a('0x1d')]],'as':_0x2b07bb['as'],'attributes':_0x2b07bb[_0x228a('0x1a')],'include':_0x2b07bb['include']?_[_0x228a('0x1c')](_0x2b07bb[_0x228a('0x1b')],function(_0x2baa19){return{'model':db[_0x2baa19[_0x228a('0x1d')]],'as':_0x2baa19['as'],'attributes':_0x2baa19['attributes'],'include':_0x2baa19['include']?_[_0x228a('0x1c')](_0x2baa19[_0x228a('0x1b')],function(_0x5ae2b2){return{'model':db[_0x5ae2b2[_0x228a('0x1d')]],'as':_0x5ae2b2['as'],'attributes':_0x5ae2b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x228a('0x1e')](function(_0x11762b){logger[_0x228a('0xd')]('ShowFreshdeskAccount',_0x20cb70);logger[_0x228a('0x10')](_0x228a('0x22'),_0x20cb70,JSON[_0x228a('0x12')](_0x11762b));_0x2811f1(_0x11762b);})['catch'](function(_0x67e498){logger[_0x228a('0x13')](_0x228a('0x22'),_0x67e498[_0x228a('0x14')],_0x20cb70);_0x79dd28(_0x58eb46[_0x228a('0x13')](0x1f4,_0x67e498[_0x228a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 92d6a79..aa411ea 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 _0xb844=['isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','/:id'];(function(_0x5f4115,_0x265f66){var _0x1318cb=function(_0x5dce2e){while(--_0x5dce2e){_0x5f4115['push'](_0x5f4115['shift']());}};_0x1318cb(++_0x265f66);}(_0xb844,0x12e));var _0x4b84=function(_0x14d343,_0x52558f){_0x14d343=_0x14d343-0x0;var _0x2d7363=_0xb844[_0x14d343];return _0x2d7363;};'use strict';var multer=require('multer');var util=require(_0x4b84('0x0'));var path=require(_0x4b84('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b84('0x2'));var router=express[_0x4b84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4b84('0x4'));var interaction=require(_0x4b84('0x5'));var config=require(_0x4b84('0x6'));var controller=require(_0x4b84('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4b84('0x8')]);router['get'](_0x4b84('0x9'),auth[_0x4b84('0xa')](),controller['show']);router[_0x4b84('0xb')](_0x4b84('0xc'),auth[_0x4b84('0xa')](),controller[_0x4b84('0xd')]);router['get'](_0x4b84('0xe'),auth[_0x4b84('0xa')](),controller[_0x4b84('0xf')]);router[_0x4b84('0xb')](_0x4b84('0x10'),auth[_0x4b84('0xa')](),controller['getDescriptions']);router[_0x4b84('0xb')](_0x4b84('0x11'),auth[_0x4b84('0xa')](),controller[_0x4b84('0x12')]);router[_0x4b84('0x13')]('/',auth[_0x4b84('0xa')](),controller[_0x4b84('0x14')]);router[_0x4b84('0x13')](_0x4b84('0x11'),auth[_0x4b84('0xa')](),controller[_0x4b84('0x15')]);router[_0x4b84('0x16')](_0x4b84('0x9'),auth[_0x4b84('0xa')](),controller['update']);router[_0x4b84('0x17')]('/:id',auth[_0x4b84('0xa')](),controller[_0x4b84('0x18')]);module[_0x4b84('0x19')]=router; \ No newline at end of file +var _0xcffd=['getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x4f768a,_0x413685){var _0x4ab541=function(_0x213c3a){while(--_0x213c3a){_0x4f768a['push'](_0x4f768a['shift']());}};_0x4ab541(++_0x413685);}(_0xcffd,0xd1));var _0xdcff=function(_0x1cac0b,_0x5cb75){_0x1cac0b=_0x1cac0b-0x0;var _0x17d328=_0xcffd[_0x1cac0b];return _0x17d328;};'use strict';var multer=require(_0xdcff('0x0'));var util=require(_0xdcff('0x1'));var path=require('path');var timeout=require(_0xdcff('0x2'));var express=require(_0xdcff('0x3'));var router=express[_0xdcff('0x4')]();var fs_extra=require(_0xdcff('0x5'));var auth=require(_0xdcff('0x6'));var interaction=require(_0xdcff('0x7'));var config=require('../../config/environment');var controller=require(_0xdcff('0x8'));router[_0xdcff('0x9')]('/',auth['isAuthenticated'](),controller[_0xdcff('0xa')]);router[_0xdcff('0x9')](_0xdcff('0xb'),auth[_0xdcff('0xc')](),controller[_0xdcff('0xd')]);router[_0xdcff('0x9')](_0xdcff('0xe'),auth['isAuthenticated'](),controller[_0xdcff('0xf')]);router[_0xdcff('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xdcff('0x10')]);router['get']('/:id/descriptions',auth[_0xdcff('0xc')](),controller[_0xdcff('0x11')]);router[_0xdcff('0x9')](_0xdcff('0x12'),auth['isAuthenticated'](),controller[_0xdcff('0x13')]);router[_0xdcff('0x14')]('/',auth[_0xdcff('0xc')](),controller[_0xdcff('0x15')]);router[_0xdcff('0x14')](_0xdcff('0x12'),auth[_0xdcff('0xc')](),controller[_0xdcff('0x16')]);router[_0xdcff('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xdcff('0x18')]);router[_0xdcff('0x19')](_0xdcff('0xb'),auth[_0xdcff('0xc')](),controller[_0xdcff('0x1a')]);module[_0xdcff('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5c5c873..a3d3be4 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 _0x6ab7=['exports','STRING','sequelize'];(function(_0x2fea6e,_0x1ec3eb){var _0x252fbb=function(_0x246b4a){while(--_0x246b4a){_0x2fea6e['push'](_0x2fea6e['shift']());}};_0x252fbb(++_0x1ec3eb);}(_0x6ab7,0xb9));var _0x76ab=function(_0x5b6080,_0x7ef398){_0x5b6080=_0x5b6080-0x0;var _0x487dbf=_0x6ab7[_0x5b6080];return _0x487dbf;};'use strict';var Sequelize=require(_0x76ab('0x0'));module[_0x76ab('0x1')]={'name':{'type':Sequelize[_0x76ab('0x2')]},'description':{'type':Sequelize[_0x76ab('0x2')]}}; \ No newline at end of file +var _0x779f=['STRING','sequelize','exports'];(function(_0xc01f1c,_0x494f97){var _0x5cecc7=function(_0x43e898){while(--_0x43e898){_0xc01f1c['push'](_0xc01f1c['shift']());}};_0x5cecc7(++_0x494f97);}(_0x779f,0x139));var _0xf779=function(_0x5c10a1,_0x1e7b92){_0x5c10a1=_0x5c10a1-0x0;var _0x3fdb92=_0x779f[_0x5c10a1];return _0x3fdb92;};'use strict';var Sequelize=require(_0xf779('0x0'));module[_0xf779('0x1')]={'name':{'type':Sequelize[_0xf779('0x2')]},'description':{'type':Sequelize[_0xf779('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c72df98..de79156 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 _0x643c=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','create','catch','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x643c,0xed));var _0xc643=function(_0x423e2d,_0x265e39){_0x423e2d=_0x423e2d-0x0;var _0x28b57d=_0x643c[_0x423e2d];return _0x28b57d;};'use strict';var emlformat=require(_0xc643('0x0'));var rimraf=require(_0xc643('0x1'));var zipdir=require(_0xc643('0x2'));var jsonpatch=require(_0xc643('0x3'));var rp=require(_0xc643('0x4'));var moment=require(_0xc643('0x5'));var BPromise=require(_0xc643('0x6'));var Mustache=require('mustache');var util=require(_0xc643('0x7'));var path=require(_0xc643('0x8'));var sox=require(_0xc643('0x9'));var csv=require(_0xc643('0xa'));var ejs=require(_0xc643('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc643('0xc'));var squel=require(_0xc643('0xd'));var crypto=require(_0xc643('0xe'));var jsforce=require(_0xc643('0xf'));var deskjs=require(_0xc643('0x10'));var toCsv=require(_0xc643('0xa'));var querystring=require('querystring');var Papa=require(_0xc643('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc643('0x12'));var as=require(_0xc643('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc643('0x14'));var utils=require(_0xc643('0x15'));var config=require(_0xc643('0x16'));var licenseUtil=require(_0xc643('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124c69,_0xc7307){_0xc7307=_0xc7307||0xcc;return function(_0x1c496b){if(_0x1c496b){return _0x124c69[_0xc643('0x18')](_0xc7307);}return _0x124c69['status'](_0xc7307)[_0xc643('0x19')]();};}function respondWithResult(_0x2b0f22,_0x50d691){_0x50d691=_0x50d691||0xc8;return function(_0xa16e53){if(_0xa16e53){return _0x2b0f22[_0xc643('0x1a')](_0x50d691)[_0xc643('0x1b')](_0xa16e53);}};}function respondWithFilteredResult(_0x4e1707,_0x48d8f5){return function(_0x4b75a9){if(_0x4b75a9){var _0x2f4c4b=typeof _0x48d8f5[_0xc643('0x1c')]===_0xc643('0x1d')&&typeof _0x48d8f5[_0xc643('0x1e')]===_0xc643('0x1d');var _0x1d3542=_0x4b75a9['count'];var _0x4e5d84=_0x2f4c4b?0x0:_0x48d8f5['offset'];var _0xf8ca96=_0x2f4c4b?_0x4b75a9[_0xc643('0x1f')]:_0x48d8f5[_0xc643('0x1c')]+_0x48d8f5[_0xc643('0x1e')];var _0x4c01f2;if(_0xf8ca96>=_0x1d3542){_0xf8ca96=_0x1d3542;_0x4c01f2=0xc8;}else{_0x4c01f2=0xce;}_0x4e1707[_0xc643('0x1a')](_0x4c01f2);return _0x4e1707[_0xc643('0x20')]('Content-Range',_0x4e5d84+'-'+_0xf8ca96+'/'+_0x1d3542)['json'](_0x4b75a9);}return null;};}function patchUpdates(_0x445c97){return function(_0x3eff50){try{jsonpatch[_0xc643('0x21')](_0x3eff50,_0x445c97,!![]);}catch(_0x579661){return BPromise[_0xc643('0x22')](_0x579661);}return _0x3eff50[_0xc643('0x23')]();};}function saveUpdates(_0x2ff238,_0x355388){return function(_0x242bd6){if(_0x242bd6){return _0x242bd6[_0xc643('0x24')](_0x2ff238)[_0xc643('0x25')](function(_0x395a23){return _0x395a23;});}return null;};}function removeEntity(_0x26cc8f,_0x54d707){return function(_0x4f3610){if(_0x4f3610){return _0x4f3610[_0xc643('0x26')]()['then'](function(){_0x26cc8f[_0xc643('0x1a')](0xcc)[_0xc643('0x19')]();});}};}function handleEntityNotFound(_0x4c5219,_0x469e44){return function(_0x23453b){if(!_0x23453b){_0x4c5219[_0xc643('0x18')](0x194);}return _0x23453b;};}function handleError(_0x577767,_0x5a4070){_0x5a4070=_0x5a4070||0x1f4;return function(_0x257b1f){logger[_0xc643('0x27')](_0x257b1f[_0xc643('0x28')]);if(_0x257b1f[_0xc643('0x29')]){delete _0x257b1f['name'];}_0x577767[_0xc643('0x1a')](_0x5a4070)[_0xc643('0x2a')](_0x257b1f);};}exports[_0xc643('0x2b')]=function(_0x18d1b8,_0x10e21b){var _0x356320={},_0x2a2feb={},_0x290ff3={'count':0x0,'rows':[]};var _0x4a1fca=_[_0xc643('0x2c')](db[_0xc643('0x2d')][_0xc643('0x2e')],function(_0x1efe5f){return{'name':_0x1efe5f[_0xc643('0x2f')],'type':_0x1efe5f[_0xc643('0x30')][_0xc643('0x31')]};});_0x2a2feb[_0xc643('0x32')]=_[_0xc643('0x2c')](_0x4a1fca,_0xc643('0x29'));_0x2a2feb['query']=_[_0xc643('0x33')](_0x18d1b8['query']);_0x2a2feb['filters']=_[_0xc643('0x34')](_0x2a2feb[_0xc643('0x32')],_0x2a2feb['query']);_0x356320[_0xc643('0x35')]=_['intersection'](_0x2a2feb[_0xc643('0x32')],qs['fields'](_0x18d1b8[_0xc643('0x36')]['fields']));_0x356320[_0xc643('0x35')]=_0x356320[_0xc643('0x35')][_0xc643('0x37')]?_0x356320['attributes']:_0x2a2feb[_0xc643('0x32')];if(!_0x18d1b8[_0xc643('0x36')][_0xc643('0x38')](_0xc643('0x39'))){_0x356320[_0xc643('0x1e')]=qs['limit'](_0x18d1b8[_0xc643('0x36')][_0xc643('0x1e')]);_0x356320[_0xc643('0x1c')]=qs[_0xc643('0x1c')](_0x18d1b8[_0xc643('0x36')][_0xc643('0x1c')]);}_0x356320[_0xc643('0x3a')]=qs[_0xc643('0x3b')](_0x18d1b8[_0xc643('0x36')][_0xc643('0x3b')]);_0x356320[_0xc643('0x3c')]=qs[_0xc643('0x3d')](_[_0xc643('0x3e')](_0x18d1b8[_0xc643('0x36')],_0x2a2feb[_0xc643('0x3d')]),_0x4a1fca);if(_0x18d1b8[_0xc643('0x36')][_0xc643('0x3f')]){_0x356320[_0xc643('0x3c')]=_[_0xc643('0x40')](_0x356320[_0xc643('0x3c')],{'$or':_['map'](_0x4a1fca,function(_0x5cb9e3){if(_0x5cb9e3[_0xc643('0x30')]!==_0xc643('0x41')){var _0x13232d={};_0x13232d[_0x5cb9e3[_0xc643('0x29')]]={'$like':'%'+_0x18d1b8[_0xc643('0x36')]['filter']+'%'};return _0x13232d;}})});}_0x356320=_[_0xc643('0x40')]({},_0x356320,_0x18d1b8[_0xc643('0x42')]);var _0x19c5fe={'where':_0x356320['where']};return db['FreshdeskConfiguration'][_0xc643('0x1f')](_0x19c5fe)['then'](function(_0x1b3512){_0x290ff3[_0xc643('0x1f')]=_0x1b3512;if(_0x18d1b8['query'][_0xc643('0x43')]){_0x356320['include']=[{'all':!![]}];}return db[_0xc643('0x2d')][_0xc643('0x44')](_0x356320);})['then'](function(_0x37a4ab){_0x290ff3[_0xc643('0x45')]=_0x37a4ab;return _0x290ff3;})[_0xc643('0x25')](respondWithFilteredResult(_0x10e21b,_0x356320))['catch'](handleError(_0x10e21b,null));};exports[_0xc643('0x46')]=function(_0x402d95,_0x4401e1){var _0x2ea9c1={'raw':![],'where':{'id':_0x402d95[_0xc643('0x47')]['id']}},_0x10aa22={};_0x10aa22[_0xc643('0x32')]=_[_0xc643('0x33')](db[_0xc643('0x2d')]['rawAttributes']);_0x10aa22['query']=_[_0xc643('0x33')](_0x402d95['query']);_0x10aa22[_0xc643('0x3d')]=_[_0xc643('0x34')](_0x10aa22[_0xc643('0x32')],_0x10aa22[_0xc643('0x36')]);_0x2ea9c1[_0xc643('0x35')]=_[_0xc643('0x34')](_0x10aa22[_0xc643('0x32')],qs[_0xc643('0x48')](_0x402d95['query']['fields']));_0x2ea9c1[_0xc643('0x35')]=_0x2ea9c1['attributes']['length']?_0x2ea9c1[_0xc643('0x35')]:_0x10aa22['model'];if(_0x402d95[_0xc643('0x36')][_0xc643('0x43')]){_0x2ea9c1[_0xc643('0x49')]=[{'all':!![]}];}_0x2ea9c1=_['merge']({},_0x2ea9c1,_0x402d95[_0xc643('0x42')]);return db[_0xc643('0x2d')][_0xc643('0x4a')](_0x2ea9c1)[_0xc643('0x25')](handleEntityNotFound(_0x4401e1,null))[_0xc643('0x25')](respondWithResult(_0x4401e1,null))['catch'](handleError(_0x4401e1,null));};exports[_0xc643('0x4b')]=function(_0x41699d,_0x2699d1){return db['FreshdeskConfiguration']['create'](_0x41699d['body'],{})[_0xc643('0x25')](respondWithResult(_0x2699d1,0xc9))[_0xc643('0x4c')](handleError(_0x2699d1,null));};exports['update']=function(_0x8fb9a2,_0x4a5079){if(_0x8fb9a2[_0xc643('0x4d')]['id']){delete _0x8fb9a2['body']['id'];}return db[_0xc643('0x2d')][_0xc643('0x4a')]({'where':{'id':_0x8fb9a2[_0xc643('0x47')]['id']}})[_0xc643('0x25')](handleEntityNotFound(_0x4a5079,null))[_0xc643('0x25')](saveUpdates(_0x8fb9a2[_0xc643('0x4d')],null))['then'](respondWithResult(_0x4a5079,null))[_0xc643('0x4c')](handleError(_0x4a5079,null));};exports[_0xc643('0x26')]=function(_0x3a91d8,_0x3f3abb){return db[_0xc643('0x2d')][_0xc643('0x4a')]({'where':{'id':_0x3a91d8[_0xc643('0x47')]['id']}})[_0xc643('0x25')](handleEntityNotFound(_0x3f3abb,null))[_0xc643('0x25')](removeEntity(_0x3f3abb,null))[_0xc643('0x4c')](handleError(_0x3f3abb,null));};exports[_0xc643('0x4e')]=function(_0x3bb25d,_0xae7ed7,_0x4ac56f){var _0x1fa2cf={};var _0xe166a3={};var _0x162e5d;var _0x29c92c;return db['FreshdeskConfiguration'][_0xc643('0x4f')]({'where':{'id':_0x3bb25d['params']['id']}})[_0xc643('0x25')](handleEntityNotFound(_0xae7ed7,null))[_0xc643('0x25')](function(_0x853ce3){if(_0x853ce3){_0x162e5d=_0x853ce3;_0xe166a3[_0xc643('0x32')]=_['keys'](db['FreshdeskField'][_0xc643('0x2e')]);_0xe166a3['query']=_[_0xc643('0x33')](_0x3bb25d[_0xc643('0x36')]);_0xe166a3[_0xc643('0x3d')]=_[_0xc643('0x34')](_0xe166a3[_0xc643('0x32')],_0xe166a3[_0xc643('0x36')]);_0x1fa2cf[_0xc643('0x35')]=_[_0xc643('0x34')](_0xe166a3[_0xc643('0x32')],qs[_0xc643('0x48')](_0x3bb25d[_0xc643('0x36')][_0xc643('0x48')]));_0x1fa2cf[_0xc643('0x35')]=_0x1fa2cf['attributes']['length']?_0x1fa2cf[_0xc643('0x35')]:_0xe166a3[_0xc643('0x32')];_0x1fa2cf[_0xc643('0x3a')]=qs['sort'](_0x3bb25d[_0xc643('0x36')][_0xc643('0x3b')]);_0x1fa2cf['where']=qs['filters'](_[_0xc643('0x3e')](_0x3bb25d[_0xc643('0x36')],_0xe166a3[_0xc643('0x3d')]));if(_0x3bb25d[_0xc643('0x36')][_0xc643('0x3f')]){_0x1fa2cf['where']=_['merge'](_0x1fa2cf[_0xc643('0x3c')],{'$or':_[_0xc643('0x2c')](_0x1fa2cf[_0xc643('0x35')],function(_0x4a7c68){var _0x5c5ce2={};_0x5c5ce2[_0x4a7c68]={'$like':'%'+_0x3bb25d[_0xc643('0x36')]['filter']+'%'};return _0x5c5ce2;})});}_0x1fa2cf=_['merge']({},_0x1fa2cf,_0x3bb25d[_0xc643('0x42')]);return _0x162e5d[_0xc643('0x4e')](_0x1fa2cf);}})['then'](function(_0x5e3573){if(_0x5e3573){_0x29c92c=_0x5e3573[_0xc643('0x37')];if(!_0x3bb25d['query'][_0xc643('0x38')]('nolimit')){_0x1fa2cf[_0xc643('0x1e')]=qs[_0xc643('0x1e')](_0x3bb25d[_0xc643('0x36')]['limit']);_0x1fa2cf[_0xc643('0x1c')]=qs['offset'](_0x3bb25d['query'][_0xc643('0x1c')]);}return _0x162e5d[_0xc643('0x4e')](_0x1fa2cf);}})['then'](function(_0x46f3ba){if(_0x46f3ba){return _0x46f3ba?{'count':_0x29c92c,'rows':_0x46f3ba}:null;}})['then'](respondWithResult(_0xae7ed7,null))[_0xc643('0x4c')](handleError(_0xae7ed7,null));};exports['getSubjects']=function(_0x2c2080,_0x32a178,_0x52c3ad){var _0x597952={};var _0x27cf30={};var _0x6ab527;var _0x4b5d24;return db[_0xc643('0x2d')][_0xc643('0x4f')]({'where':{'id':_0x2c2080[_0xc643('0x47')]['id']}})[_0xc643('0x25')](handleEntityNotFound(_0x32a178,null))[_0xc643('0x25')](function(_0x5a3576){if(_0x5a3576){_0x6ab527=_0x5a3576;_0x27cf30[_0xc643('0x32')]=_[_0xc643('0x33')](db[_0xc643('0x50')][_0xc643('0x2e')]);_0x27cf30[_0xc643('0x36')]=_[_0xc643('0x33')](_0x2c2080['query']);_0x27cf30['filters']=_['intersection'](_0x27cf30[_0xc643('0x32')],_0x27cf30['query']);_0x597952[_0xc643('0x35')]=_['intersection'](_0x27cf30[_0xc643('0x32')],qs['fields'](_0x2c2080['query']['fields']));_0x597952[_0xc643('0x35')]=_0x597952['attributes'][_0xc643('0x37')]?_0x597952[_0xc643('0x35')]:_0x27cf30['model'];_0x597952['order']=qs['sort'](_0x2c2080[_0xc643('0x36')]['sort']);_0x597952['where']=qs[_0xc643('0x3d')](_[_0xc643('0x3e')](_0x2c2080['query'],_0x27cf30['filters']));if(_0x2c2080[_0xc643('0x36')][_0xc643('0x3f')]){_0x597952['where']=_['merge'](_0x597952[_0xc643('0x3c')],{'$or':_[_0xc643('0x2c')](_0x597952['attributes'],function(_0x4b0050){var _0x4c5c02={};_0x4c5c02[_0x4b0050]={'$like':'%'+_0x2c2080[_0xc643('0x36')][_0xc643('0x3f')]+'%'};return _0x4c5c02;})});}_0x597952=_[_0xc643('0x40')]({},_0x597952,_0x2c2080['options']);return _0x6ab527[_0xc643('0x51')](_0x597952);}})[_0xc643('0x25')](function(_0x20343f){if(_0x20343f){_0x4b5d24=_0x20343f[_0xc643('0x37')];if(!_0x2c2080[_0xc643('0x36')]['hasOwnProperty'](_0xc643('0x39'))){_0x597952[_0xc643('0x1e')]=qs[_0xc643('0x1e')](_0x2c2080[_0xc643('0x36')][_0xc643('0x1e')]);_0x597952[_0xc643('0x1c')]=qs[_0xc643('0x1c')](_0x2c2080[_0xc643('0x36')][_0xc643('0x1c')]);}return _0x6ab527['getSubjects'](_0x597952);}})[_0xc643('0x25')](function(_0xac1a90){if(_0xac1a90){return _0xac1a90?{'count':_0x4b5d24,'rows':_0xac1a90}:null;}})[_0xc643('0x25')](respondWithResult(_0x32a178,null))['catch'](handleError(_0x32a178,null));};exports['getDescriptions']=function(_0x4121b7,_0x489816,_0xfc9b5d){var _0x3654b={};var _0x52f6ca={};var _0xdeb0;var _0x34e20e;return db[_0xc643('0x2d')][_0xc643('0x4f')]({'where':{'id':_0x4121b7[_0xc643('0x47')]['id']}})['then'](handleEntityNotFound(_0x489816,null))[_0xc643('0x25')](function(_0x5a1c90){if(_0x5a1c90){_0xdeb0=_0x5a1c90;_0x52f6ca[_0xc643('0x32')]=_['keys'](db[_0xc643('0x50')][_0xc643('0x2e')]);_0x52f6ca['query']=_[_0xc643('0x33')](_0x4121b7[_0xc643('0x36')]);_0x52f6ca[_0xc643('0x3d')]=_[_0xc643('0x34')](_0x52f6ca['model'],_0x52f6ca[_0xc643('0x36')]);_0x3654b[_0xc643('0x35')]=_[_0xc643('0x34')](_0x52f6ca[_0xc643('0x32')],qs[_0xc643('0x48')](_0x4121b7[_0xc643('0x36')][_0xc643('0x48')]));_0x3654b[_0xc643('0x35')]=_0x3654b[_0xc643('0x35')]['length']?_0x3654b[_0xc643('0x35')]:_0x52f6ca[_0xc643('0x32')];_0x3654b[_0xc643('0x3a')]=qs[_0xc643('0x3b')](_0x4121b7[_0xc643('0x36')][_0xc643('0x3b')]);_0x3654b[_0xc643('0x3c')]=qs[_0xc643('0x3d')](_[_0xc643('0x3e')](_0x4121b7[_0xc643('0x36')],_0x52f6ca['filters']));if(_0x4121b7[_0xc643('0x36')][_0xc643('0x3f')]){_0x3654b[_0xc643('0x3c')]=_[_0xc643('0x40')](_0x3654b['where'],{'$or':_[_0xc643('0x2c')](_0x3654b[_0xc643('0x35')],function(_0x234875){var _0x35b562={};_0x35b562[_0x234875]={'$like':'%'+_0x4121b7[_0xc643('0x36')]['filter']+'%'};return _0x35b562;})});}_0x3654b=_['merge']({},_0x3654b,_0x4121b7[_0xc643('0x42')]);return _0xdeb0[_0xc643('0x52')](_0x3654b);}})[_0xc643('0x25')](function(_0x4fb484){if(_0x4fb484){_0x34e20e=_0x4fb484[_0xc643('0x37')];if(!_0x4121b7[_0xc643('0x36')][_0xc643('0x38')](_0xc643('0x39'))){_0x3654b[_0xc643('0x1e')]=qs[_0xc643('0x1e')](_0x4121b7[_0xc643('0x36')][_0xc643('0x1e')]);_0x3654b[_0xc643('0x1c')]=qs[_0xc643('0x1c')](_0x4121b7[_0xc643('0x36')][_0xc643('0x1c')]);}return _0xdeb0['getDescriptions'](_0x3654b);}})[_0xc643('0x25')](function(_0x4c0a10){if(_0x4c0a10){return _0x4c0a10?{'count':_0x34e20e,'rows':_0x4c0a10}:null;}})[_0xc643('0x25')](respondWithResult(_0x489816,null))[_0xc643('0x4c')](handleError(_0x489816,null));};exports[_0xc643('0x53')]=function(_0x529b93,_0x292191,_0x2bbc21){var _0x2691d4={};var _0x1d7807={};var _0x5955ed;var _0x31eb90;return db[_0xc643('0x2d')][_0xc643('0x4f')]({'where':{'id':_0x529b93[_0xc643('0x47')]['id']}})[_0xc643('0x25')](handleEntityNotFound(_0x292191,null))[_0xc643('0x25')](function(_0xaeef24){if(_0xaeef24){_0x5955ed=_0xaeef24;_0x1d7807[_0xc643('0x32')]=_['keys'](db[_0xc643('0x54')][_0xc643('0x2e')]);_0x1d7807[_0xc643('0x36')]=_[_0xc643('0x33')](_0x529b93[_0xc643('0x36')]);_0x1d7807[_0xc643('0x3d')]=_[_0xc643('0x34')](_0x1d7807['model'],_0x1d7807[_0xc643('0x36')]);_0x2691d4[_0xc643('0x35')]=_['intersection'](_0x1d7807[_0xc643('0x32')],qs[_0xc643('0x48')](_0x529b93['query']['fields']));_0x2691d4[_0xc643('0x35')]=_0x2691d4['attributes'][_0xc643('0x37')]?_0x2691d4[_0xc643('0x35')]:_0x1d7807[_0xc643('0x32')];_0x2691d4[_0xc643('0x3a')]=qs[_0xc643('0x3b')](_0x529b93[_0xc643('0x36')][_0xc643('0x3b')]);_0x2691d4[_0xc643('0x3c')]=qs[_0xc643('0x3d')](_[_0xc643('0x3e')](_0x529b93['query'],_0x1d7807['filters']));if(_0x529b93[_0xc643('0x36')]['filter']){_0x2691d4[_0xc643('0x3c')]=_[_0xc643('0x40')](_0x2691d4['where'],{'$or':_[_0xc643('0x2c')](_0x2691d4[_0xc643('0x35')],function(_0x3e1961){var _0x1d41d4={};_0x1d41d4[_0x3e1961]={'$like':'%'+_0x529b93['query']['filter']+'%'};return _0x1d41d4;})});}_0x2691d4=_[_0xc643('0x40')]({},_0x2691d4,_0x529b93['options']);return _0x5955ed[_0xc643('0x53')](_0x2691d4);}})[_0xc643('0x25')](function(_0x2e5de9){if(_0x2e5de9){_0x31eb90=_0x2e5de9[_0xc643('0x37')];if(!_0x529b93[_0xc643('0x36')][_0xc643('0x38')](_0xc643('0x39'))){_0x2691d4[_0xc643('0x1e')]=qs[_0xc643('0x1e')](_0x529b93[_0xc643('0x36')][_0xc643('0x1e')]);_0x2691d4['offset']=qs[_0xc643('0x1c')](_0x529b93['query'][_0xc643('0x1c')]);}return _0x5955ed[_0xc643('0x53')](_0x2691d4);}})[_0xc643('0x25')](function(_0x11b801){if(_0x11b801){return _0x11b801?{'count':_0x31eb90,'rows':_0x11b801}:null;}})['then'](respondWithResult(_0x292191,null))[_0xc643('0x4c')](handleError(_0x292191,null));};exports[_0xc643('0x55')]=function(_0xc5c7a8,_0x15c409,_0x35d126){if(_0xc5c7a8[_0xc643('0x4d')]['id']){delete _0xc5c7a8['body']['id'];}return db['FreshdeskConfiguration'][_0xc643('0x4f')]({'where':{'id':_0xc5c7a8['params']['id']}})[_0xc643('0x25')](handleEntityNotFound(_0x15c409,null))['then'](function(_0x134014){if(_0x134014){return _0x134014[_0xc643('0x55')](_0xc5c7a8[_0xc643('0x4d')][_0xc643('0x56')]||[]);}return null;})['then'](respondWithResult(_0x15c409,null))['catch'](handleError(_0x15c409,null));}; \ No newline at end of file +var _0x0d14=['include','findAll','rows','catch','show','merge','create','body','find','params','findOne','FreshdeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','limit','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll'];(function(_0x20cfbe,_0x17e507){var _0x32f9ef=function(_0xff6c25){while(--_0xff6c25){_0x20cfbe['push'](_0x20cfbe['shift']());}};_0x32f9ef(++_0x17e507);}(_0x0d14,0x10c));var _0x40d1=function(_0x1cb5d2,_0x2d83fd){_0x1cb5d2=_0x1cb5d2-0x0;var _0x3e3904=_0x0d14[_0x1cb5d2];return _0x3e3904;};'use strict';var emlformat=require(_0x40d1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x40d1('0x1'));var rp=require('request-promise');var moment=require(_0x40d1('0x2'));var BPromise=require(_0x40d1('0x3'));var Mustache=require(_0x40d1('0x4'));var util=require(_0x40d1('0x5'));var path=require(_0x40d1('0x6'));var sox=require(_0x40d1('0x7'));var csv=require(_0x40d1('0x8'));var ejs=require(_0x40d1('0x9'));var fs=require('fs');var fs_extra=require(_0x40d1('0xa'));var _=require(_0x40d1('0xb'));var squel=require(_0x40d1('0xc'));var crypto=require(_0x40d1('0xd'));var jsforce=require(_0x40d1('0xe'));var deskjs=require(_0x40d1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x40d1('0x10'));var Papa=require(_0x40d1('0x11'));var Redis=require(_0x40d1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x40d1('0x13'));var as=require(_0x40d1('0x14'));var hardwareService=require(_0x40d1('0x15'));var logger=require(_0x40d1('0x16'))('api');var utils=require(_0x40d1('0x17'));var config=require(_0x40d1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x40d1('0x19'))['db'];function respondWithStatusCode(_0x596ac6,_0x573a62){_0x573a62=_0x573a62||0xcc;return function(_0x13fbe0){if(_0x13fbe0){return _0x596ac6['sendStatus'](_0x573a62);}return _0x596ac6[_0x40d1('0x1a')](_0x573a62)[_0x40d1('0x1b')]();};}function respondWithResult(_0x444eb3,_0x3e04d6){_0x3e04d6=_0x3e04d6||0xc8;return function(_0xfe6c1a){if(_0xfe6c1a){return _0x444eb3[_0x40d1('0x1a')](_0x3e04d6)[_0x40d1('0x1c')](_0xfe6c1a);}};}function respondWithFilteredResult(_0x5987cd,_0x3c8d12){return function(_0x26994e){if(_0x26994e){var _0x568244=typeof _0x3c8d12[_0x40d1('0x1d')]==='undefined'&&typeof _0x3c8d12['limit']==='undefined';var _0x5b0a58=_0x26994e[_0x40d1('0x1e')];var _0x2b7df5=_0x568244?0x0:_0x3c8d12[_0x40d1('0x1d')];var _0x540049=_0x568244?_0x26994e['count']:_0x3c8d12[_0x40d1('0x1d')]+_0x3c8d12[_0x40d1('0x1f')];var _0x1cfb8b;if(_0x540049>=_0x5b0a58){_0x540049=_0x5b0a58;_0x1cfb8b=0xc8;}else{_0x1cfb8b=0xce;}_0x5987cd[_0x40d1('0x1a')](_0x1cfb8b);return _0x5987cd['set']('Content-Range',_0x2b7df5+'-'+_0x540049+'/'+_0x5b0a58)[_0x40d1('0x1c')](_0x26994e);}return null;};}function patchUpdates(_0x112c15){return function(_0x26ff08){try{jsonpatch[_0x40d1('0x20')](_0x26ff08,_0x112c15,!![]);}catch(_0x88b1ec){return BPromise[_0x40d1('0x21')](_0x88b1ec);}return _0x26ff08[_0x40d1('0x22')]();};}function saveUpdates(_0x458901,_0x1b2fea){return function(_0x27f1a1){if(_0x27f1a1){return _0x27f1a1[_0x40d1('0x23')](_0x458901)[_0x40d1('0x24')](function(_0x4482b0){return _0x4482b0;});}return null;};}function removeEntity(_0x2dc51a,_0x30cca3){return function(_0x2fd080){if(_0x2fd080){return _0x2fd080[_0x40d1('0x25')]()[_0x40d1('0x24')](function(){_0x2dc51a[_0x40d1('0x1a')](0xcc)[_0x40d1('0x1b')]();});}};}function handleEntityNotFound(_0x46e85e,_0x649a31){return function(_0x381c33){if(!_0x381c33){_0x46e85e['sendStatus'](0x194);}return _0x381c33;};}function handleError(_0x302a57,_0x395eae){_0x395eae=_0x395eae||0x1f4;return function(_0x58b178){logger[_0x40d1('0x26')](_0x58b178['stack']);if(_0x58b178[_0x40d1('0x27')]){delete _0x58b178[_0x40d1('0x27')];}_0x302a57['status'](_0x395eae)[_0x40d1('0x28')](_0x58b178);};}exports[_0x40d1('0x29')]=function(_0xc8a3a5,_0x57f724){var _0x21a15d={},_0x41916a={},_0x5effbe={'count':0x0,'rows':[]};var _0x2849c0=_[_0x40d1('0x2a')](db[_0x40d1('0x2b')][_0x40d1('0x2c')],function(_0x2bd6ec){return{'name':_0x2bd6ec['fieldName'],'type':_0x2bd6ec[_0x40d1('0x2d')][_0x40d1('0x2e')]};});_0x41916a['model']=_[_0x40d1('0x2a')](_0x2849c0,_0x40d1('0x27'));_0x41916a[_0x40d1('0x2f')]=_[_0x40d1('0x30')](_0xc8a3a5['query']);_0x41916a['filters']=_[_0x40d1('0x31')](_0x41916a[_0x40d1('0x32')],_0x41916a[_0x40d1('0x2f')]);_0x21a15d[_0x40d1('0x33')]=_[_0x40d1('0x31')](_0x41916a[_0x40d1('0x32')],qs[_0x40d1('0x34')](_0xc8a3a5[_0x40d1('0x2f')][_0x40d1('0x34')]));_0x21a15d[_0x40d1('0x33')]=_0x21a15d[_0x40d1('0x33')][_0x40d1('0x35')]?_0x21a15d[_0x40d1('0x33')]:_0x41916a[_0x40d1('0x32')];if(!_0xc8a3a5[_0x40d1('0x2f')][_0x40d1('0x36')]('nolimit')){_0x21a15d[_0x40d1('0x1f')]=qs[_0x40d1('0x1f')](_0xc8a3a5[_0x40d1('0x2f')][_0x40d1('0x1f')]);_0x21a15d[_0x40d1('0x1d')]=qs[_0x40d1('0x1d')](_0xc8a3a5[_0x40d1('0x2f')]['offset']);}_0x21a15d[_0x40d1('0x37')]=qs[_0x40d1('0x38')](_0xc8a3a5[_0x40d1('0x2f')]['sort']);_0x21a15d[_0x40d1('0x39')]=qs['filters'](_[_0x40d1('0x3a')](_0xc8a3a5[_0x40d1('0x2f')],_0x41916a[_0x40d1('0x3b')]),_0x2849c0);if(_0xc8a3a5[_0x40d1('0x2f')][_0x40d1('0x3c')]){_0x21a15d[_0x40d1('0x39')]=_['merge'](_0x21a15d[_0x40d1('0x39')],{'$or':_[_0x40d1('0x2a')](_0x2849c0,function(_0x46eb53){if(_0x46eb53[_0x40d1('0x2d')]!==_0x40d1('0x3d')){var _0x19d1c6={};_0x19d1c6[_0x46eb53[_0x40d1('0x27')]]={'$like':'%'+_0xc8a3a5[_0x40d1('0x2f')]['filter']+'%'};return _0x19d1c6;}})});}_0x21a15d=_['merge']({},_0x21a15d,_0xc8a3a5[_0x40d1('0x3e')]);var _0x5cc7d1={'where':_0x21a15d[_0x40d1('0x39')]};return db['FreshdeskConfiguration'][_0x40d1('0x1e')](_0x5cc7d1)[_0x40d1('0x24')](function(_0x1019e7){_0x5effbe['count']=_0x1019e7;if(_0xc8a3a5['query'][_0x40d1('0x3f')]){_0x21a15d[_0x40d1('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x40d1('0x41')](_0x21a15d);})[_0x40d1('0x24')](function(_0xcb9637){_0x5effbe[_0x40d1('0x42')]=_0xcb9637;return _0x5effbe;})['then'](respondWithFilteredResult(_0x57f724,_0x21a15d))[_0x40d1('0x43')](handleError(_0x57f724,null));};exports[_0x40d1('0x44')]=function(_0x26d7a0,_0xd209be){var _0xc8627a={'raw':![],'where':{'id':_0x26d7a0['params']['id']}},_0x3dbcdb={};_0x3dbcdb['model']=_['keys'](db[_0x40d1('0x2b')][_0x40d1('0x2c')]);_0x3dbcdb['query']=_[_0x40d1('0x30')](_0x26d7a0[_0x40d1('0x2f')]);_0x3dbcdb[_0x40d1('0x3b')]=_[_0x40d1('0x31')](_0x3dbcdb[_0x40d1('0x32')],_0x3dbcdb[_0x40d1('0x2f')]);_0xc8627a[_0x40d1('0x33')]=_['intersection'](_0x3dbcdb[_0x40d1('0x32')],qs[_0x40d1('0x34')](_0x26d7a0[_0x40d1('0x2f')][_0x40d1('0x34')]));_0xc8627a[_0x40d1('0x33')]=_0xc8627a['attributes']['length']?_0xc8627a[_0x40d1('0x33')]:_0x3dbcdb[_0x40d1('0x32')];if(_0x26d7a0[_0x40d1('0x2f')][_0x40d1('0x3f')]){_0xc8627a['include']=[{'all':!![]}];}_0xc8627a=_[_0x40d1('0x45')]({},_0xc8627a,_0x26d7a0['options']);return db['FreshdeskConfiguration']['find'](_0xc8627a)['then'](handleEntityNotFound(_0xd209be,null))[_0x40d1('0x24')](respondWithResult(_0xd209be,null))[_0x40d1('0x43')](handleError(_0xd209be,null));};exports[_0x40d1('0x46')]=function(_0x1e6b56,_0x35d76d){return db[_0x40d1('0x2b')][_0x40d1('0x46')](_0x1e6b56[_0x40d1('0x47')],{})[_0x40d1('0x24')](respondWithResult(_0x35d76d,0xc9))['catch'](handleError(_0x35d76d,null));};exports[_0x40d1('0x23')]=function(_0x2aa811,_0x123516){if(_0x2aa811[_0x40d1('0x47')]['id']){delete _0x2aa811['body']['id'];}return db[_0x40d1('0x2b')]['find']({'where':{'id':_0x2aa811['params']['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x123516,null))['then'](saveUpdates(_0x2aa811[_0x40d1('0x47')],null))[_0x40d1('0x24')](respondWithResult(_0x123516,null))['catch'](handleError(_0x123516,null));};exports['destroy']=function(_0x51c3e5,_0x1260d8){return db[_0x40d1('0x2b')][_0x40d1('0x48')]({'where':{'id':_0x51c3e5[_0x40d1('0x49')]['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x1260d8,null))[_0x40d1('0x24')](removeEntity(_0x1260d8,null))[_0x40d1('0x43')](handleError(_0x1260d8,null));};exports['getFields']=function(_0x4260c7,_0x2a247a,_0x453f0a){var _0xbc728={};var _0x1dec9d={};var _0x3dd996;var _0x165f7d;return db[_0x40d1('0x2b')][_0x40d1('0x4a')]({'where':{'id':_0x4260c7['params']['id']}})['then'](handleEntityNotFound(_0x2a247a,null))[_0x40d1('0x24')](function(_0x14fede){if(_0x14fede){_0x3dd996=_0x14fede;_0x1dec9d[_0x40d1('0x32')]=_[_0x40d1('0x30')](db[_0x40d1('0x4b')][_0x40d1('0x2c')]);_0x1dec9d[_0x40d1('0x2f')]=_[_0x40d1('0x30')](_0x4260c7[_0x40d1('0x2f')]);_0x1dec9d[_0x40d1('0x3b')]=_[_0x40d1('0x31')](_0x1dec9d['model'],_0x1dec9d[_0x40d1('0x2f')]);_0xbc728[_0x40d1('0x33')]=_['intersection'](_0x1dec9d[_0x40d1('0x32')],qs[_0x40d1('0x34')](_0x4260c7['query'][_0x40d1('0x34')]));_0xbc728[_0x40d1('0x33')]=_0xbc728[_0x40d1('0x33')]['length']?_0xbc728[_0x40d1('0x33')]:_0x1dec9d[_0x40d1('0x32')];_0xbc728[_0x40d1('0x37')]=qs[_0x40d1('0x38')](_0x4260c7[_0x40d1('0x2f')]['sort']);_0xbc728['where']=qs[_0x40d1('0x3b')](_[_0x40d1('0x3a')](_0x4260c7[_0x40d1('0x2f')],_0x1dec9d[_0x40d1('0x3b')]));if(_0x4260c7[_0x40d1('0x2f')][_0x40d1('0x3c')]){_0xbc728['where']=_['merge'](_0xbc728[_0x40d1('0x39')],{'$or':_[_0x40d1('0x2a')](_0xbc728[_0x40d1('0x33')],function(_0x27f823){var _0x40c743={};_0x40c743[_0x27f823]={'$like':'%'+_0x4260c7[_0x40d1('0x2f')]['filter']+'%'};return _0x40c743;})});}_0xbc728=_[_0x40d1('0x45')]({},_0xbc728,_0x4260c7[_0x40d1('0x3e')]);return _0x3dd996[_0x40d1('0x4c')](_0xbc728);}})[_0x40d1('0x24')](function(_0x3d21cd){if(_0x3d21cd){_0x165f7d=_0x3d21cd[_0x40d1('0x35')];if(!_0x4260c7[_0x40d1('0x2f')][_0x40d1('0x36')](_0x40d1('0x4d'))){_0xbc728[_0x40d1('0x1f')]=qs[_0x40d1('0x1f')](_0x4260c7[_0x40d1('0x2f')][_0x40d1('0x1f')]);_0xbc728[_0x40d1('0x1d')]=qs[_0x40d1('0x1d')](_0x4260c7['query'][_0x40d1('0x1d')]);}return _0x3dd996[_0x40d1('0x4c')](_0xbc728);}})[_0x40d1('0x24')](function(_0x446dbf){if(_0x446dbf){return _0x446dbf?{'count':_0x165f7d,'rows':_0x446dbf}:null;}})['then'](respondWithResult(_0x2a247a,null))[_0x40d1('0x43')](handleError(_0x2a247a,null));};exports[_0x40d1('0x4e')]=function(_0x39fe9c,_0x216a00,_0xa6e122){var _0x50e0d8={};var _0x17db16={};var _0x475a6e;var _0x3eccb3;return db[_0x40d1('0x2b')][_0x40d1('0x4a')]({'where':{'id':_0x39fe9c[_0x40d1('0x49')]['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x216a00,null))[_0x40d1('0x24')](function(_0x22b23d){if(_0x22b23d){_0x475a6e=_0x22b23d;_0x17db16[_0x40d1('0x32')]=_[_0x40d1('0x30')](db['FreshdeskField'][_0x40d1('0x2c')]);_0x17db16[_0x40d1('0x2f')]=_[_0x40d1('0x30')](_0x39fe9c[_0x40d1('0x2f')]);_0x17db16[_0x40d1('0x3b')]=_[_0x40d1('0x31')](_0x17db16['model'],_0x17db16[_0x40d1('0x2f')]);_0x50e0d8['attributes']=_[_0x40d1('0x31')](_0x17db16[_0x40d1('0x32')],qs['fields'](_0x39fe9c[_0x40d1('0x2f')][_0x40d1('0x34')]));_0x50e0d8['attributes']=_0x50e0d8[_0x40d1('0x33')]['length']?_0x50e0d8[_0x40d1('0x33')]:_0x17db16[_0x40d1('0x32')];_0x50e0d8[_0x40d1('0x37')]=qs[_0x40d1('0x38')](_0x39fe9c['query'][_0x40d1('0x38')]);_0x50e0d8[_0x40d1('0x39')]=qs[_0x40d1('0x3b')](_[_0x40d1('0x3a')](_0x39fe9c[_0x40d1('0x2f')],_0x17db16[_0x40d1('0x3b')]));if(_0x39fe9c[_0x40d1('0x2f')]['filter']){_0x50e0d8[_0x40d1('0x39')]=_['merge'](_0x50e0d8[_0x40d1('0x39')],{'$or':_[_0x40d1('0x2a')](_0x50e0d8[_0x40d1('0x33')],function(_0x38e486){var _0x3680e1={};_0x3680e1[_0x38e486]={'$like':'%'+_0x39fe9c[_0x40d1('0x2f')]['filter']+'%'};return _0x3680e1;})});}_0x50e0d8=_['merge']({},_0x50e0d8,_0x39fe9c['options']);return _0x475a6e[_0x40d1('0x4e')](_0x50e0d8);}})[_0x40d1('0x24')](function(_0x15a47f){if(_0x15a47f){_0x3eccb3=_0x15a47f['length'];if(!_0x39fe9c[_0x40d1('0x2f')][_0x40d1('0x36')]('nolimit')){_0x50e0d8[_0x40d1('0x1f')]=qs['limit'](_0x39fe9c[_0x40d1('0x2f')][_0x40d1('0x1f')]);_0x50e0d8[_0x40d1('0x1d')]=qs[_0x40d1('0x1d')](_0x39fe9c[_0x40d1('0x2f')][_0x40d1('0x1d')]);}return _0x475a6e[_0x40d1('0x4e')](_0x50e0d8);}})[_0x40d1('0x24')](function(_0x2451a2){if(_0x2451a2){return _0x2451a2?{'count':_0x3eccb3,'rows':_0x2451a2}:null;}})['then'](respondWithResult(_0x216a00,null))[_0x40d1('0x43')](handleError(_0x216a00,null));};exports['getDescriptions']=function(_0x3e441c,_0x407b90,_0x469a36){var _0x335664={};var _0x4664bf={};var _0x3d7295;var _0x2b0ed0;return db[_0x40d1('0x2b')]['findOne']({'where':{'id':_0x3e441c[_0x40d1('0x49')]['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x407b90,null))['then'](function(_0x4e1e4b){if(_0x4e1e4b){_0x3d7295=_0x4e1e4b;_0x4664bf[_0x40d1('0x32')]=_[_0x40d1('0x30')](db[_0x40d1('0x4b')]['rawAttributes']);_0x4664bf['query']=_[_0x40d1('0x30')](_0x3e441c[_0x40d1('0x2f')]);_0x4664bf[_0x40d1('0x3b')]=_[_0x40d1('0x31')](_0x4664bf[_0x40d1('0x32')],_0x4664bf['query']);_0x335664[_0x40d1('0x33')]=_['intersection'](_0x4664bf[_0x40d1('0x32')],qs[_0x40d1('0x34')](_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x34')]));_0x335664[_0x40d1('0x33')]=_0x335664['attributes'][_0x40d1('0x35')]?_0x335664['attributes']:_0x4664bf[_0x40d1('0x32')];_0x335664[_0x40d1('0x37')]=qs['sort'](_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x38')]);_0x335664[_0x40d1('0x39')]=qs[_0x40d1('0x3b')](_[_0x40d1('0x3a')](_0x3e441c[_0x40d1('0x2f')],_0x4664bf[_0x40d1('0x3b')]));if(_0x3e441c['query'][_0x40d1('0x3c')]){_0x335664[_0x40d1('0x39')]=_[_0x40d1('0x45')](_0x335664[_0x40d1('0x39')],{'$or':_[_0x40d1('0x2a')](_0x335664[_0x40d1('0x33')],function(_0x532f13){var _0xdf7f86={};_0xdf7f86[_0x532f13]={'$like':'%'+_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x3c')]+'%'};return _0xdf7f86;})});}_0x335664=_['merge']({},_0x335664,_0x3e441c[_0x40d1('0x3e')]);return _0x3d7295[_0x40d1('0x4f')](_0x335664);}})[_0x40d1('0x24')](function(_0x544a3f){if(_0x544a3f){_0x2b0ed0=_0x544a3f[_0x40d1('0x35')];if(!_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x36')](_0x40d1('0x4d'))){_0x335664[_0x40d1('0x1f')]=qs[_0x40d1('0x1f')](_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x1f')]);_0x335664[_0x40d1('0x1d')]=qs[_0x40d1('0x1d')](_0x3e441c[_0x40d1('0x2f')][_0x40d1('0x1d')]);}return _0x3d7295[_0x40d1('0x4f')](_0x335664);}})[_0x40d1('0x24')](function(_0x31af8a){if(_0x31af8a){return _0x31af8a?{'count':_0x2b0ed0,'rows':_0x31af8a}:null;}})['then'](respondWithResult(_0x407b90,null))[_0x40d1('0x43')](handleError(_0x407b90,null));};exports[_0x40d1('0x50')]=function(_0x112ea4,_0x151bce,_0x19e568){var _0x49b0e5={};var _0x4c7223={};var _0x1a6aa9;var _0x1df65f;return db[_0x40d1('0x2b')][_0x40d1('0x4a')]({'where':{'id':_0x112ea4[_0x40d1('0x49')]['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x151bce,null))[_0x40d1('0x24')](function(_0x45aa8a){if(_0x45aa8a){_0x1a6aa9=_0x45aa8a;_0x4c7223[_0x40d1('0x32')]=_['keys'](db[_0x40d1('0x51')][_0x40d1('0x2c')]);_0x4c7223[_0x40d1('0x2f')]=_['keys'](_0x112ea4[_0x40d1('0x2f')]);_0x4c7223[_0x40d1('0x3b')]=_[_0x40d1('0x31')](_0x4c7223[_0x40d1('0x32')],_0x4c7223['query']);_0x49b0e5[_0x40d1('0x33')]=_[_0x40d1('0x31')](_0x4c7223[_0x40d1('0x32')],qs['fields'](_0x112ea4[_0x40d1('0x2f')]['fields']));_0x49b0e5[_0x40d1('0x33')]=_0x49b0e5[_0x40d1('0x33')][_0x40d1('0x35')]?_0x49b0e5[_0x40d1('0x33')]:_0x4c7223[_0x40d1('0x32')];_0x49b0e5[_0x40d1('0x37')]=qs[_0x40d1('0x38')](_0x112ea4[_0x40d1('0x2f')][_0x40d1('0x38')]);_0x49b0e5[_0x40d1('0x39')]=qs[_0x40d1('0x3b')](_[_0x40d1('0x3a')](_0x112ea4[_0x40d1('0x2f')],_0x4c7223[_0x40d1('0x3b')]));if(_0x112ea4[_0x40d1('0x2f')][_0x40d1('0x3c')]){_0x49b0e5[_0x40d1('0x39')]=_[_0x40d1('0x45')](_0x49b0e5[_0x40d1('0x39')],{'$or':_[_0x40d1('0x2a')](_0x49b0e5[_0x40d1('0x33')],function(_0xae8f43){var _0xe73262={};_0xe73262[_0xae8f43]={'$like':'%'+_0x112ea4[_0x40d1('0x2f')]['filter']+'%'};return _0xe73262;})});}_0x49b0e5=_[_0x40d1('0x45')]({},_0x49b0e5,_0x112ea4[_0x40d1('0x3e')]);return _0x1a6aa9[_0x40d1('0x50')](_0x49b0e5);}})[_0x40d1('0x24')](function(_0x59cef0){if(_0x59cef0){_0x1df65f=_0x59cef0[_0x40d1('0x35')];if(!_0x112ea4[_0x40d1('0x2f')]['hasOwnProperty'](_0x40d1('0x4d'))){_0x49b0e5[_0x40d1('0x1f')]=qs[_0x40d1('0x1f')](_0x112ea4[_0x40d1('0x2f')][_0x40d1('0x1f')]);_0x49b0e5['offset']=qs['offset'](_0x112ea4[_0x40d1('0x2f')]['offset']);}return _0x1a6aa9[_0x40d1('0x50')](_0x49b0e5);}})['then'](function(_0x7eb9b3){if(_0x7eb9b3){return _0x7eb9b3?{'count':_0x1df65f,'rows':_0x7eb9b3}:null;}})['then'](respondWithResult(_0x151bce,null))[_0x40d1('0x43')](handleError(_0x151bce,null));};exports[_0x40d1('0x52')]=function(_0x3243eb,_0x23bdd3,_0x371b10){if(_0x3243eb[_0x40d1('0x47')]['id']){delete _0x3243eb[_0x40d1('0x47')]['id'];}return db[_0x40d1('0x2b')]['findOne']({'where':{'id':_0x3243eb[_0x40d1('0x49')]['id']}})[_0x40d1('0x24')](handleEntityNotFound(_0x23bdd3,null))['then'](function(_0x3ab6eb){if(_0x3ab6eb){return _0x3ab6eb[_0x40d1('0x52')](_0x3243eb[_0x40d1('0x47')]['ids']||[]);}return null;})[_0x40d1('0x24')](respondWithResult(_0x23bdd3,null))[_0x40d1('0x43')](handleError(_0x23bdd3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3d94de2..dedd8f2 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 _0xc819=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','lodash','util','../../config/logger'];(function(_0x2293cf,_0x1d1ce3){var _0x4b6623=function(_0x43d003){while(--_0x43d003){_0x2293cf['push'](_0x2293cf['shift']());}};_0x4b6623(++_0x1d1ce3);}(_0xc819,0x1e9));var _0x9c81=function(_0x55c432,_0x320ed9){_0x55c432=_0x55c432-0x0;var _0x55b975=_0xc819[_0x55c432];return _0x55b975;};'use strict';var _=require(_0x9c81('0x0'));var util=require(_0x9c81('0x1'));var logger=require(_0x9c81('0x2'))(_0x9c81('0x3'));var moment=require(_0x9c81('0x4'));var BPromise=require(_0x9c81('0x5'));var rp=require(_0x9c81('0x6'));var fs=require('fs');var path=require(_0x9c81('0x7'));var rimraf=require(_0x9c81('0x8'));var config=require(_0x9c81('0x9'));var attributes=require(_0x9c81('0xa'));module['exports']=function(_0x542a16,_0x3e03e4){return _0x542a16[_0x9c81('0xb')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d6c=['int_freshdesk_configurations','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x8d6c,0x135));var _0xc8d6=function(_0x54410c,_0x5d4e0a){_0x54410c=_0x54410c-0x0;var _0x4f73a5=_0x8d6c[_0x54410c];return _0x4f73a5;};'use strict';var _=require(_0xc8d6('0x0'));var util=require('util');var logger=require(_0xc8d6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc8d6('0x2'));var rp=require(_0xc8d6('0x3'));var fs=require('fs');var path=require(_0xc8d6('0x4'));var rimraf=require('rimraf');var config=require(_0xc8d6('0x5'));var attributes=require(_0xc8d6('0x6'));module[_0xc8d6('0x7')]=function(_0xa3e940,_0x42f4be){return _0xa3e940[_0xc8d6('0x8')](_0xc8d6('0x9'),attributes,{'tableName':_0xc8d6('0xa'),'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 79dbf3b..b819900 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 _0xe2a2=['../../config/utils','../../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','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4ed546,_0x244bd0){var _0x10bfcc=function(_0x2e2caa){while(--_0x2e2caa){_0x4ed546['push'](_0x4ed546['shift']());}};_0x10bfcc(++_0x244bd0);}(_0xe2a2,0xa2));var _0x2e2a=function(_0x1655bf,_0x5c4e78){_0x1655bf=_0x1655bf-0x0;var _0x3f2a8b=_0xe2a2[_0x1655bf];return _0x3f2a8b;};'use strict';var _=require('lodash');var util=require(_0x2e2a('0x0'));var moment=require(_0x2e2a('0x1'));var BPromise=require(_0x2e2a('0x2'));var rs=require(_0x2e2a('0x3'));var fs=require('fs');var Redis=require(_0x2e2a('0x4'));var db=require(_0x2e2a('0x5'))['db'];var utils=require(_0x2e2a('0x6'));var logger=require(_0x2e2a('0x7'))(_0x2e2a('0x8'));var config=require(_0x2e2a('0x9'));var jayson=require(_0x2e2a('0xa'));var client=jayson[_0x2e2a('0xb')][_0x2e2a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x809e2a,_0x3fe5f3,_0xe2000f){return new BPromise(function(_0x452952,_0xb91309){return client[_0x2e2a('0xd')](_0x809e2a,_0xe2000f)[_0x2e2a('0xe')](function(_0x288abc){logger[_0x2e2a('0xf')](_0x2e2a('0x10'),_0x3fe5f3,_0x2e2a('0x11'));logger[_0x2e2a('0x12')](_0x2e2a('0x13'),_0x3fe5f3,_0x2e2a('0x11'),JSON['stringify'](_0x288abc));if(_0x288abc[_0x2e2a('0x14')]){if(_0x288abc['error'][_0x2e2a('0x15')]===0x1f4){logger[_0x2e2a('0x14')](_0x2e2a('0x10'),_0x3fe5f3,_0x288abc[_0x2e2a('0x14')]['message']);return _0xb91309(_0x288abc[_0x2e2a('0x14')]['message']);}logger[_0x2e2a('0x14')](_0x2e2a('0x10'),_0x3fe5f3,_0x288abc[_0x2e2a('0x14')][_0x2e2a('0x16')]);return _0x452952(_0x288abc['error'][_0x2e2a('0x16')]);}else{logger[_0x2e2a('0xf')](_0x2e2a('0x10'),_0x3fe5f3,_0x2e2a('0x11'));_0x452952(_0x288abc[_0x2e2a('0x17')]['message']);}})['catch'](function(_0x2f3878){logger['error'](_0x2e2a('0x10'),_0x3fe5f3,_0x2f3878);_0xb91309(_0x2f3878);});});} \ No newline at end of file +var _0xd3e6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x32e8ce,_0x1e3759){var _0x3a61a5=function(_0x4eb754){while(--_0x4eb754){_0x32e8ce['push'](_0x32e8ce['shift']());}};_0x3a61a5(++_0x1e3759);}(_0xd3e6,0xb5));var _0x6d3e=function(_0x201ed4,_0x132fc7){_0x201ed4=_0x201ed4-0x0;var _0x1f833a=_0xd3e6[_0x201ed4];return _0x1f833a;};'use strict';var _=require(_0x6d3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6d3e('0x1'));var rs=require(_0x6d3e('0x2'));var fs=require('fs');var Redis=require(_0x6d3e('0x3'));var db=require(_0x6d3e('0x4'))['db'];var utils=require(_0x6d3e('0x5'));var logger=require(_0x6d3e('0x6'))(_0x6d3e('0x7'));var config=require(_0x6d3e('0x8'));var jayson=require(_0x6d3e('0x9'));var client=jayson['client'][_0x6d3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477290,_0x4d8faf,_0xdbd319){return new BPromise(function(_0x44fbbc,_0x1f103c){return client[_0x6d3e('0xb')](_0x477290,_0xdbd319)['then'](function(_0x55c7c7){logger[_0x6d3e('0xc')](_0x6d3e('0xd'),_0x4d8faf,_0x6d3e('0xe'));logger[_0x6d3e('0xf')](_0x6d3e('0x10'),_0x4d8faf,'request\x20sent',JSON[_0x6d3e('0x11')](_0x55c7c7));if(_0x55c7c7[_0x6d3e('0x12')]){if(_0x55c7c7[_0x6d3e('0x12')][_0x6d3e('0x13')]===0x1f4){logger[_0x6d3e('0x12')](_0x6d3e('0xd'),_0x4d8faf,_0x55c7c7[_0x6d3e('0x12')][_0x6d3e('0x14')]);return _0x1f103c(_0x55c7c7['error'][_0x6d3e('0x14')]);}logger['error'](_0x6d3e('0xd'),_0x4d8faf,_0x55c7c7[_0x6d3e('0x12')]['message']);return _0x44fbbc(_0x55c7c7[_0x6d3e('0x12')][_0x6d3e('0x14')]);}else{logger[_0x6d3e('0xc')](_0x6d3e('0xd'),_0x4d8faf,_0x6d3e('0xe'));_0x44fbbc(_0x55c7c7[_0x6d3e('0x15')][_0x6d3e('0x14')]);}})[_0x6d3e('0x16')](function(_0xb863b9){logger[_0x6d3e('0x12')](_0x6d3e('0xd'),_0x4d8faf,_0xb863b9);_0x1f103c(_0xb863b9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1e64ce6..ad3c2be 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 _0xd9c8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x42b89a,_0x5842f4){var _0x33e70d=function(_0x5b6048){while(--_0x5b6048){_0x42b89a['push'](_0x42b89a['shift']());}};_0x33e70d(++_0x5842f4);}(_0xd9c8,0x14c));var _0x8d9c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xd9c8[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var path=require(_0x8d9c('0x2'));var timeout=require(_0x8d9c('0x3'));var express=require(_0x8d9c('0x4'));var router=express[_0x8d9c('0x5')]();var fs_extra=require(_0x8d9c('0x6'));var auth=require(_0x8d9c('0x7'));var interaction=require(_0x8d9c('0x8'));var config=require(_0x8d9c('0x9'));var controller=require(_0x8d9c('0xa'));router[_0x8d9c('0xb')]('/',auth['isAuthenticated'](),controller[_0x8d9c('0xc')]);router['get'](_0x8d9c('0xd'),auth['isAuthenticated'](),controller[_0x8d9c('0xe')]);router['post']('/',auth[_0x8d9c('0xf')](),controller[_0x8d9c('0x10')]);router[_0x8d9c('0x11')](_0x8d9c('0xd'),auth[_0x8d9c('0xf')](),controller[_0x8d9c('0x12')]);router[_0x8d9c('0x13')]('/:id',auth[_0x8d9c('0xf')](),controller['destroy']);module[_0x8d9c('0x14')]=router; \ No newline at end of file +var _0xaa46=['../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xaa46,0xad));var _0x6aa4=function(_0x4ee1ed,_0x3cb2b0){_0x4ee1ed=_0x4ee1ed-0x0;var _0x70fc7d=_0xaa46[_0x4ee1ed];return _0x70fc7d;};'use strict';var multer=require(_0x6aa4('0x0'));var util=require(_0x6aa4('0x1'));var path=require(_0x6aa4('0x2'));var timeout=require(_0x6aa4('0x3'));var express=require(_0x6aa4('0x4'));var router=express[_0x6aa4('0x5')]();var fs_extra=require(_0x6aa4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6aa4('0x7'));var config=require('../../config/environment');var controller=require(_0x6aa4('0x8'));router[_0x6aa4('0x9')]('/',auth[_0x6aa4('0xa')](),controller[_0x6aa4('0xb')]);router[_0x6aa4('0x9')](_0x6aa4('0xc'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0xd')]);router['post']('/',auth[_0x6aa4('0xa')](),controller[_0x6aa4('0xe')]);router[_0x6aa4('0xf')](_0x6aa4('0xc'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x10')]);router[_0x6aa4('0x11')](_0x6aa4('0xc'),auth[_0x6aa4('0xa')](),controller[_0x6aa4('0x12')]);module[_0x6aa4('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 785a579..524ae34 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 _0x9c10=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x55704a,_0x3875d5){var _0xf7d503=function(_0x2f0ae7){while(--_0x2f0ae7){_0x55704a['push'](_0x55704a['shift']());}};_0xf7d503(++_0x3875d5);}(_0x9c10,0x162));var _0x09c1=function(_0x5f45a5,_0x471af7){_0x5f45a5=_0x5f45a5-0x0;var _0x771c5=_0x9c10[_0x5f45a5];return _0x771c5;};'use strict';var Sequelize=require(_0x09c1('0x0'));module[_0x09c1('0x1')]={'type':{'type':Sequelize[_0x09c1('0x2')](_0x09c1('0x3'),_0x09c1('0x4'),_0x09c1('0x5'),_0x09c1('0x6'),'picklist'),'defaultValue':_0x09c1('0x3')},'content':{'type':Sequelize[_0x09c1('0x7')]},'key':{'type':Sequelize[_0x09c1('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x09c1('0x5'))},'keyContent':{'type':Sequelize[_0x09c1('0x7')]},'idField':{'type':Sequelize[_0x09c1('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x09c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c1('0x7')]}}; \ No newline at end of file +var _0x0401=['BOOLEAN','sequelize','exports','string','STRING','variable','customVariable'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0401,0xe8));var _0x1040=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x0401[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x1040('0x0'));module[_0x1040('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1040('0x2'),'variable','customVariable','keyValue','picklist'),'defaultValue':_0x1040('0x2')},'content':{'type':Sequelize[_0x1040('0x3')]},'key':{'type':Sequelize[_0x1040('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x1040('0x2'),_0x1040('0x4'),_0x1040('0x5'))},'keyContent':{'type':Sequelize[_0x1040('0x3')]},'idField':{'type':Sequelize[_0x1040('0x3')]},'nameField':{'type':Sequelize[_0x1040('0x3')]},'customField':{'type':Sequelize[_0x1040('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1040('0x3')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4c3be43..86bdf0f 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 _0x22fb=['Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x103ea0,_0x14283b){var _0x24348d=function(_0x1b3405){while(--_0x1b3405){_0x103ea0['push'](_0x103ea0['shift']());}};_0x24348d(++_0x14283b);}(_0x22fb,0x192));var _0xb22f=function(_0x2dfb91,_0x5a0144){_0x2dfb91=_0x2dfb91-0x0;var _0x2be610=_0x22fb[_0x2dfb91];return _0x2be610;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb22f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb22f('0x1'));var moment=require(_0xb22f('0x2'));var BPromise=require(_0xb22f('0x3'));var Mustache=require(_0xb22f('0x4'));var util=require(_0xb22f('0x5'));var path=require('path');var sox=require(_0xb22f('0x6'));var csv=require(_0xb22f('0x7'));var ejs=require(_0xb22f('0x8'));var fs=require('fs');var fs_extra=require(_0xb22f('0x9'));var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x7'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb22f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bb02a,_0x5bf0b9){_0x5bf0b9=_0x5bf0b9||0xcc;return function(_0x45e426){if(_0x45e426){return _0x4bb02a[_0xb22f('0x17')](_0x5bf0b9);}return _0x4bb02a[_0xb22f('0x18')](_0x5bf0b9)[_0xb22f('0x19')]();};}function respondWithResult(_0x390c53,_0x32d796){_0x32d796=_0x32d796||0xc8;return function(_0x5c6ccf){if(_0x5c6ccf){return _0x390c53[_0xb22f('0x18')](_0x32d796)['json'](_0x5c6ccf);}};}function respondWithFilteredResult(_0x36e2a8,_0x4f9108){return function(_0x2187fc){if(_0x2187fc){var _0x514a8f=typeof _0x4f9108[_0xb22f('0x1a')]===_0xb22f('0x1b')&&typeof _0x4f9108[_0xb22f('0x1c')]==='undefined';var _0x1530f7=_0x2187fc['count'];var _0x252742=_0x514a8f?0x0:_0x4f9108[_0xb22f('0x1a')];var _0x2aaec4=_0x514a8f?_0x2187fc[_0xb22f('0x1d')]:_0x4f9108[_0xb22f('0x1a')]+_0x4f9108[_0xb22f('0x1c')];var _0x5c843b;if(_0x2aaec4>=_0x1530f7){_0x2aaec4=_0x1530f7;_0x5c843b=0xc8;}else{_0x5c843b=0xce;}_0x36e2a8[_0xb22f('0x18')](_0x5c843b);return _0x36e2a8['set'](_0xb22f('0x1e'),_0x252742+'-'+_0x2aaec4+'/'+_0x1530f7)[_0xb22f('0x1f')](_0x2187fc);}return null;};}function patchUpdates(_0x316f11){return function(_0x2239b8){try{jsonpatch[_0xb22f('0x20')](_0x2239b8,_0x316f11,!![]);}catch(_0x4bbb12){return BPromise['reject'](_0x4bbb12);}return _0x2239b8[_0xb22f('0x21')]();};}function saveUpdates(_0x19e480,_0xf34e0d){return function(_0x16e465){if(_0x16e465){return _0x16e465[_0xb22f('0x22')](_0x19e480)[_0xb22f('0x23')](function(_0x201764){return _0x201764;});}return null;};}function removeEntity(_0x286465,_0x583fbe){return function(_0x482b3a){if(_0x482b3a){return _0x482b3a[_0xb22f('0x24')]()[_0xb22f('0x23')](function(){_0x286465['status'](0xcc)[_0xb22f('0x19')]();});}};}function handleEntityNotFound(_0x4364f5,_0x4f2986){return function(_0x4687f2){if(!_0x4687f2){_0x4364f5[_0xb22f('0x17')](0x194);}return _0x4687f2;};}function handleError(_0x4dfb62,_0x3e471f){_0x3e471f=_0x3e471f||0x1f4;return function(_0x2c4a9e){logger[_0xb22f('0x25')](_0x2c4a9e[_0xb22f('0x26')]);if(_0x2c4a9e[_0xb22f('0x27')]){delete _0x2c4a9e[_0xb22f('0x27')];}_0x4dfb62[_0xb22f('0x18')](_0x3e471f)[_0xb22f('0x28')](_0x2c4a9e);};}exports['index']=function(_0x483cc3,_0x5d86a1){var _0x2f6b97={},_0x557d96={},_0x327200={'count':0x0,'rows':[]};var _0xc7f33b=_[_0xb22f('0x29')](db[_0xb22f('0x2a')][_0xb22f('0x2b')],function(_0x5b2a42){return{'name':_0x5b2a42['fieldName'],'type':_0x5b2a42[_0xb22f('0x2c')][_0xb22f('0x2d')]};});_0x557d96[_0xb22f('0x2e')]=_[_0xb22f('0x29')](_0xc7f33b,'name');_0x557d96[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x483cc3['query']);_0x557d96[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x557d96[_0xb22f('0x2e')],_0x557d96[_0xb22f('0x2f')]);_0x2f6b97[_0xb22f('0x33')]=_['intersection'](_0x557d96['model'],qs[_0xb22f('0x34')](_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x34')]));_0x2f6b97[_0xb22f('0x33')]=_0x2f6b97[_0xb22f('0x33')][_0xb22f('0x35')]?_0x2f6b97[_0xb22f('0x33')]:_0x557d96[_0xb22f('0x2e')];if(!_0x483cc3[_0xb22f('0x2f')]['hasOwnProperty'](_0xb22f('0x36'))){_0x2f6b97['limit']=qs['limit'](_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x1c')]);_0x2f6b97[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x1a')]);}_0x2f6b97[_0xb22f('0x37')]=qs[_0xb22f('0x38')](_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x38')]);_0x2f6b97[_0xb22f('0x39')]=qs[_0xb22f('0x31')](_[_0xb22f('0x3a')](_0x483cc3['query'],_0x557d96['filters']),_0xc7f33b);if(_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x3b')]){_0x2f6b97[_0xb22f('0x39')]=_['merge'](_0x2f6b97[_0xb22f('0x39')],{'$or':_[_0xb22f('0x29')](_0xc7f33b,function(_0x4a142c){if(_0x4a142c['type']!==_0xb22f('0x3c')){var _0x5a5ee7={};_0x5a5ee7[_0x4a142c[_0xb22f('0x27')]]={'$like':'%'+_0x483cc3['query'][_0xb22f('0x3b')]+'%'};return _0x5a5ee7;}})});}_0x2f6b97=_[_0xb22f('0x3d')]({},_0x2f6b97,_0x483cc3[_0xb22f('0x3e')]);var _0x52a3c7={'where':_0x2f6b97[_0xb22f('0x39')]};return db[_0xb22f('0x2a')][_0xb22f('0x1d')](_0x52a3c7)['then'](function(_0x14cd91){_0x327200[_0xb22f('0x1d')]=_0x14cd91;if(_0x483cc3[_0xb22f('0x2f')][_0xb22f('0x3f')]){_0x2f6b97[_0xb22f('0x40')]=[{'all':!![]}];}return db[_0xb22f('0x2a')][_0xb22f('0x41')](_0x2f6b97);})[_0xb22f('0x23')](function(_0xcb55d3){_0x327200[_0xb22f('0x42')]=_0xcb55d3;return _0x327200;})['then'](respondWithFilteredResult(_0x5d86a1,_0x2f6b97))[_0xb22f('0x43')](handleError(_0x5d86a1,null));};exports[_0xb22f('0x44')]=function(_0x5846ed,_0x3e4c4a){var _0x4be0de={'raw':!![],'where':{'id':_0x5846ed[_0xb22f('0x45')]['id']}},_0x58ba40={};_0x58ba40[_0xb22f('0x2e')]=_[_0xb22f('0x30')](db[_0xb22f('0x2a')]['rawAttributes']);_0x58ba40[_0xb22f('0x2f')]=_['keys'](_0x5846ed[_0xb22f('0x2f')]);_0x58ba40[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x58ba40[_0xb22f('0x2e')],_0x58ba40[_0xb22f('0x2f')]);_0x4be0de[_0xb22f('0x33')]=_['intersection'](_0x58ba40[_0xb22f('0x2e')],qs['fields'](_0x5846ed[_0xb22f('0x2f')][_0xb22f('0x34')]));_0x4be0de['attributes']=_0x4be0de[_0xb22f('0x33')][_0xb22f('0x35')]?_0x4be0de['attributes']:_0x58ba40['model'];if(_0x5846ed[_0xb22f('0x2f')]['includeAll']){_0x4be0de[_0xb22f('0x40')]=[{'all':!![]}];}_0x4be0de=_[_0xb22f('0x3d')]({},_0x4be0de,_0x5846ed[_0xb22f('0x3e')]);return db[_0xb22f('0x2a')]['find'](_0x4be0de)[_0xb22f('0x23')](handleEntityNotFound(_0x3e4c4a,null))[_0xb22f('0x23')](respondWithResult(_0x3e4c4a,null))['catch'](handleError(_0x3e4c4a,null));};exports[_0xb22f('0x46')]=function(_0x72d501,_0x411723){return db[_0xb22f('0x2a')][_0xb22f('0x46')](_0x72d501['body'],{})[_0xb22f('0x23')](respondWithResult(_0x411723,0xc9))['catch'](handleError(_0x411723,null));};exports['update']=function(_0x3fb0ac,_0x90eef9){if(_0x3fb0ac[_0xb22f('0x47')]['id']){delete _0x3fb0ac[_0xb22f('0x47')]['id'];}return db[_0xb22f('0x2a')]['find']({'where':{'id':_0x3fb0ac[_0xb22f('0x45')]['id']}})['then'](handleEntityNotFound(_0x90eef9,null))[_0xb22f('0x23')](saveUpdates(_0x3fb0ac['body'],null))[_0xb22f('0x23')](respondWithResult(_0x90eef9,null))[_0xb22f('0x43')](handleError(_0x90eef9,null));};exports[_0xb22f('0x24')]=function(_0x58cd19,_0x299156){return db[_0xb22f('0x2a')]['find']({'where':{'id':_0x58cd19[_0xb22f('0x45')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x299156,null))['then'](removeEntity(_0x299156,null))['catch'](handleError(_0x299156,null));}; \ No newline at end of file +var _0xe28e=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','send','index','map','FreshdeskField','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xe28e,0x1ba));var _0xee28=function(_0x59fed4,_0x463876){_0x59fed4=_0x59fed4-0x0;var _0x593c68=_0xe28e[_0x59fed4];return _0x593c68;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){_0x17d8e4[_0xee28('0x1c')](0xcc)[_0xee28('0x1b')]();});}};}function handleEntityNotFound(_0x95d917,_0x2a7c95){return function(_0x733ca8){if(!_0x733ca8){_0x95d917[_0xee28('0x1a')](0x194);}return _0x733ca8;};}function handleError(_0x4ce19b,_0x2c847b){_0x2c847b=_0x2c847b||0x1f4;return function(_0x5b1b1e){logger['error'](_0x5b1b1e['stack']);if(_0x5b1b1e['name']){delete _0x5b1b1e['name'];}_0x4ce19b[_0xee28('0x1c')](_0x2c847b)[_0xee28('0x28')](_0x5b1b1e);};}exports[_0xee28('0x29')]=function(_0x469889,_0x346201){var _0x417840={},_0xbafd67={},_0x4fcc8f={'count':0x0,'rows':[]};var _0x84e0ba=_[_0xee28('0x2a')](db[_0xee28('0x2b')]['rawAttributes'],function(_0x14f7c4){return{'name':_0x14f7c4[_0xee28('0x2c')],'type':_0x14f7c4[_0xee28('0x2d')][_0xee28('0x2e')]};});_0xbafd67[_0xee28('0x2f')]=_[_0xee28('0x2a')](_0x84e0ba,_0xee28('0x30'));_0xbafd67['query']=_[_0xee28('0x31')](_0x469889[_0xee28('0x32')]);_0xbafd67['filters']=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],_0xbafd67[_0xee28('0x32')]);_0x417840[_0xee28('0x34')]=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],qs[_0xee28('0x35')](_0x469889['query']['fields']));_0x417840['attributes']=_0x417840[_0xee28('0x34')][_0xee28('0x36')]?_0x417840[_0xee28('0x34')]:_0xbafd67[_0xee28('0x2f')];if(!_0x469889[_0xee28('0x32')][_0xee28('0x37')]('nolimit')){_0x417840[_0xee28('0x38')]=qs[_0xee28('0x38')](_0x469889['query']['limit']);_0x417840[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x469889['query']['offset']);}_0x417840[_0xee28('0x39')]=qs[_0xee28('0x3a')](_0x469889['query'][_0xee28('0x3a')]);_0x417840[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_[_0xee28('0x3d')](_0x469889[_0xee28('0x32')],_0xbafd67[_0xee28('0x3c')]),_0x84e0ba);if(_0x469889[_0xee28('0x32')][_0xee28('0x3e')]){_0x417840[_0xee28('0x3b')]=_[_0xee28('0x3f')](_0x417840[_0xee28('0x3b')],{'$or':_[_0xee28('0x2a')](_0x84e0ba,function(_0x486d55){if(_0x486d55[_0xee28('0x2d')]!=='VIRTUAL'){var _0x4b0b75={};_0x4b0b75[_0x486d55[_0xee28('0x30')]]={'$like':'%'+_0x469889['query'][_0xee28('0x3e')]+'%'};return _0x4b0b75;}})});}_0x417840=_['merge']({},_0x417840,_0x469889[_0xee28('0x40')]);var _0x4d096c={'where':_0x417840[_0xee28('0x3b')]};return db[_0xee28('0x2b')][_0xee28('0x1f')](_0x4d096c)[_0xee28('0x27')](function(_0x58ebb5){_0x4fcc8f[_0xee28('0x1f')]=_0x58ebb5;if(_0x469889['query'][_0xee28('0x41')]){_0x417840[_0xee28('0x42')]=[{'all':!![]}];}return db[_0xee28('0x2b')][_0xee28('0x43')](_0x417840);})[_0xee28('0x27')](function(_0x2e046e){_0x4fcc8f[_0xee28('0x44')]=_0x2e046e;return _0x4fcc8f;})['then'](respondWithFilteredResult(_0x346201,_0x417840))['catch'](handleError(_0x346201,null));};exports[_0xee28('0x45')]=function(_0x5c710d,_0x52b666){var _0x4064cf={'raw':!![],'where':{'id':_0x5c710d['params']['id']}},_0x14bd8d={};_0x14bd8d[_0xee28('0x2f')]=_[_0xee28('0x31')](db[_0xee28('0x2b')][_0xee28('0x46')]);_0x14bd8d[_0xee28('0x32')]=_[_0xee28('0x31')](_0x5c710d[_0xee28('0x32')]);_0x14bd8d['filters']=_[_0xee28('0x33')](_0x14bd8d[_0xee28('0x2f')],_0x14bd8d[_0xee28('0x32')]);_0x4064cf[_0xee28('0x34')]=_[_0xee28('0x33')](_0x14bd8d['model'],qs[_0xee28('0x35')](_0x5c710d[_0xee28('0x32')]['fields']));_0x4064cf[_0xee28('0x34')]=_0x4064cf[_0xee28('0x34')][_0xee28('0x36')]?_0x4064cf[_0xee28('0x34')]:_0x14bd8d[_0xee28('0x2f')];if(_0x5c710d[_0xee28('0x32')]['includeAll']){_0x4064cf[_0xee28('0x42')]=[{'all':!![]}];}_0x4064cf=_['merge']({},_0x4064cf,_0x5c710d['options']);return db[_0xee28('0x2b')][_0xee28('0x47')](_0x4064cf)['then'](handleEntityNotFound(_0x52b666,null))[_0xee28('0x27')](respondWithResult(_0x52b666,null))[_0xee28('0x48')](handleError(_0x52b666,null));};exports[_0xee28('0x49')]=function(_0x5d07ed,_0x57e57e){return db[_0xee28('0x2b')][_0xee28('0x49')](_0x5d07ed[_0xee28('0x4a')],{})[_0xee28('0x27')](respondWithResult(_0x57e57e,0xc9))[_0xee28('0x48')](handleError(_0x57e57e,null));};exports[_0xee28('0x25')]=function(_0x2574c5,_0x2b5f36){if(_0x2574c5[_0xee28('0x4a')]['id']){delete _0x2574c5[_0xee28('0x4a')]['id'];}return db['FreshdeskField'][_0xee28('0x47')]({'where':{'id':_0x2574c5['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x2b5f36,null))[_0xee28('0x27')](saveUpdates(_0x2574c5[_0xee28('0x4a')],null))[_0xee28('0x27')](respondWithResult(_0x2b5f36,null))[_0xee28('0x48')](handleError(_0x2b5f36,null));};exports['destroy']=function(_0x5247fe,_0x5ca018){return db[_0xee28('0x2b')]['find']({'where':{'id':_0x5247fe['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x5ca018,null))['then'](removeEntity(_0x5ca018,null))[_0xee28('0x48')](handleError(_0x5ca018,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 41b8263..8db2cb0 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 _0x0585=['./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0x0585,0x1ba));var _0x5058=function(_0x47bc1c,_0x11b41d){_0x47bc1c=_0x47bc1c-0x0;var _0x491268=_0x0585[_0x47bc1c];return _0x491268;};'use strict';var _=require(_0x5058('0x0'));var util=require(_0x5058('0x1'));var logger=require('../../config/logger')(_0x5058('0x2'));var moment=require('moment');var BPromise=require(_0x5058('0x3'));var rp=require(_0x5058('0x4'));var fs=require('fs');var path=require(_0x5058('0x5'));var rimraf=require(_0x5058('0x6'));var config=require(_0x5058('0x7'));var attributes=require(_0x5058('0x8'));module[_0x5058('0x9')]=function(_0x58841b,_0x3992c9){return _0x58841b[_0x5058('0xa')](_0x5058('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5058('0xc'),'fields':[_0x5058('0xd'),_0x5058('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7e4=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5245e6,_0x2e0624){var _0x17b7c5=function(_0x4b0542){while(--_0x4b0542){_0x5245e6['push'](_0x5245e6['shift']());}};_0x17b7c5(++_0x2e0624);}(_0xe7e4,0xa3));var _0x4e7e=function(_0x1b1ed1,_0x5c808e){_0x1b1ed1=_0x1b1ed1-0x0;var _0x5a9ca6=_0xe7e4[_0x1b1ed1];return _0x5a9ca6;};'use strict';var _=require('lodash');var util=require(_0x4e7e('0x0'));var logger=require(_0x4e7e('0x1'))('api');var moment=require(_0x4e7e('0x2'));var BPromise=require(_0x4e7e('0x3'));var rp=require(_0x4e7e('0x4'));var fs=require('fs');var path=require(_0x4e7e('0x5'));var rimraf=require(_0x4e7e('0x6'));var config=require(_0x4e7e('0x7'));var attributes=require(_0x4e7e('0x8'));module[_0x4e7e('0x9')]=function(_0x4f038a,_0x38a076){return _0x4f038a['define'](_0x4e7e('0xa'),attributes,{'tableName':_0x4e7e('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x4e7e('0xc'),_0x4e7e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index ef06c99..62ebb7b 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 _0x067a=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b887d,_0x261750){var _0x300237=function(_0x4a56f3){while(--_0x4a56f3){_0x4b887d['push'](_0x4b887d['shift']());}};_0x300237(++_0x261750);}(_0x067a,0x131));var _0xa067=function(_0x1090d4,_0x2aab2b){_0x1090d4=_0x1090d4-0x0;var _0x3cd20a=_0x067a[_0x1090d4];return _0x3cd20a;};'use strict';var _=require(_0xa067('0x0'));var util=require(_0xa067('0x1'));var moment=require('moment');var BPromise=require(_0xa067('0x2'));var rs=require(_0xa067('0x3'));var fs=require('fs');var Redis=require(_0xa067('0x4'));var db=require(_0xa067('0x5'))['db'];var utils=require(_0xa067('0x6'));var logger=require(_0xa067('0x7'))('rpc');var config=require(_0xa067('0x8'));var jayson=require(_0xa067('0x9'));var client=jayson['client'][_0xa067('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33c52e,_0x5db6eb,_0xf9abab){return new BPromise(function(_0x5f4bfd,_0x568548){return client[_0xa067('0xb')](_0x33c52e,_0xf9abab)[_0xa067('0xc')](function(_0x258684){logger[_0xa067('0xd')](_0xa067('0xe'),_0x5db6eb,_0xa067('0xf'));logger[_0xa067('0x10')](_0xa067('0x11'),_0x5db6eb,_0xa067('0xf'),JSON[_0xa067('0x12')](_0x258684));if(_0x258684[_0xa067('0x13')]){if(_0x258684[_0xa067('0x13')][_0xa067('0x14')]===0x1f4){logger[_0xa067('0x13')](_0xa067('0xe'),_0x5db6eb,_0x258684['error'][_0xa067('0x15')]);return _0x568548(_0x258684[_0xa067('0x13')]['message']);}logger['error'](_0xa067('0xe'),_0x5db6eb,_0x258684[_0xa067('0x13')][_0xa067('0x15')]);return _0x5f4bfd(_0x258684[_0xa067('0x13')][_0xa067('0x15')]);}else{logger[_0xa067('0xd')](_0xa067('0xe'),_0x5db6eb,_0xa067('0xf'));_0x5f4bfd(_0x258684[_0xa067('0x16')][_0xa067('0x15')]);}})[_0xa067('0x17')](function(_0x3692d8){logger[_0xa067('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5db6eb,_0x3692d8);_0x568548(_0x3692d8);});});} \ No newline at end of file +var _0x82da=['../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x82da,0xf4));var _0xa82d=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x82da[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xa82d('0x0'));var util=require(_0xa82d('0x1'));var moment=require('moment');var BPromise=require(_0xa82d('0x2'));var rs=require(_0xa82d('0x3'));var fs=require('fs');var Redis=require(_0xa82d('0x4'));var db=require(_0xa82d('0x5'))['db'];var utils=require(_0xa82d('0x6'));var logger=require(_0xa82d('0x7'))(_0xa82d('0x8'));var config=require(_0xa82d('0x9'));var jayson=require(_0xa82d('0xa'));var client=jayson[_0xa82d('0xb')][_0xa82d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d6dd0,_0xbe38cb,_0x51d148){return new BPromise(function(_0x1fa9c2,_0x31923c){return client[_0xa82d('0xd')](_0x4d6dd0,_0x51d148)[_0xa82d('0xe')](function(_0x138d03){logger['info'](_0xa82d('0xf'),_0xbe38cb,_0xa82d('0x10'));logger[_0xa82d('0x11')](_0xa82d('0x12'),_0xbe38cb,_0xa82d('0x10'),JSON[_0xa82d('0x13')](_0x138d03));if(_0x138d03[_0xa82d('0x14')]){if(_0x138d03[_0xa82d('0x14')][_0xa82d('0x15')]===0x1f4){logger[_0xa82d('0x14')](_0xa82d('0xf'),_0xbe38cb,_0x138d03[_0xa82d('0x14')][_0xa82d('0x16')]);return _0x31923c(_0x138d03['error'][_0xa82d('0x16')]);}logger[_0xa82d('0x14')](_0xa82d('0xf'),_0xbe38cb,_0x138d03[_0xa82d('0x14')][_0xa82d('0x16')]);return _0x1fa9c2(_0x138d03[_0xa82d('0x14')][_0xa82d('0x16')]);}else{logger['info'](_0xa82d('0xf'),_0xbe38cb,_0xa82d('0x10'));_0x1fa9c2(_0x138d03['result']['message']);}})['catch'](function(_0xecd05b){logger[_0xa82d('0x14')](_0xa82d('0xf'),_0xbe38cb,_0xecd05b);_0x31923c(_0xecd05b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3f1a55b..a0d28fc 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 _0xcf66=['util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','put','update','delete','destroy','multer'];(function(_0x57258e,_0x2c209e){var _0x587b12=function(_0x253945){while(--_0x253945){_0x57258e['push'](_0x57258e['shift']());}};_0x587b12(++_0x2c209e);}(_0xcf66,0x71));var _0x6cf6=function(_0x270151,_0x1dd0de){_0x270151=_0x270151-0x0;var _0x4b9295=_0xcf66[_0x270151];return _0x4b9295;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x6cf6('0x7')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x9')]);router['get'](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xb')]);router[_0x6cf6('0x7')](_0x6cf6('0xc'),auth[_0x6cf6('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6cf6('0x8')](),controller['getFields']);router[_0x6cf6('0xd')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6cf6('0xf')](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x10')]);router[_0x6cf6('0x11')](_0x6cf6('0xa'),auth['isAuthenticated'](),controller[_0x6cf6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x58418a,_0x3d9f06){var _0x2716bf=function(_0x36fcfd){while(--_0x36fcfd){_0x58418a['push'](_0x58418a['shift']());}};_0x2716bf(++_0x3d9f06);}(_0x96cc,0x16c));var _0xc96c=function(_0x36271b,_0x52ef81){_0x36271b=_0x36271b-0x0;var _0x315b6c=_0x96cc[_0x36271b];return _0x315b6c;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index facae99..462dfcc 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 _0x4137=['STRING','username','remoteUri','sequelize','exports'];(function(_0x33c660,_0x5d9ca9){var _0x389906=function(_0x2b40d5){while(--_0x2b40d5){_0x33c660['push'](_0x33c660['shift']());}};_0x389906(++_0x5d9ca9);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')]},'description':{'type':Sequelize[_0x7413('0x2')]},'username':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3')},'apiKey':{'type':Sequelize[_0x7413('0x2')]},'remoteUri':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x4')},'serverUrl':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8952=['username','remoteUri','exports','STRING'];(function(_0x26da5e,_0x2f4830){var _0x19932c=function(_0x681c95){while(--_0x681c95){_0x26da5e['push'](_0x26da5e['shift']());}};_0x19932c(++_0x2f4830);}(_0x8952,0x17e));var _0x2895=function(_0x203016,_0x45968f){_0x203016=_0x203016-0x0;var _0x300ccf=_0x8952[_0x203016];return _0x300ccf;};'use strict';var Sequelize=require('sequelize');module[_0x2895('0x0')]={'name':{'type':Sequelize[_0x2895('0x1')]},'description':{'type':Sequelize[_0x2895('0x1')]},'username':{'type':Sequelize[_0x2895('0x1')],'unique':_0x2895('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2895('0x1')],'unique':_0x2895('0x3')},'serverUrl':{'type':Sequelize[_0x2895('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 37de1fa..acb5157 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 _0xc3ae=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','merge','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','username','remoteUri','apiKey','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4a085d,_0x2b1aa4){var _0x3176f6=function(_0x50d056){while(--_0x50d056){_0x4a085d['push'](_0x4a085d['shift']());}};_0x3176f6(++_0x2b1aa4);}(_0xc3ae,0x12d));var _0xec3a=function(_0x1bdbc4,_0x43e32b){_0x1bdbc4=_0x1bdbc4-0x0;var _0x719586=_0xc3ae[_0x1bdbc4];return _0x719586;};'use strict';var emlformat=require(_0xec3a('0x0'));var rimraf=require(_0xec3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec3a('0x2'));var rp=require('request-promise');var moment=require(_0xec3a('0x3'));var BPromise=require(_0xec3a('0x4'));var Mustache=require(_0xec3a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xec3a('0x6'));var csv=require(_0xec3a('0x7'));var ejs=require(_0xec3a('0x8'));var fs=require('fs');var fs_extra=require(_0xec3a('0x9'));var _=require(_0xec3a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec3a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xec3a('0xc'));var Papa=require(_0xec3a('0xd'));var Redis=require(_0xec3a('0xe'));var authService=require(_0xec3a('0xf'));var qs=require(_0xec3a('0x10'));var as=require(_0xec3a('0x11'));var hardwareService=require(_0xec3a('0x12'));var logger=require(_0xec3a('0x13'))(_0xec3a('0x14'));var utils=require('../../config/utils');var config=require(_0xec3a('0x15'));var licenseUtil=require(_0xec3a('0x16'));var db=require(_0xec3a('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x204e4c,_0x325153){_0x325153=_0x325153||0xcc;return function(_0x5b9eeb){if(_0x5b9eeb){return _0x204e4c[_0xec3a('0x18')](_0x325153);}return _0x204e4c[_0xec3a('0x19')](_0x325153)[_0xec3a('0x1a')]();};}function respondWithResult(_0xf092a,_0x1849ad){_0x1849ad=_0x1849ad||0xc8;return function(_0x475c1d){if(_0x475c1d){return _0xf092a[_0xec3a('0x19')](_0x1849ad)['json'](_0x475c1d);}};}function respondWithFilteredResult(_0x48167f,_0x18964e){return function(_0x37cebe){if(_0x37cebe){var _0x5415af=typeof _0x18964e[_0xec3a('0x1b')]===_0xec3a('0x1c')&&typeof _0x18964e[_0xec3a('0x1d')]===_0xec3a('0x1c');var _0x2e5cb2=_0x37cebe[_0xec3a('0x1e')];var _0x5b6e9a=_0x5415af?0x0:_0x18964e[_0xec3a('0x1b')];var _0x43316a=_0x5415af?_0x37cebe[_0xec3a('0x1e')]:_0x18964e['offset']+_0x18964e[_0xec3a('0x1d')];var _0x2d4b45;if(_0x43316a>=_0x2e5cb2){_0x43316a=_0x2e5cb2;_0x2d4b45=0xc8;}else{_0x2d4b45=0xce;}_0x48167f[_0xec3a('0x19')](_0x2d4b45);return _0x48167f[_0xec3a('0x1f')](_0xec3a('0x20'),_0x5b6e9a+'-'+_0x43316a+'/'+_0x2e5cb2)[_0xec3a('0x21')](_0x37cebe);}return null;};}function patchUpdates(_0x25af2a){return function(_0x5ed7a1){try{jsonpatch[_0xec3a('0x22')](_0x5ed7a1,_0x25af2a,!![]);}catch(_0x309fac){return BPromise[_0xec3a('0x23')](_0x309fac);}return _0x5ed7a1[_0xec3a('0x24')]();};}function saveUpdates(_0x47cbc5,_0xbf7402){return function(_0x352bb0){if(_0x352bb0){return _0x352bb0[_0xec3a('0x25')](_0x47cbc5)[_0xec3a('0x26')](function(_0x5041e3){return _0x5041e3;});}return null;};}function removeEntity(_0x3395de,_0x34ba9a){return function(_0x261537){if(_0x261537){return _0x261537[_0xec3a('0x27')]()[_0xec3a('0x26')](function(){_0x3395de[_0xec3a('0x19')](0xcc)[_0xec3a('0x1a')]();});}};}function handleEntityNotFound(_0x49ed95,_0x2bc3bd){return function(_0x5861b1){if(!_0x5861b1){_0x49ed95['sendStatus'](0x194);}return _0x5861b1;};}function handleError(_0x10ba4e,_0x4a9af0){_0x4a9af0=_0x4a9af0||0x1f4;return function(_0x57b551){logger[_0xec3a('0x28')](_0x57b551[_0xec3a('0x29')]);if(_0x57b551['name']){delete _0x57b551[_0xec3a('0x2a')];}_0x10ba4e[_0xec3a('0x19')](_0x4a9af0)[_0xec3a('0x2b')](_0x57b551);};}exports[_0xec3a('0x2c')]=function(_0x114091,_0x14ac3d){var _0x41fbf8={},_0x2f7a3b={},_0x19cbf5={'count':0x0,'rows':[]};var _0x1c2a57=_['map'](db[_0xec3a('0x2d')][_0xec3a('0x2e')],function(_0x2d389b){return{'name':_0x2d389b[_0xec3a('0x2f')],'type':_0x2d389b[_0xec3a('0x30')][_0xec3a('0x31')]};});_0x2f7a3b[_0xec3a('0x32')]=_[_0xec3a('0x33')](_0x1c2a57,_0xec3a('0x2a'));_0x2f7a3b[_0xec3a('0x34')]=_[_0xec3a('0x35')](_0x114091[_0xec3a('0x34')]);_0x2f7a3b['filters']=_[_0xec3a('0x36')](_0x2f7a3b[_0xec3a('0x32')],_0x2f7a3b[_0xec3a('0x34')]);_0x41fbf8[_0xec3a('0x37')]=_['intersection'](_0x2f7a3b[_0xec3a('0x32')],qs['fields'](_0x114091[_0xec3a('0x34')]['fields']));_0x41fbf8[_0xec3a('0x37')]=_0x41fbf8['attributes'][_0xec3a('0x38')]?_0x41fbf8[_0xec3a('0x37')]:_0x2f7a3b[_0xec3a('0x32')];if(!_0x114091['query'][_0xec3a('0x39')]('nolimit')){_0x41fbf8[_0xec3a('0x1d')]=qs[_0xec3a('0x1d')](_0x114091['query'][_0xec3a('0x1d')]);_0x41fbf8[_0xec3a('0x1b')]=qs['offset'](_0x114091[_0xec3a('0x34')][_0xec3a('0x1b')]);}_0x41fbf8[_0xec3a('0x3a')]=qs['sort'](_0x114091[_0xec3a('0x34')][_0xec3a('0x3b')]);_0x41fbf8[_0xec3a('0x3c')]=qs[_0xec3a('0x3d')](_['pick'](_0x114091['query'],_0x2f7a3b['filters']),_0x1c2a57);if(_0x114091[_0xec3a('0x34')][_0xec3a('0x3e')]){_0x41fbf8['where']=_['merge'](_0x41fbf8['where'],{'$or':_['map'](_0x1c2a57,function(_0x26e121){if(_0x26e121[_0xec3a('0x30')]!==_0xec3a('0x3f')){var _0x16ba65={};_0x16ba65[_0x26e121[_0xec3a('0x2a')]]={'$like':'%'+_0x114091[_0xec3a('0x34')][_0xec3a('0x3e')]+'%'};return _0x16ba65;}})});}_0x41fbf8=_['merge']({},_0x41fbf8,_0x114091[_0xec3a('0x40')]);var _0x29b9ca={'where':_0x41fbf8['where']};return db[_0xec3a('0x2d')][_0xec3a('0x1e')](_0x29b9ca)[_0xec3a('0x26')](function(_0x37cfcb){_0x19cbf5[_0xec3a('0x1e')]=_0x37cfcb;if(_0x114091[_0xec3a('0x34')][_0xec3a('0x41')]){_0x41fbf8['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0xec3a('0x42')](_0x41fbf8);})[_0xec3a('0x26')](function(_0x4e936b){_0x19cbf5[_0xec3a('0x43')]=_0x4e936b;return _0x19cbf5;})[_0xec3a('0x26')](respondWithFilteredResult(_0x14ac3d,_0x41fbf8))[_0xec3a('0x44')](handleError(_0x14ac3d,null));};exports[_0xec3a('0x45')]=function(_0x3ca382,_0x268fdc){var _0x5a3048={'raw':![],'where':{'id':_0x3ca382[_0xec3a('0x46')]['id']}},_0x49a024={};_0x49a024[_0xec3a('0x32')]=_[_0xec3a('0x35')](db[_0xec3a('0x2d')]['rawAttributes']);_0x49a024[_0xec3a('0x34')]=_[_0xec3a('0x35')](_0x3ca382[_0xec3a('0x34')]);_0x49a024['filters']=_[_0xec3a('0x36')](_0x49a024['model'],_0x49a024[_0xec3a('0x34')]);_0x5a3048[_0xec3a('0x37')]=_[_0xec3a('0x36')](_0x49a024['model'],qs[_0xec3a('0x47')](_0x3ca382[_0xec3a('0x34')][_0xec3a('0x47')]));_0x5a3048['attributes']=_0x5a3048[_0xec3a('0x37')][_0xec3a('0x38')]?_0x5a3048[_0xec3a('0x37')]:_0x49a024[_0xec3a('0x32')];if(_0x3ca382[_0xec3a('0x34')][_0xec3a('0x41')]){_0x5a3048[_0xec3a('0x48')]=[{'all':!![]}];}_0x5a3048=_[_0xec3a('0x49')]({},_0x5a3048,_0x3ca382[_0xec3a('0x40')]);return db['FreshsalesAccount'][_0xec3a('0x4a')](_0x5a3048)[_0xec3a('0x26')](handleEntityNotFound(_0x268fdc,null))['then'](respondWithResult(_0x268fdc,null))[_0xec3a('0x44')](handleError(_0x268fdc,null));};exports[_0xec3a('0x4b')]=function(_0xd77e55,_0x243de0){return db['FreshsalesAccount']['create'](_0xd77e55[_0xec3a('0x4c')],{})[_0xec3a('0x26')](respondWithResult(_0x243de0,0xc9))['catch'](handleError(_0x243de0,null));};exports[_0xec3a('0x25')]=function(_0x55b997,_0x40edfa){if(_0x55b997[_0xec3a('0x4c')]['id']){delete _0x55b997[_0xec3a('0x4c')]['id'];}return db['FreshsalesAccount'][_0xec3a('0x4a')]({'where':{'id':_0x55b997[_0xec3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x40edfa,null))[_0xec3a('0x26')](saveUpdates(_0x55b997[_0xec3a('0x4c')],null))['then'](respondWithResult(_0x40edfa,null))[_0xec3a('0x44')](handleError(_0x40edfa,null));};exports[_0xec3a('0x27')]=function(_0x2880d6,_0x23d892){return db['FreshsalesAccount'][_0xec3a('0x4a')]({'where':{'id':_0x2880d6[_0xec3a('0x46')]['id']}})[_0xec3a('0x26')](handleEntityNotFound(_0x23d892,null))[_0xec3a('0x26')](removeEntity(_0x23d892,null))[_0xec3a('0x44')](handleError(_0x23d892,null));};exports[_0xec3a('0x4d')]=function(_0x283880,_0x59c054,_0x432d6f){var _0x3bcb63={};var _0x1d3a07={};var _0x153b99;var _0x51b89d;return db['FreshsalesAccount'][_0xec3a('0x4e')]({'where':{'id':_0x283880['params']['id']}})[_0xec3a('0x26')](handleEntityNotFound(_0x59c054,null))[_0xec3a('0x26')](function(_0x524472){if(_0x524472){_0x153b99=_0x524472;_0x1d3a07[_0xec3a('0x32')]=_[_0xec3a('0x35')](db[_0xec3a('0x4f')][_0xec3a('0x2e')]);_0x1d3a07[_0xec3a('0x34')]=_['keys'](_0x283880[_0xec3a('0x34')]);_0x1d3a07[_0xec3a('0x3d')]=_[_0xec3a('0x36')](_0x1d3a07[_0xec3a('0x32')],_0x1d3a07[_0xec3a('0x34')]);_0x3bcb63[_0xec3a('0x37')]=_['intersection'](_0x1d3a07[_0xec3a('0x32')],qs[_0xec3a('0x47')](_0x283880[_0xec3a('0x34')]['fields']));_0x3bcb63['attributes']=_0x3bcb63['attributes'][_0xec3a('0x38')]?_0x3bcb63['attributes']:_0x1d3a07[_0xec3a('0x32')];_0x3bcb63[_0xec3a('0x3a')]=qs[_0xec3a('0x3b')](_0x283880[_0xec3a('0x34')][_0xec3a('0x3b')]);_0x3bcb63[_0xec3a('0x3c')]=qs[_0xec3a('0x3d')](_[_0xec3a('0x50')](_0x283880[_0xec3a('0x34')],_0x1d3a07[_0xec3a('0x3d')]));if(_0x283880[_0xec3a('0x34')][_0xec3a('0x3e')]){_0x3bcb63[_0xec3a('0x3c')]=_['merge'](_0x3bcb63['where'],{'$or':_[_0xec3a('0x33')](_0x3bcb63[_0xec3a('0x37')],function(_0x86d0da){var _0x37685a={};_0x37685a[_0x86d0da]={'$like':'%'+_0x283880[_0xec3a('0x34')]['filter']+'%'};return _0x37685a;})});}_0x3bcb63=_[_0xec3a('0x49')]({},_0x3bcb63,_0x283880[_0xec3a('0x40')]);return _0x153b99[_0xec3a('0x4d')](_0x3bcb63);}})[_0xec3a('0x26')](function(_0x58a2a4){if(_0x58a2a4){_0x51b89d=_0x58a2a4[_0xec3a('0x38')];if(!_0x283880[_0xec3a('0x34')]['hasOwnProperty'](_0xec3a('0x51'))){_0x3bcb63['limit']=qs[_0xec3a('0x1d')](_0x283880[_0xec3a('0x34')][_0xec3a('0x1d')]);_0x3bcb63['offset']=qs[_0xec3a('0x1b')](_0x283880[_0xec3a('0x34')][_0xec3a('0x1b')]);}return _0x153b99[_0xec3a('0x4d')](_0x3bcb63);}})['then'](function(_0x3f3a9f){if(_0x3f3a9f){return _0x3f3a9f?{'count':_0x51b89d,'rows':_0x3f3a9f}:null;}})[_0xec3a('0x26')](respondWithResult(_0x59c054,null))[_0xec3a('0x44')](handleError(_0x59c054,null));};exports[_0xec3a('0x52')]=function(_0x1ab47f,_0x40ef97,_0x2a811b){if(_0x1ab47f[_0xec3a('0x4c')]['id']){delete _0x1ab47f[_0xec3a('0x4c')]['id'];}return db[_0xec3a('0x2d')]['findOne']({'where':{'id':_0x1ab47f[_0xec3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x40ef97,null))[_0xec3a('0x26')](function(_0x3d73d1){if(_0x3d73d1){_0x1ab47f[_0xec3a('0x4c')][_0xec3a('0x53')]=_0x3d73d1['id'];_0x1ab47f['body'][_0xec3a('0x54')]=integrations[_0xec3a('0x55')](_0x1ab47f[_0xec3a('0x4c')][_0xec3a('0x56')],_0x1ab47f[_0xec3a('0x4c')][_0xec3a('0x30')]);_0x1ab47f[_0xec3a('0x4c')][_0xec3a('0x57')]=integrations['getDescriptions'](_0x1ab47f['body'][_0xec3a('0x56')],_0x1ab47f[_0xec3a('0x4c')][_0xec3a('0x30')]);return db[_0xec3a('0x4f')][_0xec3a('0x4b')](_0x1ab47f[_0xec3a('0x4c')],{'include':[{'model':db[_0xec3a('0x58')],'as':_0xec3a('0x54')},{'model':db[_0xec3a('0x58')],'as':'Descriptions'}]});}return null;})[_0xec3a('0x26')](respondWithResult(_0x40ef97,null))[_0xec3a('0x44')](handleError(_0x40ef97,null));};exports['getFields']=function(_0x2e3461,_0xf5a9aa,_0x231528){var _0x2c17a0='';var _0x226b3e='';return db[_0xec3a('0x2d')][_0xec3a('0x4e')]({'where':{'id':_0x2e3461[_0xec3a('0x46')]['id']},'attributes':['id',_0xec3a('0x59'),_0xec3a('0x5a'),_0xec3a('0x5b')]})[_0xec3a('0x26')](handleEntityNotFound(_0xf5a9aa,null))[_0xec3a('0x26')](function(_0x5e6141){if(_0x5e6141){_0x226b3e=_0x5e6141['username'];_0x2c17a0=_0x5e6141['remoteUri'];var _0x2460e3=_0x5e6141[_0xec3a('0x5a')]['slice'](-0x1);if(_0x2460e3==='/'){_0x2c17a0=_0x2c17a0['substring'](0x0,_0x2c17a0[_0xec3a('0x5c')](_0x2460e3));}return rp({'method':_0xec3a('0x5d'),'uri':util[_0xec3a('0x5e')](_0xec3a('0x5f'),_0x2c17a0,_0xec3a('0x60')),'headers':{'Authorization':_0xec3a('0x61')+_0x5e6141[_0xec3a('0x5b')]},'json':!![]});}})[_0xec3a('0x26')](function(_0x395a09){if(_0x395a09){var _0x11bd67=_0x395a09[_0xec3a('0x62')];var _0x1bb845=![];var _0x349e4a=null;for(_0x349e4a=0x0;_0x349e4a<_0x11bd67['length'];_0x349e4a++){if(_0x11bd67[_0x349e4a]['email']===_0x226b3e){_0x1bb845=!![];}}if(_0x1bb845){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xec3a('0x63')});}}})[_0xec3a('0x26')](respondWithResult(_0xf5a9aa,null))[_0xec3a('0x44')](function(_0x32a379){var _0x2036e6=_0x2e3461[_0xec3a('0x34')]['test']?0x1f4:_0x32a379[_0xec3a('0x64')]||0x1f4;logger[_0xec3a('0x28')](_0xec3a('0x65'),_0xec3a('0x66'),_0x2036e6,JSON[_0xec3a('0x67')](_0x32a379));delete _0x32a379[_0xec3a('0x2a')];if(_0x2036e6===0x191){_0x2036e6=0x190;}_0xf5a9aa[_0xec3a('0x19')](_0x2036e6)[_0xec3a('0x2b')](_0x2e3461[_0xec3a('0x34')][_0xec3a('0x68')]?{'message':_0xec3a('0x69'),'statusCode':_0x32a379[_0xec3a('0x64')]}:_0x32a379);});}; \ No newline at end of file +var _0x1713=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','FreshsalesAccount','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs'];(function(_0x3875a8,_0x3c7a66){var _0x4326b6=function(_0x44d1c8){while(--_0x44d1c8){_0x3875a8['push'](_0x3875a8['shift']());}};_0x4326b6(++_0x3c7a66);}(_0x1713,0x134));var _0x3171=function(_0x4c4957,_0x11348d){_0x4c4957=_0x4c4957-0x0;var _0x13787a=_0x1713[_0x4c4957];return _0x13787a;};'use strict';var emlformat=require(_0x3171('0x0'));var rimraf=require(_0x3171('0x1'));var zipdir=require(_0x3171('0x2'));var jsonpatch=require(_0x3171('0x3'));var rp=require(_0x3171('0x4'));var moment=require(_0x3171('0x5'));var BPromise=require(_0x3171('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3171('0x7'));var csv=require(_0x3171('0x8'));var ejs=require(_0x3171('0x9'));var fs=require('fs');var fs_extra=require(_0x3171('0xa'));var _=require('lodash');var squel=require(_0x3171('0xb'));var crypto=require(_0x3171('0xc'));var jsforce=require(_0x3171('0xd'));var deskjs=require(_0x3171('0xe'));var toCsv=require(_0x3171('0x8'));var querystring=require(_0x3171('0xf'));var Papa=require(_0x3171('0x10'));var Redis=require(_0x3171('0x11'));var authService=require(_0x3171('0x12'));var qs=require(_0x3171('0x13'));var as=require(_0x3171('0x14'));var hardwareService=require(_0x3171('0x15'));var logger=require('../../config/logger')(_0x3171('0x16'));var utils=require(_0x3171('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3171('0x18'));var db=require(_0x3171('0x19'))['db'];var integrations=require(_0x3171('0x1a'));function respondWithStatusCode(_0x1f845f,_0xbce9af){_0xbce9af=_0xbce9af||0xcc;return function(_0x3e28fd){if(_0x3e28fd){return _0x1f845f[_0x3171('0x1b')](_0xbce9af);}return _0x1f845f[_0x3171('0x1c')](_0xbce9af)[_0x3171('0x1d')]();};}function respondWithResult(_0x5540a8,_0x1962d8){_0x1962d8=_0x1962d8||0xc8;return function(_0x2790ad){if(_0x2790ad){return _0x5540a8[_0x3171('0x1c')](_0x1962d8)[_0x3171('0x1e')](_0x2790ad);}};}function respondWithFilteredResult(_0x3901e2,_0xb1b6f7){return function(_0x59091e){if(_0x59091e){var _0x36bcbb=typeof _0xb1b6f7['offset']==='undefined'&&typeof _0xb1b6f7[_0x3171('0x1f')]===_0x3171('0x20');var _0x17d726=_0x59091e[_0x3171('0x21')];var _0x19d721=_0x36bcbb?0x0:_0xb1b6f7['offset'];var _0x162f0c=_0x36bcbb?_0x59091e[_0x3171('0x21')]:_0xb1b6f7[_0x3171('0x22')]+_0xb1b6f7[_0x3171('0x1f')];var _0x33b120;if(_0x162f0c>=_0x17d726){_0x162f0c=_0x17d726;_0x33b120=0xc8;}else{_0x33b120=0xce;}_0x3901e2[_0x3171('0x1c')](_0x33b120);return _0x3901e2[_0x3171('0x23')](_0x3171('0x24'),_0x19d721+'-'+_0x162f0c+'/'+_0x17d726)[_0x3171('0x1e')](_0x59091e);}return null;};}function patchUpdates(_0x172df1){return function(_0x1e97cc){try{jsonpatch[_0x3171('0x25')](_0x1e97cc,_0x172df1,!![]);}catch(_0x163338){return BPromise[_0x3171('0x26')](_0x163338);}return _0x1e97cc[_0x3171('0x27')]();};}function saveUpdates(_0x45bde3,_0x26bc47){return function(_0x1e19a3){if(_0x1e19a3){return _0x1e19a3[_0x3171('0x28')](_0x45bde3)[_0x3171('0x29')](function(_0x4b6245){return _0x4b6245;});}return null;};}function removeEntity(_0xf25ce5,_0x4956ec){return function(_0x1bd940){if(_0x1bd940){return _0x1bd940[_0x3171('0x2a')]()['then'](function(){_0xf25ce5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x461e71,_0x5b6cb5){return function(_0x2ce970){if(!_0x2ce970){_0x461e71['sendStatus'](0x194);}return _0x2ce970;};}function handleError(_0x5de348,_0x4fb72b){_0x4fb72b=_0x4fb72b||0x1f4;return function(_0x1d25aa){logger[_0x3171('0x2b')](_0x1d25aa[_0x3171('0x2c')]);if(_0x1d25aa[_0x3171('0x2d')]){delete _0x1d25aa[_0x3171('0x2d')];}_0x5de348['status'](_0x4fb72b)['send'](_0x1d25aa);};}exports[_0x3171('0x2e')]=function(_0x503a17,_0x37b5ea){var _0x30206a={},_0xc56470={},_0x29dece={'count':0x0,'rows':[]};var _0x20a9eb=_['map'](db[_0x3171('0x2f')][_0x3171('0x30')],function(_0x5009a6){return{'name':_0x5009a6['fieldName'],'type':_0x5009a6[_0x3171('0x31')]['key']};});_0xc56470[_0x3171('0x32')]=_[_0x3171('0x33')](_0x20a9eb,'name');_0xc56470[_0x3171('0x34')]=_[_0x3171('0x35')](_0x503a17[_0x3171('0x34')]);_0xc56470[_0x3171('0x36')]=_[_0x3171('0x37')](_0xc56470[_0x3171('0x32')],_0xc56470[_0x3171('0x34')]);_0x30206a[_0x3171('0x38')]=_[_0x3171('0x37')](_0xc56470[_0x3171('0x32')],qs[_0x3171('0x39')](_0x503a17[_0x3171('0x34')]['fields']));_0x30206a[_0x3171('0x38')]=_0x30206a['attributes'][_0x3171('0x3a')]?_0x30206a[_0x3171('0x38')]:_0xc56470[_0x3171('0x32')];if(!_0x503a17[_0x3171('0x34')]['hasOwnProperty'](_0x3171('0x3b'))){_0x30206a[_0x3171('0x1f')]=qs['limit'](_0x503a17[_0x3171('0x34')][_0x3171('0x1f')]);_0x30206a[_0x3171('0x22')]=qs[_0x3171('0x22')](_0x503a17['query'][_0x3171('0x22')]);}_0x30206a[_0x3171('0x3c')]=qs[_0x3171('0x3d')](_0x503a17[_0x3171('0x34')]['sort']);_0x30206a['where']=qs[_0x3171('0x36')](_[_0x3171('0x3e')](_0x503a17[_0x3171('0x34')],_0xc56470[_0x3171('0x36')]),_0x20a9eb);if(_0x503a17['query'][_0x3171('0x3f')]){_0x30206a['where']=_[_0x3171('0x40')](_0x30206a[_0x3171('0x41')],{'$or':_['map'](_0x20a9eb,function(_0x2bcf3b){if(_0x2bcf3b['type']!=='VIRTUAL'){var _0x356f04={};_0x356f04[_0x2bcf3b[_0x3171('0x2d')]]={'$like':'%'+_0x503a17[_0x3171('0x34')][_0x3171('0x3f')]+'%'};return _0x356f04;}})});}_0x30206a=_[_0x3171('0x40')]({},_0x30206a,_0x503a17[_0x3171('0x42')]);var _0x2f7202={'where':_0x30206a[_0x3171('0x41')]};return db['FreshsalesAccount'][_0x3171('0x21')](_0x2f7202)[_0x3171('0x29')](function(_0x8469e5){_0x29dece[_0x3171('0x21')]=_0x8469e5;if(_0x503a17['query'][_0x3171('0x43')]){_0x30206a[_0x3171('0x44')]=[{'all':!![]}];}return db[_0x3171('0x2f')][_0x3171('0x45')](_0x30206a);})['then'](function(_0x3c87c5){_0x29dece[_0x3171('0x46')]=_0x3c87c5;return _0x29dece;})[_0x3171('0x29')](respondWithFilteredResult(_0x37b5ea,_0x30206a))['catch'](handleError(_0x37b5ea,null));};exports[_0x3171('0x47')]=function(_0x343ae4,_0x2a00f4){var _0x2a688b={'raw':![],'where':{'id':_0x343ae4[_0x3171('0x48')]['id']}},_0x17eba0={};_0x17eba0['model']=_['keys'](db[_0x3171('0x2f')][_0x3171('0x30')]);_0x17eba0[_0x3171('0x34')]=_['keys'](_0x343ae4[_0x3171('0x34')]);_0x17eba0[_0x3171('0x36')]=_[_0x3171('0x37')](_0x17eba0[_0x3171('0x32')],_0x17eba0[_0x3171('0x34')]);_0x2a688b[_0x3171('0x38')]=_[_0x3171('0x37')](_0x17eba0[_0x3171('0x32')],qs[_0x3171('0x39')](_0x343ae4[_0x3171('0x34')][_0x3171('0x39')]));_0x2a688b['attributes']=_0x2a688b[_0x3171('0x38')][_0x3171('0x3a')]?_0x2a688b[_0x3171('0x38')]:_0x17eba0[_0x3171('0x32')];if(_0x343ae4[_0x3171('0x34')][_0x3171('0x43')]){_0x2a688b[_0x3171('0x44')]=[{'all':!![]}];}_0x2a688b=_[_0x3171('0x40')]({},_0x2a688b,_0x343ae4[_0x3171('0x42')]);return db[_0x3171('0x2f')]['find'](_0x2a688b)[_0x3171('0x29')](handleEntityNotFound(_0x2a00f4,null))[_0x3171('0x29')](respondWithResult(_0x2a00f4,null))[_0x3171('0x49')](handleError(_0x2a00f4,null));};exports[_0x3171('0x4a')]=function(_0xc71e50,_0x44a529){return db['FreshsalesAccount'][_0x3171('0x4a')](_0xc71e50['body'],{})[_0x3171('0x29')](respondWithResult(_0x44a529,0xc9))['catch'](handleError(_0x44a529,null));};exports[_0x3171('0x28')]=function(_0xc591fb,_0x4906fb){if(_0xc591fb[_0x3171('0x4b')]['id']){delete _0xc591fb[_0x3171('0x4b')]['id'];}return db[_0x3171('0x2f')][_0x3171('0x4c')]({'where':{'id':_0xc591fb['params']['id']}})[_0x3171('0x29')](handleEntityNotFound(_0x4906fb,null))[_0x3171('0x29')](saveUpdates(_0xc591fb[_0x3171('0x4b')],null))[_0x3171('0x29')](respondWithResult(_0x4906fb,null))['catch'](handleError(_0x4906fb,null));};exports['destroy']=function(_0x2d3365,_0x73c669){return db[_0x3171('0x2f')][_0x3171('0x4c')]({'where':{'id':_0x2d3365['params']['id']}})[_0x3171('0x29')](handleEntityNotFound(_0x73c669,null))[_0x3171('0x29')](removeEntity(_0x73c669,null))[_0x3171('0x49')](handleError(_0x73c669,null));};exports['getConfigurations']=function(_0xe9b506,_0x28507c,_0x356e14){var _0x3696e5={};var _0x5da6c7={};var _0x4ad916;var _0x1c1ba2;return db[_0x3171('0x2f')][_0x3171('0x4d')]({'where':{'id':_0xe9b506[_0x3171('0x48')]['id']}})[_0x3171('0x29')](handleEntityNotFound(_0x28507c,null))[_0x3171('0x29')](function(_0x11a16c){if(_0x11a16c){_0x4ad916=_0x11a16c;_0x5da6c7[_0x3171('0x32')]=_[_0x3171('0x35')](db[_0x3171('0x4e')][_0x3171('0x30')]);_0x5da6c7[_0x3171('0x34')]=_[_0x3171('0x35')](_0xe9b506['query']);_0x5da6c7[_0x3171('0x36')]=_[_0x3171('0x37')](_0x5da6c7[_0x3171('0x32')],_0x5da6c7[_0x3171('0x34')]);_0x3696e5[_0x3171('0x38')]=_[_0x3171('0x37')](_0x5da6c7[_0x3171('0x32')],qs[_0x3171('0x39')](_0xe9b506[_0x3171('0x34')][_0x3171('0x39')]));_0x3696e5[_0x3171('0x38')]=_0x3696e5[_0x3171('0x38')][_0x3171('0x3a')]?_0x3696e5['attributes']:_0x5da6c7[_0x3171('0x32')];_0x3696e5[_0x3171('0x3c')]=qs[_0x3171('0x3d')](_0xe9b506[_0x3171('0x34')][_0x3171('0x3d')]);_0x3696e5['where']=qs['filters'](_[_0x3171('0x3e')](_0xe9b506[_0x3171('0x34')],_0x5da6c7['filters']));if(_0xe9b506['query'][_0x3171('0x3f')]){_0x3696e5[_0x3171('0x41')]=_[_0x3171('0x40')](_0x3696e5[_0x3171('0x41')],{'$or':_[_0x3171('0x33')](_0x3696e5[_0x3171('0x38')],function(_0x206a34){var _0x221bc7={};_0x221bc7[_0x206a34]={'$like':'%'+_0xe9b506[_0x3171('0x34')][_0x3171('0x3f')]+'%'};return _0x221bc7;})});}_0x3696e5=_[_0x3171('0x40')]({},_0x3696e5,_0xe9b506[_0x3171('0x42')]);return _0x4ad916[_0x3171('0x4f')](_0x3696e5);}})[_0x3171('0x29')](function(_0x237e32){if(_0x237e32){_0x1c1ba2=_0x237e32['length'];if(!_0xe9b506[_0x3171('0x34')]['hasOwnProperty']('nolimit')){_0x3696e5[_0x3171('0x1f')]=qs[_0x3171('0x1f')](_0xe9b506[_0x3171('0x34')][_0x3171('0x1f')]);_0x3696e5['offset']=qs[_0x3171('0x22')](_0xe9b506[_0x3171('0x34')][_0x3171('0x22')]);}return _0x4ad916[_0x3171('0x4f')](_0x3696e5);}})[_0x3171('0x29')](function(_0x35acbb){if(_0x35acbb){return _0x35acbb?{'count':_0x1c1ba2,'rows':_0x35acbb}:null;}})[_0x3171('0x29')](respondWithResult(_0x28507c,null))[_0x3171('0x49')](handleError(_0x28507c,null));};exports[_0x3171('0x50')]=function(_0x459bf2,_0x5b32b8,_0x373620){if(_0x459bf2[_0x3171('0x4b')]['id']){delete _0x459bf2[_0x3171('0x4b')]['id'];}return db[_0x3171('0x2f')][_0x3171('0x4d')]({'where':{'id':_0x459bf2[_0x3171('0x48')]['id']}})[_0x3171('0x29')](handleEntityNotFound(_0x5b32b8,null))[_0x3171('0x29')](function(_0x14671d){if(_0x14671d){_0x459bf2[_0x3171('0x4b')][_0x3171('0x51')]=_0x14671d['id'];_0x459bf2[_0x3171('0x4b')][_0x3171('0x52')]=integrations[_0x3171('0x53')](_0x459bf2[_0x3171('0x4b')]['channel'],_0x459bf2['body'][_0x3171('0x31')]);_0x459bf2['body']['Descriptions']=integrations[_0x3171('0x54')](_0x459bf2[_0x3171('0x4b')]['channel'],_0x459bf2['body'][_0x3171('0x31')]);return db[_0x3171('0x4e')][_0x3171('0x4a')](_0x459bf2[_0x3171('0x4b')],{'include':[{'model':db[_0x3171('0x55')],'as':_0x3171('0x52')},{'model':db[_0x3171('0x55')],'as':_0x3171('0x56')}]});}return null;})[_0x3171('0x29')](respondWithResult(_0x5b32b8,null))[_0x3171('0x49')](handleError(_0x5b32b8,null));};exports[_0x3171('0x57')]=function(_0x1f83ec,_0x2f6535,_0x4b8165){var _0x4d695a='';var _0x31f5cd='';return db[_0x3171('0x2f')][_0x3171('0x4d')]({'where':{'id':_0x1f83ec[_0x3171('0x48')]['id']},'attributes':['id',_0x3171('0x58'),_0x3171('0x59'),_0x3171('0x5a')]})[_0x3171('0x29')](handleEntityNotFound(_0x2f6535,null))[_0x3171('0x29')](function(_0x245dc5){if(_0x245dc5){_0x31f5cd=_0x245dc5[_0x3171('0x58')];_0x4d695a=_0x245dc5['remoteUri'];var _0x3eb5df=_0x245dc5[_0x3171('0x59')][_0x3171('0x5b')](-0x1);if(_0x3eb5df==='/'){_0x4d695a=_0x4d695a['substring'](0x0,_0x4d695a[_0x3171('0x5c')](_0x3eb5df));}return rp({'method':_0x3171('0x5d'),'uri':util[_0x3171('0x5e')](_0x3171('0x5f'),_0x4d695a,_0x3171('0x60')),'headers':{'Authorization':_0x3171('0x61')+_0x245dc5[_0x3171('0x5a')]},'json':!![]});}})[_0x3171('0x29')](function(_0xad4ffa){if(_0xad4ffa){var _0x3e34cf=_0xad4ffa[_0x3171('0x62')];var _0x1fcc16=![];var _0x321a82=null;for(_0x321a82=0x0;_0x321a82<_0x3e34cf[_0x3171('0x3a')];_0x321a82++){if(_0x3e34cf[_0x321a82][_0x3171('0x63')]===_0x31f5cd){_0x1fcc16=!![];}}if(_0x1fcc16){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3171('0x64')});}}})[_0x3171('0x29')](respondWithResult(_0x2f6535,null))[_0x3171('0x49')](function(_0x13bf4e){var _0x47a17d=_0x1f83ec[_0x3171('0x34')][_0x3171('0x65')]?0x1f4:_0x13bf4e['statusCode']||0x1f4;logger['error'](_0x3171('0x66'),_0x3171('0x57'),_0x47a17d,JSON[_0x3171('0x67')](_0x13bf4e));delete _0x13bf4e[_0x3171('0x2d')];if(_0x47a17d===0x191){_0x47a17d=0x190;}_0x2f6535[_0x3171('0x1c')](_0x47a17d)[_0x3171('0x68')](_0x1f83ec[_0x3171('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x13bf4e[_0x3171('0x69')]}:_0x13bf4e);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6d6e742..f0ee464 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts'];(function(_0x27fb6e,_0x487c11){var _0x3d3afd=function(_0x55a999){while(--_0x55a999){_0x27fb6e['push'](_0x27fb6e['shift']());}};_0x3d3afd(++_0x487c11);}(_0x1261,0x144));var _0x1126=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x1261[_0xf04c6d];return _0x4a804e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ace=['request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1977c2,_0x19446a){_0x1977c2=_0x1977c2-0x0;var _0x1f591c=_0x8ace[_0x1977c2];return _0x1f591c;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));var integrations=require(_0xe8ac('0xb'));module[_0xe8ac('0xc')]=function(_0x2b48ec,_0x4eb087){return _0x2b48ec[_0xe8ac('0xd')](_0xe8ac('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index af80994..c2a23fd 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 _0x25e7=['find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x25e7,0x1d6));var _0x725e=function(_0x24cf7f,_0x31a459){_0x24cf7f=_0x24cf7f-0x0;var _0x522347=_0x25e7[_0x24cf7f];return _0x522347;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')]({'raw':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x397e33[_0x725e('0x19')]?_0x397e33['options'][_0x725e('0x1b')]||null:null,'attributes':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1c')]||null:null,'limit':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1d')]||null:null,'include':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')]['include']?_[_0x725e('0x1e')](_0x397e33[_0x725e('0x19')][_0x725e('0x1f')],function(_0x3facae){return{'model':db[_0x3facae['model']],'as':_0x3facae['as'],'attributes':_0x3facae[_0x725e('0x1c')],'include':_0x3facae['include']?_['map'](_0x3facae['include'],function(_0x2aad7b){return{'model':db[_0x2aad7b[_0x725e('0x20')]],'as':_0x2aad7b['as'],'attributes':_0x2aad7b[_0x725e('0x1c')],'include':_0x2aad7b['include']?_[_0x725e('0x1e')](_0x2aad7b[_0x725e('0x1f')],function(_0x5a5bef){return{'model':db[_0x5a5bef[_0x725e('0x20')]],'as':_0x5a5bef['as'],'attributes':_0x5a5bef[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x378ace){logger['info']('GetFreshsalesAccount',_0x397e33);logger[_0x725e('0x10')]('GetFreshsalesAccount',_0x397e33,JSON[_0x725e('0x21')](_0x378ace));_0x2811e7(_0x378ace);})['catch'](function(_0x4de2e0){logger[_0x725e('0x12')](_0x725e('0x16'),_0x4de2e0[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438['error'](0x1f4,_0x4de2e0[_0x725e('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x85d29c){var _0x1ce9c8=this;return new Promise(function(_0x39932f,_0x28951f){return db[_0x725e('0x17')][_0x725e('0x22')]({'raw':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['where']||null:null,'attributes':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['attributes']||null:null,'include':_0x85d29c[_0x725e('0x19')]?_0x85d29c['options'][_0x725e('0x1f')]?_['map'](_0x85d29c[_0x725e('0x19')][_0x725e('0x1f')],function(_0x1f2898){return{'model':db[_0x1f2898[_0x725e('0x20')]],'as':_0x1f2898['as'],'attributes':_0x1f2898[_0x725e('0x1c')],'include':_0x1f2898[_0x725e('0x1f')]?_['map'](_0x1f2898['include'],function(_0x35e5e7){return{'model':db[_0x35e5e7[_0x725e('0x20')]],'as':_0x35e5e7['as'],'attributes':_0x35e5e7[_0x725e('0x1c')],'include':_0x35e5e7['include']?_[_0x725e('0x1e')](_0x35e5e7['include'],function(_0x3ce327){return{'model':db[_0x3ce327[_0x725e('0x20')]],'as':_0x3ce327['as'],'attributes':_0x3ce327[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x725e('0xc')](function(_0x4f15f3){logger['info'](_0x725e('0x23'),_0x85d29c);logger[_0x725e('0x10')](_0x725e('0x23'),_0x85d29c,JSON['stringify'](_0x4f15f3));_0x39932f(_0x4f15f3);})[_0x725e('0x15')](function(_0xec3b9d){logger[_0x725e('0x12')]('ShowFreshsalesAccount',_0xec3b9d[_0x725e('0x13')],_0x85d29c);_0x28951f(_0x1ce9c8['error'](0x1f4,_0xec3b9d[_0x725e('0x13')]));});});}; \ No newline at end of file +var _0x7278=['stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x343a4f,_0x339403){var _0x50c50d=function(_0xdaed02){while(--_0xdaed02){_0x343a4f['push'](_0x343a4f['shift']());}};_0x50c50d(++_0x339403);}(_0x7278,0x161));var _0x8727=function(_0x15801c,_0x178758){_0x15801c=_0x15801c-0x0;var _0x514877=_0x7278[_0x15801c];return _0x514877;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd1902,_0x2f491c,_0xffd783){return new BPromise(function(_0x435911,_0x4160c3){return client['request'](_0xfd1902,_0xffd783)['then'](function(_0x4df6f8){logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));logger[_0x8727('0xf')](_0x8727('0x10'),_0x2f491c,_0x8727('0xe'),JSON[_0x8727('0x11')](_0x4df6f8));if(_0x4df6f8[_0x8727('0x12')]){if(_0x4df6f8['error'][_0x8727('0x13')]===0x1f4){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8['error'][_0x8727('0x14')]);return _0x4160c3(_0x4df6f8[_0x8727('0x12')]['message']);}logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);return _0x435911(_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);}else{logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));_0x435911(_0x4df6f8[_0x8727('0x15')]['message']);}})[_0x8727('0x16')](function(_0x1f9538){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x1f9538);_0x4160c3(_0x1f9538);});});}exports[_0x8727('0x17')]=function(_0xba0af5){var _0x533e6d=this;return new Promise(function(_0x575d29,_0x1a90ed){return db['FreshsalesAccount'][_0x8727('0x18')]({'raw':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1a')]===undefined?!![]:![]:!![],'where':_0xba0af5[_0x8727('0x19')]?_0xba0af5['options'][_0x8727('0x1b')]||null:null,'attributes':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'limit':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1d')]||null:null,'include':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0xba0af5[_0x8727('0x19')]['include'],function(_0x464a32){return{'model':db[_0x464a32[_0x8727('0x20')]],'as':_0x464a32['as'],'attributes':_0x464a32['attributes'],'include':_0x464a32['include']?_[_0x8727('0x1f')](_0x464a32[_0x8727('0x1e')],function(_0x15e8bf){return{'model':db[_0x15e8bf['model']],'as':_0x15e8bf['as'],'attributes':_0x15e8bf[_0x8727('0x1c')],'include':_0x15e8bf[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x15e8bf[_0x8727('0x1e')],function(_0x2c8cd5){return{'model':db[_0x2c8cd5[_0x8727('0x20')]],'as':_0x2c8cd5['as'],'attributes':_0x2c8cd5[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x5d03f2){logger[_0x8727('0xc')](_0x8727('0x17'),_0xba0af5);logger['debug'](_0x8727('0x17'),_0xba0af5,JSON[_0x8727('0x11')](_0x5d03f2));_0x575d29(_0x5d03f2);})[_0x8727('0x16')](function(_0x228ca9){logger[_0x8727('0x12')](_0x8727('0x17'),_0x228ca9['message'],_0xba0af5);_0x1a90ed(_0x533e6d[_0x8727('0x12')](0x1f4,_0x228ca9['message']));});});};exports[_0x8727('0x22')]=function(_0x47e9f9){var _0x44ed83=this;return new Promise(function(_0x391d60,_0x152a53){return db[_0x8727('0x23')][_0x8727('0x24')]({'raw':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1b')]||null:null,'attributes':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'include':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')],function(_0x54bff3){return{'model':db[_0x54bff3['model']],'as':_0x54bff3['as'],'attributes':_0x54bff3[_0x8727('0x1c')],'include':_0x54bff3[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x54bff3[_0x8727('0x1e')],function(_0x52220f){return{'model':db[_0x52220f[_0x8727('0x20')]],'as':_0x52220f['as'],'attributes':_0x52220f[_0x8727('0x1c')],'include':_0x52220f[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x52220f[_0x8727('0x1e')],function(_0x5b96cc){return{'model':db[_0x5b96cc[_0x8727('0x20')]],'as':_0x5b96cc['as'],'attributes':_0x5b96cc[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x1b0e88){logger[_0x8727('0xc')](_0x8727('0x22'),_0x47e9f9);logger[_0x8727('0xf')](_0x8727('0x22'),_0x47e9f9,JSON[_0x8727('0x11')](_0x1b0e88));_0x391d60(_0x1b0e88);})[_0x8727('0x16')](function(_0x396f12){logger[_0x8727('0x12')]('ShowFreshsalesAccount',_0x396f12[_0x8727('0x14')],_0x47e9f9);_0x152a53(_0x44ed83[_0x8727('0x12')](0x1f4,_0x396f12[_0x8727('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 05fcdb1..df17065 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 _0x63d4=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/fields','getFields','post'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x63d4,0x8f));var _0x463d=function(_0x4a2b2c,_0x57d7fa){_0x4a2b2c=_0x4a2b2c-0x0;var _0x4b29ea=_0x63d4[_0x4a2b2c];return _0x4b29ea;};'use strict';var multer=require('multer');var util=require(_0x463d('0x0'));var path=require(_0x463d('0x1'));var timeout=require(_0x463d('0x2'));var express=require(_0x463d('0x3'));var router=express[_0x463d('0x4')]();var fs_extra=require(_0x463d('0x5'));var auth=require(_0x463d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x463d('0x7'));var controller=require(_0x463d('0x8'));router[_0x463d('0x9')]('/',auth[_0x463d('0xa')](),controller[_0x463d('0xb')]);router[_0x463d('0x9')](_0x463d('0xc'),auth[_0x463d('0xa')](),controller[_0x463d('0xd')]);router['get'](_0x463d('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x463d('0x9')]('/:id/descriptions',auth[_0x463d('0xa')](),controller['getDescriptions']);router[_0x463d('0x9')](_0x463d('0xf'),auth[_0x463d('0xa')](),controller[_0x463d('0x10')]);router[_0x463d('0x11')]('/',auth['isAuthenticated'](),controller[_0x463d('0x12')]);router[_0x463d('0x13')](_0x463d('0xc'),auth[_0x463d('0xa')](),controller[_0x463d('0x14')]);router['delete']('/:id',auth[_0x463d('0xa')](),controller[_0x463d('0x15')]);module[_0x463d('0x16')]=router; \ No newline at end of file +var _0xaee3=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/descriptions','getDescriptions','/:id/fields','create','put','update','delete'];(function(_0x146f65,_0x5f1cba){var _0x422b41=function(_0x13ba08){while(--_0x13ba08){_0x146f65['push'](_0x146f65['shift']());}};_0x422b41(++_0x5f1cba);}(_0xaee3,0xb5));var _0x3aee=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0xaee3[_0xcba291];return _0x162274;};'use strict';var multer=require(_0x3aee('0x0'));var util=require(_0x3aee('0x1'));var path=require(_0x3aee('0x2'));var timeout=require(_0x3aee('0x3'));var express=require(_0x3aee('0x4'));var router=express[_0x3aee('0x5')]();var fs_extra=require(_0x3aee('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3aee('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x3aee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3aee('0x8')](_0x3aee('0x9'),auth[_0x3aee('0xa')](),controller[_0x3aee('0xb')]);router[_0x3aee('0x8')]('/:id/subjects',auth[_0x3aee('0xa')](),controller['getSubjects']);router[_0x3aee('0x8')](_0x3aee('0xc'),auth[_0x3aee('0xa')](),controller[_0x3aee('0xd')]);router[_0x3aee('0x8')](_0x3aee('0xe'),auth[_0x3aee('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x3aee('0xf')]);router[_0x3aee('0x10')](_0x3aee('0x9'),auth[_0x3aee('0xa')](),controller[_0x3aee('0x11')]);router[_0x3aee('0x12')](_0x3aee('0x9'),auth['isAuthenticated'](),controller[_0x3aee('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e12816b..96ef3dd 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 _0x6af1=['STRING','sequelize','exports'];(function(_0xc26da0,_0x3d1381){var _0x913d47=function(_0x39e468){while(--_0x39e468){_0xc26da0['push'](_0xc26da0['shift']());}};_0x913d47(++_0x3d1381);}(_0x6af1,0xf4));var _0x16af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6af1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x16af('0x0'));module[_0x16af('0x1')]={'name':{'type':Sequelize[_0x16af('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1914=['sequelize','exports','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1914,0x90));var _0x4191=function(_0x1183de,_0x17d5b9){_0x1183de=_0x1183de-0x0;var _0x89354e=_0x1914[_0x1183de];return _0x89354e;};'use strict';var Sequelize=require(_0x4191('0x0'));module[_0x4191('0x1')]={'name':{'type':Sequelize[_0x4191('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 711e78f..6c24519 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 _0x9b8e=['options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','destroy','getSubjects','FreshsalesField','length','order','pick','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FreshsalesConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL'];(function(_0x1c23fb,_0x450494){var _0x80acd6=function(_0x4a7674){while(--_0x4a7674){_0x1c23fb['push'](_0x1c23fb['shift']());}};_0x80acd6(++_0x450494);}(_0x9b8e,0x158));var _0xe9b8=function(_0x211b3d,_0x5c75db){_0x211b3d=_0x211b3d-0x0;var _0x2d972e=_0x9b8e[_0x211b3d];return _0x2d972e;};'use strict';var emlformat=require(_0xe9b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9b8('0x1'));var jsonpatch=require(_0xe9b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9b8('0x3'));var Mustache=require('mustache');var util=require(_0xe9b8('0x4'));var path=require(_0xe9b8('0x5'));var sox=require('sox');var csv=require(_0xe9b8('0x6'));var ejs=require(_0xe9b8('0x7'));var fs=require('fs');var fs_extra=require(_0xe9b8('0x8'));var _=require(_0xe9b8('0x9'));var squel=require(_0xe9b8('0xa'));var crypto=require(_0xe9b8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe9b8('0x6'));var querystring=require(_0xe9b8('0xc'));var Papa=require(_0xe9b8('0xd'));var Redis=require(_0xe9b8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe9b8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9b8('0x10'));var logger=require(_0xe9b8('0x11'))(_0xe9b8('0x12'));var utils=require(_0xe9b8('0x13'));var config=require(_0xe9b8('0x14'));var licenseUtil=require(_0xe9b8('0x15'));var db=require(_0xe9b8('0x16'))['db'];function respondWithStatusCode(_0x3ac945,_0x261e9b){_0x261e9b=_0x261e9b||0xcc;return function(_0x3bab83){if(_0x3bab83){return _0x3ac945[_0xe9b8('0x17')](_0x261e9b);}return _0x3ac945[_0xe9b8('0x18')](_0x261e9b)[_0xe9b8('0x19')]();};}function respondWithResult(_0x56b8c4,_0x4b0dcc){_0x4b0dcc=_0x4b0dcc||0xc8;return function(_0x568fb9){if(_0x568fb9){return _0x56b8c4['status'](_0x4b0dcc)[_0xe9b8('0x1a')](_0x568fb9);}};}function respondWithFilteredResult(_0x55de79,_0x59a70c){return function(_0xe05950){if(_0xe05950){var _0x13933a=typeof _0x59a70c[_0xe9b8('0x1b')]===_0xe9b8('0x1c')&&typeof _0x59a70c[_0xe9b8('0x1d')]===_0xe9b8('0x1c');var _0x5a58ac=_0xe05950[_0xe9b8('0x1e')];var _0xe435b0=_0x13933a?0x0:_0x59a70c[_0xe9b8('0x1b')];var _0x3e8123=_0x13933a?_0xe05950[_0xe9b8('0x1e')]:_0x59a70c[_0xe9b8('0x1b')]+_0x59a70c['limit'];var _0xd53200;if(_0x3e8123>=_0x5a58ac){_0x3e8123=_0x5a58ac;_0xd53200=0xc8;}else{_0xd53200=0xce;}_0x55de79['status'](_0xd53200);return _0x55de79[_0xe9b8('0x1f')](_0xe9b8('0x20'),_0xe435b0+'-'+_0x3e8123+'/'+_0x5a58ac)[_0xe9b8('0x1a')](_0xe05950);}return null;};}function patchUpdates(_0x5cb0b0){return function(_0x281b6c){try{jsonpatch[_0xe9b8('0x21')](_0x281b6c,_0x5cb0b0,!![]);}catch(_0xdd66f7){return BPromise[_0xe9b8('0x22')](_0xdd66f7);}return _0x281b6c[_0xe9b8('0x23')]();};}function saveUpdates(_0x542304,_0x362fb8){return function(_0x4839f7){if(_0x4839f7){return _0x4839f7[_0xe9b8('0x24')](_0x542304)[_0xe9b8('0x25')](function(_0x234040){return _0x234040;});}return null;};}function removeEntity(_0x21e313,_0x427570){return function(_0x5c905c){if(_0x5c905c){return _0x5c905c['destroy']()[_0xe9b8('0x25')](function(){_0x21e313[_0xe9b8('0x18')](0xcc)[_0xe9b8('0x19')]();});}};}function handleEntityNotFound(_0x53e0b8,_0x51c940){return function(_0x277f5a){if(!_0x277f5a){_0x53e0b8['sendStatus'](0x194);}return _0x277f5a;};}function handleError(_0xb4a844,_0x5b901c){_0x5b901c=_0x5b901c||0x1f4;return function(_0x45f2e9){logger[_0xe9b8('0x26')](_0x45f2e9[_0xe9b8('0x27')]);if(_0x45f2e9['name']){delete _0x45f2e9[_0xe9b8('0x28')];}_0xb4a844['status'](_0x5b901c)[_0xe9b8('0x29')](_0x45f2e9);};}exports['index']=function(_0x403512,_0x2aa11c){var _0x1226fa={},_0x38ba68={},_0x179c25={'count':0x0,'rows':[]};var _0xb878d1=_[_0xe9b8('0x2a')](db[_0xe9b8('0x2b')]['rawAttributes'],function(_0x19e1b4){return{'name':_0x19e1b4[_0xe9b8('0x2c')],'type':_0x19e1b4[_0xe9b8('0x2d')][_0xe9b8('0x2e')]};});_0x38ba68[_0xe9b8('0x2f')]=_['map'](_0xb878d1,_0xe9b8('0x28'));_0x38ba68[_0xe9b8('0x30')]=_[_0xe9b8('0x31')](_0x403512[_0xe9b8('0x30')]);_0x38ba68[_0xe9b8('0x32')]=_[_0xe9b8('0x33')](_0x38ba68['model'],_0x38ba68['query']);_0x1226fa['attributes']=_['intersection'](_0x38ba68[_0xe9b8('0x2f')],qs[_0xe9b8('0x34')](_0x403512[_0xe9b8('0x30')]['fields']));_0x1226fa[_0xe9b8('0x35')]=_0x1226fa['attributes']['length']?_0x1226fa[_0xe9b8('0x35')]:_0x38ba68[_0xe9b8('0x2f')];if(!_0x403512['query'][_0xe9b8('0x36')](_0xe9b8('0x37'))){_0x1226fa[_0xe9b8('0x1d')]=qs[_0xe9b8('0x1d')](_0x403512[_0xe9b8('0x30')]['limit']);_0x1226fa['offset']=qs[_0xe9b8('0x1b')](_0x403512['query'][_0xe9b8('0x1b')]);}_0x1226fa['order']=qs['sort'](_0x403512['query'][_0xe9b8('0x38')]);_0x1226fa['where']=qs[_0xe9b8('0x32')](_['pick'](_0x403512['query'],_0x38ba68['filters']),_0xb878d1);if(_0x403512[_0xe9b8('0x30')][_0xe9b8('0x39')]){_0x1226fa[_0xe9b8('0x3a')]=_[_0xe9b8('0x3b')](_0x1226fa[_0xe9b8('0x3a')],{'$or':_[_0xe9b8('0x2a')](_0xb878d1,function(_0x3e267e){if(_0x3e267e[_0xe9b8('0x2d')]!==_0xe9b8('0x3c')){var _0x489ba0={};_0x489ba0[_0x3e267e['name']]={'$like':'%'+_0x403512[_0xe9b8('0x30')]['filter']+'%'};return _0x489ba0;}})});}_0x1226fa=_[_0xe9b8('0x3b')]({},_0x1226fa,_0x403512[_0xe9b8('0x3d')]);var _0x413563={'where':_0x1226fa[_0xe9b8('0x3a')]};return db[_0xe9b8('0x2b')][_0xe9b8('0x1e')](_0x413563)[_0xe9b8('0x25')](function(_0x81be8){_0x179c25[_0xe9b8('0x1e')]=_0x81be8;if(_0x403512[_0xe9b8('0x30')]['includeAll']){_0x1226fa[_0xe9b8('0x3e')]=[{'all':!![]}];}return db[_0xe9b8('0x2b')][_0xe9b8('0x3f')](_0x1226fa);})[_0xe9b8('0x25')](function(_0x2d7a6e){_0x179c25[_0xe9b8('0x40')]=_0x2d7a6e;return _0x179c25;})['then'](respondWithFilteredResult(_0x2aa11c,_0x1226fa))['catch'](handleError(_0x2aa11c,null));};exports[_0xe9b8('0x41')]=function(_0x551939,_0x25e24e){var _0x15b4bd={'raw':![],'where':{'id':_0x551939[_0xe9b8('0x42')]['id']}},_0x2b4003={};_0x2b4003[_0xe9b8('0x2f')]=_['keys'](db[_0xe9b8('0x2b')][_0xe9b8('0x43')]);_0x2b4003['query']=_[_0xe9b8('0x31')](_0x551939[_0xe9b8('0x30')]);_0x2b4003[_0xe9b8('0x32')]=_['intersection'](_0x2b4003['model'],_0x2b4003[_0xe9b8('0x30')]);_0x15b4bd['attributes']=_[_0xe9b8('0x33')](_0x2b4003['model'],qs[_0xe9b8('0x34')](_0x551939[_0xe9b8('0x30')][_0xe9b8('0x34')]));_0x15b4bd['attributes']=_0x15b4bd[_0xe9b8('0x35')]['length']?_0x15b4bd[_0xe9b8('0x35')]:_0x2b4003['model'];if(_0x551939[_0xe9b8('0x30')][_0xe9b8('0x44')]){_0x15b4bd['include']=[{'all':!![]}];}_0x15b4bd=_[_0xe9b8('0x3b')]({},_0x15b4bd,_0x551939[_0xe9b8('0x3d')]);return db[_0xe9b8('0x2b')][_0xe9b8('0x45')](_0x15b4bd)[_0xe9b8('0x25')](handleEntityNotFound(_0x25e24e,null))[_0xe9b8('0x25')](respondWithResult(_0x25e24e,null))[_0xe9b8('0x46')](handleError(_0x25e24e,null));};exports['create']=function(_0x42955e,_0x19e27c){return db[_0xe9b8('0x2b')][_0xe9b8('0x47')](_0x42955e['body'],{})[_0xe9b8('0x25')](respondWithResult(_0x19e27c,0xc9))[_0xe9b8('0x46')](handleError(_0x19e27c,null));};exports[_0xe9b8('0x24')]=function(_0x4783df,_0x30adfc){if(_0x4783df[_0xe9b8('0x48')]['id']){delete _0x4783df['body']['id'];}return db[_0xe9b8('0x2b')]['find']({'where':{'id':_0x4783df[_0xe9b8('0x42')]['id']}})[_0xe9b8('0x25')](handleEntityNotFound(_0x30adfc,null))[_0xe9b8('0x25')](saveUpdates(_0x4783df[_0xe9b8('0x48')],null))[_0xe9b8('0x25')](respondWithResult(_0x30adfc,null))['catch'](handleError(_0x30adfc,null));};exports[_0xe9b8('0x49')]=function(_0x356acf,_0x15e6dc){return db[_0xe9b8('0x2b')]['find']({'where':{'id':_0x356acf[_0xe9b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x15e6dc,null))[_0xe9b8('0x25')](removeEntity(_0x15e6dc,null))[_0xe9b8('0x46')](handleError(_0x15e6dc,null));};exports[_0xe9b8('0x4a')]=function(_0x399d57,_0x435cab,_0x1adf58){var _0x58bbcc={};var _0x307fa8={};var _0x18997a;var _0x4d208a;return db[_0xe9b8('0x2b')]['findOne']({'where':{'id':_0x399d57[_0xe9b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x435cab,null))[_0xe9b8('0x25')](function(_0x519a1a){if(_0x519a1a){_0x18997a=_0x519a1a;_0x307fa8[_0xe9b8('0x2f')]=_[_0xe9b8('0x31')](db[_0xe9b8('0x4b')][_0xe9b8('0x43')]);_0x307fa8[_0xe9b8('0x30')]=_[_0xe9b8('0x31')](_0x399d57['query']);_0x307fa8['filters']=_[_0xe9b8('0x33')](_0x307fa8[_0xe9b8('0x2f')],_0x307fa8[_0xe9b8('0x30')]);_0x58bbcc[_0xe9b8('0x35')]=_[_0xe9b8('0x33')](_0x307fa8['model'],qs[_0xe9b8('0x34')](_0x399d57[_0xe9b8('0x30')]['fields']));_0x58bbcc[_0xe9b8('0x35')]=_0x58bbcc['attributes'][_0xe9b8('0x4c')]?_0x58bbcc[_0xe9b8('0x35')]:_0x307fa8[_0xe9b8('0x2f')];_0x58bbcc[_0xe9b8('0x4d')]=qs[_0xe9b8('0x38')](_0x399d57['query']['sort']);_0x58bbcc['where']=qs[_0xe9b8('0x32')](_[_0xe9b8('0x4e')](_0x399d57[_0xe9b8('0x30')],_0x307fa8[_0xe9b8('0x32')]));if(_0x399d57['query'][_0xe9b8('0x39')]){_0x58bbcc[_0xe9b8('0x3a')]=_[_0xe9b8('0x3b')](_0x58bbcc['where'],{'$or':_[_0xe9b8('0x2a')](_0x58bbcc[_0xe9b8('0x35')],function(_0x33bd93){var _0x133b8f={};_0x133b8f[_0x33bd93]={'$like':'%'+_0x399d57['query']['filter']+'%'};return _0x133b8f;})});}_0x58bbcc=_[_0xe9b8('0x3b')]({},_0x58bbcc,_0x399d57[_0xe9b8('0x3d')]);return _0x18997a[_0xe9b8('0x4a')](_0x58bbcc);}})[_0xe9b8('0x25')](function(_0x3578ed){if(_0x3578ed){_0x4d208a=_0x3578ed['length'];if(!_0x399d57[_0xe9b8('0x30')][_0xe9b8('0x36')](_0xe9b8('0x37'))){_0x58bbcc['limit']=qs[_0xe9b8('0x1d')](_0x399d57['query'][_0xe9b8('0x1d')]);_0x58bbcc[_0xe9b8('0x1b')]=qs[_0xe9b8('0x1b')](_0x399d57[_0xe9b8('0x30')][_0xe9b8('0x1b')]);}return _0x18997a[_0xe9b8('0x4a')](_0x58bbcc);}})['then'](function(_0x3e8fdd){if(_0x3e8fdd){return _0x3e8fdd?{'count':_0x4d208a,'rows':_0x3e8fdd}:null;}})['then'](respondWithResult(_0x435cab,null))['catch'](handleError(_0x435cab,null));};exports['getDescriptions']=function(_0x30eb24,_0x688456,_0x48041a){var _0xc8ea88={};var _0x13ccf6={};var _0x1c9b92;var _0x41edb9;return db[_0xe9b8('0x2b')]['findOne']({'where':{'id':_0x30eb24[_0xe9b8('0x42')]['id']}})[_0xe9b8('0x25')](handleEntityNotFound(_0x688456,null))[_0xe9b8('0x25')](function(_0x583536){if(_0x583536){_0x1c9b92=_0x583536;_0x13ccf6[_0xe9b8('0x2f')]=_['keys'](db[_0xe9b8('0x4b')][_0xe9b8('0x43')]);_0x13ccf6[_0xe9b8('0x30')]=_[_0xe9b8('0x31')](_0x30eb24[_0xe9b8('0x30')]);_0x13ccf6[_0xe9b8('0x32')]=_[_0xe9b8('0x33')](_0x13ccf6[_0xe9b8('0x2f')],_0x13ccf6[_0xe9b8('0x30')]);_0xc8ea88[_0xe9b8('0x35')]=_['intersection'](_0x13ccf6[_0xe9b8('0x2f')],qs[_0xe9b8('0x34')](_0x30eb24[_0xe9b8('0x30')]['fields']));_0xc8ea88[_0xe9b8('0x35')]=_0xc8ea88[_0xe9b8('0x35')][_0xe9b8('0x4c')]?_0xc8ea88[_0xe9b8('0x35')]:_0x13ccf6[_0xe9b8('0x2f')];_0xc8ea88[_0xe9b8('0x4d')]=qs[_0xe9b8('0x38')](_0x30eb24[_0xe9b8('0x30')][_0xe9b8('0x38')]);_0xc8ea88[_0xe9b8('0x3a')]=qs[_0xe9b8('0x32')](_[_0xe9b8('0x4e')](_0x30eb24[_0xe9b8('0x30')],_0x13ccf6[_0xe9b8('0x32')]));if(_0x30eb24['query'][_0xe9b8('0x39')]){_0xc8ea88['where']=_[_0xe9b8('0x3b')](_0xc8ea88[_0xe9b8('0x3a')],{'$or':_[_0xe9b8('0x2a')](_0xc8ea88[_0xe9b8('0x35')],function(_0x4006e4){var _0x19bad5={};_0x19bad5[_0x4006e4]={'$like':'%'+_0x30eb24[_0xe9b8('0x30')][_0xe9b8('0x39')]+'%'};return _0x19bad5;})});}_0xc8ea88=_[_0xe9b8('0x3b')]({},_0xc8ea88,_0x30eb24[_0xe9b8('0x3d')]);return _0x1c9b92[_0xe9b8('0x4f')](_0xc8ea88);}})['then'](function(_0x3ede60){if(_0x3ede60){_0x41edb9=_0x3ede60[_0xe9b8('0x4c')];if(!_0x30eb24[_0xe9b8('0x30')]['hasOwnProperty'](_0xe9b8('0x37'))){_0xc8ea88[_0xe9b8('0x1d')]=qs[_0xe9b8('0x1d')](_0x30eb24[_0xe9b8('0x30')][_0xe9b8('0x1d')]);_0xc8ea88[_0xe9b8('0x1b')]=qs['offset'](_0x30eb24[_0xe9b8('0x30')][_0xe9b8('0x1b')]);}return _0x1c9b92['getDescriptions'](_0xc8ea88);}})[_0xe9b8('0x25')](function(_0x24f38c){if(_0x24f38c){return _0x24f38c?{'count':_0x41edb9,'rows':_0x24f38c}:null;}})[_0xe9b8('0x25')](respondWithResult(_0x688456,null))[_0xe9b8('0x46')](handleError(_0x688456,null));};exports['getFields']=function(_0x3a7426,_0x1fb8e7,_0x2a45a9){var _0x5875a7={};var _0x348762={};var _0x18aec3;var _0x151a7c;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3a7426[_0xe9b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x1fb8e7,null))[_0xe9b8('0x25')](function(_0x49392b){if(_0x49392b){_0x18aec3=_0x49392b;_0x348762['model']=_[_0xe9b8('0x31')](db[_0xe9b8('0x4b')][_0xe9b8('0x43')]);_0x348762[_0xe9b8('0x30')]=_[_0xe9b8('0x31')](_0x3a7426[_0xe9b8('0x30')]);_0x348762['filters']=_[_0xe9b8('0x33')](_0x348762[_0xe9b8('0x2f')],_0x348762['query']);_0x5875a7[_0xe9b8('0x35')]=_[_0xe9b8('0x33')](_0x348762[_0xe9b8('0x2f')],qs[_0xe9b8('0x34')](_0x3a7426[_0xe9b8('0x30')][_0xe9b8('0x34')]));_0x5875a7[_0xe9b8('0x35')]=_0x5875a7['attributes'][_0xe9b8('0x4c')]?_0x5875a7[_0xe9b8('0x35')]:_0x348762['model'];_0x5875a7[_0xe9b8('0x4d')]=qs[_0xe9b8('0x38')](_0x3a7426['query'][_0xe9b8('0x38')]);_0x5875a7[_0xe9b8('0x3a')]=qs[_0xe9b8('0x32')](_[_0xe9b8('0x4e')](_0x3a7426[_0xe9b8('0x30')],_0x348762['filters']));if(_0x3a7426['query'][_0xe9b8('0x39')]){_0x5875a7[_0xe9b8('0x3a')]=_['merge'](_0x5875a7[_0xe9b8('0x3a')],{'$or':_[_0xe9b8('0x2a')](_0x5875a7[_0xe9b8('0x35')],function(_0x529b2c){var _0x49295f={};_0x49295f[_0x529b2c]={'$like':'%'+_0x3a7426[_0xe9b8('0x30')]['filter']+'%'};return _0x49295f;})});}_0x5875a7=_[_0xe9b8('0x3b')]({},_0x5875a7,_0x3a7426[_0xe9b8('0x3d')]);return _0x18aec3[_0xe9b8('0x50')](_0x5875a7);}})['then'](function(_0x505be6){if(_0x505be6){_0x151a7c=_0x505be6[_0xe9b8('0x4c')];if(!_0x3a7426[_0xe9b8('0x30')][_0xe9b8('0x36')](_0xe9b8('0x37'))){_0x5875a7[_0xe9b8('0x1d')]=qs[_0xe9b8('0x1d')](_0x3a7426[_0xe9b8('0x30')][_0xe9b8('0x1d')]);_0x5875a7[_0xe9b8('0x1b')]=qs[_0xe9b8('0x1b')](_0x3a7426[_0xe9b8('0x30')][_0xe9b8('0x1b')]);}return _0x18aec3[_0xe9b8('0x50')](_0x5875a7);}})[_0xe9b8('0x25')](function(_0x1e42e2){if(_0x1e42e2){return _0x1e42e2?{'count':_0x151a7c,'rows':_0x1e42e2}:null;}})[_0xe9b8('0x25')](respondWithResult(_0x1fb8e7,null))[_0xe9b8('0x46')](handleError(_0x1fb8e7,null));}; \ No newline at end of file +var _0x8354=['query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','keys','FreshsalesField','getSubjects','findOne','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','update','then','destroy','sendStatus','error','name','index','fieldName','type','model','map','filters','intersection'];(function(_0x2e5f89,_0x1de87f){var _0x3a76b5=function(_0x44c80a){while(--_0x44c80a){_0x2e5f89['push'](_0x2e5f89['shift']());}};_0x3a76b5(++_0x1de87f);}(_0x8354,0x158));var _0x4835=function(_0x5ee884,_0x32084d){_0x5ee884=_0x5ee884-0x0;var _0x583824=_0x8354[_0x5ee884];return _0x583824;};'use strict';var emlformat=require(_0x4835('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4835('0x1'));var jsonpatch=require(_0x4835('0x2'));var rp=require(_0x4835('0x3'));var moment=require(_0x4835('0x4'));var BPromise=require(_0x4835('0x5'));var Mustache=require(_0x4835('0x6'));var util=require(_0x4835('0x7'));var path=require('path');var sox=require(_0x4835('0x8'));var csv=require(_0x4835('0x9'));var ejs=require(_0x4835('0xa'));var fs=require('fs');var fs_extra=require(_0x4835('0xb'));var _=require('lodash');var squel=require(_0x4835('0xc'));var crypto=require(_0x4835('0xd'));var jsforce=require(_0x4835('0xe'));var deskjs=require(_0x4835('0xf'));var toCsv=require(_0x4835('0x9'));var querystring=require(_0x4835('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4835('0x11'));var hardwareService=require(_0x4835('0x12'));var logger=require(_0x4835('0x13'))(_0x4835('0x14'));var utils=require(_0x4835('0x15'));var config=require(_0x4835('0x16'));var licenseUtil=require(_0x4835('0x17'));var db=require(_0x4835('0x18'))['db'];function respondWithStatusCode(_0x203be3,_0x4697ee){_0x4697ee=_0x4697ee||0xcc;return function(_0x4ee59b){if(_0x4ee59b){return _0x203be3['sendStatus'](_0x4697ee);}return _0x203be3[_0x4835('0x19')](_0x4697ee)[_0x4835('0x1a')]();};}function respondWithResult(_0x16e09c,_0x4cdf1d){_0x4cdf1d=_0x4cdf1d||0xc8;return function(_0x542fa6){if(_0x542fa6){return _0x16e09c[_0x4835('0x19')](_0x4cdf1d)[_0x4835('0x1b')](_0x542fa6);}};}function respondWithFilteredResult(_0x18a060,_0x3705e4){return function(_0xf0cba0){if(_0xf0cba0){var _0x2aaf06=typeof _0x3705e4[_0x4835('0x1c')]===_0x4835('0x1d')&&typeof _0x3705e4['limit']===_0x4835('0x1d');var _0x2cb010=_0xf0cba0[_0x4835('0x1e')];var _0xf71999=_0x2aaf06?0x0:_0x3705e4[_0x4835('0x1c')];var _0x512d0a=_0x2aaf06?_0xf0cba0[_0x4835('0x1e')]:_0x3705e4[_0x4835('0x1c')]+_0x3705e4['limit'];var _0x2936f0;if(_0x512d0a>=_0x2cb010){_0x512d0a=_0x2cb010;_0x2936f0=0xc8;}else{_0x2936f0=0xce;}_0x18a060[_0x4835('0x19')](_0x2936f0);return _0x18a060[_0x4835('0x1f')]('Content-Range',_0xf71999+'-'+_0x512d0a+'/'+_0x2cb010)[_0x4835('0x1b')](_0xf0cba0);}return null;};}function patchUpdates(_0x288f9b){return function(_0x574366){try{jsonpatch[_0x4835('0x20')](_0x574366,_0x288f9b,!![]);}catch(_0x31acd9){return BPromise['reject'](_0x31acd9);}return _0x574366['save']();};}function saveUpdates(_0x257263,_0xbf665){return function(_0x1b3ca0){if(_0x1b3ca0){return _0x1b3ca0[_0x4835('0x21')](_0x257263)[_0x4835('0x22')](function(_0x1f975c){return _0x1f975c;});}return null;};}function removeEntity(_0x5a8e29,_0x4d5d41){return function(_0x3c0512){if(_0x3c0512){return _0x3c0512[_0x4835('0x23')]()[_0x4835('0x22')](function(){_0x5a8e29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7afe,_0x2a4176){return function(_0x7ce872){if(!_0x7ce872){_0x4f7afe[_0x4835('0x24')](0x194);}return _0x7ce872;};}function handleError(_0x12b29b,_0x1f4f37){_0x1f4f37=_0x1f4f37||0x1f4;return function(_0x28e240){logger[_0x4835('0x25')](_0x28e240['stack']);if(_0x28e240[_0x4835('0x26')]){delete _0x28e240[_0x4835('0x26')];}_0x12b29b[_0x4835('0x19')](_0x1f4f37)['send'](_0x28e240);};}exports[_0x4835('0x27')]=function(_0xb369e3,_0x3c8292){var _0x3c7ed4={},_0x4685bc={},_0x143f4d={'count':0x0,'rows':[]};var _0x13bb6d=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x34f4e6){return{'name':_0x34f4e6[_0x4835('0x28')],'type':_0x34f4e6[_0x4835('0x29')]['key']};});_0x4685bc[_0x4835('0x2a')]=_[_0x4835('0x2b')](_0x13bb6d,_0x4835('0x26'));_0x4685bc['query']=_['keys'](_0xb369e3['query']);_0x4685bc[_0x4835('0x2c')]=_[_0x4835('0x2d')](_0x4685bc[_0x4835('0x2a')],_0x4685bc[_0x4835('0x2e')]);_0x3c7ed4[_0x4835('0x2f')]=_['intersection'](_0x4685bc[_0x4835('0x2a')],qs[_0x4835('0x30')](_0xb369e3['query'][_0x4835('0x30')]));_0x3c7ed4[_0x4835('0x2f')]=_0x3c7ed4[_0x4835('0x2f')][_0x4835('0x31')]?_0x3c7ed4[_0x4835('0x2f')]:_0x4685bc[_0x4835('0x2a')];if(!_0xb369e3[_0x4835('0x2e')][_0x4835('0x32')](_0x4835('0x33'))){_0x3c7ed4[_0x4835('0x34')]=qs[_0x4835('0x34')](_0xb369e3[_0x4835('0x2e')][_0x4835('0x34')]);_0x3c7ed4['offset']=qs[_0x4835('0x1c')](_0xb369e3[_0x4835('0x2e')]['offset']);}_0x3c7ed4[_0x4835('0x35')]=qs[_0x4835('0x36')](_0xb369e3[_0x4835('0x2e')][_0x4835('0x36')]);_0x3c7ed4['where']=qs[_0x4835('0x2c')](_[_0x4835('0x37')](_0xb369e3[_0x4835('0x2e')],_0x4685bc[_0x4835('0x2c')]),_0x13bb6d);if(_0xb369e3[_0x4835('0x2e')]['filter']){_0x3c7ed4[_0x4835('0x38')]=_['merge'](_0x3c7ed4['where'],{'$or':_[_0x4835('0x2b')](_0x13bb6d,function(_0x2df5dd){if(_0x2df5dd['type']!==_0x4835('0x39')){var _0x56d6bb={};_0x56d6bb[_0x2df5dd[_0x4835('0x26')]]={'$like':'%'+_0xb369e3[_0x4835('0x2e')][_0x4835('0x3a')]+'%'};return _0x56d6bb;}})});}_0x3c7ed4=_[_0x4835('0x3b')]({},_0x3c7ed4,_0xb369e3[_0x4835('0x3c')]);var _0x4e2d6f={'where':_0x3c7ed4[_0x4835('0x38')]};return db[_0x4835('0x3d')][_0x4835('0x1e')](_0x4e2d6f)[_0x4835('0x22')](function(_0x3440cb){_0x143f4d[_0x4835('0x1e')]=_0x3440cb;if(_0xb369e3['query']['includeAll']){_0x3c7ed4[_0x4835('0x3e')]=[{'all':!![]}];}return db[_0x4835('0x3d')][_0x4835('0x3f')](_0x3c7ed4);})[_0x4835('0x22')](function(_0x31d64d){_0x143f4d[_0x4835('0x40')]=_0x31d64d;return _0x143f4d;})['then'](respondWithFilteredResult(_0x3c8292,_0x3c7ed4))[_0x4835('0x41')](handleError(_0x3c8292,null));};exports[_0x4835('0x42')]=function(_0x2ecd7d,_0x38a3c6){var _0x43be0e={'raw':![],'where':{'id':_0x2ecd7d[_0x4835('0x43')]['id']}},_0x3a1b2b={};_0x3a1b2b[_0x4835('0x2a')]=_['keys'](db[_0x4835('0x3d')][_0x4835('0x44')]);_0x3a1b2b[_0x4835('0x2e')]=_['keys'](_0x2ecd7d[_0x4835('0x2e')]);_0x3a1b2b[_0x4835('0x2c')]=_[_0x4835('0x2d')](_0x3a1b2b['model'],_0x3a1b2b['query']);_0x43be0e[_0x4835('0x2f')]=_[_0x4835('0x2d')](_0x3a1b2b[_0x4835('0x2a')],qs[_0x4835('0x30')](_0x2ecd7d[_0x4835('0x2e')]['fields']));_0x43be0e['attributes']=_0x43be0e[_0x4835('0x2f')][_0x4835('0x31')]?_0x43be0e[_0x4835('0x2f')]:_0x3a1b2b['model'];if(_0x2ecd7d[_0x4835('0x2e')]['includeAll']){_0x43be0e[_0x4835('0x3e')]=[{'all':!![]}];}_0x43be0e=_[_0x4835('0x3b')]({},_0x43be0e,_0x2ecd7d[_0x4835('0x3c')]);return db[_0x4835('0x3d')][_0x4835('0x45')](_0x43be0e)[_0x4835('0x22')](handleEntityNotFound(_0x38a3c6,null))['then'](respondWithResult(_0x38a3c6,null))[_0x4835('0x41')](handleError(_0x38a3c6,null));};exports[_0x4835('0x46')]=function(_0x4fb4d5,_0x318a5e){return db[_0x4835('0x3d')][_0x4835('0x46')](_0x4fb4d5[_0x4835('0x47')],{})[_0x4835('0x22')](respondWithResult(_0x318a5e,0xc9))[_0x4835('0x41')](handleError(_0x318a5e,null));};exports['update']=function(_0x4f5c0c,_0xa5f41c){if(_0x4f5c0c[_0x4835('0x47')]['id']){delete _0x4f5c0c[_0x4835('0x47')]['id'];}return db[_0x4835('0x3d')][_0x4835('0x45')]({'where':{'id':_0x4f5c0c[_0x4835('0x43')]['id']}})['then'](handleEntityNotFound(_0xa5f41c,null))[_0x4835('0x22')](saveUpdates(_0x4f5c0c[_0x4835('0x47')],null))[_0x4835('0x22')](respondWithResult(_0xa5f41c,null))[_0x4835('0x41')](handleError(_0xa5f41c,null));};exports[_0x4835('0x23')]=function(_0x499d8e,_0x5621e8){return db[_0x4835('0x3d')][_0x4835('0x45')]({'where':{'id':_0x499d8e['params']['id']}})['then'](handleEntityNotFound(_0x5621e8,null))[_0x4835('0x22')](removeEntity(_0x5621e8,null))[_0x4835('0x41')](handleError(_0x5621e8,null));};exports['getSubjects']=function(_0x450eca,_0x2a82fa,_0x329a8e){var _0x4fffe9={};var _0x4988d4={};var _0x3f295e;var _0x309351;return db[_0x4835('0x3d')]['findOne']({'where':{'id':_0x450eca[_0x4835('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a82fa,null))[_0x4835('0x22')](function(_0x394a0e){if(_0x394a0e){_0x3f295e=_0x394a0e;_0x4988d4[_0x4835('0x2a')]=_[_0x4835('0x48')](db[_0x4835('0x49')][_0x4835('0x44')]);_0x4988d4['query']=_['keys'](_0x450eca[_0x4835('0x2e')]);_0x4988d4['filters']=_[_0x4835('0x2d')](_0x4988d4['model'],_0x4988d4[_0x4835('0x2e')]);_0x4fffe9[_0x4835('0x2f')]=_['intersection'](_0x4988d4[_0x4835('0x2a')],qs[_0x4835('0x30')](_0x450eca[_0x4835('0x2e')][_0x4835('0x30')]));_0x4fffe9[_0x4835('0x2f')]=_0x4fffe9[_0x4835('0x2f')][_0x4835('0x31')]?_0x4fffe9[_0x4835('0x2f')]:_0x4988d4[_0x4835('0x2a')];_0x4fffe9['order']=qs[_0x4835('0x36')](_0x450eca['query']['sort']);_0x4fffe9[_0x4835('0x38')]=qs['filters'](_['pick'](_0x450eca[_0x4835('0x2e')],_0x4988d4['filters']));if(_0x450eca[_0x4835('0x2e')]['filter']){_0x4fffe9['where']=_[_0x4835('0x3b')](_0x4fffe9[_0x4835('0x38')],{'$or':_[_0x4835('0x2b')](_0x4fffe9[_0x4835('0x2f')],function(_0x75e421){var _0xa68909={};_0xa68909[_0x75e421]={'$like':'%'+_0x450eca[_0x4835('0x2e')][_0x4835('0x3a')]+'%'};return _0xa68909;})});}_0x4fffe9=_[_0x4835('0x3b')]({},_0x4fffe9,_0x450eca[_0x4835('0x3c')]);return _0x3f295e['getSubjects'](_0x4fffe9);}})[_0x4835('0x22')](function(_0x254f40){if(_0x254f40){_0x309351=_0x254f40['length'];if(!_0x450eca[_0x4835('0x2e')][_0x4835('0x32')]('nolimit')){_0x4fffe9[_0x4835('0x34')]=qs[_0x4835('0x34')](_0x450eca[_0x4835('0x2e')][_0x4835('0x34')]);_0x4fffe9['offset']=qs[_0x4835('0x1c')](_0x450eca[_0x4835('0x2e')][_0x4835('0x1c')]);}return _0x3f295e[_0x4835('0x4a')](_0x4fffe9);}})['then'](function(_0x1a6615){if(_0x1a6615){return _0x1a6615?{'count':_0x309351,'rows':_0x1a6615}:null;}})[_0x4835('0x22')](respondWithResult(_0x2a82fa,null))[_0x4835('0x41')](handleError(_0x2a82fa,null));};exports['getDescriptions']=function(_0x3ed1de,_0x35c5c9,_0x222087){var _0x597a24={};var _0x36b1ce={};var _0xd5b413;var _0x18a1a1;return db[_0x4835('0x3d')][_0x4835('0x4b')]({'where':{'id':_0x3ed1de[_0x4835('0x43')]['id']}})[_0x4835('0x22')](handleEntityNotFound(_0x35c5c9,null))[_0x4835('0x22')](function(_0xd58c29){if(_0xd58c29){_0xd5b413=_0xd58c29;_0x36b1ce[_0x4835('0x2a')]=_['keys'](db[_0x4835('0x49')]['rawAttributes']);_0x36b1ce['query']=_[_0x4835('0x48')](_0x3ed1de[_0x4835('0x2e')]);_0x36b1ce[_0x4835('0x2c')]=_['intersection'](_0x36b1ce[_0x4835('0x2a')],_0x36b1ce[_0x4835('0x2e')]);_0x597a24[_0x4835('0x2f')]=_[_0x4835('0x2d')](_0x36b1ce[_0x4835('0x2a')],qs[_0x4835('0x30')](_0x3ed1de[_0x4835('0x2e')][_0x4835('0x30')]));_0x597a24[_0x4835('0x2f')]=_0x597a24['attributes'][_0x4835('0x31')]?_0x597a24['attributes']:_0x36b1ce[_0x4835('0x2a')];_0x597a24['order']=qs[_0x4835('0x36')](_0x3ed1de[_0x4835('0x2e')]['sort']);_0x597a24[_0x4835('0x38')]=qs[_0x4835('0x2c')](_['pick'](_0x3ed1de[_0x4835('0x2e')],_0x36b1ce[_0x4835('0x2c')]));if(_0x3ed1de[_0x4835('0x2e')][_0x4835('0x3a')]){_0x597a24[_0x4835('0x38')]=_['merge'](_0x597a24[_0x4835('0x38')],{'$or':_['map'](_0x597a24[_0x4835('0x2f')],function(_0x30f5bc){var _0x4a1b85={};_0x4a1b85[_0x30f5bc]={'$like':'%'+_0x3ed1de['query']['filter']+'%'};return _0x4a1b85;})});}_0x597a24=_[_0x4835('0x3b')]({},_0x597a24,_0x3ed1de[_0x4835('0x3c')]);return _0xd5b413[_0x4835('0x4c')](_0x597a24);}})['then'](function(_0x3f0dc3){if(_0x3f0dc3){_0x18a1a1=_0x3f0dc3['length'];if(!_0x3ed1de['query'][_0x4835('0x32')](_0x4835('0x33'))){_0x597a24['limit']=qs['limit'](_0x3ed1de[_0x4835('0x2e')][_0x4835('0x34')]);_0x597a24[_0x4835('0x1c')]=qs[_0x4835('0x1c')](_0x3ed1de[_0x4835('0x2e')][_0x4835('0x1c')]);}return _0xd5b413[_0x4835('0x4c')](_0x597a24);}})[_0x4835('0x22')](function(_0xe6273d){if(_0xe6273d){return _0xe6273d?{'count':_0x18a1a1,'rows':_0xe6273d}:null;}})['then'](respondWithResult(_0x35c5c9,null))[_0x4835('0x41')](handleError(_0x35c5c9,null));};exports[_0x4835('0x4d')]=function(_0x244d33,_0x4f1a02,_0x4389ba){var _0x15cc54={};var _0x280258={};var _0xe25532;var _0x625f1d;return db[_0x4835('0x3d')][_0x4835('0x4b')]({'where':{'id':_0x244d33[_0x4835('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f1a02,null))[_0x4835('0x22')](function(_0x4684fa){if(_0x4684fa){_0xe25532=_0x4684fa;_0x280258[_0x4835('0x2a')]=_[_0x4835('0x48')](db['FreshsalesField']['rawAttributes']);_0x280258[_0x4835('0x2e')]=_[_0x4835('0x48')](_0x244d33['query']);_0x280258['filters']=_[_0x4835('0x2d')](_0x280258['model'],_0x280258['query']);_0x15cc54[_0x4835('0x2f')]=_['intersection'](_0x280258[_0x4835('0x2a')],qs[_0x4835('0x30')](_0x244d33[_0x4835('0x2e')][_0x4835('0x30')]));_0x15cc54[_0x4835('0x2f')]=_0x15cc54['attributes'][_0x4835('0x31')]?_0x15cc54[_0x4835('0x2f')]:_0x280258['model'];_0x15cc54[_0x4835('0x35')]=qs[_0x4835('0x36')](_0x244d33[_0x4835('0x2e')][_0x4835('0x36')]);_0x15cc54[_0x4835('0x38')]=qs[_0x4835('0x2c')](_[_0x4835('0x37')](_0x244d33[_0x4835('0x2e')],_0x280258[_0x4835('0x2c')]));if(_0x244d33[_0x4835('0x2e')][_0x4835('0x3a')]){_0x15cc54[_0x4835('0x38')]=_[_0x4835('0x3b')](_0x15cc54[_0x4835('0x38')],{'$or':_[_0x4835('0x2b')](_0x15cc54[_0x4835('0x2f')],function(_0x486d59){var _0x36df25={};_0x36df25[_0x486d59]={'$like':'%'+_0x244d33[_0x4835('0x2e')][_0x4835('0x3a')]+'%'};return _0x36df25;})});}_0x15cc54=_[_0x4835('0x3b')]({},_0x15cc54,_0x244d33[_0x4835('0x3c')]);return _0xe25532['getFields'](_0x15cc54);}})[_0x4835('0x22')](function(_0x4bcd42){if(_0x4bcd42){_0x625f1d=_0x4bcd42[_0x4835('0x31')];if(!_0x244d33['query'][_0x4835('0x32')](_0x4835('0x33'))){_0x15cc54[_0x4835('0x34')]=qs[_0x4835('0x34')](_0x244d33[_0x4835('0x2e')]['limit']);_0x15cc54[_0x4835('0x1c')]=qs[_0x4835('0x1c')](_0x244d33[_0x4835('0x2e')][_0x4835('0x1c')]);}return _0xe25532['getFields'](_0x15cc54);}})[_0x4835('0x22')](function(_0x4d1437){if(_0x4d1437){return _0x4d1437?{'count':_0x625f1d,'rows':_0x4d1437}:null;}})[_0x4835('0x22')](respondWithResult(_0x4f1a02,null))[_0x4835('0x41')](handleError(_0x4f1a02,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index afbaea9..e7aad1f 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 _0x8686=['../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8686,0x1b5));var _0x6868=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x8686[_0x22b8a3];return _0x199a0c;};'use strict';var _=require('lodash');var util=require(_0x6868('0x0'));var logger=require('../../config/logger')(_0x6868('0x1'));var moment=require(_0x6868('0x2'));var BPromise=require(_0x6868('0x3'));var rp=require(_0x6868('0x4'));var fs=require('fs');var path=require(_0x6868('0x5'));var rimraf=require(_0x6868('0x6'));var config=require(_0x6868('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x6868('0x8')]=function(_0x294465,_0xbed206){return _0x294465[_0x6868('0x9')](_0x6868('0xa'),attributes,{'tableName':_0x6868('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd96c=['api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','util','../../config/logger'];(function(_0x500775,_0x9ae86c){var _0x58d3dc=function(_0x236166){while(--_0x236166){_0x500775['push'](_0x500775['shift']());}};_0x58d3dc(++_0x9ae86c);}(_0xd96c,0x1a0));var _0xcd96=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0xd96c[_0x2af3e1];return _0xfa27d;};'use strict';var _=require('lodash');var util=require(_0xcd96('0x0'));var logger=require(_0xcd96('0x1'))(_0xcd96('0x2'));var moment=require(_0xcd96('0x3'));var BPromise=require(_0xcd96('0x4'));var rp=require(_0xcd96('0x5'));var fs=require('fs');var path=require(_0xcd96('0x6'));var rimraf=require(_0xcd96('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd96('0x8'));module[_0xcd96('0x9')]=function(_0xf2675d,_0xc576b6){return _0xf2675d['define'](_0xcd96('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 25600cc..1c9369c 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 _0xeb7c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x40da2b,_0x4c8c73){var _0x122eb5=function(_0x2fc5f3){while(--_0x2fc5f3){_0x40da2b['push'](_0x40da2b['shift']());}};_0x122eb5(++_0x4c8c73);}(_0xeb7c,0x105));var _0xceb7=function(_0xc34977,_0x1c195e){_0xc34977=_0xc34977-0x0;var _0x1ca801=_0xeb7c[_0xc34977];return _0x1ca801;};'use strict';var _=require(_0xceb7('0x0'));var util=require(_0xceb7('0x1'));var moment=require(_0xceb7('0x2'));var BPromise=require(_0xceb7('0x3'));var rs=require(_0xceb7('0x4'));var fs=require('fs');var Redis=require(_0xceb7('0x5'));var db=require(_0xceb7('0x6'))['db'];var utils=require(_0xceb7('0x7'));var logger=require(_0xceb7('0x8'))(_0xceb7('0x9'));var config=require(_0xceb7('0xa'));var jayson=require(_0xceb7('0xb'));var client=jayson[_0xceb7('0xc')][_0xceb7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x54d8b8,_0x58a9f0,_0x2ac1fa){return new BPromise(function(_0x23529d,_0x20d6a0){return client[_0xceb7('0xe')](_0x54d8b8,_0x2ac1fa)['then'](function(_0x312761){logger[_0xceb7('0xf')](_0xceb7('0x10'),_0x58a9f0,'request\x20sent');logger[_0xceb7('0x11')](_0xceb7('0x12'),_0x58a9f0,_0xceb7('0x13'),JSON[_0xceb7('0x14')](_0x312761));if(_0x312761[_0xceb7('0x15')]){if(_0x312761['error'][_0xceb7('0x16')]===0x1f4){logger[_0xceb7('0x15')](_0xceb7('0x10'),_0x58a9f0,_0x312761[_0xceb7('0x15')][_0xceb7('0x17')]);return _0x20d6a0(_0x312761['error']['message']);}logger['error'](_0xceb7('0x10'),_0x58a9f0,_0x312761[_0xceb7('0x15')]['message']);return _0x23529d(_0x312761[_0xceb7('0x15')][_0xceb7('0x17')]);}else{logger[_0xceb7('0xf')](_0xceb7('0x10'),_0x58a9f0,'request\x20sent');_0x23529d(_0x312761[_0xceb7('0x18')][_0xceb7('0x17')]);}})[_0xceb7('0x19')](function(_0x573fb7){logger[_0xceb7('0x15')](_0xceb7('0x10'),_0x58a9f0,_0x573fb7);_0x20d6a0(_0x573fb7);});});} \ No newline at end of file +var _0x7a77=['stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x20b6e2,_0x1105f2){var _0x1e6dde=function(_0x47aa91){while(--_0x47aa91){_0x20b6e2['push'](_0x20b6e2['shift']());}};_0x1e6dde(++_0x1105f2);}(_0x7a77,0xd6));var _0x77a7=function(_0xf57103,_0x29f1d7){_0xf57103=_0xf57103-0x0;var _0x425052=_0x7a77[_0xf57103];return _0x425052;};'use strict';var _=require(_0x77a7('0x0'));var util=require(_0x77a7('0x1'));var moment=require(_0x77a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77a7('0x3'));var db=require(_0x77a7('0x4'))['db'];var utils=require(_0x77a7('0x5'));var logger=require(_0x77a7('0x6'))(_0x77a7('0x7'));var config=require('../../config/environment');var jayson=require(_0x77a7('0x8'));var client=jayson[_0x77a7('0x9')][_0x77a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x310ea5,_0x277a9f,_0x478efe){return new BPromise(function(_0x328305,_0x37906a){return client[_0x77a7('0xb')](_0x310ea5,_0x478efe)['then'](function(_0x2aca5f){logger[_0x77a7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x277a9f,_0x77a7('0xd'));logger[_0x77a7('0xe')](_0x77a7('0xf'),_0x277a9f,_0x77a7('0xd'),JSON[_0x77a7('0x10')](_0x2aca5f));if(_0x2aca5f[_0x77a7('0x11')]){if(_0x2aca5f[_0x77a7('0x11')][_0x77a7('0x12')]===0x1f4){logger['error'](_0x77a7('0x13'),_0x277a9f,_0x2aca5f[_0x77a7('0x11')]['message']);return _0x37906a(_0x2aca5f[_0x77a7('0x11')][_0x77a7('0x14')]);}logger[_0x77a7('0x11')](_0x77a7('0x13'),_0x277a9f,_0x2aca5f[_0x77a7('0x11')][_0x77a7('0x14')]);return _0x328305(_0x2aca5f[_0x77a7('0x11')][_0x77a7('0x14')]);}else{logger['info'](_0x77a7('0x13'),_0x277a9f,_0x77a7('0xd'));_0x328305(_0x2aca5f[_0x77a7('0x15')][_0x77a7('0x14')]);}})[_0x77a7('0x16')](function(_0xb1894b){logger[_0x77a7('0x11')](_0x77a7('0x13'),_0x277a9f,_0xb1894b);_0x37906a(_0xb1894b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e51f696..20e772d 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 _0x97a2=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','destroy'];(function(_0x1d6ed5,_0x299372){var _0x10bebf=function(_0x6f85a9){while(--_0x6f85a9){_0x1d6ed5['push'](_0x1d6ed5['shift']());}};_0x10bebf(++_0x299372);}(_0x97a2,0x1b1));var _0x297a=function(_0x34660e,_0x16f7fe){_0x34660e=_0x34660e-0x0;var _0x561cde=_0x97a2[_0x34660e];return _0x561cde;};'use strict';var multer=require(_0x297a('0x0'));var util=require('util');var path=require(_0x297a('0x1'));var timeout=require(_0x297a('0x2'));var express=require(_0x297a('0x3'));var router=express[_0x297a('0x4')]();var fs_extra=require(_0x297a('0x5'));var auth=require(_0x297a('0x6'));var interaction=require(_0x297a('0x7'));var config=require(_0x297a('0x8'));var controller=require('./intFreshsalesField.controller');router[_0x297a('0x9')]('/',auth[_0x297a('0xa')](),controller[_0x297a('0xb')]);router[_0x297a('0x9')](_0x297a('0xc'),auth[_0x297a('0xa')](),controller['show']);router[_0x297a('0xd')]('/',auth[_0x297a('0xa')](),controller[_0x297a('0xe')]);router[_0x297a('0xf')](_0x297a('0xc'),auth[_0x297a('0xa')](),controller['update']);router['delete']('/:id',auth[_0x297a('0xa')](),controller[_0x297a('0x10')]);module[_0x297a('0x11')]=router; \ No newline at end of file +var _0xc68d=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','post','put','/:id','update','destroy','exports'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xc68d,0x17a));var _0xdc68=function(_0x279b9a,_0x382dea){_0x279b9a=_0x279b9a-0x0;var _0x2049c0=_0xc68d[_0x279b9a];return _0x2049c0;};'use strict';var multer=require('multer');var util=require(_0xdc68('0x0'));var path=require(_0xdc68('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdc68('0x2')]();var fs_extra=require(_0xdc68('0x3'));var auth=require(_0xdc68('0x4'));var interaction=require(_0xdc68('0x5'));var config=require(_0xdc68('0x6'));var controller=require(_0xdc68('0x7'));router['get']('/',auth[_0xdc68('0x8')](),controller[_0xdc68('0x9')]);router[_0xdc68('0xa')]('/:id',auth[_0xdc68('0x8')](),controller[_0xdc68('0xb')]);router[_0xdc68('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdc68('0xd')](_0xdc68('0xe'),auth[_0xdc68('0x8')](),controller[_0xdc68('0xf')]);router['delete'](_0xdc68('0xe'),auth[_0xdc68('0x8')](),controller[_0xdc68('0x10')]);module[_0xdc68('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a24d753..88490b0 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 _0x0f57=['ENUM','variable','customVariable','sequelize','exports','string','keyValue','picklist','STRING'];(function(_0x437934,_0xd86c48){var _0x2cd45e=function(_0x2a7c00){while(--_0x2a7c00){_0x437934['push'](_0x437934['shift']());}};_0x2cd45e(++_0xd86c48);}(_0x0f57,0x78));var _0x70f5=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x0f57[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x70f5('0x0'));module[_0x70f5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x70f5('0x2'),'variable','customVariable',_0x70f5('0x3'),_0x70f5('0x4')),'defaultValue':_0x70f5('0x2')},'content':{'type':Sequelize[_0x70f5('0x5')]},'key':{'type':Sequelize[_0x70f5('0x5')]},'keyType':{'type':Sequelize[_0x70f5('0x6')](_0x70f5('0x2'),_0x70f5('0x7'),_0x70f5('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x70f5('0x5')]},'nameField':{'type':Sequelize[_0x70f5('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x70f5('0x5')]}}; \ No newline at end of file +var _0xcac8=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xcac8,0xbc));var _0x8cac=function(_0x599039,_0x2f0e71){_0x599039=_0x599039-0x0;var _0x4bb619=_0xcac8[_0x599039];return _0x4bb619;};'use strict';var Sequelize=require(_0x8cac('0x0'));module[_0x8cac('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8cac('0x2'),_0x8cac('0x3'),_0x8cac('0x4'),_0x8cac('0x5'),_0x8cac('0x6')),'defaultValue':_0x8cac('0x2')},'content':{'type':Sequelize[_0x8cac('0x7')]},'key':{'type':Sequelize[_0x8cac('0x7')]},'keyType':{'type':Sequelize[_0x8cac('0x8')](_0x8cac('0x2'),_0x8cac('0x3'),_0x8cac('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8cac('0x7')]},'nameField':{'type':Sequelize[_0x8cac('0x7')]},'customField':{'type':Sequelize[_0x8cac('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8cac('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 0c4527f..9ff9146 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 _0xb866=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','params','zip-dir','fast-json-patch','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','then','end','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5e2561,_0x279f18){var _0x2730ac=function(_0x53bd16){while(--_0x53bd16){_0x5e2561['push'](_0x5e2561['shift']());}};_0x2730ac(++_0x279f18);}(_0xb866,0x93));var _0x6b86=function(_0x4f8a1d,_0x3acbe8){_0x4f8a1d=_0x4f8a1d-0x0;var _0x221f23=_0xb866[_0x4f8a1d];return _0x221f23;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6b86('0x0'));var jsonpatch=require(_0x6b86('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6b86('0x2'));var csv=require(_0x6b86('0x3'));var ejs=require(_0x6b86('0x4'));var fs=require('fs');var fs_extra=require(_0x6b86('0x5'));var _=require(_0x6b86('0x6'));var squel=require(_0x6b86('0x7'));var crypto=require(_0x6b86('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6b86('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b86('0xa'));var Redis=require(_0x6b86('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6b86('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b86('0xd'))(_0x6b86('0xe'));var utils=require(_0x6b86('0xf'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6b86('0x10'))['db'];function respondWithStatusCode(_0x3ee9c1,_0x49ade5){_0x49ade5=_0x49ade5||0xcc;return function(_0x618de){if(_0x618de){return _0x3ee9c1['sendStatus'](_0x49ade5);}return _0x3ee9c1['status'](_0x49ade5)['end']();};}function respondWithResult(_0x444f06,_0x2a0f84){_0x2a0f84=_0x2a0f84||0xc8;return function(_0x44e4f0){if(_0x44e4f0){return _0x444f06[_0x6b86('0x11')](_0x2a0f84)['json'](_0x44e4f0);}};}function respondWithFilteredResult(_0x4bdc50,_0x48a268){return function(_0x387c1a){if(_0x387c1a){var _0x36b095=typeof _0x48a268[_0x6b86('0x12')]===_0x6b86('0x13')&&typeof _0x48a268[_0x6b86('0x14')]===_0x6b86('0x13');var _0x1a248e=_0x387c1a[_0x6b86('0x15')];var _0x59bac0=_0x36b095?0x0:_0x48a268[_0x6b86('0x12')];var _0x41d6da=_0x36b095?_0x387c1a[_0x6b86('0x15')]:_0x48a268['offset']+_0x48a268[_0x6b86('0x14')];var _0x41e17f;if(_0x41d6da>=_0x1a248e){_0x41d6da=_0x1a248e;_0x41e17f=0xc8;}else{_0x41e17f=0xce;}_0x4bdc50['status'](_0x41e17f);return _0x4bdc50[_0x6b86('0x16')](_0x6b86('0x17'),_0x59bac0+'-'+_0x41d6da+'/'+_0x1a248e)[_0x6b86('0x18')](_0x387c1a);}return null;};}function patchUpdates(_0x5a3363){return function(_0x3e050a){try{jsonpatch['apply'](_0x3e050a,_0x5a3363,!![]);}catch(_0x11718a){return BPromise[_0x6b86('0x19')](_0x11718a);}return _0x3e050a['save']();};}function saveUpdates(_0x415662,_0x515af0){return function(_0x2eb1dd){if(_0x2eb1dd){return _0x2eb1dd[_0x6b86('0x1a')](_0x415662)['then'](function(_0x1a4ebb){return _0x1a4ebb;});}return null;};}function removeEntity(_0x38f9ff,_0x274978){return function(_0x35f41a){if(_0x35f41a){return _0x35f41a[_0x6b86('0x1b')]()[_0x6b86('0x1c')](function(){_0x38f9ff[_0x6b86('0x11')](0xcc)[_0x6b86('0x1d')]();});}};}function handleEntityNotFound(_0x32edec,_0x277dcc){return function(_0x4d440){if(!_0x4d440){_0x32edec['sendStatus'](0x194);}return _0x4d440;};}function handleError(_0x3bafa4,_0x4c75c1){_0x4c75c1=_0x4c75c1||0x1f4;return function(_0x5e7bdf){logger[_0x6b86('0x1e')](_0x5e7bdf[_0x6b86('0x1f')]);if(_0x5e7bdf[_0x6b86('0x20')]){delete _0x5e7bdf[_0x6b86('0x20')];}_0x3bafa4[_0x6b86('0x11')](_0x4c75c1)[_0x6b86('0x21')](_0x5e7bdf);};}exports['index']=function(_0x45584f,_0xfc44b1){var _0x396eb4={},_0x2dad3c={},_0x3683f={'count':0x0,'rows':[]};var _0x1df46d=_[_0x6b86('0x22')](db[_0x6b86('0x23')][_0x6b86('0x24')],function(_0x4e369c){return{'name':_0x4e369c[_0x6b86('0x25')],'type':_0x4e369c[_0x6b86('0x26')][_0x6b86('0x27')]};});_0x2dad3c[_0x6b86('0x28')]=_['map'](_0x1df46d,'name');_0x2dad3c['query']=_['keys'](_0x45584f['query']);_0x2dad3c[_0x6b86('0x29')]=_[_0x6b86('0x2a')](_0x2dad3c['model'],_0x2dad3c['query']);_0x396eb4['attributes']=_['intersection'](_0x2dad3c[_0x6b86('0x28')],qs['fields'](_0x45584f[_0x6b86('0x2b')][_0x6b86('0x2c')]));_0x396eb4[_0x6b86('0x2d')]=_0x396eb4[_0x6b86('0x2d')][_0x6b86('0x2e')]?_0x396eb4[_0x6b86('0x2d')]:_0x2dad3c['model'];if(!_0x45584f[_0x6b86('0x2b')][_0x6b86('0x2f')](_0x6b86('0x30'))){_0x396eb4[_0x6b86('0x14')]=qs[_0x6b86('0x14')](_0x45584f['query']['limit']);_0x396eb4['offset']=qs['offset'](_0x45584f['query']['offset']);}_0x396eb4['order']=qs[_0x6b86('0x31')](_0x45584f[_0x6b86('0x2b')][_0x6b86('0x31')]);_0x396eb4[_0x6b86('0x32')]=qs['filters'](_[_0x6b86('0x33')](_0x45584f[_0x6b86('0x2b')],_0x2dad3c[_0x6b86('0x29')]),_0x1df46d);if(_0x45584f[_0x6b86('0x2b')][_0x6b86('0x34')]){_0x396eb4[_0x6b86('0x32')]=_[_0x6b86('0x35')](_0x396eb4['where'],{'$or':_['map'](_0x1df46d,function(_0x3387e2){if(_0x3387e2[_0x6b86('0x26')]!==_0x6b86('0x36')){var _0x3265ff={};_0x3265ff[_0x3387e2[_0x6b86('0x20')]]={'$like':'%'+_0x45584f[_0x6b86('0x2b')][_0x6b86('0x34')]+'%'};return _0x3265ff;}})});}_0x396eb4=_[_0x6b86('0x35')]({},_0x396eb4,_0x45584f[_0x6b86('0x37')]);var _0x2c29b2={'where':_0x396eb4[_0x6b86('0x32')]};return db[_0x6b86('0x23')][_0x6b86('0x15')](_0x2c29b2)[_0x6b86('0x1c')](function(_0x5e456c){_0x3683f[_0x6b86('0x15')]=_0x5e456c;if(_0x45584f[_0x6b86('0x2b')][_0x6b86('0x38')]){_0x396eb4[_0x6b86('0x39')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x396eb4);})[_0x6b86('0x1c')](function(_0x51f37d){_0x3683f[_0x6b86('0x3a')]=_0x51f37d;return _0x3683f;})[_0x6b86('0x1c')](respondWithFilteredResult(_0xfc44b1,_0x396eb4))[_0x6b86('0x3b')](handleError(_0xfc44b1,null));};exports[_0x6b86('0x3c')]=function(_0x2a5cbb,_0x2241a1){var _0x5c4cae={'raw':!![],'where':{'id':_0x2a5cbb['params']['id']}},_0x54bf19={};_0x54bf19[_0x6b86('0x28')]=_['keys'](db[_0x6b86('0x23')][_0x6b86('0x24')]);_0x54bf19[_0x6b86('0x2b')]=_[_0x6b86('0x3d')](_0x2a5cbb[_0x6b86('0x2b')]);_0x54bf19[_0x6b86('0x29')]=_['intersection'](_0x54bf19[_0x6b86('0x28')],_0x54bf19[_0x6b86('0x2b')]);_0x5c4cae[_0x6b86('0x2d')]=_['intersection'](_0x54bf19[_0x6b86('0x28')],qs[_0x6b86('0x2c')](_0x2a5cbb[_0x6b86('0x2b')][_0x6b86('0x2c')]));_0x5c4cae[_0x6b86('0x2d')]=_0x5c4cae[_0x6b86('0x2d')][_0x6b86('0x2e')]?_0x5c4cae['attributes']:_0x54bf19[_0x6b86('0x28')];if(_0x2a5cbb['query'][_0x6b86('0x38')]){_0x5c4cae[_0x6b86('0x39')]=[{'all':!![]}];}_0x5c4cae=_[_0x6b86('0x35')]({},_0x5c4cae,_0x2a5cbb['options']);return db[_0x6b86('0x23')][_0x6b86('0x3e')](_0x5c4cae)[_0x6b86('0x1c')](handleEntityNotFound(_0x2241a1,null))[_0x6b86('0x1c')](respondWithResult(_0x2241a1,null))[_0x6b86('0x3b')](handleError(_0x2241a1,null));};exports['create']=function(_0x2cef5f,_0x16cee6){return db[_0x6b86('0x23')][_0x6b86('0x3f')](_0x2cef5f[_0x6b86('0x40')],{})[_0x6b86('0x1c')](respondWithResult(_0x16cee6,0xc9))[_0x6b86('0x3b')](handleError(_0x16cee6,null));};exports[_0x6b86('0x1a')]=function(_0x52c484,_0x20df3e){if(_0x52c484[_0x6b86('0x40')]['id']){delete _0x52c484[_0x6b86('0x40')]['id'];}return db[_0x6b86('0x23')]['find']({'where':{'id':_0x52c484[_0x6b86('0x41')]['id']}})[_0x6b86('0x1c')](handleEntityNotFound(_0x20df3e,null))['then'](saveUpdates(_0x52c484[_0x6b86('0x40')],null))[_0x6b86('0x1c')](respondWithResult(_0x20df3e,null))['catch'](handleError(_0x20df3e,null));};exports[_0x6b86('0x1b')]=function(_0x279c2c,_0x25bdab){return db[_0x6b86('0x23')][_0x6b86('0x3e')]({'where':{'id':_0x279c2c[_0x6b86('0x41')]['id']}})[_0x6b86('0x1c')](handleEntityNotFound(_0x25bdab,null))[_0x6b86('0x1c')](removeEntity(_0x25bdab,null))[_0x6b86('0x3b')](handleError(_0x25bdab,null));}; \ No newline at end of file +var _0x0389=['send','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshsalesField','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','destroy','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name'];(function(_0x3e487f,_0xcfe144){var _0x1eb2a9=function(_0x4a8a5d){while(--_0x4a8a5d){_0x3e487f['push'](_0x3e487f['shift']());}};_0x1eb2a9(++_0xcfe144);}(_0x0389,0x6c));var _0x9038=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x0389[_0x3a2a3c];return _0x50ac9a;};'use strict';var emlformat=require(_0x9038('0x0'));var rimraf=require(_0x9038('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9038('0x2'));var BPromise=require(_0x9038('0x3'));var Mustache=require(_0x9038('0x4'));var util=require(_0x9038('0x5'));var path=require(_0x9038('0x6'));var sox=require('sox');var csv=require(_0x9038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9038('0x8'));var squel=require(_0x9038('0x9'));var crypto=require(_0x9038('0xa'));var jsforce=require(_0x9038('0xb'));var deskjs=require(_0x9038('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9038('0xd'));var Papa=require(_0x9038('0xe'));var Redis=require(_0x9038('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9038('0x10'));var as=require(_0x9038('0x11'));var hardwareService=require(_0x9038('0x12'));var logger=require(_0x9038('0x13'))(_0x9038('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9038('0x15'));var db=require(_0x9038('0x16'))['db'];function respondWithStatusCode(_0x30f9f1,_0x377766){_0x377766=_0x377766||0xcc;return function(_0x5eec84){if(_0x5eec84){return _0x30f9f1[_0x9038('0x17')](_0x377766);}return _0x30f9f1[_0x9038('0x18')](_0x377766)[_0x9038('0x19')]();};}function respondWithResult(_0x4f5ca7,_0x1d16b6){_0x1d16b6=_0x1d16b6||0xc8;return function(_0x3309c0){if(_0x3309c0){return _0x4f5ca7['status'](_0x1d16b6)['json'](_0x3309c0);}};}function respondWithFilteredResult(_0x4069cd,_0x3003ab){return function(_0x8c58f9){if(_0x8c58f9){var _0x544e7d=typeof _0x3003ab[_0x9038('0x1a')]===_0x9038('0x1b')&&typeof _0x3003ab['limit']===_0x9038('0x1b');var _0x144ac2=_0x8c58f9[_0x9038('0x1c')];var _0x5ad0f6=_0x544e7d?0x0:_0x3003ab[_0x9038('0x1a')];var _0x29b481=_0x544e7d?_0x8c58f9['count']:_0x3003ab['offset']+_0x3003ab[_0x9038('0x1d')];var _0x50893d;if(_0x29b481>=_0x144ac2){_0x29b481=_0x144ac2;_0x50893d=0xc8;}else{_0x50893d=0xce;}_0x4069cd['status'](_0x50893d);return _0x4069cd[_0x9038('0x1e')](_0x9038('0x1f'),_0x5ad0f6+'-'+_0x29b481+'/'+_0x144ac2)[_0x9038('0x20')](_0x8c58f9);}return null;};}function patchUpdates(_0x4f962a){return function(_0x2e46b8){try{jsonpatch['apply'](_0x2e46b8,_0x4f962a,!![]);}catch(_0x2928f3){return BPromise[_0x9038('0x21')](_0x2928f3);}return _0x2e46b8[_0x9038('0x22')]();};}function saveUpdates(_0x1fc9be,_0x3812da){return function(_0x85002e){if(_0x85002e){return _0x85002e[_0x9038('0x23')](_0x1fc9be)[_0x9038('0x24')](function(_0x5d3baa){return _0x5d3baa;});}return null;};}function removeEntity(_0x334ce0,_0x2b69f4){return function(_0x16ef18){if(_0x16ef18){return _0x16ef18['destroy']()[_0x9038('0x24')](function(){_0x334ce0[_0x9038('0x18')](0xcc)[_0x9038('0x19')]();});}};}function handleEntityNotFound(_0x1093d1,_0x37b4ba){return function(_0x10338c){if(!_0x10338c){_0x1093d1['sendStatus'](0x194);}return _0x10338c;};}function handleError(_0x3284f7,_0x345a74){_0x345a74=_0x345a74||0x1f4;return function(_0x1dabfd){logger[_0x9038('0x25')](_0x1dabfd[_0x9038('0x26')]);if(_0x1dabfd[_0x9038('0x27')]){delete _0x1dabfd[_0x9038('0x27')];}_0x3284f7[_0x9038('0x18')](_0x345a74)[_0x9038('0x28')](_0x1dabfd);};}exports[_0x9038('0x29')]=function(_0x3c3d65,_0x2795e6){var _0x1c0417={},_0x4f1ea9={},_0x52995e={'count':0x0,'rows':[]};var _0x2ff8b3=_[_0x9038('0x2a')](db['FreshsalesField']['rawAttributes'],function(_0x2dda56){return{'name':_0x2dda56[_0x9038('0x2b')],'type':_0x2dda56[_0x9038('0x2c')][_0x9038('0x2d')]};});_0x4f1ea9[_0x9038('0x2e')]=_[_0x9038('0x2a')](_0x2ff8b3,_0x9038('0x27'));_0x4f1ea9[_0x9038('0x2f')]=_[_0x9038('0x30')](_0x3c3d65[_0x9038('0x2f')]);_0x4f1ea9[_0x9038('0x31')]=_['intersection'](_0x4f1ea9[_0x9038('0x2e')],_0x4f1ea9[_0x9038('0x2f')]);_0x1c0417[_0x9038('0x32')]=_['intersection'](_0x4f1ea9[_0x9038('0x2e')],qs[_0x9038('0x33')](_0x3c3d65[_0x9038('0x2f')]['fields']));_0x1c0417[_0x9038('0x32')]=_0x1c0417[_0x9038('0x32')][_0x9038('0x34')]?_0x1c0417[_0x9038('0x32')]:_0x4f1ea9[_0x9038('0x2e')];if(!_0x3c3d65['query'][_0x9038('0x35')](_0x9038('0x36'))){_0x1c0417[_0x9038('0x1d')]=qs[_0x9038('0x1d')](_0x3c3d65[_0x9038('0x2f')][_0x9038('0x1d')]);_0x1c0417[_0x9038('0x1a')]=qs[_0x9038('0x1a')](_0x3c3d65[_0x9038('0x2f')][_0x9038('0x1a')]);}_0x1c0417[_0x9038('0x37')]=qs['sort'](_0x3c3d65[_0x9038('0x2f')][_0x9038('0x38')]);_0x1c0417[_0x9038('0x39')]=qs['filters'](_[_0x9038('0x3a')](_0x3c3d65[_0x9038('0x2f')],_0x4f1ea9[_0x9038('0x31')]),_0x2ff8b3);if(_0x3c3d65[_0x9038('0x2f')][_0x9038('0x3b')]){_0x1c0417['where']=_[_0x9038('0x3c')](_0x1c0417['where'],{'$or':_[_0x9038('0x2a')](_0x2ff8b3,function(_0x433cf3){if(_0x433cf3['type']!=='VIRTUAL'){var _0x26faaa={};_0x26faaa[_0x433cf3[_0x9038('0x27')]]={'$like':'%'+_0x3c3d65['query']['filter']+'%'};return _0x26faaa;}})});}_0x1c0417=_[_0x9038('0x3c')]({},_0x1c0417,_0x3c3d65[_0x9038('0x3d')]);var _0x4ffaf3={'where':_0x1c0417[_0x9038('0x39')]};return db[_0x9038('0x3e')][_0x9038('0x1c')](_0x4ffaf3)['then'](function(_0x2411a7){_0x52995e[_0x9038('0x1c')]=_0x2411a7;if(_0x3c3d65[_0x9038('0x2f')][_0x9038('0x3f')]){_0x1c0417['include']=[{'all':!![]}];}return db[_0x9038('0x3e')]['findAll'](_0x1c0417);})[_0x9038('0x24')](function(_0x41d587){_0x52995e[_0x9038('0x40')]=_0x41d587;return _0x52995e;})['then'](respondWithFilteredResult(_0x2795e6,_0x1c0417))['catch'](handleError(_0x2795e6,null));};exports[_0x9038('0x41')]=function(_0x5374e6,_0x41f2fd){var _0x215fd9={'raw':!![],'where':{'id':_0x5374e6[_0x9038('0x42')]['id']}},_0x2abe50={};_0x2abe50[_0x9038('0x2e')]=_['keys'](db[_0x9038('0x3e')][_0x9038('0x43')]);_0x2abe50[_0x9038('0x2f')]=_[_0x9038('0x30')](_0x5374e6[_0x9038('0x2f')]);_0x2abe50['filters']=_['intersection'](_0x2abe50[_0x9038('0x2e')],_0x2abe50[_0x9038('0x2f')]);_0x215fd9[_0x9038('0x32')]=_['intersection'](_0x2abe50[_0x9038('0x2e')],qs[_0x9038('0x33')](_0x5374e6[_0x9038('0x2f')][_0x9038('0x33')]));_0x215fd9[_0x9038('0x32')]=_0x215fd9['attributes'][_0x9038('0x34')]?_0x215fd9[_0x9038('0x32')]:_0x2abe50[_0x9038('0x2e')];if(_0x5374e6[_0x9038('0x2f')]['includeAll']){_0x215fd9[_0x9038('0x44')]=[{'all':!![]}];}_0x215fd9=_[_0x9038('0x3c')]({},_0x215fd9,_0x5374e6[_0x9038('0x3d')]);return db[_0x9038('0x3e')][_0x9038('0x45')](_0x215fd9)[_0x9038('0x24')](handleEntityNotFound(_0x41f2fd,null))[_0x9038('0x24')](respondWithResult(_0x41f2fd,null))[_0x9038('0x46')](handleError(_0x41f2fd,null));};exports[_0x9038('0x47')]=function(_0x59934d,_0x1a9a14){return db[_0x9038('0x3e')][_0x9038('0x47')](_0x59934d[_0x9038('0x48')],{})[_0x9038('0x24')](respondWithResult(_0x1a9a14,0xc9))[_0x9038('0x46')](handleError(_0x1a9a14,null));};exports[_0x9038('0x23')]=function(_0x4d65c8,_0x372281){if(_0x4d65c8[_0x9038('0x48')]['id']){delete _0x4d65c8['body']['id'];}return db[_0x9038('0x3e')]['find']({'where':{'id':_0x4d65c8[_0x9038('0x42')]['id']}})['then'](handleEntityNotFound(_0x372281,null))[_0x9038('0x24')](saveUpdates(_0x4d65c8[_0x9038('0x48')],null))[_0x9038('0x24')](respondWithResult(_0x372281,null))[_0x9038('0x46')](handleError(_0x372281,null));};exports[_0x9038('0x49')]=function(_0xa82679,_0x182f39){return db[_0x9038('0x3e')]['find']({'where':{'id':_0xa82679[_0x9038('0x42')]['id']}})[_0x9038('0x24')](handleEntityNotFound(_0x182f39,null))[_0x9038('0x24')](removeEntity(_0x182f39,null))[_0x9038('0x46')](handleError(_0x182f39,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e97b9cd..a68497c 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 _0xa1c5=['../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x151cce,_0x360be5){var _0x42d11a=function(_0x1a25cc){while(--_0x1a25cc){_0x151cce['push'](_0x151cce['shift']());}};_0x42d11a(++_0x360be5);}(_0xa1c5,0x96));var _0x5a1c=function(_0x57cc1a,_0x27e0a5){_0x57cc1a=_0x57cc1a-0x0;var _0x278dc2=_0xa1c5[_0x57cc1a];return _0x278dc2;};'use strict';var _=require(_0x5a1c('0x0'));var util=require(_0x5a1c('0x1'));var logger=require(_0x5a1c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5a1c('0x3'));var rp=require(_0x5a1c('0x4'));var fs=require('fs');var path=require(_0x5a1c('0x5'));var rimraf=require('rimraf');var config=require(_0x5a1c('0x6'));var attributes=require(_0x5a1c('0x7'));module[_0x5a1c('0x8')]=function(_0x5a16d2,_0x2607fc){return _0x5a16d2[_0x5a1c('0x9')]('FreshsalesField',attributes,{'tableName':_0x5a1c('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x5a1c('0xb'),_0x5a1c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdac7=['request-promise','path','rimraf','FreshsalesField','freshsales_unique_index','FieldId','lodash','util','bluebird'];(function(_0x20398e,_0x201e3b){var _0x1231f6=function(_0x3a424d){while(--_0x3a424d){_0x20398e['push'](_0x20398e['shift']());}};_0x1231f6(++_0x201e3b);}(_0xdac7,0x180));var _0x7dac=function(_0x40ea2e,_0x323264){_0x40ea2e=_0x40ea2e-0x0;var _0x302821=_0xdac7[_0x40ea2e];return _0x302821;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7dac('0x2'));var rp=require(_0x7dac('0x3'));var fs=require('fs');var path=require(_0x7dac('0x4'));var rimraf=require(_0x7dac('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x17a05f,_0x2557ee){return _0x17a05f['define'](_0x7dac('0x6'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7dac('0x7'),'fields':['idField',_0x7dac('0x8')],'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 2918ae6..a10f90f 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 _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xfcf0[_0x3d5f84];return _0x1981b8;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file +var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xacf4,0xe7));var _0x4acf=function(_0x1549a3,_0x5c3777){_0x1549a3=_0x1549a3-0x0;var _0x5a820f=_0xacf4[_0x1549a3];return _0x5a820f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d84f481..2b2346c 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(_0x180bb4,_0x1ae473){var _0x3bd885=function(_0x44f571){while(--_0x44f571){_0x180bb4['push'](_0x180bb4['shift']());}};_0x3bd885(++_0x1ae473);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 _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(_0x194a72,_0x225209){var _0x545a0d=function(_0x290ccc){while(--_0x290ccc){_0x194a72['push'](_0x194a72['shift']());}};_0x545a0d(++_0x225209);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index a5884b1..685ebe6 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 _0xab54=['ENUM','newTab','exports','STRING','username'];(function(_0x204cdc,_0x243cd5){var _0x587745=function(_0xb90b71){while(--_0xb90b71){_0x204cdc['push'](_0x204cdc['shift']());}};_0x587745(++_0x243cd5);}(_0xab54,0x115));var _0x4ab5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab54[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x4ab5('0x0')]={'name':{'type':Sequelize[_0x4ab5('0x1')]},'description':{'type':Sequelize[_0x4ab5('0x1')]},'username':{'type':Sequelize[_0x4ab5('0x1')],'unique':_0x4ab5('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4ab5('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4ab5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4ab5('0x3')]('integrationTab',_0x4ab5('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x633b=['sequelize','exports','STRING','ENUM','newTab','integrationTab'];(function(_0x2a2616,_0xb92e79){var _0x25117d=function(_0x236ab2){while(--_0x236ab2){_0x2a2616['push'](_0x2a2616['shift']());}};_0x25117d(++_0xb92e79);}(_0x633b,0xd8));var _0xb633=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x633b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb633('0x0'));module[_0xb633('0x1')]={'name':{'type':Sequelize[_0xb633('0x2')]},'description':{'type':Sequelize[_0xb633('0x2')]},'username':{'type':Sequelize[_0xb633('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb633('0x2')]},'password':{'type':Sequelize[_0xb633('0x2')]},'clientId':{'type':Sequelize[_0xb633('0x2')]},'clientSecret':{'type':Sequelize[_0xb633('0x2')]},'securityToken':{'type':Sequelize[_0xb633('0x2')]},'serverUrl':{'type':Sequelize[_0xb633('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb633('0x3')]('integrationTab',_0xb633('0x4')),'defaultValue':_0xb633('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 24899ae..0786d04 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 _0x805e=['filter','merge','VIRTUAL','options','includeAll','SalesforceAccount','findAll','rows','catch','show','params','length','include','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','login','username','password','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Description','int','picklist','boolean','email','phone','includes','label','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x135240,_0x5d0162){var _0x56cca2=function(_0x414034){while(--_0x414034){_0x135240['push'](_0x135240['shift']());}};_0x56cca2(++_0x5d0162);}(_0x805e,0x1bd));var _0xe805=function(_0x3b8720,_0x37e5eb){_0x3b8720=_0x3b8720-0x0;var _0x340f4d=_0x805e[_0x3b8720];return _0x340f4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe805('0x0'));var jsonpatch=require(_0xe805('0x1'));var rp=require(_0xe805('0x2'));var moment=require(_0xe805('0x3'));var BPromise=require(_0xe805('0x4'));var Mustache=require('mustache');var util=require(_0xe805('0x5'));var path=require(_0xe805('0x6'));var sox=require(_0xe805('0x7'));var csv=require('to-csv');var ejs=require(_0xe805('0x8'));var fs=require('fs');var fs_extra=require(_0xe805('0x9'));var _=require(_0xe805('0xa'));var squel=require(_0xe805('0xb'));var crypto=require(_0xe805('0xc'));var jsforce=require(_0xe805('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe805('0xe'));var Papa=require(_0xe805('0xf'));var Redis=require(_0xe805('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe805('0x11'));var logger=require(_0xe805('0x12'))(_0xe805('0x13'));var utils=require(_0xe805('0x14'));var config=require(_0xe805('0x15'));var licenseUtil=require(_0xe805('0x16'));var db=require(_0xe805('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2da8d6,_0x2041f5){_0x2041f5=_0x2041f5||0xcc;return function(_0x4ba1f5){if(_0x4ba1f5){return _0x2da8d6['sendStatus'](_0x2041f5);}return _0x2da8d6[_0xe805('0x18')](_0x2041f5)[_0xe805('0x19')]();};}function respondWithResult(_0x220b2d,_0x3bc9c1){_0x3bc9c1=_0x3bc9c1||0xc8;return function(_0x1358ce){if(_0x1358ce){return _0x220b2d['status'](_0x3bc9c1)[_0xe805('0x1a')](_0x1358ce);}};}function respondWithFilteredResult(_0x40266b,_0x243cc9){return function(_0x353453){if(_0x353453){var _0x3a6f44=typeof _0x243cc9['offset']===_0xe805('0x1b')&&typeof _0x243cc9[_0xe805('0x1c')]===_0xe805('0x1b');var _0x5f51b7=_0x353453[_0xe805('0x1d')];var _0x2845b1=_0x3a6f44?0x0:_0x243cc9[_0xe805('0x1e')];var _0x370392=_0x3a6f44?_0x353453['count']:_0x243cc9[_0xe805('0x1e')]+_0x243cc9[_0xe805('0x1c')];var _0x13c388;if(_0x370392>=_0x5f51b7){_0x370392=_0x5f51b7;_0x13c388=0xc8;}else{_0x13c388=0xce;}_0x40266b[_0xe805('0x18')](_0x13c388);return _0x40266b[_0xe805('0x1f')](_0xe805('0x20'),_0x2845b1+'-'+_0x370392+'/'+_0x5f51b7)[_0xe805('0x1a')](_0x353453);}return null;};}function patchUpdates(_0x5e72e8){return function(_0x447b27){try{jsonpatch[_0xe805('0x21')](_0x447b27,_0x5e72e8,!![]);}catch(_0x1516ac){return BPromise[_0xe805('0x22')](_0x1516ac);}return _0x447b27['save']();};}function saveUpdates(_0x5b6492,_0x37b871){return function(_0x6131f9){if(_0x6131f9){return _0x6131f9[_0xe805('0x23')](_0x5b6492)[_0xe805('0x24')](function(_0x37b120){return _0x37b120;});}return null;};}function removeEntity(_0x4860bf,_0x17106b){return function(_0xa96bc){if(_0xa96bc){return _0xa96bc['destroy']()[_0xe805('0x24')](function(){_0x4860bf[_0xe805('0x18')](0xcc)[_0xe805('0x19')]();});}};}function handleEntityNotFound(_0x545313,_0x512710){return function(_0x9db6cb){if(!_0x9db6cb){_0x545313[_0xe805('0x25')](0x194);}return _0x9db6cb;};}function handleError(_0x3a02e4,_0xd5a8ba){_0xd5a8ba=_0xd5a8ba||0x1f4;return function(_0x76f67e){logger[_0xe805('0x26')](_0x76f67e[_0xe805('0x27')]);if(_0x76f67e[_0xe805('0x28')]){delete _0x76f67e['name'];}_0x3a02e4[_0xe805('0x18')](_0xd5a8ba)['send'](_0x76f67e);};}exports[_0xe805('0x29')]=function(_0x5941ae,_0x23cbf6){var _0x3bc699={},_0x1ddd71={},_0x15e35d={'count':0x0,'rows':[]};var _0x443868=_[_0xe805('0x2a')](db['SalesforceAccount']['rawAttributes'],function(_0x403ab7){return{'name':_0x403ab7[_0xe805('0x2b')],'type':_0x403ab7[_0xe805('0x2c')][_0xe805('0x2d')]};});_0x1ddd71['model']=_[_0xe805('0x2a')](_0x443868,_0xe805('0x28'));_0x1ddd71[_0xe805('0x2e')]=_[_0xe805('0x2f')](_0x5941ae[_0xe805('0x2e')]);_0x1ddd71['filters']=_[_0xe805('0x30')](_0x1ddd71[_0xe805('0x31')],_0x1ddd71[_0xe805('0x2e')]);_0x3bc699[_0xe805('0x32')]=_['intersection'](_0x1ddd71[_0xe805('0x31')],qs[_0xe805('0x33')](_0x5941ae[_0xe805('0x2e')][_0xe805('0x33')]));_0x3bc699[_0xe805('0x32')]=_0x3bc699[_0xe805('0x32')]['length']?_0x3bc699[_0xe805('0x32')]:_0x1ddd71[_0xe805('0x31')];if(!_0x5941ae['query'][_0xe805('0x34')](_0xe805('0x35'))){_0x3bc699[_0xe805('0x1c')]=qs['limit'](_0x5941ae[_0xe805('0x2e')][_0xe805('0x1c')]);_0x3bc699[_0xe805('0x1e')]=qs['offset'](_0x5941ae['query'][_0xe805('0x1e')]);}_0x3bc699[_0xe805('0x36')]=qs[_0xe805('0x37')](_0x5941ae[_0xe805('0x2e')][_0xe805('0x37')]);_0x3bc699[_0xe805('0x38')]=qs[_0xe805('0x39')](_[_0xe805('0x3a')](_0x5941ae[_0xe805('0x2e')],_0x1ddd71[_0xe805('0x39')]),_0x443868);if(_0x5941ae[_0xe805('0x2e')][_0xe805('0x3b')]){_0x3bc699[_0xe805('0x38')]=_[_0xe805('0x3c')](_0x3bc699[_0xe805('0x38')],{'$or':_[_0xe805('0x2a')](_0x443868,function(_0x16069d){if(_0x16069d[_0xe805('0x2c')]!==_0xe805('0x3d')){var _0x2290d4={};_0x2290d4[_0x16069d[_0xe805('0x28')]]={'$like':'%'+_0x5941ae['query']['filter']+'%'};return _0x2290d4;}})});}_0x3bc699=_[_0xe805('0x3c')]({},_0x3bc699,_0x5941ae[_0xe805('0x3e')]);var _0x28f818={'where':_0x3bc699['where']};return db['SalesforceAccount'][_0xe805('0x1d')](_0x28f818)[_0xe805('0x24')](function(_0x37c3dc){_0x15e35d[_0xe805('0x1d')]=_0x37c3dc;if(_0x5941ae['query'][_0xe805('0x3f')]){_0x3bc699['include']=[{'all':!![]}];}return db[_0xe805('0x40')][_0xe805('0x41')](_0x3bc699);})['then'](function(_0xbb40b2){_0x15e35d[_0xe805('0x42')]=_0xbb40b2;return _0x15e35d;})[_0xe805('0x24')](respondWithFilteredResult(_0x23cbf6,_0x3bc699))[_0xe805('0x43')](handleError(_0x23cbf6,null));};exports[_0xe805('0x44')]=function(_0x4af2ca,_0x55452d){var _0x88124a={'raw':![],'where':{'id':_0x4af2ca[_0xe805('0x45')]['id']}},_0x1ce191={};_0x1ce191[_0xe805('0x31')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x1ce191['query']=_[_0xe805('0x2f')](_0x4af2ca[_0xe805('0x2e')]);_0x1ce191[_0xe805('0x39')]=_[_0xe805('0x30')](_0x1ce191[_0xe805('0x31')],_0x1ce191[_0xe805('0x2e')]);_0x88124a['attributes']=_[_0xe805('0x30')](_0x1ce191[_0xe805('0x31')],qs[_0xe805('0x33')](_0x4af2ca[_0xe805('0x2e')][_0xe805('0x33')]));_0x88124a[_0xe805('0x32')]=_0x88124a['attributes'][_0xe805('0x46')]?_0x88124a[_0xe805('0x32')]:_0x1ce191['model'];if(_0x4af2ca['query']['includeAll']){_0x88124a[_0xe805('0x47')]=[{'all':!![]}];}_0x88124a=_['merge']({},_0x88124a,_0x4af2ca[_0xe805('0x3e')]);return db['SalesforceAccount'][_0xe805('0x48')](_0x88124a)[_0xe805('0x24')](handleEntityNotFound(_0x55452d,null))[_0xe805('0x24')](respondWithResult(_0x55452d,null))[_0xe805('0x43')](handleError(_0x55452d,null));};exports[_0xe805('0x49')]=function(_0x12aee7,_0x321a19){return db[_0xe805('0x40')]['create'](_0x12aee7[_0xe805('0x4a')],{})[_0xe805('0x24')](respondWithResult(_0x321a19,0xc9))[_0xe805('0x43')](handleError(_0x321a19,null));};exports['update']=function(_0x353afe,_0x5af688){if(_0x353afe['body']['id']){delete _0x353afe['body']['id'];}return db[_0xe805('0x40')]['find']({'where':{'id':_0x353afe['params']['id']}})['then'](handleEntityNotFound(_0x5af688,null))['then'](saveUpdates(_0x353afe[_0xe805('0x4a')],null))[_0xe805('0x24')](respondWithResult(_0x5af688,null))[_0xe805('0x43')](handleError(_0x5af688,null));};exports[_0xe805('0x4b')]=function(_0x5d6f6e,_0x15acd9){return db[_0xe805('0x40')][_0xe805('0x48')]({'where':{'id':_0x5d6f6e[_0xe805('0x45')]['id']}})['then'](handleEntityNotFound(_0x15acd9,null))[_0xe805('0x24')](removeEntity(_0x15acd9,null))[_0xe805('0x43')](handleError(_0x15acd9,null));};exports[_0xe805('0x4c')]=function(_0x5212e0,_0x3647d3,_0x3c875d){var _0x1cf77f={};var _0x30eb3e={};var _0x495367;var _0x24a851;return db['SalesforceAccount'][_0xe805('0x4d')]({'where':{'id':_0x5212e0['params']['id']}})[_0xe805('0x24')](handleEntityNotFound(_0x3647d3,null))[_0xe805('0x24')](function(_0x46eb08){if(_0x46eb08){_0x495367=_0x46eb08;_0x30eb3e[_0xe805('0x31')]=_[_0xe805('0x2f')](db[_0xe805('0x4e')][_0xe805('0x4f')]);_0x30eb3e[_0xe805('0x2e')]=_[_0xe805('0x2f')](_0x5212e0['query']);_0x30eb3e[_0xe805('0x39')]=_[_0xe805('0x30')](_0x30eb3e['model'],_0x30eb3e[_0xe805('0x2e')]);_0x1cf77f[_0xe805('0x32')]=_[_0xe805('0x30')](_0x30eb3e[_0xe805('0x31')],qs['fields'](_0x5212e0[_0xe805('0x2e')]['fields']));_0x1cf77f[_0xe805('0x32')]=_0x1cf77f['attributes'][_0xe805('0x46')]?_0x1cf77f['attributes']:_0x30eb3e[_0xe805('0x31')];_0x1cf77f[_0xe805('0x36')]=qs[_0xe805('0x37')](_0x5212e0[_0xe805('0x2e')][_0xe805('0x37')]);_0x1cf77f['where']=qs[_0xe805('0x39')](_['pick'](_0x5212e0[_0xe805('0x2e')],_0x30eb3e[_0xe805('0x39')]));if(_0x5212e0['query'][_0xe805('0x3b')]){_0x1cf77f[_0xe805('0x38')]=_[_0xe805('0x3c')](_0x1cf77f[_0xe805('0x38')],{'$or':_[_0xe805('0x2a')](_0x1cf77f[_0xe805('0x32')],function(_0x113ea2){var _0x383a52={};_0x383a52[_0x113ea2]={'$like':'%'+_0x5212e0[_0xe805('0x2e')][_0xe805('0x3b')]+'%'};return _0x383a52;})});}_0x1cf77f=_[_0xe805('0x3c')]({},_0x1cf77f,_0x5212e0[_0xe805('0x3e')]);return _0x495367['getConfigurations'](_0x1cf77f);}})[_0xe805('0x24')](function(_0x38f494){if(_0x38f494){_0x24a851=_0x38f494['length'];if(!_0x5212e0[_0xe805('0x2e')]['hasOwnProperty'](_0xe805('0x35'))){_0x1cf77f[_0xe805('0x1c')]=qs['limit'](_0x5212e0[_0xe805('0x2e')]['limit']);_0x1cf77f['offset']=qs[_0xe805('0x1e')](_0x5212e0['query']['offset']);}return _0x495367[_0xe805('0x4c')](_0x1cf77f);}})[_0xe805('0x24')](function(_0x2ff5a2){if(_0x2ff5a2){return _0x2ff5a2?{'count':_0x24a851,'rows':_0x2ff5a2}:null;}})[_0xe805('0x24')](respondWithResult(_0x3647d3,null))[_0xe805('0x43')](handleError(_0x3647d3,null));};exports[_0xe805('0x50')]=function(_0x5232f5,_0x169238,_0x251dc9){if(_0x5232f5['body']['id']){delete _0x5232f5[_0xe805('0x4a')]['id'];}return db[_0xe805('0x40')]['findOne']({'where':{'id':_0x5232f5[_0xe805('0x45')]['id']}})[_0xe805('0x24')](handleEntityNotFound(_0x169238,null))[_0xe805('0x24')](function(_0x594857){if(_0x594857){_0x5232f5['body'][_0xe805('0x51')]=_0x594857['id'];_0x5232f5[_0xe805('0x4a')][_0xe805('0x52')]=integrations[_0xe805('0x53')](_0x5232f5[_0xe805('0x4a')]['channel'],_0x5232f5[_0xe805('0x4a')]['type']);_0x5232f5[_0xe805('0x4a')][_0xe805('0x54')]=integrations[_0xe805('0x55')](_0x5232f5[_0xe805('0x4a')][_0xe805('0x56')],_0x5232f5[_0xe805('0x4a')]['type']);return db[_0xe805('0x4e')][_0xe805('0x49')](_0x5232f5[_0xe805('0x4a')],{'include':[{'model':db[_0xe805('0x57')],'as':_0xe805('0x52')},{'model':db[_0xe805('0x57')],'as':_0xe805('0x54')}]});}return null;})[_0xe805('0x24')](respondWithResult(_0x169238,null))[_0xe805('0x43')](handleError(_0x169238,null));};exports[_0xe805('0x58')]=function(_0xb40901,_0x585b43,_0x4d2945){var _0x2957dd;var _0x8500d4='';var _0x2952b8=_0xe805('0x59');return db[_0xe805('0x40')][_0xe805('0x4d')]({'where':{'id':_0xb40901[_0xe805('0x45')]['id']},'attributes':['id',_0xe805('0x5a'),_0xe805('0x5b'),_0xe805('0x5c'),'username','password',_0xe805('0x5d')]})[_0xe805('0x24')](handleEntityNotFound(_0x585b43,null))[_0xe805('0x24')](function(_0x2fb1b6){if(_0x2fb1b6){_0x8500d4=_0x2fb1b6['remoteUri'];var _0x52c88f=_0x8500d4[_0xe805('0x5e')](-0x1);if(_0x52c88f==='/'){_0x8500d4=_0x8500d4[_0xe805('0x5f')](0x0,_0x8500d4[_0xe805('0x60')](_0x52c88f));}_0x2957dd=new jsforce[(_0xe805('0x61'))]({'oauth2':{'loginUrl':_0x8500d4,'clientId':_0x2fb1b6['clientId'],'clientSecret':_0x2fb1b6[_0xe805('0x5c')]}});return _0x2957dd[_0xe805('0x62')](_0x2fb1b6[_0xe805('0x63')],_0x2fb1b6[_0xe805('0x64')]['concat'](_0x2fb1b6['securityToken']));}})[_0xe805('0x24')](function(_0x17c7af){if(_0x17c7af){if(!_[_0xe805('0x65')](_0xb40901[_0xe805('0x2e')][_0xe805('0x66')])){_0x2952b8=_0xb40901[_0xe805('0x2e')][_0xe805('0x66')];}return _0x2957dd[_0xe805('0x67')](_0x2952b8)[_0xe805('0x68')]();}})[_0xe805('0x24')](function(_0xc2061f){var _0x43c5a0=['OwnerId',_0xe805('0x69'),_0xe805('0x6a'),'IsRecurrence','Subject',_0xe805('0x6b')];var _0x5bac9b=['string',_0xe805('0x6c'),_0xe805('0x6d'),_0xe805('0x6e'),_0xe805('0x6f'),'textarea',_0xe805('0x70')];if(_0xc2061f){_['remove'](_0xc2061f[_0xe805('0x33')],function(_0x4c59a6){return _0x43c5a0[_0xe805('0x71')](_0x4c59a6[_0xe805('0x28')])||!_0x5bac9b[_0xe805('0x71')](_0x4c59a6[_0xe805('0x2c')]);});return{'count':_0xc2061f[_0xe805('0x33')][_0xe805('0x46')],'rows':_['map'](_0xc2061f[_0xe805('0x33')],function(_0x3e768d){return{'id':_0x3e768d[_0xe805('0x28')],'name':_0x3e768d[_0xe805('0x72')],'custom':_0x3e768d['custom'],'options':_0x3e768d[_0xe805('0x73')]['length']>0x0?_[_0xe805('0x2a')](_0x3e768d[_0xe805('0x73')],function(_0x5c5d53){return{'name':_0x5c5d53[_0xe805('0x72')],'value':_0x5c5d53[_0xe805('0x74')]};}):_0x3e768d[_0xe805('0x2c')]==_0xe805('0x6e')?[{'name':_0xe805('0x75'),'value':_0xe805('0x76')},{'name':'False','value':_0xe805('0x77')}]:[]};})};}})[_0xe805('0x24')](respondWithResult(_0x585b43,null))['catch'](function(_0xec64eb){var _0x12cd90=_0xb40901['query'][_0xe805('0x78')]?0x1f4:_0xec64eb[_0xe805('0x79')]||0x1f4;logger['error'](_0xe805('0x7a'),_0xe805('0x58'),_0x12cd90,JSON[_0xe805('0x7b')](_0xec64eb));delete _0xec64eb['name'];if(_0x12cd90===0x191){_0x12cd90=0x190;}_0x585b43[_0xe805('0x18')](_0x12cd90)[_0xe805('0x7c')](_0xb40901['query'][_0xe805('0x78')]?{'message':_0xe805('0x7d'),'statusCode':_0xec64eb[_0xe805('0x79')]}:_0xec64eb);});}; \ No newline at end of file +var _0x56e7=['true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','substring','Connection','password','concat','isNil','ticketType','sobject','describe','ActivityDate','Subject','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value'];(function(_0x2a3753,_0x5368f4){var _0x2ff2f3=function(_0x97395a){while(--_0x97395a){_0x2a3753['push'](_0x2a3753['shift']());}};_0x2ff2f3(++_0x5368f4);}(_0x56e7,0x7b));var _0x756e=function(_0x299349,_0x4460fa){_0x299349=_0x299349-0x0;var _0x113f9d=_0x56e7[_0x299349];return _0x113f9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x756e('0x0'));var zipdir=require(_0x756e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x756e('0x2'));var moment=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var Mustache=require(_0x756e('0x5'));var util=require(_0x756e('0x6'));var path=require(_0x756e('0x7'));var sox=require(_0x756e('0x8'));var csv=require('to-csv');var ejs=require(_0x756e('0x9'));var fs=require('fs');var fs_extra=require(_0x756e('0xa'));var _=require(_0x756e('0xb'));var squel=require(_0x756e('0xc'));var crypto=require('crypto');var jsforce=require(_0x756e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x756e('0xe'));var querystring=require(_0x756e('0xf'));var Papa=require(_0x756e('0x10'));var Redis=require(_0x756e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x756e('0x12'));var hardwareService=require(_0x756e('0x13'));var logger=require(_0x756e('0x14'))('api');var utils=require(_0x756e('0x15'));var config=require(_0x756e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x756e('0x17'));function respondWithStatusCode(_0x569e8f,_0x459237){_0x459237=_0x459237||0xcc;return function(_0x21701a){if(_0x21701a){return _0x569e8f[_0x756e('0x18')](_0x459237);}return _0x569e8f[_0x756e('0x19')](_0x459237)[_0x756e('0x1a')]();};}function respondWithResult(_0x4ae32a,_0x4b3660){_0x4b3660=_0x4b3660||0xc8;return function(_0x36de2a){if(_0x36de2a){return _0x4ae32a[_0x756e('0x19')](_0x4b3660)[_0x756e('0x1b')](_0x36de2a);}};}function respondWithFilteredResult(_0x59956f,_0x530e36){return function(_0x1f7161){if(_0x1f7161){var _0x33dd9c=typeof _0x530e36[_0x756e('0x1c')]===_0x756e('0x1d')&&typeof _0x530e36[_0x756e('0x1e')]===_0x756e('0x1d');var _0x124ac0=_0x1f7161[_0x756e('0x1f')];var _0xb17214=_0x33dd9c?0x0:_0x530e36['offset'];var _0x216ffd=_0x33dd9c?_0x1f7161['count']:_0x530e36['offset']+_0x530e36[_0x756e('0x1e')];var _0x28872e;if(_0x216ffd>=_0x124ac0){_0x216ffd=_0x124ac0;_0x28872e=0xc8;}else{_0x28872e=0xce;}_0x59956f[_0x756e('0x19')](_0x28872e);return _0x59956f[_0x756e('0x20')](_0x756e('0x21'),_0xb17214+'-'+_0x216ffd+'/'+_0x124ac0)[_0x756e('0x1b')](_0x1f7161);}return null;};}function patchUpdates(_0xb00195){return function(_0x27e1eb){try{jsonpatch[_0x756e('0x22')](_0x27e1eb,_0xb00195,!![]);}catch(_0x2c03dc){return BPromise[_0x756e('0x23')](_0x2c03dc);}return _0x27e1eb[_0x756e('0x24')]();};}function saveUpdates(_0x42173f,_0x24d4ad){return function(_0x4088f5){if(_0x4088f5){return _0x4088f5[_0x756e('0x25')](_0x42173f)['then'](function(_0x335523){return _0x335523;});}return null;};}function removeEntity(_0x4b38b4,_0x256dc1){return function(_0x4152bd){if(_0x4152bd){return _0x4152bd[_0x756e('0x26')]()[_0x756e('0x27')](function(){_0x4b38b4['status'](0xcc)[_0x756e('0x1a')]();});}};}function handleEntityNotFound(_0x4cbd7,_0x2f4db8){return function(_0x48638d){if(!_0x48638d){_0x4cbd7[_0x756e('0x18')](0x194);}return _0x48638d;};}function handleError(_0x44f8f9,_0x29dffb){_0x29dffb=_0x29dffb||0x1f4;return function(_0x555912){logger[_0x756e('0x28')](_0x555912[_0x756e('0x29')]);if(_0x555912['name']){delete _0x555912[_0x756e('0x2a')];}_0x44f8f9[_0x756e('0x19')](_0x29dffb)[_0x756e('0x2b')](_0x555912);};}exports['index']=function(_0x3c332e,_0x308153){var _0x5c6949={},_0x20543c={},_0x2a7fdb={'count':0x0,'rows':[]};var _0x5be7b5=_[_0x756e('0x2c')](db[_0x756e('0x2d')][_0x756e('0x2e')],function(_0x80a978){return{'name':_0x80a978[_0x756e('0x2f')],'type':_0x80a978['type'][_0x756e('0x30')]};});_0x20543c['model']=_['map'](_0x5be7b5,_0x756e('0x2a'));_0x20543c['query']=_[_0x756e('0x31')](_0x3c332e[_0x756e('0x32')]);_0x20543c[_0x756e('0x33')]=_[_0x756e('0x34')](_0x20543c[_0x756e('0x35')],_0x20543c[_0x756e('0x32')]);_0x5c6949[_0x756e('0x36')]=_[_0x756e('0x34')](_0x20543c[_0x756e('0x35')],qs[_0x756e('0x37')](_0x3c332e[_0x756e('0x32')][_0x756e('0x37')]));_0x5c6949['attributes']=_0x5c6949['attributes'][_0x756e('0x38')]?_0x5c6949[_0x756e('0x36')]:_0x20543c[_0x756e('0x35')];if(!_0x3c332e[_0x756e('0x32')][_0x756e('0x39')](_0x756e('0x3a'))){_0x5c6949[_0x756e('0x1e')]=qs['limit'](_0x3c332e['query']['limit']);_0x5c6949[_0x756e('0x1c')]=qs[_0x756e('0x1c')](_0x3c332e[_0x756e('0x32')]['offset']);}_0x5c6949[_0x756e('0x3b')]=qs[_0x756e('0x3c')](_0x3c332e['query'][_0x756e('0x3c')]);_0x5c6949[_0x756e('0x3d')]=qs[_0x756e('0x33')](_[_0x756e('0x3e')](_0x3c332e[_0x756e('0x32')],_0x20543c[_0x756e('0x33')]),_0x5be7b5);if(_0x3c332e[_0x756e('0x32')][_0x756e('0x3f')]){_0x5c6949['where']=_[_0x756e('0x40')](_0x5c6949[_0x756e('0x3d')],{'$or':_[_0x756e('0x2c')](_0x5be7b5,function(_0x164a55){if(_0x164a55[_0x756e('0x41')]!==_0x756e('0x42')){var _0x20d16c={};_0x20d16c[_0x164a55[_0x756e('0x2a')]]={'$like':'%'+_0x3c332e[_0x756e('0x32')][_0x756e('0x3f')]+'%'};return _0x20d16c;}})});}_0x5c6949=_['merge']({},_0x5c6949,_0x3c332e[_0x756e('0x43')]);var _0x38274c={'where':_0x5c6949['where']};return db[_0x756e('0x2d')][_0x756e('0x1f')](_0x38274c)[_0x756e('0x27')](function(_0x57a93f){_0x2a7fdb[_0x756e('0x1f')]=_0x57a93f;if(_0x3c332e[_0x756e('0x32')][_0x756e('0x44')]){_0x5c6949['include']=[{'all':!![]}];}return db[_0x756e('0x2d')][_0x756e('0x45')](_0x5c6949);})[_0x756e('0x27')](function(_0x1fc45c){_0x2a7fdb[_0x756e('0x46')]=_0x1fc45c;return _0x2a7fdb;})[_0x756e('0x27')](respondWithFilteredResult(_0x308153,_0x5c6949))['catch'](handleError(_0x308153,null));};exports[_0x756e('0x47')]=function(_0x2b593d,_0x5c471e){var _0xa031fb={'raw':![],'where':{'id':_0x2b593d[_0x756e('0x48')]['id']}},_0x4291b5={};_0x4291b5[_0x756e('0x35')]=_[_0x756e('0x31')](db[_0x756e('0x2d')][_0x756e('0x2e')]);_0x4291b5[_0x756e('0x32')]=_[_0x756e('0x31')](_0x2b593d['query']);_0x4291b5[_0x756e('0x33')]=_['intersection'](_0x4291b5[_0x756e('0x35')],_0x4291b5[_0x756e('0x32')]);_0xa031fb[_0x756e('0x36')]=_['intersection'](_0x4291b5[_0x756e('0x35')],qs[_0x756e('0x37')](_0x2b593d[_0x756e('0x32')]['fields']));_0xa031fb['attributes']=_0xa031fb[_0x756e('0x36')][_0x756e('0x38')]?_0xa031fb['attributes']:_0x4291b5['model'];if(_0x2b593d[_0x756e('0x32')][_0x756e('0x44')]){_0xa031fb[_0x756e('0x49')]=[{'all':!![]}];}_0xa031fb=_['merge']({},_0xa031fb,_0x2b593d[_0x756e('0x43')]);return db['SalesforceAccount'][_0x756e('0x4a')](_0xa031fb)[_0x756e('0x27')](handleEntityNotFound(_0x5c471e,null))[_0x756e('0x27')](respondWithResult(_0x5c471e,null))['catch'](handleError(_0x5c471e,null));};exports[_0x756e('0x4b')]=function(_0x5224f2,_0x5064a3){return db[_0x756e('0x2d')]['create'](_0x5224f2[_0x756e('0x4c')],{})[_0x756e('0x27')](respondWithResult(_0x5064a3,0xc9))[_0x756e('0x4d')](handleError(_0x5064a3,null));};exports[_0x756e('0x25')]=function(_0x95061c,_0x2fb384){if(_0x95061c['body']['id']){delete _0x95061c[_0x756e('0x4c')]['id'];}return db['SalesforceAccount'][_0x756e('0x4a')]({'where':{'id':_0x95061c['params']['id']}})[_0x756e('0x27')](handleEntityNotFound(_0x2fb384,null))['then'](saveUpdates(_0x95061c[_0x756e('0x4c')],null))['then'](respondWithResult(_0x2fb384,null))[_0x756e('0x4d')](handleError(_0x2fb384,null));};exports[_0x756e('0x26')]=function(_0x27a201,_0x52c976){return db[_0x756e('0x2d')][_0x756e('0x4a')]({'where':{'id':_0x27a201['params']['id']}})['then'](handleEntityNotFound(_0x52c976,null))[_0x756e('0x27')](removeEntity(_0x52c976,null))[_0x756e('0x4d')](handleError(_0x52c976,null));};exports[_0x756e('0x4e')]=function(_0x2ef29e,_0x3d78a8,_0x2197ec){var _0x435729={};var _0x9e8559={};var _0x33f923;var _0x5275f4;return db[_0x756e('0x2d')][_0x756e('0x4f')]({'where':{'id':_0x2ef29e[_0x756e('0x48')]['id']}})[_0x756e('0x27')](handleEntityNotFound(_0x3d78a8,null))[_0x756e('0x27')](function(_0x36eb30){if(_0x36eb30){_0x33f923=_0x36eb30;_0x9e8559[_0x756e('0x35')]=_[_0x756e('0x31')](db['SalesforceConfiguration'][_0x756e('0x2e')]);_0x9e8559[_0x756e('0x32')]=_['keys'](_0x2ef29e[_0x756e('0x32')]);_0x9e8559['filters']=_[_0x756e('0x34')](_0x9e8559[_0x756e('0x35')],_0x9e8559[_0x756e('0x32')]);_0x435729['attributes']=_[_0x756e('0x34')](_0x9e8559[_0x756e('0x35')],qs[_0x756e('0x37')](_0x2ef29e['query'][_0x756e('0x37')]));_0x435729['attributes']=_0x435729[_0x756e('0x36')][_0x756e('0x38')]?_0x435729[_0x756e('0x36')]:_0x9e8559[_0x756e('0x35')];_0x435729[_0x756e('0x3b')]=qs[_0x756e('0x3c')](_0x2ef29e[_0x756e('0x32')][_0x756e('0x3c')]);_0x435729['where']=qs[_0x756e('0x33')](_[_0x756e('0x3e')](_0x2ef29e[_0x756e('0x32')],_0x9e8559[_0x756e('0x33')]));if(_0x2ef29e[_0x756e('0x32')][_0x756e('0x3f')]){_0x435729[_0x756e('0x3d')]=_[_0x756e('0x40')](_0x435729[_0x756e('0x3d')],{'$or':_[_0x756e('0x2c')](_0x435729[_0x756e('0x36')],function(_0x176d84){var _0x11e8cd={};_0x11e8cd[_0x176d84]={'$like':'%'+_0x2ef29e[_0x756e('0x32')]['filter']+'%'};return _0x11e8cd;})});}_0x435729=_[_0x756e('0x40')]({},_0x435729,_0x2ef29e[_0x756e('0x43')]);return _0x33f923[_0x756e('0x4e')](_0x435729);}})[_0x756e('0x27')](function(_0x674b74){if(_0x674b74){_0x5275f4=_0x674b74[_0x756e('0x38')];if(!_0x2ef29e['query'][_0x756e('0x39')](_0x756e('0x3a'))){_0x435729[_0x756e('0x1e')]=qs[_0x756e('0x1e')](_0x2ef29e['query']['limit']);_0x435729[_0x756e('0x1c')]=qs[_0x756e('0x1c')](_0x2ef29e[_0x756e('0x32')][_0x756e('0x1c')]);}return _0x33f923['getConfigurations'](_0x435729);}})[_0x756e('0x27')](function(_0x312715){if(_0x312715){return _0x312715?{'count':_0x5275f4,'rows':_0x312715}:null;}})[_0x756e('0x27')](respondWithResult(_0x3d78a8,null))[_0x756e('0x4d')](handleError(_0x3d78a8,null));};exports['addConfiguration']=function(_0x5c580b,_0x207228,_0x2eefd8){if(_0x5c580b[_0x756e('0x4c')]['id']){delete _0x5c580b[_0x756e('0x4c')]['id'];}return db[_0x756e('0x2d')][_0x756e('0x4f')]({'where':{'id':_0x5c580b[_0x756e('0x48')]['id']}})[_0x756e('0x27')](handleEntityNotFound(_0x207228,null))['then'](function(_0x5bd7f3){if(_0x5bd7f3){_0x5c580b[_0x756e('0x4c')][_0x756e('0x50')]=_0x5bd7f3['id'];_0x5c580b[_0x756e('0x4c')][_0x756e('0x51')]=integrations[_0x756e('0x52')](_0x5c580b[_0x756e('0x4c')][_0x756e('0x53')],_0x5c580b['body'][_0x756e('0x41')]);_0x5c580b['body'][_0x756e('0x54')]=integrations['getDescriptions'](_0x5c580b[_0x756e('0x4c')][_0x756e('0x53')],_0x5c580b[_0x756e('0x4c')]['type']);return db[_0x756e('0x55')][_0x756e('0x4b')](_0x5c580b[_0x756e('0x4c')],{'include':[{'model':db[_0x756e('0x56')],'as':_0x756e('0x51')},{'model':db[_0x756e('0x56')],'as':_0x756e('0x54')}]});}return null;})['then'](respondWithResult(_0x207228,null))['catch'](handleError(_0x207228,null));};exports[_0x756e('0x57')]=function(_0x1a2f9f,_0x3445ef,_0x463397){var _0x2c4dc5;var _0x2a5cf7='';var _0x58f8ec=_0x756e('0x58');return db[_0x756e('0x2d')][_0x756e('0x4f')]({'where':{'id':_0x1a2f9f[_0x756e('0x48')]['id']},'attributes':['id',_0x756e('0x59'),_0x756e('0x5a'),_0x756e('0x5b'),_0x756e('0x5c'),'password',_0x756e('0x5d')]})[_0x756e('0x27')](handleEntityNotFound(_0x3445ef,null))[_0x756e('0x27')](function(_0x250899){if(_0x250899){_0x2a5cf7=_0x250899[_0x756e('0x59')];var _0x582721=_0x2a5cf7['slice'](-0x1);if(_0x582721==='/'){_0x2a5cf7=_0x2a5cf7[_0x756e('0x5e')](0x0,_0x2a5cf7['lastIndexOf'](_0x582721));}_0x2c4dc5=new jsforce[(_0x756e('0x5f'))]({'oauth2':{'loginUrl':_0x2a5cf7,'clientId':_0x250899['clientId'],'clientSecret':_0x250899[_0x756e('0x5b')]}});return _0x2c4dc5['login'](_0x250899[_0x756e('0x5c')],_0x250899[_0x756e('0x60')][_0x756e('0x61')](_0x250899['securityToken']));}})[_0x756e('0x27')](function(_0x49766a){if(_0x49766a){if(!_[_0x756e('0x62')](_0x1a2f9f[_0x756e('0x32')][_0x756e('0x63')])){_0x58f8ec=_0x1a2f9f[_0x756e('0x32')][_0x756e('0x63')];}return _0x2c4dc5[_0x756e('0x64')](_0x58f8ec)[_0x756e('0x65')]();}})['then'](function(_0xe3e3b6){var _0x1a07c6=['OwnerId',_0x756e('0x66'),'IsReminderSet','IsRecurrence',_0x756e('0x67'),'Description'];var _0x34a884=['string',_0x756e('0x68'),'picklist',_0x756e('0x69'),_0x756e('0x6a'),_0x756e('0x6b'),_0x756e('0x6c')];if(_0xe3e3b6){_[_0x756e('0x6d')](_0xe3e3b6[_0x756e('0x37')],function(_0xd14720){return _0x1a07c6[_0x756e('0x6e')](_0xd14720[_0x756e('0x2a')])||!_0x34a884[_0x756e('0x6e')](_0xd14720[_0x756e('0x41')]);});return{'count':_0xe3e3b6[_0x756e('0x37')][_0x756e('0x38')],'rows':_['map'](_0xe3e3b6['fields'],function(_0x45d212){return{'id':_0x45d212[_0x756e('0x2a')],'name':_0x45d212[_0x756e('0x6f')],'custom':_0x45d212[_0x756e('0x70')],'options':_0x45d212[_0x756e('0x71')][_0x756e('0x38')]>0x0?_[_0x756e('0x2c')](_0x45d212['picklistValues'],function(_0x2950f8){return{'name':_0x2950f8[_0x756e('0x6f')],'value':_0x2950f8[_0x756e('0x72')]};}):_0x45d212[_0x756e('0x41')]==_0x756e('0x69')?[{'name':'True','value':_0x756e('0x73')},{'name':'False','value':'false'}]:[]};})};}})[_0x756e('0x27')](respondWithResult(_0x3445ef,null))['catch'](function(_0x863f9){var _0x1d5cc3=_0x1a2f9f['query'][_0x756e('0x74')]?0x1f4:_0x863f9[_0x756e('0x75')]||0x1f4;logger[_0x756e('0x28')](_0x756e('0x76'),_0x756e('0x57'),_0x1d5cc3,JSON['stringify'](_0x863f9));delete _0x863f9[_0x756e('0x2a')];if(_0x1d5cc3===0x191){_0x1d5cc3=0x190;}_0x3445ef[_0x756e('0x19')](_0x1d5cc3)[_0x756e('0x2b')](_0x1a2f9f[_0x756e('0x32')][_0x756e('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x863f9['statusCode']}:_0x863f9);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6dd2581..3e68652 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 _0x05bf=['rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x05bf,0x77));var _0xf05b=function(_0x368ef0,_0x1e6b25){_0x368ef0=_0x368ef0-0x0;var _0x37e026=_0x05bf[_0x368ef0];return _0x37e026;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var logger=require(_0xf05b('0x2'))(_0xf05b('0x3'));var moment=require(_0xf05b('0x4'));var BPromise=require(_0xf05b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf05b('0x6'));var rimraf=require(_0xf05b('0x7'));var config=require(_0xf05b('0x8'));var attributes=require(_0xf05b('0x9'));var integrations=require(_0xf05b('0xa'));module[_0xf05b('0xb')]=function(_0x3ce13e,_0x574ba2){return _0x3ce13e[_0xf05b('0xc')]('SalesforceAccount',attributes,{'tableName':_0xf05b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8cf=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','define','util','../../config/logger','api','moment'];(function(_0x50a91a,_0x516a42){var _0x187a70=function(_0x418945){while(--_0x418945){_0x50a91a['push'](_0x50a91a['shift']());}};_0x187a70(++_0x516a42);}(_0xe8cf,0x16e));var _0xfe8c=function(_0x284c4a,_0x314b94){_0x284c4a=_0x284c4a-0x0;var _0x1e94ce=_0xe8cf[_0x284c4a];return _0x1e94ce;};'use strict';var _=require('lodash');var util=require(_0xfe8c('0x0'));var logger=require(_0xfe8c('0x1'))(_0xfe8c('0x2'));var moment=require(_0xfe8c('0x3'));var BPromise=require(_0xfe8c('0x4'));var rp=require(_0xfe8c('0x5'));var fs=require('fs');var path=require(_0xfe8c('0x6'));var rimraf=require(_0xfe8c('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xfe8c('0x8'));module['exports']=function(_0xb5ce37,_0x26f726){return _0xb5ce37[_0xfe8c('0x9')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 0b10d98..6416335 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 _0xe67e=['ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe67e,0x1ca));var _0xee67=function(_0x94b853,_0x28399b){_0x94b853=_0x94b853-0x0;var _0x17a9c0=_0xe67e[_0x94b853];return _0x17a9c0;};'use strict';var _=require(_0xee67('0x0'));var util=require(_0xee67('0x1'));var moment=require(_0xee67('0x2'));var BPromise=require('bluebird');var rs=require(_0xee67('0x3'));var fs=require('fs');var Redis=require(_0xee67('0x4'));var db=require(_0xee67('0x5'))['db'];var utils=require(_0xee67('0x6'));var logger=require(_0xee67('0x7'))(_0xee67('0x8'));var config=require(_0xee67('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xee67('0xa')][_0xee67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e41fa,_0x34c7cb,_0x4b9c74){return new BPromise(function(_0x4ae5d4,_0x177664){return client[_0xee67('0xc')](_0x3e41fa,_0x4b9c74)['then'](function(_0x22289a){logger[_0xee67('0xd')](_0xee67('0xe'),_0x34c7cb,_0xee67('0xf'));logger['debug'](_0xee67('0x10'),_0x34c7cb,_0xee67('0xf'),JSON[_0xee67('0x11')](_0x22289a));if(_0x22289a[_0xee67('0x12')]){if(_0x22289a[_0xee67('0x12')][_0xee67('0x13')]===0x1f4){logger[_0xee67('0x12')](_0xee67('0xe'),_0x34c7cb,_0x22289a[_0xee67('0x12')][_0xee67('0x14')]);return _0x177664(_0x22289a['error'][_0xee67('0x14')]);}logger[_0xee67('0x12')](_0xee67('0xe'),_0x34c7cb,_0x22289a[_0xee67('0x12')][_0xee67('0x14')]);return _0x4ae5d4(_0x22289a[_0xee67('0x12')][_0xee67('0x14')]);}else{logger['info'](_0xee67('0xe'),_0x34c7cb,_0xee67('0xf'));_0x4ae5d4(_0x22289a[_0xee67('0x15')]['message']);}})[_0xee67('0x16')](function(_0x5295b9){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x34c7cb,_0x5295b9);_0x177664(_0x5295b9);});});}exports[_0xee67('0x17')]=function(_0x2f6b37){var _0x9aac53=this;return new Promise(function(_0x271959,_0x28a69a){return db[_0xee67('0x18')][_0xee67('0x19')]({'raw':_0x2f6b37[_0xee67('0x1a')]?_0x2f6b37[_0xee67('0x1a')][_0xee67('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f6b37[_0xee67('0x1a')]?_0x2f6b37[_0xee67('0x1a')][_0xee67('0x1c')]||null:null,'attributes':_0x2f6b37[_0xee67('0x1a')]?_0x2f6b37[_0xee67('0x1a')]['attributes']||null:null,'limit':_0x2f6b37[_0xee67('0x1a')]?_0x2f6b37[_0xee67('0x1a')][_0xee67('0x1d')]||null:null,'include':_0x2f6b37[_0xee67('0x1a')]?_0x2f6b37[_0xee67('0x1a')][_0xee67('0x1e')]?_[_0xee67('0x1f')](_0x2f6b37[_0xee67('0x1a')][_0xee67('0x1e')],function(_0x2efe16){return{'model':db[_0x2efe16[_0xee67('0x20')]],'as':_0x2efe16['as'],'attributes':_0x2efe16[_0xee67('0x21')],'include':_0x2efe16[_0xee67('0x1e')]?_[_0xee67('0x1f')](_0x2efe16[_0xee67('0x1e')],function(_0x10f01b){return{'model':db[_0x10f01b[_0xee67('0x20')]],'as':_0x10f01b['as'],'attributes':_0x10f01b[_0xee67('0x21')],'include':_0x10f01b[_0xee67('0x1e')]?_[_0xee67('0x1f')](_0x10f01b[_0xee67('0x1e')],function(_0x596d92){return{'model':db[_0x596d92[_0xee67('0x20')]],'as':_0x596d92['as'],'attributes':_0x596d92[_0xee67('0x21')]};}):[]};}):[]};}):[]:[]})[_0xee67('0x22')](function(_0x3fd22d){logger[_0xee67('0xd')](_0xee67('0x17'),_0x2f6b37);logger[_0xee67('0x23')](_0xee67('0x17'),_0x2f6b37,JSON[_0xee67('0x11')](_0x3fd22d));_0x271959(_0x3fd22d);})[_0xee67('0x16')](function(_0x52b3fb){logger[_0xee67('0x12')](_0xee67('0x17'),_0x52b3fb[_0xee67('0x14')],_0x2f6b37);_0x28a69a(_0x9aac53[_0xee67('0x12')](0x1f4,_0x52b3fb[_0xee67('0x14')]));});});};exports[_0xee67('0x24')]=function(_0x590d63){var _0x2a65f5=this;return new Promise(function(_0x5f2e67,_0x3d2108){return db['SalesforceAccount'][_0xee67('0x25')]({'raw':_0x590d63[_0xee67('0x1a')]?_0x590d63[_0xee67('0x1a')][_0xee67('0x1b')]===undefined?!![]:![]:!![],'where':_0x590d63[_0xee67('0x1a')]?_0x590d63[_0xee67('0x1a')][_0xee67('0x1c')]||null:null,'attributes':_0x590d63[_0xee67('0x1a')]?_0x590d63[_0xee67('0x1a')][_0xee67('0x21')]||null:null,'include':_0x590d63[_0xee67('0x1a')]?_0x590d63[_0xee67('0x1a')]['include']?_[_0xee67('0x1f')](_0x590d63[_0xee67('0x1a')]['include'],function(_0x34411f){return{'model':db[_0x34411f[_0xee67('0x20')]],'as':_0x34411f['as'],'attributes':_0x34411f['attributes'],'include':_0x34411f[_0xee67('0x1e')]?_[_0xee67('0x1f')](_0x34411f[_0xee67('0x1e')],function(_0x46c68d){return{'model':db[_0x46c68d[_0xee67('0x20')]],'as':_0x46c68d['as'],'attributes':_0x46c68d['attributes'],'include':_0x46c68d[_0xee67('0x1e')]?_[_0xee67('0x1f')](_0x46c68d[_0xee67('0x1e')],function(_0x4df566){return{'model':db[_0x4df566[_0xee67('0x20')]],'as':_0x4df566['as'],'attributes':_0x4df566['attributes']};}):[]};}):[]};}):[]:[]})[_0xee67('0x22')](function(_0x564dab){logger[_0xee67('0xd')](_0xee67('0x24'),_0x590d63);logger['debug'](_0xee67('0x24'),_0x590d63,JSON[_0xee67('0x11')](_0x564dab));_0x5f2e67(_0x564dab);})[_0xee67('0x16')](function(_0x583deb){logger[_0xee67('0x12')]('ShowSalesforceAccount',_0x583deb[_0xee67('0x14')],_0x590d63);_0x3d2108(_0x2a65f5[_0xee67('0x12')](0x1f4,_0x583deb[_0xee67('0x14')]));});});}; \ No newline at end of file +var _0xa6d4=['then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceAccount,\x20%s,\x20%s','request\x20sent','result','catch','SalesforceAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x182870,_0x5b19bd){var _0x5d6517=function(_0x4edd9e){while(--_0x4edd9e){_0x182870['push'](_0x182870['shift']());}};_0x5d6517(++_0x5b19bd);}(_0xa6d4,0x1dd));var _0x4a6d=function(_0x4e89b3,_0x54d80b){_0x4e89b3=_0x4e89b3-0x0;var _0x139d2a=_0xa6d4[_0x4e89b3];return _0x139d2a;};'use strict';var _=require('lodash');var util=require(_0x4a6d('0x0'));var moment=require(_0x4a6d('0x1'));var BPromise=require(_0x4a6d('0x2'));var rs=require(_0x4a6d('0x3'));var fs=require('fs');var Redis=require(_0x4a6d('0x4'));var db=require(_0x4a6d('0x5'))['db'];var utils=require(_0x4a6d('0x6'));var logger=require(_0x4a6d('0x7'))(_0x4a6d('0x8'));var config=require(_0x4a6d('0x9'));var jayson=require(_0x4a6d('0xa'));var client=jayson['client'][_0x4a6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x347915,_0x58c727,_0x52476c){return new BPromise(function(_0x59f5b8,_0x509e71){return client[_0x4a6d('0xc')](_0x347915,_0x52476c)[_0x4a6d('0xd')](function(_0x5409ca){logger[_0x4a6d('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x58c727,'request\x20sent');logger[_0x4a6d('0xf')](_0x4a6d('0x10'),_0x58c727,'request\x20sent',JSON[_0x4a6d('0x11')](_0x5409ca));if(_0x5409ca['error']){if(_0x5409ca[_0x4a6d('0x12')]['code']===0x1f4){logger[_0x4a6d('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x58c727,_0x5409ca[_0x4a6d('0x12')][_0x4a6d('0x13')]);return _0x509e71(_0x5409ca[_0x4a6d('0x12')][_0x4a6d('0x13')]);}logger[_0x4a6d('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x58c727,_0x5409ca['error'][_0x4a6d('0x13')]);return _0x59f5b8(_0x5409ca[_0x4a6d('0x12')]['message']);}else{logger[_0x4a6d('0xe')](_0x4a6d('0x14'),_0x58c727,_0x4a6d('0x15'));_0x59f5b8(_0x5409ca[_0x4a6d('0x16')]['message']);}})[_0x4a6d('0x17')](function(_0x130689){logger['error'](_0x4a6d('0x14'),_0x58c727,_0x130689);_0x509e71(_0x130689);});});}exports['GetSalesforceAccount']=function(_0x3d8632){var _0x936115=this;return new Promise(function(_0x13a24a,_0x4ed57c){return db[_0x4a6d('0x18')][_0x4a6d('0x19')]({'raw':_0x3d8632[_0x4a6d('0x1a')]?_0x3d8632[_0x4a6d('0x1a')][_0x4a6d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d8632[_0x4a6d('0x1a')]?_0x3d8632[_0x4a6d('0x1a')][_0x4a6d('0x1c')]||null:null,'attributes':_0x3d8632[_0x4a6d('0x1a')]?_0x3d8632[_0x4a6d('0x1a')]['attributes']||null:null,'limit':_0x3d8632[_0x4a6d('0x1a')]?_0x3d8632[_0x4a6d('0x1a')][_0x4a6d('0x1d')]||null:null,'include':_0x3d8632[_0x4a6d('0x1a')]?_0x3d8632[_0x4a6d('0x1a')]['include']?_['map'](_0x3d8632[_0x4a6d('0x1a')][_0x4a6d('0x1e')],function(_0x16a4e6){return{'model':db[_0x16a4e6[_0x4a6d('0x1f')]],'as':_0x16a4e6['as'],'attributes':_0x16a4e6[_0x4a6d('0x20')],'include':_0x16a4e6[_0x4a6d('0x1e')]?_[_0x4a6d('0x21')](_0x16a4e6[_0x4a6d('0x1e')],function(_0x487734){return{'model':db[_0x487734['model']],'as':_0x487734['as'],'attributes':_0x487734[_0x4a6d('0x20')],'include':_0x487734['include']?_[_0x4a6d('0x21')](_0x487734[_0x4a6d('0x1e')],function(_0x55a074){return{'model':db[_0x55a074[_0x4a6d('0x1f')]],'as':_0x55a074['as'],'attributes':_0x55a074[_0x4a6d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af6e4){logger[_0x4a6d('0xe')]('GetSalesforceAccount',_0x3d8632);logger[_0x4a6d('0xf')]('GetSalesforceAccount',_0x3d8632,JSON[_0x4a6d('0x11')](_0x1af6e4));_0x13a24a(_0x1af6e4);})[_0x4a6d('0x17')](function(_0x55f206){logger[_0x4a6d('0x12')]('GetSalesforceAccount',_0x55f206[_0x4a6d('0x13')],_0x3d8632);_0x4ed57c(_0x936115['error'](0x1f4,_0x55f206[_0x4a6d('0x13')]));});});};exports[_0x4a6d('0x22')]=function(_0x435500){var _0x284667=this;return new Promise(function(_0x4f90b7,_0x3bb779){return db[_0x4a6d('0x18')]['find']({'raw':_0x435500[_0x4a6d('0x1a')]?_0x435500[_0x4a6d('0x1a')][_0x4a6d('0x1b')]===undefined?!![]:![]:!![],'where':_0x435500['options']?_0x435500[_0x4a6d('0x1a')][_0x4a6d('0x1c')]||null:null,'attributes':_0x435500[_0x4a6d('0x1a')]?_0x435500[_0x4a6d('0x1a')][_0x4a6d('0x20')]||null:null,'include':_0x435500['options']?_0x435500[_0x4a6d('0x1a')][_0x4a6d('0x1e')]?_[_0x4a6d('0x21')](_0x435500[_0x4a6d('0x1a')][_0x4a6d('0x1e')],function(_0x5aa558){return{'model':db[_0x5aa558[_0x4a6d('0x1f')]],'as':_0x5aa558['as'],'attributes':_0x5aa558[_0x4a6d('0x20')],'include':_0x5aa558[_0x4a6d('0x1e')]?_[_0x4a6d('0x21')](_0x5aa558[_0x4a6d('0x1e')],function(_0x48f433){return{'model':db[_0x48f433[_0x4a6d('0x1f')]],'as':_0x48f433['as'],'attributes':_0x48f433['attributes'],'include':_0x48f433[_0x4a6d('0x1e')]?_[_0x4a6d('0x21')](_0x48f433['include'],function(_0x266ab8){return{'model':db[_0x266ab8[_0x4a6d('0x1f')]],'as':_0x266ab8['as'],'attributes':_0x266ab8[_0x4a6d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x85f595){logger[_0x4a6d('0xe')]('ShowSalesforceAccount',_0x435500);logger[_0x4a6d('0xf')](_0x4a6d('0x22'),_0x435500,JSON[_0x4a6d('0x11')](_0x85f595));_0x4f90b7(_0x85f595);})[_0x4a6d('0x17')](function(_0x2bb2e0){logger[_0x4a6d('0x12')](_0x4a6d('0x22'),_0x2bb2e0[_0x4a6d('0x13')],_0x435500);_0x3bb779(_0x284667[_0x4a6d('0x12')](0x1f4,_0x2bb2e0[_0x4a6d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 550cd0d..ca308d1 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x0b0e,0x187));var _0xe0b0=function(_0x318dda,_0x1aa800){_0x318dda=_0x318dda-0x0;var _0x3f97ca=_0x0b0e[_0x318dda];return _0x3f97ca;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x49fc6b,_0x4fdc6d){var _0xef191f=function(_0x37c6d7){while(--_0x37c6d7){_0x49fc6b['push'](_0x49fc6b['shift']());}};_0xef191f(++_0x4fdc6d);}(_0x7a54,0x106));var _0x47a5=function(_0x11888e,_0x98c128){_0x11888e=_0x11888e-0x0;var _0xc7fad7=_0x7a54[_0x11888e];return _0xc7fad7;};'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/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 749b54c..42f2d49 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 _0x6ffa=['Case','contact_lead','contact','lead','account_contact_lead','account','nothing','exports','STRING','ENUM','Task'];(function(_0x50cd9b,_0x3aa1c8){var _0x40940a=function(_0x23f235){while(--_0x23f235){_0x50cd9b['push'](_0x50cd9b['shift']());}};_0x40940a(++_0x3aa1c8);}(_0x6ffa,0x80));var _0xa6ff=function(_0x9b7394,_0x4bbf35){_0x9b7394=_0x9b7394-0x0;var _0x4e43fc=_0x6ffa[_0x9b7394];return _0x4e43fc;};'use strict';var Sequelize=require('sequelize');module[_0xa6ff('0x0')]={'name':{'type':Sequelize[_0xa6ff('0x1')]},'description':{'type':Sequelize[_0xa6ff('0x1')]},'ticketType':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'),_0xa6ff('0x4')),'defaultValue':_0xa6ff('0x3')},'moduleSearch':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x5'),_0xa6ff('0x6'),_0xa6ff('0x7'),_0xa6ff('0x8'),_0xa6ff('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0xa'),_0xa6ff('0x6'),_0xa6ff('0x7'),_0xa6ff('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xa6ff('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xa6ff('0x1')]}}; \ No newline at end of file +var _0xa61f=['lead','account_contact_lead','account','nothing','sequelize','exports','STRING','Case','Task','ENUM','contact_lead','contact'];(function(_0x22b35a,_0x30f124){var _0x493b6b=function(_0x103b69){while(--_0x103b69){_0x22b35a['push'](_0x22b35a['shift']());}};_0x493b6b(++_0x30f124);}(_0xa61f,0x1a8));var _0xfa61=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa61f[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xfa61('0x0'));module[_0xfa61('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfa61('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0xfa61('0x3')),'defaultValue':_0xfa61('0x4')},'moduleSearch':{'type':Sequelize[_0xfa61('0x5')](_0xfa61('0x6'),_0xfa61('0x7'),_0xfa61('0x8'),_0xfa61('0x9'),_0xfa61('0xa')),'defaultValue':_0xfa61('0x6')},'moduleCreate':{'type':Sequelize[_0xfa61('0x5')](_0xfa61('0xb'),_0xfa61('0x7'),_0xfa61('0x8'),_0xfa61('0xa')),'defaultValue':_0xfa61('0x8')},'leadId':{'type':Sequelize[_0xfa61('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xfa61('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b577109..1ac67a4 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 _0x73f4=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','SalesforceConfiguration','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','catch','show','params','options','create','find','getFields','SalesforceField','pick','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x3af3c8,_0x178c71){var _0x408be1=function(_0x224a5d){while(--_0x224a5d){_0x3af3c8['push'](_0x3af3c8['shift']());}};_0x408be1(++_0x178c71);}(_0x73f4,0xdc));var _0x473f=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x73f4[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require(_0x473f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x473f('0x1'));var jsonpatch=require(_0x473f('0x2'));var rp=require(_0x473f('0x3'));var moment=require('moment');var BPromise=require(_0x473f('0x4'));var Mustache=require(_0x473f('0x5'));var util=require(_0x473f('0x6'));var path=require('path');var sox=require(_0x473f('0x7'));var csv=require(_0x473f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x473f('0x9'));var _=require(_0x473f('0xa'));var squel=require('squel');var crypto=require(_0x473f('0xb'));var jsforce=require(_0x473f('0xc'));var deskjs=require(_0x473f('0xd'));var toCsv=require(_0x473f('0x8'));var querystring=require(_0x473f('0xe'));var Papa=require('papaparse');var Redis=require(_0x473f('0xf'));var authService=require(_0x473f('0x10'));var qs=require(_0x473f('0x11'));var as=require(_0x473f('0x12'));var hardwareService=require(_0x473f('0x13'));var logger=require(_0x473f('0x14'))(_0x473f('0x15'));var utils=require(_0x473f('0x16'));var config=require(_0x473f('0x17'));var licenseUtil=require(_0x473f('0x18'));var db=require(_0x473f('0x19'))['db'];function respondWithStatusCode(_0x434daa,_0x3617da){_0x3617da=_0x3617da||0xcc;return function(_0x325610){if(_0x325610){return _0x434daa[_0x473f('0x1a')](_0x3617da);}return _0x434daa['status'](_0x3617da)[_0x473f('0x1b')]();};}function respondWithResult(_0x13b334,_0x47ef96){_0x47ef96=_0x47ef96||0xc8;return function(_0x5a2e05){if(_0x5a2e05){return _0x13b334['status'](_0x47ef96)[_0x473f('0x1c')](_0x5a2e05);}};}function respondWithFilteredResult(_0x1f1aa8,_0x44c79a){return function(_0x4df9b0){if(_0x4df9b0){var _0x443c4c=typeof _0x44c79a[_0x473f('0x1d')]===_0x473f('0x1e')&&typeof _0x44c79a[_0x473f('0x1f')]===_0x473f('0x1e');var _0x532bfb=_0x4df9b0['count'];var _0x4e3c34=_0x443c4c?0x0:_0x44c79a[_0x473f('0x1d')];var _0x2fa6d9=_0x443c4c?_0x4df9b0['count']:_0x44c79a[_0x473f('0x1d')]+_0x44c79a['limit'];var _0x46bf43;if(_0x2fa6d9>=_0x532bfb){_0x2fa6d9=_0x532bfb;_0x46bf43=0xc8;}else{_0x46bf43=0xce;}_0x1f1aa8[_0x473f('0x20')](_0x46bf43);return _0x1f1aa8[_0x473f('0x21')](_0x473f('0x22'),_0x4e3c34+'-'+_0x2fa6d9+'/'+_0x532bfb)['json'](_0x4df9b0);}return null;};}function patchUpdates(_0xfee959){return function(_0x371697){try{jsonpatch[_0x473f('0x23')](_0x371697,_0xfee959,!![]);}catch(_0x56d8d0){return BPromise[_0x473f('0x24')](_0x56d8d0);}return _0x371697['save']();};}function saveUpdates(_0x7a0e5b,_0x13c1fc){return function(_0x58a0de){if(_0x58a0de){return _0x58a0de[_0x473f('0x25')](_0x7a0e5b)[_0x473f('0x26')](function(_0xee614e){return _0xee614e;});}return null;};}function removeEntity(_0x40a81f,_0x40c82c){return function(_0x55036c){if(_0x55036c){return _0x55036c[_0x473f('0x27')]()[_0x473f('0x26')](function(){_0x40a81f[_0x473f('0x20')](0xcc)[_0x473f('0x1b')]();});}};}function handleEntityNotFound(_0x31736d,_0x261a03){return function(_0x374817){if(!_0x374817){_0x31736d[_0x473f('0x1a')](0x194);}return _0x374817;};}function handleError(_0x3de295,_0x14350a){_0x14350a=_0x14350a||0x1f4;return function(_0xb24b2e){logger[_0x473f('0x28')](_0xb24b2e[_0x473f('0x29')]);if(_0xb24b2e[_0x473f('0x2a')]){delete _0xb24b2e[_0x473f('0x2a')];}_0x3de295['status'](_0x14350a)['send'](_0xb24b2e);};}exports['index']=function(_0xeae266,_0x31a050){var _0x2cff24={},_0x4c495b={},_0x377cd7={'count':0x0,'rows':[]};var _0x3aa81a=_[_0x473f('0x2b')](db[_0x473f('0x2c')][_0x473f('0x2d')],function(_0x49118f){return{'name':_0x49118f['fieldName'],'type':_0x49118f[_0x473f('0x2e')]['key']};});_0x4c495b[_0x473f('0x2f')]=_[_0x473f('0x2b')](_0x3aa81a,'name');_0x4c495b[_0x473f('0x30')]=_[_0x473f('0x31')](_0xeae266['query']);_0x4c495b[_0x473f('0x32')]=_['intersection'](_0x4c495b[_0x473f('0x2f')],_0x4c495b[_0x473f('0x30')]);_0x2cff24[_0x473f('0x33')]=_[_0x473f('0x34')](_0x4c495b[_0x473f('0x2f')],qs[_0x473f('0x35')](_0xeae266['query']['fields']));_0x2cff24[_0x473f('0x33')]=_0x2cff24[_0x473f('0x33')][_0x473f('0x36')]?_0x2cff24[_0x473f('0x33')]:_0x4c495b[_0x473f('0x2f')];if(!_0xeae266[_0x473f('0x30')][_0x473f('0x37')](_0x473f('0x38'))){_0x2cff24[_0x473f('0x1f')]=qs[_0x473f('0x1f')](_0xeae266[_0x473f('0x30')][_0x473f('0x1f')]);_0x2cff24['offset']=qs['offset'](_0xeae266[_0x473f('0x30')][_0x473f('0x1d')]);}_0x2cff24[_0x473f('0x39')]=qs[_0x473f('0x3a')](_0xeae266['query']['sort']);_0x2cff24[_0x473f('0x3b')]=qs[_0x473f('0x32')](_['pick'](_0xeae266['query'],_0x4c495b[_0x473f('0x32')]),_0x3aa81a);if(_0xeae266[_0x473f('0x30')][_0x473f('0x3c')]){_0x2cff24['where']=_[_0x473f('0x3d')](_0x2cff24[_0x473f('0x3b')],{'$or':_[_0x473f('0x2b')](_0x3aa81a,function(_0x1e74b6){if(_0x1e74b6[_0x473f('0x2e')]!==_0x473f('0x3e')){var _0x54a8ce={};_0x54a8ce[_0x1e74b6[_0x473f('0x2a')]]={'$like':'%'+_0xeae266[_0x473f('0x30')][_0x473f('0x3c')]+'%'};return _0x54a8ce;}})});}_0x2cff24=_[_0x473f('0x3d')]({},_0x2cff24,_0xeae266['options']);var _0x1077dd={'where':_0x2cff24['where']};return db[_0x473f('0x2c')][_0x473f('0x3f')](_0x1077dd)[_0x473f('0x26')](function(_0x71c7b6){_0x377cd7[_0x473f('0x3f')]=_0x71c7b6;if(_0xeae266[_0x473f('0x30')][_0x473f('0x40')]){_0x2cff24[_0x473f('0x41')]=[{'all':!![]}];}return db[_0x473f('0x2c')]['findAll'](_0x2cff24);})['then'](function(_0xe73f69){_0x377cd7['rows']=_0xe73f69;return _0x377cd7;})['then'](respondWithFilteredResult(_0x31a050,_0x2cff24))[_0x473f('0x42')](handleError(_0x31a050,null));};exports[_0x473f('0x43')]=function(_0xa6d3fa,_0x3e9b87){var _0x183a33={'raw':![],'where':{'id':_0xa6d3fa[_0x473f('0x44')]['id']}},_0x4dbbe0={};_0x4dbbe0[_0x473f('0x2f')]=_[_0x473f('0x31')](db[_0x473f('0x2c')][_0x473f('0x2d')]);_0x4dbbe0[_0x473f('0x30')]=_[_0x473f('0x31')](_0xa6d3fa['query']);_0x4dbbe0[_0x473f('0x32')]=_['intersection'](_0x4dbbe0[_0x473f('0x2f')],_0x4dbbe0[_0x473f('0x30')]);_0x183a33[_0x473f('0x33')]=_[_0x473f('0x34')](_0x4dbbe0[_0x473f('0x2f')],qs[_0x473f('0x35')](_0xa6d3fa[_0x473f('0x30')][_0x473f('0x35')]));_0x183a33[_0x473f('0x33')]=_0x183a33[_0x473f('0x33')][_0x473f('0x36')]?_0x183a33['attributes']:_0x4dbbe0[_0x473f('0x2f')];if(_0xa6d3fa[_0x473f('0x30')][_0x473f('0x40')]){_0x183a33[_0x473f('0x41')]=[{'all':!![]}];}_0x183a33=_[_0x473f('0x3d')]({},_0x183a33,_0xa6d3fa[_0x473f('0x45')]);return db[_0x473f('0x2c')]['find'](_0x183a33)['then'](handleEntityNotFound(_0x3e9b87,null))['then'](respondWithResult(_0x3e9b87,null))[_0x473f('0x42')](handleError(_0x3e9b87,null));};exports[_0x473f('0x46')]=function(_0x5df25f,_0x1a6377){return db['SalesforceConfiguration'][_0x473f('0x46')](_0x5df25f['body'],{})[_0x473f('0x26')](respondWithResult(_0x1a6377,0xc9))[_0x473f('0x42')](handleError(_0x1a6377,null));};exports[_0x473f('0x25')]=function(_0x2901c3,_0x2a5d01){if(_0x2901c3['body']['id']){delete _0x2901c3['body']['id'];}return db[_0x473f('0x2c')][_0x473f('0x47')]({'where':{'id':_0x2901c3['params']['id']}})[_0x473f('0x26')](handleEntityNotFound(_0x2a5d01,null))['then'](saveUpdates(_0x2901c3['body'],null))[_0x473f('0x26')](respondWithResult(_0x2a5d01,null))['catch'](handleError(_0x2a5d01,null));};exports[_0x473f('0x27')]=function(_0x144c23,_0x474d60){return db[_0x473f('0x2c')][_0x473f('0x47')]({'where':{'id':_0x144c23[_0x473f('0x44')]['id']}})[_0x473f('0x26')](handleEntityNotFound(_0x474d60,null))['then'](removeEntity(_0x474d60,null))[_0x473f('0x42')](handleError(_0x474d60,null));};exports[_0x473f('0x48')]=function(_0x431f32,_0x349733,_0x5b2705){var _0x5e597c={};var _0x47747e={};var _0x109f88;var _0x3d261d;return db[_0x473f('0x2c')]['findOne']({'where':{'id':_0x431f32[_0x473f('0x44')]['id']}})['then'](handleEntityNotFound(_0x349733,null))[_0x473f('0x26')](function(_0x2763f7){if(_0x2763f7){_0x109f88=_0x2763f7;_0x47747e[_0x473f('0x2f')]=_[_0x473f('0x31')](db[_0x473f('0x49')][_0x473f('0x2d')]);_0x47747e[_0x473f('0x30')]=_[_0x473f('0x31')](_0x431f32['query']);_0x47747e[_0x473f('0x32')]=_[_0x473f('0x34')](_0x47747e['model'],_0x47747e[_0x473f('0x30')]);_0x5e597c['attributes']=_[_0x473f('0x34')](_0x47747e[_0x473f('0x2f')],qs['fields'](_0x431f32[_0x473f('0x30')][_0x473f('0x35')]));_0x5e597c['attributes']=_0x5e597c['attributes']['length']?_0x5e597c[_0x473f('0x33')]:_0x47747e[_0x473f('0x2f')];_0x5e597c[_0x473f('0x39')]=qs['sort'](_0x431f32[_0x473f('0x30')]['sort']);_0x5e597c[_0x473f('0x3b')]=qs[_0x473f('0x32')](_[_0x473f('0x4a')](_0x431f32[_0x473f('0x30')],_0x47747e[_0x473f('0x32')]));if(_0x431f32[_0x473f('0x30')][_0x473f('0x3c')]){_0x5e597c[_0x473f('0x3b')]=_['merge'](_0x5e597c[_0x473f('0x3b')],{'$or':_[_0x473f('0x2b')](_0x5e597c[_0x473f('0x33')],function(_0x56b729){var _0x3136b={};_0x3136b[_0x56b729]={'$like':'%'+_0x431f32['query'][_0x473f('0x3c')]+'%'};return _0x3136b;})});}_0x5e597c=_[_0x473f('0x3d')]({},_0x5e597c,_0x431f32[_0x473f('0x45')]);return _0x109f88[_0x473f('0x48')](_0x5e597c);}})[_0x473f('0x26')](function(_0x200767){if(_0x200767){_0x3d261d=_0x200767[_0x473f('0x36')];if(!_0x431f32[_0x473f('0x30')]['hasOwnProperty'](_0x473f('0x38'))){_0x5e597c[_0x473f('0x1f')]=qs[_0x473f('0x1f')](_0x431f32[_0x473f('0x30')][_0x473f('0x1f')]);_0x5e597c[_0x473f('0x1d')]=qs[_0x473f('0x1d')](_0x431f32[_0x473f('0x30')][_0x473f('0x1d')]);}return _0x109f88[_0x473f('0x48')](_0x5e597c);}})[_0x473f('0x26')](function(_0x5f35de){if(_0x5f35de){return _0x5f35de?{'count':_0x3d261d,'rows':_0x5f35de}:null;}})['then'](respondWithResult(_0x349733,null))['catch'](handleError(_0x349733,null));};exports['getSubjects']=function(_0x46cece,_0x3342cf,_0x3815f7){var _0x5f3935={};var _0x20f78d={};var _0x880758;var _0x53fce7;return db[_0x473f('0x2c')]['findOne']({'where':{'id':_0x46cece[_0x473f('0x44')]['id']}})[_0x473f('0x26')](handleEntityNotFound(_0x3342cf,null))[_0x473f('0x26')](function(_0x43bd89){if(_0x43bd89){_0x880758=_0x43bd89;_0x20f78d['model']=_[_0x473f('0x31')](db[_0x473f('0x49')]['rawAttributes']);_0x20f78d[_0x473f('0x30')]=_['keys'](_0x46cece[_0x473f('0x30')]);_0x20f78d[_0x473f('0x32')]=_[_0x473f('0x34')](_0x20f78d[_0x473f('0x2f')],_0x20f78d['query']);_0x5f3935[_0x473f('0x33')]=_[_0x473f('0x34')](_0x20f78d[_0x473f('0x2f')],qs['fields'](_0x46cece[_0x473f('0x30')][_0x473f('0x35')]));_0x5f3935[_0x473f('0x33')]=_0x5f3935['attributes']['length']?_0x5f3935[_0x473f('0x33')]:_0x20f78d[_0x473f('0x2f')];_0x5f3935[_0x473f('0x39')]=qs[_0x473f('0x3a')](_0x46cece[_0x473f('0x30')][_0x473f('0x3a')]);_0x5f3935['where']=qs[_0x473f('0x32')](_[_0x473f('0x4a')](_0x46cece['query'],_0x20f78d[_0x473f('0x32')]));if(_0x46cece[_0x473f('0x30')][_0x473f('0x3c')]){_0x5f3935[_0x473f('0x3b')]=_[_0x473f('0x3d')](_0x5f3935[_0x473f('0x3b')],{'$or':_[_0x473f('0x2b')](_0x5f3935[_0x473f('0x33')],function(_0x649954){var _0x9a87a={};_0x9a87a[_0x649954]={'$like':'%'+_0x46cece[_0x473f('0x30')][_0x473f('0x3c')]+'%'};return _0x9a87a;})});}_0x5f3935=_[_0x473f('0x3d')]({},_0x5f3935,_0x46cece[_0x473f('0x45')]);return _0x880758['getSubjects'](_0x5f3935);}})[_0x473f('0x26')](function(_0x274be0){if(_0x274be0){_0x53fce7=_0x274be0[_0x473f('0x36')];if(!_0x46cece['query'][_0x473f('0x37')](_0x473f('0x38'))){_0x5f3935[_0x473f('0x1f')]=qs[_0x473f('0x1f')](_0x46cece[_0x473f('0x30')][_0x473f('0x1f')]);_0x5f3935['offset']=qs[_0x473f('0x1d')](_0x46cece['query'][_0x473f('0x1d')]);}return _0x880758['getSubjects'](_0x5f3935);}})[_0x473f('0x26')](function(_0x36dd4d){if(_0x36dd4d){return _0x36dd4d?{'count':_0x53fce7,'rows':_0x36dd4d}:null;}})[_0x473f('0x26')](respondWithResult(_0x3342cf,null))[_0x473f('0x42')](handleError(_0x3342cf,null));};exports[_0x473f('0x4b')]=function(_0x5bcefe,_0x54101b,_0x967e06){var _0x717715={};var _0x19af4f={};var _0x5e929d;var _0x5c6226;return db['SalesforceConfiguration'][_0x473f('0x4c')]({'where':{'id':_0x5bcefe[_0x473f('0x44')]['id']}})[_0x473f('0x26')](handleEntityNotFound(_0x54101b,null))[_0x473f('0x26')](function(_0x59fdc6){if(_0x59fdc6){_0x5e929d=_0x59fdc6;_0x19af4f[_0x473f('0x2f')]=_[_0x473f('0x31')](db[_0x473f('0x49')][_0x473f('0x2d')]);_0x19af4f[_0x473f('0x30')]=_[_0x473f('0x31')](_0x5bcefe['query']);_0x19af4f[_0x473f('0x32')]=_[_0x473f('0x34')](_0x19af4f[_0x473f('0x2f')],_0x19af4f['query']);_0x717715[_0x473f('0x33')]=_[_0x473f('0x34')](_0x19af4f['model'],qs['fields'](_0x5bcefe[_0x473f('0x30')][_0x473f('0x35')]));_0x717715[_0x473f('0x33')]=_0x717715['attributes'][_0x473f('0x36')]?_0x717715[_0x473f('0x33')]:_0x19af4f[_0x473f('0x2f')];_0x717715[_0x473f('0x39')]=qs['sort'](_0x5bcefe['query'][_0x473f('0x3a')]);_0x717715[_0x473f('0x3b')]=qs[_0x473f('0x32')](_['pick'](_0x5bcefe[_0x473f('0x30')],_0x19af4f[_0x473f('0x32')]));if(_0x5bcefe[_0x473f('0x30')][_0x473f('0x3c')]){_0x717715[_0x473f('0x3b')]=_['merge'](_0x717715['where'],{'$or':_[_0x473f('0x2b')](_0x717715['attributes'],function(_0x56f7b6){var _0x2e1307={};_0x2e1307[_0x56f7b6]={'$like':'%'+_0x5bcefe[_0x473f('0x30')]['filter']+'%'};return _0x2e1307;})});}_0x717715=_['merge']({},_0x717715,_0x5bcefe[_0x473f('0x45')]);return _0x5e929d['getDescriptions'](_0x717715);}})['then'](function(_0x1c13d5){if(_0x1c13d5){_0x5c6226=_0x1c13d5['length'];if(!_0x5bcefe[_0x473f('0x30')]['hasOwnProperty']('nolimit')){_0x717715[_0x473f('0x1f')]=qs[_0x473f('0x1f')](_0x5bcefe['query'][_0x473f('0x1f')]);_0x717715[_0x473f('0x1d')]=qs['offset'](_0x5bcefe['query'][_0x473f('0x1d')]);}return _0x5e929d[_0x473f('0x4b')](_0x717715);}})[_0x473f('0x26')](function(_0x530560){if(_0x530560){return _0x530560?{'count':_0x5c6226,'rows':_0x530560}:null;}})[_0x473f('0x26')](respondWithResult(_0x54101b,null))['catch'](handleError(_0x54101b,null));}; \ No newline at end of file +var _0xe671=['update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','order','where','filters','pick','filter','merge','type','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','findOne','sort','options','getFields','hasOwnProperty','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xe671,0x1be));var _0x1e67=function(_0x2001a1,_0x2e581f){_0x2001a1=_0x2001a1-0x0;var _0xc6b3d3=_0xe671[_0x2001a1];return _0xc6b3d3;};'use strict';var emlformat=require(_0x1e67('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1e67('0x1'));var rp=require(_0x1e67('0x2'));var moment=require(_0x1e67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1e67('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1e67('0x5'));var csv=require(_0x1e67('0x6'));var ejs=require(_0x1e67('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e67('0x8'));var squel=require(_0x1e67('0x9'));var crypto=require('crypto');var jsforce=require(_0x1e67('0xa'));var deskjs=require(_0x1e67('0xb'));var toCsv=require(_0x1e67('0x6'));var querystring=require(_0x1e67('0xc'));var Papa=require(_0x1e67('0xd'));var Redis=require(_0x1e67('0xe'));var authService=require(_0x1e67('0xf'));var qs=require(_0x1e67('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e67('0x11'));var logger=require(_0x1e67('0x12'))(_0x1e67('0x13'));var utils=require(_0x1e67('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1e67('0x15'));var db=require(_0x1e67('0x16'))['db'];function respondWithStatusCode(_0x1778db,_0x1110aa){_0x1110aa=_0x1110aa||0xcc;return function(_0x321434){if(_0x321434){return _0x1778db[_0x1e67('0x17')](_0x1110aa);}return _0x1778db[_0x1e67('0x18')](_0x1110aa)[_0x1e67('0x19')]();};}function respondWithResult(_0x160584,_0x54f0c0){_0x54f0c0=_0x54f0c0||0xc8;return function(_0xfd7c73){if(_0xfd7c73){return _0x160584[_0x1e67('0x18')](_0x54f0c0)['json'](_0xfd7c73);}};}function respondWithFilteredResult(_0x4e4af4,_0x6b9d){return function(_0x1a0a2a){if(_0x1a0a2a){var _0x2a07bf=typeof _0x6b9d[_0x1e67('0x1a')]==='undefined'&&typeof _0x6b9d['limit']===_0x1e67('0x1b');var _0x15a938=_0x1a0a2a['count'];var _0x355c0d=_0x2a07bf?0x0:_0x6b9d['offset'];var _0x1e5f9a=_0x2a07bf?_0x1a0a2a[_0x1e67('0x1c')]:_0x6b9d[_0x1e67('0x1a')]+_0x6b9d[_0x1e67('0x1d')];var _0x59e512;if(_0x1e5f9a>=_0x15a938){_0x1e5f9a=_0x15a938;_0x59e512=0xc8;}else{_0x59e512=0xce;}_0x4e4af4[_0x1e67('0x18')](_0x59e512);return _0x4e4af4[_0x1e67('0x1e')](_0x1e67('0x1f'),_0x355c0d+'-'+_0x1e5f9a+'/'+_0x15a938)['json'](_0x1a0a2a);}return null;};}function patchUpdates(_0x182036){return function(_0x487dd0){try{jsonpatch[_0x1e67('0x20')](_0x487dd0,_0x182036,!![]);}catch(_0x50e169){return BPromise[_0x1e67('0x21')](_0x50e169);}return _0x487dd0['save']();};}function saveUpdates(_0x32fc23,_0x3e6df4){return function(_0x2ac3b3){if(_0x2ac3b3){return _0x2ac3b3[_0x1e67('0x22')](_0x32fc23)['then'](function(_0x150b3e){return _0x150b3e;});}return null;};}function removeEntity(_0x1314b6,_0x38c313){return function(_0x275a48){if(_0x275a48){return _0x275a48[_0x1e67('0x23')]()[_0x1e67('0x24')](function(){_0x1314b6[_0x1e67('0x18')](0xcc)[_0x1e67('0x19')]();});}};}function handleEntityNotFound(_0xed4a69,_0x48b509){return function(_0x3ecde7){if(!_0x3ecde7){_0xed4a69['sendStatus'](0x194);}return _0x3ecde7;};}function handleError(_0x268b75,_0xa49b1f){_0xa49b1f=_0xa49b1f||0x1f4;return function(_0x29d626){logger['error'](_0x29d626[_0x1e67('0x25')]);if(_0x29d626[_0x1e67('0x26')]){delete _0x29d626['name'];}_0x268b75[_0x1e67('0x18')](_0xa49b1f)[_0x1e67('0x27')](_0x29d626);};}exports[_0x1e67('0x28')]=function(_0x140699,_0x47651a){var _0x39c300={},_0x24f472={},_0x2daee2={'count':0x0,'rows':[]};var _0x28465b=_[_0x1e67('0x29')](db['SalesforceConfiguration'][_0x1e67('0x2a')],function(_0x2133df){return{'name':_0x2133df[_0x1e67('0x2b')],'type':_0x2133df['type'][_0x1e67('0x2c')]};});_0x24f472[_0x1e67('0x2d')]=_[_0x1e67('0x29')](_0x28465b,'name');_0x24f472[_0x1e67('0x2e')]=_[_0x1e67('0x2f')](_0x140699[_0x1e67('0x2e')]);_0x24f472['filters']=_[_0x1e67('0x30')](_0x24f472[_0x1e67('0x2d')],_0x24f472[_0x1e67('0x2e')]);_0x39c300[_0x1e67('0x31')]=_[_0x1e67('0x30')](_0x24f472[_0x1e67('0x2d')],qs[_0x1e67('0x32')](_0x140699['query'][_0x1e67('0x32')]));_0x39c300[_0x1e67('0x31')]=_0x39c300[_0x1e67('0x31')]['length']?_0x39c300['attributes']:_0x24f472[_0x1e67('0x2d')];if(!_0x140699[_0x1e67('0x2e')]['hasOwnProperty']('nolimit')){_0x39c300[_0x1e67('0x1d')]=qs[_0x1e67('0x1d')](_0x140699['query'][_0x1e67('0x1d')]);_0x39c300['offset']=qs[_0x1e67('0x1a')](_0x140699[_0x1e67('0x2e')][_0x1e67('0x1a')]);}_0x39c300[_0x1e67('0x33')]=qs['sort'](_0x140699[_0x1e67('0x2e')]['sort']);_0x39c300[_0x1e67('0x34')]=qs[_0x1e67('0x35')](_[_0x1e67('0x36')](_0x140699[_0x1e67('0x2e')],_0x24f472[_0x1e67('0x35')]),_0x28465b);if(_0x140699['query'][_0x1e67('0x37')]){_0x39c300['where']=_[_0x1e67('0x38')](_0x39c300[_0x1e67('0x34')],{'$or':_[_0x1e67('0x29')](_0x28465b,function(_0x3bd9b6){if(_0x3bd9b6[_0x1e67('0x39')]!==_0x1e67('0x3a')){var _0x45076a={};_0x45076a[_0x3bd9b6[_0x1e67('0x26')]]={'$like':'%'+_0x140699['query'][_0x1e67('0x37')]+'%'};return _0x45076a;}})});}_0x39c300=_[_0x1e67('0x38')]({},_0x39c300,_0x140699['options']);var _0x2c2675={'where':_0x39c300[_0x1e67('0x34')]};return db[_0x1e67('0x3b')][_0x1e67('0x1c')](_0x2c2675)[_0x1e67('0x24')](function(_0x4089b1){_0x2daee2[_0x1e67('0x1c')]=_0x4089b1;if(_0x140699[_0x1e67('0x2e')][_0x1e67('0x3c')]){_0x39c300[_0x1e67('0x3d')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1e67('0x3e')](_0x39c300);})[_0x1e67('0x24')](function(_0x1e7792){_0x2daee2[_0x1e67('0x3f')]=_0x1e7792;return _0x2daee2;})[_0x1e67('0x24')](respondWithFilteredResult(_0x47651a,_0x39c300))['catch'](handleError(_0x47651a,null));};exports[_0x1e67('0x40')]=function(_0x204eb3,_0x707439){var _0x1f166e={'raw':![],'where':{'id':_0x204eb3[_0x1e67('0x41')]['id']}},_0x77a23f={};_0x77a23f['model']=_[_0x1e67('0x2f')](db[_0x1e67('0x3b')]['rawAttributes']);_0x77a23f[_0x1e67('0x2e')]=_[_0x1e67('0x2f')](_0x204eb3[_0x1e67('0x2e')]);_0x77a23f[_0x1e67('0x35')]=_[_0x1e67('0x30')](_0x77a23f[_0x1e67('0x2d')],_0x77a23f['query']);_0x1f166e[_0x1e67('0x31')]=_[_0x1e67('0x30')](_0x77a23f['model'],qs['fields'](_0x204eb3[_0x1e67('0x2e')][_0x1e67('0x32')]));_0x1f166e[_0x1e67('0x31')]=_0x1f166e[_0x1e67('0x31')][_0x1e67('0x42')]?_0x1f166e['attributes']:_0x77a23f[_0x1e67('0x2d')];if(_0x204eb3[_0x1e67('0x2e')][_0x1e67('0x3c')]){_0x1f166e[_0x1e67('0x3d')]=[{'all':!![]}];}_0x1f166e=_['merge']({},_0x1f166e,_0x204eb3['options']);return db[_0x1e67('0x3b')][_0x1e67('0x43')](_0x1f166e)[_0x1e67('0x24')](handleEntityNotFound(_0x707439,null))[_0x1e67('0x24')](respondWithResult(_0x707439,null))[_0x1e67('0x44')](handleError(_0x707439,null));};exports[_0x1e67('0x45')]=function(_0x2b6c16,_0x42ad4a){return db[_0x1e67('0x3b')][_0x1e67('0x45')](_0x2b6c16[_0x1e67('0x46')],{})[_0x1e67('0x24')](respondWithResult(_0x42ad4a,0xc9))[_0x1e67('0x44')](handleError(_0x42ad4a,null));};exports['update']=function(_0x65a2ef,_0x1cda96){if(_0x65a2ef['body']['id']){delete _0x65a2ef[_0x1e67('0x46')]['id'];}return db[_0x1e67('0x3b')][_0x1e67('0x43')]({'where':{'id':_0x65a2ef[_0x1e67('0x41')]['id']}})[_0x1e67('0x24')](handleEntityNotFound(_0x1cda96,null))['then'](saveUpdates(_0x65a2ef['body'],null))[_0x1e67('0x24')](respondWithResult(_0x1cda96,null))[_0x1e67('0x44')](handleError(_0x1cda96,null));};exports[_0x1e67('0x23')]=function(_0x3ef240,_0x27ac31){return db[_0x1e67('0x3b')][_0x1e67('0x43')]({'where':{'id':_0x3ef240['params']['id']}})[_0x1e67('0x24')](handleEntityNotFound(_0x27ac31,null))[_0x1e67('0x24')](removeEntity(_0x27ac31,null))[_0x1e67('0x44')](handleError(_0x27ac31,null));};exports['getFields']=function(_0x910b07,_0x5e3129,_0x158ef0){var _0x2d1030={};var _0x999d8c={};var _0x2252ac;var _0x2fe75f;return db[_0x1e67('0x3b')][_0x1e67('0x47')]({'where':{'id':_0x910b07[_0x1e67('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e3129,null))['then'](function(_0x2926c8){if(_0x2926c8){_0x2252ac=_0x2926c8;_0x999d8c[_0x1e67('0x2d')]=_[_0x1e67('0x2f')](db['SalesforceField'][_0x1e67('0x2a')]);_0x999d8c[_0x1e67('0x2e')]=_['keys'](_0x910b07[_0x1e67('0x2e')]);_0x999d8c[_0x1e67('0x35')]=_[_0x1e67('0x30')](_0x999d8c[_0x1e67('0x2d')],_0x999d8c[_0x1e67('0x2e')]);_0x2d1030[_0x1e67('0x31')]=_[_0x1e67('0x30')](_0x999d8c[_0x1e67('0x2d')],qs[_0x1e67('0x32')](_0x910b07[_0x1e67('0x2e')][_0x1e67('0x32')]));_0x2d1030[_0x1e67('0x31')]=_0x2d1030[_0x1e67('0x31')][_0x1e67('0x42')]?_0x2d1030['attributes']:_0x999d8c['model'];_0x2d1030['order']=qs['sort'](_0x910b07['query'][_0x1e67('0x48')]);_0x2d1030[_0x1e67('0x34')]=qs[_0x1e67('0x35')](_['pick'](_0x910b07[_0x1e67('0x2e')],_0x999d8c[_0x1e67('0x35')]));if(_0x910b07['query'][_0x1e67('0x37')]){_0x2d1030[_0x1e67('0x34')]=_[_0x1e67('0x38')](_0x2d1030[_0x1e67('0x34')],{'$or':_[_0x1e67('0x29')](_0x2d1030[_0x1e67('0x31')],function(_0x41c849){var _0x4c8c69={};_0x4c8c69[_0x41c849]={'$like':'%'+_0x910b07['query'][_0x1e67('0x37')]+'%'};return _0x4c8c69;})});}_0x2d1030=_['merge']({},_0x2d1030,_0x910b07[_0x1e67('0x49')]);return _0x2252ac[_0x1e67('0x4a')](_0x2d1030);}})[_0x1e67('0x24')](function(_0x5dce55){if(_0x5dce55){_0x2fe75f=_0x5dce55[_0x1e67('0x42')];if(!_0x910b07[_0x1e67('0x2e')][_0x1e67('0x4b')](_0x1e67('0x4c'))){_0x2d1030[_0x1e67('0x1d')]=qs[_0x1e67('0x1d')](_0x910b07[_0x1e67('0x2e')][_0x1e67('0x1d')]);_0x2d1030[_0x1e67('0x1a')]=qs[_0x1e67('0x1a')](_0x910b07[_0x1e67('0x2e')][_0x1e67('0x1a')]);}return _0x2252ac[_0x1e67('0x4a')](_0x2d1030);}})[_0x1e67('0x24')](function(_0x53d723){if(_0x53d723){return _0x53d723?{'count':_0x2fe75f,'rows':_0x53d723}:null;}})[_0x1e67('0x24')](respondWithResult(_0x5e3129,null))[_0x1e67('0x44')](handleError(_0x5e3129,null));};exports[_0x1e67('0x4d')]=function(_0x501520,_0x1af43a,_0x458b9b){var _0x32a1bd={};var _0x42823c={};var _0x42308f;var _0x5f16b5;return db[_0x1e67('0x3b')][_0x1e67('0x47')]({'where':{'id':_0x501520[_0x1e67('0x41')]['id']}})[_0x1e67('0x24')](handleEntityNotFound(_0x1af43a,null))[_0x1e67('0x24')](function(_0x31106a){if(_0x31106a){_0x42308f=_0x31106a;_0x42823c[_0x1e67('0x2d')]=_[_0x1e67('0x2f')](db[_0x1e67('0x4e')][_0x1e67('0x2a')]);_0x42823c[_0x1e67('0x2e')]=_[_0x1e67('0x2f')](_0x501520[_0x1e67('0x2e')]);_0x42823c['filters']=_[_0x1e67('0x30')](_0x42823c['model'],_0x42823c['query']);_0x32a1bd[_0x1e67('0x31')]=_['intersection'](_0x42823c[_0x1e67('0x2d')],qs['fields'](_0x501520[_0x1e67('0x2e')]['fields']));_0x32a1bd[_0x1e67('0x31')]=_0x32a1bd[_0x1e67('0x31')][_0x1e67('0x42')]?_0x32a1bd['attributes']:_0x42823c['model'];_0x32a1bd[_0x1e67('0x33')]=qs['sort'](_0x501520[_0x1e67('0x2e')]['sort']);_0x32a1bd[_0x1e67('0x34')]=qs[_0x1e67('0x35')](_[_0x1e67('0x36')](_0x501520[_0x1e67('0x2e')],_0x42823c[_0x1e67('0x35')]));if(_0x501520[_0x1e67('0x2e')][_0x1e67('0x37')]){_0x32a1bd[_0x1e67('0x34')]=_[_0x1e67('0x38')](_0x32a1bd[_0x1e67('0x34')],{'$or':_[_0x1e67('0x29')](_0x32a1bd[_0x1e67('0x31')],function(_0x44a2ba){var _0x102b51={};_0x102b51[_0x44a2ba]={'$like':'%'+_0x501520[_0x1e67('0x2e')][_0x1e67('0x37')]+'%'};return _0x102b51;})});}_0x32a1bd=_[_0x1e67('0x38')]({},_0x32a1bd,_0x501520[_0x1e67('0x49')]);return _0x42308f[_0x1e67('0x4d')](_0x32a1bd);}})[_0x1e67('0x24')](function(_0x29b6e1){if(_0x29b6e1){_0x5f16b5=_0x29b6e1['length'];if(!_0x501520[_0x1e67('0x2e')][_0x1e67('0x4b')](_0x1e67('0x4c'))){_0x32a1bd[_0x1e67('0x1d')]=qs[_0x1e67('0x1d')](_0x501520[_0x1e67('0x2e')][_0x1e67('0x1d')]);_0x32a1bd['offset']=qs[_0x1e67('0x1a')](_0x501520[_0x1e67('0x2e')][_0x1e67('0x1a')]);}return _0x42308f[_0x1e67('0x4d')](_0x32a1bd);}})['then'](function(_0x1926de){if(_0x1926de){return _0x1926de?{'count':_0x5f16b5,'rows':_0x1926de}:null;}})[_0x1e67('0x24')](respondWithResult(_0x1af43a,null))[_0x1e67('0x44')](handleError(_0x1af43a,null));};exports[_0x1e67('0x4f')]=function(_0x1bbdfe,_0x3e88e2,_0x461e82){var _0x29991d={};var _0xebe1c0={};var _0x1b5e1c;var _0x59cc8d;return db['SalesforceConfiguration'][_0x1e67('0x47')]({'where':{'id':_0x1bbdfe[_0x1e67('0x41')]['id']}})[_0x1e67('0x24')](handleEntityNotFound(_0x3e88e2,null))['then'](function(_0x15b9fd){if(_0x15b9fd){_0x1b5e1c=_0x15b9fd;_0xebe1c0[_0x1e67('0x2d')]=_[_0x1e67('0x2f')](db['SalesforceField'][_0x1e67('0x2a')]);_0xebe1c0[_0x1e67('0x2e')]=_[_0x1e67('0x2f')](_0x1bbdfe[_0x1e67('0x2e')]);_0xebe1c0[_0x1e67('0x35')]=_[_0x1e67('0x30')](_0xebe1c0[_0x1e67('0x2d')],_0xebe1c0[_0x1e67('0x2e')]);_0x29991d[_0x1e67('0x31')]=_[_0x1e67('0x30')](_0xebe1c0[_0x1e67('0x2d')],qs['fields'](_0x1bbdfe[_0x1e67('0x2e')]['fields']));_0x29991d[_0x1e67('0x31')]=_0x29991d[_0x1e67('0x31')][_0x1e67('0x42')]?_0x29991d[_0x1e67('0x31')]:_0xebe1c0['model'];_0x29991d[_0x1e67('0x33')]=qs['sort'](_0x1bbdfe[_0x1e67('0x2e')][_0x1e67('0x48')]);_0x29991d[_0x1e67('0x34')]=qs[_0x1e67('0x35')](_[_0x1e67('0x36')](_0x1bbdfe[_0x1e67('0x2e')],_0xebe1c0['filters']));if(_0x1bbdfe[_0x1e67('0x2e')][_0x1e67('0x37')]){_0x29991d[_0x1e67('0x34')]=_['merge'](_0x29991d[_0x1e67('0x34')],{'$or':_['map'](_0x29991d[_0x1e67('0x31')],function(_0x32fc8e){var _0x47e180={};_0x47e180[_0x32fc8e]={'$like':'%'+_0x1bbdfe[_0x1e67('0x2e')][_0x1e67('0x37')]+'%'};return _0x47e180;})});}_0x29991d=_[_0x1e67('0x38')]({},_0x29991d,_0x1bbdfe[_0x1e67('0x49')]);return _0x1b5e1c[_0x1e67('0x4f')](_0x29991d);}})[_0x1e67('0x24')](function(_0x46617b){if(_0x46617b){_0x59cc8d=_0x46617b['length'];if(!_0x1bbdfe[_0x1e67('0x2e')][_0x1e67('0x4b')](_0x1e67('0x4c'))){_0x29991d[_0x1e67('0x1d')]=qs[_0x1e67('0x1d')](_0x1bbdfe[_0x1e67('0x2e')][_0x1e67('0x1d')]);_0x29991d[_0x1e67('0x1a')]=qs[_0x1e67('0x1a')](_0x1bbdfe['query'][_0x1e67('0x1a')]);}return _0x1b5e1c[_0x1e67('0x4f')](_0x29991d);}})[_0x1e67('0x24')](function(_0x292e9f){if(_0x292e9f){return _0x292e9f?{'count':_0x59cc8d,'rows':_0x292e9f}:null;}})[_0x1e67('0x24')](respondWithResult(_0x3e88e2,null))[_0x1e67('0x44')](handleError(_0x3e88e2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f1f57d9..8ad1870 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 _0x73b7=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x799c0a,_0xb1c5cf){var _0x18fe5a=function(_0x59107f){while(--_0x59107f){_0x799c0a['push'](_0x799c0a['shift']());}};_0x18fe5a(++_0xb1c5cf);}(_0x73b7,0xd6));var _0x773b=function(_0x1eaeb9,_0x12d4b){_0x1eaeb9=_0x1eaeb9-0x0;var _0x87baba=_0x73b7[_0x1eaeb9];return _0x87baba;};'use strict';var _=require(_0x773b('0x0'));var util=require(_0x773b('0x1'));var logger=require('../../config/logger')(_0x773b('0x2'));var moment=require(_0x773b('0x3'));var BPromise=require(_0x773b('0x4'));var rp=require(_0x773b('0x5'));var fs=require('fs');var path=require(_0x773b('0x6'));var rimraf=require(_0x773b('0x7'));var config=require(_0x773b('0x8'));var attributes=require(_0x773b('0x9'));module[_0x773b('0xa')]=function(_0x32d9e3,_0x27b35d){return _0x32d9e3[_0x773b('0xb')](_0x773b('0xc'),attributes,{'tableName':_0x773b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc22=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','bluebird','path'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdc22,0xf7));var _0x2dc2=function(_0x52b0b2,_0xf6dbf9){_0x52b0b2=_0x52b0b2-0x0;var _0x322769=_0xdc22[_0x52b0b2];return _0x322769;};'use strict';var _=require(_0x2dc2('0x0'));var util=require('util');var logger=require(_0x2dc2('0x1'))(_0x2dc2('0x2'));var moment=require('moment');var BPromise=require(_0x2dc2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2dc2('0x4'));var rimraf=require(_0x2dc2('0x5'));var config=require(_0x2dc2('0x6'));var attributes=require(_0x2dc2('0x7'));module[_0x2dc2('0x8')]=function(_0x3edf21,_0x28eb96){return _0x3edf21[_0x2dc2('0x9')](_0x2dc2('0xa'),attributes,{'tableName':_0x2dc2('0xb'),'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 33f9112..61936e8 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 _0x5324=['jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0x5324,0x19f));var _0x4532=function(_0x481de7,_0xfd2b42){_0x481de7=_0x481de7-0x0;var _0x1340fe=_0x5324[_0x481de7];return _0x1340fe;};'use strict';var _=require('lodash');var util=require(_0x4532('0x0'));var moment=require(_0x4532('0x1'));var BPromise=require(_0x4532('0x2'));var rs=require(_0x4532('0x3'));var fs=require('fs');var Redis=require(_0x4532('0x4'));var db=require(_0x4532('0x5'))['db'];var utils=require(_0x4532('0x6'));var logger=require(_0x4532('0x7'))(_0x4532('0x8'));var config=require(_0x4532('0x9'));var jayson=require(_0x4532('0xa'));var client=jayson[_0x4532('0xb')][_0x4532('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e5fcd,_0x20ea9d,_0x5f136a){return new BPromise(function(_0xa3f45a,_0x3216d1){return client['request'](_0x5e5fcd,_0x5f136a)[_0x4532('0xd')](function(_0x1c1a6d){logger['info'](_0x4532('0xe'),_0x20ea9d,_0x4532('0xf'));logger[_0x4532('0x10')](_0x4532('0x11'),_0x20ea9d,_0x4532('0xf'),JSON[_0x4532('0x12')](_0x1c1a6d));if(_0x1c1a6d['error']){if(_0x1c1a6d['error'][_0x4532('0x13')]===0x1f4){logger[_0x4532('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x20ea9d,_0x1c1a6d[_0x4532('0x14')]['message']);return _0x3216d1(_0x1c1a6d[_0x4532('0x14')]['message']);}logger[_0x4532('0x14')](_0x4532('0xe'),_0x20ea9d,_0x1c1a6d[_0x4532('0x14')][_0x4532('0x15')]);return _0xa3f45a(_0x1c1a6d[_0x4532('0x14')][_0x4532('0x15')]);}else{logger[_0x4532('0x16')]('SalesforceConfiguration,\x20%s,\x20%s',_0x20ea9d,_0x4532('0xf'));_0xa3f45a(_0x1c1a6d[_0x4532('0x17')]['message']);}})[_0x4532('0x18')](function(_0x11b201){logger[_0x4532('0x14')](_0x4532('0xe'),_0x20ea9d,_0x11b201);_0x3216d1(_0x11b201);});});} \ No newline at end of file +var _0x8653=['http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8653,0x1da));var _0x3865=function(_0x5d95e7,_0x5d9a84){_0x5d95e7=_0x5d95e7-0x0;var _0x3e47fe=_0x8653[_0x5d95e7];return _0x3e47fe;};'use strict';var _=require('lodash');var util=require(_0x3865('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3865('0x1'));var fs=require('fs');var Redis=require(_0x3865('0x2'));var db=require(_0x3865('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3865('0x4'))(_0x3865('0x5'));var config=require(_0x3865('0x6'));var jayson=require(_0x3865('0x7'));var client=jayson[_0x3865('0x8')][_0x3865('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ada6,_0x4294a6,_0x49a2fb){return new BPromise(function(_0x486b88,_0x38d72f){return client[_0x3865('0xa')](_0x50ada6,_0x49a2fb)[_0x3865('0xb')](function(_0x45d784){logger[_0x3865('0xc')](_0x3865('0xd'),_0x4294a6,_0x3865('0xe'));logger[_0x3865('0xf')](_0x3865('0x10'),_0x4294a6,_0x3865('0xe'),JSON[_0x3865('0x11')](_0x45d784));if(_0x45d784['error']){if(_0x45d784[_0x3865('0x12')][_0x3865('0x13')]===0x1f4){logger[_0x3865('0x12')](_0x3865('0xd'),_0x4294a6,_0x45d784[_0x3865('0x12')]['message']);return _0x38d72f(_0x45d784[_0x3865('0x12')][_0x3865('0x14')]);}logger['error'](_0x3865('0xd'),_0x4294a6,_0x45d784[_0x3865('0x12')][_0x3865('0x14')]);return _0x486b88(_0x45d784['error'][_0x3865('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4294a6,_0x3865('0xe'));_0x486b88(_0x45d784[_0x3865('0x15')]['message']);}})[_0x3865('0x16')](function(_0xd861ef){logger['error'](_0x3865('0xd'),_0x4294a6,_0xd861ef);_0x38d72f(_0xd861ef);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 6ca4094..62f5a27 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 _0x78c1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','show','create','put','update','delete','isAuthenticated'];(function(_0x533990,_0x21fe8d){var _0x5a5e2a=function(_0x2539c3){while(--_0x2539c3){_0x533990['push'](_0x533990['shift']());}};_0x5a5e2a(++_0x21fe8d);}(_0x78c1,0x143));var _0x178c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x78c1[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x178c('0x0'));var util=require(_0x178c('0x1'));var path=require(_0x178c('0x2'));var timeout=require(_0x178c('0x3'));var express=require(_0x178c('0x4'));var router=express[_0x178c('0x5')]();var fs_extra=require(_0x178c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x178c('0x7'));var config=require(_0x178c('0x8'));var controller=require(_0x178c('0x9'));router[_0x178c('0xa')]('/',auth['isAuthenticated'](),controller[_0x178c('0xb')]);router[_0x178c('0xa')](_0x178c('0xc'),auth['isAuthenticated'](),controller[_0x178c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x178c('0xe')]);router[_0x178c('0xf')](_0x178c('0xc'),auth['isAuthenticated'](),controller[_0x178c('0x10')]);router[_0x178c('0x11')](_0x178c('0xc'),auth[_0x178c('0x12')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9d47=['express','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x56feb6,_0x38defa){var _0x16b7ba=function(_0x23a0bf){while(--_0x23a0bf){_0x56feb6['push'](_0x56feb6['shift']());}};_0x16b7ba(++_0x38defa);}(_0x9d47,0x176));var _0x79d4=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9d47[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x79d4('0x0'));var util=require(_0x79d4('0x1'));var path=require(_0x79d4('0x2'));var timeout=require(_0x79d4('0x3'));var express=require(_0x79d4('0x4'));var router=express[_0x79d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x79d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x79d4('0x7'));var controller=require(_0x79d4('0x8'));router[_0x79d4('0x9')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xb')]);router[_0x79d4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x79d4('0xc')]);router[_0x79d4('0xd')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xe')]);router[_0x79d4('0xf')](_0x79d4('0x10'),auth[_0x79d4('0xa')](),controller[_0x79d4('0x11')]);router[_0x79d4('0x12')](_0x79d4('0x10'),auth[_0x79d4('0xa')](),controller[_0x79d4('0x13')]);module[_0x79d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1882168..d394684 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 _0xfd52=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xfd52,0xda));var _0x2fd5=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xfd52[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0x2fd5('0x0'));module[_0x2fd5('0x1')]={'type':{'type':Sequelize[_0x2fd5('0x2')](_0x2fd5('0x3'),_0x2fd5('0x4'),_0x2fd5('0x5'),_0x2fd5('0x6'),'picklist'),'defaultValue':_0x2fd5('0x3')},'content':{'type':Sequelize[_0x2fd5('0x7')]},'key':{'type':Sequelize[_0x2fd5('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2fd5('0x3'),_0x2fd5('0x4'),_0x2fd5('0x5'))},'keyContent':{'type':Sequelize[_0x2fd5('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x2fd5('0x7')]}}; \ No newline at end of file +var _0x9e39=['variable','sequelize','exports','ENUM','customVariable','picklist','string','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9e39,0x1e9));var _0x99e3=function(_0x20df0a,_0x1c5415){_0x20df0a=_0x20df0a-0x0;var _0x57a33d=_0x9e39[_0x20df0a];return _0x57a33d;};'use strict';var Sequelize=require(_0x99e3('0x0'));module[_0x99e3('0x1')]={'type':{'type':Sequelize[_0x99e3('0x2')]('string','variable',_0x99e3('0x3'),'keyValue',_0x99e3('0x4')),'defaultValue':_0x99e3('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x99e3('0x6')]},'keyType':{'type':Sequelize[_0x99e3('0x2')](_0x99e3('0x5'),_0x99e3('0x7'),_0x99e3('0x3'))},'keyContent':{'type':Sequelize[_0x99e3('0x6')]},'idField':{'type':Sequelize[_0x99e3('0x6')]},'variableName':{'type':Sequelize[_0x99e3('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8f3a0cc..74e7416 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 _0xb119=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','index','map','SalesforceField','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format'];(function(_0x493bed,_0x1ad10f){var _0x146127=function(_0x5438fe){while(--_0x5438fe){_0x493bed['push'](_0x493bed['shift']());}};_0x146127(++_0x1ad10f);}(_0xb119,0xdd));var _0x9b11=function(_0x3a2deb,_0x2f8c2d){_0x3a2deb=_0x3a2deb-0x0;var _0x203ab0=_0xb119[_0x3a2deb];return _0x203ab0;};'use strict';var emlformat=require(_0x9b11('0x0'));var rimraf=require(_0x9b11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b11('0x2'));var rp=require(_0x9b11('0x3'));var moment=require(_0x9b11('0x4'));var BPromise=require(_0x9b11('0x5'));var Mustache=require(_0x9b11('0x6'));var util=require('util');var path=require(_0x9b11('0x7'));var sox=require(_0x9b11('0x8'));var csv=require(_0x9b11('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b11('0xa'));var _=require('lodash');var squel=require(_0x9b11('0xb'));var crypto=require(_0x9b11('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b11('0xd'));var toCsv=require(_0x9b11('0x9'));var querystring=require(_0x9b11('0xe'));var Papa=require(_0x9b11('0xf'));var Redis=require('ioredis');var authService=require(_0x9b11('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b11('0x11'))(_0x9b11('0x12'));var utils=require(_0x9b11('0x13'));var config=require(_0x9b11('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b11('0x15'))['db'];function respondWithStatusCode(_0x43baf1,_0x4a23b6){_0x4a23b6=_0x4a23b6||0xcc;return function(_0x517487){if(_0x517487){return _0x43baf1[_0x9b11('0x16')](_0x4a23b6);}return _0x43baf1[_0x9b11('0x17')](_0x4a23b6)['end']();};}function respondWithResult(_0x4e4106,_0x1327f0){_0x1327f0=_0x1327f0||0xc8;return function(_0x56320b){if(_0x56320b){return _0x4e4106['status'](_0x1327f0)[_0x9b11('0x18')](_0x56320b);}};}function respondWithFilteredResult(_0x3d5cb4,_0x91971b){return function(_0x415bc0){if(_0x415bc0){var _0x4d4c9d=typeof _0x91971b[_0x9b11('0x19')]==='undefined'&&typeof _0x91971b['limit']===_0x9b11('0x1a');var _0x4b8e3f=_0x415bc0['count'];var _0x2de7f6=_0x4d4c9d?0x0:_0x91971b[_0x9b11('0x19')];var _0x25b669=_0x4d4c9d?_0x415bc0[_0x9b11('0x1b')]:_0x91971b[_0x9b11('0x19')]+_0x91971b[_0x9b11('0x1c')];var _0x453df6;if(_0x25b669>=_0x4b8e3f){_0x25b669=_0x4b8e3f;_0x453df6=0xc8;}else{_0x453df6=0xce;}_0x3d5cb4['status'](_0x453df6);return _0x3d5cb4[_0x9b11('0x1d')](_0x9b11('0x1e'),_0x2de7f6+'-'+_0x25b669+'/'+_0x4b8e3f)[_0x9b11('0x18')](_0x415bc0);}return null;};}function patchUpdates(_0x1bd427){return function(_0x4d8a23){try{jsonpatch['apply'](_0x4d8a23,_0x1bd427,!![]);}catch(_0x5b84be){return BPromise[_0x9b11('0x1f')](_0x5b84be);}return _0x4d8a23[_0x9b11('0x20')]();};}function saveUpdates(_0x1b946d,_0x18e41f){return function(_0x4b04cf){if(_0x4b04cf){return _0x4b04cf[_0x9b11('0x21')](_0x1b946d)['then'](function(_0x389c73){return _0x389c73;});}return null;};}function removeEntity(_0x421f28,_0x327d17){return function(_0x907c71){if(_0x907c71){return _0x907c71[_0x9b11('0x22')]()[_0x9b11('0x23')](function(){_0x421f28['status'](0xcc)[_0x9b11('0x24')]();});}};}function handleEntityNotFound(_0x1976b1,_0x3e268e){return function(_0x2063b7){if(!_0x2063b7){_0x1976b1[_0x9b11('0x16')](0x194);}return _0x2063b7;};}function handleError(_0xebf568,_0x367cdf){_0x367cdf=_0x367cdf||0x1f4;return function(_0x3c9449){logger[_0x9b11('0x25')](_0x3c9449[_0x9b11('0x26')]);if(_0x3c9449[_0x9b11('0x27')]){delete _0x3c9449[_0x9b11('0x27')];}_0xebf568[_0x9b11('0x17')](_0x367cdf)['send'](_0x3c9449);};}exports[_0x9b11('0x28')]=function(_0x56c89b,_0x488ec1){var _0x548209={},_0x217a29={},_0x45de3c={'count':0x0,'rows':[]};var _0x29195d=_[_0x9b11('0x29')](db[_0x9b11('0x2a')][_0x9b11('0x2b')],function(_0x2b6632){return{'name':_0x2b6632['fieldName'],'type':_0x2b6632[_0x9b11('0x2c')][_0x9b11('0x2d')]};});_0x217a29['model']=_[_0x9b11('0x29')](_0x29195d,_0x9b11('0x27'));_0x217a29[_0x9b11('0x2e')]=_[_0x9b11('0x2f')](_0x56c89b[_0x9b11('0x2e')]);_0x217a29['filters']=_[_0x9b11('0x30')](_0x217a29[_0x9b11('0x31')],_0x217a29[_0x9b11('0x2e')]);_0x548209[_0x9b11('0x32')]=_[_0x9b11('0x30')](_0x217a29[_0x9b11('0x31')],qs[_0x9b11('0x33')](_0x56c89b[_0x9b11('0x2e')][_0x9b11('0x33')]));_0x548209[_0x9b11('0x32')]=_0x548209[_0x9b11('0x32')][_0x9b11('0x34')]?_0x548209[_0x9b11('0x32')]:_0x217a29[_0x9b11('0x31')];if(!_0x56c89b[_0x9b11('0x2e')][_0x9b11('0x35')](_0x9b11('0x36'))){_0x548209[_0x9b11('0x1c')]=qs[_0x9b11('0x1c')](_0x56c89b[_0x9b11('0x2e')][_0x9b11('0x1c')]);_0x548209['offset']=qs[_0x9b11('0x19')](_0x56c89b['query'][_0x9b11('0x19')]);}_0x548209[_0x9b11('0x37')]=qs[_0x9b11('0x38')](_0x56c89b[_0x9b11('0x2e')][_0x9b11('0x38')]);_0x548209[_0x9b11('0x39')]=qs[_0x9b11('0x3a')](_[_0x9b11('0x3b')](_0x56c89b[_0x9b11('0x2e')],_0x217a29['filters']),_0x29195d);if(_0x56c89b['query'][_0x9b11('0x3c')]){_0x548209[_0x9b11('0x39')]=_['merge'](_0x548209[_0x9b11('0x39')],{'$or':_[_0x9b11('0x29')](_0x29195d,function(_0x4789a9){if(_0x4789a9[_0x9b11('0x2c')]!==_0x9b11('0x3d')){var _0x4d3649={};_0x4d3649[_0x4789a9[_0x9b11('0x27')]]={'$like':'%'+_0x56c89b['query'][_0x9b11('0x3c')]+'%'};return _0x4d3649;}})});}_0x548209=_[_0x9b11('0x3e')]({},_0x548209,_0x56c89b['options']);var _0x15f56b={'where':_0x548209[_0x9b11('0x39')]};return db['SalesforceField'][_0x9b11('0x1b')](_0x15f56b)['then'](function(_0x475c9f){_0x45de3c[_0x9b11('0x1b')]=_0x475c9f;if(_0x56c89b['query'][_0x9b11('0x3f')]){_0x548209[_0x9b11('0x40')]=[{'all':!![]}];}return db[_0x9b11('0x2a')][_0x9b11('0x41')](_0x548209);})[_0x9b11('0x23')](function(_0x133087){_0x45de3c[_0x9b11('0x42')]=_0x133087;return _0x45de3c;})[_0x9b11('0x23')](respondWithFilteredResult(_0x488ec1,_0x548209))[_0x9b11('0x43')](handleError(_0x488ec1,null));};exports[_0x9b11('0x44')]=function(_0x43425b,_0x1efbcc){var _0x3db65d={'raw':!![],'where':{'id':_0x43425b[_0x9b11('0x45')]['id']}},_0x11d31d={};_0x11d31d[_0x9b11('0x31')]=_[_0x9b11('0x2f')](db[_0x9b11('0x2a')][_0x9b11('0x2b')]);_0x11d31d[_0x9b11('0x2e')]=_[_0x9b11('0x2f')](_0x43425b[_0x9b11('0x2e')]);_0x11d31d['filters']=_[_0x9b11('0x30')](_0x11d31d['model'],_0x11d31d['query']);_0x3db65d[_0x9b11('0x32')]=_[_0x9b11('0x30')](_0x11d31d[_0x9b11('0x31')],qs[_0x9b11('0x33')](_0x43425b[_0x9b11('0x2e')][_0x9b11('0x33')]));_0x3db65d['attributes']=_0x3db65d[_0x9b11('0x32')][_0x9b11('0x34')]?_0x3db65d['attributes']:_0x11d31d[_0x9b11('0x31')];if(_0x43425b[_0x9b11('0x2e')][_0x9b11('0x3f')]){_0x3db65d[_0x9b11('0x40')]=[{'all':!![]}];}_0x3db65d=_[_0x9b11('0x3e')]({},_0x3db65d,_0x43425b[_0x9b11('0x46')]);return db[_0x9b11('0x2a')][_0x9b11('0x47')](_0x3db65d)[_0x9b11('0x23')](handleEntityNotFound(_0x1efbcc,null))['then'](respondWithResult(_0x1efbcc,null))[_0x9b11('0x43')](handleError(_0x1efbcc,null));};exports[_0x9b11('0x48')]=function(_0x32950c,_0x2c4806){return db['SalesforceField'][_0x9b11('0x48')](_0x32950c[_0x9b11('0x49')],{})[_0x9b11('0x23')](respondWithResult(_0x2c4806,0xc9))['catch'](handleError(_0x2c4806,null));};exports[_0x9b11('0x21')]=function(_0x554c37,_0x5cc60a){if(_0x554c37[_0x9b11('0x49')]['id']){delete _0x554c37[_0x9b11('0x49')]['id'];}return db['SalesforceField'][_0x9b11('0x47')]({'where':{'id':_0x554c37[_0x9b11('0x45')]['id']}})[_0x9b11('0x23')](handleEntityNotFound(_0x5cc60a,null))['then'](saveUpdates(_0x554c37[_0x9b11('0x49')],null))[_0x9b11('0x23')](respondWithResult(_0x5cc60a,null))[_0x9b11('0x43')](handleError(_0x5cc60a,null));};exports[_0x9b11('0x22')]=function(_0x48a33e,_0x12e931){return db[_0x9b11('0x2a')]['find']({'where':{'id':_0x48a33e['params']['id']}})['then'](handleEntityNotFound(_0x12e931,null))[_0x9b11('0x23')](removeEntity(_0x12e931,null))[_0x9b11('0x43')](handleError(_0x12e931,null));}; \ No newline at end of file +var _0xf295=['moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3af7bd,_0x5a21e4){var _0x36b4d1=function(_0x9ffd12){while(--_0x9ffd12){_0x3af7bd['push'](_0x3af7bd['shift']());}};_0x36b4d1(++_0x5a21e4);}(_0xf295,0x1bd));var _0x5f29=function(_0x1960f9,_0x1edb2a){_0x1960f9=_0x1960f9-0x0;var _0x5bb364=_0xf295[_0x1960f9];return _0x5bb364;};'use strict';var emlformat=require(_0x5f29('0x0'));var rimraf=require(_0x5f29('0x1'));var zipdir=require(_0x5f29('0x2'));var jsonpatch=require(_0x5f29('0x3'));var rp=require(_0x5f29('0x4'));var moment=require(_0x5f29('0x5'));var BPromise=require(_0x5f29('0x6'));var Mustache=require(_0x5f29('0x7'));var util=require(_0x5f29('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5f29('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f29('0xa'));var squel=require(_0x5f29('0xb'));var crypto=require(_0x5f29('0xc'));var jsforce=require(_0x5f29('0xd'));var deskjs=require(_0x5f29('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5f29('0xf'));var Papa=require(_0x5f29('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5f29('0x11'));var as=require(_0x5f29('0x12'));var hardwareService=require(_0x5f29('0x13'));var logger=require(_0x5f29('0x14'))(_0x5f29('0x15'));var utils=require(_0x5f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5f29('0x17'));var db=require(_0x5f29('0x18'))['db'];function respondWithStatusCode(_0x5829d5,_0x16aa0c){_0x16aa0c=_0x16aa0c||0xcc;return function(_0x519afc){if(_0x519afc){return _0x5829d5[_0x5f29('0x19')](_0x16aa0c);}return _0x5829d5[_0x5f29('0x1a')](_0x16aa0c)[_0x5f29('0x1b')]();};}function respondWithResult(_0x5ce396,_0x5e634b){_0x5e634b=_0x5e634b||0xc8;return function(_0x1abdd1){if(_0x1abdd1){return _0x5ce396[_0x5f29('0x1a')](_0x5e634b)['json'](_0x1abdd1);}};}function respondWithFilteredResult(_0xe50247,_0x5c01bb){return function(_0x1fe1ed){if(_0x1fe1ed){var _0x4c602d=typeof _0x5c01bb[_0x5f29('0x1c')]==='undefined'&&typeof _0x5c01bb['limit']===_0x5f29('0x1d');var _0x3357d9=_0x1fe1ed['count'];var _0x4fe3c7=_0x4c602d?0x0:_0x5c01bb[_0x5f29('0x1c')];var _0x1125c6=_0x4c602d?_0x1fe1ed[_0x5f29('0x1e')]:_0x5c01bb[_0x5f29('0x1c')]+_0x5c01bb['limit'];var _0x2b21d3;if(_0x1125c6>=_0x3357d9){_0x1125c6=_0x3357d9;_0x2b21d3=0xc8;}else{_0x2b21d3=0xce;}_0xe50247['status'](_0x2b21d3);return _0xe50247[_0x5f29('0x1f')](_0x5f29('0x20'),_0x4fe3c7+'-'+_0x1125c6+'/'+_0x3357d9)['json'](_0x1fe1ed);}return null;};}function patchUpdates(_0x490ad9){return function(_0x2ae6de){try{jsonpatch[_0x5f29('0x21')](_0x2ae6de,_0x490ad9,!![]);}catch(_0x2b3f90){return BPromise['reject'](_0x2b3f90);}return _0x2ae6de['save']();};}function saveUpdates(_0x142578,_0x55b595){return function(_0x1a2027){if(_0x1a2027){return _0x1a2027[_0x5f29('0x22')](_0x142578)[_0x5f29('0x23')](function(_0x3ab3de){return _0x3ab3de;});}return null;};}function removeEntity(_0x5d09fc,_0x323438){return function(_0x16e081){if(_0x16e081){return _0x16e081[_0x5f29('0x24')]()[_0x5f29('0x23')](function(){_0x5d09fc['status'](0xcc)[_0x5f29('0x1b')]();});}};}function handleEntityNotFound(_0x36dc4b,_0x25529b){return function(_0x227732){if(!_0x227732){_0x36dc4b['sendStatus'](0x194);}return _0x227732;};}function handleError(_0x530fa5,_0x58682b){_0x58682b=_0x58682b||0x1f4;return function(_0x489a11){logger[_0x5f29('0x25')](_0x489a11[_0x5f29('0x26')]);if(_0x489a11[_0x5f29('0x27')]){delete _0x489a11[_0x5f29('0x27')];}_0x530fa5[_0x5f29('0x1a')](_0x58682b)[_0x5f29('0x28')](_0x489a11);};}exports[_0x5f29('0x29')]=function(_0x57888d,_0x15ba06){var _0x526ace={},_0x1a4b1b={},_0x26ddca={'count':0x0,'rows':[]};var _0x12733b=_[_0x5f29('0x2a')](db[_0x5f29('0x2b')][_0x5f29('0x2c')],function(_0x51e218){return{'name':_0x51e218[_0x5f29('0x2d')],'type':_0x51e218['type']['key']};});_0x1a4b1b[_0x5f29('0x2e')]=_['map'](_0x12733b,_0x5f29('0x27'));_0x1a4b1b['query']=_[_0x5f29('0x2f')](_0x57888d[_0x5f29('0x30')]);_0x1a4b1b['filters']=_['intersection'](_0x1a4b1b[_0x5f29('0x2e')],_0x1a4b1b[_0x5f29('0x30')]);_0x526ace[_0x5f29('0x31')]=_[_0x5f29('0x32')](_0x1a4b1b['model'],qs[_0x5f29('0x33')](_0x57888d['query'][_0x5f29('0x33')]));_0x526ace[_0x5f29('0x31')]=_0x526ace[_0x5f29('0x31')][_0x5f29('0x34')]?_0x526ace[_0x5f29('0x31')]:_0x1a4b1b['model'];if(!_0x57888d['query'][_0x5f29('0x35')](_0x5f29('0x36'))){_0x526ace[_0x5f29('0x37')]=qs[_0x5f29('0x37')](_0x57888d[_0x5f29('0x30')][_0x5f29('0x37')]);_0x526ace[_0x5f29('0x1c')]=qs['offset'](_0x57888d[_0x5f29('0x30')][_0x5f29('0x1c')]);}_0x526ace[_0x5f29('0x38')]=qs[_0x5f29('0x39')](_0x57888d[_0x5f29('0x30')][_0x5f29('0x39')]);_0x526ace[_0x5f29('0x3a')]=qs[_0x5f29('0x3b')](_[_0x5f29('0x3c')](_0x57888d[_0x5f29('0x30')],_0x1a4b1b[_0x5f29('0x3b')]),_0x12733b);if(_0x57888d[_0x5f29('0x30')]['filter']){_0x526ace[_0x5f29('0x3a')]=_[_0x5f29('0x3d')](_0x526ace[_0x5f29('0x3a')],{'$or':_[_0x5f29('0x2a')](_0x12733b,function(_0x20806a){if(_0x20806a['type']!==_0x5f29('0x3e')){var _0x5547d4={};_0x5547d4[_0x20806a[_0x5f29('0x27')]]={'$like':'%'+_0x57888d['query'][_0x5f29('0x3f')]+'%'};return _0x5547d4;}})});}_0x526ace=_[_0x5f29('0x3d')]({},_0x526ace,_0x57888d[_0x5f29('0x40')]);var _0x1876d1={'where':_0x526ace[_0x5f29('0x3a')]};return db[_0x5f29('0x2b')][_0x5f29('0x1e')](_0x1876d1)['then'](function(_0x384a84){_0x26ddca[_0x5f29('0x1e')]=_0x384a84;if(_0x57888d[_0x5f29('0x30')][_0x5f29('0x41')]){_0x526ace[_0x5f29('0x42')]=[{'all':!![]}];}return db[_0x5f29('0x2b')][_0x5f29('0x43')](_0x526ace);})[_0x5f29('0x23')](function(_0x216258){_0x26ddca[_0x5f29('0x44')]=_0x216258;return _0x26ddca;})[_0x5f29('0x23')](respondWithFilteredResult(_0x15ba06,_0x526ace))[_0x5f29('0x45')](handleError(_0x15ba06,null));};exports[_0x5f29('0x46')]=function(_0x559579,_0x51379a){var _0x38f420={'raw':!![],'where':{'id':_0x559579[_0x5f29('0x47')]['id']}},_0x14c588={};_0x14c588['model']=_[_0x5f29('0x2f')](db[_0x5f29('0x2b')][_0x5f29('0x2c')]);_0x14c588['query']=_[_0x5f29('0x2f')](_0x559579[_0x5f29('0x30')]);_0x14c588[_0x5f29('0x3b')]=_[_0x5f29('0x32')](_0x14c588[_0x5f29('0x2e')],_0x14c588[_0x5f29('0x30')]);_0x38f420[_0x5f29('0x31')]=_['intersection'](_0x14c588['model'],qs[_0x5f29('0x33')](_0x559579[_0x5f29('0x30')][_0x5f29('0x33')]));_0x38f420[_0x5f29('0x31')]=_0x38f420[_0x5f29('0x31')][_0x5f29('0x34')]?_0x38f420[_0x5f29('0x31')]:_0x14c588[_0x5f29('0x2e')];if(_0x559579[_0x5f29('0x30')][_0x5f29('0x41')]){_0x38f420[_0x5f29('0x42')]=[{'all':!![]}];}_0x38f420=_[_0x5f29('0x3d')]({},_0x38f420,_0x559579[_0x5f29('0x40')]);return db['SalesforceField'][_0x5f29('0x48')](_0x38f420)[_0x5f29('0x23')](handleEntityNotFound(_0x51379a,null))[_0x5f29('0x23')](respondWithResult(_0x51379a,null))['catch'](handleError(_0x51379a,null));};exports[_0x5f29('0x49')]=function(_0xcceed5,_0x1619eb){return db[_0x5f29('0x2b')][_0x5f29('0x49')](_0xcceed5[_0x5f29('0x4a')],{})[_0x5f29('0x23')](respondWithResult(_0x1619eb,0xc9))[_0x5f29('0x45')](handleError(_0x1619eb,null));};exports[_0x5f29('0x22')]=function(_0x5056f5,_0x24ffbd){if(_0x5056f5[_0x5f29('0x4a')]['id']){delete _0x5056f5[_0x5f29('0x4a')]['id'];}return db[_0x5f29('0x2b')]['find']({'where':{'id':_0x5056f5['params']['id']}})[_0x5f29('0x23')](handleEntityNotFound(_0x24ffbd,null))[_0x5f29('0x23')](saveUpdates(_0x5056f5[_0x5f29('0x4a')],null))[_0x5f29('0x23')](respondWithResult(_0x24ffbd,null))[_0x5f29('0x45')](handleError(_0x24ffbd,null));};exports[_0x5f29('0x24')]=function(_0x40fb20,_0x23df8f){return db[_0x5f29('0x2b')]['find']({'where':{'id':_0x40fb20[_0x5f29('0x47')]['id']}})[_0x5f29('0x23')](handleEntityNotFound(_0x23df8f,null))[_0x5f29('0x23')](removeEntity(_0x23df8f,null))[_0x5f29('0x45')](handleError(_0x23df8f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b94abf2..6dbf958 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 _0x9ff0=['define','SalesforceField','int_salesforce_fields','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x4d45f5,_0x2b6dea){var _0x255f94=function(_0x25216d){while(--_0x25216d){_0x4d45f5['push'](_0x4d45f5['shift']());}};_0x255f94(++_0x2b6dea);}(_0x9ff0,0x1f3));var _0x09ff=function(_0x31bdaa,_0x38fe64){_0x31bdaa=_0x31bdaa-0x0;var _0x1a04ec=_0x9ff0[_0x31bdaa];return _0x1a04ec;};'use strict';var _=require(_0x09ff('0x0'));var util=require(_0x09ff('0x1'));var logger=require(_0x09ff('0x2'))(_0x09ff('0x3'));var moment=require(_0x09ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x09ff('0x5'));var fs=require('fs');var path=require(_0x09ff('0x6'));var rimraf=require(_0x09ff('0x7'));var config=require(_0x09ff('0x8'));var attributes=require(_0x09ff('0x9'));module[_0x09ff('0xa')]=function(_0x21010f,_0x2a2a6f){return _0x21010f[_0x09ff('0xb')](_0x09ff('0xc'),attributes,{'tableName':_0x09ff('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x09ff('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b44=['int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intSalesforceField.attributes','define','SalesforceField'];(function(_0x51c454,_0x425fa8){var _0x16d76b=function(_0x744202){while(--_0x744202){_0x51c454['push'](_0x51c454['shift']());}};_0x16d76b(++_0x425fa8);}(_0x2b44,0x1b0));var _0x42b4=function(_0x103cb6,_0x27f8c9){_0x103cb6=_0x103cb6-0x0;var _0x20d810=_0x2b44[_0x103cb6];return _0x20d810;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require(_0x42b4('0x2'))('api');var moment=require(_0x42b4('0x3'));var BPromise=require(_0x42b4('0x4'));var rp=require(_0x42b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x42b4('0x6'));var attributes=require(_0x42b4('0x7'));module['exports']=function(_0x4936d9,_0xe2b28){return _0x4936d9[_0x42b4('0x8')](_0x42b4('0x9'),attributes,{'tableName':_0x42b4('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x42b4('0xb'),_0x42b4('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 fc61568..ed45e77 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 _0xb949=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x2b4dfa,_0x388568){var _0x26cb10=function(_0x4bf6e9){while(--_0x4bf6e9){_0x2b4dfa['push'](_0x2b4dfa['shift']());}};_0x26cb10(++_0x388568);}(_0xb949,0x177));var _0x9b94=function(_0x39df3c,_0x48fef3){_0x39df3c=_0x39df3c-0x0;var _0x3df031=_0xb949[_0x39df3c];return _0x3df031;};'use strict';var _=require(_0x9b94('0x0'));var util=require('util');var moment=require(_0x9b94('0x1'));var BPromise=require(_0x9b94('0x2'));var rs=require(_0x9b94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b94('0x4'))['db'];var utils=require(_0x9b94('0x5'));var logger=require(_0x9b94('0x6'))(_0x9b94('0x7'));var config=require(_0x9b94('0x8'));var jayson=require(_0x9b94('0x9'));var client=jayson[_0x9b94('0xa')][_0x9b94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e87f9,_0x358c8e,_0x3311e8){return new BPromise(function(_0x338490,_0x4e7d9c){return client[_0x9b94('0xc')](_0x1e87f9,_0x3311e8)[_0x9b94('0xd')](function(_0x5daa3a){logger[_0x9b94('0xe')](_0x9b94('0xf'),_0x358c8e,_0x9b94('0x10'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x358c8e,_0x9b94('0x10'),JSON[_0x9b94('0x11')](_0x5daa3a));if(_0x5daa3a[_0x9b94('0x12')]){if(_0x5daa3a[_0x9b94('0x12')][_0x9b94('0x13')]===0x1f4){logger[_0x9b94('0x12')](_0x9b94('0xf'),_0x358c8e,_0x5daa3a[_0x9b94('0x12')]['message']);return _0x4e7d9c(_0x5daa3a[_0x9b94('0x12')]['message']);}logger['error'](_0x9b94('0xf'),_0x358c8e,_0x5daa3a['error'][_0x9b94('0x14')]);return _0x338490(_0x5daa3a['error'][_0x9b94('0x14')]);}else{logger[_0x9b94('0xe')](_0x9b94('0xf'),_0x358c8e,_0x9b94('0x10'));_0x338490(_0x5daa3a[_0x9b94('0x15')][_0x9b94('0x14')]);}})[_0x9b94('0x16')](function(_0x41def7){logger['error'](_0x9b94('0xf'),_0x358c8e,_0x41def7);_0x4e7d9c(_0x41def7);});});} \ No newline at end of file +var _0x9a8e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x9a8e,0x17b));var _0xe9a8=function(_0x13a00a,_0x3209d0){_0x13a00a=_0x13a00a-0x0;var _0x164e71=_0x9a8e[_0x13a00a];return _0x164e71;};'use strict';var _=require(_0xe9a8('0x0'));var util=require(_0xe9a8('0x1'));var moment=require('moment');var BPromise=require(_0xe9a8('0x2'));var rs=require(_0xe9a8('0x3'));var fs=require('fs');var Redis=require(_0xe9a8('0x4'));var db=require(_0xe9a8('0x5'))['db'];var utils=require(_0xe9a8('0x6'));var logger=require('../../config/logger')(_0xe9a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x398750,_0x6210fa,_0x272c57){return new BPromise(function(_0x2b1477,_0x1e2d47){return client[_0xe9a8('0x8')](_0x398750,_0x272c57)[_0xe9a8('0x9')](function(_0x522c7c){logger['info'](_0xe9a8('0xa'),_0x6210fa,_0xe9a8('0xb'));logger['debug'](_0xe9a8('0xc'),_0x6210fa,_0xe9a8('0xb'),JSON[_0xe9a8('0xd')](_0x522c7c));if(_0x522c7c[_0xe9a8('0xe')]){if(_0x522c7c['error'][_0xe9a8('0xf')]===0x1f4){logger[_0xe9a8('0xe')]('SalesforceField,\x20%s,\x20%s',_0x6210fa,_0x522c7c[_0xe9a8('0xe')]['message']);return _0x1e2d47(_0x522c7c[_0xe9a8('0xe')][_0xe9a8('0x10')]);}logger[_0xe9a8('0xe')](_0xe9a8('0xa'),_0x6210fa,_0x522c7c[_0xe9a8('0xe')][_0xe9a8('0x10')]);return _0x2b1477(_0x522c7c[_0xe9a8('0xe')][_0xe9a8('0x10')]);}else{logger[_0xe9a8('0x11')](_0xe9a8('0xa'),_0x6210fa,_0xe9a8('0xb'));_0x2b1477(_0x522c7c[_0xe9a8('0x12')][_0xe9a8('0x10')]);}})[_0xe9a8('0x13')](function(_0x266928){logger['error']('SalesforceField,\x20%s,\x20%s',_0x6210fa,_0x266928);_0x1e2d47(_0x266928);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 5fac2f9..dd647d1 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 _0x3f43=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','/:id','update','delete'];(function(_0x3ece66,_0xfdb861){var _0x1aee8f=function(_0x5c381c){while(--_0x5c381c){_0x3ece66['push'](_0x3ece66['shift']());}};_0x1aee8f(++_0xfdb861);}(_0x3f43,0x1e6));var _0x33f4=function(_0x2d83b7,_0x395594){_0x2d83b7=_0x2d83b7-0x0;var _0x4d3f31=_0x3f43[_0x2d83b7];return _0x4d3f31;};'use strict';var multer=require(_0x33f4('0x0'));var util=require(_0x33f4('0x1'));var path=require(_0x33f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x33f4('0x3'));var router=express[_0x33f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x33f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x33f4('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x33f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x33f4('0x8')]);router[_0x33f4('0x7')]('/:id',auth[_0x33f4('0x9')](),controller[_0x33f4('0xa')]);router[_0x33f4('0x7')](_0x33f4('0xb'),auth[_0x33f4('0x9')](),controller[_0x33f4('0xc')]);router[_0x33f4('0x7')](_0x33f4('0xd'),auth[_0x33f4('0x9')](),controller['getFields']);router[_0x33f4('0xe')]('/',auth[_0x33f4('0x9')](),controller['create']);router[_0x33f4('0xe')](_0x33f4('0xb'),auth['isAuthenticated'](),controller[_0x33f4('0xf')]);router[_0x33f4('0x10')](_0x33f4('0x11'),auth['isAuthenticated'](),controller[_0x33f4('0x12')]);router[_0x33f4('0x13')](_0x33f4('0x11'),auth['isAuthenticated'](),controller[_0x33f4('0x14')]);module[_0x33f4('0x15')]=router; \ No newline at end of file +var _0x851a=['isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/configurations'];(function(_0xab2afb,_0x546bfb){var _0x25262b=function(_0x3bd92d){while(--_0x3bd92d){_0xab2afb['push'](_0xab2afb['shift']());}};_0x25262b(++_0x546bfb);}(_0x851a,0x19b));var _0xa851=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x851a[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xa851('0x0'));var util=require('util');var path=require(_0xa851('0x1'));var timeout=require(_0xa851('0x2'));var express=require(_0xa851('0x3'));var router=express[_0xa851('0x4')]();var fs_extra=require(_0xa851('0x5'));var auth=require(_0xa851('0x6'));var interaction=require(_0xa851('0x7'));var config=require(_0xa851('0x8'));var controller=require('./intServicenowAccount.controller');router[_0xa851('0x9')]('/',auth['isAuthenticated'](),controller[_0xa851('0xa')]);router[_0xa851('0x9')](_0xa851('0xb'),auth['isAuthenticated'](),controller[_0xa851('0xc')]);router[_0xa851('0x9')](_0xa851('0xd'),auth[_0xa851('0xe')](),controller['getConfigurations']);router[_0xa851('0x9')](_0xa851('0xf'),auth['isAuthenticated'](),controller[_0xa851('0x10')]);router[_0xa851('0x11')]('/',auth[_0xa851('0xe')](),controller[_0xa851('0x12')]);router[_0xa851('0x11')](_0xa851('0xd'),auth[_0xa851('0xe')](),controller[_0xa851('0x13')]);router[_0xa851('0x14')](_0xa851('0xb'),auth[_0xa851('0xe')](),controller[_0xa851('0x15')]);router[_0xa851('0x16')](_0xa851('0xb'),auth[_0xa851('0xe')](),controller[_0xa851('0x17')]);module[_0xa851('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9cfeb09..79bc51c 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 _0x2521=['sequelize','exports','STRING','username'];(function(_0x5ca000,_0x598855){var _0x2caa77=function(_0x1c0f38){while(--_0x1c0f38){_0x5ca000['push'](_0x5ca000['shift']());}};_0x2caa77(++_0x598855);}(_0x2521,0x1c4));var _0x1252=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0x2521[_0x216428];return _0x313dd4;};'use strict';var Sequelize=require(_0x1252('0x0'));module[_0x1252('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1252('0x2')]},'username':{'type':Sequelize[_0x1252('0x2')],'unique':_0x1252('0x3')},'password':{'type':Sequelize[_0x1252('0x2')]},'email':{'type':Sequelize[_0x1252('0x2')]},'remoteUri':{'type':Sequelize[_0x1252('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4346=['username','remoteUri','sequelize','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4346,0x126));var _0x6434=function(_0xbf09ab,_0x251a19){_0xbf09ab=_0xbf09ab-0x0;var _0x2a9aef=_0x4346[_0xbf09ab];return _0x2a9aef;};'use strict';var Sequelize=require(_0x6434('0x0'));module['exports']={'name':{'type':Sequelize[_0x6434('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6434('0x1')],'unique':_0x6434('0x2')},'password':{'type':Sequelize[_0x6434('0x1')]},'email':{'type':Sequelize[_0x6434('0x1')]},'remoteUri':{'type':Sequelize[_0x6434('0x1')],'unique':_0x6434('0x3')},'serverUrl':{'type':Sequelize[_0x6434('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c4b054c..59b59c0 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 _0xfe08=['sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','params','options','catch','create','body','update','find','getConfigurations','ServicenowConfiguration','order','addConfiguration','findOne','Subjects','channel','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','test','statusCode','error','stack','Wrong\x20credentials','boolean','True','true','False'];(function(_0x5b8499,_0x131622){var _0x50aa33=function(_0x1f97fd){while(--_0x1f97fd){_0x5b8499['push'](_0x5b8499['shift']());}};_0x50aa33(++_0x131622);}(_0xfe08,0xbf));var _0x8fe0=function(_0x49eb44,_0x724f7f){_0x49eb44=_0x49eb44-0x0;var _0x3ba34a=_0xfe08[_0x49eb44];return _0x3ba34a;};'use strict';var emlformat=require(_0x8fe0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fe0('0x1'));var jsonpatch=require(_0x8fe0('0x2'));var rp=require(_0x8fe0('0x3'));var moment=require(_0x8fe0('0x4'));var BPromise=require(_0x8fe0('0x5'));var Mustache=require('mustache');var util=require(_0x8fe0('0x6'));var path=require(_0x8fe0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8fe0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fe0('0x9'));var squel=require(_0x8fe0('0xa'));var crypto=require(_0x8fe0('0xb'));var jsforce=require(_0x8fe0('0xc'));var deskjs=require(_0x8fe0('0xd'));var toCsv=require(_0x8fe0('0xe'));var querystring=require(_0x8fe0('0xf'));var Papa=require(_0x8fe0('0x10'));var Redis=require(_0x8fe0('0x11'));var authService=require(_0x8fe0('0x12'));var qs=require(_0x8fe0('0x13'));var as=require(_0x8fe0('0x14'));var hardwareService=require(_0x8fe0('0x15'));var logger=require(_0x8fe0('0x16'))(_0x8fe0('0x17'));var utils=require(_0x8fe0('0x18'));var config=require(_0x8fe0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fe0('0x1a'))['db'];var integrations=require(_0x8fe0('0x1b'));function respondWithStatusCode(_0x372871,_0x26a5ce){_0x26a5ce=_0x26a5ce||0xcc;return function(_0x3ecd88){if(_0x3ecd88){return _0x372871[_0x8fe0('0x1c')](_0x26a5ce);}return _0x372871[_0x8fe0('0x1d')](_0x26a5ce)[_0x8fe0('0x1e')]();};}function respondWithResult(_0x1b4880,_0x3fa358){_0x3fa358=_0x3fa358||0xc8;return function(_0x1f6e38){if(_0x1f6e38){return _0x1b4880[_0x8fe0('0x1d')](_0x3fa358)[_0x8fe0('0x1f')](_0x1f6e38);}};}function respondWithFilteredResult(_0x487ade,_0x424858){return function(_0x2fd593){if(_0x2fd593){var _0x5e0ef8=typeof _0x424858[_0x8fe0('0x20')]===_0x8fe0('0x21')&&typeof _0x424858['limit']==='undefined';var _0x49a177=_0x2fd593[_0x8fe0('0x22')];var _0x5e799c=_0x5e0ef8?0x0:_0x424858[_0x8fe0('0x20')];var _0x507779=_0x5e0ef8?_0x2fd593['count']:_0x424858[_0x8fe0('0x20')]+_0x424858[_0x8fe0('0x23')];var _0x161b30;if(_0x507779>=_0x49a177){_0x507779=_0x49a177;_0x161b30=0xc8;}else{_0x161b30=0xce;}_0x487ade[_0x8fe0('0x1d')](_0x161b30);return _0x487ade['set'](_0x8fe0('0x24'),_0x5e799c+'-'+_0x507779+'/'+_0x49a177)[_0x8fe0('0x1f')](_0x2fd593);}return null;};}function patchUpdates(_0x49e795){return function(_0x4cf07a){try{jsonpatch['apply'](_0x4cf07a,_0x49e795,!![]);}catch(_0x3d52fb){return BPromise[_0x8fe0('0x25')](_0x3d52fb);}return _0x4cf07a[_0x8fe0('0x26')]();};}function saveUpdates(_0x173370,_0x391853){return function(_0x1183ce){if(_0x1183ce){return _0x1183ce['update'](_0x173370)[_0x8fe0('0x27')](function(_0x32ef90){return _0x32ef90;});}return null;};}function removeEntity(_0x5301a3,_0x582dbf){return function(_0x2b496c){if(_0x2b496c){return _0x2b496c[_0x8fe0('0x28')]()[_0x8fe0('0x27')](function(){_0x5301a3[_0x8fe0('0x1d')](0xcc)[_0x8fe0('0x1e')]();});}};}function handleEntityNotFound(_0x23fd8e,_0x1f7fbb){return function(_0x16826e){if(!_0x16826e){_0x23fd8e[_0x8fe0('0x1c')](0x194);}return _0x16826e;};}function handleError(_0x28e9e9,_0x46344d){_0x46344d=_0x46344d||0x1f4;return function(_0x20b477){logger['error'](_0x20b477['stack']);if(_0x20b477[_0x8fe0('0x29')]){delete _0x20b477['name'];}_0x28e9e9[_0x8fe0('0x1d')](_0x46344d)[_0x8fe0('0x2a')](_0x20b477);};}exports[_0x8fe0('0x2b')]=function(_0x208593,_0x5be3b3){var _0x6ef812={},_0x51fe2c={},_0x16dbc9={'count':0x0,'rows':[]};var _0x5213ef=_['map'](db[_0x8fe0('0x2c')][_0x8fe0('0x2d')],function(_0x39b5b7){return{'name':_0x39b5b7[_0x8fe0('0x2e')],'type':_0x39b5b7[_0x8fe0('0x2f')]['key']};});_0x51fe2c['model']=_[_0x8fe0('0x30')](_0x5213ef,_0x8fe0('0x29'));_0x51fe2c[_0x8fe0('0x31')]=_[_0x8fe0('0x32')](_0x208593['query']);_0x51fe2c['filters']=_[_0x8fe0('0x33')](_0x51fe2c[_0x8fe0('0x34')],_0x51fe2c[_0x8fe0('0x31')]);_0x6ef812[_0x8fe0('0x35')]=_['intersection'](_0x51fe2c[_0x8fe0('0x34')],qs[_0x8fe0('0x36')](_0x208593['query'][_0x8fe0('0x36')]));_0x6ef812[_0x8fe0('0x35')]=_0x6ef812[_0x8fe0('0x35')][_0x8fe0('0x37')]?_0x6ef812['attributes']:_0x51fe2c['model'];if(!_0x208593[_0x8fe0('0x31')][_0x8fe0('0x38')](_0x8fe0('0x39'))){_0x6ef812['limit']=qs['limit'](_0x208593['query'][_0x8fe0('0x23')]);_0x6ef812['offset']=qs[_0x8fe0('0x20')](_0x208593[_0x8fe0('0x31')][_0x8fe0('0x20')]);}_0x6ef812['order']=qs['sort'](_0x208593[_0x8fe0('0x31')][_0x8fe0('0x3a')]);_0x6ef812[_0x8fe0('0x3b')]=qs[_0x8fe0('0x3c')](_[_0x8fe0('0x3d')](_0x208593[_0x8fe0('0x31')],_0x51fe2c['filters']),_0x5213ef);if(_0x208593['query'][_0x8fe0('0x3e')]){_0x6ef812[_0x8fe0('0x3b')]=_['merge'](_0x6ef812[_0x8fe0('0x3b')],{'$or':_[_0x8fe0('0x30')](_0x5213ef,function(_0x4eb874){if(_0x4eb874['type']!=='VIRTUAL'){var _0x3dcf4b={};_0x3dcf4b[_0x4eb874[_0x8fe0('0x29')]]={'$like':'%'+_0x208593['query'][_0x8fe0('0x3e')]+'%'};return _0x3dcf4b;}})});}_0x6ef812=_[_0x8fe0('0x3f')]({},_0x6ef812,_0x208593['options']);var _0x2c35f5={'where':_0x6ef812[_0x8fe0('0x3b')]};return db[_0x8fe0('0x2c')][_0x8fe0('0x22')](_0x2c35f5)[_0x8fe0('0x27')](function(_0x1979ee){_0x16dbc9[_0x8fe0('0x22')]=_0x1979ee;if(_0x208593[_0x8fe0('0x31')][_0x8fe0('0x40')]){_0x6ef812[_0x8fe0('0x41')]=[{'all':!![]}];}return db[_0x8fe0('0x2c')][_0x8fe0('0x42')](_0x6ef812);})['then'](function(_0x4631e3){_0x16dbc9[_0x8fe0('0x43')]=_0x4631e3;return _0x16dbc9;})[_0x8fe0('0x27')](respondWithFilteredResult(_0x5be3b3,_0x6ef812))['catch'](handleError(_0x5be3b3,null));};exports['show']=function(_0x1af863,_0x2c0010){var _0x4492e2={'raw':![],'where':{'id':_0x1af863[_0x8fe0('0x44')]['id']}},_0x27f20f={};_0x27f20f[_0x8fe0('0x34')]=_[_0x8fe0('0x32')](db['ServicenowAccount'][_0x8fe0('0x2d')]);_0x27f20f[_0x8fe0('0x31')]=_[_0x8fe0('0x32')](_0x1af863[_0x8fe0('0x31')]);_0x27f20f[_0x8fe0('0x3c')]=_['intersection'](_0x27f20f[_0x8fe0('0x34')],_0x27f20f[_0x8fe0('0x31')]);_0x4492e2[_0x8fe0('0x35')]=_[_0x8fe0('0x33')](_0x27f20f[_0x8fe0('0x34')],qs[_0x8fe0('0x36')](_0x1af863[_0x8fe0('0x31')]['fields']));_0x4492e2[_0x8fe0('0x35')]=_0x4492e2[_0x8fe0('0x35')]['length']?_0x4492e2['attributes']:_0x27f20f[_0x8fe0('0x34')];if(_0x1af863[_0x8fe0('0x31')][_0x8fe0('0x40')]){_0x4492e2['include']=[{'all':!![]}];}_0x4492e2=_[_0x8fe0('0x3f')]({},_0x4492e2,_0x1af863[_0x8fe0('0x45')]);return db[_0x8fe0('0x2c')]['find'](_0x4492e2)[_0x8fe0('0x27')](handleEntityNotFound(_0x2c0010,null))['then'](respondWithResult(_0x2c0010,null))[_0x8fe0('0x46')](handleError(_0x2c0010,null));};exports[_0x8fe0('0x47')]=function(_0x5af022,_0x39b34b){return db[_0x8fe0('0x2c')]['create'](_0x5af022[_0x8fe0('0x48')],{})[_0x8fe0('0x27')](respondWithResult(_0x39b34b,0xc9))['catch'](handleError(_0x39b34b,null));};exports[_0x8fe0('0x49')]=function(_0x3b1a65,_0x1c28e0){if(_0x3b1a65[_0x8fe0('0x48')]['id']){delete _0x3b1a65['body']['id'];}return db[_0x8fe0('0x2c')][_0x8fe0('0x4a')]({'where':{'id':_0x3b1a65[_0x8fe0('0x44')]['id']}})[_0x8fe0('0x27')](handleEntityNotFound(_0x1c28e0,null))[_0x8fe0('0x27')](saveUpdates(_0x3b1a65[_0x8fe0('0x48')],null))[_0x8fe0('0x27')](respondWithResult(_0x1c28e0,null))[_0x8fe0('0x46')](handleError(_0x1c28e0,null));};exports['destroy']=function(_0x204573,_0x560849){return db[_0x8fe0('0x2c')][_0x8fe0('0x4a')]({'where':{'id':_0x204573[_0x8fe0('0x44')]['id']}})[_0x8fe0('0x27')](handleEntityNotFound(_0x560849,null))['then'](removeEntity(_0x560849,null))[_0x8fe0('0x46')](handleError(_0x560849,null));};exports[_0x8fe0('0x4b')]=function(_0x28e186,_0xbb2a5f,_0x36da81){var _0x28e08d={};var _0x436893={};var _0x12e612;var _0x3f72ed;return db['ServicenowAccount']['findOne']({'where':{'id':_0x28e186[_0x8fe0('0x44')]['id']}})[_0x8fe0('0x27')](handleEntityNotFound(_0xbb2a5f,null))[_0x8fe0('0x27')](function(_0x502eee){if(_0x502eee){_0x12e612=_0x502eee;_0x436893[_0x8fe0('0x34')]=_[_0x8fe0('0x32')](db[_0x8fe0('0x4c')][_0x8fe0('0x2d')]);_0x436893['query']=_[_0x8fe0('0x32')](_0x28e186[_0x8fe0('0x31')]);_0x436893[_0x8fe0('0x3c')]=_[_0x8fe0('0x33')](_0x436893[_0x8fe0('0x34')],_0x436893['query']);_0x28e08d[_0x8fe0('0x35')]=_[_0x8fe0('0x33')](_0x436893[_0x8fe0('0x34')],qs[_0x8fe0('0x36')](_0x28e186['query'][_0x8fe0('0x36')]));_0x28e08d[_0x8fe0('0x35')]=_0x28e08d['attributes'][_0x8fe0('0x37')]?_0x28e08d[_0x8fe0('0x35')]:_0x436893[_0x8fe0('0x34')];_0x28e08d[_0x8fe0('0x4d')]=qs[_0x8fe0('0x3a')](_0x28e186['query'][_0x8fe0('0x3a')]);_0x28e08d[_0x8fe0('0x3b')]=qs[_0x8fe0('0x3c')](_[_0x8fe0('0x3d')](_0x28e186['query'],_0x436893[_0x8fe0('0x3c')]));if(_0x28e186[_0x8fe0('0x31')]['filter']){_0x28e08d[_0x8fe0('0x3b')]=_[_0x8fe0('0x3f')](_0x28e08d['where'],{'$or':_[_0x8fe0('0x30')](_0x28e08d[_0x8fe0('0x35')],function(_0xd42ea7){var _0x433af5={};_0x433af5[_0xd42ea7]={'$like':'%'+_0x28e186['query'][_0x8fe0('0x3e')]+'%'};return _0x433af5;})});}_0x28e08d=_[_0x8fe0('0x3f')]({},_0x28e08d,_0x28e186[_0x8fe0('0x45')]);return _0x12e612[_0x8fe0('0x4b')](_0x28e08d);}})[_0x8fe0('0x27')](function(_0x499e5b){if(_0x499e5b){_0x3f72ed=_0x499e5b[_0x8fe0('0x37')];if(!_0x28e186['query'][_0x8fe0('0x38')](_0x8fe0('0x39'))){_0x28e08d[_0x8fe0('0x23')]=qs[_0x8fe0('0x23')](_0x28e186[_0x8fe0('0x31')][_0x8fe0('0x23')]);_0x28e08d[_0x8fe0('0x20')]=qs[_0x8fe0('0x20')](_0x28e186[_0x8fe0('0x31')][_0x8fe0('0x20')]);}return _0x12e612[_0x8fe0('0x4b')](_0x28e08d);}})[_0x8fe0('0x27')](function(_0x2b4d4a){if(_0x2b4d4a){return _0x2b4d4a?{'count':_0x3f72ed,'rows':_0x2b4d4a}:null;}})[_0x8fe0('0x27')](respondWithResult(_0xbb2a5f,null))['catch'](handleError(_0xbb2a5f,null));};exports[_0x8fe0('0x4e')]=function(_0x20602e,_0x1c57b0,_0x52d2c0){if(_0x20602e['body']['id']){delete _0x20602e[_0x8fe0('0x48')]['id'];}return db[_0x8fe0('0x2c')][_0x8fe0('0x4f')]({'where':{'id':_0x20602e[_0x8fe0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c57b0,null))[_0x8fe0('0x27')](function(_0x36035b){if(_0x36035b){_0x20602e[_0x8fe0('0x48')]['AccountId']=_0x36035b['id'];_0x20602e[_0x8fe0('0x48')][_0x8fe0('0x50')]=integrations['getSubjects'](_0x20602e['body'][_0x8fe0('0x51')],_0x20602e['body'][_0x8fe0('0x2f')]);_0x20602e[_0x8fe0('0x48')]['Descriptions']=integrations['getDescriptions'](_0x20602e[_0x8fe0('0x48')][_0x8fe0('0x51')],_0x20602e['body'][_0x8fe0('0x2f')]);return db[_0x8fe0('0x4c')][_0x8fe0('0x47')](_0x20602e[_0x8fe0('0x48')],{'include':[{'model':db[_0x8fe0('0x52')],'as':_0x8fe0('0x50')},{'model':db[_0x8fe0('0x52')],'as':_0x8fe0('0x53')}]});}return null;})[_0x8fe0('0x27')](respondWithResult(_0x1c57b0,null))[_0x8fe0('0x46')](handleError(_0x1c57b0,null));};exports[_0x8fe0('0x54')]=function(_0x37a53a,_0xaa570b,_0x371ec9){var _0x5d5a09=[_0x8fe0('0x55'),'hold_reason',_0x8fe0('0x56'),_0x8fe0('0x57'),_0x8fe0('0x58'),_0x8fe0('0x59'),_0x8fe0('0x5a'),_0x8fe0('0x5b'),_0x8fe0('0x5c')];var _0x3dcd89=['parent',_0x8fe0('0x55'),_0x8fe0('0x5d'),'watch_list',_0x8fe0('0x5e'),_0x8fe0('0x5f'),_0x8fe0('0x60'),_0x8fe0('0x61'),_0x8fe0('0x62'),_0x8fe0('0x63'),'resolved_by','sys_updated_by',_0x8fe0('0x64'),_0x8fe0('0x65'),_0x8fe0('0x66'),_0x8fe0('0x67'),'state',_0x8fe0('0x68'),_0x8fe0('0x56'),_0x8fe0('0x4d'),_0x8fe0('0x69'),_0x8fe0('0x6a'),_0x8fe0('0x6b'),'delivery_plan','impact',_0x8fe0('0x6c'),_0x8fe0('0x6d'),_0x8fe0('0x6e'),_0x8fe0('0x6f'),_0x8fe0('0x70'),_0x8fe0('0x71'),'time_worked',_0x8fe0('0x72'),_0x8fe0('0x73'),_0x8fe0('0x74'),_0x8fe0('0x75'),_0x8fe0('0x76'),_0x8fe0('0x77'),_0x8fe0('0x78'),_0x8fe0('0x79'),_0x8fe0('0x7a'),'subcategory','work_notes',_0x8fe0('0x7b'),_0x8fe0('0x58'),_0x8fe0('0x7c'),_0x8fe0('0x7d'),_0x8fe0('0x7e'),_0x8fe0('0x7f'),_0x8fe0('0x80'),'additional_assignee_list',_0x8fe0('0x81'),'calendar_duration',_0x8fe0('0x59'),_0x8fe0('0x82'),_0x8fe0('0x83'),_0x8fe0('0x84'),_0x8fe0('0x85'),'parent_incident',_0x8fe0('0x86'),_0x8fe0('0x87'),'reopened_by',_0x8fe0('0x5a'),'urgency',_0x8fe0('0x88'),_0x8fe0('0x89'),_0x8fe0('0x8a'),_0x8fe0('0x8b'),_0x8fe0('0x8c'),_0x8fe0('0x5b'),_0x8fe0('0x8d'),_0x8fe0('0x8e'),_0x8fe0('0x8f'),'comments_and_work_notes',_0x8fe0('0x90'),_0x8fe0('0x91'),_0x8fe0('0x92'),_0x8fe0('0x93'),_0x8fe0('0x94'),_0x8fe0('0x95'),_0x8fe0('0x96'),_0x8fe0('0x97'),_0x8fe0('0x5c')];var _0x787d6f='';var _0x4505f9='';var _0x4e1e80=[];var _0x5a3d2f='';var _0x1ea074='';var _0x3bd41c=[];var _0x1d2fc9='';var _0x17e095='';var _0x2801b1={};var _0x3fb48b='';return db['ServicenowAccount'][_0x8fe0('0x4f')]({'where':{'id':_0x37a53a['params']['id']},'attributes':['id',_0x8fe0('0x98'),_0x8fe0('0x99'),'email',_0x8fe0('0x9a'),_0x8fe0('0x9b')]})[_0x8fe0('0x27')](handleEntityNotFound(_0xaa570b,null))[_0x8fe0('0x27')](function(_0x2c2f34){if(_0x2c2f34){_0x3fb48b=_0x2c2f34[_0x8fe0('0x9a')];var _0xfe59ec=_0x3fb48b[_0x8fe0('0x9c')](-0x1);if(_0xfe59ec==='/'){_0x3fb48b=_0x3fb48b['substring'](0x0,_0x3fb48b['lastIndexOf'](_0xfe59ec));}_0x17e095=util[_0x8fe0('0x9d')](_0x8fe0('0x9e'),_0x3fb48b);_0x1d2fc9=util[_0x8fe0('0x9d')](_0x8fe0('0x9f'),_0x3fb48b);_0x2801b1={'user':_0x2c2f34['username'],'pass':_0x2c2f34['password']};var _0x592ff2={'method':_0x8fe0('0xa0'),'uri':_0x17e095+_0x8fe0('0xa1'),'auth':_0x2801b1,'json':!![]};return rp(_0x592ff2);}})[_0x8fe0('0x27')](function(_0x34a4ed){if(_0x34a4ed[_0x8fe0('0xa2')]['length']>0x0){_0x787d6f=_0x34a4ed[_0x8fe0('0xa2')];}console[_0x8fe0('0xa3')]('incident\x20table\x20objects',_0x787d6f);_0x3bd41c=[];_0x4505f9=Object[_0x8fe0('0xa4')]([],_0x787d6f);_[_0x8fe0('0xa5')](_0x4505f9,function(_0x5201c8){return!_0x5d5a09[_0x8fe0('0xa6')](_0x5201c8['name']);});_0x4505f9['forEach'](function(_0x52204b){var _0x324d7a=createFieldObject(_0x1d2fc9,_0x2801b1,_0x52204b[_0x8fe0('0xa7')],_0x52204b['name'],_0x52204b[_0x8fe0('0xa8')],![]);_0x3bd41c[_0x8fe0('0xa9')](_0x324d7a);});return Promise[_0x8fe0('0xaa')](_0x3bd41c);})[_0x8fe0('0x27')](function(_0x27005d){_0x4e1e80=_0x27005d;_0x5a3d2f=Object[_0x8fe0('0xa4')]([],_0x787d6f);console[_0x8fe0('0xa3')]('TCL:\x20_object',_0x787d6f);_[_0x8fe0('0xa5')](_0x5a3d2f,function(_0x37d117){return _0x3dcd89['includes'](_0x37d117[_0x8fe0('0x29')]);});console['log'](_0x8fe0('0xab'),_0x5a3d2f);_0x3bd41c=[];_0x5a3d2f[_0x8fe0('0xac')](function(_0x3098c4){var _0x39d019=createFieldObject(_0x1d2fc9,_0x2801b1,_0x3098c4[_0x8fe0('0xa7')],_0x3098c4[_0x8fe0('0x29')],_0x3098c4[_0x8fe0('0xa8')],!![]);_0x3bd41c[_0x8fe0('0xa9')](_0x39d019);});return Promise[_0x8fe0('0xaa')](_0x3bd41c);})[_0x8fe0('0x27')](function(_0x4b0bb0){_0x1ea074=_0x4b0bb0;var _0x5f2c82=_0x4e1e80[_0x8fe0('0xad')](_0x1ea074);return{'count':_0x5f2c82['length'],'rows':_0x5f2c82};})[_0x8fe0('0x27')](respondWithResult(_0xaa570b,null))[_0x8fe0('0x46')](function(_0x169fd5){console['log']('ServiceNow\x20error:\x20'+_0x169fd5);var _0x15fe4b=_0x37a53a[_0x8fe0('0x31')][_0x8fe0('0xae')]?0x1f4:_0x169fd5[_0x8fe0('0xaf')]||0x1f4;logger[_0x8fe0('0xb0')](_0x169fd5[_0x8fe0('0xb1')]);delete _0x169fd5[_0x8fe0('0x29')];if(_0x15fe4b===0x191){_0x15fe4b=0x190;}_0xaa570b['status'](_0x15fe4b)['send'](_0x37a53a[_0x8fe0('0x31')][_0x8fe0('0xae')]?{'message':_0x8fe0('0xb2'),'statusCode':_0x169fd5[_0x8fe0('0xaf')]}:_0x169fd5);});};function createFieldObject(_0x29bb93,_0x3db549,_0x504f5a,_0x23ca6f,_0x114e79,_0x17cac4){return new Promise(function(_0x1585db,_0x24b34a){var _0x4dae93={'id':_0x23ca6f,'name':_0x114e79,'custom':_0x17cac4};if(_0x504f5a===_0x8fe0('0xb3')){_0x4dae93[_0x8fe0('0x45')]=[{'name':_0x8fe0('0xb4'),'value':_0x8fe0('0xb5')},{'name':_0x8fe0('0xb6'),'value':'false'}];_0x1585db(_0x4dae93);}else{var _0x4752cf={'method':_0x8fe0('0xa0'),'uri':_0x29bb93+_0x8fe0('0xb7')+_0x23ca6f,'auth':_0x3db549,'json':!![]};return rp(_0x4752cf)[_0x8fe0('0x27')](function(_0x4cf4f0){var _0x3646c2=[];if(_0x4cf4f0[_0x8fe0('0xa2')][_0x8fe0('0x37')]>0x0){_0x4cf4f0[_0x8fe0('0xa2')][_0x8fe0('0xac')](function(_0x2068e5){if(_0x2068e5[_0x8fe0('0xb8')]===_0x8fe0('0xb9')){var _0x551d48={'name':_0x2068e5[_0x8fe0('0xa8')],'value':_0x2068e5[_0x8fe0('0xba')]};_0x3646c2[_0x8fe0('0xa9')](_0x551d48);}});}_0x4dae93['options']=_0x3646c2;if(_0x4dae93[_0x8fe0('0x45')][_0x8fe0('0x37')]>0x0){_0x1585db(_0x4dae93);}else{if(_0x17cac4==![]){_0x1585db();}else{_0x1585db(_0x4dae93);}}});}});} \ No newline at end of file +var _0x0175=['work_end','reopened_time','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','internalType','label','push','all','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','options','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','getConfigurations','findOne','ServicenowConfiguration','order','merge','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list'];(function(_0x49daca,_0x4c63f3){var _0x6fe200=function(_0x6809ff){while(--_0x6809ff){_0x49daca['push'](_0x49daca['shift']());}};_0x6fe200(++_0x4c63f3);}(_0x0175,0x1cc));var _0x5017=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0x0175[_0x16e0f5];return _0x4839d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5017('0x0'));var jsonpatch=require(_0x5017('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5017('0x2'));var util=require('util');var path=require(_0x5017('0x3'));var sox=require(_0x5017('0x4'));var csv=require('to-csv');var ejs=require(_0x5017('0x5'));var fs=require('fs');var fs_extra=require(_0x5017('0x6'));var _=require(_0x5017('0x7'));var squel=require(_0x5017('0x8'));var crypto=require(_0x5017('0x9'));var jsforce=require(_0x5017('0xa'));var deskjs=require(_0x5017('0xb'));var toCsv=require(_0x5017('0xc'));var querystring=require('querystring');var Papa=require(_0x5017('0xd'));var Redis=require(_0x5017('0xe'));var authService=require(_0x5017('0xf'));var qs=require(_0x5017('0x10'));var as=require(_0x5017('0x11'));var hardwareService=require(_0x5017('0x12'));var logger=require(_0x5017('0x13'))(_0x5017('0x14'));var utils=require(_0x5017('0x15'));var config=require(_0x5017('0x16'));var licenseUtil=require(_0x5017('0x17'));var db=require(_0x5017('0x18'))['db'];var integrations=require(_0x5017('0x19'));function respondWithStatusCode(_0x4f6adf,_0x148f24){_0x148f24=_0x148f24||0xcc;return function(_0x1ef5f6){if(_0x1ef5f6){return _0x4f6adf[_0x5017('0x1a')](_0x148f24);}return _0x4f6adf[_0x5017('0x1b')](_0x148f24)[_0x5017('0x1c')]();};}function respondWithResult(_0x40fd9f,_0x55844b){_0x55844b=_0x55844b||0xc8;return function(_0x484f1a){if(_0x484f1a){return _0x40fd9f[_0x5017('0x1b')](_0x55844b)[_0x5017('0x1d')](_0x484f1a);}};}function respondWithFilteredResult(_0x45440b,_0x1ff71a){return function(_0x284bee){if(_0x284bee){var _0x538401=typeof _0x1ff71a['offset']==='undefined'&&typeof _0x1ff71a['limit']===_0x5017('0x1e');var _0x3a5ea7=_0x284bee['count'];var _0x41c524=_0x538401?0x0:_0x1ff71a[_0x5017('0x1f')];var _0x97ef75=_0x538401?_0x284bee[_0x5017('0x20')]:_0x1ff71a[_0x5017('0x1f')]+_0x1ff71a[_0x5017('0x21')];var _0xec524e;if(_0x97ef75>=_0x3a5ea7){_0x97ef75=_0x3a5ea7;_0xec524e=0xc8;}else{_0xec524e=0xce;}_0x45440b[_0x5017('0x1b')](_0xec524e);return _0x45440b['set'](_0x5017('0x22'),_0x41c524+'-'+_0x97ef75+'/'+_0x3a5ea7)[_0x5017('0x1d')](_0x284bee);}return null;};}function patchUpdates(_0x15e5be){return function(_0x84e0e7){try{jsonpatch[_0x5017('0x23')](_0x84e0e7,_0x15e5be,!![]);}catch(_0x14da6b){return BPromise[_0x5017('0x24')](_0x14da6b);}return _0x84e0e7[_0x5017('0x25')]();};}function saveUpdates(_0xdde087,_0x1ff76a){return function(_0x2c27bf){if(_0x2c27bf){return _0x2c27bf['update'](_0xdde087)[_0x5017('0x26')](function(_0x5b6ecb){return _0x5b6ecb;});}return null;};}function removeEntity(_0x1d3823,_0x20c096){return function(_0x590f78){if(_0x590f78){return _0x590f78[_0x5017('0x27')]()[_0x5017('0x26')](function(){_0x1d3823[_0x5017('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304ae2,_0x4a329b){return function(_0x532626){if(!_0x532626){_0x304ae2['sendStatus'](0x194);}return _0x532626;};}function handleError(_0x186d06,_0x4a358e){_0x4a358e=_0x4a358e||0x1f4;return function(_0x2e9387){logger[_0x5017('0x28')](_0x2e9387[_0x5017('0x29')]);if(_0x2e9387[_0x5017('0x2a')]){delete _0x2e9387['name'];}_0x186d06['status'](_0x4a358e)[_0x5017('0x2b')](_0x2e9387);};}exports[_0x5017('0x2c')]=function(_0xa71c13,_0x4c0a96){var _0x36b3cc={},_0x3adf29={},_0x4279f8={'count':0x0,'rows':[]};var _0x823a2b=_[_0x5017('0x2d')](db[_0x5017('0x2e')]['rawAttributes'],function(_0x131075){return{'name':_0x131075[_0x5017('0x2f')],'type':_0x131075[_0x5017('0x30')][_0x5017('0x31')]};});_0x3adf29[_0x5017('0x32')]=_[_0x5017('0x2d')](_0x823a2b,_0x5017('0x2a'));_0x3adf29['query']=_[_0x5017('0x33')](_0xa71c13[_0x5017('0x34')]);_0x3adf29[_0x5017('0x35')]=_['intersection'](_0x3adf29[_0x5017('0x32')],_0x3adf29[_0x5017('0x34')]);_0x36b3cc[_0x5017('0x36')]=_[_0x5017('0x37')](_0x3adf29['model'],qs[_0x5017('0x38')](_0xa71c13['query']['fields']));_0x36b3cc[_0x5017('0x36')]=_0x36b3cc[_0x5017('0x36')][_0x5017('0x39')]?_0x36b3cc['attributes']:_0x3adf29['model'];if(!_0xa71c13['query'][_0x5017('0x3a')]('nolimit')){_0x36b3cc[_0x5017('0x21')]=qs[_0x5017('0x21')](_0xa71c13['query']['limit']);_0x36b3cc['offset']=qs['offset'](_0xa71c13['query']['offset']);}_0x36b3cc['order']=qs[_0x5017('0x3b')](_0xa71c13[_0x5017('0x34')]['sort']);_0x36b3cc[_0x5017('0x3c')]=qs['filters'](_[_0x5017('0x3d')](_0xa71c13[_0x5017('0x34')],_0x3adf29[_0x5017('0x35')]),_0x823a2b);if(_0xa71c13[_0x5017('0x34')][_0x5017('0x3e')]){_0x36b3cc[_0x5017('0x3c')]=_['merge'](_0x36b3cc[_0x5017('0x3c')],{'$or':_['map'](_0x823a2b,function(_0xb3c2fe){if(_0xb3c2fe['type']!=='VIRTUAL'){var _0x271552={};_0x271552[_0xb3c2fe[_0x5017('0x2a')]]={'$like':'%'+_0xa71c13[_0x5017('0x34')][_0x5017('0x3e')]+'%'};return _0x271552;}})});}_0x36b3cc=_['merge']({},_0x36b3cc,_0xa71c13[_0x5017('0x3f')]);var _0x2f805f={'where':_0x36b3cc[_0x5017('0x3c')]};return db[_0x5017('0x2e')][_0x5017('0x20')](_0x2f805f)[_0x5017('0x26')](function(_0x22b774){_0x4279f8[_0x5017('0x20')]=_0x22b774;if(_0xa71c13[_0x5017('0x34')]['includeAll']){_0x36b3cc['include']=[{'all':!![]}];}return db[_0x5017('0x2e')]['findAll'](_0x36b3cc);})[_0x5017('0x26')](function(_0x95c315){_0x4279f8[_0x5017('0x40')]=_0x95c315;return _0x4279f8;})[_0x5017('0x26')](respondWithFilteredResult(_0x4c0a96,_0x36b3cc))[_0x5017('0x41')](handleError(_0x4c0a96,null));};exports[_0x5017('0x42')]=function(_0x2f09e1,_0x54faf4){var _0x1fe48e={'raw':![],'where':{'id':_0x2f09e1[_0x5017('0x43')]['id']}},_0x32224d={};_0x32224d[_0x5017('0x32')]=_[_0x5017('0x33')](db['ServicenowAccount'][_0x5017('0x44')]);_0x32224d[_0x5017('0x34')]=_[_0x5017('0x33')](_0x2f09e1['query']);_0x32224d[_0x5017('0x35')]=_[_0x5017('0x37')](_0x32224d[_0x5017('0x32')],_0x32224d[_0x5017('0x34')]);_0x1fe48e[_0x5017('0x36')]=_['intersection'](_0x32224d[_0x5017('0x32')],qs[_0x5017('0x38')](_0x2f09e1[_0x5017('0x34')][_0x5017('0x38')]));_0x1fe48e[_0x5017('0x36')]=_0x1fe48e[_0x5017('0x36')]['length']?_0x1fe48e[_0x5017('0x36')]:_0x32224d['model'];if(_0x2f09e1[_0x5017('0x34')][_0x5017('0x45')]){_0x1fe48e['include']=[{'all':!![]}];}_0x1fe48e=_['merge']({},_0x1fe48e,_0x2f09e1[_0x5017('0x3f')]);return db[_0x5017('0x2e')]['find'](_0x1fe48e)[_0x5017('0x26')](handleEntityNotFound(_0x54faf4,null))[_0x5017('0x26')](respondWithResult(_0x54faf4,null))[_0x5017('0x41')](handleError(_0x54faf4,null));};exports['create']=function(_0xd8be1a,_0x4b9c48){return db[_0x5017('0x2e')][_0x5017('0x46')](_0xd8be1a[_0x5017('0x47')],{})['then'](respondWithResult(_0x4b9c48,0xc9))[_0x5017('0x41')](handleError(_0x4b9c48,null));};exports[_0x5017('0x48')]=function(_0x4f2163,_0x1768a4){if(_0x4f2163[_0x5017('0x47')]['id']){delete _0x4f2163[_0x5017('0x47')]['id'];}return db[_0x5017('0x2e')][_0x5017('0x49')]({'where':{'id':_0x4f2163[_0x5017('0x43')]['id']}})[_0x5017('0x26')](handleEntityNotFound(_0x1768a4,null))[_0x5017('0x26')](saveUpdates(_0x4f2163[_0x5017('0x47')],null))['then'](respondWithResult(_0x1768a4,null))['catch'](handleError(_0x1768a4,null));};exports[_0x5017('0x27')]=function(_0x4909ba,_0x307c5c){return db[_0x5017('0x2e')][_0x5017('0x49')]({'where':{'id':_0x4909ba['params']['id']}})[_0x5017('0x26')](handleEntityNotFound(_0x307c5c,null))[_0x5017('0x26')](removeEntity(_0x307c5c,null))['catch'](handleError(_0x307c5c,null));};exports[_0x5017('0x4a')]=function(_0x35c90f,_0x31122a,_0x357c03){var _0x96509d={};var _0x2ff229={};var _0x3e889e;var _0x30ae42;return db[_0x5017('0x2e')][_0x5017('0x4b')]({'where':{'id':_0x35c90f[_0x5017('0x43')]['id']}})[_0x5017('0x26')](handleEntityNotFound(_0x31122a,null))[_0x5017('0x26')](function(_0x4fddfa){if(_0x4fddfa){_0x3e889e=_0x4fddfa;_0x2ff229[_0x5017('0x32')]=_[_0x5017('0x33')](db[_0x5017('0x4c')][_0x5017('0x44')]);_0x2ff229[_0x5017('0x34')]=_['keys'](_0x35c90f['query']);_0x2ff229[_0x5017('0x35')]=_[_0x5017('0x37')](_0x2ff229['model'],_0x2ff229['query']);_0x96509d[_0x5017('0x36')]=_['intersection'](_0x2ff229[_0x5017('0x32')],qs[_0x5017('0x38')](_0x35c90f[_0x5017('0x34')][_0x5017('0x38')]));_0x96509d['attributes']=_0x96509d[_0x5017('0x36')]['length']?_0x96509d[_0x5017('0x36')]:_0x2ff229['model'];_0x96509d[_0x5017('0x4d')]=qs[_0x5017('0x3b')](_0x35c90f['query'][_0x5017('0x3b')]);_0x96509d[_0x5017('0x3c')]=qs[_0x5017('0x35')](_[_0x5017('0x3d')](_0x35c90f['query'],_0x2ff229[_0x5017('0x35')]));if(_0x35c90f['query'][_0x5017('0x3e')]){_0x96509d[_0x5017('0x3c')]=_[_0x5017('0x4e')](_0x96509d[_0x5017('0x3c')],{'$or':_['map'](_0x96509d['attributes'],function(_0x5a16e1){var _0x446d13={};_0x446d13[_0x5a16e1]={'$like':'%'+_0x35c90f['query'][_0x5017('0x3e')]+'%'};return _0x446d13;})});}_0x96509d=_[_0x5017('0x4e')]({},_0x96509d,_0x35c90f[_0x5017('0x3f')]);return _0x3e889e[_0x5017('0x4a')](_0x96509d);}})[_0x5017('0x26')](function(_0x3446a8){if(_0x3446a8){_0x30ae42=_0x3446a8[_0x5017('0x39')];if(!_0x35c90f[_0x5017('0x34')][_0x5017('0x3a')](_0x5017('0x4f'))){_0x96509d[_0x5017('0x21')]=qs[_0x5017('0x21')](_0x35c90f[_0x5017('0x34')][_0x5017('0x21')]);_0x96509d['offset']=qs[_0x5017('0x1f')](_0x35c90f[_0x5017('0x34')][_0x5017('0x1f')]);}return _0x3e889e['getConfigurations'](_0x96509d);}})[_0x5017('0x26')](function(_0x55dbe5){if(_0x55dbe5){return _0x55dbe5?{'count':_0x30ae42,'rows':_0x55dbe5}:null;}})['then'](respondWithResult(_0x31122a,null))[_0x5017('0x41')](handleError(_0x31122a,null));};exports[_0x5017('0x50')]=function(_0x35fb36,_0x39d57c,_0xe72279){if(_0x35fb36['body']['id']){delete _0x35fb36[_0x5017('0x47')]['id'];}return db[_0x5017('0x2e')][_0x5017('0x4b')]({'where':{'id':_0x35fb36[_0x5017('0x43')]['id']}})[_0x5017('0x26')](handleEntityNotFound(_0x39d57c,null))[_0x5017('0x26')](function(_0x27c5ac){if(_0x27c5ac){_0x35fb36[_0x5017('0x47')][_0x5017('0x51')]=_0x27c5ac['id'];_0x35fb36[_0x5017('0x47')][_0x5017('0x52')]=integrations[_0x5017('0x53')](_0x35fb36[_0x5017('0x47')][_0x5017('0x54')],_0x35fb36[_0x5017('0x47')]['type']);_0x35fb36[_0x5017('0x47')][_0x5017('0x55')]=integrations[_0x5017('0x56')](_0x35fb36[_0x5017('0x47')][_0x5017('0x54')],_0x35fb36['body'][_0x5017('0x30')]);return db[_0x5017('0x4c')][_0x5017('0x46')](_0x35fb36[_0x5017('0x47')],{'include':[{'model':db[_0x5017('0x57')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x5017('0x55')}]});}return null;})[_0x5017('0x26')](respondWithResult(_0x39d57c,null))['catch'](handleError(_0x39d57c,null));};exports[_0x5017('0x58')]=function(_0x2d83a1,_0x2adde8,_0x375d9b){var _0xfd393a=[_0x5017('0x59'),'hold_reason',_0x5017('0x5a'),_0x5017('0x5b'),_0x5017('0x5c'),_0x5017('0x5d'),_0x5017('0x5e'),_0x5017('0x5f'),_0x5017('0x60')];var _0x5c9709=[_0x5017('0x61'),_0x5017('0x59'),'caused_by',_0x5017('0x62'),_0x5017('0x63'),_0x5017('0x64'),_0x5017('0x65'),_0x5017('0x66'),_0x5017('0x67'),_0x5017('0x68'),_0x5017('0x69'),_0x5017('0x6a'),_0x5017('0x6b'),_0x5017('0x6c'),_0x5017('0x6d'),_0x5017('0x6e'),_0x5017('0x6f'),_0x5017('0x70'),_0x5017('0x5a'),_0x5017('0x4d'),_0x5017('0x71'),_0x5017('0x72'),_0x5017('0x73'),_0x5017('0x74'),_0x5017('0x75'),_0x5017('0x76'),_0x5017('0x77'),'business_service',_0x5017('0x78'),_0x5017('0x79'),_0x5017('0x7a'),_0x5017('0x7b'),_0x5017('0x7c'),_0x5017('0x7d'),_0x5017('0x7e'),_0x5017('0x7f'),_0x5017('0x80'),_0x5017('0x81'),_0x5017('0x82'),'caller_id','approval_set','subcategory',_0x5017('0x83'),_0x5017('0x84'),'close_code',_0x5017('0x85'),_0x5017('0x86'),_0x5017('0x87'),_0x5017('0x88'),'business_stc',_0x5017('0x89'),_0x5017('0x8a'),_0x5017('0x8b'),_0x5017('0x5d'),_0x5017('0x8c'),_0x5017('0x8d'),_0x5017('0x8e'),_0x5017('0x8f'),_0x5017('0x90'),'sys_id',_0x5017('0x91'),_0x5017('0x92'),'incident_state',_0x5017('0x93'),_0x5017('0x94'),'company',_0x5017('0x95'),_0x5017('0x96'),_0x5017('0x97'),'severity','comments','sla_due',_0x5017('0x98'),_0x5017('0x99'),_0x5017('0x9a'),_0x5017('0x9b'),_0x5017('0x9c'),_0x5017('0x9d'),_0x5017('0x9e'),_0x5017('0x9f'),_0x5017('0xa0'),_0x5017('0xa1'),_0x5017('0x60')];var _0x178af1='';var _0x2b6a41='';var _0xae7e82=[];var _0x3ebbb0='';var _0x232560='';var _0x5a9e8f=[];var _0x41cdbd='';var _0x100568='';var _0x21ce06={};var _0x1e1c17='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x2d83a1[_0x5017('0x43')]['id']},'attributes':['id',_0x5017('0xa2'),_0x5017('0xa3'),'email','remoteUri',_0x5017('0xa4')]})[_0x5017('0x26')](handleEntityNotFound(_0x2adde8,null))[_0x5017('0x26')](function(_0x1606ff){if(_0x1606ff){_0x1e1c17=_0x1606ff['remoteUri'];var _0x20c865=_0x1e1c17[_0x5017('0xa5')](-0x1);if(_0x20c865==='/'){_0x1e1c17=_0x1e1c17[_0x5017('0xa6')](0x0,_0x1e1c17[_0x5017('0xa7')](_0x20c865));}_0x100568=util[_0x5017('0xa8')](_0x5017('0xa9'),_0x1e1c17);_0x41cdbd=util[_0x5017('0xa8')](_0x5017('0xaa'),_0x1e1c17);_0x21ce06={'user':_0x1606ff[_0x5017('0xa2')],'pass':_0x1606ff[_0x5017('0xa3')]};var _0x3ab4be={'method':_0x5017('0xab'),'uri':_0x100568+_0x5017('0xac'),'auth':_0x21ce06,'json':!![]};return rp(_0x3ab4be);}})[_0x5017('0x26')](function(_0x465316){if(_0x465316[_0x5017('0xad')][_0x5017('0x39')]>0x0){_0x178af1=_0x465316['result'];}console['log']('incident\x20table\x20objects',_0x178af1);_0x5a9e8f=[];_0x2b6a41=Object[_0x5017('0xae')]([],_0x178af1);_['remove'](_0x2b6a41,function(_0x31346d){return!_0xfd393a[_0x5017('0xaf')](_0x31346d[_0x5017('0x2a')]);});_0x2b6a41[_0x5017('0xb0')](function(_0x405d31){var _0x4ff255=createFieldObject(_0x41cdbd,_0x21ce06,_0x405d31[_0x5017('0xb1')],_0x405d31[_0x5017('0x2a')],_0x405d31[_0x5017('0xb2')],![]);_0x5a9e8f[_0x5017('0xb3')](_0x4ff255);});return Promise[_0x5017('0xb4')](_0x5a9e8f);})['then'](function(_0x4185c4){_0xae7e82=_0x4185c4;_0x3ebbb0=Object[_0x5017('0xae')]([],_0x178af1);console[_0x5017('0xb5')]('TCL:\x20_object',_0x178af1);_[_0x5017('0xb6')](_0x3ebbb0,function(_0x2312bf){return _0x5c9709[_0x5017('0xaf')](_0x2312bf[_0x5017('0x2a')]);});console[_0x5017('0xb5')](_0x5017('0xb7'),_0x3ebbb0);_0x5a9e8f=[];_0x3ebbb0[_0x5017('0xb0')](function(_0x3ee28a){var _0x86d7f5=createFieldObject(_0x41cdbd,_0x21ce06,_0x3ee28a['internalType'],_0x3ee28a[_0x5017('0x2a')],_0x3ee28a[_0x5017('0xb2')],!![]);_0x5a9e8f[_0x5017('0xb3')](_0x86d7f5);});return Promise[_0x5017('0xb4')](_0x5a9e8f);})['then'](function(_0x4beeff){_0x232560=_0x4beeff;var _0x5e94c0=_0xae7e82[_0x5017('0xb8')](_0x232560);return{'count':_0x5e94c0[_0x5017('0x39')],'rows':_0x5e94c0};})[_0x5017('0x26')](respondWithResult(_0x2adde8,null))[_0x5017('0x41')](function(_0x46c7a9){console['log'](_0x5017('0xb9')+_0x46c7a9);var _0x506e7d=_0x2d83a1[_0x5017('0x34')][_0x5017('0xba')]?0x1f4:_0x46c7a9['statusCode']||0x1f4;logger[_0x5017('0x28')](_0x46c7a9[_0x5017('0x29')]);delete _0x46c7a9[_0x5017('0x2a')];if(_0x506e7d===0x191){_0x506e7d=0x190;}_0x2adde8[_0x5017('0x1b')](_0x506e7d)[_0x5017('0x2b')](_0x2d83a1[_0x5017('0x34')][_0x5017('0xba')]?{'message':'Wrong\x20credentials','statusCode':_0x46c7a9[_0x5017('0xbb')]}:_0x46c7a9);});};function createFieldObject(_0x32921e,_0x5ad865,_0x5e6195,_0x18c65f,_0x3e42ed,_0x3706ee){return new Promise(function(_0x3c5246,_0x239f43){var _0x3b564c={'id':_0x18c65f,'name':_0x3e42ed,'custom':_0x3706ee};if(_0x5e6195===_0x5017('0xbc')){_0x3b564c['options']=[{'name':_0x5017('0xbd'),'value':_0x5017('0xbe')},{'name':_0x5017('0xbf'),'value':_0x5017('0xc0')}];_0x3c5246(_0x3b564c);}else{var _0x102880={'method':'GET','uri':_0x32921e+_0x5017('0xc1')+_0x18c65f,'auth':_0x5ad865,'json':!![]};return rp(_0x102880)[_0x5017('0x26')](function(_0x3ad0c3){var _0x17a722=[];if(_0x3ad0c3['result']['length']>0x0){_0x3ad0c3[_0x5017('0xad')][_0x5017('0xb0')](function(_0x199ad7){if(_0x199ad7[_0x5017('0xc2')]==='false'){var _0x4a0f58={'name':_0x199ad7[_0x5017('0xb2')],'value':_0x199ad7[_0x5017('0xc3')]};_0x17a722[_0x5017('0xb3')](_0x4a0f58);}});}_0x3b564c['options']=_0x17a722;if(_0x3b564c[_0x5017('0x3f')]['length']>0x0){_0x3c5246(_0x3b564c);}else{if(_0x3706ee==![]){_0x3c5246();}else{_0x3c5246(_0x3b564c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b6d907d..ed624c6 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x466747,_0x5236e9){var _0x2583b7=function(_0x4f7580){while(--_0x4f7580){_0x466747['push'](_0x466747['shift']());}};_0x2583b7(++_0x5236e9);}(_0x4819,0xcd));var _0x9481=function(_0x2b29ab,_0x201845){_0x2b29ab=_0x2b29ab-0x0;var _0x16e64b=_0x4819[_0x2b29ab];return _0x16e64b;};'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'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x5496,0x175));var _0x6549=function(_0x51c823,_0x47a251){_0x51c823=_0x51c823-0x0;var _0x56615a=_0x5496[_0x51c823];return _0x56615a;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index bf20837..9a1556e 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 _0x7a65=['code','ServicenowAccount,\x20%s,\x20%s','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','limit','map','include','model','attributes','catch','ShowServicenowAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a65,0xd6));var _0x57a6=function(_0x26bd54,_0x564ea4){_0x26bd54=_0x26bd54-0x0;var _0x49e0ec=_0x7a65[_0x26bd54];return _0x49e0ec;};'use strict';var _=require(_0x57a6('0x0'));var util=require(_0x57a6('0x1'));var moment=require(_0x57a6('0x2'));var BPromise=require(_0x57a6('0x3'));var rs=require(_0x57a6('0x4'));var fs=require('fs');var Redis=require(_0x57a6('0x5'));var db=require(_0x57a6('0x6'))['db'];var utils=require(_0x57a6('0x7'));var logger=require(_0x57a6('0x8'))(_0x57a6('0x9'));var config=require(_0x57a6('0xa'));var jayson=require(_0x57a6('0xb'));var client=jayson['client'][_0x57a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28355c,_0x4ad10f,_0x2ac8f6){return new BPromise(function(_0x2600e1,_0x5d84b5){return client[_0x57a6('0xd')](_0x28355c,_0x2ac8f6)[_0x57a6('0xe')](function(_0x2a52e6){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4ad10f,_0x57a6('0xf'));logger[_0x57a6('0x10')](_0x57a6('0x11'),_0x4ad10f,_0x57a6('0xf'),JSON[_0x57a6('0x12')](_0x2a52e6));if(_0x2a52e6[_0x57a6('0x13')]){if(_0x2a52e6[_0x57a6('0x13')][_0x57a6('0x14')]===0x1f4){logger['error'](_0x57a6('0x15'),_0x4ad10f,_0x2a52e6[_0x57a6('0x13')][_0x57a6('0x16')]);return _0x5d84b5(_0x2a52e6['error']['message']);}logger['error'](_0x57a6('0x15'),_0x4ad10f,_0x2a52e6[_0x57a6('0x13')][_0x57a6('0x16')]);return _0x2600e1(_0x2a52e6[_0x57a6('0x13')][_0x57a6('0x16')]);}else{logger[_0x57a6('0x17')](_0x57a6('0x15'),_0x4ad10f,_0x57a6('0xf'));_0x2600e1(_0x2a52e6[_0x57a6('0x18')][_0x57a6('0x16')]);}})['catch'](function(_0x18f96c){logger[_0x57a6('0x13')](_0x57a6('0x15'),_0x4ad10f,_0x18f96c);_0x5d84b5(_0x18f96c);});});}exports[_0x57a6('0x19')]=function(_0x2ebb0c){var _0x3359c9=this;return new Promise(function(_0xbb38df,_0x28660a){return db[_0x57a6('0x1a')][_0x57a6('0x1b')]({'raw':_0x2ebb0c[_0x57a6('0x1c')]?_0x2ebb0c[_0x57a6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ebb0c[_0x57a6('0x1c')]?_0x2ebb0c[_0x57a6('0x1c')][_0x57a6('0x1d')]||null:null,'attributes':_0x2ebb0c[_0x57a6('0x1c')]?_0x2ebb0c[_0x57a6('0x1c')]['attributes']||null:null,'limit':_0x2ebb0c[_0x57a6('0x1c')]?_0x2ebb0c['options'][_0x57a6('0x1e')]||null:null,'include':_0x2ebb0c[_0x57a6('0x1c')]?_0x2ebb0c['options']['include']?_[_0x57a6('0x1f')](_0x2ebb0c[_0x57a6('0x1c')][_0x57a6('0x20')],function(_0x25a5ab){return{'model':db[_0x25a5ab[_0x57a6('0x21')]],'as':_0x25a5ab['as'],'attributes':_0x25a5ab[_0x57a6('0x22')],'include':_0x25a5ab[_0x57a6('0x20')]?_[_0x57a6('0x1f')](_0x25a5ab[_0x57a6('0x20')],function(_0x5c6d8a){return{'model':db[_0x5c6d8a[_0x57a6('0x21')]],'as':_0x5c6d8a['as'],'attributes':_0x5c6d8a[_0x57a6('0x22')],'include':_0x5c6d8a['include']?_['map'](_0x5c6d8a[_0x57a6('0x20')],function(_0x2cc7aa){return{'model':db[_0x2cc7aa['model']],'as':_0x2cc7aa['as'],'attributes':_0x2cc7aa[_0x57a6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x57a6('0xe')](function(_0x5a0cdb){logger[_0x57a6('0x17')](_0x57a6('0x19'),_0x2ebb0c);logger['debug']('GetServicenowAccount',_0x2ebb0c,JSON[_0x57a6('0x12')](_0x5a0cdb));_0xbb38df(_0x5a0cdb);})[_0x57a6('0x23')](function(_0x321e79){logger[_0x57a6('0x13')](_0x57a6('0x19'),_0x321e79[_0x57a6('0x16')],_0x2ebb0c);_0x28660a(_0x3359c9[_0x57a6('0x13')](0x1f4,_0x321e79['message']));});});};exports[_0x57a6('0x24')]=function(_0x3666a4){var _0x2589d8=this;return new Promise(function(_0x2dfe52,_0x1028fd){return db[_0x57a6('0x1a')][_0x57a6('0x25')]({'raw':_0x3666a4[_0x57a6('0x1c')]?_0x3666a4[_0x57a6('0x1c')][_0x57a6('0x26')]===undefined?!![]:![]:!![],'where':_0x3666a4[_0x57a6('0x1c')]?_0x3666a4[_0x57a6('0x1c')][_0x57a6('0x1d')]||null:null,'attributes':_0x3666a4[_0x57a6('0x1c')]?_0x3666a4[_0x57a6('0x1c')][_0x57a6('0x22')]||null:null,'include':_0x3666a4[_0x57a6('0x1c')]?_0x3666a4[_0x57a6('0x1c')]['include']?_['map'](_0x3666a4[_0x57a6('0x1c')]['include'],function(_0x558302){return{'model':db[_0x558302[_0x57a6('0x21')]],'as':_0x558302['as'],'attributes':_0x558302['attributes'],'include':_0x558302[_0x57a6('0x20')]?_[_0x57a6('0x1f')](_0x558302[_0x57a6('0x20')],function(_0x10bd48){return{'model':db[_0x10bd48[_0x57a6('0x21')]],'as':_0x10bd48['as'],'attributes':_0x10bd48['attributes'],'include':_0x10bd48[_0x57a6('0x20')]?_[_0x57a6('0x1f')](_0x10bd48[_0x57a6('0x20')],function(_0x46971a){return{'model':db[_0x46971a[_0x57a6('0x21')]],'as':_0x46971a['as'],'attributes':_0x46971a[_0x57a6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x57a6('0xe')](function(_0x2c4ed1){logger['info'](_0x57a6('0x24'),_0x3666a4);logger[_0x57a6('0x10')](_0x57a6('0x24'),_0x3666a4,JSON['stringify'](_0x2c4ed1));_0x2dfe52(_0x2c4ed1);})[_0x57a6('0x23')](function(_0x33fa55){logger[_0x57a6('0x13')](_0x57a6('0x24'),_0x33fa55[_0x57a6('0x16')],_0x3666a4);_0x1028fd(_0x2589d8[_0x57a6('0x13')](0x1f4,_0x33fa55[_0x57a6('0x16')]));});});}; \ No newline at end of file +var _0x9258=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','ShowServicenowAccount','find','lodash','util','moment','bluebird'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9258,0x1a0));var _0x8925=function(_0x2d837e,_0x5a9f6f){_0x2d837e=_0x2d837e-0x0;var _0xc945f2=_0x9258[_0x2d837e];return _0xc945f2;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var moment=require(_0x8925('0x2'));var BPromise=require(_0x8925('0x3'));var rs=require(_0x8925('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8925('0x5'))['db'];var utils=require(_0x8925('0x6'));var logger=require(_0x8925('0x7'))(_0x8925('0x8'));var config=require(_0x8925('0x9'));var jayson=require(_0x8925('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45aa11,_0x25ce96,_0x358321){return new BPromise(function(_0x2f6430,_0x5b2d7e){return client['request'](_0x45aa11,_0x358321)[_0x8925('0xb')](function(_0x3519de){logger[_0x8925('0xc')](_0x8925('0xd'),_0x25ce96,_0x8925('0xe'));logger[_0x8925('0xf')](_0x8925('0x10'),_0x25ce96,_0x8925('0xe'),JSON[_0x8925('0x11')](_0x3519de));if(_0x3519de[_0x8925('0x12')]){if(_0x3519de[_0x8925('0x12')][_0x8925('0x13')]===0x1f4){logger[_0x8925('0x12')](_0x8925('0xd'),_0x25ce96,_0x3519de[_0x8925('0x12')]['message']);return _0x5b2d7e(_0x3519de[_0x8925('0x12')][_0x8925('0x14')]);}logger['error'](_0x8925('0xd'),_0x25ce96,_0x3519de[_0x8925('0x12')][_0x8925('0x14')]);return _0x2f6430(_0x3519de[_0x8925('0x12')]['message']);}else{logger['info'](_0x8925('0xd'),_0x25ce96,_0x8925('0xe'));_0x2f6430(_0x3519de[_0x8925('0x15')][_0x8925('0x14')]);}})[_0x8925('0x16')](function(_0xbe2be5){logger[_0x8925('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x25ce96,_0xbe2be5);_0x5b2d7e(_0xbe2be5);});});}exports[_0x8925('0x17')]=function(_0x1592b1){var _0x21f01f=this;return new Promise(function(_0x400e10,_0x3482cf){return db[_0x8925('0x18')][_0x8925('0x19')]({'raw':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1b')]===undefined?!![]:![]:!![],'where':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1c')]||null:null,'attributes':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1d')]||null:null,'limit':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')]['limit']||null:null,'include':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1e')]?_[_0x8925('0x1f')](_0x1592b1['options'][_0x8925('0x1e')],function(_0x4d27e7){return{'model':db[_0x4d27e7[_0x8925('0x20')]],'as':_0x4d27e7['as'],'attributes':_0x4d27e7[_0x8925('0x1d')],'include':_0x4d27e7[_0x8925('0x1e')]?_[_0x8925('0x1f')](_0x4d27e7['include'],function(_0x2cb459){return{'model':db[_0x2cb459[_0x8925('0x20')]],'as':_0x2cb459['as'],'attributes':_0x2cb459[_0x8925('0x1d')],'include':_0x2cb459['include']?_[_0x8925('0x1f')](_0x2cb459[_0x8925('0x1e')],function(_0x3edd4d){return{'model':db[_0x3edd4d[_0x8925('0x20')]],'as':_0x3edd4d['as'],'attributes':_0x3edd4d[_0x8925('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8925('0xb')](function(_0x4e24f7){logger[_0x8925('0xc')](_0x8925('0x17'),_0x1592b1);logger['debug'](_0x8925('0x17'),_0x1592b1,JSON[_0x8925('0x11')](_0x4e24f7));_0x400e10(_0x4e24f7);})[_0x8925('0x16')](function(_0x225edb){logger[_0x8925('0x12')](_0x8925('0x17'),_0x225edb['message'],_0x1592b1);_0x3482cf(_0x21f01f['error'](0x1f4,_0x225edb[_0x8925('0x14')]));});});};exports[_0x8925('0x21')]=function(_0x5707c0){var _0xa99b17=this;return new Promise(function(_0x47e167,_0x22a0c6){return db['ServicenowAccount'][_0x8925('0x22')]({'raw':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')][_0x8925('0x1c')]||null:null,'attributes':_0x5707c0['options']?_0x5707c0[_0x8925('0x1a')][_0x8925('0x1d')]||null:null,'include':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')]['include']?_['map'](_0x5707c0['options'][_0x8925('0x1e')],function(_0x5d973c){return{'model':db[_0x5d973c['model']],'as':_0x5d973c['as'],'attributes':_0x5d973c[_0x8925('0x1d')],'include':_0x5d973c[_0x8925('0x1e')]?_['map'](_0x5d973c[_0x8925('0x1e')],function(_0x5c5fb5){return{'model':db[_0x5c5fb5[_0x8925('0x20')]],'as':_0x5c5fb5['as'],'attributes':_0x5c5fb5[_0x8925('0x1d')],'include':_0x5c5fb5[_0x8925('0x1e')]?_['map'](_0x5c5fb5[_0x8925('0x1e')],function(_0x39c851){return{'model':db[_0x39c851[_0x8925('0x20')]],'as':_0x39c851['as'],'attributes':_0x39c851[_0x8925('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8925('0xb')](function(_0x86a27e){logger['info'](_0x8925('0x21'),_0x5707c0);logger['debug'](_0x8925('0x21'),_0x5707c0,JSON[_0x8925('0x11')](_0x86a27e));_0x47e167(_0x86a27e);})['catch'](function(_0x5929d3){logger[_0x8925('0x12')](_0x8925('0x21'),_0x5929d3[_0x8925('0x14')],_0x5707c0);_0x22a0c6(_0xa99b17[_0x8925('0x12')](0x1f4,_0x5929d3[_0x8925('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 71fa6bb..c395988 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 _0x31d3=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','/:id','update','delete','destroy'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0x31d3,0xb0));var _0x331d=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x31d3[_0x403f5f];return _0x15b1cd;};'use strict';var multer=require(_0x331d('0x0'));var util=require(_0x331d('0x1'));var path=require(_0x331d('0x2'));var timeout=require(_0x331d('0x3'));var express=require(_0x331d('0x4'));var router=express['Router']();var fs_extra=require(_0x331d('0x5'));var auth=require(_0x331d('0x6'));var interaction=require(_0x331d('0x7'));var config=require(_0x331d('0x8'));var controller=require(_0x331d('0x9'));router['get']('/',auth[_0x331d('0xa')](),controller[_0x331d('0xb')]);router['get']('/:id',auth[_0x331d('0xa')](),controller[_0x331d('0xc')]);router[_0x331d('0xd')](_0x331d('0xe'),auth[_0x331d('0xa')](),controller['getFields']);router[_0x331d('0xd')](_0x331d('0xf'),auth[_0x331d('0xa')](),controller[_0x331d('0x10')]);router['get'](_0x331d('0x11'),auth[_0x331d('0xa')](),controller['getDescriptions']);router[_0x331d('0x12')]('/',auth[_0x331d('0xa')](),controller[_0x331d('0x13')]);router['put'](_0x331d('0x14'),auth[_0x331d('0xa')](),controller[_0x331d('0x15')]);router[_0x331d('0x16')](_0x331d('0x14'),auth[_0x331d('0xa')](),controller[_0x331d('0x17')]);module[_0x331d('0x18')]=router; \ No newline at end of file +var _0x12f8=['get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x1eb4e0,_0x4ebc2d){var _0x18ec21=function(_0x28c9a9){while(--_0x28c9a9){_0x1eb4e0['push'](_0x1eb4e0['shift']());}};_0x18ec21(++_0x4ebc2d);}(_0x12f8,0x1f1));var _0x812f=function(_0x3c9f82,_0x19cadf){_0x3c9f82=_0x3c9f82-0x0;var _0x3007d9=_0x12f8[_0x3c9f82];return _0x3007d9;};'use strict';var multer=require(_0x812f('0x0'));var util=require(_0x812f('0x1'));var path=require(_0x812f('0x2'));var timeout=require(_0x812f('0x3'));var express=require('express');var router=express[_0x812f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x812f('0x5'));var interaction=require(_0x812f('0x6'));var config=require(_0x812f('0x7'));var controller=require(_0x812f('0x8'));router[_0x812f('0x9')]('/',auth['isAuthenticated'](),controller[_0x812f('0xa')]);router[_0x812f('0x9')](_0x812f('0xb'),auth[_0x812f('0xc')](),controller[_0x812f('0xd')]);router[_0x812f('0x9')](_0x812f('0xe'),auth[_0x812f('0xc')](),controller[_0x812f('0xf')]);router[_0x812f('0x9')]('/:id/subjects',auth[_0x812f('0xc')](),controller['getSubjects']);router['get'](_0x812f('0x10'),auth[_0x812f('0xc')](),controller[_0x812f('0x11')]);router[_0x812f('0x12')]('/',auth[_0x812f('0xc')](),controller['create']);router[_0x812f('0x13')]('/:id',auth[_0x812f('0xc')](),controller[_0x812f('0x14')]);router['delete'](_0x812f('0xb'),auth[_0x812f('0xc')](),controller[_0x812f('0x15')]);module[_0x812f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 043afa6..7b838b4 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 _0x9e4a=['sequelize','exports','STRING'];(function(_0x19d43d,_0x4b181e){var _0x490e4e=function(_0x1a6751){while(--_0x1a6751){_0x19d43d['push'](_0x19d43d['shift']());}};_0x490e4e(++_0x4b181e);}(_0x9e4a,0x111));var _0xa9e4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9e4a[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xa9e4('0x0'));module[_0xa9e4('0x1')]={'name':{'type':Sequelize[_0xa9e4('0x2')]},'description':{'type':Sequelize[_0xa9e4('0x2')]}}; \ No newline at end of file +var _0xf6fa=['STRING'];(function(_0x543f0b,_0x9de82){var _0x5d417d=function(_0x199bc9){while(--_0x199bc9){_0x543f0b['push'](_0x543f0b['shift']());}};_0x5d417d(++_0x9de82);}(_0xf6fa,0xbd));var _0xaf6f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf6fa[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaf6f('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 2068989..45c7185 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 _0xcb0d=['findOne','ServicenowField','rawAttributes','getFields','getSubjects','getDescriptions','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','index','ServicenowConfiguration','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xcb0d,0x1e6));var _0xdcb0=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xcb0d[_0x29d6e6];return _0xc75ff0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdcb0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcb0('0x1'));var moment=require(_0xdcb0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdcb0('0x3'));var util=require(_0xdcb0('0x4'));var path=require(_0xdcb0('0x5'));var sox=require(_0xdcb0('0x6'));var csv=require(_0xdcb0('0x7'));var ejs=require(_0xdcb0('0x8'));var fs=require('fs');var fs_extra=require(_0xdcb0('0x9'));var _=require('lodash');var squel=require(_0xdcb0('0xa'));var crypto=require(_0xdcb0('0xb'));var jsforce=require(_0xdcb0('0xc'));var deskjs=require(_0xdcb0('0xd'));var toCsv=require(_0xdcb0('0x7'));var querystring=require(_0xdcb0('0xe'));var Papa=require(_0xdcb0('0xf'));var Redis=require(_0xdcb0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdcb0('0x11'));var as=require(_0xdcb0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcb0('0x13'))(_0xdcb0('0x14'));var utils=require('../../config/utils');var config=require(_0xdcb0('0x15'));var licenseUtil=require(_0xdcb0('0x16'));var db=require(_0xdcb0('0x17'))['db'];function respondWithStatusCode(_0x44b9f9,_0x181ae9){_0x181ae9=_0x181ae9||0xcc;return function(_0x1502bb){if(_0x1502bb){return _0x44b9f9[_0xdcb0('0x18')](_0x181ae9);}return _0x44b9f9[_0xdcb0('0x19')](_0x181ae9)['end']();};}function respondWithResult(_0x207b76,_0xb38cd5){_0xb38cd5=_0xb38cd5||0xc8;return function(_0x507cdd){if(_0x507cdd){return _0x207b76[_0xdcb0('0x19')](_0xb38cd5)['json'](_0x507cdd);}};}function respondWithFilteredResult(_0x340f23,_0x2ba013){return function(_0x11ddb3){if(_0x11ddb3){var _0x5c55f1=typeof _0x2ba013[_0xdcb0('0x1a')]===_0xdcb0('0x1b')&&typeof _0x2ba013[_0xdcb0('0x1c')]===_0xdcb0('0x1b');var _0x5bb18f=_0x11ddb3['count'];var _0x1d4b7c=_0x5c55f1?0x0:_0x2ba013['offset'];var _0x54ced8=_0x5c55f1?_0x11ddb3[_0xdcb0('0x1d')]:_0x2ba013[_0xdcb0('0x1a')]+_0x2ba013[_0xdcb0('0x1c')];var _0x50a589;if(_0x54ced8>=_0x5bb18f){_0x54ced8=_0x5bb18f;_0x50a589=0xc8;}else{_0x50a589=0xce;}_0x340f23[_0xdcb0('0x19')](_0x50a589);return _0x340f23[_0xdcb0('0x1e')](_0xdcb0('0x1f'),_0x1d4b7c+'-'+_0x54ced8+'/'+_0x5bb18f)[_0xdcb0('0x20')](_0x11ddb3);}return null;};}function patchUpdates(_0x51f207){return function(_0xf83e3a){try{jsonpatch[_0xdcb0('0x21')](_0xf83e3a,_0x51f207,!![]);}catch(_0x2f6787){return BPromise['reject'](_0x2f6787);}return _0xf83e3a['save']();};}function saveUpdates(_0x51957a,_0x29d7be){return function(_0x5e0fcf){if(_0x5e0fcf){return _0x5e0fcf['update'](_0x51957a)[_0xdcb0('0x22')](function(_0x284207){return _0x284207;});}return null;};}function removeEntity(_0x455400,_0x9ac3bd){return function(_0x3a9587){if(_0x3a9587){return _0x3a9587[_0xdcb0('0x23')]()[_0xdcb0('0x22')](function(){_0x455400[_0xdcb0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190bc3,_0x283c2c){return function(_0x1df14f){if(!_0x1df14f){_0x190bc3[_0xdcb0('0x18')](0x194);}return _0x1df14f;};}function handleError(_0x3c63d6,_0x585a76){_0x585a76=_0x585a76||0x1f4;return function(_0xfbf93b){logger[_0xdcb0('0x24')](_0xfbf93b[_0xdcb0('0x25')]);if(_0xfbf93b[_0xdcb0('0x26')]){delete _0xfbf93b['name'];}_0x3c63d6['status'](_0x585a76)['send'](_0xfbf93b);};}exports[_0xdcb0('0x27')]=function(_0x1a81eb,_0x38b671){var _0x423719={},_0x46a546={},_0x55791d={'count':0x0,'rows':[]};var _0x523663=_['map'](db[_0xdcb0('0x28')]['rawAttributes'],function(_0xd82eb2){return{'name':_0xd82eb2[_0xdcb0('0x29')],'type':_0xd82eb2[_0xdcb0('0x2a')][_0xdcb0('0x2b')]};});_0x46a546[_0xdcb0('0x2c')]=_[_0xdcb0('0x2d')](_0x523663,_0xdcb0('0x26'));_0x46a546[_0xdcb0('0x2e')]=_[_0xdcb0('0x2f')](_0x1a81eb[_0xdcb0('0x2e')]);_0x46a546['filters']=_[_0xdcb0('0x30')](_0x46a546['model'],_0x46a546[_0xdcb0('0x2e')]);_0x423719[_0xdcb0('0x31')]=_['intersection'](_0x46a546[_0xdcb0('0x2c')],qs[_0xdcb0('0x32')](_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x32')]));_0x423719[_0xdcb0('0x31')]=_0x423719[_0xdcb0('0x31')][_0xdcb0('0x33')]?_0x423719[_0xdcb0('0x31')]:_0x46a546[_0xdcb0('0x2c')];if(!_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x34')](_0xdcb0('0x35'))){_0x423719[_0xdcb0('0x1c')]=qs[_0xdcb0('0x1c')](_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x1c')]);_0x423719[_0xdcb0('0x1a')]=qs['offset'](_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x1a')]);}_0x423719[_0xdcb0('0x36')]=qs[_0xdcb0('0x37')](_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x37')]);_0x423719[_0xdcb0('0x38')]=qs['filters'](_[_0xdcb0('0x39')](_0x1a81eb['query'],_0x46a546[_0xdcb0('0x3a')]),_0x523663);if(_0x1a81eb[_0xdcb0('0x2e')][_0xdcb0('0x3b')]){_0x423719[_0xdcb0('0x38')]=_[_0xdcb0('0x3c')](_0x423719[_0xdcb0('0x38')],{'$or':_['map'](_0x523663,function(_0xf03d74){if(_0xf03d74[_0xdcb0('0x2a')]!==_0xdcb0('0x3d')){var _0x4ae21e={};_0x4ae21e[_0xf03d74[_0xdcb0('0x26')]]={'$like':'%'+_0x1a81eb['query'][_0xdcb0('0x3b')]+'%'};return _0x4ae21e;}})});}_0x423719=_[_0xdcb0('0x3c')]({},_0x423719,_0x1a81eb[_0xdcb0('0x3e')]);var _0x383f82={'where':_0x423719[_0xdcb0('0x38')]};return db[_0xdcb0('0x28')][_0xdcb0('0x1d')](_0x383f82)['then'](function(_0x157651){_0x55791d[_0xdcb0('0x1d')]=_0x157651;if(_0x1a81eb['query'][_0xdcb0('0x3f')]){_0x423719[_0xdcb0('0x40')]=[{'all':!![]}];}return db[_0xdcb0('0x28')][_0xdcb0('0x41')](_0x423719);})[_0xdcb0('0x22')](function(_0x19f889){_0x55791d[_0xdcb0('0x42')]=_0x19f889;return _0x55791d;})['then'](respondWithFilteredResult(_0x38b671,_0x423719))[_0xdcb0('0x43')](handleError(_0x38b671,null));};exports[_0xdcb0('0x44')]=function(_0x581024,_0x10b3ae){var _0x3d1d54={'raw':![],'where':{'id':_0x581024[_0xdcb0('0x45')]['id']}},_0x4d9b3a={};_0x4d9b3a[_0xdcb0('0x2c')]=_[_0xdcb0('0x2f')](db[_0xdcb0('0x28')]['rawAttributes']);_0x4d9b3a['query']=_[_0xdcb0('0x2f')](_0x581024[_0xdcb0('0x2e')]);_0x4d9b3a[_0xdcb0('0x3a')]=_[_0xdcb0('0x30')](_0x4d9b3a[_0xdcb0('0x2c')],_0x4d9b3a[_0xdcb0('0x2e')]);_0x3d1d54[_0xdcb0('0x31')]=_[_0xdcb0('0x30')](_0x4d9b3a[_0xdcb0('0x2c')],qs[_0xdcb0('0x32')](_0x581024[_0xdcb0('0x2e')][_0xdcb0('0x32')]));_0x3d1d54['attributes']=_0x3d1d54[_0xdcb0('0x31')][_0xdcb0('0x33')]?_0x3d1d54['attributes']:_0x4d9b3a[_0xdcb0('0x2c')];if(_0x581024[_0xdcb0('0x2e')]['includeAll']){_0x3d1d54[_0xdcb0('0x40')]=[{'all':!![]}];}_0x3d1d54=_[_0xdcb0('0x3c')]({},_0x3d1d54,_0x581024[_0xdcb0('0x3e')]);return db['ServicenowConfiguration'][_0xdcb0('0x46')](_0x3d1d54)[_0xdcb0('0x22')](handleEntityNotFound(_0x10b3ae,null))[_0xdcb0('0x22')](respondWithResult(_0x10b3ae,null))[_0xdcb0('0x43')](handleError(_0x10b3ae,null));};exports[_0xdcb0('0x47')]=function(_0x182fd2,_0x3250d1){return db[_0xdcb0('0x28')][_0xdcb0('0x47')](_0x182fd2[_0xdcb0('0x48')],{})[_0xdcb0('0x22')](respondWithResult(_0x3250d1,0xc9))[_0xdcb0('0x43')](handleError(_0x3250d1,null));};exports[_0xdcb0('0x49')]=function(_0x1929c5,_0x10618e){if(_0x1929c5['body']['id']){delete _0x1929c5[_0xdcb0('0x48')]['id'];}return db['ServicenowConfiguration'][_0xdcb0('0x46')]({'where':{'id':_0x1929c5['params']['id']}})[_0xdcb0('0x22')](handleEntityNotFound(_0x10618e,null))[_0xdcb0('0x22')](saveUpdates(_0x1929c5[_0xdcb0('0x48')],null))[_0xdcb0('0x22')](respondWithResult(_0x10618e,null))['catch'](handleError(_0x10618e,null));};exports[_0xdcb0('0x23')]=function(_0x14635c,_0x3e82ad){return db['ServicenowConfiguration'][_0xdcb0('0x46')]({'where':{'id':_0x14635c[_0xdcb0('0x45')]['id']}})[_0xdcb0('0x22')](handleEntityNotFound(_0x3e82ad,null))[_0xdcb0('0x22')](removeEntity(_0x3e82ad,null))[_0xdcb0('0x43')](handleError(_0x3e82ad,null));};exports['getFields']=function(_0x4b2293,_0x4b23ed,_0x2da857){var _0x56b67a={};var _0x4b1b83={};var _0x58f4d2;var _0x1c6ee8;return db[_0xdcb0('0x28')][_0xdcb0('0x4a')]({'where':{'id':_0x4b2293[_0xdcb0('0x45')]['id']}})[_0xdcb0('0x22')](handleEntityNotFound(_0x4b23ed,null))[_0xdcb0('0x22')](function(_0x3867f9){if(_0x3867f9){_0x58f4d2=_0x3867f9;_0x4b1b83[_0xdcb0('0x2c')]=_[_0xdcb0('0x2f')](db[_0xdcb0('0x4b')][_0xdcb0('0x4c')]);_0x4b1b83[_0xdcb0('0x2e')]=_[_0xdcb0('0x2f')](_0x4b2293[_0xdcb0('0x2e')]);_0x4b1b83[_0xdcb0('0x3a')]=_[_0xdcb0('0x30')](_0x4b1b83['model'],_0x4b1b83[_0xdcb0('0x2e')]);_0x56b67a[_0xdcb0('0x31')]=_['intersection'](_0x4b1b83[_0xdcb0('0x2c')],qs[_0xdcb0('0x32')](_0x4b2293[_0xdcb0('0x2e')]['fields']));_0x56b67a[_0xdcb0('0x31')]=_0x56b67a[_0xdcb0('0x31')]['length']?_0x56b67a['attributes']:_0x4b1b83[_0xdcb0('0x2c')];_0x56b67a['order']=qs[_0xdcb0('0x37')](_0x4b2293[_0xdcb0('0x2e')]['sort']);_0x56b67a[_0xdcb0('0x38')]=qs['filters'](_[_0xdcb0('0x39')](_0x4b2293[_0xdcb0('0x2e')],_0x4b1b83[_0xdcb0('0x3a')]));if(_0x4b2293[_0xdcb0('0x2e')][_0xdcb0('0x3b')]){_0x56b67a[_0xdcb0('0x38')]=_[_0xdcb0('0x3c')](_0x56b67a[_0xdcb0('0x38')],{'$or':_[_0xdcb0('0x2d')](_0x56b67a[_0xdcb0('0x31')],function(_0x267beb){var _0x2a87a4={};_0x2a87a4[_0x267beb]={'$like':'%'+_0x4b2293['query']['filter']+'%'};return _0x2a87a4;})});}_0x56b67a=_[_0xdcb0('0x3c')]({},_0x56b67a,_0x4b2293[_0xdcb0('0x3e')]);return _0x58f4d2[_0xdcb0('0x4d')](_0x56b67a);}})[_0xdcb0('0x22')](function(_0x335292){if(_0x335292){_0x1c6ee8=_0x335292[_0xdcb0('0x33')];if(!_0x4b2293[_0xdcb0('0x2e')][_0xdcb0('0x34')](_0xdcb0('0x35'))){_0x56b67a[_0xdcb0('0x1c')]=qs[_0xdcb0('0x1c')](_0x4b2293[_0xdcb0('0x2e')][_0xdcb0('0x1c')]);_0x56b67a[_0xdcb0('0x1a')]=qs[_0xdcb0('0x1a')](_0x4b2293['query'][_0xdcb0('0x1a')]);}return _0x58f4d2[_0xdcb0('0x4d')](_0x56b67a);}})[_0xdcb0('0x22')](function(_0x291765){if(_0x291765){return _0x291765?{'count':_0x1c6ee8,'rows':_0x291765}:null;}})[_0xdcb0('0x22')](respondWithResult(_0x4b23ed,null))[_0xdcb0('0x43')](handleError(_0x4b23ed,null));};exports[_0xdcb0('0x4e')]=function(_0x55fb0b,_0x2e363e,_0x16ea56){var _0x5e69e4={};var _0x302167={};var _0x56b659;var _0x5c1ad3;return db[_0xdcb0('0x28')][_0xdcb0('0x4a')]({'where':{'id':_0x55fb0b[_0xdcb0('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e363e,null))[_0xdcb0('0x22')](function(_0x4c4e9c){if(_0x4c4e9c){_0x56b659=_0x4c4e9c;_0x302167[_0xdcb0('0x2c')]=_['keys'](db[_0xdcb0('0x4b')][_0xdcb0('0x4c')]);_0x302167[_0xdcb0('0x2e')]=_[_0xdcb0('0x2f')](_0x55fb0b['query']);_0x302167[_0xdcb0('0x3a')]=_[_0xdcb0('0x30')](_0x302167[_0xdcb0('0x2c')],_0x302167[_0xdcb0('0x2e')]);_0x5e69e4[_0xdcb0('0x31')]=_[_0xdcb0('0x30')](_0x302167[_0xdcb0('0x2c')],qs[_0xdcb0('0x32')](_0x55fb0b[_0xdcb0('0x2e')][_0xdcb0('0x32')]));_0x5e69e4['attributes']=_0x5e69e4['attributes'][_0xdcb0('0x33')]?_0x5e69e4['attributes']:_0x302167['model'];_0x5e69e4[_0xdcb0('0x36')]=qs[_0xdcb0('0x37')](_0x55fb0b[_0xdcb0('0x2e')]['sort']);_0x5e69e4[_0xdcb0('0x38')]=qs[_0xdcb0('0x3a')](_['pick'](_0x55fb0b[_0xdcb0('0x2e')],_0x302167[_0xdcb0('0x3a')]));if(_0x55fb0b[_0xdcb0('0x2e')][_0xdcb0('0x3b')]){_0x5e69e4[_0xdcb0('0x38')]=_[_0xdcb0('0x3c')](_0x5e69e4['where'],{'$or':_[_0xdcb0('0x2d')](_0x5e69e4[_0xdcb0('0x31')],function(_0x3c05cf){var _0x4defbf={};_0x4defbf[_0x3c05cf]={'$like':'%'+_0x55fb0b[_0xdcb0('0x2e')][_0xdcb0('0x3b')]+'%'};return _0x4defbf;})});}_0x5e69e4=_[_0xdcb0('0x3c')]({},_0x5e69e4,_0x55fb0b[_0xdcb0('0x3e')]);return _0x56b659[_0xdcb0('0x4e')](_0x5e69e4);}})['then'](function(_0x38fb9e){if(_0x38fb9e){_0x5c1ad3=_0x38fb9e[_0xdcb0('0x33')];if(!_0x55fb0b[_0xdcb0('0x2e')][_0xdcb0('0x34')]('nolimit')){_0x5e69e4['limit']=qs['limit'](_0x55fb0b[_0xdcb0('0x2e')][_0xdcb0('0x1c')]);_0x5e69e4[_0xdcb0('0x1a')]=qs[_0xdcb0('0x1a')](_0x55fb0b['query']['offset']);}return _0x56b659[_0xdcb0('0x4e')](_0x5e69e4);}})[_0xdcb0('0x22')](function(_0x52554f){if(_0x52554f){return _0x52554f?{'count':_0x5c1ad3,'rows':_0x52554f}:null;}})[_0xdcb0('0x22')](respondWithResult(_0x2e363e,null))[_0xdcb0('0x43')](handleError(_0x2e363e,null));};exports['getDescriptions']=function(_0x120371,_0x259319,_0x3fc780){var _0x206cf1={};var _0x2980f4={};var _0x595164;var _0x486ec1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x120371[_0xdcb0('0x45')]['id']}})[_0xdcb0('0x22')](handleEntityNotFound(_0x259319,null))[_0xdcb0('0x22')](function(_0x4675bc){if(_0x4675bc){_0x595164=_0x4675bc;_0x2980f4[_0xdcb0('0x2c')]=_['keys'](db[_0xdcb0('0x4b')][_0xdcb0('0x4c')]);_0x2980f4[_0xdcb0('0x2e')]=_[_0xdcb0('0x2f')](_0x120371['query']);_0x2980f4[_0xdcb0('0x3a')]=_['intersection'](_0x2980f4[_0xdcb0('0x2c')],_0x2980f4['query']);_0x206cf1['attributes']=_['intersection'](_0x2980f4['model'],qs[_0xdcb0('0x32')](_0x120371[_0xdcb0('0x2e')][_0xdcb0('0x32')]));_0x206cf1[_0xdcb0('0x31')]=_0x206cf1[_0xdcb0('0x31')][_0xdcb0('0x33')]?_0x206cf1[_0xdcb0('0x31')]:_0x2980f4[_0xdcb0('0x2c')];_0x206cf1[_0xdcb0('0x36')]=qs[_0xdcb0('0x37')](_0x120371[_0xdcb0('0x2e')][_0xdcb0('0x37')]);_0x206cf1[_0xdcb0('0x38')]=qs[_0xdcb0('0x3a')](_[_0xdcb0('0x39')](_0x120371[_0xdcb0('0x2e')],_0x2980f4[_0xdcb0('0x3a')]));if(_0x120371[_0xdcb0('0x2e')]['filter']){_0x206cf1['where']=_[_0xdcb0('0x3c')](_0x206cf1[_0xdcb0('0x38')],{'$or':_[_0xdcb0('0x2d')](_0x206cf1['attributes'],function(_0x184d90){var _0xe9830f={};_0xe9830f[_0x184d90]={'$like':'%'+_0x120371['query']['filter']+'%'};return _0xe9830f;})});}_0x206cf1=_['merge']({},_0x206cf1,_0x120371['options']);return _0x595164[_0xdcb0('0x4f')](_0x206cf1);}})[_0xdcb0('0x22')](function(_0x275bcd){if(_0x275bcd){_0x486ec1=_0x275bcd[_0xdcb0('0x33')];if(!_0x120371[_0xdcb0('0x2e')][_0xdcb0('0x34')](_0xdcb0('0x35'))){_0x206cf1[_0xdcb0('0x1c')]=qs[_0xdcb0('0x1c')](_0x120371[_0xdcb0('0x2e')][_0xdcb0('0x1c')]);_0x206cf1[_0xdcb0('0x1a')]=qs[_0xdcb0('0x1a')](_0x120371[_0xdcb0('0x2e')][_0xdcb0('0x1a')]);}return _0x595164[_0xdcb0('0x4f')](_0x206cf1);}})[_0xdcb0('0x22')](function(_0x589704){if(_0x589704){return _0x589704?{'count':_0x486ec1,'rows':_0x589704}:null;}})[_0xdcb0('0x22')](respondWithResult(_0x259319,null))[_0xdcb0('0x43')](handleError(_0x259319,null));}; \ No newline at end of file +var _0x2203=['request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','keys','fields','options','find','create','body','catch','getFields','findOne','ServicenowField','getSubjects','params','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2f07c1,_0x54af34){var _0x55cdf2=function(_0xad8901){while(--_0xad8901){_0x2f07c1['push'](_0x2f07c1['shift']());}};_0x55cdf2(++_0x54af34);}(_0x2203,0x16e));var _0x3220=function(_0x5252a1,_0x32b917){_0x5252a1=_0x5252a1-0x0;var _0x39973f=_0x2203[_0x5252a1];return _0x39973f;};'use strict';var emlformat=require(_0x3220('0x0'));var rimraf=require(_0x3220('0x1'));var zipdir=require(_0x3220('0x2'));var jsonpatch=require(_0x3220('0x3'));var rp=require(_0x3220('0x4'));var moment=require(_0x3220('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3220('0x6'));var util=require(_0x3220('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3220('0x8'));var ejs=require(_0x3220('0x9'));var fs=require('fs');var fs_extra=require(_0x3220('0xa'));var _=require(_0x3220('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3220('0xc'));var deskjs=require(_0x3220('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3220('0xe'));var Papa=require(_0x3220('0xf'));var Redis=require(_0x3220('0x10'));var authService=require(_0x3220('0x11'));var qs=require(_0x3220('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3220('0x13'))(_0x3220('0x14'));var utils=require(_0x3220('0x15'));var config=require(_0x3220('0x16'));var licenseUtil=require(_0x3220('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2edb62,_0x4c5a11){_0x4c5a11=_0x4c5a11||0xcc;return function(_0x4e677b){if(_0x4e677b){return _0x2edb62['sendStatus'](_0x4c5a11);}return _0x2edb62[_0x3220('0x18')](_0x4c5a11)[_0x3220('0x19')]();};}function respondWithResult(_0x5cf018,_0x54e466){_0x54e466=_0x54e466||0xc8;return function(_0x31348a){if(_0x31348a){return _0x5cf018[_0x3220('0x18')](_0x54e466)[_0x3220('0x1a')](_0x31348a);}};}function respondWithFilteredResult(_0x3fd837,_0x17ec0e){return function(_0x4f002f){if(_0x4f002f){var _0x2f573a=typeof _0x17ec0e[_0x3220('0x1b')]===_0x3220('0x1c')&&typeof _0x17ec0e[_0x3220('0x1d')]===_0x3220('0x1c');var _0x48beea=_0x4f002f[_0x3220('0x1e')];var _0x15a40f=_0x2f573a?0x0:_0x17ec0e[_0x3220('0x1b')];var _0x502607=_0x2f573a?_0x4f002f[_0x3220('0x1e')]:_0x17ec0e[_0x3220('0x1b')]+_0x17ec0e['limit'];var _0xa3da24;if(_0x502607>=_0x48beea){_0x502607=_0x48beea;_0xa3da24=0xc8;}else{_0xa3da24=0xce;}_0x3fd837[_0x3220('0x18')](_0xa3da24);return _0x3fd837['set']('Content-Range',_0x15a40f+'-'+_0x502607+'/'+_0x48beea)[_0x3220('0x1a')](_0x4f002f);}return null;};}function patchUpdates(_0x534484){return function(_0x289eea){try{jsonpatch[_0x3220('0x1f')](_0x289eea,_0x534484,!![]);}catch(_0x31271e){return BPromise['reject'](_0x31271e);}return _0x289eea[_0x3220('0x20')]();};}function saveUpdates(_0x513371,_0x1acac8){return function(_0x33159b){if(_0x33159b){return _0x33159b[_0x3220('0x21')](_0x513371)[_0x3220('0x22')](function(_0x444232){return _0x444232;});}return null;};}function removeEntity(_0xeb0e06,_0x542dab){return function(_0x51c103){if(_0x51c103){return _0x51c103[_0x3220('0x23')]()[_0x3220('0x22')](function(){_0xeb0e06[_0x3220('0x18')](0xcc)[_0x3220('0x19')]();});}};}function handleEntityNotFound(_0x1871eb,_0x2af1e7){return function(_0xa96a19){if(!_0xa96a19){_0x1871eb['sendStatus'](0x194);}return _0xa96a19;};}function handleError(_0x58a40b,_0x4e68d5){_0x4e68d5=_0x4e68d5||0x1f4;return function(_0x463005){logger['error'](_0x463005[_0x3220('0x24')]);if(_0x463005[_0x3220('0x25')]){delete _0x463005[_0x3220('0x25')];}_0x58a40b[_0x3220('0x18')](_0x4e68d5)['send'](_0x463005);};}exports[_0x3220('0x26')]=function(_0x4a1b29,_0x57660b){var _0x27a70a={},_0x383663={},_0x5da7cb={'count':0x0,'rows':[]};var _0x1c202d=_['map'](db[_0x3220('0x27')][_0x3220('0x28')],function(_0x513de0){return{'name':_0x513de0[_0x3220('0x29')],'type':_0x513de0[_0x3220('0x2a')]['key']};});_0x383663[_0x3220('0x2b')]=_[_0x3220('0x2c')](_0x1c202d,_0x3220('0x25'));_0x383663[_0x3220('0x2d')]=_['keys'](_0x4a1b29[_0x3220('0x2d')]);_0x383663[_0x3220('0x2e')]=_['intersection'](_0x383663[_0x3220('0x2b')],_0x383663[_0x3220('0x2d')]);_0x27a70a[_0x3220('0x2f')]=_[_0x3220('0x30')](_0x383663['model'],qs['fields'](_0x4a1b29[_0x3220('0x2d')]['fields']));_0x27a70a[_0x3220('0x2f')]=_0x27a70a[_0x3220('0x2f')][_0x3220('0x31')]?_0x27a70a['attributes']:_0x383663[_0x3220('0x2b')];if(!_0x4a1b29[_0x3220('0x2d')][_0x3220('0x32')](_0x3220('0x33'))){_0x27a70a['limit']=qs[_0x3220('0x1d')](_0x4a1b29[_0x3220('0x2d')][_0x3220('0x1d')]);_0x27a70a[_0x3220('0x1b')]=qs[_0x3220('0x1b')](_0x4a1b29[_0x3220('0x2d')][_0x3220('0x1b')]);}_0x27a70a[_0x3220('0x34')]=qs[_0x3220('0x35')](_0x4a1b29['query'][_0x3220('0x35')]);_0x27a70a['where']=qs[_0x3220('0x2e')](_[_0x3220('0x36')](_0x4a1b29['query'],_0x383663[_0x3220('0x2e')]),_0x1c202d);if(_0x4a1b29[_0x3220('0x2d')][_0x3220('0x37')]){_0x27a70a[_0x3220('0x38')]=_['merge'](_0x27a70a[_0x3220('0x38')],{'$or':_[_0x3220('0x2c')](_0x1c202d,function(_0x3c4236){if(_0x3c4236['type']!==_0x3220('0x39')){var _0x40d546={};_0x40d546[_0x3c4236[_0x3220('0x25')]]={'$like':'%'+_0x4a1b29[_0x3220('0x2d')]['filter']+'%'};return _0x40d546;}})});}_0x27a70a=_[_0x3220('0x3a')]({},_0x27a70a,_0x4a1b29['options']);var _0x1ac4eb={'where':_0x27a70a[_0x3220('0x38')]};return db[_0x3220('0x27')][_0x3220('0x1e')](_0x1ac4eb)[_0x3220('0x22')](function(_0x419d31){_0x5da7cb[_0x3220('0x1e')]=_0x419d31;if(_0x4a1b29[_0x3220('0x2d')][_0x3220('0x3b')]){_0x27a70a['include']=[{'all':!![]}];}return db[_0x3220('0x27')][_0x3220('0x3c')](_0x27a70a);})[_0x3220('0x22')](function(_0x46326c){_0x5da7cb['rows']=_0x46326c;return _0x5da7cb;})[_0x3220('0x22')](respondWithFilteredResult(_0x57660b,_0x27a70a))['catch'](handleError(_0x57660b,null));};exports['show']=function(_0x12d048,_0x13da83){var _0x26995b={'raw':![],'where':{'id':_0x12d048['params']['id']}},_0x81d7dd={};_0x81d7dd[_0x3220('0x2b')]=_[_0x3220('0x3d')](db[_0x3220('0x27')]['rawAttributes']);_0x81d7dd['query']=_['keys'](_0x12d048[_0x3220('0x2d')]);_0x81d7dd[_0x3220('0x2e')]=_['intersection'](_0x81d7dd[_0x3220('0x2b')],_0x81d7dd[_0x3220('0x2d')]);_0x26995b[_0x3220('0x2f')]=_[_0x3220('0x30')](_0x81d7dd[_0x3220('0x2b')],qs[_0x3220('0x3e')](_0x12d048[_0x3220('0x2d')][_0x3220('0x3e')]));_0x26995b[_0x3220('0x2f')]=_0x26995b[_0x3220('0x2f')]['length']?_0x26995b['attributes']:_0x81d7dd[_0x3220('0x2b')];if(_0x12d048['query'][_0x3220('0x3b')]){_0x26995b['include']=[{'all':!![]}];}_0x26995b=_[_0x3220('0x3a')]({},_0x26995b,_0x12d048[_0x3220('0x3f')]);return db['ServicenowConfiguration'][_0x3220('0x40')](_0x26995b)[_0x3220('0x22')](handleEntityNotFound(_0x13da83,null))['then'](respondWithResult(_0x13da83,null))['catch'](handleError(_0x13da83,null));};exports[_0x3220('0x41')]=function(_0x3f6019,_0x3fa664){return db[_0x3220('0x27')]['create'](_0x3f6019[_0x3220('0x42')],{})[_0x3220('0x22')](respondWithResult(_0x3fa664,0xc9))['catch'](handleError(_0x3fa664,null));};exports[_0x3220('0x21')]=function(_0x2abc1f,_0x3a76db){if(_0x2abc1f[_0x3220('0x42')]['id']){delete _0x2abc1f[_0x3220('0x42')]['id'];}return db[_0x3220('0x27')][_0x3220('0x40')]({'where':{'id':_0x2abc1f['params']['id']}})[_0x3220('0x22')](handleEntityNotFound(_0x3a76db,null))[_0x3220('0x22')](saveUpdates(_0x2abc1f[_0x3220('0x42')],null))['then'](respondWithResult(_0x3a76db,null))['catch'](handleError(_0x3a76db,null));};exports[_0x3220('0x23')]=function(_0x128a89,_0x5c19d4){return db[_0x3220('0x27')]['find']({'where':{'id':_0x128a89['params']['id']}})[_0x3220('0x22')](handleEntityNotFound(_0x5c19d4,null))[_0x3220('0x22')](removeEntity(_0x5c19d4,null))[_0x3220('0x43')](handleError(_0x5c19d4,null));};exports[_0x3220('0x44')]=function(_0x1758d1,_0xcc15c0,_0x536bbd){var _0x292bff={};var _0x3e0954={};var _0x223ac6;var _0x5863e6;return db[_0x3220('0x27')][_0x3220('0x45')]({'where':{'id':_0x1758d1['params']['id']}})[_0x3220('0x22')](handleEntityNotFound(_0xcc15c0,null))[_0x3220('0x22')](function(_0x1e3c74){if(_0x1e3c74){_0x223ac6=_0x1e3c74;_0x3e0954[_0x3220('0x2b')]=_['keys'](db[_0x3220('0x46')][_0x3220('0x28')]);_0x3e0954[_0x3220('0x2d')]=_[_0x3220('0x3d')](_0x1758d1[_0x3220('0x2d')]);_0x3e0954['filters']=_[_0x3220('0x30')](_0x3e0954[_0x3220('0x2b')],_0x3e0954['query']);_0x292bff[_0x3220('0x2f')]=_['intersection'](_0x3e0954[_0x3220('0x2b')],qs[_0x3220('0x3e')](_0x1758d1[_0x3220('0x2d')][_0x3220('0x3e')]));_0x292bff[_0x3220('0x2f')]=_0x292bff[_0x3220('0x2f')][_0x3220('0x31')]?_0x292bff[_0x3220('0x2f')]:_0x3e0954[_0x3220('0x2b')];_0x292bff[_0x3220('0x34')]=qs[_0x3220('0x35')](_0x1758d1[_0x3220('0x2d')][_0x3220('0x35')]);_0x292bff[_0x3220('0x38')]=qs['filters'](_[_0x3220('0x36')](_0x1758d1[_0x3220('0x2d')],_0x3e0954[_0x3220('0x2e')]));if(_0x1758d1[_0x3220('0x2d')][_0x3220('0x37')]){_0x292bff['where']=_[_0x3220('0x3a')](_0x292bff[_0x3220('0x38')],{'$or':_[_0x3220('0x2c')](_0x292bff[_0x3220('0x2f')],function(_0x19fc20){var _0x273fa3={};_0x273fa3[_0x19fc20]={'$like':'%'+_0x1758d1[_0x3220('0x2d')][_0x3220('0x37')]+'%'};return _0x273fa3;})});}_0x292bff=_[_0x3220('0x3a')]({},_0x292bff,_0x1758d1['options']);return _0x223ac6[_0x3220('0x44')](_0x292bff);}})['then'](function(_0x59e0e1){if(_0x59e0e1){_0x5863e6=_0x59e0e1[_0x3220('0x31')];if(!_0x1758d1[_0x3220('0x2d')][_0x3220('0x32')](_0x3220('0x33'))){_0x292bff[_0x3220('0x1d')]=qs['limit'](_0x1758d1[_0x3220('0x2d')][_0x3220('0x1d')]);_0x292bff[_0x3220('0x1b')]=qs['offset'](_0x1758d1[_0x3220('0x2d')][_0x3220('0x1b')]);}return _0x223ac6[_0x3220('0x44')](_0x292bff);}})[_0x3220('0x22')](function(_0x4e8615){if(_0x4e8615){return _0x4e8615?{'count':_0x5863e6,'rows':_0x4e8615}:null;}})[_0x3220('0x22')](respondWithResult(_0xcc15c0,null))['catch'](handleError(_0xcc15c0,null));};exports[_0x3220('0x47')]=function(_0x3681b5,_0x18c18c,_0x58d442){var _0x2d33b8={};var _0x3bb54c={};var _0x2d1ee;var _0x277414;return db[_0x3220('0x27')]['findOne']({'where':{'id':_0x3681b5[_0x3220('0x48')]['id']}})[_0x3220('0x22')](handleEntityNotFound(_0x18c18c,null))[_0x3220('0x22')](function(_0x2615cb){if(_0x2615cb){_0x2d1ee=_0x2615cb;_0x3bb54c[_0x3220('0x2b')]=_['keys'](db[_0x3220('0x46')][_0x3220('0x28')]);_0x3bb54c[_0x3220('0x2d')]=_[_0x3220('0x3d')](_0x3681b5[_0x3220('0x2d')]);_0x3bb54c['filters']=_[_0x3220('0x30')](_0x3bb54c[_0x3220('0x2b')],_0x3bb54c['query']);_0x2d33b8[_0x3220('0x2f')]=_['intersection'](_0x3bb54c[_0x3220('0x2b')],qs[_0x3220('0x3e')](_0x3681b5[_0x3220('0x2d')][_0x3220('0x3e')]));_0x2d33b8['attributes']=_0x2d33b8[_0x3220('0x2f')][_0x3220('0x31')]?_0x2d33b8[_0x3220('0x2f')]:_0x3bb54c['model'];_0x2d33b8[_0x3220('0x34')]=qs[_0x3220('0x35')](_0x3681b5[_0x3220('0x2d')][_0x3220('0x35')]);_0x2d33b8[_0x3220('0x38')]=qs[_0x3220('0x2e')](_[_0x3220('0x36')](_0x3681b5[_0x3220('0x2d')],_0x3bb54c['filters']));if(_0x3681b5[_0x3220('0x2d')][_0x3220('0x37')]){_0x2d33b8[_0x3220('0x38')]=_[_0x3220('0x3a')](_0x2d33b8[_0x3220('0x38')],{'$or':_[_0x3220('0x2c')](_0x2d33b8['attributes'],function(_0x324dae){var _0x54a647={};_0x54a647[_0x324dae]={'$like':'%'+_0x3681b5['query'][_0x3220('0x37')]+'%'};return _0x54a647;})});}_0x2d33b8=_[_0x3220('0x3a')]({},_0x2d33b8,_0x3681b5[_0x3220('0x3f')]);return _0x2d1ee[_0x3220('0x47')](_0x2d33b8);}})[_0x3220('0x22')](function(_0x25f428){if(_0x25f428){_0x277414=_0x25f428[_0x3220('0x31')];if(!_0x3681b5[_0x3220('0x2d')][_0x3220('0x32')]('nolimit')){_0x2d33b8[_0x3220('0x1d')]=qs[_0x3220('0x1d')](_0x3681b5[_0x3220('0x2d')][_0x3220('0x1d')]);_0x2d33b8[_0x3220('0x1b')]=qs[_0x3220('0x1b')](_0x3681b5['query'][_0x3220('0x1b')]);}return _0x2d1ee[_0x3220('0x47')](_0x2d33b8);}})['then'](function(_0x1c07fa){if(_0x1c07fa){return _0x1c07fa?{'count':_0x277414,'rows':_0x1c07fa}:null;}})[_0x3220('0x22')](respondWithResult(_0x18c18c,null))[_0x3220('0x43')](handleError(_0x18c18c,null));};exports[_0x3220('0x49')]=function(_0x3cc0c2,_0x1fc664,_0x1feafc){var _0x25c133={};var _0x17e652={};var _0x214997;var _0x515cd9;return db[_0x3220('0x27')][_0x3220('0x45')]({'where':{'id':_0x3cc0c2['params']['id']}})['then'](handleEntityNotFound(_0x1fc664,null))[_0x3220('0x22')](function(_0x195ebc){if(_0x195ebc){_0x214997=_0x195ebc;_0x17e652[_0x3220('0x2b')]=_['keys'](db[_0x3220('0x46')]['rawAttributes']);_0x17e652[_0x3220('0x2d')]=_['keys'](_0x3cc0c2[_0x3220('0x2d')]);_0x17e652[_0x3220('0x2e')]=_['intersection'](_0x17e652[_0x3220('0x2b')],_0x17e652[_0x3220('0x2d')]);_0x25c133[_0x3220('0x2f')]=_[_0x3220('0x30')](_0x17e652[_0x3220('0x2b')],qs[_0x3220('0x3e')](_0x3cc0c2['query'][_0x3220('0x3e')]));_0x25c133[_0x3220('0x2f')]=_0x25c133[_0x3220('0x2f')][_0x3220('0x31')]?_0x25c133[_0x3220('0x2f')]:_0x17e652[_0x3220('0x2b')];_0x25c133[_0x3220('0x34')]=qs['sort'](_0x3cc0c2['query']['sort']);_0x25c133['where']=qs['filters'](_[_0x3220('0x36')](_0x3cc0c2[_0x3220('0x2d')],_0x17e652[_0x3220('0x2e')]));if(_0x3cc0c2[_0x3220('0x2d')][_0x3220('0x37')]){_0x25c133[_0x3220('0x38')]=_[_0x3220('0x3a')](_0x25c133[_0x3220('0x38')],{'$or':_[_0x3220('0x2c')](_0x25c133[_0x3220('0x2f')],function(_0x3cdba9){var _0x5dbb89={};_0x5dbb89[_0x3cdba9]={'$like':'%'+_0x3cc0c2['query'][_0x3220('0x37')]+'%'};return _0x5dbb89;})});}_0x25c133=_[_0x3220('0x3a')]({},_0x25c133,_0x3cc0c2[_0x3220('0x3f')]);return _0x214997[_0x3220('0x49')](_0x25c133);}})[_0x3220('0x22')](function(_0x500b94){if(_0x500b94){_0x515cd9=_0x500b94[_0x3220('0x31')];if(!_0x3cc0c2[_0x3220('0x2d')][_0x3220('0x32')](_0x3220('0x33'))){_0x25c133['limit']=qs[_0x3220('0x1d')](_0x3cc0c2['query'][_0x3220('0x1d')]);_0x25c133['offset']=qs['offset'](_0x3cc0c2[_0x3220('0x2d')][_0x3220('0x1b')]);}return _0x214997['getDescriptions'](_0x25c133);}})[_0x3220('0x22')](function(_0x4cc3ac){if(_0x4cc3ac){return _0x4cc3ac?{'count':_0x515cd9,'rows':_0x4cc3ac}:null;}})[_0x3220('0x22')](respondWithResult(_0x1fc664,null))[_0x3220('0x43')](handleError(_0x1fc664,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6aec6d0..0003d97 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 _0x0490=['exports','define','int_servicenow_configurations','util','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x1b6e53,_0x19c562){var _0x4d3d96=function(_0xafb609){while(--_0xafb609){_0x1b6e53['push'](_0x1b6e53['shift']());}};_0x4d3d96(++_0x19c562);}(_0x0490,0x147));var _0x0049=function(_0x5291a1,_0x5447b6){_0x5291a1=_0x5291a1-0x0;var _0x34e7cf=_0x0490[_0x5291a1];return _0x34e7cf;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0049('0x1'));var fs=require('fs');var path=require(_0x0049('0x2'));var rimraf=require(_0x0049('0x3'));var config=require(_0x0049('0x4'));var attributes=require(_0x0049('0x5'));module[_0x0049('0x6')]=function(_0x2957b6,_0x4dde1){return _0x2957b6[_0x0049('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x0049('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x866a=['rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','path'];(function(_0x147e9e,_0x3dfac5){var _0x1b42cf=function(_0x3a9bdc){while(--_0x3a9bdc){_0x147e9e['push'](_0x147e9e['shift']());}};_0x1b42cf(++_0x3dfac5);}(_0x866a,0x156));var _0xa866=function(_0x2350dd,_0x53e293){_0x2350dd=_0x2350dd-0x0;var _0x5ca2db=_0x866a[_0x2350dd];return _0x5ca2db;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var logger=require(_0xa866('0x1'))(_0xa866('0x2'));var moment=require(_0xa866('0x3'));var BPromise=require(_0xa866('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa866('0x5'));var rimraf=require(_0xa866('0x6'));var config=require(_0xa866('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xa866('0x8')]=function(_0x31a017,_0x1ea4de){return _0x31a017[_0xa866('0x9')](_0xa866('0xa'),attributes,{'tableName':_0xa866('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 c3b8bdc..cadc847 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 _0x8daf=['request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x414ec1,_0x3b27a8){var _0x40de69=function(_0x32fc0e){while(--_0x32fc0e){_0x414ec1['push'](_0x414ec1['shift']());}};_0x40de69(++_0x3b27a8);}(_0x8daf,0x15c));var _0xf8da=function(_0x32bcda,_0x156e9c){_0x32bcda=_0x32bcda-0x0;var _0x4e6191=_0x8daf[_0x32bcda];return _0x4e6191;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8da('0x0'));var fs=require('fs');var Redis=require(_0xf8da('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8da('0x2'));var logger=require(_0xf8da('0x3'))(_0xf8da('0x4'));var config=require(_0xf8da('0x5'));var jayson=require(_0xf8da('0x6'));var client=jayson[_0xf8da('0x7')][_0xf8da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4565a9,_0xef5c26,_0x585e0c){return new BPromise(function(_0x30bc1d,_0x4bc1e3){return client[_0xf8da('0x9')](_0x4565a9,_0x585e0c)['then'](function(_0x5059a1){logger[_0xf8da('0xa')](_0xf8da('0xb'),_0xef5c26,_0xf8da('0xc'));logger[_0xf8da('0xd')](_0xf8da('0xe'),_0xef5c26,_0xf8da('0xc'),JSON[_0xf8da('0xf')](_0x5059a1));if(_0x5059a1[_0xf8da('0x10')]){if(_0x5059a1['error'][_0xf8da('0x11')]===0x1f4){logger[_0xf8da('0x10')](_0xf8da('0xb'),_0xef5c26,_0x5059a1[_0xf8da('0x10')]['message']);return _0x4bc1e3(_0x5059a1[_0xf8da('0x10')]['message']);}logger[_0xf8da('0x10')](_0xf8da('0xb'),_0xef5c26,_0x5059a1[_0xf8da('0x10')][_0xf8da('0x12')]);return _0x30bc1d(_0x5059a1[_0xf8da('0x10')]['message']);}else{logger[_0xf8da('0xa')](_0xf8da('0xb'),_0xef5c26,_0xf8da('0xc'));_0x30bc1d(_0x5059a1[_0xf8da('0x13')][_0xf8da('0x12')]);}})[_0xf8da('0x14')](function(_0x17eb8d){logger['error'](_0xf8da('0xb'),_0xef5c26,_0x17eb8d);_0x4bc1e3(_0x17eb8d);});});} \ No newline at end of file +var _0x9a18=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x2e4d12,_0x4446ba){var _0x3efeb3=function(_0x491d1e){while(--_0x491d1e){_0x2e4d12['push'](_0x2e4d12['shift']());}};_0x3efeb3(++_0x4446ba);}(_0x9a18,0xfa));var _0x89a1=function(_0x21df96,_0x31fdcd){_0x21df96=_0x21df96-0x0;var _0x50f5b6=_0x9a18[_0x21df96];return _0x50f5b6;};'use strict';var _=require(_0x89a1('0x0'));var util=require(_0x89a1('0x1'));var moment=require(_0x89a1('0x2'));var BPromise=require(_0x89a1('0x3'));var rs=require(_0x89a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89a1('0x6'))(_0x89a1('0x7'));var config=require('../../config/environment');var jayson=require(_0x89a1('0x8'));var client=jayson[_0x89a1('0x9')][_0x89a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382f1f,_0x6b1d58,_0x477650){return new BPromise(function(_0x5d5ecd,_0x18857f){return client[_0x89a1('0xb')](_0x382f1f,_0x477650)[_0x89a1('0xc')](function(_0x157409){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x6b1d58,_0x89a1('0xd'));logger[_0x89a1('0xe')](_0x89a1('0xf'),_0x6b1d58,'request\x20sent',JSON[_0x89a1('0x10')](_0x157409));if(_0x157409['error']){if(_0x157409[_0x89a1('0x11')][_0x89a1('0x12')]===0x1f4){logger[_0x89a1('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x6b1d58,_0x157409['error'][_0x89a1('0x13')]);return _0x18857f(_0x157409[_0x89a1('0x11')][_0x89a1('0x13')]);}logger[_0x89a1('0x11')](_0x89a1('0x14'),_0x6b1d58,_0x157409[_0x89a1('0x11')][_0x89a1('0x13')]);return _0x5d5ecd(_0x157409[_0x89a1('0x11')][_0x89a1('0x13')]);}else{logger['info'](_0x89a1('0x14'),_0x6b1d58,_0x89a1('0xd'));_0x5d5ecd(_0x157409[_0x89a1('0x15')][_0x89a1('0x13')]);}})['catch'](function(_0x44e2a9){logger[_0x89a1('0x11')](_0x89a1('0x14'),_0x6b1d58,_0x44e2a9);_0x18857f(_0x44e2a9);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1a4c0e0..6257b6f 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 _0x1256=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','post','put','/:id','update','destroy','exports','multer','util','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1256,0xc3));var _0x6125=function(_0x5612f0,_0x227259){_0x5612f0=_0x5612f0-0x0;var _0x57cfb2=_0x1256[_0x5612f0];return _0x57cfb2;};'use strict';var multer=require(_0x6125('0x0'));var util=require(_0x6125('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6125('0x2'));var router=express[_0x6125('0x3')]();var fs_extra=require(_0x6125('0x4'));var auth=require(_0x6125('0x5'));var interaction=require(_0x6125('0x6'));var config=require(_0x6125('0x7'));var controller=require(_0x6125('0x8'));router['get']('/',auth[_0x6125('0x9')](),controller[_0x6125('0xa')]);router[_0x6125('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6125('0xc')]('/',auth[_0x6125('0x9')](),controller['create']);router[_0x6125('0xd')](_0x6125('0xe'),auth['isAuthenticated'](),controller[_0x6125('0xf')]);router['delete'](_0x6125('0xe'),auth['isAuthenticated'](),controller[_0x6125('0x10')]);module[_0x6125('0x11')]=router; \ No newline at end of file +var _0x0fde=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','exports','path'];(function(_0x551890,_0x986a6d){var _0x483ab2=function(_0x2e9d5d){while(--_0x2e9d5d){_0x551890['push'](_0x551890['shift']());}};_0x483ab2(++_0x986a6d);}(_0x0fde,0xb3));var _0xe0fd=function(_0x8ed995,_0xe845){_0x8ed995=_0x8ed995-0x0;var _0x492bff=_0x0fde[_0x8ed995];return _0x492bff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe0fd('0x0'));var timeout=require(_0xe0fd('0x1'));var express=require(_0xe0fd('0x2'));var router=express[_0xe0fd('0x3')]();var fs_extra=require(_0xe0fd('0x4'));var auth=require(_0xe0fd('0x5'));var interaction=require(_0xe0fd('0x6'));var config=require(_0xe0fd('0x7'));var controller=require(_0xe0fd('0x8'));router[_0xe0fd('0x9')]('/',auth[_0xe0fd('0xa')](),controller[_0xe0fd('0xb')]);router['get']('/:id',auth[_0xe0fd('0xa')](),controller[_0xe0fd('0xc')]);router[_0xe0fd('0xd')]('/',auth[_0xe0fd('0xa')](),controller[_0xe0fd('0xe')]);router[_0xe0fd('0xf')](_0xe0fd('0x10'),auth[_0xe0fd('0xa')](),controller['update']);router['delete'](_0xe0fd('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xe0fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 8a1125b..0b9f5c4 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 _0x55db=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x21af12,_0x4532c3){var _0x2b02f4=function(_0x984d07){while(--_0x984d07){_0x21af12['push'](_0x21af12['shift']());}};_0x2b02f4(++_0x4532c3);}(_0x55db,0xfd));var _0xb55d=function(_0x1fced3,_0x1a65f9){_0x1fced3=_0x1fced3-0x0;var _0x1324b5=_0x55db[_0x1fced3];return _0x1324b5;};'use strict';var Sequelize=require(_0xb55d('0x0'));module[_0xb55d('0x1')]={'type':{'type':Sequelize[_0xb55d('0x2')]('string',_0xb55d('0x3'),_0xb55d('0x4'),'keyValue',_0xb55d('0x5')),'defaultValue':_0xb55d('0x6')},'content':{'type':Sequelize[_0xb55d('0x7')]},'key':{'type':Sequelize[_0xb55d('0x7')]},'keyType':{'type':Sequelize[_0xb55d('0x2')](_0xb55d('0x6'),'variable',_0xb55d('0x4'))},'keyContent':{'type':Sequelize[_0xb55d('0x7')]},'idField':{'type':Sequelize[_0xb55d('0x7')]},'nameField':{'type':Sequelize[_0xb55d('0x7')]},'customField':{'type':Sequelize[_0xb55d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb55d('0x7')]}}; \ No newline at end of file +var _0xe99e=['STRING','ENUM','sequelize','exports','variable','customVariable','string'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xe99e,0xe9));var _0xee99=function(_0x232e58,_0x101edc){_0x232e58=_0x232e58-0x0;var _0x267999=_0xe99e[_0x232e58];return _0x267999;};'use strict';var Sequelize=require(_0xee99('0x0'));module[_0xee99('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xee99('0x2'),_0xee99('0x3'),'keyValue','picklist'),'defaultValue':_0xee99('0x4')},'content':{'type':Sequelize[_0xee99('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xee99('0x6')](_0xee99('0x4'),'variable',_0xee99('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee99('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 05ef663..4137350 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 _0xdc2f=['path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','destroy','stack','name','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','include','findAll','catch','params','keys','fields','includeAll','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xdc2f,0x1f1));var _0xfdc2=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xdc2f[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0xfdc2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdc2('0x1'));var rp=require(_0xfdc2('0x2'));var moment=require(_0xfdc2('0x3'));var BPromise=require(_0xfdc2('0x4'));var Mustache=require(_0xfdc2('0x5'));var util=require(_0xfdc2('0x6'));var path=require(_0xfdc2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdc2('0x8'));var _=require(_0xfdc2('0x9'));var squel=require(_0xfdc2('0xa'));var crypto=require(_0xfdc2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfdc2('0xc'));var toCsv=require(_0xfdc2('0xd'));var querystring=require(_0xfdc2('0xe'));var Papa=require(_0xfdc2('0xf'));var Redis=require(_0xfdc2('0x10'));var authService=require(_0xfdc2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfdc2('0x12'));var hardwareService=require(_0xfdc2('0x13'));var logger=require(_0xfdc2('0x14'))(_0xfdc2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfdc2('0x16'))['db'];function respondWithStatusCode(_0x1227fc,_0xd2f363){_0xd2f363=_0xd2f363||0xcc;return function(_0x2b4d68){if(_0x2b4d68){return _0x1227fc[_0xfdc2('0x17')](_0xd2f363);}return _0x1227fc['status'](_0xd2f363)[_0xfdc2('0x18')]();};}function respondWithResult(_0x507f32,_0x5a2a34){_0x5a2a34=_0x5a2a34||0xc8;return function(_0x2760f8){if(_0x2760f8){return _0x507f32['status'](_0x5a2a34)[_0xfdc2('0x19')](_0x2760f8);}};}function respondWithFilteredResult(_0x1e502e,_0x16406d){return function(_0x5d6497){if(_0x5d6497){var _0x457dd4=typeof _0x16406d[_0xfdc2('0x1a')]===_0xfdc2('0x1b')&&typeof _0x16406d[_0xfdc2('0x1c')]===_0xfdc2('0x1b');var _0x5af93b=_0x5d6497[_0xfdc2('0x1d')];var _0x11c230=_0x457dd4?0x0:_0x16406d[_0xfdc2('0x1a')];var _0x5592e3=_0x457dd4?_0x5d6497[_0xfdc2('0x1d')]:_0x16406d[_0xfdc2('0x1a')]+_0x16406d['limit'];var _0x1ae6e9;if(_0x5592e3>=_0x5af93b){_0x5592e3=_0x5af93b;_0x1ae6e9=0xc8;}else{_0x1ae6e9=0xce;}_0x1e502e[_0xfdc2('0x1e')](_0x1ae6e9);return _0x1e502e['set']('Content-Range',_0x11c230+'-'+_0x5592e3+'/'+_0x5af93b)[_0xfdc2('0x19')](_0x5d6497);}return null;};}function patchUpdates(_0x1f2bf5){return function(_0x35de2b){try{jsonpatch[_0xfdc2('0x1f')](_0x35de2b,_0x1f2bf5,!![]);}catch(_0x1adb71){return BPromise[_0xfdc2('0x20')](_0x1adb71);}return _0x35de2b[_0xfdc2('0x21')]();};}function saveUpdates(_0x42ddaa,_0x57c06e){return function(_0x4541cd){if(_0x4541cd){return _0x4541cd[_0xfdc2('0x22')](_0x42ddaa)['then'](function(_0x4d1214){return _0x4d1214;});}return null;};}function removeEntity(_0x1446c9,_0x2478ae){return function(_0x46e9ab){if(_0x46e9ab){return _0x46e9ab[_0xfdc2('0x23')]()['then'](function(){_0x1446c9['status'](0xcc)[_0xfdc2('0x18')]();});}};}function handleEntityNotFound(_0x1c5f23,_0x5de17c){return function(_0x5c4e71){if(!_0x5c4e71){_0x1c5f23[_0xfdc2('0x17')](0x194);}return _0x5c4e71;};}function handleError(_0x5a4e32,_0x380918){_0x380918=_0x380918||0x1f4;return function(_0x384e77){logger['error'](_0x384e77[_0xfdc2('0x24')]);if(_0x384e77[_0xfdc2('0x25')]){delete _0x384e77[_0xfdc2('0x25')];}_0x5a4e32[_0xfdc2('0x1e')](_0x380918)['send'](_0x384e77);};}exports[_0xfdc2('0x26')]=function(_0x36ea0a,_0x523f58){var _0x22d995={},_0x3e47d2={},_0x2789e1={'count':0x0,'rows':[]};var _0x2bae86=_['map'](db[_0xfdc2('0x27')][_0xfdc2('0x28')],function(_0x130c8d){return{'name':_0x130c8d[_0xfdc2('0x29')],'type':_0x130c8d[_0xfdc2('0x2a')][_0xfdc2('0x2b')]};});_0x3e47d2[_0xfdc2('0x2c')]=_[_0xfdc2('0x2d')](_0x2bae86,_0xfdc2('0x25'));_0x3e47d2[_0xfdc2('0x2e')]=_['keys'](_0x36ea0a[_0xfdc2('0x2e')]);_0x3e47d2['filters']=_[_0xfdc2('0x2f')](_0x3e47d2['model'],_0x3e47d2[_0xfdc2('0x2e')]);_0x22d995[_0xfdc2('0x30')]=_['intersection'](_0x3e47d2[_0xfdc2('0x2c')],qs['fields'](_0x36ea0a[_0xfdc2('0x2e')]['fields']));_0x22d995[_0xfdc2('0x30')]=_0x22d995[_0xfdc2('0x30')][_0xfdc2('0x31')]?_0x22d995[_0xfdc2('0x30')]:_0x3e47d2[_0xfdc2('0x2c')];if(!_0x36ea0a[_0xfdc2('0x2e')][_0xfdc2('0x32')](_0xfdc2('0x33'))){_0x22d995[_0xfdc2('0x1c')]=qs[_0xfdc2('0x1c')](_0x36ea0a[_0xfdc2('0x2e')]['limit']);_0x22d995[_0xfdc2('0x1a')]=qs[_0xfdc2('0x1a')](_0x36ea0a[_0xfdc2('0x2e')][_0xfdc2('0x1a')]);}_0x22d995[_0xfdc2('0x34')]=qs['sort'](_0x36ea0a[_0xfdc2('0x2e')][_0xfdc2('0x35')]);_0x22d995['where']=qs[_0xfdc2('0x36')](_[_0xfdc2('0x37')](_0x36ea0a[_0xfdc2('0x2e')],_0x3e47d2[_0xfdc2('0x36')]),_0x2bae86);if(_0x36ea0a['query'][_0xfdc2('0x38')]){_0x22d995[_0xfdc2('0x39')]=_[_0xfdc2('0x3a')](_0x22d995[_0xfdc2('0x39')],{'$or':_[_0xfdc2('0x2d')](_0x2bae86,function(_0x3038dd){if(_0x3038dd[_0xfdc2('0x2a')]!==_0xfdc2('0x3b')){var _0x4bce82={};_0x4bce82[_0x3038dd[_0xfdc2('0x25')]]={'$like':'%'+_0x36ea0a[_0xfdc2('0x2e')][_0xfdc2('0x38')]+'%'};return _0x4bce82;}})});}_0x22d995=_[_0xfdc2('0x3a')]({},_0x22d995,_0x36ea0a[_0xfdc2('0x3c')]);var _0x563750={'where':_0x22d995[_0xfdc2('0x39')]};return db[_0xfdc2('0x27')]['count'](_0x563750)[_0xfdc2('0x3d')](function(_0x3a8f21){_0x2789e1[_0xfdc2('0x1d')]=_0x3a8f21;if(_0x36ea0a['query']['includeAll']){_0x22d995[_0xfdc2('0x3e')]=[{'all':!![]}];}return db[_0xfdc2('0x27')][_0xfdc2('0x3f')](_0x22d995);})[_0xfdc2('0x3d')](function(_0x4bcdcc){_0x2789e1['rows']=_0x4bcdcc;return _0x2789e1;})['then'](respondWithFilteredResult(_0x523f58,_0x22d995))[_0xfdc2('0x40')](handleError(_0x523f58,null));};exports['show']=function(_0x5e5cac,_0x4d9b39){var _0x480ffa={'raw':!![],'where':{'id':_0x5e5cac[_0xfdc2('0x41')]['id']}},_0x52240a={};_0x52240a[_0xfdc2('0x2c')]=_[_0xfdc2('0x42')](db[_0xfdc2('0x27')]['rawAttributes']);_0x52240a[_0xfdc2('0x2e')]=_[_0xfdc2('0x42')](_0x5e5cac[_0xfdc2('0x2e')]);_0x52240a['filters']=_['intersection'](_0x52240a['model'],_0x52240a[_0xfdc2('0x2e')]);_0x480ffa[_0xfdc2('0x30')]=_['intersection'](_0x52240a[_0xfdc2('0x2c')],qs[_0xfdc2('0x43')](_0x5e5cac['query'][_0xfdc2('0x43')]));_0x480ffa[_0xfdc2('0x30')]=_0x480ffa[_0xfdc2('0x30')][_0xfdc2('0x31')]?_0x480ffa[_0xfdc2('0x30')]:_0x52240a['model'];if(_0x5e5cac[_0xfdc2('0x2e')][_0xfdc2('0x44')]){_0x480ffa[_0xfdc2('0x3e')]=[{'all':!![]}];}_0x480ffa=_[_0xfdc2('0x3a')]({},_0x480ffa,_0x5e5cac[_0xfdc2('0x3c')]);return db[_0xfdc2('0x27')][_0xfdc2('0x45')](_0x480ffa)[_0xfdc2('0x3d')](handleEntityNotFound(_0x4d9b39,null))[_0xfdc2('0x3d')](respondWithResult(_0x4d9b39,null))[_0xfdc2('0x40')](handleError(_0x4d9b39,null));};exports[_0xfdc2('0x46')]=function(_0x1fd14c,_0x264d17){return db[_0xfdc2('0x27')][_0xfdc2('0x46')](_0x1fd14c[_0xfdc2('0x47')],{})[_0xfdc2('0x3d')](respondWithResult(_0x264d17,0xc9))[_0xfdc2('0x40')](handleError(_0x264d17,null));};exports[_0xfdc2('0x22')]=function(_0x10157c,_0x3e9004){if(_0x10157c[_0xfdc2('0x47')]['id']){delete _0x10157c[_0xfdc2('0x47')]['id'];}return db[_0xfdc2('0x27')][_0xfdc2('0x45')]({'where':{'id':_0x10157c['params']['id']}})[_0xfdc2('0x3d')](handleEntityNotFound(_0x3e9004,null))['then'](saveUpdates(_0x10157c[_0xfdc2('0x47')],null))['then'](respondWithResult(_0x3e9004,null))['catch'](handleError(_0x3e9004,null));};exports[_0xfdc2('0x23')]=function(_0x28aa98,_0x44ff85){return db['ServicenowField'][_0xfdc2('0x45')]({'where':{'id':_0x28aa98['params']['id']}})[_0xfdc2('0x3d')](handleEntityNotFound(_0x44ff85,null))[_0xfdc2('0x3d')](removeEntity(_0x44ff85,null))['catch'](handleError(_0x44ff85,null));}; \ No newline at end of file +var _0x85c1=['VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','request-promise','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge'];(function(_0x544ac9,_0x306137){var _0x18327a=function(_0x3d12e2){while(--_0x3d12e2){_0x544ac9['push'](_0x544ac9['shift']());}};_0x18327a(++_0x306137);}(_0x85c1,0x1a6));var _0x185c=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x85c1[_0x2405bc];return _0x5272d4;};'use strict';var emlformat=require(_0x185c('0x0'));var rimraf=require(_0x185c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x185c('0x2'));var moment=require(_0x185c('0x3'));var BPromise=require(_0x185c('0x4'));var Mustache=require(_0x185c('0x5'));var util=require(_0x185c('0x6'));var path=require(_0x185c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x185c('0x8'));var fs=require('fs');var fs_extra=require(_0x185c('0x9'));var _=require(_0x185c('0xa'));var squel=require(_0x185c('0xb'));var crypto=require(_0x185c('0xc'));var jsforce=require(_0x185c('0xd'));var deskjs=require(_0x185c('0xe'));var toCsv=require(_0x185c('0xf'));var querystring=require(_0x185c('0x10'));var Papa=require(_0x185c('0x11'));var Redis=require(_0x185c('0x12'));var authService=require(_0x185c('0x13'));var qs=require(_0x185c('0x14'));var as=require(_0x185c('0x15'));var hardwareService=require(_0x185c('0x16'));var logger=require(_0x185c('0x17'))(_0x185c('0x18'));var utils=require(_0x185c('0x19'));var config=require(_0x185c('0x1a'));var licenseUtil=require(_0x185c('0x1b'));var db=require(_0x185c('0x1c'))['db'];function respondWithStatusCode(_0x1122aa,_0x1f776d){_0x1f776d=_0x1f776d||0xcc;return function(_0x4e9d2e){if(_0x4e9d2e){return _0x1122aa['sendStatus'](_0x1f776d);}return _0x1122aa[_0x185c('0x1d')](_0x1f776d)[_0x185c('0x1e')]();};}function respondWithResult(_0x551574,_0x124510){_0x124510=_0x124510||0xc8;return function(_0x597d87){if(_0x597d87){return _0x551574[_0x185c('0x1d')](_0x124510)['json'](_0x597d87);}};}function respondWithFilteredResult(_0x59dcfb,_0x2a1308){return function(_0x4638e4){if(_0x4638e4){var _0x4915c4=typeof _0x2a1308[_0x185c('0x1f')]===_0x185c('0x20')&&typeof _0x2a1308[_0x185c('0x21')]==='undefined';var _0x394a56=_0x4638e4[_0x185c('0x22')];var _0x56cf17=_0x4915c4?0x0:_0x2a1308['offset'];var _0x528fd6=_0x4915c4?_0x4638e4['count']:_0x2a1308[_0x185c('0x1f')]+_0x2a1308[_0x185c('0x21')];var _0x26b510;if(_0x528fd6>=_0x394a56){_0x528fd6=_0x394a56;_0x26b510=0xc8;}else{_0x26b510=0xce;}_0x59dcfb[_0x185c('0x1d')](_0x26b510);return _0x59dcfb[_0x185c('0x23')]('Content-Range',_0x56cf17+'-'+_0x528fd6+'/'+_0x394a56)[_0x185c('0x24')](_0x4638e4);}return null;};}function patchUpdates(_0x569cbf){return function(_0x480b33){try{jsonpatch[_0x185c('0x25')](_0x480b33,_0x569cbf,!![]);}catch(_0x3aabe1){return BPromise[_0x185c('0x26')](_0x3aabe1);}return _0x480b33[_0x185c('0x27')]();};}function saveUpdates(_0x369422,_0x57277b){return function(_0xacf45e){if(_0xacf45e){return _0xacf45e[_0x185c('0x28')](_0x369422)[_0x185c('0x29')](function(_0x32b083){return _0x32b083;});}return null;};}function removeEntity(_0xe9199d,_0x1e4bda){return function(_0x423762){if(_0x423762){return _0x423762[_0x185c('0x2a')]()[_0x185c('0x29')](function(){_0xe9199d[_0x185c('0x1d')](0xcc)[_0x185c('0x1e')]();});}};}function handleEntityNotFound(_0x2100cf,_0x3405f1){return function(_0xe15b7d){if(!_0xe15b7d){_0x2100cf[_0x185c('0x2b')](0x194);}return _0xe15b7d;};}function handleError(_0x132843,_0x3effd3){_0x3effd3=_0x3effd3||0x1f4;return function(_0x19be97){logger[_0x185c('0x2c')](_0x19be97[_0x185c('0x2d')]);if(_0x19be97[_0x185c('0x2e')]){delete _0x19be97['name'];}_0x132843['status'](_0x3effd3)[_0x185c('0x2f')](_0x19be97);};}exports[_0x185c('0x30')]=function(_0x55a4ae,_0x33925f){var _0x57ae3f={},_0x371fe4={},_0x1dc707={'count':0x0,'rows':[]};var _0x326034=_[_0x185c('0x31')](db[_0x185c('0x32')][_0x185c('0x33')],function(_0x1b6d58){return{'name':_0x1b6d58[_0x185c('0x34')],'type':_0x1b6d58[_0x185c('0x35')][_0x185c('0x36')]};});_0x371fe4['model']=_[_0x185c('0x31')](_0x326034,_0x185c('0x2e'));_0x371fe4[_0x185c('0x37')]=_[_0x185c('0x38')](_0x55a4ae[_0x185c('0x37')]);_0x371fe4['filters']=_[_0x185c('0x39')](_0x371fe4[_0x185c('0x3a')],_0x371fe4[_0x185c('0x37')]);_0x57ae3f[_0x185c('0x3b')]=_[_0x185c('0x39')](_0x371fe4['model'],qs[_0x185c('0x3c')](_0x55a4ae[_0x185c('0x37')]['fields']));_0x57ae3f[_0x185c('0x3b')]=_0x57ae3f[_0x185c('0x3b')][_0x185c('0x3d')]?_0x57ae3f[_0x185c('0x3b')]:_0x371fe4[_0x185c('0x3a')];if(!_0x55a4ae[_0x185c('0x37')][_0x185c('0x3e')](_0x185c('0x3f'))){_0x57ae3f[_0x185c('0x21')]=qs[_0x185c('0x21')](_0x55a4ae[_0x185c('0x37')]['limit']);_0x57ae3f['offset']=qs[_0x185c('0x1f')](_0x55a4ae[_0x185c('0x37')]['offset']);}_0x57ae3f[_0x185c('0x40')]=qs[_0x185c('0x41')](_0x55a4ae['query'][_0x185c('0x41')]);_0x57ae3f['where']=qs[_0x185c('0x42')](_['pick'](_0x55a4ae['query'],_0x371fe4[_0x185c('0x42')]),_0x326034);if(_0x55a4ae['query'][_0x185c('0x43')]){_0x57ae3f[_0x185c('0x44')]=_[_0x185c('0x45')](_0x57ae3f[_0x185c('0x44')],{'$or':_[_0x185c('0x31')](_0x326034,function(_0x56d436){if(_0x56d436[_0x185c('0x35')]!==_0x185c('0x46')){var _0x392a05={};_0x392a05[_0x56d436[_0x185c('0x2e')]]={'$like':'%'+_0x55a4ae[_0x185c('0x37')]['filter']+'%'};return _0x392a05;}})});}_0x57ae3f=_[_0x185c('0x45')]({},_0x57ae3f,_0x55a4ae[_0x185c('0x47')]);var _0x3fca1c={'where':_0x57ae3f[_0x185c('0x44')]};return db[_0x185c('0x32')][_0x185c('0x22')](_0x3fca1c)[_0x185c('0x29')](function(_0x89a506){_0x1dc707['count']=_0x89a506;if(_0x55a4ae[_0x185c('0x37')]['includeAll']){_0x57ae3f[_0x185c('0x48')]=[{'all':!![]}];}return db['ServicenowField'][_0x185c('0x49')](_0x57ae3f);})[_0x185c('0x29')](function(_0x48c3ff){_0x1dc707[_0x185c('0x4a')]=_0x48c3ff;return _0x1dc707;})[_0x185c('0x29')](respondWithFilteredResult(_0x33925f,_0x57ae3f))[_0x185c('0x4b')](handleError(_0x33925f,null));};exports[_0x185c('0x4c')]=function(_0x2245ca,_0x27f1b4){var _0x4bb836={'raw':!![],'where':{'id':_0x2245ca[_0x185c('0x4d')]['id']}},_0x382964={};_0x382964['model']=_[_0x185c('0x38')](db[_0x185c('0x32')][_0x185c('0x33')]);_0x382964[_0x185c('0x37')]=_[_0x185c('0x38')](_0x2245ca[_0x185c('0x37')]);_0x382964['filters']=_[_0x185c('0x39')](_0x382964[_0x185c('0x3a')],_0x382964[_0x185c('0x37')]);_0x4bb836[_0x185c('0x3b')]=_[_0x185c('0x39')](_0x382964[_0x185c('0x3a')],qs[_0x185c('0x3c')](_0x2245ca['query']['fields']));_0x4bb836[_0x185c('0x3b')]=_0x4bb836['attributes'][_0x185c('0x3d')]?_0x4bb836['attributes']:_0x382964['model'];if(_0x2245ca[_0x185c('0x37')][_0x185c('0x4e')]){_0x4bb836[_0x185c('0x48')]=[{'all':!![]}];}_0x4bb836=_[_0x185c('0x45')]({},_0x4bb836,_0x2245ca[_0x185c('0x47')]);return db['ServicenowField'][_0x185c('0x4f')](_0x4bb836)['then'](handleEntityNotFound(_0x27f1b4,null))[_0x185c('0x29')](respondWithResult(_0x27f1b4,null))[_0x185c('0x4b')](handleError(_0x27f1b4,null));};exports[_0x185c('0x50')]=function(_0x42497b,_0x197a82){return db[_0x185c('0x32')]['create'](_0x42497b[_0x185c('0x51')],{})['then'](respondWithResult(_0x197a82,0xc9))[_0x185c('0x4b')](handleError(_0x197a82,null));};exports[_0x185c('0x28')]=function(_0x13ed0c,_0xc8927a){if(_0x13ed0c[_0x185c('0x51')]['id']){delete _0x13ed0c[_0x185c('0x51')]['id'];}return db[_0x185c('0x32')][_0x185c('0x4f')]({'where':{'id':_0x13ed0c[_0x185c('0x4d')]['id']}})[_0x185c('0x29')](handleEntityNotFound(_0xc8927a,null))[_0x185c('0x29')](saveUpdates(_0x13ed0c[_0x185c('0x51')],null))[_0x185c('0x29')](respondWithResult(_0xc8927a,null))[_0x185c('0x4b')](handleError(_0xc8927a,null));};exports['destroy']=function(_0xa8b5d4,_0x500b0c){return db['ServicenowField'][_0x185c('0x4f')]({'where':{'id':_0xa8b5d4['params']['id']}})['then'](handleEntityNotFound(_0x500b0c,null))[_0x185c('0x29')](removeEntity(_0x500b0c,null))['catch'](handleError(_0x500b0c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7c4e32e..ed5ad34 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 _0x98c2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x5a3ec6,_0x2de80a){var _0x56f894=function(_0x391b68){while(--_0x391b68){_0x5a3ec6['push'](_0x5a3ec6['shift']());}};_0x56f894(++_0x2de80a);}(_0x98c2,0x8b));var _0x298c=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x98c2[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x298c('0x0'));var util=require('util');var logger=require(_0x298c('0x1'))(_0x298c('0x2'));var moment=require(_0x298c('0x3'));var BPromise=require(_0x298c('0x4'));var rp=require(_0x298c('0x5'));var fs=require('fs');var path=require(_0x298c('0x6'));var rimraf=require(_0x298c('0x7'));var config=require('../../config/environment');var attributes=require(_0x298c('0x8'));module[_0x298c('0x9')]=function(_0xf4d9ca,_0x1ae27f){return _0xf4d9ca['define'](_0x298c('0xa'),attributes,{'tableName':_0x298c('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x298c('0xc'),_0x298c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c25=['../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4925b8,_0x580dff){var _0x535277=function(_0x587689){while(--_0x587689){_0x4925b8['push'](_0x4925b8['shift']());}};_0x535277(++_0x580dff);}(_0x6c25,0x9d));var _0x56c2=function(_0x154979,_0x2aac80){_0x154979=_0x154979-0x0;var _0x474574=_0x6c25[_0x154979];return _0x474574;};'use strict';var _=require(_0x56c2('0x0'));var util=require(_0x56c2('0x1'));var logger=require(_0x56c2('0x2'))(_0x56c2('0x3'));var moment=require('moment');var BPromise=require(_0x56c2('0x4'));var rp=require(_0x56c2('0x5'));var fs=require('fs');var path=require(_0x56c2('0x6'));var rimraf=require(_0x56c2('0x7'));var config=require(_0x56c2('0x8'));var attributes=require(_0x56c2('0x9'));module[_0x56c2('0xa')]=function(_0x1fceed,_0x19fe58){return _0x1fceed['define'](_0x56c2('0xb'),attributes,{'tableName':_0x56c2('0xc'),'paranoid':![],'indexes':[{'name':_0x56c2('0xd'),'fields':[_0x56c2('0xe'),'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 fe00b05..7623294 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x59e2a0,_0xdb8dca){var _0x91e378=function(_0x164f5e){while(--_0x164f5e){_0x59e2a0['push'](_0x59e2a0['shift']());}};_0x91e378(++_0xdb8dca);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5ee77f,_0x458cd1){_0x5ee77f=_0x5ee77f-0x0;var _0x579418=_0x9ffd[_0x5ee77f];return _0x579418;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f0b7a55..91a86ca 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(_0x10caef,_0x60dfa2){var _0x52abb6=function(_0x2c6d09){while(--_0x2c6d09){_0x10caef['push'](_0x10caef['shift']());}};_0x52abb6(++_0x60dfa2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0x806c9f,_0x3c9e4b){var _0x3781fa=function(_0x5336e7){while(--_0x5336e7){_0x806c9f['push'](_0x806c9f['shift']());}};_0x3781fa(++_0x3c9e4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 68070fd..78267ce 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(_0x320da4,_0x320afe){var _0x351bf1=function(_0x5a6416){while(--_0x5a6416){_0x320da4['push'](_0x320da4['shift']());}};_0x351bf1(++_0x320afe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x6be6c4,_0x2e5d8f){var _0x4edca2=function(_0x4ad159){while(--_0x4ad159){_0x6be6c4['push'](_0x6be6c4['shift']());}};_0x4edca2(++_0x2e5d8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 13ea250..dee596e 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 _0x8ccb=['format','get_module_fields','values','module_fields','remove','includes','label','endsWith','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','includeAll','catch','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','getSubjects','channel','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','parent_id','parent_type','username','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','password','xCALLY\x20Motion\x20Integration'];(function(_0x5e527c,_0xea61){var _0x12c0a7=function(_0x51b83a){while(--_0x51b83a){_0x5e527c['push'](_0x5e527c['shift']());}};_0x12c0a7(++_0xea61);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0x8ccb[_0x1deb72];return _0x18bbdf;};'use strict';var emlformat=require(_0xb8cc('0x0'));var rimraf=require(_0xb8cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8cc('0x2'));var rp=require(_0xb8cc('0x3'));var moment=require(_0xb8cc('0x4'));var BPromise=require(_0xb8cc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8cc('0x6'));var sox=require(_0xb8cc('0x7'));var csv=require(_0xb8cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8cc('0x9'));var _=require(_0xb8cc('0xa'));var squel=require(_0xb8cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb8cc('0xc'));var deskjs=require(_0xb8cc('0xd'));var toCsv=require(_0xb8cc('0x8'));var querystring=require('querystring');var Papa=require(_0xb8cc('0xe'));var Redis=require(_0xb8cc('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb8cc('0x10'));var hardwareService=require(_0xb8cc('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb8cc('0x12'));var config=require(_0xb8cc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8cc('0x14'))['db'];var integrations=require(_0xb8cc('0x15'));function respondWithStatusCode(_0xfd89e0,_0x2875e0){_0x2875e0=_0x2875e0||0xcc;return function(_0x4157db){if(_0x4157db){return _0xfd89e0[_0xb8cc('0x16')](_0x2875e0);}return _0xfd89e0[_0xb8cc('0x17')](_0x2875e0)['end']();};}function respondWithResult(_0x11ecf2,_0x5ec8a7){_0x5ec8a7=_0x5ec8a7||0xc8;return function(_0x2f876e){if(_0x2f876e){return _0x11ecf2[_0xb8cc('0x17')](_0x5ec8a7)[_0xb8cc('0x18')](_0x2f876e);}};}function respondWithFilteredResult(_0x5f3b91,_0x1f8b8d){return function(_0x274cab){if(_0x274cab){var _0x4663d4=typeof _0x1f8b8d['offset']===_0xb8cc('0x19')&&typeof _0x1f8b8d['limit']===_0xb8cc('0x19');var _0x4e6573=_0x274cab[_0xb8cc('0x1a')];var _0x259708=_0x4663d4?0x0:_0x1f8b8d[_0xb8cc('0x1b')];var _0x3e1ba7=_0x4663d4?_0x274cab[_0xb8cc('0x1a')]:_0x1f8b8d['offset']+_0x1f8b8d[_0xb8cc('0x1c')];var _0x1e9769;if(_0x3e1ba7>=_0x4e6573){_0x3e1ba7=_0x4e6573;_0x1e9769=0xc8;}else{_0x1e9769=0xce;}_0x5f3b91[_0xb8cc('0x17')](_0x1e9769);return _0x5f3b91['set'](_0xb8cc('0x1d'),_0x259708+'-'+_0x3e1ba7+'/'+_0x4e6573)[_0xb8cc('0x18')](_0x274cab);}return null;};}function patchUpdates(_0x4a7aac){return function(_0x9b0aba){try{jsonpatch[_0xb8cc('0x1e')](_0x9b0aba,_0x4a7aac,!![]);}catch(_0x4c34b8){return BPromise[_0xb8cc('0x1f')](_0x4c34b8);}return _0x9b0aba[_0xb8cc('0x20')]();};}function saveUpdates(_0xd1c676,_0x1d372c){return function(_0x26fba9){if(_0x26fba9){return _0x26fba9[_0xb8cc('0x21')](_0xd1c676)[_0xb8cc('0x22')](function(_0x59608c){return _0x59608c;});}return null;};}function removeEntity(_0x50aa38,_0x8b6b21){return function(_0x5a8fbf){if(_0x5a8fbf){return _0x5a8fbf[_0xb8cc('0x23')]()['then'](function(){_0x50aa38[_0xb8cc('0x17')](0xcc)[_0xb8cc('0x24')]();});}};}function handleEntityNotFound(_0x335f32,_0x77a162){return function(_0x56ed01){if(!_0x56ed01){_0x335f32[_0xb8cc('0x16')](0x194);}return _0x56ed01;};}function handleError(_0x2cc7f3,_0x400de6){_0x400de6=_0x400de6||0x1f4;return function(_0x13acba){logger[_0xb8cc('0x25')](_0x13acba['stack']);if(_0x13acba['name']){delete _0x13acba[_0xb8cc('0x26')];}_0x2cc7f3[_0xb8cc('0x17')](_0x400de6)['send'](_0x13acba);};}exports[_0xb8cc('0x27')]=function(_0x5cc936,_0x23f204){var _0x2634a4={},_0x1d1514={},_0x118a18={'count':0x0,'rows':[]};var _0x4e3883=_[_0xb8cc('0x28')](db[_0xb8cc('0x29')][_0xb8cc('0x2a')],function(_0x52fbb1){return{'name':_0x52fbb1[_0xb8cc('0x2b')],'type':_0x52fbb1['type'][_0xb8cc('0x2c')]};});_0x1d1514['model']=_[_0xb8cc('0x28')](_0x4e3883,_0xb8cc('0x26'));_0x1d1514['query']=_[_0xb8cc('0x2d')](_0x5cc936[_0xb8cc('0x2e')]);_0x1d1514[_0xb8cc('0x2f')]=_[_0xb8cc('0x30')](_0x1d1514[_0xb8cc('0x31')],_0x1d1514[_0xb8cc('0x2e')]);_0x2634a4[_0xb8cc('0x32')]=_['intersection'](_0x1d1514['model'],qs[_0xb8cc('0x33')](_0x5cc936['query'][_0xb8cc('0x33')]));_0x2634a4['attributes']=_0x2634a4['attributes'][_0xb8cc('0x34')]?_0x2634a4[_0xb8cc('0x32')]:_0x1d1514[_0xb8cc('0x31')];if(!_0x5cc936['query'][_0xb8cc('0x35')](_0xb8cc('0x36'))){_0x2634a4[_0xb8cc('0x1c')]=qs[_0xb8cc('0x1c')](_0x5cc936[_0xb8cc('0x2e')][_0xb8cc('0x1c')]);_0x2634a4[_0xb8cc('0x1b')]=qs[_0xb8cc('0x1b')](_0x5cc936[_0xb8cc('0x2e')][_0xb8cc('0x1b')]);}_0x2634a4[_0xb8cc('0x37')]=qs[_0xb8cc('0x38')](_0x5cc936[_0xb8cc('0x2e')][_0xb8cc('0x38')]);_0x2634a4[_0xb8cc('0x39')]=qs[_0xb8cc('0x2f')](_[_0xb8cc('0x3a')](_0x5cc936[_0xb8cc('0x2e')],_0x1d1514['filters']),_0x4e3883);if(_0x5cc936['query'][_0xb8cc('0x3b')]){_0x2634a4[_0xb8cc('0x39')]=_[_0xb8cc('0x3c')](_0x2634a4[_0xb8cc('0x39')],{'$or':_[_0xb8cc('0x28')](_0x4e3883,function(_0x46e0d2){if(_0x46e0d2[_0xb8cc('0x3d')]!==_0xb8cc('0x3e')){var _0x263cee={};_0x263cee[_0x46e0d2['name']]={'$like':'%'+_0x5cc936['query']['filter']+'%'};return _0x263cee;}})});}_0x2634a4=_['merge']({},_0x2634a4,_0x5cc936[_0xb8cc('0x3f')]);var _0x5a89be={'where':_0x2634a4[_0xb8cc('0x39')]};return db['SugarcrmAccount'][_0xb8cc('0x1a')](_0x5a89be)[_0xb8cc('0x22')](function(_0x88ca47){_0x118a18[_0xb8cc('0x1a')]=_0x88ca47;if(_0x5cc936[_0xb8cc('0x2e')]['includeAll']){_0x2634a4[_0xb8cc('0x40')]=[{'all':!![]}];}return db[_0xb8cc('0x29')][_0xb8cc('0x41')](_0x2634a4);})['then'](function(_0x133ee9){_0x118a18['rows']=_0x133ee9;return _0x118a18;})['then'](respondWithFilteredResult(_0x23f204,_0x2634a4))['catch'](handleError(_0x23f204,null));};exports[_0xb8cc('0x42')]=function(_0xd54827,_0x3d2f26){var _0x3f3a96={'raw':![],'where':{'id':_0xd54827['params']['id']}},_0x51b0e5={};_0x51b0e5[_0xb8cc('0x31')]=_['keys'](db['SugarcrmAccount'][_0xb8cc('0x2a')]);_0x51b0e5[_0xb8cc('0x2e')]=_[_0xb8cc('0x2d')](_0xd54827[_0xb8cc('0x2e')]);_0x51b0e5['filters']=_[_0xb8cc('0x30')](_0x51b0e5[_0xb8cc('0x31')],_0x51b0e5['query']);_0x3f3a96[_0xb8cc('0x32')]=_[_0xb8cc('0x30')](_0x51b0e5[_0xb8cc('0x31')],qs[_0xb8cc('0x33')](_0xd54827[_0xb8cc('0x2e')][_0xb8cc('0x33')]));_0x3f3a96[_0xb8cc('0x32')]=_0x3f3a96['attributes'][_0xb8cc('0x34')]?_0x3f3a96[_0xb8cc('0x32')]:_0x51b0e5[_0xb8cc('0x31')];if(_0xd54827[_0xb8cc('0x2e')][_0xb8cc('0x43')]){_0x3f3a96[_0xb8cc('0x40')]=[{'all':!![]}];}_0x3f3a96=_[_0xb8cc('0x3c')]({},_0x3f3a96,_0xd54827['options']);return db[_0xb8cc('0x29')]['find'](_0x3f3a96)['then'](handleEntityNotFound(_0x3d2f26,null))['then'](respondWithResult(_0x3d2f26,null))[_0xb8cc('0x44')](handleError(_0x3d2f26,null));};exports[_0xb8cc('0x45')]=function(_0x210d59,_0x19cd31){return db['SugarcrmAccount']['create'](_0x210d59[_0xb8cc('0x46')],{})[_0xb8cc('0x22')](respondWithResult(_0x19cd31,0xc9))[_0xb8cc('0x44')](handleError(_0x19cd31,null));};exports[_0xb8cc('0x21')]=function(_0x3216a4,_0x34a8a5){if(_0x3216a4[_0xb8cc('0x46')]['id']){delete _0x3216a4[_0xb8cc('0x46')]['id'];}return db[_0xb8cc('0x29')][_0xb8cc('0x47')]({'where':{'id':_0x3216a4['params']['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0x34a8a5,null))[_0xb8cc('0x22')](saveUpdates(_0x3216a4[_0xb8cc('0x46')],null))[_0xb8cc('0x22')](respondWithResult(_0x34a8a5,null))['catch'](handleError(_0x34a8a5,null));};exports[_0xb8cc('0x23')]=function(_0x4688b4,_0x1aa318){return db['SugarcrmAccount'][_0xb8cc('0x47')]({'where':{'id':_0x4688b4[_0xb8cc('0x48')]['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0x1aa318,null))['then'](removeEntity(_0x1aa318,null))[_0xb8cc('0x44')](handleError(_0x1aa318,null));};exports[_0xb8cc('0x49')]=function(_0x563e4f,_0xaeb76,_0x1232d0){var _0x27cf78={};var _0x59d522={};var _0x414eb2;var _0xa2d0ba;return db[_0xb8cc('0x29')][_0xb8cc('0x4a')]({'where':{'id':_0x563e4f['params']['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0xaeb76,null))[_0xb8cc('0x22')](function(_0x43c180){if(_0x43c180){_0x414eb2=_0x43c180;_0x59d522['model']=_[_0xb8cc('0x2d')](db[_0xb8cc('0x4b')][_0xb8cc('0x2a')]);_0x59d522[_0xb8cc('0x2e')]=_[_0xb8cc('0x2d')](_0x563e4f[_0xb8cc('0x2e')]);_0x59d522[_0xb8cc('0x2f')]=_[_0xb8cc('0x30')](_0x59d522[_0xb8cc('0x31')],_0x59d522['query']);_0x27cf78['attributes']=_[_0xb8cc('0x30')](_0x59d522[_0xb8cc('0x31')],qs['fields'](_0x563e4f['query'][_0xb8cc('0x33')]));_0x27cf78[_0xb8cc('0x32')]=_0x27cf78[_0xb8cc('0x32')][_0xb8cc('0x34')]?_0x27cf78[_0xb8cc('0x32')]:_0x59d522['model'];_0x27cf78[_0xb8cc('0x37')]=qs[_0xb8cc('0x38')](_0x563e4f[_0xb8cc('0x2e')]['sort']);_0x27cf78[_0xb8cc('0x39')]=qs[_0xb8cc('0x2f')](_[_0xb8cc('0x3a')](_0x563e4f[_0xb8cc('0x2e')],_0x59d522[_0xb8cc('0x2f')]));if(_0x563e4f[_0xb8cc('0x2e')][_0xb8cc('0x3b')]){_0x27cf78[_0xb8cc('0x39')]=_[_0xb8cc('0x3c')](_0x27cf78[_0xb8cc('0x39')],{'$or':_[_0xb8cc('0x28')](_0x27cf78[_0xb8cc('0x32')],function(_0x3aa1fc){var _0x58fe9c={};_0x58fe9c[_0x3aa1fc]={'$like':'%'+_0x563e4f['query']['filter']+'%'};return _0x58fe9c;})});}_0x27cf78=_[_0xb8cc('0x3c')]({},_0x27cf78,_0x563e4f[_0xb8cc('0x3f')]);return _0x414eb2[_0xb8cc('0x49')](_0x27cf78);}})[_0xb8cc('0x22')](function(_0xc82a4b){if(_0xc82a4b){_0xa2d0ba=_0xc82a4b[_0xb8cc('0x34')];if(!_0x563e4f['query']['hasOwnProperty']('nolimit')){_0x27cf78[_0xb8cc('0x1c')]=qs[_0xb8cc('0x1c')](_0x563e4f[_0xb8cc('0x2e')][_0xb8cc('0x1c')]);_0x27cf78['offset']=qs['offset'](_0x563e4f[_0xb8cc('0x2e')][_0xb8cc('0x1b')]);}return _0x414eb2[_0xb8cc('0x49')](_0x27cf78);}})['then'](function(_0x51b184){if(_0x51b184){return _0x51b184?{'count':_0xa2d0ba,'rows':_0x51b184}:null;}})[_0xb8cc('0x22')](respondWithResult(_0xaeb76,null))['catch'](handleError(_0xaeb76,null));};exports['addConfiguration']=function(_0x2b0917,_0x2a92b9,_0x3a9edf){if(_0x2b0917[_0xb8cc('0x46')]['id']){delete _0x2b0917[_0xb8cc('0x46')]['id'];}return db[_0xb8cc('0x29')][_0xb8cc('0x4a')]({'where':{'id':_0x2b0917['params']['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0x2a92b9,null))['then'](function(_0x546d75){if(_0x546d75){_0x2b0917[_0xb8cc('0x46')]['AccountId']=_0x546d75['id'];_0x2b0917[_0xb8cc('0x46')]['Subjects']=integrations[_0xb8cc('0x4c')](_0x2b0917['body'][_0xb8cc('0x4d')],_0x2b0917[_0xb8cc('0x46')][_0xb8cc('0x3d')]);_0x2b0917['body']['Descriptions']=integrations[_0xb8cc('0x4e')](_0x2b0917[_0xb8cc('0x46')][_0xb8cc('0x4d')],_0x2b0917[_0xb8cc('0x46')][_0xb8cc('0x3d')]);return db['SugarcrmConfiguration'][_0xb8cc('0x45')](_0x2b0917[_0xb8cc('0x46')],{'include':[{'model':db[_0xb8cc('0x4f')],'as':'Subjects'},{'model':db[_0xb8cc('0x4f')],'as':'Descriptions'}]});}return null;})[_0xb8cc('0x22')](respondWithResult(_0x2a92b9,null))['catch'](handleError(_0x2a92b9,null));};exports[_0xb8cc('0x50')]=function(_0x423cbd,_0x16de12,_0x2f787f){var _0x46ac85='';var _0x57f2d4=['id',_0xb8cc('0x26'),_0xb8cc('0x51'),_0xb8cc('0x52'),_0xb8cc('0x53'),'date_start','duration_hours','duration_minutes',_0xb8cc('0x54'),_0xb8cc('0x55'),'parent_name','direction'];return db[_0xb8cc('0x29')][_0xb8cc('0x4a')]({'where':{'id':_0x423cbd['params']['id']},'attributes':['id',_0xb8cc('0x56'),'password',_0xb8cc('0x57')]})['then'](handleEntityNotFound(_0x16de12,null))[_0xb8cc('0x22')](function(_0x361eb0){if(_0x361eb0){_0x46ac85=_0x361eb0['remoteUri'];var _0x2b98d9=_0x46ac85[_0xb8cc('0x58')](-0x1);if(_0x2b98d9==='/'){_0x46ac85=_0x46ac85[_0xb8cc('0x59')](0x0,_0x46ac85[_0xb8cc('0x5a')](_0x2b98d9));}return rp({'method':_0xb8cc('0x5b'),'uri':util['format'](_0xb8cc('0x5c'),_0x46ac85,_0xb8cc('0x5d')),'json':!![],'form':{'method':'login','input_type':_0xb8cc('0x5e'),'response_type':_0xb8cc('0x5e'),'rest_data':JSON[_0xb8cc('0x5f')]({'user_auth':{'user_name':_0x361eb0[_0xb8cc('0x56')],'password':_0x361eb0[_0xb8cc('0x60')],'encryption':'PLAIN'},'application':_0xb8cc('0x61')})}});}})[_0xb8cc('0x22')](function(_0x3ec6d5){if(_0x3ec6d5&&_0x3ec6d5[_0xb8cc('0x26')]!=='Invalid\x20Login'&&_0x3ec6d5['name']!=='Password\x20Expired'){return rp({'method':_0xb8cc('0x5b'),'uri':util[_0xb8cc('0x62')](_0xb8cc('0x5c'),_0x46ac85,_0xb8cc('0x5d')),'json':!![],'form':{'method':_0xb8cc('0x63'),'input_type':'JSON','response_type':_0xb8cc('0x5e'),'rest_data':JSON[_0xb8cc('0x5f')]({'session':_0x3ec6d5['id'],'module_name':'Calls'})}})[_0xb8cc('0x22')](function(_0x80b8a){if(_0x80b8a){var _0xe7e91=_[_0xb8cc('0x64')](_0x80b8a[_0xb8cc('0x65')]);_[_0xb8cc('0x66')](_0xe7e91,function(_0x40a254){return _0x57f2d4[_0xb8cc('0x67')](_0x40a254[_0xb8cc('0x26')]);});return{'count':_0xe7e91[_0xb8cc('0x34')],'rows':_['map'](_0xe7e91,function(_0x35178a){return{'id':_0x35178a[_0xb8cc('0x26')],'name':_0x35178a[_0xb8cc('0x68')],'custom':_[_0xb8cc('0x69')](_0x35178a[_0xb8cc('0x26')],'_c')?!![]:![],'options':_0x35178a[_0xb8cc('0x3f')]?_[_0xb8cc('0x28')](_[_0xb8cc('0x64')](_0x35178a[_0xb8cc('0x3f')]),function(_0x51a9b0){return{'name':_0x51a9b0['value'],'value':_0x51a9b0[_0xb8cc('0x26')]};}):[]};})};}})['then'](respondWithResult(_0x16de12,null))[_0xb8cc('0x44')](function(_0x51873d){var _0x3510b3=_0x423cbd[_0xb8cc('0x2e')][_0xb8cc('0x6a')]?0x1f4:_0x51873d[_0xb8cc('0x6b')]||0x1f4;logger[_0xb8cc('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xb8cc('0x50'),_0x3510b3,JSON[_0xb8cc('0x5f')](_0x51873d));delete _0x51873d[_0xb8cc('0x26')];if(_0x3510b3===0x191){_0x3510b3=0x190;}_0x16de12[_0xb8cc('0x17')](_0x3510b3)[_0xb8cc('0x6c')](_0x423cbd[_0xb8cc('0x2e')][_0xb8cc('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x51873d[_0xb8cc('0x6b')]}:_0x51873d);});}else{var _0x3b7634=0x1f4;_0x16de12['status'](_0x3b7634)[_0xb8cc('0x6c')]({'message':_0xb8cc('0x6d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7234=['path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','keys','order','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','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','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xfb830d,_0x31f0de){var _0x365bdf=function(_0x45863e){while(--_0x45863e){_0xfb830d['push'](_0xfb830d['shift']());}};_0x365bdf(++_0x31f0de);}(_0x7234,0x172));var _0x4723=function(_0x2c949f,_0x59b146){_0x2c949f=_0x2c949f-0x0;var _0x4ab1b3=_0x7234[_0x2c949f];return _0x4ab1b3;};'use strict';var emlformat=require(_0x4723('0x0'));var rimraf=require(_0x4723('0x1'));var zipdir=require(_0x4723('0x2'));var jsonpatch=require(_0x4723('0x3'));var rp=require(_0x4723('0x4'));var moment=require('moment');var BPromise=require(_0x4723('0x5'));var Mustache=require(_0x4723('0x6'));var util=require(_0x4723('0x7'));var path=require(_0x4723('0x8'));var sox=require('sox');var csv=require(_0x4723('0x9'));var ejs=require(_0x4723('0xa'));var fs=require('fs');var fs_extra=require(_0x4723('0xb'));var _=require('lodash');var squel=require(_0x4723('0xc'));var crypto=require(_0x4723('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4723('0xe'));var toCsv=require(_0x4723('0x9'));var querystring=require(_0x4723('0xf'));var Papa=require('papaparse');var Redis=require(_0x4723('0x10'));var authService=require(_0x4723('0x11'));var qs=require(_0x4723('0x12'));var as=require(_0x4723('0x13'));var hardwareService=require(_0x4723('0x14'));var logger=require(_0x4723('0x15'))(_0x4723('0x16'));var utils=require(_0x4723('0x17'));var config=require(_0x4723('0x18'));var licenseUtil=require(_0x4723('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ecc98,_0x2ab44a){_0x2ab44a=_0x2ab44a||0xcc;return function(_0x4f6ef0){if(_0x4f6ef0){return _0x4ecc98[_0x4723('0x1a')](_0x2ab44a);}return _0x4ecc98[_0x4723('0x1b')](_0x2ab44a)[_0x4723('0x1c')]();};}function respondWithResult(_0x4870a5,_0x394a8e){_0x394a8e=_0x394a8e||0xc8;return function(_0x589071){if(_0x589071){return _0x4870a5[_0x4723('0x1b')](_0x394a8e)[_0x4723('0x1d')](_0x589071);}};}function respondWithFilteredResult(_0x41d2d5,_0x4dcd71){return function(_0x1216a1){if(_0x1216a1){var _0x25fb2a=typeof _0x4dcd71[_0x4723('0x1e')]==='undefined'&&typeof _0x4dcd71[_0x4723('0x1f')]===_0x4723('0x20');var _0x51004b=_0x1216a1[_0x4723('0x21')];var _0x515648=_0x25fb2a?0x0:_0x4dcd71['offset'];var _0x4e5615=_0x25fb2a?_0x1216a1[_0x4723('0x21')]:_0x4dcd71[_0x4723('0x1e')]+_0x4dcd71[_0x4723('0x1f')];var _0x29d5c7;if(_0x4e5615>=_0x51004b){_0x4e5615=_0x51004b;_0x29d5c7=0xc8;}else{_0x29d5c7=0xce;}_0x41d2d5[_0x4723('0x1b')](_0x29d5c7);return _0x41d2d5[_0x4723('0x22')](_0x4723('0x23'),_0x515648+'-'+_0x4e5615+'/'+_0x51004b)[_0x4723('0x1d')](_0x1216a1);}return null;};}function patchUpdates(_0x2acd3f){return function(_0x5a6729){try{jsonpatch[_0x4723('0x24')](_0x5a6729,_0x2acd3f,!![]);}catch(_0x79b22d){return BPromise[_0x4723('0x25')](_0x79b22d);}return _0x5a6729[_0x4723('0x26')]();};}function saveUpdates(_0x5b2b14,_0x29356c){return function(_0x5f1c43){if(_0x5f1c43){return _0x5f1c43[_0x4723('0x27')](_0x5b2b14)[_0x4723('0x28')](function(_0x103672){return _0x103672;});}return null;};}function removeEntity(_0x52a0dc,_0x5cbd39){return function(_0x28edc6){if(_0x28edc6){return _0x28edc6[_0x4723('0x29')]()[_0x4723('0x28')](function(){_0x52a0dc[_0x4723('0x1b')](0xcc)[_0x4723('0x1c')]();});}};}function handleEntityNotFound(_0x40e8c0,_0x5e9d7e){return function(_0x44c764){if(!_0x44c764){_0x40e8c0[_0x4723('0x1a')](0x194);}return _0x44c764;};}function handleError(_0x37f281,_0x48d87a){_0x48d87a=_0x48d87a||0x1f4;return function(_0x1235bc){logger[_0x4723('0x2a')](_0x1235bc[_0x4723('0x2b')]);if(_0x1235bc[_0x4723('0x2c')]){delete _0x1235bc[_0x4723('0x2c')];}_0x37f281[_0x4723('0x1b')](_0x48d87a)[_0x4723('0x2d')](_0x1235bc);};}exports[_0x4723('0x2e')]=function(_0x2e47c0,_0x2eb0c4){var _0x44ee4d={},_0x32a2a3={},_0x2d6664={'count':0x0,'rows':[]};var _0x23f987=_[_0x4723('0x2f')](db[_0x4723('0x30')]['rawAttributes'],function(_0x77a5de){return{'name':_0x77a5de['fieldName'],'type':_0x77a5de[_0x4723('0x31')]['key']};});_0x32a2a3['model']=_[_0x4723('0x2f')](_0x23f987,_0x4723('0x2c'));_0x32a2a3[_0x4723('0x32')]=_['keys'](_0x2e47c0[_0x4723('0x32')]);_0x32a2a3[_0x4723('0x33')]=_[_0x4723('0x34')](_0x32a2a3['model'],_0x32a2a3[_0x4723('0x32')]);_0x44ee4d[_0x4723('0x35')]=_[_0x4723('0x34')](_0x32a2a3[_0x4723('0x36')],qs[_0x4723('0x37')](_0x2e47c0['query']['fields']));_0x44ee4d[_0x4723('0x35')]=_0x44ee4d[_0x4723('0x35')][_0x4723('0x38')]?_0x44ee4d[_0x4723('0x35')]:_0x32a2a3['model'];if(!_0x2e47c0[_0x4723('0x32')][_0x4723('0x39')](_0x4723('0x3a'))){_0x44ee4d[_0x4723('0x1f')]=qs[_0x4723('0x1f')](_0x2e47c0[_0x4723('0x32')][_0x4723('0x1f')]);_0x44ee4d[_0x4723('0x1e')]=qs[_0x4723('0x1e')](_0x2e47c0[_0x4723('0x32')][_0x4723('0x1e')]);}_0x44ee4d['order']=qs[_0x4723('0x3b')](_0x2e47c0[_0x4723('0x32')][_0x4723('0x3b')]);_0x44ee4d[_0x4723('0x3c')]=qs[_0x4723('0x33')](_[_0x4723('0x3d')](_0x2e47c0[_0x4723('0x32')],_0x32a2a3[_0x4723('0x33')]),_0x23f987);if(_0x2e47c0[_0x4723('0x32')]['filter']){_0x44ee4d['where']=_['merge'](_0x44ee4d[_0x4723('0x3c')],{'$or':_[_0x4723('0x2f')](_0x23f987,function(_0x34e51a){if(_0x34e51a[_0x4723('0x31')]!==_0x4723('0x3e')){var _0x568aea={};_0x568aea[_0x34e51a[_0x4723('0x2c')]]={'$like':'%'+_0x2e47c0[_0x4723('0x32')][_0x4723('0x3f')]+'%'};return _0x568aea;}})});}_0x44ee4d=_[_0x4723('0x40')]({},_0x44ee4d,_0x2e47c0['options']);var _0x53b627={'where':_0x44ee4d[_0x4723('0x3c')]};return db['SugarcrmAccount'][_0x4723('0x21')](_0x53b627)[_0x4723('0x28')](function(_0x477f3b){_0x2d6664['count']=_0x477f3b;if(_0x2e47c0[_0x4723('0x32')][_0x4723('0x41')]){_0x44ee4d[_0x4723('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x4723('0x43')](_0x44ee4d);})[_0x4723('0x28')](function(_0x262424){_0x2d6664[_0x4723('0x44')]=_0x262424;return _0x2d6664;})[_0x4723('0x28')](respondWithFilteredResult(_0x2eb0c4,_0x44ee4d))['catch'](handleError(_0x2eb0c4,null));};exports[_0x4723('0x45')]=function(_0x42be4c,_0x13bf2b){var _0x55ed20={'raw':![],'where':{'id':_0x42be4c[_0x4723('0x46')]['id']}},_0x486982={};_0x486982[_0x4723('0x36')]=_['keys'](db[_0x4723('0x30')][_0x4723('0x47')]);_0x486982[_0x4723('0x32')]=_['keys'](_0x42be4c[_0x4723('0x32')]);_0x486982[_0x4723('0x33')]=_[_0x4723('0x34')](_0x486982[_0x4723('0x36')],_0x486982[_0x4723('0x32')]);_0x55ed20[_0x4723('0x35')]=_[_0x4723('0x34')](_0x486982[_0x4723('0x36')],qs[_0x4723('0x37')](_0x42be4c[_0x4723('0x32')][_0x4723('0x37')]));_0x55ed20[_0x4723('0x35')]=_0x55ed20[_0x4723('0x35')]['length']?_0x55ed20[_0x4723('0x35')]:_0x486982[_0x4723('0x36')];if(_0x42be4c[_0x4723('0x32')][_0x4723('0x41')]){_0x55ed20[_0x4723('0x42')]=[{'all':!![]}];}_0x55ed20=_[_0x4723('0x40')]({},_0x55ed20,_0x42be4c[_0x4723('0x48')]);return db[_0x4723('0x30')][_0x4723('0x49')](_0x55ed20)[_0x4723('0x28')](handleEntityNotFound(_0x13bf2b,null))[_0x4723('0x28')](respondWithResult(_0x13bf2b,null))[_0x4723('0x4a')](handleError(_0x13bf2b,null));};exports[_0x4723('0x4b')]=function(_0x24033c,_0x15ec32){return db[_0x4723('0x30')][_0x4723('0x4b')](_0x24033c[_0x4723('0x4c')],{})['then'](respondWithResult(_0x15ec32,0xc9))[_0x4723('0x4a')](handleError(_0x15ec32,null));};exports[_0x4723('0x27')]=function(_0x464ca1,_0x1386df){if(_0x464ca1[_0x4723('0x4c')]['id']){delete _0x464ca1[_0x4723('0x4c')]['id'];}return db[_0x4723('0x30')][_0x4723('0x49')]({'where':{'id':_0x464ca1[_0x4723('0x46')]['id']}})[_0x4723('0x28')](handleEntityNotFound(_0x1386df,null))[_0x4723('0x28')](saveUpdates(_0x464ca1[_0x4723('0x4c')],null))['then'](respondWithResult(_0x1386df,null))['catch'](handleError(_0x1386df,null));};exports[_0x4723('0x29')]=function(_0x47f481,_0x5f0c52){return db[_0x4723('0x30')]['find']({'where':{'id':_0x47f481['params']['id']}})[_0x4723('0x28')](handleEntityNotFound(_0x5f0c52,null))[_0x4723('0x28')](removeEntity(_0x5f0c52,null))[_0x4723('0x4a')](handleError(_0x5f0c52,null));};exports[_0x4723('0x4d')]=function(_0x528348,_0x34f60d,_0xbc8bfa){var _0x87ab5b={};var _0x282ddc={};var _0x85c61c;var _0x588680;return db[_0x4723('0x30')][_0x4723('0x4e')]({'where':{'id':_0x528348[_0x4723('0x46')]['id']}})['then'](handleEntityNotFound(_0x34f60d,null))[_0x4723('0x28')](function(_0x512b16){if(_0x512b16){_0x85c61c=_0x512b16;_0x282ddc[_0x4723('0x36')]=_['keys'](db[_0x4723('0x4f')][_0x4723('0x47')]);_0x282ddc[_0x4723('0x32')]=_[_0x4723('0x50')](_0x528348['query']);_0x282ddc[_0x4723('0x33')]=_[_0x4723('0x34')](_0x282ddc[_0x4723('0x36')],_0x282ddc[_0x4723('0x32')]);_0x87ab5b['attributes']=_['intersection'](_0x282ddc[_0x4723('0x36')],qs['fields'](_0x528348[_0x4723('0x32')]['fields']));_0x87ab5b[_0x4723('0x35')]=_0x87ab5b['attributes'][_0x4723('0x38')]?_0x87ab5b[_0x4723('0x35')]:_0x282ddc[_0x4723('0x36')];_0x87ab5b[_0x4723('0x51')]=qs[_0x4723('0x3b')](_0x528348['query'][_0x4723('0x3b')]);_0x87ab5b[_0x4723('0x3c')]=qs[_0x4723('0x33')](_['pick'](_0x528348[_0x4723('0x32')],_0x282ddc['filters']));if(_0x528348['query'][_0x4723('0x3f')]){_0x87ab5b[_0x4723('0x3c')]=_[_0x4723('0x40')](_0x87ab5b['where'],{'$or':_['map'](_0x87ab5b[_0x4723('0x35')],function(_0x461c56){var _0x24edaf={};_0x24edaf[_0x461c56]={'$like':'%'+_0x528348[_0x4723('0x32')][_0x4723('0x3f')]+'%'};return _0x24edaf;})});}_0x87ab5b=_[_0x4723('0x40')]({},_0x87ab5b,_0x528348[_0x4723('0x48')]);return _0x85c61c[_0x4723('0x4d')](_0x87ab5b);}})[_0x4723('0x28')](function(_0x18845f){if(_0x18845f){_0x588680=_0x18845f[_0x4723('0x38')];if(!_0x528348[_0x4723('0x32')]['hasOwnProperty'](_0x4723('0x3a'))){_0x87ab5b[_0x4723('0x1f')]=qs['limit'](_0x528348[_0x4723('0x32')]['limit']);_0x87ab5b[_0x4723('0x1e')]=qs[_0x4723('0x1e')](_0x528348[_0x4723('0x32')][_0x4723('0x1e')]);}return _0x85c61c[_0x4723('0x4d')](_0x87ab5b);}})['then'](function(_0x19ba0d){if(_0x19ba0d){return _0x19ba0d?{'count':_0x588680,'rows':_0x19ba0d}:null;}})[_0x4723('0x28')](respondWithResult(_0x34f60d,null))[_0x4723('0x4a')](handleError(_0x34f60d,null));};exports[_0x4723('0x52')]=function(_0x597f30,_0x264f3d,_0x32ab6e){if(_0x597f30[_0x4723('0x4c')]['id']){delete _0x597f30[_0x4723('0x4c')]['id'];}return db[_0x4723('0x30')]['findOne']({'where':{'id':_0x597f30[_0x4723('0x46')]['id']}})[_0x4723('0x28')](handleEntityNotFound(_0x264f3d,null))[_0x4723('0x28')](function(_0x13b752){if(_0x13b752){_0x597f30[_0x4723('0x4c')][_0x4723('0x53')]=_0x13b752['id'];_0x597f30[_0x4723('0x4c')][_0x4723('0x54')]=integrations[_0x4723('0x55')](_0x597f30[_0x4723('0x4c')][_0x4723('0x56')],_0x597f30[_0x4723('0x4c')][_0x4723('0x31')]);_0x597f30[_0x4723('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x597f30['body']['channel'],_0x597f30[_0x4723('0x4c')][_0x4723('0x31')]);return db[_0x4723('0x4f')][_0x4723('0x4b')](_0x597f30[_0x4723('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x4723('0x57')],'as':_0x4723('0x58')}]});}return null;})[_0x4723('0x28')](respondWithResult(_0x264f3d,null))[_0x4723('0x4a')](handleError(_0x264f3d,null));};exports[_0x4723('0x59')]=function(_0x3a442c,_0x1d7c90,_0x58198e){var _0x5e933c='';var _0x35aa08=['id','name',_0x4723('0x5a'),_0x4723('0x5b'),_0x4723('0x5c'),_0x4723('0x5d'),_0x4723('0x5e'),_0x4723('0x5f'),_0x4723('0x60'),_0x4723('0x61'),_0x4723('0x62'),_0x4723('0x63')];return db[_0x4723('0x30')][_0x4723('0x4e')]({'where':{'id':_0x3a442c['params']['id']},'attributes':['id',_0x4723('0x64'),_0x4723('0x65'),_0x4723('0x66')]})[_0x4723('0x28')](handleEntityNotFound(_0x1d7c90,null))[_0x4723('0x28')](function(_0x535456){if(_0x535456){_0x5e933c=_0x535456[_0x4723('0x66')];var _0x34e6e7=_0x5e933c[_0x4723('0x67')](-0x1);if(_0x34e6e7==='/'){_0x5e933c=_0x5e933c[_0x4723('0x68')](0x0,_0x5e933c[_0x4723('0x69')](_0x34e6e7));}return rp({'method':_0x4723('0x6a'),'uri':util['format'](_0x4723('0x6b'),_0x5e933c,_0x4723('0x6c')),'json':!![],'form':{'method':_0x4723('0x6d'),'input_type':_0x4723('0x6e'),'response_type':_0x4723('0x6e'),'rest_data':JSON[_0x4723('0x6f')]({'user_auth':{'user_name':_0x535456[_0x4723('0x64')],'password':_0x535456[_0x4723('0x65')],'encryption':'PLAIN'},'application':_0x4723('0x70')})}});}})[_0x4723('0x28')](function(_0x3ccea1){if(_0x3ccea1&&_0x3ccea1['name']!==_0x4723('0x71')&&_0x3ccea1[_0x4723('0x2c')]!==_0x4723('0x72')){return rp({'method':'POST','uri':util[_0x4723('0x73')](_0x4723('0x6b'),_0x5e933c,_0x4723('0x6c')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x4723('0x6e'),'rest_data':JSON[_0x4723('0x6f')]({'session':_0x3ccea1['id'],'module_name':'Calls'})}})['then'](function(_0x5c2051){if(_0x5c2051){var _0x68cea2=_[_0x4723('0x74')](_0x5c2051[_0x4723('0x75')]);_[_0x4723('0x76')](_0x68cea2,function(_0x255d19){return _0x35aa08['includes'](_0x255d19[_0x4723('0x2c')]);});return{'count':_0x68cea2[_0x4723('0x38')],'rows':_[_0x4723('0x2f')](_0x68cea2,function(_0x2d773d){return{'id':_0x2d773d['name'],'name':_0x2d773d[_0x4723('0x77')],'custom':_[_0x4723('0x78')](_0x2d773d[_0x4723('0x2c')],'_c')?!![]:![],'options':_0x2d773d['options']?_[_0x4723('0x2f')](_[_0x4723('0x74')](_0x2d773d['options']),function(_0x275435){return{'name':_0x275435[_0x4723('0x79')],'value':_0x275435[_0x4723('0x2c')]};}):[]};})};}})[_0x4723('0x28')](respondWithResult(_0x1d7c90,null))[_0x4723('0x4a')](function(_0x325e88){var _0x2d3ca5=_0x3a442c[_0x4723('0x32')][_0x4723('0x7a')]?0x1f4:_0x325e88[_0x4723('0x7b')]||0x1f4;logger['error'](_0x4723('0x7c'),_0x4723('0x59'),_0x2d3ca5,JSON['stringify'](_0x325e88));delete _0x325e88[_0x4723('0x2c')];if(_0x2d3ca5===0x191){_0x2d3ca5=0x190;}_0x1d7c90[_0x4723('0x1b')](_0x2d3ca5)[_0x4723('0x2d')](_0x3a442c[_0x4723('0x32')][_0x4723('0x7a')]?{'message':_0x4723('0x7d'),'statusCode':_0x325e88[_0x4723('0x7b')]}:_0x325e88);});}else{var _0x508a41=0x1f4;_0x1d7c90['status'](_0x508a41)[_0x4723('0x2d')]({'message':_0x4723('0x7d'),'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 e7530bf..e354e2f 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 _0xb4f8=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','util'];(function(_0xc3286c,_0x5c604f){var _0x1b8cb8=function(_0x30ffca){while(--_0x30ffca){_0xc3286c['push'](_0xc3286c['shift']());}};_0x1b8cb8(++_0x5c604f);}(_0xb4f8,0x83));var _0x8b4f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb4f8[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var logger=require(_0x8b4f('0x1'))(_0x8b4f('0x2'));var moment=require(_0x8b4f('0x3'));var BPromise=require(_0x8b4f('0x4'));var rp=require(_0x8b4f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b4f('0x7'));var integrations=require(_0x8b4f('0x8'));module[_0x8b4f('0x9')]=function(_0x17e04f,_0x2eefde){return _0x17e04f['define'](_0x8b4f('0xa'),attributes,{'tableName':_0x8b4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ff=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util'];(function(_0x571f7a,_0x4d06f4){var _0x3da003=function(_0x169886){while(--_0x169886){_0x571f7a['push'](_0x571f7a['shift']());}};_0x3da003(++_0x4d06f4);}(_0x84ff,0x1ac));var _0xf84f=function(_0x44f683,_0x4160d2){_0x44f683=_0x44f683-0x0;var _0x50a883=_0x84ff[_0x44f683];return _0x50a883;};'use strict';var _=require('lodash');var util=require(_0xf84f('0x0'));var logger=require(_0xf84f('0x1'))(_0xf84f('0x2'));var moment=require(_0xf84f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf84f('0x4'));var rimraf=require(_0xf84f('0x5'));var config=require(_0xf84f('0x6'));var attributes=require(_0xf84f('0x7'));var integrations=require(_0xf84f('0x8'));module[_0xf84f('0x9')]=function(_0x58f969,_0x3f28e2){return _0x58f969[_0xf84f('0xa')](_0xf84f('0xb'),attributes,{'tableName':_0xf84f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 118930b..ef6b42a 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 _0x86b5=['request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','then','GetSugarcrmAccount','stringify','SugarcrmAccount','find','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1c9e1a,_0x22ac14){var _0x509ec9=function(_0x59eb7f){while(--_0x59eb7f){_0x1c9e1a['push'](_0x1c9e1a['shift']());}};_0x509ec9(++_0x22ac14);}(_0x86b5,0x1c9));var _0x586b=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x86b5[_0x120376];return _0x28c529;};'use strict';var _=require(_0x586b('0x0'));var util=require(_0x586b('0x1'));var moment=require('moment');var BPromise=require(_0x586b('0x2'));var rs=require(_0x586b('0x3'));var fs=require('fs');var Redis=require(_0x586b('0x4'));var db=require(_0x586b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x586b('0x6'))(_0x586b('0x7'));var config=require(_0x586b('0x8'));var jayson=require(_0x586b('0x9'));var client=jayson['client'][_0x586b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21cc17,_0x481f61,_0x2f9792){return new BPromise(function(_0x22d424,_0x2d9edc){return client[_0x586b('0xb')](_0x21cc17,_0x2f9792)['then'](function(_0x123b70){logger['info'](_0x586b('0xc'),_0x481f61,_0x586b('0xd'));logger[_0x586b('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x481f61,_0x586b('0xd'),JSON['stringify'](_0x123b70));if(_0x123b70['error']){if(_0x123b70[_0x586b('0xf')][_0x586b('0x10')]===0x1f4){logger[_0x586b('0xf')](_0x586b('0xc'),_0x481f61,_0x123b70[_0x586b('0xf')][_0x586b('0x11')]);return _0x2d9edc(_0x123b70[_0x586b('0xf')][_0x586b('0x11')]);}logger[_0x586b('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x481f61,_0x123b70['error']['message']);return _0x22d424(_0x123b70[_0x586b('0xf')]['message']);}else{logger[_0x586b('0x12')](_0x586b('0xc'),_0x481f61,_0x586b('0xd'));_0x22d424(_0x123b70[_0x586b('0x13')][_0x586b('0x11')]);}})[_0x586b('0x14')](function(_0x105b75){logger[_0x586b('0xf')](_0x586b('0xc'),_0x481f61,_0x105b75);_0x2d9edc(_0x105b75);});});}exports['GetSugarcrmAccount']=function(_0x665109){var _0x29bcbb=this;return new Promise(function(_0x2a3409,_0x5ee8a9){return db['SugarcrmAccount'][_0x586b('0x15')]({'raw':_0x665109[_0x586b('0x16')]?_0x665109[_0x586b('0x16')][_0x586b('0x17')]===undefined?!![]:![]:!![],'where':_0x665109[_0x586b('0x16')]?_0x665109[_0x586b('0x16')][_0x586b('0x18')]||null:null,'attributes':_0x665109[_0x586b('0x16')]?_0x665109['options'][_0x586b('0x19')]||null:null,'limit':_0x665109[_0x586b('0x16')]?_0x665109[_0x586b('0x16')][_0x586b('0x1a')]||null:null,'include':_0x665109['options']?_0x665109[_0x586b('0x16')]['include']?_[_0x586b('0x1b')](_0x665109[_0x586b('0x16')][_0x586b('0x1c')],function(_0x106851){return{'model':db[_0x106851[_0x586b('0x1d')]],'as':_0x106851['as'],'attributes':_0x106851[_0x586b('0x19')],'include':_0x106851[_0x586b('0x1c')]?_[_0x586b('0x1b')](_0x106851['include'],function(_0x38afe3){return{'model':db[_0x38afe3[_0x586b('0x1d')]],'as':_0x38afe3['as'],'attributes':_0x38afe3[_0x586b('0x19')],'include':_0x38afe3[_0x586b('0x1c')]?_[_0x586b('0x1b')](_0x38afe3[_0x586b('0x1c')],function(_0x3efca7){return{'model':db[_0x3efca7[_0x586b('0x1d')]],'as':_0x3efca7['as'],'attributes':_0x3efca7[_0x586b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x586b('0x1e')](function(_0x5f1e66){logger[_0x586b('0x12')](_0x586b('0x1f'),_0x665109);logger[_0x586b('0xe')](_0x586b('0x1f'),_0x665109,JSON[_0x586b('0x20')](_0x5f1e66));_0x2a3409(_0x5f1e66);})[_0x586b('0x14')](function(_0x4fad53){logger[_0x586b('0xf')](_0x586b('0x1f'),_0x4fad53[_0x586b('0x11')],_0x665109);_0x5ee8a9(_0x29bcbb[_0x586b('0xf')](0x1f4,_0x4fad53[_0x586b('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x249316){var _0x25c713=this;return new Promise(function(_0x4c2e05,_0x2c3b55){return db[_0x586b('0x21')][_0x586b('0x22')]({'raw':_0x249316[_0x586b('0x16')]?_0x249316[_0x586b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x249316[_0x586b('0x16')]?_0x249316['options'][_0x586b('0x18')]||null:null,'attributes':_0x249316[_0x586b('0x16')]?_0x249316[_0x586b('0x16')]['attributes']||null:null,'include':_0x249316[_0x586b('0x16')]?_0x249316[_0x586b('0x16')][_0x586b('0x1c')]?_[_0x586b('0x1b')](_0x249316[_0x586b('0x16')]['include'],function(_0x371179){return{'model':db[_0x371179[_0x586b('0x1d')]],'as':_0x371179['as'],'attributes':_0x371179[_0x586b('0x19')],'include':_0x371179[_0x586b('0x1c')]?_['map'](_0x371179[_0x586b('0x1c')],function(_0x23c6f4){return{'model':db[_0x23c6f4[_0x586b('0x1d')]],'as':_0x23c6f4['as'],'attributes':_0x23c6f4['attributes'],'include':_0x23c6f4[_0x586b('0x1c')]?_[_0x586b('0x1b')](_0x23c6f4[_0x586b('0x1c')],function(_0x13f7a4){return{'model':db[_0x13f7a4['model']],'as':_0x13f7a4['as'],'attributes':_0x13f7a4[_0x586b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x586b('0x1e')](function(_0x27ecdb){logger['info'](_0x586b('0x23'),_0x249316);logger[_0x586b('0xe')](_0x586b('0x23'),_0x249316,JSON['stringify'](_0x27ecdb));_0x4c2e05(_0x27ecdb);})[_0x586b('0x14')](function(_0x417688){logger[_0x586b('0xf')](_0x586b('0x23'),_0x417688['message'],_0x249316);_0x2c3b55(_0x25c713[_0x586b('0xf')](0x1f4,_0x417688[_0x586b('0x11')]));});});}; \ No newline at end of file +var _0x0274=['options','raw','attributes','limit','include','map','model','then','ShowSugarcrmAccount','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x1dfa83,_0x487279){var _0x29afa8=function(_0x544781){while(--_0x544781){_0x1dfa83['push'](_0x1dfa83['shift']());}};_0x29afa8(++_0x487279);}(_0x0274,0x1e6));var _0x4027=function(_0x28af23,_0x2875b5){_0x28af23=_0x28af23-0x0;var _0x204cf3=_0x0274[_0x28af23];return _0x204cf3;};'use strict';var _=require(_0x4027('0x0'));var util=require(_0x4027('0x1'));var moment=require('moment');var BPromise=require(_0x4027('0x2'));var rs=require(_0x4027('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4027('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4027('0x5'))(_0x4027('0x6'));var config=require(_0x4027('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4027('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18abad,_0x1ed6c0,_0x3e1b24){return new BPromise(function(_0x432b49,_0xf139e3){return client[_0x4027('0x9')](_0x18abad,_0x3e1b24)['then'](function(_0x4bb3da){logger[_0x4027('0xa')](_0x4027('0xb'),_0x1ed6c0,'request\x20sent');logger[_0x4027('0xc')](_0x4027('0xd'),_0x1ed6c0,'request\x20sent',JSON[_0x4027('0xe')](_0x4bb3da));if(_0x4bb3da[_0x4027('0xf')]){if(_0x4bb3da[_0x4027('0xf')][_0x4027('0x10')]===0x1f4){logger[_0x4027('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ed6c0,_0x4bb3da[_0x4027('0xf')][_0x4027('0x11')]);return _0xf139e3(_0x4bb3da[_0x4027('0xf')][_0x4027('0x11')]);}logger['error'](_0x4027('0xb'),_0x1ed6c0,_0x4bb3da[_0x4027('0xf')]['message']);return _0x432b49(_0x4bb3da[_0x4027('0xf')][_0x4027('0x11')]);}else{logger['info'](_0x4027('0xb'),_0x1ed6c0,_0x4027('0x12'));_0x432b49(_0x4bb3da[_0x4027('0x13')]['message']);}})[_0x4027('0x14')](function(_0x46335f){logger['error'](_0x4027('0xb'),_0x1ed6c0,_0x46335f);_0xf139e3(_0x46335f);});});}exports[_0x4027('0x15')]=function(_0x1c45ad){var _0x2a6016=this;return new Promise(function(_0x25062f,_0x17d68f){return db[_0x4027('0x16')][_0x4027('0x17')]({'raw':_0x1c45ad[_0x4027('0x18')]?_0x1c45ad['options'][_0x4027('0x19')]===undefined?!![]:![]:!![],'where':_0x1c45ad[_0x4027('0x18')]?_0x1c45ad[_0x4027('0x18')]['where']||null:null,'attributes':_0x1c45ad[_0x4027('0x18')]?_0x1c45ad[_0x4027('0x18')][_0x4027('0x1a')]||null:null,'limit':_0x1c45ad[_0x4027('0x18')]?_0x1c45ad[_0x4027('0x18')][_0x4027('0x1b')]||null:null,'include':_0x1c45ad[_0x4027('0x18')]?_0x1c45ad['options']['include']?_['map'](_0x1c45ad[_0x4027('0x18')][_0x4027('0x1c')],function(_0x40f0c1){return{'model':db[_0x40f0c1['model']],'as':_0x40f0c1['as'],'attributes':_0x40f0c1[_0x4027('0x1a')],'include':_0x40f0c1['include']?_[_0x4027('0x1d')](_0x40f0c1['include'],function(_0x6d029c){return{'model':db[_0x6d029c[_0x4027('0x1e')]],'as':_0x6d029c['as'],'attributes':_0x6d029c[_0x4027('0x1a')],'include':_0x6d029c['include']?_[_0x4027('0x1d')](_0x6d029c[_0x4027('0x1c')],function(_0xdac450){return{'model':db[_0xdac450[_0x4027('0x1e')]],'as':_0xdac450['as'],'attributes':_0xdac450['attributes']};}):[]};}):[]};}):[]:[]})[_0x4027('0x1f')](function(_0x48a4e1){logger[_0x4027('0xa')](_0x4027('0x15'),_0x1c45ad);logger[_0x4027('0xc')](_0x4027('0x15'),_0x1c45ad,JSON[_0x4027('0xe')](_0x48a4e1));_0x25062f(_0x48a4e1);})[_0x4027('0x14')](function(_0x5f13ad){logger[_0x4027('0xf')](_0x4027('0x15'),_0x5f13ad[_0x4027('0x11')],_0x1c45ad);_0x17d68f(_0x2a6016[_0x4027('0xf')](0x1f4,_0x5f13ad['message']));});});};exports[_0x4027('0x20')]=function(_0x387363){var _0x4834d9=this;return new Promise(function(_0x912b94,_0x1b9463){return db[_0x4027('0x16')]['find']({'raw':_0x387363['options']?_0x387363[_0x4027('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x387363[_0x4027('0x18')]?_0x387363['options'][_0x4027('0x21')]||null:null,'attributes':_0x387363[_0x4027('0x18')]?_0x387363['options']['attributes']||null:null,'include':_0x387363[_0x4027('0x18')]?_0x387363[_0x4027('0x18')][_0x4027('0x1c')]?_[_0x4027('0x1d')](_0x387363['options']['include'],function(_0x3d6e73){return{'model':db[_0x3d6e73[_0x4027('0x1e')]],'as':_0x3d6e73['as'],'attributes':_0x3d6e73['attributes'],'include':_0x3d6e73[_0x4027('0x1c')]?_[_0x4027('0x1d')](_0x3d6e73['include'],function(_0x14bd60){return{'model':db[_0x14bd60[_0x4027('0x1e')]],'as':_0x14bd60['as'],'attributes':_0x14bd60[_0x4027('0x1a')],'include':_0x14bd60[_0x4027('0x1c')]?_['map'](_0x14bd60[_0x4027('0x1c')],function(_0x5439a4){return{'model':db[_0x5439a4[_0x4027('0x1e')]],'as':_0x5439a4['as'],'attributes':_0x5439a4['attributes']};}):[]};}):[]};}):[]:[]})[_0x4027('0x1f')](function(_0x23edaf){logger[_0x4027('0xa')](_0x4027('0x20'),_0x387363);logger[_0x4027('0xc')](_0x4027('0x20'),_0x387363,JSON[_0x4027('0xe')](_0x23edaf));_0x912b94(_0x23edaf);})[_0x4027('0x14')](function(_0x42c6bb){logger[_0x4027('0xf')](_0x4027('0x20'),_0x42c6bb[_0x4027('0x11')],_0x387363);_0x1b9463(_0x4834d9[_0x4027('0xf')](0x1f4,_0x42c6bb[_0x4027('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a2cfdf9..dffdf87 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 _0x47a1=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x47a1,0x189));var _0x147a=function(_0x1d58a5,_0x1ffed0){_0x1d58a5=_0x1d58a5-0x0;var _0x247617=_0x47a1[_0x1d58a5];return _0x247617;};'use strict';var multer=require(_0x147a('0x0'));var util=require(_0x147a('0x1'));var path=require(_0x147a('0x2'));var timeout=require(_0x147a('0x3'));var express=require('express');var router=express[_0x147a('0x4')]();var fs_extra=require(_0x147a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x147a('0x6'));var config=require(_0x147a('0x7'));var controller=require(_0x147a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x147a('0x9')]);router[_0x147a('0xa')](_0x147a('0xb'),auth['isAuthenticated'](),controller[_0x147a('0xc')]);router[_0x147a('0xa')](_0x147a('0xd'),auth[_0x147a('0xe')](),controller[_0x147a('0xf')]);router[_0x147a('0xa')]('/:id/subjects',auth[_0x147a('0xe')](),controller['getSubjects']);router[_0x147a('0xa')](_0x147a('0x10'),auth['isAuthenticated'](),controller[_0x147a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x147a('0x12')]);router[_0x147a('0x13')](_0x147a('0xb'),auth[_0x147a('0xe')](),controller[_0x147a('0x14')]);router[_0x147a('0x15')](_0x147a('0xb'),auth[_0x147a('0xe')](),controller['destroy']);module[_0x147a('0x16')]=router; \ No newline at end of file +var _0xcedb=['get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','delete','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x223b4d,_0x15aec9){var _0x16c080=function(_0x28a44d){while(--_0x28a44d){_0x223b4d['push'](_0x223b4d['shift']());}};_0x16c080(++_0x15aec9);}(_0xcedb,0x13e));var _0xbced=function(_0x278098,_0x1ed4d6){_0x278098=_0x278098-0x0;var _0x2672b0=_0xcedb[_0x278098];return _0x2672b0;};'use strict';var multer=require('multer');var util=require(_0xbced('0x0'));var path=require(_0xbced('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbced('0x2'));var auth=require(_0xbced('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbced('0x4'));var controller=require(_0xbced('0x5'));router[_0xbced('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbced('0x6')]('/:id',auth[_0xbced('0x7')](),controller['show']);router['get'](_0xbced('0x8'),auth['isAuthenticated'](),controller['getFields']);router[_0xbced('0x6')](_0xbced('0x9'),auth[_0xbced('0x7')](),controller[_0xbced('0xa')]);router[_0xbced('0x6')]('/:id/descriptions',auth[_0xbced('0x7')](),controller[_0xbced('0xb')]);router[_0xbced('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbced('0xd')](_0xbced('0xe'),auth['isAuthenticated'](),controller[_0xbced('0xf')]);router[_0xbced('0x10')](_0xbced('0xe'),auth[_0xbced('0x7')](),controller['destroy']);module[_0xbced('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a06ecce..0101f1a 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d49=['STRING','exports'];(function(_0x5ed692,_0x5a370a){var _0x10e8cf=function(_0x48d9b4){while(--_0x48d9b4){_0x5ed692['push'](_0x5ed692['shift']());}};_0x10e8cf(++_0x5a370a);}(_0x1d49,0xf5));var _0x91d4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1d49[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x91d4('0x0')]={'name':{'type':Sequelize[_0x91d4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbadc=['STRING','exports'];(function(_0x487066,_0x1fdadd){var _0xff5f81=function(_0x568881){while(--_0x568881){_0x487066['push'](_0x487066['shift']());}};_0xff5f81(++_0x1fdadd);}(_0xbadc,0x6b));var _0xcbad=function(_0xc971a4,_0x5b381c){_0xc971a4=_0xc971a4-0x0;var _0x4ebd6b=_0xbadc[_0xc971a4];return _0x4ebd6b;};'use strict';var Sequelize=require('sequelize');module[_0xcbad('0x0')]={'name':{'type':Sequelize[_0xcbad('0x1')]},'description':{'type':Sequelize[_0xcbad('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9506dcb..f38c264 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 _0x0dfd=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','SugarcrmConfiguration','findAll','catch','params','find','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0dfd,0x124));var _0xd0df=function(_0x1ac229,_0x106584){_0x1ac229=_0x1ac229-0x0;var _0x14d2dc=_0x0dfd[_0x1ac229];return _0x14d2dc;};'use strict';var emlformat=require(_0xd0df('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0df('0x1'));var rp=require(_0xd0df('0x2'));var moment=require(_0xd0df('0x3'));var BPromise=require(_0xd0df('0x4'));var Mustache=require(_0xd0df('0x5'));var util=require(_0xd0df('0x6'));var path=require(_0xd0df('0x7'));var sox=require(_0xd0df('0x8'));var csv=require(_0xd0df('0x9'));var ejs=require(_0xd0df('0xa'));var fs=require('fs');var fs_extra=require(_0xd0df('0xb'));var _=require(_0xd0df('0xc'));var squel=require(_0xd0df('0xd'));var crypto=require('crypto');var jsforce=require(_0xd0df('0xe'));var deskjs=require(_0xd0df('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd0df('0x10'));var Papa=require(_0xd0df('0x11'));var Redis=require(_0xd0df('0x12'));var authService=require(_0xd0df('0x13'));var qs=require(_0xd0df('0x14'));var as=require(_0xd0df('0x15'));var hardwareService=require(_0xd0df('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd0df('0x17'));var config=require(_0xd0df('0x18'));var licenseUtil=require(_0xd0df('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527d2a,_0x202eda){_0x202eda=_0x202eda||0xcc;return function(_0x13f6a3){if(_0x13f6a3){return _0x527d2a['sendStatus'](_0x202eda);}return _0x527d2a[_0xd0df('0x1a')](_0x202eda)[_0xd0df('0x1b')]();};}function respondWithResult(_0x1c4179,_0x3d28c1){_0x3d28c1=_0x3d28c1||0xc8;return function(_0x1131d5){if(_0x1131d5){return _0x1c4179[_0xd0df('0x1a')](_0x3d28c1)[_0xd0df('0x1c')](_0x1131d5);}};}function respondWithFilteredResult(_0xf1d6e9,_0x2cfe99){return function(_0xe43103){if(_0xe43103){var _0x20ab2e=typeof _0x2cfe99[_0xd0df('0x1d')]===_0xd0df('0x1e')&&typeof _0x2cfe99[_0xd0df('0x1f')]===_0xd0df('0x1e');var _0x43abf8=_0xe43103[_0xd0df('0x20')];var _0xba898=_0x20ab2e?0x0:_0x2cfe99[_0xd0df('0x1d')];var _0x440b03=_0x20ab2e?_0xe43103[_0xd0df('0x20')]:_0x2cfe99['offset']+_0x2cfe99[_0xd0df('0x1f')];var _0x8f9ec1;if(_0x440b03>=_0x43abf8){_0x440b03=_0x43abf8;_0x8f9ec1=0xc8;}else{_0x8f9ec1=0xce;}_0xf1d6e9[_0xd0df('0x1a')](_0x8f9ec1);return _0xf1d6e9[_0xd0df('0x21')](_0xd0df('0x22'),_0xba898+'-'+_0x440b03+'/'+_0x43abf8)[_0xd0df('0x1c')](_0xe43103);}return null;};}function patchUpdates(_0x39f41f){return function(_0x53d185){try{jsonpatch[_0xd0df('0x23')](_0x53d185,_0x39f41f,!![]);}catch(_0x150972){return BPromise['reject'](_0x150972);}return _0x53d185[_0xd0df('0x24')]();};}function saveUpdates(_0x16d71c,_0x474f32){return function(_0x2148eb){if(_0x2148eb){return _0x2148eb[_0xd0df('0x25')](_0x16d71c)[_0xd0df('0x26')](function(_0x2182fe){return _0x2182fe;});}return null;};}function removeEntity(_0x584672,_0x3924f4){return function(_0x443b0f){if(_0x443b0f){return _0x443b0f[_0xd0df('0x27')]()[_0xd0df('0x26')](function(){_0x584672[_0xd0df('0x1a')](0xcc)[_0xd0df('0x1b')]();});}};}function handleEntityNotFound(_0x2bf984,_0x329ee7){return function(_0x105943){if(!_0x105943){_0x2bf984[_0xd0df('0x28')](0x194);}return _0x105943;};}function handleError(_0x23e59d,_0x1db9c4){_0x1db9c4=_0x1db9c4||0x1f4;return function(_0x4427e6){logger['error'](_0x4427e6['stack']);if(_0x4427e6[_0xd0df('0x29')]){delete _0x4427e6[_0xd0df('0x29')];}_0x23e59d[_0xd0df('0x1a')](_0x1db9c4)[_0xd0df('0x2a')](_0x4427e6);};}exports[_0xd0df('0x2b')]=function(_0x784e8c,_0x159c0a){var _0x398c3e={},_0x5521d3={},_0xfbdb93={'count':0x0,'rows':[]};var _0x19c63a=_[_0xd0df('0x2c')](db['SugarcrmConfiguration'][_0xd0df('0x2d')],function(_0x48401b){return{'name':_0x48401b[_0xd0df('0x2e')],'type':_0x48401b[_0xd0df('0x2f')][_0xd0df('0x30')]};});_0x5521d3[_0xd0df('0x31')]=_[_0xd0df('0x2c')](_0x19c63a,'name');_0x5521d3[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x784e8c[_0xd0df('0x32')]);_0x5521d3[_0xd0df('0x34')]=_[_0xd0df('0x35')](_0x5521d3[_0xd0df('0x31')],_0x5521d3[_0xd0df('0x32')]);_0x398c3e[_0xd0df('0x36')]=_['intersection'](_0x5521d3[_0xd0df('0x31')],qs['fields'](_0x784e8c[_0xd0df('0x32')][_0xd0df('0x37')]));_0x398c3e[_0xd0df('0x36')]=_0x398c3e['attributes'][_0xd0df('0x38')]?_0x398c3e[_0xd0df('0x36')]:_0x5521d3[_0xd0df('0x31')];if(!_0x784e8c['query']['hasOwnProperty'](_0xd0df('0x39'))){_0x398c3e[_0xd0df('0x1f')]=qs[_0xd0df('0x1f')](_0x784e8c['query']['limit']);_0x398c3e[_0xd0df('0x1d')]=qs[_0xd0df('0x1d')](_0x784e8c[_0xd0df('0x32')]['offset']);}_0x398c3e[_0xd0df('0x3a')]=qs[_0xd0df('0x3b')](_0x784e8c[_0xd0df('0x32')][_0xd0df('0x3b')]);_0x398c3e[_0xd0df('0x3c')]=qs[_0xd0df('0x34')](_[_0xd0df('0x3d')](_0x784e8c[_0xd0df('0x32')],_0x5521d3[_0xd0df('0x34')]),_0x19c63a);if(_0x784e8c[_0xd0df('0x32')][_0xd0df('0x3e')]){_0x398c3e['where']=_[_0xd0df('0x3f')](_0x398c3e[_0xd0df('0x3c')],{'$or':_['map'](_0x19c63a,function(_0x2927bd){if(_0x2927bd[_0xd0df('0x2f')]!==_0xd0df('0x40')){var _0x525ee6={};_0x525ee6[_0x2927bd[_0xd0df('0x29')]]={'$like':'%'+_0x784e8c[_0xd0df('0x32')][_0xd0df('0x3e')]+'%'};return _0x525ee6;}})});}_0x398c3e=_['merge']({},_0x398c3e,_0x784e8c[_0xd0df('0x41')]);var _0x1aced1={'where':_0x398c3e[_0xd0df('0x3c')]};return db['SugarcrmConfiguration'][_0xd0df('0x20')](_0x1aced1)[_0xd0df('0x26')](function(_0x5bd9b3){_0xfbdb93['count']=_0x5bd9b3;if(_0x784e8c[_0xd0df('0x32')][_0xd0df('0x42')]){_0x398c3e['include']=[{'all':!![]}];}return db[_0xd0df('0x43')][_0xd0df('0x44')](_0x398c3e);})[_0xd0df('0x26')](function(_0x356914){_0xfbdb93['rows']=_0x356914;return _0xfbdb93;})[_0xd0df('0x26')](respondWithFilteredResult(_0x159c0a,_0x398c3e))[_0xd0df('0x45')](handleError(_0x159c0a,null));};exports['show']=function(_0x226d0f,_0x7f3ac5){var _0x4a3851={'raw':![],'where':{'id':_0x226d0f[_0xd0df('0x46')]['id']}},_0x142f35={};_0x142f35[_0xd0df('0x31')]=_[_0xd0df('0x33')](db[_0xd0df('0x43')][_0xd0df('0x2d')]);_0x142f35[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x226d0f[_0xd0df('0x32')]);_0x142f35['filters']=_[_0xd0df('0x35')](_0x142f35['model'],_0x142f35[_0xd0df('0x32')]);_0x4a3851[_0xd0df('0x36')]=_[_0xd0df('0x35')](_0x142f35[_0xd0df('0x31')],qs[_0xd0df('0x37')](_0x226d0f[_0xd0df('0x32')][_0xd0df('0x37')]));_0x4a3851[_0xd0df('0x36')]=_0x4a3851[_0xd0df('0x36')][_0xd0df('0x38')]?_0x4a3851[_0xd0df('0x36')]:_0x142f35[_0xd0df('0x31')];if(_0x226d0f['query'][_0xd0df('0x42')]){_0x4a3851['include']=[{'all':!![]}];}_0x4a3851=_[_0xd0df('0x3f')]({},_0x4a3851,_0x226d0f['options']);return db[_0xd0df('0x43')][_0xd0df('0x47')](_0x4a3851)['then'](handleEntityNotFound(_0x7f3ac5,null))[_0xd0df('0x26')](respondWithResult(_0x7f3ac5,null))[_0xd0df('0x45')](handleError(_0x7f3ac5,null));};exports[_0xd0df('0x48')]=function(_0x656a66,_0x23b92b){return db[_0xd0df('0x43')][_0xd0df('0x48')](_0x656a66[_0xd0df('0x49')],{})['then'](respondWithResult(_0x23b92b,0xc9))[_0xd0df('0x45')](handleError(_0x23b92b,null));};exports['update']=function(_0x3f2b92,_0x4900c4){if(_0x3f2b92[_0xd0df('0x49')]['id']){delete _0x3f2b92[_0xd0df('0x49')]['id'];}return db[_0xd0df('0x43')]['find']({'where':{'id':_0x3f2b92[_0xd0df('0x46')]['id']}})['then'](handleEntityNotFound(_0x4900c4,null))[_0xd0df('0x26')](saveUpdates(_0x3f2b92['body'],null))[_0xd0df('0x26')](respondWithResult(_0x4900c4,null))[_0xd0df('0x45')](handleError(_0x4900c4,null));};exports['destroy']=function(_0x597e2f,_0x14dfd7){return db[_0xd0df('0x43')][_0xd0df('0x47')]({'where':{'id':_0x597e2f[_0xd0df('0x46')]['id']}})['then'](handleEntityNotFound(_0x14dfd7,null))[_0xd0df('0x26')](removeEntity(_0x14dfd7,null))[_0xd0df('0x45')](handleError(_0x14dfd7,null));};exports[_0xd0df('0x4a')]=function(_0x34496,_0x4814c9,_0x55def8){var _0x548e84={};var _0x29fdde={};var _0x397a50;var _0x13ec45;return db[_0xd0df('0x43')][_0xd0df('0x4b')]({'where':{'id':_0x34496[_0xd0df('0x46')]['id']}})[_0xd0df('0x26')](handleEntityNotFound(_0x4814c9,null))[_0xd0df('0x26')](function(_0x3afde1){if(_0x3afde1){_0x397a50=_0x3afde1;_0x29fdde['model']=_[_0xd0df('0x33')](db[_0xd0df('0x4c')][_0xd0df('0x2d')]);_0x29fdde[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x34496[_0xd0df('0x32')]);_0x29fdde['filters']=_[_0xd0df('0x35')](_0x29fdde['model'],_0x29fdde[_0xd0df('0x32')]);_0x548e84[_0xd0df('0x36')]=_['intersection'](_0x29fdde[_0xd0df('0x31')],qs[_0xd0df('0x37')](_0x34496[_0xd0df('0x32')][_0xd0df('0x37')]));_0x548e84['attributes']=_0x548e84[_0xd0df('0x36')][_0xd0df('0x38')]?_0x548e84[_0xd0df('0x36')]:_0x29fdde[_0xd0df('0x31')];_0x548e84[_0xd0df('0x3a')]=qs[_0xd0df('0x3b')](_0x34496[_0xd0df('0x32')][_0xd0df('0x3b')]);_0x548e84[_0xd0df('0x3c')]=qs[_0xd0df('0x34')](_[_0xd0df('0x3d')](_0x34496[_0xd0df('0x32')],_0x29fdde['filters']));if(_0x34496[_0xd0df('0x32')][_0xd0df('0x3e')]){_0x548e84[_0xd0df('0x3c')]=_[_0xd0df('0x3f')](_0x548e84[_0xd0df('0x3c')],{'$or':_[_0xd0df('0x2c')](_0x548e84[_0xd0df('0x36')],function(_0x1b6164){var _0x550060={};_0x550060[_0x1b6164]={'$like':'%'+_0x34496[_0xd0df('0x32')][_0xd0df('0x3e')]+'%'};return _0x550060;})});}_0x548e84=_[_0xd0df('0x3f')]({},_0x548e84,_0x34496['options']);return _0x397a50['getFields'](_0x548e84);}})[_0xd0df('0x26')](function(_0x4dfb6a){if(_0x4dfb6a){_0x13ec45=_0x4dfb6a['length'];if(!_0x34496[_0xd0df('0x32')][_0xd0df('0x4d')]('nolimit')){_0x548e84[_0xd0df('0x1f')]=qs[_0xd0df('0x1f')](_0x34496[_0xd0df('0x32')][_0xd0df('0x1f')]);_0x548e84[_0xd0df('0x1d')]=qs[_0xd0df('0x1d')](_0x34496['query'][_0xd0df('0x1d')]);}return _0x397a50[_0xd0df('0x4a')](_0x548e84);}})[_0xd0df('0x26')](function(_0x5e4fd6){if(_0x5e4fd6){return _0x5e4fd6?{'count':_0x13ec45,'rows':_0x5e4fd6}:null;}})[_0xd0df('0x26')](respondWithResult(_0x4814c9,null))[_0xd0df('0x45')](handleError(_0x4814c9,null));};exports[_0xd0df('0x4e')]=function(_0x5cff94,_0x3533eb,_0x9bc1f6){var _0x3ccd88={};var _0x2c00b6={};var _0xb5df5e;var _0x336096;return db['SugarcrmConfiguration'][_0xd0df('0x4b')]({'where':{'id':_0x5cff94[_0xd0df('0x46')]['id']}})[_0xd0df('0x26')](handleEntityNotFound(_0x3533eb,null))[_0xd0df('0x26')](function(_0x4dda06){if(_0x4dda06){_0xb5df5e=_0x4dda06;_0x2c00b6[_0xd0df('0x31')]=_[_0xd0df('0x33')](db[_0xd0df('0x4c')][_0xd0df('0x2d')]);_0x2c00b6[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x5cff94[_0xd0df('0x32')]);_0x2c00b6[_0xd0df('0x34')]=_[_0xd0df('0x35')](_0x2c00b6[_0xd0df('0x31')],_0x2c00b6[_0xd0df('0x32')]);_0x3ccd88[_0xd0df('0x36')]=_[_0xd0df('0x35')](_0x2c00b6[_0xd0df('0x31')],qs[_0xd0df('0x37')](_0x5cff94['query'][_0xd0df('0x37')]));_0x3ccd88[_0xd0df('0x36')]=_0x3ccd88[_0xd0df('0x36')][_0xd0df('0x38')]?_0x3ccd88[_0xd0df('0x36')]:_0x2c00b6['model'];_0x3ccd88['order']=qs[_0xd0df('0x3b')](_0x5cff94['query']['sort']);_0x3ccd88[_0xd0df('0x3c')]=qs[_0xd0df('0x34')](_['pick'](_0x5cff94[_0xd0df('0x32')],_0x2c00b6[_0xd0df('0x34')]));if(_0x5cff94['query'][_0xd0df('0x3e')]){_0x3ccd88[_0xd0df('0x3c')]=_[_0xd0df('0x3f')](_0x3ccd88[_0xd0df('0x3c')],{'$or':_['map'](_0x3ccd88[_0xd0df('0x36')],function(_0x40b897){var _0xcc0f2c={};_0xcc0f2c[_0x40b897]={'$like':'%'+_0x5cff94[_0xd0df('0x32')][_0xd0df('0x3e')]+'%'};return _0xcc0f2c;})});}_0x3ccd88=_[_0xd0df('0x3f')]({},_0x3ccd88,_0x5cff94['options']);return _0xb5df5e[_0xd0df('0x4e')](_0x3ccd88);}})[_0xd0df('0x26')](function(_0x144450){if(_0x144450){_0x336096=_0x144450['length'];if(!_0x5cff94[_0xd0df('0x32')][_0xd0df('0x4d')](_0xd0df('0x39'))){_0x3ccd88[_0xd0df('0x1f')]=qs[_0xd0df('0x1f')](_0x5cff94[_0xd0df('0x32')][_0xd0df('0x1f')]);_0x3ccd88['offset']=qs[_0xd0df('0x1d')](_0x5cff94[_0xd0df('0x32')]['offset']);}return _0xb5df5e['getSubjects'](_0x3ccd88);}})['then'](function(_0x35709b){if(_0x35709b){return _0x35709b?{'count':_0x336096,'rows':_0x35709b}:null;}})[_0xd0df('0x26')](respondWithResult(_0x3533eb,null))['catch'](handleError(_0x3533eb,null));};exports[_0xd0df('0x4f')]=function(_0x4b59d4,_0x1593d2,_0x1e9c19){var _0x9b6225={};var _0x2b39af={};var _0x48f466;var _0x554eb6;return db['SugarcrmConfiguration'][_0xd0df('0x4b')]({'where':{'id':_0x4b59d4[_0xd0df('0x46')]['id']}})[_0xd0df('0x26')](handleEntityNotFound(_0x1593d2,null))[_0xd0df('0x26')](function(_0x109436){if(_0x109436){_0x48f466=_0x109436;_0x2b39af[_0xd0df('0x31')]=_[_0xd0df('0x33')](db['SugarcrmField']['rawAttributes']);_0x2b39af[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x4b59d4[_0xd0df('0x32')]);_0x2b39af[_0xd0df('0x34')]=_['intersection'](_0x2b39af[_0xd0df('0x31')],_0x2b39af[_0xd0df('0x32')]);_0x9b6225[_0xd0df('0x36')]=_['intersection'](_0x2b39af['model'],qs['fields'](_0x4b59d4['query']['fields']));_0x9b6225['attributes']=_0x9b6225[_0xd0df('0x36')][_0xd0df('0x38')]?_0x9b6225['attributes']:_0x2b39af[_0xd0df('0x31')];_0x9b6225[_0xd0df('0x3a')]=qs[_0xd0df('0x3b')](_0x4b59d4[_0xd0df('0x32')][_0xd0df('0x3b')]);_0x9b6225[_0xd0df('0x3c')]=qs['filters'](_[_0xd0df('0x3d')](_0x4b59d4[_0xd0df('0x32')],_0x2b39af[_0xd0df('0x34')]));if(_0x4b59d4[_0xd0df('0x32')][_0xd0df('0x3e')]){_0x9b6225[_0xd0df('0x3c')]=_[_0xd0df('0x3f')](_0x9b6225[_0xd0df('0x3c')],{'$or':_['map'](_0x9b6225[_0xd0df('0x36')],function(_0xdbd6d9){var _0x4c5272={};_0x4c5272[_0xdbd6d9]={'$like':'%'+_0x4b59d4[_0xd0df('0x32')][_0xd0df('0x3e')]+'%'};return _0x4c5272;})});}_0x9b6225=_[_0xd0df('0x3f')]({},_0x9b6225,_0x4b59d4[_0xd0df('0x41')]);return _0x48f466[_0xd0df('0x4f')](_0x9b6225);}})['then'](function(_0x258da0){if(_0x258da0){_0x554eb6=_0x258da0[_0xd0df('0x38')];if(!_0x4b59d4['query'][_0xd0df('0x4d')](_0xd0df('0x39'))){_0x9b6225[_0xd0df('0x1f')]=qs['limit'](_0x4b59d4[_0xd0df('0x32')]['limit']);_0x9b6225[_0xd0df('0x1d')]=qs[_0xd0df('0x1d')](_0x4b59d4['query']['offset']);}return _0x48f466[_0xd0df('0x4f')](_0x9b6225);}})[_0xd0df('0x26')](function(_0x1c7115){if(_0x1c7115){return _0x1c7115?{'count':_0x554eb6,'rows':_0x1c7115}:null;}})[_0xd0df('0x26')](respondWithResult(_0x1593d2,null))[_0xd0df('0x45')](handleError(_0x1593d2,null));}; \ No newline at end of file +var _0x2171=['rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SugarcrmConfiguration','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','index','map'];(function(_0x3122f9,_0x562fac){var _0x38f881=function(_0x4e8b82){while(--_0x4e8b82){_0x3122f9['push'](_0x3122f9['shift']());}};_0x38f881(++_0x562fac);}(_0x2171,0xcd));var _0x1217=function(_0x1be0c0,_0x1ff6ef){_0x1be0c0=_0x1be0c0-0x0;var _0x4b8160=_0x2171[_0x1be0c0];return _0x4b8160;};'use strict';var emlformat=require(_0x1217('0x0'));var rimraf=require(_0x1217('0x1'));var zipdir=require(_0x1217('0x2'));var jsonpatch=require(_0x1217('0x3'));var rp=require(_0x1217('0x4'));var moment=require(_0x1217('0x5'));var BPromise=require(_0x1217('0x6'));var Mustache=require(_0x1217('0x7'));var util=require(_0x1217('0x8'));var path=require('path');var sox=require(_0x1217('0x9'));var csv=require(_0x1217('0xa'));var ejs=require(_0x1217('0xb'));var fs=require('fs');var fs_extra=require(_0x1217('0xc'));var _=require(_0x1217('0xd'));var squel=require(_0x1217('0xe'));var crypto=require(_0x1217('0xf'));var jsforce=require(_0x1217('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1217('0xa'));var querystring=require(_0x1217('0x11'));var Papa=require(_0x1217('0x12'));var Redis=require(_0x1217('0x13'));var authService=require(_0x1217('0x14'));var qs=require(_0x1217('0x15'));var as=require(_0x1217('0x16'));var hardwareService=require(_0x1217('0x17'));var logger=require('../../config/logger')(_0x1217('0x18'));var utils=require(_0x1217('0x19'));var config=require(_0x1217('0x1a'));var licenseUtil=require(_0x1217('0x1b'));var db=require(_0x1217('0x1c'))['db'];function respondWithStatusCode(_0x224c71,_0x577246){_0x577246=_0x577246||0xcc;return function(_0x360e16){if(_0x360e16){return _0x224c71[_0x1217('0x1d')](_0x577246);}return _0x224c71[_0x1217('0x1e')](_0x577246)[_0x1217('0x1f')]();};}function respondWithResult(_0x3843bd,_0x5ca3cb){_0x5ca3cb=_0x5ca3cb||0xc8;return function(_0x3b792d){if(_0x3b792d){return _0x3843bd['status'](_0x5ca3cb)[_0x1217('0x20')](_0x3b792d);}};}function respondWithFilteredResult(_0x5a9bd6,_0xcec0af){return function(_0x42d366){if(_0x42d366){var _0x549f35=typeof _0xcec0af[_0x1217('0x21')]===_0x1217('0x22')&&typeof _0xcec0af[_0x1217('0x23')]==='undefined';var _0x2031a5=_0x42d366[_0x1217('0x24')];var _0x1af313=_0x549f35?0x0:_0xcec0af[_0x1217('0x21')];var _0xc55ed0=_0x549f35?_0x42d366['count']:_0xcec0af[_0x1217('0x21')]+_0xcec0af[_0x1217('0x23')];var _0x2159a2;if(_0xc55ed0>=_0x2031a5){_0xc55ed0=_0x2031a5;_0x2159a2=0xc8;}else{_0x2159a2=0xce;}_0x5a9bd6[_0x1217('0x1e')](_0x2159a2);return _0x5a9bd6[_0x1217('0x25')]('Content-Range',_0x1af313+'-'+_0xc55ed0+'/'+_0x2031a5)[_0x1217('0x20')](_0x42d366);}return null;};}function patchUpdates(_0x5f41d7){return function(_0x40c5b0){try{jsonpatch['apply'](_0x40c5b0,_0x5f41d7,!![]);}catch(_0x4c7db1){return BPromise[_0x1217('0x26')](_0x4c7db1);}return _0x40c5b0[_0x1217('0x27')]();};}function saveUpdates(_0x14647e,_0x7646a9){return function(_0x375842){if(_0x375842){return _0x375842['update'](_0x14647e)[_0x1217('0x28')](function(_0x1700f5){return _0x1700f5;});}return null;};}function removeEntity(_0x3405d1,_0x1a630f){return function(_0x25200c){if(_0x25200c){return _0x25200c[_0x1217('0x29')]()[_0x1217('0x28')](function(){_0x3405d1[_0x1217('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf454,_0x56b3af){return function(_0x18ddd8){if(!_0x18ddd8){_0x2cf454[_0x1217('0x1d')](0x194);}return _0x18ddd8;};}function handleError(_0x28da4d,_0x3a9a68){_0x3a9a68=_0x3a9a68||0x1f4;return function(_0x437023){logger[_0x1217('0x2a')](_0x437023[_0x1217('0x2b')]);if(_0x437023[_0x1217('0x2c')]){delete _0x437023[_0x1217('0x2c')];}_0x28da4d[_0x1217('0x1e')](_0x3a9a68)['send'](_0x437023);};}exports[_0x1217('0x2d')]=function(_0x3c25f5,_0x202cc9){var _0x335b49={},_0x3f0499={},_0x5a3b8f={'count':0x0,'rows':[]};var _0x5d84c2=_[_0x1217('0x2e')](db['SugarcrmConfiguration'][_0x1217('0x2f')],function(_0x2ccce9){return{'name':_0x2ccce9['fieldName'],'type':_0x2ccce9[_0x1217('0x30')][_0x1217('0x31')]};});_0x3f0499['model']=_[_0x1217('0x2e')](_0x5d84c2,_0x1217('0x2c'));_0x3f0499[_0x1217('0x32')]=_[_0x1217('0x33')](_0x3c25f5[_0x1217('0x32')]);_0x3f0499['filters']=_[_0x1217('0x34')](_0x3f0499[_0x1217('0x35')],_0x3f0499[_0x1217('0x32')]);_0x335b49[_0x1217('0x36')]=_[_0x1217('0x34')](_0x3f0499['model'],qs[_0x1217('0x37')](_0x3c25f5[_0x1217('0x32')][_0x1217('0x37')]));_0x335b49[_0x1217('0x36')]=_0x335b49[_0x1217('0x36')][_0x1217('0x38')]?_0x335b49[_0x1217('0x36')]:_0x3f0499[_0x1217('0x35')];if(!_0x3c25f5[_0x1217('0x32')][_0x1217('0x39')](_0x1217('0x3a'))){_0x335b49[_0x1217('0x23')]=qs['limit'](_0x3c25f5[_0x1217('0x32')]['limit']);_0x335b49[_0x1217('0x21')]=qs[_0x1217('0x21')](_0x3c25f5[_0x1217('0x32')][_0x1217('0x21')]);}_0x335b49[_0x1217('0x3b')]=qs[_0x1217('0x3c')](_0x3c25f5[_0x1217('0x32')][_0x1217('0x3c')]);_0x335b49[_0x1217('0x3d')]=qs[_0x1217('0x3e')](_[_0x1217('0x3f')](_0x3c25f5[_0x1217('0x32')],_0x3f0499[_0x1217('0x3e')]),_0x5d84c2);if(_0x3c25f5[_0x1217('0x32')][_0x1217('0x40')]){_0x335b49[_0x1217('0x3d')]=_['merge'](_0x335b49['where'],{'$or':_[_0x1217('0x2e')](_0x5d84c2,function(_0x35a64a){if(_0x35a64a[_0x1217('0x30')]!==_0x1217('0x41')){var _0x55781e={};_0x55781e[_0x35a64a['name']]={'$like':'%'+_0x3c25f5['query'][_0x1217('0x40')]+'%'};return _0x55781e;}})});}_0x335b49=_[_0x1217('0x42')]({},_0x335b49,_0x3c25f5[_0x1217('0x43')]);var _0x4aff8b={'where':_0x335b49[_0x1217('0x3d')]};return db[_0x1217('0x44')][_0x1217('0x24')](_0x4aff8b)[_0x1217('0x28')](function(_0x50c72d){_0x5a3b8f[_0x1217('0x24')]=_0x50c72d;if(_0x3c25f5[_0x1217('0x32')]['includeAll']){_0x335b49[_0x1217('0x45')]=[{'all':!![]}];}return db[_0x1217('0x44')][_0x1217('0x46')](_0x335b49);})[_0x1217('0x28')](function(_0x1fc2cb){_0x5a3b8f[_0x1217('0x47')]=_0x1fc2cb;return _0x5a3b8f;})[_0x1217('0x28')](respondWithFilteredResult(_0x202cc9,_0x335b49))[_0x1217('0x48')](handleError(_0x202cc9,null));};exports[_0x1217('0x49')]=function(_0x41a0e5,_0x22e7fb){var _0x3cdcf0={'raw':![],'where':{'id':_0x41a0e5[_0x1217('0x4a')]['id']}},_0xb15efc={};_0xb15efc[_0x1217('0x35')]=_[_0x1217('0x33')](db['SugarcrmConfiguration'][_0x1217('0x2f')]);_0xb15efc['query']=_[_0x1217('0x33')](_0x41a0e5[_0x1217('0x32')]);_0xb15efc[_0x1217('0x3e')]=_[_0x1217('0x34')](_0xb15efc['model'],_0xb15efc[_0x1217('0x32')]);_0x3cdcf0[_0x1217('0x36')]=_[_0x1217('0x34')](_0xb15efc[_0x1217('0x35')],qs['fields'](_0x41a0e5['query'][_0x1217('0x37')]));_0x3cdcf0[_0x1217('0x36')]=_0x3cdcf0['attributes'][_0x1217('0x38')]?_0x3cdcf0[_0x1217('0x36')]:_0xb15efc[_0x1217('0x35')];if(_0x41a0e5[_0x1217('0x32')][_0x1217('0x4b')]){_0x3cdcf0['include']=[{'all':!![]}];}_0x3cdcf0=_[_0x1217('0x42')]({},_0x3cdcf0,_0x41a0e5['options']);return db[_0x1217('0x44')][_0x1217('0x4c')](_0x3cdcf0)[_0x1217('0x28')](handleEntityNotFound(_0x22e7fb,null))[_0x1217('0x28')](respondWithResult(_0x22e7fb,null))[_0x1217('0x48')](handleError(_0x22e7fb,null));};exports[_0x1217('0x4d')]=function(_0x26ada6,_0x3fbccc){return db['SugarcrmConfiguration'][_0x1217('0x4d')](_0x26ada6[_0x1217('0x4e')],{})[_0x1217('0x28')](respondWithResult(_0x3fbccc,0xc9))[_0x1217('0x48')](handleError(_0x3fbccc,null));};exports['update']=function(_0x326ee5,_0x532a9c){if(_0x326ee5['body']['id']){delete _0x326ee5[_0x1217('0x4e')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x326ee5[_0x1217('0x4a')]['id']}})[_0x1217('0x28')](handleEntityNotFound(_0x532a9c,null))[_0x1217('0x28')](saveUpdates(_0x326ee5['body'],null))[_0x1217('0x28')](respondWithResult(_0x532a9c,null))[_0x1217('0x48')](handleError(_0x532a9c,null));};exports['destroy']=function(_0x511538,_0x3f75af){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x511538[_0x1217('0x4a')]['id']}})[_0x1217('0x28')](handleEntityNotFound(_0x3f75af,null))[_0x1217('0x28')](removeEntity(_0x3f75af,null))[_0x1217('0x48')](handleError(_0x3f75af,null));};exports[_0x1217('0x4f')]=function(_0x1164f6,_0x53aeb9,_0x2d964c){var _0x3bc839={};var _0x56744c={};var _0x1eb948;var _0x5269a9;return db[_0x1217('0x44')]['findOne']({'where':{'id':_0x1164f6[_0x1217('0x4a')]['id']}})[_0x1217('0x28')](handleEntityNotFound(_0x53aeb9,null))['then'](function(_0x4fea8c){if(_0x4fea8c){_0x1eb948=_0x4fea8c;_0x56744c[_0x1217('0x35')]=_[_0x1217('0x33')](db[_0x1217('0x50')][_0x1217('0x2f')]);_0x56744c[_0x1217('0x32')]=_['keys'](_0x1164f6['query']);_0x56744c[_0x1217('0x3e')]=_[_0x1217('0x34')](_0x56744c[_0x1217('0x35')],_0x56744c[_0x1217('0x32')]);_0x3bc839[_0x1217('0x36')]=_['intersection'](_0x56744c[_0x1217('0x35')],qs[_0x1217('0x37')](_0x1164f6['query'][_0x1217('0x37')]));_0x3bc839[_0x1217('0x36')]=_0x3bc839[_0x1217('0x36')][_0x1217('0x38')]?_0x3bc839['attributes']:_0x56744c[_0x1217('0x35')];_0x3bc839[_0x1217('0x3b')]=qs[_0x1217('0x3c')](_0x1164f6[_0x1217('0x32')][_0x1217('0x3c')]);_0x3bc839[_0x1217('0x3d')]=qs[_0x1217('0x3e')](_[_0x1217('0x3f')](_0x1164f6[_0x1217('0x32')],_0x56744c[_0x1217('0x3e')]));if(_0x1164f6[_0x1217('0x32')][_0x1217('0x40')]){_0x3bc839[_0x1217('0x3d')]=_[_0x1217('0x42')](_0x3bc839[_0x1217('0x3d')],{'$or':_[_0x1217('0x2e')](_0x3bc839[_0x1217('0x36')],function(_0x2a0441){var _0x5d9b4b={};_0x5d9b4b[_0x2a0441]={'$like':'%'+_0x1164f6['query'][_0x1217('0x40')]+'%'};return _0x5d9b4b;})});}_0x3bc839=_[_0x1217('0x42')]({},_0x3bc839,_0x1164f6[_0x1217('0x43')]);return _0x1eb948[_0x1217('0x4f')](_0x3bc839);}})[_0x1217('0x28')](function(_0x141b2f){if(_0x141b2f){_0x5269a9=_0x141b2f['length'];if(!_0x1164f6[_0x1217('0x32')][_0x1217('0x39')](_0x1217('0x3a'))){_0x3bc839[_0x1217('0x23')]=qs[_0x1217('0x23')](_0x1164f6['query']['limit']);_0x3bc839['offset']=qs[_0x1217('0x21')](_0x1164f6['query'][_0x1217('0x21')]);}return _0x1eb948[_0x1217('0x4f')](_0x3bc839);}})[_0x1217('0x28')](function(_0x1318fb){if(_0x1318fb){return _0x1318fb?{'count':_0x5269a9,'rows':_0x1318fb}:null;}})[_0x1217('0x28')](respondWithResult(_0x53aeb9,null))['catch'](handleError(_0x53aeb9,null));};exports[_0x1217('0x51')]=function(_0x2183a0,_0xd1c990,_0x19de29){var _0x4431ed={};var _0x3f68bc={};var _0x4c0a94;var _0x69cfc8;return db[_0x1217('0x44')][_0x1217('0x52')]({'where':{'id':_0x2183a0[_0x1217('0x4a')]['id']}})[_0x1217('0x28')](handleEntityNotFound(_0xd1c990,null))[_0x1217('0x28')](function(_0x4dc95e){if(_0x4dc95e){_0x4c0a94=_0x4dc95e;_0x3f68bc['model']=_['keys'](db[_0x1217('0x50')][_0x1217('0x2f')]);_0x3f68bc['query']=_['keys'](_0x2183a0[_0x1217('0x32')]);_0x3f68bc[_0x1217('0x3e')]=_['intersection'](_0x3f68bc[_0x1217('0x35')],_0x3f68bc[_0x1217('0x32')]);_0x4431ed['attributes']=_[_0x1217('0x34')](_0x3f68bc[_0x1217('0x35')],qs[_0x1217('0x37')](_0x2183a0['query']['fields']));_0x4431ed[_0x1217('0x36')]=_0x4431ed[_0x1217('0x36')][_0x1217('0x38')]?_0x4431ed[_0x1217('0x36')]:_0x3f68bc[_0x1217('0x35')];_0x4431ed['order']=qs[_0x1217('0x3c')](_0x2183a0[_0x1217('0x32')][_0x1217('0x3c')]);_0x4431ed[_0x1217('0x3d')]=qs[_0x1217('0x3e')](_[_0x1217('0x3f')](_0x2183a0[_0x1217('0x32')],_0x3f68bc['filters']));if(_0x2183a0[_0x1217('0x32')]['filter']){_0x4431ed[_0x1217('0x3d')]=_[_0x1217('0x42')](_0x4431ed['where'],{'$or':_[_0x1217('0x2e')](_0x4431ed['attributes'],function(_0x52b1aa){var _0x567a56={};_0x567a56[_0x52b1aa]={'$like':'%'+_0x2183a0['query'][_0x1217('0x40')]+'%'};return _0x567a56;})});}_0x4431ed=_[_0x1217('0x42')]({},_0x4431ed,_0x2183a0[_0x1217('0x43')]);return _0x4c0a94[_0x1217('0x51')](_0x4431ed);}})[_0x1217('0x28')](function(_0x2fd37c){if(_0x2fd37c){_0x69cfc8=_0x2fd37c[_0x1217('0x38')];if(!_0x2183a0[_0x1217('0x32')][_0x1217('0x39')](_0x1217('0x3a'))){_0x4431ed[_0x1217('0x23')]=qs[_0x1217('0x23')](_0x2183a0[_0x1217('0x32')][_0x1217('0x23')]);_0x4431ed[_0x1217('0x21')]=qs[_0x1217('0x21')](_0x2183a0['query'][_0x1217('0x21')]);}return _0x4c0a94[_0x1217('0x51')](_0x4431ed);}})[_0x1217('0x28')](function(_0x4a974f){if(_0x4a974f){return _0x4a974f?{'count':_0x69cfc8,'rows':_0x4a974f}:null;}})[_0x1217('0x28')](respondWithResult(_0xd1c990,null))[_0x1217('0x48')](handleError(_0xd1c990,null));};exports[_0x1217('0x53')]=function(_0x4e5742,_0x1ca942,_0x106894){var _0x6926e3={};var _0x384330={};var _0xa6b777;var _0x8a6bc4;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4e5742['params']['id']}})['then'](handleEntityNotFound(_0x1ca942,null))[_0x1217('0x28')](function(_0x6c7f87){if(_0x6c7f87){_0xa6b777=_0x6c7f87;_0x384330[_0x1217('0x35')]=_['keys'](db['SugarcrmField'][_0x1217('0x2f')]);_0x384330['query']=_[_0x1217('0x33')](_0x4e5742[_0x1217('0x32')]);_0x384330[_0x1217('0x3e')]=_[_0x1217('0x34')](_0x384330['model'],_0x384330[_0x1217('0x32')]);_0x6926e3[_0x1217('0x36')]=_[_0x1217('0x34')](_0x384330[_0x1217('0x35')],qs[_0x1217('0x37')](_0x4e5742[_0x1217('0x32')][_0x1217('0x37')]));_0x6926e3[_0x1217('0x36')]=_0x6926e3['attributes'][_0x1217('0x38')]?_0x6926e3[_0x1217('0x36')]:_0x384330[_0x1217('0x35')];_0x6926e3['order']=qs[_0x1217('0x3c')](_0x4e5742[_0x1217('0x32')][_0x1217('0x3c')]);_0x6926e3['where']=qs[_0x1217('0x3e')](_[_0x1217('0x3f')](_0x4e5742['query'],_0x384330[_0x1217('0x3e')]));if(_0x4e5742[_0x1217('0x32')]['filter']){_0x6926e3['where']=_[_0x1217('0x42')](_0x6926e3[_0x1217('0x3d')],{'$or':_[_0x1217('0x2e')](_0x6926e3[_0x1217('0x36')],function(_0x325bda){var _0x461bd3={};_0x461bd3[_0x325bda]={'$like':'%'+_0x4e5742['query'][_0x1217('0x40')]+'%'};return _0x461bd3;})});}_0x6926e3=_[_0x1217('0x42')]({},_0x6926e3,_0x4e5742[_0x1217('0x43')]);return _0xa6b777[_0x1217('0x53')](_0x6926e3);}})[_0x1217('0x28')](function(_0xd792e2){if(_0xd792e2){_0x8a6bc4=_0xd792e2[_0x1217('0x38')];if(!_0x4e5742[_0x1217('0x32')][_0x1217('0x39')]('nolimit')){_0x6926e3['limit']=qs['limit'](_0x4e5742[_0x1217('0x32')]['limit']);_0x6926e3[_0x1217('0x21')]=qs[_0x1217('0x21')](_0x4e5742[_0x1217('0x32')][_0x1217('0x21')]);}return _0xa6b777[_0x1217('0x53')](_0x6926e3);}})[_0x1217('0x28')](function(_0x68160a){if(_0x68160a){return _0x68160a?{'count':_0x8a6bc4,'rows':_0x68160a}:null;}})[_0x1217('0x28')](respondWithResult(_0x1ca942,null))[_0x1217('0x48')](handleError(_0x1ca942,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index f934f85..81078c8 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 _0xa881=['path','exports','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b2ee1,_0x2bb4b6){var _0x282a26=function(_0x4ee7db){while(--_0x4ee7db){_0x5b2ee1['push'](_0x5b2ee1['shift']());}};_0x282a26(++_0x2bb4b6);}(_0xa881,0x1ce));var _0x1a88=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa881[_0x14add3];return _0x4a174f;};'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('request-promise');var fs=require('fs');var path=require(_0x1a88('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x1a88('0x7')]=function(_0x38d685,_0x54cc15){return _0x38d685['define']('SugarcrmConfiguration',attributes,{'tableName':_0x1a88('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7472=['exports','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intSugarcrmConfiguration.attributes'];(function(_0x425715,_0x3bbf74){var _0x2b13b8=function(_0x270bae){while(--_0x270bae){_0x425715['push'](_0x425715['shift']());}};_0x2b13b8(++_0x3bbf74);}(_0x7472,0xdf));var _0x2747=function(_0x1331b2,_0x3df22b){_0x1331b2=_0x1331b2-0x0;var _0x10f741=_0x7472[_0x1331b2];return _0x10f741;};'use strict';var _=require(_0x2747('0x0'));var util=require('util');var logger=require(_0x2747('0x1'))(_0x2747('0x2'));var moment=require(_0x2747('0x3'));var BPromise=require(_0x2747('0x4'));var rp=require(_0x2747('0x5'));var fs=require('fs');var path=require(_0x2747('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2747('0x7'));module[_0x2747('0x8')]=function(_0x1ca76f,_0x2506b9){return _0x1ca76f[_0x2747('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x2747('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8d98947..3376eaf 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 _0xb105=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x16d22b,_0x417882){var _0x41545f=function(_0x4838b5){while(--_0x4838b5){_0x16d22b['push'](_0x16d22b['shift']());}};_0x41545f(++_0x417882);}(_0xb105,0xa5));var _0x5b10=function(_0x29f2c4,_0x367c2e){_0x29f2c4=_0x29f2c4-0x0;var _0x26e4c5=_0xb105[_0x29f2c4];return _0x26e4c5;};'use strict';var _=require(_0x5b10('0x0'));var util=require(_0x5b10('0x1'));var moment=require(_0x5b10('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b10('0x3'));var fs=require('fs');var Redis=require(_0x5b10('0x4'));var db=require(_0x5b10('0x5'))['db'];var utils=require(_0x5b10('0x6'));var logger=require(_0x5b10('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b10('0x8'));var client=jayson['client'][_0x5b10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeb93bf,_0x593dd0,_0x41aa62){return new BPromise(function(_0x2a125c,_0x2d5f58){return client['request'](_0xeb93bf,_0x41aa62)[_0x5b10('0xa')](function(_0x4bb262){logger[_0x5b10('0xb')](_0x5b10('0xc'),_0x593dd0,'request\x20sent');logger['debug'](_0x5b10('0xd'),_0x593dd0,_0x5b10('0xe'),JSON[_0x5b10('0xf')](_0x4bb262));if(_0x4bb262['error']){if(_0x4bb262[_0x5b10('0x10')][_0x5b10('0x11')]===0x1f4){logger[_0x5b10('0x10')](_0x5b10('0xc'),_0x593dd0,_0x4bb262[_0x5b10('0x10')][_0x5b10('0x12')]);return _0x2d5f58(_0x4bb262['error'][_0x5b10('0x12')]);}logger[_0x5b10('0x10')](_0x5b10('0xc'),_0x593dd0,_0x4bb262[_0x5b10('0x10')][_0x5b10('0x12')]);return _0x2a125c(_0x4bb262['error']['message']);}else{logger[_0x5b10('0xb')](_0x5b10('0xc'),_0x593dd0,_0x5b10('0xe'));_0x2a125c(_0x4bb262[_0x5b10('0x13')][_0x5b10('0x12')]);}})[_0x5b10('0x14')](function(_0x448125){logger[_0x5b10('0x10')](_0x5b10('0xc'),_0x593dd0,_0x448125);_0x2d5f58(_0x448125);});});} \ No newline at end of file +var _0xe739=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xe739,0x1d0));var _0x9e73=function(_0xef281a,_0x240a1c){_0xef281a=_0xef281a-0x0;var _0x53f076=_0xe739[_0xef281a];return _0x53f076;};'use strict';var _=require(_0x9e73('0x0'));var util=require(_0x9e73('0x1'));var moment=require(_0x9e73('0x2'));var BPromise=require(_0x9e73('0x3'));var rs=require(_0x9e73('0x4'));var fs=require('fs');var Redis=require(_0x9e73('0x5'));var db=require(_0x9e73('0x6'))['db'];var utils=require(_0x9e73('0x7'));var logger=require(_0x9e73('0x8'))(_0x9e73('0x9'));var config=require(_0x9e73('0xa'));var jayson=require(_0x9e73('0xb'));var client=jayson['client'][_0x9e73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44e2e2,_0x39e27f,_0x2770ff){return new BPromise(function(_0x187652,_0x25b93){return client[_0x9e73('0xd')](_0x44e2e2,_0x2770ff)['then'](function(_0x7bbd9e){logger[_0x9e73('0xe')](_0x9e73('0xf'),_0x39e27f,_0x9e73('0x10'));logger['debug'](_0x9e73('0x11'),_0x39e27f,_0x9e73('0x10'),JSON['stringify'](_0x7bbd9e));if(_0x7bbd9e[_0x9e73('0x12')]){if(_0x7bbd9e['error']['code']===0x1f4){logger[_0x9e73('0x12')](_0x9e73('0xf'),_0x39e27f,_0x7bbd9e[_0x9e73('0x12')][_0x9e73('0x13')]);return _0x25b93(_0x7bbd9e[_0x9e73('0x12')][_0x9e73('0x13')]);}logger[_0x9e73('0x12')](_0x9e73('0xf'),_0x39e27f,_0x7bbd9e[_0x9e73('0x12')][_0x9e73('0x13')]);return _0x187652(_0x7bbd9e[_0x9e73('0x12')][_0x9e73('0x13')]);}else{logger[_0x9e73('0xe')](_0x9e73('0xf'),_0x39e27f,_0x9e73('0x10'));_0x187652(_0x7bbd9e[_0x9e73('0x14')]['message']);}})['catch'](function(_0x277eda){logger[_0x9e73('0x12')](_0x9e73('0xf'),_0x39e27f,_0x277eda);_0x25b93(_0x277eda);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 40d630a..f4a5716 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 _0xa35d=['index','show','post','create','/:id','delete','destroy','exports','multer','util','express','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0xa35d,0xda));var _0xda35=function(_0x64f829,_0x4770b3){_0x64f829=_0x64f829-0x0;var _0x4d0e50=_0xa35d[_0x64f829];return _0x4d0e50;};'use strict';var multer=require(_0xda35('0x0'));var util=require(_0xda35('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda35('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xda35('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xda35('0x4'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xda35('0x5')](),controller[_0xda35('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xda35('0x7')]);router[_0xda35('0x8')]('/',auth[_0xda35('0x5')](),controller[_0xda35('0x9')]);router['put'](_0xda35('0xa'),auth[_0xda35('0x5')](),controller['update']);router[_0xda35('0xb')](_0xda35('0xa'),auth[_0xda35('0x5')](),controller[_0xda35('0xc')]);module[_0xda35('0xd')]=router; \ No newline at end of file +var _0x8957=['delete','/:id','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x414ce0,_0x533c70){var _0x4e4694=function(_0x3f199f){while(--_0x3f199f){_0x414ce0['push'](_0x414ce0['shift']());}};_0x4e4694(++_0x533c70);}(_0x8957,0x1ac));var _0x7895=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8957[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x7895('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7895('0x1'));var express=require('express');var router=express[_0x7895('0x2')]();var fs_extra=require(_0x7895('0x3'));var auth=require(_0x7895('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7895('0x5'));var controller=require(_0x7895('0x6'));router[_0x7895('0x7')]('/',auth[_0x7895('0x8')](),controller[_0x7895('0x9')]);router[_0x7895('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7895('0xa')]);router[_0x7895('0xb')]('/',auth[_0x7895('0x8')](),controller[_0x7895('0xc')]);router[_0x7895('0xd')]('/:id',auth[_0x7895('0x8')](),controller['update']);router[_0x7895('0xe')](_0x7895('0xf'),auth[_0x7895('0x8')](),controller[_0x7895('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3e5b9d4..47854ac 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 _0x401f=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0xaba415,_0x513052){var _0x2a0c42=function(_0x5190c6){while(--_0x5190c6){_0xaba415['push'](_0xaba415['shift']());}};_0x2a0c42(++_0x513052);}(_0x401f,0x85));var _0xf401=function(_0x5093cc,_0x2d83ac){_0x5093cc=_0x5093cc-0x0;var _0x2a7c75=_0x401f[_0x5093cc];return _0x2a7c75;};'use strict';var Sequelize=require(_0xf401('0x0'));module[_0xf401('0x1')]={'type':{'type':Sequelize[_0xf401('0x2')](_0xf401('0x3'),_0xf401('0x4'),_0xf401('0x5'),_0xf401('0x6'),_0xf401('0x7')),'defaultValue':_0xf401('0x3')},'content':{'type':Sequelize[_0xf401('0x8')]},'key':{'type':Sequelize[_0xf401('0x8')]},'keyType':{'type':Sequelize[_0xf401('0x2')](_0xf401('0x3'),_0xf401('0x4'),_0xf401('0x5'))},'keyContent':{'type':Sequelize[_0xf401('0x8')]},'idField':{'type':Sequelize[_0xf401('0x8')]},'nameField':{'type':Sequelize[_0xf401('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf401('0x8')]}}; \ No newline at end of file +var _0x328a=['exports','string','variable','customVariable','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x31ff1e,_0x4e0e8b){var _0x3f5f61=function(_0x36bc6a){while(--_0x36bc6a){_0x31ff1e['push'](_0x31ff1e['shift']());}};_0x3f5f61(++_0x4e0e8b);}(_0x328a,0x97));var _0xa328=function(_0x3f3bee,_0x2750aa){_0x3f3bee=_0x3f3bee-0x0;var _0x5f1916=_0x328a[_0x3f3bee];return _0x5f1916;};'use strict';var Sequelize=require(_0xa328('0x0'));module[_0xa328('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa328('0x2'),_0xa328('0x3'),_0xa328('0x4'),'keyValue','picklist'),'defaultValue':_0xa328('0x2')},'content':{'type':Sequelize[_0xa328('0x5')]},'key':{'type':Sequelize[_0xa328('0x5')]},'keyType':{'type':Sequelize[_0xa328('0x6')](_0xa328('0x2'),_0xa328('0x3'),_0xa328('0x4'))},'keyContent':{'type':Sequelize[_0xa328('0x5')]},'idField':{'type':Sequelize[_0xa328('0x5')]},'nameField':{'type':Sequelize[_0xa328('0x5')]},'customField':{'type':Sequelize[_0xa328('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa328('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index db68a6e..d607598 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 _0x5c13=['moment','mustache','util','path','sox','to-csv','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','map','SugarcrmField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x338619,_0x22f992){var _0x330cbb=function(_0x522f8e){while(--_0x522f8e){_0x338619['push'](_0x338619['shift']());}};_0x330cbb(++_0x22f992);}(_0x5c13,0x8b));var _0x35c1=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x5c13[_0x5cc51f];return _0x315a2f;};'use strict';var emlformat=require(_0x35c1('0x0'));var rimraf=require(_0x35c1('0x1'));var zipdir=require(_0x35c1('0x2'));var jsonpatch=require(_0x35c1('0x3'));var rp=require(_0x35c1('0x4'));var moment=require(_0x35c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c1('0x6'));var util=require(_0x35c1('0x7'));var path=require(_0x35c1('0x8'));var sox=require(_0x35c1('0x9'));var csv=require(_0x35c1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35c1('0xb'));var squel=require('squel');var crypto=require(_0x35c1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35c1('0xd'));var Redis=require(_0x35c1('0xe'));var authService=require(_0x35c1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x35c1('0x10'));var hardwareService=require(_0x35c1('0x11'));var logger=require(_0x35c1('0x12'))(_0x35c1('0x13'));var utils=require(_0x35c1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35c1('0x15'))['db'];function respondWithStatusCode(_0x533f22,_0x5dfe65){_0x5dfe65=_0x5dfe65||0xcc;return function(_0x378a2e){if(_0x378a2e){return _0x533f22['sendStatus'](_0x5dfe65);}return _0x533f22[_0x35c1('0x16')](_0x5dfe65)[_0x35c1('0x17')]();};}function respondWithResult(_0x237e89,_0x3f0788){_0x3f0788=_0x3f0788||0xc8;return function(_0x270a64){if(_0x270a64){return _0x237e89[_0x35c1('0x16')](_0x3f0788)[_0x35c1('0x18')](_0x270a64);}};}function respondWithFilteredResult(_0x2e5577,_0x34038a){return function(_0x180f10){if(_0x180f10){var _0x7ce659=typeof _0x34038a['offset']===_0x35c1('0x19')&&typeof _0x34038a[_0x35c1('0x1a')]===_0x35c1('0x19');var _0x59b8d3=_0x180f10[_0x35c1('0x1b')];var _0x126db9=_0x7ce659?0x0:_0x34038a[_0x35c1('0x1c')];var _0x502e34=_0x7ce659?_0x180f10[_0x35c1('0x1b')]:_0x34038a[_0x35c1('0x1c')]+_0x34038a[_0x35c1('0x1a')];var _0x251606;if(_0x502e34>=_0x59b8d3){_0x502e34=_0x59b8d3;_0x251606=0xc8;}else{_0x251606=0xce;}_0x2e5577[_0x35c1('0x16')](_0x251606);return _0x2e5577['set']('Content-Range',_0x126db9+'-'+_0x502e34+'/'+_0x59b8d3)[_0x35c1('0x18')](_0x180f10);}return null;};}function patchUpdates(_0x2814f8){return function(_0x17f45c){try{jsonpatch[_0x35c1('0x1d')](_0x17f45c,_0x2814f8,!![]);}catch(_0x125285){return BPromise[_0x35c1('0x1e')](_0x125285);}return _0x17f45c[_0x35c1('0x1f')]();};}function saveUpdates(_0x11770c,_0xce909c){return function(_0x441e64){if(_0x441e64){return _0x441e64[_0x35c1('0x20')](_0x11770c)['then'](function(_0x5a3c02){return _0x5a3c02;});}return null;};}function removeEntity(_0x211551,_0x49ceb3){return function(_0xb8b0bd){if(_0xb8b0bd){return _0xb8b0bd[_0x35c1('0x21')]()[_0x35c1('0x22')](function(){_0x211551['status'](0xcc)[_0x35c1('0x17')]();});}};}function handleEntityNotFound(_0x568046,_0x25fd76){return function(_0x1251a7){if(!_0x1251a7){_0x568046[_0x35c1('0x23')](0x194);}return _0x1251a7;};}function handleError(_0x3a8ca3,_0x3b7eae){_0x3b7eae=_0x3b7eae||0x1f4;return function(_0x2e54c3){logger[_0x35c1('0x24')](_0x2e54c3[_0x35c1('0x25')]);if(_0x2e54c3[_0x35c1('0x26')]){delete _0x2e54c3[_0x35c1('0x26')];}_0x3a8ca3[_0x35c1('0x16')](_0x3b7eae)['send'](_0x2e54c3);};}exports[_0x35c1('0x27')]=function(_0x3499dc,_0x2634b9){var _0x5973e7={},_0x50198e={},_0x4ba602={'count':0x0,'rows':[]};var _0x484fc1=_[_0x35c1('0x28')](db[_0x35c1('0x29')]['rawAttributes'],function(_0xf2b0aa){return{'name':_0xf2b0aa[_0x35c1('0x2a')],'type':_0xf2b0aa['type'][_0x35c1('0x2b')]};});_0x50198e[_0x35c1('0x2c')]=_[_0x35c1('0x28')](_0x484fc1,_0x35c1('0x26'));_0x50198e[_0x35c1('0x2d')]=_[_0x35c1('0x2e')](_0x3499dc['query']);_0x50198e[_0x35c1('0x2f')]=_[_0x35c1('0x30')](_0x50198e['model'],_0x50198e['query']);_0x5973e7[_0x35c1('0x31')]=_[_0x35c1('0x30')](_0x50198e[_0x35c1('0x2c')],qs[_0x35c1('0x32')](_0x3499dc[_0x35c1('0x2d')][_0x35c1('0x32')]));_0x5973e7[_0x35c1('0x31')]=_0x5973e7['attributes'][_0x35c1('0x33')]?_0x5973e7[_0x35c1('0x31')]:_0x50198e[_0x35c1('0x2c')];if(!_0x3499dc[_0x35c1('0x2d')][_0x35c1('0x34')]('nolimit')){_0x5973e7[_0x35c1('0x1a')]=qs[_0x35c1('0x1a')](_0x3499dc[_0x35c1('0x2d')][_0x35c1('0x1a')]);_0x5973e7[_0x35c1('0x1c')]=qs[_0x35c1('0x1c')](_0x3499dc['query'][_0x35c1('0x1c')]);}_0x5973e7[_0x35c1('0x35')]=qs[_0x35c1('0x36')](_0x3499dc[_0x35c1('0x2d')]['sort']);_0x5973e7[_0x35c1('0x37')]=qs[_0x35c1('0x2f')](_[_0x35c1('0x38')](_0x3499dc['query'],_0x50198e['filters']),_0x484fc1);if(_0x3499dc['query']['filter']){_0x5973e7[_0x35c1('0x37')]=_[_0x35c1('0x39')](_0x5973e7['where'],{'$or':_[_0x35c1('0x28')](_0x484fc1,function(_0x42432c){if(_0x42432c[_0x35c1('0x3a')]!=='VIRTUAL'){var _0x27fbf4={};_0x27fbf4[_0x42432c[_0x35c1('0x26')]]={'$like':'%'+_0x3499dc[_0x35c1('0x2d')][_0x35c1('0x3b')]+'%'};return _0x27fbf4;}})});}_0x5973e7=_[_0x35c1('0x39')]({},_0x5973e7,_0x3499dc[_0x35c1('0x3c')]);var _0x29ab44={'where':_0x5973e7[_0x35c1('0x37')]};return db['SugarcrmField']['count'](_0x29ab44)[_0x35c1('0x22')](function(_0x3fd09e){_0x4ba602[_0x35c1('0x1b')]=_0x3fd09e;if(_0x3499dc['query'][_0x35c1('0x3d')]){_0x5973e7[_0x35c1('0x3e')]=[{'all':!![]}];}return db[_0x35c1('0x29')][_0x35c1('0x3f')](_0x5973e7);})[_0x35c1('0x22')](function(_0x5761e6){_0x4ba602[_0x35c1('0x40')]=_0x5761e6;return _0x4ba602;})['then'](respondWithFilteredResult(_0x2634b9,_0x5973e7))[_0x35c1('0x41')](handleError(_0x2634b9,null));};exports[_0x35c1('0x42')]=function(_0x19eabc,_0xdb1e3f){var _0x166b6d={'raw':!![],'where':{'id':_0x19eabc[_0x35c1('0x43')]['id']}},_0x43ca4d={};_0x43ca4d['model']=_[_0x35c1('0x2e')](db[_0x35c1('0x29')][_0x35c1('0x44')]);_0x43ca4d[_0x35c1('0x2d')]=_[_0x35c1('0x2e')](_0x19eabc[_0x35c1('0x2d')]);_0x43ca4d[_0x35c1('0x2f')]=_[_0x35c1('0x30')](_0x43ca4d[_0x35c1('0x2c')],_0x43ca4d[_0x35c1('0x2d')]);_0x166b6d['attributes']=_[_0x35c1('0x30')](_0x43ca4d[_0x35c1('0x2c')],qs['fields'](_0x19eabc[_0x35c1('0x2d')][_0x35c1('0x32')]));_0x166b6d[_0x35c1('0x31')]=_0x166b6d[_0x35c1('0x31')][_0x35c1('0x33')]?_0x166b6d[_0x35c1('0x31')]:_0x43ca4d[_0x35c1('0x2c')];if(_0x19eabc['query'][_0x35c1('0x3d')]){_0x166b6d[_0x35c1('0x3e')]=[{'all':!![]}];}_0x166b6d=_[_0x35c1('0x39')]({},_0x166b6d,_0x19eabc[_0x35c1('0x3c')]);return db[_0x35c1('0x29')]['find'](_0x166b6d)[_0x35c1('0x22')](handleEntityNotFound(_0xdb1e3f,null))[_0x35c1('0x22')](respondWithResult(_0xdb1e3f,null))['catch'](handleError(_0xdb1e3f,null));};exports[_0x35c1('0x45')]=function(_0x4e5744,_0x274504){return db[_0x35c1('0x29')]['create'](_0x4e5744[_0x35c1('0x46')],{})[_0x35c1('0x22')](respondWithResult(_0x274504,0xc9))['catch'](handleError(_0x274504,null));};exports[_0x35c1('0x20')]=function(_0x1d1f25,_0x591a51){if(_0x1d1f25['body']['id']){delete _0x1d1f25['body']['id'];}return db[_0x35c1('0x29')][_0x35c1('0x47')]({'where':{'id':_0x1d1f25[_0x35c1('0x43')]['id']}})[_0x35c1('0x22')](handleEntityNotFound(_0x591a51,null))[_0x35c1('0x22')](saveUpdates(_0x1d1f25[_0x35c1('0x46')],null))[_0x35c1('0x22')](respondWithResult(_0x591a51,null))[_0x35c1('0x41')](handleError(_0x591a51,null));};exports['destroy']=function(_0x23ccb4,_0x229e58){return db[_0x35c1('0x29')][_0x35c1('0x47')]({'where':{'id':_0x23ccb4[_0x35c1('0x43')]['id']}})[_0x35c1('0x22')](handleEntityNotFound(_0x229e58,null))[_0x35c1('0x22')](removeEntity(_0x229e58,null))[_0x35c1('0x41')](handleError(_0x229e58,null));}; \ No newline at end of file +var _0x791a=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','SugarcrmField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x3fe4b5,_0x2b167e){var _0xde0f13=function(_0x170609){while(--_0x170609){_0x3fe4b5['push'](_0x3fe4b5['shift']());}};_0xde0f13(++_0x2b167e);}(_0x791a,0x1b6));var _0xa791=function(_0x2b407d,_0x5d09f8){_0x2b407d=_0x2b407d-0x0;var _0x4f8208=_0x791a[_0x2b407d];return _0x4f8208;};'use strict';var emlformat=require(_0xa791('0x0'));var rimraf=require(_0xa791('0x1'));var zipdir=require(_0xa791('0x2'));var jsonpatch=require(_0xa791('0x3'));var rp=require(_0xa791('0x4'));var moment=require(_0xa791('0x5'));var BPromise=require(_0xa791('0x6'));var Mustache=require('mustache');var util=require(_0xa791('0x7'));var path=require(_0xa791('0x8'));var sox=require(_0xa791('0x9'));var csv=require(_0xa791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa791('0xb'));var _=require(_0xa791('0xc'));var squel=require(_0xa791('0xd'));var crypto=require(_0xa791('0xe'));var jsforce=require(_0xa791('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa791('0xa'));var querystring=require(_0xa791('0x10'));var Papa=require(_0xa791('0x11'));var Redis=require(_0xa791('0x12'));var authService=require(_0xa791('0x13'));var qs=require(_0xa791('0x14'));var as=require(_0xa791('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa791('0x16'));var utils=require(_0xa791('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa791('0x18'));var db=require(_0xa791('0x19'))['db'];function respondWithStatusCode(_0x5a21d3,_0x17c0f1){_0x17c0f1=_0x17c0f1||0xcc;return function(_0x4b6765){if(_0x4b6765){return _0x5a21d3[_0xa791('0x1a')](_0x17c0f1);}return _0x5a21d3[_0xa791('0x1b')](_0x17c0f1)['end']();};}function respondWithResult(_0x356bb2,_0x43480f){_0x43480f=_0x43480f||0xc8;return function(_0x446121){if(_0x446121){return _0x356bb2[_0xa791('0x1b')](_0x43480f)[_0xa791('0x1c')](_0x446121);}};}function respondWithFilteredResult(_0x11a058,_0x509517){return function(_0x25a158){if(_0x25a158){var _0x1b785f=typeof _0x509517[_0xa791('0x1d')]===_0xa791('0x1e')&&typeof _0x509517[_0xa791('0x1f')]===_0xa791('0x1e');var _0x47af02=_0x25a158[_0xa791('0x20')];var _0x568fd9=_0x1b785f?0x0:_0x509517[_0xa791('0x1d')];var _0x3400d5=_0x1b785f?_0x25a158['count']:_0x509517['offset']+_0x509517[_0xa791('0x1f')];var _0xce1370;if(_0x3400d5>=_0x47af02){_0x3400d5=_0x47af02;_0xce1370=0xc8;}else{_0xce1370=0xce;}_0x11a058[_0xa791('0x1b')](_0xce1370);return _0x11a058[_0xa791('0x21')](_0xa791('0x22'),_0x568fd9+'-'+_0x3400d5+'/'+_0x47af02)['json'](_0x25a158);}return null;};}function patchUpdates(_0x3b2278){return function(_0x44fb85){try{jsonpatch[_0xa791('0x23')](_0x44fb85,_0x3b2278,!![]);}catch(_0x55d7b8){return BPromise[_0xa791('0x24')](_0x55d7b8);}return _0x44fb85[_0xa791('0x25')]();};}function saveUpdates(_0x34eba7,_0xa09d18){return function(_0x5c49d0){if(_0x5c49d0){return _0x5c49d0['update'](_0x34eba7)[_0xa791('0x26')](function(_0x27e661){return _0x27e661;});}return null;};}function removeEntity(_0x576f56,_0x3c778e){return function(_0x247721){if(_0x247721){return _0x247721[_0xa791('0x27')]()[_0xa791('0x26')](function(){_0x576f56[_0xa791('0x1b')](0xcc)[_0xa791('0x28')]();});}};}function handleEntityNotFound(_0x1e777d,_0x56594f){return function(_0x335101){if(!_0x335101){_0x1e777d[_0xa791('0x1a')](0x194);}return _0x335101;};}function handleError(_0x1db830,_0x46cfd8){_0x46cfd8=_0x46cfd8||0x1f4;return function(_0xe9a6b3){logger['error'](_0xe9a6b3[_0xa791('0x29')]);if(_0xe9a6b3[_0xa791('0x2a')]){delete _0xe9a6b3[_0xa791('0x2a')];}_0x1db830[_0xa791('0x1b')](_0x46cfd8)[_0xa791('0x2b')](_0xe9a6b3);};}exports['index']=function(_0x200284,_0x39ad61){var _0x180613={},_0x32bc89={},_0x4280e4={'count':0x0,'rows':[]};var _0x313728=_['map'](db[_0xa791('0x2c')][_0xa791('0x2d')],function(_0x51aaeb){return{'name':_0x51aaeb[_0xa791('0x2e')],'type':_0x51aaeb[_0xa791('0x2f')][_0xa791('0x30')]};});_0x32bc89['model']=_[_0xa791('0x31')](_0x313728,'name');_0x32bc89[_0xa791('0x32')]=_[_0xa791('0x33')](_0x200284[_0xa791('0x32')]);_0x32bc89[_0xa791('0x34')]=_[_0xa791('0x35')](_0x32bc89[_0xa791('0x36')],_0x32bc89['query']);_0x180613[_0xa791('0x37')]=_[_0xa791('0x35')](_0x32bc89[_0xa791('0x36')],qs[_0xa791('0x38')](_0x200284[_0xa791('0x32')]['fields']));_0x180613[_0xa791('0x37')]=_0x180613[_0xa791('0x37')][_0xa791('0x39')]?_0x180613[_0xa791('0x37')]:_0x32bc89[_0xa791('0x36')];if(!_0x200284[_0xa791('0x32')]['hasOwnProperty'](_0xa791('0x3a'))){_0x180613[_0xa791('0x1f')]=qs[_0xa791('0x1f')](_0x200284['query'][_0xa791('0x1f')]);_0x180613[_0xa791('0x1d')]=qs['offset'](_0x200284['query'][_0xa791('0x1d')]);}_0x180613['order']=qs[_0xa791('0x3b')](_0x200284[_0xa791('0x32')][_0xa791('0x3b')]);_0x180613[_0xa791('0x3c')]=qs[_0xa791('0x34')](_[_0xa791('0x3d')](_0x200284[_0xa791('0x32')],_0x32bc89[_0xa791('0x34')]),_0x313728);if(_0x200284[_0xa791('0x32')][_0xa791('0x3e')]){_0x180613[_0xa791('0x3c')]=_[_0xa791('0x3f')](_0x180613[_0xa791('0x3c')],{'$or':_[_0xa791('0x31')](_0x313728,function(_0x229154){if(_0x229154[_0xa791('0x2f')]!==_0xa791('0x40')){var _0x5ab80f={};_0x5ab80f[_0x229154[_0xa791('0x2a')]]={'$like':'%'+_0x200284[_0xa791('0x32')][_0xa791('0x3e')]+'%'};return _0x5ab80f;}})});}_0x180613=_[_0xa791('0x3f')]({},_0x180613,_0x200284['options']);var _0x32943a={'where':_0x180613['where']};return db[_0xa791('0x2c')]['count'](_0x32943a)[_0xa791('0x26')](function(_0x1c8740){_0x4280e4[_0xa791('0x20')]=_0x1c8740;if(_0x200284['query'][_0xa791('0x41')]){_0x180613[_0xa791('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0xa791('0x43')](_0x180613);})[_0xa791('0x26')](function(_0x298f50){_0x4280e4['rows']=_0x298f50;return _0x4280e4;})[_0xa791('0x26')](respondWithFilteredResult(_0x39ad61,_0x180613))[_0xa791('0x44')](handleError(_0x39ad61,null));};exports['show']=function(_0x1fd455,_0x52bf7d){var _0x3142c2={'raw':!![],'where':{'id':_0x1fd455[_0xa791('0x45')]['id']}},_0xd6179b={};_0xd6179b[_0xa791('0x36')]=_['keys'](db[_0xa791('0x2c')][_0xa791('0x2d')]);_0xd6179b[_0xa791('0x32')]=_[_0xa791('0x33')](_0x1fd455[_0xa791('0x32')]);_0xd6179b[_0xa791('0x34')]=_[_0xa791('0x35')](_0xd6179b[_0xa791('0x36')],_0xd6179b[_0xa791('0x32')]);_0x3142c2[_0xa791('0x37')]=_[_0xa791('0x35')](_0xd6179b[_0xa791('0x36')],qs['fields'](_0x1fd455[_0xa791('0x32')][_0xa791('0x38')]));_0x3142c2[_0xa791('0x37')]=_0x3142c2['attributes'][_0xa791('0x39')]?_0x3142c2['attributes']:_0xd6179b[_0xa791('0x36')];if(_0x1fd455[_0xa791('0x32')][_0xa791('0x41')]){_0x3142c2[_0xa791('0x42')]=[{'all':!![]}];}_0x3142c2=_[_0xa791('0x3f')]({},_0x3142c2,_0x1fd455[_0xa791('0x46')]);return db[_0xa791('0x2c')][_0xa791('0x47')](_0x3142c2)[_0xa791('0x26')](handleEntityNotFound(_0x52bf7d,null))['then'](respondWithResult(_0x52bf7d,null))[_0xa791('0x44')](handleError(_0x52bf7d,null));};exports[_0xa791('0x48')]=function(_0x49841d,_0x5c11b4){return db[_0xa791('0x2c')]['create'](_0x49841d[_0xa791('0x49')],{})[_0xa791('0x26')](respondWithResult(_0x5c11b4,0xc9))['catch'](handleError(_0x5c11b4,null));};exports[_0xa791('0x4a')]=function(_0x5e36f3,_0x235e34){if(_0x5e36f3[_0xa791('0x49')]['id']){delete _0x5e36f3[_0xa791('0x49')]['id'];}return db[_0xa791('0x2c')][_0xa791('0x47')]({'where':{'id':_0x5e36f3[_0xa791('0x45')]['id']}})[_0xa791('0x26')](handleEntityNotFound(_0x235e34,null))[_0xa791('0x26')](saveUpdates(_0x5e36f3[_0xa791('0x49')],null))[_0xa791('0x26')](respondWithResult(_0x235e34,null))[_0xa791('0x44')](handleError(_0x235e34,null));};exports[_0xa791('0x27')]=function(_0x467b61,_0x11438e){return db[_0xa791('0x2c')][_0xa791('0x47')]({'where':{'id':_0x467b61[_0xa791('0x45')]['id']}})['then'](handleEntityNotFound(_0x11438e,null))[_0xa791('0x26')](removeEntity(_0x11438e,null))[_0xa791('0x44')](handleError(_0x11438e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 27f85fd..b5e7f6e 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 _0x7186=['SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define'];(function(_0x33cef3,_0x3e8051){var _0x318c6f=function(_0x217cfa){while(--_0x217cfa){_0x33cef3['push'](_0x33cef3['shift']());}};_0x318c6f(++_0x3e8051);}(_0x7186,0xba));var _0x6718=function(_0x4db573,_0x117f00){_0x4db573=_0x4db573-0x0;var _0x474f8f=_0x7186[_0x4db573];return _0x474f8f;};'use strict';var _=require(_0x6718('0x0'));var util=require('util');var logger=require(_0x6718('0x1'))(_0x6718('0x2'));var moment=require(_0x6718('0x3'));var BPromise=require(_0x6718('0x4'));var rp=require(_0x6718('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6718('0x6'));var config=require(_0x6718('0x7'));var attributes=require(_0x6718('0x8'));module['exports']=function(_0x4adc41,_0x28e237){return _0x4adc41[_0x6718('0x9')](_0x6718('0xa'),attributes,{'tableName':_0x6718('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x6718('0xc'),_0x6718('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b04=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x18797b,_0x2b8d5e){var _0x330a00=function(_0x1c32c0){while(--_0x1c32c0){_0x18797b['push'](_0x18797b['shift']());}};_0x330a00(++_0x2b8d5e);}(_0x0b04,0x157));var _0x40b0=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x0b04[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x40b0('0x0'));var logger=require(_0x40b0('0x1'))(_0x40b0('0x2'));var moment=require(_0x40b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x40b0('0x4'));var fs=require('fs');var path=require(_0x40b0('0x5'));var rimraf=require(_0x40b0('0x6'));var config=require(_0x40b0('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x40b0('0x8')]=function(_0x27fa44,_0x34fcd1){return _0x27fa44[_0x40b0('0x9')](_0x40b0('0xa'),attributes,{'tableName':_0x40b0('0xb'),'paranoid':![],'indexes':[{'name':_0x40b0('0xc'),'fields':[_0x40b0('0xd'),_0x40b0('0xe')],'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 34e2954..bf139cd 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 _0xe125=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x4ce71d,_0x26ad52){var _0x38ce74=function(_0x1e0f24){while(--_0x1e0f24){_0x4ce71d['push'](_0x4ce71d['shift']());}};_0x38ce74(++_0x26ad52);}(_0xe125,0x176));var _0x5e12=function(_0x43e517,_0xdeb0be){_0x43e517=_0x43e517-0x0;var _0x79ecb0=_0xe125[_0x43e517];return _0x79ecb0;};'use strict';var _=require('lodash');var util=require(_0x5e12('0x0'));var moment=require(_0x5e12('0x1'));var BPromise=require(_0x5e12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e12('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e12('0x4'));var logger=require(_0x5e12('0x5'))(_0x5e12('0x6'));var config=require(_0x5e12('0x7'));var jayson=require(_0x5e12('0x8'));var client=jayson[_0x5e12('0x9')][_0x5e12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x312253,_0x26a5d9,_0x229d19){return new BPromise(function(_0x159cde,_0xfffcd7){return client[_0x5e12('0xb')](_0x312253,_0x229d19)['then'](function(_0x39c571){logger[_0x5e12('0xc')](_0x5e12('0xd'),_0x26a5d9,_0x5e12('0xe'));logger[_0x5e12('0xf')](_0x5e12('0x10'),_0x26a5d9,_0x5e12('0xe'),JSON['stringify'](_0x39c571));if(_0x39c571['error']){if(_0x39c571[_0x5e12('0x11')]['code']===0x1f4){logger[_0x5e12('0x11')](_0x5e12('0xd'),_0x26a5d9,_0x39c571[_0x5e12('0x11')][_0x5e12('0x12')]);return _0xfffcd7(_0x39c571[_0x5e12('0x11')]['message']);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x26a5d9,_0x39c571[_0x5e12('0x11')][_0x5e12('0x12')]);return _0x159cde(_0x39c571[_0x5e12('0x11')][_0x5e12('0x12')]);}else{logger[_0x5e12('0xc')](_0x5e12('0xd'),_0x26a5d9,_0x5e12('0xe'));_0x159cde(_0x39c571[_0x5e12('0x13')][_0x5e12('0x12')]);}})[_0x5e12('0x14')](function(_0x51c1a2){logger[_0x5e12('0x11')](_0x5e12('0xd'),_0x26a5d9,_0x51c1a2);_0xfffcd7(_0x51c1a2);});});} \ No newline at end of file +var _0x2198=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2198,0x16a));var _0x8219=function(_0x279423,_0x40fad9){_0x279423=_0x279423-0x0;var _0x3af73d=_0x2198[_0x279423];return _0x3af73d;};'use strict';var _=require(_0x8219('0x0'));var util=require(_0x8219('0x1'));var moment=require(_0x8219('0x2'));var BPromise=require(_0x8219('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8219('0x4'))['db'];var utils=require(_0x8219('0x5'));var logger=require(_0x8219('0x6'))(_0x8219('0x7'));var config=require('../../config/environment');var jayson=require(_0x8219('0x8'));var client=jayson[_0x8219('0x9')][_0x8219('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcfabdc,_0x36bfdf,_0x37ffab){return new BPromise(function(_0x257c7,_0x237590){return client[_0x8219('0xb')](_0xcfabdc,_0x37ffab)[_0x8219('0xc')](function(_0x5dc073){logger[_0x8219('0xd')](_0x8219('0xe'),_0x36bfdf,_0x8219('0xf'));logger[_0x8219('0x10')](_0x8219('0x11'),_0x36bfdf,_0x8219('0xf'),JSON[_0x8219('0x12')](_0x5dc073));if(_0x5dc073['error']){if(_0x5dc073[_0x8219('0x13')][_0x8219('0x14')]===0x1f4){logger['error'](_0x8219('0xe'),_0x36bfdf,_0x5dc073[_0x8219('0x13')]['message']);return _0x237590(_0x5dc073[_0x8219('0x13')]['message']);}logger[_0x8219('0x13')](_0x8219('0xe'),_0x36bfdf,_0x5dc073[_0x8219('0x13')]['message']);return _0x257c7(_0x5dc073[_0x8219('0x13')]['message']);}else{logger[_0x8219('0xd')](_0x8219('0xe'),_0x36bfdf,_0x8219('0xf'));_0x257c7(_0x5dc073[_0x8219('0x15')]['message']);}})[_0x8219('0x16')](function(_0x25fba3){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x36bfdf,_0x25fba3);_0x237590(_0x25fba3);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a4fe68c..2d78d3f 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 _0xcd4e=['index','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xcd4e,0x187));var _0xecd4=function(_0x48341b,_0x551bfb){_0x48341b=_0x48341b-0x0;var _0x27c1d9=_0xcd4e[_0x48341b];return _0x27c1d9;};'use strict';var multer=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var path=require(_0xecd4('0x2'));var timeout=require(_0xecd4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xecd4('0x4'));var auth=require(_0xecd4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xecd4('0x6'));var controller=require('./intVtigerAccount.controller');router[_0xecd4('0x7')]('/',auth['isAuthenticated'](),controller[_0xecd4('0x8')]);router[_0xecd4('0x7')](_0xecd4('0x9'),auth[_0xecd4('0xa')](),controller[_0xecd4('0xb')]);router['get'](_0xecd4('0xc'),auth[_0xecd4('0xa')](),controller['getConfigurations']);router[_0xecd4('0x7')]('/:id/fields',auth[_0xecd4('0xa')](),controller[_0xecd4('0xd')]);router[_0xecd4('0xe')]('/',auth['isAuthenticated'](),controller[_0xecd4('0xf')]);router[_0xecd4('0xe')]('/:id/configurations',auth[_0xecd4('0xa')](),controller['addConfiguration']);router[_0xecd4('0x10')](_0xecd4('0x9'),auth[_0xecd4('0xa')](),controller[_0xecd4('0x11')]);router[_0xecd4('0x12')]('/:id',auth[_0xecd4('0xa')](),controller[_0xecd4('0x13')]);module[_0xecd4('0x14')]=router; \ No newline at end of file +var _0x0855=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','destroy','exports','multer','util'];(function(_0x20269f,_0x4655b8){var _0x4b5a3e=function(_0x47f6f9){while(--_0x47f6f9){_0x20269f['push'](_0x20269f['shift']());}};_0x4b5a3e(++_0x4655b8);}(_0x0855,0x1de));var _0x5085=function(_0x78e63b,_0x5161a4){_0x78e63b=_0x78e63b-0x0;var _0x3ca19a=_0x0855[_0x78e63b];return _0x3ca19a;};'use strict';var multer=require(_0x5085('0x0'));var util=require(_0x5085('0x1'));var path=require('path');var timeout=require(_0x5085('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5085('0x3'));var auth=require(_0x5085('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5085('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x5085('0x6')]('/',auth[_0x5085('0x7')](),controller[_0x5085('0x8')]);router[_0x5085('0x6')]('/:id',auth[_0x5085('0x7')](),controller[_0x5085('0x9')]);router[_0x5085('0x6')](_0x5085('0xa'),auth[_0x5085('0x7')](),controller[_0x5085('0xb')]);router[_0x5085('0x6')]('/:id/fields',auth[_0x5085('0x7')](),controller[_0x5085('0xc')]);router[_0x5085('0xd')]('/',auth[_0x5085('0x7')](),controller[_0x5085('0xe')]);router[_0x5085('0xd')]('/:id/configurations',auth[_0x5085('0x7')](),controller[_0x5085('0xf')]);router[_0x5085('0x10')](_0x5085('0x11'),auth[_0x5085('0x7')](),controller['update']);router['delete'](_0x5085('0x11'),auth[_0x5085('0x7')](),controller[_0x5085('0x12')]);module[_0x5085('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 474b604..244e347 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 _0x3ebd=['HelpDesk','exports','STRING'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x3ebd,0x133));var _0xd3eb=function(_0x23cc64,_0x3c22c6){_0x23cc64=_0x23cc64-0x0;var _0x3bc337=_0x3ebd[_0x23cc64];return _0x3bc337;};'use strict';var Sequelize=require('sequelize');module[_0xd3eb('0x0')]={'name':{'type':Sequelize[_0xd3eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3eb('0x1')]},'username':{'type':Sequelize[_0xd3eb('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd3eb('0x2')},'remoteUri':{'type':Sequelize[_0xd3eb('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd3eb('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2e75=['exports','STRING','HelpDesk','sequelize'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x2e75,0xc7));var _0x52e7=function(_0x52aa73,_0x4d6a67){_0x52aa73=_0x52aa73-0x0;var _0x3c1d14=_0x2e75[_0x52aa73];return _0x3c1d14;};'use strict';var Sequelize=require(_0x52e7('0x0'));module[_0x52e7('0x1')]={'name':{'type':Sequelize[_0x52e7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x52e7('0x2')]},'username':{'type':Sequelize[_0x52e7('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x52e7('0x3')},'remoteUri':{'type':Sequelize[_0x52e7('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x52e7('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6f710a1..8aa1f96 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 _0xbd72=['getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','POST','login','result','token','success','describe','sessionName','reference','owner','remove','includes','editable','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','order','sort','filters','filter','where','merge','VIRTUAL','options','VtigerAccount','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','catch','getConfigurations','findOne','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects'];(function(_0x57d867,_0x2ee50b){var _0x33d270=function(_0x43a7b5){while(--_0x43a7b5){_0x57d867['push'](_0x57d867['shift']());}};_0x33d270(++_0x2ee50b);}(_0xbd72,0x129));var _0x2bd7=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xbd72[_0x3474ac];return _0x5345ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2bd7('0x0'));var zipdir=require(_0x2bd7('0x1'));var jsonpatch=require(_0x2bd7('0x2'));var rp=require(_0x2bd7('0x3'));var moment=require(_0x2bd7('0x4'));var BPromise=require(_0x2bd7('0x5'));var Mustache=require('mustache');var util=require(_0x2bd7('0x6'));var path=require(_0x2bd7('0x7'));var sox=require(_0x2bd7('0x8'));var csv=require(_0x2bd7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bd7('0xa'));var _=require(_0x2bd7('0xb'));var squel=require(_0x2bd7('0xc'));var crypto=require(_0x2bd7('0xd'));var jsforce=require(_0x2bd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2bd7('0x9'));var querystring=require(_0x2bd7('0xf'));var Papa=require('papaparse');var Redis=require(_0x2bd7('0x10'));var authService=require(_0x2bd7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2bd7('0x12'));var hardwareService=require(_0x2bd7('0x13'));var logger=require(_0x2bd7('0x14'))('api');var utils=require(_0x2bd7('0x15'));var config=require(_0x2bd7('0x16'));var licenseUtil=require(_0x2bd7('0x17'));var db=require(_0x2bd7('0x18'))['db'];var integrations=require(_0x2bd7('0x19'));function respondWithStatusCode(_0x204be1,_0x57f3b3){_0x57f3b3=_0x57f3b3||0xcc;return function(_0x344af0){if(_0x344af0){return _0x204be1[_0x2bd7('0x1a')](_0x57f3b3);}return _0x204be1['status'](_0x57f3b3)[_0x2bd7('0x1b')]();};}function respondWithResult(_0x2bafee,_0x136212){_0x136212=_0x136212||0xc8;return function(_0x21e75b){if(_0x21e75b){return _0x2bafee['status'](_0x136212)[_0x2bd7('0x1c')](_0x21e75b);}};}function respondWithFilteredResult(_0x3c2055,_0x1ac9ba){return function(_0x37fa7b){if(_0x37fa7b){var _0x4bff14=typeof _0x1ac9ba[_0x2bd7('0x1d')]===_0x2bd7('0x1e')&&typeof _0x1ac9ba['limit']==='undefined';var _0x2eff9a=_0x37fa7b[_0x2bd7('0x1f')];var _0x335b45=_0x4bff14?0x0:_0x1ac9ba['offset'];var _0x4d3619=_0x4bff14?_0x37fa7b[_0x2bd7('0x1f')]:_0x1ac9ba[_0x2bd7('0x1d')]+_0x1ac9ba[_0x2bd7('0x20')];var _0x8e9119;if(_0x4d3619>=_0x2eff9a){_0x4d3619=_0x2eff9a;_0x8e9119=0xc8;}else{_0x8e9119=0xce;}_0x3c2055[_0x2bd7('0x21')](_0x8e9119);return _0x3c2055[_0x2bd7('0x22')](_0x2bd7('0x23'),_0x335b45+'-'+_0x4d3619+'/'+_0x2eff9a)[_0x2bd7('0x1c')](_0x37fa7b);}return null;};}function patchUpdates(_0x2e3932){return function(_0x441e83){try{jsonpatch[_0x2bd7('0x24')](_0x441e83,_0x2e3932,!![]);}catch(_0x3b103b){return BPromise[_0x2bd7('0x25')](_0x3b103b);}return _0x441e83[_0x2bd7('0x26')]();};}function saveUpdates(_0x13928d,_0x39ac4c){return function(_0x41c927){if(_0x41c927){return _0x41c927[_0x2bd7('0x27')](_0x13928d)[_0x2bd7('0x28')](function(_0x4536b5){return _0x4536b5;});}return null;};}function removeEntity(_0x5592dc,_0x322968){return function(_0x472159){if(_0x472159){return _0x472159[_0x2bd7('0x29')]()[_0x2bd7('0x28')](function(){_0x5592dc['status'](0xcc)[_0x2bd7('0x1b')]();});}};}function handleEntityNotFound(_0x514c23,_0x3983e2){return function(_0x490fd6){if(!_0x490fd6){_0x514c23[_0x2bd7('0x1a')](0x194);}return _0x490fd6;};}function handleError(_0x4e8464,_0x509c1d){_0x509c1d=_0x509c1d||0x1f4;return function(_0x3f459b){logger['error'](_0x3f459b[_0x2bd7('0x2a')]);if(_0x3f459b[_0x2bd7('0x2b')]){delete _0x3f459b['name'];}_0x4e8464[_0x2bd7('0x21')](_0x509c1d)[_0x2bd7('0x2c')](_0x3f459b);};}exports['index']=function(_0x14d424,_0x3a9354){var _0x4832ee={},_0x1cd076={},_0x101b35={'count':0x0,'rows':[]};var _0x305bd9=_[_0x2bd7('0x2d')](db['VtigerAccount']['rawAttributes'],function(_0x429ed8){return{'name':_0x429ed8[_0x2bd7('0x2e')],'type':_0x429ed8[_0x2bd7('0x2f')][_0x2bd7('0x30')]};});_0x1cd076['model']=_[_0x2bd7('0x2d')](_0x305bd9,_0x2bd7('0x2b'));_0x1cd076[_0x2bd7('0x31')]=_[_0x2bd7('0x32')](_0x14d424['query']);_0x1cd076['filters']=_[_0x2bd7('0x33')](_0x1cd076[_0x2bd7('0x34')],_0x1cd076[_0x2bd7('0x31')]);_0x4832ee['attributes']=_[_0x2bd7('0x33')](_0x1cd076[_0x2bd7('0x34')],qs[_0x2bd7('0x35')](_0x14d424['query'][_0x2bd7('0x35')]));_0x4832ee[_0x2bd7('0x36')]=_0x4832ee[_0x2bd7('0x36')]['length']?_0x4832ee['attributes']:_0x1cd076[_0x2bd7('0x34')];if(!_0x14d424['query']['hasOwnProperty']('nolimit')){_0x4832ee[_0x2bd7('0x20')]=qs[_0x2bd7('0x20')](_0x14d424[_0x2bd7('0x31')]['limit']);_0x4832ee[_0x2bd7('0x1d')]=qs[_0x2bd7('0x1d')](_0x14d424[_0x2bd7('0x31')][_0x2bd7('0x1d')]);}_0x4832ee[_0x2bd7('0x37')]=qs[_0x2bd7('0x38')](_0x14d424['query']['sort']);_0x4832ee['where']=qs[_0x2bd7('0x39')](_['pick'](_0x14d424[_0x2bd7('0x31')],_0x1cd076[_0x2bd7('0x39')]),_0x305bd9);if(_0x14d424[_0x2bd7('0x31')][_0x2bd7('0x3a')]){_0x4832ee[_0x2bd7('0x3b')]=_[_0x2bd7('0x3c')](_0x4832ee['where'],{'$or':_['map'](_0x305bd9,function(_0x14c64a){if(_0x14c64a['type']!==_0x2bd7('0x3d')){var _0x135c89={};_0x135c89[_0x14c64a[_0x2bd7('0x2b')]]={'$like':'%'+_0x14d424[_0x2bd7('0x31')][_0x2bd7('0x3a')]+'%'};return _0x135c89;}})});}_0x4832ee=_[_0x2bd7('0x3c')]({},_0x4832ee,_0x14d424[_0x2bd7('0x3e')]);var _0x399c3c={'where':_0x4832ee[_0x2bd7('0x3b')]};return db[_0x2bd7('0x3f')][_0x2bd7('0x1f')](_0x399c3c)[_0x2bd7('0x28')](function(_0x4dd505){_0x101b35[_0x2bd7('0x1f')]=_0x4dd505;if(_0x14d424[_0x2bd7('0x31')]['includeAll']){_0x4832ee[_0x2bd7('0x40')]=[{'all':!![]}];}return db['VtigerAccount'][_0x2bd7('0x41')](_0x4832ee);})[_0x2bd7('0x28')](function(_0x5c2a43){_0x101b35[_0x2bd7('0x42')]=_0x5c2a43;return _0x101b35;})[_0x2bd7('0x28')](respondWithFilteredResult(_0x3a9354,_0x4832ee))['catch'](handleError(_0x3a9354,null));};exports[_0x2bd7('0x43')]=function(_0x10fab6,_0x293817){var _0xca39e3={'raw':![],'where':{'id':_0x10fab6[_0x2bd7('0x44')]['id']}},_0xcda6d9={};_0xcda6d9['model']=_[_0x2bd7('0x32')](db[_0x2bd7('0x3f')][_0x2bd7('0x45')]);_0xcda6d9['query']=_[_0x2bd7('0x32')](_0x10fab6['query']);_0xcda6d9[_0x2bd7('0x39')]=_['intersection'](_0xcda6d9['model'],_0xcda6d9[_0x2bd7('0x31')]);_0xca39e3[_0x2bd7('0x36')]=_[_0x2bd7('0x33')](_0xcda6d9[_0x2bd7('0x34')],qs[_0x2bd7('0x35')](_0x10fab6['query'][_0x2bd7('0x35')]));_0xca39e3['attributes']=_0xca39e3['attributes'][_0x2bd7('0x46')]?_0xca39e3['attributes']:_0xcda6d9[_0x2bd7('0x34')];if(_0x10fab6[_0x2bd7('0x31')][_0x2bd7('0x47')]){_0xca39e3['include']=[{'all':!![]}];}_0xca39e3=_[_0x2bd7('0x3c')]({},_0xca39e3,_0x10fab6['options']);return db[_0x2bd7('0x3f')][_0x2bd7('0x48')](_0xca39e3)[_0x2bd7('0x28')](handleEntityNotFound(_0x293817,null))[_0x2bd7('0x28')](respondWithResult(_0x293817,null))['catch'](handleError(_0x293817,null));};exports[_0x2bd7('0x49')]=function(_0x924077,_0x126e2d){return db[_0x2bd7('0x3f')][_0x2bd7('0x49')](_0x924077['body'],{})[_0x2bd7('0x28')](respondWithResult(_0x126e2d,0xc9))['catch'](handleError(_0x126e2d,null));};exports[_0x2bd7('0x27')]=function(_0x177aee,_0x1f5edd){if(_0x177aee['body']['id']){delete _0x177aee['body']['id'];}return db[_0x2bd7('0x3f')][_0x2bd7('0x48')]({'where':{'id':_0x177aee[_0x2bd7('0x44')]['id']}})[_0x2bd7('0x28')](handleEntityNotFound(_0x1f5edd,null))[_0x2bd7('0x28')](saveUpdates(_0x177aee[_0x2bd7('0x4a')],null))[_0x2bd7('0x28')](respondWithResult(_0x1f5edd,null))[_0x2bd7('0x4b')](handleError(_0x1f5edd,null));};exports[_0x2bd7('0x29')]=function(_0x50b55d,_0x28f430){return db[_0x2bd7('0x3f')][_0x2bd7('0x48')]({'where':{'id':_0x50b55d[_0x2bd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x28f430,null))[_0x2bd7('0x28')](removeEntity(_0x28f430,null))[_0x2bd7('0x4b')](handleError(_0x28f430,null));};exports[_0x2bd7('0x4c')]=function(_0x3314af,_0x4cfc4f,_0x313236){var _0x2cf2be={};var _0x19c099={};var _0x5974ed;var _0x4b74ab;return db[_0x2bd7('0x3f')][_0x2bd7('0x4d')]({'where':{'id':_0x3314af[_0x2bd7('0x44')]['id']}})[_0x2bd7('0x28')](handleEntityNotFound(_0x4cfc4f,null))[_0x2bd7('0x28')](function(_0x2aaa26){if(_0x2aaa26){_0x5974ed=_0x2aaa26;_0x19c099[_0x2bd7('0x34')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x19c099[_0x2bd7('0x31')]=_['keys'](_0x3314af[_0x2bd7('0x31')]);_0x19c099['filters']=_['intersection'](_0x19c099['model'],_0x19c099[_0x2bd7('0x31')]);_0x2cf2be[_0x2bd7('0x36')]=_[_0x2bd7('0x33')](_0x19c099[_0x2bd7('0x34')],qs['fields'](_0x3314af['query']['fields']));_0x2cf2be[_0x2bd7('0x36')]=_0x2cf2be[_0x2bd7('0x36')]['length']?_0x2cf2be[_0x2bd7('0x36')]:_0x19c099[_0x2bd7('0x34')];_0x2cf2be[_0x2bd7('0x37')]=qs[_0x2bd7('0x38')](_0x3314af[_0x2bd7('0x31')][_0x2bd7('0x38')]);_0x2cf2be[_0x2bd7('0x3b')]=qs[_0x2bd7('0x39')](_[_0x2bd7('0x4e')](_0x3314af[_0x2bd7('0x31')],_0x19c099[_0x2bd7('0x39')]));if(_0x3314af['query'][_0x2bd7('0x3a')]){_0x2cf2be['where']=_[_0x2bd7('0x3c')](_0x2cf2be[_0x2bd7('0x3b')],{'$or':_[_0x2bd7('0x2d')](_0x2cf2be[_0x2bd7('0x36')],function(_0x21817a){var _0x50eca6={};_0x50eca6[_0x21817a]={'$like':'%'+_0x3314af[_0x2bd7('0x31')][_0x2bd7('0x3a')]+'%'};return _0x50eca6;})});}_0x2cf2be=_['merge']({},_0x2cf2be,_0x3314af['options']);return _0x5974ed[_0x2bd7('0x4c')](_0x2cf2be);}})[_0x2bd7('0x28')](function(_0x4eafca){if(_0x4eafca){_0x4b74ab=_0x4eafca[_0x2bd7('0x46')];if(!_0x3314af[_0x2bd7('0x31')][_0x2bd7('0x4f')](_0x2bd7('0x50'))){_0x2cf2be[_0x2bd7('0x20')]=qs[_0x2bd7('0x20')](_0x3314af[_0x2bd7('0x31')]['limit']);_0x2cf2be[_0x2bd7('0x1d')]=qs[_0x2bd7('0x1d')](_0x3314af[_0x2bd7('0x31')][_0x2bd7('0x1d')]);}return _0x5974ed['getConfigurations'](_0x2cf2be);}})[_0x2bd7('0x28')](function(_0x1a13b1){if(_0x1a13b1){return _0x1a13b1?{'count':_0x4b74ab,'rows':_0x1a13b1}:null;}})['then'](respondWithResult(_0x4cfc4f,null))[_0x2bd7('0x4b')](handleError(_0x4cfc4f,null));};exports[_0x2bd7('0x51')]=function(_0x3caef5,_0x4062fd,_0xeee7e1){if(_0x3caef5[_0x2bd7('0x4a')]['id']){delete _0x3caef5[_0x2bd7('0x4a')]['id'];}return db['VtigerAccount'][_0x2bd7('0x4d')]({'where':{'id':_0x3caef5[_0x2bd7('0x44')]['id']}})[_0x2bd7('0x28')](handleEntityNotFound(_0x4062fd,null))[_0x2bd7('0x28')](function(_0x278c15){if(_0x278c15){_0x3caef5[_0x2bd7('0x4a')][_0x2bd7('0x52')]=_0x278c15['id'];_0x3caef5[_0x2bd7('0x4a')][_0x2bd7('0x53')]=integrations[_0x2bd7('0x54')](_0x3caef5[_0x2bd7('0x4a')][_0x2bd7('0x55')],_0x3caef5[_0x2bd7('0x4a')][_0x2bd7('0x2f')]);_0x3caef5[_0x2bd7('0x4a')]['Descriptions']=integrations[_0x2bd7('0x56')](_0x3caef5['body'][_0x2bd7('0x55')],_0x3caef5[_0x2bd7('0x4a')][_0x2bd7('0x2f')]);return db[_0x2bd7('0x57')][_0x2bd7('0x49')](_0x3caef5[_0x2bd7('0x4a')],{'include':[{'model':db[_0x2bd7('0x58')],'as':_0x2bd7('0x53')},{'model':db[_0x2bd7('0x58')],'as':_0x2bd7('0x59')}]});}return null;})[_0x2bd7('0x28')](respondWithResult(_0x4062fd,null))['catch'](handleError(_0x4062fd,null));};var md5=require(_0x2bd7('0x5a'));exports[_0x2bd7('0x5b')]=function(_0x7a3f89,_0x25667b,_0x56b538){var _0x16d084=null;var _0x250794=null;var _0x46cac1=null;var _0x39eb0e=null;var _0x4e0ec4='';return db[_0x2bd7('0x3f')]['findOne']({'where':{'id':_0x7a3f89[_0x2bd7('0x44')]['id']},'attributes':['id',_0x2bd7('0x2b'),'username','description',_0x2bd7('0x5c'),_0x2bd7('0x5d'),_0x2bd7('0x5e'),_0x2bd7('0x5f')]})[_0x2bd7('0x28')](handleEntityNotFound(_0x25667b,null))[_0x2bd7('0x28')](function(_0x464028){if(_0x464028){_0x16d084=_0x464028['username'];_0x250794=_0x464028['accessKey'];_0x46cac1=_0x464028['moduleName'];_0x4e0ec4=_0x464028[_0x2bd7('0x5d')];var _0x224f99=_0x4e0ec4[_0x2bd7('0x60')](-0x1);if(_0x224f99==='/'){_0x4e0ec4=_0x4e0ec4[_0x2bd7('0x61')](0x0,_0x4e0ec4[_0x2bd7('0x62')](_0x224f99));}_0x39eb0e=util[_0x2bd7('0x63')](_0x2bd7('0x64'),_0x4e0ec4);var _0x334344={'method':_0x2bd7('0x65'),'uri':_0x39eb0e,'qs':{'operation':_0x2bd7('0x66'),'username':_0x464028[_0x2bd7('0x67')]},'json':!![]};return rp(_0x334344);}})[_0x2bd7('0x28')](function(_0x5c5fb1){if(_0x5c5fb1['success']){var _0x3dabd0={'method':_0x2bd7('0x68'),'uri':_0x39eb0e,'form':{'operation':_0x2bd7('0x69'),'username':_0x16d084,'accessKey':md5(_0x5c5fb1[_0x2bd7('0x6a')][_0x2bd7('0x6b')]+_0x250794)},'json':!![]};return rp(_0x3dabd0);}})[_0x2bd7('0x28')](function(_0x52c908){if(_0x52c908[_0x2bd7('0x6c')]){var _0x7c545a={'method':_0x2bd7('0x65'),'uri':_0x39eb0e,'qs':{'operation':_0x2bd7('0x6d'),'username':_0x16d084,'sessionName':_0x52c908[_0x2bd7('0x6a')][_0x2bd7('0x6e')],'elementType':_0x46cac1},'json':!![]};return rp(_0x7c545a);}})['then'](function(_0x4dff15){if(_0x4dff15[_0x2bd7('0x6c')]){var _0x53663c=['autogenerated',_0x2bd7('0x6f'),_0x2bd7('0x70')];_[_0x2bd7('0x71')](_0x4dff15[_0x2bd7('0x6a')][_0x2bd7('0x35')],function(_0x2c22f6){return _0x53663c[_0x2bd7('0x72')](_0x2c22f6[_0x2bd7('0x2f')]['name']);});_[_0x2bd7('0x71')](_0x4dff15[_0x2bd7('0x6a')][_0x2bd7('0x35')],function(_0x48ed03){return _0x48ed03[_0x2bd7('0x73')]==='false';});return{'count':_0x4dff15[_0x2bd7('0x6a')]['fields'][_0x2bd7('0x46')],'rows':_[_0x2bd7('0x2d')](_0x4dff15['result'][_0x2bd7('0x35')],function(_0x4dc0b1){return{'id':_0x4dc0b1[_0x2bd7('0x2b')],'name':_0x4dc0b1[_0x2bd7('0x74')],'custom':_[_0x2bd7('0x75')](_0x4dc0b1[_0x2bd7('0x2b')],'cf_')?!![]:![],'options':_0x4dc0b1[_0x2bd7('0x2f')][_0x2bd7('0x2b')]==='picklist'&&_0x4dc0b1[_0x2bd7('0x2f')]['picklistValues'][_0x2bd7('0x46')]>0x0?_[_0x2bd7('0x2d')](_0x4dc0b1[_0x2bd7('0x2f')][_0x2bd7('0x76')],function(_0x16f712){return{'name':_0x16f712['label'],'value':_0x16f712[_0x2bd7('0x77')]};}):[]};})};}})[_0x2bd7('0x28')](respondWithResult(_0x25667b,null))[_0x2bd7('0x4b')](function(_0x1b9f6f){console[_0x2bd7('0x78')](_0x2bd7('0x79')+_0x1b9f6f);var _0x955f84=_0x7a3f89[_0x2bd7('0x31')][_0x2bd7('0x7a')]?0x1f4:_0x1b9f6f[_0x2bd7('0x7b')]||0x1f4;logger[_0x2bd7('0x7c')](_0x2bd7('0x7d'),'getFields',_0x955f84,JSON[_0x2bd7('0x7e')](_0x1b9f6f));delete _0x1b9f6f[_0x2bd7('0x2b')];if(_0x955f84===0x191){_0x955f84=0x190;}_0x25667b['status'](_0x955f84)[_0x2bd7('0x2c')](_0x7a3f89['query'][_0x2bd7('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x1b9f6f[_0x2bd7('0x7b')]}:_0x1b9f6f);});}; \ No newline at end of file +var _0x8358=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','length','order','AccountId','channel','Descriptions','VtigerField','Subjects','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','describe','result','sessionName','owner','remove','includes','editable','false','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring'];(function(_0x1d5677,_0x342d27){var _0x274227=function(_0x5ead9c){while(--_0x5ead9c){_0x1d5677['push'](_0x1d5677['shift']());}};_0x274227(++_0x342d27);}(_0x8358,0x156));var _0x8835=function(_0x5bd4a6,_0x332ddc){_0x5bd4a6=_0x5bd4a6-0x0;var _0x16f4aa=_0x8358[_0x5bd4a6];return _0x16f4aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8835('0x0'));var rp=require(_0x8835('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8835('0x2'));var path=require(_0x8835('0x3'));var sox=require(_0x8835('0x4'));var csv=require(_0x8835('0x5'));var ejs=require(_0x8835('0x6'));var fs=require('fs');var fs_extra=require(_0x8835('0x7'));var _=require(_0x8835('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8835('0x9'));var deskjs=require(_0x8835('0xa'));var toCsv=require(_0x8835('0x5'));var querystring=require(_0x8835('0xb'));var Papa=require(_0x8835('0xc'));var Redis=require(_0x8835('0xd'));var authService=require(_0x8835('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8835('0xf'));var hardwareService=require(_0x8835('0x10'));var logger=require(_0x8835('0x11'))(_0x8835('0x12'));var utils=require(_0x8835('0x13'));var config=require(_0x8835('0x14'));var licenseUtil=require(_0x8835('0x15'));var db=require(_0x8835('0x16'))['db'];var integrations=require(_0x8835('0x17'));function respondWithStatusCode(_0x501bac,_0x1a1e07){_0x1a1e07=_0x1a1e07||0xcc;return function(_0x5ef284){if(_0x5ef284){return _0x501bac[_0x8835('0x18')](_0x1a1e07);}return _0x501bac[_0x8835('0x19')](_0x1a1e07)[_0x8835('0x1a')]();};}function respondWithResult(_0x3b6e89,_0x1c4769){_0x1c4769=_0x1c4769||0xc8;return function(_0x449152){if(_0x449152){return _0x3b6e89[_0x8835('0x19')](_0x1c4769)[_0x8835('0x1b')](_0x449152);}};}function respondWithFilteredResult(_0x1301fb,_0x6bd6fb){return function(_0x18e789){if(_0x18e789){var _0x1e353a=typeof _0x6bd6fb[_0x8835('0x1c')]===_0x8835('0x1d')&&typeof _0x6bd6fb[_0x8835('0x1e')]==='undefined';var _0x2dd4a9=_0x18e789[_0x8835('0x1f')];var _0x3ac130=_0x1e353a?0x0:_0x6bd6fb[_0x8835('0x1c')];var _0x320af2=_0x1e353a?_0x18e789['count']:_0x6bd6fb[_0x8835('0x1c')]+_0x6bd6fb['limit'];var _0x4babf1;if(_0x320af2>=_0x2dd4a9){_0x320af2=_0x2dd4a9;_0x4babf1=0xc8;}else{_0x4babf1=0xce;}_0x1301fb['status'](_0x4babf1);return _0x1301fb[_0x8835('0x20')](_0x8835('0x21'),_0x3ac130+'-'+_0x320af2+'/'+_0x2dd4a9)['json'](_0x18e789);}return null;};}function patchUpdates(_0xf258d7){return function(_0x368872){try{jsonpatch[_0x8835('0x22')](_0x368872,_0xf258d7,!![]);}catch(_0x3105fc){return BPromise[_0x8835('0x23')](_0x3105fc);}return _0x368872['save']();};}function saveUpdates(_0x47b144,_0xadd981){return function(_0x5d6c37){if(_0x5d6c37){return _0x5d6c37[_0x8835('0x24')](_0x47b144)[_0x8835('0x25')](function(_0x1767c8){return _0x1767c8;});}return null;};}function removeEntity(_0x1df638,_0x55b048){return function(_0x1669bb){if(_0x1669bb){return _0x1669bb[_0x8835('0x26')]()['then'](function(){_0x1df638[_0x8835('0x19')](0xcc)[_0x8835('0x1a')]();});}};}function handleEntityNotFound(_0x12a72d,_0x363df4){return function(_0x63e2a9){if(!_0x63e2a9){_0x12a72d[_0x8835('0x18')](0x194);}return _0x63e2a9;};}function handleError(_0xdc49b2,_0x2de9ce){_0x2de9ce=_0x2de9ce||0x1f4;return function(_0x286170){logger[_0x8835('0x27')](_0x286170[_0x8835('0x28')]);if(_0x286170[_0x8835('0x29')]){delete _0x286170[_0x8835('0x29')];}_0xdc49b2['status'](_0x2de9ce)['send'](_0x286170);};}exports[_0x8835('0x2a')]=function(_0x357425,_0x60b67e){var _0x458216={},_0x2e7324={},_0x95a5a9={'count':0x0,'rows':[]};var _0x588b86=_['map'](db[_0x8835('0x2b')][_0x8835('0x2c')],function(_0x9a488f){return{'name':_0x9a488f[_0x8835('0x2d')],'type':_0x9a488f[_0x8835('0x2e')][_0x8835('0x2f')]};});_0x2e7324[_0x8835('0x30')]=_[_0x8835('0x31')](_0x588b86,_0x8835('0x29'));_0x2e7324['query']=_[_0x8835('0x32')](_0x357425[_0x8835('0x33')]);_0x2e7324[_0x8835('0x34')]=_['intersection'](_0x2e7324['model'],_0x2e7324[_0x8835('0x33')]);_0x458216['attributes']=_[_0x8835('0x35')](_0x2e7324['model'],qs[_0x8835('0x36')](_0x357425[_0x8835('0x33')][_0x8835('0x36')]));_0x458216[_0x8835('0x37')]=_0x458216[_0x8835('0x37')]['length']?_0x458216['attributes']:_0x2e7324[_0x8835('0x30')];if(!_0x357425[_0x8835('0x33')][_0x8835('0x38')](_0x8835('0x39'))){_0x458216['limit']=qs[_0x8835('0x1e')](_0x357425[_0x8835('0x33')][_0x8835('0x1e')]);_0x458216[_0x8835('0x1c')]=qs[_0x8835('0x1c')](_0x357425[_0x8835('0x33')]['offset']);}_0x458216['order']=qs[_0x8835('0x3a')](_0x357425[_0x8835('0x33')][_0x8835('0x3a')]);_0x458216['where']=qs['filters'](_[_0x8835('0x3b')](_0x357425[_0x8835('0x33')],_0x2e7324[_0x8835('0x34')]),_0x588b86);if(_0x357425[_0x8835('0x33')]['filter']){_0x458216[_0x8835('0x3c')]=_[_0x8835('0x3d')](_0x458216[_0x8835('0x3c')],{'$or':_['map'](_0x588b86,function(_0x27d012){if(_0x27d012['type']!=='VIRTUAL'){var _0x42b6c5={};_0x42b6c5[_0x27d012['name']]={'$like':'%'+_0x357425[_0x8835('0x33')][_0x8835('0x3e')]+'%'};return _0x42b6c5;}})});}_0x458216=_['merge']({},_0x458216,_0x357425[_0x8835('0x3f')]);var _0x52529f={'where':_0x458216[_0x8835('0x3c')]};return db[_0x8835('0x2b')][_0x8835('0x1f')](_0x52529f)[_0x8835('0x25')](function(_0x260740){_0x95a5a9['count']=_0x260740;if(_0x357425['query'][_0x8835('0x40')]){_0x458216[_0x8835('0x41')]=[{'all':!![]}];}return db[_0x8835('0x2b')][_0x8835('0x42')](_0x458216);})[_0x8835('0x25')](function(_0x1a2183){_0x95a5a9['rows']=_0x1a2183;return _0x95a5a9;})[_0x8835('0x25')](respondWithFilteredResult(_0x60b67e,_0x458216))[_0x8835('0x43')](handleError(_0x60b67e,null));};exports[_0x8835('0x44')]=function(_0x489876,_0x363053){var _0x30bc1b={'raw':![],'where':{'id':_0x489876[_0x8835('0x45')]['id']}},_0x5b78f9={};_0x5b78f9['model']=_[_0x8835('0x32')](db['VtigerAccount']['rawAttributes']);_0x5b78f9['query']=_[_0x8835('0x32')](_0x489876[_0x8835('0x33')]);_0x5b78f9['filters']=_[_0x8835('0x35')](_0x5b78f9[_0x8835('0x30')],_0x5b78f9[_0x8835('0x33')]);_0x30bc1b['attributes']=_[_0x8835('0x35')](_0x5b78f9['model'],qs['fields'](_0x489876[_0x8835('0x33')][_0x8835('0x36')]));_0x30bc1b[_0x8835('0x37')]=_0x30bc1b['attributes']['length']?_0x30bc1b[_0x8835('0x37')]:_0x5b78f9[_0x8835('0x30')];if(_0x489876[_0x8835('0x33')]['includeAll']){_0x30bc1b[_0x8835('0x41')]=[{'all':!![]}];}_0x30bc1b=_[_0x8835('0x3d')]({},_0x30bc1b,_0x489876['options']);return db[_0x8835('0x2b')]['find'](_0x30bc1b)[_0x8835('0x25')](handleEntityNotFound(_0x363053,null))[_0x8835('0x25')](respondWithResult(_0x363053,null))['catch'](handleError(_0x363053,null));};exports['create']=function(_0x3c6a9d,_0x5b89d8){return db[_0x8835('0x2b')][_0x8835('0x46')](_0x3c6a9d[_0x8835('0x47')],{})[_0x8835('0x25')](respondWithResult(_0x5b89d8,0xc9))['catch'](handleError(_0x5b89d8,null));};exports[_0x8835('0x24')]=function(_0x4fb19b,_0x255a0c){if(_0x4fb19b[_0x8835('0x47')]['id']){delete _0x4fb19b[_0x8835('0x47')]['id'];}return db['VtigerAccount'][_0x8835('0x48')]({'where':{'id':_0x4fb19b['params']['id']}})[_0x8835('0x25')](handleEntityNotFound(_0x255a0c,null))[_0x8835('0x25')](saveUpdates(_0x4fb19b['body'],null))[_0x8835('0x25')](respondWithResult(_0x255a0c,null))['catch'](handleError(_0x255a0c,null));};exports[_0x8835('0x26')]=function(_0x3f52f0,_0x43320f){return db[_0x8835('0x2b')][_0x8835('0x48')]({'where':{'id':_0x3f52f0[_0x8835('0x45')]['id']}})[_0x8835('0x25')](handleEntityNotFound(_0x43320f,null))[_0x8835('0x25')](removeEntity(_0x43320f,null))['catch'](handleError(_0x43320f,null));};exports[_0x8835('0x49')]=function(_0x3c42eb,_0x49d607,_0x2882f7){var _0x256766={};var _0x1df656={};var _0x2ab76c;var _0x151bc9;return db[_0x8835('0x2b')][_0x8835('0x4a')]({'where':{'id':_0x3c42eb[_0x8835('0x45')]['id']}})[_0x8835('0x25')](handleEntityNotFound(_0x49d607,null))[_0x8835('0x25')](function(_0x5edc1c){if(_0x5edc1c){_0x2ab76c=_0x5edc1c;_0x1df656[_0x8835('0x30')]=_[_0x8835('0x32')](db[_0x8835('0x4b')][_0x8835('0x2c')]);_0x1df656[_0x8835('0x33')]=_[_0x8835('0x32')](_0x3c42eb[_0x8835('0x33')]);_0x1df656[_0x8835('0x34')]=_['intersection'](_0x1df656[_0x8835('0x30')],_0x1df656[_0x8835('0x33')]);_0x256766[_0x8835('0x37')]=_['intersection'](_0x1df656[_0x8835('0x30')],qs[_0x8835('0x36')](_0x3c42eb[_0x8835('0x33')][_0x8835('0x36')]));_0x256766[_0x8835('0x37')]=_0x256766[_0x8835('0x37')][_0x8835('0x4c')]?_0x256766[_0x8835('0x37')]:_0x1df656[_0x8835('0x30')];_0x256766[_0x8835('0x4d')]=qs[_0x8835('0x3a')](_0x3c42eb['query'][_0x8835('0x3a')]);_0x256766[_0x8835('0x3c')]=qs[_0x8835('0x34')](_[_0x8835('0x3b')](_0x3c42eb[_0x8835('0x33')],_0x1df656[_0x8835('0x34')]));if(_0x3c42eb[_0x8835('0x33')][_0x8835('0x3e')]){_0x256766[_0x8835('0x3c')]=_[_0x8835('0x3d')](_0x256766[_0x8835('0x3c')],{'$or':_[_0x8835('0x31')](_0x256766['attributes'],function(_0x7f334d){var _0x206000={};_0x206000[_0x7f334d]={'$like':'%'+_0x3c42eb[_0x8835('0x33')][_0x8835('0x3e')]+'%'};return _0x206000;})});}_0x256766=_[_0x8835('0x3d')]({},_0x256766,_0x3c42eb[_0x8835('0x3f')]);return _0x2ab76c[_0x8835('0x49')](_0x256766);}})[_0x8835('0x25')](function(_0x29c38a){if(_0x29c38a){_0x151bc9=_0x29c38a[_0x8835('0x4c')];if(!_0x3c42eb['query'][_0x8835('0x38')](_0x8835('0x39'))){_0x256766['limit']=qs[_0x8835('0x1e')](_0x3c42eb[_0x8835('0x33')][_0x8835('0x1e')]);_0x256766[_0x8835('0x1c')]=qs[_0x8835('0x1c')](_0x3c42eb[_0x8835('0x33')][_0x8835('0x1c')]);}return _0x2ab76c['getConfigurations'](_0x256766);}})[_0x8835('0x25')](function(_0x4b5ef9){if(_0x4b5ef9){return _0x4b5ef9?{'count':_0x151bc9,'rows':_0x4b5ef9}:null;}})['then'](respondWithResult(_0x49d607,null))[_0x8835('0x43')](handleError(_0x49d607,null));};exports['addConfiguration']=function(_0x1f2ab5,_0x5d9d40,_0x2e44ed){if(_0x1f2ab5[_0x8835('0x47')]['id']){delete _0x1f2ab5[_0x8835('0x47')]['id'];}return db[_0x8835('0x2b')][_0x8835('0x4a')]({'where':{'id':_0x1f2ab5['params']['id']}})['then'](handleEntityNotFound(_0x5d9d40,null))[_0x8835('0x25')](function(_0x2dcea6){if(_0x2dcea6){_0x1f2ab5['body'][_0x8835('0x4e')]=_0x2dcea6['id'];_0x1f2ab5['body']['Subjects']=integrations['getSubjects'](_0x1f2ab5[_0x8835('0x47')][_0x8835('0x4f')],_0x1f2ab5[_0x8835('0x47')][_0x8835('0x2e')]);_0x1f2ab5['body'][_0x8835('0x50')]=integrations['getDescriptions'](_0x1f2ab5[_0x8835('0x47')]['channel'],_0x1f2ab5[_0x8835('0x47')]['type']);return db[_0x8835('0x4b')][_0x8835('0x46')](_0x1f2ab5[_0x8835('0x47')],{'include':[{'model':db[_0x8835('0x51')],'as':_0x8835('0x52')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x8835('0x25')](respondWithResult(_0x5d9d40,null))[_0x8835('0x43')](handleError(_0x5d9d40,null));};var md5=require(_0x8835('0x53'));exports['getFields']=function(_0x39a0da,_0x955f69,_0x46772a){var _0x560112=null;var _0x5a353f=null;var _0x2b35c0=null;var _0x1dfd5d=null;var _0x112aae='';return db[_0x8835('0x2b')]['findOne']({'where':{'id':_0x39a0da[_0x8835('0x45')]['id']},'attributes':['id','name',_0x8835('0x54'),_0x8835('0x55'),'moduleName',_0x8835('0x56'),_0x8835('0x57'),'accessKey']})[_0x8835('0x25')](handleEntityNotFound(_0x955f69,null))[_0x8835('0x25')](function(_0x1ca0f5){if(_0x1ca0f5){_0x560112=_0x1ca0f5['username'];_0x5a353f=_0x1ca0f5[_0x8835('0x58')];_0x2b35c0=_0x1ca0f5[_0x8835('0x59')];_0x112aae=_0x1ca0f5[_0x8835('0x56')];var _0x1ced68=_0x112aae[_0x8835('0x5a')](-0x1);if(_0x1ced68==='/'){_0x112aae=_0x112aae[_0x8835('0x5b')](0x0,_0x112aae[_0x8835('0x5c')](_0x1ced68));}_0x1dfd5d=util[_0x8835('0x5d')](_0x8835('0x5e'),_0x112aae);var _0xd4f07f={'method':_0x8835('0x5f'),'uri':_0x1dfd5d,'qs':{'operation':'getchallenge','username':_0x1ca0f5['username']},'json':!![]};return rp(_0xd4f07f);}})[_0x8835('0x25')](function(_0x4fc0b6){if(_0x4fc0b6[_0x8835('0x60')]){var _0x502b8c={'method':_0x8835('0x61'),'uri':_0x1dfd5d,'form':{'operation':'login','username':_0x560112,'accessKey':md5(_0x4fc0b6['result']['token']+_0x5a353f)},'json':!![]};return rp(_0x502b8c);}})[_0x8835('0x25')](function(_0x2c528c){if(_0x2c528c[_0x8835('0x60')]){var _0x408c5a={'method':_0x8835('0x5f'),'uri':_0x1dfd5d,'qs':{'operation':_0x8835('0x62'),'username':_0x560112,'sessionName':_0x2c528c[_0x8835('0x63')][_0x8835('0x64')],'elementType':_0x2b35c0},'json':!![]};return rp(_0x408c5a);}})['then'](function(_0x27170c){if(_0x27170c[_0x8835('0x60')]){var _0x3cebb7=['autogenerated','reference',_0x8835('0x65')];_[_0x8835('0x66')](_0x27170c['result'][_0x8835('0x36')],function(_0x225349){return _0x3cebb7[_0x8835('0x67')](_0x225349['type'][_0x8835('0x29')]);});_['remove'](_0x27170c[_0x8835('0x63')][_0x8835('0x36')],function(_0x492231){return _0x492231[_0x8835('0x68')]===_0x8835('0x69');});return{'count':_0x27170c[_0x8835('0x63')]['fields'][_0x8835('0x4c')],'rows':_['map'](_0x27170c[_0x8835('0x63')][_0x8835('0x36')],function(_0x29987c){return{'id':_0x29987c[_0x8835('0x29')],'name':_0x29987c[_0x8835('0x6a')],'custom':_['startsWith'](_0x29987c[_0x8835('0x29')],'cf_')?!![]:![],'options':_0x29987c[_0x8835('0x2e')][_0x8835('0x29')]===_0x8835('0x6b')&&_0x29987c['type'][_0x8835('0x6c')][_0x8835('0x4c')]>0x0?_[_0x8835('0x31')](_0x29987c[_0x8835('0x2e')][_0x8835('0x6c')],function(_0x11102d){return{'name':_0x11102d[_0x8835('0x6a')],'value':_0x11102d[_0x8835('0x6d')]};}):[]};})};}})[_0x8835('0x25')](respondWithResult(_0x955f69,null))[_0x8835('0x43')](function(_0x4c5e62){console[_0x8835('0x6e')](_0x8835('0x6f')+_0x4c5e62);var _0x387e67=_0x39a0da[_0x8835('0x33')][_0x8835('0x70')]?0x1f4:_0x4c5e62[_0x8835('0x71')]||0x1f4;logger[_0x8835('0x27')](_0x8835('0x72'),_0x8835('0x73'),_0x387e67,JSON[_0x8835('0x74')](_0x4c5e62));delete _0x4c5e62[_0x8835('0x29')];if(_0x387e67===0x191){_0x387e67=0x190;}_0x955f69['status'](_0x387e67)[_0x8835('0x75')](_0x39a0da[_0x8835('0x33')][_0x8835('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x4c5e62[_0x8835('0x71')]}:_0x4c5e62);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 80b62d9..77682e2 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 _0x0734=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','util','../../config/logger','api'];(function(_0x1c7586,_0x1d46bd){var _0x3bd9a1=function(_0x2f2d4d){while(--_0x2f2d4d){_0x1c7586['push'](_0x1c7586['shift']());}};_0x3bd9a1(++_0x1d46bd);}(_0x0734,0xbb));var _0x4073=function(_0x2c088a,_0x434d71){_0x2c088a=_0x2c088a-0x0;var _0x46210d=_0x0734[_0x2c088a];return _0x46210d;};'use strict';var _=require('lodash');var util=require(_0x4073('0x0'));var logger=require(_0x4073('0x1'))(_0x4073('0x2'));var moment=require('moment');var BPromise=require(_0x4073('0x3'));var rp=require(_0x4073('0x4'));var fs=require('fs');var path=require(_0x4073('0x5'));var rimraf=require(_0x4073('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4073('0x7'));module[_0x4073('0x8')]=function(_0x5a1099,_0x3026be){return _0x5a1099[_0x4073('0x9')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec0=['int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','VtigerAccount'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x9ec0,0xb7));var _0x09ec=function(_0x1cf15a,_0x5408ff){_0x1cf15a=_0x1cf15a-0x0;var _0x42974b=_0x9ec0[_0x1cf15a];return _0x42974b;};'use strict';var _=require(_0x09ec('0x0'));var util=require('util');var logger=require(_0x09ec('0x1'))(_0x09ec('0x2'));var moment=require(_0x09ec('0x3'));var BPromise=require(_0x09ec('0x4'));var rp=require(_0x09ec('0x5'));var fs=require('fs');var path=require(_0x09ec('0x6'));var rimraf=require(_0x09ec('0x7'));var config=require(_0x09ec('0x8'));var attributes=require(_0x09ec('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x09ec('0xa')]=function(_0x15adc4,_0x1b08d7){return _0x15adc4['define'](_0x09ec('0xb'),attributes,{'tableName':_0x09ec('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 842605a..52b604f 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 _0xbfcc=['findAll','options','raw','where','attributes','limit','map','model','include','then','GetVtigerAccount','catch','ShowVtigerAccount','VtigerAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xbfcc[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});}exports['GetVtigerAccount']=function(_0x5b078f){var _0x33f731=this;return new Promise(function(_0x99b59d,_0x344510){return db['VtigerAccount'][_0xcbfc('0x12')]({'raw':_0x5b078f['options']?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x15')]||null:null,'attributes':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x16')]||null:null,'limit':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x17')]||null:null,'include':_0x5b078f['options']?_0x5b078f['options']['include']?_[_0xcbfc('0x18')](_0x5b078f['options']['include'],function(_0x1b3e42){return{'model':db[_0x1b3e42[_0xcbfc('0x19')]],'as':_0x1b3e42['as'],'attributes':_0x1b3e42[_0xcbfc('0x16')],'include':_0x1b3e42[_0xcbfc('0x1a')]?_['map'](_0x1b3e42[_0xcbfc('0x1a')],function(_0x51284a){return{'model':db[_0x51284a[_0xcbfc('0x19')]],'as':_0x51284a['as'],'attributes':_0x51284a[_0xcbfc('0x16')],'include':_0x51284a['include']?_[_0xcbfc('0x18')](_0x51284a[_0xcbfc('0x1a')],function(_0x4ab48e){return{'model':db[_0x4ab48e[_0xcbfc('0x19')]],'as':_0x4ab48e['as'],'attributes':_0x4ab48e[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x41f3b8){logger['info'](_0xcbfc('0x1c'),_0x5b078f);logger[_0xcbfc('0xb')]('GetVtigerAccount',_0x5b078f,JSON[_0xcbfc('0xd')](_0x41f3b8));_0x99b59d(_0x41f3b8);})[_0xcbfc('0x1d')](function(_0x7cbdfa){logger[_0xcbfc('0xe')](_0xcbfc('0x1c'),_0x7cbdfa[_0xcbfc('0x10')],_0x5b078f);_0x344510(_0x33f731[_0xcbfc('0xe')](0x1f4,_0x7cbdfa['message']));});});};exports[_0xcbfc('0x1e')]=function(_0x433300){var _0x3f9d20=this;return new Promise(function(_0x20a378,_0x500a0b){return db[_0xcbfc('0x1f')][_0xcbfc('0x20')]({'raw':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['where']||null:null,'attributes':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['attributes']||null:null,'include':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x1a')]?_['map'](_0x433300['options']['include'],function(_0x3c6d04){return{'model':db[_0x3c6d04[_0xcbfc('0x19')]],'as':_0x3c6d04['as'],'attributes':_0x3c6d04[_0xcbfc('0x16')],'include':_0x3c6d04[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x3c6d04[_0xcbfc('0x1a')],function(_0x856e83){return{'model':db[_0x856e83[_0xcbfc('0x19')]],'as':_0x856e83['as'],'attributes':_0x856e83['attributes'],'include':_0x856e83[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x856e83['include'],function(_0x3093b5){return{'model':db[_0x3093b5['model']],'as':_0x3093b5['as'],'attributes':_0x3093b5[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x43121e){logger['info'](_0xcbfc('0x1e'),_0x433300);logger['debug']('ShowVtigerAccount',_0x433300,JSON[_0xcbfc('0xd')](_0x43121e));_0x20a378(_0x43121e);})[_0xcbfc('0x1d')](function(_0x382d8b){logger[_0xcbfc('0xe')](_0xcbfc('0x1e'),_0x382d8b[_0xcbfc('0x10')],_0x433300);_0x500a0b(_0x3f9d20[_0xcbfc('0xe')](0x1f4,_0x382d8b[_0xcbfc('0x10')]));});});}; \ No newline at end of file +var _0xbdb7=['model','map','ShowVtigerAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','attributes','limit','include'];(function(_0x21cce9,_0x231204){var _0x503721=function(_0xd1c1e4){while(--_0xd1c1e4){_0x21cce9['push'](_0x21cce9['shift']());}};_0x503721(++_0x231204);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1933fe,_0x4dd1d2){_0x1933fe=_0x1933fe-0x0;var _0x3ccf9c=_0xbdb7[_0x1933fe];return _0x3ccf9c;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}exports[_0x7bdb('0x15')]=function(_0x5723f4){var _0x2aff6a=this;return new Promise(function(_0x4ffd4b,_0x41f540){return db[_0x7bdb('0x16')]['findAll']({'raw':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')]['where']||null:null,'attributes':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x19')]||null:null,'limit':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1a')]||null:null,'include':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_['map'](_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')],function(_0x40c447){return{'model':db[_0x40c447[_0x7bdb('0x1c')]],'as':_0x40c447['as'],'attributes':_0x40c447['attributes'],'include':_0x40c447['include']?_[_0x7bdb('0x1d')](_0x40c447['include'],function(_0x47abaf){return{'model':db[_0x47abaf['model']],'as':_0x47abaf['as'],'attributes':_0x47abaf[_0x7bdb('0x19')],'include':_0x47abaf['include']?_[_0x7bdb('0x1d')](_0x47abaf[_0x7bdb('0x1b')],function(_0x3ec129){return{'model':db[_0x3ec129[_0x7bdb('0x1c')]],'as':_0x3ec129['as'],'attributes':_0x3ec129[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10e818){logger[_0x7bdb('0xb')](_0x7bdb('0x15'),_0x5723f4);logger[_0x7bdb('0xe')](_0x7bdb('0x15'),_0x5723f4,JSON[_0x7bdb('0x10')](_0x10e818));_0x4ffd4b(_0x10e818);})[_0x7bdb('0x14')](function(_0xd2d7be){logger[_0x7bdb('0x11')](_0x7bdb('0x15'),_0xd2d7be[_0x7bdb('0x12')],_0x5723f4);_0x41f540(_0x2aff6a[_0x7bdb('0x11')](0x1f4,_0xd2d7be['message']));});});};exports[_0x7bdb('0x1e')]=function(_0x23fc3a){var _0x8f7672=this;return new Promise(function(_0x9f5c1,_0x29eac5){return db['VtigerAccount'][_0x7bdb('0x1f')]({'raw':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x23fc3a['options']?_0x23fc3a['options']['where']||null:null,'attributes':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a['options'][_0x7bdb('0x19')]||null:null,'include':_0x23fc3a['options']?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x23fc3a['options'][_0x7bdb('0x1b')],function(_0x514713){return{'model':db[_0x514713['model']],'as':_0x514713['as'],'attributes':_0x514713[_0x7bdb('0x19')],'include':_0x514713['include']?_[_0x7bdb('0x1d')](_0x514713['include'],function(_0x5ee47d){return{'model':db[_0x5ee47d[_0x7bdb('0x1c')]],'as':_0x5ee47d['as'],'attributes':_0x5ee47d[_0x7bdb('0x19')],'include':_0x5ee47d[_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x5ee47d[_0x7bdb('0x1b')],function(_0x2bb28a){return{'model':db[_0x2bb28a['model']],'as':_0x2bb28a['as'],'attributes':_0x2bb28a[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7bdb('0x20')](function(_0x329ecf){logger[_0x7bdb('0xb')](_0x7bdb('0x1e'),_0x23fc3a);logger[_0x7bdb('0xe')](_0x7bdb('0x1e'),_0x23fc3a,JSON[_0x7bdb('0x10')](_0x329ecf));_0x9f5c1(_0x329ecf);})[_0x7bdb('0x14')](function(_0x4e1c97){logger['error'](_0x7bdb('0x1e'),_0x4e1c97[_0x7bdb('0x12')],_0x23fc3a);_0x29eac5(_0x8f7672[_0x7bdb('0x11')](0x1f4,_0x4e1c97[_0x7bdb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index dd32d45..92b32de 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 _0x300f=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/descriptions','getDescriptions','post','create','put','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c2d6a,_0xe370fb){var _0x5c7c16=function(_0x51e58e){while(--_0x51e58e){_0x5c2d6a['push'](_0x5c2d6a['shift']());}};_0x5c7c16(++_0xe370fb);}(_0x300f,0x1b1));var _0xf300=function(_0x1dff90,_0x4e5292){_0x1dff90=_0x1dff90-0x0;var _0x121dcd=_0x300f[_0x1dff90];return _0x121dcd;};'use strict';var multer=require(_0xf300('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf300('0x1'));var express=require(_0xf300('0x2'));var router=express[_0xf300('0x3')]();var fs_extra=require(_0xf300('0x4'));var auth=require(_0xf300('0x5'));var interaction=require(_0xf300('0x6'));var config=require(_0xf300('0x7'));var controller=require(_0xf300('0x8'));router[_0xf300('0x9')]('/',auth[_0xf300('0xa')](),controller[_0xf300('0xb')]);router[_0xf300('0x9')](_0xf300('0xc'),auth['isAuthenticated'](),controller[_0xf300('0xd')]);router[_0xf300('0x9')]('/:id/fields',auth[_0xf300('0xa')](),controller[_0xf300('0xe')]);router['get']('/:id/subjects',auth[_0xf300('0xa')](),controller['getSubjects']);router[_0xf300('0x9')](_0xf300('0xf'),auth[_0xf300('0xa')](),controller[_0xf300('0x10')]);router[_0xf300('0x11')]('/',auth['isAuthenticated'](),controller[_0xf300('0x12')]);router[_0xf300('0x13')](_0xf300('0xc'),auth[_0xf300('0xa')](),controller['update']);router[_0xf300('0x14')](_0xf300('0xc'),auth[_0xf300('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x306d=['../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ea9c5,_0x5bbc9a){var _0x3151d5=function(_0x22ca3b){while(--_0x22ca3b){_0x1ea9c5['push'](_0x1ea9c5['shift']());}};_0x3151d5(++_0x5bbc9a);}(_0x306d,0xc8));var _0xd306=function(_0x2b00a5,_0x446a30){_0x2b00a5=_0x2b00a5-0x0;var _0x48479a=_0x306d[_0x2b00a5];return _0x48479a;};'use strict';var multer=require(_0xd306('0x0'));var util=require(_0xd306('0x1'));var path=require(_0xd306('0x2'));var timeout=require(_0xd306('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd306('0x4'));var auth=require(_0xd306('0x5'));var interaction=require(_0xd306('0x6'));var config=require(_0xd306('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xd306('0x8')]('/',auth['isAuthenticated'](),controller[_0xd306('0x9')]);router[_0xd306('0x8')](_0xd306('0xa'),auth[_0xd306('0xb')](),controller[_0xd306('0xc')]);router[_0xd306('0x8')](_0xd306('0xd'),auth[_0xd306('0xb')](),controller[_0xd306('0xe')]);router[_0xd306('0x8')](_0xd306('0xf'),auth['isAuthenticated'](),controller[_0xd306('0x10')]);router['get'](_0xd306('0x11'),auth[_0xd306('0xb')](),controller['getDescriptions']);router[_0xd306('0x12')]('/',auth[_0xd306('0xb')](),controller['create']);router[_0xd306('0x13')](_0xd306('0xa'),auth[_0xd306('0xb')](),controller[_0xd306('0x14')]);router[_0xd306('0x15')](_0xd306('0xa'),auth[_0xd306('0xb')](),controller['destroy']);module[_0xd306('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 383851d..7009fe4 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 _0x34e5=['STRING','sequelize','exports'];(function(_0xfd7396,_0x242be7){var _0x1b5ed8=function(_0x2e681e){while(--_0x2e681e){_0xfd7396['push'](_0xfd7396['shift']());}};_0x1b5ed8(++_0x242be7);}(_0x34e5,0xeb));var _0x534e=function(_0x47af44,_0x5d61eb){_0x47af44=_0x47af44-0x0;var _0x421ce0=_0x34e5[_0x47af44];return _0x421ce0;};'use strict';var Sequelize=require(_0x534e('0x0'));module[_0x534e('0x1')]={'name':{'type':Sequelize[_0x534e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeffb=['sequelize','exports','STRING'];(function(_0x41f89e,_0x1364a3){var _0x1b7e94=function(_0x47735e){while(--_0x47735e){_0x41f89e['push'](_0x41f89e['shift']());}};_0x1b7e94(++_0x1364a3);}(_0xeffb,0xbd));var _0xbeff=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xeffb[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0xbeff('0x0'));module[_0xbeff('0x1')]={'name':{'type':Sequelize[_0xbeff('0x2')]},'description':{'type':Sequelize[_0xbeff('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 92063bd..9b8501d 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 _0xffab=['pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','find','catch','create','body','params','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','set','Content-Range','apply','save','update','then','destroy','error','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','filters'];(function(_0x32c18d,_0x34b160){var _0x5db577=function(_0x1ae424){while(--_0x1ae424){_0x32c18d['push'](_0x32c18d['shift']());}};_0x5db577(++_0x34b160);}(_0xffab,0x1a5));var _0xbffa=function(_0x28586f,_0x19383b){_0x28586f=_0x28586f-0x0;var _0xb81282=_0xffab[_0x28586f];return _0xb81282;};'use strict';var emlformat=require(_0xbffa('0x0'));var rimraf=require(_0xbffa('0x1'));var zipdir=require(_0xbffa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbffa('0x3'));var moment=require(_0xbffa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbffa('0x5'));var util=require(_0xbffa('0x6'));var path=require(_0xbffa('0x7'));var sox=require(_0xbffa('0x8'));var csv=require(_0xbffa('0x9'));var ejs=require(_0xbffa('0xa'));var fs=require('fs');var fs_extra=require(_0xbffa('0xb'));var _=require('lodash');var squel=require(_0xbffa('0xc'));var crypto=require('crypto');var jsforce=require(_0xbffa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbffa('0x9'));var querystring=require(_0xbffa('0xe'));var Papa=require('papaparse');var Redis=require(_0xbffa('0xf'));var authService=require(_0xbffa('0x10'));var qs=require(_0xbffa('0x11'));var as=require(_0xbffa('0x12'));var hardwareService=require(_0xbffa('0x13'));var logger=require(_0xbffa('0x14'))(_0xbffa('0x15'));var utils=require(_0xbffa('0x16'));var config=require(_0xbffa('0x17'));var licenseUtil=require(_0xbffa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x473397,_0x474c81){_0x474c81=_0x474c81||0xcc;return function(_0x9b2d86){if(_0x9b2d86){return _0x473397[_0xbffa('0x19')](_0x474c81);}return _0x473397[_0xbffa('0x1a')](_0x474c81)[_0xbffa('0x1b')]();};}function respondWithResult(_0x1181ea,_0x3d1259){_0x3d1259=_0x3d1259||0xc8;return function(_0x4a3fcd){if(_0x4a3fcd){return _0x1181ea[_0xbffa('0x1a')](_0x3d1259)[_0xbffa('0x1c')](_0x4a3fcd);}};}function respondWithFilteredResult(_0x244d99,_0x1cfe01){return function(_0x909cf3){if(_0x909cf3){var _0x3ccb80=typeof _0x1cfe01[_0xbffa('0x1d')]==='undefined'&&typeof _0x1cfe01['limit']==='undefined';var _0x25be01=_0x909cf3[_0xbffa('0x1e')];var _0x2199e8=_0x3ccb80?0x0:_0x1cfe01[_0xbffa('0x1d')];var _0x54c1a9=_0x3ccb80?_0x909cf3[_0xbffa('0x1e')]:_0x1cfe01[_0xbffa('0x1d')]+_0x1cfe01['limit'];var _0x9339de;if(_0x54c1a9>=_0x25be01){_0x54c1a9=_0x25be01;_0x9339de=0xc8;}else{_0x9339de=0xce;}_0x244d99[_0xbffa('0x1a')](_0x9339de);return _0x244d99[_0xbffa('0x1f')](_0xbffa('0x20'),_0x2199e8+'-'+_0x54c1a9+'/'+_0x25be01)[_0xbffa('0x1c')](_0x909cf3);}return null;};}function patchUpdates(_0x233108){return function(_0x5960e3){try{jsonpatch[_0xbffa('0x21')](_0x5960e3,_0x233108,!![]);}catch(_0x35497a){return BPromise['reject'](_0x35497a);}return _0x5960e3[_0xbffa('0x22')]();};}function saveUpdates(_0x451219,_0x240011){return function(_0x4b1974){if(_0x4b1974){return _0x4b1974[_0xbffa('0x23')](_0x451219)[_0xbffa('0x24')](function(_0x22abe7){return _0x22abe7;});}return null;};}function removeEntity(_0x2c1d36,_0xe224bc){return function(_0x43e40a){if(_0x43e40a){return _0x43e40a[_0xbffa('0x25')]()[_0xbffa('0x24')](function(){_0x2c1d36['status'](0xcc)[_0xbffa('0x1b')]();});}};}function handleEntityNotFound(_0x59676c,_0x36435b){return function(_0x184101){if(!_0x184101){_0x59676c['sendStatus'](0x194);}return _0x184101;};}function handleError(_0x390cd1,_0x4e3ff4){_0x4e3ff4=_0x4e3ff4||0x1f4;return function(_0x24fed0){logger[_0xbffa('0x26')](_0x24fed0['stack']);if(_0x24fed0['name']){delete _0x24fed0['name'];}_0x390cd1['status'](_0x4e3ff4)['send'](_0x24fed0);};}exports[_0xbffa('0x27')]=function(_0x3c32bb,_0x29c56a){var _0x325367={},_0x8cd843={},_0x3890fb={'count':0x0,'rows':[]};var _0x30e691=_['map'](db[_0xbffa('0x28')][_0xbffa('0x29')],function(_0x4d6f05){return{'name':_0x4d6f05[_0xbffa('0x2a')],'type':_0x4d6f05[_0xbffa('0x2b')][_0xbffa('0x2c')]};});_0x8cd843[_0xbffa('0x2d')]=_[_0xbffa('0x2e')](_0x30e691,_0xbffa('0x2f'));_0x8cd843[_0xbffa('0x30')]=_[_0xbffa('0x31')](_0x3c32bb[_0xbffa('0x30')]);_0x8cd843['filters']=_[_0xbffa('0x32')](_0x8cd843['model'],_0x8cd843[_0xbffa('0x30')]);_0x325367[_0xbffa('0x33')]=_['intersection'](_0x8cd843['model'],qs['fields'](_0x3c32bb[_0xbffa('0x30')][_0xbffa('0x34')]));_0x325367[_0xbffa('0x33')]=_0x325367['attributes'][_0xbffa('0x35')]?_0x325367[_0xbffa('0x33')]:_0x8cd843[_0xbffa('0x2d')];if(!_0x3c32bb[_0xbffa('0x30')]['hasOwnProperty'](_0xbffa('0x36'))){_0x325367[_0xbffa('0x37')]=qs['limit'](_0x3c32bb[_0xbffa('0x30')][_0xbffa('0x37')]);_0x325367['offset']=qs[_0xbffa('0x1d')](_0x3c32bb['query']['offset']);}_0x325367[_0xbffa('0x38')]=qs[_0xbffa('0x39')](_0x3c32bb[_0xbffa('0x30')][_0xbffa('0x39')]);_0x325367['where']=qs[_0xbffa('0x3a')](_[_0xbffa('0x3b')](_0x3c32bb[_0xbffa('0x30')],_0x8cd843[_0xbffa('0x3a')]),_0x30e691);if(_0x3c32bb[_0xbffa('0x30')][_0xbffa('0x3c')]){_0x325367['where']=_[_0xbffa('0x3d')](_0x325367[_0xbffa('0x3e')],{'$or':_['map'](_0x30e691,function(_0x40a9f7){if(_0x40a9f7[_0xbffa('0x2b')]!==_0xbffa('0x3f')){var _0x17de87={};_0x17de87[_0x40a9f7[_0xbffa('0x2f')]]={'$like':'%'+_0x3c32bb['query'][_0xbffa('0x3c')]+'%'};return _0x17de87;}})});}_0x325367=_[_0xbffa('0x3d')]({},_0x325367,_0x3c32bb[_0xbffa('0x40')]);var _0x546ba2={'where':_0x325367[_0xbffa('0x3e')]};return db[_0xbffa('0x28')][_0xbffa('0x1e')](_0x546ba2)['then'](function(_0x127a6f){_0x3890fb[_0xbffa('0x1e')]=_0x127a6f;if(_0x3c32bb[_0xbffa('0x30')][_0xbffa('0x41')]){_0x325367[_0xbffa('0x42')]=[{'all':!![]}];}return db[_0xbffa('0x28')]['findAll'](_0x325367);})[_0xbffa('0x24')](function(_0x1dfe86){_0x3890fb[_0xbffa('0x43')]=_0x1dfe86;return _0x3890fb;})[_0xbffa('0x24')](respondWithFilteredResult(_0x29c56a,_0x325367))['catch'](handleError(_0x29c56a,null));};exports[_0xbffa('0x44')]=function(_0x508b70,_0x30e566){var _0x407d70={'raw':![],'where':{'id':_0x508b70['params']['id']}},_0x5886ab={};_0x5886ab[_0xbffa('0x2d')]=_['keys'](db[_0xbffa('0x28')][_0xbffa('0x29')]);_0x5886ab[_0xbffa('0x30')]=_[_0xbffa('0x31')](_0x508b70['query']);_0x5886ab['filters']=_['intersection'](_0x5886ab[_0xbffa('0x2d')],_0x5886ab[_0xbffa('0x30')]);_0x407d70[_0xbffa('0x33')]=_[_0xbffa('0x32')](_0x5886ab[_0xbffa('0x2d')],qs[_0xbffa('0x34')](_0x508b70['query'][_0xbffa('0x34')]));_0x407d70[_0xbffa('0x33')]=_0x407d70[_0xbffa('0x33')][_0xbffa('0x35')]?_0x407d70[_0xbffa('0x33')]:_0x5886ab['model'];if(_0x508b70[_0xbffa('0x30')][_0xbffa('0x41')]){_0x407d70[_0xbffa('0x42')]=[{'all':!![]}];}_0x407d70=_[_0xbffa('0x3d')]({},_0x407d70,_0x508b70['options']);return db[_0xbffa('0x28')][_0xbffa('0x45')](_0x407d70)['then'](handleEntityNotFound(_0x30e566,null))[_0xbffa('0x24')](respondWithResult(_0x30e566,null))[_0xbffa('0x46')](handleError(_0x30e566,null));};exports[_0xbffa('0x47')]=function(_0x32da7d,_0x214684){return db[_0xbffa('0x28')][_0xbffa('0x47')](_0x32da7d[_0xbffa('0x48')],{})[_0xbffa('0x24')](respondWithResult(_0x214684,0xc9))[_0xbffa('0x46')](handleError(_0x214684,null));};exports[_0xbffa('0x23')]=function(_0x3ab5c8,_0x2817aa){if(_0x3ab5c8[_0xbffa('0x48')]['id']){delete _0x3ab5c8[_0xbffa('0x48')]['id'];}return db[_0xbffa('0x28')][_0xbffa('0x45')]({'where':{'id':_0x3ab5c8[_0xbffa('0x49')]['id']}})[_0xbffa('0x24')](handleEntityNotFound(_0x2817aa,null))[_0xbffa('0x24')](saveUpdates(_0x3ab5c8[_0xbffa('0x48')],null))[_0xbffa('0x24')](respondWithResult(_0x2817aa,null))[_0xbffa('0x46')](handleError(_0x2817aa,null));};exports[_0xbffa('0x25')]=function(_0x1426a1,_0x986c42){return db[_0xbffa('0x28')][_0xbffa('0x45')]({'where':{'id':_0x1426a1[_0xbffa('0x49')]['id']}})[_0xbffa('0x24')](handleEntityNotFound(_0x986c42,null))[_0xbffa('0x24')](removeEntity(_0x986c42,null))[_0xbffa('0x46')](handleError(_0x986c42,null));};exports[_0xbffa('0x4a')]=function(_0x5560a1,_0x8a417f,_0x4b723f){var _0x4e9ca6={};var _0xb8cd74={};var _0x5a2951;var _0x26b510;return db['VtigerConfiguration'][_0xbffa('0x4b')]({'where':{'id':_0x5560a1[_0xbffa('0x49')]['id']}})[_0xbffa('0x24')](handleEntityNotFound(_0x8a417f,null))['then'](function(_0x5ca0fd){if(_0x5ca0fd){_0x5a2951=_0x5ca0fd;_0xb8cd74['model']=_[_0xbffa('0x31')](db[_0xbffa('0x4c')][_0xbffa('0x29')]);_0xb8cd74[_0xbffa('0x30')]=_[_0xbffa('0x31')](_0x5560a1[_0xbffa('0x30')]);_0xb8cd74[_0xbffa('0x3a')]=_[_0xbffa('0x32')](_0xb8cd74[_0xbffa('0x2d')],_0xb8cd74['query']);_0x4e9ca6[_0xbffa('0x33')]=_[_0xbffa('0x32')](_0xb8cd74['model'],qs[_0xbffa('0x34')](_0x5560a1[_0xbffa('0x30')][_0xbffa('0x34')]));_0x4e9ca6['attributes']=_0x4e9ca6[_0xbffa('0x33')]['length']?_0x4e9ca6[_0xbffa('0x33')]:_0xb8cd74[_0xbffa('0x2d')];_0x4e9ca6[_0xbffa('0x38')]=qs[_0xbffa('0x39')](_0x5560a1[_0xbffa('0x30')][_0xbffa('0x39')]);_0x4e9ca6[_0xbffa('0x3e')]=qs[_0xbffa('0x3a')](_[_0xbffa('0x3b')](_0x5560a1[_0xbffa('0x30')],_0xb8cd74[_0xbffa('0x3a')]));if(_0x5560a1[_0xbffa('0x30')][_0xbffa('0x3c')]){_0x4e9ca6[_0xbffa('0x3e')]=_[_0xbffa('0x3d')](_0x4e9ca6[_0xbffa('0x3e')],{'$or':_[_0xbffa('0x2e')](_0x4e9ca6['attributes'],function(_0x116a2b){var _0x5c31b3={};_0x5c31b3[_0x116a2b]={'$like':'%'+_0x5560a1[_0xbffa('0x30')]['filter']+'%'};return _0x5c31b3;})});}_0x4e9ca6=_[_0xbffa('0x3d')]({},_0x4e9ca6,_0x5560a1['options']);return _0x5a2951['getFields'](_0x4e9ca6);}})['then'](function(_0x3a2067){if(_0x3a2067){_0x26b510=_0x3a2067[_0xbffa('0x35')];if(!_0x5560a1[_0xbffa('0x30')][_0xbffa('0x4d')](_0xbffa('0x36'))){_0x4e9ca6[_0xbffa('0x37')]=qs[_0xbffa('0x37')](_0x5560a1['query'][_0xbffa('0x37')]);_0x4e9ca6['offset']=qs['offset'](_0x5560a1[_0xbffa('0x30')][_0xbffa('0x1d')]);}return _0x5a2951[_0xbffa('0x4a')](_0x4e9ca6);}})[_0xbffa('0x24')](function(_0x14cd9e){if(_0x14cd9e){return _0x14cd9e?{'count':_0x26b510,'rows':_0x14cd9e}:null;}})[_0xbffa('0x24')](respondWithResult(_0x8a417f,null))[_0xbffa('0x46')](handleError(_0x8a417f,null));};exports['getSubjects']=function(_0x354ecf,_0x48d8cf,_0x233bc1){var _0x31b6eb={};var _0x73e8a1={};var _0x532aa1;var _0x588322;return db[_0xbffa('0x28')][_0xbffa('0x4b')]({'where':{'id':_0x354ecf[_0xbffa('0x49')]['id']}})[_0xbffa('0x24')](handleEntityNotFound(_0x48d8cf,null))[_0xbffa('0x24')](function(_0x504489){if(_0x504489){_0x532aa1=_0x504489;_0x73e8a1[_0xbffa('0x2d')]=_[_0xbffa('0x31')](db[_0xbffa('0x4c')][_0xbffa('0x29')]);_0x73e8a1[_0xbffa('0x30')]=_[_0xbffa('0x31')](_0x354ecf['query']);_0x73e8a1[_0xbffa('0x3a')]=_[_0xbffa('0x32')](_0x73e8a1[_0xbffa('0x2d')],_0x73e8a1[_0xbffa('0x30')]);_0x31b6eb[_0xbffa('0x33')]=_['intersection'](_0x73e8a1[_0xbffa('0x2d')],qs[_0xbffa('0x34')](_0x354ecf[_0xbffa('0x30')][_0xbffa('0x34')]));_0x31b6eb['attributes']=_0x31b6eb[_0xbffa('0x33')]['length']?_0x31b6eb[_0xbffa('0x33')]:_0x73e8a1[_0xbffa('0x2d')];_0x31b6eb['order']=qs['sort'](_0x354ecf[_0xbffa('0x30')][_0xbffa('0x39')]);_0x31b6eb[_0xbffa('0x3e')]=qs['filters'](_['pick'](_0x354ecf[_0xbffa('0x30')],_0x73e8a1['filters']));if(_0x354ecf[_0xbffa('0x30')][_0xbffa('0x3c')]){_0x31b6eb[_0xbffa('0x3e')]=_[_0xbffa('0x3d')](_0x31b6eb['where'],{'$or':_[_0xbffa('0x2e')](_0x31b6eb[_0xbffa('0x33')],function(_0x250bcf){var _0x5e7f1b={};_0x5e7f1b[_0x250bcf]={'$like':'%'+_0x354ecf[_0xbffa('0x30')]['filter']+'%'};return _0x5e7f1b;})});}_0x31b6eb=_[_0xbffa('0x3d')]({},_0x31b6eb,_0x354ecf[_0xbffa('0x40')]);return _0x532aa1[_0xbffa('0x4e')](_0x31b6eb);}})[_0xbffa('0x24')](function(_0x36be33){if(_0x36be33){_0x588322=_0x36be33[_0xbffa('0x35')];if(!_0x354ecf['query']['hasOwnProperty'](_0xbffa('0x36'))){_0x31b6eb[_0xbffa('0x37')]=qs['limit'](_0x354ecf['query'][_0xbffa('0x37')]);_0x31b6eb[_0xbffa('0x1d')]=qs[_0xbffa('0x1d')](_0x354ecf['query'][_0xbffa('0x1d')]);}return _0x532aa1[_0xbffa('0x4e')](_0x31b6eb);}})[_0xbffa('0x24')](function(_0x2aa771){if(_0x2aa771){return _0x2aa771?{'count':_0x588322,'rows':_0x2aa771}:null;}})['then'](respondWithResult(_0x48d8cf,null))[_0xbffa('0x46')](handleError(_0x48d8cf,null));};exports[_0xbffa('0x4f')]=function(_0x4b91af,_0x4debb4,_0x27c615){var _0x394b8c={};var _0x18f36a={};var _0x17b81d;var _0x1170b8;return db[_0xbffa('0x28')][_0xbffa('0x4b')]({'where':{'id':_0x4b91af[_0xbffa('0x49')]['id']}})[_0xbffa('0x24')](handleEntityNotFound(_0x4debb4,null))[_0xbffa('0x24')](function(_0x268dc1){if(_0x268dc1){_0x17b81d=_0x268dc1;_0x18f36a['model']=_[_0xbffa('0x31')](db[_0xbffa('0x4c')][_0xbffa('0x29')]);_0x18f36a[_0xbffa('0x30')]=_['keys'](_0x4b91af[_0xbffa('0x30')]);_0x18f36a['filters']=_['intersection'](_0x18f36a[_0xbffa('0x2d')],_0x18f36a[_0xbffa('0x30')]);_0x394b8c['attributes']=_[_0xbffa('0x32')](_0x18f36a[_0xbffa('0x2d')],qs['fields'](_0x4b91af[_0xbffa('0x30')][_0xbffa('0x34')]));_0x394b8c['attributes']=_0x394b8c[_0xbffa('0x33')][_0xbffa('0x35')]?_0x394b8c[_0xbffa('0x33')]:_0x18f36a[_0xbffa('0x2d')];_0x394b8c[_0xbffa('0x38')]=qs['sort'](_0x4b91af[_0xbffa('0x30')]['sort']);_0x394b8c[_0xbffa('0x3e')]=qs['filters'](_[_0xbffa('0x3b')](_0x4b91af[_0xbffa('0x30')],_0x18f36a[_0xbffa('0x3a')]));if(_0x4b91af[_0xbffa('0x30')]['filter']){_0x394b8c[_0xbffa('0x3e')]=_[_0xbffa('0x3d')](_0x394b8c[_0xbffa('0x3e')],{'$or':_['map'](_0x394b8c[_0xbffa('0x33')],function(_0x20bdfe){var _0x586e2b={};_0x586e2b[_0x20bdfe]={'$like':'%'+_0x4b91af['query']['filter']+'%'};return _0x586e2b;})});}_0x394b8c=_[_0xbffa('0x3d')]({},_0x394b8c,_0x4b91af[_0xbffa('0x40')]);return _0x17b81d[_0xbffa('0x4f')](_0x394b8c);}})['then'](function(_0x3a0fce){if(_0x3a0fce){_0x1170b8=_0x3a0fce[_0xbffa('0x35')];if(!_0x4b91af[_0xbffa('0x30')][_0xbffa('0x4d')](_0xbffa('0x36'))){_0x394b8c[_0xbffa('0x37')]=qs[_0xbffa('0x37')](_0x4b91af[_0xbffa('0x30')]['limit']);_0x394b8c['offset']=qs[_0xbffa('0x1d')](_0x4b91af[_0xbffa('0x30')][_0xbffa('0x1d')]);}return _0x17b81d[_0xbffa('0x4f')](_0x394b8c);}})[_0xbffa('0x24')](function(_0x28ea51){if(_0x28ea51){return _0x28ea51?{'count':_0x1170b8,'rows':_0x28ea51}:null;}})['then'](respondWithResult(_0x4debb4,null))['catch'](handleError(_0x4debb4,null));}; \ No newline at end of file +var _0xfd09=['findOne','VtigerField','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','getFields'];(function(_0x10fa19,_0x70ffa1){var _0x2ee294=function(_0x19ae92){while(--_0x19ae92){_0x10fa19['push'](_0x10fa19['shift']());}};_0x2ee294(++_0x70ffa1);}(_0xfd09,0x1d8));var _0x9fd0=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0xfd09[_0x2a94cf];return _0x22147f;};'use strict';var emlformat=require(_0x9fd0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fd0('0x1'));var rp=require('request-promise');var moment=require(_0x9fd0('0x2'));var BPromise=require(_0x9fd0('0x3'));var Mustache=require(_0x9fd0('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9fd0('0x5'));var csv=require(_0x9fd0('0x6'));var ejs=require(_0x9fd0('0x7'));var fs=require('fs');var fs_extra=require(_0x9fd0('0x8'));var _=require(_0x9fd0('0x9'));var squel=require('squel');var crypto=require(_0x9fd0('0xa'));var jsforce=require(_0x9fd0('0xb'));var deskjs=require(_0x9fd0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9fd0('0xd'));var Papa=require(_0x9fd0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9fd0('0xf'));var as=require(_0x9fd0('0x10'));var hardwareService=require(_0x9fd0('0x11'));var logger=require(_0x9fd0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9fd0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fd0('0x14'))['db'];function respondWithStatusCode(_0xbdd777,_0xaac81d){_0xaac81d=_0xaac81d||0xcc;return function(_0xae972d){if(_0xae972d){return _0xbdd777[_0x9fd0('0x15')](_0xaac81d);}return _0xbdd777['status'](_0xaac81d)[_0x9fd0('0x16')]();};}function respondWithResult(_0x103c43,_0x32570e){_0x32570e=_0x32570e||0xc8;return function(_0x526a3e){if(_0x526a3e){return _0x103c43[_0x9fd0('0x17')](_0x32570e)[_0x9fd0('0x18')](_0x526a3e);}};}function respondWithFilteredResult(_0x460839,_0x1b9c4d){return function(_0x3a78fb){if(_0x3a78fb){var _0x1fc55b=typeof _0x1b9c4d[_0x9fd0('0x19')]==='undefined'&&typeof _0x1b9c4d[_0x9fd0('0x1a')]===_0x9fd0('0x1b');var _0xe2719e=_0x3a78fb[_0x9fd0('0x1c')];var _0x38adff=_0x1fc55b?0x0:_0x1b9c4d[_0x9fd0('0x19')];var _0x4ea105=_0x1fc55b?_0x3a78fb['count']:_0x1b9c4d[_0x9fd0('0x19')]+_0x1b9c4d[_0x9fd0('0x1a')];var _0x4970a2;if(_0x4ea105>=_0xe2719e){_0x4ea105=_0xe2719e;_0x4970a2=0xc8;}else{_0x4970a2=0xce;}_0x460839[_0x9fd0('0x17')](_0x4970a2);return _0x460839[_0x9fd0('0x1d')]('Content-Range',_0x38adff+'-'+_0x4ea105+'/'+_0xe2719e)[_0x9fd0('0x18')](_0x3a78fb);}return null;};}function patchUpdates(_0x56d4dc){return function(_0x2fb513){try{jsonpatch[_0x9fd0('0x1e')](_0x2fb513,_0x56d4dc,!![]);}catch(_0x1f527d){return BPromise['reject'](_0x1f527d);}return _0x2fb513[_0x9fd0('0x1f')]();};}function saveUpdates(_0x1fee97,_0x4eaf95){return function(_0xc286a7){if(_0xc286a7){return _0xc286a7['update'](_0x1fee97)[_0x9fd0('0x20')](function(_0x589573){return _0x589573;});}return null;};}function removeEntity(_0x5af6da,_0x2b6068){return function(_0x554d33){if(_0x554d33){return _0x554d33[_0x9fd0('0x21')]()[_0x9fd0('0x20')](function(){_0x5af6da[_0x9fd0('0x17')](0xcc)[_0x9fd0('0x16')]();});}};}function handleEntityNotFound(_0x56c4c8,_0x512140){return function(_0x34cc7c){if(!_0x34cc7c){_0x56c4c8['sendStatus'](0x194);}return _0x34cc7c;};}function handleError(_0x1084a0,_0x27850f){_0x27850f=_0x27850f||0x1f4;return function(_0x101993){logger[_0x9fd0('0x22')](_0x101993[_0x9fd0('0x23')]);if(_0x101993[_0x9fd0('0x24')]){delete _0x101993[_0x9fd0('0x24')];}_0x1084a0[_0x9fd0('0x17')](_0x27850f)[_0x9fd0('0x25')](_0x101993);};}exports[_0x9fd0('0x26')]=function(_0x2cf5a1,_0x3aa31b){var _0x5e0ace={},_0x4ff3c0={},_0x4b86f6={'count':0x0,'rows':[]};var _0x329272=_[_0x9fd0('0x27')](db[_0x9fd0('0x28')][_0x9fd0('0x29')],function(_0x399c5a){return{'name':_0x399c5a[_0x9fd0('0x2a')],'type':_0x399c5a['type'][_0x9fd0('0x2b')]};});_0x4ff3c0[_0x9fd0('0x2c')]=_['map'](_0x329272,_0x9fd0('0x24'));_0x4ff3c0[_0x9fd0('0x2d')]=_[_0x9fd0('0x2e')](_0x2cf5a1[_0x9fd0('0x2d')]);_0x4ff3c0[_0x9fd0('0x2f')]=_['intersection'](_0x4ff3c0[_0x9fd0('0x2c')],_0x4ff3c0[_0x9fd0('0x2d')]);_0x5e0ace[_0x9fd0('0x30')]=_[_0x9fd0('0x31')](_0x4ff3c0[_0x9fd0('0x2c')],qs['fields'](_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x32')]));_0x5e0ace[_0x9fd0('0x30')]=_0x5e0ace['attributes']['length']?_0x5e0ace[_0x9fd0('0x30')]:_0x4ff3c0[_0x9fd0('0x2c')];if(!_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x33')](_0x9fd0('0x34'))){_0x5e0ace[_0x9fd0('0x1a')]=qs['limit'](_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x1a')]);_0x5e0ace[_0x9fd0('0x19')]=qs['offset'](_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x19')]);}_0x5e0ace[_0x9fd0('0x35')]=qs[_0x9fd0('0x36')](_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x36')]);_0x5e0ace['where']=qs['filters'](_[_0x9fd0('0x37')](_0x2cf5a1[_0x9fd0('0x2d')],_0x4ff3c0[_0x9fd0('0x2f')]),_0x329272);if(_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x38')]){_0x5e0ace[_0x9fd0('0x39')]=_['merge'](_0x5e0ace[_0x9fd0('0x39')],{'$or':_['map'](_0x329272,function(_0x4fe044){if(_0x4fe044[_0x9fd0('0x3a')]!==_0x9fd0('0x3b')){var _0x3f44ee={};_0x3f44ee[_0x4fe044[_0x9fd0('0x24')]]={'$like':'%'+_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x38')]+'%'};return _0x3f44ee;}})});}_0x5e0ace=_['merge']({},_0x5e0ace,_0x2cf5a1[_0x9fd0('0x3c')]);var _0x15bfea={'where':_0x5e0ace['where']};return db[_0x9fd0('0x28')][_0x9fd0('0x1c')](_0x15bfea)[_0x9fd0('0x20')](function(_0x4cd1a2){_0x4b86f6['count']=_0x4cd1a2;if(_0x2cf5a1[_0x9fd0('0x2d')][_0x9fd0('0x3d')]){_0x5e0ace[_0x9fd0('0x3e')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x9fd0('0x3f')](_0x5e0ace);})['then'](function(_0x634448){_0x4b86f6[_0x9fd0('0x40')]=_0x634448;return _0x4b86f6;})['then'](respondWithFilteredResult(_0x3aa31b,_0x5e0ace))[_0x9fd0('0x41')](handleError(_0x3aa31b,null));};exports[_0x9fd0('0x42')]=function(_0x256477,_0x353f85){var _0x101449={'raw':![],'where':{'id':_0x256477[_0x9fd0('0x43')]['id']}},_0x42942={};_0x42942[_0x9fd0('0x2c')]=_[_0x9fd0('0x2e')](db['VtigerConfiguration'][_0x9fd0('0x29')]);_0x42942[_0x9fd0('0x2d')]=_[_0x9fd0('0x2e')](_0x256477[_0x9fd0('0x2d')]);_0x42942['filters']=_[_0x9fd0('0x31')](_0x42942[_0x9fd0('0x2c')],_0x42942['query']);_0x101449['attributes']=_[_0x9fd0('0x31')](_0x42942[_0x9fd0('0x2c')],qs[_0x9fd0('0x32')](_0x256477[_0x9fd0('0x2d')][_0x9fd0('0x32')]));_0x101449['attributes']=_0x101449[_0x9fd0('0x30')][_0x9fd0('0x44')]?_0x101449['attributes']:_0x42942[_0x9fd0('0x2c')];if(_0x256477[_0x9fd0('0x2d')][_0x9fd0('0x3d')]){_0x101449[_0x9fd0('0x3e')]=[{'all':!![]}];}_0x101449=_[_0x9fd0('0x45')]({},_0x101449,_0x256477[_0x9fd0('0x3c')]);return db['VtigerConfiguration'][_0x9fd0('0x46')](_0x101449)[_0x9fd0('0x20')](handleEntityNotFound(_0x353f85,null))['then'](respondWithResult(_0x353f85,null))[_0x9fd0('0x41')](handleError(_0x353f85,null));};exports[_0x9fd0('0x47')]=function(_0x4627bc,_0x785cd3){return db[_0x9fd0('0x28')][_0x9fd0('0x47')](_0x4627bc[_0x9fd0('0x48')],{})[_0x9fd0('0x20')](respondWithResult(_0x785cd3,0xc9))[_0x9fd0('0x41')](handleError(_0x785cd3,null));};exports['update']=function(_0x43e390,_0x5f40be){if(_0x43e390[_0x9fd0('0x48')]['id']){delete _0x43e390['body']['id'];}return db[_0x9fd0('0x28')][_0x9fd0('0x46')]({'where':{'id':_0x43e390[_0x9fd0('0x43')]['id']}})[_0x9fd0('0x20')](handleEntityNotFound(_0x5f40be,null))[_0x9fd0('0x20')](saveUpdates(_0x43e390['body'],null))[_0x9fd0('0x20')](respondWithResult(_0x5f40be,null))['catch'](handleError(_0x5f40be,null));};exports['destroy']=function(_0x4566a8,_0x2aa06a){return db[_0x9fd0('0x28')][_0x9fd0('0x46')]({'where':{'id':_0x4566a8[_0x9fd0('0x43')]['id']}})[_0x9fd0('0x20')](handleEntityNotFound(_0x2aa06a,null))[_0x9fd0('0x20')](removeEntity(_0x2aa06a,null))[_0x9fd0('0x41')](handleError(_0x2aa06a,null));};exports[_0x9fd0('0x49')]=function(_0x5090f3,_0x2353c0,_0x5a5b6f){var _0x752850={};var _0x1fc68e={};var _0x1ca401;var _0x45bf1a;return db[_0x9fd0('0x28')][_0x9fd0('0x4a')]({'where':{'id':_0x5090f3[_0x9fd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x2353c0,null))['then'](function(_0x329782){if(_0x329782){_0x1ca401=_0x329782;_0x1fc68e[_0x9fd0('0x2c')]=_['keys'](db[_0x9fd0('0x4b')][_0x9fd0('0x29')]);_0x1fc68e[_0x9fd0('0x2d')]=_['keys'](_0x5090f3['query']);_0x1fc68e[_0x9fd0('0x2f')]=_[_0x9fd0('0x31')](_0x1fc68e[_0x9fd0('0x2c')],_0x1fc68e[_0x9fd0('0x2d')]);_0x752850[_0x9fd0('0x30')]=_[_0x9fd0('0x31')](_0x1fc68e[_0x9fd0('0x2c')],qs[_0x9fd0('0x32')](_0x5090f3[_0x9fd0('0x2d')][_0x9fd0('0x32')]));_0x752850['attributes']=_0x752850[_0x9fd0('0x30')][_0x9fd0('0x44')]?_0x752850[_0x9fd0('0x30')]:_0x1fc68e[_0x9fd0('0x2c')];_0x752850['order']=qs[_0x9fd0('0x36')](_0x5090f3[_0x9fd0('0x2d')][_0x9fd0('0x36')]);_0x752850['where']=qs[_0x9fd0('0x2f')](_[_0x9fd0('0x37')](_0x5090f3['query'],_0x1fc68e[_0x9fd0('0x2f')]));if(_0x5090f3[_0x9fd0('0x2d')][_0x9fd0('0x38')]){_0x752850[_0x9fd0('0x39')]=_[_0x9fd0('0x45')](_0x752850[_0x9fd0('0x39')],{'$or':_[_0x9fd0('0x27')](_0x752850[_0x9fd0('0x30')],function(_0x3a9855){var _0x110245={};_0x110245[_0x3a9855]={'$like':'%'+_0x5090f3[_0x9fd0('0x2d')]['filter']+'%'};return _0x110245;})});}_0x752850=_[_0x9fd0('0x45')]({},_0x752850,_0x5090f3[_0x9fd0('0x3c')]);return _0x1ca401['getFields'](_0x752850);}})[_0x9fd0('0x20')](function(_0x389fb5){if(_0x389fb5){_0x45bf1a=_0x389fb5[_0x9fd0('0x44')];if(!_0x5090f3['query'][_0x9fd0('0x33')](_0x9fd0('0x34'))){_0x752850['limit']=qs[_0x9fd0('0x1a')](_0x5090f3[_0x9fd0('0x2d')]['limit']);_0x752850[_0x9fd0('0x19')]=qs[_0x9fd0('0x19')](_0x5090f3[_0x9fd0('0x2d')]['offset']);}return _0x1ca401[_0x9fd0('0x49')](_0x752850);}})[_0x9fd0('0x20')](function(_0x5d70a1){if(_0x5d70a1){return _0x5d70a1?{'count':_0x45bf1a,'rows':_0x5d70a1}:null;}})[_0x9fd0('0x20')](respondWithResult(_0x2353c0,null))[_0x9fd0('0x41')](handleError(_0x2353c0,null));};exports['getSubjects']=function(_0x1ea734,_0x273b8a,_0x28c2bf){var _0x70a130={};var _0x17d892={};var _0x40dafd;var _0x402027;return db[_0x9fd0('0x28')][_0x9fd0('0x4a')]({'where':{'id':_0x1ea734['params']['id']}})[_0x9fd0('0x20')](handleEntityNotFound(_0x273b8a,null))[_0x9fd0('0x20')](function(_0x3922d6){if(_0x3922d6){_0x40dafd=_0x3922d6;_0x17d892[_0x9fd0('0x2c')]=_[_0x9fd0('0x2e')](db[_0x9fd0('0x4b')]['rawAttributes']);_0x17d892[_0x9fd0('0x2d')]=_[_0x9fd0('0x2e')](_0x1ea734[_0x9fd0('0x2d')]);_0x17d892[_0x9fd0('0x2f')]=_['intersection'](_0x17d892[_0x9fd0('0x2c')],_0x17d892['query']);_0x70a130[_0x9fd0('0x30')]=_[_0x9fd0('0x31')](_0x17d892[_0x9fd0('0x2c')],qs[_0x9fd0('0x32')](_0x1ea734['query']['fields']));_0x70a130['attributes']=_0x70a130[_0x9fd0('0x30')][_0x9fd0('0x44')]?_0x70a130[_0x9fd0('0x30')]:_0x17d892[_0x9fd0('0x2c')];_0x70a130[_0x9fd0('0x35')]=qs[_0x9fd0('0x36')](_0x1ea734[_0x9fd0('0x2d')][_0x9fd0('0x36')]);_0x70a130[_0x9fd0('0x39')]=qs[_0x9fd0('0x2f')](_[_0x9fd0('0x37')](_0x1ea734[_0x9fd0('0x2d')],_0x17d892['filters']));if(_0x1ea734['query'][_0x9fd0('0x38')]){_0x70a130[_0x9fd0('0x39')]=_[_0x9fd0('0x45')](_0x70a130[_0x9fd0('0x39')],{'$or':_[_0x9fd0('0x27')](_0x70a130['attributes'],function(_0x1404e8){var _0xaf3ac8={};_0xaf3ac8[_0x1404e8]={'$like':'%'+_0x1ea734[_0x9fd0('0x2d')][_0x9fd0('0x38')]+'%'};return _0xaf3ac8;})});}_0x70a130=_['merge']({},_0x70a130,_0x1ea734['options']);return _0x40dafd['getSubjects'](_0x70a130);}})[_0x9fd0('0x20')](function(_0x52ae90){if(_0x52ae90){_0x402027=_0x52ae90[_0x9fd0('0x44')];if(!_0x1ea734[_0x9fd0('0x2d')][_0x9fd0('0x33')](_0x9fd0('0x34'))){_0x70a130[_0x9fd0('0x1a')]=qs[_0x9fd0('0x1a')](_0x1ea734['query']['limit']);_0x70a130['offset']=qs[_0x9fd0('0x19')](_0x1ea734[_0x9fd0('0x2d')][_0x9fd0('0x19')]);}return _0x40dafd[_0x9fd0('0x4c')](_0x70a130);}})[_0x9fd0('0x20')](function(_0x8a91a6){if(_0x8a91a6){return _0x8a91a6?{'count':_0x402027,'rows':_0x8a91a6}:null;}})[_0x9fd0('0x20')](respondWithResult(_0x273b8a,null))[_0x9fd0('0x41')](handleError(_0x273b8a,null));};exports['getDescriptions']=function(_0x182a1d,_0x27738f,_0x2f58f6){var _0x2a03e9={};var _0x434bac={};var _0xf9f2;var _0x86550;return db[_0x9fd0('0x28')][_0x9fd0('0x4a')]({'where':{'id':_0x182a1d['params']['id']}})[_0x9fd0('0x20')](handleEntityNotFound(_0x27738f,null))[_0x9fd0('0x20')](function(_0x4d2237){if(_0x4d2237){_0xf9f2=_0x4d2237;_0x434bac[_0x9fd0('0x2c')]=_[_0x9fd0('0x2e')](db[_0x9fd0('0x4b')]['rawAttributes']);_0x434bac['query']=_['keys'](_0x182a1d['query']);_0x434bac['filters']=_[_0x9fd0('0x31')](_0x434bac['model'],_0x434bac['query']);_0x2a03e9[_0x9fd0('0x30')]=_[_0x9fd0('0x31')](_0x434bac[_0x9fd0('0x2c')],qs[_0x9fd0('0x32')](_0x182a1d[_0x9fd0('0x2d')][_0x9fd0('0x32')]));_0x2a03e9[_0x9fd0('0x30')]=_0x2a03e9['attributes']['length']?_0x2a03e9[_0x9fd0('0x30')]:_0x434bac[_0x9fd0('0x2c')];_0x2a03e9[_0x9fd0('0x35')]=qs[_0x9fd0('0x36')](_0x182a1d[_0x9fd0('0x2d')]['sort']);_0x2a03e9[_0x9fd0('0x39')]=qs[_0x9fd0('0x2f')](_[_0x9fd0('0x37')](_0x182a1d[_0x9fd0('0x2d')],_0x434bac['filters']));if(_0x182a1d[_0x9fd0('0x2d')][_0x9fd0('0x38')]){_0x2a03e9[_0x9fd0('0x39')]=_[_0x9fd0('0x45')](_0x2a03e9['where'],{'$or':_['map'](_0x2a03e9[_0x9fd0('0x30')],function(_0x5f5e09){var _0x267d52={};_0x267d52[_0x5f5e09]={'$like':'%'+_0x182a1d[_0x9fd0('0x2d')][_0x9fd0('0x38')]+'%'};return _0x267d52;})});}_0x2a03e9=_[_0x9fd0('0x45')]({},_0x2a03e9,_0x182a1d[_0x9fd0('0x3c')]);return _0xf9f2[_0x9fd0('0x4d')](_0x2a03e9);}})[_0x9fd0('0x20')](function(_0x1448c2){if(_0x1448c2){_0x86550=_0x1448c2[_0x9fd0('0x44')];if(!_0x182a1d[_0x9fd0('0x2d')][_0x9fd0('0x33')](_0x9fd0('0x34'))){_0x2a03e9['limit']=qs[_0x9fd0('0x1a')](_0x182a1d['query'][_0x9fd0('0x1a')]);_0x2a03e9[_0x9fd0('0x19')]=qs[_0x9fd0('0x19')](_0x182a1d[_0x9fd0('0x2d')]['offset']);}return _0xf9f2[_0x9fd0('0x4d')](_0x2a03e9);}})['then'](function(_0x920c28){if(_0x920c28){return _0x920c28?{'count':_0x86550,'rows':_0x920c28}:null;}})[_0x9fd0('0x20')](respondWithResult(_0x27738f,null))[_0x9fd0('0x41')](handleError(_0x27738f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a933cfa..0c5e1d7 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 _0xf680=['../../config/logger','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x4b26a7,_0x654b5a){var _0x3cf936=function(_0x801c65){while(--_0x801c65){_0x4b26a7['push'](_0x4b26a7['shift']());}};_0x3cf936(++_0x654b5a);}(_0xf680,0x1ed));var _0x0f68=function(_0x7fa1d7,_0x1df267){_0x7fa1d7=_0x7fa1d7-0x0;var _0x40ffc8=_0xf680[_0x7fa1d7];return _0x40ffc8;};'use strict';var _=require(_0x0f68('0x0'));var util=require(_0x0f68('0x1'));var logger=require(_0x0f68('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0f68('0x3'));var fs=require('fs');var path=require(_0x0f68('0x4'));var rimraf=require(_0x0f68('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f68('0x6'));module[_0x0f68('0x7')]=function(_0x52eccf,_0x550566){return _0x52eccf[_0x0f68('0x8')](_0x0f68('0x9'),attributes,{'tableName':_0x0f68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb77=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','util'];(function(_0x4f874a,_0x3397a8){var _0x1528ed=function(_0xa8b81c){while(--_0xa8b81c){_0x4f874a['push'](_0x4f874a['shift']());}};_0x1528ed(++_0x3397a8);}(_0xdb77,0x1c2));var _0x7db7=function(_0x525e1d,_0x2d8128){_0x525e1d=_0x525e1d-0x0;var _0x3bae51=_0xdb77[_0x525e1d];return _0x3bae51;};'use strict';var _=require('lodash');var util=require(_0x7db7('0x0'));var logger=require('../../config/logger')(_0x7db7('0x1'));var moment=require(_0x7db7('0x2'));var BPromise=require(_0x7db7('0x3'));var rp=require(_0x7db7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7db7('0x5'));var config=require(_0x7db7('0x6'));var attributes=require(_0x7db7('0x7'));module['exports']=function(_0x368697,_0x3ad9f8){return _0x368697[_0x7db7('0x8')](_0x7db7('0x9'),attributes,{'tableName':_0x7db7('0xa'),'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 520c878..30cd9c4 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 _0x5933=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27acd5,_0x47a23e){var _0x27fdb0=function(_0x3bf6d2){while(--_0x3bf6d2){_0x27acd5['push'](_0x27acd5['shift']());}};_0x27fdb0(++_0x47a23e);}(_0x5933,0xbf));var _0x3593=function(_0x52667d,_0xc60229){_0x52667d=_0x52667d-0x0;var _0x3c52aa=_0x5933[_0x52667d];return _0x3c52aa;};'use strict';var _=require(_0x3593('0x0'));var util=require(_0x3593('0x1'));var moment=require(_0x3593('0x2'));var BPromise=require('bluebird');var rs=require(_0x3593('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3593('0x4'))['db'];var utils=require(_0x3593('0x5'));var logger=require(_0x3593('0x6'))(_0x3593('0x7'));var config=require(_0x3593('0x8'));var jayson=require(_0x3593('0x9'));var client=jayson[_0x3593('0xa')][_0x3593('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34a829,_0x9bdde6,_0x25e289){return new BPromise(function(_0x2eb848,_0x14097f){return client[_0x3593('0xc')](_0x34a829,_0x25e289)['then'](function(_0x2d7e9d){logger['info'](_0x3593('0xd'),_0x9bdde6,_0x3593('0xe'));logger[_0x3593('0xf')](_0x3593('0x10'),_0x9bdde6,'request\x20sent',JSON['stringify'](_0x2d7e9d));if(_0x2d7e9d[_0x3593('0x11')]){if(_0x2d7e9d[_0x3593('0x11')][_0x3593('0x12')]===0x1f4){logger[_0x3593('0x11')](_0x3593('0xd'),_0x9bdde6,_0x2d7e9d['error'][_0x3593('0x13')]);return _0x14097f(_0x2d7e9d[_0x3593('0x11')]['message']);}logger['error'](_0x3593('0xd'),_0x9bdde6,_0x2d7e9d[_0x3593('0x11')][_0x3593('0x13')]);return _0x2eb848(_0x2d7e9d[_0x3593('0x11')]['message']);}else{logger[_0x3593('0x14')](_0x3593('0xd'),_0x9bdde6,_0x3593('0xe'));_0x2eb848(_0x2d7e9d[_0x3593('0x15')][_0x3593('0x13')]);}})[_0x3593('0x16')](function(_0x3eae65){logger['error'](_0x3593('0xd'),_0x9bdde6,_0x3eae65);_0x14097f(_0x3eae65);});});} \ No newline at end of file +var _0xc661=['request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug'];(function(_0x55fc82,_0x59524f){var _0x51402e=function(_0x40b591){while(--_0x40b591){_0x55fc82['push'](_0x55fc82['shift']());}};_0x51402e(++_0x59524f);}(_0xc661,0x1d5));var _0x1c66=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xc661[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x1c66('0x0'));var util=require(_0x1c66('0x1'));var moment=require(_0x1c66('0x2'));var BPromise=require(_0x1c66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c66('0x5'));var logger=require(_0x1c66('0x6'))(_0x1c66('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c66('0x8')][_0x1c66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5172a4,_0x15642e,_0x56f130){return new BPromise(function(_0x2d4043,_0xa5c8f2){return client[_0x1c66('0xa')](_0x5172a4,_0x56f130)['then'](function(_0x1eaa36){logger[_0x1c66('0xb')](_0x1c66('0xc'),_0x15642e,'request\x20sent');logger[_0x1c66('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x15642e,_0x1c66('0xe'),JSON[_0x1c66('0xf')](_0x1eaa36));if(_0x1eaa36['error']){if(_0x1eaa36['error'][_0x1c66('0x10')]===0x1f4){logger['error'](_0x1c66('0xc'),_0x15642e,_0x1eaa36[_0x1c66('0x11')][_0x1c66('0x12')]);return _0xa5c8f2(_0x1eaa36[_0x1c66('0x11')][_0x1c66('0x12')]);}logger[_0x1c66('0x11')](_0x1c66('0xc'),_0x15642e,_0x1eaa36[_0x1c66('0x11')]['message']);return _0x2d4043(_0x1eaa36['error'][_0x1c66('0x12')]);}else{logger[_0x1c66('0xb')](_0x1c66('0xc'),_0x15642e,_0x1c66('0xe'));_0x2d4043(_0x1eaa36[_0x1c66('0x13')][_0x1c66('0x12')]);}})[_0x1c66('0x14')](function(_0x26532c){logger[_0x1c66('0x11')](_0x1c66('0xc'),_0x15642e,_0x26532c);_0xa5c8f2(_0x26532c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5d97ff2..28b0004 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 _0xe923=['./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4b98f5,_0x58984e){var _0x2b09f4=function(_0x5ad79c){while(--_0x5ad79c){_0x4b98f5['push'](_0x4b98f5['shift']());}};_0x2b09f4(++_0x58984e);}(_0xe923,0x129));var _0x3e92=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xe923[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x3e92('0x0'));var util=require(_0x3e92('0x1'));var path=require(_0x3e92('0x2'));var timeout=require(_0x3e92('0x3'));var express=require(_0x3e92('0x4'));var router=express[_0x3e92('0x5')]();var fs_extra=require(_0x3e92('0x6'));var auth=require(_0x3e92('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e92('0x8'));var controller=require(_0x3e92('0x9'));router[_0x3e92('0xa')]('/',auth[_0x3e92('0xb')](),controller[_0x3e92('0xc')]);router[_0x3e92('0xa')](_0x3e92('0xd'),auth['isAuthenticated'](),controller[_0x3e92('0xe')]);router[_0x3e92('0xf')]('/',auth[_0x3e92('0xb')](),controller['create']);router[_0x3e92('0x10')](_0x3e92('0xd'),auth[_0x3e92('0xb')](),controller[_0x3e92('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc5f3=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','create','put','/:id','delete','exports','multer','path'];(function(_0xfeb39,_0x1d20b7){var _0x167aa8=function(_0x54b506){while(--_0x54b506){_0xfeb39['push'](_0xfeb39['shift']());}};_0x167aa8(++_0x1d20b7);}(_0xc5f3,0xca));var _0x3c5f=function(_0x173f13,_0x4ea3cf){_0x173f13=_0x173f13-0x0;var _0x585942=_0xc5f3[_0x173f13];return _0x585942;};'use strict';var multer=require(_0x3c5f('0x0'));var util=require('util');var path=require(_0x3c5f('0x1'));var timeout=require(_0x3c5f('0x2'));var express=require('express');var router=express[_0x3c5f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c5f('0x4'));var interaction=require(_0x3c5f('0x5'));var config=require(_0x3c5f('0x6'));var controller=require(_0x3c5f('0x7'));router[_0x3c5f('0x8')]('/',auth[_0x3c5f('0x9')](),controller[_0x3c5f('0xa')]);router[_0x3c5f('0x8')]('/:id',auth[_0x3c5f('0x9')](),controller[_0x3c5f('0xb')]);router['post']('/',auth[_0x3c5f('0x9')](),controller[_0x3c5f('0xc')]);router[_0x3c5f('0xd')](_0x3c5f('0xe'),auth[_0x3c5f('0x9')](),controller['update']);router[_0x3c5f('0xf')](_0x3c5f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c5f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 4646936..51cc981 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 _0xec3f=['customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM'];(function(_0x2aeafb,_0xc8d478){var _0x2305ff=function(_0x4cab72){while(--_0x4cab72){_0x2aeafb['push'](_0x2aeafb['shift']());}};_0x2305ff(++_0xc8d478);}(_0xec3f,0x1a2));var _0xfec3=function(_0x237612,_0x5a9b96){_0x237612=_0x237612-0x0;var _0x1a97ca=_0xec3f[_0x237612];return _0x1a97ca;};'use strict';var Sequelize=require('sequelize');module[_0xfec3('0x0')]={'type':{'type':Sequelize[_0xfec3('0x1')]('string','variable',_0xfec3('0x2'),_0xfec3('0x3'),'picklist'),'defaultValue':_0xfec3('0x4')},'content':{'type':Sequelize[_0xfec3('0x5')]},'key':{'type':Sequelize[_0xfec3('0x5')]},'keyType':{'type':Sequelize[_0xfec3('0x1')](_0xfec3('0x4'),'variable',_0xfec3('0x2'))},'keyContent':{'type':Sequelize[_0xfec3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfec3('0x5')]},'customField':{'type':Sequelize[_0xfec3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7d36=['customVariable','keyValue','STRING','BOOLEAN','ENUM','string','variable'];(function(_0x54ca9c,_0x22a3ee){var _0x321e68=function(_0x54b713){while(--_0x54b713){_0x54ca9c['push'](_0x54ca9c['shift']());}};_0x321e68(++_0x22a3ee);}(_0x7d36,0xd6));var _0x67d3=function(_0x5baea8,_0x11573b){_0x5baea8=_0x5baea8-0x0;var _0x494194=_0x7d36[_0x5baea8];return _0x494194;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x67d3('0x0')](_0x67d3('0x1'),_0x67d3('0x2'),_0x67d3('0x3'),_0x67d3('0x4'),'picklist'),'defaultValue':_0x67d3('0x1')},'content':{'type':Sequelize[_0x67d3('0x5')]},'key':{'type':Sequelize[_0x67d3('0x5')]},'keyType':{'type':Sequelize[_0x67d3('0x0')](_0x67d3('0x1'),_0x67d3('0x2'),_0x67d3('0x3'))},'keyContent':{'type':Sequelize[_0x67d3('0x5')]},'idField':{'type':Sequelize[_0x67d3('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x67d3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x67d3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f287ef2..cf5642a 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 _0xdf1e=['apply','then','destroy','error','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','rimraf','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','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','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x390fdb,_0x26bf40){var _0x9b5d2a=function(_0xfe51a0){while(--_0xfe51a0){_0x390fdb['push'](_0x390fdb['shift']());}};_0x9b5d2a(++_0x26bf40);}(_0xdf1e,0x183));var _0xedf1=function(_0x5e32b4,_0x43ab9c){_0x5e32b4=_0x5e32b4-0x0;var _0xc2125a=_0xdf1e[_0x5e32b4];return _0xc2125a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedf1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedf1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xedf1('0x2'));var util=require(_0xedf1('0x3'));var path=require(_0xedf1('0x4'));var sox=require(_0xedf1('0x5'));var csv=require('to-csv');var ejs=require(_0xedf1('0x6'));var fs=require('fs');var fs_extra=require(_0xedf1('0x7'));var _=require('lodash');var squel=require(_0xedf1('0x8'));var crypto=require('crypto');var jsforce=require(_0xedf1('0x9'));var deskjs=require(_0xedf1('0xa'));var toCsv=require(_0xedf1('0xb'));var querystring=require(_0xedf1('0xc'));var Papa=require('papaparse');var Redis=require(_0xedf1('0xd'));var authService=require(_0xedf1('0xe'));var qs=require(_0xedf1('0xf'));var as=require(_0xedf1('0x10'));var hardwareService=require(_0xedf1('0x11'));var logger=require(_0xedf1('0x12'))(_0xedf1('0x13'));var utils=require(_0xedf1('0x14'));var config=require(_0xedf1('0x15'));var licenseUtil=require(_0xedf1('0x16'));var db=require(_0xedf1('0x17'))['db'];function respondWithStatusCode(_0x3fcbeb,_0x149c6c){_0x149c6c=_0x149c6c||0xcc;return function(_0xc699b3){if(_0xc699b3){return _0x3fcbeb[_0xedf1('0x18')](_0x149c6c);}return _0x3fcbeb[_0xedf1('0x19')](_0x149c6c)[_0xedf1('0x1a')]();};}function respondWithResult(_0x5a0bd3,_0x122845){_0x122845=_0x122845||0xc8;return function(_0x3696ed){if(_0x3696ed){return _0x5a0bd3['status'](_0x122845)[_0xedf1('0x1b')](_0x3696ed);}};}function respondWithFilteredResult(_0xc9ef7e,_0xd0347c){return function(_0x46d73a){if(_0x46d73a){var _0x18dd5f=typeof _0xd0347c[_0xedf1('0x1c')]===_0xedf1('0x1d')&&typeof _0xd0347c[_0xedf1('0x1e')]==='undefined';var _0x1381d7=_0x46d73a[_0xedf1('0x1f')];var _0x5836e2=_0x18dd5f?0x0:_0xd0347c[_0xedf1('0x1c')];var _0x4c48c1=_0x18dd5f?_0x46d73a[_0xedf1('0x1f')]:_0xd0347c[_0xedf1('0x1c')]+_0xd0347c[_0xedf1('0x1e')];var _0x31a004;if(_0x4c48c1>=_0x1381d7){_0x4c48c1=_0x1381d7;_0x31a004=0xc8;}else{_0x31a004=0xce;}_0xc9ef7e[_0xedf1('0x19')](_0x31a004);return _0xc9ef7e['set'](_0xedf1('0x20'),_0x5836e2+'-'+_0x4c48c1+'/'+_0x1381d7)[_0xedf1('0x1b')](_0x46d73a);}return null;};}function patchUpdates(_0x2a389d){return function(_0x25ab87){try{jsonpatch[_0xedf1('0x21')](_0x25ab87,_0x2a389d,!![]);}catch(_0x17cd3d){return BPromise['reject'](_0x17cd3d);}return _0x25ab87['save']();};}function saveUpdates(_0x1aaf68,_0x59494b){return function(_0x4708cf){if(_0x4708cf){return _0x4708cf['update'](_0x1aaf68)[_0xedf1('0x22')](function(_0x119dc0){return _0x119dc0;});}return null;};}function removeEntity(_0x45ad6d,_0x2e6362){return function(_0x42c784){if(_0x42c784){return _0x42c784[_0xedf1('0x23')]()[_0xedf1('0x22')](function(){_0x45ad6d[_0xedf1('0x19')](0xcc)[_0xedf1('0x1a')]();});}};}function handleEntityNotFound(_0xe60bb5,_0x18b69f){return function(_0x2c296a){if(!_0x2c296a){_0xe60bb5[_0xedf1('0x18')](0x194);}return _0x2c296a;};}function handleError(_0x3f0e90,_0x3df912){_0x3df912=_0x3df912||0x1f4;return function(_0x24d833){logger[_0xedf1('0x24')](_0x24d833['stack']);if(_0x24d833['name']){delete _0x24d833[_0xedf1('0x25')];}_0x3f0e90['status'](_0x3df912)[_0xedf1('0x26')](_0x24d833);};}exports['index']=function(_0x2b03d1,_0x357f88){var _0x2545ad={},_0x4ca61f={},_0x3ec293={'count':0x0,'rows':[]};var _0x589c51=_['map'](db[_0xedf1('0x27')][_0xedf1('0x28')],function(_0x132df1){return{'name':_0x132df1[_0xedf1('0x29')],'type':_0x132df1[_0xedf1('0x2a')][_0xedf1('0x2b')]};});_0x4ca61f[_0xedf1('0x2c')]=_[_0xedf1('0x2d')](_0x589c51,'name');_0x4ca61f[_0xedf1('0x2e')]=_[_0xedf1('0x2f')](_0x2b03d1[_0xedf1('0x2e')]);_0x4ca61f[_0xedf1('0x30')]=_[_0xedf1('0x31')](_0x4ca61f[_0xedf1('0x2c')],_0x4ca61f[_0xedf1('0x2e')]);_0x2545ad[_0xedf1('0x32')]=_[_0xedf1('0x31')](_0x4ca61f[_0xedf1('0x2c')],qs[_0xedf1('0x33')](_0x2b03d1[_0xedf1('0x2e')][_0xedf1('0x33')]));_0x2545ad['attributes']=_0x2545ad[_0xedf1('0x32')][_0xedf1('0x34')]?_0x2545ad[_0xedf1('0x32')]:_0x4ca61f[_0xedf1('0x2c')];if(!_0x2b03d1[_0xedf1('0x2e')]['hasOwnProperty'](_0xedf1('0x35'))){_0x2545ad[_0xedf1('0x1e')]=qs[_0xedf1('0x1e')](_0x2b03d1[_0xedf1('0x2e')][_0xedf1('0x1e')]);_0x2545ad[_0xedf1('0x1c')]=qs[_0xedf1('0x1c')](_0x2b03d1['query'][_0xedf1('0x1c')]);}_0x2545ad[_0xedf1('0x36')]=qs[_0xedf1('0x37')](_0x2b03d1[_0xedf1('0x2e')][_0xedf1('0x37')]);_0x2545ad[_0xedf1('0x38')]=qs['filters'](_[_0xedf1('0x39')](_0x2b03d1[_0xedf1('0x2e')],_0x4ca61f[_0xedf1('0x30')]),_0x589c51);if(_0x2b03d1[_0xedf1('0x2e')][_0xedf1('0x3a')]){_0x2545ad[_0xedf1('0x38')]=_[_0xedf1('0x3b')](_0x2545ad[_0xedf1('0x38')],{'$or':_['map'](_0x589c51,function(_0x1957ca){if(_0x1957ca[_0xedf1('0x2a')]!=='VIRTUAL'){var _0x40093b={};_0x40093b[_0x1957ca[_0xedf1('0x25')]]={'$like':'%'+_0x2b03d1['query']['filter']+'%'};return _0x40093b;}})});}_0x2545ad=_[_0xedf1('0x3b')]({},_0x2545ad,_0x2b03d1[_0xedf1('0x3c')]);var _0x34c92b={'where':_0x2545ad['where']};return db['VtigerField'][_0xedf1('0x1f')](_0x34c92b)['then'](function(_0x1ad748){_0x3ec293['count']=_0x1ad748;if(_0x2b03d1[_0xedf1('0x2e')][_0xedf1('0x3d')]){_0x2545ad['include']=[{'all':!![]}];}return db[_0xedf1('0x27')][_0xedf1('0x3e')](_0x2545ad);})[_0xedf1('0x22')](function(_0x183653){_0x3ec293['rows']=_0x183653;return _0x3ec293;})['then'](respondWithFilteredResult(_0x357f88,_0x2545ad))[_0xedf1('0x3f')](handleError(_0x357f88,null));};exports[_0xedf1('0x40')]=function(_0x4934ef,_0x42072b){var _0x27415f={'raw':!![],'where':{'id':_0x4934ef[_0xedf1('0x41')]['id']}},_0x502b8d={};_0x502b8d[_0xedf1('0x2c')]=_[_0xedf1('0x2f')](db['VtigerField'][_0xedf1('0x28')]);_0x502b8d[_0xedf1('0x2e')]=_[_0xedf1('0x2f')](_0x4934ef[_0xedf1('0x2e')]);_0x502b8d['filters']=_[_0xedf1('0x31')](_0x502b8d[_0xedf1('0x2c')],_0x502b8d[_0xedf1('0x2e')]);_0x27415f['attributes']=_[_0xedf1('0x31')](_0x502b8d[_0xedf1('0x2c')],qs['fields'](_0x4934ef['query'][_0xedf1('0x33')]));_0x27415f[_0xedf1('0x32')]=_0x27415f[_0xedf1('0x32')][_0xedf1('0x34')]?_0x27415f['attributes']:_0x502b8d[_0xedf1('0x2c')];if(_0x4934ef['query'][_0xedf1('0x3d')]){_0x27415f[_0xedf1('0x42')]=[{'all':!![]}];}_0x27415f=_['merge']({},_0x27415f,_0x4934ef['options']);return db[_0xedf1('0x27')][_0xedf1('0x43')](_0x27415f)[_0xedf1('0x22')](handleEntityNotFound(_0x42072b,null))[_0xedf1('0x22')](respondWithResult(_0x42072b,null))[_0xedf1('0x3f')](handleError(_0x42072b,null));};exports['create']=function(_0x53f109,_0x49d5ea){return db[_0xedf1('0x27')][_0xedf1('0x44')](_0x53f109[_0xedf1('0x45')],{})['then'](respondWithResult(_0x49d5ea,0xc9))[_0xedf1('0x3f')](handleError(_0x49d5ea,null));};exports['update']=function(_0x330380,_0x3d86f4){if(_0x330380[_0xedf1('0x45')]['id']){delete _0x330380[_0xedf1('0x45')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x330380['params']['id']}})[_0xedf1('0x22')](handleEntityNotFound(_0x3d86f4,null))[_0xedf1('0x22')](saveUpdates(_0x330380['body'],null))[_0xedf1('0x22')](respondWithResult(_0x3d86f4,null))[_0xedf1('0x3f')](handleError(_0x3d86f4,null));};exports[_0xedf1('0x23')]=function(_0x341207,_0xa54b2b){return db[_0xedf1('0x27')]['find']({'where':{'id':_0x341207[_0xedf1('0x41')]['id']}})[_0xedf1('0x22')](handleEntityNotFound(_0xa54b2b,null))['then'](removeEntity(_0xa54b2b,null))[_0xedf1('0x3f')](handleError(_0xa54b2b,null));}; \ No newline at end of file +var _0xce4d=['keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','VtigerField','rawAttributes','type','key','model','map','query'];(function(_0x239226,_0x2f03cf){var _0x12e157=function(_0x5ee817){while(--_0x5ee817){_0x239226['push'](_0x239226['shift']());}};_0x12e157(++_0x2f03cf);}(_0xce4d,0x64));var _0xdce4=function(_0x28a705,_0x480010){_0x28a705=_0x28a705-0x0;var _0x3b5ca9=_0xce4d[_0x28a705];return _0x3b5ca9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdce4('0x0'));var zipdir=require(_0xdce4('0x1'));var jsonpatch=require(_0xdce4('0x2'));var rp=require(_0xdce4('0x3'));var moment=require(_0xdce4('0x4'));var BPromise=require(_0xdce4('0x5'));var Mustache=require(_0xdce4('0x6'));var util=require(_0xdce4('0x7'));var path=require(_0xdce4('0x8'));var sox=require(_0xdce4('0x9'));var csv=require(_0xdce4('0xa'));var ejs=require(_0xdce4('0xb'));var fs=require('fs');var fs_extra=require(_0xdce4('0xc'));var _=require(_0xdce4('0xd'));var squel=require(_0xdce4('0xe'));var crypto=require(_0xdce4('0xf'));var jsforce=require(_0xdce4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xdce4('0xa'));var querystring=require(_0xdce4('0x11'));var Papa=require(_0xdce4('0x12'));var Redis=require(_0xdce4('0x13'));var authService=require(_0xdce4('0x14'));var qs=require(_0xdce4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdce4('0x16'));var config=require(_0xdce4('0x17'));var licenseUtil=require(_0xdce4('0x18'));var db=require(_0xdce4('0x19'))['db'];function respondWithStatusCode(_0x5bc063,_0x3bc956){_0x3bc956=_0x3bc956||0xcc;return function(_0x28e405){if(_0x28e405){return _0x5bc063[_0xdce4('0x1a')](_0x3bc956);}return _0x5bc063[_0xdce4('0x1b')](_0x3bc956)[_0xdce4('0x1c')]();};}function respondWithResult(_0x2771cf,_0x32a5f7){_0x32a5f7=_0x32a5f7||0xc8;return function(_0x3a55c5){if(_0x3a55c5){return _0x2771cf['status'](_0x32a5f7)['json'](_0x3a55c5);}};}function respondWithFilteredResult(_0x35cccb,_0xce939e){return function(_0x5fe899){if(_0x5fe899){var _0x530702=typeof _0xce939e['offset']===_0xdce4('0x1d')&&typeof _0xce939e[_0xdce4('0x1e')]===_0xdce4('0x1d');var _0x51f295=_0x5fe899['count'];var _0x44d4b4=_0x530702?0x0:_0xce939e[_0xdce4('0x1f')];var _0x2d29ee=_0x530702?_0x5fe899[_0xdce4('0x20')]:_0xce939e[_0xdce4('0x1f')]+_0xce939e[_0xdce4('0x1e')];var _0x138ce4;if(_0x2d29ee>=_0x51f295){_0x2d29ee=_0x51f295;_0x138ce4=0xc8;}else{_0x138ce4=0xce;}_0x35cccb['status'](_0x138ce4);return _0x35cccb['set'](_0xdce4('0x21'),_0x44d4b4+'-'+_0x2d29ee+'/'+_0x51f295)['json'](_0x5fe899);}return null;};}function patchUpdates(_0x20c775){return function(_0x4fc41f){try{jsonpatch[_0xdce4('0x22')](_0x4fc41f,_0x20c775,!![]);}catch(_0x42f97f){return BPromise[_0xdce4('0x23')](_0x42f97f);}return _0x4fc41f['save']();};}function saveUpdates(_0x15d228,_0x2f6ba5){return function(_0x3e3848){if(_0x3e3848){return _0x3e3848[_0xdce4('0x24')](_0x15d228)[_0xdce4('0x25')](function(_0x25293a){return _0x25293a;});}return null;};}function removeEntity(_0x4ac2ed,_0x52f0ce){return function(_0x367006){if(_0x367006){return _0x367006['destroy']()['then'](function(){_0x4ac2ed['status'](0xcc)[_0xdce4('0x1c')]();});}};}function handleEntityNotFound(_0x51bf1f,_0x4943d7){return function(_0x1e3cf1){if(!_0x1e3cf1){_0x51bf1f[_0xdce4('0x1a')](0x194);}return _0x1e3cf1;};}function handleError(_0x2b6161,_0x2f08c0){_0x2f08c0=_0x2f08c0||0x1f4;return function(_0x2a1cb4){logger[_0xdce4('0x26')](_0x2a1cb4[_0xdce4('0x27')]);if(_0x2a1cb4[_0xdce4('0x28')]){delete _0x2a1cb4['name'];}_0x2b6161[_0xdce4('0x1b')](_0x2f08c0)[_0xdce4('0x29')](_0x2a1cb4);};}exports[_0xdce4('0x2a')]=function(_0x2518b5,_0x598148){var _0xc0ac0f={},_0x3b987a={},_0x44e5a5={'count':0x0,'rows':[]};var _0x34a5b5=_['map'](db[_0xdce4('0x2b')][_0xdce4('0x2c')],function(_0x4e520a){return{'name':_0x4e520a['fieldName'],'type':_0x4e520a[_0xdce4('0x2d')][_0xdce4('0x2e')]};});_0x3b987a[_0xdce4('0x2f')]=_[_0xdce4('0x30')](_0x34a5b5,_0xdce4('0x28'));_0x3b987a[_0xdce4('0x31')]=_[_0xdce4('0x32')](_0x2518b5[_0xdce4('0x31')]);_0x3b987a[_0xdce4('0x33')]=_['intersection'](_0x3b987a[_0xdce4('0x2f')],_0x3b987a[_0xdce4('0x31')]);_0xc0ac0f[_0xdce4('0x34')]=_['intersection'](_0x3b987a['model'],qs['fields'](_0x2518b5[_0xdce4('0x31')][_0xdce4('0x35')]));_0xc0ac0f[_0xdce4('0x34')]=_0xc0ac0f[_0xdce4('0x34')][_0xdce4('0x36')]?_0xc0ac0f[_0xdce4('0x34')]:_0x3b987a[_0xdce4('0x2f')];if(!_0x2518b5[_0xdce4('0x31')][_0xdce4('0x37')](_0xdce4('0x38'))){_0xc0ac0f[_0xdce4('0x1e')]=qs['limit'](_0x2518b5[_0xdce4('0x31')]['limit']);_0xc0ac0f['offset']=qs[_0xdce4('0x1f')](_0x2518b5['query'][_0xdce4('0x1f')]);}_0xc0ac0f[_0xdce4('0x39')]=qs[_0xdce4('0x3a')](_0x2518b5[_0xdce4('0x31')][_0xdce4('0x3a')]);_0xc0ac0f[_0xdce4('0x3b')]=qs[_0xdce4('0x33')](_[_0xdce4('0x3c')](_0x2518b5[_0xdce4('0x31')],_0x3b987a[_0xdce4('0x33')]),_0x34a5b5);if(_0x2518b5[_0xdce4('0x31')]['filter']){_0xc0ac0f[_0xdce4('0x3b')]=_[_0xdce4('0x3d')](_0xc0ac0f[_0xdce4('0x3b')],{'$or':_[_0xdce4('0x30')](_0x34a5b5,function(_0xc76b66){if(_0xc76b66[_0xdce4('0x2d')]!==_0xdce4('0x3e')){var _0x23d234={};_0x23d234[_0xc76b66[_0xdce4('0x28')]]={'$like':'%'+_0x2518b5['query']['filter']+'%'};return _0x23d234;}})});}_0xc0ac0f=_[_0xdce4('0x3d')]({},_0xc0ac0f,_0x2518b5[_0xdce4('0x3f')]);var _0x38d863={'where':_0xc0ac0f[_0xdce4('0x3b')]};return db[_0xdce4('0x2b')][_0xdce4('0x20')](_0x38d863)[_0xdce4('0x25')](function(_0x2b15e9){_0x44e5a5[_0xdce4('0x20')]=_0x2b15e9;if(_0x2518b5[_0xdce4('0x31')][_0xdce4('0x40')]){_0xc0ac0f[_0xdce4('0x41')]=[{'all':!![]}];}return db[_0xdce4('0x2b')][_0xdce4('0x42')](_0xc0ac0f);})[_0xdce4('0x25')](function(_0x3e3b69){_0x44e5a5[_0xdce4('0x43')]=_0x3e3b69;return _0x44e5a5;})['then'](respondWithFilteredResult(_0x598148,_0xc0ac0f))[_0xdce4('0x44')](handleError(_0x598148,null));};exports[_0xdce4('0x45')]=function(_0x14d63f,_0x3328f4){var _0x447e5a={'raw':!![],'where':{'id':_0x14d63f['params']['id']}},_0x43fd05={};_0x43fd05['model']=_['keys'](db[_0xdce4('0x2b')][_0xdce4('0x2c')]);_0x43fd05[_0xdce4('0x31')]=_[_0xdce4('0x32')](_0x14d63f['query']);_0x43fd05[_0xdce4('0x33')]=_[_0xdce4('0x46')](_0x43fd05[_0xdce4('0x2f')],_0x43fd05['query']);_0x447e5a[_0xdce4('0x34')]=_[_0xdce4('0x46')](_0x43fd05[_0xdce4('0x2f')],qs['fields'](_0x14d63f[_0xdce4('0x31')][_0xdce4('0x35')]));_0x447e5a[_0xdce4('0x34')]=_0x447e5a['attributes'][_0xdce4('0x36')]?_0x447e5a[_0xdce4('0x34')]:_0x43fd05[_0xdce4('0x2f')];if(_0x14d63f[_0xdce4('0x31')][_0xdce4('0x40')]){_0x447e5a['include']=[{'all':!![]}];}_0x447e5a=_[_0xdce4('0x3d')]({},_0x447e5a,_0x14d63f[_0xdce4('0x3f')]);return db[_0xdce4('0x2b')][_0xdce4('0x47')](_0x447e5a)['then'](handleEntityNotFound(_0x3328f4,null))[_0xdce4('0x25')](respondWithResult(_0x3328f4,null))[_0xdce4('0x44')](handleError(_0x3328f4,null));};exports[_0xdce4('0x48')]=function(_0x4ac68d,_0x29d4f9){return db[_0xdce4('0x2b')][_0xdce4('0x48')](_0x4ac68d[_0xdce4('0x49')],{})[_0xdce4('0x25')](respondWithResult(_0x29d4f9,0xc9))[_0xdce4('0x44')](handleError(_0x29d4f9,null));};exports['update']=function(_0x36a9a8,_0x1849fc){if(_0x36a9a8[_0xdce4('0x49')]['id']){delete _0x36a9a8[_0xdce4('0x49')]['id'];}return db[_0xdce4('0x2b')][_0xdce4('0x47')]({'where':{'id':_0x36a9a8[_0xdce4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1849fc,null))['then'](saveUpdates(_0x36a9a8['body'],null))[_0xdce4('0x25')](respondWithResult(_0x1849fc,null))[_0xdce4('0x44')](handleError(_0x1849fc,null));};exports['destroy']=function(_0x1a4e28,_0x1dc8d9){return db['VtigerField']['find']({'where':{'id':_0x1a4e28['params']['id']}})['then'](handleEntityNotFound(_0x1dc8d9,null))[_0xdce4('0x25')](removeEntity(_0x1dc8d9,null))[_0xdce4('0x44')](handleError(_0x1dc8d9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index b900da4..1e20426 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 _0xfe79=['moment','path','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x3f73c2,_0x5ca7ed){var _0x416276=function(_0x14ff68){while(--_0x14ff68){_0x3f73c2['push'](_0x3f73c2['shift']());}};_0x416276(++_0x5ca7ed);}(_0xfe79,0x1e9));var _0x9fe7=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfe79[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0x9fe7('0x0'));var logger=require(_0x9fe7('0x1'))(_0x9fe7('0x2'));var moment=require(_0x9fe7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fe7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9fe7('0x5'));module['exports']=function(_0x2c4f37,_0x1f7c0c){return _0x2c4f37[_0x9fe7('0x6')](_0x9fe7('0x7'),attributes,{'tableName':_0x9fe7('0x8'),'paranoid':![],'indexes':[{'name':_0x9fe7('0x9'),'fields':[_0x9fe7('0xa'),_0x9fe7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51aa=['util','../../config/logger','moment','request-promise','path','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0xbbff23,_0x5b0a14){var _0x49ddf0=function(_0x27c11b){while(--_0x27c11b){_0xbbff23['push'](_0xbbff23['shift']());}};_0x49ddf0(++_0x5b0a14);}(_0x51aa,0xdf));var _0xa51a=function(_0xfa929,_0x19b64c){_0xfa929=_0xfa929-0x0;var _0x130411=_0x51aa[_0xfa929];return _0x130411;};'use strict';var _=require(_0xa51a('0x0'));var util=require(_0xa51a('0x1'));var logger=require(_0xa51a('0x2'))('api');var moment=require(_0xa51a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa51a('0x4'));var fs=require('fs');var path=require(_0xa51a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa51a('0x6'));module[_0xa51a('0x7')]=function(_0x4f0c77,_0x253759){return _0x4f0c77[_0xa51a('0x8')](_0xa51a('0x9'),attributes,{'tableName':_0xa51a('0xa'),'paranoid':![],'indexes':[{'name':_0xa51a('0xb'),'fields':[_0xa51a('0xc'),_0xa51a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index dbf5f06..2bf07e7 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 _0x5b69=['../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x50b7db,_0x179385){var _0x111b40=function(_0x19550d){while(--_0x19550d){_0x50b7db['push'](_0x50b7db['shift']());}};_0x111b40(++_0x179385);}(_0x5b69,0xbf));var _0x95b6=function(_0x29f9af,_0x4f3d10){_0x29f9af=_0x29f9af-0x0;var _0x56e4a8=_0x5b69[_0x29f9af];return _0x56e4a8;};'use strict';var _=require(_0x95b6('0x0'));var util=require(_0x95b6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x95b6('0x2'));var fs=require('fs');var Redis=require(_0x95b6('0x3'));var db=require(_0x95b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x95b6('0x5'))(_0x95b6('0x6'));var config=require(_0x95b6('0x7'));var jayson=require(_0x95b6('0x8'));var client=jayson['client'][_0x95b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366d69,_0x375998,_0x1aade8){return new BPromise(function(_0x428703,_0x5de542){return client[_0x95b6('0xa')](_0x366d69,_0x1aade8)[_0x95b6('0xb')](function(_0x58f191){logger['info'](_0x95b6('0xc'),_0x375998,_0x95b6('0xd'));logger[_0x95b6('0xe')](_0x95b6('0xf'),_0x375998,_0x95b6('0xd'),JSON[_0x95b6('0x10')](_0x58f191));if(_0x58f191['error']){if(_0x58f191[_0x95b6('0x11')]['code']===0x1f4){logger[_0x95b6('0x11')](_0x95b6('0xc'),_0x375998,_0x58f191[_0x95b6('0x11')][_0x95b6('0x12')]);return _0x5de542(_0x58f191[_0x95b6('0x11')][_0x95b6('0x12')]);}logger[_0x95b6('0x11')](_0x95b6('0xc'),_0x375998,_0x58f191['error']['message']);return _0x428703(_0x58f191['error'][_0x95b6('0x12')]);}else{logger[_0x95b6('0x13')](_0x95b6('0xc'),_0x375998,_0x95b6('0xd'));_0x428703(_0x58f191[_0x95b6('0x14')][_0x95b6('0x12')]);}})[_0x95b6('0x15')](function(_0x53560d){logger['error'](_0x95b6('0xc'),_0x375998,_0x53560d);_0x5de542(_0x53560d);});});} \ No newline at end of file +var _0xbb9d=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4e2b31,_0xe78c0b){var _0x48c756=function(_0x344139){while(--_0x344139){_0x4e2b31['push'](_0x4e2b31['shift']());}};_0x48c756(++_0xe78c0b);}(_0xbb9d,0x195));var _0xdbb9=function(_0x3e8e5d,_0x26f118){_0x3e8e5d=_0x3e8e5d-0x0;var _0x4f8f8c=_0xbb9d[_0x3e8e5d];return _0x4f8f8c;};'use strict';var _=require(_0xdbb9('0x0'));var util=require(_0xdbb9('0x1'));var moment=require('moment');var BPromise=require(_0xdbb9('0x2'));var rs=require(_0xdbb9('0x3'));var fs=require('fs');var Redis=require(_0xdbb9('0x4'));var db=require(_0xdbb9('0x5'))['db'];var utils=require(_0xdbb9('0x6'));var logger=require(_0xdbb9('0x7'))(_0xdbb9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdbb9('0x9'));var client=jayson[_0xdbb9('0xa')][_0xdbb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e8157,_0x27d52d,_0x43c131){return new BPromise(function(_0x1f99e2,_0xe3a393){return client[_0xdbb9('0xc')](_0x3e8157,_0x43c131)[_0xdbb9('0xd')](function(_0x28ef36){logger[_0xdbb9('0xe')](_0xdbb9('0xf'),_0x27d52d,'request\x20sent');logger['debug'](_0xdbb9('0x10'),_0x27d52d,'request\x20sent',JSON['stringify'](_0x28ef36));if(_0x28ef36[_0xdbb9('0x11')]){if(_0x28ef36[_0xdbb9('0x11')][_0xdbb9('0x12')]===0x1f4){logger[_0xdbb9('0x11')]('VtigerField,\x20%s,\x20%s',_0x27d52d,_0x28ef36['error'][_0xdbb9('0x13')]);return _0xe3a393(_0x28ef36[_0xdbb9('0x11')][_0xdbb9('0x13')]);}logger['error'](_0xdbb9('0xf'),_0x27d52d,_0x28ef36[_0xdbb9('0x11')][_0xdbb9('0x13')]);return _0x1f99e2(_0x28ef36[_0xdbb9('0x11')]['message']);}else{logger['info'](_0xdbb9('0xf'),_0x27d52d,_0xdbb9('0x14'));_0x1f99e2(_0x28ef36[_0xdbb9('0x15')]['message']);}})[_0xdbb9('0x16')](function(_0x2496d1){logger[_0xdbb9('0x11')](_0xdbb9('0xf'),_0x27d52d,_0x2496d1);_0xe3a393(_0x2496d1);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 81f3da7..6ad354d 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 _0x0a3e=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0x25f849,_0x5a709a){var _0x454bec=function(_0x5be32c){while(--_0x5be32c){_0x25f849['push'](_0x25f849['shift']());}};_0x454bec(++_0x5a709a);}(_0x0a3e,0xd6));var _0xe0a3=function(_0x3b10f6,_0x2e6ba9){_0x3b10f6=_0x3b10f6-0x0;var _0x5a60fe=_0x0a3e[_0x3b10f6];return _0x5a60fe;};'use strict';var multer=require(_0xe0a3('0x0'));var util=require(_0xe0a3('0x1'));var path=require(_0xe0a3('0x2'));var timeout=require(_0xe0a3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe0a3('0x4'));var auth=require(_0xe0a3('0x5'));var interaction=require(_0xe0a3('0x6'));var config=require(_0xe0a3('0x7'));var controller=require(_0xe0a3('0x8'));router[_0xe0a3('0x9')]('/',auth[_0xe0a3('0xa')](),controller[_0xe0a3('0xb')]);router[_0xe0a3('0x9')](_0xe0a3('0xc'),auth[_0xe0a3('0xa')](),controller[_0xe0a3('0xd')]);router[_0xe0a3('0x9')](_0xe0a3('0xe'),auth[_0xe0a3('0xa')](),controller[_0xe0a3('0xf')]);router[_0xe0a3('0x9')](_0xe0a3('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0xe0a3('0x11')]('/',auth[_0xe0a3('0xa')](),controller[_0xe0a3('0x12')]);router[_0xe0a3('0x11')](_0xe0a3('0xe'),auth[_0xe0a3('0xa')](),controller[_0xe0a3('0x13')]);router[_0xe0a3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe0a3('0x15')]);router[_0xe0a3('0x16')]('/:id',auth[_0xe0a3('0xa')](),controller[_0xe0a3('0x17')]);module[_0xe0a3('0x18')]=router; \ No newline at end of file +var _0x3623=['post','create','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'];(function(_0x52a391,_0x3ecdbe){var _0x562ff0=function(_0xcb052){while(--_0xcb052){_0x52a391['push'](_0x52a391['shift']());}};_0x562ff0(++_0x3ecdbe);}(_0x3623,0xaf));var _0x3362=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0x3623[_0x53b6ae];return _0x34f4b2;};'use strict';var multer=require(_0x3362('0x0'));var util=require(_0x3362('0x1'));var path=require(_0x3362('0x2'));var timeout=require(_0x3362('0x3'));var express=require(_0x3362('0x4'));var router=express[_0x3362('0x5')]();var fs_extra=require(_0x3362('0x6'));var auth=require(_0x3362('0x7'));var interaction=require(_0x3362('0x8'));var config=require(_0x3362('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x3362('0xa')]('/',auth[_0x3362('0xb')](),controller[_0x3362('0xc')]);router[_0x3362('0xa')](_0x3362('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x3362('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3362('0xa')](_0x3362('0xf'),auth[_0x3362('0xb')](),controller[_0x3362('0x10')]);router[_0x3362('0x11')]('/',auth[_0x3362('0xb')](),controller[_0x3362('0x12')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3362('0x13')](_0x3362('0xd'),auth['isAuthenticated'](),controller[_0x3362('0x14')]);router[_0x3362('0x15')](_0x3362('0xd'),auth[_0x3362('0xb')](),controller[_0x3362('0x16')]);module[_0x3362('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index a8310eb..f8f0dfb 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 _0xd1f8=['STRING','username','remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xd1f8[_0x2b8077];return _0x308091;};'use strict';var Sequelize=require(_0x8d1f('0x0'));module[_0x8d1f('0x1')]={'name':{'type':Sequelize[_0x8d1f('0x2')]},'description':{'type':Sequelize[_0x8d1f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8d1f('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8d1f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8d1f('0x4')},'authType':{'type':Sequelize['ENUM'](_0x8d1f('0x5'),_0x8d1f('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x8d1f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8d1f('0x7')](_0x8d1f('0x8'),_0x8d1f('0x9')),'defaultValue':_0x8d1f('0x8')}}; \ No newline at end of file +var _0x11f3=['exports','STRING','password','ENUM','integrationTab','sequelize'];(function(_0x45d024,_0x550d1d){var _0x14756b=function(_0x7c848c){while(--_0x7c848c){_0x45d024['push'](_0x45d024['shift']());}};_0x14756b(++_0x550d1d);}(_0x11f3,0x149));var _0x311f=function(_0x2f73d7,_0x55a1bd){_0x2f73d7=_0x2f73d7-0x0;var _0x58d74b=_0x11f3[_0x2f73d7];return _0x58d74b;};'use strict';var Sequelize=require(_0x311f('0x0'));module[_0x311f('0x1')]={'name':{'type':Sequelize[_0x311f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x311f('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x311f('0x2')]},'token':{'type':Sequelize[_0x311f('0x2')]},'remoteUri':{'type':Sequelize[_0x311f('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x311f('0x3'),'token'),'defaultValue':_0x311f('0x3')},'serverUrl':{'type':Sequelize[_0x311f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x311f('0x4')](_0x311f('0x5'),'newTab'),'defaultValue':_0x311f('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5cfaa18..da7ba80 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 _0x13f6=['where','pick','filters','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','show','params','find','catch','create','body','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','send','test','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x646ba9,_0x4e8f7d){var _0x49aa21=function(_0x5f2d31){while(--_0x5f2d31){_0x646ba9['push'](_0x646ba9['shift']());}};_0x49aa21(++_0x4e8f7d);}(_0x13f6,0x124));var _0x613f=function(_0x5dd5fe,_0x4488ea){_0x5dd5fe=_0x5dd5fe-0x0;var _0x16e288=_0x13f6[_0x5dd5fe];return _0x16e288;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c2a85,_0x517f57){_0x517f57=_0x517f57||0xcc;return function(_0x38d90a){if(_0x38d90a){return _0x4c2a85[_0x613f('0x16')](_0x517f57);}return _0x4c2a85[_0x613f('0x17')](_0x517f57)[_0x613f('0x18')]();};}function respondWithResult(_0x329fcf,_0x4a6fc){_0x4a6fc=_0x4a6fc||0xc8;return function(_0x305894){if(_0x305894){return _0x329fcf[_0x613f('0x17')](_0x4a6fc)[_0x613f('0x19')](_0x305894);}};}function respondWithFilteredResult(_0x1d68fd,_0x548218){return function(_0x3c9edf){if(_0x3c9edf){var _0x5d7c69=typeof _0x548218['offset']===_0x613f('0x1a')&&typeof _0x548218[_0x613f('0x1b')]==='undefined';var _0x39e417=_0x3c9edf['count'];var _0x62ebfe=_0x5d7c69?0x0:_0x548218[_0x613f('0x1c')];var _0x431266=_0x5d7c69?_0x3c9edf[_0x613f('0x1d')]:_0x548218[_0x613f('0x1c')]+_0x548218[_0x613f('0x1b')];var _0x4e412c;if(_0x431266>=_0x39e417){_0x431266=_0x39e417;_0x4e412c=0xc8;}else{_0x4e412c=0xce;}_0x1d68fd['status'](_0x4e412c);return _0x1d68fd[_0x613f('0x1e')]('Content-Range',_0x62ebfe+'-'+_0x431266+'/'+_0x39e417)['json'](_0x3c9edf);}return null;};}function patchUpdates(_0x3c9b58){return function(_0x446562){try{jsonpatch['apply'](_0x446562,_0x3c9b58,!![]);}catch(_0x19123f){return BPromise[_0x613f('0x1f')](_0x19123f);}return _0x446562[_0x613f('0x20')]();};}function saveUpdates(_0x48b28a,_0x5401c2){return function(_0x11f5f3){if(_0x11f5f3){return _0x11f5f3[_0x613f('0x21')](_0x48b28a)[_0x613f('0x22')](function(_0x51f376){return _0x51f376;});}return null;};}function removeEntity(_0x41104e,_0x33e0c6){return function(_0x30de90){if(_0x30de90){return _0x30de90[_0x613f('0x23')]()[_0x613f('0x22')](function(){_0x41104e['status'](0xcc)[_0x613f('0x18')]();});}};}function handleEntityNotFound(_0x204185,_0x51bba1){return function(_0x22035f){if(!_0x22035f){_0x204185[_0x613f('0x16')](0x194);}return _0x22035f;};}function handleError(_0x32e747,_0x4a878d){_0x4a878d=_0x4a878d||0x1f4;return function(_0x53e32b){logger['error'](_0x53e32b[_0x613f('0x24')]);if(_0x53e32b['name']){delete _0x53e32b[_0x613f('0x25')];}_0x32e747[_0x613f('0x17')](_0x4a878d)['send'](_0x53e32b);};}exports[_0x613f('0x26')]=function(_0x2551c1,_0x4c8aa1){var _0x4cff5d={},_0x4f892d={},_0x24be7c={'count':0x0,'rows':[]};var _0x7c1a94=_[_0x613f('0x27')](db['ZendeskAccount'][_0x613f('0x28')],function(_0x439478){return{'name':_0x439478[_0x613f('0x29')],'type':_0x439478[_0x613f('0x2a')]['key']};});_0x4f892d[_0x613f('0x2b')]=_[_0x613f('0x27')](_0x7c1a94,_0x613f('0x25'));_0x4f892d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x2551c1[_0x613f('0x2c')]);_0x4f892d['filters']=_[_0x613f('0x2e')](_0x4f892d[_0x613f('0x2b')],_0x4f892d[_0x613f('0x2c')]);_0x4cff5d['attributes']=_[_0x613f('0x2e')](_0x4f892d['model'],qs[_0x613f('0x2f')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x2f')]));_0x4cff5d[_0x613f('0x30')]=_0x4cff5d[_0x613f('0x30')][_0x613f('0x31')]?_0x4cff5d['attributes']:_0x4f892d[_0x613f('0x2b')];if(!_0x2551c1[_0x613f('0x2c')][_0x613f('0x32')](_0x613f('0x33'))){_0x4cff5d[_0x613f('0x1b')]=qs['limit'](_0x2551c1['query']['limit']);_0x4cff5d[_0x613f('0x1c')]=qs[_0x613f('0x1c')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x1c')]);}_0x4cff5d['order']=qs[_0x613f('0x34')](_0x2551c1[_0x613f('0x2c')]['sort']);_0x4cff5d[_0x613f('0x35')]=qs['filters'](_[_0x613f('0x36')](_0x2551c1['query'],_0x4f892d[_0x613f('0x37')]),_0x7c1a94);if(_0x2551c1['query'][_0x613f('0x38')]){_0x4cff5d[_0x613f('0x35')]=_[_0x613f('0x39')](_0x4cff5d['where'],{'$or':_[_0x613f('0x27')](_0x7c1a94,function(_0x2c6a0c){if(_0x2c6a0c[_0x613f('0x2a')]!==_0x613f('0x3a')){var _0x474432={};_0x474432[_0x2c6a0c[_0x613f('0x25')]]={'$like':'%'+_0x2551c1[_0x613f('0x2c')][_0x613f('0x38')]+'%'};return _0x474432;}})});}_0x4cff5d=_[_0x613f('0x39')]({},_0x4cff5d,_0x2551c1[_0x613f('0x3b')]);var _0x4da8d3={'where':_0x4cff5d[_0x613f('0x35')]};return db[_0x613f('0x3c')][_0x613f('0x1d')](_0x4da8d3)[_0x613f('0x22')](function(_0x301d33){_0x24be7c[_0x613f('0x1d')]=_0x301d33;if(_0x2551c1[_0x613f('0x2c')]['includeAll']){_0x4cff5d[_0x613f('0x3d')]=[{'all':!![]}];}return db[_0x613f('0x3c')][_0x613f('0x3e')](_0x4cff5d);})[_0x613f('0x22')](function(_0x59d34f){_0x24be7c[_0x613f('0x3f')]=_0x59d34f;return _0x24be7c;})[_0x613f('0x22')](respondWithFilteredResult(_0x4c8aa1,_0x4cff5d))['catch'](handleError(_0x4c8aa1,null));};exports[_0x613f('0x40')]=function(_0x18f427,_0x3bb605){var _0x2f584e={'raw':![],'where':{'id':_0x18f427[_0x613f('0x41')]['id']}},_0x3952c9={};_0x3952c9[_0x613f('0x2b')]=_[_0x613f('0x2d')](db[_0x613f('0x3c')][_0x613f('0x28')]);_0x3952c9[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x18f427[_0x613f('0x2c')]);_0x3952c9['filters']=_[_0x613f('0x2e')](_0x3952c9[_0x613f('0x2b')],_0x3952c9[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x30')]=_['intersection'](_0x3952c9[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x18f427[_0x613f('0x2c')][_0x613f('0x2f')]));_0x2f584e[_0x613f('0x30')]=_0x2f584e[_0x613f('0x30')][_0x613f('0x31')]?_0x2f584e[_0x613f('0x30')]:_0x3952c9[_0x613f('0x2b')];if(_0x18f427[_0x613f('0x2c')]['includeAll']){_0x2f584e['include']=[{'all':!![]}];}_0x2f584e=_[_0x613f('0x39')]({},_0x2f584e,_0x18f427[_0x613f('0x3b')]);return db['ZendeskAccount'][_0x613f('0x42')](_0x2f584e)[_0x613f('0x22')](handleEntityNotFound(_0x3bb605,null))[_0x613f('0x22')](respondWithResult(_0x3bb605,null))[_0x613f('0x43')](handleError(_0x3bb605,null));};exports[_0x613f('0x44')]=function(_0x1c0b07,_0x412dd4){return db[_0x613f('0x3c')][_0x613f('0x44')](_0x1c0b07[_0x613f('0x45')],{})[_0x613f('0x22')](respondWithResult(_0x412dd4,0xc9))[_0x613f('0x43')](handleError(_0x412dd4,null));};exports[_0x613f('0x21')]=function(_0x17f8e5,_0x1fd46c){if(_0x17f8e5[_0x613f('0x45')]['id']){delete _0x17f8e5[_0x613f('0x45')]['id'];}return db[_0x613f('0x3c')]['find']({'where':{'id':_0x17f8e5['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x1fd46c,null))[_0x613f('0x22')](saveUpdates(_0x17f8e5['body'],null))['then'](respondWithResult(_0x1fd46c,null))[_0x613f('0x43')](handleError(_0x1fd46c,null));};exports['destroy']=function(_0x513bf1,_0x6e006b){return db[_0x613f('0x3c')][_0x613f('0x42')]({'where':{'id':_0x513bf1['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x6e006b,null))[_0x613f('0x22')](removeEntity(_0x6e006b,null))['catch'](handleError(_0x6e006b,null));};exports['getConfigurations']=function(_0x1c0c8e,_0x30d7b1,_0x13b585){var _0x145009={};var _0x3f7ead={};var _0x395357;var _0x24d162;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c0c8e[_0x613f('0x41')]['id']}})['then'](handleEntityNotFound(_0x30d7b1,null))['then'](function(_0x387913){if(_0x387913){_0x395357=_0x387913;_0x3f7ead[_0x613f('0x2b')]=_[_0x613f('0x2d')](db['ZendeskConfiguration'][_0x613f('0x28')]);_0x3f7ead[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x1c0c8e[_0x613f('0x2c')]);_0x3f7ead[_0x613f('0x37')]=_[_0x613f('0x2e')](_0x3f7ead[_0x613f('0x2b')],_0x3f7ead['query']);_0x145009[_0x613f('0x30')]=_['intersection'](_0x3f7ead[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x2f')]));_0x145009[_0x613f('0x30')]=_0x145009[_0x613f('0x30')][_0x613f('0x31')]?_0x145009[_0x613f('0x30')]:_0x3f7ead[_0x613f('0x2b')];_0x145009[_0x613f('0x46')]=qs[_0x613f('0x34')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x34')]);_0x145009['where']=qs['filters'](_[_0x613f('0x36')](_0x1c0c8e['query'],_0x3f7ead[_0x613f('0x37')]));if(_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x38')]){_0x145009[_0x613f('0x35')]=_[_0x613f('0x39')](_0x145009[_0x613f('0x35')],{'$or':_[_0x613f('0x27')](_0x145009[_0x613f('0x30')],function(_0x3ababc){var _0x29bb88={};_0x29bb88[_0x3ababc]={'$like':'%'+_0x1c0c8e[_0x613f('0x2c')]['filter']+'%'};return _0x29bb88;})});}_0x145009=_[_0x613f('0x39')]({},_0x145009,_0x1c0c8e[_0x613f('0x3b')]);return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5a3ea1){if(_0x5a3ea1){_0x24d162=_0x5a3ea1[_0x613f('0x31')];if(!_0x1c0c8e[_0x613f('0x2c')]['hasOwnProperty']('nolimit')){_0x145009[_0x613f('0x1b')]=qs['limit'](_0x1c0c8e['query']['limit']);_0x145009[_0x613f('0x1c')]=qs['offset'](_0x1c0c8e['query']['offset']);}return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5bf4ce){if(_0x5bf4ce){return _0x5bf4ce?{'count':_0x24d162,'rows':_0x5bf4ce}:null;}})[_0x613f('0x22')](respondWithResult(_0x30d7b1,null))[_0x613f('0x43')](handleError(_0x30d7b1,null));};exports[_0x613f('0x48')]=function(_0x2a7ca7,_0x5b8712,_0x24f25c){if(_0x2a7ca7[_0x613f('0x45')]['id']){delete _0x2a7ca7['body']['id'];}return db[_0x613f('0x3c')][_0x613f('0x49')]({'where':{'id':_0x2a7ca7[_0x613f('0x41')]['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x5b8712,null))[_0x613f('0x22')](function(_0xdf8993){if(_0xdf8993){_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4a')]=_0xdf8993['id'];_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4b')]=integrations[_0x613f('0x4c')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4d')]=integrations[_0x613f('0x4e')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);return db[_0x613f('0x4f')][_0x613f('0x44')](_0x2a7ca7[_0x613f('0x45')],{'include':[{'model':db[_0x613f('0x50')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x613f('0x4d')}]});}return null;})[_0x613f('0x22')](respondWithResult(_0x5b8712,null))[_0x613f('0x43')](handleError(_0x5b8712,null));};exports[_0x613f('0x51')]=function(_0x4f28c7,_0x11d2f4,_0x29e5c8){var _0x3d8777='';return db[_0x613f('0x3c')]['findOne']({'where':{'id':_0x4f28c7[_0x613f('0x41')]['id']},'attributes':['id',_0x613f('0x52'),_0x613f('0x53'),_0x613f('0x54'),_0x613f('0x55'),_0x613f('0x56')]})[_0x613f('0x22')](handleEntityNotFound(_0x11d2f4,null))[_0x613f('0x22')](function(_0x5dc81a){if(_0x5dc81a){_0x3d8777=_0x5dc81a[_0x613f('0x56')];var _0x792bf3=_0x3d8777[_0x613f('0x57')](-0x1);if(_0x792bf3==='/'){_0x3d8777=_0x3d8777[_0x613f('0x58')](0x0,_0x3d8777[_0x613f('0x59')](_0x792bf3));}var _0x15ef2d={'method':_0x613f('0x5a'),'uri':util[_0x613f('0x5b')](_0x613f('0x5c'),_0x3d8777,_0x613f('0x5d')),'json':!![]};switch(_0x5dc81a['authType']){case _0x613f('0x53'):_0x15ef2d[_0x613f('0x5e')]={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x60'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x53')]))[_0x613f('0x61')](_0x613f('0x62')))};break;case _0x613f('0x54'):_0x15ef2d['headers']={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x63'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x54')]))[_0x613f('0x61')](_0x613f('0x62')))};break;default:throw new db[(_0x613f('0x64'))][(_0x613f('0x65'))](_0x613f('0x66'));}return rp(_0x15ef2d);}})[_0x613f('0x22')](function(_0x5b8563){if(_0x5b8563){var _0x30c62f=[_0x613f('0x67'),'description',_0x613f('0x68'),'assignee'];_[_0x613f('0x69')](_0x5b8563['ticket_fields'],function(_0x49cb13){return _0x30c62f[_0x613f('0x6a')](_0x49cb13[_0x613f('0x2a')]);});return{'count':_0x5b8563[_0x613f('0x5d')][_0x613f('0x31')],'rows':_[_0x613f('0x27')](_0x5b8563[_0x613f('0x5d')],function(_0x622812){return{'id':_0x622812['id'],'name':_0x622812['position']>0x7?_0x622812[_0x613f('0x6b')]:_0x622812[_0x613f('0x2a')],'custom':_0x622812[_0x613f('0x6c')]>0x7?!![]:![],'options':_0x622812[_0x613f('0x6d')]?_0x622812[_0x613f('0x6d')]:_0x622812['custom_field_options']?_0x622812[_0x613f('0x6e')]:[]};})};}})[_0x613f('0x22')](respondWithResult(_0x11d2f4,null))['catch'](function(_0x188be6){var _0x8073b2=_0x4f28c7[_0x613f('0x2c')]['test']?0x1f4:_0x188be6['statusCode']||0x1f4;logger['error'](_0x613f('0x6f'),_0x613f('0x51'),_0x8073b2,JSON['stringify'](_0x188be6));delete _0x188be6[_0x613f('0x25')];if(_0x8073b2===0x191){_0x8073b2=0x190;}_0x11d2f4[_0x613f('0x17')](_0x8073b2)[_0x613f('0x70')](_0x4f28c7['query'][_0x613f('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x188be6[_0x613f('0x72')]}:_0x188be6);});}; \ No newline at end of file +var _0xe706=['getConfigurations','findOne','ZendeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','password','headers','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','create','body','catch','params'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xe706,0xa3));var _0x6e70=function(_0x5b7e2e,_0x689e00){_0x5b7e2e=_0x5b7e2e-0x0;var _0x31c1a2=_0xe706[_0x5b7e2e];return _0x31c1a2;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['ZendeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['ZendeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'password',_0x6e70('0x5a'),_0x6e70('0x5b'),_0x6e70('0x5c')]})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x13c092){if(_0x13c092){_0x3249a5=_0x13c092[_0x6e70('0x5c')];var _0xd9b4a9=_0x3249a5[_0x6e70('0x5d')](-0x1);if(_0xd9b4a9==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5e')](0x0,_0x3249a5['lastIndexOf'](_0xd9b4a9));}var _0x44c877={'method':_0x6e70('0x5f'),'uri':util[_0x6e70('0x60')]('%s/%s',_0x3249a5,'ticket_fields'),'json':!![]};switch(_0x13c092[_0x6e70('0x5b')]){case _0x6e70('0x61'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util['format']('%s:%s',_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x61')]))['toString'](_0x6e70('0x64')))};break;case _0x6e70('0x5a'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util[_0x6e70('0x60')](_0x6e70('0x65'),_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x5a')]))[_0x6e70('0x66')](_0x6e70('0x64')))};break;default:throw new db[(_0x6e70('0x67'))][(_0x6e70('0x68'))](_0x6e70('0x69'));}return rp(_0x44c877);}})['then'](function(_0x5b3cb0){if(_0x5b3cb0){var _0x39ed95=['subject',_0x6e70('0x6a'),'group','assignee'];_[_0x6e70('0x6b')](_0x5b3cb0['ticket_fields'],function(_0x576069){return _0x39ed95[_0x6e70('0x6c')](_0x576069[_0x6e70('0x31')]);});return{'count':_0x5b3cb0[_0x6e70('0x6d')]['length'],'rows':_['map'](_0x5b3cb0['ticket_fields'],function(_0x3e7be7){return{'id':_0x3e7be7['id'],'name':_0x3e7be7['position']>0x7?_0x3e7be7[_0x6e70('0x6e')]:_0x3e7be7[_0x6e70('0x31')],'custom':_0x3e7be7[_0x6e70('0x6f')]>0x7?!![]:![],'options':_0x3e7be7[_0x6e70('0x70')]?_0x3e7be7[_0x6e70('0x70')]:_0x3e7be7[_0x6e70('0x71')]?_0x3e7be7[_0x6e70('0x71')]:[]};})};}})['then'](respondWithResult(_0x5b4046,null))[_0x6e70('0x4b')](function(_0x2493b0){var _0xb649a6=_0x531097['query'][_0x6e70('0x72')]?0x1f4:_0x2493b0[_0x6e70('0x73')]||0x1f4;logger[_0x6e70('0x74')](_0x6e70('0x75'),_0x6e70('0x58'),_0xb649a6,JSON[_0x6e70('0x76')](_0x2493b0));delete _0x2493b0[_0x6e70('0x2c')];if(_0xb649a6===0x191){_0xb649a6=0x190;}_0x5b4046[_0x6e70('0x23')](_0xb649a6)[_0x6e70('0x2d')](_0x531097['query'][_0x6e70('0x72')]?{'message':_0x6e70('0x77'),'statusCode':_0x2493b0['statusCode']}:_0x2493b0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index c79d49e..3eab81d 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 _0x94c5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts'];(function(_0x4f0424,_0x5c1815){var _0x47aeab=function(_0x335f21){while(--_0x335f21){_0x4f0424['push'](_0x4f0424['shift']());}};_0x47aeab(++_0x5c1815);}(_0x94c5,0x1e0));var _0x594c=function(_0x14ef79,_0x17fa9d){_0x14ef79=_0x14ef79-0x0;var _0x5561dc=_0x94c5[_0x14ef79];return _0x5561dc;};'use strict';var _=require('lodash');var util=require(_0x594c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x594c('0x1'));var BPromise=require(_0x594c('0x2'));var rp=require(_0x594c('0x3'));var fs=require('fs');var path=require(_0x594c('0x4'));var rimraf=require(_0x594c('0x5'));var config=require(_0x594c('0x6'));var attributes=require(_0x594c('0x7'));var integrations=require(_0x594c('0x8'));module[_0x594c('0x9')]=function(_0x32d354,_0x4863e4){return _0x32d354['define'](_0x594c('0xa'),attributes,{'tableName':_0x594c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49ee=['int_zendesk_accounts','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount'];(function(_0x51d5c2,_0x2a96e2){var _0x385aad=function(_0x504524){while(--_0x504524){_0x51d5c2['push'](_0x51d5c2['shift']());}};_0x385aad(++_0x2a96e2);}(_0x49ee,0x199));var _0xe49e=function(_0x6e28e2,_0xcdf57){_0x6e28e2=_0x6e28e2-0x0;var _0x5a0d23=_0x49ee[_0x6e28e2];return _0x5a0d23;};'use strict';var _=require(_0xe49e('0x0'));var util=require('util');var logger=require(_0xe49e('0x1'))(_0xe49e('0x2'));var moment=require('moment');var BPromise=require(_0xe49e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe49e('0x4'));var rimraf=require(_0xe49e('0x5'));var config=require(_0xe49e('0x6'));var attributes=require(_0xe49e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe49e('0x8')]=function(_0x19a144,_0x37e881){return _0x19a144[_0xe49e('0x9')](_0xe49e('0xa'),attributes,{'tableName':_0xe49e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 7a05e2e..628b7c6 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 _0x29b7=['debug','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowZendeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x29b7,0x17d));var _0x729b=function(_0x460d7b,_0x3f0a30){_0x460d7b=_0x460d7b-0x0;var _0x5e972f=_0x29b7[_0x460d7b];return _0x5e972f;};'use strict';var _=require('lodash');var util=require(_0x729b('0x0'));var moment=require(_0x729b('0x1'));var BPromise=require(_0x729b('0x2'));var rs=require(_0x729b('0x3'));var fs=require('fs');var Redis=require(_0x729b('0x4'));var db=require(_0x729b('0x5'))['db'];var utils=require(_0x729b('0x6'));var logger=require(_0x729b('0x7'))('rpc');var config=require(_0x729b('0x8'));var jayson=require(_0x729b('0x9'));var client=jayson['client'][_0x729b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x161396,_0xf72e6d,_0x2c4252){return new BPromise(function(_0x4d75fd,_0x3df326){return client[_0x729b('0xb')](_0x161396,_0x2c4252)[_0x729b('0xc')](function(_0x1ae4e3){logger[_0x729b('0xd')](_0x729b('0xe'),_0xf72e6d,'request\x20sent');logger[_0x729b('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xf72e6d,_0x729b('0x10'),JSON[_0x729b('0x11')](_0x1ae4e3));if(_0x1ae4e3[_0x729b('0x12')]){if(_0x1ae4e3['error'][_0x729b('0x13')]===0x1f4){logger[_0x729b('0x12')](_0x729b('0xe'),_0xf72e6d,_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);return _0x3df326(_0x1ae4e3['error'][_0x729b('0x14')]);}logger[_0x729b('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0xf72e6d,_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);return _0x4d75fd(_0x1ae4e3[_0x729b('0x12')][_0x729b('0x14')]);}else{logger[_0x729b('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0xf72e6d,'request\x20sent');_0x4d75fd(_0x1ae4e3[_0x729b('0x15')][_0x729b('0x14')]);}})[_0x729b('0x16')](function(_0x22b0d6){logger['error'](_0x729b('0xe'),_0xf72e6d,_0x22b0d6);_0x3df326(_0x22b0d6);});});}exports[_0x729b('0x17')]=function(_0x58fce1){var _0x10e303=this;return new Promise(function(_0x36a23e,_0x45af11){return db[_0x729b('0x18')][_0x729b('0x19')]({'raw':_0x58fce1['options']?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1b')]===undefined?!![]:![]:!![],'where':_0x58fce1['options']?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1c')]||null:null,'attributes':_0x58fce1['options']?_0x58fce1['options'][_0x729b('0x1d')]||null:null,'limit':_0x58fce1[_0x729b('0x1a')]?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1e')]||null:null,'include':_0x58fce1[_0x729b('0x1a')]?_0x58fce1[_0x729b('0x1a')][_0x729b('0x1f')]?_[_0x729b('0x20')](_0x58fce1['options'][_0x729b('0x1f')],function(_0x378c4d){return{'model':db[_0x378c4d[_0x729b('0x21')]],'as':_0x378c4d['as'],'attributes':_0x378c4d[_0x729b('0x1d')],'include':_0x378c4d[_0x729b('0x1f')]?_['map'](_0x378c4d[_0x729b('0x1f')],function(_0x2d127e){return{'model':db[_0x2d127e['model']],'as':_0x2d127e['as'],'attributes':_0x2d127e[_0x729b('0x1d')],'include':_0x2d127e['include']?_['map'](_0x2d127e[_0x729b('0x1f')],function(_0x376a22){return{'model':db[_0x376a22[_0x729b('0x21')]],'as':_0x376a22['as'],'attributes':_0x376a22[_0x729b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x729b('0xc')](function(_0x4ab773){logger[_0x729b('0xd')](_0x729b('0x17'),_0x58fce1);logger[_0x729b('0xf')](_0x729b('0x17'),_0x58fce1,JSON[_0x729b('0x11')](_0x4ab773));_0x36a23e(_0x4ab773);})[_0x729b('0x16')](function(_0x41fe6a){logger[_0x729b('0x12')]('GetZendeskAccount',_0x41fe6a[_0x729b('0x14')],_0x58fce1);_0x45af11(_0x10e303[_0x729b('0x12')](0x1f4,_0x41fe6a[_0x729b('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x18d4fa){var _0x277962=this;return new Promise(function(_0x3babe2,_0x52c9f9){return db[_0x729b('0x18')][_0x729b('0x22')]({'raw':_0x18d4fa['options']?_0x18d4fa[_0x729b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x18d4fa[_0x729b('0x1a')]?_0x18d4fa[_0x729b('0x1a')]['where']||null:null,'attributes':_0x18d4fa[_0x729b('0x1a')]?_0x18d4fa[_0x729b('0x1a')][_0x729b('0x1d')]||null:null,'include':_0x18d4fa[_0x729b('0x1a')]?_0x18d4fa[_0x729b('0x1a')][_0x729b('0x1f')]?_['map'](_0x18d4fa[_0x729b('0x1a')][_0x729b('0x1f')],function(_0x32522f){return{'model':db[_0x32522f[_0x729b('0x21')]],'as':_0x32522f['as'],'attributes':_0x32522f[_0x729b('0x1d')],'include':_0x32522f[_0x729b('0x1f')]?_['map'](_0x32522f[_0x729b('0x1f')],function(_0x21e3b7){return{'model':db[_0x21e3b7['model']],'as':_0x21e3b7['as'],'attributes':_0x21e3b7[_0x729b('0x1d')],'include':_0x21e3b7[_0x729b('0x1f')]?_['map'](_0x21e3b7[_0x729b('0x1f')],function(_0x27a9d8){return{'model':db[_0x27a9d8[_0x729b('0x21')]],'as':_0x27a9d8['as'],'attributes':_0x27a9d8[_0x729b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x729b('0xc')](function(_0x32dcc4){logger[_0x729b('0xd')](_0x729b('0x23'),_0x18d4fa);logger[_0x729b('0xf')](_0x729b('0x23'),_0x18d4fa,JSON['stringify'](_0x32dcc4));_0x3babe2(_0x32dcc4);})[_0x729b('0x16')](function(_0x3d824e){logger[_0x729b('0x12')](_0x729b('0x23'),_0x3d824e['message'],_0x18d4fa);_0x52c9f9(_0x277962[_0x729b('0x12')](0x1f4,_0x3d824e[_0x729b('0x14')]));});});}; \ No newline at end of file +var _0x7f81=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','debug','ShowZendeskAccount','find','catch','lodash'];(function(_0x242527,_0x205875){var _0x5bb2c8=function(_0x280343){while(--_0x280343){_0x242527['push'](_0x242527['shift']());}};_0x5bb2c8(++_0x205875);}(_0x7f81,0x185));var _0x17f8=function(_0x30e8d8,_0x471998){_0x30e8d8=_0x30e8d8-0x0;var _0x3da37e=_0x7f81[_0x30e8d8];return _0x3da37e;};'use strict';var _=require(_0x17f8('0x0'));var util=require(_0x17f8('0x1'));var moment=require(_0x17f8('0x2'));var BPromise=require(_0x17f8('0x3'));var rs=require(_0x17f8('0x4'));var fs=require('fs');var Redis=require(_0x17f8('0x5'));var db=require(_0x17f8('0x6'))['db'];var utils=require(_0x17f8('0x7'));var logger=require('../../config/logger')(_0x17f8('0x8'));var config=require(_0x17f8('0x9'));var jayson=require(_0x17f8('0xa'));var client=jayson[_0x17f8('0xb')][_0x17f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13027d,_0x59f048,_0x494fe2){return new BPromise(function(_0x15681c,_0x400894){return client[_0x17f8('0xd')](_0x13027d,_0x494fe2)[_0x17f8('0xe')](function(_0x352930){logger['info'](_0x17f8('0xf'),_0x59f048,_0x17f8('0x10'));logger['debug'](_0x17f8('0x11'),_0x59f048,'request\x20sent',JSON[_0x17f8('0x12')](_0x352930));if(_0x352930['error']){if(_0x352930[_0x17f8('0x13')][_0x17f8('0x14')]===0x1f4){logger['error'](_0x17f8('0xf'),_0x59f048,_0x352930[_0x17f8('0x13')][_0x17f8('0x15')]);return _0x400894(_0x352930['error'][_0x17f8('0x15')]);}logger[_0x17f8('0x13')](_0x17f8('0xf'),_0x59f048,_0x352930[_0x17f8('0x13')]['message']);return _0x15681c(_0x352930[_0x17f8('0x13')][_0x17f8('0x15')]);}else{logger[_0x17f8('0x16')](_0x17f8('0xf'),_0x59f048,'request\x20sent');_0x15681c(_0x352930[_0x17f8('0x17')]['message']);}})['catch'](function(_0x2a722f){logger['error'](_0x17f8('0xf'),_0x59f048,_0x2a722f);_0x400894(_0x2a722f);});});}exports['GetZendeskAccount']=function(_0x21dbfa){var _0x5d2352=this;return new Promise(function(_0x631531,_0x5a82fc){return db[_0x17f8('0x18')][_0x17f8('0x19')]({'raw':_0x21dbfa[_0x17f8('0x1a')]?_0x21dbfa[_0x17f8('0x1a')][_0x17f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x21dbfa[_0x17f8('0x1a')]?_0x21dbfa[_0x17f8('0x1a')][_0x17f8('0x1c')]||null:null,'attributes':_0x21dbfa[_0x17f8('0x1a')]?_0x21dbfa[_0x17f8('0x1a')][_0x17f8('0x1d')]||null:null,'limit':_0x21dbfa[_0x17f8('0x1a')]?_0x21dbfa['options'][_0x17f8('0x1e')]||null:null,'include':_0x21dbfa['options']?_0x21dbfa[_0x17f8('0x1a')][_0x17f8('0x1f')]?_[_0x17f8('0x20')](_0x21dbfa[_0x17f8('0x1a')][_0x17f8('0x1f')],function(_0x1e3276){return{'model':db[_0x1e3276['model']],'as':_0x1e3276['as'],'attributes':_0x1e3276[_0x17f8('0x1d')],'include':_0x1e3276['include']?_[_0x17f8('0x20')](_0x1e3276['include'],function(_0x489743){return{'model':db[_0x489743[_0x17f8('0x21')]],'as':_0x489743['as'],'attributes':_0x489743[_0x17f8('0x1d')],'include':_0x489743[_0x17f8('0x1f')]?_[_0x17f8('0x20')](_0x489743['include'],function(_0x57bcea){return{'model':db[_0x57bcea[_0x17f8('0x21')]],'as':_0x57bcea['as'],'attributes':_0x57bcea[_0x17f8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x17f8('0xe')](function(_0x4008cb){logger['info'](_0x17f8('0x22'),_0x21dbfa);logger[_0x17f8('0x23')](_0x17f8('0x22'),_0x21dbfa,JSON['stringify'](_0x4008cb));_0x631531(_0x4008cb);})['catch'](function(_0xeedecc){logger['error'](_0x17f8('0x22'),_0xeedecc[_0x17f8('0x15')],_0x21dbfa);_0x5a82fc(_0x5d2352[_0x17f8('0x13')](0x1f4,_0xeedecc[_0x17f8('0x15')]));});});};exports[_0x17f8('0x24')]=function(_0x52a37c){var _0x5dbf11=this;return new Promise(function(_0xa7ace0,_0x1f8181){return db['ZendeskAccount'][_0x17f8('0x25')]({'raw':_0x52a37c['options']?_0x52a37c[_0x17f8('0x1a')][_0x17f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x52a37c[_0x17f8('0x1a')]?_0x52a37c[_0x17f8('0x1a')][_0x17f8('0x1c')]||null:null,'attributes':_0x52a37c[_0x17f8('0x1a')]?_0x52a37c[_0x17f8('0x1a')][_0x17f8('0x1d')]||null:null,'include':_0x52a37c[_0x17f8('0x1a')]?_0x52a37c[_0x17f8('0x1a')][_0x17f8('0x1f')]?_[_0x17f8('0x20')](_0x52a37c[_0x17f8('0x1a')][_0x17f8('0x1f')],function(_0x45dd5d){return{'model':db[_0x45dd5d[_0x17f8('0x21')]],'as':_0x45dd5d['as'],'attributes':_0x45dd5d[_0x17f8('0x1d')],'include':_0x45dd5d[_0x17f8('0x1f')]?_['map'](_0x45dd5d[_0x17f8('0x1f')],function(_0x482098){return{'model':db[_0x482098[_0x17f8('0x21')]],'as':_0x482098['as'],'attributes':_0x482098['attributes'],'include':_0x482098[_0x17f8('0x1f')]?_['map'](_0x482098[_0x17f8('0x1f')],function(_0x4f4fc1){return{'model':db[_0x4f4fc1['model']],'as':_0x4f4fc1['as'],'attributes':_0x4f4fc1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x593005){logger[_0x17f8('0x16')](_0x17f8('0x24'),_0x52a37c);logger['debug'](_0x17f8('0x24'),_0x52a37c,JSON[_0x17f8('0x12')](_0x593005));_0xa7ace0(_0x593005);})[_0x17f8('0x26')](function(_0xf395c3){logger['error'](_0x17f8('0x24'),_0xf395c3[_0x17f8('0x15')],_0x52a37c);_0x1f8181(_0x5dbf11[_0x17f8('0x13')](0x1f4,_0xf395c3[_0x17f8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 28fdae6..28aeb7a 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 _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file +var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0xff360,_0xea8af4){var _0x37b9a1=function(_0x114abd){while(--_0x114abd){_0xff360['push'](_0xff360['shift']());}};_0x37b9a1(++_0xea8af4);}(_0x750a,0x140));var _0xa750=function(_0x1fb37e,_0x49de19){_0x1fb37e=_0x1fb37e-0x0;var _0x15177d=_0x750a[_0x1fb37e];return _0x15177d;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 79e51e5..4b8e1fd 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 _0x0362=['sequelize','exports','STRING'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x0362,0x1aa));var _0x2036=function(_0x3a7ebb,_0x556811){_0x3a7ebb=_0x3a7ebb-0x0;var _0x448f8a=_0x0362[_0x3a7ebb];return _0x448f8a;};'use strict';var Sequelize=require(_0x2036('0x0'));module[_0x2036('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2036('0x2')]}}; \ No newline at end of file +var _0x67f2=['sequelize','exports','STRING'];(function(_0xc03864,_0x162796){var _0x419790=function(_0x2fdafe){while(--_0x2fdafe){_0xc03864['push'](_0xc03864['shift']());}};_0x419790(++_0x162796);}(_0x67f2,0x13b));var _0x267f=function(_0x467eaf,_0x545018){_0x467eaf=_0x467eaf-0x0;var _0x3dd741=_0x67f2[_0x467eaf];return _0x3dd741;};'use strict';var Sequelize=require(_0x267f('0x0'));module[_0x267f('0x1')]={'name':{'type':Sequelize[_0x267f('0x2')]},'description':{'type':Sequelize[_0x267f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d492e8d..5240d66 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 _0xdca9=['../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','ZendeskConfiguration','intersection','fields','find','create','body','destroy','findOne','ZendeskField','getFields','getSubjects','getDescriptions','pick','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xdca9,0x134));var _0x9dca=function(_0x483ad2,_0x5034bc){_0x483ad2=_0x483ad2-0x0;var _0x1a5251=_0xdca9[_0x483ad2];return _0x1a5251;};'use strict';var emlformat=require(_0x9dca('0x0'));var rimraf=require(_0x9dca('0x1'));var zipdir=require(_0x9dca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9dca('0x3'));var moment=require(_0x9dca('0x4'));var BPromise=require(_0x9dca('0x5'));var Mustache=require(_0x9dca('0x6'));var util=require(_0x9dca('0x7'));var path=require(_0x9dca('0x8'));var sox=require(_0x9dca('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9dca('0xa'));var squel=require(_0x9dca('0xb'));var crypto=require(_0x9dca('0xc'));var jsforce=require(_0x9dca('0xd'));var deskjs=require(_0x9dca('0xe'));var toCsv=require(_0x9dca('0xf'));var querystring=require(_0x9dca('0x10'));var Papa=require(_0x9dca('0x11'));var Redis=require(_0x9dca('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9dca('0x13'));var hardwareService=require(_0x9dca('0x14'));var logger=require(_0x9dca('0x15'))(_0x9dca('0x16'));var utils=require('../../config/utils');var config=require(_0x9dca('0x17'));var licenseUtil=require(_0x9dca('0x18'));var db=require(_0x9dca('0x19'))['db'];function respondWithStatusCode(_0x4c15c3,_0x4bfb2a){_0x4bfb2a=_0x4bfb2a||0xcc;return function(_0x5b1d6b){if(_0x5b1d6b){return _0x4c15c3['sendStatus'](_0x4bfb2a);}return _0x4c15c3[_0x9dca('0x1a')](_0x4bfb2a)['end']();};}function respondWithResult(_0x4296a0,_0x117cca){_0x117cca=_0x117cca||0xc8;return function(_0x10dea0){if(_0x10dea0){return _0x4296a0[_0x9dca('0x1a')](_0x117cca)[_0x9dca('0x1b')](_0x10dea0);}};}function respondWithFilteredResult(_0x670d71,_0x9c9506){return function(_0x52180c){if(_0x52180c){var _0x42fdf5=typeof _0x9c9506[_0x9dca('0x1c')]==='undefined'&&typeof _0x9c9506[_0x9dca('0x1d')]===_0x9dca('0x1e');var _0x461b8b=_0x52180c['count'];var _0x6d0e8b=_0x42fdf5?0x0:_0x9c9506[_0x9dca('0x1c')];var _0x43539e=_0x42fdf5?_0x52180c[_0x9dca('0x1f')]:_0x9c9506[_0x9dca('0x1c')]+_0x9c9506['limit'];var _0x47fca8;if(_0x43539e>=_0x461b8b){_0x43539e=_0x461b8b;_0x47fca8=0xc8;}else{_0x47fca8=0xce;}_0x670d71['status'](_0x47fca8);return _0x670d71[_0x9dca('0x20')](_0x9dca('0x21'),_0x6d0e8b+'-'+_0x43539e+'/'+_0x461b8b)[_0x9dca('0x1b')](_0x52180c);}return null;};}function patchUpdates(_0x2aeac5){return function(_0x556104){try{jsonpatch['apply'](_0x556104,_0x2aeac5,!![]);}catch(_0x1d0f5f){return BPromise['reject'](_0x1d0f5f);}return _0x556104['save']();};}function saveUpdates(_0x2d0391,_0x50c86a){return function(_0x2b19b9){if(_0x2b19b9){return _0x2b19b9[_0x9dca('0x22')](_0x2d0391)['then'](function(_0x1ce1a7){return _0x1ce1a7;});}return null;};}function removeEntity(_0x25695a,_0x1ce905){return function(_0x145c40){if(_0x145c40){return _0x145c40['destroy']()[_0x9dca('0x23')](function(){_0x25695a[_0x9dca('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x272a6a,_0x5ba03f){return function(_0x509c18){if(!_0x509c18){_0x272a6a[_0x9dca('0x24')](0x194);}return _0x509c18;};}function handleError(_0x54626e,_0x3dec1f){_0x3dec1f=_0x3dec1f||0x1f4;return function(_0x1b26cb){logger[_0x9dca('0x25')](_0x1b26cb[_0x9dca('0x26')]);if(_0x1b26cb[_0x9dca('0x27')]){delete _0x1b26cb[_0x9dca('0x27')];}_0x54626e[_0x9dca('0x1a')](_0x3dec1f)[_0x9dca('0x28')](_0x1b26cb);};}exports[_0x9dca('0x29')]=function(_0x53a376,_0x1b4d05){var _0x413def={},_0x54f9d8={},_0x11de8c={'count':0x0,'rows':[]};var _0x44e732=_[_0x9dca('0x2a')](db['ZendeskConfiguration'][_0x9dca('0x2b')],function(_0x5ac119){return{'name':_0x5ac119['fieldName'],'type':_0x5ac119[_0x9dca('0x2c')][_0x9dca('0x2d')]};});_0x54f9d8[_0x9dca('0x2e')]=_[_0x9dca('0x2a')](_0x44e732,'name');_0x54f9d8[_0x9dca('0x2f')]=_[_0x9dca('0x30')](_0x53a376['query']);_0x54f9d8[_0x9dca('0x31')]=_['intersection'](_0x54f9d8[_0x9dca('0x2e')],_0x54f9d8['query']);_0x413def[_0x9dca('0x32')]=_['intersection'](_0x54f9d8['model'],qs['fields'](_0x53a376['query']['fields']));_0x413def[_0x9dca('0x32')]=_0x413def[_0x9dca('0x32')][_0x9dca('0x33')]?_0x413def[_0x9dca('0x32')]:_0x54f9d8[_0x9dca('0x2e')];if(!_0x53a376[_0x9dca('0x2f')][_0x9dca('0x34')](_0x9dca('0x35'))){_0x413def['limit']=qs[_0x9dca('0x1d')](_0x53a376[_0x9dca('0x2f')][_0x9dca('0x1d')]);_0x413def[_0x9dca('0x1c')]=qs[_0x9dca('0x1c')](_0x53a376[_0x9dca('0x2f')][_0x9dca('0x1c')]);}_0x413def[_0x9dca('0x36')]=qs['sort'](_0x53a376[_0x9dca('0x2f')][_0x9dca('0x37')]);_0x413def[_0x9dca('0x38')]=qs[_0x9dca('0x31')](_['pick'](_0x53a376[_0x9dca('0x2f')],_0x54f9d8['filters']),_0x44e732);if(_0x53a376['query'][_0x9dca('0x39')]){_0x413def['where']=_[_0x9dca('0x3a')](_0x413def[_0x9dca('0x38')],{'$or':_[_0x9dca('0x2a')](_0x44e732,function(_0x1b507b){if(_0x1b507b[_0x9dca('0x2c')]!=='VIRTUAL'){var _0x25ff05={};_0x25ff05[_0x1b507b[_0x9dca('0x27')]]={'$like':'%'+_0x53a376[_0x9dca('0x2f')][_0x9dca('0x39')]+'%'};return _0x25ff05;}})});}_0x413def=_[_0x9dca('0x3a')]({},_0x413def,_0x53a376[_0x9dca('0x3b')]);var _0x496118={'where':_0x413def[_0x9dca('0x38')]};return db['ZendeskConfiguration'][_0x9dca('0x1f')](_0x496118)[_0x9dca('0x23')](function(_0x17dcda){_0x11de8c[_0x9dca('0x1f')]=_0x17dcda;if(_0x53a376[_0x9dca('0x2f')][_0x9dca('0x3c')]){_0x413def[_0x9dca('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x9dca('0x3e')](_0x413def);})[_0x9dca('0x23')](function(_0x596a0a){_0x11de8c[_0x9dca('0x3f')]=_0x596a0a;return _0x11de8c;})[_0x9dca('0x23')](respondWithFilteredResult(_0x1b4d05,_0x413def))[_0x9dca('0x40')](handleError(_0x1b4d05,null));};exports['show']=function(_0x5cc8af,_0x4b536a){var _0x1023c2={'raw':![],'where':{'id':_0x5cc8af[_0x9dca('0x41')]['id']}},_0x2d9506={};_0x2d9506[_0x9dca('0x2e')]=_['keys'](db[_0x9dca('0x42')]['rawAttributes']);_0x2d9506[_0x9dca('0x2f')]=_[_0x9dca('0x30')](_0x5cc8af[_0x9dca('0x2f')]);_0x2d9506['filters']=_[_0x9dca('0x43')](_0x2d9506[_0x9dca('0x2e')],_0x2d9506[_0x9dca('0x2f')]);_0x1023c2[_0x9dca('0x32')]=_[_0x9dca('0x43')](_0x2d9506['model'],qs[_0x9dca('0x44')](_0x5cc8af['query']['fields']));_0x1023c2[_0x9dca('0x32')]=_0x1023c2[_0x9dca('0x32')]['length']?_0x1023c2[_0x9dca('0x32')]:_0x2d9506[_0x9dca('0x2e')];if(_0x5cc8af[_0x9dca('0x2f')][_0x9dca('0x3c')]){_0x1023c2[_0x9dca('0x3d')]=[{'all':!![]}];}_0x1023c2=_[_0x9dca('0x3a')]({},_0x1023c2,_0x5cc8af['options']);return db[_0x9dca('0x42')][_0x9dca('0x45')](_0x1023c2)[_0x9dca('0x23')](handleEntityNotFound(_0x4b536a,null))[_0x9dca('0x23')](respondWithResult(_0x4b536a,null))[_0x9dca('0x40')](handleError(_0x4b536a,null));};exports[_0x9dca('0x46')]=function(_0x309096,_0x252760){return db[_0x9dca('0x42')][_0x9dca('0x46')](_0x309096[_0x9dca('0x47')],{})[_0x9dca('0x23')](respondWithResult(_0x252760,0xc9))[_0x9dca('0x40')](handleError(_0x252760,null));};exports['update']=function(_0x490a29,_0x27e04d){if(_0x490a29['body']['id']){delete _0x490a29[_0x9dca('0x47')]['id'];}return db[_0x9dca('0x42')][_0x9dca('0x45')]({'where':{'id':_0x490a29[_0x9dca('0x41')]['id']}})[_0x9dca('0x23')](handleEntityNotFound(_0x27e04d,null))[_0x9dca('0x23')](saveUpdates(_0x490a29[_0x9dca('0x47')],null))[_0x9dca('0x23')](respondWithResult(_0x27e04d,null))[_0x9dca('0x40')](handleError(_0x27e04d,null));};exports[_0x9dca('0x48')]=function(_0x37edef,_0x56cffa){return db['ZendeskConfiguration']['find']({'where':{'id':_0x37edef[_0x9dca('0x41')]['id']}})[_0x9dca('0x23')](handleEntityNotFound(_0x56cffa,null))[_0x9dca('0x23')](removeEntity(_0x56cffa,null))['catch'](handleError(_0x56cffa,null));};exports['getFields']=function(_0x560391,_0x44c115,_0x2bb7f2){var _0x453dbc={};var _0x5777ae={};var _0x3c28ca;var _0x3a3ead;return db[_0x9dca('0x42')][_0x9dca('0x49')]({'where':{'id':_0x560391['params']['id']}})[_0x9dca('0x23')](handleEntityNotFound(_0x44c115,null))[_0x9dca('0x23')](function(_0x14a398){if(_0x14a398){_0x3c28ca=_0x14a398;_0x5777ae[_0x9dca('0x2e')]=_['keys'](db[_0x9dca('0x4a')][_0x9dca('0x2b')]);_0x5777ae[_0x9dca('0x2f')]=_['keys'](_0x560391[_0x9dca('0x2f')]);_0x5777ae[_0x9dca('0x31')]=_[_0x9dca('0x43')](_0x5777ae[_0x9dca('0x2e')],_0x5777ae['query']);_0x453dbc[_0x9dca('0x32')]=_[_0x9dca('0x43')](_0x5777ae[_0x9dca('0x2e')],qs[_0x9dca('0x44')](_0x560391[_0x9dca('0x2f')]['fields']));_0x453dbc[_0x9dca('0x32')]=_0x453dbc[_0x9dca('0x32')][_0x9dca('0x33')]?_0x453dbc[_0x9dca('0x32')]:_0x5777ae[_0x9dca('0x2e')];_0x453dbc[_0x9dca('0x36')]=qs['sort'](_0x560391['query'][_0x9dca('0x37')]);_0x453dbc['where']=qs['filters'](_['pick'](_0x560391[_0x9dca('0x2f')],_0x5777ae[_0x9dca('0x31')]));if(_0x560391[_0x9dca('0x2f')][_0x9dca('0x39')]){_0x453dbc['where']=_['merge'](_0x453dbc[_0x9dca('0x38')],{'$or':_['map'](_0x453dbc[_0x9dca('0x32')],function(_0x3f4461){var _0x114d09={};_0x114d09[_0x3f4461]={'$like':'%'+_0x560391['query']['filter']+'%'};return _0x114d09;})});}_0x453dbc=_['merge']({},_0x453dbc,_0x560391['options']);return _0x3c28ca[_0x9dca('0x4b')](_0x453dbc);}})[_0x9dca('0x23')](function(_0x3fd42c){if(_0x3fd42c){_0x3a3ead=_0x3fd42c[_0x9dca('0x33')];if(!_0x560391['query']['hasOwnProperty'](_0x9dca('0x35'))){_0x453dbc[_0x9dca('0x1d')]=qs[_0x9dca('0x1d')](_0x560391[_0x9dca('0x2f')][_0x9dca('0x1d')]);_0x453dbc[_0x9dca('0x1c')]=qs['offset'](_0x560391[_0x9dca('0x2f')][_0x9dca('0x1c')]);}return _0x3c28ca[_0x9dca('0x4b')](_0x453dbc);}})[_0x9dca('0x23')](function(_0x3cee3b){if(_0x3cee3b){return _0x3cee3b?{'count':_0x3a3ead,'rows':_0x3cee3b}:null;}})['then'](respondWithResult(_0x44c115,null))[_0x9dca('0x40')](handleError(_0x44c115,null));};exports['getSubjects']=function(_0x8bf8d4,_0x3e78ea,_0x3538bb){var _0x1bee55={};var _0x6cef22={};var _0x3971d5;var _0x254138;return db['ZendeskConfiguration'][_0x9dca('0x49')]({'where':{'id':_0x8bf8d4[_0x9dca('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e78ea,null))[_0x9dca('0x23')](function(_0x4618a2){if(_0x4618a2){_0x3971d5=_0x4618a2;_0x6cef22[_0x9dca('0x2e')]=_[_0x9dca('0x30')](db['ZendeskField'][_0x9dca('0x2b')]);_0x6cef22[_0x9dca('0x2f')]=_['keys'](_0x8bf8d4['query']);_0x6cef22[_0x9dca('0x31')]=_['intersection'](_0x6cef22[_0x9dca('0x2e')],_0x6cef22['query']);_0x1bee55[_0x9dca('0x32')]=_['intersection'](_0x6cef22['model'],qs[_0x9dca('0x44')](_0x8bf8d4[_0x9dca('0x2f')][_0x9dca('0x44')]));_0x1bee55[_0x9dca('0x32')]=_0x1bee55['attributes'][_0x9dca('0x33')]?_0x1bee55[_0x9dca('0x32')]:_0x6cef22[_0x9dca('0x2e')];_0x1bee55[_0x9dca('0x36')]=qs[_0x9dca('0x37')](_0x8bf8d4[_0x9dca('0x2f')][_0x9dca('0x37')]);_0x1bee55[_0x9dca('0x38')]=qs[_0x9dca('0x31')](_['pick'](_0x8bf8d4[_0x9dca('0x2f')],_0x6cef22['filters']));if(_0x8bf8d4[_0x9dca('0x2f')][_0x9dca('0x39')]){_0x1bee55[_0x9dca('0x38')]=_['merge'](_0x1bee55[_0x9dca('0x38')],{'$or':_[_0x9dca('0x2a')](_0x1bee55[_0x9dca('0x32')],function(_0x511102){var _0x587c01={};_0x587c01[_0x511102]={'$like':'%'+_0x8bf8d4[_0x9dca('0x2f')]['filter']+'%'};return _0x587c01;})});}_0x1bee55=_[_0x9dca('0x3a')]({},_0x1bee55,_0x8bf8d4[_0x9dca('0x3b')]);return _0x3971d5['getSubjects'](_0x1bee55);}})['then'](function(_0x5b3046){if(_0x5b3046){_0x254138=_0x5b3046['length'];if(!_0x8bf8d4[_0x9dca('0x2f')][_0x9dca('0x34')](_0x9dca('0x35'))){_0x1bee55[_0x9dca('0x1d')]=qs['limit'](_0x8bf8d4[_0x9dca('0x2f')][_0x9dca('0x1d')]);_0x1bee55[_0x9dca('0x1c')]=qs[_0x9dca('0x1c')](_0x8bf8d4['query']['offset']);}return _0x3971d5[_0x9dca('0x4c')](_0x1bee55);}})[_0x9dca('0x23')](function(_0x2a839b){if(_0x2a839b){return _0x2a839b?{'count':_0x254138,'rows':_0x2a839b}:null;}})['then'](respondWithResult(_0x3e78ea,null))['catch'](handleError(_0x3e78ea,null));};exports[_0x9dca('0x4d')]=function(_0x6b3c11,_0x594135,_0x23cc73){var _0x347292={};var _0xd41207={};var _0x57e225;var _0x457446;return db[_0x9dca('0x42')][_0x9dca('0x49')]({'where':{'id':_0x6b3c11[_0x9dca('0x41')]['id']}})[_0x9dca('0x23')](handleEntityNotFound(_0x594135,null))['then'](function(_0x1db99){if(_0x1db99){_0x57e225=_0x1db99;_0xd41207['model']=_[_0x9dca('0x30')](db['ZendeskField']['rawAttributes']);_0xd41207[_0x9dca('0x2f')]=_[_0x9dca('0x30')](_0x6b3c11[_0x9dca('0x2f')]);_0xd41207[_0x9dca('0x31')]=_[_0x9dca('0x43')](_0xd41207['model'],_0xd41207[_0x9dca('0x2f')]);_0x347292[_0x9dca('0x32')]=_[_0x9dca('0x43')](_0xd41207['model'],qs['fields'](_0x6b3c11[_0x9dca('0x2f')][_0x9dca('0x44')]));_0x347292[_0x9dca('0x32')]=_0x347292[_0x9dca('0x32')][_0x9dca('0x33')]?_0x347292[_0x9dca('0x32')]:_0xd41207[_0x9dca('0x2e')];_0x347292[_0x9dca('0x36')]=qs['sort'](_0x6b3c11[_0x9dca('0x2f')]['sort']);_0x347292[_0x9dca('0x38')]=qs[_0x9dca('0x31')](_[_0x9dca('0x4e')](_0x6b3c11['query'],_0xd41207[_0x9dca('0x31')]));if(_0x6b3c11[_0x9dca('0x2f')][_0x9dca('0x39')]){_0x347292[_0x9dca('0x38')]=_[_0x9dca('0x3a')](_0x347292[_0x9dca('0x38')],{'$or':_[_0x9dca('0x2a')](_0x347292[_0x9dca('0x32')],function(_0x579007){var _0x14f1c8={};_0x14f1c8[_0x579007]={'$like':'%'+_0x6b3c11['query'][_0x9dca('0x39')]+'%'};return _0x14f1c8;})});}_0x347292=_['merge']({},_0x347292,_0x6b3c11[_0x9dca('0x3b')]);return _0x57e225[_0x9dca('0x4d')](_0x347292);}})[_0x9dca('0x23')](function(_0x100724){if(_0x100724){_0x457446=_0x100724[_0x9dca('0x33')];if(!_0x6b3c11[_0x9dca('0x2f')][_0x9dca('0x34')](_0x9dca('0x35'))){_0x347292['limit']=qs[_0x9dca('0x1d')](_0x6b3c11[_0x9dca('0x2f')]['limit']);_0x347292[_0x9dca('0x1c')]=qs[_0x9dca('0x1c')](_0x6b3c11[_0x9dca('0x2f')][_0x9dca('0x1c')]);}return _0x57e225[_0x9dca('0x4d')](_0x347292);}})['then'](function(_0x1e50d6){if(_0x1e50d6){return _0x1e50d6?{'count':_0x457446,'rows':_0x1e50d6}:null;}})['then'](respondWithResult(_0x594135,null))[_0x9dca('0x40')](handleError(_0x594135,null));};exports[_0x9dca('0x4f')]=function(_0x24430e,_0x5bfba8,_0x5c0860){var _0x5a47e1={};var _0x3c92e0={};var _0x484c8c;var _0x5672fd;return db[_0x9dca('0x42')][_0x9dca('0x49')]({'where':{'id':_0x24430e[_0x9dca('0x41')]['id']}})[_0x9dca('0x23')](handleEntityNotFound(_0x5bfba8,null))['then'](function(_0x56244a){if(_0x56244a){_0x484c8c=_0x56244a;_0x3c92e0[_0x9dca('0x2e')]=_[_0x9dca('0x30')](db[_0x9dca('0x50')]['rawAttributes']);_0x3c92e0['query']=_[_0x9dca('0x30')](_0x24430e['query']);_0x3c92e0[_0x9dca('0x31')]=_[_0x9dca('0x43')](_0x3c92e0[_0x9dca('0x2e')],_0x3c92e0['query']);_0x5a47e1[_0x9dca('0x32')]=_[_0x9dca('0x43')](_0x3c92e0[_0x9dca('0x2e')],qs[_0x9dca('0x44')](_0x24430e[_0x9dca('0x2f')][_0x9dca('0x44')]));_0x5a47e1[_0x9dca('0x32')]=_0x5a47e1[_0x9dca('0x32')][_0x9dca('0x33')]?_0x5a47e1[_0x9dca('0x32')]:_0x3c92e0[_0x9dca('0x2e')];_0x5a47e1[_0x9dca('0x36')]=qs[_0x9dca('0x37')](_0x24430e[_0x9dca('0x2f')][_0x9dca('0x37')]);_0x5a47e1[_0x9dca('0x38')]=qs[_0x9dca('0x31')](_[_0x9dca('0x4e')](_0x24430e[_0x9dca('0x2f')],_0x3c92e0[_0x9dca('0x31')]));if(_0x24430e['query'][_0x9dca('0x39')]){_0x5a47e1['where']=_[_0x9dca('0x3a')](_0x5a47e1[_0x9dca('0x38')],{'$or':_[_0x9dca('0x2a')](_0x5a47e1[_0x9dca('0x32')],function(_0x14441b){var _0x4da02f={};_0x4da02f[_0x14441b]={'$like':'%'+_0x24430e['query'][_0x9dca('0x39')]+'%'};return _0x4da02f;})});}_0x5a47e1=_['merge']({},_0x5a47e1,_0x24430e[_0x9dca('0x3b')]);return _0x484c8c['getTags'](_0x5a47e1);}})['then'](function(_0x2217a8){if(_0x2217a8){_0x5672fd=_0x2217a8[_0x9dca('0x33')];if(!_0x24430e['query']['hasOwnProperty'](_0x9dca('0x35'))){_0x5a47e1[_0x9dca('0x1d')]=qs[_0x9dca('0x1d')](_0x24430e[_0x9dca('0x2f')]['limit']);_0x5a47e1[_0x9dca('0x1c')]=qs[_0x9dca('0x1c')](_0x24430e[_0x9dca('0x2f')][_0x9dca('0x1c')]);}return _0x484c8c[_0x9dca('0x4f')](_0x5a47e1);}})['then'](function(_0x26e6eb){if(_0x26e6eb){return _0x26e6eb?{'count':_0x5672fd,'rows':_0x26e6eb}:null;}})[_0x9dca('0x23')](respondWithResult(_0x5bfba8,null))[_0x9dca('0x40')](handleError(_0x5bfba8,null));};exports[_0x9dca('0x51')]=function(_0x202d56,_0x199028,_0x42f22b){if(_0x202d56['body']['id']){delete _0x202d56['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x202d56['params']['id']}})['then'](handleEntityNotFound(_0x199028,null))['then'](function(_0x23fc73){if(_0x23fc73){return _0x23fc73[_0x9dca('0x51')](_0x202d56[_0x9dca('0x47')][_0x9dca('0x52')]||[]);}return null;})[_0x9dca('0x23')](respondWithResult(_0x199028,null))[_0x9dca('0x40')](handleError(_0x199028,null));}; \ No newline at end of file +var _0xade3=['map','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','index'];(function(_0x5865ff,_0x42155b){var _0x43ac76=function(_0x7d3f8d){while(--_0x7d3f8d){_0x5865ff['push'](_0x5865ff['shift']());}};_0x43ac76(++_0x42155b);}(_0xade3,0x7f));var _0x3ade=function(_0x4468a2,_0x323622){_0x4468a2=_0x4468a2-0x0;var _0x210d91=_0xade3[_0x4468a2];return _0x210d91;};'use strict';var emlformat=require(_0x3ade('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ade('0x1'));var jsonpatch=require(_0x3ade('0x2'));var rp=require(_0x3ade('0x3'));var moment=require(_0x3ade('0x4'));var BPromise=require(_0x3ade('0x5'));var Mustache=require(_0x3ade('0x6'));var util=require(_0x3ade('0x7'));var path=require(_0x3ade('0x8'));var sox=require('sox');var csv=require(_0x3ade('0x9'));var ejs=require(_0x3ade('0xa'));var fs=require('fs');var fs_extra=require(_0x3ade('0xb'));var _=require(_0x3ade('0xc'));var squel=require('squel');var crypto=require(_0x3ade('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3ade('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ade('0xf'));var Redis=require(_0x3ade('0x10'));var authService=require(_0x3ade('0x11'));var qs=require(_0x3ade('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ade('0x13'));var logger=require(_0x3ade('0x14'))(_0x3ade('0x15'));var utils=require(_0x3ade('0x16'));var config=require(_0x3ade('0x17'));var licenseUtil=require(_0x3ade('0x18'));var db=require(_0x3ade('0x19'))['db'];function respondWithStatusCode(_0x51f3e2,_0x54253e){_0x54253e=_0x54253e||0xcc;return function(_0x268bb9){if(_0x268bb9){return _0x51f3e2[_0x3ade('0x1a')](_0x54253e);}return _0x51f3e2[_0x3ade('0x1b')](_0x54253e)[_0x3ade('0x1c')]();};}function respondWithResult(_0x3a2e33,_0x327983){_0x327983=_0x327983||0xc8;return function(_0x5ce580){if(_0x5ce580){return _0x3a2e33[_0x3ade('0x1b')](_0x327983)[_0x3ade('0x1d')](_0x5ce580);}};}function respondWithFilteredResult(_0x4eda65,_0x7a5e1a){return function(_0x42803f){if(_0x42803f){var _0x5c204e=typeof _0x7a5e1a[_0x3ade('0x1e')]===_0x3ade('0x1f')&&typeof _0x7a5e1a['limit']==='undefined';var _0x1c84af=_0x42803f[_0x3ade('0x20')];var _0x94689c=_0x5c204e?0x0:_0x7a5e1a[_0x3ade('0x1e')];var _0x160faf=_0x5c204e?_0x42803f[_0x3ade('0x20')]:_0x7a5e1a[_0x3ade('0x1e')]+_0x7a5e1a[_0x3ade('0x21')];var _0x92a74d;if(_0x160faf>=_0x1c84af){_0x160faf=_0x1c84af;_0x92a74d=0xc8;}else{_0x92a74d=0xce;}_0x4eda65[_0x3ade('0x1b')](_0x92a74d);return _0x4eda65[_0x3ade('0x22')](_0x3ade('0x23'),_0x94689c+'-'+_0x160faf+'/'+_0x1c84af)[_0x3ade('0x1d')](_0x42803f);}return null;};}function patchUpdates(_0x2f30ff){return function(_0x2a29ce){try{jsonpatch[_0x3ade('0x24')](_0x2a29ce,_0x2f30ff,!![]);}catch(_0xe628d0){return BPromise['reject'](_0xe628d0);}return _0x2a29ce[_0x3ade('0x25')]();};}function saveUpdates(_0x3917d6,_0x171907){return function(_0x3856f2){if(_0x3856f2){return _0x3856f2[_0x3ade('0x26')](_0x3917d6)['then'](function(_0x9c8c28){return _0x9c8c28;});}return null;};}function removeEntity(_0x5038b5,_0x2e96db){return function(_0x390da4){if(_0x390da4){return _0x390da4[_0x3ade('0x27')]()[_0x3ade('0x28')](function(){_0x5038b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3581ed,_0x35f4b6){return function(_0x128b2c){if(!_0x128b2c){_0x3581ed['sendStatus'](0x194);}return _0x128b2c;};}function handleError(_0x54b1e7,_0x28ff89){_0x28ff89=_0x28ff89||0x1f4;return function(_0x14891b){logger[_0x3ade('0x29')](_0x14891b[_0x3ade('0x2a')]);if(_0x14891b[_0x3ade('0x2b')]){delete _0x14891b[_0x3ade('0x2b')];}_0x54b1e7[_0x3ade('0x1b')](_0x28ff89)['send'](_0x14891b);};}exports[_0x3ade('0x2c')]=function(_0x11b57d,_0x35026d){var _0x2e9b38={},_0x281eb0={},_0x47f951={'count':0x0,'rows':[]};var _0x1fb352=_[_0x3ade('0x2d')](db[_0x3ade('0x2e')]['rawAttributes'],function(_0xbd941d){return{'name':_0xbd941d[_0x3ade('0x2f')],'type':_0xbd941d[_0x3ade('0x30')][_0x3ade('0x31')]};});_0x281eb0[_0x3ade('0x32')]=_['map'](_0x1fb352,'name');_0x281eb0[_0x3ade('0x33')]=_[_0x3ade('0x34')](_0x11b57d[_0x3ade('0x33')]);_0x281eb0[_0x3ade('0x35')]=_['intersection'](_0x281eb0[_0x3ade('0x32')],_0x281eb0[_0x3ade('0x33')]);_0x2e9b38['attributes']=_[_0x3ade('0x36')](_0x281eb0[_0x3ade('0x32')],qs[_0x3ade('0x37')](_0x11b57d[_0x3ade('0x33')][_0x3ade('0x37')]));_0x2e9b38[_0x3ade('0x38')]=_0x2e9b38[_0x3ade('0x38')]['length']?_0x2e9b38[_0x3ade('0x38')]:_0x281eb0[_0x3ade('0x32')];if(!_0x11b57d['query'][_0x3ade('0x39')](_0x3ade('0x3a'))){_0x2e9b38[_0x3ade('0x21')]=qs[_0x3ade('0x21')](_0x11b57d[_0x3ade('0x33')][_0x3ade('0x21')]);_0x2e9b38['offset']=qs[_0x3ade('0x1e')](_0x11b57d[_0x3ade('0x33')]['offset']);}_0x2e9b38[_0x3ade('0x3b')]=qs[_0x3ade('0x3c')](_0x11b57d[_0x3ade('0x33')][_0x3ade('0x3c')]);_0x2e9b38['where']=qs[_0x3ade('0x35')](_[_0x3ade('0x3d')](_0x11b57d[_0x3ade('0x33')],_0x281eb0[_0x3ade('0x35')]),_0x1fb352);if(_0x11b57d[_0x3ade('0x33')][_0x3ade('0x3e')]){_0x2e9b38[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x2e9b38[_0x3ade('0x3f')],{'$or':_[_0x3ade('0x2d')](_0x1fb352,function(_0x37605b){if(_0x37605b[_0x3ade('0x30')]!==_0x3ade('0x41')){var _0x280844={};_0x280844[_0x37605b[_0x3ade('0x2b')]]={'$like':'%'+_0x11b57d[_0x3ade('0x33')]['filter']+'%'};return _0x280844;}})});}_0x2e9b38=_['merge']({},_0x2e9b38,_0x11b57d['options']);var _0x2c9978={'where':_0x2e9b38['where']};return db[_0x3ade('0x2e')][_0x3ade('0x20')](_0x2c9978)[_0x3ade('0x28')](function(_0x3814ac){_0x47f951[_0x3ade('0x20')]=_0x3814ac;if(_0x11b57d['query'][_0x3ade('0x42')]){_0x2e9b38['include']=[{'all':!![]}];}return db[_0x3ade('0x2e')][_0x3ade('0x43')](_0x2e9b38);})[_0x3ade('0x28')](function(_0x375a33){_0x47f951[_0x3ade('0x44')]=_0x375a33;return _0x47f951;})['then'](respondWithFilteredResult(_0x35026d,_0x2e9b38))[_0x3ade('0x45')](handleError(_0x35026d,null));};exports[_0x3ade('0x46')]=function(_0x3337b6,_0x16b1cc){var _0xdd58cc={'raw':![],'where':{'id':_0x3337b6[_0x3ade('0x47')]['id']}},_0x2f6f13={};_0x2f6f13[_0x3ade('0x32')]=_[_0x3ade('0x34')](db['ZendeskConfiguration'][_0x3ade('0x48')]);_0x2f6f13[_0x3ade('0x33')]=_[_0x3ade('0x34')](_0x3337b6[_0x3ade('0x33')]);_0x2f6f13[_0x3ade('0x35')]=_[_0x3ade('0x36')](_0x2f6f13[_0x3ade('0x32')],_0x2f6f13[_0x3ade('0x33')]);_0xdd58cc['attributes']=_[_0x3ade('0x36')](_0x2f6f13[_0x3ade('0x32')],qs[_0x3ade('0x37')](_0x3337b6[_0x3ade('0x33')][_0x3ade('0x37')]));_0xdd58cc['attributes']=_0xdd58cc[_0x3ade('0x38')][_0x3ade('0x49')]?_0xdd58cc[_0x3ade('0x38')]:_0x2f6f13[_0x3ade('0x32')];if(_0x3337b6['query'][_0x3ade('0x42')]){_0xdd58cc[_0x3ade('0x4a')]=[{'all':!![]}];}_0xdd58cc=_[_0x3ade('0x40')]({},_0xdd58cc,_0x3337b6[_0x3ade('0x4b')]);return db[_0x3ade('0x2e')][_0x3ade('0x4c')](_0xdd58cc)['then'](handleEntityNotFound(_0x16b1cc,null))[_0x3ade('0x28')](respondWithResult(_0x16b1cc,null))['catch'](handleError(_0x16b1cc,null));};exports[_0x3ade('0x4d')]=function(_0x5d96c5,_0xcbc700){return db[_0x3ade('0x2e')][_0x3ade('0x4d')](_0x5d96c5[_0x3ade('0x4e')],{})[_0x3ade('0x28')](respondWithResult(_0xcbc700,0xc9))['catch'](handleError(_0xcbc700,null));};exports[_0x3ade('0x26')]=function(_0x6c7430,_0xddd03d){if(_0x6c7430['body']['id']){delete _0x6c7430['body']['id'];}return db[_0x3ade('0x2e')]['find']({'where':{'id':_0x6c7430['params']['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0xddd03d,null))[_0x3ade('0x28')](saveUpdates(_0x6c7430[_0x3ade('0x4e')],null))[_0x3ade('0x28')](respondWithResult(_0xddd03d,null))[_0x3ade('0x45')](handleError(_0xddd03d,null));};exports[_0x3ade('0x27')]=function(_0xca148d,_0x36d817){return db[_0x3ade('0x2e')][_0x3ade('0x4c')]({'where':{'id':_0xca148d['params']['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0x36d817,null))[_0x3ade('0x28')](removeEntity(_0x36d817,null))['catch'](handleError(_0x36d817,null));};exports['getFields']=function(_0x2e755e,_0x496fff,_0x490c94){var _0x34b0f5={};var _0x5e2412={};var _0x2d52f0;var _0x4edf00;return db[_0x3ade('0x2e')][_0x3ade('0x4f')]({'where':{'id':_0x2e755e['params']['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0x496fff,null))[_0x3ade('0x28')](function(_0x1f5acf){if(_0x1f5acf){_0x2d52f0=_0x1f5acf;_0x5e2412[_0x3ade('0x32')]=_[_0x3ade('0x34')](db[_0x3ade('0x50')][_0x3ade('0x48')]);_0x5e2412['query']=_[_0x3ade('0x34')](_0x2e755e[_0x3ade('0x33')]);_0x5e2412[_0x3ade('0x35')]=_[_0x3ade('0x36')](_0x5e2412['model'],_0x5e2412[_0x3ade('0x33')]);_0x34b0f5[_0x3ade('0x38')]=_[_0x3ade('0x36')](_0x5e2412[_0x3ade('0x32')],qs['fields'](_0x2e755e['query'][_0x3ade('0x37')]));_0x34b0f5[_0x3ade('0x38')]=_0x34b0f5[_0x3ade('0x38')][_0x3ade('0x49')]?_0x34b0f5[_0x3ade('0x38')]:_0x5e2412['model'];_0x34b0f5['order']=qs[_0x3ade('0x3c')](_0x2e755e[_0x3ade('0x33')]['sort']);_0x34b0f5[_0x3ade('0x3f')]=qs[_0x3ade('0x35')](_[_0x3ade('0x3d')](_0x2e755e[_0x3ade('0x33')],_0x5e2412['filters']));if(_0x2e755e[_0x3ade('0x33')]['filter']){_0x34b0f5['where']=_[_0x3ade('0x40')](_0x34b0f5[_0x3ade('0x3f')],{'$or':_['map'](_0x34b0f5[_0x3ade('0x38')],function(_0x2fee3d){var _0x54ba6f={};_0x54ba6f[_0x2fee3d]={'$like':'%'+_0x2e755e['query'][_0x3ade('0x3e')]+'%'};return _0x54ba6f;})});}_0x34b0f5=_['merge']({},_0x34b0f5,_0x2e755e[_0x3ade('0x4b')]);return _0x2d52f0['getFields'](_0x34b0f5);}})[_0x3ade('0x28')](function(_0x3d96ee){if(_0x3d96ee){_0x4edf00=_0x3d96ee[_0x3ade('0x49')];if(!_0x2e755e[_0x3ade('0x33')][_0x3ade('0x39')](_0x3ade('0x3a'))){_0x34b0f5[_0x3ade('0x21')]=qs[_0x3ade('0x21')](_0x2e755e[_0x3ade('0x33')][_0x3ade('0x21')]);_0x34b0f5[_0x3ade('0x1e')]=qs[_0x3ade('0x1e')](_0x2e755e[_0x3ade('0x33')][_0x3ade('0x1e')]);}return _0x2d52f0['getFields'](_0x34b0f5);}})['then'](function(_0x310cb3){if(_0x310cb3){return _0x310cb3?{'count':_0x4edf00,'rows':_0x310cb3}:null;}})[_0x3ade('0x28')](respondWithResult(_0x496fff,null))['catch'](handleError(_0x496fff,null));};exports[_0x3ade('0x51')]=function(_0x169e24,_0x5cccf7,_0x366da0){var _0x17615e={};var _0xfac5b={};var _0x1208a8;var _0x417dda;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x169e24[_0x3ade('0x47')]['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0x5cccf7,null))['then'](function(_0x74200b){if(_0x74200b){_0x1208a8=_0x74200b;_0xfac5b[_0x3ade('0x32')]=_[_0x3ade('0x34')](db[_0x3ade('0x50')][_0x3ade('0x48')]);_0xfac5b[_0x3ade('0x33')]=_['keys'](_0x169e24[_0x3ade('0x33')]);_0xfac5b['filters']=_['intersection'](_0xfac5b[_0x3ade('0x32')],_0xfac5b['query']);_0x17615e[_0x3ade('0x38')]=_[_0x3ade('0x36')](_0xfac5b[_0x3ade('0x32')],qs[_0x3ade('0x37')](_0x169e24[_0x3ade('0x33')][_0x3ade('0x37')]));_0x17615e[_0x3ade('0x38')]=_0x17615e['attributes'][_0x3ade('0x49')]?_0x17615e[_0x3ade('0x38')]:_0xfac5b[_0x3ade('0x32')];_0x17615e[_0x3ade('0x3b')]=qs[_0x3ade('0x3c')](_0x169e24['query'][_0x3ade('0x3c')]);_0x17615e[_0x3ade('0x3f')]=qs[_0x3ade('0x35')](_[_0x3ade('0x3d')](_0x169e24['query'],_0xfac5b['filters']));if(_0x169e24[_0x3ade('0x33')][_0x3ade('0x3e')]){_0x17615e[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x17615e[_0x3ade('0x3f')],{'$or':_[_0x3ade('0x2d')](_0x17615e['attributes'],function(_0x11fe04){var _0x4f4a3c={};_0x4f4a3c[_0x11fe04]={'$like':'%'+_0x169e24[_0x3ade('0x33')][_0x3ade('0x3e')]+'%'};return _0x4f4a3c;})});}_0x17615e=_['merge']({},_0x17615e,_0x169e24[_0x3ade('0x4b')]);return _0x1208a8[_0x3ade('0x51')](_0x17615e);}})[_0x3ade('0x28')](function(_0x4f8765){if(_0x4f8765){_0x417dda=_0x4f8765[_0x3ade('0x49')];if(!_0x169e24[_0x3ade('0x33')][_0x3ade('0x39')](_0x3ade('0x3a'))){_0x17615e[_0x3ade('0x21')]=qs[_0x3ade('0x21')](_0x169e24[_0x3ade('0x33')][_0x3ade('0x21')]);_0x17615e[_0x3ade('0x1e')]=qs[_0x3ade('0x1e')](_0x169e24[_0x3ade('0x33')][_0x3ade('0x1e')]);}return _0x1208a8[_0x3ade('0x51')](_0x17615e);}})[_0x3ade('0x28')](function(_0x2000db){if(_0x2000db){return _0x2000db?{'count':_0x417dda,'rows':_0x2000db}:null;}})[_0x3ade('0x28')](respondWithResult(_0x5cccf7,null))[_0x3ade('0x45')](handleError(_0x5cccf7,null));};exports['getDescriptions']=function(_0x21e029,_0x15c08f,_0x3da8d6){var _0x4e3388={};var _0x498356={};var _0x4e88f0;var _0x5b314c;return db['ZendeskConfiguration'][_0x3ade('0x4f')]({'where':{'id':_0x21e029[_0x3ade('0x47')]['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0x15c08f,null))[_0x3ade('0x28')](function(_0x1f37b9){if(_0x1f37b9){_0x4e88f0=_0x1f37b9;_0x498356[_0x3ade('0x32')]=_['keys'](db[_0x3ade('0x50')][_0x3ade('0x48')]);_0x498356[_0x3ade('0x33')]=_[_0x3ade('0x34')](_0x21e029[_0x3ade('0x33')]);_0x498356[_0x3ade('0x35')]=_['intersection'](_0x498356['model'],_0x498356[_0x3ade('0x33')]);_0x4e3388[_0x3ade('0x38')]=_[_0x3ade('0x36')](_0x498356[_0x3ade('0x32')],qs['fields'](_0x21e029[_0x3ade('0x33')][_0x3ade('0x37')]));_0x4e3388[_0x3ade('0x38')]=_0x4e3388['attributes'][_0x3ade('0x49')]?_0x4e3388[_0x3ade('0x38')]:_0x498356[_0x3ade('0x32')];_0x4e3388['order']=qs['sort'](_0x21e029[_0x3ade('0x33')]['sort']);_0x4e3388[_0x3ade('0x3f')]=qs['filters'](_[_0x3ade('0x3d')](_0x21e029[_0x3ade('0x33')],_0x498356[_0x3ade('0x35')]));if(_0x21e029[_0x3ade('0x33')][_0x3ade('0x3e')]){_0x4e3388[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x4e3388[_0x3ade('0x3f')],{'$or':_['map'](_0x4e3388['attributes'],function(_0x12421e){var _0x3d9e58={};_0x3d9e58[_0x12421e]={'$like':'%'+_0x21e029[_0x3ade('0x33')]['filter']+'%'};return _0x3d9e58;})});}_0x4e3388=_[_0x3ade('0x40')]({},_0x4e3388,_0x21e029['options']);return _0x4e88f0['getDescriptions'](_0x4e3388);}})[_0x3ade('0x28')](function(_0x3244d7){if(_0x3244d7){_0x5b314c=_0x3244d7[_0x3ade('0x49')];if(!_0x21e029['query']['hasOwnProperty'](_0x3ade('0x3a'))){_0x4e3388[_0x3ade('0x21')]=qs[_0x3ade('0x21')](_0x21e029['query'][_0x3ade('0x21')]);_0x4e3388[_0x3ade('0x1e')]=qs['offset'](_0x21e029[_0x3ade('0x33')][_0x3ade('0x1e')]);}return _0x4e88f0[_0x3ade('0x52')](_0x4e3388);}})[_0x3ade('0x28')](function(_0x4c3c29){if(_0x4c3c29){return _0x4c3c29?{'count':_0x5b314c,'rows':_0x4c3c29}:null;}})[_0x3ade('0x28')](respondWithResult(_0x15c08f,null))[_0x3ade('0x45')](handleError(_0x15c08f,null));};exports[_0x3ade('0x53')]=function(_0x548158,_0x1feffd,_0x39ef0d){var _0x1b5078={};var _0x2f3c86={};var _0xda6d92;var _0x4d4d0f;return db[_0x3ade('0x2e')]['findOne']({'where':{'id':_0x548158[_0x3ade('0x47')]['id']}})[_0x3ade('0x28')](handleEntityNotFound(_0x1feffd,null))[_0x3ade('0x28')](function(_0x4994f5){if(_0x4994f5){_0xda6d92=_0x4994f5;_0x2f3c86[_0x3ade('0x32')]=_[_0x3ade('0x34')](db[_0x3ade('0x54')][_0x3ade('0x48')]);_0x2f3c86[_0x3ade('0x33')]=_[_0x3ade('0x34')](_0x548158[_0x3ade('0x33')]);_0x2f3c86[_0x3ade('0x35')]=_[_0x3ade('0x36')](_0x2f3c86['model'],_0x2f3c86['query']);_0x1b5078['attributes']=_[_0x3ade('0x36')](_0x2f3c86['model'],qs[_0x3ade('0x37')](_0x548158[_0x3ade('0x33')][_0x3ade('0x37')]));_0x1b5078['attributes']=_0x1b5078[_0x3ade('0x38')][_0x3ade('0x49')]?_0x1b5078[_0x3ade('0x38')]:_0x2f3c86[_0x3ade('0x32')];_0x1b5078['order']=qs[_0x3ade('0x3c')](_0x548158[_0x3ade('0x33')][_0x3ade('0x3c')]);_0x1b5078[_0x3ade('0x3f')]=qs['filters'](_[_0x3ade('0x3d')](_0x548158[_0x3ade('0x33')],_0x2f3c86['filters']));if(_0x548158['query'][_0x3ade('0x3e')]){_0x1b5078['where']=_[_0x3ade('0x40')](_0x1b5078[_0x3ade('0x3f')],{'$or':_[_0x3ade('0x2d')](_0x1b5078[_0x3ade('0x38')],function(_0x518cbb){var _0x35c523={};_0x35c523[_0x518cbb]={'$like':'%'+_0x548158['query']['filter']+'%'};return _0x35c523;})});}_0x1b5078=_[_0x3ade('0x40')]({},_0x1b5078,_0x548158['options']);return _0xda6d92[_0x3ade('0x53')](_0x1b5078);}})[_0x3ade('0x28')](function(_0x5d0a1d){if(_0x5d0a1d){_0x4d4d0f=_0x5d0a1d['length'];if(!_0x548158[_0x3ade('0x33')]['hasOwnProperty']('nolimit')){_0x1b5078['limit']=qs[_0x3ade('0x21')](_0x548158['query'][_0x3ade('0x21')]);_0x1b5078[_0x3ade('0x1e')]=qs[_0x3ade('0x1e')](_0x548158[_0x3ade('0x33')][_0x3ade('0x1e')]);}return _0xda6d92[_0x3ade('0x53')](_0x1b5078);}})[_0x3ade('0x28')](function(_0x3173b3){if(_0x3173b3){return _0x3173b3?{'count':_0x4d4d0f,'rows':_0x3173b3}:null;}})[_0x3ade('0x28')](respondWithResult(_0x1feffd,null))[_0x3ade('0x45')](handleError(_0x1feffd,null));};exports[_0x3ade('0x55')]=function(_0x54697f,_0x43f9e7,_0x596bbe){if(_0x54697f[_0x3ade('0x4e')]['id']){delete _0x54697f[_0x3ade('0x4e')]['id'];}return db[_0x3ade('0x2e')][_0x3ade('0x4f')]({'where':{'id':_0x54697f['params']['id']}})['then'](handleEntityNotFound(_0x43f9e7,null))[_0x3ade('0x28')](function(_0x4e2b41){if(_0x4e2b41){return _0x4e2b41[_0x3ade('0x55')](_0x54697f[_0x3ade('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x43f9e7,null))[_0x3ade('0x45')](handleError(_0x43f9e7,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f045bfd..b382620 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 _0x1eba=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x160564,_0x3f387e){var _0xa67975=function(_0x48a6ac){while(--_0x48a6ac){_0x160564['push'](_0x160564['shift']());}};_0xa67975(++_0x3f387e);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x1eba[_0x38fb0d];return _0x30a5d6;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32b6=['moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api'];(function(_0x449591,_0x24e498){var _0x3885b9=function(_0x5cdf21){while(--_0x5cdf21){_0x449591['push'](_0x449591['shift']());}};_0x3885b9(++_0x24e498);}(_0x32b6,0x1d1));var _0x632b=function(_0x2832d9,_0x3eeb79){_0x2832d9=_0x2832d9-0x0;var _0x2b2ce9=_0x32b6[_0x2832d9];return _0x2b2ce9;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'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 59d804c..8aae67f 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 _0xa6ae=['info','ZendeskConfiguration,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xa6ae,0x199));var _0xea6a=function(_0x4c463a,_0x4411bb){_0x4c463a=_0x4c463a-0x0;var _0x54f816=_0xa6ae[_0x4c463a];return _0x54f816;};'use strict';var _=require('lodash');var util=require(_0xea6a('0x0'));var moment=require(_0xea6a('0x1'));var BPromise=require(_0xea6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6a('0x3'));var db=require(_0xea6a('0x4'))['db'];var utils=require(_0xea6a('0x5'));var logger=require(_0xea6a('0x6'))(_0xea6a('0x7'));var config=require(_0xea6a('0x8'));var jayson=require(_0xea6a('0x9'));var client=jayson['client'][_0xea6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f13fb,_0x5cb11c,_0x162a31){return new BPromise(function(_0x27ee21,_0x424764){return client['request'](_0x1f13fb,_0x162a31)['then'](function(_0x9a7fbb){logger[_0xea6a('0xb')](_0xea6a('0xc'),_0x5cb11c,'request\x20sent');logger[_0xea6a('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5cb11c,'request\x20sent',JSON['stringify'](_0x9a7fbb));if(_0x9a7fbb[_0xea6a('0xe')]){if(_0x9a7fbb[_0xea6a('0xe')][_0xea6a('0xf')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5cb11c,_0x9a7fbb[_0xea6a('0xe')][_0xea6a('0x10')]);return _0x424764(_0x9a7fbb[_0xea6a('0xe')]['message']);}logger[_0xea6a('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cb11c,_0x9a7fbb['error'][_0xea6a('0x10')]);return _0x27ee21(_0x9a7fbb[_0xea6a('0xe')][_0xea6a('0x10')]);}else{logger[_0xea6a('0xb')](_0xea6a('0xc'),_0x5cb11c,_0xea6a('0x11'));_0x27ee21(_0x9a7fbb[_0xea6a('0x12')][_0xea6a('0x10')]);}})[_0xea6a('0x13')](function(_0xca290a){logger[_0xea6a('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cb11c,_0xca290a);_0x424764(_0xca290a);});});} \ No newline at end of file +var _0x44a5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../mysqldb'];(function(_0x85bc21,_0x2fb4d2){var _0x3368cf=function(_0x4e3897){while(--_0x4e3897){_0x85bc21['push'](_0x85bc21['shift']());}};_0x3368cf(++_0x2fb4d2);}(_0x44a5,0xc4));var _0x544a=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0x44a5[_0x3bbd2d];return _0x241bd4;};'use strict';var _=require('lodash');var util=require(_0x544a('0x0'));var moment=require(_0x544a('0x1'));var BPromise=require('bluebird');var rs=require(_0x544a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x544a('0x3'))['db'];var utils=require(_0x544a('0x4'));var logger=require('../../config/logger')(_0x544a('0x5'));var config=require(_0x544a('0x6'));var jayson=require(_0x544a('0x7'));var client=jayson[_0x544a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29d4e5,_0x237204,_0x19448a){return new BPromise(function(_0x2bd9f4,_0x1a1357){return client[_0x544a('0x9')](_0x29d4e5,_0x19448a)[_0x544a('0xa')](function(_0x82fcdd){logger[_0x544a('0xb')](_0x544a('0xc'),_0x237204,_0x544a('0xd'));logger['debug'](_0x544a('0xe'),_0x237204,_0x544a('0xd'),JSON['stringify'](_0x82fcdd));if(_0x82fcdd['error']){if(_0x82fcdd[_0x544a('0xf')][_0x544a('0x10')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x237204,_0x82fcdd[_0x544a('0xf')][_0x544a('0x11')]);return _0x1a1357(_0x82fcdd[_0x544a('0xf')][_0x544a('0x11')]);}logger[_0x544a('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x237204,_0x82fcdd[_0x544a('0xf')][_0x544a('0x11')]);return _0x2bd9f4(_0x82fcdd[_0x544a('0xf')][_0x544a('0x11')]);}else{logger[_0x544a('0xb')](_0x544a('0xc'),_0x237204,_0x544a('0xd'));_0x2bd9f4(_0x82fcdd[_0x544a('0x12')]['message']);}})[_0x544a('0x13')](function(_0x4ce780){logger[_0x544a('0xf')](_0x544a('0xc'),_0x237204,_0x4ce780);_0x1a1357(_0x4ce780);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 4a1e157..dbbbdc4 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 _0xb8c3=['index','/:id','post','put','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated'];(function(_0x309de6,_0x3e53a9){var _0x22b485=function(_0x3a9e24){while(--_0x3a9e24){_0x309de6['push'](_0x309de6['shift']());}};_0x22b485(++_0x3e53a9);}(_0xb8c3,0x19b));var _0x3b8c=function(_0x2e309f,_0xeb56b9){_0x2e309f=_0x2e309f-0x0;var _0x576d89=_0xb8c3[_0x2e309f];return _0x576d89;};'use strict';var multer=require(_0x3b8c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3b8c('0x1'));var express=require(_0x3b8c('0x2'));var router=express['Router']();var fs_extra=require(_0x3b8c('0x3'));var auth=require(_0x3b8c('0x4'));var interaction=require(_0x3b8c('0x5'));var config=require('../../config/environment');var controller=require(_0x3b8c('0x6'));router[_0x3b8c('0x7')]('/',auth[_0x3b8c('0x8')](),controller[_0x3b8c('0x9')]);router[_0x3b8c('0x7')](_0x3b8c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3b8c('0xb')]('/',auth[_0x3b8c('0x8')](),controller['create']);router[_0x3b8c('0xc')](_0x3b8c('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b8c('0xa'),auth['isAuthenticated'](),controller[_0x3b8c('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1f32=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','multer','util','path'];(function(_0x274886,_0x2b53e4){var _0x2a77f3=function(_0x57e316){while(--_0x57e316){_0x274886['push'](_0x274886['shift']());}};_0x2a77f3(++_0x2b53e4);}(_0x1f32,0x140));var _0x21f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1f32[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x21f3('0x0'));var util=require(_0x21f3('0x1'));var path=require(_0x21f3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x21f3('0x3')]();var fs_extra=require(_0x21f3('0x4'));var auth=require(_0x21f3('0x5'));var interaction=require(_0x21f3('0x6'));var config=require(_0x21f3('0x7'));var controller=require(_0x21f3('0x8'));router[_0x21f3('0x9')]('/',auth[_0x21f3('0xa')](),controller[_0x21f3('0xb')]);router[_0x21f3('0x9')](_0x21f3('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x21f3('0xd')]('/',auth[_0x21f3('0xa')](),controller[_0x21f3('0xe')]);router['put'](_0x21f3('0xc'),auth[_0x21f3('0xa')](),controller[_0x21f3('0xf')]);router[_0x21f3('0x10')](_0x21f3('0xc'),auth[_0x21f3('0xa')](),controller['destroy']);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 dd7a8aa..bc3aadf 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 _0xe8e2=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3be478,_0x1c19de){var _0x5427eb=function(_0x2ae505){while(--_0x2ae505){_0x3be478['push'](_0x3be478['shift']());}};_0x5427eb(++_0x1c19de);}(_0xe8e2,0x132));var _0x2e8e=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xe8e2[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x2e8e('0x0'));module[_0x2e8e('0x1')]={'type':{'type':Sequelize[_0x2e8e('0x2')](_0x2e8e('0x3'),_0x2e8e('0x4'),_0x2e8e('0x5'),_0x2e8e('0x6'),_0x2e8e('0x7')),'defaultValue':_0x2e8e('0x3')},'content':{'type':Sequelize[_0x2e8e('0x8')]},'key':{'type':Sequelize[_0x2e8e('0x8')]},'keyType':{'type':Sequelize[_0x2e8e('0x2')]('string','variable',_0x2e8e('0x5'))},'keyContent':{'type':Sequelize[_0x2e8e('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2e8e('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e8e('0x8')]}}; \ No newline at end of file +var _0x1b71=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1bbe43,_0x322938){var _0x478776=function(_0x1ac382){while(--_0x1ac382){_0x1bbe43['push'](_0x1bbe43['shift']());}};_0x478776(++_0x322938);}(_0x1b71,0x10f));var _0x11b7=function(_0xa1a17,_0x2e5f01){_0xa1a17=_0xa1a17-0x0;var _0x1087e1=_0x1b71[_0xa1a17];return _0x1087e1;};'use strict';var Sequelize=require(_0x11b7('0x0'));module[_0x11b7('0x1')]={'type':{'type':Sequelize[_0x11b7('0x2')](_0x11b7('0x3'),_0x11b7('0x4'),_0x11b7('0x5'),_0x11b7('0x6'),_0x11b7('0x7')),'defaultValue':_0x11b7('0x3')},'content':{'type':Sequelize[_0x11b7('0x8')]},'key':{'type':Sequelize[_0x11b7('0x8')]},'keyType':{'type':Sequelize[_0x11b7('0x2')]('string',_0x11b7('0x4'),_0x11b7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x11b7('0x8')]},'nameField':{'type':Sequelize[_0x11b7('0x8')]},'customField':{'type':Sequelize[_0x11b7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11b7('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8cefe26..8e90fec 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 _0x0ea9=['rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','ZendeskField','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4d0c68,_0x4cec24){var _0x414537=function(_0x422e62){while(--_0x422e62){_0x4d0c68['push'](_0x4d0c68['shift']());}};_0x414537(++_0x4cec24);}(_0x0ea9,0xd6));var _0x90ea=function(_0x21e9cf,_0x19387e){_0x21e9cf=_0x21e9cf-0x0;var _0x3515a9=_0x0ea9[_0x21e9cf];return _0x3515a9;};'use strict';var emlformat=require(_0x90ea('0x0'));var rimraf=require(_0x90ea('0x1'));var zipdir=require(_0x90ea('0x2'));var jsonpatch=require(_0x90ea('0x3'));var rp=require(_0x90ea('0x4'));var moment=require(_0x90ea('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x90ea('0x6'));var csv=require(_0x90ea('0x7'));var ejs=require(_0x90ea('0x8'));var fs=require('fs');var fs_extra=require(_0x90ea('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90ea('0xa'));var jsforce=require(_0x90ea('0xb'));var deskjs=require(_0x90ea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x90ea('0xd'));var Papa=require(_0x90ea('0xe'));var Redis=require(_0x90ea('0xf'));var authService=require(_0x90ea('0x10'));var qs=require(_0x90ea('0x11'));var as=require(_0x90ea('0x12'));var hardwareService=require(_0x90ea('0x13'));var logger=require(_0x90ea('0x14'))(_0x90ea('0x15'));var utils=require('../../config/utils');var config=require(_0x90ea('0x16'));var licenseUtil=require(_0x90ea('0x17'));var db=require(_0x90ea('0x18'))['db'];function respondWithStatusCode(_0x5bc7a0,_0xc9d91e){_0xc9d91e=_0xc9d91e||0xcc;return function(_0x461370){if(_0x461370){return _0x5bc7a0[_0x90ea('0x19')](_0xc9d91e);}return _0x5bc7a0['status'](_0xc9d91e)[_0x90ea('0x1a')]();};}function respondWithResult(_0x421021,_0x5143cf){_0x5143cf=_0x5143cf||0xc8;return function(_0x337cf5){if(_0x337cf5){return _0x421021['status'](_0x5143cf)[_0x90ea('0x1b')](_0x337cf5);}};}function respondWithFilteredResult(_0x184a57,_0x3c1f6f){return function(_0x243096){if(_0x243096){var _0x5763a2=typeof _0x3c1f6f[_0x90ea('0x1c')]===_0x90ea('0x1d')&&typeof _0x3c1f6f[_0x90ea('0x1e')]===_0x90ea('0x1d');var _0x3a96e2=_0x243096['count'];var _0x58ad51=_0x5763a2?0x0:_0x3c1f6f['offset'];var _0x3d5d69=_0x5763a2?_0x243096[_0x90ea('0x1f')]:_0x3c1f6f['offset']+_0x3c1f6f[_0x90ea('0x1e')];var _0x2a8470;if(_0x3d5d69>=_0x3a96e2){_0x3d5d69=_0x3a96e2;_0x2a8470=0xc8;}else{_0x2a8470=0xce;}_0x184a57[_0x90ea('0x20')](_0x2a8470);return _0x184a57[_0x90ea('0x21')]('Content-Range',_0x58ad51+'-'+_0x3d5d69+'/'+_0x3a96e2)['json'](_0x243096);}return null;};}function patchUpdates(_0x520a35){return function(_0x26518b){try{jsonpatch[_0x90ea('0x22')](_0x26518b,_0x520a35,!![]);}catch(_0x23d1d4){return BPromise[_0x90ea('0x23')](_0x23d1d4);}return _0x26518b[_0x90ea('0x24')]();};}function saveUpdates(_0xf944f1,_0x26f029){return function(_0x2d8aca){if(_0x2d8aca){return _0x2d8aca[_0x90ea('0x25')](_0xf944f1)[_0x90ea('0x26')](function(_0x4e1dad){return _0x4e1dad;});}return null;};}function removeEntity(_0x27f78f,_0x41cef4){return function(_0x27635c){if(_0x27635c){return _0x27635c[_0x90ea('0x27')]()['then'](function(){_0x27f78f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dca63,_0x132236){return function(_0x3e9de2){if(!_0x3e9de2){_0x5dca63[_0x90ea('0x19')](0x194);}return _0x3e9de2;};}function handleError(_0x58e1ec,_0x5adff0){_0x5adff0=_0x5adff0||0x1f4;return function(_0x46350a){logger['error'](_0x46350a[_0x90ea('0x28')]);if(_0x46350a[_0x90ea('0x29')]){delete _0x46350a[_0x90ea('0x29')];}_0x58e1ec[_0x90ea('0x20')](_0x5adff0)[_0x90ea('0x2a')](_0x46350a);};}exports['index']=function(_0x41b07b,_0xa26b4b){var _0x348a62={},_0x4f7683={},_0x3ae07d={'count':0x0,'rows':[]};var _0x881e9=_['map'](db[_0x90ea('0x2b')]['rawAttributes'],function(_0x257a50){return{'name':_0x257a50['fieldName'],'type':_0x257a50[_0x90ea('0x2c')][_0x90ea('0x2d')]};});_0x4f7683[_0x90ea('0x2e')]=_[_0x90ea('0x2f')](_0x881e9,_0x90ea('0x29'));_0x4f7683[_0x90ea('0x30')]=_[_0x90ea('0x31')](_0x41b07b[_0x90ea('0x30')]);_0x4f7683[_0x90ea('0x32')]=_[_0x90ea('0x33')](_0x4f7683[_0x90ea('0x2e')],_0x4f7683['query']);_0x348a62['attributes']=_[_0x90ea('0x33')](_0x4f7683['model'],qs['fields'](_0x41b07b[_0x90ea('0x30')][_0x90ea('0x34')]));_0x348a62[_0x90ea('0x35')]=_0x348a62[_0x90ea('0x35')][_0x90ea('0x36')]?_0x348a62[_0x90ea('0x35')]:_0x4f7683[_0x90ea('0x2e')];if(!_0x41b07b[_0x90ea('0x30')]['hasOwnProperty']('nolimit')){_0x348a62[_0x90ea('0x1e')]=qs[_0x90ea('0x1e')](_0x41b07b[_0x90ea('0x30')]['limit']);_0x348a62[_0x90ea('0x1c')]=qs[_0x90ea('0x1c')](_0x41b07b[_0x90ea('0x30')][_0x90ea('0x1c')]);}_0x348a62['order']=qs[_0x90ea('0x37')](_0x41b07b[_0x90ea('0x30')][_0x90ea('0x37')]);_0x348a62[_0x90ea('0x38')]=qs['filters'](_['pick'](_0x41b07b[_0x90ea('0x30')],_0x4f7683['filters']),_0x881e9);if(_0x41b07b['query']['filter']){_0x348a62['where']=_[_0x90ea('0x39')](_0x348a62[_0x90ea('0x38')],{'$or':_[_0x90ea('0x2f')](_0x881e9,function(_0x3d1624){if(_0x3d1624['type']!=='VIRTUAL'){var _0x48f53c={};_0x48f53c[_0x3d1624['name']]={'$like':'%'+_0x41b07b[_0x90ea('0x30')]['filter']+'%'};return _0x48f53c;}})});}_0x348a62=_[_0x90ea('0x39')]({},_0x348a62,_0x41b07b[_0x90ea('0x3a')]);var _0x2161a2={'where':_0x348a62[_0x90ea('0x38')]};return db[_0x90ea('0x2b')]['count'](_0x2161a2)[_0x90ea('0x26')](function(_0x44bffb){_0x3ae07d[_0x90ea('0x1f')]=_0x44bffb;if(_0x41b07b['query'][_0x90ea('0x3b')]){_0x348a62[_0x90ea('0x3c')]=[{'all':!![]}];}return db[_0x90ea('0x2b')][_0x90ea('0x3d')](_0x348a62);})[_0x90ea('0x26')](function(_0x54af4d){_0x3ae07d[_0x90ea('0x3e')]=_0x54af4d;return _0x3ae07d;})[_0x90ea('0x26')](respondWithFilteredResult(_0xa26b4b,_0x348a62))[_0x90ea('0x3f')](handleError(_0xa26b4b,null));};exports[_0x90ea('0x40')]=function(_0x44789f,_0x24b45d){var _0x4ce43f={'raw':!![],'where':{'id':_0x44789f[_0x90ea('0x41')]['id']}},_0xeb6f03={};_0xeb6f03[_0x90ea('0x2e')]=_[_0x90ea('0x31')](db['ZendeskField'][_0x90ea('0x42')]);_0xeb6f03['query']=_[_0x90ea('0x31')](_0x44789f[_0x90ea('0x30')]);_0xeb6f03['filters']=_[_0x90ea('0x33')](_0xeb6f03[_0x90ea('0x2e')],_0xeb6f03['query']);_0x4ce43f['attributes']=_[_0x90ea('0x33')](_0xeb6f03[_0x90ea('0x2e')],qs[_0x90ea('0x34')](_0x44789f[_0x90ea('0x30')][_0x90ea('0x34')]));_0x4ce43f['attributes']=_0x4ce43f[_0x90ea('0x35')][_0x90ea('0x36')]?_0x4ce43f[_0x90ea('0x35')]:_0xeb6f03[_0x90ea('0x2e')];if(_0x44789f[_0x90ea('0x30')][_0x90ea('0x3b')]){_0x4ce43f[_0x90ea('0x3c')]=[{'all':!![]}];}_0x4ce43f=_['merge']({},_0x4ce43f,_0x44789f[_0x90ea('0x3a')]);return db[_0x90ea('0x2b')]['find'](_0x4ce43f)[_0x90ea('0x26')](handleEntityNotFound(_0x24b45d,null))[_0x90ea('0x26')](respondWithResult(_0x24b45d,null))['catch'](handleError(_0x24b45d,null));};exports[_0x90ea('0x43')]=function(_0x4a6c57,_0xc60751){return db[_0x90ea('0x2b')][_0x90ea('0x43')](_0x4a6c57[_0x90ea('0x44')],{})['then'](respondWithResult(_0xc60751,0xc9))['catch'](handleError(_0xc60751,null));};exports[_0x90ea('0x25')]=function(_0x270e0a,_0x840602){if(_0x270e0a[_0x90ea('0x44')]['id']){delete _0x270e0a[_0x90ea('0x44')]['id'];}return db[_0x90ea('0x2b')][_0x90ea('0x45')]({'where':{'id':_0x270e0a['params']['id']}})[_0x90ea('0x26')](handleEntityNotFound(_0x840602,null))[_0x90ea('0x26')](saveUpdates(_0x270e0a[_0x90ea('0x44')],null))['then'](respondWithResult(_0x840602,null))['catch'](handleError(_0x840602,null));};exports[_0x90ea('0x27')]=function(_0x3e01d3,_0x22b97b){return db[_0x90ea('0x2b')]['find']({'where':{'id':_0x3e01d3[_0x90ea('0x41')]['id']}})[_0x90ea('0x26')](handleEntityNotFound(_0x22b97b,null))[_0x90ea('0x26')](removeEntity(_0x22b97b,null))[_0x90ea('0x3f')](handleError(_0x22b97b,null));}; \ No newline at end of file +var _0xfb3f=['params','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskField','includeAll','findAll','rows','show','length','find','catch','body'];(function(_0x47e65e,_0x2a0f91){var _0x50f2b0=function(_0x22fa71){while(--_0x22fa71){_0x47e65e['push'](_0x47e65e['shift']());}};_0x50f2b0(++_0x2a0f91);}(_0xfb3f,0xd9));var _0xffb3=function(_0x5cbabd,_0xd41b44){_0x5cbabd=_0x5cbabd-0x0;var _0x53b71c=_0xfb3f[_0x5cbabd];return _0x53b71c;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];function respondWithStatusCode(_0x40c953,_0x55192c){_0x55192c=_0x55192c||0xcc;return function(_0x21924a){if(_0x21924a){return _0x40c953[_0xffb3('0x19')](_0x55192c);}return _0x40c953[_0xffb3('0x1a')](_0x55192c)[_0xffb3('0x1b')]();};}function respondWithResult(_0x65ef59,_0x420156){_0x420156=_0x420156||0xc8;return function(_0x19ce6e){if(_0x19ce6e){return _0x65ef59[_0xffb3('0x1a')](_0x420156)[_0xffb3('0x1c')](_0x19ce6e);}};}function respondWithFilteredResult(_0x3183bd,_0x38daab){return function(_0x2c3ef7){if(_0x2c3ef7){var _0x4d3c48=typeof _0x38daab[_0xffb3('0x1d')]===_0xffb3('0x1e')&&typeof _0x38daab[_0xffb3('0x1f')]==='undefined';var _0x51f3bb=_0x2c3ef7[_0xffb3('0x20')];var _0x167ed7=_0x4d3c48?0x0:_0x38daab['offset'];var _0x3b35de=_0x4d3c48?_0x2c3ef7[_0xffb3('0x20')]:_0x38daab[_0xffb3('0x1d')]+_0x38daab['limit'];var _0x2dfb40;if(_0x3b35de>=_0x51f3bb){_0x3b35de=_0x51f3bb;_0x2dfb40=0xc8;}else{_0x2dfb40=0xce;}_0x3183bd[_0xffb3('0x1a')](_0x2dfb40);return _0x3183bd['set'](_0xffb3('0x21'),_0x167ed7+'-'+_0x3b35de+'/'+_0x51f3bb)[_0xffb3('0x1c')](_0x2c3ef7);}return null;};}function patchUpdates(_0x223ad5){return function(_0x21c9ad){try{jsonpatch[_0xffb3('0x22')](_0x21c9ad,_0x223ad5,!![]);}catch(_0x46858f){return BPromise[_0xffb3('0x23')](_0x46858f);}return _0x21c9ad['save']();};}function saveUpdates(_0x473cff,_0xe4c60e){return function(_0x5e0f48){if(_0x5e0f48){return _0x5e0f48[_0xffb3('0x24')](_0x473cff)['then'](function(_0x5b707a){return _0x5b707a;});}return null;};}function removeEntity(_0x24c502,_0x3d55e6){return function(_0x22bbea){if(_0x22bbea){return _0x22bbea[_0xffb3('0x25')]()[_0xffb3('0x26')](function(){_0x24c502[_0xffb3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x796b8e,_0x588608){return function(_0x1390c6){if(!_0x1390c6){_0x796b8e[_0xffb3('0x19')](0x194);}return _0x1390c6;};}function handleError(_0x5267f7,_0x32e047){_0x32e047=_0x32e047||0x1f4;return function(_0x5e0474){logger[_0xffb3('0x27')](_0x5e0474[_0xffb3('0x28')]);if(_0x5e0474[_0xffb3('0x29')]){delete _0x5e0474[_0xffb3('0x29')];}_0x5267f7['status'](_0x32e047)['send'](_0x5e0474);};}exports['index']=function(_0x52fc8c,_0xe3d338){var _0x5d1630={},_0x17f601={},_0x3e64bb={'count':0x0,'rows':[]};var _0x17462d=_[_0xffb3('0x2a')](db['ZendeskField'][_0xffb3('0x2b')],function(_0x42fa8e){return{'name':_0x42fa8e['fieldName'],'type':_0x42fa8e[_0xffb3('0x2c')][_0xffb3('0x2d')]};});_0x17f601[_0xffb3('0x2e')]=_['map'](_0x17462d,_0xffb3('0x29'));_0x17f601[_0xffb3('0x2f')]=_[_0xffb3('0x30')](_0x52fc8c['query']);_0x17f601[_0xffb3('0x31')]=_[_0xffb3('0x32')](_0x17f601['model'],_0x17f601[_0xffb3('0x2f')]);_0x5d1630[_0xffb3('0x33')]=_[_0xffb3('0x32')](_0x17f601[_0xffb3('0x2e')],qs[_0xffb3('0x34')](_0x52fc8c['query'][_0xffb3('0x34')]));_0x5d1630[_0xffb3('0x33')]=_0x5d1630[_0xffb3('0x33')]['length']?_0x5d1630[_0xffb3('0x33')]:_0x17f601[_0xffb3('0x2e')];if(!_0x52fc8c['query'][_0xffb3('0x35')](_0xffb3('0x36'))){_0x5d1630['limit']=qs[_0xffb3('0x1f')](_0x52fc8c[_0xffb3('0x2f')]['limit']);_0x5d1630['offset']=qs['offset'](_0x52fc8c[_0xffb3('0x2f')][_0xffb3('0x1d')]);}_0x5d1630['order']=qs[_0xffb3('0x37')](_0x52fc8c['query'][_0xffb3('0x37')]);_0x5d1630[_0xffb3('0x38')]=qs['filters'](_[_0xffb3('0x39')](_0x52fc8c['query'],_0x17f601[_0xffb3('0x31')]),_0x17462d);if(_0x52fc8c[_0xffb3('0x2f')]['filter']){_0x5d1630[_0xffb3('0x38')]=_[_0xffb3('0x3a')](_0x5d1630[_0xffb3('0x38')],{'$or':_[_0xffb3('0x2a')](_0x17462d,function(_0x1a662e){if(_0x1a662e[_0xffb3('0x2c')]!==_0xffb3('0x3b')){var _0x1a9492={};_0x1a9492[_0x1a662e[_0xffb3('0x29')]]={'$like':'%'+_0x52fc8c[_0xffb3('0x2f')][_0xffb3('0x3c')]+'%'};return _0x1a9492;}})});}_0x5d1630=_[_0xffb3('0x3a')]({},_0x5d1630,_0x52fc8c[_0xffb3('0x3d')]);var _0x568bc5={'where':_0x5d1630[_0xffb3('0x38')]};return db[_0xffb3('0x3e')][_0xffb3('0x20')](_0x568bc5)['then'](function(_0x139c0d){_0x3e64bb['count']=_0x139c0d;if(_0x52fc8c[_0xffb3('0x2f')][_0xffb3('0x3f')]){_0x5d1630['include']=[{'all':!![]}];}return db[_0xffb3('0x3e')][_0xffb3('0x40')](_0x5d1630);})['then'](function(_0x596af5){_0x3e64bb[_0xffb3('0x41')]=_0x596af5;return _0x3e64bb;})[_0xffb3('0x26')](respondWithFilteredResult(_0xe3d338,_0x5d1630))['catch'](handleError(_0xe3d338,null));};exports[_0xffb3('0x42')]=function(_0x399d8d,_0x3f2b13){var _0x1bfa03={'raw':!![],'where':{'id':_0x399d8d['params']['id']}},_0x2e8564={};_0x2e8564[_0xffb3('0x2e')]=_[_0xffb3('0x30')](db[_0xffb3('0x3e')][_0xffb3('0x2b')]);_0x2e8564[_0xffb3('0x2f')]=_['keys'](_0x399d8d['query']);_0x2e8564[_0xffb3('0x31')]=_[_0xffb3('0x32')](_0x2e8564['model'],_0x2e8564[_0xffb3('0x2f')]);_0x1bfa03[_0xffb3('0x33')]=_[_0xffb3('0x32')](_0x2e8564[_0xffb3('0x2e')],qs['fields'](_0x399d8d['query'][_0xffb3('0x34')]));_0x1bfa03[_0xffb3('0x33')]=_0x1bfa03[_0xffb3('0x33')][_0xffb3('0x43')]?_0x1bfa03[_0xffb3('0x33')]:_0x2e8564[_0xffb3('0x2e')];if(_0x399d8d['query'][_0xffb3('0x3f')]){_0x1bfa03['include']=[{'all':!![]}];}_0x1bfa03=_[_0xffb3('0x3a')]({},_0x1bfa03,_0x399d8d[_0xffb3('0x3d')]);return db[_0xffb3('0x3e')][_0xffb3('0x44')](_0x1bfa03)['then'](handleEntityNotFound(_0x3f2b13,null))['then'](respondWithResult(_0x3f2b13,null))[_0xffb3('0x45')](handleError(_0x3f2b13,null));};exports['create']=function(_0x359655,_0x30a92a){return db[_0xffb3('0x3e')]['create'](_0x359655[_0xffb3('0x46')],{})[_0xffb3('0x26')](respondWithResult(_0x30a92a,0xc9))[_0xffb3('0x45')](handleError(_0x30a92a,null));};exports[_0xffb3('0x24')]=function(_0x2f99ed,_0x4b0fd3){if(_0x2f99ed[_0xffb3('0x46')]['id']){delete _0x2f99ed[_0xffb3('0x46')]['id'];}return db[_0xffb3('0x3e')]['find']({'where':{'id':_0x2f99ed[_0xffb3('0x47')]['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x4b0fd3,null))[_0xffb3('0x26')](saveUpdates(_0x2f99ed['body'],null))[_0xffb3('0x26')](respondWithResult(_0x4b0fd3,null))[_0xffb3('0x45')](handleError(_0x4b0fd3,null));};exports[_0xffb3('0x25')]=function(_0x1c179c,_0x51a66e){return db['ZendeskField']['find']({'where':{'id':_0x1c179c['params']['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x51a66e,null))['then'](removeEntity(_0x51a66e,null))['catch'](handleError(_0x51a66e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 87afa26..6b8db68 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 _0x2bc7=['./intZendeskField.attributes','exports','define','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x23d729,_0x4251bf){var _0x46a770=function(_0x569f43){while(--_0x569f43){_0x23d729['push'](_0x23d729['shift']());}};_0x46a770(++_0x4251bf);}(_0x2bc7,0x84));var _0x72bc=function(_0xfc1d89,_0x4b14a9){_0xfc1d89=_0xfc1d89-0x0;var _0x4df14c=_0x2bc7[_0xfc1d89];return _0x4df14c;};'use strict';var _=require(_0x72bc('0x0'));var util=require(_0x72bc('0x1'));var logger=require(_0x72bc('0x2'))(_0x72bc('0x3'));var moment=require('moment');var BPromise=require(_0x72bc('0x4'));var rp=require(_0x72bc('0x5'));var fs=require('fs');var path=require(_0x72bc('0x6'));var rimraf=require('rimraf');var config=require(_0x72bc('0x7'));var attributes=require(_0x72bc('0x8'));module[_0x72bc('0x9')]=function(_0x30685e,_0x4d6552){return _0x30685e[_0x72bc('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x72bc('0xb'),'fields':[_0x72bc('0xc'),_0x72bc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x344f=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ZendeskField','int_zendesk_fields'];(function(_0x389e13,_0x7ae59d){var _0x4c0da4=function(_0x4a5e85){while(--_0x4a5e85){_0x389e13['push'](_0x389e13['shift']());}};_0x4c0da4(++_0x7ae59d);}(_0x344f,0x1a6));var _0xf344=function(_0x24644a,_0x11b85f){_0x24644a=_0x24644a-0x0;var _0x27c6b8=_0x344f[_0x24644a];return _0x27c6b8;};'use strict';var _=require(_0xf344('0x0'));var util=require(_0xf344('0x1'));var logger=require(_0xf344('0x2'))(_0xf344('0x3'));var moment=require(_0xf344('0x4'));var BPromise=require(_0xf344('0x5'));var rp=require(_0xf344('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf344('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0xf344('0x8')]=function(_0x45136c,_0x2bfa31){return _0x45136c[_0xf344('0x9')](_0xf344('0xa'),attributes,{'tableName':_0xf344('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xf344('0xc'),_0xf344('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 1f41f15..a704685 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 _0x0ecc=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x0ecc,0x138));var _0xc0ec=function(_0x4c0ba8,_0x1aba2a){_0x4c0ba8=_0x4c0ba8-0x0;var _0x512023=_0x0ecc[_0x4c0ba8];return _0x512023;};'use strict';var _=require('lodash');var util=require(_0xc0ec('0x0'));var moment=require(_0xc0ec('0x1'));var BPromise=require(_0xc0ec('0x2'));var rs=require(_0xc0ec('0x3'));var fs=require('fs');var Redis=require(_0xc0ec('0x4'));var db=require(_0xc0ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc0ec('0x6'));var config=require(_0xc0ec('0x7'));var jayson=require(_0xc0ec('0x8'));var client=jayson[_0xc0ec('0x9')][_0xc0ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x734a42,_0x416f3a,_0x529bf0){return new BPromise(function(_0x34f2b6,_0x582955){return client['request'](_0x734a42,_0x529bf0)[_0xc0ec('0xb')](function(_0x3ecc54){logger[_0xc0ec('0xc')](_0xc0ec('0xd'),_0x416f3a,_0xc0ec('0xe'));logger[_0xc0ec('0xf')](_0xc0ec('0x10'),_0x416f3a,'request\x20sent',JSON['stringify'](_0x3ecc54));if(_0x3ecc54[_0xc0ec('0x11')]){if(_0x3ecc54[_0xc0ec('0x11')][_0xc0ec('0x12')]===0x1f4){logger[_0xc0ec('0x11')](_0xc0ec('0xd'),_0x416f3a,_0x3ecc54['error'][_0xc0ec('0x13')]);return _0x582955(_0x3ecc54[_0xc0ec('0x11')][_0xc0ec('0x13')]);}logger[_0xc0ec('0x11')](_0xc0ec('0xd'),_0x416f3a,_0x3ecc54['error'][_0xc0ec('0x13')]);return _0x34f2b6(_0x3ecc54[_0xc0ec('0x11')][_0xc0ec('0x13')]);}else{logger[_0xc0ec('0xc')](_0xc0ec('0xd'),_0x416f3a,'request\x20sent');_0x34f2b6(_0x3ecc54[_0xc0ec('0x14')][_0xc0ec('0x13')]);}})['catch'](function(_0x2808be){logger[_0xc0ec('0x11')](_0xc0ec('0xd'),_0x416f3a,_0x2808be);_0x582955(_0x2808be);});});} \ No newline at end of file +var _0x646f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3589ba,_0x318887){var _0x479eb8=function(_0x499e62){while(--_0x499e62){_0x3589ba['push'](_0x3589ba['shift']());}};_0x479eb8(++_0x318887);}(_0x646f,0xe1));var _0xf646=function(_0x54d418,_0x4e4d6c){_0x54d418=_0x54d418-0x0;var _0x4d4feb=_0x646f[_0x54d418];return _0x4d4feb;};'use strict';var _=require('lodash');var util=require(_0xf646('0x0'));var moment=require(_0xf646('0x1'));var BPromise=require('bluebird');var rs=require(_0xf646('0x2'));var fs=require('fs');var Redis=require(_0xf646('0x3'));var db=require(_0xf646('0x4'))['db'];var utils=require(_0xf646('0x5'));var logger=require(_0xf646('0x6'))(_0xf646('0x7'));var config=require(_0xf646('0x8'));var jayson=require(_0xf646('0x9'));var client=jayson[_0xf646('0xa')][_0xf646('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5532ab,_0x35c044,_0x25e7b7){return new BPromise(function(_0x1808f6,_0xd4dd5a){return client[_0xf646('0xc')](_0x5532ab,_0x25e7b7)[_0xf646('0xd')](function(_0x5162c8){logger['info'](_0xf646('0xe'),_0x35c044,'request\x20sent');logger[_0xf646('0xf')](_0xf646('0x10'),_0x35c044,_0xf646('0x11'),JSON[_0xf646('0x12')](_0x5162c8));if(_0x5162c8[_0xf646('0x13')]){if(_0x5162c8[_0xf646('0x13')][_0xf646('0x14')]===0x1f4){logger[_0xf646('0x13')](_0xf646('0xe'),_0x35c044,_0x5162c8[_0xf646('0x13')][_0xf646('0x15')]);return _0xd4dd5a(_0x5162c8['error'][_0xf646('0x15')]);}logger[_0xf646('0x13')](_0xf646('0xe'),_0x35c044,_0x5162c8[_0xf646('0x13')][_0xf646('0x15')]);return _0x1808f6(_0x5162c8[_0xf646('0x13')][_0xf646('0x15')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x35c044,_0xf646('0x11'));_0x1808f6(_0x5162c8['result'][_0xf646('0x15')]);}})[_0xf646('0x16')](function(_0x43b981){logger[_0xf646('0x13')](_0xf646('0xe'),_0x35c044,_0x43b981);_0xd4dd5a(_0x43b981);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 995a2ae..dfa88d8 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 _0xceda=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceda,0x161));var _0xaced=function(_0x5d3e07,_0x4dcb26){_0x5d3e07=_0x5d3e07-0x0;var _0x55223c=_0xceda[_0x5d3e07];return _0x55223c;};'use strict';var multer=require(_0xaced('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaced('0x1'));var express=require(_0xaced('0x2'));var router=express[_0xaced('0x3')]();var fs_extra=require(_0xaced('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaced('0x5'));router[_0xaced('0x6')]('/',auth[_0xaced('0x7')](),controller[_0xaced('0x8')]);router['get'](_0xaced('0x9'),auth[_0xaced('0x7')](),controller[_0xaced('0xa')]);router[_0xaced('0x6')](_0xaced('0xb'),auth[_0xaced('0x7')](),controller[_0xaced('0xc')]);router[_0xaced('0x6')](_0xaced('0xd'),auth[_0xaced('0x7')](),controller[_0xaced('0xe')]);router[_0xaced('0xf')]('/',auth['isAuthenticated'](),controller[_0xaced('0x10')]);router[_0xaced('0xf')](_0xaced('0xb'),auth[_0xaced('0x7')](),controller[_0xaced('0x11')]);router[_0xaced('0x12')](_0xaced('0x9'),auth[_0xaced('0x7')](),controller[_0xaced('0x13')]);router[_0xaced('0x14')]('/:id',auth[_0xaced('0x7')](),controller[_0xaced('0x15')]);module[_0xaced('0x16')]=router; \ No newline at end of file +var _0xe7f7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x528130,_0x1d0cc8){var _0x5ec5c6=function(_0x1175d7){while(--_0x1175d7){_0x528130['push'](_0x528130['shift']());}};_0x5ec5c6(++_0x1d0cc8);}(_0xe7f7,0x170));var _0x7e7f=function(_0x39ded1,_0xaee436){_0x39ded1=_0x39ded1-0x0;var _0x2e248e=_0xe7f7[_0x39ded1];return _0x2e248e;};'use strict';var multer=require(_0x7e7f('0x0'));var util=require(_0x7e7f('0x1'));var path=require(_0x7e7f('0x2'));var timeout=require(_0x7e7f('0x3'));var express=require(_0x7e7f('0x4'));var router=express[_0x7e7f('0x5')]();var fs_extra=require(_0x7e7f('0x6'));var auth=require(_0x7e7f('0x7'));var interaction=require(_0x7e7f('0x8'));var config=require(_0x7e7f('0x9'));var controller=require(_0x7e7f('0xa'));router[_0x7e7f('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e7f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7e7f('0xc')]);router['get'](_0x7e7f('0xd'),auth['isAuthenticated'](),controller[_0x7e7f('0xe')]);router['get'](_0x7e7f('0xf'),auth[_0x7e7f('0x10')](),controller[_0x7e7f('0x11')]);router[_0x7e7f('0x12')]('/',auth[_0x7e7f('0x10')](),controller[_0x7e7f('0x13')]);router['post'](_0x7e7f('0xd'),auth[_0x7e7f('0x10')](),controller[_0x7e7f('0x14')]);router[_0x7e7f('0x15')](_0x7e7f('0x16'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7e7f('0x16'),auth['isAuthenticated'](),controller[_0x7e7f('0x17')]);module[_0x7e7f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e2034eb..ea48b59 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 _0x750a=['exports','STRING'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x750a,0x140));var _0xa750=function(_0x50936f,_0x384d77){_0x50936f=_0x50936f-0x0;var _0x32ca54=_0x750a[_0x50936f];return _0x32ca54;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa750('0x1')]},'zone':{'type':Sequelize[_0xa750('0x1')]},'clientId':{'type':Sequelize[_0xa750('0x1')]},'clientSecret':{'type':Sequelize[_0xa750('0x1')]},'serverUrl':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa750('0x1')]},'refreshToken':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file +var _0xa8a8=['exports','STRING','sequelize'];(function(_0x5be3bb,_0x4b2600){var _0x2b689d=function(_0x17dd84){while(--_0x17dd84){_0x5be3bb['push'](_0x5be3bb['shift']());}};_0x2b689d(++_0x4b2600);}(_0xa8a8,0xec));var _0x8a8a=function(_0x5ade95,_0x58b726){_0x5ade95=_0x5ade95-0x0;var _0x41ccd8=_0xa8a8[_0x5ade95];return _0x41ccd8;};'use strict';var Sequelize=require(_0x8a8a('0x0'));module[_0x8a8a('0x1')]={'name':{'type':Sequelize[_0x8a8a('0x2')]},'description':{'type':Sequelize[_0x8a8a('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8a8a('0x2')]},'clientId':{'type':Sequelize[_0x8a8a('0x2')]},'clientSecret':{'type':Sequelize[_0x8a8a('0x2')]},'serverUrl':{'type':Sequelize[_0x8a8a('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8a8a('0x2')]},'refreshToken':{'type':Sequelize[_0x8a8a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 022dbea..7d019d3 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 _0x0d07=['ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','getFields','stringify','statusCode','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x48ecd2,_0x481ad3){var _0x5a4457=function(_0xdd9abd){while(--_0xdd9abd){_0x48ecd2['push'](_0x48ecd2['shift']());}};_0x5a4457(++_0x481ad3);}(_0x0d07,0x1a0));var _0x70d0=function(_0x40fde3,_0x42e5a8){_0x40fde3=_0x40fde3-0x0;var _0x4a57bc=_0x0d07[_0x40fde3];return _0x4a57bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70d0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70d0('0x1'));var rp=require('request-promise');var moment=require(_0x70d0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x70d0('0x3'));var util=require(_0x70d0('0x4'));var path=require('path');var sox=require(_0x70d0('0x5'));var csv=require(_0x70d0('0x6'));var ejs=require(_0x70d0('0x7'));var fs=require('fs');var fs_extra=require(_0x70d0('0x8'));var _=require(_0x70d0('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x70d0('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x70d0('0xb'));var Papa=require(_0x70d0('0xc'));var Redis=require(_0x70d0('0xd'));var authService=require(_0x70d0('0xe'));var qs=require(_0x70d0('0xf'));var as=require(_0x70d0('0x10'));var hardwareService=require(_0x70d0('0x11'));var logger=require(_0x70d0('0x12'))(_0x70d0('0x13'));var utils=require('../../config/utils');var config=require(_0x70d0('0x14'));var licenseUtil=require(_0x70d0('0x15'));var db=require(_0x70d0('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x24896e,_0x3fc778){_0x3fc778=_0x3fc778||0xcc;return function(_0x3bb81d){if(_0x3bb81d){return _0x24896e[_0x70d0('0x17')](_0x3fc778);}return _0x24896e[_0x70d0('0x18')](_0x3fc778)[_0x70d0('0x19')]();};}function respondWithResult(_0x4526d2,_0x545650){_0x545650=_0x545650||0xc8;return function(_0x1b4f30){if(_0x1b4f30){return _0x4526d2[_0x70d0('0x18')](_0x545650)['json'](_0x1b4f30);}};}function respondWithFilteredResult(_0x14c40b,_0x5ae267){return function(_0x5d4224){if(_0x5d4224){var _0x22a953=typeof _0x5ae267[_0x70d0('0x1a')]===_0x70d0('0x1b')&&typeof _0x5ae267[_0x70d0('0x1c')]==='undefined';var _0x5c9988=_0x5d4224['count'];var _0x2971ae=_0x22a953?0x0:_0x5ae267[_0x70d0('0x1a')];var _0x3a32b3=_0x22a953?_0x5d4224[_0x70d0('0x1d')]:_0x5ae267[_0x70d0('0x1a')]+_0x5ae267[_0x70d0('0x1c')];var _0x125565;if(_0x3a32b3>=_0x5c9988){_0x3a32b3=_0x5c9988;_0x125565=0xc8;}else{_0x125565=0xce;}_0x14c40b[_0x70d0('0x18')](_0x125565);return _0x14c40b['set']('Content-Range',_0x2971ae+'-'+_0x3a32b3+'/'+_0x5c9988)['json'](_0x5d4224);}return null;};}function patchUpdates(_0x3742ed){return function(_0x50de3a){try{jsonpatch[_0x70d0('0x1e')](_0x50de3a,_0x3742ed,!![]);}catch(_0x5809ee){return BPromise[_0x70d0('0x1f')](_0x5809ee);}return _0x50de3a[_0x70d0('0x20')]();};}function saveUpdates(_0xc85a,_0xac8f18){return function(_0x351c36){if(_0x351c36){return _0x351c36['update'](_0xc85a)[_0x70d0('0x21')](function(_0x3f706f){return _0x3f706f;});}return null;};}function removeEntity(_0x496caa,_0x3200de){return function(_0x15c4e5){if(_0x15c4e5){return _0x15c4e5[_0x70d0('0x22')]()[_0x70d0('0x21')](function(){_0x496caa[_0x70d0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5ff9,_0x2cce4b){return function(_0x7abb34){if(!_0x7abb34){_0x1c5ff9['sendStatus'](0x194);}return _0x7abb34;};}function handleError(_0x518cd5,_0x3f1563){_0x3f1563=_0x3f1563||0x1f4;return function(_0x3143f1){logger[_0x70d0('0x23')](_0x3143f1[_0x70d0('0x24')]);if(_0x3143f1[_0x70d0('0x25')]){delete _0x3143f1['name'];}_0x518cd5[_0x70d0('0x18')](_0x3f1563)[_0x70d0('0x26')](_0x3143f1);};}exports['index']=function(_0x5e68a4,_0x379f8f){var _0x30ccc2={},_0x96ab4e={},_0x406f93={'count':0x0,'rows':[]};var _0x3792da=_[_0x70d0('0x27')](db[_0x70d0('0x28')][_0x70d0('0x29')],function(_0x501de7){return{'name':_0x501de7['fieldName'],'type':_0x501de7[_0x70d0('0x2a')][_0x70d0('0x2b')]};});_0x96ab4e[_0x70d0('0x2c')]=_[_0x70d0('0x27')](_0x3792da,_0x70d0('0x25'));_0x96ab4e[_0x70d0('0x2d')]=_['keys'](_0x5e68a4[_0x70d0('0x2d')]);_0x96ab4e[_0x70d0('0x2e')]=_[_0x70d0('0x2f')](_0x96ab4e[_0x70d0('0x2c')],_0x96ab4e['query']);_0x30ccc2[_0x70d0('0x30')]=_['intersection'](_0x96ab4e[_0x70d0('0x2c')],qs['fields'](_0x5e68a4[_0x70d0('0x2d')][_0x70d0('0x31')]));_0x30ccc2[_0x70d0('0x30')]=_0x30ccc2[_0x70d0('0x30')][_0x70d0('0x32')]?_0x30ccc2[_0x70d0('0x30')]:_0x96ab4e[_0x70d0('0x2c')];if(!_0x5e68a4[_0x70d0('0x2d')][_0x70d0('0x33')](_0x70d0('0x34'))){_0x30ccc2['limit']=qs[_0x70d0('0x1c')](_0x5e68a4[_0x70d0('0x2d')][_0x70d0('0x1c')]);_0x30ccc2[_0x70d0('0x1a')]=qs['offset'](_0x5e68a4['query'][_0x70d0('0x1a')]);}_0x30ccc2[_0x70d0('0x35')]=qs['sort'](_0x5e68a4[_0x70d0('0x2d')]['sort']);_0x30ccc2[_0x70d0('0x36')]=qs['filters'](_['pick'](_0x5e68a4[_0x70d0('0x2d')],_0x96ab4e[_0x70d0('0x2e')]),_0x3792da);if(_0x5e68a4['query'][_0x70d0('0x37')]){_0x30ccc2[_0x70d0('0x36')]=_[_0x70d0('0x38')](_0x30ccc2[_0x70d0('0x36')],{'$or':_[_0x70d0('0x27')](_0x3792da,function(_0x574ab0){if(_0x574ab0[_0x70d0('0x2a')]!==_0x70d0('0x39')){var _0x369ff0={};_0x369ff0[_0x574ab0[_0x70d0('0x25')]]={'$like':'%'+_0x5e68a4[_0x70d0('0x2d')][_0x70d0('0x37')]+'%'};return _0x369ff0;}})});}_0x30ccc2=_[_0x70d0('0x38')]({},_0x30ccc2,_0x5e68a4[_0x70d0('0x3a')]);var _0x20f9b5={'where':_0x30ccc2[_0x70d0('0x36')]};return db[_0x70d0('0x28')][_0x70d0('0x1d')](_0x20f9b5)[_0x70d0('0x21')](function(_0x102c12){_0x406f93[_0x70d0('0x1d')]=_0x102c12;if(_0x5e68a4[_0x70d0('0x2d')][_0x70d0('0x3b')]){_0x30ccc2[_0x70d0('0x3c')]=[{'all':!![]}];}return db[_0x70d0('0x28')]['findAll'](_0x30ccc2);})[_0x70d0('0x21')](function(_0xfb3f01){_0x406f93[_0x70d0('0x3d')]=_0xfb3f01;return _0x406f93;})[_0x70d0('0x21')](respondWithFilteredResult(_0x379f8f,_0x30ccc2))[_0x70d0('0x3e')](handleError(_0x379f8f,null));};exports[_0x70d0('0x3f')]=function(_0x3def75,_0x5e4763){var _0x4ced51={'raw':![],'where':{'id':_0x3def75['params']['id']}},_0x549adc={};_0x549adc[_0x70d0('0x2c')]=_[_0x70d0('0x40')](db[_0x70d0('0x28')][_0x70d0('0x29')]);_0x549adc[_0x70d0('0x2d')]=_[_0x70d0('0x40')](_0x3def75['query']);_0x549adc[_0x70d0('0x2e')]=_[_0x70d0('0x2f')](_0x549adc[_0x70d0('0x2c')],_0x549adc[_0x70d0('0x2d')]);_0x4ced51[_0x70d0('0x30')]=_['intersection'](_0x549adc[_0x70d0('0x2c')],qs[_0x70d0('0x31')](_0x3def75[_0x70d0('0x2d')][_0x70d0('0x31')]));_0x4ced51['attributes']=_0x4ced51[_0x70d0('0x30')][_0x70d0('0x32')]?_0x4ced51[_0x70d0('0x30')]:_0x549adc[_0x70d0('0x2c')];if(_0x3def75['query']['includeAll']){_0x4ced51[_0x70d0('0x3c')]=[{'all':!![]}];}_0x4ced51=_[_0x70d0('0x38')]({},_0x4ced51,_0x3def75['options']);return db[_0x70d0('0x28')][_0x70d0('0x41')](_0x4ced51)[_0x70d0('0x21')](handleEntityNotFound(_0x5e4763,null))[_0x70d0('0x21')](respondWithResult(_0x5e4763,null))[_0x70d0('0x3e')](handleError(_0x5e4763,null));};exports[_0x70d0('0x42')]=function(_0x4a4cd2,_0x121e1b){return db[_0x70d0('0x28')][_0x70d0('0x42')](_0x4a4cd2['body'],{})['then'](respondWithResult(_0x121e1b,0xc9))[_0x70d0('0x3e')](handleError(_0x121e1b,null));};exports['update']=function(_0x4711a8,_0x5ba1fe){if(_0x4711a8[_0x70d0('0x43')]['id']){delete _0x4711a8[_0x70d0('0x43')]['id'];}return db[_0x70d0('0x28')][_0x70d0('0x41')]({'where':{'id':_0x4711a8[_0x70d0('0x44')]['id']}})[_0x70d0('0x21')](handleEntityNotFound(_0x5ba1fe,null))[_0x70d0('0x21')](saveUpdates(_0x4711a8['body'],null))[_0x70d0('0x21')](respondWithResult(_0x5ba1fe,null))['catch'](handleError(_0x5ba1fe,null));};exports['destroy']=function(_0x87879b,_0x23fd15){return db[_0x70d0('0x28')]['find']({'where':{'id':_0x87879b[_0x70d0('0x44')]['id']}})['then'](handleEntityNotFound(_0x23fd15,null))[_0x70d0('0x21')](removeEntity(_0x23fd15,null))['catch'](handleError(_0x23fd15,null));};exports[_0x70d0('0x45')]=function(_0x3433d4,_0x104452,_0x20537c){var _0x40832d={};var _0x4a29ee={};var _0xce786;var _0x515496;return db['ZohoAccount'][_0x70d0('0x46')]({'where':{'id':_0x3433d4[_0x70d0('0x44')]['id']}})[_0x70d0('0x21')](handleEntityNotFound(_0x104452,null))[_0x70d0('0x21')](function(_0x3d0d1d){if(_0x3d0d1d){_0xce786=_0x3d0d1d;_0x4a29ee['model']=_['keys'](db[_0x70d0('0x47')][_0x70d0('0x29')]);_0x4a29ee[_0x70d0('0x2d')]=_[_0x70d0('0x40')](_0x3433d4[_0x70d0('0x2d')]);_0x4a29ee[_0x70d0('0x2e')]=_[_0x70d0('0x2f')](_0x4a29ee[_0x70d0('0x2c')],_0x4a29ee['query']);_0x40832d[_0x70d0('0x30')]=_['intersection'](_0x4a29ee[_0x70d0('0x2c')],qs[_0x70d0('0x31')](_0x3433d4[_0x70d0('0x2d')][_0x70d0('0x31')]));_0x40832d[_0x70d0('0x30')]=_0x40832d['attributes'][_0x70d0('0x32')]?_0x40832d[_0x70d0('0x30')]:_0x4a29ee[_0x70d0('0x2c')];_0x40832d['order']=qs['sort'](_0x3433d4[_0x70d0('0x2d')][_0x70d0('0x48')]);_0x40832d[_0x70d0('0x36')]=qs[_0x70d0('0x2e')](_['pick'](_0x3433d4[_0x70d0('0x2d')],_0x4a29ee[_0x70d0('0x2e')]));if(_0x3433d4[_0x70d0('0x2d')][_0x70d0('0x37')]){_0x40832d[_0x70d0('0x36')]=_[_0x70d0('0x38')](_0x40832d[_0x70d0('0x36')],{'$or':_['map'](_0x40832d[_0x70d0('0x30')],function(_0x161800){var _0xda7718={};_0xda7718[_0x161800]={'$like':'%'+_0x3433d4['query'][_0x70d0('0x37')]+'%'};return _0xda7718;})});}_0x40832d=_[_0x70d0('0x38')]({},_0x40832d,_0x3433d4[_0x70d0('0x3a')]);return _0xce786['getConfigurations'](_0x40832d);}})[_0x70d0('0x21')](function(_0x326046){if(_0x326046){_0x515496=_0x326046[_0x70d0('0x32')];if(!_0x3433d4[_0x70d0('0x2d')]['hasOwnProperty'](_0x70d0('0x34'))){_0x40832d['limit']=qs[_0x70d0('0x1c')](_0x3433d4[_0x70d0('0x2d')][_0x70d0('0x1c')]);_0x40832d[_0x70d0('0x1a')]=qs[_0x70d0('0x1a')](_0x3433d4[_0x70d0('0x2d')][_0x70d0('0x1a')]);}return _0xce786[_0x70d0('0x45')](_0x40832d);}})[_0x70d0('0x21')](function(_0x28c1d0){if(_0x28c1d0){return _0x28c1d0?{'count':_0x515496,'rows':_0x28c1d0}:null;}})['then'](respondWithResult(_0x104452,null))[_0x70d0('0x3e')](handleError(_0x104452,null));};exports[_0x70d0('0x49')]=function(_0x2c783d,_0x18daae,_0xf264d5){if(_0x2c783d[_0x70d0('0x43')]['id']){delete _0x2c783d['body']['id'];}return db[_0x70d0('0x28')][_0x70d0('0x46')]({'where':{'id':_0x2c783d[_0x70d0('0x44')]['id']}})[_0x70d0('0x21')](handleEntityNotFound(_0x18daae,null))[_0x70d0('0x21')](function(_0x2d87d1){if(_0x2d87d1){_0x2c783d[_0x70d0('0x43')][_0x70d0('0x4a')]=_0x2d87d1['id'];_0x2c783d[_0x70d0('0x43')][_0x70d0('0x4b')]=integrations[_0x70d0('0x4c')](_0x2c783d[_0x70d0('0x43')][_0x70d0('0x4d')],_0x2c783d[_0x70d0('0x43')]['type']);_0x2c783d['body'][_0x70d0('0x4e')]=integrations[_0x70d0('0x4f')](_0x2c783d[_0x70d0('0x43')]['channel'],_0x2c783d[_0x70d0('0x43')]['type']);return db['ZohoConfiguration'][_0x70d0('0x42')](_0x2c783d[_0x70d0('0x43')],{'include':[{'model':db['ZohoField'],'as':_0x70d0('0x4b')},{'model':db[_0x70d0('0x50')],'as':'Descriptions'}]});}return null;})[_0x70d0('0x21')](respondWithResult(_0x18daae,null))[_0x70d0('0x3e')](handleError(_0x18daae,null));};function getAccessToken(_0x2f8a2f){return new Promise(function(_0x9f575b,_0x47c7b3){var _0x5e7591;switch(_0x2f8a2f['zone']){case'US':_0x5e7591=_0x70d0('0x51');break;case'AU':_0x5e7591=_0x70d0('0x52');break;case'EU':_0x5e7591=_0x70d0('0x53');break;case'IN':_0x5e7591='https://accounts.zoho.in';break;case'CN':_0x5e7591=_0x70d0('0x54');break;default:_0x5e7591='https://accounts.zoho.eu';break;}var _0x5cba71={'method':_0x70d0('0x55'),'uri':_0x5e7591+_0x70d0('0x56'),'qs':{'refresh_token':_0x2f8a2f[_0x70d0('0x57')],'client_id':_0x2f8a2f['clientId'],'client_secret':_0x2f8a2f[_0x70d0('0x58')],'grant_type':_0x70d0('0x59')},'json':!![]};return rp(_0x5cba71)[_0x70d0('0x21')](function(_0xdb4a4d){if(_0xdb4a4d[_0x70d0('0x5a')]){_0x9f575b(_0xdb4a4d['access_token']);}else{_0x47c7b3(_0x70d0('0x5b'));}})[_0x70d0('0x3e')](function(_0x1dfc08){_0x47c7b3(_0x1dfc08);});});}exports['getFields']=function(_0x3ce3ee,_0x61384b,_0x2909a9){var _0x471635,_0x496be1,_0x88edb1,_0x2a57ea,_0x234271;return db[_0x70d0('0x28')][_0x70d0('0x46')]({'where':{'id':_0x3ce3ee['params']['id']},'attributes':['id',_0x70d0('0x5c'),_0x70d0('0x5d'),'clientId',_0x70d0('0x58'),_0x70d0('0x5e'),_0x70d0('0x5f'),_0x70d0('0x57')]})[_0x70d0('0x21')](handleEntityNotFound(_0x61384b,null))[_0x70d0('0x21')](function(_0x7b5bfb){_0x234271=_0x7b5bfb;_0x471635=_0x234271['host'];_0x496be1=_0x471635==='zoho.eu'?'eu':_0x70d0('0x60');_0x88edb1=_0x234271[_0x70d0('0x5e')];var _0x1cd640=_0x88edb1[_0x70d0('0x61')](-0x1);if(_0x1cd640==='/'||_0x1cd640==='\x5c'||_0x1cd640===':'){_0x88edb1=_0x88edb1[_0x70d0('0x62')](0x0,_0x88edb1[_0x70d0('0x63')](_0x1cd640));}if(!_0x234271[_0x70d0('0x57')]){throw new Error(_0x70d0('0x64'));}return getAccessToken(_0x234271);})[_0x70d0('0x21')](function(_0x180794){if(_0x180794){return rp({'method':_0x70d0('0x65'),'uri':util[_0x70d0('0x66')](_0x70d0('0x67'),_0x496be1),'qs':{'module':'Calls'},'headers':{'Authorization':_0x70d0('0x68')+_0x180794},'json':!![]});}})[_0x70d0('0x21')](function(_0x4cc420){if(_0x4cc420){if(_0x4cc420[_0x70d0('0x69')]&&_0x4cc420['response'][_0x70d0('0x23')]){throw new Error(_0x4cc420[_0x70d0('0x69')][_0x70d0('0x23')][_0x70d0('0x6a')]);}var _0x1d959a=[];var _0x5354fd=[];var _0x163eca=[_0x70d0('0x6b'),_0x70d0('0x6c'),'Description',_0x70d0('0x6d'),_0x70d0('0x6e'),_0x70d0('0x6f'),_0x70d0('0x70'),'Call_Type'];_0x5354fd=_['remove'](_0x4cc420[_0x70d0('0x31')],function(_0x197138){return _0x163eca['includes'](_0x197138[_0x70d0('0x71')]);});for(var _0x2165c7=0x0;_0x2165c7<_0x5354fd[_0x70d0('0x32')];_0x2165c7++){if(_0x5354fd[_0x2165c7][_0x70d0('0x72')]===![]){_0x1d959a[_0x70d0('0x73')]({'id':_0x5354fd[_0x2165c7]['id'],'name':_0x5354fd[_0x2165c7][_0x70d0('0x74')],'custom':_0x5354fd[_0x2165c7]['custom_field'],'options':_0x5354fd[_0x2165c7][_0x70d0('0x75')]===_0x70d0('0x76')&&_0x5354fd[_0x2165c7][_0x70d0('0x77')][_0x70d0('0x32')]>-0x1?_['map'](_0x5354fd[_0x2165c7]['pick_list_values'],function(_0x5bcdb4){return{'name':_0x5bcdb4,'value':_0x5bcdb4};}):[]});}}return{'count':_0x1d959a[_0x70d0('0x32')],'rows':_0x1d959a};}else{return{'count':0x0,'rows':[]};}})[_0x70d0('0x21')](respondWithResult(_0x61384b,null))[_0x70d0('0x3e')](function(_0x546cdb){var _0xebc6cb=_0x3ce3ee['query'][_0x70d0('0x78')]?0x1f4:_0x546cdb['statusCode']||0x1f4;logger[_0x70d0('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x70d0('0x79'),_0xebc6cb,JSON[_0x70d0('0x7a')](_0x546cdb));delete _0x546cdb[_0x70d0('0x25')];if(_0xebc6cb===0x191){_0xebc6cb=0x190;}_0x61384b['status'](_0xebc6cb)['send'](_0x3ce3ee['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x546cdb[_0x70d0('0x7b')]}:_0x546cdb);});}; \ No newline at end of file +var _0xfabc=['Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','send','ZohoAccount','rawAttributes','fieldName','type','model','map','name','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','filter','merge','where','options','includeAll','findAll','rows','catch','show','params','fields','length','include','create','update','body','find','ZohoConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','zone','serverUrl','code','zoho.eu','com','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration'];(function(_0x3302e7,_0x139ab4){var _0x1a9a60=function(_0x3e9ce7){while(--_0x3e9ce7){_0x3302e7['push'](_0x3302e7['shift']());}};_0x1a9a60(++_0x139ab4);}(_0xfabc,0x92));var _0xcfab=function(_0x38b703,_0x666573){_0x38b703=_0x38b703-0x0;var _0x43ba97=_0xfabc[_0x38b703];return _0x43ba97;};'use strict';var emlformat=require(_0xcfab('0x0'));var rimraf=require(_0xcfab('0x1'));var zipdir=require(_0xcfab('0x2'));var jsonpatch=require(_0xcfab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcfab('0x5'));var sox=require(_0xcfab('0x6'));var csv=require(_0xcfab('0x7'));var ejs=require(_0xcfab('0x8'));var fs=require('fs');var fs_extra=require(_0xcfab('0x9'));var _=require(_0xcfab('0xa'));var squel=require(_0xcfab('0xb'));var crypto=require(_0xcfab('0xc'));var jsforce=require(_0xcfab('0xd'));var deskjs=require(_0xcfab('0xe'));var toCsv=require(_0xcfab('0x7'));var querystring=require(_0xcfab('0xf'));var Papa=require(_0xcfab('0x10'));var Redis=require(_0xcfab('0x11'));var authService=require(_0xcfab('0x12'));var qs=require(_0xcfab('0x13'));var as=require(_0xcfab('0x14'));var hardwareService=require(_0xcfab('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcfab('0x16'));var licenseUtil=require(_0xcfab('0x17'));var db=require(_0xcfab('0x18'))['db'];var integrations=require(_0xcfab('0x19'));function respondWithStatusCode(_0x2a4714,_0xe5beb1){_0xe5beb1=_0xe5beb1||0xcc;return function(_0x441989){if(_0x441989){return _0x2a4714['sendStatus'](_0xe5beb1);}return _0x2a4714[_0xcfab('0x1a')](_0xe5beb1)[_0xcfab('0x1b')]();};}function respondWithResult(_0x20d743,_0x4034bb){_0x4034bb=_0x4034bb||0xc8;return function(_0xf57f18){if(_0xf57f18){return _0x20d743[_0xcfab('0x1a')](_0x4034bb)[_0xcfab('0x1c')](_0xf57f18);}};}function respondWithFilteredResult(_0x11b11a,_0x5a57e8){return function(_0x2d1339){if(_0x2d1339){var _0x2e40e8=typeof _0x5a57e8[_0xcfab('0x1d')]===_0xcfab('0x1e')&&typeof _0x5a57e8[_0xcfab('0x1f')]==='undefined';var _0x4a22d3=_0x2d1339[_0xcfab('0x20')];var _0x1ba24e=_0x2e40e8?0x0:_0x5a57e8[_0xcfab('0x1d')];var _0x4930d2=_0x2e40e8?_0x2d1339[_0xcfab('0x20')]:_0x5a57e8[_0xcfab('0x1d')]+_0x5a57e8[_0xcfab('0x1f')];var _0x3846af;if(_0x4930d2>=_0x4a22d3){_0x4930d2=_0x4a22d3;_0x3846af=0xc8;}else{_0x3846af=0xce;}_0x11b11a[_0xcfab('0x1a')](_0x3846af);return _0x11b11a[_0xcfab('0x21')](_0xcfab('0x22'),_0x1ba24e+'-'+_0x4930d2+'/'+_0x4a22d3)[_0xcfab('0x1c')](_0x2d1339);}return null;};}function patchUpdates(_0x21364e){return function(_0x199daa){try{jsonpatch[_0xcfab('0x23')](_0x199daa,_0x21364e,!![]);}catch(_0x2c8b43){return BPromise['reject'](_0x2c8b43);}return _0x199daa['save']();};}function saveUpdates(_0x1448db,_0x5889f5){return function(_0x51e5e4){if(_0x51e5e4){return _0x51e5e4['update'](_0x1448db)[_0xcfab('0x24')](function(_0x367f12){return _0x367f12;});}return null;};}function removeEntity(_0x115a6c,_0x5df799){return function(_0x576a30){if(_0x576a30){return _0x576a30[_0xcfab('0x25')]()['then'](function(){_0x115a6c[_0xcfab('0x1a')](0xcc)[_0xcfab('0x1b')]();});}};}function handleEntityNotFound(_0x68c989,_0x189849){return function(_0x19c98c){if(!_0x19c98c){_0x68c989['sendStatus'](0x194);}return _0x19c98c;};}function handleError(_0x53131c,_0x24133d){_0x24133d=_0x24133d||0x1f4;return function(_0x55dfa5){logger[_0xcfab('0x26')](_0x55dfa5['stack']);if(_0x55dfa5['name']){delete _0x55dfa5['name'];}_0x53131c[_0xcfab('0x1a')](_0x24133d)[_0xcfab('0x27')](_0x55dfa5);};}exports['index']=function(_0x48dd3d,_0x510000){var _0x10cd22={},_0x442a33={},_0x1bd630={'count':0x0,'rows':[]};var _0x1be969=_['map'](db[_0xcfab('0x28')][_0xcfab('0x29')],function(_0xadb8f0){return{'name':_0xadb8f0[_0xcfab('0x2a')],'type':_0xadb8f0[_0xcfab('0x2b')]['key']};});_0x442a33[_0xcfab('0x2c')]=_[_0xcfab('0x2d')](_0x1be969,_0xcfab('0x2e'));_0x442a33['query']=_[_0xcfab('0x2f')](_0x48dd3d[_0xcfab('0x30')]);_0x442a33[_0xcfab('0x31')]=_[_0xcfab('0x32')](_0x442a33['model'],_0x442a33['query']);_0x10cd22['attributes']=_[_0xcfab('0x32')](_0x442a33['model'],qs['fields'](_0x48dd3d[_0xcfab('0x30')]['fields']));_0x10cd22[_0xcfab('0x33')]=_0x10cd22['attributes']['length']?_0x10cd22['attributes']:_0x442a33[_0xcfab('0x2c')];if(!_0x48dd3d['query'][_0xcfab('0x34')]('nolimit')){_0x10cd22[_0xcfab('0x1f')]=qs[_0xcfab('0x1f')](_0x48dd3d[_0xcfab('0x30')][_0xcfab('0x1f')]);_0x10cd22['offset']=qs[_0xcfab('0x1d')](_0x48dd3d[_0xcfab('0x30')]['offset']);}_0x10cd22[_0xcfab('0x35')]=qs[_0xcfab('0x36')](_0x48dd3d[_0xcfab('0x30')][_0xcfab('0x36')]);_0x10cd22['where']=qs['filters'](_['pick'](_0x48dd3d[_0xcfab('0x30')],_0x442a33['filters']),_0x1be969);if(_0x48dd3d[_0xcfab('0x30')][_0xcfab('0x37')]){_0x10cd22['where']=_[_0xcfab('0x38')](_0x10cd22[_0xcfab('0x39')],{'$or':_[_0xcfab('0x2d')](_0x1be969,function(_0x477ba9){if(_0x477ba9[_0xcfab('0x2b')]!=='VIRTUAL'){var _0x67f970={};_0x67f970[_0x477ba9[_0xcfab('0x2e')]]={'$like':'%'+_0x48dd3d[_0xcfab('0x30')]['filter']+'%'};return _0x67f970;}})});}_0x10cd22=_[_0xcfab('0x38')]({},_0x10cd22,_0x48dd3d[_0xcfab('0x3a')]);var _0x133a98={'where':_0x10cd22['where']};return db[_0xcfab('0x28')][_0xcfab('0x20')](_0x133a98)[_0xcfab('0x24')](function(_0x402271){_0x1bd630[_0xcfab('0x20')]=_0x402271;if(_0x48dd3d[_0xcfab('0x30')][_0xcfab('0x3b')]){_0x10cd22['include']=[{'all':!![]}];}return db[_0xcfab('0x28')][_0xcfab('0x3c')](_0x10cd22);})[_0xcfab('0x24')](function(_0x3dd83e){_0x1bd630[_0xcfab('0x3d')]=_0x3dd83e;return _0x1bd630;})[_0xcfab('0x24')](respondWithFilteredResult(_0x510000,_0x10cd22))[_0xcfab('0x3e')](handleError(_0x510000,null));};exports[_0xcfab('0x3f')]=function(_0x195c09,_0x1b931b){var _0x16c7d9={'raw':![],'where':{'id':_0x195c09[_0xcfab('0x40')]['id']}},_0x53bc54={};_0x53bc54['model']=_[_0xcfab('0x2f')](db[_0xcfab('0x28')][_0xcfab('0x29')]);_0x53bc54[_0xcfab('0x30')]=_['keys'](_0x195c09['query']);_0x53bc54[_0xcfab('0x31')]=_[_0xcfab('0x32')](_0x53bc54['model'],_0x53bc54[_0xcfab('0x30')]);_0x16c7d9[_0xcfab('0x33')]=_['intersection'](_0x53bc54[_0xcfab('0x2c')],qs[_0xcfab('0x41')](_0x195c09[_0xcfab('0x30')][_0xcfab('0x41')]));_0x16c7d9[_0xcfab('0x33')]=_0x16c7d9[_0xcfab('0x33')][_0xcfab('0x42')]?_0x16c7d9[_0xcfab('0x33')]:_0x53bc54[_0xcfab('0x2c')];if(_0x195c09[_0xcfab('0x30')][_0xcfab('0x3b')]){_0x16c7d9[_0xcfab('0x43')]=[{'all':!![]}];}_0x16c7d9=_[_0xcfab('0x38')]({},_0x16c7d9,_0x195c09[_0xcfab('0x3a')]);return db[_0xcfab('0x28')]['find'](_0x16c7d9)[_0xcfab('0x24')](handleEntityNotFound(_0x1b931b,null))[_0xcfab('0x24')](respondWithResult(_0x1b931b,null))[_0xcfab('0x3e')](handleError(_0x1b931b,null));};exports[_0xcfab('0x44')]=function(_0x7185ef,_0x4cc5f7){return db[_0xcfab('0x28')]['create'](_0x7185ef['body'],{})[_0xcfab('0x24')](respondWithResult(_0x4cc5f7,0xc9))[_0xcfab('0x3e')](handleError(_0x4cc5f7,null));};exports[_0xcfab('0x45')]=function(_0x1ab74a,_0x3eb059){if(_0x1ab74a[_0xcfab('0x46')]['id']){delete _0x1ab74a['body']['id'];}return db['ZohoAccount'][_0xcfab('0x47')]({'where':{'id':_0x1ab74a[_0xcfab('0x40')]['id']}})['then'](handleEntityNotFound(_0x3eb059,null))[_0xcfab('0x24')](saveUpdates(_0x1ab74a[_0xcfab('0x46')],null))[_0xcfab('0x24')](respondWithResult(_0x3eb059,null))[_0xcfab('0x3e')](handleError(_0x3eb059,null));};exports[_0xcfab('0x25')]=function(_0x2b208c,_0x29f9fd){return db['ZohoAccount']['find']({'where':{'id':_0x2b208c['params']['id']}})[_0xcfab('0x24')](handleEntityNotFound(_0x29f9fd,null))[_0xcfab('0x24')](removeEntity(_0x29f9fd,null))[_0xcfab('0x3e')](handleError(_0x29f9fd,null));};exports['getConfigurations']=function(_0x1f77bb,_0x13d794,_0x4ff188){var _0x2c5a81={};var _0x430a4e={};var _0x365b72;var _0x2c79bc;return db[_0xcfab('0x28')]['findOne']({'where':{'id':_0x1f77bb[_0xcfab('0x40')]['id']}})['then'](handleEntityNotFound(_0x13d794,null))[_0xcfab('0x24')](function(_0x4ce3af){if(_0x4ce3af){_0x365b72=_0x4ce3af;_0x430a4e[_0xcfab('0x2c')]=_['keys'](db[_0xcfab('0x48')][_0xcfab('0x29')]);_0x430a4e['query']=_[_0xcfab('0x2f')](_0x1f77bb[_0xcfab('0x30')]);_0x430a4e[_0xcfab('0x31')]=_[_0xcfab('0x32')](_0x430a4e['model'],_0x430a4e['query']);_0x2c5a81[_0xcfab('0x33')]=_['intersection'](_0x430a4e['model'],qs[_0xcfab('0x41')](_0x1f77bb['query'][_0xcfab('0x41')]));_0x2c5a81[_0xcfab('0x33')]=_0x2c5a81[_0xcfab('0x33')]['length']?_0x2c5a81[_0xcfab('0x33')]:_0x430a4e[_0xcfab('0x2c')];_0x2c5a81['order']=qs[_0xcfab('0x36')](_0x1f77bb[_0xcfab('0x30')]['sort']);_0x2c5a81[_0xcfab('0x39')]=qs[_0xcfab('0x31')](_[_0xcfab('0x49')](_0x1f77bb[_0xcfab('0x30')],_0x430a4e[_0xcfab('0x31')]));if(_0x1f77bb[_0xcfab('0x30')][_0xcfab('0x37')]){_0x2c5a81[_0xcfab('0x39')]=_['merge'](_0x2c5a81['where'],{'$or':_[_0xcfab('0x2d')](_0x2c5a81[_0xcfab('0x33')],function(_0x2b34d6){var _0x21ad87={};_0x21ad87[_0x2b34d6]={'$like':'%'+_0x1f77bb[_0xcfab('0x30')]['filter']+'%'};return _0x21ad87;})});}_0x2c5a81=_[_0xcfab('0x38')]({},_0x2c5a81,_0x1f77bb[_0xcfab('0x3a')]);return _0x365b72[_0xcfab('0x4a')](_0x2c5a81);}})['then'](function(_0x5df244){if(_0x5df244){_0x2c79bc=_0x5df244[_0xcfab('0x42')];if(!_0x1f77bb[_0xcfab('0x30')]['hasOwnProperty'](_0xcfab('0x4b'))){_0x2c5a81['limit']=qs['limit'](_0x1f77bb['query'][_0xcfab('0x1f')]);_0x2c5a81[_0xcfab('0x1d')]=qs[_0xcfab('0x1d')](_0x1f77bb['query'][_0xcfab('0x1d')]);}return _0x365b72[_0xcfab('0x4a')](_0x2c5a81);}})[_0xcfab('0x24')](function(_0x329d02){if(_0x329d02){return _0x329d02?{'count':_0x2c79bc,'rows':_0x329d02}:null;}})['then'](respondWithResult(_0x13d794,null))[_0xcfab('0x3e')](handleError(_0x13d794,null));};exports[_0xcfab('0x4c')]=function(_0x2f663a,_0x2df419,_0x2e8244){if(_0x2f663a[_0xcfab('0x46')]['id']){delete _0x2f663a[_0xcfab('0x46')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x2f663a[_0xcfab('0x40')]['id']}})[_0xcfab('0x24')](handleEntityNotFound(_0x2df419,null))[_0xcfab('0x24')](function(_0x2f0f1b){if(_0x2f0f1b){_0x2f663a[_0xcfab('0x46')][_0xcfab('0x4d')]=_0x2f0f1b['id'];_0x2f663a['body'][_0xcfab('0x4e')]=integrations['getSubjects'](_0x2f663a['body'][_0xcfab('0x4f')],_0x2f663a[_0xcfab('0x46')][_0xcfab('0x2b')]);_0x2f663a['body'][_0xcfab('0x50')]=integrations['getDescriptions'](_0x2f663a[_0xcfab('0x46')][_0xcfab('0x4f')],_0x2f663a[_0xcfab('0x46')][_0xcfab('0x2b')]);return db[_0xcfab('0x48')]['create'](_0x2f663a[_0xcfab('0x46')],{'include':[{'model':db[_0xcfab('0x51')],'as':'Subjects'},{'model':db[_0xcfab('0x51')],'as':'Descriptions'}]});}return null;})[_0xcfab('0x24')](respondWithResult(_0x2df419,null))['catch'](handleError(_0x2df419,null));};function getAccessToken(_0x411310){return new Promise(function(_0x5cf43c,_0x3054a6){var _0x46fc04;switch(_0x411310['zone']){case'US':_0x46fc04=_0xcfab('0x52');break;case'AU':_0x46fc04=_0xcfab('0x53');break;case'EU':_0x46fc04=_0xcfab('0x54');break;case'IN':_0x46fc04=_0xcfab('0x55');break;case'CN':_0x46fc04='https://accounts.zoho.com.cn';break;default:_0x46fc04='https://accounts.zoho.eu';break;}var _0x2d9d51={'method':_0xcfab('0x56'),'uri':_0x46fc04+_0xcfab('0x57'),'qs':{'refresh_token':_0x411310[_0xcfab('0x58')],'client_id':_0x411310[_0xcfab('0x59')],'client_secret':_0x411310[_0xcfab('0x5a')],'grant_type':_0xcfab('0x5b')},'json':!![]};return rp(_0x2d9d51)[_0xcfab('0x24')](function(_0xdb7268){if(_0xdb7268[_0xcfab('0x5c')]){_0x5cf43c(_0xdb7268[_0xcfab('0x5c')]);}else{_0x3054a6(_0xcfab('0x5d'));}})[_0xcfab('0x3e')](function(_0x135068){_0x3054a6(_0x135068);});});}exports[_0xcfab('0x5e')]=function(_0x42cb59,_0xbf2fd9,_0x26784f){var _0xccdb55,_0x501e6d,_0x45aa4f,_0xfdd6a3,_0x4eb758;return db[_0xcfab('0x28')][_0xcfab('0x5f')]({'where':{'id':_0x42cb59['params']['id']},'attributes':['id',_0xcfab('0x60'),_0xcfab('0x61'),'clientId','clientSecret',_0xcfab('0x62'),_0xcfab('0x63'),'refreshToken']})[_0xcfab('0x24')](handleEntityNotFound(_0xbf2fd9,null))[_0xcfab('0x24')](function(_0x5c668d){_0x4eb758=_0x5c668d;_0xccdb55=_0x4eb758['host'];_0x501e6d=_0xccdb55===_0xcfab('0x64')?'eu':_0xcfab('0x65');_0x45aa4f=_0x4eb758['serverUrl'];var _0x5a5ffb=_0x45aa4f['slice'](-0x1);if(_0x5a5ffb==='/'||_0x5a5ffb==='\x5c'||_0x5a5ffb===':'){_0x45aa4f=_0x45aa4f[_0xcfab('0x66')](0x0,_0x45aa4f[_0xcfab('0x67')](_0x5a5ffb));}if(!_0x4eb758['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4eb758);})['then'](function(_0x1ad04a){if(_0x1ad04a){return rp({'method':_0xcfab('0x68'),'uri':util[_0xcfab('0x69')](_0xcfab('0x6a'),_0x501e6d),'qs':{'module':_0xcfab('0x6b')},'headers':{'Authorization':_0xcfab('0x6c')+_0x1ad04a},'json':!![]});}})['then'](function(_0x1cbb5f){if(_0x1cbb5f){if(_0x1cbb5f[_0xcfab('0x6d')]&&_0x1cbb5f[_0xcfab('0x6d')][_0xcfab('0x26')]){throw new Error(_0x1cbb5f[_0xcfab('0x6d')][_0xcfab('0x26')][_0xcfab('0x6e')]);}var _0x4ad188=[];var _0x20e205=[];var _0x32152d=[_0xcfab('0x6f'),_0xcfab('0x70'),_0xcfab('0x71'),_0xcfab('0x72'),_0xcfab('0x73'),_0xcfab('0x74'),_0xcfab('0x75'),_0xcfab('0x76')];_0x20e205=_['remove'](_0x1cbb5f[_0xcfab('0x41')],function(_0x25c7d9){return _0x32152d[_0xcfab('0x77')](_0x25c7d9[_0xcfab('0x78')]);});for(var _0x38baed=0x0;_0x38baed<_0x20e205[_0xcfab('0x42')];_0x38baed++){if(_0x20e205[_0x38baed][_0xcfab('0x79')]===![]){_0x4ad188[_0xcfab('0x7a')]({'id':_0x20e205[_0x38baed]['id'],'name':_0x20e205[_0x38baed][_0xcfab('0x7b')],'custom':_0x20e205[_0x38baed]['custom_field'],'options':_0x20e205[_0x38baed][_0xcfab('0x7c')]===_0xcfab('0x7d')&&_0x20e205[_0x38baed][_0xcfab('0x7e')][_0xcfab('0x42')]>-0x1?_['map'](_0x20e205[_0x38baed][_0xcfab('0x7e')],function(_0x37335f){return{'name':_0x37335f,'value':_0x37335f};}):[]});}}return{'count':_0x4ad188['length'],'rows':_0x4ad188};}else{return{'count':0x0,'rows':[]};}})[_0xcfab('0x24')](respondWithResult(_0xbf2fd9,null))[_0xcfab('0x3e')](function(_0x2d4cb4){var _0x5295a4=_0x42cb59[_0xcfab('0x30')][_0xcfab('0x7f')]?0x1f4:_0x2d4cb4['statusCode']||0x1f4;logger[_0xcfab('0x26')](_0xcfab('0x80'),_0xcfab('0x5e'),_0x5295a4,JSON[_0xcfab('0x81')](_0x2d4cb4));delete _0x2d4cb4[_0xcfab('0x2e')];if(_0x5295a4===0x191){_0x5295a4=0x190;}_0xbf2fd9[_0xcfab('0x1a')](_0x5295a4)[_0xcfab('0x27')](_0x42cb59['query']['test']?{'message':_0xcfab('0x82'),'statusCode':_0x2d4cb4['statusCode']}:_0x2d4cb4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c2ed068..b2a7409 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 _0x8da0=['format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','lastIndexOf','https://accounts.zoho.com','then','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','serverUrl','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','info','name','error'];(function(_0x462bff,_0x151a16){var _0x27229a=function(_0x223b61){while(--_0x223b61){_0x462bff['push'](_0x462bff['shift']());}};_0x27229a(++_0x151a16);}(_0x8da0,0xff));var _0x08da=function(_0x1094a4,_0x782e88){_0x1094a4=_0x1094a4-0x0;var _0x5ca516=_0x8da0[_0x1094a4];return _0x5ca516;};'use strict';var _=require(_0x08da('0x0'));var util=require(_0x08da('0x1'));var logger=require(_0x08da('0x2'))(_0x08da('0x3'));var moment=require(_0x08da('0x4'));var BPromise=require(_0x08da('0x5'));var rp=require(_0x08da('0x6'));var fs=require('fs');var path=require(_0x08da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x08da('0x8'));module['exports']=function(_0x3decb8,_0x4b1a30){return _0x3decb8[_0x08da('0x9')](_0x08da('0xa'),attributes,{'tableName':_0x08da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6146ba,_0x4e4314,_0x17a945){if(_0x6146ba[_0x08da('0xc')](_0x08da('0xd'))||_0x6146ba['changed']('serverUrl')||_0x6146ba['changed'](_0x08da('0xe'))||_0x6146ba['changed'](_0x08da('0xf'))||_0x6146ba[_0x08da('0xc')](_0x08da('0x10'))||_0x6146ba[_0x08da('0xc')]('host')){var _0x23e469,_0x12c0b7;_0x23e469=_0x6146ba[_0x08da('0x11')];var _0xc39448=_0x23e469[_0x08da('0x12')](-0x1);if(_0xc39448==='/'||_0xc39448==='\x5c'||_0xc39448===':'){_0x23e469=_0x23e469[_0x08da('0x13')](0x0,_0x23e469['lastIndexOf'](_0xc39448));}switch(_0x6146ba['zone']){case'US':_0x12c0b7='https://accounts.zoho.com';break;case'AU':_0x12c0b7=_0x08da('0x14');break;case'IN':_0x12c0b7='https://accounts.zoho.in';break;case'CN':_0x12c0b7=_0x08da('0x15');break;default:_0x12c0b7=_0x08da('0x16');break;}var _0x5db0a5={'method':_0x08da('0x17'),'uri':_0x12c0b7+_0x08da('0x18'),'form':{'grant_type':_0x08da('0x19'),'client_id':_0x6146ba[_0x08da('0xe')],'client_secret':_0x6146ba[_0x08da('0xf')],'redirect_uri':_0x6146ba[_0x08da('0x11')],'code':_0x6146ba[_0x08da('0x10')]},'headers':{'Content-Type':_0x08da('0x1a')}};return rp(_0x5db0a5)['then'](function(_0x3eef3e){var _0xe7e5e0=JSON[_0x08da('0x1b')](_0x3eef3e);if(_0xe7e5e0[_0x08da('0x1c')]){_0x6146ba['refreshToken']=_0xe7e5e0[_0x08da('0x1c')];logger[_0x08da('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6146ba[_0x08da('0x1e')],_0x6146ba['id']));}else{logger[_0x08da('0x1f')](util[_0x08da('0x20')](_0x08da('0x21'),_0x6146ba['name'],_0x6146ba['id']),util[_0x08da('0x22')](_0xe7e5e0,{'showHidden':![],'depth':null}));}return _0x17a945(null,_0x4e4314);})[_0x08da('0x23')](function(_0x119d2d){logger[_0x08da('0x1f')](util[_0x08da('0x20')](_0x08da('0x21'),_0x6146ba[_0x08da('0x1e')],_0x6146ba['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x17a945(_0x119d2d);});}else{return _0x17a945(null,_0x4e4314);}},'beforeUpdate':function(_0x5c5f0a,_0x21b28c,_0x95ac2f){if(_0x5c5f0a['changed'](_0x08da('0xd'))||_0x5c5f0a[_0x08da('0xc')](_0x08da('0x11'))||_0x5c5f0a['changed']('clientId')||_0x5c5f0a[_0x08da('0xc')](_0x08da('0xf'))||_0x5c5f0a[_0x08da('0xc')](_0x08da('0x10'))||_0x5c5f0a['changed'](_0x08da('0x24'))){var _0x3491b0,_0x1b3c6b;_0x3491b0=_0x5c5f0a['serverUrl'];var _0x4a4760=_0x3491b0['slice'](-0x1);if(_0x4a4760==='/'||_0x4a4760==='\x5c'||_0x4a4760===':'){_0x3491b0=_0x3491b0[_0x08da('0x13')](0x0,_0x3491b0[_0x08da('0x25')](_0x4a4760));}switch(_0x5c5f0a[_0x08da('0xd')]){case'US':_0x1b3c6b=_0x08da('0x26');break;case'AU':_0x1b3c6b='https://accounts.zoho.com.au';break;case'IN':_0x1b3c6b='https://accounts.zoho.in';break;case'CN':_0x1b3c6b=_0x08da('0x15');break;default:_0x1b3c6b='https://accounts.zoho.eu';break;}var _0x49a3b3={'method':_0x08da('0x17'),'uri':_0x1b3c6b+_0x08da('0x18'),'form':{'grant_type':_0x08da('0x19'),'client_id':_0x5c5f0a[_0x08da('0xe')],'client_secret':_0x5c5f0a[_0x08da('0xf')],'redirect_uri':_0x5c5f0a[_0x08da('0x11')],'code':_0x5c5f0a['code']},'headers':{'Content-Type':_0x08da('0x1a')}};return rp(_0x49a3b3)[_0x08da('0x27')](function(_0x22b954){var _0x1da104=JSON[_0x08da('0x1b')](_0x22b954);if(_0x1da104[_0x08da('0x1c')]){_0x5c5f0a[_0x08da('0x28')]=_0x1da104['refresh_token'];logger[_0x08da('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c5f0a[_0x08da('0x1e')],_0x5c5f0a['id']));}else{logger[_0x08da('0x1f')](util[_0x08da('0x20')](_0x08da('0x21'),_0x5c5f0a[_0x08da('0x1e')],_0x5c5f0a['id']),util[_0x08da('0x22')](_0x1da104,{'showHidden':![],'depth':null}));}return _0x95ac2f(null,_0x21b28c);})['catch'](function(_0x47571b){logger[_0x08da('0x1f')](util[_0x08da('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c5f0a['name'],_0x5c5f0a['id']),util[_0x08da('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x95ac2f(_0x47571b);});}else{return _0x95ac2f(null,_0x21b28c);}}}});}; \ No newline at end of file +var _0xea82=['exports','define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','https://accounts.zoho.in','POST','then','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x50d642,_0x2a8478){var _0x61fc03=function(_0x2d7a9f){while(--_0x2d7a9f){_0x50d642['push'](_0x50d642['shift']());}};_0x61fc03(++_0x2a8478);}(_0xea82,0x9e));var _0x2ea8=function(_0x134c9b,_0x2b4738){_0x134c9b=_0x134c9b-0x0;var _0x33f38e=_0xea82[_0x134c9b];return _0x33f38e;};'use strict';var _=require(_0x2ea8('0x0'));var util=require(_0x2ea8('0x1'));var logger=require('../../config/logger')(_0x2ea8('0x2'));var moment=require(_0x2ea8('0x3'));var BPromise=require(_0x2ea8('0x4'));var rp=require(_0x2ea8('0x5'));var fs=require('fs');var path=require(_0x2ea8('0x6'));var rimraf=require(_0x2ea8('0x7'));var config=require(_0x2ea8('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x2ea8('0x9'));module[_0x2ea8('0xa')]=function(_0x1542f1,_0x58bdad){return _0x1542f1[_0x2ea8('0xb')]('ZohoAccount',attributes,{'tableName':_0x2ea8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21d41c,_0x31b529,_0x211d35){if(_0x21d41c[_0x2ea8('0xd')]('zone')||_0x21d41c['changed'](_0x2ea8('0xe'))||_0x21d41c[_0x2ea8('0xd')](_0x2ea8('0xf'))||_0x21d41c[_0x2ea8('0xd')](_0x2ea8('0x10'))||_0x21d41c[_0x2ea8('0xd')](_0x2ea8('0x11'))||_0x21d41c[_0x2ea8('0xd')]('host')){var _0x2c5c39,_0x2ff3db;_0x2c5c39=_0x21d41c[_0x2ea8('0xe')];var _0x3dd745=_0x2c5c39[_0x2ea8('0x12')](-0x1);if(_0x3dd745==='/'||_0x3dd745==='\x5c'||_0x3dd745===':'){_0x2c5c39=_0x2c5c39[_0x2ea8('0x13')](0x0,_0x2c5c39[_0x2ea8('0x14')](_0x3dd745));}switch(_0x21d41c[_0x2ea8('0x15')]){case'US':_0x2ff3db=_0x2ea8('0x16');break;case'AU':_0x2ff3db=_0x2ea8('0x17');break;case'IN':_0x2ff3db='https://accounts.zoho.in';break;case'CN':_0x2ff3db='https://accounts.zoho.com.cn';break;default:_0x2ff3db=_0x2ea8('0x18');break;}var _0x4bc1d2={'method':'POST','uri':_0x2ff3db+_0x2ea8('0x19'),'form':{'grant_type':_0x2ea8('0x1a'),'client_id':_0x21d41c['clientId'],'client_secret':_0x21d41c['clientSecret'],'redirect_uri':_0x21d41c[_0x2ea8('0xe')],'code':_0x21d41c[_0x2ea8('0x11')]},'headers':{'Content-Type':_0x2ea8('0x1b')}};return rp(_0x4bc1d2)['then'](function(_0x1e5454){var _0x5e3869=JSON[_0x2ea8('0x1c')](_0x1e5454);if(_0x5e3869['refresh_token']){_0x21d41c[_0x2ea8('0x1d')]=_0x5e3869[_0x2ea8('0x1e')];logger[_0x2ea8('0x1f')](util[_0x2ea8('0x20')](_0x2ea8('0x21'),_0x21d41c['name'],_0x21d41c['id']));}else{logger[_0x2ea8('0x22')](util[_0x2ea8('0x20')](_0x2ea8('0x23'),_0x21d41c['name'],_0x21d41c['id']),util[_0x2ea8('0x24')](_0x5e3869,{'showHidden':![],'depth':null}));}return _0x211d35(null,_0x31b529);})[_0x2ea8('0x25')](function(_0x5815c3){logger['error'](util[_0x2ea8('0x20')](_0x2ea8('0x23'),_0x21d41c[_0x2ea8('0x26')],_0x21d41c['id']),util[_0x2ea8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x211d35(_0x5815c3);});}else{return _0x211d35(null,_0x31b529);}},'beforeUpdate':function(_0x571b43,_0x11e7d1,_0x3ea82e){if(_0x571b43['changed'](_0x2ea8('0x15'))||_0x571b43['changed'](_0x2ea8('0xe'))||_0x571b43['changed']('clientId')||_0x571b43[_0x2ea8('0xd')](_0x2ea8('0x10'))||_0x571b43['changed'](_0x2ea8('0x11'))||_0x571b43[_0x2ea8('0xd')]('host')){var _0x24c109,_0x478244;_0x24c109=_0x571b43['serverUrl'];var _0x4ae0d3=_0x24c109[_0x2ea8('0x12')](-0x1);if(_0x4ae0d3==='/'||_0x4ae0d3==='\x5c'||_0x4ae0d3===':'){_0x24c109=_0x24c109[_0x2ea8('0x13')](0x0,_0x24c109[_0x2ea8('0x14')](_0x4ae0d3));}switch(_0x571b43[_0x2ea8('0x15')]){case'US':_0x478244=_0x2ea8('0x16');break;case'AU':_0x478244=_0x2ea8('0x17');break;case'IN':_0x478244=_0x2ea8('0x27');break;case'CN':_0x478244='https://accounts.zoho.com.cn';break;default:_0x478244='https://accounts.zoho.eu';break;}var _0x5086d9={'method':_0x2ea8('0x28'),'uri':_0x478244+_0x2ea8('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x571b43[_0x2ea8('0xf')],'client_secret':_0x571b43[_0x2ea8('0x10')],'redirect_uri':_0x571b43[_0x2ea8('0xe')],'code':_0x571b43[_0x2ea8('0x11')]},'headers':{'Content-Type':_0x2ea8('0x1b')}};return rp(_0x5086d9)[_0x2ea8('0x29')](function(_0x39228b){var _0x47d1e0=JSON[_0x2ea8('0x1c')](_0x39228b);if(_0x47d1e0[_0x2ea8('0x1e')]){_0x571b43[_0x2ea8('0x1d')]=_0x47d1e0[_0x2ea8('0x1e')];logger[_0x2ea8('0x1f')](util['format'](_0x2ea8('0x21'),_0x571b43['name'],_0x571b43['id']));}else{logger[_0x2ea8('0x22')](util[_0x2ea8('0x20')](_0x2ea8('0x23'),_0x571b43['name'],_0x571b43['id']),util[_0x2ea8('0x24')](_0x47d1e0,{'showHidden':![],'depth':null}));}return _0x3ea82e(null,_0x11e7d1);})[_0x2ea8('0x25')](function(_0x10aa22){logger[_0x2ea8('0x22')](util['format'](_0x2ea8('0x23'),_0x571b43[_0x2ea8('0x26')],_0x571b43['id']),util[_0x2ea8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ea82e(_0x10aa22);});}else{return _0x3ea82e(null,_0x11e7d1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d346b47..52749da 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 _0x9ccd=['map','model','ShowZohoAccount','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','findAll','options','raw','attributes','limit','include'];(function(_0x1b3a9e,_0x3b6e29){var _0x53cdc2=function(_0x4b14ec){while(--_0x4b14ec){_0x1b3a9e['push'](_0x1b3a9e['shift']());}};_0x53cdc2(++_0x3b6e29);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f7b2b,_0x23b70a,_0x9e1e10){return new BPromise(function(_0x1a1bd1,_0x20282c){return client[_0xd9cc('0xa')](_0x1f7b2b,_0x9e1e10)[_0xd9cc('0xb')](function(_0x1737e5){logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,'request\x20sent');logger[_0xd9cc('0xe')](_0xd9cc('0xf'),_0x23b70a,_0xd9cc('0x10'),JSON[_0xd9cc('0x11')](_0x1737e5));if(_0x1737e5[_0xd9cc('0x12')]){if(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x13')]===0x1f4){logger[_0xd9cc('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')]['message']);return _0x20282c(_0x1737e5['error']['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x1a1bd1(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);}else{logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,_0xd9cc('0x10'));_0x1a1bd1(_0x1737e5['result'][_0xd9cc('0x14')]);}})[_0xd9cc('0x15')](function(_0x513635){logger[_0xd9cc('0x12')](_0xd9cc('0xd'),_0x23b70a,_0x513635);_0x20282c(_0x513635);});});}exports[_0xd9cc('0x16')]=function(_0x2e2baa){var _0x5a4b50=this;return new Promise(function(_0x37b745,_0x32df89){return db['ZohoAccount'][_0xd9cc('0x17')]({'raw':_0x2e2baa[_0xd9cc('0x18')]?_0x2e2baa[_0xd9cc('0x18')][_0xd9cc('0x19')]===undefined?!![]:![]:!![],'where':_0x2e2baa[_0xd9cc('0x18')]?_0x2e2baa[_0xd9cc('0x18')]['where']||null:null,'attributes':_0x2e2baa['options']?_0x2e2baa[_0xd9cc('0x18')][_0xd9cc('0x1a')]||null:null,'limit':_0x2e2baa[_0xd9cc('0x18')]?_0x2e2baa[_0xd9cc('0x18')][_0xd9cc('0x1b')]||null:null,'include':_0x2e2baa[_0xd9cc('0x18')]?_0x2e2baa[_0xd9cc('0x18')][_0xd9cc('0x1c')]?_[_0xd9cc('0x1d')](_0x2e2baa[_0xd9cc('0x18')][_0xd9cc('0x1c')],function(_0x17cda7){return{'model':db[_0x17cda7[_0xd9cc('0x1e')]],'as':_0x17cda7['as'],'attributes':_0x17cda7[_0xd9cc('0x1a')],'include':_0x17cda7['include']?_[_0xd9cc('0x1d')](_0x17cda7[_0xd9cc('0x1c')],function(_0x5e913b){return{'model':db[_0x5e913b[_0xd9cc('0x1e')]],'as':_0x5e913b['as'],'attributes':_0x5e913b[_0xd9cc('0x1a')],'include':_0x5e913b[_0xd9cc('0x1c')]?_[_0xd9cc('0x1d')](_0x5e913b[_0xd9cc('0x1c')],function(_0x26040f){return{'model':db[_0x26040f[_0xd9cc('0x1e')]],'as':_0x26040f['as'],'attributes':_0x26040f[_0xd9cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9cc('0xb')](function(_0x544172){logger[_0xd9cc('0xc')](_0xd9cc('0x16'),_0x2e2baa);logger[_0xd9cc('0xe')](_0xd9cc('0x16'),_0x2e2baa,JSON[_0xd9cc('0x11')](_0x544172));_0x37b745(_0x544172);})[_0xd9cc('0x15')](function(_0xa01bf4){logger[_0xd9cc('0x12')]('GetZohoAccount',_0xa01bf4[_0xd9cc('0x14')],_0x2e2baa);_0x32df89(_0x5a4b50[_0xd9cc('0x12')](0x1f4,_0xa01bf4[_0xd9cc('0x14')]));});});};exports[_0xd9cc('0x1f')]=function(_0x17bcf8){var _0x2e147a=this;return new Promise(function(_0x4e7742,_0x14d9f5){return db['ZohoAccount']['find']({'raw':_0x17bcf8[_0xd9cc('0x18')]?_0x17bcf8[_0xd9cc('0x18')][_0xd9cc('0x19')]===undefined?!![]:![]:!![],'where':_0x17bcf8['options']?_0x17bcf8[_0xd9cc('0x18')]['where']||null:null,'attributes':_0x17bcf8[_0xd9cc('0x18')]?_0x17bcf8[_0xd9cc('0x18')][_0xd9cc('0x1a')]||null:null,'include':_0x17bcf8['options']?_0x17bcf8[_0xd9cc('0x18')][_0xd9cc('0x1c')]?_[_0xd9cc('0x1d')](_0x17bcf8['options'][_0xd9cc('0x1c')],function(_0x46f50d){return{'model':db[_0x46f50d[_0xd9cc('0x1e')]],'as':_0x46f50d['as'],'attributes':_0x46f50d[_0xd9cc('0x1a')],'include':_0x46f50d[_0xd9cc('0x1c')]?_[_0xd9cc('0x1d')](_0x46f50d[_0xd9cc('0x1c')],function(_0x5959a4){return{'model':db[_0x5959a4[_0xd9cc('0x1e')]],'as':_0x5959a4['as'],'attributes':_0x5959a4[_0xd9cc('0x1a')],'include':_0x5959a4[_0xd9cc('0x1c')]?_['map'](_0x5959a4[_0xd9cc('0x1c')],function(_0x25c811){return{'model':db[_0x25c811[_0xd9cc('0x1e')]],'as':_0x25c811['as'],'attributes':_0x25c811[_0xd9cc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x336e51){logger[_0xd9cc('0xc')](_0xd9cc('0x1f'),_0x17bcf8);logger[_0xd9cc('0xe')](_0xd9cc('0x1f'),_0x17bcf8,JSON[_0xd9cc('0x11')](_0x336e51));_0x4e7742(_0x336e51);})[_0xd9cc('0x15')](function(_0x105815){logger[_0xd9cc('0x12')](_0xd9cc('0x1f'),_0x105815[_0xd9cc('0x14')],_0x17bcf8);_0x14d9f5(_0x2e147a['error'](0x1f4,_0x105815[_0xd9cc('0x14')]));});});}; \ No newline at end of file +var _0xe61c=['lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','GetZohoAccount','where','catch','ShowZohoAccount'];(function(_0x38651d,_0xa0d38b){var _0x4daf9e=function(_0x3b26f7){while(--_0x3b26f7){_0x38651d['push'](_0x38651d['shift']());}};_0x4daf9e(++_0xa0d38b);}(_0xe61c,0xee));var _0xce61=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xe61c[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xce61('0x0'));var util=require('util');var moment=require(_0xce61('0x1'));var BPromise=require(_0xce61('0x2'));var rs=require(_0xce61('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce61('0x4'));var logger=require('../../config/logger')(_0xce61('0x5'));var config=require(_0xce61('0x6'));var jayson=require(_0xce61('0x7'));var client=jayson[_0xce61('0x8')][_0xce61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x310203,_0x24528e,_0x5f1d02){return new BPromise(function(_0x2fad37,_0x4b52c3){return client[_0xce61('0xa')](_0x310203,_0x5f1d02)[_0xce61('0xb')](function(_0xa1a028){logger[_0xce61('0xc')](_0xce61('0xd'),_0x24528e,'request\x20sent');logger[_0xce61('0xe')](_0xce61('0xf'),_0x24528e,'request\x20sent',JSON[_0xce61('0x10')](_0xa1a028));if(_0xa1a028[_0xce61('0x11')]){if(_0xa1a028['error'][_0xce61('0x12')]===0x1f4){logger['error'](_0xce61('0xd'),_0x24528e,_0xa1a028[_0xce61('0x11')]['message']);return _0x4b52c3(_0xa1a028[_0xce61('0x11')]['message']);}logger[_0xce61('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x24528e,_0xa1a028[_0xce61('0x11')][_0xce61('0x13')]);return _0x2fad37(_0xa1a028[_0xce61('0x11')][_0xce61('0x13')]);}else{logger[_0xce61('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x24528e,'request\x20sent');_0x2fad37(_0xa1a028[_0xce61('0x14')]['message']);}})['catch'](function(_0x1977f6){logger[_0xce61('0x11')](_0xce61('0xd'),_0x24528e,_0x1977f6);_0x4b52c3(_0x1977f6);});});}exports['GetZohoAccount']=function(_0x37d4a0){var _0x4baf32=this;return new Promise(function(_0x3df071,_0xafb99e){return db[_0xce61('0x15')][_0xce61('0x16')]({'raw':_0x37d4a0[_0xce61('0x17')]?_0x37d4a0[_0xce61('0x17')][_0xce61('0x18')]===undefined?!![]:![]:!![],'where':_0x37d4a0[_0xce61('0x17')]?_0x37d4a0['options']['where']||null:null,'attributes':_0x37d4a0[_0xce61('0x17')]?_0x37d4a0['options'][_0xce61('0x19')]||null:null,'limit':_0x37d4a0[_0xce61('0x17')]?_0x37d4a0[_0xce61('0x17')][_0xce61('0x1a')]||null:null,'include':_0x37d4a0[_0xce61('0x17')]?_0x37d4a0[_0xce61('0x17')][_0xce61('0x1b')]?_[_0xce61('0x1c')](_0x37d4a0['options']['include'],function(_0x28c7a7){return{'model':db[_0x28c7a7[_0xce61('0x1d')]],'as':_0x28c7a7['as'],'attributes':_0x28c7a7[_0xce61('0x19')],'include':_0x28c7a7[_0xce61('0x1b')]?_[_0xce61('0x1c')](_0x28c7a7[_0xce61('0x1b')],function(_0x471a08){return{'model':db[_0x471a08[_0xce61('0x1d')]],'as':_0x471a08['as'],'attributes':_0x471a08[_0xce61('0x19')],'include':_0x471a08[_0xce61('0x1b')]?_['map'](_0x471a08[_0xce61('0x1b')],function(_0x48b544){return{'model':db[_0x48b544[_0xce61('0x1d')]],'as':_0x48b544['as'],'attributes':_0x48b544[_0xce61('0x19')]};}):[]};}):[]};}):[]:[]})[_0xce61('0xb')](function(_0x23c30d){logger[_0xce61('0xc')]('GetZohoAccount',_0x37d4a0);logger[_0xce61('0xe')](_0xce61('0x1e'),_0x37d4a0,JSON['stringify'](_0x23c30d));_0x3df071(_0x23c30d);})['catch'](function(_0x5cb588){logger[_0xce61('0x11')](_0xce61('0x1e'),_0x5cb588[_0xce61('0x13')],_0x37d4a0);_0xafb99e(_0x4baf32[_0xce61('0x11')](0x1f4,_0x5cb588[_0xce61('0x13')]));});});};exports['ShowZohoAccount']=function(_0x74f1bc){var _0x314d62=this;return new Promise(function(_0x4f73cb,_0x187467){return db[_0xce61('0x15')]['find']({'raw':_0x74f1bc[_0xce61('0x17')]?_0x74f1bc[_0xce61('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x74f1bc[_0xce61('0x17')]?_0x74f1bc['options'][_0xce61('0x1f')]||null:null,'attributes':_0x74f1bc['options']?_0x74f1bc['options']['attributes']||null:null,'include':_0x74f1bc[_0xce61('0x17')]?_0x74f1bc[_0xce61('0x17')][_0xce61('0x1b')]?_[_0xce61('0x1c')](_0x74f1bc[_0xce61('0x17')][_0xce61('0x1b')],function(_0x23688d){return{'model':db[_0x23688d[_0xce61('0x1d')]],'as':_0x23688d['as'],'attributes':_0x23688d[_0xce61('0x19')],'include':_0x23688d[_0xce61('0x1b')]?_[_0xce61('0x1c')](_0x23688d[_0xce61('0x1b')],function(_0x259a75){return{'model':db[_0x259a75[_0xce61('0x1d')]],'as':_0x259a75['as'],'attributes':_0x259a75[_0xce61('0x19')],'include':_0x259a75[_0xce61('0x1b')]?_[_0xce61('0x1c')](_0x259a75[_0xce61('0x1b')],function(_0xdb7a31){return{'model':db[_0xdb7a31[_0xce61('0x1d')]],'as':_0xdb7a31['as'],'attributes':_0xdb7a31['attributes']};}):[]};}):[]};}):[]:[]})[_0xce61('0xb')](function(_0x152856){logger[_0xce61('0xc')]('ShowZohoAccount',_0x74f1bc);logger['debug']('ShowZohoAccount',_0x74f1bc,JSON[_0xce61('0x10')](_0x152856));_0x4f73cb(_0x152856);})[_0xce61('0x20')](function(_0x1b8c66){logger[_0xce61('0x11')](_0xce61('0x21'),_0x1b8c66[_0xce61('0x13')],_0x74f1bc);_0x187467(_0x314d62[_0xce61('0x11')](0x1f4,_0x1b8c66[_0xce61('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 08e94bc..8c233e7 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 _0x61db=['update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x5ccc85,_0x2ae7f4){var _0x478473=function(_0x2ed677){while(--_0x2ed677){_0x5ccc85['push'](_0x5ccc85['shift']());}};_0x478473(++_0x2ae7f4);}(_0x61db,0x130));var _0xb61d=function(_0x4cbf78,_0x206106){_0x4cbf78=_0x4cbf78-0x0;var _0x2ae4f8=_0x61db[_0x4cbf78];return _0x2ae4f8;};'use strict';var multer=require(_0xb61d('0x0'));var util=require(_0xb61d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb61d('0x2'));var router=express[_0xb61d('0x3')]();var fs_extra=require(_0xb61d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb61d('0x5'));var config=require(_0xb61d('0x6'));var controller=require(_0xb61d('0x7'));router['get']('/',auth[_0xb61d('0x8')](),controller[_0xb61d('0x9')]);router[_0xb61d('0xa')](_0xb61d('0xb'),auth['isAuthenticated'](),controller[_0xb61d('0xc')]);router[_0xb61d('0xa')](_0xb61d('0xd'),auth[_0xb61d('0x8')](),controller[_0xb61d('0xe')]);router[_0xb61d('0xa')](_0xb61d('0xf'),auth[_0xb61d('0x8')](),controller[_0xb61d('0x10')]);router['get'](_0xb61d('0x11'),auth[_0xb61d('0x8')](),controller[_0xb61d('0x12')]);router[_0xb61d('0x13')]('/',auth[_0xb61d('0x8')](),controller[_0xb61d('0x14')]);router['put'](_0xb61d('0xb'),auth[_0xb61d('0x8')](),controller[_0xb61d('0x15')]);router[_0xb61d('0x16')]('/:id',auth[_0xb61d('0x8')](),controller[_0xb61d('0x17')]);module[_0xb61d('0x18')]=router; \ No newline at end of file +var _0x1696=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x1696,0x1c5));var _0x6169=function(_0x5b8d27,_0x19566d){_0x5b8d27=_0x5b8d27-0x0;var _0x597ffe=_0x1696[_0x5b8d27];return _0x597ffe;};'use strict';var multer=require(_0x6169('0x0'));var util=require(_0x6169('0x1'));var path=require(_0x6169('0x2'));var timeout=require('connect-timeout');var express=require(_0x6169('0x3'));var router=express[_0x6169('0x4')]();var fs_extra=require(_0x6169('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6169('0x6'));var config=require(_0x6169('0x7'));var controller=require(_0x6169('0x8'));router[_0x6169('0x9')]('/',auth[_0x6169('0xa')](),controller['index']);router[_0x6169('0x9')](_0x6169('0xb'),auth[_0x6169('0xa')](),controller[_0x6169('0xc')]);router['get']('/:id/fields',auth[_0x6169('0xa')](),controller[_0x6169('0xd')]);router['get'](_0x6169('0xe'),auth[_0x6169('0xa')](),controller[_0x6169('0xf')]);router['get']('/:id/descriptions',auth[_0x6169('0xa')](),controller[_0x6169('0x10')]);router[_0x6169('0x11')]('/',auth['isAuthenticated'](),controller[_0x6169('0x12')]);router[_0x6169('0x13')](_0x6169('0xb'),auth[_0x6169('0xa')](),controller['update']);router['delete'](_0x6169('0xb'),auth['isAuthenticated'](),controller[_0x6169('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index e73a935..ef54763 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 _0x5809=['STRING','sequelize','ENUM','lead','contact','nothing','contact_lead'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0x5809,0x78));var _0x9580=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5809[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9580('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x9580('0x1')](_0x9580('0x2'),_0x9580('0x3'),_0x9580('0x4')),'defaultValue':_0x9580('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x9580('0x5'),_0x9580('0x3'),_0x9580('0x2')),'defaultValue':_0x9580('0x5')},'description':{'type':Sequelize[_0x9580('0x6')]}}; \ No newline at end of file +var _0xc58a=['nothing','contact_lead','exports','STRING','ENUM','lead','contact'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xc58a,0x64));var _0xac58=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xc58a[_0x39e84d];return _0x1991bc;};'use strict';var Sequelize=require('sequelize');module[_0xac58('0x0')]={'name':{'type':Sequelize[_0xac58('0x1')]},'moduleCreate':{'type':Sequelize[_0xac58('0x2')](_0xac58('0x3'),_0xac58('0x4'),_0xac58('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xac58('0x6'),_0xac58('0x4'),_0xac58('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xac58('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d6e5e79..8d7c607 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 _0x6579=['fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','body','findOne','ZohoField','map','getFields','getSubjects','getDescriptions','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZohoConfiguration','rawAttributes'];(function(_0x5a3b6f,_0x403e76){var _0x38bdef=function(_0x5844b5){while(--_0x5844b5){_0x5a3b6f['push'](_0x5a3b6f['shift']());}};_0x38bdef(++_0x403e76);}(_0x6579,0x16c));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9657('0x0'));var rimraf=require(_0x9657('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9657('0x2'));var rp=require(_0x9657('0x3'));var moment=require('moment');var BPromise=require(_0x9657('0x4'));var Mustache=require('mustache');var util=require(_0x9657('0x5'));var path=require(_0x9657('0x6'));var sox=require('sox');var csv=require(_0x9657('0x7'));var ejs=require(_0x9657('0x8'));var fs=require('fs');var fs_extra=require(_0x9657('0x9'));var _=require(_0x9657('0xa'));var squel=require(_0x9657('0xb'));var crypto=require(_0x9657('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9657('0xd'));var toCsv=require(_0x9657('0x7'));var querystring=require('querystring');var Papa=require(_0x9657('0xe'));var Redis=require(_0x9657('0xf'));var authService=require(_0x9657('0x10'));var qs=require(_0x9657('0x11'));var as=require(_0x9657('0x12'));var hardwareService=require(_0x9657('0x13'));var logger=require(_0x9657('0x14'))(_0x9657('0x15'));var utils=require('../../config/utils');var config=require(_0x9657('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9657('0x17'))['db'];function respondWithStatusCode(_0xbcc8fd,_0x4d9e4f){_0x4d9e4f=_0x4d9e4f||0xcc;return function(_0x27c10b){if(_0x27c10b){return _0xbcc8fd[_0x9657('0x18')](_0x4d9e4f);}return _0xbcc8fd[_0x9657('0x19')](_0x4d9e4f)[_0x9657('0x1a')]();};}function respondWithResult(_0x3a8010,_0x3ab375){_0x3ab375=_0x3ab375||0xc8;return function(_0x3e86f7){if(_0x3e86f7){return _0x3a8010[_0x9657('0x19')](_0x3ab375)[_0x9657('0x1b')](_0x3e86f7);}};}function respondWithFilteredResult(_0x443b30,_0x210951){return function(_0x415f33){if(_0x415f33){var _0x98b9da=typeof _0x210951['offset']===_0x9657('0x1c')&&typeof _0x210951[_0x9657('0x1d')]===_0x9657('0x1c');var _0x207d26=_0x415f33[_0x9657('0x1e')];var _0x1d7a98=_0x98b9da?0x0:_0x210951['offset'];var _0x3bd7ba=_0x98b9da?_0x415f33[_0x9657('0x1e')]:_0x210951[_0x9657('0x1f')]+_0x210951['limit'];var _0x509d88;if(_0x3bd7ba>=_0x207d26){_0x3bd7ba=_0x207d26;_0x509d88=0xc8;}else{_0x509d88=0xce;}_0x443b30[_0x9657('0x19')](_0x509d88);return _0x443b30[_0x9657('0x20')](_0x9657('0x21'),_0x1d7a98+'-'+_0x3bd7ba+'/'+_0x207d26)[_0x9657('0x1b')](_0x415f33);}return null;};}function patchUpdates(_0x5cc18d){return function(_0x565691){try{jsonpatch[_0x9657('0x22')](_0x565691,_0x5cc18d,!![]);}catch(_0x50ba50){return BPromise['reject'](_0x50ba50);}return _0x565691[_0x9657('0x23')]();};}function saveUpdates(_0xbf7363,_0x191b5b){return function(_0x3bbf42){if(_0x3bbf42){return _0x3bbf42[_0x9657('0x24')](_0xbf7363)[_0x9657('0x25')](function(_0x3b1a3e){return _0x3b1a3e;});}return null;};}function removeEntity(_0x10175b,_0x2db13b){return function(_0x2432c7){if(_0x2432c7){return _0x2432c7[_0x9657('0x26')]()['then'](function(){_0x10175b[_0x9657('0x19')](0xcc)[_0x9657('0x1a')]();});}};}function handleEntityNotFound(_0x55da6b,_0x38a443){return function(_0x1708f5){if(!_0x1708f5){_0x55da6b[_0x9657('0x18')](0x194);}return _0x1708f5;};}function handleError(_0x1e68f4,_0x55eb2a){_0x55eb2a=_0x55eb2a||0x1f4;return function(_0x5ea411){logger[_0x9657('0x27')](_0x5ea411[_0x9657('0x28')]);if(_0x5ea411[_0x9657('0x29')]){delete _0x5ea411[_0x9657('0x29')];}_0x1e68f4[_0x9657('0x19')](_0x55eb2a)[_0x9657('0x2a')](_0x5ea411);};}exports[_0x9657('0x2b')]=function(_0x4efc4b,_0x2f9f72){var _0x5d7bd1={},_0x10f960={},_0xb138d2={'count':0x0,'rows':[]};var _0x4421b4=_['map'](db[_0x9657('0x2c')][_0x9657('0x2d')],function(_0x39461b){return{'name':_0x39461b[_0x9657('0x2e')],'type':_0x39461b[_0x9657('0x2f')][_0x9657('0x30')]};});_0x10f960['model']=_['map'](_0x4421b4,_0x9657('0x29'));_0x10f960[_0x9657('0x31')]=_['keys'](_0x4efc4b[_0x9657('0x31')]);_0x10f960['filters']=_[_0x9657('0x32')](_0x10f960[_0x9657('0x33')],_0x10f960[_0x9657('0x31')]);_0x5d7bd1['attributes']=_['intersection'](_0x10f960[_0x9657('0x33')],qs[_0x9657('0x34')](_0x4efc4b[_0x9657('0x31')][_0x9657('0x34')]));_0x5d7bd1[_0x9657('0x35')]=_0x5d7bd1[_0x9657('0x35')][_0x9657('0x36')]?_0x5d7bd1[_0x9657('0x35')]:_0x10f960['model'];if(!_0x4efc4b[_0x9657('0x31')][_0x9657('0x37')]('nolimit')){_0x5d7bd1[_0x9657('0x1d')]=qs[_0x9657('0x1d')](_0x4efc4b['query'][_0x9657('0x1d')]);_0x5d7bd1[_0x9657('0x1f')]=qs['offset'](_0x4efc4b[_0x9657('0x31')][_0x9657('0x1f')]);}_0x5d7bd1[_0x9657('0x38')]=qs['sort'](_0x4efc4b[_0x9657('0x31')][_0x9657('0x39')]);_0x5d7bd1[_0x9657('0x3a')]=qs[_0x9657('0x3b')](_[_0x9657('0x3c')](_0x4efc4b[_0x9657('0x31')],_0x10f960[_0x9657('0x3b')]),_0x4421b4);if(_0x4efc4b[_0x9657('0x31')][_0x9657('0x3d')]){_0x5d7bd1[_0x9657('0x3a')]=_['merge'](_0x5d7bd1[_0x9657('0x3a')],{'$or':_['map'](_0x4421b4,function(_0x83d604){if(_0x83d604[_0x9657('0x2f')]!==_0x9657('0x3e')){var _0x240cd1={};_0x240cd1[_0x83d604[_0x9657('0x29')]]={'$like':'%'+_0x4efc4b[_0x9657('0x31')][_0x9657('0x3d')]+'%'};return _0x240cd1;}})});}_0x5d7bd1=_[_0x9657('0x3f')]({},_0x5d7bd1,_0x4efc4b[_0x9657('0x40')]);var _0x57e6b4={'where':_0x5d7bd1[_0x9657('0x3a')]};return db['ZohoConfiguration'][_0x9657('0x1e')](_0x57e6b4)[_0x9657('0x25')](function(_0xf33cf3){_0xb138d2[_0x9657('0x1e')]=_0xf33cf3;if(_0x4efc4b['query']['includeAll']){_0x5d7bd1[_0x9657('0x41')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x5d7bd1);})[_0x9657('0x25')](function(_0x91a8aa){_0xb138d2[_0x9657('0x42')]=_0x91a8aa;return _0xb138d2;})[_0x9657('0x25')](respondWithFilteredResult(_0x2f9f72,_0x5d7bd1))[_0x9657('0x43')](handleError(_0x2f9f72,null));};exports[_0x9657('0x44')]=function(_0x3a144f,_0x37ac81){var _0x15bd23={'raw':![],'where':{'id':_0x3a144f[_0x9657('0x45')]['id']}},_0x27fab3={};_0x27fab3['model']=_[_0x9657('0x46')](db[_0x9657('0x2c')][_0x9657('0x2d')]);_0x27fab3[_0x9657('0x31')]=_[_0x9657('0x46')](_0x3a144f[_0x9657('0x31')]);_0x27fab3[_0x9657('0x3b')]=_[_0x9657('0x32')](_0x27fab3[_0x9657('0x33')],_0x27fab3[_0x9657('0x31')]);_0x15bd23[_0x9657('0x35')]=_[_0x9657('0x32')](_0x27fab3[_0x9657('0x33')],qs['fields'](_0x3a144f[_0x9657('0x31')][_0x9657('0x34')]));_0x15bd23[_0x9657('0x35')]=_0x15bd23[_0x9657('0x35')]['length']?_0x15bd23[_0x9657('0x35')]:_0x27fab3[_0x9657('0x33')];if(_0x3a144f['query'][_0x9657('0x47')]){_0x15bd23[_0x9657('0x41')]=[{'all':!![]}];}_0x15bd23=_[_0x9657('0x3f')]({},_0x15bd23,_0x3a144f[_0x9657('0x40')]);return db[_0x9657('0x2c')][_0x9657('0x48')](_0x15bd23)['then'](handleEntityNotFound(_0x37ac81,null))[_0x9657('0x25')](respondWithResult(_0x37ac81,null))['catch'](handleError(_0x37ac81,null));};exports['create']=function(_0x4fc6fc,_0x563a1b){return db[_0x9657('0x2c')][_0x9657('0x49')](_0x4fc6fc['body'],{})[_0x9657('0x25')](respondWithResult(_0x563a1b,0xc9))[_0x9657('0x43')](handleError(_0x563a1b,null));};exports[_0x9657('0x24')]=function(_0x3bee45,_0x4c8018){if(_0x3bee45[_0x9657('0x4a')]['id']){delete _0x3bee45[_0x9657('0x4a')]['id'];}return db[_0x9657('0x2c')]['find']({'where':{'id':_0x3bee45[_0x9657('0x45')]['id']}})[_0x9657('0x25')](handleEntityNotFound(_0x4c8018,null))[_0x9657('0x25')](saveUpdates(_0x3bee45[_0x9657('0x4a')],null))[_0x9657('0x25')](respondWithResult(_0x4c8018,null))[_0x9657('0x43')](handleError(_0x4c8018,null));};exports['destroy']=function(_0x457c5b,_0x1ffeec){return db[_0x9657('0x2c')]['find']({'where':{'id':_0x457c5b[_0x9657('0x45')]['id']}})[_0x9657('0x25')](handleEntityNotFound(_0x1ffeec,null))[_0x9657('0x25')](removeEntity(_0x1ffeec,null))[_0x9657('0x43')](handleError(_0x1ffeec,null));};exports['getFields']=function(_0x388e48,_0x5b3361,_0xa5488){var _0x3323a2={};var _0x251a82={};var _0x353713;var _0x50ecda;return db[_0x9657('0x2c')][_0x9657('0x4b')]({'where':{'id':_0x388e48[_0x9657('0x45')]['id']}})[_0x9657('0x25')](handleEntityNotFound(_0x5b3361,null))[_0x9657('0x25')](function(_0x58182e){if(_0x58182e){_0x353713=_0x58182e;_0x251a82[_0x9657('0x33')]=_['keys'](db[_0x9657('0x4c')]['rawAttributes']);_0x251a82[_0x9657('0x31')]=_[_0x9657('0x46')](_0x388e48[_0x9657('0x31')]);_0x251a82['filters']=_['intersection'](_0x251a82[_0x9657('0x33')],_0x251a82['query']);_0x3323a2['attributes']=_[_0x9657('0x32')](_0x251a82[_0x9657('0x33')],qs['fields'](_0x388e48[_0x9657('0x31')][_0x9657('0x34')]));_0x3323a2[_0x9657('0x35')]=_0x3323a2[_0x9657('0x35')]['length']?_0x3323a2['attributes']:_0x251a82['model'];_0x3323a2[_0x9657('0x38')]=qs[_0x9657('0x39')](_0x388e48[_0x9657('0x31')][_0x9657('0x39')]);_0x3323a2['where']=qs[_0x9657('0x3b')](_['pick'](_0x388e48[_0x9657('0x31')],_0x251a82[_0x9657('0x3b')]));if(_0x388e48[_0x9657('0x31')][_0x9657('0x3d')]){_0x3323a2[_0x9657('0x3a')]=_[_0x9657('0x3f')](_0x3323a2[_0x9657('0x3a')],{'$or':_[_0x9657('0x4d')](_0x3323a2[_0x9657('0x35')],function(_0x3be269){var _0x28caa3={};_0x28caa3[_0x3be269]={'$like':'%'+_0x388e48['query'][_0x9657('0x3d')]+'%'};return _0x28caa3;})});}_0x3323a2=_[_0x9657('0x3f')]({},_0x3323a2,_0x388e48[_0x9657('0x40')]);return _0x353713['getFields'](_0x3323a2);}})[_0x9657('0x25')](function(_0x53bce4){if(_0x53bce4){_0x50ecda=_0x53bce4[_0x9657('0x36')];if(!_0x388e48[_0x9657('0x31')][_0x9657('0x37')]('nolimit')){_0x3323a2[_0x9657('0x1d')]=qs[_0x9657('0x1d')](_0x388e48[_0x9657('0x31')][_0x9657('0x1d')]);_0x3323a2[_0x9657('0x1f')]=qs[_0x9657('0x1f')](_0x388e48['query'][_0x9657('0x1f')]);}return _0x353713[_0x9657('0x4e')](_0x3323a2);}})[_0x9657('0x25')](function(_0x5e9b26){if(_0x5e9b26){return _0x5e9b26?{'count':_0x50ecda,'rows':_0x5e9b26}:null;}})[_0x9657('0x25')](respondWithResult(_0x5b3361,null))[_0x9657('0x43')](handleError(_0x5b3361,null));};exports[_0x9657('0x4f')]=function(_0x34a041,_0x570a49,_0x5b3760){var _0x269705={};var _0x88bca8={};var _0x544897;var _0x4b21a8;return db[_0x9657('0x2c')][_0x9657('0x4b')]({'where':{'id':_0x34a041[_0x9657('0x45')]['id']}})['then'](handleEntityNotFound(_0x570a49,null))[_0x9657('0x25')](function(_0x1c2472){if(_0x1c2472){_0x544897=_0x1c2472;_0x88bca8[_0x9657('0x33')]=_[_0x9657('0x46')](db[_0x9657('0x4c')]['rawAttributes']);_0x88bca8[_0x9657('0x31')]=_[_0x9657('0x46')](_0x34a041['query']);_0x88bca8[_0x9657('0x3b')]=_[_0x9657('0x32')](_0x88bca8[_0x9657('0x33')],_0x88bca8['query']);_0x269705['attributes']=_[_0x9657('0x32')](_0x88bca8[_0x9657('0x33')],qs[_0x9657('0x34')](_0x34a041[_0x9657('0x31')][_0x9657('0x34')]));_0x269705[_0x9657('0x35')]=_0x269705['attributes'][_0x9657('0x36')]?_0x269705[_0x9657('0x35')]:_0x88bca8[_0x9657('0x33')];_0x269705[_0x9657('0x38')]=qs[_0x9657('0x39')](_0x34a041[_0x9657('0x31')]['sort']);_0x269705[_0x9657('0x3a')]=qs['filters'](_[_0x9657('0x3c')](_0x34a041[_0x9657('0x31')],_0x88bca8['filters']));if(_0x34a041[_0x9657('0x31')][_0x9657('0x3d')]){_0x269705[_0x9657('0x3a')]=_[_0x9657('0x3f')](_0x269705[_0x9657('0x3a')],{'$or':_[_0x9657('0x4d')](_0x269705[_0x9657('0x35')],function(_0x3cf5b6){var _0x4b1a6f={};_0x4b1a6f[_0x3cf5b6]={'$like':'%'+_0x34a041['query'][_0x9657('0x3d')]+'%'};return _0x4b1a6f;})});}_0x269705=_[_0x9657('0x3f')]({},_0x269705,_0x34a041[_0x9657('0x40')]);return _0x544897['getSubjects'](_0x269705);}})[_0x9657('0x25')](function(_0x4d688a){if(_0x4d688a){_0x4b21a8=_0x4d688a['length'];if(!_0x34a041[_0x9657('0x31')][_0x9657('0x37')]('nolimit')){_0x269705[_0x9657('0x1d')]=qs[_0x9657('0x1d')](_0x34a041['query'][_0x9657('0x1d')]);_0x269705['offset']=qs[_0x9657('0x1f')](_0x34a041[_0x9657('0x31')]['offset']);}return _0x544897['getSubjects'](_0x269705);}})['then'](function(_0x381a3a){if(_0x381a3a){return _0x381a3a?{'count':_0x4b21a8,'rows':_0x381a3a}:null;}})[_0x9657('0x25')](respondWithResult(_0x570a49,null))[_0x9657('0x43')](handleError(_0x570a49,null));};exports[_0x9657('0x50')]=function(_0xd1bf87,_0xb90007,_0x251061){var _0x485b54={};var _0xb7fe8f={};var _0x34e165;var _0x5b8bfc;return db['ZohoConfiguration'][_0x9657('0x4b')]({'where':{'id':_0xd1bf87['params']['id']}})[_0x9657('0x25')](handleEntityNotFound(_0xb90007,null))[_0x9657('0x25')](function(_0x4d7d59){if(_0x4d7d59){_0x34e165=_0x4d7d59;_0xb7fe8f[_0x9657('0x33')]=_[_0x9657('0x46')](db['ZohoField']['rawAttributes']);_0xb7fe8f[_0x9657('0x31')]=_[_0x9657('0x46')](_0xd1bf87[_0x9657('0x31')]);_0xb7fe8f[_0x9657('0x3b')]=_[_0x9657('0x32')](_0xb7fe8f[_0x9657('0x33')],_0xb7fe8f[_0x9657('0x31')]);_0x485b54[_0x9657('0x35')]=_['intersection'](_0xb7fe8f[_0x9657('0x33')],qs[_0x9657('0x34')](_0xd1bf87[_0x9657('0x31')][_0x9657('0x34')]));_0x485b54['attributes']=_0x485b54[_0x9657('0x35')][_0x9657('0x36')]?_0x485b54[_0x9657('0x35')]:_0xb7fe8f[_0x9657('0x33')];_0x485b54['order']=qs[_0x9657('0x39')](_0xd1bf87[_0x9657('0x31')][_0x9657('0x39')]);_0x485b54[_0x9657('0x3a')]=qs[_0x9657('0x3b')](_[_0x9657('0x3c')](_0xd1bf87[_0x9657('0x31')],_0xb7fe8f[_0x9657('0x3b')]));if(_0xd1bf87['query'][_0x9657('0x3d')]){_0x485b54[_0x9657('0x3a')]=_[_0x9657('0x3f')](_0x485b54[_0x9657('0x3a')],{'$or':_[_0x9657('0x4d')](_0x485b54[_0x9657('0x35')],function(_0x280cef){var _0x104c47={};_0x104c47[_0x280cef]={'$like':'%'+_0xd1bf87[_0x9657('0x31')][_0x9657('0x3d')]+'%'};return _0x104c47;})});}_0x485b54=_[_0x9657('0x3f')]({},_0x485b54,_0xd1bf87[_0x9657('0x40')]);return _0x34e165['getDescriptions'](_0x485b54);}})['then'](function(_0x2a1bdf){if(_0x2a1bdf){_0x5b8bfc=_0x2a1bdf[_0x9657('0x36')];if(!_0xd1bf87[_0x9657('0x31')][_0x9657('0x37')](_0x9657('0x51'))){_0x485b54[_0x9657('0x1d')]=qs['limit'](_0xd1bf87['query'][_0x9657('0x1d')]);_0x485b54[_0x9657('0x1f')]=qs[_0x9657('0x1f')](_0xd1bf87[_0x9657('0x31')][_0x9657('0x1f')]);}return _0x34e165[_0x9657('0x50')](_0x485b54);}})[_0x9657('0x25')](function(_0x422505){if(_0x422505){return _0x422505?{'count':_0x5b8bfc,'rows':_0x422505}:null;}})[_0x9657('0x25')](respondWithResult(_0xb90007,null))[_0x9657('0x43')](handleError(_0xb90007,null));}; \ No newline at end of file +var _0xc9d7=['getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','name','index','map','ZohoConfiguration','rawAttributes','fieldName','key','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','options','includeAll','findAll','catch','show','model','fields','include','create','body','find','params','findOne','getFields','ZohoField'];(function(_0x427fa9,_0x41e993){var _0x14c155=function(_0x557f87){while(--_0x557f87){_0x427fa9['push'](_0x427fa9['shift']());}};_0x14c155(++_0x41e993);}(_0xc9d7,0xf3));var _0x7c9d=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xc9d7[_0xcfeda9];return _0x4826c7;};'use strict';var emlformat=require(_0x7c9d('0x0'));var rimraf=require(_0x7c9d('0x1'));var zipdir=require(_0x7c9d('0x2'));var jsonpatch=require(_0x7c9d('0x3'));var rp=require(_0x7c9d('0x4'));var moment=require(_0x7c9d('0x5'));var BPromise=require(_0x7c9d('0x6'));var Mustache=require(_0x7c9d('0x7'));var util=require('util');var path=require(_0x7c9d('0x8'));var sox=require(_0x7c9d('0x9'));var csv=require(_0x7c9d('0xa'));var ejs=require(_0x7c9d('0xb'));var fs=require('fs');var fs_extra=require(_0x7c9d('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c9d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c9d('0xe'));var toCsv=require(_0x7c9d('0xa'));var querystring=require(_0x7c9d('0xf'));var Papa=require(_0x7c9d('0x10'));var Redis=require('ioredis');var authService=require(_0x7c9d('0x11'));var qs=require(_0x7c9d('0x12'));var as=require(_0x7c9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c9d('0x14'));var utils=require(_0x7c9d('0x15'));var config=require(_0x7c9d('0x16'));var licenseUtil=require(_0x7c9d('0x17'));var db=require(_0x7c9d('0x18'))['db'];function respondWithStatusCode(_0x55b7d4,_0x5e907c){_0x5e907c=_0x5e907c||0xcc;return function(_0x23b9c1){if(_0x23b9c1){return _0x55b7d4[_0x7c9d('0x19')](_0x5e907c);}return _0x55b7d4[_0x7c9d('0x1a')](_0x5e907c)['end']();};}function respondWithResult(_0x11de13,_0x2cc64e){_0x2cc64e=_0x2cc64e||0xc8;return function(_0x58191b){if(_0x58191b){return _0x11de13[_0x7c9d('0x1a')](_0x2cc64e)[_0x7c9d('0x1b')](_0x58191b);}};}function respondWithFilteredResult(_0xc62787,_0x2ef7dc){return function(_0x25bc3d){if(_0x25bc3d){var _0x2b647c=typeof _0x2ef7dc[_0x7c9d('0x1c')]===_0x7c9d('0x1d')&&typeof _0x2ef7dc['limit']==='undefined';var _0x50a320=_0x25bc3d[_0x7c9d('0x1e')];var _0x5a18ed=_0x2b647c?0x0:_0x2ef7dc['offset'];var _0x45b6f8=_0x2b647c?_0x25bc3d[_0x7c9d('0x1e')]:_0x2ef7dc[_0x7c9d('0x1c')]+_0x2ef7dc[_0x7c9d('0x1f')];var _0x1003ad;if(_0x45b6f8>=_0x50a320){_0x45b6f8=_0x50a320;_0x1003ad=0xc8;}else{_0x1003ad=0xce;}_0xc62787[_0x7c9d('0x1a')](_0x1003ad);return _0xc62787[_0x7c9d('0x20')]('Content-Range',_0x5a18ed+'-'+_0x45b6f8+'/'+_0x50a320)[_0x7c9d('0x1b')](_0x25bc3d);}return null;};}function patchUpdates(_0x45d6dd){return function(_0x54f0aa){try{jsonpatch[_0x7c9d('0x21')](_0x54f0aa,_0x45d6dd,!![]);}catch(_0x25c93b){return BPromise[_0x7c9d('0x22')](_0x25c93b);}return _0x54f0aa[_0x7c9d('0x23')]();};}function saveUpdates(_0x2feaa0,_0x36e87c){return function(_0x4f3ecb){if(_0x4f3ecb){return _0x4f3ecb[_0x7c9d('0x24')](_0x2feaa0)[_0x7c9d('0x25')](function(_0x49559d){return _0x49559d;});}return null;};}function removeEntity(_0x8f5838,_0x4c7d9c){return function(_0x39b1dd){if(_0x39b1dd){return _0x39b1dd[_0x7c9d('0x26')]()['then'](function(){_0x8f5838[_0x7c9d('0x1a')](0xcc)[_0x7c9d('0x27')]();});}};}function handleEntityNotFound(_0x4c5c24,_0x3d3773){return function(_0x400469){if(!_0x400469){_0x4c5c24[_0x7c9d('0x19')](0x194);}return _0x400469;};}function handleError(_0x469c12,_0x5e4511){_0x5e4511=_0x5e4511||0x1f4;return function(_0x487497){logger[_0x7c9d('0x28')](_0x487497['stack']);if(_0x487497[_0x7c9d('0x29')]){delete _0x487497[_0x7c9d('0x29')];}_0x469c12[_0x7c9d('0x1a')](_0x5e4511)['send'](_0x487497);};}exports[_0x7c9d('0x2a')]=function(_0xadcda6,_0x577666){var _0x1b6acf={},_0x25d3b7={},_0x28ef5a={'count':0x0,'rows':[]};var _0x16d527=_[_0x7c9d('0x2b')](db[_0x7c9d('0x2c')][_0x7c9d('0x2d')],function(_0x51a22d){return{'name':_0x51a22d[_0x7c9d('0x2e')],'type':_0x51a22d['type'][_0x7c9d('0x2f')]};});_0x25d3b7['model']=_[_0x7c9d('0x2b')](_0x16d527,_0x7c9d('0x29'));_0x25d3b7[_0x7c9d('0x30')]=_[_0x7c9d('0x31')](_0xadcda6[_0x7c9d('0x30')]);_0x25d3b7['filters']=_[_0x7c9d('0x32')](_0x25d3b7['model'],_0x25d3b7[_0x7c9d('0x30')]);_0x1b6acf[_0x7c9d('0x33')]=_['intersection'](_0x25d3b7['model'],qs['fields'](_0xadcda6[_0x7c9d('0x30')]['fields']));_0x1b6acf[_0x7c9d('0x33')]=_0x1b6acf[_0x7c9d('0x33')][_0x7c9d('0x34')]?_0x1b6acf['attributes']:_0x25d3b7['model'];if(!_0xadcda6[_0x7c9d('0x30')][_0x7c9d('0x35')]('nolimit')){_0x1b6acf[_0x7c9d('0x1f')]=qs[_0x7c9d('0x1f')](_0xadcda6[_0x7c9d('0x30')][_0x7c9d('0x1f')]);_0x1b6acf[_0x7c9d('0x1c')]=qs[_0x7c9d('0x1c')](_0xadcda6['query']['offset']);}_0x1b6acf[_0x7c9d('0x36')]=qs[_0x7c9d('0x37')](_0xadcda6[_0x7c9d('0x30')]['sort']);_0x1b6acf[_0x7c9d('0x38')]=qs['filters'](_[_0x7c9d('0x39')](_0xadcda6[_0x7c9d('0x30')],_0x25d3b7[_0x7c9d('0x3a')]),_0x16d527);if(_0xadcda6[_0x7c9d('0x30')][_0x7c9d('0x3b')]){_0x1b6acf[_0x7c9d('0x38')]=_[_0x7c9d('0x3c')](_0x1b6acf[_0x7c9d('0x38')],{'$or':_[_0x7c9d('0x2b')](_0x16d527,function(_0x4e83ec){if(_0x4e83ec[_0x7c9d('0x3d')]!=='VIRTUAL'){var _0x41e1ba={};_0x41e1ba[_0x4e83ec[_0x7c9d('0x29')]]={'$like':'%'+_0xadcda6['query'][_0x7c9d('0x3b')]+'%'};return _0x41e1ba;}})});}_0x1b6acf=_[_0x7c9d('0x3c')]({},_0x1b6acf,_0xadcda6[_0x7c9d('0x3e')]);var _0x1b9630={'where':_0x1b6acf['where']};return db[_0x7c9d('0x2c')][_0x7c9d('0x1e')](_0x1b9630)[_0x7c9d('0x25')](function(_0x38d9bd){_0x28ef5a[_0x7c9d('0x1e')]=_0x38d9bd;if(_0xadcda6['query'][_0x7c9d('0x3f')]){_0x1b6acf['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7c9d('0x40')](_0x1b6acf);})[_0x7c9d('0x25')](function(_0x455f9b){_0x28ef5a['rows']=_0x455f9b;return _0x28ef5a;})[_0x7c9d('0x25')](respondWithFilteredResult(_0x577666,_0x1b6acf))[_0x7c9d('0x41')](handleError(_0x577666,null));};exports[_0x7c9d('0x42')]=function(_0x417e35,_0x445451){var _0x3728f3={'raw':![],'where':{'id':_0x417e35['params']['id']}},_0x2e4cee={};_0x2e4cee[_0x7c9d('0x43')]=_[_0x7c9d('0x31')](db[_0x7c9d('0x2c')][_0x7c9d('0x2d')]);_0x2e4cee[_0x7c9d('0x30')]=_[_0x7c9d('0x31')](_0x417e35['query']);_0x2e4cee[_0x7c9d('0x3a')]=_[_0x7c9d('0x32')](_0x2e4cee['model'],_0x2e4cee[_0x7c9d('0x30')]);_0x3728f3[_0x7c9d('0x33')]=_[_0x7c9d('0x32')](_0x2e4cee[_0x7c9d('0x43')],qs['fields'](_0x417e35['query'][_0x7c9d('0x44')]));_0x3728f3[_0x7c9d('0x33')]=_0x3728f3[_0x7c9d('0x33')][_0x7c9d('0x34')]?_0x3728f3[_0x7c9d('0x33')]:_0x2e4cee[_0x7c9d('0x43')];if(_0x417e35[_0x7c9d('0x30')][_0x7c9d('0x3f')]){_0x3728f3[_0x7c9d('0x45')]=[{'all':!![]}];}_0x3728f3=_[_0x7c9d('0x3c')]({},_0x3728f3,_0x417e35[_0x7c9d('0x3e')]);return db['ZohoConfiguration']['find'](_0x3728f3)[_0x7c9d('0x25')](handleEntityNotFound(_0x445451,null))[_0x7c9d('0x25')](respondWithResult(_0x445451,null))['catch'](handleError(_0x445451,null));};exports['create']=function(_0x1a6082,_0x455ac3){return db[_0x7c9d('0x2c')][_0x7c9d('0x46')](_0x1a6082['body'],{})['then'](respondWithResult(_0x455ac3,0xc9))[_0x7c9d('0x41')](handleError(_0x455ac3,null));};exports['update']=function(_0x166ad4,_0x4e83c9){if(_0x166ad4[_0x7c9d('0x47')]['id']){delete _0x166ad4[_0x7c9d('0x47')]['id'];}return db[_0x7c9d('0x2c')][_0x7c9d('0x48')]({'where':{'id':_0x166ad4['params']['id']}})['then'](handleEntityNotFound(_0x4e83c9,null))[_0x7c9d('0x25')](saveUpdates(_0x166ad4['body'],null))[_0x7c9d('0x25')](respondWithResult(_0x4e83c9,null))[_0x7c9d('0x41')](handleError(_0x4e83c9,null));};exports[_0x7c9d('0x26')]=function(_0x33840f,_0x36991e){return db[_0x7c9d('0x2c')][_0x7c9d('0x48')]({'where':{'id':_0x33840f[_0x7c9d('0x49')]['id']}})[_0x7c9d('0x25')](handleEntityNotFound(_0x36991e,null))[_0x7c9d('0x25')](removeEntity(_0x36991e,null))[_0x7c9d('0x41')](handleError(_0x36991e,null));};exports['getFields']=function(_0x5535d1,_0x231fb9,_0x4f7186){var _0x311724={};var _0x1e5aec={};var _0xf9a8cf;var _0x5b29bb;return db[_0x7c9d('0x2c')][_0x7c9d('0x4a')]({'where':{'id':_0x5535d1['params']['id']}})['then'](handleEntityNotFound(_0x231fb9,null))['then'](function(_0x3d00b9){if(_0x3d00b9){_0xf9a8cf=_0x3d00b9;_0x1e5aec[_0x7c9d('0x43')]=_[_0x7c9d('0x31')](db['ZohoField'][_0x7c9d('0x2d')]);_0x1e5aec[_0x7c9d('0x30')]=_[_0x7c9d('0x31')](_0x5535d1[_0x7c9d('0x30')]);_0x1e5aec['filters']=_[_0x7c9d('0x32')](_0x1e5aec['model'],_0x1e5aec[_0x7c9d('0x30')]);_0x311724[_0x7c9d('0x33')]=_['intersection'](_0x1e5aec[_0x7c9d('0x43')],qs[_0x7c9d('0x44')](_0x5535d1[_0x7c9d('0x30')]['fields']));_0x311724[_0x7c9d('0x33')]=_0x311724[_0x7c9d('0x33')]['length']?_0x311724[_0x7c9d('0x33')]:_0x1e5aec[_0x7c9d('0x43')];_0x311724[_0x7c9d('0x36')]=qs['sort'](_0x5535d1[_0x7c9d('0x30')][_0x7c9d('0x37')]);_0x311724['where']=qs[_0x7c9d('0x3a')](_[_0x7c9d('0x39')](_0x5535d1[_0x7c9d('0x30')],_0x1e5aec[_0x7c9d('0x3a')]));if(_0x5535d1['query'][_0x7c9d('0x3b')]){_0x311724[_0x7c9d('0x38')]=_[_0x7c9d('0x3c')](_0x311724[_0x7c9d('0x38')],{'$or':_['map'](_0x311724['attributes'],function(_0x4b2827){var _0x6854a5={};_0x6854a5[_0x4b2827]={'$like':'%'+_0x5535d1[_0x7c9d('0x30')]['filter']+'%'};return _0x6854a5;})});}_0x311724=_[_0x7c9d('0x3c')]({},_0x311724,_0x5535d1[_0x7c9d('0x3e')]);return _0xf9a8cf[_0x7c9d('0x4b')](_0x311724);}})['then'](function(_0x45c4cb){if(_0x45c4cb){_0x5b29bb=_0x45c4cb[_0x7c9d('0x34')];if(!_0x5535d1['query'][_0x7c9d('0x35')]('nolimit')){_0x311724[_0x7c9d('0x1f')]=qs[_0x7c9d('0x1f')](_0x5535d1['query'][_0x7c9d('0x1f')]);_0x311724['offset']=qs[_0x7c9d('0x1c')](_0x5535d1[_0x7c9d('0x30')][_0x7c9d('0x1c')]);}return _0xf9a8cf[_0x7c9d('0x4b')](_0x311724);}})[_0x7c9d('0x25')](function(_0x2091ab){if(_0x2091ab){return _0x2091ab?{'count':_0x5b29bb,'rows':_0x2091ab}:null;}})[_0x7c9d('0x25')](respondWithResult(_0x231fb9,null))['catch'](handleError(_0x231fb9,null));};exports['getSubjects']=function(_0x261ac4,_0x172f08,_0x129811){var _0x594cf1={};var _0x511328={};var _0x248e06;var _0x292bca;return db[_0x7c9d('0x2c')]['findOne']({'where':{'id':_0x261ac4['params']['id']}})[_0x7c9d('0x25')](handleEntityNotFound(_0x172f08,null))[_0x7c9d('0x25')](function(_0x116625){if(_0x116625){_0x248e06=_0x116625;_0x511328[_0x7c9d('0x43')]=_[_0x7c9d('0x31')](db[_0x7c9d('0x4c')][_0x7c9d('0x2d')]);_0x511328['query']=_[_0x7c9d('0x31')](_0x261ac4[_0x7c9d('0x30')]);_0x511328['filters']=_['intersection'](_0x511328[_0x7c9d('0x43')],_0x511328[_0x7c9d('0x30')]);_0x594cf1[_0x7c9d('0x33')]=_['intersection'](_0x511328['model'],qs[_0x7c9d('0x44')](_0x261ac4[_0x7c9d('0x30')]['fields']));_0x594cf1['attributes']=_0x594cf1[_0x7c9d('0x33')][_0x7c9d('0x34')]?_0x594cf1[_0x7c9d('0x33')]:_0x511328['model'];_0x594cf1['order']=qs[_0x7c9d('0x37')](_0x261ac4[_0x7c9d('0x30')][_0x7c9d('0x37')]);_0x594cf1[_0x7c9d('0x38')]=qs[_0x7c9d('0x3a')](_[_0x7c9d('0x39')](_0x261ac4['query'],_0x511328['filters']));if(_0x261ac4[_0x7c9d('0x30')][_0x7c9d('0x3b')]){_0x594cf1[_0x7c9d('0x38')]=_['merge'](_0x594cf1[_0x7c9d('0x38')],{'$or':_[_0x7c9d('0x2b')](_0x594cf1[_0x7c9d('0x33')],function(_0x49af5f){var _0x59f6bb={};_0x59f6bb[_0x49af5f]={'$like':'%'+_0x261ac4[_0x7c9d('0x30')][_0x7c9d('0x3b')]+'%'};return _0x59f6bb;})});}_0x594cf1=_[_0x7c9d('0x3c')]({},_0x594cf1,_0x261ac4['options']);return _0x248e06[_0x7c9d('0x4d')](_0x594cf1);}})[_0x7c9d('0x25')](function(_0x3d30bc){if(_0x3d30bc){_0x292bca=_0x3d30bc[_0x7c9d('0x34')];if(!_0x261ac4[_0x7c9d('0x30')][_0x7c9d('0x35')](_0x7c9d('0x4e'))){_0x594cf1[_0x7c9d('0x1f')]=qs[_0x7c9d('0x1f')](_0x261ac4[_0x7c9d('0x30')]['limit']);_0x594cf1[_0x7c9d('0x1c')]=qs[_0x7c9d('0x1c')](_0x261ac4[_0x7c9d('0x30')][_0x7c9d('0x1c')]);}return _0x248e06[_0x7c9d('0x4d')](_0x594cf1);}})[_0x7c9d('0x25')](function(_0x663807){if(_0x663807){return _0x663807?{'count':_0x292bca,'rows':_0x663807}:null;}})[_0x7c9d('0x25')](respondWithResult(_0x172f08,null))['catch'](handleError(_0x172f08,null));};exports[_0x7c9d('0x4f')]=function(_0x1047ba,_0x6b2a07,_0x32a60b){var _0x1dfdcb={};var _0x8b929b={};var _0x47b808;var _0x588071;return db['ZohoConfiguration'][_0x7c9d('0x4a')]({'where':{'id':_0x1047ba[_0x7c9d('0x49')]['id']}})[_0x7c9d('0x25')](handleEntityNotFound(_0x6b2a07,null))[_0x7c9d('0x25')](function(_0x5324d4){if(_0x5324d4){_0x47b808=_0x5324d4;_0x8b929b[_0x7c9d('0x43')]=_[_0x7c9d('0x31')](db[_0x7c9d('0x4c')][_0x7c9d('0x2d')]);_0x8b929b[_0x7c9d('0x30')]=_[_0x7c9d('0x31')](_0x1047ba[_0x7c9d('0x30')]);_0x8b929b[_0x7c9d('0x3a')]=_['intersection'](_0x8b929b['model'],_0x8b929b[_0x7c9d('0x30')]);_0x1dfdcb[_0x7c9d('0x33')]=_[_0x7c9d('0x32')](_0x8b929b[_0x7c9d('0x43')],qs[_0x7c9d('0x44')](_0x1047ba['query'][_0x7c9d('0x44')]));_0x1dfdcb['attributes']=_0x1dfdcb['attributes'][_0x7c9d('0x34')]?_0x1dfdcb[_0x7c9d('0x33')]:_0x8b929b[_0x7c9d('0x43')];_0x1dfdcb[_0x7c9d('0x36')]=qs[_0x7c9d('0x37')](_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x37')]);_0x1dfdcb['where']=qs[_0x7c9d('0x3a')](_[_0x7c9d('0x39')](_0x1047ba[_0x7c9d('0x30')],_0x8b929b[_0x7c9d('0x3a')]));if(_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x3b')]){_0x1dfdcb['where']=_['merge'](_0x1dfdcb[_0x7c9d('0x38')],{'$or':_[_0x7c9d('0x2b')](_0x1dfdcb['attributes'],function(_0x1803c8){var _0x20f59b={};_0x20f59b[_0x1803c8]={'$like':'%'+_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x3b')]+'%'};return _0x20f59b;})});}_0x1dfdcb=_[_0x7c9d('0x3c')]({},_0x1dfdcb,_0x1047ba[_0x7c9d('0x3e')]);return _0x47b808[_0x7c9d('0x4f')](_0x1dfdcb);}})[_0x7c9d('0x25')](function(_0x101f9d){if(_0x101f9d){_0x588071=_0x101f9d[_0x7c9d('0x34')];if(!_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x35')](_0x7c9d('0x4e'))){_0x1dfdcb[_0x7c9d('0x1f')]=qs[_0x7c9d('0x1f')](_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x1f')]);_0x1dfdcb[_0x7c9d('0x1c')]=qs[_0x7c9d('0x1c')](_0x1047ba[_0x7c9d('0x30')][_0x7c9d('0x1c')]);}return _0x47b808[_0x7c9d('0x4f')](_0x1dfdcb);}})['then'](function(_0x132310){if(_0x132310){return _0x132310?{'count':_0x588071,'rows':_0x132310}:null;}})[_0x7c9d('0x25')](respondWithResult(_0x6b2a07,null))[_0x7c9d('0x41')](handleError(_0x6b2a07,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 019249d..0ebba69 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 _0x43e0=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x43e0,0x1ae));var _0x043e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x43e0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x043e('0x0'));var util=require(_0x043e('0x1'));var logger=require(_0x043e('0x2'))(_0x043e('0x3'));var moment=require('moment');var BPromise=require(_0x043e('0x4'));var rp=require(_0x043e('0x5'));var fs=require('fs');var path=require(_0x043e('0x6'));var rimraf=require(_0x043e('0x7'));var config=require(_0x043e('0x8'));var attributes=require(_0x043e('0x9'));module[_0x043e('0xa')]=function(_0x3c8468,_0x551714){return _0x3c8468[_0x043e('0xb')](_0x043e('0xc'),attributes,{'tableName':_0x043e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84f8=['define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0xf0c56a,_0x5a0beb){var _0x23b4ac=function(_0x27a33f){while(--_0x27a33f){_0xf0c56a['push'](_0xf0c56a['shift']());}};_0x23b4ac(++_0x5a0beb);}(_0x84f8,0x1f2));var _0x884f=function(_0x2cbedb,_0x34fafe){_0x2cbedb=_0x2cbedb-0x0;var _0x284e79=_0x84f8[_0x2cbedb];return _0x284e79;};'use strict';var _=require('lodash');var util=require(_0x884f('0x0'));var logger=require(_0x884f('0x1'))('api');var moment=require(_0x884f('0x2'));var BPromise=require(_0x884f('0x3'));var rp=require(_0x884f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x884f('0x5'));var attributes=require(_0x884f('0x6'));module[_0x884f('0x7')]=function(_0xe07b9d,_0x23ad45){return _0xe07b9d[_0x884f('0x8')](_0x884f('0x9'),attributes,{'tableName':_0x884f('0xa'),'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 8d05b91..9066027 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 _0xd9e0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','randomstring'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0xd9e0,0x132));var _0x0d9e=function(_0x1664e1,_0x1c6de0){_0x1664e1=_0x1664e1-0x0;var _0x3e581c=_0xd9e0[_0x1664e1];return _0x3e581c;};'use strict';var _=require(_0x0d9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d9e('0x1'));var fs=require('fs');var Redis=require(_0x0d9e('0x2'));var db=require(_0x0d9e('0x3'))['db'];var utils=require(_0x0d9e('0x4'));var logger=require(_0x0d9e('0x5'))(_0x0d9e('0x6'));var config=require(_0x0d9e('0x7'));var jayson=require(_0x0d9e('0x8'));var client=jayson['client'][_0x0d9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428ad1,_0x331b83,_0x36d96b){return new BPromise(function(_0x200a9b,_0x35021f){return client[_0x0d9e('0xa')](_0x428ad1,_0x36d96b)[_0x0d9e('0xb')](function(_0x4005e8){logger[_0x0d9e('0xc')](_0x0d9e('0xd'),_0x331b83,'request\x20sent');logger[_0x0d9e('0xe')](_0x0d9e('0xf'),_0x331b83,_0x0d9e('0x10'),JSON[_0x0d9e('0x11')](_0x4005e8));if(_0x4005e8[_0x0d9e('0x12')]){if(_0x4005e8[_0x0d9e('0x12')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x331b83,_0x4005e8['error'][_0x0d9e('0x13')]);return _0x35021f(_0x4005e8[_0x0d9e('0x12')][_0x0d9e('0x13')]);}logger[_0x0d9e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x331b83,_0x4005e8[_0x0d9e('0x12')][_0x0d9e('0x13')]);return _0x200a9b(_0x4005e8[_0x0d9e('0x12')][_0x0d9e('0x13')]);}else{logger[_0x0d9e('0xc')](_0x0d9e('0xd'),_0x331b83,_0x0d9e('0x10'));_0x200a9b(_0x4005e8[_0x0d9e('0x14')]['message']);}})[_0x0d9e('0x15')](function(_0x67818e){logger[_0x0d9e('0x12')](_0x0d9e('0xd'),_0x331b83,_0x67818e);_0x35021f(_0x67818e);});});} \ No newline at end of file +var _0x5b8f=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch'];(function(_0x297f45,_0x5840e7){var _0x6afe2=function(_0x1f1e09){while(--_0x1f1e09){_0x297f45['push'](_0x297f45['shift']());}};_0x6afe2(++_0x5840e7);}(_0x5b8f,0x88));var _0xf5b8=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x5b8f[_0x2265da];return _0x430c2b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5b8('0x0'));var BPromise=require(_0xf5b8('0x1'));var rs=require(_0xf5b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5b8('0x3'))['db'];var utils=require(_0xf5b8('0x4'));var logger=require(_0xf5b8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf5b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a84fe,_0x591d36,_0x3bc024){return new BPromise(function(_0x39de74,_0x52ca7c){return client['request'](_0x5a84fe,_0x3bc024)[_0xf5b8('0x7')](function(_0x47ee43){logger['info'](_0xf5b8('0x8'),_0x591d36,_0xf5b8('0x9'));logger[_0xf5b8('0xa')](_0xf5b8('0xb'),_0x591d36,_0xf5b8('0x9'),JSON['stringify'](_0x47ee43));if(_0x47ee43[_0xf5b8('0xc')]){if(_0x47ee43[_0xf5b8('0xc')][_0xf5b8('0xd')]===0x1f4){logger[_0xf5b8('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x591d36,_0x47ee43['error']['message']);return _0x52ca7c(_0x47ee43['error']['message']);}logger[_0xf5b8('0xc')](_0xf5b8('0x8'),_0x591d36,_0x47ee43[_0xf5b8('0xc')]['message']);return _0x39de74(_0x47ee43['error'][_0xf5b8('0xe')]);}else{logger[_0xf5b8('0xf')](_0xf5b8('0x8'),_0x591d36,'request\x20sent');_0x39de74(_0x47ee43['result'][_0xf5b8('0xe')]);}})[_0xf5b8('0x10')](function(_0x73292a){logger[_0xf5b8('0xc')](_0xf5b8('0x8'),_0x591d36,_0x73292a);_0x52ca7c(_0x73292a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6f515a1..34b369e 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 _0x437e=['destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete'];(function(_0x4ee88a,_0x3737e5){var _0x1e5e99=function(_0x5346fa){while(--_0x5346fa){_0x4ee88a['push'](_0x4ee88a['shift']());}};_0x1e5e99(++_0x3737e5);}(_0x437e,0x1bb));var _0xe437=function(_0x197f1e,_0x1f25ef){_0x197f1e=_0x197f1e-0x0;var _0x353b04=_0x437e[_0x197f1e];return _0x353b04;};'use strict';var multer=require(_0xe437('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe437('0x1'));var router=express[_0xe437('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe437('0x3'));var interaction=require(_0xe437('0x4'));var config=require(_0xe437('0x5'));var controller=require(_0xe437('0x6'));router[_0xe437('0x7')]('/',auth[_0xe437('0x8')](),controller[_0xe437('0x9')]);router[_0xe437('0x7')]('/:id',auth[_0xe437('0x8')](),controller[_0xe437('0xa')]);router[_0xe437('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe437('0xc')](_0xe437('0xd'),auth[_0xe437('0x8')](),controller[_0xe437('0xe')]);router[_0xe437('0xf')]('/:id',auth[_0xe437('0x8')](),controller[_0xe437('0x10')]);module['exports']=router; \ No newline at end of file +var _0x360c=['../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','fs-extra'];(function(_0x3be8e8,_0x246a8f){var _0x5f7c64=function(_0x14b674){while(--_0x14b674){_0x3be8e8['push'](_0x3be8e8['shift']());}};_0x5f7c64(++_0x246a8f);}(_0x360c,0x147));var _0xc360=function(_0x5d5477,_0x52fb06){_0x5d5477=_0x5d5477-0x0;var _0x178efa=_0x360c[_0x5d5477];return _0x178efa;};'use strict';var multer=require(_0xc360('0x0'));var util=require(_0xc360('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc360('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc360('0x3'));var config=require('../../config/environment');var controller=require(_0xc360('0x4'));router[_0xc360('0x5')]('/',auth[_0xc360('0x6')](),controller[_0xc360('0x7')]);router[_0xc360('0x5')](_0xc360('0x8'),auth[_0xc360('0x6')](),controller[_0xc360('0x9')]);router[_0xc360('0xa')]('/',auth['isAuthenticated'](),controller[_0xc360('0xb')]);router[_0xc360('0xc')](_0xc360('0x8'),auth[_0xc360('0x6')](),controller['update']);router[_0xc360('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc360('0xe')]);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 29625ff..3bf36d8 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 _0x5eb6=['exports','ENUM','string','variable','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x36b427,_0x4f5c3a){var _0x55f4f6=function(_0x48dc08){while(--_0x48dc08){_0x36b427['push'](_0x36b427['shift']());}};_0x55f4f6(++_0x4f5c3a);}(_0x5eb6,0x97));var _0x65eb=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5eb6[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x65eb('0x0'));module[_0x65eb('0x1')]={'type':{'type':Sequelize[_0x65eb('0x2')](_0x65eb('0x3'),_0x65eb('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x65eb('0x3')},'content':{'type':Sequelize[_0x65eb('0x5')]},'key':{'type':Sequelize[_0x65eb('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x65eb('0x3'),_0x65eb('0x4'),_0x65eb('0x6'))},'keyContent':{'type':Sequelize[_0x65eb('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x65eb('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x65eb('0x5')]}}; \ No newline at end of file +var _0x0b48=['ENUM','string','variable','picklist','customVariable','STRING','BOOLEAN','sequelize','exports'];(function(_0x595409,_0x4d786c){var _0x5eab68=function(_0x4c03b8){while(--_0x4c03b8){_0x595409['push'](_0x595409['shift']());}};_0x5eab68(++_0x4d786c);}(_0x0b48,0xa9));var _0x80b4=function(_0x5e8ac4,_0x2e51dc){_0x5e8ac4=_0x5e8ac4-0x0;var _0x1c15fc=_0x0b48[_0x5e8ac4];return _0x1c15fc;};'use strict';var Sequelize=require(_0x80b4('0x0'));module[_0x80b4('0x1')]={'type':{'type':Sequelize[_0x80b4('0x2')](_0x80b4('0x3'),_0x80b4('0x4'),'customVariable','keyValue',_0x80b4('0x5')),'defaultValue':_0x80b4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x80b4('0x3'),'variable',_0x80b4('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x80b4('0x7')]},'nameField':{'type':Sequelize[_0x80b4('0x7')]},'customField':{'type':Sequelize[_0x80b4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x80b4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8ce52b4..6315ad0 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 _0x98d4=['findAll','rows','catch','rawAttributes','intersection','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','ZohoField','fieldName','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x1adb1e,_0x1f434b){var _0x2a3c64=function(_0x858cca){while(--_0x858cca){_0x1adb1e['push'](_0x1adb1e['shift']());}};_0x2a3c64(++_0x1f434b);}(_0x98d4,0xa3));var _0x498d=function(_0x12c5b8,_0x3a1cf4){_0x12c5b8=_0x12c5b8-0x0;var _0x5a95f5=_0x98d4[_0x12c5b8];return _0x5a95f5;};'use strict';var emlformat=require(_0x498d('0x0'));var rimraf=require(_0x498d('0x1'));var zipdir=require(_0x498d('0x2'));var jsonpatch=require(_0x498d('0x3'));var rp=require(_0x498d('0x4'));var moment=require(_0x498d('0x5'));var BPromise=require(_0x498d('0x6'));var Mustache=require('mustache');var util=require(_0x498d('0x7'));var path=require(_0x498d('0x8'));var sox=require('sox');var csv=require(_0x498d('0x9'));var ejs=require(_0x498d('0xa'));var fs=require('fs');var fs_extra=require(_0x498d('0xb'));var _=require(_0x498d('0xc'));var squel=require(_0x498d('0xd'));var crypto=require(_0x498d('0xe'));var jsforce=require(_0x498d('0xf'));var deskjs=require(_0x498d('0x10'));var toCsv=require(_0x498d('0x9'));var querystring=require(_0x498d('0x11'));var Papa=require(_0x498d('0x12'));var Redis=require(_0x498d('0x13'));var authService=require(_0x498d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x498d('0x15'));var hardwareService=require(_0x498d('0x16'));var logger=require(_0x498d('0x17'))(_0x498d('0x18'));var utils=require('../../config/utils');var config=require(_0x498d('0x19'));var licenseUtil=require(_0x498d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c8c0b,_0x4df179){_0x4df179=_0x4df179||0xcc;return function(_0x37d13b){if(_0x37d13b){return _0x1c8c0b['sendStatus'](_0x4df179);}return _0x1c8c0b[_0x498d('0x1b')](_0x4df179)['end']();};}function respondWithResult(_0x5697f0,_0x428836){_0x428836=_0x428836||0xc8;return function(_0x348484){if(_0x348484){return _0x5697f0[_0x498d('0x1b')](_0x428836)[_0x498d('0x1c')](_0x348484);}};}function respondWithFilteredResult(_0x59ea97,_0x907e57){return function(_0x3c816f){if(_0x3c816f){var _0x3a1bf1=typeof _0x907e57[_0x498d('0x1d')]===_0x498d('0x1e')&&typeof _0x907e57[_0x498d('0x1f')]===_0x498d('0x1e');var _0x336da5=_0x3c816f[_0x498d('0x20')];var _0x31c080=_0x3a1bf1?0x0:_0x907e57['offset'];var _0x3cf98f=_0x3a1bf1?_0x3c816f[_0x498d('0x20')]:_0x907e57[_0x498d('0x1d')]+_0x907e57[_0x498d('0x1f')];var _0x311b97;if(_0x3cf98f>=_0x336da5){_0x3cf98f=_0x336da5;_0x311b97=0xc8;}else{_0x311b97=0xce;}_0x59ea97['status'](_0x311b97);return _0x59ea97[_0x498d('0x21')](_0x498d('0x22'),_0x31c080+'-'+_0x3cf98f+'/'+_0x336da5)['json'](_0x3c816f);}return null;};}function patchUpdates(_0x2a820c){return function(_0x4172fb){try{jsonpatch[_0x498d('0x23')](_0x4172fb,_0x2a820c,!![]);}catch(_0x81a87d){return BPromise[_0x498d('0x24')](_0x81a87d);}return _0x4172fb['save']();};}function saveUpdates(_0x34b23e,_0x4b7053){return function(_0x3b8abe){if(_0x3b8abe){return _0x3b8abe[_0x498d('0x25')](_0x34b23e)[_0x498d('0x26')](function(_0x453b89){return _0x453b89;});}return null;};}function removeEntity(_0x33e1b1,_0xc94ebc){return function(_0xf3b04e){if(_0xf3b04e){return _0xf3b04e[_0x498d('0x27')]()[_0x498d('0x26')](function(){_0x33e1b1[_0x498d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5718de,_0x256711){return function(_0x2656a2){if(!_0x2656a2){_0x5718de[_0x498d('0x28')](0x194);}return _0x2656a2;};}function handleError(_0x1d9121,_0x2f9a47){_0x2f9a47=_0x2f9a47||0x1f4;return function(_0x28da73){logger['error'](_0x28da73[_0x498d('0x29')]);if(_0x28da73[_0x498d('0x2a')]){delete _0x28da73[_0x498d('0x2a')];}_0x1d9121['status'](_0x2f9a47)[_0x498d('0x2b')](_0x28da73);};}exports[_0x498d('0x2c')]=function(_0x257b59,_0x65ad2){var _0x18eded={},_0x57200a={},_0x1b75a2={'count':0x0,'rows':[]};var _0x3161de=_[_0x498d('0x2d')](db[_0x498d('0x2e')]['rawAttributes'],function(_0x41d46d){return{'name':_0x41d46d[_0x498d('0x2f')],'type':_0x41d46d[_0x498d('0x30')][_0x498d('0x31')]};});_0x57200a['model']=_[_0x498d('0x2d')](_0x3161de,_0x498d('0x2a'));_0x57200a['query']=_[_0x498d('0x32')](_0x257b59[_0x498d('0x33')]);_0x57200a[_0x498d('0x34')]=_['intersection'](_0x57200a[_0x498d('0x35')],_0x57200a[_0x498d('0x33')]);_0x18eded[_0x498d('0x36')]=_['intersection'](_0x57200a[_0x498d('0x35')],qs[_0x498d('0x37')](_0x257b59[_0x498d('0x33')][_0x498d('0x37')]));_0x18eded[_0x498d('0x36')]=_0x18eded[_0x498d('0x36')][_0x498d('0x38')]?_0x18eded[_0x498d('0x36')]:_0x57200a['model'];if(!_0x257b59[_0x498d('0x33')][_0x498d('0x39')](_0x498d('0x3a'))){_0x18eded['limit']=qs[_0x498d('0x1f')](_0x257b59['query'][_0x498d('0x1f')]);_0x18eded[_0x498d('0x1d')]=qs[_0x498d('0x1d')](_0x257b59['query'][_0x498d('0x1d')]);}_0x18eded['order']=qs[_0x498d('0x3b')](_0x257b59[_0x498d('0x33')][_0x498d('0x3b')]);_0x18eded[_0x498d('0x3c')]=qs['filters'](_[_0x498d('0x3d')](_0x257b59[_0x498d('0x33')],_0x57200a['filters']),_0x3161de);if(_0x257b59[_0x498d('0x33')][_0x498d('0x3e')]){_0x18eded[_0x498d('0x3c')]=_[_0x498d('0x3f')](_0x18eded[_0x498d('0x3c')],{'$or':_['map'](_0x3161de,function(_0x8a8325){if(_0x8a8325['type']!==_0x498d('0x40')){var _0x1496d6={};_0x1496d6[_0x8a8325[_0x498d('0x2a')]]={'$like':'%'+_0x257b59['query'][_0x498d('0x3e')]+'%'};return _0x1496d6;}})});}_0x18eded=_[_0x498d('0x3f')]({},_0x18eded,_0x257b59[_0x498d('0x41')]);var _0x4d0f26={'where':_0x18eded['where']};return db[_0x498d('0x2e')][_0x498d('0x20')](_0x4d0f26)[_0x498d('0x26')](function(_0x1784e7){_0x1b75a2['count']=_0x1784e7;if(_0x257b59[_0x498d('0x33')][_0x498d('0x42')]){_0x18eded[_0x498d('0x43')]=[{'all':!![]}];}return db[_0x498d('0x2e')][_0x498d('0x44')](_0x18eded);})[_0x498d('0x26')](function(_0x35aa96){_0x1b75a2[_0x498d('0x45')]=_0x35aa96;return _0x1b75a2;})[_0x498d('0x26')](respondWithFilteredResult(_0x65ad2,_0x18eded))[_0x498d('0x46')](handleError(_0x65ad2,null));};exports['show']=function(_0x23c291,_0x1b2f44){var _0x458642={'raw':!![],'where':{'id':_0x23c291['params']['id']}},_0x55a1d4={};_0x55a1d4['model']=_['keys'](db[_0x498d('0x2e')][_0x498d('0x47')]);_0x55a1d4[_0x498d('0x33')]=_[_0x498d('0x32')](_0x23c291[_0x498d('0x33')]);_0x55a1d4[_0x498d('0x34')]=_[_0x498d('0x48')](_0x55a1d4['model'],_0x55a1d4[_0x498d('0x33')]);_0x458642[_0x498d('0x36')]=_[_0x498d('0x48')](_0x55a1d4[_0x498d('0x35')],qs[_0x498d('0x37')](_0x23c291[_0x498d('0x33')][_0x498d('0x37')]));_0x458642[_0x498d('0x36')]=_0x458642[_0x498d('0x36')][_0x498d('0x38')]?_0x458642[_0x498d('0x36')]:_0x55a1d4['model'];if(_0x23c291['query'][_0x498d('0x42')]){_0x458642['include']=[{'all':!![]}];}_0x458642=_[_0x498d('0x3f')]({},_0x458642,_0x23c291['options']);return db[_0x498d('0x2e')][_0x498d('0x49')](_0x458642)[_0x498d('0x26')](handleEntityNotFound(_0x1b2f44,null))['then'](respondWithResult(_0x1b2f44,null))['catch'](handleError(_0x1b2f44,null));};exports['create']=function(_0x40cb70,_0x39e834){return db[_0x498d('0x2e')][_0x498d('0x4a')](_0x40cb70[_0x498d('0x4b')],{})['then'](respondWithResult(_0x39e834,0xc9))['catch'](handleError(_0x39e834,null));};exports['update']=function(_0x14097b,_0xff923){if(_0x14097b[_0x498d('0x4b')]['id']){delete _0x14097b[_0x498d('0x4b')]['id'];}return db[_0x498d('0x2e')]['find']({'where':{'id':_0x14097b[_0x498d('0x4c')]['id']}})[_0x498d('0x26')](handleEntityNotFound(_0xff923,null))[_0x498d('0x26')](saveUpdates(_0x14097b[_0x498d('0x4b')],null))[_0x498d('0x26')](respondWithResult(_0xff923,null))[_0x498d('0x46')](handleError(_0xff923,null));};exports['destroy']=function(_0x397143,_0x3a0d0c){return db[_0x498d('0x2e')]['find']({'where':{'id':_0x397143['params']['id']}})[_0x498d('0x26')](handleEntityNotFound(_0x3a0d0c,null))['then'](removeEntity(_0x3a0d0c,null))[_0x498d('0x46')](handleError(_0x3a0d0c,null));}; \ No newline at end of file +var _0x1869=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','ZohoField','includeAll','include','rows','catch','show','rawAttributes','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1869,0x1c3));var _0x9186=function(_0x4a0bdc,_0x308288){_0x4a0bdc=_0x4a0bdc-0x0;var _0x1584c3=_0x1869[_0x4a0bdc];return _0x1584c3;};'use strict';var emlformat=require(_0x9186('0x0'));var rimraf=require(_0x9186('0x1'));var zipdir=require(_0x9186('0x2'));var jsonpatch=require(_0x9186('0x3'));var rp=require(_0x9186('0x4'));var moment=require(_0x9186('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9186('0x6'));var util=require(_0x9186('0x7'));var path=require(_0x9186('0x8'));var sox=require(_0x9186('0x9'));var csv=require(_0x9186('0xa'));var ejs=require(_0x9186('0xb'));var fs=require('fs');var fs_extra=require(_0x9186('0xc'));var _=require(_0x9186('0xd'));var squel=require(_0x9186('0xe'));var crypto=require(_0x9186('0xf'));var jsforce=require(_0x9186('0x10'));var deskjs=require(_0x9186('0x11'));var toCsv=require(_0x9186('0xa'));var querystring=require(_0x9186('0x12'));var Papa=require(_0x9186('0x13'));var Redis=require(_0x9186('0x14'));var authService=require(_0x9186('0x15'));var qs=require(_0x9186('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9186('0x17'));var logger=require('../../config/logger')(_0x9186('0x18'));var utils=require(_0x9186('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9186('0x1a'));var db=require(_0x9186('0x1b'))['db'];function respondWithStatusCode(_0x41dfaa,_0x3dc9fe){_0x3dc9fe=_0x3dc9fe||0xcc;return function(_0x4c1ea5){if(_0x4c1ea5){return _0x41dfaa[_0x9186('0x1c')](_0x3dc9fe);}return _0x41dfaa[_0x9186('0x1d')](_0x3dc9fe)[_0x9186('0x1e')]();};}function respondWithResult(_0x31ad2a,_0x3c4561){_0x3c4561=_0x3c4561||0xc8;return function(_0x3e5430){if(_0x3e5430){return _0x31ad2a['status'](_0x3c4561)[_0x9186('0x1f')](_0x3e5430);}};}function respondWithFilteredResult(_0x255706,_0x39a63f){return function(_0x261c28){if(_0x261c28){var _0x26efae=typeof _0x39a63f[_0x9186('0x20')]==='undefined'&&typeof _0x39a63f[_0x9186('0x21')]===_0x9186('0x22');var _0x4b8a84=_0x261c28[_0x9186('0x23')];var _0x6f3eb=_0x26efae?0x0:_0x39a63f[_0x9186('0x20')];var _0x55c49a=_0x26efae?_0x261c28[_0x9186('0x23')]:_0x39a63f['offset']+_0x39a63f[_0x9186('0x21')];var _0x2fc575;if(_0x55c49a>=_0x4b8a84){_0x55c49a=_0x4b8a84;_0x2fc575=0xc8;}else{_0x2fc575=0xce;}_0x255706['status'](_0x2fc575);return _0x255706[_0x9186('0x24')](_0x9186('0x25'),_0x6f3eb+'-'+_0x55c49a+'/'+_0x4b8a84)['json'](_0x261c28);}return null;};}function patchUpdates(_0x2ad177){return function(_0x5deb14){try{jsonpatch[_0x9186('0x26')](_0x5deb14,_0x2ad177,!![]);}catch(_0x423454){return BPromise[_0x9186('0x27')](_0x423454);}return _0x5deb14[_0x9186('0x28')]();};}function saveUpdates(_0x1d4dde,_0x131121){return function(_0x2cf44e){if(_0x2cf44e){return _0x2cf44e[_0x9186('0x29')](_0x1d4dde)[_0x9186('0x2a')](function(_0x15056f){return _0x15056f;});}return null;};}function removeEntity(_0xc6b709,_0x4cdf87){return function(_0x362398){if(_0x362398){return _0x362398['destroy']()[_0x9186('0x2a')](function(){_0xc6b709['status'](0xcc)[_0x9186('0x1e')]();});}};}function handleEntityNotFound(_0x1efc5d,_0x3db7be){return function(_0x297040){if(!_0x297040){_0x1efc5d[_0x9186('0x1c')](0x194);}return _0x297040;};}function handleError(_0x46fc11,_0xf559c6){_0xf559c6=_0xf559c6||0x1f4;return function(_0x4c8a2f){logger[_0x9186('0x2b')](_0x4c8a2f[_0x9186('0x2c')]);if(_0x4c8a2f[_0x9186('0x2d')]){delete _0x4c8a2f[_0x9186('0x2d')];}_0x46fc11[_0x9186('0x1d')](_0xf559c6)[_0x9186('0x2e')](_0x4c8a2f);};}exports[_0x9186('0x2f')]=function(_0x4aa9e3,_0xd19f0c){var _0x44ded3={},_0x639939={},_0xd43b61={'count':0x0,'rows':[]};var _0x798cbf=_[_0x9186('0x30')](db['ZohoField']['rawAttributes'],function(_0x243a02){return{'name':_0x243a02['fieldName'],'type':_0x243a02['type'][_0x9186('0x31')]};});_0x639939[_0x9186('0x32')]=_[_0x9186('0x30')](_0x798cbf,_0x9186('0x2d'));_0x639939['query']=_[_0x9186('0x33')](_0x4aa9e3[_0x9186('0x34')]);_0x639939[_0x9186('0x35')]=_['intersection'](_0x639939[_0x9186('0x32')],_0x639939[_0x9186('0x34')]);_0x44ded3[_0x9186('0x36')]=_[_0x9186('0x37')](_0x639939[_0x9186('0x32')],qs[_0x9186('0x38')](_0x4aa9e3['query'][_0x9186('0x38')]));_0x44ded3[_0x9186('0x36')]=_0x44ded3[_0x9186('0x36')][_0x9186('0x39')]?_0x44ded3[_0x9186('0x36')]:_0x639939['model'];if(!_0x4aa9e3[_0x9186('0x34')][_0x9186('0x3a')]('nolimit')){_0x44ded3[_0x9186('0x21')]=qs[_0x9186('0x21')](_0x4aa9e3[_0x9186('0x34')][_0x9186('0x21')]);_0x44ded3['offset']=qs[_0x9186('0x20')](_0x4aa9e3['query'][_0x9186('0x20')]);}_0x44ded3[_0x9186('0x3b')]=qs[_0x9186('0x3c')](_0x4aa9e3[_0x9186('0x34')][_0x9186('0x3c')]);_0x44ded3['where']=qs[_0x9186('0x35')](_['pick'](_0x4aa9e3[_0x9186('0x34')],_0x639939[_0x9186('0x35')]),_0x798cbf);if(_0x4aa9e3[_0x9186('0x34')][_0x9186('0x3d')]){_0x44ded3[_0x9186('0x3e')]=_[_0x9186('0x3f')](_0x44ded3['where'],{'$or':_[_0x9186('0x30')](_0x798cbf,function(_0x2633f0){if(_0x2633f0['type']!==_0x9186('0x40')){var _0x195715={};_0x195715[_0x2633f0[_0x9186('0x2d')]]={'$like':'%'+_0x4aa9e3[_0x9186('0x34')]['filter']+'%'};return _0x195715;}})});}_0x44ded3=_[_0x9186('0x3f')]({},_0x44ded3,_0x4aa9e3['options']);var _0xa483ad={'where':_0x44ded3[_0x9186('0x3e')]};return db[_0x9186('0x41')][_0x9186('0x23')](_0xa483ad)[_0x9186('0x2a')](function(_0x2b3b06){_0xd43b61[_0x9186('0x23')]=_0x2b3b06;if(_0x4aa9e3['query'][_0x9186('0x42')]){_0x44ded3[_0x9186('0x43')]=[{'all':!![]}];}return db[_0x9186('0x41')]['findAll'](_0x44ded3);})['then'](function(_0x1b7ff4){_0xd43b61[_0x9186('0x44')]=_0x1b7ff4;return _0xd43b61;})[_0x9186('0x2a')](respondWithFilteredResult(_0xd19f0c,_0x44ded3))[_0x9186('0x45')](handleError(_0xd19f0c,null));};exports[_0x9186('0x46')]=function(_0x158c2a,_0x474a9b){var _0x2843f1={'raw':!![],'where':{'id':_0x158c2a['params']['id']}},_0x361eeb={};_0x361eeb['model']=_[_0x9186('0x33')](db['ZohoField'][_0x9186('0x47')]);_0x361eeb[_0x9186('0x34')]=_[_0x9186('0x33')](_0x158c2a['query']);_0x361eeb[_0x9186('0x35')]=_[_0x9186('0x37')](_0x361eeb[_0x9186('0x32')],_0x361eeb['query']);_0x2843f1[_0x9186('0x36')]=_[_0x9186('0x37')](_0x361eeb[_0x9186('0x32')],qs[_0x9186('0x38')](_0x158c2a[_0x9186('0x34')][_0x9186('0x38')]));_0x2843f1['attributes']=_0x2843f1[_0x9186('0x36')][_0x9186('0x39')]?_0x2843f1['attributes']:_0x361eeb[_0x9186('0x32')];if(_0x158c2a[_0x9186('0x34')][_0x9186('0x42')]){_0x2843f1[_0x9186('0x43')]=[{'all':!![]}];}_0x2843f1=_[_0x9186('0x3f')]({},_0x2843f1,_0x158c2a[_0x9186('0x48')]);return db[_0x9186('0x41')][_0x9186('0x49')](_0x2843f1)[_0x9186('0x2a')](handleEntityNotFound(_0x474a9b,null))[_0x9186('0x2a')](respondWithResult(_0x474a9b,null))['catch'](handleError(_0x474a9b,null));};exports[_0x9186('0x4a')]=function(_0x12bcc3,_0x573d9a){return db[_0x9186('0x41')][_0x9186('0x4a')](_0x12bcc3['body'],{})[_0x9186('0x2a')](respondWithResult(_0x573d9a,0xc9))[_0x9186('0x45')](handleError(_0x573d9a,null));};exports['update']=function(_0x1fba82,_0xa07580){if(_0x1fba82[_0x9186('0x4b')]['id']){delete _0x1fba82[_0x9186('0x4b')]['id'];}return db[_0x9186('0x41')][_0x9186('0x49')]({'where':{'id':_0x1fba82['params']['id']}})['then'](handleEntityNotFound(_0xa07580,null))[_0x9186('0x2a')](saveUpdates(_0x1fba82['body'],null))[_0x9186('0x2a')](respondWithResult(_0xa07580,null))[_0x9186('0x45')](handleError(_0xa07580,null));};exports['destroy']=function(_0x35963f,_0x20a5d8){return db['ZohoField'][_0x9186('0x49')]({'where':{'id':_0x35963f[_0x9186('0x4c')]['id']}})[_0x9186('0x2a')](handleEntityNotFound(_0x20a5d8,null))[_0x9186('0x2a')](removeEntity(_0x20a5d8,null))[_0x9186('0x45')](handleError(_0x20a5d8,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index db740c3..34fe43b 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 _0x1623=['zoho_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','./intZohoField.attributes','ZohoField','int_zoho_fields'];(function(_0x41c114,_0x29e8b3){var _0x35e30f=function(_0x2b377a){while(--_0x2b377a){_0x41c114['push'](_0x41c114['shift']());}};_0x35e30f(++_0x29e8b3);}(_0x1623,0xab));var _0x3162=function(_0x453d37,_0x41af2c){_0x453d37=_0x453d37-0x0;var _0x3807f9=_0x1623[_0x453d37];return _0x3807f9;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0xa'),_0x3162('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['bluebird','request-promise','path','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x3f4c7b,_0x5ae319){var _0x3fb248=function(_0x339e57){while(--_0x339e57){_0x3f4c7b['push'](_0x3f4c7b['shift']());}};_0x3fb248(++_0x5ae319);}(_0xafc4,0x69));var _0x4afc=function(_0x4b7737,_0x3d39f5){_0x4b7737=_0x4b7737-0x0;var _0x253c8a=_0xafc4[_0x4b7737];return _0x253c8a;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4afc('0xa'),_0x4afc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index dfd1d4d..03d8849 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 _0x7048=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x303276,_0x558016){var _0x530342=function(_0x443fd1){while(--_0x443fd1){_0x303276['push'](_0x303276['shift']());}};_0x530342(++_0x558016);}(_0x7048,0x1ed));var _0x8704=function(_0x10d6c7,_0x4f32c0){_0x10d6c7=_0x10d6c7-0x0;var _0x3721d5=_0x7048[_0x10d6c7];return _0x3721d5;};'use strict';var _=require(_0x8704('0x0'));var util=require(_0x8704('0x1'));var moment=require(_0x8704('0x2'));var BPromise=require(_0x8704('0x3'));var rs=require(_0x8704('0x4'));var fs=require('fs');var Redis=require(_0x8704('0x5'));var db=require(_0x8704('0x6'))['db'];var utils=require(_0x8704('0x7'));var logger=require(_0x8704('0x8'))(_0x8704('0x9'));var config=require(_0x8704('0xa'));var jayson=require(_0x8704('0xb'));var client=jayson[_0x8704('0xc')][_0x8704('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4019f8,_0x42b194,_0x5196a7){return new BPromise(function(_0x513a02,_0x2a2552){return client[_0x8704('0xe')](_0x4019f8,_0x5196a7)[_0x8704('0xf')](function(_0xcef2ff){logger[_0x8704('0x10')]('ZohoField,\x20%s,\x20%s',_0x42b194,'request\x20sent');logger[_0x8704('0x11')](_0x8704('0x12'),_0x42b194,_0x8704('0x13'),JSON['stringify'](_0xcef2ff));if(_0xcef2ff[_0x8704('0x14')]){if(_0xcef2ff[_0x8704('0x14')][_0x8704('0x15')]===0x1f4){logger['error'](_0x8704('0x16'),_0x42b194,_0xcef2ff[_0x8704('0x14')][_0x8704('0x17')]);return _0x2a2552(_0xcef2ff[_0x8704('0x14')][_0x8704('0x17')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x42b194,_0xcef2ff[_0x8704('0x14')][_0x8704('0x17')]);return _0x513a02(_0xcef2ff['error'][_0x8704('0x17')]);}else{logger[_0x8704('0x10')](_0x8704('0x16'),_0x42b194,_0x8704('0x13'));_0x513a02(_0xcef2ff[_0x8704('0x18')][_0x8704('0x17')]);}})['catch'](function(_0x2ce966){logger[_0x8704('0x14')](_0x8704('0x16'),_0x42b194,_0x2ce966);_0x2a2552(_0x2ce966);});});} \ No newline at end of file +var _0x191f=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s'];(function(_0x4b9ae6,_0x19e685){var _0x32bc60=function(_0x4e4d4a){while(--_0x4e4d4a){_0x4b9ae6['push'](_0x4b9ae6['shift']());}};_0x32bc60(++_0x19e685);}(_0x191f,0xbb));var _0xf191=function(_0xdbc857,_0x140440){_0xdbc857=_0xdbc857-0x0;var _0x119bd0=_0x191f[_0xdbc857];return _0x119bd0;};'use strict';var _=require(_0xf191('0x0'));var util=require(_0xf191('0x1'));var moment=require(_0xf191('0x2'));var BPromise=require(_0xf191('0x3'));var rs=require(_0xf191('0x4'));var fs=require('fs');var Redis=require(_0xf191('0x5'));var db=require(_0xf191('0x6'))['db'];var utils=require(_0xf191('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf191('0x8'));var jayson=require(_0xf191('0x9'));var client=jayson[_0xf191('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa878,_0x397e33,_0x45e1d6){return new BPromise(function(_0x4e3bca,_0x4947c8){return client['request'](_0x4aa878,_0x45e1d6)[_0xf191('0xb')](function(_0x28a336){logger[_0xf191('0xc')]('ZohoField,\x20%s,\x20%s',_0x397e33,_0xf191('0xd'));logger[_0xf191('0xe')](_0xf191('0xf'),_0x397e33,_0xf191('0xd'),JSON[_0xf191('0x10')](_0x28a336));if(_0x28a336[_0xf191('0x11')]){if(_0x28a336[_0xf191('0x11')][_0xf191('0x12')]===0x1f4){logger[_0xf191('0x11')](_0xf191('0x13'),_0x397e33,_0x28a336[_0xf191('0x11')]['message']);return _0x4947c8(_0x28a336['error'][_0xf191('0x14')]);}logger[_0xf191('0x11')](_0xf191('0x13'),_0x397e33,_0x28a336[_0xf191('0x11')][_0xf191('0x14')]);return _0x4e3bca(_0x28a336[_0xf191('0x11')][_0xf191('0x14')]);}else{logger[_0xf191('0xc')]('ZohoField,\x20%s,\x20%s',_0x397e33,_0xf191('0xd'));_0x4e3bca(_0x28a336[_0xf191('0x15')][_0xf191('0x14')]);}})[_0xf191('0x16')](function(_0x1f4509){logger[_0xf191('0x11')](_0xf191('0x13'),_0x397e33,_0x1f4509);_0x4947c8(_0x1f4509);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 78e50d7..8ecb009 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33e21e,_0x368fa9){var _0x3ebe11=function(_0x36d311){while(--_0x36d311){_0x33e21e['push'](_0x33e21e['shift']());}};_0x3ebe11(++_0x368fa9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x174212,_0x57fa15){var _0x2da868=function(_0x467b93){while(--_0x467b93){_0x174212['push'](_0x174212['shift']());}};_0x2da868(++_0x57fa15);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xcb91[_0x402731];return _0x111736;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 543f24a..b243fed 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 _0x01ab=['BOOLEAN','unique_name_and_version','STRING'];(function(_0x4bfff4,_0x976415){var _0x5d1237=function(_0x2bbef9){while(--_0x2bbef9){_0x4bfff4['push'](_0x4bfff4['shift']());}};_0x5d1237(++_0x976415);}(_0x01ab,0x1ab));var _0xb01a=function(_0x4c39f5,_0x109684){_0x4c39f5=_0x4c39f5-0x0;var _0x1db24f=_0x01ab[_0x4c39f5];return _0x1db24f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb01a('0x0')},'version':{'type':Sequelize[_0xb01a('0x1')],'allowNull':![],'unique':_0xb01a('0x0')},'main':{'type':Sequelize[_0xb01a('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xb01a('0x1')]},'type':{'type':Sequelize[_0xb01a('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xb01a('0x2')],'defaultValue':![]},'author':{'type':Sequelize[_0xb01a('0x1')]},'logo':{'type':Sequelize[_0xb01a('0x1')]},'state':{'type':Sequelize[_0xb01a('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xb01a('0x1')]},'title':{'type':Sequelize[_0xb01a('0x1')]},'remoteUri':{'type':Sequelize[_0xb01a('0x1')]},'link':{'type':Sequelize[_0xb01a('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7ebf=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x2ab634,_0x114f99){var _0x1f46f9=function(_0x3bb956){while(--_0x3bb956){_0x2ab634['push'](_0x2ab634['shift']());}};_0x1f46f9(++_0x114f99);}(_0x7ebf,0x1da));var _0xf7eb=function(_0x3ac7bf,_0xfd44ca){_0x3ac7bf=_0x3ac7bf-0x0;var _0x252900=_0x7ebf[_0x3ac7bf];return _0x252900;};'use strict';var Sequelize=require(_0xf7eb('0x0'));module[_0xf7eb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf7eb('0x2')},'version':{'type':Sequelize[_0xf7eb('0x3')],'allowNull':![],'unique':_0xf7eb('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xf7eb('0x4')},'filename':{'type':Sequelize[_0xf7eb('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xf7eb('0x5')]},'active':{'type':Sequelize[_0xf7eb('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xf7eb('0x3')]},'logo':{'type':Sequelize[_0xf7eb('0x3')]},'state':{'type':Sequelize[_0xf7eb('0x3')],'unique':_0xf7eb('0x7')},'description':{'type':Sequelize[_0xf7eb('0x3')]},'title':{'type':Sequelize[_0xf7eb('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xf7eb('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b510baf..f6a245e 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 _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x66fa,0x117));var _0xa66f=function(_0x64fe1c,_0x15b6ae){_0x64fe1c=_0x64fe1c-0x0;var _0xd728be=_0x66fa[_0x64fe1c];return _0xd728be;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file +var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0xdb47d8,_0x933e5b){var _0x5cdfd9=function(_0x3b69a8){while(--_0x3b69a8){_0xdb47d8['push'](_0xdb47d8['shift']());}};_0x5cdfd9(++_0x933e5b);}(_0xf61e,0x191));var _0xef61=function(_0x33c7a8,_0xce5895){_0x33c7a8=_0x33c7a8-0x0;var _0x53509c=_0xf61e[_0x33c7a8];return _0x53509c;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['Integration']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['Integration'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index e205cba..a71899c 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 _0xaaaa=['../../config/environment','./integration.attributes','exports','define','Integration','lodash','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaaaa,0xff));var _0xaaaa=function(_0x4418b9,_0x285e25){_0x4418b9=_0x4418b9-0x0;var _0x3fc6cb=_0xaaaa[_0x4418b9];return _0x3fc6cb;};'use strict';var _=require(_0xaaaa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaaaa('0x1'));var rp=require(_0xaaaa('0x2'));var fs=require('fs');var path=require(_0xaaaa('0x3'));var rimraf=require(_0xaaaa('0x4'));var config=require(_0xaaaa('0x5'));var attributes=require(_0xaaaa('0x6'));module[_0xaaaa('0x7')]=function(_0x374066,_0x2cbdd3){return _0x374066[_0xaaaa('0x8')](_0xaaaa('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9015=['bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','moment'];(function(_0x22fb57,_0x2a7585){var _0x1fbe52=function(_0x56d209){while(--_0x56d209){_0x22fb57['push'](_0x22fb57['shift']());}};_0x1fbe52(++_0x2a7585);}(_0x9015,0x6b));var _0x5901=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9015[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x5901('0x0'));var logger=require(_0x5901('0x1'))('api');var moment=require(_0x5901('0x2'));var BPromise=require(_0x5901('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5901('0x4'));var config=require(_0x5901('0x5'));var attributes=require(_0x5901('0x6'));module[_0x5901('0x7')]=function(_0x174f8d,_0x44c7cd){return _0x174f8d[_0x5901('0x8')](_0x5901('0x9'),attributes,{'tableName':_0x5901('0xa'),'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 8eaef5a..d871b42 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 _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2e519a,_0x4b9a71){var _0x182feb=function(_0x332c81){while(--_0x332c81){_0x2e519a['push'](_0x2e519a['shift']());}};_0x182feb(++_0x4b9a71);}(_0x6d38,0x1ef));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b0d76,_0x5843f4){var _0x28b35b=function(_0x1daadd){while(--_0x1daadd){_0x2b0d76['push'](_0x2b0d76['shift']());}};_0x28b35b(++_0x5843f4);}(_0x7880,0x1f4));var _0x0788=function(_0x385669,_0x43d386){_0x385669=_0x385669-0x0;var _0x11e2d2=_0x7880[_0x385669];return _0x11e2d2;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fe804d6..106bb28 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xd943,0x15d));var _0x3d94=function(_0x40d78a,_0x571a72){_0x40d78a=_0x40d78a-0x0;var _0x4e89f4=_0xd943[_0x40d78a];return _0x4e89f4;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x5b279d,_0x356b86){var _0xb2c4ea=function(_0x15044f){while(--_0x15044f){_0x5b279d['push'](_0x5b279d['shift']());}};_0xb2c4ea(++_0x356b86);}(_0x7a54,0x106));var _0x47a5=function(_0x9fc6a7,_0x39300c){_0x9fc6a7=_0x9fc6a7-0x0;var _0x81cfef=_0x7a54[_0x9fc6a7];return _0x81cfef;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 57e7f60..416de00 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 _0x0aaf=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','FAILED'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0aaf,0x90));var _0xf0aa=function(_0x22a91c,_0x5ce13f){_0x22a91c=_0x22a91c-0x0;var _0x733c2f=_0x0aaf[_0x22a91c];return _0x733c2f;};'use strict';var Sequelize=require(_0xf0aa('0x0'));module[_0xf0aa('0x1')]={'integration':{'type':Sequelize[_0xf0aa('0x2')]},'eventChannel':{'type':Sequelize[_0xf0aa('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf0aa('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf0aa('0x2')]},'calleridnum':{'type':Sequelize[_0xf0aa('0x2')]},'calleridname':{'type':Sequelize[_0xf0aa('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xf0aa('0x2')]},'membername':{'type':Sequelize[_0xf0aa('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xf0aa('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf0aa('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xf0aa('0x3')]},'agentacw':{'type':Sequelize[_0xf0aa('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf0aa('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf0aa('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xf0aa('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xf0aa('0x2')]},'channel':{'type':Sequelize[_0xf0aa('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf0aa('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf0aa('0x2')]},'connectedlinename':{'type':Sequelize[_0xf0aa('0x2')]},'language':{'type':Sequelize[_0xf0aa('0x2')]},'accountcode':{'type':Sequelize[_0xf0aa('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf0aa('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf0aa('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf0aa('0x2')]},'destcalleridname':{'type':Sequelize[_0xf0aa('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf0aa('0x2')]},'destlanguage':{'type':Sequelize[_0xf0aa('0x2')]},'destaccountcode':{'type':Sequelize[_0xf0aa('0x2')]},'destcontext':{'type':Sequelize[_0xf0aa('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xf0aa('0x2')]},'destuniqueid':{'type':Sequelize[_0xf0aa('0x2')]},'messageId':{'type':Sequelize[_0xf0aa('0x2')]},'inReplyTo':{'type':Sequelize[_0xf0aa('0x2')]},'subject':{'type':Sequelize[_0xf0aa('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf0aa('0x2')]},'cc':{'type':Sequelize[_0xf0aa('0x2')]},'attachment':{'type':Sequelize[_0xf0aa('0x6')]},'html':{'type':Sequelize[_0xf0aa('0x6')]},'text':{'type':Sequelize[_0xf0aa('0x6')]},'status':{'type':Sequelize['ENUM'](_0xf0aa('0x7'),'SENDING','RECEIVED',_0xf0aa('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xf0aa('0x2')]},'appdata':{'type':Sequelize[_0xf0aa('0x2')]},'projectId':{'type':Sequelize[_0xf0aa('0x3')]}}; \ No newline at end of file +var _0x1116=['TEXT','ENUM','SENT','RECEIVED','sequelize','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x64d7e9,_0x2c2f38){var _0x506b2b=function(_0x3d6132){while(--_0x3d6132){_0x64d7e9['push'](_0x64d7e9['shift']());}};_0x506b2b(++_0x2c2f38);}(_0x1116,0x190));var _0x6111=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x1116[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x6111('0x0'));module['exports']={'integration':{'type':Sequelize[_0x6111('0x1')]},'eventChannel':{'type':Sequelize[_0x6111('0x1')]},'exitStatus':{'type':Sequelize[_0x6111('0x1')]},'ticketId':{'type':Sequelize[_0x6111('0x1')]},'integrationId':{'type':Sequelize[_0x6111('0x2')]},'contacts':{'type':Sequelize[_0x6111('0x1')]},'uniqueid':{'type':Sequelize[_0x6111('0x1')]},'calleridnum':{'type':Sequelize[_0x6111('0x1')]},'calleridname':{'type':Sequelize[_0x6111('0x1')]},'queue':{'type':Sequelize[_0x6111('0x1')]},'interface':{'type':Sequelize[_0x6111('0x1')]},'membername':{'type':Sequelize[_0x6111('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6111('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6111('0x3')]},'holdtime':{'type':Sequelize[_0x6111('0x2')]},'agentcomplete':{'type':Sequelize[_0x6111('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6111('0x2')]},'agentacw':{'type':Sequelize[_0x6111('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6111('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x6111('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6111('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6111('0x3')]},'lastevent':{'type':Sequelize[_0x6111('0x1')]},'channel':{'type':Sequelize[_0x6111('0x1')]},'channelstate':{'type':Sequelize[_0x6111('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6111('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6111('0x1')]},'accountcode':{'type':Sequelize[_0x6111('0x1')]},'context':{'type':Sequelize[_0x6111('0x1')]},'exten':{'type':Sequelize[_0x6111('0x1')]},'priority':{'type':Sequelize[_0x6111('0x1')]},'destchannel':{'type':Sequelize[_0x6111('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x6111('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6111('0x1')]},'destcalleridname':{'type':Sequelize[_0x6111('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6111('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x6111('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6111('0x1')]},'messageId':{'type':Sequelize[_0x6111('0x1')]},'inReplyTo':{'type':Sequelize[_0x6111('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x6111('0x1')]},'to':{'type':Sequelize[_0x6111('0x1')]},'cc':{'type':Sequelize[_0x6111('0x1')]},'attachment':{'type':Sequelize[_0x6111('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x6111('0x5')]},'status':{'type':Sequelize[_0x6111('0x6')](_0x6111('0x7'),'SENDING',_0x6111('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x6111('0x1')]},'appdata':{'type':Sequelize[_0x6111('0x1')]},'projectId':{'type':Sequelize[_0x6111('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 9ab2e04..82fbefa 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 _0xa9d6=['undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','includeAll','include','catch','show','params','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xa9d6,0xb9));var _0x6a9d=function(_0x252f30,_0x2691b1){_0x252f30=_0x252f30-0x0;var _0x391643=_0xa9d6[_0x252f30];return _0x391643;};'use strict';var emlformat=require(_0x6a9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a9d('0x1'));var jsonpatch=require(_0x6a9d('0x2'));var rp=require(_0x6a9d('0x3'));var moment=require(_0x6a9d('0x4'));var BPromise=require(_0x6a9d('0x5'));var Mustache=require('mustache');var util=require(_0x6a9d('0x6'));var path=require(_0x6a9d('0x7'));var sox=require(_0x6a9d('0x8'));var csv=require(_0x6a9d('0x9'));var ejs=require(_0x6a9d('0xa'));var fs=require('fs');var fs_extra=require(_0x6a9d('0xb'));var _=require(_0x6a9d('0xc'));var squel=require('squel');var crypto=require(_0x6a9d('0xd'));var jsforce=require(_0x6a9d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6a9d('0x9'));var querystring=require(_0x6a9d('0xf'));var Papa=require(_0x6a9d('0x10'));var Redis=require(_0x6a9d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a9d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a9d('0x13'))('api');var utils=require(_0x6a9d('0x14'));var config=require(_0x6a9d('0x15'));var licenseUtil=require(_0x6a9d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4926fa,_0x22103f){_0x22103f=_0x22103f||0xcc;return function(_0x345388){if(_0x345388){return _0x4926fa[_0x6a9d('0x17')](_0x22103f);}return _0x4926fa[_0x6a9d('0x18')](_0x22103f)[_0x6a9d('0x19')]();};}function respondWithResult(_0x1f1699,_0x2e5096){_0x2e5096=_0x2e5096||0xc8;return function(_0x2a782a){if(_0x2a782a){return _0x1f1699[_0x6a9d('0x18')](_0x2e5096)[_0x6a9d('0x1a')](_0x2a782a);}};}function respondWithFilteredResult(_0x4cfda6,_0x899e66){return function(_0x1ed7bd){if(_0x1ed7bd){var _0x3abef1=typeof _0x899e66[_0x6a9d('0x1b')]===_0x6a9d('0x1c')&&typeof _0x899e66[_0x6a9d('0x1d')]===_0x6a9d('0x1c');var _0x52ac8d=_0x1ed7bd[_0x6a9d('0x1e')];var _0x4e086e=_0x3abef1?0x0:_0x899e66[_0x6a9d('0x1b')];var _0x91fa49=_0x3abef1?_0x1ed7bd[_0x6a9d('0x1e')]:_0x899e66['offset']+_0x899e66['limit'];var _0x3b05d2;if(_0x91fa49>=_0x52ac8d){_0x91fa49=_0x52ac8d;_0x3b05d2=0xc8;}else{_0x3b05d2=0xce;}_0x4cfda6[_0x6a9d('0x18')](_0x3b05d2);return _0x4cfda6['set'](_0x6a9d('0x1f'),_0x4e086e+'-'+_0x91fa49+'/'+_0x52ac8d)[_0x6a9d('0x1a')](_0x1ed7bd);}return null;};}function patchUpdates(_0x12e483){return function(_0x4dfb0f){try{jsonpatch['apply'](_0x4dfb0f,_0x12e483,!![]);}catch(_0x53cc7c){return BPromise[_0x6a9d('0x20')](_0x53cc7c);}return _0x4dfb0f[_0x6a9d('0x21')]();};}function saveUpdates(_0x12da07,_0x226eb8){return function(_0x5d5344){if(_0x5d5344){return _0x5d5344[_0x6a9d('0x22')](_0x12da07)['then'](function(_0x238a64){return _0x238a64;});}return null;};}function removeEntity(_0x48b84b,_0x6cdae){return function(_0x2edc05){if(_0x2edc05){return _0x2edc05[_0x6a9d('0x23')]()[_0x6a9d('0x24')](function(){_0x48b84b[_0x6a9d('0x18')](0xcc)[_0x6a9d('0x19')]();});}};}function handleEntityNotFound(_0x2f59a4,_0x357f03){return function(_0x565f64){if(!_0x565f64){_0x2f59a4[_0x6a9d('0x17')](0x194);}return _0x565f64;};}function handleError(_0x5da53a,_0x32351c){_0x32351c=_0x32351c||0x1f4;return function(_0x310f0b){logger[_0x6a9d('0x25')](_0x310f0b[_0x6a9d('0x26')]);if(_0x310f0b[_0x6a9d('0x27')]){delete _0x310f0b[_0x6a9d('0x27')];}_0x5da53a[_0x6a9d('0x18')](_0x32351c)[_0x6a9d('0x28')](_0x310f0b);};}exports['index']=function(_0x4f7eee,_0x50124d){var _0x1ff81a={},_0x13e770={},_0x460821={'count':0x0,'rows':[]};var _0x22813a=_[_0x6a9d('0x29')](db[_0x6a9d('0x2a')][_0x6a9d('0x2b')],function(_0x306241){return{'name':_0x306241['fieldName'],'type':_0x306241[_0x6a9d('0x2c')][_0x6a9d('0x2d')]};});_0x13e770[_0x6a9d('0x2e')]=_[_0x6a9d('0x29')](_0x22813a,'name');_0x13e770[_0x6a9d('0x2f')]=_[_0x6a9d('0x30')](_0x4f7eee['query']);_0x13e770[_0x6a9d('0x31')]=_[_0x6a9d('0x32')](_0x13e770[_0x6a9d('0x2e')],_0x13e770[_0x6a9d('0x2f')]);_0x1ff81a[_0x6a9d('0x33')]=_['intersection'](_0x13e770[_0x6a9d('0x2e')],qs[_0x6a9d('0x34')](_0x4f7eee[_0x6a9d('0x2f')][_0x6a9d('0x34')]));_0x1ff81a['attributes']=_0x1ff81a[_0x6a9d('0x33')]['length']?_0x1ff81a[_0x6a9d('0x33')]:_0x13e770[_0x6a9d('0x2e')];if(!_0x4f7eee['query'][_0x6a9d('0x35')](_0x6a9d('0x36'))){_0x1ff81a[_0x6a9d('0x1d')]=qs[_0x6a9d('0x1d')](_0x4f7eee[_0x6a9d('0x2f')][_0x6a9d('0x1d')]);_0x1ff81a['offset']=qs['offset'](_0x4f7eee['query'][_0x6a9d('0x1b')]);}_0x1ff81a[_0x6a9d('0x37')]=qs[_0x6a9d('0x38')](_0x4f7eee['query'][_0x6a9d('0x38')]);_0x1ff81a['where']=qs['filters'](_[_0x6a9d('0x39')](_0x4f7eee[_0x6a9d('0x2f')],_0x13e770[_0x6a9d('0x31')]),_0x22813a);if(_0x4f7eee[_0x6a9d('0x2f')][_0x6a9d('0x3a')]){_0x1ff81a['where']=_[_0x6a9d('0x3b')](_0x1ff81a['where'],{'$or':_[_0x6a9d('0x29')](_0x22813a,function(_0x5fafff){if(_0x5fafff[_0x6a9d('0x2c')]!=='VIRTUAL'){var _0x3210db={};_0x3210db[_0x5fafff[_0x6a9d('0x27')]]={'$like':'%'+_0x4f7eee[_0x6a9d('0x2f')]['filter']+'%'};return _0x3210db;}})});}_0x1ff81a=_[_0x6a9d('0x3b')]({},_0x1ff81a,_0x4f7eee[_0x6a9d('0x3c')]);var _0x14776a={'where':_0x1ff81a['where']};return db['IntegrationReport'][_0x6a9d('0x1e')](_0x14776a)['then'](function(_0x410fed){_0x460821[_0x6a9d('0x1e')]=_0x410fed;if(_0x4f7eee[_0x6a9d('0x2f')][_0x6a9d('0x3d')]){_0x1ff81a[_0x6a9d('0x3e')]=[{'all':!![]}];}return db[_0x6a9d('0x2a')]['findAll'](_0x1ff81a);})[_0x6a9d('0x24')](function(_0x596a79){_0x460821['rows']=_0x596a79;return _0x460821;})[_0x6a9d('0x24')](respondWithFilteredResult(_0x50124d,_0x1ff81a))[_0x6a9d('0x3f')](handleError(_0x50124d,null));};exports[_0x6a9d('0x40')]=function(_0x208350,_0x19c735){var _0x48260c={'raw':![],'where':{'id':_0x208350[_0x6a9d('0x41')]['id']}},_0xe00614={};_0xe00614[_0x6a9d('0x2e')]=_['keys'](db[_0x6a9d('0x2a')][_0x6a9d('0x2b')]);_0xe00614[_0x6a9d('0x2f')]=_[_0x6a9d('0x30')](_0x208350[_0x6a9d('0x2f')]);_0xe00614[_0x6a9d('0x31')]=_['intersection'](_0xe00614[_0x6a9d('0x2e')],_0xe00614[_0x6a9d('0x2f')]);_0x48260c[_0x6a9d('0x33')]=_[_0x6a9d('0x32')](_0xe00614['model'],qs[_0x6a9d('0x34')](_0x208350['query'][_0x6a9d('0x34')]));_0x48260c[_0x6a9d('0x33')]=_0x48260c['attributes'][_0x6a9d('0x42')]?_0x48260c[_0x6a9d('0x33')]:_0xe00614[_0x6a9d('0x2e')];if(_0x208350[_0x6a9d('0x2f')][_0x6a9d('0x3d')]){_0x48260c[_0x6a9d('0x3e')]=[{'all':!![]}];}_0x48260c=_[_0x6a9d('0x3b')]({},_0x48260c,_0x208350[_0x6a9d('0x3c')]);return db[_0x6a9d('0x2a')]['find'](_0x48260c)['then'](handleEntityNotFound(_0x19c735,null))[_0x6a9d('0x24')](respondWithResult(_0x19c735,null))[_0x6a9d('0x3f')](handleError(_0x19c735,null));};exports['create']=function(_0x5353a6,_0x351498){return db['IntegrationReport'][_0x6a9d('0x43')](_0x5353a6[_0x6a9d('0x44')],{})['then'](respondWithResult(_0x351498,0xc9))[_0x6a9d('0x3f')](handleError(_0x351498,null));};exports[_0x6a9d('0x22')]=function(_0x5e571c,_0x50aee2){if(_0x5e571c['body']['id']){delete _0x5e571c[_0x6a9d('0x44')]['id'];}return db[_0x6a9d('0x2a')][_0x6a9d('0x45')]({'where':{'id':_0x5e571c[_0x6a9d('0x41')]['id']}})[_0x6a9d('0x24')](handleEntityNotFound(_0x50aee2,null))[_0x6a9d('0x24')](saveUpdates(_0x5e571c[_0x6a9d('0x44')],null))[_0x6a9d('0x24')](respondWithResult(_0x50aee2,null))[_0x6a9d('0x3f')](handleError(_0x50aee2,null));};exports[_0x6a9d('0x23')]=function(_0x2a5142,_0x5ac446){return db[_0x6a9d('0x2a')][_0x6a9d('0x45')]({'where':{'id':_0x2a5142[_0x6a9d('0x41')]['id']}})[_0x6a9d('0x24')](handleEntityNotFound(_0x5ac446,null))[_0x6a9d('0x24')](removeEntity(_0x5ac446,null))[_0x6a9d('0x3f')](handleError(_0x5ac446,null));};exports[_0x6a9d('0x46')]=function(_0x2cbdbe,_0x14152c){return db[_0x6a9d('0x2a')][_0x6a9d('0x46')]()[_0x6a9d('0x24')](respondWithResult(_0x14152c,null))['catch'](handleError(_0x14152c,null));}; \ No newline at end of file +var _0xcdc4=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','limit','undefined','offset','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query'];(function(_0x3af704,_0x58486b){var _0x4ac16c=function(_0x1a49b8){while(--_0x1a49b8){_0x3af704['push'](_0x3af704['shift']());}};_0x4ac16c(++_0x58486b);}(_0xcdc4,0x1ba));var _0x4cdc=function(_0xb7f4e,_0x4da983){_0xb7f4e=_0xb7f4e-0x0;var _0x2df6ee=_0xcdc4[_0xb7f4e];return _0x2df6ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cdc('0x0'));var zipdir=require(_0x4cdc('0x1'));var jsonpatch=require(_0x4cdc('0x2'));var rp=require(_0x4cdc('0x3'));var moment=require(_0x4cdc('0x4'));var BPromise=require(_0x4cdc('0x5'));var Mustache=require(_0x4cdc('0x6'));var util=require(_0x4cdc('0x7'));var path=require('path');var sox=require(_0x4cdc('0x8'));var csv=require(_0x4cdc('0x9'));var ejs=require(_0x4cdc('0xa'));var fs=require('fs');var fs_extra=require(_0x4cdc('0xb'));var _=require(_0x4cdc('0xc'));var squel=require('squel');var crypto=require(_0x4cdc('0xd'));var jsforce=require(_0x4cdc('0xe'));var deskjs=require(_0x4cdc('0xf'));var toCsv=require(_0x4cdc('0x9'));var querystring=require('querystring');var Papa=require(_0x4cdc('0x10'));var Redis=require(_0x4cdc('0x11'));var authService=require(_0x4cdc('0x12'));var qs=require(_0x4cdc('0x13'));var as=require(_0x4cdc('0x14'));var hardwareService=require(_0x4cdc('0x15'));var logger=require(_0x4cdc('0x16'))(_0x4cdc('0x17'));var utils=require(_0x4cdc('0x18'));var config=require(_0x4cdc('0x19'));var licenseUtil=require(_0x4cdc('0x1a'));var db=require(_0x4cdc('0x1b'))['db'];function respondWithStatusCode(_0x4635de,_0x40b6d3){_0x40b6d3=_0x40b6d3||0xcc;return function(_0x14e081){if(_0x14e081){return _0x4635de['sendStatus'](_0x40b6d3);}return _0x4635de['status'](_0x40b6d3)[_0x4cdc('0x1c')]();};}function respondWithResult(_0x3afc0e,_0x1406e4){_0x1406e4=_0x1406e4||0xc8;return function(_0x2fd372){if(_0x2fd372){return _0x3afc0e['status'](_0x1406e4)[_0x4cdc('0x1d')](_0x2fd372);}};}function respondWithFilteredResult(_0x2e065f,_0x137cee){return function(_0x421e63){if(_0x421e63){var _0x4b458c=typeof _0x137cee['offset']==='undefined'&&typeof _0x137cee[_0x4cdc('0x1e')]===_0x4cdc('0x1f');var _0x4f0cf0=_0x421e63['count'];var _0x253ad7=_0x4b458c?0x0:_0x137cee[_0x4cdc('0x20')];var _0x12390b=_0x4b458c?_0x421e63[_0x4cdc('0x21')]:_0x137cee['offset']+_0x137cee[_0x4cdc('0x1e')];var _0x43a16d;if(_0x12390b>=_0x4f0cf0){_0x12390b=_0x4f0cf0;_0x43a16d=0xc8;}else{_0x43a16d=0xce;}_0x2e065f[_0x4cdc('0x22')](_0x43a16d);return _0x2e065f[_0x4cdc('0x23')](_0x4cdc('0x24'),_0x253ad7+'-'+_0x12390b+'/'+_0x4f0cf0)[_0x4cdc('0x1d')](_0x421e63);}return null;};}function patchUpdates(_0x96cd74){return function(_0x2ea3cd){try{jsonpatch[_0x4cdc('0x25')](_0x2ea3cd,_0x96cd74,!![]);}catch(_0x1965c2){return BPromise[_0x4cdc('0x26')](_0x1965c2);}return _0x2ea3cd[_0x4cdc('0x27')]();};}function saveUpdates(_0x1a3f6d,_0x109aff){return function(_0x2552d4){if(_0x2552d4){return _0x2552d4[_0x4cdc('0x28')](_0x1a3f6d)[_0x4cdc('0x29')](function(_0x243062){return _0x243062;});}return null;};}function removeEntity(_0x23c3f7,_0x2d54d7){return function(_0xeb5116){if(_0xeb5116){return _0xeb5116[_0x4cdc('0x2a')]()[_0x4cdc('0x29')](function(){_0x23c3f7['status'](0xcc)[_0x4cdc('0x1c')]();});}};}function handleEntityNotFound(_0x44c67d,_0x1cff33){return function(_0x193e86){if(!_0x193e86){_0x44c67d[_0x4cdc('0x2b')](0x194);}return _0x193e86;};}function handleError(_0x1cadaf,_0x59b828){_0x59b828=_0x59b828||0x1f4;return function(_0x5e81e5){logger[_0x4cdc('0x2c')](_0x5e81e5[_0x4cdc('0x2d')]);if(_0x5e81e5[_0x4cdc('0x2e')]){delete _0x5e81e5[_0x4cdc('0x2e')];}_0x1cadaf[_0x4cdc('0x22')](_0x59b828)[_0x4cdc('0x2f')](_0x5e81e5);};}exports[_0x4cdc('0x30')]=function(_0x5c20e6,_0x3113c9){var _0x51fa88={},_0x534b05={},_0x52a122={'count':0x0,'rows':[]};var _0x5bec23=_[_0x4cdc('0x31')](db[_0x4cdc('0x32')][_0x4cdc('0x33')],function(_0xb3d0f4){return{'name':_0xb3d0f4[_0x4cdc('0x34')],'type':_0xb3d0f4['type'][_0x4cdc('0x35')]};});_0x534b05[_0x4cdc('0x36')]=_[_0x4cdc('0x31')](_0x5bec23,'name');_0x534b05[_0x4cdc('0x37')]=_[_0x4cdc('0x38')](_0x5c20e6['query']);_0x534b05[_0x4cdc('0x39')]=_[_0x4cdc('0x3a')](_0x534b05[_0x4cdc('0x36')],_0x534b05[_0x4cdc('0x37')]);_0x51fa88[_0x4cdc('0x3b')]=_[_0x4cdc('0x3a')](_0x534b05[_0x4cdc('0x36')],qs[_0x4cdc('0x3c')](_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x3c')]));_0x51fa88[_0x4cdc('0x3b')]=_0x51fa88[_0x4cdc('0x3b')][_0x4cdc('0x3d')]?_0x51fa88[_0x4cdc('0x3b')]:_0x534b05[_0x4cdc('0x36')];if(!_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x3e')](_0x4cdc('0x3f'))){_0x51fa88[_0x4cdc('0x1e')]=qs['limit'](_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x1e')]);_0x51fa88[_0x4cdc('0x20')]=qs['offset'](_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x20')]);}_0x51fa88[_0x4cdc('0x40')]=qs[_0x4cdc('0x41')](_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x41')]);_0x51fa88[_0x4cdc('0x42')]=qs[_0x4cdc('0x39')](_[_0x4cdc('0x43')](_0x5c20e6[_0x4cdc('0x37')],_0x534b05[_0x4cdc('0x39')]),_0x5bec23);if(_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x44')]){_0x51fa88['where']=_['merge'](_0x51fa88[_0x4cdc('0x42')],{'$or':_[_0x4cdc('0x31')](_0x5bec23,function(_0x65401f){if(_0x65401f['type']!==_0x4cdc('0x45')){var _0x29abcd={};_0x29abcd[_0x65401f['name']]={'$like':'%'+_0x5c20e6['query'][_0x4cdc('0x44')]+'%'};return _0x29abcd;}})});}_0x51fa88=_[_0x4cdc('0x46')]({},_0x51fa88,_0x5c20e6[_0x4cdc('0x47')]);var _0x2d962d={'where':_0x51fa88[_0x4cdc('0x42')]};return db[_0x4cdc('0x32')][_0x4cdc('0x21')](_0x2d962d)[_0x4cdc('0x29')](function(_0x18cb7d){_0x52a122[_0x4cdc('0x21')]=_0x18cb7d;if(_0x5c20e6[_0x4cdc('0x37')][_0x4cdc('0x48')]){_0x51fa88[_0x4cdc('0x49')]=[{'all':!![]}];}return db['IntegrationReport'][_0x4cdc('0x4a')](_0x51fa88);})['then'](function(_0x170dda){_0x52a122[_0x4cdc('0x4b')]=_0x170dda;return _0x52a122;})[_0x4cdc('0x29')](respondWithFilteredResult(_0x3113c9,_0x51fa88))[_0x4cdc('0x4c')](handleError(_0x3113c9,null));};exports[_0x4cdc('0x4d')]=function(_0x49c387,_0x4afc79){var _0x56f976={'raw':![],'where':{'id':_0x49c387['params']['id']}},_0x51bcae={};_0x51bcae[_0x4cdc('0x36')]=_[_0x4cdc('0x38')](db['IntegrationReport'][_0x4cdc('0x33')]);_0x51bcae['query']=_[_0x4cdc('0x38')](_0x49c387['query']);_0x51bcae[_0x4cdc('0x39')]=_[_0x4cdc('0x3a')](_0x51bcae[_0x4cdc('0x36')],_0x51bcae[_0x4cdc('0x37')]);_0x56f976[_0x4cdc('0x3b')]=_[_0x4cdc('0x3a')](_0x51bcae['model'],qs[_0x4cdc('0x3c')](_0x49c387[_0x4cdc('0x37')]['fields']));_0x56f976[_0x4cdc('0x3b')]=_0x56f976['attributes']['length']?_0x56f976[_0x4cdc('0x3b')]:_0x51bcae[_0x4cdc('0x36')];if(_0x49c387[_0x4cdc('0x37')][_0x4cdc('0x48')]){_0x56f976[_0x4cdc('0x49')]=[{'all':!![]}];}_0x56f976=_[_0x4cdc('0x46')]({},_0x56f976,_0x49c387[_0x4cdc('0x47')]);return db[_0x4cdc('0x32')]['find'](_0x56f976)[_0x4cdc('0x29')](handleEntityNotFound(_0x4afc79,null))[_0x4cdc('0x29')](respondWithResult(_0x4afc79,null))[_0x4cdc('0x4c')](handleError(_0x4afc79,null));};exports[_0x4cdc('0x4e')]=function(_0x225239,_0x2a2aa9){return db['IntegrationReport'][_0x4cdc('0x4e')](_0x225239[_0x4cdc('0x4f')],{})[_0x4cdc('0x29')](respondWithResult(_0x2a2aa9,0xc9))['catch'](handleError(_0x2a2aa9,null));};exports[_0x4cdc('0x28')]=function(_0x52f7ec,_0x209189){if(_0x52f7ec[_0x4cdc('0x4f')]['id']){delete _0x52f7ec[_0x4cdc('0x4f')]['id'];}return db[_0x4cdc('0x32')][_0x4cdc('0x50')]({'where':{'id':_0x52f7ec['params']['id']}})[_0x4cdc('0x29')](handleEntityNotFound(_0x209189,null))[_0x4cdc('0x29')](saveUpdates(_0x52f7ec[_0x4cdc('0x4f')],null))[_0x4cdc('0x29')](respondWithResult(_0x209189,null))[_0x4cdc('0x4c')](handleError(_0x209189,null));};exports['destroy']=function(_0x305bee,_0x1d76ed){return db['IntegrationReport'][_0x4cdc('0x50')]({'where':{'id':_0x305bee[_0x4cdc('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d76ed,null))['then'](removeEntity(_0x1d76ed,null))[_0x4cdc('0x4c')](handleError(_0x1d76ed,null));};exports[_0x4cdc('0x52')]=function(_0x539889,_0x28f9c2){return db[_0x4cdc('0x32')][_0x4cdc('0x52')]()['then'](respondWithResult(_0x28f9c2,null))[_0x4cdc('0x4c')](handleError(_0x28f9c2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4c95e35..c6c7d9c 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 _0x9b6f=['request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','report_integration','../../config/logger','api','moment'];(function(_0x41757b,_0x49eaaf){var _0x84a9=function(_0x8467dc){while(--_0x8467dc){_0x41757b['push'](_0x41757b['shift']());}};_0x84a9(++_0x49eaaf);}(_0x9b6f,0xf7));var _0xf9b6=function(_0x1d874d,_0x4ec6d2){_0x1d874d=_0x1d874d-0x0;var _0x4fb9a8=_0x9b6f[_0x1d874d];return _0x4fb9a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9b6('0x0'))(_0xf9b6('0x1'));var moment=require(_0xf9b6('0x2'));var BPromise=require('bluebird');var rp=require(_0xf9b6('0x3'));var fs=require('fs');var path=require(_0xf9b6('0x4'));var rimraf=require('rimraf');var config=require(_0xf9b6('0x5'));var attributes=require(_0xf9b6('0x6'));module[_0xf9b6('0x7')]=function(_0x268166,_0x5645b5){return _0x268166[_0xf9b6('0x8')]('IntegrationReport',attributes,{'tableName':_0xf9b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa335=['request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x23b3fc,_0x59b1c1){var _0x24e919=function(_0x47e1c2){while(--_0x47e1c2){_0x23b3fc['push'](_0x23b3fc['shift']());}};_0x24e919(++_0x59b1c1);}(_0xa335,0x159));var _0x5a33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa335[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5a33('0x0'));var util=require(_0x5a33('0x1'));var logger=require(_0x5a33('0x2'))(_0x5a33('0x3'));var moment=require(_0x5a33('0x4'));var BPromise=require(_0x5a33('0x5'));var rp=require(_0x5a33('0x6'));var fs=require('fs');var path=require(_0x5a33('0x7'));var rimraf=require('rimraf');var config=require(_0x5a33('0x8'));var attributes=require(_0x5a33('0x9'));module[_0x5a33('0xa')]=function(_0x4b32f6,_0x4747b4){return _0x4b32f6[_0x5a33('0xb')]('IntegrationReport',attributes,{'tableName':_0x5a33('0xc'),'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 2871196..a46c976 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x36a5dc,_0x210bbf){var _0x11ba8c=function(_0x48e5bc){while(--_0x48e5bc){_0x36a5dc['push'](_0x36a5dc['shift']());}};_0x11ba8c(++_0x210bbf);}(_0xdb28,0x106));var _0x8db2=function(_0x4277ab,_0x5e5e3c){_0x4277ab=_0x4277ab-0x0;var _0x157ae1=_0xdb28[_0x4277ab];return _0x157ae1;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x152fee,_0x3d6a81){var _0x4ad506=function(_0x485751){while(--_0x485751){_0x152fee['push'](_0x152fee['shift']());}};_0x4ad506(++_0x3d6a81);}(_0x2675,0x75));var _0x5267=function(_0x1d70cb,_0x16e1ef){_0x1d70cb=_0x1d70cb-0x0;var _0x246c28=_0x2675[_0x1d70cb];return _0x246c28;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b4fa4c8..64571e8 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 _0x4300=['destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4300,0x1a6));var _0x0430=function(_0x328af3,_0x2b5be5){_0x328af3=_0x328af3-0x0;var _0x1263a8=_0x4300[_0x328af3];return _0x1263a8;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var fs_extra=require(_0x0430('0x2'));var auth=require(_0x0430('0x3'));var interaction=require(_0x0430('0x4'));var config=require(_0x0430('0x5'));var controller=require('./interval.controller');router[_0x0430('0x6')]('/',auth['isAuthenticated'](),controller[_0x0430('0x7')]);router['get'](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0xa')]);router[_0x0430('0x6')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xc')]);router[_0x0430('0xd')]('/',auth[_0x0430('0x9')](),controller['create']);router[_0x0430('0xd')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xe')]);router[_0x0430('0xd')](_0x0430('0xf'),auth[_0x0430('0x9')](),controller[_0x0430('0x10')]);router['put']('/:id',auth[_0x0430('0x9')](),controller[_0x0430('0x11')]);router[_0x0430('0x12')](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0x13')]);module[_0x0430('0x14')]=router; \ No newline at end of file +var _0x2f38=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer'];(function(_0x2e5d55,_0x4abab3){var _0x8ac7d5=function(_0x390f2b){while(--_0x390f2b){_0x2e5d55['push'](_0x2e5d55['shift']());}};_0x8ac7d5(++_0x4abab3);}(_0x2f38,0x95));var _0x82f3=function(_0x1b7e04,_0x390c6e){_0x1b7e04=_0x1b7e04-0x0;var _0x1103cc=_0x2f38[_0x1b7e04];return _0x1103cc;};'use strict';var multer=require(_0x82f3('0x0'));var util=require('util');var path=require(_0x82f3('0x1'));var timeout=require(_0x82f3('0x2'));var express=require(_0x82f3('0x3'));var router=express[_0x82f3('0x4')]();var fs_extra=require(_0x82f3('0x5'));var auth=require(_0x82f3('0x6'));var interaction=require(_0x82f3('0x7'));var config=require(_0x82f3('0x8'));var controller=require(_0x82f3('0x9'));router['get']('/',auth[_0x82f3('0xa')](),controller[_0x82f3('0xb')]);router[_0x82f3('0xc')](_0x82f3('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x82f3('0xe'),auth[_0x82f3('0xa')](),controller[_0x82f3('0xf')]);router['post']('/',auth[_0x82f3('0xa')](),controller[_0x82f3('0x10')]);router[_0x82f3('0x11')](_0x82f3('0xe'),auth[_0x82f3('0xa')](),controller[_0x82f3('0x12')]);router[_0x82f3('0x11')](_0x82f3('0x13'),auth[_0x82f3('0xa')](),controller['addIntervals']);router[_0x82f3('0x14')]('/:id',auth[_0x82f3('0xa')](),controller[_0x82f3('0x15')]);router[_0x82f3('0x16')](_0x82f3('0xd'),auth['isAuthenticated'](),controller[_0x82f3('0x17')]);module[_0x82f3('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ca3b5a6..56922a4 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 _0xd8ce=['STRING'];(function(_0x27b439,_0xfe6411){var _0x2db931=function(_0x364270){while(--_0x364270){_0x27b439['push'](_0x27b439['shift']());}};_0x2db931(++_0xfe6411);}(_0xd8ce,0x134));var _0xed8c=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0xd8ce[_0x946518];return _0x909b69;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xed8c('0x0')]},'description':{'type':Sequelize[_0xed8c('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4ff5=['STRING','sequelize'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x4ff5,0xfb));var _0x54ff=function(_0x516bd1,_0x56a257){_0x516bd1=_0x516bd1-0x0;var _0x532413=_0x4ff5[_0x516bd1];return _0x532413;};'use strict';var Sequelize=require(_0x54ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x54ff('0x1')]},'description':{'type':Sequelize[_0x54ff('0x1')]},'interval':{'type':Sequelize[_0x54ff('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4430736..1f995bc 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 _0x0ed9=['UserProfileResource','name','index','Interval','rawAttributes','fieldName','type','key','map','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','addInterval','IntervalId','create','getIntervals','order','pick','addIntervals','findOne','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Intervals'];(function(_0x51d793,_0x454ece){var _0x3aefc4=function(_0x149c88){while(--_0x149c88){_0x51d793['push'](_0x51d793['shift']());}};_0x3aefc4(++_0x454ece);}(_0x0ed9,0x19f));var _0x90ed=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0x0ed9[_0x4d7241];return _0x59d9e2;};'use strict';var emlformat=require(_0x90ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90ed('0x1'));var jsonpatch=require(_0x90ed('0x2'));var rp=require('request-promise');var moment=require(_0x90ed('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x90ed('0x4'));var util=require(_0x90ed('0x5'));var path=require(_0x90ed('0x6'));var sox=require(_0x90ed('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90ed('0x8'));var _=require(_0x90ed('0x9'));var squel=require('squel');var crypto=require(_0x90ed('0xa'));var jsforce=require(_0x90ed('0xb'));var deskjs=require(_0x90ed('0xc'));var toCsv=require(_0x90ed('0xd'));var querystring=require(_0x90ed('0xe'));var Papa=require(_0x90ed('0xf'));var Redis=require(_0x90ed('0x10'));var authService=require(_0x90ed('0x11'));var qs=require(_0x90ed('0x12'));var as=require(_0x90ed('0x13'));var hardwareService=require(_0x90ed('0x14'));var logger=require(_0x90ed('0x15'))(_0x90ed('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x90ed('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x90ed('0x18'));function respondWithStatusCode(_0x23ff2a,_0x2b71fe){_0x2b71fe=_0x2b71fe||0xcc;return function(_0x5602c0){if(_0x5602c0){return _0x23ff2a[_0x90ed('0x19')](_0x2b71fe);}return _0x23ff2a[_0x90ed('0x1a')](_0x2b71fe)['end']();};}function respondWithResult(_0x4fd1e1,_0x132a82){_0x132a82=_0x132a82||0xc8;return function(_0x366c6a){if(_0x366c6a){return _0x4fd1e1[_0x90ed('0x1a')](_0x132a82)['json'](_0x366c6a);}};}function respondWithFilteredResult(_0x18ff0c,_0x29540f){return function(_0x46cef8){if(_0x46cef8){var _0x3d0e58=typeof _0x29540f[_0x90ed('0x1b')]===_0x90ed('0x1c')&&typeof _0x29540f['limit']==='undefined';var _0x21264f=_0x46cef8['count'];var _0x515f4e=_0x3d0e58?0x0:_0x29540f[_0x90ed('0x1b')];var _0xb8705e=_0x3d0e58?_0x46cef8[_0x90ed('0x1d')]:_0x29540f[_0x90ed('0x1b')]+_0x29540f[_0x90ed('0x1e')];var _0x378303;if(_0xb8705e>=_0x21264f){_0xb8705e=_0x21264f;_0x378303=0xc8;}else{_0x378303=0xce;}_0x18ff0c[_0x90ed('0x1a')](_0x378303);return _0x18ff0c['set'](_0x90ed('0x1f'),_0x515f4e+'-'+_0xb8705e+'/'+_0x21264f)['json'](_0x46cef8);}return null;};}function patchUpdates(_0x424580){return function(_0x191b6b){try{jsonpatch[_0x90ed('0x20')](_0x191b6b,_0x424580,!![]);}catch(_0x5ea8e4){return BPromise[_0x90ed('0x21')](_0x5ea8e4);}return _0x191b6b[_0x90ed('0x22')]();};}function saveUpdates(_0x34772e,_0x39b9ed){return function(_0x450d12){if(_0x450d12){return _0x450d12[_0x90ed('0x23')](_0x34772e)[_0x90ed('0x24')](function(_0x626db0){return _0x626db0;});}return null;};}function removeEntity(_0x1f1185,_0x714a2c){return function(_0x34e401){if(_0x34e401){return _0x34e401[_0x90ed('0x25')]()[_0x90ed('0x24')](function(){var _0x14cae4=_0x34e401[_0x90ed('0x26')]({'plain':!![]});var _0x2d911f=_0x90ed('0x27');return db[_0x90ed('0x28')][_0x90ed('0x25')]({'where':{'type':_0x2d911f,'resourceId':_0x14cae4['id']}})['then'](function(){return _0x34e401;});})['then'](function(){_0x1f1185[_0x90ed('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f1313,_0x2da254){return function(_0x196c16){if(!_0x196c16){_0x5f1313[_0x90ed('0x19')](0x194);}return _0x196c16;};}function handleError(_0x37b5e0,_0x387dfb){_0x387dfb=_0x387dfb||0x1f4;return function(_0x257b4e){logger['error'](_0x257b4e['stack']);if(_0x257b4e['name']){delete _0x257b4e[_0x90ed('0x29')];}_0x37b5e0['status'](_0x387dfb)['send'](_0x257b4e);};}exports[_0x90ed('0x2a')]=function(_0x18baf7,_0x2cc5ae){var _0x24f23f={},_0x2cded4={},_0x2d4e13={'count':0x0,'rows':[]};var _0xfd4047=_['map'](db[_0x90ed('0x2b')][_0x90ed('0x2c')],function(_0x3f1c78){return{'name':_0x3f1c78[_0x90ed('0x2d')],'type':_0x3f1c78[_0x90ed('0x2e')][_0x90ed('0x2f')]};});_0x2cded4['model']=_[_0x90ed('0x30')](_0xfd4047,_0x90ed('0x29'));_0x2cded4['query']=_[_0x90ed('0x31')](_0x18baf7['query']);_0x2cded4[_0x90ed('0x32')]=_['intersection'](_0x2cded4[_0x90ed('0x33')],_0x2cded4[_0x90ed('0x34')]);_0x24f23f[_0x90ed('0x35')]=_[_0x90ed('0x36')](_0x2cded4['model'],qs[_0x90ed('0x37')](_0x18baf7[_0x90ed('0x34')][_0x90ed('0x37')]));_0x24f23f['attributes']=_0x24f23f[_0x90ed('0x35')][_0x90ed('0x38')]?_0x24f23f[_0x90ed('0x35')]:_0x2cded4['model'];if(!_0x18baf7[_0x90ed('0x34')][_0x90ed('0x39')](_0x90ed('0x3a'))){_0x24f23f[_0x90ed('0x1e')]=qs[_0x90ed('0x1e')](_0x18baf7['query'][_0x90ed('0x1e')]);_0x24f23f[_0x90ed('0x1b')]=qs[_0x90ed('0x1b')](_0x18baf7[_0x90ed('0x34')]['offset']);}_0x24f23f['order']=qs['sort'](_0x18baf7[_0x90ed('0x34')][_0x90ed('0x3b')]);_0x24f23f[_0x90ed('0x3c')]=qs[_0x90ed('0x32')](_['pick'](_0x18baf7['query'],_0x2cded4[_0x90ed('0x32')]),_0xfd4047);if(_0x18baf7[_0x90ed('0x34')][_0x90ed('0x3d')]){_0x24f23f[_0x90ed('0x3c')]=_[_0x90ed('0x3e')](_0x24f23f[_0x90ed('0x3c')],{'$or':_[_0x90ed('0x30')](_0xfd4047,function(_0x21f182){if(_0x21f182[_0x90ed('0x2e')]!==_0x90ed('0x3f')){var _0x3baf3c={};_0x3baf3c[_0x21f182[_0x90ed('0x29')]]={'$like':'%'+_0x18baf7['query'][_0x90ed('0x3d')]+'%'};return _0x3baf3c;}})});}_0x24f23f=_['merge']({},_0x24f23f,_0x18baf7[_0x90ed('0x40')]);var _0x66acfc={'where':_0x24f23f[_0x90ed('0x3c')]};return db[_0x90ed('0x2b')]['count'](_0x66acfc)[_0x90ed('0x24')](function(_0x4e99ff){_0x2d4e13[_0x90ed('0x1d')]=_0x4e99ff;if(_0x18baf7['query'][_0x90ed('0x41')]){_0x24f23f['include']=[{'all':!![]}];}return db[_0x90ed('0x2b')][_0x90ed('0x42')](_0x24f23f);})['then'](function(_0x4df7c1){_0x2d4e13[_0x90ed('0x43')]=_0x4df7c1;return _0x2d4e13;})['then'](respondWithFilteredResult(_0x2cc5ae,_0x24f23f))['catch'](handleError(_0x2cc5ae,null));};exports[_0x90ed('0x44')]=function(_0x297f09,_0x581ed5){var _0x5f4810={'raw':!![],'where':{'id':_0x297f09['params']['id']}},_0x24f766={};_0x24f766[_0x90ed('0x33')]=_[_0x90ed('0x31')](db[_0x90ed('0x2b')][_0x90ed('0x2c')]);_0x24f766[_0x90ed('0x34')]=_[_0x90ed('0x31')](_0x297f09[_0x90ed('0x34')]);_0x24f766[_0x90ed('0x32')]=_[_0x90ed('0x36')](_0x24f766[_0x90ed('0x33')],_0x24f766[_0x90ed('0x34')]);_0x5f4810[_0x90ed('0x35')]=_[_0x90ed('0x36')](_0x24f766[_0x90ed('0x33')],qs[_0x90ed('0x37')](_0x297f09[_0x90ed('0x34')][_0x90ed('0x37')]));_0x5f4810[_0x90ed('0x35')]=_0x5f4810[_0x90ed('0x35')][_0x90ed('0x38')]?_0x5f4810['attributes']:_0x24f766[_0x90ed('0x33')];if(_0x297f09[_0x90ed('0x34')][_0x90ed('0x41')]){_0x5f4810[_0x90ed('0x45')]=[{'all':!![]}];}_0x5f4810=_[_0x90ed('0x3e')]({},_0x5f4810,_0x297f09[_0x90ed('0x40')]);return db[_0x90ed('0x2b')][_0x90ed('0x46')](_0x5f4810)[_0x90ed('0x24')](handleEntityNotFound(_0x581ed5,null))[_0x90ed('0x24')](respondWithResult(_0x581ed5,null))['catch'](handleError(_0x581ed5,null));};exports['create']=function(_0x18681a,_0x2898bc){return db[_0x90ed('0x2b')]['create'](_0x18681a[_0x90ed('0x47')],{})[_0x90ed('0x24')](function(_0x24f56f){var _0x1ec6d0=_0x18681a[_0x90ed('0x48')][_0x90ed('0x26')]({'plain':!![]});if(!_0x1ec6d0)throw new Error(_0x90ed('0x49'));if(_0x1ec6d0[_0x90ed('0x4a')]===_0x90ed('0x48')){var _0x3e644a=_0x24f56f[_0x90ed('0x26')]({'plain':!![]});var _0x93b93e=_0x90ed('0x27');return db[_0x90ed('0x4b')][_0x90ed('0x46')]({'where':{'name':_0x93b93e,'userProfileId':_0x1ec6d0[_0x90ed('0x4c')]},'raw':!![]})[_0x90ed('0x24')](function(_0x6fd514){if(_0x6fd514&&_0x6fd514[_0x90ed('0x4d')]===0x0){return db[_0x90ed('0x28')]['create']({'name':_0x3e644a[_0x90ed('0x29')],'resourceId':_0x3e644a['id'],'type':_0x6fd514[_0x90ed('0x29')],'sectionId':_0x6fd514['id']},{})[_0x90ed('0x24')](function(){return _0x24f56f;});}else{return _0x24f56f;}})['catch'](function(_0x250aac){logger[_0x90ed('0x4e')](_0x90ed('0x4f'),_0x250aac);throw _0x250aac;});}return _0x24f56f;})[_0x90ed('0x24')](respondWithResult(_0x2898bc,0xc9))[_0x90ed('0x50')](handleError(_0x2898bc,null));};exports['update']=function(_0xc12d00,_0x2acc71){if(_0xc12d00[_0x90ed('0x47')]['id']){delete _0xc12d00[_0x90ed('0x47')]['id'];}return db[_0x90ed('0x2b')]['find']({'where':{'id':_0xc12d00[_0x90ed('0x51')]['id']}})[_0x90ed('0x24')](handleEntityNotFound(_0x2acc71,null))[_0x90ed('0x24')](saveUpdates(_0xc12d00[_0x90ed('0x47')],null))[_0x90ed('0x24')](respondWithResult(_0x2acc71,null))['catch'](handleError(_0x2acc71,null));};exports[_0x90ed('0x25')]=function(_0x10e645,_0x261786){return db['Interval'][_0x90ed('0x46')]({'where':{'id':_0x10e645[_0x90ed('0x51')]['id']}})[_0x90ed('0x24')](handleEntityNotFound(_0x261786,null))[_0x90ed('0x24')](removeEntity(_0x261786,null))['catch'](handleError(_0x261786,null));};exports[_0x90ed('0x52')]=function(_0x1796e1,_0x3d7a74,_0x30b4c7){if(_0x1796e1[_0x90ed('0x47')]['id']){delete _0x1796e1[_0x90ed('0x47')]['id'];}return db[_0x90ed('0x2b')]['find']({'where':{'id':_0x1796e1['params']['id']}})[_0x90ed('0x24')](handleEntityNotFound(_0x3d7a74,null))[_0x90ed('0x24')](function(_0xdde112){if(_0xdde112){_0x1796e1[_0x90ed('0x47')][_0x90ed('0x53')]=_0xdde112['id'];return db[_0x90ed('0x2b')][_0x90ed('0x54')](_0x1796e1[_0x90ed('0x47')]);}})[_0x90ed('0x24')](respondWithResult(_0x3d7a74,null))[_0x90ed('0x50')](handleError(_0x3d7a74,null));};exports[_0x90ed('0x55')]=function(_0x3b8149,_0x2049b4,_0x50954f){var _0x2c2b1a={};var _0x223fa1={};var _0x1df35c;var _0x3da11a;return db[_0x90ed('0x2b')]['findOne']({'where':{'id':_0x3b8149[_0x90ed('0x51')]['id']}})[_0x90ed('0x24')](handleEntityNotFound(_0x2049b4,null))['then'](function(_0x18223e){if(_0x18223e){_0x1df35c=_0x18223e;_0x223fa1[_0x90ed('0x33')]=_[_0x90ed('0x31')](db['Interval'][_0x90ed('0x2c')]);_0x223fa1['query']=_[_0x90ed('0x31')](_0x3b8149[_0x90ed('0x34')]);_0x223fa1['filters']=_['intersection'](_0x223fa1[_0x90ed('0x33')],_0x223fa1['query']);_0x2c2b1a[_0x90ed('0x35')]=_[_0x90ed('0x36')](_0x223fa1['model'],qs['fields'](_0x3b8149[_0x90ed('0x34')][_0x90ed('0x37')]));_0x2c2b1a[_0x90ed('0x35')]=_0x2c2b1a[_0x90ed('0x35')]['length']?_0x2c2b1a['attributes']:_0x223fa1[_0x90ed('0x33')];_0x2c2b1a[_0x90ed('0x56')]=qs[_0x90ed('0x3b')](_0x3b8149[_0x90ed('0x34')]['sort']);_0x2c2b1a[_0x90ed('0x3c')]=qs[_0x90ed('0x32')](_[_0x90ed('0x57')](_0x3b8149['query'],_0x223fa1[_0x90ed('0x32')]));if(_0x3b8149[_0x90ed('0x34')][_0x90ed('0x3d')]){_0x2c2b1a[_0x90ed('0x3c')]=_['merge'](_0x2c2b1a[_0x90ed('0x3c')],{'$or':_['map'](_0x2c2b1a[_0x90ed('0x35')],function(_0x2d727e){var _0x3b7a81={};_0x3b7a81[_0x2d727e]={'$like':'%'+_0x3b8149[_0x90ed('0x34')]['filter']+'%'};return _0x3b7a81;})});}_0x2c2b1a=_[_0x90ed('0x3e')]({},_0x2c2b1a,_0x3b8149[_0x90ed('0x40')]);return _0x1df35c['getIntervals'](_0x2c2b1a);}})[_0x90ed('0x24')](function(_0x227bfa){if(_0x227bfa){_0x3da11a=_0x227bfa[_0x90ed('0x38')];if(!_0x3b8149[_0x90ed('0x34')][_0x90ed('0x39')]('nolimit')){_0x2c2b1a['limit']=qs['limit'](_0x3b8149['query'][_0x90ed('0x1e')]);_0x2c2b1a['offset']=qs[_0x90ed('0x1b')](_0x3b8149[_0x90ed('0x34')]['offset']);}return _0x1df35c[_0x90ed('0x55')](_0x2c2b1a);}})[_0x90ed('0x24')](function(_0x43832c){if(_0x43832c){return _0x43832c?{'count':_0x3da11a,'rows':_0x43832c}:null;}})['then'](respondWithResult(_0x2049b4,null))['catch'](handleError(_0x2049b4,null));};exports[_0x90ed('0x58')]=function(_0x254459,_0x538fbd,_0x1952e6){return db[_0x90ed('0x2b')][_0x90ed('0x59')]({'where':{'id':_0x254459[_0x90ed('0x51')]['id']}})[_0x90ed('0x24')](handleEntityNotFound(_0x538fbd,null))[_0x90ed('0x24')](function(_0x89b82e){if(_0x89b82e){return db['sequelize']['transaction'](function(_0x2e26cf){return db[_0x90ed('0x2b')][_0x90ed('0x25')]({'where':{'IntervalId':_0x254459[_0x90ed('0x51')]['id']},'transaction':_0x2e26cf})[_0x90ed('0x24')](function(_0x487802){var _0x1cea06=_[_0x90ed('0x30')](_0x254459['body'],function(_0x4f8654){delete _0x4f8654['id'];_0x4f8654['IntervalId']=_0x254459[_0x90ed('0x51')]['id'];return _0x4f8654;});return db[_0x90ed('0x2b')][_0x90ed('0x5a')](_0x1cea06,{'transaction':_0x2e26cf});});})[_0x90ed('0x24')](function(){return db[_0x90ed('0x2b')][_0x90ed('0x42')]({'where':{'IntervalId':_0x254459[_0x90ed('0x51')]['id']}});});}})[_0x90ed('0x24')](respondWithResult(_0x538fbd,null))['catch'](handleError(_0x538fbd,null));}; \ No newline at end of file +var _0xd29f=['status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','get','Intervals','destroy','then','error','stack','name','send','index','Interval','rawAttributes','fieldName','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end'];(function(_0x6dd1b0,_0x45785f){var _0x4d5506=function(_0x338b54){while(--_0x338b54){_0x6dd1b0['push'](_0x6dd1b0['shift']());}};_0x4d5506(++_0x45785f);}(_0xd29f,0x109));var _0xfd29=function(_0x19cbcc,_0x44384e){_0x19cbcc=_0x19cbcc-0x0;var _0x44d405=_0xd29f[_0x19cbcc];return _0x44d405;};'use strict';var emlformat=require(_0xfd29('0x0'));var rimraf=require(_0xfd29('0x1'));var zipdir=require(_0xfd29('0x2'));var jsonpatch=require(_0xfd29('0x3'));var rp=require('request-promise');var moment=require(_0xfd29('0x4'));var BPromise=require(_0xfd29('0x5'));var Mustache=require(_0xfd29('0x6'));var util=require(_0xfd29('0x7'));var path=require(_0xfd29('0x8'));var sox=require(_0xfd29('0x9'));var csv=require(_0xfd29('0xa'));var ejs=require(_0xfd29('0xb'));var fs=require('fs');var fs_extra=require(_0xfd29('0xc'));var _=require(_0xfd29('0xd'));var squel=require(_0xfd29('0xe'));var crypto=require(_0xfd29('0xf'));var jsforce=require(_0xfd29('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd29('0x11'));var Papa=require(_0xfd29('0x12'));var Redis=require(_0xfd29('0x13'));var authService=require(_0xfd29('0x14'));var qs=require(_0xfd29('0x15'));var as=require(_0xfd29('0x16'));var hardwareService=require(_0xfd29('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfd29('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd29('0x19'))['db'];var extensions=require(_0xfd29('0x1a'));function respondWithStatusCode(_0x107cdd,_0x14b0b1){_0x14b0b1=_0x14b0b1||0xcc;return function(_0x1ee4e9){if(_0x1ee4e9){return _0x107cdd[_0xfd29('0x1b')](_0x14b0b1);}return _0x107cdd['status'](_0x14b0b1)[_0xfd29('0x1c')]();};}function respondWithResult(_0x127609,_0x15be10){_0x15be10=_0x15be10||0xc8;return function(_0x1954cb){if(_0x1954cb){return _0x127609[_0xfd29('0x1d')](_0x15be10)['json'](_0x1954cb);}};}function respondWithFilteredResult(_0x2ff17b,_0x38fada){return function(_0x4d700b){if(_0x4d700b){var _0x2c1b32=typeof _0x38fada[_0xfd29('0x1e')]===_0xfd29('0x1f')&&typeof _0x38fada[_0xfd29('0x20')]===_0xfd29('0x1f');var _0x5bfb86=_0x4d700b[_0xfd29('0x21')];var _0x57cbaf=_0x2c1b32?0x0:_0x38fada[_0xfd29('0x1e')];var _0x23acc7=_0x2c1b32?_0x4d700b[_0xfd29('0x21')]:_0x38fada[_0xfd29('0x1e')]+_0x38fada['limit'];var _0x11b43c;if(_0x23acc7>=_0x5bfb86){_0x23acc7=_0x5bfb86;_0x11b43c=0xc8;}else{_0x11b43c=0xce;}_0x2ff17b[_0xfd29('0x1d')](_0x11b43c);return _0x2ff17b[_0xfd29('0x22')](_0xfd29('0x23'),_0x57cbaf+'-'+_0x23acc7+'/'+_0x5bfb86)[_0xfd29('0x24')](_0x4d700b);}return null;};}function patchUpdates(_0x6d8bcb){return function(_0xfdf958){try{jsonpatch[_0xfd29('0x25')](_0xfdf958,_0x6d8bcb,!![]);}catch(_0x14ae25){return BPromise[_0xfd29('0x26')](_0x14ae25);}return _0xfdf958['save']();};}function saveUpdates(_0x913bf9,_0x260dd6){return function(_0x16de5f){if(_0x16de5f){return _0x16de5f[_0xfd29('0x27')](_0x913bf9)['then'](function(_0x29104a){return _0x29104a;});}return null;};}function removeEntity(_0x5d71a1,_0x531c9b){return function(_0x30b4da){if(_0x30b4da){return _0x30b4da['destroy']()['then'](function(){var _0x3e6c22=_0x30b4da[_0xfd29('0x28')]({'plain':!![]});var _0xa20189=_0xfd29('0x29');return db['UserProfileResource'][_0xfd29('0x2a')]({'where':{'type':_0xa20189,'resourceId':_0x3e6c22['id']}})[_0xfd29('0x2b')](function(){return _0x30b4da;});})[_0xfd29('0x2b')](function(){_0x5d71a1[_0xfd29('0x1d')](0xcc)[_0xfd29('0x1c')]();});}};}function handleEntityNotFound(_0x3d1cda,_0x504dd2){return function(_0x4e4c5a){if(!_0x4e4c5a){_0x3d1cda['sendStatus'](0x194);}return _0x4e4c5a;};}function handleError(_0x18bd19,_0x107168){_0x107168=_0x107168||0x1f4;return function(_0x3e4b6c){logger[_0xfd29('0x2c')](_0x3e4b6c[_0xfd29('0x2d')]);if(_0x3e4b6c[_0xfd29('0x2e')]){delete _0x3e4b6c['name'];}_0x18bd19['status'](_0x107168)[_0xfd29('0x2f')](_0x3e4b6c);};}exports[_0xfd29('0x30')]=function(_0x476510,_0x5abecc){var _0x9d4c40={},_0x2dbdc4={},_0x5e0b70={'count':0x0,'rows':[]};var _0x4ed229=_['map'](db[_0xfd29('0x31')][_0xfd29('0x32')],function(_0x51b690){return{'name':_0x51b690[_0xfd29('0x33')],'type':_0x51b690['type'][_0xfd29('0x34')]};});_0x2dbdc4['model']=_[_0xfd29('0x35')](_0x4ed229,_0xfd29('0x2e'));_0x2dbdc4[_0xfd29('0x36')]=_[_0xfd29('0x37')](_0x476510['query']);_0x2dbdc4[_0xfd29('0x38')]=_['intersection'](_0x2dbdc4[_0xfd29('0x39')],_0x2dbdc4[_0xfd29('0x36')]);_0x9d4c40['attributes']=_['intersection'](_0x2dbdc4[_0xfd29('0x39')],qs['fields'](_0x476510[_0xfd29('0x36')][_0xfd29('0x3a')]));_0x9d4c40[_0xfd29('0x3b')]=_0x9d4c40[_0xfd29('0x3b')][_0xfd29('0x3c')]?_0x9d4c40[_0xfd29('0x3b')]:_0x2dbdc4[_0xfd29('0x39')];if(!_0x476510['query'][_0xfd29('0x3d')](_0xfd29('0x3e'))){_0x9d4c40[_0xfd29('0x20')]=qs['limit'](_0x476510[_0xfd29('0x36')]['limit']);_0x9d4c40[_0xfd29('0x1e')]=qs['offset'](_0x476510[_0xfd29('0x36')]['offset']);}_0x9d4c40[_0xfd29('0x3f')]=qs['sort'](_0x476510[_0xfd29('0x36')][_0xfd29('0x40')]);_0x9d4c40[_0xfd29('0x41')]=qs[_0xfd29('0x38')](_[_0xfd29('0x42')](_0x476510[_0xfd29('0x36')],_0x2dbdc4[_0xfd29('0x38')]),_0x4ed229);if(_0x476510['query'][_0xfd29('0x43')]){_0x9d4c40[_0xfd29('0x41')]=_[_0xfd29('0x44')](_0x9d4c40[_0xfd29('0x41')],{'$or':_['map'](_0x4ed229,function(_0x511bc6){if(_0x511bc6[_0xfd29('0x45')]!==_0xfd29('0x46')){var _0x5eeeb7={};_0x5eeeb7[_0x511bc6[_0xfd29('0x2e')]]={'$like':'%'+_0x476510[_0xfd29('0x36')]['filter']+'%'};return _0x5eeeb7;}})});}_0x9d4c40=_[_0xfd29('0x44')]({},_0x9d4c40,_0x476510[_0xfd29('0x47')]);var _0x6ee943={'where':_0x9d4c40['where']};return db[_0xfd29('0x31')]['count'](_0x6ee943)['then'](function(_0x3c93ac){_0x5e0b70[_0xfd29('0x21')]=_0x3c93ac;if(_0x476510[_0xfd29('0x36')][_0xfd29('0x48')]){_0x9d4c40['include']=[{'all':!![]}];}return db[_0xfd29('0x31')]['findAll'](_0x9d4c40);})['then'](function(_0xadc962){_0x5e0b70[_0xfd29('0x49')]=_0xadc962;return _0x5e0b70;})[_0xfd29('0x2b')](respondWithFilteredResult(_0x5abecc,_0x9d4c40))['catch'](handleError(_0x5abecc,null));};exports[_0xfd29('0x4a')]=function(_0x112498,_0x339869){var _0x5a2b2a={'raw':!![],'where':{'id':_0x112498[_0xfd29('0x4b')]['id']}},_0x3c991d={};_0x3c991d[_0xfd29('0x39')]=_['keys'](db[_0xfd29('0x31')][_0xfd29('0x32')]);_0x3c991d[_0xfd29('0x36')]=_['keys'](_0x112498[_0xfd29('0x36')]);_0x3c991d[_0xfd29('0x38')]=_['intersection'](_0x3c991d[_0xfd29('0x39')],_0x3c991d[_0xfd29('0x36')]);_0x5a2b2a[_0xfd29('0x3b')]=_[_0xfd29('0x4c')](_0x3c991d[_0xfd29('0x39')],qs['fields'](_0x112498['query'][_0xfd29('0x3a')]));_0x5a2b2a[_0xfd29('0x3b')]=_0x5a2b2a[_0xfd29('0x3b')][_0xfd29('0x3c')]?_0x5a2b2a[_0xfd29('0x3b')]:_0x3c991d[_0xfd29('0x39')];if(_0x112498[_0xfd29('0x36')][_0xfd29('0x48')]){_0x5a2b2a['include']=[{'all':!![]}];}_0x5a2b2a=_[_0xfd29('0x44')]({},_0x5a2b2a,_0x112498[_0xfd29('0x47')]);return db[_0xfd29('0x31')][_0xfd29('0x4d')](_0x5a2b2a)['then'](handleEntityNotFound(_0x339869,null))[_0xfd29('0x2b')](respondWithResult(_0x339869,null))['catch'](handleError(_0x339869,null));};exports[_0xfd29('0x4e')]=function(_0x17d0b6,_0x2df950){return db[_0xfd29('0x31')][_0xfd29('0x4e')](_0x17d0b6[_0xfd29('0x4f')],{})[_0xfd29('0x2b')](function(_0x512902){var _0x35ddff=_0x17d0b6[_0xfd29('0x50')][_0xfd29('0x28')]({'plain':!![]});if(!_0x35ddff)throw new Error(_0xfd29('0x51'));if(_0x35ddff[_0xfd29('0x52')]===_0xfd29('0x50')){var _0x7f459=_0x512902[_0xfd29('0x28')]({'plain':!![]});var _0x3b1975=_0xfd29('0x29');return db[_0xfd29('0x53')][_0xfd29('0x4d')]({'where':{'name':_0x3b1975,'userProfileId':_0x35ddff[_0xfd29('0x54')]},'raw':!![]})[_0xfd29('0x2b')](function(_0x5dfc8){if(_0x5dfc8&&_0x5dfc8[_0xfd29('0x55')]===0x0){return db[_0xfd29('0x56')][_0xfd29('0x4e')]({'name':_0x7f459['name'],'resourceId':_0x7f459['id'],'type':_0x5dfc8[_0xfd29('0x2e')],'sectionId':_0x5dfc8['id']},{})['then'](function(){return _0x512902;});}else{return _0x512902;}})[_0xfd29('0x57')](function(_0x1c712c){logger[_0xfd29('0x2c')](_0xfd29('0x58'),_0x1c712c);throw _0x1c712c;});}return _0x512902;})[_0xfd29('0x2b')](respondWithResult(_0x2df950,0xc9))['catch'](handleError(_0x2df950,null));};exports[_0xfd29('0x27')]=function(_0xed16f6,_0x586f6f){if(_0xed16f6[_0xfd29('0x4f')]['id']){delete _0xed16f6['body']['id'];}return db[_0xfd29('0x31')][_0xfd29('0x4d')]({'where':{'id':_0xed16f6[_0xfd29('0x4b')]['id']}})[_0xfd29('0x2b')](handleEntityNotFound(_0x586f6f,null))[_0xfd29('0x2b')](saveUpdates(_0xed16f6['body'],null))[_0xfd29('0x2b')](respondWithResult(_0x586f6f,null))['catch'](handleError(_0x586f6f,null));};exports['destroy']=function(_0x54322d,_0x2418cf){return db[_0xfd29('0x31')][_0xfd29('0x4d')]({'where':{'id':_0x54322d[_0xfd29('0x4b')]['id']}})[_0xfd29('0x2b')](handleEntityNotFound(_0x2418cf,null))[_0xfd29('0x2b')](removeEntity(_0x2418cf,null))[_0xfd29('0x57')](handleError(_0x2418cf,null));};exports[_0xfd29('0x59')]=function(_0x38b124,_0x2af1a8,_0x404c2a){if(_0x38b124[_0xfd29('0x4f')]['id']){delete _0x38b124[_0xfd29('0x4f')]['id'];}return db[_0xfd29('0x31')]['find']({'where':{'id':_0x38b124[_0xfd29('0x4b')]['id']}})[_0xfd29('0x2b')](handleEntityNotFound(_0x2af1a8,null))[_0xfd29('0x2b')](function(_0x5a026e){if(_0x5a026e){_0x38b124['body'][_0xfd29('0x5a')]=_0x5a026e['id'];return db[_0xfd29('0x31')][_0xfd29('0x4e')](_0x38b124['body']);}})[_0xfd29('0x2b')](respondWithResult(_0x2af1a8,null))[_0xfd29('0x57')](handleError(_0x2af1a8,null));};exports[_0xfd29('0x5b')]=function(_0x47197c,_0x420d52,_0x56b386){var _0x386df1={};var _0x126c51={};var _0x2af78b;var _0x3f51f0;return db[_0xfd29('0x31')][_0xfd29('0x5c')]({'where':{'id':_0x47197c[_0xfd29('0x4b')]['id']}})['then'](handleEntityNotFound(_0x420d52,null))[_0xfd29('0x2b')](function(_0x52843a){if(_0x52843a){_0x2af78b=_0x52843a;_0x126c51['model']=_[_0xfd29('0x37')](db[_0xfd29('0x31')][_0xfd29('0x32')]);_0x126c51[_0xfd29('0x36')]=_['keys'](_0x47197c['query']);_0x126c51['filters']=_['intersection'](_0x126c51[_0xfd29('0x39')],_0x126c51[_0xfd29('0x36')]);_0x386df1[_0xfd29('0x3b')]=_[_0xfd29('0x4c')](_0x126c51[_0xfd29('0x39')],qs[_0xfd29('0x3a')](_0x47197c['query'][_0xfd29('0x3a')]));_0x386df1['attributes']=_0x386df1[_0xfd29('0x3b')][_0xfd29('0x3c')]?_0x386df1['attributes']:_0x126c51[_0xfd29('0x39')];_0x386df1['order']=qs[_0xfd29('0x40')](_0x47197c[_0xfd29('0x36')][_0xfd29('0x40')]);_0x386df1[_0xfd29('0x41')]=qs[_0xfd29('0x38')](_[_0xfd29('0x42')](_0x47197c[_0xfd29('0x36')],_0x126c51[_0xfd29('0x38')]));if(_0x47197c['query']['filter']){_0x386df1['where']=_[_0xfd29('0x44')](_0x386df1['where'],{'$or':_['map'](_0x386df1[_0xfd29('0x3b')],function(_0x4c45f5){var _0x37fac3={};_0x37fac3[_0x4c45f5]={'$like':'%'+_0x47197c[_0xfd29('0x36')]['filter']+'%'};return _0x37fac3;})});}_0x386df1=_[_0xfd29('0x44')]({},_0x386df1,_0x47197c[_0xfd29('0x47')]);return _0x2af78b[_0xfd29('0x5b')](_0x386df1);}})[_0xfd29('0x2b')](function(_0x5474d5){if(_0x5474d5){_0x3f51f0=_0x5474d5[_0xfd29('0x3c')];if(!_0x47197c[_0xfd29('0x36')]['hasOwnProperty']('nolimit')){_0x386df1[_0xfd29('0x20')]=qs['limit'](_0x47197c[_0xfd29('0x36')][_0xfd29('0x20')]);_0x386df1[_0xfd29('0x1e')]=qs[_0xfd29('0x1e')](_0x47197c['query'][_0xfd29('0x1e')]);}return _0x2af78b[_0xfd29('0x5b')](_0x386df1);}})[_0xfd29('0x2b')](function(_0x13dd3a){if(_0x13dd3a){return _0x13dd3a?{'count':_0x3f51f0,'rows':_0x13dd3a}:null;}})[_0xfd29('0x2b')](respondWithResult(_0x420d52,null))[_0xfd29('0x57')](handleError(_0x420d52,null));};exports[_0xfd29('0x5d')]=function(_0x535628,_0x494341,_0x4798d5){return db[_0xfd29('0x31')][_0xfd29('0x5c')]({'where':{'id':_0x535628[_0xfd29('0x4b')]['id']}})[_0xfd29('0x2b')](handleEntityNotFound(_0x494341,null))[_0xfd29('0x2b')](function(_0x4ea64b){if(_0x4ea64b){return db[_0xfd29('0x5e')][_0xfd29('0x5f')](function(_0x482b2c){return db[_0xfd29('0x31')][_0xfd29('0x2a')]({'where':{'IntervalId':_0x535628[_0xfd29('0x4b')]['id']},'transaction':_0x482b2c})[_0xfd29('0x2b')](function(_0x314eb2){var _0x4fec90=_['map'](_0x535628[_0xfd29('0x4f')],function(_0x47ea65){delete _0x47ea65['id'];_0x47ea65[_0xfd29('0x5a')]=_0x535628[_0xfd29('0x4b')]['id'];return _0x47ea65;});return db[_0xfd29('0x31')][_0xfd29('0x60')](_0x4fec90,{'transaction':_0x482b2c});});})[_0xfd29('0x2b')](function(){return db['Interval'][_0xfd29('0x61')]({'where':{'IntervalId':_0x535628[_0xfd29('0x4b')]['id']}});});}})[_0xfd29('0x2b')](respondWithResult(_0x494341,null))[_0xfd29('0x57')](handleError(_0x494341,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 9d0440f..a89c729 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 _0x2c06=['rewrite','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x321e01,_0xdd0c77){var _0xa6c71c=function(_0x3419cc){while(--_0x3419cc){_0x321e01['push'](_0x321e01['shift']());}};_0xa6c71c(++_0xdd0c77);}(_0x2c06,0x1cf));var _0x62c0=function(_0x554367,_0x183137){_0x554367=_0x554367-0x0;var _0x2419ea=_0x2c06[_0x554367];return _0x2419ea;};'use strict';var _=require(_0x62c0('0x0'));var util=require(_0x62c0('0x1'));var logger=require(_0x62c0('0x2'))('api');var moment=require(_0x62c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x62c0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x62c0('0x5'));var attributes=require(_0x62c0('0x6'));var extensions=require(_0x62c0('0x7'));module[_0x62c0('0x8')]=function(_0xf16ad,_0xe341fb){return _0xf16ad['define'](_0x62c0('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x574bb5,_0x60fb27){extensions[_0x62c0('0xa')](_0xf16ad,_0x574bb5);},'afterBulkCreate':function(_0xb4b57,_0x4af61b,_0x3f6438){_0x3f6438();extensions[_0x62c0('0xa')](_0xf16ad,_0xb4b57[0x0]);},'afterUpdate':function(_0x39c2cf,_0x305e00){extensions[_0x62c0('0xa')](_0xf16ad,_0x39c2cf);},'afterDestroy':function(_0x4e144b,_0x5e22bd){extensions['rewrite'](_0xf16ad,_0x4e144b);}}});}; \ No newline at end of file +var _0x45fc=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x45fc,0x16f));var _0xc45f=function(_0x4229b2,_0x1cd586){_0x4229b2=_0x4229b2-0x0;var _0x252835=_0x45fc[_0x4229b2];return _0x252835;};'use strict';var _=require(_0xc45f('0x0'));var util=require(_0xc45f('0x1'));var logger=require(_0xc45f('0x2'))(_0xc45f('0x3'));var moment=require('moment');var BPromise=require(_0xc45f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc45f('0x5'));var config=require(_0xc45f('0x6'));var attributes=require(_0xc45f('0x7'));var extensions=require(_0xc45f('0x8'));module['exports']=function(_0x2bb3b4,_0x137426){return _0x2bb3b4[_0xc45f('0x9')](_0xc45f('0xa'),attributes,{'tableName':_0xc45f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c95fb,_0x2c566a){extensions[_0xc45f('0xc')](_0x2bb3b4,_0x4c95fb);},'afterBulkCreate':function(_0x3993db,_0x1235fe,_0x11315a){_0x11315a();extensions[_0xc45f('0xc')](_0x2bb3b4,_0x3993db[0x0]);},'afterUpdate':function(_0x2d05e7,_0xe38aee){extensions['rewrite'](_0x2bb3b4,_0x2d05e7);},'afterDestroy':function(_0x2590f1,_0x48813f){extensions['rewrite'](_0x2bb3b4,_0x2590f1);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 93b7cca..fdc6b05 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index cd4e3ef..5f0bf7a 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x8fd298,_0x5acdfb){var _0x137c9b=function(_0x267bc2){while(--_0x267bc2){_0x8fd298['push'](_0x8fd298['shift']());}};_0x137c9b(++_0x5acdfb);}(_0xadb5,0xad));var _0x5adb=function(_0x2043e6,_0xb11613){_0x2043e6=_0x2043e6-0x0;var _0x9902fc=_0xadb5[_0x2043e6];return _0x9902fc;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x413672,_0x4fdf10){var _0x5f134b=function(_0x3f9985){while(--_0x3f9985){_0x413672['push'](_0x413672['shift']());}};_0x5f134b(++_0x4fdf10);}(_0xdb28,0x106));var _0x8db2=function(_0x20c347,_0x2af807){_0x20c347=_0x20c347-0x0;var _0x582d2e=_0xdb28[_0x20c347];return _0x582d2e;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index ab35b6b..d4f9305 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 _0x62f3=['statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','email','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end'];(function(_0x462d27,_0x5e6442){var _0x29aa39=function(_0x1318d5){while(--_0x1318d5){_0x462d27['push'](_0x462d27['shift']());}};_0x29aa39(++_0x5e6442);}(_0x62f3,0x18f));var _0x362f=function(_0x3fd6c4,_0x579bbe){_0x3fd6c4=_0x3fd6c4-0x0;var _0x537b5c=_0x62f3[_0x3fd6c4];return _0x537b5c;};'use strict';var BPromise=require(_0x362f('0x0'));var https=require(_0x362f('0x1'));var logger=require(_0x362f('0x2'))(_0x362f('0x3'));var USERNAME='support';var PASSWORD=_0x362f('0x4');function openIssue(_0x3dfa33,_0x5acd93){var _0x25b1c4={'fields':{'project':{'key':_0x3dfa33[_0x362f('0x5')]||_0x362f('0x6')},'summary':(_0x3dfa33[_0x362f('0x7')]||_0x362f('0x8'))+_0x362f('0x9')+_0x3dfa33['ip'],'description':_0x3dfa33[_0x362f('0xa')]||JSON[_0x362f('0xb')](_0x3dfa33),'issuetype':{'name':_0x3dfa33['issuetype']||_0x362f('0xc')}}};_0x25b1c4['fields']['customfield_11500']=_0x3dfa33[_0x362f('0xd')];_0x25b1c4[_0x362f('0xe')]['customfield_11501']=_0x3dfa33['oldToken'];_0x25b1c4[_0x362f('0xe')][_0x362f('0xf')]=_0x3dfa33[_0x362f('0x10')];_0x25b1c4[_0x362f('0xe')][_0x362f('0x11')]=_0x3dfa33[_0x362f('0x12')];_0x25b1c4['fields'][_0x362f('0x13')]=_0x3dfa33['reason'];_0x25b1c4[_0x362f('0xe')][_0x362f('0x14')]=_0x3dfa33['ip'];var _0x3aabd9={'host':_0x362f('0x15'),'port':0x1bb,'path':_0x362f('0x16'),'method':_0x362f('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x362f('0x18'),'Authorization':_0x362f('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x362f('0x1a')](_0x362f('0x1b'))}};var _0x576414=JSON[_0x362f('0xb')](_0x25b1c4);var _0x474fda=https[_0x362f('0x1c')](_0x3aabd9,function(_0x3d2b8d){_0x3d2b8d[_0x362f('0x1d')](_0x362f('0x1e'));var _0x545af6='';_0x3d2b8d['on'](_0x362f('0x1f'),function(_0x1f67e1){_0x545af6+=_0x1f67e1;});_0x3d2b8d['on'](_0x362f('0x20'),function(){if(_0x5acd93){return _0x5acd93['status'](_0x3d2b8d[_0x362f('0x21')])[_0x362f('0x22')](JSON[_0x362f('0x23')](_0x545af6));}});});_0x474fda['on'](_0x362f('0x24'),function(_0x3bfb1d){if(_0x5acd93){return _0x5acd93[_0x362f('0x25')](0x1f4)[_0x362f('0x22')]({'errors':[{'message':_0x362f('0x26'),'type':_0x362f('0x27')}]});}});_0x474fda[_0x362f('0x28')](_0x576414);_0x474fda[_0x362f('0x20')]();}exports[_0x362f('0x29')]=openIssue;exports[_0x362f('0x2a')]=function(_0x14518e,_0x5289c0){_0x14518e['body']['ip']=_0x14518e[_0x362f('0x2b')]['x-forwarded-for']||_0x14518e[_0x362f('0x2c')]['remoteAddress']||_0x14518e['socket'][_0x362f('0x2d')]||_0x14518e[_0x362f('0x2c')][_0x362f('0x2e')][_0x362f('0x2d')];return openIssue(_0x14518e[_0x362f('0x2f')],_0x5289c0);}; \ No newline at end of file +var _0xe9a0=['data','status','statusCode','json','parse','error','api.jira','openIssue','send','body','headers','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','Report','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','base64','request','utf8'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0xe9a0,0x15e));var _0x0e9a=function(_0x1bcb3e,_0x3bad2b){_0x1bcb3e=_0x1bcb3e-0x0;var _0x421b1b=_0xe9a0[_0x1bcb3e];return _0x421b1b;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x0e9a('0x0'))(_0x0e9a('0x1'));var USERNAME=_0x0e9a('0x2');var PASSWORD=_0x0e9a('0x3');function openIssue(_0x26136a,_0x49f378){var _0x57e4ef={'fields':{'project':{'key':_0x26136a['key']||_0x0e9a('0x4')},'summary':(_0x26136a['summary']||_0x0e9a('0x5'))+'\x20from\x20'+_0x26136a['ip'],'description':_0x26136a[_0x0e9a('0x6')]||JSON[_0x0e9a('0x7')](_0x26136a),'issuetype':{'name':_0x26136a['issuetype']||_0x0e9a('0x8')}}};_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0xa')]=_0x26136a[_0x0e9a('0xb')];_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0xc')]=_0x26136a[_0x0e9a('0xd')];_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0xe')]=_0x26136a[_0x0e9a('0xf')];_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0x10')]=_0x26136a[_0x0e9a('0x11')];_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0x12')]=_0x26136a[_0x0e9a('0x13')];_0x57e4ef[_0x0e9a('0x9')][_0x0e9a('0x14')]=_0x26136a['ip'];var _0x5c86ca={'host':_0x0e9a('0x15'),'port':0x1bb,'path':_0x0e9a('0x16'),'method':_0x0e9a('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x0e9a('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x0e9a('0x19'))}};var _0x29a4b2=JSON[_0x0e9a('0x7')](_0x57e4ef);var _0x31b93f=https[_0x0e9a('0x1a')](_0x5c86ca,function(_0x3bf842){_0x3bf842['setEncoding'](_0x0e9a('0x1b'));var _0x466594='';_0x3bf842['on'](_0x0e9a('0x1c'),function(_0x3d26ee){_0x466594+=_0x3d26ee;});_0x3bf842['on']('end',function(){if(_0x49f378){return _0x49f378[_0x0e9a('0x1d')](_0x3bf842[_0x0e9a('0x1e')])[_0x0e9a('0x1f')](JSON[_0x0e9a('0x20')](_0x466594));}});});_0x31b93f['on'](_0x0e9a('0x21'),function(_0x14dddb){if(_0x49f378){return _0x49f378[_0x0e9a('0x1d')](0x1f4)[_0x0e9a('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0e9a('0x22')}]});}});_0x31b93f['write'](_0x29a4b2);_0x31b93f['end']();}exports[_0x0e9a('0x23')]=openIssue;exports[_0x0e9a('0x24')]=function(_0x4c0813,_0x504f46){_0x4c0813[_0x0e9a('0x25')]['ip']=_0x4c0813[_0x0e9a('0x26')]['x-forwarded-for']||_0x4c0813[_0x0e9a('0x27')][_0x0e9a('0x28')]||_0x4c0813[_0x0e9a('0x29')][_0x0e9a('0x28')]||_0x4c0813[_0x0e9a('0x27')]['socket'][_0x0e9a('0x28')];return openIssue(_0x4c0813['body'],_0x504f46);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 2811455..94e12fb 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x2750,0x13b));var _0x0275=function(_0x344a66,_0x48f900){_0x344a66=_0x344a66-0x0;var _0x24b10d=_0x2750[_0x344a66];return _0x24b10d;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x59a1f4,_0x113a80){var _0x1a62ce=function(_0x104e3a){while(--_0x104e3a){_0x59a1f4['push'](_0x59a1f4['shift']());}};_0x1a62ce(++_0x113a80);}(_0x0bb5,0x148));var _0x50bb=function(_0x4e6733,_0x17ef34){_0x4e6733=_0x4e6733-0x0;var _0x2d58da=_0x0bb5[_0x4e6733];return _0x2d58da;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 035afcd..6f4fa92 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x4b408b,_0x2b7c54){_0x4b408b=_0x4b408b-0x0;var _0x1fcec3=_0x7a54[_0x4b408b];return _0x1fcec3;};'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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a54,0x106));var _0x47a5=function(_0x62a383,_0x21f4ad){_0x62a383=_0x62a383-0x0;var _0x44c1b9=_0x7a54[_0x62a383];return _0x44c1b9;};'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 19f0734..28e38c9 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 _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0x896273,_0x4baa69){var _0x103198=function(_0x16f943){while(--_0x16f943){_0x896273['push'](_0x896273['shift']());}};_0x103198(++_0x4baa69);}(_0xee14,0x13a));var _0x4ee1=function(_0x497b22,_0x5cb18b){_0x497b22=_0x497b22-0x0;var _0x40bcf0=_0xee14[_0x497b22];return _0x40bcf0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['JscriptyAnswerReport'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['JscriptyAnswerReport'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['JscriptyAnswerReport'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));}; \ No newline at end of file +var _0xae1c=['send','index','map','JscriptyAnswerReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xae1c,0xff));var _0xcae1=function(_0x221d84,_0x2eeb9d){_0x221d84=_0x221d84-0x0;var _0x325f9e=_0xae1c[_0x221d84];return _0x325f9e;};'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(_0xcae1('0x0'));var moment=require(_0xcae1('0x1'));var BPromise=require(_0xcae1('0x2'));var Mustache=require(_0xcae1('0x3'));var util=require(_0xcae1('0x4'));var path=require(_0xcae1('0x5'));var sox=require(_0xcae1('0x6'));var csv=require(_0xcae1('0x7'));var ejs=require(_0xcae1('0x8'));var fs=require('fs');var fs_extra=require(_0xcae1('0x9'));var _=require(_0xcae1('0xa'));var squel=require(_0xcae1('0xb'));var crypto=require(_0xcae1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcae1('0x7'));var querystring=require(_0xcae1('0xd'));var Papa=require(_0xcae1('0xe'));var Redis=require('ioredis');var authService=require(_0xcae1('0xf'));var qs=require(_0xcae1('0x10'));var as=require(_0xcae1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcae1('0x12'))(_0xcae1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcae1('0x14'));var db=require(_0xcae1('0x15'))['db'];function respondWithStatusCode(_0x340bdc,_0x27cbd9){_0x27cbd9=_0x27cbd9||0xcc;return function(_0x41d7bb){if(_0x41d7bb){return _0x340bdc[_0xcae1('0x16')](_0x27cbd9);}return _0x340bdc[_0xcae1('0x17')](_0x27cbd9)[_0xcae1('0x18')]();};}function respondWithResult(_0x41fd7a,_0x277c6d){_0x277c6d=_0x277c6d||0xc8;return function(_0x13ad2c){if(_0x13ad2c){return _0x41fd7a[_0xcae1('0x17')](_0x277c6d)[_0xcae1('0x19')](_0x13ad2c);}};}function respondWithFilteredResult(_0x12d6cb,_0x2ac1ea){return function(_0x54ab10){if(_0x54ab10){var _0x4743b4=typeof _0x2ac1ea[_0xcae1('0x1a')]==='undefined'&&typeof _0x2ac1ea['limit']===_0xcae1('0x1b');var _0x143c21=_0x54ab10['count'];var _0x5f18d5=_0x4743b4?0x0:_0x2ac1ea[_0xcae1('0x1a')];var _0x4dcd4b=_0x4743b4?_0x54ab10[_0xcae1('0x1c')]:_0x2ac1ea[_0xcae1('0x1a')]+_0x2ac1ea[_0xcae1('0x1d')];var _0x14cd02;if(_0x4dcd4b>=_0x143c21){_0x4dcd4b=_0x143c21;_0x14cd02=0xc8;}else{_0x14cd02=0xce;}_0x12d6cb[_0xcae1('0x17')](_0x14cd02);return _0x12d6cb[_0xcae1('0x1e')](_0xcae1('0x1f'),_0x5f18d5+'-'+_0x4dcd4b+'/'+_0x143c21)[_0xcae1('0x19')](_0x54ab10);}return null;};}function patchUpdates(_0x11fda8){return function(_0x33e1af){try{jsonpatch[_0xcae1('0x20')](_0x33e1af,_0x11fda8,!![]);}catch(_0x401659){return BPromise[_0xcae1('0x21')](_0x401659);}return _0x33e1af[_0xcae1('0x22')]();};}function saveUpdates(_0x480365,_0x1f8beb){return function(_0x17f9f4){if(_0x17f9f4){return _0x17f9f4[_0xcae1('0x23')](_0x480365)[_0xcae1('0x24')](function(_0x514501){return _0x514501;});}return null;};}function removeEntity(_0x137a21,_0x2227e4){return function(_0x737966){if(_0x737966){return _0x737966[_0xcae1('0x25')]()[_0xcae1('0x24')](function(){_0x137a21[_0xcae1('0x17')](0xcc)[_0xcae1('0x18')]();});}};}function handleEntityNotFound(_0x9fac02,_0x556f45){return function(_0x285b9a){if(!_0x285b9a){_0x9fac02['sendStatus'](0x194);}return _0x285b9a;};}function handleError(_0x22710b,_0x300758){_0x300758=_0x300758||0x1f4;return function(_0x5bb602){logger[_0xcae1('0x26')](_0x5bb602[_0xcae1('0x27')]);if(_0x5bb602[_0xcae1('0x28')]){delete _0x5bb602['name'];}_0x22710b['status'](_0x300758)[_0xcae1('0x29')](_0x5bb602);};}exports[_0xcae1('0x2a')]=function(_0xbba4eb,_0x3be989){var _0x38b76d={},_0x2348df={},_0x3e7b1d={'count':0x0,'rows':[]};var _0x4ed7d8=_[_0xcae1('0x2b')](db[_0xcae1('0x2c')][_0xcae1('0x2d')],function(_0x5defb0){return{'name':_0x5defb0['fieldName'],'type':_0x5defb0[_0xcae1('0x2e')]['key']};});_0x2348df[_0xcae1('0x2f')]=_[_0xcae1('0x2b')](_0x4ed7d8,_0xcae1('0x28'));_0x2348df[_0xcae1('0x30')]=_[_0xcae1('0x31')](_0xbba4eb[_0xcae1('0x30')]);_0x2348df[_0xcae1('0x32')]=_[_0xcae1('0x33')](_0x2348df[_0xcae1('0x2f')],_0x2348df[_0xcae1('0x30')]);_0x38b76d['attributes']=_[_0xcae1('0x33')](_0x2348df[_0xcae1('0x2f')],qs[_0xcae1('0x34')](_0xbba4eb[_0xcae1('0x30')]['fields']));_0x38b76d[_0xcae1('0x35')]=_0x38b76d['attributes'][_0xcae1('0x36')]?_0x38b76d['attributes']:_0x2348df[_0xcae1('0x2f')];if(!_0xbba4eb[_0xcae1('0x30')][_0xcae1('0x37')](_0xcae1('0x38'))){_0x38b76d[_0xcae1('0x1d')]=qs[_0xcae1('0x1d')](_0xbba4eb[_0xcae1('0x30')][_0xcae1('0x1d')]);_0x38b76d[_0xcae1('0x1a')]=qs[_0xcae1('0x1a')](_0xbba4eb['query'][_0xcae1('0x1a')]);}_0x38b76d['order']=qs[_0xcae1('0x39')](_0xbba4eb['query'][_0xcae1('0x39')]);_0x38b76d[_0xcae1('0x3a')]=qs['filters'](_[_0xcae1('0x3b')](_0xbba4eb[_0xcae1('0x30')],_0x2348df[_0xcae1('0x32')]),_0x4ed7d8);if(_0xbba4eb[_0xcae1('0x30')]['filter']){_0x38b76d[_0xcae1('0x3a')]=_[_0xcae1('0x3c')](_0x38b76d['where'],{'$or':_[_0xcae1('0x2b')](_0x4ed7d8,function(_0xb5e255){if(_0xb5e255[_0xcae1('0x2e')]!=='VIRTUAL'){var _0x16295b={};_0x16295b[_0xb5e255['name']]={'$like':'%'+_0xbba4eb[_0xcae1('0x30')][_0xcae1('0x3d')]+'%'};return _0x16295b;}})});}_0x38b76d=_[_0xcae1('0x3c')]({},_0x38b76d,_0xbba4eb['options']);var _0xcd95de={'where':_0x38b76d[_0xcae1('0x3a')]};return db[_0xcae1('0x2c')][_0xcae1('0x1c')](_0xcd95de)[_0xcae1('0x24')](function(_0x237201){_0x3e7b1d['count']=_0x237201;if(_0xbba4eb[_0xcae1('0x30')][_0xcae1('0x3e')]){_0x38b76d[_0xcae1('0x3f')]=[{'all':!![]}];}return db[_0xcae1('0x2c')][_0xcae1('0x40')](_0x38b76d);})[_0xcae1('0x24')](function(_0x349a18){_0x3e7b1d[_0xcae1('0x41')]=_0x349a18;return _0x3e7b1d;})[_0xcae1('0x24')](respondWithFilteredResult(_0x3be989,_0x38b76d))[_0xcae1('0x42')](handleError(_0x3be989,null));};exports[_0xcae1('0x43')]=function(_0x47b77e,_0x296d31){var _0x2f6d1b={'raw':!![],'where':{'id':_0x47b77e[_0xcae1('0x44')]['id']}},_0x1df5f0={};_0x1df5f0[_0xcae1('0x2f')]=_[_0xcae1('0x31')](db[_0xcae1('0x2c')]['rawAttributes']);_0x1df5f0[_0xcae1('0x30')]=_[_0xcae1('0x31')](_0x47b77e[_0xcae1('0x30')]);_0x1df5f0[_0xcae1('0x32')]=_['intersection'](_0x1df5f0['model'],_0x1df5f0['query']);_0x2f6d1b[_0xcae1('0x35')]=_[_0xcae1('0x33')](_0x1df5f0[_0xcae1('0x2f')],qs[_0xcae1('0x34')](_0x47b77e[_0xcae1('0x30')][_0xcae1('0x34')]));_0x2f6d1b['attributes']=_0x2f6d1b[_0xcae1('0x35')][_0xcae1('0x36')]?_0x2f6d1b['attributes']:_0x1df5f0[_0xcae1('0x2f')];if(_0x47b77e[_0xcae1('0x30')][_0xcae1('0x3e')]){_0x2f6d1b['include']=[{'all':!![]}];}_0x2f6d1b=_['merge']({},_0x2f6d1b,_0x47b77e[_0xcae1('0x45')]);return db[_0xcae1('0x2c')][_0xcae1('0x46')](_0x2f6d1b)[_0xcae1('0x24')](handleEntityNotFound(_0x296d31,null))[_0xcae1('0x24')](respondWithResult(_0x296d31,null))[_0xcae1('0x42')](handleError(_0x296d31,null));};exports[_0xcae1('0x47')]=function(_0x168c0f,_0x417f9f){return db[_0xcae1('0x2c')][_0xcae1('0x47')](_0x168c0f[_0xcae1('0x48')],{})['then'](respondWithResult(_0x417f9f,0xc9))[_0xcae1('0x42')](handleError(_0x417f9f,null));};exports[_0xcae1('0x23')]=function(_0x3bf8b0,_0x258630){if(_0x3bf8b0[_0xcae1('0x48')]['id']){delete _0x3bf8b0[_0xcae1('0x48')]['id'];}return db[_0xcae1('0x2c')][_0xcae1('0x46')]({'where':{'id':_0x3bf8b0[_0xcae1('0x44')]['id']}})[_0xcae1('0x24')](handleEntityNotFound(_0x258630,null))[_0xcae1('0x24')](saveUpdates(_0x3bf8b0[_0xcae1('0x48')],null))['then'](respondWithResult(_0x258630,null))[_0xcae1('0x42')](handleError(_0x258630,null));};exports[_0xcae1('0x25')]=function(_0x3a203f,_0x58c63c){return db[_0xcae1('0x2c')][_0xcae1('0x46')]({'where':{'id':_0x3a203f[_0xcae1('0x44')]['id']}})[_0xcae1('0x24')](handleEntityNotFound(_0x58c63c,null))['then'](removeEntity(_0x58c63c,null))[_0xcae1('0x42')](handleError(_0x58c63c,null));};exports[_0xcae1('0x49')]=function(_0x1b40b9,_0x4b195a){return db[_0xcae1('0x2c')][_0xcae1('0x49')]()[_0xcae1('0x24')](respondWithResult(_0x4b195a,null))['catch'](handleError(_0x4b195a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 15098d6..00e3bdb 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 _0x1c94=['define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x19f5de,_0x27ef9a){var _0x5a97a8=function(_0x536b58){while(--_0x536b58){_0x19f5de['push'](_0x19f5de['shift']());}};_0x5a97a8(++_0x27ef9a);}(_0x1c94,0x1d6));var _0x41c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c94[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41c9('0x0'));var util=require(_0x41c9('0x1'));var logger=require(_0x41c9('0x2'))(_0x41c9('0x3'));var moment=require(_0x41c9('0x4'));var BPromise=require(_0x41c9('0x5'));var rp=require(_0x41c9('0x6'));var fs=require('fs');var path=require(_0x41c9('0x7'));var rimraf=require('rimraf');var config=require(_0x41c9('0x8'));var attributes=require(_0x41c9('0x9'));module[_0x41c9('0xa')]=function(_0x771ffe,_0x13f345){return _0x771ffe[_0x41c9('0xb')](_0x41c9('0xc'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5295=['./jscriptyAnswerReport.attributes','exports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5295,0x9b));var _0x5529=function(_0x21dace,_0x260fd6){_0x21dace=_0x21dace-0x0;var _0x59cf28=_0x5295[_0x21dace];return _0x59cf28;};'use strict';var _=require(_0x5529('0x0'));var util=require('util');var logger=require(_0x5529('0x1'))(_0x5529('0x2'));var moment=require('moment');var BPromise=require(_0x5529('0x3'));var rp=require(_0x5529('0x4'));var fs=require('fs');var path=require(_0x5529('0x5'));var rimraf=require(_0x5529('0x6'));var config=require('../../config/environment');var attributes=require(_0x5529('0x7'));module[_0x5529('0x8')]=function(_0x24f94c,_0x1217a4){return _0x24f94c['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 092cdc7..5ea0226 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 _0x1767=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3d8b34,_0x48ed2b){var _0x46a32c=function(_0x420a88){while(--_0x420a88){_0x3d8b34['push'](_0x3d8b34['shift']());}};_0x46a32c(++_0x48ed2b);}(_0x1767,0x98));var _0x7176=function(_0x4774f4,_0xfad33f){_0x4774f4=_0x4774f4-0x0;var _0x24ad4f=_0x1767[_0x4774f4];return _0x24ad4f;};'use strict';var _=require(_0x7176('0x0'));var util=require(_0x7176('0x1'));var moment=require(_0x7176('0x2'));var BPromise=require(_0x7176('0x3'));var rs=require(_0x7176('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7176('0x5'))['db'];var utils=require(_0x7176('0x6'));var logger=require(_0x7176('0x7'))(_0x7176('0x8'));var config=require(_0x7176('0x9'));var jayson=require(_0x7176('0xa'));var client=jayson[_0x7176('0xb')][_0x7176('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a0884,_0x5e30c4,_0x16af96){return new BPromise(function(_0xed75a4,_0x10a153){return client[_0x7176('0xd')](_0x1a0884,_0x16af96)[_0x7176('0xe')](function(_0x235db0){logger[_0x7176('0xf')](_0x7176('0x10'),_0x5e30c4,_0x7176('0x11'));logger[_0x7176('0x12')](_0x7176('0x13'),_0x5e30c4,_0x7176('0x11'),JSON[_0x7176('0x14')](_0x235db0));if(_0x235db0[_0x7176('0x15')]){if(_0x235db0['error']['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5e30c4,_0x235db0[_0x7176('0x15')]['message']);return _0x10a153(_0x235db0[_0x7176('0x15')][_0x7176('0x16')]);}logger['error'](_0x7176('0x10'),_0x5e30c4,_0x235db0['error'][_0x7176('0x16')]);return _0xed75a4(_0x235db0[_0x7176('0x15')][_0x7176('0x16')]);}else{logger[_0x7176('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5e30c4,_0x7176('0x11'));_0xed75a4(_0x235db0[_0x7176('0x17')][_0x7176('0x16')]);}})['catch'](function(_0x411b1b){logger[_0x7176('0x15')](_0x7176('0x10'),_0x5e30c4,_0x411b1b);_0x10a153(_0x411b1b);});});} \ No newline at end of file +var _0x34b7=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x41dd12,_0x2ccdcb){var _0x19e94c=function(_0x318b15){while(--_0x318b15){_0x41dd12['push'](_0x41dd12['shift']());}};_0x19e94c(++_0x2ccdcb);}(_0x34b7,0x19c));var _0x734b=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x34b7[_0xd29c88];return _0x375635;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x734b('0x1'));var db=require(_0x734b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x734b('0x3'))(_0x734b('0x4'));var config=require('../../config/environment');var jayson=require(_0x734b('0x5'));var client=jayson[_0x734b('0x6')][_0x734b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d245c,_0x16307b,_0x1a3fea){return new BPromise(function(_0x422fbd,_0x423174){return client[_0x734b('0x8')](_0x4d245c,_0x1a3fea)[_0x734b('0x9')](function(_0x39a655){logger[_0x734b('0xa')](_0x734b('0xb'),_0x16307b,_0x734b('0xc'));logger[_0x734b('0xd')](_0x734b('0xe'),_0x16307b,_0x734b('0xc'),JSON['stringify'](_0x39a655));if(_0x39a655['error']){if(_0x39a655[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger['error'](_0x734b('0xb'),_0x16307b,_0x39a655[_0x734b('0xf')][_0x734b('0x11')]);return _0x423174(_0x39a655[_0x734b('0xf')][_0x734b('0x11')]);}logger[_0x734b('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x16307b,_0x39a655[_0x734b('0xf')][_0x734b('0x11')]);return _0x422fbd(_0x39a655['error']['message']);}else{logger['info'](_0x734b('0xb'),_0x16307b,_0x734b('0xc'));_0x422fbd(_0x39a655[_0x734b('0x12')][_0x734b('0x11')]);}})['catch'](function(_0x422baf){logger[_0x734b('0xf')](_0x734b('0xb'),_0x16307b,_0x422baf);_0x423174(_0x422baf);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index df2f420..fe7427e 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 _0x08f2=['30s','post','create','/:id/clone','put','update','delete','destroy','exports','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers'];(function(_0x5624db,_0x5be3fb){var _0x1a69c4=function(_0x61b7ee){while(--_0x61b7ee){_0x5624db['push'](_0x5624db['shift']());}};_0x1a69c4(++_0x5be3fb);}(_0x08f2,0x1d5));var _0x208f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x08f2[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x208f('0x0'));var timeout=require('connect-timeout');var express=require(_0x208f('0x1'));var router=express[_0x208f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x208f('0x3'));var config=require(_0x208f('0x4'));var controller=require(_0x208f('0x5'));router[_0x208f('0x6')]('/',auth[_0x208f('0x7')](),controller[_0x208f('0x8')]);router['get'](_0x208f('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x208f('0xa'),auth[_0x208f('0x7')](),controller[_0x208f('0xb')]);router[_0x208f('0x6')](_0x208f('0xc'),auth['isAuthenticated'](),controller[_0x208f('0xd')]);router[_0x208f('0x6')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x208f('0xe')),controller['getSummary']);router[_0x208f('0xf')]('/',auth['isAuthenticated'](),controller[_0x208f('0x10')]);router[_0x208f('0xf')](_0x208f('0x11'),auth[_0x208f('0x7')](),controller['clone']);router[_0x208f('0x12')](_0x208f('0x9'),auth['isAuthenticated'](),controller[_0x208f('0x13')]);router[_0x208f('0x14')](_0x208f('0x9'),auth[_0x208f('0x7')](),controller[_0x208f('0x15')]);module[_0x208f('0x16')]=router; \ No newline at end of file +var _0x3101=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2af710,_0x3590de){var _0x5ad56d=function(_0x50e513){while(--_0x50e513){_0x2af710['push'](_0x2af710['shift']());}};_0x5ad56d(++_0x3590de);}(_0x3101,0x183));var _0x1310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3101[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1310('0x0'));var util=require(_0x1310('0x1'));var path=require(_0x1310('0x2'));var timeout=require(_0x1310('0x3'));var express=require(_0x1310('0x4'));var router=express[_0x1310('0x5')]();var fs_extra=require(_0x1310('0x6'));var auth=require(_0x1310('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x1310('0x8')]('/',auth[_0x1310('0x9')](),controller['index']);router[_0x1310('0x8')](_0x1310('0xa'),auth[_0x1310('0x9')](),controller['show']);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0x1310('0xb')]);router[_0x1310('0x8')](_0x1310('0xc'),auth['isAuthenticated'](),controller[_0x1310('0xd')]);router[_0x1310('0x8')](_0x1310('0xe'),auth[_0x1310('0x9')](),timeout(_0x1310('0xf')),controller[_0x1310('0x10')]);router[_0x1310('0x11')]('/',auth[_0x1310('0x9')](),controller['create']);router[_0x1310('0x11')](_0x1310('0x12'),auth[_0x1310('0x9')](),controller[_0x1310('0x13')]);router['put'](_0x1310('0xa'),auth[_0x1310('0x9')](),controller[_0x1310('0x14')]);router['delete'](_0x1310('0xa'),auth[_0x1310('0x9')](),controller[_0x1310('0x15')]);module[_0x1310('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 512a67b..fe06591 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 _0x37f0=['STRING','name','TEXT','isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x37f0,0x129));var _0x037f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x37f0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');var _=require(_0x037f('0x0'));var util=require(_0x037f('0x1'));module['exports']={'name':{'type':Sequelize[_0x037f('0x2')],'unique':_0x037f('0x3')},'description':{'type':Sequelize[_0x037f('0x2')]},'formData':{'type':Sequelize[_0x037f('0x4')]('long'),'set':function(_0x513257){if(_[_0x037f('0x5')](_0x513257)){this[_0x037f('0x6')](_0x037f('0x7'),JSON['stringify'](_0x513257));}else if(_['isString'](_0x513257)){this[_0x037f('0x6')]('formData',_0x513257);}else{this['setDataValue'](_0x037f('0x7'),util[_0x037f('0x8')](_0x037f('0x9'),this[_0x037f('0xa')](_0x037f('0x3'))||'',this[_0x037f('0xa')](_0x037f('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x037f('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5a75=['isObjectLike','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','BOOLEAN','sequelize','lodash','util','exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a75,0x13e));var _0x55a7=function(_0xb7cb72,_0x19d391){_0xb7cb72=_0xb7cb72-0x0;var _0x4b7570=_0x5a75[_0xb7cb72];return _0x4b7570;};'use strict';var Sequelize=require(_0x55a7('0x0'));var _=require(_0x55a7('0x1'));var util=require(_0x55a7('0x2'));module[_0x55a7('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x55a7('0x4')},'description':{'type':Sequelize[_0x55a7('0x5')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x1bf72a){if(_[_0x55a7('0x6')](_0x1bf72a)){this['setDataValue'](_0x55a7('0x7'),JSON[_0x55a7('0x8')](_0x1bf72a));}else if(_['isString'](_0x1bf72a)){this['setDataValue'](_0x55a7('0x7'),_0x1bf72a);}else{this['setDataValue']('formData',util[_0x55a7('0x9')](_0x55a7('0xa'),this['getDataValue'](_0x55a7('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x55a7('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x55a7('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d0c802a..a5ef8f6 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 _0x2c1b=['params','intersection','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','clone','createdAt','updatedAt','body','role','autoAssociation','error','getSessions','findOne','nolimit','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','update','then','destroy','Projects','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x2c1b[_0x4ae829];return _0x256b31;};'use strict';var emlformat=require(_0xb2c1('0x0'));var rimraf=require(_0xb2c1('0x1'));var zipdir=require(_0xb2c1('0x2'));var jsonpatch=require(_0xb2c1('0x3'));var rp=require(_0xb2c1('0x4'));var moment=require(_0xb2c1('0x5'));var BPromise=require(_0xb2c1('0x6'));var Mustache=require('mustache');var util=require(_0xb2c1('0x7'));var path=require(_0xb2c1('0x8'));var sox=require(_0xb2c1('0x9'));var csv=require(_0xb2c1('0xa'));var ejs=require(_0xb2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xb2c1('0xc'));var _=require(_0xb2c1('0xd'));var squel=require(_0xb2c1('0xe'));var crypto=require(_0xb2c1('0xf'));var jsforce=require(_0xb2c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2c1('0x11'));var Papa=require(_0xb2c1('0x12'));var Redis=require(_0xb2c1('0x13'));var authService=require(_0xb2c1('0x14'));var qs=require(_0xb2c1('0x15'));var as=require(_0xb2c1('0x16'));var hardwareService=require(_0xb2c1('0x17'));var logger=require(_0xb2c1('0x18'))('api');var utils=require(_0xb2c1('0x19'));var config=require(_0xb2c1('0x1a'));var licenseUtil=require(_0xb2c1('0x1b'));var db=require(_0xb2c1('0x1c'))['db'];function respondWithStatusCode(_0x218998,_0x4cc09b){_0x4cc09b=_0x4cc09b||0xcc;return function(_0x404159){if(_0x404159){return _0x218998[_0xb2c1('0x1d')](_0x4cc09b);}return _0x218998[_0xb2c1('0x1e')](_0x4cc09b)['end']();};}function respondWithResult(_0x3c4313,_0x4470e5){_0x4470e5=_0x4470e5||0xc8;return function(_0x22a2b3){if(_0x22a2b3){return _0x3c4313[_0xb2c1('0x1e')](_0x4470e5)[_0xb2c1('0x1f')](_0x22a2b3);}};}function respondWithFilteredResult(_0x47571f,_0x2b4d8f){return function(_0x46d620){if(_0x46d620){var _0x1e26f3=typeof _0x2b4d8f['offset']===_0xb2c1('0x20')&&typeof _0x2b4d8f['limit']==='undefined';var _0x59268e=_0x46d620['count'];var _0x486411=_0x1e26f3?0x0:_0x2b4d8f[_0xb2c1('0x21')];var _0x16c1ed=_0x1e26f3?_0x46d620[_0xb2c1('0x22')]:_0x2b4d8f[_0xb2c1('0x21')]+_0x2b4d8f[_0xb2c1('0x23')];var _0x165875;if(_0x16c1ed>=_0x59268e){_0x16c1ed=_0x59268e;_0x165875=0xc8;}else{_0x165875=0xce;}_0x47571f[_0xb2c1('0x1e')](_0x165875);return _0x47571f[_0xb2c1('0x24')]('Content-Range',_0x486411+'-'+_0x16c1ed+'/'+_0x59268e)[_0xb2c1('0x1f')](_0x46d620);}return null;};}function patchUpdates(_0x42f519){return function(_0x2af0fa){try{jsonpatch[_0xb2c1('0x25')](_0x2af0fa,_0x42f519,!![]);}catch(_0x49d87c){return BPromise[_0xb2c1('0x26')](_0x49d87c);}return _0x2af0fa['save']();};}function saveUpdates(_0x27d5bf,_0x31ae39){return function(_0x2f6c51){if(_0x2f6c51){return _0x2f6c51[_0xb2c1('0x27')](_0x27d5bf)[_0xb2c1('0x28')](function(_0x270fb2){return _0x270fb2;});}return null;};}function removeEntity(_0x4af0bd,_0xc3f671){return function(_0x40dac3){if(_0x40dac3){return _0x40dac3[_0xb2c1('0x29')]()[_0xb2c1('0x28')](function(){var _0x1cdadf=_0x40dac3['get']({'plain':!![]});var _0x48f58c=_0xb2c1('0x2a');return db['UserProfileResource'][_0xb2c1('0x29')]({'where':{'type':_0x48f58c,'resourceId':_0x1cdadf['id']}})['then'](function(){return _0x40dac3;});})[_0xb2c1('0x28')](function(){_0x4af0bd[_0xb2c1('0x1e')](0xcc)[_0xb2c1('0x2b')]();});}};}function handleEntityNotFound(_0x17153b,_0x306b17){return function(_0x1b459c){if(!_0x1b459c){_0x17153b[_0xb2c1('0x1d')](0x194);}return _0x1b459c;};}function handleError(_0x5e9108,_0x5b7808){_0x5b7808=_0x5b7808||0x1f4;return function(_0x2d9a64){logger['error'](_0x2d9a64[_0xb2c1('0x2c')]);if(_0x2d9a64[_0xb2c1('0x2d')]){delete _0x2d9a64['name'];}_0x5e9108[_0xb2c1('0x1e')](_0x5b7808)[_0xb2c1('0x2e')](_0x2d9a64);};}exports[_0xb2c1('0x2f')]=function(_0x28c136,_0x1cac02){var _0x1feb6a={},_0x5a71ab={},_0x3b9d67={'count':0x0,'rows':[]};var _0x145e94=_[_0xb2c1('0x30')](db[_0xb2c1('0x31')][_0xb2c1('0x32')],function(_0x445372){return{'name':_0x445372[_0xb2c1('0x33')],'type':_0x445372[_0xb2c1('0x34')][_0xb2c1('0x35')]};});_0x5a71ab[_0xb2c1('0x36')]=_[_0xb2c1('0x30')](_0x145e94,_0xb2c1('0x2d'));_0x5a71ab['query']=_[_0xb2c1('0x37')](_0x28c136[_0xb2c1('0x38')]);_0x5a71ab[_0xb2c1('0x39')]=_['intersection'](_0x5a71ab[_0xb2c1('0x36')],_0x5a71ab[_0xb2c1('0x38')]);_0x1feb6a[_0xb2c1('0x3a')]=_['intersection'](_0x5a71ab[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0x1feb6a[_0xb2c1('0x3a')]=_0x1feb6a['attributes'][_0xb2c1('0x3c')]?_0x1feb6a[_0xb2c1('0x3a')]:_0x5a71ab['model'];if(!_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3d')]('nolimit')){_0x1feb6a[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0x1feb6a['offset']=qs[_0xb2c1('0x21')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0x1feb6a[_0xb2c1('0x3e')]=qs['sort'](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0x1feb6a[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x28c136['query'],_0x5a71ab[_0xb2c1('0x39')]),_0x145e94);if(_0x28c136['query'][_0xb2c1('0x42')]){_0x1feb6a[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x1feb6a[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x145e94,function(_0x24dcbc){if(_0x24dcbc['type']!==_0xb2c1('0x44')){var _0x59288c={};_0x59288c[_0x24dcbc[_0xb2c1('0x2d')]]={'$like':'%'+_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x59288c;}})});}_0x1feb6a=_[_0xb2c1('0x43')]({},_0x1feb6a,_0x28c136[_0xb2c1('0x45')]);var _0x44e15e={'where':_0x1feb6a[_0xb2c1('0x40')]};return db[_0xb2c1('0x31')][_0xb2c1('0x22')](_0x44e15e)[_0xb2c1('0x28')](function(_0x305d17){_0x3b9d67[_0xb2c1('0x22')]=_0x305d17;if(_0x28c136['query'][_0xb2c1('0x46')]){_0x1feb6a[_0xb2c1('0x47')]=[{'all':!![]}];}return db['JscriptyProject'][_0xb2c1('0x48')](_0x1feb6a);})[_0xb2c1('0x28')](function(_0x2e546e){_0x3b9d67[_0xb2c1('0x49')]=_0x2e546e;return _0x3b9d67;})[_0xb2c1('0x28')](respondWithFilteredResult(_0x1cac02,_0x1feb6a))['catch'](handleError(_0x1cac02,null));};exports['show']=function(_0xdd775d,_0x2e7d7b){var _0x419f48={'raw':![],'where':{'id':_0xdd775d[_0xb2c1('0x4a')]['id']}},_0x57c76c={};_0x57c76c['model']=_[_0xb2c1('0x37')](db[_0xb2c1('0x31')]['rawAttributes']);_0x57c76c[_0xb2c1('0x38')]=_['keys'](_0xdd775d['query']);_0x57c76c[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x57c76c[_0xb2c1('0x36')],_0x57c76c[_0xb2c1('0x38')]);_0x419f48[_0xb2c1('0x3a')]=_[_0xb2c1('0x4b')](_0x57c76c[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0xdd775d[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0x419f48['attributes']=_0x419f48[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x419f48[_0xb2c1('0x3a')]:_0x57c76c['model'];if(_0xdd775d[_0xb2c1('0x38')]['includeAll']){_0x419f48[_0xb2c1('0x47')]=[{'all':!![]}];}_0x419f48=_['merge']({},_0x419f48,_0xdd775d[_0xb2c1('0x45')]);return db[_0xb2c1('0x31')][_0xb2c1('0x4c')](_0x419f48)[_0xb2c1('0x28')](handleEntityNotFound(_0x2e7d7b,null))[_0xb2c1('0x28')](respondWithResult(_0x2e7d7b,null))[_0xb2c1('0x4d')](handleError(_0x2e7d7b,null));};exports['create']=function(_0x486011,_0xf730c3){return db['JscriptyProject'][_0xb2c1('0x4e')](_0x486011['body'],{})['then'](function(_0x38539a){var _0x413518=_0x486011[_0xb2c1('0x4f')][_0xb2c1('0x50')]({'plain':!![]});if(!_0x413518)throw new Error(_0xb2c1('0x51'));if(_0x413518['role']===_0xb2c1('0x4f')){var _0x4c3929=_0x38539a[_0xb2c1('0x50')]({'plain':!![]});var _0x2d4c27=_0xb2c1('0x2a');return db[_0xb2c1('0x52')][_0xb2c1('0x4c')]({'where':{'name':_0x2d4c27,'userProfileId':_0x413518['userProfileId']},'raw':!![]})['then'](function(_0x2cb41a){if(_0x2cb41a&&_0x2cb41a['autoAssociation']===0x0){return db[_0xb2c1('0x53')]['create']({'name':_0x4c3929[_0xb2c1('0x2d')],'resourceId':_0x4c3929['id'],'type':_0x2cb41a[_0xb2c1('0x2d')],'sectionId':_0x2cb41a['id']},{})[_0xb2c1('0x28')](function(){return _0x38539a;});}else{return _0x38539a;}})[_0xb2c1('0x4d')](function(_0x99ec3d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x99ec3d);throw _0x99ec3d;});}return _0x38539a;})[_0xb2c1('0x28')](respondWithResult(_0xf730c3,0xc9))[_0xb2c1('0x4d')](handleError(_0xf730c3,null));};exports[_0xb2c1('0x54')]=function(_0x5e81e0,_0x517e92){var _0x4384a7={'where':{'id':_0x5e81e0[_0xb2c1('0x4a')]['id']}},_0x37e093={};_0x37e093[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db['JscriptyProject'][_0xb2c1('0x32')]);_0x4384a7['attributes']=_['intersection'](_0x37e093[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x5e81e0['query'][_0xb2c1('0x3b')]));_0x4384a7[_0xb2c1('0x3a')]=_0x4384a7[_0xb2c1('0x3a')]['length']?_0x4384a7[_0xb2c1('0x3a')]:_0x37e093['model'];if(_0x5e81e0[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0x4384a7[_0xb2c1('0x47')]=[{'all':!![]}];}_0x4384a7=_[_0xb2c1('0x43')]({},_0x4384a7,_0x5e81e0[_0xb2c1('0x45')]);return db[_0xb2c1('0x31')][_0xb2c1('0x4c')](_0x4384a7)[_0xb2c1('0x28')](handleEntityNotFound(_0x517e92,null))[_0xb2c1('0x28')](function(_0x4dfb8f){if(_0x4dfb8f){var _0x904c1b=_0x4dfb8f[_0xb2c1('0x50')]({'plain':!![]});_0x904c1b=qs['omit'](_0x904c1b,['id',_0xb2c1('0x55'),_0xb2c1('0x56')]);_0x5e81e0['body']=_['omit'](_0x5e81e0[_0xb2c1('0x57')],['id',_0xb2c1('0x55'),'updatedAt']);return db[_0xb2c1('0x31')][_0xb2c1('0x4e')](_[_0xb2c1('0x43')](_0x904c1b,_0x5e81e0['body']),{'include':_0x5e81e0[_0xb2c1('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0xb2c1('0x28')](function(_0x379a2d){var _0x256c3a=_0x5e81e0[_0xb2c1('0x4f')][_0xb2c1('0x50')]({'plain':!![]});if(!_0x256c3a)throw new Error(_0xb2c1('0x51'));if(_0x256c3a[_0xb2c1('0x58')]===_0xb2c1('0x4f')){var _0x259cf5=_0x379a2d['get']({'plain':!![]});var _0x39985e=_0xb2c1('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x39985e,'userProfileId':_0x256c3a['userProfileId']},'raw':!![]})[_0xb2c1('0x28')](function(_0x4130e2){if(_0x4130e2&&_0x4130e2[_0xb2c1('0x59')]===0x0){return db[_0xb2c1('0x53')][_0xb2c1('0x4e')]({'name':_0x259cf5[_0xb2c1('0x2d')],'resourceId':_0x259cf5['id'],'type':_0x4130e2[_0xb2c1('0x2d')],'sectionId':_0x4130e2['id']},{})[_0xb2c1('0x28')](function(){return _0x379a2d;});}else{return _0x379a2d;}})[_0xb2c1('0x4d')](function(_0x204baf){logger[_0xb2c1('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x204baf);throw _0x204baf;});}return _0x379a2d;});}})[_0xb2c1('0x28')](respondWithResult(_0x517e92,0xc9))[_0xb2c1('0x4d')](handleError(_0x517e92,null));};exports[_0xb2c1('0x27')]=function(_0x47c57d,_0x2693be){if(_0x47c57d[_0xb2c1('0x57')]['id']){delete _0x47c57d['body']['id'];}return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0x47c57d[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x2693be,null))[_0xb2c1('0x28')](saveUpdates(_0x47c57d[_0xb2c1('0x57')],null))[_0xb2c1('0x28')](respondWithResult(_0x2693be,null))[_0xb2c1('0x4d')](handleError(_0x2693be,null));};exports['destroy']=function(_0xb31fd8,_0x30eef9){return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0xb31fd8[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x30eef9,null))[_0xb2c1('0x28')](removeEntity(_0x30eef9,null))[_0xb2c1('0x4d')](handleError(_0x30eef9,null));};exports[_0xb2c1('0x5b')]=function(_0x523224,_0x45530f,_0x4b1bd2){var _0x37dd50={'raw':!![],'where':{}};var _0x357156={};var _0x4054d8={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x523224[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x45530f,null))['then'](function(_0x1517fa){if(_0x1517fa){_0x357156[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db['JscriptySessionReport']['rawAttributes']);_0x357156[_0xb2c1('0x38')]=_[_0xb2c1('0x37')](_0x523224[_0xb2c1('0x38')]);_0x357156[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x357156[_0xb2c1('0x36')],_0x357156[_0xb2c1('0x38')]);_0x37dd50[_0xb2c1('0x3a')]=_['intersection'](_0x357156[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x523224['query']['fields']));_0x37dd50[_0xb2c1('0x3a')]=_0x37dd50[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x37dd50['attributes']:_0x357156[_0xb2c1('0x36')];if(!_0x523224[_0xb2c1('0x38')]['hasOwnProperty'](_0xb2c1('0x5d'))){_0x37dd50[_0xb2c1('0x23')]=qs['limit'](_0x523224[_0xb2c1('0x38')]['limit']);_0x37dd50[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x523224[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0x37dd50[_0xb2c1('0x3e')]=qs[_0xb2c1('0x3f')](_0x523224[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0x37dd50[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x523224[_0xb2c1('0x38')],_0x357156[_0xb2c1('0x39')]));_0x37dd50[_0xb2c1('0x40')][_0xb2c1('0x5e')]=_0x1517fa['id'];if(_0x523224[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0x37dd50[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x37dd50[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x37dd50[_0xb2c1('0x3a')],function(_0x477cb0){var _0x320b24={};_0x320b24[_0x477cb0]={'$like':'%'+_0x523224[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x320b24;})});}_0x37dd50=_['merge']({},_0x37dd50,_0x523224[_0xb2c1('0x45')]);return db[_0xb2c1('0x5f')][_0xb2c1('0x22')]({'where':_0x37dd50[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x1241ea){_0x4054d8['count']=_0x1241ea;if(_0x523224[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0x37dd50[_0xb2c1('0x47')]=[{'all':!![]}];}return db[_0xb2c1('0x5f')][_0xb2c1('0x48')](_0x37dd50);})[_0xb2c1('0x28')](function(_0x443e13){_0x4054d8[_0xb2c1('0x49')]=_0x443e13;return _0x4054d8;});}})['then'](respondWithFilteredResult(_0x45530f,_0x37dd50))[_0xb2c1('0x4d')](handleError(_0x45530f,null));};exports[_0xb2c1('0x60')]=function(_0x50ad43,_0x452006,_0x2cb07d){var _0xab0705={'raw':!![],'where':{}};var _0x399973={};var _0x2a8516={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')]['findOne']({'where':{'id':_0x50ad43[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x452006,null))[_0xb2c1('0x28')](function(_0x4e27ef){if(_0x4e27ef){_0x399973[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db[_0xb2c1('0x61')]['rawAttributes']);_0x399973['query']=_[_0xb2c1('0x37')](_0x50ad43['query']);_0x399973[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x399973[_0xb2c1('0x36')],_0x399973[_0xb2c1('0x38')]);_0xab0705[_0xb2c1('0x3a')]=_[_0xb2c1('0x4b')](_0x399973[_0xb2c1('0x36')],qs['fields'](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0xab0705[_0xb2c1('0x3a')]=_0xab0705[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0xab0705[_0xb2c1('0x3a')]:_0x399973['model'];if(!_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x3d')](_0xb2c1('0x5d'))){_0xab0705['limit']=qs[_0xb2c1('0x23')](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0xab0705['offset']=qs['offset'](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0xab0705[_0xb2c1('0x3e')]=qs['sort'](_0x50ad43['query'][_0xb2c1('0x3f')]);_0xab0705[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x50ad43['query'],_0x399973[_0xb2c1('0x39')]));_0xab0705[_0xb2c1('0x40')][_0xb2c1('0x5e')]=_0x4e27ef['id'];if(_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0xab0705[_0xb2c1('0x40')]=_['merge'](_0xab0705[_0xb2c1('0x40')],{'$or':_['map'](_0xab0705[_0xb2c1('0x3a')],function(_0x35aded){var _0x2750a7={};_0x2750a7[_0x35aded]={'$like':'%'+_0x50ad43['query']['filter']+'%'};return _0x2750a7;})});}_0xab0705=_[_0xb2c1('0x43')]({},_0xab0705,_0x50ad43[_0xb2c1('0x45')]);return db['JscriptyAnswerReport'][_0xb2c1('0x22')]({'where':_0xab0705[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x40ad4a){_0x2a8516[_0xb2c1('0x22')]=_0x40ad4a;if(_0x50ad43[_0xb2c1('0x38')]['includeAll']){_0xab0705['include']=[{'all':!![]}];}return db[_0xb2c1('0x61')][_0xb2c1('0x48')](_0xab0705);})[_0xb2c1('0x28')](function(_0x2e0576){_0x2a8516[_0xb2c1('0x49')]=_0x2e0576;return _0x2a8516;});}})['then'](respondWithFilteredResult(_0x452006,_0xab0705))[_0xb2c1('0x4d')](handleError(_0x452006,null));};function char(_0x1dd48b){return'number'===typeof _0x1dd48b?String[_0xb2c1('0x62')][_0xb2c1('0x25')](null,arguments):_0x1dd48b;}function needsEncapsulation(_0xa8c2a8){return!!_0xa8c2a8&&(_0xa8c2a8[_0xb2c1('0x63')]()[_0xb2c1('0x64')](char(0xd))>=0x0||_0xa8c2a8[_0xb2c1('0x63')]()[_0xb2c1('0x64')](char(0xa))>=0x0||_0xa8c2a8[_0xb2c1('0x63')]()[_0xb2c1('0x64')](char(0x2c))>=0x0||_0xa8c2a8['toString']()[_0xb2c1('0x64')](char(0x22))>=0x0);}function encapsulate(_0x1d73b2){var _0x2eadba=char(0x22),_0x24383c='\x5c'+char(0x22),_0x35e85f=_0x1d73b2[_0xb2c1('0x63')]()[_0xb2c1('0x65')](new RegExp(_0x2eadba,'g'),_0x24383c);return _0x2eadba+_0x35e85f+_0x2eadba;}exports[_0xb2c1('0x66')]=function(_0x2139bc,_0x45337f,_0x10f8d8){var _0x38f032,_0x31f3bb;var _0x5a0fa4={'where':{'ProjectId':_0x2139bc[_0xb2c1('0x4a')]['id']}};if(_0x2139bc[_0xb2c1('0x38')]['startTime']){_0x5a0fa4[_0xb2c1('0x40')]['starttime']=JSON[_0xb2c1('0x67')](_0x2139bc['query']['startTime']);}return db[_0xb2c1('0x5f')][_0xb2c1('0x48')](_0x5a0fa4)[_0xb2c1('0x28')](handleEntityNotFound(_0x45337f,null))['then'](function(_0x1e7324){if(_0x1e7324){_0x38f032=_0x1e7324;return db[_0xb2c1('0x68')][_0xb2c1('0x48')]({'where':{'SessionId':{'$in':_[_0xb2c1('0x30')](_0x38f032,'id')},'ProjectId':_0x2139bc['params']['id']},'order':_0xb2c1('0x69')});}})[_0xb2c1('0x28')](handleEntityNotFound(_0x45337f,null))[_0xb2c1('0x28')](function(_0x47c3c9){if(_0x47c3c9){_0x31f3bb=_0x47c3c9;var _0x35ae26={};for(var _0x599199=0x0,_0x28889c=_0x31f3bb[_0xb2c1('0x3c')];_0x599199<_0x28889c;_0x599199++){if(!_0x35ae26[_0xb2c1('0x3d')](_0x31f3bb[_0x599199][_0xb2c1('0x6a')])){_0x35ae26[_0x31f3bb[_0x599199][_0xb2c1('0x6a')]]=needsEncapsulation(_0x31f3bb[_0x599199][_0xb2c1('0x6b')])?encapsulate(_0x31f3bb[_0x599199][_0xb2c1('0x6b')]):_0x31f3bb[_0x599199][_0xb2c1('0x6b')];}}var _0x1f51b3=[],_0x135d6e={};for(var _0x310901=0x0,_0x52748d=_0x38f032[_0xb2c1('0x3c')];_0x310901<_0x52748d;_0x310901++){_0x135d6e={'ProjectId':_0x2139bc[_0xb2c1('0x4a')]['id'],'SessionId':_0x38f032[_0x310901]['id'],'StartTime':moment(_0x38f032[_0x310901][_0xb2c1('0x6c')])[_0xb2c1('0x6d')](_0xb2c1('0x6e'))};for(var _0x547325=0x0,_0x50acdb=_0x31f3bb['length'];_0x547325<_0x50acdb;_0x547325++){if(_0x31f3bb[_0x547325][_0xb2c1('0x6f')]==_0x38f032[_0x310901]['id']&&_0x35ae26['hasOwnProperty'](_0x31f3bb[_0x547325]['questionId'])){_0x135d6e[_0x35ae26[_0x31f3bb[_0x547325][_0xb2c1('0x6a')]]]=_0x31f3bb[_0x547325][_0xb2c1('0x70')];}}for(var _0x209487 in _0x35ae26){if(!_0x135d6e['hasOwnProperty'](_0x35ae26[_0x209487])){_0x135d6e[_0x35ae26[_0x209487]]=null;}}_0x1f51b3[_0xb2c1('0x71')](_0x135d6e);}return _0x1f51b3;}})[_0xb2c1('0x28')](function(_0x4f87c8){if(!_[_0xb2c1('0x72')](_0x4f87c8)){var _0x97d6c7=toCsv(_0x4f87c8);var _0x5ad91b=Date[_0xb2c1('0x73')]();fs[_0xb2c1('0x74')](util[_0xb2c1('0x6d')](_0xb2c1('0x75'),_0x2139bc['params']['id'],_0x5ad91b),_0x97d6c7);_0x45337f['setHeader'](_0xb2c1('0x76'),_0xb2c1('0x77')+util[_0xb2c1('0x6d')](_0xb2c1('0x78'),_0x2139bc['params']['id'],_0x5ad91b));_0x45337f[_0xb2c1('0x79')](_0xb2c1('0x7a'),_0xb2c1('0x7b'));return _0x45337f[_0xb2c1('0x7c')](util['format'](_0xb2c1('0x75'),_0x2139bc['params']['id'],_0x5ad91b));}else{return _0x45337f['sendStatus'](0xcc);}})['catch'](handleError(_0x45337f,null));}; \ No newline at end of file +var _0x6b47=['Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','fast-json-patch','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','keys','intersection','model','fields','query','length','attributes','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','autoAssociation','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','setHeader'];(function(_0x5d4460,_0x400e28){var _0x5bdc5e=function(_0x114666){while(--_0x114666){_0x5d4460['push'](_0x5d4460['shift']());}};_0x5bdc5e(++_0x400e28);}(_0x6b47,0xe9));var _0x76b4=function(_0x2fe5fa,_0x528194){_0x2fe5fa=_0x2fe5fa-0x0;var _0x47a039=_0x6b47[_0x2fe5fa];return _0x47a039;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76b4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76b4('0x1'));var rp=require(_0x76b4('0x2'));var moment=require(_0x76b4('0x3'));var BPromise=require(_0x76b4('0x4'));var Mustache=require('mustache');var util=require(_0x76b4('0x5'));var path=require(_0x76b4('0x6'));var sox=require(_0x76b4('0x7'));var csv=require(_0x76b4('0x8'));var ejs=require(_0x76b4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76b4('0xa'));var squel=require(_0x76b4('0xb'));var crypto=require(_0x76b4('0xc'));var jsforce=require(_0x76b4('0xd'));var deskjs=require(_0x76b4('0xe'));var toCsv=require(_0x76b4('0x8'));var querystring=require(_0x76b4('0xf'));var Papa=require(_0x76b4('0x10'));var Redis=require(_0x76b4('0x11'));var authService=require(_0x76b4('0x12'));var qs=require(_0x76b4('0x13'));var as=require(_0x76b4('0x14'));var hardwareService=require(_0x76b4('0x15'));var logger=require('../../config/logger')(_0x76b4('0x16'));var utils=require(_0x76b4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x76b4('0x18'));var db=require(_0x76b4('0x19'))['db'];function respondWithStatusCode(_0xf62e19,_0x5c7cb6){_0x5c7cb6=_0x5c7cb6||0xcc;return function(_0x4dddac){if(_0x4dddac){return _0xf62e19[_0x76b4('0x1a')](_0x5c7cb6);}return _0xf62e19[_0x76b4('0x1b')](_0x5c7cb6)[_0x76b4('0x1c')]();};}function respondWithResult(_0x94f8e7,_0x389092){_0x389092=_0x389092||0xc8;return function(_0xada02b){if(_0xada02b){return _0x94f8e7[_0x76b4('0x1b')](_0x389092)[_0x76b4('0x1d')](_0xada02b);}};}function respondWithFilteredResult(_0x3f10d6,_0x3a0508){return function(_0x507542){if(_0x507542){var _0x5ebc74=typeof _0x3a0508[_0x76b4('0x1e')]===_0x76b4('0x1f')&&typeof _0x3a0508['limit']==='undefined';var _0x12efb4=_0x507542[_0x76b4('0x20')];var _0x2bf42a=_0x5ebc74?0x0:_0x3a0508[_0x76b4('0x1e')];var _0x19feeb=_0x5ebc74?_0x507542['count']:_0x3a0508[_0x76b4('0x1e')]+_0x3a0508[_0x76b4('0x21')];var _0xe074f9;if(_0x19feeb>=_0x12efb4){_0x19feeb=_0x12efb4;_0xe074f9=0xc8;}else{_0xe074f9=0xce;}_0x3f10d6[_0x76b4('0x1b')](_0xe074f9);return _0x3f10d6[_0x76b4('0x22')]('Content-Range',_0x2bf42a+'-'+_0x19feeb+'/'+_0x12efb4)[_0x76b4('0x1d')](_0x507542);}return null;};}function patchUpdates(_0x4ee840){return function(_0x5c9a79){try{jsonpatch[_0x76b4('0x23')](_0x5c9a79,_0x4ee840,!![]);}catch(_0x1e8e95){return BPromise[_0x76b4('0x24')](_0x1e8e95);}return _0x5c9a79['save']();};}function saveUpdates(_0x35956a,_0x56bfcd){return function(_0x43ccf7){if(_0x43ccf7){return _0x43ccf7[_0x76b4('0x25')](_0x35956a)[_0x76b4('0x26')](function(_0xc7b013){return _0xc7b013;});}return null;};}function removeEntity(_0x41b614,_0x40e25a){return function(_0x1d263b){if(_0x1d263b){return _0x1d263b[_0x76b4('0x27')]()['then'](function(){var _0x1ffb52=_0x1d263b['get']({'plain':!![]});var _0x458b60='Projects';return db[_0x76b4('0x28')]['destroy']({'where':{'type':_0x458b60,'resourceId':_0x1ffb52['id']}})[_0x76b4('0x26')](function(){return _0x1d263b;});})[_0x76b4('0x26')](function(){_0x41b614['status'](0xcc)[_0x76b4('0x1c')]();});}};}function handleEntityNotFound(_0x173edb,_0x6887ae){return function(_0x56b805){if(!_0x56b805){_0x173edb[_0x76b4('0x1a')](0x194);}return _0x56b805;};}function handleError(_0x7d687,_0x3e8b9a){_0x3e8b9a=_0x3e8b9a||0x1f4;return function(_0x5f0443){logger[_0x76b4('0x29')](_0x5f0443['stack']);if(_0x5f0443[_0x76b4('0x2a')]){delete _0x5f0443[_0x76b4('0x2a')];}_0x7d687[_0x76b4('0x1b')](_0x3e8b9a)[_0x76b4('0x2b')](_0x5f0443);};}exports[_0x76b4('0x2c')]=function(_0x3f8d87,_0x316a2a){var _0x1330b5={},_0xc7e753={},_0x455b4a={'count':0x0,'rows':[]};var _0x4e6b42=_[_0x76b4('0x2d')](db[_0x76b4('0x2e')][_0x76b4('0x2f')],function(_0x5ba568){return{'name':_0x5ba568[_0x76b4('0x30')],'type':_0x5ba568['type'][_0x76b4('0x31')]};});_0xc7e753['model']=_[_0x76b4('0x2d')](_0x4e6b42,_0x76b4('0x2a'));_0xc7e753['query']=_[_0x76b4('0x32')](_0x3f8d87['query']);_0xc7e753['filters']=_[_0x76b4('0x33')](_0xc7e753[_0x76b4('0x34')],_0xc7e753['query']);_0x1330b5['attributes']=_[_0x76b4('0x33')](_0xc7e753[_0x76b4('0x34')],qs[_0x76b4('0x35')](_0x3f8d87[_0x76b4('0x36')][_0x76b4('0x35')]));_0x1330b5['attributes']=_0x1330b5['attributes'][_0x76b4('0x37')]?_0x1330b5[_0x76b4('0x38')]:_0xc7e753['model'];if(!_0x3f8d87[_0x76b4('0x36')]['hasOwnProperty'](_0x76b4('0x39'))){_0x1330b5[_0x76b4('0x21')]=qs[_0x76b4('0x21')](_0x3f8d87[_0x76b4('0x36')]['limit']);_0x1330b5[_0x76b4('0x1e')]=qs[_0x76b4('0x1e')](_0x3f8d87[_0x76b4('0x36')][_0x76b4('0x1e')]);}_0x1330b5[_0x76b4('0x3a')]=qs[_0x76b4('0x3b')](_0x3f8d87[_0x76b4('0x36')][_0x76b4('0x3b')]);_0x1330b5['where']=qs[_0x76b4('0x3c')](_[_0x76b4('0x3d')](_0x3f8d87[_0x76b4('0x36')],_0xc7e753['filters']),_0x4e6b42);if(_0x3f8d87['query'][_0x76b4('0x3e')]){_0x1330b5[_0x76b4('0x3f')]=_[_0x76b4('0x40')](_0x1330b5['where'],{'$or':_['map'](_0x4e6b42,function(_0x5e368c){if(_0x5e368c['type']!==_0x76b4('0x41')){var _0xe6bdda={};_0xe6bdda[_0x5e368c[_0x76b4('0x2a')]]={'$like':'%'+_0x3f8d87[_0x76b4('0x36')][_0x76b4('0x3e')]+'%'};return _0xe6bdda;}})});}_0x1330b5=_['merge']({},_0x1330b5,_0x3f8d87[_0x76b4('0x42')]);var _0x3d65c7={'where':_0x1330b5[_0x76b4('0x3f')]};return db[_0x76b4('0x2e')][_0x76b4('0x20')](_0x3d65c7)['then'](function(_0x536fd6){_0x455b4a['count']=_0x536fd6;if(_0x3f8d87['query'][_0x76b4('0x43')]){_0x1330b5[_0x76b4('0x44')]=[{'all':!![]}];}return db[_0x76b4('0x2e')][_0x76b4('0x45')](_0x1330b5);})[_0x76b4('0x26')](function(_0x31f3ce){_0x455b4a[_0x76b4('0x46')]=_0x31f3ce;return _0x455b4a;})[_0x76b4('0x26')](respondWithFilteredResult(_0x316a2a,_0x1330b5))[_0x76b4('0x47')](handleError(_0x316a2a,null));};exports[_0x76b4('0x48')]=function(_0xbea460,_0x145c1f){var _0x4ba841={'raw':![],'where':{'id':_0xbea460[_0x76b4('0x49')]['id']}},_0x1cbf07={};_0x1cbf07[_0x76b4('0x34')]=_['keys'](db[_0x76b4('0x2e')][_0x76b4('0x2f')]);_0x1cbf07[_0x76b4('0x36')]=_[_0x76b4('0x32')](_0xbea460['query']);_0x1cbf07[_0x76b4('0x3c')]=_[_0x76b4('0x33')](_0x1cbf07['model'],_0x1cbf07[_0x76b4('0x36')]);_0x4ba841[_0x76b4('0x38')]=_[_0x76b4('0x33')](_0x1cbf07['model'],qs['fields'](_0xbea460['query'][_0x76b4('0x35')]));_0x4ba841['attributes']=_0x4ba841[_0x76b4('0x38')][_0x76b4('0x37')]?_0x4ba841[_0x76b4('0x38')]:_0x1cbf07[_0x76b4('0x34')];if(_0xbea460[_0x76b4('0x36')][_0x76b4('0x43')]){_0x4ba841['include']=[{'all':!![]}];}_0x4ba841=_[_0x76b4('0x40')]({},_0x4ba841,_0xbea460[_0x76b4('0x42')]);return db[_0x76b4('0x2e')][_0x76b4('0x4a')](_0x4ba841)[_0x76b4('0x26')](handleEntityNotFound(_0x145c1f,null))[_0x76b4('0x26')](respondWithResult(_0x145c1f,null))[_0x76b4('0x47')](handleError(_0x145c1f,null));};exports[_0x76b4('0x4b')]=function(_0x7e3be1,_0x2bc1e8){return db[_0x76b4('0x2e')]['create'](_0x7e3be1[_0x76b4('0x4c')],{})['then'](function(_0x60cbb){var _0x27c0e8=_0x7e3be1[_0x76b4('0x4d')][_0x76b4('0x4e')]({'plain':!![]});if(!_0x27c0e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c0e8[_0x76b4('0x4f')]==='user'){var _0x27150d=_0x60cbb[_0x76b4('0x4e')]({'plain':!![]});var _0x3a6931='Projects';return db[_0x76b4('0x50')][_0x76b4('0x4a')]({'where':{'name':_0x3a6931,'userProfileId':_0x27c0e8[_0x76b4('0x51')]},'raw':!![]})[_0x76b4('0x26')](function(_0x34ce1b){if(_0x34ce1b&&_0x34ce1b['autoAssociation']===0x0){return db[_0x76b4('0x28')]['create']({'name':_0x27150d[_0x76b4('0x2a')],'resourceId':_0x27150d['id'],'type':_0x34ce1b[_0x76b4('0x2a')],'sectionId':_0x34ce1b['id']},{})[_0x76b4('0x26')](function(){return _0x60cbb;});}else{return _0x60cbb;}})[_0x76b4('0x47')](function(_0xfc2e7f){logger[_0x76b4('0x29')](_0x76b4('0x52'),_0xfc2e7f);throw _0xfc2e7f;});}return _0x60cbb;})[_0x76b4('0x26')](respondWithResult(_0x2bc1e8,0xc9))[_0x76b4('0x47')](handleError(_0x2bc1e8,null));};exports['clone']=function(_0x201fc4,_0x3ab37a){var _0x3899f6={'where':{'id':_0x201fc4[_0x76b4('0x49')]['id']}},_0x5b38de={};_0x5b38de['model']=_[_0x76b4('0x32')](db[_0x76b4('0x2e')][_0x76b4('0x2f')]);_0x3899f6[_0x76b4('0x38')]=_[_0x76b4('0x33')](_0x5b38de[_0x76b4('0x34')],qs['fields'](_0x201fc4[_0x76b4('0x36')][_0x76b4('0x35')]));_0x3899f6[_0x76b4('0x38')]=_0x3899f6['attributes'][_0x76b4('0x37')]?_0x3899f6[_0x76b4('0x38')]:_0x5b38de[_0x76b4('0x34')];if(_0x201fc4[_0x76b4('0x36')][_0x76b4('0x43')]){_0x3899f6[_0x76b4('0x44')]=[{'all':!![]}];}_0x3899f6=_['merge']({},_0x3899f6,_0x201fc4[_0x76b4('0x42')]);return db[_0x76b4('0x2e')]['find'](_0x3899f6)[_0x76b4('0x26')](handleEntityNotFound(_0x3ab37a,null))[_0x76b4('0x26')](function(_0x32bbec){if(_0x32bbec){var _0x3e1663=_0x32bbec[_0x76b4('0x4e')]({'plain':!![]});_0x3e1663=qs['omit'](_0x3e1663,['id',_0x76b4('0x53'),_0x76b4('0x54')]);_0x201fc4['body']=_['omit'](_0x201fc4[_0x76b4('0x4c')],['id','createdAt',_0x76b4('0x54')]);return db[_0x76b4('0x2e')]['create'](_[_0x76b4('0x40')](_0x3e1663,_0x201fc4[_0x76b4('0x4c')]),{'include':_0x201fc4[_0x76b4('0x36')][_0x76b4('0x43')]?[{'all':!![]}]:undefined})[_0x76b4('0x26')](function(_0x2a4429){var _0x3d695f=_0x201fc4[_0x76b4('0x4d')]['get']({'plain':!![]});if(!_0x3d695f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d695f[_0x76b4('0x4f')]==='user'){var _0x58f75a=_0x2a4429[_0x76b4('0x4e')]({'plain':!![]});var _0x53a80c='Projects';return db[_0x76b4('0x50')][_0x76b4('0x4a')]({'where':{'name':_0x53a80c,'userProfileId':_0x3d695f[_0x76b4('0x51')]},'raw':!![]})[_0x76b4('0x26')](function(_0x5a8508){if(_0x5a8508&&_0x5a8508[_0x76b4('0x55')]===0x0){return db[_0x76b4('0x28')][_0x76b4('0x4b')]({'name':_0x58f75a['name'],'resourceId':_0x58f75a['id'],'type':_0x5a8508[_0x76b4('0x2a')],'sectionId':_0x5a8508['id']},{})[_0x76b4('0x26')](function(){return _0x2a4429;});}else{return _0x2a4429;}})['catch'](function(_0x318d08){logger[_0x76b4('0x29')](_0x76b4('0x52'),_0x318d08);throw _0x318d08;});}return _0x2a4429;});}})[_0x76b4('0x26')](respondWithResult(_0x3ab37a,0xc9))[_0x76b4('0x47')](handleError(_0x3ab37a,null));};exports['update']=function(_0x3e4a85,_0x295368){if(_0x3e4a85[_0x76b4('0x4c')]['id']){delete _0x3e4a85[_0x76b4('0x4c')]['id'];}return db[_0x76b4('0x2e')][_0x76b4('0x4a')]({'where':{'id':_0x3e4a85[_0x76b4('0x49')]['id']}})[_0x76b4('0x26')](handleEntityNotFound(_0x295368,null))[_0x76b4('0x26')](saveUpdates(_0x3e4a85['body'],null))[_0x76b4('0x26')](respondWithResult(_0x295368,null))[_0x76b4('0x47')](handleError(_0x295368,null));};exports['destroy']=function(_0x4f3bea,_0x57520c){return db[_0x76b4('0x2e')]['find']({'where':{'id':_0x4f3bea[_0x76b4('0x49')]['id']}})[_0x76b4('0x26')](handleEntityNotFound(_0x57520c,null))[_0x76b4('0x26')](removeEntity(_0x57520c,null))[_0x76b4('0x47')](handleError(_0x57520c,null));};exports[_0x76b4('0x56')]=function(_0x9848eb,_0x55ba3b,_0x31105e){var _0x5d4b70={'raw':!![],'where':{}};var _0x22baeb={};var _0x3d66ae={'count':0x0,'rows':[]};return db[_0x76b4('0x2e')][_0x76b4('0x57')]({'where':{'id':_0x9848eb[_0x76b4('0x49')]['id']}})[_0x76b4('0x26')](handleEntityNotFound(_0x55ba3b,null))[_0x76b4('0x26')](function(_0x2d3601){if(_0x2d3601){_0x22baeb[_0x76b4('0x34')]=_[_0x76b4('0x32')](db[_0x76b4('0x58')][_0x76b4('0x2f')]);_0x22baeb[_0x76b4('0x36')]=_[_0x76b4('0x32')](_0x9848eb[_0x76b4('0x36')]);_0x22baeb[_0x76b4('0x3c')]=_[_0x76b4('0x33')](_0x22baeb[_0x76b4('0x34')],_0x22baeb[_0x76b4('0x36')]);_0x5d4b70['attributes']=_[_0x76b4('0x33')](_0x22baeb[_0x76b4('0x34')],qs[_0x76b4('0x35')](_0x9848eb[_0x76b4('0x36')]['fields']));_0x5d4b70[_0x76b4('0x38')]=_0x5d4b70[_0x76b4('0x38')][_0x76b4('0x37')]?_0x5d4b70[_0x76b4('0x38')]:_0x22baeb[_0x76b4('0x34')];if(!_0x9848eb[_0x76b4('0x36')][_0x76b4('0x59')]('nolimit')){_0x5d4b70[_0x76b4('0x21')]=qs[_0x76b4('0x21')](_0x9848eb['query']['limit']);_0x5d4b70[_0x76b4('0x1e')]=qs[_0x76b4('0x1e')](_0x9848eb[_0x76b4('0x36')][_0x76b4('0x1e')]);}_0x5d4b70[_0x76b4('0x3a')]=qs[_0x76b4('0x3b')](_0x9848eb[_0x76b4('0x36')][_0x76b4('0x3b')]);_0x5d4b70[_0x76b4('0x3f')]=qs[_0x76b4('0x3c')](_['pick'](_0x9848eb[_0x76b4('0x36')],_0x22baeb[_0x76b4('0x3c')]));_0x5d4b70[_0x76b4('0x3f')][_0x76b4('0x5a')]=_0x2d3601['id'];if(_0x9848eb[_0x76b4('0x36')][_0x76b4('0x3e')]){_0x5d4b70[_0x76b4('0x3f')]=_['merge'](_0x5d4b70[_0x76b4('0x3f')],{'$or':_[_0x76b4('0x2d')](_0x5d4b70[_0x76b4('0x38')],function(_0x4a8559){var _0x450d9c={};_0x450d9c[_0x4a8559]={'$like':'%'+_0x9848eb[_0x76b4('0x36')][_0x76b4('0x3e')]+'%'};return _0x450d9c;})});}_0x5d4b70=_[_0x76b4('0x40')]({},_0x5d4b70,_0x9848eb[_0x76b4('0x42')]);return db[_0x76b4('0x58')][_0x76b4('0x20')]({'where':_0x5d4b70[_0x76b4('0x3f')]})[_0x76b4('0x26')](function(_0x51b218){_0x3d66ae[_0x76b4('0x20')]=_0x51b218;if(_0x9848eb[_0x76b4('0x36')]['includeAll']){_0x5d4b70['include']=[{'all':!![]}];}return db[_0x76b4('0x58')][_0x76b4('0x45')](_0x5d4b70);})['then'](function(_0x39f441){_0x3d66ae[_0x76b4('0x46')]=_0x39f441;return _0x3d66ae;});}})[_0x76b4('0x26')](respondWithFilteredResult(_0x55ba3b,_0x5d4b70))[_0x76b4('0x47')](handleError(_0x55ba3b,null));};exports[_0x76b4('0x5b')]=function(_0x1400ef,_0x346f2b,_0x1d03dd){var _0x2fad4d={'raw':!![],'where':{}};var _0x5145c1={};var _0x4f5e41={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x76b4('0x57')]({'where':{'id':_0x1400ef['params']['id']}})[_0x76b4('0x26')](handleEntityNotFound(_0x346f2b,null))[_0x76b4('0x26')](function(_0x2a7d27){if(_0x2a7d27){_0x5145c1['model']=_[_0x76b4('0x32')](db[_0x76b4('0x5c')][_0x76b4('0x2f')]);_0x5145c1[_0x76b4('0x36')]=_[_0x76b4('0x32')](_0x1400ef[_0x76b4('0x36')]);_0x5145c1[_0x76b4('0x3c')]=_[_0x76b4('0x33')](_0x5145c1['model'],_0x5145c1[_0x76b4('0x36')]);_0x2fad4d['attributes']=_[_0x76b4('0x33')](_0x5145c1['model'],qs[_0x76b4('0x35')](_0x1400ef[_0x76b4('0x36')][_0x76b4('0x35')]));_0x2fad4d['attributes']=_0x2fad4d[_0x76b4('0x38')][_0x76b4('0x37')]?_0x2fad4d['attributes']:_0x5145c1[_0x76b4('0x34')];if(!_0x1400ef[_0x76b4('0x36')][_0x76b4('0x59')](_0x76b4('0x39'))){_0x2fad4d['limit']=qs[_0x76b4('0x21')](_0x1400ef[_0x76b4('0x36')][_0x76b4('0x21')]);_0x2fad4d[_0x76b4('0x1e')]=qs[_0x76b4('0x1e')](_0x1400ef[_0x76b4('0x36')][_0x76b4('0x1e')]);}_0x2fad4d[_0x76b4('0x3a')]=qs['sort'](_0x1400ef[_0x76b4('0x36')]['sort']);_0x2fad4d['where']=qs['filters'](_['pick'](_0x1400ef[_0x76b4('0x36')],_0x5145c1['filters']));_0x2fad4d[_0x76b4('0x3f')][_0x76b4('0x5a')]=_0x2a7d27['id'];if(_0x1400ef[_0x76b4('0x36')][_0x76b4('0x3e')]){_0x2fad4d[_0x76b4('0x3f')]=_[_0x76b4('0x40')](_0x2fad4d[_0x76b4('0x3f')],{'$or':_[_0x76b4('0x2d')](_0x2fad4d[_0x76b4('0x38')],function(_0x3cf0dc){var _0x5a3b6f={};_0x5a3b6f[_0x3cf0dc]={'$like':'%'+_0x1400ef[_0x76b4('0x36')][_0x76b4('0x3e')]+'%'};return _0x5a3b6f;})});}_0x2fad4d=_[_0x76b4('0x40')]({},_0x2fad4d,_0x1400ef[_0x76b4('0x42')]);return db[_0x76b4('0x5c')][_0x76b4('0x20')]({'where':_0x2fad4d[_0x76b4('0x3f')]})['then'](function(_0x40c85e){_0x4f5e41[_0x76b4('0x20')]=_0x40c85e;if(_0x1400ef[_0x76b4('0x36')][_0x76b4('0x43')]){_0x2fad4d['include']=[{'all':!![]}];}return db[_0x76b4('0x5c')][_0x76b4('0x45')](_0x2fad4d);})[_0x76b4('0x26')](function(_0x31832c){_0x4f5e41[_0x76b4('0x46')]=_0x31832c;return _0x4f5e41;});}})['then'](respondWithFilteredResult(_0x346f2b,_0x2fad4d))['catch'](handleError(_0x346f2b,null));};function char(_0x197a57){return'number'===typeof _0x197a57?String[_0x76b4('0x5d')]['apply'](null,arguments):_0x197a57;}function needsEncapsulation(_0x1f81c6){return!!_0x1f81c6&&(_0x1f81c6[_0x76b4('0x5e')]()[_0x76b4('0x5f')](char(0xd))>=0x0||_0x1f81c6['toString']()[_0x76b4('0x5f')](char(0xa))>=0x0||_0x1f81c6['toString']()[_0x76b4('0x5f')](char(0x2c))>=0x0||_0x1f81c6[_0x76b4('0x5e')]()[_0x76b4('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x1da363){var _0x4c5c8e=char(0x22),_0x111082='\x5c'+char(0x22),_0xe1ce07=_0x1da363[_0x76b4('0x5e')]()[_0x76b4('0x60')](new RegExp(_0x4c5c8e,'g'),_0x111082);return _0x4c5c8e+_0xe1ce07+_0x4c5c8e;}exports['getSummary']=function(_0x4eb451,_0x3598c5,_0x1c3b5c){var _0x401104,_0x5e17cf;var _0x4bd08e={'where':{'ProjectId':_0x4eb451[_0x76b4('0x49')]['id']}};if(_0x4eb451[_0x76b4('0x36')][_0x76b4('0x61')]){_0x4bd08e['where'][_0x76b4('0x62')]=JSON[_0x76b4('0x63')](_0x4eb451[_0x76b4('0x36')][_0x76b4('0x61')]);}return db[_0x76b4('0x58')]['findAll'](_0x4bd08e)[_0x76b4('0x26')](handleEntityNotFound(_0x3598c5,null))['then'](function(_0x345c12){if(_0x345c12){_0x401104=_0x345c12;return db[_0x76b4('0x64')][_0x76b4('0x45')]({'where':{'SessionId':{'$in':_[_0x76b4('0x2d')](_0x401104,'id')},'ProjectId':_0x4eb451[_0x76b4('0x49')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x3598c5,null))[_0x76b4('0x26')](function(_0x41fd33){if(_0x41fd33){_0x5e17cf=_0x41fd33;var _0x1bb269={};for(var _0x2f13fe=0x0,_0x45dff3=_0x5e17cf['length'];_0x2f13fe<_0x45dff3;_0x2f13fe++){if(!_0x1bb269[_0x76b4('0x59')](_0x5e17cf[_0x2f13fe]['questionId'])){_0x1bb269[_0x5e17cf[_0x2f13fe][_0x76b4('0x65')]]=needsEncapsulation(_0x5e17cf[_0x2f13fe][_0x76b4('0x66')])?encapsulate(_0x5e17cf[_0x2f13fe][_0x76b4('0x66')]):_0x5e17cf[_0x2f13fe][_0x76b4('0x66')];}}var _0x1b5f30=[],_0xd716fb={};for(var _0x1b4c81=0x0,_0x3d80aa=_0x401104['length'];_0x1b4c81<_0x3d80aa;_0x1b4c81++){_0xd716fb={'ProjectId':_0x4eb451[_0x76b4('0x49')]['id'],'SessionId':_0x401104[_0x1b4c81]['id'],'StartTime':moment(_0x401104[_0x1b4c81][_0x76b4('0x62')])[_0x76b4('0x67')](_0x76b4('0x68'))};for(var _0x5e8bcc=0x0,_0x12074b=_0x5e17cf[_0x76b4('0x37')];_0x5e8bcc<_0x12074b;_0x5e8bcc++){if(_0x5e17cf[_0x5e8bcc]['SessionId']==_0x401104[_0x1b4c81]['id']&&_0x1bb269[_0x76b4('0x59')](_0x5e17cf[_0x5e8bcc]['questionId'])){_0xd716fb[_0x1bb269[_0x5e17cf[_0x5e8bcc][_0x76b4('0x65')]]]=_0x5e17cf[_0x5e8bcc]['answer'];}}for(var _0xcfa709 in _0x1bb269){if(!_0xd716fb[_0x76b4('0x59')](_0x1bb269[_0xcfa709])){_0xd716fb[_0x1bb269[_0xcfa709]]=null;}}_0x1b5f30[_0x76b4('0x69')](_0xd716fb);}return _0x1b5f30;}})[_0x76b4('0x26')](function(_0x49e122){if(!_[_0x76b4('0x6a')](_0x49e122)){var _0x27ad0a=toCsv(_0x49e122);var _0x538f66=Date[_0x76b4('0x6b')]();fs['writeFileSync'](util[_0x76b4('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4eb451[_0x76b4('0x49')]['id'],_0x538f66),_0x27ad0a);_0x3598c5[_0x76b4('0x6c')](_0x76b4('0x6d'),'attachment;\x20filename='+util['format'](_0x76b4('0x6e'),_0x4eb451['params']['id'],_0x538f66));_0x3598c5['setHeader'](_0x76b4('0x6f'),_0x76b4('0x70'));return _0x3598c5[_0x76b4('0x71')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4eb451['params']['id'],_0x538f66));}else{return _0x3598c5[_0x76b4('0x1a')](0xcc);}})[_0x76b4('0x47')](handleError(_0x3598c5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 138bb7d..d64be21 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 _0x7579=['define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x433ba3,_0x303968){var _0x59da1a=function(_0xbb592d){while(--_0xbb592d){_0x433ba3['push'](_0x433ba3['shift']());}};_0x59da1a(++_0x303968);}(_0x7579,0x1e2));var _0x9757=function(_0x588f02,_0x112ae5){_0x588f02=_0x588f02-0x0;var _0x2ad0c1=_0x7579[_0x588f02];return _0x2ad0c1;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('JscriptyProject',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41d9=['../../config/environment','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x269d15,_0x2b3e71){var _0xe8d2e=function(_0x411a40){while(--_0x411a40){_0x269d15['push'](_0x269d15['shift']());}};_0xe8d2e(++_0x2b3e71);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var logger=require(_0x941d('0x2'))(_0x941d('0x3'));var moment=require(_0x941d('0x4'));var BPromise=require(_0x941d('0x5'));var rp=require(_0x941d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x941d('0x7'));var config=require(_0x941d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x941d('0x9')]=function(_0x19dd41,_0x56e384){return _0x19dd41[_0x941d('0xa')]('JscriptyProject',attributes,{'tableName':_0x941d('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 da48eae..1b84346 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xda3f,0xec));var _0xfda3=function(_0x885799,_0x395768){_0x885799=_0x885799-0x0;var _0x199c0c=_0xda3f[_0x885799];return _0x199c0c;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x1cd947,_0x52d527){var _0x2414ef=function(_0x174421){while(--_0x174421){_0x1cd947['push'](_0x1cd947['shift']());}};_0x2414ef(++_0x52d527);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xcb91[_0x4f11cb];return _0x491488;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 42e083d..317ff4f 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 _0x03cc=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3dac79,_0x849db0){var _0x4e18a9=function(_0x411e39){while(--_0x411e39){_0x3dac79['push'](_0x3dac79['shift']());}};_0x4e18a9(++_0x849db0);}(_0x03cc,0xfb));var _0xc03c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x03cc[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xc03c('0x0'));var util=require('util');var path=require(_0xc03c('0x1'));var timeout=require(_0xc03c('0x2'));var express=require(_0xc03c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc03c('0x4'));var interaction=require(_0xc03c('0x5'));var config=require(_0xc03c('0x6'));var controller=require(_0xc03c('0x7'));router[_0xc03c('0x8')]('/',auth[_0xc03c('0x9')](),controller['index']);router[_0xc03c('0x8')](_0xc03c('0xa'),auth[_0xc03c('0x9')](),controller[_0xc03c('0xb')]);router['get'](_0xc03c('0xc'),auth[_0xc03c('0x9')](),controller[_0xc03c('0xd')]);router[_0xc03c('0xe')]('/',auth[_0xc03c('0x9')](),controller[_0xc03c('0xf')]);router[_0xc03c('0x10')](_0xc03c('0xc'),auth[_0xc03c('0x9')](),controller[_0xc03c('0x11')]);router[_0xc03c('0x12')](_0xc03c('0xc'),auth[_0xc03c('0x9')](),controller[_0xc03c('0x13')]);module[_0xc03c('0x14')]=router; \ No newline at end of file +var _0x8b3b=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x2352eb,_0x5e1425){var _0x325092=function(_0x3b8cd0){while(--_0x3b8cd0){_0x2352eb['push'](_0x2352eb['shift']());}};_0x325092(++_0x5e1425);}(_0x8b3b,0x19c));var _0xb8b3=function(_0x635e28,_0x4eecc1){_0x635e28=_0x635e28-0x0;var _0x5bb9dc=_0x8b3b[_0x635e28];return _0x5bb9dc;};'use strict';var multer=require(_0xb8b3('0x0'));var util=require(_0xb8b3('0x1'));var path=require(_0xb8b3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb8b3('0x3')]();var fs_extra=require(_0xb8b3('0x4'));var auth=require(_0xb8b3('0x5'));var interaction=require(_0xb8b3('0x6'));var config=require(_0xb8b3('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xb8b3('0x8')]('/',auth['isAuthenticated'](),controller[_0xb8b3('0x9')]);router[_0xb8b3('0x8')](_0xb8b3('0xa'),auth[_0xb8b3('0xb')](),controller['describe']);router['get']('/:id',auth[_0xb8b3('0xb')](),controller[_0xb8b3('0xc')]);router[_0xb8b3('0xd')]('/',auth[_0xb8b3('0xb')](),controller['create']);router[_0xb8b3('0xe')](_0xb8b3('0xf'),auth[_0xb8b3('0xb')](),controller[_0xb8b3('0x10')]);router[_0xb8b3('0x11')](_0xb8b3('0xf'),auth[_0xb8b3('0xb')](),controller['destroy']);module[_0xb8b3('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 62b1f79..fe92ac3 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5c8145,_0x353086){_0x5c8145=_0x5c8145-0x0;var _0x7b29b9=_0x7a54[_0x5c8145];return _0x7b29b9;};'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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x1c589a,_0x4ec7ea){_0x1c589a=_0x1c589a-0x0;var _0x19fa5a=_0x7a54[_0x1c589a];return _0x19fa5a;};'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 66f8eea..1720cc3 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 _0x9201=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','find','create'];(function(_0x371c17,_0x194968){var _0x518fa3=function(_0x348e62){while(--_0x348e62){_0x371c17['push'](_0x371c17['shift']());}};_0x518fa3(++_0x194968);}(_0x9201,0xef));var _0x1920=function(_0x367102,_0x24c1f7){_0x367102=_0x367102-0x0;var _0x123d1d=_0x9201[_0x367102];return _0x123d1d;};'use strict';var emlformat=require(_0x1920('0x0'));var rimraf=require(_0x1920('0x1'));var zipdir=require(_0x1920('0x2'));var jsonpatch=require(_0x1920('0x3'));var rp=require(_0x1920('0x4'));var moment=require(_0x1920('0x5'));var BPromise=require(_0x1920('0x6'));var Mustache=require(_0x1920('0x7'));var util=require('util');var path=require(_0x1920('0x8'));var sox=require(_0x1920('0x9'));var csv=require(_0x1920('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1920('0xb'));var _=require(_0x1920('0xc'));var squel=require(_0x1920('0xd'));var crypto=require(_0x1920('0xe'));var jsforce=require(_0x1920('0xf'));var deskjs=require(_0x1920('0x10'));var toCsv=require(_0x1920('0xa'));var querystring=require(_0x1920('0x11'));var Papa=require(_0x1920('0x12'));var Redis=require(_0x1920('0x13'));var authService=require(_0x1920('0x14'));var qs=require(_0x1920('0x15'));var as=require(_0x1920('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1920('0x17'))('api');var utils=require(_0x1920('0x18'));var config=require(_0x1920('0x19'));var licenseUtil=require(_0x1920('0x1a'));var db=require(_0x1920('0x1b'))['db'];function respondWithStatusCode(_0x402fae,_0x32332d){_0x32332d=_0x32332d||0xcc;return function(_0x3940e7){if(_0x3940e7){return _0x402fae[_0x1920('0x1c')](_0x32332d);}return _0x402fae[_0x1920('0x1d')](_0x32332d)[_0x1920('0x1e')]();};}function respondWithResult(_0x3b50f5,_0x162077){_0x162077=_0x162077||0xc8;return function(_0x2cd02b){if(_0x2cd02b){return _0x3b50f5[_0x1920('0x1d')](_0x162077)['json'](_0x2cd02b);}};}function respondWithFilteredResult(_0xe5ddc3,_0x3182d9){return function(_0x450810){if(_0x450810){var _0x119aa8=typeof _0x3182d9[_0x1920('0x1f')]===_0x1920('0x20')&&typeof _0x3182d9[_0x1920('0x21')]===_0x1920('0x20');var _0x5c6aa4=_0x450810[_0x1920('0x22')];var _0x368b42=_0x119aa8?0x0:_0x3182d9[_0x1920('0x1f')];var _0x320b2d=_0x119aa8?_0x450810[_0x1920('0x22')]:_0x3182d9['offset']+_0x3182d9['limit'];var _0x3d4cd2;if(_0x320b2d>=_0x5c6aa4){_0x320b2d=_0x5c6aa4;_0x3d4cd2=0xc8;}else{_0x3d4cd2=0xce;}_0xe5ddc3[_0x1920('0x1d')](_0x3d4cd2);return _0xe5ddc3['set'](_0x1920('0x23'),_0x368b42+'-'+_0x320b2d+'/'+_0x5c6aa4)['json'](_0x450810);}return null;};}function patchUpdates(_0x18245e){return function(_0x579e1f){try{jsonpatch[_0x1920('0x24')](_0x579e1f,_0x18245e,!![]);}catch(_0x282713){return BPromise['reject'](_0x282713);}return _0x579e1f[_0x1920('0x25')]();};}function saveUpdates(_0x491870,_0xe55f9e){return function(_0x354e3f){if(_0x354e3f){return _0x354e3f[_0x1920('0x26')](_0x491870)[_0x1920('0x27')](function(_0x4ce3b2){return _0x4ce3b2;});}return null;};}function removeEntity(_0x121800,_0xf64717){return function(_0x41760a){if(_0x41760a){return _0x41760a[_0x1920('0x28')]()[_0x1920('0x27')](function(){_0x121800[_0x1920('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35776b,_0x3039c4){return function(_0x56dbfe){if(!_0x56dbfe){_0x35776b['sendStatus'](0x194);}return _0x56dbfe;};}function handleError(_0x58fae0,_0x3756d5){_0x3756d5=_0x3756d5||0x1f4;return function(_0x24b32e){logger[_0x1920('0x29')](_0x24b32e[_0x1920('0x2a')]);if(_0x24b32e[_0x1920('0x2b')]){delete _0x24b32e[_0x1920('0x2b')];}_0x58fae0[_0x1920('0x1d')](_0x3756d5)['send'](_0x24b32e);};}exports[_0x1920('0x2c')]=function(_0x38021e,_0x31ee89){var _0x5bbf20={},_0x12f586={},_0x3769fd={'count':0x0,'rows':[]};var _0x29da6e=_[_0x1920('0x2d')](db[_0x1920('0x2e')]['rawAttributes'],function(_0x441880){return{'name':_0x441880[_0x1920('0x2f')],'type':_0x441880[_0x1920('0x30')][_0x1920('0x31')]};});_0x12f586[_0x1920('0x32')]=_['map'](_0x29da6e,_0x1920('0x2b'));_0x12f586[_0x1920('0x33')]=_['keys'](_0x38021e[_0x1920('0x33')]);_0x12f586['filters']=_[_0x1920('0x34')](_0x12f586[_0x1920('0x32')],_0x12f586[_0x1920('0x33')]);_0x5bbf20[_0x1920('0x35')]=_[_0x1920('0x34')](_0x12f586[_0x1920('0x32')],qs[_0x1920('0x36')](_0x38021e['query'][_0x1920('0x36')]));_0x5bbf20['attributes']=_0x5bbf20['attributes'][_0x1920('0x37')]?_0x5bbf20['attributes']:_0x12f586[_0x1920('0x32')];if(!_0x38021e[_0x1920('0x33')][_0x1920('0x38')](_0x1920('0x39'))){_0x5bbf20[_0x1920('0x21')]=qs[_0x1920('0x21')](_0x38021e[_0x1920('0x33')][_0x1920('0x21')]);_0x5bbf20['offset']=qs[_0x1920('0x1f')](_0x38021e[_0x1920('0x33')][_0x1920('0x1f')]);}_0x5bbf20[_0x1920('0x3a')]=qs[_0x1920('0x3b')](_0x38021e[_0x1920('0x33')]['sort']);_0x5bbf20[_0x1920('0x3c')]=qs['filters'](_[_0x1920('0x3d')](_0x38021e[_0x1920('0x33')],_0x12f586[_0x1920('0x3e')]),_0x29da6e);if(_0x38021e['query'][_0x1920('0x3f')]){_0x5bbf20[_0x1920('0x3c')]=_['merge'](_0x5bbf20[_0x1920('0x3c')],{'$or':_[_0x1920('0x2d')](_0x29da6e,function(_0x54095a){if(_0x54095a['type']!==_0x1920('0x40')){var _0x5c44b6={};_0x5c44b6[_0x54095a[_0x1920('0x2b')]]={'$like':'%'+_0x38021e[_0x1920('0x33')][_0x1920('0x3f')]+'%'};return _0x5c44b6;}})});}_0x5bbf20=_[_0x1920('0x41')]({},_0x5bbf20,_0x38021e[_0x1920('0x42')]);var _0x1ef702={'where':_0x5bbf20[_0x1920('0x3c')]};return db['JscriptyQuestionReport']['count'](_0x1ef702)['then'](function(_0xff7047){_0x3769fd[_0x1920('0x22')]=_0xff7047;if(_0x38021e['query'][_0x1920('0x43')]){_0x5bbf20[_0x1920('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x1920('0x45')](_0x5bbf20);})['then'](function(_0x5815c3){_0x3769fd['rows']=_0x5815c3;return _0x3769fd;})[_0x1920('0x27')](respondWithFilteredResult(_0x31ee89,_0x5bbf20))[_0x1920('0x46')](handleError(_0x31ee89,null));};exports[_0x1920('0x47')]=function(_0x42b984,_0x5a4b93){var _0x50b80e={'raw':!![],'where':{'id':_0x42b984[_0x1920('0x48')]['id']}},_0x261869={};_0x261869['model']=_['keys'](db[_0x1920('0x2e')][_0x1920('0x49')]);_0x261869['query']=_[_0x1920('0x4a')](_0x42b984['query']);_0x261869[_0x1920('0x3e')]=_[_0x1920('0x34')](_0x261869[_0x1920('0x32')],_0x261869[_0x1920('0x33')]);_0x50b80e[_0x1920('0x35')]=_[_0x1920('0x34')](_0x261869[_0x1920('0x32')],qs['fields'](_0x42b984[_0x1920('0x33')]['fields']));_0x50b80e[_0x1920('0x35')]=_0x50b80e[_0x1920('0x35')][_0x1920('0x37')]?_0x50b80e['attributes']:_0x261869['model'];if(_0x42b984[_0x1920('0x33')]['includeAll']){_0x50b80e['include']=[{'all':!![]}];}_0x50b80e=_[_0x1920('0x41')]({},_0x50b80e,_0x42b984[_0x1920('0x42')]);return db['JscriptyQuestionReport'][_0x1920('0x4b')](_0x50b80e)[_0x1920('0x27')](handleEntityNotFound(_0x5a4b93,null))['then'](respondWithResult(_0x5a4b93,null))['catch'](handleError(_0x5a4b93,null));};exports[_0x1920('0x4c')]=function(_0x44603f,_0x2d36cf){return db['JscriptyQuestionReport'][_0x1920('0x4c')](_0x44603f[_0x1920('0x4d')],{})[_0x1920('0x27')](respondWithResult(_0x2d36cf,0xc9))[_0x1920('0x46')](handleError(_0x2d36cf,null));};exports[_0x1920('0x26')]=function(_0x22f7f5,_0x183290){if(_0x22f7f5[_0x1920('0x4d')]['id']){delete _0x22f7f5[_0x1920('0x4d')]['id'];}return db[_0x1920('0x2e')]['find']({'where':{'id':_0x22f7f5[_0x1920('0x48')]['id']}})['then'](handleEntityNotFound(_0x183290,null))['then'](saveUpdates(_0x22f7f5['body'],null))[_0x1920('0x27')](respondWithResult(_0x183290,null))['catch'](handleError(_0x183290,null));};exports['destroy']=function(_0x5458a8,_0x410463){return db['JscriptyQuestionReport'][_0x1920('0x4b')]({'where':{'id':_0x5458a8['params']['id']}})[_0x1920('0x27')](handleEntityNotFound(_0x410463,null))[_0x1920('0x27')](removeEntity(_0x410463,null))[_0x1920('0x46')](handleError(_0x410463,null));};exports[_0x1920('0x4e')]=function(_0xb52183,_0x58c26f){return db[_0x1920('0x2e')][_0x1920('0x4e')]()['then'](respondWithResult(_0x58c26f,null))[_0x1920('0x46')](handleError(_0x58c26f,null));}; \ No newline at end of file +var _0x7adf=['count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','JscriptyQuestionReport','include','findAll','rows','show','params','includeAll','merge','catch','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3a6b8e,_0x157918){var _0x3bef1f=function(_0x1b3a55){while(--_0x1b3a55){_0x3a6b8e['push'](_0x3a6b8e['shift']());}};_0x3bef1f(++_0x157918);}(_0x7adf,0x155));var _0xf7ad=function(_0x3af955,_0x21431c){_0x3af955=_0x3af955-0x0;var _0x167de5=_0x7adf[_0x3af955];return _0x167de5;};'use strict';var emlformat=require(_0xf7ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7ad('0x1'));var jsonpatch=require(_0xf7ad('0x2'));var rp=require(_0xf7ad('0x3'));var moment=require(_0xf7ad('0x4'));var BPromise=require(_0xf7ad('0x5'));var Mustache=require(_0xf7ad('0x6'));var util=require('util');var path=require(_0xf7ad('0x7'));var sox=require(_0xf7ad('0x8'));var csv=require('to-csv');var ejs=require(_0xf7ad('0x9'));var fs=require('fs');var fs_extra=require(_0xf7ad('0xa'));var _=require(_0xf7ad('0xb'));var squel=require(_0xf7ad('0xc'));var crypto=require('crypto');var jsforce=require(_0xf7ad('0xd'));var deskjs=require(_0xf7ad('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf7ad('0xf'));var Redis=require('ioredis');var authService=require(_0xf7ad('0x10'));var qs=require(_0xf7ad('0x11'));var as=require(_0xf7ad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7ad('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7ad('0x14'));var licenseUtil=require(_0xf7ad('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a2e0a,_0x14814d){_0x14814d=_0x14814d||0xcc;return function(_0x4ea671){if(_0x4ea671){return _0x4a2e0a[_0xf7ad('0x16')](_0x14814d);}return _0x4a2e0a[_0xf7ad('0x17')](_0x14814d)[_0xf7ad('0x18')]();};}function respondWithResult(_0x6c42b2,_0x59c8e2){_0x59c8e2=_0x59c8e2||0xc8;return function(_0x11caf4){if(_0x11caf4){return _0x6c42b2[_0xf7ad('0x17')](_0x59c8e2)[_0xf7ad('0x19')](_0x11caf4);}};}function respondWithFilteredResult(_0x1a2a62,_0x5951f2){return function(_0xb75698){if(_0xb75698){var _0x29d484=typeof _0x5951f2[_0xf7ad('0x1a')]===_0xf7ad('0x1b')&&typeof _0x5951f2[_0xf7ad('0x1c')]==='undefined';var _0x4aecfc=_0xb75698[_0xf7ad('0x1d')];var _0x2d5232=_0x29d484?0x0:_0x5951f2[_0xf7ad('0x1a')];var _0x246187=_0x29d484?_0xb75698[_0xf7ad('0x1d')]:_0x5951f2[_0xf7ad('0x1a')]+_0x5951f2['limit'];var _0x441a1e;if(_0x246187>=_0x4aecfc){_0x246187=_0x4aecfc;_0x441a1e=0xc8;}else{_0x441a1e=0xce;}_0x1a2a62[_0xf7ad('0x17')](_0x441a1e);return _0x1a2a62[_0xf7ad('0x1e')](_0xf7ad('0x1f'),_0x2d5232+'-'+_0x246187+'/'+_0x4aecfc)[_0xf7ad('0x19')](_0xb75698);}return null;};}function patchUpdates(_0x3fa344){return function(_0x50c764){try{jsonpatch[_0xf7ad('0x20')](_0x50c764,_0x3fa344,!![]);}catch(_0x1e293f){return BPromise[_0xf7ad('0x21')](_0x1e293f);}return _0x50c764[_0xf7ad('0x22')]();};}function saveUpdates(_0x3cbb74,_0x2e2fc9){return function(_0x31b1be){if(_0x31b1be){return _0x31b1be[_0xf7ad('0x23')](_0x3cbb74)[_0xf7ad('0x24')](function(_0x3f740f){return _0x3f740f;});}return null;};}function removeEntity(_0x3b0def,_0x5da515){return function(_0x159307){if(_0x159307){return _0x159307['destroy']()['then'](function(){_0x3b0def[_0xf7ad('0x17')](0xcc)[_0xf7ad('0x18')]();});}};}function handleEntityNotFound(_0x39b10b,_0x59730d){return function(_0x37deb8){if(!_0x37deb8){_0x39b10b[_0xf7ad('0x16')](0x194);}return _0x37deb8;};}function handleError(_0x3c6f4a,_0x35cc8a){_0x35cc8a=_0x35cc8a||0x1f4;return function(_0x2f3fc3){logger['error'](_0x2f3fc3['stack']);if(_0x2f3fc3[_0xf7ad('0x25')]){delete _0x2f3fc3[_0xf7ad('0x25')];}_0x3c6f4a[_0xf7ad('0x17')](_0x35cc8a)[_0xf7ad('0x26')](_0x2f3fc3);};}exports[_0xf7ad('0x27')]=function(_0x12c5a4,_0x45198b){var _0x1870b6={},_0x398c13={},_0x76d985={'count':0x0,'rows':[]};var _0x3c9cc6=_[_0xf7ad('0x28')](db['JscriptyQuestionReport'][_0xf7ad('0x29')],function(_0xf95797){return{'name':_0xf95797[_0xf7ad('0x2a')],'type':_0xf95797[_0xf7ad('0x2b')][_0xf7ad('0x2c')]};});_0x398c13[_0xf7ad('0x2d')]=_[_0xf7ad('0x28')](_0x3c9cc6,_0xf7ad('0x25'));_0x398c13['query']=_[_0xf7ad('0x2e')](_0x12c5a4[_0xf7ad('0x2f')]);_0x398c13[_0xf7ad('0x30')]=_['intersection'](_0x398c13[_0xf7ad('0x2d')],_0x398c13['query']);_0x1870b6[_0xf7ad('0x31')]=_[_0xf7ad('0x32')](_0x398c13[_0xf7ad('0x2d')],qs[_0xf7ad('0x33')](_0x12c5a4[_0xf7ad('0x2f')][_0xf7ad('0x33')]));_0x1870b6[_0xf7ad('0x31')]=_0x1870b6['attributes']['length']?_0x1870b6[_0xf7ad('0x31')]:_0x398c13[_0xf7ad('0x2d')];if(!_0x12c5a4['query'][_0xf7ad('0x34')](_0xf7ad('0x35'))){_0x1870b6[_0xf7ad('0x1c')]=qs['limit'](_0x12c5a4['query'][_0xf7ad('0x1c')]);_0x1870b6[_0xf7ad('0x1a')]=qs[_0xf7ad('0x1a')](_0x12c5a4[_0xf7ad('0x2f')][_0xf7ad('0x1a')]);}_0x1870b6[_0xf7ad('0x36')]=qs['sort'](_0x12c5a4[_0xf7ad('0x2f')][_0xf7ad('0x37')]);_0x1870b6['where']=qs[_0xf7ad('0x30')](_[_0xf7ad('0x38')](_0x12c5a4[_0xf7ad('0x2f')],_0x398c13['filters']),_0x3c9cc6);if(_0x12c5a4[_0xf7ad('0x2f')][_0xf7ad('0x39')]){_0x1870b6[_0xf7ad('0x3a')]=_['merge'](_0x1870b6[_0xf7ad('0x3a')],{'$or':_['map'](_0x3c9cc6,function(_0x291d46){if(_0x291d46['type']!==_0xf7ad('0x3b')){var _0x545a86={};_0x545a86[_0x291d46['name']]={'$like':'%'+_0x12c5a4[_0xf7ad('0x2f')]['filter']+'%'};return _0x545a86;}})});}_0x1870b6=_['merge']({},_0x1870b6,_0x12c5a4[_0xf7ad('0x3c')]);var _0x498b9a={'where':_0x1870b6[_0xf7ad('0x3a')]};return db[_0xf7ad('0x3d')][_0xf7ad('0x1d')](_0x498b9a)[_0xf7ad('0x24')](function(_0x26306e){_0x76d985[_0xf7ad('0x1d')]=_0x26306e;if(_0x12c5a4[_0xf7ad('0x2f')]['includeAll']){_0x1870b6[_0xf7ad('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf7ad('0x3f')](_0x1870b6);})['then'](function(_0x476955){_0x76d985[_0xf7ad('0x40')]=_0x476955;return _0x76d985;})['then'](respondWithFilteredResult(_0x45198b,_0x1870b6))['catch'](handleError(_0x45198b,null));};exports[_0xf7ad('0x41')]=function(_0x19cc36,_0x5d7aaa){var _0x26a214={'raw':!![],'where':{'id':_0x19cc36[_0xf7ad('0x42')]['id']}},_0x33251b={};_0x33251b['model']=_[_0xf7ad('0x2e')](db[_0xf7ad('0x3d')][_0xf7ad('0x29')]);_0x33251b[_0xf7ad('0x2f')]=_[_0xf7ad('0x2e')](_0x19cc36[_0xf7ad('0x2f')]);_0x33251b[_0xf7ad('0x30')]=_[_0xf7ad('0x32')](_0x33251b[_0xf7ad('0x2d')],_0x33251b['query']);_0x26a214[_0xf7ad('0x31')]=_[_0xf7ad('0x32')](_0x33251b[_0xf7ad('0x2d')],qs['fields'](_0x19cc36[_0xf7ad('0x2f')]['fields']));_0x26a214['attributes']=_0x26a214[_0xf7ad('0x31')]['length']?_0x26a214['attributes']:_0x33251b[_0xf7ad('0x2d')];if(_0x19cc36[_0xf7ad('0x2f')][_0xf7ad('0x43')]){_0x26a214['include']=[{'all':!![]}];}_0x26a214=_[_0xf7ad('0x44')]({},_0x26a214,_0x19cc36['options']);return db['JscriptyQuestionReport']['find'](_0x26a214)[_0xf7ad('0x24')](handleEntityNotFound(_0x5d7aaa,null))[_0xf7ad('0x24')](respondWithResult(_0x5d7aaa,null))[_0xf7ad('0x45')](handleError(_0x5d7aaa,null));};exports['create']=function(_0x61bc56,_0x65b92c){return db[_0xf7ad('0x3d')]['create'](_0x61bc56[_0xf7ad('0x46')],{})[_0xf7ad('0x24')](respondWithResult(_0x65b92c,0xc9))[_0xf7ad('0x45')](handleError(_0x65b92c,null));};exports[_0xf7ad('0x23')]=function(_0x351d44,_0x12f8de){if(_0x351d44[_0xf7ad('0x46')]['id']){delete _0x351d44['body']['id'];}return db[_0xf7ad('0x3d')][_0xf7ad('0x47')]({'where':{'id':_0x351d44[_0xf7ad('0x42')]['id']}})['then'](handleEntityNotFound(_0x12f8de,null))[_0xf7ad('0x24')](saveUpdates(_0x351d44['body'],null))[_0xf7ad('0x24')](respondWithResult(_0x12f8de,null))[_0xf7ad('0x45')](handleError(_0x12f8de,null));};exports[_0xf7ad('0x48')]=function(_0x10502a,_0x56dfeb){return db[_0xf7ad('0x3d')][_0xf7ad('0x47')]({'where':{'id':_0x10502a['params']['id']}})[_0xf7ad('0x24')](handleEntityNotFound(_0x56dfeb,null))[_0xf7ad('0x24')](removeEntity(_0x56dfeb,null))[_0xf7ad('0x45')](handleError(_0x56dfeb,null));};exports[_0xf7ad('0x49')]=function(_0x13eee6,_0x1f5cd6){return db['JscriptyQuestionReport'][_0xf7ad('0x49')]()[_0xf7ad('0x24')](respondWithResult(_0x1f5cd6,null))[_0xf7ad('0x45')](handleError(_0x1f5cd6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 63556b4..cc28be7 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 _0x5879=['report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0xb1d99e,_0x315cd9){var _0x33d97a=function(_0x172b4f){while(--_0x172b4f){_0xb1d99e['push'](_0xb1d99e['shift']());}};_0x33d97a(++_0x315cd9);}(_0x5879,0x11f));var _0x9587=function(_0x1c3e6a,_0x33d987){_0x1c3e6a=_0x1c3e6a-0x0;var _0x3cf9e4=_0x5879[_0x1c3e6a];return _0x3cf9e4;};'use strict';var _=require(_0x9587('0x0'));var util=require('util');var logger=require(_0x9587('0x1'))(_0x9587('0x2'));var moment=require(_0x9587('0x3'));var BPromise=require(_0x9587('0x4'));var rp=require(_0x9587('0x5'));var fs=require('fs');var path=require(_0x9587('0x6'));var rimraf=require(_0x9587('0x7'));var config=require(_0x9587('0x8'));var attributes=require(_0x9587('0x9'));module[_0x9587('0xa')]=function(_0x115a85,_0x502b8f){return _0x115a85[_0x9587('0xb')]('JscriptyQuestionReport',attributes,{'tableName':_0x9587('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07d4=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','./jscriptyQuestionReport.attributes','define'];(function(_0x1a5eb0,_0x1f8fbb){var _0x30f9ba=function(_0x8f1caa){while(--_0x8f1caa){_0x1a5eb0['push'](_0x1a5eb0['shift']());}};_0x30f9ba(++_0x1f8fbb);}(_0x07d4,0x197));var _0x407d=function(_0xc2f25d,_0x525a48){_0xc2f25d=_0xc2f25d-0x0;var _0x5259ee=_0x07d4[_0xc2f25d];return _0x5259ee;};'use strict';var _=require(_0x407d('0x0'));var util=require('util');var logger=require(_0x407d('0x1'))(_0x407d('0x2'));var moment=require(_0x407d('0x3'));var BPromise=require(_0x407d('0x4'));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(_0x407d('0x5'));module['exports']=function(_0x5de7da,_0xe6544f){return _0x5de7da[_0x407d('0x6')](_0x407d('0x7'),attributes,{'tableName':_0x407d('0x8'),'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 735ede0..0cb3d21 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 _0xec4f=['message','info','result','JscriptyQuestionReport,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','error','code'];(function(_0x3d1244,_0x156028){var _0x5d6372=function(_0x509c76){while(--_0x509c76){_0x3d1244['push'](_0x3d1244['shift']());}};_0x5d6372(++_0x156028);}(_0xec4f,0x10e));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfec4('0x0'));var moment=require(_0xfec4('0x1'));var BPromise=require(_0xfec4('0x2'));var rs=require(_0xfec4('0x3'));var fs=require('fs');var Redis=require(_0xfec4('0x4'));var db=require(_0xfec4('0x5'))['db'];var utils=require(_0xfec4('0x6'));var logger=require(_0xfec4('0x7'))('rpc');var config=require(_0xfec4('0x8'));var jayson=require(_0xfec4('0x9'));var client=jayson[_0xfec4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1348db,_0x185f98,_0x14755f){return new BPromise(function(_0x5744b4,_0x1433a7){return client['request'](_0x1348db,_0x14755f)[_0xfec4('0xb')](function(_0x2638a6){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x185f98,_0xfec4('0xc'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x185f98,_0xfec4('0xc'),JSON['stringify'](_0x2638a6));if(_0x2638a6[_0xfec4('0xd')]){if(_0x2638a6['error'][_0xfec4('0xe')]===0x1f4){logger[_0xfec4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x185f98,_0x2638a6[_0xfec4('0xd')][_0xfec4('0xf')]);return _0x1433a7(_0x2638a6[_0xfec4('0xd')][_0xfec4('0xf')]);}logger[_0xfec4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x185f98,_0x2638a6[_0xfec4('0xd')][_0xfec4('0xf')]);return _0x5744b4(_0x2638a6['error'][_0xfec4('0xf')]);}else{logger[_0xfec4('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x185f98,_0xfec4('0xc'));_0x5744b4(_0x2638a6[_0xfec4('0x11')][_0xfec4('0xf')]);}})['catch'](function(_0x37cfdf){logger[_0xfec4('0xd')](_0xfec4('0x12'),_0x185f98,_0x37cfdf);_0x1433a7(_0x37cfdf);});});} \ No newline at end of file +var _0x410f=['request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x410f,0x1ea));var _0xf410=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x410f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf410('0x0'));var moment=require(_0xf410('0x1'));var BPromise=require(_0xf410('0x2'));var rs=require(_0xf410('0x3'));var fs=require('fs');var Redis=require(_0xf410('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf410('0x5'));var logger=require(_0xf410('0x6'))(_0xf410('0x7'));var config=require(_0xf410('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf410('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x566271,_0x4e8319,_0x77ae6){return new BPromise(function(_0x265e76,_0x536ab1){return client[_0xf410('0xa')](_0x566271,_0x77ae6)[_0xf410('0xb')](function(_0x39604e){logger[_0xf410('0xc')](_0xf410('0xd'),_0x4e8319,_0xf410('0xe'));logger[_0xf410('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4e8319,_0xf410('0xe'),JSON['stringify'](_0x39604e));if(_0x39604e[_0xf410('0x10')]){if(_0x39604e['error']['code']===0x1f4){logger[_0xf410('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4e8319,_0x39604e[_0xf410('0x10')][_0xf410('0x11')]);return _0x536ab1(_0x39604e[_0xf410('0x10')][_0xf410('0x11')]);}logger[_0xf410('0x10')](_0xf410('0xd'),_0x4e8319,_0x39604e[_0xf410('0x10')]['message']);return _0x265e76(_0x39604e['error'][_0xf410('0x11')]);}else{logger[_0xf410('0xc')](_0xf410('0xd'),_0x4e8319,_0xf410('0xe'));_0x265e76(_0x39604e[_0xf410('0x12')][_0xf410('0x11')]);}})[_0xf410('0x13')](function(_0x229a44){logger['error'](_0xf410('0xd'),_0x4e8319,_0x229a44);_0x536ab1(_0x229a44);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 90118f6..af7b4d3 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 _0x2af0=['post','isAuthenticated','create','put','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x14a931,_0x1f3f0f){var _0x4340b4=function(_0x4075de){while(--_0x4075de){_0x14a931['push'](_0x14a931['shift']());}};_0x4340b4(++_0x1f3f0f);}(_0x2af0,0x1be));var _0x02af=function(_0x27176b,_0x153e67){_0x27176b=_0x27176b-0x0;var _0x54ad37=_0x2af0[_0x27176b];return _0x54ad37;};'use strict';var multer=require(_0x02af('0x0'));var util=require(_0x02af('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x02af('0x2')]();var fs_extra=require(_0x02af('0x3'));var auth=require(_0x02af('0x4'));var interaction=require(_0x02af('0x5'));var config=require(_0x02af('0x6'));var controller=require(_0x02af('0x7'));router[_0x02af('0x8')]('/',auth['isAuthenticated'](),controller[_0x02af('0x9')]);router[_0x02af('0x8')](_0x02af('0xa'),auth['isAuthenticated'](),controller[_0x02af('0xb')]);router[_0x02af('0x8')](_0x02af('0xc'),auth['isAuthenticated'](),controller[_0x02af('0xd')]);router[_0x02af('0x8')](_0x02af('0xe'),auth['isAuthenticated'](),controller[_0x02af('0xf')]);router[_0x02af('0x10')]('/',auth[_0x02af('0x11')](),controller[_0x02af('0x12')]);router[_0x02af('0x13')](_0x02af('0xc'),auth[_0x02af('0x11')](),controller[_0x02af('0x14')]);router['delete'](_0x02af('0xc'),auth[_0x02af('0x11')](),controller['destroy']);module[_0x02af('0x15')]=router; \ No newline at end of file +var _0x6867=['post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x6867,0x1a8));var _0x7686=function(_0x4d61e9,_0x2dd865){_0x4d61e9=_0x4d61e9-0x0;var _0x2245eb=_0x6867[_0x4d61e9];return _0x2245eb;};'use strict';var multer=require(_0x7686('0x0'));var util=require('util');var path=require(_0x7686('0x1'));var timeout=require(_0x7686('0x2'));var express=require(_0x7686('0x3'));var router=express[_0x7686('0x4')]();var fs_extra=require(_0x7686('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7686('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x7686('0x7')]('/',auth[_0x7686('0x8')](),controller[_0x7686('0x9')]);router['get'](_0x7686('0xa'),auth['isAuthenticated'](),controller[_0x7686('0xb')]);router['get'](_0x7686('0xc'),auth[_0x7686('0x8')](),controller[_0x7686('0xd')]);router['get'](_0x7686('0xe'),auth['isAuthenticated'](),controller[_0x7686('0xf')]);router[_0x7686('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7686('0x11')](_0x7686('0xc'),auth[_0x7686('0x8')](),controller[_0x7686('0x12')]);router[_0x7686('0x13')](_0x7686('0xc'),auth[_0x7686('0x8')](),controller[_0x7686('0x14')]);module[_0x7686('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 29ba485..0393db5 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 _0x2c04=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','setDataValue','starttime','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c04,0x13b));var _0x42c0=function(_0x526311,_0x3ba0e7){_0x526311=_0x526311-0x0;var _0x46679a=_0x2c04[_0x526311];return _0x46679a;};'use strict';var moment=require('moment');var Sequelize=require(_0x42c0('0x0'));module[_0x42c0('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5ed1f9){this[_0x42c0('0x2')](_0x42c0('0x3'),_0x5ed1f9);this[_0x42c0('0x2')]('endtime',moment()[_0x42c0('0x4')](_0x42c0('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x42c0('0x6')]},'projectname':{'type':Sequelize[_0x42c0('0x6')]},'queue':{'type':Sequelize[_0x42c0('0x6')]},'uniqueid':{'type':Sequelize[_0x42c0('0x6')]},'calleridname':{'type':Sequelize[_0x42c0('0x6')]},'calleridnum':{'type':Sequelize[_0x42c0('0x6')]},'completed':{'type':Sequelize[_0x42c0('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xb7de=['sequelize','exports','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xb7de,0xc7));var _0xeb7d=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xb7de[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xeb7d('0x0'));var Sequelize=require(_0xeb7d('0x1'));module[_0xeb7d('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x170bd9){this[_0xeb7d('0x3')](_0xeb7d('0x4'),_0x170bd9);this[_0xeb7d('0x3')](_0xeb7d('0x5'),moment()['format'](_0xeb7d('0x6')));}},'endtime':{'type':Sequelize[_0xeb7d('0x7')]},'membername':{'type':Sequelize[_0xeb7d('0x8')]},'projectname':{'type':Sequelize[_0xeb7d('0x8')]},'queue':{'type':Sequelize[_0xeb7d('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeb7d('0x8')]},'completed':{'type':Sequelize[_0xeb7d('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 2e97833..21b0cb2 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 _0x12df=['describe','SessionId','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','JscriptySessionReport','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','params','rawAttributes','include','find','create','body'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x12df,0xfd));var _0xf12d=function(_0x198e4f,_0x44811a){_0x198e4f=_0x198e4f-0x0;var _0x5baa5f=_0x12df[_0x198e4f];return _0x5baa5f;};'use strict';var emlformat=require(_0xf12d('0x0'));var rimraf=require(_0xf12d('0x1'));var zipdir=require(_0xf12d('0x2'));var jsonpatch=require(_0xf12d('0x3'));var rp=require(_0xf12d('0x4'));var moment=require(_0xf12d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf12d('0x6'));var path=require(_0xf12d('0x7'));var sox=require(_0xf12d('0x8'));var csv=require(_0xf12d('0x9'));var ejs=require(_0xf12d('0xa'));var fs=require('fs');var fs_extra=require(_0xf12d('0xb'));var _=require(_0xf12d('0xc'));var squel=require(_0xf12d('0xd'));var crypto=require(_0xf12d('0xe'));var jsforce=require(_0xf12d('0xf'));var deskjs=require(_0xf12d('0x10'));var toCsv=require(_0xf12d('0x9'));var querystring=require(_0xf12d('0x11'));var Papa=require('papaparse');var Redis=require(_0xf12d('0x12'));var authService=require(_0xf12d('0x13'));var qs=require(_0xf12d('0x14'));var as=require(_0xf12d('0x15'));var hardwareService=require(_0xf12d('0x16'));var logger=require(_0xf12d('0x17'))(_0xf12d('0x18'));var utils=require(_0xf12d('0x19'));var config=require(_0xf12d('0x1a'));var licenseUtil=require(_0xf12d('0x1b'));var db=require(_0xf12d('0x1c'))['db'];function respondWithStatusCode(_0x2a712b,_0x17b903){_0x17b903=_0x17b903||0xcc;return function(_0x1d3e95){if(_0x1d3e95){return _0x2a712b['sendStatus'](_0x17b903);}return _0x2a712b['status'](_0x17b903)[_0xf12d('0x1d')]();};}function respondWithResult(_0x5d6a79,_0x45bd7c){_0x45bd7c=_0x45bd7c||0xc8;return function(_0x96c31f){if(_0x96c31f){return _0x5d6a79[_0xf12d('0x1e')](_0x45bd7c)[_0xf12d('0x1f')](_0x96c31f);}};}function respondWithFilteredResult(_0x40b7cd,_0xa83328){return function(_0x36d6e8){if(_0x36d6e8){var _0x4bdca7=typeof _0xa83328['offset']===_0xf12d('0x20')&&typeof _0xa83328['limit']===_0xf12d('0x20');var _0x5c303a=_0x36d6e8[_0xf12d('0x21')];var _0x4e7ed2=_0x4bdca7?0x0:_0xa83328[_0xf12d('0x22')];var _0x1a2449=_0x4bdca7?_0x36d6e8[_0xf12d('0x21')]:_0xa83328['offset']+_0xa83328[_0xf12d('0x23')];var _0x4ba232;if(_0x1a2449>=_0x5c303a){_0x1a2449=_0x5c303a;_0x4ba232=0xc8;}else{_0x4ba232=0xce;}_0x40b7cd[_0xf12d('0x1e')](_0x4ba232);return _0x40b7cd['set'](_0xf12d('0x24'),_0x4e7ed2+'-'+_0x1a2449+'/'+_0x5c303a)[_0xf12d('0x1f')](_0x36d6e8);}return null;};}function patchUpdates(_0x5c47fb){return function(_0x42ee09){try{jsonpatch[_0xf12d('0x25')](_0x42ee09,_0x5c47fb,!![]);}catch(_0x4d5fe4){return BPromise[_0xf12d('0x26')](_0x4d5fe4);}return _0x42ee09[_0xf12d('0x27')]();};}function saveUpdates(_0x5ec1fd,_0x47018b){return function(_0x109f61){if(_0x109f61){return _0x109f61[_0xf12d('0x28')](_0x5ec1fd)[_0xf12d('0x29')](function(_0x118b36){return _0x118b36;});}return null;};}function removeEntity(_0x5949b2,_0x168957){return function(_0x2ddef5){if(_0x2ddef5){return _0x2ddef5[_0xf12d('0x2a')]()[_0xf12d('0x29')](function(){_0x5949b2[_0xf12d('0x1e')](0xcc)[_0xf12d('0x1d')]();});}};}function handleEntityNotFound(_0x4230da,_0x4df53e){return function(_0x2f83cc){if(!_0x2f83cc){_0x4230da[_0xf12d('0x2b')](0x194);}return _0x2f83cc;};}function handleError(_0x15d6c7,_0x5535d1){_0x5535d1=_0x5535d1||0x1f4;return function(_0x2b1d3e){logger['error'](_0x2b1d3e[_0xf12d('0x2c')]);if(_0x2b1d3e[_0xf12d('0x2d')]){delete _0x2b1d3e[_0xf12d('0x2d')];}_0x15d6c7[_0xf12d('0x1e')](_0x5535d1)[_0xf12d('0x2e')](_0x2b1d3e);};}exports[_0xf12d('0x2f')]=function(_0x439b54,_0xaa07e7){var _0x1c5c92={},_0x3ece92={},_0x49b208={'count':0x0,'rows':[]};var _0x644221=_['map'](db[_0xf12d('0x30')]['rawAttributes'],function(_0x29dc24){return{'name':_0x29dc24[_0xf12d('0x31')],'type':_0x29dc24['type'][_0xf12d('0x32')]};});_0x3ece92['model']=_[_0xf12d('0x33')](_0x644221,_0xf12d('0x2d'));_0x3ece92['query']=_[_0xf12d('0x34')](_0x439b54[_0xf12d('0x35')]);_0x3ece92[_0xf12d('0x36')]=_[_0xf12d('0x37')](_0x3ece92[_0xf12d('0x38')],_0x3ece92[_0xf12d('0x35')]);_0x1c5c92['attributes']=_[_0xf12d('0x37')](_0x3ece92[_0xf12d('0x38')],qs[_0xf12d('0x39')](_0x439b54[_0xf12d('0x35')][_0xf12d('0x39')]));_0x1c5c92[_0xf12d('0x3a')]=_0x1c5c92[_0xf12d('0x3a')][_0xf12d('0x3b')]?_0x1c5c92[_0xf12d('0x3a')]:_0x3ece92['model'];if(!_0x439b54[_0xf12d('0x35')][_0xf12d('0x3c')](_0xf12d('0x3d'))){_0x1c5c92['limit']=qs[_0xf12d('0x23')](_0x439b54[_0xf12d('0x35')]['limit']);_0x1c5c92[_0xf12d('0x22')]=qs[_0xf12d('0x22')](_0x439b54['query'][_0xf12d('0x22')]);}_0x1c5c92[_0xf12d('0x3e')]=qs[_0xf12d('0x3f')](_0x439b54[_0xf12d('0x35')]['sort']);_0x1c5c92[_0xf12d('0x40')]=qs[_0xf12d('0x36')](_[_0xf12d('0x41')](_0x439b54['query'],_0x3ece92[_0xf12d('0x36')]),_0x644221);if(_0x439b54['query']['filter']){_0x1c5c92[_0xf12d('0x40')]=_[_0xf12d('0x42')](_0x1c5c92[_0xf12d('0x40')],{'$or':_[_0xf12d('0x33')](_0x644221,function(_0x56ce0f){if(_0x56ce0f['type']!==_0xf12d('0x43')){var _0x30a9d0={};_0x30a9d0[_0x56ce0f[_0xf12d('0x2d')]]={'$like':'%'+_0x439b54['query'][_0xf12d('0x44')]+'%'};return _0x30a9d0;}})});}_0x1c5c92=_[_0xf12d('0x42')]({},_0x1c5c92,_0x439b54[_0xf12d('0x45')]);var _0x538e49={'where':_0x1c5c92[_0xf12d('0x40')]};return db['JscriptySessionReport'][_0xf12d('0x21')](_0x538e49)[_0xf12d('0x29')](function(_0x130e98){_0x49b208[_0xf12d('0x21')]=_0x130e98;if(_0x439b54['query'][_0xf12d('0x46')]){_0x1c5c92['include']=[{'all':!![]}];}return db[_0xf12d('0x30')]['findAll'](_0x1c5c92);})[_0xf12d('0x29')](function(_0x506892){_0x49b208['rows']=_0x506892;return _0x49b208;})['then'](respondWithFilteredResult(_0xaa07e7,_0x1c5c92))[_0xf12d('0x47')](handleError(_0xaa07e7,null));};exports[_0xf12d('0x48')]=function(_0x5a1f47,_0x3d2d06){var _0x17e29d={'raw':!![],'where':{'id':_0x5a1f47[_0xf12d('0x49')]['id']}},_0x559d88={};_0x559d88[_0xf12d('0x38')]=_['keys'](db[_0xf12d('0x30')][_0xf12d('0x4a')]);_0x559d88['query']=_[_0xf12d('0x34')](_0x5a1f47[_0xf12d('0x35')]);_0x559d88['filters']=_[_0xf12d('0x37')](_0x559d88[_0xf12d('0x38')],_0x559d88[_0xf12d('0x35')]);_0x17e29d[_0xf12d('0x3a')]=_[_0xf12d('0x37')](_0x559d88[_0xf12d('0x38')],qs[_0xf12d('0x39')](_0x5a1f47[_0xf12d('0x35')][_0xf12d('0x39')]));_0x17e29d[_0xf12d('0x3a')]=_0x17e29d[_0xf12d('0x3a')]['length']?_0x17e29d[_0xf12d('0x3a')]:_0x559d88[_0xf12d('0x38')];if(_0x5a1f47[_0xf12d('0x35')][_0xf12d('0x46')]){_0x17e29d[_0xf12d('0x4b')]=[{'all':!![]}];}_0x17e29d=_[_0xf12d('0x42')]({},_0x17e29d,_0x5a1f47[_0xf12d('0x45')]);return db[_0xf12d('0x30')][_0xf12d('0x4c')](_0x17e29d)[_0xf12d('0x29')](handleEntityNotFound(_0x3d2d06,null))[_0xf12d('0x29')](respondWithResult(_0x3d2d06,null))[_0xf12d('0x47')](handleError(_0x3d2d06,null));};exports[_0xf12d('0x4d')]=function(_0x4adb96,_0x448390){return db[_0xf12d('0x30')]['create'](_0x4adb96[_0xf12d('0x4e')],{})[_0xf12d('0x29')](respondWithResult(_0x448390,0xc9))[_0xf12d('0x47')](handleError(_0x448390,null));};exports[_0xf12d('0x28')]=function(_0x50f467,_0x27650d){if(_0x50f467[_0xf12d('0x4e')]['id']){delete _0x50f467[_0xf12d('0x4e')]['id'];}return db[_0xf12d('0x30')][_0xf12d('0x4c')]({'where':{'id':_0x50f467['params']['id']}})['then'](handleEntityNotFound(_0x27650d,null))[_0xf12d('0x29')](saveUpdates(_0x50f467[_0xf12d('0x4e')],null))[_0xf12d('0x29')](respondWithResult(_0x27650d,null))[_0xf12d('0x47')](handleError(_0x27650d,null));};exports[_0xf12d('0x2a')]=function(_0x37077b,_0x36266f){return db['JscriptySessionReport'][_0xf12d('0x4c')]({'where':{'id':_0x37077b[_0xf12d('0x49')]['id']}})['then'](handleEntityNotFound(_0x36266f,null))['then'](removeEntity(_0x36266f,null))[_0xf12d('0x47')](handleError(_0x36266f,null));};exports['describe']=function(_0x593b3e,_0x4d10e5){return db['JscriptySessionReport'][_0xf12d('0x4f')]()['then'](respondWithResult(_0x4d10e5,null))[_0xf12d('0x47')](handleError(_0x4d10e5,null));};exports['getQuestions']=function(_0x248e3f,_0x1ffef0,_0x495752){var _0x1e3dc8={'raw':!![],'where':{}};var _0x5cb7bf={};var _0x20fd87={'count':0x0,'rows':[]};return db[_0xf12d('0x30')]['findOne']({'where':{'id':_0x248e3f['params']['id']}})['then'](handleEntityNotFound(_0x1ffef0,null))[_0xf12d('0x29')](function(_0x564dc7){if(_0x564dc7){_0x5cb7bf['model']=_[_0xf12d('0x34')](db['JscriptyQuestionReport'][_0xf12d('0x4a')]);_0x5cb7bf[_0xf12d('0x35')]=_[_0xf12d('0x34')](_0x248e3f['query']);_0x5cb7bf[_0xf12d('0x36')]=_['intersection'](_0x5cb7bf[_0xf12d('0x38')],_0x5cb7bf[_0xf12d('0x35')]);_0x1e3dc8[_0xf12d('0x3a')]=_[_0xf12d('0x37')](_0x5cb7bf['model'],qs[_0xf12d('0x39')](_0x248e3f[_0xf12d('0x35')][_0xf12d('0x39')]));_0x1e3dc8['attributes']=_0x1e3dc8[_0xf12d('0x3a')][_0xf12d('0x3b')]?_0x1e3dc8[_0xf12d('0x3a')]:_0x5cb7bf[_0xf12d('0x38')];if(!_0x248e3f['query'][_0xf12d('0x3c')](_0xf12d('0x3d'))){_0x1e3dc8[_0xf12d('0x23')]=qs['limit'](_0x248e3f[_0xf12d('0x35')][_0xf12d('0x23')]);_0x1e3dc8[_0xf12d('0x22')]=qs[_0xf12d('0x22')](_0x248e3f[_0xf12d('0x35')][_0xf12d('0x22')]);}_0x1e3dc8[_0xf12d('0x3e')]=qs[_0xf12d('0x3f')](_0x248e3f[_0xf12d('0x35')][_0xf12d('0x3f')]);_0x1e3dc8[_0xf12d('0x40')]=qs[_0xf12d('0x36')](_[_0xf12d('0x41')](_0x248e3f[_0xf12d('0x35')],_0x5cb7bf[_0xf12d('0x36')]));_0x1e3dc8[_0xf12d('0x40')][_0xf12d('0x50')]=_0x564dc7['id'];if(_0x248e3f[_0xf12d('0x35')][_0xf12d('0x44')]){_0x1e3dc8['where']=_[_0xf12d('0x42')](_0x1e3dc8[_0xf12d('0x40')],{'$or':_['map'](_0x1e3dc8[_0xf12d('0x3a')],function(_0x2c673f){var _0x8f0251={};_0x8f0251[_0x2c673f]={'$like':'%'+_0x248e3f[_0xf12d('0x35')][_0xf12d('0x44')]+'%'};return _0x8f0251;})});}_0x1e3dc8=_['merge']({},_0x1e3dc8,_0x248e3f[_0xf12d('0x45')]);return db['JscriptyQuestionReport'][_0xf12d('0x21')]({'where':_0x1e3dc8[_0xf12d('0x40')]})['then'](function(_0x185338){_0x20fd87[_0xf12d('0x21')]=_0x185338;if(_0x248e3f['query']['includeAll']){_0x1e3dc8[_0xf12d('0x4b')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf12d('0x51')](_0x1e3dc8);})[_0xf12d('0x29')](function(_0x3b4952){_0x20fd87[_0xf12d('0x52')]=_0x3b4952;return _0x20fd87;});}})['then'](respondWithFilteredResult(_0x1ffef0,_0x1e3dc8))[_0xf12d('0x47')](handleError(_0x1ffef0,null));}; \ No newline at end of file +var _0x7518=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','filters','merge','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','sendStatus','error','name','send','JscriptySessionReport','rawAttributes','type','model','map','keys','query'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x7518,0x149));var _0x8751=function(_0x489b4d,_0x4ddcbe){_0x489b4d=_0x489b4d-0x0;var _0x17f1ba=_0x7518[_0x489b4d];return _0x17f1ba;};'use strict';var emlformat=require(_0x8751('0x0'));var rimraf=require(_0x8751('0x1'));var zipdir=require(_0x8751('0x2'));var jsonpatch=require(_0x8751('0x3'));var rp=require(_0x8751('0x4'));var moment=require(_0x8751('0x5'));var BPromise=require(_0x8751('0x6'));var Mustache=require(_0x8751('0x7'));var util=require('util');var path=require(_0x8751('0x8'));var sox=require('sox');var csv=require(_0x8751('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8751('0xa'));var _=require(_0x8751('0xb'));var squel=require(_0x8751('0xc'));var crypto=require(_0x8751('0xd'));var jsforce=require(_0x8751('0xe'));var deskjs=require(_0x8751('0xf'));var toCsv=require(_0x8751('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8751('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8751('0x11'));var hardwareService=require(_0x8751('0x12'));var logger=require('../../config/logger')(_0x8751('0x13'));var utils=require(_0x8751('0x14'));var config=require(_0x8751('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a5e86,_0x1e2de6){_0x1e2de6=_0x1e2de6||0xcc;return function(_0x36c273){if(_0x36c273){return _0x2a5e86['sendStatus'](_0x1e2de6);}return _0x2a5e86[_0x8751('0x16')](_0x1e2de6)[_0x8751('0x17')]();};}function respondWithResult(_0x7879b7,_0x3fae3f){_0x3fae3f=_0x3fae3f||0xc8;return function(_0x57112f){if(_0x57112f){return _0x7879b7[_0x8751('0x16')](_0x3fae3f)[_0x8751('0x18')](_0x57112f);}};}function respondWithFilteredResult(_0x369d5a,_0x1b5b9b){return function(_0x15d6b2){if(_0x15d6b2){var _0x85381f=typeof _0x1b5b9b['offset']===_0x8751('0x19')&&typeof _0x1b5b9b[_0x8751('0x1a')]==='undefined';var _0x3b3766=_0x15d6b2[_0x8751('0x1b')];var _0x26b76c=_0x85381f?0x0:_0x1b5b9b[_0x8751('0x1c')];var _0x119ee2=_0x85381f?_0x15d6b2['count']:_0x1b5b9b[_0x8751('0x1c')]+_0x1b5b9b['limit'];var _0x44315b;if(_0x119ee2>=_0x3b3766){_0x119ee2=_0x3b3766;_0x44315b=0xc8;}else{_0x44315b=0xce;}_0x369d5a['status'](_0x44315b);return _0x369d5a[_0x8751('0x1d')]('Content-Range',_0x26b76c+'-'+_0x119ee2+'/'+_0x3b3766)['json'](_0x15d6b2);}return null;};}function patchUpdates(_0x41dbb9){return function(_0x31781e){try{jsonpatch[_0x8751('0x1e')](_0x31781e,_0x41dbb9,!![]);}catch(_0x1f1153){return BPromise[_0x8751('0x1f')](_0x1f1153);}return _0x31781e[_0x8751('0x20')]();};}function saveUpdates(_0x1d012b,_0x23349f){return function(_0x15996f){if(_0x15996f){return _0x15996f[_0x8751('0x21')](_0x1d012b)['then'](function(_0x372bdd){return _0x372bdd;});}return null;};}function removeEntity(_0x232084,_0x110658){return function(_0x41b480){if(_0x41b480){return _0x41b480[_0x8751('0x22')]()['then'](function(){_0x232084['status'](0xcc)[_0x8751('0x17')]();});}};}function handleEntityNotFound(_0x56e228,_0x106c5f){return function(_0x9ac476){if(!_0x9ac476){_0x56e228[_0x8751('0x23')](0x194);}return _0x9ac476;};}function handleError(_0x506fca,_0x3f420c){_0x3f420c=_0x3f420c||0x1f4;return function(_0x3222b9){logger[_0x8751('0x24')](_0x3222b9['stack']);if(_0x3222b9['name']){delete _0x3222b9[_0x8751('0x25')];}_0x506fca[_0x8751('0x16')](_0x3f420c)[_0x8751('0x26')](_0x3222b9);};}exports['index']=function(_0x3c83bb,_0x1d4bb6){var _0x2677ec={},_0x35c52d={},_0xe8a8a7={'count':0x0,'rows':[]};var _0x18c2a1=_['map'](db[_0x8751('0x27')][_0x8751('0x28')],function(_0x511a78){return{'name':_0x511a78['fieldName'],'type':_0x511a78[_0x8751('0x29')]['key']};});_0x35c52d[_0x8751('0x2a')]=_[_0x8751('0x2b')](_0x18c2a1,_0x8751('0x25'));_0x35c52d['query']=_[_0x8751('0x2c')](_0x3c83bb[_0x8751('0x2d')]);_0x35c52d['filters']=_[_0x8751('0x2e')](_0x35c52d['model'],_0x35c52d[_0x8751('0x2d')]);_0x2677ec[_0x8751('0x2f')]=_['intersection'](_0x35c52d[_0x8751('0x2a')],qs[_0x8751('0x30')](_0x3c83bb['query'][_0x8751('0x30')]));_0x2677ec[_0x8751('0x2f')]=_0x2677ec['attributes'][_0x8751('0x31')]?_0x2677ec[_0x8751('0x2f')]:_0x35c52d['model'];if(!_0x3c83bb['query'][_0x8751('0x32')](_0x8751('0x33'))){_0x2677ec[_0x8751('0x1a')]=qs['limit'](_0x3c83bb[_0x8751('0x2d')][_0x8751('0x1a')]);_0x2677ec[_0x8751('0x1c')]=qs[_0x8751('0x1c')](_0x3c83bb[_0x8751('0x2d')]['offset']);}_0x2677ec[_0x8751('0x34')]=qs[_0x8751('0x35')](_0x3c83bb['query'][_0x8751('0x35')]);_0x2677ec['where']=qs['filters'](_['pick'](_0x3c83bb[_0x8751('0x2d')],_0x35c52d['filters']),_0x18c2a1);if(_0x3c83bb[_0x8751('0x2d')][_0x8751('0x36')]){_0x2677ec['where']=_['merge'](_0x2677ec[_0x8751('0x37')],{'$or':_[_0x8751('0x2b')](_0x18c2a1,function(_0x2add24){if(_0x2add24[_0x8751('0x29')]!==_0x8751('0x38')){var _0x4450de={};_0x4450de[_0x2add24[_0x8751('0x25')]]={'$like':'%'+_0x3c83bb[_0x8751('0x2d')][_0x8751('0x36')]+'%'};return _0x4450de;}})});}_0x2677ec=_['merge']({},_0x2677ec,_0x3c83bb[_0x8751('0x39')]);var _0x4df315={'where':_0x2677ec[_0x8751('0x37')]};return db[_0x8751('0x27')][_0x8751('0x1b')](_0x4df315)[_0x8751('0x3a')](function(_0x102109){_0xe8a8a7[_0x8751('0x1b')]=_0x102109;if(_0x3c83bb[_0x8751('0x2d')][_0x8751('0x3b')]){_0x2677ec[_0x8751('0x3c')]=[{'all':!![]}];}return db[_0x8751('0x27')][_0x8751('0x3d')](_0x2677ec);})[_0x8751('0x3a')](function(_0x346741){_0xe8a8a7[_0x8751('0x3e')]=_0x346741;return _0xe8a8a7;})['then'](respondWithFilteredResult(_0x1d4bb6,_0x2677ec))[_0x8751('0x3f')](handleError(_0x1d4bb6,null));};exports['show']=function(_0x4de8d0,_0x4c4a35){var _0x59b343={'raw':!![],'where':{'id':_0x4de8d0[_0x8751('0x40')]['id']}},_0x293ac2={};_0x293ac2[_0x8751('0x2a')]=_['keys'](db[_0x8751('0x27')]['rawAttributes']);_0x293ac2['query']=_[_0x8751('0x2c')](_0x4de8d0[_0x8751('0x2d')]);_0x293ac2[_0x8751('0x41')]=_[_0x8751('0x2e')](_0x293ac2[_0x8751('0x2a')],_0x293ac2['query']);_0x59b343['attributes']=_[_0x8751('0x2e')](_0x293ac2[_0x8751('0x2a')],qs['fields'](_0x4de8d0[_0x8751('0x2d')]['fields']));_0x59b343['attributes']=_0x59b343['attributes'][_0x8751('0x31')]?_0x59b343[_0x8751('0x2f')]:_0x293ac2['model'];if(_0x4de8d0[_0x8751('0x2d')][_0x8751('0x3b')]){_0x59b343[_0x8751('0x3c')]=[{'all':!![]}];}_0x59b343=_[_0x8751('0x42')]({},_0x59b343,_0x4de8d0[_0x8751('0x39')]);return db[_0x8751('0x27')][_0x8751('0x43')](_0x59b343)[_0x8751('0x3a')](handleEntityNotFound(_0x4c4a35,null))[_0x8751('0x3a')](respondWithResult(_0x4c4a35,null))[_0x8751('0x3f')](handleError(_0x4c4a35,null));};exports[_0x8751('0x44')]=function(_0x37a854,_0x5330e8){return db[_0x8751('0x27')][_0x8751('0x44')](_0x37a854['body'],{})[_0x8751('0x3a')](respondWithResult(_0x5330e8,0xc9))[_0x8751('0x3f')](handleError(_0x5330e8,null));};exports[_0x8751('0x21')]=function(_0x54f1aa,_0xb79f62){if(_0x54f1aa[_0x8751('0x45')]['id']){delete _0x54f1aa[_0x8751('0x45')]['id'];}return db[_0x8751('0x27')]['find']({'where':{'id':_0x54f1aa['params']['id']}})[_0x8751('0x3a')](handleEntityNotFound(_0xb79f62,null))[_0x8751('0x3a')](saveUpdates(_0x54f1aa[_0x8751('0x45')],null))[_0x8751('0x3a')](respondWithResult(_0xb79f62,null))[_0x8751('0x3f')](handleError(_0xb79f62,null));};exports[_0x8751('0x22')]=function(_0x3a49b7,_0x4415d3){return db[_0x8751('0x27')][_0x8751('0x43')]({'where':{'id':_0x3a49b7[_0x8751('0x40')]['id']}})[_0x8751('0x3a')](handleEntityNotFound(_0x4415d3,null))[_0x8751('0x3a')](removeEntity(_0x4415d3,null))[_0x8751('0x3f')](handleError(_0x4415d3,null));};exports[_0x8751('0x46')]=function(_0x1b5df1,_0x42ffdd){return db[_0x8751('0x27')][_0x8751('0x46')]()[_0x8751('0x3a')](respondWithResult(_0x42ffdd,null))[_0x8751('0x3f')](handleError(_0x42ffdd,null));};exports[_0x8751('0x47')]=function(_0x14f75a,_0x142162,_0x535d88){var _0x2b4f2e={'raw':!![],'where':{}};var _0x190c04={};var _0x19e8d0={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x8751('0x48')]({'where':{'id':_0x14f75a[_0x8751('0x40')]['id']}})[_0x8751('0x3a')](handleEntityNotFound(_0x142162,null))[_0x8751('0x3a')](function(_0x298642){if(_0x298642){_0x190c04[_0x8751('0x2a')]=_[_0x8751('0x2c')](db[_0x8751('0x49')][_0x8751('0x28')]);_0x190c04[_0x8751('0x2d')]=_[_0x8751('0x2c')](_0x14f75a[_0x8751('0x2d')]);_0x190c04['filters']=_[_0x8751('0x2e')](_0x190c04[_0x8751('0x2a')],_0x190c04['query']);_0x2b4f2e[_0x8751('0x2f')]=_[_0x8751('0x2e')](_0x190c04[_0x8751('0x2a')],qs[_0x8751('0x30')](_0x14f75a[_0x8751('0x2d')][_0x8751('0x30')]));_0x2b4f2e[_0x8751('0x2f')]=_0x2b4f2e[_0x8751('0x2f')][_0x8751('0x31')]?_0x2b4f2e[_0x8751('0x2f')]:_0x190c04['model'];if(!_0x14f75a['query'][_0x8751('0x32')](_0x8751('0x33'))){_0x2b4f2e[_0x8751('0x1a')]=qs[_0x8751('0x1a')](_0x14f75a[_0x8751('0x2d')][_0x8751('0x1a')]);_0x2b4f2e['offset']=qs[_0x8751('0x1c')](_0x14f75a[_0x8751('0x2d')][_0x8751('0x1c')]);}_0x2b4f2e[_0x8751('0x34')]=qs[_0x8751('0x35')](_0x14f75a['query'][_0x8751('0x35')]);_0x2b4f2e[_0x8751('0x37')]=qs[_0x8751('0x41')](_['pick'](_0x14f75a['query'],_0x190c04[_0x8751('0x41')]));_0x2b4f2e[_0x8751('0x37')][_0x8751('0x4a')]=_0x298642['id'];if(_0x14f75a[_0x8751('0x2d')][_0x8751('0x36')]){_0x2b4f2e[_0x8751('0x37')]=_[_0x8751('0x42')](_0x2b4f2e[_0x8751('0x37')],{'$or':_[_0x8751('0x2b')](_0x2b4f2e[_0x8751('0x2f')],function(_0x43654f){var _0x1df778={};_0x1df778[_0x43654f]={'$like':'%'+_0x14f75a[_0x8751('0x2d')]['filter']+'%'};return _0x1df778;})});}_0x2b4f2e=_['merge']({},_0x2b4f2e,_0x14f75a[_0x8751('0x39')]);return db['JscriptyQuestionReport']['count']({'where':_0x2b4f2e['where']})['then'](function(_0x2d1b29){_0x19e8d0['count']=_0x2d1b29;if(_0x14f75a['query'][_0x8751('0x3b')]){_0x2b4f2e['include']=[{'all':!![]}];}return db[_0x8751('0x49')][_0x8751('0x3d')](_0x2b4f2e);})[_0x8751('0x3a')](function(_0x8aa424){_0x19e8d0[_0x8751('0x3e')]=_0x8aa424;return _0x19e8d0;});}})[_0x8751('0x3a')](respondWithFilteredResult(_0x142162,_0x2b4f2e))[_0x8751('0x3f')](handleError(_0x142162,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index cfad50b..f632cfe 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 _0x814b=['define','JscriptySessionReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x5935e4,_0x39480b){var _0x550285=function(_0x5f4022){while(--_0x5f4022){_0x5935e4['push'](_0x5935e4['shift']());}};_0x550285(++_0x39480b);}(_0x814b,0x1a2));var _0xb814=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x814b[_0x2bfd4f];return _0x341849;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x449b2a,_0x5154c4){var _0x5c0ec2=function(_0x4bfd4d){while(--_0x4bfd4d){_0x449b2a['push'](_0x449b2a['shift']());}};_0x5c0ec2(++_0x5154c4);}(_0x8ca9,0x9c));var _0x98ca=function(_0xcf6659,_0x250ea1){_0xcf6659=_0xcf6659-0x0;var _0x2eaa0f=_0x8ca9[_0xcf6659];return _0x2eaa0f;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('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 7a17d08..a18f5ea 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 _0x7b84=['jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5cd231,_0x2f32b6){var _0x5204d7=function(_0x180122){while(--_0x180122){_0x5cd231['push'](_0x5cd231['shift']());}};_0x5204d7(++_0x2f32b6);}(_0x7b84,0x17c));var _0x47b8=function(_0x3e2d18,_0x6bba0c){_0x3e2d18=_0x3e2d18-0x0;var _0x32cae9=_0x7b84[_0x3e2d18];return _0x32cae9;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});} \ No newline at end of file +var _0x7278=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x53627f,_0xe20d61){var _0x4cb8e6=function(_0x57b02c){while(--_0x57b02c){_0x53627f['push'](_0x53627f['shift']());}};_0x4cb8e6(++_0xe20d61);}(_0x7278,0x161));var _0x8727=function(_0x1e8f06,_0x4c3815){_0x1e8f06=_0x1e8f06-0x0;var _0x4f8c16=_0x7278[_0x1e8f06];return _0x4f8c16;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd1902,_0x2f491c,_0xffd783){return new BPromise(function(_0x435911,_0x4160c3){return client['request'](_0xfd1902,_0xffd783)['then'](function(_0x4df6f8){logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));logger[_0x8727('0xf')](_0x8727('0x10'),_0x2f491c,_0x8727('0xe'),JSON[_0x8727('0x11')](_0x4df6f8));if(_0x4df6f8[_0x8727('0x12')]){if(_0x4df6f8['error'][_0x8727('0x13')]===0x1f4){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8['error'][_0x8727('0x14')]);return _0x4160c3(_0x4df6f8[_0x8727('0x12')]['message']);}logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);return _0x435911(_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);}else{logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));_0x435911(_0x4df6f8[_0x8727('0x15')]['message']);}})[_0x8727('0x16')](function(_0x1f9538){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x1f9538);_0x4160c3(_0x1f9538);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d8f497b..47e4c09 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 _0x8c39=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','index','put','isAuthenticated','exports','multer','path'];(function(_0x259126,_0x5b2e92){var _0x12db5c=function(_0x4f6772){while(--_0x4f6772){_0x259126['push'](_0x259126['shift']());}};_0x12db5c(++_0x5b2e92);}(_0x8c39,0x1df));var _0x98c3=function(_0x46112c,_0x49489c){_0x46112c=_0x46112c-0x0;var _0x53a0a1=_0x8c39[_0x46112c];return _0x53a0a1;};'use strict';var multer=require(_0x98c3('0x0'));var util=require('util');var path=require(_0x98c3('0x1'));var timeout=require(_0x98c3('0x2'));var express=require(_0x98c3('0x3'));var router=express[_0x98c3('0x4')]();var fs_extra=require(_0x98c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98c3('0x6'));var config=require(_0x98c3('0x7'));var controller=require(_0x98c3('0x8'));router['get']('/',controller[_0x98c3('0x9')]);router[_0x98c3('0xa')]('/:id',auth[_0x98c3('0xb')](),controller['update']);module[_0x98c3('0xc')]=router; \ No newline at end of file +var _0x1b69=['update','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated'];(function(_0xe81598,_0x53502e){var _0x1b3e01=function(_0x5017d5){while(--_0x5017d5){_0xe81598['push'](_0xe81598['shift']());}};_0x1b3e01(++_0x53502e);}(_0x1b69,0x1d0));var _0x91b6=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x1b69[_0x53cf8e];return _0x459197;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91b6('0x0'));var express=require(_0x91b6('0x1'));var router=express[_0x91b6('0x2')]();var fs_extra=require(_0x91b6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var controller=require(_0x91b6('0x6'));router[_0x91b6('0x7')]('/',controller[_0x91b6('0x8')]);router[_0x91b6('0x9')](_0x91b6('0xa'),auth[_0x91b6('0xb')](),controller[_0x91b6('0xc')]);module[_0x91b6('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 aaae86e..eb3daae 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 _0xdf3a=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf3a,0x1aa));var _0xadf3=function(_0x1c933e,_0x2c492d){_0x1c933e=_0x1c933e-0x0;var _0x2773db=_0xdf3a[_0x1c933e];return _0x2773db;};'use strict';var Sequelize=require(_0xadf3('0x0'));module[_0xadf3('0x1')]={'license':{'type':Sequelize[_0xadf3('0x2')]},'data1':{'type':Sequelize[_0xadf3('0x3')]},'data2':{'type':Sequelize[_0xadf3('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xadf3('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f43=['exports','TEXT','STRING','INTEGER'];(function(_0x5be8db,_0x1f198f){var _0x2e8b8b=function(_0x3c9905){while(--_0x3c9905){_0x5be8db['push'](_0x5be8db['shift']());}};_0x2e8b8b(++_0x1f198f);}(_0x3f43,0x128));var _0x33f4=function(_0x385931,_0x4985b5){_0x385931=_0x385931-0x0;var _0x18e90e=_0x3f43[_0x385931];return _0x18e90e;};'use strict';var Sequelize=require('sequelize');module[_0x33f4('0x0')]={'license':{'type':Sequelize[_0x33f4('0x1')]},'data1':{'type':Sequelize[_0x33f4('0x2')]},'data2':{'type':Sequelize[_0x33f4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x33f4('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 a83adeb..9c8be19 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 _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x3e7e1d,_0x2306e3){var _0x1604d7=function(_0x15484e){while(--_0x15484e){_0x3e7e1d['push'](_0x3e7e1d['shift']());}};_0x1604d7(++_0x2306e3);}(_0x1967,0x173));var _0x7196=function(_0x5ab8c7,_0x148bba){_0x5ab8c7=_0x5ab8c7-0x0;var _0x213bab=_0x1967[_0x5ab8c7];return _0x213bab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file +var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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'];(function(_0x3996b3,_0x4f5b18){var _0x3925a6=function(_0x2ce925){while(--_0x2ce925){_0x3996b3['push'](_0x3996b3['shift']());}};_0x3925a6(++_0x4f5b18);}(_0x4975,0x86));var _0x5497=function(_0x55bd02,_0x44dfe4){_0x55bd02=_0x55bd02-0x0;var _0x29fb43=_0x4975[_0x55bd02];return _0x29fb43;};'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);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7936e25..bb3ff14 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 _0xceee=['../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17d581,_0x55ec2a){var _0x137ab8=function(_0x1e9b15){while(--_0x1e9b15){_0x17d581['push'](_0x17d581['shift']());}};_0x137ab8(++_0x55ec2a);}(_0xceee,0x172));var _0xecee=function(_0x3b1536,_0x42742f){_0x3b1536=_0x3b1536-0x0;var _0x3cb6bb=_0xceee[_0x3b1536];return _0x3cb6bb;};'use strict';var _=require(_0xecee('0x0'));var util=require('util');var logger=require(_0xecee('0x1'))(_0xecee('0x2'));var moment=require(_0xecee('0x3'));var BPromise=require(_0xecee('0x4'));var rp=require(_0xecee('0x5'));var fs=require('fs');var path=require(_0xecee('0x6'));var rimraf=require(_0xecee('0x7'));var config=require(_0xecee('0x8'));var attributes=require(_0xecee('0x9'));module[_0xecee('0xa')]=function(_0x485066,_0x31bb48){return _0x485066[_0xecee('0xb')](_0xecee('0xc'),attributes,{'tableName':_0xecee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b0=['exports','define','License','license','../../config/logger','api','moment','bluebird','request-promise','./license.attributes'];(function(_0x2f8bc6,_0x4dc869){var _0x2d008a=function(_0x276072){while(--_0x276072){_0x2f8bc6['push'](_0x2f8bc6['shift']());}};_0x2d008a(++_0x4dc869);}(_0x04b0,0x162));var _0x004b=function(_0x2a6eaa,_0x313fa3){_0x2a6eaa=_0x2a6eaa-0x0;var _0x41d30d=_0x04b0[_0x2a6eaa];return _0x41d30d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x004b('0x0'))(_0x004b('0x1'));var moment=require(_0x004b('0x2'));var BPromise=require(_0x004b('0x3'));var rp=require(_0x004b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x004b('0x5'));module[_0x004b('0x6')]=function(_0xe0fc4e,_0x24b181){return _0xe0fc4e[_0x004b('0x7')](_0x004b('0x8'),attributes,{'tableName':_0x004b('0x9'),'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 a02d751..d6f2c47 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 _0xcec8=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x78aeb1,_0x3f04af){var _0x27ec0f=function(_0x477fb7){while(--_0x477fb7){_0x78aeb1['push'](_0x78aeb1['shift']());}};_0x27ec0f(++_0x3f04af);}(_0xcec8,0x19a));var _0x8cec=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xcec8[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x8cec('0x0'));var util=require(_0x8cec('0x1'));var moment=require(_0x8cec('0x2'));var BPromise=require(_0x8cec('0x3'));var rs=require(_0x8cec('0x4'));var fs=require('fs');var Redis=require(_0x8cec('0x5'));var db=require(_0x8cec('0x6'))['db'];var utils=require(_0x8cec('0x7'));var logger=require(_0x8cec('0x8'))(_0x8cec('0x9'));var config=require(_0x8cec('0xa'));var jayson=require(_0x8cec('0xb'));var client=jayson[_0x8cec('0xc')][_0x8cec('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x32fa17,_0x2988a3,_0xa2c139){return new BPromise(function(_0x551dd4,_0x57d9e5){return client[_0x8cec('0xe')](_0x32fa17,_0xa2c139)[_0x8cec('0xf')](function(_0x2a8c3e){logger['info'](_0x8cec('0x10'),_0x2988a3,_0x8cec('0x11'));logger[_0x8cec('0x12')](_0x8cec('0x13'),_0x2988a3,_0x8cec('0x11'),JSON[_0x8cec('0x14')](_0x2a8c3e));if(_0x2a8c3e[_0x8cec('0x15')]){if(_0x2a8c3e[_0x8cec('0x15')][_0x8cec('0x16')]===0x1f4){logger[_0x8cec('0x15')](_0x8cec('0x10'),_0x2988a3,_0x2a8c3e[_0x8cec('0x15')][_0x8cec('0x17')]);return _0x57d9e5(_0x2a8c3e[_0x8cec('0x15')][_0x8cec('0x17')]);}logger[_0x8cec('0x15')](_0x8cec('0x10'),_0x2988a3,_0x2a8c3e[_0x8cec('0x15')][_0x8cec('0x17')]);return _0x551dd4(_0x2a8c3e[_0x8cec('0x15')][_0x8cec('0x17')]);}else{logger[_0x8cec('0x18')](_0x8cec('0x10'),_0x2988a3,'request\x20sent');_0x551dd4(_0x2a8c3e[_0x8cec('0x19')][_0x8cec('0x17')]);}})[_0x8cec('0x1a')](function(_0x3576ab){logger[_0x8cec('0x15')](_0x8cec('0x10'),_0x2988a3,_0x3576ab);_0x57d9e5(_0x3576ab);});});} \ No newline at end of file +var _0x3126=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37f16f,_0xef887e){var _0x3d4af8=function(_0x5e3a9c){while(--_0x5e3a9c){_0x37f16f['push'](_0x37f16f['shift']());}};_0x3d4af8(++_0xef887e);}(_0x3126,0x138));var _0x6312=function(_0x561ccb,_0x2243c5){_0x561ccb=_0x561ccb-0x0;var _0x49634f=_0x3126[_0x561ccb];return _0x49634f;};'use strict';var _=require('lodash');var util=require(_0x6312('0x0'));var moment=require(_0x6312('0x1'));var BPromise=require(_0x6312('0x2'));var rs=require(_0x6312('0x3'));var fs=require('fs');var Redis=require(_0x6312('0x4'));var db=require(_0x6312('0x5'))['db'];var utils=require(_0x6312('0x6'));var logger=require(_0x6312('0x7'))(_0x6312('0x8'));var config=require(_0x6312('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6312('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d75c9,_0x1854c6,_0x40357a){return new BPromise(function(_0x585cd0,_0x3b4838){return client[_0x6312('0xb')](_0x4d75c9,_0x40357a)['then'](function(_0x19f142){logger[_0x6312('0xc')](_0x6312('0xd'),_0x1854c6,_0x6312('0xe'));logger[_0x6312('0xf')](_0x6312('0x10'),_0x1854c6,_0x6312('0xe'),JSON[_0x6312('0x11')](_0x19f142));if(_0x19f142[_0x6312('0x12')]){if(_0x19f142[_0x6312('0x12')][_0x6312('0x13')]===0x1f4){logger[_0x6312('0x12')](_0x6312('0xd'),_0x1854c6,_0x19f142[_0x6312('0x12')]['message']);return _0x3b4838(_0x19f142[_0x6312('0x12')]['message']);}logger[_0x6312('0x12')]('License,\x20%s,\x20%s',_0x1854c6,_0x19f142[_0x6312('0x12')][_0x6312('0x14')]);return _0x585cd0(_0x19f142[_0x6312('0x12')]['message']);}else{logger['info'](_0x6312('0xd'),_0x1854c6,_0x6312('0xe'));_0x585cd0(_0x19f142['result'][_0x6312('0x14')]);}})[_0x6312('0x15')](function(_0x3aea81){logger[_0x6312('0x12')](_0x6312('0xd'),_0x1854c6,_0x3aea81);_0x3b4838(_0x3aea81);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index b63fd7d..9b09b20 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 _0xab0a=['show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','addInteraction','/:id/send','send','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id'];(function(_0x20c5b6,_0x3ba264){var _0x2f73bc=function(_0x5ab8b2){while(--_0x5ab8b2){_0x20c5b6['push'](_0x20c5b6['shift']());}};_0x2f73bc(++_0x3ba264);}(_0xab0a,0x154));var _0xaab0=function(_0x4b73f6,_0x1a2fe2){_0x4b73f6=_0x4b73f6-0x0;var _0x1b7c85=_0xab0a[_0x4b73f6];return _0x1b7c85;};'use strict';var multer=require(_0xaab0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaab0('0x1'));var express=require(_0xaab0('0x2'));var router=express[_0xaab0('0x3')]();var fs_extra=require(_0xaab0('0x4'));var auth=require(_0xaab0('0x5'));var interaction=require(_0xaab0('0x6'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xaab0('0x7')]('/',auth[_0xaab0('0x8')](),controller[_0xaab0('0x9')]);router[_0xaab0('0x7')](_0xaab0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xaab0('0x7')](_0xaab0('0xb'),auth[_0xaab0('0x8')](),controller[_0xaab0('0xc')]);router[_0xaab0('0x7')](_0xaab0('0xd'),auth[_0xaab0('0x8')](),controller[_0xaab0('0xe')]);router[_0xaab0('0x7')](_0xaab0('0xf'),auth[_0xaab0('0x8')](),controller['getAnswers']);router[_0xaab0('0x7')](_0xaab0('0x10'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x11')]);router[_0xaab0('0x7')](_0xaab0('0x12'),auth[_0xaab0('0x8')](),controller['getSmtp']);router['get'](_0xaab0('0x13'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x14')]);router[_0xaab0('0x7')](_0xaab0('0x15'),auth['isAuthenticated'](),controller[_0xaab0('0x16')]);router[_0xaab0('0x7')](_0xaab0('0x17'),auth[_0xaab0('0x8')](),controller['getMessages']);router[_0xaab0('0x7')](_0xaab0('0x18'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x19')]);router[_0xaab0('0x7')](_0xaab0('0x1a'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x1b')]);router[_0xaab0('0x1c')]('/:id/dispositions',auth[_0xaab0('0x8')](),controller[_0xaab0('0x1d')]);router[_0xaab0('0x1c')]('/:id/canned_answers',auth[_0xaab0('0x8')](),controller[_0xaab0('0x1e')]);router[_0xaab0('0x1c')]('/',auth[_0xaab0('0x8')](),controller[_0xaab0('0x1f')]);router[_0xaab0('0x1c')](_0xaab0('0x10'),auth[_0xaab0('0x8')](),controller['addImap']);router[_0xaab0('0x1c')](_0xaab0('0x12'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x20')]);router['post'](_0xaab0('0x13'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x21')]);router[_0xaab0('0x1c')](_0xaab0('0x15'),auth[_0xaab0('0x8')](),controller['addApplications']);router['post'](_0xaab0('0x22'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x23')]);router[_0xaab0('0x1c')](_0xaab0('0x1a'),auth[_0xaab0('0x8')](),controller['addAgents']);router[_0xaab0('0x24')]('/:id',auth[_0xaab0('0x8')](),controller[_0xaab0('0x25')]);router['delete'](_0xaab0('0xd'),auth['isAuthenticated'](),controller[_0xaab0('0x26')]);router[_0xaab0('0x27')](_0xaab0('0xf'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x28')]);router[_0xaab0('0x27')](_0xaab0('0x10'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x29')]);router['delete'](_0xaab0('0x12'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x2a')]);router[_0xaab0('0x27')]('/:id',auth[_0xaab0('0x8')](),controller['destroy']);router[_0xaab0('0x27')](_0xaab0('0x1a'),auth[_0xaab0('0x8')](),controller[_0xaab0('0x2b')]);module['exports']=router; \ No newline at end of file +var _0xf684=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getSmtp','/:id/applications','getApplications','getMessages','/:id/verify','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','/:id/interactions','/:id/send','send','addAgents','update','delete','removeAnswers','removeImap','removeSmtp','/:id/users','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x24c1ec,_0x59d5d8){var _0x42ab86=function(_0x2faa74){while(--_0x2faa74){_0x24c1ec['push'](_0x24c1ec['shift']());}};_0x42ab86(++_0x59d5d8);}(_0xf684,0x151));var _0x4f68=function(_0x2aa23f,_0x2e4c9f){_0x2aa23f=_0x2aa23f-0x0;var _0x2ce584=_0xf684[_0x2aa23f];return _0x2ce584;};'use strict';var multer=require(_0x4f68('0x0'));var util=require('util');var path=require(_0x4f68('0x1'));var timeout=require(_0x4f68('0x2'));var express=require('express');var router=express[_0x4f68('0x3')]();var fs_extra=require(_0x4f68('0x4'));var auth=require(_0x4f68('0x5'));var interaction=require(_0x4f68('0x6'));var config=require(_0x4f68('0x7'));var controller=require(_0x4f68('0x8'));router[_0x4f68('0x9')]('/',auth[_0x4f68('0xa')](),controller[_0x4f68('0xb')]);router[_0x4f68('0x9')](_0x4f68('0xc'),auth[_0x4f68('0xa')](),controller[_0x4f68('0xd')]);router[_0x4f68('0x9')](_0x4f68('0xe'),auth[_0x4f68('0xa')](),controller[_0x4f68('0xf')]);router['get'](_0x4f68('0x10'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x11')]);router[_0x4f68('0x9')](_0x4f68('0x12'),auth[_0x4f68('0xa')](),controller['getAnswers']);router['get']('/:id/in_servers',auth[_0x4f68('0xa')](),controller['getImap']);router[_0x4f68('0x9')]('/:id/out_servers',auth[_0x4f68('0xa')](),controller[_0x4f68('0x13')]);router[_0x4f68('0x9')]('/:id/interactions',auth[_0x4f68('0xa')](),controller['getInteractions']);router['get'](_0x4f68('0x14'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x15')]);router[_0x4f68('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x4f68('0x16')]);router['get'](_0x4f68('0x17'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x4f68('0x9')]('/:id/users',auth[_0x4f68('0xa')](),controller[_0x4f68('0x18')]);router[_0x4f68('0x19')](_0x4f68('0x10'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x1a')]);router['post'](_0x4f68('0x12'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x1b')]);router[_0x4f68('0x19')]('/',auth[_0x4f68('0xa')](),controller[_0x4f68('0x1c')]);router['post'](_0x4f68('0x1d'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x1e')]);router['post'](_0x4f68('0x1f'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x20')]);router[_0x4f68('0x19')](_0x4f68('0x21'),auth[_0x4f68('0xa')](),controller['addInteraction']);router[_0x4f68('0x19')](_0x4f68('0x14'),auth[_0x4f68('0xa')](),controller['addApplications']);router['post'](_0x4f68('0x22'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x23')]);router[_0x4f68('0x19')]('/:id/users',auth[_0x4f68('0xa')](),controller[_0x4f68('0x24')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4f68('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x4f68('0x26')](_0x4f68('0x12'),auth['isAuthenticated'](),controller[_0x4f68('0x27')]);router[_0x4f68('0x26')](_0x4f68('0x1d'),auth[_0x4f68('0xa')](),controller[_0x4f68('0x28')]);router[_0x4f68('0x26')](_0x4f68('0x1f'),auth['isAuthenticated'](),controller[_0x4f68('0x29')]);router[_0x4f68('0x26')](_0x4f68('0xe'),auth[_0x4f68('0xa')](),controller['destroy']);router['delete'](_0x4f68('0x2a'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4f68('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 60ace01..f93227f 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 _0xa1a5=['sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x44f1cb,_0x4bc512){var _0x5444d7=function(_0xcabdcd){while(--_0xcabdcd){_0x44f1cb['push'](_0x44f1cb['shift']());}};_0x5444d7(++_0x4bc512);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x35ba2,_0x540919){_0x35ba2=_0x35ba2-0x0;var _0x3536b8=_0xa1a5[_0x35ba2];return _0x3536b8;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'description':{'type':Sequelize[_0x5a1a('0x1')]},'name':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5a1a('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x5a1a('0x3')]},'markAsUnread':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':![],'defaultValue':_0x5a1a('0x4')},'fontSize':{'type':Sequelize[_0x5a1a('0x5')](0x2)[_0x5a1a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5a1a('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a1a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a1a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a1a('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a1a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a1a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x5a1a('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5a1a('0x8'),'set':function(_0x27baef){if(!_0x27baef)this[_0x5a1a('0x9')]('mandatoryDispositionPauseId',null);this[_0x5a1a('0x9')]('mandatoryDisposition',_0x27baef);}}}; \ No newline at end of file +var _0xfd7b=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports'];(function(_0x5f4ca0,_0x54ab89){var _0x3f4253=function(_0x1cf1d7){while(--_0x1cf1d7){_0x5f4ca0['push'](_0x5f4ca0['shift']());}};_0x3f4253(++_0x54ab89);}(_0xfd7b,0x1df));var _0xbfd7=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xfd7b[_0xb1cf84];return _0x4bad2e;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'description':{'type':Sequelize[_0xbfd7('0x1')]},'name':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbfd7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xbfd7('0x3')]},'markAsUnread':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![],'defaultValue':_0xbfd7('0x4')},'fontSize':{'type':Sequelize[_0xbfd7('0x5')](0x2)[_0xbfd7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbfd7('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbfd7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53ad21){if(!_0x53ad21)this[_0xbfd7('0x9')](_0xbfd7('0xa'),null);this[_0xbfd7('0x9')](_0xbfd7('0xb'),_0x53ad21);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 903c430..e1dd900 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 _0x4241=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailAccount.socket','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','apply','reject','save','then','get','MailAccounts','UserProfileResource','destroy','end','name','send','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','keys','length','find','body','params','update','describe','addDisposition','MailAccountId','Disposition','findOne','filter','findAll','removeDispositions','ids','addAnswer','create','getAnswers','CannedAnswer','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','List','Contacts','from','format','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','html-to-text','ioredis'];(function(_0x458ed3,_0x5980a3){var _0x69d3ff=function(_0x511352){while(--_0x511352){_0x458ed3['push'](_0x458ed3['shift']());}};_0x69d3ff(++_0x5980a3);}(_0x4241,0x17d));var _0x1424=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x4241[_0x1eda20];return _0x31b953;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1424('0x0'));var jsonpatch=require(_0x1424('0x1'));var rp=require(_0x1424('0x2'));var moment=require(_0x1424('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1424('0x4'));var util=require(_0x1424('0x5'));var path=require(_0x1424('0x6'));var sox=require(_0x1424('0x7'));var csv=require(_0x1424('0x8'));var ejs=require(_0x1424('0x9'));var fs=require('fs');var fs_extra=require(_0x1424('0xa'));var _=require(_0x1424('0xb'));var squel=require(_0x1424('0xc'));var crypto=require(_0x1424('0xd'));var jsforce=require(_0x1424('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1424('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x1424('0xf'));var juice=require('juice');var Redis=require(_0x1424('0x10'));var authService=require(_0x1424('0x11'));var qs=require(_0x1424('0x12'));var as=require(_0x1424('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1424('0x14'));var utils=require('../../config/utils');var config=require(_0x1424('0x15'));var licenseUtil=require(_0x1424('0x16'));var db=require('../../mysqldb')['db'];config[_0x1424('0x17')]=_['defaults'](config['redis'],{'host':_0x1424('0x18'),'port':0x18eb});var socket=require(_0x1424('0x19'))(new Redis(config[_0x1424('0x17')]));require(_0x1424('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1424('0x1b')][_0x1424('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0xb7414d,_0x151917,_0x25937f,_0x39d36c){return new BPromise(function(_0x528942,_0x28ff04){var _0x522b9b=_0x39d36c||client;return _0x522b9b[_0x1424('0x1d')](_0xb7414d,_0x25937f)['then'](function(_0x41b1d9){logger[_0x1424('0x1e')](_0x1424('0x1f'),_0x151917,_0x1424('0x20'));logger[_0x1424('0x21')](_0x1424('0x22'),_0x151917,_0x1424('0x20'),JSON[_0x1424('0x23')](_0x41b1d9));if(_0x41b1d9[_0x1424('0x24')]){if(_0x41b1d9[_0x1424('0x24')][_0x1424('0x25')]===0x1f4){logger[_0x1424('0x24')](_0x1424('0x1f'),_0x151917,_0x41b1d9[_0x1424('0x24')][_0x1424('0x26')]);return _0x28ff04(_0x41b1d9[_0x1424('0x24')][_0x1424('0x26')]);}logger[_0x1424('0x24')](_0x1424('0x1f'),_0x151917,_0x41b1d9['error'][_0x1424('0x26')]);return _0x528942(_0x41b1d9['error'][_0x1424('0x26')]);}else{logger[_0x1424('0x1e')]('MailAccount,\x20%s,\x20%s',_0x151917,_0x1424('0x20'));_0x528942(_0x41b1d9[_0x1424('0x27')]['message']);}})[_0x1424('0x28')](function(_0x2f700e){logger[_0x1424('0x24')](_0x1424('0x1f'),_0x151917,_0x2f700e);_0x28ff04(_0x2f700e);});});}function respondWithStatusCode(_0x5c0993,_0x2ffbfa){_0x2ffbfa=_0x2ffbfa||0xcc;return function(_0x584a29){if(_0x584a29){return _0x5c0993[_0x1424('0x29')](_0x2ffbfa);}return _0x5c0993[_0x1424('0x2a')](_0x2ffbfa)['end']();};}function respondWithResult(_0x5eb568,_0x34eb15){_0x34eb15=_0x34eb15||0xc8;return function(_0x33c6c9){if(_0x33c6c9){return _0x5eb568['status'](_0x34eb15)['json'](_0x33c6c9);}};}function respondWithFilteredResult(_0x298c8c,_0x3a27d2){return function(_0x1e6e99){if(_0x1e6e99){var _0x13e938=typeof _0x3a27d2['offset']===_0x1424('0x2b')&&typeof _0x3a27d2[_0x1424('0x2c')]===_0x1424('0x2b');var _0x38c6cd=_0x1e6e99[_0x1424('0x2d')];var _0xe5792a=_0x13e938?0x0:_0x3a27d2['offset'];var _0x4d5f8a=_0x13e938?_0x1e6e99[_0x1424('0x2d')]:_0x3a27d2[_0x1424('0x2e')]+_0x3a27d2[_0x1424('0x2c')];var _0x31c468;if(_0x4d5f8a>=_0x38c6cd){_0x4d5f8a=_0x38c6cd;_0x31c468=0xc8;}else{_0x31c468=0xce;}_0x298c8c['status'](_0x31c468);return _0x298c8c[_0x1424('0x2f')]('Content-Range',_0xe5792a+'-'+_0x4d5f8a+'/'+_0x38c6cd)['json'](_0x1e6e99);}return null;};}function patchUpdates(_0x530c19){return function(_0x4ae79a){try{jsonpatch[_0x1424('0x30')](_0x4ae79a,_0x530c19,!![]);}catch(_0x401bf7){return BPromise[_0x1424('0x31')](_0x401bf7);}return _0x4ae79a[_0x1424('0x32')]();};}function saveUpdates(_0x1e570d,_0x39b085){return function(_0x463dfb){if(_0x463dfb){return _0x463dfb['update'](_0x1e570d)[_0x1424('0x33')](function(_0x5315b3){return _0x5315b3;});}return null;};}function removeEntity(_0x3ad2aa,_0x401880){return function(_0x57162c){if(_0x57162c){return _0x57162c['destroy']()[_0x1424('0x33')](function(){var _0x2c5054=_0x57162c[_0x1424('0x34')]({'plain':!![]});var _0x1de16e=_0x1424('0x35');return db[_0x1424('0x36')][_0x1424('0x37')]({'where':{'type':_0x1de16e,'resourceId':_0x2c5054['id']}})['then'](function(){return _0x57162c;});})[_0x1424('0x33')](function(){_0x3ad2aa[_0x1424('0x2a')](0xcc)[_0x1424('0x38')]();});}};}function handleEntityNotFound(_0x346132,_0x3819db){return function(_0x173eb6){if(!_0x173eb6){_0x346132[_0x1424('0x29')](0x194);}return _0x173eb6;};}function handleError(_0x2cbf6c,_0x25abfd){_0x25abfd=_0x25abfd||0x1f4;return function(_0x512203){logger[_0x1424('0x24')](_0x512203['stack']);if(_0x512203[_0x1424('0x39')]){delete _0x512203[_0x1424('0x39')];}_0x2cbf6c[_0x1424('0x2a')](_0x25abfd)[_0x1424('0x3a')](_0x512203);};}exports['index']=function(_0x5544f0,_0xbfe4a7){var _0x5e14be={'include':[{'model':db[_0x1424('0x3b')],'as':_0x1424('0x3c')},{'model':db[_0x1424('0x3d')],'as':_0x1424('0x3e')},{'model':db[_0x1424('0x3f')],'as':_0x1424('0x40')}]},_0x1e8cbe={},_0x308906={'count':0x0,'rows':[]};var _0x3249bc=_[_0x1424('0x41')](db[_0x1424('0x42')][_0x1424('0x43')],function(_0x3f5620){return{'name':_0x3f5620[_0x1424('0x44')],'type':_0x3f5620[_0x1424('0x45')][_0x1424('0x46')]};});_0x1e8cbe[_0x1424('0x47')]=_[_0x1424('0x41')](_0x3249bc,'name');_0x1e8cbe[_0x1424('0x48')]=_['keys'](_0x5544f0[_0x1424('0x48')]);_0x1e8cbe[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x1e8cbe[_0x1424('0x47')],_0x1e8cbe['query']);_0x5e14be[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x1e8cbe[_0x1424('0x47')],qs[_0x1424('0x4c')](_0x5544f0['query'][_0x1424('0x4c')]));_0x5e14be[_0x1424('0x4b')]=_0x5e14be[_0x1424('0x4b')]['length']?_0x5e14be[_0x1424('0x4b')]:_0x1e8cbe[_0x1424('0x47')];if(!_0x5544f0[_0x1424('0x48')][_0x1424('0x4d')](_0x1424('0x4e'))){_0x5e14be[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0x5544f0['query'][_0x1424('0x2c')]);_0x5e14be['offset']=qs[_0x1424('0x2e')](_0x5544f0[_0x1424('0x48')][_0x1424('0x2e')]);}_0x5e14be[_0x1424('0x4f')]=qs['sort'](_0x5544f0[_0x1424('0x48')][_0x1424('0x50')]);_0x5e14be[_0x1424('0x51')]=qs[_0x1424('0x49')](_[_0x1424('0x52')](_0x5544f0[_0x1424('0x48')],_0x1e8cbe[_0x1424('0x49')]),_0x3249bc);if(_0x5544f0[_0x1424('0x48')]['filter']){_0x5e14be['where']=_['merge'](_0x5e14be[_0x1424('0x51')],{'$or':_[_0x1424('0x41')](_0x3249bc,function(_0x26a858){if(_0x26a858[_0x1424('0x45')]!==_0x1424('0x53')){var _0x38495d={};_0x38495d[_0x26a858['name']]={'$like':'%'+_0x5544f0['query']['filter']+'%'};return _0x38495d;}})});}_0x5e14be=_[_0x1424('0x54')]({},_0x5e14be,_0x5544f0[_0x1424('0x55')]);var _0x1cabe4={'where':_0x5e14be[_0x1424('0x51')]};return db[_0x1424('0x42')][_0x1424('0x2d')](_0x1cabe4)[_0x1424('0x33')](function(_0x5c82e9){_0x308906['count']=_0x5c82e9;if(_0x5544f0[_0x1424('0x48')][_0x1424('0x56')]){_0x5e14be[_0x1424('0x57')]=[{'all':!![]}];}return db[_0x1424('0x42')]['findAll'](_0x5e14be);})[_0x1424('0x33')](function(_0x4cfe0d){_0x308906[_0x1424('0x58')]=_0x4cfe0d;return _0x308906;})[_0x1424('0x33')](respondWithFilteredResult(_0xbfe4a7,_0x5e14be))[_0x1424('0x28')](handleError(_0xbfe4a7,null));};exports['show']=function(_0x3b6d67,_0x4f6ac4){var _0x1202ac={'raw':![],'where':{'id':_0x3b6d67['params']['id']},'include':[{'model':db[_0x1424('0x3b')],'as':_0x1424('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1424('0x3f')],'as':_0x1424('0x40')}]},_0x22520={};_0x22520['model']=_[_0x1424('0x59')](db[_0x1424('0x42')][_0x1424('0x43')]);_0x22520[_0x1424('0x48')]=_[_0x1424('0x59')](_0x3b6d67[_0x1424('0x48')]);_0x22520[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x22520['model'],_0x22520[_0x1424('0x48')]);_0x1202ac[_0x1424('0x4b')]=_['intersection'](_0x22520['model'],qs[_0x1424('0x4c')](_0x3b6d67[_0x1424('0x48')]['fields']));_0x1202ac[_0x1424('0x4b')]=_0x1202ac['attributes'][_0x1424('0x5a')]?_0x1202ac[_0x1424('0x4b')]:_0x22520[_0x1424('0x47')];if(_0x3b6d67[_0x1424('0x48')][_0x1424('0x56')]){_0x1202ac[_0x1424('0x57')]=[{'all':!![]}];}_0x1202ac=_['merge']({},_0x1202ac,_0x3b6d67[_0x1424('0x55')]);return db[_0x1424('0x42')][_0x1424('0x5b')](_0x1202ac)[_0x1424('0x33')](handleEntityNotFound(_0x4f6ac4,null))[_0x1424('0x33')](respondWithResult(_0x4f6ac4,null))['catch'](handleError(_0x4f6ac4,null));};exports['update']=function(_0x22c880,_0x4aa1b0){if(_0x22c880[_0x1424('0x5c')]['id']){delete _0x22c880[_0x1424('0x5c')]['id'];}return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x22c880[_0x1424('0x5d')]['id']},'include':[{'model':db[_0x1424('0x3b')],'as':_0x1424('0x3c')},{'model':db[_0x1424('0x3d')],'as':_0x1424('0x3e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1424('0x33')](handleEntityNotFound(_0x4aa1b0,null))[_0x1424('0x33')](saveUpdates(_0x22c880[_0x1424('0x5c')],null))[_0x1424('0x33')](function(_0x38a69e){if(_0x38a69e&&_0x22c880[_0x1424('0x5c')][_0x1424('0x3c')]){return db[_0x1424('0x3b')][_0x1424('0x5e')](_0x22c880[_0x1424('0x5c')]['Imap'],{'where':{'MailAccountId':_0x38a69e['id']}})[_0x1424('0x33')](function(){return _0x38a69e;});}return _0x38a69e;})[_0x1424('0x33')](function(_0x40a7c7){if(_0x40a7c7&&_0x22c880[_0x1424('0x5c')]['Smtp']){return db['MailServerOut']['update'](_0x22c880['body'][_0x1424('0x3e')],{'where':{'MailAccountId':_0x40a7c7['id']}})['then'](function(){return _0x40a7c7;});}return _0x40a7c7;})[_0x1424('0x33')](respondWithResult(_0x4aa1b0,null))[_0x1424('0x28')](handleError(_0x4aa1b0,null));};exports[_0x1424('0x5f')]=function(_0x458b98,_0x1a010c){return db[_0x1424('0x42')][_0x1424('0x5f')]()['then'](respondWithResult(_0x1a010c,null))[_0x1424('0x28')](handleError(_0x1a010c,null));};exports[_0x1424('0x60')]=function(_0x52a440,_0x29503a,_0x45a4bc){if(_0x52a440['body']['id']){delete _0x52a440[_0x1424('0x5c')]['id'];}return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x52a440['params']['id']}})['then'](handleEntityNotFound(_0x29503a,null))[_0x1424('0x33')](function(_0xebf53a){if(_0xebf53a){_0x52a440[_0x1424('0x5c')][_0x1424('0x61')]=_0xebf53a['id'];return db[_0x1424('0x62')]['create'](_0x52a440[_0x1424('0x5c')]);}})[_0x1424('0x33')](respondWithResult(_0x29503a,null))[_0x1424('0x28')](handleError(_0x29503a,null));};exports['getDispositions']=function(_0xa9f82e,_0x1b971d,_0x535b1c){var _0x5041b2={'raw':![],'where':{}};var _0x14baff={};var _0x16b3c2={'count':0x0,'rows':[]};return db['MailAccount'][_0x1424('0x63')]({'where':{'id':_0xa9f82e[_0x1424('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b971d,null))['then'](function(_0x4f342f){if(_0x4f342f){_0x14baff[_0x1424('0x47')]=_[_0x1424('0x59')](db[_0x1424('0x62')]['rawAttributes']);_0x14baff[_0x1424('0x48')]=_['keys'](_0xa9f82e[_0x1424('0x48')]);_0x14baff[_0x1424('0x49')]=_['intersection'](_0x14baff[_0x1424('0x47')],_0x14baff['query']);_0x5041b2[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x14baff[_0x1424('0x47')],qs[_0x1424('0x4c')](_0xa9f82e[_0x1424('0x48')][_0x1424('0x4c')]));_0x5041b2[_0x1424('0x4b')]=_0x5041b2[_0x1424('0x4b')][_0x1424('0x5a')]?_0x5041b2[_0x1424('0x4b')]:_0x14baff['model'];if(!_0xa9f82e['query'][_0x1424('0x4d')](_0x1424('0x4e'))){_0x5041b2[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0xa9f82e[_0x1424('0x48')][_0x1424('0x2c')]);_0x5041b2[_0x1424('0x2e')]=qs[_0x1424('0x2e')](_0xa9f82e[_0x1424('0x48')][_0x1424('0x2e')]);}_0x5041b2[_0x1424('0x4f')]=qs[_0x1424('0x50')](_0xa9f82e[_0x1424('0x48')]['sort']);_0x5041b2[_0x1424('0x51')]=qs[_0x1424('0x49')](_[_0x1424('0x52')](_0xa9f82e['query'],_0x14baff[_0x1424('0x49')]));_0x5041b2[_0x1424('0x51')][_0x1424('0x61')]=_0x4f342f['id'];if(_0xa9f82e[_0x1424('0x48')][_0x1424('0x64')]){_0x5041b2[_0x1424('0x51')]=_[_0x1424('0x54')](_0x5041b2[_0x1424('0x51')],{'$or':_[_0x1424('0x41')](_0x5041b2[_0x1424('0x4b')],function(_0x36c4c1){var _0x6c5eb0={};_0x6c5eb0[_0x36c4c1]={'$like':'%'+_0xa9f82e['query'][_0x1424('0x64')]+'%'};return _0x6c5eb0;})});}_0x5041b2=_[_0x1424('0x54')]({},_0x5041b2,_0xa9f82e[_0x1424('0x55')]);return db[_0x1424('0x62')]['count']({'where':_0x5041b2[_0x1424('0x51')]})['then'](function(_0xa0c6c5){_0x16b3c2[_0x1424('0x2d')]=_0xa0c6c5;if(_0xa9f82e[_0x1424('0x48')][_0x1424('0x56')]){_0x5041b2[_0x1424('0x57')]=[{'all':!![]}];}return db[_0x1424('0x62')][_0x1424('0x65')](_0x5041b2);})[_0x1424('0x33')](function(_0x25a888){_0x16b3c2[_0x1424('0x58')]=_0x25a888;return _0x16b3c2;});}})['then'](respondWithFilteredResult(_0x1b971d,_0x5041b2))[_0x1424('0x28')](handleError(_0x1b971d,null));};exports['removeDispositions']=function(_0x37f8aa,_0x43c671,_0x2f88e3){return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x37f8aa[_0x1424('0x5d')]['id']}})['then'](handleEntityNotFound(_0x43c671,null))[_0x1424('0x33')](function(_0x4320dc){if(_0x4320dc){return _0x4320dc[_0x1424('0x66')](_0x37f8aa['query'][_0x1424('0x67')]);}})[_0x1424('0x33')](respondWithStatusCode(_0x43c671,null))[_0x1424('0x28')](handleError(_0x43c671,null));};exports[_0x1424('0x68')]=function(_0x1c1e70,_0x4ca3d8,_0x48a035){if(_0x1c1e70[_0x1424('0x5c')]['id']){delete _0x1c1e70[_0x1424('0x5c')]['id'];}return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x1c1e70[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x4ca3d8,null))['then'](function(_0x33a21b){if(_0x33a21b){_0x1c1e70[_0x1424('0x5c')][_0x1424('0x61')]=_0x33a21b['id'];return db['CannedAnswer'][_0x1424('0x69')](_0x1c1e70[_0x1424('0x5c')]);}})[_0x1424('0x33')](respondWithResult(_0x4ca3d8,null))['catch'](handleError(_0x4ca3d8,null));};exports[_0x1424('0x6a')]=function(_0x13c8e1,_0x3eb11c,_0x4cb63c){var _0x43be52={'raw':![],'where':{}};var _0x1d4695={};var _0x5a438d={'count':0x0,'rows':[]};return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0x13c8e1[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x3eb11c,null))[_0x1424('0x33')](function(_0x4c3f2e){if(_0x4c3f2e){_0x1d4695[_0x1424('0x47')]=_['keys'](db['CannedAnswer'][_0x1424('0x43')]);_0x1d4695[_0x1424('0x48')]=_[_0x1424('0x59')](_0x13c8e1[_0x1424('0x48')]);_0x1d4695[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x1d4695[_0x1424('0x47')],_0x1d4695[_0x1424('0x48')]);_0x43be52[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x1d4695['model'],qs[_0x1424('0x4c')](_0x13c8e1[_0x1424('0x48')][_0x1424('0x4c')]));_0x43be52[_0x1424('0x4b')]=_0x43be52[_0x1424('0x4b')]['length']?_0x43be52[_0x1424('0x4b')]:_0x1d4695[_0x1424('0x47')];if(!_0x13c8e1[_0x1424('0x48')][_0x1424('0x4d')](_0x1424('0x4e'))){_0x43be52[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0x13c8e1['query']['limit']);_0x43be52[_0x1424('0x2e')]=qs[_0x1424('0x2e')](_0x13c8e1[_0x1424('0x48')]['offset']);}_0x43be52[_0x1424('0x4f')]=qs['sort'](_0x13c8e1[_0x1424('0x48')][_0x1424('0x50')]);_0x43be52[_0x1424('0x51')]=qs[_0x1424('0x49')](_[_0x1424('0x52')](_0x13c8e1[_0x1424('0x48')],_0x1d4695[_0x1424('0x49')]));_0x43be52[_0x1424('0x51')][_0x1424('0x61')]=_0x4c3f2e['id'];if(_0x13c8e1[_0x1424('0x48')][_0x1424('0x64')]){_0x43be52[_0x1424('0x51')]=_[_0x1424('0x54')](_0x43be52[_0x1424('0x51')],{'$or':_[_0x1424('0x41')](_0x43be52[_0x1424('0x4b')],function(_0x19b0ec){var _0x38cc99={};_0x38cc99[_0x19b0ec]={'$like':'%'+_0x13c8e1[_0x1424('0x48')][_0x1424('0x64')]+'%'};return _0x38cc99;})});}_0x43be52=_[_0x1424('0x54')]({},_0x43be52,_0x13c8e1['options']);return db[_0x1424('0x6b')][_0x1424('0x2d')]({'where':_0x43be52[_0x1424('0x51')]})[_0x1424('0x33')](function(_0x1f0af9){_0x5a438d[_0x1424('0x2d')]=_0x1f0af9;if(_0x13c8e1[_0x1424('0x48')][_0x1424('0x56')]){_0x43be52[_0x1424('0x57')]=[{'all':!![]}];}return db[_0x1424('0x6b')][_0x1424('0x65')](_0x43be52);})['then'](function(_0x2dc047){_0x5a438d[_0x1424('0x58')]=_0x2dc047;return _0x5a438d;});}})[_0x1424('0x33')](respondWithFilteredResult(_0x3eb11c,_0x43be52))[_0x1424('0x28')](handleError(_0x3eb11c,null));};exports[_0x1424('0x6c')]=function(_0x1da6ad,_0x1e251e,_0x1343e2){return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x1da6ad[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x1e251e,null))['then'](function(_0x48c579){if(_0x48c579){return _0x48c579['removeAnswers'](_0x1da6ad[_0x1424('0x48')][_0x1424('0x67')]);}})['then'](respondWithStatusCode(_0x1e251e,null))[_0x1424('0x28')](handleError(_0x1e251e,null));};exports[_0x1424('0x69')]=function(_0x542417,_0x3a4341){var _0x15f564={'name':_0x542417[_0x1424('0x5c')][_0x1424('0x39')],'key':_0x542417[_0x1424('0x5c')][_0x1424('0x46')],'email':_0x542417[_0x1424('0x5c')]['email'],'ListId':_0x542417[_0x1424('0x5c')][_0x1424('0x6d')],'active':!_[_0x1424('0x6e')](_0x542417['body'][_0x1424('0x6f')])?_0x542417['body'][_0x1424('0x6f')]:!![],'description':_0x542417['body'][_0x1424('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x1424('0x6e')](_0x542417[_0x1424('0x5c')][_0x1424('0x71')])){if(_0x542417[_0x1424('0x5c')][_0x1424('0x72')]){_0x15f564[_0x1424('0x3c')][_0x1424('0x73')]=_0x15f564[_0x1424('0x3e')][_0x1424('0x73')]=_0x542417[_0x1424('0x5c')][_0x1424('0x74')];_0x15f564[_0x1424('0x3c')]['password']=_0x15f564[_0x1424('0x3e')][_0x1424('0x75')]=_0x542417[_0x1424('0x5c')][_0x1424('0x76')];}else{_0x15f564[_0x1424('0x3c')][_0x1424('0x77')]=_0x15f564[_0x1424('0x3e')][_0x1424('0x77')]=![];}_0x15f564[_0x1424('0x3c')][_0x1424('0x78')]=_0x542417['body'][_0x1424('0x3c')][_0x1424('0x78')];_0x15f564[_0x1424('0x3c')][_0x1424('0x79')]=_0x542417[_0x1424('0x5c')][_0x1424('0x3c')][_0x1424('0x79')];_0x15f564['Smtp'][_0x1424('0x78')]=_0x542417[_0x1424('0x5c')][_0x1424('0x3e')]['host'];_0x15f564['Smtp']['port']=_0x542417['body'][_0x1424('0x3e')][_0x1424('0x79')];}else{_0x15f564['Imap'][_0x1424('0x7a')]=_0x15f564[_0x1424('0x3e')][_0x1424('0x7a')]=_0x542417['body'][_0x1424('0x71')];_0x15f564[_0x1424('0x3c')][_0x1424('0x73')]=_0x15f564[_0x1424('0x3e')][_0x1424('0x73')]=_0x542417[_0x1424('0x5c')][_0x1424('0x74')];_0x15f564[_0x1424('0x3c')][_0x1424('0x7b')]=_0x15f564['Smtp']['pass']=_0x542417['body'][_0x1424('0x76')];}return db[_0x1424('0x42')][_0x1424('0x69')](_0x15f564,{'include':[{'model':db[_0x1424('0x3d')],'as':'Smtp'},{'model':db[_0x1424('0x3b')],'as':_0x1424('0x3c')}]})['then'](function(_0x1bfc0d){var _0x5a2076=_0x542417[_0x1424('0x73')]['get']({'plain':!![]});if(!_0x5a2076)throw new Error(_0x1424('0x7c'));if(_0x5a2076[_0x1424('0x7d')]===_0x1424('0x73')){var _0xe47380=_0x1bfc0d[_0x1424('0x34')]({'plain':!![]});return db[_0x1424('0x7e')][_0x1424('0x5b')]({'where':{'name':_0x1424('0x35'),'userProfileId':_0x5a2076['userProfileId']},'raw':!![]})[_0x1424('0x33')](function(_0x1559be){if(_0x1559be&&_0x1559be[_0x1424('0x7f')]===0x0){return db['UserProfileResource'][_0x1424('0x69')]({'name':_0xe47380['name'],'resourceId':_0xe47380['id'],'type':_0x1559be['name'],'sectionId':_0x1559be['id']},{})['then'](function(){return _0x1bfc0d;});}else{return _0x1bfc0d;}})[_0x1424('0x28')](function(_0x48ec1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48ec1e);throw _0x48ec1e;});}return _0x1bfc0d;})[_0x1424('0x33')](respondWithResult(_0x3a4341,0xc9))[_0x1424('0x28')](handleError(_0x3a4341,null));};exports['getImap']=function(_0x40cb9e,_0x581051,_0x4492b8){return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0x40cb9e[_0x1424('0x5d')]['id']}})['then'](handleEntityNotFound(_0x581051,null))[_0x1424('0x33')](function(_0x279747){if(_0x279747){return _0x279747[_0x1424('0x80')]();}return null;})[_0x1424('0x33')](respondWithResult(_0x581051,null))[_0x1424('0x28')](handleError(_0x581051,null));};exports[_0x1424('0x81')]=function(_0x1d28b5,_0x3ea6ac,_0x2bfc14){if(_0x1d28b5[_0x1424('0x5c')]['id']){delete _0x1d28b5[_0x1424('0x5c')]['id'];}return db['MailAccount'][_0x1424('0x5b')]({'where':{'id':_0x1d28b5[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x3ea6ac,null))[_0x1424('0x33')](function(_0x49d8d1){if(_0x49d8d1){_0x1d28b5[_0x1424('0x5c')][_0x1424('0x61')]=_0x49d8d1['id'];return db[_0x1424('0x3b')][_0x1424('0x69')](_0x1d28b5[_0x1424('0x5c')]);}})[_0x1424('0x33')](respondWithResult(_0x3ea6ac,null))[_0x1424('0x28')](handleError(_0x3ea6ac,null));};exports[_0x1424('0x82')]=function(_0x1871e6,_0xe9e3e0,_0x317b60){return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0x1871e6[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0xe9e3e0,null))[_0x1424('0x33')](function(_0x5cb279){if(_0x5cb279){return _0x5cb279[_0x1424('0x83')](null);}return null;})['then'](respondWithStatusCode(_0xe9e3e0,null))[_0x1424('0x28')](handleError(_0xe9e3e0,null));};exports[_0x1424('0x84')]=function(_0x2aa2ed,_0x1eec3a,_0xc55fc1){return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0x2aa2ed[_0x1424('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1eec3a,null))[_0x1424('0x33')](function(_0x580e9f){if(_0x580e9f){return _0x580e9f[_0x1424('0x84')]();}return null;})[_0x1424('0x33')](respondWithResult(_0x1eec3a,null))[_0x1424('0x28')](handleError(_0x1eec3a,null));};exports[_0x1424('0x85')]=function(_0x40dbb2,_0x52b207,_0x6440be){if(_0x40dbb2[_0x1424('0x5c')]['id']){delete _0x40dbb2[_0x1424('0x5c')]['id'];}return db[_0x1424('0x42')]['find']({'where':{'id':_0x40dbb2[_0x1424('0x5d')]['id']}})['then'](handleEntityNotFound(_0x52b207,null))[_0x1424('0x33')](function(_0x5be35d){if(_0x5be35d){_0x40dbb2[_0x1424('0x5c')][_0x1424('0x61')]=_0x5be35d['id'];return db[_0x1424('0x3d')][_0x1424('0x69')](_0x40dbb2[_0x1424('0x5c')]);}})[_0x1424('0x33')](respondWithResult(_0x52b207,null))[_0x1424('0x28')](handleError(_0x52b207,null));};exports[_0x1424('0x86')]=function(_0xed3c2b,_0x15bbd2,_0x190b63){return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0xed3c2b['params']['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x15bbd2,null))[_0x1424('0x33')](function(_0x2afcde){if(_0x2afcde){return _0x2afcde[_0x1424('0x87')](null);}return null;})['then'](respondWithStatusCode(_0x15bbd2,null))[_0x1424('0x28')](handleError(_0x15bbd2,null));};exports[_0x1424('0x88')]=function(_0xcaf133,_0x4c3d40,_0x4e9858){return db[_0x1424('0x89')][_0x1424('0x5b')]({'where':{'id':_0xcaf133[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x4c3d40,null))[_0x1424('0x33')](function(_0x25d6d9){if(_0x25d6d9){return _0x25d6d9['addInteraction'](_0xcaf133[_0x1424('0x5c')]['ids'],_[_0x1424('0x8a')](_0xcaf133[_0x1424('0x5c')],[_0x1424('0x67'),'id'])||{});}})['then'](respondWithResult(_0x4c3d40,null))[_0x1424('0x28')](handleError(_0x4c3d40,null));};exports[_0x1424('0x8b')]=function(_0xd359c9,_0x4c342d,_0x3eadca){var _0x2b23a8={'raw':![],'where':{}};var _0x6f710={};var _0x3e894a={'count':0x0,'rows':[]};return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0xd359c9[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x4c342d,null))[_0x1424('0x33')](function(_0x38b3b8){if(_0x38b3b8){_0x6f710[_0x1424('0x47')]=_[_0x1424('0x59')](db[_0x1424('0x89')][_0x1424('0x43')]);_0x6f710[_0x1424('0x48')]=_[_0x1424('0x59')](_0xd359c9['query']);_0x6f710[_0x1424('0x49')]=_['intersection'](_0x6f710[_0x1424('0x47')],_0x6f710[_0x1424('0x48')]);_0x2b23a8[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x6f710[_0x1424('0x47')],qs[_0x1424('0x4c')](_0xd359c9[_0x1424('0x48')]['fields']));_0x2b23a8[_0x1424('0x4b')]=_0x2b23a8[_0x1424('0x4b')][_0x1424('0x5a')]?_0x2b23a8[_0x1424('0x4b')]:_0x6f710['model'];if(!_0xd359c9['query']['hasOwnProperty'](_0x1424('0x4e'))){_0x2b23a8[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0xd359c9['query']['limit']);_0x2b23a8['offset']=qs[_0x1424('0x2e')](_0xd359c9[_0x1424('0x48')]['offset']);}_0x2b23a8[_0x1424('0x4f')]=qs[_0x1424('0x50')](_0xd359c9['query'][_0x1424('0x50')]);_0x2b23a8['where']=qs['filters'](_[_0x1424('0x52')](_0xd359c9[_0x1424('0x48')],_0x6f710[_0x1424('0x49')]));_0x2b23a8[_0x1424('0x51')][_0x1424('0x61')]=_0x38b3b8['id'];if(_0xd359c9[_0x1424('0x48')]['filter']){_0x2b23a8['where']=_[_0x1424('0x54')](_0x2b23a8['where'],{'$or':_[_0x1424('0x41')](_0x2b23a8[_0x1424('0x4b')],function(_0x493eed){var _0x4d947d={};_0x4d947d[_0x493eed]={'$like':'%'+_0xd359c9['query'][_0x1424('0x64')]+'%'};return _0x4d947d;})});}_0x2b23a8=_[_0x1424('0x54')]({},_0x2b23a8,_0xd359c9[_0x1424('0x55')]);return db[_0x1424('0x89')][_0x1424('0x2d')]({'where':_0x2b23a8[_0x1424('0x51')]})[_0x1424('0x33')](function(_0x434eb5){_0x3e894a[_0x1424('0x2d')]=_0x434eb5;if(_0xd359c9['query'][_0x1424('0x56')]){_0x2b23a8['include']=[{'model':db[_0x1424('0x8c')],'as':'Contact','required':![]},{'model':db[_0x1424('0x8d')],'as':_0x1424('0x8e'),'attributes':[_0x1424('0x39'),'fullname',_0x1424('0x8f')],'required':![]},{'model':db['Tag'],'as':_0x1424('0x90'),'attributes':['id',_0x1424('0x39'),_0x1424('0x91')],'where':_0xd359c9[_0x1424('0x48')]['tag']?{'id':_0xd359c9['query'][_0x1424('0x92')]}:undefined,'required':_0xd359c9[_0x1424('0x48')][_0x1424('0x92')]?!![]:![]}];}return db[_0x1424('0x89')][_0x1424('0x65')](_0x2b23a8);})[_0x1424('0x33')](function(_0x34d75f){_0x3e894a['rows']=_0x34d75f;return _0x3e894a;});}})[_0x1424('0x33')](respondWithFilteredResult(_0x4c342d,_0x2b23a8))[_0x1424('0x28')](handleError(_0x4c342d,null));};exports[_0x1424('0x93')]=function addApplications(_0x5ab7ec,_0x574ed8){var _0xa08a97=_0x5ab7ec['params']['id'];var _0x226c17=_0x5ab7ec[_0x1424('0x5c')];var _0x1562db=0xc8;var _0x135881=null;return db[_0x1424('0x94')][_0x1424('0x95')]({'isolationLevel':db['sequelize']['Transaction'][_0x1424('0x96')][_0x1424('0x97')]},function(_0x116e7f){return db['MailAccount'][_0x1424('0x63')]({'where':{'id':_0xa08a97},'transaction':_0x116e7f})[_0x1424('0x33')](function(_0x474777){if(_0x474777){return db[_0x1424('0x98')][_0x1424('0x37')]({'where':{'MailAccountId':_0xa08a97},'transaction':_0x116e7f})[_0x1424('0x33')](function(){var _0x5f9ac9=_[_0x1424('0x41')](_0x226c17,function(_0x4919eb){_0x4919eb[_0x1424('0x61')]=_0xa08a97;return _0x4919eb;});return db[_0x1424('0x98')][_0x1424('0x99')](_0x5f9ac9,{'transaction':_0x116e7f});});}else{_0x1562db=0x194;_0x135881=[];}});})[_0x1424('0x33')](function(){if(_0x1562db!==0x194){return db[_0x1424('0x98')][_0x1424('0x9a')]({'where':{'MailAccountId':_0xa08a97},'order':_0x1424('0x9b')})['then'](function(_0x3328c5){_0x135881=_0x3328c5;});}})[_0x1424('0x28')](function(_0x4e36d2){_0x1562db=0x1f4;logger[_0x1424('0x24')](_0x4e36d2['stack']);if(_0x4e36d2[_0x1424('0x39')]){delete _0x4e36d2[_0x1424('0x39')];}_0x135881=_0x4e36d2;})[_0x1424('0x9c')](function(){if(_0x135881===null){_0x574ed8[_0x1424('0x29')](_0x1562db);}else{if(_0x1562db===0x1f4){_0x574ed8['status'](_0x1562db)[_0x1424('0x3a')](_0x135881);}else{_0x574ed8['status'](_0x1562db)[_0x1424('0x9d')](_0x135881);}}});};exports[_0x1424('0x9e')]=function(_0x38a433,_0x38ae5c,_0x3cf3eb){var _0x4e938c={};var _0x1dc850={};var _0x5441a8;var _0x342c8d;return db['MailAccount'][_0x1424('0x63')]({'where':{'id':_0x38a433[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x38ae5c,null))[_0x1424('0x33')](function(_0x19c87d){if(_0x19c87d){_0x5441a8=_0x19c87d;_0x1dc850[_0x1424('0x47')]=_[_0x1424('0x59')](db['MailApplication'][_0x1424('0x43')]);_0x1dc850[_0x1424('0x48')]=_[_0x1424('0x59')](_0x38a433['query']);_0x1dc850[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x1dc850['model'],_0x1dc850[_0x1424('0x48')]);_0x4e938c[_0x1424('0x4b')]=_['intersection'](_0x1dc850['model'],qs[_0x1424('0x4c')](_0x38a433[_0x1424('0x48')][_0x1424('0x4c')]));_0x4e938c['attributes']=_0x4e938c[_0x1424('0x4b')][_0x1424('0x5a')]?_0x4e938c['attributes']:_0x1dc850[_0x1424('0x47')];_0x4e938c[_0x1424('0x4f')]=qs[_0x1424('0x50')](_0x38a433[_0x1424('0x48')][_0x1424('0x50')]);_0x4e938c['where']=qs[_0x1424('0x49')](_[_0x1424('0x52')](_0x38a433[_0x1424('0x48')],_0x1dc850[_0x1424('0x49')]));if(_0x38a433[_0x1424('0x48')]['filter']){_0x4e938c[_0x1424('0x51')]=_[_0x1424('0x54')](_0x4e938c[_0x1424('0x51')],{'$or':_['map'](_0x4e938c['attributes'],function(_0x2a9ac6){var _0x3e7787={};_0x3e7787[_0x2a9ac6]={'$like':'%'+_0x38a433[_0x1424('0x48')][_0x1424('0x64')]+'%'};return _0x3e7787;})});}_0x4e938c=_['merge']({},_0x4e938c,_0x38a433[_0x1424('0x55')]);return _0x5441a8['getApplications'](_0x4e938c);}})[_0x1424('0x33')](function(_0x40a043){if(_0x40a043){_0x342c8d=_0x40a043[_0x1424('0x5a')];if(!_0x38a433[_0x1424('0x48')][_0x1424('0x4d')](_0x1424('0x4e'))){_0x4e938c[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0x38a433[_0x1424('0x48')][_0x1424('0x2c')]);_0x4e938c[_0x1424('0x2e')]=qs[_0x1424('0x2e')](_0x38a433[_0x1424('0x48')][_0x1424('0x2e')]);}return _0x5441a8[_0x1424('0x9e')](_0x4e938c);}})[_0x1424('0x33')](function(_0x372458){if(_0x372458){return _0x372458?{'count':_0x342c8d,'rows':_0x372458}:null;}})[_0x1424('0x33')](respondWithResult(_0x38ae5c,null))['catch'](handleError(_0x38ae5c,null));};exports[_0x1424('0x9f')]=function(_0x1053d1,_0x55f7a2,_0x22f1a8){var _0xa0149b={'raw':!![],'where':{}};var _0x44406e={};var _0x1ec0f4={'count':0x0,'rows':[]};return db[_0x1424('0x42')][_0x1424('0x63')]({'where':{'id':_0x1053d1[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x55f7a2,null))[_0x1424('0x33')](function(_0x166e53){if(_0x166e53){_0x44406e[_0x1424('0x47')]=_[_0x1424('0x59')](db['MailMessage'][_0x1424('0x43')]);_0x44406e[_0x1424('0x48')]=_[_0x1424('0x59')](_0x1053d1[_0x1424('0x48')]);_0x44406e[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x44406e['model'],_0x44406e[_0x1424('0x48')]);_0xa0149b[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x44406e[_0x1424('0x47')],qs[_0x1424('0x4c')](_0x1053d1[_0x1424('0x48')][_0x1424('0x4c')]));_0xa0149b[_0x1424('0x4b')]=_0xa0149b['attributes'][_0x1424('0x5a')]?_0xa0149b['attributes']:_0x44406e[_0x1424('0x47')];if(!_0x1053d1[_0x1424('0x48')][_0x1424('0x4d')]('nolimit')){_0xa0149b[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0x1053d1[_0x1424('0x48')]['limit']);_0xa0149b[_0x1424('0x2e')]=qs[_0x1424('0x2e')](_0x1053d1[_0x1424('0x48')][_0x1424('0x2e')]);}_0xa0149b[_0x1424('0x4f')]=qs['sort'](_0x1053d1[_0x1424('0x48')][_0x1424('0x50')]);_0xa0149b[_0x1424('0x51')]=qs[_0x1424('0x49')](_[_0x1424('0x52')](_0x1053d1[_0x1424('0x48')],_0x44406e[_0x1424('0x49')]));_0xa0149b[_0x1424('0x51')]['MailAccountId']=_0x166e53['id'];if(_0x1053d1[_0x1424('0x48')][_0x1424('0x64')]){_0xa0149b['where']=_['merge'](_0xa0149b[_0x1424('0x51')],{'$or':_[_0x1424('0x41')](_0xa0149b[_0x1424('0x4b')],function(_0x1ef411){var _0x2b3521={};_0x2b3521[_0x1ef411]={'$like':'%'+_0x1053d1[_0x1424('0x48')][_0x1424('0x64')]+'%'};return _0x2b3521;})});}if(_0x1053d1['query'][_0x1424('0xa0')]){var _0x469b78=_0x1053d1[_0x1424('0x48')][_0x1424('0xa0')]['split'](',');var _0x2352f3={};_0x2352f3[_0x469b78[0x0]]={'$gte':moment(_0x469b78[0x1])['format'](_0x1424('0xa1'))};_0xa0149b[_0x1424('0x51')]=_[_0x1424('0x54')](_0xa0149b[_0x1424('0x51')],_0x2352f3);}_0xa0149b=_['merge']({},_0xa0149b,_0x1053d1[_0x1424('0x55')]);return db[_0x1424('0xa2')]['count']({'where':_0xa0149b['where']})['then'](function(_0x3646fd){_0x1ec0f4[_0x1424('0x2d')]=_0x3646fd;if(_0x1053d1[_0x1424('0x48')][_0x1424('0x56')]){_0xa0149b[_0x1424('0x57')]=[{'all':!![]}];}return db[_0x1424('0xa2')][_0x1424('0x65')](_0xa0149b);})['then'](function(_0x3697be){if(_0x1053d1[_0x1424('0x48')][_0x1424('0xa3')]===_0x1424('0xa4')){for(var _0x20f016=0x0;_0x20f016<_0x3697be['length'];_0x20f016++){_0x3697be[_0x20f016][_0x1424('0x5c')]=juice(_0x3697be[_0x20f016][_0x1424('0x5c')]);}}_0x1ec0f4[_0x1424('0x58')]=_0x3697be;return _0x1ec0f4;});}})[_0x1424('0x33')](respondWithFilteredResult(_0x55f7a2,_0xa0149b))[_0x1424('0x28')](handleError(_0x55f7a2,null));};exports[_0x1424('0x3a')]=function(_0x1f04c8,_0x294920,_0x3972c5){var _0x4dee6c,_0x2bf40f={},_0x325660;if(_0x1f04c8['body']['to']){_0x325660=_0x1f04c8[_0x1424('0x5c')]['to'][_0x1424('0xa5')](',')[0x0];}return db[_0x1424('0x42')][_0x1424('0x5b')]({'where':{'id':_0x1f04c8[_0x1424('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x1424('0xa6'),'include':[{'model':db[_0x1424('0x8c')],'as':_0x1424('0xa7'),'where':{'email':_0x325660},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1424('0x3d')],'as':_0x1424('0x3e'),'raw':!![]}]})[_0x1424('0x33')](handleEntityNotFound(_0x294920,null))['then'](function(_0x3b4dd4){if(_0x3b4dd4){_0x4dee6c=_0x3b4dd4;if(_0x3b4dd4['Smtp']){if(_[_0x1424('0x6e')](_0x1f04c8[_0x1424('0x5c')][_0x1424('0xa8')])){_0x1f04c8[_0x1424('0x5c')]['from']=util[_0x1424('0xa9')](_0x1424('0xaa'),_0x3b4dd4[_0x1424('0x39')],_0x3b4dd4[_0x1424('0xab')]||_0x3b4dd4[_0x1424('0x3e')]['user']);}if(_0x1f04c8['body'][_0x1424('0xac')]&&_0x1f04c8[_0x1424('0x5c')]['attachments']['length']){for(var _0x33915c=0x0;_0x33915c<_0x1f04c8['body']['attachments'][_0x1424('0x5a')];_0x33915c+=0x1){_0x1f04c8[_0x1424('0x5c')][_0x1424('0xac')][_0x33915c]={'filename':_0x1f04c8[_0x1424('0x5c')][_0x1424('0xac')][_0x33915c][_0x1424('0x39')],'path':path[_0x1424('0xad')](config['root'],_0x1424('0xae'),_0x1f04c8[_0x1424('0x5c')][_0x1424('0xac')][_0x33915c][_0x1424('0xaf')])};}}var _0x4f37cd={'tls':{'rejectUnauthorized':![]}};if(_[_0x1424('0x6e')](_0x3b4dd4[_0x1424('0x3e')]['service'])){if(_0x3b4dd4[_0x1424('0x3e')][_0x1424('0x77')]){_0x4f37cd[_0x1424('0xb0')]={'user':_0x3b4dd4[_0x1424('0x3e')]['user'],'pass':_0x3b4dd4[_0x1424('0x3e')][_0x1424('0x75')]};}_0x4f37cd[_0x1424('0x78')]=_0x3b4dd4[_0x1424('0x3e')]['host'];_0x4f37cd['port']=_0x3b4dd4[_0x1424('0x3e')]['port'];_0x4f37cd[_0x1424('0xb1')]=_0x3b4dd4[_0x1424('0x3e')][_0x1424('0xb1')];}else{_0x4f37cd[_0x1424('0x7a')]=_0x3b4dd4[_0x1424('0x3e')][_0x1424('0x7a')];_0x4f37cd['auth']={'user':_0x3b4dd4['Smtp'][_0x1424('0x73')],'pass':_0x3b4dd4[_0x1424('0x3e')]['pass']};}return respondWithRpcPromise(_0x1424('0xb2'),_0x1424('0xb3'),{'account':_0x4f37cd,'message':_0x1f04c8[_0x1424('0x5c')]});}else{throw new Error(_0x1424('0xb4'));}}})[_0x1424('0x33')](function(_0x289efe){if(_0x289efe){_0x2bf40f=_0x289efe;if(_0x4dee6c[_0x1424('0xa6')]){if(_0x4dee6c['List'][_0x1424('0xa7')][_0x1424('0x5a')]){return _0x4dee6c['List'][_0x1424('0xa7')][0x0];}else{return db[_0x1424('0x8c')][_0x1424('0x69')](_['defaults'](_0x1f04c8[_0x1424('0x5c')],{'firstName':_0x1f04c8['body']['to'],'email':_0x1f04c8['body']['to'],'phone':_0x1f04c8[_0x1424('0x5c')]['to'],'ListId':_0x4dee6c[_0x1424('0x6d')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x1a4257){if(_0x1a4257){var _0x38ecde={'UserId':_0x1f04c8[_0x1424('0x73')]['id'],'ContactId':_0x1a4257['id'],'MailAccountId':_0x4dee6c['id'],'inReplyTo':_0x2bf40f[_0x1424('0xb5')],'to':_0x1f04c8[_0x1424('0x5c')][_0x1424('0xa8')],'cc':_0x1f04c8['body']['cc'],'subject':_0x1f04c8['body'][_0x1424('0xb6')],'attach':_0x1f04c8[_0x1424('0x5c')][_0x1424('0xb7')],'firstMsgDirection':_0x1424('0xb8'),'lastMsgAt':moment()['format'](_0x1424('0xa1')),'lastMsgDirection':'out','Messages':[_[_0x1424('0x54')](_0x1f04c8['body'],{'messageId':_0x2bf40f[_0x1424('0xb5')],'sentAt':moment()[_0x1424('0xa9')](_0x1424('0xa1')),'read':!![],'MailAccountId':_0x4dee6c['id'],'UserId':_0x1f04c8[_0x1424('0x73')]['id'],'ContactId':_0x1a4257['id']})]};if(_0x1f04c8['body']['Interaction']){_0x38ecde=_[_0x1424('0x54')](_0x38ecde,_0x1f04c8[_0x1424('0x5c')][_0x1424('0xb9')]);}return db[_0x1424('0x89')][_0x1424('0x69')](_0x38ecde,{'include':[{'model':db[_0x1424('0xa2')],'as':'Messages'}]});}})[_0x1424('0x33')](respondWithResult(_0x294920,null))[_0x1424('0x28')](handleError(_0x294920,null));};exports['verifySmtp']=function(_0x58e996,_0x469447,_0x356556){return db['MailAccount'][_0x1424('0x5b')]({'where':{'id':_0x58e996[_0x1424('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x1424('0x33')](handleEntityNotFound(_0x469447,null))[_0x1424('0x33')](function(_0xcab6a4){if(_0xcab6a4&&_0xcab6a4[_0x1424('0x3e')]){var _0x3a9f6b={'id':_0xcab6a4['id'],'tls':{'rejectUnauthorized':![]}};if(_0xcab6a4[_0x1424('0x3e')][_0x1424('0x7a')]){_0x3a9f6b[_0x1424('0x7a')]=_0xcab6a4[_0x1424('0x3e')][_0x1424('0x7a')];}else{_0x3a9f6b['host']=_0xcab6a4[_0x1424('0x3e')][_0x1424('0x78')];_0x3a9f6b['port']=_0xcab6a4[_0x1424('0x3e')][_0x1424('0x79')];_0x3a9f6b[_0x1424('0xb1')]=_0xcab6a4[_0x1424('0x3e')][_0x1424('0xb1')];}if(_0xcab6a4[_0x1424('0x3e')]['authentication']){_0x3a9f6b[_0x1424('0xb0')]={'user':_0xcab6a4[_0x1424('0x3e')]['user'],'pass':_0xcab6a4[_0x1424('0x3e')]['pass']};}return respondWithRpcPromise(_0x1424('0xba'),_0x1424('0xbb'),{'account':_0x3a9f6b});}})['then'](respondWithResult(_0x469447,null))[_0x1424('0x28')](handleError(_0x469447,null));};exports[_0x1424('0x37')]=function(_0x541c37,_0x10a00c){return db['MailAccount']['find']({'where':{'id':_0x541c37[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x10a00c,null))[_0x1424('0x33')](function(_0x436759){if(_0x436759&&_0x436759[_0x1424('0x7a')]){throw new db[(_0x1424('0xbc'))][(_0x1424('0xbd'))](_0x1424('0xbe'));}return _0x436759;})['then'](removeEntity(_0x10a00c,null))[_0x1424('0x28')](handleError(_0x10a00c,null));};exports[_0x1424('0xbf')]=function(_0x5ee054,_0x1051a6,_0x3dac82){return db['MailAccount'][_0x1424('0x5b')]({'where':{'id':_0x5ee054[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x1051a6,null))[_0x1424('0x33')](function(_0x56c5a2){if(_0x56c5a2){return _0x56c5a2[_0x1424('0xbf')](_0x5ee054[_0x1424('0x5c')][_0x1424('0x67')],_[_0x1424('0x8a')](_0x5ee054[_0x1424('0x5c')],[_0x1424('0x67'),'id'])||{})[_0x1424('0xc0')](function(_0x2adb1b){for(var _0x37e29f=0x0;_0x37e29f<_0x5ee054[_0x1424('0x5c')][_0x1424('0x67')][_0x1424('0x5a')];_0x37e29f+=0x1){socket[_0x1424('0xc1')](_0x1424('0xc2'),{'UserId':Number(_0x5ee054[_0x1424('0x5c')][_0x1424('0x67')][_0x37e29f]),'MailAccountId':Number(_0x5ee054[_0x1424('0x5d')]['id'])});}return _0x2adb1b;});}})[_0x1424('0x33')](respondWithResult(_0x1051a6,null))[_0x1424('0x28')](handleError(_0x1051a6,null));};exports[_0x1424('0xc3')]=function(_0xbcbb83,_0x2589cc,_0x4038ba){return db[_0x1424('0x42')]['find']({'where':{'id':_0xbcbb83[_0x1424('0x5d')]['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x2589cc,null))[_0x1424('0x33')](function(_0x4e71df){if(_0x4e71df){return _0x4e71df[_0x1424('0xc3')](_0xbcbb83[_0x1424('0x48')][_0x1424('0x67')])[_0x1424('0x33')](function(){if(_[_0x1424('0xc4')](_0xbcbb83[_0x1424('0x48')][_0x1424('0x67')])){for(var _0x38c8db=0x0;_0x38c8db<_0xbcbb83[_0x1424('0x48')]['ids'][_0x1424('0x5a')];_0x38c8db+=0x1){socket[_0x1424('0xc1')]('userMailAccount:remove',{'UserId':Number(_0xbcbb83[_0x1424('0x48')][_0x1424('0x67')][_0x38c8db]),'MailAccountId':Number(_0xbcbb83['params']['id'])});}}else{socket['emit'](_0x1424('0xc5'),{'UserId':Number(_0xbcbb83[_0x1424('0x48')][_0x1424('0x67')]),'MailAccountId':Number(_0xbcbb83['params']['id'])});}});}})[_0x1424('0x33')](respondWithStatusCode(_0x2589cc,null))[_0x1424('0x28')](handleError(_0x2589cc,null));};exports[_0x1424('0xc6')]=function(_0x42225a,_0x2cbac8,_0x3c8799){var _0x1ded4c={};var _0x4ecc28={};var _0x266ab4;var _0x326a09;return db[_0x1424('0x42')]['findOne']({'where':{'id':_0x42225a['params']['id']}})[_0x1424('0x33')](handleEntityNotFound(_0x2cbac8,null))['then'](function(_0x14dfcb){if(_0x14dfcb){_0x266ab4=_0x14dfcb;_0x4ecc28[_0x1424('0x47')]=_[_0x1424('0x59')](db[_0x1424('0x8d')][_0x1424('0x43')]);_0x4ecc28[_0x1424('0x48')]=_[_0x1424('0x59')](_0x42225a[_0x1424('0x48')]);_0x4ecc28[_0x1424('0x49')]=_[_0x1424('0x4a')](_0x4ecc28['model'],_0x4ecc28['query']);_0x1ded4c[_0x1424('0x4b')]=_[_0x1424('0x4a')](_0x4ecc28[_0x1424('0x47')],qs[_0x1424('0x4c')](_0x42225a[_0x1424('0x48')]['fields']));_0x1ded4c[_0x1424('0x4b')]=_0x1ded4c[_0x1424('0x4b')][_0x1424('0x5a')]?_0x1ded4c['attributes']:_0x4ecc28[_0x1424('0x47')];_0x1ded4c[_0x1424('0x4f')]=qs[_0x1424('0x50')](_0x42225a[_0x1424('0x48')]['sort']);_0x1ded4c['where']=qs[_0x1424('0x49')](_['pick'](_0x42225a[_0x1424('0x48')],_0x4ecc28[_0x1424('0x49')]));if(_0x42225a[_0x1424('0x48')]['filter']){_0x1ded4c[_0x1424('0x51')]=_[_0x1424('0x54')](_0x1ded4c[_0x1424('0x51')],{'$or':_[_0x1424('0x41')](_0x1ded4c[_0x1424('0x4b')],function(_0x2903c3){var _0x568eba={};_0x568eba[_0x2903c3]={'$like':'%'+_0x42225a['query']['filter']+'%'};return _0x568eba;})});}_0x1ded4c=_[_0x1424('0x54')]({},_0x1ded4c,_0x42225a[_0x1424('0x55')]);return _0x266ab4[_0x1424('0xc6')](_0x1ded4c);}})[_0x1424('0x33')](function(_0x354d1d){if(_0x354d1d){_0x326a09=_0x354d1d['length'];if(!_0x42225a[_0x1424('0x48')][_0x1424('0x4d')](_0x1424('0x4e'))){_0x1ded4c[_0x1424('0x2c')]=qs[_0x1424('0x2c')](_0x42225a['query'][_0x1424('0x2c')]);_0x1ded4c[_0x1424('0x2e')]=qs[_0x1424('0x2e')](_0x42225a[_0x1424('0x48')][_0x1424('0x2e')]);}return _0x266ab4[_0x1424('0xc6')](_0x1ded4c);}})['then'](function(_0x3c7b85){if(_0x3c7b85){return _0x3c7b85?{'count':_0x326a09,'rows':_0x3c7b85}:null;}})[_0x1424('0x33')](respondWithResult(_0x2cbac8,null))['catch'](handleError(_0x2cbac8,null));}; \ No newline at end of file +var _0x622f=['localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','rows','params','includeAll','include','body','find','describe','addDisposition','Disposition','create','findOne','hasOwnProperty','nolimit','removeDispositions','addAnswer','MailAccountId','CannedAnswer','getAnswers','findAll','removeAnswers','ids','email','ListId','isNil','active','description','cservice','user','cuser','cpassword','authentication','host','port','service','password','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','priority','finally','send','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','crypto','jsforce','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x2e0bc0,_0xaad046){var _0x1ef34e=function(_0x36a59f){while(--_0x36a59f){_0x2e0bc0['push'](_0x2e0bc0['shift']());}};_0x1ef34e(++_0xaad046);}(_0x622f,0x172));var _0xf622=function(_0x3b1e1d,_0x1504a2){_0x3b1e1d=_0x3b1e1d-0x0;var _0x55ab85=_0x622f[_0x3b1e1d];return _0x55ab85;};'use strict';var emlformat=require(_0xf622('0x0'));var rimraf=require(_0xf622('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf622('0x2'));var rp=require(_0xf622('0x3'));var moment=require(_0xf622('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf622('0x5'));var util=require('util');var path=require(_0xf622('0x6'));var sox=require(_0xf622('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf622('0x8'));var _=require(_0xf622('0x9'));var squel=require('squel');var crypto=require(_0xf622('0xa'));var jsforce=require(_0xf622('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf622('0xc'));var Papa=require('papaparse');var htmlToText=require(_0xf622('0xd'));var juice=require(_0xf622('0xe'));var Redis=require(_0xf622('0xf'));var authService=require(_0xf622('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf622('0x11'));var hardwareService=require(_0xf622('0x12'));var logger=require(_0xf622('0x13'))(_0xf622('0x14'));var utils=require('../../config/utils');var config=require(_0xf622('0x15'));var licenseUtil=require(_0xf622('0x16'));var db=require(_0xf622('0x17'))['db'];config['redis']=_[_0xf622('0x18')](config[_0xf622('0x19')],{'host':_0xf622('0x1a'),'port':0x18eb});var socket=require(_0xf622('0x1b'))(new Redis(config[_0xf622('0x19')]));require(_0xf622('0x1c'))['register'](socket);var jayson=require(_0xf622('0x1d'));var client=jayson['client'][_0xf622('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x47d746,_0x43aaf9,_0xd26182,_0x247d0c){return new BPromise(function(_0x52c66f,_0x3f8ad5){var _0x13dff4=_0x247d0c||client;return _0x13dff4['request'](_0x47d746,_0xd26182)['then'](function(_0x4cc01a){logger[_0xf622('0x1f')](_0xf622('0x20'),_0x43aaf9,_0xf622('0x21'));logger[_0xf622('0x22')](_0xf622('0x23'),_0x43aaf9,_0xf622('0x21'),JSON[_0xf622('0x24')](_0x4cc01a));if(_0x4cc01a['error']){if(_0x4cc01a[_0xf622('0x25')][_0xf622('0x26')]===0x1f4){logger[_0xf622('0x25')](_0xf622('0x20'),_0x43aaf9,_0x4cc01a[_0xf622('0x25')][_0xf622('0x27')]);return _0x3f8ad5(_0x4cc01a['error']['message']);}logger[_0xf622('0x25')](_0xf622('0x20'),_0x43aaf9,_0x4cc01a['error']['message']);return _0x52c66f(_0x4cc01a['error'][_0xf622('0x27')]);}else{logger[_0xf622('0x1f')](_0xf622('0x20'),_0x43aaf9,_0xf622('0x21'));_0x52c66f(_0x4cc01a[_0xf622('0x28')][_0xf622('0x27')]);}})[_0xf622('0x29')](function(_0x4b4c0d){logger[_0xf622('0x25')](_0xf622('0x20'),_0x43aaf9,_0x4b4c0d);_0x3f8ad5(_0x4b4c0d);});});}function respondWithStatusCode(_0x436c10,_0x43881c){_0x43881c=_0x43881c||0xcc;return function(_0x346b9){if(_0x346b9){return _0x436c10[_0xf622('0x2a')](_0x43881c);}return _0x436c10['status'](_0x43881c)[_0xf622('0x2b')]();};}function respondWithResult(_0x5098d6,_0x67834a){_0x67834a=_0x67834a||0xc8;return function(_0x111706){if(_0x111706){return _0x5098d6['status'](_0x67834a)[_0xf622('0x2c')](_0x111706);}};}function respondWithFilteredResult(_0x1d1c25,_0x1785a8){return function(_0x4f9a59){if(_0x4f9a59){var _0x2c95c4=typeof _0x1785a8[_0xf622('0x2d')]===_0xf622('0x2e')&&typeof _0x1785a8[_0xf622('0x2f')]===_0xf622('0x2e');var _0x9d0392=_0x4f9a59[_0xf622('0x30')];var _0x6d4a20=_0x2c95c4?0x0:_0x1785a8[_0xf622('0x2d')];var _0x4709b7=_0x2c95c4?_0x4f9a59[_0xf622('0x30')]:_0x1785a8[_0xf622('0x2d')]+_0x1785a8[_0xf622('0x2f')];var _0x5f27c0;if(_0x4709b7>=_0x9d0392){_0x4709b7=_0x9d0392;_0x5f27c0=0xc8;}else{_0x5f27c0=0xce;}_0x1d1c25[_0xf622('0x31')](_0x5f27c0);return _0x1d1c25[_0xf622('0x32')](_0xf622('0x33'),_0x6d4a20+'-'+_0x4709b7+'/'+_0x9d0392)[_0xf622('0x2c')](_0x4f9a59);}return null;};}function patchUpdates(_0x2218b3){return function(_0x46c2bd){try{jsonpatch[_0xf622('0x34')](_0x46c2bd,_0x2218b3,!![]);}catch(_0x48a40c){return BPromise[_0xf622('0x35')](_0x48a40c);}return _0x46c2bd[_0xf622('0x36')]();};}function saveUpdates(_0x322ebd,_0x53a3bb){return function(_0x1cfcf1){if(_0x1cfcf1){return _0x1cfcf1[_0xf622('0x37')](_0x322ebd)[_0xf622('0x38')](function(_0x2f28dc){return _0x2f28dc;});}return null;};}function removeEntity(_0x24f565,_0x36d6d3){return function(_0x3e3577){if(_0x3e3577){return _0x3e3577[_0xf622('0x39')]()[_0xf622('0x38')](function(){var _0x130980=_0x3e3577[_0xf622('0x3a')]({'plain':!![]});var _0x3a106d='MailAccounts';return db[_0xf622('0x3b')][_0xf622('0x39')]({'where':{'type':_0x3a106d,'resourceId':_0x130980['id']}})[_0xf622('0x38')](function(){return _0x3e3577;});})[_0xf622('0x38')](function(){_0x24f565[_0xf622('0x31')](0xcc)[_0xf622('0x2b')]();});}};}function handleEntityNotFound(_0x3d1db8,_0x1a2c06){return function(_0xb0d024){if(!_0xb0d024){_0x3d1db8[_0xf622('0x2a')](0x194);}return _0xb0d024;};}function handleError(_0x459174,_0x82e0ab){_0x82e0ab=_0x82e0ab||0x1f4;return function(_0x34c34b){logger[_0xf622('0x25')](_0x34c34b[_0xf622('0x3c')]);if(_0x34c34b[_0xf622('0x3d')]){delete _0x34c34b[_0xf622('0x3d')];}_0x459174[_0xf622('0x31')](_0x82e0ab)['send'](_0x34c34b);};}exports['index']=function(_0x4b9aa8,_0x188aca){var _0x361c09={'include':[{'model':db[_0xf622('0x3e')],'as':_0xf622('0x3f')},{'model':db[_0xf622('0x40')],'as':_0xf622('0x41')},{'model':db[_0xf622('0x42')],'as':_0xf622('0x43')}]},_0x36d904={},_0x29fe8a={'count':0x0,'rows':[]};var _0x29946e=_[_0xf622('0x44')](db[_0xf622('0x45')][_0xf622('0x46')],function(_0x4e4a2e){return{'name':_0x4e4a2e[_0xf622('0x47')],'type':_0x4e4a2e[_0xf622('0x48')][_0xf622('0x49')]};});_0x36d904['model']=_[_0xf622('0x44')](_0x29946e,_0xf622('0x3d'));_0x36d904[_0xf622('0x4a')]=_[_0xf622('0x4b')](_0x4b9aa8[_0xf622('0x4a')]);_0x36d904[_0xf622('0x4c')]=_[_0xf622('0x4d')](_0x36d904[_0xf622('0x4e')],_0x36d904['query']);_0x361c09[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x36d904[_0xf622('0x4e')],qs[_0xf622('0x50')](_0x4b9aa8['query'][_0xf622('0x50')]));_0x361c09[_0xf622('0x4f')]=_0x361c09[_0xf622('0x4f')][_0xf622('0x51')]?_0x361c09['attributes']:_0x36d904[_0xf622('0x4e')];if(!_0x4b9aa8['query']['hasOwnProperty']('nolimit')){_0x361c09[_0xf622('0x2f')]=qs[_0xf622('0x2f')](_0x4b9aa8[_0xf622('0x4a')]['limit']);_0x361c09[_0xf622('0x2d')]=qs['offset'](_0x4b9aa8[_0xf622('0x4a')][_0xf622('0x2d')]);}_0x361c09[_0xf622('0x52')]=qs[_0xf622('0x53')](_0x4b9aa8[_0xf622('0x4a')][_0xf622('0x53')]);_0x361c09['where']=qs['filters'](_[_0xf622('0x54')](_0x4b9aa8[_0xf622('0x4a')],_0x36d904['filters']),_0x29946e);if(_0x4b9aa8[_0xf622('0x4a')][_0xf622('0x55')]){_0x361c09['where']=_[_0xf622('0x56')](_0x361c09[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x29946e,function(_0x227fe5){if(_0x227fe5['type']!==_0xf622('0x58')){var _0x67b05={};_0x67b05[_0x227fe5[_0xf622('0x3d')]]={'$like':'%'+_0x4b9aa8[_0xf622('0x4a')]['filter']+'%'};return _0x67b05;}})});}_0x361c09=_[_0xf622('0x56')]({},_0x361c09,_0x4b9aa8[_0xf622('0x59')]);var _0x524926={'where':_0x361c09['where']};return db[_0xf622('0x45')][_0xf622('0x30')](_0x524926)[_0xf622('0x38')](function(_0x3fc249){_0x29fe8a[_0xf622('0x30')]=_0x3fc249;if(_0x4b9aa8[_0xf622('0x4a')]['includeAll']){_0x361c09['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x361c09);})[_0xf622('0x38')](function(_0x151b89){_0x29fe8a[_0xf622('0x5a')]=_0x151b89;return _0x29fe8a;})[_0xf622('0x38')](respondWithFilteredResult(_0x188aca,_0x361c09))[_0xf622('0x29')](handleError(_0x188aca,null));};exports['show']=function(_0x4a5370,_0x15af88){var _0x78c0f7={'raw':![],'where':{'id':_0x4a5370[_0xf622('0x5b')]['id']},'include':[{'model':db[_0xf622('0x3e')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xf622('0x41')},{'model':db[_0xf622('0x42')],'as':_0xf622('0x43')}]},_0x47e4cd={};_0x47e4cd['model']=_[_0xf622('0x4b')](db[_0xf622('0x45')][_0xf622('0x46')]);_0x47e4cd['query']=_[_0xf622('0x4b')](_0x4a5370[_0xf622('0x4a')]);_0x47e4cd['filters']=_[_0xf622('0x4d')](_0x47e4cd[_0xf622('0x4e')],_0x47e4cd[_0xf622('0x4a')]);_0x78c0f7[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x47e4cd[_0xf622('0x4e')],qs['fields'](_0x4a5370[_0xf622('0x4a')]['fields']));_0x78c0f7[_0xf622('0x4f')]=_0x78c0f7[_0xf622('0x4f')][_0xf622('0x51')]?_0x78c0f7[_0xf622('0x4f')]:_0x47e4cd[_0xf622('0x4e')];if(_0x4a5370[_0xf622('0x4a')][_0xf622('0x5c')]){_0x78c0f7[_0xf622('0x5d')]=[{'all':!![]}];}_0x78c0f7=_['merge']({},_0x78c0f7,_0x4a5370[_0xf622('0x59')]);return db[_0xf622('0x45')]['find'](_0x78c0f7)['then'](handleEntityNotFound(_0x15af88,null))[_0xf622('0x38')](respondWithResult(_0x15af88,null))['catch'](handleError(_0x15af88,null));};exports[_0xf622('0x37')]=function(_0x1e1a52,_0x4a6fba){if(_0x1e1a52[_0xf622('0x5e')]['id']){delete _0x1e1a52[_0xf622('0x5e')]['id'];}return db[_0xf622('0x45')][_0xf622('0x5f')]({'where':{'id':_0x1e1a52[_0xf622('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xf622('0x40')],'as':_0xf622('0x41')},{'model':db['Pause'],'as':_0xf622('0x43')}]})[_0xf622('0x38')](handleEntityNotFound(_0x4a6fba,null))[_0xf622('0x38')](saveUpdates(_0x1e1a52[_0xf622('0x5e')],null))[_0xf622('0x38')](function(_0x127eee){if(_0x127eee&&_0x1e1a52['body']['Imap']){return db[_0xf622('0x3e')]['update'](_0x1e1a52['body'][_0xf622('0x3f')],{'where':{'MailAccountId':_0x127eee['id']}})[_0xf622('0x38')](function(){return _0x127eee;});}return _0x127eee;})['then'](function(_0x57ffe4){if(_0x57ffe4&&_0x1e1a52[_0xf622('0x5e')][_0xf622('0x41')]){return db[_0xf622('0x40')][_0xf622('0x37')](_0x1e1a52[_0xf622('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x57ffe4['id']}})[_0xf622('0x38')](function(){return _0x57ffe4;});}return _0x57ffe4;})['then'](respondWithResult(_0x4a6fba,null))[_0xf622('0x29')](handleError(_0x4a6fba,null));};exports[_0xf622('0x60')]=function(_0x51bc3e,_0x1a71d3){return db[_0xf622('0x45')][_0xf622('0x60')]()['then'](respondWithResult(_0x1a71d3,null))[_0xf622('0x29')](handleError(_0x1a71d3,null));};exports[_0xf622('0x61')]=function(_0x3e9085,_0x42b2d3,_0xf788ee){if(_0x3e9085[_0xf622('0x5e')]['id']){delete _0x3e9085[_0xf622('0x5e')]['id'];}return db[_0xf622('0x45')][_0xf622('0x5f')]({'where':{'id':_0x3e9085[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x42b2d3,null))[_0xf622('0x38')](function(_0x59aaa5){if(_0x59aaa5){_0x3e9085[_0xf622('0x5e')]['MailAccountId']=_0x59aaa5['id'];return db[_0xf622('0x62')][_0xf622('0x63')](_0x3e9085[_0xf622('0x5e')]);}})['then'](respondWithResult(_0x42b2d3,null))[_0xf622('0x29')](handleError(_0x42b2d3,null));};exports['getDispositions']=function(_0x130be7,_0x392a4a,_0x48811a){var _0x120a80={'raw':![],'where':{}};var _0x57b2c3={};var _0xb5fcb={'count':0x0,'rows':[]};return db['MailAccount'][_0xf622('0x64')]({'where':{'id':_0x130be7['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x392a4a,null))[_0xf622('0x38')](function(_0x34d002){if(_0x34d002){_0x57b2c3[_0xf622('0x4e')]=_['keys'](db[_0xf622('0x62')][_0xf622('0x46')]);_0x57b2c3[_0xf622('0x4a')]=_[_0xf622('0x4b')](_0x130be7[_0xf622('0x4a')]);_0x57b2c3[_0xf622('0x4c')]=_[_0xf622('0x4d')](_0x57b2c3[_0xf622('0x4e')],_0x57b2c3['query']);_0x120a80[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x57b2c3[_0xf622('0x4e')],qs['fields'](_0x130be7[_0xf622('0x4a')][_0xf622('0x50')]));_0x120a80['attributes']=_0x120a80[_0xf622('0x4f')]['length']?_0x120a80['attributes']:_0x57b2c3[_0xf622('0x4e')];if(!_0x130be7[_0xf622('0x4a')][_0xf622('0x65')](_0xf622('0x66'))){_0x120a80['limit']=qs[_0xf622('0x2f')](_0x130be7[_0xf622('0x4a')][_0xf622('0x2f')]);_0x120a80[_0xf622('0x2d')]=qs[_0xf622('0x2d')](_0x130be7['query'][_0xf622('0x2d')]);}_0x120a80[_0xf622('0x52')]=qs[_0xf622('0x53')](_0x130be7[_0xf622('0x4a')][_0xf622('0x53')]);_0x120a80[_0xf622('0x57')]=qs[_0xf622('0x4c')](_['pick'](_0x130be7[_0xf622('0x4a')],_0x57b2c3['filters']));_0x120a80['where']['MailAccountId']=_0x34d002['id'];if(_0x130be7['query'][_0xf622('0x55')]){_0x120a80[_0xf622('0x57')]=_[_0xf622('0x56')](_0x120a80[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x120a80[_0xf622('0x4f')],function(_0x2ee0d2){var _0x2073ee={};_0x2073ee[_0x2ee0d2]={'$like':'%'+_0x130be7[_0xf622('0x4a')][_0xf622('0x55')]+'%'};return _0x2073ee;})});}_0x120a80=_['merge']({},_0x120a80,_0x130be7['options']);return db['Disposition'][_0xf622('0x30')]({'where':_0x120a80[_0xf622('0x57')]})[_0xf622('0x38')](function(_0x167e05){_0xb5fcb['count']=_0x167e05;if(_0x130be7['query'][_0xf622('0x5c')]){_0x120a80[_0xf622('0x5d')]=[{'all':!![]}];}return db[_0xf622('0x62')]['findAll'](_0x120a80);})[_0xf622('0x38')](function(_0x2b62fb){_0xb5fcb[_0xf622('0x5a')]=_0x2b62fb;return _0xb5fcb;});}})[_0xf622('0x38')](respondWithFilteredResult(_0x392a4a,_0x120a80))[_0xf622('0x29')](handleError(_0x392a4a,null));};exports[_0xf622('0x67')]=function(_0x6f183c,_0x64dba0,_0x2ebcb4){return db[_0xf622('0x45')][_0xf622('0x5f')]({'where':{'id':_0x6f183c[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x64dba0,null))[_0xf622('0x38')](function(_0x4dff06){if(_0x4dff06){return _0x4dff06[_0xf622('0x67')](_0x6f183c['query']['ids']);}})[_0xf622('0x38')](respondWithStatusCode(_0x64dba0,null))[_0xf622('0x29')](handleError(_0x64dba0,null));};exports[_0xf622('0x68')]=function(_0x58a1a5,_0x4bb3ec,_0x1cec9b){if(_0x58a1a5[_0xf622('0x5e')]['id']){delete _0x58a1a5['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x58a1a5['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x4bb3ec,null))['then'](function(_0x45cafa){if(_0x45cafa){_0x58a1a5[_0xf622('0x5e')][_0xf622('0x69')]=_0x45cafa['id'];return db[_0xf622('0x6a')][_0xf622('0x63')](_0x58a1a5['body']);}})[_0xf622('0x38')](respondWithResult(_0x4bb3ec,null))[_0xf622('0x29')](handleError(_0x4bb3ec,null));};exports[_0xf622('0x6b')]=function(_0x2c6c3a,_0x3f539b,_0x429b93){var _0x34e68b={'raw':![],'where':{}};var _0x37389e={};var _0x44e17b={'count':0x0,'rows':[]};return db[_0xf622('0x45')][_0xf622('0x64')]({'where':{'id':_0x2c6c3a['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x3f539b,null))[_0xf622('0x38')](function(_0x4f28b1){if(_0x4f28b1){_0x37389e[_0xf622('0x4e')]=_[_0xf622('0x4b')](db[_0xf622('0x6a')][_0xf622('0x46')]);_0x37389e[_0xf622('0x4a')]=_[_0xf622('0x4b')](_0x2c6c3a[_0xf622('0x4a')]);_0x37389e[_0xf622('0x4c')]=_[_0xf622('0x4d')](_0x37389e['model'],_0x37389e[_0xf622('0x4a')]);_0x34e68b['attributes']=_['intersection'](_0x37389e['model'],qs[_0xf622('0x50')](_0x2c6c3a[_0xf622('0x4a')]['fields']));_0x34e68b[_0xf622('0x4f')]=_0x34e68b[_0xf622('0x4f')][_0xf622('0x51')]?_0x34e68b[_0xf622('0x4f')]:_0x37389e['model'];if(!_0x2c6c3a['query'][_0xf622('0x65')]('nolimit')){_0x34e68b[_0xf622('0x2f')]=qs[_0xf622('0x2f')](_0x2c6c3a[_0xf622('0x4a')]['limit']);_0x34e68b[_0xf622('0x2d')]=qs[_0xf622('0x2d')](_0x2c6c3a[_0xf622('0x4a')][_0xf622('0x2d')]);}_0x34e68b[_0xf622('0x52')]=qs[_0xf622('0x53')](_0x2c6c3a[_0xf622('0x4a')][_0xf622('0x53')]);_0x34e68b[_0xf622('0x57')]=qs[_0xf622('0x4c')](_['pick'](_0x2c6c3a[_0xf622('0x4a')],_0x37389e['filters']));_0x34e68b['where']['MailAccountId']=_0x4f28b1['id'];if(_0x2c6c3a[_0xf622('0x4a')][_0xf622('0x55')]){_0x34e68b['where']=_[_0xf622('0x56')](_0x34e68b[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x34e68b['attributes'],function(_0x12c79f){var _0x56dd72={};_0x56dd72[_0x12c79f]={'$like':'%'+_0x2c6c3a['query'][_0xf622('0x55')]+'%'};return _0x56dd72;})});}_0x34e68b=_[_0xf622('0x56')]({},_0x34e68b,_0x2c6c3a[_0xf622('0x59')]);return db[_0xf622('0x6a')][_0xf622('0x30')]({'where':_0x34e68b[_0xf622('0x57')]})[_0xf622('0x38')](function(_0x15717f){_0x44e17b['count']=_0x15717f;if(_0x2c6c3a[_0xf622('0x4a')][_0xf622('0x5c')]){_0x34e68b[_0xf622('0x5d')]=[{'all':!![]}];}return db[_0xf622('0x6a')][_0xf622('0x6c')](_0x34e68b);})[_0xf622('0x38')](function(_0x2dd0f4){_0x44e17b[_0xf622('0x5a')]=_0x2dd0f4;return _0x44e17b;});}})['then'](respondWithFilteredResult(_0x3f539b,_0x34e68b))[_0xf622('0x29')](handleError(_0x3f539b,null));};exports['removeAnswers']=function(_0x819f2b,_0x3af603,_0x5c891b){return db[_0xf622('0x45')][_0xf622('0x5f')]({'where':{'id':_0x819f2b[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x3af603,null))['then'](function(_0x56bf2e){if(_0x56bf2e){return _0x56bf2e[_0xf622('0x6d')](_0x819f2b[_0xf622('0x4a')][_0xf622('0x6e')]);}})['then'](respondWithStatusCode(_0x3af603,null))[_0xf622('0x29')](handleError(_0x3af603,null));};exports[_0xf622('0x63')]=function(_0x1cd1e,_0x211f1c){var _0x272515={'name':_0x1cd1e[_0xf622('0x5e')]['name'],'key':_0x1cd1e[_0xf622('0x5e')][_0xf622('0x49')],'email':_0x1cd1e['body'][_0xf622('0x6f')],'ListId':_0x1cd1e[_0xf622('0x5e')][_0xf622('0x70')],'active':!_[_0xf622('0x71')](_0x1cd1e[_0xf622('0x5e')][_0xf622('0x72')])?_0x1cd1e['body'][_0xf622('0x72')]:!![],'description':_0x1cd1e[_0xf622('0x5e')][_0xf622('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xf622('0x71')](_0x1cd1e[_0xf622('0x5e')][_0xf622('0x74')])){if(_0x1cd1e[_0xf622('0x5e')]['cauthentication']){_0x272515[_0xf622('0x3f')][_0xf622('0x75')]=_0x272515[_0xf622('0x41')][_0xf622('0x75')]=_0x1cd1e[_0xf622('0x5e')][_0xf622('0x76')];_0x272515['Imap']['password']=_0x272515[_0xf622('0x41')]['pass']=_0x1cd1e[_0xf622('0x5e')][_0xf622('0x77')];}else{_0x272515[_0xf622('0x3f')]['authentication']=_0x272515[_0xf622('0x41')][_0xf622('0x78')]=![];}_0x272515[_0xf622('0x3f')][_0xf622('0x79')]=_0x1cd1e[_0xf622('0x5e')][_0xf622('0x3f')][_0xf622('0x79')];_0x272515[_0xf622('0x3f')][_0xf622('0x7a')]=_0x1cd1e[_0xf622('0x5e')]['Imap'][_0xf622('0x7a')];_0x272515[_0xf622('0x41')]['host']=_0x1cd1e['body'][_0xf622('0x41')][_0xf622('0x79')];_0x272515['Smtp'][_0xf622('0x7a')]=_0x1cd1e['body'][_0xf622('0x41')]['port'];}else{_0x272515[_0xf622('0x3f')]['service']=_0x272515['Smtp'][_0xf622('0x7b')]=_0x1cd1e['body'][_0xf622('0x74')];_0x272515[_0xf622('0x3f')][_0xf622('0x75')]=_0x272515[_0xf622('0x41')][_0xf622('0x75')]=_0x1cd1e[_0xf622('0x5e')][_0xf622('0x76')];_0x272515[_0xf622('0x3f')][_0xf622('0x7c')]=_0x272515['Smtp'][_0xf622('0x7d')]=_0x1cd1e['body'][_0xf622('0x77')];}return db['MailAccount'][_0xf622('0x63')](_0x272515,{'include':[{'model':db[_0xf622('0x40')],'as':_0xf622('0x41')},{'model':db[_0xf622('0x3e')],'as':'Imap'}]})['then'](function(_0x21ba6a){var _0x541f71=_0x1cd1e[_0xf622('0x75')][_0xf622('0x3a')]({'plain':!![]});if(!_0x541f71)throw new Error(_0xf622('0x7e'));if(_0x541f71['role']===_0xf622('0x75')){var _0x34a8f0=_0x21ba6a[_0xf622('0x3a')]({'plain':!![]});return db[_0xf622('0x7f')][_0xf622('0x5f')]({'where':{'name':_0xf622('0x80'),'userProfileId':_0x541f71['userProfileId']},'raw':!![]})[_0xf622('0x38')](function(_0x1e98d8){if(_0x1e98d8&&_0x1e98d8[_0xf622('0x81')]===0x0){return db[_0xf622('0x3b')][_0xf622('0x63')]({'name':_0x34a8f0[_0xf622('0x3d')],'resourceId':_0x34a8f0['id'],'type':_0x1e98d8[_0xf622('0x3d')],'sectionId':_0x1e98d8['id']},{})[_0xf622('0x38')](function(){return _0x21ba6a;});}else{return _0x21ba6a;}})[_0xf622('0x29')](function(_0x57bf39){logger[_0xf622('0x25')](_0xf622('0x82'),_0x57bf39);throw _0x57bf39;});}return _0x21ba6a;})[_0xf622('0x38')](respondWithResult(_0x211f1c,0xc9))[_0xf622('0x29')](handleError(_0x211f1c,null));};exports['getImap']=function(_0x45d5fe,_0x5d31fe,_0x1d5377){return db[_0xf622('0x45')][_0xf622('0x64')]({'where':{'id':_0x45d5fe[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x5d31fe,null))[_0xf622('0x38')](function(_0x2b06a5){if(_0x2b06a5){return _0x2b06a5['getImap']();}return null;})['then'](respondWithResult(_0x5d31fe,null))[_0xf622('0x29')](handleError(_0x5d31fe,null));};exports[_0xf622('0x83')]=function(_0x1f94f3,_0x21e0d6,_0x3f36b7){if(_0x1f94f3['body']['id']){delete _0x1f94f3[_0xf622('0x5e')]['id'];}return db[_0xf622('0x45')]['find']({'where':{'id':_0x1f94f3[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x21e0d6,null))['then'](function(_0x6a955e){if(_0x6a955e){_0x1f94f3[_0xf622('0x5e')][_0xf622('0x69')]=_0x6a955e['id'];return db[_0xf622('0x3e')][_0xf622('0x63')](_0x1f94f3[_0xf622('0x5e')]);}})[_0xf622('0x38')](respondWithResult(_0x21e0d6,null))[_0xf622('0x29')](handleError(_0x21e0d6,null));};exports[_0xf622('0x84')]=function(_0x564d2d,_0x509f31,_0x41e479){return db['MailAccount'][_0xf622('0x64')]({'where':{'id':_0x564d2d[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x509f31,null))[_0xf622('0x38')](function(_0x29a917){if(_0x29a917){return _0x29a917[_0xf622('0x85')](null);}return null;})[_0xf622('0x38')](respondWithStatusCode(_0x509f31,null))[_0xf622('0x29')](handleError(_0x509f31,null));};exports[_0xf622('0x86')]=function(_0x2bca19,_0x4cc3e9,_0x437fbd){return db[_0xf622('0x45')]['findOne']({'where':{'id':_0x2bca19[_0xf622('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4cc3e9,null))[_0xf622('0x38')](function(_0xbf6f7d){if(_0xbf6f7d){return _0xbf6f7d[_0xf622('0x86')]();}return null;})[_0xf622('0x38')](respondWithResult(_0x4cc3e9,null))[_0xf622('0x29')](handleError(_0x4cc3e9,null));};exports[_0xf622('0x87')]=function(_0x375865,_0x2e901c,_0x84d1c8){if(_0x375865[_0xf622('0x5e')]['id']){delete _0x375865['body']['id'];}return db[_0xf622('0x45')]['find']({'where':{'id':_0x375865[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x2e901c,null))[_0xf622('0x38')](function(_0x5a48fa){if(_0x5a48fa){_0x375865[_0xf622('0x5e')]['MailAccountId']=_0x5a48fa['id'];return db[_0xf622('0x40')][_0xf622('0x63')](_0x375865[_0xf622('0x5e')]);}})[_0xf622('0x38')](respondWithResult(_0x2e901c,null))['catch'](handleError(_0x2e901c,null));};exports[_0xf622('0x88')]=function(_0x468766,_0x4d52c0,_0x4b1bac){return db['MailAccount'][_0xf622('0x64')]({'where':{'id':_0x468766[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x4d52c0,null))[_0xf622('0x38')](function(_0x48578e){if(_0x48578e){return _0x48578e[_0xf622('0x89')](null);}return null;})[_0xf622('0x38')](respondWithStatusCode(_0x4d52c0,null))[_0xf622('0x29')](handleError(_0x4d52c0,null));};exports[_0xf622('0x8a')]=function(_0x1ad6bf,_0x50e180,_0x269b09){return db[_0xf622('0x8b')]['find']({'where':{'id':_0x1ad6bf['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x50e180,null))[_0xf622('0x38')](function(_0x393ada){if(_0x393ada){return _0x393ada['addInteraction'](_0x1ad6bf[_0xf622('0x5e')][_0xf622('0x6e')],_[_0xf622('0x8c')](_0x1ad6bf[_0xf622('0x5e')],['ids','id'])||{});}})[_0xf622('0x38')](respondWithResult(_0x50e180,null))['catch'](handleError(_0x50e180,null));};exports[_0xf622('0x8d')]=function(_0x206004,_0x16ecde,_0x2c9c14){var _0x351449={'raw':![],'where':{}};var _0x5b2949={};var _0x550f88={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x206004['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x16ecde,null))[_0xf622('0x38')](function(_0x55074c){if(_0x55074c){_0x5b2949['model']=_[_0xf622('0x4b')](db[_0xf622('0x8b')][_0xf622('0x46')]);_0x5b2949['query']=_[_0xf622('0x4b')](_0x206004[_0xf622('0x4a')]);_0x5b2949['filters']=_[_0xf622('0x4d')](_0x5b2949[_0xf622('0x4e')],_0x5b2949[_0xf622('0x4a')]);_0x351449[_0xf622('0x4f')]=_['intersection'](_0x5b2949['model'],qs['fields'](_0x206004[_0xf622('0x4a')]['fields']));_0x351449[_0xf622('0x4f')]=_0x351449[_0xf622('0x4f')][_0xf622('0x51')]?_0x351449[_0xf622('0x4f')]:_0x5b2949[_0xf622('0x4e')];if(!_0x206004['query'][_0xf622('0x65')](_0xf622('0x66'))){_0x351449[_0xf622('0x2f')]=qs[_0xf622('0x2f')](_0x206004[_0xf622('0x4a')][_0xf622('0x2f')]);_0x351449[_0xf622('0x2d')]=qs[_0xf622('0x2d')](_0x206004['query'][_0xf622('0x2d')]);}_0x351449[_0xf622('0x52')]=qs['sort'](_0x206004[_0xf622('0x4a')][_0xf622('0x53')]);_0x351449[_0xf622('0x57')]=qs[_0xf622('0x4c')](_[_0xf622('0x54')](_0x206004[_0xf622('0x4a')],_0x5b2949[_0xf622('0x4c')]));_0x351449[_0xf622('0x57')][_0xf622('0x69')]=_0x55074c['id'];if(_0x206004[_0xf622('0x4a')][_0xf622('0x55')]){_0x351449[_0xf622('0x57')]=_[_0xf622('0x56')](_0x351449[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x351449[_0xf622('0x4f')],function(_0x4e7f50){var _0x981008={};_0x981008[_0x4e7f50]={'$like':'%'+_0x206004[_0xf622('0x4a')][_0xf622('0x55')]+'%'};return _0x981008;})});}_0x351449=_['merge']({},_0x351449,_0x206004[_0xf622('0x59')]);return db['MailInteraction']['count']({'where':_0x351449['where']})[_0xf622('0x38')](function(_0x13ca31){_0x550f88[_0xf622('0x30')]=_0x13ca31;if(_0x206004[_0xf622('0x4a')]['includeAll']){_0x351449[_0xf622('0x5d')]=[{'model':db[_0xf622('0x8e')],'as':'Contact','required':![]},{'model':db[_0xf622('0x8f')],'as':_0xf622('0x90'),'attributes':[_0xf622('0x3d'),_0xf622('0x91'),_0xf622('0x92')],'required':![]},{'model':db[_0xf622('0x93')],'as':_0xf622('0x94'),'attributes':['id',_0xf622('0x3d'),'color'],'where':_0x206004[_0xf622('0x4a')][_0xf622('0x95')]?{'id':_0x206004[_0xf622('0x4a')][_0xf622('0x95')]}:undefined,'required':_0x206004['query']['tag']?!![]:![]}];}return db[_0xf622('0x8b')][_0xf622('0x6c')](_0x351449);})[_0xf622('0x38')](function(_0x23aa63){_0x550f88['rows']=_0x23aa63;return _0x550f88;});}})[_0xf622('0x38')](respondWithFilteredResult(_0x16ecde,_0x351449))[_0xf622('0x29')](handleError(_0x16ecde,null));};exports[_0xf622('0x96')]=function addApplications(_0x50f2ec,_0x5edc06){var _0x1db84a=_0x50f2ec[_0xf622('0x5b')]['id'];var _0x284bbe=_0x50f2ec[_0xf622('0x5e')];var _0x39d325=0xc8;var _0x308d16=null;return db[_0xf622('0x97')][_0xf622('0x98')]({'isolationLevel':db['sequelize'][_0xf622('0x99')][_0xf622('0x9a')]['READ_COMMITTED']},function(_0x5eac46){return db[_0xf622('0x45')]['findOne']({'where':{'id':_0x1db84a},'transaction':_0x5eac46})[_0xf622('0x38')](function(_0x50ab9c){if(_0x50ab9c){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x1db84a},'transaction':_0x5eac46})[_0xf622('0x38')](function(){var _0x3ae981=_[_0xf622('0x44')](_0x284bbe,function(_0x5f5059){_0x5f5059['MailAccountId']=_0x1db84a;return _0x5f5059;});return db[_0xf622('0x9b')]['bulkCreate'](_0x3ae981,{'transaction':_0x5eac46});});}else{_0x39d325=0x194;_0x308d16=[];}});})[_0xf622('0x38')](function(){if(_0x39d325!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x1db84a},'order':_0xf622('0x9c')})[_0xf622('0x38')](function(_0x4261ef){_0x308d16=_0x4261ef;});}})['catch'](function(_0xfb5807){_0x39d325=0x1f4;logger[_0xf622('0x25')](_0xfb5807['stack']);if(_0xfb5807[_0xf622('0x3d')]){delete _0xfb5807[_0xf622('0x3d')];}_0x308d16=_0xfb5807;})[_0xf622('0x9d')](function(){if(_0x308d16===null){_0x5edc06[_0xf622('0x2a')](_0x39d325);}else{if(_0x39d325===0x1f4){_0x5edc06[_0xf622('0x31')](_0x39d325)[_0xf622('0x9e')](_0x308d16);}else{_0x5edc06[_0xf622('0x31')](_0x39d325)[_0xf622('0x2c')](_0x308d16);}}});};exports[_0xf622('0x9f')]=function(_0x13f52f,_0xb67a59,_0x502923){var _0x1bd4d7={};var _0x46a338={};var _0x12f949;var _0x4711a5;return db[_0xf622('0x45')][_0xf622('0x64')]({'where':{'id':_0x13f52f[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0xb67a59,null))[_0xf622('0x38')](function(_0x4e5765){if(_0x4e5765){_0x12f949=_0x4e5765;_0x46a338['model']=_[_0xf622('0x4b')](db[_0xf622('0x9b')]['rawAttributes']);_0x46a338[_0xf622('0x4a')]=_[_0xf622('0x4b')](_0x13f52f[_0xf622('0x4a')]);_0x46a338[_0xf622('0x4c')]=_[_0xf622('0x4d')](_0x46a338[_0xf622('0x4e')],_0x46a338[_0xf622('0x4a')]);_0x1bd4d7[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x46a338['model'],qs[_0xf622('0x50')](_0x13f52f[_0xf622('0x4a')][_0xf622('0x50')]));_0x1bd4d7[_0xf622('0x4f')]=_0x1bd4d7[_0xf622('0x4f')]['length']?_0x1bd4d7[_0xf622('0x4f')]:_0x46a338['model'];_0x1bd4d7[_0xf622('0x52')]=qs['sort'](_0x13f52f['query'][_0xf622('0x53')]);_0x1bd4d7['where']=qs['filters'](_[_0xf622('0x54')](_0x13f52f[_0xf622('0x4a')],_0x46a338[_0xf622('0x4c')]));if(_0x13f52f[_0xf622('0x4a')][_0xf622('0x55')]){_0x1bd4d7[_0xf622('0x57')]=_['merge'](_0x1bd4d7[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x1bd4d7[_0xf622('0x4f')],function(_0x3d3156){var _0x23c481={};_0x23c481[_0x3d3156]={'$like':'%'+_0x13f52f[_0xf622('0x4a')][_0xf622('0x55')]+'%'};return _0x23c481;})});}_0x1bd4d7=_[_0xf622('0x56')]({},_0x1bd4d7,_0x13f52f[_0xf622('0x59')]);return _0x12f949[_0xf622('0x9f')](_0x1bd4d7);}})['then'](function(_0x4c8754){if(_0x4c8754){_0x4711a5=_0x4c8754['length'];if(!_0x13f52f[_0xf622('0x4a')][_0xf622('0x65')](_0xf622('0x66'))){_0x1bd4d7['limit']=qs['limit'](_0x13f52f[_0xf622('0x4a')][_0xf622('0x2f')]);_0x1bd4d7[_0xf622('0x2d')]=qs['offset'](_0x13f52f[_0xf622('0x4a')][_0xf622('0x2d')]);}return _0x12f949['getApplications'](_0x1bd4d7);}})[_0xf622('0x38')](function(_0x405d47){if(_0x405d47){return _0x405d47?{'count':_0x4711a5,'rows':_0x405d47}:null;}})[_0xf622('0x38')](respondWithResult(_0xb67a59,null))['catch'](handleError(_0xb67a59,null));};exports[_0xf622('0xa0')]=function(_0x52cdea,_0xe61f3e,_0x4b966a){var _0x1879d2={'raw':!![],'where':{}};var _0x322932={};var _0x496007={'count':0x0,'rows':[]};return db[_0xf622('0x45')][_0xf622('0x64')]({'where':{'id':_0x52cdea[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0xe61f3e,null))[_0xf622('0x38')](function(_0xa40b25){if(_0xa40b25){_0x322932[_0xf622('0x4e')]=_['keys'](db[_0xf622('0xa1')][_0xf622('0x46')]);_0x322932['query']=_[_0xf622('0x4b')](_0x52cdea[_0xf622('0x4a')]);_0x322932['filters']=_[_0xf622('0x4d')](_0x322932['model'],_0x322932['query']);_0x1879d2[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x322932[_0xf622('0x4e')],qs[_0xf622('0x50')](_0x52cdea[_0xf622('0x4a')][_0xf622('0x50')]));_0x1879d2[_0xf622('0x4f')]=_0x1879d2['attributes'][_0xf622('0x51')]?_0x1879d2[_0xf622('0x4f')]:_0x322932[_0xf622('0x4e')];if(!_0x52cdea['query'][_0xf622('0x65')](_0xf622('0x66'))){_0x1879d2[_0xf622('0x2f')]=qs[_0xf622('0x2f')](_0x52cdea['query'][_0xf622('0x2f')]);_0x1879d2[_0xf622('0x2d')]=qs[_0xf622('0x2d')](_0x52cdea[_0xf622('0x4a')][_0xf622('0x2d')]);}_0x1879d2['order']=qs[_0xf622('0x53')](_0x52cdea[_0xf622('0x4a')][_0xf622('0x53')]);_0x1879d2[_0xf622('0x57')]=qs['filters'](_[_0xf622('0x54')](_0x52cdea[_0xf622('0x4a')],_0x322932['filters']));_0x1879d2[_0xf622('0x57')][_0xf622('0x69')]=_0xa40b25['id'];if(_0x52cdea[_0xf622('0x4a')][_0xf622('0x55')]){_0x1879d2[_0xf622('0x57')]=_['merge'](_0x1879d2[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x1879d2['attributes'],function(_0x1a343e){var _0x538a5b={};_0x538a5b[_0x1a343e]={'$like':'%'+_0x52cdea['query']['filter']+'%'};return _0x538a5b;})});}if(_0x52cdea['query'][_0xf622('0xa2')]){var _0x162089=_0x52cdea[_0xf622('0x4a')][_0xf622('0xa2')]['split'](',');var _0x5f24ea={};_0x5f24ea[_0x162089[0x0]]={'$gte':moment(_0x162089[0x1])[_0xf622('0xa3')](_0xf622('0xa4'))};_0x1879d2[_0xf622('0x57')]=_['merge'](_0x1879d2[_0xf622('0x57')],_0x5f24ea);}_0x1879d2=_[_0xf622('0x56')]({},_0x1879d2,_0x52cdea['options']);return db[_0xf622('0xa1')][_0xf622('0x30')]({'where':_0x1879d2[_0xf622('0x57')]})[_0xf622('0x38')](function(_0x38e6b1){_0x496007[_0xf622('0x30')]=_0x38e6b1;if(_0x52cdea[_0xf622('0x4a')][_0xf622('0x5c')]){_0x1879d2[_0xf622('0x5d')]=[{'all':!![]}];}return db[_0xf622('0xa1')]['findAll'](_0x1879d2);})[_0xf622('0x38')](function(_0x1d8576){if(_0x52cdea[_0xf622('0x4a')][_0xf622('0xa5')]==='true'){for(var _0x319657=0x0;_0x319657<_0x1d8576[_0xf622('0x51')];_0x319657++){_0x1d8576[_0x319657][_0xf622('0x5e')]=juice(_0x1d8576[_0x319657]['body']);}}_0x496007['rows']=_0x1d8576;return _0x496007;});}})[_0xf622('0x38')](respondWithFilteredResult(_0xe61f3e,_0x1879d2))[_0xf622('0x29')](handleError(_0xe61f3e,null));};exports['send']=function(_0x32c17f,_0x295ca1,_0x249562){var _0x1e714d,_0x5ae219={},_0x5d846c;if(_0x32c17f[_0xf622('0x5e')]['to']){_0x5d846c=_0x32c17f[_0xf622('0x5e')]['to'][_0xf622('0xa6')](',')[0x0];}return db[_0xf622('0x45')]['find']({'where':{'id':_0x32c17f[_0xf622('0x5b')]['id']},'include':[{'model':db[_0xf622('0xa7')],'as':_0xf622('0xa8'),'include':[{'model':db['CmContact'],'as':_0xf622('0xa9'),'where':{'email':_0x5d846c},'limit':0x1,'order':[[_0xf622('0xaa'),_0xf622('0xab')]]}]},{'model':db['MailServerOut'],'as':_0xf622('0x41'),'raw':!![]}]})[_0xf622('0x38')](handleEntityNotFound(_0x295ca1,null))[_0xf622('0x38')](function(_0x3c84e3){if(_0x3c84e3){_0x1e714d=_0x3c84e3;if(_0x3c84e3['Smtp']){if(_['isNil'](_0x32c17f[_0xf622('0x5e')][_0xf622('0xac')])){_0x32c17f['body'][_0xf622('0xac')]=util[_0xf622('0xa3')](_0xf622('0xad'),_0x3c84e3['name'],_0x3c84e3[_0xf622('0x6f')]||_0x3c84e3[_0xf622('0x41')]['user']);}if(_0x32c17f['body'][_0xf622('0xae')]&&_0x32c17f[_0xf622('0x5e')]['attachments'][_0xf622('0x51')]){for(var _0x2a065f=0x0;_0x2a065f<_0x32c17f[_0xf622('0x5e')][_0xf622('0xae')]['length'];_0x2a065f+=0x1){_0x32c17f[_0xf622('0x5e')][_0xf622('0xae')][_0x2a065f]={'filename':_0x32c17f[_0xf622('0x5e')][_0xf622('0xae')][_0x2a065f]['name'],'path':path[_0xf622('0xaf')](config['root'],'server/files/attachments',_0x32c17f['body'][_0xf622('0xae')][_0x2a065f][_0xf622('0xb0')])};}}var _0x383056={'tls':{'rejectUnauthorized':![]}};if(_[_0xf622('0x71')](_0x3c84e3['Smtp'][_0xf622('0x7b')])){if(_0x3c84e3['Smtp'][_0xf622('0x78')]){_0x383056[_0xf622('0xb1')]={'user':_0x3c84e3[_0xf622('0x41')][_0xf622('0x75')],'pass':_0x3c84e3[_0xf622('0x41')][_0xf622('0x7d')]};}_0x383056[_0xf622('0x79')]=_0x3c84e3[_0xf622('0x41')]['host'];_0x383056[_0xf622('0x7a')]=_0x3c84e3[_0xf622('0x41')][_0xf622('0x7a')];_0x383056[_0xf622('0xb2')]=_0x3c84e3['Smtp'][_0xf622('0xb2')];}else{_0x383056[_0xf622('0x7b')]=_0x3c84e3[_0xf622('0x41')][_0xf622('0x7b')];_0x383056['auth']={'user':_0x3c84e3[_0xf622('0x41')]['user'],'pass':_0x3c84e3[_0xf622('0x41')]['pass']};}return respondWithRpcPromise(_0xf622('0xb3'),_0xf622('0xb4'),{'account':_0x383056,'message':_0x32c17f[_0xf622('0x5e')]});}else{throw new Error(_0xf622('0xb5'));}}})[_0xf622('0x38')](function(_0x6652e0){if(_0x6652e0){_0x5ae219=_0x6652e0;if(_0x1e714d[_0xf622('0xa8')]){if(_0x1e714d[_0xf622('0xa8')][_0xf622('0xa9')][_0xf622('0x51')]){return _0x1e714d[_0xf622('0xa8')][_0xf622('0xa9')][0x0];}else{return db['CmContact'][_0xf622('0x63')](_[_0xf622('0x18')](_0x32c17f[_0xf622('0x5e')],{'firstName':_0x32c17f[_0xf622('0x5e')]['to'],'email':_0x32c17f[_0xf622('0x5e')]['to'],'phone':_0x32c17f[_0xf622('0x5e')]['to'],'ListId':_0x1e714d['ListId']}));}}else{throw new Error(_0xf622('0xb5'));}}})[_0xf622('0x38')](function(_0x446447){if(_0x446447){var _0x32b8b6={'UserId':_0x32c17f[_0xf622('0x75')]['id'],'ContactId':_0x446447['id'],'MailAccountId':_0x1e714d['id'],'inReplyTo':_0x5ae219['messageId'],'to':_0x32c17f['body'][_0xf622('0xac')],'cc':_0x32c17f[_0xf622('0x5e')]['cc'],'subject':_0x32c17f[_0xf622('0x5e')][_0xf622('0xb6')],'attach':_0x32c17f[_0xf622('0x5e')][_0xf622('0xb7')],'firstMsgDirection':_0xf622('0xb8'),'lastMsgAt':moment()[_0xf622('0xa3')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf622('0xb8'),'Messages':[_[_0xf622('0x56')](_0x32c17f['body'],{'messageId':_0x5ae219[_0xf622('0xb9')],'sentAt':moment()['format'](_0xf622('0xa4')),'read':!![],'MailAccountId':_0x1e714d['id'],'UserId':_0x32c17f[_0xf622('0x75')]['id'],'ContactId':_0x446447['id']})]};if(_0x32c17f['body']['Interaction']){_0x32b8b6=_[_0xf622('0x56')](_0x32b8b6,_0x32c17f['body'][_0xf622('0xba')]);}return db['MailInteraction']['create'](_0x32b8b6,{'include':[{'model':db['MailMessage'],'as':_0xf622('0xbb')}]});}})[_0xf622('0x38')](respondWithResult(_0x295ca1,null))['catch'](handleError(_0x295ca1,null));};exports[_0xf622('0xbc')]=function(_0x1ac665,_0x32e4b0,_0x403f80){return db['MailAccount'][_0xf622('0x5f')]({'where':{'id':_0x1ac665[_0xf622('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xf622('0x41'),'raw':!![]}]})[_0xf622('0x38')](handleEntityNotFound(_0x32e4b0,null))['then'](function(_0x3f5b2d){if(_0x3f5b2d&&_0x3f5b2d[_0xf622('0x41')]){var _0x416bd6={'id':_0x3f5b2d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3f5b2d[_0xf622('0x41')][_0xf622('0x7b')]){_0x416bd6['service']=_0x3f5b2d['Smtp']['service'];}else{_0x416bd6[_0xf622('0x79')]=_0x3f5b2d[_0xf622('0x41')]['host'];_0x416bd6[_0xf622('0x7a')]=_0x3f5b2d[_0xf622('0x41')][_0xf622('0x7a')];_0x416bd6[_0xf622('0xb2')]=_0x3f5b2d[_0xf622('0x41')][_0xf622('0xb2')];}if(_0x3f5b2d[_0xf622('0x41')]['authentication']){_0x416bd6['auth']={'user':_0x3f5b2d[_0xf622('0x41')][_0xf622('0x75')],'pass':_0x3f5b2d[_0xf622('0x41')]['pass']};}return respondWithRpcPromise(_0xf622('0xbd'),_0xf622('0xbc'),{'account':_0x416bd6});}})[_0xf622('0x38')](respondWithResult(_0x32e4b0,null))['catch'](handleError(_0x32e4b0,null));};exports['destroy']=function(_0x33d1cd,_0x3dc1fd){return db[_0xf622('0x45')][_0xf622('0x5f')]({'where':{'id':_0x33d1cd[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x3dc1fd,null))[_0xf622('0x38')](function(_0x111d03){if(_0x111d03&&_0x111d03[_0xf622('0x7b')]){throw new db['Sequelize'][(_0xf622('0xbe'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x111d03;})[_0xf622('0x38')](removeEntity(_0x3dc1fd,null))['catch'](handleError(_0x3dc1fd,null));};exports[_0xf622('0xbf')]=function(_0x214079,_0x165c5e,_0x12b42f){return db['MailAccount'][_0xf622('0x5f')]({'where':{'id':_0x214079[_0xf622('0x5b')]['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x165c5e,null))[_0xf622('0x38')](function(_0x432091){if(_0x432091){return _0x432091[_0xf622('0xbf')](_0x214079[_0xf622('0x5e')][_0xf622('0x6e')],_[_0xf622('0x8c')](_0x214079[_0xf622('0x5e')],['ids','id'])||{})['spread'](function(_0xb2d9c7){for(var _0x8b0101=0x0;_0x8b0101<_0x214079[_0xf622('0x5e')][_0xf622('0x6e')][_0xf622('0x51')];_0x8b0101+=0x1){socket[_0xf622('0xc0')](_0xf622('0xc1'),{'UserId':Number(_0x214079[_0xf622('0x5e')][_0xf622('0x6e')][_0x8b0101]),'MailAccountId':Number(_0x214079[_0xf622('0x5b')]['id'])});}return _0xb2d9c7;});}})[_0xf622('0x38')](respondWithResult(_0x165c5e,null))['catch'](handleError(_0x165c5e,null));};exports[_0xf622('0xc2')]=function(_0x10824f,_0x21f7b2,_0xda0d44){return db[_0xf622('0x45')]['find']({'where':{'id':_0x10824f['params']['id']}})[_0xf622('0x38')](handleEntityNotFound(_0x21f7b2,null))[_0xf622('0x38')](function(_0x354680){if(_0x354680){return _0x354680['removeAgents'](_0x10824f[_0xf622('0x4a')][_0xf622('0x6e')])[_0xf622('0x38')](function(){if(_[_0xf622('0xc3')](_0x10824f[_0xf622('0x4a')][_0xf622('0x6e')])){for(var _0x21d53c=0x0;_0x21d53c<_0x10824f['query']['ids'][_0xf622('0x51')];_0x21d53c+=0x1){socket[_0xf622('0xc0')]('userMailAccount:remove',{'UserId':Number(_0x10824f['query']['ids'][_0x21d53c]),'MailAccountId':Number(_0x10824f[_0xf622('0x5b')]['id'])});}}else{socket['emit'](_0xf622('0xc4'),{'UserId':Number(_0x10824f[_0xf622('0x4a')][_0xf622('0x6e')]),'MailAccountId':Number(_0x10824f[_0xf622('0x5b')]['id'])});}});}})[_0xf622('0x38')](respondWithStatusCode(_0x21f7b2,null))[_0xf622('0x29')](handleError(_0x21f7b2,null));};exports[_0xf622('0xc5')]=function(_0x4fd9bb,_0x5614fb,_0x231950){var _0x180cca={};var _0x3de4dc={};var _0xc9b2c5;var _0x2634d3;return db[_0xf622('0x45')][_0xf622('0x64')]({'where':{'id':_0x4fd9bb[_0xf622('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5614fb,null))[_0xf622('0x38')](function(_0x31a547){if(_0x31a547){_0xc9b2c5=_0x31a547;_0x3de4dc[_0xf622('0x4e')]=_[_0xf622('0x4b')](db[_0xf622('0x8f')][_0xf622('0x46')]);_0x3de4dc[_0xf622('0x4a')]=_[_0xf622('0x4b')](_0x4fd9bb[_0xf622('0x4a')]);_0x3de4dc[_0xf622('0x4c')]=_[_0xf622('0x4d')](_0x3de4dc[_0xf622('0x4e')],_0x3de4dc[_0xf622('0x4a')]);_0x180cca[_0xf622('0x4f')]=_[_0xf622('0x4d')](_0x3de4dc[_0xf622('0x4e')],qs[_0xf622('0x50')](_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x50')]));_0x180cca['attributes']=_0x180cca[_0xf622('0x4f')][_0xf622('0x51')]?_0x180cca[_0xf622('0x4f')]:_0x3de4dc[_0xf622('0x4e')];_0x180cca[_0xf622('0x52')]=qs[_0xf622('0x53')](_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x53')]);_0x180cca[_0xf622('0x57')]=qs[_0xf622('0x4c')](_['pick'](_0x4fd9bb['query'],_0x3de4dc[_0xf622('0x4c')]));if(_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x55')]){_0x180cca['where']=_[_0xf622('0x56')](_0x180cca[_0xf622('0x57')],{'$or':_[_0xf622('0x44')](_0x180cca[_0xf622('0x4f')],function(_0x58c16f){var _0x3ed222={};_0x3ed222[_0x58c16f]={'$like':'%'+_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x55')]+'%'};return _0x3ed222;})});}_0x180cca=_[_0xf622('0x56')]({},_0x180cca,_0x4fd9bb[_0xf622('0x59')]);return _0xc9b2c5[_0xf622('0xc5')](_0x180cca);}})[_0xf622('0x38')](function(_0x5aa70e){if(_0x5aa70e){_0x2634d3=_0x5aa70e[_0xf622('0x51')];if(!_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x65')](_0xf622('0x66'))){_0x180cca[_0xf622('0x2f')]=qs['limit'](_0x4fd9bb['query'][_0xf622('0x2f')]);_0x180cca[_0xf622('0x2d')]=qs[_0xf622('0x2d')](_0x4fd9bb[_0xf622('0x4a')][_0xf622('0x2d')]);}return _0xc9b2c5[_0xf622('0xc5')](_0x180cca);}})['then'](function(_0x2c59bd){if(_0x2c59bd){return _0x2c59bd?{'count':_0x2634d3,'rows':_0x2c59bd}:null;}})[_0xf622('0x38')](respondWithResult(_0x5614fb,null))[_0xf622('0x29')](handleError(_0x5614fb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 2a648af..5b495ae 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 _0x5b0d=['setMaxListeners','emit','hook','exports','../../mysqldb'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0x5b0d,0x153));var _0xd5b0=function(_0x11b4f8,_0x2f0a69){_0x11b4f8=_0x11b4f8-0x0;var _0x1fd16e=_0x5b0d[_0x11b4f8];return _0x1fd16e;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xd5b0('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd5b0('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b1361){return function(_0x52bc8e,_0x42f172,_0x2c617e){MailAccountEvents[_0xd5b0('0x2')](_0x3b1361+':'+_0x52bc8e['id'],_0x52bc8e);MailAccountEvents['emit'](_0x3b1361,_0x52bc8e);_0x2c617e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xd5b0('0x3')](e,emitEvent(event));}}module[_0xd5b0('0x4')]=MailAccountEvents; \ No newline at end of file +var _0xa9f3=['setMaxListeners','save','emit','events','../../mysqldb'];(function(_0x47c902,_0x220fd2){var _0x1ad6a0=function(_0xf9fdb0){while(--_0xf9fdb0){_0x47c902['push'](_0x47c902['shift']());}};_0x1ad6a0(++_0x220fd2);}(_0xa9f3,0x1de));var _0x3a9f=function(_0x2e6bcd,_0x364b83){_0x2e6bcd=_0x2e6bcd-0x0;var _0x106812=_0xa9f3[_0x2e6bcd];return _0x106812;};'use strict';var EventEmitter=require(_0x3a9f('0x0'));var MailAccount=require(_0x3a9f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3a9f('0x2')](0x0);var events={'afterCreate':_0x3a9f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19d4c3){return function(_0x2b7836,_0x50d15e,_0x43d394){MailAccountEvents[_0x3a9f('0x4')](_0x19d4c3+':'+_0x2b7836['id'],_0x2b7836);MailAccountEvents[_0x3a9f('0x4')](_0x19d4c3,_0x2b7836);_0x43d394(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 19123ce..de00e29 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 _0xf67b=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','MailAccount','lodash'];(function(_0x5b19ae,_0x2fef9e){var _0x367f6a=function(_0x1bcbf1){while(--_0x1bcbf1){_0x5b19ae['push'](_0x5b19ae['shift']());}};_0x367f6a(++_0x2fef9e);}(_0xf67b,0xf9));var _0xbf67=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xf67b[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0xbf67('0x0'));var util=require(_0xbf67('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf67('0x2'));var BPromise=require(_0xbf67('0x3'));var rp=require(_0xbf67('0x4'));var fs=require('fs');var path=require(_0xbf67('0x5'));var rimraf=require(_0xbf67('0x6'));var config=require(_0xbf67('0x7'));var attributes=require(_0xbf67('0x8'));module['exports']=function(_0x26f7bd,_0x3a4fbb){return _0x26f7bd['define'](_0xbf67('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x121a=['moment','bluebird','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api'];(function(_0x62af71,_0x44c986){var _0x594052=function(_0x47fe29){while(--_0x47fe29){_0x62af71['push'](_0x62af71['shift']());}};_0x594052(++_0x44c986);}(_0x121a,0x141));var _0xa121=function(_0x3490d4,_0x1e7bbc){_0x3490d4=_0x3490d4-0x0;var _0x8f02fd=_0x121a[_0x3490d4];return _0x8f02fd;};'use strict';var _=require(_0xa121('0x0'));var util=require(_0xa121('0x1'));var logger=require(_0xa121('0x2'))(_0xa121('0x3'));var moment=require(_0xa121('0x4'));var BPromise=require(_0xa121('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa121('0x6'));var rimraf=require(_0xa121('0x7'));var config=require('../../config/environment');var attributes=require(_0xa121('0x8'));module[_0xa121('0x9')]=function(_0x4d05f2,_0x1f33ea){return _0x4d05f2[_0xa121('0xa')](_0xa121('0xb'),attributes,{'tableName':_0xa121('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index a57f5fa..4f438d1 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 _0xc1c1=['unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','where','attributes','limit','include','map','model','ShowMailAccount','raw','debug','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','List','DESC','MailApplication','Applications','MailServerOut','get','omit','applications','orderBy','priority','asc','autoclose','length','close','*,*,*,*','Contacts','List\x20not\x20found','contact','generate','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','Contact\x20not\x20found','spread','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','User','find','UserId'];(function(_0x29a7df,_0x4b64e2){var _0x25b33d=function(_0x49a6ce){while(--_0x49a6ce){_0x29a7df['push'](_0x29a7df['shift']());}};_0x25b33d(++_0x4b64e2);}(_0xc1c1,0x13a));var _0x1c1c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc1c1[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1c1c('0x0'));var util=require('util');var moment=require(_0x1c1c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c1c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c1c('0x3'));var logger=require(_0x1c1c('0x4'))(_0x1c1c('0x5'));var config=require('../../config/environment');var jayson=require(_0x1c1c('0x6'));var client=jayson['client'][_0x1c1c('0x7')]({'port':0x232c});config[_0x1c1c('0x8')]=_[_0x1c1c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1c1c('0xa'))[_0x1c1c('0xb')](socket);function respondWithRpcPromise(_0x304976,_0x3de8ae,_0x348522){return new BPromise(function(_0x3b4ad8,_0x25759a){return client[_0x1c1c('0xc')](_0x304976,_0x348522)[_0x1c1c('0xd')](function(_0x18265b){logger[_0x1c1c('0xe')](_0x1c1c('0xf'),_0x3de8ae,_0x1c1c('0x10'));logger['debug'](_0x1c1c('0x11'),_0x3de8ae,_0x1c1c('0x10'),JSON[_0x1c1c('0x12')](_0x18265b));if(_0x18265b[_0x1c1c('0x13')]){if(_0x18265b[_0x1c1c('0x13')][_0x1c1c('0x14')]===0x1f4){logger[_0x1c1c('0x13')](_0x1c1c('0xf'),_0x3de8ae,_0x18265b[_0x1c1c('0x13')]['message']);return _0x25759a(_0x18265b[_0x1c1c('0x13')][_0x1c1c('0x15')]);}logger[_0x1c1c('0x13')](_0x1c1c('0xf'),_0x3de8ae,_0x18265b[_0x1c1c('0x13')]['message']);return _0x3b4ad8(_0x18265b['error'][_0x1c1c('0x15')]);}else{logger[_0x1c1c('0xe')]('MailAccount,\x20%s,\x20%s',_0x3de8ae,_0x1c1c('0x10'));_0x3b4ad8(_0x18265b['result']['message']);}})[_0x1c1c('0x16')](function(_0x4c04c8){logger[_0x1c1c('0x13')](_0x1c1c('0xf'),_0x3de8ae,_0x4c04c8);_0x25759a(_0x4c04c8);});});}exports[_0x1c1c('0x17')]=function(_0x151fb1){var _0x4c6977=this;return new Promise(function(_0xd82262,_0x4af506){return db['MailAccount'][_0x1c1c('0x18')]({'raw':_0x151fb1[_0x1c1c('0x19')]?_0x151fb1[_0x1c1c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x151fb1[_0x1c1c('0x19')]?_0x151fb1[_0x1c1c('0x19')][_0x1c1c('0x1a')]||null:null,'attributes':_0x151fb1['options']?_0x151fb1['options'][_0x1c1c('0x1b')]||null:null,'limit':_0x151fb1[_0x1c1c('0x19')]?_0x151fb1[_0x1c1c('0x19')][_0x1c1c('0x1c')]||null:null,'include':_0x151fb1[_0x1c1c('0x19')]?_0x151fb1[_0x1c1c('0x19')][_0x1c1c('0x1d')]?_[_0x1c1c('0x1e')](_0x151fb1['options']['include'],function(_0x38a36b){return{'model':db[_0x38a36b[_0x1c1c('0x1f')]],'as':_0x38a36b['as'],'attributes':_0x38a36b[_0x1c1c('0x1b')],'include':_0x38a36b[_0x1c1c('0x1d')]?_[_0x1c1c('0x1e')](_0x38a36b[_0x1c1c('0x1d')],function(_0x292f87){return{'model':db[_0x292f87[_0x1c1c('0x1f')]],'as':_0x292f87['as'],'attributes':_0x292f87[_0x1c1c('0x1b')],'include':_0x292f87[_0x1c1c('0x1d')]?_[_0x1c1c('0x1e')](_0x292f87[_0x1c1c('0x1d')],function(_0x8b5a6a){return{'model':db[_0x8b5a6a['model']],'as':_0x8b5a6a['as'],'attributes':_0x8b5a6a[_0x1c1c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c8509){logger[_0x1c1c('0xe')](_0x1c1c('0x17'),_0x151fb1);logger['debug'](_0x1c1c('0x17'),_0x151fb1,JSON[_0x1c1c('0x12')](_0x4c8509));_0xd82262(_0x4c8509);})['catch'](function(_0x592483){logger[_0x1c1c('0x13')]('GetMailAccount',_0x592483[_0x1c1c('0x15')],_0x151fb1);_0x4af506(_0x4c6977['error'](0x1f4,_0x592483[_0x1c1c('0x15')]));});});};exports[_0x1c1c('0x20')]=function(_0x4b3a06){var _0x5a24d1=this;return new Promise(function(_0x3c043,_0x57ea01){return db['MailAccount']['find']({'raw':_0x4b3a06[_0x1c1c('0x19')]?_0x4b3a06[_0x1c1c('0x19')][_0x1c1c('0x21')]===undefined?!![]:![]:!![],'where':_0x4b3a06[_0x1c1c('0x19')]?_0x4b3a06[_0x1c1c('0x19')][_0x1c1c('0x1a')]||null:null,'attributes':_0x4b3a06[_0x1c1c('0x19')]?_0x4b3a06[_0x1c1c('0x19')][_0x1c1c('0x1b')]||null:null,'include':_0x4b3a06['options']?_0x4b3a06[_0x1c1c('0x19')][_0x1c1c('0x1d')]?_[_0x1c1c('0x1e')](_0x4b3a06[_0x1c1c('0x19')][_0x1c1c('0x1d')],function(_0x5affd5){return{'model':db[_0x5affd5[_0x1c1c('0x1f')]],'as':_0x5affd5['as'],'attributes':_0x5affd5[_0x1c1c('0x1b')],'include':_0x5affd5[_0x1c1c('0x1d')]?_[_0x1c1c('0x1e')](_0x5affd5[_0x1c1c('0x1d')],function(_0x445206){return{'model':db[_0x445206[_0x1c1c('0x1f')]],'as':_0x445206['as'],'attributes':_0x445206[_0x1c1c('0x1b')],'include':_0x445206['include']?_['map'](_0x445206[_0x1c1c('0x1d')],function(_0x466873){return{'model':db[_0x466873[_0x1c1c('0x1f')]],'as':_0x466873['as'],'attributes':_0x466873['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c1c('0xd')](function(_0x29a5ee){logger['info']('ShowMailAccount',_0x4b3a06);logger[_0x1c1c('0x22')](_0x1c1c('0x20'),_0x4b3a06,JSON[_0x1c1c('0x12')](_0x29a5ee));_0x3c043(_0x29a5ee);})[_0x1c1c('0x16')](function(_0x17f252){logger[_0x1c1c('0x13')](_0x1c1c('0x20'),_0x17f252[_0x1c1c('0x15')],_0x4b3a06);_0x57ea01(_0x5a24d1[_0x1c1c('0x13')](0x1f4,_0x17f252[_0x1c1c('0x15')]));});});};exports[_0x1c1c('0x23')]=function(_0xa1d51e){var _0x9356cf=this;return new Promise(function(_0x560ca7,_0x3ede43){var _0x4bd460={'body':_0xa1d51e[_0x1c1c('0x24')],'channel':_0x1c1c('0x25')};var _0xc0d1f2=_[_0x1c1c('0x26')](_[_0x1c1c('0x27')](db[_0x1c1c('0x28')][_0x1c1c('0x29')]),[_0x1c1c('0x2a'),'updatedAt',_0x1c1c('0x2b'),_0x1c1c('0x2c')]);var _0x10efc2=![];if(_0xa1d51e[_0x1c1c('0x24')]['id']){delete _0xa1d51e[_0x1c1c('0x24')]['id'];}if(_[_0x1c1c('0x2d')](_0xa1d51e['body'][_0x1c1c('0x2e')])){return _0x3ede43(_0x9356cf[_0x1c1c('0x13')](0x1f4,_0x1c1c('0x2f')));}if(_['isNil'](_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x24')])||_0xa1d51e[_0x1c1c('0x24')]['body']===''){return _0x3ede43(_0x9356cf[_0x1c1c('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1c1c('0x2d')](_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x30')])){return _0x3ede43(_0x9356cf[_0x1c1c('0x13')](0x1f4,_0x1c1c('0x31')+_0xc0d1f2));}if(!_[_0x1c1c('0x32')](_0xc0d1f2,_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x30')])){return _0x3ede43(_0x9356cf[_0x1c1c('0x13')](0x1f4,_0x1c1c('0x33')+_0xc0d1f2));}var _0x3dcfa7={};_0x3dcfa7[_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x30')]]=_0xa1d51e['body']['from'];return db[_0x1c1c('0x34')]['find']({'where':{'id':_0xa1d51e[_0x1c1c('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0x1c1c('0x36'),'include':[{'model':db[_0x1c1c('0x28')],'as':'Contacts','where':_0x3dcfa7,'limit':0x1,'order':[['updatedAt',_0x1c1c('0x37')]]}]},{'model':db[_0x1c1c('0x38')],'as':_0x1c1c('0x39')},{'model':db[_0x1c1c('0x3a')],'as':'Smtp'}]})['then'](function(_0x1006d7){if(_0x1006d7&&_0x1006d7['List']){var _0x3603aa=_0x1006d7[_0x1c1c('0x3b')]({'plain':!![]});_0x4bd460['account']=_[_0x1c1c('0x3c')](_0x3603aa,[_0x1c1c('0x39'),_0x1c1c('0x36')]);_0x4bd460[_0x1c1c('0x3d')]=_0x3603aa[_0x1c1c('0x39')];_0x4bd460['list']=_0x3603aa[_0x1c1c('0x36')];_0x4bd460[_0x1c1c('0x3d')]=_[_0x1c1c('0x3e')](_0x4bd460[_0x1c1c('0x3d')],[_0x1c1c('0x3f')],[_0x1c1c('0x40')]);if(_0x4bd460['account']&&_0x4bd460[_0x1c1c('0x35')][_0x1c1c('0x41')]){_0x4bd460[_0x1c1c('0x3d')]['push']({'id':0x0,'priority':_0x4bd460['applications'][_0x1c1c('0x42')]+0x1,'app':_0x1c1c('0x43'),'appdata':_0x1c1c('0x41'),'interval':_0x1c1c('0x44')});}if(_0x4bd460[_0x1c1c('0x35')][_0x1c1c('0x39')]){delete _0x4bd460[_0x1c1c('0x35')][_0x1c1c('0x39')];}if(_0x4bd460[_0x1c1c('0x35')]['List']){delete _0x4bd460['account'][_0x1c1c('0x36')];}if(_0x3603aa[_0x1c1c('0x36')]['Contacts']['length']){return _0x3603aa['List'][_0x1c1c('0x45')][0x0];}var _0x392ea5=_[_0x1c1c('0x9')](_0xa1d51e[_0x1c1c('0x24')],{'firstName':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x2e')],'ListId':_0x3603aa[_0x1c1c('0x2c')]});_0x392ea5[_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x30')]]=_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x2e')];return db['CmContact']['create'](_0x392ea5);}else{throw new Error(_0x1c1c('0x46'));}})[_0x1c1c('0xd')](function(_0x166ae3){_0x4bd460[_0x1c1c('0x47')]=_0x166ae3;if(_0x166ae3){if(!_0xa1d51e['body'][_0x1c1c('0x15')]['messageId']){_0xa1d51e['body'][_0x1c1c('0x15')]['messageId']=rs[_0x1c1c('0x48')]()+'\x20'+_0xa1d51e[_0x1c1c('0x24')]['message'][_0x1c1c('0x2e')];}var _0x2bc5d4={'ContactId':_0x166ae3['id'],'MailAccountId':_0xa1d51e[_0x1c1c('0x35')]['id'],'inReplyTo':_0xa1d51e['body'][_0x1c1c('0x15')][_0x1c1c('0x49')],'to':_0xa1d51e['body']['message'][_0x1c1c('0x2e')],'cc':_0xa1d51e[_0x1c1c('0x24')]['message']['cc'],'subject':_0xa1d51e['body'][_0x1c1c('0x15')][_0x1c1c('0x4a')],'attach':_0xa1d51e['body'][_0x1c1c('0x15')][_0x1c1c('0x4b')],'lastMsgAt':moment()[_0x1c1c('0x4c')](_0x1c1c('0x4d')),'lastMsgDirection':'in'};return db[_0x1c1c('0x4e')]['find']({'where':{'closed':![],'MailAccountId':_0xa1d51e[_0x1c1c('0x35')]['id']},'include':[{'model':db[_0x1c1c('0x4f')],'as':'Messages','attributes':[_0x1c1c('0x49')],'where':{'messageId':_0xa1d51e[_0x1c1c('0x24')]['message'][_0x1c1c('0x50')]}}]})[_0x1c1c('0xd')](function(_0x14bb56){if(_0x14bb56){return[_0x14bb56,![]];}return db[_0x1c1c('0x4e')][_0x1c1c('0x51')](_0x2bc5d4)['then'](function(_0x2d117c){return[_0x2d117c,!![]];});});}else{throw new Error(_0x1c1c('0x52'));}})[_0x1c1c('0x53')](function(_0xb33edb,_0x27fd8f){if(_0xb33edb){_0x10efc2=_0x27fd8f;if(!_0x27fd8f){return _0xb33edb['update']({'inReplyTo':_0xa1d51e['body']['message'][_0x1c1c('0x49')],'to':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x2e')],'cc':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')]['cc'],'subject':_0xa1d51e['body'][_0x1c1c('0x15')][_0x1c1c('0x4a')],'attach':_0xb33edb[_0x1c1c('0x4b')]?_0xb33edb[_0x1c1c('0x4b')]:_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')]['attach'],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x1c1c('0x4c')](_0x1c1c('0x4d')),'lastMsgDirection':'in'});}else{return _0xb33edb;}}})[_0x1c1c('0xd')](function(_0x1f8e7a){_0x4bd460[_0x1c1c('0x54')]=_0x1f8e7a['get']({'plain':!![]});_0x4bd460[_0x1c1c('0x54')][_0x1c1c('0x55')]=_0x10efc2;return db[_0x1c1c('0x4f')][_0x1c1c('0x51')]({'body':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x24')],'MailAccountId':_0xa1d51e[_0x1c1c('0x35')]['id'],'MailInteractionId':_0x1f8e7a['id'],'direction':'in','ContactId':_0x4bd460['contact']['id'],'messageId':_0xa1d51e[_0x1c1c('0x24')]['message']['messageId'],'from':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x2e')],'to':_0xa1d51e[_0x1c1c('0x24')]['message']['to'],'cc':_0xa1d51e[_0x1c1c('0x24')]['message']['cc'],'subject':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x4a')],'attach':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x4b')],'Attachments':_0xa1d51e['body'][_0x1c1c('0x15')][_0x1c1c('0x56')],'originTo':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x57')],'originCc':_0xa1d51e[_0x1c1c('0x24')]['message'][_0x1c1c('0x58')],'bcc':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')][_0x1c1c('0x59')],'ChatWebsiteId':_0xa1d51e[_0x1c1c('0x24')]['message'][_0x1c1c('0x5a')]||null,'originChannel':_0xa1d51e[_0x1c1c('0x24')][_0x1c1c('0x15')]['originChannel']||_0x1c1c('0x5b'),'ChatOfflineMessageId':_0xa1d51e[_0x1c1c('0x24')]['message'][_0x1c1c('0x5c')]||null},{'include':[{'model':db[_0x1c1c('0x5d')],'as':_0x1c1c('0x5e')}]});})[_0x1c1c('0xd')](function(_0x39634d){_0x4bd460['message']=_0x39634d;if(_0x4bd460['interaction']['UserId']){return db[_0x1c1c('0x5f')][_0x1c1c('0x60')]({'attributes':['id','name'],'where':{'id':_0x4bd460[_0x1c1c('0x54')][_0x1c1c('0x61')]}})[_0x1c1c('0xd')](function(_0x4eda65){if(_0x4eda65){_0x4bd460['applications'][_0x1c1c('0x62')]({'id':0x0,'priority':0x0,'app':_0x1c1c('0x63'),'appdata':_0x4eda65['name']+','+(_0x4bd460[_0x1c1c('0x35')][_0x1c1c('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4bd460);});}return respondWithRpcPromise(_0x1c1c('0x65'),_0x1c1c('0x66'),_0x4bd460);})[_0x1c1c('0xd')](function(_0x3c2a6c){_0x560ca7(_0x3c2a6c);})[_0x1c1c('0x16')](function(_0x7f5961){_0x3ede43(_0x9356cf[_0x1c1c('0x13')](0x1f4,_0x7f5961[_0x1c1c('0x15')]));});});}; \ No newline at end of file +var _0x2980=['push','length','close','*,*,*,*','Contacts','defaults','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','UserId','name','unshift','waitForTheAssignedAgent','startRouting','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailAccount','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowMailAccount','MailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','from','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','updatedAt','DESC','MailApplication','Applications','MailServerOut','List','get','account','applications','list','orderBy','asc','autoclose'];(function(_0x40bcc0,_0xa7de4e){var _0x588b67=function(_0x238830){while(--_0x238830){_0x40bcc0['push'](_0x40bcc0['shift']());}};_0x588b67(++_0xa7de4e);}(_0x2980,0x154));var _0x0298=function(_0x324a28,_0x45feab){_0x324a28=_0x324a28-0x0;var _0x333e21=_0x2980[_0x324a28];return _0x333e21;};'use strict';var _=require('lodash');var util=require(_0x0298('0x0'));var moment=require(_0x0298('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0298('0x2'));var db=require(_0x0298('0x3'))['db'];var utils=require(_0x0298('0x4'));var logger=require(_0x0298('0x5'))('rpc');var config=require(_0x0298('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0298('0x7')][_0x0298('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0x0298('0x9')],{'host':_0x0298('0xa'),'port':0x18eb});var socket=require(_0x0298('0xb'))(new Redis(config[_0x0298('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x187b8b,_0x289e89,_0x5ceea9){return new BPromise(function(_0x290290,_0x73a1c0){return client[_0x0298('0xc')](_0x187b8b,_0x5ceea9)[_0x0298('0xd')](function(_0x4550f4){logger['info'](_0x0298('0xe'),_0x289e89,_0x0298('0xf'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x289e89,_0x0298('0xf'),JSON[_0x0298('0x10')](_0x4550f4));if(_0x4550f4[_0x0298('0x11')]){if(_0x4550f4[_0x0298('0x11')][_0x0298('0x12')]===0x1f4){logger[_0x0298('0x11')]('MailAccount,\x20%s,\x20%s',_0x289e89,_0x4550f4[_0x0298('0x11')][_0x0298('0x13')]);return _0x73a1c0(_0x4550f4[_0x0298('0x11')][_0x0298('0x13')]);}logger[_0x0298('0x11')](_0x0298('0xe'),_0x289e89,_0x4550f4['error'][_0x0298('0x13')]);return _0x290290(_0x4550f4[_0x0298('0x11')][_0x0298('0x13')]);}else{logger[_0x0298('0x14')]('MailAccount,\x20%s,\x20%s',_0x289e89,_0x0298('0xf'));_0x290290(_0x4550f4[_0x0298('0x15')][_0x0298('0x13')]);}})[_0x0298('0x16')](function(_0xbd1f71){logger[_0x0298('0x11')](_0x0298('0xe'),_0x289e89,_0xbd1f71);_0x73a1c0(_0xbd1f71);});});}exports[_0x0298('0x17')]=function(_0x353488){var _0x4b571a=this;return new Promise(function(_0x26235d,_0xb8e63d){return db['MailAccount'][_0x0298('0x18')]({'raw':_0x353488[_0x0298('0x19')]?_0x353488['options'][_0x0298('0x1a')]===undefined?!![]:![]:!![],'where':_0x353488[_0x0298('0x19')]?_0x353488[_0x0298('0x19')][_0x0298('0x1b')]||null:null,'attributes':_0x353488[_0x0298('0x19')]?_0x353488[_0x0298('0x19')]['attributes']||null:null,'limit':_0x353488[_0x0298('0x19')]?_0x353488[_0x0298('0x19')][_0x0298('0x1c')]||null:null,'include':_0x353488['options']?_0x353488['options']['include']?_[_0x0298('0x1d')](_0x353488[_0x0298('0x19')][_0x0298('0x1e')],function(_0x5b55b1){return{'model':db[_0x5b55b1[_0x0298('0x1f')]],'as':_0x5b55b1['as'],'attributes':_0x5b55b1['attributes'],'include':_0x5b55b1['include']?_[_0x0298('0x1d')](_0x5b55b1[_0x0298('0x1e')],function(_0x280177){return{'model':db[_0x280177[_0x0298('0x1f')]],'as':_0x280177['as'],'attributes':_0x280177[_0x0298('0x20')],'include':_0x280177[_0x0298('0x1e')]?_[_0x0298('0x1d')](_0x280177[_0x0298('0x1e')],function(_0x553627){return{'model':db[_0x553627[_0x0298('0x1f')]],'as':_0x553627['as'],'attributes':_0x553627[_0x0298('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f0e6){logger[_0x0298('0x14')](_0x0298('0x17'),_0x353488);logger[_0x0298('0x21')](_0x0298('0x17'),_0x353488,JSON[_0x0298('0x10')](_0x14f0e6));_0x26235d(_0x14f0e6);})['catch'](function(_0x5630a0){logger[_0x0298('0x11')]('GetMailAccount',_0x5630a0[_0x0298('0x13')],_0x353488);_0xb8e63d(_0x4b571a[_0x0298('0x11')](0x1f4,_0x5630a0['message']));});});};exports[_0x0298('0x22')]=function(_0x2d5f44){var _0x28f5ef=this;return new Promise(function(_0x293bbf,_0x16379d){return db[_0x0298('0x23')][_0x0298('0x24')]({'raw':_0x2d5f44[_0x0298('0x19')]?_0x2d5f44[_0x0298('0x19')][_0x0298('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d5f44[_0x0298('0x19')]?_0x2d5f44[_0x0298('0x19')][_0x0298('0x1b')]||null:null,'attributes':_0x2d5f44[_0x0298('0x19')]?_0x2d5f44[_0x0298('0x19')]['attributes']||null:null,'include':_0x2d5f44['options']?_0x2d5f44[_0x0298('0x19')]['include']?_['map'](_0x2d5f44[_0x0298('0x19')][_0x0298('0x1e')],function(_0x45ada8){return{'model':db[_0x45ada8[_0x0298('0x1f')]],'as':_0x45ada8['as'],'attributes':_0x45ada8['attributes'],'include':_0x45ada8[_0x0298('0x1e')]?_[_0x0298('0x1d')](_0x45ada8[_0x0298('0x1e')],function(_0x3ffedb){return{'model':db[_0x3ffedb['model']],'as':_0x3ffedb['as'],'attributes':_0x3ffedb[_0x0298('0x20')],'include':_0x3ffedb[_0x0298('0x1e')]?_[_0x0298('0x1d')](_0x3ffedb[_0x0298('0x1e')],function(_0x547aec){return{'model':db[_0x547aec[_0x0298('0x1f')]],'as':_0x547aec['as'],'attributes':_0x547aec[_0x0298('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0298('0xd')](function(_0x43c2a7){logger[_0x0298('0x14')](_0x0298('0x22'),_0x2d5f44);logger[_0x0298('0x21')]('ShowMailAccount',_0x2d5f44,JSON[_0x0298('0x10')](_0x43c2a7));_0x293bbf(_0x43c2a7);})[_0x0298('0x16')](function(_0x1f1933){logger[_0x0298('0x11')](_0x0298('0x22'),_0x1f1933['message'],_0x2d5f44);_0x16379d(_0x28f5ef[_0x0298('0x11')](0x1f4,_0x1f1933[_0x0298('0x13')]));});});};exports[_0x0298('0x25')]=function(_0x59ca07){var _0x5b34cc=this;return new Promise(function(_0x4a392d,_0x987e7f){var _0x502c5c={'body':_0x59ca07['body'],'channel':_0x0298('0x26')};var _0x94383d=_[_0x0298('0x27')](_[_0x0298('0x28')](db[_0x0298('0x29')][_0x0298('0x2a')]),[_0x0298('0x2b'),'updatedAt',_0x0298('0x2c'),_0x0298('0x2d')]);var _0x32d189=![];if(_0x59ca07[_0x0298('0x2e')]['id']){delete _0x59ca07[_0x0298('0x2e')]['id'];}if(_['isNil'](_0x59ca07[_0x0298('0x2e')][_0x0298('0x2f')])){return _0x987e7f(_0x5b34cc['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x59ca07[_0x0298('0x2e')][_0x0298('0x2e')])||_0x59ca07[_0x0298('0x2e')][_0x0298('0x2e')]===''){return _0x987e7f(_0x5b34cc['error'](0x1f4,_0x0298('0x30')));}if(_[_0x0298('0x31')](_0x59ca07[_0x0298('0x2e')][_0x0298('0x32')])){return _0x987e7f(_0x5b34cc[_0x0298('0x11')](0x1f4,_0x0298('0x33')+_0x94383d));}if(!_[_0x0298('0x34')](_0x94383d,_0x59ca07[_0x0298('0x2e')][_0x0298('0x32')])){return _0x987e7f(_0x5b34cc[_0x0298('0x11')](0x1f4,_0x0298('0x35')+_0x94383d));}var _0x1bfe99={};_0x1bfe99[_0x59ca07['body'][_0x0298('0x32')]]=_0x59ca07[_0x0298('0x2e')][_0x0298('0x2f')];return db[_0x0298('0x23')][_0x0298('0x24')]({'where':{'id':_0x59ca07['account']['id']},'include':[{'model':db[_0x0298('0x36')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1bfe99,'limit':0x1,'order':[[_0x0298('0x37'),_0x0298('0x38')]]}]},{'model':db[_0x0298('0x39')],'as':_0x0298('0x3a')},{'model':db[_0x0298('0x3b')],'as':'Smtp'}]})[_0x0298('0xd')](function(_0x248622){if(_0x248622&&_0x248622[_0x0298('0x3c')]){var _0x1c971e=_0x248622[_0x0298('0x3d')]({'plain':!![]});_0x502c5c[_0x0298('0x3e')]=_['omit'](_0x1c971e,[_0x0298('0x3a'),'List']);_0x502c5c[_0x0298('0x3f')]=_0x1c971e[_0x0298('0x3a')];_0x502c5c[_0x0298('0x40')]=_0x1c971e[_0x0298('0x3c')];_0x502c5c[_0x0298('0x3f')]=_[_0x0298('0x41')](_0x502c5c['applications'],['priority'],[_0x0298('0x42')]);if(_0x502c5c[_0x0298('0x3e')]&&_0x502c5c[_0x0298('0x3e')][_0x0298('0x43')]){_0x502c5c[_0x0298('0x3f')][_0x0298('0x44')]({'id':0x0,'priority':_0x502c5c['applications'][_0x0298('0x45')]+0x1,'app':_0x0298('0x46'),'appdata':'autoclose','interval':_0x0298('0x47')});}if(_0x502c5c[_0x0298('0x3e')]['Applications']){delete _0x502c5c[_0x0298('0x3e')][_0x0298('0x3a')];}if(_0x502c5c[_0x0298('0x3e')][_0x0298('0x3c')]){delete _0x502c5c[_0x0298('0x3e')][_0x0298('0x3c')];}if(_0x1c971e[_0x0298('0x3c')]['Contacts'][_0x0298('0x45')]){return _0x1c971e[_0x0298('0x3c')][_0x0298('0x48')][0x0];}var _0x551765=_[_0x0298('0x49')](_0x59ca07[_0x0298('0x2e')],{'firstName':_0x59ca07['body']['from'],'ListId':_0x1c971e[_0x0298('0x2d')]});_0x551765[_0x59ca07['body'][_0x0298('0x32')]]=_0x59ca07[_0x0298('0x2e')]['from'];return db['CmContact'][_0x0298('0x4a')](_0x551765);}else{throw new Error('List\x20not\x20found');}})[_0x0298('0xd')](function(_0x58b3b5){_0x502c5c[_0x0298('0x4b')]=_0x58b3b5;if(_0x58b3b5){if(!_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x4c')]){_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['messageId']=rs[_0x0298('0x4d')]()+'\x20'+_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['from'];}var _0xa4cb4c={'ContactId':_0x58b3b5['id'],'MailAccountId':_0x59ca07[_0x0298('0x3e')]['id'],'inReplyTo':_0x59ca07['body'][_0x0298('0x13')][_0x0298('0x4c')],'to':_0x59ca07[_0x0298('0x2e')]['message'][_0x0298('0x2f')],'cc':_0x59ca07['body']['message']['cc'],'subject':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x4e')],'attach':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x4f')],'lastMsgAt':moment()[_0x0298('0x50')](_0x0298('0x51')),'lastMsgDirection':'in'};return db[_0x0298('0x52')][_0x0298('0x24')]({'where':{'closed':![],'MailAccountId':_0x59ca07[_0x0298('0x3e')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x53')]}}]})[_0x0298('0xd')](function(_0x404054){if(_0x404054){return[_0x404054,![]];}return db[_0x0298('0x52')][_0x0298('0x4a')](_0xa4cb4c)[_0x0298('0xd')](function(_0x550341){return[_0x550341,!![]];});});}else{throw new Error(_0x0298('0x54'));}})[_0x0298('0x55')](function(_0x37be66,_0x18a816){if(_0x37be66){_0x32d189=_0x18a816;if(!_0x18a816){return _0x37be66[_0x0298('0x56')]({'inReplyTo':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['messageId'],'to':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x2f')],'cc':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['cc'],'subject':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['subject'],'attach':_0x37be66[_0x0298('0x4f')]?_0x37be66['attach']:_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x4f')],'substatus':null,'substatusAt':moment()[_0x0298('0x50')](_0x0298('0x51')),'lastMsgAt':moment()['format'](_0x0298('0x51')),'lastMsgDirection':'in'});}else{return _0x37be66;}}})['then'](function(_0x3c5329){_0x502c5c['interaction']=_0x3c5329[_0x0298('0x3d')]({'plain':!![]});_0x502c5c[_0x0298('0x57')][_0x0298('0x58')]=_0x32d189;return db[_0x0298('0x59')][_0x0298('0x4a')]({'body':_0x59ca07[_0x0298('0x2e')]['body'],'MailAccountId':_0x59ca07[_0x0298('0x3e')]['id'],'MailInteractionId':_0x3c5329['id'],'direction':'in','ContactId':_0x502c5c['contact']['id'],'messageId':_0x59ca07['body'][_0x0298('0x13')][_0x0298('0x4c')],'from':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x2f')],'to':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['to'],'cc':_0x59ca07[_0x0298('0x2e')]['message']['cc'],'subject':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x4e')],'attach':_0x59ca07['body'][_0x0298('0x13')]['attach'],'Attachments':_0x59ca07['body'][_0x0298('0x13')][_0x0298('0x5a')],'originTo':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['originTo'],'originCc':_0x59ca07['body'][_0x0298('0x13')][_0x0298('0x5b')],'bcc':_0x59ca07['body']['message'][_0x0298('0x5c')],'ChatWebsiteId':_0x59ca07[_0x0298('0x2e')]['message'][_0x0298('0x5d')]||null,'originChannel':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')]['originChannel']||_0x0298('0x5e'),'ChatOfflineMessageId':_0x59ca07[_0x0298('0x2e')][_0x0298('0x13')][_0x0298('0x5f')]||null},{'include':[{'model':db[_0x0298('0x60')],'as':'Attachments'}]});})[_0x0298('0xd')](function(_0x4e3201){_0x502c5c[_0x0298('0x13')]=_0x4e3201;if(_0x502c5c[_0x0298('0x57')][_0x0298('0x61')]){return db['User'][_0x0298('0x24')]({'attributes':['id',_0x0298('0x62')],'where':{'id':_0x502c5c[_0x0298('0x57')]['UserId']}})[_0x0298('0xd')](function(_0x2e5daf){if(_0x2e5daf){_0x502c5c[_0x0298('0x3f')][_0x0298('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e5daf['name']+','+(_0x502c5c[_0x0298('0x3e')][_0x0298('0x64')]||0xa),'interval':_0x0298('0x47')});}return respondWithRpcPromise('Start',_0x0298('0x65'),_0x502c5c);});}return respondWithRpcPromise('Start',_0x0298('0x65'),_0x502c5c);})[_0x0298('0xd')](function(_0x17630b){_0x4a392d(_0x17630b);})[_0x0298('0x16')](function(_0x1a4b4a){_0x987e7f(_0x5b34cc[_0x0298('0x11')](0x1f4,_0x1a4b4a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 28948d2..cc15eba 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 _0xc2c4=['register','length','./mailAccount.events','save','update','emit'];(function(_0x2384d0,_0x57ec21){var _0x35ba7c=function(_0x19a03a){while(--_0x19a03a){_0x2384d0['push'](_0x2384d0['shift']());}};_0x35ba7c(++_0x57ec21);}(_0xc2c4,0x80));var _0x4c2c=function(_0x2ff905,_0x50384c){_0x2ff905=_0x2ff905-0x0;var _0x10bfeb=_0xc2c4[_0x2ff905];return _0x10bfeb;};'use strict';var MailAccountEvents=require(_0x4c2c('0x0'));var events=[_0x4c2c('0x1'),'remove',_0x4c2c('0x2')];function createListener(_0x18c886,_0x16d26a){return function(_0x250510){_0x16d26a[_0x4c2c('0x3')](_0x18c886,_0x250510);};}function removeListener(_0x917e2f,_0x5d2714){return function(){MailAccountEvents['removeListener'](_0x917e2f,_0x5d2714);};}exports[_0x4c2c('0x4')]=function(_0xf65f69){for(var _0x4f527a=0x0,_0x41b4c6=events[_0x4c2c('0x5')];_0x4f527a<_0x41b4c6;_0x4f527a++){var _0x1e1aa3=events[_0x4f527a];var _0x5b38bd=createListener('mailAccount:'+_0x1e1aa3,_0xf65f69);MailAccountEvents['on'](_0x1e1aa3,_0x5b38bd);}}; \ No newline at end of file +var _0x9749=['./mailAccount.events','save','remove','update','length','mailAccount:'];(function(_0x1f1962,_0x18b519){var _0x65564d=function(_0x561cc5){while(--_0x561cc5){_0x1f1962['push'](_0x1f1962['shift']());}};_0x65564d(++_0x18b519);}(_0x9749,0xde));var _0x9974=function(_0x5cf7fa,_0x566c3d){_0x5cf7fa=_0x5cf7fa-0x0;var _0x555c66=_0x9749[_0x5cf7fa];return _0x555c66;};'use strict';var MailAccountEvents=require(_0x9974('0x0'));var events=[_0x9974('0x1'),_0x9974('0x2'),_0x9974('0x3')];function createListener(_0x103521,_0x59ee25){return function(_0x2f02b2){_0x59ee25['emit'](_0x103521,_0x2f02b2);};}function removeListener(_0x3390d5,_0x1939c5){return function(){MailAccountEvents['removeListener'](_0x3390d5,_0x1939c5);};}exports['register']=function(_0x24fba0){for(var _0xa1e04d=0x0,_0xfbe130=events[_0x9974('0x4')];_0xa1e04d<_0xfbe130;_0xa1e04d++){var _0x1a6b0f=events[_0xa1e04d];var _0x1caa73=createListener(_0x9974('0x5')+_0x1a6b0f,_0x24fba0);MailAccountEvents['on'](_0x1a6b0f,_0x1caa73);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 541eb5f..95f783d 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 _0xd732=['exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xd732,0x1ae));var _0x2d73=function(_0x54eea6,_0x3aa7a1){_0x54eea6=_0x54eea6-0x0;var _0x1188f6=_0xd732[_0x54eea6];return _0x1188f6;};'use strict';var multer=require('multer');var util=require(_0x2d73('0x0'));var path=require(_0x2d73('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2d73('0x2'));var auth=require(_0x2d73('0x3'));var interaction=require(_0x2d73('0x4'));var config=require('../../config/environment');var controller=require(_0x2d73('0x5'));router[_0x2d73('0x6')](_0x2d73('0x7'),auth[_0x2d73('0x8')](),controller['show']);router['put'](_0x2d73('0x7'),auth['isAuthenticated'](),controller[_0x2d73('0x9')]);router[_0x2d73('0xa')](_0x2d73('0x7'),auth[_0x2d73('0x8')](),controller[_0x2d73('0xb')]);module[_0x2d73('0xc')]=router; \ No newline at end of file +var _0x751b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy'];(function(_0xaadffa,_0x5d23a3){var _0x484dc1=function(_0x2b6ed4){while(--_0x2b6ed4){_0xaadffa['push'](_0xaadffa['shift']());}};_0x484dc1(++_0x5d23a3);}(_0x751b,0x78));var _0xb751=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x751b[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0xb751('0x0'));var util=require(_0xb751('0x1'));var path=require(_0xb751('0x2'));var timeout=require(_0xb751('0x3'));var express=require(_0xb751('0x4'));var router=express[_0xb751('0x5')]();var fs_extra=require(_0xb751('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb751('0x7'));var controller=require(_0xb751('0x8'));router[_0xb751('0x9')](_0xb751('0xa'),auth[_0xb751('0xb')](),controller[_0xb751('0xc')]);router['put'](_0xb751('0xa'),auth[_0xb751('0xb')](),controller[_0xb751('0xd')]);router[_0xb751('0xe')](_0xb751('0xa'),auth['isAuthenticated'](),controller[_0xb751('0xf')]);module[_0xb751('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 025e227..7a4902b 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 _0x0ec1=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x25402e,_0x1ab8f2){var _0x168dbb=function(_0x440845){while(--_0x440845){_0x25402e['push'](_0x25402e['shift']());}};_0x168dbb(++_0x1ab8f2);}(_0x0ec1,0x143));var _0x10ec=function(_0x4513ad,_0x12a9c1){_0x4513ad=_0x4513ad-0x0;var _0x30dac5=_0x0ec1[_0x4513ad];return _0x30dac5;};'use strict';var Sequelize=require('sequelize');module[_0x10ec('0x0')]={'priority':{'type':Sequelize[_0x10ec('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x10ec('0x2')},'appdata':{'type':Sequelize[_0x10ec('0x3')]()},'description':{'type':Sequelize[_0x10ec('0x4')]},'interval':{'type':Sequelize[_0x10ec('0x4')],'defaultValue':_0x10ec('0x5')}}; \ No newline at end of file +var _0xb3af=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x26297c,_0xb0a30){var _0x5383be=function(_0x514d9e){while(--_0x514d9e){_0x26297c['push'](_0x26297c['shift']());}};_0x5383be(++_0xb0a30);}(_0xb3af,0xdc));var _0xfb3a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb3af[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module[_0xfb3a('0x0')]={'priority':{'type':Sequelize[_0xfb3a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfb3a('0x2')],'allowNull':![],'defaultValue':_0xfb3a('0x3')},'appdata':{'type':Sequelize[_0xfb3a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfb3a('0x2')],'defaultValue':_0xfb3a('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7fec44e..4613ec7 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 _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x251bff,_0x3d19ad){var _0x502149=function(_0x546444){while(--_0x546444){_0x251bff['push'](_0x251bff['shift']());}};_0x502149(++_0x3d19ad);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5c16e6,_0x148fb0){_0x5c16e6=_0x5c16e6-0x0;var _0x13c57e=_0xb43b[_0x5c16e6];return _0x13c57e;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xedd9,0xfc));var _0x9edd=function(_0x393b5e,_0x86d273){_0x393b5e=_0x393b5e-0x0;var _0x1dd58f=_0xedd9[_0x393b5e];return _0x1dd58f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 3192d00..1d0adcf 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 _0xca8c=['moment','bluebird','request-promise','path','./mailApplication.attributes','MailApplication','mail_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xca8c,0xef));var _0xcca8=function(_0x6df3cb,_0xb2f188){_0x6df3cb=_0x6df3cb-0x0;var _0x2b0f57=_0xca8c[_0x6df3cb];return _0x2b0f57;};'use strict';var _=require('lodash');var util=require(_0xcca8('0x0'));var logger=require(_0xcca8('0x1'))(_0xcca8('0x2'));var moment=require(_0xcca8('0x3'));var BPromise=require(_0xcca8('0x4'));var rp=require(_0xcca8('0x5'));var fs=require('fs');var path=require(_0xcca8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcca8('0x7'));module['exports']=function(_0x307777,_0x49700f){return _0x307777['define'](_0xcca8('0x8'),attributes,{'tableName':_0xcca8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcca8('0xa')});}; \ No newline at end of file +var _0x0eb3=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x0eb3,0x16c));var _0x30eb=function(_0x21c575,_0x151802){_0x21c575=_0x21c575-0x0;var _0x49a69a=_0x0eb3[_0x21c575];return _0x49a69a;};'use strict';var _=require(_0x30eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x30eb('0x2'));var fs=require('fs');var path=require(_0x30eb('0x3'));var rimraf=require(_0x30eb('0x4'));var config=require(_0x30eb('0x5'));var attributes=require('./mailApplication.attributes');module[_0x30eb('0x6')]=function(_0x45e863,_0x3219e2){return _0x45e863[_0x30eb('0x7')](_0x30eb('0x8'),attributes,{'tableName':_0x30eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30eb('0xa'),'collate':_0x30eb('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 2b2d3f3..c5583f5 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 _0x766c=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailApplication','update','options','where','attributes','UpdateMailApplication','stringify','util'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x766c,0x14f));var _0xc766=function(_0x5bef39,_0x12095f){_0x5bef39=_0x5bef39-0x0;var _0x132ed8=_0x766c[_0x5bef39];return _0x132ed8;};'use strict';var _=require('lodash');var util=require(_0xc766('0x0'));var moment=require(_0xc766('0x1'));var BPromise=require('bluebird');var rs=require(_0xc766('0x2'));var fs=require('fs');var Redis=require(_0xc766('0x3'));var db=require(_0xc766('0x4'))['db'];var utils=require(_0xc766('0x5'));var logger=require(_0xc766('0x6'))(_0xc766('0x7'));var config=require(_0xc766('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3a68,_0x4dddd7,_0x1eb71c){return new BPromise(function(_0x1007df,_0x5d81e0){return client[_0xc766('0x9')](_0x2e3a68,_0x1eb71c)[_0xc766('0xa')](function(_0x257634){logger[_0xc766('0xb')](_0xc766('0xc'),_0x4dddd7,_0xc766('0xd'));logger[_0xc766('0xe')](_0xc766('0xf'),_0x4dddd7,_0xc766('0xd'),JSON['stringify'](_0x257634));if(_0x257634[_0xc766('0x10')]){if(_0x257634[_0xc766('0x10')][_0xc766('0x11')]===0x1f4){logger['error'](_0xc766('0xc'),_0x4dddd7,_0x257634['error'][_0xc766('0x12')]);return _0x5d81e0(_0x257634[_0xc766('0x10')][_0xc766('0x12')]);}logger['error'](_0xc766('0xc'),_0x4dddd7,_0x257634[_0xc766('0x10')][_0xc766('0x12')]);return _0x1007df(_0x257634[_0xc766('0x10')][_0xc766('0x12')]);}else{logger[_0xc766('0xb')](_0xc766('0xc'),_0x4dddd7,_0xc766('0xd'));_0x1007df(_0x257634[_0xc766('0x13')][_0xc766('0x12')]);}})[_0xc766('0x14')](function(_0x2f49f0){logger['error'](_0xc766('0xc'),_0x4dddd7,_0x2f49f0);_0x5d81e0(_0x2f49f0);});});}exports['UpdateMailApplication']=function(_0x5d38a6){var _0x563079=this;return new Promise(function(_0x221d57,_0x56b215){return db[_0xc766('0x15')][_0xc766('0x16')](_0x5d38a6['body'],{'raw':_0x5d38a6[_0xc766('0x17')]?_0x5d38a6[_0xc766('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d38a6[_0xc766('0x17')]?_0x5d38a6[_0xc766('0x17')][_0xc766('0x18')]||null:null,'attributes':_0x5d38a6[_0xc766('0x17')]?_0x5d38a6[_0xc766('0x17')][_0xc766('0x19')]||null:null,'limit':_0x5d38a6['options']?_0x5d38a6[_0xc766('0x17')]['limit']||null:null})[_0xc766('0xa')](function(_0x52e931){logger[_0xc766('0xb')](_0xc766('0x1a'),_0x5d38a6);logger[_0xc766('0xe')](_0xc766('0x1a'),_0x5d38a6,JSON[_0xc766('0x1b')](_0x52e931));_0x221d57(_0x52e931);})[_0xc766('0x14')](function(_0x58cab9){logger[_0xc766('0x10')](_0xc766('0x1a'),_0x58cab9[_0xc766('0x12')],_0x5d38a6);_0x56b215(_0x563079[_0xc766('0x10')](0x1f4,_0x58cab9['message']));});});}; \ No newline at end of file +var _0x9ca3=['client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailApplication','update','options','where','attributes','limit','UpdateMailApplication','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x568cc3,_0x31eadf){var _0x11431a=function(_0x50864d){while(--_0x50864d){_0x568cc3['push'](_0x568cc3['shift']());}};_0x11431a(++_0x31eadf);}(_0x9ca3,0x1c8));var _0x39ca=function(_0x469b0d,_0x150218){_0x469b0d=_0x469b0d-0x0;var _0x4c3f78=_0x9ca3[_0x469b0d];return _0x4c3f78;};'use strict';var _=require('lodash');var util=require(_0x39ca('0x0'));var moment=require('moment');var BPromise=require(_0x39ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39ca('0x2'));var db=require(_0x39ca('0x3'))['db'];var utils=require(_0x39ca('0x4'));var logger=require(_0x39ca('0x5'))(_0x39ca('0x6'));var config=require(_0x39ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x39ca('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c1f4d,_0x266b62,_0x49af59){return new BPromise(function(_0x39c015,_0x4f61b8){return client[_0x39ca('0x9')](_0x2c1f4d,_0x49af59)[_0x39ca('0xa')](function(_0x4beb0f){logger[_0x39ca('0xb')](_0x39ca('0xc'),_0x266b62,_0x39ca('0xd'));logger[_0x39ca('0xe')](_0x39ca('0xf'),_0x266b62,_0x39ca('0xd'),JSON['stringify'](_0x4beb0f));if(_0x4beb0f[_0x39ca('0x10')]){if(_0x4beb0f[_0x39ca('0x10')][_0x39ca('0x11')]===0x1f4){logger[_0x39ca('0x10')]('MailApplication,\x20%s,\x20%s',_0x266b62,_0x4beb0f['error'][_0x39ca('0x12')]);return _0x4f61b8(_0x4beb0f[_0x39ca('0x10')][_0x39ca('0x12')]);}logger[_0x39ca('0x10')](_0x39ca('0xc'),_0x266b62,_0x4beb0f['error']['message']);return _0x39c015(_0x4beb0f[_0x39ca('0x10')]['message']);}else{logger[_0x39ca('0xb')](_0x39ca('0xc'),_0x266b62,_0x39ca('0xd'));_0x39c015(_0x4beb0f[_0x39ca('0x13')][_0x39ca('0x12')]);}})[_0x39ca('0x14')](function(_0x5f049b){logger[_0x39ca('0x10')]('MailApplication,\x20%s,\x20%s',_0x266b62,_0x5f049b);_0x4f61b8(_0x5f049b);});});}exports['UpdateMailApplication']=function(_0x8a2999){var _0x1daeac=this;return new Promise(function(_0x263276,_0x3e9aa0){return db[_0x39ca('0x15')][_0x39ca('0x16')](_0x8a2999['body'],{'raw':_0x8a2999['options']?_0x8a2999[_0x39ca('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a2999[_0x39ca('0x17')]?_0x8a2999['options'][_0x39ca('0x18')]||null:null,'attributes':_0x8a2999['options']?_0x8a2999[_0x39ca('0x17')][_0x39ca('0x19')]||null:null,'limit':_0x8a2999[_0x39ca('0x17')]?_0x8a2999[_0x39ca('0x17')][_0x39ca('0x1a')]||null:null})[_0x39ca('0xa')](function(_0x4917b4){logger['info'](_0x39ca('0x1b'),_0x8a2999);logger['debug']('UpdateMailApplication',_0x8a2999,JSON[_0x39ca('0x1c')](_0x4917b4));_0x263276(_0x4917b4);})['catch'](function(_0x2f2a02){logger[_0x39ca('0x10')]('UpdateMailApplication',_0x2f2a02[_0x39ca('0x12')],_0x8a2999);_0x3e9aa0(_0x1daeac[_0x39ca('0x10')](0x1f4,_0x2f2a02['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8e6f186..ed78693 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 _0x55b9=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','update','delete','removeTags','express','Router'];(function(_0x200af4,_0x8416e8){var _0x3831b6=function(_0xf139c0){while(--_0xf139c0){_0x200af4['push'](_0x200af4['shift']());}};_0x3831b6(++_0x8416e8);}(_0x55b9,0xfa));var _0x955b=function(_0xb48475,_0x263b38){_0xb48475=_0xb48475-0x0;var _0x374951=_0x55b9[_0xb48475];return _0x374951;};'use strict';var express=require(_0x955b('0x0'));var router=express[_0x955b('0x1')]();var auth=require(_0x955b('0x2'));var interaction=require(_0x955b('0x3'));var controller=require(_0x955b('0x4'));router[_0x955b('0x5')]('/',auth[_0x955b('0x6')](),controller[_0x955b('0x7')]);router[_0x955b('0x5')](_0x955b('0x8'),auth[_0x955b('0x6')](),controller[_0x955b('0x9')]);router[_0x955b('0x5')]('/:id',auth[_0x955b('0x6')](),controller[_0x955b('0xa')]);router[_0x955b('0x5')](_0x955b('0xb'),auth['isAuthenticated'](),controller[_0x955b('0xc')]);router[_0x955b('0x5')](_0x955b('0xd'),auth[_0x955b('0x6')](),controller[_0x955b('0xe')]);router['post']('/',auth[_0x955b('0x6')](),controller[_0x955b('0xf')]);router[_0x955b('0x10')](_0x955b('0xb'),auth[_0x955b('0x6')](),controller[_0x955b('0x11')]);router[_0x955b('0x10')](_0x955b('0x12'),auth[_0x955b('0x6')](),interaction[_0x955b('0x13')](_0x955b('0x14'),_0x955b('0x15')),controller[_0x955b('0x16')]);router[_0x955b('0x17')](_0x955b('0x18'),auth[_0x955b('0x6')](),interaction[_0x955b('0x13')](_0x955b('0x14'),'mailinteraction:update'),controller[_0x955b('0x19')]);router[_0x955b('0x1a')](_0x955b('0x18'),auth[_0x955b('0x6')](),interaction[_0x955b('0x13')]('mail','mailinteraction:destroy'),controller['destroy']);router[_0x955b('0x1a')](_0x955b('0x12'),auth[_0x955b('0x6')](),controller[_0x955b('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x83b5=['mail','addTags','put','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x43851b,_0xcba452){var _0x5eb740=function(_0x41cb60){while(--_0x41cb60){_0x43851b['push'](_0x43851b['shift']());}};_0x5eb740(++_0xcba452);}(_0x83b5,0x1a7));var _0x583b=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x83b5[_0x1b8e60];return _0x363363;};'use strict';var express=require(_0x583b('0x0'));var router=express[_0x583b('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x583b('0x2'));var controller=require(_0x583b('0x3'));router[_0x583b('0x4')]('/',auth[_0x583b('0x5')](),controller[_0x583b('0x6')]);router[_0x583b('0x4')](_0x583b('0x7'),auth[_0x583b('0x5')](),controller[_0x583b('0x8')]);router[_0x583b('0x4')](_0x583b('0x9'),auth[_0x583b('0x5')](),controller[_0x583b('0xa')]);router['get'](_0x583b('0xb'),auth[_0x583b('0x5')](),controller[_0x583b('0xc')]);router[_0x583b('0x4')](_0x583b('0xd'),auth[_0x583b('0x5')](),controller[_0x583b('0xe')]);router[_0x583b('0xf')]('/',auth[_0x583b('0x5')](),controller['create']);router[_0x583b('0xf')]('/:id/messages',auth[_0x583b('0x5')](),controller[_0x583b('0x10')]);router[_0x583b('0xf')](_0x583b('0x11'),auth[_0x583b('0x5')](),interaction[_0x583b('0x12')](_0x583b('0x13'),'mailinteraction:addtags'),controller[_0x583b('0x14')]);router[_0x583b('0x15')](_0x583b('0x9'),auth['isAuthenticated'](),interaction[_0x583b('0x12')](_0x583b('0x13'),'mailinteraction:update'),controller['update']);router[_0x583b('0x16')](_0x583b('0x9'),auth[_0x583b('0x5')](),interaction[_0x583b('0x12')](_0x583b('0x13'),_0x583b('0x17')),controller['destroy']);router['delete']('/:id/tags',auth[_0x583b('0x5')](),controller[_0x583b('0x18')]);module[_0x583b('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 41b6e16..d919eb1 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 _0xc0bc=['out','ENUM','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x15a99d,_0x4486ea){var _0x2cb908=function(_0x1243c1){while(--_0x1243c1){_0x15a99d['push'](_0x15a99d['shift']());}};_0x2cb908(++_0x4486ea);}(_0xc0bc,0x136));var _0xcc0b=function(_0x1722fb,_0x4cf40b){_0x1722fb=_0x1722fb-0x0;var _0x561d53=_0xc0bc[_0x1722fb];return _0x561d53;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xcc0b('0x0'));module['exports']={'closed':{'type':Sequelize[_0xcc0b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc0b('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcc0b('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcc0b('0x3')]},'inReplyTo':{'type':Sequelize[_0xcc0b('0x3')](0x1fe)},'to':{'type':Sequelize[_0xcc0b('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xcc0b('0x4')]()},'attach':{'type':Sequelize[_0xcc0b('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xcc0b('0x2')]},'substatus':{'type':Sequelize[_0xcc0b('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xcc0b('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xcc0b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc0b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xcc0b('0x6')]('in',_0xcc0b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc0b('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xb90b=['long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0xb90b,0xd2));var _0xbb90=function(_0x476d12,_0x134ebb){_0x476d12=_0x476d12-0x0;var _0x2c1086=_0xb90b[_0x476d12];return _0x2c1086;};'use strict';var Sequelize=require(_0xbb90('0x0'));var iconv=require(_0xbb90('0x1'));module[_0xbb90('0x2')]={'closed':{'type':Sequelize[_0xbb90('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb90('0x4')]},'disposition':{'type':Sequelize[_0xbb90('0x5')]},'secondDisposition':{'type':Sequelize[_0xbb90('0x5')]},'thirdDisposition':{'type':Sequelize[_0xbb90('0x5')]},'note':{'type':Sequelize[_0xbb90('0x5')]},'inReplyTo':{'type':Sequelize[_0xbb90('0x5')](0x1fe)},'to':{'type':Sequelize[_0xbb90('0x5')]},'cc':{'type':Sequelize['TEXT'](_0xbb90('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xbb90('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xbb90('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xbb90('0x7')]('in',_0xbb90('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb90('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb90('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbb90('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 5762ea1..809ea0d 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 _0xe1eb=['pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','find','UserId','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','Account.mandatoryDisposition','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','groupBy','MailInteractionId','Setting','enableEmailPreview','rows','catch','show','includeAll','create','body','params','describe','addMessage','omit','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','inlineCss','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','server','files','root','join','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','end','error','name','send','Users','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','trimStart','index','map','MailInteraction','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0xe1eb,0x187));var _0xbe1e=function(_0x1b8aa1,_0x25ca77){_0x1b8aa1=_0x1b8aa1-0x0;var _0x246fbb=_0xe1eb[_0x1b8aa1];return _0x246fbb;};'use strict';var emlformat=require(_0xbe1e('0x0'));var rimraf=require(_0xbe1e('0x1'));var zipdir=require('zip-dir');var moment=require(_0xbe1e('0x2'));var BPromise=require(_0xbe1e('0x3'));var util=require(_0xbe1e('0x4'));var path=require(_0xbe1e('0x5'));var fs=require('fs');var _=require(_0xbe1e('0x6'));var squel=require('squel');var juice=require(_0xbe1e('0x7'));var Redis=require(_0xbe1e('0x8'));var qs=require(_0xbe1e('0x9'));var as=require(_0xbe1e('0xa'));var logger=require(_0xbe1e('0xb'))('api');var config=require(_0xbe1e('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xbe1e('0xd'));config[_0xbe1e('0xe')]=_[_0xbe1e('0xf')](config[_0xbe1e('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe1e('0x10'))(new Redis(config['redis']));require(_0xbe1e('0x11'))['register'](socket);function respondWithStatusCode(_0x4d33d2,_0x548dea){_0x548dea=_0x548dea||0xcc;return function(_0x27cbf2){if(_0x27cbf2){return _0x4d33d2[_0xbe1e('0x12')](_0x548dea);}return _0x4d33d2['status'](_0x548dea)['end']();};}function respondWithResult(_0x16c79b,_0x2027b6){_0x2027b6=_0x2027b6||0xc8;return function(_0x2b073f){if(_0x2b073f){return _0x16c79b[_0xbe1e('0x13')](_0x2027b6)['json'](_0x2b073f);}};}function respondWithFilteredResult(_0x451362,_0x17cf21){return function(_0x2ff687){if(_0x2ff687){var _0x1cbaaf=typeof _0x17cf21[_0xbe1e('0x14')]===_0xbe1e('0x15')&&typeof _0x17cf21[_0xbe1e('0x16')]===_0xbe1e('0x15');var _0x26b1b9=_0x2ff687[_0xbe1e('0x17')];var _0x5289a6=_0x1cbaaf?0x0:_0x17cf21[_0xbe1e('0x14')];var _0x4984f4=_0x1cbaaf?_0x2ff687[_0xbe1e('0x17')]:_0x17cf21[_0xbe1e('0x14')]+_0x17cf21['limit'];var _0x4d1f90;if(_0x4984f4>=_0x26b1b9){_0x4984f4=_0x26b1b9;_0x4d1f90=0xc8;}else{_0x4d1f90=0xce;}_0x451362['status'](_0x4d1f90);return _0x451362[_0xbe1e('0x18')](_0xbe1e('0x19'),_0x5289a6+'-'+_0x4984f4+'/'+_0x26b1b9)[_0xbe1e('0x1a')](_0x2ff687);}return null;};}function saveUpdates(_0x47cd3a){return function(_0x5d5239){if(_0x5d5239){return _0x5d5239[_0xbe1e('0x1b')](_0x47cd3a)['then'](function(_0x50a5e9){return _0x50a5e9;});}return null;};}function removeEntity(_0x2ea0c3){return function(_0x117167){if(_0x117167){return _0x117167[_0xbe1e('0x1c')]()[_0xbe1e('0x1d')](function(){_0x2ea0c3[_0xbe1e('0x13')](0xcc)[_0xbe1e('0x1e')]();});}};}function handleEntityNotFound(_0x17641a){return function(_0x2e0e6a){if(!_0x2e0e6a){_0x17641a[_0xbe1e('0x12')](0x194);}return _0x2e0e6a;};}function handleError(_0x406710,_0x338e8f){_0x338e8f=_0x338e8f||0x1f4;return function(_0x74179d){logger[_0xbe1e('0x1f')](_0x74179d['stack']);if(_0x74179d[_0xbe1e('0x20')]){delete _0x74179d['name'];}_0x406710[_0xbe1e('0x13')](_0x338e8f)[_0xbe1e('0x21')](_0x74179d);};}function getInteractionUsers(_0x372776,_0x215135){return new BPromise(function(_0xb127d,_0x416343){try{if(_0x215135[_0x372776['id']]){_0x372776[_0xbe1e('0x22')]=_['map'](_0x215135[_0x372776['id']],function(_0x31abe7){return{'id':_0x31abe7['id'],'fullname':_0x31abe7[_0xbe1e('0x23')]};});}}catch(_0x10ade4){_0x416343(_0x10ade4);}_0xb127d(_0x372776);});}function getInteractionTags(_0x3a0fb7,_0x284b25){return new BPromise(function(_0x474eef,_0x2296ab){try{if(_0x3a0fb7[_0xbe1e('0x24')]){_0x3a0fb7[_0xbe1e('0x25')]=[];_0x3a0fb7['TagIds'][_0xbe1e('0x26')](',')[_0xbe1e('0x27')](function(_0x424e58){_0x3a0fb7[_0xbe1e('0x25')][_0xbe1e('0x28')](_0x284b25[_0x424e58]);});}delete _0x3a0fb7['TagIds'];}catch(_0xa9e0a4){_0x2296ab(_0xa9e0a4);}_0x474eef(_0x3a0fb7);});}function getLastMessageText(_0x526bd6){return new BPromise(function(_0x3697ac,_0x5a15e7){return db[_0xbe1e('0x29')][_0xbe1e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x526bd6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbe1e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbe1e('0x2c')],'order':'-id','raw':!![]})[_0xbe1e('0x1d')](function(_0x49115a){if(_0x49115a&&_0x49115a[_0xbe1e('0x2c')]){_0x526bd6['lastMsgText']=_[_0xbe1e('0x2d')](_0x49115a[_0xbe1e('0x2c')]);}_0x3697ac(_0x526bd6);})['catch'](function(_0x35f89d){_0x5a15e7(_0x35f89d);});});}function updateMailInteraction(_0x8aa3e5,_0x417234,_0x44e070,_0x4aa715){return new BPromise(function(_0x7500a0,_0x48621d){return getInteractionUsers(_0x8aa3e5,_0x44e070)[_0xbe1e('0x1d')](function(_0x471724){return getInteractionTags(_0x471724,_0x417234);})['then'](function(_0x8444ee){if(_0x4aa715){_0x7500a0(getLastMessageText(_0x8444ee));}else{_0x7500a0(_0x8444ee);}})['catch'](function(_0x5e48cc){_0x48621d(_0x5e48cc);});});}exports[_0xbe1e('0x2e')]=function(_0x4bea36,_0x4fcc5a){var _0x289c41={},_0x593bfe={},_0x36560c={'count':0x0,'rows':[]};var _0x3ee051=_[_0xbe1e('0x2f')](db[_0xbe1e('0x30')][_0xbe1e('0x31')],function(_0x34afcd){return{'name':_0x34afcd[_0xbe1e('0x32')],'type':_0x34afcd['type']['key']};});_0x593bfe['model']=_[_0xbe1e('0x2f')](_0x3ee051,'name');_0x593bfe[_0xbe1e('0x33')]=_[_0xbe1e('0x34')](_0x4bea36[_0xbe1e('0x33')]);_0x593bfe[_0xbe1e('0x35')]=_[_0xbe1e('0x36')](_0x593bfe[_0xbe1e('0x37')],_0x593bfe[_0xbe1e('0x33')]);_0x289c41[_0xbe1e('0x38')]=_[_0xbe1e('0x36')](_0x593bfe[_0xbe1e('0x37')],qs[_0xbe1e('0x39')](_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x39')]));_0x289c41[_0xbe1e('0x38')]=_0x289c41[_0xbe1e('0x38')][_0xbe1e('0x3a')]?_0x289c41[_0xbe1e('0x38')]:_0x593bfe['model'];if(!_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x3b')](_0xbe1e('0x3c'))){_0x289c41[_0xbe1e('0x16')]=qs['limit'](_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x16')]);_0x289c41['offset']=qs[_0xbe1e('0x14')](_0x4bea36['query']['offset']);}_0x289c41[_0xbe1e('0x3d')]=qs[_0xbe1e('0x3e')](_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x3e')]);_0x289c41['where']=qs[_0xbe1e('0x35')](_[_0xbe1e('0x3f')](_0x4bea36[_0xbe1e('0x33')],_0x593bfe[_0xbe1e('0x35')]),_0x3ee051);var _0x120d8=[];var _0x4d5a89=squel[_0xbe1e('0x40')]()[_0xbe1e('0x41')]('id')[_0xbe1e('0x41')](_0xbe1e('0x20'))[_0xbe1e('0x41')](_0xbe1e('0x42'))[_0xbe1e('0x43')](_0xbe1e('0x44'));var _0x12daa6=squel['select']()[_0xbe1e('0x41')](_0xbe1e('0x45'))[_0xbe1e('0x41')](_0xbe1e('0x46'))[_0xbe1e('0x41')](_0xbe1e('0x47'))[_0xbe1e('0x43')](_0xbe1e('0x48'),'ui')[_0xbe1e('0x49')](_0xbe1e('0x4a'),'u',_0xbe1e('0x4b'));var _0x4dcc31=squel[_0xbe1e('0x40')]()[_0xbe1e('0x43')](_0xbe1e('0x4c'),'i')[_0xbe1e('0x49')]('cm_contacts','c',_0xbe1e('0x4d'))[_0xbe1e('0x49')](_0xbe1e('0x4a'),'o','o.id\x20=\x20i.UserId')[_0xbe1e('0x49')]('mail_accounts','a',_0xbe1e('0x4e'))[_0xbe1e('0x49')](_0xbe1e('0x4f'),'me',_0xbe1e('0x50'))[_0xbe1e('0x49')](_0xbe1e('0x51'),'it',_0xbe1e('0x52'))[_0xbe1e('0x49')](_0xbe1e('0x44'),'t',_0xbe1e('0x53'));var _0x1e8cc9=squel['expr']();var _0x3eb07d=[];var _0x2c1a76=squel[_0xbe1e('0x54')]();var _0x591d26;if(_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x55')]){_0x591d26=as[_0xbe1e('0x56')](_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x55')]);var _0x3ee1db=_0x591d26[_0xbe1e('0x57')];for(var _0x268eb2=0x0;_0x268eb2<_0x591d26[_0xbe1e('0x58')][_0xbe1e('0x3a')];_0x268eb2++){var _0x45fd43=_0x591d26[_0xbe1e('0x58')][_0x268eb2];var _0x2b8532='i';var _0x2155f3=_['find'](_0x3ee051,[_0xbe1e('0x20'),_0x45fd43[_0xbe1e('0x41')]]);if(!_0x2155f3){switch(_0x45fd43[_0xbe1e('0x41')]){case _0xbe1e('0x59'):if(_0x45fd43[_0xbe1e('0x5a')]==0x1){_0x4dcc31[_0xbe1e('0x5b')]('`'+_0x45fd43['field']+_0xbe1e('0x5c'));}else{_0x4dcc31['having']('`'+_0x45fd43[_0xbe1e('0x41')]+_0xbe1e('0x5d'));}break;case _0xbe1e('0x5e'):if(_0x45fd43['operator']===_0xbe1e('0x5f')){if(_0x45fd43[_0xbe1e('0x5a')]['split']('\x20')[_0xbe1e('0x3a')]>0x1){_0x1e8cc9[_0x3ee1db](_0xbe1e('0x60'),qs[_0xbe1e('0x61')](_0x45fd43[_0xbe1e('0x5a')]),null);}else{var _0x1ae1de='%'+_0x45fd43['value']+'%';_0x1e8cc9[_0x3ee1db](_0xbe1e('0x62'),_0x1ae1de,_0x1ae1de,_0x1ae1de);}}else{_0x2155f3=_['find'](_0x3ee051,[_0xbe1e('0x20'),_0xbe1e('0x63')]);_0x45fd43[_0xbe1e('0x41')]='ContactId';_0x5a1c98=as[_0xbe1e('0x64')](_0x2b8532,_0x2155f3[_0xbe1e('0x65')],_0x45fd43);_0x1e8cc9[_0x3ee1db](_0x5a1c98[_0xbe1e('0x66')],_0x5a1c98[_0xbe1e('0x5a')][_0xbe1e('0x67')],_0x5a1c98['value']['end']);}break;case _0xbe1e('0x68'):var _0x596055=_0x45fd43['value'][_0xbe1e('0x26')](',')['map'](function(_0x53f8c6){return Number(_0x53f8c6);});_0x596055[_0xbe1e('0x27')](function(_0x49e6f9){_0x2c1a76['or'](_0xbe1e('0x69'),'%,'+_0x49e6f9+',%');});_0x3eb07d=_[_0xbe1e('0x6a')](_0x3eb07d,_0x596055);break;case _0xbe1e('0x6b'):if(_0x45fd43[_0xbe1e('0x6c')]==='$substring'){_0x1e8cc9[_0x3ee1db]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45fd43[_0xbe1e('0x5a')]+'%',null);}else{_0x2155f3=_[_0xbe1e('0x6d')](_0x3ee051,[_0xbe1e('0x20'),_0xbe1e('0x6e')]);_0x45fd43['field']=_0xbe1e('0x6e');_0x5a1c98=as[_0xbe1e('0x64')](_0x2b8532,_0x2155f3['type'],_0x45fd43);_0x1e8cc9[_0x3ee1db](_0x5a1c98[_0xbe1e('0x66')],_0x5a1c98[_0xbe1e('0x5a')][_0xbe1e('0x67')],_0x5a1c98[_0xbe1e('0x5a')]['end']);}break;case'plainBody':_0x5a1c98=as[_0xbe1e('0x64')]('me',null,_0x45fd43);_0x1e8cc9[_0x3ee1db](_0x5a1c98[_0xbe1e('0x66')],_0x5a1c98[_0xbe1e('0x5a')]['start'],_0x5a1c98['value'][_0xbe1e('0x1e')]);break;}}else{var _0x5a1c98=as[_0xbe1e('0x64')](_0x2b8532,_0x2155f3['type'],_0x45fd43);_0x1e8cc9[_0x3ee1db](_0x5a1c98['text'],_0x5a1c98['value'][_0xbe1e('0x67')],_0x5a1c98[_0xbe1e('0x5a')]['end']);}}}else{var _0x2aa5a3=_(_0x4bea36['query'])[_0xbe1e('0x34')]()[_0xbe1e('0x2f')](function(_0x224636){return _['some'](_0x3ee051,[_0xbe1e('0x20'),_0x224636])?_0x224636:undefined;})[_0xbe1e('0x6f')]()[_0xbe1e('0x5a')]();if(!_[_0xbe1e('0x70')](_0x2aa5a3)){_0x2aa5a3[_0xbe1e('0x27')](function(_0x4ff09b){if(_0x4ff09b===_0xbe1e('0x71')){_0x4dcc31[_0xbe1e('0x72')](_0xbe1e('0x73'),[]['concat'](_0x4bea36[_0xbe1e('0x33')][_0x4ff09b]));}else if(_0x4ff09b===_0xbe1e('0x74')){var _0x292a42=JSON['parse'](_0x4bea36[_0xbe1e('0x33')][_0x4ff09b])[_0xbe1e('0x75')];var _0x1938cb=JSON[_0xbe1e('0x76')](_0x4bea36[_0xbe1e('0x33')][_0x4ff09b])[_0xbe1e('0x77')];_0x4dcc31[_0xbe1e('0x72')](_0xbe1e('0x78'),_0x292a42,_0x1938cb);}else{if(_0x4bea36[_0xbe1e('0x33')][_0x4ff09b]===_0xbe1e('0x79')){_0x4dcc31[_0xbe1e('0x72')]('i.'+_0x4ff09b+'\x20IS\x20NULL');}else{_0x4dcc31[_0xbe1e('0x72')]('i.'+_0x4ff09b+_0xbe1e('0x7a'),_0x4bea36[_0xbe1e('0x33')][_0x4ff09b]);}}});}if(_0x4bea36[_0xbe1e('0x33')]['read']){if(_0x4bea36[_0xbe1e('0x33')]['read']==0x1){_0x4dcc31[_0xbe1e('0x5b')](_0xbe1e('0x7b'));}else{_0x4dcc31[_0xbe1e('0x5b')]('`unreadMessages`\x20>\x200');}}if(_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7c')]){_0x3eb07d=_['isArray'](_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7c')])?_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7c')]:new Array(_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7c')]);_0x3eb07d[_0xbe1e('0x27')](function(_0x3ea8c5){_0x2c1a76['or'](_0xbe1e('0x69'),'%,'+_0x3ea8c5+',%');});}if(_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7d')]){var _0xe444e0=_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x7d')][_0xbe1e('0x7e')]('\x5c','\x5c\x5c')[_0xbe1e('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xe444e0)){_0x1e8cc9['or'](_0xbe1e('0x7f'),_0xe444e0+'%');}else if(qs[_0xbe1e('0x80')](_0xe444e0)){_0x1e8cc9['or'](_0xbe1e('0x81'),_0xe444e0+'%');}else{_0x1e8cc9['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbe1e('0x61')](_0xe444e0))['or'](_0xbe1e('0x82'),qs[_0xbe1e('0x61')](_0xe444e0));}}}_0x4dcc31[_0xbe1e('0x72')](_0x1e8cc9);_0x4dcc31['group']('i.id');var _0x57f124={'type':db[_0xbe1e('0x83')][_0xbe1e('0x84')][_0xbe1e('0x85')],'raw':!![]};var _0x1d18e6=_0x4dcc31['clone']();_0x1d18e6[_0xbe1e('0x41')]('i.id');_0x1d18e6[_0xbe1e('0x41')](_0xbe1e('0x86'),_0xbe1e('0x59'));if(_0x289c41['order']){_0x289c41[_0xbe1e('0x3d')][_0xbe1e('0x27')](function(_0x360e18){var _0x3f5115=_0x360e18[0x0]==='contactName'?_0x360e18[0x0]:'i.'+_0x360e18[0x0];_0x4dcc31[_0xbe1e('0x3d')](_0x3f5115,_0x360e18[0x1]===_0xbe1e('0x87')?![]:!![]);});}if(!_[_0xbe1e('0x70')](_0x3eb07d)){_0x4dcc31['having'](_0x2c1a76);_0x1d18e6['where'](_0xbe1e('0x88'),_0x3eb07d);}BPromise[_0xbe1e('0x89')]()[_0xbe1e('0x1d')](function(){if(!_0x591d26){if(_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x71')])return;_0x1d18e6['where'](_0xbe1e('0x8a'));_0x4dcc31[_0xbe1e('0x72')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4bea36[_0xbe1e('0x8b')]['role']!=='agent')return;return _0x4bea36[_0xbe1e('0x8b')][_0xbe1e('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbe1e('0x1d')](function(_0x36f7b0){if(_['isEmpty'](_0x36f7b0)){_0x1d18e6['where'](_0xbe1e('0x8d'));_0x4dcc31[_0xbe1e('0x72')](_0xbe1e('0x8d'));}else{_0x1d18e6[_0xbe1e('0x72')](_0xbe1e('0x73'),_[_0xbe1e('0x2f')](_0x36f7b0,'id'));_0x4dcc31[_0xbe1e('0x72')](_0xbe1e('0x73'),_[_0xbe1e('0x2f')](_0x36f7b0,'id'));}});})[_0xbe1e('0x1d')](function(){if(_0x4bea36[_0xbe1e('0x8b')]['role']==='agent'&&!_0x591d26&&!_0x4bea36[_0xbe1e('0x33')][_0xbe1e('0x71')])return[];return db[_0xbe1e('0x8e')][_0xbe1e('0x33')](_0x1d18e6[_0xbe1e('0x8f')](),_0x57f124);})['then'](function(_0x24e085){_0x36560c[_0xbe1e('0x17')]=_0x24e085[_0xbe1e('0x3a')];if(_0x36560c[_0xbe1e('0x17')]===0x0)return[];return db[_0xbe1e('0x8e')]['query'](_0x4d5a89[_0xbe1e('0x8f')](),_0x57f124)[_0xbe1e('0x1d')](function(_0x2efc3d){_0x120d8=_['keyBy'](_0x2efc3d,'id');_0x57f124=_[_0xbe1e('0x90')](_0x57f124,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bea36[_0xbe1e('0x33')]['fields']){_0x289c41['attributes'][_0xbe1e('0x27')](function(_0x120a29){_0x4dcc31[_0xbe1e('0x41')]('i.'+_0x120a29);});}else{_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x86'),'unreadMessages');_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x91'),_0xbe1e('0x92'));_0x4dcc31[_0xbe1e('0x41')]('a.mandatoryDisposition',_0xbe1e('0x93'));_0x4dcc31[_0xbe1e('0x41')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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',_0xbe1e('0x94'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x95'));_0x4dcc31['field'](_0xbe1e('0x96'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x97'));_0x4dcc31['field'](_0xbe1e('0x98'));_0x4dcc31[_0xbe1e('0x41')]('i.closedAt');_0x4dcc31[_0xbe1e('0x41')]('i.attach');_0x4dcc31['field']('i.lastMsgAt');_0x4dcc31['field'](_0xbe1e('0x99'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x9a'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x9b'));_0x4dcc31[_0xbe1e('0x41')]('i.secondDisposition');_0x4dcc31['field'](_0xbe1e('0x9c'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x9d'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x9e'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0x9f'));_0x4dcc31['field'](_0xbe1e('0xa0'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0xa1'));_0x4dcc31[_0xbe1e('0x41')]('c.firstName',_0xbe1e('0xa2'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0xa3'),_0xbe1e('0xa4'));_0x4dcc31['field']('c.email',_0xbe1e('0xa5'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0xa6'),_0xbe1e('0xa7'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0xa8'),_0xbe1e('0xa9'));_0x4dcc31[_0xbe1e('0x41')](_0xbe1e('0xaa'),_0xbe1e('0xab'));_0x4dcc31['field'](_0xbe1e('0xac'),_0xbe1e('0xad'));_0x4dcc31[_0xbe1e('0x41')]('o.internal','Owner.internal');_0x4dcc31[_0xbe1e('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbe1e('0x24'));}if(_0x289c41[_0xbe1e('0x16')])_0x4dcc31[_0xbe1e('0x16')](_0x289c41[_0xbe1e('0x16')]);if(_0x289c41['offset'])_0x4dcc31[_0xbe1e('0x14')](_0x289c41[_0xbe1e('0x14')]);return db[_0xbe1e('0x8e')][_0xbe1e('0x33')](_0x4dcc31['toString'](),_0x57f124);})[_0xbe1e('0x1d')](function(_0x130a37){if(_0x130a37[_0xbe1e('0x3a')]>0x0)_0x12daa6[_0xbe1e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0xbe1e('0x2f')](_0x130a37,'id'));return db['sequelize'][_0xbe1e('0x33')](_0x12daa6[_0xbe1e('0x8f')](),_0x57f124)['then'](function(_0x1f6030){var _0x5d790d=_[_0xbe1e('0xae')](_0x1f6030,_0xbe1e('0xaf'));var _0x5bbe09=[];return db[_0xbe1e('0xb0')][_0xbe1e('0x2a')]({'attributes':[_0xbe1e('0xb1')],'raw':!![]})[_0xbe1e('0x1d')](function(_0x3a5794){var _0x1db507=_0x3a5794[_0xbe1e('0xb1')];_0x130a37['forEach'](function(_0xf97b1a){_0x5bbe09[_0xbe1e('0x28')](updateMailInteraction(_0xf97b1a,_0x120d8,_0x5d790d,_0x1db507));});return BPromise['all'](_0x5bbe09);});});});})['then'](function(_0x35b3df){_0x36560c[_0xbe1e('0xb2')]=_0x35b3df;return _0x36560c;})['then'](respondWithFilteredResult(_0x4fcc5a,_0x289c41))[_0xbe1e('0xb3')](handleError(_0x4fcc5a,null));};exports[_0xbe1e('0xb4')]=function(_0x5eb0ac,_0x241a0e){var _0x272137={'raw':![],'where':{'id':_0x5eb0ac['params']['id']}},_0x2936d5={};_0x2936d5[_0xbe1e('0x37')]=_[_0xbe1e('0x34')](db[_0xbe1e('0x30')]['rawAttributes']);_0x2936d5[_0xbe1e('0x33')]=_[_0xbe1e('0x34')](_0x5eb0ac[_0xbe1e('0x33')]);_0x2936d5[_0xbe1e('0x35')]=_[_0xbe1e('0x36')](_0x2936d5[_0xbe1e('0x37')],_0x2936d5[_0xbe1e('0x33')]);_0x272137[_0xbe1e('0x38')]=_[_0xbe1e('0x36')](_0x2936d5[_0xbe1e('0x37')],qs['fields'](_0x5eb0ac[_0xbe1e('0x33')][_0xbe1e('0x39')]));_0x272137[_0xbe1e('0x38')]=_0x272137[_0xbe1e('0x38')][_0xbe1e('0x3a')]?_0x272137[_0xbe1e('0x38')]:_0x2936d5[_0xbe1e('0x37')];if(_0x5eb0ac['query'][_0xbe1e('0xb5')]){_0x272137['include']=[{'all':!![]}];}_0x272137=_['merge']({},_0x272137,_0x5eb0ac['options']);return db[_0xbe1e('0x30')][_0xbe1e('0x6d')](_0x272137)[_0xbe1e('0x1d')](handleEntityNotFound(_0x241a0e,null))[_0xbe1e('0x1d')](respondWithResult(_0x241a0e,null))[_0xbe1e('0xb3')](handleError(_0x241a0e,null));};exports['create']=function(_0x782f8c,_0x91cd97){return db[_0xbe1e('0x30')][_0xbe1e('0xb6')](_0x782f8c[_0xbe1e('0xb7')],{})[_0xbe1e('0x1d')](respondWithResult(_0x91cd97,0xc9))[_0xbe1e('0xb3')](handleError(_0x91cd97,null));};exports[_0xbe1e('0x1b')]=function(_0x50505e,_0xbafcd5){if(_0x50505e[_0xbe1e('0xb7')]['id']){delete _0x50505e[_0xbe1e('0xb7')]['id'];}return db[_0xbe1e('0x30')][_0xbe1e('0x6d')]({'where':{'id':_0x50505e[_0xbe1e('0xb8')]['id']}})[_0xbe1e('0x1d')](handleEntityNotFound(_0xbafcd5,null))[_0xbe1e('0x1d')](saveUpdates(_0x50505e[_0xbe1e('0xb7')],null))[_0xbe1e('0x1d')](respondWithResult(_0xbafcd5,null))[_0xbe1e('0xb3')](handleError(_0xbafcd5,null));};exports[_0xbe1e('0x1c')]=function(_0x337992,_0x290b76){return db[_0xbe1e('0x30')][_0xbe1e('0x6d')]({'where':{'id':_0x337992['params']['id']}})['then'](handleEntityNotFound(_0x290b76,null))[_0xbe1e('0x1d')](removeEntity(_0x290b76,null))[_0xbe1e('0xb3')](handleError(_0x290b76,null));};exports[_0xbe1e('0xb9')]=function(_0xf54d1f,_0x3cc2dc){return db[_0xbe1e('0x30')]['describe']()[_0xbe1e('0x1d')](respondWithResult(_0x3cc2dc,null))[_0xbe1e('0xb3')](handleError(_0x3cc2dc,null));};exports[_0xbe1e('0xba')]=function(_0x306287,_0x20481d){return db[_0xbe1e('0x29')][_0xbe1e('0x6d')]({'where':{'id':_0x306287['params']['id']}})[_0xbe1e('0x1d')](handleEntityNotFound(_0x20481d,null))['then'](function(_0x15b084){if(_0x15b084){return _0x15b084[_0xbe1e('0xba')](_0x306287[_0xbe1e('0xb7')]['ids'],_[_0xbe1e('0xbb')](_0x306287['body'],[_0xbe1e('0xbc'),'id'])||{});}})[_0xbe1e('0x1d')](respondWithResult(_0x20481d,null))['catch'](handleError(_0x20481d,null));};exports[_0xbe1e('0xbd')]=function(_0x175647,_0x340f45){var _0x29b07f={'raw':![],'where':{}};var _0x436d14={};var _0x45b817={'count':0x0,'rows':[]};return db[_0xbe1e('0x30')][_0xbe1e('0x2a')]({'where':{'id':_0x175647[_0xbe1e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x340f45,null))[_0xbe1e('0x1d')](function(_0x499906){if(_0x499906){_0x436d14[_0xbe1e('0x37')]=_[_0xbe1e('0x34')](db[_0xbe1e('0x29')][_0xbe1e('0x31')]);_0x436d14[_0xbe1e('0x33')]=_[_0xbe1e('0x34')](_0x175647['query']);_0x436d14['filters']=_[_0xbe1e('0x36')](_0x436d14['model'],_0x436d14[_0xbe1e('0x33')]);_0x29b07f[_0xbe1e('0x38')]=_[_0xbe1e('0x36')](_0x436d14[_0xbe1e('0x37')],qs[_0xbe1e('0x39')](_0x175647[_0xbe1e('0x33')][_0xbe1e('0x39')]));_0x29b07f['attributes']=_0x29b07f['attributes'][_0xbe1e('0x3a')]?_0x29b07f[_0xbe1e('0x38')]:_0x436d14[_0xbe1e('0x37')];if(!_0x175647[_0xbe1e('0x33')][_0xbe1e('0x3b')](_0xbe1e('0x3c'))){_0x29b07f[_0xbe1e('0x16')]=qs[_0xbe1e('0x16')](_0x175647[_0xbe1e('0x33')][_0xbe1e('0x16')]);_0x29b07f[_0xbe1e('0x14')]=qs[_0xbe1e('0x14')](_0x175647[_0xbe1e('0x33')][_0xbe1e('0x14')]);}_0x29b07f[_0xbe1e('0x3d')]=qs['sort'](_0x175647[_0xbe1e('0x33')]['sort']);_0x29b07f['where']=qs[_0xbe1e('0x35')](_['pick'](_0x175647[_0xbe1e('0x33')],_0x436d14[_0xbe1e('0x35')]));_0x29b07f[_0xbe1e('0x72')][_0xbe1e('0xaf')]=_0x499906['id'];if(_0x175647[_0xbe1e('0x33')][_0xbe1e('0x7d')]){_0x29b07f['where']=_[_0xbe1e('0x90')](_0x29b07f[_0xbe1e('0x72')],{'$or':_[_0xbe1e('0x2f')](_0x29b07f[_0xbe1e('0x38')],function(_0x4ff733){var _0x5a26e2={};_0x5a26e2[_0x4ff733]={'$like':'%'+_0x175647[_0xbe1e('0x33')]['filter']+'%'};return _0x5a26e2;})});}if(_0x175647[_0xbe1e('0x33')]['$gte']){var _0x3b3786=_0x175647[_0xbe1e('0x33')]['$gte'][_0xbe1e('0x26')](',');var _0xb1cffd={};_0xb1cffd[_0x3b3786[0x0]]={'$gte':moment(_0x3b3786[0x1])[_0xbe1e('0xbe')](_0xbe1e('0xbf'))};_0x29b07f[_0xbe1e('0x72')]=_[_0xbe1e('0x90')](_0x29b07f[_0xbe1e('0x72')],_0xb1cffd);}_0x29b07f=_['merge']({},_0x29b07f,_0x175647[_0xbe1e('0xc0')]);return db[_0xbe1e('0x29')][_0xbe1e('0x17')]({'where':_0x29b07f['where']})[_0xbe1e('0x1d')](function(_0x5e4b45){_0x45b817[_0xbe1e('0x17')]=_0x5e4b45;if(_0x175647[_0xbe1e('0x33')][_0xbe1e('0xb5')]){_0x29b07f[_0xbe1e('0xc1')]=[{'all':!![]}];}return db['MailMessage'][_0xbe1e('0xc2')](_0x29b07f);})[_0xbe1e('0x1d')](function(_0x47cb9d){if(_0x175647[_0xbe1e('0x33')][_0xbe1e('0xc3')]===_0xbe1e('0xc4')){for(var _0x32749f=0x0;_0x32749f<_0x47cb9d[_0xbe1e('0x3a')];_0x32749f++){_0x47cb9d[_0x32749f][_0xbe1e('0xb7')]=juice(_0x47cb9d[_0x32749f][_0xbe1e('0xb7')]);}}_0x45b817[_0xbe1e('0xb2')]=_0x47cb9d;return _0x45b817;});}})['then'](respondWithFilteredResult(_0x340f45,_0x29b07f))[_0xbe1e('0xb3')](handleError(_0x340f45,null));};exports[_0xbe1e('0xc5')]=function(_0x547a01,_0x3981b1){return db[_0xbe1e('0x30')][_0xbe1e('0x6d')]({'where':{'id':_0x547a01[_0xbe1e('0xb8')]['id']}})[_0xbe1e('0x1d')](handleEntityNotFound(_0x3981b1,null))['then'](function(_0x3deb54){if(_0x3deb54){return _0x3deb54[_0xbe1e('0xc6')](_0x547a01[_0xbe1e('0xb7')][_0xbe1e('0xbc')],_[_0xbe1e('0xbb')](_0x547a01[_0xbe1e('0xb7')],[_0xbe1e('0xbc'),'id'])||{})[_0xbe1e('0xc7')](function(){return db['Tag']['findAll']({'attributes':['id',_0xbe1e('0x20'),_0xbe1e('0x42')],'where':{'id':_0x547a01[_0xbe1e('0xb7')][_0xbe1e('0xbc')]}});})[_0xbe1e('0x1d')](function(_0x12c73e){socket[_0xbe1e('0xc8')](_0xbe1e('0xc9'),{'id':Number(_0x547a01[_0xbe1e('0xb8')]['id']),'tags':_0x12c73e||[]});return{'id':Number(_0x547a01[_0xbe1e('0xb8')]['id']),'tags':_0x12c73e||[]};});}})[_0xbe1e('0x1d')](respondWithResult(_0x3981b1,null))[_0xbe1e('0xb3')](handleError(_0x3981b1,null));};exports[_0xbe1e('0xca')]=function(_0x48dffb,_0x3fc117){return db[_0xbe1e('0x30')][_0xbe1e('0x6d')]({'where':{'id':_0x48dffb[_0xbe1e('0xb8')]['id']}})[_0xbe1e('0x1d')](handleEntityNotFound(_0x3fc117,null))[_0xbe1e('0x1d')](function(_0x47f5f1){if(_0x47f5f1){return _0x47f5f1[_0xbe1e('0xca')](_0x48dffb[_0xbe1e('0x33')][_0xbe1e('0xbc')]);}})['then'](respondWithStatusCode(_0x3fc117,null))['catch'](handleError(_0x3fc117,null));};exports[_0xbe1e('0xcb')]=function(_0xe8afa7,_0xfe5b05){var _0x229d67=moment()[_0xbe1e('0xcc')]()[_0xbe1e('0x8f')]();var _0x55f2a6=path['join'](config['root'],_0xbe1e('0xcd'),_0xbe1e('0xce'),'tmp');var _0xf5491=path['join'](config[_0xbe1e('0xcf')],_0xbe1e('0xcd'),_0xbe1e('0xce'),'attachments');var _0x539648=path[_0xbe1e('0xd0')](_0x55f2a6,_0x229d67);var _0xff839e=util[_0xbe1e('0xbe')](_0xbe1e('0xd1'),_0xe8afa7[_0xbe1e('0xb8')]['id'],_0x229d67);var _0x37ecae=path[_0xbe1e('0xd0')](_0x55f2a6,_0xff839e);var _0x18f7c4=[];if(_0xe8afa7[_0xbe1e('0x33')]['attachments']){_0x18f7c4[_0xbe1e('0x28')]({'model':db[_0xbe1e('0xd2')],'as':_0xbe1e('0xd3'),'raw':!![]});}var _0x32ae6d=[{'model':db['MailMessage'],'as':_0xbe1e('0xd4'),'attributes':['id','body',_0xbe1e('0x43'),'to','cc',_0xbe1e('0xd5'),_0xbe1e('0xd6'),_0xbe1e('0x74')],'where':{'secret':![]},'order':qs[_0xbe1e('0x3e')]('id'),'include':_0x18f7c4}];return db[_0xbe1e('0x30')]['find']({'where':{'id':_0xe8afa7['params']['id']},'include':_0x32ae6d})[_0xbe1e('0x1d')](handleEntityNotFound(_0xfe5b05,null))[_0xbe1e('0x1d')](function(_0x2c244e){if(_0x2c244e&&_0x2c244e[_0xbe1e('0xd4')]){var _0x215633=_0x2c244e[_0xbe1e('0xd7')]({'plain':!![]});fs[_0xbe1e('0xd8')](_0x539648);return BPromise[_0xbe1e('0xd9')](_0x215633[_0xbe1e('0xd4')],function(_0x5dc08d,_0x1a062a){var _0x50f39e={'from':_0x5dc08d[_0xbe1e('0x43')],'to':_0x5dc08d['to'],'subject':_0x5dc08d[_0xbe1e('0xd6')],'html':htmlEntities['decode'](_0x5dc08d['body']),'headers':{'Date':moment(_0x5dc08d[_0xbe1e('0x74')])[_0xbe1e('0xbe')](_0xbe1e('0xda'))},'attachments':[]};if(_0x5dc08d['cc']){_0x50f39e[_0xbe1e('0xdb')]['Cc']=_0x5dc08d['cc'];}if(_0x5dc08d['bcc']){_0x50f39e[_0xbe1e('0xdb')][_0xbe1e('0xdc')]=_0x5dc08d[_0xbe1e('0xd5')];}return new BPromise(function(_0x3d1044,_0x1f7829){if(_0x5dc08d[_0xbe1e('0xd3')]){for(var _0x1881a3=0x0;_0x1881a3<_0x5dc08d[_0xbe1e('0xd3')]['length'];_0x1881a3++){var _0x3ca5ae=_0x5dc08d[_0xbe1e('0xd3')][_0x1881a3];var _0x4bacdc=path[_0xbe1e('0xd0')](_0xf5491,_0x3ca5ae['basename']);if(fs[_0xbe1e('0xdd')](_0x4bacdc)){_0x50f39e['attachments'][_0xbe1e('0x28')]({'name':_0x3ca5ae[_0xbe1e('0x20')],'contentType':_0x3ca5ae[_0xbe1e('0x65')],'data':fs[_0xbe1e('0xde')](_0x4bacdc)});}}}emlformat[_0xbe1e('0xdf')](_0x50f39e,function(_0x469ba6,_0x2aa72d){if(_0x469ba6)return _0x1f7829(_0x469ba6);fs[_0xbe1e('0xe0')](path[_0xbe1e('0xd0')](_0x539648,util[_0xbe1e('0xbe')](_0xbe1e('0xe1'),_0x1a062a)),_0x2aa72d);return _0x3d1044(_0x2aa72d);});});})['then'](function(){return new BPromise(function(_0x5bc52a,_0x2d1885){zipdir(_0x539648,{'saveTo':_0x37ecae},function(_0x11c1dc,_0x5b640f){if(_0x11c1dc)return _0x2d1885(_0x11c1dc);return _0x5bc52a(_0x5b640f);});})[_0xbe1e('0x1d')](function(){return new BPromise(function(_0x184d49,_0x5b2b19){rimraf(_0x539648,function(_0x271b84){if(_0x271b84)_0x5b2b19(_0x271b84);return _0x184d49();});});})[_0xbe1e('0x1d')](function(){return _0xfe5b05['download'](_0x37ecae,_0xff839e,function(_0x234d29){if(!_0x234d29)fs[_0xbe1e('0xe2')](_0x37ecae);});});});}else{return _0xfe5b05[_0xbe1e('0x12')](0xc8);}})[_0xbe1e('0xb3')](handleError(_0xfe5b05,null));}; \ No newline at end of file +var _0x7c47=['Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','show','params','includeAll','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','name','send','TagIds','Tags','split','forEach','push','MailMessage','-id','lastMsgText','trimStart','plainBody','catch','index','map','MailInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','value','`\x20=\x200','having','`\x20>\x200','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','operator','UserId','keys','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','unreadMessages'];(function(_0xd73a6d,_0x1da0ab){var _0x1c0143=function(_0x27ef34){while(--_0x27ef34){_0xd73a6d['push'](_0xd73a6d['shift']());}};_0x1c0143(++_0x1da0ab);}(_0x7c47,0x135));var _0x77c4=function(_0x3689ca,_0x4a1ab4){_0x3689ca=_0x3689ca-0x0;var _0x50223a=_0x7c47[_0x3689ca];return _0x50223a;};'use strict';var emlformat=require(_0x77c4('0x0'));var rimraf=require(_0x77c4('0x1'));var zipdir=require(_0x77c4('0x2'));var moment=require(_0x77c4('0x3'));var BPromise=require(_0x77c4('0x4'));var util=require(_0x77c4('0x5'));var path=require(_0x77c4('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require(_0x77c4('0x7'));var Redis=require(_0x77c4('0x8'));var qs=require(_0x77c4('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x77c4('0xa'));var config=require(_0x77c4('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x77c4('0xc'));config[_0x77c4('0xd')]=_[_0x77c4('0xe')](config[_0x77c4('0xd')],{'host':_0x77c4('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x77c4('0x10'))['register'](socket);function respondWithStatusCode(_0x505619,_0x459c94){_0x459c94=_0x459c94||0xcc;return function(_0x562554){if(_0x562554){return _0x505619[_0x77c4('0x11')](_0x459c94);}return _0x505619[_0x77c4('0x12')](_0x459c94)[_0x77c4('0x13')]();};}function respondWithResult(_0x375d9f,_0x5b4116){_0x5b4116=_0x5b4116||0xc8;return function(_0x4ebdc3){if(_0x4ebdc3){return _0x375d9f['status'](_0x5b4116)[_0x77c4('0x14')](_0x4ebdc3);}};}function respondWithFilteredResult(_0x107c45,_0x3fed49){return function(_0x3d6116){if(_0x3d6116){var _0x4f6b51=typeof _0x3fed49[_0x77c4('0x15')]===_0x77c4('0x16')&&typeof _0x3fed49['limit']==='undefined';var _0x17290b=_0x3d6116[_0x77c4('0x17')];var _0x208b4e=_0x4f6b51?0x0:_0x3fed49[_0x77c4('0x15')];var _0x22306d=_0x4f6b51?_0x3d6116[_0x77c4('0x17')]:_0x3fed49[_0x77c4('0x15')]+_0x3fed49[_0x77c4('0x18')];var _0x2dcd83;if(_0x22306d>=_0x17290b){_0x22306d=_0x17290b;_0x2dcd83=0xc8;}else{_0x2dcd83=0xce;}_0x107c45['status'](_0x2dcd83);return _0x107c45[_0x77c4('0x19')](_0x77c4('0x1a'),_0x208b4e+'-'+_0x22306d+'/'+_0x17290b)[_0x77c4('0x14')](_0x3d6116);}return null;};}function saveUpdates(_0x3d067e){return function(_0xfecba4){if(_0xfecba4){return _0xfecba4[_0x77c4('0x1b')](_0x3d067e)[_0x77c4('0x1c')](function(_0x381d35){return _0x381d35;});}return null;};}function removeEntity(_0x31c5a8){return function(_0x10bea1){if(_0x10bea1){return _0x10bea1[_0x77c4('0x1d')]()[_0x77c4('0x1c')](function(){_0x31c5a8['status'](0xcc)[_0x77c4('0x13')]();});}};}function handleEntityNotFound(_0x93ae22){return function(_0x5b19b3){if(!_0x5b19b3){_0x93ae22[_0x77c4('0x11')](0x194);}return _0x5b19b3;};}function handleError(_0x56722a,_0x79ed3e){_0x79ed3e=_0x79ed3e||0x1f4;return function(_0x43bf4f){logger[_0x77c4('0x1e')](_0x43bf4f['stack']);if(_0x43bf4f[_0x77c4('0x1f')]){delete _0x43bf4f['name'];}_0x56722a[_0x77c4('0x12')](_0x79ed3e)[_0x77c4('0x20')](_0x43bf4f);};}function getInteractionUsers(_0x15d227,_0x4918bd){return new BPromise(function(_0x37c12c,_0x24c46f){try{if(_0x4918bd[_0x15d227['id']]){_0x15d227['Users']=_['map'](_0x4918bd[_0x15d227['id']],function(_0x24b81c){return{'id':_0x24b81c['id'],'fullname':_0x24b81c['fullname']};});}}catch(_0x1ea5ec){_0x24c46f(_0x1ea5ec);}_0x37c12c(_0x15d227);});}function getInteractionTags(_0xe7cb7a,_0x4a5763){return new BPromise(function(_0x3a1835,_0x4a37b4){try{if(_0xe7cb7a[_0x77c4('0x21')]){_0xe7cb7a[_0x77c4('0x22')]=[];_0xe7cb7a['TagIds'][_0x77c4('0x23')](',')[_0x77c4('0x24')](function(_0x1efe94){_0xe7cb7a[_0x77c4('0x22')][_0x77c4('0x25')](_0x4a5763[_0x1efe94]);});}delete _0xe7cb7a[_0x77c4('0x21')];}catch(_0x28942a){_0x4a37b4(_0x28942a);}_0x3a1835(_0xe7cb7a);});}function getLastMessageText(_0x585f27){return new BPromise(function(_0x3e3f44,_0x24f254){return db[_0x77c4('0x26')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x585f27['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x77c4('0x27'),'raw':!![]})[_0x77c4('0x1c')](function(_0x104842){if(_0x104842&&_0x104842['plainBody']){_0x585f27[_0x77c4('0x28')]=_[_0x77c4('0x29')](_0x104842[_0x77c4('0x2a')]);}_0x3e3f44(_0x585f27);})[_0x77c4('0x2b')](function(_0x469bbb){_0x24f254(_0x469bbb);});});}function updateMailInteraction(_0x2baa01,_0x1cd99c,_0x1428e6,_0xc2fe17){return new BPromise(function(_0x392f60,_0x131539){return getInteractionUsers(_0x2baa01,_0x1428e6)[_0x77c4('0x1c')](function(_0x2319c5){return getInteractionTags(_0x2319c5,_0x1cd99c);})['then'](function(_0x4de8e4){if(_0xc2fe17){_0x392f60(getLastMessageText(_0x4de8e4));}else{_0x392f60(_0x4de8e4);}})[_0x77c4('0x2b')](function(_0x2220b0){_0x131539(_0x2220b0);});});}exports[_0x77c4('0x2c')]=function(_0x49dde3,_0x15dc61){var _0x53d8a7={},_0x28779f={},_0x2f10cc={'count':0x0,'rows':[]};var _0x1546cd=_[_0x77c4('0x2d')](db[_0x77c4('0x2e')][_0x77c4('0x2f')],function(_0x48179e){return{'name':_0x48179e[_0x77c4('0x30')],'type':_0x48179e[_0x77c4('0x31')][_0x77c4('0x32')]};});_0x28779f[_0x77c4('0x33')]=_[_0x77c4('0x2d')](_0x1546cd,_0x77c4('0x1f'));_0x28779f['query']=_['keys'](_0x49dde3[_0x77c4('0x34')]);_0x28779f[_0x77c4('0x35')]=_[_0x77c4('0x36')](_0x28779f[_0x77c4('0x33')],_0x28779f[_0x77c4('0x34')]);_0x53d8a7['attributes']=_[_0x77c4('0x36')](_0x28779f[_0x77c4('0x33')],qs[_0x77c4('0x37')](_0x49dde3[_0x77c4('0x34')][_0x77c4('0x37')]));_0x53d8a7[_0x77c4('0x38')]=_0x53d8a7['attributes']['length']?_0x53d8a7['attributes']:_0x28779f['model'];if(!_0x49dde3['query'][_0x77c4('0x39')]('nolimit')){_0x53d8a7[_0x77c4('0x18')]=qs['limit'](_0x49dde3[_0x77c4('0x34')]['limit']);_0x53d8a7[_0x77c4('0x15')]=qs['offset'](_0x49dde3[_0x77c4('0x34')]['offset']);}_0x53d8a7['order']=qs[_0x77c4('0x3a')](_0x49dde3[_0x77c4('0x34')]['sort']);_0x53d8a7[_0x77c4('0x3b')]=qs[_0x77c4('0x35')](_[_0x77c4('0x3c')](_0x49dde3['query'],_0x28779f[_0x77c4('0x35')]),_0x1546cd);var _0x566a0b=[];var _0x178a37=squel['select']()[_0x77c4('0x3d')]('id')[_0x77c4('0x3d')](_0x77c4('0x1f'))['field'](_0x77c4('0x3e'))[_0x77c4('0x3f')](_0x77c4('0x40'));var _0x2a12a6=squel[_0x77c4('0x41')]()[_0x77c4('0x3d')](_0x77c4('0x42'))[_0x77c4('0x3d')](_0x77c4('0x43'))['field'](_0x77c4('0x44'))[_0x77c4('0x3f')](_0x77c4('0x45'),'ui')[_0x77c4('0x46')](_0x77c4('0x47'),'u',_0x77c4('0x48'));var _0x33d29a=squel[_0x77c4('0x41')]()['from'](_0x77c4('0x49'),'i')[_0x77c4('0x46')](_0x77c4('0x4a'),'c',_0x77c4('0x4b'))[_0x77c4('0x46')]('users','o','o.id\x20=\x20i.UserId')[_0x77c4('0x46')]('mail_accounts','a',_0x77c4('0x4c'))[_0x77c4('0x46')](_0x77c4('0x4d'),'me',_0x77c4('0x4e'))[_0x77c4('0x46')](_0x77c4('0x4f'),'it',_0x77c4('0x50'))[_0x77c4('0x46')](_0x77c4('0x40'),'t',_0x77c4('0x51'));var _0x1725ce=squel[_0x77c4('0x52')]();var _0x137f20=[];var _0x2fc8c5=squel[_0x77c4('0x52')]();var _0x3373dc;if(_0x49dde3[_0x77c4('0x34')]['search']){_0x3373dc=as[_0x77c4('0x53')](_0x49dde3[_0x77c4('0x34')][_0x77c4('0x54')]);var _0x4ce073=_0x3373dc[_0x77c4('0x55')];for(var _0x5108c2=0x0;_0x5108c2<_0x3373dc[_0x77c4('0x56')][_0x77c4('0x57')];_0x5108c2++){var _0x9a6550=_0x3373dc['conditions'][_0x5108c2];var _0x39d11f='i';var _0x35d8f9=_[_0x77c4('0x58')](_0x1546cd,['name',_0x9a6550['field']]);if(!_0x35d8f9){switch(_0x9a6550[_0x77c4('0x3d')]){case'unreadMessages':if(_0x9a6550[_0x77c4('0x59')]==0x1){_0x33d29a['having']('`'+_0x9a6550[_0x77c4('0x3d')]+_0x77c4('0x5a'));}else{_0x33d29a[_0x77c4('0x5b')]('`'+_0x9a6550[_0x77c4('0x3d')]+_0x77c4('0x5c'));}break;case'Contact':if(_0x9a6550['operator']===_0x77c4('0x5d')){if(_0x9a6550['value'][_0x77c4('0x23')]('\x20')[_0x77c4('0x57')]>0x1){_0x1725ce[_0x4ce073]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x9a6550[_0x77c4('0x59')]),null);}else{var _0x25548d='%'+_0x9a6550['value']+'%';_0x1725ce[_0x4ce073](_0x77c4('0x5e'),_0x25548d,_0x25548d,_0x25548d);}}else{_0x35d8f9=_[_0x77c4('0x58')](_0x1546cd,['name',_0x77c4('0x5f')]);_0x9a6550[_0x77c4('0x3d')]=_0x77c4('0x5f');_0x2d6f3=as[_0x77c4('0x60')](_0x39d11f,_0x35d8f9[_0x77c4('0x31')],_0x9a6550);_0x1725ce[_0x4ce073](_0x2d6f3[_0x77c4('0x61')],_0x2d6f3['value'][_0x77c4('0x62')],_0x2d6f3['value'][_0x77c4('0x13')]);}break;case'Tag':var _0x1c5e75=_0x9a6550[_0x77c4('0x59')][_0x77c4('0x23')](',')[_0x77c4('0x2d')](function(_0x55ba13){return Number(_0x55ba13);});_0x1c5e75[_0x77c4('0x24')](function(_0x42cf89){_0x2fc8c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x42cf89+',%');});_0x137f20=_['union'](_0x137f20,_0x1c5e75);break;case _0x77c4('0x63'):if(_0x9a6550[_0x77c4('0x64')]===_0x77c4('0x5d')){_0x1725ce[_0x4ce073]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x9a6550['value']+'%',null);}else{_0x35d8f9=_[_0x77c4('0x58')](_0x1546cd,['name',_0x77c4('0x65')]);_0x9a6550['field']=_0x77c4('0x65');_0x2d6f3=as[_0x77c4('0x60')](_0x39d11f,_0x35d8f9['type'],_0x9a6550);_0x1725ce[_0x4ce073](_0x2d6f3[_0x77c4('0x61')],_0x2d6f3[_0x77c4('0x59')][_0x77c4('0x62')],_0x2d6f3[_0x77c4('0x59')]['end']);}break;case _0x77c4('0x2a'):_0x2d6f3=as[_0x77c4('0x60')]('me',null,_0x9a6550);_0x1725ce[_0x4ce073](_0x2d6f3[_0x77c4('0x61')],_0x2d6f3[_0x77c4('0x59')][_0x77c4('0x62')],_0x2d6f3[_0x77c4('0x59')][_0x77c4('0x13')]);break;}}else{var _0x2d6f3=as[_0x77c4('0x60')](_0x39d11f,_0x35d8f9[_0x77c4('0x31')],_0x9a6550);_0x1725ce[_0x4ce073](_0x2d6f3[_0x77c4('0x61')],_0x2d6f3[_0x77c4('0x59')][_0x77c4('0x62')],_0x2d6f3['value'][_0x77c4('0x13')]);}}}else{var _0x5f59c1=_(_0x49dde3['query'])[_0x77c4('0x66')]()['map'](function(_0x36ac46){return _[_0x77c4('0x67')](_0x1546cd,[_0x77c4('0x1f'),_0x36ac46])?_0x36ac46:undefined;})[_0x77c4('0x68')]()[_0x77c4('0x59')]();if(!_[_0x77c4('0x69')](_0x5f59c1)){_0x5f59c1['forEach'](function(_0xdab4c5){if(_0xdab4c5==='MailAccountId'){_0x33d29a[_0x77c4('0x3b')](_0x77c4('0x6a'),[][_0x77c4('0x6b')](_0x49dde3[_0x77c4('0x34')][_0xdab4c5]));}else if(_0xdab4c5===_0x77c4('0x6c')){var _0x5d5906=JSON[_0x77c4('0x6d')](_0x49dde3['query'][_0xdab4c5])[_0x77c4('0x6e')];var _0x1227ca=JSON['parse'](_0x49dde3[_0x77c4('0x34')][_0xdab4c5])['$lte'];_0x33d29a['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5d5906,_0x1227ca);}else{if(_0x49dde3[_0x77c4('0x34')][_0xdab4c5]===_0x77c4('0x6f')){_0x33d29a['where']('i.'+_0xdab4c5+'\x20IS\x20NULL');}else{_0x33d29a[_0x77c4('0x3b')]('i.'+_0xdab4c5+_0x77c4('0x70'),_0x49dde3[_0x77c4('0x34')][_0xdab4c5]);}}});}if(_0x49dde3[_0x77c4('0x34')]['read']){if(_0x49dde3[_0x77c4('0x34')]['read']==0x1){_0x33d29a['having'](_0x77c4('0x71'));}else{_0x33d29a[_0x77c4('0x5b')](_0x77c4('0x72'));}}if(_0x49dde3[_0x77c4('0x34')][_0x77c4('0x73')]){_0x137f20=_['isArray'](_0x49dde3[_0x77c4('0x34')][_0x77c4('0x73')])?_0x49dde3[_0x77c4('0x34')]['tag']:new Array(_0x49dde3['query']['tag']);_0x137f20[_0x77c4('0x24')](function(_0x1bac17){_0x2fc8c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bac17+',%');});}if(_0x49dde3[_0x77c4('0x34')][_0x77c4('0x74')]){var _0x3a0890=_0x49dde3[_0x77c4('0x34')][_0x77c4('0x74')]['replace']('\x5c','\x5c\x5c')[_0x77c4('0x75')](/'/g,'\x27\x27');if(qs[_0x77c4('0x76')](_0x3a0890)){_0x1725ce['or'](_0x77c4('0x77'),_0x3a0890+'%');}else if(qs[_0x77c4('0x78')](_0x3a0890)){_0x1725ce['or'](_0x77c4('0x79'),_0x3a0890+'%');}else{_0x1725ce['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3a0890))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x77c4('0x7a')](_0x3a0890));}}}_0x33d29a[_0x77c4('0x3b')](_0x1725ce);_0x33d29a['group'](_0x77c4('0x7b'));var _0x4e60b9={'type':db[_0x77c4('0x7c')][_0x77c4('0x7d')][_0x77c4('0x7e')],'raw':!![]};var _0x3b996f=_0x33d29a['clone']();_0x3b996f[_0x77c4('0x3d')](_0x77c4('0x7b'));_0x3b996f[_0x77c4('0x3d')](_0x77c4('0x7f'),'unreadMessages');if(_0x53d8a7[_0x77c4('0x80')]){_0x53d8a7[_0x77c4('0x80')][_0x77c4('0x24')](function(_0x4f272e){var _0x208775=_0x4f272e[0x0]===_0x77c4('0x81')?_0x4f272e[0x0]:'i.'+_0x4f272e[0x0];_0x33d29a[_0x77c4('0x80')](_0x208775,_0x4f272e[0x1]===_0x77c4('0x82')?![]:!![]);});}if(!_[_0x77c4('0x69')](_0x137f20)){_0x33d29a[_0x77c4('0x5b')](_0x2fc8c5);_0x3b996f[_0x77c4('0x3b')](_0x77c4('0x83'),_0x137f20);}BPromise['resolve']()[_0x77c4('0x1c')](function(){if(!_0x3373dc){if(_0x49dde3[_0x77c4('0x34')][_0x77c4('0x84')])return;_0x3b996f['where'](_0x77c4('0x85'));_0x33d29a[_0x77c4('0x3b')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x49dde3[_0x77c4('0x86')][_0x77c4('0x87')]!==_0x77c4('0x88'))return;return _0x49dde3[_0x77c4('0x86')][_0x77c4('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22ce14){if(_['isEmpty'](_0x22ce14)){_0x3b996f[_0x77c4('0x3b')](_0x77c4('0x8a'));_0x33d29a['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x3b996f[_0x77c4('0x3b')](_0x77c4('0x6a'),_[_0x77c4('0x2d')](_0x22ce14,'id'));_0x33d29a[_0x77c4('0x3b')]('i.MailAccountId\x20IN\x20?',_[_0x77c4('0x2d')](_0x22ce14,'id'));}});})[_0x77c4('0x1c')](function(){if(_0x49dde3[_0x77c4('0x86')][_0x77c4('0x87')]===_0x77c4('0x88')&&!_0x3373dc&&!_0x49dde3[_0x77c4('0x34')][_0x77c4('0x84')])return[];return db[_0x77c4('0x8b')][_0x77c4('0x34')](_0x3b996f['toString'](),_0x4e60b9);})[_0x77c4('0x1c')](function(_0x2f2b8e){_0x2f10cc[_0x77c4('0x17')]=_0x2f2b8e[_0x77c4('0x57')];if(_0x2f10cc[_0x77c4('0x17')]===0x0)return[];return db['sequelize']['query'](_0x178a37[_0x77c4('0x8c')](),_0x4e60b9)['then'](function(_0x1e71f1){_0x566a0b=_['keyBy'](_0x1e71f1,'id');_0x4e60b9=_[_0x77c4('0x8d')](_0x4e60b9,{'model':db[_0x77c4('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49dde3[_0x77c4('0x34')][_0x77c4('0x37')]){_0x53d8a7[_0x77c4('0x38')]['forEach'](function(_0x4e8a66){_0x33d29a[_0x77c4('0x3d')]('i.'+_0x4e8a66);});}else{_0x33d29a['field'](_0x77c4('0x7f'),_0x77c4('0x8e'));_0x33d29a['field']('a.key',_0x77c4('0x8f'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x90'),_0x77c4('0x91'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x92'),_0x77c4('0x81'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x7b'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x93'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x94'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x95'));_0x33d29a[_0x77c4('0x3d')]('i.closedAt');_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x96'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x97'));_0x33d29a['field']('i.lastMsgDirection');_0x33d29a['field'](_0x77c4('0x98'));_0x33d29a['field'](_0x77c4('0x99'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x9a'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x9b'));_0x33d29a['field'](_0x77c4('0x9c'));_0x33d29a['field'](_0x77c4('0x9d'));_0x33d29a[_0x77c4('0x3d')]('i.ContactId');_0x33d29a['field'](_0x77c4('0x9e'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0x9f'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0xa0'),_0x77c4('0xa1'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0xa2'),_0x77c4('0xa3'));_0x33d29a[_0x77c4('0x3d')]('c.email',_0x77c4('0xa4'));_0x33d29a['field']('c.phone','Contact.phone');_0x33d29a[_0x77c4('0x3d')](_0x77c4('0xa5'),_0x77c4('0xa6'));_0x33d29a['field']('c.fax','Contact.fax');_0x33d29a[_0x77c4('0x3d')](_0x77c4('0xa7'),_0x77c4('0xa8'));_0x33d29a[_0x77c4('0x3d')](_0x77c4('0xa9'),_0x77c4('0xaa'));_0x33d29a['field'](_0x77c4('0xab'),_0x77c4('0x21'));}if(_0x53d8a7['limit'])_0x33d29a[_0x77c4('0x18')](_0x53d8a7['limit']);if(_0x53d8a7['offset'])_0x33d29a['offset'](_0x53d8a7['offset']);return db[_0x77c4('0x8b')][_0x77c4('0x34')](_0x33d29a['toString'](),_0x4e60b9);})[_0x77c4('0x1c')](function(_0x477820){if(_0x477820['length']>0x0)_0x2a12a6[_0x77c4('0x3b')](_0x77c4('0xac'),_[_0x77c4('0x2d')](_0x477820,'id'));return db[_0x77c4('0x8b')][_0x77c4('0x34')](_0x2a12a6[_0x77c4('0x8c')](),_0x4e60b9)[_0x77c4('0x1c')](function(_0x68086f){var _0x5c81ca=_[_0x77c4('0xad')](_0x68086f,_0x77c4('0xae'));var _0x3d9809=[];return db[_0x77c4('0xaf')][_0x77c4('0xb0')]({'attributes':[_0x77c4('0xb1')],'raw':!![]})['then'](function(_0x2e4a9f){var _0x340426=_0x2e4a9f[_0x77c4('0xb1')];_0x477820[_0x77c4('0x24')](function(_0x53a389){_0x3d9809[_0x77c4('0x25')](updateMailInteraction(_0x53a389,_0x566a0b,_0x5c81ca,_0x340426));});return BPromise[_0x77c4('0xb2')](_0x3d9809);});});});})[_0x77c4('0x1c')](function(_0x3d2ad0){_0x2f10cc[_0x77c4('0xb3')]=_0x3d2ad0;return _0x2f10cc;})[_0x77c4('0x1c')](respondWithFilteredResult(_0x15dc61,_0x53d8a7))[_0x77c4('0x2b')](handleError(_0x15dc61,null));};exports[_0x77c4('0xb4')]=function(_0x518181,_0xe2b106){var _0x2eddf8={'raw':![],'where':{'id':_0x518181[_0x77c4('0xb5')]['id']}},_0x333dcf={};_0x333dcf[_0x77c4('0x33')]=_[_0x77c4('0x66')](db[_0x77c4('0x2e')]['rawAttributes']);_0x333dcf[_0x77c4('0x34')]=_['keys'](_0x518181[_0x77c4('0x34')]);_0x333dcf[_0x77c4('0x35')]=_[_0x77c4('0x36')](_0x333dcf['model'],_0x333dcf[_0x77c4('0x34')]);_0x2eddf8[_0x77c4('0x38')]=_[_0x77c4('0x36')](_0x333dcf[_0x77c4('0x33')],qs[_0x77c4('0x37')](_0x518181['query']['fields']));_0x2eddf8[_0x77c4('0x38')]=_0x2eddf8[_0x77c4('0x38')][_0x77c4('0x57')]?_0x2eddf8['attributes']:_0x333dcf[_0x77c4('0x33')];if(_0x518181[_0x77c4('0x34')][_0x77c4('0xb6')]){_0x2eddf8['include']=[{'all':!![]}];}_0x2eddf8=_[_0x77c4('0x8d')]({},_0x2eddf8,_0x518181[_0x77c4('0xb7')]);return db[_0x77c4('0x2e')][_0x77c4('0x58')](_0x2eddf8)['then'](handleEntityNotFound(_0xe2b106,null))[_0x77c4('0x1c')](respondWithResult(_0xe2b106,null))[_0x77c4('0x2b')](handleError(_0xe2b106,null));};exports[_0x77c4('0xb8')]=function(_0x51d73f,_0x543fd4){return db[_0x77c4('0x2e')][_0x77c4('0xb8')](_0x51d73f[_0x77c4('0xb9')],{})['then'](respondWithResult(_0x543fd4,0xc9))[_0x77c4('0x2b')](handleError(_0x543fd4,null));};exports[_0x77c4('0x1b')]=function(_0x2132b2,_0x4f0bc4){if(_0x2132b2[_0x77c4('0xb9')]['id']){delete _0x2132b2[_0x77c4('0xb9')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x2132b2[_0x77c4('0xb5')]['id']}})['then'](handleEntityNotFound(_0x4f0bc4,null))['then'](saveUpdates(_0x2132b2[_0x77c4('0xb9')],null))['then'](respondWithResult(_0x4f0bc4,null))[_0x77c4('0x2b')](handleError(_0x4f0bc4,null));};exports[_0x77c4('0x1d')]=function(_0xdb377a,_0x51768b){return db['MailInteraction']['find']({'where':{'id':_0xdb377a[_0x77c4('0xb5')]['id']}})[_0x77c4('0x1c')](handleEntityNotFound(_0x51768b,null))['then'](removeEntity(_0x51768b,null))[_0x77c4('0x2b')](handleError(_0x51768b,null));};exports[_0x77c4('0xba')]=function(_0x10df20,_0x4e6775){return db['MailInteraction'][_0x77c4('0xba')]()[_0x77c4('0x1c')](respondWithResult(_0x4e6775,null))[_0x77c4('0x2b')](handleError(_0x4e6775,null));};exports['addMessage']=function(_0x2598b9,_0x3f5b45){return db['MailMessage'][_0x77c4('0x58')]({'where':{'id':_0x2598b9['params']['id']}})[_0x77c4('0x1c')](handleEntityNotFound(_0x3f5b45,null))[_0x77c4('0x1c')](function(_0x2c5fc6){if(_0x2c5fc6){return _0x2c5fc6[_0x77c4('0xbb')](_0x2598b9[_0x77c4('0xb9')][_0x77c4('0xbc')],_[_0x77c4('0xbd')](_0x2598b9[_0x77c4('0xb9')],['ids','id'])||{});}})[_0x77c4('0x1c')](respondWithResult(_0x3f5b45,null))[_0x77c4('0x2b')](handleError(_0x3f5b45,null));};exports[_0x77c4('0xbe')]=function(_0x315e6f,_0x217a3){var _0x35f746={'raw':![],'where':{}};var _0x557709={};var _0x164376={'count':0x0,'rows':[]};return db[_0x77c4('0x2e')]['findOne']({'where':{'id':_0x315e6f[_0x77c4('0xb5')]['id']}})[_0x77c4('0x1c')](handleEntityNotFound(_0x217a3,null))[_0x77c4('0x1c')](function(_0x19eae6){if(_0x19eae6){_0x557709[_0x77c4('0x33')]=_[_0x77c4('0x66')](db[_0x77c4('0x26')][_0x77c4('0x2f')]);_0x557709['query']=_[_0x77c4('0x66')](_0x315e6f['query']);_0x557709['filters']=_[_0x77c4('0x36')](_0x557709['model'],_0x557709['query']);_0x35f746[_0x77c4('0x38')]=_[_0x77c4('0x36')](_0x557709['model'],qs['fields'](_0x315e6f[_0x77c4('0x34')][_0x77c4('0x37')]));_0x35f746['attributes']=_0x35f746[_0x77c4('0x38')][_0x77c4('0x57')]?_0x35f746['attributes']:_0x557709['model'];if(!_0x315e6f['query'][_0x77c4('0x39')](_0x77c4('0xbf'))){_0x35f746[_0x77c4('0x18')]=qs['limit'](_0x315e6f[_0x77c4('0x34')][_0x77c4('0x18')]);_0x35f746['offset']=qs['offset'](_0x315e6f[_0x77c4('0x34')]['offset']);}_0x35f746[_0x77c4('0x80')]=qs[_0x77c4('0x3a')](_0x315e6f[_0x77c4('0x34')]['sort']);_0x35f746[_0x77c4('0x3b')]=qs[_0x77c4('0x35')](_[_0x77c4('0x3c')](_0x315e6f[_0x77c4('0x34')],_0x557709['filters']));_0x35f746[_0x77c4('0x3b')][_0x77c4('0xae')]=_0x19eae6['id'];if(_0x315e6f[_0x77c4('0x34')][_0x77c4('0x74')]){_0x35f746[_0x77c4('0x3b')]=_[_0x77c4('0x8d')](_0x35f746[_0x77c4('0x3b')],{'$or':_[_0x77c4('0x2d')](_0x35f746[_0x77c4('0x38')],function(_0x54f66c){var _0x57e23a={};_0x57e23a[_0x54f66c]={'$like':'%'+_0x315e6f[_0x77c4('0x34')][_0x77c4('0x74')]+'%'};return _0x57e23a;})});}if(_0x315e6f[_0x77c4('0x34')][_0x77c4('0x6e')]){var _0x1be291=_0x315e6f[_0x77c4('0x34')][_0x77c4('0x6e')][_0x77c4('0x23')](',');var _0x4ed9d0={};_0x4ed9d0[_0x1be291[0x0]]={'$gte':moment(_0x1be291[0x1])[_0x77c4('0xc0')](_0x77c4('0xc1'))};_0x35f746[_0x77c4('0x3b')]=_[_0x77c4('0x8d')](_0x35f746[_0x77c4('0x3b')],_0x4ed9d0);}_0x35f746=_[_0x77c4('0x8d')]({},_0x35f746,_0x315e6f[_0x77c4('0xb7')]);return db[_0x77c4('0x26')][_0x77c4('0x17')]({'where':_0x35f746[_0x77c4('0x3b')]})[_0x77c4('0x1c')](function(_0x25ba91){_0x164376[_0x77c4('0x17')]=_0x25ba91;if(_0x315e6f['query'][_0x77c4('0xb6')]){_0x35f746['include']=[{'all':!![]}];}return db[_0x77c4('0x26')][_0x77c4('0xc2')](_0x35f746);})['then'](function(_0x58fb17){if(_0x315e6f['query'][_0x77c4('0xc3')]==='true'){for(var _0xdf6c58=0x0;_0xdf6c58<_0x58fb17[_0x77c4('0x57')];_0xdf6c58++){_0x58fb17[_0xdf6c58][_0x77c4('0xb9')]=juice(_0x58fb17[_0xdf6c58][_0x77c4('0xb9')]);}}_0x164376[_0x77c4('0xb3')]=_0x58fb17;return _0x164376;});}})[_0x77c4('0x1c')](respondWithFilteredResult(_0x217a3,_0x35f746))[_0x77c4('0x2b')](handleError(_0x217a3,null));};exports[_0x77c4('0xc4')]=function(_0x18e2e7,_0x4805e2){return db[_0x77c4('0x2e')][_0x77c4('0x58')]({'where':{'id':_0x18e2e7[_0x77c4('0xb5')]['id']}})[_0x77c4('0x1c')](handleEntityNotFound(_0x4805e2,null))[_0x77c4('0x1c')](function(_0x5de599){if(_0x5de599){return _0x5de599[_0x77c4('0xc5')](_0x18e2e7[_0x77c4('0xb9')]['ids'],_[_0x77c4('0xbd')](_0x18e2e7[_0x77c4('0xb9')],[_0x77c4('0xbc'),'id'])||{})[_0x77c4('0xc6')](function(){return db['Tag']['findAll']({'attributes':['id',_0x77c4('0x1f'),_0x77c4('0x3e')],'where':{'id':_0x18e2e7['body'][_0x77c4('0xbc')]}});})[_0x77c4('0x1c')](function(_0x106a56){socket['emit'](_0x77c4('0xc7'),{'id':Number(_0x18e2e7[_0x77c4('0xb5')]['id']),'tags':_0x106a56||[]});return{'id':Number(_0x18e2e7['params']['id']),'tags':_0x106a56||[]};});}})['then'](respondWithResult(_0x4805e2,null))[_0x77c4('0x2b')](handleError(_0x4805e2,null));};exports[_0x77c4('0xc8')]=function(_0x266baa,_0x8c28da){return db['MailInteraction'][_0x77c4('0x58')]({'where':{'id':_0x266baa[_0x77c4('0xb5')]['id']}})['then'](handleEntityNotFound(_0x8c28da,null))['then'](function(_0x47ef79){if(_0x47ef79){return _0x47ef79['removeTags'](_0x266baa[_0x77c4('0x34')][_0x77c4('0xbc')]);}})[_0x77c4('0x1c')](respondWithStatusCode(_0x8c28da,null))[_0x77c4('0x2b')](handleError(_0x8c28da,null));};exports[_0x77c4('0xc9')]=function(_0x173b7e,_0x3683b9){var _0x43bd4f=moment()[_0x77c4('0xca')]()[_0x77c4('0x8c')]();var _0x3e1e01=path[_0x77c4('0xcb')](config[_0x77c4('0xcc')],'server','files','tmp');var _0x5d5a34=path['join'](config[_0x77c4('0xcc')],_0x77c4('0xcd'),_0x77c4('0xce'),'attachments');var _0x121771=path[_0x77c4('0xcb')](_0x3e1e01,_0x43bd4f);var _0x31267a=util[_0x77c4('0xc0')](_0x77c4('0xcf'),_0x173b7e[_0x77c4('0xb5')]['id'],_0x43bd4f);var _0x1509ec=path['join'](_0x3e1e01,_0x31267a);var _0x12b61b=[];if(_0x173b7e[_0x77c4('0x34')][_0x77c4('0xd0')]){_0x12b61b[_0x77c4('0x25')]({'model':db[_0x77c4('0xd1')],'as':_0x77c4('0xd2'),'raw':!![]});}var _0x17034b=[{'model':db[_0x77c4('0x26')],'as':_0x77c4('0xd3'),'attributes':['id','body',_0x77c4('0x3f'),'to','cc',_0x77c4('0xd4'),_0x77c4('0xd5'),_0x77c4('0x6c')],'where':{'secret':![]},'order':qs[_0x77c4('0x3a')]('id'),'include':_0x12b61b}];return db[_0x77c4('0x2e')][_0x77c4('0x58')]({'where':{'id':_0x173b7e[_0x77c4('0xb5')]['id']},'include':_0x17034b})[_0x77c4('0x1c')](handleEntityNotFound(_0x3683b9,null))['then'](function(_0x1f315f){if(_0x1f315f&&_0x1f315f[_0x77c4('0xd3')]){var _0x44f91a=_0x1f315f[_0x77c4('0xd6')]({'plain':!![]});fs[_0x77c4('0xd7')](_0x121771);return BPromise[_0x77c4('0xd8')](_0x44f91a[_0x77c4('0xd3')],function(_0x40b38d,_0xd2a20e){var _0x255eea={'from':_0x40b38d[_0x77c4('0x3f')],'to':_0x40b38d['to'],'subject':_0x40b38d[_0x77c4('0xd5')],'html':htmlEntities['decode'](_0x40b38d[_0x77c4('0xb9')]),'headers':{'Date':moment(_0x40b38d[_0x77c4('0x6c')])['format'](_0x77c4('0xd9'))},'attachments':[]};if(_0x40b38d['cc']){_0x255eea['headers']['Cc']=_0x40b38d['cc'];}if(_0x40b38d[_0x77c4('0xd4')]){_0x255eea[_0x77c4('0xda')][_0x77c4('0xdb')]=_0x40b38d[_0x77c4('0xd4')];}return new BPromise(function(_0x564344,_0x154072){if(_0x40b38d[_0x77c4('0xd2')]){for(var _0x335600=0x0;_0x335600<_0x40b38d[_0x77c4('0xd2')][_0x77c4('0x57')];_0x335600++){var _0x3bcbfd=_0x40b38d[_0x77c4('0xd2')][_0x335600];var _0x76e008=path[_0x77c4('0xcb')](_0x5d5a34,_0x3bcbfd[_0x77c4('0xdc')]);if(fs[_0x77c4('0xdd')](_0x76e008)){_0x255eea[_0x77c4('0xd0')]['push']({'name':_0x3bcbfd[_0x77c4('0x1f')],'contentType':_0x3bcbfd[_0x77c4('0x31')],'data':fs[_0x77c4('0xde')](_0x76e008)});}}}emlformat[_0x77c4('0xdf')](_0x255eea,function(_0x323583,_0x5ab00a){if(_0x323583)return _0x154072(_0x323583);fs[_0x77c4('0xe0')](path[_0x77c4('0xcb')](_0x121771,util[_0x77c4('0xc0')]('message%d.eml',_0xd2a20e)),_0x5ab00a);return _0x564344(_0x5ab00a);});});})['then'](function(){return new BPromise(function(_0x1af3d8,_0x12dda7){zipdir(_0x121771,{'saveTo':_0x1509ec},function(_0x2951e5,_0x3df618){if(_0x2951e5)return _0x12dda7(_0x2951e5);return _0x1af3d8(_0x3df618);});})['then'](function(){return new BPromise(function(_0x66c31b,_0x1b83f7){rimraf(_0x121771,function(_0x16af84){if(_0x16af84)_0x1b83f7(_0x16af84);return _0x66c31b();});});})['then'](function(){return _0x3683b9[_0x77c4('0xc9')](_0x1509ec,_0x31267a,function(_0x522515){if(!_0x522515)fs[_0x77c4('0xe1')](_0x1509ec);});});});}else{return _0x3683b9[_0x77c4('0x11')](0xc8);}})[_0x77c4('0x2b')](handleError(_0x3683b9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4409c3a..a0df50a 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 _0xea99=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','events'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0xea99,0x87));var _0x9ea9=function(_0x31db69,_0xe8384c){_0x31db69=_0x31db69-0x0;var _0x27c34b=_0xea99[_0x31db69];return _0x27c34b;};'use strict';var EventEmitter=require(_0x9ea9('0x0'));var MailInteraction=require(_0x9ea9('0x1'))['db'][_0x9ea9('0x2')];var MailMessage=require(_0x9ea9('0x1'))['db'][_0x9ea9('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9ea9('0x4')](0x0);var events={'afterCreate':_0x9ea9('0x5'),'afterUpdate':'update','afterDestroy':_0x9ea9('0x6')};function emitEvent(_0x2ed4f5){return function(_0x48c88e,_0x5f396e,_0x38e67f){_0x48c88e['getUsers']({'attributes':['id'],'raw':!![]})[_0x9ea9('0x7')](function(_0x59e4f8){_0x48c88e[_0x9ea9('0x8')](_0x9ea9('0x9'),_0x59e4f8[_0x9ea9('0xa')](function(_0x400741){return{'id':_0x400741['id']};}));return MailMessage[_0x9ea9('0xb')]({'where':{'MailInteractionId':_0x48c88e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x157f7c){_0x48c88e[_0x9ea9('0x8')](_0x9ea9('0xc'),_0x157f7c[_0x9ea9('0xd')]);MailInteractionEvents[_0x9ea9('0xe')](_0x2ed4f5+':'+_0x48c88e['id'],_0x48c88e);MailInteractionEvents[_0x9ea9('0xe')](_0x2ed4f5,_0x48c88e);_0x38e67f(null);})[_0x9ea9('0xf')](_0x38e67f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9ea9('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x7368=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers'];(function(_0x1bec23,_0x3d2287){var _0x318995=function(_0xbfdd83){while(--_0xbfdd83){_0x1bec23['push'](_0x1bec23['shift']());}};_0x318995(++_0x3d2287);}(_0x7368,0x174));var _0x8736=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7368[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x8736('0x0'));var MailInteraction=require(_0x8736('0x1'))['db'][_0x8736('0x2')];var MailMessage=require(_0x8736('0x1'))['db'][_0x8736('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8736('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8736('0x5'),'afterDestroy':_0x8736('0x6')};function emitEvent(_0x170c7a){return function(_0x5e8d78,_0x2187b3,_0x5b78d8){_0x5e8d78[_0x8736('0x7')]({'attributes':['id'],'raw':!![]})[_0x8736('0x8')](function(_0xf3daeb){_0x5e8d78['setDataValue'](_0x8736('0x9'),_0xf3daeb[_0x8736('0xa')](function(_0x42904d){return{'id':_0x42904d['id']};}));return MailMessage[_0x8736('0xb')]({'where':{'MailInteractionId':_0x5e8d78['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8736('0x8')](function(_0x28d871){_0x5e8d78[_0x8736('0xc')](_0x8736('0xd'),_0x28d871[_0x8736('0xe')]);MailInteractionEvents['emit'](_0x170c7a+':'+_0x5e8d78['id'],_0x5e8d78);MailInteractionEvents[_0x8736('0xf')](_0x170c7a,_0x5e8d78);_0x5b78d8(null);})['catch'](_0x5b78d8(null));};}for(var e in events){if(events[_0x8736('0x10')](e)){var event=events[e];MailInteraction[_0x8736('0x11')](e,emitEvent(event));}}module[_0x8736('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index da6f3f3..d8991b4 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 _0x9c21=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x9c21,0x136));var _0x19c2=function(_0x4fd64a,_0x5c7705){_0x4fd64a=_0x4fd64a-0x0;var _0x350d9b=_0x9c21[_0x4fd64a];return _0x350d9b;};'use strict';var _=require('lodash');var util=require(_0x19c2('0x0'));var logger=require(_0x19c2('0x1'))(_0x19c2('0x2'));var moment=require(_0x19c2('0x3'));var BPromise=require(_0x19c2('0x4'));var rp=require(_0x19c2('0x5'));var fs=require('fs');var path=require(_0x19c2('0x6'));var rimraf=require(_0x19c2('0x7'));var config=require(_0x19c2('0x8'));var attributes=require(_0x19c2('0x9'));module[_0x19c2('0xa')]=function(_0x306922,_0x4e9ee9){return _0x306922[_0x19c2('0xb')](_0x19c2('0xc'),attributes,{'tableName':_0x19c2('0xd'),'paranoid':![],'indexes':[{'name':_0x19c2('0xe'),'fields':[_0x19c2('0xf'),'to'],'type':_0x19c2('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ad3ea,_0x58b8c8,_0x1b3491){if(_0x4ad3ea['substatus']){_0x4ad3ea[_0x19c2('0x11')]=moment()[_0x19c2('0x12')](_0x19c2('0x13'));}if(_0x4ad3ea['closed']){_0x4ad3ea[_0x19c2('0x14')]=moment()[_0x19c2('0x12')](_0x19c2('0x13'));}_0x1b3491(null,_0x58b8c8);},'beforeUpdate':function(_0x16ca07,_0x165315,_0x380850){if(_0x16ca07[_0x19c2('0x15')]('substatus')){_0x16ca07[_0x19c2('0x11')]=_0x16ca07[_0x19c2('0x16')]?moment()['format'](_0x19c2('0x13')):null;}if(_0x16ca07[_0x19c2('0x15')](_0x19c2('0x17'))){_0x16ca07['closedAt']=moment()['format'](_0x19c2('0x13'));_0x16ca07[_0x19c2('0x16')]=null;_0x16ca07['substatusAt']=null;}_0x380850(null,_0x16ca07);},'afterUpdate':function(_0x3e5399,_0x4436cc,_0x1d9df7){var _0x1bc5a8=_0x306922[_0x19c2('0x18')];var _0x4520ea=_0x3e5399['get']({'plain':!![]});if(_0x4520ea[_0x19c2('0x17')]){return _0x1bc5a8[_0x19c2('0x19')][_0x19c2('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x4520ea['id']}})[_0x19c2('0x1b')](function(){_0x1d9df7();})[_0x19c2('0x1c')](function(_0x3456cd){_0x1d9df7(_0x3456cd);});}else{_0x1d9df7();}}},'charset':_0x19c2('0x1d'),'collate':_0x19c2('0x1e')});}; \ No newline at end of file +var _0xac18=['YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatusAt','closedAt','models','get','MailMessage','then','catch','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format'];(function(_0x43368a,_0x2a3caa){var _0x215a18=function(_0x2522a9){while(--_0x2522a9){_0x43368a['push'](_0x43368a['shift']());}};_0x215a18(++_0x2a3caa);}(_0xac18,0x76));var _0x8ac1=function(_0x5c641f,_0x5b847f){_0x5c641f=_0x5c641f-0x0;var _0x32f907=_0xac18[_0x5c641f];return _0x32f907;};'use strict';var _=require('lodash');var util=require(_0x8ac1('0x0'));var logger=require(_0x8ac1('0x1'))(_0x8ac1('0x2'));var moment=require(_0x8ac1('0x3'));var BPromise=require(_0x8ac1('0x4'));var rp=require(_0x8ac1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ac1('0x6'));var config=require(_0x8ac1('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x8ac1('0x8')]=function(_0x81bc11,_0x2a4a81){return _0x81bc11[_0x8ac1('0x9')](_0x8ac1('0xa'),attributes,{'tableName':_0x8ac1('0xb'),'paranoid':![],'indexes':[{'name':_0x8ac1('0xc'),'fields':[_0x8ac1('0xd'),'to'],'type':_0x8ac1('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41e287,_0x34cb11,_0x31a043){if(_0x41e287[_0x8ac1('0xf')]){_0x41e287['substatusAt']=moment()[_0x8ac1('0x10')](_0x8ac1('0x11'));}if(_0x41e287[_0x8ac1('0x12')]){_0x41e287['closedAt']=moment()[_0x8ac1('0x10')](_0x8ac1('0x11'));}_0x31a043(null,_0x34cb11);},'beforeUpdate':function(_0x20ef56,_0x2a8572,_0x5a834d){if(_0x20ef56[_0x8ac1('0x13')](_0x8ac1('0xf'))){_0x20ef56[_0x8ac1('0x14')]=_0x20ef56[_0x8ac1('0xf')]?moment()[_0x8ac1('0x10')](_0x8ac1('0x11')):null;}if(_0x20ef56[_0x8ac1('0x13')](_0x8ac1('0x12'))){_0x20ef56[_0x8ac1('0x15')]=moment()[_0x8ac1('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x20ef56['substatus']=null;_0x20ef56[_0x8ac1('0x14')]=null;}_0x5a834d(null,_0x20ef56);},'afterUpdate':function(_0x3e47ba,_0x26cda8,_0x458226){var _0x3a9710=_0x81bc11[_0x8ac1('0x16')];var _0x34fb5d=_0x3e47ba[_0x8ac1('0x17')]({'plain':!![]});if(_0x34fb5d[_0x8ac1('0x12')]){return _0x3a9710[_0x8ac1('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x34fb5d['id']}})[_0x8ac1('0x19')](function(){_0x458226();})[_0x8ac1('0x1a')](function(_0x57b485){_0x458226(_0x57b485);});}else{_0x458226();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b678554..f08d387 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 _0x3dd7=['client','redis','localhost','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x3dd7,0x1f2));var _0x73dd=function(_0x2bd3a5,_0x458543){_0x2bd3a5=_0x2bd3a5-0x0;var _0x3573c0=_0x3dd7[_0x2bd3a5];return _0x3573c0;};'use strict';var _=require('lodash');var util=require(_0x73dd('0x0'));var moment=require(_0x73dd('0x1'));var BPromise=require(_0x73dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73dd('0x3'))['db'];var utils=require(_0x73dd('0x4'));var logger=require(_0x73dd('0x5'))(_0x73dd('0x6'));var config=require(_0x73dd('0x7'));var jayson=require(_0x73dd('0x8'));var client=jayson[_0x73dd('0x9')]['http']({'port':0x232a});config[_0x73dd('0xa')]=_['defaults'](config[_0x73dd('0xa')],{'host':_0x73dd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73dd('0xa')]));require(_0x73dd('0xc'))['register'](socket);function respondWithRpcPromise(_0x10a0a9,_0x288fe3,_0x57edaa){return new BPromise(function(_0x116063,_0x42bfec){return client['request'](_0x10a0a9,_0x57edaa)[_0x73dd('0xd')](function(_0x5db71c){logger[_0x73dd('0xe')](_0x73dd('0xf'),_0x288fe3,_0x73dd('0x10'));logger[_0x73dd('0x11')](_0x73dd('0x12'),_0x288fe3,_0x73dd('0x10'),JSON[_0x73dd('0x13')](_0x5db71c));if(_0x5db71c[_0x73dd('0x14')]){if(_0x5db71c['error'][_0x73dd('0x15')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x288fe3,_0x5db71c['error'][_0x73dd('0x16')]);return _0x42bfec(_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);}logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);return _0x116063(_0x5db71c['error'][_0x73dd('0x16')]);}else{logger['info'](_0x73dd('0xf'),_0x288fe3,'request\x20sent');_0x116063(_0x5db71c[_0x73dd('0x17')][_0x73dd('0x16')]);}})[_0x73dd('0x18')](function(_0x3137bd){logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x3137bd);_0x42bfec(_0x3137bd);});});}exports[_0x73dd('0x19')]=function(_0x4b07b7){var _0x65eb=this;return new Promise(function(_0x5f491f,_0x103c7c){return db[_0x73dd('0x1a')]['update'](_0x4b07b7[_0x73dd('0x1b')],{'raw':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7['options'][_0x73dd('0x1e')]||null:null,'attributes':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1f')]||null:null,'limit':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x20')]||null:null})[_0x73dd('0xd')](function(_0x21e8a6){logger[_0x73dd('0xe')](_0x73dd('0x19'),_0x4b07b7);logger[_0x73dd('0x11')](_0x73dd('0x19'),_0x4b07b7,JSON[_0x73dd('0x13')](_0x21e8a6));_0x5f491f(_0x21e8a6);})[_0x73dd('0x18')](function(_0x1b3886){logger['error'](_0x73dd('0x19'),_0x1b3886[_0x73dd('0x16')],_0x4b07b7);_0x103c7c(_0x65eb[_0x73dd('0x14')](0x1f4,_0x1b3886['message']));});});};exports[_0x73dd('0x21')]=function(_0x8d669b){return new Promise(function(_0x450548,_0x26dabe){return db[_0x73dd('0x1a')]['find']({'where':_0x8d669b[_0x73dd('0x1c')]?_0x8d669b[_0x73dd('0x1c')][_0x73dd('0x1e')]||null:null})['then'](function(_0x49acb1){if(_0x49acb1){return _0x49acb1[_0x73dd('0x22')](_0x8d669b[_0x73dd('0x1b')][_0x73dd('0x23')],_[_0x73dd('0x24')](_0x8d669b[_0x73dd('0x1b')],['ids','id'])||{});}})[_0x73dd('0x25')](function(_0x153ed9){logger[_0x73dd('0xe')](_0x73dd('0x26'),_0x8d669b);logger['debug'](_0x73dd('0x26'),_0x8d669b,JSON[_0x73dd('0x13')](_0x153ed9));_0x450548(_0x153ed9);})['catch'](function(_0x5b2741){logger['error'](_0x73dd('0x26'),_0x5b2741[_0x73dd('0x16')],_0x8d669b);_0x26dabe(_this[_0x73dd('0x14')](0x1f4,_0x5b2741[_0x73dd('0x16')]));});});}; \ No newline at end of file +var _0x534b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','result','message','MailInteraction','update','options','raw','where','limit','UpdateMailInteraction','stringify','catch','AddTagsToMailInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x50ad77,_0x25023f){var _0x3d6b75=function(_0x1e73a1){while(--_0x1e73a1){_0x50ad77['push'](_0x50ad77['shift']());}};_0x3d6b75(++_0x25023f);}(_0x534b,0x19a));var _0xb534=function(_0x26b069,_0x506500){_0x26b069=_0x26b069-0x0;var _0x4db25f=_0x534b[_0x26b069];return _0x4db25f;};'use strict';var _=require(_0xb534('0x0'));var util=require(_0xb534('0x1'));var moment=require(_0xb534('0x2'));var BPromise=require(_0xb534('0x3'));var rs=require(_0xb534('0x4'));var fs=require('fs');var Redis=require(_0xb534('0x5'));var db=require(_0xb534('0x6'))['db'];var utils=require(_0xb534('0x7'));var logger=require(_0xb534('0x8'))(_0xb534('0x9'));var config=require('../../config/environment');var jayson=require(_0xb534('0xa'));var client=jayson[_0xb534('0xb')][_0xb534('0xc')]({'port':0x232a});config['redis']=_[_0xb534('0xd')](config['redis'],{'host':_0xb534('0xe'),'port':0x18eb});var socket=require(_0xb534('0xf'))(new Redis(config[_0xb534('0x10')]));require(_0xb534('0x11'))[_0xb534('0x12')](socket);function respondWithRpcPromise(_0x9682f1,_0x415eac,_0xe3c125){return new BPromise(function(_0x127d1e,_0x7f9412){return client[_0xb534('0x13')](_0x9682f1,_0xe3c125)[_0xb534('0x14')](function(_0x5714bd){logger[_0xb534('0x15')](_0xb534('0x16'),_0x415eac,_0xb534('0x17'));logger[_0xb534('0x18')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x415eac,_0xb534('0x17'),JSON['stringify'](_0x5714bd));if(_0x5714bd[_0xb534('0x19')]){if(_0x5714bd[_0xb534('0x19')][_0xb534('0x1a')]===0x1f4){logger['error'](_0xb534('0x16'),_0x415eac,_0x5714bd[_0xb534('0x19')]['message']);return _0x7f9412(_0x5714bd['error']['message']);}logger[_0xb534('0x19')]('MailInteraction,\x20%s,\x20%s',_0x415eac,_0x5714bd[_0xb534('0x19')]['message']);return _0x127d1e(_0x5714bd[_0xb534('0x19')]['message']);}else{logger[_0xb534('0x15')](_0xb534('0x16'),_0x415eac,_0xb534('0x17'));_0x127d1e(_0x5714bd[_0xb534('0x1b')][_0xb534('0x1c')]);}})['catch'](function(_0x4affa2){logger[_0xb534('0x19')](_0xb534('0x16'),_0x415eac,_0x4affa2);_0x7f9412(_0x4affa2);});});}exports['UpdateMailInteraction']=function(_0x13be36){var _0x4c1f92=this;return new Promise(function(_0x55b1b1,_0x39c5af){return db[_0xb534('0x1d')][_0xb534('0x1e')](_0x13be36['body'],{'raw':_0x13be36[_0xb534('0x1f')]?_0x13be36['options'][_0xb534('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13be36[_0xb534('0x1f')]?_0x13be36[_0xb534('0x1f')][_0xb534('0x21')]||null:null,'attributes':_0x13be36[_0xb534('0x1f')]?_0x13be36[_0xb534('0x1f')]['attributes']||null:null,'limit':_0x13be36[_0xb534('0x1f')]?_0x13be36[_0xb534('0x1f')][_0xb534('0x22')]||null:null})[_0xb534('0x14')](function(_0x3400ac){logger[_0xb534('0x15')](_0xb534('0x23'),_0x13be36);logger[_0xb534('0x18')](_0xb534('0x23'),_0x13be36,JSON[_0xb534('0x24')](_0x3400ac));_0x55b1b1(_0x3400ac);})[_0xb534('0x25')](function(_0x42ba19){logger[_0xb534('0x19')]('UpdateMailInteraction',_0x42ba19[_0xb534('0x1c')],_0x13be36);_0x39c5af(_0x4c1f92['error'](0x1f4,_0x42ba19['message']));});});};exports[_0xb534('0x26')]=function(_0x36546a){return new Promise(function(_0x234ae2,_0x6b1fe7){return db['MailInteraction'][_0xb534('0x27')]({'where':_0x36546a[_0xb534('0x1f')]?_0x36546a[_0xb534('0x1f')][_0xb534('0x21')]||null:null})['then'](function(_0xb011a7){if(_0xb011a7){return _0xb011a7[_0xb534('0x28')](_0x36546a['body'][_0xb534('0x29')],_[_0xb534('0x2a')](_0x36546a[_0xb534('0x2b')],['ids','id'])||{});}})[_0xb534('0x2c')](function(_0xec61f5){logger[_0xb534('0x15')](_0xb534('0x2d'),_0x36546a);logger[_0xb534('0x18')]('AddTags',_0x36546a,JSON[_0xb534('0x24')](_0xec61f5));_0x234ae2(_0xec61f5);})[_0xb534('0x25')](function(_0x225daf){logger[_0xb534('0x19')]('AddTags',_0x225daf[_0xb534('0x1c')],_0x36546a);_0x6b1fe7(_this['error'](0x1f4,_0x225daf['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9121c4f..f5fcc02 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 _0xfd9f=['register','length','mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener'];(function(_0x188e1a,_0x481d14){var _0x44b3c8=function(_0x8afb4){while(--_0x8afb4){_0x188e1a['push'](_0x188e1a['shift']());}};_0x44b3c8(++_0x481d14);}(_0xfd9f,0x1bb));var _0xffd9=function(_0x124049,_0xb888a8){_0x124049=_0x124049-0x0;var _0x464b44=_0xfd9f[_0x124049];return _0x464b44;};'use strict';var MailInteractionEvents=require(_0xffd9('0x0'));var events=[_0xffd9('0x1'),_0xffd9('0x2'),'update'];function createListener(_0xd80563,_0x185513){return function(_0x258a0c){_0x185513[_0xffd9('0x3')](_0xd80563,_0x258a0c);};}function removeListener(_0x1e40a7,_0x589835){return function(){MailInteractionEvents[_0xffd9('0x4')](_0x1e40a7,_0x589835);};}exports[_0xffd9('0x5')]=function(_0x1a9509){for(var _0x101c65=0x0,_0x3e2e44=events[_0xffd9('0x6')];_0x101c65<_0x3e2e44;_0x101c65++){var _0x5081a4=events[_0x101c65];var _0x55e03f=createListener(_0xffd9('0x7')+_0x5081a4,_0x1a9509);MailInteractionEvents['on'](_0x5081a4,_0x55e03f);}}; \ No newline at end of file +var _0x8839=['mailInteraction:','./mailInteraction.events','remove','update','removeListener','register','length'];(function(_0x1a8770,_0x344224){var _0x1528ef=function(_0x397a8d){while(--_0x397a8d){_0x1a8770['push'](_0x1a8770['shift']());}};_0x1528ef(++_0x344224);}(_0x8839,0x120));var _0x9883=function(_0x269bb7,_0x2b3a02){_0x269bb7=_0x269bb7-0x0;var _0x19b088=_0x8839[_0x269bb7];return _0x19b088;};'use strict';var MailInteractionEvents=require(_0x9883('0x0'));var events=['save',_0x9883('0x1'),_0x9883('0x2')];function createListener(_0x23edfb,_0x4c1d95){return function(_0x1e0d0f){_0x4c1d95['emit'](_0x23edfb,_0x1e0d0f);};}function removeListener(_0x560754,_0x404453){return function(){MailInteractionEvents[_0x9883('0x3')](_0x560754,_0x404453);};}exports[_0x9883('0x4')]=function(_0x15f260){for(var _0x3c896d=0x0,_0x2e2c30=events[_0x9883('0x5')];_0x3c896d<_0x2e2c30;_0x3c896d++){var _0x2cb7af=events[_0x3c896d];var _0x3a463f=createListener(_0x9883('0x6')+_0x2cb7af,_0x15f260);MailInteractionEvents['on'](_0x2cb7af,_0x3a463f);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6bc6565..195b9da 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 _0x9d26=['isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailMessage.controller','get'];(function(_0x415f26,_0x5e4271){var _0x3fa734=function(_0x3b923a){while(--_0x3b923a){_0x415f26['push'](_0x415f26['shift']());}};_0x3fa734(++_0x5e4271);}(_0x9d26,0x17d));var _0x69d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d26[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x69d2('0x0'));var util=require('util');var path=require(_0x69d2('0x1'));var timeout=require(_0x69d2('0x2'));var express=require(_0x69d2('0x3'));var router=express[_0x69d2('0x4')]();var fs_extra=require(_0x69d2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x69d2('0x6'));var config=require('../../config/environment');var controller=require(_0x69d2('0x7'));router[_0x69d2('0x8')]('/',auth[_0x69d2('0x9')](),controller['index']);router[_0x69d2('0x8')](_0x69d2('0xa'),auth[_0x69d2('0x9')](),controller[_0x69d2('0xb')]);router[_0x69d2('0x8')](_0x69d2('0xc'),auth[_0x69d2('0x9')](),controller[_0x69d2('0xd')]);router[_0x69d2('0x8')](_0x69d2('0xe'),auth['isAuthenticated'](),controller[_0x69d2('0xf')]);router[_0x69d2('0x10')]('/',auth[_0x69d2('0x9')](),interaction[_0x69d2('0x11')](_0x69d2('0x12'),_0x69d2('0x13')),controller['create']);router[_0x69d2('0x14')](_0x69d2('0xc'),auth[_0x69d2('0x9')](),controller[_0x69d2('0x15')]);router[_0x69d2('0x14')](_0x69d2('0x16'),auth[_0x69d2('0x9')](),controller[_0x69d2('0x17')]);router['put'](_0x69d2('0x18'),auth[_0x69d2('0x9')](),controller['reject']);router[_0x69d2('0x19')](_0x69d2('0xc'),auth[_0x69d2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b88=['index','/describe','/:id','/:id/download','post','tracked','create','put','/:id/accept','accept','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8b88,0x14f));var _0x88b8=function(_0x389201,_0x24c305){_0x389201=_0x389201-0x0;var _0x59f721=_0x8b88[_0x389201];return _0x59f721;};'use strict';var multer=require('multer');var util=require(_0x88b8('0x0'));var path=require('path');var timeout=require(_0x88b8('0x1'));var express=require('express');var router=express[_0x88b8('0x2')]();var fs_extra=require(_0x88b8('0x3'));var auth=require(_0x88b8('0x4'));var interaction=require(_0x88b8('0x5'));var config=require(_0x88b8('0x6'));var controller=require(_0x88b8('0x7'));router[_0x88b8('0x8')]('/',auth[_0x88b8('0x9')](),controller[_0x88b8('0xa')]);router[_0x88b8('0x8')](_0x88b8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x88b8('0x8')](_0x88b8('0xc'),auth[_0x88b8('0x9')](),controller['show']);router[_0x88b8('0x8')](_0x88b8('0xd'),auth[_0x88b8('0x9')](),controller['download']);router[_0x88b8('0xe')]('/',auth[_0x88b8('0x9')](),interaction[_0x88b8('0xf')]('mail','mailmessage:create'),controller[_0x88b8('0x10')]);router[_0x88b8('0x11')](_0x88b8('0xc'),auth[_0x88b8('0x9')](),controller['update']);router['put'](_0x88b8('0x12'),auth['isAuthenticated'](),controller[_0x88b8('0x13')]);router[_0x88b8('0x11')]('/:id/reject',auth[_0x88b8('0x9')](),controller[_0x88b8('0x14')]);router[_0x88b8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x88b8('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 80df767..dfd1acf 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 _0x6a84=['Email','Chat','lodash','exports','TEXT','BOOLEAN','out','STRING','long','INTEGER','DATE','ENUM'];(function(_0x5158d3,_0x40d802){var _0x51756a=function(_0xd4452a){while(--_0xd4452a){_0x5158d3['push'](_0x5158d3['shift']());}};_0x51756a(++_0x40d802);}(_0x6a84,0x1d6));var _0x46a8=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6a84[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require('sequelize');var _=require(_0x46a8('0x0'));module[_0x46a8('0x1')]={'body':{'type':Sequelize[_0x46a8('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x46a8('0x2')]('medium')},'read':{'type':Sequelize[_0x46a8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x46a8('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x46a8('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x46a8('0x2')](_0x46a8('0x6'))},'cc':{'type':Sequelize[_0x46a8('0x2')](_0x46a8('0x6'))},'bcc':{'type':Sequelize['TEXT'](_0x46a8('0x6'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x46a8('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x46a8('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x46a8('0x6'))},'originCc':{'type':Sequelize[_0x46a8('0x2')](_0x46a8('0x6'))},'originChannel':{'type':Sequelize[_0x46a8('0x9')](_0x46a8('0xa'),_0x46a8('0xb')),'defaultValue':_0x46a8('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xc106=['DATE','Email','Chat','sequelize','lodash','exports','long','TEXT','medium','ENUM','out','STRING','INTEGER','BOOLEAN'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xc106,0x17d));var _0x6c10=function(_0x391dfe,_0x4f2d64){_0x391dfe=_0x391dfe-0x0;var _0x5d07d6=_0xc106[_0x391dfe];return _0x5d07d6;};'use strict';var Sequelize=require(_0x6c10('0x0'));var _=require(_0x6c10('0x1'));module[_0x6c10('0x2')]={'body':{'type':Sequelize['TEXT'](_0x6c10('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6c10('0x4')](_0x6c10('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6c10('0x6')]('in',_0x6c10('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x6c10('0x8')](0x1fe)},'from':{'type':Sequelize[_0x6c10('0x8')]},'to':{'type':Sequelize[_0x6c10('0x4')](_0x6c10('0x3'))},'cc':{'type':Sequelize[_0x6c10('0x4')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x6c10('0x3'))},'subject':{'type':Sequelize[_0x6c10('0x4')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x6c10('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6c10('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6c10('0xb')]},'originTo':{'type':Sequelize['TEXT'](_0x6c10('0x3'))},'originCc':{'type':Sequelize[_0x6c10('0x4')](_0x6c10('0x3'))},'originChannel':{'type':Sequelize[_0x6c10('0x6')](_0x6c10('0xc'),_0x6c10('0xd')),'defaultValue':_0x6c10('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6397340..af9e756 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 _0x12aa=['readFileSync','build','writeFileSync','eml-format','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','index','MailMessage','rawAttributes','fieldName','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','then','includeAll','include','findAll','rows','params','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','MailServerOut','Smtp','isNil','service','port','secure','user','pass','auth','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','MailInteraction','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push'];(function(_0x5b7215,_0x49d515){var _0x272e19=function(_0x904499){while(--_0x904499){_0x5b7215['push'](_0x5b7215['shift']());}};_0x272e19(++_0x49d515);}(_0x12aa,0x1ec));var _0xa12a=function(_0x58c9be,_0x324b97){_0x58c9be=_0x58c9be-0x0;var _0x3d4700=_0x12aa[_0x58c9be];return _0x3d4700;};'use strict';var emlformat=require(_0xa12a('0x0'));var moment=require('moment');var BPromise=require(_0xa12a('0x1'));var util=require(_0xa12a('0x2'));var path=require(_0xa12a('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa12a('0x4'));var htmlToText=require('html-to-text');var qs=require(_0xa12a('0x5'));var logger=require(_0xa12a('0x6'))(_0xa12a('0x7'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0xa12a('0x8'))['db'];config[_0xa12a('0x9')]=_[_0xa12a('0xa')](config[_0xa12a('0x9')],{'host':_0xa12a('0xb'),'port':0x18eb});var socket=require(_0xa12a('0xc'))(new Redis(config[_0xa12a('0x9')]));var htmlEntities=require(_0xa12a('0xd'));require('./mailMessage.socket')[_0xa12a('0xe')](socket);var jayson=require(_0xa12a('0xf'));var client=jayson[_0xa12a('0x10')][_0xa12a('0x11')]({'port':0x232c});var client9003=jayson['client'][_0xa12a('0x11')]({'port':0x232b});var client9002=jayson[_0xa12a('0x10')][_0xa12a('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x199ed1,_0x324637,_0x36c26d,_0x582c09){return new BPromise(function(_0x1dfb27,_0x4376de){var _0xadf4be=_0x582c09||client;return _0xadf4be[_0xa12a('0x12')](_0x199ed1,_0x36c26d)['then'](function(_0x154a84){logger[_0xa12a('0x13')](_0xa12a('0x14'),_0x324637,_0xa12a('0x15'));logger[_0xa12a('0x16')](_0xa12a('0x17'),_0x324637,'request\x20sent',JSON[_0xa12a('0x18')](_0x154a84));if(_0x154a84['error']){if(_0x154a84[_0xa12a('0x19')]['code']===0x1f4){logger[_0xa12a('0x19')](_0xa12a('0x14'),_0x324637,_0x154a84[_0xa12a('0x19')][_0xa12a('0x1a')]);return _0x4376de(_0x154a84[_0xa12a('0x19')][_0xa12a('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x324637,_0x154a84[_0xa12a('0x19')][_0xa12a('0x1a')]);return _0x1dfb27(_0x154a84[_0xa12a('0x19')][_0xa12a('0x1a')]);}else{logger[_0xa12a('0x13')](_0xa12a('0x14'),_0x324637,'request\x20sent');_0x1dfb27(_0x154a84[_0xa12a('0x1b')][_0xa12a('0x1a')]);}})[_0xa12a('0x1c')](function(_0x1fb6fe){logger[_0xa12a('0x19')](_0xa12a('0x14'),_0x324637,_0x1fb6fe);_0x4376de(_0x1fb6fe);});});}function respondWithResult(_0x3ec966,_0x229216){_0x229216=_0x229216||0xc8;return function(_0x5bb5f2){if(_0x5bb5f2){return _0x3ec966[_0xa12a('0x1d')](_0x229216)[_0xa12a('0x1e')](_0x5bb5f2);}};}function respondWithFilteredResult(_0x3e11a4,_0x181f4d){return function(_0x30214f){if(_0x30214f){var _0x86ccb9=typeof _0x181f4d[_0xa12a('0x1f')]===_0xa12a('0x20')&&typeof _0x181f4d[_0xa12a('0x21')]==='undefined';var _0x4e17aa=_0x30214f[_0xa12a('0x22')];var _0x5dc6fd=_0x86ccb9?0x0:_0x181f4d[_0xa12a('0x1f')];var _0x25395d=_0x86ccb9?_0x30214f['count']:_0x181f4d[_0xa12a('0x1f')]+_0x181f4d[_0xa12a('0x21')];var _0x1993a7;if(_0x25395d>=_0x4e17aa){_0x25395d=_0x4e17aa;_0x1993a7=0xc8;}else{_0x1993a7=0xce;}_0x3e11a4[_0xa12a('0x1d')](_0x1993a7);return _0x3e11a4[_0xa12a('0x23')](_0xa12a('0x24'),_0x5dc6fd+'-'+_0x25395d+'/'+_0x4e17aa)[_0xa12a('0x1e')](_0x30214f);}return null;};}function saveUpdates(_0x4b1cad){return function(_0x2e8e0c){if(_0x2e8e0c){return _0x2e8e0c[_0xa12a('0x25')](_0x4b1cad)['then'](function(_0x3d6be1){return _0x3d6be1;});}return null;};}function removeEntity(_0x4be944){return function(_0x15cb12){if(_0x15cb12){return _0x15cb12[_0xa12a('0x26')]()['then'](function(){_0x4be944[_0xa12a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50afe8){return function(_0x534455){if(!_0x534455){_0x50afe8['sendStatus'](0x194);}return _0x534455;};}function handleError(_0x4106bb,_0x3a8dfe){_0x3a8dfe=_0x3a8dfe||0x1f4;return function(_0x550552){logger[_0xa12a('0x19')](_0x550552[_0xa12a('0x27')]);if(_0x550552[_0xa12a('0x28')]){delete _0x550552[_0xa12a('0x28')];}_0x4106bb[_0xa12a('0x1d')](_0x3a8dfe)[_0xa12a('0x29')](_0x550552);};}exports[_0xa12a('0x2a')]=function(_0x591756,_0x258dec){var _0x51722d={},_0x4b99ed={},_0x5669d4={'count':0x0,'rows':[]};var _0xf158f8=_['map'](db[_0xa12a('0x2b')][_0xa12a('0x2c')],function(_0x70c2a9){return{'name':_0x70c2a9[_0xa12a('0x2d')],'type':_0x70c2a9['type']['key']};});_0x4b99ed['model']=_[_0xa12a('0x2e')](_0xf158f8,_0xa12a('0x28'));_0x4b99ed[_0xa12a('0x2f')]=_[_0xa12a('0x30')](_0x591756[_0xa12a('0x2f')]);_0x4b99ed[_0xa12a('0x31')]=_[_0xa12a('0x32')](_0x4b99ed['model'],_0x4b99ed[_0xa12a('0x2f')]);_0x51722d[_0xa12a('0x33')]=_[_0xa12a('0x32')](_0x4b99ed[_0xa12a('0x34')],qs['fields'](_0x591756[_0xa12a('0x2f')][_0xa12a('0x35')]));_0x51722d[_0xa12a('0x33')]=_0x51722d[_0xa12a('0x33')][_0xa12a('0x36')]?_0x51722d[_0xa12a('0x33')]:_0x4b99ed[_0xa12a('0x34')];if(!_0x591756[_0xa12a('0x2f')][_0xa12a('0x37')]('nolimit')){_0x51722d[_0xa12a('0x21')]=qs['limit'](_0x591756['query'][_0xa12a('0x21')]);_0x51722d[_0xa12a('0x1f')]=qs[_0xa12a('0x1f')](_0x591756[_0xa12a('0x2f')][_0xa12a('0x1f')]);}_0x51722d[_0xa12a('0x38')]=qs[_0xa12a('0x39')](_0x591756[_0xa12a('0x2f')]['sort']);_0x51722d['where']=qs[_0xa12a('0x31')](_[_0xa12a('0x3a')](_0x591756[_0xa12a('0x2f')],_0x4b99ed[_0xa12a('0x31')]),_0xf158f8);if(_0x591756[_0xa12a('0x2f')][_0xa12a('0x3b')]){_0x51722d[_0xa12a('0x3c')]=_[_0xa12a('0x3d')](_0x51722d[_0xa12a('0x3c')],{'$or':_[_0xa12a('0x2e')](_0xf158f8,function(_0x7f0317){if(_0x7f0317[_0xa12a('0x3e')]!=='VIRTUAL'){var _0x11616e={};_0x11616e[_0x7f0317[_0xa12a('0x28')]]={'$like':'%'+_0x591756[_0xa12a('0x2f')][_0xa12a('0x3b')]+'%'};return _0x11616e;}})});}_0x51722d=_[_0xa12a('0x3d')]({},_0x51722d,_0x591756['options']);var _0x2b2789={'where':_0x51722d[_0xa12a('0x3c')]};return db['MailMessage'][_0xa12a('0x22')](_0x2b2789)[_0xa12a('0x3f')](function(_0xff592c){_0x5669d4[_0xa12a('0x22')]=_0xff592c;if(_0x591756[_0xa12a('0x2f')][_0xa12a('0x40')]){_0x51722d[_0xa12a('0x41')]=[{'all':!![]}];}return db[_0xa12a('0x2b')][_0xa12a('0x42')](_0x51722d);})['then'](function(_0x426b79){_0x5669d4[_0xa12a('0x43')]=_0x426b79;return _0x5669d4;})[_0xa12a('0x3f')](respondWithFilteredResult(_0x258dec,_0x51722d))[_0xa12a('0x1c')](handleError(_0x258dec,null));};exports['show']=function(_0x7f110b,_0x2be37a){var _0xf906={'raw':!![],'where':{'id':_0x7f110b[_0xa12a('0x44')]['id']}},_0x1e6ccd={};_0x1e6ccd[_0xa12a('0x34')]=_[_0xa12a('0x30')](db[_0xa12a('0x2b')][_0xa12a('0x2c')]);_0x1e6ccd[_0xa12a('0x2f')]=_[_0xa12a('0x30')](_0x7f110b[_0xa12a('0x2f')]);_0x1e6ccd[_0xa12a('0x31')]=_[_0xa12a('0x32')](_0x1e6ccd[_0xa12a('0x34')],_0x1e6ccd[_0xa12a('0x2f')]);_0xf906[_0xa12a('0x33')]=_[_0xa12a('0x32')](_0x1e6ccd[_0xa12a('0x34')],qs['fields'](_0x7f110b[_0xa12a('0x2f')][_0xa12a('0x35')]));_0xf906['attributes']=_0xf906['attributes']['length']?_0xf906[_0xa12a('0x33')]:_0x1e6ccd[_0xa12a('0x34')];if(_0x7f110b[_0xa12a('0x2f')]['includeAll']){_0xf906[_0xa12a('0x41')]=[{'all':!![]}];}_0xf906=_[_0xa12a('0x3d')]({},_0xf906,_0x7f110b[_0xa12a('0x45')]);return db['MailMessage'][_0xa12a('0x46')](_0xf906)['then'](handleEntityNotFound(_0x2be37a,null))['then'](respondWithResult(_0x2be37a,null))[_0xa12a('0x1c')](handleError(_0x2be37a,null));};exports['update']=function(_0x1b333c,_0x49f0ac){if(_0x1b333c[_0xa12a('0x47')]['id']){delete _0x1b333c[_0xa12a('0x47')]['id'];}return db[_0xa12a('0x2b')]['find']({'where':{'id':_0x1b333c['params']['id']}})[_0xa12a('0x3f')](handleEntityNotFound(_0x49f0ac,null))[_0xa12a('0x3f')](saveUpdates(_0x1b333c[_0xa12a('0x47')],null))[_0xa12a('0x3f')](respondWithResult(_0x49f0ac,null))['catch'](handleError(_0x49f0ac,null));};exports[_0xa12a('0x26')]=function(_0x4c29a7,_0x3ccb9c){return db[_0xa12a('0x2b')][_0xa12a('0x46')]({'where':{'id':_0x4c29a7[_0xa12a('0x44')]['id']}})[_0xa12a('0x3f')](handleEntityNotFound(_0x3ccb9c,null))[_0xa12a('0x3f')](removeEntity(_0x3ccb9c,null))[_0xa12a('0x1c')](handleError(_0x3ccb9c,null));};exports[_0xa12a('0x48')]=function(_0x4fb209,_0x21359c){return db[_0xa12a('0x2b')]['describe']()[_0xa12a('0x3f')](respondWithResult(_0x21359c,null))[_0xa12a('0x1c')](handleError(_0x21359c,null));};exports['create']=function(_0x128019,_0x5a02ef){return db[_0xa12a('0x2b')][_0xa12a('0x49')](_0x128019['body'])[_0xa12a('0x3f')](function(_0x511948){if(_0x511948){if(_0x511948[_0xa12a('0x4a')]===_0xa12a('0x4b')&&!_0x511948[_0xa12a('0x4c')]){var _0x462bee,_0x13b3b,_0x386ee8;if(_0x128019[_0xa12a('0x47')]['to']){_0x13b3b=_0x128019['body']['to'][_0xa12a('0x4d')](',')[0x0];}return db[_0xa12a('0x4e')][_0xa12a('0x4f')]({'where':{'id':_0x511948[_0xa12a('0x50')]},'include':[{'model':db[_0xa12a('0x51')],'as':_0xa12a('0x52'),'include':[{'model':db[_0xa12a('0x53')],'as':_0xa12a('0x54'),'where':{'email':_0x13b3b},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xa12a('0x55')],'as':'Smtp','raw':!![]}]})[_0xa12a('0x3f')](function(_0x4233e6){_0x462bee=_0x4233e6;if(_0x462bee&&_0x462bee[_0xa12a('0x56')]){var _0x40f1f1={'tls':{'rejectUnauthorized':![]}};if(_[_0xa12a('0x57')](_0x462bee['Smtp'][_0xa12a('0x58')])){_0x40f1f1['host']=_0x462bee['Smtp']['host'];_0x40f1f1['port']=_0x462bee[_0xa12a('0x56')][_0xa12a('0x59')];_0x40f1f1[_0xa12a('0x5a')]=_0x462bee[_0xa12a('0x56')]['secure'];if(_0x462bee[_0xa12a('0x56')]['authentication']){_0x40f1f1['auth']={'user':_0x462bee[_0xa12a('0x56')][_0xa12a('0x5b')],'pass':_0x462bee[_0xa12a('0x56')][_0xa12a('0x5c')]};}}else{_0x40f1f1[_0xa12a('0x58')]=_0x462bee[_0xa12a('0x56')][_0xa12a('0x58')];_0x40f1f1[_0xa12a('0x5d')]={'user':_0x462bee[_0xa12a('0x56')][_0xa12a('0x5b')],'pass':_0x462bee[_0xa12a('0x56')][_0xa12a('0x5c')]};_0x40f1f1[_0xa12a('0x5a')]=_0x462bee['Smtp'][_0xa12a('0x5a')];}if(_0x128019['body']['attachments']&&_0x128019[_0xa12a('0x47')][_0xa12a('0x5e')][_0xa12a('0x36')]){for(var _0x12a9a1=0x0;_0x12a9a1<_0x128019[_0xa12a('0x47')][_0xa12a('0x5e')]['length'];_0x12a9a1+=0x1){_0x128019[_0xa12a('0x47')][_0xa12a('0x5e')][_0x12a9a1]={'filename':_0x128019[_0xa12a('0x47')]['attachments'][_0x12a9a1]['name'],'path':path[_0xa12a('0x5f')](config[_0xa12a('0x60')],_0xa12a('0x61'),_0x128019[_0xa12a('0x47')]['attachments'][_0x12a9a1][_0xa12a('0x62')])};}}_0x386ee8={'account':_0x40f1f1,'message':_0x128019['body']};return;}})[_0xa12a('0x3f')](function(){if(_0x462bee[_0xa12a('0x52')]){if(_0x462bee[_0xa12a('0x52')]['Contacts'][_0xa12a('0x36')]){return _0x462bee[_0xa12a('0x52')][_0xa12a('0x54')][0x0];}else{return db[_0xa12a('0x53')]['create'](_['defaults'](_0x128019[_0xa12a('0x47')],{'firstName':_0x128019[_0xa12a('0x47')]['to'],'email':_0x128019['body']['to'],'phone':_0x128019[_0xa12a('0x47')]['to'],'ListId':_0x462bee[_0xa12a('0x63')]}));}}else{throw new Error(_0xa12a('0x64'));}})['then'](function(){if(_0x386ee8){return respondWithRpcPromise('SendMail',_0xa12a('0x65'),_0x386ee8,client9003)[_0xa12a('0x3f')](function(_0x572a44){return _0x511948[_0xa12a('0x25')]({'read':!![],'messageId':_0x572a44[_0xa12a('0x66')],'sentAt':moment()[_0xa12a('0x67')](_0xa12a('0x68'))});})[_0xa12a('0x1c')](function(_0x4e0d8b){logger[_0xa12a('0x19')]('%s',JSON[_0xa12a('0x18')](_0x4e0d8b));return _0x511948;});}return _0x511948;});}return _0x511948;}})[_0xa12a('0x3f')](respondWithResult(_0x5a02ef,0xc9))['catch'](handleError(_0x5a02ef,null));};exports[_0xa12a('0x69')]=function(_0x3c5402,_0x4355fc){var _0x54c2d1={'agent':{},'channel':_0xa12a('0x6a')};if(_0x3c5402[_0xa12a('0x47')]['id']){delete _0x3c5402[_0xa12a('0x47')]['id'];}_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6b')]=!![];_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6c')]=moment()[_0xa12a('0x67')](_0xa12a('0x68'));_0x3c5402['body']['UserId']=_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6d')]||_0x3c5402[_0xa12a('0x5b')]['id'];_0x54c2d1[_0xa12a('0x6e')]['id']=_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6d')];return db[_0xa12a('0x2b')][_0xa12a('0x46')]({'where':{'id':_0x3c5402[_0xa12a('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4355fc,null))['then'](saveUpdates(_0x3c5402[_0xa12a('0x47')],null))[_0xa12a('0x3f')](function(_0x110971){if(_0x110971){_0x54c2d1['message']=_0x110971['get']({'plain':!![]});return db[_0xa12a('0x6f')][_0xa12a('0x46')]({'where':{'id':_0x110971['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4355fc,null))[_0xa12a('0x3f')](function(_0x7f62fc){if(_0x7f62fc){return _0x7f62fc[_0xa12a('0x25')]({'UserId':_0x3c5402['body'][_0xa12a('0x6d')],'read1stAt':_[_0xa12a('0x57')](_0x7f62fc[_0xa12a('0x70')])?moment()['format'](_0xa12a('0x68')):undefined});}return null;})[_0xa12a('0x3f')](function(_0x5e4267){if(_0x5e4267){_0x54c2d1[_0xa12a('0x71')]=_0x5e4267[_0xa12a('0x72')]({'plain':!![]});interaction_log['info'](_0xa12a('0x73'),_0x3c5402[_0xa12a('0x5b')]['id'],_0x3c5402[_0xa12a('0x5b')]['name'],_0x3c5402[_0xa12a('0x5b')]['role'],_0x54c2d1['interaction']['id'],_0x3c5402[_0xa12a('0x47')]?JSON[_0xa12a('0x18')](_0x3c5402[_0xa12a('0x47')]):_0xa12a('0x74'));return respondWithRpcPromise(_0xa12a('0x75'),'acceptMessage',_0x54c2d1);}return null;})[_0xa12a('0x3f')](function(_0x59707b){var _0x54ae14=_0xa12a('0x76')+_0x59707b['message']['ContactId'];return db[_0xa12a('0x77')][_0xa12a('0x2f')](_0x54ae14,{'type':db['Sequelize']['QueryTypes'][_0xa12a('0x78')],'raw':!![]})[_0xa12a('0x3f')](function(_0xcb511f){return _0xcb511f;});})[_0xa12a('0x3f')](function(_0x4bb591){if(_0x4bb591){_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x79')]=_0x4bb591[0x0];if(!_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6d')])return;return db[_0xa12a('0x7a')][_0xa12a('0x46')]({'where':{'id':_0x3c5402[_0xa12a('0x47')][_0xa12a('0x6d')],'role':_0xa12a('0x6e')},'attributes':['id',_0xa12a('0x28'),_0xa12a('0x7b'),_0xa12a('0x7c'),_0xa12a('0x7d')],'raw':!![]});}return null;})[_0xa12a('0x3f')](function(_0x1bd859){if(!_0x1bd859)return null;_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x6e')]=_0x1bd859;return _0x54c2d1;})[_0xa12a('0x3f')](function(_0x10bffb){if(_0x10bffb){if(_0x3c5402['body'][_0xa12a('0x7e')]){_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x7f')]=util[_0xa12a('0x67')](_0xa12a('0x80'),_0x3c5402[_0xa12a('0x5b')]['name']);_0x54c2d1[_0xa12a('0x1a')]['channel']=_0x54c2d1[_0xa12a('0x81')];_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x82')]=_0x54c2d1['channel'];_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x83')]=_0xa12a('0x69');_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x47')]=htmlToText[_0xa12a('0x84')](_0x54c2d1[_0xa12a('0x1a')][_0xa12a('0x47')]);return respondWithRpcPromise(_0xa12a('0x85'),_0xa12a('0x85'),{'event':'acceptmessage','message':_0x54c2d1['message']},client9002)['then'](function(){return _0x54c2d1;});}return _0x54c2d1;}return null;})['then'](respondWithResult(_0x4355fc,null))[_0xa12a('0x1c')](handleError(_0x4355fc,null));};exports[_0xa12a('0x86')]=function(_0x55dd47,_0x26bb5b){var _0x2fef1e={'agent':{},'channel':_0xa12a('0x6a')};if(_0x55dd47[_0xa12a('0x47')]['id']){delete _0x55dd47[_0xa12a('0x47')]['id'];}_0x55dd47[_0xa12a('0x47')]['UserId']=_0x55dd47[_0xa12a('0x47')][_0xa12a('0x6d')]||_0x55dd47[_0xa12a('0x5b')]['id'];_0x2fef1e[_0xa12a('0x6e')]['id']=_0x55dd47[_0xa12a('0x47')][_0xa12a('0x6d')];return db[_0xa12a('0x2b')][_0xa12a('0x46')]({'where':{'id':_0x55dd47[_0xa12a('0x44')]['id'],'UserId':null}})[_0xa12a('0x3f')](handleEntityNotFound(_0x26bb5b,null))[_0xa12a('0x3f')](function(_0x545a64){if(_0x545a64){_0x2fef1e[_0xa12a('0x1a')]=_0x545a64[_0xa12a('0x72')]({'plain':!![]});return db[_0xa12a('0x6f')]['find']({'where':{'id':_0x545a64[_0xa12a('0x87')]}});}return null;})[_0xa12a('0x3f')](handleEntityNotFound(_0x26bb5b,null))[_0xa12a('0x3f')](function(_0x970761){if(_0x970761){_0x2fef1e[_0xa12a('0x71')]=_0x970761[_0xa12a('0x72')]({'plain':!![]});interaction_log[_0xa12a('0x13')](_0xa12a('0x88'),_0x55dd47['user']['id'],_0x55dd47[_0xa12a('0x5b')]['name'],_0x55dd47['user'][_0xa12a('0x89')],_0x2fef1e[_0xa12a('0x71')]['id'],_0x55dd47[_0xa12a('0x47')]?JSON[_0xa12a('0x18')](_0x55dd47[_0xa12a('0x47')]):'null');return respondWithRpcPromise(_0xa12a('0x8a'),_0xa12a('0x8b'),_0x2fef1e);}return null;})[_0xa12a('0x3f')](function(_0x52750d){var _0x28c3da=_0xa12a('0x76')+_0x52750d[_0xa12a('0x1a')][_0xa12a('0x8c')];return db['sequelize']['query'](_0x28c3da,{'type':db[_0xa12a('0x8d')][_0xa12a('0x8e')][_0xa12a('0x78')],'raw':!![]})[_0xa12a('0x3f')](function(_0x3dbdd7){return _0x3dbdd7;});})[_0xa12a('0x3f')](function(_0x44cd03){if(_0x44cd03){_0x2fef1e['message'][_0xa12a('0x79')]=_0x44cd03[0x0];if(!_0x55dd47[_0xa12a('0x47')][_0xa12a('0x6d')])return;return db[_0xa12a('0x7a')]['find']({'where':{'id':_0x55dd47[_0xa12a('0x47')][_0xa12a('0x6d')],'role':_0xa12a('0x6e')},'attributes':['id',_0xa12a('0x28'),_0xa12a('0x7b'),'email',_0xa12a('0x7d')],'raw':!![]});}return null;})[_0xa12a('0x3f')](function(_0x1a907e){if(!_0x1a907e)return null;_0x2fef1e[_0xa12a('0x1a')][_0xa12a('0x6e')]=_0x1a907e;return _0x2fef1e;})[_0xa12a('0x3f')](function(_0x41bd11){if(_0x41bd11){_0x41bd11['message'][_0xa12a('0x7f')]=util['format'](_0xa12a('0x80'),_0x55dd47[_0xa12a('0x5b')][_0xa12a('0x28')]);_0x41bd11[_0xa12a('0x1a')][_0xa12a('0x81')]=_0x2fef1e['channel'];_0x41bd11[_0xa12a('0x1a')][_0xa12a('0x82')]=_0x2fef1e[_0xa12a('0x81')];_0x41bd11['message'][_0xa12a('0x83')]='reject';_0x41bd11[_0xa12a('0x1a')]['body']=htmlToText[_0xa12a('0x84')](_0x2fef1e[_0xa12a('0x1a')]['body']);respondWithRpcPromise('EventManager',_0xa12a('0x85'),{'event':'rejectmessage','message':_0x41bd11[_0xa12a('0x1a')]},client9002);return _0x2fef1e;}return null;})[_0xa12a('0x3f')](respondWithResult(_0x26bb5b,null))[_0xa12a('0x1c')](handleError(_0x26bb5b,null));};exports[_0xa12a('0x8f')]=function(_0x463873,_0x4a39ba){var _0x338a2c=moment()[_0xa12a('0x90')]()[_0xa12a('0x91')]();var _0x3fb123=path['join'](config['root'],_0xa12a('0x92'),_0xa12a('0x93'),_0xa12a('0x94'));var _0x449ad4=path[_0xa12a('0x5f')](config[_0xa12a('0x60')],_0xa12a('0x92'),_0xa12a('0x93'),'attachments');var _0x551c4d=util[_0xa12a('0x67')](_0xa12a('0x95'),_0x338a2c);return db[_0xa12a('0x2b')][_0xa12a('0x46')]({'where':{'id':_0x463873[_0xa12a('0x44')]['id']},'attributes':['id','body','from','to','cc',_0xa12a('0x96'),_0xa12a('0x97'),_0xa12a('0x98')],'include':_0x463873['query']['attachments']?[{'model':db['Attachment'],'as':_0xa12a('0x99')}]:undefined})[_0xa12a('0x3f')](handleEntityNotFound(_0x4a39ba,null))[_0xa12a('0x3f')](function(_0x430388){if(_0x430388){var _0x36c65e=_0x430388;var _0x5b1ab4={'from':_0x36c65e[_0xa12a('0x9a')],'to':_0x36c65e['to'],'subject':_0x36c65e[_0xa12a('0x97')],'html':htmlEntities[_0xa12a('0x9b')](_0x36c65e[_0xa12a('0x47')]),'headers':{'Date':moment(_0x36c65e[_0xa12a('0x98')])['format'](_0xa12a('0x9c'))},'attachments':[]};if(_0x430388['cc']){_0x5b1ab4[_0xa12a('0x9d')]['Cc']=_0x430388['cc'];}if(_0x430388[_0xa12a('0x96')]){_0x5b1ab4[_0xa12a('0x9d')]['Bcc']=_0x430388[_0xa12a('0x96')];}return new BPromise(function(_0x332979,_0x5661f7){if(_0x430388['Attachments']){for(var _0x5289ae=0x0;_0x5289ae<_0x430388[_0xa12a('0x99')][_0xa12a('0x36')];_0x5289ae++){var _0x438872=_0x430388['Attachments'][_0x5289ae];var _0x4b769d=path[_0xa12a('0x5f')](_0x449ad4,_0x438872[_0xa12a('0x62')]);if(fs[_0xa12a('0x9e')](_0x4b769d)){_0x5b1ab4[_0xa12a('0x5e')][_0xa12a('0x9f')]({'name':_0x438872[_0xa12a('0x28')],'contentType':_0x438872[_0xa12a('0x3e')],'data':fs[_0xa12a('0xa0')](_0x4b769d)});}}}emlformat[_0xa12a('0xa1')](_0x5b1ab4,function(_0x90fcc1,_0x1805b1){if(_0x90fcc1)return _0x5661f7(_0x90fcc1);fs[_0xa12a('0xa2')](path[_0xa12a('0x5f')](_0x3fb123,_0x551c4d),_0x1805b1);return _0x332979(_0x1805b1);});});}})[_0xa12a('0x3f')](function(_0x408fff){if(_0x408fff){return _0x4a39ba[_0xa12a('0x8f')](path[_0xa12a('0x5f')](_0x3fb123,_0x551c4d),_0x551c4d,function(_0x3152a3){if(!_0x3152a3)fs['unlinkSync'](path[_0xa12a('0x5f')](_0x3fb123,_0x551c4d));});}})[_0xa12a('0x1c')](handleError(_0x4a39ba,null));}; \ No newline at end of file +var _0x9648=['join','root','server/files/attachments','basename','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','rejectMessage','User','SIP/%s','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','status','json','offset','limit','undefined','count','Content-Range','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','body','catch','describe','create','direction','out','secret','split','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments'];(function(_0x466dd0,_0xca4783){var _0x4c452a=function(_0x3ccca6){while(--_0x3ccca6){_0x466dd0['push'](_0x466dd0['shift']());}};_0x4c452a(++_0xca4783);}(_0x9648,0xe2));var _0x8964=function(_0x50a3c0,_0x4ce353){_0x50a3c0=_0x50a3c0-0x0;var _0x3d877a=_0x9648[_0x50a3c0];return _0x3d877a;};'use strict';var emlformat=require(_0x8964('0x0'));var moment=require(_0x8964('0x1'));var BPromise=require(_0x8964('0x2'));var util=require(_0x8964('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x8964('0x4'));var Redis=require(_0x8964('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x8964('0x6'));var logger=require(_0x8964('0x7'))(_0x8964('0x8'));var interaction_log=require(_0x8964('0x7'))('mail-interactions');var config=require(_0x8964('0x9'));var db=require(_0x8964('0xa'))['db'];config['redis']=_[_0x8964('0xb')](config[_0x8964('0xc')],{'host':_0x8964('0xd'),'port':0x18eb});var socket=require(_0x8964('0xe'))(new Redis(config[_0x8964('0xc')]));var htmlEntities=require(_0x8964('0xf'));require(_0x8964('0x10'))[_0x8964('0x11')](socket);var jayson=require(_0x8964('0x12'));var client=jayson['client'][_0x8964('0x13')]({'port':0x232c});var client9003=jayson[_0x8964('0x14')][_0x8964('0x13')]({'port':0x232b});var client9002=jayson[_0x8964('0x14')][_0x8964('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x10532e,_0x22c861,_0x579ff0,_0x241a72){return new BPromise(function(_0x261f6e,_0xc75889){var _0x35273b=_0x241a72||client;return _0x35273b['request'](_0x10532e,_0x579ff0)[_0x8964('0x15')](function(_0x47a644){logger[_0x8964('0x16')](_0x8964('0x17'),_0x22c861,'request\x20sent');logger[_0x8964('0x18')](_0x8964('0x19'),_0x22c861,_0x8964('0x1a'),JSON[_0x8964('0x1b')](_0x47a644));if(_0x47a644[_0x8964('0x1c')]){if(_0x47a644['error']['code']===0x1f4){logger[_0x8964('0x1c')](_0x8964('0x17'),_0x22c861,_0x47a644[_0x8964('0x1c')][_0x8964('0x1d')]);return _0xc75889(_0x47a644[_0x8964('0x1c')]['message']);}logger['error'](_0x8964('0x17'),_0x22c861,_0x47a644[_0x8964('0x1c')][_0x8964('0x1d')]);return _0x261f6e(_0x47a644[_0x8964('0x1c')][_0x8964('0x1d')]);}else{logger[_0x8964('0x16')]('MailMessage,\x20%s,\x20%s',_0x22c861,_0x8964('0x1a'));_0x261f6e(_0x47a644['result']['message']);}})['catch'](function(_0x1fb9dc){logger['error'](_0x8964('0x17'),_0x22c861,_0x1fb9dc);_0xc75889(_0x1fb9dc);});});}function respondWithResult(_0x3a222a,_0x3ea56b){_0x3ea56b=_0x3ea56b||0xc8;return function(_0x442ce8){if(_0x442ce8){return _0x3a222a[_0x8964('0x1e')](_0x3ea56b)[_0x8964('0x1f')](_0x442ce8);}};}function respondWithFilteredResult(_0x3bfb21,_0x359043){return function(_0x4deea2){if(_0x4deea2){var _0x1afb81=typeof _0x359043[_0x8964('0x20')]==='undefined'&&typeof _0x359043[_0x8964('0x21')]===_0x8964('0x22');var _0x4a1fc5=_0x4deea2[_0x8964('0x23')];var _0x3d6992=_0x1afb81?0x0:_0x359043[_0x8964('0x20')];var _0x109935=_0x1afb81?_0x4deea2[_0x8964('0x23')]:_0x359043[_0x8964('0x20')]+_0x359043[_0x8964('0x21')];var _0x528ca8;if(_0x109935>=_0x4a1fc5){_0x109935=_0x4a1fc5;_0x528ca8=0xc8;}else{_0x528ca8=0xce;}_0x3bfb21[_0x8964('0x1e')](_0x528ca8);return _0x3bfb21['set'](_0x8964('0x24'),_0x3d6992+'-'+_0x109935+'/'+_0x4a1fc5)[_0x8964('0x1f')](_0x4deea2);}return null;};}function saveUpdates(_0x406506){return function(_0x391772){if(_0x391772){return _0x391772[_0x8964('0x25')](_0x406506)[_0x8964('0x15')](function(_0x1b61a9){return _0x1b61a9;});}return null;};}function removeEntity(_0x33a695){return function(_0x154cfb){if(_0x154cfb){return _0x154cfb[_0x8964('0x26')]()['then'](function(){_0x33a695[_0x8964('0x1e')](0xcc)[_0x8964('0x27')]();});}};}function handleEntityNotFound(_0x33ca70){return function(_0x3121be){if(!_0x3121be){_0x33ca70[_0x8964('0x28')](0x194);}return _0x3121be;};}function handleError(_0x267382,_0x4a792c){_0x4a792c=_0x4a792c||0x1f4;return function(_0x3730df){logger[_0x8964('0x1c')](_0x3730df['stack']);if(_0x3730df[_0x8964('0x29')]){delete _0x3730df[_0x8964('0x29')];}_0x267382[_0x8964('0x1e')](_0x4a792c)[_0x8964('0x2a')](_0x3730df);};}exports[_0x8964('0x2b')]=function(_0x51f4b5,_0x50ea28){var _0x191333={},_0x1aee94={},_0x5f405a={'count':0x0,'rows':[]};var _0x21e271=_[_0x8964('0x2c')](db[_0x8964('0x2d')][_0x8964('0x2e')],function(_0x20d6c5){return{'name':_0x20d6c5[_0x8964('0x2f')],'type':_0x20d6c5[_0x8964('0x30')]['key']};});_0x1aee94[_0x8964('0x31')]=_[_0x8964('0x2c')](_0x21e271,_0x8964('0x29'));_0x1aee94['query']=_[_0x8964('0x32')](_0x51f4b5[_0x8964('0x33')]);_0x1aee94[_0x8964('0x34')]=_['intersection'](_0x1aee94[_0x8964('0x31')],_0x1aee94['query']);_0x191333[_0x8964('0x35')]=_[_0x8964('0x36')](_0x1aee94[_0x8964('0x31')],qs['fields'](_0x51f4b5['query'][_0x8964('0x37')]));_0x191333['attributes']=_0x191333[_0x8964('0x35')][_0x8964('0x38')]?_0x191333[_0x8964('0x35')]:_0x1aee94[_0x8964('0x31')];if(!_0x51f4b5[_0x8964('0x33')][_0x8964('0x39')](_0x8964('0x3a'))){_0x191333[_0x8964('0x21')]=qs[_0x8964('0x21')](_0x51f4b5[_0x8964('0x33')]['limit']);_0x191333[_0x8964('0x20')]=qs[_0x8964('0x20')](_0x51f4b5[_0x8964('0x33')][_0x8964('0x20')]);}_0x191333[_0x8964('0x3b')]=qs[_0x8964('0x3c')](_0x51f4b5[_0x8964('0x33')]['sort']);_0x191333[_0x8964('0x3d')]=qs[_0x8964('0x34')](_[_0x8964('0x3e')](_0x51f4b5[_0x8964('0x33')],_0x1aee94[_0x8964('0x34')]),_0x21e271);if(_0x51f4b5['query'][_0x8964('0x3f')]){_0x191333[_0x8964('0x3d')]=_[_0x8964('0x40')](_0x191333[_0x8964('0x3d')],{'$or':_[_0x8964('0x2c')](_0x21e271,function(_0x4d44b3){if(_0x4d44b3[_0x8964('0x30')]!==_0x8964('0x41')){var _0x31847a={};_0x31847a[_0x4d44b3[_0x8964('0x29')]]={'$like':'%'+_0x51f4b5['query'][_0x8964('0x3f')]+'%'};return _0x31847a;}})});}_0x191333=_['merge']({},_0x191333,_0x51f4b5[_0x8964('0x42')]);var _0x589d8a={'where':_0x191333[_0x8964('0x3d')]};return db['MailMessage']['count'](_0x589d8a)[_0x8964('0x15')](function(_0x359179){_0x5f405a[_0x8964('0x23')]=_0x359179;if(_0x51f4b5[_0x8964('0x33')][_0x8964('0x43')]){_0x191333['include']=[{'all':!![]}];}return db[_0x8964('0x2d')][_0x8964('0x44')](_0x191333);})[_0x8964('0x15')](function(_0x39dcfd){_0x5f405a['rows']=_0x39dcfd;return _0x5f405a;})[_0x8964('0x15')](respondWithFilteredResult(_0x50ea28,_0x191333))['catch'](handleError(_0x50ea28,null));};exports['show']=function(_0x37c9af,_0x6d0b69){var _0xaebbec={'raw':!![],'where':{'id':_0x37c9af[_0x8964('0x45')]['id']}},_0x32bfb2={};_0x32bfb2[_0x8964('0x31')]=_[_0x8964('0x32')](db[_0x8964('0x2d')][_0x8964('0x2e')]);_0x32bfb2['query']=_['keys'](_0x37c9af['query']);_0x32bfb2[_0x8964('0x34')]=_[_0x8964('0x36')](_0x32bfb2['model'],_0x32bfb2['query']);_0xaebbec[_0x8964('0x35')]=_['intersection'](_0x32bfb2[_0x8964('0x31')],qs[_0x8964('0x37')](_0x37c9af[_0x8964('0x33')]['fields']));_0xaebbec[_0x8964('0x35')]=_0xaebbec['attributes'][_0x8964('0x38')]?_0xaebbec[_0x8964('0x35')]:_0x32bfb2['model'];if(_0x37c9af['query']['includeAll']){_0xaebbec[_0x8964('0x46')]=[{'all':!![]}];}_0xaebbec=_[_0x8964('0x40')]({},_0xaebbec,_0x37c9af[_0x8964('0x42')]);return db[_0x8964('0x2d')][_0x8964('0x47')](_0xaebbec)[_0x8964('0x15')](handleEntityNotFound(_0x6d0b69,null))[_0x8964('0x15')](respondWithResult(_0x6d0b69,null))['catch'](handleError(_0x6d0b69,null));};exports['update']=function(_0x460aa1,_0x3dc5af){if(_0x460aa1[_0x8964('0x48')]['id']){delete _0x460aa1[_0x8964('0x48')]['id'];}return db[_0x8964('0x2d')][_0x8964('0x47')]({'where':{'id':_0x460aa1[_0x8964('0x45')]['id']}})['then'](handleEntityNotFound(_0x3dc5af,null))[_0x8964('0x15')](saveUpdates(_0x460aa1[_0x8964('0x48')],null))[_0x8964('0x15')](respondWithResult(_0x3dc5af,null))[_0x8964('0x49')](handleError(_0x3dc5af,null));};exports[_0x8964('0x26')]=function(_0x1c14f5,_0x42a883){return db['MailMessage'][_0x8964('0x47')]({'where':{'id':_0x1c14f5['params']['id']}})[_0x8964('0x15')](handleEntityNotFound(_0x42a883,null))['then'](removeEntity(_0x42a883,null))['catch'](handleError(_0x42a883,null));};exports[_0x8964('0x4a')]=function(_0xa771d4,_0x9edd7){return db['MailMessage'][_0x8964('0x4a')]()[_0x8964('0x15')](respondWithResult(_0x9edd7,null))[_0x8964('0x49')](handleError(_0x9edd7,null));};exports[_0x8964('0x4b')]=function(_0x41c26b,_0x4a40bb){return db[_0x8964('0x2d')]['create'](_0x41c26b['body'])['then'](function(_0x5d11f7){if(_0x5d11f7){if(_0x5d11f7[_0x8964('0x4c')]===_0x8964('0x4d')&&!_0x5d11f7[_0x8964('0x4e')]){var _0x298379,_0x56ba69,_0xa77f2a;if(_0x41c26b[_0x8964('0x48')]['to']){_0x56ba69=_0x41c26b[_0x8964('0x48')]['to'][_0x8964('0x4f')](',')[0x0];}return db['MailAccount'][_0x8964('0x50')]({'where':{'id':_0x5d11f7['MailAccountId']},'include':[{'model':db[_0x8964('0x51')],'as':_0x8964('0x52'),'include':[{'model':db[_0x8964('0x53')],'as':_0x8964('0x54'),'where':{'email':_0x56ba69},'limit':0x1,'order':[[_0x8964('0x55'),_0x8964('0x56')]]}]},{'model':db[_0x8964('0x57')],'as':_0x8964('0x58'),'raw':!![]}]})[_0x8964('0x15')](function(_0x3c28c7){_0x298379=_0x3c28c7;if(_0x298379&&_0x298379[_0x8964('0x58')]){var _0xe4f1ce={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x298379[_0x8964('0x58')][_0x8964('0x59')])){_0xe4f1ce[_0x8964('0x5a')]=_0x298379[_0x8964('0x58')][_0x8964('0x5a')];_0xe4f1ce['port']=_0x298379[_0x8964('0x58')][_0x8964('0x5b')];_0xe4f1ce[_0x8964('0x5c')]=_0x298379[_0x8964('0x58')][_0x8964('0x5c')];if(_0x298379[_0x8964('0x58')][_0x8964('0x5d')]){_0xe4f1ce[_0x8964('0x5e')]={'user':_0x298379[_0x8964('0x58')][_0x8964('0x5f')],'pass':_0x298379[_0x8964('0x58')][_0x8964('0x60')]};}}else{_0xe4f1ce[_0x8964('0x59')]=_0x298379['Smtp']['service'];_0xe4f1ce[_0x8964('0x5e')]={'user':_0x298379[_0x8964('0x58')][_0x8964('0x5f')],'pass':_0x298379['Smtp']['pass']};_0xe4f1ce[_0x8964('0x5c')]=_0x298379[_0x8964('0x58')]['secure'];}if(_0x41c26b[_0x8964('0x48')][_0x8964('0x61')]&&_0x41c26b[_0x8964('0x48')][_0x8964('0x61')][_0x8964('0x38')]){for(var _0x22153e=0x0;_0x22153e<_0x41c26b[_0x8964('0x48')]['attachments'][_0x8964('0x38')];_0x22153e+=0x1){_0x41c26b['body'][_0x8964('0x61')][_0x22153e]={'filename':_0x41c26b['body']['attachments'][_0x22153e]['name'],'path':path[_0x8964('0x62')](config[_0x8964('0x63')],_0x8964('0x64'),_0x41c26b['body'][_0x8964('0x61')][_0x22153e][_0x8964('0x65')])};}}_0xa77f2a={'account':_0xe4f1ce,'message':_0x41c26b[_0x8964('0x48')]};return;}})[_0x8964('0x15')](function(){if(_0x298379[_0x8964('0x52')]){if(_0x298379[_0x8964('0x52')][_0x8964('0x54')][_0x8964('0x38')]){return _0x298379[_0x8964('0x52')][_0x8964('0x54')][0x0];}else{return db[_0x8964('0x53')][_0x8964('0x4b')](_[_0x8964('0xb')](_0x41c26b['body'],{'firstName':_0x41c26b[_0x8964('0x48')]['to'],'email':_0x41c26b[_0x8964('0x48')]['to'],'phone':_0x41c26b['body']['to'],'ListId':_0x298379['ListId']}));}}else{throw new Error(_0x8964('0x66'));}})[_0x8964('0x15')](function(){if(_0xa77f2a){return respondWithRpcPromise('SendMail',_0x8964('0x67'),_0xa77f2a,client9003)['then'](function(_0x2bd5aa){return _0x5d11f7['update']({'read':!![],'messageId':_0x2bd5aa[_0x8964('0x68')],'sentAt':moment()[_0x8964('0x69')](_0x8964('0x6a'))});})['catch'](function(_0x4f220d){logger[_0x8964('0x1c')]('%s',JSON[_0x8964('0x1b')](_0x4f220d));return _0x5d11f7;});}return _0x5d11f7;});}return _0x5d11f7;}})[_0x8964('0x15')](respondWithResult(_0x4a40bb,0xc9))[_0x8964('0x49')](handleError(_0x4a40bb,null));};exports[_0x8964('0x6b')]=function(_0x57d78c,_0x19b6c9){var _0x539b23={'agent':{},'channel':_0x8964('0x6c')};if(_0x57d78c[_0x8964('0x48')]['id']){delete _0x57d78c['body']['id'];}_0x57d78c[_0x8964('0x48')][_0x8964('0x6d')]=!![];_0x57d78c[_0x8964('0x48')][_0x8964('0x6e')]=moment()[_0x8964('0x69')](_0x8964('0x6a'));_0x57d78c['body'][_0x8964('0x6f')]=_0x57d78c[_0x8964('0x48')][_0x8964('0x6f')]||_0x57d78c['user']['id'];_0x539b23[_0x8964('0x70')]['id']=_0x57d78c[_0x8964('0x48')][_0x8964('0x6f')];return db['MailMessage'][_0x8964('0x47')]({'where':{'id':_0x57d78c[_0x8964('0x45')]['id'],'UserId':null}})[_0x8964('0x15')](handleEntityNotFound(_0x19b6c9,null))[_0x8964('0x15')](saveUpdates(_0x57d78c[_0x8964('0x48')],null))[_0x8964('0x15')](function(_0x5e8c39){if(_0x5e8c39){_0x539b23['message']=_0x5e8c39[_0x8964('0x71')]({'plain':!![]});return db[_0x8964('0x72')][_0x8964('0x47')]({'where':{'id':_0x5e8c39[_0x8964('0x73')]}});}return null;})['then'](handleEntityNotFound(_0x19b6c9,null))['then'](function(_0x4ed18f){if(_0x4ed18f){return _0x4ed18f[_0x8964('0x25')]({'UserId':_0x57d78c[_0x8964('0x48')][_0x8964('0x6f')],'read1stAt':_['isNil'](_0x4ed18f['read1stAt'])?moment()[_0x8964('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8964('0x15')](function(_0x3e339d){if(_0x3e339d){_0x539b23[_0x8964('0x74')]=_0x3e339d['get']({'plain':!![]});interaction_log[_0x8964('0x16')](_0x8964('0x75'),_0x57d78c[_0x8964('0x5f')]['id'],_0x57d78c[_0x8964('0x5f')][_0x8964('0x29')],_0x57d78c['user'][_0x8964('0x76')],_0x539b23[_0x8964('0x74')]['id'],_0x57d78c[_0x8964('0x48')]?JSON[_0x8964('0x1b')](_0x57d78c['body']):_0x8964('0x77'));return respondWithRpcPromise(_0x8964('0x78'),_0x8964('0x79'),_0x539b23);}return null;})[_0x8964('0x15')](function(_0x2a06ba){var _0x391e29=_0x8964('0x7a')+_0x2a06ba[_0x8964('0x1d')][_0x8964('0x7b')];return db[_0x8964('0x7c')]['query'](_0x391e29,{'type':db[_0x8964('0x7d')][_0x8964('0x7e')][_0x8964('0x7f')],'raw':!![]})['then'](function(_0x49d150){return _0x49d150;});})[_0x8964('0x15')](function(_0x1e495e){if(_0x1e495e){_0x539b23[_0x8964('0x1d')][_0x8964('0x80')]=_0x1e495e[0x0];if(!_0x57d78c[_0x8964('0x48')][_0x8964('0x6f')])return;return db['User'][_0x8964('0x47')]({'where':{'id':_0x57d78c[_0x8964('0x48')]['UserId'],'role':_0x8964('0x70')},'attributes':['id',_0x8964('0x29'),_0x8964('0x81'),_0x8964('0x82'),_0x8964('0x83')],'raw':!![]});}return null;})[_0x8964('0x15')](function(_0x20dcf3){if(!_0x20dcf3)return null;_0x539b23['message']['agent']=_0x20dcf3;return _0x539b23;})[_0x8964('0x15')](function(_0x563a46){if(_0x563a46){if(_0x57d78c[_0x8964('0x48')][_0x8964('0x84')]){_0x539b23['message'][_0x8964('0x85')]=util[_0x8964('0x69')]('SIP/%s',_0x57d78c[_0x8964('0x5f')][_0x8964('0x29')]);_0x539b23[_0x8964('0x1d')][_0x8964('0x86')]=_0x539b23[_0x8964('0x86')];_0x539b23[_0x8964('0x1d')][_0x8964('0x87')]=_0x539b23['channel'];_0x539b23[_0x8964('0x1d')][_0x8964('0x88')]=_0x8964('0x6b');_0x539b23[_0x8964('0x1d')][_0x8964('0x48')]=htmlToText[_0x8964('0x89')](_0x539b23['message'][_0x8964('0x48')]);return respondWithRpcPromise(_0x8964('0x8a'),'EventManager',{'event':_0x8964('0x8b'),'message':_0x539b23[_0x8964('0x1d')]},client9002)[_0x8964('0x15')](function(){return _0x539b23;});}return _0x539b23;}return null;})[_0x8964('0x15')](respondWithResult(_0x19b6c9,null))['catch'](handleError(_0x19b6c9,null));};exports[_0x8964('0x8c')]=function(_0x49f662,_0x8a9207){var _0x4376f8={'agent':{},'channel':_0x8964('0x6c')};if(_0x49f662['body']['id']){delete _0x49f662['body']['id'];}_0x49f662['body']['UserId']=_0x49f662[_0x8964('0x48')]['UserId']||_0x49f662[_0x8964('0x5f')]['id'];_0x4376f8['agent']['id']=_0x49f662['body']['UserId'];return db[_0x8964('0x2d')][_0x8964('0x47')]({'where':{'id':_0x49f662[_0x8964('0x45')]['id'],'UserId':null}})[_0x8964('0x15')](handleEntityNotFound(_0x8a9207,null))[_0x8964('0x15')](function(_0x4b60d6){if(_0x4b60d6){_0x4376f8['message']=_0x4b60d6[_0x8964('0x71')]({'plain':!![]});return db['MailInteraction'][_0x8964('0x47')]({'where':{'id':_0x4b60d6[_0x8964('0x73')]}});}return null;})[_0x8964('0x15')](handleEntityNotFound(_0x8a9207,null))['then'](function(_0x2ad631){if(_0x2ad631){_0x4376f8[_0x8964('0x74')]=_0x2ad631[_0x8964('0x71')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x49f662[_0x8964('0x5f')]['id'],_0x49f662[_0x8964('0x5f')]['name'],_0x49f662[_0x8964('0x5f')][_0x8964('0x76')],_0x4376f8[_0x8964('0x74')]['id'],_0x49f662[_0x8964('0x48')]?JSON[_0x8964('0x1b')](_0x49f662['body']):_0x8964('0x77'));return respondWithRpcPromise('RejectMessage',_0x8964('0x8d'),_0x4376f8);}return null;})[_0x8964('0x15')](function(_0x2e950c){var _0x55bf71=_0x8964('0x7a')+_0x2e950c['message']['ContactId'];return db[_0x8964('0x7c')][_0x8964('0x33')](_0x55bf71,{'type':db[_0x8964('0x7d')][_0x8964('0x7e')]['SELECT'],'raw':!![]})[_0x8964('0x15')](function(_0x3b44d9){return _0x3b44d9;});})[_0x8964('0x15')](function(_0x2735d9){if(_0x2735d9){_0x4376f8['message'][_0x8964('0x80')]=_0x2735d9[0x0];if(!_0x49f662['body'][_0x8964('0x6f')])return;return db[_0x8964('0x8e')][_0x8964('0x47')]({'where':{'id':_0x49f662[_0x8964('0x48')][_0x8964('0x6f')],'role':_0x8964('0x70')},'attributes':['id',_0x8964('0x29'),'fullname',_0x8964('0x82'),_0x8964('0x83')],'raw':!![]});}return null;})[_0x8964('0x15')](function(_0x337a0a){if(!_0x337a0a)return null;_0x4376f8[_0x8964('0x1d')][_0x8964('0x70')]=_0x337a0a;return _0x4376f8;})[_0x8964('0x15')](function(_0x134d6b){if(_0x134d6b){_0x134d6b[_0x8964('0x1d')][_0x8964('0x85')]=util[_0x8964('0x69')](_0x8964('0x8f'),_0x49f662[_0x8964('0x5f')][_0x8964('0x29')]);_0x134d6b[_0x8964('0x1d')][_0x8964('0x86')]=_0x4376f8['channel'];_0x134d6b[_0x8964('0x1d')][_0x8964('0x87')]=_0x4376f8[_0x8964('0x86')];_0x134d6b[_0x8964('0x1d')][_0x8964('0x88')]=_0x8964('0x8c');_0x134d6b[_0x8964('0x1d')]['body']=htmlToText[_0x8964('0x89')](_0x4376f8[_0x8964('0x1d')][_0x8964('0x48')]);respondWithRpcPromise(_0x8964('0x8a'),_0x8964('0x8a'),{'event':_0x8964('0x90'),'message':_0x134d6b[_0x8964('0x1d')]},client9002);return _0x4376f8;}return null;})['then'](respondWithResult(_0x8a9207,null))[_0x8964('0x49')](handleError(_0x8a9207,null));};exports['download']=function(_0x32797c,_0x339d69){var _0x36ebe9=moment()[_0x8964('0x91')]()[_0x8964('0x92')]();var _0x2f4cdd=path[_0x8964('0x62')](config[_0x8964('0x63')],_0x8964('0x93'),_0x8964('0x94'),_0x8964('0x95'));var _0x3b499c=path[_0x8964('0x62')](config[_0x8964('0x63')],_0x8964('0x93'),_0x8964('0x94'),_0x8964('0x61'));var _0x3336df=util[_0x8964('0x69')](_0x8964('0x96'),_0x36ebe9);return db[_0x8964('0x2d')]['find']({'where':{'id':_0x32797c[_0x8964('0x45')]['id']},'attributes':['id',_0x8964('0x48'),'from','to','cc',_0x8964('0x97'),_0x8964('0x98'),'createdAt'],'include':_0x32797c['query'][_0x8964('0x61')]?[{'model':db['Attachment'],'as':_0x8964('0x99')}]:undefined})[_0x8964('0x15')](handleEntityNotFound(_0x339d69,null))[_0x8964('0x15')](function(_0x5ccdbf){if(_0x5ccdbf){var _0x5964dd=_0x5ccdbf;var _0x5fb0ed={'from':_0x5964dd[_0x8964('0x9a')],'to':_0x5964dd['to'],'subject':_0x5964dd['subject'],'html':htmlEntities[_0x8964('0x9b')](_0x5964dd[_0x8964('0x48')]),'headers':{'Date':moment(_0x5964dd[_0x8964('0x9c')])['format'](_0x8964('0x9d'))},'attachments':[]};if(_0x5ccdbf['cc']){_0x5fb0ed[_0x8964('0x9e')]['Cc']=_0x5ccdbf['cc'];}if(_0x5ccdbf[_0x8964('0x97')]){_0x5fb0ed[_0x8964('0x9e')]['Bcc']=_0x5ccdbf['bcc'];}return new BPromise(function(_0x532c8b,_0x4039a9){if(_0x5ccdbf['Attachments']){for(var _0x3b0711=0x0;_0x3b0711<_0x5ccdbf[_0x8964('0x99')][_0x8964('0x38')];_0x3b0711++){var _0x297fbc=_0x5ccdbf['Attachments'][_0x3b0711];var _0xc9dc3e=path[_0x8964('0x62')](_0x3b499c,_0x297fbc[_0x8964('0x65')]);if(fs['existsSync'](_0xc9dc3e)){_0x5fb0ed[_0x8964('0x61')]['push']({'name':_0x297fbc[_0x8964('0x29')],'contentType':_0x297fbc[_0x8964('0x30')],'data':fs[_0x8964('0x9f')](_0xc9dc3e)});}}}emlformat[_0x8964('0xa0')](_0x5fb0ed,function(_0x40fa17,_0x5d170b){if(_0x40fa17)return _0x4039a9(_0x40fa17);fs['writeFileSync'](path[_0x8964('0x62')](_0x2f4cdd,_0x3336df),_0x5d170b);return _0x532c8b(_0x5d170b);});});}})[_0x8964('0x15')](function(_0x202b0b){if(_0x202b0b){return _0x339d69['download'](path[_0x8964('0x62')](_0x2f4cdd,_0x3336df),_0x3336df,function(_0x349cbc){if(!_0x349cbc)fs[_0x8964('0xa1')](path[_0x8964('0x62')](_0x2f4cdd,_0x3336df));});}})['catch'](handleError(_0x339d69,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bb19d8a..33f9d72 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 _0x84c6=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save','update','remove'];(function(_0x4f2a7d,_0x3f27b6){var _0x17846a=function(_0x2fa255){while(--_0x2fa255){_0x4f2a7d['push'](_0x4f2a7d['shift']());}};_0x17846a(++_0x3f27b6);}(_0x84c6,0x1c5));var _0x684c=function(_0xc1e05a,_0x5d4cdc){_0xc1e05a=_0xc1e05a-0x0;var _0xb6a24c=_0x84c6[_0xc1e05a];return _0xb6a24c;};'use strict';var EventEmitter=require(_0x684c('0x0'));var MailMessage=require(_0x684c('0x1'))['db'][_0x684c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x684c('0x3'),'afterUpdate':_0x684c('0x4'),'afterDestroy':_0x684c('0x5')};function emitEvent(_0x17b8a3){return function(_0x4e010f,_0x38ad0f,_0x671a91){MailMessageEvents[_0x684c('0x6')](_0x17b8a3+':'+_0x4e010f['id'],_0x4e010f);MailMessageEvents[_0x684c('0x6')](_0x17b8a3,_0x4e010f);_0x671a91(null);};}for(var e in events){if(events[_0x684c('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x684c('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x823c=['exports','events','../../mysqldb','MailMessage','emit','hook'];(function(_0x48ccd1,_0x4f4f00){var _0x267554=function(_0x54735b){while(--_0x54735b){_0x48ccd1['push'](_0x48ccd1['shift']());}};_0x267554(++_0x4f4f00);}(_0x823c,0xa9));var _0xc823=function(_0x2be3e8,_0xbf11a7){_0x2be3e8=_0x2be3e8-0x0;var _0x59d3ea=_0x823c[_0x2be3e8];return _0x59d3ea;};'use strict';var EventEmitter=require(_0xc823('0x0'));var MailMessage=require(_0xc823('0x1'))['db'][_0xc823('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ee51a){return function(_0x161d4b,_0x368efe,_0x4d840b){MailMessageEvents[_0xc823('0x3')](_0x5ee51a+':'+_0x161d4b['id'],_0x161d4b);MailMessageEvents[_0xc823('0x3')](_0x5ee51a,_0x161d4b);_0x4d840b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xc823('0x4')](e,emitEvent(event));}}module[_0xc823('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 058c313..0c59210 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 _0xc3a7=['secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc3a7,0x1b8));var _0x7c3a=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xc3a7[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require(_0x7c3a('0x0'));var util=require('util');var logger=require(_0x7c3a('0x1'))(_0x7c3a('0x2'));var moment=require(_0x7c3a('0x3'));var BPromise=require(_0x7c3a('0x4'));var rp=require(_0x7c3a('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c3a('0x6'));var config=require(_0x7c3a('0x7'));var attributes=require('./mailMessage.attributes');module[_0x7c3a('0x8')]=function(_0x49c30a,_0x3218c4){return _0x49c30a[_0x7c3a('0x9')]('MailMessage',attributes,{'tableName':_0x7c3a('0xa'),'paranoid':![],'indexes':[{'name':_0x7c3a('0xb'),'fields':[_0x7c3a('0xb')]},{'name':'fti_mail_messages','fields':[_0x7c3a('0xc'),_0x7c3a('0xd')],'type':_0x7c3a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12fc7a,_0x22e204,_0x2f1b68){if(_0x12fc7a[_0x7c3a('0xf')]){_0x12fc7a[_0x7c3a('0xc')]=htmlToText[_0x7c3a('0x10')](_0x12fc7a[_0x7c3a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2f1b68(null,_0x22e204);},'afterCreate':function(_0x485a26,_0x65ba34,_0x45031e){var _0x3b9001=_0x49c30a[_0x7c3a('0x11')];var _0x246c37=_0x485a26[_0x7c3a('0x12')]({'plain':!![]});if(_0x246c37['direction']['toLowerCase']()==='in'||_0x246c37[_0x7c3a('0x13')][_0x7c3a('0x14')]()===_0x7c3a('0x15')&&!_0x246c37[_0x7c3a('0x16')]&&!_[_0x7c3a('0x17')](_0x246c37[_0x7c3a('0x18')])){_0x3b9001[_0x7c3a('0x19')][_0x7c3a('0x1a')]({'where':{'id':_0x246c37[_0x7c3a('0x1b')]}})[_0x7c3a('0x1c')](function(_0x3b9c9b){if(_0x3b9c9b){_0x3b9c9b['update']({'lastMsgAt':_0x246c37[_0x7c3a('0x1d')],'lastMsgDirection':_0x246c37[_0x7c3a('0x13')]['toLowerCase']()});}})[_0x7c3a('0x1e')](function(_0x4d2b94){console[_0x7c3a('0x1f')](_0x4d2b94);});}_0x45031e();}},'charset':'utf8mb4','collate':_0x7c3a('0x20')});}; \ No newline at end of file +var _0x9896=['../../config/logger','api','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','update','catch','utf8mb4_unicode_ci','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9896,0x19f));var _0x6989=function(_0x4e6db4,_0x4995d9){_0x4e6db4=_0x4e6db4-0x0;var _0x4fe802=_0x9896[_0x4e6db4];return _0x4fe802;};'use strict';var _=require(_0x6989('0x0'));var util=require('util');var logger=require(_0x6989('0x1'))(_0x6989('0x2'));var moment=require(_0x6989('0x3'));var BPromise=require('bluebird');var rp=require(_0x6989('0x4'));var htmlToText=require(_0x6989('0x5'));var fs=require('fs');var path=require(_0x6989('0x6'));var rimraf=require('rimraf');var config=require(_0x6989('0x7'));var attributes=require(_0x6989('0x8'));module[_0x6989('0x9')]=function(_0x4cadc8,_0x5ab16a){return _0x4cadc8[_0x6989('0xa')](_0x6989('0xb'),attributes,{'tableName':_0x6989('0xc'),'paranoid':![],'indexes':[{'name':_0x6989('0xd'),'fields':[_0x6989('0xd')]},{'name':'fti_mail_messages','fields':[_0x6989('0xe'),_0x6989('0xf')],'type':_0x6989('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x461fbf,_0x4c27fd,_0x1b84e0){if(_0x461fbf[_0x6989('0x11')]){_0x461fbf['plainBody']=htmlToText[_0x6989('0x12')](_0x461fbf[_0x6989('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1b84e0(null,_0x4c27fd);},'afterCreate':function(_0xb0c92f,_0x3303ca,_0x2b7458){var _0x77cfeb=_0x4cadc8[_0x6989('0x13')];var _0x444254=_0xb0c92f[_0x6989('0x14')]({'plain':!![]});if(_0x444254[_0x6989('0x15')][_0x6989('0x16')]()==='in'||_0x444254[_0x6989('0x15')]['toLowerCase']()===_0x6989('0x17')&&!_0x444254[_0x6989('0x18')]&&!_[_0x6989('0x19')](_0x444254['UserId'])){_0x77cfeb[_0x6989('0x1a')]['findOne']({'where':{'id':_0x444254[_0x6989('0x1b')]}})[_0x6989('0x1c')](function(_0x2eff07){if(_0x2eff07){_0x2eff07[_0x6989('0x1d')]({'lastMsgAt':_0x444254['createdAt'],'lastMsgDirection':_0x444254[_0x6989('0x15')][_0x6989('0x16')]()});}})[_0x6989('0x1e')](function(_0x415d52){console['error'](_0x415d52);});}_0x2b7458();}},'charset':'utf8mb4','collate':_0x6989('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 555d177..a6ca71e 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x314c87,_0x5a1e04){var _0xac2f31=function(_0x596bf3){while(--_0x596bf3){_0x314c87['push'](_0x314c87['shift']());}};_0xac2f31(++_0x5a1e04);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x5c3c[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file +var _0xdd4f=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1aa8e4,_0x422beb){_0x1aa8e4=_0x1aa8e4-0x0;var _0x335a4d=_0xdd4f[_0x1aa8e4];return _0x335a4d;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});config[_0xfdd4('0x9')]=_[_0xfdd4('0xa')](config['redis'],{'host':_0xfdd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdd4('0x9')]));require(_0xfdd4('0xc'))[_0xfdd4('0xd')](socket);function respondWithRpcPromise(_0x4ee02f,_0x3d06c9,_0x4b4f1d){return new BPromise(function(_0x27a9f3,_0x3ce77a){return client[_0xfdd4('0xe')](_0x4ee02f,_0x4b4f1d)[_0xfdd4('0xf')](function(_0x35e22d){logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));logger[_0xfdd4('0x13')](_0xfdd4('0x14'),_0x3d06c9,_0xfdd4('0x12'),JSON['stringify'](_0x35e22d));if(_0x35e22d[_0xfdd4('0x15')]){if(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x16')]===0x1f4){logger['error'](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error'][_0xfdd4('0x17')]);return _0x3ce77a(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x17')]);}logger[_0xfdd4('0x15')](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error']['message']);return _0x27a9f3(_0x35e22d['error'][_0xfdd4('0x17')]);}else{logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));_0x27a9f3(_0x35e22d[_0xfdd4('0x18')][_0xfdd4('0x17')]);}})[_0xfdd4('0x19')](function(_0x2ffd5f){logger[_0xfdd4('0x15')]('MailMessage,\x20%s,\x20%s',_0x3d06c9,_0x2ffd5f);_0x3ce77a(_0x2ffd5f);});});}exports[_0xfdd4('0x1a')]=function(_0x3e8eac){var _0x2dc51c=this;return new Promise(function(_0x36e611,_0x1454f1){return db[_0xfdd4('0x1b')][_0xfdd4('0x1c')](_0x3e8eac[_0xfdd4('0x1d')],{'raw':_0x3e8eac['options']?_0x3e8eac[_0xfdd4('0x1e')][_0xfdd4('0x1f')]===undefined?!![]:![]:!![]})[_0xfdd4('0xf')](function(_0x16e81b){logger[_0xfdd4('0x10')](_0xfdd4('0x1a'),_0x3e8eac);logger[_0xfdd4('0x13')](_0xfdd4('0x1a'),_0x3e8eac,JSON['stringify'](_0x16e81b));_0x36e611(_0x16e81b);})[_0xfdd4('0x19')](function(_0x1112e8){logger[_0xfdd4('0x15')]('CreateMailMessage',_0x1112e8[_0xfdd4('0x17')],_0x3e8eac);_0x1454f1(_0x2dc51c[_0xfdd4('0x15')](0x1f4,_0x1112e8[_0xfdd4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 4ee157e..6b30914 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 _0xb642=['remove','register','length','mailMessage:','save'];(function(_0x32c268,_0x22ced7){var _0x1f9019=function(_0x207397){while(--_0x207397){_0x32c268['push'](_0x32c268['shift']());}};_0x1f9019(++_0x22ced7);}(_0xb642,0x15d));var _0x2b64=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xb642[_0xc6be3a];return _0x56a310;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x2b64('0x0'),_0x2b64('0x1'),'update'];function createListener(_0x1c2fbf,_0x352a17){return function(_0x10fcd2){_0x352a17['emit'](_0x1c2fbf,_0x10fcd2);};}function removeListener(_0x510dcb,_0x43e208){return function(){MailMessageEvents['removeListener'](_0x510dcb,_0x43e208);};}exports[_0x2b64('0x2')]=function(_0x4331f0){for(var _0x4dedfc=0x0,_0x2305e3=events[_0x2b64('0x3')];_0x4dedfc<_0x2305e3;_0x4dedfc++){var _0x33dbbc=events[_0x4dedfc];var _0x4a0afd=createListener(_0x2b64('0x4')+_0x33dbbc,_0x4331f0);MailMessageEvents['on'](_0x33dbbc,_0x4a0afd);}}; \ No newline at end of file +var _0xde74=['save','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0x3ebbd2,_0x18293c){var _0x5cc1ba=function(_0x3ccace){while(--_0x3ccace){_0x3ebbd2['push'](_0x3ebbd2['shift']());}};_0x5cc1ba(++_0x18293c);}(_0xde74,0xe8));var _0x4de7=function(_0x444309,_0x132bbe){_0x444309=_0x444309-0x0;var _0x5f1092=_0xde74[_0x444309];return _0x5f1092;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x4de7('0x0'),_0x4de7('0x1'),_0x4de7('0x2')];function createListener(_0x47f7f6,_0x50ac38){return function(_0x405c8c){_0x50ac38[_0x4de7('0x3')](_0x47f7f6,_0x405c8c);};}function removeListener(_0x4b94c5,_0x53d134){return function(){MailMessageEvents[_0x4de7('0x4')](_0x4b94c5,_0x53d134);};}exports[_0x4de7('0x5')]=function(_0x477ada){for(var _0xf47f91=0x0,_0x20dc41=events[_0x4de7('0x6')];_0xf47f91<_0x20dc41;_0xf47f91++){var _0x58bfe0=events[_0xf47f91];var _0x267a5c=createListener(_0x4de7('0x7')+_0x58bfe0,_0x477ada);MailMessageEvents['on'](_0x58bfe0,_0x267a5c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 7ff3f7e..da0aed4 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 _0x6134=['destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6134,0x78));var _0x4613=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6134[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x4613('0x0'));var util=require(_0x4613('0x1'));var path=require(_0x4613('0x2'));var timeout=require(_0x4613('0x3'));var express=require('express');var router=express[_0x4613('0x4')]();var fs_extra=require(_0x4613('0x5'));var auth=require(_0x4613('0x6'));var interaction=require(_0x4613('0x7'));var config=require(_0x4613('0x8'));var controller=require('./mailQueue.controller');router[_0x4613('0x9')]('/',auth[_0x4613('0xa')](),controller[_0x4613('0xb')]);router['get'](_0x4613('0xc'),auth[_0x4613('0xa')](),controller['describe']);router[_0x4613('0x9')](_0x4613('0xd'),auth[_0x4613('0xa')](),controller[_0x4613('0xe')]);router[_0x4613('0x9')](_0x4613('0xf'),auth[_0x4613('0xa')](),controller[_0x4613('0x10')]);router[_0x4613('0x9')](_0x4613('0x11'),auth[_0x4613('0xa')](),controller[_0x4613('0x12')]);router[_0x4613('0x9')](_0x4613('0x13'),auth[_0x4613('0xa')](),controller['getAgents']);router['post']('/',auth[_0x4613('0xa')](),controller[_0x4613('0x14')]);router[_0x4613('0x15')](_0x4613('0x11'),auth[_0x4613('0xa')](),controller[_0x4613('0x16')]);router[_0x4613('0x15')]('/:id/users',auth[_0x4613('0xa')](),controller[_0x4613('0x17')]);router[_0x4613('0x18')](_0x4613('0xd'),auth[_0x4613('0xa')](),controller['update']);router['delete'](_0x4613('0xd'),auth[_0x4613('0xa')](),controller[_0x4613('0x19')]);router[_0x4613('0x1a')](_0x4613('0x11'),auth[_0x4613('0xa')](),controller[_0x4613('0x1b')]);router['delete'](_0x4613('0x13'),auth[_0x4613('0xa')](),controller['removeAgents']);module[_0x4613('0x1c')]=router; \ No newline at end of file +var _0xe2f4=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x539dfc,_0x4c80ee){var _0x1c3bc7=function(_0x62148c){while(--_0x62148c){_0x539dfc['push'](_0x539dfc['shift']());}};_0x1c3bc7(++_0x4c80ee);}(_0xe2f4,0x1df));var _0x4e2f=function(_0x182c42,_0x6a462b){_0x182c42=_0x182c42-0x0;var _0x2cea53=_0xe2f4[_0x182c42];return _0x2cea53;};'use strict';var multer=require(_0x4e2f('0x0'));var util=require(_0x4e2f('0x1'));var path=require(_0x4e2f('0x2'));var timeout=require(_0x4e2f('0x3'));var express=require(_0x4e2f('0x4'));var router=express[_0x4e2f('0x5')]();var fs_extra=require(_0x4e2f('0x6'));var auth=require(_0x4e2f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x4e2f('0x8')]('/',auth[_0x4e2f('0x9')](),controller[_0x4e2f('0xa')]);router[_0x4e2f('0x8')](_0x4e2f('0xb'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0xc')]);router[_0x4e2f('0x8')](_0x4e2f('0xd'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0xe')]);router['get'](_0x4e2f('0xf'),auth[_0x4e2f('0x9')](),controller['getMembers']);router['get'](_0x4e2f('0x10'),auth[_0x4e2f('0x9')](),controller['getTeams']);router[_0x4e2f('0x8')](_0x4e2f('0x11'),auth[_0x4e2f('0x9')](),controller['getAgents']);router[_0x4e2f('0x12')]('/',auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x13')]);router[_0x4e2f('0x12')](_0x4e2f('0x10'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x14')]);router[_0x4e2f('0x12')](_0x4e2f('0x11'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x15')]);router['put'](_0x4e2f('0xd'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x16')]);router[_0x4e2f('0x17')](_0x4e2f('0xd'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x18')]);router[_0x4e2f('0x17')](_0x4e2f('0x10'),auth[_0x4e2f('0x9')](),controller['removeTeams']);router[_0x4e2f('0x17')](_0x4e2f('0x11'),auth[_0x4e2f('0x9')](),controller[_0x4e2f('0x19')]);module[_0x4e2f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index f97c441..6e18cb9 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 _0xb18d=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xb18d,0x11d));var _0xdb18=function(_0x137fca,_0x3c9d36){_0x137fca=_0x137fca-0x0;var _0x5c055c=_0xb18d[_0x137fca];return _0x5c055c;};'use strict';var Sequelize=require(_0xdb18('0x0'));module[_0xdb18('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdb18('0x2')]},'timeout':{'type':Sequelize[_0xdb18('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdb18('0x4')](_0xdb18('0x5'),_0xdb18('0x6'),_0xdb18('0x7'))}}; \ No newline at end of file +var _0xa491=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x2cdf12,_0x43341e){var _0x555b3b=function(_0x13da8e){while(--_0x13da8e){_0x2cdf12['push'](_0x2cdf12['shift']());}};_0x555b3b(++_0x43341e);}(_0xa491,0x15d));var _0x1a49=function(_0x5d5a42,_0x447c9d){_0x5d5a42=_0x5d5a42-0x0;var _0x5e8221=_0xa491[_0x5d5a42];return _0x5e8221;};'use strict';var Sequelize=require(_0x1a49('0x0'));module[_0x1a49('0x1')]={'name':{'type':Sequelize[_0x1a49('0x2')],'unique':_0x1a49('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1a49('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1a49('0x5'),_0x1a49('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 209a045..1c36c51 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 _0x552a=['getTeams','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','Team','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','includes','all','union','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','hasOwnProperty','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','MailQueues','destroy','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserMailQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','SIP','mailPause'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x552a,0xaf));var _0xa552=function(_0x492813,_0x4fad44){_0x492813=_0x492813-0x0;var _0x1c30ab=_0x552a[_0x492813];return _0x1c30ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa552('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa552('0x1'));var moment=require(_0xa552('0x2'));var BPromise=require(_0xa552('0x3'));var Mustache=require(_0xa552('0x4'));var util=require('util');var path=require(_0xa552('0x5'));var sox=require('sox');var csv=require(_0xa552('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa552('0x7'));var crypto=require(_0xa552('0x8'));var jsforce=require(_0xa552('0x9'));var deskjs=require(_0xa552('0xa'));var toCsv=require(_0xa552('0x6'));var querystring=require(_0xa552('0xb'));var Papa=require(_0xa552('0xc'));var Redis=require('ioredis');var authService=require(_0xa552('0xd'));var qs=require(_0xa552('0xe'));var as=require(_0xa552('0xf'));var hardwareService=require(_0xa552('0x10'));var logger=require(_0xa552('0x11'))(_0xa552('0x12'));var utils=require(_0xa552('0x13'));var config=require(_0xa552('0x14'));var licenseUtil=require(_0xa552('0x15'));var db=require(_0xa552('0x16'))['db'];config['redis']=_[_0xa552('0x17')](config[_0xa552('0x18')],{'host':_0xa552('0x19'),'port':0x18eb});var socket=require(_0xa552('0x1a'))(new Redis(config[_0xa552('0x18')]));require('./mailQueue.socket')[_0xa552('0x1b')](socket);function respondWithStatusCode(_0x44b321,_0x4ff62a){_0x4ff62a=_0x4ff62a||0xcc;return function(_0x30e5ec){if(_0x30e5ec){return _0x44b321['sendStatus'](_0x4ff62a);}return _0x44b321[_0xa552('0x1c')](_0x4ff62a)[_0xa552('0x1d')]();};}function respondWithResult(_0x31828e,_0x3c7649){_0x3c7649=_0x3c7649||0xc8;return function(_0x52240b){if(_0x52240b){return _0x31828e[_0xa552('0x1c')](_0x3c7649)[_0xa552('0x1e')](_0x52240b);}};}function respondWithFilteredResult(_0x5824e8,_0x4470a8){return function(_0x5780ad){if(_0x5780ad){var _0x2db3df=typeof _0x4470a8[_0xa552('0x1f')]===_0xa552('0x20')&&typeof _0x4470a8[_0xa552('0x21')]===_0xa552('0x20');var _0x2e6716=_0x5780ad['count'];var _0x3e24ec=_0x2db3df?0x0:_0x4470a8['offset'];var _0x3a667d=_0x2db3df?_0x5780ad[_0xa552('0x22')]:_0x4470a8[_0xa552('0x1f')]+_0x4470a8['limit'];var _0x1e6118;if(_0x3a667d>=_0x2e6716){_0x3a667d=_0x2e6716;_0x1e6118=0xc8;}else{_0x1e6118=0xce;}_0x5824e8[_0xa552('0x1c')](_0x1e6118);return _0x5824e8[_0xa552('0x23')](_0xa552('0x24'),_0x3e24ec+'-'+_0x3a667d+'/'+_0x2e6716)[_0xa552('0x1e')](_0x5780ad);}return null;};}function patchUpdates(_0xd36a91){return function(_0x1a4410){try{jsonpatch['apply'](_0x1a4410,_0xd36a91,!![]);}catch(_0x343a87){return BPromise[_0xa552('0x25')](_0x343a87);}return _0x1a4410['save']();};}function saveUpdates(_0x920756,_0x53658b){return function(_0x43e573){if(_0x43e573){return _0x43e573[_0xa552('0x26')](_0x920756)[_0xa552('0x27')](function(_0xf4d071){return _0xf4d071;});}return null;};}function removeEntity(_0x2566e3,_0x4c1b3c){return function(_0x1f410c){if(_0x1f410c){return _0x1f410c['destroy']()['then'](function(){var _0x36a048=_0x1f410c['get']({'plain':!![]});var _0x3e87d7=_0xa552('0x28');return db['UserProfileResource'][_0xa552('0x29')]({'where':{'type':_0x3e87d7,'resourceId':_0x36a048['id']}})[_0xa552('0x27')](function(){return _0x1f410c;});})[_0xa552('0x27')](function(){_0x2566e3[_0xa552('0x1c')](0xcc)[_0xa552('0x1d')]();});}};}function handleEntityNotFound(_0x494d14,_0xd1afcf){return function(_0x8ac2d8){if(!_0x8ac2d8){_0x494d14['sendStatus'](0x194);}return _0x8ac2d8;};}function handleError(_0x1a9db5,_0x35b7ab){_0x35b7ab=_0x35b7ab||0x1f4;return function(_0x45919a){logger['error'](_0x45919a[_0xa552('0x2a')]);if(_0x45919a[_0xa552('0x2b')]){delete _0x45919a['name'];}_0x1a9db5[_0xa552('0x1c')](_0x35b7ab)[_0xa552('0x2c')](_0x45919a);};}exports[_0xa552('0x2d')]=function(_0x5dc595,_0x11f53e){var _0x6e2104={},_0x35b74f={},_0x3c4c49={'count':0x0,'rows':[]};var _0x579583=_[_0xa552('0x2e')](db[_0xa552('0x2f')][_0xa552('0x30')],function(_0x581d71){return{'name':_0x581d71[_0xa552('0x31')],'type':_0x581d71[_0xa552('0x32')][_0xa552('0x33')]};});_0x35b74f[_0xa552('0x34')]=_['map'](_0x579583,_0xa552('0x2b'));_0x35b74f[_0xa552('0x35')]=_[_0xa552('0x36')](_0x5dc595[_0xa552('0x35')]);_0x35b74f[_0xa552('0x37')]=_[_0xa552('0x38')](_0x35b74f[_0xa552('0x34')],_0x35b74f[_0xa552('0x35')]);_0x6e2104['attributes']=_[_0xa552('0x38')](_0x35b74f[_0xa552('0x34')],qs[_0xa552('0x39')](_0x5dc595[_0xa552('0x35')][_0xa552('0x39')]));_0x6e2104[_0xa552('0x3a')]=_0x6e2104[_0xa552('0x3a')][_0xa552('0x3b')]?_0x6e2104[_0xa552('0x3a')]:_0x35b74f[_0xa552('0x34')];if(!_0x5dc595[_0xa552('0x35')]['hasOwnProperty'](_0xa552('0x3c'))){_0x6e2104[_0xa552('0x21')]=qs[_0xa552('0x21')](_0x5dc595['query'][_0xa552('0x21')]);_0x6e2104[_0xa552('0x1f')]=qs['offset'](_0x5dc595['query'][_0xa552('0x1f')]);}_0x6e2104[_0xa552('0x3d')]=qs[_0xa552('0x3e')](_0x5dc595[_0xa552('0x35')][_0xa552('0x3e')]);_0x6e2104['where']=qs[_0xa552('0x37')](_[_0xa552('0x3f')](_0x5dc595[_0xa552('0x35')],_0x35b74f[_0xa552('0x37')]),_0x579583);if(_0x5dc595[_0xa552('0x35')][_0xa552('0x40')]){_0x6e2104[_0xa552('0x41')]=_[_0xa552('0x42')](_0x6e2104[_0xa552('0x41')],{'$or':_[_0xa552('0x2e')](_0x579583,function(_0x2579a0){if(_0x2579a0[_0xa552('0x32')]!==_0xa552('0x43')){var _0x3a9cbb={};_0x3a9cbb[_0x2579a0[_0xa552('0x2b')]]={'$like':'%'+_0x5dc595[_0xa552('0x35')]['filter']+'%'};return _0x3a9cbb;}})});}_0x6e2104=_['merge']({},_0x6e2104,_0x5dc595[_0xa552('0x44')]);var _0x43806e={'where':_0x6e2104[_0xa552('0x41')]};return db[_0xa552('0x2f')][_0xa552('0x22')](_0x43806e)['then'](function(_0x371880){_0x3c4c49['count']=_0x371880;if(_0x5dc595['query'][_0xa552('0x45')]){_0x6e2104[_0xa552('0x46')]=[{'all':!![]}];}return db[_0xa552('0x2f')][_0xa552('0x47')](_0x6e2104);})['then'](function(_0x4e5b9a){_0x3c4c49['rows']=_0x4e5b9a;return _0x3c4c49;})[_0xa552('0x27')](respondWithFilteredResult(_0x11f53e,_0x6e2104))['catch'](handleError(_0x11f53e,null));};exports[_0xa552('0x48')]=function(_0x374f5c,_0x1880a5){var _0x514746={'raw':!![],'where':{'id':_0x374f5c[_0xa552('0x49')]['id']}},_0x406489={};_0x406489[_0xa552('0x34')]=_['keys'](db[_0xa552('0x2f')][_0xa552('0x30')]);_0x406489[_0xa552('0x35')]=_['keys'](_0x374f5c[_0xa552('0x35')]);_0x406489[_0xa552('0x37')]=_[_0xa552('0x38')](_0x406489[_0xa552('0x34')],_0x406489['query']);_0x514746[_0xa552('0x3a')]=_[_0xa552('0x38')](_0x406489[_0xa552('0x34')],qs[_0xa552('0x39')](_0x374f5c['query'][_0xa552('0x39')]));_0x514746[_0xa552('0x3a')]=_0x514746[_0xa552('0x3a')][_0xa552('0x3b')]?_0x514746['attributes']:_0x406489['model'];if(_0x374f5c[_0xa552('0x35')][_0xa552('0x45')]){_0x514746[_0xa552('0x46')]=[{'all':!![]}];}_0x514746=_[_0xa552('0x42')]({},_0x514746,_0x374f5c[_0xa552('0x44')]);return db[_0xa552('0x2f')][_0xa552('0x4a')](_0x514746)[_0xa552('0x27')](handleEntityNotFound(_0x1880a5,null))[_0xa552('0x27')](respondWithResult(_0x1880a5,null))[_0xa552('0x4b')](handleError(_0x1880a5,null));};exports['create']=function(_0x39cf4e,_0x113e6d){return db['MailQueue'][_0xa552('0x4c')](_0x39cf4e['body'],{})['then'](function(_0x24f5da){var _0x4bac80=_0x39cf4e[_0xa552('0x4d')]['get']({'plain':!![]});if(!_0x4bac80)throw new Error(_0xa552('0x4e'));if(_0x4bac80[_0xa552('0x4f')]==='user'){var _0x372669=_0x24f5da[_0xa552('0x50')]({'plain':!![]});var _0x2b5fcf='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0x2b5fcf,'userProfileId':_0x4bac80[_0xa552('0x51')]},'raw':!![]})['then'](function(_0x5bcbd2){if(_0x5bcbd2&&_0x5bcbd2['autoAssociation']===0x0){return db['UserProfileResource'][_0xa552('0x4c')]({'name':_0x372669['name'],'resourceId':_0x372669['id'],'type':_0x5bcbd2['name'],'sectionId':_0x5bcbd2['id']},{})[_0xa552('0x27')](function(){return _0x24f5da;});}else{return _0x24f5da;}})[_0xa552('0x4b')](function(_0x88b823){logger[_0xa552('0x52')](_0xa552('0x53'),_0x88b823);throw _0x88b823;});}return _0x24f5da;})[_0xa552('0x27')](respondWithResult(_0x113e6d,0xc9))['catch'](handleError(_0x113e6d,null));};exports['update']=function(_0x216411,_0x416965){if(_0x216411[_0xa552('0x54')]['id']){delete _0x216411[_0xa552('0x54')]['id'];}return db[_0xa552('0x2f')][_0xa552('0x4a')]({'where':{'id':_0x216411[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x416965,null))['then'](saveUpdates(_0x216411[_0xa552('0x54')],null))[_0xa552('0x27')](respondWithResult(_0x416965,null))['catch'](handleError(_0x416965,null));};exports['destroy']=function(_0x42877e,_0x391b87){return db[_0xa552('0x2f')][_0xa552('0x4a')]({'where':{'id':_0x42877e[_0xa552('0x49')]['id']}})['then'](handleEntityNotFound(_0x391b87,null))[_0xa552('0x27')](removeEntity(_0x391b87,null))['catch'](handleError(_0x391b87,null));};exports[_0xa552('0x55')]=function(_0x49e007,_0xe42d7f){return db[_0xa552('0x2f')][_0xa552('0x55')]()[_0xa552('0x27')](respondWithResult(_0xe42d7f,null))[_0xa552('0x4b')](handleError(_0xe42d7f,null));};exports[_0xa552('0x56')]=function(_0x386fbe,_0x27161b,_0x589a63){var _0x58231a={'raw':!![],'where':{}},_0x4772fb={},_0x5e0942;return db[_0xa552('0x2f')]['findOne']({'where':{'id':_0x386fbe[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x27161b,null))['then'](function(_0x2cb013){if(_0x2cb013){_0x5e0942=_0x2cb013[_0xa552('0x50')]({'plain':!![]});_0x4772fb[_0xa552('0x34')]=_[_0xa552('0x36')](db[_0xa552('0x57')][_0xa552('0x30')]);_0x4772fb[_0xa552('0x35')]=_[_0xa552('0x36')](_0x386fbe[_0xa552('0x35')]);_0x4772fb[_0xa552('0x37')]=_[_0xa552('0x38')](_0x4772fb[_0xa552('0x34')],_0x4772fb['query']);_0x58231a[_0xa552('0x3a')]=_[_0xa552('0x38')](_0x4772fb[_0xa552('0x34')],qs[_0xa552('0x39')](_0x386fbe[_0xa552('0x35')]['fields']));_0x58231a['attributes']=_0x58231a['attributes']['length']?_0x58231a[_0xa552('0x3a')]:_0x4772fb[_0xa552('0x34')];if(!_0x386fbe[_0xa552('0x35')]['hasOwnProperty'](_0xa552('0x3c'))){_0x58231a[_0xa552('0x21')]=qs[_0xa552('0x21')](_0x386fbe['query']['limit']);_0x58231a['offset']=qs['offset'](_0x386fbe[_0xa552('0x35')][_0xa552('0x1f')]);}_0x58231a[_0xa552('0x3d')]=qs[_0xa552('0x3e')](_0x386fbe[_0xa552('0x35')][_0xa552('0x3e')]);_0x58231a[_0xa552('0x41')]=qs[_0xa552('0x37')](_[_0xa552('0x3f')](_0x386fbe[_0xa552('0x35')],_0x4772fb[_0xa552('0x37')]));_0x58231a[_0xa552('0x41')]['MailQueueId']=_0x2cb013['id'];if(_0x386fbe[_0xa552('0x35')][_0xa552('0x40')]){_0x58231a[_0xa552('0x41')]=_[_0xa552('0x42')](_0x58231a[_0xa552('0x41')],{'$or':_[_0xa552('0x2e')](_0x58231a[_0xa552('0x3a')],function(_0x310733){var _0xb772bb={};_0xb772bb[_0x310733]={'$like':'%'+_0x386fbe[_0xa552('0x35')]['filter']+'%'};return _0xb772bb;})});}_0x58231a=_['merge']({},_0x58231a,_0x386fbe[_0xa552('0x44')]);return db[_0xa552('0x57')][_0xa552('0x47')](_0x58231a);}})['then'](function(_0x5453d4){if(_0x5453d4){return db[_0xa552('0x58')][_0xa552('0x59')]({'where':{'id':_[_0xa552('0x2e')](_0x5453d4,_0xa552('0x5a')),'role':_0xa552('0x5b')},'attributes':['id',_0xa552('0x2b'),'mailPause',_0xa552('0x5c'),_0xa552('0x5d')]});}})['then'](function(_0x6c6c3f){if(_0x6c6c3f){return{'count':_0x6c6c3f[_0xa552('0x22')],'rows':_[_0xa552('0x2e')](_0x6c6c3f[_0xa552('0x5e')],function(_0x5a1202){return{'membername':_0x5a1202['name'],'UserId':_0x5a1202['id'],'queue_name':_0x5e0942[_0xa552('0x2b')],'MailQueueId':_0x5e0942['id'],'interface':util['format']('%s/%s',_0xa552('0x5f'),_0x5a1202['name']),'penalty':0x0,'paused':_0x5a1202[_0xa552('0x60')],'createdAt':_0x5a1202['createdAt'],'updatedAt':_0x5a1202[_0xa552('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa552('0x27')](respondWithFilteredResult(_0x27161b,_0x58231a))[_0xa552('0x4b')](handleError(_0x27161b,null));};exports[_0xa552('0x61')]=function(_0x49b2e2,_0x13ae4c,_0x31decf){var _0x3eb06e={};var _0x3e76b3={};var _0x6a957f;var _0x1ab905;return db[_0xa552('0x2f')]['findOne']({'where':{'id':_0x49b2e2[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x13ae4c,null))[_0xa552('0x27')](function(_0x43d546){if(_0x43d546){_0x6a957f=_0x43d546;_0x3e76b3[_0xa552('0x34')]=_[_0xa552('0x36')](db['Team']['rawAttributes']);_0x3e76b3[_0xa552('0x35')]=_[_0xa552('0x36')](_0x49b2e2[_0xa552('0x35')]);_0x3e76b3['filters']=_[_0xa552('0x38')](_0x3e76b3[_0xa552('0x34')],_0x3e76b3[_0xa552('0x35')]);_0x3eb06e['attributes']=_[_0xa552('0x38')](_0x3e76b3[_0xa552('0x34')],qs[_0xa552('0x39')](_0x49b2e2[_0xa552('0x35')][_0xa552('0x39')]));_0x3eb06e[_0xa552('0x3a')]=_0x3eb06e[_0xa552('0x3a')][_0xa552('0x3b')]?_0x3eb06e['attributes']:_0x3e76b3['model'];_0x3eb06e[_0xa552('0x3d')]=qs[_0xa552('0x3e')](_0x49b2e2[_0xa552('0x35')][_0xa552('0x3e')]);_0x3eb06e['where']=qs[_0xa552('0x37')](_[_0xa552('0x3f')](_0x49b2e2[_0xa552('0x35')],_0x3e76b3['filters']));if(_0x49b2e2[_0xa552('0x35')]['filter']){_0x3eb06e[_0xa552('0x41')]=_['merge'](_0x3eb06e[_0xa552('0x41')],{'$or':_['map'](_0x3eb06e[_0xa552('0x3a')],function(_0x5a77c){var _0x997c2a={};_0x997c2a[_0x5a77c]={'$like':'%'+_0x49b2e2[_0xa552('0x35')]['filter']+'%'};return _0x997c2a;})});}_0x3eb06e=_['merge']({},_0x3eb06e,_0x49b2e2[_0xa552('0x44')]);return _0x6a957f[_0xa552('0x61')](_0x3eb06e);}})['then'](function(_0x467e36){if(_0x467e36){_0x1ab905=_0x467e36[_0xa552('0x3b')];if(!_0x49b2e2[_0xa552('0x35')]['hasOwnProperty']('nolimit')){_0x3eb06e[_0xa552('0x21')]=qs[_0xa552('0x21')](_0x49b2e2[_0xa552('0x35')][_0xa552('0x21')]);_0x3eb06e[_0xa552('0x1f')]=qs[_0xa552('0x1f')](_0x49b2e2[_0xa552('0x35')][_0xa552('0x1f')]);}return _0x6a957f[_0xa552('0x61')](_0x3eb06e);}})['then'](function(_0xe722dc){if(_0xe722dc){return _0xe722dc?{'count':_0x1ab905,'rows':_0xe722dc}:null;}})['then'](respondWithResult(_0x13ae4c,null))[_0xa552('0x4b')](handleError(_0x13ae4c,null));};exports[_0xa552('0x62')]=function(_0x3ba606,_0x146337,_0x4fc201){var _0x4fabf7=_0x3ba606['body']['ids'];return db['Team'][_0xa552('0x47')]({'where':{'id':_0x4fabf7},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa552('0x63'),'attributes':['id',_0xa552('0x2b'),_0xa552('0x64'),'voicePause',_0xa552('0x65')],'raw':!![]}]})[_0xa552('0x27')](function(_0x5e1106){if(_0x5e1106){var _0x52edfc=_[_0xa552('0x66')](_0x5e1106,function(_0x375f3e){var _0x3394f1=_0x375f3e[_0xa552('0x50')]({'plain':!![]});return _0x3394f1[_0xa552('0x63')];});return db['MailQueue'][_0xa552('0x4a')]({'where':{'id':_0x3ba606[_0xa552('0x49')]['id']}})[_0xa552('0x27')](function(_0x563ae9){return db[_0xa552('0x67')][_0xa552('0x68')](function(_0x12fca2){return _0x563ae9[_0xa552('0x62')](_0x4fabf7,{'transaction':_0x12fca2})[_0xa552('0x27')](function(){return BPromise[_0xa552('0x69')](_0x52edfc,function(_0x2b7f9f){return db[_0xa552('0x57')][_0xa552('0x6a')]({'where':{'UserId':_0x2b7f9f['id'],'MailQueueId':_0x3ba606['params']['id']},'transaction':_0x12fca2});});})[_0xa552('0x27')](function(){_0x52edfc[_0xa552('0x6b')](function(_0x17450d){socket[_0xa552('0x6c')](_0xa552('0x6d'),{'UserId':_0x17450d['id'],'MailQueueId':_0x563ae9['id']});});});});});}})['then'](respondWithStatusCode(_0x146337,null))['catch'](handleError(_0x146337,null));};exports[_0xa552('0x6e')]=function(_0x5b9506,_0x78d0e0,_0x117f37){return db[_0xa552('0x6f')][_0xa552('0x47')]({'where':{'id':_0x5b9506[_0xa552('0x35')][_0xa552('0x70')]},'attributes':['id'],'include':[{'model':db[_0xa552('0x58')],'as':_0xa552('0x63'),'attributes':['id'],'raw':!![]}]})[_0xa552('0x27')](handleEntityNotFound(_0x78d0e0,null))['then'](function(_0x4fc418){var _0x16e66d=_[_0xa552('0x2e')](_0x4fc418,'id');var _0x5897cb=[];var _0x508d9c=[];var _0x52435b=squel[_0xa552('0x71')]();_0x52435b['field'](_0xa552('0x72'))[_0xa552('0x73')]('team_has_mail_queues','tq')[_0xa552('0x74')](_0xa552('0x75'),'ut',_0xa552('0x76'))[_0xa552('0x41')]('MailQueueId\x20=\x20?',_0x5b9506[_0xa552('0x49')]['id']);for(var _0x20bfe1=0x0;_0x20bfe1<_0x4fc418['length'];_0x20bfe1+=0x1){let _0x3c10b6=_0x4fc418[_0x20bfe1];for(var _0x2ddbb9=0x0;_0x2ddbb9<_0x3c10b6[_0xa552('0x63')][_0xa552('0x3b')];_0x2ddbb9+=0x1){let _0x2f9f16=_0x3c10b6['Agents'][_0x2ddbb9];var _0x248bbf=_0x52435b['clone']();_0x248bbf[_0xa552('0x41')]('ut.UserId\x20=\x20?',_0x2f9f16['id']);_0x508d9c[_0xa552('0x77')](db[_0xa552('0x67')][_0xa552('0x35')](_0x248bbf[_0xa552('0x78')](),{'type':db[_0xa552('0x67')][_0xa552('0x79')][_0xa552('0x7a')]})[_0xa552('0x27')](function(_0x96d638){if(_0x96d638[_0xa552('0x3b')]===0x1){return _0x2f9f16['id'];}else{var _0x2ee8d3=_['every'](_[_0xa552('0x2e')](_0x96d638,'TeamId'),function(_0x39b3c9){return _[_0xa552('0x7b')](_0x16e66d,_0x39b3c9);});if(_0x2ee8d3){return _0x2f9f16['id'];}}}));}}return BPromise[_0xa552('0x7c')](_0x508d9c)[_0xa552('0x27')](function(_0x50a742){_0x5897cb=_(_0x5897cb)[_0xa552('0x7d')](_0x50a742)['compact']()['value']();return db[_0xa552('0x2f')][_0xa552('0x4a')]({'where':{'id':_0x5b9506[_0xa552('0x49')]['id']}})['then'](function(_0x2b495b){return db[_0xa552('0x67')]['transaction'](function(_0x6a1506){return _0x2b495b['removeTeams'](_0x5b9506['query'][_0xa552('0x70')],{'transaction':_0x6a1506})[_0xa552('0x27')](function(){if(!_[_0xa552('0x7e')](_0x5897cb)){return _0x2b495b['removeAgents'](_0x5897cb,{'transaction':_0x6a1506});}})[_0xa552('0x27')](function(){_0x5897cb[_0xa552('0x6b')](function(_0x22b309){socket['emit'](_0xa552('0x7f'),{'UserId':_0x22b309,'MailQueueId':_0x2b495b['id']});});});});});});})[_0xa552('0x27')](respondWithStatusCode(_0x78d0e0,null))[_0xa552('0x4b')](handleError(_0x78d0e0,null));};exports[_0xa552('0x80')]=function(_0x50c495,_0x2ae350,_0x3a6b66){return db[_0xa552('0x2f')][_0xa552('0x4a')]({'where':{'id':_0x50c495[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x2ae350,null))[_0xa552('0x27')](function(_0x5c200f){if(_0x5c200f){return _0x5c200f[_0xa552('0x80')](_0x50c495[_0xa552('0x54')][_0xa552('0x70')],_[_0xa552('0x81')](_0x50c495['body'],[_0xa552('0x70'),'id'])||{})[_0xa552('0x82')](function(_0x3977fc){for(var _0x4cbd8b=0x0;_0x4cbd8b<_0x50c495[_0xa552('0x54')][_0xa552('0x70')][_0xa552('0x3b')];_0x4cbd8b+=0x1){socket[_0xa552('0x6c')]('userMailQueue:save',{'UserId':Number(_0x50c495['body'][_0xa552('0x70')][_0x4cbd8b]),'MailQueueId':Number(_0x50c495['params']['id'])});}return _0x3977fc;});}})[_0xa552('0x27')](respondWithResult(_0x2ae350,null))['catch'](handleError(_0x2ae350,null));};exports[_0xa552('0x83')]=function(_0xf8cce3,_0x9a43e9,_0x30ebec){return db[_0xa552('0x2f')]['find']({'where':{'id':_0xf8cce3[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x9a43e9,null))[_0xa552('0x27')](function(_0x4ef023){if(_0x4ef023){return _0x4ef023[_0xa552('0x83')](_0xf8cce3[_0xa552('0x35')][_0xa552('0x70')])[_0xa552('0x27')](function(){if(_[_0xa552('0x84')](_0xf8cce3['query'][_0xa552('0x70')])){for(var _0x4c7b32=0x0;_0x4c7b32<_0xf8cce3[_0xa552('0x35')][_0xa552('0x70')]['length'];_0x4c7b32+=0x1){socket[_0xa552('0x6c')](_0xa552('0x7f'),{'UserId':Number(_0xf8cce3[_0xa552('0x35')]['ids'][_0x4c7b32]),'MailQueueId':Number(_0xf8cce3[_0xa552('0x49')]['id'])});}}else{socket[_0xa552('0x6c')](_0xa552('0x7f'),{'UserId':Number(_0xf8cce3[_0xa552('0x35')]['ids']),'MailQueueId':Number(_0xf8cce3[_0xa552('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x9a43e9,null))['catch'](handleError(_0x9a43e9,null));};exports[_0xa552('0x85')]=function(_0x963c8b,_0x7a0317,_0x33251a){var _0x31a9a0={};var _0x46db0b={};var _0x4fc690;var _0x4adbcc;return db[_0xa552('0x2f')][_0xa552('0x86')]({'where':{'id':_0x963c8b[_0xa552('0x49')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x7a0317,null))[_0xa552('0x27')](function(_0x49df14){if(_0x49df14){_0x4fc690=_0x49df14;_0x46db0b[_0xa552('0x34')]=_[_0xa552('0x36')](db['User'][_0xa552('0x30')]);_0x46db0b['query']=_[_0xa552('0x36')](_0x963c8b['query']);_0x46db0b[_0xa552('0x37')]=_[_0xa552('0x38')](_0x46db0b[_0xa552('0x34')],_0x46db0b[_0xa552('0x35')]);_0x31a9a0[_0xa552('0x3a')]=_['intersection'](_0x46db0b[_0xa552('0x34')],qs[_0xa552('0x39')](_0x963c8b[_0xa552('0x35')][_0xa552('0x39')]));_0x31a9a0[_0xa552('0x3a')]=_0x31a9a0[_0xa552('0x3a')][_0xa552('0x3b')]?_0x31a9a0['attributes']:_0x46db0b[_0xa552('0x34')];_0x31a9a0['order']=qs[_0xa552('0x3e')](_0x963c8b[_0xa552('0x35')][_0xa552('0x3e')]);_0x31a9a0[_0xa552('0x41')]=qs[_0xa552('0x37')](_[_0xa552('0x3f')](_0x963c8b[_0xa552('0x35')],_0x46db0b[_0xa552('0x37')]));if(_0x963c8b['query'][_0xa552('0x40')]){_0x31a9a0['where']=_[_0xa552('0x42')](_0x31a9a0[_0xa552('0x41')],{'$or':_['map'](_0x31a9a0[_0xa552('0x3a')],function(_0x5ee3fb){var _0x325c87={};_0x325c87[_0x5ee3fb]={'$like':'%'+_0x963c8b[_0xa552('0x35')]['filter']+'%'};return _0x325c87;})});}_0x31a9a0=_[_0xa552('0x42')]({},_0x31a9a0,_0x963c8b[_0xa552('0x44')]);return _0x4fc690[_0xa552('0x85')](_0x31a9a0);}})[_0xa552('0x27')](function(_0x311bb7){if(_0x311bb7){_0x4adbcc=_0x311bb7[_0xa552('0x3b')];if(!_0x963c8b[_0xa552('0x35')][_0xa552('0x87')](_0xa552('0x3c'))){_0x31a9a0[_0xa552('0x21')]=qs[_0xa552('0x21')](_0x963c8b[_0xa552('0x35')][_0xa552('0x21')]);_0x31a9a0[_0xa552('0x1f')]=qs['offset'](_0x963c8b['query'][_0xa552('0x1f')]);}return _0x4fc690[_0xa552('0x85')](_0x31a9a0);}})['then'](function(_0x46671b){if(_0x46671b){return _0x46671b?{'count':_0x4adbcc,'rows':_0x46671b}:null;}})[_0xa552('0x27')](respondWithResult(_0x7a0317,null))['catch'](handleError(_0x7a0317,null));}; \ No newline at end of file +var _0x1cf3=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','forEach','userMailQueue:remove','addAgents','emit','userMailQueue:save','isArray','getAgents','User','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','getMembers','findOne','UserMailQueue','MailQueueId','UserId','updatedAt','createdAt','format','%s/%s','mailPause','getTeams','Team','hasOwnProperty','addTeams','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1cf3,0x1be));var _0x31cf=function(_0x16c715,_0x328fb1){_0x16c715=_0x16c715-0x0;var _0x3877b7=_0x1cf3[_0x16c715];return _0x3877b7;};'use strict';var emlformat=require(_0x31cf('0x0'));var rimraf=require(_0x31cf('0x1'));var zipdir=require(_0x31cf('0x2'));var jsonpatch=require(_0x31cf('0x3'));var rp=require('request-promise');var moment=require(_0x31cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31cf('0x5'));var util=require(_0x31cf('0x6'));var path=require(_0x31cf('0x7'));var sox=require(_0x31cf('0x8'));var csv=require(_0x31cf('0x9'));var ejs=require(_0x31cf('0xa'));var fs=require('fs');var fs_extra=require(_0x31cf('0xb'));var _=require(_0x31cf('0xc'));var squel=require(_0x31cf('0xd'));var crypto=require(_0x31cf('0xe'));var jsforce=require(_0x31cf('0xf'));var deskjs=require(_0x31cf('0x10'));var toCsv=require(_0x31cf('0x9'));var querystring=require(_0x31cf('0x11'));var Papa=require('papaparse');var Redis=require(_0x31cf('0x12'));var authService=require(_0x31cf('0x13'));var qs=require(_0x31cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31cf('0x15'));var logger=require(_0x31cf('0x16'))(_0x31cf('0x17'));var utils=require(_0x31cf('0x18'));var config=require(_0x31cf('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x31cf('0x1a')]=_[_0x31cf('0x1b')](config[_0x31cf('0x1a')],{'host':_0x31cf('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31cf('0x1a')]));require(_0x31cf('0x1d'))[_0x31cf('0x1e')](socket);function respondWithStatusCode(_0x492d3d,_0xfe3b10){_0xfe3b10=_0xfe3b10||0xcc;return function(_0x3f2c56){if(_0x3f2c56){return _0x492d3d[_0x31cf('0x1f')](_0xfe3b10);}return _0x492d3d[_0x31cf('0x20')](_0xfe3b10)['end']();};}function respondWithResult(_0x54af12,_0x3be709){_0x3be709=_0x3be709||0xc8;return function(_0x45068c){if(_0x45068c){return _0x54af12[_0x31cf('0x20')](_0x3be709)['json'](_0x45068c);}};}function respondWithFilteredResult(_0x1d4830,_0x1218cc){return function(_0x54b753){if(_0x54b753){var _0x560d11=typeof _0x1218cc[_0x31cf('0x21')]==='undefined'&&typeof _0x1218cc[_0x31cf('0x22')]==='undefined';var _0x4fd305=_0x54b753[_0x31cf('0x23')];var _0x3be3a7=_0x560d11?0x0:_0x1218cc[_0x31cf('0x21')];var _0x1ac9f9=_0x560d11?_0x54b753[_0x31cf('0x23')]:_0x1218cc[_0x31cf('0x21')]+_0x1218cc[_0x31cf('0x22')];var _0x1a1864;if(_0x1ac9f9>=_0x4fd305){_0x1ac9f9=_0x4fd305;_0x1a1864=0xc8;}else{_0x1a1864=0xce;}_0x1d4830['status'](_0x1a1864);return _0x1d4830[_0x31cf('0x24')](_0x31cf('0x25'),_0x3be3a7+'-'+_0x1ac9f9+'/'+_0x4fd305)[_0x31cf('0x26')](_0x54b753);}return null;};}function patchUpdates(_0xfa517f){return function(_0x2319d0){try{jsonpatch[_0x31cf('0x27')](_0x2319d0,_0xfa517f,!![]);}catch(_0x462b83){return BPromise['reject'](_0x462b83);}return _0x2319d0[_0x31cf('0x28')]();};}function saveUpdates(_0x3f09d3,_0x348b46){return function(_0x816fbb){if(_0x816fbb){return _0x816fbb[_0x31cf('0x29')](_0x3f09d3)[_0x31cf('0x2a')](function(_0x34c383){return _0x34c383;});}return null;};}function removeEntity(_0x10dd40,_0x53664a){return function(_0x1c5a6d){if(_0x1c5a6d){return _0x1c5a6d[_0x31cf('0x2b')]()[_0x31cf('0x2a')](function(){var _0xc5fee6=_0x1c5a6d[_0x31cf('0x2c')]({'plain':!![]});var _0x1398cf=_0x31cf('0x2d');return db[_0x31cf('0x2e')][_0x31cf('0x2b')]({'where':{'type':_0x1398cf,'resourceId':_0xc5fee6['id']}})[_0x31cf('0x2a')](function(){return _0x1c5a6d;});})['then'](function(){_0x10dd40[_0x31cf('0x20')](0xcc)[_0x31cf('0x2f')]();});}};}function handleEntityNotFound(_0x4d7fd0,_0x29b920){return function(_0x51e298){if(!_0x51e298){_0x4d7fd0[_0x31cf('0x1f')](0x194);}return _0x51e298;};}function handleError(_0x6c789,_0x3abb09){_0x3abb09=_0x3abb09||0x1f4;return function(_0x31585a){logger[_0x31cf('0x30')](_0x31585a[_0x31cf('0x31')]);if(_0x31585a[_0x31cf('0x32')]){delete _0x31585a[_0x31cf('0x32')];}_0x6c789[_0x31cf('0x20')](_0x3abb09)[_0x31cf('0x33')](_0x31585a);};}exports[_0x31cf('0x34')]=function(_0x2c8d5e,_0x5d18a8){var _0x4cbc01={},_0x426846={},_0x45dc4e={'count':0x0,'rows':[]};var _0xd03d93=_[_0x31cf('0x35')](db[_0x31cf('0x36')][_0x31cf('0x37')],function(_0x58121d){return{'name':_0x58121d[_0x31cf('0x38')],'type':_0x58121d[_0x31cf('0x39')][_0x31cf('0x3a')]};});_0x426846['model']=_[_0x31cf('0x35')](_0xd03d93,_0x31cf('0x32'));_0x426846['query']=_['keys'](_0x2c8d5e[_0x31cf('0x3b')]);_0x426846[_0x31cf('0x3c')]=_[_0x31cf('0x3d')](_0x426846[_0x31cf('0x3e')],_0x426846['query']);_0x4cbc01[_0x31cf('0x3f')]=_[_0x31cf('0x3d')](_0x426846[_0x31cf('0x3e')],qs['fields'](_0x2c8d5e['query']['fields']));_0x4cbc01[_0x31cf('0x3f')]=_0x4cbc01[_0x31cf('0x3f')][_0x31cf('0x40')]?_0x4cbc01[_0x31cf('0x3f')]:_0x426846[_0x31cf('0x3e')];if(!_0x2c8d5e['query']['hasOwnProperty']('nolimit')){_0x4cbc01[_0x31cf('0x22')]=qs[_0x31cf('0x22')](_0x2c8d5e[_0x31cf('0x3b')]['limit']);_0x4cbc01[_0x31cf('0x21')]=qs[_0x31cf('0x21')](_0x2c8d5e[_0x31cf('0x3b')][_0x31cf('0x21')]);}_0x4cbc01[_0x31cf('0x41')]=qs[_0x31cf('0x42')](_0x2c8d5e['query'][_0x31cf('0x42')]);_0x4cbc01[_0x31cf('0x43')]=qs[_0x31cf('0x3c')](_[_0x31cf('0x44')](_0x2c8d5e[_0x31cf('0x3b')],_0x426846[_0x31cf('0x3c')]),_0xd03d93);if(_0x2c8d5e[_0x31cf('0x3b')][_0x31cf('0x45')]){_0x4cbc01[_0x31cf('0x43')]=_['merge'](_0x4cbc01[_0x31cf('0x43')],{'$or':_['map'](_0xd03d93,function(_0x5cf29f){if(_0x5cf29f[_0x31cf('0x39')]!==_0x31cf('0x46')){var _0x17cb02={};_0x17cb02[_0x5cf29f[_0x31cf('0x32')]]={'$like':'%'+_0x2c8d5e['query'][_0x31cf('0x45')]+'%'};return _0x17cb02;}})});}_0x4cbc01=_[_0x31cf('0x47')]({},_0x4cbc01,_0x2c8d5e[_0x31cf('0x48')]);var _0xac6476={'where':_0x4cbc01[_0x31cf('0x43')]};return db[_0x31cf('0x36')]['count'](_0xac6476)['then'](function(_0x44c1b2){_0x45dc4e[_0x31cf('0x23')]=_0x44c1b2;if(_0x2c8d5e[_0x31cf('0x3b')][_0x31cf('0x49')]){_0x4cbc01[_0x31cf('0x4a')]=[{'all':!![]}];}return db[_0x31cf('0x36')][_0x31cf('0x4b')](_0x4cbc01);})[_0x31cf('0x2a')](function(_0x3615da){_0x45dc4e[_0x31cf('0x4c')]=_0x3615da;return _0x45dc4e;})[_0x31cf('0x2a')](respondWithFilteredResult(_0x5d18a8,_0x4cbc01))[_0x31cf('0x4d')](handleError(_0x5d18a8,null));};exports[_0x31cf('0x4e')]=function(_0x3df359,_0xf75635){var _0x515a71={'raw':!![],'where':{'id':_0x3df359[_0x31cf('0x4f')]['id']}},_0x147c0e={};_0x147c0e['model']=_[_0x31cf('0x50')](db[_0x31cf('0x36')][_0x31cf('0x37')]);_0x147c0e[_0x31cf('0x3b')]=_[_0x31cf('0x50')](_0x3df359[_0x31cf('0x3b')]);_0x147c0e[_0x31cf('0x3c')]=_[_0x31cf('0x3d')](_0x147c0e[_0x31cf('0x3e')],_0x147c0e[_0x31cf('0x3b')]);_0x515a71[_0x31cf('0x3f')]=_[_0x31cf('0x3d')](_0x147c0e[_0x31cf('0x3e')],qs[_0x31cf('0x51')](_0x3df359[_0x31cf('0x3b')]['fields']));_0x515a71['attributes']=_0x515a71['attributes']['length']?_0x515a71[_0x31cf('0x3f')]:_0x147c0e[_0x31cf('0x3e')];if(_0x3df359[_0x31cf('0x3b')]['includeAll']){_0x515a71[_0x31cf('0x4a')]=[{'all':!![]}];}_0x515a71=_[_0x31cf('0x47')]({},_0x515a71,_0x3df359[_0x31cf('0x48')]);return db['MailQueue'][_0x31cf('0x52')](_0x515a71)[_0x31cf('0x2a')](handleEntityNotFound(_0xf75635,null))[_0x31cf('0x2a')](respondWithResult(_0xf75635,null))['catch'](handleError(_0xf75635,null));};exports['create']=function(_0x131cdd,_0x2a2e9c){return db['MailQueue'][_0x31cf('0x53')](_0x131cdd[_0x31cf('0x54')],{})['then'](function(_0x5a9f3c){var _0x1ee5b1=_0x131cdd[_0x31cf('0x55')][_0x31cf('0x2c')]({'plain':!![]});if(!_0x1ee5b1)throw new Error(_0x31cf('0x56'));if(_0x1ee5b1[_0x31cf('0x57')]===_0x31cf('0x55')){var _0x433fef=_0x5a9f3c[_0x31cf('0x2c')]({'plain':!![]});var _0x2baaf3=_0x31cf('0x2d');return db[_0x31cf('0x58')]['find']({'where':{'name':_0x2baaf3,'userProfileId':_0x1ee5b1['userProfileId']},'raw':!![]})[_0x31cf('0x2a')](function(_0x5b3002){if(_0x5b3002&&_0x5b3002['autoAssociation']===0x0){return db[_0x31cf('0x2e')]['create']({'name':_0x433fef[_0x31cf('0x32')],'resourceId':_0x433fef['id'],'type':_0x5b3002[_0x31cf('0x32')],'sectionId':_0x5b3002['id']},{})['then'](function(){return _0x5a9f3c;});}else{return _0x5a9f3c;}})[_0x31cf('0x4d')](function(_0x3b4605){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4605);throw _0x3b4605;});}return _0x5a9f3c;})[_0x31cf('0x2a')](respondWithResult(_0x2a2e9c,0xc9))[_0x31cf('0x4d')](handleError(_0x2a2e9c,null));};exports[_0x31cf('0x29')]=function(_0x596aa1,_0x5312b8){if(_0x596aa1[_0x31cf('0x54')]['id']){delete _0x596aa1[_0x31cf('0x54')]['id'];}return db[_0x31cf('0x36')][_0x31cf('0x52')]({'where':{'id':_0x596aa1[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x5312b8,null))['then'](saveUpdates(_0x596aa1['body'],null))[_0x31cf('0x2a')](respondWithResult(_0x5312b8,null))[_0x31cf('0x4d')](handleError(_0x5312b8,null));};exports[_0x31cf('0x2b')]=function(_0x2b07c6,_0x4345ce){return db[_0x31cf('0x36')]['find']({'where':{'id':_0x2b07c6[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x4345ce,null))[_0x31cf('0x2a')](removeEntity(_0x4345ce,null))['catch'](handleError(_0x4345ce,null));};exports['describe']=function(_0x3618fb,_0x29af3f){return db[_0x31cf('0x36')]['describe']()['then'](respondWithResult(_0x29af3f,null))['catch'](handleError(_0x29af3f,null));};exports[_0x31cf('0x59')]=function(_0x636626,_0x2ff477,_0x545853){var _0x372486={'raw':!![],'where':{}},_0x3b9847={},_0x461f3d;return db[_0x31cf('0x36')][_0x31cf('0x5a')]({'where':{'id':_0x636626[_0x31cf('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2ff477,null))['then'](function(_0x58b645){if(_0x58b645){_0x461f3d=_0x58b645[_0x31cf('0x2c')]({'plain':!![]});_0x3b9847[_0x31cf('0x3e')]=_[_0x31cf('0x50')](db[_0x31cf('0x5b')][_0x31cf('0x37')]);_0x3b9847[_0x31cf('0x3b')]=_[_0x31cf('0x50')](_0x636626[_0x31cf('0x3b')]);_0x3b9847[_0x31cf('0x3c')]=_['intersection'](_0x3b9847[_0x31cf('0x3e')],_0x3b9847['query']);_0x372486[_0x31cf('0x3f')]=_['intersection'](_0x3b9847[_0x31cf('0x3e')],qs[_0x31cf('0x51')](_0x636626['query']['fields']));_0x372486['attributes']=_0x372486[_0x31cf('0x3f')][_0x31cf('0x40')]?_0x372486[_0x31cf('0x3f')]:_0x3b9847[_0x31cf('0x3e')];if(!_0x636626[_0x31cf('0x3b')]['hasOwnProperty']('nolimit')){_0x372486[_0x31cf('0x22')]=qs[_0x31cf('0x22')](_0x636626[_0x31cf('0x3b')][_0x31cf('0x22')]);_0x372486[_0x31cf('0x21')]=qs[_0x31cf('0x21')](_0x636626[_0x31cf('0x3b')][_0x31cf('0x21')]);}_0x372486['order']=qs[_0x31cf('0x42')](_0x636626[_0x31cf('0x3b')][_0x31cf('0x42')]);_0x372486['where']=qs[_0x31cf('0x3c')](_['pick'](_0x636626['query'],_0x3b9847['filters']));_0x372486[_0x31cf('0x43')][_0x31cf('0x5c')]=_0x58b645['id'];if(_0x636626[_0x31cf('0x3b')]['filter']){_0x372486['where']=_[_0x31cf('0x47')](_0x372486[_0x31cf('0x43')],{'$or':_[_0x31cf('0x35')](_0x372486[_0x31cf('0x3f')],function(_0x4d7a6c){var _0x12c9c1={};_0x12c9c1[_0x4d7a6c]={'$like':'%'+_0x636626[_0x31cf('0x3b')]['filter']+'%'};return _0x12c9c1;})});}_0x372486=_[_0x31cf('0x47')]({},_0x372486,_0x636626[_0x31cf('0x48')]);return db[_0x31cf('0x5b')][_0x31cf('0x4b')](_0x372486);}})[_0x31cf('0x2a')](function(_0x54ef9c){if(_0x54ef9c){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x54ef9c,_0x31cf('0x5d')),'role':'agent'},'attributes':['id',_0x31cf('0x32'),'mailPause',_0x31cf('0x5e'),_0x31cf('0x5f')]});}})[_0x31cf('0x2a')](function(_0x264872){if(_0x264872){return{'count':_0x264872[_0x31cf('0x23')],'rows':_[_0x31cf('0x35')](_0x264872[_0x31cf('0x4c')],function(_0x4d07ea){return{'membername':_0x4d07ea[_0x31cf('0x32')],'UserId':_0x4d07ea['id'],'queue_name':_0x461f3d[_0x31cf('0x32')],'MailQueueId':_0x461f3d['id'],'interface':util[_0x31cf('0x60')](_0x31cf('0x61'),'SIP',_0x4d07ea[_0x31cf('0x32')]),'penalty':0x0,'paused':_0x4d07ea[_0x31cf('0x62')],'createdAt':_0x4d07ea[_0x31cf('0x5f')],'updatedAt':_0x4d07ea[_0x31cf('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31cf('0x2a')](respondWithFilteredResult(_0x2ff477,_0x372486))['catch'](handleError(_0x2ff477,null));};exports[_0x31cf('0x63')]=function(_0x56d550,_0x3767c1,_0x3c4d7f){var _0x58a63e={};var _0x49126a={};var _0x2b9bc0;var _0x2167fd;return db[_0x31cf('0x36')]['findOne']({'where':{'id':_0x56d550[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x3767c1,null))['then'](function(_0x3a0e08){if(_0x3a0e08){_0x2b9bc0=_0x3a0e08;_0x49126a['model']=_[_0x31cf('0x50')](db[_0x31cf('0x64')][_0x31cf('0x37')]);_0x49126a[_0x31cf('0x3b')]=_[_0x31cf('0x50')](_0x56d550[_0x31cf('0x3b')]);_0x49126a['filters']=_[_0x31cf('0x3d')](_0x49126a['model'],_0x49126a['query']);_0x58a63e[_0x31cf('0x3f')]=_[_0x31cf('0x3d')](_0x49126a[_0x31cf('0x3e')],qs['fields'](_0x56d550[_0x31cf('0x3b')][_0x31cf('0x51')]));_0x58a63e['attributes']=_0x58a63e[_0x31cf('0x3f')][_0x31cf('0x40')]?_0x58a63e['attributes']:_0x49126a['model'];_0x58a63e[_0x31cf('0x41')]=qs[_0x31cf('0x42')](_0x56d550['query'][_0x31cf('0x42')]);_0x58a63e[_0x31cf('0x43')]=qs[_0x31cf('0x3c')](_[_0x31cf('0x44')](_0x56d550[_0x31cf('0x3b')],_0x49126a[_0x31cf('0x3c')]));if(_0x56d550['query'][_0x31cf('0x45')]){_0x58a63e['where']=_[_0x31cf('0x47')](_0x58a63e[_0x31cf('0x43')],{'$or':_[_0x31cf('0x35')](_0x58a63e[_0x31cf('0x3f')],function(_0x440f18){var _0x1c23ab={};_0x1c23ab[_0x440f18]={'$like':'%'+_0x56d550[_0x31cf('0x3b')][_0x31cf('0x45')]+'%'};return _0x1c23ab;})});}_0x58a63e=_[_0x31cf('0x47')]({},_0x58a63e,_0x56d550['options']);return _0x2b9bc0[_0x31cf('0x63')](_0x58a63e);}})[_0x31cf('0x2a')](function(_0x189ba7){if(_0x189ba7){_0x2167fd=_0x189ba7['length'];if(!_0x56d550[_0x31cf('0x3b')][_0x31cf('0x65')]('nolimit')){_0x58a63e[_0x31cf('0x22')]=qs['limit'](_0x56d550['query'][_0x31cf('0x22')]);_0x58a63e[_0x31cf('0x21')]=qs[_0x31cf('0x21')](_0x56d550[_0x31cf('0x3b')]['offset']);}return _0x2b9bc0[_0x31cf('0x63')](_0x58a63e);}})[_0x31cf('0x2a')](function(_0x1f1588){if(_0x1f1588){return _0x1f1588?{'count':_0x2167fd,'rows':_0x1f1588}:null;}})[_0x31cf('0x2a')](respondWithResult(_0x3767c1,null))['catch'](handleError(_0x3767c1,null));};exports[_0x31cf('0x66')]=function(_0x549fe1,_0x3c3b1c,_0x3af613){var _0x36739f=_0x549fe1[_0x31cf('0x54')]['ids'];return db[_0x31cf('0x64')][_0x31cf('0x4b')]({'where':{'id':_0x36739f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x31cf('0x67'),'voicePause',_0x31cf('0x68')],'raw':!![]}]})[_0x31cf('0x2a')](function(_0x3accb1){if(_0x3accb1){var _0x2324b8=_[_0x31cf('0x69')](_0x3accb1,function(_0x2abc0e){var _0x3f9c32=_0x2abc0e[_0x31cf('0x2c')]({'plain':!![]});return _0x3f9c32[_0x31cf('0x6a')];});return db[_0x31cf('0x36')][_0x31cf('0x52')]({'where':{'id':_0x549fe1[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](function(_0x395a93){return db[_0x31cf('0x6b')][_0x31cf('0x6c')](function(_0xc8c7f4){return _0x395a93[_0x31cf('0x66')](_0x36739f,{'transaction':_0xc8c7f4})[_0x31cf('0x2a')](function(){return BPromise[_0x31cf('0x6d')](_0x2324b8,function(_0x591eeb){return db[_0x31cf('0x5b')][_0x31cf('0x6e')]({'where':{'UserId':_0x591eeb['id'],'MailQueueId':_0x549fe1['params']['id']},'transaction':_0xc8c7f4});});})[_0x31cf('0x2a')](function(){_0x2324b8['forEach'](function(_0x48a11b){socket['emit']('userMailQueue:save',{'UserId':_0x48a11b['id'],'MailQueueId':_0x395a93['id']});});});});});}})[_0x31cf('0x2a')](respondWithStatusCode(_0x3c3b1c,null))[_0x31cf('0x4d')](handleError(_0x3c3b1c,null));};exports[_0x31cf('0x6f')]=function(_0x1cc276,_0x11eab7,_0x568e0d){return db[_0x31cf('0x64')][_0x31cf('0x4b')]({'where':{'id':_0x1cc276[_0x31cf('0x3b')][_0x31cf('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x31cf('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11eab7,null))[_0x31cf('0x2a')](function(_0x177cc8){var _0xddef9d=_[_0x31cf('0x35')](_0x177cc8,'id');var _0x332376=[];var _0x4ab4f0=[];var _0x2ecbf7=squel[_0x31cf('0x71')]();_0x2ecbf7[_0x31cf('0x72')](_0x31cf('0x73'))[_0x31cf('0x74')](_0x31cf('0x75'),'tq')['join'](_0x31cf('0x76'),'ut',_0x31cf('0x77'))['where']('MailQueueId\x20=\x20?',_0x1cc276[_0x31cf('0x4f')]['id']);for(var _0x53b6ab=0x0;_0x53b6ab<_0x177cc8['length'];_0x53b6ab+=0x1){let _0x54e8d4=_0x177cc8[_0x53b6ab];for(var _0x134948=0x0;_0x134948<_0x54e8d4[_0x31cf('0x6a')][_0x31cf('0x40')];_0x134948+=0x1){let _0xc50dbf=_0x54e8d4[_0x31cf('0x6a')][_0x134948];var _0x3fc4b2=_0x2ecbf7[_0x31cf('0x78')]();_0x3fc4b2[_0x31cf('0x43')](_0x31cf('0x79'),_0xc50dbf['id']);_0x4ab4f0['push'](db[_0x31cf('0x6b')][_0x31cf('0x3b')](_0x3fc4b2[_0x31cf('0x7a')](),{'type':db[_0x31cf('0x6b')][_0x31cf('0x7b')][_0x31cf('0x7c')]})[_0x31cf('0x2a')](function(_0x358507){if(_0x358507['length']===0x1){return _0xc50dbf['id'];}else{var _0x23f17e=_[_0x31cf('0x7d')](_[_0x31cf('0x35')](_0x358507,_0x31cf('0x7e')),function(_0xed97dc){return _[_0x31cf('0x7f')](_0xddef9d,_0xed97dc);});if(_0x23f17e){return _0xc50dbf['id'];}}}));}}return BPromise['all'](_0x4ab4f0)['then'](function(_0x987015){_0x332376=_(_0x332376)[_0x31cf('0x80')](_0x987015)[_0x31cf('0x81')]()[_0x31cf('0x82')]();return db[_0x31cf('0x36')][_0x31cf('0x52')]({'where':{'id':_0x1cc276['params']['id']}})[_0x31cf('0x2a')](function(_0x1726a4){return db[_0x31cf('0x6b')][_0x31cf('0x6c')](function(_0x3aa6bf){return _0x1726a4[_0x31cf('0x6f')](_0x1cc276[_0x31cf('0x3b')][_0x31cf('0x70')],{'transaction':_0x3aa6bf})[_0x31cf('0x2a')](function(){if(!_['isEmpty'](_0x332376)){return _0x1726a4[_0x31cf('0x83')](_0x332376,{'transaction':_0x3aa6bf});}})[_0x31cf('0x2a')](function(){_0x332376[_0x31cf('0x84')](function(_0xf1adc0){socket['emit'](_0x31cf('0x85'),{'UserId':_0xf1adc0,'MailQueueId':_0x1726a4['id']});});});});});});})[_0x31cf('0x2a')](respondWithStatusCode(_0x11eab7,null))[_0x31cf('0x4d')](handleError(_0x11eab7,null));};exports[_0x31cf('0x86')]=function(_0x5d5f3c,_0x55d9dd,_0x322dd8){return db[_0x31cf('0x36')]['find']({'where':{'id':_0x5d5f3c[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x55d9dd,null))[_0x31cf('0x2a')](function(_0x59245d){if(_0x59245d){return _0x59245d[_0x31cf('0x86')](_0x5d5f3c[_0x31cf('0x54')]['ids'],_['omit'](_0x5d5f3c['body'],[_0x31cf('0x70'),'id'])||{})['spread'](function(_0x2f972c){for(var _0x2bdfef=0x0;_0x2bdfef<_0x5d5f3c[_0x31cf('0x54')][_0x31cf('0x70')][_0x31cf('0x40')];_0x2bdfef+=0x1){socket[_0x31cf('0x87')](_0x31cf('0x88'),{'UserId':Number(_0x5d5f3c['body']['ids'][_0x2bdfef]),'MailQueueId':Number(_0x5d5f3c[_0x31cf('0x4f')]['id'])});}return _0x2f972c;});}})[_0x31cf('0x2a')](respondWithResult(_0x55d9dd,null))[_0x31cf('0x4d')](handleError(_0x55d9dd,null));};exports[_0x31cf('0x83')]=function(_0x448966,_0x2b7104,_0x299ae6){return db[_0x31cf('0x36')]['find']({'where':{'id':_0x448966[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x2b7104,null))[_0x31cf('0x2a')](function(_0x5d6b06){if(_0x5d6b06){return _0x5d6b06[_0x31cf('0x83')](_0x448966[_0x31cf('0x3b')][_0x31cf('0x70')])['then'](function(){if(_[_0x31cf('0x89')](_0x448966[_0x31cf('0x3b')][_0x31cf('0x70')])){for(var _0x5b2827=0x0;_0x5b2827<_0x448966['query'][_0x31cf('0x70')]['length'];_0x5b2827+=0x1){socket[_0x31cf('0x87')](_0x31cf('0x85'),{'UserId':Number(_0x448966[_0x31cf('0x3b')]['ids'][_0x5b2827]),'MailQueueId':Number(_0x448966['params']['id'])});}}else{socket[_0x31cf('0x87')](_0x31cf('0x85'),{'UserId':Number(_0x448966[_0x31cf('0x3b')]['ids']),'MailQueueId':Number(_0x448966[_0x31cf('0x4f')]['id'])});}});}})[_0x31cf('0x2a')](respondWithStatusCode(_0x2b7104,null))[_0x31cf('0x4d')](handleError(_0x2b7104,null));};exports[_0x31cf('0x8a')]=function(_0x12f9c3,_0x47e8f3,_0x45e712){var _0xb064cd={};var _0x48e84c={};var _0x4e820f;var _0x578187;return db[_0x31cf('0x36')][_0x31cf('0x5a')]({'where':{'id':_0x12f9c3[_0x31cf('0x4f')]['id']}})[_0x31cf('0x2a')](handleEntityNotFound(_0x47e8f3,null))[_0x31cf('0x2a')](function(_0x5b5be3){if(_0x5b5be3){_0x4e820f=_0x5b5be3;_0x48e84c[_0x31cf('0x3e')]=_[_0x31cf('0x50')](db[_0x31cf('0x8b')]['rawAttributes']);_0x48e84c['query']=_['keys'](_0x12f9c3[_0x31cf('0x3b')]);_0x48e84c['filters']=_[_0x31cf('0x3d')](_0x48e84c[_0x31cf('0x3e')],_0x48e84c[_0x31cf('0x3b')]);_0xb064cd[_0x31cf('0x3f')]=_['intersection'](_0x48e84c[_0x31cf('0x3e')],qs[_0x31cf('0x51')](_0x12f9c3['query'][_0x31cf('0x51')]));_0xb064cd[_0x31cf('0x3f')]=_0xb064cd[_0x31cf('0x3f')][_0x31cf('0x40')]?_0xb064cd[_0x31cf('0x3f')]:_0x48e84c[_0x31cf('0x3e')];_0xb064cd[_0x31cf('0x41')]=qs[_0x31cf('0x42')](_0x12f9c3[_0x31cf('0x3b')][_0x31cf('0x42')]);_0xb064cd[_0x31cf('0x43')]=qs[_0x31cf('0x3c')](_['pick'](_0x12f9c3[_0x31cf('0x3b')],_0x48e84c['filters']));if(_0x12f9c3[_0x31cf('0x3b')][_0x31cf('0x45')]){_0xb064cd[_0x31cf('0x43')]=_[_0x31cf('0x47')](_0xb064cd['where'],{'$or':_[_0x31cf('0x35')](_0xb064cd['attributes'],function(_0x1138b7){var _0x4f0290={};_0x4f0290[_0x1138b7]={'$like':'%'+_0x12f9c3[_0x31cf('0x3b')][_0x31cf('0x45')]+'%'};return _0x4f0290;})});}_0xb064cd=_['merge']({},_0xb064cd,_0x12f9c3[_0x31cf('0x48')]);return _0x4e820f[_0x31cf('0x8a')](_0xb064cd);}})[_0x31cf('0x2a')](function(_0x566235){if(_0x566235){_0x578187=_0x566235['length'];if(!_0x12f9c3['query']['hasOwnProperty'](_0x31cf('0x8c'))){_0xb064cd['limit']=qs[_0x31cf('0x22')](_0x12f9c3[_0x31cf('0x3b')]['limit']);_0xb064cd[_0x31cf('0x21')]=qs[_0x31cf('0x21')](_0x12f9c3['query'][_0x31cf('0x21')]);}return _0x4e820f[_0x31cf('0x8a')](_0xb064cd);}})[_0x31cf('0x2a')](function(_0x46d8a9){if(_0x46d8a9){return _0x46d8a9?{'count':_0x578187,'rows':_0x46d8a9}:null;}})[_0x31cf('0x2a')](respondWithResult(_0x47e8f3,null))['catch'](handleError(_0x47e8f3,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d92503e..1be48b4 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 _0x29bf=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x3ff898,_0x5b82a7){var _0x50b486=function(_0x509e6c){while(--_0x509e6c){_0x3ff898['push'](_0x3ff898['shift']());}};_0x50b486(++_0x5b82a7);}(_0x29bf,0x1c6));var _0xf29b=function(_0x742518,_0xdd4196){_0x742518=_0x742518-0x0;var _0x10fc3f=_0x29bf[_0x742518];return _0x10fc3f;};'use strict';var EventEmitter=require(_0xf29b('0x0'));var MailQueue=require(_0xf29b('0x1'))['db'][_0xf29b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf29b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf29b('0x4'),'afterDestroy':_0xf29b('0x5')};function emitEvent(_0x3ac444){return function(_0x219d2d,_0x32fd5e,_0x3b36a0){MailQueueEvents[_0xf29b('0x6')](_0x3ac444+':'+_0x219d2d['id'],_0x219d2d);MailQueueEvents[_0xf29b('0x6')](_0x3ac444,_0x219d2d);_0x3b36a0(null);};}for(var e in events){if(events[_0xf29b('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xf29b('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x51c0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x217e5d,_0x170ad5){var _0x2ac399=function(_0x34cf1e){while(--_0x34cf1e){_0x217e5d['push'](_0x217e5d['shift']());}};_0x2ac399(++_0x170ad5);}(_0x51c0,0xa5));var _0x051c=function(_0x47b496,_0x20dd8b){_0x47b496=_0x47b496-0x0;var _0xae703d=_0x51c0[_0x47b496];return _0xae703d;};'use strict';var EventEmitter=require(_0x051c('0x0'));var MailQueue=require(_0x051c('0x1'))['db'][_0x051c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x051c('0x3')](0x0);var events={'afterCreate':_0x051c('0x4'),'afterUpdate':'update','afterDestroy':_0x051c('0x5')};function emitEvent(_0x85eddc){return function(_0xfc77c1,_0x1ce9c5,_0x216c44){MailQueueEvents[_0x051c('0x6')](_0x85eddc+':'+_0xfc77c1['id'],_0xfc77c1);MailQueueEvents['emit'](_0x85eddc,_0xfc77c1);_0x216c44(null);};}for(var e in events){if(events[_0x051c('0x7')](e)){var event=events[e];MailQueue[_0x051c('0x8')](e,emitEvent(event));}}module[_0x051c('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index a77d0d4..170af99 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 _0x1137=['rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','moment','bluebird','request-promise','path'];(function(_0x283da6,_0x4ed596){var _0x2125cb=function(_0x40bc73){while(--_0x40bc73){_0x283da6['push'](_0x283da6['shift']());}};_0x2125cb(++_0x4ed596);}(_0x1137,0x13b));var _0x7113=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x1137[_0x3ff4a3];return _0x38676f;};'use strict';var _=require(_0x7113('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7113('0x1'));var BPromise=require(_0x7113('0x2'));var rp=require(_0x7113('0x3'));var fs=require('fs');var path=require(_0x7113('0x4'));var rimraf=require(_0x7113('0x5'));var config=require(_0x7113('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x472b72,_0x420727){return _0x472b72[_0x7113('0x7')](_0x7113('0x8'),attributes,{'tableName':_0x7113('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd05b=['api','moment','request-promise','path','../../config/environment','MailQueue','mail_queues','lodash','../../config/logger'];(function(_0x5b959e,_0x28debf){var _0x11df5a=function(_0x1bcd63){while(--_0x1bcd63){_0x5b959e['push'](_0x5b959e['shift']());}};_0x11df5a(++_0x28debf);}(_0xd05b,0xf1));var _0xbd05=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xd05b[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xbd05('0x0'));var util=require('util');var logger=require(_0xbd05('0x1'))(_0xbd05('0x2'));var moment=require(_0xbd05('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd05('0x4'));var fs=require('fs');var path=require(_0xbd05('0x5'));var rimraf=require('rimraf');var config=require(_0xbd05('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x17c72b,_0x5532de){return _0x17c72b['define'](_0xbd05('0x7'),attributes,{'tableName':_0xbd05('0x8'),'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 3daa9d3..b9d5ab7 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 _0xdbfc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','map','model','attributes','ShowMailQueue','find','where','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x731b12,_0x2ddda9){_0x731b12=_0x731b12-0x0;var _0xf2f99c=_0xdbfc[_0x731b12];return _0xf2f99c;};'use strict';var _=require(_0xcdbf('0x0'));var util=require(_0xcdbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdbf('0x2'));var fs=require('fs');var Redis=require(_0xcdbf('0x3'));var db=require(_0xcdbf('0x4'))['db'];var utils=require(_0xcdbf('0x5'));var logger=require(_0xcdbf('0x6'))(_0xcdbf('0x7'));var config=require(_0xcdbf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcdbf('0x9')][_0xcdbf('0xa')]({'port':0x232a});config['redis']=_[_0xcdbf('0xb')](config[_0xcdbf('0xc')],{'host':_0xcdbf('0xd'),'port':0x18eb});var socket=require(_0xcdbf('0xe'))(new Redis(config['redis']));require(_0xcdbf('0xf'))[_0xcdbf('0x10')](socket);function respondWithRpcPromise(_0x4088ce,_0x248e7f,_0x8a0230){return new BPromise(function(_0x4ad1d8,_0x3b6fb4){return client['request'](_0x4088ce,_0x8a0230)[_0xcdbf('0x11')](function(_0x55c7e8){logger[_0xcdbf('0x12')]('MailQueue,\x20%s,\x20%s',_0x248e7f,_0xcdbf('0x13'));logger[_0xcdbf('0x14')](_0xcdbf('0x15'),_0x248e7f,'request\x20sent',JSON[_0xcdbf('0x16')](_0x55c7e8));if(_0x55c7e8['error']){if(_0x55c7e8[_0xcdbf('0x17')][_0xcdbf('0x18')]===0x1f4){logger[_0xcdbf('0x17')](_0xcdbf('0x19'),_0x248e7f,_0x55c7e8[_0xcdbf('0x17')]['message']);return _0x3b6fb4(_0x55c7e8[_0xcdbf('0x17')][_0xcdbf('0x1a')]);}logger[_0xcdbf('0x17')](_0xcdbf('0x19'),_0x248e7f,_0x55c7e8[_0xcdbf('0x17')][_0xcdbf('0x1a')]);return _0x4ad1d8(_0x55c7e8[_0xcdbf('0x17')][_0xcdbf('0x1a')]);}else{logger[_0xcdbf('0x12')](_0xcdbf('0x19'),_0x248e7f,_0xcdbf('0x13'));_0x4ad1d8(_0x55c7e8['result'][_0xcdbf('0x1a')]);}})[_0xcdbf('0x1b')](function(_0x264e30){logger[_0xcdbf('0x17')](_0xcdbf('0x19'),_0x248e7f,_0x264e30);_0x3b6fb4(_0x264e30);});});}exports[_0xcdbf('0x1c')]=function(_0x541e97){var _0x2c37b1=this;return new Promise(function(_0x13ab9b,_0x41458b){return db[_0xcdbf('0x1d')][_0xcdbf('0x1e')]({'raw':_0x541e97['options']?_0x541e97[_0xcdbf('0x1f')][_0xcdbf('0x20')]===undefined?!![]:![]:!![],'where':_0x541e97[_0xcdbf('0x1f')]?_0x541e97[_0xcdbf('0x1f')]['where']||null:null,'attributes':_0x541e97[_0xcdbf('0x1f')]?_0x541e97['options']['attributes']||null:null,'limit':_0x541e97[_0xcdbf('0x1f')]?_0x541e97['options'][_0xcdbf('0x21')]||null:null,'include':_0x541e97[_0xcdbf('0x1f')]?_0x541e97[_0xcdbf('0x1f')][_0xcdbf('0x22')]?_[_0xcdbf('0x23')](_0x541e97['options'][_0xcdbf('0x22')],function(_0x102f5c){return{'model':db[_0x102f5c[_0xcdbf('0x24')]],'as':_0x102f5c['as'],'attributes':_0x102f5c[_0xcdbf('0x25')],'include':_0x102f5c[_0xcdbf('0x22')]?_[_0xcdbf('0x23')](_0x102f5c[_0xcdbf('0x22')],function(_0x596fe9){return{'model':db[_0x596fe9[_0xcdbf('0x24')]],'as':_0x596fe9['as'],'attributes':_0x596fe9[_0xcdbf('0x25')],'include':_0x596fe9[_0xcdbf('0x22')]?_[_0xcdbf('0x23')](_0x596fe9[_0xcdbf('0x22')],function(_0x48f4a){return{'model':db[_0x48f4a[_0xcdbf('0x24')]],'as':_0x48f4a['as'],'attributes':_0x48f4a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdbf('0x11')](function(_0x2fa55a){logger[_0xcdbf('0x12')](_0xcdbf('0x1c'),_0x541e97);logger[_0xcdbf('0x14')]('GetMailQueue',_0x541e97,JSON[_0xcdbf('0x16')](_0x2fa55a));_0x13ab9b(_0x2fa55a);})[_0xcdbf('0x1b')](function(_0xcc7e4e){logger[_0xcdbf('0x17')](_0xcdbf('0x1c'),_0xcc7e4e[_0xcdbf('0x1a')],_0x541e97);_0x41458b(_0x2c37b1['error'](0x1f4,_0xcc7e4e[_0xcdbf('0x1a')]));});});};exports[_0xcdbf('0x26')]=function(_0x39e439){var _0x39e327=this;return new Promise(function(_0x2e7ad5,_0x517324){return db[_0xcdbf('0x1d')][_0xcdbf('0x27')]({'raw':_0x39e439[_0xcdbf('0x1f')]?_0x39e439[_0xcdbf('0x1f')][_0xcdbf('0x20')]===undefined?!![]:![]:!![],'where':_0x39e439[_0xcdbf('0x1f')]?_0x39e439[_0xcdbf('0x1f')][_0xcdbf('0x28')]||null:null,'attributes':_0x39e439[_0xcdbf('0x1f')]?_0x39e439[_0xcdbf('0x1f')]['attributes']||null:null,'include':_0x39e439['options']?_0x39e439[_0xcdbf('0x1f')][_0xcdbf('0x22')]?_[_0xcdbf('0x23')](_0x39e439['options'][_0xcdbf('0x22')],function(_0x40c17d){return{'model':db[_0x40c17d[_0xcdbf('0x24')]],'as':_0x40c17d['as'],'attributes':_0x40c17d[_0xcdbf('0x25')],'include':_0x40c17d[_0xcdbf('0x22')]?_[_0xcdbf('0x23')](_0x40c17d[_0xcdbf('0x22')],function(_0x3650ac){return{'model':db[_0x3650ac['model']],'as':_0x3650ac['as'],'attributes':_0x3650ac[_0xcdbf('0x25')],'include':_0x3650ac['include']?_[_0xcdbf('0x23')](_0x3650ac['include'],function(_0x13868c){return{'model':db[_0x13868c[_0xcdbf('0x24')]],'as':_0x13868c['as'],'attributes':_0x13868c[_0xcdbf('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcdbf('0x11')](function(_0x548907){logger[_0xcdbf('0x12')](_0xcdbf('0x26'),_0x39e439);logger[_0xcdbf('0x14')](_0xcdbf('0x26'),_0x39e439,JSON[_0xcdbf('0x16')](_0x548907));_0x2e7ad5(_0x548907);})['catch'](function(_0x907f4d){logger[_0xcdbf('0x17')](_0xcdbf('0x26'),_0x907f4d[_0xcdbf('0x1a')],_0x39e439);_0x517324(_0x39e327['error'](0x1f4,_0x907f4d[_0xcdbf('0x1a')]));});});}; \ No newline at end of file +var _0x3c60=['localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','attributes','limit','include','model','GetMailQueue','ShowMailQueue','find','raw','where','map','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis'];(function(_0x2528c6,_0x478b23){var _0x3b2325=function(_0x426400){while(--_0x426400){_0x2528c6['push'](_0x2528c6['shift']());}};_0x3b2325(++_0x478b23);}(_0x3c60,0x14c));var _0x03c6=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x3c60[_0x4eaa4c];return _0x15aec6;};'use strict';var _=require('lodash');var util=require(_0x03c6('0x0'));var moment=require(_0x03c6('0x1'));var BPromise=require(_0x03c6('0x2'));var rs=require(_0x03c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03c6('0x4'))('rpc');var config=require(_0x03c6('0x5'));var jayson=require(_0x03c6('0x6'));var client=jayson['client'][_0x03c6('0x7')]({'port':0x232a});config['redis']=_[_0x03c6('0x8')](config[_0x03c6('0x9')],{'host':_0x03c6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03c6('0x9')]));require('./mailQueue.socket')[_0x03c6('0xb')](socket);function respondWithRpcPromise(_0x495545,_0x3f78c6,_0x17fd2f){return new BPromise(function(_0x1b9283,_0x2dace8){return client[_0x03c6('0xc')](_0x495545,_0x17fd2f)[_0x03c6('0xd')](function(_0x308604){logger[_0x03c6('0xe')](_0x03c6('0xf'),_0x3f78c6,_0x03c6('0x10'));logger[_0x03c6('0x11')](_0x03c6('0x12'),_0x3f78c6,_0x03c6('0x10'),JSON[_0x03c6('0x13')](_0x308604));if(_0x308604['error']){if(_0x308604[_0x03c6('0x14')][_0x03c6('0x15')]===0x1f4){logger[_0x03c6('0x14')]('MailQueue,\x20%s,\x20%s',_0x3f78c6,_0x308604[_0x03c6('0x14')][_0x03c6('0x16')]);return _0x2dace8(_0x308604[_0x03c6('0x14')][_0x03c6('0x16')]);}logger[_0x03c6('0x14')](_0x03c6('0xf'),_0x3f78c6,_0x308604[_0x03c6('0x14')][_0x03c6('0x16')]);return _0x1b9283(_0x308604[_0x03c6('0x14')][_0x03c6('0x16')]);}else{logger[_0x03c6('0xe')](_0x03c6('0xf'),_0x3f78c6,_0x03c6('0x10'));_0x1b9283(_0x308604[_0x03c6('0x17')][_0x03c6('0x16')]);}})[_0x03c6('0x18')](function(_0x3848da){logger[_0x03c6('0x14')](_0x03c6('0xf'),_0x3f78c6,_0x3848da);_0x2dace8(_0x3848da);});});}exports['GetMailQueue']=function(_0x614768){var _0x56f8e3=this;return new Promise(function(_0x3c1b23,_0x3f3b86){return db[_0x03c6('0x19')][_0x03c6('0x1a')]({'raw':_0x614768[_0x03c6('0x1b')]?_0x614768[_0x03c6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x614768[_0x03c6('0x1b')]?_0x614768['options']['where']||null:null,'attributes':_0x614768['options']?_0x614768['options'][_0x03c6('0x1c')]||null:null,'limit':_0x614768[_0x03c6('0x1b')]?_0x614768[_0x03c6('0x1b')][_0x03c6('0x1d')]||null:null,'include':_0x614768['options']?_0x614768[_0x03c6('0x1b')][_0x03c6('0x1e')]?_['map'](_0x614768[_0x03c6('0x1b')][_0x03c6('0x1e')],function(_0x3ab933){return{'model':db[_0x3ab933[_0x03c6('0x1f')]],'as':_0x3ab933['as'],'attributes':_0x3ab933[_0x03c6('0x1c')],'include':_0x3ab933[_0x03c6('0x1e')]?_['map'](_0x3ab933[_0x03c6('0x1e')],function(_0x15db4a){return{'model':db[_0x15db4a[_0x03c6('0x1f')]],'as':_0x15db4a['as'],'attributes':_0x15db4a[_0x03c6('0x1c')],'include':_0x15db4a[_0x03c6('0x1e')]?_['map'](_0x15db4a[_0x03c6('0x1e')],function(_0x4005c0){return{'model':db[_0x4005c0['model']],'as':_0x4005c0['as'],'attributes':_0x4005c0['attributes']};}):[]};}):[]};}):[]:[]})[_0x03c6('0xd')](function(_0x469bbd){logger[_0x03c6('0xe')](_0x03c6('0x20'),_0x614768);logger[_0x03c6('0x11')](_0x03c6('0x20'),_0x614768,JSON['stringify'](_0x469bbd));_0x3c1b23(_0x469bbd);})[_0x03c6('0x18')](function(_0x3acf49){logger[_0x03c6('0x14')](_0x03c6('0x20'),_0x3acf49['message'],_0x614768);_0x3f3b86(_0x56f8e3[_0x03c6('0x14')](0x1f4,_0x3acf49['message']));});});};exports[_0x03c6('0x21')]=function(_0x561a37){var _0x282148=this;return new Promise(function(_0x3262f9,_0xe980c7){return db[_0x03c6('0x19')][_0x03c6('0x22')]({'raw':_0x561a37[_0x03c6('0x1b')]?_0x561a37['options'][_0x03c6('0x23')]===undefined?!![]:![]:!![],'where':_0x561a37[_0x03c6('0x1b')]?_0x561a37[_0x03c6('0x1b')][_0x03c6('0x24')]||null:null,'attributes':_0x561a37['options']?_0x561a37[_0x03c6('0x1b')]['attributes']||null:null,'include':_0x561a37['options']?_0x561a37[_0x03c6('0x1b')][_0x03c6('0x1e')]?_[_0x03c6('0x25')](_0x561a37[_0x03c6('0x1b')][_0x03c6('0x1e')],function(_0x514a13){return{'model':db[_0x514a13[_0x03c6('0x1f')]],'as':_0x514a13['as'],'attributes':_0x514a13[_0x03c6('0x1c')],'include':_0x514a13[_0x03c6('0x1e')]?_[_0x03c6('0x25')](_0x514a13[_0x03c6('0x1e')],function(_0x3ed433){return{'model':db[_0x3ed433[_0x03c6('0x1f')]],'as':_0x3ed433['as'],'attributes':_0x3ed433[_0x03c6('0x1c')],'include':_0x3ed433[_0x03c6('0x1e')]?_['map'](_0x3ed433[_0x03c6('0x1e')],function(_0x544e9d){return{'model':db[_0x544e9d['model']],'as':_0x544e9d['as'],'attributes':_0x544e9d[_0x03c6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x03c6('0xd')](function(_0x1a4bae){logger[_0x03c6('0xe')](_0x03c6('0x21'),_0x561a37);logger[_0x03c6('0x11')](_0x03c6('0x21'),_0x561a37,JSON[_0x03c6('0x13')](_0x1a4bae));_0x3262f9(_0x1a4bae);})[_0x03c6('0x18')](function(_0x5cce34){logger[_0x03c6('0x14')](_0x03c6('0x21'),_0x5cce34[_0x03c6('0x16')],_0x561a37);_0xe980c7(_0x282148['error'](0x1f4,_0x5cce34[_0x03c6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 14fb9ae..ac2f967 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 _0x70b7=['removeListener','register','mailQueue:','save','update','emit'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x70b7,0x1e9));var _0x770b=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x70b7[_0x1db251];return _0x56685a;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x770b('0x0'),'remove',_0x770b('0x1')];function createListener(_0x2e1e5a,_0x309633){return function(_0x3a03f2){_0x309633[_0x770b('0x2')](_0x2e1e5a,_0x3a03f2);};}function removeListener(_0x51dfe9,_0x50d706){return function(){MailQueueEvents[_0x770b('0x3')](_0x51dfe9,_0x50d706);};}exports[_0x770b('0x4')]=function(_0x4938dc){for(var _0x36113c=0x0,_0x49e54d=events['length'];_0x36113c<_0x49e54d;_0x36113c++){var _0x2ca061=events[_0x36113c];var _0x5d8632=createListener(_0x770b('0x5')+_0x2ca061,_0x4938dc);MailQueueEvents['on'](_0x2ca061,_0x5d8632);}}; \ No newline at end of file +var _0x100e=['remove','update','removeListener','register','length','mailQueue:','save'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0x100e,0xdf));var _0xe100=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x100e[_0xa6cc5c];return _0x44803d;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xe100('0x0'),_0xe100('0x1'),_0xe100('0x2')];function createListener(_0x7b7e09,_0x5bb60d){return function(_0xe34bdf){_0x5bb60d['emit'](_0x7b7e09,_0xe34bdf);};}function removeListener(_0x5d4f4d,_0x9a95ad){return function(){MailQueueEvents[_0xe100('0x3')](_0x5d4f4d,_0x9a95ad);};}exports[_0xe100('0x4')]=function(_0x5f3e35){for(var _0xdac11e=0x0,_0x402bfa=events[_0xe100('0x5')];_0xdac11e<_0x402bfa;_0xdac11e++){var _0xd8e3ca=events[_0xdac11e];var _0x1bb71a=createListener(_0xe100('0x6')+_0xd8e3ca,_0x5f3e35);MailQueueEvents['on'](_0xd8e3ca,_0x1bb71a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 028553d..19b5190 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 _0x184b=['describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated'];(function(_0x405f1c,_0x59aa04){var _0x464bfd=function(_0x3ebd2d){while(--_0x3ebd2d){_0x405f1c['push'](_0x405f1c['shift']());}};_0x464bfd(++_0x59aa04);}(_0x184b,0x162));var _0xb184=function(_0xbd273b,_0x1f729f){_0xbd273b=_0xbd273b-0x0;var _0x49e94e=_0x184b[_0xbd273b];return _0x49e94e;};'use strict';var multer=require('multer');var util=require(_0xb184('0x0'));var path=require(_0xb184('0x1'));var timeout=require(_0xb184('0x2'));var express=require(_0xb184('0x3'));var router=express[_0xb184('0x4')]();var fs_extra=require(_0xb184('0x5'));var auth=require(_0xb184('0x6'));var interaction=require(_0xb184('0x7'));var config=require(_0xb184('0x8'));var controller=require(_0xb184('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb184('0xa')]);router[_0xb184('0xb')](_0xb184('0xc'),auth[_0xb184('0xd')](),controller[_0xb184('0xe')]);router[_0xb184('0xb')](_0xb184('0xf'),auth[_0xb184('0xd')](),controller[_0xb184('0x10')]);router[_0xb184('0x11')]('/',auth[_0xb184('0xd')](),controller[_0xb184('0x12')]);router[_0xb184('0x13')](_0xb184('0xf'),auth[_0xb184('0xd')](),controller['update']);router[_0xb184('0x14')](_0xb184('0xf'),auth[_0xb184('0xd')](),controller[_0xb184('0x15')]);module[_0xb184('0x16')]=router; \ No newline at end of file +var _0x6256=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/:id','show','post','put','update','delete','exports','multer','util','path','Router'];(function(_0x18b232,_0x3cd1e9){var _0x303efe=function(_0xac931d){while(--_0xac931d){_0x18b232['push'](_0x18b232['shift']());}};_0x303efe(++_0x3cd1e9);}(_0x6256,0xd4));var _0x6625=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x6256[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x6625('0x0'));var util=require(_0x6625('0x1'));var path=require(_0x6625('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6625('0x3')]();var fs_extra=require(_0x6625('0x4'));var auth=require(_0x6625('0x5'));var interaction=require(_0x6625('0x6'));var config=require(_0x6625('0x7'));var controller=require(_0x6625('0x8'));router['get']('/',auth[_0x6625('0x9')](),controller['index']);router[_0x6625('0xa')]('/describe',auth[_0x6625('0x9')](),controller['describe']);router[_0x6625('0xa')](_0x6625('0xb'),auth[_0x6625('0x9')](),controller[_0x6625('0xc')]);router[_0x6625('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6625('0xe')]('/:id',auth[_0x6625('0x9')](),controller[_0x6625('0xf')]);router[_0x6625('0x10')](_0x6625('0xb'),auth[_0x6625('0x9')](),controller['destroy']);module[_0x6625('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ded8565..d82d8e9 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 _0x227a=['sequelize','exports','STRING','DATE','moment'];(function(_0x11c406,_0x1131af){var _0x430ca3=function(_0x13fbee){while(--_0x13fbee){_0x11c406['push'](_0x11c406['shift']());}};_0x430ca3(++_0x1131af);}(_0x227a,0x1b2));var _0xa227=function(_0x1ba8fb,_0x14cd6c){_0x1ba8fb=_0x1ba8fb-0x0;var _0x56998a=_0x227a[_0x1ba8fb];return _0x56998a;};'use strict';var moment=require(_0xa227('0x0'));var Sequelize=require(_0xa227('0x1'));module[_0xa227('0x2')]={'uniqueid':{'type':Sequelize[_0xa227('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa227('0x3')]},'joinAt':{'type':Sequelize[_0xa227('0x4')]},'leaveAt':{'type':Sequelize[_0xa227('0x4')]},'acceptAt':{'type':Sequelize[_0xa227('0x4')]},'exitAt':{'type':Sequelize[_0xa227('0x4')]},'reason':{'type':Sequelize[_0xa227('0x3')]}}; \ No newline at end of file +var _0x6c23=['STRING','DATE','moment','sequelize'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0x6c23,0x112));var _0x36c2=function(_0x8a619,_0x3d39f3){_0x8a619=_0x8a619-0x0;var _0x3c2678=_0x6c23[_0x8a619];return _0x3c2678;};'use strict';var moment=require(_0x36c2('0x0'));var Sequelize=require(_0x36c2('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x36c2('0x2')]},'joinAt':{'type':Sequelize[_0x36c2('0x3')]},'leaveAt':{'type':Sequelize[_0x36c2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x36c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 9eb8659..a05758e 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 _0x2da6=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','intersection','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x3b1efe,_0x8203c2){var _0x4a6411=function(_0x2841fb){while(--_0x2841fb){_0x3b1efe['push'](_0x3b1efe['shift']());}};_0x4a6411(++_0x8203c2);}(_0x2da6,0x1dd));var _0x62da=function(_0x3a72ca,_0x27652f){_0x3a72ca=_0x3a72ca-0x0;var _0x108247=_0x2da6[_0x3a72ca];return _0x108247;};'use strict';var emlformat=require(_0x62da('0x0'));var rimraf=require(_0x62da('0x1'));var zipdir=require(_0x62da('0x2'));var jsonpatch=require(_0x62da('0x3'));var rp=require(_0x62da('0x4'));var moment=require(_0x62da('0x5'));var BPromise=require(_0x62da('0x6'));var Mustache=require(_0x62da('0x7'));var util=require('util');var path=require('path');var sox=require(_0x62da('0x8'));var csv=require(_0x62da('0x9'));var ejs=require(_0x62da('0xa'));var fs=require('fs');var fs_extra=require(_0x62da('0xb'));var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x62da('0x1a'));var db=require(_0x62da('0x1b'))['db'];function respondWithStatusCode(_0xd27693,_0x362eeb){_0x362eeb=_0x362eeb||0xcc;return function(_0x37ba2e){if(_0x37ba2e){return _0xd27693['sendStatus'](_0x362eeb);}return _0xd27693['status'](_0x362eeb)[_0x62da('0x1c')]();};}function respondWithResult(_0x27a000,_0x1bd7f9){_0x1bd7f9=_0x1bd7f9||0xc8;return function(_0x191ed5){if(_0x191ed5){return _0x27a000[_0x62da('0x1d')](_0x1bd7f9)[_0x62da('0x1e')](_0x191ed5);}};}function respondWithFilteredResult(_0x3c6498,_0x624a1c){return function(_0x2cbdf6){if(_0x2cbdf6){var _0xcc1a25=typeof _0x624a1c[_0x62da('0x1f')]===_0x62da('0x20')&&typeof _0x624a1c[_0x62da('0x21')]===_0x62da('0x20');var _0x4bdab9=_0x2cbdf6['count'];var _0xa7050b=_0xcc1a25?0x0:_0x624a1c['offset'];var _0x4d6482=_0xcc1a25?_0x2cbdf6[_0x62da('0x22')]:_0x624a1c[_0x62da('0x1f')]+_0x624a1c['limit'];var _0x29191b;if(_0x4d6482>=_0x4bdab9){_0x4d6482=_0x4bdab9;_0x29191b=0xc8;}else{_0x29191b=0xce;}_0x3c6498['status'](_0x29191b);return _0x3c6498[_0x62da('0x23')](_0x62da('0x24'),_0xa7050b+'-'+_0x4d6482+'/'+_0x4bdab9)[_0x62da('0x1e')](_0x2cbdf6);}return null;};}function patchUpdates(_0x2f7b01){return function(_0x3d015f){try{jsonpatch[_0x62da('0x25')](_0x3d015f,_0x2f7b01,!![]);}catch(_0x183033){return BPromise[_0x62da('0x26')](_0x183033);}return _0x3d015f[_0x62da('0x27')]();};}function saveUpdates(_0x583fc0,_0x13bf6d){return function(_0x866a76){if(_0x866a76){return _0x866a76[_0x62da('0x28')](_0x583fc0)[_0x62da('0x29')](function(_0x35f687){return _0x35f687;});}return null;};}function removeEntity(_0x54b936,_0x24298a){return function(_0x50ed6b){if(_0x50ed6b){return _0x50ed6b['destroy']()['then'](function(){_0x54b936[_0x62da('0x1d')](0xcc)[_0x62da('0x1c')]();});}};}function handleEntityNotFound(_0x14897c,_0x3f6fc9){return function(_0x4b1237){if(!_0x4b1237){_0x14897c[_0x62da('0x2a')](0x194);}return _0x4b1237;};}function handleError(_0x3b9c06,_0x5f0a9c){_0x5f0a9c=_0x5f0a9c||0x1f4;return function(_0x3ccf96){logger[_0x62da('0x2b')](_0x3ccf96[_0x62da('0x2c')]);if(_0x3ccf96['name']){delete _0x3ccf96[_0x62da('0x2d')];}_0x3b9c06[_0x62da('0x1d')](_0x5f0a9c)[_0x62da('0x2e')](_0x3ccf96);};}exports['index']=function(_0x4f5657,_0x3c6274){var _0x301e3d={},_0x220ffc={},_0x594c5a={'count':0x0,'rows':[]};var _0x45f67a=_[_0x62da('0x2f')](db[_0x62da('0x30')][_0x62da('0x31')],function(_0xd8cf3b){return{'name':_0xd8cf3b[_0x62da('0x32')],'type':_0xd8cf3b['type'][_0x62da('0x33')]};});_0x220ffc['model']=_[_0x62da('0x2f')](_0x45f67a,_0x62da('0x2d'));_0x220ffc[_0x62da('0x34')]=_[_0x62da('0x35')](_0x4f5657[_0x62da('0x34')]);_0x220ffc[_0x62da('0x36')]=_['intersection'](_0x220ffc[_0x62da('0x37')],_0x220ffc[_0x62da('0x34')]);_0x301e3d[_0x62da('0x38')]=_['intersection'](_0x220ffc[_0x62da('0x37')],qs[_0x62da('0x39')](_0x4f5657[_0x62da('0x34')]['fields']));_0x301e3d[_0x62da('0x38')]=_0x301e3d[_0x62da('0x38')]['length']?_0x301e3d[_0x62da('0x38')]:_0x220ffc[_0x62da('0x37')];if(!_0x4f5657['query'][_0x62da('0x3a')](_0x62da('0x3b'))){_0x301e3d[_0x62da('0x21')]=qs[_0x62da('0x21')](_0x4f5657[_0x62da('0x34')][_0x62da('0x21')]);_0x301e3d[_0x62da('0x1f')]=qs[_0x62da('0x1f')](_0x4f5657[_0x62da('0x34')][_0x62da('0x1f')]);}_0x301e3d[_0x62da('0x3c')]=qs[_0x62da('0x3d')](_0x4f5657[_0x62da('0x34')][_0x62da('0x3d')]);_0x301e3d[_0x62da('0x3e')]=qs[_0x62da('0x36')](_[_0x62da('0x3f')](_0x4f5657['query'],_0x220ffc[_0x62da('0x36')]),_0x45f67a);if(_0x4f5657['query'][_0x62da('0x40')]){_0x301e3d[_0x62da('0x3e')]=_[_0x62da('0x41')](_0x301e3d['where'],{'$or':_[_0x62da('0x2f')](_0x45f67a,function(_0xecf52d){if(_0xecf52d[_0x62da('0x42')]!==_0x62da('0x43')){var _0x5093c1={};_0x5093c1[_0xecf52d[_0x62da('0x2d')]]={'$like':'%'+_0x4f5657[_0x62da('0x34')][_0x62da('0x40')]+'%'};return _0x5093c1;}})});}_0x301e3d=_[_0x62da('0x41')]({},_0x301e3d,_0x4f5657[_0x62da('0x44')]);var _0x203815={'where':_0x301e3d[_0x62da('0x3e')]};return db[_0x62da('0x30')][_0x62da('0x22')](_0x203815)['then'](function(_0x29d2c2){_0x594c5a[_0x62da('0x22')]=_0x29d2c2;if(_0x4f5657['query'][_0x62da('0x45')]){_0x301e3d[_0x62da('0x46')]=[{'all':!![]}];}return db[_0x62da('0x30')][_0x62da('0x47')](_0x301e3d);})[_0x62da('0x29')](function(_0xde827d){_0x594c5a[_0x62da('0x48')]=_0xde827d;return _0x594c5a;})[_0x62da('0x29')](respondWithFilteredResult(_0x3c6274,_0x301e3d))['catch'](handleError(_0x3c6274,null));};exports['show']=function(_0x4bd1b8,_0x40d0af){var _0x54b49c={'raw':!![],'where':{'id':_0x4bd1b8['params']['id']}},_0x86f5a8={};_0x86f5a8['model']=_['keys'](db[_0x62da('0x30')][_0x62da('0x31')]);_0x86f5a8['query']=_[_0x62da('0x35')](_0x4bd1b8['query']);_0x86f5a8[_0x62da('0x36')]=_['intersection'](_0x86f5a8['model'],_0x86f5a8[_0x62da('0x34')]);_0x54b49c[_0x62da('0x38')]=_[_0x62da('0x49')](_0x86f5a8['model'],qs[_0x62da('0x39')](_0x4bd1b8[_0x62da('0x34')][_0x62da('0x39')]));_0x54b49c[_0x62da('0x38')]=_0x54b49c[_0x62da('0x38')]['length']?_0x54b49c['attributes']:_0x86f5a8[_0x62da('0x37')];if(_0x4bd1b8[_0x62da('0x34')][_0x62da('0x45')]){_0x54b49c[_0x62da('0x46')]=[{'all':!![]}];}_0x54b49c=_[_0x62da('0x41')]({},_0x54b49c,_0x4bd1b8['options']);return db['MailQueueReport'][_0x62da('0x4a')](_0x54b49c)[_0x62da('0x29')](handleEntityNotFound(_0x40d0af,null))['then'](respondWithResult(_0x40d0af,null))[_0x62da('0x4b')](handleError(_0x40d0af,null));};exports[_0x62da('0x4c')]=function(_0x454cc0,_0x29153f){return db[_0x62da('0x30')]['create'](_0x454cc0[_0x62da('0x4d')],{})[_0x62da('0x29')](respondWithResult(_0x29153f,0xc9))[_0x62da('0x4b')](handleError(_0x29153f,null));};exports[_0x62da('0x28')]=function(_0x4d3ec0,_0x1f2ab5){if(_0x4d3ec0[_0x62da('0x4d')]['id']){delete _0x4d3ec0[_0x62da('0x4d')]['id'];}return db[_0x62da('0x30')]['find']({'where':{'id':_0x4d3ec0[_0x62da('0x4e')]['id']}})[_0x62da('0x29')](handleEntityNotFound(_0x1f2ab5,null))['then'](saveUpdates(_0x4d3ec0['body'],null))['then'](respondWithResult(_0x1f2ab5,null))[_0x62da('0x4b')](handleError(_0x1f2ab5,null));};exports[_0x62da('0x4f')]=function(_0x33fbfc,_0x5cd1a9){return db[_0x62da('0x30')][_0x62da('0x4a')]({'where':{'id':_0x33fbfc[_0x62da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cd1a9,null))[_0x62da('0x29')](removeEntity(_0x5cd1a9,null))[_0x62da('0x4b')](handleError(_0x5cd1a9,null));};exports[_0x62da('0x50')]=function(_0x420697,_0x4bb439){return db[_0x62da('0x30')][_0x62da('0x50')]()[_0x62da('0x29')](respondWithResult(_0x4bb439,null))[_0x62da('0x4b')](handleError(_0x4bb439,null));}; \ No newline at end of file +var _0x2272=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../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','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailQueueReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','show','params','merge','options','create','body','find','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x5e5afc,_0xe0a694){var _0x59e228=function(_0x3808e1){while(--_0x3808e1){_0x5e5afc['push'](_0x5e5afc['shift']());}};_0x59e228(++_0xe0a694);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x2227('0x0'));var rimraf=require(_0x2227('0x1'));var zipdir=require(_0x2227('0x2'));var jsonpatch=require(_0x2227('0x3'));var rp=require(_0x2227('0x4'));var moment=require('moment');var BPromise=require(_0x2227('0x5'));var Mustache=require(_0x2227('0x6'));var util=require(_0x2227('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require(_0x2227('0xb'));var squel=require(_0x2227('0xc'));var crypto=require(_0x2227('0xd'));var jsforce=require(_0x2227('0xe'));var deskjs=require(_0x2227('0xf'));var toCsv=require(_0x2227('0x8'));var querystring=require(_0x2227('0x10'));var Papa=require('papaparse');var Redis=require(_0x2227('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2227('0x12'));var as=require(_0x2227('0x13'));var hardwareService=require(_0x2227('0x14'));var logger=require(_0x2227('0x15'))(_0x2227('0x16'));var utils=require('../../config/utils');var config=require(_0x2227('0x17'));var licenseUtil=require(_0x2227('0x18'));var db=require(_0x2227('0x19'))['db'];function respondWithStatusCode(_0x2e19fb,_0x125c3b){_0x125c3b=_0x125c3b||0xcc;return function(_0x18a2c0){if(_0x18a2c0){return _0x2e19fb['sendStatus'](_0x125c3b);}return _0x2e19fb['status'](_0x125c3b)['end']();};}function respondWithResult(_0x136f6b,_0x571dd1){_0x571dd1=_0x571dd1||0xc8;return function(_0x42f60b){if(_0x42f60b){return _0x136f6b[_0x2227('0x1a')](_0x571dd1)['json'](_0x42f60b);}};}function respondWithFilteredResult(_0x3da09c,_0x4fa23d){return function(_0x1df1ef){if(_0x1df1ef){var _0x43e174=typeof _0x4fa23d[_0x2227('0x1b')]===_0x2227('0x1c')&&typeof _0x4fa23d['limit']===_0x2227('0x1c');var _0x1cf016=_0x1df1ef[_0x2227('0x1d')];var _0x531f75=_0x43e174?0x0:_0x4fa23d[_0x2227('0x1b')];var _0x620012=_0x43e174?_0x1df1ef[_0x2227('0x1d')]:_0x4fa23d[_0x2227('0x1b')]+_0x4fa23d[_0x2227('0x1e')];var _0x28e642;if(_0x620012>=_0x1cf016){_0x620012=_0x1cf016;_0x28e642=0xc8;}else{_0x28e642=0xce;}_0x3da09c[_0x2227('0x1a')](_0x28e642);return _0x3da09c['set'](_0x2227('0x1f'),_0x531f75+'-'+_0x620012+'/'+_0x1cf016)['json'](_0x1df1ef);}return null;};}function patchUpdates(_0x2b26b7){return function(_0x3aed68){try{jsonpatch[_0x2227('0x20')](_0x3aed68,_0x2b26b7,!![]);}catch(_0x1f28ef){return BPromise[_0x2227('0x21')](_0x1f28ef);}return _0x3aed68[_0x2227('0x22')]();};}function saveUpdates(_0x19ab59,_0x10d9ca){return function(_0x3299fd){if(_0x3299fd){return _0x3299fd[_0x2227('0x23')](_0x19ab59)[_0x2227('0x24')](function(_0x5a454f){return _0x5a454f;});}return null;};}function removeEntity(_0x45def5,_0x42d500){return function(_0x5b3a09){if(_0x5b3a09){return _0x5b3a09[_0x2227('0x25')]()[_0x2227('0x24')](function(){_0x45def5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17c7a4,_0xa4d18b){return function(_0x35333f){if(!_0x35333f){_0x17c7a4[_0x2227('0x26')](0x194);}return _0x35333f;};}function handleError(_0x5be889,_0x191a3e){_0x191a3e=_0x191a3e||0x1f4;return function(_0x301304){logger[_0x2227('0x27')](_0x301304[_0x2227('0x28')]);if(_0x301304['name']){delete _0x301304[_0x2227('0x29')];}_0x5be889[_0x2227('0x1a')](_0x191a3e)[_0x2227('0x2a')](_0x301304);};}exports[_0x2227('0x2b')]=function(_0x1627d3,_0x4789eb){var _0x55015e={},_0x5d1d56={},_0x2dc38d={'count':0x0,'rows':[]};var _0x497f91=_[_0x2227('0x2c')](db[_0x2227('0x2d')]['rawAttributes'],function(_0x5916d4){return{'name':_0x5916d4[_0x2227('0x2e')],'type':_0x5916d4[_0x2227('0x2f')][_0x2227('0x30')]};});_0x5d1d56['model']=_[_0x2227('0x2c')](_0x497f91,'name');_0x5d1d56[_0x2227('0x31')]=_[_0x2227('0x32')](_0x1627d3[_0x2227('0x31')]);_0x5d1d56[_0x2227('0x33')]=_[_0x2227('0x34')](_0x5d1d56[_0x2227('0x35')],_0x5d1d56[_0x2227('0x31')]);_0x55015e[_0x2227('0x36')]=_[_0x2227('0x34')](_0x5d1d56[_0x2227('0x35')],qs[_0x2227('0x37')](_0x1627d3['query'][_0x2227('0x37')]));_0x55015e[_0x2227('0x36')]=_0x55015e[_0x2227('0x36')][_0x2227('0x38')]?_0x55015e['attributes']:_0x5d1d56[_0x2227('0x35')];if(!_0x1627d3[_0x2227('0x31')][_0x2227('0x39')](_0x2227('0x3a'))){_0x55015e['limit']=qs[_0x2227('0x1e')](_0x1627d3[_0x2227('0x31')][_0x2227('0x1e')]);_0x55015e['offset']=qs['offset'](_0x1627d3[_0x2227('0x31')][_0x2227('0x1b')]);}_0x55015e['order']=qs[_0x2227('0x3b')](_0x1627d3[_0x2227('0x31')]['sort']);_0x55015e[_0x2227('0x3c')]=qs['filters'](_[_0x2227('0x3d')](_0x1627d3[_0x2227('0x31')],_0x5d1d56[_0x2227('0x33')]),_0x497f91);if(_0x1627d3[_0x2227('0x31')]['filter']){_0x55015e[_0x2227('0x3c')]=_['merge'](_0x55015e[_0x2227('0x3c')],{'$or':_[_0x2227('0x2c')](_0x497f91,function(_0x5ef625){if(_0x5ef625['type']!==_0x2227('0x3e')){var _0x2b96b1={};_0x2b96b1[_0x5ef625[_0x2227('0x29')]]={'$like':'%'+_0x1627d3[_0x2227('0x31')][_0x2227('0x3f')]+'%'};return _0x2b96b1;}})});}_0x55015e=_['merge']({},_0x55015e,_0x1627d3['options']);var _0x2b1a8c={'where':_0x55015e['where']};return db[_0x2227('0x2d')][_0x2227('0x1d')](_0x2b1a8c)[_0x2227('0x24')](function(_0x3ae79a){_0x2dc38d[_0x2227('0x1d')]=_0x3ae79a;if(_0x1627d3[_0x2227('0x31')][_0x2227('0x40')]){_0x55015e[_0x2227('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x2227('0x42')](_0x55015e);})['then'](function(_0x3c67c6){_0x2dc38d['rows']=_0x3c67c6;return _0x2dc38d;})[_0x2227('0x24')](respondWithFilteredResult(_0x4789eb,_0x55015e))['catch'](handleError(_0x4789eb,null));};exports[_0x2227('0x43')]=function(_0x49239e,_0xf45d6b){var _0x307099={'raw':!![],'where':{'id':_0x49239e[_0x2227('0x44')]['id']}},_0x46eb0f={};_0x46eb0f[_0x2227('0x35')]=_[_0x2227('0x32')](db['MailQueueReport']['rawAttributes']);_0x46eb0f[_0x2227('0x31')]=_['keys'](_0x49239e[_0x2227('0x31')]);_0x46eb0f['filters']=_[_0x2227('0x34')](_0x46eb0f[_0x2227('0x35')],_0x46eb0f[_0x2227('0x31')]);_0x307099[_0x2227('0x36')]=_[_0x2227('0x34')](_0x46eb0f[_0x2227('0x35')],qs['fields'](_0x49239e[_0x2227('0x31')][_0x2227('0x37')]));_0x307099[_0x2227('0x36')]=_0x307099[_0x2227('0x36')][_0x2227('0x38')]?_0x307099[_0x2227('0x36')]:_0x46eb0f[_0x2227('0x35')];if(_0x49239e[_0x2227('0x31')]['includeAll']){_0x307099[_0x2227('0x41')]=[{'all':!![]}];}_0x307099=_[_0x2227('0x45')]({},_0x307099,_0x49239e[_0x2227('0x46')]);return db[_0x2227('0x2d')]['find'](_0x307099)[_0x2227('0x24')](handleEntityNotFound(_0xf45d6b,null))[_0x2227('0x24')](respondWithResult(_0xf45d6b,null))['catch'](handleError(_0xf45d6b,null));};exports[_0x2227('0x47')]=function(_0x475a1b,_0x1e4d8f){return db[_0x2227('0x2d')][_0x2227('0x47')](_0x475a1b[_0x2227('0x48')],{})[_0x2227('0x24')](respondWithResult(_0x1e4d8f,0xc9))['catch'](handleError(_0x1e4d8f,null));};exports[_0x2227('0x23')]=function(_0x3155dd,_0x482bf9){if(_0x3155dd[_0x2227('0x48')]['id']){delete _0x3155dd['body']['id'];}return db[_0x2227('0x2d')][_0x2227('0x49')]({'where':{'id':_0x3155dd[_0x2227('0x44')]['id']}})[_0x2227('0x24')](handleEntityNotFound(_0x482bf9,null))['then'](saveUpdates(_0x3155dd['body'],null))['then'](respondWithResult(_0x482bf9,null))[_0x2227('0x4a')](handleError(_0x482bf9,null));};exports[_0x2227('0x25')]=function(_0x5b0e5b,_0x3ab28b){return db[_0x2227('0x2d')][_0x2227('0x49')]({'where':{'id':_0x5b0e5b[_0x2227('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ab28b,null))['then'](removeEntity(_0x3ab28b,null))[_0x2227('0x4a')](handleError(_0x3ab28b,null));};exports[_0x2227('0x4b')]=function(_0x225299,_0xc13872){return db['MailQueueReport'][_0x2227('0x4b')]()[_0x2227('0x24')](respondWithResult(_0xc13872,null))[_0x2227('0x4a')](handleError(_0xc13872,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 51ebf21..ade3ff4 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 _0xf77f=['bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x5cfc17,_0x46f1ff){var _0x283613=function(_0xacc92){while(--_0xacc92){_0x5cfc17['push'](_0x5cfc17['shift']());}};_0x283613(++_0x46f1ff);}(_0xf77f,0x134));var _0xff77=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xf77f[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xff77('0x0'));var util=require('util');var logger=require(_0xff77('0x1'))(_0xff77('0x2'));var moment=require(_0xff77('0x3'));var BPromise=require(_0xff77('0x4'));var rp=require(_0xff77('0x5'));var fs=require('fs');var path=require(_0xff77('0x6'));var rimraf=require(_0xff77('0x7'));var config=require(_0xff77('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xff77('0x9')]=function(_0x17e374,_0x54c2e4){return _0x17e374['define'](_0xff77('0xa'),attributes,{'tableName':_0xff77('0xb'),'paranoid':![],'indexes':[{'name':_0xff77('0xc'),'fields':[_0xff77('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7370=['report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x7370,0x1e2));var _0x0737=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0x7370[_0xab2afb];return _0x25262b;};'use strict';var _=require(_0x0737('0x0'));var util=require(_0x0737('0x1'));var logger=require(_0x0737('0x2'))(_0x0737('0x3'));var moment=require(_0x0737('0x4'));var BPromise=require(_0x0737('0x5'));var rp=require(_0x0737('0x6'));var fs=require('fs');var path=require(_0x0737('0x7'));var rimraf=require(_0x0737('0x8'));var config=require(_0x0737('0x9'));var attributes=require(_0x0737('0xa'));module[_0x0737('0xb')]=function(_0x4b7c76,_0x174abe){return _0x4b7c76[_0x0737('0xc')](_0x0737('0xd'),attributes,{'tableName':_0x0737('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0737('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 6af85ff..a770768 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x2bfad5,_0x2aace6){var _0x4ce913=function(_0x5d804b){while(--_0x5d804b){_0x2bfad5['push'](_0x2bfad5['shift']());}};_0x4ce913(++_0x2aace6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ 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(_0x317069,_0x5a46ac){var _0x303af5=function(_0x41c177){while(--_0x41c177){_0x317069['push'](_0x317069['shift']());}};_0x303af5(++_0x5a46ac);}(_0x1261,0x144));var _0x1126=function(_0x460fd9,_0x4b4b97){_0x460fd9=_0x460fd9-0x0;var _0x424e18=_0x1261[_0x460fd9];return _0x424e18;};'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 71768e0..48f6850 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x43fb15,_0x4b3f5b){var _0x42d47a=function(_0x27859b){while(--_0x27859b){_0x43fb15['push'](_0x43fb15['shift']());}};_0x42d47a(++_0x4b3f5b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x312270,_0x1c538f){var _0x1f8187=function(_0x51dd75){while(--_0x51dd75){_0x312270['push'](_0x312270['shift']());}};_0x1f8187(++_0x1c538f);}(_0x70e0,0x17b));var _0x070e=function(_0x2ba8cc,_0x36c4d6){_0x2ba8cc=_0x2ba8cc-0x0;var _0x3930d8=_0x70e0[_0x2ba8cc];return _0x3930d8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 91c63b4..6a62711 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 _0xac4a=['INTEGER','sequelize','exports','STRING','BOOLEAN','INBOX'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xac4a,0x13f));var _0xaac4=function(_0x2f2840,_0x1bb703){_0x2f2840=_0x2f2840-0x0;var _0x23c957=_0xac4a[_0x2f2840];return _0x23c957;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'description':{'type':Sequelize[_0xaac4('0x2')]},'host':{'type':Sequelize[_0xaac4('0x2')]},'authentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xaac4('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaac4('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x80df=['STRING','INTEGER','BOOLEAN','INBOX','sequelize','exports'];(function(_0x1120a7,_0x4a49cf){var _0x460cf4=function(_0x18629e){while(--_0x18629e){_0x1120a7['push'](_0x1120a7['shift']());}};_0x460cf4(++_0x4a49cf);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf80d('0x0'));module[_0xf80d('0x1')]={'description':{'type':Sequelize[_0xf80d('0x2')]},'host':{'type':Sequelize[_0xf80d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xf80d('0x2')]},'password':{'type':Sequelize[_0xf80d('0x2')]},'port':{'type':Sequelize[_0xf80d('0x3')]},'tls':{'type':Sequelize[_0xf80d('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf80d('0x2')],'defaultValue':_0xf80d('0x5')},'connTimeout':{'type':Sequelize[_0xf80d('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf80d('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf80d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 4a7f33e..feb6dc0 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 _0x1bc4=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','lodash'];(function(_0x56b566,_0x4f50a3){var _0x58815b=function(_0x557fdb){while(--_0x557fdb){_0x56b566['push'](_0x56b566['shift']());}};_0x58815b(++_0x4f50a3);}(_0x1bc4,0xd1));var _0x41bc=function(_0x17986a,_0x4e2223){_0x17986a=_0x17986a-0x0;var _0x2d82fa=_0x1bc4[_0x17986a];return _0x2d82fa;};'use strict';var _=require(_0x41bc('0x0'));var util=require(_0x41bc('0x1'));var logger=require(_0x41bc('0x2'))('api');var moment=require(_0x41bc('0x3'));var BPromise=require(_0x41bc('0x4'));var rp=require(_0x41bc('0x5'));var fs=require('fs');var path=require(_0x41bc('0x6'));var rimraf=require('rimraf');var config=require(_0x41bc('0x7'));var attributes=require(_0x41bc('0x8'));module[_0x41bc('0x9')]=function(_0xbf2a17,_0x53db4f){return _0xbf2a17['define']('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfde9=['rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0xfde9,0x113));var _0x9fde=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0xfde9[_0x53afe9];return _0x396396;};'use strict';var _=require(_0x9fde('0x0'));var util=require(_0x9fde('0x1'));var logger=require(_0x9fde('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9fde('0x3'));var rp=require(_0x9fde('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fde('0x5'));var config=require(_0x9fde('0x6'));var attributes=require(_0x9fde('0x7'));module['exports']=function(_0x43d64b,_0x5b8076){return _0x43d64b[_0x9fde('0x8')](_0x9fde('0x9'),attributes,{'tableName':'mail_servers_in','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 6179497..6d66f03 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 _0x7e8e=['MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','options','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e8e,0x91));var _0xe7e8=function(_0xa65ffb,_0x53dd5b){_0xa65ffb=_0xa65ffb-0x0;var _0x491769=_0x7e8e[_0xa65ffb];return _0x491769;};'use strict';var _=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var moment=require(_0xe7e8('0x2'));var BPromise=require(_0xe7e8('0x3'));var rs=require(_0xe7e8('0x4'));var fs=require('fs');var Redis=require(_0xe7e8('0x5'));var db=require(_0xe7e8('0x6'))['db'];var utils=require(_0xe7e8('0x7'));var logger=require(_0xe7e8('0x8'))(_0xe7e8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7e8('0xa')][_0xe7e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d86f2,_0x27ab3b,_0x2b5d17){return new BPromise(function(_0x28a2de,_0x398855){return client[_0xe7e8('0xc')](_0x5d86f2,_0x2b5d17)[_0xe7e8('0xd')](function(_0x9305d7){logger[_0xe7e8('0xe')](_0xe7e8('0xf'),_0x27ab3b,'request\x20sent');logger[_0xe7e8('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x27ab3b,_0xe7e8('0x11'),JSON[_0xe7e8('0x12')](_0x9305d7));if(_0x9305d7['error']){if(_0x9305d7[_0xe7e8('0x13')]['code']===0x1f4){logger[_0xe7e8('0x13')](_0xe7e8('0xf'),_0x27ab3b,_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);return _0x398855(_0x9305d7['error'][_0xe7e8('0x14')]);}logger[_0xe7e8('0x13')]('MailServerIn,\x20%s,\x20%s',_0x27ab3b,_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);return _0x28a2de(_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);}else{logger['info'](_0xe7e8('0xf'),_0x27ab3b,_0xe7e8('0x11'));_0x28a2de(_0x9305d7[_0xe7e8('0x15')][_0xe7e8('0x14')]);}})[_0xe7e8('0x16')](function(_0x27539b){logger[_0xe7e8('0x13')](_0xe7e8('0xf'),_0x27ab3b,_0x27539b);_0x398855(_0x27539b);});});}exports[_0xe7e8('0x17')]=function(_0x486e0f){var _0x10b0a8=this;return new Promise(function(_0x375434,_0x280388){return db[_0xe7e8('0x18')]['findAll']({'raw':_0x486e0f[_0xe7e8('0x19')]?_0x486e0f[_0xe7e8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x486e0f['options']?_0x486e0f[_0xe7e8('0x19')][_0xe7e8('0x1a')]||null:null,'attributes':_0x486e0f[_0xe7e8('0x19')]?_0x486e0f['options']['attributes']||null:null,'limit':_0x486e0f[_0xe7e8('0x19')]?_0x486e0f[_0xe7e8('0x19')][_0xe7e8('0x1b')]||null:null,'include':_0x486e0f[_0xe7e8('0x19')]?_0x486e0f[_0xe7e8('0x19')][_0xe7e8('0x1c')]?_[_0xe7e8('0x1d')](_0x486e0f[_0xe7e8('0x19')]['include'],function(_0x2785db){return{'model':db[_0x2785db[_0xe7e8('0x1e')]],'as':_0x2785db['as'],'attributes':_0x2785db[_0xe7e8('0x1f')],'include':_0x2785db['include']?_[_0xe7e8('0x1d')](_0x2785db[_0xe7e8('0x1c')],function(_0x32f69d){return{'model':db[_0x32f69d[_0xe7e8('0x1e')]],'as':_0x32f69d['as'],'attributes':_0x32f69d[_0xe7e8('0x1f')],'include':_0x32f69d[_0xe7e8('0x1c')]?_[_0xe7e8('0x1d')](_0x32f69d[_0xe7e8('0x1c')],function(_0x2383c3){return{'model':db[_0x2383c3['model']],'as':_0x2383c3['as'],'attributes':_0x2383c3[_0xe7e8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe7e8('0xd')](function(_0x3bec05){logger[_0xe7e8('0xe')](_0xe7e8('0x17'),_0x486e0f);logger[_0xe7e8('0x10')](_0xe7e8('0x17'),_0x486e0f,JSON['stringify'](_0x3bec05));_0x375434(_0x3bec05);})[_0xe7e8('0x16')](function(_0x439e53){logger[_0xe7e8('0x13')](_0xe7e8('0x17'),_0x439e53[_0xe7e8('0x14')],_0x486e0f);_0x280388(_0x10b0a8[_0xe7e8('0x13')](0x1f4,_0x439e53[_0xe7e8('0x14')]));});});}; \ No newline at end of file +var _0x3e5c=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x361ecd,_0x32451e){var _0x31942f=function(_0x4fe2b5){while(--_0x4fe2b5){_0x361ecd['push'](_0x361ecd['shift']());}};_0x31942f(++_0x32451e);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x32365a,_0x57353e){_0x32365a=_0x32365a-0x0;var _0x1462cd=_0x3e5c[_0x32365a];return _0x1462cd;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require(_0xc3e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e5('0x4'));var db=require(_0xc3e5('0x5'))['db'];var utils=require(_0xc3e5('0x6'));var logger=require(_0xc3e5('0x7'))(_0xc3e5('0x8'));var config=require(_0xc3e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3e5('0xa')][_0xc3e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6089,_0xcbbec0,_0x2d580e){return new BPromise(function(_0x4864a2,_0x196f3a){return client[_0xc3e5('0xc')](_0x2d6089,_0x2d580e)[_0xc3e5('0xd')](function(_0x19813b){logger[_0xc3e5('0xe')](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));logger['debug'](_0xc3e5('0x11'),_0xcbbec0,_0xc3e5('0x10'),JSON[_0xc3e5('0x12')](_0x19813b));if(_0x19813b[_0xc3e5('0x13')]){if(_0x19813b['error'][_0xc3e5('0x14')]===0x1f4){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);return _0x196f3a(_0x19813b[_0xc3e5('0x13')]['message']);}logger['error']('MailServerIn,\x20%s,\x20%s',_0xcbbec0,_0x19813b[_0xc3e5('0x13')]['message']);return _0x4864a2(_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);}else{logger['info'](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));_0x4864a2(_0x19813b[_0xc3e5('0x16')][_0xc3e5('0x15')]);}})[_0xc3e5('0x17')](function(_0x47cfd8){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x47cfd8);_0x196f3a(_0x47cfd8);});});}exports[_0xc3e5('0x18')]=function(_0xa33d84){var _0x1e884a=this;return new Promise(function(_0x1e1eea,_0x538f71){return db[_0xc3e5('0x19')][_0xc3e5('0x1a')]({'raw':_0xa33d84['options']?_0xa33d84[_0xc3e5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xa33d84[_0xc3e5('0x1b')]?_0xa33d84[_0xc3e5('0x1b')][_0xc3e5('0x1c')]||null:null,'attributes':_0xa33d84[_0xc3e5('0x1b')]?_0xa33d84[_0xc3e5('0x1b')]['attributes']||null:null,'limit':_0xa33d84[_0xc3e5('0x1b')]?_0xa33d84[_0xc3e5('0x1b')][_0xc3e5('0x1d')]||null:null,'include':_0xa33d84[_0xc3e5('0x1b')]?_0xa33d84[_0xc3e5('0x1b')][_0xc3e5('0x1e')]?_[_0xc3e5('0x1f')](_0xa33d84['options'][_0xc3e5('0x1e')],function(_0x430cb4){return{'model':db[_0x430cb4[_0xc3e5('0x20')]],'as':_0x430cb4['as'],'attributes':_0x430cb4[_0xc3e5('0x21')],'include':_0x430cb4[_0xc3e5('0x1e')]?_[_0xc3e5('0x1f')](_0x430cb4[_0xc3e5('0x1e')],function(_0x45556e){return{'model':db[_0x45556e['model']],'as':_0x45556e['as'],'attributes':_0x45556e[_0xc3e5('0x21')],'include':_0x45556e['include']?_['map'](_0x45556e[_0xc3e5('0x1e')],function(_0x12ad6e){return{'model':db[_0x12ad6e[_0xc3e5('0x20')]],'as':_0x12ad6e['as'],'attributes':_0x12ad6e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3e5('0xd')](function(_0x38a961){logger[_0xc3e5('0xe')](_0xc3e5('0x18'),_0xa33d84);logger['debug'](_0xc3e5('0x18'),_0xa33d84,JSON['stringify'](_0x38a961));_0x1e1eea(_0x38a961);})[_0xc3e5('0x17')](function(_0xc0e6e7){logger[_0xc3e5('0x13')]('GetMailServerIn',_0xc0e6e7['message'],_0xa33d84);_0x538f71(_0x1e884a['error'](0x1f4,_0xc0e6e7[_0xc3e5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 6f5d91a..02d7071 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(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x3523b6,_0x552c5d){_0x3523b6=_0x3523b6-0x0;var _0x59b762=_0x7a54[_0x3523b6];return _0x59b762;};'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 c268bdc..8c37002 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 _0x22b4=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3c1320,_0x16290f){var _0x47a57e=function(_0x46b1bf){while(--_0x46b1bf){_0x3c1320['push'](_0x3c1320['shift']());}};_0x47a57e(++_0x16290f);}(_0x22b4,0x8b));var _0x422b=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x22b4[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x422b('0x0'));module[_0x422b('0x1')]={'description':{'type':Sequelize[_0x422b('0x2')]},'host':{'type':Sequelize[_0x422b('0x2')]},'user':{'type':Sequelize[_0x422b('0x2')]},'pass':{'type':Sequelize[_0x422b('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x422b('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x422b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfbf7=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x3f06a2,_0x8113fe){var _0x1e76cd=function(_0x449111){while(--_0x449111){_0x3f06a2['push'](_0x3f06a2['shift']());}};_0x1e76cd(++_0x8113fe);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x4642ef,_0x562055){_0x4642ef=_0x4642ef-0x0;var _0x228355=_0xfbf7[_0x4642ef];return _0x228355;};'use strict';var Sequelize=require('sequelize');module[_0x7fbf('0x0')]={'description':{'type':Sequelize[_0x7fbf('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7fbf('0x1')]},'pass':{'type':Sequelize[_0x7fbf('0x1')]},'port':{'type':Sequelize[_0x7fbf('0x2')]},'secure':{'type':Sequelize[_0x7fbf('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7fbf('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 3ac080a..43d1283 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 _0x779d=['save','update','then','destroy','sendStatus','stack','name','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','MailServerOut','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','apply'];(function(_0x528c12,_0x451151){var _0x299b76=function(_0x3893ca){while(--_0x3893ca){_0x528c12['push'](_0x528c12['shift']());}};_0x299b76(++_0x451151);}(_0x779d,0x14d));var _0xd779=function(_0x137d39,_0x4787df){_0x137d39=_0x137d39-0x0;var _0x1d7827=_0x779d[_0x137d39];return _0x1d7827;};'use strict';var emlformat=require(_0xd779('0x0'));var rimraf=require(_0xd779('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd779('0x2'));var moment=require(_0xd779('0x3'));var BPromise=require(_0xd779('0x4'));var Mustache=require(_0xd779('0x5'));var util=require(_0xd779('0x6'));var path=require('path');var sox=require(_0xd779('0x7'));var csv=require(_0xd779('0x8'));var ejs=require(_0xd779('0x9'));var fs=require('fs');var fs_extra=require(_0xd779('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd779('0xb'));var jsforce=require(_0xd779('0xc'));var deskjs=require(_0xd779('0xd'));var toCsv=require(_0xd779('0x8'));var querystring=require('querystring');var Papa=require(_0xd779('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd779('0xf'));var as=require(_0xd779('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd779('0x11'))(_0xd779('0x12'));var utils=require(_0xd779('0x13'));var config=require(_0xd779('0x14'));var licenseUtil=require(_0xd779('0x15'));var db=require(_0xd779('0x16'))['db'];function respondWithStatusCode(_0x391d76,_0x456cb1){_0x456cb1=_0x456cb1||0xcc;return function(_0x480b99){if(_0x480b99){return _0x391d76['sendStatus'](_0x456cb1);}return _0x391d76['status'](_0x456cb1)[_0xd779('0x17')]();};}function respondWithResult(_0x22744a,_0x2dc933){_0x2dc933=_0x2dc933||0xc8;return function(_0x1829d6){if(_0x1829d6){return _0x22744a[_0xd779('0x18')](_0x2dc933)[_0xd779('0x19')](_0x1829d6);}};}function respondWithFilteredResult(_0x348a47,_0x11d746){return function(_0xf4729f){if(_0xf4729f){var _0x1f443b=typeof _0x11d746['offset']===_0xd779('0x1a')&&typeof _0x11d746[_0xd779('0x1b')]===_0xd779('0x1a');var _0x391d18=_0xf4729f['count'];var _0x2f85a9=_0x1f443b?0x0:_0x11d746[_0xd779('0x1c')];var _0x175d54=_0x1f443b?_0xf4729f[_0xd779('0x1d')]:_0x11d746['offset']+_0x11d746['limit'];var _0x53b4bf;if(_0x175d54>=_0x391d18){_0x175d54=_0x391d18;_0x53b4bf=0xc8;}else{_0x53b4bf=0xce;}_0x348a47[_0xd779('0x18')](_0x53b4bf);return _0x348a47[_0xd779('0x1e')]('Content-Range',_0x2f85a9+'-'+_0x175d54+'/'+_0x391d18)[_0xd779('0x19')](_0xf4729f);}return null;};}function patchUpdates(_0x2b8b1a){return function(_0x2614ca){try{jsonpatch[_0xd779('0x1f')](_0x2614ca,_0x2b8b1a,!![]);}catch(_0x4b029e){return BPromise['reject'](_0x4b029e);}return _0x2614ca[_0xd779('0x20')]();};}function saveUpdates(_0x42582c,_0xb6a145){return function(_0x39796e){if(_0x39796e){return _0x39796e[_0xd779('0x21')](_0x42582c)[_0xd779('0x22')](function(_0x217a82){return _0x217a82;});}return null;};}function removeEntity(_0x594e35,_0x3fdf76){return function(_0x230f1a){if(_0x230f1a){return _0x230f1a[_0xd779('0x23')]()[_0xd779('0x22')](function(){_0x594e35[_0xd779('0x18')](0xcc)[_0xd779('0x17')]();});}};}function handleEntityNotFound(_0xd4ad6f,_0x576687){return function(_0xbc09c){if(!_0xbc09c){_0xd4ad6f[_0xd779('0x24')](0x194);}return _0xbc09c;};}function handleError(_0x5edbb1,_0x5d235d){_0x5d235d=_0x5d235d||0x1f4;return function(_0x1ccbcc){logger['error'](_0x1ccbcc[_0xd779('0x25')]);if(_0x1ccbcc[_0xd779('0x26')]){delete _0x1ccbcc[_0xd779('0x26')];}_0x5edbb1[_0xd779('0x18')](_0x5d235d)['send'](_0x1ccbcc);};}exports['index']=function(_0x1c7e57,_0x5d0ee6){var _0x310774={},_0x15a019={},_0x23b7f0={'count':0x0,'rows':[]};var _0x163d9c=_[_0xd779('0x27')](db['MailServerOut']['rawAttributes'],function(_0x45452b){return{'name':_0x45452b[_0xd779('0x28')],'type':_0x45452b[_0xd779('0x29')][_0xd779('0x2a')]};});_0x15a019['model']=_[_0xd779('0x27')](_0x163d9c,'name');_0x15a019[_0xd779('0x2b')]=_[_0xd779('0x2c')](_0x1c7e57[_0xd779('0x2b')]);_0x15a019[_0xd779('0x2d')]=_[_0xd779('0x2e')](_0x15a019[_0xd779('0x2f')],_0x15a019[_0xd779('0x2b')]);_0x310774[_0xd779('0x30')]=_[_0xd779('0x2e')](_0x15a019['model'],qs[_0xd779('0x31')](_0x1c7e57[_0xd779('0x2b')]['fields']));_0x310774['attributes']=_0x310774[_0xd779('0x30')][_0xd779('0x32')]?_0x310774[_0xd779('0x30')]:_0x15a019[_0xd779('0x2f')];if(!_0x1c7e57[_0xd779('0x2b')][_0xd779('0x33')](_0xd779('0x34'))){_0x310774[_0xd779('0x1b')]=qs[_0xd779('0x1b')](_0x1c7e57[_0xd779('0x2b')][_0xd779('0x1b')]);_0x310774[_0xd779('0x1c')]=qs['offset'](_0x1c7e57[_0xd779('0x2b')][_0xd779('0x1c')]);}_0x310774[_0xd779('0x35')]=qs[_0xd779('0x36')](_0x1c7e57['query']['sort']);_0x310774['where']=qs[_0xd779('0x2d')](_[_0xd779('0x37')](_0x1c7e57[_0xd779('0x2b')],_0x15a019[_0xd779('0x2d')]),_0x163d9c);if(_0x1c7e57[_0xd779('0x2b')][_0xd779('0x38')]){_0x310774[_0xd779('0x39')]=_['merge'](_0x310774[_0xd779('0x39')],{'$or':_[_0xd779('0x27')](_0x163d9c,function(_0x567c57){if(_0x567c57[_0xd779('0x29')]!==_0xd779('0x3a')){var _0x2555a6={};_0x2555a6[_0x567c57[_0xd779('0x26')]]={'$like':'%'+_0x1c7e57[_0xd779('0x2b')][_0xd779('0x38')]+'%'};return _0x2555a6;}})});}_0x310774=_[_0xd779('0x3b')]({},_0x310774,_0x1c7e57[_0xd779('0x3c')]);var _0xb2ced1={'where':_0x310774['where']};return db[_0xd779('0x3d')][_0xd779('0x1d')](_0xb2ced1)['then'](function(_0x162cf3){_0x23b7f0[_0xd779('0x1d')]=_0x162cf3;if(_0x1c7e57[_0xd779('0x2b')][_0xd779('0x3e')]){_0x310774[_0xd779('0x3f')]=[{'all':!![]}];}return db['MailServerOut'][_0xd779('0x40')](_0x310774);})[_0xd779('0x22')](function(_0x564642){_0x23b7f0[_0xd779('0x41')]=_0x564642;return _0x23b7f0;})[_0xd779('0x22')](respondWithFilteredResult(_0x5d0ee6,_0x310774))[_0xd779('0x42')](handleError(_0x5d0ee6,null));};exports[_0xd779('0x43')]=function(_0x39cc3a,_0x2a19a8){var _0x38a410={'raw':!![],'where':{'id':_0x39cc3a[_0xd779('0x44')]['id']}},_0x5ae06c={};_0x5ae06c['model']=_[_0xd779('0x2c')](db['MailServerOut'][_0xd779('0x45')]);_0x5ae06c[_0xd779('0x2b')]=_[_0xd779('0x2c')](_0x39cc3a['query']);_0x5ae06c[_0xd779('0x2d')]=_[_0xd779('0x2e')](_0x5ae06c[_0xd779('0x2f')],_0x5ae06c[_0xd779('0x2b')]);_0x38a410['attributes']=_['intersection'](_0x5ae06c[_0xd779('0x2f')],qs[_0xd779('0x31')](_0x39cc3a[_0xd779('0x2b')][_0xd779('0x31')]));_0x38a410[_0xd779('0x30')]=_0x38a410[_0xd779('0x30')][_0xd779('0x32')]?_0x38a410[_0xd779('0x30')]:_0x5ae06c[_0xd779('0x2f')];if(_0x39cc3a[_0xd779('0x2b')][_0xd779('0x3e')]){_0x38a410[_0xd779('0x3f')]=[{'all':!![]}];}_0x38a410=_['merge']({},_0x38a410,_0x39cc3a[_0xd779('0x3c')]);return db[_0xd779('0x3d')][_0xd779('0x46')](_0x38a410)[_0xd779('0x22')](handleEntityNotFound(_0x2a19a8,null))['then'](respondWithResult(_0x2a19a8,null))[_0xd779('0x42')](handleError(_0x2a19a8,null));};exports[_0xd779('0x47')]=function(_0x431237,_0x9e95b5){return db[_0xd779('0x3d')]['create'](_0x431237[_0xd779('0x48')],{})[_0xd779('0x22')](respondWithResult(_0x9e95b5,0xc9))['catch'](handleError(_0x9e95b5,null));};exports[_0xd779('0x21')]=function(_0x3b1a0d,_0x15b6d1){if(_0x3b1a0d[_0xd779('0x48')]['id']){delete _0x3b1a0d['body']['id'];}return db[_0xd779('0x3d')][_0xd779('0x46')]({'where':{'id':_0x3b1a0d[_0xd779('0x44')]['id']}})[_0xd779('0x22')](handleEntityNotFound(_0x15b6d1,null))[_0xd779('0x22')](saveUpdates(_0x3b1a0d[_0xd779('0x48')],null))[_0xd779('0x22')](respondWithResult(_0x15b6d1,null))[_0xd779('0x42')](handleError(_0x15b6d1,null));};exports['destroy']=function(_0x470ecc,_0x4a4f5){return db[_0xd779('0x3d')][_0xd779('0x46')]({'where':{'id':_0x470ecc['params']['id']}})[_0xd779('0x22')](handleEntityNotFound(_0x4a4f5,null))[_0xd779('0x22')](removeEntity(_0x4a4f5,null))['catch'](handleError(_0x4a4f5,null));}; \ No newline at end of file +var _0x8575=['where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','update','then','sendStatus','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0xc2eb8c,_0x123bdc){var _0xe0730f=function(_0x21df07){while(--_0x21df07){_0xc2eb8c['push'](_0xc2eb8c['shift']());}};_0xe0730f(++_0x123bdc);}(_0x8575,0x187));var _0x5857=function(_0x11ed41,_0x163715){_0x11ed41=_0x11ed41-0x0;var _0x1422da=_0x8575[_0x11ed41];return _0x1422da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5857('0x0'));var zipdir=require(_0x5857('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5857('0x2'));var moment=require(_0x5857('0x3'));var BPromise=require(_0x5857('0x4'));var Mustache=require(_0x5857('0x5'));var util=require('util');var path=require(_0x5857('0x6'));var sox=require(_0x5857('0x7'));var csv=require('to-csv');var ejs=require(_0x5857('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5857('0x9'));var squel=require('squel');var crypto=require(_0x5857('0xa'));var jsforce=require(_0x5857('0xb'));var deskjs=require(_0x5857('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5857('0xd'));var Papa=require(_0x5857('0xe'));var Redis=require(_0x5857('0xf'));var authService=require(_0x5857('0x10'));var qs=require(_0x5857('0x11'));var as=require(_0x5857('0x12'));var hardwareService=require(_0x5857('0x13'));var logger=require(_0x5857('0x14'))(_0x5857('0x15'));var utils=require(_0x5857('0x16'));var config=require(_0x5857('0x17'));var licenseUtil=require(_0x5857('0x18'));var db=require(_0x5857('0x19'))['db'];function respondWithStatusCode(_0x4ea4d3,_0x3c4489){_0x3c4489=_0x3c4489||0xcc;return function(_0x3f6c84){if(_0x3f6c84){return _0x4ea4d3['sendStatus'](_0x3c4489);}return _0x4ea4d3[_0x5857('0x1a')](_0x3c4489)[_0x5857('0x1b')]();};}function respondWithResult(_0x289888,_0x2925d9){_0x2925d9=_0x2925d9||0xc8;return function(_0x2eeeef){if(_0x2eeeef){return _0x289888[_0x5857('0x1a')](_0x2925d9)[_0x5857('0x1c')](_0x2eeeef);}};}function respondWithFilteredResult(_0x21d272,_0x27d7ec){return function(_0x3fc67b){if(_0x3fc67b){var _0xfdde99=typeof _0x27d7ec[_0x5857('0x1d')]==='undefined'&&typeof _0x27d7ec[_0x5857('0x1e')]===_0x5857('0x1f');var _0x6b7d98=_0x3fc67b['count'];var _0x4e90c6=_0xfdde99?0x0:_0x27d7ec[_0x5857('0x1d')];var _0x53d562=_0xfdde99?_0x3fc67b[_0x5857('0x20')]:_0x27d7ec[_0x5857('0x1d')]+_0x27d7ec['limit'];var _0x388db6;if(_0x53d562>=_0x6b7d98){_0x53d562=_0x6b7d98;_0x388db6=0xc8;}else{_0x388db6=0xce;}_0x21d272[_0x5857('0x1a')](_0x388db6);return _0x21d272[_0x5857('0x21')]('Content-Range',_0x4e90c6+'-'+_0x53d562+'/'+_0x6b7d98)[_0x5857('0x1c')](_0x3fc67b);}return null;};}function patchUpdates(_0x5e8697){return function(_0x2b9eb8){try{jsonpatch[_0x5857('0x22')](_0x2b9eb8,_0x5e8697,!![]);}catch(_0x1a17e3){return BPromise['reject'](_0x1a17e3);}return _0x2b9eb8['save']();};}function saveUpdates(_0x4be350,_0x1332b4){return function(_0x2954a6){if(_0x2954a6){return _0x2954a6[_0x5857('0x23')](_0x4be350)[_0x5857('0x24')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x103606,_0x149933){return function(_0x4df5bb){if(_0x4df5bb){return _0x4df5bb['destroy']()['then'](function(){_0x103606['status'](0xcc)[_0x5857('0x1b')]();});}};}function handleEntityNotFound(_0x395039,_0x33ddfb){return function(_0x1e4a1f){if(!_0x1e4a1f){_0x395039[_0x5857('0x25')](0x194);}return _0x1e4a1f;};}function handleError(_0x1cc186,_0x417da2){_0x417da2=_0x417da2||0x1f4;return function(_0xee2810){logger[_0x5857('0x26')](_0xee2810['stack']);if(_0xee2810[_0x5857('0x27')]){delete _0xee2810[_0x5857('0x27')];}_0x1cc186[_0x5857('0x1a')](_0x417da2)[_0x5857('0x28')](_0xee2810);};}exports[_0x5857('0x29')]=function(_0x188334,_0x406e9a){var _0x57549a={},_0x51a1ba={},_0x372dcb={'count':0x0,'rows':[]};var _0x5300f9=_[_0x5857('0x2a')](db[_0x5857('0x2b')][_0x5857('0x2c')],function(_0x2eefa1){return{'name':_0x2eefa1[_0x5857('0x2d')],'type':_0x2eefa1[_0x5857('0x2e')][_0x5857('0x2f')]};});_0x51a1ba[_0x5857('0x30')]=_[_0x5857('0x2a')](_0x5300f9,_0x5857('0x27'));_0x51a1ba[_0x5857('0x31')]=_[_0x5857('0x32')](_0x188334[_0x5857('0x31')]);_0x51a1ba[_0x5857('0x33')]=_['intersection'](_0x51a1ba[_0x5857('0x30')],_0x51a1ba[_0x5857('0x31')]);_0x57549a['attributes']=_[_0x5857('0x34')](_0x51a1ba[_0x5857('0x30')],qs[_0x5857('0x35')](_0x188334[_0x5857('0x31')][_0x5857('0x35')]));_0x57549a[_0x5857('0x36')]=_0x57549a[_0x5857('0x36')][_0x5857('0x37')]?_0x57549a['attributes']:_0x51a1ba['model'];if(!_0x188334[_0x5857('0x31')]['hasOwnProperty'](_0x5857('0x38'))){_0x57549a[_0x5857('0x1e')]=qs[_0x5857('0x1e')](_0x188334[_0x5857('0x31')][_0x5857('0x1e')]);_0x57549a[_0x5857('0x1d')]=qs['offset'](_0x188334['query']['offset']);}_0x57549a[_0x5857('0x39')]=qs[_0x5857('0x3a')](_0x188334['query'][_0x5857('0x3a')]);_0x57549a[_0x5857('0x3b')]=qs['filters'](_[_0x5857('0x3c')](_0x188334['query'],_0x51a1ba['filters']),_0x5300f9);if(_0x188334[_0x5857('0x31')][_0x5857('0x3d')]){_0x57549a['where']=_['merge'](_0x57549a[_0x5857('0x3b')],{'$or':_['map'](_0x5300f9,function(_0x3ba540){if(_0x3ba540[_0x5857('0x2e')]!==_0x5857('0x3e')){var _0x130a1b={};_0x130a1b[_0x3ba540[_0x5857('0x27')]]={'$like':'%'+_0x188334[_0x5857('0x31')][_0x5857('0x3d')]+'%'};return _0x130a1b;}})});}_0x57549a=_[_0x5857('0x3f')]({},_0x57549a,_0x188334[_0x5857('0x40')]);var _0x4be01d={'where':_0x57549a[_0x5857('0x3b')]};return db[_0x5857('0x2b')][_0x5857('0x20')](_0x4be01d)[_0x5857('0x24')](function(_0x88ee1c){_0x372dcb['count']=_0x88ee1c;if(_0x188334[_0x5857('0x31')][_0x5857('0x41')]){_0x57549a['include']=[{'all':!![]}];}return db['MailServerOut'][_0x5857('0x42')](_0x57549a);})[_0x5857('0x24')](function(_0x438dc2){_0x372dcb[_0x5857('0x43')]=_0x438dc2;return _0x372dcb;})[_0x5857('0x24')](respondWithFilteredResult(_0x406e9a,_0x57549a))[_0x5857('0x44')](handleError(_0x406e9a,null));};exports['show']=function(_0x4210b4,_0x202f9a){var _0x41164a={'raw':!![],'where':{'id':_0x4210b4[_0x5857('0x45')]['id']}},_0x44acf9={};_0x44acf9[_0x5857('0x30')]=_['keys'](db[_0x5857('0x2b')][_0x5857('0x2c')]);_0x44acf9[_0x5857('0x31')]=_['keys'](_0x4210b4[_0x5857('0x31')]);_0x44acf9[_0x5857('0x33')]=_['intersection'](_0x44acf9[_0x5857('0x30')],_0x44acf9[_0x5857('0x31')]);_0x41164a[_0x5857('0x36')]=_[_0x5857('0x34')](_0x44acf9['model'],qs[_0x5857('0x35')](_0x4210b4[_0x5857('0x31')][_0x5857('0x35')]));_0x41164a[_0x5857('0x36')]=_0x41164a[_0x5857('0x36')]['length']?_0x41164a[_0x5857('0x36')]:_0x44acf9[_0x5857('0x30')];if(_0x4210b4[_0x5857('0x31')]['includeAll']){_0x41164a[_0x5857('0x46')]=[{'all':!![]}];}_0x41164a=_[_0x5857('0x3f')]({},_0x41164a,_0x4210b4[_0x5857('0x40')]);return db[_0x5857('0x2b')][_0x5857('0x47')](_0x41164a)[_0x5857('0x24')](handleEntityNotFound(_0x202f9a,null))['then'](respondWithResult(_0x202f9a,null))[_0x5857('0x44')](handleError(_0x202f9a,null));};exports[_0x5857('0x48')]=function(_0x853ee6,_0x162274){return db[_0x5857('0x2b')][_0x5857('0x48')](_0x853ee6[_0x5857('0x49')],{})[_0x5857('0x24')](respondWithResult(_0x162274,0xc9))['catch'](handleError(_0x162274,null));};exports[_0x5857('0x23')]=function(_0x38b12b,_0x1df6f7){if(_0x38b12b[_0x5857('0x49')]['id']){delete _0x38b12b[_0x5857('0x49')]['id'];}return db['MailServerOut'][_0x5857('0x47')]({'where':{'id':_0x38b12b[_0x5857('0x45')]['id']}})[_0x5857('0x24')](handleEntityNotFound(_0x1df6f7,null))['then'](saveUpdates(_0x38b12b[_0x5857('0x49')],null))['then'](respondWithResult(_0x1df6f7,null))['catch'](handleError(_0x1df6f7,null));};exports[_0x5857('0x4a')]=function(_0x489fe6,_0x31608e){return db[_0x5857('0x2b')][_0x5857('0x47')]({'where':{'id':_0x489fe6[_0x5857('0x45')]['id']}})[_0x5857('0x24')](handleEntityNotFound(_0x31608e,null))['then'](removeEntity(_0x31608e,null))[_0x5857('0x44')](handleError(_0x31608e,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8b4c6e6..ffc2633 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 _0xc55c=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0xc55c,0x174));var _0xcc55=function(_0x455bbb,_0x4c24e9){_0x455bbb=_0x455bbb-0x0;var _0x4cf4cc=_0xc55c[_0x455bbb];return _0x4cf4cc;};'use strict';var _=require(_0xcc55('0x0'));var util=require(_0xcc55('0x1'));var logger=require(_0xcc55('0x2'))(_0xcc55('0x3'));var moment=require(_0xcc55('0x4'));var BPromise=require('bluebird');var rp=require(_0xcc55('0x5'));var fs=require('fs');var path=require(_0xcc55('0x6'));var rimraf=require(_0xcc55('0x7'));var config=require(_0xcc55('0x8'));var attributes=require(_0xcc55('0x9'));module[_0xcc55('0xa')]=function(_0x190d87,_0x5a61f3){return _0x190d87[_0xcc55('0xb')]('MailServerOut',attributes,{'tableName':_0xcc55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0d0=['request-promise','rimraf','./mailServerOut.attributes','exports','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb0d0,0x186));var _0x0b0d=function(_0x1de153,_0x308a62){_0x1de153=_0x1de153-0x0;var _0x34f328=_0xb0d0[_0x1de153];return _0x34f328;};'use strict';var _=require(_0x0b0d('0x0'));var util=require(_0x0b0d('0x1'));var logger=require(_0x0b0d('0x2'))(_0x0b0d('0x3'));var moment=require(_0x0b0d('0x4'));var BPromise=require(_0x0b0d('0x5'));var rp=require(_0x0b0d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b0d('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b0d('0x8'));module[_0x0b0d('0x9')]=function(_0x1e42ed,_0x15b27a){return _0x1e42ed['define']('MailServerOut',attributes,{'tableName':_0x0b0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 746e064..03a66f6 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 _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(_0x2f8194,_0x33bad8){var _0x427283=function(_0x53cc95){while(--_0x53cc95){_0x2f8194['push'](_0x2f8194['shift']());}};_0x427283(++_0x33bad8);}(_0x1261,0x144));var _0x1126=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x1261[_0xcd0918];return _0x250704;};'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 +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0xadb5,0xad));var _0x5adb=function(_0x17863f,_0x55f99c){_0x17863f=_0x17863f-0x0;var _0x3bf979=_0xadb5[_0x17863f];return _0x3bf979;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 528ae21..6cef273 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 _0x9071=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x36103d,_0x3453b9){var _0x4edadd=function(_0x1b6e64){while(--_0x1b6e64){_0x36103d['push'](_0x36103d['shift']());}};_0x4edadd(++_0x3453b9);}(_0x9071,0x101));var _0x1907=function(_0xa6a397,_0x1cafd7){_0xa6a397=_0xa6a397-0x0;var _0x53393f=_0x9071[_0xa6a397];return _0x53393f;};'use strict';var multer=require(_0x1907('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1907('0x1'));var express=require(_0x1907('0x2'));var router=express[_0x1907('0x3')]();var fs_extra=require(_0x1907('0x4'));var auth=require(_0x1907('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1907('0x6'));var controller=require(_0x1907('0x7'));router['get']('/',auth[_0x1907('0x8')](),controller[_0x1907('0x9')]);router[_0x1907('0xa')](_0x1907('0xb'),auth['isAuthenticated'](),controller[_0x1907('0xc')]);router['get'](_0x1907('0xd'),auth[_0x1907('0x8')](),controller['show']);router[_0x1907('0xe')]('/',auth[_0x1907('0x8')](),controller[_0x1907('0xf')]);router[_0x1907('0x10')](_0x1907('0xd'),auth['isAuthenticated'](),controller[_0x1907('0x11')]);router[_0x1907('0x12')]('/:id',auth[_0x1907('0x8')](),controller[_0x1907('0x13')]);module[_0x1907('0x14')]=router; \ No newline at end of file +var _0x9343=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id'];(function(_0x3c0f01,_0x587931){var _0xab2895=function(_0x28ccc9){while(--_0x28ccc9){_0x3c0f01['push'](_0x3c0f01['shift']());}};_0xab2895(++_0x587931);}(_0x9343,0x8f));var _0x3934=function(_0x4710ee,_0x14fbce){_0x4710ee=_0x4710ee-0x0;var _0x18d7e5=_0x9343[_0x4710ee];return _0x18d7e5;};'use strict';var multer=require(_0x3934('0x0'));var util=require('util');var path=require(_0x3934('0x1'));var timeout=require(_0x3934('0x2'));var express=require(_0x3934('0x3'));var router=express[_0x3934('0x4')]();var fs_extra=require(_0x3934('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3934('0x6'));var config=require(_0x3934('0x7'));var controller=require(_0x3934('0x8'));router[_0x3934('0x9')]('/',auth[_0x3934('0xa')](),controller[_0x3934('0xb')]);router[_0x3934('0x9')](_0x3934('0xc'),auth[_0x3934('0xa')](),controller[_0x3934('0xd')]);router['get']('/:id',auth[_0x3934('0xa')](),controller[_0x3934('0xe')]);router['post']('/',auth[_0x3934('0xa')](),controller[_0x3934('0xf')]);router['put'](_0x3934('0x10'),auth[_0x3934('0xa')](),controller[_0x3934('0x11')]);router[_0x3934('0x12')](_0x3934('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3934('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5ca30a7..3f8b823 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 _0x741c=['STRING','name','sequelize','exports'];(function(_0x672f2d,_0x194d37){var _0x4bb4f7=function(_0x3d27ad){while(--_0x3d27ad){_0x672f2d['push'](_0x672f2d['shift']());}};_0x4bb4f7(++_0x194d37);}(_0x741c,0x196));var _0xc741=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x741c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xc741('0x0'));module[_0xc741('0x1')]={'name':{'type':Sequelize[_0xc741('0x2')],'unique':_0xc741('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc741('0x2')]}}; \ No newline at end of file +var _0x8c46=['name','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8c46,0x171));var _0x68c4=function(_0x3425a9,_0x1add93){_0x3425a9=_0x3425a9-0x0;var _0x34a159=_0x8c46[_0x3425a9];return _0x34a159;};'use strict';var Sequelize=require(_0x68c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x68c4('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 964f9a9..56d4039 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 _0xe00d=['keys','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x145eff,_0x269003){var _0x1a7a9e=function(_0x55345f){while(--_0x55345f){_0x145eff['push'](_0x145eff['shift']());}};_0x1a7a9e(++_0x269003);}(_0xe00d,0x1cf));var _0xde00=function(_0x5c3491,_0x3b2f9d){_0x5c3491=_0x5c3491-0x0;var _0x5c43ed=_0xe00d[_0x5c3491];return _0x5c43ed;};'use strict';var emlformat=require(_0xde00('0x0'));var rimraf=require(_0xde00('0x1'));var zipdir=require(_0xde00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde00('0x3'));var moment=require(_0xde00('0x4'));var BPromise=require(_0xde00('0x5'));var Mustache=require(_0xde00('0x6'));var util=require('util');var path=require('path');var sox=require(_0xde00('0x7'));var csv=require('to-csv');var ejs=require(_0xde00('0x8'));var fs=require('fs');var fs_extra=require(_0xde00('0x9'));var _=require(_0xde00('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde00('0xb'));var deskjs=require(_0xde00('0xc'));var toCsv=require(_0xde00('0xd'));var querystring=require(_0xde00('0xe'));var Papa=require(_0xde00('0xf'));var Redis=require(_0xde00('0x10'));var authService=require(_0xde00('0x11'));var qs=require(_0xde00('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde00('0x13'));var logger=require('../../config/logger')(_0xde00('0x14'));var utils=require(_0xde00('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde00('0x16'));var db=require(_0xde00('0x17'))['db'];function respondWithStatusCode(_0x52e8ac,_0x33bda7){_0x33bda7=_0x33bda7||0xcc;return function(_0x4fc92e){if(_0x4fc92e){return _0x52e8ac[_0xde00('0x18')](_0x33bda7);}return _0x52e8ac[_0xde00('0x19')](_0x33bda7)[_0xde00('0x1a')]();};}function respondWithResult(_0x4420c3,_0x2b7539){_0x2b7539=_0x2b7539||0xc8;return function(_0x598e27){if(_0x598e27){return _0x4420c3['status'](_0x2b7539)[_0xde00('0x1b')](_0x598e27);}};}function respondWithFilteredResult(_0x3a55a9,_0x3d50e3){return function(_0x5d13a2){if(_0x5d13a2){var _0x505197=typeof _0x3d50e3['offset']===_0xde00('0x1c')&&typeof _0x3d50e3[_0xde00('0x1d')]===_0xde00('0x1c');var _0x42e4cf=_0x5d13a2[_0xde00('0x1e')];var _0x52b55a=_0x505197?0x0:_0x3d50e3[_0xde00('0x1f')];var _0x5ac550=_0x505197?_0x5d13a2[_0xde00('0x1e')]:_0x3d50e3[_0xde00('0x1f')]+_0x3d50e3['limit'];var _0x531942;if(_0x5ac550>=_0x42e4cf){_0x5ac550=_0x42e4cf;_0x531942=0xc8;}else{_0x531942=0xce;}_0x3a55a9['status'](_0x531942);return _0x3a55a9['set'](_0xde00('0x20'),_0x52b55a+'-'+_0x5ac550+'/'+_0x42e4cf)[_0xde00('0x1b')](_0x5d13a2);}return null;};}function patchUpdates(_0x14629f){return function(_0xbff0a5){try{jsonpatch[_0xde00('0x21')](_0xbff0a5,_0x14629f,!![]);}catch(_0x591534){return BPromise[_0xde00('0x22')](_0x591534);}return _0xbff0a5['save']();};}function saveUpdates(_0x51c7b2,_0x511e38){return function(_0x47f8a5){if(_0x47f8a5){return _0x47f8a5[_0xde00('0x23')](_0x51c7b2)[_0xde00('0x24')](function(_0x1bbfb7){return _0x1bbfb7;});}return null;};}function removeEntity(_0x49dfec,_0x4c4a39){return function(_0x126d05){if(_0x126d05){return _0x126d05[_0xde00('0x25')]()[_0xde00('0x24')](function(){_0x49dfec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb62bff,_0xe37972){return function(_0x403b39){if(!_0x403b39){_0xb62bff[_0xde00('0x18')](0x194);}return _0x403b39;};}function handleError(_0x2ec34d,_0x76da6a){_0x76da6a=_0x76da6a||0x1f4;return function(_0x4d4574){logger[_0xde00('0x26')](_0x4d4574[_0xde00('0x27')]);if(_0x4d4574[_0xde00('0x28')]){delete _0x4d4574['name'];}_0x2ec34d[_0xde00('0x19')](_0x76da6a)[_0xde00('0x29')](_0x4d4574);};}exports['index']=function(_0x163879,_0x52c01e){var _0x2b5173={},_0x3577ed={},_0x19461e={'count':0x0,'rows':[]};var _0x5e9360=_[_0xde00('0x2a')](db[_0xde00('0x2b')][_0xde00('0x2c')],function(_0x5c9172){return{'name':_0x5c9172[_0xde00('0x2d')],'type':_0x5c9172[_0xde00('0x2e')][_0xde00('0x2f')]};});_0x3577ed[_0xde00('0x30')]=_[_0xde00('0x2a')](_0x5e9360,'name');_0x3577ed[_0xde00('0x31')]=_['keys'](_0x163879['query']);_0x3577ed[_0xde00('0x32')]=_[_0xde00('0x33')](_0x3577ed['model'],_0x3577ed[_0xde00('0x31')]);_0x2b5173[_0xde00('0x34')]=_[_0xde00('0x33')](_0x3577ed[_0xde00('0x30')],qs[_0xde00('0x35')](_0x163879[_0xde00('0x31')]['fields']));_0x2b5173[_0xde00('0x34')]=_0x2b5173[_0xde00('0x34')][_0xde00('0x36')]?_0x2b5173[_0xde00('0x34')]:_0x3577ed[_0xde00('0x30')];if(!_0x163879[_0xde00('0x31')][_0xde00('0x37')](_0xde00('0x38'))){_0x2b5173[_0xde00('0x1d')]=qs[_0xde00('0x1d')](_0x163879[_0xde00('0x31')][_0xde00('0x1d')]);_0x2b5173[_0xde00('0x1f')]=qs[_0xde00('0x1f')](_0x163879[_0xde00('0x31')][_0xde00('0x1f')]);}_0x2b5173[_0xde00('0x39')]=qs[_0xde00('0x3a')](_0x163879[_0xde00('0x31')][_0xde00('0x3a')]);_0x2b5173[_0xde00('0x3b')]=qs['filters'](_['pick'](_0x163879[_0xde00('0x31')],_0x3577ed[_0xde00('0x32')]),_0x5e9360);if(_0x163879[_0xde00('0x31')]['filter']){_0x2b5173[_0xde00('0x3b')]=_[_0xde00('0x3c')](_0x2b5173[_0xde00('0x3b')],{'$or':_['map'](_0x5e9360,function(_0x19ae0d){if(_0x19ae0d[_0xde00('0x2e')]!==_0xde00('0x3d')){var _0x4a670a={};_0x4a670a[_0x19ae0d[_0xde00('0x28')]]={'$like':'%'+_0x163879['query'][_0xde00('0x3e')]+'%'};return _0x4a670a;}})});}_0x2b5173=_[_0xde00('0x3c')]({},_0x2b5173,_0x163879[_0xde00('0x3f')]);var _0x37610c={'where':_0x2b5173[_0xde00('0x3b')]};return db[_0xde00('0x2b')][_0xde00('0x1e')](_0x37610c)['then'](function(_0x3febc9){_0x19461e['count']=_0x3febc9;if(_0x163879[_0xde00('0x31')][_0xde00('0x40')]){_0x2b5173[_0xde00('0x41')]=[{'all':!![]}];}return db[_0xde00('0x2b')][_0xde00('0x42')](_0x2b5173);})[_0xde00('0x24')](function(_0x512981){_0x19461e[_0xde00('0x43')]=_0x512981;return _0x19461e;})[_0xde00('0x24')](respondWithFilteredResult(_0x52c01e,_0x2b5173))['catch'](handleError(_0x52c01e,null));};exports[_0xde00('0x44')]=function(_0x1a5caa,_0x341add){var _0x516c59={'raw':!![],'where':{'id':_0x1a5caa['params']['id']}},_0x11b8b3={};_0x11b8b3[_0xde00('0x30')]=_[_0xde00('0x45')](db['MailSubstatus'][_0xde00('0x2c')]);_0x11b8b3['query']=_[_0xde00('0x45')](_0x1a5caa[_0xde00('0x31')]);_0x11b8b3[_0xde00('0x32')]=_[_0xde00('0x33')](_0x11b8b3[_0xde00('0x30')],_0x11b8b3[_0xde00('0x31')]);_0x516c59['attributes']=_['intersection'](_0x11b8b3[_0xde00('0x30')],qs[_0xde00('0x35')](_0x1a5caa[_0xde00('0x31')][_0xde00('0x35')]));_0x516c59[_0xde00('0x34')]=_0x516c59[_0xde00('0x34')]['length']?_0x516c59[_0xde00('0x34')]:_0x11b8b3['model'];if(_0x1a5caa[_0xde00('0x31')][_0xde00('0x40')]){_0x516c59[_0xde00('0x41')]=[{'all':!![]}];}_0x516c59=_[_0xde00('0x3c')]({},_0x516c59,_0x1a5caa[_0xde00('0x3f')]);return db[_0xde00('0x2b')]['find'](_0x516c59)[_0xde00('0x24')](handleEntityNotFound(_0x341add,null))[_0xde00('0x24')](respondWithResult(_0x341add,null))[_0xde00('0x46')](handleError(_0x341add,null));};exports[_0xde00('0x47')]=function(_0x19a6aa,_0x5c8861){return db[_0xde00('0x2b')][_0xde00('0x47')](_0x19a6aa[_0xde00('0x48')],{})[_0xde00('0x24')](respondWithResult(_0x5c8861,0xc9))[_0xde00('0x46')](handleError(_0x5c8861,null));};exports[_0xde00('0x23')]=function(_0x542367,_0x22761f){if(_0x542367['body']['id']){delete _0x542367[_0xde00('0x48')]['id'];}return db['MailSubstatus'][_0xde00('0x49')]({'where':{'id':_0x542367[_0xde00('0x4a')]['id']}})[_0xde00('0x24')](handleEntityNotFound(_0x22761f,null))[_0xde00('0x24')](saveUpdates(_0x542367[_0xde00('0x48')],null))[_0xde00('0x24')](respondWithResult(_0x22761f,null))[_0xde00('0x46')](handleError(_0x22761f,null));};exports[_0xde00('0x25')]=function(_0x155c67,_0xae12d){return db[_0xde00('0x2b')]['find']({'where':{'id':_0x155c67[_0xde00('0x4a')]['id']}})[_0xde00('0x24')](handleEntityNotFound(_0xae12d,null))[_0xde00('0x24')](removeEntity(_0xae12d,null))[_0xde00('0x46')](handleError(_0xae12d,null));};exports[_0xde00('0x4b')]=function(_0x3f66f5,_0x5823f8){return db[_0xde00('0x2b')][_0xde00('0x4b')]()[_0xde00('0x24')](respondWithResult(_0x5823f8,null))[_0xde00('0x46')](handleError(_0x5823f8,null));}; \ No newline at end of file +var _0x613e=['then','destroy','end','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x12d814,_0x21e2ed){var _0x1d52b2=function(_0x2b1c5b){while(--_0x2b1c5b){_0x12d814['push'](_0x12d814['shift']());}};_0x1d52b2(++_0x21e2ed);}(_0x613e,0xc5));var _0xe613=function(_0x134499,_0x55fbee){_0x134499=_0x134499-0x0;var _0x2ba945=_0x613e[_0x134499];return _0x2ba945;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe613('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe613('0x1'));var rp=require(_0xe613('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe613('0x3'));var util=require(_0xe613('0x4'));var path=require(_0xe613('0x5'));var sox=require(_0xe613('0x6'));var csv=require(_0xe613('0x7'));var ejs=require(_0xe613('0x8'));var fs=require('fs');var fs_extra=require(_0xe613('0x9'));var _=require(_0xe613('0xa'));var squel=require('squel');var crypto=require(_0xe613('0xb'));var jsforce=require(_0xe613('0xc'));var deskjs=require(_0xe613('0xd'));var toCsv=require(_0xe613('0x7'));var querystring=require(_0xe613('0xe'));var Papa=require(_0xe613('0xf'));var Redis=require(_0xe613('0x10'));var authService=require(_0xe613('0x11'));var qs=require(_0xe613('0x12'));var as=require(_0xe613('0x13'));var hardwareService=require(_0xe613('0x14'));var logger=require(_0xe613('0x15'))('api');var utils=require(_0xe613('0x16'));var config=require(_0xe613('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe613('0x18'))['db'];function respondWithStatusCode(_0x4d232e,_0x4be6b9){_0x4be6b9=_0x4be6b9||0xcc;return function(_0xad254a){if(_0xad254a){return _0x4d232e['sendStatus'](_0x4be6b9);}return _0x4d232e[_0xe613('0x19')](_0x4be6b9)['end']();};}function respondWithResult(_0x427cc7,_0x3eaed4){_0x3eaed4=_0x3eaed4||0xc8;return function(_0x47e24f){if(_0x47e24f){return _0x427cc7['status'](_0x3eaed4)[_0xe613('0x1a')](_0x47e24f);}};}function respondWithFilteredResult(_0x413bf1,_0xab922f){return function(_0x40d75d){if(_0x40d75d){var _0x2bfcea=typeof _0xab922f[_0xe613('0x1b')]===_0xe613('0x1c')&&typeof _0xab922f[_0xe613('0x1d')]==='undefined';var _0x5c84fd=_0x40d75d[_0xe613('0x1e')];var _0x35ac94=_0x2bfcea?0x0:_0xab922f[_0xe613('0x1b')];var _0x2497a0=_0x2bfcea?_0x40d75d['count']:_0xab922f[_0xe613('0x1b')]+_0xab922f[_0xe613('0x1d')];var _0x157e11;if(_0x2497a0>=_0x5c84fd){_0x2497a0=_0x5c84fd;_0x157e11=0xc8;}else{_0x157e11=0xce;}_0x413bf1[_0xe613('0x19')](_0x157e11);return _0x413bf1[_0xe613('0x1f')](_0xe613('0x20'),_0x35ac94+'-'+_0x2497a0+'/'+_0x5c84fd)['json'](_0x40d75d);}return null;};}function patchUpdates(_0x205734){return function(_0x2e680c){try{jsonpatch[_0xe613('0x21')](_0x2e680c,_0x205734,!![]);}catch(_0x191d56){return BPromise[_0xe613('0x22')](_0x191d56);}return _0x2e680c[_0xe613('0x23')]();};}function saveUpdates(_0x207397,_0x42bf0b){return function(_0x59d708){if(_0x59d708){return _0x59d708[_0xe613('0x24')](_0x207397)[_0xe613('0x25')](function(_0xc7d72){return _0xc7d72;});}return null;};}function removeEntity(_0x395b7f,_0x2292ba){return function(_0x4485f9){if(_0x4485f9){return _0x4485f9[_0xe613('0x26')]()[_0xe613('0x25')](function(){_0x395b7f[_0xe613('0x19')](0xcc)[_0xe613('0x27')]();});}};}function handleEntityNotFound(_0x215567,_0x371de2){return function(_0x5dc881){if(!_0x5dc881){_0x215567['sendStatus'](0x194);}return _0x5dc881;};}function handleError(_0x3160aa,_0x39b101){_0x39b101=_0x39b101||0x1f4;return function(_0xbc6aee){logger[_0xe613('0x28')](_0xbc6aee[_0xe613('0x29')]);if(_0xbc6aee[_0xe613('0x2a')]){delete _0xbc6aee[_0xe613('0x2a')];}_0x3160aa['status'](_0x39b101)[_0xe613('0x2b')](_0xbc6aee);};}exports[_0xe613('0x2c')]=function(_0x3714d0,_0x4f536b){var _0x3304e2={},_0xd1c01={},_0x520a40={'count':0x0,'rows':[]};var _0x1ce429=_['map'](db[_0xe613('0x2d')][_0xe613('0x2e')],function(_0x1196ff){return{'name':_0x1196ff[_0xe613('0x2f')],'type':_0x1196ff[_0xe613('0x30')][_0xe613('0x31')]};});_0xd1c01[_0xe613('0x32')]=_[_0xe613('0x33')](_0x1ce429,_0xe613('0x2a'));_0xd1c01['query']=_[_0xe613('0x34')](_0x3714d0['query']);_0xd1c01['filters']=_[_0xe613('0x35')](_0xd1c01[_0xe613('0x32')],_0xd1c01[_0xe613('0x36')]);_0x3304e2[_0xe613('0x37')]=_[_0xe613('0x35')](_0xd1c01[_0xe613('0x32')],qs[_0xe613('0x38')](_0x3714d0[_0xe613('0x36')][_0xe613('0x38')]));_0x3304e2[_0xe613('0x37')]=_0x3304e2[_0xe613('0x37')][_0xe613('0x39')]?_0x3304e2[_0xe613('0x37')]:_0xd1c01['model'];if(!_0x3714d0['query'][_0xe613('0x3a')]('nolimit')){_0x3304e2[_0xe613('0x1d')]=qs[_0xe613('0x1d')](_0x3714d0[_0xe613('0x36')][_0xe613('0x1d')]);_0x3304e2[_0xe613('0x1b')]=qs[_0xe613('0x1b')](_0x3714d0['query'][_0xe613('0x1b')]);}_0x3304e2[_0xe613('0x3b')]=qs[_0xe613('0x3c')](_0x3714d0['query'][_0xe613('0x3c')]);_0x3304e2[_0xe613('0x3d')]=qs[_0xe613('0x3e')](_[_0xe613('0x3f')](_0x3714d0[_0xe613('0x36')],_0xd1c01['filters']),_0x1ce429);if(_0x3714d0['query'][_0xe613('0x40')]){_0x3304e2[_0xe613('0x3d')]=_['merge'](_0x3304e2[_0xe613('0x3d')],{'$or':_[_0xe613('0x33')](_0x1ce429,function(_0x50ea1c){if(_0x50ea1c[_0xe613('0x30')]!==_0xe613('0x41')){var _0x30d9b2={};_0x30d9b2[_0x50ea1c['name']]={'$like':'%'+_0x3714d0[_0xe613('0x36')][_0xe613('0x40')]+'%'};return _0x30d9b2;}})});}_0x3304e2=_[_0xe613('0x42')]({},_0x3304e2,_0x3714d0['options']);var _0x518cc4={'where':_0x3304e2[_0xe613('0x3d')]};return db[_0xe613('0x2d')][_0xe613('0x1e')](_0x518cc4)[_0xe613('0x25')](function(_0x1f093d){_0x520a40[_0xe613('0x1e')]=_0x1f093d;if(_0x3714d0['query'][_0xe613('0x43')]){_0x3304e2[_0xe613('0x44')]=[{'all':!![]}];}return db[_0xe613('0x2d')][_0xe613('0x45')](_0x3304e2);})[_0xe613('0x25')](function(_0x4e23d4){_0x520a40['rows']=_0x4e23d4;return _0x520a40;})[_0xe613('0x25')](respondWithFilteredResult(_0x4f536b,_0x3304e2))[_0xe613('0x46')](handleError(_0x4f536b,null));};exports[_0xe613('0x47')]=function(_0x5c362b,_0x58f8b8){var _0x2c72ae={'raw':!![],'where':{'id':_0x5c362b['params']['id']}},_0x2e3c80={};_0x2e3c80[_0xe613('0x32')]=_[_0xe613('0x34')](db[_0xe613('0x2d')]['rawAttributes']);_0x2e3c80[_0xe613('0x36')]=_[_0xe613('0x34')](_0x5c362b['query']);_0x2e3c80['filters']=_[_0xe613('0x35')](_0x2e3c80[_0xe613('0x32')],_0x2e3c80[_0xe613('0x36')]);_0x2c72ae['attributes']=_[_0xe613('0x35')](_0x2e3c80['model'],qs['fields'](_0x5c362b[_0xe613('0x36')][_0xe613('0x38')]));_0x2c72ae['attributes']=_0x2c72ae['attributes'][_0xe613('0x39')]?_0x2c72ae['attributes']:_0x2e3c80[_0xe613('0x32')];if(_0x5c362b[_0xe613('0x36')][_0xe613('0x43')]){_0x2c72ae['include']=[{'all':!![]}];}_0x2c72ae=_[_0xe613('0x42')]({},_0x2c72ae,_0x5c362b[_0xe613('0x48')]);return db[_0xe613('0x2d')][_0xe613('0x49')](_0x2c72ae)[_0xe613('0x25')](handleEntityNotFound(_0x58f8b8,null))[_0xe613('0x25')](respondWithResult(_0x58f8b8,null))[_0xe613('0x46')](handleError(_0x58f8b8,null));};exports[_0xe613('0x4a')]=function(_0x5e2c47,_0xa73382){return db[_0xe613('0x2d')][_0xe613('0x4a')](_0x5e2c47[_0xe613('0x4b')],{})[_0xe613('0x25')](respondWithResult(_0xa73382,0xc9))[_0xe613('0x46')](handleError(_0xa73382,null));};exports[_0xe613('0x24')]=function(_0x1651aa,_0x113bfb){if(_0x1651aa[_0xe613('0x4b')]['id']){delete _0x1651aa['body']['id'];}return db[_0xe613('0x2d')][_0xe613('0x49')]({'where':{'id':_0x1651aa[_0xe613('0x4c')]['id']}})[_0xe613('0x25')](handleEntityNotFound(_0x113bfb,null))[_0xe613('0x25')](saveUpdates(_0x1651aa['body'],null))[_0xe613('0x25')](respondWithResult(_0x113bfb,null))['catch'](handleError(_0x113bfb,null));};exports[_0xe613('0x26')]=function(_0x1c2145,_0x5abd16){return db[_0xe613('0x2d')][_0xe613('0x49')]({'where':{'id':_0x1c2145[_0xe613('0x4c')]['id']}})[_0xe613('0x25')](handleEntityNotFound(_0x5abd16,null))[_0xe613('0x25')](removeEntity(_0x5abd16,null))[_0xe613('0x46')](handleError(_0x5abd16,null));};exports['describe']=function(_0x1d7e58,_0x240bf9){return db[_0xe613('0x2d')][_0xe613('0x4d')]()['then'](respondWithResult(_0x240bf9,null))[_0xe613('0x46')](handleError(_0x240bf9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index fe65c85..3b994c3 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 _0xd2d7=['api','bluebird','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','mail_substatuses','lodash'];(function(_0x4a58f1,_0x20aff3){var _0x452292=function(_0x2f7fcd){while(--_0x2f7fcd){_0x4a58f1['push'](_0x4a58f1['shift']());}};_0x452292(++_0x20aff3);}(_0xd2d7,0x1dc));var _0x7d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d2d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d2d('0x1'));var moment=require('moment');var BPromise=require(_0x7d2d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d2d('0x3'));var rimraf=require(_0x7d2d('0x4'));var config=require(_0x7d2d('0x5'));var attributes=require(_0x7d2d('0x6'));module['exports']=function(_0x14e3ed,_0x97daf6){return _0x14e3ed[_0x7d2d('0x7')]('MailSubstatus',attributes,{'tableName':_0x7d2d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8e7=['moment','request-promise','path','rimraf','../../config/environment','MailSubstatus','lodash','util','../../config/logger'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xe8e7,0x192));var _0x7e8e=function(_0x37bea1,_0x29c12d){_0x37bea1=_0x37bea1-0x0;var _0x240caa=_0xe8e7[_0x37bea1];return _0x240caa;};'use strict';var _=require(_0x7e8e('0x0'));var util=require(_0x7e8e('0x1'));var logger=require(_0x7e8e('0x2'))('api');var moment=require(_0x7e8e('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e8e('0x4'));var fs=require('fs');var path=require(_0x7e8e('0x5'));var rimraf=require(_0x7e8e('0x6'));var config=require(_0x7e8e('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x211fb9,_0xafe517){return _0x211fb9['define'](_0x7e8e('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 3bb02cc..b563ec3 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 _0x1041=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xbf6f32,_0x3d793a){var _0x1d3ecc=function(_0x2f236e){while(--_0x2f236e){_0xbf6f32['push'](_0xbf6f32['shift']());}};_0x1d3ecc(++_0x3d793a);}(_0x1041,0x19f));var _0x1104=function(_0x19c64f,_0x2ae7d2){_0x19c64f=_0x19c64f-0x0;var _0x47bac7=_0x1041[_0x19c64f];return _0x47bac7;};'use strict';var _=require(_0x1104('0x0'));var util=require('util');var moment=require(_0x1104('0x1'));var BPromise=require('bluebird');var rs=require(_0x1104('0x2'));var fs=require('fs');var Redis=require(_0x1104('0x3'));var db=require(_0x1104('0x4'))['db'];var utils=require(_0x1104('0x5'));var logger=require(_0x1104('0x6'))(_0x1104('0x7'));var config=require(_0x1104('0x8'));var jayson=require(_0x1104('0x9'));var client=jayson['client'][_0x1104('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x184099,_0x2df7b2,_0x5cf021){return new BPromise(function(_0xa4bad7,_0x1d5b48){return client[_0x1104('0xb')](_0x184099,_0x5cf021)['then'](function(_0x53506e){logger[_0x1104('0xc')](_0x1104('0xd'),_0x2df7b2,_0x1104('0xe'));logger['debug'](_0x1104('0xf'),_0x2df7b2,_0x1104('0xe'),JSON[_0x1104('0x10')](_0x53506e));if(_0x53506e[_0x1104('0x11')]){if(_0x53506e['error'][_0x1104('0x12')]===0x1f4){logger[_0x1104('0x11')](_0x1104('0xd'),_0x2df7b2,_0x53506e[_0x1104('0x11')]['message']);return _0x1d5b48(_0x53506e[_0x1104('0x11')][_0x1104('0x13')]);}logger[_0x1104('0x11')](_0x1104('0xd'),_0x2df7b2,_0x53506e[_0x1104('0x11')][_0x1104('0x13')]);return _0xa4bad7(_0x53506e[_0x1104('0x11')][_0x1104('0x13')]);}else{logger[_0x1104('0xc')](_0x1104('0xd'),_0x2df7b2,'request\x20sent');_0xa4bad7(_0x53506e[_0x1104('0x14')]['message']);}})['catch'](function(_0xe309b1){logger['error'](_0x1104('0xd'),_0x2df7b2,_0xe309b1);_0x1d5b48(_0xe309b1);});});} \ No newline at end of file +var _0xf2fc=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x539bb2,_0x1692ba){var _0x137078=function(_0x43ff6c){while(--_0x43ff6c){_0x539bb2['push'](_0x539bb2['shift']());}};_0x137078(++_0x1692ba);}(_0xf2fc,0x19c));var _0xcf2f=function(_0x558602,_0x2e8d6f){_0x558602=_0x558602-0x0;var _0x4d1cd1=_0xf2fc[_0x558602];return _0x4d1cd1;};'use strict';var _=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var moment=require(_0xcf2f('0x2'));var BPromise=require(_0xcf2f('0x3'));var rs=require(_0xcf2f('0x4'));var fs=require('fs');var Redis=require(_0xcf2f('0x5'));var db=require(_0xcf2f('0x6'))['db'];var utils=require(_0xcf2f('0x7'));var logger=require('../../config/logger')(_0xcf2f('0x8'));var config=require(_0xcf2f('0x9'));var jayson=require(_0xcf2f('0xa'));var client=jayson['client'][_0xcf2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x309046,_0x164201,_0x3bb503){return new BPromise(function(_0x16d6e9,_0x64ae72){return client[_0xcf2f('0xc')](_0x309046,_0x3bb503)[_0xcf2f('0xd')](function(_0x1a9abb){logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x164201,_0xcf2f('0x10'));logger[_0xcf2f('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x164201,'request\x20sent',JSON[_0xcf2f('0x12')](_0x1a9abb));if(_0x1a9abb[_0xcf2f('0x13')]){if(_0x1a9abb['error'][_0xcf2f('0x14')]===0x1f4){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x164201,_0x1a9abb['error'][_0xcf2f('0x15')]);return _0x64ae72(_0x1a9abb[_0xcf2f('0x13')][_0xcf2f('0x15')]);}logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x164201,_0x1a9abb[_0xcf2f('0x13')][_0xcf2f('0x15')]);return _0x16d6e9(_0x1a9abb[_0xcf2f('0x13')][_0xcf2f('0x15')]);}else{logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x164201,'request\x20sent');_0x16d6e9(_0x1a9abb[_0xcf2f('0x16')]['message']);}})[_0xcf2f('0x17')](function(_0x10825a){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x164201,_0x10825a);_0x64ae72(_0x10825a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 7f98c69..fdec1fe 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 _0x7a0d=['Router','../../components/interaction/service','./mailTransferReport.controller','get','index','isAuthenticated','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x546d1d,_0x563949){var _0x89bcfb=function(_0x1089af){while(--_0x1089af){_0x546d1d['push'](_0x546d1d['shift']());}};_0x89bcfb(++_0x563949);}(_0x7a0d,0xc1));var _0xd7a0=function(_0x112147,_0x4e692e){_0x112147=_0x112147-0x0;var _0x3ba744=_0x7a0d[_0x112147];return _0x3ba744;};'use strict';var multer=require(_0xd7a0('0x0'));var util=require(_0xd7a0('0x1'));var path=require(_0xd7a0('0x2'));var timeout=require(_0xd7a0('0x3'));var express=require(_0xd7a0('0x4'));var router=express[_0xd7a0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7a0('0x6'));var config=require('../../config/environment');var controller=require(_0xd7a0('0x7'));router[_0xd7a0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7a0('0x9')]);router[_0xd7a0('0x8')]('/describe',auth[_0xd7a0('0xa')](),controller['describe']);router['get'](_0xd7a0('0xb'),auth[_0xd7a0('0xa')](),controller[_0xd7a0('0xc')]);router[_0xd7a0('0xd')]('/',auth[_0xd7a0('0xa')](),controller[_0xd7a0('0xe')]);router[_0xd7a0('0xf')](_0xd7a0('0xb'),auth['isAuthenticated'](),controller[_0xd7a0('0x10')]);router[_0xd7a0('0x11')](_0xd7a0('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d1b=['/:id','show','post','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','/describe'];(function(_0x5c0966,_0x2eb094){var _0xeb25ef=function(_0x2b18f0){while(--_0x2b18f0){_0x5c0966['push'](_0x5c0966['shift']());}};_0xeb25ef(++_0x2eb094);}(_0x5d1b,0xc2));var _0xb5d1=function(_0x1e78b7,_0x7b9f57){_0x1e78b7=_0x1e78b7-0x0;var _0x3ce971=_0x5d1b[_0x1e78b7];return _0x3ce971;};'use strict';var multer=require(_0xb5d1('0x0'));var util=require(_0xb5d1('0x1'));var path=require(_0xb5d1('0x2'));var timeout=require(_0xb5d1('0x3'));var express=require('express');var router=express[_0xb5d1('0x4')]();var fs_extra=require(_0xb5d1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5d1('0x6'));var controller=require(_0xb5d1('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb5d1('0x8')](_0xb5d1('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xb5d1('0x8')](_0xb5d1('0xa'),auth['isAuthenticated'](),controller[_0xb5d1('0xb')]);router[_0xb5d1('0xc')]('/',auth[_0xb5d1('0xd')](),controller['create']);router['put'](_0xb5d1('0xa'),auth[_0xb5d1('0xd')](),controller['update']);router[_0xb5d1('0xe')](_0xb5d1('0xa'),auth[_0xb5d1('0xd')](),controller[_0xb5d1('0xf')]);module[_0xb5d1('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5d0c97c..f914bbb 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x23e785,_0x2b304a){var _0x44762b=function(_0x4981d4){while(--_0x4981d4){_0x23e785['push'](_0x23e785['shift']());}};_0x44762b(++_0x2b304a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcb91[_0x51020b];return _0x371e47;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5a3bb9,_0x15a437){var _0x10e646=function(_0x517a3f){while(--_0x517a3f){_0x5a3bb9['push'](_0x5a3bb9['shift']());}};_0x10e646(++_0x15a437);}(_0xaa88,0x137));var _0x8aa8=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xaa88[_0x3dc538];return _0x72c2fd;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 4314a7c..bbd1920 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 _0x9fcc=['body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','then','catch','show','params','keys','options','create'];(function(_0x43db25,_0x5204ae){var _0x5d0da1=function(_0x49db0f){while(--_0x49db0f){_0x43db25['push'](_0x43db25['shift']());}};_0x5d0da1(++_0x5204ae);}(_0x9fcc,0xe8));var _0xc9fc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9fcc[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xc9fc('0x0'));var rimraf=require(_0xc9fc('0x1'));var zipdir=require(_0xc9fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9fc('0x3'));var moment=require(_0xc9fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9fc('0x5'));var util=require(_0xc9fc('0x6'));var path=require(_0xc9fc('0x7'));var sox=require(_0xc9fc('0x8'));var csv=require(_0xc9fc('0x9'));var ejs=require(_0xc9fc('0xa'));var fs=require('fs');var fs_extra=require(_0xc9fc('0xb'));var _=require('lodash');var squel=require(_0xc9fc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc9fc('0xd'));var toCsv=require(_0xc9fc('0x9'));var querystring=require('querystring');var Papa=require(_0xc9fc('0xe'));var Redis=require(_0xc9fc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc9fc('0x10'));var as=require(_0xc9fc('0x11'));var hardwareService=require(_0xc9fc('0x12'));var logger=require(_0xc9fc('0x13'))(_0xc9fc('0x14'));var utils=require(_0xc9fc('0x15'));var config=require(_0xc9fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9fc('0x17'))['db'];function respondWithStatusCode(_0x56fd10,_0x46f936){_0x46f936=_0x46f936||0xcc;return function(_0x54244f){if(_0x54244f){return _0x56fd10[_0xc9fc('0x18')](_0x46f936);}return _0x56fd10[_0xc9fc('0x19')](_0x46f936)[_0xc9fc('0x1a')]();};}function respondWithResult(_0x508bf7,_0x2965e6){_0x2965e6=_0x2965e6||0xc8;return function(_0x4b57e3){if(_0x4b57e3){return _0x508bf7[_0xc9fc('0x19')](_0x2965e6)[_0xc9fc('0x1b')](_0x4b57e3);}};}function respondWithFilteredResult(_0x7d0763,_0xe2d6f1){return function(_0x17c379){if(_0x17c379){var _0x193aca=typeof _0xe2d6f1[_0xc9fc('0x1c')]===_0xc9fc('0x1d')&&typeof _0xe2d6f1[_0xc9fc('0x1e')]===_0xc9fc('0x1d');var _0x25628a=_0x17c379[_0xc9fc('0x1f')];var _0x2be89a=_0x193aca?0x0:_0xe2d6f1[_0xc9fc('0x1c')];var _0x1bc791=_0x193aca?_0x17c379[_0xc9fc('0x1f')]:_0xe2d6f1[_0xc9fc('0x1c')]+_0xe2d6f1[_0xc9fc('0x1e')];var _0x1253d7;if(_0x1bc791>=_0x25628a){_0x1bc791=_0x25628a;_0x1253d7=0xc8;}else{_0x1253d7=0xce;}_0x7d0763[_0xc9fc('0x19')](_0x1253d7);return _0x7d0763[_0xc9fc('0x20')](_0xc9fc('0x21'),_0x2be89a+'-'+_0x1bc791+'/'+_0x25628a)['json'](_0x17c379);}return null;};}function patchUpdates(_0x2bb0b6){return function(_0x3eef2c){try{jsonpatch[_0xc9fc('0x22')](_0x3eef2c,_0x2bb0b6,!![]);}catch(_0x377902){return BPromise[_0xc9fc('0x23')](_0x377902);}return _0x3eef2c['save']();};}function saveUpdates(_0x365c9a,_0x30ba6b){return function(_0x41a42a){if(_0x41a42a){return _0x41a42a[_0xc9fc('0x24')](_0x365c9a)['then'](function(_0x1658f6){return _0x1658f6;});}return null;};}function removeEntity(_0x43ace7,_0x208909){return function(_0x5af71a){if(_0x5af71a){return _0x5af71a['destroy']()['then'](function(){_0x43ace7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8cc3e6,_0x28b33b){return function(_0x44d1df){if(!_0x44d1df){_0x8cc3e6['sendStatus'](0x194);}return _0x44d1df;};}function handleError(_0x548cb4,_0x33f522){_0x33f522=_0x33f522||0x1f4;return function(_0xd17d0b){logger[_0xc9fc('0x25')](_0xd17d0b[_0xc9fc('0x26')]);if(_0xd17d0b[_0xc9fc('0x27')]){delete _0xd17d0b[_0xc9fc('0x27')];}_0x548cb4[_0xc9fc('0x19')](_0x33f522)[_0xc9fc('0x28')](_0xd17d0b);};}exports[_0xc9fc('0x29')]=function(_0x2bae8d,_0x29a35a){var _0x5574be={},_0x514dc8={},_0x26a894={'count':0x0,'rows':[]};var _0x5833a0=_[_0xc9fc('0x2a')](db[_0xc9fc('0x2b')][_0xc9fc('0x2c')],function(_0x10cd5e){return{'name':_0x10cd5e[_0xc9fc('0x2d')],'type':_0x10cd5e['type']['key']};});_0x514dc8[_0xc9fc('0x2e')]=_[_0xc9fc('0x2a')](_0x5833a0,_0xc9fc('0x27'));_0x514dc8[_0xc9fc('0x2f')]=_['keys'](_0x2bae8d['query']);_0x514dc8[_0xc9fc('0x30')]=_[_0xc9fc('0x31')](_0x514dc8['model'],_0x514dc8[_0xc9fc('0x2f')]);_0x5574be[_0xc9fc('0x32')]=_[_0xc9fc('0x31')](_0x514dc8[_0xc9fc('0x2e')],qs[_0xc9fc('0x33')](_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x33')]));_0x5574be[_0xc9fc('0x32')]=_0x5574be[_0xc9fc('0x32')][_0xc9fc('0x34')]?_0x5574be[_0xc9fc('0x32')]:_0x514dc8[_0xc9fc('0x2e')];if(!_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x35')](_0xc9fc('0x36'))){_0x5574be[_0xc9fc('0x1e')]=qs[_0xc9fc('0x1e')](_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x1e')]);_0x5574be[_0xc9fc('0x1c')]=qs['offset'](_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x1c')]);}_0x5574be[_0xc9fc('0x37')]=qs[_0xc9fc('0x38')](_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x38')]);_0x5574be['where']=qs[_0xc9fc('0x30')](_[_0xc9fc('0x39')](_0x2bae8d[_0xc9fc('0x2f')],_0x514dc8[_0xc9fc('0x30')]),_0x5833a0);if(_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x3a')]){_0x5574be[_0xc9fc('0x3b')]=_[_0xc9fc('0x3c')](_0x5574be[_0xc9fc('0x3b')],{'$or':_[_0xc9fc('0x2a')](_0x5833a0,function(_0x375758){if(_0x375758[_0xc9fc('0x3d')]!==_0xc9fc('0x3e')){var _0x19eef9={};_0x19eef9[_0x375758['name']]={'$like':'%'+_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x3a')]+'%'};return _0x19eef9;}})});}_0x5574be=_[_0xc9fc('0x3c')]({},_0x5574be,_0x2bae8d['options']);var _0x233c91={'where':_0x5574be['where']};return db['MailTransferReport'][_0xc9fc('0x1f')](_0x233c91)['then'](function(_0x68201a){_0x26a894[_0xc9fc('0x1f')]=_0x68201a;if(_0x2bae8d[_0xc9fc('0x2f')][_0xc9fc('0x3f')]){_0x5574be[_0xc9fc('0x40')]=[{'all':!![]}];}return db[_0xc9fc('0x2b')]['findAll'](_0x5574be);})[_0xc9fc('0x41')](function(_0x50e02b){_0x26a894['rows']=_0x50e02b;return _0x26a894;})['then'](respondWithFilteredResult(_0x29a35a,_0x5574be))[_0xc9fc('0x42')](handleError(_0x29a35a,null));};exports[_0xc9fc('0x43')]=function(_0x2e7676,_0x24f7ed){var _0x4ad9f7={'raw':!![],'where':{'id':_0x2e7676[_0xc9fc('0x44')]['id']}},_0x6b717c={};_0x6b717c['model']=_['keys'](db['MailTransferReport'][_0xc9fc('0x2c')]);_0x6b717c['query']=_[_0xc9fc('0x45')](_0x2e7676[_0xc9fc('0x2f')]);_0x6b717c[_0xc9fc('0x30')]=_[_0xc9fc('0x31')](_0x6b717c[_0xc9fc('0x2e')],_0x6b717c['query']);_0x4ad9f7[_0xc9fc('0x32')]=_[_0xc9fc('0x31')](_0x6b717c['model'],qs[_0xc9fc('0x33')](_0x2e7676[_0xc9fc('0x2f')][_0xc9fc('0x33')]));_0x4ad9f7[_0xc9fc('0x32')]=_0x4ad9f7['attributes'][_0xc9fc('0x34')]?_0x4ad9f7[_0xc9fc('0x32')]:_0x6b717c[_0xc9fc('0x2e')];if(_0x2e7676['query']['includeAll']){_0x4ad9f7[_0xc9fc('0x40')]=[{'all':!![]}];}_0x4ad9f7=_[_0xc9fc('0x3c')]({},_0x4ad9f7,_0x2e7676[_0xc9fc('0x46')]);return db[_0xc9fc('0x2b')]['find'](_0x4ad9f7)['then'](handleEntityNotFound(_0x24f7ed,null))[_0xc9fc('0x41')](respondWithResult(_0x24f7ed,null))[_0xc9fc('0x42')](handleError(_0x24f7ed,null));};exports['create']=function(_0x4cf0ce,_0x3ad44f){return db[_0xc9fc('0x2b')][_0xc9fc('0x47')](_0x4cf0ce[_0xc9fc('0x48')],{})[_0xc9fc('0x41')](respondWithResult(_0x3ad44f,0xc9))[_0xc9fc('0x42')](handleError(_0x3ad44f,null));};exports['update']=function(_0x3b4c87,_0x229541){if(_0x3b4c87[_0xc9fc('0x48')]['id']){delete _0x3b4c87['body']['id'];}return db['MailTransferReport'][_0xc9fc('0x49')]({'where':{'id':_0x3b4c87[_0xc9fc('0x44')]['id']}})[_0xc9fc('0x41')](handleEntityNotFound(_0x229541,null))[_0xc9fc('0x41')](saveUpdates(_0x3b4c87[_0xc9fc('0x48')],null))[_0xc9fc('0x41')](respondWithResult(_0x229541,null))[_0xc9fc('0x42')](handleError(_0x229541,null));};exports[_0xc9fc('0x4a')]=function(_0x4f6f9b,_0x492314){return db[_0xc9fc('0x2b')][_0xc9fc('0x49')]({'where':{'id':_0x4f6f9b[_0xc9fc('0x44')]['id']}})[_0xc9fc('0x41')](handleEntityNotFound(_0x492314,null))['then'](removeEntity(_0x492314,null))[_0xc9fc('0x42')](handleError(_0x492314,null));};exports[_0xc9fc('0x4b')]=function(_0x332be6,_0x2fb96a){return db[_0xc9fc('0x2b')][_0xc9fc('0x4b')]()[_0xc9fc('0x41')](respondWithResult(_0x2fb96a,null))['catch'](handleError(_0x2fb96a,null));}; \ No newline at end of file +var _0x3eee=['fields','attributes','hasOwnProperty','sort','where','pick','merge','options','MailTransferReport','includeAll','include','findAll','rows','show','params','keys','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','filters','intersection','query'];(function(_0x12511e,_0x23bf7a){var _0x4c06cf=function(_0x453e31){while(--_0x453e31){_0x12511e['push'](_0x12511e['shift']());}};_0x4c06cf(++_0x23bf7a);}(_0x3eee,0xa4));var _0xe3ee=function(_0xca056d,_0x13c44f){_0xca056d=_0xca056d-0x0;var _0x312182=_0x3eee[_0xca056d];return _0x312182;};'use strict';var emlformat=require(_0xe3ee('0x0'));var rimraf=require(_0xe3ee('0x1'));var zipdir=require(_0xe3ee('0x2'));var jsonpatch=require(_0xe3ee('0x3'));var rp=require(_0xe3ee('0x4'));var moment=require(_0xe3ee('0x5'));var BPromise=require(_0xe3ee('0x6'));var Mustache=require(_0xe3ee('0x7'));var util=require('util');var path=require(_0xe3ee('0x8'));var sox=require(_0xe3ee('0x9'));var csv=require(_0xe3ee('0xa'));var ejs=require(_0xe3ee('0xb'));var fs=require('fs');var fs_extra=require(_0xe3ee('0xc'));var _=require(_0xe3ee('0xd'));var squel=require(_0xe3ee('0xe'));var crypto=require(_0xe3ee('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe3ee('0x10'));var toCsv=require(_0xe3ee('0xa'));var querystring=require(_0xe3ee('0x11'));var Papa=require(_0xe3ee('0x12'));var Redis=require(_0xe3ee('0x13'));var authService=require(_0xe3ee('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe3ee('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3ee('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe3ee('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4029b1,_0x504369){_0x504369=_0x504369||0xcc;return function(_0x176e46){if(_0x176e46){return _0x4029b1[_0xe3ee('0x18')](_0x504369);}return _0x4029b1['status'](_0x504369)[_0xe3ee('0x19')]();};}function respondWithResult(_0x1982dc,_0xc03427){_0xc03427=_0xc03427||0xc8;return function(_0x2d749f){if(_0x2d749f){return _0x1982dc[_0xe3ee('0x1a')](_0xc03427)[_0xe3ee('0x1b')](_0x2d749f);}};}function respondWithFilteredResult(_0x333916,_0x38d803){return function(_0x1e75b6){if(_0x1e75b6){var _0x53ac8b=typeof _0x38d803[_0xe3ee('0x1c')]===_0xe3ee('0x1d')&&typeof _0x38d803[_0xe3ee('0x1e')]==='undefined';var _0x3a5dff=_0x1e75b6[_0xe3ee('0x1f')];var _0x5d06bb=_0x53ac8b?0x0:_0x38d803['offset'];var _0x16909f=_0x53ac8b?_0x1e75b6[_0xe3ee('0x1f')]:_0x38d803[_0xe3ee('0x1c')]+_0x38d803[_0xe3ee('0x1e')];var _0x2c7b20;if(_0x16909f>=_0x3a5dff){_0x16909f=_0x3a5dff;_0x2c7b20=0xc8;}else{_0x2c7b20=0xce;}_0x333916[_0xe3ee('0x1a')](_0x2c7b20);return _0x333916[_0xe3ee('0x20')](_0xe3ee('0x21'),_0x5d06bb+'-'+_0x16909f+'/'+_0x3a5dff)[_0xe3ee('0x1b')](_0x1e75b6);}return null;};}function patchUpdates(_0x13a6b4){return function(_0x479bfb){try{jsonpatch[_0xe3ee('0x22')](_0x479bfb,_0x13a6b4,!![]);}catch(_0x4260a2){return BPromise['reject'](_0x4260a2);}return _0x479bfb[_0xe3ee('0x23')]();};}function saveUpdates(_0x183227,_0x5af527){return function(_0x3f857e){if(_0x3f857e){return _0x3f857e[_0xe3ee('0x24')](_0x183227)[_0xe3ee('0x25')](function(_0x47b846){return _0x47b846;});}return null;};}function removeEntity(_0x4960bc,_0x3d4c75){return function(_0x5ae87f){if(_0x5ae87f){return _0x5ae87f[_0xe3ee('0x26')]()['then'](function(){_0x4960bc[_0xe3ee('0x1a')](0xcc)[_0xe3ee('0x19')]();});}};}function handleEntityNotFound(_0x4aed03,_0x13ab30){return function(_0x22f5bd){if(!_0x22f5bd){_0x4aed03['sendStatus'](0x194);}return _0x22f5bd;};}function handleError(_0x4849c3,_0x22dd23){_0x22dd23=_0x22dd23||0x1f4;return function(_0x2ee2e9){logger[_0xe3ee('0x27')](_0x2ee2e9[_0xe3ee('0x28')]);if(_0x2ee2e9[_0xe3ee('0x29')]){delete _0x2ee2e9[_0xe3ee('0x29')];}_0x4849c3[_0xe3ee('0x1a')](_0x22dd23)[_0xe3ee('0x2a')](_0x2ee2e9);};}exports[_0xe3ee('0x2b')]=function(_0x3e96da,_0x43138c){var _0x101505={},_0xd2b4cf={},_0x427ee2={'count':0x0,'rows':[]};var _0x2a7ac0=_[_0xe3ee('0x2c')](db['MailTransferReport'][_0xe3ee('0x2d')],function(_0x2d0601){return{'name':_0x2d0601['fieldName'],'type':_0x2d0601[_0xe3ee('0x2e')][_0xe3ee('0x2f')]};});_0xd2b4cf[_0xe3ee('0x30')]=_[_0xe3ee('0x2c')](_0x2a7ac0,_0xe3ee('0x29'));_0xd2b4cf['query']=_['keys'](_0x3e96da['query']);_0xd2b4cf[_0xe3ee('0x31')]=_[_0xe3ee('0x32')](_0xd2b4cf['model'],_0xd2b4cf[_0xe3ee('0x33')]);_0x101505['attributes']=_[_0xe3ee('0x32')](_0xd2b4cf[_0xe3ee('0x30')],qs[_0xe3ee('0x34')](_0x3e96da['query'][_0xe3ee('0x34')]));_0x101505[_0xe3ee('0x35')]=_0x101505[_0xe3ee('0x35')]['length']?_0x101505['attributes']:_0xd2b4cf[_0xe3ee('0x30')];if(!_0x3e96da[_0xe3ee('0x33')][_0xe3ee('0x36')]('nolimit')){_0x101505[_0xe3ee('0x1e')]=qs[_0xe3ee('0x1e')](_0x3e96da[_0xe3ee('0x33')]['limit']);_0x101505['offset']=qs[_0xe3ee('0x1c')](_0x3e96da[_0xe3ee('0x33')][_0xe3ee('0x1c')]);}_0x101505['order']=qs[_0xe3ee('0x37')](_0x3e96da[_0xe3ee('0x33')][_0xe3ee('0x37')]);_0x101505[_0xe3ee('0x38')]=qs[_0xe3ee('0x31')](_[_0xe3ee('0x39')](_0x3e96da[_0xe3ee('0x33')],_0xd2b4cf['filters']),_0x2a7ac0);if(_0x3e96da[_0xe3ee('0x33')]['filter']){_0x101505[_0xe3ee('0x38')]=_[_0xe3ee('0x3a')](_0x101505[_0xe3ee('0x38')],{'$or':_[_0xe3ee('0x2c')](_0x2a7ac0,function(_0x426345){if(_0x426345['type']!=='VIRTUAL'){var _0x174b8d={};_0x174b8d[_0x426345[_0xe3ee('0x29')]]={'$like':'%'+_0x3e96da[_0xe3ee('0x33')]['filter']+'%'};return _0x174b8d;}})});}_0x101505=_[_0xe3ee('0x3a')]({},_0x101505,_0x3e96da[_0xe3ee('0x3b')]);var _0xcc6aad={'where':_0x101505[_0xe3ee('0x38')]};return db[_0xe3ee('0x3c')][_0xe3ee('0x1f')](_0xcc6aad)['then'](function(_0x2541b4){_0x427ee2[_0xe3ee('0x1f')]=_0x2541b4;if(_0x3e96da[_0xe3ee('0x33')][_0xe3ee('0x3d')]){_0x101505[_0xe3ee('0x3e')]=[{'all':!![]}];}return db[_0xe3ee('0x3c')][_0xe3ee('0x3f')](_0x101505);})[_0xe3ee('0x25')](function(_0x806d23){_0x427ee2[_0xe3ee('0x40')]=_0x806d23;return _0x427ee2;})[_0xe3ee('0x25')](respondWithFilteredResult(_0x43138c,_0x101505))['catch'](handleError(_0x43138c,null));};exports[_0xe3ee('0x41')]=function(_0x36a392,_0xb0759f){var _0x1e904a={'raw':!![],'where':{'id':_0x36a392[_0xe3ee('0x42')]['id']}},_0x3755b5={};_0x3755b5[_0xe3ee('0x30')]=_[_0xe3ee('0x43')](db[_0xe3ee('0x3c')][_0xe3ee('0x2d')]);_0x3755b5[_0xe3ee('0x33')]=_[_0xe3ee('0x43')](_0x36a392[_0xe3ee('0x33')]);_0x3755b5[_0xe3ee('0x31')]=_[_0xe3ee('0x32')](_0x3755b5[_0xe3ee('0x30')],_0x3755b5[_0xe3ee('0x33')]);_0x1e904a['attributes']=_[_0xe3ee('0x32')](_0x3755b5['model'],qs[_0xe3ee('0x34')](_0x36a392[_0xe3ee('0x33')][_0xe3ee('0x34')]));_0x1e904a[_0xe3ee('0x35')]=_0x1e904a[_0xe3ee('0x35')]['length']?_0x1e904a[_0xe3ee('0x35')]:_0x3755b5[_0xe3ee('0x30')];if(_0x36a392[_0xe3ee('0x33')][_0xe3ee('0x3d')]){_0x1e904a[_0xe3ee('0x3e')]=[{'all':!![]}];}_0x1e904a=_[_0xe3ee('0x3a')]({},_0x1e904a,_0x36a392[_0xe3ee('0x3b')]);return db['MailTransferReport'][_0xe3ee('0x44')](_0x1e904a)[_0xe3ee('0x25')](handleEntityNotFound(_0xb0759f,null))[_0xe3ee('0x25')](respondWithResult(_0xb0759f,null))[_0xe3ee('0x45')](handleError(_0xb0759f,null));};exports['create']=function(_0x59b70d,_0x5ece39){return db[_0xe3ee('0x3c')]['create'](_0x59b70d[_0xe3ee('0x46')],{})['then'](respondWithResult(_0x5ece39,0xc9))['catch'](handleError(_0x5ece39,null));};exports[_0xe3ee('0x24')]=function(_0x54b74d,_0x3182f0){if(_0x54b74d[_0xe3ee('0x46')]['id']){delete _0x54b74d[_0xe3ee('0x46')]['id'];}return db[_0xe3ee('0x3c')][_0xe3ee('0x44')]({'where':{'id':_0x54b74d[_0xe3ee('0x42')]['id']}})[_0xe3ee('0x25')](handleEntityNotFound(_0x3182f0,null))['then'](saveUpdates(_0x54b74d[_0xe3ee('0x46')],null))[_0xe3ee('0x25')](respondWithResult(_0x3182f0,null))[_0xe3ee('0x45')](handleError(_0x3182f0,null));};exports['destroy']=function(_0x30f7a1,_0x45c414){return db[_0xe3ee('0x3c')][_0xe3ee('0x44')]({'where':{'id':_0x30f7a1[_0xe3ee('0x42')]['id']}})[_0xe3ee('0x25')](handleEntityNotFound(_0x45c414,null))[_0xe3ee('0x25')](removeEntity(_0x45c414,null))['catch'](handleError(_0x45c414,null));};exports[_0xe3ee('0x47')]=function(_0x128adc,_0x26fd09){return db[_0xe3ee('0x3c')]['describe']()['then'](respondWithResult(_0x26fd09,null))[_0xe3ee('0x45')](handleError(_0x26fd09,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c882e32..ef4ca18 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 _0x004c=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','define','report_mail_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x004c,0x85));var _0xc004=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x004c[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var logger=require(_0xc004('0x2'))(_0xc004('0x3'));var moment=require('moment');var BPromise=require(_0xc004('0x4'));var rp=require(_0xc004('0x5'));var fs=require('fs');var path=require(_0xc004('0x6'));var rimraf=require(_0xc004('0x7'));var config=require('../../config/environment');var attributes=require(_0xc004('0x8'));module['exports']=function(_0x2c7142,_0x25a58b){return _0x2c7142[_0xc004('0x9')]('MailTransferReport',attributes,{'tableName':_0xc004('0xa'),'paranoid':![],'indexes':[{'name':_0xc004('0xb'),'fields':[_0xc004('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fed=['../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x497bea,_0x2ac5bc){var _0x5ab6ae=function(_0x392512){while(--_0x392512){_0x497bea['push'](_0x497bea['shift']());}};_0x5ab6ae(++_0x2ac5bc);}(_0x8fed,0xab));var _0xd8fe=function(_0x4b0917,_0x3a1c84){_0x4b0917=_0x4b0917-0x0;var _0x4efaeb=_0x8fed[_0x4b0917];return _0x4efaeb;};'use strict';var _=require(_0xd8fe('0x0'));var util=require(_0xd8fe('0x1'));var logger=require(_0xd8fe('0x2'))(_0xd8fe('0x3'));var moment=require(_0xd8fe('0x4'));var BPromise=require(_0xd8fe('0x5'));var rp=require(_0xd8fe('0x6'));var fs=require('fs');var path=require(_0xd8fe('0x7'));var rimraf=require(_0xd8fe('0x8'));var config=require(_0xd8fe('0x9'));var attributes=require(_0xd8fe('0xa'));module[_0xd8fe('0xb')]=function(_0x343d98,_0x143f41){return _0x343d98['define'](_0xd8fe('0xc'),attributes,{'tableName':_0xd8fe('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd8fe('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 008a079..2851180 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 _0xabcc=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x91718e,_0x42d1f4){var _0x4226b6=function(_0x28d6f0){while(--_0x28d6f0){_0x91718e['push'](_0x91718e['shift']());}};_0x4226b6(++_0x42d1f4);}(_0xabcc,0xc1));var _0xcabc=function(_0xcafb2b,_0x2cc85e){_0xcafb2b=_0xcafb2b-0x0;var _0x539f9a=_0xabcc[_0xcafb2b];return _0x539f9a;};'use strict';var _=require(_0xcabc('0x0'));var util=require(_0xcabc('0x1'));var moment=require(_0xcabc('0x2'));var BPromise=require(_0xcabc('0x3'));var rs=require(_0xcabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcabc('0x5'))['db'];var utils=require(_0xcabc('0x6'));var logger=require(_0xcabc('0x7'))(_0xcabc('0x8'));var config=require(_0xcabc('0x9'));var jayson=require(_0xcabc('0xa'));var client=jayson[_0xcabc('0xb')][_0xcabc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31d7cf,_0x500b82,_0x38dee1){return new BPromise(function(_0x662431,_0x52b84e){return client[_0xcabc('0xd')](_0x31d7cf,_0x38dee1)['then'](function(_0x4d793a){logger[_0xcabc('0xe')](_0xcabc('0xf'),_0x500b82,_0xcabc('0x10'));logger['debug'](_0xcabc('0x11'),_0x500b82,_0xcabc('0x10'),JSON[_0xcabc('0x12')](_0x4d793a));if(_0x4d793a[_0xcabc('0x13')]){if(_0x4d793a[_0xcabc('0x13')][_0xcabc('0x14')]===0x1f4){logger[_0xcabc('0x13')](_0xcabc('0xf'),_0x500b82,_0x4d793a['error'][_0xcabc('0x15')]);return _0x52b84e(_0x4d793a[_0xcabc('0x13')][_0xcabc('0x15')]);}logger[_0xcabc('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x500b82,_0x4d793a[_0xcabc('0x13')][_0xcabc('0x15')]);return _0x662431(_0x4d793a['error'][_0xcabc('0x15')]);}else{logger[_0xcabc('0xe')](_0xcabc('0xf'),_0x500b82,_0xcabc('0x10'));_0x662431(_0x4d793a[_0xcabc('0x16')][_0xcabc('0x15')]);}})['catch'](function(_0x255cec){logger[_0xcabc('0x13')](_0xcabc('0xf'),_0x500b82,_0x255cec);_0x52b84e(_0x255cec);});});} \ No newline at end of file +var _0xaddd=['MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x41d638,_0x4a41e9){var _0x57aae4=function(_0x150258){while(--_0x150258){_0x41d638['push'](_0x41d638['shift']());}};_0x57aae4(++_0x4a41e9);}(_0xaddd,0x135));var _0xdadd=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0xaddd[_0x1123bb];return _0xdeb602;};'use strict';var _=require(_0xdadd('0x0'));var util=require(_0xdadd('0x1'));var moment=require(_0xdadd('0x2'));var BPromise=require('bluebird');var rs=require(_0xdadd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdadd('0x4'));var logger=require(_0xdadd('0x5'))(_0xdadd('0x6'));var config=require(_0xdadd('0x7'));var jayson=require(_0xdadd('0x8'));var client=jayson[_0xdadd('0x9')][_0xdadd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x71d1ac,_0x2c77e9,_0x151ebe){return new BPromise(function(_0x42dd4c,_0x15c87f){return client['request'](_0x71d1ac,_0x151ebe)[_0xdadd('0xb')](function(_0x4edc74){logger[_0xdadd('0xc')](_0xdadd('0xd'),_0x2c77e9,'request\x20sent');logger[_0xdadd('0xe')](_0xdadd('0xf'),_0x2c77e9,'request\x20sent',JSON[_0xdadd('0x10')](_0x4edc74));if(_0x4edc74['error']){if(_0x4edc74[_0xdadd('0x11')][_0xdadd('0x12')]===0x1f4){logger[_0xdadd('0x11')](_0xdadd('0xd'),_0x2c77e9,_0x4edc74[_0xdadd('0x11')][_0xdadd('0x13')]);return _0x15c87f(_0x4edc74['error']['message']);}logger[_0xdadd('0x11')](_0xdadd('0xd'),_0x2c77e9,_0x4edc74['error'][_0xdadd('0x13')]);return _0x42dd4c(_0x4edc74[_0xdadd('0x11')][_0xdadd('0x13')]);}else{logger['info'](_0xdadd('0xd'),_0x2c77e9,_0xdadd('0x14'));_0x42dd4c(_0x4edc74[_0xdadd('0x15')][_0xdadd('0x13')]);}})[_0xdadd('0x16')](function(_0x4f5fc9){logger[_0xdadd('0x11')](_0xdadd('0xd'),_0x2c77e9,_0x4f5fc9);_0x15c87f(_0x4f5fc9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 9b30f07..1254e23 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 _0xeb4a=['post','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xeb4a,0x81));var _0xaeb4=function(_0x2799fa,_0x4e822b){_0x2799fa=_0x2799fa-0x0;var _0x47ec47=_0xeb4a[_0x2799fa];return _0x47ec47;};'use strict';var multer=require(_0xaeb4('0x0'));var util=require(_0xaeb4('0x1'));var path=require(_0xaeb4('0x2'));var timeout=require(_0xaeb4('0x3'));var express=require(_0xaeb4('0x4'));var router=express[_0xaeb4('0x5')]();var fs_extra=require(_0xaeb4('0x6'));var auth=require(_0xaeb4('0x7'));var interaction=require(_0xaeb4('0x8'));var config=require('../../config/environment');var controller=require(_0xaeb4('0x9'));router['get']('/',auth[_0xaeb4('0xa')](),controller['index']);router['get'](_0xaeb4('0xb'),auth[_0xaeb4('0xa')](),controller[_0xaeb4('0xc')]);router['get'](_0xaeb4('0xd'),auth['isAuthenticated'](),controller[_0xaeb4('0xe')]);router[_0xaeb4('0xf')]('/',auth[_0xaeb4('0xa')](),controller['create']);router['put'](_0xaeb4('0xd'),auth[_0xaeb4('0xa')](),controller[_0xaeb4('0x10')]);router['delete'](_0xaeb4('0xd'),auth[_0xaeb4('0xa')](),controller['destroy']);module[_0xaeb4('0x11')]=router; \ No newline at end of file +var _0x9e05=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9e05,0x137));var _0x59e0=function(_0x3e08fc,_0xd7b83a){_0x3e08fc=_0x3e08fc-0x0;var _0x3eaa68=_0x9e05[_0x3e08fc];return _0x3eaa68;};'use strict';var multer=require(_0x59e0('0x0'));var util=require(_0x59e0('0x1'));var path=require(_0x59e0('0x2'));var timeout=require(_0x59e0('0x3'));var express=require(_0x59e0('0x4'));var router=express['Router']();var fs_extra=require(_0x59e0('0x5'));var auth=require(_0x59e0('0x6'));var interaction=require(_0x59e0('0x7'));var config=require(_0x59e0('0x8'));var controller=require(_0x59e0('0x9'));router[_0x59e0('0xa')]('/',auth[_0x59e0('0xb')](),controller[_0x59e0('0xc')]);router[_0x59e0('0xa')](_0x59e0('0xd'),auth[_0x59e0('0xb')](),controller['describe']);router[_0x59e0('0xa')](_0x59e0('0xe'),auth[_0x59e0('0xb')](),controller['show']);router[_0x59e0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x59e0('0x10')](_0x59e0('0xe'),auth[_0x59e0('0xb')](),controller[_0x59e0('0x11')]);router[_0x59e0('0x12')]('/:id',auth[_0x59e0('0xb')](),controller[_0x59e0('0x13')]);module[_0x59e0('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 7965f25..ea76fa1 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 _0x192f=['getDataValue','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x192f,0xd6));var _0xf192=function(_0x5d76c8,_0x432c5e){_0x5d76c8=_0x5d76c8-0x0;var _0xe18213=_0x192f[_0x5d76c8];return _0xe18213;};'use strict';var Sequelize=require(_0xf192('0x0'));var moment=require('moment');module[_0xf192('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf192('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf192('0x3'),'comment':_0xf192('0x4')},'duration':{'type':Sequelize[_0xf192('0x5')]},'enterAt':{'type':Sequelize[_0xf192('0x6')]},'exitAt':{'type':Sequelize[_0xf192('0x6')],'set':function(_0x221f55){var _0x5a05b0=moment(_0x221f55);var _0x38dcbf=moment(this[_0xf192('0x7')]('enterAt'));var _0x2c4102=_0x5a05b0[_0xf192('0x8')](_0x38dcbf,_0xf192('0x9'));this[_0xf192('0xa')](_0xf192('0xb'),_0x221f55);this['setDataValue']('duration',_0x2c4102||null);}},'data1':{'type':Sequelize[_0xf192('0x2')],'comment':_0xf192('0xc')},'data2':{'type':Sequelize[_0xf192('0x2')],'comment':_0xf192('0xd')},'data3':{'type':Sequelize[_0xf192('0x2')],'comment':_0xf192('0xe')},'data4':{'type':Sequelize[_0xf192('0x2')],'comment':_0xf192('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xf192('0x10')},'role':{'type':Sequelize[_0xf192('0x2')]},'internal':{'type':Sequelize[_0xf192('0x5')]},'uniqueid':{'type':Sequelize[_0xf192('0x2')]}}; \ No newline at end of file +var _0xf0cc=['talk:[queue]','INTEGER','sequelize','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x207ede,_0x5dc99e){var _0x2ad796=function(_0x51fb5f){while(--_0x51fb5f){_0x207ede['push'](_0x207ede['shift']());}};_0x2ad796(++_0x5dc99e);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x8bce37,_0x492da6){_0x8bce37=_0x8bce37-0x0;var _0x2246af=_0xf0cc[_0x8bce37];return _0x2246af;};'use strict';var Sequelize=require(_0xcf0c('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xcf0c('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcf0c('0x1')],'defaultValue':_0xcf0c('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xcf0c('0x3')]},'exitAt':{'type':Sequelize[_0xcf0c('0x3')],'set':function(_0x1a6003){var _0x497363=moment(_0x1a6003);var _0x346cb0=moment(this[_0xcf0c('0x4')](_0xcf0c('0x5')));var _0x5d4cdb=_0x497363['diff'](_0x346cb0,_0xcf0c('0x6'));this['setDataValue'](_0xcf0c('0x7'),_0x1a6003);this['setDataValue'](_0xcf0c('0x8'),_0x5d4cdb||null);}},'data1':{'type':Sequelize[_0xcf0c('0x1')],'comment':_0xcf0c('0x9')},'data2':{'type':Sequelize[_0xcf0c('0x1')],'comment':_0xcf0c('0xa')},'data3':{'type':Sequelize[_0xcf0c('0x1')],'comment':_0xcf0c('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0xcf0c('0xc')},'data5':{'type':Sequelize[_0xcf0c('0x1')],'comment':_0xcf0c('0xd')},'role':{'type':Sequelize[_0xcf0c('0x1')]},'internal':{'type':Sequelize[_0xcf0c('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4d02c6b..f49cfbd 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 _0x9957=['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','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x33337f,_0x5d7319){var _0x3d9d50=function(_0x660d6a){while(--_0x660d6a){_0x33337f['push'](_0x33337f['shift']());}};_0x3d9d50(++_0x5d7319);}(_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){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x9957=['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','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x768458,_0x3d0933){var _0x31385c=function(_0xf11dad){while(--_0xf11dad){_0x768458['push'](_0x768458['shift']());}};_0x31385c(++_0x3d0933);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8e3bb5a..4e28123 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 _0xf975=['./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0xf975,0x162));var _0x5f97=function(_0x4b423a,_0x49113b){_0x4b423a=_0x4b423a-0x0;var _0x4b7d82=_0xf975[_0x4b423a];return _0x4b7d82;};'use strict';var _=require(_0x5f97('0x0'));var util=require('util');var logger=require(_0x5f97('0x1'))('api');var moment=require(_0x5f97('0x2'));var BPromise=require(_0x5f97('0x3'));var rp=require(_0x5f97('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f97('0x5'));var attributes=require(_0x5f97('0x6'));module[_0x5f97('0x7')]=function(_0x2ffaaa,_0x962b55){return _0x2ffaaa['define'](_0x5f97('0x8'),attributes,{'tableName':_0x5f97('0x9'),'paranoid':![],'indexes':[{'name':_0x5f97('0xa'),'fields':[_0x5f97('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb04=['interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MemberReport','report_member','membername_interface','membername'];(function(_0x5ae073,_0x411e65){var _0x143847=function(_0x5ce49f){while(--_0x5ce49f){_0x5ae073['push'](_0x5ae073['shift']());}};_0x143847(++_0x411e65);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require(_0x4cb0('0x2'))(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var rp=require(_0x4cb0('0x6'));var fs=require('fs');var path=require(_0x4cb0('0x7'));var rimraf=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var attributes=require('./memberReport.attributes');module[_0x4cb0('0xa')]=function(_0x2fb566,_0x247e05){return _0x2fb566[_0x4cb0('0xb')](_0x4cb0('0xc'),attributes,{'tableName':_0x4cb0('0xd'),'paranoid':![],'indexes':[{'name':_0x4cb0('0xe'),'fields':[_0x4cb0('0xf'),_0x4cb0('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7cd1b99..9e71957 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 _0xd991=['jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','map','model','debug','stringify','create','body','raw','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4f55a9,_0x35d9c0){var _0x37bcb3=function(_0x286fb2){while(--_0x286fb2){_0x4f55a9['push'](_0x4f55a9['shift']());}};_0x37bcb3(++_0x35d9c0);}(_0xd991,0x115));var _0x1d99=function(_0x4722e2,_0xf7b3e4){_0x4722e2=_0x4722e2-0x0;var _0xbb851a=_0xd991[_0x4722e2];return _0xbb851a;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var moment=require(_0x1d99('0x2'));var BPromise=require(_0x1d99('0x3'));var rs=require(_0x1d99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d99('0x5'))['db'];var utils=require(_0x1d99('0x6'));var logger=require(_0x1d99('0x7'))(_0x1d99('0x8'));var config=require(_0x1d99('0x9'));var jayson=require(_0x1d99('0xa'));var client=jayson['client'][_0x1d99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440bb4,_0x5100fc,_0x21d746){return new BPromise(function(_0x2f4502,_0x6de8e8){return client[_0x1d99('0xc')](_0x440bb4,_0x21d746)[_0x1d99('0xd')](function(_0x3d55b1){logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x5100fc,_0x1d99('0x10'));logger['debug'](_0x1d99('0x11'),_0x5100fc,_0x1d99('0x10'),JSON['stringify'](_0x3d55b1));if(_0x3d55b1[_0x1d99('0x12')]){if(_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x13')]===0x1f4){logger['error'](_0x1d99('0xf'),_0x5100fc,_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x14')]);return _0x6de8e8(_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x14')]);}logger[_0x1d99('0x12')]('MemberReport,\x20%s,\x20%s',_0x5100fc,_0x3d55b1[_0x1d99('0x12')]['message']);return _0x2f4502(_0x3d55b1[_0x1d99('0x12')]['message']);}else{logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x5100fc,_0x1d99('0x10'));_0x2f4502(_0x3d55b1[_0x1d99('0x15')][_0x1d99('0x14')]);}})[_0x1d99('0x16')](function(_0x8cf8b8){logger[_0x1d99('0x12')]('MemberReport,\x20%s,\x20%s',_0x5100fc,_0x8cf8b8);_0x6de8e8(_0x8cf8b8);});});}exports[_0x1d99('0x17')]=function(_0x4da463){var _0x3669d1=this;return new Promise(function(_0x1a51a4,_0xb6555a){return db[_0x1d99('0x18')][_0x1d99('0x19')]({'raw':_0x4da463['options']?_0x4da463['options']['raw']===undefined?!![]:![]:!![],'where':_0x4da463['options']?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1b')]||null:null,'attributes':_0x4da463[_0x1d99('0x1a')]?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1c')]||null:null,'limit':_0x4da463['options']?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1d')]||null:null,'include':_0x4da463[_0x1d99('0x1a')]?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1e')]?_[_0x1d99('0x1f')](_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1e')],function(_0x8273bb){return{'model':db[_0x8273bb[_0x1d99('0x20')]],'as':_0x8273bb['as'],'attributes':_0x8273bb[_0x1d99('0x1c')],'include':_0x8273bb[_0x1d99('0x1e')]?_['map'](_0x8273bb[_0x1d99('0x1e')],function(_0x31e70e){return{'model':db[_0x31e70e[_0x1d99('0x20')]],'as':_0x31e70e['as'],'attributes':_0x31e70e[_0x1d99('0x1c')],'include':_0x31e70e['include']?_[_0x1d99('0x1f')](_0x31e70e['include'],function(_0x150569){return{'model':db[_0x150569[_0x1d99('0x20')]],'as':_0x150569['as'],'attributes':_0x150569[_0x1d99('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1d99('0xd')](function(_0x53e108){logger[_0x1d99('0xe')](_0x1d99('0x17'),_0x4da463);logger[_0x1d99('0x21')](_0x1d99('0x17'),_0x4da463,JSON[_0x1d99('0x22')](_0x53e108));_0x1a51a4(_0x53e108);})[_0x1d99('0x16')](function(_0x5c0c0a){logger[_0x1d99('0x12')](_0x1d99('0x17'),_0x5c0c0a[_0x1d99('0x14')],_0x4da463);_0xb6555a(_0x3669d1[_0x1d99('0x12')](0x1f4,_0x5c0c0a[_0x1d99('0x14')]));});});};exports['CreateMemberReport']=function(_0x25ad6f){var _0x395e6d=this;return new Promise(function(_0x14f437,_0xfb22f4){return db[_0x1d99('0x18')][_0x1d99('0x23')](_0x25ad6f[_0x1d99('0x24')],{'raw':_0x25ad6f[_0x1d99('0x1a')]?_0x25ad6f[_0x1d99('0x1a')][_0x1d99('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x24cccb){logger[_0x1d99('0xe')](_0x1d99('0x26'),_0x25ad6f);logger['debug'](_0x1d99('0x26'),_0x25ad6f,JSON[_0x1d99('0x22')](_0x24cccb));_0x14f437(_0x24cccb);})['catch'](function(_0x2f8dc1){logger[_0x1d99('0x12')](_0x1d99('0x26'),_0x2f8dc1[_0x1d99('0x14')],_0x25ad6f);_0xfb22f4(_0x395e6d[_0x1d99('0x12')](0x1f4,_0x2f8dc1['message']));});});};exports[_0x1d99('0x27')]=function(_0x363266){var _0x33e4da=this;return new Promise(function(_0x37f9d5,_0x3aa132){return db[_0x1d99('0x18')][_0x1d99('0x28')](_0x363266['body'],{'raw':_0x363266['options']?_0x363266[_0x1d99('0x1a')][_0x1d99('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x363266[_0x1d99('0x1a')]?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1b')]||null:null,'attributes':_0x363266['options']?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1c')]||null:null,'limit':_0x363266[_0x1d99('0x1a')]?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1d')]||null:null})[_0x1d99('0xd')](function(_0x40cc83){logger[_0x1d99('0xe')]('UpdateMemberReport',_0x363266);logger[_0x1d99('0x21')](_0x1d99('0x27'),_0x363266,JSON[_0x1d99('0x22')](_0x40cc83));_0x37f9d5(_0x40cc83);})['catch'](function(_0x32b5c0){logger[_0x1d99('0x12')]('UpdateMemberReport',_0x32b5c0[_0x1d99('0x14')],_0x363266);_0x3aa132(_0x33e4da[_0x1d99('0x12')](0x1f4,_0x32b5c0[_0x1d99('0x14')]));});});}; \ No newline at end of file +var _0xcddb=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','then','CreateMemberReport','create','body','UpdateMemberReport','lodash','util','moment'];(function(_0x5d949e,_0x555707){var _0x445c1e=function(_0x160f2a){while(--_0x160f2a){_0x5d949e['push'](_0x5d949e['shift']());}};_0x445c1e(++_0x555707);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x498d52,_0x2d02eb){_0x498d52=_0x498d52-0x0;var _0x436aef=_0xcddb[_0x498d52];return _0x436aef;};'use strict';var _=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var moment=require(_0xbcdd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcdd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcdd('0x4'));var logger=require(_0xbcdd('0x5'))(_0xbcdd('0x6'));var config=require(_0xbcdd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbcdd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d00d4,_0x25675b,_0x586e64){return new BPromise(function(_0x46f26c,_0x270ac4){return client['request'](_0x1d00d4,_0x586e64)['then'](function(_0x1946f8){logger[_0xbcdd('0x9')](_0xbcdd('0xa'),_0x25675b,'request\x20sent');logger[_0xbcdd('0xb')](_0xbcdd('0xc'),_0x25675b,_0xbcdd('0xd'),JSON[_0xbcdd('0xe')](_0x1946f8));if(_0x1946f8['error']){if(_0x1946f8[_0xbcdd('0xf')][_0xbcdd('0x10')]===0x1f4){logger['error'](_0xbcdd('0xa'),_0x25675b,_0x1946f8[_0xbcdd('0xf')]['message']);return _0x270ac4(_0x1946f8[_0xbcdd('0xf')][_0xbcdd('0x11')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x25675b,_0x1946f8[_0xbcdd('0xf')][_0xbcdd('0x11')]);return _0x46f26c(_0x1946f8[_0xbcdd('0xf')][_0xbcdd('0x11')]);}else{logger[_0xbcdd('0x9')]('MemberReport,\x20%s,\x20%s',_0x25675b,_0xbcdd('0xd'));_0x46f26c(_0x1946f8[_0xbcdd('0x12')]['message']);}})[_0xbcdd('0x13')](function(_0x5b68b0){logger[_0xbcdd('0xf')](_0xbcdd('0xa'),_0x25675b,_0x5b68b0);_0x270ac4(_0x5b68b0);});});}exports[_0xbcdd('0x14')]=function(_0x47ae02){var _0x1b27cb=this;return new Promise(function(_0x39d865,_0x1f524e){return db[_0xbcdd('0x15')][_0xbcdd('0x16')]({'raw':_0x47ae02['options']?_0x47ae02[_0xbcdd('0x17')][_0xbcdd('0x18')]===undefined?!![]:![]:!![],'where':_0x47ae02[_0xbcdd('0x17')]?_0x47ae02[_0xbcdd('0x17')][_0xbcdd('0x19')]||null:null,'attributes':_0x47ae02[_0xbcdd('0x17')]?_0x47ae02['options'][_0xbcdd('0x1a')]||null:null,'limit':_0x47ae02['options']?_0x47ae02[_0xbcdd('0x17')][_0xbcdd('0x1b')]||null:null,'include':_0x47ae02[_0xbcdd('0x17')]?_0x47ae02[_0xbcdd('0x17')]['include']?_[_0xbcdd('0x1c')](_0x47ae02[_0xbcdd('0x17')][_0xbcdd('0x1d')],function(_0x19e183){return{'model':db[_0x19e183['model']],'as':_0x19e183['as'],'attributes':_0x19e183[_0xbcdd('0x1a')],'include':_0x19e183[_0xbcdd('0x1d')]?_[_0xbcdd('0x1c')](_0x19e183[_0xbcdd('0x1d')],function(_0x3cfd0f){return{'model':db[_0x3cfd0f['model']],'as':_0x3cfd0f['as'],'attributes':_0x3cfd0f[_0xbcdd('0x1a')],'include':_0x3cfd0f[_0xbcdd('0x1d')]?_[_0xbcdd('0x1c')](_0x3cfd0f[_0xbcdd('0x1d')],function(_0x37f2a9){return{'model':db[_0x37f2a9['model']],'as':_0x37f2a9['as'],'attributes':_0x37f2a9[_0xbcdd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbcdd('0x1e')](function(_0x58cc33){logger[_0xbcdd('0x9')](_0xbcdd('0x14'),_0x47ae02);logger[_0xbcdd('0xb')](_0xbcdd('0x14'),_0x47ae02,JSON[_0xbcdd('0xe')](_0x58cc33));_0x39d865(_0x58cc33);})['catch'](function(_0x163a3e){logger['error']('GetMemberReport',_0x163a3e[_0xbcdd('0x11')],_0x47ae02);_0x1f524e(_0x1b27cb[_0xbcdd('0xf')](0x1f4,_0x163a3e['message']));});});};exports[_0xbcdd('0x1f')]=function(_0x561fb4){var _0x3cdcb3=this;return new Promise(function(_0x15dacc,_0x29c495){return db[_0xbcdd('0x15')][_0xbcdd('0x20')](_0x561fb4[_0xbcdd('0x21')],{'raw':_0x561fb4[_0xbcdd('0x17')]?_0x561fb4['options'][_0xbcdd('0x18')]===undefined?!![]:![]:!![]})[_0xbcdd('0x1e')](function(_0x500eba){logger['info'](_0xbcdd('0x1f'),_0x561fb4);logger[_0xbcdd('0xb')]('CreateMemberReport',_0x561fb4,JSON[_0xbcdd('0xe')](_0x500eba));_0x15dacc(_0x500eba);})['catch'](function(_0x22cc9e){logger['error'](_0xbcdd('0x1f'),_0x22cc9e['message'],_0x561fb4);_0x29c495(_0x3cdcb3[_0xbcdd('0xf')](0x1f4,_0x22cc9e[_0xbcdd('0x11')]));});});};exports['UpdateMemberReport']=function(_0x134277){var _0x3382b3=this;return new Promise(function(_0x2c3eb5,_0x3b368f){return db[_0xbcdd('0x15')]['update'](_0x134277[_0xbcdd('0x21')],{'raw':_0x134277['options']?_0x134277[_0xbcdd('0x17')][_0xbcdd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134277['options']?_0x134277['options'][_0xbcdd('0x19')]||null:null,'attributes':_0x134277['options']?_0x134277[_0xbcdd('0x17')][_0xbcdd('0x1a')]||null:null,'limit':_0x134277[_0xbcdd('0x17')]?_0x134277['options'][_0xbcdd('0x1b')]||null:null})[_0xbcdd('0x1e')](function(_0xedb4a5){logger[_0xbcdd('0x9')](_0xbcdd('0x22'),_0x134277);logger[_0xbcdd('0xb')](_0xbcdd('0x22'),_0x134277,JSON[_0xbcdd('0xe')](_0xedb4a5));_0x2c3eb5(_0xedb4a5);})[_0xbcdd('0x13')](function(_0xa54fef){logger[_0xbcdd('0xf')](_0xbcdd('0x22'),_0xa54fef['message'],_0x134277);_0x3b368f(_0x3382b3[_0xbcdd('0xf')](0x1f4,_0xa54fef[_0xbcdd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index bdd21ba..b0419c1 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 _0x371e=['index','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x5248b5,_0x22dee8){var _0x151eff=function(_0x1339b9){while(--_0x1339b9){_0x5248b5['push'](_0x5248b5['shift']());}};_0x151eff(++_0x22dee8);}(_0x371e,0x160));var _0xe371=function(_0x365a40,_0x5c073e){_0x365a40=_0x365a40-0x0;var _0x1dd6d5=_0x371e[_0x365a40];return _0x1dd6d5;};'use strict';var multer=require(_0xe371('0x0'));var util=require(_0xe371('0x1'));var path=require(_0xe371('0x2'));var timeout=require(_0xe371('0x3'));var express=require(_0xe371('0x4'));var router=express[_0xe371('0x5')]();var fs_extra=require(_0xe371('0x6'));var auth=require(_0xe371('0x7'));var interaction=require(_0xe371('0x8'));var config=require(_0xe371('0x9'));var controller=require(_0xe371('0xa'));router[_0xe371('0xb')]('/',controller[_0xe371('0xc')]);module[_0xe371('0xd')]=router; \ No newline at end of file +var _0x6fc8=['../../config/environment','index','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c2eb7,_0x102a69){var _0x3e2780=function(_0x2a6c2d){while(--_0x2a6c2d){_0x2c2eb7['push'](_0x2c2eb7['shift']());}};_0x3e2780(++_0x102a69);}(_0x6fc8,0x156));var _0x86fc=function(_0x1542c2,_0x2c6404){_0x1542c2=_0x1542c2-0x0;var _0x27319b=_0x6fc8[_0x1542c2];return _0x27319b;};'use strict';var multer=require(_0x86fc('0x0'));var util=require(_0x86fc('0x1'));var path=require(_0x86fc('0x2'));var timeout=require(_0x86fc('0x3'));var express=require(_0x86fc('0x4'));var router=express[_0x86fc('0x5')]();var fs_extra=require(_0x86fc('0x6'));var auth=require(_0x86fc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x86fc('0x8'));var controller=require('./migration.controller');router['get']('/',controller[_0x86fc('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 3fc7374..8199f27 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 _0xfe94=['version','sequelize'];(function(_0x4b346e,_0x3fa06e){var _0x3f82bf=function(_0x19c936){while(--_0x19c936){_0x4b346e['push'](_0x4b346e['shift']());}};_0x3f82bf(++_0x3fa06e);}(_0xfe94,0x16b));var _0x4fe9=function(_0x5a39c7,_0x549dff){_0x5a39c7=_0x5a39c7-0x0;var _0x3d8b8d=_0xfe94[_0x5a39c7];return _0x3d8b8d;};'use strict';var Sequelize=require(_0x4fe9('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x4fe9('0x1')}}; \ No newline at end of file +var _0xd9dd=['STRING','version','sequelize','exports'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xd9dd,0x14e));var _0xdd9d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9dd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdd9d('0x0'));module[_0xdd9d('0x1')]={'version':{'type':Sequelize[_0xdd9d('0x2')],'unique':_0xdd9d('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index a02998f..1d6b55d 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 _0x2cd7=['limit','count','offset','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Migration','includeAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x1bd402,_0x46c874){var _0x3c6524=function(_0x4d8d28){while(--_0x4d8d28){_0x1bd402['push'](_0x1bd402['shift']());}};_0x3c6524(++_0x46c874);}(_0x2cd7,0x1c0));var _0x72cd=function(_0x4823b2,_0x307f45){_0x4823b2=_0x4823b2-0x0;var _0x1781de=_0x2cd7[_0x4823b2];return _0x1781de;};'use strict';var emlformat=require(_0x72cd('0x0'));var rimraf=require(_0x72cd('0x1'));var zipdir=require(_0x72cd('0x2'));var jsonpatch=require(_0x72cd('0x3'));var rp=require(_0x72cd('0x4'));var moment=require(_0x72cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x72cd('0x6'));var util=require(_0x72cd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x72cd('0x8'));var ejs=require(_0x72cd('0x9'));var fs=require('fs');var fs_extra=require(_0x72cd('0xa'));var _=require('lodash');var squel=require(_0x72cd('0xb'));var crypto=require(_0x72cd('0xc'));var jsforce=require(_0x72cd('0xd'));var deskjs=require(_0x72cd('0xe'));var toCsv=require(_0x72cd('0x8'));var querystring=require(_0x72cd('0xf'));var Papa=require(_0x72cd('0x10'));var Redis=require(_0x72cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x72cd('0x12'));var as=require(_0x72cd('0x13'));var hardwareService=require(_0x72cd('0x14'));var logger=require(_0x72cd('0x15'))('api');var utils=require(_0x72cd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x72cd('0x17'));var db=require(_0x72cd('0x18'))['db'];function respondWithStatusCode(_0xf40de2,_0x132f68){_0x132f68=_0x132f68||0xcc;return function(_0x3081ad){if(_0x3081ad){return _0xf40de2[_0x72cd('0x19')](_0x132f68);}return _0xf40de2[_0x72cd('0x1a')](_0x132f68)['end']();};}function respondWithResult(_0x24d7a5,_0x3e6ebb){_0x3e6ebb=_0x3e6ebb||0xc8;return function(_0x1b88cf){if(_0x1b88cf){return _0x24d7a5[_0x72cd('0x1a')](_0x3e6ebb)['json'](_0x1b88cf);}};}function respondWithFilteredResult(_0x2d8317,_0x94087d){return function(_0x4a58c4){if(_0x4a58c4){var _0x2fc97f=typeof _0x94087d['offset']===_0x72cd('0x1b')&&typeof _0x94087d[_0x72cd('0x1c')]===_0x72cd('0x1b');var _0x24337e=_0x4a58c4['count'];var _0x3af2c9=_0x2fc97f?0x0:_0x94087d['offset'];var _0x5659f5=_0x2fc97f?_0x4a58c4[_0x72cd('0x1d')]:_0x94087d[_0x72cd('0x1e')]+_0x94087d[_0x72cd('0x1c')];var _0x1bb69a;if(_0x5659f5>=_0x24337e){_0x5659f5=_0x24337e;_0x1bb69a=0xc8;}else{_0x1bb69a=0xce;}_0x2d8317[_0x72cd('0x1a')](_0x1bb69a);return _0x2d8317[_0x72cd('0x1f')](_0x72cd('0x20'),_0x3af2c9+'-'+_0x5659f5+'/'+_0x24337e)['json'](_0x4a58c4);}return null;};}function patchUpdates(_0x673a1a){return function(_0x1c57b0){try{jsonpatch[_0x72cd('0x21')](_0x1c57b0,_0x673a1a,!![]);}catch(_0x57e4de){return BPromise[_0x72cd('0x22')](_0x57e4de);}return _0x1c57b0['save']();};}function saveUpdates(_0x39000e,_0x53830a){return function(_0x16c5a7){if(_0x16c5a7){return _0x16c5a7[_0x72cd('0x23')](_0x39000e)[_0x72cd('0x24')](function(_0x1de53e){return _0x1de53e;});}return null;};}function removeEntity(_0x5c2bd7,_0x1fa2fb){return function(_0x41d6e1){if(_0x41d6e1){return _0x41d6e1['destroy']()['then'](function(){_0x5c2bd7[_0x72cd('0x1a')](0xcc)[_0x72cd('0x25')]();});}};}function handleEntityNotFound(_0x4211bf,_0x36c460){return function(_0x34a843){if(!_0x34a843){_0x4211bf[_0x72cd('0x19')](0x194);}return _0x34a843;};}function handleError(_0xb81d1a,_0x32c610){_0x32c610=_0x32c610||0x1f4;return function(_0x37653f){logger[_0x72cd('0x26')](_0x37653f[_0x72cd('0x27')]);if(_0x37653f[_0x72cd('0x28')]){delete _0x37653f[_0x72cd('0x28')];}_0xb81d1a['status'](_0x32c610)[_0x72cd('0x29')](_0x37653f);};}exports[_0x72cd('0x2a')]=function(_0x17c55d,_0x1b9131){var _0x4b535a={},_0x199524={},_0x19a5f3={'count':0x0,'rows':[]};var _0x183ad1=_['map'](db['Migration'][_0x72cd('0x2b')],function(_0x53b79f){return{'name':_0x53b79f[_0x72cd('0x2c')],'type':_0x53b79f[_0x72cd('0x2d')]['key']};});_0x199524['model']=_[_0x72cd('0x2e')](_0x183ad1,'name');_0x199524[_0x72cd('0x2f')]=_[_0x72cd('0x30')](_0x17c55d['query']);_0x199524[_0x72cd('0x31')]=_[_0x72cd('0x32')](_0x199524[_0x72cd('0x33')],_0x199524[_0x72cd('0x2f')]);_0x4b535a[_0x72cd('0x34')]=_[_0x72cd('0x32')](_0x199524[_0x72cd('0x33')],qs['fields'](_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x35')]));_0x4b535a[_0x72cd('0x34')]=_0x4b535a[_0x72cd('0x34')][_0x72cd('0x36')]?_0x4b535a[_0x72cd('0x34')]:_0x199524[_0x72cd('0x33')];if(!_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x37')](_0x72cd('0x38'))){_0x4b535a['limit']=qs[_0x72cd('0x1c')](_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x1c')]);_0x4b535a[_0x72cd('0x1e')]=qs[_0x72cd('0x1e')](_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x1e')]);}_0x4b535a[_0x72cd('0x39')]=qs['sort'](_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x3a')]);_0x4b535a[_0x72cd('0x3b')]=qs['filters'](_[_0x72cd('0x3c')](_0x17c55d['query'],_0x199524[_0x72cd('0x31')]),_0x183ad1);if(_0x17c55d[_0x72cd('0x2f')]['filter']){_0x4b535a[_0x72cd('0x3b')]=_[_0x72cd('0x3d')](_0x4b535a[_0x72cd('0x3b')],{'$or':_['map'](_0x183ad1,function(_0x1a6c41){if(_0x1a6c41['type']!==_0x72cd('0x3e')){var _0x10f4bc={};_0x10f4bc[_0x1a6c41['name']]={'$like':'%'+_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x3f')]+'%'};return _0x10f4bc;}})});}_0x4b535a=_[_0x72cd('0x3d')]({},_0x4b535a,_0x17c55d[_0x72cd('0x40')]);var _0x45e07c={'where':_0x4b535a[_0x72cd('0x3b')]};return db[_0x72cd('0x41')]['count'](_0x45e07c)[_0x72cd('0x24')](function(_0x2510e3){_0x19a5f3[_0x72cd('0x1d')]=_0x2510e3;if(_0x17c55d[_0x72cd('0x2f')][_0x72cd('0x42')]){_0x4b535a['include']=[{'all':!![]}];}return db['Migration']['findAll'](_0x4b535a);})[_0x72cd('0x24')](function(_0x36e46a){_0x19a5f3[_0x72cd('0x43')]=_0x36e46a;return _0x19a5f3;})[_0x72cd('0x24')](respondWithFilteredResult(_0x1b9131,_0x4b535a))['catch'](handleError(_0x1b9131,null));}; \ No newline at end of file +var _0x652e=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x1f355e,_0x30ad37){var _0x129e21=function(_0x4175ac){while(--_0x4175ac){_0x1f355e['push'](_0x1f355e['shift']());}};_0x129e21(++_0x30ad37);}(_0x652e,0x1f2));var _0xe652=function(_0x26320b,_0x325a04){_0x26320b=_0x26320b-0x0;var _0x1a399b=_0x652e[_0x26320b];return _0x1a399b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe652('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe652('0x1'));var rp=require(_0xe652('0x2'));var moment=require(_0xe652('0x3'));var BPromise=require(_0xe652('0x4'));var Mustache=require(_0xe652('0x5'));var util=require(_0xe652('0x6'));var path=require(_0xe652('0x7'));var sox=require(_0xe652('0x8'));var csv=require(_0xe652('0x9'));var ejs=require(_0xe652('0xa'));var fs=require('fs');var fs_extra=require(_0xe652('0xb'));var _=require(_0xe652('0xc'));var squel=require('squel');var crypto=require(_0xe652('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe652('0xe'));var toCsv=require(_0xe652('0x9'));var querystring=require(_0xe652('0xf'));var Papa=require(_0xe652('0x10'));var Redis=require('ioredis');var authService=require(_0xe652('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe652('0x12'));var hardwareService=require(_0xe652('0x13'));var logger=require(_0xe652('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xe652('0x15'));var licenseUtil=require(_0xe652('0x16'));var db=require(_0xe652('0x17'))['db'];function respondWithStatusCode(_0x1d6566,_0x436df4){_0x436df4=_0x436df4||0xcc;return function(_0x34feeb){if(_0x34feeb){return _0x1d6566[_0xe652('0x18')](_0x436df4);}return _0x1d6566['status'](_0x436df4)[_0xe652('0x19')]();};}function respondWithResult(_0x35caf5,_0x5560b2){_0x5560b2=_0x5560b2||0xc8;return function(_0x40d8f6){if(_0x40d8f6){return _0x35caf5[_0xe652('0x1a')](_0x5560b2)[_0xe652('0x1b')](_0x40d8f6);}};}function respondWithFilteredResult(_0x367b63,_0x2ad052){return function(_0x3ee293){if(_0x3ee293){var _0x97a107=typeof _0x2ad052[_0xe652('0x1c')]===_0xe652('0x1d')&&typeof _0x2ad052[_0xe652('0x1e')]==='undefined';var _0x125d1d=_0x3ee293[_0xe652('0x1f')];var _0x4b7443=_0x97a107?0x0:_0x2ad052['offset'];var _0xb561af=_0x97a107?_0x3ee293[_0xe652('0x1f')]:_0x2ad052[_0xe652('0x1c')]+_0x2ad052[_0xe652('0x1e')];var _0x5b9290;if(_0xb561af>=_0x125d1d){_0xb561af=_0x125d1d;_0x5b9290=0xc8;}else{_0x5b9290=0xce;}_0x367b63['status'](_0x5b9290);return _0x367b63[_0xe652('0x20')](_0xe652('0x21'),_0x4b7443+'-'+_0xb561af+'/'+_0x125d1d)[_0xe652('0x1b')](_0x3ee293);}return null;};}function patchUpdates(_0x4a25cc){return function(_0x179770){try{jsonpatch[_0xe652('0x22')](_0x179770,_0x4a25cc,!![]);}catch(_0x60b3f4){return BPromise[_0xe652('0x23')](_0x60b3f4);}return _0x179770[_0xe652('0x24')]();};}function saveUpdates(_0x39f763,_0x4e4ceb){return function(_0x4a1528){if(_0x4a1528){return _0x4a1528[_0xe652('0x25')](_0x39f763)[_0xe652('0x26')](function(_0x81ea93){return _0x81ea93;});}return null;};}function removeEntity(_0x443534,_0x243910){return function(_0x3a3abe){if(_0x3a3abe){return _0x3a3abe[_0xe652('0x27')]()[_0xe652('0x26')](function(){_0x443534['status'](0xcc)[_0xe652('0x19')]();});}};}function handleEntityNotFound(_0x468073,_0x4ea492){return function(_0x177eb0){if(!_0x177eb0){_0x468073[_0xe652('0x18')](0x194);}return _0x177eb0;};}function handleError(_0x2fcbdb,_0x18c234){_0x18c234=_0x18c234||0x1f4;return function(_0x1bbe54){logger[_0xe652('0x28')](_0x1bbe54['stack']);if(_0x1bbe54['name']){delete _0x1bbe54[_0xe652('0x29')];}_0x2fcbdb['status'](_0x18c234)[_0xe652('0x2a')](_0x1bbe54);};}exports[_0xe652('0x2b')]=function(_0x1eb35a,_0x177ae6){var _0x30b539={},_0xbd7cb6={},_0x37ca6f={'count':0x0,'rows':[]};var _0x5d6389=_[_0xe652('0x2c')](db[_0xe652('0x2d')][_0xe652('0x2e')],function(_0x3a232e){return{'name':_0x3a232e[_0xe652('0x2f')],'type':_0x3a232e['type'][_0xe652('0x30')]};});_0xbd7cb6[_0xe652('0x31')]=_['map'](_0x5d6389,_0xe652('0x29'));_0xbd7cb6[_0xe652('0x32')]=_[_0xe652('0x33')](_0x1eb35a['query']);_0xbd7cb6[_0xe652('0x34')]=_[_0xe652('0x35')](_0xbd7cb6['model'],_0xbd7cb6[_0xe652('0x32')]);_0x30b539[_0xe652('0x36')]=_[_0xe652('0x35')](_0xbd7cb6[_0xe652('0x31')],qs['fields'](_0x1eb35a[_0xe652('0x32')][_0xe652('0x37')]));_0x30b539[_0xe652('0x36')]=_0x30b539[_0xe652('0x36')]['length']?_0x30b539[_0xe652('0x36')]:_0xbd7cb6[_0xe652('0x31')];if(!_0x1eb35a[_0xe652('0x32')][_0xe652('0x38')](_0xe652('0x39'))){_0x30b539[_0xe652('0x1e')]=qs[_0xe652('0x1e')](_0x1eb35a[_0xe652('0x32')]['limit']);_0x30b539[_0xe652('0x1c')]=qs[_0xe652('0x1c')](_0x1eb35a[_0xe652('0x32')][_0xe652('0x1c')]);}_0x30b539['order']=qs[_0xe652('0x3a')](_0x1eb35a[_0xe652('0x32')][_0xe652('0x3a')]);_0x30b539[_0xe652('0x3b')]=qs[_0xe652('0x34')](_[_0xe652('0x3c')](_0x1eb35a[_0xe652('0x32')],_0xbd7cb6[_0xe652('0x34')]),_0x5d6389);if(_0x1eb35a[_0xe652('0x32')]['filter']){_0x30b539[_0xe652('0x3b')]=_[_0xe652('0x3d')](_0x30b539[_0xe652('0x3b')],{'$or':_[_0xe652('0x2c')](_0x5d6389,function(_0x42429c){if(_0x42429c[_0xe652('0x3e')]!==_0xe652('0x3f')){var _0x731c7c={};_0x731c7c[_0x42429c['name']]={'$like':'%'+_0x1eb35a[_0xe652('0x32')][_0xe652('0x40')]+'%'};return _0x731c7c;}})});}_0x30b539=_[_0xe652('0x3d')]({},_0x30b539,_0x1eb35a[_0xe652('0x41')]);var _0x2a3d72={'where':_0x30b539['where']};return db[_0xe652('0x2d')][_0xe652('0x1f')](_0x2a3d72)[_0xe652('0x26')](function(_0x1ac149){_0x37ca6f['count']=_0x1ac149;if(_0x1eb35a[_0xe652('0x32')]['includeAll']){_0x30b539[_0xe652('0x42')]=[{'all':!![]}];}return db['Migration'][_0xe652('0x43')](_0x30b539);})[_0xe652('0x26')](function(_0x1ac67d){_0x37ca6f['rows']=_0x1ac67d;return _0x37ca6f;})[_0xe652('0x26')](respondWithFilteredResult(_0x177ae6,_0x30b539))[_0xe652('0x44')](handleError(_0x177ae6,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c38163e..245e642 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 _0x155e=['api','moment','request-promise','rimraf','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger'];(function(_0xc9cb46,_0x7d6e30){var _0x325ad2=function(_0x1ffa96){while(--_0x1ffa96){_0xc9cb46['push'](_0xc9cb46['shift']());}};_0x325ad2(++_0x7d6e30);}(_0x155e,0x11b));var _0xe155=function(_0x247633,_0x5058f5){_0x247633=_0x247633-0x0;var _0x170b86=_0x155e[_0x247633];return _0x170b86;};'use strict';var _=require(_0xe155('0x0'));var util=require(_0xe155('0x1'));var logger=require(_0xe155('0x2'))(_0xe155('0x3'));var moment=require(_0xe155('0x4'));var BPromise=require('bluebird');var rp=require(_0xe155('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe155('0x6'));var config=require('../../config/environment');var attributes=require(_0xe155('0x7'));module[_0xe155('0x8')]=function(_0x587837,_0x4af726){return _0x587837[_0xe155('0x9')](_0xe155('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebc5=['define','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x44bc6b,_0x17fe72){var _0x40d979=function(_0x442f61){while(--_0x442f61){_0x44bc6b['push'](_0x44bc6b['shift']());}};_0x40d979(++_0x17fe72);}(_0xebc5,0x199));var _0x5ebc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xebc5[_0x543084];return _0x306a57;};'use strict';var _=require(_0x5ebc('0x0'));var util=require(_0x5ebc('0x1'));var logger=require(_0x5ebc('0x2'))('api');var moment=require(_0x5ebc('0x3'));var BPromise=require(_0x5ebc('0x4'));var rp=require(_0x5ebc('0x5'));var fs=require('fs');var path=require(_0x5ebc('0x6'));var rimraf=require(_0x5ebc('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x5ebc('0x8')]=function(_0x3995de,_0x394265){return _0x3995de[_0x5ebc('0x9')]('Migration',attributes,{'tableName':_0x5ebc('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 08c8759..8cfde33 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 _0x58a7=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x165e53,_0x434218){var _0x3b4657=function(_0x59f50a){while(--_0x59f50a){_0x165e53['push'](_0x165e53['shift']());}};_0x3b4657(++_0x434218);}(_0x58a7,0xf7));var _0x758a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x58a7[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var moment=require(_0x758a('0x2'));var BPromise=require(_0x758a('0x3'));var rs=require(_0x758a('0x4'));var fs=require('fs');var Redis=require(_0x758a('0x5'));var db=require(_0x758a('0x6'))['db'];var utils=require(_0x758a('0x7'));var logger=require('../../config/logger')(_0x758a('0x8'));var config=require(_0x758a('0x9'));var jayson=require(_0x758a('0xa'));var client=jayson[_0x758a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52bc94,_0x232c83,_0x514bca){return new BPromise(function(_0x227bdb,_0x31311b){return client[_0x758a('0xc')](_0x52bc94,_0x514bca)[_0x758a('0xd')](function(_0x1e5665){logger[_0x758a('0xe')](_0x758a('0xf'),_0x232c83,_0x758a('0x10'));logger[_0x758a('0x11')](_0x758a('0x12'),_0x232c83,_0x758a('0x10'),JSON['stringify'](_0x1e5665));if(_0x1e5665['error']){if(_0x1e5665[_0x758a('0x13')][_0x758a('0x14')]===0x1f4){logger[_0x758a('0x13')]('Migration,\x20%s,\x20%s',_0x232c83,_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);return _0x31311b(_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);}logger[_0x758a('0x13')]('Migration,\x20%s,\x20%s',_0x232c83,_0x1e5665['error'][_0x758a('0x15')]);return _0x227bdb(_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x232c83,'request\x20sent');_0x227bdb(_0x1e5665['result'][_0x758a('0x15')]);}})[_0x758a('0x16')](function(_0x520883){logger[_0x758a('0x13')](_0x758a('0xf'),_0x232c83,_0x520883);_0x31311b(_0x520883);});});} \ No newline at end of file +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x2a06b3,_0xdab73d){var _0x418611=function(_0x4fb619){while(--_0x4fb619){_0x2a06b3['push'](_0x2a06b3['shift']());}};_0x418611(++_0xdab73d);}(_0x2bb0,0xf3));var _0x02bb=function(_0x4eb798,_0x44998f){_0x4eb798=_0x4eb798-0x0;var _0x1a0b14=_0x2bb0[_0x4eb798];return _0x1a0b14;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('Migration,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 86b6462..59469a3 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 _0x73a8=['../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','create','put','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4ed209,_0x2e2bab){var _0x557b7e=function(_0x286e1d){while(--_0x286e1d){_0x4ed209['push'](_0x4ed209['shift']());}};_0x557b7e(++_0x2e2bab);}(_0x73a8,0x12a));var _0x873a=function(_0x5afa2a,_0x393a5e){_0x5afa2a=_0x5afa2a-0x0;var _0x551faa=_0x73a8[_0x5afa2a];return _0x551faa;};'use strict';var multer=require('multer');var util=require(_0x873a('0x0'));var path=require('path');var timeout=require(_0x873a('0x1'));var express=require(_0x873a('0x2'));var router=express[_0x873a('0x3')]();var fs_extra=require(_0x873a('0x4'));var auth=require(_0x873a('0x5'));var interaction=require(_0x873a('0x6'));var config=require('../../config/environment');var controller=require(_0x873a('0x7'));router[_0x873a('0x8')]('/',auth[_0x873a('0x9')](),controller[_0x873a('0xa')]);router[_0x873a('0x8')](_0x873a('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x873a('0x9')](),controller[_0x873a('0xc')]);router[_0x873a('0xd')]('/:id',auth[_0x873a('0x9')](),controller['update']);router[_0x873a('0xe')](_0x873a('0xb'),auth[_0x873a('0x9')](),controller['destroy']);module[_0x873a('0xf')]=router; \ No newline at end of file +var _0xf722=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x5c16d9,_0x3d56be){var _0x297890=function(_0x2aef6f){while(--_0x2aef6f){_0x5c16d9['push'](_0x5c16d9['shift']());}};_0x297890(++_0x3d56be);}(_0xf722,0x18f));var _0x2f72=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf722[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var path=require(_0x2f72('0x2'));var timeout=require(_0x2f72('0x3'));var express=require('express');var router=express[_0x2f72('0x4')]();var fs_extra=require(_0x2f72('0x5'));var auth=require(_0x2f72('0x6'));var interaction=require(_0x2f72('0x7'));var config=require('../../config/environment');var controller=require(_0x2f72('0x8'));router[_0x2f72('0x9')]('/',auth[_0x2f72('0xa')](),controller['index']);router['get'](_0x2f72('0xb'),auth[_0x2f72('0xa')](),controller[_0x2f72('0xc')]);router[_0x2f72('0xd')]('/',auth[_0x2f72('0xa')](),controller[_0x2f72('0xe')]);router[_0x2f72('0xf')](_0x2f72('0xb'),auth[_0x2f72('0xa')](),controller[_0x2f72('0x10')]);router[_0x2f72('0x11')](_0x2f72('0xb'),auth[_0x2f72('0xa')](),controller[_0x2f72('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 7dfa7a6..0fc6890 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 _0x464e=['exports','ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x464e,0x127));var _0xe464=function(_0x5da8f9,_0x2b6a8e){_0x5da8f9=_0x5da8f9-0x0;var _0x4464e4=_0x464e[_0x5da8f9];return _0x4464e4;};'use strict';var Sequelize=require(_0xe464('0x0'));module[_0xe464('0x1')]={'type':{'type':Sequelize[_0xe464('0x2')](_0xe464('0x3'),_0xe464('0x4'),_0xe464('0x5'),_0xe464('0x6'))},'value':{'type':Sequelize[_0xe464('0x7')]},'username':{'type':Sequelize[_0xe464('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbe5f=['exports','externip','turn','STRING','sequelize'];(function(_0x274eb6,_0x35cb4d){var _0x4aa2e3=function(_0x60de1c){while(--_0x60de1c){_0x274eb6['push'](_0x274eb6['shift']());}};_0x4aa2e3(++_0x35cb4d);}(_0xbe5f,0x162));var _0xfbe5=function(_0x493fcd,_0x35735a){_0x493fcd=_0x493fcd-0x0;var _0x4270e9=_0xbe5f[_0x493fcd];return _0x4270e9;};'use strict';var Sequelize=require(_0xfbe5('0x0'));module[_0xfbe5('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xfbe5('0x2'),'stun',_0xfbe5('0x3'))},'value':{'type':Sequelize[_0xfbe5('0x4')]},'username':{'type':Sequelize[_0xfbe5('0x4')]},'password':{'type':Sequelize[_0xfbe5('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e72d30e..9c814eb 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 _0x5c71=['map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','catch','show','params','keys','length','includeAll','create','sequelize','transaction','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','toUpperCase','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','STUN','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','info','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','destroy','stack','name','send','index'];(function(_0x584d57,_0x36bffd){var _0x1d871a=function(_0x1933bd){while(--_0x1933bd){_0x584d57['push'](_0x584d57['shift']());}};_0x1d871a(++_0x36bffd);}(_0x5c71,0x1e5));var _0x15c7=function(_0x2020b6,_0x2ff986){_0x2020b6=_0x2020b6-0x0;var _0x2e0f62=_0x5c71[_0x2020b6];return _0x2e0f62;};'use strict';var emlformat=require(_0x15c7('0x0'));var rimraf=require(_0x15c7('0x1'));var zipdir=require(_0x15c7('0x2'));var jsonpatch=require(_0x15c7('0x3'));var rp=require(_0x15c7('0x4'));var moment=require(_0x15c7('0x5'));var BPromise=require(_0x15c7('0x6'));var Mustache=require(_0x15c7('0x7'));var util=require(_0x15c7('0x8'));var path=require(_0x15c7('0x9'));var sox=require(_0x15c7('0xa'));var csv=require(_0x15c7('0xb'));var ejs=require(_0x15c7('0xc'));var fs=require('fs');var fs_extra=require(_0x15c7('0xd'));var _=require(_0x15c7('0xe'));var squel=require(_0x15c7('0xf'));var crypto=require('crypto');var jsforce=require(_0x15c7('0x10'));var deskjs=require(_0x15c7('0x11'));var toCsv=require(_0x15c7('0xb'));var querystring=require(_0x15c7('0x12'));var Papa=require('papaparse');var Redis=require(_0x15c7('0x13'));var authService=require(_0x15c7('0x14'));var qs=require(_0x15c7('0x15'));var as=require(_0x15c7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15c7('0x17'))(_0x15c7('0x18'));var utils=require(_0x15c7('0x19'));var config=require(_0x15c7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x15c7('0x1b'))['db'];var jayson=require(_0x15c7('0x1c'));var client=jayson['client'][_0x15c7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x25dcf1,_0x71df4b,_0x58bc80,_0x1410ca){return new BPromise(function(_0x438ba7,_0x51d81c){var _0x1f68ff=_0x1410ca||client;return _0x1f68ff['request'](_0x25dcf1,_0x58bc80)[_0x15c7('0x1e')](function(_0x1363b6){logger['info'](_0x15c7('0x1f'),_0x71df4b,_0x15c7('0x20'));logger[_0x15c7('0x21')](_0x15c7('0x22'),_0x71df4b,_0x15c7('0x20'),JSON['stringify'](_0x1363b6));if(_0x1363b6[_0x15c7('0x23')]){if(_0x1363b6[_0x15c7('0x23')]['code']===0x1f4){logger[_0x15c7('0x23')]('Network,\x20%s,\x20%s',_0x71df4b,_0x1363b6[_0x15c7('0x23')][_0x15c7('0x24')]);return _0x51d81c(_0x1363b6['error'][_0x15c7('0x24')]);}logger['error']('Network,\x20%s,\x20%s',_0x71df4b,_0x1363b6[_0x15c7('0x23')][_0x15c7('0x24')]);return _0x438ba7(_0x1363b6[_0x15c7('0x23')][_0x15c7('0x24')]);}else{logger[_0x15c7('0x25')]('Network,\x20%s,\x20%s',_0x71df4b,_0x15c7('0x20'));_0x438ba7(_0x1363b6['result'][_0x15c7('0x24')]);}})['catch'](function(_0x102f4f){logger[_0x15c7('0x23')](_0x15c7('0x1f'),_0x71df4b,_0x102f4f);_0x51d81c(_0x102f4f);});});}function respondWithStatusCode(_0x1cb7d5,_0x179d32){_0x179d32=_0x179d32||0xcc;return function(_0x4ac413){if(_0x4ac413){return _0x1cb7d5[_0x15c7('0x26')](_0x179d32);}return _0x1cb7d5['status'](_0x179d32)[_0x15c7('0x27')]();};}function respondWithResult(_0x2620eb,_0x2be6dc){_0x2be6dc=_0x2be6dc||0xc8;return function(_0x961846){if(_0x961846){return _0x2620eb['status'](_0x2be6dc)['json'](_0x961846);}};}function respondWithFilteredResult(_0x289725,_0x5dd040){return function(_0x43e30e){if(_0x43e30e){var _0x42becc=typeof _0x5dd040[_0x15c7('0x28')]===_0x15c7('0x29')&&typeof _0x5dd040[_0x15c7('0x2a')]===_0x15c7('0x29');var _0x20defc=_0x43e30e[_0x15c7('0x2b')];var _0x5b8385=_0x42becc?0x0:_0x5dd040[_0x15c7('0x28')];var _0xe61b73=_0x42becc?_0x43e30e[_0x15c7('0x2b')]:_0x5dd040[_0x15c7('0x28')]+_0x5dd040[_0x15c7('0x2a')];var _0x11825f;if(_0xe61b73>=_0x20defc){_0xe61b73=_0x20defc;_0x11825f=0xc8;}else{_0x11825f=0xce;}_0x289725[_0x15c7('0x2c')](_0x11825f);return _0x289725['set'](_0x15c7('0x2d'),_0x5b8385+'-'+_0xe61b73+'/'+_0x20defc)[_0x15c7('0x2e')](_0x43e30e);}return null;};}function patchUpdates(_0xaf116d){return function(_0x311a38){try{jsonpatch[_0x15c7('0x2f')](_0x311a38,_0xaf116d,!![]);}catch(_0x38c637){return BPromise[_0x15c7('0x30')](_0x38c637);}return _0x311a38[_0x15c7('0x31')]();};}function saveUpdates(_0x3a0f0e,_0x2be687){return function(_0x2a92c2){if(_0x2a92c2){return _0x2a92c2['update'](_0x3a0f0e)[_0x15c7('0x1e')](function(_0x2a7a95){return _0x2a7a95;});}return null;};}function removeEntity(_0x51e3cc,_0x538724){return function(_0x571112){if(_0x571112){return _0x571112[_0x15c7('0x32')]()[_0x15c7('0x1e')](function(){_0x51e3cc[_0x15c7('0x2c')](0xcc)[_0x15c7('0x27')]();});}};}function handleEntityNotFound(_0x18657a,_0x5110fc){return function(_0x43fa7b){if(!_0x43fa7b){_0x18657a[_0x15c7('0x26')](0x194);}return _0x43fa7b;};}function handleError(_0x18c503,_0x317358){_0x317358=_0x317358||0x1f4;return function(_0x4f3801){logger[_0x15c7('0x23')](_0x4f3801[_0x15c7('0x33')]);if(_0x4f3801[_0x15c7('0x34')]){delete _0x4f3801[_0x15c7('0x34')];}_0x18c503[_0x15c7('0x2c')](_0x317358)[_0x15c7('0x35')](_0x4f3801);};}exports[_0x15c7('0x36')]=function(_0x41e7f6,_0x509b1d){var _0x27efd7={},_0x24a647={},_0x37a847={'count':0x0,'rows':[]};var _0x4098e3=_[_0x15c7('0x37')](db[_0x15c7('0x38')][_0x15c7('0x39')],function(_0x123d00){return{'name':_0x123d00[_0x15c7('0x3a')],'type':_0x123d00[_0x15c7('0x3b')][_0x15c7('0x3c')]};});_0x24a647[_0x15c7('0x3d')]=_[_0x15c7('0x37')](_0x4098e3,_0x15c7('0x34'));_0x24a647[_0x15c7('0x3e')]=_['keys'](_0x41e7f6[_0x15c7('0x3e')]);_0x24a647[_0x15c7('0x3f')]=_[_0x15c7('0x40')](_0x24a647[_0x15c7('0x3d')],_0x24a647[_0x15c7('0x3e')]);_0x27efd7[_0x15c7('0x41')]=_[_0x15c7('0x40')](_0x24a647[_0x15c7('0x3d')],qs['fields'](_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x42')]));_0x27efd7[_0x15c7('0x41')]=_0x27efd7['attributes']['length']?_0x27efd7[_0x15c7('0x41')]:_0x24a647['model'];if(!_0x41e7f6[_0x15c7('0x3e')]['hasOwnProperty'](_0x15c7('0x43'))){_0x27efd7['limit']=qs[_0x15c7('0x2a')](_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x2a')]);_0x27efd7[_0x15c7('0x28')]=qs[_0x15c7('0x28')](_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x28')]);}_0x27efd7[_0x15c7('0x44')]=qs[_0x15c7('0x45')](_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x45')]);_0x27efd7['where']=qs[_0x15c7('0x3f')](_['pick'](_0x41e7f6['query'],_0x24a647['filters']),_0x4098e3);if(_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x46')]){_0x27efd7[_0x15c7('0x47')]=_[_0x15c7('0x48')](_0x27efd7[_0x15c7('0x47')],{'$or':_[_0x15c7('0x37')](_0x4098e3,function(_0xf1fb43){if(_0xf1fb43[_0x15c7('0x3b')]!=='VIRTUAL'){var _0x17234b={};_0x17234b[_0xf1fb43[_0x15c7('0x34')]]={'$like':'%'+_0x41e7f6[_0x15c7('0x3e')][_0x15c7('0x46')]+'%'};return _0x17234b;}})});}_0x27efd7=_[_0x15c7('0x48')]({},_0x27efd7,_0x41e7f6[_0x15c7('0x49')]);var _0xe0192={'where':_0x27efd7[_0x15c7('0x47')]};return db['Network'][_0x15c7('0x2b')](_0xe0192)[_0x15c7('0x1e')](function(_0x5d1369){_0x37a847['count']=_0x5d1369;if(_0x41e7f6['query']['includeAll']){_0x27efd7[_0x15c7('0x4a')]=[{'all':!![]}];}return db[_0x15c7('0x38')][_0x15c7('0x4b')](_0x27efd7);})[_0x15c7('0x1e')](function(_0x2eff2f){_0x37a847[_0x15c7('0x4c')]=_0x2eff2f;return _0x37a847;})[_0x15c7('0x1e')](respondWithFilteredResult(_0x509b1d,_0x27efd7))[_0x15c7('0x4d')](handleError(_0x509b1d,null));};exports[_0x15c7('0x4e')]=function(_0x2d6059,_0x55e6a4){var _0x5e8e26={'raw':!![],'where':{'id':_0x2d6059[_0x15c7('0x4f')]['id']}},_0x432818={};_0x432818[_0x15c7('0x3d')]=_[_0x15c7('0x50')](db['Network'][_0x15c7('0x39')]);_0x432818[_0x15c7('0x3e')]=_['keys'](_0x2d6059[_0x15c7('0x3e')]);_0x432818['filters']=_[_0x15c7('0x40')](_0x432818[_0x15c7('0x3d')],_0x432818[_0x15c7('0x3e')]);_0x5e8e26['attributes']=_['intersection'](_0x432818[_0x15c7('0x3d')],qs[_0x15c7('0x42')](_0x2d6059[_0x15c7('0x3e')][_0x15c7('0x42')]));_0x5e8e26[_0x15c7('0x41')]=_0x5e8e26[_0x15c7('0x41')][_0x15c7('0x51')]?_0x5e8e26[_0x15c7('0x41')]:_0x432818[_0x15c7('0x3d')];if(_0x2d6059[_0x15c7('0x3e')][_0x15c7('0x52')]){_0x5e8e26[_0x15c7('0x4a')]=[{'all':!![]}];}_0x5e8e26=_['merge']({},_0x5e8e26,_0x2d6059['options']);return db[_0x15c7('0x38')]['find'](_0x5e8e26)['then'](handleEntityNotFound(_0x55e6a4,null))[_0x15c7('0x1e')](respondWithResult(_0x55e6a4,null))[_0x15c7('0x4d')](handleError(_0x55e6a4,null));};exports[_0x15c7('0x53')]=function(_0xfafd05,_0x400c0e,_0x46d453){var _0x5f10cc;return db[_0x15c7('0x54')][_0x15c7('0x55')](function(_0x386065){return db[_0x15c7('0x38')][_0x15c7('0x53')](_0xfafd05[_0x15c7('0x56')],{'raw':!![]})['then'](function(_0x1af54b){_0x5f10cc=_0x1af54b;return db[_0x15c7('0x38')][_0x15c7('0x4b')]({'where':{'type':_0xfafd05[_0x15c7('0x56')][_0x15c7('0x3b')]},'raw':!![]});})['then'](function(_0x58063f){if(_0x5f10cc['type']['toUpperCase']()=='STUN'){var _0x3181fd=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],_0x15c7('0x5a')),_0x15c7('0x5b'));var _0x115969=ejs[_0x15c7('0x5c')](_0x3181fd,{'networks':_0x58063f||[]});fs[_0x15c7('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x115969);return respondWithRpcPromise('Reload',_0x15c7('0x53'),{'module':_0x15c7('0x5e')});}else if(_0x5f10cc['type'][_0x15c7('0x5f')]()=='TURN'){var _0x177f33=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],'server/files/templates/turn_multiple.ejs'),_0x15c7('0x5b'));var _0x46a43b=ejs[_0x15c7('0x5c')](_0x177f33,{'networks':_0x58063f||[]});fs[_0x15c7('0x5d')](_0x15c7('0x60'),_0x46a43b);return respondWithRpcPromise(_0x15c7('0x61'),_0x15c7('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x15a370=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],_0x15c7('0x62')),_0x15c7('0x5b'));var _0x13dd74=ejs[_0x15c7('0x5c')](_0x15a370,{'networks':_0x58063f||[]});fs[_0x15c7('0x5d')](util[_0x15c7('0x63')](_0x15c7('0x64'),_0xfafd05[_0x15c7('0x56')][_0x15c7('0x3b')][_0x15c7('0x65')]()),_0x13dd74);return respondWithRpcPromise('Reload',_0x15c7('0x53'),{'module':_0x15c7('0x66')});}return null;})['then'](function(){return _0x5f10cc;});})[_0x15c7('0x1e')](respondWithResult(_0x400c0e,0xc9))['catch'](handleError(_0x400c0e,null));};exports[_0x15c7('0x67')]=function(_0x16e063,_0x17b31a,_0x5483a0){var _0x302499;return db[_0x15c7('0x54')]['transaction'](function(_0x371695){return db[_0x15c7('0x38')]['find']({'where':{'id':_0x16e063[_0x15c7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17b31a,null))[_0x15c7('0x1e')](saveUpdates(_0x16e063[_0x15c7('0x56')],null))['then'](function(_0x46096a){if(_0x46096a){_0x302499=_0x46096a;return db[_0x15c7('0x38')][_0x15c7('0x4b')]({'where':{'type':_0x302499[_0x15c7('0x3b')]},'raw':!![]});}return null;})['then'](function(_0x3d164d){if(_0x302499[_0x15c7('0x3b')][_0x15c7('0x5f')]()==_0x15c7('0x68')){var _0x301a4f=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],_0x15c7('0x5a')),_0x15c7('0x5b'));var _0x72f6a1=ejs[_0x15c7('0x5c')](_0x301a4f,{'networks':_0x3d164d||[]});fs[_0x15c7('0x5d')](_0x15c7('0x69'),_0x72f6a1);return respondWithRpcPromise('Reload',_0x15c7('0x67'),{'module':_0x15c7('0x5e')});}else if(_0x302499[_0x15c7('0x3b')][_0x15c7('0x5f')]()==_0x15c7('0x6a')){var _0x10934e=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],_0x15c7('0x6b')),_0x15c7('0x5b'));var _0x4ec1e4=ejs[_0x15c7('0x5c')](_0x10934e,{'networks':_0x3d164d||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4ec1e4);return respondWithRpcPromise(_0x15c7('0x61'),'update',{'module':_0x15c7('0x5e')});}else{var _0x23c83f=fs[_0x15c7('0x57')](path['join'](config['root'],_0x15c7('0x62')),_0x15c7('0x5b'));var _0x2406af=ejs['render'](_0x23c83f,{'networks':_0x3d164d||[]});fs[_0x15c7('0x5d')](util[_0x15c7('0x63')](_0x15c7('0x64'),_0x16e063['body'][_0x15c7('0x3b')][_0x15c7('0x65')]()),_0x2406af);return respondWithRpcPromise('Reload',_0x15c7('0x67'),{'module':_0x15c7('0x66')});}return null;})[_0x15c7('0x1e')](function(_0x534f83){if(_0x534f83){return _0x302499;}return null;});})[_0x15c7('0x1e')](respondWithResult(_0x17b31a,null))[_0x15c7('0x4d')](handleError(_0x17b31a,null));};exports[_0x15c7('0x32')]=function(_0x36627a,_0x2aad98,_0x11799a){var _0x9ec094;return db[_0x15c7('0x38')]['find']({'where':{'id':_0x36627a[_0x15c7('0x4f')]['id']}})[_0x15c7('0x1e')](function(_0x2cbdd3){_0x9ec094=_0x2cbdd3;return _0x2cbdd3;})[_0x15c7('0x1e')](handleEntityNotFound(_0x2aad98,null))['then'](removeEntity(_0x2aad98,null))[_0x15c7('0x1e')](function(){if(_0x9ec094){return db[_0x15c7('0x38')][_0x15c7('0x4b')]({'where':{'type':_0x9ec094[_0x15c7('0x3b')]},'raw':!![]});}})[_0x15c7('0x1e')](function(_0x584fb2){if(_0x9ec094[_0x15c7('0x3b')]['toUpperCase']()==_0x15c7('0x68')){var _0x22ed2e=fs[_0x15c7('0x57')](path[_0x15c7('0x58')](config[_0x15c7('0x59')],_0x15c7('0x5a')),_0x15c7('0x5b'));var _0x26acab=ejs[_0x15c7('0x5c')](_0x22ed2e,{'networks':_0x584fb2||[]});fs[_0x15c7('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x26acab);return respondWithRpcPromise(_0x15c7('0x61'),_0x15c7('0x32'),{'module':_0x15c7('0x5e')});}else if(_0x9ec094[_0x15c7('0x3b')][_0x15c7('0x5f')]()==_0x15c7('0x6a')){var _0x31b011=fs[_0x15c7('0x57')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x15c7('0x5b'));var _0x420335=ejs['render'](_0x31b011,{'networks':_0x584fb2||[]});fs[_0x15c7('0x5d')](_0x15c7('0x60'),_0x420335);return respondWithRpcPromise('Reload',_0x15c7('0x32'),{'module':_0x15c7('0x5e')});}else{var _0x47a27b=fs[_0x15c7('0x57')](path['join'](config[_0x15c7('0x59')],'server/files/templates/network.ejs'),_0x15c7('0x5b'));var _0x3c5b7a=ejs[_0x15c7('0x5c')](_0x47a27b,{'networks':_0x584fb2||[]});fs['writeFileSync'](util[_0x15c7('0x63')](_0x15c7('0x64'),_0x36627a[_0x15c7('0x56')][_0x15c7('0x3b')][_0x15c7('0x65')]()),_0x3c5b7a);return respondWithRpcPromise(_0x15c7('0x61'),_0x15c7('0x32'),{'module':_0x15c7('0x66')});}return null;})[_0x15c7('0x4d')](handleError(_0x2aad98,null));}; \ No newline at end of file +var _0x8832=['client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','Network','intersection','include','options','find','create','sequelize','transaction','body','findAll','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','type','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','params','res_stun_monitor.so','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','jayson/promise'];(function(_0x3d42e8,_0x53b2d8){var _0x35e836=function(_0x3ffa01){while(--_0x3ffa01){_0x3d42e8['push'](_0x3d42e8['shift']());}};_0x35e836(++_0x53b2d8);}(_0x8832,0x1f4));var _0x2883=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0x8832[_0x443494];return _0x4a6794;};'use strict';var emlformat=require(_0x2883('0x0'));var rimraf=require(_0x2883('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2883('0x2'));var moment=require(_0x2883('0x3'));var BPromise=require(_0x2883('0x4'));var Mustache=require('mustache');var util=require(_0x2883('0x5'));var path=require('path');var sox=require(_0x2883('0x6'));var csv=require(_0x2883('0x7'));var ejs=require(_0x2883('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2883('0x9'));var squel=require('squel');var crypto=require(_0x2883('0xa'));var jsforce=require(_0x2883('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2883('0xc'));var Papa=require(_0x2883('0xd'));var Redis=require(_0x2883('0xe'));var authService=require(_0x2883('0xf'));var qs=require(_0x2883('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2883('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2883('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2883('0x13'));var client=jayson[_0x2883('0x14')][_0x2883('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1bc7e1,_0x40b62a,_0x40c9e6,_0x4a32d7){return new BPromise(function(_0x4a3a24,_0x85a4a5){var _0x426b37=_0x4a32d7||client;return _0x426b37['request'](_0x1bc7e1,_0x40c9e6)[_0x2883('0x16')](function(_0x41062b){logger[_0x2883('0x17')](_0x2883('0x18'),_0x40b62a,_0x2883('0x19'));logger[_0x2883('0x1a')](_0x2883('0x1b'),_0x40b62a,_0x2883('0x19'),JSON['stringify'](_0x41062b));if(_0x41062b[_0x2883('0x1c')]){if(_0x41062b[_0x2883('0x1c')][_0x2883('0x1d')]===0x1f4){logger[_0x2883('0x1c')](_0x2883('0x18'),_0x40b62a,_0x41062b[_0x2883('0x1c')][_0x2883('0x1e')]);return _0x85a4a5(_0x41062b[_0x2883('0x1c')][_0x2883('0x1e')]);}logger['error'](_0x2883('0x18'),_0x40b62a,_0x41062b[_0x2883('0x1c')][_0x2883('0x1e')]);return _0x4a3a24(_0x41062b['error'][_0x2883('0x1e')]);}else{logger['info'](_0x2883('0x18'),_0x40b62a,_0x2883('0x19'));_0x4a3a24(_0x41062b[_0x2883('0x1f')]['message']);}})[_0x2883('0x20')](function(_0x2f6adf){logger['error'](_0x2883('0x18'),_0x40b62a,_0x2f6adf);_0x85a4a5(_0x2f6adf);});});}function respondWithStatusCode(_0x4def16,_0x76717b){_0x76717b=_0x76717b||0xcc;return function(_0x5556a1){if(_0x5556a1){return _0x4def16['sendStatus'](_0x76717b);}return _0x4def16['status'](_0x76717b)[_0x2883('0x21')]();};}function respondWithResult(_0x49e0d2,_0x4bf27b){_0x4bf27b=_0x4bf27b||0xc8;return function(_0x3f5fb1){if(_0x3f5fb1){return _0x49e0d2['status'](_0x4bf27b)[_0x2883('0x22')](_0x3f5fb1);}};}function respondWithFilteredResult(_0x327e4e,_0x3f6268){return function(_0x15c130){if(_0x15c130){var _0x68dfd5=typeof _0x3f6268[_0x2883('0x23')]==='undefined'&&typeof _0x3f6268[_0x2883('0x24')]===_0x2883('0x25');var _0x52a011=_0x15c130[_0x2883('0x26')];var _0x1a2971=_0x68dfd5?0x0:_0x3f6268[_0x2883('0x23')];var _0x405c02=_0x68dfd5?_0x15c130['count']:_0x3f6268['offset']+_0x3f6268[_0x2883('0x24')];var _0x4e091c;if(_0x405c02>=_0x52a011){_0x405c02=_0x52a011;_0x4e091c=0xc8;}else{_0x4e091c=0xce;}_0x327e4e[_0x2883('0x27')](_0x4e091c);return _0x327e4e[_0x2883('0x28')](_0x2883('0x29'),_0x1a2971+'-'+_0x405c02+'/'+_0x52a011)['json'](_0x15c130);}return null;};}function patchUpdates(_0x213e6e){return function(_0x35e30b){try{jsonpatch[_0x2883('0x2a')](_0x35e30b,_0x213e6e,!![]);}catch(_0x4cd054){return BPromise[_0x2883('0x2b')](_0x4cd054);}return _0x35e30b[_0x2883('0x2c')]();};}function saveUpdates(_0x215e0a,_0x4e1ef8){return function(_0x40d7e5){if(_0x40d7e5){return _0x40d7e5['update'](_0x215e0a)[_0x2883('0x16')](function(_0x26501a){return _0x26501a;});}return null;};}function removeEntity(_0x3a1385,_0xa403bd){return function(_0x214d2e){if(_0x214d2e){return _0x214d2e['destroy']()[_0x2883('0x16')](function(){_0x3a1385[_0x2883('0x27')](0xcc)[_0x2883('0x21')]();});}};}function handleEntityNotFound(_0x5b1491,_0x3c1606){return function(_0x58c10d){if(!_0x58c10d){_0x5b1491[_0x2883('0x2d')](0x194);}return _0x58c10d;};}function handleError(_0x64eaaf,_0x3c897a){_0x3c897a=_0x3c897a||0x1f4;return function(_0x237c2b){logger['error'](_0x237c2b[_0x2883('0x2e')]);if(_0x237c2b[_0x2883('0x2f')]){delete _0x237c2b[_0x2883('0x2f')];}_0x64eaaf[_0x2883('0x27')](_0x3c897a)[_0x2883('0x30')](_0x237c2b);};}exports['index']=function(_0x1a8f99,_0x40876a){var _0x2c2639={},_0xc3a384={},_0x1d3e7c={'count':0x0,'rows':[]};var _0x1be346=_[_0x2883('0x31')](db['Network'][_0x2883('0x32')],function(_0x7d86b8){return{'name':_0x7d86b8[_0x2883('0x33')],'type':_0x7d86b8['type'][_0x2883('0x34')]};});_0xc3a384[_0x2883('0x35')]=_[_0x2883('0x31')](_0x1be346,_0x2883('0x2f'));_0xc3a384[_0x2883('0x36')]=_[_0x2883('0x37')](_0x1a8f99[_0x2883('0x36')]);_0xc3a384[_0x2883('0x38')]=_['intersection'](_0xc3a384['model'],_0xc3a384[_0x2883('0x36')]);_0x2c2639[_0x2883('0x39')]=_['intersection'](_0xc3a384[_0x2883('0x35')],qs['fields'](_0x1a8f99['query'][_0x2883('0x3a')]));_0x2c2639[_0x2883('0x39')]=_0x2c2639[_0x2883('0x39')][_0x2883('0x3b')]?_0x2c2639[_0x2883('0x39')]:_0xc3a384[_0x2883('0x35')];if(!_0x1a8f99['query']['hasOwnProperty'](_0x2883('0x3c'))){_0x2c2639[_0x2883('0x24')]=qs[_0x2883('0x24')](_0x1a8f99[_0x2883('0x36')]['limit']);_0x2c2639[_0x2883('0x23')]=qs['offset'](_0x1a8f99['query'][_0x2883('0x23')]);}_0x2c2639[_0x2883('0x3d')]=qs['sort'](_0x1a8f99[_0x2883('0x36')][_0x2883('0x3e')]);_0x2c2639[_0x2883('0x3f')]=qs[_0x2883('0x38')](_[_0x2883('0x40')](_0x1a8f99['query'],_0xc3a384[_0x2883('0x38')]),_0x1be346);if(_0x1a8f99['query'][_0x2883('0x41')]){_0x2c2639['where']=_[_0x2883('0x42')](_0x2c2639['where'],{'$or':_[_0x2883('0x31')](_0x1be346,function(_0x1f9af2){if(_0x1f9af2['type']!==_0x2883('0x43')){var _0x4937dc={};_0x4937dc[_0x1f9af2['name']]={'$like':'%'+_0x1a8f99[_0x2883('0x36')][_0x2883('0x41')]+'%'};return _0x4937dc;}})});}_0x2c2639=_['merge']({},_0x2c2639,_0x1a8f99['options']);var _0x57e8bf={'where':_0x2c2639[_0x2883('0x3f')]};return db['Network'][_0x2883('0x26')](_0x57e8bf)['then'](function(_0x156f37){_0x1d3e7c[_0x2883('0x26')]=_0x156f37;if(_0x1a8f99[_0x2883('0x36')][_0x2883('0x44')]){_0x2c2639['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x2c2639);})[_0x2883('0x16')](function(_0x608942){_0x1d3e7c[_0x2883('0x45')]=_0x608942;return _0x1d3e7c;})['then'](respondWithFilteredResult(_0x40876a,_0x2c2639))[_0x2883('0x20')](handleError(_0x40876a,null));};exports[_0x2883('0x46')]=function(_0x233afa,_0x2e64c1){var _0x1427fd={'raw':!![],'where':{'id':_0x233afa['params']['id']}},_0xc2a4af={};_0xc2a4af[_0x2883('0x35')]=_['keys'](db[_0x2883('0x47')][_0x2883('0x32')]);_0xc2a4af[_0x2883('0x36')]=_[_0x2883('0x37')](_0x233afa[_0x2883('0x36')]);_0xc2a4af[_0x2883('0x38')]=_[_0x2883('0x48')](_0xc2a4af[_0x2883('0x35')],_0xc2a4af['query']);_0x1427fd['attributes']=_[_0x2883('0x48')](_0xc2a4af[_0x2883('0x35')],qs['fields'](_0x233afa['query']['fields']));_0x1427fd[_0x2883('0x39')]=_0x1427fd['attributes']['length']?_0x1427fd[_0x2883('0x39')]:_0xc2a4af[_0x2883('0x35')];if(_0x233afa['query']['includeAll']){_0x1427fd[_0x2883('0x49')]=[{'all':!![]}];}_0x1427fd=_['merge']({},_0x1427fd,_0x233afa[_0x2883('0x4a')]);return db[_0x2883('0x47')][_0x2883('0x4b')](_0x1427fd)[_0x2883('0x16')](handleEntityNotFound(_0x2e64c1,null))['then'](respondWithResult(_0x2e64c1,null))['catch'](handleError(_0x2e64c1,null));};exports[_0x2883('0x4c')]=function(_0x5d88ed,_0x16b004,_0x3923bb){var _0x1d3d5d;return db[_0x2883('0x4d')][_0x2883('0x4e')](function(_0x481754){return db[_0x2883('0x47')][_0x2883('0x4c')](_0x5d88ed[_0x2883('0x4f')],{'raw':!![]})[_0x2883('0x16')](function(_0x80a3c0){_0x1d3d5d=_0x80a3c0;return db[_0x2883('0x47')][_0x2883('0x50')]({'where':{'type':_0x5d88ed['body']['type']},'raw':!![]});})['then'](function(_0x38d009){if(_0x1d3d5d['type']['toUpperCase']()==_0x2883('0x51')){var _0x461f18=fs[_0x2883('0x52')](path[_0x2883('0x53')](config[_0x2883('0x54')],_0x2883('0x55')),_0x2883('0x56'));var _0x25e8fc=ejs[_0x2883('0x57')](_0x461f18,{'networks':_0x38d009||[]});fs[_0x2883('0x58')](_0x2883('0x59'),_0x25e8fc);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x4c'),{'module':'res_stun_monitor.so'});}else if(_0x1d3d5d[_0x2883('0x5b')][_0x2883('0x5c')]()==_0x2883('0x5d')){var _0x41c298=fs[_0x2883('0x52')](path[_0x2883('0x53')](config['root'],_0x2883('0x5e')),_0x2883('0x56'));var _0x2252f0=ejs[_0x2883('0x57')](_0x41c298,{'networks':_0x38d009||[]});fs[_0x2883('0x58')]('/etc/asterisk/turn_xcally.conf',_0x2252f0);return respondWithRpcPromise(_0x2883('0x5a'),'create',{'module':'res_stun_monitor.so'});}else{var _0x46bc75=fs['readFileSync'](path[_0x2883('0x53')](config[_0x2883('0x54')],'server/files/templates/network.ejs'),_0x2883('0x56'));var _0x3dde56=ejs[_0x2883('0x57')](_0x46bc75,{'networks':_0x38d009||[]});fs[_0x2883('0x58')](util[_0x2883('0x5f')](_0x2883('0x60'),_0x5d88ed[_0x2883('0x4f')][_0x2883('0x5b')][_0x2883('0x61')]()),_0x3dde56);return respondWithRpcPromise('Reload',_0x2883('0x4c'),{'module':'chan_sip.so'});}return null;})[_0x2883('0x16')](function(){return _0x1d3d5d;});})[_0x2883('0x16')](respondWithResult(_0x16b004,0xc9))['catch'](handleError(_0x16b004,null));};exports[_0x2883('0x62')]=function(_0x7bd2ed,_0x19d0c7,_0x4347bd){var _0x1e330d;return db[_0x2883('0x4d')][_0x2883('0x4e')](function(_0x1c5891){return db[_0x2883('0x47')][_0x2883('0x4b')]({'where':{'id':_0x7bd2ed[_0x2883('0x63')]['id']}})[_0x2883('0x16')](handleEntityNotFound(_0x19d0c7,null))[_0x2883('0x16')](saveUpdates(_0x7bd2ed['body'],null))[_0x2883('0x16')](function(_0x6ed09b){if(_0x6ed09b){_0x1e330d=_0x6ed09b;return db[_0x2883('0x47')][_0x2883('0x50')]({'where':{'type':_0x1e330d[_0x2883('0x5b')]},'raw':!![]});}return null;})[_0x2883('0x16')](function(_0x52a5a8){if(_0x1e330d[_0x2883('0x5b')][_0x2883('0x5c')]()==_0x2883('0x51')){var _0x303220=fs[_0x2883('0x52')](path[_0x2883('0x53')](config[_0x2883('0x54')],_0x2883('0x55')),_0x2883('0x56'));var _0x193071=ejs[_0x2883('0x57')](_0x303220,{'networks':_0x52a5a8||[]});fs[_0x2883('0x58')]('/etc/asterisk/stun_xcally.conf',_0x193071);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x62'),{'module':_0x2883('0x64')});}else if(_0x1e330d[_0x2883('0x5b')]['toUpperCase']()==_0x2883('0x5d')){var _0x49e6cc=fs[_0x2883('0x52')](path[_0x2883('0x53')](config[_0x2883('0x54')],_0x2883('0x5e')),_0x2883('0x56'));var _0x1ee07c=ejs['render'](_0x49e6cc,{'networks':_0x52a5a8||[]});fs[_0x2883('0x58')](_0x2883('0x65'),_0x1ee07c);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x62'),{'module':_0x2883('0x64')});}else{var _0x1fff1e=fs[_0x2883('0x52')](path[_0x2883('0x53')](config[_0x2883('0x54')],_0x2883('0x66')),_0x2883('0x56'));var _0x788a0d=ejs[_0x2883('0x57')](_0x1fff1e,{'networks':_0x52a5a8||[]});fs[_0x2883('0x58')](util['format'](_0x2883('0x60'),_0x7bd2ed[_0x2883('0x4f')][_0x2883('0x5b')][_0x2883('0x61')]()),_0x788a0d);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x62'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x119ec0){if(_0x119ec0){return _0x1e330d;}return null;});})[_0x2883('0x16')](respondWithResult(_0x19d0c7,null))[_0x2883('0x20')](handleError(_0x19d0c7,null));};exports[_0x2883('0x67')]=function(_0x1df8ac,_0x4b2ec8,_0x1d1de4){var _0x2ad7a4;return db[_0x2883('0x47')][_0x2883('0x4b')]({'where':{'id':_0x1df8ac[_0x2883('0x63')]['id']}})[_0x2883('0x16')](function(_0x3070bc){_0x2ad7a4=_0x3070bc;return _0x3070bc;})['then'](handleEntityNotFound(_0x4b2ec8,null))[_0x2883('0x16')](removeEntity(_0x4b2ec8,null))[_0x2883('0x16')](function(){if(_0x2ad7a4){return db[_0x2883('0x47')]['findAll']({'where':{'type':_0x2ad7a4[_0x2883('0x5b')]},'raw':!![]});}})[_0x2883('0x16')](function(_0x16e25e){if(_0x2ad7a4[_0x2883('0x5b')][_0x2883('0x5c')]()==_0x2883('0x51')){var _0x5b4586=fs[_0x2883('0x52')](path['join'](config[_0x2883('0x54')],_0x2883('0x55')),'utf8');var _0xe10b18=ejs[_0x2883('0x57')](_0x5b4586,{'networks':_0x16e25e||[]});fs[_0x2883('0x58')]('/etc/asterisk/stun_xcally.conf',_0xe10b18);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x67'),{'module':_0x2883('0x64')});}else if(_0x2ad7a4['type']['toUpperCase']()==_0x2883('0x5d')){var _0x317edb=fs[_0x2883('0x52')](path[_0x2883('0x53')](config[_0x2883('0x54')],_0x2883('0x5e')),'utf8');var _0x2d3a33=ejs[_0x2883('0x57')](_0x317edb,{'networks':_0x16e25e||[]});fs[_0x2883('0x58')]('/etc/asterisk/turn_xcally.conf',_0x2d3a33);return respondWithRpcPromise(_0x2883('0x5a'),'destroy',{'module':_0x2883('0x64')});}else{var _0x58b509=fs['readFileSync'](path['join'](config[_0x2883('0x54')],_0x2883('0x66')),_0x2883('0x56'));var _0x43faef=ejs['render'](_0x58b509,{'networks':_0x16e25e||[]});fs['writeFileSync'](util[_0x2883('0x5f')](_0x2883('0x60'),_0x1df8ac[_0x2883('0x4f')][_0x2883('0x5b')][_0x2883('0x61')]()),_0x43faef);return respondWithRpcPromise(_0x2883('0x5a'),_0x2883('0x67'),{'module':'chan_sip.so'});}return null;})[_0x2883('0x20')](handleError(_0x4b2ec8,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4971b95..5e5fd78 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 _0x24cf=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','Network','../../config/logger'];(function(_0x1aef65,_0x521e60){var _0x4a4594=function(_0x120020){while(--_0x120020){_0x1aef65['push'](_0x1aef65['shift']());}};_0x4a4594(++_0x521e60);}(_0x24cf,0x1d5));var _0xf24c=function(_0x2d5c73,_0x25eefc){_0x2d5c73=_0x2d5c73-0x0;var _0x4efb19=_0x24cf[_0x2d5c73];return _0x4efb19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf24c('0x0'))(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rp=require(_0xf24c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var attributes=require(_0xf24c('0x7'));module[_0xf24c('0x8')]=function(_0x5c4ebc,_0x4983e2){return _0x5c4ebc['define'](_0xf24c('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5db8=['lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./network.attributes','exports','Network','network'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x5db8,0xbb));var _0x85db=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x5db8[_0x25248b];return _0x509939;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var moment=require(_0x85db('0x3'));var BPromise=require(_0x85db('0x4'));var rp=require(_0x85db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85db('0x6'));var attributes=require(_0x85db('0x7'));module[_0x85db('0x8')]=function(_0x34d71f,_0x48bf16){return _0x34d71f['define'](_0x85db('0x9'),attributes,{'tableName':_0x85db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 2c89a4f..8e5f884 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(_0x36a8b3,_0x197687){var _0x310b7b=function(_0x2aed4f){while(--_0x2aed4f){_0x36a8b3['push'](_0x36a8b3['shift']());}};_0x310b7b(++_0x197687);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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 _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(_0x2bac4e,_0x791f2e){var _0x298052=function(_0x449f2c){while(--_0x449f2c){_0x2bac4e['push'](_0x2bac4e['shift']());}};_0x298052(++_0x791f2e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4a9d141..7e65fcc 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 _0x62a9=['get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index'];(function(_0x37e2c6,_0x2a0f91){var _0x5275be=function(_0x4c748f){while(--_0x4c748f){_0x37e2c6['push'](_0x37e2c6['shift']());}};_0x5275be(++_0x2a0f91);}(_0x62a9,0x6b));var _0x962a=function(_0x5ce2e3,_0x3dc503){_0x5ce2e3=_0x5ce2e3-0x0;var _0x3b53ab=_0x62a9[_0x5ce2e3];return _0x3b53ab;};'use strict';var multer=require(_0x962a('0x0'));var util=require(_0x962a('0x1'));var path=require('path');var timeout=require(_0x962a('0x2'));var express=require(_0x962a('0x3'));var router=express[_0x962a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x962a('0x5'));var interaction=require(_0x962a('0x6'));var config=require(_0x962a('0x7'));var controller=require(_0x962a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x962a('0x9')]);router[_0x962a('0xa')](_0x962a('0xb'),auth[_0x962a('0xc')](),controller[_0x962a('0xd')]);router[_0x962a('0xa')](_0x962a('0xe'),auth[_0x962a('0xc')](),controller[_0x962a('0xf')]);router[_0x962a('0xa')](_0x962a('0x10'),auth[_0x962a('0xc')](),controller[_0x962a('0x11')]);router[_0x962a('0xa')]('/:id/canned_answers',auth[_0x962a('0xc')](),controller[_0x962a('0x12')]);router['get'](_0x962a('0x13'),auth[_0x962a('0xc')](),controller['getApplications']);router[_0x962a('0xa')](_0x962a('0x14'),auth[_0x962a('0xc')](),controller[_0x962a('0x15')]);router[_0x962a('0xa')](_0x962a('0x16'),auth[_0x962a('0xc')](),controller[_0x962a('0x17')]);router[_0x962a('0x18')]('/',auth[_0x962a('0xc')](),controller[_0x962a('0x19')]);router['post'](_0x962a('0x10'),auth[_0x962a('0xc')](),controller[_0x962a('0x1a')]);router['post']('/:id/canned_answers',auth[_0x962a('0xc')](),controller[_0x962a('0x1b')]);router[_0x962a('0x18')]('/:id/notify',controller[_0x962a('0x1c')]);router[_0x962a('0x18')](_0x962a('0x13'),auth[_0x962a('0xc')](),controller[_0x962a('0x1d')]);router[_0x962a('0x18')](_0x962a('0x16'),auth[_0x962a('0xc')](),controller[_0x962a('0x1e')]);router[_0x962a('0x18')](_0x962a('0x1f'),auth['isAuthenticated'](),controller['send']);router['put'](_0x962a('0xe'),auth[_0x962a('0xc')](),controller[_0x962a('0x20')]);router[_0x962a('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x962a('0x22')]);router[_0x962a('0x21')](_0x962a('0x10'),auth[_0x962a('0xc')](),controller[_0x962a('0x23')]);router[_0x962a('0x21')](_0x962a('0x24'),auth[_0x962a('0xc')](),controller[_0x962a('0x25')]);router['delete'](_0x962a('0x16'),auth[_0x962a('0xc')](),controller[_0x962a('0x26')]);module['exports']=router; \ No newline at end of file +var _0x9be3=['update','delete','destroy','removeDispositions','removeAgents','multer','util','path','express','fs-extra','./openchannelAccount.controller','index','get','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','addApplications','addAgents','send'];(function(_0x1e3ab6,_0x1343ee){var _0xab38bd=function(_0x2e20de){while(--_0x2e20de){_0x1e3ab6['push'](_0x1e3ab6['shift']());}};_0xab38bd(++_0x1343ee);}(_0x9be3,0x10d));var _0x39be=function(_0x7ca506,_0x1e22f8){_0x7ca506=_0x7ca506-0x0;var _0x24f0e1=_0x9be3[_0x7ca506];return _0x24f0e1;};'use strict';var multer=require(_0x39be('0x0'));var util=require(_0x39be('0x1'));var path=require(_0x39be('0x2'));var timeout=require('connect-timeout');var express=require(_0x39be('0x3'));var router=express['Router']();var fs_extra=require(_0x39be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39be('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x39be('0x6')]);router[_0x39be('0x7')](_0x39be('0x8'),auth['isAuthenticated'](),controller[_0x39be('0x9')]);router['get'](_0x39be('0xa'),auth['isAuthenticated'](),controller[_0x39be('0xb')]);router['get'](_0x39be('0xc'),auth[_0x39be('0xd')](),controller['getDispositions']);router[_0x39be('0x7')](_0x39be('0xe'),auth[_0x39be('0xd')](),controller[_0x39be('0xf')]);router[_0x39be('0x7')](_0x39be('0x10'),auth[_0x39be('0xd')](),controller['getApplications']);router[_0x39be('0x7')](_0x39be('0x11'),auth[_0x39be('0xd')](),controller[_0x39be('0x12')]);router[_0x39be('0x7')](_0x39be('0x13'),auth[_0x39be('0xd')](),controller[_0x39be('0x14')]);router[_0x39be('0x15')]('/',auth[_0x39be('0xd')](),controller[_0x39be('0x16')]);router[_0x39be('0x15')](_0x39be('0xc'),auth[_0x39be('0xd')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x39be('0x17')]);router[_0x39be('0x15')](_0x39be('0x18'),controller['notify']);router[_0x39be('0x15')]('/:id/applications',auth[_0x39be('0xd')](),controller[_0x39be('0x19')]);router['post'](_0x39be('0x13'),auth['isAuthenticated'](),controller[_0x39be('0x1a')]);router['post']('/:id/send',auth[_0x39be('0xd')](),controller[_0x39be('0x1b')]);router['put']('/:id',auth[_0x39be('0xd')](),controller[_0x39be('0x1c')]);router[_0x39be('0x1d')]('/:id',auth[_0x39be('0xd')](),controller[_0x39be('0x1e')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x39be('0x1f')]);router[_0x39be('0x1d')](_0x39be('0xe'),auth[_0x39be('0xd')](),controller['removeAnswers']);router[_0x39be('0x1d')](_0x39be('0x13'),auth[_0x39be('0xd')](),controller[_0x39be('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 8217c88..2e7e0c5 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 _0xf787=['STRING','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','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x55f49c,_0x3c610c){var _0x1daafb=function(_0x146426){while(--_0x146426){_0x55f49c['push'](_0x55f49c['shift']());}};_0x1daafb(++_0x3c610c);}(_0xf787,0x1de));var _0x7f78=function(_0x3a50d0,_0x78a88a){_0x3a50d0=_0x3a50d0-0x0;var _0x1987fb=_0xf787[_0x3a50d0];return _0x1987fb;};'use strict';var Sequelize=require(_0x7f78('0x0'));var rs=require(_0x7f78('0x1'));module['exports']={'name':{'type':Sequelize[_0x7f78('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7f78('0x2')]},'token':{'type':Sequelize[_0x7f78('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7f78('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7f78('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7f78('0x3')],'defaultValue':function(){return _0x7f78('0x4');}},'notificationSound':{'type':Sequelize[_0x7f78('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f78('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f78('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7f78('0x2')]},'queueTransfer':{'type':Sequelize[_0x7f78('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f78('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f78('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f78('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f78('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7f78('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x266414){if(!_0x266414)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x7f78('0x8')](_0x7f78('0x9'),_0x266414);}}}; \ No newline at end of file +var _0x7eac=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7eac,0xaa));var _0xc7ea=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x7eac[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc7ea('0x0'));module[_0xc7ea('0x1')]={'name':{'type':Sequelize[_0xc7ea('0x2')],'unique':_0xc7ea('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc7ea('0x2')]},'token':{'type':Sequelize[_0xc7ea('0x2')],'defaultValue':function(){return rs[_0xc7ea('0x4')]();}},'replyUri':{'type':Sequelize[_0xc7ea('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc7ea('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc7ea('0x5')],'defaultValue':function(){return _0xc7ea('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc7ea('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc7ea('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc7ea('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc7ea('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xc7ea('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc7ea('0x7')],'defaultValue':![],'comment':_0xc7ea('0xa'),'set':function(_0x261b39){if(!_0x261b39)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc7ea('0xb')]('mandatoryDisposition',_0x261b39);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d2cff72..119e1cc 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 _0x4a0a=['userOpenchannelAccount:remove','getAgents','DESC','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','client','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','map','query','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','getDispositions','hasOwnProperty','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','list','applications','orderBy','priority','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','update','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','omit','emit','userOpenchannelAccount:save','removeAgents','isArray'];(function(_0x4c9afd,_0x21af7a){var _0x4ecefe=function(_0x4d67a1){while(--_0x4d67a1){_0x4c9afd['push'](_0x4c9afd['shift']());}};_0x4ecefe(++_0x21af7a);}(_0x4a0a,0x17a));var _0xa4a0=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4a0a[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xa4a0('0x0'));var rimraf=require(_0xa4a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4a0('0x2'));var rp=require('request-promise');var moment=require(_0xa4a0('0x3'));var BPromise=require(_0xa4a0('0x4'));var Mustache=require(_0xa4a0('0x5'));var util=require(_0xa4a0('0x6'));var path=require('path');var sox=require(_0xa4a0('0x7'));var csv=require(_0xa4a0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4a0('0x9'));var _=require(_0xa4a0('0xa'));var squel=require('squel');var crypto=require(_0xa4a0('0xb'));var jsforce=require(_0xa4a0('0xc'));var deskjs=require(_0xa4a0('0xd'));var toCsv=require(_0xa4a0('0x8'));var querystring=require(_0xa4a0('0xe'));var Papa=require(_0xa4a0('0xf'));var Redis=require(_0xa4a0('0x10'));var authService=require(_0xa4a0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa4a0('0x12'));var hardwareService=require(_0xa4a0('0x13'));var logger=require(_0xa4a0('0x14'))(_0xa4a0('0x15'));var utils=require(_0xa4a0('0x16'));var config=require(_0xa4a0('0x17'));var licenseUtil=require(_0xa4a0('0x18'));var db=require(_0xa4a0('0x19'))['db'];config[_0xa4a0('0x1a')]=_[_0xa4a0('0x1b')](config[_0xa4a0('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4a0('0x1a')]));require(_0xa4a0('0x1c'))[_0xa4a0('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa4a0('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xa4a0('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x585da1,_0x191a3f,_0x2a7d0a,_0x4c9622){return new BPromise(function(_0x4b2b66,_0x26f077){var _0x25ab3f=_0x4c9622||client;return _0x25ab3f[_0xa4a0('0x1f')](_0x585da1,_0x2a7d0a)['then'](function(_0x5534eb){logger[_0xa4a0('0x20')](_0xa4a0('0x21'),_0x191a3f,_0xa4a0('0x22'));logger[_0xa4a0('0x23')](_0xa4a0('0x24'),_0x191a3f,_0xa4a0('0x22'),JSON[_0xa4a0('0x25')](_0x5534eb));if(_0x5534eb[_0xa4a0('0x26')]){if(_0x5534eb[_0xa4a0('0x26')]['code']===0x1f4){logger['error'](_0xa4a0('0x21'),_0x191a3f,_0x5534eb[_0xa4a0('0x26')][_0xa4a0('0x27')]);return _0x26f077(_0x5534eb[_0xa4a0('0x26')]['message']);}logger[_0xa4a0('0x26')](_0xa4a0('0x21'),_0x191a3f,_0x5534eb[_0xa4a0('0x26')]['message']);return _0x4b2b66(_0x5534eb[_0xa4a0('0x26')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x191a3f,'request\x20sent');_0x4b2b66(_0x5534eb[_0xa4a0('0x28')]['message']);}})[_0xa4a0('0x29')](function(_0x4a6843){logger[_0xa4a0('0x26')](_0xa4a0('0x21'),_0x191a3f,_0x4a6843);_0x26f077(_0x4a6843);});});}function respondWithStatusCode(_0x240cfe,_0x365a4d){_0x365a4d=_0x365a4d||0xcc;return function(_0x36f567){if(_0x36f567){return _0x240cfe[_0xa4a0('0x2a')](_0x365a4d);}return _0x240cfe[_0xa4a0('0x2b')](_0x365a4d)[_0xa4a0('0x2c')]();};}function respondWithResult(_0x32b22c,_0x26ee74){_0x26ee74=_0x26ee74||0xc8;return function(_0x3fb1c0){if(_0x3fb1c0){return _0x32b22c[_0xa4a0('0x2b')](_0x26ee74)['json'](_0x3fb1c0);}};}function respondWithFilteredResult(_0xb8001b,_0x229ae7){return function(_0x44ccf2){if(_0x44ccf2){var _0x37f3ff=typeof _0x229ae7[_0xa4a0('0x2d')]===_0xa4a0('0x2e')&&typeof _0x229ae7[_0xa4a0('0x2f')]===_0xa4a0('0x2e');var _0x5c27d7=_0x44ccf2[_0xa4a0('0x30')];var _0x420956=_0x37f3ff?0x0:_0x229ae7['offset'];var _0x4c16fd=_0x37f3ff?_0x44ccf2[_0xa4a0('0x30')]:_0x229ae7['offset']+_0x229ae7[_0xa4a0('0x2f')];var _0x4a6a8b;if(_0x4c16fd>=_0x5c27d7){_0x4c16fd=_0x5c27d7;_0x4a6a8b=0xc8;}else{_0x4a6a8b=0xce;}_0xb8001b[_0xa4a0('0x2b')](_0x4a6a8b);return _0xb8001b[_0xa4a0('0x31')](_0xa4a0('0x32'),_0x420956+'-'+_0x4c16fd+'/'+_0x5c27d7)['json'](_0x44ccf2);}return null;};}function patchUpdates(_0x491817){return function(_0xa88e72){try{jsonpatch['apply'](_0xa88e72,_0x491817,!![]);}catch(_0x405652){return BPromise['reject'](_0x405652);}return _0xa88e72[_0xa4a0('0x33')]();};}function saveUpdates(_0x162308,_0x58e266){return function(_0x3e3976){if(_0x3e3976){return _0x3e3976['update'](_0x162308)[_0xa4a0('0x34')](function(_0x3cf187){return _0x3cf187;});}return null;};}function removeEntity(_0x2ec1c6,_0x1116bf){return function(_0x4fc6a6){if(_0x4fc6a6){return _0x4fc6a6[_0xa4a0('0x35')]()[_0xa4a0('0x34')](function(){var _0x190d45=_0x4fc6a6[_0xa4a0('0x36')]({'plain':!![]});var _0x81b1e0='OpenchannelAccounts';return db[_0xa4a0('0x37')][_0xa4a0('0x35')]({'where':{'type':_0x81b1e0,'resourceId':_0x190d45['id']}})[_0xa4a0('0x34')](function(){return _0x4fc6a6;});})[_0xa4a0('0x34')](function(){_0x2ec1c6[_0xa4a0('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d914d,_0x2f16f2){return function(_0x49c943){if(!_0x49c943){_0x3d914d[_0xa4a0('0x2a')](0x194);}return _0x49c943;};}function handleError(_0x2a57b6,_0x46d208){_0x46d208=_0x46d208||0x1f4;return function(_0x50fa61){logger[_0xa4a0('0x26')](_0x50fa61[_0xa4a0('0x38')]);if(_0x50fa61[_0xa4a0('0x39')]){delete _0x50fa61[_0xa4a0('0x39')];}_0x2a57b6[_0xa4a0('0x2b')](_0x46d208)[_0xa4a0('0x3a')](_0x50fa61);};}exports[_0xa4a0('0x3b')]=function(_0x445d17,_0x40f14d){var _0x46e74e={'include':[{'model':db[_0xa4a0('0x3c')],'as':'mandatoryDispositionPause'}]},_0xf2c906={},_0x53029e={'count':0x0,'rows':[]};var _0x10d6c6=_['map'](db['OpenchannelAccount'][_0xa4a0('0x3d')],function(_0x3e809d){return{'name':_0x3e809d[_0xa4a0('0x3e')],'type':_0x3e809d[_0xa4a0('0x3f')][_0xa4a0('0x40')]};});_0xf2c906['model']=_[_0xa4a0('0x41')](_0x10d6c6,_0xa4a0('0x39'));_0xf2c906['query']=_['keys'](_0x445d17[_0xa4a0('0x42')]);_0xf2c906['filters']=_['intersection'](_0xf2c906[_0xa4a0('0x43')],_0xf2c906[_0xa4a0('0x42')]);_0x46e74e[_0xa4a0('0x44')]=_[_0xa4a0('0x45')](_0xf2c906[_0xa4a0('0x43')],qs[_0xa4a0('0x46')](_0x445d17['query']['fields']));_0x46e74e[_0xa4a0('0x44')]=_0x46e74e[_0xa4a0('0x44')][_0xa4a0('0x47')]?_0x46e74e[_0xa4a0('0x44')]:_0xf2c906['model'];if(!_0x445d17[_0xa4a0('0x42')]['hasOwnProperty'](_0xa4a0('0x48'))){_0x46e74e[_0xa4a0('0x2f')]=qs[_0xa4a0('0x2f')](_0x445d17[_0xa4a0('0x42')]['limit']);_0x46e74e[_0xa4a0('0x2d')]=qs['offset'](_0x445d17[_0xa4a0('0x42')][_0xa4a0('0x2d')]);}_0x46e74e[_0xa4a0('0x49')]=qs['sort'](_0x445d17[_0xa4a0('0x42')][_0xa4a0('0x4a')]);_0x46e74e['where']=qs[_0xa4a0('0x4b')](_[_0xa4a0('0x4c')](_0x445d17['query'],_0xf2c906[_0xa4a0('0x4b')]),_0x10d6c6);if(_0x445d17[_0xa4a0('0x42')][_0xa4a0('0x4d')]){_0x46e74e[_0xa4a0('0x4e')]=_[_0xa4a0('0x4f')](_0x46e74e[_0xa4a0('0x4e')],{'$or':_[_0xa4a0('0x41')](_0x10d6c6,function(_0xa73f0d){if(_0xa73f0d['type']!==_0xa4a0('0x50')){var _0x15428d={};_0x15428d[_0xa73f0d[_0xa4a0('0x39')]]={'$like':'%'+_0x445d17[_0xa4a0('0x42')][_0xa4a0('0x4d')]+'%'};return _0x15428d;}})});}_0x46e74e=_[_0xa4a0('0x4f')]({},_0x46e74e,_0x445d17[_0xa4a0('0x51')]);var _0x2112ad={'where':_0x46e74e[_0xa4a0('0x4e')]};return db[_0xa4a0('0x52')]['count'](_0x2112ad)[_0xa4a0('0x34')](function(_0x1f5d8b){_0x53029e[_0xa4a0('0x30')]=_0x1f5d8b;if(_0x445d17[_0xa4a0('0x42')][_0xa4a0('0x53')]){_0x46e74e[_0xa4a0('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xa4a0('0x55')](_0x46e74e);})[_0xa4a0('0x34')](function(_0x30be58){_0x53029e[_0xa4a0('0x56')]=_0x30be58;return _0x53029e;})[_0xa4a0('0x34')](respondWithFilteredResult(_0x40f14d,_0x46e74e))[_0xa4a0('0x29')](handleError(_0x40f14d,null));};exports[_0xa4a0('0x57')]=function(_0x4e96a8,_0x207d4a){var _0x35d29c={'raw':![],'where':{'id':_0x4e96a8[_0xa4a0('0x58')]['id']},'include':[{'model':db[_0xa4a0('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4fff6c={};_0x4fff6c[_0xa4a0('0x43')]=_[_0xa4a0('0x59')](db[_0xa4a0('0x52')][_0xa4a0('0x3d')]);_0x4fff6c[_0xa4a0('0x42')]=_[_0xa4a0('0x59')](_0x4e96a8[_0xa4a0('0x42')]);_0x4fff6c[_0xa4a0('0x4b')]=_[_0xa4a0('0x45')](_0x4fff6c[_0xa4a0('0x43')],_0x4fff6c['query']);_0x35d29c['attributes']=_[_0xa4a0('0x45')](_0x4fff6c[_0xa4a0('0x43')],qs[_0xa4a0('0x46')](_0x4e96a8[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x35d29c['attributes']=_0x35d29c[_0xa4a0('0x44')][_0xa4a0('0x47')]?_0x35d29c[_0xa4a0('0x44')]:_0x4fff6c[_0xa4a0('0x43')];if(_0x4e96a8[_0xa4a0('0x42')][_0xa4a0('0x53')]){_0x35d29c[_0xa4a0('0x54')]=[{'all':!![]}];}_0x35d29c=_[_0xa4a0('0x4f')]({},_0x35d29c,_0x4e96a8[_0xa4a0('0x51')]);return db['OpenchannelAccount'][_0xa4a0('0x5a')](_0x35d29c)[_0xa4a0('0x34')](handleEntityNotFound(_0x207d4a,null))[_0xa4a0('0x34')](respondWithResult(_0x207d4a,null))[_0xa4a0('0x29')](handleError(_0x207d4a,null));};exports['create']=function(_0x505a0b,_0x1cd8b5){return db['OpenchannelAccount'][_0xa4a0('0x5b')](_0x505a0b[_0xa4a0('0x5c')],{})[_0xa4a0('0x34')](function(_0xf727f1){var _0x110257=_0x505a0b['user'][_0xa4a0('0x36')]({'plain':!![]});if(!_0x110257)throw new Error(_0xa4a0('0x5d'));if(_0x110257[_0xa4a0('0x5e')]===_0xa4a0('0x5f')){var _0x1543b7=_0xf727f1['get']({'plain':!![]});var _0x4b52b0=_0xa4a0('0x60');return db[_0xa4a0('0x61')][_0xa4a0('0x5a')]({'where':{'name':_0x4b52b0,'userProfileId':_0x110257[_0xa4a0('0x62')]},'raw':!![]})[_0xa4a0('0x34')](function(_0x1f53c4){if(_0x1f53c4&&_0x1f53c4['autoAssociation']===0x0){return db[_0xa4a0('0x37')][_0xa4a0('0x5b')]({'name':_0x1543b7['name'],'resourceId':_0x1543b7['id'],'type':_0x1f53c4[_0xa4a0('0x39')],'sectionId':_0x1f53c4['id']},{})['then'](function(){return _0xf727f1;});}else{return _0xf727f1;}})['catch'](function(_0x50f18a){logger[_0xa4a0('0x26')](_0xa4a0('0x63'),_0x50f18a);throw _0x50f18a;});}return _0xf727f1;})[_0xa4a0('0x34')](respondWithResult(_0x1cd8b5,0xc9))['catch'](handleError(_0x1cd8b5,null));};exports['update']=function(_0x13b3e2,_0x1ba8c9){if(_0x13b3e2['body']['id']){delete _0x13b3e2[_0xa4a0('0x5c')]['id'];}return db[_0xa4a0('0x52')]['find']({'where':{'id':_0x13b3e2[_0xa4a0('0x58')]['id']},'include':[{'model':db[_0xa4a0('0x3c')],'as':_0xa4a0('0x64')}]})[_0xa4a0('0x34')](handleEntityNotFound(_0x1ba8c9,null))[_0xa4a0('0x34')](saveUpdates(_0x13b3e2[_0xa4a0('0x5c')],null))[_0xa4a0('0x34')](respondWithResult(_0x1ba8c9,null))[_0xa4a0('0x29')](handleError(_0x1ba8c9,null));};exports[_0xa4a0('0x35')]=function(_0x49e187,_0x395a17){return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x49e187[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x395a17,null))['then'](removeEntity(_0x395a17,null))[_0xa4a0('0x29')](handleError(_0x395a17,null));};exports[_0xa4a0('0x65')]=function(_0x963e9,_0x53b3b9){return db[_0xa4a0('0x52')]['describe']()[_0xa4a0('0x34')](respondWithResult(_0x53b3b9,null))[_0xa4a0('0x29')](handleError(_0x53b3b9,null));};exports[_0xa4a0('0x66')]=function(_0x4a731d,_0x51bd8d,_0x1625f6){if(_0x4a731d[_0xa4a0('0x5c')]['id']){delete _0x4a731d['body']['id'];}return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x4a731d[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x51bd8d,null))[_0xa4a0('0x34')](function(_0x1216d1){if(_0x1216d1){_0x4a731d[_0xa4a0('0x5c')][_0xa4a0('0x67')]=_0x1216d1['id'];return db['Disposition'][_0xa4a0('0x5b')](_0x4a731d[_0xa4a0('0x5c')]);}})['then'](respondWithResult(_0x51bd8d,null))['catch'](handleError(_0x51bd8d,null));};exports[_0xa4a0('0x68')]=function(_0x6b4650,_0x5bd022,_0x561c88){var _0x2ad981={'raw':![],'where':{}};var _0x3d4630={};var _0x15b3c6={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x6b4650[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x5bd022,null))[_0xa4a0('0x34')](function(_0x5298b7){if(_0x5298b7){_0x3d4630[_0xa4a0('0x43')]=_['keys'](db['Disposition'][_0xa4a0('0x3d')]);_0x3d4630['query']=_[_0xa4a0('0x59')](_0x6b4650['query']);_0x3d4630['filters']=_[_0xa4a0('0x45')](_0x3d4630[_0xa4a0('0x43')],_0x3d4630[_0xa4a0('0x42')]);_0x2ad981[_0xa4a0('0x44')]=_['intersection'](_0x3d4630['model'],qs['fields'](_0x6b4650[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x2ad981[_0xa4a0('0x44')]=_0x2ad981['attributes'][_0xa4a0('0x47')]?_0x2ad981['attributes']:_0x3d4630[_0xa4a0('0x43')];if(!_0x6b4650['query'][_0xa4a0('0x69')](_0xa4a0('0x48'))){_0x2ad981[_0xa4a0('0x2f')]=qs[_0xa4a0('0x2f')](_0x6b4650[_0xa4a0('0x42')][_0xa4a0('0x2f')]);_0x2ad981[_0xa4a0('0x2d')]=qs[_0xa4a0('0x2d')](_0x6b4650[_0xa4a0('0x42')]['offset']);}_0x2ad981[_0xa4a0('0x49')]=qs[_0xa4a0('0x4a')](_0x6b4650[_0xa4a0('0x42')]['sort']);_0x2ad981[_0xa4a0('0x4e')]=qs['filters'](_[_0xa4a0('0x4c')](_0x6b4650[_0xa4a0('0x42')],_0x3d4630[_0xa4a0('0x4b')]));_0x2ad981['where'][_0xa4a0('0x67')]=_0x5298b7['id'];if(_0x6b4650[_0xa4a0('0x42')][_0xa4a0('0x4d')]){_0x2ad981[_0xa4a0('0x4e')]=_[_0xa4a0('0x4f')](_0x2ad981[_0xa4a0('0x4e')],{'$or':_[_0xa4a0('0x41')](_0x2ad981[_0xa4a0('0x44')],function(_0x1a6752){var _0x52f876={};_0x52f876[_0x1a6752]={'$like':'%'+_0x6b4650['query']['filter']+'%'};return _0x52f876;})});}_0x2ad981=_['merge']({},_0x2ad981,_0x6b4650[_0xa4a0('0x51')]);return db[_0xa4a0('0x6a')]['count']({'where':_0x2ad981['where']})[_0xa4a0('0x34')](function(_0x4bc395){_0x15b3c6[_0xa4a0('0x30')]=_0x4bc395;if(_0x6b4650[_0xa4a0('0x42')][_0xa4a0('0x53')]){_0x2ad981[_0xa4a0('0x54')]=[{'all':!![]}];}return db[_0xa4a0('0x6a')][_0xa4a0('0x55')](_0x2ad981);})[_0xa4a0('0x34')](function(_0x3d7d7c){_0x15b3c6[_0xa4a0('0x56')]=_0x3d7d7c;return _0x15b3c6;});}})[_0xa4a0('0x34')](respondWithFilteredResult(_0x5bd022,_0x2ad981))[_0xa4a0('0x29')](handleError(_0x5bd022,null));};exports['removeDispositions']=function(_0x75d5cc,_0x29a7c9,_0x45c026){return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x75d5cc['params']['id']}})['then'](handleEntityNotFound(_0x29a7c9,null))['then'](function(_0x1ecff2){if(_0x1ecff2){return _0x1ecff2[_0xa4a0('0x6b')](_0x75d5cc[_0xa4a0('0x42')][_0xa4a0('0x6c')]);}})['then'](respondWithStatusCode(_0x29a7c9,null))[_0xa4a0('0x29')](handleError(_0x29a7c9,null));};exports[_0xa4a0('0x6d')]=function(_0x2cb04c,_0x49379f,_0x2beccd){if(_0x2cb04c[_0xa4a0('0x5c')]['id']){delete _0x2cb04c['body']['id'];}return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x2cb04c['params']['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0x49379f,null))[_0xa4a0('0x34')](function(_0x2d753f){if(_0x2d753f){_0x2cb04c[_0xa4a0('0x5c')][_0xa4a0('0x67')]=_0x2d753f['id'];return db[_0xa4a0('0x6e')][_0xa4a0('0x5b')](_0x2cb04c[_0xa4a0('0x5c')]);}})[_0xa4a0('0x34')](respondWithResult(_0x49379f,null))['catch'](handleError(_0x49379f,null));};exports[_0xa4a0('0x6f')]=function(_0x3298ae,_0x4bcec0,_0x2725df){var _0x1cd137={'raw':![],'where':{}};var _0x39176a={};var _0x359071={'count':0x0,'rows':[]};return db[_0xa4a0('0x52')][_0xa4a0('0x70')]({'where':{'id':_0x3298ae[_0xa4a0('0x58')]['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0x4bcec0,null))[_0xa4a0('0x34')](function(_0xfe3cbd){if(_0xfe3cbd){_0x39176a[_0xa4a0('0x43')]=_['keys'](db[_0xa4a0('0x6e')]['rawAttributes']);_0x39176a[_0xa4a0('0x42')]=_['keys'](_0x3298ae['query']);_0x39176a[_0xa4a0('0x4b')]=_[_0xa4a0('0x45')](_0x39176a[_0xa4a0('0x43')],_0x39176a['query']);_0x1cd137[_0xa4a0('0x44')]=_['intersection'](_0x39176a[_0xa4a0('0x43')],qs['fields'](_0x3298ae[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x1cd137[_0xa4a0('0x44')]=_0x1cd137[_0xa4a0('0x44')][_0xa4a0('0x47')]?_0x1cd137[_0xa4a0('0x44')]:_0x39176a[_0xa4a0('0x43')];if(!_0x3298ae['query'][_0xa4a0('0x69')](_0xa4a0('0x48'))){_0x1cd137[_0xa4a0('0x2f')]=qs[_0xa4a0('0x2f')](_0x3298ae[_0xa4a0('0x42')]['limit']);_0x1cd137[_0xa4a0('0x2d')]=qs[_0xa4a0('0x2d')](_0x3298ae[_0xa4a0('0x42')][_0xa4a0('0x2d')]);}_0x1cd137[_0xa4a0('0x49')]=qs[_0xa4a0('0x4a')](_0x3298ae[_0xa4a0('0x42')][_0xa4a0('0x4a')]);_0x1cd137['where']=qs[_0xa4a0('0x4b')](_[_0xa4a0('0x4c')](_0x3298ae[_0xa4a0('0x42')],_0x39176a['filters']));_0x1cd137[_0xa4a0('0x4e')][_0xa4a0('0x67')]=_0xfe3cbd['id'];if(_0x3298ae[_0xa4a0('0x42')]['filter']){_0x1cd137[_0xa4a0('0x4e')]=_['merge'](_0x1cd137['where'],{'$or':_[_0xa4a0('0x41')](_0x1cd137[_0xa4a0('0x44')],function(_0x40f15a){var _0x1e63a0={};_0x1e63a0[_0x40f15a]={'$like':'%'+_0x3298ae[_0xa4a0('0x42')][_0xa4a0('0x4d')]+'%'};return _0x1e63a0;})});}_0x1cd137=_[_0xa4a0('0x4f')]({},_0x1cd137,_0x3298ae[_0xa4a0('0x51')]);return db['CannedAnswer'][_0xa4a0('0x30')]({'where':_0x1cd137[_0xa4a0('0x4e')]})[_0xa4a0('0x34')](function(_0x2201ed){_0x359071[_0xa4a0('0x30')]=_0x2201ed;if(_0x3298ae['query'][_0xa4a0('0x53')]){_0x1cd137[_0xa4a0('0x54')]=[{'all':!![]}];}return db[_0xa4a0('0x6e')][_0xa4a0('0x55')](_0x1cd137);})[_0xa4a0('0x34')](function(_0x4f151e){_0x359071[_0xa4a0('0x56')]=_0x4f151e;return _0x359071;});}})[_0xa4a0('0x34')](respondWithFilteredResult(_0x4bcec0,_0x1cd137))[_0xa4a0('0x29')](handleError(_0x4bcec0,null));};exports[_0xa4a0('0x71')]=function(_0x646448,_0x7d3ee4,_0x1a0e7e){return db['OpenchannelAccount']['find']({'where':{'id':_0x646448[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x7d3ee4,null))['then'](function(_0x12a5f7){if(_0x12a5f7){return _0x12a5f7[_0xa4a0('0x71')](_0x646448['query'][_0xa4a0('0x6c')]);}})[_0xa4a0('0x34')](respondWithStatusCode(_0x7d3ee4,null))['catch'](handleError(_0x7d3ee4,null));};exports[_0xa4a0('0x72')]=function(_0x246ebb,_0x1a516e,_0x415cd4){var _0x56a055={'body':_0x246ebb[_0xa4a0('0x5c')],'channel':'openchannel'};var _0x20e734=[];var _0x4f34f3=[];var _0x24d3d7={};var _0x3500db=![];return db[_0xa4a0('0x73')][_0xa4a0('0x65')]()[_0xa4a0('0x34')](function(_0x2eb46b){if(!_0x2eb46b){throw new db['Sequelize'][(_0xa4a0('0x74'))](_0xa4a0('0x75'));}_0x20e734=_['difference'](_[_0xa4a0('0x59')](_0x2eb46b),[_0xa4a0('0x76'),_0xa4a0('0x77')]);_0x4f34f3=_[_0xa4a0('0x78')](_['keys'](_0x2eb46b),[_0xa4a0('0x76'),'updatedAt',_0xa4a0('0x79'),_0xa4a0('0x7a')]);if(_0x246ebb[_0xa4a0('0x5c')]['id']){delete _0x246ebb['body']['id'];}if(_[_0xa4a0('0x7b')](_0x246ebb['body'][_0xa4a0('0x7c')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa4a0('0x7b')](_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x5c')])||_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0xa4a0('0x7d'));}if(_[_0xa4a0('0x7b')](_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x7e')])){throw new db[(_0xa4a0('0x7f'))][(_0xa4a0('0x74'))](_0xa4a0('0x80')+_0x4f34f3);}if(!_['includes'](_0x4f34f3,_0x246ebb[_0xa4a0('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0xa4a0('0x74'))](_0xa4a0('0x81')+_0x4f34f3);}_0x24d3d7[_0x246ebb[_0xa4a0('0x5c')]['mapKey']]=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x7c')];})[_0xa4a0('0x34')](function(){return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x246ebb[_0xa4a0('0x58')]['id']},'include':[{'model':db[_0xa4a0('0x82')],'as':_0xa4a0('0x83'),'include':[{'model':db['CmContact'],'as':_0xa4a0('0x84'),'where':_0x24d3d7,'limit':0x1,'order':[[_0xa4a0('0x77'),'DESC']]}]},{'model':db[_0xa4a0('0x85')],'as':_0xa4a0('0x86')}]});})[_0xa4a0('0x34')](handleEntityNotFound(_0x1a516e,null))[_0xa4a0('0x34')](function(_0x5737e0){if(_0x5737e0&&_0x5737e0[_0xa4a0('0x83')]){_0x56a055['account']=_0x5737e0;_0x56a055['applications']=_0x5737e0[_0xa4a0('0x86')];_0x56a055[_0xa4a0('0x87')]=_0x5737e0[_0xa4a0('0x83')];_0x56a055[_0xa4a0('0x88')]=_[_0xa4a0('0x89')](_0x56a055['applications'],[_0xa4a0('0x8a')],['asc']);if(_0x56a055[_0xa4a0('0x8b')][_0xa4a0('0x86')]){delete _0x56a055['account'][_0xa4a0('0x86')];}if(_0x56a055['account'][_0xa4a0('0x83')]&&_0x56a055[_0xa4a0('0x8b')][_0xa4a0('0x83')][_0xa4a0('0x84')][_0xa4a0('0x47')]){return _0x56a055[_0xa4a0('0x8b')][_0xa4a0('0x83')][_0xa4a0('0x84')][0x0];}var _0x1a2b6f=_[_0xa4a0('0x1b')](_0x246ebb['body'],{'firstName':_0x246ebb['body'][_0xa4a0('0x7c')],'ListId':_0x5737e0[_0xa4a0('0x7a')]});_0x1a2b6f[_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x7e')]]=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x7c')];return db[_0xa4a0('0x73')][_0xa4a0('0x5b')](_0x1a2b6f,{'fields':_0x20e734,'raw':!![]});}})[_0xa4a0('0x34')](handleEntityNotFound(_0x1a516e,null))[_0xa4a0('0x34')](function(_0x5b9ced){_0x56a055[_0xa4a0('0x8c')]=_0x5b9ced;if(_0x5b9ced){var _0x4cbadf={'ContactId':_0x5b9ced['id'],'OpenchannelAccountId':_0x246ebb[_0xa4a0('0x58')]['id'],'from':(_0x5b9ced[_0xa4a0('0x8d')]||'')+'\x20'+(_0x5b9ced[_0xa4a0('0x8e')]||'')};var _0x28c236={'OpenchannelAccountId':_0x246ebb[_0xa4a0('0x58')]['id'],'closed':![]};if(_0x246ebb['body'][_0xa4a0('0x8f')]){_0x28c236[_0xa4a0('0x8f')]=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x8f')];return db['OpenchannelInteraction']['find']({'where':_0x28c236})[_0xa4a0('0x34')](function(_0x5245c4){if(_0x5245c4){return[_0x5245c4,![]];}_0x4cbadf[_0xa4a0('0x8f')]=_0x246ebb['body'][_0xa4a0('0x8f')];_0x4cbadf[_0xa4a0('0x90')]=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x90')];return db['OpenchannelInteraction']['create'](_0x4cbadf)[_0xa4a0('0x34')](function(_0x154efd){return[_0x154efd,!![]];});});}else{_0x28c236[_0xa4a0('0x8f')]=null;}_0x28c236['ContactId']=_0x5b9ced['id'];return db[_0xa4a0('0x91')][_0xa4a0('0x5a')]({'where':_0x28c236})['then'](function(_0x4bc482){if(_0x4bc482){return[_0x4bc482,![]];}return db['OpenchannelInteraction']['create'](_0x4cbadf)[_0xa4a0('0x34')](function(_0x43a2e4){return[_0x43a2e4,!![]];});});}})[_0xa4a0('0x92')](function(_0xef1454,_0x455544){if(_0xef1454){_0x3500db=_0x455544;if(!_0x455544){var _0x584fa6={'from':(_0x56a055[_0xa4a0('0x8c')][_0xa4a0('0x8d')]||'')+'\x20'+(_0x56a055['contact'][_0xa4a0('0x8e')]||'')};if(_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x8f')]&&_0x246ebb['body']['messageId']&&_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x8f')]!=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x93')]){_0x584fa6[_0xa4a0('0x8f')]=_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x93')];}return _0xef1454[_0xa4a0('0x94')](_0x584fa6);}else{return _0xef1454;}}})[_0xa4a0('0x34')](function(_0x353c79){_0x56a055[_0xa4a0('0x95')]=_0x353c79[_0xa4a0('0x36')]({'plain':!![]});_0x56a055[_0xa4a0('0x95')]['created']=_0x3500db;if(_0x56a055[_0xa4a0('0x95')][_0xa4a0('0x96')]){if(_0x56a055[_0xa4a0('0x8b')][_0xa4a0('0x97')]){_0x56a055[_0xa4a0('0x88')][_0xa4a0('0x98')]({'id':0x0,'priority':_0x56a055[_0xa4a0('0x88')][_0xa4a0('0x47')]+0x1,'app':_0xa4a0('0x99'),'appdata':_0xa4a0('0x9a'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x5c')],'OpenchannelAccountId':_0x246ebb[_0xa4a0('0x58')]['id'],'OpenchannelInteractionId':_0x353c79['id'],'direction':'in','ContactId':_0x56a055[_0xa4a0('0x8c')]['id'],'AttachmentId':_0x246ebb[_0xa4a0('0x5c')][_0xa4a0('0x9b')]});})['then'](function(_0x1b00e7){_0x56a055[_0xa4a0('0x27')]=_0x1b00e7;if(_0x56a055[_0xa4a0('0x95')][_0xa4a0('0x9c')]){return db[_0xa4a0('0x9d')][_0xa4a0('0x5a')]({'attributes':['id',_0xa4a0('0x39')],'where':{'id':_0x56a055[_0xa4a0('0x95')][_0xa4a0('0x9c')]}})[_0xa4a0('0x34')](function(_0x5408ef){if(_0x5408ef){_0x56a055['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5408ef[_0xa4a0('0x39')]+','+(_0x56a055['account'][_0xa4a0('0x9e')]||0xa),'interval':'*,*,*,*'});_0x56a055[_0xa4a0('0x9f')]=![];}return respondWithRpcPromise(_0xa4a0('0xa0'),_0xa4a0('0xa1'),_0x56a055);});}return respondWithRpcPromise(_0xa4a0('0xa0'),_0xa4a0('0xa1'),_0x56a055);})[_0xa4a0('0x34')](function(_0x3e4043){respondWithRpcPromise('EventManager',_0xa4a0('0xa2'),{'event':'notify','message':_0x3e4043},client9002);return _0x3e4043;})[_0xa4a0('0x34')](respondWithResult(_0x1a516e,null))['catch'](handleError(_0x1a516e,null));};exports[_0xa4a0('0xa3')]=function(_0x41b9f7,_0x44635c,_0x266165){return db[_0xa4a0('0x52')][_0xa4a0('0x70')]({'where':{'id':_0x41b9f7[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x44635c,null))['then'](function(_0x1d4ea0){if(_0x1d4ea0){return db[_0xa4a0('0xa4')][_0xa4a0('0xa5')](function(_0x187853){return db[_0xa4a0('0x85')][_0xa4a0('0x35')]({'where':{'OpenchannelAccountId':_0x41b9f7[_0xa4a0('0x58')]['id']},'transaction':_0x187853})[_0xa4a0('0x34')](function(_0x2a0aca){var _0x376394=_[_0xa4a0('0x41')](_0x41b9f7[_0xa4a0('0x5c')],function(_0x27d747){_0x27d747['OpenchannelAccountId']=_0x41b9f7[_0xa4a0('0x58')]['id'];return _0x27d747;});return db['OpenchannelApplication']['bulkCreate'](_0x376394,{'transaction':_0x187853});});})[_0xa4a0('0x34')](function(){return db[_0xa4a0('0x85')][_0xa4a0('0xa6')]({'where':{'OpenchannelAccountId':_0x41b9f7[_0xa4a0('0x58')]['id']},'order':_0xa4a0('0x8a')});});}})[_0xa4a0('0x34')](respondWithResult(_0x44635c,null))['catch'](handleError(_0x44635c,null));};exports[_0xa4a0('0xa7')]=function(_0xcef25a,_0x4668ea,_0x45e8ae){var _0x2b788c={};var _0x86b997={};var _0x34ad39;var _0x1e8715;return db['OpenchannelAccount'][_0xa4a0('0x70')]({'where':{'id':_0xcef25a['params']['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0x4668ea,null))[_0xa4a0('0x34')](function(_0x3a756d){if(_0x3a756d){_0x34ad39=_0x3a756d;_0x86b997[_0xa4a0('0x43')]=_[_0xa4a0('0x59')](db[_0xa4a0('0x85')]['rawAttributes']);_0x86b997[_0xa4a0('0x42')]=_[_0xa4a0('0x59')](_0xcef25a['query']);_0x86b997[_0xa4a0('0x4b')]=_[_0xa4a0('0x45')](_0x86b997['model'],_0x86b997['query']);_0x2b788c[_0xa4a0('0x44')]=_['intersection'](_0x86b997[_0xa4a0('0x43')],qs[_0xa4a0('0x46')](_0xcef25a[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x2b788c[_0xa4a0('0x44')]=_0x2b788c[_0xa4a0('0x44')]['length']?_0x2b788c[_0xa4a0('0x44')]:_0x86b997[_0xa4a0('0x43')];_0x2b788c[_0xa4a0('0x49')]=qs[_0xa4a0('0x4a')](_0xcef25a['query']['sort']);_0x2b788c['where']=qs[_0xa4a0('0x4b')](_[_0xa4a0('0x4c')](_0xcef25a[_0xa4a0('0x42')],_0x86b997[_0xa4a0('0x4b')]));if(_0xcef25a[_0xa4a0('0x42')][_0xa4a0('0x4d')]){_0x2b788c[_0xa4a0('0x4e')]=_[_0xa4a0('0x4f')](_0x2b788c[_0xa4a0('0x4e')],{'$or':_['map'](_0x2b788c[_0xa4a0('0x44')],function(_0x859c20){var _0x52f998={};_0x52f998[_0x859c20]={'$like':'%'+_0xcef25a['query'][_0xa4a0('0x4d')]+'%'};return _0x52f998;})});}_0x2b788c=_[_0xa4a0('0x4f')]({},_0x2b788c,_0xcef25a[_0xa4a0('0x51')]);return _0x34ad39[_0xa4a0('0xa7')](_0x2b788c);}})['then'](function(_0x20cc1c){if(_0x20cc1c){_0x1e8715=_0x20cc1c[_0xa4a0('0x47')];if(!_0xcef25a['query'][_0xa4a0('0x69')](_0xa4a0('0x48'))){_0x2b788c['limit']=qs[_0xa4a0('0x2f')](_0xcef25a[_0xa4a0('0x42')][_0xa4a0('0x2f')]);_0x2b788c[_0xa4a0('0x2d')]=qs[_0xa4a0('0x2d')](_0xcef25a[_0xa4a0('0x42')]['offset']);}return _0x34ad39[_0xa4a0('0xa7')](_0x2b788c);}})[_0xa4a0('0x34')](function(_0x4256fc){if(_0x4256fc){return _0x4256fc?{'count':_0x1e8715,'rows':_0x4256fc}:null;}})[_0xa4a0('0x34')](respondWithResult(_0x4668ea,null))[_0xa4a0('0x29')](handleError(_0x4668ea,null));};exports[_0xa4a0('0xa8')]=function(_0x25bad9,_0xe119a,_0x28cbc3){var _0x338293={'raw':![],'where':{}};var _0x44776f={};var _0xc7f45e={'count':0x0,'rows':[]};return db[_0xa4a0('0x52')][_0xa4a0('0x70')]({'where':{'id':_0x25bad9[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0xe119a,null))['then'](function(_0x4f5211){if(_0x4f5211){_0x44776f[_0xa4a0('0x43')]=_['keys'](db['OpenchannelInteraction'][_0xa4a0('0x3d')]);_0x44776f[_0xa4a0('0x42')]=_['keys'](_0x25bad9[_0xa4a0('0x42')]);_0x44776f[_0xa4a0('0x4b')]=_['intersection'](_0x44776f[_0xa4a0('0x43')],_0x44776f[_0xa4a0('0x42')]);_0x338293[_0xa4a0('0x44')]=_[_0xa4a0('0x45')](_0x44776f[_0xa4a0('0x43')],qs[_0xa4a0('0x46')](_0x25bad9[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x338293[_0xa4a0('0x44')]=_0x338293[_0xa4a0('0x44')][_0xa4a0('0x47')]?_0x338293['attributes']:_0x44776f[_0xa4a0('0x43')];if(!_0x25bad9[_0xa4a0('0x42')]['hasOwnProperty'](_0xa4a0('0x48'))){_0x338293[_0xa4a0('0x2f')]=qs[_0xa4a0('0x2f')](_0x25bad9['query']['limit']);_0x338293[_0xa4a0('0x2d')]=qs[_0xa4a0('0x2d')](_0x25bad9['query'][_0xa4a0('0x2d')]);}_0x338293[_0xa4a0('0x49')]=qs[_0xa4a0('0x4a')](_0x25bad9['query'][_0xa4a0('0x4a')]);_0x338293['where']=qs[_0xa4a0('0x4b')](_[_0xa4a0('0x4c')](_0x25bad9[_0xa4a0('0x42')],_0x44776f['filters']));_0x338293[_0xa4a0('0x4e')][_0xa4a0('0x67')]=_0x4f5211['id'];if(_0x25bad9[_0xa4a0('0x42')]['filter']){_0x338293[_0xa4a0('0x4e')]=_[_0xa4a0('0x4f')](_0x338293[_0xa4a0('0x4e')],{'$or':_[_0xa4a0('0x41')](_0x338293['attributes'],function(_0x505afb){var _0x1f26d9={};_0x1f26d9[_0x505afb]={'$like':'%'+_0x25bad9['query']['filter']+'%'};return _0x1f26d9;})});}_0x338293=_[_0xa4a0('0x4f')]({},_0x338293,_0x25bad9[_0xa4a0('0x51')]);return db[_0xa4a0('0x91')][_0xa4a0('0x30')]({'where':_0x338293['where']})['then'](function(_0x21c8c9){_0xc7f45e[_0xa4a0('0x30')]=_0x21c8c9;if(_0x25bad9[_0xa4a0('0x42')]['includeAll']){_0x338293[_0xa4a0('0x54')]=[{'model':db[_0xa4a0('0x73')],'as':_0xa4a0('0xa9'),'required':![]},{'model':db['User'],'as':_0xa4a0('0xaa'),'attributes':['name','fullname',_0xa4a0('0xab')],'required':![]},{'model':db[_0xa4a0('0xac')],'as':_0xa4a0('0xad'),'attributes':['id',_0xa4a0('0x39'),'color'],'where':_0x25bad9[_0xa4a0('0x42')][_0xa4a0('0xae')]?{'id':_0x25bad9[_0xa4a0('0x42')][_0xa4a0('0xae')]}:undefined,'required':_0x25bad9[_0xa4a0('0x42')][_0xa4a0('0xae')]?!![]:![]}];}return db[_0xa4a0('0x91')][_0xa4a0('0x55')](_0x338293);})[_0xa4a0('0x34')](function(_0x37710f){_0xc7f45e['rows']=_0x37710f;return _0xc7f45e;});}})[_0xa4a0('0x34')](respondWithFilteredResult(_0xe119a,_0x338293))['catch'](handleError(_0xe119a,null));};exports['addAgents']=function(_0x11bdd5,_0x12f68e,_0x1f4deb){return db[_0xa4a0('0x52')]['find']({'where':{'id':_0x11bdd5[_0xa4a0('0x58')]['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0x12f68e,null))[_0xa4a0('0x34')](function(_0x492dbb){if(_0x492dbb){return _0x492dbb['addAgents'](_0x11bdd5['body'][_0xa4a0('0x6c')],_[_0xa4a0('0xaf')](_0x11bdd5[_0xa4a0('0x5c')],[_0xa4a0('0x6c'),'id'])||{})[_0xa4a0('0x92')](function(_0x335702){for(var _0x427d1a=0x0;_0x427d1a<_0x11bdd5['body'][_0xa4a0('0x6c')][_0xa4a0('0x47')];_0x427d1a+=0x1){socket[_0xa4a0('0xb0')](_0xa4a0('0xb1'),{'UserId':Number(_0x11bdd5[_0xa4a0('0x5c')][_0xa4a0('0x6c')][_0x427d1a]),'OpenchannelAccountId':Number(_0x11bdd5['params']['id'])});}return _0x335702;});}})['then'](respondWithResult(_0x12f68e,null))[_0xa4a0('0x29')](handleError(_0x12f68e,null));};exports['removeAgents']=function(_0xcc719b,_0x377c50,_0x1fb6b6){return db['OpenchannelAccount'][_0xa4a0('0x5a')]({'where':{'id':_0xcc719b[_0xa4a0('0x58')]['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0x377c50,null))['then'](function(_0x6be26a){if(_0x6be26a){return _0x6be26a[_0xa4a0('0xb2')](_0xcc719b[_0xa4a0('0x42')][_0xa4a0('0x6c')])[_0xa4a0('0x34')](function(){if(_[_0xa4a0('0xb3')](_0xcc719b[_0xa4a0('0x42')]['ids'])){for(var _0x442f62=0x0;_0x442f62<_0xcc719b[_0xa4a0('0x42')][_0xa4a0('0x6c')][_0xa4a0('0x47')];_0x442f62+=0x1){socket['emit'](_0xa4a0('0xb4'),{'UserId':Number(_0xcc719b[_0xa4a0('0x42')][_0xa4a0('0x6c')][_0x442f62]),'OpenchannelAccountId':Number(_0xcc719b[_0xa4a0('0x58')]['id'])});}}else{socket[_0xa4a0('0xb0')](_0xa4a0('0xb4'),{'UserId':Number(_0xcc719b[_0xa4a0('0x42')][_0xa4a0('0x6c')]),'OpenchannelAccountId':Number(_0xcc719b[_0xa4a0('0x58')]['id'])});}});}})[_0xa4a0('0x34')](respondWithStatusCode(_0x377c50,null))[_0xa4a0('0x29')](handleError(_0x377c50,null));};exports[_0xa4a0('0xb5')]=function(_0x161023,_0xfdddeb,_0x19c685){var _0x5ea245={};var _0x3c50e2={};var _0x1fff95;var _0x2054c7;return db['OpenchannelAccount'][_0xa4a0('0x70')]({'where':{'id':_0x161023[_0xa4a0('0x58')]['id']}})[_0xa4a0('0x34')](handleEntityNotFound(_0xfdddeb,null))[_0xa4a0('0x34')](function(_0xf4c0f8){if(_0xf4c0f8){_0x1fff95=_0xf4c0f8;_0x3c50e2[_0xa4a0('0x43')]=_[_0xa4a0('0x59')](db['User']['rawAttributes']);_0x3c50e2['query']=_['keys'](_0x161023[_0xa4a0('0x42')]);_0x3c50e2[_0xa4a0('0x4b')]=_['intersection'](_0x3c50e2[_0xa4a0('0x43')],_0x3c50e2[_0xa4a0('0x42')]);_0x5ea245['attributes']=_[_0xa4a0('0x45')](_0x3c50e2[_0xa4a0('0x43')],qs[_0xa4a0('0x46')](_0x161023[_0xa4a0('0x42')][_0xa4a0('0x46')]));_0x5ea245[_0xa4a0('0x44')]=_0x5ea245[_0xa4a0('0x44')][_0xa4a0('0x47')]?_0x5ea245[_0xa4a0('0x44')]:_0x3c50e2['model'];_0x5ea245[_0xa4a0('0x49')]=qs[_0xa4a0('0x4a')](_0x161023['query']['sort']);_0x5ea245['where']=qs['filters'](_['pick'](_0x161023[_0xa4a0('0x42')],_0x3c50e2['filters']));if(_0x161023[_0xa4a0('0x42')][_0xa4a0('0x4d')]){_0x5ea245[_0xa4a0('0x4e')]=_[_0xa4a0('0x4f')](_0x5ea245[_0xa4a0('0x4e')],{'$or':_[_0xa4a0('0x41')](_0x5ea245[_0xa4a0('0x44')],function(_0x2f1bfb){var _0x46f2ea={};_0x46f2ea[_0x2f1bfb]={'$like':'%'+_0x161023[_0xa4a0('0x42')][_0xa4a0('0x4d')]+'%'};return _0x46f2ea;})});}_0x5ea245=_[_0xa4a0('0x4f')]({},_0x5ea245,_0x161023[_0xa4a0('0x51')]);return _0x1fff95[_0xa4a0('0xb5')](_0x5ea245);}})[_0xa4a0('0x34')](function(_0x1c7492){if(_0x1c7492){_0x2054c7=_0x1c7492['length'];if(!_0x161023[_0xa4a0('0x42')][_0xa4a0('0x69')](_0xa4a0('0x48'))){_0x5ea245[_0xa4a0('0x2f')]=qs['limit'](_0x161023['query'][_0xa4a0('0x2f')]);_0x5ea245['offset']=qs[_0xa4a0('0x2d')](_0x161023[_0xa4a0('0x42')]['offset']);}return _0x1fff95[_0xa4a0('0xb5')](_0x5ea245);}})[_0xa4a0('0x34')](function(_0x36e681){if(_0x36e681){return _0x36e681?{'count':_0x2054c7,'rows':_0x36e681}:null;}})[_0xa4a0('0x34')](respondWithResult(_0xfdddeb,null))['catch'](handleError(_0xfdddeb,null));};exports['send']=function(_0x3cfbc3,_0x2831dd,_0x1ad15d){var _0x30e776,_0x15b17d,_0x3bffc6;if(_[_0xa4a0('0x7b')](_0x3cfbc3[_0xa4a0('0x5c')][_0xa4a0('0x5c')])||_0x3cfbc3[_0xa4a0('0x5c')][_0xa4a0('0x5c')]===''){throw new db[(_0xa4a0('0x7f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3cfbc3['body']['to'])){}_0x30e776=_0x3cfbc3[_0xa4a0('0x5c')]['to'];return db[_0xa4a0('0x52')][_0xa4a0('0x70')]({'where':{'id':_0x3cfbc3[_0xa4a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x2831dd,null))[_0xa4a0('0x34')](function(_0x3ba643){if(_0x3ba643){return db[_0xa4a0('0x52')][_0xa4a0('0x5a')]({'where':{'id':_0x3ba643['id']},'include':[{'model':db['CmList'],'as':_0xa4a0('0x83'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x3ba643[_0xa4a0('0x7e')]]:_0x30e776},'limit':0x1,'order':[[_0xa4a0('0x77'),_0xa4a0('0xb6')]]}]}]})[_0xa4a0('0x34')](handleEntityNotFound(_0x2831dd,null))[_0xa4a0('0x34')](function(_0x89d6a0){if(_0x89d6a0&&_0x89d6a0[_0xa4a0('0x83')]){_0x15b17d=_0x89d6a0[_0xa4a0('0x36')]({'plain':!![]});if(_0x15b17d[_0xa4a0('0x83')]&&_0x15b17d[_0xa4a0('0x83')][_0xa4a0('0x84')]['length']){return _0x15b17d['List'][_0xa4a0('0x84')][0x0];}return db[_0xa4a0('0x73')][_0xa4a0('0x5b')](_[_0xa4a0('0x1b')](_0x3cfbc3['body'],{'firstName':_0x30e776,[_0x89d6a0['mapKey']]:_0x30e776,'phone':_0x30e776,'ListId':_0x15b17d[_0xa4a0('0x7a')]}));}})['then'](handleEntityNotFound(_0x2831dd,null))[_0xa4a0('0x34')](function(_0x483f19){if(_0x483f19){_0x3bffc6=_0x483f19;return db[_0xa4a0('0x91')]['find']({'where':{'ContactId':_0x3bffc6['id'],'closed':![],'OpenchannelAccountId':_0x15b17d['id']}})['then'](function(_0x5af960){if(_0x5af960){return[_0x5af960,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x3cfbc3['user']['id'],'ContactId':_0x3bffc6['id'],'OpenchannelAccountId':_0x15b17d['id'],'lastMsgDirection':'out','Messages':[_[_0xa4a0('0x4f')](_0x3cfbc3[_0xa4a0('0x5c')],{'read':![],'body':_0x3cfbc3['body'][_0xa4a0('0x5c')],'OpenchannelAccountId':_0x15b17d['id'],'UserId':_0x3cfbc3[_0xa4a0('0x5f')]['id'],'ContactId':_0x3bffc6['id']})]},{'include':[{'model':db[_0xa4a0('0xb7')],'as':_0xa4a0('0xb8')}]})['then'](function(_0x22f5c3){return[_0x22f5c3,!![]];});});}})[_0xa4a0('0x92')](function(_0x1b935d,_0x7a99b){if(_0x7a99b){return _0x1b935d;}return db['OpenchannelMessage'][_0xa4a0('0x5b')](_[_0xa4a0('0x4f')](_0x3cfbc3[_0xa4a0('0x5c')],{'read':![],'body':_0x3cfbc3[_0xa4a0('0x5c')][_0xa4a0('0x5c')],'OpenchannelAccountId':_0x15b17d['id'],'OpenchannelInteractionId':_0x1b935d['id'],'UserId':_0x3cfbc3[_0xa4a0('0x5f')]['id'],'ContactId':_0x3bffc6['id']}))[_0xa4a0('0x34')](function(_0x5c7629){_0x1b935d[_0xa4a0('0xb9')]['Messages']=[];_0x1b935d[_0xa4a0('0xb9')][_0xa4a0('0xb8')][_0xa4a0('0x98')](_0x5c7629[_0xa4a0('0xb9')]);return _0x1b935d;});});}})[_0xa4a0('0x34')](respondWithResult(_0x2831dd,null))[_0xa4a0('0x29')](handleError(_0x2831dd,null));}; \ No newline at end of file +var _0x1a3d=['addApplications','transaction','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','Owner','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','Pause','keys','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','Applications','account','applications','list','orderBy','priority','asc','Contacts','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager'];(function(_0x174e6d,_0x45f4d1){var _0x27a7eb=function(_0x283f35){while(--_0x283f35){_0x174e6d['push'](_0x174e6d['shift']());}};_0x27a7eb(++_0x45f4d1);}(_0x1a3d,0xd5));var _0xd1a3=function(_0x9082bb,_0x107aa6){_0x9082bb=_0x9082bb-0x0;var _0x209c7e=_0x1a3d[_0x9082bb];return _0x209c7e;};'use strict';var emlformat=require(_0xd1a3('0x0'));var rimraf=require(_0xd1a3('0x1'));var zipdir=require(_0xd1a3('0x2'));var jsonpatch=require(_0xd1a3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd1a3('0x4'));var Mustache=require(_0xd1a3('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd1a3('0x6'));var csv=require(_0xd1a3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1a3('0x8'));var _=require('lodash');var squel=require(_0xd1a3('0x9'));var crypto=require(_0xd1a3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd1a3('0xb'));var toCsv=require(_0xd1a3('0x7'));var querystring=require(_0xd1a3('0xc'));var Papa=require(_0xd1a3('0xd'));var Redis=require(_0xd1a3('0xe'));var authService=require(_0xd1a3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd1a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1a3('0x11'))('api');var utils=require(_0xd1a3('0x12'));var config=require(_0xd1a3('0x13'));var licenseUtil=require(_0xd1a3('0x14'));var db=require('../../mysqldb')['db'];config[_0xd1a3('0x15')]=_[_0xd1a3('0x16')](config['redis'],{'host':_0xd1a3('0x17'),'port':0x18eb});var socket=require(_0xd1a3('0x18'))(new Redis(config['redis']));require(_0xd1a3('0x19'))[_0xd1a3('0x1a')](socket);var jayson=require(_0xd1a3('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xd1a3('0x1c')][_0xd1a3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5f0a17,_0x5e8265,_0x140d09,_0x4ca062){return new BPromise(function(_0x6d8c10,_0x1dc869){var _0x4795ca=_0x4ca062||client;return _0x4795ca[_0xd1a3('0x1e')](_0x5f0a17,_0x140d09)[_0xd1a3('0x1f')](function(_0x25ea5f){logger[_0xd1a3('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e8265,_0xd1a3('0x21'));logger[_0xd1a3('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5e8265,_0xd1a3('0x21'),JSON[_0xd1a3('0x23')](_0x25ea5f));if(_0x25ea5f['error']){if(_0x25ea5f[_0xd1a3('0x24')][_0xd1a3('0x25')]===0x1f4){logger[_0xd1a3('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e8265,_0x25ea5f['error'][_0xd1a3('0x26')]);return _0x1dc869(_0x25ea5f[_0xd1a3('0x24')]['message']);}logger[_0xd1a3('0x24')](_0xd1a3('0x27'),_0x5e8265,_0x25ea5f[_0xd1a3('0x24')][_0xd1a3('0x26')]);return _0x6d8c10(_0x25ea5f['error'][_0xd1a3('0x26')]);}else{logger[_0xd1a3('0x20')](_0xd1a3('0x27'),_0x5e8265,'request\x20sent');_0x6d8c10(_0x25ea5f[_0xd1a3('0x28')]['message']);}})['catch'](function(_0x5da25c){logger[_0xd1a3('0x24')](_0xd1a3('0x27'),_0x5e8265,_0x5da25c);_0x1dc869(_0x5da25c);});});}function respondWithStatusCode(_0x3de33b,_0x529fb8){_0x529fb8=_0x529fb8||0xcc;return function(_0xeec06f){if(_0xeec06f){return _0x3de33b[_0xd1a3('0x29')](_0x529fb8);}return _0x3de33b[_0xd1a3('0x2a')](_0x529fb8)['end']();};}function respondWithResult(_0x4c6653,_0x41939d){_0x41939d=_0x41939d||0xc8;return function(_0x48efcf){if(_0x48efcf){return _0x4c6653[_0xd1a3('0x2a')](_0x41939d)[_0xd1a3('0x2b')](_0x48efcf);}};}function respondWithFilteredResult(_0x56bdf2,_0x3bc97e){return function(_0xe4cc70){if(_0xe4cc70){var _0x18eda3=typeof _0x3bc97e[_0xd1a3('0x2c')]==='undefined'&&typeof _0x3bc97e[_0xd1a3('0x2d')]===_0xd1a3('0x2e');var _0x4822de=_0xe4cc70[_0xd1a3('0x2f')];var _0x45c29c=_0x18eda3?0x0:_0x3bc97e[_0xd1a3('0x2c')];var _0x10680c=_0x18eda3?_0xe4cc70[_0xd1a3('0x2f')]:_0x3bc97e[_0xd1a3('0x2c')]+_0x3bc97e[_0xd1a3('0x2d')];var _0x2d2aca;if(_0x10680c>=_0x4822de){_0x10680c=_0x4822de;_0x2d2aca=0xc8;}else{_0x2d2aca=0xce;}_0x56bdf2[_0xd1a3('0x2a')](_0x2d2aca);return _0x56bdf2[_0xd1a3('0x30')](_0xd1a3('0x31'),_0x45c29c+'-'+_0x10680c+'/'+_0x4822de)[_0xd1a3('0x2b')](_0xe4cc70);}return null;};}function patchUpdates(_0x32f310){return function(_0x2b9e8a){try{jsonpatch[_0xd1a3('0x32')](_0x2b9e8a,_0x32f310,!![]);}catch(_0x193ef2){return BPromise[_0xd1a3('0x33')](_0x193ef2);}return _0x2b9e8a[_0xd1a3('0x34')]();};}function saveUpdates(_0x348143,_0x3d88ee){return function(_0xed2dfb){if(_0xed2dfb){return _0xed2dfb['update'](_0x348143)['then'](function(_0x4d45b9){return _0x4d45b9;});}return null;};}function removeEntity(_0x36afc3,_0x1e06b0){return function(_0x53cb9b){if(_0x53cb9b){return _0x53cb9b['destroy']()['then'](function(){var _0x368508=_0x53cb9b[_0xd1a3('0x35')]({'plain':!![]});var _0x193f19='OpenchannelAccounts';return db[_0xd1a3('0x36')][_0xd1a3('0x37')]({'where':{'type':_0x193f19,'resourceId':_0x368508['id']}})['then'](function(){return _0x53cb9b;});})[_0xd1a3('0x1f')](function(){_0x36afc3[_0xd1a3('0x2a')](0xcc)[_0xd1a3('0x38')]();});}};}function handleEntityNotFound(_0x4a59dc,_0xca4225){return function(_0x1d0a29){if(!_0x1d0a29){_0x4a59dc[_0xd1a3('0x29')](0x194);}return _0x1d0a29;};}function handleError(_0x178425,_0x4bfea6){_0x4bfea6=_0x4bfea6||0x1f4;return function(_0x3ce947){logger[_0xd1a3('0x24')](_0x3ce947[_0xd1a3('0x39')]);if(_0x3ce947[_0xd1a3('0x3a')]){delete _0x3ce947['name'];}_0x178425['status'](_0x4bfea6)[_0xd1a3('0x3b')](_0x3ce947);};}exports[_0xd1a3('0x3c')]=function(_0x470a40,_0x47309e){var _0x535b2b={'include':[{'model':db['Pause'],'as':_0xd1a3('0x3d')}]},_0x74e925={},_0x4ad831={'count':0x0,'rows':[]};var _0x2f3cec=_[_0xd1a3('0x3e')](db[_0xd1a3('0x3f')][_0xd1a3('0x40')],function(_0x48bc27){return{'name':_0x48bc27[_0xd1a3('0x41')],'type':_0x48bc27[_0xd1a3('0x42')][_0xd1a3('0x43')]};});_0x74e925[_0xd1a3('0x44')]=_[_0xd1a3('0x3e')](_0x2f3cec,_0xd1a3('0x3a'));_0x74e925[_0xd1a3('0x45')]=_['keys'](_0x470a40['query']);_0x74e925[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x74e925['model'],_0x74e925[_0xd1a3('0x45')]);_0x535b2b['attributes']=_['intersection'](_0x74e925[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x470a40[_0xd1a3('0x45')][_0xd1a3('0x48')]));_0x535b2b[_0xd1a3('0x49')]=_0x535b2b[_0xd1a3('0x49')][_0xd1a3('0x4a')]?_0x535b2b[_0xd1a3('0x49')]:_0x74e925['model'];if(!_0x470a40[_0xd1a3('0x45')][_0xd1a3('0x4b')](_0xd1a3('0x4c'))){_0x535b2b[_0xd1a3('0x2d')]=qs[_0xd1a3('0x2d')](_0x470a40[_0xd1a3('0x45')]['limit']);_0x535b2b[_0xd1a3('0x2c')]=qs[_0xd1a3('0x2c')](_0x470a40['query'][_0xd1a3('0x2c')]);}_0x535b2b[_0xd1a3('0x4d')]=qs['sort'](_0x470a40[_0xd1a3('0x45')][_0xd1a3('0x4e')]);_0x535b2b['where']=qs['filters'](_[_0xd1a3('0x4f')](_0x470a40[_0xd1a3('0x45')],_0x74e925[_0xd1a3('0x46')]),_0x2f3cec);if(_0x470a40['query'][_0xd1a3('0x50')]){_0x535b2b['where']=_['merge'](_0x535b2b[_0xd1a3('0x51')],{'$or':_[_0xd1a3('0x3e')](_0x2f3cec,function(_0x4d3d9f){if(_0x4d3d9f['type']!==_0xd1a3('0x52')){var _0x1f1cf9={};_0x1f1cf9[_0x4d3d9f['name']]={'$like':'%'+_0x470a40[_0xd1a3('0x45')][_0xd1a3('0x50')]+'%'};return _0x1f1cf9;}})});}_0x535b2b=_[_0xd1a3('0x53')]({},_0x535b2b,_0x470a40[_0xd1a3('0x54')]);var _0x14420f={'where':_0x535b2b[_0xd1a3('0x51')]};return db['OpenchannelAccount'][_0xd1a3('0x2f')](_0x14420f)[_0xd1a3('0x1f')](function(_0x13442c){_0x4ad831[_0xd1a3('0x2f')]=_0x13442c;if(_0x470a40[_0xd1a3('0x45')]['includeAll']){_0x535b2b[_0xd1a3('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xd1a3('0x56')](_0x535b2b);})[_0xd1a3('0x1f')](function(_0x6d4e32){_0x4ad831[_0xd1a3('0x57')]=_0x6d4e32;return _0x4ad831;})[_0xd1a3('0x1f')](respondWithFilteredResult(_0x47309e,_0x535b2b))['catch'](handleError(_0x47309e,null));};exports['show']=function(_0x39f27f,_0xc8d52f){var _0x3173fb={'raw':![],'where':{'id':_0x39f27f['params']['id']},'include':[{'model':db[_0xd1a3('0x58')],'as':'mandatoryDispositionPause'}]},_0x558856={};_0x558856[_0xd1a3('0x44')]=_[_0xd1a3('0x59')](db[_0xd1a3('0x3f')][_0xd1a3('0x40')]);_0x558856[_0xd1a3('0x45')]=_['keys'](_0x39f27f[_0xd1a3('0x45')]);_0x558856['filters']=_[_0xd1a3('0x47')](_0x558856['model'],_0x558856['query']);_0x3173fb['attributes']=_[_0xd1a3('0x47')](_0x558856[_0xd1a3('0x44')],qs['fields'](_0x39f27f[_0xd1a3('0x45')][_0xd1a3('0x48')]));_0x3173fb[_0xd1a3('0x49')]=_0x3173fb[_0xd1a3('0x49')]['length']?_0x3173fb[_0xd1a3('0x49')]:_0x558856[_0xd1a3('0x44')];if(_0x39f27f[_0xd1a3('0x45')][_0xd1a3('0x5a')]){_0x3173fb[_0xd1a3('0x55')]=[{'all':!![]}];}_0x3173fb=_['merge']({},_0x3173fb,_0x39f27f['options']);return db['OpenchannelAccount']['find'](_0x3173fb)[_0xd1a3('0x1f')](handleEntityNotFound(_0xc8d52f,null))[_0xd1a3('0x1f')](respondWithResult(_0xc8d52f,null))[_0xd1a3('0x5b')](handleError(_0xc8d52f,null));};exports['create']=function(_0x2f8f14,_0x2be49d){return db[_0xd1a3('0x3f')][_0xd1a3('0x5c')](_0x2f8f14[_0xd1a3('0x5d')],{})[_0xd1a3('0x1f')](function(_0x1e0fb9){var _0x42ba24=_0x2f8f14[_0xd1a3('0x5e')][_0xd1a3('0x35')]({'plain':!![]});if(!_0x42ba24)throw new Error(_0xd1a3('0x5f'));if(_0x42ba24[_0xd1a3('0x60')]==='user'){var _0x10b078=_0x1e0fb9[_0xd1a3('0x35')]({'plain':!![]});var _0x115351=_0xd1a3('0x61');return db[_0xd1a3('0x62')][_0xd1a3('0x63')]({'where':{'name':_0x115351,'userProfileId':_0x42ba24[_0xd1a3('0x64')]},'raw':!![]})[_0xd1a3('0x1f')](function(_0x5b6403){if(_0x5b6403&&_0x5b6403['autoAssociation']===0x0){return db['UserProfileResource'][_0xd1a3('0x5c')]({'name':_0x10b078[_0xd1a3('0x3a')],'resourceId':_0x10b078['id'],'type':_0x5b6403['name'],'sectionId':_0x5b6403['id']},{})[_0xd1a3('0x1f')](function(){return _0x1e0fb9;});}else{return _0x1e0fb9;}})[_0xd1a3('0x5b')](function(_0x5f14b1){logger['error'](_0xd1a3('0x65'),_0x5f14b1);throw _0x5f14b1;});}return _0x1e0fb9;})[_0xd1a3('0x1f')](respondWithResult(_0x2be49d,0xc9))['catch'](handleError(_0x2be49d,null));};exports[_0xd1a3('0x66')]=function(_0x3ce1bf,_0x30b9bc){if(_0x3ce1bf[_0xd1a3('0x5d')]['id']){delete _0x3ce1bf[_0xd1a3('0x5d')]['id'];}return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x3ce1bf[_0xd1a3('0x67')]['id']},'include':[{'model':db[_0xd1a3('0x58')],'as':_0xd1a3('0x3d')}]})[_0xd1a3('0x1f')](handleEntityNotFound(_0x30b9bc,null))[_0xd1a3('0x1f')](saveUpdates(_0x3ce1bf[_0xd1a3('0x5d')],null))[_0xd1a3('0x1f')](respondWithResult(_0x30b9bc,null))[_0xd1a3('0x5b')](handleError(_0x30b9bc,null));};exports['destroy']=function(_0x599fed,_0x280555){return db['OpenchannelAccount']['find']({'where':{'id':_0x599fed[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x280555,null))[_0xd1a3('0x1f')](removeEntity(_0x280555,null))[_0xd1a3('0x5b')](handleError(_0x280555,null));};exports[_0xd1a3('0x68')]=function(_0x318984,_0xafe6e6){return db['OpenchannelAccount'][_0xd1a3('0x68')]()[_0xd1a3('0x1f')](respondWithResult(_0xafe6e6,null))[_0xd1a3('0x5b')](handleError(_0xafe6e6,null));};exports['addDisposition']=function(_0x54c183,_0x43715e,_0x5369c8){if(_0x54c183[_0xd1a3('0x5d')]['id']){delete _0x54c183['body']['id'];}return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x54c183[_0xd1a3('0x67')]['id']}})['then'](handleEntityNotFound(_0x43715e,null))['then'](function(_0x8d3b82){if(_0x8d3b82){_0x54c183[_0xd1a3('0x5d')][_0xd1a3('0x69')]=_0x8d3b82['id'];return db['Disposition'][_0xd1a3('0x5c')](_0x54c183[_0xd1a3('0x5d')]);}})[_0xd1a3('0x1f')](respondWithResult(_0x43715e,null))['catch'](handleError(_0x43715e,null));};exports[_0xd1a3('0x6a')]=function(_0x478755,_0x3e30ed,_0x32c83b){var _0x5446d4={'raw':![],'where':{}};var _0x2c26ff={};var _0x4173c0={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd1a3('0x6b')]({'where':{'id':_0x478755[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x3e30ed,null))['then'](function(_0x54dca2){if(_0x54dca2){_0x2c26ff[_0xd1a3('0x44')]=_[_0xd1a3('0x59')](db[_0xd1a3('0x6c')][_0xd1a3('0x40')]);_0x2c26ff[_0xd1a3('0x45')]=_[_0xd1a3('0x59')](_0x478755[_0xd1a3('0x45')]);_0x2c26ff[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x2c26ff[_0xd1a3('0x44')],_0x2c26ff[_0xd1a3('0x45')]);_0x5446d4[_0xd1a3('0x49')]=_[_0xd1a3('0x47')](_0x2c26ff[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x478755[_0xd1a3('0x45')][_0xd1a3('0x48')]));_0x5446d4[_0xd1a3('0x49')]=_0x5446d4[_0xd1a3('0x49')]['length']?_0x5446d4['attributes']:_0x2c26ff[_0xd1a3('0x44')];if(!_0x478755['query']['hasOwnProperty']('nolimit')){_0x5446d4['limit']=qs['limit'](_0x478755[_0xd1a3('0x45')][_0xd1a3('0x2d')]);_0x5446d4[_0xd1a3('0x2c')]=qs[_0xd1a3('0x2c')](_0x478755[_0xd1a3('0x45')][_0xd1a3('0x2c')]);}_0x5446d4[_0xd1a3('0x4d')]=qs[_0xd1a3('0x4e')](_0x478755[_0xd1a3('0x45')][_0xd1a3('0x4e')]);_0x5446d4['where']=qs['filters'](_[_0xd1a3('0x4f')](_0x478755[_0xd1a3('0x45')],_0x2c26ff['filters']));_0x5446d4['where'][_0xd1a3('0x69')]=_0x54dca2['id'];if(_0x478755[_0xd1a3('0x45')][_0xd1a3('0x50')]){_0x5446d4[_0xd1a3('0x51')]=_[_0xd1a3('0x53')](_0x5446d4['where'],{'$or':_[_0xd1a3('0x3e')](_0x5446d4[_0xd1a3('0x49')],function(_0xe6a0da){var _0x1ac5aa={};_0x1ac5aa[_0xe6a0da]={'$like':'%'+_0x478755[_0xd1a3('0x45')][_0xd1a3('0x50')]+'%'};return _0x1ac5aa;})});}_0x5446d4=_[_0xd1a3('0x53')]({},_0x5446d4,_0x478755[_0xd1a3('0x54')]);return db[_0xd1a3('0x6c')][_0xd1a3('0x2f')]({'where':_0x5446d4[_0xd1a3('0x51')]})[_0xd1a3('0x1f')](function(_0x7b4096){_0x4173c0[_0xd1a3('0x2f')]=_0x7b4096;if(_0x478755['query'][_0xd1a3('0x5a')]){_0x5446d4[_0xd1a3('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xd1a3('0x56')](_0x5446d4);})[_0xd1a3('0x1f')](function(_0x250316){_0x4173c0[_0xd1a3('0x57')]=_0x250316;return _0x4173c0;});}})['then'](respondWithFilteredResult(_0x3e30ed,_0x5446d4))[_0xd1a3('0x5b')](handleError(_0x3e30ed,null));};exports[_0xd1a3('0x6d')]=function(_0x20989f,_0x2684e1,_0x28d27d){return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x20989f[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x2684e1,null))[_0xd1a3('0x1f')](function(_0x3a6487){if(_0x3a6487){return _0x3a6487[_0xd1a3('0x6d')](_0x20989f[_0xd1a3('0x45')][_0xd1a3('0x6e')]);}})[_0xd1a3('0x1f')](respondWithStatusCode(_0x2684e1,null))['catch'](handleError(_0x2684e1,null));};exports[_0xd1a3('0x6f')]=function(_0x1197f7,_0x565786,_0x2284c3){if(_0x1197f7[_0xd1a3('0x5d')]['id']){delete _0x1197f7['body']['id'];}return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x1197f7[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x565786,null))[_0xd1a3('0x1f')](function(_0x393fbe){if(_0x393fbe){_0x1197f7[_0xd1a3('0x5d')][_0xd1a3('0x69')]=_0x393fbe['id'];return db[_0xd1a3('0x70')][_0xd1a3('0x5c')](_0x1197f7[_0xd1a3('0x5d')]);}})[_0xd1a3('0x1f')](respondWithResult(_0x565786,null))['catch'](handleError(_0x565786,null));};exports[_0xd1a3('0x71')]=function(_0x4d3605,_0x520dfa,_0x393461){var _0x1abc79={'raw':![],'where':{}};var _0x2de0fd={};var _0x511052={'count':0x0,'rows':[]};return db[_0xd1a3('0x3f')][_0xd1a3('0x6b')]({'where':{'id':_0x4d3605['params']['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x520dfa,null))[_0xd1a3('0x1f')](function(_0x59e8ad){if(_0x59e8ad){_0x2de0fd[_0xd1a3('0x44')]=_[_0xd1a3('0x59')](db[_0xd1a3('0x70')][_0xd1a3('0x40')]);_0x2de0fd['query']=_[_0xd1a3('0x59')](_0x4d3605[_0xd1a3('0x45')]);_0x2de0fd[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x2de0fd['model'],_0x2de0fd[_0xd1a3('0x45')]);_0x1abc79[_0xd1a3('0x49')]=_[_0xd1a3('0x47')](_0x2de0fd[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x4d3605[_0xd1a3('0x45')]['fields']));_0x1abc79[_0xd1a3('0x49')]=_0x1abc79[_0xd1a3('0x49')][_0xd1a3('0x4a')]?_0x1abc79[_0xd1a3('0x49')]:_0x2de0fd[_0xd1a3('0x44')];if(!_0x4d3605[_0xd1a3('0x45')][_0xd1a3('0x4b')]('nolimit')){_0x1abc79[_0xd1a3('0x2d')]=qs[_0xd1a3('0x2d')](_0x4d3605[_0xd1a3('0x45')][_0xd1a3('0x2d')]);_0x1abc79['offset']=qs[_0xd1a3('0x2c')](_0x4d3605[_0xd1a3('0x45')][_0xd1a3('0x2c')]);}_0x1abc79[_0xd1a3('0x4d')]=qs['sort'](_0x4d3605[_0xd1a3('0x45')]['sort']);_0x1abc79[_0xd1a3('0x51')]=qs[_0xd1a3('0x46')](_[_0xd1a3('0x4f')](_0x4d3605['query'],_0x2de0fd['filters']));_0x1abc79['where'][_0xd1a3('0x69')]=_0x59e8ad['id'];if(_0x4d3605['query'][_0xd1a3('0x50')]){_0x1abc79[_0xd1a3('0x51')]=_[_0xd1a3('0x53')](_0x1abc79[_0xd1a3('0x51')],{'$or':_[_0xd1a3('0x3e')](_0x1abc79[_0xd1a3('0x49')],function(_0x315111){var _0x527e6={};_0x527e6[_0x315111]={'$like':'%'+_0x4d3605[_0xd1a3('0x45')]['filter']+'%'};return _0x527e6;})});}_0x1abc79=_[_0xd1a3('0x53')]({},_0x1abc79,_0x4d3605[_0xd1a3('0x54')]);return db[_0xd1a3('0x70')][_0xd1a3('0x2f')]({'where':_0x1abc79[_0xd1a3('0x51')]})[_0xd1a3('0x1f')](function(_0x1a9021){_0x511052['count']=_0x1a9021;if(_0x4d3605[_0xd1a3('0x45')][_0xd1a3('0x5a')]){_0x1abc79[_0xd1a3('0x55')]=[{'all':!![]}];}return db[_0xd1a3('0x70')][_0xd1a3('0x56')](_0x1abc79);})['then'](function(_0x2ba608){_0x511052[_0xd1a3('0x57')]=_0x2ba608;return _0x511052;});}})[_0xd1a3('0x1f')](respondWithFilteredResult(_0x520dfa,_0x1abc79))[_0xd1a3('0x5b')](handleError(_0x520dfa,null));};exports[_0xd1a3('0x72')]=function(_0x35142c,_0x3c2d56,_0x28f598){return db['OpenchannelAccount']['find']({'where':{'id':_0x35142c[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x3c2d56,null))[_0xd1a3('0x1f')](function(_0x3ebccf){if(_0x3ebccf){return _0x3ebccf[_0xd1a3('0x72')](_0x35142c[_0xd1a3('0x45')][_0xd1a3('0x6e')]);}})[_0xd1a3('0x1f')](respondWithStatusCode(_0x3c2d56,null))[_0xd1a3('0x5b')](handleError(_0x3c2d56,null));};exports[_0xd1a3('0x73')]=function(_0x2e7e41,_0x30e318,_0x4bff9d){var _0x4c5b8f={'body':_0x2e7e41['body'],'channel':'openchannel'};var _0x485e46=[];var _0x13e684=[];var _0x4bb824={};var _0x1e295d=![];return db[_0xd1a3('0x74')][_0xd1a3('0x68')]()[_0xd1a3('0x1f')](function(_0x5b2e96){if(!_0x5b2e96){throw new db[(_0xd1a3('0x75'))][(_0xd1a3('0x76'))](_0xd1a3('0x77'));}_0x485e46=_[_0xd1a3('0x78')](_[_0xd1a3('0x59')](_0x5b2e96),[_0xd1a3('0x79'),_0xd1a3('0x7a')]);_0x13e684=_['difference'](_[_0xd1a3('0x59')](_0x5b2e96),[_0xd1a3('0x79'),'updatedAt',_0xd1a3('0x7b'),_0xd1a3('0x7c')]);if(_0x2e7e41[_0xd1a3('0x5d')]['id']){delete _0x2e7e41[_0xd1a3('0x5d')]['id'];}if(_[_0xd1a3('0x7d')](_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x7e')])){throw new db[(_0xd1a3('0x75'))][(_0xd1a3('0x76'))]('from\x20is\x20mandatory');}if(_[_0xd1a3('0x7d')](_0x2e7e41['body'][_0xd1a3('0x5d')])||_0x2e7e41['body'][_0xd1a3('0x5d')]===''){throw new db[(_0xd1a3('0x75'))]['ValidationError'](_0xd1a3('0x7f'));}if(_['isNil'](_0x2e7e41['body'][_0xd1a3('0x80')])){throw new db[(_0xd1a3('0x75'))][(_0xd1a3('0x76'))](_0xd1a3('0x81')+_0x13e684);}if(!_['includes'](_0x13e684,_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x80')])){throw new db[(_0xd1a3('0x75'))][(_0xd1a3('0x76'))](_0xd1a3('0x82')+_0x13e684);}_0x4bb824[_0x2e7e41[_0xd1a3('0x5d')]['mapKey']]=_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x7e')];})['then'](function(){return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x2e7e41[_0xd1a3('0x67')]['id']},'include':[{'model':db['CmList'],'as':_0xd1a3('0x83'),'include':[{'model':db[_0xd1a3('0x74')],'as':'Contacts','where':_0x4bb824,'limit':0x1,'order':[[_0xd1a3('0x7a'),_0xd1a3('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd1a3('0x85')}]});})[_0xd1a3('0x1f')](handleEntityNotFound(_0x30e318,null))[_0xd1a3('0x1f')](function(_0x8ec4f0){if(_0x8ec4f0&&_0x8ec4f0[_0xd1a3('0x83')]){_0x4c5b8f[_0xd1a3('0x86')]=_0x8ec4f0;_0x4c5b8f[_0xd1a3('0x87')]=_0x8ec4f0[_0xd1a3('0x85')];_0x4c5b8f[_0xd1a3('0x88')]=_0x8ec4f0['List'];_0x4c5b8f[_0xd1a3('0x87')]=_[_0xd1a3('0x89')](_0x4c5b8f[_0xd1a3('0x87')],[_0xd1a3('0x8a')],[_0xd1a3('0x8b')]);if(_0x4c5b8f[_0xd1a3('0x86')][_0xd1a3('0x85')]){delete _0x4c5b8f[_0xd1a3('0x86')][_0xd1a3('0x85')];}if(_0x4c5b8f[_0xd1a3('0x86')]['List']&&_0x4c5b8f[_0xd1a3('0x86')][_0xd1a3('0x83')][_0xd1a3('0x8c')]['length']){return _0x4c5b8f[_0xd1a3('0x86')]['List'][_0xd1a3('0x8c')][0x0];}var _0x5b9513=_[_0xd1a3('0x16')](_0x2e7e41[_0xd1a3('0x5d')],{'firstName':_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x7e')],'ListId':_0x8ec4f0['ListId']});_0x5b9513[_0x2e7e41[_0xd1a3('0x5d')]['mapKey']]=_0x2e7e41['body'][_0xd1a3('0x7e')];return db['CmContact']['create'](_0x5b9513,{'fields':_0x485e46,'raw':!![]});}})['then'](handleEntityNotFound(_0x30e318,null))[_0xd1a3('0x1f')](function(_0x56297f){_0x4c5b8f[_0xd1a3('0x8d')]=_0x56297f;if(_0x56297f){var _0x4bb8bd={'ContactId':_0x56297f['id'],'OpenchannelAccountId':_0x2e7e41[_0xd1a3('0x67')]['id'],'from':(_0x56297f[_0xd1a3('0x8e')]||'')+'\x20'+(_0x56297f['lastName']||'')};var _0x4f13ab={'OpenchannelAccountId':_0x2e7e41[_0xd1a3('0x67')]['id'],'closed':![]};if(_0x2e7e41['body'][_0xd1a3('0x8f')]){_0x4f13ab[_0xd1a3('0x8f')]=_0x2e7e41[_0xd1a3('0x5d')]['threadId'];return db[_0xd1a3('0x90')][_0xd1a3('0x63')]({'where':_0x4f13ab})[_0xd1a3('0x1f')](function(_0x2422f8){if(_0x2422f8){return[_0x2422f8,![]];}_0x4bb8bd[_0xd1a3('0x8f')]=_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x8f')];_0x4bb8bd[_0xd1a3('0x91')]=_0x2e7e41[_0xd1a3('0x5d')]['externalUrl'];return db[_0xd1a3('0x90')][_0xd1a3('0x5c')](_0x4bb8bd)['then'](function(_0x292bc3){return[_0x292bc3,!![]];});});}else{_0x4f13ab[_0xd1a3('0x8f')]=null;}_0x4f13ab[_0xd1a3('0x92')]=_0x56297f['id'];return db[_0xd1a3('0x90')][_0xd1a3('0x63')]({'where':_0x4f13ab})['then'](function(_0x514433){if(_0x514433){return[_0x514433,![]];}return db[_0xd1a3('0x90')][_0xd1a3('0x5c')](_0x4bb8bd)[_0xd1a3('0x1f')](function(_0x1c5108){return[_0x1c5108,!![]];});});}})[_0xd1a3('0x93')](function(_0x2a7a2f,_0x4fcbe8){if(_0x2a7a2f){_0x1e295d=_0x4fcbe8;if(!_0x4fcbe8){var _0x277a1e={'from':(_0x4c5b8f[_0xd1a3('0x8d')]['firstName']||'')+'\x20'+(_0x4c5b8f[_0xd1a3('0x8d')][_0xd1a3('0x94')]||'')};if(_0x2e7e41[_0xd1a3('0x5d')]['threadId']&&_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x95')]&&_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x8f')]!=_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x95')]){_0x277a1e[_0xd1a3('0x8f')]=_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x95')];}return _0x2a7a2f['update'](_0x277a1e);}else{return _0x2a7a2f;}}})[_0xd1a3('0x1f')](function(_0x5ec341){_0x4c5b8f[_0xd1a3('0x96')]=_0x5ec341['get']({'plain':!![]});_0x4c5b8f[_0xd1a3('0x96')]['created']=_0x1e295d;if(_0x4c5b8f[_0xd1a3('0x96')][_0xd1a3('0x97')]){if(_0x4c5b8f[_0xd1a3('0x86')][_0xd1a3('0x98')]){_0x4c5b8f[_0xd1a3('0x87')]['push']({'id':0x0,'priority':_0x4c5b8f[_0xd1a3('0x87')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xd1a3('0x99')][_0xd1a3('0x5c')]({'body':_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x5d')],'OpenchannelAccountId':_0x2e7e41[_0xd1a3('0x67')]['id'],'OpenchannelInteractionId':_0x5ec341['id'],'direction':'in','ContactId':_0x4c5b8f[_0xd1a3('0x8d')]['id'],'AttachmentId':_0x2e7e41[_0xd1a3('0x5d')][_0xd1a3('0x9a')]});})[_0xd1a3('0x1f')](function(_0x203cae){_0x4c5b8f[_0xd1a3('0x26')]=_0x203cae;if(_0x4c5b8f[_0xd1a3('0x96')][_0xd1a3('0x9b')]){return db[_0xd1a3('0x9c')]['find']({'attributes':['id',_0xd1a3('0x3a')],'where':{'id':_0x4c5b8f[_0xd1a3('0x96')][_0xd1a3('0x9b')]}})[_0xd1a3('0x1f')](function(_0x4cb668){if(_0x4cb668){_0x4c5b8f[_0xd1a3('0x87')][_0xd1a3('0x9d')]({'id':0x0,'priority':0x0,'app':_0xd1a3('0x9e'),'appdata':_0x4cb668['name']+','+(_0x4c5b8f[_0xd1a3('0x86')][_0xd1a3('0x9f')]||0xa),'interval':_0xd1a3('0xa0')});_0x4c5b8f[_0xd1a3('0xa1')]=![];}return respondWithRpcPromise(_0xd1a3('0xa2'),'startRouting',_0x4c5b8f);});}return respondWithRpcPromise(_0xd1a3('0xa2'),_0xd1a3('0xa3'),_0x4c5b8f);})['then'](function(_0x82cf13){respondWithRpcPromise(_0xd1a3('0xa4'),'EventManager',{'event':_0xd1a3('0x73'),'message':_0x82cf13},client9002);return _0x82cf13;})[_0xd1a3('0x1f')](respondWithResult(_0x30e318,null))[_0xd1a3('0x5b')](handleError(_0x30e318,null));};exports[_0xd1a3('0xa5')]=function(_0x4d9e1e,_0x2afaef,_0x5a6124){return db[_0xd1a3('0x3f')][_0xd1a3('0x6b')]({'where':{'id':_0x4d9e1e[_0xd1a3('0x67')]['id']}})['then'](handleEntityNotFound(_0x2afaef,null))[_0xd1a3('0x1f')](function(_0x1b3da1){if(_0x1b3da1){return db['sequelize'][_0xd1a3('0xa6')](function(_0x35c4a3){return db[_0xd1a3('0xa7')][_0xd1a3('0x37')]({'where':{'OpenchannelAccountId':_0x4d9e1e[_0xd1a3('0x67')]['id']},'transaction':_0x35c4a3})[_0xd1a3('0x1f')](function(_0x5a934e){var _0x5d1ed4=_[_0xd1a3('0x3e')](_0x4d9e1e['body'],function(_0x38b6eb){_0x38b6eb['OpenchannelAccountId']=_0x4d9e1e[_0xd1a3('0x67')]['id'];return _0x38b6eb;});return db[_0xd1a3('0xa7')]['bulkCreate'](_0x5d1ed4,{'transaction':_0x35c4a3});});})[_0xd1a3('0x1f')](function(){return db['OpenchannelApplication'][_0xd1a3('0xa8')]({'where':{'OpenchannelAccountId':_0x4d9e1e[_0xd1a3('0x67')]['id']},'order':_0xd1a3('0x8a')});});}})[_0xd1a3('0x1f')](respondWithResult(_0x2afaef,null))['catch'](handleError(_0x2afaef,null));};exports['getApplications']=function(_0x13a1b9,_0x537eeb,_0x5f469c){var _0x500459={};var _0x22f715={};var _0x306547;var _0x1cae21;return db['OpenchannelAccount'][_0xd1a3('0x6b')]({'where':{'id':_0x13a1b9['params']['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x537eeb,null))[_0xd1a3('0x1f')](function(_0x1c5060){if(_0x1c5060){_0x306547=_0x1c5060;_0x22f715[_0xd1a3('0x44')]=_['keys'](db[_0xd1a3('0xa7')][_0xd1a3('0x40')]);_0x22f715[_0xd1a3('0x45')]=_[_0xd1a3('0x59')](_0x13a1b9['query']);_0x22f715[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x22f715['model'],_0x22f715['query']);_0x500459[_0xd1a3('0x49')]=_[_0xd1a3('0x47')](_0x22f715[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x13a1b9['query'][_0xd1a3('0x48')]));_0x500459[_0xd1a3('0x49')]=_0x500459['attributes'][_0xd1a3('0x4a')]?_0x500459[_0xd1a3('0x49')]:_0x22f715[_0xd1a3('0x44')];_0x500459[_0xd1a3('0x4d')]=qs[_0xd1a3('0x4e')](_0x13a1b9[_0xd1a3('0x45')][_0xd1a3('0x4e')]);_0x500459[_0xd1a3('0x51')]=qs[_0xd1a3('0x46')](_['pick'](_0x13a1b9[_0xd1a3('0x45')],_0x22f715[_0xd1a3('0x46')]));if(_0x13a1b9['query'][_0xd1a3('0x50')]){_0x500459[_0xd1a3('0x51')]=_[_0xd1a3('0x53')](_0x500459[_0xd1a3('0x51')],{'$or':_['map'](_0x500459['attributes'],function(_0x2ff9e3){var _0x433bbc={};_0x433bbc[_0x2ff9e3]={'$like':'%'+_0x13a1b9['query'][_0xd1a3('0x50')]+'%'};return _0x433bbc;})});}_0x500459=_[_0xd1a3('0x53')]({},_0x500459,_0x13a1b9[_0xd1a3('0x54')]);return _0x306547['getApplications'](_0x500459);}})['then'](function(_0x4de160){if(_0x4de160){_0x1cae21=_0x4de160[_0xd1a3('0x4a')];if(!_0x13a1b9[_0xd1a3('0x45')][_0xd1a3('0x4b')](_0xd1a3('0x4c'))){_0x500459['limit']=qs[_0xd1a3('0x2d')](_0x13a1b9['query'][_0xd1a3('0x2d')]);_0x500459['offset']=qs['offset'](_0x13a1b9[_0xd1a3('0x45')][_0xd1a3('0x2c')]);}return _0x306547[_0xd1a3('0xa9')](_0x500459);}})[_0xd1a3('0x1f')](function(_0x1d0ce8){if(_0x1d0ce8){return _0x1d0ce8?{'count':_0x1cae21,'rows':_0x1d0ce8}:null;}})[_0xd1a3('0x1f')](respondWithResult(_0x537eeb,null))[_0xd1a3('0x5b')](handleError(_0x537eeb,null));};exports[_0xd1a3('0xaa')]=function(_0x5c90f3,_0x722692,_0x21ce5a){var _0x1d5e42={'raw':![],'where':{}};var _0x4da199={};var _0x23b1b1={'count':0x0,'rows':[]};return db[_0xd1a3('0x3f')][_0xd1a3('0x6b')]({'where':{'id':_0x5c90f3[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x722692,null))['then'](function(_0x3c6f55){if(_0x3c6f55){_0x4da199[_0xd1a3('0x44')]=_['keys'](db[_0xd1a3('0x90')][_0xd1a3('0x40')]);_0x4da199[_0xd1a3('0x45')]=_[_0xd1a3('0x59')](_0x5c90f3['query']);_0x4da199[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x4da199[_0xd1a3('0x44')],_0x4da199['query']);_0x1d5e42[_0xd1a3('0x49')]=_[_0xd1a3('0x47')](_0x4da199[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x48')]));_0x1d5e42[_0xd1a3('0x49')]=_0x1d5e42[_0xd1a3('0x49')][_0xd1a3('0x4a')]?_0x1d5e42['attributes']:_0x4da199[_0xd1a3('0x44')];if(!_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x4b')]('nolimit')){_0x1d5e42['limit']=qs[_0xd1a3('0x2d')](_0x5c90f3[_0xd1a3('0x45')]['limit']);_0x1d5e42[_0xd1a3('0x2c')]=qs['offset'](_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x2c')]);}_0x1d5e42[_0xd1a3('0x4d')]=qs[_0xd1a3('0x4e')](_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x4e')]);_0x1d5e42['where']=qs[_0xd1a3('0x46')](_[_0xd1a3('0x4f')](_0x5c90f3[_0xd1a3('0x45')],_0x4da199[_0xd1a3('0x46')]));_0x1d5e42[_0xd1a3('0x51')]['OpenchannelAccountId']=_0x3c6f55['id'];if(_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x50')]){_0x1d5e42[_0xd1a3('0x51')]=_[_0xd1a3('0x53')](_0x1d5e42[_0xd1a3('0x51')],{'$or':_[_0xd1a3('0x3e')](_0x1d5e42[_0xd1a3('0x49')],function(_0x2a643b){var _0x574076={};_0x574076[_0x2a643b]={'$like':'%'+_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0x50')]+'%'};return _0x574076;})});}_0x1d5e42=_[_0xd1a3('0x53')]({},_0x1d5e42,_0x5c90f3[_0xd1a3('0x54')]);return db[_0xd1a3('0x90')][_0xd1a3('0x2f')]({'where':_0x1d5e42[_0xd1a3('0x51')]})[_0xd1a3('0x1f')](function(_0x1ed2bd){_0x23b1b1[_0xd1a3('0x2f')]=_0x1ed2bd;if(_0x5c90f3[_0xd1a3('0x45')]['includeAll']){_0x1d5e42[_0xd1a3('0x55')]=[{'model':db['CmContact'],'as':_0xd1a3('0xab'),'required':![]},{'model':db['User'],'as':_0xd1a3('0xac'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xd1a3('0xad')],'as':'Tags','attributes':['id',_0xd1a3('0x3a'),_0xd1a3('0xae')],'where':_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0xaf')]?{'id':_0x5c90f3[_0xd1a3('0x45')][_0xd1a3('0xaf')]}:undefined,'required':_0x5c90f3[_0xd1a3('0x45')]['tag']?!![]:![]}];}return db[_0xd1a3('0x90')][_0xd1a3('0x56')](_0x1d5e42);})[_0xd1a3('0x1f')](function(_0x400863){_0x23b1b1[_0xd1a3('0x57')]=_0x400863;return _0x23b1b1;});}})[_0xd1a3('0x1f')](respondWithFilteredResult(_0x722692,_0x1d5e42))['catch'](handleError(_0x722692,null));};exports[_0xd1a3('0xb0')]=function(_0x5b722e,_0x43f110,_0x1b79f1){return db['OpenchannelAccount'][_0xd1a3('0x63')]({'where':{'id':_0x5b722e[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x43f110,null))[_0xd1a3('0x1f')](function(_0x15a205){if(_0x15a205){return _0x15a205[_0xd1a3('0xb0')](_0x5b722e[_0xd1a3('0x5d')][_0xd1a3('0x6e')],_[_0xd1a3('0xb1')](_0x5b722e[_0xd1a3('0x5d')],[_0xd1a3('0x6e'),'id'])||{})[_0xd1a3('0x93')](function(_0x2f0f94){for(var _0xd75594=0x0;_0xd75594<_0x5b722e[_0xd1a3('0x5d')][_0xd1a3('0x6e')][_0xd1a3('0x4a')];_0xd75594+=0x1){socket[_0xd1a3('0xb2')](_0xd1a3('0xb3'),{'UserId':Number(_0x5b722e[_0xd1a3('0x5d')]['ids'][_0xd75594]),'OpenchannelAccountId':Number(_0x5b722e[_0xd1a3('0x67')]['id'])});}return _0x2f0f94;});}})[_0xd1a3('0x1f')](respondWithResult(_0x43f110,null))['catch'](handleError(_0x43f110,null));};exports[_0xd1a3('0xb4')]=function(_0x4e220e,_0x2d37fa,_0x3c2c3e){return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x4e220e[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0x2d37fa,null))[_0xd1a3('0x1f')](function(_0x1d10f5){if(_0x1d10f5){return _0x1d10f5['removeAgents'](_0x4e220e['query'][_0xd1a3('0x6e')])[_0xd1a3('0x1f')](function(){if(_[_0xd1a3('0xb5')](_0x4e220e[_0xd1a3('0x45')][_0xd1a3('0x6e')])){for(var _0x2707b5=0x0;_0x2707b5<_0x4e220e[_0xd1a3('0x45')]['ids'][_0xd1a3('0x4a')];_0x2707b5+=0x1){socket['emit'](_0xd1a3('0xb6'),{'UserId':Number(_0x4e220e[_0xd1a3('0x45')][_0xd1a3('0x6e')][_0x2707b5]),'OpenchannelAccountId':Number(_0x4e220e[_0xd1a3('0x67')]['id'])});}}else{socket[_0xd1a3('0xb2')](_0xd1a3('0xb6'),{'UserId':Number(_0x4e220e[_0xd1a3('0x45')]['ids']),'OpenchannelAccountId':Number(_0x4e220e['params']['id'])});}});}})[_0xd1a3('0x1f')](respondWithStatusCode(_0x2d37fa,null))[_0xd1a3('0x5b')](handleError(_0x2d37fa,null));};exports[_0xd1a3('0xb7')]=function(_0x419a34,_0x54e769,_0x55a0bf){var _0x1f68c0={};var _0x4fb4b8={};var _0x2b1465;var _0x7387cc;return db[_0xd1a3('0x3f')][_0xd1a3('0x6b')]({'where':{'id':_0x419a34[_0xd1a3('0x67')]['id']}})['then'](handleEntityNotFound(_0x54e769,null))[_0xd1a3('0x1f')](function(_0x36e2de){if(_0x36e2de){_0x2b1465=_0x36e2de;_0x4fb4b8[_0xd1a3('0x44')]=_[_0xd1a3('0x59')](db[_0xd1a3('0x9c')][_0xd1a3('0x40')]);_0x4fb4b8[_0xd1a3('0x45')]=_[_0xd1a3('0x59')](_0x419a34[_0xd1a3('0x45')]);_0x4fb4b8[_0xd1a3('0x46')]=_[_0xd1a3('0x47')](_0x4fb4b8['model'],_0x4fb4b8['query']);_0x1f68c0[_0xd1a3('0x49')]=_[_0xd1a3('0x47')](_0x4fb4b8[_0xd1a3('0x44')],qs[_0xd1a3('0x48')](_0x419a34[_0xd1a3('0x45')][_0xd1a3('0x48')]));_0x1f68c0['attributes']=_0x1f68c0[_0xd1a3('0x49')][_0xd1a3('0x4a')]?_0x1f68c0[_0xd1a3('0x49')]:_0x4fb4b8['model'];_0x1f68c0['order']=qs[_0xd1a3('0x4e')](_0x419a34[_0xd1a3('0x45')]['sort']);_0x1f68c0[_0xd1a3('0x51')]=qs[_0xd1a3('0x46')](_['pick'](_0x419a34[_0xd1a3('0x45')],_0x4fb4b8[_0xd1a3('0x46')]));if(_0x419a34[_0xd1a3('0x45')][_0xd1a3('0x50')]){_0x1f68c0[_0xd1a3('0x51')]=_[_0xd1a3('0x53')](_0x1f68c0[_0xd1a3('0x51')],{'$or':_[_0xd1a3('0x3e')](_0x1f68c0[_0xd1a3('0x49')],function(_0x57363d){var _0x10bf86={};_0x10bf86[_0x57363d]={'$like':'%'+_0x419a34[_0xd1a3('0x45')][_0xd1a3('0x50')]+'%'};return _0x10bf86;})});}_0x1f68c0=_[_0xd1a3('0x53')]({},_0x1f68c0,_0x419a34[_0xd1a3('0x54')]);return _0x2b1465[_0xd1a3('0xb7')](_0x1f68c0);}})[_0xd1a3('0x1f')](function(_0x3eb695){if(_0x3eb695){_0x7387cc=_0x3eb695[_0xd1a3('0x4a')];if(!_0x419a34['query'][_0xd1a3('0x4b')](_0xd1a3('0x4c'))){_0x1f68c0[_0xd1a3('0x2d')]=qs['limit'](_0x419a34[_0xd1a3('0x45')][_0xd1a3('0x2d')]);_0x1f68c0['offset']=qs[_0xd1a3('0x2c')](_0x419a34[_0xd1a3('0x45')][_0xd1a3('0x2c')]);}return _0x2b1465['getAgents'](_0x1f68c0);}})[_0xd1a3('0x1f')](function(_0x542549){if(_0x542549){return _0x542549?{'count':_0x7387cc,'rows':_0x542549}:null;}})[_0xd1a3('0x1f')](respondWithResult(_0x54e769,null))[_0xd1a3('0x5b')](handleError(_0x54e769,null));};exports[_0xd1a3('0x3b')]=function(_0x289c2c,_0xec11fc,_0x30452a){var _0x5abe7c,_0x21ed1a,_0x53acf4;if(_[_0xd1a3('0x7d')](_0x289c2c[_0xd1a3('0x5d')][_0xd1a3('0x5d')])||_0x289c2c[_0xd1a3('0x5d')][_0xd1a3('0x5d')]===''){throw new db[(_0xd1a3('0x75'))][(_0xd1a3('0x76'))](_0xd1a3('0x7f'));}if(_[_0xd1a3('0x7d')](_0x289c2c[_0xd1a3('0x5d')]['to'])){}_0x5abe7c=_0x289c2c[_0xd1a3('0x5d')]['to'];return db[_0xd1a3('0x3f')][_0xd1a3('0x6b')]({'where':{'id':_0x289c2c[_0xd1a3('0x67')]['id']}})[_0xd1a3('0x1f')](handleEntityNotFound(_0xec11fc,null))[_0xd1a3('0x1f')](function(_0x1cb8f2){if(_0x1cb8f2){return db[_0xd1a3('0x3f')][_0xd1a3('0x63')]({'where':{'id':_0x1cb8f2['id']},'include':[{'model':db[_0xd1a3('0xb8')],'as':_0xd1a3('0x83'),'include':[{'model':db[_0xd1a3('0x74')],'as':_0xd1a3('0x8c'),'where':{[_0x1cb8f2[_0xd1a3('0x80')]]:_0x5abe7c},'limit':0x1,'order':[['updatedAt',_0xd1a3('0x84')]]}]}]})[_0xd1a3('0x1f')](handleEntityNotFound(_0xec11fc,null))[_0xd1a3('0x1f')](function(_0x4532f7){if(_0x4532f7&&_0x4532f7[_0xd1a3('0x83')]){_0x21ed1a=_0x4532f7[_0xd1a3('0x35')]({'plain':!![]});if(_0x21ed1a['List']&&_0x21ed1a[_0xd1a3('0x83')][_0xd1a3('0x8c')][_0xd1a3('0x4a')]){return _0x21ed1a[_0xd1a3('0x83')][_0xd1a3('0x8c')][0x0];}return db[_0xd1a3('0x74')][_0xd1a3('0x5c')](_[_0xd1a3('0x16')](_0x289c2c['body'],{'firstName':_0x5abe7c,[_0x4532f7[_0xd1a3('0x80')]]:_0x5abe7c,'phone':_0x5abe7c,'ListId':_0x21ed1a[_0xd1a3('0x7c')]}));}})[_0xd1a3('0x1f')](handleEntityNotFound(_0xec11fc,null))[_0xd1a3('0x1f')](function(_0x41de02){if(_0x41de02){_0x53acf4=_0x41de02;return db[_0xd1a3('0x90')][_0xd1a3('0x63')]({'where':{'ContactId':_0x53acf4['id'],'closed':![],'OpenchannelAccountId':_0x21ed1a['id']}})[_0xd1a3('0x1f')](function(_0x5df43e){if(_0x5df43e){return[_0x5df43e,![]];}return db[_0xd1a3('0x90')][_0xd1a3('0x5c')]({'UserId':_0x289c2c[_0xd1a3('0x5e')]['id'],'ContactId':_0x53acf4['id'],'OpenchannelAccountId':_0x21ed1a['id'],'lastMsgDirection':_0xd1a3('0xb9'),'Messages':[_['merge'](_0x289c2c[_0xd1a3('0x5d')],{'read':![],'body':_0x289c2c[_0xd1a3('0x5d')][_0xd1a3('0x5d')],'OpenchannelAccountId':_0x21ed1a['id'],'UserId':_0x289c2c['user']['id'],'ContactId':_0x53acf4['id']})]},{'include':[{'model':db[_0xd1a3('0x99')],'as':_0xd1a3('0xba')}]})['then'](function(_0xb5681d){return[_0xb5681d,!![]];});});}})['spread'](function(_0x370d60,_0x51b08d){if(_0x51b08d){return _0x370d60;}return db['OpenchannelMessage'][_0xd1a3('0x5c')](_['merge'](_0x289c2c[_0xd1a3('0x5d')],{'read':![],'body':_0x289c2c[_0xd1a3('0x5d')][_0xd1a3('0x5d')],'OpenchannelAccountId':_0x21ed1a['id'],'OpenchannelInteractionId':_0x370d60['id'],'UserId':_0x289c2c['user']['id'],'ContactId':_0x53acf4['id']}))[_0xd1a3('0x1f')](function(_0x4be68f){_0x370d60[_0xd1a3('0xbb')]['Messages']=[];_0x370d60['dataValues'][_0xd1a3('0xba')][_0xd1a3('0xbc')](_0x4be68f['dataValues']);return _0x370d60;});});}})[_0xd1a3('0x1f')](respondWithResult(_0xec11fc,null))[_0xd1a3('0x5b')](handleError(_0xec11fc,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 08c9c57..9099854 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 _0x70e0=['emit','events','../../mysqldb','OpenchannelAccount','update','remove'];(function(_0x5e3c77,_0x127e2f){var _0x31f93b=function(_0x3fec1a){while(--_0x3fec1a){_0x5e3c77['push'](_0x5e3c77['shift']());}};_0x31f93b(++_0x127e2f);}(_0x70e0,0x17b));var _0x070e=function(_0x1b93bc,_0x8d8654){_0x1b93bc=_0x1b93bc-0x0;var _0x3196a3=_0x70e0[_0x1b93bc];return _0x3196a3;};'use strict';var EventEmitter=require(_0x070e('0x0'));var OpenchannelAccount=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){OpenchannelAccountEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);OpenchannelAccountEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x564aa9,_0x53f13d){var _0x15b1fc=function(_0x1561a0){while(--_0x1561a0){_0x564aa9['push'](_0x564aa9['shift']());}};_0x15b1fc(++_0x53f13d);}(_0x41bb,0xc5));var _0xb41b=function(_0x2e1cae,_0x434ef4){_0x2e1cae=_0x2e1cae-0x0;var _0x50fa37=_0x41bb[_0x2e1cae];return _0x50fa37;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ac6059d..5a539cd 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(_0x1846c8,_0x299efb){var _0x577700=function(_0x2c0dbc){while(--_0x2c0dbc){_0x1846c8['push'](_0x1846c8['shift']());}};_0x577700(++_0x299efb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x24e741,_0x25d254){var _0x324ca5=function(_0x47037e){while(--_0x47037e){_0x24e741['push'](_0x24e741['shift']());}};_0x324ca5(++_0x25d254);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 57e1c1b..f396ff0 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 _0xe130=['then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe130,0x127));var _0x0e13=function(_0x2e3cc3,_0x2ca61b){_0x2e3cc3=_0x2e3cc3-0x0;var _0x345132=_0xe130[_0x2e3cc3];return _0x345132;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});config[_0x0e13('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e13('0xc'))(new Redis(config[_0x0e13('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2906e9,_0x124e0d,_0x3aad73){return new BPromise(function(_0x2e385d,_0x53f9a9){return client['request'](_0x2906e9,_0x3aad73)[_0x0e13('0xd')](function(_0x37a04e){logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');logger[_0x0e13('0x10')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x124e0d,_0x0e13('0x11'),JSON[_0x0e13('0x12')](_0x37a04e));if(_0x37a04e[_0x0e13('0x13')]){if(_0x37a04e[_0x0e13('0x13')][_0x0e13('0x14')]===0x1f4){logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x53f9a9(_0x37a04e['error'][_0x0e13('0x15')]);}logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x2e385d(_0x37a04e[_0x0e13('0x13')]['message']);}else{logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');_0x2e385d(_0x37a04e['result'][_0x0e13('0x15')]);}})['catch'](function(_0x2063ca){logger['error'](_0x0e13('0xf'),_0x124e0d,_0x2063ca);_0x53f9a9(_0x2063ca);});});} \ No newline at end of file +var _0x9c2c=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x4a22dd,_0x5a8af8){var _0x38186a=function(_0x2e59d5){while(--_0x2e59d5){_0x4a22dd['push'](_0x4a22dd['shift']());}};_0x38186a(++_0x5a8af8);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9c2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9c2('0x3'));var logger=require(_0xc9c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9c2('0x5'));var client=jayson['client'][_0xc9c2('0x6')]({'port':0x232a});config[_0xc9c2('0x7')]=_[_0xc9c2('0x8')](config[_0xc9c2('0x7')],{'host':_0xc9c2('0x9'),'port':0x18eb});var socket=require(_0xc9c2('0xa'))(new Redis(config[_0xc9c2('0x7')]));require(_0xc9c2('0xb'))[_0xc9c2('0xc')](socket);function respondWithRpcPromise(_0x53e18d,_0x342609,_0x530f6a){return new BPromise(function(_0x46e650,_0x3e5847){return client[_0xc9c2('0xd')](_0x53e18d,_0x530f6a)[_0xc9c2('0xe')](function(_0x5894a4){logger['info'](_0xc9c2('0xf'),_0x342609,_0xc9c2('0x10'));logger['debug'](_0xc9c2('0x11'),_0x342609,_0xc9c2('0x10'),JSON[_0xc9c2('0x12')](_0x5894a4));if(_0x5894a4[_0xc9c2('0x13')]){if(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x14')]===0x1f4){logger[_0xc9c2('0x13')](_0xc9c2('0xf'),_0x342609,_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);return _0x3e5847(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);}logger['error'](_0xc9c2('0xf'),_0x342609,_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);return _0x46e650(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);}else{logger['info'](_0xc9c2('0xf'),_0x342609,_0xc9c2('0x10'));_0x46e650(_0x5894a4[_0xc9c2('0x16')]['message']);}})[_0xc9c2('0x17')](function(_0x7de09c){logger[_0xc9c2('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x342609,_0x7de09c);_0x3e5847(_0x7de09c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9ad5cda..eed8843 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 _0xfa2f=['remove','removeListener','register','openchannelAccount:'];(function(_0x3536dd,_0x14e817){var _0x2203f2=function(_0x4a33c0){while(--_0x4a33c0){_0x3536dd['push'](_0x3536dd['shift']());}};_0x2203f2(++_0x14e817);}(_0xfa2f,0xe8));var _0xffa2=function(_0x294caa,_0x4cc848){_0x294caa=_0x294caa-0x0;var _0x351e22=_0xfa2f[_0x294caa];return _0x351e22;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xffa2('0x0'),'update'];function createListener(_0x2411c2,_0x34de1d){return function(_0x4d6507){_0x34de1d['emit'](_0x2411c2,_0x4d6507);};}function removeListener(_0x3fcced,_0x12b74e){return function(){OpenchannelAccountEvents[_0xffa2('0x1')](_0x3fcced,_0x12b74e);};}exports[_0xffa2('0x2')]=function(_0x25fd81){for(var _0x2c7708=0x0,_0x215134=events['length'];_0x2c7708<_0x215134;_0x2c7708++){var _0x4c6406=events[_0x2c7708];var _0x34cf1b=createListener(_0xffa2('0x3')+_0x4c6406,_0x25fd81);OpenchannelAccountEvents['on'](_0x4c6406,_0x34cf1b);}}; \ No newline at end of file +var _0x6ae0=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register'];(function(_0x12aaf4,_0x2b1af5){var _0x1989ed=function(_0x29fd0d){while(--_0x29fd0d){_0x12aaf4['push'](_0x12aaf4['shift']());}};_0x1989ed(++_0x2b1af5);}(_0x6ae0,0x192));var _0x06ae=function(_0x3ceedd,_0x1b6ea4){_0x3ceedd=_0x3ceedd-0x0;var _0x490073=_0x6ae0[_0x3ceedd];return _0x490073;};'use strict';var OpenchannelAccountEvents=require(_0x06ae('0x0'));var events=[_0x06ae('0x1'),_0x06ae('0x2'),_0x06ae('0x3')];function createListener(_0x54e586,_0x52f385){return function(_0x319535){_0x52f385['emit'](_0x54e586,_0x319535);};}function removeListener(_0x104bb4,_0x5ec2f9){return function(){OpenchannelAccountEvents[_0x06ae('0x4')](_0x104bb4,_0x5ec2f9);};}exports[_0x06ae('0x5')]=function(_0x517dea){for(var _0x17b806=0x0,_0x51bac4=events[_0x06ae('0x6')];_0x17b806<_0x51bac4;_0x17b806++){var _0x2bc2ad=events[_0x17b806];var _0x591c0f=createListener(_0x06ae('0x7')+_0x2bc2ad,_0x517dea);OpenchannelAccountEvents['on'](_0x2bc2ad,_0x591c0f);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index dddce60..88444bb 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 _0x1f61=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','get','show','post','isAuthenticated','put','/:id','update','destroy','util','connect-timeout','express'];(function(_0x5606d3,_0x2fdaf1){var _0x1860f9=function(_0x9f7121){while(--_0x9f7121){_0x5606d3['push'](_0x5606d3['shift']());}};_0x1860f9(++_0x2fdaf1);}(_0x1f61,0xeb));var _0x11f6=function(_0x5f49a2,_0x54b7ed){_0x5f49a2=_0x5f49a2-0x0;var _0x2e49ac=_0x1f61[_0x5f49a2];return _0x2e49ac;};'use strict';var multer=require('multer');var util=require(_0x11f6('0x0'));var path=require('path');var timeout=require(_0x11f6('0x1'));var express=require(_0x11f6('0x2'));var router=express[_0x11f6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x11f6('0x4'));var interaction=require(_0x11f6('0x5'));var config=require(_0x11f6('0x6'));var controller=require(_0x11f6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x11f6('0x8')]);router[_0x11f6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x11f6('0xa')]);router[_0x11f6('0xb')]('/',auth[_0x11f6('0xc')](),controller['create']);router[_0x11f6('0xd')](_0x11f6('0xe'),auth[_0x11f6('0xc')](),controller[_0x11f6('0xf')]);router['delete'](_0x11f6('0xe'),auth['isAuthenticated'](),controller[_0x11f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf0ad=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3e5fb6,_0x44187d){var _0x14862d=function(_0x1703af){while(--_0x1703af){_0x3e5fb6['push'](_0x3e5fb6['shift']());}};_0x14862d(++_0x44187d);}(_0xf0ad,0x103));var _0xdf0a=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0xf0ad[_0x5235a6];return _0x1cf37e;};'use strict';var multer=require(_0xdf0a('0x0'));var util=require(_0xdf0a('0x1'));var path=require(_0xdf0a('0x2'));var timeout=require(_0xdf0a('0x3'));var express=require(_0xdf0a('0x4'));var router=express[_0xdf0a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdf0a('0x6'));var config=require(_0xdf0a('0x7'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0xdf0a('0x8')](),controller[_0xdf0a('0x9')]);router[_0xdf0a('0xa')](_0xdf0a('0xb'),auth[_0xdf0a('0x8')](),controller[_0xdf0a('0xc')]);router[_0xdf0a('0xd')]('/',auth[_0xdf0a('0x8')](),controller[_0xdf0a('0xe')]);router[_0xdf0a('0xf')](_0xdf0a('0xb'),auth[_0xdf0a('0x8')](),controller[_0xdf0a('0x10')]);router[_0xdf0a('0x11')](_0xdf0a('0xb'),auth['isAuthenticated'](),controller[_0xdf0a('0x12')]);module[_0xdf0a('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 0b8b4ee..912d5a5 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 _0x0179=['*,*,*,*','exports','STRING','TEXT'];(function(_0x23a174,_0x555b0a){var _0x557037=function(_0x5e115e){while(--_0x5e115e){_0x23a174['push'](_0x23a174['shift']());}};_0x557037(++_0x555b0a);}(_0x0179,0x1a9));var _0x9017=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x0179[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0x9017('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9017('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9017('0x2')]()},'description':{'type':Sequelize[_0x9017('0x1')]},'interval':{'type':Sequelize[_0x9017('0x1')],'defaultValue':_0x9017('0x3')}}; \ No newline at end of file +var _0xf523=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xf523,0x1e5));var _0x3f52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf523[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f52('0x0'));module[_0x3f52('0x1')]={'priority':{'type':Sequelize[_0x3f52('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3f52('0x3')],'allowNull':![],'defaultValue':_0x3f52('0x4')},'appdata':{'type':Sequelize[_0x3f52('0x5')]()},'description':{'type':Sequelize[_0x3f52('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3f52('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index d8fbc78..8863fdc 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 _0x9d46=['update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','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','Content-Range','apply','reject'];(function(_0x1b76b7,_0x5ca31c){var _0x31bd53=function(_0x5b871c){while(--_0x5b871c){_0x1b76b7['push'](_0x1b76b7['shift']());}};_0x31bd53(++_0x5ca31c);}(_0x9d46,0x107));var _0x69d4=function(_0x54df5a,_0x2125e0){_0x54df5a=_0x54df5a-0x0;var _0x16aced=_0x9d46[_0x54df5a];return _0x16aced;};'use strict';var emlformat=require(_0x69d4('0x0'));var rimraf=require(_0x69d4('0x1'));var zipdir=require(_0x69d4('0x2'));var jsonpatch=require(_0x69d4('0x3'));var rp=require(_0x69d4('0x4'));var moment=require('moment');var BPromise=require(_0x69d4('0x5'));var Mustache=require('mustache');var util=require(_0x69d4('0x6'));var path=require(_0x69d4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x69d4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69d4('0x9'));var squel=require(_0x69d4('0xa'));var crypto=require(_0x69d4('0xb'));var jsforce=require(_0x69d4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x69d4('0xd'));var Papa=require('papaparse');var Redis=require(_0x69d4('0xe'));var authService=require(_0x69d4('0xf'));var qs=require(_0x69d4('0x10'));var as=require(_0x69d4('0x11'));var hardwareService=require(_0x69d4('0x12'));var logger=require(_0x69d4('0x13'))(_0x69d4('0x14'));var utils=require('../../config/utils');var config=require(_0x69d4('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x94b688,_0x5e1c98){_0x5e1c98=_0x5e1c98||0xcc;return function(_0x4e83a3){if(_0x4e83a3){return _0x94b688[_0x69d4('0x16')](_0x5e1c98);}return _0x94b688[_0x69d4('0x17')](_0x5e1c98)[_0x69d4('0x18')]();};}function respondWithResult(_0x3fd10e,_0x1c4339){_0x1c4339=_0x1c4339||0xc8;return function(_0x2a0064){if(_0x2a0064){return _0x3fd10e[_0x69d4('0x17')](_0x1c4339)[_0x69d4('0x19')](_0x2a0064);}};}function respondWithFilteredResult(_0x4fc8f9,_0x2e27cf){return function(_0x6c8d72){if(_0x6c8d72){var _0x49e820=typeof _0x2e27cf[_0x69d4('0x1a')]===_0x69d4('0x1b')&&typeof _0x2e27cf[_0x69d4('0x1c')]===_0x69d4('0x1b');var _0x2390d4=_0x6c8d72[_0x69d4('0x1d')];var _0x4a84a4=_0x49e820?0x0:_0x2e27cf[_0x69d4('0x1a')];var _0x5c5f8b=_0x49e820?_0x6c8d72[_0x69d4('0x1d')]:_0x2e27cf['offset']+_0x2e27cf['limit'];var _0x1f3f9e;if(_0x5c5f8b>=_0x2390d4){_0x5c5f8b=_0x2390d4;_0x1f3f9e=0xc8;}else{_0x1f3f9e=0xce;}_0x4fc8f9['status'](_0x1f3f9e);return _0x4fc8f9['set'](_0x69d4('0x1e'),_0x4a84a4+'-'+_0x5c5f8b+'/'+_0x2390d4)[_0x69d4('0x19')](_0x6c8d72);}return null;};}function patchUpdates(_0x30ac24){return function(_0x12a348){try{jsonpatch[_0x69d4('0x1f')](_0x12a348,_0x30ac24,!![]);}catch(_0x106f68){return BPromise[_0x69d4('0x20')](_0x106f68);}return _0x12a348['save']();};}function saveUpdates(_0x132fcf,_0x1bf190){return function(_0x4d65f4){if(_0x4d65f4){return _0x4d65f4[_0x69d4('0x21')](_0x132fcf)[_0x69d4('0x22')](function(_0x5d95b7){return _0x5d95b7;});}return null;};}function removeEntity(_0x2277cc,_0x59a1bb){return function(_0x431adc){if(_0x431adc){return _0x431adc[_0x69d4('0x23')]()[_0x69d4('0x22')](function(){_0x2277cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x474454,_0x4fa750){return function(_0x5aa673){if(!_0x5aa673){_0x474454[_0x69d4('0x16')](0x194);}return _0x5aa673;};}function handleError(_0x1aa75d,_0x58a255){_0x58a255=_0x58a255||0x1f4;return function(_0x244f56){logger[_0x69d4('0x24')](_0x244f56[_0x69d4('0x25')]);if(_0x244f56[_0x69d4('0x26')]){delete _0x244f56['name'];}_0x1aa75d[_0x69d4('0x17')](_0x58a255)[_0x69d4('0x27')](_0x244f56);};}exports[_0x69d4('0x28')]=function(_0x5cddf5,_0x21e53e){var _0x590a0d={},_0x29525a={},_0x46eae0={'count':0x0,'rows':[]};var _0x1bc718=_[_0x69d4('0x29')](db[_0x69d4('0x2a')][_0x69d4('0x2b')],function(_0x3fb1ff){return{'name':_0x3fb1ff[_0x69d4('0x2c')],'type':_0x3fb1ff[_0x69d4('0x2d')][_0x69d4('0x2e')]};});_0x29525a[_0x69d4('0x2f')]=_[_0x69d4('0x29')](_0x1bc718,'name');_0x29525a[_0x69d4('0x30')]=_[_0x69d4('0x31')](_0x5cddf5[_0x69d4('0x30')]);_0x29525a[_0x69d4('0x32')]=_['intersection'](_0x29525a['model'],_0x29525a[_0x69d4('0x30')]);_0x590a0d[_0x69d4('0x33')]=_[_0x69d4('0x34')](_0x29525a[_0x69d4('0x2f')],qs[_0x69d4('0x35')](_0x5cddf5[_0x69d4('0x30')][_0x69d4('0x35')]));_0x590a0d[_0x69d4('0x33')]=_0x590a0d[_0x69d4('0x33')][_0x69d4('0x36')]?_0x590a0d[_0x69d4('0x33')]:_0x29525a[_0x69d4('0x2f')];if(!_0x5cddf5['query']['hasOwnProperty'](_0x69d4('0x37'))){_0x590a0d['limit']=qs['limit'](_0x5cddf5[_0x69d4('0x30')]['limit']);_0x590a0d[_0x69d4('0x1a')]=qs[_0x69d4('0x1a')](_0x5cddf5[_0x69d4('0x30')]['offset']);}_0x590a0d[_0x69d4('0x38')]=qs[_0x69d4('0x39')](_0x5cddf5[_0x69d4('0x30')]['sort']);_0x590a0d[_0x69d4('0x3a')]=qs[_0x69d4('0x32')](_[_0x69d4('0x3b')](_0x5cddf5[_0x69d4('0x30')],_0x29525a['filters']),_0x1bc718);if(_0x5cddf5[_0x69d4('0x30')][_0x69d4('0x3c')]){_0x590a0d[_0x69d4('0x3a')]=_[_0x69d4('0x3d')](_0x590a0d[_0x69d4('0x3a')],{'$or':_[_0x69d4('0x29')](_0x1bc718,function(_0xe89dae){if(_0xe89dae[_0x69d4('0x2d')]!==_0x69d4('0x3e')){var _0x129209={};_0x129209[_0xe89dae[_0x69d4('0x26')]]={'$like':'%'+_0x5cddf5[_0x69d4('0x30')]['filter']+'%'};return _0x129209;}})});}_0x590a0d=_['merge']({},_0x590a0d,_0x5cddf5[_0x69d4('0x3f')]);var _0x49b195={'where':_0x590a0d[_0x69d4('0x3a')]};return db[_0x69d4('0x2a')][_0x69d4('0x1d')](_0x49b195)[_0x69d4('0x22')](function(_0x481e36){_0x46eae0[_0x69d4('0x1d')]=_0x481e36;if(_0x5cddf5[_0x69d4('0x30')]['includeAll']){_0x590a0d[_0x69d4('0x40')]=[{'all':!![]}];}return db[_0x69d4('0x2a')][_0x69d4('0x41')](_0x590a0d);})[_0x69d4('0x22')](function(_0x2a4dbb){_0x46eae0[_0x69d4('0x42')]=_0x2a4dbb;return _0x46eae0;})[_0x69d4('0x22')](respondWithFilteredResult(_0x21e53e,_0x590a0d))['catch'](handleError(_0x21e53e,null));};exports[_0x69d4('0x43')]=function(_0x39ae3a,_0x5aef7f){var _0x48642a={'raw':!![],'where':{'id':_0x39ae3a[_0x69d4('0x44')]['id']}},_0x121847={};_0x121847[_0x69d4('0x2f')]=_[_0x69d4('0x31')](db[_0x69d4('0x2a')][_0x69d4('0x2b')]);_0x121847[_0x69d4('0x30')]=_[_0x69d4('0x31')](_0x39ae3a[_0x69d4('0x30')]);_0x121847['filters']=_[_0x69d4('0x34')](_0x121847[_0x69d4('0x2f')],_0x121847['query']);_0x48642a[_0x69d4('0x33')]=_[_0x69d4('0x34')](_0x121847[_0x69d4('0x2f')],qs[_0x69d4('0x35')](_0x39ae3a[_0x69d4('0x30')][_0x69d4('0x35')]));_0x48642a[_0x69d4('0x33')]=_0x48642a[_0x69d4('0x33')][_0x69d4('0x36')]?_0x48642a[_0x69d4('0x33')]:_0x121847[_0x69d4('0x2f')];if(_0x39ae3a[_0x69d4('0x30')][_0x69d4('0x45')]){_0x48642a[_0x69d4('0x40')]=[{'all':!![]}];}_0x48642a=_[_0x69d4('0x3d')]({},_0x48642a,_0x39ae3a[_0x69d4('0x3f')]);return db[_0x69d4('0x2a')][_0x69d4('0x46')](_0x48642a)[_0x69d4('0x22')](handleEntityNotFound(_0x5aef7f,null))[_0x69d4('0x22')](respondWithResult(_0x5aef7f,null))[_0x69d4('0x47')](handleError(_0x5aef7f,null));};exports[_0x69d4('0x48')]=function(_0x4ce6bb,_0x4f4413){return db[_0x69d4('0x2a')][_0x69d4('0x48')](_0x4ce6bb[_0x69d4('0x49')],{})[_0x69d4('0x22')](respondWithResult(_0x4f4413,0xc9))[_0x69d4('0x47')](handleError(_0x4f4413,null));};exports[_0x69d4('0x21')]=function(_0x17271e,_0x665fbf){if(_0x17271e['body']['id']){delete _0x17271e[_0x69d4('0x49')]['id'];}return db['OpenchannelApplication'][_0x69d4('0x46')]({'where':{'id':_0x17271e['params']['id']}})['then'](handleEntityNotFound(_0x665fbf,null))[_0x69d4('0x22')](saveUpdates(_0x17271e[_0x69d4('0x49')],null))['then'](respondWithResult(_0x665fbf,null))[_0x69d4('0x47')](handleError(_0x665fbf,null));};exports[_0x69d4('0x23')]=function(_0x4d4393,_0x138ebe){return db[_0x69d4('0x2a')]['find']({'where':{'id':_0x4d4393[_0x69d4('0x44')]['id']}})[_0x69d4('0x22')](handleEntityNotFound(_0x138ebe,null))[_0x69d4('0x22')](removeEntity(_0x138ebe,null))[_0x69d4('0x47')](handleError(_0x138ebe,null));}; \ No newline at end of file +var _0xd5d8=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','reject','save','update','then','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','find','catch'];(function(_0x2b8c23,_0xc9e5c6){var _0x2f810c=function(_0x44a1e9){while(--_0x44a1e9){_0x2b8c23['push'](_0x2b8c23['shift']());}};_0x2f810c(++_0xc9e5c6);}(_0xd5d8,0x127));var _0x8d5d=function(_0x230179,_0x3c2a1e){_0x230179=_0x230179-0x0;var _0x389c93=_0xd5d8[_0x230179];return _0x389c93;};'use strict';var emlformat=require(_0x8d5d('0x0'));var rimraf=require(_0x8d5d('0x1'));var zipdir=require(_0x8d5d('0x2'));var jsonpatch=require(_0x8d5d('0x3'));var rp=require('request-promise');var moment=require(_0x8d5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d5d('0x5'));var util=require(_0x8d5d('0x6'));var path=require(_0x8d5d('0x7'));var sox=require(_0x8d5d('0x8'));var csv=require(_0x8d5d('0x9'));var ejs=require(_0x8d5d('0xa'));var fs=require('fs');var fs_extra=require(_0x8d5d('0xb'));var _=require('lodash');var squel=require(_0x8d5d('0xc'));var crypto=require(_0x8d5d('0xd'));var jsforce=require(_0x8d5d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8d5d('0x9'));var querystring=require('querystring');var Papa=require(_0x8d5d('0xf'));var Redis=require(_0x8d5d('0x10'));var authService=require(_0x8d5d('0x11'));var qs=require(_0x8d5d('0x12'));var as=require(_0x8d5d('0x13'));var hardwareService=require(_0x8d5d('0x14'));var logger=require(_0x8d5d('0x15'))(_0x8d5d('0x16'));var utils=require(_0x8d5d('0x17'));var config=require(_0x8d5d('0x18'));var licenseUtil=require(_0x8d5d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48dc6e,_0xda3ebc){_0xda3ebc=_0xda3ebc||0xcc;return function(_0x27a157){if(_0x27a157){return _0x48dc6e[_0x8d5d('0x1a')](_0xda3ebc);}return _0x48dc6e[_0x8d5d('0x1b')](_0xda3ebc)[_0x8d5d('0x1c')]();};}function respondWithResult(_0x29d7cd,_0x12f350){_0x12f350=_0x12f350||0xc8;return function(_0x3a89e5){if(_0x3a89e5){return _0x29d7cd[_0x8d5d('0x1b')](_0x12f350)[_0x8d5d('0x1d')](_0x3a89e5);}};}function respondWithFilteredResult(_0x152daa,_0x1bcdac){return function(_0x5e2efe){if(_0x5e2efe){var _0x1538c7=typeof _0x1bcdac['offset']===_0x8d5d('0x1e')&&typeof _0x1bcdac[_0x8d5d('0x1f')]===_0x8d5d('0x1e');var _0x4dbfbe=_0x5e2efe['count'];var _0xbb61ed=_0x1538c7?0x0:_0x1bcdac['offset'];var _0x1eed36=_0x1538c7?_0x5e2efe[_0x8d5d('0x20')]:_0x1bcdac['offset']+_0x1bcdac[_0x8d5d('0x1f')];var _0x1c1cf3;if(_0x1eed36>=_0x4dbfbe){_0x1eed36=_0x4dbfbe;_0x1c1cf3=0xc8;}else{_0x1c1cf3=0xce;}_0x152daa[_0x8d5d('0x1b')](_0x1c1cf3);return _0x152daa['set']('Content-Range',_0xbb61ed+'-'+_0x1eed36+'/'+_0x4dbfbe)[_0x8d5d('0x1d')](_0x5e2efe);}return null;};}function patchUpdates(_0xf9b413){return function(_0x3200f1){try{jsonpatch['apply'](_0x3200f1,_0xf9b413,!![]);}catch(_0x2b5d67){return BPromise[_0x8d5d('0x21')](_0x2b5d67);}return _0x3200f1[_0x8d5d('0x22')]();};}function saveUpdates(_0x35e241,_0x34f43d){return function(_0x406e59){if(_0x406e59){return _0x406e59[_0x8d5d('0x23')](_0x35e241)[_0x8d5d('0x24')](function(_0xd033e1){return _0xd033e1;});}return null;};}function removeEntity(_0x35509b,_0x530d0d){return function(_0x5c393d){if(_0x5c393d){return _0x5c393d['destroy']()[_0x8d5d('0x24')](function(){_0x35509b[_0x8d5d('0x1b')](0xcc)[_0x8d5d('0x1c')]();});}};}function handleEntityNotFound(_0x153368,_0x3f7ab1){return function(_0x42b2e6){if(!_0x42b2e6){_0x153368[_0x8d5d('0x1a')](0x194);}return _0x42b2e6;};}function handleError(_0x3b159b,_0x59f6a1){_0x59f6a1=_0x59f6a1||0x1f4;return function(_0x1e5af4){logger[_0x8d5d('0x25')](_0x1e5af4['stack']);if(_0x1e5af4[_0x8d5d('0x26')]){delete _0x1e5af4[_0x8d5d('0x26')];}_0x3b159b[_0x8d5d('0x1b')](_0x59f6a1)[_0x8d5d('0x27')](_0x1e5af4);};}exports[_0x8d5d('0x28')]=function(_0x29c54d,_0x381a96){var _0x17c195={},_0x55d35a={},_0x37793f={'count':0x0,'rows':[]};var _0x5e5803=_[_0x8d5d('0x29')](db[_0x8d5d('0x2a')][_0x8d5d('0x2b')],function(_0x5630f1){return{'name':_0x5630f1[_0x8d5d('0x2c')],'type':_0x5630f1['type']['key']};});_0x55d35a[_0x8d5d('0x2d')]=_['map'](_0x5e5803,'name');_0x55d35a[_0x8d5d('0x2e')]=_[_0x8d5d('0x2f')](_0x29c54d[_0x8d5d('0x2e')]);_0x55d35a[_0x8d5d('0x30')]=_[_0x8d5d('0x31')](_0x55d35a['model'],_0x55d35a['query']);_0x17c195[_0x8d5d('0x32')]=_[_0x8d5d('0x31')](_0x55d35a[_0x8d5d('0x2d')],qs[_0x8d5d('0x33')](_0x29c54d[_0x8d5d('0x2e')][_0x8d5d('0x33')]));_0x17c195[_0x8d5d('0x32')]=_0x17c195[_0x8d5d('0x32')][_0x8d5d('0x34')]?_0x17c195[_0x8d5d('0x32')]:_0x55d35a[_0x8d5d('0x2d')];if(!_0x29c54d[_0x8d5d('0x2e')][_0x8d5d('0x35')](_0x8d5d('0x36'))){_0x17c195[_0x8d5d('0x1f')]=qs[_0x8d5d('0x1f')](_0x29c54d[_0x8d5d('0x2e')][_0x8d5d('0x1f')]);_0x17c195[_0x8d5d('0x37')]=qs['offset'](_0x29c54d['query'][_0x8d5d('0x37')]);}_0x17c195['order']=qs[_0x8d5d('0x38')](_0x29c54d[_0x8d5d('0x2e')][_0x8d5d('0x38')]);_0x17c195[_0x8d5d('0x39')]=qs[_0x8d5d('0x30')](_[_0x8d5d('0x3a')](_0x29c54d[_0x8d5d('0x2e')],_0x55d35a[_0x8d5d('0x30')]),_0x5e5803);if(_0x29c54d['query'][_0x8d5d('0x3b')]){_0x17c195[_0x8d5d('0x39')]=_[_0x8d5d('0x3c')](_0x17c195[_0x8d5d('0x39')],{'$or':_[_0x8d5d('0x29')](_0x5e5803,function(_0x377545){if(_0x377545[_0x8d5d('0x3d')]!==_0x8d5d('0x3e')){var _0xbb0089={};_0xbb0089[_0x377545[_0x8d5d('0x26')]]={'$like':'%'+_0x29c54d[_0x8d5d('0x2e')][_0x8d5d('0x3b')]+'%'};return _0xbb0089;}})});}_0x17c195=_[_0x8d5d('0x3c')]({},_0x17c195,_0x29c54d[_0x8d5d('0x3f')]);var _0x2ea3df={'where':_0x17c195['where']};return db[_0x8d5d('0x2a')][_0x8d5d('0x20')](_0x2ea3df)[_0x8d5d('0x24')](function(_0x2956dc){_0x37793f[_0x8d5d('0x20')]=_0x2956dc;if(_0x29c54d[_0x8d5d('0x2e')]['includeAll']){_0x17c195[_0x8d5d('0x40')]=[{'all':!![]}];}return db[_0x8d5d('0x2a')][_0x8d5d('0x41')](_0x17c195);})[_0x8d5d('0x24')](function(_0x187356){_0x37793f['rows']=_0x187356;return _0x37793f;})[_0x8d5d('0x24')](respondWithFilteredResult(_0x381a96,_0x17c195))['catch'](handleError(_0x381a96,null));};exports[_0x8d5d('0x42')]=function(_0xe208de,_0x3404bd){var _0x426168={'raw':!![],'where':{'id':_0xe208de[_0x8d5d('0x43')]['id']}},_0x3d77a6={};_0x3d77a6[_0x8d5d('0x2d')]=_[_0x8d5d('0x2f')](db[_0x8d5d('0x2a')][_0x8d5d('0x2b')]);_0x3d77a6['query']=_[_0x8d5d('0x2f')](_0xe208de[_0x8d5d('0x2e')]);_0x3d77a6['filters']=_[_0x8d5d('0x31')](_0x3d77a6[_0x8d5d('0x2d')],_0x3d77a6[_0x8d5d('0x2e')]);_0x426168['attributes']=_[_0x8d5d('0x31')](_0x3d77a6[_0x8d5d('0x2d')],qs[_0x8d5d('0x33')](_0xe208de[_0x8d5d('0x2e')][_0x8d5d('0x33')]));_0x426168[_0x8d5d('0x32')]=_0x426168[_0x8d5d('0x32')][_0x8d5d('0x34')]?_0x426168[_0x8d5d('0x32')]:_0x3d77a6['model'];if(_0xe208de[_0x8d5d('0x2e')]['includeAll']){_0x426168[_0x8d5d('0x40')]=[{'all':!![]}];}_0x426168=_[_0x8d5d('0x3c')]({},_0x426168,_0xe208de[_0x8d5d('0x3f')]);return db[_0x8d5d('0x2a')][_0x8d5d('0x44')](_0x426168)[_0x8d5d('0x24')](handleEntityNotFound(_0x3404bd,null))[_0x8d5d('0x24')](respondWithResult(_0x3404bd,null))[_0x8d5d('0x45')](handleError(_0x3404bd,null));};exports[_0x8d5d('0x46')]=function(_0x13a89a,_0x208ce1){return db[_0x8d5d('0x2a')]['create'](_0x13a89a[_0x8d5d('0x47')],{})[_0x8d5d('0x24')](respondWithResult(_0x208ce1,0xc9))[_0x8d5d('0x45')](handleError(_0x208ce1,null));};exports[_0x8d5d('0x23')]=function(_0x1e1263,_0x79074f){if(_0x1e1263[_0x8d5d('0x47')]['id']){delete _0x1e1263[_0x8d5d('0x47')]['id'];}return db[_0x8d5d('0x2a')][_0x8d5d('0x44')]({'where':{'id':_0x1e1263['params']['id']}})[_0x8d5d('0x24')](handleEntityNotFound(_0x79074f,null))['then'](saveUpdates(_0x1e1263[_0x8d5d('0x47')],null))[_0x8d5d('0x24')](respondWithResult(_0x79074f,null))[_0x8d5d('0x45')](handleError(_0x79074f,null));};exports[_0x8d5d('0x48')]=function(_0xdb688a,_0x48bb8b){return db[_0x8d5d('0x2a')][_0x8d5d('0x44')]({'where':{'id':_0xdb688a[_0x8d5d('0x43')]['id']}})['then'](handleEntityNotFound(_0x48bb8b,null))[_0x8d5d('0x24')](removeEntity(_0x48bb8b,null))[_0x8d5d('0x45')](handleError(_0x48bb8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 42e6763..c209bab 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 _0xb07e=['moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xb07e,0x12a));var _0xeb07=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xb07e[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require(_0xeb07('0x0'));var logger=require(_0xeb07('0x1'))('api');var moment=require(_0xeb07('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb07('0x3'));var fs=require('fs');var path=require(_0xeb07('0x4'));var rimraf=require(_0xeb07('0x5'));var config=require(_0xeb07('0x6'));var attributes=require(_0xeb07('0x7'));module['exports']=function(_0x1528e8,_0x227709){return _0x1528e8['define'](_0xeb07('0x8'),attributes,{'tableName':_0xeb07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb07('0xa'),'collate':_0xeb07('0xb')});}; \ No newline at end of file +var _0x1e6b=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x1e6b,0xe5));var _0xb1e6=function(_0xb051b7,_0x323f58){_0xb051b7=_0xb051b7-0x0;var _0x25cf82=_0x1e6b[_0xb051b7];return _0x25cf82;};'use strict';var _=require(_0xb1e6('0x0'));var util=require(_0xb1e6('0x1'));var logger=require(_0xb1e6('0x2'))(_0xb1e6('0x3'));var moment=require(_0xb1e6('0x4'));var BPromise=require(_0xb1e6('0x5'));var rp=require(_0xb1e6('0x6'));var fs=require('fs');var path=require(_0xb1e6('0x7'));var rimraf=require('rimraf');var config=require(_0xb1e6('0x8'));var attributes=require(_0xb1e6('0x9'));module[_0xb1e6('0xa')]=function(_0x567deb,_0x2cdb25){return _0x567deb[_0xb1e6('0xb')](_0xb1e6('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb1e6('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5907ff8..5fcaec4 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 _0x5b3b=['moment','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','options','raw','where','attributes','limit','then','lodash','util'];(function(_0x4d2219,_0x4a64d2){var _0x1a403f=function(_0x53d14d){while(--_0x53d14d){_0x4d2219['push'](_0x4d2219['shift']());}};_0x1a403f(++_0x4a64d2);}(_0x5b3b,0x193));var _0xb5b3=function(_0x3331c9,_0x143198){_0x3331c9=_0x3331c9-0x0;var _0x4affad=_0x5b3b[_0x3331c9];return _0x4affad;};'use strict';var _=require(_0xb5b3('0x0'));var util=require(_0xb5b3('0x1'));var moment=require(_0xb5b3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5b3('0x4'))('rpc');var config=require(_0xb5b3('0x5'));var jayson=require(_0xb5b3('0x6'));var client=jayson['client'][_0xb5b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a910d,_0x15df19,_0x2152f7){return new BPromise(function(_0x38ccb3,_0x9f6824){return client[_0xb5b3('0x8')](_0x2a910d,_0x2152f7)['then'](function(_0x3d0161){logger[_0xb5b3('0x9')](_0xb5b3('0xa'),_0x15df19,_0xb5b3('0xb'));logger[_0xb5b3('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x15df19,_0xb5b3('0xb'),JSON[_0xb5b3('0xd')](_0x3d0161));if(_0x3d0161[_0xb5b3('0xe')]){if(_0x3d0161[_0xb5b3('0xe')][_0xb5b3('0xf')]===0x1f4){logger['error'](_0xb5b3('0xa'),_0x15df19,_0x3d0161[_0xb5b3('0xe')]['message']);return _0x9f6824(_0x3d0161[_0xb5b3('0xe')][_0xb5b3('0x10')]);}logger[_0xb5b3('0xe')](_0xb5b3('0xa'),_0x15df19,_0x3d0161[_0xb5b3('0xe')][_0xb5b3('0x10')]);return _0x38ccb3(_0x3d0161[_0xb5b3('0xe')][_0xb5b3('0x10')]);}else{logger['info'](_0xb5b3('0xa'),_0x15df19,'request\x20sent');_0x38ccb3(_0x3d0161[_0xb5b3('0x11')]['message']);}})[_0xb5b3('0x12')](function(_0x5183ed){logger[_0xb5b3('0xe')](_0xb5b3('0xa'),_0x15df19,_0x5183ed);_0x9f6824(_0x5183ed);});});}exports[_0xb5b3('0x13')]=function(_0x4524b3){var _0x2d5246=this;return new Promise(function(_0x4c75d5,_0x380c61){return db['OpenchannelApplication'][_0xb5b3('0x14')](_0x4524b3['body'],{'raw':_0x4524b3[_0xb5b3('0x15')]?_0x4524b3[_0xb5b3('0x15')][_0xb5b3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4524b3[_0xb5b3('0x15')]?_0x4524b3[_0xb5b3('0x15')][_0xb5b3('0x17')]||null:null,'attributes':_0x4524b3[_0xb5b3('0x15')]?_0x4524b3[_0xb5b3('0x15')][_0xb5b3('0x18')]||null:null,'limit':_0x4524b3[_0xb5b3('0x15')]?_0x4524b3[_0xb5b3('0x15')][_0xb5b3('0x19')]||null:null})[_0xb5b3('0x1a')](function(_0x5e17c9){logger[_0xb5b3('0x9')](_0xb5b3('0x13'),_0x4524b3);logger[_0xb5b3('0xc')](_0xb5b3('0x13'),_0x4524b3,JSON[_0xb5b3('0xd')](_0x5e17c9));_0x4c75d5(_0x5e17c9);})[_0xb5b3('0x12')](function(_0x18516f){logger[_0xb5b3('0xe')](_0xb5b3('0x13'),_0x18516f[_0xb5b3('0x10')],_0x4524b3);_0x380c61(_0x2d5246[_0xb5b3('0xe')](0x1f4,_0x18516f['message']));});});}; \ No newline at end of file +var _0xff1f=['update','options','raw','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x42545e,_0x430f43){var _0x48c2e9=function(_0xa49621){while(--_0xa49621){_0x42545e['push'](_0x42545e['shift']());}};_0x48c2e9(++_0x430f43);}(_0xff1f,0xdd));var _0xfff1=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xff1f[_0x172747];return _0x509692;};'use strict';var _=require(_0xfff1('0x0'));var util=require('util');var moment=require(_0xfff1('0x1'));var BPromise=require(_0xfff1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfff1('0x3'));var db=require(_0xfff1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfff1('0x5'))('rpc');var config=require(_0xfff1('0x6'));var jayson=require(_0xfff1('0x7'));var client=jayson['client'][_0xfff1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53337c,_0x3e79d7,_0x8cdc15){return new BPromise(function(_0x2b6b73,_0xeeca0b){return client[_0xfff1('0x9')](_0x53337c,_0x8cdc15)[_0xfff1('0xa')](function(_0x119f37){logger[_0xfff1('0xb')](_0xfff1('0xc'),_0x3e79d7,'request\x20sent');logger[_0xfff1('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3e79d7,_0xfff1('0xe'),JSON[_0xfff1('0xf')](_0x119f37));if(_0x119f37[_0xfff1('0x10')]){if(_0x119f37[_0xfff1('0x10')]['code']===0x1f4){logger[_0xfff1('0x10')](_0xfff1('0xc'),_0x3e79d7,_0x119f37['error'][_0xfff1('0x11')]);return _0xeeca0b(_0x119f37['error'][_0xfff1('0x11')]);}logger[_0xfff1('0x10')](_0xfff1('0xc'),_0x3e79d7,_0x119f37['error'][_0xfff1('0x11')]);return _0x2b6b73(_0x119f37[_0xfff1('0x10')][_0xfff1('0x11')]);}else{logger[_0xfff1('0xb')](_0xfff1('0xc'),_0x3e79d7,_0xfff1('0xe'));_0x2b6b73(_0x119f37[_0xfff1('0x12')][_0xfff1('0x11')]);}})[_0xfff1('0x13')](function(_0x5bca5b){logger[_0xfff1('0x10')](_0xfff1('0xc'),_0x3e79d7,_0x5bca5b);_0xeeca0b(_0x5bca5b);});});}exports[_0xfff1('0x14')]=function(_0x106e20){var _0x17aef9=this;return new Promise(function(_0x4d6aa7,_0x364e39){return db[_0xfff1('0x15')][_0xfff1('0x16')](_0x106e20['body'],{'raw':_0x106e20[_0xfff1('0x17')]?_0x106e20['options'][_0xfff1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106e20[_0xfff1('0x17')]?_0x106e20[_0xfff1('0x17')]['where']||null:null,'attributes':_0x106e20[_0xfff1('0x17')]?_0x106e20[_0xfff1('0x17')][_0xfff1('0x19')]||null:null,'limit':_0x106e20['options']?_0x106e20['options'][_0xfff1('0x1a')]||null:null})[_0xfff1('0xa')](function(_0x5a6f0e){logger[_0xfff1('0xb')](_0xfff1('0x14'),_0x106e20);logger[_0xfff1('0xd')](_0xfff1('0x14'),_0x106e20,JSON[_0xfff1('0xf')](_0x5a6f0e));_0x4d6aa7(_0x5a6f0e);})[_0xfff1('0x13')](function(_0x179619){logger[_0xfff1('0x10')](_0xfff1('0x14'),_0x179619['message'],_0x106e20);_0x364e39(_0x17aef9['error'](0x1f4,_0x179619[_0xfff1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9028221..ddd8653 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 _0xffc6=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','getMessages','/:id/download','download','post','create','addMessage','openchannelinteraction:addtags','addTags','put','/:id','openchannel','openchannelinteraction:update','update','tracked','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3c587a,_0x3c4d2a){var _0x13c7ba=function(_0xe9bea9){while(--_0xe9bea9){_0x3c587a['push'](_0x3c587a['shift']());}};_0x13c7ba(++_0x3c4d2a);}(_0xffc6,0xd3));var _0x6ffc=function(_0x37e560,_0x30b109){_0x37e560=_0x37e560-0x0;var _0x5baf5c=_0xffc6[_0x37e560];return _0x5baf5c;};'use strict';var multer=require(_0x6ffc('0x0'));var util=require(_0x6ffc('0x1'));var path=require(_0x6ffc('0x2'));var timeout=require(_0x6ffc('0x3'));var express=require('express');var router=express[_0x6ffc('0x4')]();var fs_extra=require(_0x6ffc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6ffc('0x6'));var config=require(_0x6ffc('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x6ffc('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ffc('0x9')]);router[_0x6ffc('0x8')]('/describe',auth[_0x6ffc('0xa')](),controller[_0x6ffc('0xb')]);router[_0x6ffc('0x8')]('/:id',auth[_0x6ffc('0xa')](),controller[_0x6ffc('0xc')]);router[_0x6ffc('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6ffc('0xd')]);router[_0x6ffc('0x8')](_0x6ffc('0xe'),auth[_0x6ffc('0xa')](),controller[_0x6ffc('0xf')]);router[_0x6ffc('0x10')]('/',auth[_0x6ffc('0xa')](),controller[_0x6ffc('0x11')]);router[_0x6ffc('0x10')]('/:id/messages',auth[_0x6ffc('0xa')](),controller[_0x6ffc('0x12')]);router[_0x6ffc('0x10')]('/:id/tags',auth[_0x6ffc('0xa')](),interaction['tracked']('openchannel',_0x6ffc('0x13')),controller[_0x6ffc('0x14')]);router[_0x6ffc('0x15')](_0x6ffc('0x16'),auth[_0x6ffc('0xa')](),interaction['tracked'](_0x6ffc('0x17'),_0x6ffc('0x18')),controller[_0x6ffc('0x19')]);router['delete'](_0x6ffc('0x16'),auth['isAuthenticated'](),interaction[_0x6ffc('0x1a')](_0x6ffc('0x17'),_0x6ffc('0x1b')),controller[_0x6ffc('0x1c')]);router['delete'](_0x6ffc('0x1d'),auth[_0x6ffc('0xa')](),controller['removeTags']);module[_0x6ffc('0x1e')]=router; \ No newline at end of file +var _0xe4f4=['openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','delete','tracked'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0xe4f4,0x6a));var _0x4e4f=function(_0x2715f0,_0x35ae1d){_0x2715f0=_0x2715f0-0x0;var _0x21f73f=_0xe4f4[_0x2715f0];return _0x21f73f;};'use strict';var multer=require(_0x4e4f('0x0'));var util=require(_0x4e4f('0x1'));var path=require('path');var timeout=require(_0x4e4f('0x2'));var express=require(_0x4e4f('0x3'));var router=express[_0x4e4f('0x4')]();var fs_extra=require(_0x4e4f('0x5'));var auth=require(_0x4e4f('0x6'));var interaction=require(_0x4e4f('0x7'));var config=require(_0x4e4f('0x8'));var controller=require('./openchannelInteraction.controller');router[_0x4e4f('0x9')]('/',auth[_0x4e4f('0xa')](),controller[_0x4e4f('0xb')]);router[_0x4e4f('0x9')]('/describe',auth[_0x4e4f('0xa')](),controller[_0x4e4f('0xc')]);router[_0x4e4f('0x9')]('/:id',auth[_0x4e4f('0xa')](),controller[_0x4e4f('0xd')]);router[_0x4e4f('0x9')](_0x4e4f('0xe'),auth[_0x4e4f('0xa')](),controller[_0x4e4f('0xf')]);router[_0x4e4f('0x9')](_0x4e4f('0x10'),auth[_0x4e4f('0xa')](),controller['download']);router['post']('/',auth[_0x4e4f('0xa')](),controller[_0x4e4f('0x11')]);router[_0x4e4f('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x4e4f('0x13')]);router[_0x4e4f('0x12')](_0x4e4f('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x4e4f('0x15'),_0x4e4f('0x16')),controller[_0x4e4f('0x17')]);router[_0x4e4f('0x18')](_0x4e4f('0x19'),auth['isAuthenticated'](),interaction['tracked'](_0x4e4f('0x15'),_0x4e4f('0x1a')),controller[_0x4e4f('0x1b')]);router[_0x4e4f('0x1c')](_0x4e4f('0x19'),auth[_0x4e4f('0xa')](),interaction[_0x4e4f('0x1d')]('openchannel',_0x4e4f('0x1e')),controller[_0x4e4f('0x1f')]);router['delete'](_0x4e4f('0x14'),auth['isAuthenticated'](),controller[_0x4e4f('0x20')]);module[_0x4e4f('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 96b7c43..19940f2 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 _0x569b=['exports','DATE','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x569b,0x173));var _0xb569=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x569b[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0xb569('0x0'));module[_0xb569('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb569('0x2')]},'disposition':{'type':Sequelize[_0xb569('0x3')]},'secondDisposition':{'type':Sequelize[_0xb569('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb569('0x3')]},'read1stAt':{'type':Sequelize[_0xb569('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb569('0x3')]},'lastMsgAt':{'type':Sequelize[_0xb569('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xb569('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb569('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xb569('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x50d0=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x1a3036,_0x3e8f92){var _0x3e177a=function(_0x21872){while(--_0x21872){_0x1a3036['push'](_0x1a3036['shift']());}};_0x3e177a(++_0x3e8f92);}(_0x50d0,0x101));var _0x050d=function(_0xcce566,_0x2a080c){_0xcce566=_0xcce566-0x0;var _0x4d585e=_0x50d0[_0xcce566];return _0x4d585e;};'use strict';var Sequelize=require(_0x050d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x050d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x050d('0x2')]},'disposition':{'type':Sequelize[_0x050d('0x3')]},'secondDisposition':{'type':Sequelize[_0x050d('0x3')]},'thirdDisposition':{'type':Sequelize[_0x050d('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x050d('0x2')]},'threadId':{'type':Sequelize[_0x050d('0x3')]},'externalUrl':{'type':Sequelize[_0x050d('0x3')]},'lastMsgAt':{'type':Sequelize[_0x050d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x050d('0x4')]('in',_0x050d('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x050d('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x050d('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 5b7b73b..084afb9 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 _0x01b3=['toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','pick','findAll','addTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','threadId','Private','createReadStream','pipe','createWriteStream','basename','System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','catch','index','map','rawAttributes','type','key','model','filters','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','order','sort','where','select','field','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','start','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize'];(function(_0x593b33,_0x1ea034){var _0x2f17a2=function(_0x2dbb16){while(--_0x2dbb16){_0x593b33['push'](_0x593b33['shift']());}};_0x2f17a2(++_0x1ea034);}(_0x01b3,0x14d));var _0x301b=function(_0x30c071,_0xa66aeb){_0x30c071=_0x30c071-0x0;var _0x5141f6=_0x01b3[_0x30c071];return _0x5141f6;};'use strict';var emlformat=require(_0x301b('0x0'));var rimraf=require(_0x301b('0x1'));var zipdir=require(_0x301b('0x2'));var jsonpatch=require(_0x301b('0x3'));var rp=require('request-promise');var moment=require(_0x301b('0x4'));var BPromise=require(_0x301b('0x5'));var Mustache=require('mustache');var util=require(_0x301b('0x6'));var path=require('path');var sox=require(_0x301b('0x7'));var csv=require(_0x301b('0x8'));var ejs=require(_0x301b('0x9'));var fs=require('fs');var fs_extra=require(_0x301b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x301b('0xb'));var jsforce=require(_0x301b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x301b('0xd'));var Papa=require('papaparse');var Redis=require(_0x301b('0xe'));var authService=require(_0x301b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x301b('0x10'));var logger=require(_0x301b('0x11'))(_0x301b('0x12'));var utils=require(_0x301b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x301b('0x14'))['db'];config['redis']=_[_0x301b('0x15')](config[_0x301b('0x16')],{'host':_0x301b('0x17'),'port':0x18eb});var socket=require(_0x301b('0x18'))(new Redis(config[_0x301b('0x16')]));require(_0x301b('0x19'))[_0x301b('0x1a')](socket);function respondWithStatusCode(_0x4ec9f5,_0x35e790){_0x35e790=_0x35e790||0xcc;return function(_0x19c57a){if(_0x19c57a){return _0x4ec9f5[_0x301b('0x1b')](_0x35e790);}return _0x4ec9f5[_0x301b('0x1c')](_0x35e790)[_0x301b('0x1d')]();};}function respondWithResult(_0x40b629,_0x1f93a3){_0x1f93a3=_0x1f93a3||0xc8;return function(_0x215bc3){if(_0x215bc3){return _0x40b629[_0x301b('0x1c')](_0x1f93a3)['json'](_0x215bc3);}};}function respondWithFilteredResult(_0x36aadf,_0x583cfd){return function(_0x1781f9){if(_0x1781f9){var _0x40a42d=typeof _0x583cfd[_0x301b('0x1e')]===_0x301b('0x1f')&&typeof _0x583cfd['limit']===_0x301b('0x1f');var _0x4678cb=_0x1781f9[_0x301b('0x20')];var _0x576fbd=_0x40a42d?0x0:_0x583cfd[_0x301b('0x1e')];var _0x2f8931=_0x40a42d?_0x1781f9['count']:_0x583cfd['offset']+_0x583cfd[_0x301b('0x21')];var _0x11d66a;if(_0x2f8931>=_0x4678cb){_0x2f8931=_0x4678cb;_0x11d66a=0xc8;}else{_0x11d66a=0xce;}_0x36aadf['status'](_0x11d66a);return _0x36aadf[_0x301b('0x22')](_0x301b('0x23'),_0x576fbd+'-'+_0x2f8931+'/'+_0x4678cb)[_0x301b('0x24')](_0x1781f9);}return null;};}function patchUpdates(_0x2b4c62){return function(_0x10686b){try{jsonpatch[_0x301b('0x25')](_0x10686b,_0x2b4c62,!![]);}catch(_0x2d8757){return BPromise[_0x301b('0x26')](_0x2d8757);}return _0x10686b[_0x301b('0x27')]();};}function saveUpdates(_0xc18bbb,_0x55a166){return function(_0x1beea7){if(_0x1beea7){return _0x1beea7[_0x301b('0x28')](_0xc18bbb)['then'](function(_0x40782d){return _0x40782d;});}return null;};}function removeEntity(_0x3d6124,_0x59fa02){return function(_0x4dcc38){if(_0x4dcc38){return _0x4dcc38[_0x301b('0x29')]()[_0x301b('0x2a')](function(){_0x3d6124['status'](0xcc)[_0x301b('0x1d')]();});}};}function handleEntityNotFound(_0x3962c9,_0x2c45c5){return function(_0x379c52){if(!_0x379c52){_0x3962c9[_0x301b('0x1b')](0x194);}return _0x379c52;};}function handleError(_0x91e55f,_0x39a811){_0x39a811=_0x39a811||0x1f4;return function(_0x4ad4f5){logger[_0x301b('0x2b')](_0x4ad4f5[_0x301b('0x2c')]);if(_0x4ad4f5[_0x301b('0x2d')]){delete _0x4ad4f5[_0x301b('0x2d')];}_0x91e55f[_0x301b('0x1c')](_0x39a811)[_0x301b('0x2e')](_0x4ad4f5);};}function getInteractionUsers(_0x1f82c8,_0xbc1cad){return new BPromise(function(_0x24a3a2,_0xf9c850){try{if(_0xbc1cad[_0x1f82c8['id']]){_0x1f82c8[_0x301b('0x2f')]=_['map'](_0xbc1cad[_0x1f82c8['id']],function(_0x53192a){return{'id':_0x53192a['id'],'fullname':_0x53192a['fullname']};});}}catch(_0x1a86f7){_0xf9c850(_0x1a86f7);}_0x24a3a2(_0x1f82c8);});}function getInteractionTags(_0x3a29d7,_0x1c296a){return new BPromise(function(_0x1a8370,_0x10e807){try{if(_0x3a29d7[_0x301b('0x30')]){_0x3a29d7[_0x301b('0x31')]=[];_0x3a29d7[_0x301b('0x30')][_0x301b('0x32')](',')[_0x301b('0x33')](function(_0x169088){_0x3a29d7[_0x301b('0x31')][_0x301b('0x34')](_0x1c296a[_0x169088]);});}delete _0x3a29d7[_0x301b('0x30')];}catch(_0x34907e){_0x10e807(_0x34907e);}_0x1a8370(_0x3a29d7);});}function updateOpenchannelInteraction(_0x6ef72c,_0x3759e0,_0xb77eb1){return new BPromise(function(_0x421e17,_0x44783a){return getInteractionUsers(_0x6ef72c,_0xb77eb1)[_0x301b('0x2a')](function(_0x2311e5){return getInteractionTags(_0x2311e5,_0x3759e0);})[_0x301b('0x2a')](function(_0x5c6137){_0x421e17(_0x5c6137);})[_0x301b('0x35')](function(_0x482105){_0x44783a(_0x482105);});});}exports[_0x301b('0x36')]=function(_0x55e683,_0x11d43c){var _0x4f24f4={},_0xc31046={},_0x2fdf94={'count':0x0,'rows':[]};var _0x4a1ccd=_[_0x301b('0x37')](db['OpenchannelInteraction'][_0x301b('0x38')],function(_0x3cd01f){return{'name':_0x3cd01f['fieldName'],'type':_0x3cd01f[_0x301b('0x39')][_0x301b('0x3a')]};});_0xc31046[_0x301b('0x3b')]=_[_0x301b('0x37')](_0x4a1ccd,_0x301b('0x2d'));_0xc31046['query']=_['keys'](_0x55e683['query']);_0xc31046[_0x301b('0x3c')]=_['intersection'](_0xc31046[_0x301b('0x3b')],_0xc31046['query']);_0x4f24f4[_0x301b('0x3d')]=_[_0x301b('0x3e')](_0xc31046[_0x301b('0x3b')],qs[_0x301b('0x3f')](_0x55e683['query'][_0x301b('0x3f')]));_0x4f24f4['attributes']=_0x4f24f4[_0x301b('0x3d')][_0x301b('0x40')]?_0x4f24f4['attributes']:_0xc31046[_0x301b('0x3b')];if(!_0x55e683[_0x301b('0x41')][_0x301b('0x42')](_0x301b('0x43'))){_0x4f24f4[_0x301b('0x21')]=qs[_0x301b('0x21')](_0x55e683[_0x301b('0x41')][_0x301b('0x21')]);_0x4f24f4['offset']=qs[_0x301b('0x1e')](_0x55e683[_0x301b('0x41')][_0x301b('0x1e')]);}_0x4f24f4[_0x301b('0x44')]=qs['sort'](_0x55e683['query'][_0x301b('0x45')]);_0x4f24f4[_0x301b('0x46')]=qs[_0x301b('0x3c')](_['pick'](_0x55e683[_0x301b('0x41')],_0xc31046[_0x301b('0x3c')]),_0x4a1ccd);var _0x1cff67=[];var _0x36061a=squel[_0x301b('0x47')]()['field']('id')[_0x301b('0x48')](_0x301b('0x2d'))['field']('color')['from'](_0x301b('0x49'));var _0x2de6f5=squel[_0x301b('0x47')]()[_0x301b('0x48')](_0x301b('0x4a'))['field'](_0x301b('0x4b'))[_0x301b('0x48')](_0x301b('0x4c'))[_0x301b('0x4d')](_0x301b('0x4e'),'ui')[_0x301b('0x4f')](_0x301b('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x188fd5=squel['select']()[_0x301b('0x4d')]('openchannel_interactions','i')[_0x301b('0x4f')](_0x301b('0x51'),'c',_0x301b('0x52'))['left_join'](_0x301b('0x50'),'o',_0x301b('0x53'))[_0x301b('0x4f')]('openchannel_accounts','a',_0x301b('0x54'))[_0x301b('0x4f')](_0x301b('0x55'),'me',_0x301b('0x56'))[_0x301b('0x4f')](_0x301b('0x57'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x301b('0x49'),'t','t.id\x20=\x20it.TagId');var _0x2028af=squel['expr']();var _0x1082d5=[];var _0x4df0a3=squel[_0x301b('0x58')]();var _0x2459b3;if(_0x55e683[_0x301b('0x41')][_0x301b('0x59')]){_0x2459b3=as[_0x301b('0x5a')](_0x55e683[_0x301b('0x41')][_0x301b('0x59')]);var _0x555c72=_0x2459b3[_0x301b('0x5b')];for(var _0x4099d8=0x0;_0x4099d8<_0x2459b3[_0x301b('0x5c')][_0x301b('0x40')];_0x4099d8++){var _0x272826=_0x2459b3['conditions'][_0x4099d8];var _0x53f92e='i';var _0x19d553=_[_0x301b('0x5d')](_0x4a1ccd,[_0x301b('0x2d'),_0x272826[_0x301b('0x48')]]);if(!_0x19d553){switch(_0x272826[_0x301b('0x48')]){case'unreadMessages':if(_0x272826[_0x301b('0x5e')]==0x1){_0x188fd5[_0x301b('0x5f')]('`'+_0x272826[_0x301b('0x48')]+'`\x20=\x200');}else{_0x188fd5['having']('`'+_0x272826[_0x301b('0x48')]+'`\x20>\x200');}break;case _0x301b('0x60'):if(_0x272826[_0x301b('0x61')]===_0x301b('0x62')){if(_0x272826[_0x301b('0x5e')][_0x301b('0x32')]('\x20')[_0x301b('0x40')]>0x1){_0x2028af[_0x555c72](_0x301b('0x63'),qs['getFullTextValue'](_0x272826[_0x301b('0x5e')]),null);}else{var _0xd79a75='%'+_0x272826[_0x301b('0x5e')]+'%';_0x2028af[_0x555c72](_0x301b('0x64'),_0xd79a75,_0xd79a75,_0xd79a75);}}else{_0x19d553=_[_0x301b('0x5d')](_0x4a1ccd,[_0x301b('0x2d'),_0x301b('0x65')]);_0x272826['field']=_0x301b('0x65');_0xe5b615=as['buildExpression'](_0x53f92e,_0x19d553['type'],_0x272826);_0x2028af[_0x555c72](_0xe5b615['text'],_0xe5b615[_0x301b('0x5e')]['start'],_0xe5b615[_0x301b('0x5e')][_0x301b('0x1d')]);}break;case _0x301b('0x66'):var _0x5ad35a=_0x272826[_0x301b('0x5e')][_0x301b('0x32')](',')[_0x301b('0x37')](function(_0x2d0aa6){return Number(_0x2d0aa6);});_0x5ad35a[_0x301b('0x33')](function(_0xa267ab){_0x4df0a3['or'](_0x301b('0x67'),'%,'+_0xa267ab+',%');});_0x1082d5=_[_0x301b('0x68')](_0x1082d5,_0x5ad35a);break;case _0x301b('0x69'):if(_0x272826[_0x301b('0x61')]==='$substring'){_0x2028af[_0x555c72](_0x301b('0x6a'),'%'+_0x272826[_0x301b('0x5e')]+'%',null);}else{_0x19d553=_[_0x301b('0x5d')](_0x4a1ccd,['name','UserId']);_0x272826[_0x301b('0x48')]=_0x301b('0x6b');_0xe5b615=as[_0x301b('0x6c')](_0x53f92e,_0x19d553[_0x301b('0x39')],_0x272826);_0x2028af[_0x555c72](_0xe5b615[_0x301b('0x6d')],_0xe5b615[_0x301b('0x5e')]['start'],_0xe5b615[_0x301b('0x5e')][_0x301b('0x1d')]);}break;case'body':_0xe5b615=as[_0x301b('0x6c')]('me',null,_0x272826);_0x2028af[_0x555c72](_0xe5b615[_0x301b('0x6d')],_0xe5b615[_0x301b('0x5e')][_0x301b('0x6e')],_0xe5b615[_0x301b('0x5e')][_0x301b('0x1d')]);break;}}else{var _0xe5b615=as[_0x301b('0x6c')](_0x53f92e,_0x19d553[_0x301b('0x39')],_0x272826);_0x2028af[_0x555c72](_0xe5b615[_0x301b('0x6d')],_0xe5b615[_0x301b('0x5e')][_0x301b('0x6e')],_0xe5b615[_0x301b('0x5e')]['end']);}}}else{var _0xc1a88f=_(_0x55e683[_0x301b('0x41')])[_0x301b('0x6f')]()[_0x301b('0x37')](function(_0x3940ca){return _[_0x301b('0x70')](_0x4a1ccd,[_0x301b('0x2d'),_0x3940ca])?_0x3940ca:undefined;})[_0x301b('0x71')]()[_0x301b('0x5e')]();if(!_[_0x301b('0x72')](_0xc1a88f)){_0xc1a88f[_0x301b('0x33')](function(_0x271a67){if(_0x271a67===_0x301b('0x73')){_0x188fd5[_0x301b('0x46')](_0x301b('0x74'),[][_0x301b('0x75')](_0x55e683[_0x301b('0x41')][_0x271a67]));}else if(_0x271a67===_0x301b('0x76')){var _0x4d43e1=JSON['parse'](_0x55e683[_0x301b('0x41')][_0x271a67])[_0x301b('0x77')];var _0x210302=JSON[_0x301b('0x78')](_0x55e683[_0x301b('0x41')][_0x271a67])['$lte'];_0x188fd5[_0x301b('0x46')](_0x301b('0x79'),_0x4d43e1,_0x210302);}else{if(_0x55e683[_0x301b('0x41')][_0x271a67]==='null'){_0x188fd5[_0x301b('0x46')]('i.'+_0x271a67+_0x301b('0x7a'));}else{_0x188fd5['where']('i.'+_0x271a67+_0x301b('0x7b'),_0x55e683[_0x301b('0x41')][_0x271a67]);}}});}if(_0x55e683[_0x301b('0x41')][_0x301b('0x7c')]){if(_0x55e683[_0x301b('0x41')][_0x301b('0x7c')]==0x1){_0x188fd5[_0x301b('0x5f')](_0x301b('0x7d'));}else{_0x188fd5['having']('`unreadMessages`\x20>\x200');}}if(_0x55e683[_0x301b('0x41')][_0x301b('0x7e')]){_0x1082d5=_[_0x301b('0x7f')](_0x55e683['query']['tag'])?_0x55e683[_0x301b('0x41')][_0x301b('0x7e')]:new Array(_0x55e683[_0x301b('0x41')][_0x301b('0x7e')]);_0x1082d5[_0x301b('0x33')](function(_0x98694a){_0x4df0a3['or'](_0x301b('0x67'),'%,'+_0x98694a+',%');});}if(_0x55e683[_0x301b('0x41')][_0x301b('0x80')]){var _0xef2969=_0x55e683['query'][_0x301b('0x80')][_0x301b('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x301b('0x82')](_0xef2969)){_0x2028af['or'](_0x301b('0x83'),_0xef2969+'%');}else{_0x2028af['or'](_0x301b('0x84'),qs[_0x301b('0x85')](_0xef2969))['or'](_0x301b('0x86'),_0xef2969+'%')['or'](_0x301b('0x87'),_0xef2969+'%');}}}_0x188fd5[_0x301b('0x46')](_0x2028af);_0x188fd5[_0x301b('0x88')]('i.id');var _0x4e220f={'type':db[_0x301b('0x89')]['QueryTypes'][_0x301b('0x8a')],'raw':!![]};var _0x2bed72=_0x188fd5[_0x301b('0x8b')]();_0x2bed72['field'](_0x301b('0x8c'));_0x2bed72[_0x301b('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x301b('0x8d'));if(_0x4f24f4['order']){_0x4f24f4[_0x301b('0x44')][_0x301b('0x33')](function(_0x30d888){var _0x4f9ff5=_0x30d888[0x0]===_0x301b('0x8e')?_0x30d888[0x0]:'i.'+_0x30d888[0x0];_0x188fd5[_0x301b('0x44')](_0x4f9ff5,_0x30d888[0x1]==='DESC'?![]:!![]);});}if(!_[_0x301b('0x72')](_0x1082d5)){_0x188fd5['having'](_0x4df0a3);_0x2bed72[_0x301b('0x46')](_0x301b('0x8f'),_0x1082d5);}BPromise[_0x301b('0x90')]()['then'](function(){if(!_0x2459b3){if(_0x55e683[_0x301b('0x41')][_0x301b('0x73')])return;_0x2bed72[_0x301b('0x46')](_0x301b('0x91'));_0x188fd5[_0x301b('0x46')](_0x301b('0x91'));return;}if(_0x55e683[_0x301b('0x92')]['role']!=='agent')return;return _0x55e683[_0x301b('0x92')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x301b('0x2a')](function(_0x419fc0){if(_['isEmpty'](_0x419fc0)){_0x2bed72['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x188fd5[_0x301b('0x46')](_0x301b('0x93'));}else{_0x2bed72[_0x301b('0x46')](_0x301b('0x74'),_[_0x301b('0x37')](_0x419fc0,'id'));_0x188fd5[_0x301b('0x46')](_0x301b('0x74'),_[_0x301b('0x37')](_0x419fc0,'id'));}});})[_0x301b('0x2a')](function(){if(_0x55e683[_0x301b('0x92')]['role']==='agent'&&!_0x2459b3&&!_0x55e683[_0x301b('0x41')][_0x301b('0x73')])return[];return db[_0x301b('0x94')][_0x301b('0x41')](_0x2bed72[_0x301b('0x95')](),_0x4e220f);})[_0x301b('0x2a')](function(_0x1e4bde){_0x2fdf94[_0x301b('0x20')]=_0x1e4bde['length'];if(_0x2fdf94[_0x301b('0x20')]===0x0)return[];return db['sequelize'][_0x301b('0x41')](_0x36061a[_0x301b('0x95')](),_0x4e220f)[_0x301b('0x2a')](function(_0x12e9b8){_0x1cff67=_[_0x301b('0x96')](_0x12e9b8,'id');_0x4e220f=_[_0x301b('0x97')](_0x4e220f,{'model':db[_0x301b('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55e683['query']['fields']){_0x4f24f4[_0x301b('0x3d')][_0x301b('0x33')](function(_0x28045c){_0x188fd5['field']('i.'+_0x28045c);});}else{_0x188fd5[_0x301b('0x48')](_0x301b('0x99'),_0x301b('0x8d'));_0x188fd5['field'](_0x301b('0x9a'),'Account.key');_0x188fd5[_0x301b('0x48')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x188fd5['field']('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',_0x301b('0x8e'));_0x188fd5['field'](_0x301b('0x9b'));_0x188fd5[_0x301b('0x48')](_0x301b('0x9c'),_0x301b('0x9d'));_0x188fd5[_0x301b('0x48')](_0x301b('0x9e'),_0x301b('0x9f'));_0x188fd5['field'](_0x301b('0xa0'),_0x301b('0xa1'));_0x188fd5[_0x301b('0x48')](_0x301b('0xa2'),_0x301b('0xa3'));_0x188fd5['field'](_0x301b('0xa4'),_0x301b('0xa5'));_0x188fd5['field'](_0x301b('0xa6'),_0x301b('0xa7'));_0x188fd5[_0x301b('0x48')](_0x301b('0xa8'),_0x301b('0xa9'));_0x188fd5[_0x301b('0x48')](_0x301b('0xaa'),_0x301b('0xab'));_0x188fd5[_0x301b('0x48')](_0x301b('0xac'),'TagIds');}if(_0x4f24f4[_0x301b('0x21')])_0x188fd5[_0x301b('0x21')](_0x4f24f4[_0x301b('0x21')]);if(_0x4f24f4[_0x301b('0x1e')])_0x188fd5[_0x301b('0x1e')](_0x4f24f4[_0x301b('0x1e')]);return db[_0x301b('0x94')]['query'](_0x188fd5['toString'](),_0x4e220f);})[_0x301b('0x2a')](function(_0x3ace23){if(_0x3ace23['length']>0x0)_0x2de6f5[_0x301b('0x46')](_0x301b('0xad'),_[_0x301b('0x37')](_0x3ace23,'id'));return db[_0x301b('0x94')][_0x301b('0x41')](_0x2de6f5[_0x301b('0x95')](),_0x4e220f)['then'](function(_0x3433dd){var _0x58fa9a=_['groupBy'](_0x3433dd,_0x301b('0xae'));var _0x275238=[];_0x3ace23[_0x301b('0x33')](function(_0x4ea2d4){_0x275238['push'](updateOpenchannelInteraction(_0x4ea2d4,_0x1cff67,_0x58fa9a));});return BPromise[_0x301b('0xaf')](_0x275238);});});})[_0x301b('0x2a')](function(_0x1e2802){_0x2fdf94[_0x301b('0xb0')]=_0x1e2802;return _0x2fdf94;})[_0x301b('0x2a')](respondWithFilteredResult(_0x11d43c,_0x4f24f4))[_0x301b('0x35')](handleError(_0x11d43c,null));};exports[_0x301b('0xb1')]=function(_0x5c50e8,_0x3409af){var _0x1e2d9c={};if(_0x5c50e8[_0x301b('0x41')][_0x301b('0x39')]&&_0x5c50e8[_0x301b('0x41')][_0x301b('0x39')]==='from'){_0x1e2d9c[_0x301b('0x4d')]=_0x5c50e8[_0x301b('0xb2')]['id'];}else{_0x1e2d9c['id']=_0x5c50e8[_0x301b('0xb2')]['id'];}var _0x2ff8ab={'raw':![],'where':_0x1e2d9c},_0x57b62e={};_0x57b62e[_0x301b('0x3b')]=_[_0x301b('0x6f')](db[_0x301b('0x98')][_0x301b('0x38')]);_0x57b62e[_0x301b('0x41')]=_[_0x301b('0x6f')](_0x5c50e8[_0x301b('0x41')]);_0x57b62e[_0x301b('0x3c')]=_[_0x301b('0x3e')](_0x57b62e[_0x301b('0x3b')],_0x57b62e[_0x301b('0x41')]);_0x2ff8ab[_0x301b('0x3d')]=_[_0x301b('0x3e')](_0x57b62e[_0x301b('0x3b')],qs['fields'](_0x5c50e8[_0x301b('0x41')][_0x301b('0x3f')]));_0x2ff8ab[_0x301b('0x3d')]=_0x2ff8ab[_0x301b('0x3d')][_0x301b('0x40')]?_0x2ff8ab[_0x301b('0x3d')]:_0x57b62e[_0x301b('0x3b')];if(_0x5c50e8['query'][_0x301b('0xb3')]){_0x2ff8ab[_0x301b('0xb4')]=[{'all':!![]}];}_0x2ff8ab=_[_0x301b('0x97')]({},_0x2ff8ab,_0x5c50e8[_0x301b('0xb5')]);return db[_0x301b('0x98')][_0x301b('0x5d')](_0x2ff8ab)[_0x301b('0x2a')](handleEntityNotFound(_0x3409af,null))['then'](respondWithResult(_0x3409af,null))[_0x301b('0x35')](handleError(_0x3409af,null));};exports[_0x301b('0xb6')]=function(_0x59bccf,_0x5a14c7){return db[_0x301b('0x98')][_0x301b('0xb6')](_0x59bccf[_0x301b('0xb7')],{})[_0x301b('0x2a')](respondWithResult(_0x5a14c7,0xc9))[_0x301b('0x35')](handleError(_0x5a14c7,null));};exports['update']=function(_0x3cb222,_0x25e1b8){if(_0x3cb222['body']['id']){delete _0x3cb222['body']['id'];}return db['OpenchannelInteraction'][_0x301b('0x5d')]({'where':{'id':_0x3cb222[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x25e1b8,null))[_0x301b('0x2a')](saveUpdates(_0x3cb222[_0x301b('0xb7')],null))[_0x301b('0x2a')](respondWithResult(_0x25e1b8,null))['catch'](handleError(_0x25e1b8,null));};exports[_0x301b('0x29')]=function(_0x331ff9,_0x2f6464){return db['OpenchannelInteraction'][_0x301b('0x5d')]({'where':{'id':_0x331ff9[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x2f6464,null))[_0x301b('0x2a')](removeEntity(_0x2f6464,null))[_0x301b('0x35')](handleError(_0x2f6464,null));};exports[_0x301b('0xb8')]=function(_0x561a7d,_0x48ab30){return db[_0x301b('0x98')]['describe']()[_0x301b('0x2a')](respondWithResult(_0x48ab30,null))[_0x301b('0x35')](handleError(_0x48ab30,null));};exports[_0x301b('0xb9')]=function(_0x10c013,_0x23b9b0,_0x304b73){return db[_0x301b('0xba')]['find']({'where':{'id':_0x10c013[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x23b9b0,null))[_0x301b('0x2a')](function(_0x355f68){if(_0x355f68){return _0x355f68['addMessage'](_0x10c013['body'][_0x301b('0xbb')],_[_0x301b('0xbc')](_0x10c013[_0x301b('0xb7')],[_0x301b('0xbb'),'id'])||{});}})[_0x301b('0x2a')](respondWithResult(_0x23b9b0,null))[_0x301b('0x35')](handleError(_0x23b9b0,null));};exports[_0x301b('0xbd')]=function(_0x41401e,_0x55afc7,_0x45db20){var _0x1de8e7={'raw':![],'where':{}};var _0x2bfc9d={};var _0x4f7393={'count':0x0,'rows':[]};return db[_0x301b('0x98')][_0x301b('0xbe')]({'where':{'id':_0x41401e[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x55afc7,null))['then'](function(_0x256bc9){if(_0x256bc9){_0x2bfc9d[_0x301b('0x3b')]=_[_0x301b('0x6f')](db[_0x301b('0xba')][_0x301b('0x38')]);_0x2bfc9d['query']=_[_0x301b('0x6f')](_0x41401e[_0x301b('0x41')]);_0x2bfc9d[_0x301b('0x3c')]=_[_0x301b('0x3e')](_0x2bfc9d[_0x301b('0x3b')],_0x2bfc9d['query']);_0x1de8e7['attributes']=_[_0x301b('0x3e')](_0x2bfc9d[_0x301b('0x3b')],qs['fields'](_0x41401e[_0x301b('0x41')][_0x301b('0x3f')]));_0x1de8e7[_0x301b('0x3d')]=_0x1de8e7[_0x301b('0x3d')]['length']?_0x1de8e7[_0x301b('0x3d')]:_0x2bfc9d[_0x301b('0x3b')];if(!_0x41401e[_0x301b('0x41')][_0x301b('0x42')]('nolimit')){_0x1de8e7[_0x301b('0x21')]=qs['limit'](_0x41401e[_0x301b('0x41')][_0x301b('0x21')]);_0x1de8e7[_0x301b('0x1e')]=qs[_0x301b('0x1e')](_0x41401e[_0x301b('0x41')]['offset']);}_0x1de8e7[_0x301b('0x44')]=qs[_0x301b('0x45')](_0x41401e['query'][_0x301b('0x45')]);_0x1de8e7['where']=qs[_0x301b('0x3c')](_[_0x301b('0xbf')](_0x41401e[_0x301b('0x41')],_0x2bfc9d[_0x301b('0x3c')]));_0x1de8e7[_0x301b('0x46')][_0x301b('0xae')]=_0x256bc9['id'];if(_0x41401e['query'][_0x301b('0x80')]){_0x1de8e7[_0x301b('0x46')]=_['merge'](_0x1de8e7[_0x301b('0x46')],{'$or':_[_0x301b('0x37')](_0x1de8e7[_0x301b('0x3d')],function(_0x432c04){var _0x4e1485={};_0x4e1485[_0x432c04]={'$like':'%'+_0x41401e['query'][_0x301b('0x80')]+'%'};return _0x4e1485;})});}if(_0x41401e[_0x301b('0x41')]['$gte']){var _0x4ca8bd=_0x41401e['query'][_0x301b('0x77')][_0x301b('0x32')](',');var _0x30e470={};_0x30e470[_0x4ca8bd[0x0]]={'$gte':moment(_0x4ca8bd[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1de8e7[_0x301b('0x46')]=_[_0x301b('0x97')](_0x1de8e7[_0x301b('0x46')],_0x30e470);}_0x1de8e7=_['merge']({},_0x1de8e7,_0x41401e['options']);return db[_0x301b('0xba')][_0x301b('0x20')]({'where':_0x1de8e7[_0x301b('0x46')]})['then'](function(_0x1deef8){_0x4f7393[_0x301b('0x20')]=_0x1deef8;if(_0x41401e[_0x301b('0x41')][_0x301b('0xb3')]){_0x1de8e7[_0x301b('0xb4')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x301b('0xc0')](_0x1de8e7);})[_0x301b('0x2a')](function(_0x555463){_0x4f7393[_0x301b('0xb0')]=_0x555463;return _0x4f7393;});}})[_0x301b('0x2a')](respondWithFilteredResult(_0x55afc7,_0x1de8e7))[_0x301b('0x35')](handleError(_0x55afc7,null));};exports[_0x301b('0xc1')]=function(_0x4534d1,_0x3d490f,_0x37453a){return db[_0x301b('0x98')][_0x301b('0x5d')]({'where':{'id':_0x4534d1[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x3d490f,null))[_0x301b('0x2a')](function(_0x4e441e){if(_0x4e441e){return _0x4e441e['setTags'](_0x4534d1[_0x301b('0xb7')]['ids'],_['omit'](_0x4534d1[_0x301b('0xb7')],['ids','id'])||{})[_0x301b('0xc2')](function(){return db[_0x301b('0x66')][_0x301b('0xc0')]({'attributes':['id',_0x301b('0x2d'),_0x301b('0xc3')],'where':{'id':_0x4534d1[_0x301b('0xb7')][_0x301b('0xbb')]}});})[_0x301b('0x2a')](function(_0x4955a8){socket[_0x301b('0xc4')](_0x301b('0xc5'),{'id':Number(_0x4534d1[_0x301b('0xb2')]['id']),'tags':_0x4955a8||[]});return{'id':Number(_0x4534d1[_0x301b('0xb2')]['id']),'tags':_0x4955a8||[]};});}})[_0x301b('0x2a')](respondWithResult(_0x3d490f,null))[_0x301b('0x35')](handleError(_0x3d490f,null));};exports[_0x301b('0xc6')]=function(_0x1d77a9,_0x453a1e,_0xfc54b5){return db[_0x301b('0x98')][_0x301b('0x5d')]({'where':{'id':_0x1d77a9[_0x301b('0xb2')]['id']}})[_0x301b('0x2a')](handleEntityNotFound(_0x453a1e,null))[_0x301b('0x2a')](function(_0x430502){if(_0x430502){return _0x430502[_0x301b('0xc6')](_0x1d77a9[_0x301b('0x41')][_0x301b('0xbb')]);}})['then'](respondWithStatusCode(_0x453a1e,null))[_0x301b('0x35')](handleError(_0x453a1e,null));};exports[_0x301b('0xc7')]=function(_0x4f01f1,_0x31640f){var _0x28efe1=moment()[_0x301b('0xc8')]()[_0x301b('0x95')]();var _0x309fb7=path[_0x301b('0xc9')](config['root'],_0x301b('0xca'),'files',_0x301b('0xcb'));var _0x437e66=path['join'](config[_0x301b('0xcc')],_0x301b('0xca'),_0x301b('0xcd'),_0x301b('0xce'));var _0x37f74d=path[_0x301b('0xc9')](_0x309fb7,_0x28efe1);var _0x5ca40d=util['format'](_0x301b('0xcf'),_0x4f01f1[_0x301b('0xb2')]['id'],_0x28efe1);var _0x184ed3=path[_0x301b('0xc9')](_0x309fb7,_0x5ca40d);var _0x5beca1=[];_0x5beca1[_0x301b('0x34')]({'model':db[_0x301b('0x69')],'as':'User','attributes':['id',_0x301b('0xd0')],'raw':!![]});_0x5beca1['push']({'model':db[_0x301b('0xd1')],'as':_0x301b('0x60'),'attributes':['id',_0x301b('0xd2'),_0x301b('0xd3')],'raw':!![]});if(_0x4f01f1[_0x301b('0x41')][_0x301b('0xce')]){_0x5beca1[_0x301b('0x34')]({'model':db[_0x301b('0xd4')],'as':_0x301b('0xd4'),'raw':!![]});}var _0x4c346d=[{'model':db[_0x301b('0xba')],'as':'Messages','attributes':['id','body',_0x301b('0x76'),_0x301b('0xd5'),_0x301b('0xd6'),_0x301b('0x7c')],'include':_0x5beca1}];_0x4c346d[_0x301b('0x34')]({'model':db[_0x301b('0xd7')],'as':_0x301b('0xd8'),'attributes':['id','name']});_0x4c346d[_0x301b('0x34')]({'model':db[_0x301b('0x69')],'as':_0x301b('0xd9'),'attributes':['id',_0x301b('0xd0')]});return db[_0x301b('0x98')]['find']({'where':{'id':_0x4f01f1[_0x301b('0xb2')]['id']},'include':_0x4c346d})['then'](handleEntityNotFound(_0x31640f,null))[_0x301b('0x2a')](function(_0x505f4a){if(_0x505f4a){var _0x589bf7=_0x505f4a[_0x301b('0xda')]({'plain':!![]});fs['mkdirSync'](_0x37f74d);var _0x203844={'channel':_0x301b('0xdb'),'account':_0x589bf7[_0x301b('0xd8')][_0x301b('0x2d')],'agent':_0x589bf7[_0x301b('0xd9')]?_0x589bf7[_0x301b('0xd9')][_0x301b('0xd0')]:_0x301b('0xdc'),'createdAt':moment(_0x589bf7['createdAt'])[_0x301b('0xdd')](_0x301b('0xde'))[_0x301b('0x95')](),'closedAt':_0x589bf7['closed']?moment(_0x589bf7[_0x301b('0xdf')])[_0x301b('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x589bf7['disposition'],'visibility':_0x589bf7[_0x301b('0xe0')]?'Public':_0x301b('0xe1'),'messages':_(_0x589bf7['Messages'])['filter']({'secret':![]})[_0x301b('0x37')](function(_0x4ba6ac){if(_0x4ba6ac[_0x301b('0xd4')]){var _0x468209=path[_0x301b('0xc9')](_0x437e66,_0x4ba6ac[_0x301b('0xd4')]['basename']);if(fs['existsSync'](_0x468209)){fs[_0x301b('0xe2')](_0x468209)[_0x301b('0xe3')](fs[_0x301b('0xe4')](path[_0x301b('0xc9')](_0x37f74d,_0x4ba6ac[_0x301b('0xd4')][_0x301b('0xe5')])));}}return{'date':moment(_0x4ba6ac[_0x301b('0x76')])[_0x301b('0xdd')](_0x301b('0xde'))[_0x301b('0x95')](),'sender':_0x4ba6ac[_0x301b('0xd5')]==='out'?_0x4ba6ac['User']?_0x4ba6ac[_0x301b('0x69')][_0x301b('0xd0')]:_0x301b('0xe6'):_0x4ba6ac[_0x301b('0x60')][_0x301b('0xd2')]+(_0x4ba6ac['Contact']['lastName']?'\x20'+_0x4ba6ac[_0x301b('0x60')]['lastName']:''),'body':_0x4ba6ac[_0x301b('0xd4')]?_0x4ba6ac[_0x301b('0xd4')][_0x301b('0xe5')]:_0x4ba6ac[_0x301b('0xb7')],'direction':_0x4ba6ac[_0x301b('0xd5')]===_0x301b('0xe7')?'A':'C','secret':_0x4ba6ac[_0x301b('0xd6')],'read':_0x4ba6ac[_0x301b('0x7c')],'attachment':_0x4ba6ac[_0x301b('0xd4')]};})[_0x301b('0x5e')]()};return ejs[_0x301b('0xe8')](path[_0x301b('0xc9')](config['root'],'server',_0x301b('0xe9'),_0x301b('0xea')),{'interaction':_0x203844})[_0x301b('0x2a')](function(_0x5d4727){var _0x2ba832=path[_0x301b('0xc9')](_0x37f74d,_0x301b('0xeb')+_0x589bf7['id']+'-'+_0x28efe1+_0x301b('0xec'));var _0x371c76={'path':_0x2ba832,'channel':_0x301b('0xdb'),'interactionId':_0x589bf7['id']};return pdf[_0x301b('0xed')](_0x5d4727,_0x371c76);})['then'](function(){return new BPromise(function(_0x118b3f,_0x1320ac){zipdir(_0x37f74d,{'saveTo':_0x184ed3},function(_0x19cf82,_0x2a08ee){if(_0x19cf82)return _0x1320ac(_0x19cf82);return _0x118b3f(_0x2a08ee);});})[_0x301b('0x2a')](function(){return new BPromise(function(_0x301067,_0x2d2cf4){rimraf(_0x37f74d,function(_0x10704d){if(_0x10704d)_0x2d2cf4(_0x10704d);return _0x301067();});});})[_0x301b('0x2a')](function(){return _0x31640f['download'](_0x184ed3,_0x5ca40d,function(_0x3e9fa6){if(_0x3e9fa6){console[_0x301b('0xee')](_0x301b('0xef'),_0x3e9fa6);}else{fs[_0x301b('0xf0')](_0x184ed3);}});});});}else{return _0x31640f[_0x301b('0x1b')](0xc8);}})[_0x301b('0x35')](handleError(_0x31640f,null));}; \ No newline at end of file +var _0x0027=['buildExpression','text','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','params','rawAttributes','includeAll','include','options','OpenchannelInteraction','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','removeTags','download','unix','root','attachments','transcript-%d-%s.zip','push','User','CmContact','lastName','Attachment','Messages','createdAt','direction','Owner','mkdirSync','Openchannel','Account','N.A.','closed','disposition','threadId','Public','join','basename','createReadStream','pipe','createWriteStream','out','firstName','secret','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','stack','name','send','map','fullname','TagIds','split','forEach','Tags','catch','index','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x45b4bb,_0x5e17cb){var _0x24c21f=function(_0x4a064b){while(--_0x4a064b){_0x45b4bb['push'](_0x45b4bb['shift']());}};_0x24c21f(++_0x5e17cb);}(_0x0027,0x82));var _0x7002=function(_0x256a46,_0x5d21a5){_0x256a46=_0x256a46-0x0;var _0x207472=_0x0027[_0x256a46];return _0x207472;};'use strict';var emlformat=require(_0x7002('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7002('0x1'));var moment=require('moment');var BPromise=require(_0x7002('0x2'));var Mustache=require(_0x7002('0x3'));var util=require(_0x7002('0x4'));var path=require(_0x7002('0x5'));var sox=require(_0x7002('0x6'));var csv=require(_0x7002('0x7'));var ejs=require(_0x7002('0x8'));var fs=require('fs');var fs_extra=require(_0x7002('0x9'));var _=require(_0x7002('0xa'));var squel=require(_0x7002('0xb'));var crypto=require(_0x7002('0xc'));var jsforce=require(_0x7002('0xd'));var deskjs=require(_0x7002('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7002('0xf'));var Papa=require(_0x7002('0x10'));var Redis=require(_0x7002('0x11'));var authService=require(_0x7002('0x12'));var qs=require(_0x7002('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x7002('0x14'));var logger=require(_0x7002('0x15'))(_0x7002('0x16'));var utils=require(_0x7002('0x17'));var config=require(_0x7002('0x18'));var licenseUtil=require(_0x7002('0x19'));var db=require(_0x7002('0x1a'))['db'];config['redis']=_[_0x7002('0x1b')](config['redis'],{'host':_0x7002('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7002('0x1d')]));require(_0x7002('0x1e'))['register'](socket);function respondWithStatusCode(_0x41507f,_0x1b3412){_0x1b3412=_0x1b3412||0xcc;return function(_0x188e47){if(_0x188e47){return _0x41507f[_0x7002('0x1f')](_0x1b3412);}return _0x41507f[_0x7002('0x20')](_0x1b3412)[_0x7002('0x21')]();};}function respondWithResult(_0x278da4,_0x47dcb4){_0x47dcb4=_0x47dcb4||0xc8;return function(_0xf50c7d){if(_0xf50c7d){return _0x278da4[_0x7002('0x20')](_0x47dcb4)[_0x7002('0x22')](_0xf50c7d);}};}function respondWithFilteredResult(_0x56f1a0,_0x1b474d){return function(_0x17c39b){if(_0x17c39b){var _0x4f4316=typeof _0x1b474d[_0x7002('0x23')]===_0x7002('0x24')&&typeof _0x1b474d[_0x7002('0x25')]==='undefined';var _0x3e85d0=_0x17c39b[_0x7002('0x26')];var _0x29f6a5=_0x4f4316?0x0:_0x1b474d['offset'];var _0x534d11=_0x4f4316?_0x17c39b['count']:_0x1b474d['offset']+_0x1b474d[_0x7002('0x25')];var _0x4458b6;if(_0x534d11>=_0x3e85d0){_0x534d11=_0x3e85d0;_0x4458b6=0xc8;}else{_0x4458b6=0xce;}_0x56f1a0['status'](_0x4458b6);return _0x56f1a0[_0x7002('0x27')](_0x7002('0x28'),_0x29f6a5+'-'+_0x534d11+'/'+_0x3e85d0)[_0x7002('0x22')](_0x17c39b);}return null;};}function patchUpdates(_0x3cefd4){return function(_0xaba126){try{jsonpatch['apply'](_0xaba126,_0x3cefd4,!![]);}catch(_0x369202){return BPromise[_0x7002('0x29')](_0x369202);}return _0xaba126[_0x7002('0x2a')]();};}function saveUpdates(_0x32361b,_0x18b38f){return function(_0x459a04){if(_0x459a04){return _0x459a04['update'](_0x32361b)[_0x7002('0x2b')](function(_0x52d61b){return _0x52d61b;});}return null;};}function removeEntity(_0x1f2898,_0x212201){return function(_0x89b876){if(_0x89b876){return _0x89b876['destroy']()[_0x7002('0x2b')](function(){_0x1f2898[_0x7002('0x20')](0xcc)[_0x7002('0x21')]();});}};}function handleEntityNotFound(_0x2d2dbf,_0x512ccc){return function(_0xde30e5){if(!_0xde30e5){_0x2d2dbf[_0x7002('0x1f')](0x194);}return _0xde30e5;};}function handleError(_0x57884e,_0x216397){_0x216397=_0x216397||0x1f4;return function(_0x5f3b3e){logger['error'](_0x5f3b3e[_0x7002('0x2c')]);if(_0x5f3b3e[_0x7002('0x2d')]){delete _0x5f3b3e[_0x7002('0x2d')];}_0x57884e['status'](_0x216397)[_0x7002('0x2e')](_0x5f3b3e);};}function getInteractionUsers(_0x1d9e19,_0x5ec70b){return new BPromise(function(_0x510745,_0x58f7e2){try{if(_0x5ec70b[_0x1d9e19['id']]){_0x1d9e19['Users']=_[_0x7002('0x2f')](_0x5ec70b[_0x1d9e19['id']],function(_0x3347ce){return{'id':_0x3347ce['id'],'fullname':_0x3347ce[_0x7002('0x30')]};});}}catch(_0x38d2f1){_0x58f7e2(_0x38d2f1);}_0x510745(_0x1d9e19);});}function getInteractionTags(_0x5cca8d,_0x62f80b){return new BPromise(function(_0x46bab6,_0x374a01){try{if(_0x5cca8d[_0x7002('0x31')]){_0x5cca8d['Tags']=[];_0x5cca8d[_0x7002('0x31')][_0x7002('0x32')](',')[_0x7002('0x33')](function(_0x1ea3ec){_0x5cca8d[_0x7002('0x34')]['push'](_0x62f80b[_0x1ea3ec]);});}delete _0x5cca8d[_0x7002('0x31')];}catch(_0x41b3fb){_0x374a01(_0x41b3fb);}_0x46bab6(_0x5cca8d);});}function updateOpenchannelInteraction(_0x508eb3,_0x1e0fde,_0x4152a6){return new BPromise(function(_0xbd159c,_0x54bc06){return getInteractionUsers(_0x508eb3,_0x4152a6)[_0x7002('0x2b')](function(_0x10d554){return getInteractionTags(_0x10d554,_0x1e0fde);})[_0x7002('0x2b')](function(_0x232bea){_0xbd159c(_0x232bea);})[_0x7002('0x35')](function(_0x2ca539){_0x54bc06(_0x2ca539);});});}exports[_0x7002('0x36')]=function(_0x4f5bb1,_0x3cdc03){var _0x4e65a8={},_0x5d2829={},_0x4c952a={'count':0x0,'rows':[]};var _0x4aaeee=_['map'](db['OpenchannelInteraction']['rawAttributes'],function(_0x2eca90){return{'name':_0x2eca90[_0x7002('0x37')],'type':_0x2eca90[_0x7002('0x38')][_0x7002('0x39')]};});_0x5d2829[_0x7002('0x3a')]=_[_0x7002('0x2f')](_0x4aaeee,'name');_0x5d2829['query']=_[_0x7002('0x3b')](_0x4f5bb1[_0x7002('0x3c')]);_0x5d2829[_0x7002('0x3d')]=_[_0x7002('0x3e')](_0x5d2829[_0x7002('0x3a')],_0x5d2829['query']);_0x4e65a8[_0x7002('0x3f')]=_[_0x7002('0x3e')](_0x5d2829[_0x7002('0x3a')],qs[_0x7002('0x40')](_0x4f5bb1['query']['fields']));_0x4e65a8[_0x7002('0x3f')]=_0x4e65a8[_0x7002('0x3f')][_0x7002('0x41')]?_0x4e65a8[_0x7002('0x3f')]:_0x5d2829[_0x7002('0x3a')];if(!_0x4f5bb1[_0x7002('0x3c')]['hasOwnProperty'](_0x7002('0x42'))){_0x4e65a8['limit']=qs[_0x7002('0x25')](_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x25')]);_0x4e65a8[_0x7002('0x23')]=qs['offset'](_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x23')]);}_0x4e65a8[_0x7002('0x43')]=qs['sort'](_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x44')]);_0x4e65a8[_0x7002('0x45')]=qs['filters'](_[_0x7002('0x46')](_0x4f5bb1[_0x7002('0x3c')],_0x5d2829[_0x7002('0x3d')]),_0x4aaeee);var _0x200038=[];var _0x20ca09=squel[_0x7002('0x47')]()[_0x7002('0x48')]('id')[_0x7002('0x48')](_0x7002('0x2d'))['field'](_0x7002('0x49'))[_0x7002('0x4a')](_0x7002('0x4b'));var _0x51b2e4=squel[_0x7002('0x47')]()[_0x7002('0x48')](_0x7002('0x4c'))[_0x7002('0x48')](_0x7002('0x4d'))[_0x7002('0x48')](_0x7002('0x4e'))['from'](_0x7002('0x4f'),'ui')['left_join'](_0x7002('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x222081=squel[_0x7002('0x47')]()[_0x7002('0x4a')](_0x7002('0x51'),'i')[_0x7002('0x52')]('cm_contacts','c',_0x7002('0x53'))[_0x7002('0x52')](_0x7002('0x50'),'o',_0x7002('0x54'))[_0x7002('0x52')](_0x7002('0x55'),'a',_0x7002('0x56'))[_0x7002('0x52')](_0x7002('0x57'),'me',_0x7002('0x58'))[_0x7002('0x52')](_0x7002('0x59'),'it',_0x7002('0x5a'))[_0x7002('0x52')](_0x7002('0x4b'),'t',_0x7002('0x5b'));var _0x4f0c74=squel[_0x7002('0x5c')]();var _0x2ca36e=[];var _0x56a57e=squel['expr']();var _0x511f79;if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x5d')]){_0x511f79=as[_0x7002('0x5e')](_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x5d')]);var _0x216358=_0x511f79[_0x7002('0x5f')];for(var _0x5df4ac=0x0;_0x5df4ac<_0x511f79[_0x7002('0x60')]['length'];_0x5df4ac++){var _0x1b1ca6=_0x511f79[_0x7002('0x60')][_0x5df4ac];var _0x1e0cf0='i';var _0x272729=_['find'](_0x4aaeee,[_0x7002('0x2d'),_0x1b1ca6[_0x7002('0x48')]]);if(!_0x272729){switch(_0x1b1ca6[_0x7002('0x48')]){case _0x7002('0x61'):if(_0x1b1ca6[_0x7002('0x62')]==0x1){_0x222081[_0x7002('0x63')]('`'+_0x1b1ca6[_0x7002('0x48')]+'`\x20=\x200');}else{_0x222081[_0x7002('0x63')]('`'+_0x1b1ca6[_0x7002('0x48')]+_0x7002('0x64'));}break;case _0x7002('0x65'):if(_0x1b1ca6[_0x7002('0x66')]===_0x7002('0x67')){if(_0x1b1ca6['value']['split']('\x20')[_0x7002('0x41')]>0x1){_0x4f0c74[_0x216358](_0x7002('0x68'),qs[_0x7002('0x69')](_0x1b1ca6[_0x7002('0x62')]),null);}else{var _0x3ea379='%'+_0x1b1ca6['value']+'%';_0x4f0c74[_0x216358](_0x7002('0x6a'),_0x3ea379,_0x3ea379,_0x3ea379);}}else{_0x272729=_[_0x7002('0x6b')](_0x4aaeee,['name',_0x7002('0x6c')]);_0x1b1ca6[_0x7002('0x48')]=_0x7002('0x6c');_0x40060e=as['buildExpression'](_0x1e0cf0,_0x272729['type'],_0x1b1ca6);_0x4f0c74[_0x216358](_0x40060e['text'],_0x40060e[_0x7002('0x62')][_0x7002('0x6d')],_0x40060e[_0x7002('0x62')][_0x7002('0x21')]);}break;case _0x7002('0x6e'):var _0x52afe1=_0x1b1ca6[_0x7002('0x62')]['split'](',')[_0x7002('0x2f')](function(_0xef4927){return Number(_0xef4927);});_0x52afe1['forEach'](function(_0x4c6c68){_0x56a57e['or'](_0x7002('0x6f'),'%,'+_0x4c6c68+',%');});_0x2ca36e=_['union'](_0x2ca36e,_0x52afe1);break;case'User':if(_0x1b1ca6[_0x7002('0x66')]==='$substring'){_0x4f0c74[_0x216358](_0x7002('0x70'),'%'+_0x1b1ca6[_0x7002('0x62')]+'%',null);}else{_0x272729=_[_0x7002('0x6b')](_0x4aaeee,[_0x7002('0x2d'),_0x7002('0x71')]);_0x1b1ca6['field']=_0x7002('0x71');_0x40060e=as[_0x7002('0x72')](_0x1e0cf0,_0x272729[_0x7002('0x38')],_0x1b1ca6);_0x4f0c74[_0x216358](_0x40060e[_0x7002('0x73')],_0x40060e[_0x7002('0x62')][_0x7002('0x6d')],_0x40060e[_0x7002('0x62')][_0x7002('0x21')]);}break;case _0x7002('0x74'):_0x40060e=as[_0x7002('0x72')]('me',null,_0x1b1ca6);_0x4f0c74[_0x216358](_0x40060e['text'],_0x40060e[_0x7002('0x62')][_0x7002('0x6d')],_0x40060e['value'][_0x7002('0x21')]);break;}}else{var _0x40060e=as[_0x7002('0x72')](_0x1e0cf0,_0x272729['type'],_0x1b1ca6);_0x4f0c74[_0x216358](_0x40060e[_0x7002('0x73')],_0x40060e[_0x7002('0x62')][_0x7002('0x6d')],_0x40060e[_0x7002('0x62')][_0x7002('0x21')]);}}}else{var _0x122a10=_(_0x4f5bb1['query'])['keys']()[_0x7002('0x2f')](function(_0xa4f4c1){return _[_0x7002('0x75')](_0x4aaeee,['name',_0xa4f4c1])?_0xa4f4c1:undefined;})['compact']()[_0x7002('0x62')]();if(!_[_0x7002('0x76')](_0x122a10)){_0x122a10[_0x7002('0x33')](function(_0x310ca7){if(_0x310ca7===_0x7002('0x77')){_0x222081[_0x7002('0x45')](_0x7002('0x78'),[][_0x7002('0x79')](_0x4f5bb1[_0x7002('0x3c')][_0x310ca7]));}else if(_0x310ca7==='createdAt'){var _0x2b9805=JSON[_0x7002('0x7a')](_0x4f5bb1[_0x7002('0x3c')][_0x310ca7])[_0x7002('0x7b')];var _0x206b9e=JSON[_0x7002('0x7a')](_0x4f5bb1[_0x7002('0x3c')][_0x310ca7])[_0x7002('0x7c')];_0x222081[_0x7002('0x45')](_0x7002('0x7d'),_0x2b9805,_0x206b9e);}else{if(_0x4f5bb1[_0x7002('0x3c')][_0x310ca7]===_0x7002('0x7e')){_0x222081['where']('i.'+_0x310ca7+_0x7002('0x7f'));}else{_0x222081[_0x7002('0x45')]('i.'+_0x310ca7+'\x20=\x20?',_0x4f5bb1[_0x7002('0x3c')][_0x310ca7]);}}});}if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x80')]){if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x80')]==0x1){_0x222081[_0x7002('0x63')](_0x7002('0x81'));}else{_0x222081['having'](_0x7002('0x82'));}}if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x83')]){_0x2ca36e=_[_0x7002('0x84')](_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x83')])?_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x83')]:new Array(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x83')]);_0x2ca36e[_0x7002('0x33')](function(_0x5ae637){_0x56a57e['or'](_0x7002('0x6f'),'%,'+_0x5ae637+',%');});}if(_0x4f5bb1[_0x7002('0x3c')]['filter']){var _0x35c6f7=_0x4f5bb1[_0x7002('0x3c')]['filter'][_0x7002('0x85')]('\x5c','\x5c\x5c')[_0x7002('0x85')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x35c6f7)){_0x4f0c74['or'](_0x7002('0x86'),_0x35c6f7+'%');}else{_0x4f0c74['or'](_0x7002('0x87'),qs['getFullTextValue'](_0x35c6f7))['or'](_0x7002('0x88'),_0x35c6f7+'%')['or'](_0x7002('0x89'),_0x35c6f7+'%');}}}_0x222081['where'](_0x4f0c74);_0x222081[_0x7002('0x8a')](_0x7002('0x8b'));var _0x256025={'type':db['Sequelize'][_0x7002('0x8c')][_0x7002('0x8d')],'raw':!![]};var _0x2563ff=_0x222081[_0x7002('0x8e')]();_0x2563ff[_0x7002('0x48')](_0x7002('0x8b'));_0x2563ff['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7002('0x61'));if(_0x4e65a8[_0x7002('0x43')]){_0x4e65a8[_0x7002('0x43')]['forEach'](function(_0x55f053){var _0xbbc264=_0x55f053[0x0]===_0x7002('0x8f')?_0x55f053[0x0]:'i.'+_0x55f053[0x0];_0x222081[_0x7002('0x43')](_0xbbc264,_0x55f053[0x1]===_0x7002('0x90')?![]:!![]);});}if(!_[_0x7002('0x76')](_0x2ca36e)){_0x222081['having'](_0x56a57e);_0x2563ff[_0x7002('0x45')](_0x7002('0x91'),_0x2ca36e);}BPromise[_0x7002('0x92')]()[_0x7002('0x2b')](function(){if(!_0x511f79){if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x77')])return;_0x2563ff[_0x7002('0x45')](_0x7002('0x93'));_0x222081[_0x7002('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4f5bb1['user'][_0x7002('0x94')]!=='agent')return;return _0x4f5bb1[_0x7002('0x95')][_0x7002('0x96')]({'attributes':['id'],'raw':!![]})[_0x7002('0x2b')](function(_0x9dc051){if(_['isEmpty'](_0x9dc051)){_0x2563ff[_0x7002('0x45')](_0x7002('0x97'));_0x222081[_0x7002('0x45')](_0x7002('0x97'));}else{_0x2563ff['where'](_0x7002('0x78'),_[_0x7002('0x2f')](_0x9dc051,'id'));_0x222081['where'](_0x7002('0x78'),_[_0x7002('0x2f')](_0x9dc051,'id'));}});})[_0x7002('0x2b')](function(){if(_0x4f5bb1[_0x7002('0x95')][_0x7002('0x94')]===_0x7002('0x98')&&!_0x511f79&&!_0x4f5bb1[_0x7002('0x3c')]['OpenchannelAccountId'])return[];return db[_0x7002('0x99')]['query'](_0x2563ff['toString'](),_0x256025);})[_0x7002('0x2b')](function(_0x5f593e){_0x4c952a[_0x7002('0x26')]=_0x5f593e[_0x7002('0x41')];if(_0x4c952a[_0x7002('0x26')]===0x0)return[];return db[_0x7002('0x99')][_0x7002('0x3c')](_0x20ca09['toString'](),_0x256025)[_0x7002('0x2b')](function(_0x3f7e52){_0x200038=_[_0x7002('0x9a')](_0x3f7e52,'id');_0x256025=_[_0x7002('0x9b')](_0x256025,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f5bb1[_0x7002('0x3c')][_0x7002('0x40')]){_0x4e65a8[_0x7002('0x3f')][_0x7002('0x33')](function(_0x4bf9bd){_0x222081[_0x7002('0x48')]('i.'+_0x4bf9bd);});}else{_0x222081[_0x7002('0x48')](_0x7002('0x9c'),_0x7002('0x61'));_0x222081[_0x7002('0x48')](_0x7002('0x9d'),_0x7002('0x9e'));_0x222081['field'](_0x7002('0x9f'),'Account.mandatoryDisposition');_0x222081[_0x7002('0x48')](_0x7002('0xa0'),_0x7002('0x8f'));_0x222081[_0x7002('0x48')](_0x7002('0xa1'));_0x222081[_0x7002('0x48')]('c.firstName','Contact.firstName');_0x222081[_0x7002('0x48')](_0x7002('0xa2'),_0x7002('0xa3'));_0x222081[_0x7002('0x48')](_0x7002('0xa4'),_0x7002('0xa5'));_0x222081['field'](_0x7002('0xa6'),_0x7002('0xa7'));_0x222081[_0x7002('0x48')](_0x7002('0xa8'),_0x7002('0xa9'));_0x222081['field']('c.fax',_0x7002('0xaa'));_0x222081[_0x7002('0x48')](_0x7002('0xab'),_0x7002('0xac'));_0x222081[_0x7002('0x48')](_0x7002('0xad'),_0x7002('0xae'));_0x222081[_0x7002('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4e65a8[_0x7002('0x25')])_0x222081['limit'](_0x4e65a8[_0x7002('0x25')]);if(_0x4e65a8['offset'])_0x222081[_0x7002('0x23')](_0x4e65a8[_0x7002('0x23')]);return db[_0x7002('0x99')][_0x7002('0x3c')](_0x222081[_0x7002('0xaf')](),_0x256025);})[_0x7002('0x2b')](function(_0x2424e0){if(_0x2424e0[_0x7002('0x41')]>0x0)_0x51b2e4[_0x7002('0x45')](_0x7002('0xb0'),_[_0x7002('0x2f')](_0x2424e0,'id'));return db['sequelize'][_0x7002('0x3c')](_0x51b2e4[_0x7002('0xaf')](),_0x256025)['then'](function(_0x1b42f2){var _0x1944c8=_['groupBy'](_0x1b42f2,_0x7002('0xb1'));var _0x1f07f8=[];_0x2424e0[_0x7002('0x33')](function(_0x439007){_0x1f07f8['push'](updateOpenchannelInteraction(_0x439007,_0x200038,_0x1944c8));});return BPromise[_0x7002('0xb2')](_0x1f07f8);});});})[_0x7002('0x2b')](function(_0x39739d){_0x4c952a[_0x7002('0xb3')]=_0x39739d;return _0x4c952a;})[_0x7002('0x2b')](respondWithFilteredResult(_0x3cdc03,_0x4e65a8))[_0x7002('0x35')](handleError(_0x3cdc03,null));};exports['show']=function(_0x44dc2d,_0x4cb4a7){var _0x17d3ec={};if(_0x44dc2d[_0x7002('0x3c')]['type']&&_0x44dc2d[_0x7002('0x3c')][_0x7002('0x38')]===_0x7002('0x4a')){_0x17d3ec[_0x7002('0x4a')]=_0x44dc2d[_0x7002('0xb4')]['id'];}else{_0x17d3ec['id']=_0x44dc2d[_0x7002('0xb4')]['id'];}var _0x3bcf83={'raw':![],'where':_0x17d3ec},_0x129ffa={};_0x129ffa[_0x7002('0x3a')]=_[_0x7002('0x3b')](db['OpenchannelInteraction'][_0x7002('0xb5')]);_0x129ffa[_0x7002('0x3c')]=_[_0x7002('0x3b')](_0x44dc2d[_0x7002('0x3c')]);_0x129ffa[_0x7002('0x3d')]=_['intersection'](_0x129ffa[_0x7002('0x3a')],_0x129ffa[_0x7002('0x3c')]);_0x3bcf83[_0x7002('0x3f')]=_['intersection'](_0x129ffa[_0x7002('0x3a')],qs['fields'](_0x44dc2d['query'][_0x7002('0x40')]));_0x3bcf83[_0x7002('0x3f')]=_0x3bcf83[_0x7002('0x3f')]['length']?_0x3bcf83['attributes']:_0x129ffa[_0x7002('0x3a')];if(_0x44dc2d[_0x7002('0x3c')][_0x7002('0xb6')]){_0x3bcf83[_0x7002('0xb7')]=[{'all':!![]}];}_0x3bcf83=_[_0x7002('0x9b')]({},_0x3bcf83,_0x44dc2d[_0x7002('0xb8')]);return db[_0x7002('0xb9')][_0x7002('0x6b')](_0x3bcf83)['then'](handleEntityNotFound(_0x4cb4a7,null))[_0x7002('0x2b')](respondWithResult(_0x4cb4a7,null))[_0x7002('0x35')](handleError(_0x4cb4a7,null));};exports[_0x7002('0xba')]=function(_0x1db3da,_0x26f68b){return db[_0x7002('0xb9')][_0x7002('0xba')](_0x1db3da['body'],{})['then'](respondWithResult(_0x26f68b,0xc9))['catch'](handleError(_0x26f68b,null));};exports[_0x7002('0xbb')]=function(_0x7a0685,_0x54ccd1){if(_0x7a0685[_0x7002('0x74')]['id']){delete _0x7a0685['body']['id'];}return db['OpenchannelInteraction'][_0x7002('0x6b')]({'where':{'id':_0x7a0685['params']['id']}})[_0x7002('0x2b')](handleEntityNotFound(_0x54ccd1,null))['then'](saveUpdates(_0x7a0685[_0x7002('0x74')],null))[_0x7002('0x2b')](respondWithResult(_0x54ccd1,null))['catch'](handleError(_0x54ccd1,null));};exports[_0x7002('0xbc')]=function(_0x499662,_0x3a940d){return db[_0x7002('0xb9')][_0x7002('0x6b')]({'where':{'id':_0x499662[_0x7002('0xb4')]['id']}})[_0x7002('0x2b')](handleEntityNotFound(_0x3a940d,null))[_0x7002('0x2b')](removeEntity(_0x3a940d,null))[_0x7002('0x35')](handleError(_0x3a940d,null));};exports[_0x7002('0xbd')]=function(_0x4e40a5,_0x3de2ef){return db['OpenchannelInteraction']['describe']()[_0x7002('0x2b')](respondWithResult(_0x3de2ef,null))[_0x7002('0x35')](handleError(_0x3de2ef,null));};exports[_0x7002('0xbe')]=function(_0x2fb10e,_0x3c080e,_0x3edc1c){return db[_0x7002('0xbf')][_0x7002('0x6b')]({'where':{'id':_0x2fb10e['params']['id']}})['then'](handleEntityNotFound(_0x3c080e,null))[_0x7002('0x2b')](function(_0x1d48c9){if(_0x1d48c9){return _0x1d48c9[_0x7002('0xbe')](_0x2fb10e['body'][_0x7002('0xc0')],_[_0x7002('0xc1')](_0x2fb10e['body'],[_0x7002('0xc0'),'id'])||{});}})[_0x7002('0x2b')](respondWithResult(_0x3c080e,null))[_0x7002('0x35')](handleError(_0x3c080e,null));};exports[_0x7002('0xc2')]=function(_0x1b797c,_0x13114e,_0x56b16a){var _0x3d1f4e={'raw':![],'where':{}};var _0x19ad01={};var _0x111e61={'count':0x0,'rows':[]};return db[_0x7002('0xb9')][_0x7002('0xc3')]({'where':{'id':_0x1b797c[_0x7002('0xb4')]['id']}})[_0x7002('0x2b')](handleEntityNotFound(_0x13114e,null))['then'](function(_0x3df8d3){if(_0x3df8d3){_0x19ad01[_0x7002('0x3a')]=_[_0x7002('0x3b')](db[_0x7002('0xbf')][_0x7002('0xb5')]);_0x19ad01['query']=_[_0x7002('0x3b')](_0x1b797c[_0x7002('0x3c')]);_0x19ad01[_0x7002('0x3d')]=_['intersection'](_0x19ad01[_0x7002('0x3a')],_0x19ad01[_0x7002('0x3c')]);_0x3d1f4e[_0x7002('0x3f')]=_['intersection'](_0x19ad01[_0x7002('0x3a')],qs[_0x7002('0x40')](_0x1b797c[_0x7002('0x3c')][_0x7002('0x40')]));_0x3d1f4e['attributes']=_0x3d1f4e[_0x7002('0x3f')][_0x7002('0x41')]?_0x3d1f4e['attributes']:_0x19ad01[_0x7002('0x3a')];if(!_0x1b797c[_0x7002('0x3c')][_0x7002('0xc4')]('nolimit')){_0x3d1f4e[_0x7002('0x25')]=qs[_0x7002('0x25')](_0x1b797c[_0x7002('0x3c')]['limit']);_0x3d1f4e[_0x7002('0x23')]=qs[_0x7002('0x23')](_0x1b797c[_0x7002('0x3c')]['offset']);}_0x3d1f4e[_0x7002('0x43')]=qs[_0x7002('0x44')](_0x1b797c[_0x7002('0x3c')]['sort']);_0x3d1f4e[_0x7002('0x45')]=qs['filters'](_['pick'](_0x1b797c[_0x7002('0x3c')],_0x19ad01[_0x7002('0x3d')]));_0x3d1f4e[_0x7002('0x45')][_0x7002('0xb1')]=_0x3df8d3['id'];if(_0x1b797c[_0x7002('0x3c')][_0x7002('0xc5')]){_0x3d1f4e[_0x7002('0x45')]=_[_0x7002('0x9b')](_0x3d1f4e[_0x7002('0x45')],{'$or':_['map'](_0x3d1f4e[_0x7002('0x3f')],function(_0x3c7276){var _0x5ae63d={};_0x5ae63d[_0x3c7276]={'$like':'%'+_0x1b797c['query'][_0x7002('0xc5')]+'%'};return _0x5ae63d;})});}if(_0x1b797c[_0x7002('0x3c')][_0x7002('0x7b')]){var _0x52ab5a=_0x1b797c[_0x7002('0x3c')][_0x7002('0x7b')][_0x7002('0x32')](',');var _0x4f9676={};_0x4f9676[_0x52ab5a[0x0]]={'$gte':moment(_0x52ab5a[0x1])[_0x7002('0xc6')](_0x7002('0xc7'))};_0x3d1f4e[_0x7002('0x45')]=_[_0x7002('0x9b')](_0x3d1f4e['where'],_0x4f9676);}_0x3d1f4e=_[_0x7002('0x9b')]({},_0x3d1f4e,_0x1b797c[_0x7002('0xb8')]);return db['OpenchannelMessage'][_0x7002('0x26')]({'where':_0x3d1f4e['where']})['then'](function(_0x3c1b5b){_0x111e61[_0x7002('0x26')]=_0x3c1b5b;if(_0x1b797c[_0x7002('0x3c')][_0x7002('0xb6')]){_0x3d1f4e[_0x7002('0xb7')]=[{'all':!![]}];}return db[_0x7002('0xbf')][_0x7002('0xc8')](_0x3d1f4e);})['then'](function(_0x30c4d2){_0x111e61[_0x7002('0xb3')]=_0x30c4d2;return _0x111e61;});}})['then'](respondWithFilteredResult(_0x13114e,_0x3d1f4e))[_0x7002('0x35')](handleError(_0x13114e,null));};exports[_0x7002('0xc9')]=function(_0x2dd81a,_0x193e0c,_0x4977a4){return db[_0x7002('0xb9')][_0x7002('0x6b')]({'where':{'id':_0x2dd81a[_0x7002('0xb4')]['id']}})['then'](handleEntityNotFound(_0x193e0c,null))[_0x7002('0x2b')](function(_0x954e9d){if(_0x954e9d){return _0x954e9d[_0x7002('0xca')](_0x2dd81a['body'][_0x7002('0xc0')],_['omit'](_0x2dd81a[_0x7002('0x74')],[_0x7002('0xc0'),'id'])||{})[_0x7002('0xcb')](function(){return db[_0x7002('0x6e')][_0x7002('0xc8')]({'attributes':['id','name',_0x7002('0x49')],'where':{'id':_0x2dd81a[_0x7002('0x74')][_0x7002('0xc0')]}});})[_0x7002('0x2b')](function(_0x5705a5){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x2dd81a[_0x7002('0xb4')]['id']),'tags':_0x5705a5||[]});return{'id':Number(_0x2dd81a['params']['id']),'tags':_0x5705a5||[]};});}})[_0x7002('0x2b')](respondWithResult(_0x193e0c,null))[_0x7002('0x35')](handleError(_0x193e0c,null));};exports[_0x7002('0xcc')]=function(_0x455d24,_0x20be7d,_0x17ab97){return db['OpenchannelInteraction'][_0x7002('0x6b')]({'where':{'id':_0x455d24[_0x7002('0xb4')]['id']}})[_0x7002('0x2b')](handleEntityNotFound(_0x20be7d,null))[_0x7002('0x2b')](function(_0x2a0f74){if(_0x2a0f74){return _0x2a0f74[_0x7002('0xcc')](_0x455d24[_0x7002('0x3c')][_0x7002('0xc0')]);}})[_0x7002('0x2b')](respondWithStatusCode(_0x20be7d,null))[_0x7002('0x35')](handleError(_0x20be7d,null));};exports[_0x7002('0xcd')]=function(_0x2d7724,_0x4b2364){var _0x65c579=moment()[_0x7002('0xce')]()[_0x7002('0xaf')]();var _0x3fb6b7=path['join'](config[_0x7002('0xcf')],'server','files','tmp');var _0x113504=path['join'](config['root'],'server','files',_0x7002('0xd0'));var _0x30af74=path['join'](_0x3fb6b7,_0x65c579);var _0x417d5b=util[_0x7002('0xc6')](_0x7002('0xd1'),_0x2d7724[_0x7002('0xb4')]['id'],_0x65c579);var _0x10b9f9=path['join'](_0x3fb6b7,_0x417d5b);var _0x470299=[];_0x470299[_0x7002('0xd2')]({'model':db[_0x7002('0xd3')],'as':_0x7002('0xd3'),'attributes':['id',_0x7002('0x30')],'raw':!![]});_0x470299[_0x7002('0xd2')]({'model':db[_0x7002('0xd4')],'as':_0x7002('0x65'),'attributes':['id','firstName',_0x7002('0xd5')],'raw':!![]});if(_0x2d7724[_0x7002('0x3c')][_0x7002('0xd0')]){_0x470299['push']({'model':db['Attachment'],'as':_0x7002('0xd6'),'raw':!![]});}var _0x22cad8=[{'model':db[_0x7002('0xbf')],'as':_0x7002('0xd7'),'attributes':['id',_0x7002('0x74'),_0x7002('0xd8'),_0x7002('0xd9'),'secret',_0x7002('0x80')],'include':_0x470299}];_0x22cad8['push']({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x22cad8[_0x7002('0xd2')]({'model':db[_0x7002('0xd3')],'as':_0x7002('0xda'),'attributes':['id',_0x7002('0x30')]});return db['OpenchannelInteraction'][_0x7002('0x6b')]({'where':{'id':_0x2d7724['params']['id']},'include':_0x22cad8})[_0x7002('0x2b')](handleEntityNotFound(_0x4b2364,null))[_0x7002('0x2b')](function(_0xe548cc){if(_0xe548cc){var _0x93b647=_0xe548cc['get']({'plain':!![]});fs[_0x7002('0xdb')](_0x30af74);var _0x165d6a={'channel':_0x7002('0xdc'),'account':_0x93b647[_0x7002('0xdd')]['name'],'agent':_0x93b647[_0x7002('0xda')]?_0x93b647[_0x7002('0xda')][_0x7002('0x30')]:_0x7002('0xde'),'createdAt':moment(_0x93b647['createdAt'])[_0x7002('0xc6')](_0x7002('0xc7'))['toString'](),'closedAt':_0x93b647[_0x7002('0xdf')]?moment(_0x93b647['closedAt'])[_0x7002('0xc6')](_0x7002('0xc7'))[_0x7002('0xaf')]():'','disposition':_0x93b647[_0x7002('0xe0')],'visibility':_0x93b647[_0x7002('0xe1')]?_0x7002('0xe2'):'Private','messages':_(_0x93b647[_0x7002('0xd7')])[_0x7002('0xc5')]({'secret':![]})[_0x7002('0x2f')](function(_0x3bbfc7){if(_0x3bbfc7['Attachment']){var _0x5660ca=path[_0x7002('0xe3')](_0x113504,_0x3bbfc7[_0x7002('0xd6')][_0x7002('0xe4')]);if(fs['existsSync'](_0x5660ca)){fs[_0x7002('0xe5')](_0x5660ca)[_0x7002('0xe6')](fs[_0x7002('0xe7')](path['join'](_0x30af74,_0x3bbfc7[_0x7002('0xd6')][_0x7002('0xe4')])));}}return{'date':moment(_0x3bbfc7[_0x7002('0xd8')])['format'](_0x7002('0xc7'))[_0x7002('0xaf')](),'sender':_0x3bbfc7[_0x7002('0xd9')]===_0x7002('0xe8')?_0x3bbfc7[_0x7002('0xd3')]?_0x3bbfc7[_0x7002('0xd3')][_0x7002('0x30')]:'System':_0x3bbfc7[_0x7002('0x65')][_0x7002('0xe9')]+(_0x3bbfc7[_0x7002('0x65')][_0x7002('0xd5')]?'\x20'+_0x3bbfc7[_0x7002('0x65')]['lastName']:''),'body':_0x3bbfc7[_0x7002('0xd6')]?_0x3bbfc7['Attachment'][_0x7002('0xe4')]:_0x3bbfc7['body'],'direction':_0x3bbfc7[_0x7002('0xd9')]===_0x7002('0xe8')?'A':'C','secret':_0x3bbfc7[_0x7002('0xea')],'read':_0x3bbfc7['read'],'attachment':_0x3bbfc7['Attachment']};})[_0x7002('0x62')]()};return ejs[_0x7002('0xeb')](path[_0x7002('0xe3')](config[_0x7002('0xcf')],_0x7002('0xec'),_0x7002('0xed'),_0x7002('0xee')),{'interaction':_0x165d6a})[_0x7002('0x2b')](function(_0x515d00){var _0xef65ea=path[_0x7002('0xe3')](_0x30af74,_0x7002('0xef')+_0x93b647['id']+'-'+_0x65c579+_0x7002('0xf0'));var _0x2c7c2f={'path':_0xef65ea,'channel':_0x7002('0xdc'),'interactionId':_0x93b647['id']};return pdf[_0x7002('0xf1')](_0x515d00,_0x2c7c2f);})['then'](function(){return new BPromise(function(_0x590b59,_0x32ff47){zipdir(_0x30af74,{'saveTo':_0x10b9f9},function(_0x131558,_0x96a11){if(_0x131558)return _0x32ff47(_0x131558);return _0x590b59(_0x96a11);});})[_0x7002('0x2b')](function(){return new BPromise(function(_0x775b0,_0xa3e57a){rimraf(_0x30af74,function(_0x3fa0df){if(_0x3fa0df)_0xa3e57a(_0x3fa0df);return _0x775b0();});});})['then'](function(){return _0x4b2364[_0x7002('0xcd')](_0x10b9f9,_0x417d5b,function(_0x5a1a5d){if(_0x5a1a5d){console['log'](_0x7002('0xf2'),_0x5a1a5d);}else{fs[_0x7002('0xf3')](_0x10b9f9);}});});});}else{return _0x4b2364[_0x7002('0x1f')](0xc8);}})[_0x7002('0x35')](handleError(_0x4b2364,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4cdad9a..a7ca5a3 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 _0xd12b=['Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','remove','getUsers','then','setDataValue'];(function(_0x5d1f51,_0x4a9b43){var _0x2a3aef=function(_0x4aeae7){while(--_0x4aeae7){_0x5d1f51['push'](_0x5d1f51['shift']());}};_0x2a3aef(++_0x4a9b43);}(_0xd12b,0x6e));var _0xbd12=function(_0x2da402,_0x14a691){_0x2da402=_0x2da402-0x0;var _0x31a57d=_0xd12b[_0x2da402];return _0x31a57d;};'use strict';var EventEmitter=require(_0xbd12('0x0'));var OpenchannelInteraction=require(_0xbd12('0x1'))['db'][_0xbd12('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xbd12('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd12('0x4'),'afterUpdate':'update','afterDestroy':_0xbd12('0x5')};function emitEvent(_0x416fcd){return function(_0x54bc42,_0x1aa359,_0x55aa86){_0x54bc42[_0xbd12('0x6')]({'attributes':['id'],'raw':!![]})[_0xbd12('0x7')](function(_0x4c2903){_0x54bc42[_0xbd12('0x8')](_0xbd12('0x9'),_0x4c2903['map'](function(_0x47df32){return{'id':_0x47df32['id']};}));return OpenchannelMessage[_0xbd12('0xa')]({'where':{'OpenchannelInteractionId':_0x54bc42['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x556d6d){_0x54bc42[_0xbd12('0x8')](_0xbd12('0xb'),_0x556d6d['length']);OpenchannelInteractionEvents['emit'](_0x416fcd+':'+_0x54bc42['id'],_0x54bc42);OpenchannelInteractionEvents[_0xbd12('0xc')](_0x416fcd,_0x54bc42);_0x55aa86(null);})[_0xbd12('0xd')](_0x55aa86(null));};}for(var e in events){if(events[_0xbd12('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xbd12('0xf')](e,emitEvent(event));}}module[_0xbd12('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6895=['catch','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6895,0x113));var _0x5689=function(_0x31cc50,_0x169b78){_0x31cc50=_0x31cc50-0x0;var _0x421e15=_0x6895[_0x31cc50];return _0x421e15;};'use strict';var EventEmitter=require(_0x5689('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x5689('0x1'))['db'][_0x5689('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x5689('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5689('0x4'),'afterDestroy':_0x5689('0x5')};function emitEvent(_0x29adf3){return function(_0x42394b,_0x50e947,_0x145969){_0x42394b[_0x5689('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x419fbb){_0x42394b[_0x5689('0x7')](_0x5689('0x8'),_0x419fbb[_0x5689('0x9')](function(_0x203017){return{'id':_0x203017['id']};}));return OpenchannelMessage[_0x5689('0xa')]({'where':{'OpenchannelInteractionId':_0x42394b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f3caf){_0x42394b[_0x5689('0x7')](_0x5689('0xb'),_0x3f3caf['length']);OpenchannelInteractionEvents[_0x5689('0xc')](_0x29adf3+':'+_0x42394b['id'],_0x42394b);OpenchannelInteractionEvents[_0x5689('0xc')](_0x29adf3,_0x42394b);_0x145969(null);})[_0x5689('0xd')](_0x145969(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x5689('0xe')](e,emitEvent(event));}}module[_0x5689('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 0e7085a..dca9521 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 _0x4658=['openchannel_interactions','utf8mb4','closed','closedAt','format','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x5ea1a6,_0x36ce42){var _0xa38b8=function(_0x1844c6){while(--_0x1844c6){_0x5ea1a6['push'](_0x5ea1a6['shift']());}};_0xa38b8(++_0x36ce42);}(_0x4658,0x145));var _0x8465=function(_0x1742c7,_0x17a5d7){_0x1742c7=_0x1742c7-0x0;var _0x36861e=_0x4658[_0x1742c7];return _0x36861e;};'use strict';var _=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var logger=require(_0x8465('0x2'))('api');var moment=require(_0x8465('0x3'));var BPromise=require('bluebird');var rp=require(_0x8465('0x4'));var fs=require('fs');var path=require(_0x8465('0x5'));var rimraf=require(_0x8465('0x6'));var config=require(_0x8465('0x7'));var attributes=require(_0x8465('0x8'));module[_0x8465('0x9')]=function(_0x4d56cc,_0x3da4c8){return _0x4d56cc[_0x8465('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x8465('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8465('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3b1dc7,_0x5c4619,_0x5e0a94){if(_0x3b1dc7['changed'](_0x8465('0xd'))){_0x3b1dc7[_0x8465('0xe')]=moment()[_0x8465('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e0a94(null,_0x3b1dc7);}}});}; \ No newline at end of file +var _0x2c98=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed'];(function(_0x4be61d,_0x1c0d15){var _0x136586=function(_0x5a4793){while(--_0x5a4793){_0x4be61d['push'](_0x4be61d['shift']());}};_0x136586(++_0x1c0d15);}(_0x2c98,0xac));var _0x82c9=function(_0x4dc9d4,_0x416752){_0x4dc9d4=_0x4dc9d4-0x0;var _0x4f4fdb=_0x2c98[_0x4dc9d4];return _0x4f4fdb;};'use strict';var _=require(_0x82c9('0x0'));var util=require(_0x82c9('0x1'));var logger=require(_0x82c9('0x2'))(_0x82c9('0x3'));var moment=require(_0x82c9('0x4'));var BPromise=require(_0x82c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82c9('0x6'));var config=require(_0x82c9('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x82c9('0x8')]=function(_0x48e6be,_0x5da126){return _0x48e6be[_0x82c9('0x9')](_0x82c9('0xa'),attributes,{'tableName':_0x82c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82c9('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x41d450,_0x3cccd4,_0x2be35e){if(_0x41d450[_0x82c9('0xd')](_0x82c9('0xe'))){_0x41d450['closedAt']=moment()[_0x82c9('0xf')](_0x82c9('0x10'));}_0x2be35e(null,_0x41d450);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index dc4fac7..eabc992 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 _0xfee4=['where','attributes','limit','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw'];(function(_0xc2c0c3,_0x2bf8a9){var _0x292acf=function(_0x192b73){while(--_0x192b73){_0xc2c0c3['push'](_0xc2c0c3['shift']());}};_0x292acf(++_0x2bf8a9);}(_0xfee4,0x13e));var _0x4fee=function(_0x17842d,_0x2d0235){_0x17842d=_0x17842d-0x0;var _0x439585=_0xfee4[_0x17842d];return _0x439585;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fee('0x0'));var BPromise=require(_0x4fee('0x1'));var rs=require(_0x4fee('0x2'));var fs=require('fs');var Redis=require(_0x4fee('0x3'));var db=require(_0x4fee('0x4'))['db'];var utils=require(_0x4fee('0x5'));var logger=require(_0x4fee('0x6'))(_0x4fee('0x7'));var config=require('../../config/environment');var jayson=require(_0x4fee('0x8'));var client=jayson['client'][_0x4fee('0x9')]({'port':0x232a});config[_0x4fee('0xa')]=_[_0x4fee('0xb')](config[_0x4fee('0xa')],{'host':_0x4fee('0xc'),'port':0x18eb});var socket=require(_0x4fee('0xd'))(new Redis(config['redis']));require(_0x4fee('0xe'))[_0x4fee('0xf')](socket);function respondWithRpcPromise(_0x114269,_0x197f96,_0x13ab8e){return new BPromise(function(_0x5a9f0f,_0x5356c1){return client[_0x4fee('0x10')](_0x114269,_0x13ab8e)[_0x4fee('0x11')](function(_0x57a9ca){logger[_0x4fee('0x12')](_0x4fee('0x13'),_0x197f96,_0x4fee('0x14'));logger[_0x4fee('0x15')](_0x4fee('0x16'),_0x197f96,_0x4fee('0x14'),JSON[_0x4fee('0x17')](_0x57a9ca));if(_0x57a9ca[_0x4fee('0x18')]){if(_0x57a9ca[_0x4fee('0x18')][_0x4fee('0x19')]===0x1f4){logger[_0x4fee('0x18')](_0x4fee('0x13'),_0x197f96,_0x57a9ca[_0x4fee('0x18')][_0x4fee('0x1a')]);return _0x5356c1(_0x57a9ca[_0x4fee('0x18')][_0x4fee('0x1a')]);}logger[_0x4fee('0x18')](_0x4fee('0x13'),_0x197f96,_0x57a9ca[_0x4fee('0x18')][_0x4fee('0x1a')]);return _0x5a9f0f(_0x57a9ca[_0x4fee('0x18')]['message']);}else{logger[_0x4fee('0x12')](_0x4fee('0x13'),_0x197f96,'request\x20sent');_0x5a9f0f(_0x57a9ca[_0x4fee('0x1b')][_0x4fee('0x1a')]);}})['catch'](function(_0x49dd0e){logger[_0x4fee('0x18')](_0x4fee('0x13'),_0x197f96,_0x49dd0e);_0x5356c1(_0x49dd0e);});});}exports[_0x4fee('0x1c')]=function(_0x1d33e7){var _0x360d55=this;return new Promise(function(_0x130637,_0x1d90d9){return db[_0x4fee('0x1d')][_0x4fee('0x1e')](_0x1d33e7[_0x4fee('0x1f')],{'raw':_0x1d33e7[_0x4fee('0x20')]?_0x1d33e7[_0x4fee('0x20')][_0x4fee('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d33e7[_0x4fee('0x20')]?_0x1d33e7['options'][_0x4fee('0x22')]||null:null,'attributes':_0x1d33e7[_0x4fee('0x20')]?_0x1d33e7[_0x4fee('0x20')][_0x4fee('0x23')]||null:null,'limit':_0x1d33e7[_0x4fee('0x20')]?_0x1d33e7[_0x4fee('0x20')][_0x4fee('0x24')]||null:null})[_0x4fee('0x11')](function(_0xb3d89b){logger[_0x4fee('0x12')](_0x4fee('0x1c'),_0x1d33e7);logger['debug']('UpdateOpenchannelInteraction',_0x1d33e7,JSON['stringify'](_0xb3d89b));_0x130637(_0xb3d89b);})[_0x4fee('0x25')](function(_0x39534a){logger[_0x4fee('0x18')](_0x4fee('0x1c'),_0x39534a['message'],_0x1d33e7);_0x1d90d9(_0x360d55[_0x4fee('0x18')](0x1f4,_0x39534a['message']));});});};exports[_0x4fee('0x26')]=function(_0x37ce69){return new Promise(function(_0x45314a,_0x25befe){return db[_0x4fee('0x1d')][_0x4fee('0x27')]({'where':_0x37ce69['options']?_0x37ce69[_0x4fee('0x20')][_0x4fee('0x22')]||null:null})[_0x4fee('0x11')](function(_0xc55086){if(_0xc55086){return _0xc55086[_0x4fee('0x28')](_0x37ce69[_0x4fee('0x1f')][_0x4fee('0x29')],_['omit'](_0x37ce69[_0x4fee('0x1f')],[_0x4fee('0x29'),'id'])||{});}})[_0x4fee('0x2a')](function(_0x54515a){logger['info']('AddTags',_0x37ce69);logger[_0x4fee('0x15')](_0x4fee('0x2b'),_0x37ce69,JSON[_0x4fee('0x17')](_0x54515a));_0x45314a(_0x54515a);})[_0x4fee('0x25')](function(_0x1c2a4d){logger[_0x4fee('0x18')](_0x4fee('0x2b'),_0x1c2a4d[_0x4fee('0x1a')],_0x37ce69);_0x25befe(_this[_0x4fee('0x18')](0x1f4,_0x1c2a4d['message']));});});}; \ No newline at end of file +var _0x909b=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','request\x20sent','stringify','code','error','message','OpenchannelInteraction,\x20%s,\x20%s','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','raw','options','where','debug','AddTagsToOpenchannelInteraction','ids','omit','spread','lodash','util','moment','bluebird'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x909b,0x114));var _0xb909=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x909b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb909('0x0'));var util=require(_0xb909('0x1'));var moment=require(_0xb909('0x2'));var BPromise=require(_0xb909('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb909('0x4'));var db=require(_0xb909('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb909('0x6'))(_0xb909('0x7'));var config=require(_0xb909('0x8'));var jayson=require(_0xb909('0x9'));var client=jayson[_0xb909('0xa')][_0xb909('0xb')]({'port':0x232a});config[_0xb909('0xc')]=_[_0xb909('0xd')](config[_0xb909('0xc')],{'host':_0xb909('0xe'),'port':0x18eb});var socket=require(_0xb909('0xf'))(new Redis(config['redis']));require(_0xb909('0x10'))[_0xb909('0x11')](socket);function respondWithRpcPromise(_0x344bc3,_0x21a2c8,_0x777eb3){return new BPromise(function(_0x15994b,_0x565f98){return client[_0xb909('0x12')](_0x344bc3,_0x777eb3)[_0xb909('0x13')](function(_0x281e3c){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x21a2c8,_0xb909('0x14'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x21a2c8,_0xb909('0x14'),JSON[_0xb909('0x15')](_0x281e3c));if(_0x281e3c['error']){if(_0x281e3c['error'][_0xb909('0x16')]===0x1f4){logger[_0xb909('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x21a2c8,_0x281e3c[_0xb909('0x17')][_0xb909('0x18')]);return _0x565f98(_0x281e3c[_0xb909('0x17')][_0xb909('0x18')]);}logger[_0xb909('0x17')](_0xb909('0x19'),_0x21a2c8,_0x281e3c[_0xb909('0x17')][_0xb909('0x18')]);return _0x15994b(_0x281e3c[_0xb909('0x17')][_0xb909('0x18')]);}else{logger[_0xb909('0x1a')](_0xb909('0x19'),_0x21a2c8,_0xb909('0x14'));_0x15994b(_0x281e3c[_0xb909('0x1b')][_0xb909('0x18')]);}})[_0xb909('0x1c')](function(_0x1a36a1){logger['error'](_0xb909('0x19'),_0x21a2c8,_0x1a36a1);_0x565f98(_0x1a36a1);});});}exports[_0xb909('0x1d')]=function(_0x13b12e){var _0x53835c=this;return new Promise(function(_0x36e23d,_0x4ddad8){return db[_0xb909('0x1e')]['update'](_0x13b12e[_0xb909('0x1f')],{'raw':_0x13b12e['options']?_0x13b12e['options'][_0xb909('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b12e[_0xb909('0x21')]?_0x13b12e['options'][_0xb909('0x22')]||null:null,'attributes':_0x13b12e['options']?_0x13b12e['options']['attributes']||null:null,'limit':_0x13b12e[_0xb909('0x21')]?_0x13b12e[_0xb909('0x21')]['limit']||null:null})[_0xb909('0x13')](function(_0x1f6dc4){logger[_0xb909('0x1a')](_0xb909('0x1d'),_0x13b12e);logger[_0xb909('0x23')]('UpdateOpenchannelInteraction',_0x13b12e,JSON[_0xb909('0x15')](_0x1f6dc4));_0x36e23d(_0x1f6dc4);})[_0xb909('0x1c')](function(_0x4c85f9){logger['error'](_0xb909('0x1d'),_0x4c85f9[_0xb909('0x18')],_0x13b12e);_0x4ddad8(_0x53835c['error'](0x1f4,_0x4c85f9[_0xb909('0x18')]));});});};exports[_0xb909('0x24')]=function(_0x239eff){return new Promise(function(_0x397e95,_0x11f84f){return db[_0xb909('0x1e')]['find']({'where':_0x239eff[_0xb909('0x21')]?_0x239eff[_0xb909('0x21')][_0xb909('0x22')]||null:null})['then'](function(_0x50b5a3){if(_0x50b5a3){return _0x50b5a3['addTags'](_0x239eff[_0xb909('0x1f')][_0xb909('0x25')],_[_0xb909('0x26')](_0x239eff['body'],[_0xb909('0x25'),'id'])||{});}})[_0xb909('0x27')](function(_0x37c531){logger[_0xb909('0x1a')]('AddTags',_0x239eff);logger[_0xb909('0x23')]('AddTags',_0x239eff,JSON[_0xb909('0x15')](_0x37c531));_0x397e95(_0x37c531);})['catch'](function(_0x16822e){logger[_0xb909('0x17')]('AddTags',_0x16822e[_0xb909('0x18')],_0x239eff);_0x11f84f(_this[_0xb909('0x17')](0x1f4,_0x16822e[_0xb909('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c568f76..d3bf6bb 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 _0x6dcd=['remove','emit','removeListener','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x5a70fc,_0x242706){var _0x4fa90f=function(_0x270780){while(--_0x270780){_0x5a70fc['push'](_0x5a70fc['shift']());}};_0x4fa90f(++_0x242706);}(_0x6dcd,0xb8));var _0xd6dc=function(_0x48181d,_0x45471c){_0x48181d=_0x48181d-0x0;var _0x595482=_0x6dcd[_0x48181d];return _0x595482;};'use strict';var OpenchannelInteractionEvents=require(_0xd6dc('0x0'));var events=[_0xd6dc('0x1'),_0xd6dc('0x2'),'update'];function createListener(_0x988c6c,_0xde83f2){return function(_0x117843){_0xde83f2[_0xd6dc('0x3')](_0x988c6c,_0x117843);};}function removeListener(_0x957516,_0xdb38d6){return function(){OpenchannelInteractionEvents[_0xd6dc('0x4')](_0x957516,_0xdb38d6);};}exports['register']=function(_0x39b2bc){for(var _0x209f24=0x0,_0x1aadbc=events['length'];_0x209f24<_0x1aadbc;_0x209f24++){var _0x577499=events[_0x209f24];var _0x28b1ca=createListener(_0xd6dc('0x5')+_0x577499,_0x39b2bc);OpenchannelInteractionEvents['on'](_0x577499,_0x28b1ca);}}; \ No newline at end of file +var _0xba7f=['register','openchannelInteraction:','./openchannelInteraction.events','save','emit'];(function(_0xb2cab2,_0x1680f5){var _0x392207=function(_0x2919ae){while(--_0x2919ae){_0xb2cab2['push'](_0xb2cab2['shift']());}};_0x392207(++_0x1680f5);}(_0xba7f,0x19c));var _0xfba7=function(_0x1cd714,_0xeff776){_0x1cd714=_0x1cd714-0x0;var _0x5dd798=_0xba7f[_0x1cd714];return _0x5dd798;};'use strict';var OpenchannelInteractionEvents=require(_0xfba7('0x0'));var events=[_0xfba7('0x1'),'remove','update'];function createListener(_0x57acf2,_0x16aa04){return function(_0x4b25a5){_0x16aa04[_0xfba7('0x2')](_0x57acf2,_0x4b25a5);};}function removeListener(_0x2880ac,_0x3c5ef9){return function(){OpenchannelInteractionEvents['removeListener'](_0x2880ac,_0x3c5ef9);};}exports[_0xfba7('0x3')]=function(_0x32cd90){for(var _0x5e0ce7=0x0,_0x11f880=events['length'];_0x5e0ce7<_0x11f880;_0x5e0ce7++){var _0x264ad8=events[_0x5e0ce7];var _0x576d77=createListener(_0xfba7('0x4')+_0x264ad8,_0x32cd90);OpenchannelInteractionEvents['on'](_0x264ad8,_0x576d77);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index fe3f327..2a69245 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x24b591,_0x3dad15){var _0x17af27=function(_0x1ca523){while(--_0x1ca523){_0x24b591['push'](_0x24b591['shift']());}};_0x17af27(++_0x3dad15);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x3b2f6c,_0x450500){var _0x8aec06=function(_0x57acc3){while(--_0x57acc3){_0x3b2f6c['push'](_0x3b2f6c['shift']());}};_0x8aec06(++_0x450500);}(_0xe706,0xa3));var _0x6e70=function(_0x2eeed4,_0x28dc98){_0x2eeed4=_0x2eeed4-0x0;var _0x56099d=_0xe706[_0x2eeed4];return _0x56099d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9c211c1..7fc7483 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 _0x531a=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x338665,_0x53d163){var _0x284926=function(_0x2785a3){while(--_0x2785a3){_0x338665['push'](_0x338665['shift']());}};_0x284926(++_0x53d163);}(_0x531a,0x100));var _0xa531=function(_0x24e91e,_0x38b947){_0x24e91e=_0x24e91e-0x0;var _0x51252c=_0x531a[_0x24e91e];return _0x51252c;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'body':{'type':Sequelize[_0xa531('0x2')](_0xa531('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa531('0x5')]('in',_0xa531('0x6')),'defaultValue':_0xa531('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa531('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa531('0x2')]}}; \ No newline at end of file +var _0x3495=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x117926,_0x268445){var _0xc34604=function(_0x67f9c5){while(--_0x67f9c5){_0x117926['push'](_0x117926['shift']());}};_0xc34604(++_0x268445);}(_0x3495,0x1de));var _0x5349=function(_0x30c387,_0x31e41f){_0x30c387=_0x30c387-0x0;var _0x1aebe4=_0x3495[_0x30c387];return _0x1aebe4;};'use strict';var Sequelize=require(_0x5349('0x0'));module[_0x5349('0x1')]={'body':{'type':Sequelize[_0x5349('0x2')](_0x5349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5349('0x5')]('in',_0x5349('0x6')),'defaultValue':_0x5349('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x5349('0x7')]},'providerResponse':{'type':Sequelize[_0x5349('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b5d4b1e..20d04bc 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 _0x8457=['pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','options','find','create','body','accept','openchannel','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','contact','fullname','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4549e6,_0x3e735c){var _0x48fc46=function(_0x5d3940){while(--_0x5d3940){_0x4549e6['push'](_0x4549e6['shift']());}};_0x48fc46(++_0x3e735c);}(_0x8457,0x142));var _0x7845=function(_0x38e473,_0x38dfe1){_0x38e473=_0x38e473-0x0;var _0x4dd005=_0x8457[_0x38e473];return _0x4dd005;};'use strict';var emlformat=require(_0x7845('0x0'));var rimraf=require(_0x7845('0x1'));var zipdir=require(_0x7845('0x2'));var jsonpatch=require(_0x7845('0x3'));var rp=require(_0x7845('0x4'));var moment=require(_0x7845('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7845('0x6'));var util=require('util');var path=require(_0x7845('0x7'));var sox=require(_0x7845('0x8'));var csv=require(_0x7845('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7845('0xa'));var _=require(_0x7845('0xb'));var squel=require(_0x7845('0xc'));var crypto=require(_0x7845('0xd'));var jsforce=require(_0x7845('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7845('0x9'));var querystring=require(_0x7845('0xf'));var Papa=require(_0x7845('0x10'));var Redis=require('ioredis');var authService=require(_0x7845('0x11'));var qs=require(_0x7845('0x12'));var as=require(_0x7845('0x13'));var hardwareService=require(_0x7845('0x14'));var logger=require(_0x7845('0x15'))(_0x7845('0x16'));var utils=require(_0x7845('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7845('0x18'));var db=require(_0x7845('0x19'))['db'];config[_0x7845('0x1a')]=_[_0x7845('0x1b')](config[_0x7845('0x1a')],{'host':_0x7845('0x1c'),'port':0x18eb});var socket=require(_0x7845('0x1d'))(new Redis(config[_0x7845('0x1a')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x7845('0x1e'));var client=jayson[_0x7845('0x1f')][_0x7845('0x20')]({'port':0x232c});var client9002=jayson[_0x7845('0x1f')][_0x7845('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2be508,_0x119e1d,_0x573bf1,_0x575785){return new BPromise(function(_0x1d8f0d,_0x5574eb){var _0x1b962e=_0x575785||client;return _0x1b962e[_0x7845('0x21')](_0x2be508,_0x573bf1)[_0x7845('0x22')](function(_0x164319){logger[_0x7845('0x23')](_0x7845('0x24'),_0x119e1d,_0x7845('0x25'));logger[_0x7845('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x119e1d,_0x7845('0x25'),JSON['stringify'](_0x164319));if(_0x164319['error']){if(_0x164319[_0x7845('0x27')][_0x7845('0x28')]===0x1f4){logger['error'](_0x7845('0x24'),_0x119e1d,_0x164319[_0x7845('0x27')][_0x7845('0x29')]);return _0x5574eb(_0x164319[_0x7845('0x27')]['message']);}logger[_0x7845('0x27')](_0x7845('0x24'),_0x119e1d,_0x164319[_0x7845('0x27')][_0x7845('0x29')]);return _0x1d8f0d(_0x164319[_0x7845('0x27')][_0x7845('0x29')]);}else{logger[_0x7845('0x23')](_0x7845('0x24'),_0x119e1d,'request\x20sent');_0x1d8f0d(_0x164319[_0x7845('0x2a')][_0x7845('0x29')]);}})[_0x7845('0x2b')](function(_0x56e59c){logger['error'](_0x7845('0x24'),_0x119e1d,_0x56e59c);_0x5574eb(_0x56e59c);});});}function respondWithStatusCode(_0x27be16,_0xad2432){_0xad2432=_0xad2432||0xcc;return function(_0x1d0f30){if(_0x1d0f30){return _0x27be16[_0x7845('0x2c')](_0xad2432);}return _0x27be16['status'](_0xad2432)[_0x7845('0x2d')]();};}function respondWithResult(_0xaf383b,_0x1cc765){_0x1cc765=_0x1cc765||0xc8;return function(_0x305525){if(_0x305525){return _0xaf383b[_0x7845('0x2e')](_0x1cc765)[_0x7845('0x2f')](_0x305525);}};}function respondWithFilteredResult(_0x14719e,_0x2ff4fe){return function(_0x285693){if(_0x285693){var _0x312ba5=typeof _0x2ff4fe[_0x7845('0x30')]===_0x7845('0x31')&&typeof _0x2ff4fe[_0x7845('0x32')]===_0x7845('0x31');var _0x13c200=_0x285693[_0x7845('0x33')];var _0x2a436a=_0x312ba5?0x0:_0x2ff4fe[_0x7845('0x30')];var _0x2e8d99=_0x312ba5?_0x285693[_0x7845('0x33')]:_0x2ff4fe['offset']+_0x2ff4fe[_0x7845('0x32')];var _0x113e9f;if(_0x2e8d99>=_0x13c200){_0x2e8d99=_0x13c200;_0x113e9f=0xc8;}else{_0x113e9f=0xce;}_0x14719e[_0x7845('0x2e')](_0x113e9f);return _0x14719e[_0x7845('0x34')]('Content-Range',_0x2a436a+'-'+_0x2e8d99+'/'+_0x13c200)[_0x7845('0x2f')](_0x285693);}return null;};}function patchUpdates(_0x2ec8a4){return function(_0x2b3ca6){try{jsonpatch[_0x7845('0x35')](_0x2b3ca6,_0x2ec8a4,!![]);}catch(_0x236df7){return BPromise[_0x7845('0x36')](_0x236df7);}return _0x2b3ca6[_0x7845('0x37')]();};}function saveUpdates(_0x15f9e9,_0x3882ba){return function(_0x408f3a){if(_0x408f3a){return _0x408f3a[_0x7845('0x38')](_0x15f9e9)[_0x7845('0x22')](function(_0x1116a7){return _0x1116a7;});}return null;};}function removeEntity(_0x36a33b,_0x5c7534){return function(_0x4b1605){if(_0x4b1605){return _0x4b1605[_0x7845('0x39')]()['then'](function(){_0x36a33b['status'](0xcc)[_0x7845('0x2d')]();});}};}function handleEntityNotFound(_0x30bfc8,_0x3067fa){return function(_0x55e30a){if(!_0x55e30a){_0x30bfc8[_0x7845('0x2c')](0x194);}return _0x55e30a;};}function handleError(_0x1b15d6,_0x37d573){_0x37d573=_0x37d573||0x1f4;return function(_0x2f4b38){logger[_0x7845('0x27')](_0x2f4b38['stack']);if(_0x2f4b38[_0x7845('0x3a')]){delete _0x2f4b38[_0x7845('0x3a')];}_0x1b15d6[_0x7845('0x2e')](_0x37d573)[_0x7845('0x3b')](_0x2f4b38);};}exports[_0x7845('0x3c')]=function(_0x145d39,_0x5df64a){var _0x13d3be={},_0x383eaf={},_0x557f89={'count':0x0,'rows':[]};var _0x2aa904=_[_0x7845('0x3d')](db[_0x7845('0x3e')][_0x7845('0x3f')],function(_0x121fa0){return{'name':_0x121fa0['fieldName'],'type':_0x121fa0['type']['key']};});_0x383eaf['model']=_[_0x7845('0x3d')](_0x2aa904,'name');_0x383eaf[_0x7845('0x40')]=_[_0x7845('0x41')](_0x145d39[_0x7845('0x40')]);_0x383eaf[_0x7845('0x42')]=_[_0x7845('0x43')](_0x383eaf[_0x7845('0x44')],_0x383eaf[_0x7845('0x40')]);_0x13d3be[_0x7845('0x45')]=_[_0x7845('0x43')](_0x383eaf['model'],qs[_0x7845('0x46')](_0x145d39[_0x7845('0x40')][_0x7845('0x46')]));_0x13d3be[_0x7845('0x45')]=_0x13d3be[_0x7845('0x45')][_0x7845('0x47')]?_0x13d3be[_0x7845('0x45')]:_0x383eaf[_0x7845('0x44')];if(!_0x145d39[_0x7845('0x40')][_0x7845('0x48')](_0x7845('0x49'))){_0x13d3be[_0x7845('0x32')]=qs['limit'](_0x145d39['query']['limit']);_0x13d3be[_0x7845('0x30')]=qs[_0x7845('0x30')](_0x145d39[_0x7845('0x40')][_0x7845('0x30')]);}_0x13d3be[_0x7845('0x4a')]=qs[_0x7845('0x4b')](_0x145d39['query'][_0x7845('0x4b')]);_0x13d3be[_0x7845('0x4c')]=qs['filters'](_[_0x7845('0x4d')](_0x145d39[_0x7845('0x40')],_0x383eaf[_0x7845('0x42')]),_0x2aa904);if(_0x145d39['query'][_0x7845('0x4e')]){_0x13d3be['where']=_[_0x7845('0x4f')](_0x13d3be[_0x7845('0x4c')],{'$or':_[_0x7845('0x3d')](_0x2aa904,function(_0x27930f){if(_0x27930f[_0x7845('0x50')]!==_0x7845('0x51')){var _0x8d2397={};_0x8d2397[_0x27930f[_0x7845('0x3a')]]={'$like':'%'+_0x145d39[_0x7845('0x40')][_0x7845('0x4e')]+'%'};return _0x8d2397;}})});}_0x13d3be=_[_0x7845('0x4f')]({},_0x13d3be,_0x145d39['options']);var _0x282762={'where':_0x13d3be['where']};return db['OpenchannelMessage'][_0x7845('0x33')](_0x282762)[_0x7845('0x22')](function(_0x5109af){_0x557f89[_0x7845('0x33')]=_0x5109af;if(_0x145d39[_0x7845('0x40')][_0x7845('0x52')]){_0x13d3be[_0x7845('0x53')]=[{'all':!![]}];}return db[_0x7845('0x3e')]['findAll'](_0x13d3be);})['then'](function(_0x54b629){_0x557f89[_0x7845('0x54')]=_0x54b629;return _0x557f89;})[_0x7845('0x22')](respondWithFilteredResult(_0x5df64a,_0x13d3be))['catch'](handleError(_0x5df64a,null));};exports[_0x7845('0x55')]=function(_0x23cbbc,_0x5b6cdf){var _0x30bbe2={'raw':!![],'where':{'id':_0x23cbbc[_0x7845('0x56')]['id']}},_0x3385cc={};_0x3385cc[_0x7845('0x44')]=_['keys'](db['OpenchannelMessage'][_0x7845('0x3f')]);_0x3385cc[_0x7845('0x40')]=_[_0x7845('0x41')](_0x23cbbc[_0x7845('0x40')]);_0x3385cc['filters']=_[_0x7845('0x43')](_0x3385cc[_0x7845('0x44')],_0x3385cc[_0x7845('0x40')]);_0x30bbe2[_0x7845('0x45')]=_[_0x7845('0x43')](_0x3385cc[_0x7845('0x44')],qs[_0x7845('0x46')](_0x23cbbc[_0x7845('0x40')][_0x7845('0x46')]));_0x30bbe2[_0x7845('0x45')]=_0x30bbe2[_0x7845('0x45')][_0x7845('0x47')]?_0x30bbe2[_0x7845('0x45')]:_0x3385cc['model'];if(_0x23cbbc[_0x7845('0x40')][_0x7845('0x52')]){_0x30bbe2[_0x7845('0x53')]=[{'all':!![]}];}_0x30bbe2=_[_0x7845('0x4f')]({},_0x30bbe2,_0x23cbbc[_0x7845('0x57')]);return db[_0x7845('0x3e')][_0x7845('0x58')](_0x30bbe2)['then'](handleEntityNotFound(_0x5b6cdf,null))[_0x7845('0x22')](respondWithResult(_0x5b6cdf,null))[_0x7845('0x2b')](handleError(_0x5b6cdf,null));};exports[_0x7845('0x59')]=function(_0x1b83b1,_0x317f44){return db[_0x7845('0x3e')][_0x7845('0x59')](_0x1b83b1['body'],{})[_0x7845('0x22')](respondWithResult(_0x317f44,0xc9))[_0x7845('0x2b')](handleError(_0x317f44,null));};exports['update']=function(_0x1124fd,_0x48ba1){if(_0x1124fd['body']['id']){delete _0x1124fd[_0x7845('0x5a')]['id'];}return db[_0x7845('0x3e')][_0x7845('0x58')]({'where':{'id':_0x1124fd[_0x7845('0x56')]['id']}})['then'](handleEntityNotFound(_0x48ba1,null))[_0x7845('0x22')](saveUpdates(_0x1124fd[_0x7845('0x5a')],null))[_0x7845('0x22')](respondWithResult(_0x48ba1,null))['catch'](handleError(_0x48ba1,null));};exports[_0x7845('0x39')]=function(_0x2ec986,_0x27b946){return db[_0x7845('0x3e')][_0x7845('0x58')]({'where':{'id':_0x2ec986[_0x7845('0x56')]['id']}})['then'](handleEntityNotFound(_0x27b946,null))[_0x7845('0x22')](removeEntity(_0x27b946,null))['catch'](handleError(_0x27b946,null));};exports['describe']=function(_0x301172,_0x8dc14f){return db[_0x7845('0x3e')]['describe']()[_0x7845('0x22')](respondWithResult(_0x8dc14f,null))[_0x7845('0x2b')](handleError(_0x8dc14f,null));};var interaction_log=require(_0x7845('0x15'))('openchannel-interactions');exports[_0x7845('0x5b')]=function(_0x511fb7,_0x2994f2,_0x2503c2){var _0x238130={'agent':{},'channel':_0x7845('0x5c')};if(_0x511fb7['body']['id']){delete _0x511fb7['body']['id'];}_0x511fb7[_0x7845('0x5a')]['read']=!![];_0x511fb7[_0x7845('0x5a')]['readAt']=moment()[_0x7845('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x511fb7[_0x7845('0x5a')][_0x7845('0x5e')]=_0x511fb7['body'][_0x7845('0x5e')]||_0x511fb7[_0x7845('0x5f')]['id'];_0x238130[_0x7845('0x60')]['id']=_0x511fb7['body'][_0x7845('0x5e')];return db['OpenchannelMessage'][_0x7845('0x58')]({'where':{'id':_0x511fb7['params']['id'],'UserId':null}})[_0x7845('0x22')](handleEntityNotFound(_0x2994f2,null))[_0x7845('0x22')](saveUpdates(_0x511fb7[_0x7845('0x5a')],null))[_0x7845('0x22')](function(_0x5d9102){if(_0x5d9102){_0x238130[_0x7845('0x29')]=_0x5d9102[_0x7845('0x61')]({'plain':!![]});return db[_0x7845('0x62')][_0x7845('0x58')]({'where':{'id':_0x5d9102[_0x7845('0x63')]}});}return null;})[_0x7845('0x22')](handleEntityNotFound(_0x2994f2,null))[_0x7845('0x22')](function(_0xba619d){if(_0xba619d){return _0xba619d[_0x7845('0x38')]({'UserId':_0x511fb7[_0x7845('0x5a')]['UserId'],'read1stAt':_[_0x7845('0x64')](_0xba619d[_0x7845('0x65')])?moment()['format'](_0x7845('0x66')):undefined});}return null;})[_0x7845('0x22')](function(_0x508524){if(_0x508524){_0x238130[_0x7845('0x67')]=_0x508524[_0x7845('0x61')]({'plain':!![]});interaction_log[_0x7845('0x23')](_0x7845('0x68'),_0x511fb7[_0x7845('0x5f')]['id'],_0x511fb7[_0x7845('0x5f')]['name'],_0x511fb7[_0x7845('0x5f')][_0x7845('0x69')],_0x238130[_0x7845('0x67')]['id'],_0x511fb7[_0x7845('0x5a')]?JSON['stringify'](_0x511fb7[_0x7845('0x5a')]):_0x7845('0x6a'));return respondWithRpcPromise(_0x7845('0x6b'),_0x7845('0x6c'),_0x238130);}return null;})['then'](function(_0x17c25f){var _0x1ab675=_0x7845('0x6d')+_0x17c25f[_0x7845('0x29')][_0x7845('0x6e')];return db[_0x7845('0x6f')]['query'](_0x1ab675,{'type':db[_0x7845('0x70')][_0x7845('0x71')][_0x7845('0x72')],'raw':!![]})[_0x7845('0x22')](function(_0xa6afd6){return _0xa6afd6;});})[_0x7845('0x22')](function(_0x34579d){if(_0x34579d){_0x238130[_0x7845('0x29')]['contact']=_0x34579d[0x0];if(!_0x511fb7[_0x7845('0x5a')][_0x7845('0x5e')])return;return db[_0x7845('0x73')][_0x7845('0x58')]({'where':{'id':_0x511fb7[_0x7845('0x5a')][_0x7845('0x5e')],'role':_0x7845('0x60')},'attributes':['id',_0x7845('0x3a'),'fullname',_0x7845('0x74'),_0x7845('0x75')],'raw':!![]});}return null;})['then'](function(_0xa8e49a){if(!_0xa8e49a)return null;_0x238130[_0x7845('0x29')][_0x7845('0x60')]=_0xa8e49a;return _0x238130;})[_0x7845('0x22')](function(_0x1c540f){if(_0x1c540f){if(_0x511fb7[_0x7845('0x5a')][_0x7845('0x76')]){_0x238130['message'][_0x7845('0x77')]=util[_0x7845('0x5d')](_0x7845('0x78'),_0x511fb7[_0x7845('0x5f')][_0x7845('0x3a')]);_0x238130[_0x7845('0x29')][_0x7845('0x79')]=_0x238130[_0x7845('0x79')];_0x238130['message'][_0x7845('0x7a')]=_0x238130[_0x7845('0x79')];_0x238130[_0x7845('0x29')][_0x7845('0x7b')]=_0x7845('0x5b');return respondWithRpcPromise(_0x7845('0x7c'),_0x7845('0x7c'),{'event':_0x7845('0x7d'),'message':_0x238130[_0x7845('0x29')]},client9002)[_0x7845('0x22')](function(){return _0x238130;});}return _0x238130;}return null;})[_0x7845('0x22')](respondWithResult(_0x2994f2,null))[_0x7845('0x2b')](handleError(_0x2994f2,null));};var interaction_log=require(_0x7845('0x15'))(_0x7845('0x7e'));exports['reject']=function(_0x4b445c,_0x8bf4e1,_0x174bc6){var _0x556e02={'agent':{},'channel':_0x7845('0x5c')};if(_0x4b445c[_0x7845('0x5a')]['id']){delete _0x4b445c[_0x7845('0x5a')]['id'];}_0x4b445c[_0x7845('0x5a')][_0x7845('0x5e')]=_0x4b445c['body'][_0x7845('0x5e')]||_0x4b445c[_0x7845('0x5f')]['id'];_0x556e02[_0x7845('0x60')]['id']=_0x4b445c[_0x7845('0x5a')][_0x7845('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4b445c[_0x7845('0x56')]['id'],'UserId':null}})[_0x7845('0x22')](handleEntityNotFound(_0x8bf4e1,null))[_0x7845('0x22')](function(_0x5091bd){if(_0x5091bd){_0x556e02[_0x7845('0x29')]=_0x5091bd[_0x7845('0x61')]({'plain':!![]});return db[_0x7845('0x62')][_0x7845('0x58')]({'where':{'id':_0x5091bd[_0x7845('0x63')]}});}return null;})[_0x7845('0x22')](handleEntityNotFound(_0x8bf4e1,null))['then'](function(_0xdd6b53){if(_0xdd6b53){_0x556e02[_0x7845('0x67')]=_0xdd6b53[_0x7845('0x61')]({'plain':!![]});interaction_log[_0x7845('0x23')](_0x7845('0x7f'),_0x4b445c[_0x7845('0x5f')]['id'],_0x4b445c[_0x7845('0x5f')][_0x7845('0x3a')],_0x4b445c['user'][_0x7845('0x69')],_0x556e02['interaction']['id'],_0x4b445c[_0x7845('0x5a')]?JSON[_0x7845('0x80')](_0x4b445c[_0x7845('0x5a')]):_0x7845('0x6a'));return respondWithRpcPromise(_0x7845('0x81'),_0x7845('0x82'),_0x556e02);}return null;})[_0x7845('0x22')](function(_0x442914){var _0x4c2454=_0x7845('0x6d')+_0x442914[_0x7845('0x29')][_0x7845('0x6e')];return db['sequelize'][_0x7845('0x40')](_0x4c2454,{'type':db[_0x7845('0x70')][_0x7845('0x71')]['SELECT'],'raw':!![]})[_0x7845('0x22')](function(_0x3ca050){return _0x3ca050;});})[_0x7845('0x22')](function(_0x2e102e){if(_0x2e102e){_0x556e02['message'][_0x7845('0x83')]=_0x2e102e[0x0];if(!_0x4b445c['body'][_0x7845('0x5e')])return;return db[_0x7845('0x73')]['find']({'where':{'id':_0x4b445c[_0x7845('0x5a')][_0x7845('0x5e')],'role':_0x7845('0x60')},'attributes':['id',_0x7845('0x3a'),_0x7845('0x84'),_0x7845('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x51dfb1){if(!_0x51dfb1)return null;_0x556e02[_0x7845('0x29')][_0x7845('0x60')]=_0x51dfb1;return _0x556e02;})['then'](function(_0x336149){if(_0x336149){_0x336149[_0x7845('0x29')][_0x7845('0x77')]=util[_0x7845('0x5d')]('SIP/%s',_0x4b445c['user']['name']);_0x336149[_0x7845('0x29')]['channel']=_0x556e02['channel'];_0x336149[_0x7845('0x29')][_0x7845('0x7a')]=_0x556e02[_0x7845('0x79')];_0x336149[_0x7845('0x29')][_0x7845('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x7845('0x7c'),{'event':'rejectmessage','message':_0x336149['message']},client9002);return _0x556e02;}return null;})[_0x7845('0x22')](respondWithResult(_0x8bf4e1,null))['catch'](handleError(_0x8bf4e1,null));}; \ No newline at end of file +var _0x3a0b=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','destroy','name','send','OpenchannelMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT','contact','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x3a0b,0x7a));var _0xb3a0=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x3a0b[_0x296923];return _0x29af70;};'use strict';var emlformat=require(_0xb3a0('0x0'));var rimraf=require(_0xb3a0('0x1'));var zipdir=require(_0xb3a0('0x2'));var jsonpatch=require(_0xb3a0('0x3'));var rp=require(_0xb3a0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb3a0('0x5'));var sox=require(_0xb3a0('0x6'));var csv=require('to-csv');var ejs=require(_0xb3a0('0x7'));var fs=require('fs');var fs_extra=require(_0xb3a0('0x8'));var _=require(_0xb3a0('0x9'));var squel=require(_0xb3a0('0xa'));var crypto=require(_0xb3a0('0xb'));var jsforce=require(_0xb3a0('0xc'));var deskjs=require(_0xb3a0('0xd'));var toCsv=require(_0xb3a0('0xe'));var querystring=require(_0xb3a0('0xf'));var Papa=require(_0xb3a0('0x10'));var Redis=require(_0xb3a0('0x11'));var authService=require(_0xb3a0('0x12'));var qs=require(_0xb3a0('0x13'));var as=require(_0xb3a0('0x14'));var hardwareService=require(_0xb3a0('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3a0('0x16'))['db'];config[_0xb3a0('0x17')]=_[_0xb3a0('0x18')](config[_0xb3a0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3a0('0x19'))(new Redis(config[_0xb3a0('0x17')]));require('./openchannelMessage.socket')[_0xb3a0('0x1a')](socket);var jayson=require(_0xb3a0('0x1b'));var client=jayson['client'][_0xb3a0('0x1c')]({'port':0x232c});var client9002=jayson[_0xb3a0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa95ecb,_0x34eb62,_0x247778,_0x3bb560){return new BPromise(function(_0x3315e9,_0x4e4461){var _0x1e3786=_0x3bb560||client;return _0x1e3786[_0xb3a0('0x1e')](_0xa95ecb,_0x247778)[_0xb3a0('0x1f')](function(_0x4f8d80){logger['info'](_0xb3a0('0x20'),_0x34eb62,_0xb3a0('0x21'));logger[_0xb3a0('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x34eb62,_0xb3a0('0x21'),JSON[_0xb3a0('0x23')](_0x4f8d80));if(_0x4f8d80[_0xb3a0('0x24')]){if(_0x4f8d80['error'][_0xb3a0('0x25')]===0x1f4){logger[_0xb3a0('0x24')](_0xb3a0('0x20'),_0x34eb62,_0x4f8d80[_0xb3a0('0x24')]['message']);return _0x4e4461(_0x4f8d80[_0xb3a0('0x24')][_0xb3a0('0x26')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x34eb62,_0x4f8d80['error'][_0xb3a0('0x26')]);return _0x3315e9(_0x4f8d80[_0xb3a0('0x24')]['message']);}else{logger[_0xb3a0('0x27')](_0xb3a0('0x20'),_0x34eb62,'request\x20sent');_0x3315e9(_0x4f8d80[_0xb3a0('0x28')][_0xb3a0('0x26')]);}})[_0xb3a0('0x29')](function(_0x17bbc2){logger[_0xb3a0('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x34eb62,_0x17bbc2);_0x4e4461(_0x17bbc2);});});}function respondWithStatusCode(_0x5e0203,_0x1db0df){_0x1db0df=_0x1db0df||0xcc;return function(_0x236d68){if(_0x236d68){return _0x5e0203[_0xb3a0('0x2a')](_0x1db0df);}return _0x5e0203['status'](_0x1db0df)[_0xb3a0('0x2b')]();};}function respondWithResult(_0x31de05,_0x19c391){_0x19c391=_0x19c391||0xc8;return function(_0x2ddeec){if(_0x2ddeec){return _0x31de05['status'](_0x19c391)[_0xb3a0('0x2c')](_0x2ddeec);}};}function respondWithFilteredResult(_0x2cfd7f,_0x314ab1){return function(_0x362dce){if(_0x362dce){var _0x158ff4=typeof _0x314ab1['offset']==='undefined'&&typeof _0x314ab1[_0xb3a0('0x2d')]===_0xb3a0('0x2e');var _0x3ba521=_0x362dce['count'];var _0x3d59f4=_0x158ff4?0x0:_0x314ab1['offset'];var _0x59a5fd=_0x158ff4?_0x362dce[_0xb3a0('0x2f')]:_0x314ab1[_0xb3a0('0x30')]+_0x314ab1[_0xb3a0('0x2d')];var _0x1543fb;if(_0x59a5fd>=_0x3ba521){_0x59a5fd=_0x3ba521;_0x1543fb=0xc8;}else{_0x1543fb=0xce;}_0x2cfd7f[_0xb3a0('0x31')](_0x1543fb);return _0x2cfd7f[_0xb3a0('0x32')](_0xb3a0('0x33'),_0x3d59f4+'-'+_0x59a5fd+'/'+_0x3ba521)[_0xb3a0('0x2c')](_0x362dce);}return null;};}function patchUpdates(_0x1f4d9c){return function(_0xf93c2a){try{jsonpatch[_0xb3a0('0x34')](_0xf93c2a,_0x1f4d9c,!![]);}catch(_0x2cbbc0){return BPromise[_0xb3a0('0x35')](_0x2cbbc0);}return _0xf93c2a[_0xb3a0('0x36')]();};}function saveUpdates(_0x4e598c,_0x2cfc1f){return function(_0x27e784){if(_0x27e784){return _0x27e784['update'](_0x4e598c)[_0xb3a0('0x1f')](function(_0x46ec2e){return _0x46ec2e;});}return null;};}function removeEntity(_0x1f7869,_0x1f3788){return function(_0x281da8){if(_0x281da8){return _0x281da8[_0xb3a0('0x37')]()[_0xb3a0('0x1f')](function(){_0x1f7869['status'](0xcc)[_0xb3a0('0x2b')]();});}};}function handleEntityNotFound(_0x86ed0,_0x31b744){return function(_0x246fc7){if(!_0x246fc7){_0x86ed0[_0xb3a0('0x2a')](0x194);}return _0x246fc7;};}function handleError(_0x3bc424,_0xf9b39f){_0xf9b39f=_0xf9b39f||0x1f4;return function(_0x25fbd1){logger['error'](_0x25fbd1['stack']);if(_0x25fbd1[_0xb3a0('0x38')]){delete _0x25fbd1[_0xb3a0('0x38')];}_0x3bc424[_0xb3a0('0x31')](_0xf9b39f)[_0xb3a0('0x39')](_0x25fbd1);};}exports['index']=function(_0x5cfaa2,_0x5d95cd){var _0x42767e={},_0x1a8d2e={},_0x35872b={'count':0x0,'rows':[]};var _0x20f8cf=_['map'](db[_0xb3a0('0x3a')][_0xb3a0('0x3b')],function(_0x5e3a68){return{'name':_0x5e3a68[_0xb3a0('0x3c')],'type':_0x5e3a68[_0xb3a0('0x3d')]['key']};});_0x1a8d2e[_0xb3a0('0x3e')]=_[_0xb3a0('0x3f')](_0x20f8cf,'name');_0x1a8d2e[_0xb3a0('0x40')]=_[_0xb3a0('0x41')](_0x5cfaa2[_0xb3a0('0x40')]);_0x1a8d2e[_0xb3a0('0x42')]=_[_0xb3a0('0x43')](_0x1a8d2e['model'],_0x1a8d2e['query']);_0x42767e[_0xb3a0('0x44')]=_[_0xb3a0('0x43')](_0x1a8d2e['model'],qs[_0xb3a0('0x45')](_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x45')]));_0x42767e['attributes']=_0x42767e[_0xb3a0('0x44')][_0xb3a0('0x46')]?_0x42767e[_0xb3a0('0x44')]:_0x1a8d2e[_0xb3a0('0x3e')];if(!_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x47')](_0xb3a0('0x48'))){_0x42767e[_0xb3a0('0x2d')]=qs[_0xb3a0('0x2d')](_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x2d')]);_0x42767e[_0xb3a0('0x30')]=qs[_0xb3a0('0x30')](_0x5cfaa2[_0xb3a0('0x40')]['offset']);}_0x42767e['order']=qs[_0xb3a0('0x49')](_0x5cfaa2['query'][_0xb3a0('0x49')]);_0x42767e[_0xb3a0('0x4a')]=qs[_0xb3a0('0x42')](_['pick'](_0x5cfaa2['query'],_0x1a8d2e[_0xb3a0('0x42')]),_0x20f8cf);if(_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x4b')]){_0x42767e[_0xb3a0('0x4a')]=_[_0xb3a0('0x4c')](_0x42767e[_0xb3a0('0x4a')],{'$or':_[_0xb3a0('0x3f')](_0x20f8cf,function(_0x6df27c){if(_0x6df27c[_0xb3a0('0x3d')]!==_0xb3a0('0x4d')){var _0x2372bb={};_0x2372bb[_0x6df27c[_0xb3a0('0x38')]]={'$like':'%'+_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x4b')]+'%'};return _0x2372bb;}})});}_0x42767e=_[_0xb3a0('0x4c')]({},_0x42767e,_0x5cfaa2[_0xb3a0('0x4e')]);var _0x2a4f7e={'where':_0x42767e[_0xb3a0('0x4a')]};return db[_0xb3a0('0x3a')][_0xb3a0('0x2f')](_0x2a4f7e)[_0xb3a0('0x1f')](function(_0x3a1684){_0x35872b[_0xb3a0('0x2f')]=_0x3a1684;if(_0x5cfaa2[_0xb3a0('0x40')][_0xb3a0('0x4f')]){_0x42767e[_0xb3a0('0x50')]=[{'all':!![]}];}return db[_0xb3a0('0x3a')][_0xb3a0('0x51')](_0x42767e);})[_0xb3a0('0x1f')](function(_0x7ac061){_0x35872b[_0xb3a0('0x52')]=_0x7ac061;return _0x35872b;})['then'](respondWithFilteredResult(_0x5d95cd,_0x42767e))[_0xb3a0('0x29')](handleError(_0x5d95cd,null));};exports[_0xb3a0('0x53')]=function(_0x8242ca,_0x498216){var _0x1c7ede={'raw':!![],'where':{'id':_0x8242ca['params']['id']}},_0x27fe9c={};_0x27fe9c['model']=_['keys'](db['OpenchannelMessage'][_0xb3a0('0x3b')]);_0x27fe9c[_0xb3a0('0x40')]=_[_0xb3a0('0x41')](_0x8242ca[_0xb3a0('0x40')]);_0x27fe9c[_0xb3a0('0x42')]=_['intersection'](_0x27fe9c['model'],_0x27fe9c[_0xb3a0('0x40')]);_0x1c7ede['attributes']=_[_0xb3a0('0x43')](_0x27fe9c[_0xb3a0('0x3e')],qs[_0xb3a0('0x45')](_0x8242ca[_0xb3a0('0x40')]['fields']));_0x1c7ede['attributes']=_0x1c7ede['attributes'][_0xb3a0('0x46')]?_0x1c7ede['attributes']:_0x27fe9c[_0xb3a0('0x3e')];if(_0x8242ca[_0xb3a0('0x40')]['includeAll']){_0x1c7ede[_0xb3a0('0x50')]=[{'all':!![]}];}_0x1c7ede=_[_0xb3a0('0x4c')]({},_0x1c7ede,_0x8242ca[_0xb3a0('0x4e')]);return db[_0xb3a0('0x3a')][_0xb3a0('0x54')](_0x1c7ede)[_0xb3a0('0x1f')](handleEntityNotFound(_0x498216,null))[_0xb3a0('0x1f')](respondWithResult(_0x498216,null))[_0xb3a0('0x29')](handleError(_0x498216,null));};exports[_0xb3a0('0x55')]=function(_0x4d96b0,_0x5598a4){return db[_0xb3a0('0x3a')]['create'](_0x4d96b0[_0xb3a0('0x56')],{})[_0xb3a0('0x1f')](respondWithResult(_0x5598a4,0xc9))[_0xb3a0('0x29')](handleError(_0x5598a4,null));};exports[_0xb3a0('0x57')]=function(_0x2a0c9e,_0x6dd09f){if(_0x2a0c9e['body']['id']){delete _0x2a0c9e[_0xb3a0('0x56')]['id'];}return db[_0xb3a0('0x3a')]['find']({'where':{'id':_0x2a0c9e[_0xb3a0('0x58')]['id']}})[_0xb3a0('0x1f')](handleEntityNotFound(_0x6dd09f,null))[_0xb3a0('0x1f')](saveUpdates(_0x2a0c9e[_0xb3a0('0x56')],null))[_0xb3a0('0x1f')](respondWithResult(_0x6dd09f,null))[_0xb3a0('0x29')](handleError(_0x6dd09f,null));};exports[_0xb3a0('0x37')]=function(_0x183b16,_0x2da8a0){return db[_0xb3a0('0x3a')][_0xb3a0('0x54')]({'where':{'id':_0x183b16['params']['id']}})['then'](handleEntityNotFound(_0x2da8a0,null))[_0xb3a0('0x1f')](removeEntity(_0x2da8a0,null))['catch'](handleError(_0x2da8a0,null));};exports['describe']=function(_0x72c966,_0x4cbb16){return db[_0xb3a0('0x3a')][_0xb3a0('0x59')]()[_0xb3a0('0x1f')](respondWithResult(_0x4cbb16,null))[_0xb3a0('0x29')](handleError(_0x4cbb16,null));};var interaction_log=require('../../config/logger')(_0xb3a0('0x5a'));exports[_0xb3a0('0x5b')]=function(_0x1faf48,_0x18d0f0,_0x32bca8){var _0x24c3a6={'agent':{},'channel':_0xb3a0('0x5c')};if(_0x1faf48[_0xb3a0('0x56')]['id']){delete _0x1faf48[_0xb3a0('0x56')]['id'];}_0x1faf48[_0xb3a0('0x56')]['read']=!![];_0x1faf48['body'][_0xb3a0('0x5d')]=moment()['format'](_0xb3a0('0x5e'));_0x1faf48[_0xb3a0('0x56')][_0xb3a0('0x5f')]=_0x1faf48[_0xb3a0('0x56')]['UserId']||_0x1faf48[_0xb3a0('0x60')]['id'];_0x24c3a6[_0xb3a0('0x61')]['id']=_0x1faf48['body']['UserId'];return db[_0xb3a0('0x3a')]['find']({'where':{'id':_0x1faf48[_0xb3a0('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18d0f0,null))[_0xb3a0('0x1f')](saveUpdates(_0x1faf48[_0xb3a0('0x56')],null))[_0xb3a0('0x1f')](function(_0x23ea1e){if(_0x23ea1e){_0x24c3a6[_0xb3a0('0x26')]=_0x23ea1e[_0xb3a0('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb3a0('0x54')]({'where':{'id':_0x23ea1e[_0xb3a0('0x63')]}});}return null;})[_0xb3a0('0x1f')](handleEntityNotFound(_0x18d0f0,null))[_0xb3a0('0x1f')](function(_0x125d12){if(_0x125d12){return _0x125d12[_0xb3a0('0x57')]({'UserId':_0x1faf48['body'][_0xb3a0('0x5f')],'read1stAt':_[_0xb3a0('0x64')](_0x125d12['read1stAt'])?moment()['format'](_0xb3a0('0x5e')):undefined});}return null;})[_0xb3a0('0x1f')](function(_0x2ae81d){if(_0x2ae81d){_0x24c3a6['interaction']=_0x2ae81d[_0xb3a0('0x62')]({'plain':!![]});interaction_log[_0xb3a0('0x27')](_0xb3a0('0x65'),_0x1faf48[_0xb3a0('0x60')]['id'],_0x1faf48[_0xb3a0('0x60')]['name'],_0x1faf48[_0xb3a0('0x60')][_0xb3a0('0x66')],_0x24c3a6['interaction']['id'],_0x1faf48['body']?JSON['stringify'](_0x1faf48[_0xb3a0('0x56')]):_0xb3a0('0x67'));return respondWithRpcPromise(_0xb3a0('0x68'),_0xb3a0('0x69'),_0x24c3a6);}return null;})[_0xb3a0('0x1f')](function(_0x325951){var _0x59c944=_0xb3a0('0x6a')+_0x325951[_0xb3a0('0x26')][_0xb3a0('0x6b')];return db[_0xb3a0('0x6c')][_0xb3a0('0x40')](_0x59c944,{'type':db[_0xb3a0('0x6d')][_0xb3a0('0x6e')]['SELECT'],'raw':!![]})[_0xb3a0('0x1f')](function(_0x4d1bc0){return _0x4d1bc0;});})[_0xb3a0('0x1f')](function(_0x321d43){if(_0x321d43){_0x24c3a6['message']['contact']=_0x321d43[0x0];if(!_0x1faf48[_0xb3a0('0x56')]['UserId'])return;return db[_0xb3a0('0x6f')]['find']({'where':{'id':_0x1faf48[_0xb3a0('0x56')][_0xb3a0('0x5f')],'role':_0xb3a0('0x61')},'attributes':['id',_0xb3a0('0x38'),_0xb3a0('0x70'),_0xb3a0('0x71'),'internal'],'raw':!![]});}return null;})[_0xb3a0('0x1f')](function(_0x325737){if(!_0x325737)return null;_0x24c3a6['message'][_0xb3a0('0x61')]=_0x325737;return _0x24c3a6;})[_0xb3a0('0x1f')](function(_0x5a5328){if(_0x5a5328){if(_0x1faf48[_0xb3a0('0x56')][_0xb3a0('0x72')]){_0x24c3a6[_0xb3a0('0x26')][_0xb3a0('0x73')]=util[_0xb3a0('0x74')](_0xb3a0('0x75'),_0x1faf48[_0xb3a0('0x60')]['name']);_0x24c3a6['message']['channel']=_0x24c3a6[_0xb3a0('0x76')];_0x24c3a6[_0xb3a0('0x26')][_0xb3a0('0x77')]=_0x24c3a6[_0xb3a0('0x76')];_0x24c3a6[_0xb3a0('0x26')][_0xb3a0('0x78')]=_0xb3a0('0x5b');return respondWithRpcPromise('EventManager',_0xb3a0('0x79'),{'event':'acceptmessage','message':_0x24c3a6[_0xb3a0('0x26')]},client9002)[_0xb3a0('0x1f')](function(){return _0x24c3a6;});}return _0x24c3a6;}return null;})[_0xb3a0('0x1f')](respondWithResult(_0x18d0f0,null))['catch'](handleError(_0x18d0f0,null));};var interaction_log=require(_0xb3a0('0x7a'))(_0xb3a0('0x5a'));exports['reject']=function(_0x3d79a5,_0x5c08d4,_0x53e1d8){var _0x53304a={'agent':{},'channel':_0xb3a0('0x5c')};if(_0x3d79a5['body']['id']){delete _0x3d79a5['body']['id'];}_0x3d79a5[_0xb3a0('0x56')][_0xb3a0('0x5f')]=_0x3d79a5[_0xb3a0('0x56')]['UserId']||_0x3d79a5['user']['id'];_0x53304a[_0xb3a0('0x61')]['id']=_0x3d79a5['body'][_0xb3a0('0x5f')];return db[_0xb3a0('0x3a')][_0xb3a0('0x54')]({'where':{'id':_0x3d79a5[_0xb3a0('0x58')]['id'],'UserId':null}})[_0xb3a0('0x1f')](handleEntityNotFound(_0x5c08d4,null))['then'](function(_0x1d1cec){if(_0x1d1cec){_0x53304a[_0xb3a0('0x26')]=_0x1d1cec[_0xb3a0('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb3a0('0x54')]({'where':{'id':_0x1d1cec[_0xb3a0('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5c08d4,null))[_0xb3a0('0x1f')](function(_0x30c10e){if(_0x30c10e){_0x53304a[_0xb3a0('0x7b')]=_0x30c10e[_0xb3a0('0x62')]({'plain':!![]});interaction_log['info'](_0xb3a0('0x7c'),_0x3d79a5[_0xb3a0('0x60')]['id'],_0x3d79a5['user'][_0xb3a0('0x38')],_0x3d79a5[_0xb3a0('0x60')][_0xb3a0('0x66')],_0x53304a[_0xb3a0('0x7b')]['id'],_0x3d79a5[_0xb3a0('0x56')]?JSON[_0xb3a0('0x23')](_0x3d79a5[_0xb3a0('0x56')]):_0xb3a0('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x53304a);}return null;})['then'](function(_0x4ed416){var _0x39e3e1=_0xb3a0('0x6a')+_0x4ed416[_0xb3a0('0x26')][_0xb3a0('0x6b')];return db[_0xb3a0('0x6c')][_0xb3a0('0x40')](_0x39e3e1,{'type':db[_0xb3a0('0x6d')]['QueryTypes'][_0xb3a0('0x7d')],'raw':!![]})['then'](function(_0x5644a6){return _0x5644a6;});})[_0xb3a0('0x1f')](function(_0x4bca56){if(_0x4bca56){_0x53304a['message'][_0xb3a0('0x7e')]=_0x4bca56[0x0];if(!_0x3d79a5[_0xb3a0('0x56')][_0xb3a0('0x5f')])return;return db[_0xb3a0('0x6f')][_0xb3a0('0x54')]({'where':{'id':_0x3d79a5['body'][_0xb3a0('0x5f')],'role':_0xb3a0('0x61')},'attributes':['id',_0xb3a0('0x38'),_0xb3a0('0x70'),_0xb3a0('0x71'),_0xb3a0('0x7f')],'raw':!![]});}return null;})[_0xb3a0('0x1f')](function(_0x5d1e93){if(!_0x5d1e93)return null;_0x53304a[_0xb3a0('0x26')][_0xb3a0('0x61')]=_0x5d1e93;return _0x53304a;})['then'](function(_0x1f14c6){if(_0x1f14c6){_0x1f14c6[_0xb3a0('0x26')]['interface']=util[_0xb3a0('0x74')](_0xb3a0('0x75'),_0x3d79a5[_0xb3a0('0x60')]['name']);_0x1f14c6[_0xb3a0('0x26')][_0xb3a0('0x76')]=_0x53304a['channel'];_0x1f14c6['message'][_0xb3a0('0x77')]=_0x53304a[_0xb3a0('0x76')];_0x1f14c6[_0xb3a0('0x26')]['event']='reject';respondWithRpcPromise(_0xb3a0('0x79'),'EventManager',{'event':_0xb3a0('0x80'),'message':_0x1f14c6[_0xb3a0('0x26')]},client9002);return _0x53304a;}return null;})[_0xb3a0('0x1f')](respondWithResult(_0x5c08d4,null))[_0xb3a0('0x29')](handleError(_0x5c08d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f8234be..9ec9856 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 _0x59f5=['update','remove','emit','hasOwnProperty','exports','OpenchannelMessage','setMaxListeners','save'];(function(_0x2a6339,_0xcffe38){var _0x468e3d=function(_0x52ce0b){while(--_0x52ce0b){_0x2a6339['push'](_0x2a6339['shift']());}};_0x468e3d(++_0xcffe38);}(_0x59f5,0x1d5));var _0x559f=function(_0x2e23f8,_0x552da3){_0x2e23f8=_0x2e23f8-0x0;var _0x202deb=_0x59f5[_0x2e23f8];return _0x202deb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x559f('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x559f('0x1')](0x0);var events={'afterCreate':_0x559f('0x2'),'afterUpdate':_0x559f('0x3'),'afterDestroy':_0x559f('0x4')};function emitEvent(_0x2e6a90){return function(_0x1726c4,_0x463c16,_0xbadd43){OpenchannelMessageEvents[_0x559f('0x5')](_0x2e6a90+':'+_0x1726c4['id'],_0x1726c4);OpenchannelMessageEvents[_0x559f('0x5')](_0x2e6a90,_0x1726c4);_0xbadd43(null);};}for(var e in events){if(events[_0x559f('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x559f('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5ca1=['emit','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x50f364,_0x4edc35){var _0x15151f=function(_0x4c8ec8){while(--_0x4c8ec8){_0x50f364['push'](_0x50f364['shift']());}};_0x15151f(++_0x4edc35);}(_0x5ca1,0x1b8));var _0x15ca=function(_0x146dde,_0x4b246f){_0x146dde=_0x146dde-0x0;var _0x4060ec=_0x5ca1[_0x146dde];return _0x4060ec;};'use strict';var EventEmitter=require(_0x15ca('0x0'));var OpenchannelMessage=require(_0x15ca('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x15ca('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x15ca('0x3')};function emitEvent(_0x4bb4fc){return function(_0x5686cb,_0x31afed,_0x55c66c){OpenchannelMessageEvents[_0x15ca('0x4')](_0x4bb4fc+':'+_0x5686cb['id'],_0x5686cb);OpenchannelMessageEvents[_0x15ca('0x4')](_0x4bb4fc,_0x5686cb);_0x55c66c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x15ca('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index ca713e7..ff10193 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 _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x405fdb,_0x1beceb){var _0x4f3f61=function(_0x1117f1){while(--_0x1117f1){_0x405fdb['push'](_0x405fdb['shift']());}};_0x4f3f61(++_0x1beceb);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x5c3c[_0x2f3848];return _0x102668;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});}; \ No newline at end of file +var _0x0598=['util','api','request-promise','path','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','secret','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','get','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x16fd4b,_0x224eeb){var _0x4dd98b=function(_0x57bc45){while(--_0x57bc45){_0x16fd4b['push'](_0x16fd4b['shift']());}};_0x4dd98b(++_0x224eeb);}(_0x0598,0x92));var _0x8059=function(_0x5d355b,_0x3d47e0){_0x5d355b=_0x5d355b-0x0;var _0xcc1738=_0x0598[_0x5d355b];return _0xcc1738;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[{'name':_0x8059('0x8'),'fields':[_0x8059('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d1010,_0x89dda1,_0x1bf5fd){var _0x336f85=_0xa7d7c1[_0x8059('0xa')];var _0x283b63=_0x4d1010['get']({'plain':!![]});if(_0x283b63['direction'][_0x8059('0xb')]()==='in'||_0x283b63[_0x8059('0xc')]['toLowerCase']()==='out'&&!_0x283b63['secret']&&!_[_0x8059('0xd')](_0x283b63[_0x8059('0xe')])){_0x336f85[_0x8059('0xf')][_0x8059('0x10')]({'where':{'id':_0x283b63[_0x8059('0x11')]}})['then'](function(_0x11218f){if(_0x11218f){_0x11218f['update']({'lastMsgAt':_0x283b63[_0x8059('0x12')],'lastMsgDirection':_0x283b63['direction'][_0x8059('0xb')]()});}})[_0x8059('0x13')](function(_0x4810fd){console['error'](_0x4810fd);});}if(_0x283b63['direction']==='out'&&!_0x283b63[_0x8059('0x14')]){var _0x239195;_0x336f85[_0x8059('0x15')][_0x8059('0x16')]()[_0x8059('0x17')](function(_0x4b6d55){return _0x336f85[_0x8059('0x18')][_0x8059('0x19')]({'where':{'id':_0x283b63[_0x8059('0x1a')]},'include':[{'model':_0x336f85[_0x8059('0xf')],'as':'Interactions','where':{'id':_0x283b63[_0x8059('0x11')]},'limit':0x1,'include':[{'model':_0x336f85['CmContact'],'as':_0x8059('0x1b'),'attributes':_['keys'](_0x4b6d55)}]}]});})[_0x8059('0x17')](function(_0x56d794){_0x239195=_0x56d794[_0x8059('0x1c')]({'plain':!![]});if(_0x239195&&_0x239195[_0x8059('0x1d')]){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8059('0x1f')](_0x8059('0x20'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x239195[_0x8059('0x21')]&&_0x239195['Interactions'][_0x8059('0x22')]){_0x283b63[_0x8059('0x23')]=_[_0x8059('0x24')](_0x239195['Interactions'][0x0],_0x8059('0x1b'));_0x283b63[_0x8059('0x1b')]=_0x239195[_0x8059('0x21')][0x0][_0x8059('0x1b')];}var _0x89dda1={'method':_0x8059('0x25'),'uri':encodeURI(_0x239195[_0x8059('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x89dda1[_0x8059('0x26')]){case _0x8059('0x27'):_0x89dda1['qs']=_0x283b63;break;case _0x8059('0x25'):_0x89dda1['body']=_0x283b63;break;}return rp(_0x89dda1)[_0x8059('0x17')](function(_0x19b95a){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x8059('0x28'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]&&_0x19b95a['body'][_0x8059('0x29')]!=_0x283b63['Interaction'][_0x8059('0x29')]){return _0x336f85[_0x8059('0xf')]['update']({'threadId':_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]},{'logging':!![],'where':{'id':_0x283b63[_0x8059('0x23')]['id']}});}else{return;}})[_0x8059('0x17')](function(){return _0x4d1010[_0x8059('0x2a')]({'read':!![]});})[_0x8059('0x13')](function(_0x46b6a1){logger[_0x8059('0x2b')]('OpenchannelMessage,\x20%s,\x20%s',_0x8059('0x2c'),util[_0x8059('0x2d')](_0x46b6a1,{'showHidden':![],'depth':null}));_0x1bf5fd();});}else{_0x1bf5fd();}})[_0x8059('0x2e')](function(){_0x1bf5fd();});}else{_0x1bf5fd();}}},'charset':_0x8059('0x2f'),'collate':_0x8059('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 8c63775..222dd6a 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xb4788,_0x1efb8d){var _0xd49d21=function(_0x2b2a2b){while(--_0x2b2a2b){_0xb4788['push'](_0xb4788['shift']());}};_0xd49d21(++_0x1efb8d);}(_0xdb28,0x106));var _0x8db2=function(_0x3b9f42,_0x49cf13){_0x3b9f42=_0x3b9f42-0x0;var _0xfb2490=_0xdb28[_0x3b9f42];return _0xfb2490;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x597d67,_0xf49b02){var _0x5d636b=function(_0x50d7cd){while(--_0x50d7cd){_0x597d67['push'](_0x597d67['shift']());}};_0x5d636b(++_0xf49b02);}(_0xadb5,0xad));var _0x5adb=function(_0x28cdb6,_0x2f927d){_0x28cdb6=_0x28cdb6-0x0;var _0x5580b9=_0xadb5[_0x28cdb6];return _0x5580b9;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 453d527..3372f0f 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 _0xee3c=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','removeListener','register'];(function(_0xd25ffa,_0x52a929){var _0x2113fb=function(_0x409b72){while(--_0x409b72){_0xd25ffa['push'](_0xd25ffa['shift']());}};_0x2113fb(++_0x52a929);}(_0xee3c,0x14a));var _0xcee3=function(_0x2e0e06,_0x503ffe){_0x2e0e06=_0x2e0e06-0x0;var _0x2730a2=_0xee3c[_0x2e0e06];return _0x2730a2;};'use strict';var OpenchannelMessageEvents=require(_0xcee3('0x0'));var events=[_0xcee3('0x1'),_0xcee3('0x2'),_0xcee3('0x3')];function createListener(_0x3077e7,_0x853001){return function(_0x4f216c){_0x853001['emit'](_0x3077e7,_0x4f216c);};}function removeListener(_0x435892,_0x4cd398){return function(){OpenchannelMessageEvents[_0xcee3('0x4')](_0x435892,_0x4cd398);};}exports[_0xcee3('0x5')]=function(_0x9350f3){for(var _0x44e46f=0x0,_0x3b8ffe=events[_0xcee3('0x6')];_0x44e46f<_0x3b8ffe;_0x44e46f++){var _0x22953c=events[_0x44e46f];var _0x364eb2=createListener(_0xcee3('0x7')+_0x22953c,_0x9350f3);OpenchannelMessageEvents['on'](_0x22953c,_0x364eb2);}}; \ No newline at end of file +var _0x8a3c=['length','openchannelMessage:','./openchannelMessage.events','remove','removeListener','register'];(function(_0x8cda6f,_0x4961bc){var _0x46bccd=function(_0x2cbc22){while(--_0x2cbc22){_0x8cda6f['push'](_0x8cda6f['shift']());}};_0x46bccd(++_0x4961bc);}(_0x8a3c,0xf8));var _0xc8a3=function(_0xad470b,_0x11a3d8){_0xad470b=_0xad470b-0x0;var _0x1a6cbf=_0x8a3c[_0xad470b];return _0x1a6cbf;};'use strict';var OpenchannelMessageEvents=require(_0xc8a3('0x0'));var events=['save',_0xc8a3('0x1'),'update'];function createListener(_0x1116bd,_0x288024){return function(_0x1843b8){_0x288024['emit'](_0x1116bd,_0x1843b8);};}function removeListener(_0x2cfae4,_0x2d5fc9){return function(){OpenchannelMessageEvents[_0xc8a3('0x2')](_0x2cfae4,_0x2d5fc9);};}exports[_0xc8a3('0x3')]=function(_0x16c115){for(var _0x3f61f4=0x0,_0x169f40=events[_0xc8a3('0x4')];_0x3f61f4<_0x169f40;_0x3f61f4++){var _0x51597a=events[_0x3f61f4];var _0x25c74f=createListener(_0xc8a3('0x5')+_0x51597a,_0x16c115);OpenchannelMessageEvents['on'](_0x51597a,_0x25c74f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0066c0a..55e2cd9 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 _0x4864=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x4864,0xa3));var _0x4486=function(_0x21aa5b,_0x2c808f){_0x21aa5b=_0x21aa5b-0x0;var _0x2ca4c8=_0x4864[_0x21aa5b];return _0x2ca4c8;};'use strict';var multer=require(_0x4486('0x0'));var util=require(_0x4486('0x1'));var path=require(_0x4486('0x2'));var timeout=require(_0x4486('0x3'));var express=require(_0x4486('0x4'));var router=express[_0x4486('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4486('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4486('0x7'));router[_0x4486('0x8')]('/',auth['isAuthenticated'](),controller[_0x4486('0x9')]);router[_0x4486('0x8')](_0x4486('0xa'),auth[_0x4486('0xb')](),controller[_0x4486('0xc')]);router[_0x4486('0x8')](_0x4486('0xd'),auth[_0x4486('0xb')](),controller[_0x4486('0xe')]);router[_0x4486('0x8')](_0x4486('0xf'),auth['isAuthenticated'](),controller[_0x4486('0x10')]);router[_0x4486('0x8')](_0x4486('0x11'),auth[_0x4486('0xb')](),controller[_0x4486('0x12')]);router[_0x4486('0x8')](_0x4486('0x13'),auth[_0x4486('0xb')](),controller[_0x4486('0x14')]);router[_0x4486('0x15')]('/',auth[_0x4486('0xb')](),controller[_0x4486('0x16')]);router['post']('/:id/teams',auth[_0x4486('0xb')](),controller['addTeams']);router[_0x4486('0x15')](_0x4486('0x13'),auth[_0x4486('0xb')](),controller[_0x4486('0x17')]);router[_0x4486('0x18')](_0x4486('0xd'),auth[_0x4486('0xb')](),controller[_0x4486('0x19')]);router['delete'](_0x4486('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x4486('0x1a')](_0x4486('0x11'),auth[_0x4486('0xb')](),controller[_0x4486('0x1b')]);router['delete'](_0x4486('0x13'),auth[_0x4486('0xb')](),controller[_0x4486('0x1c')]);module[_0x4486('0x1d')]=router; \ No newline at end of file +var _0x4ac2=['exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','delete','removeTeams','removeAgents'];(function(_0x1f9862,_0x1047d7){var _0x5c41b0=function(_0x4790a3){while(--_0x4790a3){_0x1f9862['push'](_0x1f9862['shift']());}};_0x5c41b0(++_0x1047d7);}(_0x4ac2,0xd9));var _0x24ac=function(_0x350260,_0x403c08){_0x350260=_0x350260-0x0;var _0x2ae094=_0x4ac2[_0x350260];return _0x2ae094;};'use strict';var multer=require('multer');var util=require(_0x24ac('0x0'));var path=require('path');var timeout=require(_0x24ac('0x1'));var express=require('express');var router=express[_0x24ac('0x2')]();var fs_extra=require(_0x24ac('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x24ac('0x4'));var config=require(_0x24ac('0x5'));var controller=require(_0x24ac('0x6'));router[_0x24ac('0x7')]('/',auth[_0x24ac('0x8')](),controller[_0x24ac('0x9')]);router[_0x24ac('0x7')](_0x24ac('0xa'),auth[_0x24ac('0x8')](),controller['describe']);router[_0x24ac('0x7')](_0x24ac('0xb'),auth['isAuthenticated'](),controller[_0x24ac('0xc')]);router[_0x24ac('0x7')](_0x24ac('0xd'),auth[_0x24ac('0x8')](),controller[_0x24ac('0xe')]);router[_0x24ac('0x7')](_0x24ac('0xf'),auth[_0x24ac('0x8')](),controller[_0x24ac('0x10')]);router['get'](_0x24ac('0x11'),auth[_0x24ac('0x8')](),controller[_0x24ac('0x12')]);router[_0x24ac('0x13')]('/',auth[_0x24ac('0x8')](),controller[_0x24ac('0x14')]);router[_0x24ac('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x24ac('0x15')]);router['post'](_0x24ac('0x11'),auth[_0x24ac('0x8')](),controller['addAgents']);router['put'](_0x24ac('0xb'),auth[_0x24ac('0x8')](),controller[_0x24ac('0x16')]);router[_0x24ac('0x17')](_0x24ac('0xb'),auth[_0x24ac('0x8')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x24ac('0x18')]);router[_0x24ac('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x24ac('0x19')]);module[_0x24ac('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 507b8f0..acf00d4 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 _0x84de=['sequelize','exports','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x49f619,_0x4425e1){var _0x511ecd=function(_0x4566c7){while(--_0x4566c7){_0x49f619['push'](_0x49f619['shift']());}};_0x511ecd(++_0x4425e1);}(_0x84de,0x11f));var _0xe84d=function(_0x4e6b5f,_0x210669){_0x4e6b5f=_0x4e6b5f-0x0;var _0x2b8864=_0x84de[_0x4e6b5f];return _0x2b8864;};'use strict';var Sequelize=require(_0xe84d('0x0'));module[_0xe84d('0x1')]={'name':{'type':Sequelize[_0xe84d('0x2')],'unique':_0xe84d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe84d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe84d('0x5'),'beepall',_0xe84d('0x6'))}}; \ No newline at end of file +var _0x0552=['rrmemory','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0552,0x159));var _0x2055=function(_0x566614,_0x1cb163){_0x566614=_0x566614-0x0;var _0x1d7e59=_0x0552[_0x566614];return _0x1d7e59;};'use strict';var Sequelize=require(_0x2055('0x0'));module[_0x2055('0x1')]={'name':{'type':Sequelize[_0x2055('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2055('0x2')]},'timeout':{'type':Sequelize[_0x2055('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2055('0x4')](_0x2055('0x5'),'beepall',_0x2055('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 065c0a6..f8b69df 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 _0x7377=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','./openchannelQueue.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','OpenchannelQueues','UserProfileResource','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','findAll','catch','show','params','length','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','update','destroy','describe','getMembers','findOne','UserOpenchannelQueue','options','User','findAndCountAll','agent','openchannelPause','updatedAt','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x47825d,_0x2f1c51){var _0x4537e5=function(_0x1a0aaf){while(--_0x1a0aaf){_0x47825d['push'](_0x47825d['shift']());}};_0x4537e5(++_0x2f1c51);}(_0x7377,0x7f));var _0x7737=function(_0x27d751,_0x1a7e34){_0x27d751=_0x27d751-0x0;var _0x492995=_0x7377[_0x27d751];return _0x492995;};'use strict';var emlformat=require(_0x7737('0x0'));var rimraf=require(_0x7737('0x1'));var zipdir=require(_0x7737('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7737('0x3'));var moment=require(_0x7737('0x4'));var BPromise=require(_0x7737('0x5'));var Mustache=require('mustache');var util=require(_0x7737('0x6'));var path=require(_0x7737('0x7'));var sox=require(_0x7737('0x8'));var csv=require(_0x7737('0x9'));var ejs=require(_0x7737('0xa'));var fs=require('fs');var fs_extra=require(_0x7737('0xb'));var _=require(_0x7737('0xc'));var squel=require(_0x7737('0xd'));var crypto=require(_0x7737('0xe'));var jsforce=require(_0x7737('0xf'));var deskjs=require(_0x7737('0x10'));var toCsv=require(_0x7737('0x9'));var querystring=require(_0x7737('0x11'));var Papa=require(_0x7737('0x12'));var Redis=require(_0x7737('0x13'));var authService=require(_0x7737('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7737('0x15'));var hardwareService=require(_0x7737('0x16'));var logger=require(_0x7737('0x17'))(_0x7737('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7737('0x19'));var db=require(_0x7737('0x1a'))['db'];config[_0x7737('0x1b')]=_[_0x7737('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7737('0x1d'))[_0x7737('0x1e')](socket);function respondWithStatusCode(_0x246477,_0x379c74){_0x379c74=_0x379c74||0xcc;return function(_0x98ec0b){if(_0x98ec0b){return _0x246477['sendStatus'](_0x379c74);}return _0x246477[_0x7737('0x1f')](_0x379c74)['end']();};}function respondWithResult(_0x533191,_0x42aa2b){_0x42aa2b=_0x42aa2b||0xc8;return function(_0x3a3648){if(_0x3a3648){return _0x533191[_0x7737('0x1f')](_0x42aa2b)[_0x7737('0x20')](_0x3a3648);}};}function respondWithFilteredResult(_0x267722,_0x18e079){return function(_0x5deee2){if(_0x5deee2){var _0x20463d=typeof _0x18e079[_0x7737('0x21')]===_0x7737('0x22')&&typeof _0x18e079[_0x7737('0x23')]===_0x7737('0x22');var _0x24a10a=_0x5deee2[_0x7737('0x24')];var _0x1a8a12=_0x20463d?0x0:_0x18e079[_0x7737('0x21')];var _0x1709a7=_0x20463d?_0x5deee2[_0x7737('0x24')]:_0x18e079[_0x7737('0x21')]+_0x18e079[_0x7737('0x23')];var _0x2d4dfc;if(_0x1709a7>=_0x24a10a){_0x1709a7=_0x24a10a;_0x2d4dfc=0xc8;}else{_0x2d4dfc=0xce;}_0x267722[_0x7737('0x1f')](_0x2d4dfc);return _0x267722[_0x7737('0x25')](_0x7737('0x26'),_0x1a8a12+'-'+_0x1709a7+'/'+_0x24a10a)[_0x7737('0x20')](_0x5deee2);}return null;};}function patchUpdates(_0x237618){return function(_0x1b118d){try{jsonpatch[_0x7737('0x27')](_0x1b118d,_0x237618,!![]);}catch(_0x2be2d4){return BPromise[_0x7737('0x28')](_0x2be2d4);}return _0x1b118d[_0x7737('0x29')]();};}function saveUpdates(_0x365978,_0x5c7f54){return function(_0x1d601b){if(_0x1d601b){return _0x1d601b['update'](_0x365978)[_0x7737('0x2a')](function(_0x1810db){return _0x1810db;});}return null;};}function removeEntity(_0x2e7d83,_0x22c2a6){return function(_0x459847){if(_0x459847){return _0x459847['destroy']()['then'](function(){var _0x2e2e22=_0x459847['get']({'plain':!![]});var _0x2f1680=_0x7737('0x2b');return db[_0x7737('0x2c')]['destroy']({'where':{'type':_0x2f1680,'resourceId':_0x2e2e22['id']}})[_0x7737('0x2a')](function(){return _0x459847;});})[_0x7737('0x2a')](function(){_0x2e7d83[_0x7737('0x1f')](0xcc)[_0x7737('0x2d')]();});}};}function handleEntityNotFound(_0x4dcefa,_0x2ee666){return function(_0x21f72e){if(!_0x21f72e){_0x4dcefa[_0x7737('0x2e')](0x194);}return _0x21f72e;};}function handleError(_0x31d5b6,_0x3e2283){_0x3e2283=_0x3e2283||0x1f4;return function(_0x8d5b67){logger[_0x7737('0x2f')](_0x8d5b67[_0x7737('0x30')]);if(_0x8d5b67[_0x7737('0x31')]){delete _0x8d5b67['name'];}_0x31d5b6['status'](_0x3e2283)['send'](_0x8d5b67);};}exports['index']=function(_0x1dfdbb,_0x1400d5){var _0x4fb908={},_0x2b7bfa={},_0x2484b8={'count':0x0,'rows':[]};var _0x48fba5=_[_0x7737('0x32')](db['OpenchannelQueue'][_0x7737('0x33')],function(_0x347858){return{'name':_0x347858[_0x7737('0x34')],'type':_0x347858[_0x7737('0x35')]['key']};});_0x2b7bfa['model']=_['map'](_0x48fba5,_0x7737('0x31'));_0x2b7bfa[_0x7737('0x36')]=_[_0x7737('0x37')](_0x1dfdbb[_0x7737('0x36')]);_0x2b7bfa[_0x7737('0x38')]=_['intersection'](_0x2b7bfa['model'],_0x2b7bfa['query']);_0x4fb908[_0x7737('0x39')]=_[_0x7737('0x3a')](_0x2b7bfa['model'],qs[_0x7737('0x3b')](_0x1dfdbb[_0x7737('0x36')]['fields']));_0x4fb908[_0x7737('0x39')]=_0x4fb908[_0x7737('0x39')]['length']?_0x4fb908[_0x7737('0x39')]:_0x2b7bfa[_0x7737('0x3c')];if(!_0x1dfdbb[_0x7737('0x36')][_0x7737('0x3d')](_0x7737('0x3e'))){_0x4fb908['limit']=qs['limit'](_0x1dfdbb[_0x7737('0x36')][_0x7737('0x23')]);_0x4fb908[_0x7737('0x21')]=qs['offset'](_0x1dfdbb[_0x7737('0x36')][_0x7737('0x21')]);}_0x4fb908[_0x7737('0x3f')]=qs['sort'](_0x1dfdbb[_0x7737('0x36')][_0x7737('0x40')]);_0x4fb908[_0x7737('0x41')]=qs[_0x7737('0x38')](_[_0x7737('0x42')](_0x1dfdbb[_0x7737('0x36')],_0x2b7bfa['filters']),_0x48fba5);if(_0x1dfdbb[_0x7737('0x36')][_0x7737('0x43')]){_0x4fb908[_0x7737('0x41')]=_[_0x7737('0x44')](_0x4fb908[_0x7737('0x41')],{'$or':_['map'](_0x48fba5,function(_0x425599){if(_0x425599['type']!==_0x7737('0x45')){var _0x14ae71={};_0x14ae71[_0x425599[_0x7737('0x31')]]={'$like':'%'+_0x1dfdbb[_0x7737('0x36')][_0x7737('0x43')]+'%'};return _0x14ae71;}})});}_0x4fb908=_[_0x7737('0x44')]({},_0x4fb908,_0x1dfdbb['options']);var _0x27a390={'where':_0x4fb908[_0x7737('0x41')]};return db[_0x7737('0x46')][_0x7737('0x24')](_0x27a390)[_0x7737('0x2a')](function(_0x2ea881){_0x2484b8['count']=_0x2ea881;if(_0x1dfdbb[_0x7737('0x36')]['includeAll']){_0x4fb908['include']=[{'all':!![]}];}return db[_0x7737('0x46')][_0x7737('0x47')](_0x4fb908);})['then'](function(_0x46815e){_0x2484b8['rows']=_0x46815e;return _0x2484b8;})['then'](respondWithFilteredResult(_0x1400d5,_0x4fb908))[_0x7737('0x48')](handleError(_0x1400d5,null));};exports[_0x7737('0x49')]=function(_0x1c2cfe,_0x5602b4){var _0x2d22b3={'raw':!![],'where':{'id':_0x1c2cfe[_0x7737('0x4a')]['id']}},_0x3c6a01={};_0x3c6a01[_0x7737('0x3c')]=_['keys'](db[_0x7737('0x46')][_0x7737('0x33')]);_0x3c6a01['query']=_['keys'](_0x1c2cfe[_0x7737('0x36')]);_0x3c6a01[_0x7737('0x38')]=_['intersection'](_0x3c6a01['model'],_0x3c6a01[_0x7737('0x36')]);_0x2d22b3['attributes']=_[_0x7737('0x3a')](_0x3c6a01['model'],qs['fields'](_0x1c2cfe['query'][_0x7737('0x3b')]));_0x2d22b3[_0x7737('0x39')]=_0x2d22b3[_0x7737('0x39')][_0x7737('0x4b')]?_0x2d22b3[_0x7737('0x39')]:_0x3c6a01['model'];if(_0x1c2cfe[_0x7737('0x36')][_0x7737('0x4c')]){_0x2d22b3[_0x7737('0x4d')]=[{'all':!![]}];}_0x2d22b3=_[_0x7737('0x44')]({},_0x2d22b3,_0x1c2cfe['options']);return db['OpenchannelQueue'][_0x7737('0x4e')](_0x2d22b3)['then'](handleEntityNotFound(_0x5602b4,null))['then'](respondWithResult(_0x5602b4,null))[_0x7737('0x48')](handleError(_0x5602b4,null));};exports[_0x7737('0x4f')]=function(_0x36e8ff,_0x258821){return db[_0x7737('0x46')][_0x7737('0x4f')](_0x36e8ff[_0x7737('0x50')],{})[_0x7737('0x2a')](function(_0x167c3f){var _0x5408b2=_0x36e8ff[_0x7737('0x51')][_0x7737('0x52')]({'plain':!![]});if(!_0x5408b2)throw new Error(_0x7737('0x53'));if(_0x5408b2[_0x7737('0x54')]==='user'){var _0x191b35=_0x167c3f[_0x7737('0x52')]({'plain':!![]});var _0x1ae3e4=_0x7737('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x1ae3e4,'userProfileId':_0x5408b2[_0x7737('0x55')]},'raw':!![]})[_0x7737('0x2a')](function(_0x52fdc2){if(_0x52fdc2&&_0x52fdc2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x191b35[_0x7737('0x31')],'resourceId':_0x191b35['id'],'type':_0x52fdc2['name'],'sectionId':_0x52fdc2['id']},{})[_0x7737('0x2a')](function(){return _0x167c3f;});}else{return _0x167c3f;}})[_0x7737('0x48')](function(_0x3987b3){logger[_0x7737('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3987b3);throw _0x3987b3;});}return _0x167c3f;})[_0x7737('0x2a')](respondWithResult(_0x258821,0xc9))['catch'](handleError(_0x258821,null));};exports[_0x7737('0x56')]=function(_0x5b3bde,_0x320513){if(_0x5b3bde['body']['id']){delete _0x5b3bde['body']['id'];}return db[_0x7737('0x46')][_0x7737('0x4e')]({'where':{'id':_0x5b3bde['params']['id']}})[_0x7737('0x2a')](handleEntityNotFound(_0x320513,null))[_0x7737('0x2a')](saveUpdates(_0x5b3bde[_0x7737('0x50')],null))[_0x7737('0x2a')](respondWithResult(_0x320513,null))['catch'](handleError(_0x320513,null));};exports[_0x7737('0x57')]=function(_0x4523e7,_0x4dc0f7){return db[_0x7737('0x46')]['find']({'where':{'id':_0x4523e7[_0x7737('0x4a')]['id']}})[_0x7737('0x2a')](handleEntityNotFound(_0x4dc0f7,null))[_0x7737('0x2a')](removeEntity(_0x4dc0f7,null))[_0x7737('0x48')](handleError(_0x4dc0f7,null));};exports['describe']=function(_0x43cdca,_0x496529){return db[_0x7737('0x46')][_0x7737('0x58')]()['then'](respondWithResult(_0x496529,null))['catch'](handleError(_0x496529,null));};exports[_0x7737('0x59')]=function(_0x56572b,_0x55a45e,_0x474de5){var _0x2dae78={'raw':!![],'where':{}},_0x57ce9a={},_0x11bbdd;return db[_0x7737('0x46')][_0x7737('0x5a')]({'where':{'id':_0x56572b[_0x7737('0x4a')]['id']}})['then'](handleEntityNotFound(_0x55a45e,null))['then'](function(_0x3d3c7b){if(_0x3d3c7b){_0x11bbdd=_0x3d3c7b['get']({'plain':!![]});_0x57ce9a['model']=_[_0x7737('0x37')](db[_0x7737('0x5b')]['rawAttributes']);_0x57ce9a[_0x7737('0x36')]=_[_0x7737('0x37')](_0x56572b['query']);_0x57ce9a[_0x7737('0x38')]=_[_0x7737('0x3a')](_0x57ce9a['model'],_0x57ce9a[_0x7737('0x36')]);_0x2dae78[_0x7737('0x39')]=_[_0x7737('0x3a')](_0x57ce9a[_0x7737('0x3c')],qs['fields'](_0x56572b[_0x7737('0x36')][_0x7737('0x3b')]));_0x2dae78[_0x7737('0x39')]=_0x2dae78['attributes'][_0x7737('0x4b')]?_0x2dae78[_0x7737('0x39')]:_0x57ce9a[_0x7737('0x3c')];if(!_0x56572b[_0x7737('0x36')][_0x7737('0x3d')]('nolimit')){_0x2dae78[_0x7737('0x23')]=qs[_0x7737('0x23')](_0x56572b['query'][_0x7737('0x23')]);_0x2dae78[_0x7737('0x21')]=qs[_0x7737('0x21')](_0x56572b['query'][_0x7737('0x21')]);}_0x2dae78['order']=qs['sort'](_0x56572b[_0x7737('0x36')][_0x7737('0x40')]);_0x2dae78[_0x7737('0x41')]=qs['filters'](_['pick'](_0x56572b[_0x7737('0x36')],_0x57ce9a['filters']));_0x2dae78['where']['OpenchannelQueueId']=_0x3d3c7b['id'];if(_0x56572b[_0x7737('0x36')]['filter']){_0x2dae78[_0x7737('0x41')]=_[_0x7737('0x44')](_0x2dae78[_0x7737('0x41')],{'$or':_[_0x7737('0x32')](_0x2dae78[_0x7737('0x39')],function(_0x2b73c1){var _0x522cf7={};_0x522cf7[_0x2b73c1]={'$like':'%'+_0x56572b[_0x7737('0x36')]['filter']+'%'};return _0x522cf7;})});}_0x2dae78=_[_0x7737('0x44')]({},_0x2dae78,_0x56572b[_0x7737('0x5c')]);return db[_0x7737('0x5b')][_0x7737('0x47')](_0x2dae78);}})[_0x7737('0x2a')](function(_0x1aedfc){if(_0x1aedfc){return db[_0x7737('0x5d')][_0x7737('0x5e')]({'where':{'id':_[_0x7737('0x32')](_0x1aedfc,'UserId'),'role':_0x7737('0x5f')},'attributes':['id',_0x7737('0x31'),_0x7737('0x60'),_0x7737('0x61'),'createdAt']});}})['then'](function(_0x1eba2e){if(_0x1eba2e){return{'count':_0x1eba2e[_0x7737('0x24')],'rows':_[_0x7737('0x32')](_0x1eba2e['rows'],function(_0x32305e){return{'membername':_0x32305e['name'],'UserId':_0x32305e['id'],'queue_name':_0x11bbdd[_0x7737('0x31')],'OpenchannelQueueId':_0x11bbdd['id'],'interface':util['format'](_0x7737('0x62'),_0x7737('0x63'),_0x32305e['name']),'penalty':0x0,'paused':_0x32305e[_0x7737('0x60')],'createdAt':_0x32305e[_0x7737('0x64')],'updatedAt':_0x32305e[_0x7737('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7737('0x2a')](respondWithFilteredResult(_0x55a45e,_0x2dae78))['catch'](handleError(_0x55a45e,null));};exports[_0x7737('0x65')]=function(_0x490e7d,_0x511019,_0x2de4a4){var _0x19b15e={};var _0x2837a0={};var _0x2f62ae;var _0x4705d4;return db[_0x7737('0x46')][_0x7737('0x5a')]({'where':{'id':_0x490e7d[_0x7737('0x4a')]['id']}})['then'](handleEntityNotFound(_0x511019,null))[_0x7737('0x2a')](function(_0x3e28e2){if(_0x3e28e2){_0x2f62ae=_0x3e28e2;_0x2837a0['model']=_['keys'](db['Team'][_0x7737('0x33')]);_0x2837a0[_0x7737('0x36')]=_[_0x7737('0x37')](_0x490e7d['query']);_0x2837a0[_0x7737('0x38')]=_[_0x7737('0x3a')](_0x2837a0[_0x7737('0x3c')],_0x2837a0[_0x7737('0x36')]);_0x19b15e[_0x7737('0x39')]=_['intersection'](_0x2837a0[_0x7737('0x3c')],qs[_0x7737('0x3b')](_0x490e7d[_0x7737('0x36')]['fields']));_0x19b15e[_0x7737('0x39')]=_0x19b15e['attributes'][_0x7737('0x4b')]?_0x19b15e[_0x7737('0x39')]:_0x2837a0['model'];_0x19b15e['order']=qs[_0x7737('0x40')](_0x490e7d[_0x7737('0x36')]['sort']);_0x19b15e[_0x7737('0x41')]=qs[_0x7737('0x38')](_[_0x7737('0x42')](_0x490e7d[_0x7737('0x36')],_0x2837a0[_0x7737('0x38')]));if(_0x490e7d[_0x7737('0x36')][_0x7737('0x43')]){_0x19b15e['where']=_[_0x7737('0x44')](_0x19b15e[_0x7737('0x41')],{'$or':_[_0x7737('0x32')](_0x19b15e['attributes'],function(_0x8ddea8){var _0xebad1={};_0xebad1[_0x8ddea8]={'$like':'%'+_0x490e7d['query']['filter']+'%'};return _0xebad1;})});}_0x19b15e=_[_0x7737('0x44')]({},_0x19b15e,_0x490e7d[_0x7737('0x5c')]);return _0x2f62ae[_0x7737('0x65')](_0x19b15e);}})[_0x7737('0x2a')](function(_0x33b582){if(_0x33b582){_0x4705d4=_0x33b582[_0x7737('0x4b')];if(!_0x490e7d[_0x7737('0x36')][_0x7737('0x3d')]('nolimit')){_0x19b15e[_0x7737('0x23')]=qs[_0x7737('0x23')](_0x490e7d[_0x7737('0x36')][_0x7737('0x23')]);_0x19b15e[_0x7737('0x21')]=qs['offset'](_0x490e7d[_0x7737('0x36')][_0x7737('0x21')]);}return _0x2f62ae[_0x7737('0x65')](_0x19b15e);}})['then'](function(_0x262e66){if(_0x262e66){return _0x262e66?{'count':_0x4705d4,'rows':_0x262e66}:null;}})['then'](respondWithResult(_0x511019,null))['catch'](handleError(_0x511019,null));};exports[_0x7737('0x66')]=function(_0x8e900c,_0x291386,_0x29ae98){var _0x7d997f=_0x8e900c[_0x7737('0x50')][_0x7737('0x67')];return db['Team'][_0x7737('0x47')]({'where':{'id':_0x7d997f},'attributes':['id'],'include':[{'model':db[_0x7737('0x5d')],'as':_0x7737('0x68'),'attributes':['id','name',_0x7737('0x69'),_0x7737('0x6a'),_0x7737('0x6b')],'raw':!![]}]})[_0x7737('0x2a')](function(_0x1bcefb){if(_0x1bcefb){var _0x44e66b=_['flatMap'](_0x1bcefb,function(_0x1f0484){var _0x368900=_0x1f0484[_0x7737('0x52')]({'plain':!![]});return _0x368900[_0x7737('0x68')];});return db['OpenchannelQueue'][_0x7737('0x4e')]({'where':{'id':_0x8e900c[_0x7737('0x4a')]['id']}})[_0x7737('0x2a')](function(_0x998e7e){return db[_0x7737('0x6c')][_0x7737('0x6d')](function(_0x10d137){return _0x998e7e[_0x7737('0x66')](_0x7d997f,{'transaction':_0x10d137})[_0x7737('0x2a')](function(){return BPromise['each'](_0x44e66b,function(_0x1b29f9){return db[_0x7737('0x5b')]['findOrCreate']({'where':{'UserId':_0x1b29f9['id'],'OpenchannelQueueId':_0x8e900c[_0x7737('0x4a')]['id']},'transaction':_0x10d137});});})[_0x7737('0x2a')](function(){_0x44e66b[_0x7737('0x6e')](function(_0xfe816c){socket[_0x7737('0x6f')](_0x7737('0x70'),{'UserId':_0xfe816c['id'],'OpenchannelQueueId':_0x998e7e['id']});});});});});}})[_0x7737('0x2a')](respondWithStatusCode(_0x291386,null))[_0x7737('0x48')](handleError(_0x291386,null));};exports[_0x7737('0x71')]=function(_0x52b964,_0x33e8cf,_0x2262fb){return db[_0x7737('0x72')]['findAll']({'where':{'id':_0x52b964['query'][_0x7737('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7737('0x68'),'attributes':['id'],'raw':!![]}]})[_0x7737('0x2a')](handleEntityNotFound(_0x33e8cf,null))[_0x7737('0x2a')](function(_0x35b9b0){var _0x425757=_[_0x7737('0x32')](_0x35b9b0,'id');var _0x25c398=[];var _0x551e0c=[];var _0x351b96=squel[_0x7737('0x73')]();_0x351b96[_0x7737('0x74')](_0x7737('0x75'))[_0x7737('0x76')](_0x7737('0x77'),'tq')['join'](_0x7737('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7737('0x41')](_0x7737('0x79'),_0x52b964['params']['id']);for(var _0x5aead5=0x0;_0x5aead5<_0x35b9b0['length'];_0x5aead5+=0x1){let _0x48d8c2=_0x35b9b0[_0x5aead5];for(var _0x48cebb=0x0;_0x48cebb<_0x48d8c2[_0x7737('0x68')]['length'];_0x48cebb+=0x1){let _0xea19e7=_0x48d8c2[_0x7737('0x68')][_0x48cebb];var _0x40b0e2=_0x351b96['clone']();_0x40b0e2[_0x7737('0x41')](_0x7737('0x7a'),_0xea19e7['id']);_0x551e0c['push'](db[_0x7737('0x6c')][_0x7737('0x36')](_0x40b0e2[_0x7737('0x7b')](),{'type':db['sequelize'][_0x7737('0x7c')][_0x7737('0x7d')]})[_0x7737('0x2a')](function(_0x3907c8){if(_0x3907c8[_0x7737('0x4b')]===0x1){return _0xea19e7['id'];}else{var _0x593e1a=_['every'](_['map'](_0x3907c8,_0x7737('0x7e')),function(_0x341e2b){return _[_0x7737('0x7f')](_0x425757,_0x341e2b);});if(_0x593e1a){return _0xea19e7['id'];}}}));}}return BPromise[_0x7737('0x80')](_0x551e0c)[_0x7737('0x2a')](function(_0x482baf){_0x25c398=_(_0x25c398)[_0x7737('0x81')](_0x482baf)[_0x7737('0x82')]()[_0x7737('0x83')]();return db[_0x7737('0x46')]['find']({'where':{'id':_0x52b964[_0x7737('0x4a')]['id']}})[_0x7737('0x2a')](function(_0x39e889){return db['sequelize'][_0x7737('0x6d')](function(_0x32fea1){return _0x39e889['removeTeams'](_0x52b964[_0x7737('0x36')][_0x7737('0x67')],{'transaction':_0x32fea1})[_0x7737('0x2a')](function(){if(!_[_0x7737('0x84')](_0x25c398)){return _0x39e889[_0x7737('0x85')](_0x25c398,{'transaction':_0x32fea1});}})[_0x7737('0x2a')](function(){_0x25c398[_0x7737('0x6e')](function(_0x1ed6ff){socket[_0x7737('0x6f')](_0x7737('0x86'),{'UserId':_0x1ed6ff,'OpenchannelQueueId':_0x39e889['id']});});});});});});})[_0x7737('0x2a')](respondWithStatusCode(_0x33e8cf,null))[_0x7737('0x48')](handleError(_0x33e8cf,null));};exports[_0x7737('0x87')]=function(_0x377edc,_0x5d5db6,_0x5dec51){return db[_0x7737('0x46')][_0x7737('0x4e')]({'where':{'id':_0x377edc[_0x7737('0x4a')]['id']}})[_0x7737('0x2a')](handleEntityNotFound(_0x5d5db6,null))[_0x7737('0x2a')](function(_0x47b728){if(_0x47b728){return _0x47b728[_0x7737('0x87')](_0x377edc[_0x7737('0x50')][_0x7737('0x67')],_[_0x7737('0x88')](_0x377edc[_0x7737('0x50')],[_0x7737('0x67'),'id'])||{})[_0x7737('0x89')](function(_0x5a81ee){for(var _0xbb42d2=0x0;_0xbb42d2<_0x377edc[_0x7737('0x50')][_0x7737('0x67')][_0x7737('0x4b')];_0xbb42d2+=0x1){socket[_0x7737('0x6f')](_0x7737('0x70'),{'UserId':Number(_0x377edc[_0x7737('0x50')]['ids'][_0xbb42d2]),'OpenchannelQueueId':Number(_0x377edc[_0x7737('0x4a')]['id'])});}return _0x5a81ee;});}})[_0x7737('0x2a')](respondWithResult(_0x5d5db6,null))[_0x7737('0x48')](handleError(_0x5d5db6,null));};exports['removeAgents']=function(_0x3eeffe,_0x2b63a0,_0x4fab3b){return db['OpenchannelQueue']['find']({'where':{'id':_0x3eeffe[_0x7737('0x4a')]['id']}})[_0x7737('0x2a')](handleEntityNotFound(_0x2b63a0,null))[_0x7737('0x2a')](function(_0x5d3db0){if(_0x5d3db0){return _0x5d3db0[_0x7737('0x85')](_0x3eeffe['query'][_0x7737('0x67')])[_0x7737('0x2a')](function(){if(_[_0x7737('0x8a')](_0x3eeffe[_0x7737('0x36')][_0x7737('0x67')])){for(var _0x3dc8e8=0x0;_0x3dc8e8<_0x3eeffe[_0x7737('0x36')][_0x7737('0x67')]['length'];_0x3dc8e8+=0x1){socket[_0x7737('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3eeffe['query'][_0x7737('0x67')][_0x3dc8e8]),'OpenchannelQueueId':Number(_0x3eeffe[_0x7737('0x4a')]['id'])});}}else{socket[_0x7737('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3eeffe[_0x7737('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3eeffe[_0x7737('0x4a')]['id'])});}});}})[_0x7737('0x2a')](respondWithStatusCode(_0x2b63a0,null))[_0x7737('0x48')](handleError(_0x2b63a0,null));};exports['getAgents']=function(_0x2ce8ea,_0x56af8f,_0x7b3dda){var _0x452c8a={};var _0x53731b={};var _0x5ef2e3;var _0x1a69b9;return db['OpenchannelQueue'][_0x7737('0x5a')]({'where':{'id':_0x2ce8ea['params']['id']}})['then'](handleEntityNotFound(_0x56af8f,null))[_0x7737('0x2a')](function(_0x4c8ffa){if(_0x4c8ffa){_0x5ef2e3=_0x4c8ffa;_0x53731b[_0x7737('0x3c')]=_[_0x7737('0x37')](db[_0x7737('0x5d')][_0x7737('0x33')]);_0x53731b[_0x7737('0x36')]=_[_0x7737('0x37')](_0x2ce8ea[_0x7737('0x36')]);_0x53731b[_0x7737('0x38')]=_[_0x7737('0x3a')](_0x53731b[_0x7737('0x3c')],_0x53731b[_0x7737('0x36')]);_0x452c8a[_0x7737('0x39')]=_[_0x7737('0x3a')](_0x53731b['model'],qs[_0x7737('0x3b')](_0x2ce8ea[_0x7737('0x36')][_0x7737('0x3b')]));_0x452c8a['attributes']=_0x452c8a['attributes'][_0x7737('0x4b')]?_0x452c8a[_0x7737('0x39')]:_0x53731b['model'];_0x452c8a[_0x7737('0x3f')]=qs[_0x7737('0x40')](_0x2ce8ea[_0x7737('0x36')][_0x7737('0x40')]);_0x452c8a[_0x7737('0x41')]=qs[_0x7737('0x38')](_[_0x7737('0x42')](_0x2ce8ea['query'],_0x53731b[_0x7737('0x38')]));if(_0x2ce8ea[_0x7737('0x36')][_0x7737('0x43')]){_0x452c8a[_0x7737('0x41')]=_[_0x7737('0x44')](_0x452c8a[_0x7737('0x41')],{'$or':_[_0x7737('0x32')](_0x452c8a[_0x7737('0x39')],function(_0x155b2b){var _0x714c9b={};_0x714c9b[_0x155b2b]={'$like':'%'+_0x2ce8ea['query'][_0x7737('0x43')]+'%'};return _0x714c9b;})});}_0x452c8a=_['merge']({},_0x452c8a,_0x2ce8ea['options']);return _0x5ef2e3[_0x7737('0x8b')](_0x452c8a);}})[_0x7737('0x2a')](function(_0x4e053c){if(_0x4e053c){_0x1a69b9=_0x4e053c[_0x7737('0x4b')];if(!_0x2ce8ea['query'][_0x7737('0x3d')](_0x7737('0x3e'))){_0x452c8a[_0x7737('0x23')]=qs[_0x7737('0x23')](_0x2ce8ea[_0x7737('0x36')][_0x7737('0x23')]);_0x452c8a[_0x7737('0x21')]=qs[_0x7737('0x21')](_0x2ce8ea['query'][_0x7737('0x21')]);}return _0x5ef2e3[_0x7737('0x8b')](_0x452c8a);}})['then'](function(_0x46baef){if(_0x46baef){return _0x46baef?{'count':_0x1a69b9,'rows':_0x46baef}:null;}})[_0x7737('0x2a')](respondWithResult(_0x56af8f,null))['catch'](handleError(_0x56af8f,null));}; \ No newline at end of file +var _0x87fd=['register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','OpenchannelQueue','includeAll','include','findAll','catch','show','params','rawAttributes','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','rows','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','online','flatMap','Agents','sequelize','addTeams','each','findOrCreate','forEach','emit','removeTeams','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket'];(function(_0x2580f4,_0x2016b5){var _0x5a8838=function(_0x5b72bc){while(--_0x5b72bc){_0x2580f4['push'](_0x2580f4['shift']());}};_0x5a8838(++_0x2016b5);}(_0x87fd,0x6d));var _0xd87f=function(_0x39c030,_0x448b62){_0x39c030=_0x39c030-0x0;var _0x4caa03=_0x87fd[_0x39c030];return _0x4caa03;};'use strict';var emlformat=require(_0xd87f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd87f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd87f('0x2'));var moment=require(_0xd87f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd87f('0x4'));var util=require(_0xd87f('0x5'));var path=require(_0xd87f('0x6'));var sox=require(_0xd87f('0x7'));var csv=require(_0xd87f('0x8'));var ejs=require(_0xd87f('0x9'));var fs=require('fs');var fs_extra=require(_0xd87f('0xa'));var _=require(_0xd87f('0xb'));var squel=require(_0xd87f('0xc'));var crypto=require('crypto');var jsforce=require(_0xd87f('0xd'));var deskjs=require(_0xd87f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd87f('0xf'));var Papa=require(_0xd87f('0x10'));var Redis=require(_0xd87f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd87f('0x12'));var as=require(_0xd87f('0x13'));var hardwareService=require(_0xd87f('0x14'));var logger=require('../../config/logger')(_0xd87f('0x15'));var utils=require(_0xd87f('0x16'));var config=require(_0xd87f('0x17'));var licenseUtil=require(_0xd87f('0x18'));var db=require(_0xd87f('0x19'))['db'];config[_0xd87f('0x1a')]=_[_0xd87f('0x1b')](config[_0xd87f('0x1a')],{'host':_0xd87f('0x1c'),'port':0x18eb});var socket=require(_0xd87f('0x1d'))(new Redis(config[_0xd87f('0x1a')]));require(_0xd87f('0x1e'))[_0xd87f('0x1f')](socket);function respondWithStatusCode(_0x3032e2,_0x2db739){_0x2db739=_0x2db739||0xcc;return function(_0x3f2242){if(_0x3f2242){return _0x3032e2[_0xd87f('0x20')](_0x2db739);}return _0x3032e2['status'](_0x2db739)[_0xd87f('0x21')]();};}function respondWithResult(_0x27773f,_0x214032){_0x214032=_0x214032||0xc8;return function(_0x2aa368){if(_0x2aa368){return _0x27773f[_0xd87f('0x22')](_0x214032)['json'](_0x2aa368);}};}function respondWithFilteredResult(_0x3796b5,_0x31ef6a){return function(_0x208fdc){if(_0x208fdc){var _0x5b154a=typeof _0x31ef6a[_0xd87f('0x23')]===_0xd87f('0x24')&&typeof _0x31ef6a[_0xd87f('0x25')]===_0xd87f('0x24');var _0x1e1d76=_0x208fdc[_0xd87f('0x26')];var _0x258313=_0x5b154a?0x0:_0x31ef6a[_0xd87f('0x23')];var _0x518287=_0x5b154a?_0x208fdc['count']:_0x31ef6a[_0xd87f('0x23')]+_0x31ef6a['limit'];var _0x586c00;if(_0x518287>=_0x1e1d76){_0x518287=_0x1e1d76;_0x586c00=0xc8;}else{_0x586c00=0xce;}_0x3796b5[_0xd87f('0x22')](_0x586c00);return _0x3796b5[_0xd87f('0x27')](_0xd87f('0x28'),_0x258313+'-'+_0x518287+'/'+_0x1e1d76)['json'](_0x208fdc);}return null;};}function patchUpdates(_0x218bad){return function(_0x1268d3){try{jsonpatch[_0xd87f('0x29')](_0x1268d3,_0x218bad,!![]);}catch(_0x3c4dc6){return BPromise[_0xd87f('0x2a')](_0x3c4dc6);}return _0x1268d3['save']();};}function saveUpdates(_0x4b3c38,_0x56c3c7){return function(_0x32e682){if(_0x32e682){return _0x32e682[_0xd87f('0x2b')](_0x4b3c38)[_0xd87f('0x2c')](function(_0x5b12e1){return _0x5b12e1;});}return null;};}function removeEntity(_0x23b948,_0x1ba386){return function(_0x4c28c0){if(_0x4c28c0){return _0x4c28c0[_0xd87f('0x2d')]()[_0xd87f('0x2c')](function(){var _0x1d897b=_0x4c28c0[_0xd87f('0x2e')]({'plain':!![]});var _0x37c0b4='OpenchannelQueues';return db[_0xd87f('0x2f')][_0xd87f('0x2d')]({'where':{'type':_0x37c0b4,'resourceId':_0x1d897b['id']}})['then'](function(){return _0x4c28c0;});})['then'](function(){_0x23b948[_0xd87f('0x22')](0xcc)[_0xd87f('0x21')]();});}};}function handleEntityNotFound(_0x375e46,_0x120f40){return function(_0x2d0081){if(!_0x2d0081){_0x375e46[_0xd87f('0x20')](0x194);}return _0x2d0081;};}function handleError(_0x4f5653,_0x3813ef){_0x3813ef=_0x3813ef||0x1f4;return function(_0x3a6b87){logger['error'](_0x3a6b87[_0xd87f('0x30')]);if(_0x3a6b87[_0xd87f('0x31')]){delete _0x3a6b87[_0xd87f('0x31')];}_0x4f5653[_0xd87f('0x22')](_0x3813ef)[_0xd87f('0x32')](_0x3a6b87);};}exports[_0xd87f('0x33')]=function(_0x30ce10,_0x3b3a16){var _0x2836d1={},_0x28ac74={},_0x40955a={'count':0x0,'rows':[]};var _0x287803=_[_0xd87f('0x34')](db['OpenchannelQueue']['rawAttributes'],function(_0x47cee2){return{'name':_0x47cee2['fieldName'],'type':_0x47cee2[_0xd87f('0x35')][_0xd87f('0x36')]};});_0x28ac74[_0xd87f('0x37')]=_[_0xd87f('0x34')](_0x287803,'name');_0x28ac74[_0xd87f('0x38')]=_[_0xd87f('0x39')](_0x30ce10['query']);_0x28ac74[_0xd87f('0x3a')]=_[_0xd87f('0x3b')](_0x28ac74[_0xd87f('0x37')],_0x28ac74[_0xd87f('0x38')]);_0x2836d1[_0xd87f('0x3c')]=_['intersection'](_0x28ac74[_0xd87f('0x37')],qs[_0xd87f('0x3d')](_0x30ce10[_0xd87f('0x38')][_0xd87f('0x3d')]));_0x2836d1[_0xd87f('0x3c')]=_0x2836d1['attributes'][_0xd87f('0x3e')]?_0x2836d1[_0xd87f('0x3c')]:_0x28ac74['model'];if(!_0x30ce10['query']['hasOwnProperty'](_0xd87f('0x3f'))){_0x2836d1[_0xd87f('0x25')]=qs[_0xd87f('0x25')](_0x30ce10[_0xd87f('0x38')][_0xd87f('0x25')]);_0x2836d1['offset']=qs['offset'](_0x30ce10[_0xd87f('0x38')][_0xd87f('0x23')]);}_0x2836d1['order']=qs[_0xd87f('0x40')](_0x30ce10['query'][_0xd87f('0x40')]);_0x2836d1['where']=qs[_0xd87f('0x3a')](_[_0xd87f('0x41')](_0x30ce10[_0xd87f('0x38')],_0x28ac74[_0xd87f('0x3a')]),_0x287803);if(_0x30ce10[_0xd87f('0x38')][_0xd87f('0x42')]){_0x2836d1[_0xd87f('0x43')]=_[_0xd87f('0x44')](_0x2836d1[_0xd87f('0x43')],{'$or':_[_0xd87f('0x34')](_0x287803,function(_0x5a3c76){if(_0x5a3c76[_0xd87f('0x35')]!==_0xd87f('0x45')){var _0x56d14d={};_0x56d14d[_0x5a3c76[_0xd87f('0x31')]]={'$like':'%'+_0x30ce10[_0xd87f('0x38')][_0xd87f('0x42')]+'%'};return _0x56d14d;}})});}_0x2836d1=_['merge']({},_0x2836d1,_0x30ce10['options']);var _0x46c877={'where':_0x2836d1[_0xd87f('0x43')]};return db[_0xd87f('0x46')][_0xd87f('0x26')](_0x46c877)[_0xd87f('0x2c')](function(_0x5aac88){_0x40955a['count']=_0x5aac88;if(_0x30ce10[_0xd87f('0x38')][_0xd87f('0x47')]){_0x2836d1[_0xd87f('0x48')]=[{'all':!![]}];}return db[_0xd87f('0x46')][_0xd87f('0x49')](_0x2836d1);})[_0xd87f('0x2c')](function(_0x3e9893){_0x40955a['rows']=_0x3e9893;return _0x40955a;})['then'](respondWithFilteredResult(_0x3b3a16,_0x2836d1))[_0xd87f('0x4a')](handleError(_0x3b3a16,null));};exports[_0xd87f('0x4b')]=function(_0x46bb83,_0x4c50db){var _0xb04559={'raw':!![],'where':{'id':_0x46bb83[_0xd87f('0x4c')]['id']}},_0x253d04={};_0x253d04[_0xd87f('0x37')]=_['keys'](db[_0xd87f('0x46')][_0xd87f('0x4d')]);_0x253d04[_0xd87f('0x38')]=_[_0xd87f('0x39')](_0x46bb83[_0xd87f('0x38')]);_0x253d04['filters']=_[_0xd87f('0x3b')](_0x253d04['model'],_0x253d04['query']);_0xb04559['attributes']=_[_0xd87f('0x3b')](_0x253d04[_0xd87f('0x37')],qs[_0xd87f('0x3d')](_0x46bb83['query'][_0xd87f('0x3d')]));_0xb04559[_0xd87f('0x3c')]=_0xb04559[_0xd87f('0x3c')][_0xd87f('0x3e')]?_0xb04559['attributes']:_0x253d04[_0xd87f('0x37')];if(_0x46bb83[_0xd87f('0x38')][_0xd87f('0x47')]){_0xb04559[_0xd87f('0x48')]=[{'all':!![]}];}_0xb04559=_[_0xd87f('0x44')]({},_0xb04559,_0x46bb83[_0xd87f('0x4e')]);return db['OpenchannelQueue']['find'](_0xb04559)['then'](handleEntityNotFound(_0x4c50db,null))[_0xd87f('0x2c')](respondWithResult(_0x4c50db,null))[_0xd87f('0x4a')](handleError(_0x4c50db,null));};exports['create']=function(_0x45ad37,_0x29ee2a){return db['OpenchannelQueue']['create'](_0x45ad37[_0xd87f('0x4f')],{})['then'](function(_0x55f3b6){var _0x4fc607=_0x45ad37['user']['get']({'plain':!![]});if(!_0x4fc607)throw new Error(_0xd87f('0x50'));if(_0x4fc607[_0xd87f('0x51')]===_0xd87f('0x52')){var _0xd1d1fc=_0x55f3b6['get']({'plain':!![]});var _0x1596a4=_0xd87f('0x53');return db[_0xd87f('0x54')][_0xd87f('0x55')]({'where':{'name':_0x1596a4,'userProfileId':_0x4fc607['userProfileId']},'raw':!![]})[_0xd87f('0x2c')](function(_0x4ebe30){if(_0x4ebe30&&_0x4ebe30[_0xd87f('0x56')]===0x0){return db[_0xd87f('0x2f')][_0xd87f('0x57')]({'name':_0xd1d1fc[_0xd87f('0x31')],'resourceId':_0xd1d1fc['id'],'type':_0x4ebe30[_0xd87f('0x31')],'sectionId':_0x4ebe30['id']},{})['then'](function(){return _0x55f3b6;});}else{return _0x55f3b6;}})[_0xd87f('0x4a')](function(_0x4c055a){logger['error'](_0xd87f('0x58'),_0x4c055a);throw _0x4c055a;});}return _0x55f3b6;})['then'](respondWithResult(_0x29ee2a,0xc9))['catch'](handleError(_0x29ee2a,null));};exports[_0xd87f('0x2b')]=function(_0xd5eb27,_0x402a2d){if(_0xd5eb27[_0xd87f('0x4f')]['id']){delete _0xd5eb27[_0xd87f('0x4f')]['id'];}return db[_0xd87f('0x46')][_0xd87f('0x55')]({'where':{'id':_0xd5eb27[_0xd87f('0x4c')]['id']}})[_0xd87f('0x2c')](handleEntityNotFound(_0x402a2d,null))[_0xd87f('0x2c')](saveUpdates(_0xd5eb27['body'],null))['then'](respondWithResult(_0x402a2d,null))[_0xd87f('0x4a')](handleError(_0x402a2d,null));};exports[_0xd87f('0x2d')]=function(_0x41d9b6,_0x2af361){return db[_0xd87f('0x46')][_0xd87f('0x55')]({'where':{'id':_0x41d9b6[_0xd87f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2af361,null))[_0xd87f('0x2c')](removeEntity(_0x2af361,null))['catch'](handleError(_0x2af361,null));};exports[_0xd87f('0x59')]=function(_0x21a80d,_0xbb0923){return db[_0xd87f('0x46')][_0xd87f('0x59')]()[_0xd87f('0x2c')](respondWithResult(_0xbb0923,null))[_0xd87f('0x4a')](handleError(_0xbb0923,null));};exports[_0xd87f('0x5a')]=function(_0x54bb1c,_0x3382ad,_0xc5f332){var _0x10361a={'raw':!![],'where':{}},_0x48de12={},_0x47ad45;return db['OpenchannelQueue'][_0xd87f('0x5b')]({'where':{'id':_0x54bb1c[_0xd87f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3382ad,null))[_0xd87f('0x2c')](function(_0x5c5633){if(_0x5c5633){_0x47ad45=_0x5c5633[_0xd87f('0x2e')]({'plain':!![]});_0x48de12[_0xd87f('0x37')]=_[_0xd87f('0x39')](db[_0xd87f('0x5c')][_0xd87f('0x4d')]);_0x48de12[_0xd87f('0x38')]=_[_0xd87f('0x39')](_0x54bb1c[_0xd87f('0x38')]);_0x48de12[_0xd87f('0x3a')]=_[_0xd87f('0x3b')](_0x48de12['model'],_0x48de12[_0xd87f('0x38')]);_0x10361a[_0xd87f('0x3c')]=_[_0xd87f('0x3b')](_0x48de12[_0xd87f('0x37')],qs['fields'](_0x54bb1c[_0xd87f('0x38')][_0xd87f('0x3d')]));_0x10361a[_0xd87f('0x3c')]=_0x10361a[_0xd87f('0x3c')]['length']?_0x10361a[_0xd87f('0x3c')]:_0x48de12['model'];if(!_0x54bb1c[_0xd87f('0x38')][_0xd87f('0x5d')]('nolimit')){_0x10361a[_0xd87f('0x25')]=qs[_0xd87f('0x25')](_0x54bb1c['query'][_0xd87f('0x25')]);_0x10361a['offset']=qs[_0xd87f('0x23')](_0x54bb1c['query'][_0xd87f('0x23')]);}_0x10361a[_0xd87f('0x5e')]=qs[_0xd87f('0x40')](_0x54bb1c['query'][_0xd87f('0x40')]);_0x10361a['where']=qs[_0xd87f('0x3a')](_[_0xd87f('0x41')](_0x54bb1c['query'],_0x48de12[_0xd87f('0x3a')]));_0x10361a[_0xd87f('0x43')][_0xd87f('0x5f')]=_0x5c5633['id'];if(_0x54bb1c[_0xd87f('0x38')][_0xd87f('0x42')]){_0x10361a[_0xd87f('0x43')]=_['merge'](_0x10361a[_0xd87f('0x43')],{'$or':_[_0xd87f('0x34')](_0x10361a[_0xd87f('0x3c')],function(_0x41b093){var _0x5ed335={};_0x5ed335[_0x41b093]={'$like':'%'+_0x54bb1c[_0xd87f('0x38')]['filter']+'%'};return _0x5ed335;})});}_0x10361a=_[_0xd87f('0x44')]({},_0x10361a,_0x54bb1c[_0xd87f('0x4e')]);return db[_0xd87f('0x5c')][_0xd87f('0x49')](_0x10361a);}})[_0xd87f('0x2c')](function(_0x333740){if(_0x333740){return db[_0xd87f('0x60')][_0xd87f('0x61')]({'where':{'id':_[_0xd87f('0x34')](_0x333740,_0xd87f('0x62')),'role':_0xd87f('0x63')},'attributes':['id',_0xd87f('0x31'),_0xd87f('0x64'),'updatedAt','createdAt']});}})[_0xd87f('0x2c')](function(_0x300964){if(_0x300964){return{'count':_0x300964[_0xd87f('0x26')],'rows':_[_0xd87f('0x34')](_0x300964[_0xd87f('0x65')],function(_0x42c657){return{'membername':_0x42c657[_0xd87f('0x31')],'UserId':_0x42c657['id'],'queue_name':_0x47ad45[_0xd87f('0x31')],'OpenchannelQueueId':_0x47ad45['id'],'interface':util[_0xd87f('0x66')](_0xd87f('0x67'),_0xd87f('0x68'),_0x42c657[_0xd87f('0x31')]),'penalty':0x0,'paused':_0x42c657['openchannelPause'],'createdAt':_0x42c657[_0xd87f('0x69')],'updatedAt':_0x42c657[_0xd87f('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd87f('0x2c')](respondWithFilteredResult(_0x3382ad,_0x10361a))[_0xd87f('0x4a')](handleError(_0x3382ad,null));};exports[_0xd87f('0x6b')]=function(_0x47c48e,_0xa4a54f,_0x28e8f7){var _0x2263d3={};var _0x1a6e24={};var _0x397133;var _0x2eaebd;return db[_0xd87f('0x46')]['findOne']({'where':{'id':_0x47c48e[_0xd87f('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa4a54f,null))['then'](function(_0x33811a){if(_0x33811a){_0x397133=_0x33811a;_0x1a6e24[_0xd87f('0x37')]=_[_0xd87f('0x39')](db[_0xd87f('0x6c')]['rawAttributes']);_0x1a6e24[_0xd87f('0x38')]=_[_0xd87f('0x39')](_0x47c48e['query']);_0x1a6e24[_0xd87f('0x3a')]=_[_0xd87f('0x3b')](_0x1a6e24['model'],_0x1a6e24['query']);_0x2263d3['attributes']=_[_0xd87f('0x3b')](_0x1a6e24['model'],qs['fields'](_0x47c48e[_0xd87f('0x38')][_0xd87f('0x3d')]));_0x2263d3['attributes']=_0x2263d3[_0xd87f('0x3c')]['length']?_0x2263d3[_0xd87f('0x3c')]:_0x1a6e24[_0xd87f('0x37')];_0x2263d3[_0xd87f('0x5e')]=qs[_0xd87f('0x40')](_0x47c48e['query'][_0xd87f('0x40')]);_0x2263d3[_0xd87f('0x43')]=qs[_0xd87f('0x3a')](_[_0xd87f('0x41')](_0x47c48e[_0xd87f('0x38')],_0x1a6e24[_0xd87f('0x3a')]));if(_0x47c48e[_0xd87f('0x38')][_0xd87f('0x42')]){_0x2263d3[_0xd87f('0x43')]=_['merge'](_0x2263d3[_0xd87f('0x43')],{'$or':_[_0xd87f('0x34')](_0x2263d3[_0xd87f('0x3c')],function(_0x59ea29){var _0x176abf={};_0x176abf[_0x59ea29]={'$like':'%'+_0x47c48e['query']['filter']+'%'};return _0x176abf;})});}_0x2263d3=_[_0xd87f('0x44')]({},_0x2263d3,_0x47c48e['options']);return _0x397133[_0xd87f('0x6b')](_0x2263d3);}})[_0xd87f('0x2c')](function(_0x205909){if(_0x205909){_0x2eaebd=_0x205909[_0xd87f('0x3e')];if(!_0x47c48e[_0xd87f('0x38')][_0xd87f('0x5d')](_0xd87f('0x3f'))){_0x2263d3['limit']=qs[_0xd87f('0x25')](_0x47c48e[_0xd87f('0x38')][_0xd87f('0x25')]);_0x2263d3[_0xd87f('0x23')]=qs[_0xd87f('0x23')](_0x47c48e[_0xd87f('0x38')][_0xd87f('0x23')]);}return _0x397133[_0xd87f('0x6b')](_0x2263d3);}})[_0xd87f('0x2c')](function(_0x23d3f0){if(_0x23d3f0){return _0x23d3f0?{'count':_0x2eaebd,'rows':_0x23d3f0}:null;}})[_0xd87f('0x2c')](respondWithResult(_0xa4a54f,null))[_0xd87f('0x4a')](handleError(_0xa4a54f,null));};exports['addTeams']=function(_0x36e94d,_0xa4b2db,_0x48d86e){var _0x282b4c=_0x36e94d['body']['ids'];return db['Team'][_0xd87f('0x49')]({'where':{'id':_0x282b4c},'attributes':['id'],'include':[{'model':db[_0xd87f('0x60')],'as':'Agents','attributes':['id',_0xd87f('0x31'),_0xd87f('0x6d'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0xa3087c){if(_0xa3087c){var _0x16d446=_[_0xd87f('0x6e')](_0xa3087c,function(_0x53846a){var _0x142be5=_0x53846a[_0xd87f('0x2e')]({'plain':!![]});return _0x142be5[_0xd87f('0x6f')];});return db['OpenchannelQueue'][_0xd87f('0x55')]({'where':{'id':_0x36e94d[_0xd87f('0x4c')]['id']}})[_0xd87f('0x2c')](function(_0x33bf47){return db[_0xd87f('0x70')]['transaction'](function(_0x243123){return _0x33bf47[_0xd87f('0x71')](_0x282b4c,{'transaction':_0x243123})[_0xd87f('0x2c')](function(){return BPromise[_0xd87f('0x72')](_0x16d446,function(_0x442ede){return db[_0xd87f('0x5c')][_0xd87f('0x73')]({'where':{'UserId':_0x442ede['id'],'OpenchannelQueueId':_0x36e94d[_0xd87f('0x4c')]['id']},'transaction':_0x243123});});})[_0xd87f('0x2c')](function(){_0x16d446[_0xd87f('0x74')](function(_0x3da707){socket[_0xd87f('0x75')]('userOpenchannelQueue:save',{'UserId':_0x3da707['id'],'OpenchannelQueueId':_0x33bf47['id']});});});});});}})[_0xd87f('0x2c')](respondWithStatusCode(_0xa4b2db,null))[_0xd87f('0x4a')](handleError(_0xa4b2db,null));};exports[_0xd87f('0x76')]=function(_0x45fafb,_0x1b5631,_0x56da3c){return db[_0xd87f('0x6c')][_0xd87f('0x49')]({'where':{'id':_0x45fafb[_0xd87f('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd87f('0x60')],'as':_0xd87f('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xd87f('0x2c')](handleEntityNotFound(_0x1b5631,null))[_0xd87f('0x2c')](function(_0xed2866){var _0x56e1b0=_[_0xd87f('0x34')](_0xed2866,'id');var _0x1d19c7=[];var _0x3ab611=[];var _0x32cfbe=squel['select']();_0x32cfbe['field']('tq.TeamId')[_0xd87f('0x77')]('team_has_openchannel_queues','tq')['join'](_0xd87f('0x78'),'ut',_0xd87f('0x79'))[_0xd87f('0x43')]('OpenchannelQueueId\x20=\x20?',_0x45fafb[_0xd87f('0x4c')]['id']);for(var _0x43f98a=0x0;_0x43f98a<_0xed2866['length'];_0x43f98a+=0x1){let _0x5de317=_0xed2866[_0x43f98a];for(var _0x172020=0x0;_0x172020<_0x5de317[_0xd87f('0x6f')][_0xd87f('0x3e')];_0x172020+=0x1){let _0x41c0f2=_0x5de317[_0xd87f('0x6f')][_0x172020];var _0x5bca5a=_0x32cfbe[_0xd87f('0x7a')]();_0x5bca5a['where'](_0xd87f('0x7b'),_0x41c0f2['id']);_0x3ab611[_0xd87f('0x7c')](db[_0xd87f('0x70')][_0xd87f('0x38')](_0x5bca5a[_0xd87f('0x7d')](),{'type':db[_0xd87f('0x70')][_0xd87f('0x7e')][_0xd87f('0x7f')]})[_0xd87f('0x2c')](function(_0x2d9cde){if(_0x2d9cde[_0xd87f('0x3e')]===0x1){return _0x41c0f2['id'];}else{var _0x1708d7=_['every'](_[_0xd87f('0x34')](_0x2d9cde,_0xd87f('0x80')),function(_0x21b767){return _['includes'](_0x56e1b0,_0x21b767);});if(_0x1708d7){return _0x41c0f2['id'];}}}));}}return BPromise[_0xd87f('0x81')](_0x3ab611)[_0xd87f('0x2c')](function(_0x4906e4){_0x1d19c7=_(_0x1d19c7)[_0xd87f('0x82')](_0x4906e4)[_0xd87f('0x83')]()['value']();return db[_0xd87f('0x46')][_0xd87f('0x55')]({'where':{'id':_0x45fafb['params']['id']}})[_0xd87f('0x2c')](function(_0x39d9de){return db[_0xd87f('0x70')]['transaction'](function(_0x14d192){return _0x39d9de['removeTeams'](_0x45fafb[_0xd87f('0x38')][_0xd87f('0x84')],{'transaction':_0x14d192})[_0xd87f('0x2c')](function(){if(!_[_0xd87f('0x85')](_0x1d19c7)){return _0x39d9de[_0xd87f('0x86')](_0x1d19c7,{'transaction':_0x14d192});}})[_0xd87f('0x2c')](function(){_0x1d19c7[_0xd87f('0x74')](function(_0x5363d5){socket[_0xd87f('0x75')](_0xd87f('0x87'),{'UserId':_0x5363d5,'OpenchannelQueueId':_0x39d9de['id']});});});});});});})['then'](respondWithStatusCode(_0x1b5631,null))['catch'](handleError(_0x1b5631,null));};exports[_0xd87f('0x88')]=function(_0x34f5bb,_0x1ad39f,_0xea325f){return db[_0xd87f('0x46')][_0xd87f('0x55')]({'where':{'id':_0x34f5bb[_0xd87f('0x4c')]['id']}})[_0xd87f('0x2c')](handleEntityNotFound(_0x1ad39f,null))[_0xd87f('0x2c')](function(_0xf116ac){if(_0xf116ac){return _0xf116ac[_0xd87f('0x88')](_0x34f5bb[_0xd87f('0x4f')][_0xd87f('0x84')],_['omit'](_0x34f5bb[_0xd87f('0x4f')],['ids','id'])||{})[_0xd87f('0x89')](function(_0x155ad2){for(var _0x56e8d7=0x0;_0x56e8d7<_0x34f5bb[_0xd87f('0x4f')][_0xd87f('0x84')][_0xd87f('0x3e')];_0x56e8d7+=0x1){socket[_0xd87f('0x75')]('userOpenchannelQueue:save',{'UserId':Number(_0x34f5bb[_0xd87f('0x4f')][_0xd87f('0x84')][_0x56e8d7]),'OpenchannelQueueId':Number(_0x34f5bb['params']['id'])});}return _0x155ad2;});}})[_0xd87f('0x2c')](respondWithResult(_0x1ad39f,null))['catch'](handleError(_0x1ad39f,null));};exports[_0xd87f('0x86')]=function(_0x1c9b0e,_0x465edc,_0x4bc82c){return db[_0xd87f('0x46')][_0xd87f('0x55')]({'where':{'id':_0x1c9b0e[_0xd87f('0x4c')]['id']}})[_0xd87f('0x2c')](handleEntityNotFound(_0x465edc,null))[_0xd87f('0x2c')](function(_0x1d9d58){if(_0x1d9d58){return _0x1d9d58[_0xd87f('0x86')](_0x1c9b0e[_0xd87f('0x38')][_0xd87f('0x84')])['then'](function(){if(_[_0xd87f('0x8a')](_0x1c9b0e[_0xd87f('0x38')][_0xd87f('0x84')])){for(var _0x250d07=0x0;_0x250d07<_0x1c9b0e[_0xd87f('0x38')][_0xd87f('0x84')]['length'];_0x250d07+=0x1){socket[_0xd87f('0x75')](_0xd87f('0x87'),{'UserId':Number(_0x1c9b0e[_0xd87f('0x38')]['ids'][_0x250d07]),'OpenchannelQueueId':Number(_0x1c9b0e[_0xd87f('0x4c')]['id'])});}}else{socket['emit'](_0xd87f('0x87'),{'UserId':Number(_0x1c9b0e[_0xd87f('0x38')][_0xd87f('0x84')]),'OpenchannelQueueId':Number(_0x1c9b0e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x465edc,null))[_0xd87f('0x4a')](handleError(_0x465edc,null));};exports[_0xd87f('0x8b')]=function(_0x2bedb9,_0x173ff9,_0x151fa0){var _0x5b09be={};var _0x5f0e80={};var _0x20d9ea;var _0x1a0b39;return db[_0xd87f('0x46')][_0xd87f('0x5b')]({'where':{'id':_0x2bedb9['params']['id']}})[_0xd87f('0x2c')](handleEntityNotFound(_0x173ff9,null))[_0xd87f('0x2c')](function(_0x4a914c){if(_0x4a914c){_0x20d9ea=_0x4a914c;_0x5f0e80[_0xd87f('0x37')]=_[_0xd87f('0x39')](db[_0xd87f('0x60')][_0xd87f('0x4d')]);_0x5f0e80[_0xd87f('0x38')]=_[_0xd87f('0x39')](_0x2bedb9[_0xd87f('0x38')]);_0x5f0e80[_0xd87f('0x3a')]=_[_0xd87f('0x3b')](_0x5f0e80[_0xd87f('0x37')],_0x5f0e80[_0xd87f('0x38')]);_0x5b09be[_0xd87f('0x3c')]=_[_0xd87f('0x3b')](_0x5f0e80[_0xd87f('0x37')],qs['fields'](_0x2bedb9[_0xd87f('0x38')][_0xd87f('0x3d')]));_0x5b09be[_0xd87f('0x3c')]=_0x5b09be[_0xd87f('0x3c')][_0xd87f('0x3e')]?_0x5b09be['attributes']:_0x5f0e80[_0xd87f('0x37')];_0x5b09be['order']=qs[_0xd87f('0x40')](_0x2bedb9['query'][_0xd87f('0x40')]);_0x5b09be['where']=qs['filters'](_[_0xd87f('0x41')](_0x2bedb9['query'],_0x5f0e80[_0xd87f('0x3a')]));if(_0x2bedb9[_0xd87f('0x38')][_0xd87f('0x42')]){_0x5b09be['where']=_['merge'](_0x5b09be[_0xd87f('0x43')],{'$or':_['map'](_0x5b09be['attributes'],function(_0x28fc68){var _0xfb633={};_0xfb633[_0x28fc68]={'$like':'%'+_0x2bedb9['query'][_0xd87f('0x42')]+'%'};return _0xfb633;})});}_0x5b09be=_[_0xd87f('0x44')]({},_0x5b09be,_0x2bedb9[_0xd87f('0x4e')]);return _0x20d9ea[_0xd87f('0x8b')](_0x5b09be);}})['then'](function(_0x4994c){if(_0x4994c){_0x1a0b39=_0x4994c[_0xd87f('0x3e')];if(!_0x2bedb9[_0xd87f('0x38')][_0xd87f('0x5d')](_0xd87f('0x3f'))){_0x5b09be['limit']=qs[_0xd87f('0x25')](_0x2bedb9[_0xd87f('0x38')][_0xd87f('0x25')]);_0x5b09be['offset']=qs[_0xd87f('0x23')](_0x2bedb9[_0xd87f('0x38')][_0xd87f('0x23')]);}return _0x20d9ea['getAgents'](_0x5b09be);}})['then'](function(_0x2ee561){if(_0x2ee561){return _0x2ee561?{'count':_0x1a0b39,'rows':_0x2ee561}:null;}})[_0xd87f('0x2c')](respondWithResult(_0x173ff9,null))[_0xd87f('0x4a')](handleError(_0x173ff9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6b5c68c..e3b37b5 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 _0x2dbe=['events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x184cbc,_0xa97898){var _0x5aba8d=function(_0x28aac5){while(--_0x28aac5){_0x184cbc['push'](_0x184cbc['shift']());}};_0x5aba8d(++_0xa97898);}(_0x2dbe,0x171));var _0xe2db=function(_0x240285,_0x2f2c46){_0x240285=_0x240285-0x0;var _0x44055a=_0x2dbe[_0x240285];return _0x44055a;};'use strict';var EventEmitter=require(_0xe2db('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xe2db('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe2db('0x2')](0x0);var events={'afterCreate':_0xe2db('0x3'),'afterUpdate':_0xe2db('0x4'),'afterDestroy':_0xe2db('0x5')};function emitEvent(_0x3551ad){return function(_0x3d3b2c,_0x349508,_0x4315f3){OpenchannelQueueEvents['emit'](_0x3551ad+':'+_0x3d3b2c['id'],_0x3d3b2c);OpenchannelQueueEvents[_0xe2db('0x6')](_0x3551ad,_0x3d3b2c);_0x4315f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xe2db('0x7')](e,emitEvent(event));}}module[_0xe2db('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe5ad=['events','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xe5ad,0xb8));var _0xde5a=function(_0x10b126,_0x590863){_0x10b126=_0x10b126-0x0;var _0x4c53bd=_0xe5ad[_0x10b126];return _0x4c53bd;};'use strict';var EventEmitter=require(_0xde5a('0x0'));var OpenchannelQueue=require(_0xde5a('0x1'))['db'][_0xde5a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde5a('0x3'),'afterUpdate':_0xde5a('0x4'),'afterDestroy':_0xde5a('0x5')};function emitEvent(_0x13b654){return function(_0x12e214,_0xe1fbd5,_0x181250){OpenchannelQueueEvents[_0xde5a('0x6')](_0x13b654+':'+_0x12e214['id'],_0x12e214);OpenchannelQueueEvents[_0xde5a('0x6')](_0x13b654,_0x12e214);_0x181250(null);};}for(var e in events){if(events[_0xde5a('0x7')](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 1881db8..be5bb05 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 _0x8685=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x3f4656,_0x11d927){var _0x13c1da=function(_0x15d231){while(--_0x15d231){_0x3f4656['push'](_0x3f4656['shift']());}};_0x13c1da(++_0x11d927);}(_0x8685,0x79));var _0x5868=function(_0x448ac5,_0x5a2bac){_0x448ac5=_0x448ac5-0x0;var _0x645f57=_0x8685[_0x448ac5];return _0x645f57;};'use strict';var _=require('lodash');var util=require(_0x5868('0x0'));var logger=require(_0x5868('0x1'))(_0x5868('0x2'));var moment=require('moment');var BPromise=require(_0x5868('0x3'));var rp=require(_0x5868('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5868('0x5'));var config=require(_0x5868('0x6'));var attributes=require(_0x5868('0x7'));module[_0x5868('0x8')]=function(_0x2937da,_0x591399){return _0x2937da[_0x5868('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x5868('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcab=['lodash','util','api','moment','bluebird','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x1dc37b,_0x49c988){var _0x3735c5=function(_0x15e2b2){while(--_0x15e2b2){_0x1dc37b['push'](_0x1dc37b['shift']());}};_0x3735c5(++_0x49c988);}(_0xfcab,0x1b8));var _0xbfca=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xfcab[_0x16dbfd];return _0x382254;};'use strict';var _=require(_0xbfca('0x0'));var util=require(_0xbfca('0x1'));var logger=require('../../config/logger')(_0xbfca('0x2'));var moment=require(_0xbfca('0x3'));var BPromise=require(_0xbfca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbfca('0x6'));module[_0xbfca('0x7')]=function(_0x83e4c1,_0x8aea8a){return _0x83e4c1[_0xbfca('0x8')](_0xbfca('0x9'),attributes,{'tableName':_0xbfca('0xa'),'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 57703ea..c969ab2 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 _0xa228=['where','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','info','OpenchannelQueue','findAll','options'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa228,0x77));var _0x8a22=function(_0x2fd567,_0x28fd99){_0x2fd567=_0x2fd567-0x0;var _0x4bc7a7=_0xa228[_0x2fd567];return _0x4bc7a7;};'use strict';var _=require(_0x8a22('0x0'));var util=require(_0x8a22('0x1'));var moment=require(_0x8a22('0x2'));var BPromise=require(_0x8a22('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a22('0x4'));var db=require(_0x8a22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a22('0x6'))(_0x8a22('0x7'));var config=require(_0x8a22('0x8'));var jayson=require(_0x8a22('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8a22('0xa')]=_['defaults'](config[_0x8a22('0xa')],{'host':_0x8a22('0xb'),'port':0x18eb});var socket=require(_0x8a22('0xc'))(new Redis(config[_0x8a22('0xa')]));require('./openchannelQueue.socket')[_0x8a22('0xd')](socket);function respondWithRpcPromise(_0x36c544,_0x5af7a2,_0x1eb92f){return new BPromise(function(_0x145767,_0x284dec){return client[_0x8a22('0xe')](_0x36c544,_0x1eb92f)[_0x8a22('0xf')](function(_0xeee82a){logger['info'](_0x8a22('0x10'),_0x5af7a2,'request\x20sent');logger[_0x8a22('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5af7a2,_0x8a22('0x12'),JSON['stringify'](_0xeee82a));if(_0xeee82a[_0x8a22('0x13')]){if(_0xeee82a['error']['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x5af7a2,_0xeee82a[_0x8a22('0x13')][_0x8a22('0x14')]);return _0x284dec(_0xeee82a[_0x8a22('0x13')][_0x8a22('0x14')]);}logger[_0x8a22('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x5af7a2,_0xeee82a[_0x8a22('0x13')][_0x8a22('0x14')]);return _0x145767(_0xeee82a[_0x8a22('0x13')][_0x8a22('0x14')]);}else{logger[_0x8a22('0x15')](_0x8a22('0x10'),_0x5af7a2,_0x8a22('0x12'));_0x145767(_0xeee82a['result'][_0x8a22('0x14')]);}})['catch'](function(_0x5cf80e){logger[_0x8a22('0x13')](_0x8a22('0x10'),_0x5af7a2,_0x5cf80e);_0x284dec(_0x5cf80e);});});}exports['GetOpenchannelQueue']=function(_0x3c25a3){var _0x541338=this;return new Promise(function(_0x95b7d5,_0x5715f3){return db[_0x8a22('0x16')][_0x8a22('0x17')]({'raw':_0x3c25a3[_0x8a22('0x18')]?_0x3c25a3[_0x8a22('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c25a3['options']?_0x3c25a3[_0x8a22('0x18')][_0x8a22('0x19')]||null:null,'attributes':_0x3c25a3['options']?_0x3c25a3[_0x8a22('0x18')][_0x8a22('0x1a')]||null:null,'limit':_0x3c25a3[_0x8a22('0x18')]?_0x3c25a3['options'][_0x8a22('0x1b')]||null:null,'include':_0x3c25a3[_0x8a22('0x18')]?_0x3c25a3[_0x8a22('0x18')][_0x8a22('0x1c')]?_[_0x8a22('0x1d')](_0x3c25a3['options'][_0x8a22('0x1c')],function(_0x284ffd){return{'model':db[_0x284ffd[_0x8a22('0x1e')]],'as':_0x284ffd['as'],'attributes':_0x284ffd[_0x8a22('0x1a')],'include':_0x284ffd['include']?_['map'](_0x284ffd['include'],function(_0x20a41b){return{'model':db[_0x20a41b[_0x8a22('0x1e')]],'as':_0x20a41b['as'],'attributes':_0x20a41b[_0x8a22('0x1a')],'include':_0x20a41b[_0x8a22('0x1c')]?_[_0x8a22('0x1d')](_0x20a41b['include'],function(_0x55d397){return{'model':db[_0x55d397[_0x8a22('0x1e')]],'as':_0x55d397['as'],'attributes':_0x55d397[_0x8a22('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8a22('0xf')](function(_0x549abc){logger['info']('GetOpenchannelQueue',_0x3c25a3);logger[_0x8a22('0x11')](_0x8a22('0x1f'),_0x3c25a3,JSON[_0x8a22('0x20')](_0x549abc));_0x95b7d5(_0x549abc);})['catch'](function(_0x1f7598){logger[_0x8a22('0x13')](_0x8a22('0x1f'),_0x1f7598[_0x8a22('0x14')],_0x3c25a3);_0x5715f3(_0x541338['error'](0x1f4,_0x1f7598['message']));});});};exports[_0x8a22('0x21')]=function(_0x5c2541){var _0x36c933=this;return new Promise(function(_0xe5b4e9,_0x441381){return db[_0x8a22('0x16')][_0x8a22('0x22')]({'raw':_0x5c2541[_0x8a22('0x18')]?_0x5c2541[_0x8a22('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c2541['options']?_0x5c2541[_0x8a22('0x18')][_0x8a22('0x19')]||null:null,'attributes':_0x5c2541['options']?_0x5c2541['options']['attributes']||null:null,'include':_0x5c2541[_0x8a22('0x18')]?_0x5c2541[_0x8a22('0x18')][_0x8a22('0x1c')]?_['map'](_0x5c2541[_0x8a22('0x18')][_0x8a22('0x1c')],function(_0x2cfa26){return{'model':db[_0x2cfa26['model']],'as':_0x2cfa26['as'],'attributes':_0x2cfa26[_0x8a22('0x1a')],'include':_0x2cfa26[_0x8a22('0x1c')]?_[_0x8a22('0x1d')](_0x2cfa26[_0x8a22('0x1c')],function(_0x4e559a){return{'model':db[_0x4e559a[_0x8a22('0x1e')]],'as':_0x4e559a['as'],'attributes':_0x4e559a[_0x8a22('0x1a')],'include':_0x4e559a[_0x8a22('0x1c')]?_[_0x8a22('0x1d')](_0x4e559a['include'],function(_0x40f7a5){return{'model':db[_0x40f7a5[_0x8a22('0x1e')]],'as':_0x40f7a5['as'],'attributes':_0x40f7a5[_0x8a22('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8a22('0xf')](function(_0x4c1408){logger[_0x8a22('0x15')]('ShowOpenchannelQueue',_0x5c2541);logger[_0x8a22('0x11')](_0x8a22('0x21'),_0x5c2541,JSON[_0x8a22('0x20')](_0x4c1408));_0xe5b4e9(_0x4c1408);})[_0x8a22('0x23')](function(_0x2671c1){logger[_0x8a22('0x13')](_0x8a22('0x21'),_0x2671c1[_0x8a22('0x14')],_0x5c2541);_0x441381(_0x36c933['error'](0x1f4,_0x2671c1[_0x8a22('0x14')]));});});}; \ No newline at end of file +var _0x3c0f=['where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','findAll','raw','options'];(function(_0xfd34a2,_0x1c0327){var _0x5dea1b=function(_0x23ad49){while(--_0x23ad49){_0xfd34a2['push'](_0xfd34a2['shift']());}};_0x5dea1b(++_0x1c0327);}(_0x3c0f,0x128));var _0xf3c0=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x3c0f[_0x1b3564];return _0x504069;};'use strict';var _=require(_0xf3c0('0x0'));var util=require('util');var moment=require(_0xf3c0('0x1'));var BPromise=require(_0xf3c0('0x2'));var rs=require(_0xf3c0('0x3'));var fs=require('fs');var Redis=require(_0xf3c0('0x4'));var db=require(_0xf3c0('0x5'))['db'];var utils=require(_0xf3c0('0x6'));var logger=require(_0xf3c0('0x7'))(_0xf3c0('0x8'));var config=require(_0xf3c0('0x9'));var jayson=require(_0xf3c0('0xa'));var client=jayson[_0xf3c0('0xb')]['http']({'port':0x232a});config[_0xf3c0('0xc')]=_['defaults'](config['redis'],{'host':_0xf3c0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3c0('0xc')]));require('./openchannelQueue.socket')[_0xf3c0('0xe')](socket);function respondWithRpcPromise(_0xc7b904,_0x227ea1,_0x4a07f3){return new BPromise(function(_0x23f5a6,_0x445ca2){return client[_0xf3c0('0xf')](_0xc7b904,_0x4a07f3)[_0xf3c0('0x10')](function(_0x39c774){logger[_0xf3c0('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x227ea1,'request\x20sent');logger[_0xf3c0('0x12')](_0xf3c0('0x13'),_0x227ea1,_0xf3c0('0x14'),JSON[_0xf3c0('0x15')](_0x39c774));if(_0x39c774['error']){if(_0x39c774[_0xf3c0('0x16')][_0xf3c0('0x17')]===0x1f4){logger[_0xf3c0('0x16')](_0xf3c0('0x18'),_0x227ea1,_0x39c774['error'][_0xf3c0('0x19')]);return _0x445ca2(_0x39c774[_0xf3c0('0x16')]['message']);}logger[_0xf3c0('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x227ea1,_0x39c774[_0xf3c0('0x16')][_0xf3c0('0x19')]);return _0x23f5a6(_0x39c774[_0xf3c0('0x16')]['message']);}else{logger[_0xf3c0('0x11')](_0xf3c0('0x18'),_0x227ea1,_0xf3c0('0x14'));_0x23f5a6(_0x39c774[_0xf3c0('0x1a')][_0xf3c0('0x19')]);}})[_0xf3c0('0x1b')](function(_0x183967){logger[_0xf3c0('0x16')](_0xf3c0('0x18'),_0x227ea1,_0x183967);_0x445ca2(_0x183967);});});}exports['GetOpenchannelQueue']=function(_0x5a1821){var _0x147276=this;return new Promise(function(_0x3fc58e,_0x1c6476){return db[_0xf3c0('0x1c')][_0xf3c0('0x1d')]({'raw':_0x5a1821['options']?_0x5a1821['options'][_0xf3c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a1821['options']?_0x5a1821[_0xf3c0('0x1f')][_0xf3c0('0x20')]||null:null,'attributes':_0x5a1821[_0xf3c0('0x1f')]?_0x5a1821['options'][_0xf3c0('0x21')]||null:null,'limit':_0x5a1821['options']?_0x5a1821[_0xf3c0('0x1f')][_0xf3c0('0x22')]||null:null,'include':_0x5a1821[_0xf3c0('0x1f')]?_0x5a1821[_0xf3c0('0x1f')][_0xf3c0('0x23')]?_[_0xf3c0('0x24')](_0x5a1821[_0xf3c0('0x1f')][_0xf3c0('0x23')],function(_0x395270){return{'model':db[_0x395270[_0xf3c0('0x25')]],'as':_0x395270['as'],'attributes':_0x395270[_0xf3c0('0x21')],'include':_0x395270[_0xf3c0('0x23')]?_[_0xf3c0('0x24')](_0x395270[_0xf3c0('0x23')],function(_0x20e7df){return{'model':db[_0x20e7df[_0xf3c0('0x25')]],'as':_0x20e7df['as'],'attributes':_0x20e7df[_0xf3c0('0x21')],'include':_0x20e7df['include']?_[_0xf3c0('0x24')](_0x20e7df[_0xf3c0('0x23')],function(_0x27b011){return{'model':db[_0x27b011[_0xf3c0('0x25')]],'as':_0x27b011['as'],'attributes':_0x27b011[_0xf3c0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x167ca8){logger[_0xf3c0('0x11')](_0xf3c0('0x26'),_0x5a1821);logger['debug']('GetOpenchannelQueue',_0x5a1821,JSON[_0xf3c0('0x15')](_0x167ca8));_0x3fc58e(_0x167ca8);})[_0xf3c0('0x1b')](function(_0xa2f4af){logger[_0xf3c0('0x16')](_0xf3c0('0x26'),_0xa2f4af[_0xf3c0('0x19')],_0x5a1821);_0x1c6476(_0x147276[_0xf3c0('0x16')](0x1f4,_0xa2f4af[_0xf3c0('0x19')]));});});};exports[_0xf3c0('0x27')]=function(_0x4de758){var _0x43abf3=this;return new Promise(function(_0x1e098b,_0x212db3){return db[_0xf3c0('0x1c')][_0xf3c0('0x28')]({'raw':_0x4de758[_0xf3c0('0x1f')]?_0x4de758[_0xf3c0('0x1f')][_0xf3c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x4de758['options']?_0x4de758['options'][_0xf3c0('0x20')]||null:null,'attributes':_0x4de758[_0xf3c0('0x1f')]?_0x4de758[_0xf3c0('0x1f')][_0xf3c0('0x21')]||null:null,'include':_0x4de758[_0xf3c0('0x1f')]?_0x4de758['options'][_0xf3c0('0x23')]?_['map'](_0x4de758['options'][_0xf3c0('0x23')],function(_0x202e8b){return{'model':db[_0x202e8b[_0xf3c0('0x25')]],'as':_0x202e8b['as'],'attributes':_0x202e8b[_0xf3c0('0x21')],'include':_0x202e8b['include']?_['map'](_0x202e8b['include'],function(_0x2dc2c4){return{'model':db[_0x2dc2c4[_0xf3c0('0x25')]],'as':_0x2dc2c4['as'],'attributes':_0x2dc2c4[_0xf3c0('0x21')],'include':_0x2dc2c4[_0xf3c0('0x23')]?_[_0xf3c0('0x24')](_0x2dc2c4['include'],function(_0xbb528b){return{'model':db[_0xbb528b[_0xf3c0('0x25')]],'as':_0xbb528b['as'],'attributes':_0xbb528b[_0xf3c0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf3c0('0x10')](function(_0x3fdfcd){logger[_0xf3c0('0x11')](_0xf3c0('0x27'),_0x4de758);logger[_0xf3c0('0x12')]('ShowOpenchannelQueue',_0x4de758,JSON[_0xf3c0('0x15')](_0x3fdfcd));_0x1e098b(_0x3fdfcd);})['catch'](function(_0xa4e19b){logger[_0xf3c0('0x16')](_0xf3c0('0x27'),_0xa4e19b['message'],_0x4de758);_0x212db3(_0x43abf3['error'](0x1f4,_0xa4e19b[_0xf3c0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 97a55c4..f6272b4 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 _0xbfb6=['save','remove','update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbfb6,0x7f));var _0x6bfb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbfb6[_0x4a9fb1];return _0x348672;};'use strict';var OpenchannelQueueEvents=require(_0x6bfb('0x0'));var events=[_0x6bfb('0x1'),_0x6bfb('0x2'),_0x6bfb('0x3')];function createListener(_0x2693df,_0x18e81a){return function(_0x3f17ea){_0x18e81a[_0x6bfb('0x4')](_0x2693df,_0x3f17ea);};}function removeListener(_0xa97795,_0x3979c2){return function(){OpenchannelQueueEvents[_0x6bfb('0x5')](_0xa97795,_0x3979c2);};}exports['register']=function(_0x50acd8){for(var _0x9b034b=0x0,_0x314e80=events[_0x6bfb('0x6')];_0x9b034b<_0x314e80;_0x9b034b++){var _0x418459=events[_0x9b034b];var _0x2982f4=createListener(_0x6bfb('0x7')+_0x418459,_0x50acd8);OpenchannelQueueEvents['on'](_0x418459,_0x2982f4);}}; \ No newline at end of file +var _0x1b3e=['update','emit','removeListener','openchannelQueue:'];(function(_0x4cfa88,_0x47f1f7){var _0x497e2a=function(_0x533624){while(--_0x533624){_0x4cfa88['push'](_0x4cfa88['shift']());}};_0x497e2a(++_0x47f1f7);}(_0x1b3e,0x128));var _0xe1b3=function(_0x217ba1,_0x27c824){_0x217ba1=_0x217ba1-0x0;var _0x53a9c4=_0x1b3e[_0x217ba1];return _0x53a9c4;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove',_0xe1b3('0x0')];function createListener(_0x59a0ad,_0x451f75){return function(_0x503e2d){_0x451f75[_0xe1b3('0x1')](_0x59a0ad,_0x503e2d);};}function removeListener(_0x2a334a,_0xcb92e0){return function(){OpenchannelQueueEvents[_0xe1b3('0x2')](_0x2a334a,_0xcb92e0);};}exports['register']=function(_0x581255){for(var _0x163170=0x0,_0x2d2b89=events['length'];_0x163170<_0x2d2b89;_0x163170++){var _0x4650f1=events[_0x163170];var _0xad77b6=createListener(_0xe1b3('0x3')+_0x4650f1,_0x581255);OpenchannelQueueEvents['on'](_0x4650f1,_0xad77b6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 802b1ac..d6a795c 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 _0x6671=['index','/describe','describe','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x4b2281,_0x20e556){var _0x312ba6=function(_0x3a1909){while(--_0x3a1909){_0x4b2281['push'](_0x4b2281['shift']());}};_0x312ba6(++_0x20e556);}(_0x6671,0x17e));var _0x1667=function(_0x25bc42,_0x1c8239){_0x25bc42=_0x25bc42-0x0;var _0x588a07=_0x6671[_0x25bc42];return _0x588a07;};'use strict';var multer=require(_0x1667('0x0'));var util=require(_0x1667('0x1'));var path=require(_0x1667('0x2'));var timeout=require(_0x1667('0x3'));var express=require('express');var router=express[_0x1667('0x4')]();var fs_extra=require(_0x1667('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1667('0x6'));router[_0x1667('0x7')]('/',auth[_0x1667('0x8')](),controller[_0x1667('0x9')]);router[_0x1667('0x7')](_0x1667('0xa'),auth['isAuthenticated'](),controller[_0x1667('0xb')]);router['get']('/:id',auth[_0x1667('0x8')](),controller['show']);router['post']('/',auth[_0x1667('0x8')](),controller[_0x1667('0xc')]);router['put'](_0x1667('0xd'),auth[_0x1667('0x8')](),controller['update']);router[_0x1667('0xe')]('/:id',auth[_0x1667('0x8')](),controller[_0x1667('0xf')]);module[_0x1667('0x10')]=router; \ No newline at end of file +var _0xfdc3=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x57cc54,_0x6862b1){var _0xa93acc=function(_0x350992){while(--_0x350992){_0x57cc54['push'](_0x57cc54['shift']());}};_0xa93acc(++_0x6862b1);}(_0xfdc3,0xca));var _0x3fdc=function(_0x4a24df,_0x53532f){_0x4a24df=_0x4a24df-0x0;var _0x472e4c=_0xfdc3[_0x4a24df];return _0x472e4c;};'use strict';var multer=require(_0x3fdc('0x0'));var util=require(_0x3fdc('0x1'));var path=require(_0x3fdc('0x2'));var timeout=require(_0x3fdc('0x3'));var express=require('express');var router=express[_0x3fdc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3fdc('0x5'));var interaction=require(_0x3fdc('0x6'));var config=require(_0x3fdc('0x7'));var controller=require(_0x3fdc('0x8'));router[_0x3fdc('0x9')]('/',auth[_0x3fdc('0xa')](),controller['index']);router[_0x3fdc('0x9')](_0x3fdc('0xb'),auth[_0x3fdc('0xa')](),controller[_0x3fdc('0xc')]);router[_0x3fdc('0x9')](_0x3fdc('0xd'),auth['isAuthenticated'](),controller[_0x3fdc('0xe')]);router[_0x3fdc('0xf')]('/',auth['isAuthenticated'](),controller[_0x3fdc('0x10')]);router[_0x3fdc('0x11')](_0x3fdc('0xd'),auth[_0x3fdc('0xa')](),controller['update']);router[_0x3fdc('0x12')](_0x3fdc('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index de83ba7..e5121f8 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 _0xb575=['exports','STRING','DATE','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb575,0x103));var _0x5b57=function(_0x36afbe,_0x351022){_0x36afbe=_0x36afbe-0x0;var _0x3e26da=_0xb575[_0x36afbe];return _0x3e26da;};'use strict';var moment=require(_0x5b57('0x0'));var Sequelize=require('sequelize');module[_0x5b57('0x1')]={'uniqueid':{'type':Sequelize[_0x5b57('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5b57('0x2')]},'joinAt':{'type':Sequelize[_0x5b57('0x3')]},'leaveAt':{'type':Sequelize[_0x5b57('0x3')]},'acceptAt':{'type':Sequelize[_0x5b57('0x3')]},'exitAt':{'type':Sequelize[_0x5b57('0x3')]},'reason':{'type':Sequelize[_0x5b57('0x2')]}}; \ No newline at end of file +var _0x7b04=['exports','STRING','DATE','sequelize'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0x7b04,0x12b));var _0x47b0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7b04[_0x42cae2];return _0x5f256f;};'use strict';var moment=require('moment');var Sequelize=require(_0x47b0('0x0'));module[_0x47b0('0x1')]={'uniqueid':{'type':Sequelize[_0x47b0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47b0('0x3')]},'leaveAt':{'type':Sequelize[_0x47b0('0x3')]},'acceptAt':{'type':Sequelize[_0x47b0('0x3')]},'exitAt':{'type':Sequelize[_0x47b0('0x3')]},'reason':{'type':Sequelize[_0x47b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index fb2a41b..a3d9e26 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 _0x9970=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','save','destroy','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','OpenchannelQueueReport','options','find','create','update','body','params'];(function(_0x2eb6b8,_0x3425fc){var _0x270d8a=function(_0x499141){while(--_0x499141){_0x2eb6b8['push'](_0x2eb6b8['shift']());}};_0x270d8a(++_0x3425fc);}(_0x9970,0x1c3));var _0x0997=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x9970[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0x0997('0x0'));var rimraf=require(_0x0997('0x1'));var zipdir=require(_0x0997('0x2'));var jsonpatch=require(_0x0997('0x3'));var rp=require(_0x0997('0x4'));var moment=require(_0x0997('0x5'));var BPromise=require(_0x0997('0x6'));var Mustache=require(_0x0997('0x7'));var util=require(_0x0997('0x8'));var path=require(_0x0997('0x9'));var sox=require('sox');var csv=require(_0x0997('0xa'));var ejs=require(_0x0997('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0997('0xc'));var squel=require(_0x0997('0xd'));var crypto=require(_0x0997('0xe'));var jsforce=require(_0x0997('0xf'));var deskjs=require(_0x0997('0x10'));var toCsv=require(_0x0997('0xa'));var querystring=require(_0x0997('0x11'));var Papa=require(_0x0997('0x12'));var Redis=require(_0x0997('0x13'));var authService=require(_0x0997('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0997('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0997('0x16'));var utils=require(_0x0997('0x17'));var config=require(_0x0997('0x18'));var licenseUtil=require(_0x0997('0x19'));var db=require(_0x0997('0x1a'))['db'];function respondWithStatusCode(_0x144074,_0x24ff82){_0x24ff82=_0x24ff82||0xcc;return function(_0x1d0c9c){if(_0x1d0c9c){return _0x144074['sendStatus'](_0x24ff82);}return _0x144074[_0x0997('0x1b')](_0x24ff82)[_0x0997('0x1c')]();};}function respondWithResult(_0x19a19b,_0x51ef6c){_0x51ef6c=_0x51ef6c||0xc8;return function(_0x20748a){if(_0x20748a){return _0x19a19b[_0x0997('0x1b')](_0x51ef6c)[_0x0997('0x1d')](_0x20748a);}};}function respondWithFilteredResult(_0x3d20aa,_0x2fb7c7){return function(_0x195cc3){if(_0x195cc3){var _0x1735be=typeof _0x2fb7c7[_0x0997('0x1e')]==='undefined'&&typeof _0x2fb7c7[_0x0997('0x1f')]===_0x0997('0x20');var _0x258592=_0x195cc3['count'];var _0x11482d=_0x1735be?0x0:_0x2fb7c7[_0x0997('0x1e')];var _0x5a5433=_0x1735be?_0x195cc3[_0x0997('0x21')]:_0x2fb7c7[_0x0997('0x1e')]+_0x2fb7c7['limit'];var _0x5225d7;if(_0x5a5433>=_0x258592){_0x5a5433=_0x258592;_0x5225d7=0xc8;}else{_0x5225d7=0xce;}_0x3d20aa[_0x0997('0x1b')](_0x5225d7);return _0x3d20aa[_0x0997('0x22')]('Content-Range',_0x11482d+'-'+_0x5a5433+'/'+_0x258592)['json'](_0x195cc3);}return null;};}function patchUpdates(_0x230363){return function(_0x9fca60){try{jsonpatch['apply'](_0x9fca60,_0x230363,!![]);}catch(_0x4de567){return BPromise['reject'](_0x4de567);}return _0x9fca60[_0x0997('0x23')]();};}function saveUpdates(_0x12ad1b,_0x2b1c55){return function(_0x31565a){if(_0x31565a){return _0x31565a['update'](_0x12ad1b)['then'](function(_0x25825d){return _0x25825d;});}return null;};}function removeEntity(_0x3d0d37,_0xb06bfd){return function(_0x10a1e3){if(_0x10a1e3){return _0x10a1e3[_0x0997('0x24')]()[_0x0997('0x25')](function(){_0x3d0d37[_0x0997('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x214b27,_0x38dfc2){return function(_0x240b99){if(!_0x240b99){_0x214b27[_0x0997('0x26')](0x194);}return _0x240b99;};}function handleError(_0x5ecb1f,_0x3648df){_0x3648df=_0x3648df||0x1f4;return function(_0x1f3f85){logger['error'](_0x1f3f85['stack']);if(_0x1f3f85[_0x0997('0x27')]){delete _0x1f3f85[_0x0997('0x27')];}_0x5ecb1f['status'](_0x3648df)[_0x0997('0x28')](_0x1f3f85);};}exports[_0x0997('0x29')]=function(_0x4b164c,_0xfe3bb4){var _0x4068ef={},_0x3b44aa={},_0x5b572e={'count':0x0,'rows':[]};var _0x1c5c75=_[_0x0997('0x2a')](db['OpenchannelQueueReport'][_0x0997('0x2b')],function(_0x5075e1){return{'name':_0x5075e1[_0x0997('0x2c')],'type':_0x5075e1[_0x0997('0x2d')][_0x0997('0x2e')]};});_0x3b44aa[_0x0997('0x2f')]=_[_0x0997('0x2a')](_0x1c5c75,_0x0997('0x27'));_0x3b44aa[_0x0997('0x30')]=_[_0x0997('0x31')](_0x4b164c['query']);_0x3b44aa[_0x0997('0x32')]=_['intersection'](_0x3b44aa[_0x0997('0x2f')],_0x3b44aa[_0x0997('0x30')]);_0x4068ef['attributes']=_[_0x0997('0x33')](_0x3b44aa[_0x0997('0x2f')],qs[_0x0997('0x34')](_0x4b164c[_0x0997('0x30')][_0x0997('0x34')]));_0x4068ef[_0x0997('0x35')]=_0x4068ef[_0x0997('0x35')][_0x0997('0x36')]?_0x4068ef[_0x0997('0x35')]:_0x3b44aa['model'];if(!_0x4b164c['query'][_0x0997('0x37')](_0x0997('0x38'))){_0x4068ef[_0x0997('0x1f')]=qs[_0x0997('0x1f')](_0x4b164c[_0x0997('0x30')][_0x0997('0x1f')]);_0x4068ef[_0x0997('0x1e')]=qs[_0x0997('0x1e')](_0x4b164c[_0x0997('0x30')][_0x0997('0x1e')]);}_0x4068ef['order']=qs[_0x0997('0x39')](_0x4b164c['query']['sort']);_0x4068ef[_0x0997('0x3a')]=qs['filters'](_[_0x0997('0x3b')](_0x4b164c[_0x0997('0x30')],_0x3b44aa[_0x0997('0x32')]),_0x1c5c75);if(_0x4b164c[_0x0997('0x30')][_0x0997('0x3c')]){_0x4068ef['where']=_['merge'](_0x4068ef[_0x0997('0x3a')],{'$or':_['map'](_0x1c5c75,function(_0x2f7a9d){if(_0x2f7a9d[_0x0997('0x2d')]!=='VIRTUAL'){var _0x17633b={};_0x17633b[_0x2f7a9d['name']]={'$like':'%'+_0x4b164c['query'][_0x0997('0x3c')]+'%'};return _0x17633b;}})});}_0x4068ef=_['merge']({},_0x4068ef,_0x4b164c['options']);var _0x36482f={'where':_0x4068ef['where']};return db['OpenchannelQueueReport'][_0x0997('0x21')](_0x36482f)[_0x0997('0x25')](function(_0x42c062){_0x5b572e[_0x0997('0x21')]=_0x42c062;if(_0x4b164c[_0x0997('0x30')][_0x0997('0x3d')]){_0x4068ef[_0x0997('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x0997('0x3f')](_0x4068ef);})[_0x0997('0x25')](function(_0x31872f){_0x5b572e[_0x0997('0x40')]=_0x31872f;return _0x5b572e;})[_0x0997('0x25')](respondWithFilteredResult(_0xfe3bb4,_0x4068ef))[_0x0997('0x41')](handleError(_0xfe3bb4,null));};exports[_0x0997('0x42')]=function(_0x2dc4cf,_0x272825){var _0x486c21={'raw':!![],'where':{'id':_0x2dc4cf['params']['id']}},_0xe2694={};_0xe2694[_0x0997('0x2f')]=_[_0x0997('0x31')](db[_0x0997('0x43')][_0x0997('0x2b')]);_0xe2694['query']=_['keys'](_0x2dc4cf[_0x0997('0x30')]);_0xe2694[_0x0997('0x32')]=_[_0x0997('0x33')](_0xe2694['model'],_0xe2694[_0x0997('0x30')]);_0x486c21[_0x0997('0x35')]=_[_0x0997('0x33')](_0xe2694[_0x0997('0x2f')],qs[_0x0997('0x34')](_0x2dc4cf[_0x0997('0x30')][_0x0997('0x34')]));_0x486c21['attributes']=_0x486c21[_0x0997('0x35')]['length']?_0x486c21[_0x0997('0x35')]:_0xe2694['model'];if(_0x2dc4cf[_0x0997('0x30')][_0x0997('0x3d')]){_0x486c21[_0x0997('0x3e')]=[{'all':!![]}];}_0x486c21=_['merge']({},_0x486c21,_0x2dc4cf[_0x0997('0x44')]);return db[_0x0997('0x43')][_0x0997('0x45')](_0x486c21)[_0x0997('0x25')](handleEntityNotFound(_0x272825,null))['then'](respondWithResult(_0x272825,null))['catch'](handleError(_0x272825,null));};exports[_0x0997('0x46')]=function(_0x28d9f6,_0x29c890){return db[_0x0997('0x43')][_0x0997('0x46')](_0x28d9f6['body'],{})[_0x0997('0x25')](respondWithResult(_0x29c890,0xc9))[_0x0997('0x41')](handleError(_0x29c890,null));};exports[_0x0997('0x47')]=function(_0x4ac155,_0x41262c){if(_0x4ac155[_0x0997('0x48')]['id']){delete _0x4ac155[_0x0997('0x48')]['id'];}return db[_0x0997('0x43')]['find']({'where':{'id':_0x4ac155[_0x0997('0x49')]['id']}})['then'](handleEntityNotFound(_0x41262c,null))[_0x0997('0x25')](saveUpdates(_0x4ac155[_0x0997('0x48')],null))[_0x0997('0x25')](respondWithResult(_0x41262c,null))['catch'](handleError(_0x41262c,null));};exports[_0x0997('0x24')]=function(_0x54014d,_0x2cfc37){return db[_0x0997('0x43')][_0x0997('0x45')]({'where':{'id':_0x54014d[_0x0997('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cfc37,null))['then'](removeEntity(_0x2cfc37,null))[_0x0997('0x41')](handleError(_0x2cfc37,null));};exports[_0x0997('0x4a')]=function(_0x57f911,_0x812c4b){return db[_0x0997('0x43')][_0x0997('0x4a')]()[_0x0997('0x25')](respondWithResult(_0x812c4b,null))['catch'](handleError(_0x812c4b,null));}; \ No newline at end of file +var _0xf9f7=['intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','key','model','keys','query','filters'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf9f7,0x137));var _0x7f9f=function(_0x21b293,_0x352a44){_0x21b293=_0x21b293-0x0;var _0xd73e84=_0xf9f7[_0x21b293];return _0xd73e84;};'use strict';var emlformat=require(_0x7f9f('0x0'));var rimraf=require(_0x7f9f('0x1'));var zipdir=require(_0x7f9f('0x2'));var jsonpatch=require(_0x7f9f('0x3'));var rp=require(_0x7f9f('0x4'));var moment=require(_0x7f9f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7f9f('0x6'));var util=require('util');var path=require(_0x7f9f('0x7'));var sox=require(_0x7f9f('0x8'));var csv=require(_0x7f9f('0x9'));var ejs=require(_0x7f9f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f9f('0xb'));var squel=require(_0x7f9f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7f9f('0xd'));var toCsv=require(_0x7f9f('0x9'));var querystring=require(_0x7f9f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f9f('0xf'));var authService=require(_0x7f9f('0x10'));var qs=require(_0x7f9f('0x11'));var as=require(_0x7f9f('0x12'));var hardwareService=require(_0x7f9f('0x13'));var logger=require(_0x7f9f('0x14'))(_0x7f9f('0x15'));var utils=require('../../config/utils');var config=require(_0x7f9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f9f('0x17'))['db'];function respondWithStatusCode(_0x1ccec9,_0xa12ff){_0xa12ff=_0xa12ff||0xcc;return function(_0x5c1932){if(_0x5c1932){return _0x1ccec9[_0x7f9f('0x18')](_0xa12ff);}return _0x1ccec9[_0x7f9f('0x19')](_0xa12ff)['end']();};}function respondWithResult(_0xa8824c,_0x1914b5){_0x1914b5=_0x1914b5||0xc8;return function(_0x32ba66){if(_0x32ba66){return _0xa8824c[_0x7f9f('0x19')](_0x1914b5)[_0x7f9f('0x1a')](_0x32ba66);}};}function respondWithFilteredResult(_0x281122,_0x466899){return function(_0x37825d){if(_0x37825d){var _0x179585=typeof _0x466899['offset']===_0x7f9f('0x1b')&&typeof _0x466899['limit']===_0x7f9f('0x1b');var _0x3c6c98=_0x37825d[_0x7f9f('0x1c')];var _0x2f722f=_0x179585?0x0:_0x466899[_0x7f9f('0x1d')];var _0x134f4a=_0x179585?_0x37825d[_0x7f9f('0x1c')]:_0x466899[_0x7f9f('0x1d')]+_0x466899[_0x7f9f('0x1e')];var _0x5bc8d3;if(_0x134f4a>=_0x3c6c98){_0x134f4a=_0x3c6c98;_0x5bc8d3=0xc8;}else{_0x5bc8d3=0xce;}_0x281122['status'](_0x5bc8d3);return _0x281122[_0x7f9f('0x1f')](_0x7f9f('0x20'),_0x2f722f+'-'+_0x134f4a+'/'+_0x3c6c98)[_0x7f9f('0x1a')](_0x37825d);}return null;};}function patchUpdates(_0x13da60){return function(_0x562a08){try{jsonpatch[_0x7f9f('0x21')](_0x562a08,_0x13da60,!![]);}catch(_0x18c630){return BPromise['reject'](_0x18c630);}return _0x562a08['save']();};}function saveUpdates(_0x332fc5,_0x3ded75){return function(_0xbea734){if(_0xbea734){return _0xbea734['update'](_0x332fc5)[_0x7f9f('0x22')](function(_0x2ac843){return _0x2ac843;});}return null;};}function removeEntity(_0x266dc0,_0x443f1c){return function(_0x38570f){if(_0x38570f){return _0x38570f[_0x7f9f('0x23')]()['then'](function(){_0x266dc0[_0x7f9f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c6f69,_0x403096){return function(_0x430e7b){if(!_0x430e7b){_0x4c6f69['sendStatus'](0x194);}return _0x430e7b;};}function handleError(_0x2494d5,_0x1bb98b){_0x1bb98b=_0x1bb98b||0x1f4;return function(_0x510627){logger[_0x7f9f('0x24')](_0x510627[_0x7f9f('0x25')]);if(_0x510627[_0x7f9f('0x26')]){delete _0x510627[_0x7f9f('0x26')];}_0x2494d5['status'](_0x1bb98b)[_0x7f9f('0x27')](_0x510627);};}exports[_0x7f9f('0x28')]=function(_0x118e53,_0x2f9bcc){var _0x2c0fbe={},_0x59060a={},_0x29bd29={'count':0x0,'rows':[]};var _0x186b74=_[_0x7f9f('0x29')](db[_0x7f9f('0x2a')][_0x7f9f('0x2b')],function(_0x3804c0){return{'name':_0x3804c0['fieldName'],'type':_0x3804c0['type'][_0x7f9f('0x2c')]};});_0x59060a[_0x7f9f('0x2d')]=_[_0x7f9f('0x29')](_0x186b74,_0x7f9f('0x26'));_0x59060a['query']=_[_0x7f9f('0x2e')](_0x118e53[_0x7f9f('0x2f')]);_0x59060a[_0x7f9f('0x30')]=_[_0x7f9f('0x31')](_0x59060a['model'],_0x59060a[_0x7f9f('0x2f')]);_0x2c0fbe['attributes']=_['intersection'](_0x59060a[_0x7f9f('0x2d')],qs['fields'](_0x118e53[_0x7f9f('0x2f')][_0x7f9f('0x32')]));_0x2c0fbe[_0x7f9f('0x33')]=_0x2c0fbe['attributes']['length']?_0x2c0fbe[_0x7f9f('0x33')]:_0x59060a['model'];if(!_0x118e53[_0x7f9f('0x2f')][_0x7f9f('0x34')]('nolimit')){_0x2c0fbe[_0x7f9f('0x1e')]=qs[_0x7f9f('0x1e')](_0x118e53['query'][_0x7f9f('0x1e')]);_0x2c0fbe[_0x7f9f('0x1d')]=qs[_0x7f9f('0x1d')](_0x118e53['query'][_0x7f9f('0x1d')]);}_0x2c0fbe[_0x7f9f('0x35')]=qs[_0x7f9f('0x36')](_0x118e53[_0x7f9f('0x2f')][_0x7f9f('0x36')]);_0x2c0fbe[_0x7f9f('0x37')]=qs[_0x7f9f('0x30')](_['pick'](_0x118e53['query'],_0x59060a[_0x7f9f('0x30')]),_0x186b74);if(_0x118e53[_0x7f9f('0x2f')][_0x7f9f('0x38')]){_0x2c0fbe[_0x7f9f('0x37')]=_[_0x7f9f('0x39')](_0x2c0fbe['where'],{'$or':_[_0x7f9f('0x29')](_0x186b74,function(_0x300916){if(_0x300916[_0x7f9f('0x3a')]!=='VIRTUAL'){var _0x2a1add={};_0x2a1add[_0x300916[_0x7f9f('0x26')]]={'$like':'%'+_0x118e53[_0x7f9f('0x2f')]['filter']+'%'};return _0x2a1add;}})});}_0x2c0fbe=_[_0x7f9f('0x39')]({},_0x2c0fbe,_0x118e53[_0x7f9f('0x3b')]);var _0x2ea621={'where':_0x2c0fbe['where']};return db[_0x7f9f('0x2a')][_0x7f9f('0x1c')](_0x2ea621)[_0x7f9f('0x22')](function(_0x2b6658){_0x29bd29['count']=_0x2b6658;if(_0x118e53[_0x7f9f('0x2f')][_0x7f9f('0x3c')]){_0x2c0fbe[_0x7f9f('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x7f9f('0x3e')](_0x2c0fbe);})[_0x7f9f('0x22')](function(_0x143ba7){_0x29bd29[_0x7f9f('0x3f')]=_0x143ba7;return _0x29bd29;})[_0x7f9f('0x22')](respondWithFilteredResult(_0x2f9bcc,_0x2c0fbe))[_0x7f9f('0x40')](handleError(_0x2f9bcc,null));};exports[_0x7f9f('0x41')]=function(_0x2865a1,_0x1f154c){var _0x44b3ba={'raw':!![],'where':{'id':_0x2865a1[_0x7f9f('0x42')]['id']}},_0x42feeb={};_0x42feeb[_0x7f9f('0x2d')]=_[_0x7f9f('0x2e')](db[_0x7f9f('0x2a')][_0x7f9f('0x2b')]);_0x42feeb[_0x7f9f('0x2f')]=_[_0x7f9f('0x2e')](_0x2865a1[_0x7f9f('0x2f')]);_0x42feeb[_0x7f9f('0x30')]=_[_0x7f9f('0x31')](_0x42feeb['model'],_0x42feeb[_0x7f9f('0x2f')]);_0x44b3ba['attributes']=_[_0x7f9f('0x31')](_0x42feeb['model'],qs[_0x7f9f('0x32')](_0x2865a1[_0x7f9f('0x2f')][_0x7f9f('0x32')]));_0x44b3ba[_0x7f9f('0x33')]=_0x44b3ba[_0x7f9f('0x33')][_0x7f9f('0x43')]?_0x44b3ba[_0x7f9f('0x33')]:_0x42feeb['model'];if(_0x2865a1[_0x7f9f('0x2f')]['includeAll']){_0x44b3ba[_0x7f9f('0x3d')]=[{'all':!![]}];}_0x44b3ba=_[_0x7f9f('0x39')]({},_0x44b3ba,_0x2865a1[_0x7f9f('0x3b')]);return db[_0x7f9f('0x2a')][_0x7f9f('0x44')](_0x44b3ba)['then'](handleEntityNotFound(_0x1f154c,null))['then'](respondWithResult(_0x1f154c,null))[_0x7f9f('0x40')](handleError(_0x1f154c,null));};exports[_0x7f9f('0x45')]=function(_0xec353,_0x49cedb){return db['OpenchannelQueueReport'][_0x7f9f('0x45')](_0xec353[_0x7f9f('0x46')],{})[_0x7f9f('0x22')](respondWithResult(_0x49cedb,0xc9))[_0x7f9f('0x40')](handleError(_0x49cedb,null));};exports['update']=function(_0x50d4c1,_0x26344f){if(_0x50d4c1[_0x7f9f('0x46')]['id']){delete _0x50d4c1['body']['id'];}return db[_0x7f9f('0x2a')][_0x7f9f('0x44')]({'where':{'id':_0x50d4c1[_0x7f9f('0x42')]['id']}})[_0x7f9f('0x22')](handleEntityNotFound(_0x26344f,null))[_0x7f9f('0x22')](saveUpdates(_0x50d4c1[_0x7f9f('0x46')],null))['then'](respondWithResult(_0x26344f,null))['catch'](handleError(_0x26344f,null));};exports['destroy']=function(_0x4e86c9,_0x533de6){return db[_0x7f9f('0x2a')][_0x7f9f('0x44')]({'where':{'id':_0x4e86c9[_0x7f9f('0x42')]['id']}})['then'](handleEntityNotFound(_0x533de6,null))[_0x7f9f('0x22')](removeEntity(_0x533de6,null))[_0x7f9f('0x40')](handleError(_0x533de6,null));};exports[_0x7f9f('0x47')]=function(_0x43e41c,_0x4e9912){return db[_0x7f9f('0x2a')][_0x7f9f('0x47')]()[_0x7f9f('0x22')](respondWithResult(_0x4e9912,null))[_0x7f9f('0x40')](handleError(_0x4e9912,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bf25d4a..602e3fc 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(_0x4f6e97,_0x121c56){var _0x48ee74=function(_0x2dee01){while(--_0x2dee01){_0x4f6e97['push'](_0x4f6e97['shift']());}};_0x48ee74(++_0x121c56);}(_0xe14b,0x93));var _0xbe14=function(_0x1e4e22,_0x567aad){_0x1e4e22=_0x1e4e22-0x0;var _0x5a26ea=_0xe14b[_0x1e4e22];return _0x5a26ea;};'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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1abfbc,_0x435927){var _0x699298=function(_0x2a8629){while(--_0x2a8629){_0x1abfbc['push'](_0x1abfbc['shift']());}};_0x699298(++_0x435927);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 7bee416..0863027 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 _0x5f66=['error','info','catch','CreateOpenchannelQueueReport','create','raw','update','body','options','where','attributes','limit','UpdateOpenchannelQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x2965d6,_0x4f3c54){var _0x122ef7=function(_0x3f31a6){while(--_0x3f31a6){_0x2965d6['push'](_0x2965d6['shift']());}};_0x122ef7(++_0x4f3c54);}(_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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['OpenchannelQueueReport'][_0x65f6('0x16')](_0x1f974c['body'],{'raw':_0x1f974c['options']?_0x1f974c['options'][_0x65f6('0x17')]===undefined?!![]:![]:!![]})[_0x65f6('0xa')](function(_0x5114a4){logger[_0x65f6('0x13')](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON[_0x65f6('0xf')](_0x5114a4));_0x18380e(_0x5114a4);})[_0x65f6('0x14')](function(_0x581374){logger[_0x65f6('0x12')]('CreateOpenchannelQueueReport',_0x581374['message'],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x581374[_0x65f6('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1eeaaa){var _0x471a33=this;return new Promise(function(_0x2317ce,_0x2774a1){return db['OpenchannelQueueReport'][_0x65f6('0x18')](_0x1eeaaa[_0x65f6('0x19')],{'raw':_0x1eeaaa[_0x65f6('0x1a')]?_0x1eeaaa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1b')]||null:null,'attributes':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'limit':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null})[_0x65f6('0xa')](function(_0x559330){logger['info']('UpdateOpenchannelQueueReport',_0x1eeaaa);logger[_0x65f6('0xd')](_0x65f6('0x1e'),_0x1eeaaa,JSON[_0x65f6('0xf')](_0x559330));_0x2317ce(_0x559330);})[_0x65f6('0x14')](function(_0x518cac){logger[_0x65f6('0x12')](_0x65f6('0x1e'),_0x518cac['message'],_0x1eeaaa);_0x2774a1(_0x471a33['error'](0x1f4,_0x518cac[_0x65f6('0x11')]));});});}; \ No newline at end of file +var _0x26f9=['rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x5efe6c,_0x3e7b6a){var _0x5a679b=function(_0x3a6289){while(--_0x3a6289){_0x5efe6c['push'](_0x5efe6c['shift']());}};_0x5a679b(++_0x3e7b6a);}(_0x26f9,0x16f));var _0x926f=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x26f9[_0x40aaa4];return _0x4e21e5;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateOpenchannelQueueReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2d76eb){var _0x151f71=this;return new Promise(function(_0x53f10c,_0x640fe0){return db[_0x926f('0x16')][_0x926f('0x1a')](_0x2d76eb[_0x926f('0x1b')],{'raw':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb['options'][_0x926f('0x1c')]||null:null,'attributes':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')][_0x926f('0x1d')]||null:null,'limit':_0x2d76eb['options']?_0x2d76eb[_0x926f('0x18')]['limit']||null:null})[_0x926f('0xa')](function(_0x2556ce){logger['info']('UpdateOpenchannelQueueReport',_0x2d76eb);logger[_0x926f('0xd')](_0x926f('0x1e'),_0x2d76eb,JSON['stringify'](_0x2556ce));_0x53f10c(_0x2556ce);})[_0x926f('0x15')](function(_0xb6b509){logger['error']('UpdateOpenchannelQueueReport',_0xb6b509[_0x926f('0x13')],_0x2d76eb);_0x640fe0(_0x151f71[_0x926f('0x11')](0x1f4,_0xb6b509[_0x926f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index a682cdb..8fbfc67 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 _0xeca1=['isAuthenticated','index','describe','/:id','show','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','get'];(function(_0x32d83a,_0x503e06){var _0x10ca16=function(_0x317210){while(--_0x317210){_0x32d83a['push'](_0x32d83a['shift']());}};_0x10ca16(++_0x503e06);}(_0xeca1,0x194));var _0x1eca=function(_0x1b6ce6,_0x24eb57){_0x1b6ce6=_0x1b6ce6-0x0;var _0xa960c1=_0xeca1[_0x1b6ce6];return _0xa960c1;};'use strict';var multer=require(_0x1eca('0x0'));var util=require(_0x1eca('0x1'));var path=require(_0x1eca('0x2'));var timeout=require(_0x1eca('0x3'));var express=require(_0x1eca('0x4'));var router=express[_0x1eca('0x5')]();var fs_extra=require(_0x1eca('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1eca('0x7'));var config=require('../../config/environment');var controller=require(_0x1eca('0x8'));router[_0x1eca('0x9')]('/',auth[_0x1eca('0xa')](),controller[_0x1eca('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1eca('0xc')]);router[_0x1eca('0x9')](_0x1eca('0xd'),auth['isAuthenticated'](),controller[_0x1eca('0xe')]);router['post']('/',auth[_0x1eca('0xa')](),controller[_0x1eca('0xf')]);router[_0x1eca('0x10')]('/:id',auth[_0x1eca('0xa')](),controller['update']);router['delete'](_0x1eca('0xd'),auth[_0x1eca('0xa')](),controller[_0x1eca('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb922=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','describe','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','path','connect-timeout'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xb922,0x166));var _0x2b92=function(_0x5d50d7,_0x339501){_0x5d50d7=_0x5d50d7-0x0;var _0x4acb68=_0xb922[_0x5d50d7];return _0x4acb68;};'use strict';var multer=require(_0x2b92('0x0'));var util=require('util');var path=require(_0x2b92('0x1'));var timeout=require(_0x2b92('0x2'));var express=require(_0x2b92('0x3'));var router=express[_0x2b92('0x4')]();var fs_extra=require(_0x2b92('0x5'));var auth=require(_0x2b92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2b92('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x2b92('0x8')]('/',auth['isAuthenticated'](),controller[_0x2b92('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2b92('0xa')]);router[_0x2b92('0x8')](_0x2b92('0xb'),auth[_0x2b92('0xc')](),controller[_0x2b92('0xd')]);router[_0x2b92('0xe')]('/',auth[_0x2b92('0xc')](),controller[_0x2b92('0xf')]);router['put'](_0x2b92('0xb'),auth[_0x2b92('0xc')](),controller[_0x2b92('0x10')]);router[_0x2b92('0x11')](_0x2b92('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2b92('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 61c9928..060b8a4 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x386c00,_0x1ba086){var _0x373a15=function(_0x12a3ef){while(--_0x12a3ef){_0x386c00['push'](_0x386c00['shift']());}};_0x373a15(++_0x1ba086);}(_0x008c,0x188));var _0xc008=function(_0x4c53c3,_0x360764){_0x4c53c3=_0x4c53c3-0x0;var _0x32bf24=_0x008c[_0x4c53c3];return _0x32bf24;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2e3ebb,_0x5afc59){var _0x8f027f=function(_0x29b2f3){while(--_0x29b2f3){_0x2e3ebb['push'](_0x2e3ebb['shift']());}};_0x8f027f(++_0x5afc59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index be1c998..76c9cfe 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 _0x5d7c=['OpenchannelTransferReport','includeAll','include','catch','show','params','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','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','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x48774e,_0x291576){var _0x384e0e=function(_0x13b565){while(--_0x13b565){_0x48774e['push'](_0x48774e['shift']());}};_0x384e0e(++_0x291576);}(_0x5d7c,0x1c7));var _0xc5d7=function(_0x201caa,_0x478ab0){_0x201caa=_0x201caa-0x0;var _0xed8d18=_0x5d7c[_0x201caa];return _0xed8d18;};'use strict';var emlformat=require(_0xc5d7('0x0'));var rimraf=require(_0xc5d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5d7('0x2'));var rp=require(_0xc5d7('0x3'));var moment=require('moment');var BPromise=require(_0xc5d7('0x4'));var Mustache=require('mustache');var util=require(_0xc5d7('0x5'));var path=require(_0xc5d7('0x6'));var sox=require(_0xc5d7('0x7'));var csv=require('to-csv');var ejs=require(_0xc5d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc5d7('0x9'));var squel=require(_0xc5d7('0xa'));var crypto=require(_0xc5d7('0xb'));var jsforce=require(_0xc5d7('0xc'));var deskjs=require(_0xc5d7('0xd'));var toCsv=require(_0xc5d7('0xe'));var querystring=require(_0xc5d7('0xf'));var Papa=require(_0xc5d7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5d7('0x11'));var as=require(_0xc5d7('0x12'));var hardwareService=require(_0xc5d7('0x13'));var logger=require(_0xc5d7('0x14'))(_0xc5d7('0x15'));var utils=require(_0xc5d7('0x16'));var config=require(_0xc5d7('0x17'));var licenseUtil=require(_0xc5d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb89d,_0x134546){_0x134546=_0x134546||0xcc;return function(_0x2ca713){if(_0x2ca713){return _0x2cb89d[_0xc5d7('0x19')](_0x134546);}return _0x2cb89d[_0xc5d7('0x1a')](_0x134546)[_0xc5d7('0x1b')]();};}function respondWithResult(_0x17c023,_0x1aca8d){_0x1aca8d=_0x1aca8d||0xc8;return function(_0x16bb30){if(_0x16bb30){return _0x17c023[_0xc5d7('0x1a')](_0x1aca8d)[_0xc5d7('0x1c')](_0x16bb30);}};}function respondWithFilteredResult(_0x35a217,_0x514c99){return function(_0x13e81e){if(_0x13e81e){var _0xb7efc4=typeof _0x514c99['offset']==='undefined'&&typeof _0x514c99[_0xc5d7('0x1d')]===_0xc5d7('0x1e');var _0x1d637b=_0x13e81e[_0xc5d7('0x1f')];var _0x5331cd=_0xb7efc4?0x0:_0x514c99[_0xc5d7('0x20')];var _0x5beb18=_0xb7efc4?_0x13e81e[_0xc5d7('0x1f')]:_0x514c99['offset']+_0x514c99[_0xc5d7('0x1d')];var _0x54453b;if(_0x5beb18>=_0x1d637b){_0x5beb18=_0x1d637b;_0x54453b=0xc8;}else{_0x54453b=0xce;}_0x35a217[_0xc5d7('0x1a')](_0x54453b);return _0x35a217['set'](_0xc5d7('0x21'),_0x5331cd+'-'+_0x5beb18+'/'+_0x1d637b)[_0xc5d7('0x1c')](_0x13e81e);}return null;};}function patchUpdates(_0x27ed1c){return function(_0x5abb78){try{jsonpatch[_0xc5d7('0x22')](_0x5abb78,_0x27ed1c,!![]);}catch(_0x2c8a42){return BPromise[_0xc5d7('0x23')](_0x2c8a42);}return _0x5abb78[_0xc5d7('0x24')]();};}function saveUpdates(_0x466d0f,_0x4aadbb){return function(_0x168810){if(_0x168810){return _0x168810['update'](_0x466d0f)[_0xc5d7('0x25')](function(_0x55067d){return _0x55067d;});}return null;};}function removeEntity(_0x15709f,_0x46ffb9){return function(_0x41ae6b){if(_0x41ae6b){return _0x41ae6b[_0xc5d7('0x26')]()[_0xc5d7('0x25')](function(){_0x15709f[_0xc5d7('0x1a')](0xcc)[_0xc5d7('0x1b')]();});}};}function handleEntityNotFound(_0x1a1d69,_0x5a57f4){return function(_0x1502cc){if(!_0x1502cc){_0x1a1d69[_0xc5d7('0x19')](0x194);}return _0x1502cc;};}function handleError(_0x29ebba,_0x425942){_0x425942=_0x425942||0x1f4;return function(_0x2082fd){logger['error'](_0x2082fd[_0xc5d7('0x27')]);if(_0x2082fd[_0xc5d7('0x28')]){delete _0x2082fd[_0xc5d7('0x28')];}_0x29ebba[_0xc5d7('0x1a')](_0x425942)[_0xc5d7('0x29')](_0x2082fd);};}exports[_0xc5d7('0x2a')]=function(_0x5902f3,_0x274f4f){var _0x519bde={},_0x187b8c={},_0x1e7b67={'count':0x0,'rows':[]};var _0x4d1f44=_[_0xc5d7('0x2b')](db['OpenchannelTransferReport'][_0xc5d7('0x2c')],function(_0x113cea){return{'name':_0x113cea[_0xc5d7('0x2d')],'type':_0x113cea[_0xc5d7('0x2e')]['key']};});_0x187b8c['model']=_[_0xc5d7('0x2b')](_0x4d1f44,_0xc5d7('0x28'));_0x187b8c['query']=_[_0xc5d7('0x2f')](_0x5902f3[_0xc5d7('0x30')]);_0x187b8c[_0xc5d7('0x31')]=_[_0xc5d7('0x32')](_0x187b8c[_0xc5d7('0x33')],_0x187b8c['query']);_0x519bde[_0xc5d7('0x34')]=_['intersection'](_0x187b8c[_0xc5d7('0x33')],qs[_0xc5d7('0x35')](_0x5902f3[_0xc5d7('0x30')]['fields']));_0x519bde[_0xc5d7('0x34')]=_0x519bde[_0xc5d7('0x34')][_0xc5d7('0x36')]?_0x519bde[_0xc5d7('0x34')]:_0x187b8c[_0xc5d7('0x33')];if(!_0x5902f3[_0xc5d7('0x30')]['hasOwnProperty'](_0xc5d7('0x37'))){_0x519bde[_0xc5d7('0x1d')]=qs[_0xc5d7('0x1d')](_0x5902f3['query']['limit']);_0x519bde['offset']=qs['offset'](_0x5902f3['query'][_0xc5d7('0x20')]);}_0x519bde['order']=qs[_0xc5d7('0x38')](_0x5902f3[_0xc5d7('0x30')][_0xc5d7('0x38')]);_0x519bde[_0xc5d7('0x39')]=qs[_0xc5d7('0x31')](_[_0xc5d7('0x3a')](_0x5902f3[_0xc5d7('0x30')],_0x187b8c[_0xc5d7('0x31')]),_0x4d1f44);if(_0x5902f3[_0xc5d7('0x30')][_0xc5d7('0x3b')]){_0x519bde[_0xc5d7('0x39')]=_[_0xc5d7('0x3c')](_0x519bde[_0xc5d7('0x39')],{'$or':_[_0xc5d7('0x2b')](_0x4d1f44,function(_0xb8498e){if(_0xb8498e[_0xc5d7('0x2e')]!==_0xc5d7('0x3d')){var _0x564749={};_0x564749[_0xb8498e[_0xc5d7('0x28')]]={'$like':'%'+_0x5902f3[_0xc5d7('0x30')]['filter']+'%'};return _0x564749;}})});}_0x519bde=_[_0xc5d7('0x3c')]({},_0x519bde,_0x5902f3[_0xc5d7('0x3e')]);var _0x50e7bb={'where':_0x519bde[_0xc5d7('0x39')]};return db[_0xc5d7('0x3f')][_0xc5d7('0x1f')](_0x50e7bb)[_0xc5d7('0x25')](function(_0x112836){_0x1e7b67[_0xc5d7('0x1f')]=_0x112836;if(_0x5902f3['query'][_0xc5d7('0x40')]){_0x519bde[_0xc5d7('0x41')]=[{'all':!![]}];}return db[_0xc5d7('0x3f')]['findAll'](_0x519bde);})[_0xc5d7('0x25')](function(_0x52d9c9){_0x1e7b67['rows']=_0x52d9c9;return _0x1e7b67;})[_0xc5d7('0x25')](respondWithFilteredResult(_0x274f4f,_0x519bde))[_0xc5d7('0x42')](handleError(_0x274f4f,null));};exports[_0xc5d7('0x43')]=function(_0x13d90c,_0x5cd8b4){var _0x3aae70={'raw':!![],'where':{'id':_0x13d90c[_0xc5d7('0x44')]['id']}},_0x5878cf={};_0x5878cf[_0xc5d7('0x33')]=_['keys'](db[_0xc5d7('0x3f')]['rawAttributes']);_0x5878cf[_0xc5d7('0x30')]=_[_0xc5d7('0x2f')](_0x13d90c[_0xc5d7('0x30')]);_0x5878cf[_0xc5d7('0x31')]=_[_0xc5d7('0x32')](_0x5878cf['model'],_0x5878cf[_0xc5d7('0x30')]);_0x3aae70['attributes']=_[_0xc5d7('0x32')](_0x5878cf['model'],qs[_0xc5d7('0x35')](_0x13d90c['query'][_0xc5d7('0x35')]));_0x3aae70['attributes']=_0x3aae70[_0xc5d7('0x34')]['length']?_0x3aae70[_0xc5d7('0x34')]:_0x5878cf[_0xc5d7('0x33')];if(_0x13d90c[_0xc5d7('0x30')][_0xc5d7('0x40')]){_0x3aae70[_0xc5d7('0x41')]=[{'all':!![]}];}_0x3aae70=_[_0xc5d7('0x3c')]({},_0x3aae70,_0x13d90c[_0xc5d7('0x3e')]);return db[_0xc5d7('0x3f')][_0xc5d7('0x45')](_0x3aae70)[_0xc5d7('0x25')](handleEntityNotFound(_0x5cd8b4,null))[_0xc5d7('0x25')](respondWithResult(_0x5cd8b4,null))[_0xc5d7('0x42')](handleError(_0x5cd8b4,null));};exports[_0xc5d7('0x46')]=function(_0x36dc4f,_0x14c38c){return db[_0xc5d7('0x3f')][_0xc5d7('0x46')](_0x36dc4f['body'],{})[_0xc5d7('0x25')](respondWithResult(_0x14c38c,0xc9))[_0xc5d7('0x42')](handleError(_0x14c38c,null));};exports[_0xc5d7('0x47')]=function(_0x4123a3,_0x2df4b5){if(_0x4123a3['body']['id']){delete _0x4123a3[_0xc5d7('0x48')]['id'];}return db[_0xc5d7('0x3f')][_0xc5d7('0x45')]({'where':{'id':_0x4123a3['params']['id']}})['then'](handleEntityNotFound(_0x2df4b5,null))[_0xc5d7('0x25')](saveUpdates(_0x4123a3['body'],null))[_0xc5d7('0x25')](respondWithResult(_0x2df4b5,null))[_0xc5d7('0x42')](handleError(_0x2df4b5,null));};exports[_0xc5d7('0x26')]=function(_0x36a8d5,_0x4fef74){return db[_0xc5d7('0x3f')][_0xc5d7('0x45')]({'where':{'id':_0x36a8d5[_0xc5d7('0x44')]['id']}})[_0xc5d7('0x25')](handleEntityNotFound(_0x4fef74,null))[_0xc5d7('0x25')](removeEntity(_0x4fef74,null))[_0xc5d7('0x42')](handleError(_0x4fef74,null));};exports[_0xc5d7('0x49')]=function(_0x509072,_0xcb403f){return db[_0xc5d7('0x3f')]['describe']()[_0xc5d7('0x25')](respondWithResult(_0xcb403f,null))[_0xc5d7('0x42')](handleError(_0xcb403f,null));}; \ No newline at end of file +var _0x063c=['filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','show','params','find','create','body','catch','update','destroy','describe','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','error','stack','name','send','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x494ff9,_0x1d93c6){var _0x2428e7=function(_0x47ed61){while(--_0x47ed61){_0x494ff9['push'](_0x494ff9['shift']());}};_0x2428e7(++_0x1d93c6);}(_0x063c,0xea));var _0xc063=function(_0x1f91c4,_0x302f6e){_0x1f91c4=_0x1f91c4-0x0;var _0x4029be=_0x063c[_0x1f91c4];return _0x4029be;};'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(_0xc063('0x0'));var moment=require(_0xc063('0x1'));var BPromise=require(_0xc063('0x2'));var Mustache=require('mustache');var util=require(_0xc063('0x3'));var path=require('path');var sox=require(_0xc063('0x4'));var csv=require(_0xc063('0x5'));var ejs=require(_0xc063('0x6'));var fs=require('fs');var fs_extra=require(_0xc063('0x7'));var _=require(_0xc063('0x8'));var squel=require(_0xc063('0x9'));var crypto=require(_0xc063('0xa'));var jsforce=require(_0xc063('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc063('0x5'));var querystring=require('querystring');var Papa=require(_0xc063('0xc'));var Redis=require(_0xc063('0xd'));var authService=require(_0xc063('0xe'));var qs=require(_0xc063('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc063('0x10'))(_0xc063('0x11'));var utils=require(_0xc063('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc063('0x13'))['db'];function respondWithStatusCode(_0x2e3301,_0x3db288){_0x3db288=_0x3db288||0xcc;return function(_0x177a98){if(_0x177a98){return _0x2e3301[_0xc063('0x14')](_0x3db288);}return _0x2e3301['status'](_0x3db288)[_0xc063('0x15')]();};}function respondWithResult(_0x5cadea,_0x2302ce){_0x2302ce=_0x2302ce||0xc8;return function(_0x46bc4c){if(_0x46bc4c){return _0x5cadea[_0xc063('0x16')](_0x2302ce)[_0xc063('0x17')](_0x46bc4c);}};}function respondWithFilteredResult(_0x15bf97,_0x19b347){return function(_0x1d5878){if(_0x1d5878){var _0x2d2fa5=typeof _0x19b347[_0xc063('0x18')]==='undefined'&&typeof _0x19b347[_0xc063('0x19')]==='undefined';var _0x32b00c=_0x1d5878[_0xc063('0x1a')];var _0x25fd33=_0x2d2fa5?0x0:_0x19b347[_0xc063('0x18')];var _0x4774ac=_0x2d2fa5?_0x1d5878[_0xc063('0x1a')]:_0x19b347[_0xc063('0x18')]+_0x19b347[_0xc063('0x19')];var _0x15fd8f;if(_0x4774ac>=_0x32b00c){_0x4774ac=_0x32b00c;_0x15fd8f=0xc8;}else{_0x15fd8f=0xce;}_0x15bf97[_0xc063('0x16')](_0x15fd8f);return _0x15bf97[_0xc063('0x1b')](_0xc063('0x1c'),_0x25fd33+'-'+_0x4774ac+'/'+_0x32b00c)[_0xc063('0x17')](_0x1d5878);}return null;};}function patchUpdates(_0x23d8c2){return function(_0x312b02){try{jsonpatch[_0xc063('0x1d')](_0x312b02,_0x23d8c2,!![]);}catch(_0x5ac62d){return BPromise[_0xc063('0x1e')](_0x5ac62d);}return _0x312b02[_0xc063('0x1f')]();};}function saveUpdates(_0x33caae,_0x2ee87e){return function(_0x430844){if(_0x430844){return _0x430844['update'](_0x33caae)['then'](function(_0x55d5f5){return _0x55d5f5;});}return null;};}function removeEntity(_0x4d5120,_0x4899b2){return function(_0xf81d71){if(_0xf81d71){return _0xf81d71['destroy']()['then'](function(){_0x4d5120[_0xc063('0x16')](0xcc)[_0xc063('0x15')]();});}};}function handleEntityNotFound(_0x416ff4,_0x11b317){return function(_0x3ba81c){if(!_0x3ba81c){_0x416ff4[_0xc063('0x14')](0x194);}return _0x3ba81c;};}function handleError(_0x12fe7b,_0x46b725){_0x46b725=_0x46b725||0x1f4;return function(_0x2a6165){logger[_0xc063('0x20')](_0x2a6165[_0xc063('0x21')]);if(_0x2a6165[_0xc063('0x22')]){delete _0x2a6165[_0xc063('0x22')];}_0x12fe7b['status'](_0x46b725)[_0xc063('0x23')](_0x2a6165);};}exports['index']=function(_0x34d347,_0xb0ffd5){var _0x3a906e={},_0x2048df={},_0x2043cc={'count':0x0,'rows':[]};var _0x243d85=_[_0xc063('0x24')](db[_0xc063('0x25')]['rawAttributes'],function(_0x2db301){return{'name':_0x2db301[_0xc063('0x26')],'type':_0x2db301[_0xc063('0x27')][_0xc063('0x28')]};});_0x2048df[_0xc063('0x29')]=_['map'](_0x243d85,_0xc063('0x22'));_0x2048df[_0xc063('0x2a')]=_[_0xc063('0x2b')](_0x34d347[_0xc063('0x2a')]);_0x2048df[_0xc063('0x2c')]=_[_0xc063('0x2d')](_0x2048df[_0xc063('0x29')],_0x2048df[_0xc063('0x2a')]);_0x3a906e[_0xc063('0x2e')]=_[_0xc063('0x2d')](_0x2048df['model'],qs[_0xc063('0x2f')](_0x34d347[_0xc063('0x2a')][_0xc063('0x2f')]));_0x3a906e[_0xc063('0x2e')]=_0x3a906e[_0xc063('0x2e')][_0xc063('0x30')]?_0x3a906e['attributes']:_0x2048df[_0xc063('0x29')];if(!_0x34d347['query'][_0xc063('0x31')](_0xc063('0x32'))){_0x3a906e['limit']=qs[_0xc063('0x19')](_0x34d347[_0xc063('0x2a')][_0xc063('0x19')]);_0x3a906e['offset']=qs['offset'](_0x34d347[_0xc063('0x2a')][_0xc063('0x18')]);}_0x3a906e[_0xc063('0x33')]=qs[_0xc063('0x34')](_0x34d347[_0xc063('0x2a')][_0xc063('0x34')]);_0x3a906e['where']=qs['filters'](_[_0xc063('0x35')](_0x34d347[_0xc063('0x2a')],_0x2048df[_0xc063('0x2c')]),_0x243d85);if(_0x34d347[_0xc063('0x2a')][_0xc063('0x36')]){_0x3a906e[_0xc063('0x37')]=_[_0xc063('0x38')](_0x3a906e['where'],{'$or':_[_0xc063('0x24')](_0x243d85,function(_0x259a7a){if(_0x259a7a[_0xc063('0x27')]!==_0xc063('0x39')){var _0x1f041a={};_0x1f041a[_0x259a7a['name']]={'$like':'%'+_0x34d347[_0xc063('0x2a')]['filter']+'%'};return _0x1f041a;}})});}_0x3a906e=_['merge']({},_0x3a906e,_0x34d347[_0xc063('0x3a')]);var _0x5c0f5a={'where':_0x3a906e[_0xc063('0x37')]};return db['OpenchannelTransferReport'][_0xc063('0x1a')](_0x5c0f5a)[_0xc063('0x3b')](function(_0x5501cf){_0x2043cc['count']=_0x5501cf;if(_0x34d347[_0xc063('0x2a')][_0xc063('0x3c')]){_0x3a906e[_0xc063('0x3d')]=[{'all':!![]}];}return db[_0xc063('0x25')][_0xc063('0x3e')](_0x3a906e);})[_0xc063('0x3b')](function(_0x1c9c71){_0x2043cc['rows']=_0x1c9c71;return _0x2043cc;})[_0xc063('0x3b')](respondWithFilteredResult(_0xb0ffd5,_0x3a906e))['catch'](handleError(_0xb0ffd5,null));};exports[_0xc063('0x3f')]=function(_0x4aa0f8,_0x1f26f9){var _0x2c6fe7={'raw':!![],'where':{'id':_0x4aa0f8[_0xc063('0x40')]['id']}},_0x3262f8={};_0x3262f8['model']=_[_0xc063('0x2b')](db['OpenchannelTransferReport']['rawAttributes']);_0x3262f8[_0xc063('0x2a')]=_[_0xc063('0x2b')](_0x4aa0f8[_0xc063('0x2a')]);_0x3262f8[_0xc063('0x2c')]=_['intersection'](_0x3262f8[_0xc063('0x29')],_0x3262f8[_0xc063('0x2a')]);_0x2c6fe7[_0xc063('0x2e')]=_[_0xc063('0x2d')](_0x3262f8[_0xc063('0x29')],qs[_0xc063('0x2f')](_0x4aa0f8[_0xc063('0x2a')][_0xc063('0x2f')]));_0x2c6fe7['attributes']=_0x2c6fe7['attributes']['length']?_0x2c6fe7[_0xc063('0x2e')]:_0x3262f8['model'];if(_0x4aa0f8['query'][_0xc063('0x3c')]){_0x2c6fe7['include']=[{'all':!![]}];}_0x2c6fe7=_[_0xc063('0x38')]({},_0x2c6fe7,_0x4aa0f8[_0xc063('0x3a')]);return db['OpenchannelTransferReport'][_0xc063('0x41')](_0x2c6fe7)[_0xc063('0x3b')](handleEntityNotFound(_0x1f26f9,null))[_0xc063('0x3b')](respondWithResult(_0x1f26f9,null))['catch'](handleError(_0x1f26f9,null));};exports[_0xc063('0x42')]=function(_0x73de8b,_0x4eec63){return db[_0xc063('0x25')]['create'](_0x73de8b[_0xc063('0x43')],{})[_0xc063('0x3b')](respondWithResult(_0x4eec63,0xc9))[_0xc063('0x44')](handleError(_0x4eec63,null));};exports[_0xc063('0x45')]=function(_0xb710ad,_0xc4d035){if(_0xb710ad[_0xc063('0x43')]['id']){delete _0xb710ad[_0xc063('0x43')]['id'];}return db[_0xc063('0x25')][_0xc063('0x41')]({'where':{'id':_0xb710ad[_0xc063('0x40')]['id']}})[_0xc063('0x3b')](handleEntityNotFound(_0xc4d035,null))[_0xc063('0x3b')](saveUpdates(_0xb710ad[_0xc063('0x43')],null))[_0xc063('0x3b')](respondWithResult(_0xc4d035,null))['catch'](handleError(_0xc4d035,null));};exports[_0xc063('0x46')]=function(_0x4f7028,_0x3b95d6){return db[_0xc063('0x25')][_0xc063('0x41')]({'where':{'id':_0x4f7028[_0xc063('0x40')]['id']}})[_0xc063('0x3b')](handleEntityNotFound(_0x3b95d6,null))[_0xc063('0x3b')](removeEntity(_0x3b95d6,null))[_0xc063('0x44')](handleError(_0x3b95d6,null));};exports[_0xc063('0x47')]=function(_0x5a9bbf,_0x1439fa){return db[_0xc063('0x25')][_0xc063('0x47')]()['then'](respondWithResult(_0x1439fa,null))[_0xc063('0x44')](handleError(_0x1439fa,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e91cefe..0303e59 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 _0xa315=['uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x22332d,_0x34a4da){var _0x4cbd3d=function(_0x49fbe9){while(--_0x49fbe9){_0x22332d['push'](_0x22332d['shift']());}};_0x4cbd3d(++_0x34a4da);}(_0xa315,0x85));var _0x5a31=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xa315[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require(_0x5a31('0x0'));var logger=require(_0x5a31('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5a31('0x2'));var rp=require(_0x5a31('0x3'));var fs=require('fs');var path=require(_0x5a31('0x4'));var rimraf=require(_0x5a31('0x5'));var config=require(_0x5a31('0x6'));var attributes=require(_0x5a31('0x7'));module['exports']=function(_0x2e5d06,_0x21a75d){return _0x2e5d06[_0x5a31('0x8')](_0x5a31('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x5a31('0xa'),'fields':[_0x5a31('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8228=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8228,0x141));var _0x8822=function(_0x54cdc0,_0x248ed5){_0x54cdc0=_0x54cdc0-0x0;var _0x1dc34d=_0x8228[_0x54cdc0];return _0x1dc34d;};'use strict';var _=require('lodash');var util=require(_0x8822('0x0'));var logger=require('../../config/logger')(_0x8822('0x1'));var moment=require(_0x8822('0x2'));var BPromise=require(_0x8822('0x3'));var rp=require(_0x8822('0x4'));var fs=require('fs');var path=require(_0x8822('0x5'));var rimraf=require(_0x8822('0x6'));var config=require(_0x8822('0x7'));var attributes=require(_0x8822('0x8'));module['exports']=function(_0x5b4ccb,_0x51e9a6){return _0x5b4ccb[_0x8822('0x9')](_0x8822('0xa'),attributes,{'tableName':_0x8822('0xb'),'paranoid':![],'indexes':[{'name':_0x8822('0xc'),'fields':[_0x8822('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index ed01930..ed8b4ab 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 _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5577,0x1b4));var _0x7557=function(_0x28b7f1,_0x4c6a8e){_0x28b7f1=_0x28b7f1-0x0;var _0x4f79d4=_0x5577[_0x28b7f1];return _0x4f79d4;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file +var _0x7dee=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2f8140,_0x37076b){var _0x21bd12=function(_0x179e41){while(--_0x179e41){_0x2f8140['push'](_0x2f8140['shift']());}};_0x21bd12(++_0x37076b);}(_0x7dee,0xb0));var _0xe7de=function(_0x8d2fa7,_0x2e6b66){_0x8d2fa7=_0x8d2fa7-0x0;var _0x81f895=_0x7dee[_0x8d2fa7];return _0x81f895;};'use strict';var _=require(_0xe7de('0x0'));var util=require('util');var moment=require(_0xe7de('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7de('0x2'));var fs=require('fs');var Redis=require(_0xe7de('0x3'));var db=require(_0xe7de('0x4'))['db'];var utils=require(_0xe7de('0x5'));var logger=require('../../config/logger')(_0xe7de('0x6'));var config=require('../../config/environment');var jayson=require(_0xe7de('0x7'));var client=jayson[_0xe7de('0x8')][_0xe7de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17515b,_0x372910,_0x392168){return new BPromise(function(_0x52753f,_0x4469e0){return client[_0xe7de('0xa')](_0x17515b,_0x392168)[_0xe7de('0xb')](function(_0x2177f9){logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));logger[_0xe7de('0xe')](_0xe7de('0xf'),_0x372910,_0xe7de('0xd'),JSON[_0xe7de('0x10')](_0x2177f9));if(_0x2177f9[_0xe7de('0x11')]){if(_0x2177f9['error'][_0xe7de('0x12')]===0x1f4){logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x4469e0(_0x2177f9['error'][_0xe7de('0x13')]);}logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x52753f(_0x2177f9[_0xe7de('0x11')]['message']);}else{logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));_0x52753f(_0x2177f9[_0xe7de('0x14')][_0xe7de('0x13')]);}})[_0xe7de('0x15')](function(_0x573cb4){logger[_0xe7de('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x372910,_0x573cb4);_0x4469e0(_0x573cb4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0110ddb..c1bcda9 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 _0x1936=['./pause.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1936,0x1d6));var _0x6193=function(_0x143ea6,_0x3c9999){_0x143ea6=_0x143ea6-0x0;var _0xfb14d=_0x1936[_0x143ea6];return _0xfb14d;};'use strict';var multer=require(_0x6193('0x0'));var util=require(_0x6193('0x1'));var path=require(_0x6193('0x2'));var timeout=require(_0x6193('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6193('0x4'));var config=require(_0x6193('0x5'));var controller=require(_0x6193('0x6'));router['get']('/',auth[_0x6193('0x7')](),controller[_0x6193('0x8')]);router[_0x6193('0x9')](_0x6193('0xa'),auth['isAuthenticated'](),controller[_0x6193('0xb')]);router[_0x6193('0xc')]('/',auth[_0x6193('0x7')](),controller['create']);router['put'](_0x6193('0xa'),auth['isAuthenticated'](),controller[_0x6193('0xd')]);router[_0x6193('0xe')]('/:id',auth[_0x6193('0x7')](),controller[_0x6193('0xf')]);module[_0x6193('0x10')]=router; \ No newline at end of file +var _0xe9fa=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout'];(function(_0x22889a,_0x4b75f7){var _0x763d34=function(_0x2040e5){while(--_0x2040e5){_0x22889a['push'](_0x22889a['shift']());}};_0x763d34(++_0x4b75f7);}(_0xe9fa,0xfc));var _0xae9f=function(_0x58eb6e,_0x314940){_0x58eb6e=_0x58eb6e-0x0;var _0x5d2637=_0xe9fa[_0x58eb6e];return _0x5d2637;};'use strict';var multer=require(_0xae9f('0x0'));var util=require(_0xae9f('0x1'));var path=require('path');var timeout=require(_0xae9f('0x2'));var express=require(_0xae9f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xae9f('0x4'));var interaction=require(_0xae9f('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xae9f('0x6')]('/',auth[_0xae9f('0x7')](),controller['index']);router[_0xae9f('0x6')](_0xae9f('0x8'),auth[_0xae9f('0x7')](),controller[_0xae9f('0x9')]);router[_0xae9f('0xa')]('/',auth['isAuthenticated'](),controller[_0xae9f('0xb')]);router['put'](_0xae9f('0x8'),auth[_0xae9f('0x7')](),controller[_0xae9f('0xc')]);router[_0xae9f('0xd')](_0xae9f('0x8'),auth[_0xae9f('0x7')](),controller[_0xae9f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index af2a7f2..7ed9815 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 _0x9635=['exports','STRING','name','sequelize'];(function(_0x452481,_0x474ae2){var _0x4db680=function(_0x434743){while(--_0x434743){_0x452481['push'](_0x452481['shift']());}};_0x4db680(++_0x474ae2);}(_0x9635,0x1ef));var _0x5963=function(_0x4c1b9d,_0x15fe9d){_0x4c1b9d=_0x4c1b9d-0x0;var _0x3fca7a=_0x9635[_0x4c1b9d];return _0x3fca7a;};'use strict';var Sequelize=require(_0x5963('0x0'));module[_0x5963('0x1')]={'name':{'type':Sequelize[_0x5963('0x2')],'unique':_0x5963('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5963('0x2')]}}; \ No newline at end of file +var _0xe735=['STRING','name','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe735,0x13a));var _0x5e73=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xe735[_0x3fe6df];return _0x372a0e;};'use strict';var Sequelize=require(_0x5e73('0x0'));module['exports']={'name':{'type':Sequelize[_0x5e73('0x1')],'unique':_0x5e73('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5e73('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 098a82d..f70548c 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 _0xe9ce=['limit','count','set','Content-Range','apply','update','then','get','Pauses','destroy','sendStatus','error','stack','name','Pause','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','undefined'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe9ce,0x1d2));var _0xee9c=function(_0x59d1e1,_0x3bc8c1){_0x59d1e1=_0x59d1e1-0x0;var _0x2e0a0a=_0xe9ce[_0x59d1e1];return _0x2e0a0a;};'use strict';var emlformat=require(_0xee9c('0x0'));var rimraf=require(_0xee9c('0x1'));var zipdir=require(_0xee9c('0x2'));var jsonpatch=require(_0xee9c('0x3'));var rp=require(_0xee9c('0x4'));var moment=require(_0xee9c('0x5'));var BPromise=require(_0xee9c('0x6'));var Mustache=require(_0xee9c('0x7'));var util=require(_0xee9c('0x8'));var path=require(_0xee9c('0x9'));var sox=require('sox');var csv=require(_0xee9c('0xa'));var ejs=require(_0xee9c('0xb'));var fs=require('fs');var fs_extra=require(_0xee9c('0xc'));var _=require(_0xee9c('0xd'));var squel=require(_0xee9c('0xe'));var crypto=require('crypto');var jsforce=require(_0xee9c('0xf'));var deskjs=require(_0xee9c('0x10'));var toCsv=require(_0xee9c('0xa'));var querystring=require(_0xee9c('0x11'));var Papa=require(_0xee9c('0x12'));var Redis=require(_0xee9c('0x13'));var authService=require(_0xee9c('0x14'));var qs=require(_0xee9c('0x15'));var as=require(_0xee9c('0x16'));var hardwareService=require(_0xee9c('0x17'));var logger=require('../../config/logger')(_0xee9c('0x18'));var utils=require(_0xee9c('0x19'));var config=require(_0xee9c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x474908,_0x4a12fd){_0x4a12fd=_0x4a12fd||0xcc;return function(_0x25f0a0){if(_0x25f0a0){return _0x474908['sendStatus'](_0x4a12fd);}return _0x474908[_0xee9c('0x1b')](_0x4a12fd)[_0xee9c('0x1c')]();};}function respondWithResult(_0x1db766,_0xe0b170){_0xe0b170=_0xe0b170||0xc8;return function(_0x3b91f0){if(_0x3b91f0){return _0x1db766[_0xee9c('0x1b')](_0xe0b170)[_0xee9c('0x1d')](_0x3b91f0);}};}function respondWithFilteredResult(_0x5a7ec7,_0x1d33ef){return function(_0x1c4977){if(_0x1c4977){var _0x318eea=typeof _0x1d33ef[_0xee9c('0x1e')]===_0xee9c('0x1f')&&typeof _0x1d33ef[_0xee9c('0x20')]===_0xee9c('0x1f');var _0x5a0b57=_0x1c4977[_0xee9c('0x21')];var _0x112da7=_0x318eea?0x0:_0x1d33ef[_0xee9c('0x1e')];var _0x26b72e=_0x318eea?_0x1c4977['count']:_0x1d33ef['offset']+_0x1d33ef['limit'];var _0x4a277c;if(_0x26b72e>=_0x5a0b57){_0x26b72e=_0x5a0b57;_0x4a277c=0xc8;}else{_0x4a277c=0xce;}_0x5a7ec7[_0xee9c('0x1b')](_0x4a277c);return _0x5a7ec7[_0xee9c('0x22')](_0xee9c('0x23'),_0x112da7+'-'+_0x26b72e+'/'+_0x5a0b57)[_0xee9c('0x1d')](_0x1c4977);}return null;};}function patchUpdates(_0x2171a2){return function(_0x4c7638){try{jsonpatch[_0xee9c('0x24')](_0x4c7638,_0x2171a2,!![]);}catch(_0x42aa7d){return BPromise['reject'](_0x42aa7d);}return _0x4c7638['save']();};}function saveUpdates(_0x259959,_0x1164e9){return function(_0x22a18d){if(_0x22a18d){return _0x22a18d[_0xee9c('0x25')](_0x259959)[_0xee9c('0x26')](function(_0x219915){return _0x219915;});}return null;};}function removeEntity(_0x59fd1c,_0x45354f){return function(_0xae92af){if(_0xae92af){return _0xae92af['destroy']()[_0xee9c('0x26')](function(){var _0xd6ac74=_0xae92af[_0xee9c('0x27')]({'plain':!![]});var _0x1c7f26=_0xee9c('0x28');return db['UserProfileResource'][_0xee9c('0x29')]({'where':{'type':_0x1c7f26,'resourceId':_0xd6ac74['id']}})['then'](function(){return _0xae92af;});})[_0xee9c('0x26')](function(){_0x59fd1c[_0xee9c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ea04b,_0x5ccf1c){return function(_0x2eb899){if(!_0x2eb899){_0x5ea04b[_0xee9c('0x2a')](0x194);}return _0x2eb899;};}function handleError(_0x253c9a,_0x2c2772){_0x2c2772=_0x2c2772||0x1f4;return function(_0x2b0403){logger[_0xee9c('0x2b')](_0x2b0403[_0xee9c('0x2c')]);if(_0x2b0403[_0xee9c('0x2d')]){delete _0x2b0403['name'];}_0x253c9a['status'](_0x2c2772)['send'](_0x2b0403);};}exports['index']=function(_0x535da6,_0x1666ad){var _0xed596c={},_0x425a2d={},_0x4ef29e={'count':0x0,'rows':[]};var _0x581b14=_['map'](db[_0xee9c('0x2e')]['rawAttributes'],function(_0x1a1092){return{'name':_0x1a1092[_0xee9c('0x2f')],'type':_0x1a1092[_0xee9c('0x30')][_0xee9c('0x31')]};});_0x425a2d[_0xee9c('0x32')]=_[_0xee9c('0x33')](_0x581b14,_0xee9c('0x2d'));_0x425a2d[_0xee9c('0x34')]=_['keys'](_0x535da6[_0xee9c('0x34')]);_0x425a2d[_0xee9c('0x35')]=_['intersection'](_0x425a2d[_0xee9c('0x32')],_0x425a2d['query']);_0xed596c['attributes']=_[_0xee9c('0x36')](_0x425a2d[_0xee9c('0x32')],qs[_0xee9c('0x37')](_0x535da6[_0xee9c('0x34')][_0xee9c('0x37')]));_0xed596c[_0xee9c('0x38')]=_0xed596c[_0xee9c('0x38')]['length']?_0xed596c[_0xee9c('0x38')]:_0x425a2d[_0xee9c('0x32')];if(!_0x535da6[_0xee9c('0x34')][_0xee9c('0x39')]('nolimit')){_0xed596c[_0xee9c('0x20')]=qs['limit'](_0x535da6[_0xee9c('0x34')][_0xee9c('0x20')]);_0xed596c[_0xee9c('0x1e')]=qs[_0xee9c('0x1e')](_0x535da6[_0xee9c('0x34')][_0xee9c('0x1e')]);}_0xed596c['order']=qs[_0xee9c('0x3a')](_0x535da6[_0xee9c('0x34')][_0xee9c('0x3a')]);_0xed596c['where']=qs[_0xee9c('0x35')](_[_0xee9c('0x3b')](_0x535da6['query'],_0x425a2d[_0xee9c('0x35')]),_0x581b14);if(_0x535da6['query']['filter']){_0xed596c[_0xee9c('0x3c')]=_[_0xee9c('0x3d')](_0xed596c[_0xee9c('0x3c')],{'$or':_[_0xee9c('0x33')](_0x581b14,function(_0x460cc7){if(_0x460cc7['type']!=='VIRTUAL'){var _0x157b22={};_0x157b22[_0x460cc7['name']]={'$like':'%'+_0x535da6[_0xee9c('0x34')][_0xee9c('0x3e')]+'%'};return _0x157b22;}})});}_0xed596c=_[_0xee9c('0x3d')]({},_0xed596c,_0x535da6[_0xee9c('0x3f')]);var _0x1c65c5={'where':_0xed596c['where']};return db[_0xee9c('0x2e')]['count'](_0x1c65c5)[_0xee9c('0x26')](function(_0x4adf57){_0x4ef29e['count']=_0x4adf57;if(_0x535da6[_0xee9c('0x34')][_0xee9c('0x40')]){_0xed596c[_0xee9c('0x41')]=[{'all':!![]}];}return db[_0xee9c('0x2e')][_0xee9c('0x42')](_0xed596c);})[_0xee9c('0x26')](function(_0x2e26ed){_0x4ef29e[_0xee9c('0x43')]=_0x2e26ed;return _0x4ef29e;})[_0xee9c('0x26')](respondWithFilteredResult(_0x1666ad,_0xed596c))[_0xee9c('0x44')](handleError(_0x1666ad,null));};exports['show']=function(_0x5da0fd,_0xfd3e09){var _0x5c52f0={'raw':!![],'where':{'id':_0x5da0fd[_0xee9c('0x45')]['id']}},_0x539f74={};_0x539f74[_0xee9c('0x32')]=_['keys'](db[_0xee9c('0x2e')][_0xee9c('0x46')]);_0x539f74['query']=_[_0xee9c('0x47')](_0x5da0fd[_0xee9c('0x34')]);_0x539f74['filters']=_[_0xee9c('0x36')](_0x539f74[_0xee9c('0x32')],_0x539f74['query']);_0x5c52f0[_0xee9c('0x38')]=_['intersection'](_0x539f74[_0xee9c('0x32')],qs[_0xee9c('0x37')](_0x5da0fd['query'][_0xee9c('0x37')]));_0x5c52f0['attributes']=_0x5c52f0['attributes'][_0xee9c('0x48')]?_0x5c52f0[_0xee9c('0x38')]:_0x539f74[_0xee9c('0x32')];if(_0x5da0fd[_0xee9c('0x34')]['includeAll']){_0x5c52f0[_0xee9c('0x41')]=[{'all':!![]}];}_0x5c52f0=_[_0xee9c('0x3d')]({},_0x5c52f0,_0x5da0fd['options']);return db['Pause'][_0xee9c('0x49')](_0x5c52f0)['then'](handleEntityNotFound(_0xfd3e09,null))[_0xee9c('0x26')](respondWithResult(_0xfd3e09,null))[_0xee9c('0x44')](handleError(_0xfd3e09,null));};exports[_0xee9c('0x4a')]=function(_0x5f0ab9,_0x8aa3b1){return db[_0xee9c('0x2e')]['create'](_0x5f0ab9['body'],{})[_0xee9c('0x26')](function(_0x30d59d){var _0x177623=_0x5f0ab9[_0xee9c('0x4b')][_0xee9c('0x27')]({'plain':!![]});if(!_0x177623)throw new Error(_0xee9c('0x4c'));if(_0x177623[_0xee9c('0x4d')]===_0xee9c('0x4b')){var _0x36768c=_0x30d59d[_0xee9c('0x27')]({'plain':!![]});var _0x3f9390='Pauses';return db[_0xee9c('0x4e')][_0xee9c('0x49')]({'where':{'name':_0x3f9390,'userProfileId':_0x177623[_0xee9c('0x4f')]},'raw':!![]})['then'](function(_0x2a7026){if(_0x2a7026&&_0x2a7026['autoAssociation']===0x0){return db[_0xee9c('0x50')]['create']({'name':_0x36768c[_0xee9c('0x2d')],'resourceId':_0x36768c['id'],'type':_0x2a7026[_0xee9c('0x2d')],'sectionId':_0x2a7026['id']},{})[_0xee9c('0x26')](function(){return _0x30d59d;});}else{return _0x30d59d;}})['catch'](function(_0x52dd1b){logger[_0xee9c('0x2b')](_0xee9c('0x51'),_0x52dd1b);throw _0x52dd1b;});}return _0x30d59d;})['then'](respondWithResult(_0x8aa3b1,0xc9))[_0xee9c('0x44')](handleError(_0x8aa3b1,null));};exports['update']=function(_0x5d4a24,_0x191a69){if(_0x5d4a24['body']['id']){delete _0x5d4a24['body']['id'];}return db[_0xee9c('0x2e')][_0xee9c('0x49')]({'where':{'id':_0x5d4a24['params']['id']}})[_0xee9c('0x26')](handleEntityNotFound(_0x191a69,null))[_0xee9c('0x26')](saveUpdates(_0x5d4a24[_0xee9c('0x52')],null))[_0xee9c('0x26')](respondWithResult(_0x191a69,null))[_0xee9c('0x44')](handleError(_0x191a69,null));};exports[_0xee9c('0x29')]=function(_0xcb370b,_0xd3f27d){return db[_0xee9c('0x2e')][_0xee9c('0x49')]({'where':{'id':_0xcb370b[_0xee9c('0x45')]['id']}})[_0xee9c('0x26')](handleEntityNotFound(_0xd3f27d,null))[_0xee9c('0x26')](removeEntity(_0xd3f27d,null))['catch'](handleError(_0xd3f27d,null));}; \ No newline at end of file +var _0xaccc=['update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','then','destroy','get','Pauses','UserProfileResource','error','stack','name','Pause','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x226942,_0xdfdb43){var _0x15a1b1=function(_0x4a2562){while(--_0x4a2562){_0x226942['push'](_0x226942['shift']());}};_0x15a1b1(++_0xdfdb43);}(_0xaccc,0x1ed));var _0xcacc=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0xaccc[_0x557fd2];return _0x1b54a2;};'use strict';var emlformat=require(_0xcacc('0x0'));var rimraf=require(_0xcacc('0x1'));var zipdir=require(_0xcacc('0x2'));var jsonpatch=require(_0xcacc('0x3'));var rp=require(_0xcacc('0x4'));var moment=require(_0xcacc('0x5'));var BPromise=require(_0xcacc('0x6'));var Mustache=require(_0xcacc('0x7'));var util=require('util');var path=require(_0xcacc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcacc('0x9'));var squel=require('squel');var crypto=require(_0xcacc('0xa'));var jsforce=require(_0xcacc('0xb'));var deskjs=require(_0xcacc('0xc'));var toCsv=require(_0xcacc('0xd'));var querystring=require(_0xcacc('0xe'));var Papa=require(_0xcacc('0xf'));var Redis=require(_0xcacc('0x10'));var authService=require(_0xcacc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcacc('0x12'));var hardwareService=require(_0xcacc('0x13'));var logger=require('../../config/logger')(_0xcacc('0x14'));var utils=require(_0xcacc('0x15'));var config=require(_0xcacc('0x16'));var licenseUtil=require(_0xcacc('0x17'));var db=require(_0xcacc('0x18'))['db'];function respondWithStatusCode(_0x828e49,_0x147c66){_0x147c66=_0x147c66||0xcc;return function(_0x109b2f){if(_0x109b2f){return _0x828e49[_0xcacc('0x19')](_0x147c66);}return _0x828e49[_0xcacc('0x1a')](_0x147c66)[_0xcacc('0x1b')]();};}function respondWithResult(_0x228639,_0x561ca1){_0x561ca1=_0x561ca1||0xc8;return function(_0x2bb0ac){if(_0x2bb0ac){return _0x228639['status'](_0x561ca1)['json'](_0x2bb0ac);}};}function respondWithFilteredResult(_0x389f57,_0x25ad81){return function(_0x1dd031){if(_0x1dd031){var _0x62b220=typeof _0x25ad81[_0xcacc('0x1c')]==='undefined'&&typeof _0x25ad81[_0xcacc('0x1d')]==='undefined';var _0x4495a0=_0x1dd031['count'];var _0x50dbe7=_0x62b220?0x0:_0x25ad81['offset'];var _0x1cba1f=_0x62b220?_0x1dd031[_0xcacc('0x1e')]:_0x25ad81[_0xcacc('0x1c')]+_0x25ad81['limit'];var _0x348458;if(_0x1cba1f>=_0x4495a0){_0x1cba1f=_0x4495a0;_0x348458=0xc8;}else{_0x348458=0xce;}_0x389f57['status'](_0x348458);return _0x389f57[_0xcacc('0x1f')](_0xcacc('0x20'),_0x50dbe7+'-'+_0x1cba1f+'/'+_0x4495a0)[_0xcacc('0x21')](_0x1dd031);}return null;};}function patchUpdates(_0x9467ca){return function(_0x5ddbe6){try{jsonpatch['apply'](_0x5ddbe6,_0x9467ca,!![]);}catch(_0x17f46e){return BPromise[_0xcacc('0x22')](_0x17f46e);}return _0x5ddbe6['save']();};}function saveUpdates(_0x31acd9,_0x17ed8c){return function(_0x2d0a0b){if(_0x2d0a0b){return _0x2d0a0b['update'](_0x31acd9)[_0xcacc('0x23')](function(_0x197dd9){return _0x197dd9;});}return null;};}function removeEntity(_0x292404,_0x3940a4){return function(_0x1ac5cc){if(_0x1ac5cc){return _0x1ac5cc[_0xcacc('0x24')]()[_0xcacc('0x23')](function(){var _0x26a0ae=_0x1ac5cc[_0xcacc('0x25')]({'plain':!![]});var _0xfca906=_0xcacc('0x26');return db[_0xcacc('0x27')][_0xcacc('0x24')]({'where':{'type':_0xfca906,'resourceId':_0x26a0ae['id']}})[_0xcacc('0x23')](function(){return _0x1ac5cc;});})[_0xcacc('0x23')](function(){_0x292404[_0xcacc('0x1a')](0xcc)[_0xcacc('0x1b')]();});}};}function handleEntityNotFound(_0x55b6ee,_0x20f420){return function(_0x596587){if(!_0x596587){_0x55b6ee[_0xcacc('0x19')](0x194);}return _0x596587;};}function handleError(_0xb39b01,_0x580432){_0x580432=_0x580432||0x1f4;return function(_0x580255){logger[_0xcacc('0x28')](_0x580255[_0xcacc('0x29')]);if(_0x580255[_0xcacc('0x2a')]){delete _0x580255[_0xcacc('0x2a')];}_0xb39b01[_0xcacc('0x1a')](_0x580432)['send'](_0x580255);};}exports['index']=function(_0x32bdc6,_0x1177c3){var _0x2e5f86={},_0x1784b4={},_0x364bae={'count':0x0,'rows':[]};var _0x14335b=_['map'](db[_0xcacc('0x2b')][_0xcacc('0x2c')],function(_0x20ae44){return{'name':_0x20ae44['fieldName'],'type':_0x20ae44['type'][_0xcacc('0x2d')]};});_0x1784b4[_0xcacc('0x2e')]=_[_0xcacc('0x2f')](_0x14335b,_0xcacc('0x2a'));_0x1784b4[_0xcacc('0x30')]=_['keys'](_0x32bdc6[_0xcacc('0x30')]);_0x1784b4[_0xcacc('0x31')]=_[_0xcacc('0x32')](_0x1784b4[_0xcacc('0x2e')],_0x1784b4[_0xcacc('0x30')]);_0x2e5f86[_0xcacc('0x33')]=_[_0xcacc('0x32')](_0x1784b4['model'],qs[_0xcacc('0x34')](_0x32bdc6[_0xcacc('0x30')][_0xcacc('0x34')]));_0x2e5f86[_0xcacc('0x33')]=_0x2e5f86[_0xcacc('0x33')]['length']?_0x2e5f86[_0xcacc('0x33')]:_0x1784b4[_0xcacc('0x2e')];if(!_0x32bdc6[_0xcacc('0x30')][_0xcacc('0x35')](_0xcacc('0x36'))){_0x2e5f86[_0xcacc('0x1d')]=qs['limit'](_0x32bdc6[_0xcacc('0x30')]['limit']);_0x2e5f86[_0xcacc('0x1c')]=qs[_0xcacc('0x1c')](_0x32bdc6[_0xcacc('0x30')][_0xcacc('0x1c')]);}_0x2e5f86[_0xcacc('0x37')]=qs[_0xcacc('0x38')](_0x32bdc6['query'][_0xcacc('0x38')]);_0x2e5f86[_0xcacc('0x39')]=qs[_0xcacc('0x31')](_['pick'](_0x32bdc6[_0xcacc('0x30')],_0x1784b4[_0xcacc('0x31')]),_0x14335b);if(_0x32bdc6['query'][_0xcacc('0x3a')]){_0x2e5f86[_0xcacc('0x39')]=_[_0xcacc('0x3b')](_0x2e5f86[_0xcacc('0x39')],{'$or':_[_0xcacc('0x2f')](_0x14335b,function(_0x2129c9){if(_0x2129c9[_0xcacc('0x3c')]!==_0xcacc('0x3d')){var _0x4486cc={};_0x4486cc[_0x2129c9[_0xcacc('0x2a')]]={'$like':'%'+_0x32bdc6[_0xcacc('0x30')]['filter']+'%'};return _0x4486cc;}})});}_0x2e5f86=_[_0xcacc('0x3b')]({},_0x2e5f86,_0x32bdc6[_0xcacc('0x3e')]);var _0x1dc8f4={'where':_0x2e5f86[_0xcacc('0x39')]};return db[_0xcacc('0x2b')][_0xcacc('0x1e')](_0x1dc8f4)[_0xcacc('0x23')](function(_0x103226){_0x364bae['count']=_0x103226;if(_0x32bdc6[_0xcacc('0x30')][_0xcacc('0x3f')]){_0x2e5f86['include']=[{'all':!![]}];}return db[_0xcacc('0x2b')][_0xcacc('0x40')](_0x2e5f86);})[_0xcacc('0x23')](function(_0x406d99){_0x364bae[_0xcacc('0x41')]=_0x406d99;return _0x364bae;})[_0xcacc('0x23')](respondWithFilteredResult(_0x1177c3,_0x2e5f86))[_0xcacc('0x42')](handleError(_0x1177c3,null));};exports[_0xcacc('0x43')]=function(_0xf4b4de,_0x1e4d82){var _0x54e63a={'raw':!![],'where':{'id':_0xf4b4de[_0xcacc('0x44')]['id']}},_0x4e7e2e={};_0x4e7e2e[_0xcacc('0x2e')]=_[_0xcacc('0x45')](db[_0xcacc('0x2b')]['rawAttributes']);_0x4e7e2e[_0xcacc('0x30')]=_[_0xcacc('0x45')](_0xf4b4de[_0xcacc('0x30')]);_0x4e7e2e[_0xcacc('0x31')]=_[_0xcacc('0x32')](_0x4e7e2e[_0xcacc('0x2e')],_0x4e7e2e[_0xcacc('0x30')]);_0x54e63a[_0xcacc('0x33')]=_[_0xcacc('0x32')](_0x4e7e2e[_0xcacc('0x2e')],qs[_0xcacc('0x34')](_0xf4b4de[_0xcacc('0x30')][_0xcacc('0x34')]));_0x54e63a['attributes']=_0x54e63a[_0xcacc('0x33')][_0xcacc('0x46')]?_0x54e63a[_0xcacc('0x33')]:_0x4e7e2e['model'];if(_0xf4b4de['query']['includeAll']){_0x54e63a[_0xcacc('0x47')]=[{'all':!![]}];}_0x54e63a=_[_0xcacc('0x3b')]({},_0x54e63a,_0xf4b4de[_0xcacc('0x3e')]);return db[_0xcacc('0x2b')][_0xcacc('0x48')](_0x54e63a)[_0xcacc('0x23')](handleEntityNotFound(_0x1e4d82,null))['then'](respondWithResult(_0x1e4d82,null))[_0xcacc('0x42')](handleError(_0x1e4d82,null));};exports[_0xcacc('0x49')]=function(_0x56e194,_0x280008){return db[_0xcacc('0x2b')]['create'](_0x56e194[_0xcacc('0x4a')],{})['then'](function(_0x2d0ce5){var _0x12d652=_0x56e194[_0xcacc('0x4b')][_0xcacc('0x25')]({'plain':!![]});if(!_0x12d652)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12d652[_0xcacc('0x4c')]===_0xcacc('0x4b')){var _0x454a02=_0x2d0ce5['get']({'plain':!![]});var _0xa6691e=_0xcacc('0x26');return db[_0xcacc('0x4d')][_0xcacc('0x48')]({'where':{'name':_0xa6691e,'userProfileId':_0x12d652[_0xcacc('0x4e')]},'raw':!![]})['then'](function(_0x2a56b0){if(_0x2a56b0&&_0x2a56b0[_0xcacc('0x4f')]===0x0){return db[_0xcacc('0x27')][_0xcacc('0x49')]({'name':_0x454a02['name'],'resourceId':_0x454a02['id'],'type':_0x2a56b0['name'],'sectionId':_0x2a56b0['id']},{})[_0xcacc('0x23')](function(){return _0x2d0ce5;});}else{return _0x2d0ce5;}})['catch'](function(_0x502a05){logger[_0xcacc('0x28')](_0xcacc('0x50'),_0x502a05);throw _0x502a05;});}return _0x2d0ce5;})[_0xcacc('0x23')](respondWithResult(_0x280008,0xc9))[_0xcacc('0x42')](handleError(_0x280008,null));};exports[_0xcacc('0x51')]=function(_0x34b922,_0x3bf7db){if(_0x34b922[_0xcacc('0x4a')]['id']){delete _0x34b922[_0xcacc('0x4a')]['id'];}return db[_0xcacc('0x2b')]['find']({'where':{'id':_0x34b922[_0xcacc('0x44')]['id']}})[_0xcacc('0x23')](handleEntityNotFound(_0x3bf7db,null))['then'](saveUpdates(_0x34b922['body'],null))[_0xcacc('0x23')](respondWithResult(_0x3bf7db,null))[_0xcacc('0x42')](handleError(_0x3bf7db,null));};exports[_0xcacc('0x24')]=function(_0x59be01,_0x4a11f5){return db['Pause'][_0xcacc('0x48')]({'where':{'id':_0x59be01['params']['id']}})['then'](handleEntityNotFound(_0x4a11f5,null))[_0xcacc('0x23')](removeEntity(_0x4a11f5,null))[_0xcacc('0x42')](handleError(_0x4a11f5,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index afdb138..b805f8f 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(_0x5e0cd3,_0x1b6a29){var _0x56781a=function(_0x16907f){while(--_0x16907f){_0x5e0cd3['push'](_0x5e0cd3['shift']());}};_0x56781a(++_0x1b6a29);}(_0xe14b,0x93));var _0xbe14=function(_0x4bb9f5,_0x188dca){_0x4bb9f5=_0x4bb9f5-0x0;var _0x5422ef=_0xe14b[_0x4bb9f5];return _0x5422ef;};'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 _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b7f4d98..292ce3b 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x545a83,_0x1c2f0b){var _0x1668a9=function(_0x3b0c22){while(--_0x3b0c22){_0x545a83['push'](_0x545a83['shift']());}};_0x1668a9(++_0x1c2f0b);}(_0xb10b,0x12a));var _0xbb10=function(_0x54b677,_0x21ee34){_0x54b677=_0x54b677-0x0;var _0x27eb0e=_0xb10b[_0x54b677];return _0x27eb0e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x232d34,_0x13a4c1){var _0x2d5175=function(_0x45d559){while(--_0x45d559){_0x232d34['push'](_0x232d34['shift']());}};_0x2d5175(++_0x13a4c1);}(_0xb10b,0x12a));var _0xbb10=function(_0x14d4d5,_0x3c298e){_0x14d4d5=_0x14d4d5-0x0;var _0x516cf5=_0xb10b[_0x14d4d5];return _0x516cf5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bf5bfb7..bbb3b7c 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 _0xaba6=['get','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','put','/:id','delete','multer','util','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x4e5a48,_0x17e904){var _0x31baef=function(_0x24cff6){while(--_0x24cff6){_0x4e5a48['push'](_0x4e5a48['shift']());}};_0x31baef(++_0x17e904);}(_0xaba6,0xe2));var _0x6aba=function(_0x498381,_0x122bfc){_0x498381=_0x498381-0x0;var _0x7e0ae8=_0xaba6[_0x498381];return _0x7e0ae8;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/webhook',controller[_0x6aba('0x7')]);router[_0x6aba('0x6')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);var upload=multer({'storage':multer[_0x6aba('0xc')]({'destination':function(_0xdbc119,_0x4089c6,_0x181426){_0x181426(null,path['join'](config[_0x6aba('0xd')],_0x6aba('0xe')));},'filename':function(_0x43867b,_0x254007,_0x53e604){_0x254007[_0x6aba('0xf')]=_0x254007[_0x6aba('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53e604(null,util[_0x6aba('0x10')](_0x6aba('0x11'),path[_0x6aba('0x12')](_0x254007['originalname'],path[_0x6aba('0x13')](_0x254007[_0x6aba('0xf')])),Date[_0x6aba('0x14')](),path['extname'](_0x254007[_0x6aba('0xf')])));}})});router[_0x6aba('0x15')]('/',upload[_0x6aba('0x16')](_0x6aba('0x17')),controller[_0x6aba('0x18')]);router[_0x6aba('0x15')](_0x6aba('0x19'),controller['webhookPost']);router[_0x6aba('0x1a')](_0x6aba('0x1b'),auth[_0x6aba('0x8')](),controller['update']);router[_0x6aba('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','webhookPost'];(function(_0x27c28c,_0x49ba23){var _0x1f5669=function(_0x257683){while(--_0x257683){_0x27c28c['push'](_0x27c28c['shift']());}};_0x1f5669(++_0x49ba23);}(_0x34e8,0x12c));var _0x834e=function(_0x14f5c9,_0x106631){_0x14f5c9=_0x14f5c9-0x0;var _0x2bb3c9=_0x34e8[_0x14f5c9];return _0x2bb3c9;};'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'),controller[_0x834e('0xd')]);router[_0x834e('0xa')](_0x834e('0xe'),auth[_0x834e('0xf')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xf')](),controller[_0x834e('0x12')]);var upload=multer({'storage':multer[_0x834e('0x13')]({'destination':function(_0x36e124,_0x14038b,_0x2e1a37){_0x2e1a37(null,path[_0x834e('0x14')](config[_0x834e('0x15')],_0x834e('0x16')));},'filename':function(_0x538bb3,_0x5e5b6d,_0x6cd9b9){_0x5e5b6d['originalname']=_0x5e5b6d[_0x834e('0x17')][_0x834e('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6cd9b9(null,util[_0x834e('0x19')](_0x834e('0x1a'),path['basename'](_0x5e5b6d[_0x834e('0x17')],path[_0x834e('0x1b')](_0x5e5b6d['originalname'])),Date[_0x834e('0x1c')](),path['extname'](_0x5e5b6d[_0x834e('0x17')])));}})});router[_0x834e('0x1d')]('/',upload['single'](_0x834e('0x1e')),controller[_0x834e('0x1f')]);router[_0x834e('0x1d')]('/webhook',controller[_0x834e('0x20')]);router[_0x834e('0x21')](_0x834e('0xe'),auth[_0x834e('0xf')](),controller[_0x834e('0x22')]);router[_0x834e('0x23')](_0x834e('0xe'),auth['isAuthenticated'](),controller[_0x834e('0x23')]);module[_0x834e('0x24')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 45ae644..9312ef6 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 _0x10ab=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','agentOnly','always','never'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0x10ab,0x17a));var _0xb10a=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x10ab[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0xb10a('0x0'));module[_0xb10a('0x1')]={'name':{'type':Sequelize[_0xb10a('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb10a('0x3'),_0xb10a('0x4'))},'description':{'type':Sequelize[_0xb10a('0x5')]},'version':{'type':Sequelize[_0xb10a('0x5')]},'path':{'type':Sequelize[_0xb10a('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xb10a('0x6')],'defaultValue':0x0,'comment':_0xb10a('0x7')},'sidebar':{'type':Sequelize[_0xb10a('0x8')]('adminOnly',_0xb10a('0x9'),_0xb10a('0xa'),_0xb10a('0xb')),'defaultValue':_0xb10a('0xa'),'comment':_0xb10a('0xc')},'icon':{'type':Sequelize[_0xb10a('0x2')]},'adminUrl':{'type':Sequelize[_0xb10a('0x2')]},'agentUrl':{'type':Sequelize[_0xb10a('0x2')]},'scriptName':{'type':Sequelize[_0xb10a('0x2')]},'scriptPath':{'type':Sequelize[_0xb10a('0x2')]}}; \ No newline at end of file +var _0x01fc=['html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x01fc,0xc8));var _0xc01f=function(_0x47ea10,_0x45fb37){_0x47ea10=_0x47ea10-0x0;var _0x276564=_0x01fc[_0x47ea10];return _0x276564;};'use strict';var Sequelize=require(_0xc01f('0x0'));module[_0xc01f('0x1')]={'name':{'type':Sequelize[_0xc01f('0x2')]},'type':{'type':Sequelize[_0xc01f('0x3')](_0xc01f('0x4'),_0xc01f('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc01f('0x6')]},'path':{'type':Sequelize[_0xc01f('0x2')],'comment':_0xc01f('0x7')},'active':{'type':Sequelize[_0xc01f('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xc01f('0x9'),'agentOnly',_0xc01f('0xa'),'never'),'defaultValue':_0xc01f('0xa'),'comment':_0xc01f('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc01f('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xc01f('0x2')]},'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 15d8129..cf7275e 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 _0x5ede=['Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','agent','script','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','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/logger','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./plugin.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','Plugin','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','join','root','server/files/plugins','%s.zip','basename','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','lstatSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse'];(function(_0xa4b885,_0x1e725a){var _0x2be448=function(_0x57cacb){while(--_0x57cacb){_0xa4b885['push'](_0xa4b885['shift']());}};_0x2be448(++_0x1e725a);}(_0x5ede,0x182));var _0xe5ed=function(_0x394639,_0x15dd53){_0x394639=_0x394639-0x0;var _0xb74a2f=_0x5ede[_0x394639];return _0xb74a2f;};'use strict';var emlformat=require(_0xe5ed('0x0'));var rimraf=require(_0xe5ed('0x1'));var zipdir=require(_0xe5ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5ed('0x3'));var moment=require(_0xe5ed('0x4'));var BPromise=require(_0xe5ed('0x5'));var Mustache=require(_0xe5ed('0x6'));var util=require('util');var path=require(_0xe5ed('0x7'));var sox=require(_0xe5ed('0x8'));var csv=require(_0xe5ed('0x9'));var ejs=require(_0xe5ed('0xa'));var fs=require('fs');var fs_extra=require(_0xe5ed('0xb'));var _=require(_0xe5ed('0xc'));var squel=require(_0xe5ed('0xd'));var crypto=require(_0xe5ed('0xe'));var jsforce=require(_0xe5ed('0xf'));var deskjs=require(_0xe5ed('0x10'));var toCsv=require(_0xe5ed('0x9'));var querystring=require(_0xe5ed('0x11'));var Papa=require(_0xe5ed('0x12'));var extract=require(_0xe5ed('0x13'));var rimraf=require('rimraf');var archiver=require(_0xe5ed('0x14'));var Redis=require(_0xe5ed('0x15'));var authService=require(_0xe5ed('0x16'));var qs=require(_0xe5ed('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5ed('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe5ed('0x19'));var db=require(_0xe5ed('0x1a'))['db'];config['redis']=_[_0xe5ed('0x1b')](config[_0xe5ed('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5ed('0x1d'))(new Redis(config['redis']));require(_0xe5ed('0x1e'))['register'](socket);function respondWithStatusCode(_0x56625b,_0x535382){_0x535382=_0x535382||0xcc;return function(_0x59e330){if(_0x59e330){return _0x56625b['sendStatus'](_0x535382);}return _0x56625b[_0xe5ed('0x1f')](_0x535382)[_0xe5ed('0x20')]();};}function respondWithResult(_0xa2f40d,_0x1285f7){_0x1285f7=_0x1285f7||0xc8;return function(_0x10cdc6){if(_0x10cdc6){return _0xa2f40d[_0xe5ed('0x1f')](_0x1285f7)[_0xe5ed('0x21')](_0x10cdc6);}};}function respondWithFilteredResult(_0x48d77a,_0x55eb43){return function(_0x5379d9){if(_0x5379d9){var _0x53eeaa=typeof _0x55eb43[_0xe5ed('0x22')]===_0xe5ed('0x23')&&typeof _0x55eb43[_0xe5ed('0x24')]===_0xe5ed('0x23');var _0x331e6e=_0x5379d9[_0xe5ed('0x25')];var _0x49532c=_0x53eeaa?0x0:_0x55eb43['offset'];var _0x531d08=_0x53eeaa?_0x5379d9[_0xe5ed('0x25')]:_0x55eb43['offset']+_0x55eb43[_0xe5ed('0x24')];var _0x53de10;if(_0x531d08>=_0x331e6e){_0x531d08=_0x331e6e;_0x53de10=0xc8;}else{_0x53de10=0xce;}_0x48d77a[_0xe5ed('0x1f')](_0x53de10);return _0x48d77a[_0xe5ed('0x26')](_0xe5ed('0x27'),_0x49532c+'-'+_0x531d08+'/'+_0x331e6e)['json'](_0x5379d9);}return null;};}function patchUpdates(_0x3f1013){return function(_0x126973){try{jsonpatch['apply'](_0x126973,_0x3f1013,!![]);}catch(_0x32ba7a){return BPromise[_0xe5ed('0x28')](_0x32ba7a);}return _0x126973['save']();};}function saveUpdates(_0x7d48db,_0x4bf2da){return function(_0x9ae984){if(_0x9ae984){return _0x9ae984[_0xe5ed('0x29')](_0x7d48db)[_0xe5ed('0x2a')](function(_0x3211af){return _0x3211af;});}return null;};}function removeEntity(_0x580213,_0x3d22a2){return function(_0x176cf6){if(_0x176cf6){return _0x176cf6[_0xe5ed('0x2b')]()['then'](function(){var _0x5cc997=_0x176cf6[_0xe5ed('0x2c')]({'plain':!![]});var _0x56f67e=_0xe5ed('0x2d');return db[_0xe5ed('0x2e')][_0xe5ed('0x2b')]({'where':{'type':_0x56f67e,'resourceId':_0x5cc997['id']}})[_0xe5ed('0x2a')](function(){return _0x176cf6;});})[_0xe5ed('0x2a')](function(){_0x580213[_0xe5ed('0x1f')](0xcc)[_0xe5ed('0x20')]();});}};}function handleEntityNotFound(_0x1c654c,_0x5be3ab){return function(_0x5ead00){if(!_0x5ead00){_0x1c654c[_0xe5ed('0x2f')](0x194);}return _0x5ead00;};}function handleError(_0x31b7bf,_0x2fd7f4){_0x2fd7f4=_0x2fd7f4||0x1f4;return function(_0x38f4d4){logger[_0xe5ed('0x30')](_0x38f4d4[_0xe5ed('0x31')]);if(_0x38f4d4[_0xe5ed('0x32')]){delete _0x38f4d4['name'];}_0x31b7bf['status'](_0x2fd7f4)[_0xe5ed('0x33')](_0x38f4d4);};}exports[_0xe5ed('0x34')]=function(_0x1d6583,_0x4d2521){var _0x8e7ecd={},_0x4cb9b4={},_0x239416={'count':0x0,'rows':[]};var _0x590c0a=_[_0xe5ed('0x35')](db[_0xe5ed('0x36')]['rawAttributes'],function(_0x65babb){return{'name':_0x65babb[_0xe5ed('0x37')],'type':_0x65babb[_0xe5ed('0x38')][_0xe5ed('0x39')]};});_0x4cb9b4['model']=_[_0xe5ed('0x35')](_0x590c0a,_0xe5ed('0x32'));_0x4cb9b4[_0xe5ed('0x3a')]=_['keys'](_0x1d6583[_0xe5ed('0x3a')]);_0x4cb9b4[_0xe5ed('0x3b')]=_[_0xe5ed('0x3c')](_0x4cb9b4[_0xe5ed('0x3d')],_0x4cb9b4[_0xe5ed('0x3a')]);_0x8e7ecd[_0xe5ed('0x3e')]=_[_0xe5ed('0x3c')](_0x4cb9b4[_0xe5ed('0x3d')],qs['fields'](_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x3f')]));_0x8e7ecd[_0xe5ed('0x3e')]=_0x8e7ecd[_0xe5ed('0x3e')][_0xe5ed('0x40')]?_0x8e7ecd[_0xe5ed('0x3e')]:_0x4cb9b4[_0xe5ed('0x3d')];if(!_0x1d6583['query'][_0xe5ed('0x41')](_0xe5ed('0x42'))){_0x8e7ecd[_0xe5ed('0x24')]=qs[_0xe5ed('0x24')](_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x24')]);_0x8e7ecd['offset']=qs[_0xe5ed('0x22')](_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x22')]);}_0x8e7ecd[_0xe5ed('0x43')]=qs['sort'](_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x44')]);_0x8e7ecd[_0xe5ed('0x45')]=qs['filters'](_[_0xe5ed('0x46')](_0x1d6583[_0xe5ed('0x3a')],_0x4cb9b4[_0xe5ed('0x3b')]),_0x590c0a);if(_0x1d6583[_0xe5ed('0x3a')]['filter']){_0x8e7ecd[_0xe5ed('0x45')]=_[_0xe5ed('0x47')](_0x8e7ecd[_0xe5ed('0x45')],{'$or':_[_0xe5ed('0x35')](_0x590c0a,function(_0xd6e1b0){if(_0xd6e1b0[_0xe5ed('0x38')]!==_0xe5ed('0x48')){var _0xdb6803={};_0xdb6803[_0xd6e1b0[_0xe5ed('0x32')]]={'$like':'%'+_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x49')]+'%'};return _0xdb6803;}})});}_0x8e7ecd=_[_0xe5ed('0x47')]({},_0x8e7ecd,_0x1d6583[_0xe5ed('0x4a')]);var _0x3e65a9={'where':_0x8e7ecd[_0xe5ed('0x45')]};return db[_0xe5ed('0x36')][_0xe5ed('0x25')](_0x3e65a9)[_0xe5ed('0x2a')](function(_0x381894){_0x239416[_0xe5ed('0x25')]=_0x381894;if(_0x1d6583[_0xe5ed('0x3a')][_0xe5ed('0x4b')]){_0x8e7ecd[_0xe5ed('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0xe5ed('0x4d')](_0x8e7ecd);})[_0xe5ed('0x2a')](function(_0x460145){_0x239416[_0xe5ed('0x4e')]=_0x460145;return _0x239416;})[_0xe5ed('0x2a')](respondWithFilteredResult(_0x4d2521,_0x8e7ecd))['catch'](handleError(_0x4d2521,null));};exports['show']=function(_0x427d70,_0x288e83){var _0x4013a6={'raw':!![],'where':{'id':_0x427d70[_0xe5ed('0x4f')]['id']}},_0x4856f9={};_0x4856f9[_0xe5ed('0x3d')]=_[_0xe5ed('0x50')](db['Plugin'][_0xe5ed('0x51')]);_0x4856f9[_0xe5ed('0x3a')]=_[_0xe5ed('0x50')](_0x427d70[_0xe5ed('0x3a')]);_0x4856f9[_0xe5ed('0x3b')]=_[_0xe5ed('0x3c')](_0x4856f9[_0xe5ed('0x3d')],_0x4856f9[_0xe5ed('0x3a')]);_0x4013a6['attributes']=_['intersection'](_0x4856f9['model'],qs[_0xe5ed('0x3f')](_0x427d70['query'][_0xe5ed('0x3f')]));_0x4013a6[_0xe5ed('0x3e')]=_0x4013a6[_0xe5ed('0x3e')][_0xe5ed('0x40')]?_0x4013a6[_0xe5ed('0x3e')]:_0x4856f9['model'];if(_0x427d70[_0xe5ed('0x3a')]['includeAll']){_0x4013a6[_0xe5ed('0x4c')]=[{'all':!![]}];}_0x4013a6=_['merge']({},_0x4013a6,_0x427d70[_0xe5ed('0x4a')]);return db[_0xe5ed('0x36')][_0xe5ed('0x52')](_0x4013a6)[_0xe5ed('0x2a')](handleEntityNotFound(_0x288e83,null))[_0xe5ed('0x2a')](respondWithResult(_0x288e83,null))[_0xe5ed('0x53')](handleError(_0x288e83,null));};exports['download']=function(_0x1747dc,_0x2a75db,_0x12c445){return db[_0xe5ed('0x36')][_0xe5ed('0x52')]({'where':{'id':_0x1747dc[_0xe5ed('0x4f')]['id']},'attributes':[_0xe5ed('0x32'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x2a75db,null))[_0xe5ed('0x2a')](function(_0x164afc){if(_0x164afc){var _0x4301f9=path[_0xe5ed('0x54')](config[_0xe5ed('0x55')],_0xe5ed('0x56'),util['format'](_0xe5ed('0x57'),path[_0xe5ed('0x58')](_0x164afc[_0xe5ed('0x7')])));var _0x1acff7=fs['createWriteStream'](_0x4301f9);var _0x34c744=archiver(_0xe5ed('0x59'),{'zlib':{'level':0x9}});_0x34c744['on']('warning',function(_0x3ea9b3){if(_0x3ea9b3[_0xe5ed('0x5a')]===_0xe5ed('0x5b')){logger[_0xe5ed('0x30')](_0x3ea9b3);}else{throw new db[(_0xe5ed('0x5c'))][(_0xe5ed('0x5d'))](_0xe5ed('0x5e'));}});_0x34c744['on']('error',function(_0x4582ee){throw new db[(_0xe5ed('0x5c'))][(_0xe5ed('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x34c744[_0xe5ed('0x5f')](_0x1acff7);_0x34c744['glob'](_0xe5ed('0x60'),{'cwd':path[_0xe5ed('0x54')](config[_0xe5ed('0x55')],'server/files/plugins',path[_0xe5ed('0x61')](_0x164afc[_0xe5ed('0x7')])),'ignore':[path[_0xe5ed('0x54')](path[_0xe5ed('0x58')](_0x164afc[_0xe5ed('0x7')]),'node_modules/**/*'),path['join'](path['basename'](_0x164afc[_0xe5ed('0x7')]),_0xe5ed('0x62'))],'nodir':!![]})[_0xe5ed('0x63')]();_0x1acff7['on'](_0xe5ed('0x64'),function(){if(!fs[_0xe5ed('0x65')](_0x4301f9)){throw new db[(_0xe5ed('0x5c'))][(_0xe5ed('0x5d'))](_0xe5ed('0x66'));}return _0x2a75db[_0xe5ed('0x67')](_0x4301f9,util[_0xe5ed('0x68')](_0xe5ed('0x57'),path[_0xe5ed('0x58')](_0x164afc[_0xe5ed('0x7')])),function(_0x28c7fe){if(_0x28c7fe){throw new db[(_0xe5ed('0x5c'))]['Error'](_0xe5ed('0x69'));}fs['unlinkSync'](_0x4301f9);logger[_0xe5ed('0x6a')](_0xe5ed('0x6b'));logger[_0xe5ed('0x6a')](_0xe5ed('0x6c'));});});}return null;})['catch'](handleError(_0x2a75db,null));};exports['upload']=function(_0x2459e4,_0x1e3f8a,_0x32be1b){var _0x282934=path[_0xe5ed('0x58')](_0x2459e4[_0xe5ed('0x6d')][_0xe5ed('0x6e')],path[_0xe5ed('0x6f')](_0x2459e4[_0xe5ed('0x6d')][_0xe5ed('0x6e')]));var _0x340fa8=path[_0xe5ed('0x54')](config['root'],_0xe5ed('0x56'),_0x2459e4['file'][_0xe5ed('0x6e')]);var _0x26b67e=path[_0xe5ed('0x54')](config[_0xe5ed('0x55')],'server/files/plugins',_0x282934);logger[_0xe5ed('0x6a')](_0xe5ed('0x70'),_0x340fa8);logger[_0xe5ed('0x6a')](_0xe5ed('0x71'),_0x26b67e);try{fs['chmodSync'](_0x340fa8,parseInt(_0xe5ed('0x72'),0x8));extract(_0x340fa8,{'dir':_0x26b67e},function(_0x3cc96a){if(_0x3cc96a){logger[_0xe5ed('0x30')](_0x3cc96a);handleError(_0x3cc96a,!![]);};var _0x408157=fs[_0xe5ed('0x73')](_0x26b67e);if(_0x408157['length']>0x1){removeReferences(_0x340fa8,_0x26b67e);logger['error']('Invalid\x20plugin\x20structure');return _0x32be1b(new Error('Invalid\x20plugin\x20structure'));}var _0x2655a6=fs[_0xe5ed('0x74')](path[_0xe5ed('0x54')](_0x26b67e,_0x408157[0x0]));if(_0x2655a6['isFile']()){removeReferences(_0x340fa8,_0x26b67e);logger[_0xe5ed('0x30')](_0xe5ed('0x75'));return _0x32be1b(new Error(_0xe5ed('0x75')));}if(_0x2655a6[_0xe5ed('0x76')]()){var _0x1ea3c5=fs[_0xe5ed('0x73')](path[_0xe5ed('0x54')](_0x26b67e,_0x408157[0x0]));if(_0x1ea3c5['length']===0x0){removeReferences(_0x340fa8,_0x26b67e);logger[_0xe5ed('0x30')](_0xe5ed('0x75'));return _0x32be1b(new Error(_0xe5ed('0x75')));}var _0x446bf8=_0x1ea3c5[_0xe5ed('0x77')](function(_0x239f62){return _0x239f62===_0xe5ed('0x78');});if(!_0x446bf8){return _0x32be1b(new Error(_0xe5ed('0x79')));}var _0x632a18=fs[_0xe5ed('0x7a')](path[_0xe5ed('0x54')](_0x26b67e,_0x408157[0x0],_0xe5ed('0x78')));var _0x357f83=JSON[_0xe5ed('0x7b')](_0x632a18);if(_0xe5ed('0x23')==typeof _0x357f83[_0xe5ed('0x32')]){return _0x32be1b(new Error(_0xe5ed('0x7c')));}if(_0xe5ed('0x23')==typeof _0x357f83[_0xe5ed('0x38')]){return _0x32be1b(new Error(_0xe5ed('0x7d')));}if('undefined'==typeof _0x357f83[_0xe5ed('0x7e')]){return _0x32be1b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x357f83[_0xe5ed('0x7f')]){return _0x32be1b(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x357f83[_0xe5ed('0x38')]===_0xe5ed('0x80')){if('undefined'==typeof _0x357f83[_0xe5ed('0x7f')][_0xe5ed('0x81')]){return _0x32be1b(new Error(_0xe5ed('0x82')));}if('undefined'==typeof _0x357f83[_0xe5ed('0x7f')][_0xe5ed('0x81')]['admin']&&_0xe5ed('0x23')==typeof _0x357f83[_0xe5ed('0x7f')]['views'][_0xe5ed('0x83')]){return _0x32be1b(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x357f83[_0xe5ed('0x38')]===_0xe5ed('0x84')){if('undefined'==typeof _0x357f83[_0xe5ed('0x7f')]['scriptName']){return _0x32be1b(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xe5ed('0x23')==typeof _0x357f83[_0xe5ed('0x7f')][_0xe5ed('0x85')]){return _0x32be1b(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x32be1b(new Error(_0xe5ed('0x86')));}var _0x3f2a89=_0x357f83[_0xe5ed('0x32')];var _0x72748e=_0x357f83[_0xe5ed('0x87')];var _0x11ed12=_0x357f83[_0xe5ed('0x38')];var _0x4aa78f=_0x357f83[_0xe5ed('0x88')]?_0x357f83['sidebar']:_0xe5ed('0x89');var _0x7b08cf=_0x357f83['icon']?_0x357f83[_0xe5ed('0x8a')]:'icon-apps';var _0x16bf64='';var _0x1bd51f='';var _0x4ab6d4='';var _0x2e033f='';var _0x2ec95c=_0x357f83[_0xe5ed('0x7e')];if(_0x11ed12==='html'){if(_0xe5ed('0x23')!=typeof _0x357f83['parameters'][_0xe5ed('0x81')][_0xe5ed('0x8b')]){var _0x47477e=_0x357f83[_0xe5ed('0x7f')][_0xe5ed('0x81')][_0xe5ed('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xe5ed('0x8c')](_0x47477e)){_0x16bf64=path[_0xe5ed('0x54')](_0xe5ed('0x8d'),_0x282934,_0x408157[0x0],_0x47477e);}else{_0x16bf64=_0x47477e;}}else{logger['info'](_0xe5ed('0x8e'));}if(_0xe5ed('0x23')!=typeof _0x357f83[_0xe5ed('0x7f')][_0xe5ed('0x81')]['agent']){var _0x9bbf49=_0x357f83[_0xe5ed('0x7f')]['views'][_0xe5ed('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x9bbf49)){_0x1bd51f=path[_0xe5ed('0x54')](_0xe5ed('0x8d'),_0x282934,_0x408157[0x0],_0x9bbf49);}else{_0x1bd51f=_0x9bbf49;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x11ed12===_0xe5ed('0x84')){_0x4ab6d4=_0x357f83[_0xe5ed('0x7f')]['scriptName'];_0x2e033f=_0x357f83[_0xe5ed('0x7f')]['scriptPath'];if(_0xe5ed('0x23')!=typeof _0x357f83['parameters'][_0xe5ed('0x81')]){if(_0xe5ed('0x23')!=typeof _0x357f83['parameters'][_0xe5ed('0x81')]['admin']){var _0x47477e=_0x357f83['parameters']['views'][_0xe5ed('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x47477e)){_0x16bf64=path['join'](_0xe5ed('0x8d'),_0x282934,_0x408157[0x0],_0x47477e);}else{_0x16bf64=_0x47477e;}}if(_0xe5ed('0x23')!=typeof _0x357f83[_0xe5ed('0x7f')]['views'][_0xe5ed('0x83')]){var _0x9bbf49=_0x357f83[_0xe5ed('0x7f')]['views'][_0xe5ed('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x9bbf49)){_0x1bd51f=path[_0xe5ed('0x54')](_0xe5ed('0x8d'),_0x282934,_0x408157[0x0],_0x9bbf49);}else{_0x1bd51f=_0x9bbf49;}}}}var _0x325b7f={'name':_0x3f2a89,'description':_0x72748e,'path':path[_0xe5ed('0x54')](_0x282934,_0x408157[0x0]),'type':_0x11ed12,'sidebar':_0x4aa78f,'icon':_0x7b08cf,'adminUrl':_0x16bf64,'agentUrl':_0x1bd51f,'scriptName':_0x4ab6d4,'scriptPath':_0x2e033f,'version':_0x2ec95c};removeReferences(_0x340fa8,null);return db['Plugin']['create'](_0x325b7f)[_0xe5ed('0x2a')](function(_0x17a4f7){var _0x3646cf={'role':_0x2459e4[_0xe5ed('0x8f')][_0xe5ed('0x90')],'userProfileId':_0x2459e4[_0xe5ed('0x8f')][_0xe5ed('0x91')]};if(!_0x3646cf)throw new Error(_0xe5ed('0x92'));if(_0x3646cf[_0xe5ed('0x90')]===_0xe5ed('0x93')){var _0x26cda7=_0x17a4f7['get']({'plain':!![]});return db['UserProfileSection'][_0xe5ed('0x52')]({'where':{'name':'Plugins','userProfileId':_0x3646cf[_0xe5ed('0x91')]},'raw':!![]})[_0xe5ed('0x2a')](function(_0x2c06e6){if(_0x2c06e6&&_0x2c06e6[_0xe5ed('0x94')]===0x0){return db['UserProfileResource'][_0xe5ed('0x95')]({'name':_0x26cda7[_0xe5ed('0x32')],'resourceId':_0x26cda7['id'],'type':_0x2c06e6[_0xe5ed('0x32')],'sectionId':_0x2c06e6['id']},{})[_0xe5ed('0x2a')](function(){return _0x17a4f7;});}else{return _0x17a4f7;}})[_0xe5ed('0x53')](function(_0x134c74){logger['error'](_0xe5ed('0x96'),_0x134c74);throw _0x134c74;});}return _0x17a4f7;})[_0xe5ed('0x2a')](respondWithResult(_0x1e3f8a,null))[_0xe5ed('0x53')](handleError(_0x1e3f8a,null));}});}catch(_0x5ed80e){_0x1e3f8a['status'](0x1f4)[_0xe5ed('0x33')](_0x5ed80e);}};function removeReferences(_0x9d2bb8,_0x398be5){try{if(_0x9d2bb8){fs[_0xe5ed('0x97')](_0x9d2bb8);logger[_0xe5ed('0x6a')](_0xe5ed('0x98'));}if(_0x398be5){rimraf(_0x398be5,function(){});logger['info'](_0xe5ed('0x99'));}}catch(_0x5f004f){logger[_0xe5ed('0x30')](_0x5f004f);}}exports[_0xe5ed('0x29')]=function(_0x2f2547,_0x325d62,_0x3cac86){return db['Plugin']['find']({'where':{'id':_0x2f2547[_0xe5ed('0x4f')]['id']}})[_0xe5ed('0x2a')](handleEntityNotFound(_0x325d62,null))['then'](saveUpdates(_0x2f2547[_0xe5ed('0x8f')],null))[_0xe5ed('0x2a')](respondWithResult(_0x325d62,null))['catch'](handleError(_0x325d62,null));};exports[_0xe5ed('0x9a')]=function(_0x3bc5e1,_0x4f2c75,_0x15865c){return db[_0xe5ed('0x36')][_0xe5ed('0x52')]({'where':{'id':_0x3bc5e1[_0xe5ed('0x4f')]['id']}})[_0xe5ed('0x2a')](function(_0x1bc4cb){if(_0x1bc4cb){return _0x1bc4cb[_0xe5ed('0x2b')]();}})['then'](function(_0x440067){rimraf(path[_0xe5ed('0x54')](config[_0xe5ed('0x55')],'server/files/plugins',path[_0xe5ed('0x61')](_0x440067[_0xe5ed('0x7')])),function(){});return _0x440067;})[_0xe5ed('0x2a')](handleEntityNotFound(_0x4f2c75,null))[_0xe5ed('0x2a')](respondWithStatusCode(_0x4f2c75,null))[_0xe5ed('0x53')](handleError(_0x4f2c75,null));};exports[_0xe5ed('0x9b')]=function(_0x6ecc67,_0x1c7aef,_0xc0fc50){return BPromise[_0xe5ed('0x9c')]()[_0xe5ed('0x2a')](function(){if(!_0x6ecc67[_0xe5ed('0x3a')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0x9d')]){throw new Error(_0xe5ed('0x9e'));}var _0x50a41b=_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0x9f')]?_0x6ecc67[_0xe5ed('0x3a')]['hostname']+':'+_0x6ecc67[_0xe5ed('0x3a')]['port']:_0xe5ed('0xa0')+_0x6ecc67[_0xe5ed('0x3a')]['port'];var _0x268406=_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0x21')]?_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0x21')]:!![];var _0xc1aa67=_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0xa1')]?_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0xa1')]:null;var _0x46e7f4={'method':_0x6ecc67[_0xe5ed('0xa2')],'uri':util[_0xe5ed('0x68')](_0xe5ed('0xa3'),_0x50a41b,_0x6ecc67['query'][_0xe5ed('0x7')]),'json':_0x268406,'resolveWithFullResponse':!![],'encoding':_0xc1aa67,'qs':_0x6ecc67[_0xe5ed('0x3a')]};if(_0x6ecc67['headers']){_0x46e7f4[_0xe5ed('0xa4')]=_0x6ecc67['headers'];if(_0x46e7f4['headers'][_0xe5ed('0xa5')]){delete _0x46e7f4[_0xe5ed('0xa4')][_0xe5ed('0xa5')];}}if(_0x46e7f4[_0xe5ed('0xa4')][_0xe5ed('0xa6')]){delete _0x46e7f4['headers']['content-type'];}return rp(_0x46e7f4);})[_0xe5ed('0x2a')](function(_0x54e0d7){if(_0x54e0d7){_0x1c7aef[_0xe5ed('0x26')](_0x54e0d7['headers']);logger['info'](_0x54e0d7[_0xe5ed('0x8f')]);if(_['endsWith'](_0x6ecc67[_0xe5ed('0x3a')][_0xe5ed('0x7')],_0xe5ed('0x67'))&&_0x54e0d7[_0xe5ed('0xa7')]==0x1f4){return _0x1c7aef['sendStatus'](_0x54e0d7[_0xe5ed('0xa7')]);}else{return _0x1c7aef[_0xe5ed('0x1f')](_0x54e0d7[_0xe5ed('0xa7')])[_0xe5ed('0x33')](_0x54e0d7[_0xe5ed('0x8f')]);}}else{return _0x1c7aef[_0xe5ed('0x2f')](0xc8);}})['catch'](handleError(_0x1c7aef,null));};exports[_0xe5ed('0xa8')]=function(_0x240a3d,_0x55fc96,_0x31d02a){return BPromise[_0xe5ed('0x9c')]()['then'](function(){if(!_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x7')]){throw new Error(_0xe5ed('0xa9'));}if(!_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x407d33=_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x9f')]?_0x240a3d['query'][_0xe5ed('0x9f')]+':'+_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x9d')]:_0xe5ed('0xa0')+_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x9d')];var _0x5064a0=_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x21')]?_0x240a3d[_0xe5ed('0x3a')]['json']:!![];var _0x5c249b=_0x240a3d[_0xe5ed('0x3a')]['encoding']?_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0xa1')]:null;var _0x2f793a={'method':_0x240a3d['method'],'uri':util['format'](_0xe5ed('0xa3'),_0x407d33,_0x240a3d[_0xe5ed('0x3a')][_0xe5ed('0x7')]),'json':_0x5064a0,'resolveWithFullResponse':!![],'encoding':_0x5c249b,'body':_0x240a3d[_0xe5ed('0x8f')]};if(_0x240a3d[_0xe5ed('0xa4')]){_0x2f793a[_0xe5ed('0xa4')]=_0x240a3d[_0xe5ed('0xa4')];if(_0x2f793a['headers'][_0xe5ed('0xa5')]){delete _0x2f793a[_0xe5ed('0xa4')]['content-length'];}}if(_0x2f793a[_0xe5ed('0xa4')][_0xe5ed('0xa6')]){delete _0x2f793a[_0xe5ed('0xa4')][_0xe5ed('0xa6')];}return rp(_0x2f793a);})[_0xe5ed('0x2a')](function(_0x38b04d){if(_0x38b04d){_0x55fc96['set'](_0x38b04d[_0xe5ed('0xa4')]);logger[_0xe5ed('0x6a')](_0x38b04d[_0xe5ed('0x8f')]);return _0x55fc96[_0xe5ed('0x1f')](_0x38b04d['statusCode'])['send'](_0x38b04d[_0xe5ed('0x8f')]);}else{return _0x55fc96[_0xe5ed('0x2f')](0xc8);}})['catch'](handleError(_0x55fc96,null));}; \ No newline at end of file +var _0x9b69=['encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','end','status','json','offset','undefined','limit','count','set','reject','update','get','Plugins','destroy','then','sendStatus','error','stack','name','index','Plugin','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','options','include','findAll','rows','catch','params','includeAll','download','find','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','dirname','node_modules/**/*','finalize','close','existsSync','format','Error','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','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','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','description','sidebar','always','icon','icon-apps','test','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:'];(function(_0x13eb0b,_0x5c5553){var _0x11d061=function(_0x3cf0e3){while(--_0x3cf0e3){_0x13eb0b['push'](_0x13eb0b['shift']());}};_0x11d061(++_0x5c5553);}(_0x9b69,0xb1));var _0x99b6=function(_0x384989,_0x77bcf9){_0x384989=_0x384989-0x0;var _0x352cb6=_0x9b69[_0x384989];return _0x352cb6;};'use strict';var emlformat=require(_0x99b6('0x0'));var rimraf=require(_0x99b6('0x1'));var zipdir=require(_0x99b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99b6('0x3'));var BPromise=require(_0x99b6('0x4'));var Mustache=require(_0x99b6('0x5'));var util=require(_0x99b6('0x6'));var path=require(_0x99b6('0x7'));var sox=require('sox');var csv=require(_0x99b6('0x8'));var ejs=require(_0x99b6('0x9'));var fs=require('fs');var fs_extra=require(_0x99b6('0xa'));var _=require(_0x99b6('0xb'));var squel=require(_0x99b6('0xc'));var crypto=require(_0x99b6('0xd'));var jsforce=require(_0x99b6('0xe'));var deskjs=require(_0x99b6('0xf'));var toCsv=require(_0x99b6('0x8'));var querystring=require(_0x99b6('0x10'));var Papa=require(_0x99b6('0x11'));var extract=require(_0x99b6('0x12'));var rimraf=require(_0x99b6('0x1'));var archiver=require(_0x99b6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99b6('0x14'));var as=require(_0x99b6('0x15'));var hardwareService=require(_0x99b6('0x16'));var logger=require(_0x99b6('0x17'))(_0x99b6('0x18'));var utils=require(_0x99b6('0x19'));var config=require(_0x99b6('0x1a'));var licenseUtil=require(_0x99b6('0x1b'));var db=require(_0x99b6('0x1c'))['db'];config['redis']=_[_0x99b6('0x1d')](config[_0x99b6('0x1e')],{'host':_0x99b6('0x1f'),'port':0x18eb});var socket=require(_0x99b6('0x20'))(new Redis(config[_0x99b6('0x1e')]));require(_0x99b6('0x21'))[_0x99b6('0x22')](socket);function respondWithStatusCode(_0x22bb8a,_0x1007be){_0x1007be=_0x1007be||0xcc;return function(_0x34f4e6){if(_0x34f4e6){return _0x22bb8a['sendStatus'](_0x1007be);}return _0x22bb8a['status'](_0x1007be)[_0x99b6('0x23')]();};}function respondWithResult(_0xbb962f,_0x19c21e){_0x19c21e=_0x19c21e||0xc8;return function(_0x11eb27){if(_0x11eb27){return _0xbb962f[_0x99b6('0x24')](_0x19c21e)[_0x99b6('0x25')](_0x11eb27);}};}function respondWithFilteredResult(_0x1fa45c,_0x3eb8ef){return function(_0x2975f8){if(_0x2975f8){var _0x3027b7=typeof _0x3eb8ef[_0x99b6('0x26')]===_0x99b6('0x27')&&typeof _0x3eb8ef[_0x99b6('0x28')]==='undefined';var _0xab0ca2=_0x2975f8[_0x99b6('0x29')];var _0x4f7634=_0x3027b7?0x0:_0x3eb8ef[_0x99b6('0x26')];var _0xa2707d=_0x3027b7?_0x2975f8['count']:_0x3eb8ef[_0x99b6('0x26')]+_0x3eb8ef[_0x99b6('0x28')];var _0x1add86;if(_0xa2707d>=_0xab0ca2){_0xa2707d=_0xab0ca2;_0x1add86=0xc8;}else{_0x1add86=0xce;}_0x1fa45c[_0x99b6('0x24')](_0x1add86);return _0x1fa45c[_0x99b6('0x2a')]('Content-Range',_0x4f7634+'-'+_0xa2707d+'/'+_0xab0ca2)['json'](_0x2975f8);}return null;};}function patchUpdates(_0xc3ea3c){return function(_0x1f1cbc){try{jsonpatch['apply'](_0x1f1cbc,_0xc3ea3c,!![]);}catch(_0xfbc39c){return BPromise[_0x99b6('0x2b')](_0xfbc39c);}return _0x1f1cbc['save']();};}function saveUpdates(_0x34f2b3,_0x8d30a7){return function(_0x1d5d16){if(_0x1d5d16){return _0x1d5d16[_0x99b6('0x2c')](_0x34f2b3)['then'](function(_0x642c16){return _0x642c16;});}return null;};}function removeEntity(_0x3ff426,_0x49bc1c){return function(_0x2a2b74){if(_0x2a2b74){return _0x2a2b74['destroy']()['then'](function(){var _0x5b617f=_0x2a2b74[_0x99b6('0x2d')]({'plain':!![]});var _0x4755e9=_0x99b6('0x2e');return db['UserProfileResource'][_0x99b6('0x2f')]({'where':{'type':_0x4755e9,'resourceId':_0x5b617f['id']}})[_0x99b6('0x30')](function(){return _0x2a2b74;});})[_0x99b6('0x30')](function(){_0x3ff426['status'](0xcc)[_0x99b6('0x23')]();});}};}function handleEntityNotFound(_0x57088d,_0x4022c6){return function(_0x585c19){if(!_0x585c19){_0x57088d[_0x99b6('0x31')](0x194);}return _0x585c19;};}function handleError(_0x49808a,_0x1b6593){_0x1b6593=_0x1b6593||0x1f4;return function(_0x5961b2){logger[_0x99b6('0x32')](_0x5961b2[_0x99b6('0x33')]);if(_0x5961b2[_0x99b6('0x34')]){delete _0x5961b2[_0x99b6('0x34')];}_0x49808a['status'](_0x1b6593)['send'](_0x5961b2);};}exports[_0x99b6('0x35')]=function(_0x5b2c19,_0x4112d1){var _0x213cb1={},_0x258e26={},_0x30933d={'count':0x0,'rows':[]};var _0x19bca3=_['map'](db[_0x99b6('0x36')][_0x99b6('0x37')],function(_0x34aafb){return{'name':_0x34aafb[_0x99b6('0x38')],'type':_0x34aafb[_0x99b6('0x39')]['key']};});_0x258e26[_0x99b6('0x3a')]=_['map'](_0x19bca3,_0x99b6('0x34'));_0x258e26[_0x99b6('0x3b')]=_[_0x99b6('0x3c')](_0x5b2c19[_0x99b6('0x3b')]);_0x258e26['filters']=_[_0x99b6('0x3d')](_0x258e26['model'],_0x258e26['query']);_0x213cb1['attributes']=_['intersection'](_0x258e26['model'],qs[_0x99b6('0x3e')](_0x5b2c19[_0x99b6('0x3b')][_0x99b6('0x3e')]));_0x213cb1[_0x99b6('0x3f')]=_0x213cb1[_0x99b6('0x3f')][_0x99b6('0x40')]?_0x213cb1[_0x99b6('0x3f')]:_0x258e26[_0x99b6('0x3a')];if(!_0x5b2c19[_0x99b6('0x3b')][_0x99b6('0x41')](_0x99b6('0x42'))){_0x213cb1[_0x99b6('0x28')]=qs[_0x99b6('0x28')](_0x5b2c19[_0x99b6('0x3b')][_0x99b6('0x28')]);_0x213cb1['offset']=qs[_0x99b6('0x26')](_0x5b2c19['query'][_0x99b6('0x26')]);}_0x213cb1['order']=qs['sort'](_0x5b2c19[_0x99b6('0x3b')][_0x99b6('0x43')]);_0x213cb1[_0x99b6('0x44')]=qs[_0x99b6('0x45')](_['pick'](_0x5b2c19[_0x99b6('0x3b')],_0x258e26[_0x99b6('0x45')]),_0x19bca3);if(_0x5b2c19[_0x99b6('0x3b')][_0x99b6('0x46')]){_0x213cb1['where']=_[_0x99b6('0x47')](_0x213cb1[_0x99b6('0x44')],{'$or':_[_0x99b6('0x48')](_0x19bca3,function(_0x5d1c06){if(_0x5d1c06[_0x99b6('0x39')]!=='VIRTUAL'){var _0x4f4896={};_0x4f4896[_0x5d1c06[_0x99b6('0x34')]]={'$like':'%'+_0x5b2c19['query']['filter']+'%'};return _0x4f4896;}})});}_0x213cb1=_[_0x99b6('0x47')]({},_0x213cb1,_0x5b2c19[_0x99b6('0x49')]);var _0x2f5c4c={'where':_0x213cb1[_0x99b6('0x44')]};return db[_0x99b6('0x36')][_0x99b6('0x29')](_0x2f5c4c)[_0x99b6('0x30')](function(_0x3c6f09){_0x30933d['count']=_0x3c6f09;if(_0x5b2c19[_0x99b6('0x3b')]['includeAll']){_0x213cb1[_0x99b6('0x4a')]=[{'all':!![]}];}return db[_0x99b6('0x36')][_0x99b6('0x4b')](_0x213cb1);})['then'](function(_0x45a543){_0x30933d[_0x99b6('0x4c')]=_0x45a543;return _0x30933d;})[_0x99b6('0x30')](respondWithFilteredResult(_0x4112d1,_0x213cb1))[_0x99b6('0x4d')](handleError(_0x4112d1,null));};exports['show']=function(_0x23c99d,_0xdccb7d){var _0x491f49={'raw':!![],'where':{'id':_0x23c99d[_0x99b6('0x4e')]['id']}},_0x5afdcc={};_0x5afdcc[_0x99b6('0x3a')]=_[_0x99b6('0x3c')](db[_0x99b6('0x36')]['rawAttributes']);_0x5afdcc[_0x99b6('0x3b')]=_[_0x99b6('0x3c')](_0x23c99d[_0x99b6('0x3b')]);_0x5afdcc['filters']=_[_0x99b6('0x3d')](_0x5afdcc[_0x99b6('0x3a')],_0x5afdcc['query']);_0x491f49[_0x99b6('0x3f')]=_[_0x99b6('0x3d')](_0x5afdcc['model'],qs[_0x99b6('0x3e')](_0x23c99d[_0x99b6('0x3b')][_0x99b6('0x3e')]));_0x491f49['attributes']=_0x491f49[_0x99b6('0x3f')]['length']?_0x491f49['attributes']:_0x5afdcc[_0x99b6('0x3a')];if(_0x23c99d[_0x99b6('0x3b')][_0x99b6('0x4f')]){_0x491f49[_0x99b6('0x4a')]=[{'all':!![]}];}_0x491f49=_[_0x99b6('0x47')]({},_0x491f49,_0x23c99d['options']);return db[_0x99b6('0x36')]['find'](_0x491f49)[_0x99b6('0x30')](handleEntityNotFound(_0xdccb7d,null))[_0x99b6('0x30')](respondWithResult(_0xdccb7d,null))['catch'](handleError(_0xdccb7d,null));};exports[_0x99b6('0x50')]=function(_0x37cfaa,_0x283ed9,_0x4d1536){return db[_0x99b6('0x36')][_0x99b6('0x51')]({'where':{'id':_0x37cfaa[_0x99b6('0x4e')]['id']},'attributes':[_0x99b6('0x34'),_0x99b6('0x7')],'raw':!![]})[_0x99b6('0x30')](handleEntityNotFound(_0x283ed9,null))[_0x99b6('0x30')](function(_0x10b06f){if(_0x10b06f){var _0x44a140=path[_0x99b6('0x52')](config[_0x99b6('0x53')],_0x99b6('0x54'),util['format'](_0x99b6('0x55'),path[_0x99b6('0x56')](_0x10b06f[_0x99b6('0x7')])));var _0x184a70=fs['createWriteStream'](_0x44a140);var _0x325e89=archiver(_0x99b6('0x57'),{'zlib':{'level':0x9}});_0x325e89['on'](_0x99b6('0x58'),function(_0x3b8907){if(_0x3b8907[_0x99b6('0x59')]==='ENOENT'){logger['error'](_0x3b8907);}else{throw new db['Sequelize']['Error'](_0x99b6('0x5a'));}});_0x325e89['on'](_0x99b6('0x32'),function(_0x23e5dd){throw new db[(_0x99b6('0x5b'))]['Error'](_0x99b6('0x5a'));});_0x325e89['pipe'](_0x184a70);_0x325e89[_0x99b6('0x5c')](_0x99b6('0x5d'),{'cwd':path[_0x99b6('0x52')](config[_0x99b6('0x53')],'server/files/plugins',path[_0x99b6('0x5e')](_0x10b06f[_0x99b6('0x7')])),'ignore':[path['join'](path[_0x99b6('0x56')](_0x10b06f['path']),_0x99b6('0x5f')),path[_0x99b6('0x52')](path[_0x99b6('0x56')](_0x10b06f['path']),'attachments/**/*')],'nodir':!![]})[_0x99b6('0x60')]();_0x184a70['on'](_0x99b6('0x61'),function(){if(!fs[_0x99b6('0x62')](_0x44a140)){throw new db[(_0x99b6('0x5b'))]['Error']('Plugin\x20not\x20found');}return _0x283ed9[_0x99b6('0x50')](_0x44a140,util[_0x99b6('0x63')](_0x99b6('0x55'),path[_0x99b6('0x56')](_0x10b06f[_0x99b6('0x7')])),function(_0x52c1dd){if(_0x52c1dd){throw new db[(_0x99b6('0x5b'))][(_0x99b6('0x64'))](_0x99b6('0x65'));}fs[_0x99b6('0x66')](_0x44a140);logger[_0x99b6('0x67')](_0x99b6('0x68'));logger[_0x99b6('0x67')](_0x99b6('0x69'));});});}return null;})[_0x99b6('0x4d')](handleError(_0x283ed9,null));};exports['upload']=function(_0x37e474,_0x302108,_0x1ef584){var _0x3bfd4d=path[_0x99b6('0x56')](_0x37e474[_0x99b6('0x6a')][_0x99b6('0x6b')],path[_0x99b6('0x6c')](_0x37e474['file']['filename']));var _0x2870ec=path[_0x99b6('0x52')](config[_0x99b6('0x53')],'server/files/plugins',_0x37e474[_0x99b6('0x6a')][_0x99b6('0x6b')]);var _0x3502e7=path[_0x99b6('0x52')](config['root'],_0x99b6('0x54'),_0x3bfd4d);logger[_0x99b6('0x67')](_0x99b6('0x6d'),_0x2870ec);logger[_0x99b6('0x67')](_0x99b6('0x6e'),_0x3502e7);try{fs['chmodSync'](_0x2870ec,parseInt(_0x99b6('0x6f'),0x8));extract(_0x2870ec,{'dir':_0x3502e7},function(_0x39dc46){if(_0x39dc46){logger[_0x99b6('0x32')](_0x39dc46);handleError(_0x39dc46,!![]);};var _0x31df56=fs[_0x99b6('0x70')](_0x3502e7);if(_0x31df56[_0x99b6('0x40')]>0x1){removeReferences(_0x2870ec,_0x3502e7);logger['error'](_0x99b6('0x71'));return _0x1ef584(new Error('Invalid\x20plugin\x20structure'));}var _0x43e3b1=fs[_0x99b6('0x72')](path['join'](_0x3502e7,_0x31df56[0x0]));if(_0x43e3b1[_0x99b6('0x73')]()){removeReferences(_0x2870ec,_0x3502e7);logger[_0x99b6('0x32')](_0x99b6('0x71'));return _0x1ef584(new Error(_0x99b6('0x71')));}if(_0x43e3b1[_0x99b6('0x74')]()){var _0x45ed39=fs[_0x99b6('0x70')](path[_0x99b6('0x52')](_0x3502e7,_0x31df56[0x0]));if(_0x45ed39['length']===0x0){removeReferences(_0x2870ec,_0x3502e7);logger[_0x99b6('0x32')](_0x99b6('0x71'));return _0x1ef584(new Error(_0x99b6('0x71')));}var _0x1afe76=_0x45ed39[_0x99b6('0x75')](function(_0x324042){return _0x324042===_0x99b6('0x76');});if(!_0x1afe76){return _0x1ef584(new Error(_0x99b6('0x77')));}var _0x287c8b=fs[_0x99b6('0x78')](path[_0x99b6('0x52')](_0x3502e7,_0x31df56[0x0],'manifest.json'));var _0x934dc3=JSON['parse'](_0x287c8b);if(_0x99b6('0x27')==typeof _0x934dc3[_0x99b6('0x34')]){return _0x1ef584(new Error(_0x99b6('0x79')));}if(_0x99b6('0x27')==typeof _0x934dc3[_0x99b6('0x39')]){return _0x1ef584(new Error(_0x99b6('0x7a')));}if('undefined'==typeof _0x934dc3[_0x99b6('0x7b')]){return _0x1ef584(new Error(_0x99b6('0x7c')));}if(_0x99b6('0x27')==typeof _0x934dc3[_0x99b6('0x7d')]){return _0x1ef584(new Error(_0x99b6('0x7e')));}if(_0x934dc3[_0x99b6('0x39')]===_0x99b6('0x7f')){if('undefined'==typeof _0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')]){return _0x1ef584(new Error(_0x99b6('0x81')));}if('undefined'==typeof _0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')][_0x99b6('0x82')]&&_0x99b6('0x27')==typeof _0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')][_0x99b6('0x83')]){return _0x1ef584(new Error(_0x99b6('0x84')));}}else if(_0x934dc3['type']===_0x99b6('0x85')){if(_0x99b6('0x27')==typeof _0x934dc3[_0x99b6('0x7d')][_0x99b6('0x86')]){return _0x1ef584(new Error(_0x99b6('0x87')));}if(_0x99b6('0x27')==typeof _0x934dc3['parameters'][_0x99b6('0x88')]){return _0x1ef584(new Error(_0x99b6('0x89')));}}else{return _0x1ef584(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4cdc54=_0x934dc3['name'];var _0x193084=_0x934dc3[_0x99b6('0x8a')];var _0x440176=_0x934dc3[_0x99b6('0x39')];var _0x647cb2=_0x934dc3['sidebar']?_0x934dc3[_0x99b6('0x8b')]:_0x99b6('0x8c');var _0x345654=_0x934dc3[_0x99b6('0x8d')]?_0x934dc3[_0x99b6('0x8d')]:_0x99b6('0x8e');var _0x13ec24='';var _0x317018='';var _0x56b2cc='';var _0x13fe48='';var _0x1927fe=_0x934dc3[_0x99b6('0x7b')];if(_0x440176===_0x99b6('0x7f')){if(_0x99b6('0x27')!=typeof _0x934dc3[_0x99b6('0x7d')]['views'][_0x99b6('0x82')]){var _0x2aa011=_0x934dc3['parameters'][_0x99b6('0x80')][_0x99b6('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x99b6('0x8f')](_0x2aa011)){_0x13ec24=path[_0x99b6('0x52')](_0x99b6('0x90'),_0x3bfd4d,_0x31df56[0x0],_0x2aa011);}else{_0x13ec24=_0x2aa011;}}else{logger[_0x99b6('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x99b6('0x27')!=typeof _0x934dc3['parameters'][_0x99b6('0x80')][_0x99b6('0x83')]){var _0x19ce03=_0x934dc3['parameters'][_0x99b6('0x80')][_0x99b6('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x99b6('0x8f')](_0x19ce03)){_0x317018=path[_0x99b6('0x52')](_0x99b6('0x90'),_0x3bfd4d,_0x31df56[0x0],_0x19ce03);}else{_0x317018=_0x19ce03;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x440176===_0x99b6('0x85')){_0x56b2cc=_0x934dc3[_0x99b6('0x7d')][_0x99b6('0x86')];_0x13fe48=_0x934dc3['parameters'][_0x99b6('0x88')];if(_0x99b6('0x27')!=typeof _0x934dc3['parameters']['views']){if(_0x99b6('0x27')!=typeof _0x934dc3['parameters'][_0x99b6('0x80')][_0x99b6('0x82')]){var _0x2aa011=_0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')][_0x99b6('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x99b6('0x8f')](_0x2aa011)){_0x13ec24=path[_0x99b6('0x52')]('plugins',_0x3bfd4d,_0x31df56[0x0],_0x2aa011);}else{_0x13ec24=_0x2aa011;}}if('undefined'!=typeof _0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')][_0x99b6('0x83')]){var _0x19ce03=_0x934dc3[_0x99b6('0x7d')][_0x99b6('0x80')][_0x99b6('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x99b6('0x8f')](_0x19ce03)){_0x317018=path[_0x99b6('0x52')](_0x99b6('0x90'),_0x3bfd4d,_0x31df56[0x0],_0x19ce03);}else{_0x317018=_0x19ce03;}}}}var _0xf7cd54={'name':_0x4cdc54,'description':_0x193084,'path':path[_0x99b6('0x52')](_0x3bfd4d,_0x31df56[0x0]),'type':_0x440176,'sidebar':_0x647cb2,'icon':_0x345654,'adminUrl':_0x13ec24,'agentUrl':_0x317018,'scriptName':_0x56b2cc,'scriptPath':_0x13fe48,'version':_0x1927fe};removeReferences(_0x2870ec,null);return db[_0x99b6('0x36')][_0x99b6('0x91')](_0xf7cd54)[_0x99b6('0x30')](function(_0x1fe5e3){var _0x47b198={'role':_0x37e474[_0x99b6('0x92')][_0x99b6('0x93')],'userProfileId':_0x37e474[_0x99b6('0x92')][_0x99b6('0x94')]};if(!_0x47b198)throw new Error(_0x99b6('0x95'));if(_0x47b198[_0x99b6('0x93')]===_0x99b6('0x96')){var _0x504650=_0x1fe5e3[_0x99b6('0x2d')]({'plain':!![]});return db[_0x99b6('0x97')][_0x99b6('0x51')]({'where':{'name':_0x99b6('0x2e'),'userProfileId':_0x47b198[_0x99b6('0x94')]},'raw':!![]})[_0x99b6('0x30')](function(_0x27f383){if(_0x27f383&&_0x27f383[_0x99b6('0x98')]===0x0){return db[_0x99b6('0x99')]['create']({'name':_0x504650['name'],'resourceId':_0x504650['id'],'type':_0x27f383[_0x99b6('0x34')],'sectionId':_0x27f383['id']},{})[_0x99b6('0x30')](function(){return _0x1fe5e3;});}else{return _0x1fe5e3;}})['catch'](function(_0x1803b8){logger['error'](_0x99b6('0x9a'),_0x1803b8);throw _0x1803b8;});}return _0x1fe5e3;})['then'](respondWithResult(_0x302108,null))[_0x99b6('0x4d')](handleError(_0x302108,null));}});}catch(_0x12509b){_0x302108[_0x99b6('0x24')](0x1f4)[_0x99b6('0x9b')](_0x12509b);}};function removeReferences(_0x560038,_0x366b50){try{if(_0x560038){fs[_0x99b6('0x66')](_0x560038);logger[_0x99b6('0x67')]('Zip\x20archive\x20removed');}if(_0x366b50){rimraf(_0x366b50,function(){});logger[_0x99b6('0x67')](_0x99b6('0x9c'));}}catch(_0x16e5b4){logger[_0x99b6('0x32')](_0x16e5b4);}}exports[_0x99b6('0x2c')]=function(_0x1434d4,_0x1457c5,_0x4859e8){return db[_0x99b6('0x36')]['find']({'where':{'id':_0x1434d4[_0x99b6('0x4e')]['id']}})[_0x99b6('0x30')](handleEntityNotFound(_0x1457c5,null))['then'](saveUpdates(_0x1434d4[_0x99b6('0x92')],null))[_0x99b6('0x30')](respondWithResult(_0x1457c5,null))[_0x99b6('0x4d')](handleError(_0x1457c5,null));};exports[_0x99b6('0x9d')]=function(_0x135d6f,_0x3d09e9,_0x2cf53d){return db[_0x99b6('0x36')][_0x99b6('0x51')]({'where':{'id':_0x135d6f['params']['id']}})[_0x99b6('0x30')](function(_0x12dff4){if(_0x12dff4){return _0x12dff4[_0x99b6('0x2f')]();}})[_0x99b6('0x30')](function(_0x379056){rimraf(path[_0x99b6('0x52')](config['root'],_0x99b6('0x54'),path[_0x99b6('0x5e')](_0x379056[_0x99b6('0x7')])),function(){});return _0x379056;})[_0x99b6('0x30')](handleEntityNotFound(_0x3d09e9,null))['then'](respondWithStatusCode(_0x3d09e9,null))[_0x99b6('0x4d')](handleError(_0x3d09e9,null));};exports[_0x99b6('0x9e')]=function(_0x1123aa,_0x54a7be,_0x104931){return BPromise['resolve']()[_0x99b6('0x30')](function(){if(!_0x1123aa[_0x99b6('0x3b')][_0x99b6('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1123aa['query'][_0x99b6('0x9f')]){throw new Error(_0x99b6('0xa0'));}var _0x5cf7d4=_0x1123aa[_0x99b6('0x3b')][_0x99b6('0xa1')]?_0x1123aa[_0x99b6('0x3b')][_0x99b6('0xa1')]+':'+_0x1123aa[_0x99b6('0x3b')][_0x99b6('0x9f')]:_0x99b6('0xa2')+_0x1123aa[_0x99b6('0x3b')][_0x99b6('0x9f')];var _0x5e2167=_0x1123aa[_0x99b6('0x3b')][_0x99b6('0x25')]?_0x1123aa[_0x99b6('0x3b')]['json']:!![];var _0x5bd2f9=_0x1123aa[_0x99b6('0x3b')][_0x99b6('0xa3')]?_0x1123aa[_0x99b6('0x3b')][_0x99b6('0xa3')]:null;var _0x3350db={'method':_0x1123aa['method'],'uri':util[_0x99b6('0x63')](_0x99b6('0xa4'),_0x5cf7d4,_0x1123aa['query'][_0x99b6('0x7')]),'json':_0x5e2167,'resolveWithFullResponse':!![],'encoding':_0x5bd2f9,'qs':_0x1123aa[_0x99b6('0x3b')]};if(_0x1123aa[_0x99b6('0xa5')]){_0x3350db[_0x99b6('0xa5')]=_0x1123aa['headers'];if(_0x3350db[_0x99b6('0xa5')][_0x99b6('0xa6')]){delete _0x3350db[_0x99b6('0xa5')][_0x99b6('0xa6')];}}if(_0x3350db[_0x99b6('0xa5')]['content-type']){delete _0x3350db[_0x99b6('0xa5')][_0x99b6('0xa7')];}return rp(_0x3350db);})[_0x99b6('0x30')](function(_0x302d72){if(_0x302d72){_0x54a7be[_0x99b6('0x2a')](_0x302d72[_0x99b6('0xa5')]);logger['info'](_0x302d72[_0x99b6('0x92')]);if(_['endsWith'](_0x1123aa[_0x99b6('0x3b')]['path'],_0x99b6('0x50'))&&_0x302d72[_0x99b6('0xa8')]==0x1f4){return _0x54a7be[_0x99b6('0x31')](_0x302d72[_0x99b6('0xa8')]);}else{return _0x54a7be[_0x99b6('0x24')](_0x302d72['statusCode'])[_0x99b6('0x9b')](_0x302d72['body']);}}else{return _0x54a7be['sendStatus'](0xc8);}})[_0x99b6('0x4d')](handleError(_0x54a7be,null));};exports[_0x99b6('0xa9')]=function(_0x444fcd,_0x45a493,_0x5d3a2e){return BPromise['resolve']()[_0x99b6('0x30')](function(){if(!_0x444fcd[_0x99b6('0x3b')][_0x99b6('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x444fcd[_0x99b6('0x3b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x24264f=_0x444fcd[_0x99b6('0x3b')][_0x99b6('0xa1')]?_0x444fcd[_0x99b6('0x3b')]['hostname']+':'+_0x444fcd[_0x99b6('0x3b')][_0x99b6('0x9f')]:'http://localhost:'+_0x444fcd[_0x99b6('0x3b')][_0x99b6('0x9f')];var _0x48430f=_0x444fcd[_0x99b6('0x3b')][_0x99b6('0x25')]?_0x444fcd[_0x99b6('0x3b')][_0x99b6('0x25')]:!![];var _0x192615=_0x444fcd[_0x99b6('0x3b')][_0x99b6('0xa3')]?_0x444fcd[_0x99b6('0x3b')][_0x99b6('0xa3')]:null;var _0x5a9251={'method':_0x444fcd['method'],'uri':util[_0x99b6('0x63')](_0x99b6('0xa4'),_0x24264f,_0x444fcd[_0x99b6('0x3b')]['path']),'json':_0x48430f,'resolveWithFullResponse':!![],'encoding':_0x192615,'body':_0x444fcd[_0x99b6('0x92')]};if(_0x444fcd[_0x99b6('0xa5')]){_0x5a9251[_0x99b6('0xa5')]=_0x444fcd[_0x99b6('0xa5')];if(_0x5a9251['headers'][_0x99b6('0xa6')]){delete _0x5a9251[_0x99b6('0xa5')][_0x99b6('0xa6')];}}if(_0x5a9251['headers'][_0x99b6('0xa7')]){delete _0x5a9251[_0x99b6('0xa5')][_0x99b6('0xa7')];}return rp(_0x5a9251);})[_0x99b6('0x30')](function(_0x290396){if(_0x290396){_0x45a493[_0x99b6('0x2a')](_0x290396[_0x99b6('0xa5')]);logger[_0x99b6('0x67')](_0x290396['body']);return _0x45a493[_0x99b6('0x24')](_0x290396[_0x99b6('0xa8')])[_0x99b6('0x9b')](_0x290396[_0x99b6('0x92')]);}else{return _0x45a493[_0x99b6('0x31')](0xc8);}})[_0x99b6('0x4d')](handleError(_0x45a493,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2f03c40..3ee1bc7 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 _0x869e=['update','remove','emit','hasOwnProperty','events','../../mysqldb','Plugin','save'];(function(_0x1fb62b,_0x1c69d9){var _0x3798b8=function(_0x2db79e){while(--_0x2db79e){_0x1fb62b['push'](_0x1fb62b['shift']());}};_0x3798b8(++_0x1c69d9);}(_0x869e,0x15c));var _0xe869=function(_0x4d5341,_0x1dca75){_0x4d5341=_0x4d5341-0x0;var _0x2a3d3e=_0x869e[_0x4d5341];return _0x2a3d3e;};'use strict';var EventEmitter=require(_0xe869('0x0'));var Plugin=require(_0xe869('0x1'))['db'][_0xe869('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe869('0x3'),'afterUpdate':_0xe869('0x4'),'afterDestroy':_0xe869('0x5')};function emitEvent(_0x34b325){return function(_0x39fee6,_0x597771,_0x21f626){PluginEvents[_0xe869('0x6')](_0x34b325+':'+_0x39fee6['id'],_0x39fee6);PluginEvents[_0xe869('0x6')](_0x34b325,_0x39fee6);_0x21f626(null);};}for(var e in events){if(events[_0xe869('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xc359=['save','update','emit','../../mysqldb','setMaxListeners'];(function(_0x573069,_0xf59528){var _0x3a33b4=function(_0x2b6b54){while(--_0x2b6b54){_0x573069['push'](_0x573069['shift']());}};_0x3a33b4(++_0xf59528);}(_0xc359,0x1d9));var _0x9c35=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0xc359[_0x582ccd];return _0x11545d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x9c35('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x9c35('0x1')](0x0);var events={'afterCreate':_0x9c35('0x2'),'afterUpdate':_0x9c35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cfffd){return function(_0x53a490,_0x1540b4,_0x5d4ee8){PluginEvents[_0x9c35('0x4')](_0x3cfffd+':'+_0x53a490['id'],_0x53a490);PluginEvents['emit'](_0x3cfffd,_0x53a490);_0x5d4ee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4e42cde..b277658 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 _0xfe48=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x368cd6,_0x275b63){var _0x16161d=function(_0x360aec){while(--_0x360aec){_0x368cd6['push'](_0x368cd6['shift']());}};_0x16161d(++_0x275b63);}(_0xfe48,0x183));var _0x8fe4=function(_0x45d8f3,_0x45b357){_0x45d8f3=_0x45d8f3-0x0;var _0xbf4658=_0xfe48[_0x45d8f3];return _0xbf4658;};'use strict';var _=require(_0x8fe4('0x0'));var util=require(_0x8fe4('0x1'));var logger=require(_0x8fe4('0x2'))(_0x8fe4('0x3'));var moment=require(_0x8fe4('0x4'));var BPromise=require(_0x8fe4('0x5'));var rp=require(_0x8fe4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fe4('0x7'));var config=require(_0x8fe4('0x8'));var attributes=require('./plugin.attributes');module[_0x8fe4('0x9')]=function(_0x4be034,_0x19b0ea){return _0x4be034[_0x8fe4('0xa')](_0x8fe4('0xb'),attributes,{'tableName':_0x8fe4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x462b=['path','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4aefcd,_0x76a9f9){var _0x248bcc=function(_0x38983a){while(--_0x38983a){_0x4aefcd['push'](_0x4aefcd['shift']());}};_0x248bcc(++_0x76a9f9);}(_0x462b,0x1da));var _0xb462=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x462b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb462('0x0'));var util=require(_0xb462('0x1'));var logger=require(_0xb462('0x2'))(_0xb462('0x3'));var moment=require('moment');var BPromise=require(_0xb462('0x4'));var rp=require(_0xb462('0x5'));var fs=require('fs');var path=require(_0xb462('0x6'));var rimraf=require('rimraf');var config=require(_0xb462('0x7'));var attributes=require('./plugin.attributes');module[_0xb462('0x8')]=function(_0x25a077,_0x2c3831){return _0x25a077[_0xb462('0x9')](_0xb462('0xa'),attributes,{'tableName':_0xb462('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 7944306..c7a4955 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 _0x30fc=['options','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','stringify','code','Plugin,\x20%s,\x20%s','message','error','info','result','catch','CreatePlugin','create'];(function(_0x104449,_0x53be02){var _0x115491=function(_0x144ea7){while(--_0x144ea7){_0x104449['push'](_0x104449['shift']());}};_0x115491(++_0x53be02);}(_0x30fc,0xfa));var _0xc30f=function(_0x280a97,_0x1c3a99){_0x280a97=_0x280a97-0x0;var _0x54e2a2=_0x30fc[_0x280a97];return _0x54e2a2;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var moment=require('moment');var BPromise=require(_0xc30f('0x2'));var rs=require(_0xc30f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc30f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc30f('0x5'));var config=require(_0xc30f('0x6'));var jayson=require(_0xc30f('0x7'));var client=jayson[_0xc30f('0x8')][_0xc30f('0x9')]({'port':0x232a});config[_0xc30f('0xa')]=_[_0xc30f('0xb')](config[_0xc30f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc30f('0xc'))(new Redis(config['redis']));require(_0xc30f('0xd'))[_0xc30f('0xe')](socket);function respondWithRpcPromise(_0xbfdd13,_0x22a35f,_0x18d3f1){return new BPromise(function(_0xc3d1ad,_0x145b4e){return client[_0xc30f('0xf')](_0xbfdd13,_0x18d3f1)[_0xc30f('0x10')](function(_0x5db6de){logger['info']('Plugin,\x20%s,\x20%s',_0x22a35f,_0xc30f('0x11'));logger[_0xc30f('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x22a35f,_0xc30f('0x11'),JSON[_0xc30f('0x13')](_0x5db6de));if(_0x5db6de['error']){if(_0x5db6de['error'][_0xc30f('0x14')]===0x1f4){logger['error'](_0xc30f('0x15'),_0x22a35f,_0x5db6de['error'][_0xc30f('0x16')]);return _0x145b4e(_0x5db6de['error'][_0xc30f('0x16')]);}logger[_0xc30f('0x17')](_0xc30f('0x15'),_0x22a35f,_0x5db6de[_0xc30f('0x17')][_0xc30f('0x16')]);return _0xc3d1ad(_0x5db6de[_0xc30f('0x17')][_0xc30f('0x16')]);}else{logger[_0xc30f('0x18')](_0xc30f('0x15'),_0x22a35f,_0xc30f('0x11'));_0xc3d1ad(_0x5db6de[_0xc30f('0x19')][_0xc30f('0x16')]);}})[_0xc30f('0x1a')](function(_0x2de552){logger[_0xc30f('0x17')](_0xc30f('0x15'),_0x22a35f,_0x2de552);_0x145b4e(_0x2de552);});});}exports[_0xc30f('0x1b')]=function(_0x67faa3){var _0x11670c=this;return new Promise(function(_0x5aed7a,_0x50b38c){return db['Plugin'][_0xc30f('0x1c')](_0x67faa3['body'],{'raw':_0x67faa3[_0xc30f('0x1d')]?_0x67faa3[_0xc30f('0x1d')][_0xc30f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xc3d24){logger[_0xc30f('0x18')](_0xc30f('0x1b'),_0x67faa3);logger[_0xc30f('0x12')](_0xc30f('0x1b'),_0x67faa3,JSON[_0xc30f('0x13')](_0xc3d24));_0x5aed7a(_0xc3d24);})[_0xc30f('0x1a')](function(_0x36a027){logger['error']('CreatePlugin',_0x36a027['message'],_0x67faa3);_0x50b38c(_0x11670c[_0xc30f('0x17')](0x1f4,_0x36a027[_0xc30f('0x16')]));});});}; \ No newline at end of file +var _0x1395=['result','CreatePlugin','create','options','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5a1613,_0x370b1b){var _0x2197d8=function(_0x4fc508){while(--_0x4fc508){_0x5a1613['push'](_0x5a1613['shift']());}};_0x2197d8(++_0x370b1b);}(_0x1395,0xc2));var _0x5139=function(_0x58efac,_0x44d212){_0x58efac=_0x58efac-0x0;var _0x32b1b4=_0x1395[_0x58efac];return _0x32b1b4;};'use strict';var _=require(_0x5139('0x0'));var util=require(_0x5139('0x1'));var moment=require(_0x5139('0x2'));var BPromise=require(_0x5139('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5139('0x4'));var db=require(_0x5139('0x5'))['db'];var utils=require(_0x5139('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5139('0x7')][_0x5139('0x8')]({'port':0x232a});config[_0x5139('0x9')]=_[_0x5139('0xa')](config[_0x5139('0x9')],{'host':_0x5139('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x295c0f,_0x31704c,_0x5bcf0a){return new BPromise(function(_0x3a7490,_0x22ada9){return client[_0x5139('0xc')](_0x295c0f,_0x5bcf0a)[_0x5139('0xd')](function(_0x1acca7){logger[_0x5139('0xe')](_0x5139('0xf'),_0x31704c,_0x5139('0x10'));logger[_0x5139('0x11')](_0x5139('0x12'),_0x31704c,_0x5139('0x10'),JSON[_0x5139('0x13')](_0x1acca7));if(_0x1acca7[_0x5139('0x14')]){if(_0x1acca7[_0x5139('0x14')]['code']===0x1f4){logger[_0x5139('0x14')]('Plugin,\x20%s,\x20%s',_0x31704c,_0x1acca7[_0x5139('0x14')][_0x5139('0x15')]);return _0x22ada9(_0x1acca7[_0x5139('0x14')][_0x5139('0x15')]);}logger[_0x5139('0x14')](_0x5139('0xf'),_0x31704c,_0x1acca7[_0x5139('0x14')]['message']);return _0x3a7490(_0x1acca7[_0x5139('0x14')][_0x5139('0x15')]);}else{logger[_0x5139('0xe')](_0x5139('0xf'),_0x31704c,_0x5139('0x10'));_0x3a7490(_0x1acca7[_0x5139('0x16')][_0x5139('0x15')]);}})['catch'](function(_0x44e969){logger[_0x5139('0x14')](_0x5139('0xf'),_0x31704c,_0x44e969);_0x22ada9(_0x44e969);});});}exports[_0x5139('0x17')]=function(_0x52a489){var _0x41870d=this;return new Promise(function(_0x54f1c6,_0x59ccfc){return db['Plugin'][_0x5139('0x18')](_0x52a489['body'],{'raw':_0x52a489['options']?_0x52a489[_0x5139('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x5139('0xd')](function(_0x4a8a85){logger['info'](_0x5139('0x17'),_0x52a489);logger[_0x5139('0x11')](_0x5139('0x17'),_0x52a489,JSON[_0x5139('0x13')](_0x4a8a85));_0x54f1c6(_0x4a8a85);})[_0x5139('0x1a')](function(_0x5f4977){logger[_0x5139('0x14')](_0x5139('0x17'),_0x5f4977[_0x5139('0x15')],_0x52a489);_0x59ccfc(_0x41870d[_0x5139('0x14')](0x1f4,_0x5f4977['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0270547..a2d7f4b 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 _0xbd2e=['update','emit','removeListener','register','./plugin.events','save','remove'];(function(_0x55fd27,_0x2a706b){var _0x1c3c5c=function(_0x4865a7){while(--_0x4865a7){_0x55fd27['push'](_0x55fd27['shift']());}};_0x1c3c5c(++_0x2a706b);}(_0xbd2e,0x1d2));var _0xebd2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd2e[_0x21a9d9];return _0x46adce;};'use strict';var PluginEvents=require(_0xebd2('0x0'));var events=[_0xebd2('0x1'),_0xebd2('0x2'),_0xebd2('0x3')];function createListener(_0xb640d9,_0x5b41aa){return function(_0x589645){_0x5b41aa[_0xebd2('0x4')](_0xb640d9,_0x589645);};}function removeListener(_0x4c233e,_0x1a150c){return function(){PluginEvents[_0xebd2('0x5')](_0x4c233e,_0x1a150c);};}exports[_0xebd2('0x6')]=function(_0x5c8d30){for(var _0x335944=0x0,_0x2c6738=events['length'];_0x335944<_0x2c6738;_0x335944++){var _0x1ef8b7=events[_0x335944];var _0x33bcf9=createListener('plugin:'+_0x1ef8b7,_0x5c8d30);PluginEvents['on'](_0x1ef8b7,_0x33bcf9);}}; \ No newline at end of file +var _0x3f36=['plugin:','./plugin.events','remove','update','emit','removeListener','length'];(function(_0x5b3ce1,_0xedd65b){var _0x38b358=function(_0x154aa6){while(--_0x154aa6){_0x5b3ce1['push'](_0x5b3ce1['shift']());}};_0x38b358(++_0xedd65b);}(_0x3f36,0x7f));var _0x63f3=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x3f36[_0x28b7ab];return _0x56791b;};'use strict';var PluginEvents=require(_0x63f3('0x0'));var events=['save',_0x63f3('0x1'),_0x63f3('0x2')];function createListener(_0x38ef32,_0x20c6df){return function(_0x1ad26b){_0x20c6df[_0x63f3('0x3')](_0x38ef32,_0x1ad26b);};}function removeListener(_0x1d04fb,_0x557ae8){return function(){PluginEvents[_0x63f3('0x4')](_0x1d04fb,_0x557ae8);};}exports['register']=function(_0xb4c83d){for(var _0x5c063b=0x0,_0x55765b=events[_0x63f3('0x5')];_0x5c063b<_0x55765b;_0x5c063b++){var _0x290b19=events[_0x5c063b];var _0x9daaf7=createListener(_0x63f3('0x6')+_0x290b19,_0xb4c83d);PluginEvents['on'](_0x290b19,_0x9daaf7);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f1103c6..8f3788d 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(_0x2e72c1,_0x4bd0d1){var _0x3bf40=function(_0x108592){while(--_0x108592){_0x2e72c1['push'](_0x2e72c1['shift']());}};_0x3bf40(++_0x4bd0d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x2432fd,_0x401861){var _0x3d69c3=function(_0x5c9053){while(--_0x5c9053){_0x2432fd['push'](_0x2432fd['shift']());}};_0x3d69c3(++_0x401861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 7696aa8..7256e71 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 _0x9c44=['exec','bluebird','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','motion2','length','catch','body','script','join','../../files/plugins','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','../../config/logger','api','path','child_process'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var path=require(_0x49c4('0x2'));var exec=require(_0x49c4('0x3'))[_0x49c4('0x4')];var BPromise=require(_0x49c4('0x5'));function handleEntityNotFound(_0x4e0313,_0x4941f1){return function(_0x41a183){if(!_0x41a183){_0x4e0313['sendStatus'](0x194);;}return _0x41a183;};}function respondWithResult(_0xc1278f,_0x6030ae){_0x6030ae=_0x6030ae||0xc8;return function(_0x69bc41){if(_0x69bc41){return _0xc1278f[_0x49c4('0x6')](_0x6030ae)[_0x49c4('0x7')](_0x69bc41);}return null;};}function handleError(_0x511d53,_0x11c586){_0x11c586=_0x11c586||0x1f4;return function(_0x42e4f8){logger[_0x49c4('0x8')](_0x42e4f8[_0x49c4('0x9')]);if(_0x42e4f8['name']){delete _0x42e4f8['name'];}_0x511d53[_0x49c4('0x6')](_0x11c586)[_0x49c4('0xa')](_0x42e4f8);};}function execChildProcess(){return new BPromise(function(_0x58cad7,_0xb611a1){exec(_0x49c4('0xb'),function(_0x4adb3c,_0x536d42,_0x1d19bf){logger[_0x49c4('0xc')](_0x536d42);logger['info'](_0x1d19bf);if(_0x4adb3c){logger[_0x49c4('0x8')](_0x4adb3c);return _0xb611a1(_0x4adb3c);}return _0x58cad7(_0x536d42);});});}exports[_0x49c4('0xd')]=function(_0x5f2fd9,_0x1909fe){return pm2[_0x49c4('0xe')]()[_0x49c4('0xf')](function(_0x2decee){if(_0x2decee){var _0x12777c=_[_0x49c4('0x10')](_0x2decee,function(_0x75ea8){return _0x75ea8[_0x49c4('0x11')]==='express'||_0x75ea8[_0x49c4('0x11')]===_0x49c4('0x12');});return{'rows':_0x12777c,'count':_0x12777c[_0x49c4('0x13')]};}return null;})[_0x49c4('0xf')](respondWithResult(_0x1909fe,null))[_0x49c4('0x14')](handleError(_0x1909fe,null));};exports['show']=function(_0x44e607,_0x2891f4){return pm2['describe'](_0x44e607['params']['id'])[_0x49c4('0xf')](respondWithResult(_0x2891f4,null))[_0x49c4('0xf')](handleEntityNotFound(_0x2891f4,null))[_0x49c4('0x14')](handleError(_0x2891f4,null));};exports['create']=function(_0x24856d,_0x50b151){if(_0x24856d[_0x49c4('0x15')][_0x49c4('0x11')]&&_0x24856d[_0x49c4('0x15')][_0x49c4('0x16')]){var _0x382040=path[_0x49c4('0x17')](__dirname,_0x49c4('0x18'),_0x24856d[_0x49c4('0x15')][_0x49c4('0x16')]);var _0x578447=process['cwd']();process['chdir'](path[_0x49c4('0x19')](_0x382040));return execChildProcess()['then'](function(_0x592bb8){process[_0x49c4('0x1a')](_0x578447);return pm2[_0x49c4('0x1b')]({'name':_0x24856d[_0x49c4('0x15')][_0x49c4('0x11')],'script':_0x382040});})['then'](function(_0x5850f2){pm2[_0x49c4('0x1c')]();return _0x5850f2[0x0];})[_0x49c4('0xf')](respondWithResult(_0x50b151,0xc9))['catch'](handleError(_0x50b151,null));}else{return _0x50b151[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':_0x49c4('0x1d')});}};exports[_0x49c4('0x1e')]=function(_0x531d92,_0x543ea2){if(_0x531d92[_0x49c4('0x15')]['id']){delete _0x531d92['body']['id'];}var _0x3800b7={'online':_0x49c4('0x1f'),'stopped':_0x49c4('0x20')};if(_0x3800b7[_0x49c4('0x21')](_0x531d92['body'][_0x49c4('0x6')])){return pm2[_0x3800b7[_0x531d92[_0x49c4('0x15')][_0x49c4('0x6')]]](_0x531d92[_0x49c4('0x22')]['id'])[_0x49c4('0xf')](respondWithResult(_0x543ea2,0xc8))[_0x49c4('0x14')](handleError(_0x543ea2,null));}else{return _0x543ea2[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':_0x49c4('0x23')});}};exports[_0x49c4('0x24')]=function(_0x46f7ea,_0x4ea6ea){if(_0x46f7ea['body']['id']){delete _0x46f7ea['body']['id'];}if(_0x46f7ea[_0x49c4('0x22')]['id']){return pm2[_0x49c4('0x25')](_0x46f7ea[_0x49c4('0x22')]['id'])[_0x49c4('0xf')](function(_0x28eb47){pm2['dump']();return _0x28eb47[0x0];})[_0x49c4('0xf')](respondWithResult(_0x4ea6ea,null))[_0x49c4('0x14')](handleError(_0x4ea6ea,null));}else{return _0x4ea6ea[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x6c76=['status','npm\x20install','info','error','index','list','then','reject','motion2','length','catch','params','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','send','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','sendStatus','stack','name'];(function(_0x5bc9a6,_0x4294cc){var _0x24e8be=function(_0x531e92){while(--_0x531e92){_0x5bc9a6['push'](_0x5bc9a6['shift']());}};_0x24e8be(++_0x4294cc);}(_0x6c76,0x184));var _0x66c7=function(_0x35983a,_0x20ba10){_0x35983a=_0x35983a-0x0;var _0x1ba0dc=_0x6c76[_0x35983a];return _0x1ba0dc;};'use strict';var _=require(_0x66c7('0x0'));var pm2=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var path=require(_0x66c7('0x3'));var exec=require(_0x66c7('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x2f6db7,_0x2b7cf3){return function(_0x49d437){if(!_0x49d437){_0x2f6db7[_0x66c7('0x5')](0x194);;}return _0x49d437;};}function respondWithResult(_0x45b0a5,_0x52f71b){_0x52f71b=_0x52f71b||0xc8;return function(_0x23408c){if(_0x23408c){return _0x45b0a5['status'](_0x52f71b)['json'](_0x23408c);}return null;};}function handleError(_0x208d06,_0x2b0065){_0x2b0065=_0x2b0065||0x1f4;return function(_0x24349f){logger['error'](_0x24349f[_0x66c7('0x6')]);if(_0x24349f[_0x66c7('0x7')]){delete _0x24349f[_0x66c7('0x7')];}_0x208d06[_0x66c7('0x8')](_0x2b0065)['send'](_0x24349f);};}function execChildProcess(){return new BPromise(function(_0x464085,_0x45db57){exec(_0x66c7('0x9'),function(_0x187e00,_0x21fb64,_0x406e41){logger[_0x66c7('0xa')](_0x21fb64);logger['info'](_0x406e41);if(_0x187e00){logger[_0x66c7('0xb')](_0x187e00);return _0x45db57(_0x187e00);}return _0x464085(_0x21fb64);});});}exports[_0x66c7('0xc')]=function(_0x35cbc2,_0xea3f56){return pm2[_0x66c7('0xd')]()[_0x66c7('0xe')](function(_0x618bd7){if(_0x618bd7){var _0xf3b04=_[_0x66c7('0xf')](_0x618bd7,function(_0x5d44e1){return _0x5d44e1[_0x66c7('0x7')]==='express'||_0x5d44e1[_0x66c7('0x7')]===_0x66c7('0x10');});return{'rows':_0xf3b04,'count':_0xf3b04[_0x66c7('0x11')]};}return null;})[_0x66c7('0xe')](respondWithResult(_0xea3f56,null))[_0x66c7('0x12')](handleError(_0xea3f56,null));};exports['show']=function(_0x5cf913,_0x53fb36){return pm2['describe'](_0x5cf913[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x53fb36,null))['then'](handleEntityNotFound(_0x53fb36,null))['catch'](handleError(_0x53fb36,null));};exports[_0x66c7('0x14')]=function(_0x9b65cf,_0x4756f7){if(_0x9b65cf[_0x66c7('0x15')]['name']&&_0x9b65cf['body'][_0x66c7('0x16')]){var _0x237177=path[_0x66c7('0x17')](__dirname,_0x66c7('0x18'),_0x9b65cf[_0x66c7('0x15')][_0x66c7('0x16')]);var _0x4804cf=process[_0x66c7('0x19')]();process[_0x66c7('0x1a')](path['dirname'](_0x237177));return execChildProcess()[_0x66c7('0xe')](function(_0x8b96b1){process[_0x66c7('0x1a')](_0x4804cf);return pm2[_0x66c7('0x1b')]({'name':_0x9b65cf['body'][_0x66c7('0x7')],'script':_0x237177});})[_0x66c7('0xe')](function(_0x5b28e6){pm2[_0x66c7('0x1c')]();return _0x5b28e6[0x0];})[_0x66c7('0xe')](respondWithResult(_0x4756f7,0xc9))[_0x66c7('0x12')](handleError(_0x4756f7,null));}else{return _0x4756f7[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x4e514a,_0x2dd131){if(_0x4e514a[_0x66c7('0x15')]['id']){delete _0x4e514a['body']['id'];}var _0x9afd50={'online':_0x66c7('0x1e'),'stopped':_0x66c7('0x1f')};if(_0x9afd50[_0x66c7('0x20')](_0x4e514a[_0x66c7('0x15')][_0x66c7('0x8')])){return pm2[_0x9afd50[_0x4e514a['body'][_0x66c7('0x8')]]](_0x4e514a[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x2dd131,0xc8))[_0x66c7('0x12')](handleError(_0x2dd131,null));}else{return _0x2dd131[_0x66c7('0x8')](0x1f4)['send']({'message':_0x66c7('0x21')});}};exports['destroy']=function(_0xfbd97,_0x543fbf){if(_0xfbd97[_0x66c7('0x15')]['id']){delete _0xfbd97[_0x66c7('0x15')]['id'];}if(_0xfbd97[_0x66c7('0x13')]['id']){return pm2[_0x66c7('0x22')](_0xfbd97[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](function(_0x559ab9){pm2['dump']();return _0x559ab9[0x0];})[_0x66c7('0xe')](respondWithResult(_0x543fbf,null))[_0x66c7('0x12')](handleError(_0x543fbf,null));}else{return _0x543fbf[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':_0x66c7('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index e971947..8e009a9 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 _0xdbb9=['get','isAuthenticated','getQueues','exports','Router','../../components/auth/service','./realtime.controller'];(function(_0x1e9103,_0x5bc771){var _0x4c0269=function(_0x1492cc){while(--_0x1492cc){_0x1e9103['push'](_0x1e9103['shift']());}};_0x4c0269(++_0x5bc771);}(_0xdbb9,0xf9));var _0x9dbb=function(_0xa482b6,_0x243cfa){_0xa482b6=_0xa482b6-0x0;var _0x5e71c9=_0xdbb9[_0xa482b6];return _0x5e71c9;};'use strict';var express=require('express');var router=express[_0x9dbb('0x0')]();var auth=require(_0x9dbb('0x1'));var controller=require(_0x9dbb('0x2'));router[_0x9dbb('0x3')]('/queues',auth[_0x9dbb('0x4')](),controller[_0x9dbb('0x5')]);module[_0x9dbb('0x6')]=router; \ No newline at end of file +var _0x87d5=['../../components/auth/service','get','/queues','isAuthenticated','getQueues','express'];(function(_0x28107d,_0x2ec8b3){var _0x2b1cbe=function(_0x5b06ad){while(--_0x5b06ad){_0x28107d['push'](_0x28107d['shift']());}};_0x2b1cbe(++_0x2ec8b3);}(_0x87d5,0x6b));var _0x587d=function(_0x3f2dda,_0x499139){_0x3f2dda=_0x3f2dda-0x0;var _0x1faa91=_0x87d5[_0x3f2dda];return _0x1faa91;};'use strict';var express=require(_0x587d('0x0'));var router=express['Router']();var auth=require(_0x587d('0x1'));var controller=require('./realtime.controller');router[_0x587d('0x2')](_0x587d('0x3'),auth[_0x587d('0x4')](),controller[_0x587d('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 19cbb88..6e88199 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 _0xe17f=['toString','talking','find','getMembers','UserId','accountcode','voiceStatus','online','push','User','Pause','QueueId','getQueues','mail','chat','sms','whatsapp','resolve','query','channel','includes','toLowerCase','Queue','rawAttributes','fieldName','type','key','user','userProfileId','QueueCampaigns','UserProfile','getResources','rows','lodash','../../components/parsers/qs','../../config/logger','api','http','client','offset','limit','undefined','count','Content-Range','json','error','stack','name','status','request','Agents','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','voice','pTalking','originated','message','dialActive','dialMethod','startProgressive','erlangCalls','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','map','agents','loggedInDb','busy','outbound','merge','pick','filter','length','some','connectedlinenum','internal'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xe17f,0x7d));var _0xfe17=function(_0x397922,_0x34b8f0){_0x397922=_0x397922-0x0;var _0x37d067=_0xe17f[_0x397922];return _0x37d067;};'use strict';var util=require('util');var _=require(_0xfe17('0x0'));var jayson=require('jayson/promise');var qs=require(_0xfe17('0x1'));var logger=require(_0xfe17('0x2'))(_0xfe17('0x3'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0xfe17('0x4')]({'port':0x232a});var routingClient=jayson[_0xfe17('0x5')][_0xfe17('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x43e138,_0x31a8d9){return function(_0x21948a){if(_0x21948a){var _0x220100=typeof _0x31a8d9[_0xfe17('0x6')]==='undefined'&&typeof _0x31a8d9[_0xfe17('0x7')]===_0xfe17('0x8');var _0x1a6bca=_0x21948a['count'];var _0x28453c=_0x220100?0x0:_0x31a8d9[_0xfe17('0x6')];var _0x254c24=_0x220100?_0x21948a[_0xfe17('0x9')]:_0x31a8d9[_0xfe17('0x6')]+_0x31a8d9['limit'];var _0x5394ee;if(_0x254c24>=_0x1a6bca){_0x254c24=_0x1a6bca;_0x5394ee=0xc8;}else{_0x5394ee=0xce;}_0x43e138['status'](_0x5394ee);return _0x43e138['set'](_0xfe17('0xa'),_0x28453c+'-'+_0x254c24+'/'+_0x1a6bca)[_0xfe17('0xb')](_0x21948a);}return null;};}function handleError(_0x483551,_0x185e8f){_0x185e8f=_0x185e8f||0x1f4;return function(_0x2b8991){logger[_0xfe17('0xc')](_0x2b8991[_0xfe17('0xd')]);if(_0x2b8991[_0xfe17('0xe')]){delete _0x2b8991['name'];}_0x483551[_0xfe17('0xf')](_0x185e8f)['send'](_0x2b8991);};}function getRealtimeAgents(){return new Promise(function(_0x5bd189,_0x447e00){return amiClient[_0xfe17('0x10')](_0xfe17('0x11'),{})['then'](function(_0x3a596e){if(_0x3a596e[_0xfe17('0xc')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x2e9422=_0x3a596e[_0xfe17('0x12')];return routingClient[_0xfe17('0x10')]('Agents',{})[_0xfe17('0x13')](function(_0x1f45b0){if(_0x1f45b0[_0xfe17('0xc')])throw new Error(_0xfe17('0x14'));var _0x34775d=_0x1f45b0[_0xfe17('0x12')];return _0x5bd189(_['merge']({},_0x2e9422,_0x34775d));});})[_0xfe17('0x15')](function(_0x1c673e){_0x447e00(_0x1c673e);});});}function getRealtimeQueues(_0x9dc798,_0x5b7488){return new Promise(function(_0x1d29a5,_0x4b8c2c){var _0x2a9a53=_0x5b7488==='voice'?amiClient:routingClient;return _0x2a9a53['request'](_[_0xfe17('0x16')](_0x5b7488)+_0xfe17('0x17'),_0x9dc798)[_0xfe17('0x13')](function(_0x28fc90){if(_0x28fc90[_0xfe17('0xc')])throw new Error(util[_0xfe17('0x18')](_0xfe17('0x19'),_0x5b7488));return _0x1d29a5(_0x28fc90['result']);})['catch'](function(_0x4c5a51){_0x4b8c2c(_0x4c5a51);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3c0303,_0x885c90){return amiClient['request']('VoiceQueuesChannels',{})[_0xfe17('0x13')](function(_0x1d5169){if(_0x1d5169[_0xfe17('0xc')])throw new Error(_0xfe17('0x1a'));return _0x3c0303(_0x1d5169['result']);})['catch'](function(_0x2b2c5e){_0x885c90(_0x2b2c5e);});});}function initializeQueues(_0x5140c9,_0x544490,_0x2eecff,_0x558329){var _0x39ff84=[_0xfe17('0x1b'),_0xfe17('0x1c'),_0xfe17('0x1d'),'talking',_0xfe17('0x1e')];if(_0x2eecff===_0xfe17('0x1f')&&_0x558329==='outbound'){_0x39ff84['push'](_0xfe17('0x20'),_0xfe17('0x21'),_0xfe17('0x22'),_0xfe17('0x23'),_0xfe17('0x24'),'Trunk','startPredictive',_0xfe17('0x25'),_0xfe17('0x26'),'erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor',_0xfe17('0x27'),_0xfe17('0x28'),_0xfe17('0x29'),_0xfe17('0x2a'),_0xfe17('0x2b'),_0xfe17('0x2c'),_0xfe17('0x2d'),'predictiveIntervalDroppedCallsCallersExit',_0xfe17('0x2e'),'predictiveIntervalAvgTalktime');}return _0x5140c9[_0xfe17('0x2f')](function(_0x4492ee){var _0x24e7db=_0x4492ee['get']({'plain':!![]});_0x24e7db[_0xfe17('0x30')]=[];_0x24e7db[_0xfe17('0x1e')]=0x0;_0x24e7db[_0xfe17('0x31')]=0x0;_0x24e7db[_0xfe17('0x1b')]=0x0;_0x24e7db[_0xfe17('0x1c')]=0x0;_0x24e7db[_0xfe17('0x1d')]=0x0;if(_0x2eecff===_0xfe17('0x1f')){_0x24e7db['talking']=0x0;_0x24e7db[_0xfe17('0x32')]=0x0;if(_0x558329===_0xfe17('0x33')){_0x24e7db[_0xfe17('0x20')]=0x0;_0x24e7db['originated']=0x0;}}var _0x1dbb6a=_['find'](_0x544490,['id',_0x24e7db['id']]);if(_0x1dbb6a)_[_0xfe17('0x34')](_0x24e7db,_[_0xfe17('0x35')](_0x1dbb6a,_0x39ff84));return _0x24e7db;});}function updateAgentVoiceStatus(_0x5d6330,_0x33f56a,_0x28eb78){var _0x17f3e0=_[_0xfe17('0x36')](_0x28eb78,['queue',_0x33f56a[_0xfe17('0xe')]]);if(_0x17f3e0[_0xfe17('0x37')]===0x0)return _0x5d6330[_0xfe17('0x32')]=!![];if(_[_0xfe17('0x38')](_0x17f3e0,[_0xfe17('0x39'),_0x5d6330[_0xfe17('0x3a')][_0xfe17('0x3b')]()]))return _0x5d6330[_0xfe17('0x3c')]=!![];if(!_0x5d6330['talking'])return _0x5d6330['busy']=!![];}function getVoiceQueueAgents(_0x2bc757,_0xcf1a33,_0x4c500a,_0x114426){var _0xa0ceb5=_[_0xfe17('0x3d')](_0xcf1a33,['id',_0x2bc757['id']]);if(!_0xa0ceb5)return _0x2bc757;return _0xa0ceb5[_0xfe17('0x3e')]({'raw':!![]})[_0xfe17('0x13')](function(_0x14f50b){for(var _0x139691=0x0;_0x139691<_0x14f50b[_0xfe17('0x37')];_0x139691++){var _0x5b2903=_[_0xfe17('0x3d')](_0x4c500a,['id',_0x14f50b[_0x139691][_0xfe17('0x3f')]]);if(!_0x5b2903){_0x5b2903={'id':_0x14f50b[_0x139691][_0xfe17('0x3f')],'name':_0x14f50b[_0x139691][_0xfe17('0x3f')],'accountcode':'','online':![]};}var _0x3f1379={'id':_0x5b2903['id'],'name':_0x5b2903['name'],'internal':_0x5b2903[_0xfe17('0x40')],'online':Boolean(_0x5b2903['online']),'paused':Boolean(_0x14f50b[_0x139691][_0xfe17('0x1e')])};if(_0x5b2903[_0xfe17('0x41')]===_0xfe17('0x3c'))updateAgentVoiceStatus(_0x3f1379,_0x2bc757,_0x114426);if(_0x3f1379[_0xfe17('0x42')])_0x2bc757[_0xfe17('0x31')]++;if(_0x3f1379[_0xfe17('0x32')])_0x2bc757['busy']++;if(_0x3f1379[_0xfe17('0x1e')]&&!_0x3f1379['busy']&&!_0x3f1379[_0xfe17('0x3c')])_0x2bc757[_0xfe17('0x1e')]++;_0x2bc757['agents'][_0xfe17('0x43')](_0x3f1379);}return _0x2bc757;});}function getQueueAgents(_0x32d7b4,_0x458c24,_0x360bd7){var _0x49b847=_0xfe17('0x44')+_[_0xfe17('0x16')](_0x360bd7)+'Queue';var _0x43a276=_0x360bd7+_0xfe17('0x45');return db[_0x49b847]['findAll']({'where':{[_['startCase'](_0x360bd7)+_0xfe17('0x46')]:_0x32d7b4['id']},'raw':!![]})[_0xfe17('0x13')](function(_0x4d4d20){for(var _0x4dc6bb=0x0;_0x4dc6bb<_0x4d4d20[_0xfe17('0x37')];_0x4dc6bb++){var _0x3cc415=_['find'](_0x458c24,['id',_0x4d4d20[_0x4dc6bb][_0xfe17('0x3f')]]);if(!_0x3cc415){_0x3cc415={'id':_0x4d4d20[_0x4dc6bb][_0xfe17('0x3f')],'name':_0x4d4d20[_0x4dc6bb][_0xfe17('0x3f')],'online':![],['pauseField']:![]};}var _0x28cf0a={'id':_0x3cc415['id'],'name':_0x3cc415[_0xfe17('0xe')],'online':Boolean(_0x3cc415[_0xfe17('0x42')]),'paused':Boolean(_0x3cc415[_0x43a276])};if(_0x28cf0a[_0xfe17('0x42')])_0x32d7b4['loggedInDb']++;_0x32d7b4['agents'][_0xfe17('0x43')](_0x28cf0a);}return _0x32d7b4;});}exports[_0xfe17('0x47')]=function(_0x2d2467,_0x274a21){var _0x301ea7=[_0xfe17('0x48'),_0xfe17('0x49'),_0xfe17('0x4a'),'openchannel','fax',_0xfe17('0x4b'),_0xfe17('0x1f')];var _0x4b291d={'count':0x0,'rows':[]},_0x5ca575={},_0x5174c0,_0xbd1370,_0x357116,_0x4bd74a,_0x2a94cb;Promise[_0xfe17('0x4c')]()[_0xfe17('0x13')](function(){if(_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x4e')]){if(!_[_0xfe17('0x4f')](_0x301ea7,_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x4e')]['toLowerCase']()))throw new Error('Invalid\x20channel');_0x5174c0=_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x4e')][_0xfe17('0x50')]();}var _0x185f38=_[_0xfe17('0x16')](_0x5174c0)+_0xfe17('0x51');var _0x53408d=_[_0xfe17('0x2f')](db[_0x185f38][_0xfe17('0x52')],function(_0x2fa1a3){return{'name':_0x2fa1a3[_0xfe17('0x53')],'type':_0x2fa1a3[_0xfe17('0x54')][_0xfe17('0x55')]};});_0x5ca575=qs['getOptions'](_0x53408d,_0x2d2467);if(_0x2d2467[_0xfe17('0x56')]['role']==='user'){var _0x3fd6d6={'params':{'id':_0x2d2467[_0xfe17('0x56')][_0xfe17('0x57')]},'query':{'section':_0x5174c0===_0xfe17('0x1f')&&_0x2d2467['query'][_0xfe17('0x54')]===_0xfe17('0x33')?_0xfe17('0x58'):_[_0xfe17('0x16')](_0x5174c0)+_0xfe17('0x17'),'type':_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x54')],'nolimit':!![],'sort':_0xfe17('0xe'),'filter':_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x36')]}};return db[_0xfe17('0x59')][_0xfe17('0x5a')](_0x3fd6d6);}return db[_0x185f38]['findAndCountAll'](_0x5ca575);})[_0xfe17('0x13')](function(_0x6dce48){_0x4b291d[_0xfe17('0x9')]=_0x6dce48[_0xfe17('0x9')];_0xbd1370=_0x6dce48[_0xfe17('0x5b')];return getRealtimeQueues(_0x2d2467,_0x5174c0);})['then'](function(_0x51f137){_0x4bd74a=_0x51f137[_0xfe17('0x5b')];return getRealtimeAgents();})['then'](function(_0x22e93b){_0x357116=_0x22e93b[_0xfe17('0x5b')];if(_0x5174c0!=_0xfe17('0x1f'))return;return getRealtimeVoiceQueueChannels();})[_0xfe17('0x13')](function(_0x560e20){_0x2a94cb=_0x560e20?_0x560e20['rows']:[];return initializeQueues(_0xbd1370,_0x4bd74a,_0x5174c0,_0x2d2467[_0xfe17('0x4d')][_0xfe17('0x54')]);})['then'](function(_0x42116e){var _0x596bf7=_0x42116e['map'](function(_0x57a11a){if(_0x5174c0==='voice')return getVoiceQueueAgents(_0x57a11a,_0xbd1370,_0x357116,_0x2a94cb);else return getQueueAgents(_0x57a11a,_0x357116,_0x5174c0);});return Promise['all'](_0x596bf7);})[_0xfe17('0x13')](function(_0x346c9){_0x4b291d[_0xfe17('0x5b')]=_0x346c9;return _0x4b291d;})[_0xfe17('0x13')](respondWithFilteredResult(_0x274a21,_0x5ca575))[_0xfe17('0x15')](handleError(_0x274a21,null));}; \ No newline at end of file +var _0x94de=['rawAttributes','fieldName','type','user','outbound','QueueCampaigns','Queues','getResources','findAndCountAll','rows','util','lodash','../../components/parsers/qs','api','client','http','undefined','count','offset','limit','status','Content-Range','json','error','stack','name','send','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','push','pTalking','message','Trunk','startPredictive','startProgressive','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','paused','loggedInDb','busy','originated','merge','pick','filter','queue','length','some','internal','getMembers','find','UserId','accountcode','voiceStatus','online','User','startCase','Queue','Pause','QueueId','mail','chat','openchannel','fax','whatsapp','resolve','query','channel','toLowerCase','Invalid\x20channel'];(function(_0x59871f,_0x567a60){var _0x166999=function(_0x4f04be){while(--_0x4f04be){_0x59871f['push'](_0x59871f['shift']());}};_0x166999(++_0x567a60);}(_0x94de,0x11e));var _0xe94d=function(_0x489f20,_0x7163b3){_0x489f20=_0x489f20-0x0;var _0x12e1c4=_0x94de[_0x489f20];return _0x12e1c4;};'use strict';var util=require(_0xe94d('0x0'));var _=require(_0xe94d('0x1'));var jayson=require('jayson/promise');var qs=require(_0xe94d('0x2'));var logger=require('../../config/logger')(_0xe94d('0x3'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xe94d('0x4')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xe94d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x44e9b6,_0x335d33){return function(_0x480354){if(_0x480354){var _0x1b90ff=typeof _0x335d33['offset']===_0xe94d('0x6')&&typeof _0x335d33['limit']===_0xe94d('0x6');var _0xb2fa53=_0x480354[_0xe94d('0x7')];var _0x56df24=_0x1b90ff?0x0:_0x335d33[_0xe94d('0x8')];var _0x9d8a32=_0x1b90ff?_0x480354[_0xe94d('0x7')]:_0x335d33['offset']+_0x335d33[_0xe94d('0x9')];var _0x4fbf64;if(_0x9d8a32>=_0xb2fa53){_0x9d8a32=_0xb2fa53;_0x4fbf64=0xc8;}else{_0x4fbf64=0xce;}_0x44e9b6[_0xe94d('0xa')](_0x4fbf64);return _0x44e9b6['set'](_0xe94d('0xb'),_0x56df24+'-'+_0x9d8a32+'/'+_0xb2fa53)[_0xe94d('0xc')](_0x480354);}return null;};}function handleError(_0x2f4b06,_0x150834){_0x150834=_0x150834||0x1f4;return function(_0x1da3c2){logger[_0xe94d('0xd')](_0x1da3c2[_0xe94d('0xe')]);if(_0x1da3c2['name']){delete _0x1da3c2[_0xe94d('0xf')];}_0x2f4b06['status'](_0x150834)[_0xe94d('0x10')](_0x1da3c2);};}function getRealtimeAgents(){return new Promise(function(_0xb327be,_0x2e5eed){return amiClient['request'](_0xe94d('0x11'),{})['then'](function(_0x4cbfaa){if(_0x4cbfaa[_0xe94d('0xd')])throw new Error(_0xe94d('0x12'));var _0x292f41=_0x4cbfaa['result'];return routingClient[_0xe94d('0x13')](_0xe94d('0x11'),{})[_0xe94d('0x14')](function(_0xf67904){if(_0xf67904['error'])throw new Error(_0xe94d('0x15'));var _0x57bb90=_0xf67904['result'];return _0xb327be(_['merge']({},_0x292f41,_0x57bb90));});})[_0xe94d('0x16')](function(_0x24d812){_0x2e5eed(_0x24d812);});});}function getRealtimeQueues(_0xf51996,_0xbf75e0){return new Promise(function(_0x5102e6,_0x957ce1){var _0x5d2ae9=_0xbf75e0===_0xe94d('0x17')?amiClient:routingClient;return _0x5d2ae9[_0xe94d('0x13')](_['startCase'](_0xbf75e0)+'Queues',_0xf51996)[_0xe94d('0x14')](function(_0xec513){if(_0xec513[_0xe94d('0xd')])throw new Error(util[_0xe94d('0x18')](_0xe94d('0x19'),_0xbf75e0));return _0x5102e6(_0xec513['result']);})['catch'](function(_0x3b4be5){_0x957ce1(_0x3b4be5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5ad8e6,_0xa0dfbe){return amiClient['request']('VoiceQueuesChannels',{})[_0xe94d('0x14')](function(_0x9b1cad){if(_0x9b1cad[_0xe94d('0xd')])throw new Error(_0xe94d('0x1a'));return _0x5ad8e6(_0x9b1cad[_0xe94d('0x1b')]);})[_0xe94d('0x16')](function(_0x1bcbac){_0xa0dfbe(_0x1bcbac);});});}function initializeQueues(_0x4abb64,_0xcc3387,_0x3560e9,_0x53380e){var _0x911a82=[_0xe94d('0x1c'),_0xe94d('0x1d'),_0xe94d('0x1e'),_0xe94d('0x1f'),'paused'];if(_0x3560e9===_0xe94d('0x17')&&_0x53380e==='outbound'){_0x911a82[_0xe94d('0x20')](_0xe94d('0x21'),'originated',_0xe94d('0x22'),'dialActive','dialMethod',_0xe94d('0x23'),_0xe94d('0x24'),_0xe94d('0x25'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0xe94d('0x26'),'dialPredictiveInterval',_0xe94d('0x27'),_0xe94d('0x28'),_0xe94d('0x29'),_0xe94d('0x2a'),_0xe94d('0x2b'),_0xe94d('0x2c'),_0xe94d('0x2d'),_0xe94d('0x2e'),'predictiveIntervalAvgTalktime');}return _0x4abb64[_0xe94d('0x2f')](function(_0x5acb5e){var _0x4f64b3=_0x5acb5e[_0xe94d('0x30')]({'plain':!![]});_0x4f64b3[_0xe94d('0x31')]=[];_0x4f64b3[_0xe94d('0x32')]=0x0;_0x4f64b3[_0xe94d('0x33')]=0x0;_0x4f64b3[_0xe94d('0x1c')]=0x0;_0x4f64b3[_0xe94d('0x1d')]=0x0;_0x4f64b3['waiting']=0x0;if(_0x3560e9==='voice'){_0x4f64b3[_0xe94d('0x1f')]=0x0;_0x4f64b3[_0xe94d('0x34')]=0x0;if(_0x53380e==='outbound'){_0x4f64b3[_0xe94d('0x21')]=0x0;_0x4f64b3[_0xe94d('0x35')]=0x0;}}var _0x3a255b=_['find'](_0xcc3387,['id',_0x4f64b3['id']]);if(_0x3a255b)_[_0xe94d('0x36')](_0x4f64b3,_[_0xe94d('0x37')](_0x3a255b,_0x911a82));return _0x4f64b3;});}function updateAgentVoiceStatus(_0x27c23e,_0x3dbec,_0x520d12){var _0x50620f=_[_0xe94d('0x38')](_0x520d12,[_0xe94d('0x39'),_0x3dbec['name']]);if(_0x50620f[_0xe94d('0x3a')]===0x0)return _0x27c23e[_0xe94d('0x34')]=!![];if(_[_0xe94d('0x3b')](_0x50620f,['connectedlinenum',_0x27c23e[_0xe94d('0x3c')]['toString']()]))return _0x27c23e['talking']=!![];if(!_0x27c23e[_0xe94d('0x1f')])return _0x27c23e[_0xe94d('0x34')]=!![];}function getVoiceQueueAgents(_0x2b0d28,_0x300ede,_0x1f8d21,_0x15968a){var _0x17789b=_['find'](_0x300ede,['id',_0x2b0d28['id']]);if(!_0x17789b)return _0x2b0d28;return _0x17789b[_0xe94d('0x3d')]({'raw':!![]})['then'](function(_0x47fbad){for(var _0x1854fd=0x0;_0x1854fd<_0x47fbad[_0xe94d('0x3a')];_0x1854fd++){var _0x5d0f5a=_[_0xe94d('0x3e')](_0x1f8d21,['id',_0x47fbad[_0x1854fd][_0xe94d('0x3f')]]);if(!_0x5d0f5a){_0x5d0f5a={'id':_0x47fbad[_0x1854fd][_0xe94d('0x3f')],'name':_0x47fbad[_0x1854fd][_0xe94d('0x3f')],'accountcode':'','online':![]};}var _0x1de120={'id':_0x5d0f5a['id'],'name':_0x5d0f5a['name'],'internal':_0x5d0f5a[_0xe94d('0x40')],'online':Boolean(_0x5d0f5a['online']),'paused':Boolean(_0x47fbad[_0x1854fd][_0xe94d('0x32')])};if(_0x5d0f5a[_0xe94d('0x41')]===_0xe94d('0x1f'))updateAgentVoiceStatus(_0x1de120,_0x2b0d28,_0x15968a);if(_0x1de120[_0xe94d('0x42')])_0x2b0d28[_0xe94d('0x33')]++;if(_0x1de120[_0xe94d('0x34')])_0x2b0d28[_0xe94d('0x34')]++;if(_0x1de120['paused']&&!_0x1de120[_0xe94d('0x34')]&&!_0x1de120[_0xe94d('0x1f')])_0x2b0d28[_0xe94d('0x32')]++;_0x2b0d28[_0xe94d('0x31')]['push'](_0x1de120);}return _0x2b0d28;});}function getQueueAgents(_0x3ce723,_0x1a5f5d,_0x5344b1){var _0x226cff=_0xe94d('0x43')+_[_0xe94d('0x44')](_0x5344b1)+_0xe94d('0x45');var _0xa52197=_0x5344b1+_0xe94d('0x46');return db[_0x226cff]['findAll']({'where':{[_[_0xe94d('0x44')](_0x5344b1)+_0xe94d('0x47')]:_0x3ce723['id']},'raw':!![]})[_0xe94d('0x14')](function(_0x33abf9){for(var _0x35da68=0x0;_0x35da68<_0x33abf9[_0xe94d('0x3a')];_0x35da68++){var _0x445f16=_[_0xe94d('0x3e')](_0x1a5f5d,['id',_0x33abf9[_0x35da68][_0xe94d('0x3f')]]);if(!_0x445f16){_0x445f16={'id':_0x33abf9[_0x35da68][_0xe94d('0x3f')],'name':_0x33abf9[_0x35da68]['UserId'],'online':![],['pauseField']:![]};}var _0x3c3e8f={'id':_0x445f16['id'],'name':_0x445f16[_0xe94d('0xf')],'online':Boolean(_0x445f16[_0xe94d('0x42')]),'paused':Boolean(_0x445f16[_0xa52197])};if(_0x3c3e8f['online'])_0x3ce723[_0xe94d('0x33')]++;_0x3ce723[_0xe94d('0x31')][_0xe94d('0x20')](_0x3c3e8f);}return _0x3ce723;});}exports['getQueues']=function(_0x286479,_0x32c1c1){var _0x1fa5f8=[_0xe94d('0x48'),_0xe94d('0x49'),'sms',_0xe94d('0x4a'),_0xe94d('0x4b'),_0xe94d('0x4c'),_0xe94d('0x17')];var _0xe333b={'count':0x0,'rows':[]},_0x33b1cb={},_0x2e6672,_0x4eab67,_0x1fc9ce,_0x467a53,_0x251969;Promise[_0xe94d('0x4d')]()[_0xe94d('0x14')](function(){if(_0x286479[_0xe94d('0x4e')][_0xe94d('0x4f')]){if(!_['includes'](_0x1fa5f8,_0x286479[_0xe94d('0x4e')][_0xe94d('0x4f')][_0xe94d('0x50')]()))throw new Error(_0xe94d('0x51'));_0x2e6672=_0x286479[_0xe94d('0x4e')][_0xe94d('0x4f')]['toLowerCase']();}var _0x1dac0c=_[_0xe94d('0x44')](_0x2e6672)+'Queue';var _0x7c7063=_[_0xe94d('0x2f')](db[_0x1dac0c][_0xe94d('0x52')],function(_0xad8235){return{'name':_0xad8235[_0xe94d('0x53')],'type':_0xad8235[_0xe94d('0x54')]['key']};});_0x33b1cb=qs['getOptions'](_0x7c7063,_0x286479);if(_0x286479['user']['role']===_0xe94d('0x55')){var _0x4a284d={'params':{'id':_0x286479['user']['userProfileId']},'query':{'section':_0x2e6672==='voice'&&_0x286479['query'][_0xe94d('0x54')]===_0xe94d('0x56')?_0xe94d('0x57'):_[_0xe94d('0x44')](_0x2e6672)+_0xe94d('0x58'),'type':_0x286479['query']['type'],'nolimit':!![],'sort':_0xe94d('0xf'),'filter':_0x286479[_0xe94d('0x4e')][_0xe94d('0x38')]}};return db['UserProfile'][_0xe94d('0x59')](_0x4a284d);}return db[_0x1dac0c][_0xe94d('0x5a')](_0x33b1cb);})[_0xe94d('0x14')](function(_0x55f2ab){_0xe333b['count']=_0x55f2ab[_0xe94d('0x7')];_0x4eab67=_0x55f2ab['rows'];return getRealtimeQueues(_0x286479,_0x2e6672);})[_0xe94d('0x14')](function(_0x407025){_0x467a53=_0x407025['rows'];return getRealtimeAgents();})[_0xe94d('0x14')](function(_0x372e4a){_0x1fc9ce=_0x372e4a['rows'];if(_0x2e6672!=_0xe94d('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0xe94d('0x14')](function(_0x15eb35){_0x251969=_0x15eb35?_0x15eb35[_0xe94d('0x5b')]:[];return initializeQueues(_0x4eab67,_0x467a53,_0x2e6672,_0x286479[_0xe94d('0x4e')][_0xe94d('0x54')]);})[_0xe94d('0x14')](function(_0x30a79c){var _0x58dab8=_0x30a79c[_0xe94d('0x2f')](function(_0x3c0dc1){if(_0x2e6672===_0xe94d('0x17'))return getVoiceQueueAgents(_0x3c0dc1,_0x4eab67,_0x1fc9ce,_0x251969);else return getQueueAgents(_0x3c0dc1,_0x1fc9ce,_0x2e6672);});return Promise['all'](_0x58dab8);})[_0xe94d('0x14')](function(_0x3a08a1){_0xe333b[_0xe94d('0x5b')]=_0x3a08a1;return _0xe333b;})[_0xe94d('0x14')](respondWithFilteredResult(_0x32c1c1,_0x33b1cb))[_0xe94d('0x16')](handleError(_0x32c1c1,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 01db59b..ae5632d 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x12699c,_0xf9dd49){var _0x54360e=function(_0xa4d495){while(--_0xa4d495){_0x12699c['push'](_0x12699c['shift']());}};_0x54360e(++_0xf9dd49);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2c5b68,_0xa9e2cc){var _0x360a55=function(_0x30a067){while(--_0x30a067){_0x2c5b68['push'](_0x2c5b68['shift']());}};_0x360a55(++_0xa9e2cc);}(_0xedd9,0xfc));var _0x9edd=function(_0x198344,_0xe08e99){_0x198344=_0x198344-0x0;var _0x582b54=_0xedd9[_0x198344];return _0x582b54;};'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 57ffe1c..4b99f48 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 _0x1419=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x1419,0x127));var _0x9141=function(_0x2e7773,_0x287c4b){_0x2e7773=_0x2e7773-0x0;var _0x4dd5e1=_0x1419[_0x2e7773];return _0x4dd5e1;};'use strict';var Sequelize=require(_0x9141('0x0'));module[_0x9141('0x1')]={'state':{'type':Sequelize[_0x9141('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9141('0x3')]},'scheduledat':{'type':Sequelize[_0x9141('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9141('0x4')]},'ringtime':{'type':Sequelize[_0x9141('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9141('0x3')]}}; \ No newline at end of file +var _0x1298=['DATE','INTEGER','exports','STRING'];(function(_0x457885,_0x3507c9){var _0x1dcb08=function(_0x2f0fd5){while(--_0x2f0fd5){_0x457885['push'](_0x457885['shift']());}};_0x1dcb08(++_0x3507c9);}(_0x1298,0x19e));var _0x8129=function(_0x775916,_0x195559){_0x775916=_0x775916-0x0;var _0x3280e7=_0x1298[_0x775916];return _0x3280e7;};'use strict';var Sequelize=require('sequelize');module[_0x8129('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8129('0x1')]},'scheduledat':{'type':Sequelize[_0x8129('0x2')]},'uniqueid':{'type':Sequelize[_0x8129('0x1')]},'starttime':{'type':Sequelize[_0x8129('0x2')]},'responsetime':{'type':Sequelize[_0x8129('0x2')]},'ringtime':{'type':Sequelize[_0x8129('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8129('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8129('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8a5d510..4f3906e 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 _0x8f7b=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x7b3297,_0x23fec0){var _0x1f077d=function(_0x567e56){while(--_0x567e56){_0x7b3297['push'](_0x7b3297['shift']());}};_0x1f077d(++_0x23fec0);}(_0x8f7b,0x14c));var _0xb8f7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8f7b[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xb8f7('0x0'));var util=require(_0xb8f7('0x1'));var logger=require(_0xb8f7('0x2'))('api');var moment=require(_0xb8f7('0x3'));var BPromise=require(_0xb8f7('0x4'));var rp=require(_0xb8f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8f7('0x6'));var config=require(_0xb8f7('0x7'));var attributes=require(_0xb8f7('0x8'));module[_0xb8f7('0x9')]=function(_0x411f54,_0x5e6152){return _0x411f54[_0xb8f7('0xa')](_0xb8f7('0xb'),attributes,{'tableName':_0xb8f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe73c=['api','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util'];(function(_0x4b7331,_0x3f05b3){var _0x59190f=function(_0x4cd57b){while(--_0x4cd57b){_0x4b7331['push'](_0x4b7331['shift']());}};_0x59190f(++_0x3f05b3);}(_0xe73c,0x127));var _0xce73=function(_0x274956,_0x376a35){_0x274956=_0x274956-0x0;var _0x190035=_0xe73c[_0x274956];return _0x190035;};'use strict';var _=require(_0xce73('0x0'));var util=require(_0xce73('0x1'));var logger=require('../../config/logger')(_0xce73('0x2'));var moment=require('moment');var BPromise=require(_0xce73('0x3'));var rp=require(_0xce73('0x4'));var fs=require('fs');var path=require(_0xce73('0x5'));var rimraf=require('rimraf');var config=require(_0xce73('0x6'));var attributes=require(_0xce73('0x7'));module[_0xce73('0x8')]=function(_0x2ee281,_0xebdbd4){return _0x2ee281[_0xce73('0x9')]('ReportAgentPreview',attributes,{'tableName':_0xce73('0xa'),'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 c648224..2f516ff 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 _0x06ba=['info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request'];(function(_0x49a14d,_0xba785f){var _0x7ed203=function(_0x11bed3){while(--_0x11bed3){_0x49a14d['push'](_0x49a14d['shift']());}};_0x7ed203(++_0xba785f);}(_0x06ba,0x11f));var _0xa06b=function(_0x6d40a0,_0x583de2){_0x6d40a0=_0x6d40a0-0x0;var _0x3fd18b=_0x06ba[_0x6d40a0];return _0x3fd18b;};'use strict';var _=require(_0xa06b('0x0'));var util=require(_0xa06b('0x1'));var moment=require(_0xa06b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa06b('0x3'));var db=require(_0xa06b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa06b('0x5'))(_0xa06b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa06b('0x7')][_0xa06b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36ca37,_0x2a9970,_0x77fbd9){return new BPromise(function(_0x393b84,_0x370572){return client[_0xa06b('0x9')](_0x36ca37,_0x77fbd9)['then'](function(_0x3b8bd4){logger[_0xa06b('0xa')](_0xa06b('0xb'),_0x2a9970,_0xa06b('0xc'));logger[_0xa06b('0xd')](_0xa06b('0xe'),_0x2a9970,_0xa06b('0xc'),JSON[_0xa06b('0xf')](_0x3b8bd4));if(_0x3b8bd4['error']){if(_0x3b8bd4[_0xa06b('0x10')]['code']===0x1f4){logger['error'](_0xa06b('0xb'),_0x2a9970,_0x3b8bd4[_0xa06b('0x10')][_0xa06b('0x11')]);return _0x370572(_0x3b8bd4['error'][_0xa06b('0x11')]);}logger[_0xa06b('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2a9970,_0x3b8bd4[_0xa06b('0x10')][_0xa06b('0x11')]);return _0x393b84(_0x3b8bd4[_0xa06b('0x10')][_0xa06b('0x11')]);}else{logger[_0xa06b('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x2a9970,_0xa06b('0xc'));_0x393b84(_0x3b8bd4[_0xa06b('0x12')]['message']);}})[_0xa06b('0x13')](function(_0x1ac455){logger[_0xa06b('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2a9970,_0x1ac455);_0x370572(_0x1ac455);});});}exports[_0xa06b('0x14')]=function(_0x20ed07){var _0x2639e0=this;return new Promise(function(_0x39949c,_0x3e9125){return db[_0xa06b('0x15')][_0xa06b('0x16')](_0x20ed07[_0xa06b('0x17')],{'raw':_0x20ed07[_0xa06b('0x18')]?_0x20ed07[_0xa06b('0x18')][_0xa06b('0x19')]===undefined?!![]:![]:!![]})[_0xa06b('0x1a')](function(_0x1cd952){logger[_0xa06b('0xa')](_0xa06b('0x14'),_0x20ed07);logger[_0xa06b('0xd')]('CreateReportAgentPreview',_0x20ed07,JSON[_0xa06b('0xf')](_0x1cd952));_0x39949c(_0x1cd952);})[_0xa06b('0x13')](function(_0x1d75c9){logger[_0xa06b('0x10')](_0xa06b('0x14'),_0x1d75c9[_0xa06b('0x11')],_0x20ed07);_0x3e9125(_0x2639e0[_0xa06b('0x10')](0x1f4,_0x1d75c9[_0xa06b('0x11')]));});});}; \ No newline at end of file +var _0xef15=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','create','body','options','raw','then','CreateReportAgentPreview','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xef15,0x81));var _0x5ef1=function(_0x453016,_0x2bd244){_0x453016=_0x453016-0x0;var _0x3352f5=_0xef15[_0x453016];return _0x3352f5;};'use strict';var _=require(_0x5ef1('0x0'));var util=require(_0x5ef1('0x1'));var moment=require(_0x5ef1('0x2'));var BPromise=require(_0x5ef1('0x3'));var rs=require(_0x5ef1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ef1('0x5'))['db'];var utils=require(_0x5ef1('0x6'));var logger=require(_0x5ef1('0x7'))(_0x5ef1('0x8'));var config=require(_0x5ef1('0x9'));var jayson=require(_0x5ef1('0xa'));var client=jayson[_0x5ef1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1629,_0x1c3dc4,_0x1cb2a4){return new BPromise(function(_0x23eb91,_0x3a57a3){return client['request'](_0x2f1629,_0x1cb2a4)['then'](function(_0x1044a6){logger[_0x5ef1('0xc')](_0x5ef1('0xd'),_0x1c3dc4,'request\x20sent');logger[_0x5ef1('0xe')](_0x5ef1('0xf'),_0x1c3dc4,_0x5ef1('0x10'),JSON['stringify'](_0x1044a6));if(_0x1044a6[_0x5ef1('0x11')]){if(_0x1044a6['error'][_0x5ef1('0x12')]===0x1f4){logger[_0x5ef1('0x11')](_0x5ef1('0xd'),_0x1c3dc4,_0x1044a6[_0x5ef1('0x11')][_0x5ef1('0x13')]);return _0x3a57a3(_0x1044a6[_0x5ef1('0x11')][_0x5ef1('0x13')]);}logger['error'](_0x5ef1('0xd'),_0x1c3dc4,_0x1044a6['error'][_0x5ef1('0x13')]);return _0x23eb91(_0x1044a6[_0x5ef1('0x11')]['message']);}else{logger[_0x5ef1('0xc')](_0x5ef1('0xd'),_0x1c3dc4,_0x5ef1('0x10'));_0x23eb91(_0x1044a6['result']['message']);}})['catch'](function(_0x2deb6a){logger['error'](_0x5ef1('0xd'),_0x1c3dc4,_0x2deb6a);_0x3a57a3(_0x2deb6a);});});}exports['CreateReportAgentPreview']=function(_0x358537){var _0x41e673=this;return new Promise(function(_0x43af5f,_0x45f803){return db['ReportAgentPreview'][_0x5ef1('0x14')](_0x358537[_0x5ef1('0x15')],{'raw':_0x358537[_0x5ef1('0x16')]?_0x358537[_0x5ef1('0x16')][_0x5ef1('0x17')]===undefined?!![]:![]:!![]})[_0x5ef1('0x18')](function(_0x512826){logger[_0x5ef1('0xc')]('CreateReportAgentPreview',_0x358537);logger['debug'](_0x5ef1('0x19'),_0x358537,JSON[_0x5ef1('0x1a')](_0x512826));_0x43af5f(_0x512826);})['catch'](function(_0x5de9f1){logger[_0x5ef1('0x11')](_0x5ef1('0x19'),_0x5de9f1['message'],_0x358537);_0x45f803(_0x41e673[_0x5ef1('0x11')](0x1f4,_0x5de9f1[_0x5ef1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c758309..2717858 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 _0xfe79=['mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','util','path','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts'];(function(_0x40c252,_0x3a18cc){var _0x4f5e01=function(_0x6ef1ed){while(--_0x6ef1ed){_0x40c252['push'](_0x40c252['shift']());}};_0x4f5e01(++_0x3a18cc);}(_0xfe79,0x160));var _0x9fe7=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xfe79[_0x552fce];return _0x3e27a2;};'use strict';var multer=require('multer');var util=require(_0x9fe7('0x0'));var path=require(_0x9fe7('0x1'));var express=require('express');var router=express[_0x9fe7('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0x9fe7('0x3'));router[_0x9fe7('0x4')](_0x9fe7('0x5'),auth['isAuthenticated'](),controller[_0x9fe7('0x6')]);router[_0x9fe7('0x4')](_0x9fe7('0x7'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x9fe7('0x4')](_0x9fe7('0x8'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0xa')]);router[_0x9fe7('0x4')](_0x9fe7('0xb'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0xc')]);router[_0x9fe7('0x4')](_0x9fe7('0xd'),auth['isAuthenticated'](),controller[_0x9fe7('0xe')]);router[_0x9fe7('0x4')](_0x9fe7('0xf'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x10')]);router[_0x9fe7('0x4')](_0x9fe7('0x11'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x12')]);router['get'](_0x9fe7('0x13'),auth[_0x9fe7('0x9')](),controller['openchannelQueues']);router[_0x9fe7('0x4')](_0x9fe7('0x14'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x15')]);router[_0x9fe7('0x4')]('/whatsapp/queues',auth[_0x9fe7('0x9')](),controller['whatsappQueues']);router['get'](_0x9fe7('0x16'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x17')]);router[_0x9fe7('0x4')](_0x9fe7('0x18'),auth['isAuthenticated'](),controller[_0x9fe7('0x19')]);router[_0x9fe7('0x4')](_0x9fe7('0x1a'),auth[_0x9fe7('0x9')](),controller['voiceQueuesChannels']);router[_0x9fe7('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x9fe7('0x4')](_0x9fe7('0x1b'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x1c')]);router['get'](_0x9fe7('0x1d'),auth[_0x9fe7('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0x9fe7('0x4')](_0x9fe7('0x1e'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x1f')]);router[_0x9fe7('0x20')]('/voice/queues/:id',auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x21')]);router[_0x9fe7('0x4')](_0x9fe7('0x22'),auth[_0x9fe7('0x9')](),controller['outbound']);router['get'](_0x9fe7('0x23'),auth[_0x9fe7('0x9')](),controller['outboundChannels']);router[_0x9fe7('0x4')](_0x9fe7('0x24'),auth['isAuthenticated'](),controller[_0x9fe7('0x25')]);router[_0x9fe7('0x20')](_0x9fe7('0x26'),auth['isAuthenticated'](),controller[_0x9fe7('0x27')]);router[_0x9fe7('0x4')](_0x9fe7('0x28'),auth[_0x9fe7('0x9')](),controller['telephones']);router[_0x9fe7('0x4')](_0x9fe7('0x29'),auth[_0x9fe7('0x9')](),controller['trunks']);router[_0x9fe7('0x4')](_0x9fe7('0x2a'),auth['isAuthenticated'](),controller['campaigns']);router['get']('/fax/accounts',auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x2b')]);router[_0x9fe7('0x4')]('/chat/queues/waitinginteractions',auth[_0x9fe7('0x9')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x9fe7('0x2c'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x2d')]);router[_0x9fe7('0x4')](_0x9fe7('0x2e'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x2f')]);router[_0x9fe7('0x4')](_0x9fe7('0x30'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x31')]);router['get'](_0x9fe7('0x32'),auth[_0x9fe7('0x9')](),controller['smsQueuesWaitingInteractions']);router['get'](_0x9fe7('0x33'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x34')]);router[_0x9fe7('0x4')]('/fax/queues/waitinginteractions',auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x35')]);router[_0x9fe7('0x36')]('/mail/queues/:id/notify',auth[_0x9fe7('0x9')](),controller['queueNotify'](_0x9fe7('0x37')));router['get'](_0x9fe7('0x38'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x39')]);router[_0x9fe7('0x36')](_0x9fe7('0x3a'),auth[_0x9fe7('0x9')](),controller['queueNotify']('chat'));router[_0x9fe7('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x9fe7('0x36')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('fax'));router[_0x9fe7('0x4')](_0x9fe7('0x3b'),auth[_0x9fe7('0x9')](),controller['showFaxQueues']);router[_0x9fe7('0x36')](_0x9fe7('0x3c'),auth[_0x9fe7('0x9')](),controller['queueNotify'](_0x9fe7('0x3d')));router[_0x9fe7('0x4')](_0x9fe7('0x3e'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x3f')]);router[_0x9fe7('0x36')](_0x9fe7('0x40'),auth[_0x9fe7('0x9')](),controller['queueNotify'](_0x9fe7('0x41')));router[_0x9fe7('0x36')](_0x9fe7('0x42'),auth[_0x9fe7('0x9')](),controller['queueNotify'](_0x9fe7('0x43')));router[_0x9fe7('0x4')](_0x9fe7('0x44'),auth['isAuthenticated'](),controller[_0x9fe7('0x45')]);router['get'](_0x9fe7('0x46'),auth[_0x9fe7('0x9')](),controller[_0x9fe7('0x47')]);router[_0x9fe7('0x36')](_0x9fe7('0x48'),auth[_0x9fe7('0x9')](),controller['agentNotify']);module[_0x9fe7('0x49')]=router; \ No newline at end of file +var _0x4e96=['sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x9adbf8,_0x48ecb8){var _0x58528c=function(_0x50680a){while(--_0x50680a){_0x9adbf8['push'](_0x9adbf8['shift']());}};_0x58528c(++_0x48ecb8);}(_0x4e96,0x1a1));var _0x64e9=function(_0x2fa39b,_0xdd322f){_0x2fa39b=_0x2fa39b-0x0;var _0xfb015a=_0x4e96[_0x2fa39b];return _0xfb015a;};'use strict';var multer=require(_0x64e9('0x0'));var util=require(_0x64e9('0x1'));var path=require(_0x64e9('0x2'));var express=require('express');var router=express[_0x64e9('0x3')]();var auth=require(_0x64e9('0x4'));var controller=require(_0x64e9('0x5'));router[_0x64e9('0x6')](_0x64e9('0x7'),auth[_0x64e9('0x8')](),controller['voiceChannels']);router['get'](_0x64e9('0x9'),auth[_0x64e9('0x8')](),controller['voiceChannelMixMonitor']);router[_0x64e9('0x6')](_0x64e9('0xa'),auth[_0x64e9('0x8')](),controller[_0x64e9('0xb')]);router[_0x64e9('0x6')](_0x64e9('0xc'),auth['isAuthenticated'](),controller[_0x64e9('0xd')]);router[_0x64e9('0x6')]('/chat/queues',auth[_0x64e9('0x8')](),controller[_0x64e9('0xe')]);router[_0x64e9('0x6')](_0x64e9('0xf'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x64e9('0x6')](_0x64e9('0x10'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x11')]);router[_0x64e9('0x6')](_0x64e9('0x12'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x13')]);router['get'](_0x64e9('0x14'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x15')]);router['get'](_0x64e9('0x16'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x17')]);router[_0x64e9('0x6')](_0x64e9('0x18'),auth['isAuthenticated'](),controller[_0x64e9('0x19')]);router['get'](_0x64e9('0x1a'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x1b')]);router[_0x64e9('0x6')](_0x64e9('0x1c'),auth[_0x64e9('0x8')](),controller['voiceQueuesChannels']);router[_0x64e9('0x6')](_0x64e9('0x1d'),auth[_0x64e9('0x8')](),controller['voiceQueuesChannel']);router[_0x64e9('0x6')](_0x64e9('0x1e'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x64e9('0x6')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x64e9('0x20')]);router['put'](_0x64e9('0x21'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x22')]);router[_0x64e9('0x6')]('/outbound',auth[_0x64e9('0x8')](),controller['outbound']);router[_0x64e9('0x6')](_0x64e9('0x23'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x24')]);router[_0x64e9('0x6')](_0x64e9('0x25'),auth['isAuthenticated'](),controller[_0x64e9('0x26')]);router[_0x64e9('0x27')](_0x64e9('0x28'),auth['isAuthenticated'](),controller[_0x64e9('0x29')]);router[_0x64e9('0x6')](_0x64e9('0x2a'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x2b')]);router[_0x64e9('0x6')]('/trunks',auth[_0x64e9('0x8')](),controller[_0x64e9('0x2c')]);router[_0x64e9('0x6')](_0x64e9('0x2d'),auth[_0x64e9('0x8')](),controller['campaigns']);router[_0x64e9('0x6')](_0x64e9('0x2e'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x2f')]);router[_0x64e9('0x6')](_0x64e9('0x30'),auth['isAuthenticated'](),controller[_0x64e9('0x31')]);router['get'](_0x64e9('0x32'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x33')]);router[_0x64e9('0x6')](_0x64e9('0x34'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x35')]);router[_0x64e9('0x6')](_0x64e9('0x36'),auth[_0x64e9('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x64e9('0x6')](_0x64e9('0x37'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x38')]);router[_0x64e9('0x6')](_0x64e9('0x39'),auth['isAuthenticated'](),controller[_0x64e9('0x3a')]);router['get'](_0x64e9('0x3b'),auth[_0x64e9('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x64e9('0x3c')](_0x64e9('0x3d'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x3e')]('mail'));router[_0x64e9('0x6')](_0x64e9('0x3f'),auth['isAuthenticated'](),controller[_0x64e9('0x40')]);router[_0x64e9('0x3c')]('/chat/queues/:id/notify',auth[_0x64e9('0x8')](),controller[_0x64e9('0x3e')](_0x64e9('0x41')));router['get']('/chat/queues/:id',auth[_0x64e9('0x8')](),controller[_0x64e9('0x42')]);router[_0x64e9('0x3c')](_0x64e9('0x43'),auth['isAuthenticated'](),controller[_0x64e9('0x3e')](_0x64e9('0x44')));router[_0x64e9('0x6')](_0x64e9('0x45'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x46')]);router[_0x64e9('0x3c')](_0x64e9('0x47'),auth['isAuthenticated'](),controller['queueNotify'](_0x64e9('0x48')));router[_0x64e9('0x6')]('/openchannel/queues/:id',auth[_0x64e9('0x8')](),controller[_0x64e9('0x49')]);router[_0x64e9('0x3c')](_0x64e9('0x4a'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x3e')](_0x64e9('0x4b')));router[_0x64e9('0x3c')](_0x64e9('0x4c'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x3e')](_0x64e9('0x4d')));router[_0x64e9('0x6')](_0x64e9('0x4e'),auth[_0x64e9('0x8')](),controller[_0x64e9('0x4f')]);router[_0x64e9('0x6')]('/whatsapp/queues/:id',auth[_0x64e9('0x8')](),controller['showWhatsappQueues']);router[_0x64e9('0x3c')](_0x64e9('0x50'),auth[_0x64e9('0x8')](),controller['agentNotify']);module[_0x64e9('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 7013382..283283f 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 _0x46ed=['send','isNil','rows','VoiceChannels','query','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','\x20Message\x20not\x20found','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','name'];(function(_0x197b75,_0x30748e){var _0x8271f5=function(_0xddf6){while(--_0xddf6){_0x197b75['push'](_0x197b75['shift']());}};_0x8271f5(++_0x30748e);}(_0x46ed,0x168));var _0xd46e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46ed[_0x12fc8d];return _0x3f9d04;};'use strict';var BPromise=require(_0xd46e('0x0'));var moment=require(_0xd46e('0x1'));var _=require('lodash');var util=require(_0xd46e('0x2'));var db=require(_0xd46e('0x3'))['db'];var logger=require(_0xd46e('0x4'))('api');var jayson=require(_0xd46e('0x5'));var amiClient=jayson[_0xd46e('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232b});var routingClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){var _0x19e4f4=_0x437ea0?_0x437ea0:amiClient;return _0x19e4f4[_0xd46e('0x8')](_0x45e680,_0x855f24)['then'](function(_0x7b2d69){if(_0x7b2d69[_0xd46e('0x9')]){if(_0x7b2d69['error'][_0xd46e('0xa')]===0x1f4){return _0x31259b(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}return _0x144687(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}else{_0x144687(_0x7b2d69[_0xd46e('0xc')]);}})['catch'](function(_0x24c54b){_0x31259b(_0x24c54b);});});}function respondWithResult(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xc8;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0xd')](_0x48550b)['json'](_0xf3048c);}return _0x5bc1da['sendStatus'](0x194);};}function handleError(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0x1f4;return function(_0x1e9aae){logger[_0xd46e('0x9')](_0x1e9aae['stack']);if(_0x1e9aae[_0xd46e('0xe')]){delete _0x1e9aae[_0xd46e('0xe')];}_0xacd799[_0xd46e('0xd')](_0x4688ae)[_0xd46e('0xf')](_0x1e9aae);};}function findById(_0x36a317){return function(_0x47fa8f){if(!_[_0xd46e('0x10')](_0x36a317)&&!_[_0xd46e('0x10')](_0x47fa8f)&&!_[_0xd46e('0x10')](_0x47fa8f['rows'])){return _['find'](_0x47fa8f[_0xd46e('0x11')],function(_0x1bd574){return _0x1bd574['id']==_0x36a317;});}return null;};}exports['voiceChannels']=function(_0x4fd1f2,_0x2d6f2c){return respondWithRpcPromise(_0xd46e('0x12'),_0x4fd1f2[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x2d6f2c,null))[_0xd46e('0x15')](handleError(_0x2d6f2c,null));};exports[_0xd46e('0x16')]=function(_0x3b5fa4,_0x327b7e){return respondWithRpcPromise(_0xd46e('0x17'),_[_0xd46e('0x18')](_0x3b5fa4[_0xd46e('0x13')],_0x3b5fa4['params']))[_0xd46e('0x14')](respondWithResult(_0x327b7e,null))[_0xd46e('0x15')](handleError(_0x327b7e,null));};exports[_0xd46e('0x19')]=function(_0x45ce0b,_0x128246){return respondWithRpcPromise(_0xd46e('0x1a'),_[_0xd46e('0x18')](_0x45ce0b[_0xd46e('0x13')],_0x45ce0b[_0xd46e('0x1b')]))['then'](respondWithResult(_0x128246,null))[_0xd46e('0x15')](handleError(_0x128246,null));};exports['voiceQueues']=function(_0x4b8f6a,_0x371054){return respondWithRpcPromise(_0xd46e('0x1c'),_0x4b8f6a[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x371054,null))[_0xd46e('0x15')](handleError(_0x371054,null));};exports[_0xd46e('0x1d')]=function(_0x1740d1,_0x4dab6a){return respondWithRpcPromise(_0xd46e('0x1c'),_0x1740d1[_0xd46e('0x13')])[_0xd46e('0x14')](findById(_0x1740d1[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4dab6a,null))[_0xd46e('0x15')](handleError(_0x4dab6a,null));};exports['updateVoiceQueue']=function(_0x465d54,_0x3a1ced){return respondWithRpcPromise(_0xd46e('0x1e'),_[_0xd46e('0x18')](_0x465d54[_0xd46e('0x1f')],_0x465d54[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x3a1ced,null))[_0xd46e('0x15')](handleError(_0x3a1ced,null));};exports[_0xd46e('0x20')]=function(_0x45ea47,_0x2ff785){return respondWithRpcPromise(_0xd46e('0x21'),_[_0xd46e('0x18')](_0x45ea47['query'],_0x45ea47[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x2ff785,null))[_0xd46e('0x15')](handleError(_0x2ff785,null));};exports[_0xd46e('0x22')]=function(_0x5ef248,_0x2eed3a){return respondWithRpcPromise(_0xd46e('0x23'),_0x5ef248['query'])[_0xd46e('0x14')](respondWithResult(_0x2eed3a,null))[_0xd46e('0x15')](handleError(_0x2eed3a,null));};exports['voiceQueuesChannel']=function(_0x306458,_0x1c15c9){return respondWithRpcPromise(_0xd46e('0x24'),_['merge'](_0x306458['query'],_0x306458[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x1c15c9,null))[_0xd46e('0x15')](handleError(_0x1c15c9,null));};exports[_0xd46e('0x25')]=function(_0x83526a,_0x423de9){return respondWithRpcPromise(_0xd46e('0x26'),_[_0xd46e('0x18')](_0x83526a['query'],_0x83526a[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x423de9,null))[_0xd46e('0x15')](handleError(_0x423de9,null));};exports[_0xd46e('0x27')]=function(_0x1fa66c,_0x1e0897){return respondWithRpcPromise(_0xd46e('0x28'),_['merge'](_0x1fa66c[_0xd46e('0x13')],_0x1fa66c[_0xd46e('0x1b')]))['then'](respondWithResult(_0x1e0897,null))[_0xd46e('0x15')](handleError(_0x1e0897,null));};exports[_0xd46e('0x29')]=function(_0x12ccf8,_0x3b6e67){return respondWithRpcPromise('Outbound',_0x12ccf8[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x3b6e67,null))[_0xd46e('0x15')](handleError(_0x3b6e67,null));};exports[_0xd46e('0x2a')]=function(_0xefe5f4,_0x1f58ad){return respondWithRpcPromise(_0xd46e('0x2b'),_0xefe5f4[_0xd46e('0x13')])['then'](respondWithResult(_0x1f58ad,null))[_0xd46e('0x15')](handleError(_0x1f58ad,null));};exports[_0xd46e('0x2c')]=function(_0xc83ea1,_0x25657a){var _0x165ce8;return respondWithRpcPromise('Agents',_0xc83ea1[_0xd46e('0x13')])['then'](function(_0x55230d){_0x165ce8=_0x55230d;return respondWithRpcPromise('Agents',_0xc83ea1['query'],routingClient);})[_0xd46e('0x14')](function(_0x54949f){return _[_0xd46e('0x18')]({},_0x54949f,_0x165ce8);})[_0xd46e('0x14')](respondWithResult(_0x25657a,null))['catch'](handleError(_0x25657a,null));};exports[_0xd46e('0x2d')]=function(_0x4114e6,_0x3bd5e9){if(_0x4114e6[_0xd46e('0x1f')]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')]&&_0x4114e6[_0xd46e('0x2f')]&&_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]){for(var _0xec367d in _0x4114e6[_0xd46e('0x1f')]['interaction']){if(_0x4114e6['body']['interaction'][_0xd46e('0x30')](_0xec367d)){db['MemberReport'][_0xd46e('0x31')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':_0xd46e('0x32'),'exitAt':null,'uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]['length']?{'$notIn':_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d]}:{'$ne':null}}})[_0xd46e('0x14')](function(_0x196e51){var _0x41a983=moment()[_0xd46e('0x33')](_0xd46e('0x34'));for(var _0x5d65ca=0x0,_0x384b6e=_0x196e51[_0xd46e('0x35')];_0x5d65ca<_0x384b6e;_0x5d65ca+=0x1){_0x196e51[_0x5d65ca][_0xd46e('0x36')]({'exitAt':_0x41a983});}});for(var _0xac268d=0x0;_0xac268d<_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d][_0xd46e('0x35')];_0xac268d+=0x1){db[_0xd46e('0x37')][_0xd46e('0x38')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':'INTERACTION','uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d][_0xac268d],'exitAt':null},'defaults':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'interface':_[_0xd46e('0x10')](_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')])?util[_0xd46e('0x33')]('SIP/%s',_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]):_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')],'type':_0xd46e('0x32'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd46e('0x3a'),'internal':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x3b')],'uniqueid':_0x4114e6['body']['interaction'][_0xec367d][_0xac268d]}});}}}}return respondWithRpcPromise(_0xd46e('0x3c'),{'id':_0x4114e6[_0xd46e('0x1b')]['id'],'capacity':_0x4114e6['body'][_0xd46e('0x3d')]},routingClient)[_0xd46e('0x14')](respondWithResult(_0x3bd5e9,null))[_0xd46e('0x15')](handleError(_0x3bd5e9,null));};exports[_0xd46e('0x3e')]=function(_0x1bd8a5,_0x34d4ca){return respondWithRpcPromise(_0xd46e('0x3f'),_0x1bd8a5[_0xd46e('0x13')])['then'](respondWithResult(_0x34d4ca,null))[_0xd46e('0x15')](handleError(_0x34d4ca,null));};exports[_0xd46e('0x40')]=function(_0x1c7f92,_0x63ee74){return respondWithRpcPromise('Trunks',_0x1c7f92['query'])[_0xd46e('0x14')](respondWithResult(_0x63ee74,null))['catch'](handleError(_0x63ee74,null));};exports[_0xd46e('0x41')]=function(_0x2af20b,_0x393cb9){return respondWithRpcPromise(_0xd46e('0x42'),_0x2af20b[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x393cb9,null))['catch'](handleError(_0x393cb9,null));};exports[_0xd46e('0x43')]=function(_0x354739,_0x51f45a){return respondWithRpcPromise('ChatQueues',_0x354739[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x51f45a,null))[_0xd46e('0x15')](handleError(_0x51f45a,null));};exports[_0xd46e('0x44')]=function(_0x1886e6,_0x2cc676){return respondWithRpcPromise(_0xd46e('0x45'),_0x1886e6[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x1886e6[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x2cc676,null))[_0xd46e('0x15')](handleError(_0x2cc676,null));};exports[_0xd46e('0x46')]=function(_0x402df2,_0x47a86c){return respondWithRpcPromise(_0xd46e('0x47'),_0x402df2[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x47a86c,null))[_0xd46e('0x15')](handleError(_0x47a86c,null));};exports['showMailQueues']=function(_0x636f15,_0x36e18a){return respondWithRpcPromise(_0xd46e('0x47'),_0x636f15[_0xd46e('0x13')],routingClient)['then'](findById(_0x636f15[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x36e18a,null))['catch'](handleError(_0x36e18a,null));};exports['mailAccounts']=function(_0x45e102,_0xd59920){return respondWithRpcPromise(_0xd46e('0x48'),_0x45e102['query'],mailClient)['then'](respondWithResult(_0xd59920,null))[_0xd46e('0x15')](handleError(_0xd59920,null));};exports[_0xd46e('0x49')]=function(_0x1f310d,_0x263425){return respondWithRpcPromise(_0xd46e('0x4a'),_0x1f310d[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x263425,null))[_0xd46e('0x15')](handleError(_0x263425,null));};exports[_0xd46e('0x4b')]=function(_0x2a172c,_0x4af44){return respondWithRpcPromise(_0xd46e('0x4a'),_0x2a172c[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2a172c[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4af44,null))['catch'](handleError(_0x4af44,null));};exports[_0xd46e('0x4c')]=function(_0x1a3771,_0x3a2dec){return respondWithRpcPromise('SmsQueues',_0x1a3771[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x3a2dec,null))['catch'](handleError(_0x3a2dec,null));};exports[_0xd46e('0x4d')]=function(_0x2c86fe,_0x1801d4){return respondWithRpcPromise('SmsQueues',_0x2c86fe[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2c86fe[_0xd46e('0x1b')]['id']))['then'](respondWithResult(_0x1801d4,null))[_0xd46e('0x15')](handleError(_0x1801d4,null));};exports['whatsappQueues']=function(_0x32eed0,_0x148187){return respondWithRpcPromise(_0xd46e('0x4e'),_0x32eed0['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x148187,null))[_0xd46e('0x15')](handleError(_0x148187,null));};exports[_0xd46e('0x4f')]=function(_0xbce76f,_0x502f37){return respondWithRpcPromise(_0xd46e('0x4e'),_0xbce76f[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0xbce76f[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x502f37,null))[_0xd46e('0x15')](handleError(_0x502f37,null));};exports[_0xd46e('0x50')]=function(_0x41057c,_0x24be84){return respondWithRpcPromise('FaxQueues',_0x41057c['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x24be84,null))[_0xd46e('0x15')](handleError(_0x24be84,null));};exports[_0xd46e('0x51')]=function(_0x2fff69,_0x249938){return respondWithRpcPromise('FaxQueues',_0x2fff69[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2fff69[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x249938,null))['catch'](handleError(_0x249938,null));};exports[_0xd46e('0x52')]=function(_0x9dd439,_0x5a36df){return respondWithRpcPromise(_0xd46e('0x53'),_0x9dd439[_0xd46e('0x13')])['then'](respondWithResult(_0x5a36df,null))[_0xd46e('0x15')](handleError(_0x5a36df,null));};exports[_0xd46e('0x54')]=function(_0x566e65,_0x44ba36){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x566e65[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x44ba36,null))['catch'](handleError(_0x44ba36,null));};exports['mailQueuesWaitingInteractions']=function(_0x475133,_0x3eb6b){return respondWithRpcPromise(_0xd46e('0x55'),_0x475133[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x3eb6b,null))[_0xd46e('0x15')](handleError(_0x3eb6b,null));};exports[_0xd46e('0x56')]=function(_0x510a1e,_0x10bcdb){return respondWithRpcPromise(_0xd46e('0x57'),_0x510a1e[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x10bcdb,null))[_0xd46e('0x15')](handleError(_0x10bcdb,null));};exports[_0xd46e('0x58')]=function(_0x21f193,_0xaf7c79){return respondWithRpcPromise(_0xd46e('0x57'),_0x21f193['query'],routingClient)[_0xd46e('0x14')](function(_0x1c1bae){if(_0x21f193['query'][_0xd46e('0x59')]!==undefined){var _0x3ba83f=_(_0x1c1bae[_0xd46e('0x11')])[_0xd46e('0x5a')]([_0x21f193[_0xd46e('0x13')][_0xd46e('0x59')],_0x21f193['params']['id']])['map'](_0xd46e('0x5b'))[_0xd46e('0x5c')]()['value']();return _0x1c1bae['rows']['filter'](function(_0x825746){return _0x3ba83f[_0xd46e('0x5d')](_0x825746[_0xd46e('0x5b')])>-0x1;});}else{return _0x1c1bae['rows'][_0xd46e('0x5a')](function(_0x69ade9){return _0x69ade9[_0xd46e('0x5b')]===parseInt(_0x21f193['params']['id']);});}})['then'](respondWithResult(_0xaf7c79,null))['catch'](handleError(_0xaf7c79,null));};exports['smsQueuesWaitingInteractions']=function(_0x2d4410,_0x5d7c51){return respondWithRpcPromise(_0xd46e('0x5e'),_0x2d4410['query'],routingClient)['then'](respondWithResult(_0x5d7c51,null))[_0xd46e('0x15')](handleError(_0x5d7c51,null));};exports[_0xd46e('0x5f')]=function(_0x3df2c2,_0x2754ff){return respondWithRpcPromise(_0xd46e('0x60'),_0x3df2c2[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x2754ff,null))['catch'](handleError(_0x2754ff,null));};exports[_0xd46e('0x61')]=function(_0x383919,_0x114f2c){return respondWithRpcPromise(_0xd46e('0x62'),_0x383919['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x114f2c,null))[_0xd46e('0x15')](handleError(_0x114f2c,null));};exports['queueNotify']=function(_0x1309b5){return function(_0x483ef1,_0x2abaee){var _0x24a2e1,_0x5b54b6;var _0x59fb83=_[_0xd46e('0x63')](_0x1309b5);var _0x2c11b8=_0x1309b5===_0xd46e('0x64')?'Website':_0xd46e('0x65');return db[_0x59fb83+_0xd46e('0x66')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x483ef1[_0xd46e('0x1b')]['id']}})[_0xd46e('0x14')](function(_0x88460a){if(_[_0xd46e('0x10')](_0x88460a)){throw new Error(_0x59fb83+_0xd46e('0x68'));}_0x24a2e1=_0x88460a;return db[_0x59fb83+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x483ef1[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x59fb83+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x59fb83+_0x2c11b8],'as':_0xd46e('0x65')}]});})[_0xd46e('0x14')](function(_0x441f73){if(_[_0xd46e('0x10')](_0x441f73)){throw new Error(_0x59fb83+'\x20Message\x20not\x20found');}_0x5b54b6=_0x441f73;return _0x441f73[_0xd46e('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3436ff={'uniqueid':_0x1309b5+'.'+_0x5b54b6['id']+'.'+_0x5b54b6[_0xd46e('0x6b')]['id'],'FromUserId':_0x483ef1['user']['id'],'type':_0xd46e('0x6d')};_0x3436ff[_0x59fb83+_0xd46e('0x6e')]=_0x5b54b6['id'];_0x3436ff[_0x59fb83+_0xd46e('0x6f')]=_0x5b54b6[_0xd46e('0x6b')]['id'];_0x3436ff[_0xd46e('0x70')+_0x59fb83+_0x2c11b8+'Id']=_0x5b54b6[_0xd46e('0x65')]['id'];_0x3436ff['To'+_0x59fb83+_0xd46e('0x71')]=_0x24a2e1['id'];return db[_0x59fb83+_0xd46e('0x72')][_0xd46e('0x73')](_0x3436ff);})[_0xd46e('0x14')](function(){return respondWithRpcPromise(_0xd46e('0x74'),{'channel':_0x1309b5,'interaction':_0x5b54b6['Interaction'],'message':_0x5b54b6,'account':_0x5b54b6['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd46e('0x6d'),'appdata':_0x24a2e1[_0xd46e('0xe')]+','+(_0x5b54b6[_0xd46e('0x65')][_0xd46e('0x75')]||0x12c),'interval':_0xd46e('0x76')}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0x2abaee,null))['catch'](handleError(_0x2abaee,null));};};exports[_0xd46e('0x77')]=function(_0x127604,_0xa254f5){var _0x2c9703,_0x41443d;if(_[_0xd46e('0x10')](_0x127604['body'][_0xd46e('0x78')])){throw new Error(_0xd46e('0x79'));}var _0x59067a=_0x127604[_0xd46e('0x1f')][_0xd46e('0x78')];var _0x9e222d=_[_0xd46e('0x63')](_0x59067a);var _0x97ee80=_0x59067a===_0xd46e('0x64')?_0xd46e('0x7a'):_0xd46e('0x65');return db[_0xd46e('0x7b')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x127604[_0xd46e('0x1b')]['id'],'role':_0xd46e('0x3a')}})[_0xd46e('0x14')](function(_0x30dcfc){if(_['isNil'](_0x30dcfc)){throw new Error('Agent\x20not\x20found');}_0x2c9703=_0x30dcfc;return db[_0x9e222d+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x127604[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x9e222d+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x9e222d+_0x97ee80],'as':'Account'}]});})[_0xd46e('0x14')](function(_0x216143){if(_[_0xd46e('0x10')](_0x216143)){throw new Error(_0x9e222d+_0xd46e('0x7c'));}_0x41443d=_0x216143;return _0x216143['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd46e('0x14')](function(){var _0x191b48={'uniqueid':_0x59067a+'.'+_0x41443d['id']+'.'+_0x41443d['Interaction']['id'],'FromUserId':_0x127604[_0xd46e('0x2f')]['id'],'type':'queue','ToUserId':_0x2c9703['id']};_0x191b48[_0x9e222d+'MessageId']=_0x41443d['id'];_0x191b48[_0x9e222d+_0xd46e('0x6f')]=_0x41443d[_0xd46e('0x6b')]['id'];_0x191b48[_0xd46e('0x70')+_0x9e222d+_0x97ee80+'Id']=_0x41443d[_0xd46e('0x65')]['id'];return db[_0x9e222d+'TransferReport']['create'](_0x191b48);})[_0xd46e('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x59067a,'interaction':_0x41443d[_0xd46e('0x6b')],'message':_0x41443d,'account':_0x41443d['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2c9703[_0xd46e('0xe')]+','+(_0x41443d[_0xd46e('0x65')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0xa254f5,null))[_0xd46e('0x15')](handleError(_0xa254f5,null));}; \ No newline at end of file +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(_0x12ceba,_0x59ba15){var _0x36c243=function(_0x4f44c9){while(--_0x4f44c9){_0x12ceba['push'](_0x12ceba['shift']());}};_0x36c243(++_0x59ba15);}(_0xf494,0x1c6));var _0x4f49=function(_0x6143bc,_0x547322){_0x6143bc=_0x6143bc-0x0;var _0x277165=_0xf494[_0x6143bc];return _0x277165;};'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 diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 478809e..087b22f 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 _0x604a=['run','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','show'];(function(_0x17d3b5,_0x14b8ee){var _0x9fd48c=function(_0x2ab07b){while(--_0x2ab07b){_0x17d3b5['push'](_0x17d3b5['shift']());}};_0x9fd48c(++_0x14b8ee);}(_0x604a,0xc6));var _0xa604=function(_0xb51d19,_0x59726f){_0xb51d19=_0xb51d19-0x0;var _0x342019=_0x604a[_0xb51d19];return _0x342019;};'use strict';var multer=require('multer');var util=require(_0xa604('0x0'));var path=require(_0xa604('0x1'));var timeout=require(_0xa604('0x2'));var express=require('express');var router=express[_0xa604('0x3')]();var fs_extra=require(_0xa604('0x4'));var auth=require(_0xa604('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa604('0x6'));var controller=require(_0xa604('0x7'));router[_0xa604('0x8')]('/',auth[_0xa604('0x9')](),controller['index']);router[_0xa604('0x8')]('/:id',auth[_0xa604('0x9')](),controller[_0xa604('0xa')]);router['get']('/:id/run',auth[_0xa604('0x9')](),controller[_0xa604('0xb')]);router[_0xa604('0xc')]('/',auth['isAuthenticated'](),controller[_0xa604('0xd')]);router[_0xa604('0xe')]('/:id',auth[_0xa604('0x9')](),controller['update']);router[_0xa604('0xf')](_0xa604('0x10'),auth[_0xa604('0x9')](),controller[_0xa604('0x11')]);module[_0xa604('0x12')]=router; \ No newline at end of file +var _0x58a9=['index','/:id','show','/:id/run','run','create','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated'];(function(_0x35bf2f,_0x11b61a){var _0x16b650=function(_0x294ceb){while(--_0x294ceb){_0x35bf2f['push'](_0x35bf2f['shift']());}};_0x16b650(++_0x11b61a);}(_0x58a9,0x129));var _0x958a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58a9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x958a('0x0'));var path=require('path');var timeout=require(_0x958a('0x1'));var express=require(_0x958a('0x2'));var router=express[_0x958a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x958a('0x4'));var interaction=require(_0x958a('0x5'));var config=require(_0x958a('0x6'));var controller=require(_0x958a('0x7'));router['get']('/',auth[_0x958a('0x8')](),controller[_0x958a('0x9')]);router['get'](_0x958a('0xa'),auth[_0x958a('0x8')](),controller[_0x958a('0xb')]);router['get'](_0x958a('0xc'),auth[_0x958a('0x8')](),controller[_0x958a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x958a('0xe')]);router['put'](_0x958a('0xa'),auth[_0x958a('0x8')](),controller[_0x958a('0xf')]);router[_0x958a('0x10')](_0x958a('0xa'),auth[_0x958a('0x8')](),controller['destroy']);module[_0x958a('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 523530c..8bc7699 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 _0x5c91=['ENUM','years','weeks','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x46083a,_0x3956de){var _0x5adc2d=function(_0x221b1b){while(--_0x221b1b){_0x46083a['push'](_0x46083a['shift']());}};_0x5adc2d(++_0x3956de);}(_0x5c91,0x15f));var _0x15c9=function(_0x473155,_0x2f4730){_0x473155=_0x473155-0x0;var _0x57525a=_0x5c91[_0x473155];return _0x57525a;};'use strict';var Sequelize=require(_0x15c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x15c9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15c9('0x1')]},'active':{'type':Sequelize[_0x15c9('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15c9('0x3')},'startAt':{'type':Sequelize[_0x15c9('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x15c9('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x15c9('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x15c9('0x6')](_0x15c9('0x7'),'quarters','months',_0x15c9('0x8'),_0x15c9('0x9'),'hours',_0x15c9('0xa')),'allowNull':![],'defaultValue':_0x15c9('0x9')},'output':{'type':Sequelize[_0x15c9('0x6')](_0x15c9('0xb'),_0x15c9('0xc'),_0x15c9('0xd')),'allowNull':![],'defaultValue':_0x15c9('0xb')},'type':{'type':Sequelize[_0x15c9('0x6')](_0x15c9('0xe'),_0x15c9('0xf')),'allowNull':![],'defaultValue':_0x15c9('0xe')},'sendMail':{'type':Sequelize[_0x15c9('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x15c9('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5f75=['DATE','INTEGER','ENUM','years','quarters','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x5f75,0x1b6));var _0x55f7=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x5f75[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x55f7('0x0'));module[_0x55f7('0x1')]={'name':{'type':Sequelize[_0x55f7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x55f7('0x2')]},'active':{'type':Sequelize[_0x55f7('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x55f7('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x55f7('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x55f7('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x55f7('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x55f7('0x6')](_0x55f7('0x7'),_0x55f7('0x8'),'months','weeks','days','hours',_0x55f7('0x9')),'allowNull':![],'defaultValue':_0x55f7('0xa')},'output':{'type':Sequelize['ENUM'](_0x55f7('0xb'),_0x55f7('0xc'),_0x55f7('0xd')),'allowNull':![],'defaultValue':_0x55f7('0xb')},'type':{'type':Sequelize[_0x55f7('0x6')](_0x55f7('0xe'),_0x55f7('0xf')),'allowNull':![],'defaultValue':_0x55f7('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x55f7('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x55f7('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x55f7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 971d63a..ecf9c32 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 _0xc28c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring'];(function(_0x2ab089,_0x45501d){var _0x58ba09=function(_0xb7cb3a){while(--_0xb7cb3a){_0x2ab089['push'](_0x2ab089['shift']());}};_0x58ba09(++_0x45501d);}(_0xc28c,0x151));var _0xcc28=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xc28c[_0x16aaef];return _0x1c82ef;};'use strict';var emlformat=require(_0xcc28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc28('0x2'));var Mustache=require(_0xcc28('0x3'));var util=require(_0xcc28('0x4'));var path=require(_0xcc28('0x5'));var sox=require(_0xcc28('0x6'));var csv=require(_0xcc28('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc28('0x8'));var squel=require('squel');var crypto=require(_0xcc28('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcc28('0x7'));var querystring=require(_0xcc28('0xa'));var Papa=require(_0xcc28('0xb'));var Redis=require(_0xcc28('0xc'));var authService=require(_0xcc28('0xd'));var qs=require(_0xcc28('0xe'));var as=require(_0xcc28('0xf'));var hardwareService=require(_0xcc28('0x10'));var logger=require(_0xcc28('0x11'))(_0xcc28('0x12'));var utils=require(_0xcc28('0x13'));var config=require(_0xcc28('0x14'));var licenseUtil=require(_0xcc28('0x15'));var db=require(_0xcc28('0x16'))['db'];function respondWithStatusCode(_0x440b8e,_0xa05abb){_0xa05abb=_0xa05abb||0xcc;return function(_0x9e7c38){if(_0x9e7c38){return _0x440b8e[_0xcc28('0x17')](_0xa05abb);}return _0x440b8e[_0xcc28('0x18')](_0xa05abb)[_0xcc28('0x19')]();};}function respondWithResult(_0x3befeb,_0x5141c8){_0x5141c8=_0x5141c8||0xc8;return function(_0xcaa6d3){if(_0xcaa6d3){return _0x3befeb[_0xcc28('0x18')](_0x5141c8)[_0xcc28('0x1a')](_0xcaa6d3);}};}function respondWithFilteredResult(_0x4cd24a,_0x33fffa){return function(_0x2c47bf){if(_0x2c47bf){var _0x5dd99e=typeof _0x33fffa[_0xcc28('0x1b')]===_0xcc28('0x1c')&&typeof _0x33fffa[_0xcc28('0x1d')]==='undefined';var _0x344a31=_0x2c47bf['count'];var _0x310963=_0x5dd99e?0x0:_0x33fffa[_0xcc28('0x1b')];var _0x333c5f=_0x5dd99e?_0x2c47bf[_0xcc28('0x1e')]:_0x33fffa[_0xcc28('0x1b')]+_0x33fffa[_0xcc28('0x1d')];var _0x3f1352;if(_0x333c5f>=_0x344a31){_0x333c5f=_0x344a31;_0x3f1352=0xc8;}else{_0x3f1352=0xce;}_0x4cd24a[_0xcc28('0x18')](_0x3f1352);return _0x4cd24a[_0xcc28('0x1f')]('Content-Range',_0x310963+'-'+_0x333c5f+'/'+_0x344a31)['json'](_0x2c47bf);}return null;};}function patchUpdates(_0x44af43){return function(_0x54fd45){try{jsonpatch[_0xcc28('0x20')](_0x54fd45,_0x44af43,!![]);}catch(_0x57ec76){return BPromise[_0xcc28('0x21')](_0x57ec76);}return _0x54fd45[_0xcc28('0x22')]();};}function saveUpdates(_0x2811ab,_0x39ac0a){return function(_0x3df398){if(_0x3df398){return _0x3df398[_0xcc28('0x23')](_0x2811ab)[_0xcc28('0x24')](function(_0x4ad10f){return _0x4ad10f;});}return null;};}function removeEntity(_0x9def47,_0x1d7e86){return function(_0x5e7793){if(_0x5e7793){return _0x5e7793[_0xcc28('0x25')]()['then'](function(){var _0x55eaac=_0x5e7793['get']({'plain':!![]});var _0xa696fe=_0xcc28('0x26');return db[_0xcc28('0x27')]['destroy']({'where':{'type':_0xa696fe,'resourceId':_0x55eaac['id']}})[_0xcc28('0x24')](function(){return _0x5e7793;});})[_0xcc28('0x24')](function(){_0x9def47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eb6d1,_0x3ffdaf){return function(_0x1d33c2){if(!_0x1d33c2){_0x2eb6d1['sendStatus'](0x194);}return _0x1d33c2;};}function handleError(_0x59944e,_0x540dbd){_0x540dbd=_0x540dbd||0x1f4;return function(_0x516272){logger[_0xcc28('0x28')](_0x516272[_0xcc28('0x29')]);if(_0x516272[_0xcc28('0x2a')]){delete _0x516272[_0xcc28('0x2a')];}_0x59944e[_0xcc28('0x18')](_0x540dbd)[_0xcc28('0x2b')](_0x516272);};}exports[_0xcc28('0x2c')]=function(_0x59fc59,_0x2aabb0){var _0x5e0e32={},_0x187cf7={},_0x47a850={'count':0x0,'rows':[]};var _0x52b818=_[_0xcc28('0x2d')](db[_0xcc28('0x2e')][_0xcc28('0x2f')],function(_0x2b4a41){return{'name':_0x2b4a41[_0xcc28('0x30')],'type':_0x2b4a41['type'][_0xcc28('0x31')]};});_0x187cf7['model']=_[_0xcc28('0x2d')](_0x52b818,_0xcc28('0x2a'));_0x187cf7[_0xcc28('0x32')]=_[_0xcc28('0x33')](_0x59fc59[_0xcc28('0x32')]);_0x187cf7[_0xcc28('0x34')]=_[_0xcc28('0x35')](_0x187cf7[_0xcc28('0x36')],_0x187cf7[_0xcc28('0x32')]);_0x5e0e32[_0xcc28('0x37')]=_[_0xcc28('0x35')](_0x187cf7[_0xcc28('0x36')],qs[_0xcc28('0x38')](_0x59fc59['query']['fields']));_0x5e0e32['attributes']=_0x5e0e32[_0xcc28('0x37')]['length']?_0x5e0e32[_0xcc28('0x37')]:_0x187cf7['model'];if(!_0x59fc59[_0xcc28('0x32')]['hasOwnProperty'](_0xcc28('0x39'))){_0x5e0e32[_0xcc28('0x1d')]=qs[_0xcc28('0x1d')](_0x59fc59[_0xcc28('0x32')]['limit']);_0x5e0e32[_0xcc28('0x1b')]=qs[_0xcc28('0x1b')](_0x59fc59['query'][_0xcc28('0x1b')]);}_0x5e0e32[_0xcc28('0x3a')]=qs[_0xcc28('0x3b')](_0x59fc59['query'][_0xcc28('0x3b')]);_0x5e0e32[_0xcc28('0x3c')]=qs[_0xcc28('0x34')](_[_0xcc28('0x3d')](_0x59fc59[_0xcc28('0x32')],_0x187cf7[_0xcc28('0x34')]),_0x52b818);if(_0x59fc59[_0xcc28('0x32')][_0xcc28('0x3e')]){_0x5e0e32['where']=_[_0xcc28('0x3f')](_0x5e0e32[_0xcc28('0x3c')],{'$or':_['map'](_0x52b818,function(_0x52ea33){if(_0x52ea33[_0xcc28('0x40')]!==_0xcc28('0x41')){var _0x4f7050={};_0x4f7050[_0x52ea33['name']]={'$like':'%'+_0x59fc59['query'][_0xcc28('0x3e')]+'%'};return _0x4f7050;}})});}_0x5e0e32=_['merge']({},_0x5e0e32,_0x59fc59[_0xcc28('0x42')]);var _0xd05731={'where':_0x5e0e32[_0xcc28('0x3c')]};return db['Schedule'][_0xcc28('0x1e')](_0xd05731)[_0xcc28('0x24')](function(_0x2b2cb9){_0x47a850['count']=_0x2b2cb9;if(_0x59fc59[_0xcc28('0x32')]['includeAll']){_0x5e0e32[_0xcc28('0x43')]=[{'all':!![]}];}return db[_0xcc28('0x2e')][_0xcc28('0x44')](_0x5e0e32);})[_0xcc28('0x24')](function(_0xd667bc){_0x47a850[_0xcc28('0x45')]=_0xd667bc;return _0x47a850;})[_0xcc28('0x24')](respondWithFilteredResult(_0x2aabb0,_0x5e0e32))[_0xcc28('0x46')](handleError(_0x2aabb0,null));};exports[_0xcc28('0x47')]=function(_0x8d80d7,_0x1d6bda){var _0x6f7513={'raw':![],'where':{'id':_0x8d80d7[_0xcc28('0x48')]['id']}},_0x4ba09e={};_0x4ba09e[_0xcc28('0x36')]=_[_0xcc28('0x33')](db[_0xcc28('0x2e')]['rawAttributes']);_0x4ba09e[_0xcc28('0x32')]=_['keys'](_0x8d80d7[_0xcc28('0x32')]);_0x4ba09e[_0xcc28('0x34')]=_[_0xcc28('0x35')](_0x4ba09e[_0xcc28('0x36')],_0x4ba09e[_0xcc28('0x32')]);_0x6f7513[_0xcc28('0x37')]=_[_0xcc28('0x35')](_0x4ba09e[_0xcc28('0x36')],qs['fields'](_0x8d80d7[_0xcc28('0x32')][_0xcc28('0x38')]));_0x6f7513[_0xcc28('0x37')]=_0x6f7513[_0xcc28('0x37')][_0xcc28('0x49')]?_0x6f7513[_0xcc28('0x37')]:_0x4ba09e[_0xcc28('0x36')];if(_0x8d80d7['query'][_0xcc28('0x4a')]){_0x6f7513['include']=[{'all':!![]}];}_0x6f7513=_[_0xcc28('0x3f')]({},_0x6f7513,_0x8d80d7[_0xcc28('0x42')]);return db[_0xcc28('0x2e')][_0xcc28('0x4b')](_0x6f7513)[_0xcc28('0x24')](handleEntityNotFound(_0x1d6bda,null))['then'](respondWithResult(_0x1d6bda,null))[_0xcc28('0x46')](handleError(_0x1d6bda,null));};exports['create']=function(_0x399fd1,_0x5e6992){return db['Schedule']['create'](_0x399fd1['body'],{})[_0xcc28('0x24')](function(_0x4fe4c7){var _0x10a0c7=_0x399fd1[_0xcc28('0x4c')][_0xcc28('0x4d')]({'plain':!![]});if(!_0x10a0c7)throw new Error(_0xcc28('0x4e'));if(_0x10a0c7[_0xcc28('0x4f')]===_0xcc28('0x4c')){var _0x4db458=_0x4fe4c7['get']({'plain':!![]});var _0x105d75=_0xcc28('0x26');return db['UserProfileSection'][_0xcc28('0x4b')]({'where':{'name':_0x105d75,'userProfileId':_0x10a0c7[_0xcc28('0x50')]},'raw':!![]})[_0xcc28('0x24')](function(_0x31537d){if(_0x31537d&&_0x31537d[_0xcc28('0x51')]===0x0){return db[_0xcc28('0x27')][_0xcc28('0x52')]({'name':_0x4db458[_0xcc28('0x2a')],'resourceId':_0x4db458['id'],'type':_0x31537d[_0xcc28('0x2a')],'sectionId':_0x31537d['id']},{})[_0xcc28('0x24')](function(){return _0x4fe4c7;});}else{return _0x4fe4c7;}})[_0xcc28('0x46')](function(_0x2a2075){logger[_0xcc28('0x28')](_0xcc28('0x53'),_0x2a2075);throw _0x2a2075;});}return _0x4fe4c7;})['then'](respondWithResult(_0x5e6992,0xc9))['catch'](handleError(_0x5e6992,null));};exports[_0xcc28('0x23')]=function(_0x36f8a3,_0x4c61aa){if(_0x36f8a3[_0xcc28('0x54')]['id']){delete _0x36f8a3[_0xcc28('0x54')]['id'];}return db['Schedule'][_0xcc28('0x4b')]({'where':{'id':_0x36f8a3[_0xcc28('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c61aa,null))[_0xcc28('0x24')](saveUpdates(_0x36f8a3[_0xcc28('0x54')],null))[_0xcc28('0x24')](respondWithResult(_0x4c61aa,null))[_0xcc28('0x46')](handleError(_0x4c61aa,null));};exports[_0xcc28('0x25')]=function(_0x2c0964,_0x3b253e){return db[_0xcc28('0x2e')][_0xcc28('0x4b')]({'where':{'id':_0x2c0964[_0xcc28('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b253e,null))[_0xcc28('0x24')](removeEntity(_0x3b253e,null))[_0xcc28('0x46')](handleError(_0x3b253e,null));};exports['run']=function(_0x503e86,_0x27d4c2,_0x70854b){var _0x2c38b7=require(_0xcc28('0x55'));return db['Schedule'][_0xcc28('0x4b')]({'where':{'id':_0x503e86[_0xcc28('0x48')]['id']},'raw':!![]})[_0xcc28('0x24')](handleEntityNotFound(_0x27d4c2,null))[_0xcc28('0x24')](function(){_0x2c38b7[_0xcc28('0x56')](_0x503e86['params']['id']);})['then'](respondWithStatusCode(_0x27d4c2,null))[_0xcc28('0x46')](handleError(_0x27d4c2,null));}; \ No newline at end of file +var _0x8088=['end','offset','undefined','count','limit','set','json','apply','update','then','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','params','destroy','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x580197,_0xbb7e10){var _0x54a754=function(_0x271e2b){while(--_0x271e2b){_0x580197['push'](_0x580197['shift']());}};_0x54a754(++_0xbb7e10);}(_0x8088,0x87));var _0x8808=function(_0x351ba8,_0x2d53c1){_0x351ba8=_0x351ba8-0x0;var _0x5e33ab=_0x8088[_0x351ba8];return _0x5e33ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8808('0x0'));var zipdir=require(_0x8808('0x1'));var jsonpatch=require(_0x8808('0x2'));var rp=require(_0x8808('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8808('0x4'));var util=require(_0x8808('0x5'));var path=require(_0x8808('0x6'));var sox=require(_0x8808('0x7'));var csv=require(_0x8808('0x8'));var ejs=require(_0x8808('0x9'));var fs=require('fs');var fs_extra=require(_0x8808('0xa'));var _=require('lodash');var squel=require(_0x8808('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8808('0xc'));var toCsv=require(_0x8808('0x8'));var querystring=require(_0x8808('0xd'));var Papa=require(_0x8808('0xe'));var Redis=require('ioredis');var authService=require(_0x8808('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8808('0x10'))(_0x8808('0x11'));var utils=require(_0x8808('0x12'));var config=require(_0x8808('0x13'));var licenseUtil=require(_0x8808('0x14'));var db=require(_0x8808('0x15'))['db'];function respondWithStatusCode(_0x432019,_0x5d18ba){_0x5d18ba=_0x5d18ba||0xcc;return function(_0x1b9f6f){if(_0x1b9f6f){return _0x432019['sendStatus'](_0x5d18ba);}return _0x432019[_0x8808('0x16')](_0x5d18ba)[_0x8808('0x17')]();};}function respondWithResult(_0x23f35e,_0xbb4fba){_0xbb4fba=_0xbb4fba||0xc8;return function(_0x7f7cce){if(_0x7f7cce){return _0x23f35e[_0x8808('0x16')](_0xbb4fba)['json'](_0x7f7cce);}};}function respondWithFilteredResult(_0x25e42a,_0x382a4b){return function(_0x56a65f){if(_0x56a65f){var _0x299c14=typeof _0x382a4b[_0x8808('0x18')]===_0x8808('0x19')&&typeof _0x382a4b['limit']===_0x8808('0x19');var _0x1e71c2=_0x56a65f[_0x8808('0x1a')];var _0x1df2bb=_0x299c14?0x0:_0x382a4b[_0x8808('0x18')];var _0x3c9442=_0x299c14?_0x56a65f['count']:_0x382a4b['offset']+_0x382a4b[_0x8808('0x1b')];var _0x3d401b;if(_0x3c9442>=_0x1e71c2){_0x3c9442=_0x1e71c2;_0x3d401b=0xc8;}else{_0x3d401b=0xce;}_0x25e42a[_0x8808('0x16')](_0x3d401b);return _0x25e42a[_0x8808('0x1c')]('Content-Range',_0x1df2bb+'-'+_0x3c9442+'/'+_0x1e71c2)[_0x8808('0x1d')](_0x56a65f);}return null;};}function patchUpdates(_0x5af5d9){return function(_0x3d4075){try{jsonpatch[_0x8808('0x1e')](_0x3d4075,_0x5af5d9,!![]);}catch(_0x2f0ce1){return BPromise['reject'](_0x2f0ce1);}return _0x3d4075['save']();};}function saveUpdates(_0x7f2fb5,_0xbb5a9b){return function(_0x54269d){if(_0x54269d){return _0x54269d[_0x8808('0x1f')](_0x7f2fb5)[_0x8808('0x20')](function(_0xac07fa){return _0xac07fa;});}return null;};}function removeEntity(_0x1cf530,_0xf941e6){return function(_0x61cd9){if(_0x61cd9){return _0x61cd9['destroy']()['then'](function(){var _0xd1e05b=_0x61cd9['get']({'plain':!![]});var _0x3b5094=_0x8808('0x21');return db[_0x8808('0x22')]['destroy']({'where':{'type':_0x3b5094,'resourceId':_0xd1e05b['id']}})[_0x8808('0x20')](function(){return _0x61cd9;});})[_0x8808('0x20')](function(){_0x1cf530['status'](0xcc)[_0x8808('0x17')]();});}};}function handleEntityNotFound(_0x16bb66,_0x3f92a5){return function(_0x3f7e1a){if(!_0x3f7e1a){_0x16bb66['sendStatus'](0x194);}return _0x3f7e1a;};}function handleError(_0x50a530,_0x41fb92){_0x41fb92=_0x41fb92||0x1f4;return function(_0x27be91){logger[_0x8808('0x23')](_0x27be91[_0x8808('0x24')]);if(_0x27be91[_0x8808('0x25')]){delete _0x27be91['name'];}_0x50a530['status'](_0x41fb92)[_0x8808('0x26')](_0x27be91);};}exports[_0x8808('0x27')]=function(_0x18934b,_0x5dd84d){var _0x52a6bf={},_0x593fc8={},_0x525633={'count':0x0,'rows':[]};var _0x3a8bce=_[_0x8808('0x28')](db[_0x8808('0x29')][_0x8808('0x2a')],function(_0x2c9804){return{'name':_0x2c9804['fieldName'],'type':_0x2c9804[_0x8808('0x2b')][_0x8808('0x2c')]};});_0x593fc8[_0x8808('0x2d')]=_[_0x8808('0x28')](_0x3a8bce,_0x8808('0x25'));_0x593fc8['query']=_[_0x8808('0x2e')](_0x18934b[_0x8808('0x2f')]);_0x593fc8['filters']=_[_0x8808('0x30')](_0x593fc8[_0x8808('0x2d')],_0x593fc8['query']);_0x52a6bf[_0x8808('0x31')]=_[_0x8808('0x30')](_0x593fc8[_0x8808('0x2d')],qs['fields'](_0x18934b[_0x8808('0x2f')][_0x8808('0x32')]));_0x52a6bf[_0x8808('0x31')]=_0x52a6bf[_0x8808('0x31')][_0x8808('0x33')]?_0x52a6bf[_0x8808('0x31')]:_0x593fc8[_0x8808('0x2d')];if(!_0x18934b['query'][_0x8808('0x34')](_0x8808('0x35'))){_0x52a6bf['limit']=qs[_0x8808('0x1b')](_0x18934b[_0x8808('0x2f')][_0x8808('0x1b')]);_0x52a6bf[_0x8808('0x18')]=qs[_0x8808('0x18')](_0x18934b[_0x8808('0x2f')]['offset']);}_0x52a6bf[_0x8808('0x36')]=qs[_0x8808('0x37')](_0x18934b[_0x8808('0x2f')][_0x8808('0x37')]);_0x52a6bf[_0x8808('0x38')]=qs[_0x8808('0x39')](_[_0x8808('0x3a')](_0x18934b[_0x8808('0x2f')],_0x593fc8[_0x8808('0x39')]),_0x3a8bce);if(_0x18934b[_0x8808('0x2f')][_0x8808('0x3b')]){_0x52a6bf[_0x8808('0x38')]=_[_0x8808('0x3c')](_0x52a6bf['where'],{'$or':_[_0x8808('0x28')](_0x3a8bce,function(_0x393598){if(_0x393598[_0x8808('0x2b')]!=='VIRTUAL'){var _0x24d449={};_0x24d449[_0x393598[_0x8808('0x25')]]={'$like':'%'+_0x18934b[_0x8808('0x2f')][_0x8808('0x3b')]+'%'};return _0x24d449;}})});}_0x52a6bf=_[_0x8808('0x3c')]({},_0x52a6bf,_0x18934b[_0x8808('0x3d')]);var _0x210328={'where':_0x52a6bf[_0x8808('0x38')]};return db[_0x8808('0x29')][_0x8808('0x1a')](_0x210328)['then'](function(_0x18a420){_0x525633['count']=_0x18a420;if(_0x18934b[_0x8808('0x2f')][_0x8808('0x3e')]){_0x52a6bf[_0x8808('0x3f')]=[{'all':!![]}];}return db['Schedule'][_0x8808('0x40')](_0x52a6bf);})[_0x8808('0x20')](function(_0x4e0b25){_0x525633['rows']=_0x4e0b25;return _0x525633;})[_0x8808('0x20')](respondWithFilteredResult(_0x5dd84d,_0x52a6bf))['catch'](handleError(_0x5dd84d,null));};exports[_0x8808('0x41')]=function(_0x1cb1ce,_0x5dddba){var _0x3edd74={'raw':![],'where':{'id':_0x1cb1ce['params']['id']}},_0xbe6523={};_0xbe6523[_0x8808('0x2d')]=_['keys'](db['Schedule']['rawAttributes']);_0xbe6523[_0x8808('0x2f')]=_['keys'](_0x1cb1ce['query']);_0xbe6523[_0x8808('0x39')]=_[_0x8808('0x30')](_0xbe6523['model'],_0xbe6523[_0x8808('0x2f')]);_0x3edd74[_0x8808('0x31')]=_[_0x8808('0x30')](_0xbe6523[_0x8808('0x2d')],qs[_0x8808('0x32')](_0x1cb1ce[_0x8808('0x2f')][_0x8808('0x32')]));_0x3edd74[_0x8808('0x31')]=_0x3edd74['attributes']['length']?_0x3edd74[_0x8808('0x31')]:_0xbe6523[_0x8808('0x2d')];if(_0x1cb1ce[_0x8808('0x2f')]['includeAll']){_0x3edd74['include']=[{'all':!![]}];}_0x3edd74=_['merge']({},_0x3edd74,_0x1cb1ce['options']);return db[_0x8808('0x29')][_0x8808('0x42')](_0x3edd74)[_0x8808('0x20')](handleEntityNotFound(_0x5dddba,null))[_0x8808('0x20')](respondWithResult(_0x5dddba,null))['catch'](handleError(_0x5dddba,null));};exports['create']=function(_0x59c73a,_0x2f8130){return db[_0x8808('0x29')][_0x8808('0x43')](_0x59c73a[_0x8808('0x44')],{})[_0x8808('0x20')](function(_0x59bfb0){var _0x2bc507=_0x59c73a[_0x8808('0x45')][_0x8808('0x46')]({'plain':!![]});if(!_0x2bc507)throw new Error(_0x8808('0x47'));if(_0x2bc507['role']==='user'){var _0x326fbe=_0x59bfb0[_0x8808('0x46')]({'plain':!![]});var _0x8de09d=_0x8808('0x21');return db[_0x8808('0x48')]['find']({'where':{'name':_0x8de09d,'userProfileId':_0x2bc507[_0x8808('0x49')]},'raw':!![]})['then'](function(_0x50eb35){if(_0x50eb35&&_0x50eb35['autoAssociation']===0x0){return db[_0x8808('0x22')][_0x8808('0x43')]({'name':_0x326fbe[_0x8808('0x25')],'resourceId':_0x326fbe['id'],'type':_0x50eb35[_0x8808('0x25')],'sectionId':_0x50eb35['id']},{})[_0x8808('0x20')](function(){return _0x59bfb0;});}else{return _0x59bfb0;}})[_0x8808('0x4a')](function(_0x17ae9d){logger[_0x8808('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17ae9d);throw _0x17ae9d;});}return _0x59bfb0;})[_0x8808('0x20')](respondWithResult(_0x2f8130,0xc9))[_0x8808('0x4a')](handleError(_0x2f8130,null));};exports[_0x8808('0x1f')]=function(_0x3d35f2,_0xa244b0){if(_0x3d35f2[_0x8808('0x44')]['id']){delete _0x3d35f2['body']['id'];}return db['Schedule'][_0x8808('0x42')]({'where':{'id':_0x3d35f2[_0x8808('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa244b0,null))[_0x8808('0x20')](saveUpdates(_0x3d35f2[_0x8808('0x44')],null))[_0x8808('0x20')](respondWithResult(_0xa244b0,null))[_0x8808('0x4a')](handleError(_0xa244b0,null));};exports[_0x8808('0x4c')]=function(_0x10bd21,_0x574684){return db['Schedule'][_0x8808('0x42')]({'where':{'id':_0x10bd21[_0x8808('0x4b')]['id']}})[_0x8808('0x20')](handleEntityNotFound(_0x574684,null))[_0x8808('0x20')](removeEntity(_0x574684,null))['catch'](handleError(_0x574684,null));};exports[_0x8808('0x4d')]=function(_0x5b8ebb,_0x1516b2,_0x3a6eea){var _0x1d0634=require(_0x8808('0x4e'));return db[_0x8808('0x29')]['find']({'where':{'id':_0x5b8ebb[_0x8808('0x4b')]['id']},'raw':!![]})[_0x8808('0x20')](handleEntityNotFound(_0x1516b2,null))['then'](function(){_0x1d0634['run'](_0x5b8ebb['params']['id']);})[_0x8808('0x20')](respondWithStatusCode(_0x1516b2,null))['catch'](handleError(_0x1516b2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index daa967a..c114808 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 _0x8149=['../../config/logger','api','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x5abe75,_0x52bec5){var _0xeaa63e=function(_0x39f456){while(--_0x39f456){_0x5abe75['push'](_0x5abe75['shift']());}};_0xeaa63e(++_0x52bec5);}(_0x8149,0xef));var _0x9814=function(_0x353ce9,_0x12ffea){_0x353ce9=_0x353ce9-0x0;var _0x2de21a=_0x8149[_0x353ce9];return _0x2de21a;};'use strict';var _=require(_0x9814('0x0'));var util=require('util');var logger=require(_0x9814('0x1'))(_0x9814('0x2'));var moment=require('moment');var BPromise=require(_0x9814('0x3'));var rp=require(_0x9814('0x4'));var fs=require('fs');var path=require(_0x9814('0x5'));var rimraf=require(_0x9814('0x6'));var config=require('../../config/environment');var attributes=require(_0x9814('0x7'));module[_0x9814('0x8')]=function(_0x3f8cbf,_0x32fbe1){return _0x3f8cbf[_0x9814('0x9')](_0x9814('0xa'),attributes,{'tableName':_0x9814('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9ce=['moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger'];(function(_0x4ff0b3,_0x34cc15){var _0x430487=function(_0x684f7){while(--_0x684f7){_0x4ff0b3['push'](_0x4ff0b3['shift']());}};_0x430487(++_0x34cc15);}(_0xf9ce,0x11e));var _0xef9c=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xf9ce[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0xef9c('0x0'));var util=require('util');var logger=require(_0xef9c('0x1'))('api');var moment=require(_0xef9c('0x2'));var BPromise=require(_0xef9c('0x3'));var rp=require(_0xef9c('0x4'));var fs=require('fs');var path=require(_0xef9c('0x5'));var rimraf=require(_0xef9c('0x6'));var config=require('../../config/environment');var attributes=require(_0xef9c('0x7'));module[_0xef9c('0x8')]=function(_0x49796b,_0x4ebb07){return _0x49796b[_0xef9c('0x9')](_0xef9c('0xa'),attributes,{'tableName':_0xef9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 21b937f..7b7ff54 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 _0x68fa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x58025a,_0x1f4ae9){var _0x2d89bc=function(_0x2952d9){while(--_0x2952d9){_0x58025a['push'](_0x58025a['shift']());}};_0x2d89bc(++_0x1f4ae9);}(_0x68fa,0x19b));var _0xa68f=function(_0x1af420,_0x4ad7c5){_0x1af420=_0x1af420-0x0;var _0x572d5f=_0x68fa[_0x1af420];return _0x572d5f;};'use strict';var _=require(_0xa68f('0x0'));var util=require(_0xa68f('0x1'));var moment=require(_0xa68f('0x2'));var BPromise=require(_0xa68f('0x3'));var rs=require(_0xa68f('0x4'));var fs=require('fs');var Redis=require(_0xa68f('0x5'));var db=require(_0xa68f('0x6'))['db'];var utils=require(_0xa68f('0x7'));var logger=require(_0xa68f('0x8'))('rpc');var config=require(_0xa68f('0x9'));var jayson=require(_0xa68f('0xa'));var client=jayson[_0xa68f('0xb')][_0xa68f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53218f,_0x1a0aab,_0x1303c7){return new BPromise(function(_0x511f1f,_0x7b1029){return client[_0xa68f('0xd')](_0x53218f,_0x1303c7)[_0xa68f('0xe')](function(_0x490f85){logger['info']('Schedule,\x20%s,\x20%s',_0x1a0aab,'request\x20sent');logger[_0xa68f('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1a0aab,_0xa68f('0x10'),JSON['stringify'](_0x490f85));if(_0x490f85[_0xa68f('0x11')]){if(_0x490f85[_0xa68f('0x11')][_0xa68f('0x12')]===0x1f4){logger[_0xa68f('0x11')](_0xa68f('0x13'),_0x1a0aab,_0x490f85[_0xa68f('0x11')][_0xa68f('0x14')]);return _0x7b1029(_0x490f85[_0xa68f('0x11')][_0xa68f('0x14')]);}logger['error'](_0xa68f('0x13'),_0x1a0aab,_0x490f85[_0xa68f('0x11')]['message']);return _0x511f1f(_0x490f85[_0xa68f('0x11')][_0xa68f('0x14')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x1a0aab,_0xa68f('0x10'));_0x511f1f(_0x490f85[_0xa68f('0x15')][_0xa68f('0x14')]);}})[_0xa68f('0x16')](function(_0x308a2e){logger[_0xa68f('0x11')](_0xa68f('0x13'),_0x1a0aab,_0x308a2e);_0x7b1029(_0x308a2e);});});} \ No newline at end of file +var _0x3464=['http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0x3464,0x109));var _0x4346=function(_0xd4de1,_0x122f4a){_0xd4de1=_0xd4de1-0x0;var _0x5e4858=_0x3464[_0xd4de1];return _0x5e4858;};'use strict';var _=require(_0x4346('0x0'));var util=require(_0x4346('0x1'));var moment=require(_0x4346('0x2'));var BPromise=require(_0x4346('0x3'));var rs=require(_0x4346('0x4'));var fs=require('fs');var Redis=require(_0x4346('0x5'));var db=require(_0x4346('0x6'))['db'];var utils=require(_0x4346('0x7'));var logger=require('../../config/logger')(_0x4346('0x8'));var config=require(_0x4346('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4346('0xa')][_0x4346('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bccee,_0x46d25b,_0xeabab3){return new BPromise(function(_0x33751a,_0x36a93c){return client[_0x4346('0xc')](_0x2bccee,_0xeabab3)[_0x4346('0xd')](function(_0x1e7ff3){logger[_0x4346('0xe')](_0x4346('0xf'),_0x46d25b,'request\x20sent');logger[_0x4346('0x10')](_0x4346('0x11'),_0x46d25b,_0x4346('0x12'),JSON['stringify'](_0x1e7ff3));if(_0x1e7ff3['error']){if(_0x1e7ff3['error'][_0x4346('0x13')]===0x1f4){logger[_0x4346('0x14')]('Schedule,\x20%s,\x20%s',_0x46d25b,_0x1e7ff3[_0x4346('0x14')][_0x4346('0x15')]);return _0x36a93c(_0x1e7ff3[_0x4346('0x14')]['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x46d25b,_0x1e7ff3[_0x4346('0x14')][_0x4346('0x15')]);return _0x33751a(_0x1e7ff3[_0x4346('0x14')][_0x4346('0x15')]);}else{logger['info'](_0x4346('0xf'),_0x46d25b,_0x4346('0x12'));_0x33751a(_0x1e7ff3['result'][_0x4346('0x15')]);}})[_0x4346('0x16')](function(_0xd6bf40){logger[_0x4346('0x14')](_0x4346('0xf'),_0x46d25b,_0xd6bf40);_0x36a93c(_0xd6bf40);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9c86b54..9d9e54f 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 _0x012d=['isAuthenticated','describe','/:id','show','/:id/download','post','create','update','delete','exports','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x012d,0x14e));var _0xd012=function(_0x5e4a2f,_0x2e2a91){_0x5e4a2f=_0x5e4a2f-0x0;var _0x159f46=_0x012d[_0x5e4a2f];return _0x159f46;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd012('0x0'));var express=require(_0xd012('0x1'));var router=express['Router']();var fs_extra=require(_0xd012('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xd012('0x3'));var config=require(_0xd012('0x4'));var controller=require('./screenRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd012('0x5')]);router[_0xd012('0x6')](_0xd012('0x7'),auth[_0xd012('0x8')](),controller[_0xd012('0x9')]);router[_0xd012('0x6')](_0xd012('0xa'),auth[_0xd012('0x8')](),controller[_0xd012('0xb')]);router[_0xd012('0x6')](_0xd012('0xc'),auth[_0xd012('0x8')](),controller['download']);router[_0xd012('0xd')]('/',auth[_0xd012('0x8')](),controller[_0xd012('0xe')]);router['put'](_0xd012('0xa'),auth[_0xd012('0x8')](),controller[_0xd012('0xf')]);router[_0xd012('0x10')](_0xd012('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd012('0x11')]=router; \ No newline at end of file +var _0x3301=['destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','describe','/:id','show','/:id/download','download','create','put','update'];(function(_0x45b3ac,_0x2872b6){var _0x45c92c=function(_0x34ef0f){while(--_0x34ef0f){_0x45b3ac['push'](_0x45b3ac['shift']());}};_0x45c92c(++_0x2872b6);}(_0x3301,0x1b9));var _0x1330=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x3301[_0x25701b];return _0x3a8a2c;};'use strict';var multer=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var path=require(_0x1330('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1330('0x3')]();var fs_extra=require(_0x1330('0x4'));var auth=require(_0x1330('0x5'));var interaction=require(_0x1330('0x6'));var config=require(_0x1330('0x7'));var controller=require(_0x1330('0x8'));router['get']('/',auth[_0x1330('0x9')](),controller['index']);router[_0x1330('0xa')]('/describe',auth[_0x1330('0x9')](),controller[_0x1330('0xb')]);router['get'](_0x1330('0xc'),auth[_0x1330('0x9')](),controller[_0x1330('0xd')]);router[_0x1330('0xa')](_0x1330('0xe'),auth[_0x1330('0x9')](),controller[_0x1330('0xf')]);router['post']('/',auth[_0x1330('0x9')](),controller[_0x1330('0x10')]);router[_0x1330('0x11')](_0x1330('0xc'),auth[_0x1330('0x9')](),controller[_0x1330('0x12')]);router['delete'](_0x1330('0xc'),auth[_0x1330('0x9')](),controller[_0x1330('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d5ffa7b..23a0204 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 _0x6f18=['extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','getDataValue','createdAt','updatedAt','sequelize','path','exports','VIRTUAL','value'];(function(_0x38b0be,_0x3d525f){var _0x4326dc=function(_0x4dbf92){while(--_0x4dbf92){_0x38b0be['push'](_0x38b0be['shift']());}};_0x4326dc(++_0x3d525f);}(_0x6f18,0x1b4));var _0x86f1=function(_0x480145,_0x4ef888){_0x480145=_0x480145-0x0;var _0xab11b0=_0x6f18[_0x480145];return _0xab11b0;};'use strict';var Sequelize=require(_0x86f1('0x0'));var moment=require('moment');var path=require(_0x86f1('0x1'));var config=require('../../config/environment');module[_0x86f1('0x2')]={'format':{'type':Sequelize[_0x86f1('0x3')],'get':function(){return this['getDataValue'](_0x86f1('0x4'))?path[_0x86f1('0x5')](this['getDataValue'](_0x86f1('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x86f1('0x6')]},'channel':{'type':Sequelize[_0x86f1('0x6')]},'value':{'type':Sequelize[_0x86f1('0x6')],'set':function(_0x403f48){var _0x4c7943=_0x403f48[_0x86f1('0x7')](/\\/g,'/');this[_0x86f1('0x8')](_0x86f1('0x4'),_0x4c7943);}},'rating':{'type':Sequelize[_0x86f1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x86f1('0x9')],'set':function(_0x4f1f6e){this[_0x86f1('0x8')](_0x86f1('0xa'),moment()[_0x86f1('0xb')](_0x4f1f6e,'ms'));this[_0x86f1('0x8')](_0x86f1('0xc'),moment());this[_0x86f1('0x8')](_0x86f1('0xd'),_0x4f1f6e);}},'startedAt':{'type':Sequelize[_0x86f1('0xe')],'get':function(){return moment(this['getDataValue'](_0x86f1('0xa')))[_0x86f1('0xf')](_0x86f1('0x10'))[_0x86f1('0x11')]();}},'closedAt':{'type':Sequelize[_0x86f1('0xe')],'get':function(){return moment(this[_0x86f1('0x12')]('closedAt'))[_0x86f1('0xf')](_0x86f1('0x10'))[_0x86f1('0x11')]();}},'createdAt':{'type':Sequelize[_0x86f1('0xe')],'get':function(){return moment(this[_0x86f1('0x12')](_0x86f1('0x13')))[_0x86f1('0xf')](_0x86f1('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0x86f1('0xe')],'get':function(){return moment(this[_0x86f1('0x12')](_0x86f1('0x14')))[_0x86f1('0xf')](_0x86f1('0x10'))[_0x86f1('0x11')]();}}}; \ No newline at end of file +var _0x52aa=['createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x52aa,0x113));var _0xa52a=function(_0x424fda,_0x3c9bcf){_0x424fda=_0x424fda-0x0;var _0x5e19d0=_0x52aa[_0x424fda];return _0x5e19d0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa52a('0x0'));var path=require(_0xa52a('0x1'));var config=require(_0xa52a('0x2'));module[_0xa52a('0x3')]={'format':{'type':Sequelize[_0xa52a('0x4')],'get':function(){return this[_0xa52a('0x5')](_0xa52a('0x6'))?path[_0xa52a('0x7')](this[_0xa52a('0x5')](_0xa52a('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xa52a('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x8609ec){var _0x14bc85=_0x8609ec[_0xa52a('0x9')](/\\/g,'/');this[_0xa52a('0xa')](_0xa52a('0x6'),_0x14bc85);}},'rating':{'type':Sequelize[_0xa52a('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa52a('0xb')],'set':function(_0xd006ed){this[_0xa52a('0xa')](_0xa52a('0xc'),moment()['subtract'](_0xd006ed,'ms'));this[_0xa52a('0xa')]('closedAt',moment());this[_0xa52a('0xa')](_0xa52a('0xd'),_0xd006ed);}},'startedAt':{'type':Sequelize[_0xa52a('0xe')],'get':function(){return moment(this[_0xa52a('0x5')](_0xa52a('0xc')))[_0xa52a('0xf')](_0xa52a('0x10'))[_0xa52a('0x11')]();}},'closedAt':{'type':Sequelize[_0xa52a('0xe')],'get':function(){return moment(this[_0xa52a('0x5')](_0xa52a('0x12')))[_0xa52a('0xf')](_0xa52a('0x10'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa52a('0x5')](_0xa52a('0x13')))['format'](_0xa52a('0x10'))[_0xa52a('0x11')]();}},'updatedAt':{'type':Sequelize[_0xa52a('0xe')],'get':function(){return moment(this[_0xa52a('0x5')](_0xa52a('0x14')))[_0xa52a('0xf')](_0xa52a('0x10'))[_0xa52a('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 3d80c7a..069c299 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 _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x351591,_0x58554f){var _0x19152b=function(_0x390304){while(--_0x390304){_0x351591['push'](_0x351591['shift']());}};_0x19152b(++_0x58554f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));}; \ No newline at end of file +var _0x2eb2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x2eb2,0x19f));var _0x22eb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2eb2[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x2c')](_['map'](_0x1599c7,_0x22eb('0x24')),[_0x22eb('0x2d')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x49dd59[_0x22eb('0x2e')]);_0x44cf91[_0x22eb('0x30')]=_[_0x22eb('0x31')](_0x44cf91[_0x22eb('0x32')],_0x44cf91[_0x22eb('0x2e')]);_0x25e5bc[_0x22eb('0x33')]=_['intersection'](_0x44cf91['model'],qs[_0x22eb('0x34')](_0x49dd59['query']['fields']));_0x25e5bc[_0x22eb('0x33')]=_0x25e5bc[_0x22eb('0x33')][_0x22eb('0x35')]?_0x25e5bc[_0x22eb('0x33')]:_0x44cf91[_0x22eb('0x32')];if(!_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x36')](_0x22eb('0x37'))){_0x25e5bc[_0x22eb('0x38')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc['offset']=qs['offset'](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x19')]);}_0x25e5bc['order']=qs[_0x22eb('0x39')](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x39')]);_0x25e5bc[_0x22eb('0x3a')]=qs[_0x22eb('0x30')](_['pick'](_0x49dd59[_0x22eb('0x2e')],_0x44cf91[_0x22eb('0x30')]),_0x1599c7);if(_0x49dd59['query'][_0x22eb('0x3b')]){_0x25e5bc[_0x22eb('0x3a')]=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x3a')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x5382eb){if(_0x5382eb['type']!==_0x22eb('0x3d')){var _0x6cd651={};_0x6cd651[_0x5382eb['name']]={'$like':'%'+_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3b')]+'%'};return _0x6cd651;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59['options']);var _0x1d977c={'where':_0x25e5bc[_0x22eb('0x3a')]};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x1d977c)[_0x22eb('0x20')](function(_0x39778e){_0x7c0119['count']=_0x39778e;if(_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x25e5bc['include']=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0x3f')](_0x25e5bc);})[_0x22eb('0x20')](function(_0x30cb10){_0x7c0119[_0x22eb('0x40')]=_0x30cb10;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x41')](handleError(_0x2a950e,null));};exports[_0x22eb('0x42')]=function(_0x1bafa3,_0x82ace8){var _0x3e1826={'raw':![],'where':{'id':_0x1bafa3[_0x22eb('0x43')]['id']}},_0x1cf1e0={};_0x1cf1e0[_0x22eb('0x32')]=_[_0x22eb('0x2f')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x1cf1e0[_0x22eb('0x2e')]=_['keys'](_0x1bafa3[_0x22eb('0x2e')]);_0x1cf1e0[_0x22eb('0x30')]=_['intersection'](_0x1cf1e0[_0x22eb('0x32')],_0x1cf1e0[_0x22eb('0x2e')]);_0x3e1826['attributes']=_['intersection'](_0x1cf1e0['model'],qs[_0x22eb('0x34')](_0x1bafa3[_0x22eb('0x2e')]['fields']));_0x3e1826['attributes']=_0x3e1826[_0x22eb('0x33')][_0x22eb('0x35')]?_0x3e1826[_0x22eb('0x33')]:_0x1cf1e0[_0x22eb('0x32')];if(_0x1bafa3[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x3e1826[_0x22eb('0x44')]=[{'all':!![]}];}_0x3e1826=_[_0x22eb('0x3c')]({},_0x3e1826,_0x1bafa3['options']);return db['ScreenRecording'][_0x22eb('0x45')](_0x3e1826)['then'](handleEntityNotFound(_0x82ace8,null))[_0x22eb('0x20')](respondWithResult(_0x82ace8,null))['catch'](handleError(_0x82ace8,null));};exports[_0x22eb('0x46')]=function(_0x5c41c0,_0x4b2f86){return db['ScreenRecording']['create'](_0x5c41c0[_0x22eb('0x47')],{})['then'](respondWithResult(_0x4b2f86,0xc9))[_0x22eb('0x41')](handleError(_0x4b2f86,null));};exports[_0x22eb('0x1f')]=function(_0x490bef,_0x24e6ba){if(_0x490bef['body']['id']){delete _0x490bef[_0x22eb('0x47')]['id'];}delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x48')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x49')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4a')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4b')];return db['ScreenRecording'][_0x22eb('0x45')]({'where':{'id':_0x490bef[_0x22eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e6ba,null))[_0x22eb('0x20')](saveUpdates(_0x490bef[_0x22eb('0x47')],null))[_0x22eb('0x20')](respondWithResult(_0x24e6ba,null))[_0x22eb('0x41')](handleError(_0x24e6ba,null));};exports['describe']=function(_0x6c0600,_0x169ae1){return db[_0x22eb('0x27')][_0x22eb('0x4c')]()[_0x22eb('0x20')](respondWithResult(_0x169ae1,null))[_0x22eb('0x41')](handleError(_0x169ae1,null));};exports['download']=function(_0x29d7ca,_0x4e5b9f,_0x3ff406){var _0x5eecef=require(_0x22eb('0x4d'));var _0x254b53=![];var _0x4028ef={};if(_0x29d7ca[_0x22eb('0x2e')][_0x22eb('0x2a')]&&_0x29d7ca['query']['type']===_0x22eb('0x4e')){_0x4028ef[_0x22eb('0x4e')]=_0x29d7ca['params']['id'];}else{_0x4028ef['id']=_0x29d7ca[_0x22eb('0x43')]['id'];}return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':_0x4028ef,'attributes':['id',_0x22eb('0x4b')],'raw':!![]})[_0x22eb('0x20')](handleEntityNotFound(_0x4e5b9f,null))[_0x22eb('0x20')](function(_0x3a8588){if(_0x3a8588){var _0x35c997=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x3a8588['value']);var _0x19cadf=util[_0x22eb('0x2d')](_0x22eb('0x52'),_0x35c997);if(fs[_0x22eb('0x53')](_0x19cadf)){_0x254b53=!![];return _0x5eecef[_0x22eb('0x54')](_0x19cadf,_0x35c997,config[_0x22eb('0x55')][_0x22eb('0x56')])[_0x22eb('0x20')](function(){return _0x3a8588;});}return _0x3a8588;}})[_0x22eb('0x20')](function(_0x9f8465){if(_0x9f8465){var _0x3e9ab5=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x9f8465['value']);if(!fs['existsSync'](_0x3e9ab5)){throw new db[(_0x22eb('0x57'))][(_0x22eb('0x58'))](_0x22eb('0x59'));}if(_0x9f8465[_0x22eb('0x5a')]){return _0x4e5b9f[_0x22eb('0x5b')](_0x3e9ab5,_0x9f8465['filename']+path[_0x22eb('0x5c')](_0x3e9ab5),function(){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}else{return _0x4e5b9f['download'](_0x3e9ab5,function(_0x485408){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}}})[_0x22eb('0x41')](function(_0xb5c8ae){if(_0xb5c8ae[_0x22eb('0x5e')]===_0x22eb('0x59')){_0x4e5b9f[_0x22eb('0x17')](0x194)[_0x22eb('0x25')](_0x22eb('0x5f'));}else{return handleError(_0x4e5b9f,null);}});};exports[_0x22eb('0x21')]=function(_0x19b579,_0x164645){return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':{'id':_0x19b579[_0x22eb('0x43')]['id']}})['then'](function(_0x29dd8b){if(_[_0x22eb('0x60')](_0x29dd8b)){throw new ReferenceError(_0x22eb('0x61'));}return _0x29dd8b;})['then'](function(_0x1787ec){var _0x5ac4c5=path[_0x22eb('0x4f')](config['root'],_0x22eb('0x51'),_0x1787ec[_0x22eb('0x4b')]);logger['info'](_0x22eb('0x62'),_0x5ac4c5);if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs['existsSync'](_0x5ac4c5)){logger[_0x22eb('0x63')](_0x22eb('0x64')+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}_0x5ac4c5=_0x5ac4c5+_0x22eb('0x67');if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs[_0x22eb('0x53')](_0x5ac4c5)){logger['info']('File:\x20\x22'+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}return _0x1787ec;})[_0x22eb('0x20')](function(_0x22b5c6){if(!_0x22b5c6)throw new InternalError();return _0x22b5c6[_0x22eb('0x21')]();})[_0x22eb('0x20')](function(){_0x164645[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();})['catch'](handleError(_0x164645,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 8677cec..42c6b1b 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 _0x1a02=['api','moment','request-promise','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','util'];(function(_0x486edd,_0x5dee6e){var _0x38174c=function(_0x3cc783){while(--_0x3cc783){_0x486edd['push'](_0x486edd['shift']());}};_0x38174c(++_0x5dee6e);}(_0x1a02,0x15f));var _0x21a0=function(_0x20f4f4,_0x950cad){_0x20f4f4=_0x20f4f4-0x0;var _0x33cfa2=_0x1a02[_0x20f4f4];return _0x33cfa2;};'use strict';var _=require('lodash');var util=require(_0x21a0('0x0'));var logger=require('../../config/logger')(_0x21a0('0x1'));var moment=require(_0x21a0('0x2'));var BPromise=require('bluebird');var rp=require(_0x21a0('0x3'));var fs=require('fs');var path=require(_0x21a0('0x4'));var rimraf=require(_0x21a0('0x5'));var config=require('../../config/environment');var attributes=require(_0x21a0('0x6'));module['exports']=function(_0x2b3857,_0x166d7d){return _0x2b3857[_0x21a0('0x7')](_0x21a0('0x8'),attributes,{'tableName':_0x21a0('0x9'),'paranoid':![],'indexes':[{'name':_0x21a0('0xa'),'fields':[_0x21a0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbad=['util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x46addd,_0x4a6136){var _0x761150=function(_0x512e1d){while(--_0x512e1d){_0x46addd['push'](_0x46addd['shift']());}};_0x761150(++_0x4a6136);}(_0xdbad,0x1eb));var _0xddba=function(_0x402bed,_0x37f1b0){_0x402bed=_0x402bed-0x0;var _0x53e662=_0xdbad[_0x402bed];return _0x53e662;};'use strict';var _=require(_0xddba('0x0'));var util=require(_0xddba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xddba('0x2'));var rp=require(_0xddba('0x3'));var fs=require('fs');var path=require(_0xddba('0x4'));var rimraf=require(_0xddba('0x5'));var config=require(_0xddba('0x6'));var attributes=require('./screenRecording.attributes');module[_0xddba('0x7')]=function(_0x55e1e0,_0x60a556){return _0x55e1e0[_0xddba('0x8')](_0xddba('0x9'),attributes,{'tableName':_0xddba('0xa'),'paranoid':![],'indexes':[{'name':_0xddba('0xb'),'fields':[_0xddba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 28d9e26..c1033c1 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 _0xda99=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0xda99,0xd8));var _0x9da9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9da9('0x0'));var moment=require(_0x9da9('0x1'));var BPromise=require(_0x9da9('0x2'));var rs=require(_0x9da9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da9('0x4'))['db'];var utils=require(_0x9da9('0x5'));var logger=require(_0x9da9('0x6'))(_0x9da9('0x7'));var config=require(_0x9da9('0x8'));var jayson=require(_0x9da9('0x9'));var client=jayson['client'][_0x9da9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ffc51,_0x17c27f,_0xe8d91c){return new BPromise(function(_0x35bb1a,_0x1669a8){return client[_0x9da9('0xb')](_0x4ffc51,_0xe8d91c)[_0x9da9('0xc')](function(_0x436b93){logger[_0x9da9('0xd')](_0x9da9('0xe'),_0x17c27f,_0x9da9('0xf'));logger[_0x9da9('0x10')](_0x9da9('0x11'),_0x17c27f,_0x9da9('0xf'),JSON[_0x9da9('0x12')](_0x436b93));if(_0x436b93[_0x9da9('0x13')]){if(_0x436b93[_0x9da9('0x13')][_0x9da9('0x14')]===0x1f4){logger[_0x9da9('0x13')](_0x9da9('0xe'),_0x17c27f,_0x436b93[_0x9da9('0x13')][_0x9da9('0x15')]);return _0x1669a8(_0x436b93[_0x9da9('0x13')][_0x9da9('0x15')]);}logger[_0x9da9('0x13')](_0x9da9('0xe'),_0x17c27f,_0x436b93[_0x9da9('0x13')]['message']);return _0x35bb1a(_0x436b93[_0x9da9('0x13')]['message']);}else{logger[_0x9da9('0xd')](_0x9da9('0xe'),_0x17c27f,_0x9da9('0xf'));_0x35bb1a(_0x436b93[_0x9da9('0x16')][_0x9da9('0x15')]);}})['catch'](function(_0x1d7061){logger[_0x9da9('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x17c27f,_0x1d7061);_0x1669a8(_0x1d7061);});});} \ No newline at end of file +var _0xb7ff=['message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e9bdf,_0x3ea8ac){var _0x1e279f=function(_0x3f9482){while(--_0x3f9482){_0x4e9bdf['push'](_0x4e9bdf['shift']());}};_0x1e279f(++_0x3ea8ac);}(_0xb7ff,0x87));var _0xfb7f=function(_0x2f0522,_0x502caf){_0x2f0522=_0x2f0522-0x0;var _0x1c9593=_0xb7ff[_0x2f0522];return _0x1c9593;};'use strict';var _=require(_0xfb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfb7f('0x1'));var rs=require(_0xfb7f('0x2'));var fs=require('fs');var Redis=require(_0xfb7f('0x3'));var db=require(_0xfb7f('0x4'))['db'];var utils=require(_0xfb7f('0x5'));var logger=require(_0xfb7f('0x6'))(_0xfb7f('0x7'));var config=require(_0xfb7f('0x8'));var jayson=require(_0xfb7f('0x9'));var client=jayson[_0xfb7f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341488,_0x3e7267,_0x3bef5f){return new BPromise(function(_0x20c4d2,_0x4dc896){return client[_0xfb7f('0xb')](_0x341488,_0x3bef5f)[_0xfb7f('0xc')](function(_0x59f8e6){logger['info'](_0xfb7f('0xd'),_0x3e7267,_0xfb7f('0xe'));logger[_0xfb7f('0xf')](_0xfb7f('0x10'),_0x3e7267,'request\x20sent',JSON[_0xfb7f('0x11')](_0x59f8e6));if(_0x59f8e6[_0xfb7f('0x12')]){if(_0x59f8e6['error']['code']===0x1f4){logger[_0xfb7f('0x12')](_0xfb7f('0xd'),_0x3e7267,_0x59f8e6[_0xfb7f('0x12')]['message']);return _0x4dc896(_0x59f8e6[_0xfb7f('0x12')][_0xfb7f('0x13')]);}logger[_0xfb7f('0x12')](_0xfb7f('0xd'),_0x3e7267,_0x59f8e6[_0xfb7f('0x12')][_0xfb7f('0x13')]);return _0x20c4d2(_0x59f8e6[_0xfb7f('0x12')][_0xfb7f('0x13')]);}else{logger[_0xfb7f('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x3e7267,_0xfb7f('0xe'));_0x20c4d2(_0x59f8e6[_0xfb7f('0x15')][_0xfb7f('0x13')]);}})['catch'](function(_0x512d0c){logger[_0xfb7f('0x12')](_0xfb7f('0xd'),_0x3e7267,_0x512d0c);_0x4dc896(_0x512d0c);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 89e2cc5..cd861b8 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 _0x0b9e=['/now','getDate','/:id','show','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','root','format','%s%s','extname','originalname','post','single','file','server/files/images/logos/','/:id/logo_login','addLogoLogin','join','preferred','addPreferred','favicon','/:id/favicon','addFavicon','isAuthenticated','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index'];(function(_0x211695,_0x452089){var _0x2dc311=function(_0x43e7f8){while(--_0x43e7f8){_0x211695['push'](_0x211695['shift']());}};_0x2dc311(++_0x452089);}(_0x0b9e,0xcc));var _0xe0b9=function(_0x429258,_0x44ec88){_0x429258=_0x429258-0x0;var _0x24c8c1=_0x0b9e[_0x429258];return _0x24c8c1;};'use strict';var multer=require('multer');var util=require(_0xe0b9('0x0'));var path=require(_0xe0b9('0x1'));var timeout=require(_0xe0b9('0x2'));var express=require(_0xe0b9('0x3'));var router=express['Router']();var fs_extra=require(_0xe0b9('0x4'));var auth=require(_0xe0b9('0x5'));var interaction=require(_0xe0b9('0x6'));var config=require(_0xe0b9('0x7'));var controller=require(_0xe0b9('0x8'));router[_0xe0b9('0x9')]('/',auth['isAuthenticated'](),controller[_0xe0b9('0xa')]);router[_0xe0b9('0x9')](_0xe0b9('0xb'),controller[_0xe0b9('0xc')]);router[_0xe0b9('0x9')](_0xe0b9('0xd'),controller[_0xe0b9('0xe')]);router[_0xe0b9('0x9')](_0xe0b9('0xf'),controller[_0xe0b9('0x10')]);router[_0xe0b9('0x9')]('/:id/logo_login',controller['getLogoLogin']);router['get'](_0xe0b9('0x11'),controller[_0xe0b9('0x12')]);router[_0xe0b9('0x9')](_0xe0b9('0x13'),controller[_0xe0b9('0x14')]);router['get']('/:id/favicon',controller[_0xe0b9('0x15')]);var upload=multer({'storage':multer[_0xe0b9('0x16')]({'destination':function(_0x32f3a7,_0x51a86f,_0x4a5e97){_0x4a5e97(null,path['join'](config[_0xe0b9('0x17')],'server/files/images/logos/'));},'filename':function(_0x14bb21,_0x47294b,_0x368589){_0x368589(null,util[_0xe0b9('0x18')](_0xe0b9('0x19'),'logo',path[_0xe0b9('0x1a')](_0x47294b[_0xe0b9('0x1b')])));}})});router[_0xe0b9('0x1c')](_0xe0b9('0xf'),upload[_0xe0b9('0x1d')](_0xe0b9('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x550edf,_0xc09a3e,_0x432b44){_0x432b44(null,path['join'](config[_0xe0b9('0x17')],_0xe0b9('0x1f')));},'filename':function(_0x57e0bb,_0x3743cb,_0x5b04e4){_0x5b04e4(null,util[_0xe0b9('0x18')](_0xe0b9('0x19'),'logologin',path[_0xe0b9('0x1a')](_0x3743cb['originalname'])));}})});router[_0xe0b9('0x1c')](_0xe0b9('0x20'),upload['single'](_0xe0b9('0x1e')),controller[_0xe0b9('0x21')]);var upload=multer({'storage':multer[_0xe0b9('0x16')]({'destination':function(_0x1a569f,_0x53e7c1,_0x376278){_0x376278(null,path[_0xe0b9('0x22')](config['root'],_0xe0b9('0x1f')));},'filename':function(_0x3a9373,_0x1a3cd3,_0x35bda4){_0x35bda4(null,util[_0xe0b9('0x18')](_0xe0b9('0x19'),_0xe0b9('0x23'),path[_0xe0b9('0x1a')](_0x1a3cd3[_0xe0b9('0x1b')])));}})});router['post'](_0xe0b9('0x13'),upload[_0xe0b9('0x1d')]('file'),controller[_0xe0b9('0x24')]);var upload=multer({'storage':multer[_0xe0b9('0x16')]({'destination':function(_0x407c0b,_0x3009cd,_0x3cc2c3){_0x3cc2c3(null,path[_0xe0b9('0x22')](config['root'],_0xe0b9('0x1f')));},'filename':function(_0x590b4f,_0x39c139,_0x424e81){_0x424e81(null,util[_0xe0b9('0x18')](_0xe0b9('0x19'),_0xe0b9('0x25'),path['extname'](_0x39c139[_0xe0b9('0x1b')])));}})});router[_0xe0b9('0x1c')](_0xe0b9('0x26'),upload['single']('file'),controller[_0xe0b9('0x27')]);router['put'](_0xe0b9('0xd'),auth[_0xe0b9('0x28')](),controller[_0xe0b9('0x29')]);module[_0xe0b9('0x2a')]=router; \ No newline at end of file +var _0x5e96=['preferred','extname','addPreferred','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','originalname','file','addLogo','logologin','post','/:id/logo_login','single','addLogoLogin','server/files/images/logos/'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e96,0x91));var _0x65e9=function(_0x1bf9cc,_0x3e9302){_0x1bf9cc=_0x1bf9cc-0x0;var _0x2aa7ce=_0x5e96[_0x1bf9cc];return _0x2aa7ce;};'use strict';var multer=require(_0x65e9('0x0'));var util=require(_0x65e9('0x1'));var path=require(_0x65e9('0x2'));var timeout=require(_0x65e9('0x3'));var express=require(_0x65e9('0x4'));var router=express[_0x65e9('0x5')]();var fs_extra=require(_0x65e9('0x6'));var auth=require(_0x65e9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x65e9('0x8'));var controller=require(_0x65e9('0x9'));router[_0x65e9('0xa')]('/',auth[_0x65e9('0xb')](),controller[_0x65e9('0xc')]);router[_0x65e9('0xa')](_0x65e9('0xd'),controller['getDate']);router[_0x65e9('0xa')](_0x65e9('0xe'),controller[_0x65e9('0xf')]);router[_0x65e9('0xa')](_0x65e9('0x10'),controller[_0x65e9('0x11')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router[_0x65e9('0xa')](_0x65e9('0x12'),controller[_0x65e9('0x13')]);router[_0x65e9('0xa')](_0x65e9('0x14'),controller[_0x65e9('0x15')]);router[_0x65e9('0xa')](_0x65e9('0x16'),controller[_0x65e9('0x17')]);var upload=multer({'storage':multer[_0x65e9('0x18')]({'destination':function(_0x40fe91,_0x288453,_0x12dd7b){_0x12dd7b(null,path[_0x65e9('0x19')](config[_0x65e9('0x1a')],'server/files/images/logos/'));},'filename':function(_0x125706,_0x26d257,_0x13af52){_0x13af52(null,util[_0x65e9('0x1b')](_0x65e9('0x1c'),_0x65e9('0x1d'),path['extname'](_0x26d257[_0x65e9('0x1e')])));}})});router['post'](_0x65e9('0x10'),upload['single'](_0x65e9('0x1f')),controller[_0x65e9('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1fc9aa,_0x388a9c,_0x3dcfd1){_0x3dcfd1(null,path[_0x65e9('0x19')](config[_0x65e9('0x1a')],'server/files/images/logos/'));},'filename':function(_0x33f1a5,_0x191db6,_0x3b4901){_0x3b4901(null,util[_0x65e9('0x1b')]('%s%s',_0x65e9('0x21'),path['extname'](_0x191db6[_0x65e9('0x1e')])));}})});router[_0x65e9('0x22')](_0x65e9('0x23'),upload[_0x65e9('0x24')](_0x65e9('0x1f')),controller[_0x65e9('0x25')]);var upload=multer({'storage':multer[_0x65e9('0x18')]({'destination':function(_0x392ea6,_0x31263a,_0x55bc45){_0x55bc45(null,path['join'](config[_0x65e9('0x1a')],_0x65e9('0x26')));},'filename':function(_0x1b47b6,_0x36d5ce,_0x4646b7){_0x4646b7(null,util['format'](_0x65e9('0x1c'),_0x65e9('0x27'),path[_0x65e9('0x28')](_0x36d5ce[_0x65e9('0x1e')])));}})});router[_0x65e9('0x22')](_0x65e9('0x14'),upload[_0x65e9('0x24')]('file'),controller[_0x65e9('0x29')]);var upload=multer({'storage':multer[_0x65e9('0x18')]({'destination':function(_0x28bdc2,_0x3d03fa,_0xd738c9){_0xd738c9(null,path[_0x65e9('0x19')](config[_0x65e9('0x1a')],_0x65e9('0x26')));},'filename':function(_0x59e064,_0x68484a,_0x1b9f17){_0x1b9f17(null,util[_0x65e9('0x1b')](_0x65e9('0x1c'),'favicon',path[_0x65e9('0x28')](_0x68484a[_0x65e9('0x1e')])));}})});router[_0x65e9('0x22')](_0x65e9('0x16'),upload['single'](_0x65e9('0x1f')),controller[_0x65e9('0x2a')]);router[_0x65e9('0x2b')](_0x65e9('0xe'),auth[_0x65e9('0xb')](),controller[_0x65e9('0x2c')]);module[_0x65e9('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4621238..5ba7cbe 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 _0x3bcf=['UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','STRING','alternate'];(function(_0x17d137,_0x43c2e7){var _0x47e848=function(_0x44f962){while(--_0x44f962){_0x17d137['push'](_0x17d137['shift']());}};_0x47e848(++_0x43c2e7);}(_0x3bcf,0x12d));var _0xf3bc=function(_0x4c5cf4,_0x4b0331){_0x4c5cf4=_0x4c5cf4-0x0;var _0x53e890=_0x3bcf[_0x4c5cf4];return _0x53e890;};'use strict';var Sequelize=require(_0xf3bc('0x0'));module[_0xf3bc('0x1')]={'min_internal':{'type':Sequelize[_0xf3bc('0x2')](0xb),'unique':_0xf3bc('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf3bc('0x2')](0xb),'unique':_0xf3bc('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xf3bc('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf3bc('0x7')]},'defaultLoginLogo':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf3bc('0x7')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf3bc('0x7')]},'turnaddr':{'type':Sequelize[_0xf3bc('0x7')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xf3bc('0x7')]},'pageTitle':{'type':Sequelize[_0xf3bc('0x7')]},'defaultPageTitle':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xf3bc('0x7')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xf3bc('0x8')},'chatTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xf3bc('0x7')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf3bc('0x7')]},'allowedLoginAttempts':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xf3bc('0x7')]},'defaultFavicon':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf3bc('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf3bc('0x7')]},'language':{'type':Sequelize[_0xf3bc('0x7')]},'bucket':{'type':Sequelize[_0xf3bc('0x7')]},'googleSsoEnabled':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf3bc('0x2')](0x2)[_0xf3bc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xf3bc('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf3bc('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf3bc('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x4bfb=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x32f4fa,_0x2624a9){var _0x1cf96e=function(_0x12e4fd){while(--_0x12e4fd){_0x32f4fa['push'](_0x32f4fa['shift']());}};_0x1cf96e(++_0x2624a9);}(_0x4bfb,0x14b));var _0xb4bf=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x4bfb[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0xb4bf('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xb4bf('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb4bf('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xb4bf('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb4bf('0x2')],'defaultValue':_0xb4bf('0x3')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb4bf('0x2')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb4bf('0x2')]},'turnaddr':{'type':Sequelize[_0xb4bf('0x2')]},'turnusername':{'type':Sequelize[_0xb4bf('0x2')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xb4bf('0x2')]},'defaultPageTitle':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb4bf('0x2')],'defaultValue':_0xb4bf('0x5')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb4bf('0x2')],'defaultValue':_0xb4bf('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb4bf('0x2')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb4bf('0x1')]},'transcribeRegion':{'type':Sequelize[_0xb4bf('0x2')]},'sentiment':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb4bf('0x1')]},'sentimentRegion':{'type':Sequelize[_0xb4bf('0x2')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xb4bf('0x2')]},'googleSsoEnabled':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb4bf('0x1')](0x2)[_0xb4bf('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xb4bf('0x1')](0x2)[_0xb4bf('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb4bf('0x1')](0x2)[_0xb4bf('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb4bf('0x1')](0x2)[_0xb4bf('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb4bf('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb4bf('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 80a2478..8405f32 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 _0xd6fd=['default_loginLogo.svg','gdpr','addPreferred','favicon','default_preferred.png','addFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','info','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','stack','name','send','index','map','Setting','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','fields','length','update','body','find','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default','default_logo.svg','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','custom'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd6fd,0x7d));var _0xdd6f=function(_0x52121d,_0x1d1704){_0x52121d=_0x52121d-0x0;var _0x448627=_0xd6fd[_0x52121d];return _0x448627;};'use strict';var emlformat=require(_0xdd6f('0x0'));var rimraf=require(_0xdd6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd6f('0x2'));var BPromise=require(_0xdd6f('0x3'));var Mustache=require(_0xdd6f('0x4'));var util=require(_0xdd6f('0x5'));var path=require(_0xdd6f('0x6'));var sox=require(_0xdd6f('0x7'));var csv=require(_0xdd6f('0x8'));var ejs=require(_0xdd6f('0x9'));var fs=require('fs');var fs_extra=require(_0xdd6f('0xa'));var _=require(_0xdd6f('0xb'));var squel=require(_0xdd6f('0xc'));var crypto=require(_0xdd6f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd6f('0x8'));var querystring=require('querystring');var Papa=require(_0xdd6f('0xe'));var Redis=require(_0xdd6f('0xf'));var authService=require(_0xdd6f('0x10'));var qs=require(_0xdd6f('0x11'));var as=require(_0xdd6f('0x12'));var hardwareService=require(_0xdd6f('0x13'));var logger=require(_0xdd6f('0x14'))(_0xdd6f('0x15'));var utils=require(_0xdd6f('0x16'));var config=require(_0xdd6f('0x17'));var licenseUtil=require(_0xdd6f('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf0f2f0,_0x74729a,_0x577016,_0x52a671){return new BPromise(function(_0x510734,_0x3e9cf3){var _0x2bfd22=_0x52a671||client;return _0x2bfd22[_0xdd6f('0x19')](_0xf0f2f0,_0x577016)[_0xdd6f('0x1a')](function(_0x8419d8){logger['info'](_0xdd6f('0x1b'),_0x74729a,_0xdd6f('0x1c'));logger[_0xdd6f('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x74729a,'request\x20sent',JSON[_0xdd6f('0x1e')](_0x8419d8));if(_0x8419d8['error']){if(_0x8419d8[_0xdd6f('0x1f')][_0xdd6f('0x20')]===0x1f4){logger[_0xdd6f('0x1f')](_0xdd6f('0x1b'),_0x74729a,_0x8419d8[_0xdd6f('0x1f')]['message']);return _0x3e9cf3(_0x8419d8['error']['message']);}logger[_0xdd6f('0x1f')](_0xdd6f('0x1b'),_0x74729a,_0x8419d8['error']['message']);return _0x510734(_0x8419d8[_0xdd6f('0x1f')]['message']);}else{logger[_0xdd6f('0x21')]('Setting,\x20%s,\x20%s',_0x74729a,_0xdd6f('0x1c'));_0x510734(_0x8419d8[_0xdd6f('0x22')]['message']);}})[_0xdd6f('0x23')](function(_0x4155b2){logger[_0xdd6f('0x1f')]('Setting,\x20%s,\x20%s',_0x74729a,_0x4155b2);_0x3e9cf3(_0x4155b2);});});}function respondWithStatusCode(_0x3f03f9,_0xdd399e){_0xdd399e=_0xdd399e||0xcc;return function(_0x49b961){if(_0x49b961){return _0x3f03f9[_0xdd6f('0x24')](_0xdd399e);}return _0x3f03f9[_0xdd6f('0x25')](_0xdd399e)['end']();};}function respondWithResult(_0x2d598e,_0x5370d8){_0x5370d8=_0x5370d8||0xc8;return function(_0x10f1f3){if(_0x10f1f3){return _0x2d598e[_0xdd6f('0x25')](_0x5370d8)[_0xdd6f('0x26')](_0x10f1f3);}};}function respondWithFilteredResult(_0x161d29,_0x22f78d){return function(_0x59f6e8){if(_0x59f6e8){var _0x39a7b1=typeof _0x22f78d['offset']===_0xdd6f('0x27')&&typeof _0x22f78d['limit']==='undefined';var _0x37c7e6=_0x59f6e8[_0xdd6f('0x28')];var _0x20a235=_0x39a7b1?0x0:_0x22f78d[_0xdd6f('0x29')];var _0xcc4698=_0x39a7b1?_0x59f6e8['count']:_0x22f78d['offset']+_0x22f78d[_0xdd6f('0x2a')];var _0xb0af89;if(_0xcc4698>=_0x37c7e6){_0xcc4698=_0x37c7e6;_0xb0af89=0xc8;}else{_0xb0af89=0xce;}_0x161d29[_0xdd6f('0x25')](_0xb0af89);return _0x161d29[_0xdd6f('0x2b')](_0xdd6f('0x2c'),_0x20a235+'-'+_0xcc4698+'/'+_0x37c7e6)[_0xdd6f('0x26')](_0x59f6e8);}return null;};}function patchUpdates(_0x32d3bb){return function(_0x4e6509){try{jsonpatch['apply'](_0x4e6509,_0x32d3bb,!![]);}catch(_0xfb8929){return BPromise[_0xdd6f('0x2d')](_0xfb8929);}return _0x4e6509[_0xdd6f('0x2e')]();};}function saveUpdates(_0x453e40,_0x71a1d2){return function(_0x2cb00e){if(_0x2cb00e){return _0x2cb00e['update'](_0x453e40)['then'](function(_0x1eae25){return _0x1eae25;});}return null;};}function removeEntity(_0x42c07c,_0x39b5c3){return function(_0x43c9eb){if(_0x43c9eb){return _0x43c9eb['destroy']()[_0xdd6f('0x1a')](function(){_0x42c07c[_0xdd6f('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a3db,_0x23f144){return function(_0x5ba68e){if(!_0x5ba68e){_0x47a3db[_0xdd6f('0x24')](0x194);}return _0x5ba68e;};}function handleError(_0x44e58b,_0x5fdc64){_0x5fdc64=_0x5fdc64||0x1f4;return function(_0x79b736){logger[_0xdd6f('0x1f')](_0x79b736[_0xdd6f('0x2f')]);if(_0x79b736[_0xdd6f('0x30')]){delete _0x79b736[_0xdd6f('0x30')];}_0x44e58b['status'](_0x5fdc64)[_0xdd6f('0x31')](_0x79b736);};}exports[_0xdd6f('0x32')]=function(_0x116684,_0x88803){var _0x54afbd={},_0x2bbf24={},_0x1598ee={'count':0x0,'rows':[]};var _0x34185d=_[_0xdd6f('0x33')](db[_0xdd6f('0x34')]['rawAttributes'],function(_0x26fa78){return{'name':_0x26fa78[_0xdd6f('0x35')],'type':_0x26fa78[_0xdd6f('0x36')]['key']};});_0x2bbf24[_0xdd6f('0x37')]=_[_0xdd6f('0x33')](_0x34185d,_0xdd6f('0x30'));_0x2bbf24[_0xdd6f('0x38')]=_[_0xdd6f('0x39')](_0x116684[_0xdd6f('0x38')]);_0x2bbf24['filters']=_[_0xdd6f('0x3a')](_0x2bbf24[_0xdd6f('0x37')],_0x2bbf24[_0xdd6f('0x38')]);_0x54afbd['attributes']=_[_0xdd6f('0x3a')](_0x2bbf24[_0xdd6f('0x37')],qs['fields'](_0x116684['query']['fields']));_0x54afbd[_0xdd6f('0x3b')]=_0x54afbd[_0xdd6f('0x3b')]['length']?_0x54afbd['attributes']:_0x2bbf24[_0xdd6f('0x37')];if(!_0x116684[_0xdd6f('0x38')][_0xdd6f('0x3c')]('nolimit')){_0x54afbd[_0xdd6f('0x2a')]=qs[_0xdd6f('0x2a')](_0x116684['query'][_0xdd6f('0x2a')]);_0x54afbd['offset']=qs[_0xdd6f('0x29')](_0x116684[_0xdd6f('0x38')][_0xdd6f('0x29')]);}_0x54afbd[_0xdd6f('0x3d')]=qs[_0xdd6f('0x3e')](_0x116684[_0xdd6f('0x38')][_0xdd6f('0x3e')]);_0x54afbd[_0xdd6f('0x3f')]=qs['filters'](_[_0xdd6f('0x40')](_0x116684[_0xdd6f('0x38')],_0x2bbf24['filters']),_0x34185d);if(_0x116684[_0xdd6f('0x38')]['filter']){_0x54afbd[_0xdd6f('0x3f')]=_[_0xdd6f('0x41')](_0x54afbd[_0xdd6f('0x3f')],{'$or':_['map'](_0x34185d,function(_0x12713b){if(_0x12713b[_0xdd6f('0x36')]!==_0xdd6f('0x42')){var _0x4fb5a4={};_0x4fb5a4[_0x12713b[_0xdd6f('0x30')]]={'$like':'%'+_0x116684[_0xdd6f('0x38')][_0xdd6f('0x43')]+'%'};return _0x4fb5a4;}})});}_0x54afbd=_['merge']({},_0x54afbd,_0x116684[_0xdd6f('0x44')]);var _0x31d47a={'where':_0x54afbd[_0xdd6f('0x3f')]};return db[_0xdd6f('0x34')]['count'](_0x31d47a)['then'](function(_0x3015cc){_0x1598ee[_0xdd6f('0x28')]=_0x3015cc;if(_0x116684[_0xdd6f('0x38')][_0xdd6f('0x45')]){_0x54afbd[_0xdd6f('0x46')]=[{'all':!![]}];}return db[_0xdd6f('0x34')]['findAll'](_0x54afbd);})['then'](function(_0x49a1e1){_0x1598ee['rows']=_0x49a1e1;return _0x1598ee;})[_0xdd6f('0x1a')](respondWithFilteredResult(_0x88803,_0x54afbd))['catch'](handleError(_0x88803,null));};exports[_0xdd6f('0x47')]=function(_0x325d92,_0x43343){var _0x61de3b={'raw':![],'where':{'id':_0x325d92[_0xdd6f('0x48')]['id']}},_0x4c23a3={};_0x4c23a3[_0xdd6f('0x37')]=_[_0xdd6f('0x39')](db[_0xdd6f('0x34')]['rawAttributes']);_0x4c23a3[_0xdd6f('0x38')]=_[_0xdd6f('0x39')](_0x325d92[_0xdd6f('0x38')]);_0x4c23a3['filters']=_['intersection'](_0x4c23a3['model'],_0x4c23a3[_0xdd6f('0x38')]);_0x61de3b['attributes']=_[_0xdd6f('0x3a')](_0x4c23a3['model'],qs[_0xdd6f('0x49')](_0x325d92[_0xdd6f('0x38')]['fields']));_0x61de3b[_0xdd6f('0x3b')]=_0x61de3b[_0xdd6f('0x3b')][_0xdd6f('0x4a')]?_0x61de3b['attributes']:_0x4c23a3[_0xdd6f('0x37')];if(_0x325d92[_0xdd6f('0x38')]['includeAll']){_0x61de3b[_0xdd6f('0x46')]=[{'all':!![]}];}_0x61de3b=_[_0xdd6f('0x41')]({},_0x61de3b,_0x325d92[_0xdd6f('0x44')]);return db[_0xdd6f('0x34')]['find'](_0x61de3b)['then'](handleEntityNotFound(_0x43343,null))[_0xdd6f('0x1a')](respondWithResult(_0x43343,null))[_0xdd6f('0x23')](handleError(_0x43343,null));};exports[_0xdd6f('0x4b')]=function(_0x3fe4a1,_0x55726c){if(_0x3fe4a1[_0xdd6f('0x4c')]['id']){delete _0x3fe4a1[_0xdd6f('0x4c')]['id'];}return db['Setting'][_0xdd6f('0x4d')]({'where':{'id':_0x3fe4a1[_0xdd6f('0x48')]['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x55726c,null))['then'](saveUpdates(_0x3fe4a1[_0xdd6f('0x4c')],null))['then'](respondWithResult(_0x55726c,null))[_0xdd6f('0x23')](handleError(_0x55726c,null));};exports[_0xdd6f('0x4e')]=function(_0xb01418,_0x5c0604,_0x1e0895){if(_0xb01418[_0xdd6f('0x4f')]&&_0xb01418[_0xdd6f('0x4f')][_0xdd6f('0x50')]){_0xb01418[_0xdd6f('0x4c')]['logo']=_0xb01418[_0xdd6f('0x4f')]['filename'];}return db[_0xdd6f('0x34')][_0xdd6f('0x4d')]({'where':{'id':_0xb01418[_0xdd6f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c0604,null))[_0xdd6f('0x1a')](saveUpdates(_0xb01418[_0xdd6f('0x4c')],null))[_0xdd6f('0x1a')](respondWithResult(_0x5c0604,null))[_0xdd6f('0x23')](handleError(_0x5c0604,null));};exports[_0xdd6f('0x51')]=function(_0x3bb53b,_0x3a02fb,_0x1f1940){if(_0x3bb53b[_0xdd6f('0x4f')]&&_0x3bb53b[_0xdd6f('0x4f')][_0xdd6f('0x50')]){_0x3bb53b['body'][_0xdd6f('0x52')]=_0x3bb53b[_0xdd6f('0x4f')][_0xdd6f('0x50')];}return db[_0xdd6f('0x34')][_0xdd6f('0x4d')]({'where':{'id':_0x3bb53b[_0xdd6f('0x48')]['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x3a02fb,null))['then'](saveUpdates(_0x3bb53b[_0xdd6f('0x4c')],null))['then'](respondWithResult(_0x3a02fb,null))['catch'](handleError(_0x3a02fb,null));};var utilLicense=require(_0xdd6f('0x18'));exports[_0xdd6f('0x53')]=function(_0x22f5eb,_0x1771ae,_0x5cc4e4){var _0x22a8a1=_0xdd6f('0x54');var _0xc53b3e={'custom':![]};return utilLicense[_0xdd6f('0x55')]()['then'](function(_0x552657){if(_0x552657){_0xc53b3e=_0x552657;}return db[_0xdd6f('0x34')]['find']({'where':{'id':_0x22f5eb['params']['id']},'attributes':[_0xdd6f('0x56'),_0xdd6f('0x52'),_0xdd6f('0x57'),'favicon',_0xdd6f('0x58'),_0xdd6f('0x59'),_0xdd6f('0x5a'),_0xdd6f('0x5b')],'raw':!![]});})[_0xdd6f('0x1a')](handleEntityNotFound(_0x1771ae,null))['then'](function(_0x230960){if(_0x230960){var _0x3996ff=_0x230960[_0xdd6f('0x56')]&&fs[_0xdd6f('0x5c')](path['join'](config[_0xdd6f('0x5d')],_0x22a8a1,_[_0xdd6f('0x5e')](_0x230960[_0xdd6f('0x56')])))?path[_0xdd6f('0x5f')](config['root'],_0x22a8a1,_['toLower'](_0x230960[_0xdd6f('0x56')])):path[_0xdd6f('0x5f')](config['root'],_0x22a8a1,_['toLower']('default_logo.svg'));var _0x4a37b3=_0xdd6f('0x60')+_['upperFirst'](_0xdd6f('0x56'));if(_0x230960[_0x4a37b3]||!_0xc53b3e['custom']){_0x3996ff=path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x22a8a1,_[_0xdd6f('0x5e')](_0xdd6f('0x61')));}if(!fs[_0xdd6f('0x5c')](_0x3996ff)){throw new db[(_0xdd6f('0x62'))][(_0xdd6f('0x63'))](_[_0xdd6f('0x64')](_0xdd6f('0x56'))+_0xdd6f('0x65'));}return _0x1771ae[_0xdd6f('0x66')](_0x3996ff);}})[_0xdd6f('0x23')](handleError(_0x1771ae,null));};var utilLicense=require(_0xdd6f('0x18'));exports[_0xdd6f('0x67')]=function(_0x1270ef,_0x43096d,_0x177942){var _0x367961=_0xdd6f('0x54');var _0x40151a={'custom':![]};return utilLicense[_0xdd6f('0x55')]()['then'](function(_0x2c5983){if(_0x2c5983){_0x40151a=_0x2c5983;}return db[_0xdd6f('0x34')][_0xdd6f('0x4d')]({'where':{'id':_0x1270ef['params']['id']},'attributes':[_0xdd6f('0x56'),_0xdd6f('0x52'),_0xdd6f('0x57'),'favicon','defaultLogo','defaultLoginLogo',_0xdd6f('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x43096d,null))[_0xdd6f('0x1a')](function(_0x55f4ab){if(_0x55f4ab){var _0x92ceda=_0x55f4ab[_0xdd6f('0x52')]&&fs[_0xdd6f('0x5c')](path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x367961,_[_0xdd6f('0x5e')](_0x55f4ab[_0xdd6f('0x52')])))?path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x367961,_[_0xdd6f('0x5e')](_0x55f4ab[_0xdd6f('0x52')])):path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x367961,_[_0xdd6f('0x5e')]('default_loginLogo.svg'));var _0x5c2cd1=_0xdd6f('0x60')+_[_0xdd6f('0x64')](_0xdd6f('0x52'));if(_0x55f4ab[_0x5c2cd1]||!_0x40151a[_0xdd6f('0x68')]){_0x92ceda=path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x367961,_['toLower'](_0xdd6f('0x69')));}if(!fs[_0xdd6f('0x5c')](_0x92ceda)){throw new db['Sequelize'][(_0xdd6f('0x63'))](_[_0xdd6f('0x64')](_0xdd6f('0x52'))+_0xdd6f('0x65'));}return _0x43096d['download'](_0x92ceda);}})[_0xdd6f('0x23')](handleError(_0x43096d,null));};exports[_0xdd6f('0x6a')]=function(_0x28d222,_0x387aae){return db['Setting']['find']({'where':{'id':_0x28d222[_0xdd6f('0x48')]['id']},'attributes':['securePassword']})[_0xdd6f('0x1a')](respondWithResult(_0x387aae,null))[_0xdd6f('0x23')](handleError(_0x387aae,null));};exports[_0xdd6f('0x6b')]=function(_0x3664c2,_0x19f888,_0x24aeb6){if(_0x3664c2[_0xdd6f('0x4f')]&&_0x3664c2[_0xdd6f('0x4f')][_0xdd6f('0x50')]){_0x3664c2[_0xdd6f('0x4c')]['preferred']=_0x3664c2[_0xdd6f('0x4f')][_0xdd6f('0x50')];}return db[_0xdd6f('0x34')][_0xdd6f('0x4d')]({'where':{'id':_0x3664c2[_0xdd6f('0x48')]['id']}})['then'](handleEntityNotFound(_0x19f888,null))[_0xdd6f('0x1a')](saveUpdates(_0x3664c2[_0xdd6f('0x4c')],null))[_0xdd6f('0x1a')](respondWithResult(_0x19f888,null))['catch'](handleError(_0x19f888,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x5e2828,_0x223fe0,_0xf03ac0){var _0x5d454b=_0xdd6f('0x54');var _0xed4859={'custom':![]};return utilLicense[_0xdd6f('0x55')]()[_0xdd6f('0x1a')](function(_0x1f938d){if(_0x1f938d){_0xed4859=_0x1f938d;}return db[_0xdd6f('0x34')][_0xdd6f('0x4d')]({'where':{'id':_0x5e2828[_0xdd6f('0x48')]['id']},'attributes':[_0xdd6f('0x56'),'loginLogo',_0xdd6f('0x57'),_0xdd6f('0x6c'),_0xdd6f('0x58'),_0xdd6f('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xdd6f('0x1a')](handleEntityNotFound(_0x223fe0,null))[_0xdd6f('0x1a')](function(_0x39d099){if(_0x39d099){var _0x6c7c2c=_0x39d099['preferred']&&fs[_0xdd6f('0x5c')](path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x5d454b,_[_0xdd6f('0x5e')](_0x39d099[_0xdd6f('0x57')])))?path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x5d454b,_[_0xdd6f('0x5e')](_0x39d099[_0xdd6f('0x57')])):path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x5d454b,_[_0xdd6f('0x5e')](_0xdd6f('0x6d')));var _0x479b57=_0xdd6f('0x60')+_[_0xdd6f('0x64')](_0xdd6f('0x57'));if(_0x39d099[_0x479b57]||!_0xed4859[_0xdd6f('0x68')]||!_0xed4859[_0xdd6f('0x57')]){_0x6c7c2c=path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x5d454b,_[_0xdd6f('0x5e')](_0xdd6f('0x6d')));}if(!fs['existsSync'](_0x6c7c2c)){throw new db[(_0xdd6f('0x62'))][(_0xdd6f('0x63'))](_['upperFirst'](_0xdd6f('0x57'))+'\x20not\x20found');}return _0x223fe0['download'](_0x6c7c2c);}})[_0xdd6f('0x23')](handleError(_0x223fe0,null));};exports[_0xdd6f('0x6e')]=function(_0x45df55,_0x2fab48,_0x207263){if(_0x45df55[_0xdd6f('0x4f')]&&_0x45df55['file'][_0xdd6f('0x50')]){_0x45df55[_0xdd6f('0x4c')][_0xdd6f('0x6c')]=_0x45df55[_0xdd6f('0x4f')][_0xdd6f('0x50')];}return db[_0xdd6f('0x34')]['find']({'where':{'id':_0x45df55[_0xdd6f('0x48')]['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x2fab48,null))['then'](saveUpdates(_0x45df55[_0xdd6f('0x4c')],null))[_0xdd6f('0x1a')](respondWithResult(_0x2fab48,null))['catch'](handleError(_0x2fab48,null));};var utilLicense=require(_0xdd6f('0x18'));exports['getFavicon']=function(_0x53da76,_0x2b1b2d,_0xfca8e0){var _0x374d83=_0xdd6f('0x54');var _0x206933={'custom':![]};return utilLicense['getLicense']()[_0xdd6f('0x1a')](function(_0x53bed6){if(_0x53bed6){_0x206933=_0x53bed6;}return db['Setting'][_0xdd6f('0x4d')]({'where':{'id':_0x53da76[_0xdd6f('0x48')]['id']},'attributes':['logo',_0xdd6f('0x52'),_0xdd6f('0x57'),_0xdd6f('0x6c'),'defaultLogo',_0xdd6f('0x59'),_0xdd6f('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xdd6f('0x1a')](handleEntityNotFound(_0x2b1b2d,null))[_0xdd6f('0x1a')](function(_0x2385ef){if(_0x2385ef){var _0x5ee90a=_0x2385ef[_0xdd6f('0x6c')]&&fs['existsSync'](path['join'](config[_0xdd6f('0x5d')],_0x374d83,_[_0xdd6f('0x5e')](_0x2385ef['favicon'])))?path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x374d83,_[_0xdd6f('0x5e')](_0x2385ef[_0xdd6f('0x6c')])):path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x374d83,_['toLower'](_0xdd6f('0x6f')));var _0x5b430e=_0xdd6f('0x60')+_[_0xdd6f('0x64')]('favicon');if(_0x2385ef[_0x5b430e]||!_0x206933[_0xdd6f('0x68')]){_0x5ee90a=path[_0xdd6f('0x5f')](config[_0xdd6f('0x5d')],_0x374d83,_[_0xdd6f('0x5e')](_0xdd6f('0x6f')));}if(!fs[_0xdd6f('0x5c')](_0x5ee90a)){throw new db[(_0xdd6f('0x62'))][(_0xdd6f('0x63'))](_['upperFirst']('favicon')+_0xdd6f('0x65'));}return _0x2b1b2d[_0xdd6f('0x66')](_0x5ee90a);}})[_0xdd6f('0x23')](handleError(_0x2b1b2d,null));};exports['getDate']=function(_0x4d85fc,_0xaa2489){var _0x175979={'offset':moment()['utcOffset']()};_0x175979['now']=moment()[_0xdd6f('0x70')](_0x175979[_0xdd6f('0x29')])[_0xdd6f('0x71')](_0xdd6f('0x72'));return _0xaa2489[_0xdd6f('0x25')](0xc8)[_0xdd6f('0x31')](_0x175979);}; \ No newline at end of file +var _0xf9cb=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','send','index','Setting','type','key','map','name','query','keys','filters','intersection','attributes','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','params','fields','includeAll','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','existsSync','join','root','toLower','default','custom','default_logo.svg','Sequelize','ValidationError','upperFirst','download','getLogoLogin','defaultFavicon','default_loginLogo.svg','\x20not\x20found','addPreferred','defaultPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0xf9cb,0xdb));var _0xbf9c=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xf9cb[_0x3df871];return _0x570f7b;};'use strict';var emlformat=require(_0xbf9c('0x0'));var rimraf=require(_0xbf9c('0x1'));var zipdir=require(_0xbf9c('0x2'));var jsonpatch=require(_0xbf9c('0x3'));var rp=require(_0xbf9c('0x4'));var moment=require('moment');var BPromise=require(_0xbf9c('0x5'));var Mustache=require(_0xbf9c('0x6'));var util=require(_0xbf9c('0x7'));var path=require('path');var sox=require(_0xbf9c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf9c('0x9'));var squel=require(_0xbf9c('0xa'));var crypto=require(_0xbf9c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf9c('0xc'));var toCsv=require(_0xbf9c('0xd'));var querystring=require(_0xbf9c('0xe'));var Papa=require(_0xbf9c('0xf'));var Redis=require(_0xbf9c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf9c('0x11'));var as=require(_0xbf9c('0x12'));var hardwareService=require(_0xbf9c('0x13'));var logger=require('../../config/logger')(_0xbf9c('0x14'));var utils=require(_0xbf9c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbf9c('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbf9c('0x17'));var client=jayson[_0xbf9c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cab9d,_0x1b1721,_0x515d29,_0x4f4e55){return new BPromise(function(_0x550537,_0x37147f){var _0x553172=_0x4f4e55||client;return _0x553172[_0xbf9c('0x19')](_0x1cab9d,_0x515d29)['then'](function(_0x104780){logger[_0xbf9c('0x1a')](_0xbf9c('0x1b'),_0x1b1721,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x1b1721,_0xbf9c('0x1c'),JSON[_0xbf9c('0x1d')](_0x104780));if(_0x104780[_0xbf9c('0x1e')]){if(_0x104780[_0xbf9c('0x1e')][_0xbf9c('0x1f')]===0x1f4){logger[_0xbf9c('0x1e')](_0xbf9c('0x1b'),_0x1b1721,_0x104780[_0xbf9c('0x1e')][_0xbf9c('0x20')]);return _0x37147f(_0x104780['error'][_0xbf9c('0x20')]);}logger[_0xbf9c('0x1e')]('Setting,\x20%s,\x20%s',_0x1b1721,_0x104780[_0xbf9c('0x1e')][_0xbf9c('0x20')]);return _0x550537(_0x104780[_0xbf9c('0x1e')][_0xbf9c('0x20')]);}else{logger[_0xbf9c('0x1a')]('Setting,\x20%s,\x20%s',_0x1b1721,_0xbf9c('0x1c'));_0x550537(_0x104780[_0xbf9c('0x21')][_0xbf9c('0x20')]);}})[_0xbf9c('0x22')](function(_0x198c1e){logger[_0xbf9c('0x1e')]('Setting,\x20%s,\x20%s',_0x1b1721,_0x198c1e);_0x37147f(_0x198c1e);});});}function respondWithStatusCode(_0xa3b7fd,_0x1dd8e2){_0x1dd8e2=_0x1dd8e2||0xcc;return function(_0x211d50){if(_0x211d50){return _0xa3b7fd['sendStatus'](_0x1dd8e2);}return _0xa3b7fd[_0xbf9c('0x23')](_0x1dd8e2)['end']();};}function respondWithResult(_0x597a0f,_0x485f0a){_0x485f0a=_0x485f0a||0xc8;return function(_0x3cd3a6){if(_0x3cd3a6){return _0x597a0f[_0xbf9c('0x23')](_0x485f0a)['json'](_0x3cd3a6);}};}function respondWithFilteredResult(_0x2d610d,_0x17f006){return function(_0x53ee65){if(_0x53ee65){var _0x46a1b9=typeof _0x17f006[_0xbf9c('0x24')]===_0xbf9c('0x25')&&typeof _0x17f006[_0xbf9c('0x26')]===_0xbf9c('0x25');var _0xb84ec6=_0x53ee65[_0xbf9c('0x27')];var _0x5539ee=_0x46a1b9?0x0:_0x17f006[_0xbf9c('0x24')];var _0x5735d5=_0x46a1b9?_0x53ee65[_0xbf9c('0x27')]:_0x17f006[_0xbf9c('0x24')]+_0x17f006['limit'];var _0x2b81a2;if(_0x5735d5>=_0xb84ec6){_0x5735d5=_0xb84ec6;_0x2b81a2=0xc8;}else{_0x2b81a2=0xce;}_0x2d610d[_0xbf9c('0x23')](_0x2b81a2);return _0x2d610d[_0xbf9c('0x28')](_0xbf9c('0x29'),_0x5539ee+'-'+_0x5735d5+'/'+_0xb84ec6)['json'](_0x53ee65);}return null;};}function patchUpdates(_0x431ba8){return function(_0x57a3a4){try{jsonpatch[_0xbf9c('0x2a')](_0x57a3a4,_0x431ba8,!![]);}catch(_0x281057){return BPromise[_0xbf9c('0x2b')](_0x281057);}return _0x57a3a4[_0xbf9c('0x2c')]();};}function saveUpdates(_0x1597e9,_0x2ae0ce){return function(_0x1d7d26){if(_0x1d7d26){return _0x1d7d26[_0xbf9c('0x2d')](_0x1597e9)['then'](function(_0x3f3541){return _0x3f3541;});}return null;};}function removeEntity(_0x4cf83b,_0xcd9dd7){return function(_0x1cfe9a){if(_0x1cfe9a){return _0x1cfe9a['destroy']()[_0xbf9c('0x2e')](function(){_0x4cf83b['status'](0xcc)[_0xbf9c('0x2f')]();});}};}function handleEntityNotFound(_0x58f834,_0x37f30b){return function(_0x3f8dd4){if(!_0x3f8dd4){_0x58f834[_0xbf9c('0x30')](0x194);}return _0x3f8dd4;};}function handleError(_0x31cf2e,_0x1bc3cf){_0x1bc3cf=_0x1bc3cf||0x1f4;return function(_0x2ad2c3){logger[_0xbf9c('0x1e')](_0x2ad2c3[_0xbf9c('0x31')]);if(_0x2ad2c3['name']){delete _0x2ad2c3['name'];}_0x31cf2e[_0xbf9c('0x23')](_0x1bc3cf)[_0xbf9c('0x32')](_0x2ad2c3);};}exports[_0xbf9c('0x33')]=function(_0x440216,_0x2347d6){var _0x2faa73={},_0xd9a407={},_0x438de6={'count':0x0,'rows':[]};var _0x3e370d=_['map'](db[_0xbf9c('0x34')]['rawAttributes'],function(_0x560398){return{'name':_0x560398['fieldName'],'type':_0x560398[_0xbf9c('0x35')][_0xbf9c('0x36')]};});_0xd9a407['model']=_[_0xbf9c('0x37')](_0x3e370d,_0xbf9c('0x38'));_0xd9a407[_0xbf9c('0x39')]=_[_0xbf9c('0x3a')](_0x440216[_0xbf9c('0x39')]);_0xd9a407[_0xbf9c('0x3b')]=_[_0xbf9c('0x3c')](_0xd9a407['model'],_0xd9a407[_0xbf9c('0x39')]);_0x2faa73[_0xbf9c('0x3d')]=_[_0xbf9c('0x3c')](_0xd9a407['model'],qs['fields'](_0x440216[_0xbf9c('0x39')]['fields']));_0x2faa73[_0xbf9c('0x3d')]=_0x2faa73[_0xbf9c('0x3d')][_0xbf9c('0x3e')]?_0x2faa73['attributes']:_0xd9a407[_0xbf9c('0x3f')];if(!_0x440216[_0xbf9c('0x39')][_0xbf9c('0x40')](_0xbf9c('0x41'))){_0x2faa73['limit']=qs[_0xbf9c('0x26')](_0x440216[_0xbf9c('0x39')][_0xbf9c('0x26')]);_0x2faa73[_0xbf9c('0x24')]=qs[_0xbf9c('0x24')](_0x440216[_0xbf9c('0x39')][_0xbf9c('0x24')]);}_0x2faa73[_0xbf9c('0x42')]=qs[_0xbf9c('0x43')](_0x440216[_0xbf9c('0x39')]['sort']);_0x2faa73['where']=qs[_0xbf9c('0x3b')](_['pick'](_0x440216[_0xbf9c('0x39')],_0xd9a407[_0xbf9c('0x3b')]),_0x3e370d);if(_0x440216[_0xbf9c('0x39')][_0xbf9c('0x44')]){_0x2faa73[_0xbf9c('0x45')]=_[_0xbf9c('0x46')](_0x2faa73[_0xbf9c('0x45')],{'$or':_[_0xbf9c('0x37')](_0x3e370d,function(_0x7db1fb){if(_0x7db1fb[_0xbf9c('0x35')]!==_0xbf9c('0x47')){var _0xcbae42={};_0xcbae42[_0x7db1fb[_0xbf9c('0x38')]]={'$like':'%'+_0x440216[_0xbf9c('0x39')][_0xbf9c('0x44')]+'%'};return _0xcbae42;}})});}_0x2faa73=_[_0xbf9c('0x46')]({},_0x2faa73,_0x440216[_0xbf9c('0x48')]);var _0x3ddb8c={'where':_0x2faa73['where']};return db['Setting'][_0xbf9c('0x27')](_0x3ddb8c)[_0xbf9c('0x2e')](function(_0x8946ed){_0x438de6[_0xbf9c('0x27')]=_0x8946ed;if(_0x440216[_0xbf9c('0x39')]['includeAll']){_0x2faa73[_0xbf9c('0x49')]=[{'all':!![]}];}return db[_0xbf9c('0x34')][_0xbf9c('0x4a')](_0x2faa73);})[_0xbf9c('0x2e')](function(_0x12d376){_0x438de6['rows']=_0x12d376;return _0x438de6;})[_0xbf9c('0x2e')](respondWithFilteredResult(_0x2347d6,_0x2faa73))['catch'](handleError(_0x2347d6,null));};exports['show']=function(_0x405a68,_0x59742e){var _0x591d6c={'raw':![],'where':{'id':_0x405a68[_0xbf9c('0x4b')]['id']}},_0x414703={};_0x414703[_0xbf9c('0x3f')]=_['keys'](db[_0xbf9c('0x34')]['rawAttributes']);_0x414703[_0xbf9c('0x39')]=_[_0xbf9c('0x3a')](_0x405a68['query']);_0x414703[_0xbf9c('0x3b')]=_[_0xbf9c('0x3c')](_0x414703[_0xbf9c('0x3f')],_0x414703[_0xbf9c('0x39')]);_0x591d6c['attributes']=_[_0xbf9c('0x3c')](_0x414703[_0xbf9c('0x3f')],qs['fields'](_0x405a68[_0xbf9c('0x39')][_0xbf9c('0x4c')]));_0x591d6c[_0xbf9c('0x3d')]=_0x591d6c[_0xbf9c('0x3d')][_0xbf9c('0x3e')]?_0x591d6c[_0xbf9c('0x3d')]:_0x414703[_0xbf9c('0x3f')];if(_0x405a68['query'][_0xbf9c('0x4d')]){_0x591d6c[_0xbf9c('0x49')]=[{'all':!![]}];}_0x591d6c=_[_0xbf9c('0x46')]({},_0x591d6c,_0x405a68['options']);return db[_0xbf9c('0x34')]['find'](_0x591d6c)[_0xbf9c('0x2e')](handleEntityNotFound(_0x59742e,null))[_0xbf9c('0x2e')](respondWithResult(_0x59742e,null))['catch'](handleError(_0x59742e,null));};exports['update']=function(_0x10117b,_0x3ef9d7){if(_0x10117b[_0xbf9c('0x4e')]['id']){delete _0x10117b[_0xbf9c('0x4e')]['id'];}return db[_0xbf9c('0x34')][_0xbf9c('0x4f')]({'where':{'id':_0x10117b[_0xbf9c('0x4b')]['id']}})[_0xbf9c('0x2e')](handleEntityNotFound(_0x3ef9d7,null))[_0xbf9c('0x2e')](saveUpdates(_0x10117b[_0xbf9c('0x4e')],null))[_0xbf9c('0x2e')](respondWithResult(_0x3ef9d7,null))['catch'](handleError(_0x3ef9d7,null));};exports[_0xbf9c('0x50')]=function(_0x128b7a,_0xcde4d0,_0x3c037e){if(_0x128b7a[_0xbf9c('0x51')]&&_0x128b7a[_0xbf9c('0x51')][_0xbf9c('0x52')]){_0x128b7a[_0xbf9c('0x4e')][_0xbf9c('0x53')]=_0x128b7a[_0xbf9c('0x51')]['filename'];}return db['Setting'][_0xbf9c('0x4f')]({'where':{'id':_0x128b7a['params']['id']}})[_0xbf9c('0x2e')](handleEntityNotFound(_0xcde4d0,null))[_0xbf9c('0x2e')](saveUpdates(_0x128b7a[_0xbf9c('0x4e')],null))[_0xbf9c('0x2e')](respondWithResult(_0xcde4d0,null))[_0xbf9c('0x22')](handleError(_0xcde4d0,null));};exports[_0xbf9c('0x54')]=function(_0x3a2387,_0x154ec8,_0x210969){if(_0x3a2387[_0xbf9c('0x51')]&&_0x3a2387[_0xbf9c('0x51')]['filename']){_0x3a2387['body'][_0xbf9c('0x55')]=_0x3a2387['file'][_0xbf9c('0x52')];}return db[_0xbf9c('0x34')][_0xbf9c('0x4f')]({'where':{'id':_0x3a2387[_0xbf9c('0x4b')]['id']}})[_0xbf9c('0x2e')](handleEntityNotFound(_0x154ec8,null))['then'](saveUpdates(_0x3a2387[_0xbf9c('0x4e')],null))[_0xbf9c('0x2e')](respondWithResult(_0x154ec8,null))[_0xbf9c('0x22')](handleError(_0x154ec8,null));};var utilLicense=require(_0xbf9c('0x16'));exports[_0xbf9c('0x56')]=function(_0x2c8086,_0x57ef1a,_0x540c53){var _0x28827e=_0xbf9c('0x57');var _0x304a4d={'custom':![]};return utilLicense[_0xbf9c('0x58')]()['then'](function(_0x741365){if(_0x741365){_0x304a4d=_0x741365;}return db['Setting']['find']({'where':{'id':_0x2c8086['params']['id']},'attributes':[_0xbf9c('0x53'),_0xbf9c('0x55'),_0xbf9c('0x59'),_0xbf9c('0x5a'),_0xbf9c('0x5b'),_0xbf9c('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xbf9c('0x2e')](handleEntityNotFound(_0x57ef1a,null))[_0xbf9c('0x2e')](function(_0x355ed8){if(_0x355ed8){var _0x1873c0=_0x355ed8[_0xbf9c('0x53')]&&fs[_0xbf9c('0x5d')](path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x28827e,_[_0xbf9c('0x60')](_0x355ed8[_0xbf9c('0x53')])))?path['join'](config[_0xbf9c('0x5f')],_0x28827e,_[_0xbf9c('0x60')](_0x355ed8['logo'])):path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x28827e,_['toLower']('default_logo.svg'));var _0x1ec3a5=_0xbf9c('0x61')+_['upperFirst'](_0xbf9c('0x53'));if(_0x355ed8[_0x1ec3a5]||!_0x304a4d[_0xbf9c('0x62')]){_0x1873c0=path['join'](config[_0xbf9c('0x5f')],_0x28827e,_[_0xbf9c('0x60')](_0xbf9c('0x63')));}if(!fs[_0xbf9c('0x5d')](_0x1873c0)){throw new db[(_0xbf9c('0x64'))][(_0xbf9c('0x65'))](_[_0xbf9c('0x66')](_0xbf9c('0x53'))+'\x20not\x20found');}return _0x57ef1a[_0xbf9c('0x67')](_0x1873c0);}})[_0xbf9c('0x22')](handleError(_0x57ef1a,null));};var utilLicense=require('../../config/license/util');exports[_0xbf9c('0x68')]=function(_0x2d972d,_0x3ee5f8,_0x1c460e){var _0x1b8a0a=_0xbf9c('0x57');var _0x1a8e67={'custom':![]};return utilLicense[_0xbf9c('0x58')]()[_0xbf9c('0x2e')](function(_0x59ce67){if(_0x59ce67){_0x1a8e67=_0x59ce67;}return db[_0xbf9c('0x34')][_0xbf9c('0x4f')]({'where':{'id':_0x2d972d['params']['id']},'attributes':[_0xbf9c('0x53'),_0xbf9c('0x55'),_0xbf9c('0x59'),_0xbf9c('0x5a'),_0xbf9c('0x5b'),_0xbf9c('0x5c'),'defaultPreferred',_0xbf9c('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0x3ee5f8,null))['then'](function(_0x1c56ad){if(_0x1c56ad){var _0x171aed=_0x1c56ad['loginLogo']&&fs[_0xbf9c('0x5d')](path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x1b8a0a,_[_0xbf9c('0x60')](_0x1c56ad[_0xbf9c('0x55')])))?path[_0xbf9c('0x5e')](config['root'],_0x1b8a0a,_[_0xbf9c('0x60')](_0x1c56ad[_0xbf9c('0x55')])):path[_0xbf9c('0x5e')](config['root'],_0x1b8a0a,_['toLower']('default_loginLogo.svg'));var _0x10a70a='default'+_['upperFirst']('loginLogo');if(_0x1c56ad[_0x10a70a]||!_0x1a8e67[_0xbf9c('0x62')]){_0x171aed=path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x1b8a0a,_['toLower'](_0xbf9c('0x6a')));}if(!fs['existsSync'](_0x171aed)){throw new db[(_0xbf9c('0x64'))]['ValidationError'](_[_0xbf9c('0x66')](_0xbf9c('0x55'))+_0xbf9c('0x6b'));}return _0x3ee5f8[_0xbf9c('0x67')](_0x171aed);}})['catch'](handleError(_0x3ee5f8,null));};exports['gdpr']=function(_0x2c8d23,_0x4b3aef){return db[_0xbf9c('0x34')]['find']({'where':{'id':_0x2c8d23[_0xbf9c('0x4b')]['id']},'attributes':['securePassword']})[_0xbf9c('0x2e')](respondWithResult(_0x4b3aef,null))[_0xbf9c('0x22')](handleError(_0x4b3aef,null));};exports[_0xbf9c('0x6c')]=function(_0x339fce,_0x229f32,_0x1cdab9){if(_0x339fce[_0xbf9c('0x51')]&&_0x339fce[_0xbf9c('0x51')]['filename']){_0x339fce[_0xbf9c('0x4e')]['preferred']=_0x339fce['file'][_0xbf9c('0x52')];}return db[_0xbf9c('0x34')]['find']({'where':{'id':_0x339fce[_0xbf9c('0x4b')]['id']}})[_0xbf9c('0x2e')](handleEntityNotFound(_0x229f32,null))[_0xbf9c('0x2e')](saveUpdates(_0x339fce[_0xbf9c('0x4e')],null))[_0xbf9c('0x2e')](respondWithResult(_0x229f32,null))[_0xbf9c('0x22')](handleError(_0x229f32,null));};var utilLicense=require(_0xbf9c('0x16'));exports['getPreferred']=function(_0x26cec0,_0x294787,_0x263a4c){var _0x1ced21='server/files/images/logos';var _0x4b8573={'custom':![]};return utilLicense[_0xbf9c('0x58')]()[_0xbf9c('0x2e')](function(_0x4cdcf7){if(_0x4cdcf7){_0x4b8573=_0x4cdcf7;}return db[_0xbf9c('0x34')][_0xbf9c('0x4f')]({'where':{'id':_0x26cec0[_0xbf9c('0x4b')]['id']},'attributes':[_0xbf9c('0x53'),_0xbf9c('0x55'),_0xbf9c('0x59'),_0xbf9c('0x5a'),_0xbf9c('0x5b'),_0xbf9c('0x5c'),_0xbf9c('0x6d'),_0xbf9c('0x69')],'raw':!![]});})[_0xbf9c('0x2e')](handleEntityNotFound(_0x294787,null))['then'](function(_0x55906a){if(_0x55906a){var _0x50dc29=_0x55906a[_0xbf9c('0x59')]&&fs['existsSync'](path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x1ced21,_[_0xbf9c('0x60')](_0x55906a[_0xbf9c('0x59')])))?path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x1ced21,_[_0xbf9c('0x60')](_0x55906a[_0xbf9c('0x59')])):path[_0xbf9c('0x5e')](config['root'],_0x1ced21,_[_0xbf9c('0x60')](_0xbf9c('0x6e')));var _0x2e2516=_0xbf9c('0x61')+_[_0xbf9c('0x66')](_0xbf9c('0x59'));if(_0x55906a[_0x2e2516]||!_0x4b8573[_0xbf9c('0x62')]||!_0x4b8573[_0xbf9c('0x59')]){_0x50dc29=path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x1ced21,_[_0xbf9c('0x60')](_0xbf9c('0x6e')));}if(!fs[_0xbf9c('0x5d')](_0x50dc29)){throw new db[(_0xbf9c('0x64'))][(_0xbf9c('0x65'))](_['upperFirst'](_0xbf9c('0x59'))+_0xbf9c('0x6b'));}return _0x294787['download'](_0x50dc29);}})[_0xbf9c('0x22')](handleError(_0x294787,null));};exports['addFavicon']=function(_0xbcce04,_0xcf47dc,_0x490484){if(_0xbcce04[_0xbf9c('0x51')]&&_0xbcce04['file'][_0xbf9c('0x52')]){_0xbcce04[_0xbf9c('0x4e')]['favicon']=_0xbcce04[_0xbf9c('0x51')][_0xbf9c('0x52')];}return db[_0xbf9c('0x34')]['find']({'where':{'id':_0xbcce04['params']['id']}})[_0xbf9c('0x2e')](handleEntityNotFound(_0xcf47dc,null))[_0xbf9c('0x2e')](saveUpdates(_0xbcce04['body'],null))[_0xbf9c('0x2e')](respondWithResult(_0xcf47dc,null))[_0xbf9c('0x22')](handleError(_0xcf47dc,null));};var utilLicense=require('../../config/license/util');exports[_0xbf9c('0x6f')]=function(_0x1f3bcb,_0x3437db,_0x4f09c9){var _0x39a67e=_0xbf9c('0x57');var _0x4591ce={'custom':![]};return utilLicense[_0xbf9c('0x58')]()[_0xbf9c('0x2e')](function(_0x243121){if(_0x243121){_0x4591ce=_0x243121;}return db[_0xbf9c('0x34')][_0xbf9c('0x4f')]({'where':{'id':_0x1f3bcb[_0xbf9c('0x4b')]['id']},'attributes':['logo',_0xbf9c('0x55'),_0xbf9c('0x59'),_0xbf9c('0x5a'),'defaultLogo',_0xbf9c('0x5c'),_0xbf9c('0x6d'),'defaultFavicon'],'raw':!![]});})[_0xbf9c('0x2e')](handleEntityNotFound(_0x3437db,null))['then'](function(_0x1bb53a){if(_0x1bb53a){var _0x180f6c=_0x1bb53a[_0xbf9c('0x5a')]&&fs[_0xbf9c('0x5d')](path[_0xbf9c('0x5e')](config[_0xbf9c('0x5f')],_0x39a67e,_['toLower'](_0x1bb53a['favicon'])))?path[_0xbf9c('0x5e')](config['root'],_0x39a67e,_[_0xbf9c('0x60')](_0x1bb53a[_0xbf9c('0x5a')])):path[_0xbf9c('0x5e')](config['root'],_0x39a67e,_[_0xbf9c('0x60')](_0xbf9c('0x70')));var _0x479bb8=_0xbf9c('0x61')+_[_0xbf9c('0x66')](_0xbf9c('0x5a'));if(_0x1bb53a[_0x479bb8]||!_0x4591ce[_0xbf9c('0x62')]){_0x180f6c=path[_0xbf9c('0x5e')](config['root'],_0x39a67e,_['toLower'](_0xbf9c('0x70')));}if(!fs[_0xbf9c('0x5d')](_0x180f6c)){throw new db[(_0xbf9c('0x64'))][(_0xbf9c('0x65'))](_[_0xbf9c('0x66')](_0xbf9c('0x5a'))+_0xbf9c('0x6b'));}return _0x3437db['download'](_0x180f6c);}})['catch'](handleError(_0x3437db,null));};exports['getDate']=function(_0x42b14f,_0xd0c643){var _0x3d317b={'offset':moment()[_0xbf9c('0x71')]()};_0x3d317b['now']=moment()['utcOffset'](_0x3d317b[_0xbf9c('0x24')])[_0xbf9c('0x72')](_0xbf9c('0x73'));return _0xd0c643[_0xbf9c('0x23')](0xc8)['send'](_0x3d317b);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 664d5d4..d5d75dc 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x36fb68,_0x512f10){var _0x211522=function(_0x232a33){while(--_0x232a33){_0x36fb68['push'](_0x36fb68['shift']());}};_0x211522(++_0x512f10);}(_0x34e8,0x12c));var _0x834e=function(_0x381092,_0x405087){_0x381092=_0x381092-0x0;var _0xdb335e=_0x34e8[_0x381092];return _0xdb335e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x1a92ce,_0x5ba900){var _0x3e7afb=function(_0x2db1f7){while(--_0x2db1f7){_0x1a92ce['push'](_0x1a92ce['shift']());}};_0x3e7afb(++_0x5ba900);}(_0xe14b,0x93));var _0xbe14=function(_0x1036ec,_0x34c002){_0x1036ec=_0x1036ec-0x0;var _0x52a7b8=_0xe14b[_0x1036ec];return _0x52a7b8;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 9a1eb0a..457a526 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 _0x2719=['debug','stringify','error','code','message','result','catch','ShowSetting','Setting','raw','options','include','map','model','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0xd35504,_0x3cf188){var _0x133764=function(_0xb50ba8){while(--_0xb50ba8){_0xd35504['push'](_0xd35504['shift']());}};_0x133764(++_0x3cf188);}(_0x2719,0x1b3));var _0x9271=function(_0x38d4ac,_0x19cf87){_0x38d4ac=_0x38d4ac-0x0;var _0x3497fb=_0x2719[_0x38d4ac];return _0x3497fb;};'use strict';var _=require('lodash');var util=require(_0x9271('0x0'));var moment=require('moment');var BPromise=require(_0x9271('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9271('0x2'));var db=require(_0x9271('0x3'))['db'];var utils=require(_0x9271('0x4'));var logger=require(_0x9271('0x5'))(_0x9271('0x6'));var config=require(_0x9271('0x7'));var jayson=require(_0x9271('0x8'));var client=jayson['client'][_0x9271('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420031,_0x380fd7,_0x3fd001){return new BPromise(function(_0x56c19c,_0xaedc42){return client[_0x9271('0xa')](_0x420031,_0x3fd001)[_0x9271('0xb')](function(_0x3cd44b){logger[_0x9271('0xc')](_0x9271('0xd'),_0x380fd7,_0x9271('0xe'));logger[_0x9271('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x380fd7,'request\x20sent',JSON[_0x9271('0x10')](_0x3cd44b));if(_0x3cd44b[_0x9271('0x11')]){if(_0x3cd44b['error'][_0x9271('0x12')]===0x1f4){logger['error'](_0x9271('0xd'),_0x380fd7,_0x3cd44b[_0x9271('0x11')]['message']);return _0xaedc42(_0x3cd44b['error']['message']);}logger[_0x9271('0x11')]('Setting,\x20%s,\x20%s',_0x380fd7,_0x3cd44b[_0x9271('0x11')][_0x9271('0x13')]);return _0x56c19c(_0x3cd44b[_0x9271('0x11')][_0x9271('0x13')]);}else{logger[_0x9271('0xc')](_0x9271('0xd'),_0x380fd7,'request\x20sent');_0x56c19c(_0x3cd44b[_0x9271('0x14')][_0x9271('0x13')]);}})[_0x9271('0x15')](function(_0x2ce21d){logger[_0x9271('0x11')](_0x9271('0xd'),_0x380fd7,_0x2ce21d);_0xaedc42(_0x2ce21d);});});}exports[_0x9271('0x16')]=function(_0x57b3b4){var _0x46bb55=this;return new Promise(function(_0x1850ce,_0x11389c){return db[_0x9271('0x17')]['find']({'raw':_0x57b3b4['options']?_0x57b3b4['options'][_0x9271('0x18')]===undefined?!![]:![]:!![],'where':_0x57b3b4[_0x9271('0x19')]?_0x57b3b4[_0x9271('0x19')]['where']||null:null,'attributes':_0x57b3b4[_0x9271('0x19')]?_0x57b3b4[_0x9271('0x19')]['attributes']||null:null,'include':_0x57b3b4[_0x9271('0x19')]?_0x57b3b4[_0x9271('0x19')][_0x9271('0x1a')]?_[_0x9271('0x1b')](_0x57b3b4[_0x9271('0x19')][_0x9271('0x1a')],function(_0x5bbd4c){return{'model':db[_0x5bbd4c[_0x9271('0x1c')]],'as':_0x5bbd4c['as'],'attributes':_0x5bbd4c['attributes'],'include':_0x5bbd4c[_0x9271('0x1a')]?_[_0x9271('0x1b')](_0x5bbd4c[_0x9271('0x1a')],function(_0x460262){return{'model':db[_0x460262[_0x9271('0x1c')]],'as':_0x460262['as'],'attributes':_0x460262[_0x9271('0x1d')],'include':_0x460262[_0x9271('0x1a')]?_[_0x9271('0x1b')](_0x460262[_0x9271('0x1a')],function(_0x253c48){return{'model':db[_0x253c48[_0x9271('0x1c')]],'as':_0x253c48['as'],'attributes':_0x253c48[_0x9271('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x187bca){logger['info']('ShowSetting',_0x57b3b4);logger['debug'](_0x9271('0x16'),_0x57b3b4,JSON[_0x9271('0x10')](_0x187bca));_0x1850ce(_0x187bca);})[_0x9271('0x15')](function(_0x49755e){logger[_0x9271('0x11')]('ShowSetting',_0x49755e['message'],_0x57b3b4);_0x11389c(_0x46bb55['error'](0x1f4,_0x49755e[_0x9271('0x13')]));});});}; \ No newline at end of file +var _0xedec=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x2af02a,_0x50717c){var _0x461055=function(_0x4799aa){while(--_0x4799aa){_0x2af02a['push'](_0x2af02a['shift']());}};_0x461055(++_0x50717c);}(_0xedec,0xc3));var _0xcede=function(_0x5b7606,_0x3367ef){_0x5b7606=_0x5b7606-0x0;var _0x186584=_0xedec[_0x5b7606];return _0x186584;};'use strict';var _=require(_0xcede('0x0'));var util=require(_0xcede('0x1'));var moment=require(_0xcede('0x2'));var BPromise=require(_0xcede('0x3'));var rs=require(_0xcede('0x4'));var fs=require('fs');var Redis=require(_0xcede('0x5'));var db=require(_0xcede('0x6'))['db'];var utils=require(_0xcede('0x7'));var logger=require(_0xcede('0x8'))('rpc');var config=require(_0xcede('0x9'));var jayson=require(_0xcede('0xa'));var client=jayson[_0xcede('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59de91,_0x523b54,_0x4c2d66){return new BPromise(function(_0x250775,_0x39dbb0){return client[_0xcede('0xc')](_0x59de91,_0x4c2d66)[_0xcede('0xd')](function(_0x39563c){logger[_0xcede('0xe')](_0xcede('0xf'),_0x523b54,_0xcede('0x10'));logger[_0xcede('0x11')](_0xcede('0x12'),_0x523b54,_0xcede('0x10'),JSON[_0xcede('0x13')](_0x39563c));if(_0x39563c[_0xcede('0x14')]){if(_0x39563c[_0xcede('0x14')][_0xcede('0x15')]===0x1f4){logger[_0xcede('0x14')](_0xcede('0xf'),_0x523b54,_0x39563c['error'][_0xcede('0x16')]);return _0x39dbb0(_0x39563c[_0xcede('0x14')][_0xcede('0x16')]);}logger['error'](_0xcede('0xf'),_0x523b54,_0x39563c['error'][_0xcede('0x16')]);return _0x250775(_0x39563c['error']['message']);}else{logger[_0xcede('0xe')](_0xcede('0xf'),_0x523b54,_0xcede('0x10'));_0x250775(_0x39563c[_0xcede('0x17')][_0xcede('0x16')]);}})[_0xcede('0x18')](function(_0x1cb2f7){logger[_0xcede('0x14')](_0xcede('0xf'),_0x523b54,_0x1cb2f7);_0x39dbb0(_0x1cb2f7);});});}exports[_0xcede('0x19')]=function(_0x4a8103){var _0x30404b=this;return new Promise(function(_0x1ccf9d,_0x121ad0){return db[_0xcede('0x1a')][_0xcede('0x1b')]({'raw':_0x4a8103[_0xcede('0x1c')]?_0x4a8103[_0xcede('0x1c')][_0xcede('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a8103[_0xcede('0x1c')]?_0x4a8103[_0xcede('0x1c')][_0xcede('0x1e')]||null:null,'attributes':_0x4a8103['options']?_0x4a8103[_0xcede('0x1c')][_0xcede('0x1f')]||null:null,'include':_0x4a8103[_0xcede('0x1c')]?_0x4a8103[_0xcede('0x1c')][_0xcede('0x20')]?_[_0xcede('0x21')](_0x4a8103[_0xcede('0x1c')][_0xcede('0x20')],function(_0x18b11b){return{'model':db[_0x18b11b[_0xcede('0x22')]],'as':_0x18b11b['as'],'attributes':_0x18b11b[_0xcede('0x1f')],'include':_0x18b11b[_0xcede('0x20')]?_[_0xcede('0x21')](_0x18b11b['include'],function(_0x3d5e1b){return{'model':db[_0x3d5e1b[_0xcede('0x22')]],'as':_0x3d5e1b['as'],'attributes':_0x3d5e1b[_0xcede('0x1f')],'include':_0x3d5e1b[_0xcede('0x20')]?_[_0xcede('0x21')](_0x3d5e1b[_0xcede('0x20')],function(_0x1ac41d){return{'model':db[_0x1ac41d['model']],'as':_0x1ac41d['as'],'attributes':_0x1ac41d[_0xcede('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38a628){logger[_0xcede('0xe')](_0xcede('0x19'),_0x4a8103);logger['debug'](_0xcede('0x19'),_0x4a8103,JSON['stringify'](_0x38a628));_0x1ccf9d(_0x38a628);})[_0xcede('0x18')](function(_0x1b56a3){logger[_0xcede('0x14')](_0xcede('0x19'),_0x1b56a3[_0xcede('0x16')],_0x4a8103);_0x121ad0(_0x30404b[_0xcede('0x14')](0x1f4,_0x1b56a3[_0xcede('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8217265..c7423a7 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(_0xc3ab50,_0x2008de){var _0x2c4630=function(_0x50c77){while(--_0x50c77){_0xc3ab50['push'](_0xc3ab50['shift']());}};_0x2c4630(++_0x2008de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0xb003a,_0x890b20){var _0x561f79=function(_0x1a316a){while(--_0x1a316a){_0xb003a['push'](_0xb003a['shift']());}};_0x561f79(++_0x890b20);}(_0x5fc3,0xa8));var _0x35fc=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x5fc3[_0x397f37];return _0x31cae6;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 2f9e66f..dffafcc 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 _0x1f83=['name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING'];(function(_0x4fd802,_0x19a54d){var _0x2fd218=function(_0x5268f3){while(--_0x5268f3){_0x4fd802['push'](_0x4fd802['shift']());}};_0x2fd218(++_0x19a54d);}(_0x1f83,0x1e1));var _0x31f8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1f83[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x31f8('0x0'));var rs=require(_0x31f8('0x1'));module['exports']={'name':{'type':Sequelize[_0x31f8('0x2')],'unique':_0x31f8('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x31f8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x31f8('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x31f8('0x4')]();}},'phone':{'type':Sequelize[_0x31f8('0x2')]},'type':{'type':Sequelize[_0x31f8('0x5')](_0x31f8('0x6'),_0x31f8('0x7'),_0x31f8('0x8'),_0x31f8('0x9'),_0x31f8('0xa'),_0x31f8('0xb'),'bandwidth',_0x31f8('0xc'),'infobip',_0x31f8('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x31f8('0x2')]},'authToken':{'type':Sequelize[_0x31f8('0x2')]},'smsMethod':{'type':Sequelize[_0x31f8('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x31f8('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x31f8('0x2')]},'senderString':{'type':Sequelize[_0x31f8('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x31f8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x31f8('0xe')],'defaultValue':function(){return _0x31f8('0xf');}},'notificationSound':{'type':Sequelize[_0x31f8('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x31f8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x31f8('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x31f8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31f8('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x31f8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x31f8('0x11')],'comment':_0x31f8('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x31f8('0x10')],'defaultValue':![],'comment':_0x31f8('0x13'),'set':function(_0x149860){if(!_0x149860)this[_0x31f8('0x14')](_0x31f8('0x15'),null);this[_0x31f8('0x14')]('mandatoryDisposition',_0x149860);}}}; \ No newline at end of file +var _0x3c3e=['ENUM','skebby','clicksend','plivo','bandwidth','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','mandatoryDisposition','sequelize','randomstring','exports','name','STRING'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x3c3e,0x10c));var _0xe3c3=function(_0x1c7cd4,_0x207c65){_0x1c7cd4=_0x1c7cd4-0x0;var _0x4192bd=_0x3c3e[_0x1c7cd4];return _0x4192bd;};'use strict';var Sequelize=require(_0xe3c3('0x0'));var rs=require(_0xe3c3('0x1'));module[_0xe3c3('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xe3c3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xe3c3('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xe3c3('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xe3c3('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe3c3('0x4')]},'type':{'type':Sequelize[_0xe3c3('0x5')]('twilio',_0xe3c3('0x6'),'connectel',_0xe3c3('0x7'),_0xe3c3('0x8'),'clickatell',_0xe3c3('0x9'),'csc',_0xe3c3('0xa'),_0xe3c3('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xe3c3('0x4')]},'authToken':{'type':Sequelize[_0xe3c3('0x4')]},'smsMethod':{'type':Sequelize[_0xe3c3('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe3c3('0x4')]},'password':{'type':Sequelize[_0xe3c3('0x4')]},'apiKey':{'type':Sequelize[_0xe3c3('0x4')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xe3c3('0x4')]},'deliveryReport':{'type':Sequelize[_0xe3c3('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xe3c3('0x4')]},'notificationTemplate':{'type':Sequelize[_0xe3c3('0xd')],'defaultValue':function(){return _0xe3c3('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe3c3('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe3c3('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe3c3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe3c3('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3c3('0xf')],'comment':_0xe3c3('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xe3c3('0xc')],'defaultValue':![],'comment':_0xe3c3('0x11'),'set':function(_0x250b10){if(!_0x250b10)this[_0xe3c3('0x12')](_0xe3c3('0x13'),null);this['setDataValue'](_0xe3c3('0x14'),_0x250b10);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5a909b8..dbbf09d 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 _0xf11b=['push','close','SmsMessage','ContactId','UserId','User','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','\x0a','sequelize','SmsApplication','bulkCreate','findAndCountAll','getApplications','SmsInteraction','Contact','Owner','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','user','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','DELIVERED','groupName','redif','SmsAccount,\x20%s,\x20%s,\x20%s','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','destroy','get','end','name','send','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','SmsAccount','includeAll','include','findAll','rows','show','params','Pause','rawAttributes','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','omit','Contacts','interaction','created','autoclose'];(function(_0x4d256f,_0x186b29){var _0x386622=function(_0x1e9d6d){while(--_0x1e9d6d){_0x4d256f['push'](_0x4d256f['shift']());}};_0x386622(++_0x186b29);}(_0xf11b,0x11b));var _0xbf11=function(_0x1361e6,_0x3e225c){_0x1361e6=_0x1361e6-0x0;var _0x3017e5=_0xf11b[_0x1361e6];return _0x3017e5;};'use strict';var emlformat=require(_0xbf11('0x0'));var rimraf=require(_0xbf11('0x1'));var zipdir=require(_0xbf11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf11('0x3'));var moment=require(_0xbf11('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf11('0x5'));var path=require(_0xbf11('0x6'));var sox=require('sox');var csv=require(_0xbf11('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf11('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf11('0x9'));var jsforce=require(_0xbf11('0xa'));var deskjs=require(_0xbf11('0xb'));var toCsv=require(_0xbf11('0x7'));var querystring=require('querystring');var Papa=require(_0xbf11('0xc'));var Redis=require(_0xbf11('0xd'));var authService=require(_0xbf11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbf11('0xf'));var hardwareService=require(_0xbf11('0x10'));var logger=require(_0xbf11('0x11'))(_0xbf11('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbf11('0x13'));var db=require(_0xbf11('0x14'))['db'];config[_0xbf11('0x15')]=_[_0xbf11('0x16')](config[_0xbf11('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf11('0x17'))(new Redis(config['redis']));require(_0xbf11('0x18'))[_0xbf11('0x19')](socket);var jayson=require(_0xbf11('0x1a'));var client=jayson['client'][_0xbf11('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x34d603,_0x3fb843,_0x362505,_0x51eccc){return new BPromise(function(_0x4e1edb,_0x52e299){var _0x13186c=_0x51eccc||client;return _0x13186c[_0xbf11('0x1c')](_0x34d603,_0x362505)[_0xbf11('0x1d')](function(_0x2e7bae){logger['info'](_0xbf11('0x1e'),_0x3fb843,'request\x20sent');logger[_0xbf11('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb843,_0xbf11('0x20'),JSON[_0xbf11('0x21')](_0x2e7bae));if(_0x2e7bae['error']){if(_0x2e7bae[_0xbf11('0x22')][_0xbf11('0x23')]===0x1f4){logger[_0xbf11('0x22')](_0xbf11('0x1e'),_0x3fb843,_0x2e7bae[_0xbf11('0x22')][_0xbf11('0x24')]);return _0x52e299(_0x2e7bae[_0xbf11('0x22')][_0xbf11('0x24')]);}logger['error'](_0xbf11('0x1e'),_0x3fb843,_0x2e7bae['error'][_0xbf11('0x24')]);return _0x4e1edb(_0x2e7bae['error'][_0xbf11('0x24')]);}else{logger[_0xbf11('0x25')](_0xbf11('0x1e'),_0x3fb843,_0xbf11('0x20'));_0x4e1edb(_0x2e7bae[_0xbf11('0x26')][_0xbf11('0x24')]);}})[_0xbf11('0x27')](function(_0x5570d4){logger[_0xbf11('0x22')]('SmsAccount,\x20%s,\x20%s',_0x3fb843,_0x5570d4);_0x52e299(_0x5570d4);});});}function respondWithStatusCode(_0x477904,_0x288881){_0x288881=_0x288881||0xcc;return function(_0x49cbad){if(_0x49cbad){return _0x477904[_0xbf11('0x28')](_0x288881);}return _0x477904[_0xbf11('0x29')](_0x288881)['end']();};}function respondWithResult(_0x2511e8,_0x4d04b1){_0x4d04b1=_0x4d04b1||0xc8;return function(_0x10ce74){if(_0x10ce74){return _0x2511e8['status'](_0x4d04b1)['json'](_0x10ce74);}};}function respondWithFilteredResult(_0x105ce0,_0x24d40a){return function(_0x1f8be){if(_0x1f8be){var _0x561125=typeof _0x24d40a['offset']===_0xbf11('0x2a')&&typeof _0x24d40a[_0xbf11('0x2b')]===_0xbf11('0x2a');var _0x2d05cc=_0x1f8be[_0xbf11('0x2c')];var _0x13413a=_0x561125?0x0:_0x24d40a[_0xbf11('0x2d')];var _0x3c5609=_0x561125?_0x1f8be[_0xbf11('0x2c')]:_0x24d40a[_0xbf11('0x2d')]+_0x24d40a[_0xbf11('0x2b')];var _0x39a273;if(_0x3c5609>=_0x2d05cc){_0x3c5609=_0x2d05cc;_0x39a273=0xc8;}else{_0x39a273=0xce;}_0x105ce0['status'](_0x39a273);return _0x105ce0[_0xbf11('0x2e')](_0xbf11('0x2f'),_0x13413a+'-'+_0x3c5609+'/'+_0x2d05cc)[_0xbf11('0x30')](_0x1f8be);}return null;};}function patchUpdates(_0x1a69da){return function(_0x59eba5){try{jsonpatch[_0xbf11('0x31')](_0x59eba5,_0x1a69da,!![]);}catch(_0x54845a){return BPromise[_0xbf11('0x32')](_0x54845a);}return _0x59eba5['save']();};}function saveUpdates(_0x54f3a5,_0x5459b4){return function(_0x3c4fcc){if(_0x3c4fcc){return _0x3c4fcc['update'](_0x54f3a5)[_0xbf11('0x1d')](function(_0x57ac79){return _0x57ac79;});}return null;};}function removeEntity(_0xc7110f,_0x219522){return function(_0x473349){if(_0x473349){return _0x473349[_0xbf11('0x33')]()[_0xbf11('0x1d')](function(){var _0x3f7ace=_0x473349[_0xbf11('0x34')]({'plain':!![]});var _0xa8f846='SmsAccounts';return db['UserProfileResource'][_0xbf11('0x33')]({'where':{'type':_0xa8f846,'resourceId':_0x3f7ace['id']}})[_0xbf11('0x1d')](function(){return _0x473349;});})['then'](function(){_0xc7110f[_0xbf11('0x29')](0xcc)[_0xbf11('0x35')]();});}};}function handleEntityNotFound(_0xd7b2c1,_0x441723){return function(_0x58a7fc){if(!_0x58a7fc){_0xd7b2c1[_0xbf11('0x28')](0x194);}return _0x58a7fc;};}function handleError(_0x104d29,_0x118a3e){_0x118a3e=_0x118a3e||0x1f4;return function(_0x41a6ea){logger[_0xbf11('0x22')](_0x41a6ea['stack']);if(_0x41a6ea['name']){delete _0x41a6ea[_0xbf11('0x36')];}_0x104d29[_0xbf11('0x29')](_0x118a3e)[_0xbf11('0x37')](_0x41a6ea);};}exports[_0xbf11('0x38')]=function(_0x2b6c37,_0x5f252d){var _0x2a7ebf={'include':[{'model':db['Pause'],'as':_0xbf11('0x39')}]},_0x49bea1={},_0x59c88e={'count':0x0,'rows':[]};var _0x38b2da=_[_0xbf11('0x3a')](db['SmsAccount']['rawAttributes'],function(_0x56384a){return{'name':_0x56384a[_0xbf11('0x3b')],'type':_0x56384a[_0xbf11('0x3c')][_0xbf11('0x3d')]};});_0x49bea1[_0xbf11('0x3e')]=_['map'](_0x38b2da,_0xbf11('0x36'));_0x49bea1[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x2b6c37['query']);_0x49bea1[_0xbf11('0x41')]=_['intersection'](_0x49bea1[_0xbf11('0x3e')],_0x49bea1[_0xbf11('0x3f')]);_0x2a7ebf[_0xbf11('0x42')]=_[_0xbf11('0x43')](_0x49bea1['model'],qs[_0xbf11('0x44')](_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x2a7ebf[_0xbf11('0x42')]=_0x2a7ebf[_0xbf11('0x42')][_0xbf11('0x45')]?_0x2a7ebf[_0xbf11('0x42')]:_0x49bea1['model'];if(!_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x46')](_0xbf11('0x47'))){_0x2a7ebf[_0xbf11('0x2b')]=qs[_0xbf11('0x2b')](_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x2b')]);_0x2a7ebf['offset']=qs[_0xbf11('0x2d')](_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x2d')]);}_0x2a7ebf[_0xbf11('0x48')]=qs['sort'](_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x49')]);_0x2a7ebf['where']=qs['filters'](_[_0xbf11('0x4a')](_0x2b6c37[_0xbf11('0x3f')],_0x49bea1[_0xbf11('0x41')]),_0x38b2da);if(_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x4b')]){_0x2a7ebf[_0xbf11('0x4c')]=_[_0xbf11('0x4d')](_0x2a7ebf[_0xbf11('0x4c')],{'$or':_[_0xbf11('0x3a')](_0x38b2da,function(_0x30c7d8){if(_0x30c7d8[_0xbf11('0x3c')]!==_0xbf11('0x4e')){var _0x1d9d9f={};_0x1d9d9f[_0x30c7d8[_0xbf11('0x36')]]={'$like':'%'+_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x4b')]+'%'};return _0x1d9d9f;}})});}_0x2a7ebf=_[_0xbf11('0x4d')]({},_0x2a7ebf,_0x2b6c37['options']);var _0x5ce973={'where':_0x2a7ebf[_0xbf11('0x4c')]};return db[_0xbf11('0x4f')][_0xbf11('0x2c')](_0x5ce973)[_0xbf11('0x1d')](function(_0x24b5d1){_0x59c88e[_0xbf11('0x2c')]=_0x24b5d1;if(_0x2b6c37[_0xbf11('0x3f')][_0xbf11('0x50')]){_0x2a7ebf[_0xbf11('0x51')]=[{'all':!![]}];}return db[_0xbf11('0x4f')][_0xbf11('0x52')](_0x2a7ebf);})[_0xbf11('0x1d')](function(_0xc5af){_0x59c88e[_0xbf11('0x53')]=_0xc5af;return _0x59c88e;})[_0xbf11('0x1d')](respondWithFilteredResult(_0x5f252d,_0x2a7ebf))['catch'](handleError(_0x5f252d,null));};exports[_0xbf11('0x54')]=function(_0x268071,_0x1a1725){var _0x25dcbe={'raw':![],'where':{'id':_0x268071[_0xbf11('0x55')]['id']},'include':[{'model':db[_0xbf11('0x56')],'as':_0xbf11('0x39')}]},_0x5533f2={};_0x5533f2[_0xbf11('0x3e')]=_[_0xbf11('0x40')](db[_0xbf11('0x4f')][_0xbf11('0x57')]);_0x5533f2[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x268071[_0xbf11('0x3f')]);_0x5533f2[_0xbf11('0x41')]=_['intersection'](_0x5533f2[_0xbf11('0x3e')],_0x5533f2[_0xbf11('0x3f')]);_0x25dcbe[_0xbf11('0x42')]=_[_0xbf11('0x43')](_0x5533f2[_0xbf11('0x3e')],qs[_0xbf11('0x44')](_0x268071[_0xbf11('0x3f')]['fields']));_0x25dcbe[_0xbf11('0x42')]=_0x25dcbe[_0xbf11('0x42')]['length']?_0x25dcbe[_0xbf11('0x42')]:_0x5533f2[_0xbf11('0x3e')];if(_0x268071['query'][_0xbf11('0x50')]){_0x25dcbe[_0xbf11('0x51')]=[{'all':!![]}];}_0x25dcbe=_['merge']({},_0x25dcbe,_0x268071[_0xbf11('0x58')]);return db[_0xbf11('0x4f')]['find'](_0x25dcbe)[_0xbf11('0x1d')](handleEntityNotFound(_0x1a1725,null))['then'](respondWithResult(_0x1a1725,null))[_0xbf11('0x27')](handleError(_0x1a1725,null));};exports[_0xbf11('0x59')]=function(_0x509e58,_0x8d87a5){return db[_0xbf11('0x4f')][_0xbf11('0x59')](_0x509e58['body'],{})['then'](function(_0x404753){var _0x4bcc9e=_0x509e58['user'][_0xbf11('0x34')]({'plain':!![]});if(!_0x4bcc9e)throw new Error(_0xbf11('0x5a'));if(_0x4bcc9e[_0xbf11('0x5b')]==='user'){var _0x892847=_0x404753['get']({'plain':!![]});var _0x385d8d=_0xbf11('0x5c');return db['UserProfileSection'][_0xbf11('0x5d')]({'where':{'name':_0x385d8d,'userProfileId':_0x4bcc9e[_0xbf11('0x5e')]},'raw':!![]})[_0xbf11('0x1d')](function(_0x2d05c1){if(_0x2d05c1&&_0x2d05c1[_0xbf11('0x5f')]===0x0){return db[_0xbf11('0x60')][_0xbf11('0x59')]({'name':_0x892847[_0xbf11('0x36')],'resourceId':_0x892847['id'],'type':_0x2d05c1[_0xbf11('0x36')],'sectionId':_0x2d05c1['id']},{})[_0xbf11('0x1d')](function(){return _0x404753;});}else{return _0x404753;}})[_0xbf11('0x27')](function(_0x16f9b9){logger[_0xbf11('0x22')](_0xbf11('0x61'),_0x16f9b9);throw _0x16f9b9;});}return _0x404753;})[_0xbf11('0x1d')](respondWithResult(_0x8d87a5,0xc9))[_0xbf11('0x27')](handleError(_0x8d87a5,null));};exports[_0xbf11('0x62')]=function(_0x4e721f,_0x205152){if(_0x4e721f[_0xbf11('0x63')]['id']){delete _0x4e721f['body']['id'];}return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x4e721f[_0xbf11('0x55')]['id']},'include':[{'model':db[_0xbf11('0x56')],'as':_0xbf11('0x39')}]})[_0xbf11('0x1d')](handleEntityNotFound(_0x205152,null))[_0xbf11('0x1d')](saveUpdates(_0x4e721f[_0xbf11('0x63')],null))[_0xbf11('0x1d')](respondWithResult(_0x205152,null))[_0xbf11('0x27')](handleError(_0x205152,null));};exports[_0xbf11('0x33')]=function(_0x246873,_0x34ad9d){return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x246873[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x34ad9d,null))[_0xbf11('0x1d')](removeEntity(_0x34ad9d,null))[_0xbf11('0x27')](handleError(_0x34ad9d,null));};exports[_0xbf11('0x64')]=function(_0x2d3b80,_0x1c30cf){return db['SmsAccount']['describe']()[_0xbf11('0x1d')](respondWithResult(_0x1c30cf,null))[_0xbf11('0x27')](handleError(_0x1c30cf,null));};exports[_0xbf11('0x65')]=function(_0x50115b,_0x3c69fd,_0xc84653){if(_0x50115b['body']['id']){delete _0x50115b[_0xbf11('0x63')]['id'];}return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x50115b[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x3c69fd,null))[_0xbf11('0x1d')](function(_0x5eaae9){if(_0x5eaae9){_0x50115b[_0xbf11('0x63')][_0xbf11('0x66')]=_0x5eaae9['id'];return db[_0xbf11('0x67')][_0xbf11('0x59')](_0x50115b['body']);}})['then'](respondWithResult(_0x3c69fd,null))[_0xbf11('0x27')](handleError(_0x3c69fd,null));};exports[_0xbf11('0x68')]=function(_0x7d2831,_0x4aad97,_0x8a89c8){var _0x51e902={'raw':![],'where':{}};var _0x541c11={};var _0x3eaea1={'count':0x0,'rows':[]};return db[_0xbf11('0x4f')][_0xbf11('0x69')]({'where':{'id':_0x7d2831[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x4aad97,null))[_0xbf11('0x1d')](function(_0x488c92){if(_0x488c92){_0x541c11[_0xbf11('0x3e')]=_[_0xbf11('0x40')](db['Disposition'][_0xbf11('0x57')]);_0x541c11[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x7d2831[_0xbf11('0x3f')]);_0x541c11[_0xbf11('0x41')]=_['intersection'](_0x541c11[_0xbf11('0x3e')],_0x541c11['query']);_0x51e902[_0xbf11('0x42')]=_[_0xbf11('0x43')](_0x541c11[_0xbf11('0x3e')],qs['fields'](_0x7d2831[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x51e902[_0xbf11('0x42')]=_0x51e902[_0xbf11('0x42')]['length']?_0x51e902[_0xbf11('0x42')]:_0x541c11[_0xbf11('0x3e')];if(!_0x7d2831[_0xbf11('0x3f')][_0xbf11('0x46')]('nolimit')){_0x51e902['limit']=qs[_0xbf11('0x2b')](_0x7d2831[_0xbf11('0x3f')]['limit']);_0x51e902['offset']=qs[_0xbf11('0x2d')](_0x7d2831[_0xbf11('0x3f')][_0xbf11('0x2d')]);}_0x51e902['order']=qs[_0xbf11('0x49')](_0x7d2831[_0xbf11('0x3f')]['sort']);_0x51e902[_0xbf11('0x4c')]=qs[_0xbf11('0x41')](_['pick'](_0x7d2831['query'],_0x541c11[_0xbf11('0x41')]));_0x51e902['where'][_0xbf11('0x66')]=_0x488c92['id'];if(_0x7d2831[_0xbf11('0x3f')]['filter']){_0x51e902[_0xbf11('0x4c')]=_[_0xbf11('0x4d')](_0x51e902['where'],{'$or':_['map'](_0x51e902['attributes'],function(_0x23b201){var _0x5c571f={};_0x5c571f[_0x23b201]={'$like':'%'+_0x7d2831[_0xbf11('0x3f')][_0xbf11('0x4b')]+'%'};return _0x5c571f;})});}_0x51e902=_[_0xbf11('0x4d')]({},_0x51e902,_0x7d2831[_0xbf11('0x58')]);return db[_0xbf11('0x67')][_0xbf11('0x2c')]({'where':_0x51e902['where']})[_0xbf11('0x1d')](function(_0x2b86d0){_0x3eaea1[_0xbf11('0x2c')]=_0x2b86d0;if(_0x7d2831[_0xbf11('0x3f')][_0xbf11('0x50')]){_0x51e902['include']=[{'all':!![]}];}return db['Disposition'][_0xbf11('0x52')](_0x51e902);})[_0xbf11('0x1d')](function(_0x42fe31){_0x3eaea1[_0xbf11('0x53')]=_0x42fe31;return _0x3eaea1;});}})[_0xbf11('0x1d')](respondWithFilteredResult(_0x4aad97,_0x51e902))[_0xbf11('0x27')](handleError(_0x4aad97,null));};exports[_0xbf11('0x6a')]=function(_0x8d7b0a,_0x78ed9d,_0x3099b6){return db['SmsAccount'][_0xbf11('0x5d')]({'where':{'id':_0x8d7b0a['params']['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x78ed9d,null))[_0xbf11('0x1d')](function(_0x11c1b1){if(_0x11c1b1){return _0x11c1b1[_0xbf11('0x6a')](_0x8d7b0a[_0xbf11('0x3f')][_0xbf11('0x6b')]);}})[_0xbf11('0x1d')](respondWithStatusCode(_0x78ed9d,null))[_0xbf11('0x27')](handleError(_0x78ed9d,null));};exports[_0xbf11('0x6c')]=function(_0x4e8e86,_0x5c4f5b,_0x1859f3){if(_0x4e8e86[_0xbf11('0x63')]['id']){delete _0x4e8e86[_0xbf11('0x63')]['id'];}return db[_0xbf11('0x4f')]['find']({'where':{'id':_0x4e8e86[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x5c4f5b,null))[_0xbf11('0x1d')](function(_0x27c45c){if(_0x27c45c){_0x4e8e86['body'][_0xbf11('0x66')]=_0x27c45c['id'];return db[_0xbf11('0x6d')][_0xbf11('0x59')](_0x4e8e86[_0xbf11('0x63')]);}})[_0xbf11('0x1d')](respondWithResult(_0x5c4f5b,null))[_0xbf11('0x27')](handleError(_0x5c4f5b,null));};exports['getAnswers']=function(_0x321166,_0x367633,_0x37a25e){var _0x46f00a={'raw':![],'where':{}};var _0x348758={};var _0x5c013a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xbf11('0x69')]({'where':{'id':_0x321166[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x367633,null))[_0xbf11('0x1d')](function(_0x50211a){if(_0x50211a){_0x348758[_0xbf11('0x3e')]=_[_0xbf11('0x40')](db[_0xbf11('0x6d')]['rawAttributes']);_0x348758['query']=_['keys'](_0x321166[_0xbf11('0x3f')]);_0x348758[_0xbf11('0x41')]=_[_0xbf11('0x43')](_0x348758[_0xbf11('0x3e')],_0x348758[_0xbf11('0x3f')]);_0x46f00a[_0xbf11('0x42')]=_['intersection'](_0x348758[_0xbf11('0x3e')],qs[_0xbf11('0x44')](_0x321166[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x46f00a[_0xbf11('0x42')]=_0x46f00a[_0xbf11('0x42')]['length']?_0x46f00a[_0xbf11('0x42')]:_0x348758[_0xbf11('0x3e')];if(!_0x321166[_0xbf11('0x3f')][_0xbf11('0x46')](_0xbf11('0x47'))){_0x46f00a[_0xbf11('0x2b')]=qs['limit'](_0x321166[_0xbf11('0x3f')][_0xbf11('0x2b')]);_0x46f00a[_0xbf11('0x2d')]=qs['offset'](_0x321166[_0xbf11('0x3f')][_0xbf11('0x2d')]);}_0x46f00a[_0xbf11('0x48')]=qs[_0xbf11('0x49')](_0x321166[_0xbf11('0x3f')][_0xbf11('0x49')]);_0x46f00a[_0xbf11('0x4c')]=qs[_0xbf11('0x41')](_[_0xbf11('0x4a')](_0x321166[_0xbf11('0x3f')],_0x348758[_0xbf11('0x41')]));_0x46f00a['where'][_0xbf11('0x66')]=_0x50211a['id'];if(_0x321166['query'][_0xbf11('0x4b')]){_0x46f00a[_0xbf11('0x4c')]=_[_0xbf11('0x4d')](_0x46f00a[_0xbf11('0x4c')],{'$or':_[_0xbf11('0x3a')](_0x46f00a[_0xbf11('0x42')],function(_0x2e17d8){var _0x4843cd={};_0x4843cd[_0x2e17d8]={'$like':'%'+_0x321166[_0xbf11('0x3f')]['filter']+'%'};return _0x4843cd;})});}_0x46f00a=_[_0xbf11('0x4d')]({},_0x46f00a,_0x321166[_0xbf11('0x58')]);return db[_0xbf11('0x6d')][_0xbf11('0x2c')]({'where':_0x46f00a[_0xbf11('0x4c')]})[_0xbf11('0x1d')](function(_0x2d0d83){_0x5c013a['count']=_0x2d0d83;if(_0x321166[_0xbf11('0x3f')][_0xbf11('0x50')]){_0x46f00a[_0xbf11('0x51')]=[{'all':!![]}];}return db[_0xbf11('0x6d')][_0xbf11('0x52')](_0x46f00a);})['then'](function(_0x172719){_0x5c013a[_0xbf11('0x53')]=_0x172719;return _0x5c013a;});}})[_0xbf11('0x1d')](respondWithFilteredResult(_0x367633,_0x46f00a))['catch'](handleError(_0x367633,null));};exports[_0xbf11('0x6e')]=function(_0x34ea85,_0x3476c3,_0xc1ba93){return db[_0xbf11('0x4f')]['find']({'where':{'id':_0x34ea85[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x3476c3,null))[_0xbf11('0x1d')](function(_0x2f6cbb){if(_0x2f6cbb){return _0x2f6cbb[_0xbf11('0x6e')](_0x34ea85['query'][_0xbf11('0x6b')]);}})[_0xbf11('0x1d')](respondWithStatusCode(_0x3476c3,null))[_0xbf11('0x27')](handleError(_0x3476c3,null));};exports[_0xbf11('0x6f')]=function(_0x4ef25d,_0x3b2799,_0x3a5d40){var _0x3a3a3d={'channel':_0xbf11('0x70')};var _0x46c2d7=[];var _0xae5e2d=[];var _0x3a102b={};return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x4ef25d[_0xbf11('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xbf11('0x71')}]})[_0xbf11('0x1d')](handleEntityNotFound(_0x3b2799,null))[_0xbf11('0x1d')](function(_0x5e3473){_0x3a3a3d[_0xbf11('0x72')]=_0x5e3473;_0x3a3a3d[_0xbf11('0x73')]=_[_0xbf11('0x74')](_0x5e3473[_0xbf11('0x71')],[_0xbf11('0x75')],[_0xbf11('0x76')]);if(_0x3a3a3d['account'][_0xbf11('0x71')]){delete _0x3a3a3d['account'][_0xbf11('0x71')];}return db[_0xbf11('0x77')][_0xbf11('0x64')]();})[_0xbf11('0x1d')](function(_0x144cd1){if(!_0x144cd1){throw new db[(_0xbf11('0x78'))]['ValidationError']('no\x20available\x20attributes');}_0x46c2d7=_['difference'](_[_0xbf11('0x40')](_0x144cd1),[_0xbf11('0x79'),_0xbf11('0x7a')]);_0xae5e2d=_[_0xbf11('0x7b')](_['keys'](_0x144cd1),['createdAt','updatedAt',_0xbf11('0x7c'),_0xbf11('0x7d')]);_0x3a3a3d[_0xbf11('0x63')]={'mapKey':_0xbf11('0x7e')};if(_0x3a3a3d[_0xbf11('0x72')]['type']){switch(_0x3a3a3d[_0xbf11('0x72')][_0xbf11('0x3c')]){case _0xbf11('0x7f'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x81')];_0x3a3a3d[_0xbf11('0x63')]['body']=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x82')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')]['MessageSid'];break;case _0xbf11('0x84'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]='+'+_0x4ef25d['body'][_0xbf11('0x85')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')]['text'];break;case _0xbf11('0x86'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d[_0xbf11('0x63')]['from'];_0x3a3a3d['body'][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x24')];break;case _0xbf11('0x87'):_0x3a3a3d[_0xbf11('0x63')]['from']=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x80')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x63')];_0x3a3a3d['body'][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')]['message_id'];break;case _0xbf11('0x88'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x81')];_0x3a3a3d[_0xbf11('0x63')]['body']=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x89')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x8a')];break;case _0xbf11('0x8b'):_0x3a3a3d[_0xbf11('0x63')]['from']='+'+_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x8c')][0x0]['from'];_0x3a3a3d['body']['body']=_0x4ef25d[_0xbf11('0x63')]['results'][0x0][_0xbf11('0x8d')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x8c')][0x0][_0xbf11('0x83')];break;case _0xbf11('0x8e'):_0x3a3a3d[_0xbf11('0x63')]['from']=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x8f')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x90')][_0xbf11('0x24')];break;case _0xbf11('0x91'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d['body'][_0xbf11('0x92')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x8d')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x93')];break;case _0xbf11('0x94'):_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d[_0xbf11('0x63')][0x0][_0xbf11('0x24')]['id'];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d['body'][0x0][_0xbf11('0x24')][_0xbf11('0x80')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')]=_0x4ef25d[_0xbf11('0x63')][0x0][_0xbf11('0x24')][_0xbf11('0x8d')];break;case'intelepeer':_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')]=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x80')];_0x3a3a3d[_0xbf11('0x63')]['body']=_0x4ef25d[_0xbf11('0x63')][_0xbf11('0x24')];_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')]=_0x4ef25d['body'][_0xbf11('0x95')];break;}}if(_0x3a3a3d['body']['id']){delete _0x3a3a3d[_0xbf11('0x63')]['id'];}if(_[_0xbf11('0x96')](_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')])){throw new db[(_0xbf11('0x78'))][(_0xbf11('0x97'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x63')])||_0x3a3a3d['body']['body']===''){throw new db['Sequelize'][(_0xbf11('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbf11('0x96')](_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x98')])){throw new db['Sequelize'][(_0xbf11('0x97'))](_0xbf11('0x99')+_0xae5e2d);}if(!_[_0xbf11('0x9a')](_0xae5e2d,_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x98')])){throw new db['Sequelize'][(_0xbf11('0x97'))](_0xbf11('0x9b')+_0xae5e2d);}_0x3a102b[_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x98')]]=_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')];return db['CmList'][_0xbf11('0x5d')]({'where':{'id':_0x3a3a3d[_0xbf11('0x72')]['ListId']},'include':[{'model':db[_0xbf11('0x77')],'as':'Contacts','where':_0x3a102b,'limit':0x1,'order':[['updatedAt',_0xbf11('0x9c')]]}]});})[_0xbf11('0x1d')](handleEntityNotFound(_0x3b2799,null))['then'](function(_0x9e59e){if(_0x9e59e){_0x3a3a3d[_0xbf11('0x9d')]=_[_0xbf11('0x9e')](_0x9e59e,[_0xbf11('0x9f')]);if(_0x9e59e[_0xbf11('0x9f')]['length']){return _0x9e59e[_0xbf11('0x9f')][0x0];}var _0x4ab585=_[_0xbf11('0x16')](_0x3a3a3d[_0xbf11('0x63')],{'firstName':_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')],'ListId':_0x9e59e['id']});_0x4ab585[_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x98')]]=_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x80')];return db['CmContact'][_0xbf11('0x59')](_0x4ab585,{'fields':_0x46c2d7,'raw':!![]});}})[_0xbf11('0x1d')](handleEntityNotFound(_0x3b2799,null))[_0xbf11('0x1d')](function(_0x1fced0){if(_0x1fced0){_0x3a3a3d['contact']=_0x1fced0;var _0x2e9787={'ContactId':_0x1fced0['id'],'phone':_0x3a3a3d['body'][_0xbf11('0x80')],'SmsAccountId':_0x4ef25d[_0xbf11('0x55')]['id']};var _0x15819a={'ContactId':_0x1fced0['id'],'SmsAccountId':_0x4ef25d[_0xbf11('0x55')]['id'],'closed':![]};return db['SmsInteraction'][_0xbf11('0x5d')]({'where':_0x15819a})['then'](function(_0x257bd7){if(_0x257bd7){return[_0x257bd7,![]];}return db['SmsInteraction']['create'](_0x2e9787)[_0xbf11('0x1d')](function(_0x3e8234){return[_0x3e8234,!![]];});});}})['spread'](function(_0x1106a2,_0x4e7b31){_0x3a3a3d[_0xbf11('0xa0')]=_0x1106a2['get']({'plain':!![]});_0x3a3a3d['interaction'][_0xbf11('0xa1')]=![];if(_0x4e7b31){if(_0x3a3a3d[_0xbf11('0x72')][_0xbf11('0xa2')]){_0x3a3a3d[_0xbf11('0x73')][_0xbf11('0xa3')]({'id':0x0,'priority':_0x3a3a3d['applications']['length']+0x1,'app':_0xbf11('0xa4'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x3a3a3d['interaction'][_0xbf11('0xa1')]=!![];}return db[_0xbf11('0xa5')][_0xbf11('0x59')]({'phone':_0x3a3a3d['body'][_0xbf11('0x80')],'messageId':_0x3a3a3d[_0xbf11('0x63')][_0xbf11('0x83')],'body':_0x3a3a3d['body'][_0xbf11('0x63')],'SmsAccountId':_0x4ef25d[_0xbf11('0x55')]['id'],'SmsInteractionId':_0x1106a2['id'],'direction':'in','ContactId':_0x1106a2[_0xbf11('0xa6')],'AttachmentId':_0x3a3a3d[_0xbf11('0x63')]['AttachmentId']});})[_0xbf11('0x1d')](function(_0x3d5610){_0x3a3a3d[_0xbf11('0x24')]=_0x3d5610;if(_0x3a3a3d[_0xbf11('0xa0')][_0xbf11('0xa7')]){return db[_0xbf11('0xa8')][_0xbf11('0x5d')]({'attributes':['id','name'],'where':{'id':_0x3a3a3d[_0xbf11('0xa0')][_0xbf11('0xa7')]}})[_0xbf11('0x1d')](function(_0x2b65a2){if(_0x2b65a2){_0x3a3a3d['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2b65a2['name']+','+(_0x3a3a3d[_0xbf11('0x72')][_0xbf11('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbf11('0xaa'),_0xbf11('0xab'),_0x3a3a3d);});}return respondWithRpcPromise(_0xbf11('0xaa'),_0xbf11('0xab'),_0x3a3a3d);})['then'](function(_0x28269f){if(_0x28269f){var _0x38903a=0xc8;var _0x1b8e79='receiveMessage';logger[_0xbf11('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1b8e79,_0x38903a,'entity\x20found');logger[_0xbf11('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1b8e79,_0x38903a,_0xbf11('0xac'),JSON[_0xbf11('0x21')](_0x28269f));if(_0x3a3a3d['account'][_0xbf11('0x3c')]==='twilio'){return _0x3b2799[_0xbf11('0x29')](_0x38903a)[_0xbf11('0x2e')](_0xbf11('0xad'),_0xbf11('0xae'))[_0xbf11('0x37')](_0xbf11('0xaf'));}else{return _0x3b2799[_0xbf11('0x29')](_0x38903a)[_0xbf11('0x30')](_0x28269f);}}})[_0xbf11('0x27')](handleError(_0x3b2799,null));};exports['addApplications']=function(_0xdf452,_0x5a840a,_0x3b754b){return db['SmsAccount'][_0xbf11('0x69')]({'where':{'id':_0xdf452[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x5a840a,null))[_0xbf11('0x1d')](function(_0x3542fe){if(_0x3542fe){return db[_0xbf11('0xb0')]['transaction'](function(_0x2306a1){return db[_0xbf11('0xb1')][_0xbf11('0x33')]({'where':{'SmsAccountId':_0xdf452['params']['id']},'transaction':_0x2306a1})['then'](function(_0x226853){var _0x12bca2=_[_0xbf11('0x3a')](_0xdf452[_0xbf11('0x63')],function(_0x3897a0){_0x3897a0[_0xbf11('0x66')]=_0xdf452[_0xbf11('0x55')]['id'];return _0x3897a0;});return db[_0xbf11('0xb1')][_0xbf11('0xb2')](_0x12bca2,{'transaction':_0x2306a1});});})[_0xbf11('0x1d')](function(){return db[_0xbf11('0xb1')][_0xbf11('0xb3')]({'where':{'SmsAccountId':_0xdf452[_0xbf11('0x55')]['id']},'order':'priority'});});}})[_0xbf11('0x1d')](respondWithResult(_0x5a840a,null))[_0xbf11('0x27')](handleError(_0x5a840a,null));};exports[_0xbf11('0xb4')]=function(_0x235e62,_0x22da5d,_0x10c3ae){var _0x12bea9={};var _0x415ac6={};var _0x1e79ab;var _0x37d90c;return db['SmsAccount'][_0xbf11('0x69')]({'where':{'id':_0x235e62[_0xbf11('0x55')]['id']}})['then'](handleEntityNotFound(_0x22da5d,null))[_0xbf11('0x1d')](function(_0x3a05b5){if(_0x3a05b5){_0x1e79ab=_0x3a05b5;_0x415ac6[_0xbf11('0x3e')]=_[_0xbf11('0x40')](db[_0xbf11('0xb1')][_0xbf11('0x57')]);_0x415ac6[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x235e62[_0xbf11('0x3f')]);_0x415ac6[_0xbf11('0x41')]=_[_0xbf11('0x43')](_0x415ac6[_0xbf11('0x3e')],_0x415ac6[_0xbf11('0x3f')]);_0x12bea9[_0xbf11('0x42')]=_[_0xbf11('0x43')](_0x415ac6[_0xbf11('0x3e')],qs['fields'](_0x235e62[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x12bea9[_0xbf11('0x42')]=_0x12bea9[_0xbf11('0x42')][_0xbf11('0x45')]?_0x12bea9[_0xbf11('0x42')]:_0x415ac6[_0xbf11('0x3e')];_0x12bea9[_0xbf11('0x48')]=qs[_0xbf11('0x49')](_0x235e62[_0xbf11('0x3f')]['sort']);_0x12bea9[_0xbf11('0x4c')]=qs[_0xbf11('0x41')](_[_0xbf11('0x4a')](_0x235e62[_0xbf11('0x3f')],_0x415ac6[_0xbf11('0x41')]));if(_0x235e62[_0xbf11('0x3f')][_0xbf11('0x4b')]){_0x12bea9[_0xbf11('0x4c')]=_[_0xbf11('0x4d')](_0x12bea9[_0xbf11('0x4c')],{'$or':_[_0xbf11('0x3a')](_0x12bea9[_0xbf11('0x42')],function(_0x449e7a){var _0x4c287d={};_0x4c287d[_0x449e7a]={'$like':'%'+_0x235e62[_0xbf11('0x3f')][_0xbf11('0x4b')]+'%'};return _0x4c287d;})});}_0x12bea9=_[_0xbf11('0x4d')]({},_0x12bea9,_0x235e62['options']);return _0x1e79ab[_0xbf11('0xb4')](_0x12bea9);}})['then'](function(_0xb729e5){if(_0xb729e5){_0x37d90c=_0xb729e5[_0xbf11('0x45')];if(!_0x235e62['query'][_0xbf11('0x46')](_0xbf11('0x47'))){_0x12bea9[_0xbf11('0x2b')]=qs[_0xbf11('0x2b')](_0x235e62['query'][_0xbf11('0x2b')]);_0x12bea9[_0xbf11('0x2d')]=qs[_0xbf11('0x2d')](_0x235e62[_0xbf11('0x3f')]['offset']);}return _0x1e79ab[_0xbf11('0xb4')](_0x12bea9);}})['then'](function(_0x202b34){if(_0x202b34){return _0x202b34?{'count':_0x37d90c,'rows':_0x202b34}:null;}})[_0xbf11('0x1d')](respondWithResult(_0x22da5d,null))[_0xbf11('0x27')](handleError(_0x22da5d,null));};exports['getInteractions']=function(_0x3b6a82,_0x544db3,_0x93b90f){var _0x2e2ac9={'raw':![],'where':{}};var _0x207688={};var _0x15dd39={'count':0x0,'rows':[]};return db[_0xbf11('0x4f')]['findOne']({'where':{'id':_0x3b6a82[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x544db3,null))[_0xbf11('0x1d')](function(_0x5ec4a8){if(_0x5ec4a8){_0x207688[_0xbf11('0x3e')]=_['keys'](db[_0xbf11('0xb5')]['rawAttributes']);_0x207688[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x3b6a82['query']);_0x207688['filters']=_[_0xbf11('0x43')](_0x207688['model'],_0x207688['query']);_0x2e2ac9['attributes']=_[_0xbf11('0x43')](_0x207688['model'],qs[_0xbf11('0x44')](_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x2e2ac9[_0xbf11('0x42')]=_0x2e2ac9['attributes'][_0xbf11('0x45')]?_0x2e2ac9['attributes']:_0x207688[_0xbf11('0x3e')];if(!_0x3b6a82['query'][_0xbf11('0x46')](_0xbf11('0x47'))){_0x2e2ac9['limit']=qs['limit'](_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x2b')]);_0x2e2ac9[_0xbf11('0x2d')]=qs['offset'](_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x2d')]);}_0x2e2ac9[_0xbf11('0x48')]=qs[_0xbf11('0x49')](_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x49')]);_0x2e2ac9[_0xbf11('0x4c')]=qs[_0xbf11('0x41')](_['pick'](_0x3b6a82['query'],_0x207688[_0xbf11('0x41')]));_0x2e2ac9[_0xbf11('0x4c')][_0xbf11('0x66')]=_0x5ec4a8['id'];if(_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x4b')]){_0x2e2ac9[_0xbf11('0x4c')]=_[_0xbf11('0x4d')](_0x2e2ac9[_0xbf11('0x4c')],{'$or':_[_0xbf11('0x3a')](_0x2e2ac9['attributes'],function(_0x4fa75c){var _0x327340={};_0x327340[_0x4fa75c]={'$like':'%'+_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x4b')]+'%'};return _0x327340;})});}_0x2e2ac9=_[_0xbf11('0x4d')]({},_0x2e2ac9,_0x3b6a82[_0xbf11('0x58')]);return db[_0xbf11('0xb5')]['count']({'where':_0x2e2ac9[_0xbf11('0x4c')]})['then'](function(_0x2fd8ed){_0x15dd39[_0xbf11('0x2c')]=_0x2fd8ed;if(_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0x50')]){_0x2e2ac9[_0xbf11('0x51')]=[{'model':db['CmContact'],'as':_0xbf11('0xb6'),'required':![]},{'model':db[_0xbf11('0xa8')],'as':_0xbf11('0xb7'),'attributes':[_0xbf11('0x36'),_0xbf11('0xb8'),_0xbf11('0xb9')],'required':![]},{'model':db[_0xbf11('0xba')],'as':'Tags','attributes':['id',_0xbf11('0x36'),_0xbf11('0xbb')],'where':_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0xbc')]?{'id':_0x3b6a82[_0xbf11('0x3f')][_0xbf11('0xbc')]}:undefined,'required':_0x3b6a82['query'][_0xbf11('0xbc')]?!![]:![]}];}return db[_0xbf11('0xb5')][_0xbf11('0x52')](_0x2e2ac9);})['then'](function(_0x76112){_0x15dd39[_0xbf11('0x53')]=_0x76112;return _0x15dd39;});}})['then'](respondWithFilteredResult(_0x544db3,_0x2e2ac9))[_0xbf11('0x27')](handleError(_0x544db3,null));};exports[_0xbf11('0x37')]=function(_0x1b2838,_0x1c935c,_0x3d2f59){var _0xd9f2ec,_0x12bde9,_0xaa113a;if(_[_0xbf11('0x96')](_0x1b2838[_0xbf11('0x63')][_0xbf11('0x63')])||_0x1b2838[_0xbf11('0x63')]['body']===''){throw new db[(_0xbf11('0x78'))][(_0xbf11('0x97'))](_0xbf11('0xbd'));}if(_[_0xbf11('0x96')](_0x1b2838[_0xbf11('0x63')]['to'])){throw new db[(_0xbf11('0x78'))]['ValidationError'](_0xbf11('0xbe'));}_0xd9f2ec=_0x1b2838[_0xbf11('0x63')]['to'];return db['SmsAccount'][_0xbf11('0x5d')]({'where':{'id':_0x1b2838[_0xbf11('0x55')]['id']},'include':[{'model':db[_0xbf11('0xbf')],'as':_0xbf11('0xc0'),'include':[{'model':db[_0xbf11('0x77')],'as':_0xbf11('0x9f'),'where':{'mobile':_0xd9f2ec},'limit':0x1,'order':[[_0xbf11('0x7a'),_0xbf11('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x1c935c,null))[_0xbf11('0x1d')](function(_0x4f802f){if(_0x4f802f&&_0x4f802f['List']){_0x12bde9=_0x4f802f[_0xbf11('0x34')]({'plain':!![]});if(_0x12bde9[_0xbf11('0xc0')]&&_0x12bde9[_0xbf11('0xc0')]['Contacts'][_0xbf11('0x45')]){return _0x12bde9[_0xbf11('0xc0')][_0xbf11('0x9f')][0x0];}return db[_0xbf11('0x77')][_0xbf11('0x59')](_['defaults'](_0x1b2838[_0xbf11('0x63')],{'firstName':_0xd9f2ec,'mobile':_0xd9f2ec,'phone':_0xd9f2ec,'ListId':_0x12bde9[_0xbf11('0x7d')]}));}})[_0xbf11('0x1d')](handleEntityNotFound(_0x1c935c,null))[_0xbf11('0x1d')](function(_0x26768b){if(_0x26768b){_0xaa113a=_0x26768b;return db[_0xbf11('0xb5')]['find']({'where':{'ContactId':_0xaa113a['id'],'closed':![],'SmsAccountId':_0x12bde9['id']}})[_0xbf11('0x1d')](function(_0x54680d){if(_0x54680d){return[_0x54680d,![]];}return db[_0xbf11('0xb5')][_0xbf11('0x59')]({'UserId':_0x1b2838[_0xbf11('0xc1')]['id'],'ContactId':_0xaa113a['id'],'SmsAccountId':_0x12bde9['id'],'phone':_0xd9f2ec,'firstMsgDirection':_0xbf11('0xc2'),'Messages':[_['merge'](_0x1b2838['body'],{'read':![],'body':_0x1b2838[_0xbf11('0x63')][_0xbf11('0x63')],'phone':_0xd9f2ec,'SmsAccountId':_0x12bde9['id'],'UserId':_0x1b2838[_0xbf11('0xc1')]['id'],'ContactId':_0xaa113a['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x582c71){return[_0x582c71,!![]];});});}})[_0xbf11('0xc3')](function(_0x11b774,_0xc79fb5){if(_0xc79fb5){return _0x11b774;}return db[_0xbf11('0xa5')]['create'](_[_0xbf11('0x4d')](_0x1b2838[_0xbf11('0x63')],{'read':![],'body':_0x1b2838[_0xbf11('0x63')][_0xbf11('0x63')],'phone':_0xd9f2ec,'SmsAccountId':_0x12bde9['id'],'SmsInteractionId':_0x11b774['id'],'UserId':_0x1b2838[_0xbf11('0xc1')]['id'],'ContactId':_0xaa113a['id']}))[_0xbf11('0x1d')](function(_0x5dd10b){_0x11b774[_0xbf11('0xc4')][_0xbf11('0xc5')]=[];_0x11b774['dataValues'][_0xbf11('0xc5')][_0xbf11('0xa3')](_0x5dd10b[_0xbf11('0xc4')]);return _0x11b774;});})[_0xbf11('0x1d')](respondWithResult(_0x1c935c,null))[_0xbf11('0x27')](handleError(_0x1c935c,null));};exports[_0xbf11('0x29')]=function(_0x164cb4,_0x12f4ef,_0x3f0c8b){if(_0x164cb4['body']['id']){delete _0x164cb4[_0xbf11('0x63')]['id'];}var _0x17c1e7,_0x4bad21,_0x46f196;return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x164cb4[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x12f4ef,null))[_0xbf11('0x1d')](function(_0x23834b){if(_0x23834b){_0x46f196=_0x23834b;logger[_0xbf11('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xbf11('0xc6'),_0x23834b[_0xbf11('0x3c')],util[_0xbf11('0xc7')](_0x164cb4[_0xbf11('0x63')],{'showHidden':![],'depth':null}));switch(_0x23834b[_0xbf11('0x3c')]){case _0xbf11('0x84'):if(_0x164cb4[_0xbf11('0x63')][_0xbf11('0xc8')]&&_0x164cb4['body'][_0xbf11('0x29')]){_0x4bad21=_0x164cb4[_0xbf11('0x63')][_0xbf11('0x29')];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x164cb4[_0xbf11('0x63')]['skebby_dispatch_id']}});}break;case _0xbf11('0x86'):if(_0x164cb4[_0xbf11('0x63')][_0xbf11('0xc9')]&&_0x164cb4[_0xbf11('0x63')]['statusInt']){_0x4bad21=_0x164cb4[_0xbf11('0x63')][_0xbf11('0xca')];return db[_0xbf11('0xa5')]['find']({'where':{'messageId':_0x164cb4[_0xbf11('0x63')][_0xbf11('0xc9')]}});}break;case _0xbf11('0x87'):if(_0x164cb4[_0xbf11('0x63')][_0xbf11('0xcb')]&&_0x164cb4[_0xbf11('0x63')][_0xbf11('0xcc')]){_0x4bad21=_0x164cb4[_0xbf11('0x63')][_0xbf11('0xcc')];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x164cb4[_0xbf11('0x63')][_0xbf11('0xcb')]}});}break;case'infobip':var _0x1c3992=_0x164cb4[_0xbf11('0x63')][_0xbf11('0x8c')][0x0];if(_0x1c3992['messageId']&&_0x1c3992[_0xbf11('0x29')]['groupName']===_0xbf11('0xcd')){_0x4bad21=_0x1c3992[_0xbf11('0x29')][_0xbf11('0xce')];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x1c3992[_0xbf11('0x83')]}});}break;case'clickatell':if(_0x164cb4[_0xbf11('0x63')][_0xbf11('0x83')]&&_0x164cb4[_0xbf11('0x63')][_0xbf11('0x29')]){_0x4bad21=_0x164cb4[_0xbf11('0x63')][_0xbf11('0x29')];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x164cb4[_0xbf11('0x63')][_0xbf11('0x83')]}});}break;case _0xbf11('0x94'):if(_0x164cb4[_0xbf11('0x63')][0x0][_0xbf11('0x24')]['id']){_0x4bad21=_0x164cb4[_0xbf11('0x63')][0x0]['type'];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x164cb4[_0xbf11('0x63')][0x0][_0xbf11('0x24')]['id']}});}break;case'intelepeer':if(_0x164cb4[_0xbf11('0x63')][_0xbf11('0xcf')]&&_0x164cb4['body'][_0xbf11('0x29')]){_0x4bad21=_0x164cb4['body'][_0xbf11('0x29')];return db[_0xbf11('0xa5')][_0xbf11('0x5d')]({'where':{'messageId':_0x164cb4['body'][_0xbf11('0xcf')]}});}break;}}})['then'](handleEntityNotFound(_0x12f4ef,null))['then'](function(_0xa1d0c5){if(_0xa1d0c5){_0x17c1e7=_0xa1d0c5;switch(_0x46f196[_0xbf11('0x3c')]){case _0xbf11('0x84'):if(_0x4bad21==='DELIVERED'){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger['error'](_0xbf11('0xd0'),'status',_0xbf11('0x84'),util[_0xbf11('0xc7')](_0x164cb4[_0xbf11('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbf11('0x86'):if(_0x4bad21==='1'){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger[_0xbf11('0x22')](_0xbf11('0xd0'),_0xbf11('0x29'),'skebby',util[_0xbf11('0xc7')](_0x164cb4['body'],{'showHidden':![],'depth':null}));}break;case _0xbf11('0x87'):if(!_0x164cb4[_0xbf11('0x63')]['error_code']&&_0x4bad21>=0xc8&&_0x4bad21<=0xce){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger[_0xbf11('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbf11('0x29'),_0xbf11('0x87'),util[_0xbf11('0xc7')](_0x164cb4['body'],{'showHidden':![],'depth':null}));}break;case _0xbf11('0x8b'):var _0x35380e=_0x164cb4[_0xbf11('0x63')][_0xbf11('0x8c')][0x0];if(_0x35380e[_0xbf11('0x29')][_0xbf11('0xce')]==='DELIVERED'){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger['error'](_0xbf11('0xd0'),_0xbf11('0x29'),'infobip',util[_0xbf11('0xc7')](_0x164cb4['body'],{'showHidden':![],'depth':null}));}break;case _0xbf11('0x91'):if(_0x4bad21=='DELIVERED_TO_GATEWAY'||_0x4bad21=='RECEIVED_BY_RECIPIENT'){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger[_0xbf11('0x22')](_0xbf11('0xd0'),_0xbf11('0x29'),_0xbf11('0x91'),util[_0xbf11('0xc7')](_0x164cb4['body'],{'showHidden':![],'depth':null}));}break;case _0xbf11('0x94'):if(_0x4bad21==_0xbf11('0xd1')){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger['error'](_0xbf11('0xd0'),_0xbf11('0x29'),_0xbf11('0x94'),util[_0xbf11('0xc7')](_0x164cb4[_0xbf11('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbf11('0xd2'):if(_0x4bad21===_0xbf11('0xd3')||_0x4bad21===_0xbf11('0xd4')){return _0x17c1e7[_0xbf11('0x62')]({'read':!![]});}else{logger[_0xbf11('0x22')](_0xbf11('0xd0'),_0xbf11('0x29'),_0xbf11('0xd2'),util['inspect'](_0x164cb4[_0xbf11('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x17c1e7;}})[_0xbf11('0x1d')](respondWithResult(_0x12f4ef,null))[_0xbf11('0x27')](handleError(_0x12f4ef,null));};exports[_0xbf11('0xd5')]=function(_0x4a0bdd,_0x5083ff,_0x320bc3){var _0x1cecb0,_0x106f8c,_0x534ba5;return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x4a0bdd['params']['id']}})['then'](handleEntityNotFound(_0x5083ff,null))['then'](function(_0x4beb9d){if(_0x4beb9d){_0x534ba5=_0x4beb9d;logger[_0xbf11('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbf11('0x29'),_0xbf11('0xc6'),_0x4beb9d['type'],util[_0xbf11('0xc7')](_0x4a0bdd['query'],{'showHidden':![],'depth':null}));switch(_0x4beb9d[_0xbf11('0x3c')]){case _0xbf11('0x8e'):if(_0x4a0bdd[_0xbf11('0x3f')][_0xbf11('0xd6')]&&_0x4a0bdd[_0xbf11('0x3f')][_0xbf11('0xd7')]){_0x106f8c=_0x4a0bdd['query'][_0xbf11('0xd7')];return db[_0xbf11('0xa5')]['find']({'where':{'messageId':_0x4a0bdd['query'][_0xbf11('0xd6')]}});}break;}}})[_0xbf11('0x1d')](handleEntityNotFound(_0x5083ff,null))['then'](function(_0x58709b){if(_0x58709b){_0x1cecb0=_0x58709b;switch(_0x534ba5['type']){case _0xbf11('0x8e'):if(_0x106f8c==='2'||_0x106f8c==='6'){return _0x1cecb0[_0xbf11('0x62')]({'read':!![]});}else{logger[_0xbf11('0x22')](_0xbf11('0xd0'),_0xbf11('0x29'),_0xbf11('0x8e'),util[_0xbf11('0xc7')](_0x4a0bdd[_0xbf11('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x1cecb0;}})[_0xbf11('0x1d')](respondWithResult(_0x5083ff,null))[_0xbf11('0x27')](handleError(_0x5083ff,null));};exports[_0xbf11('0xd8')]=function(_0x39cd7c,_0x2c6c80,_0x292255){return db['SmsAccount'][_0xbf11('0x5d')]({'where':{'id':_0x39cd7c[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x2c6c80,null))[_0xbf11('0x1d')](function(_0x3eb8c6){if(_0x3eb8c6){return _0x3eb8c6[_0xbf11('0xd8')](_0x39cd7c[_0xbf11('0x63')][_0xbf11('0x6b')],_[_0xbf11('0x9e')](_0x39cd7c[_0xbf11('0x63')],['ids','id'])||{})[_0xbf11('0xc3')](function(_0x12a628){for(var _0x136a5c=0x0;_0x136a5c<_0x39cd7c['body']['ids'][_0xbf11('0x45')];_0x136a5c+=0x1){socket[_0xbf11('0xd9')](_0xbf11('0xda'),{'UserId':Number(_0x39cd7c[_0xbf11('0x63')][_0xbf11('0x6b')][_0x136a5c]),'SmsAccountId':Number(_0x39cd7c[_0xbf11('0x55')]['id'])});}return _0x12a628;});}})[_0xbf11('0x1d')](respondWithResult(_0x2c6c80,null))[_0xbf11('0x27')](handleError(_0x2c6c80,null));};exports[_0xbf11('0xdb')]=function(_0x1d6a3b,_0x7c0852,_0x2d3165){return db[_0xbf11('0x4f')][_0xbf11('0x5d')]({'where':{'id':_0x1d6a3b['params']['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x7c0852,null))[_0xbf11('0x1d')](function(_0x27b44f){if(_0x27b44f){return _0x27b44f[_0xbf11('0xdb')](_0x1d6a3b[_0xbf11('0x3f')][_0xbf11('0x6b')])[_0xbf11('0x1d')](function(){if(_[_0xbf11('0xdc')](_0x1d6a3b[_0xbf11('0x3f')][_0xbf11('0x6b')])){for(var _0x289343=0x0;_0x289343<_0x1d6a3b[_0xbf11('0x3f')][_0xbf11('0x6b')][_0xbf11('0x45')];_0x289343+=0x1){socket['emit'](_0xbf11('0xdd'),{'UserId':Number(_0x1d6a3b[_0xbf11('0x3f')][_0xbf11('0x6b')][_0x289343]),'SmsAccountId':Number(_0x1d6a3b[_0xbf11('0x55')]['id'])});}}else{socket[_0xbf11('0xd9')](_0xbf11('0xdd'),{'UserId':Number(_0x1d6a3b['query']['ids']),'SmsAccountId':Number(_0x1d6a3b[_0xbf11('0x55')]['id'])});}});}})[_0xbf11('0x1d')](respondWithStatusCode(_0x7c0852,null))[_0xbf11('0x27')](handleError(_0x7c0852,null));};exports['getAgents']=function(_0x4657e8,_0x57c7a4,_0x43c735){var _0x54071e={};var _0x327720={};var _0x633bcb;var _0x3e2c71;return db[_0xbf11('0x4f')][_0xbf11('0x69')]({'where':{'id':_0x4657e8[_0xbf11('0x55')]['id']}})[_0xbf11('0x1d')](handleEntityNotFound(_0x57c7a4,null))[_0xbf11('0x1d')](function(_0x34f18e){if(_0x34f18e){_0x633bcb=_0x34f18e;_0x327720[_0xbf11('0x3e')]=_['keys'](db[_0xbf11('0xa8')][_0xbf11('0x57')]);_0x327720[_0xbf11('0x3f')]=_[_0xbf11('0x40')](_0x4657e8['query']);_0x327720[_0xbf11('0x41')]=_[_0xbf11('0x43')](_0x327720['model'],_0x327720[_0xbf11('0x3f')]);_0x54071e[_0xbf11('0x42')]=_[_0xbf11('0x43')](_0x327720[_0xbf11('0x3e')],qs['fields'](_0x4657e8[_0xbf11('0x3f')][_0xbf11('0x44')]));_0x54071e[_0xbf11('0x42')]=_0x54071e[_0xbf11('0x42')]['length']?_0x54071e[_0xbf11('0x42')]:_0x327720[_0xbf11('0x3e')];_0x54071e[_0xbf11('0x48')]=qs[_0xbf11('0x49')](_0x4657e8['query'][_0xbf11('0x49')]);_0x54071e[_0xbf11('0x4c')]=qs['filters'](_['pick'](_0x4657e8[_0xbf11('0x3f')],_0x327720['filters']));if(_0x4657e8['query']['filter']){_0x54071e[_0xbf11('0x4c')]=_['merge'](_0x54071e['where'],{'$or':_[_0xbf11('0x3a')](_0x54071e[_0xbf11('0x42')],function(_0x790030){var _0x3103ac={};_0x3103ac[_0x790030]={'$like':'%'+_0x4657e8[_0xbf11('0x3f')]['filter']+'%'};return _0x3103ac;})});}_0x54071e=_[_0xbf11('0x4d')]({},_0x54071e,_0x4657e8[_0xbf11('0x58')]);return _0x633bcb[_0xbf11('0xde')](_0x54071e);}})[_0xbf11('0x1d')](function(_0x19b473){if(_0x19b473){_0x3e2c71=_0x19b473[_0xbf11('0x45')];if(!_0x4657e8['query'][_0xbf11('0x46')]('nolimit')){_0x54071e[_0xbf11('0x2b')]=qs[_0xbf11('0x2b')](_0x4657e8['query'][_0xbf11('0x2b')]);_0x54071e[_0xbf11('0x2d')]=qs[_0xbf11('0x2d')](_0x4657e8[_0xbf11('0x3f')][_0xbf11('0x2d')]);}return _0x633bcb[_0xbf11('0xde')](_0x54071e);}})[_0xbf11('0x1d')](function(_0x3fdc14){if(_0x3fdc14){return _0x3fdc14?{'count':_0x3e2c71,'rows':_0x3fdc14}:null;}})[_0xbf11('0x1d')](respondWithResult(_0x57c7a4,null))[_0xbf11('0x27')](handleError(_0x57c7a4,null));}; \ No newline at end of file +var _0xa0aa=['redif','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','destroy','then','get','stack','name','Pause','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','filter','where','VIRTUAL','include','rows','show','params','mandatoryDispositionPause','includeAll','merge','options','SmsAccount','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','userProfileId','UserProfileResource','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','hasOwnProperty','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','type','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','Text','MessageUUID','results','csc','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','send','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','requestid','groupName','DELIVERED','clickatell'];(function(_0x39d421,_0x3283ea){var _0x3df73a=function(_0x33a849){while(--_0x33a849){_0x39d421['push'](_0x39d421['shift']());}};_0x3df73a(++_0x3283ea);}(_0xa0aa,0xee));var _0xaa0a=function(_0x2d2369,_0x3307e4){_0x2d2369=_0x2d2369-0x0;var _0x3778dc=_0xa0aa[_0x2d2369];return _0x3778dc;};'use strict';var emlformat=require(_0xaa0a('0x0'));var rimraf=require(_0xaa0a('0x1'));var zipdir=require(_0xaa0a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa0a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa0a('0x4'));var path=require(_0xaa0a('0x5'));var sox=require(_0xaa0a('0x6'));var csv=require(_0xaa0a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa0a('0x8'));var squel=require(_0xaa0a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa0a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xaa0a('0xb'));var Papa=require(_0xaa0a('0xc'));var Redis=require('ioredis');var authService=require(_0xaa0a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa0a('0xe'));var logger=require(_0xaa0a('0xf'))('api');var utils=require(_0xaa0a('0x10'));var config=require(_0xaa0a('0x11'));var licenseUtil=require(_0xaa0a('0x12'));var db=require('../../mysqldb')['db'];config[_0xaa0a('0x13')]=_[_0xaa0a('0x14')](config[_0xaa0a('0x13')],{'host':_0xaa0a('0x15'),'port':0x18eb});var socket=require(_0xaa0a('0x16'))(new Redis(config[_0xaa0a('0x13')]));require(_0xaa0a('0x17'))[_0xaa0a('0x18')](socket);var jayson=require(_0xaa0a('0x19'));var client=jayson[_0xaa0a('0x1a')][_0xaa0a('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x4a945f,_0x4281dd,_0x31f8af,_0x260fbf){return new BPromise(function(_0x200909,_0x543259){var _0x3388c8=_0x260fbf||client;return _0x3388c8[_0xaa0a('0x1c')](_0x4a945f,_0x31f8af)['then'](function(_0xc9ef08){logger[_0xaa0a('0x1d')](_0xaa0a('0x1e'),_0x4281dd,'request\x20sent');logger['debug'](_0xaa0a('0x1f'),_0x4281dd,_0xaa0a('0x20'),JSON[_0xaa0a('0x21')](_0xc9ef08));if(_0xc9ef08[_0xaa0a('0x22')]){if(_0xc9ef08[_0xaa0a('0x22')][_0xaa0a('0x23')]===0x1f4){logger[_0xaa0a('0x22')](_0xaa0a('0x1e'),_0x4281dd,_0xc9ef08[_0xaa0a('0x22')][_0xaa0a('0x24')]);return _0x543259(_0xc9ef08[_0xaa0a('0x22')][_0xaa0a('0x24')]);}logger[_0xaa0a('0x22')](_0xaa0a('0x1e'),_0x4281dd,_0xc9ef08[_0xaa0a('0x22')][_0xaa0a('0x24')]);return _0x200909(_0xc9ef08['error']['message']);}else{logger['info'](_0xaa0a('0x1e'),_0x4281dd,_0xaa0a('0x20'));_0x200909(_0xc9ef08[_0xaa0a('0x25')][_0xaa0a('0x24')]);}})['catch'](function(_0x4f8aad){logger[_0xaa0a('0x22')]('SmsAccount,\x20%s,\x20%s',_0x4281dd,_0x4f8aad);_0x543259(_0x4f8aad);});});}function respondWithStatusCode(_0x3b0a60,_0x26a2a0){_0x26a2a0=_0x26a2a0||0xcc;return function(_0xcab7cd){if(_0xcab7cd){return _0x3b0a60[_0xaa0a('0x26')](_0x26a2a0);}return _0x3b0a60[_0xaa0a('0x27')](_0x26a2a0)[_0xaa0a('0x28')]();};}function respondWithResult(_0x46a13d,_0x21ea81){_0x21ea81=_0x21ea81||0xc8;return function(_0x34712d){if(_0x34712d){return _0x46a13d[_0xaa0a('0x27')](_0x21ea81)[_0xaa0a('0x29')](_0x34712d);}};}function respondWithFilteredResult(_0x3ae08c,_0x2f4641){return function(_0x377852){if(_0x377852){var _0x45fe53=typeof _0x2f4641['offset']==='undefined'&&typeof _0x2f4641[_0xaa0a('0x2a')]===_0xaa0a('0x2b');var _0x12fd7b=_0x377852[_0xaa0a('0x2c')];var _0x2abe66=_0x45fe53?0x0:_0x2f4641['offset'];var _0x28aef1=_0x45fe53?_0x377852[_0xaa0a('0x2c')]:_0x2f4641[_0xaa0a('0x2d')]+_0x2f4641[_0xaa0a('0x2a')];var _0x36d29d;if(_0x28aef1>=_0x12fd7b){_0x28aef1=_0x12fd7b;_0x36d29d=0xc8;}else{_0x36d29d=0xce;}_0x3ae08c[_0xaa0a('0x27')](_0x36d29d);return _0x3ae08c['set'](_0xaa0a('0x2e'),_0x2abe66+'-'+_0x28aef1+'/'+_0x12fd7b)[_0xaa0a('0x29')](_0x377852);}return null;};}function patchUpdates(_0x56a773){return function(_0x520854){try{jsonpatch[_0xaa0a('0x2f')](_0x520854,_0x56a773,!![]);}catch(_0x12fbb6){return BPromise[_0xaa0a('0x30')](_0x12fbb6);}return _0x520854[_0xaa0a('0x31')]();};}function saveUpdates(_0x4e1787,_0x49d77b){return function(_0x32c71d){if(_0x32c71d){return _0x32c71d['update'](_0x4e1787)['then'](function(_0x6e3267){return _0x6e3267;});}return null;};}function removeEntity(_0x560a42,_0x37e4a8){return function(_0x30b499){if(_0x30b499){return _0x30b499[_0xaa0a('0x32')]()[_0xaa0a('0x33')](function(){var _0x1f775b=_0x30b499[_0xaa0a('0x34')]({'plain':!![]});var _0x55f9c7='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x55f9c7,'resourceId':_0x1f775b['id']}})[_0xaa0a('0x33')](function(){return _0x30b499;});})[_0xaa0a('0x33')](function(){_0x560a42[_0xaa0a('0x27')](0xcc)[_0xaa0a('0x28')]();});}};}function handleEntityNotFound(_0x319417,_0x1e11f9){return function(_0x12057e){if(!_0x12057e){_0x319417[_0xaa0a('0x26')](0x194);}return _0x12057e;};}function handleError(_0x3529a1,_0x2a64c6){_0x2a64c6=_0x2a64c6||0x1f4;return function(_0x1d213a){logger['error'](_0x1d213a[_0xaa0a('0x35')]);if(_0x1d213a[_0xaa0a('0x36')]){delete _0x1d213a['name'];}_0x3529a1['status'](_0x2a64c6)['send'](_0x1d213a);};}exports['index']=function(_0x40dee5,_0x3d9df3){var _0x3f4b97={'include':[{'model':db[_0xaa0a('0x37')],'as':'mandatoryDispositionPause'}]},_0x1e7bd4={},_0x2c39ab={'count':0x0,'rows':[]};var _0x409ed7=_[_0xaa0a('0x38')](db['SmsAccount'][_0xaa0a('0x39')],function(_0xac7524){return{'name':_0xac7524[_0xaa0a('0x3a')],'type':_0xac7524['type']['key']};});_0x1e7bd4['model']=_[_0xaa0a('0x38')](_0x409ed7,_0xaa0a('0x36'));_0x1e7bd4[_0xaa0a('0x3b')]=_[_0xaa0a('0x3c')](_0x40dee5['query']);_0x1e7bd4[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x1e7bd4['model'],_0x1e7bd4[_0xaa0a('0x3b')]);_0x3f4b97[_0xaa0a('0x3f')]=_[_0xaa0a('0x3e')](_0x1e7bd4[_0xaa0a('0x40')],qs['fields'](_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x3f4b97[_0xaa0a('0x3f')]=_0x3f4b97[_0xaa0a('0x3f')][_0xaa0a('0x42')]?_0x3f4b97['attributes']:_0x1e7bd4[_0xaa0a('0x40')];if(!_0x40dee5['query']['hasOwnProperty'](_0xaa0a('0x43'))){_0x3f4b97['limit']=qs[_0xaa0a('0x2a')](_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x2a')]);_0x3f4b97[_0xaa0a('0x2d')]=qs[_0xaa0a('0x2d')](_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x2d')]);}_0x3f4b97[_0xaa0a('0x44')]=qs[_0xaa0a('0x45')](_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x45')]);_0x3f4b97['where']=qs[_0xaa0a('0x3d')](_['pick'](_0x40dee5[_0xaa0a('0x3b')],_0x1e7bd4[_0xaa0a('0x3d')]),_0x409ed7);if(_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x46')]){_0x3f4b97[_0xaa0a('0x47')]=_['merge'](_0x3f4b97[_0xaa0a('0x47')],{'$or':_[_0xaa0a('0x38')](_0x409ed7,function(_0x35b8c3){if(_0x35b8c3['type']!==_0xaa0a('0x48')){var _0x123673={};_0x123673[_0x35b8c3[_0xaa0a('0x36')]]={'$like':'%'+_0x40dee5[_0xaa0a('0x3b')][_0xaa0a('0x46')]+'%'};return _0x123673;}})});}_0x3f4b97=_['merge']({},_0x3f4b97,_0x40dee5['options']);var _0x5e964d={'where':_0x3f4b97['where']};return db['SmsAccount'][_0xaa0a('0x2c')](_0x5e964d)['then'](function(_0xf38da8){_0x2c39ab[_0xaa0a('0x2c')]=_0xf38da8;if(_0x40dee5[_0xaa0a('0x3b')]['includeAll']){_0x3f4b97[_0xaa0a('0x49')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x3f4b97);})[_0xaa0a('0x33')](function(_0x34c6b6){_0x2c39ab[_0xaa0a('0x4a')]=_0x34c6b6;return _0x2c39ab;})[_0xaa0a('0x33')](respondWithFilteredResult(_0x3d9df3,_0x3f4b97))['catch'](handleError(_0x3d9df3,null));};exports[_0xaa0a('0x4b')]=function(_0x50d17c,_0x27b5a2){var _0x4fac80={'raw':![],'where':{'id':_0x50d17c[_0xaa0a('0x4c')]['id']},'include':[{'model':db[_0xaa0a('0x37')],'as':_0xaa0a('0x4d')}]},_0x41dc74={};_0x41dc74[_0xaa0a('0x40')]=_[_0xaa0a('0x3c')](db['SmsAccount'][_0xaa0a('0x39')]);_0x41dc74[_0xaa0a('0x3b')]=_[_0xaa0a('0x3c')](_0x50d17c[_0xaa0a('0x3b')]);_0x41dc74[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x41dc74[_0xaa0a('0x40')],_0x41dc74['query']);_0x4fac80['attributes']=_[_0xaa0a('0x3e')](_0x41dc74[_0xaa0a('0x40')],qs['fields'](_0x50d17c[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x4fac80[_0xaa0a('0x3f')]=_0x4fac80[_0xaa0a('0x3f')][_0xaa0a('0x42')]?_0x4fac80[_0xaa0a('0x3f')]:_0x41dc74[_0xaa0a('0x40')];if(_0x50d17c[_0xaa0a('0x3b')][_0xaa0a('0x4e')]){_0x4fac80['include']=[{'all':!![]}];}_0x4fac80=_[_0xaa0a('0x4f')]({},_0x4fac80,_0x50d17c[_0xaa0a('0x50')]);return db[_0xaa0a('0x51')][_0xaa0a('0x52')](_0x4fac80)[_0xaa0a('0x33')](handleEntityNotFound(_0x27b5a2,null))[_0xaa0a('0x33')](respondWithResult(_0x27b5a2,null))[_0xaa0a('0x53')](handleError(_0x27b5a2,null));};exports[_0xaa0a('0x54')]=function(_0x540e3a,_0xb55fc7){return db[_0xaa0a('0x51')][_0xaa0a('0x54')](_0x540e3a[_0xaa0a('0x55')],{})[_0xaa0a('0x33')](function(_0x2232d5){var _0x3c3e8f=_0x540e3a[_0xaa0a('0x56')][_0xaa0a('0x34')]({'plain':!![]});if(!_0x3c3e8f)throw new Error(_0xaa0a('0x57'));if(_0x3c3e8f[_0xaa0a('0x58')]===_0xaa0a('0x56')){var _0x47c52b=_0x2232d5['get']({'plain':!![]});var _0x1c5101=_0xaa0a('0x59');return db['UserProfileSection'][_0xaa0a('0x52')]({'where':{'name':_0x1c5101,'userProfileId':_0x3c3e8f[_0xaa0a('0x5a')]},'raw':!![]})[_0xaa0a('0x33')](function(_0x4d4ed5){if(_0x4d4ed5&&_0x4d4ed5['autoAssociation']===0x0){return db[_0xaa0a('0x5b')][_0xaa0a('0x54')]({'name':_0x47c52b['name'],'resourceId':_0x47c52b['id'],'type':_0x4d4ed5[_0xaa0a('0x36')],'sectionId':_0x4d4ed5['id']},{})[_0xaa0a('0x33')](function(){return _0x2232d5;});}else{return _0x2232d5;}})[_0xaa0a('0x53')](function(_0x14bee3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14bee3);throw _0x14bee3;});}return _0x2232d5;})[_0xaa0a('0x33')](respondWithResult(_0xb55fc7,0xc9))['catch'](handleError(_0xb55fc7,null));};exports[_0xaa0a('0x5c')]=function(_0x4736f2,_0x66d0cb){if(_0x4736f2[_0xaa0a('0x55')]['id']){delete _0x4736f2[_0xaa0a('0x55')]['id'];}return db[_0xaa0a('0x51')][_0xaa0a('0x52')]({'where':{'id':_0x4736f2[_0xaa0a('0x4c')]['id']},'include':[{'model':db[_0xaa0a('0x37')],'as':_0xaa0a('0x4d')}]})[_0xaa0a('0x33')](handleEntityNotFound(_0x66d0cb,null))[_0xaa0a('0x33')](saveUpdates(_0x4736f2[_0xaa0a('0x55')],null))[_0xaa0a('0x33')](respondWithResult(_0x66d0cb,null))[_0xaa0a('0x53')](handleError(_0x66d0cb,null));};exports[_0xaa0a('0x32')]=function(_0x3d438b,_0x5b9c2a){return db['SmsAccount']['find']({'where':{'id':_0x3d438b[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x5b9c2a,null))[_0xaa0a('0x33')](removeEntity(_0x5b9c2a,null))[_0xaa0a('0x53')](handleError(_0x5b9c2a,null));};exports[_0xaa0a('0x5d')]=function(_0xe31a09,_0x363343){return db[_0xaa0a('0x51')][_0xaa0a('0x5d')]()[_0xaa0a('0x33')](respondWithResult(_0x363343,null))[_0xaa0a('0x53')](handleError(_0x363343,null));};exports[_0xaa0a('0x5e')]=function(_0x444139,_0xb41c1a,_0x3f7272){if(_0x444139['body']['id']){delete _0x444139[_0xaa0a('0x55')]['id'];}return db[_0xaa0a('0x51')][_0xaa0a('0x52')]({'where':{'id':_0x444139[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0xb41c1a,null))[_0xaa0a('0x33')](function(_0x4744d7){if(_0x4744d7){_0x444139[_0xaa0a('0x55')][_0xaa0a('0x5f')]=_0x4744d7['id'];return db[_0xaa0a('0x60')][_0xaa0a('0x54')](_0x444139[_0xaa0a('0x55')]);}})[_0xaa0a('0x33')](respondWithResult(_0xb41c1a,null))['catch'](handleError(_0xb41c1a,null));};exports[_0xaa0a('0x61')]=function(_0xd12992,_0x54d5c2,_0x3ff250){var _0x3097dc={'raw':![],'where':{}};var _0x215f7a={};var _0x28dd48={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xd12992[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x54d5c2,null))[_0xaa0a('0x33')](function(_0x871e1d){if(_0x871e1d){_0x215f7a['model']=_[_0xaa0a('0x3c')](db[_0xaa0a('0x60')][_0xaa0a('0x39')]);_0x215f7a[_0xaa0a('0x3b')]=_[_0xaa0a('0x3c')](_0xd12992[_0xaa0a('0x3b')]);_0x215f7a[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x215f7a[_0xaa0a('0x40')],_0x215f7a[_0xaa0a('0x3b')]);_0x3097dc['attributes']=_[_0xaa0a('0x3e')](_0x215f7a[_0xaa0a('0x40')],qs['fields'](_0xd12992[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x3097dc[_0xaa0a('0x3f')]=_0x3097dc[_0xaa0a('0x3f')]['length']?_0x3097dc['attributes']:_0x215f7a['model'];if(!_0xd12992['query'][_0xaa0a('0x62')](_0xaa0a('0x43'))){_0x3097dc[_0xaa0a('0x2a')]=qs[_0xaa0a('0x2a')](_0xd12992[_0xaa0a('0x3b')][_0xaa0a('0x2a')]);_0x3097dc[_0xaa0a('0x2d')]=qs['offset'](_0xd12992['query'][_0xaa0a('0x2d')]);}_0x3097dc[_0xaa0a('0x44')]=qs['sort'](_0xd12992['query'][_0xaa0a('0x45')]);_0x3097dc[_0xaa0a('0x47')]=qs[_0xaa0a('0x3d')](_[_0xaa0a('0x63')](_0xd12992['query'],_0x215f7a[_0xaa0a('0x3d')]));_0x3097dc[_0xaa0a('0x47')][_0xaa0a('0x5f')]=_0x871e1d['id'];if(_0xd12992['query']['filter']){_0x3097dc['where']=_['merge'](_0x3097dc[_0xaa0a('0x47')],{'$or':_['map'](_0x3097dc['attributes'],function(_0x5833e0){var _0xfbdcfc={};_0xfbdcfc[_0x5833e0]={'$like':'%'+_0xd12992[_0xaa0a('0x3b')]['filter']+'%'};return _0xfbdcfc;})});}_0x3097dc=_[_0xaa0a('0x4f')]({},_0x3097dc,_0xd12992['options']);return db['Disposition'][_0xaa0a('0x2c')]({'where':_0x3097dc[_0xaa0a('0x47')]})[_0xaa0a('0x33')](function(_0x523865){_0x28dd48['count']=_0x523865;if(_0xd12992[_0xaa0a('0x3b')][_0xaa0a('0x4e')]){_0x3097dc['include']=[{'all':!![]}];}return db[_0xaa0a('0x60')][_0xaa0a('0x64')](_0x3097dc);})[_0xaa0a('0x33')](function(_0x55e69a){_0x28dd48[_0xaa0a('0x4a')]=_0x55e69a;return _0x28dd48;});}})[_0xaa0a('0x33')](respondWithFilteredResult(_0x54d5c2,_0x3097dc))[_0xaa0a('0x53')](handleError(_0x54d5c2,null));};exports[_0xaa0a('0x65')]=function(_0x140c30,_0x252dcc,_0x50c3a3){return db[_0xaa0a('0x51')]['find']({'where':{'id':_0x140c30['params']['id']}})['then'](handleEntityNotFound(_0x252dcc,null))[_0xaa0a('0x33')](function(_0x4cc3f8){if(_0x4cc3f8){return _0x4cc3f8[_0xaa0a('0x65')](_0x140c30[_0xaa0a('0x3b')][_0xaa0a('0x66')]);}})[_0xaa0a('0x33')](respondWithStatusCode(_0x252dcc,null))[_0xaa0a('0x53')](handleError(_0x252dcc,null));};exports[_0xaa0a('0x67')]=function(_0x5797a8,_0x42c61f,_0x20b2ce){if(_0x5797a8[_0xaa0a('0x55')]['id']){delete _0x5797a8['body']['id'];}return db[_0xaa0a('0x51')]['find']({'where':{'id':_0x5797a8[_0xaa0a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42c61f,null))[_0xaa0a('0x33')](function(_0x132689){if(_0x132689){_0x5797a8['body'][_0xaa0a('0x5f')]=_0x132689['id'];return db[_0xaa0a('0x68')][_0xaa0a('0x54')](_0x5797a8['body']);}})['then'](respondWithResult(_0x42c61f,null))['catch'](handleError(_0x42c61f,null));};exports[_0xaa0a('0x69')]=function(_0x1bd933,_0x2f2e64,_0x5308de){var _0x213009={'raw':![],'where':{}};var _0xdbb0f0={};var _0x2e4fe3={'count':0x0,'rows':[]};return db[_0xaa0a('0x51')][_0xaa0a('0x6a')]({'where':{'id':_0x1bd933[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x2f2e64,null))[_0xaa0a('0x33')](function(_0x3c181d){if(_0x3c181d){_0xdbb0f0[_0xaa0a('0x40')]=_[_0xaa0a('0x3c')](db[_0xaa0a('0x68')][_0xaa0a('0x39')]);_0xdbb0f0[_0xaa0a('0x3b')]=_[_0xaa0a('0x3c')](_0x1bd933[_0xaa0a('0x3b')]);_0xdbb0f0[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0xdbb0f0['model'],_0xdbb0f0[_0xaa0a('0x3b')]);_0x213009[_0xaa0a('0x3f')]=_[_0xaa0a('0x3e')](_0xdbb0f0[_0xaa0a('0x40')],qs[_0xaa0a('0x41')](_0x1bd933[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x213009[_0xaa0a('0x3f')]=_0x213009['attributes']['length']?_0x213009[_0xaa0a('0x3f')]:_0xdbb0f0['model'];if(!_0x1bd933['query'][_0xaa0a('0x62')](_0xaa0a('0x43'))){_0x213009[_0xaa0a('0x2a')]=qs[_0xaa0a('0x2a')](_0x1bd933[_0xaa0a('0x3b')]['limit']);_0x213009[_0xaa0a('0x2d')]=qs[_0xaa0a('0x2d')](_0x1bd933[_0xaa0a('0x3b')][_0xaa0a('0x2d')]);}_0x213009[_0xaa0a('0x44')]=qs['sort'](_0x1bd933[_0xaa0a('0x3b')]['sort']);_0x213009[_0xaa0a('0x47')]=qs[_0xaa0a('0x3d')](_['pick'](_0x1bd933[_0xaa0a('0x3b')],_0xdbb0f0[_0xaa0a('0x3d')]));_0x213009[_0xaa0a('0x47')][_0xaa0a('0x5f')]=_0x3c181d['id'];if(_0x1bd933[_0xaa0a('0x3b')]['filter']){_0x213009['where']=_[_0xaa0a('0x4f')](_0x213009['where'],{'$or':_[_0xaa0a('0x38')](_0x213009[_0xaa0a('0x3f')],function(_0x7f39bd){var _0xb5e0da={};_0xb5e0da[_0x7f39bd]={'$like':'%'+_0x1bd933[_0xaa0a('0x3b')][_0xaa0a('0x46')]+'%'};return _0xb5e0da;})});}_0x213009=_['merge']({},_0x213009,_0x1bd933[_0xaa0a('0x50')]);return db[_0xaa0a('0x68')][_0xaa0a('0x2c')]({'where':_0x213009['where']})['then'](function(_0x5a6549){_0x2e4fe3[_0xaa0a('0x2c')]=_0x5a6549;if(_0x1bd933['query'][_0xaa0a('0x4e')]){_0x213009[_0xaa0a('0x49')]=[{'all':!![]}];}return db[_0xaa0a('0x68')][_0xaa0a('0x64')](_0x213009);})['then'](function(_0x110785){_0x2e4fe3[_0xaa0a('0x4a')]=_0x110785;return _0x2e4fe3;});}})[_0xaa0a('0x33')](respondWithFilteredResult(_0x2f2e64,_0x213009))['catch'](handleError(_0x2f2e64,null));};exports[_0xaa0a('0x6b')]=function(_0x200971,_0x30b6ad,_0x99f02b){return db[_0xaa0a('0x51')][_0xaa0a('0x52')]({'where':{'id':_0x200971[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x30b6ad,null))[_0xaa0a('0x33')](function(_0xf5cb33){if(_0xf5cb33){return _0xf5cb33[_0xaa0a('0x6b')](_0x200971[_0xaa0a('0x3b')]['ids']);}})[_0xaa0a('0x33')](respondWithStatusCode(_0x30b6ad,null))['catch'](handleError(_0x30b6ad,null));};exports['notify']=function(_0xc0932b,_0x378ca0,_0x2ff2f4){var _0x149b98={'channel':_0xaa0a('0x6c')};var _0x5ca1d9=[];var _0x4fd46e=[];var _0x2df629={};return db[_0xaa0a('0x51')]['find']({'where':{'id':_0xc0932b[_0xaa0a('0x4c')]['id']},'include':[{'model':db[_0xaa0a('0x6d')],'as':_0xaa0a('0x6e')}]})[_0xaa0a('0x33')](handleEntityNotFound(_0x378ca0,null))[_0xaa0a('0x33')](function(_0x1dd498){_0x149b98[_0xaa0a('0x6f')]=_0x1dd498;_0x149b98[_0xaa0a('0x70')]=_[_0xaa0a('0x71')](_0x1dd498[_0xaa0a('0x6e')],[_0xaa0a('0x72')],[_0xaa0a('0x73')]);if(_0x149b98[_0xaa0a('0x6f')]['Applications']){delete _0x149b98[_0xaa0a('0x6f')]['Applications'];}return db[_0xaa0a('0x74')][_0xaa0a('0x5d')]();})['then'](function(_0x3e5073){if(!_0x3e5073){throw new db[(_0xaa0a('0x75'))][(_0xaa0a('0x76'))]('no\x20available\x20attributes');}_0x5ca1d9=_[_0xaa0a('0x77')](_[_0xaa0a('0x3c')](_0x3e5073),[_0xaa0a('0x78'),_0xaa0a('0x79')]);_0x4fd46e=_['difference'](_[_0xaa0a('0x3c')](_0x3e5073),[_0xaa0a('0x78'),'updatedAt',_0xaa0a('0x7a'),_0xaa0a('0x7b')]);_0x149b98[_0xaa0a('0x55')]={'mapKey':'mobile'};if(_0x149b98[_0xaa0a('0x6f')][_0xaa0a('0x7c')]){switch(_0x149b98[_0xaa0a('0x6f')][_0xaa0a('0x7c')]){case'twilio':_0x149b98['body'][_0xaa0a('0x7d')]=_0xc0932b['body'][_0xaa0a('0x7e')];_0x149b98[_0xaa0a('0x55')]['body']=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x7f')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x80')]=_0xc0932b['body'][_0xaa0a('0x81')];break;case _0xaa0a('0x82'):_0x149b98[_0xaa0a('0x55')]['from']='+'+_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x83')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b['body'][_0xaa0a('0x84')];break;case'connectel':_0x149b98['body'][_0xaa0a('0x7d')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x7d')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x24')];break;case _0xaa0a('0x85'):_0x149b98[_0xaa0a('0x55')]['from']=_0xc0932b['body']['from'];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x55')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x80')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x86')];break;case _0xaa0a('0x87'):_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x7e')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x88')];_0x149b98['body'][_0xaa0a('0x80')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x89')];break;case'infobip':_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]='+'+_0xc0932b['body'][_0xaa0a('0x8a')][0x0]['from'];_0x149b98[_0xaa0a('0x55')]['body']=_0xc0932b['body'][_0xaa0a('0x8a')][0x0][_0xaa0a('0x84')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x80')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x8a')][0x0][_0xaa0a('0x80')];break;case _0xaa0a('0x8b'):_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]=_0xc0932b['body']['originatingAddress'];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x8c')][_0xaa0a('0x24')];break;case'clickatell':_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x8d')];_0x149b98['body']['body']=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x84')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x80')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x8e')];break;case'bandwidth':_0x149b98[_0xaa0a('0x55')]['messageId']=_0xc0932b[_0xaa0a('0x55')][0x0][_0xaa0a('0x24')]['id'];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]=_0xc0932b[_0xaa0a('0x55')][0x0][_0xaa0a('0x24')][_0xaa0a('0x7d')];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')][0x0][_0xaa0a('0x24')][_0xaa0a('0x84')];break;case _0xaa0a('0x8f'):_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x7d')];_0x149b98['body'][_0xaa0a('0x55')]=_0xc0932b[_0xaa0a('0x55')]['message'];_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x80')]=_0xc0932b[_0xaa0a('0x55')][_0xaa0a('0x90')];break;}}if(_0x149b98[_0xaa0a('0x55')]['id']){delete _0x149b98[_0xaa0a('0x55')]['id'];}if(_[_0xaa0a('0x91')](_0x149b98['body'][_0xaa0a('0x7d')])){throw new db['Sequelize'][(_0xaa0a('0x76'))](_0xaa0a('0x92'));}if(_[_0xaa0a('0x91')](_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x55')])||_0x149b98['body'][_0xaa0a('0x55')]===''){throw new db[(_0xaa0a('0x75'))][(_0xaa0a('0x76'))](_0xaa0a('0x93'));}if(_['isNil'](_0x149b98[_0xaa0a('0x55')]['mapKey'])){throw new db[(_0xaa0a('0x75'))][(_0xaa0a('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4fd46e);}if(!_[_0xaa0a('0x94')](_0x4fd46e,_0x149b98[_0xaa0a('0x55')]['mapKey'])){throw new db[(_0xaa0a('0x75'))][(_0xaa0a('0x76'))](_0xaa0a('0x95')+_0x4fd46e);}_0x2df629[_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x96')]]=_0x149b98['body']['from'];return db[_0xaa0a('0x97')][_0xaa0a('0x52')]({'where':{'id':_0x149b98[_0xaa0a('0x6f')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xaa0a('0x98'),'where':_0x2df629,'limit':0x1,'order':[[_0xaa0a('0x79'),_0xaa0a('0x99')]]}]});})[_0xaa0a('0x33')](handleEntityNotFound(_0x378ca0,null))[_0xaa0a('0x33')](function(_0x9a914f){if(_0x9a914f){_0x149b98['list']=_[_0xaa0a('0x9a')](_0x9a914f,[_0xaa0a('0x98')]);if(_0x9a914f['Contacts'][_0xaa0a('0x42')]){return _0x9a914f[_0xaa0a('0x98')][0x0];}var _0x1e74ce=_[_0xaa0a('0x14')](_0x149b98[_0xaa0a('0x55')],{'firstName':_0x149b98['body'][_0xaa0a('0x7d')],'ListId':_0x9a914f['id']});_0x1e74ce[_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x96')]]=_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')];return db['CmContact'][_0xaa0a('0x54')](_0x1e74ce,{'fields':_0x5ca1d9,'raw':!![]});}})[_0xaa0a('0x33')](handleEntityNotFound(_0x378ca0,null))[_0xaa0a('0x33')](function(_0x3f1f37){if(_0x3f1f37){_0x149b98['contact']=_0x3f1f37;var _0x4f94fa={'ContactId':_0x3f1f37['id'],'phone':_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')],'SmsAccountId':_0xc0932b[_0xaa0a('0x4c')]['id']};var _0x14df7d={'ContactId':_0x3f1f37['id'],'SmsAccountId':_0xc0932b[_0xaa0a('0x4c')]['id'],'closed':![]};return db[_0xaa0a('0x9b')][_0xaa0a('0x52')]({'where':_0x14df7d})[_0xaa0a('0x33')](function(_0x158c8a){if(_0x158c8a){return[_0x158c8a,![]];}return db[_0xaa0a('0x9b')][_0xaa0a('0x54')](_0x4f94fa)[_0xaa0a('0x33')](function(_0x21ea54){return[_0x21ea54,!![]];});});}})[_0xaa0a('0x9c')](function(_0x3433f2,_0x2723da){_0x149b98[_0xaa0a('0x9d')]=_0x3433f2[_0xaa0a('0x34')]({'plain':!![]});_0x149b98[_0xaa0a('0x9d')][_0xaa0a('0x9e')]=![];if(_0x2723da){if(_0x149b98[_0xaa0a('0x6f')][_0xaa0a('0x9f')]){_0x149b98[_0xaa0a('0x70')][_0xaa0a('0xa0')]({'id':0x0,'priority':_0x149b98['applications'][_0xaa0a('0x42')]+0x1,'app':_0xaa0a('0xa1'),'appdata':'unmanaged','interval':_0xaa0a('0xa2')});}_0x149b98[_0xaa0a('0x9d')]['created']=!![];}return db[_0xaa0a('0xa3')][_0xaa0a('0x54')]({'phone':_0x149b98[_0xaa0a('0x55')][_0xaa0a('0x7d')],'messageId':_0x149b98['body'][_0xaa0a('0x80')],'body':_0x149b98[_0xaa0a('0x55')]['body'],'SmsAccountId':_0xc0932b[_0xaa0a('0x4c')]['id'],'SmsInteractionId':_0x3433f2['id'],'direction':'in','ContactId':_0x3433f2[_0xaa0a('0xa4')],'AttachmentId':_0x149b98[_0xaa0a('0x55')]['AttachmentId']});})[_0xaa0a('0x33')](function(_0x9c579f){_0x149b98['message']=_0x9c579f;if(_0x149b98[_0xaa0a('0x9d')][_0xaa0a('0xa5')]){return db[_0xaa0a('0xa6')]['find']({'attributes':['id','name'],'where':{'id':_0x149b98[_0xaa0a('0x9d')][_0xaa0a('0xa5')]}})[_0xaa0a('0x33')](function(_0x59193d){if(_0x59193d){_0x149b98[_0xaa0a('0x70')][_0xaa0a('0xa7')]({'id':0x0,'priority':0x0,'app':_0xaa0a('0xa8'),'appdata':_0x59193d[_0xaa0a('0x36')]+','+(_0x149b98[_0xaa0a('0x6f')][_0xaa0a('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xaa0a('0xaa'),_0xaa0a('0xab'),_0x149b98);});}return respondWithRpcPromise(_0xaa0a('0xaa'),_0xaa0a('0xab'),_0x149b98);})[_0xaa0a('0x33')](function(_0x53daaa){if(_0x53daaa){var _0x4f627a=0xc8;var _0x141e75='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x141e75,_0x4f627a,_0xaa0a('0xac'));logger[_0xaa0a('0xad')](_0xaa0a('0xae'),_0x141e75,_0x4f627a,'entity\x20found',JSON[_0xaa0a('0x21')](_0x53daaa));if(_0x149b98[_0xaa0a('0x6f')][_0xaa0a('0x7c')]===_0xaa0a('0xaf')){return _0x378ca0[_0xaa0a('0x27')](_0x4f627a)[_0xaa0a('0xb0')](_0xaa0a('0xb1'),'text/xml')[_0xaa0a('0xb2')](_0xaa0a('0xb3'));}else{return _0x378ca0[_0xaa0a('0x27')](_0x4f627a)[_0xaa0a('0x29')](_0x53daaa);}}})[_0xaa0a('0x53')](handleError(_0x378ca0,null));};exports[_0xaa0a('0xb4')]=function(_0x3ce1f5,_0x3dd6b0,_0x33ceed){return db[_0xaa0a('0x51')]['findOne']({'where':{'id':_0x3ce1f5[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x3dd6b0,null))[_0xaa0a('0x33')](function(_0x17406b){if(_0x17406b){return db['sequelize'][_0xaa0a('0xb5')](function(_0x46c455){return db[_0xaa0a('0x6d')][_0xaa0a('0x32')]({'where':{'SmsAccountId':_0x3ce1f5[_0xaa0a('0x4c')]['id']},'transaction':_0x46c455})[_0xaa0a('0x33')](function(_0x59dcf2){var _0x28a534=_[_0xaa0a('0x38')](_0x3ce1f5[_0xaa0a('0x55')],function(_0xe44626){_0xe44626[_0xaa0a('0x5f')]=_0x3ce1f5[_0xaa0a('0x4c')]['id'];return _0xe44626;});return db[_0xaa0a('0x6d')][_0xaa0a('0xb6')](_0x28a534,{'transaction':_0x46c455});});})[_0xaa0a('0x33')](function(){return db[_0xaa0a('0x6d')][_0xaa0a('0xb7')]({'where':{'SmsAccountId':_0x3ce1f5['params']['id']},'order':_0xaa0a('0x72')});});}})['then'](respondWithResult(_0x3dd6b0,null))[_0xaa0a('0x53')](handleError(_0x3dd6b0,null));};exports[_0xaa0a('0xb8')]=function(_0x107b88,_0x53f125,_0x57e611){var _0x26bd9e={};var _0x204d44={};var _0x54c3bc;var _0x41ec45;return db[_0xaa0a('0x51')]['findOne']({'where':{'id':_0x107b88[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x53f125,null))[_0xaa0a('0x33')](function(_0x162b73){if(_0x162b73){_0x54c3bc=_0x162b73;_0x204d44[_0xaa0a('0x40')]=_['keys'](db[_0xaa0a('0x6d')][_0xaa0a('0x39')]);_0x204d44['query']=_[_0xaa0a('0x3c')](_0x107b88[_0xaa0a('0x3b')]);_0x204d44[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x204d44['model'],_0x204d44[_0xaa0a('0x3b')]);_0x26bd9e[_0xaa0a('0x3f')]=_[_0xaa0a('0x3e')](_0x204d44['model'],qs[_0xaa0a('0x41')](_0x107b88[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x26bd9e[_0xaa0a('0x3f')]=_0x26bd9e[_0xaa0a('0x3f')][_0xaa0a('0x42')]?_0x26bd9e['attributes']:_0x204d44['model'];_0x26bd9e[_0xaa0a('0x44')]=qs[_0xaa0a('0x45')](_0x107b88['query']['sort']);_0x26bd9e['where']=qs[_0xaa0a('0x3d')](_['pick'](_0x107b88[_0xaa0a('0x3b')],_0x204d44['filters']));if(_0x107b88[_0xaa0a('0x3b')][_0xaa0a('0x46')]){_0x26bd9e[_0xaa0a('0x47')]=_['merge'](_0x26bd9e[_0xaa0a('0x47')],{'$or':_[_0xaa0a('0x38')](_0x26bd9e['attributes'],function(_0x282ee7){var _0x4c4ac0={};_0x4c4ac0[_0x282ee7]={'$like':'%'+_0x107b88[_0xaa0a('0x3b')]['filter']+'%'};return _0x4c4ac0;})});}_0x26bd9e=_[_0xaa0a('0x4f')]({},_0x26bd9e,_0x107b88[_0xaa0a('0x50')]);return _0x54c3bc['getApplications'](_0x26bd9e);}})[_0xaa0a('0x33')](function(_0x993077){if(_0x993077){_0x41ec45=_0x993077['length'];if(!_0x107b88[_0xaa0a('0x3b')]['hasOwnProperty'](_0xaa0a('0x43'))){_0x26bd9e[_0xaa0a('0x2a')]=qs[_0xaa0a('0x2a')](_0x107b88[_0xaa0a('0x3b')][_0xaa0a('0x2a')]);_0x26bd9e[_0xaa0a('0x2d')]=qs[_0xaa0a('0x2d')](_0x107b88[_0xaa0a('0x3b')][_0xaa0a('0x2d')]);}return _0x54c3bc['getApplications'](_0x26bd9e);}})[_0xaa0a('0x33')](function(_0x1db9fd){if(_0x1db9fd){return _0x1db9fd?{'count':_0x41ec45,'rows':_0x1db9fd}:null;}})[_0xaa0a('0x33')](respondWithResult(_0x53f125,null))[_0xaa0a('0x53')](handleError(_0x53f125,null));};exports[_0xaa0a('0xb9')]=function(_0x16647d,_0x48c5f0,_0x3767fa){var _0x59bdcc={'raw':![],'where':{}};var _0x3663f5={};var _0x1bcfb4={'count':0x0,'rows':[]};return db[_0xaa0a('0x51')]['findOne']({'where':{'id':_0x16647d[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x48c5f0,null))[_0xaa0a('0x33')](function(_0x420768){if(_0x420768){_0x3663f5[_0xaa0a('0x40')]=_[_0xaa0a('0x3c')](db['SmsInteraction']['rawAttributes']);_0x3663f5[_0xaa0a('0x3b')]=_['keys'](_0x16647d[_0xaa0a('0x3b')]);_0x3663f5[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x3663f5[_0xaa0a('0x40')],_0x3663f5[_0xaa0a('0x3b')]);_0x59bdcc[_0xaa0a('0x3f')]=_['intersection'](_0x3663f5[_0xaa0a('0x40')],qs[_0xaa0a('0x41')](_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x59bdcc[_0xaa0a('0x3f')]=_0x59bdcc['attributes']['length']?_0x59bdcc[_0xaa0a('0x3f')]:_0x3663f5[_0xaa0a('0x40')];if(!_0x16647d[_0xaa0a('0x3b')]['hasOwnProperty']('nolimit')){_0x59bdcc['limit']=qs[_0xaa0a('0x2a')](_0x16647d['query'][_0xaa0a('0x2a')]);_0x59bdcc['offset']=qs[_0xaa0a('0x2d')](_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0x2d')]);}_0x59bdcc[_0xaa0a('0x44')]=qs['sort'](_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0x45')]);_0x59bdcc[_0xaa0a('0x47')]=qs['filters'](_['pick'](_0x16647d[_0xaa0a('0x3b')],_0x3663f5[_0xaa0a('0x3d')]));_0x59bdcc[_0xaa0a('0x47')][_0xaa0a('0x5f')]=_0x420768['id'];if(_0x16647d[_0xaa0a('0x3b')]['filter']){_0x59bdcc[_0xaa0a('0x47')]=_['merge'](_0x59bdcc[_0xaa0a('0x47')],{'$or':_[_0xaa0a('0x38')](_0x59bdcc[_0xaa0a('0x3f')],function(_0x423c4a){var _0x5f3284={};_0x5f3284[_0x423c4a]={'$like':'%'+_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0x46')]+'%'};return _0x5f3284;})});}_0x59bdcc=_[_0xaa0a('0x4f')]({},_0x59bdcc,_0x16647d[_0xaa0a('0x50')]);return db['SmsInteraction']['count']({'where':_0x59bdcc[_0xaa0a('0x47')]})[_0xaa0a('0x33')](function(_0x5516ee){_0x1bcfb4[_0xaa0a('0x2c')]=_0x5516ee;if(_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0x4e')]){_0x59bdcc['include']=[{'model':db['CmContact'],'as':_0xaa0a('0xba'),'required':![]},{'model':db[_0xaa0a('0xa6')],'as':'Owner','attributes':[_0xaa0a('0x36'),_0xaa0a('0xbb'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xaa0a('0xbc'),'attributes':['id',_0xaa0a('0x36'),_0xaa0a('0xbd')],'where':_0x16647d['query'][_0xaa0a('0xbe')]?{'id':_0x16647d['query']['tag']}:undefined,'required':_0x16647d[_0xaa0a('0x3b')][_0xaa0a('0xbe')]?!![]:![]}];}return db[_0xaa0a('0x9b')][_0xaa0a('0x64')](_0x59bdcc);})[_0xaa0a('0x33')](function(_0x3ff140){_0x1bcfb4[_0xaa0a('0x4a')]=_0x3ff140;return _0x1bcfb4;});}})['then'](respondWithFilteredResult(_0x48c5f0,_0x59bdcc))['catch'](handleError(_0x48c5f0,null));};exports[_0xaa0a('0xb2')]=function(_0x444861,_0x130055,_0x933854){var _0x3e4914,_0xd86029,_0x4fe0ae;if(_[_0xaa0a('0x91')](_0x444861[_0xaa0a('0x55')][_0xaa0a('0x55')])||_0x444861[_0xaa0a('0x55')][_0xaa0a('0x55')]===''){throw new db[(_0xaa0a('0x75'))][(_0xaa0a('0x76'))](_0xaa0a('0x93'));}if(_['isNil'](_0x444861[_0xaa0a('0x55')]['to'])){throw new db['Sequelize'][(_0xaa0a('0x76'))](_0xaa0a('0xbf'));}_0x3e4914=_0x444861['body']['to'];return db[_0xaa0a('0x51')]['find']({'where':{'id':_0x444861[_0xaa0a('0x4c')]['id']},'include':[{'model':db[_0xaa0a('0x97')],'as':_0xaa0a('0xc0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x3e4914},'limit':0x1,'order':[[_0xaa0a('0x79'),_0xaa0a('0x99')]]}]}]})['then'](handleEntityNotFound(_0x130055,null))[_0xaa0a('0x33')](function(_0x3cb7a1){if(_0x3cb7a1&&_0x3cb7a1[_0xaa0a('0xc0')]){_0xd86029=_0x3cb7a1[_0xaa0a('0x34')]({'plain':!![]});if(_0xd86029[_0xaa0a('0xc0')]&&_0xd86029[_0xaa0a('0xc0')][_0xaa0a('0x98')][_0xaa0a('0x42')]){return _0xd86029[_0xaa0a('0xc0')][_0xaa0a('0x98')][0x0];}return db[_0xaa0a('0x74')][_0xaa0a('0x54')](_[_0xaa0a('0x14')](_0x444861[_0xaa0a('0x55')],{'firstName':_0x3e4914,'mobile':_0x3e4914,'phone':_0x3e4914,'ListId':_0xd86029['ListId']}));}})[_0xaa0a('0x33')](handleEntityNotFound(_0x130055,null))['then'](function(_0x595718){if(_0x595718){_0x4fe0ae=_0x595718;return db['SmsInteraction'][_0xaa0a('0x52')]({'where':{'ContactId':_0x4fe0ae['id'],'closed':![],'SmsAccountId':_0xd86029['id']}})[_0xaa0a('0x33')](function(_0x31827a){if(_0x31827a){return[_0x31827a,![]];}return db['SmsInteraction'][_0xaa0a('0x54')]({'UserId':_0x444861[_0xaa0a('0x56')]['id'],'ContactId':_0x4fe0ae['id'],'SmsAccountId':_0xd86029['id'],'phone':_0x3e4914,'firstMsgDirection':'out','Messages':[_[_0xaa0a('0x4f')](_0x444861[_0xaa0a('0x55')],{'read':![],'body':_0x444861['body']['body'],'phone':_0x3e4914,'SmsAccountId':_0xd86029['id'],'UserId':_0x444861[_0xaa0a('0x56')]['id'],'ContactId':_0x4fe0ae['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xaa0a('0x33')](function(_0x450506){return[_0x450506,!![]];});});}})[_0xaa0a('0x9c')](function(_0x257f59,_0x2960c4){if(_0x2960c4){return _0x257f59;}return db[_0xaa0a('0xa3')][_0xaa0a('0x54')](_['merge'](_0x444861[_0xaa0a('0x55')],{'read':![],'body':_0x444861[_0xaa0a('0x55')][_0xaa0a('0x55')],'phone':_0x3e4914,'SmsAccountId':_0xd86029['id'],'SmsInteractionId':_0x257f59['id'],'UserId':_0x444861[_0xaa0a('0x56')]['id'],'ContactId':_0x4fe0ae['id']}))[_0xaa0a('0x33')](function(_0x34be94){_0x257f59['dataValues'][_0xaa0a('0xc1')]=[];_0x257f59[_0xaa0a('0xc2')][_0xaa0a('0xc1')][_0xaa0a('0xa0')](_0x34be94['dataValues']);return _0x257f59;});})['then'](respondWithResult(_0x130055,null))[_0xaa0a('0x53')](handleError(_0x130055,null));};exports[_0xaa0a('0x27')]=function(_0x425bf1,_0x514a4a,_0x1d777c){if(_0x425bf1[_0xaa0a('0x55')]['id']){delete _0x425bf1[_0xaa0a('0x55')]['id'];}var _0x279af0,_0x4c52bc,_0x4389f1;return db['SmsAccount']['find']({'where':{'id':_0x425bf1[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x514a4a,null))[_0xaa0a('0x33')](function(_0x9c6d2d){if(_0x9c6d2d){_0x4389f1=_0x9c6d2d;logger[_0xaa0a('0xad')](_0xaa0a('0x1f'),_0xaa0a('0x27'),_0xaa0a('0xc3'),_0x9c6d2d[_0xaa0a('0x7c')],util[_0xaa0a('0xc4')](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));switch(_0x9c6d2d[_0xaa0a('0x7c')]){case'skebby':if(_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xc5')]&&_0x425bf1['body'][_0xaa0a('0x27')]){_0x4c52bc=_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x27')];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xc5')]}});}break;case _0xaa0a('0xc6'):if(_0x425bf1[_0xaa0a('0x55')]['requestid']&&_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xc7')]){_0x4c52bc=_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xc7')];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xc8')]}});}break;case _0xaa0a('0x85'):if(_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x86')]&&_0x425bf1[_0xaa0a('0x55')]['status_code']){_0x4c52bc=_0x425bf1[_0xaa0a('0x55')]['status_code'];return db[_0xaa0a('0xa3')]['find']({'where':{'messageId':_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x86')]}});}break;case'infobip':var _0x2062ad=_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x8a')][0x0];if(_0x2062ad[_0xaa0a('0x80')]&&_0x2062ad[_0xaa0a('0x27')][_0xaa0a('0xc9')]===_0xaa0a('0xca')){_0x4c52bc=_0x2062ad[_0xaa0a('0x27')][_0xaa0a('0xc9')];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x2062ad['messageId']}});}break;case _0xaa0a('0xcb'):if(_0x425bf1[_0xaa0a('0x55')]['messageId']&&_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x27')]){_0x4c52bc=_0x425bf1['body'][_0xaa0a('0x27')];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x425bf1[_0xaa0a('0x55')]['messageId']}});}break;case'bandwidth':if(_0x425bf1[_0xaa0a('0x55')][0x0][_0xaa0a('0x24')]['id']){_0x4c52bc=_0x425bf1[_0xaa0a('0x55')][0x0][_0xaa0a('0x7c')];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x425bf1['body'][0x0][_0xaa0a('0x24')]['id']}});}break;case _0xaa0a('0x8f'):if(_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xcc')]&&_0x425bf1['body']['status']){_0x4c52bc=_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x27')];return db['SmsMessage']['find']({'where':{'messageId':_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0xcc')]}});}break;}}})[_0xaa0a('0x33')](handleEntityNotFound(_0x514a4a,null))[_0xaa0a('0x33')](function(_0x36b57a){if(_0x36b57a){_0x279af0=_0x36b57a;switch(_0x4389f1[_0xaa0a('0x7c')]){case'skebby':if(_0x4c52bc===_0xaa0a('0xca')){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),'status',_0xaa0a('0x82'),util[_0xaa0a('0xc4')](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaa0a('0xc6'):if(_0x4c52bc==='1'){return _0x279af0['update']({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),_0xaa0a('0x27'),'skebby',util[_0xaa0a('0xc4')](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x425bf1[_0xaa0a('0x55')]['error_code']&&_0x4c52bc>=0xc8&&_0x4c52bc<=0xce){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),'status',_0xaa0a('0x85'),util[_0xaa0a('0xc4')](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaa0a('0xcd'):var _0xd6edc8=_0x425bf1[_0xaa0a('0x55')][_0xaa0a('0x8a')][0x0];if(_0xd6edc8['status']['groupName']===_0xaa0a('0xca')){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),_0xaa0a('0x27'),'infobip',util[_0xaa0a('0xc4')](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaa0a('0xcb'):if(_0x4c52bc==_0xaa0a('0xce')||_0x4c52bc==_0xaa0a('0xcf')){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger['error'](_0xaa0a('0x1f'),_0xaa0a('0x27'),_0xaa0a('0xcb'),util['inspect'](_0x425bf1[_0xaa0a('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaa0a('0xd0'):if(_0x4c52bc==_0xaa0a('0xd1')){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa0a('0x27'),_0xaa0a('0xd0'),util[_0xaa0a('0xc4')](_0x425bf1['body'],{'showHidden':![],'depth':null}));}break;case _0xaa0a('0x8f'):if(_0x4c52bc===_0xaa0a('0xd2')||_0x4c52bc===_0xaa0a('0xd3')){return _0x279af0[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),'status',_0xaa0a('0x8f'),util[_0xaa0a('0xc4')](_0x425bf1['body'],{'showHidden':![],'depth':null}));}break;}return _0x279af0;}})[_0xaa0a('0x33')](respondWithResult(_0x514a4a,null))[_0xaa0a('0x53')](handleError(_0x514a4a,null));};exports[_0xaa0a('0xd4')]=function(_0x347497,_0x39cce2,_0x53263d){var _0x1bd67c,_0x1ee858,_0x3852e8;return db['SmsAccount'][_0xaa0a('0x52')]({'where':{'id':_0x347497[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x39cce2,null))[_0xaa0a('0x33')](function(_0x4ef137){if(_0x4ef137){_0x3852e8=_0x4ef137;logger[_0xaa0a('0xad')](_0xaa0a('0x1f'),_0xaa0a('0x27'),_0xaa0a('0xc3'),_0x4ef137[_0xaa0a('0x7c')],util[_0xaa0a('0xc4')](_0x347497[_0xaa0a('0x3b')],{'showHidden':![],'depth':null}));switch(_0x4ef137[_0xaa0a('0x7c')]){case _0xaa0a('0x8b'):if(_0x347497[_0xaa0a('0x3b')]['message-id']&&_0x347497[_0xaa0a('0x3b')]['state']){_0x1ee858=_0x347497[_0xaa0a('0x3b')]['state'];return db[_0xaa0a('0xa3')][_0xaa0a('0x52')]({'where':{'messageId':_0x347497[_0xaa0a('0x3b')][_0xaa0a('0xd5')]}});}break;}}})[_0xaa0a('0x33')](handleEntityNotFound(_0x39cce2,null))[_0xaa0a('0x33')](function(_0x2294bc){if(_0x2294bc){_0x1bd67c=_0x2294bc;switch(_0x3852e8[_0xaa0a('0x7c')]){case _0xaa0a('0x8b'):if(_0x1ee858==='2'||_0x1ee858==='6'){return _0x1bd67c[_0xaa0a('0x5c')]({'read':!![]});}else{logger[_0xaa0a('0x22')](_0xaa0a('0x1f'),_0xaa0a('0x27'),'csc',util[_0xaa0a('0xc4')](_0x347497['query'],{'showHidden':![],'depth':null}));};break;}return _0x1bd67c;}})[_0xaa0a('0x33')](respondWithResult(_0x39cce2,null))[_0xaa0a('0x53')](handleError(_0x39cce2,null));};exports[_0xaa0a('0xd6')]=function(_0x251fc8,_0x30e51e,_0x3bcc6b){return db[_0xaa0a('0x51')]['find']({'where':{'id':_0x251fc8[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x30e51e,null))[_0xaa0a('0x33')](function(_0x261aef){if(_0x261aef){return _0x261aef['addAgents'](_0x251fc8[_0xaa0a('0x55')][_0xaa0a('0x66')],_[_0xaa0a('0x9a')](_0x251fc8[_0xaa0a('0x55')],['ids','id'])||{})[_0xaa0a('0x9c')](function(_0x254d79){for(var _0x2d9638=0x0;_0x2d9638<_0x251fc8[_0xaa0a('0x55')][_0xaa0a('0x66')][_0xaa0a('0x42')];_0x2d9638+=0x1){socket[_0xaa0a('0xd7')](_0xaa0a('0xd8'),{'UserId':Number(_0x251fc8[_0xaa0a('0x55')]['ids'][_0x2d9638]),'SmsAccountId':Number(_0x251fc8['params']['id'])});}return _0x254d79;});}})[_0xaa0a('0x33')](respondWithResult(_0x30e51e,null))[_0xaa0a('0x53')](handleError(_0x30e51e,null));};exports[_0xaa0a('0xd9')]=function(_0x557696,_0x45a56c,_0x5713c0){return db[_0xaa0a('0x51')][_0xaa0a('0x52')]({'where':{'id':_0x557696[_0xaa0a('0x4c')]['id']}})[_0xaa0a('0x33')](handleEntityNotFound(_0x45a56c,null))[_0xaa0a('0x33')](function(_0x121004){if(_0x121004){return _0x121004[_0xaa0a('0xd9')](_0x557696[_0xaa0a('0x3b')][_0xaa0a('0x66')])['then'](function(){if(_[_0xaa0a('0xda')](_0x557696[_0xaa0a('0x3b')]['ids'])){for(var _0x1208aa=0x0;_0x1208aa<_0x557696[_0xaa0a('0x3b')][_0xaa0a('0x66')][_0xaa0a('0x42')];_0x1208aa+=0x1){socket[_0xaa0a('0xd7')]('userSmsAccount:remove',{'UserId':Number(_0x557696['query']['ids'][_0x1208aa]),'SmsAccountId':Number(_0x557696['params']['id'])});}}else{socket[_0xaa0a('0xd7')](_0xaa0a('0xdb'),{'UserId':Number(_0x557696[_0xaa0a('0x3b')]['ids']),'SmsAccountId':Number(_0x557696[_0xaa0a('0x4c')]['id'])});}});}})[_0xaa0a('0x33')](respondWithStatusCode(_0x45a56c,null))[_0xaa0a('0x53')](handleError(_0x45a56c,null));};exports[_0xaa0a('0xdc')]=function(_0xe878b3,_0x3488ef,_0x305834){var _0x273ee3={};var _0x34e633={};var _0x6ad89a;var _0x498eed;return db[_0xaa0a('0x51')]['findOne']({'where':{'id':_0xe878b3[_0xaa0a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3488ef,null))[_0xaa0a('0x33')](function(_0xe5544e){if(_0xe5544e){_0x6ad89a=_0xe5544e;_0x34e633[_0xaa0a('0x40')]=_[_0xaa0a('0x3c')](db[_0xaa0a('0xa6')][_0xaa0a('0x39')]);_0x34e633[_0xaa0a('0x3b')]=_[_0xaa0a('0x3c')](_0xe878b3[_0xaa0a('0x3b')]);_0x34e633[_0xaa0a('0x3d')]=_[_0xaa0a('0x3e')](_0x34e633[_0xaa0a('0x40')],_0x34e633['query']);_0x273ee3[_0xaa0a('0x3f')]=_[_0xaa0a('0x3e')](_0x34e633['model'],qs[_0xaa0a('0x41')](_0xe878b3[_0xaa0a('0x3b')][_0xaa0a('0x41')]));_0x273ee3[_0xaa0a('0x3f')]=_0x273ee3['attributes']['length']?_0x273ee3[_0xaa0a('0x3f')]:_0x34e633[_0xaa0a('0x40')];_0x273ee3[_0xaa0a('0x44')]=qs['sort'](_0xe878b3[_0xaa0a('0x3b')][_0xaa0a('0x45')]);_0x273ee3[_0xaa0a('0x47')]=qs['filters'](_[_0xaa0a('0x63')](_0xe878b3[_0xaa0a('0x3b')],_0x34e633[_0xaa0a('0x3d')]));if(_0xe878b3[_0xaa0a('0x3b')][_0xaa0a('0x46')]){_0x273ee3[_0xaa0a('0x47')]=_['merge'](_0x273ee3[_0xaa0a('0x47')],{'$or':_[_0xaa0a('0x38')](_0x273ee3[_0xaa0a('0x3f')],function(_0x1aa4a7){var _0x53e885={};_0x53e885[_0x1aa4a7]={'$like':'%'+_0xe878b3[_0xaa0a('0x3b')]['filter']+'%'};return _0x53e885;})});}_0x273ee3=_[_0xaa0a('0x4f')]({},_0x273ee3,_0xe878b3[_0xaa0a('0x50')]);return _0x6ad89a[_0xaa0a('0xdc')](_0x273ee3);}})[_0xaa0a('0x33')](function(_0x7abb65){if(_0x7abb65){_0x498eed=_0x7abb65[_0xaa0a('0x42')];if(!_0xe878b3[_0xaa0a('0x3b')]['hasOwnProperty'](_0xaa0a('0x43'))){_0x273ee3[_0xaa0a('0x2a')]=qs[_0xaa0a('0x2a')](_0xe878b3[_0xaa0a('0x3b')][_0xaa0a('0x2a')]);_0x273ee3[_0xaa0a('0x2d')]=qs[_0xaa0a('0x2d')](_0xe878b3[_0xaa0a('0x3b')][_0xaa0a('0x2d')]);}return _0x6ad89a[_0xaa0a('0xdc')](_0x273ee3);}})['then'](function(_0x2c9a94){if(_0x2c9a94){return _0x2c9a94?{'count':_0x498eed,'rows':_0x2c9a94}:null;}})[_0xaa0a('0x33')](respondWithResult(_0x3488ef,null))[_0xaa0a('0x53')](handleError(_0x3488ef,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 15ef052..6b32be4 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 _0x6997=['hook','exports','events','SmsAccount','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6997,0x16a));var _0x7699=function(_0x22b2c8,_0x486b5b){_0x22b2c8=_0x22b2c8-0x0;var _0x59c747=_0x6997[_0x22b2c8];return _0x59c747;};'use strict';var EventEmitter=require(_0x7699('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x7699('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7699('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3342ac){return function(_0x116fb2,_0x312590,_0x5c5fa5){SmsAccountEvents[_0x7699('0x3')](_0x3342ac+':'+_0x116fb2['id'],_0x116fb2);SmsAccountEvents[_0x7699('0x3')](_0x3342ac,_0x116fb2);_0x5c5fa5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x7699('0x4')](e,emitEvent(event));}}module[_0x7699('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0xa795=['exports','events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa795,0x189));var _0x5a79=function(_0xd62c73,_0x581c7f){_0xd62c73=_0xd62c73-0x0;var _0x5220cf=_0xa795[_0xd62c73];return _0x5220cf;};'use strict';var EventEmitter=require(_0x5a79('0x0'));var SmsAccount=require(_0x5a79('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a79('0x2'),'afterUpdate':'update','afterDestroy':_0x5a79('0x3')};function emitEvent(_0x13a96f){return function(_0x227bfc,_0x559d77,_0x581ca3){SmsAccountEvents['emit'](_0x13a96f+':'+_0x227bfc['id'],_0x227bfc);SmsAccountEvents[_0x5a79('0x4')](_0x13a96f,_0x227bfc);_0x581ca3(null);};}for(var e in events){if(events[_0x5a79('0x5')](e)){var event=events[e];SmsAccount[_0x5a79('0x6')](e,emitEvent(event));}}module[_0x5a79('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index fbb7ed7..9cb75ab 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 _0xa1cb=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','lodash'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xa1cb,0x1cb));var _0xba1c=function(_0x50972d,_0x2eed5b){_0x50972d=_0x50972d-0x0;var _0x55cdee=_0xa1cb[_0x50972d];return _0x55cdee;};'use strict';var _=require(_0xba1c('0x0'));var util=require('util');var logger=require(_0xba1c('0x1'))('api');var moment=require(_0xba1c('0x2'));var BPromise=require('bluebird');var rp=require(_0xba1c('0x3'));var fs=require('fs');var path=require(_0xba1c('0x4'));var rimraf=require(_0xba1c('0x5'));var config=require(_0xba1c('0x6'));var attributes=require(_0xba1c('0x7'));module['exports']=function(_0x2f1ed6,_0x498518){return _0x2f1ed6[_0xba1c('0x8')](_0xba1c('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc8=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x163318,_0x24eaaa){var _0x2314ef=function(_0x3ec4c6){while(--_0x3ec4c6){_0x163318['push'](_0x163318['shift']());}};_0x2314ef(++_0x24eaaa);}(_0xafc8,0x174));var _0x8afc=function(_0x2093fe,_0x2321cd){_0x2093fe=_0x2093fe-0x0;var _0x7ea27f=_0xafc8[_0x2093fe];return _0x7ea27f;};'use strict';var _=require(_0x8afc('0x0'));var util=require(_0x8afc('0x1'));var logger=require(_0x8afc('0x2'))('api');var moment=require(_0x8afc('0x3'));var BPromise=require(_0x8afc('0x4'));var rp=require(_0x8afc('0x5'));var fs=require('fs');var path=require(_0x8afc('0x6'));var rimraf=require(_0x8afc('0x7'));var config=require(_0x8afc('0x8'));var attributes=require(_0x8afc('0x9'));module[_0x8afc('0xa')]=function(_0x2fa1e6,_0x4da5e3){return _0x2fa1e6[_0x8afc('0xb')](_0x8afc('0xc'),attributes,{'tableName':_0x8afc('0xd'),'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 f55bb05..015a271 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 _0xdd9c=['where','attributes','include','map','model','then','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./smsAccount.socket','register','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','ShowSmsAccount','SmsAccount','options'];(function(_0x420e1b,_0x139288){var _0x313bea=function(_0x21978c){while(--_0x21978c){_0x420e1b['push'](_0x420e1b['shift']());}};_0x313bea(++_0x139288);}(_0xdd9c,0x73));var _0xcdd9=function(_0x513810,_0x2ccbbe){_0x513810=_0x513810-0x0;var _0x3538dc=_0xdd9c[_0x513810];return _0x3538dc;};'use strict';var _=require(_0xcdd9('0x0'));var util=require(_0xcdd9('0x1'));var moment=require(_0xcdd9('0x2'));var BPromise=require('bluebird');var rs=require(_0xcdd9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdd9('0x4'))['db'];var utils=require(_0xcdd9('0x5'));var logger=require(_0xcdd9('0x6'))(_0xcdd9('0x7'));var config=require(_0xcdd9('0x8'));var jayson=require(_0xcdd9('0x9'));var client=jayson['client'][_0xcdd9('0xa')]({'port':0x232a});config[_0xcdd9('0xb')]=_['defaults'](config[_0xcdd9('0xb')],{'host':_0xcdd9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdd9('0xb')]));require(_0xcdd9('0xd'))[_0xcdd9('0xe')](socket);function respondWithRpcPromise(_0xf386f6,_0x3fa5e0,_0x2a3d71){return new BPromise(function(_0x5a1d2f,_0x4d067e){return client[_0xcdd9('0xf')](_0xf386f6,_0x2a3d71)['then'](function(_0x5a41b8){logger['info']('SmsAccount,\x20%s,\x20%s',_0x3fa5e0,_0xcdd9('0x10'));logger[_0xcdd9('0x11')](_0xcdd9('0x12'),_0x3fa5e0,_0xcdd9('0x10'),JSON['stringify'](_0x5a41b8));if(_0x5a41b8[_0xcdd9('0x13')]){if(_0x5a41b8[_0xcdd9('0x13')][_0xcdd9('0x14')]===0x1f4){logger[_0xcdd9('0x13')](_0xcdd9('0x15'),_0x3fa5e0,_0x5a41b8[_0xcdd9('0x13')][_0xcdd9('0x16')]);return _0x4d067e(_0x5a41b8[_0xcdd9('0x13')]['message']);}logger[_0xcdd9('0x13')](_0xcdd9('0x15'),_0x3fa5e0,_0x5a41b8[_0xcdd9('0x13')]['message']);return _0x5a1d2f(_0x5a41b8[_0xcdd9('0x13')]['message']);}else{logger[_0xcdd9('0x17')](_0xcdd9('0x15'),_0x3fa5e0,_0xcdd9('0x10'));_0x5a1d2f(_0x5a41b8[_0xcdd9('0x18')][_0xcdd9('0x16')]);}})[_0xcdd9('0x19')](function(_0x51dc2b){logger['error'](_0xcdd9('0x15'),_0x3fa5e0,_0x51dc2b);_0x4d067e(_0x51dc2b);});});}exports[_0xcdd9('0x1a')]=function(_0x32ecf5){var _0x3a3317=this;return new Promise(function(_0x6895ec,_0x277a06){return db[_0xcdd9('0x1b')]['find']({'raw':_0x32ecf5[_0xcdd9('0x1c')]?_0x32ecf5[_0xcdd9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32ecf5[_0xcdd9('0x1c')]?_0x32ecf5['options'][_0xcdd9('0x1d')]||null:null,'attributes':_0x32ecf5['options']?_0x32ecf5[_0xcdd9('0x1c')][_0xcdd9('0x1e')]||null:null,'include':_0x32ecf5[_0xcdd9('0x1c')]?_0x32ecf5[_0xcdd9('0x1c')][_0xcdd9('0x1f')]?_['map'](_0x32ecf5[_0xcdd9('0x1c')]['include'],function(_0x2b7bc1){return{'model':db[_0x2b7bc1['model']],'as':_0x2b7bc1['as'],'attributes':_0x2b7bc1[_0xcdd9('0x1e')],'include':_0x2b7bc1[_0xcdd9('0x1f')]?_[_0xcdd9('0x20')](_0x2b7bc1[_0xcdd9('0x1f')],function(_0x2948d3){return{'model':db[_0x2948d3[_0xcdd9('0x21')]],'as':_0x2948d3['as'],'attributes':_0x2948d3[_0xcdd9('0x1e')],'include':_0x2948d3['include']?_[_0xcdd9('0x20')](_0x2948d3[_0xcdd9('0x1f')],function(_0x20476f){return{'model':db[_0x20476f[_0xcdd9('0x21')]],'as':_0x20476f['as'],'attributes':_0x20476f[_0xcdd9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcdd9('0x22')](function(_0x45bb0b){logger['info'](_0xcdd9('0x1a'),_0x32ecf5);logger[_0xcdd9('0x11')](_0xcdd9('0x1a'),_0x32ecf5,JSON[_0xcdd9('0x23')](_0x45bb0b));_0x6895ec(_0x45bb0b);})[_0xcdd9('0x19')](function(_0x2ff190){logger[_0xcdd9('0x13')](_0xcdd9('0x1a'),_0x2ff190[_0xcdd9('0x16')],_0x32ecf5);_0x277a06(_0x3a3317[_0xcdd9('0x13')](0x1f4,_0x2ff190[_0xcdd9('0x16')]));});});}; \ No newline at end of file +var _0xf0aa=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c30ed,_0x11d113){var _0x2276aa=function(_0x3df11e){while(--_0x3df11e){_0x3c30ed['push'](_0x3c30ed['shift']());}};_0x2276aa(++_0x11d113);}(_0xf0aa,0x177));var _0xaf0a=function(_0x1c6995,_0x4d9d47){_0x1c6995=_0x1c6995-0x0;var _0x5789ac=_0xf0aa[_0x1c6995];return _0x5789ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaf0a('0x0'));var BPromise=require(_0xaf0a('0x1'));var rs=require(_0xaf0a('0x2'));var fs=require('fs');var Redis=require(_0xaf0a('0x3'));var db=require(_0xaf0a('0x4'))['db'];var utils=require(_0xaf0a('0x5'));var logger=require(_0xaf0a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaf0a('0x7'));var client=jayson[_0xaf0a('0x8')][_0xaf0a('0x9')]({'port':0x232a});config[_0xaf0a('0xa')]=_[_0xaf0a('0xb')](config[_0xaf0a('0xa')],{'host':_0xaf0a('0xc'),'port':0x18eb});var socket=require(_0xaf0a('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xaf0a('0xe')](socket);function respondWithRpcPromise(_0x2340d8,_0x4deed7,_0x487226){return new BPromise(function(_0x4be8ec,_0x3786b8){return client[_0xaf0a('0xf')](_0x2340d8,_0x487226)[_0xaf0a('0x10')](function(_0x365b90){logger[_0xaf0a('0x11')]('SmsAccount,\x20%s,\x20%s',_0x4deed7,_0xaf0a('0x12'));logger[_0xaf0a('0x13')](_0xaf0a('0x14'),_0x4deed7,'request\x20sent',JSON[_0xaf0a('0x15')](_0x365b90));if(_0x365b90[_0xaf0a('0x16')]){if(_0x365b90[_0xaf0a('0x16')][_0xaf0a('0x17')]===0x1f4){logger[_0xaf0a('0x16')](_0xaf0a('0x18'),_0x4deed7,_0x365b90['error'][_0xaf0a('0x19')]);return _0x3786b8(_0x365b90['error'][_0xaf0a('0x19')]);}logger[_0xaf0a('0x16')](_0xaf0a('0x18'),_0x4deed7,_0x365b90[_0xaf0a('0x16')]['message']);return _0x4be8ec(_0x365b90[_0xaf0a('0x16')][_0xaf0a('0x19')]);}else{logger[_0xaf0a('0x11')]('SmsAccount,\x20%s,\x20%s',_0x4deed7,_0xaf0a('0x12'));_0x4be8ec(_0x365b90[_0xaf0a('0x1a')][_0xaf0a('0x19')]);}})[_0xaf0a('0x1b')](function(_0x5fabf){logger[_0xaf0a('0x16')](_0xaf0a('0x18'),_0x4deed7,_0x5fabf);_0x3786b8(_0x5fabf);});});}exports[_0xaf0a('0x1c')]=function(_0x401999){var _0x53806e=this;return new Promise(function(_0x45b05a,_0x19663f){return db[_0xaf0a('0x1d')][_0xaf0a('0x1e')]({'raw':_0x401999[_0xaf0a('0x1f')]?_0x401999['options'][_0xaf0a('0x20')]===undefined?!![]:![]:!![],'where':_0x401999[_0xaf0a('0x1f')]?_0x401999[_0xaf0a('0x1f')][_0xaf0a('0x21')]||null:null,'attributes':_0x401999[_0xaf0a('0x1f')]?_0x401999[_0xaf0a('0x1f')][_0xaf0a('0x22')]||null:null,'include':_0x401999['options']?_0x401999[_0xaf0a('0x1f')][_0xaf0a('0x23')]?_[_0xaf0a('0x24')](_0x401999[_0xaf0a('0x1f')][_0xaf0a('0x23')],function(_0x41354b){return{'model':db[_0x41354b['model']],'as':_0x41354b['as'],'attributes':_0x41354b[_0xaf0a('0x22')],'include':_0x41354b[_0xaf0a('0x23')]?_[_0xaf0a('0x24')](_0x41354b[_0xaf0a('0x23')],function(_0x4840a3){return{'model':db[_0x4840a3[_0xaf0a('0x25')]],'as':_0x4840a3['as'],'attributes':_0x4840a3[_0xaf0a('0x22')],'include':_0x4840a3['include']?_['map'](_0x4840a3['include'],function(_0x4d5787){return{'model':db[_0x4d5787['model']],'as':_0x4d5787['as'],'attributes':_0x4d5787['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf0a('0x10')](function(_0x38905d){logger[_0xaf0a('0x11')](_0xaf0a('0x1c'),_0x401999);logger[_0xaf0a('0x13')]('ShowSmsAccount',_0x401999,JSON[_0xaf0a('0x15')](_0x38905d));_0x45b05a(_0x38905d);})['catch'](function(_0x1f6aed){logger[_0xaf0a('0x16')](_0xaf0a('0x1c'),_0x1f6aed['message'],_0x401999);_0x19663f(_0x53806e[_0xaf0a('0x16')](0x1f4,_0x1f6aed['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 15093c5..261e13c 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 ef224be..32df74a 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x35d134,_0x16d7b3){var _0x170083=function(_0x1285b4){while(--_0x1285b4){_0x35d134['push'](_0x35d134['shift']());}};_0x170083(++_0x16d7b3);}(_0x3e74,0x175));var _0x43e7=function(_0x32c04,_0xa442f6){_0x32c04=_0x32c04-0x0;var _0x38409e=_0x3e74[_0x32c04];return _0x38409e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1639ce,_0x3c8593){var _0x2d3d55=function(_0x587b42){while(--_0x587b42){_0x1639ce['push'](_0x1639ce['shift']());}};_0x2d3d55(++_0x3c8593);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 8e5fc21..710b625 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 _0x80fd=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0xd3f186,_0x187bfd){var _0x1fec74=function(_0x304810){while(--_0x304810){_0xd3f186['push'](_0xd3f186['shift']());}};_0x1fec74(++_0x187bfd);}(_0x80fd,0x67));var _0xd80f=function(_0x5c54b7,_0x26ecf4){_0x5c54b7=_0x5c54b7-0x0;var _0x1c2693=_0x80fd[_0x5c54b7];return _0x1c2693;};'use strict';var Sequelize=require(_0xd80f('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd80f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd80f('0x2')],'allowNull':![],'defaultValue':_0xd80f('0x3')},'appdata':{'type':Sequelize[_0xd80f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd80f('0x2')],'defaultValue':_0xd80f('0x5')}}; \ No newline at end of file +var _0x6e6a=['STRING','*,*,*,*','sequelize','exports','TEXT'];(function(_0x46257b,_0x4cc0aa){var _0x2fccee=function(_0x1b40ca){while(--_0x1b40ca){_0x46257b['push'](_0x46257b['shift']());}};_0x2fccee(++_0x4cc0aa);}(_0x6e6a,0x1b0));var _0xa6e6=function(_0x1a8268,_0x37d861){_0x1a8268=_0x1a8268-0x0;var _0x4126f4=_0x6e6a[_0x1a8268];return _0x4126f4;};'use strict';var Sequelize=require(_0xa6e6('0x0'));module[_0xa6e6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa6e6('0x2')]()},'description':{'type':Sequelize[_0xa6e6('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa6e6('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7b28f07..555a998 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 _0xdbe7=['length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','SmsApplication','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','apply','save','update','then','destroy','sendStatus','stack','name','index','fieldName','type','model','map','query','keys','intersection','attributes','fields'];(function(_0x42fd1c,_0x25b4c6){var _0x1d3845=function(_0x292251){while(--_0x292251){_0x42fd1c['push'](_0x42fd1c['shift']());}};_0x1d3845(++_0x25b4c6);}(_0xdbe7,0xee));var _0x7dbe=function(_0x333768,_0x45de2e){_0x333768=_0x333768-0x0;var _0x1f3f8f=_0xdbe7[_0x333768];return _0x1f3f8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7dbe('0x0'));var zipdir=require(_0x7dbe('0x1'));var jsonpatch=require(_0x7dbe('0x2'));var rp=require(_0x7dbe('0x3'));var moment=require('moment');var BPromise=require(_0x7dbe('0x4'));var Mustache=require(_0x7dbe('0x5'));var util=require(_0x7dbe('0x6'));var path=require(_0x7dbe('0x7'));var sox=require('sox');var csv=require(_0x7dbe('0x8'));var ejs=require(_0x7dbe('0x9'));var fs=require('fs');var fs_extra=require(_0x7dbe('0xa'));var _=require(_0x7dbe('0xb'));var squel=require(_0x7dbe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7dbe('0xd'));var toCsv=require(_0x7dbe('0x8'));var querystring=require('querystring');var Papa=require(_0x7dbe('0xe'));var Redis=require(_0x7dbe('0xf'));var authService=require(_0x7dbe('0x10'));var qs=require(_0x7dbe('0x11'));var as=require(_0x7dbe('0x12'));var hardwareService=require(_0x7dbe('0x13'));var logger=require(_0x7dbe('0x14'))(_0x7dbe('0x15'));var utils=require(_0x7dbe('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7dbe('0x17'));var db=require(_0x7dbe('0x18'))['db'];function respondWithStatusCode(_0x6c6c50,_0x2f2974){_0x2f2974=_0x2f2974||0xcc;return function(_0x311371){if(_0x311371){return _0x6c6c50['sendStatus'](_0x2f2974);}return _0x6c6c50[_0x7dbe('0x19')](_0x2f2974)['end']();};}function respondWithResult(_0x4bae20,_0x13df80){_0x13df80=_0x13df80||0xc8;return function(_0x3d5219){if(_0x3d5219){return _0x4bae20[_0x7dbe('0x19')](_0x13df80)[_0x7dbe('0x1a')](_0x3d5219);}};}function respondWithFilteredResult(_0x5905bc,_0x30c67f){return function(_0x5694db){if(_0x5694db){var _0x376da0=typeof _0x30c67f['offset']===_0x7dbe('0x1b')&&typeof _0x30c67f['limit']===_0x7dbe('0x1b');var _0x53e8e5=_0x5694db[_0x7dbe('0x1c')];var _0x283aed=_0x376da0?0x0:_0x30c67f[_0x7dbe('0x1d')];var _0x1b882a=_0x376da0?_0x5694db['count']:_0x30c67f[_0x7dbe('0x1d')]+_0x30c67f[_0x7dbe('0x1e')];var _0x36efed;if(_0x1b882a>=_0x53e8e5){_0x1b882a=_0x53e8e5;_0x36efed=0xc8;}else{_0x36efed=0xce;}_0x5905bc[_0x7dbe('0x19')](_0x36efed);return _0x5905bc[_0x7dbe('0x1f')]('Content-Range',_0x283aed+'-'+_0x1b882a+'/'+_0x53e8e5)[_0x7dbe('0x1a')](_0x5694db);}return null;};}function patchUpdates(_0x21bfc3){return function(_0x240bbe){try{jsonpatch[_0x7dbe('0x20')](_0x240bbe,_0x21bfc3,!![]);}catch(_0x504eae){return BPromise['reject'](_0x504eae);}return _0x240bbe[_0x7dbe('0x21')]();};}function saveUpdates(_0xaeea23,_0x58b09c){return function(_0x460ff0){if(_0x460ff0){return _0x460ff0[_0x7dbe('0x22')](_0xaeea23)[_0x7dbe('0x23')](function(_0x3b4cf5){return _0x3b4cf5;});}return null;};}function removeEntity(_0x3a9fad,_0x503ae4){return function(_0x4624d0){if(_0x4624d0){return _0x4624d0[_0x7dbe('0x24')]()[_0x7dbe('0x23')](function(){_0x3a9fad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x538f6e,_0x179866){return function(_0x3ab9b7){if(!_0x3ab9b7){_0x538f6e[_0x7dbe('0x25')](0x194);}return _0x3ab9b7;};}function handleError(_0x325cd9,_0x564905){_0x564905=_0x564905||0x1f4;return function(_0x556891){logger['error'](_0x556891[_0x7dbe('0x26')]);if(_0x556891[_0x7dbe('0x27')]){delete _0x556891['name'];}_0x325cd9['status'](_0x564905)['send'](_0x556891);};}exports[_0x7dbe('0x28')]=function(_0x4a00d6,_0x402050){var _0x5bbd24={},_0x2a7fb2={},_0xb73cdd={'count':0x0,'rows':[]};var _0x21ac64=_['map'](db['SmsApplication']['rawAttributes'],function(_0x232cb0){return{'name':_0x232cb0[_0x7dbe('0x29')],'type':_0x232cb0[_0x7dbe('0x2a')]['key']};});_0x2a7fb2[_0x7dbe('0x2b')]=_[_0x7dbe('0x2c')](_0x21ac64,_0x7dbe('0x27'));_0x2a7fb2[_0x7dbe('0x2d')]=_[_0x7dbe('0x2e')](_0x4a00d6[_0x7dbe('0x2d')]);_0x2a7fb2['filters']=_[_0x7dbe('0x2f')](_0x2a7fb2[_0x7dbe('0x2b')],_0x2a7fb2[_0x7dbe('0x2d')]);_0x5bbd24[_0x7dbe('0x30')]=_[_0x7dbe('0x2f')](_0x2a7fb2['model'],qs[_0x7dbe('0x31')](_0x4a00d6[_0x7dbe('0x2d')][_0x7dbe('0x31')]));_0x5bbd24[_0x7dbe('0x30')]=_0x5bbd24[_0x7dbe('0x30')][_0x7dbe('0x32')]?_0x5bbd24[_0x7dbe('0x30')]:_0x2a7fb2['model'];if(!_0x4a00d6[_0x7dbe('0x2d')][_0x7dbe('0x33')](_0x7dbe('0x34'))){_0x5bbd24[_0x7dbe('0x1e')]=qs['limit'](_0x4a00d6['query'][_0x7dbe('0x1e')]);_0x5bbd24[_0x7dbe('0x1d')]=qs[_0x7dbe('0x1d')](_0x4a00d6[_0x7dbe('0x2d')]['offset']);}_0x5bbd24['order']=qs[_0x7dbe('0x35')](_0x4a00d6[_0x7dbe('0x2d')][_0x7dbe('0x35')]);_0x5bbd24['where']=qs[_0x7dbe('0x36')](_[_0x7dbe('0x37')](_0x4a00d6[_0x7dbe('0x2d')],_0x2a7fb2[_0x7dbe('0x36')]),_0x21ac64);if(_0x4a00d6[_0x7dbe('0x2d')][_0x7dbe('0x38')]){_0x5bbd24['where']=_[_0x7dbe('0x39')](_0x5bbd24[_0x7dbe('0x3a')],{'$or':_[_0x7dbe('0x2c')](_0x21ac64,function(_0x35ab1d){if(_0x35ab1d[_0x7dbe('0x2a')]!==_0x7dbe('0x3b')){var _0x4769e4={};_0x4769e4[_0x35ab1d[_0x7dbe('0x27')]]={'$like':'%'+_0x4a00d6[_0x7dbe('0x2d')][_0x7dbe('0x38')]+'%'};return _0x4769e4;}})});}_0x5bbd24=_[_0x7dbe('0x39')]({},_0x5bbd24,_0x4a00d6['options']);var _0x239688={'where':_0x5bbd24[_0x7dbe('0x3a')]};return db[_0x7dbe('0x3c')][_0x7dbe('0x1c')](_0x239688)[_0x7dbe('0x23')](function(_0xafa542){_0xb73cdd[_0x7dbe('0x1c')]=_0xafa542;if(_0x4a00d6[_0x7dbe('0x2d')]['includeAll']){_0x5bbd24[_0x7dbe('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x7dbe('0x3e')](_0x5bbd24);})[_0x7dbe('0x23')](function(_0x1331b2){_0xb73cdd[_0x7dbe('0x3f')]=_0x1331b2;return _0xb73cdd;})[_0x7dbe('0x23')](respondWithFilteredResult(_0x402050,_0x5bbd24))['catch'](handleError(_0x402050,null));};exports[_0x7dbe('0x40')]=function(_0x520887,_0x63bf48){var _0x599405={'raw':!![],'where':{'id':_0x520887[_0x7dbe('0x41')]['id']}},_0x589613={};_0x589613['model']=_['keys'](db[_0x7dbe('0x3c')][_0x7dbe('0x42')]);_0x589613['query']=_[_0x7dbe('0x2e')](_0x520887['query']);_0x589613['filters']=_['intersection'](_0x589613[_0x7dbe('0x2b')],_0x589613[_0x7dbe('0x2d')]);_0x599405[_0x7dbe('0x30')]=_['intersection'](_0x589613['model'],qs[_0x7dbe('0x31')](_0x520887[_0x7dbe('0x2d')]['fields']));_0x599405[_0x7dbe('0x30')]=_0x599405[_0x7dbe('0x30')][_0x7dbe('0x32')]?_0x599405['attributes']:_0x589613[_0x7dbe('0x2b')];if(_0x520887[_0x7dbe('0x2d')]['includeAll']){_0x599405['include']=[{'all':!![]}];}_0x599405=_['merge']({},_0x599405,_0x520887[_0x7dbe('0x43')]);return db[_0x7dbe('0x3c')][_0x7dbe('0x44')](_0x599405)['then'](handleEntityNotFound(_0x63bf48,null))[_0x7dbe('0x23')](respondWithResult(_0x63bf48,null))[_0x7dbe('0x45')](handleError(_0x63bf48,null));};exports[_0x7dbe('0x46')]=function(_0x9fbb3f,_0x1bd5fc){return db[_0x7dbe('0x3c')][_0x7dbe('0x46')](_0x9fbb3f[_0x7dbe('0x47')],{})[_0x7dbe('0x23')](respondWithResult(_0x1bd5fc,0xc9))[_0x7dbe('0x45')](handleError(_0x1bd5fc,null));};exports[_0x7dbe('0x22')]=function(_0x4475a3,_0x3d50ce){if(_0x4475a3['body']['id']){delete _0x4475a3[_0x7dbe('0x47')]['id'];}return db[_0x7dbe('0x3c')][_0x7dbe('0x44')]({'where':{'id':_0x4475a3[_0x7dbe('0x41')]['id']}})[_0x7dbe('0x23')](handleEntityNotFound(_0x3d50ce,null))[_0x7dbe('0x23')](saveUpdates(_0x4475a3[_0x7dbe('0x47')],null))[_0x7dbe('0x23')](respondWithResult(_0x3d50ce,null))[_0x7dbe('0x45')](handleError(_0x3d50ce,null));};exports[_0x7dbe('0x24')]=function(_0x75cdfa,_0x4f3326){return db[_0x7dbe('0x3c')][_0x7dbe('0x44')]({'where':{'id':_0x75cdfa[_0x7dbe('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f3326,null))[_0x7dbe('0x23')](removeEntity(_0x4f3326,null))[_0x7dbe('0x45')](handleError(_0x4f3326,null));}; \ No newline at end of file +var _0xf05d=['find','create','body','update','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length'];(function(_0xc78583,_0x122826){var _0x211b3c=function(_0x2eb2cd){while(--_0x2eb2cd){_0xc78583['push'](_0xc78583['shift']());}};_0x211b3c(++_0x122826);}(_0xf05d,0x90));var _0xdf05=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf05d[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdf05('0x1'));var BPromise=require(_0xdf05('0x2'));var Mustache=require(_0xdf05('0x3'));var util=require(_0xdf05('0x4'));var path=require(_0xdf05('0x5'));var sox=require(_0xdf05('0x6'));var csv=require(_0xdf05('0x7'));var ejs=require(_0xdf05('0x8'));var fs=require('fs');var fs_extra=require(_0xdf05('0x9'));var _=require(_0xdf05('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf05('0xb'));var deskjs=require(_0xdf05('0xc'));var toCsv=require(_0xdf05('0x7'));var querystring=require('querystring');var Papa=require(_0xdf05('0xd'));var Redis=require(_0xdf05('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdf05('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf05('0x10'));var logger=require(_0xdf05('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xdf05('0x12'));var licenseUtil=require(_0xdf05('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44af2f,_0x58eda8){_0x58eda8=_0x58eda8||0xcc;return function(_0x3889c7){if(_0x3889c7){return _0x44af2f['sendStatus'](_0x58eda8);}return _0x44af2f[_0xdf05('0x14')](_0x58eda8)[_0xdf05('0x15')]();};}function respondWithResult(_0x4192d7,_0xbfdb91){_0xbfdb91=_0xbfdb91||0xc8;return function(_0xea9999){if(_0xea9999){return _0x4192d7[_0xdf05('0x14')](_0xbfdb91)['json'](_0xea9999);}};}function respondWithFilteredResult(_0x117d0a,_0x3403a1){return function(_0x3de7da){if(_0x3de7da){var _0x29484a=typeof _0x3403a1['offset']==='undefined'&&typeof _0x3403a1[_0xdf05('0x16')]===_0xdf05('0x17');var _0x128d99=_0x3de7da['count'];var _0x4f44d1=_0x29484a?0x0:_0x3403a1['offset'];var _0x5a7179=_0x29484a?_0x3de7da[_0xdf05('0x18')]:_0x3403a1[_0xdf05('0x19')]+_0x3403a1[_0xdf05('0x16')];var _0x48bfbe;if(_0x5a7179>=_0x128d99){_0x5a7179=_0x128d99;_0x48bfbe=0xc8;}else{_0x48bfbe=0xce;}_0x117d0a['status'](_0x48bfbe);return _0x117d0a[_0xdf05('0x1a')](_0xdf05('0x1b'),_0x4f44d1+'-'+_0x5a7179+'/'+_0x128d99)['json'](_0x3de7da);}return null;};}function patchUpdates(_0xe2b52){return function(_0x348992){try{jsonpatch[_0xdf05('0x1c')](_0x348992,_0xe2b52,!![]);}catch(_0x104bab){return BPromise[_0xdf05('0x1d')](_0x104bab);}return _0x348992[_0xdf05('0x1e')]();};}function saveUpdates(_0x28f166,_0x47108c){return function(_0x1ede4e){if(_0x1ede4e){return _0x1ede4e['update'](_0x28f166)[_0xdf05('0x1f')](function(_0x40da24){return _0x40da24;});}return null;};}function removeEntity(_0x46b409,_0x5714bf){return function(_0x332b66){if(_0x332b66){return _0x332b66['destroy']()[_0xdf05('0x1f')](function(){_0x46b409[_0xdf05('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x159015,_0x44840b){return function(_0x11893d){if(!_0x11893d){_0x159015['sendStatus'](0x194);}return _0x11893d;};}function handleError(_0x281eb8,_0x3f2200){_0x3f2200=_0x3f2200||0x1f4;return function(_0x3821f2){logger[_0xdf05('0x20')](_0x3821f2[_0xdf05('0x21')]);if(_0x3821f2[_0xdf05('0x22')]){delete _0x3821f2['name'];}_0x281eb8[_0xdf05('0x14')](_0x3f2200)[_0xdf05('0x23')](_0x3821f2);};}exports[_0xdf05('0x24')]=function(_0x54d9ca,_0x1c1eda){var _0x3940d0={},_0x3410c6={},_0x4af0a4={'count':0x0,'rows':[]};var _0x32aff3=_[_0xdf05('0x25')](db[_0xdf05('0x26')][_0xdf05('0x27')],function(_0x466485){return{'name':_0x466485[_0xdf05('0x28')],'type':_0x466485[_0xdf05('0x29')][_0xdf05('0x2a')]};});_0x3410c6['model']=_[_0xdf05('0x25')](_0x32aff3,_0xdf05('0x22'));_0x3410c6[_0xdf05('0x2b')]=_[_0xdf05('0x2c')](_0x54d9ca[_0xdf05('0x2b')]);_0x3410c6['filters']=_['intersection'](_0x3410c6[_0xdf05('0x2d')],_0x3410c6[_0xdf05('0x2b')]);_0x3940d0[_0xdf05('0x2e')]=_[_0xdf05('0x2f')](_0x3410c6[_0xdf05('0x2d')],qs['fields'](_0x54d9ca[_0xdf05('0x2b')]['fields']));_0x3940d0[_0xdf05('0x2e')]=_0x3940d0['attributes']['length']?_0x3940d0[_0xdf05('0x2e')]:_0x3410c6['model'];if(!_0x54d9ca[_0xdf05('0x2b')]['hasOwnProperty']('nolimit')){_0x3940d0[_0xdf05('0x16')]=qs[_0xdf05('0x16')](_0x54d9ca[_0xdf05('0x2b')][_0xdf05('0x16')]);_0x3940d0['offset']=qs[_0xdf05('0x19')](_0x54d9ca[_0xdf05('0x2b')][_0xdf05('0x19')]);}_0x3940d0[_0xdf05('0x30')]=qs['sort'](_0x54d9ca['query'][_0xdf05('0x31')]);_0x3940d0[_0xdf05('0x32')]=qs[_0xdf05('0x33')](_[_0xdf05('0x34')](_0x54d9ca[_0xdf05('0x2b')],_0x3410c6['filters']),_0x32aff3);if(_0x54d9ca[_0xdf05('0x2b')][_0xdf05('0x35')]){_0x3940d0[_0xdf05('0x32')]=_[_0xdf05('0x36')](_0x3940d0[_0xdf05('0x32')],{'$or':_[_0xdf05('0x25')](_0x32aff3,function(_0x5893ff){if(_0x5893ff['type']!==_0xdf05('0x37')){var _0x5c7caf={};_0x5c7caf[_0x5893ff[_0xdf05('0x22')]]={'$like':'%'+_0x54d9ca['query'][_0xdf05('0x35')]+'%'};return _0x5c7caf;}})});}_0x3940d0=_[_0xdf05('0x36')]({},_0x3940d0,_0x54d9ca[_0xdf05('0x38')]);var _0x326ea3={'where':_0x3940d0[_0xdf05('0x32')]};return db[_0xdf05('0x26')][_0xdf05('0x18')](_0x326ea3)[_0xdf05('0x1f')](function(_0x32cfda){_0x4af0a4[_0xdf05('0x18')]=_0x32cfda;if(_0x54d9ca[_0xdf05('0x2b')][_0xdf05('0x39')]){_0x3940d0[_0xdf05('0x3a')]=[{'all':!![]}];}return db[_0xdf05('0x26')][_0xdf05('0x3b')](_0x3940d0);})[_0xdf05('0x1f')](function(_0x490146){_0x4af0a4[_0xdf05('0x3c')]=_0x490146;return _0x4af0a4;})[_0xdf05('0x1f')](respondWithFilteredResult(_0x1c1eda,_0x3940d0))[_0xdf05('0x3d')](handleError(_0x1c1eda,null));};exports[_0xdf05('0x3e')]=function(_0x5c0898,_0x33b871){var _0x3f1071={'raw':!![],'where':{'id':_0x5c0898[_0xdf05('0x3f')]['id']}},_0x4814ab={};_0x4814ab[_0xdf05('0x2d')]=_[_0xdf05('0x2c')](db['SmsApplication']['rawAttributes']);_0x4814ab[_0xdf05('0x2b')]=_[_0xdf05('0x2c')](_0x5c0898[_0xdf05('0x2b')]);_0x4814ab['filters']=_['intersection'](_0x4814ab['model'],_0x4814ab[_0xdf05('0x2b')]);_0x3f1071['attributes']=_[_0xdf05('0x2f')](_0x4814ab['model'],qs[_0xdf05('0x40')](_0x5c0898['query']['fields']));_0x3f1071[_0xdf05('0x2e')]=_0x3f1071[_0xdf05('0x2e')][_0xdf05('0x41')]?_0x3f1071[_0xdf05('0x2e')]:_0x4814ab[_0xdf05('0x2d')];if(_0x5c0898[_0xdf05('0x2b')][_0xdf05('0x39')]){_0x3f1071[_0xdf05('0x3a')]=[{'all':!![]}];}_0x3f1071=_[_0xdf05('0x36')]({},_0x3f1071,_0x5c0898['options']);return db[_0xdf05('0x26')][_0xdf05('0x42')](_0x3f1071)[_0xdf05('0x1f')](handleEntityNotFound(_0x33b871,null))['then'](respondWithResult(_0x33b871,null))['catch'](handleError(_0x33b871,null));};exports[_0xdf05('0x43')]=function(_0x5c799b,_0x32c060){return db[_0xdf05('0x26')][_0xdf05('0x43')](_0x5c799b[_0xdf05('0x44')],{})[_0xdf05('0x1f')](respondWithResult(_0x32c060,0xc9))[_0xdf05('0x3d')](handleError(_0x32c060,null));};exports[_0xdf05('0x45')]=function(_0x5b6a51,_0x3f944d){if(_0x5b6a51[_0xdf05('0x44')]['id']){delete _0x5b6a51[_0xdf05('0x44')]['id'];}return db[_0xdf05('0x26')][_0xdf05('0x42')]({'where':{'id':_0x5b6a51[_0xdf05('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f944d,null))[_0xdf05('0x1f')](saveUpdates(_0x5b6a51[_0xdf05('0x44')],null))[_0xdf05('0x1f')](respondWithResult(_0x3f944d,null))['catch'](handleError(_0x3f944d,null));};exports['destroy']=function(_0x2a5b5e,_0x48c698){return db['SmsApplication']['find']({'where':{'id':_0x2a5b5e[_0xdf05('0x3f')]['id']}})[_0xdf05('0x1f')](handleEntityNotFound(_0x48c698,null))[_0xdf05('0x1f')](removeEntity(_0x48c698,null))[_0xdf05('0x3d')](handleError(_0x48c698,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c823312..87079a0 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 _0x87cc=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4c64f1,_0x2e29ab){var _0x2e06ed=function(_0x4dfd1f){while(--_0x4dfd1f){_0x4c64f1['push'](_0x4c64f1['shift']());}};_0x2e06ed(++_0x2e29ab);}(_0x87cc,0x15c));var _0xc87c=function(_0xbc13bd,_0x510e1e){_0xbc13bd=_0xbc13bd-0x0;var _0x336475=_0x87cc[_0xbc13bd];return _0x336475;};'use strict';var _=require(_0xc87c('0x0'));var util=require(_0xc87c('0x1'));var logger=require(_0xc87c('0x2'))(_0xc87c('0x3'));var moment=require(_0xc87c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc87c('0x5'));var rimraf=require('rimraf');var config=require(_0xc87c('0x6'));var attributes=require(_0xc87c('0x7'));module[_0xc87c('0x8')]=function(_0x146f14,_0x11852b){return _0x146f14[_0xc87c('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc87c('0xa'),'collate':_0xc87c('0xb')});}; \ No newline at end of file +var _0x6075=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x6075,0x191));var _0x5607=function(_0x104ca7,_0x266d32){_0x104ca7=_0x104ca7-0x0;var _0x17081f=_0x6075[_0x104ca7];return _0x17081f;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./smsApplication.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('SmsApplication',attributes,{'tableName':_0x5607('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5607('0xb'),'collate':_0x5607('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 47f16c1..ce13431 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 _0x8861=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f74b6,_0x3ec32b){var _0x3c9d3f=function(_0x20c8fd){while(--_0x20c8fd){_0x1f74b6['push'](_0x1f74b6['shift']());}};_0x3c9d3f(++_0x3ec32b);}(_0x8861,0x6d));var _0x1886=function(_0x2f6ce3,_0x23cd93){_0x2f6ce3=_0x2f6ce3-0x0;var _0x20cf45=_0x8861[_0x2f6ce3];return _0x20cf45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1886('0x0'));var BPromise=require(_0x1886('0x1'));var rs=require(_0x1886('0x2'));var fs=require('fs');var Redis=require(_0x1886('0x3'));var db=require(_0x1886('0x4'))['db'];var utils=require(_0x1886('0x5'));var logger=require(_0x1886('0x6'))(_0x1886('0x7'));var config=require(_0x1886('0x8'));var jayson=require(_0x1886('0x9'));var client=jayson[_0x1886('0xa')][_0x1886('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39e8fd,_0x43e483,_0x129353){return new BPromise(function(_0x55ff31,_0x15c5fc){return client['request'](_0x39e8fd,_0x129353)[_0x1886('0xc')](function(_0x489fed){logger[_0x1886('0xd')]('SmsApplication,\x20%s,\x20%s',_0x43e483,_0x1886('0xe'));logger[_0x1886('0xf')](_0x1886('0x10'),_0x43e483,_0x1886('0xe'),JSON[_0x1886('0x11')](_0x489fed));if(_0x489fed[_0x1886('0x12')]){if(_0x489fed['error'][_0x1886('0x13')]===0x1f4){logger[_0x1886('0x12')](_0x1886('0x14'),_0x43e483,_0x489fed[_0x1886('0x12')][_0x1886('0x15')]);return _0x15c5fc(_0x489fed[_0x1886('0x12')]['message']);}logger['error'](_0x1886('0x14'),_0x43e483,_0x489fed[_0x1886('0x12')][_0x1886('0x15')]);return _0x55ff31(_0x489fed['error'][_0x1886('0x15')]);}else{logger[_0x1886('0xd')](_0x1886('0x14'),_0x43e483,'request\x20sent');_0x55ff31(_0x489fed[_0x1886('0x16')][_0x1886('0x15')]);}})['catch'](function(_0x18f7a6){logger['error'](_0x1886('0x14'),_0x43e483,_0x18f7a6);_0x15c5fc(_0x18f7a6);});});} \ No newline at end of file +var _0xc2a2=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x9267ac,_0x572888){var _0x4c8f77=function(_0x10e42f){while(--_0x10e42f){_0x9267ac['push'](_0x9267ac['shift']());}};_0x4c8f77(++_0x572888);}(_0xc2a2,0x84));var _0x2c2a=function(_0x343797,_0xd39997){_0x343797=_0x343797-0x0;var _0xae1d1d=_0xc2a2[_0x343797];return _0xae1d1d;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var moment=require(_0x2c2a('0x2'));var BPromise=require(_0x2c2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2a('0x4'));var db=require(_0x2c2a('0x5'))['db'];var utils=require(_0x2c2a('0x6'));var logger=require('../../config/logger')(_0x2c2a('0x7'));var config=require(_0x2c2a('0x8'));var jayson=require(_0x2c2a('0x9'));var client=jayson[_0x2c2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f476,_0x53b0c0,_0x578a80){return new BPromise(function(_0x48a901,_0x5cc8c5){return client['request'](_0x52f476,_0x578a80)[_0x2c2a('0xb')](function(_0x48ba78){logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,_0x2c2a('0xe'));logger[_0x2c2a('0xf')](_0x2c2a('0x10'),_0x53b0c0,_0x2c2a('0xe'),JSON['stringify'](_0x48ba78));if(_0x48ba78['error']){if(_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x12')]===0x1f4){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x13')]);return _0x5cc8c5(_0x48ba78['error'][_0x2c2a('0x13')]);}logger[_0x2c2a('0x11')]('SmsApplication,\x20%s,\x20%s',_0x53b0c0,_0x48ba78[_0x2c2a('0x11')]['message']);return _0x48a901(_0x48ba78[_0x2c2a('0x11')]['message']);}else{logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,'request\x20sent');_0x48a901(_0x48ba78[_0x2c2a('0x14')][_0x2c2a('0x13')]);}})[_0x2c2a('0x15')](function(_0x7af854){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x7af854);_0x5cc8c5(_0x7af854);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index d7b3877..a4b21b8 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 _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x1309cf,_0x2e6870){var _0x402157=function(_0x4120b6){while(--_0x4120b6){_0x1309cf['push'](_0x1309cf['shift']());}};_0x402157(++_0x2e6870);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x34b7,0x196));var _0x734b=function(_0x159902,_0x2f808c){_0x159902=_0x159902-0x0;var _0x128878=_0x34b7[_0x159902];return _0x128878;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 998aca9..e76342f 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 _0x7b27=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x22783e,_0x591a8e){var _0x40887a=function(_0x1f647c){while(--_0x1f647c){_0x22783e['push'](_0x22783e['shift']());}};_0x40887a(++_0x591a8e);}(_0x7b27,0x186));var _0x77b2=function(_0x255406,_0x20d4aa){_0x255406=_0x255406-0x0;var _0x19117a=_0x7b27[_0x255406];return _0x19117a;};'use strict';var Sequelize=require(_0x77b2('0x0'));var moment=require('moment');module[_0x77b2('0x1')]={'closed':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x77b2('0x3')]},'disposition':{'type':Sequelize[_0x77b2('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x77b2('0x4')]},'note':{'type':Sequelize[_0x77b2('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x77b2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x77b2('0x5')]('in',_0x77b2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x77b2('0x5')]('in',_0x77b2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x44ff=['out','DATE','ENUM','moment','exports','BOOLEAN','STRING'];(function(_0x415700,_0x1a17f0){var _0x4aa494=function(_0xcbe57d){while(--_0xcbe57d){_0x415700['push'](_0x415700['shift']());}};_0x4aa494(++_0x1a17f0);}(_0x44ff,0x1c3));var _0xf44f=function(_0x540d7c,_0x346903){_0x540d7c=_0x540d7c-0x0;var _0x5ca48e=_0x44ff[_0x540d7c];return _0x5ca48e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf44f('0x0'));module[_0xf44f('0x1')]={'closed':{'type':Sequelize[_0xf44f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf44f('0x3')]},'phone':{'type':Sequelize[_0xf44f('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf44f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf44f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf44f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf44f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 4750132..d1e8a24 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 _0xb44e=['text','body','compact','SmsAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','role','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','includeAll','include','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','merge','options','findAll','rows','addTags','setTags','omit','spread','color','emit','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','CmContact','firstName','Messages','secret','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','closedAt','format','direction','out','System','lastName','renderFile','views','.pdf','Sms','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','stack','name','send','Users','TagIds','Tags','split','forEach','push','catch','index','map','SmsInteraction','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','start','end','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression'];(function(_0x48b1f0,_0x51949d){var _0x523d1c=function(_0x5423eb){while(--_0x5423eb){_0x48b1f0['push'](_0x48b1f0['shift']());}};_0x523d1c(++_0x51949d);}(_0xb44e,0x15d));var _0xeb44=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0xb44e[_0x333714];return _0x4c211e;};'use strict';var emlformat=require(_0xeb44('0x0'));var rimraf=require(_0xeb44('0x1'));var zipdir=require(_0xeb44('0x2'));var jsonpatch=require(_0xeb44('0x3'));var rp=require(_0xeb44('0x4'));var moment=require(_0xeb44('0x5'));var BPromise=require(_0xeb44('0x6'));var Mustache=require(_0xeb44('0x7'));var util=require(_0xeb44('0x8'));var path=require('path');var sox=require(_0xeb44('0x9'));var csv=require('to-csv');var ejs=require(_0xeb44('0xa'));var fs=require('fs');var fs_extra=require(_0xeb44('0xb'));var _=require(_0xeb44('0xc'));var squel=require(_0xeb44('0xd'));var crypto=require(_0xeb44('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb44('0xf'));var Papa=require(_0xeb44('0x10'));var Redis=require(_0xeb44('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeb44('0x12'));var as=require(_0xeb44('0x13'));var pdf=require(_0xeb44('0x14'));var hardwareService=require(_0xeb44('0x15'));var logger=require('../../config/logger')(_0xeb44('0x16'));var utils=require(_0xeb44('0x17'));var config=require(_0xeb44('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb44('0x19'))['db'];config['redis']=_[_0xeb44('0x1a')](config[_0xeb44('0x1b')],{'host':_0xeb44('0x1c'),'port':0x18eb});var socket=require(_0xeb44('0x1d'))(new Redis(config[_0xeb44('0x1b')]));require(_0xeb44('0x1e'))['register'](socket);function respondWithStatusCode(_0x31498b,_0x2676fb){_0x2676fb=_0x2676fb||0xcc;return function(_0xff92b4){if(_0xff92b4){return _0x31498b[_0xeb44('0x1f')](_0x2676fb);}return _0x31498b[_0xeb44('0x20')](_0x2676fb)['end']();};}function respondWithResult(_0x19bc96,_0x2c95e5){_0x2c95e5=_0x2c95e5||0xc8;return function(_0x5a7c42){if(_0x5a7c42){return _0x19bc96[_0xeb44('0x20')](_0x2c95e5)[_0xeb44('0x21')](_0x5a7c42);}};}function respondWithFilteredResult(_0x5d98e9,_0x38783d){return function(_0x2c8f41){if(_0x2c8f41){var _0x1ce3e3=typeof _0x38783d['offset']===_0xeb44('0x22')&&typeof _0x38783d[_0xeb44('0x23')]===_0xeb44('0x22');var _0x4477ab=_0x2c8f41[_0xeb44('0x24')];var _0x1fce10=_0x1ce3e3?0x0:_0x38783d[_0xeb44('0x25')];var _0x381c31=_0x1ce3e3?_0x2c8f41[_0xeb44('0x24')]:_0x38783d[_0xeb44('0x25')]+_0x38783d[_0xeb44('0x23')];var _0x3327c0;if(_0x381c31>=_0x4477ab){_0x381c31=_0x4477ab;_0x3327c0=0xc8;}else{_0x3327c0=0xce;}_0x5d98e9[_0xeb44('0x20')](_0x3327c0);return _0x5d98e9[_0xeb44('0x26')](_0xeb44('0x27'),_0x1fce10+'-'+_0x381c31+'/'+_0x4477ab)['json'](_0x2c8f41);}return null;};}function patchUpdates(_0x41d4e4){return function(_0x10456a){try{jsonpatch['apply'](_0x10456a,_0x41d4e4,!![]);}catch(_0xf35d4e){return BPromise['reject'](_0xf35d4e);}return _0x10456a[_0xeb44('0x28')]();};}function saveUpdates(_0x21a66b,_0x83b3e3){return function(_0xdee6b7){if(_0xdee6b7){return _0xdee6b7[_0xeb44('0x29')](_0x21a66b)[_0xeb44('0x2a')](function(_0x47c524){return _0x47c524;});}return null;};}function removeEntity(_0x330e08,_0x39cac1){return function(_0x25de9b){if(_0x25de9b){return _0x25de9b[_0xeb44('0x2b')]()['then'](function(){_0x330e08[_0xeb44('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x248f51,_0x328ece){return function(_0x3296e8){if(!_0x3296e8){_0x248f51[_0xeb44('0x1f')](0x194);}return _0x3296e8;};}function handleError(_0x1317d7,_0x16e5b4){_0x16e5b4=_0x16e5b4||0x1f4;return function(_0x2353a0){logger['error'](_0x2353a0[_0xeb44('0x2c')]);if(_0x2353a0[_0xeb44('0x2d')]){delete _0x2353a0[_0xeb44('0x2d')];}_0x1317d7[_0xeb44('0x20')](_0x16e5b4)[_0xeb44('0x2e')](_0x2353a0);};}function getInteractionUsers(_0x203a81,_0x4d2963){return new BPromise(function(_0x5c7f09,_0x1996a8){try{if(_0x4d2963[_0x203a81['id']]){_0x203a81[_0xeb44('0x2f')]=_['map'](_0x4d2963[_0x203a81['id']],function(_0x1fe134){return{'id':_0x1fe134['id'],'fullname':_0x1fe134['fullname']};});}}catch(_0x1a4d4a){_0x1996a8(_0x1a4d4a);}_0x5c7f09(_0x203a81);});}function getInteractionTags(_0x5e2964,_0x4612a6){return new BPromise(function(_0x4b530a,_0x19c313){try{if(_0x5e2964[_0xeb44('0x30')]){_0x5e2964[_0xeb44('0x31')]=[];_0x5e2964[_0xeb44('0x30')][_0xeb44('0x32')](',')[_0xeb44('0x33')](function(_0x572fe8){_0x5e2964[_0xeb44('0x31')][_0xeb44('0x34')](_0x4612a6[_0x572fe8]);});}delete _0x5e2964['TagIds'];}catch(_0x5a7a46){_0x19c313(_0x5a7a46);}_0x4b530a(_0x5e2964);});}function updateSmsInteraction(_0x47bb97,_0x4ed923,_0x105b5e){return new BPromise(function(_0x1a6d6e,_0x2b3fc1){return getInteractionUsers(_0x47bb97,_0x105b5e)[_0xeb44('0x2a')](function(_0x549007){return getInteractionTags(_0x549007,_0x4ed923);})['then'](function(_0x53df4b){_0x1a6d6e(_0x53df4b);})[_0xeb44('0x35')](function(_0x333e7a){_0x2b3fc1(_0x333e7a);});});}exports[_0xeb44('0x36')]=function(_0x40ea68,_0x7f811f){var _0x5a0266={},_0x5112a3={},_0x26d32c={'count':0x0,'rows':[]};var _0x205486=_[_0xeb44('0x37')](db[_0xeb44('0x38')][_0xeb44('0x39')],function(_0x23b930){return{'name':_0x23b930['fieldName'],'type':_0x23b930[_0xeb44('0x3a')]['key']};});_0x5112a3[_0xeb44('0x3b')]=_[_0xeb44('0x37')](_0x205486,_0xeb44('0x2d'));_0x5112a3[_0xeb44('0x3c')]=_[_0xeb44('0x3d')](_0x40ea68['query']);_0x5112a3[_0xeb44('0x3e')]=_[_0xeb44('0x3f')](_0x5112a3[_0xeb44('0x3b')],_0x5112a3[_0xeb44('0x3c')]);_0x5a0266[_0xeb44('0x40')]=_['intersection'](_0x5112a3[_0xeb44('0x3b')],qs[_0xeb44('0x41')](_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x41')]));_0x5a0266[_0xeb44('0x40')]=_0x5a0266[_0xeb44('0x40')][_0xeb44('0x42')]?_0x5a0266[_0xeb44('0x40')]:_0x5112a3[_0xeb44('0x3b')];if(!_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x43')](_0xeb44('0x44'))){_0x5a0266[_0xeb44('0x23')]=qs['limit'](_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x23')]);_0x5a0266['offset']=qs[_0xeb44('0x25')](_0x40ea68[_0xeb44('0x3c')]['offset']);}_0x5a0266[_0xeb44('0x45')]=qs[_0xeb44('0x46')](_0x40ea68['query'][_0xeb44('0x46')]);_0x5a0266[_0xeb44('0x47')]=qs[_0xeb44('0x3e')](_[_0xeb44('0x48')](_0x40ea68[_0xeb44('0x3c')],_0x5112a3['filters']),_0x205486);var _0x1a7fb4=[];var _0x42011f=squel[_0xeb44('0x49')]()[_0xeb44('0x4a')]('id')['field'](_0xeb44('0x2d'))['field']('color')[_0xeb44('0x4b')](_0xeb44('0x4c'));var _0x6db9e7=squel[_0xeb44('0x49')]()['field']('u.id')[_0xeb44('0x4a')]('u.fullname')['field'](_0xeb44('0x4d'))[_0xeb44('0x4b')]('user_has_sms_interactions','ui')[_0xeb44('0x4e')](_0xeb44('0x4f'),'u',_0xeb44('0x50'));var _0x641eaa=squel['select']()[_0xeb44('0x4b')](_0xeb44('0x51'),'i')[_0xeb44('0x4e')](_0xeb44('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xeb44('0x4e')](_0xeb44('0x4f'),'o',_0xeb44('0x53'))[_0xeb44('0x4e')](_0xeb44('0x54'),'a',_0xeb44('0x55'))['left_join'](_0xeb44('0x56'),'me',_0xeb44('0x57'))[_0xeb44('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xeb44('0x4e')](_0xeb44('0x4c'),'t',_0xeb44('0x58'));var _0x4e2249=squel[_0xeb44('0x59')]();var _0x4d4ea2=[];var _0xac23e9=squel[_0xeb44('0x59')]();var _0x2bfd2e;if(_0x40ea68['query'][_0xeb44('0x5a')]){_0x2bfd2e=as[_0xeb44('0x5b')](_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x5a')]);var _0x2969ff=_0x2bfd2e['sqlOperator'];for(var _0x31a8fa=0x0;_0x31a8fa<_0x2bfd2e['conditions'][_0xeb44('0x42')];_0x31a8fa++){var _0x6241be=_0x2bfd2e[_0xeb44('0x5c')][_0x31a8fa];var _0xce5113='i';var _0x331df2=_[_0xeb44('0x5d')](_0x205486,[_0xeb44('0x2d'),_0x6241be[_0xeb44('0x4a')]]);if(!_0x331df2){switch(_0x6241be['field']){case'unreadMessages':if(_0x6241be[_0xeb44('0x5e')]==0x1){_0x641eaa['having']('`'+_0x6241be[_0xeb44('0x4a')]+_0xeb44('0x5f'));}else{_0x641eaa[_0xeb44('0x60')]('`'+_0x6241be[_0xeb44('0x4a')]+_0xeb44('0x61'));}break;case _0xeb44('0x62'):if(_0x6241be[_0xeb44('0x63')]==='$substring'){if(_0x6241be[_0xeb44('0x5e')]['split']('\x20')[_0xeb44('0x42')]>0x1){_0x4e2249[_0x2969ff](_0xeb44('0x64'),qs[_0xeb44('0x65')](_0x6241be['value']),null);}else{var _0x5369ee='%'+_0x6241be['value']+'%';_0x4e2249[_0x2969ff]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5369ee,_0x5369ee,_0x5369ee);}}else{_0x331df2=_['find'](_0x205486,[_0xeb44('0x2d'),_0xeb44('0x66')]);_0x6241be[_0xeb44('0x4a')]=_0xeb44('0x66');_0x9f5221=as['buildExpression'](_0xce5113,_0x331df2[_0xeb44('0x3a')],_0x6241be);_0x4e2249[_0x2969ff](_0x9f5221['text'],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x67')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x68')]);}break;case'Tag':var _0x5e00ae=_0x6241be[_0xeb44('0x5e')]['split'](',')[_0xeb44('0x37')](function(_0x4379c6){return Number(_0x4379c6);});_0x5e00ae[_0xeb44('0x33')](function(_0x540eab){_0xac23e9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x540eab+',%');});_0x4d4ea2=_['union'](_0x4d4ea2,_0x5e00ae);break;case _0xeb44('0x69'):if(_0x6241be[_0xeb44('0x63')]==='$substring'){_0x4e2249[_0x2969ff](_0xeb44('0x6a'),'%'+_0x6241be[_0xeb44('0x5e')]+'%',null);}else{_0x331df2=_[_0xeb44('0x5d')](_0x205486,[_0xeb44('0x2d'),_0xeb44('0x6b')]);_0x6241be[_0xeb44('0x4a')]=_0xeb44('0x6b');_0x9f5221=as[_0xeb44('0x6c')](_0xce5113,_0x331df2[_0xeb44('0x3a')],_0x6241be);_0x4e2249[_0x2969ff](_0x9f5221[_0xeb44('0x6d')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x67')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x68')]);}break;case _0xeb44('0x6e'):_0x9f5221=as['buildExpression']('me',null,_0x6241be);_0x4e2249[_0x2969ff](_0x9f5221[_0xeb44('0x6d')],_0x9f5221['value'][_0xeb44('0x67')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x68')]);break;}}else{var _0x9f5221=as[_0xeb44('0x6c')](_0xce5113,_0x331df2['type'],_0x6241be);_0x4e2249[_0x2969ff](_0x9f5221[_0xeb44('0x6d')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x67')],_0x9f5221[_0xeb44('0x5e')][_0xeb44('0x68')]);}}}else{var _0xaacb2c=_(_0x40ea68[_0xeb44('0x3c')])[_0xeb44('0x3d')]()[_0xeb44('0x37')](function(_0xef678b){return _['some'](_0x205486,['name',_0xef678b])?_0xef678b:undefined;})[_0xeb44('0x6f')]()[_0xeb44('0x5e')]();if(!_['isEmpty'](_0xaacb2c)){_0xaacb2c[_0xeb44('0x33')](function(_0x54fb9c){if(_0x54fb9c===_0xeb44('0x70')){_0x641eaa[_0xeb44('0x47')]('i.SmsAccountId\x20IN\x20?',[][_0xeb44('0x71')](_0x40ea68['query'][_0x54fb9c]));}else if(_0x54fb9c===_0xeb44('0x72')){var _0x98bed8=JSON['parse'](_0x40ea68['query'][_0x54fb9c])['$gte'];var _0x4333e5=JSON[_0xeb44('0x73')](_0x40ea68[_0xeb44('0x3c')][_0x54fb9c])[_0xeb44('0x74')];_0x641eaa[_0xeb44('0x47')](_0xeb44('0x75'),_0x98bed8,_0x4333e5);}else{if(_0x40ea68[_0xeb44('0x3c')][_0x54fb9c]===_0xeb44('0x76')){_0x641eaa[_0xeb44('0x47')]('i.'+_0x54fb9c+'\x20IS\x20NULL');}else{_0x641eaa[_0xeb44('0x47')]('i.'+_0x54fb9c+_0xeb44('0x77'),_0x40ea68['query'][_0x54fb9c]);}}});}if(_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x78')]){if(_0x40ea68[_0xeb44('0x3c')]['read']==0x1){_0x641eaa['having']('`unreadMessages`\x20=\x200');}else{_0x641eaa[_0xeb44('0x60')](_0xeb44('0x79'));}}if(_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x7a')]){_0x4d4ea2=_[_0xeb44('0x7b')](_0x40ea68[_0xeb44('0x3c')]['tag'])?_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x7a')]:new Array(_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x7a')]);_0x4d4ea2[_0xeb44('0x33')](function(_0x5747f8){_0xac23e9['or'](_0xeb44('0x7c'),'%,'+_0x5747f8+',%');});}if(_0x40ea68[_0xeb44('0x3c')]['filter']){var _0xde1f5a=_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x7d')][_0xeb44('0x7e')]('\x5c','\x5c\x5c')[_0xeb44('0x7e')](/'/g,'\x27\x27');if(qs[_0xeb44('0x7f')](_0xde1f5a)){_0x4e2249['or'](_0xeb44('0x80'),_0xde1f5a+'%')['or'](_0xeb44('0x81'),_0xde1f5a+'%');}else{_0x4e2249['or'](_0xeb44('0x82'),qs[_0xeb44('0x65')](_0xde1f5a))['or'](_0xeb44('0x83'),_0xde1f5a+'%');}}}_0x641eaa[_0xeb44('0x47')](_0x4e2249);_0x641eaa[_0xeb44('0x84')](_0xeb44('0x85'));var _0x578562={'type':db[_0xeb44('0x86')][_0xeb44('0x87')][_0xeb44('0x88')],'raw':!![]};var _0x1082b8=_0x641eaa[_0xeb44('0x89')]();_0x1082b8['field'](_0xeb44('0x85'));_0x1082b8[_0xeb44('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xeb44('0x8a'));if(_0x5a0266[_0xeb44('0x45')]){_0x5a0266[_0xeb44('0x45')][_0xeb44('0x33')](function(_0x4944f3){var _0x345c18=_0x4944f3[0x0]===_0xeb44('0x8b')?_0x4944f3[0x0]:'i.'+_0x4944f3[0x0];_0x641eaa[_0xeb44('0x45')](_0x345c18,_0x4944f3[0x1]===_0xeb44('0x8c')?![]:!![]);});}if(!_[_0xeb44('0x8d')](_0x4d4ea2)){_0x641eaa[_0xeb44('0x60')](_0xac23e9);_0x1082b8['where'](_0xeb44('0x8e'),_0x4d4ea2);}BPromise[_0xeb44('0x8f')]()[_0xeb44('0x2a')](function(){if(!_0x2bfd2e){if(_0x40ea68['query'][_0xeb44('0x70')])return;_0x1082b8[_0xeb44('0x47')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x641eaa[_0xeb44('0x47')](_0xeb44('0x90'));return;}if(_0x40ea68[_0xeb44('0x91')]['role']!==_0xeb44('0x92'))return;return _0x40ea68[_0xeb44('0x91')][_0xeb44('0x93')]({'attributes':['id'],'raw':!![]})[_0xeb44('0x2a')](function(_0x8bcc0b){if(_[_0xeb44('0x8d')](_0x8bcc0b)){_0x1082b8['where'](_0xeb44('0x94'));_0x641eaa[_0xeb44('0x47')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x1082b8[_0xeb44('0x47')]('i.SmsAccountId\x20IN\x20?',_[_0xeb44('0x37')](_0x8bcc0b,'id'));_0x641eaa[_0xeb44('0x47')](_0xeb44('0x95'),_[_0xeb44('0x37')](_0x8bcc0b,'id'));}});})['then'](function(){if(_0x40ea68['user'][_0xeb44('0x96')]===_0xeb44('0x92')&&!_0x2bfd2e&&!_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x70')])return[];return db[_0xeb44('0x97')]['query'](_0x1082b8[_0xeb44('0x98')](),_0x578562);})[_0xeb44('0x2a')](function(_0x507a96){_0x26d32c[_0xeb44('0x24')]=_0x507a96[_0xeb44('0x42')];if(_0x26d32c[_0xeb44('0x24')]===0x0)return[];return db[_0xeb44('0x97')]['query'](_0x42011f['toString'](),_0x578562)['then'](function(_0x2b7527){_0x1a7fb4=_['keyBy'](_0x2b7527,'id');_0x578562=_['merge'](_0x578562,{'model':db[_0xeb44('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x40ea68[_0xeb44('0x3c')][_0xeb44('0x41')]){_0x5a0266['attributes']['forEach'](function(_0x2696e9){_0x641eaa[_0xeb44('0x4a')]('i.'+_0x2696e9);});}else{_0x641eaa[_0xeb44('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xeb44('0x8a'));_0x641eaa[_0xeb44('0x4a')]('a.key',_0xeb44('0x99'));_0x641eaa[_0xeb44('0x4a')](_0xeb44('0x9a'),_0xeb44('0x9b'));_0x641eaa[_0xeb44('0x4a')](_0xeb44('0x9c'),_0xeb44('0x8b'));_0x641eaa[_0xeb44('0x4a')](_0xeb44('0x9d'));_0x641eaa[_0xeb44('0x4a')](_0xeb44('0x9e'),_0xeb44('0x9f'));_0x641eaa['field'](_0xeb44('0xa0'),'Contact.lastName');_0x641eaa[_0xeb44('0x4a')](_0xeb44('0xa1'),_0xeb44('0xa2'));_0x641eaa[_0xeb44('0x4a')]('c.phone',_0xeb44('0xa3'));_0x641eaa['field'](_0xeb44('0xa4'),_0xeb44('0xa5'));_0x641eaa[_0xeb44('0x4a')]('c.fax',_0xeb44('0xa6'));_0x641eaa[_0xeb44('0x4a')](_0xeb44('0xa7'),'Owner.fullname');_0x641eaa['field'](_0xeb44('0xa8'),_0xeb44('0xa9'));_0x641eaa[_0xeb44('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xeb44('0x30'));}if(_0x5a0266['limit'])_0x641eaa[_0xeb44('0x23')](_0x5a0266[_0xeb44('0x23')]);if(_0x5a0266[_0xeb44('0x25')])_0x641eaa['offset'](_0x5a0266[_0xeb44('0x25')]);return db[_0xeb44('0x97')][_0xeb44('0x3c')](_0x641eaa['toString'](),_0x578562);})[_0xeb44('0x2a')](function(_0x5322bb){if(_0x5322bb[_0xeb44('0x42')]>0x0)_0x6db9e7[_0xeb44('0x47')](_0xeb44('0xaa'),_[_0xeb44('0x37')](_0x5322bb,'id'));return db[_0xeb44('0x97')][_0xeb44('0x3c')](_0x6db9e7[_0xeb44('0x98')](),_0x578562)[_0xeb44('0x2a')](function(_0x262895){var _0x287b65=_[_0xeb44('0xab')](_0x262895,_0xeb44('0xac'));var _0x4622a=[];_0x5322bb[_0xeb44('0x33')](function(_0x106121){_0x4622a['push'](updateSmsInteraction(_0x106121,_0x1a7fb4,_0x287b65));});return BPromise[_0xeb44('0xad')](_0x4622a);});});})[_0xeb44('0x2a')](function(_0x5e5849){_0x26d32c['rows']=_0x5e5849;return _0x26d32c;})[_0xeb44('0x2a')](respondWithFilteredResult(_0x7f811f,_0x5a0266))['catch'](handleError(_0x7f811f,null));};exports[_0xeb44('0xae')]=function(_0x370114,_0x4835f1){var _0x566f7d={'raw':![],'where':{'id':_0x370114[_0xeb44('0xaf')]['id']}},_0x290d54={};_0x290d54[_0xeb44('0x3b')]=_[_0xeb44('0x3d')](db[_0xeb44('0x38')]['rawAttributes']);_0x290d54['query']=_[_0xeb44('0x3d')](_0x370114[_0xeb44('0x3c')]);_0x290d54[_0xeb44('0x3e')]=_['intersection'](_0x290d54[_0xeb44('0x3b')],_0x290d54['query']);_0x566f7d[_0xeb44('0x40')]=_['intersection'](_0x290d54[_0xeb44('0x3b')],qs[_0xeb44('0x41')](_0x370114[_0xeb44('0x3c')]['fields']));_0x566f7d['attributes']=_0x566f7d[_0xeb44('0x40')][_0xeb44('0x42')]?_0x566f7d[_0xeb44('0x40')]:_0x290d54[_0xeb44('0x3b')];if(_0x370114[_0xeb44('0x3c')][_0xeb44('0xb0')]){_0x566f7d[_0xeb44('0xb1')]=[{'all':!![]}];}_0x566f7d=_['merge']({},_0x566f7d,_0x370114['options']);return db['SmsInteraction'][_0xeb44('0x5d')](_0x566f7d)[_0xeb44('0x2a')](handleEntityNotFound(_0x4835f1,null))[_0xeb44('0x2a')](respondWithResult(_0x4835f1,null))[_0xeb44('0x35')](handleError(_0x4835f1,null));};exports['create']=function(_0x1d0929,_0x1e8936){return db[_0xeb44('0x38')][_0xeb44('0xb2')](_0x1d0929['body'],{})['then'](respondWithResult(_0x1e8936,0xc9))[_0xeb44('0x35')](handleError(_0x1e8936,null));};exports['update']=function(_0x2fdc79,_0x28f9b8){if(_0x2fdc79['body']['id']){delete _0x2fdc79[_0xeb44('0x6e')]['id'];}return db['SmsInteraction'][_0xeb44('0x5d')]({'where':{'id':_0x2fdc79['params']['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x28f9b8,null))[_0xeb44('0x2a')](saveUpdates(_0x2fdc79[_0xeb44('0x6e')],null))[_0xeb44('0x2a')](respondWithResult(_0x28f9b8,null))[_0xeb44('0x35')](handleError(_0x28f9b8,null));};exports['destroy']=function(_0x1ee86a,_0x481313){return db[_0xeb44('0x38')][_0xeb44('0x5d')]({'where':{'id':_0x1ee86a[_0xeb44('0xaf')]['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x481313,null))[_0xeb44('0x2a')](removeEntity(_0x481313,null))[_0xeb44('0x35')](handleError(_0x481313,null));};exports[_0xeb44('0xb3')]=function(_0x6262f5,_0x496ff9){return db[_0xeb44('0x38')][_0xeb44('0xb3')]()['then'](respondWithResult(_0x496ff9,null))[_0xeb44('0x35')](handleError(_0x496ff9,null));};exports[_0xeb44('0xb4')]=function(_0xa8d21d,_0x290beb,_0x26bd13){return db[_0xeb44('0xb5')]['find']({'where':{'id':_0xa8d21d['params']['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x290beb,null))[_0xeb44('0x2a')](function(_0x52a0e0){if(_0x52a0e0){return _0x52a0e0[_0xeb44('0xb4')](_0xa8d21d[_0xeb44('0x6e')][_0xeb44('0xb6')],_['omit'](_0xa8d21d['body'],[_0xeb44('0xb6'),'id'])||{});}})['then'](respondWithResult(_0x290beb,null))[_0xeb44('0x35')](handleError(_0x290beb,null));};exports[_0xeb44('0xb7')]=function(_0x5c894b,_0x37f9a0,_0x4d0bf2){var _0x464377={'raw':![],'where':{}};var _0x39268b={};var _0x327314={'count':0x0,'rows':[]};return db[_0xeb44('0x38')][_0xeb44('0xb8')]({'where':{'id':_0x5c894b['params']['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x37f9a0,null))[_0xeb44('0x2a')](function(_0x32c199){if(_0x32c199){_0x39268b[_0xeb44('0x3b')]=_['keys'](db['SmsMessage'][_0xeb44('0x39')]);_0x39268b[_0xeb44('0x3c')]=_['keys'](_0x5c894b[_0xeb44('0x3c')]);_0x39268b['filters']=_['intersection'](_0x39268b[_0xeb44('0x3b')],_0x39268b['query']);_0x464377[_0xeb44('0x40')]=_['intersection'](_0x39268b[_0xeb44('0x3b')],qs[_0xeb44('0x41')](_0x5c894b[_0xeb44('0x3c')]['fields']));_0x464377[_0xeb44('0x40')]=_0x464377[_0xeb44('0x40')]['length']?_0x464377[_0xeb44('0x40')]:_0x39268b['model'];if(!_0x5c894b['query']['hasOwnProperty']('nolimit')){_0x464377[_0xeb44('0x23')]=qs[_0xeb44('0x23')](_0x5c894b[_0xeb44('0x3c')]['limit']);_0x464377[_0xeb44('0x25')]=qs[_0xeb44('0x25')](_0x5c894b[_0xeb44('0x3c')]['offset']);}_0x464377[_0xeb44('0x45')]=qs[_0xeb44('0x46')](_0x5c894b[_0xeb44('0x3c')][_0xeb44('0x46')]);_0x464377['where']=qs[_0xeb44('0x3e')](_[_0xeb44('0x48')](_0x5c894b[_0xeb44('0x3c')],_0x39268b[_0xeb44('0x3e')]));_0x464377['where'][_0xeb44('0xac')]=_0x32c199['id'];if(_0x5c894b[_0xeb44('0x3c')][_0xeb44('0x7d')]){_0x464377[_0xeb44('0x47')]=_['merge'](_0x464377[_0xeb44('0x47')],{'$or':_[_0xeb44('0x37')](_0x464377[_0xeb44('0x40')],function(_0x5c0270){var _0x4867bb={};_0x4867bb[_0x5c0270]={'$like':'%'+_0x5c894b['query'][_0xeb44('0x7d')]+'%'};return _0x4867bb;})});}if(_0x5c894b[_0xeb44('0x3c')]['$gte']){var _0x5ae7d3=_0x5c894b[_0xeb44('0x3c')]['$gte'][_0xeb44('0x32')](',');var _0xa35267={};_0xa35267[_0x5ae7d3[0x0]]={'$gte':moment(_0x5ae7d3[0x1])['format'](_0xeb44('0xb9'))};_0x464377[_0xeb44('0x47')]=_[_0xeb44('0xba')](_0x464377[_0xeb44('0x47')],_0xa35267);}_0x464377=_[_0xeb44('0xba')]({},_0x464377,_0x5c894b[_0xeb44('0xbb')]);return db[_0xeb44('0xb5')][_0xeb44('0x24')]({'where':_0x464377['where']})[_0xeb44('0x2a')](function(_0x4c326c){_0x327314[_0xeb44('0x24')]=_0x4c326c;if(_0x5c894b[_0xeb44('0x3c')][_0xeb44('0xb0')]){_0x464377['include']=[{'all':!![]}];}return db['SmsMessage'][_0xeb44('0xbc')](_0x464377);})[_0xeb44('0x2a')](function(_0xf7a9eb){_0x327314[_0xeb44('0xbd')]=_0xf7a9eb;return _0x327314;});}})[_0xeb44('0x2a')](respondWithFilteredResult(_0x37f9a0,_0x464377))['catch'](handleError(_0x37f9a0,null));};exports[_0xeb44('0xbe')]=function(_0x9cb3af,_0x100d40,_0x181315){return db[_0xeb44('0x38')]['find']({'where':{'id':_0x9cb3af['params']['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x100d40,null))[_0xeb44('0x2a')](function(_0x205d54){if(_0x205d54){return _0x205d54[_0xeb44('0xbf')](_0x9cb3af['body'][_0xeb44('0xb6')],_[_0xeb44('0xc0')](_0x9cb3af['body'],['ids','id'])||{})[_0xeb44('0xc1')](function(){return db['Tag']['findAll']({'attributes':['id',_0xeb44('0x2d'),_0xeb44('0xc2')],'where':{'id':_0x9cb3af[_0xeb44('0x6e')][_0xeb44('0xb6')]}});})['then'](function(_0x54dc4c){socket[_0xeb44('0xc3')]('smsInteractionTags:save',{'id':Number(_0x9cb3af[_0xeb44('0xaf')]['id']),'tags':_0x54dc4c||[]});return{'id':Number(_0x9cb3af['params']['id']),'tags':_0x54dc4c||[]};});}})['then'](respondWithResult(_0x100d40,null))[_0xeb44('0x35')](handleError(_0x100d40,null));};exports['removeTags']=function(_0x59143c,_0x3362f2,_0x4b90cb){return db[_0xeb44('0x38')][_0xeb44('0x5d')]({'where':{'id':_0x59143c[_0xeb44('0xaf')]['id']}})[_0xeb44('0x2a')](handleEntityNotFound(_0x3362f2,null))[_0xeb44('0x2a')](function(_0x504b8c){if(_0x504b8c){return _0x504b8c[_0xeb44('0xc4')](_0x59143c[_0xeb44('0x3c')][_0xeb44('0xb6')]);}})[_0xeb44('0x2a')](respondWithStatusCode(_0x3362f2,null))[_0xeb44('0x35')](handleError(_0x3362f2,null));};exports[_0xeb44('0xc5')]=function(_0x7e5000,_0x378e8b){var _0x4d0063=moment()[_0xeb44('0xc6')]()[_0xeb44('0x98')]();var _0x169e90=path['join'](config[_0xeb44('0xc7')],_0xeb44('0xc8'),_0xeb44('0xc9'),_0xeb44('0xca'));var _0x3cadac=path['join'](config['root'],_0xeb44('0xc8'),'files','attachments');var _0x39e650=path[_0xeb44('0xcb')](_0x169e90,_0x4d0063);var _0x449508=util['format'](_0xeb44('0xcc'),_0x7e5000['params']['id'],_0x4d0063);var _0x255c1c=path[_0xeb44('0xcb')](_0x169e90,_0x449508);var _0x365821=[];_0x365821['push']({'model':db[_0xeb44('0x69')],'as':_0xeb44('0x69'),'attributes':['id','fullname'],'raw':!![]});_0x365821[_0xeb44('0x34')]({'model':db[_0xeb44('0xcd')],'as':'Contact','attributes':['id',_0xeb44('0xce'),'lastName'],'raw':!![]});var _0x5c2c06=[{'model':db['SmsMessage'],'as':_0xeb44('0xcf'),'attributes':['id',_0xeb44('0x6e'),_0xeb44('0x72'),'direction',_0xeb44('0xd0'),'read'],'include':_0x365821}];_0x5c2c06[_0xeb44('0x34')]({'model':db[_0xeb44('0xd1')],'as':_0xeb44('0xd2'),'attributes':['id',_0xeb44('0x2d')]});_0x5c2c06['push']({'model':db['User'],'as':_0xeb44('0xd3'),'attributes':['id',_0xeb44('0xd4')]});return db[_0xeb44('0x38')][_0xeb44('0x5d')]({'where':{'id':_0x7e5000[_0xeb44('0xaf')]['id']},'include':_0x5c2c06})['then'](handleEntityNotFound(_0x378e8b,null))[_0xeb44('0x2a')](function(_0x39d3ee){if(_0x39d3ee){var _0x180edf=_0x39d3ee[_0xeb44('0xd5')]({'plain':!![]});fs[_0xeb44('0xd6')](_0x39e650);var _0x36f15c={'channel':'Sms','account':_0x180edf[_0xeb44('0xd2')][_0xeb44('0x2d')],'agent':_0x180edf['Owner']?_0x180edf[_0xeb44('0xd3')][_0xeb44('0xd4')]:_0xeb44('0xd7'),'createdAt':moment(_0x180edf[_0xeb44('0x72')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xeb44('0x98')](),'closedAt':_0x180edf['closed']?moment(_0x180edf[_0xeb44('0xd8')])[_0xeb44('0xd9')](_0xeb44('0xb9'))[_0xeb44('0x98')]():'','disposition':_0x180edf['disposition'],'messages':_(_0x180edf[_0xeb44('0xcf')])[_0xeb44('0x7d')]({'secret':![]})['map'](function(_0x827a87){return{'date':moment(_0x827a87[_0xeb44('0x72')])[_0xeb44('0xd9')](_0xeb44('0xb9'))[_0xeb44('0x98')](),'sender':_0x827a87[_0xeb44('0xda')]===_0xeb44('0xdb')?_0x827a87[_0xeb44('0x69')]?_0x827a87[_0xeb44('0x69')]['fullname']:_0xeb44('0xdc'):_0x827a87[_0xeb44('0x62')][_0xeb44('0xce')]+(_0x827a87['Contact']['lastName']?'\x20'+_0x827a87[_0xeb44('0x62')][_0xeb44('0xdd')]:''),'body':_0x827a87[_0xeb44('0x6e')],'direction':_0x827a87[_0xeb44('0xda')]===_0xeb44('0xdb')?'A':'C','secret':_0x827a87[_0xeb44('0xd0')],'read':_0x827a87[_0xeb44('0x78')]};})['value']()};return ejs[_0xeb44('0xde')](path[_0xeb44('0xcb')](config[_0xeb44('0xc7')],_0xeb44('0xc8'),_0xeb44('0xdf'),'downloadInteraction.ejs'),{'interaction':_0x36f15c})[_0xeb44('0x2a')](function(_0xe6c461){var _0x4aa951=path[_0xeb44('0xcb')](_0x39e650,'transcript-'+_0x180edf['id']+'-'+_0x4d0063+_0xeb44('0xe0'));var _0xb22f04={'path':_0x4aa951,'channel':_0xeb44('0xe1'),'interactionId':_0x180edf['id']};return pdf['createPdfFromHTML'](_0xe6c461,_0xb22f04);})[_0xeb44('0x2a')](function(){return new BPromise(function(_0x3d44ae,_0x1913f0){zipdir(_0x39e650,{'saveTo':_0x255c1c},function(_0x1b7d03,_0x2ab2d7){if(_0x1b7d03)return _0x1913f0(_0x1b7d03);return _0x3d44ae(_0x2ab2d7);});})[_0xeb44('0x2a')](function(){return new BPromise(function(_0x4013cc,_0x47e41e){rimraf(_0x39e650,function(_0x129edf){if(_0x129edf)_0x47e41e(_0x129edf);return _0x4013cc();});});})['then'](function(){return _0x378e8b['download'](_0x255c1c,_0x449508,function(_0x5b11f2){if(_0x5b11f2){console[_0xeb44('0xe2')](_0xeb44('0xe3'),_0x5b11f2);}else{fs[_0xeb44('0xe4')](_0x255c1c);}});});});}else{return _0x378e8b[_0xeb44('0x1f')](0xc8);}})[_0xeb44('0x35')](handleError(_0x378e8b,null));}; \ No newline at end of file +var _0xd7a1=['t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','rawAttributes','includeAll','include','merge','options','create','body','destroy','params','describe','SmsMessage','addMessage','ids','getMessages','findOne','pick','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','createdAt','closed','out','secret','renderFile','transcript-','.pdf','Sms','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','start','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC'];(function(_0x4f86e3,_0x484bf5){var _0x57bfdc=function(_0x485513){while(--_0x485513){_0x4f86e3['push'](_0x4f86e3['shift']());}};_0x57bfdc(++_0x484bf5);}(_0xd7a1,0x136));var _0x1d7a=function(_0x4cd28b,_0x3f2098){_0x4cd28b=_0x4cd28b-0x0;var _0x3d0c78=_0xd7a1[_0x4cd28b];return _0x3d0c78;};'use strict';var emlformat=require(_0x1d7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d7a('0x1'));var jsonpatch=require(_0x1d7a('0x2'));var rp=require(_0x1d7a('0x3'));var moment=require(_0x1d7a('0x4'));var BPromise=require(_0x1d7a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d7a('0x6'));var sox=require('sox');var csv=require(_0x1d7a('0x7'));var ejs=require(_0x1d7a('0x8'));var fs=require('fs');var fs_extra=require(_0x1d7a('0x9'));var _=require(_0x1d7a('0xa'));var squel=require(_0x1d7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x1d7a('0xc'));var deskjs=require(_0x1d7a('0xd'));var toCsv=require(_0x1d7a('0x7'));var querystring=require(_0x1d7a('0xe'));var Papa=require(_0x1d7a('0xf'));var Redis=require(_0x1d7a('0x10'));var authService=require(_0x1d7a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1d7a('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7a('0x13'))(_0x1d7a('0x14'));var utils=require(_0x1d7a('0x15'));var config=require(_0x1d7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7a('0x17'))['db'];config[_0x1d7a('0x18')]=_['defaults'](config[_0x1d7a('0x18')],{'host':_0x1d7a('0x19'),'port':0x18eb});var socket=require(_0x1d7a('0x1a'))(new Redis(config[_0x1d7a('0x18')]));require(_0x1d7a('0x1b'))[_0x1d7a('0x1c')](socket);function respondWithStatusCode(_0x5cea56,_0x3b5e2b){_0x3b5e2b=_0x3b5e2b||0xcc;return function(_0x1adea1){if(_0x1adea1){return _0x5cea56[_0x1d7a('0x1d')](_0x3b5e2b);}return _0x5cea56[_0x1d7a('0x1e')](_0x3b5e2b)[_0x1d7a('0x1f')]();};}function respondWithResult(_0x57fd56,_0x5df161){_0x5df161=_0x5df161||0xc8;return function(_0x51c105){if(_0x51c105){return _0x57fd56[_0x1d7a('0x1e')](_0x5df161)[_0x1d7a('0x20')](_0x51c105);}};}function respondWithFilteredResult(_0x3df33c,_0x3f47a1){return function(_0x4ffd1f){if(_0x4ffd1f){var _0x46256d=typeof _0x3f47a1[_0x1d7a('0x21')]==='undefined'&&typeof _0x3f47a1[_0x1d7a('0x22')]===_0x1d7a('0x23');var _0x334ec2=_0x4ffd1f[_0x1d7a('0x24')];var _0x214030=_0x46256d?0x0:_0x3f47a1[_0x1d7a('0x21')];var _0x2ed937=_0x46256d?_0x4ffd1f['count']:_0x3f47a1[_0x1d7a('0x21')]+_0x3f47a1[_0x1d7a('0x22')];var _0x57d5da;if(_0x2ed937>=_0x334ec2){_0x2ed937=_0x334ec2;_0x57d5da=0xc8;}else{_0x57d5da=0xce;}_0x3df33c[_0x1d7a('0x1e')](_0x57d5da);return _0x3df33c['set']('Content-Range',_0x214030+'-'+_0x2ed937+'/'+_0x334ec2)[_0x1d7a('0x20')](_0x4ffd1f);}return null;};}function patchUpdates(_0xb353cf){return function(_0x3e9686){try{jsonpatch['apply'](_0x3e9686,_0xb353cf,!![]);}catch(_0x27babf){return BPromise[_0x1d7a('0x25')](_0x27babf);}return _0x3e9686[_0x1d7a('0x26')]();};}function saveUpdates(_0x56588f,_0xdf72bc){return function(_0x36f787){if(_0x36f787){return _0x36f787[_0x1d7a('0x27')](_0x56588f)[_0x1d7a('0x28')](function(_0x543ca9){return _0x543ca9;});}return null;};}function removeEntity(_0x398004,_0x28be78){return function(_0x4360cb){if(_0x4360cb){return _0x4360cb['destroy']()[_0x1d7a('0x28')](function(){_0x398004[_0x1d7a('0x1e')](0xcc)[_0x1d7a('0x1f')]();});}};}function handleEntityNotFound(_0x3d4642,_0x54e67d){return function(_0x392033){if(!_0x392033){_0x3d4642[_0x1d7a('0x1d')](0x194);}return _0x392033;};}function handleError(_0x5f3a81,_0x3d4fd0){_0x3d4fd0=_0x3d4fd0||0x1f4;return function(_0x3026e5){logger[_0x1d7a('0x29')](_0x3026e5['stack']);if(_0x3026e5[_0x1d7a('0x2a')]){delete _0x3026e5[_0x1d7a('0x2a')];}_0x5f3a81['status'](_0x3d4fd0)[_0x1d7a('0x2b')](_0x3026e5);};}function getInteractionUsers(_0x1e0907,_0x1af9b4){return new BPromise(function(_0x476c33,_0x3312a4){try{if(_0x1af9b4[_0x1e0907['id']]){_0x1e0907[_0x1d7a('0x2c')]=_[_0x1d7a('0x2d')](_0x1af9b4[_0x1e0907['id']],function(_0x56359f){return{'id':_0x56359f['id'],'fullname':_0x56359f[_0x1d7a('0x2e')]};});}}catch(_0x2cad0f){_0x3312a4(_0x2cad0f);}_0x476c33(_0x1e0907);});}function getInteractionTags(_0x52380c,_0x5d477b){return new BPromise(function(_0x25a70b,_0x28bff8){try{if(_0x52380c[_0x1d7a('0x2f')]){_0x52380c[_0x1d7a('0x30')]=[];_0x52380c[_0x1d7a('0x2f')][_0x1d7a('0x31')](',')[_0x1d7a('0x32')](function(_0x28ea70){_0x52380c[_0x1d7a('0x30')][_0x1d7a('0x33')](_0x5d477b[_0x28ea70]);});}delete _0x52380c[_0x1d7a('0x2f')];}catch(_0xe2b670){_0x28bff8(_0xe2b670);}_0x25a70b(_0x52380c);});}function updateSmsInteraction(_0x2e6b3c,_0x3f1daa,_0x24fa07){return new BPromise(function(_0x3d3b77,_0x9c1457){return getInteractionUsers(_0x2e6b3c,_0x24fa07)[_0x1d7a('0x28')](function(_0x23182d){return getInteractionTags(_0x23182d,_0x3f1daa);})[_0x1d7a('0x28')](function(_0x263db4){_0x3d3b77(_0x263db4);})[_0x1d7a('0x34')](function(_0x4f0e96){_0x9c1457(_0x4f0e96);});});}exports[_0x1d7a('0x35')]=function(_0x296322,_0x47eb73){var _0x2f727b={},_0x308c7a={},_0x1fa785={'count':0x0,'rows':[]};var _0x2f202f=_[_0x1d7a('0x2d')](db[_0x1d7a('0x36')]['rawAttributes'],function(_0x1ffc5e){return{'name':_0x1ffc5e['fieldName'],'type':_0x1ffc5e['type'][_0x1d7a('0x37')]};});_0x308c7a[_0x1d7a('0x38')]=_[_0x1d7a('0x2d')](_0x2f202f,_0x1d7a('0x2a'));_0x308c7a[_0x1d7a('0x39')]=_[_0x1d7a('0x3a')](_0x296322[_0x1d7a('0x39')]);_0x308c7a[_0x1d7a('0x3b')]=_[_0x1d7a('0x3c')](_0x308c7a[_0x1d7a('0x38')],_0x308c7a['query']);_0x2f727b[_0x1d7a('0x3d')]=_[_0x1d7a('0x3c')](_0x308c7a['model'],qs[_0x1d7a('0x3e')](_0x296322['query'][_0x1d7a('0x3e')]));_0x2f727b[_0x1d7a('0x3d')]=_0x2f727b['attributes'][_0x1d7a('0x3f')]?_0x2f727b[_0x1d7a('0x3d')]:_0x308c7a['model'];if(!_0x296322[_0x1d7a('0x39')][_0x1d7a('0x40')](_0x1d7a('0x41'))){_0x2f727b[_0x1d7a('0x22')]=qs[_0x1d7a('0x22')](_0x296322[_0x1d7a('0x39')][_0x1d7a('0x22')]);_0x2f727b[_0x1d7a('0x21')]=qs[_0x1d7a('0x21')](_0x296322[_0x1d7a('0x39')]['offset']);}_0x2f727b['order']=qs[_0x1d7a('0x42')](_0x296322[_0x1d7a('0x39')][_0x1d7a('0x42')]);_0x2f727b[_0x1d7a('0x43')]=qs[_0x1d7a('0x3b')](_['pick'](_0x296322[_0x1d7a('0x39')],_0x308c7a[_0x1d7a('0x3b')]),_0x2f202f);var _0x709bcd=[];var _0xb2d5f8=squel[_0x1d7a('0x44')]()['field']('id')[_0x1d7a('0x45')](_0x1d7a('0x2a'))['field'](_0x1d7a('0x46'))[_0x1d7a('0x47')]('tools_tags');var _0x41ae2b=squel[_0x1d7a('0x44')]()['field'](_0x1d7a('0x48'))[_0x1d7a('0x45')](_0x1d7a('0x49'))[_0x1d7a('0x45')](_0x1d7a('0x4a'))['from'](_0x1d7a('0x4b'),'ui')[_0x1d7a('0x4c')](_0x1d7a('0x4d'),'u',_0x1d7a('0x4e'));var _0xec705a=squel['select']()[_0x1d7a('0x47')]('sms_interactions','i')[_0x1d7a('0x4c')](_0x1d7a('0x4f'),'c',_0x1d7a('0x50'))[_0x1d7a('0x4c')](_0x1d7a('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x1d7a('0x4c')](_0x1d7a('0x51'),'a',_0x1d7a('0x52'))['left_join'](_0x1d7a('0x53'),'me',_0x1d7a('0x54'))[_0x1d7a('0x4c')](_0x1d7a('0x55'),'it',_0x1d7a('0x56'))['left_join'](_0x1d7a('0x57'),'t',_0x1d7a('0x58'));var _0x4ceeed=squel[_0x1d7a('0x59')]();var _0x4e1464=[];var _0xbd0357=squel[_0x1d7a('0x59')]();var _0x1506e1;if(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x5a')]){_0x1506e1=as['parseSearch'](_0x296322['query']['search']);var _0x33f2db=_0x1506e1[_0x1d7a('0x5b')];for(var _0x2d78f6=0x0;_0x2d78f6<_0x1506e1[_0x1d7a('0x5c')][_0x1d7a('0x3f')];_0x2d78f6++){var _0x18ded0=_0x1506e1[_0x1d7a('0x5c')][_0x2d78f6];var _0x277467='i';var _0x20f7bb=_[_0x1d7a('0x5d')](_0x2f202f,['name',_0x18ded0[_0x1d7a('0x45')]]);if(!_0x20f7bb){switch(_0x18ded0[_0x1d7a('0x45')]){case _0x1d7a('0x5e'):if(_0x18ded0[_0x1d7a('0x5f')]==0x1){_0xec705a['having']('`'+_0x18ded0[_0x1d7a('0x45')]+_0x1d7a('0x60'));}else{_0xec705a[_0x1d7a('0x61')]('`'+_0x18ded0[_0x1d7a('0x45')]+'`\x20>\x200');}break;case _0x1d7a('0x62'):if(_0x18ded0[_0x1d7a('0x63')]===_0x1d7a('0x64')){if(_0x18ded0[_0x1d7a('0x5f')][_0x1d7a('0x31')]('\x20')[_0x1d7a('0x3f')]>0x1){_0x4ceeed[_0x33f2db]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x18ded0[_0x1d7a('0x5f')]),null);}else{var _0x18e9d5='%'+_0x18ded0[_0x1d7a('0x5f')]+'%';_0x4ceeed[_0x33f2db](_0x1d7a('0x65'),_0x18e9d5,_0x18e9d5,_0x18e9d5);}}else{_0x20f7bb=_['find'](_0x2f202f,[_0x1d7a('0x2a'),_0x1d7a('0x66')]);_0x18ded0[_0x1d7a('0x45')]='ContactId';_0x2e527b=as[_0x1d7a('0x67')](_0x277467,_0x20f7bb[_0x1d7a('0x68')],_0x18ded0);_0x4ceeed[_0x33f2db](_0x2e527b[_0x1d7a('0x69')],_0x2e527b[_0x1d7a('0x5f')]['start'],_0x2e527b[_0x1d7a('0x5f')]['end']);}break;case _0x1d7a('0x6a'):var _0x127742=_0x18ded0[_0x1d7a('0x5f')]['split'](',')['map'](function(_0x1f9f02){return Number(_0x1f9f02);});_0x127742['forEach'](function(_0x9540ff){_0xbd0357['or'](_0x1d7a('0x6b'),'%,'+_0x9540ff+',%');});_0x4e1464=_[_0x1d7a('0x6c')](_0x4e1464,_0x127742);break;case _0x1d7a('0x6d'):if(_0x18ded0[_0x1d7a('0x63')]===_0x1d7a('0x64')){_0x4ceeed[_0x33f2db]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x18ded0[_0x1d7a('0x5f')]+'%',null);}else{_0x20f7bb=_[_0x1d7a('0x5d')](_0x2f202f,['name',_0x1d7a('0x6e')]);_0x18ded0[_0x1d7a('0x45')]=_0x1d7a('0x6e');_0x2e527b=as[_0x1d7a('0x67')](_0x277467,_0x20f7bb[_0x1d7a('0x68')],_0x18ded0);_0x4ceeed[_0x33f2db](_0x2e527b[_0x1d7a('0x69')],_0x2e527b['value'][_0x1d7a('0x6f')],_0x2e527b[_0x1d7a('0x5f')][_0x1d7a('0x1f')]);}break;case'body':_0x2e527b=as[_0x1d7a('0x67')]('me',null,_0x18ded0);_0x4ceeed[_0x33f2db](_0x2e527b['text'],_0x2e527b['value'][_0x1d7a('0x6f')],_0x2e527b[_0x1d7a('0x5f')][_0x1d7a('0x1f')]);break;}}else{var _0x2e527b=as[_0x1d7a('0x67')](_0x277467,_0x20f7bb[_0x1d7a('0x68')],_0x18ded0);_0x4ceeed[_0x33f2db](_0x2e527b[_0x1d7a('0x69')],_0x2e527b['value'][_0x1d7a('0x6f')],_0x2e527b[_0x1d7a('0x5f')]['end']);}}}else{var _0x2ec774=_(_0x296322[_0x1d7a('0x39')])['keys']()[_0x1d7a('0x2d')](function(_0x11a108){return _['some'](_0x2f202f,['name',_0x11a108])?_0x11a108:undefined;})[_0x1d7a('0x70')]()[_0x1d7a('0x5f')]();if(!_[_0x1d7a('0x71')](_0x2ec774)){_0x2ec774['forEach'](function(_0x4580e0){if(_0x4580e0===_0x1d7a('0x72')){_0xec705a[_0x1d7a('0x43')](_0x1d7a('0x73'),[]['concat'](_0x296322[_0x1d7a('0x39')][_0x4580e0]));}else if(_0x4580e0==='createdAt'){var _0x129daf=JSON[_0x1d7a('0x74')](_0x296322[_0x1d7a('0x39')][_0x4580e0])[_0x1d7a('0x75')];var _0x16e3fc=JSON[_0x1d7a('0x74')](_0x296322[_0x1d7a('0x39')][_0x4580e0])[_0x1d7a('0x76')];_0xec705a[_0x1d7a('0x43')](_0x1d7a('0x77'),_0x129daf,_0x16e3fc);}else{if(_0x296322[_0x1d7a('0x39')][_0x4580e0]==='null'){_0xec705a['where']('i.'+_0x4580e0+_0x1d7a('0x78'));}else{_0xec705a['where']('i.'+_0x4580e0+_0x1d7a('0x79'),_0x296322[_0x1d7a('0x39')][_0x4580e0]);}}});}if(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x7a')]){if(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x7a')]==0x1){_0xec705a['having']('`unreadMessages`\x20=\x200');}else{_0xec705a['having'](_0x1d7a('0x7b'));}}if(_0x296322[_0x1d7a('0x39')]['tag']){_0x4e1464=_['isArray'](_0x296322[_0x1d7a('0x39')][_0x1d7a('0x7c')])?_0x296322['query']['tag']:new Array(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x7c')]);_0x4e1464[_0x1d7a('0x32')](function(_0x52a922){_0xbd0357['or'](_0x1d7a('0x6b'),'%,'+_0x52a922+',%');});}if(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x7d')]){var _0x143046=_0x296322[_0x1d7a('0x39')]['filter'][_0x1d7a('0x7e')]('\x5c','\x5c\x5c')[_0x1d7a('0x7e')](/'/g,'\x27\x27');if(qs[_0x1d7a('0x7f')](_0x143046)){_0x4ceeed['or']('i.id\x20LIKE\x20?',_0x143046+'%')['or']('i.phone\x20LIKE\x20?',_0x143046+'%');}else{_0x4ceeed['or'](_0x1d7a('0x80'),qs['getFullTextValue'](_0x143046))['or'](_0x1d7a('0x81'),_0x143046+'%');}}}_0xec705a[_0x1d7a('0x43')](_0x4ceeed);_0xec705a[_0x1d7a('0x82')](_0x1d7a('0x83'));var _0x2c39eb={'type':db[_0x1d7a('0x84')][_0x1d7a('0x85')][_0x1d7a('0x86')],'raw':!![]};var _0x58d378=_0xec705a[_0x1d7a('0x87')]();_0x58d378['field'](_0x1d7a('0x83'));_0x58d378['field'](_0x1d7a('0x88'),_0x1d7a('0x5e'));if(_0x2f727b[_0x1d7a('0x89')]){_0x2f727b['order'][_0x1d7a('0x32')](function(_0x1e1319){var _0x54b022=_0x1e1319[0x0]===_0x1d7a('0x8a')?_0x1e1319[0x0]:'i.'+_0x1e1319[0x0];_0xec705a[_0x1d7a('0x89')](_0x54b022,_0x1e1319[0x1]===_0x1d7a('0x8b')?![]:!![]);});}if(!_[_0x1d7a('0x71')](_0x4e1464)){_0xec705a['having'](_0xbd0357);_0x58d378[_0x1d7a('0x43')](_0x1d7a('0x8c'),_0x4e1464);}BPromise[_0x1d7a('0x8d')]()[_0x1d7a('0x28')](function(){if(!_0x1506e1){if(_0x296322[_0x1d7a('0x39')][_0x1d7a('0x72')])return;_0x58d378[_0x1d7a('0x43')](_0x1d7a('0x8e'));_0xec705a[_0x1d7a('0x43')](_0x1d7a('0x8e'));return;}if(_0x296322[_0x1d7a('0x8f')][_0x1d7a('0x90')]!==_0x1d7a('0x91'))return;return _0x296322[_0x1d7a('0x8f')][_0x1d7a('0x92')]({'attributes':['id'],'raw':!![]})[_0x1d7a('0x28')](function(_0x538eaf){if(_[_0x1d7a('0x71')](_0x538eaf)){_0x58d378[_0x1d7a('0x43')](_0x1d7a('0x93'));_0xec705a[_0x1d7a('0x43')](_0x1d7a('0x93'));}else{_0x58d378[_0x1d7a('0x43')](_0x1d7a('0x73'),_['map'](_0x538eaf,'id'));_0xec705a[_0x1d7a('0x43')]('i.SmsAccountId\x20IN\x20?',_[_0x1d7a('0x2d')](_0x538eaf,'id'));}});})[_0x1d7a('0x28')](function(){if(_0x296322['user'][_0x1d7a('0x90')]===_0x1d7a('0x91')&&!_0x1506e1&&!_0x296322[_0x1d7a('0x39')][_0x1d7a('0x72')])return[];return db[_0x1d7a('0x94')]['query'](_0x58d378[_0x1d7a('0x95')](),_0x2c39eb);})[_0x1d7a('0x28')](function(_0x4fd665){_0x1fa785[_0x1d7a('0x24')]=_0x4fd665[_0x1d7a('0x3f')];if(_0x1fa785['count']===0x0)return[];return db[_0x1d7a('0x94')][_0x1d7a('0x39')](_0xb2d5f8[_0x1d7a('0x95')](),_0x2c39eb)[_0x1d7a('0x28')](function(_0x1ee7f4){_0x709bcd=_[_0x1d7a('0x96')](_0x1ee7f4,'id');_0x2c39eb=_['merge'](_0x2c39eb,{'model':db[_0x1d7a('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x296322['query']['fields']){_0x2f727b[_0x1d7a('0x3d')]['forEach'](function(_0x1b28b9){_0xec705a[_0x1d7a('0x45')]('i.'+_0x1b28b9);});}else{_0xec705a[_0x1d7a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xec705a[_0x1d7a('0x45')](_0x1d7a('0x97'),_0x1d7a('0x98'));_0xec705a[_0x1d7a('0x45')](_0x1d7a('0x99'),_0x1d7a('0x9a'));_0xec705a[_0x1d7a('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0xec705a[_0x1d7a('0x45')]('i.*');_0xec705a[_0x1d7a('0x45')]('c.firstName','Contact.firstName');_0xec705a[_0x1d7a('0x45')](_0x1d7a('0x9b'),'Contact.lastName');_0xec705a[_0x1d7a('0x45')]('c.email',_0x1d7a('0x9c'));_0xec705a[_0x1d7a('0x45')](_0x1d7a('0x9d'),_0x1d7a('0x9e'));_0xec705a[_0x1d7a('0x45')]('c.mobile',_0x1d7a('0x9f'));_0xec705a[_0x1d7a('0x45')](_0x1d7a('0xa0'),_0x1d7a('0xa1'));_0xec705a['field'](_0x1d7a('0xa2'),'Owner.fullname');_0xec705a[_0x1d7a('0x45')](_0x1d7a('0xa3'),_0x1d7a('0xa4'));_0xec705a['field'](_0x1d7a('0xa5'),_0x1d7a('0x2f'));}if(_0x2f727b[_0x1d7a('0x22')])_0xec705a['limit'](_0x2f727b[_0x1d7a('0x22')]);if(_0x2f727b['offset'])_0xec705a[_0x1d7a('0x21')](_0x2f727b[_0x1d7a('0x21')]);return db[_0x1d7a('0x94')]['query'](_0xec705a['toString'](),_0x2c39eb);})[_0x1d7a('0x28')](function(_0xaf8d0){if(_0xaf8d0[_0x1d7a('0x3f')]>0x0)_0x41ae2b['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0xaf8d0,'id'));return db[_0x1d7a('0x94')][_0x1d7a('0x39')](_0x41ae2b[_0x1d7a('0x95')](),_0x2c39eb)[_0x1d7a('0x28')](function(_0x2bed3a){var _0x555d75=_[_0x1d7a('0xa6')](_0x2bed3a,'SmsInteractionId');var _0x2b5c40=[];_0xaf8d0[_0x1d7a('0x32')](function(_0x24bac1){_0x2b5c40[_0x1d7a('0x33')](updateSmsInteraction(_0x24bac1,_0x709bcd,_0x555d75));});return BPromise[_0x1d7a('0xa7')](_0x2b5c40);});});})['then'](function(_0x24a356){_0x1fa785[_0x1d7a('0xa8')]=_0x24a356;return _0x1fa785;})['then'](respondWithFilteredResult(_0x47eb73,_0x2f727b))[_0x1d7a('0x34')](handleError(_0x47eb73,null));};exports[_0x1d7a('0xa9')]=function(_0x4dd342,_0x28d5b9){var _0x2ebe77={'raw':![],'where':{'id':_0x4dd342['params']['id']}},_0x200c5a={};_0x200c5a['model']=_[_0x1d7a('0x3a')](db[_0x1d7a('0x36')][_0x1d7a('0xaa')]);_0x200c5a[_0x1d7a('0x39')]=_['keys'](_0x4dd342[_0x1d7a('0x39')]);_0x200c5a[_0x1d7a('0x3b')]=_[_0x1d7a('0x3c')](_0x200c5a[_0x1d7a('0x38')],_0x200c5a[_0x1d7a('0x39')]);_0x2ebe77[_0x1d7a('0x3d')]=_[_0x1d7a('0x3c')](_0x200c5a[_0x1d7a('0x38')],qs[_0x1d7a('0x3e')](_0x4dd342['query'][_0x1d7a('0x3e')]));_0x2ebe77[_0x1d7a('0x3d')]=_0x2ebe77[_0x1d7a('0x3d')][_0x1d7a('0x3f')]?_0x2ebe77[_0x1d7a('0x3d')]:_0x200c5a[_0x1d7a('0x38')];if(_0x4dd342['query'][_0x1d7a('0xab')]){_0x2ebe77[_0x1d7a('0xac')]=[{'all':!![]}];}_0x2ebe77=_[_0x1d7a('0xad')]({},_0x2ebe77,_0x4dd342[_0x1d7a('0xae')]);return db[_0x1d7a('0x36')][_0x1d7a('0x5d')](_0x2ebe77)[_0x1d7a('0x28')](handleEntityNotFound(_0x28d5b9,null))['then'](respondWithResult(_0x28d5b9,null))[_0x1d7a('0x34')](handleError(_0x28d5b9,null));};exports[_0x1d7a('0xaf')]=function(_0x2661c8,_0x4f5128){return db[_0x1d7a('0x36')]['create'](_0x2661c8[_0x1d7a('0xb0')],{})[_0x1d7a('0x28')](respondWithResult(_0x4f5128,0xc9))[_0x1d7a('0x34')](handleError(_0x4f5128,null));};exports[_0x1d7a('0x27')]=function(_0x3786b1,_0x944187){if(_0x3786b1['body']['id']){delete _0x3786b1[_0x1d7a('0xb0')]['id'];}return db['SmsInteraction'][_0x1d7a('0x5d')]({'where':{'id':_0x3786b1['params']['id']}})[_0x1d7a('0x28')](handleEntityNotFound(_0x944187,null))[_0x1d7a('0x28')](saveUpdates(_0x3786b1[_0x1d7a('0xb0')],null))[_0x1d7a('0x28')](respondWithResult(_0x944187,null))[_0x1d7a('0x34')](handleError(_0x944187,null));};exports[_0x1d7a('0xb1')]=function(_0x1a7d49,_0x4dba94){return db[_0x1d7a('0x36')][_0x1d7a('0x5d')]({'where':{'id':_0x1a7d49[_0x1d7a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4dba94,null))[_0x1d7a('0x28')](removeEntity(_0x4dba94,null))['catch'](handleError(_0x4dba94,null));};exports[_0x1d7a('0xb3')]=function(_0x21d25c,_0x4f8e6c){return db[_0x1d7a('0x36')][_0x1d7a('0xb3')]()['then'](respondWithResult(_0x4f8e6c,null))[_0x1d7a('0x34')](handleError(_0x4f8e6c,null));};exports['addMessage']=function(_0x5890f0,_0xe1e593,_0x1e61ad){return db[_0x1d7a('0xb4')]['find']({'where':{'id':_0x5890f0[_0x1d7a('0xb2')]['id']}})[_0x1d7a('0x28')](handleEntityNotFound(_0xe1e593,null))[_0x1d7a('0x28')](function(_0xe3de43){if(_0xe3de43){return _0xe3de43[_0x1d7a('0xb5')](_0x5890f0[_0x1d7a('0xb0')][_0x1d7a('0xb6')],_['omit'](_0x5890f0[_0x1d7a('0xb0')],[_0x1d7a('0xb6'),'id'])||{});}})[_0x1d7a('0x28')](respondWithResult(_0xe1e593,null))[_0x1d7a('0x34')](handleError(_0xe1e593,null));};exports[_0x1d7a('0xb7')]=function(_0x2a4ba4,_0x494232,_0x4b3a4c){var _0x788e70={'raw':![],'where':{}};var _0x4fd5d9={};var _0x118bb4={'count':0x0,'rows':[]};return db[_0x1d7a('0x36')][_0x1d7a('0xb8')]({'where':{'id':_0x2a4ba4[_0x1d7a('0xb2')]['id']}})[_0x1d7a('0x28')](handleEntityNotFound(_0x494232,null))[_0x1d7a('0x28')](function(_0x529b9e){if(_0x529b9e){_0x4fd5d9[_0x1d7a('0x38')]=_[_0x1d7a('0x3a')](db[_0x1d7a('0xb4')][_0x1d7a('0xaa')]);_0x4fd5d9[_0x1d7a('0x39')]=_[_0x1d7a('0x3a')](_0x2a4ba4[_0x1d7a('0x39')]);_0x4fd5d9[_0x1d7a('0x3b')]=_['intersection'](_0x4fd5d9[_0x1d7a('0x38')],_0x4fd5d9[_0x1d7a('0x39')]);_0x788e70[_0x1d7a('0x3d')]=_[_0x1d7a('0x3c')](_0x4fd5d9[_0x1d7a('0x38')],qs['fields'](_0x2a4ba4[_0x1d7a('0x39')]['fields']));_0x788e70[_0x1d7a('0x3d')]=_0x788e70[_0x1d7a('0x3d')]['length']?_0x788e70[_0x1d7a('0x3d')]:_0x4fd5d9[_0x1d7a('0x38')];if(!_0x2a4ba4['query']['hasOwnProperty'](_0x1d7a('0x41'))){_0x788e70['limit']=qs[_0x1d7a('0x22')](_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0x22')]);_0x788e70[_0x1d7a('0x21')]=qs[_0x1d7a('0x21')](_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0x21')]);}_0x788e70[_0x1d7a('0x89')]=qs[_0x1d7a('0x42')](_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0x42')]);_0x788e70['where']=qs[_0x1d7a('0x3b')](_[_0x1d7a('0xb9')](_0x2a4ba4[_0x1d7a('0x39')],_0x4fd5d9[_0x1d7a('0x3b')]));_0x788e70['where'][_0x1d7a('0xba')]=_0x529b9e['id'];if(_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0x7d')]){_0x788e70[_0x1d7a('0x43')]=_[_0x1d7a('0xad')](_0x788e70['where'],{'$or':_[_0x1d7a('0x2d')](_0x788e70['attributes'],function(_0x7f335a){var _0x139e0e={};_0x139e0e[_0x7f335a]={'$like':'%'+_0x2a4ba4['query'][_0x1d7a('0x7d')]+'%'};return _0x139e0e;})});}if(_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0x75')]){var _0x2e7497=_0x2a4ba4['query'][_0x1d7a('0x75')][_0x1d7a('0x31')](',');var _0x227971={};_0x227971[_0x2e7497[0x0]]={'$gte':moment(_0x2e7497[0x1])[_0x1d7a('0xbb')](_0x1d7a('0xbc'))};_0x788e70[_0x1d7a('0x43')]=_[_0x1d7a('0xad')](_0x788e70[_0x1d7a('0x43')],_0x227971);}_0x788e70=_[_0x1d7a('0xad')]({},_0x788e70,_0x2a4ba4[_0x1d7a('0xae')]);return db[_0x1d7a('0xb4')][_0x1d7a('0x24')]({'where':_0x788e70[_0x1d7a('0x43')]})['then'](function(_0x4c08ec){_0x118bb4[_0x1d7a('0x24')]=_0x4c08ec;if(_0x2a4ba4[_0x1d7a('0x39')][_0x1d7a('0xab')]){_0x788e70[_0x1d7a('0xac')]=[{'all':!![]}];}return db[_0x1d7a('0xb4')][_0x1d7a('0xbd')](_0x788e70);})['then'](function(_0x24b6dc){_0x118bb4['rows']=_0x24b6dc;return _0x118bb4;});}})['then'](respondWithFilteredResult(_0x494232,_0x788e70))[_0x1d7a('0x34')](handleError(_0x494232,null));};exports[_0x1d7a('0xbe')]=function(_0xcada8f,_0x35dbb1,_0x15d431){return db[_0x1d7a('0x36')][_0x1d7a('0x5d')]({'where':{'id':_0xcada8f['params']['id']}})[_0x1d7a('0x28')](handleEntityNotFound(_0x35dbb1,null))[_0x1d7a('0x28')](function(_0x1ca994){if(_0x1ca994){return _0x1ca994[_0x1d7a('0xbf')](_0xcada8f[_0x1d7a('0xb0')][_0x1d7a('0xb6')],_[_0x1d7a('0xc0')](_0xcada8f[_0x1d7a('0xb0')],[_0x1d7a('0xb6'),'id'])||{})[_0x1d7a('0xc1')](function(){return db['Tag'][_0x1d7a('0xbd')]({'attributes':['id',_0x1d7a('0x2a'),'color'],'where':{'id':_0xcada8f[_0x1d7a('0xb0')][_0x1d7a('0xb6')]}});})[_0x1d7a('0x28')](function(_0x32e52a){socket['emit'](_0x1d7a('0xc2'),{'id':Number(_0xcada8f[_0x1d7a('0xb2')]['id']),'tags':_0x32e52a||[]});return{'id':Number(_0xcada8f[_0x1d7a('0xb2')]['id']),'tags':_0x32e52a||[]};});}})[_0x1d7a('0x28')](respondWithResult(_0x35dbb1,null))[_0x1d7a('0x34')](handleError(_0x35dbb1,null));};exports[_0x1d7a('0xc3')]=function(_0x1f51e2,_0xe2a186,_0x4c1292){return db[_0x1d7a('0x36')][_0x1d7a('0x5d')]({'where':{'id':_0x1f51e2[_0x1d7a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xe2a186,null))[_0x1d7a('0x28')](function(_0x34b99f){if(_0x34b99f){return _0x34b99f[_0x1d7a('0xc3')](_0x1f51e2[_0x1d7a('0x39')]['ids']);}})[_0x1d7a('0x28')](respondWithStatusCode(_0xe2a186,null))['catch'](handleError(_0xe2a186,null));};exports[_0x1d7a('0xc4')]=function(_0x2ed61d,_0x17dbdc){var _0x12bc5e=moment()[_0x1d7a('0xc5')]()[_0x1d7a('0x95')]();var _0x508796=path[_0x1d7a('0xc6')](config[_0x1d7a('0xc7')],_0x1d7a('0xc8'),_0x1d7a('0xc9'),_0x1d7a('0xca'));var _0x5d650a=path[_0x1d7a('0xc6')](config[_0x1d7a('0xc7')],_0x1d7a('0xc8'),'files',_0x1d7a('0xcb'));var _0xff0cbe=path[_0x1d7a('0xc6')](_0x508796,_0x12bc5e);var _0x46818c=util['format'](_0x1d7a('0xcc'),_0x2ed61d['params']['id'],_0x12bc5e);var _0x839875=path['join'](_0x508796,_0x46818c);var _0xd28596=[];_0xd28596[_0x1d7a('0x33')]({'model':db[_0x1d7a('0x6d')],'as':'User','attributes':['id',_0x1d7a('0x2e')],'raw':!![]});_0xd28596['push']({'model':db[_0x1d7a('0xcd')],'as':_0x1d7a('0x62'),'attributes':['id','firstName',_0x1d7a('0xce')],'raw':!![]});var _0x201592=[{'model':db[_0x1d7a('0xb4')],'as':_0x1d7a('0xcf'),'attributes':['id',_0x1d7a('0xb0'),'createdAt',_0x1d7a('0xd0'),'secret',_0x1d7a('0x7a')],'include':_0xd28596}];_0x201592[_0x1d7a('0x33')]({'model':db[_0x1d7a('0xd1')],'as':_0x1d7a('0xd2'),'attributes':['id','name']});_0x201592[_0x1d7a('0x33')]({'model':db[_0x1d7a('0x6d')],'as':_0x1d7a('0xd3'),'attributes':['id','fullname']});return db[_0x1d7a('0x36')]['find']({'where':{'id':_0x2ed61d[_0x1d7a('0xb2')]['id']},'include':_0x201592})[_0x1d7a('0x28')](handleEntityNotFound(_0x17dbdc,null))[_0x1d7a('0x28')](function(_0x524dec){if(_0x524dec){var _0x3d6eca=_0x524dec[_0x1d7a('0xd4')]({'plain':!![]});fs[_0x1d7a('0xd5')](_0xff0cbe);var _0x126705={'channel':'Sms','account':_0x3d6eca[_0x1d7a('0xd2')][_0x1d7a('0x2a')],'agent':_0x3d6eca[_0x1d7a('0xd3')]?_0x3d6eca[_0x1d7a('0xd3')][_0x1d7a('0x2e')]:'N.A.','createdAt':moment(_0x3d6eca[_0x1d7a('0xd6')])[_0x1d7a('0xbb')](_0x1d7a('0xbc'))[_0x1d7a('0x95')](),'closedAt':_0x3d6eca[_0x1d7a('0xd7')]?moment(_0x3d6eca['closedAt'])[_0x1d7a('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3d6eca['disposition'],'messages':_(_0x3d6eca[_0x1d7a('0xcf')])['filter']({'secret':![]})['map'](function(_0x2eb9c8){return{'date':moment(_0x2eb9c8[_0x1d7a('0xd6')])[_0x1d7a('0xbb')](_0x1d7a('0xbc'))['toString'](),'sender':_0x2eb9c8[_0x1d7a('0xd0')]===_0x1d7a('0xd8')?_0x2eb9c8[_0x1d7a('0x6d')]?_0x2eb9c8['User']['fullname']:'System':_0x2eb9c8['Contact']['firstName']+(_0x2eb9c8[_0x1d7a('0x62')][_0x1d7a('0xce')]?'\x20'+_0x2eb9c8[_0x1d7a('0x62')][_0x1d7a('0xce')]:''),'body':_0x2eb9c8['body'],'direction':_0x2eb9c8['direction']===_0x1d7a('0xd8')?'A':'C','secret':_0x2eb9c8[_0x1d7a('0xd9')],'read':_0x2eb9c8[_0x1d7a('0x7a')]};})[_0x1d7a('0x5f')]()};return ejs[_0x1d7a('0xda')](path[_0x1d7a('0xc6')](config[_0x1d7a('0xc7')],_0x1d7a('0xc8'),'views','downloadInteraction.ejs'),{'interaction':_0x126705})['then'](function(_0x511e17){var _0x500a36=path[_0x1d7a('0xc6')](_0xff0cbe,_0x1d7a('0xdb')+_0x3d6eca['id']+'-'+_0x12bc5e+_0x1d7a('0xdc'));var _0x5f42e6={'path':_0x500a36,'channel':_0x1d7a('0xdd'),'interactionId':_0x3d6eca['id']};return pdf[_0x1d7a('0xde')](_0x511e17,_0x5f42e6);})[_0x1d7a('0x28')](function(){return new BPromise(function(_0x474580,_0x55e2e0){zipdir(_0xff0cbe,{'saveTo':_0x839875},function(_0x62b1b2,_0x250865){if(_0x62b1b2)return _0x55e2e0(_0x62b1b2);return _0x474580(_0x250865);});})['then'](function(){return new BPromise(function(_0xcddb98,_0x52d9ab){rimraf(_0xff0cbe,function(_0xb2ee0e){if(_0xb2ee0e)_0x52d9ab(_0xb2ee0e);return _0xcddb98();});});})['then'](function(){return _0x17dbdc[_0x1d7a('0xc4')](_0x839875,_0x46818c,function(_0x186ce0){if(_0x186ce0){console[_0x1d7a('0xdf')](_0x1d7a('0xe0'),_0x186ce0);}else{fs['unlinkSync'](_0x839875);}});});});}else{return _0x17dbdc['sendStatus'](0xc8);}})['catch'](handleError(_0x17dbdc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 958dea9..06fa88b 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 _0x4b17=['SmsInteraction','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x3bcce9,_0x273ac3){var _0x226898=function(_0x5e50f1){while(--_0x5e50f1){_0x3bcce9['push'](_0x3bcce9['shift']());}};_0x226898(++_0x273ac3);}(_0x4b17,0x10f));var _0x74b1=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x4b17[_0x5dbb84];return _0x1d6eae;};'use strict';var EventEmitter=require(_0x74b1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x74b1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x74b1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x74b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74b1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fdea2){return function(_0x7b3c36,_0x30d910,_0x379dcc){_0x7b3c36[_0x74b1('0x5')]({'attributes':['id'],'raw':!![]})[_0x74b1('0x6')](function(_0x191d2b){_0x7b3c36[_0x74b1('0x7')]('Users',_0x191d2b[_0x74b1('0x8')](function(_0x98bb33){return{'id':_0x98bb33['id']};}));return SmsMessage[_0x74b1('0x9')]({'where':{'SmsInteractionId':_0x7b3c36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74b1('0x6')](function(_0xc1952){_0x7b3c36['setDataValue'](_0x74b1('0xa'),_0xc1952[_0x74b1('0xb')]);SmsInteractionEvents['emit'](_0x4fdea2+':'+_0x7b3c36['id'],_0x7b3c36);SmsInteractionEvents[_0x74b1('0xc')](_0x4fdea2,_0x7b3c36);_0x379dcc(null);})[_0x74b1('0xd')](_0x379dcc(null));};}for(var e in events){if(events[_0x74b1('0xe')](e)){var event=events[e];SmsInteraction[_0x74b1('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xbbbc=['map','findAll','length','emit','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','then','setDataValue','Users'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5f7da0,_0x2d82e0){_0x5f7da0=_0x5f7da0-0x0;var _0x504ff9=_0xbbbc[_0x5f7da0];return _0x504ff9;};'use strict';var EventEmitter=require(_0xcbbb('0x0'));var SmsInteraction=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x2')];var SmsMessage=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xcbbb('0x4')](0x0);var events={'afterCreate':_0xcbbb('0x5'),'afterUpdate':'update','afterDestroy':_0xcbbb('0x6')};function emitEvent(_0x938376){return function(_0x45da04,_0x3ccbf6,_0x43ff05){_0x45da04['getUsers']({'attributes':['id'],'raw':!![]})[_0xcbbb('0x7')](function(_0x1796b4){_0x45da04[_0xcbbb('0x8')](_0xcbbb('0x9'),_0x1796b4[_0xcbbb('0xa')](function(_0x150355){return{'id':_0x150355['id']};}));return SmsMessage[_0xcbbb('0xb')]({'where':{'SmsInteractionId':_0x45da04['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x225156){_0x45da04['setDataValue']('unreadMessages',_0x225156[_0xcbbb('0xc')]);SmsInteractionEvents['emit'](_0x938376+':'+_0x45da04['id'],_0x45da04);SmsInteractionEvents[_0xcbbb('0xd')](_0x938376,_0x45da04);_0x43ff05(null);})['catch'](_0x43ff05(null));};}for(var e in events){if(events[_0xcbbb('0xe')](e)){var event=events[e];SmsInteraction[_0xcbbb('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fcf9131..491c678 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 _0x0107=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x0107,0x1bc));var _0x7010=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x0107[_0x43e4b3];return _0x10c655;};'use strict';var _=require(_0x7010('0x0'));var util=require(_0x7010('0x1'));var logger=require(_0x7010('0x2'))(_0x7010('0x3'));var moment=require(_0x7010('0x4'));var BPromise=require(_0x7010('0x5'));var rp=require(_0x7010('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7010('0x7'));var config=require(_0x7010('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x7010('0x9')]=function(_0x598791,_0x4ab1b0){return _0x598791[_0x7010('0xa')](_0x7010('0xb'),attributes,{'tableName':_0x7010('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x287c25,_0xe51a16,_0x5e7e38){if(_0x287c25['changed'](_0x7010('0xd'))){_0x287c25['closedAt']=moment()[_0x7010('0xe')](_0x7010('0xf'));}_0x5e7e38(null,_0x287c25);}}});}; \ No newline at end of file +var _0x24dc=['path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','util','api','bluebird','request-promise'];(function(_0x5565bf,_0x262624){var _0x23b593=function(_0x27c9c6){while(--_0x27c9c6){_0x5565bf['push'](_0x5565bf['shift']());}};_0x23b593(++_0x262624);}(_0x24dc,0xd9));var _0xc24d=function(_0x336145,_0x7b41f3){_0x336145=_0x336145-0x0;var _0x8af6f0=_0x24dc[_0x336145];return _0x8af6f0;};'use strict';var _=require('lodash');var util=require(_0xc24d('0x0'));var logger=require('../../config/logger')(_0xc24d('0x1'));var moment=require('moment');var BPromise=require(_0xc24d('0x2'));var rp=require(_0xc24d('0x3'));var fs=require('fs');var path=require(_0xc24d('0x4'));var rimraf=require(_0xc24d('0x5'));var config=require('../../config/environment');var attributes=require(_0xc24d('0x6'));module[_0xc24d('0x7')]=function(_0x560ea0,_0x32c05f){return _0x560ea0[_0xc24d('0x8')](_0xc24d('0x9'),attributes,{'tableName':_0xc24d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41dc8a,_0x850c94,_0x31e282){if(_0x41dc8a[_0xc24d('0xb')]('closed')){_0x41dc8a[_0xc24d('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x31e282(null,_0x41dc8a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 8eb9d05..b4915c3 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 _0x75bc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsInteraction.socket','info','debug','request\x20sent','stringify','error','code','message','result','SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','where','attributes','limit','then','catch','AddTagsToSmsInteraction','find','omit','AddTags'];(function(_0x3b59da,_0x221ba1){var _0x178898=function(_0x594df2){while(--_0x594df2){_0x3b59da['push'](_0x3b59da['shift']());}};_0x178898(++_0x221ba1);}(_0x75bc,0x140));var _0xc75b=function(_0x22d564,_0x3e3ee9){_0x22d564=_0x22d564-0x0;var _0x5558fa=_0x75bc[_0x22d564];return _0x5558fa;};'use strict';var _=require('lodash');var util=require(_0xc75b('0x0'));var moment=require(_0xc75b('0x1'));var BPromise=require(_0xc75b('0x2'));var rs=require(_0xc75b('0x3'));var fs=require('fs');var Redis=require(_0xc75b('0x4'));var db=require(_0xc75b('0x5'))['db'];var utils=require(_0xc75b('0x6'));var logger=require(_0xc75b('0x7'))(_0xc75b('0x8'));var config=require(_0xc75b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc75b('0xa')][_0xc75b('0xb')]({'port':0x232a});config[_0xc75b('0xc')]=_[_0xc75b('0xd')](config[_0xc75b('0xc')],{'host':_0xc75b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc75b('0xc')]));require(_0xc75b('0xf'))['register'](socket);function respondWithRpcPromise(_0x30f833,_0x227678,_0x23b552){return new BPromise(function(_0x1e954b,_0x3c43f0){return client['request'](_0x30f833,_0x23b552)['then'](function(_0x3b8354){logger[_0xc75b('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x227678,'request\x20sent');logger[_0xc75b('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x227678,_0xc75b('0x12'),JSON[_0xc75b('0x13')](_0x3b8354));if(_0x3b8354[_0xc75b('0x14')]){if(_0x3b8354[_0xc75b('0x14')][_0xc75b('0x15')]===0x1f4){logger[_0xc75b('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x227678,_0x3b8354[_0xc75b('0x14')][_0xc75b('0x16')]);return _0x3c43f0(_0x3b8354[_0xc75b('0x14')][_0xc75b('0x16')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x227678,_0x3b8354[_0xc75b('0x14')]['message']);return _0x1e954b(_0x3b8354['error'][_0xc75b('0x16')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x227678,'request\x20sent');_0x1e954b(_0x3b8354[_0xc75b('0x17')][_0xc75b('0x16')]);}})['catch'](function(_0x53129d){logger[_0xc75b('0x14')](_0xc75b('0x18'),_0x227678,_0x53129d);_0x3c43f0(_0x53129d);});});}exports[_0xc75b('0x19')]=function(_0x5c4391){var _0x222cf1=this;return new Promise(function(_0x5fef3,_0x55e7ef){return db[_0xc75b('0x1a')][_0xc75b('0x1b')](_0x5c4391[_0xc75b('0x1c')],{'raw':_0x5c4391['options']?_0x5c4391['options'][_0xc75b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c4391['options']?_0x5c4391[_0xc75b('0x1e')][_0xc75b('0x1f')]||null:null,'attributes':_0x5c4391['options']?_0x5c4391['options'][_0xc75b('0x20')]||null:null,'limit':_0x5c4391['options']?_0x5c4391['options'][_0xc75b('0x21')]||null:null})[_0xc75b('0x22')](function(_0x316516){logger[_0xc75b('0x10')](_0xc75b('0x19'),_0x5c4391);logger[_0xc75b('0x11')](_0xc75b('0x19'),_0x5c4391,JSON[_0xc75b('0x13')](_0x316516));_0x5fef3(_0x316516);})[_0xc75b('0x23')](function(_0x2c52a2){logger['error']('UpdateSmsInteraction',_0x2c52a2[_0xc75b('0x16')],_0x5c4391);_0x55e7ef(_0x222cf1[_0xc75b('0x14')](0x1f4,_0x2c52a2[_0xc75b('0x16')]));});});};exports[_0xc75b('0x24')]=function(_0x41994c){return new Promise(function(_0x433e2a,_0x52fc25){return db[_0xc75b('0x1a')][_0xc75b('0x25')]({'where':_0x41994c[_0xc75b('0x1e')]?_0x41994c[_0xc75b('0x1e')][_0xc75b('0x1f')]||null:null})['then'](function(_0x111b1f){if(_0x111b1f){return _0x111b1f['addTags'](_0x41994c[_0xc75b('0x1c')]['ids'],_[_0xc75b('0x26')](_0x41994c['body'],['ids','id'])||{});}})['spread'](function(_0x5e6828){logger[_0xc75b('0x10')](_0xc75b('0x27'),_0x41994c);logger[_0xc75b('0x11')](_0xc75b('0x27'),_0x41994c,JSON['stringify'](_0x5e6828));_0x433e2a(_0x5e6828);})[_0xc75b('0x23')](function(_0x14b29e){logger[_0xc75b('0x14')](_0xc75b('0x27'),_0x14b29e['message'],_0x41994c);_0x52fc25(_this[_0xc75b('0x14')](0x1f4,_0x14b29e[_0xc75b('0x16')]));});});}; \ No newline at end of file +var _0x041d=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','update','options','raw','where','attributes','limit','UpdateSmsInteraction','debug','catch','AddTagsToSmsInteraction','SmsInteraction','find','addTags','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e02c6,_0xace19b){var _0xd131ad=function(_0x1c0dd7){while(--_0x1c0dd7){_0x3e02c6['push'](_0x3e02c6['shift']());}};_0xd131ad(++_0xace19b);}(_0x041d,0x7b));var _0xd041=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x041d[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xd041('0x0'));var util=require(_0xd041('0x1'));var moment=require(_0xd041('0x2'));var BPromise=require(_0xd041('0x3'));var rs=require(_0xd041('0x4'));var fs=require('fs');var Redis=require(_0xd041('0x5'));var db=require(_0xd041('0x6'))['db'];var utils=require(_0xd041('0x7'));var logger=require(_0xd041('0x8'))(_0xd041('0x9'));var config=require(_0xd041('0xa'));var jayson=require(_0xd041('0xb'));var client=jayson[_0xd041('0xc')]['http']({'port':0x232a});config[_0xd041('0xd')]=_['defaults'](config[_0xd041('0xd')],{'host':_0xd041('0xe'),'port':0x18eb});var socket=require(_0xd041('0xf'))(new Redis(config[_0xd041('0xd')]));require(_0xd041('0x10'))[_0xd041('0x11')](socket);function respondWithRpcPromise(_0x6b5179,_0x4922a9,_0x2b8196){return new BPromise(function(_0x4d3431,_0x3ba0c6){return client[_0xd041('0x12')](_0x6b5179,_0x2b8196)[_0xd041('0x13')](function(_0x279705){logger['info'](_0xd041('0x14'),_0x4922a9,'request\x20sent');logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x4922a9,_0xd041('0x15'),JSON[_0xd041('0x16')](_0x279705));if(_0x279705[_0xd041('0x17')]){if(_0x279705[_0xd041('0x17')]['code']===0x1f4){logger[_0xd041('0x17')](_0xd041('0x14'),_0x4922a9,_0x279705[_0xd041('0x17')][_0xd041('0x18')]);return _0x3ba0c6(_0x279705[_0xd041('0x17')]['message']);}logger[_0xd041('0x17')](_0xd041('0x14'),_0x4922a9,_0x279705[_0xd041('0x17')]['message']);return _0x4d3431(_0x279705[_0xd041('0x17')]['message']);}else{logger[_0xd041('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x4922a9,_0xd041('0x15'));_0x4d3431(_0x279705['result'][_0xd041('0x18')]);}})['catch'](function(_0x182ddc){logger[_0xd041('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x4922a9,_0x182ddc);_0x3ba0c6(_0x182ddc);});});}exports['UpdateSmsInteraction']=function(_0x1343b4){var _0x1c9127=this;return new Promise(function(_0x37998e,_0x443a5e){return db['SmsInteraction'][_0xd041('0x1a')](_0x1343b4['body'],{'raw':_0x1343b4[_0xd041('0x1b')]?_0x1343b4[_0xd041('0x1b')][_0xd041('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1343b4[_0xd041('0x1b')]?_0x1343b4[_0xd041('0x1b')][_0xd041('0x1d')]||null:null,'attributes':_0x1343b4[_0xd041('0x1b')]?_0x1343b4[_0xd041('0x1b')][_0xd041('0x1e')]||null:null,'limit':_0x1343b4[_0xd041('0x1b')]?_0x1343b4[_0xd041('0x1b')][_0xd041('0x1f')]||null:null})[_0xd041('0x13')](function(_0x3d5b9b){logger['info'](_0xd041('0x20'),_0x1343b4);logger[_0xd041('0x21')](_0xd041('0x20'),_0x1343b4,JSON[_0xd041('0x16')](_0x3d5b9b));_0x37998e(_0x3d5b9b);})[_0xd041('0x22')](function(_0x519834){logger[_0xd041('0x17')](_0xd041('0x20'),_0x519834[_0xd041('0x18')],_0x1343b4);_0x443a5e(_0x1c9127['error'](0x1f4,_0x519834[_0xd041('0x18')]));});});};exports[_0xd041('0x23')]=function(_0x5aada8){return new Promise(function(_0x304c23,_0x1ceb00){return db[_0xd041('0x24')][_0xd041('0x25')]({'where':_0x5aada8[_0xd041('0x1b')]?_0x5aada8[_0xd041('0x1b')]['where']||null:null})[_0xd041('0x13')](function(_0x5d1da2){if(_0x5d1da2){return _0x5d1da2[_0xd041('0x26')](_0x5aada8[_0xd041('0x27')]['ids'],_[_0xd041('0x28')](_0x5aada8[_0xd041('0x27')],[_0xd041('0x29'),'id'])||{});}})[_0xd041('0x2a')](function(_0x255bd7){logger[_0xd041('0x19')](_0xd041('0x2b'),_0x5aada8);logger[_0xd041('0x21')](_0xd041('0x2b'),_0x5aada8,JSON[_0xd041('0x16')](_0x255bd7));_0x304c23(_0x255bd7);})['catch'](function(_0x1348d7){logger[_0xd041('0x17')](_0xd041('0x2b'),_0x1348d7[_0xd041('0x18')],_0x5aada8);_0x1ceb00(_this['error'](0x1f4,_0x1348d7[_0xd041('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index dfa1624..a2571a5 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 _0xdcc1=['register','smsInteraction:','./smsInteraction.events','save','update','emit'];(function(_0x27dcb8,_0x43b659){var _0x5efcea=function(_0x2c15d5){while(--_0x2c15d5){_0x27dcb8['push'](_0x27dcb8['shift']());}};_0x5efcea(++_0x43b659);}(_0xdcc1,0x6e));var _0x1dcc=function(_0x3d4936,_0x389683){_0x3d4936=_0x3d4936-0x0;var _0x14e4ae=_0xdcc1[_0x3d4936];return _0x14e4ae;};'use strict';var SmsInteractionEvents=require(_0x1dcc('0x0'));var events=[_0x1dcc('0x1'),'remove',_0x1dcc('0x2')];function createListener(_0x439d88,_0x394e50){return function(_0x55bf97){_0x394e50[_0x1dcc('0x3')](_0x439d88,_0x55bf97);};}function removeListener(_0x46b726,_0x4107aa){return function(){SmsInteractionEvents['removeListener'](_0x46b726,_0x4107aa);};}exports[_0x1dcc('0x4')]=function(_0x2d215e){for(var _0x1f2293=0x0,_0xf50dc6=events['length'];_0x1f2293<_0xf50dc6;_0x1f2293++){var _0x36861f=events[_0x1f2293];var _0x35622f=createListener(_0x1dcc('0x5')+_0x36861f,_0x2d215e);SmsInteractionEvents['on'](_0x36861f,_0x35622f);}}; \ No newline at end of file +var _0xdd4d=['update','emit','removeListener','smsInteraction:','./smsInteraction.events','remove'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xdd4d,0xb2));var _0xddd4=function(_0x1e3f0f,_0x8998d7){_0x1e3f0f=_0x1e3f0f-0x0;var _0x660f8a=_0xdd4d[_0x1e3f0f];return _0x660f8a;};'use strict';var SmsInteractionEvents=require(_0xddd4('0x0'));var events=['save',_0xddd4('0x1'),_0xddd4('0x2')];function createListener(_0x224b74,_0x57693f){return function(_0x345177){_0x57693f[_0xddd4('0x3')](_0x224b74,_0x345177);};}function removeListener(_0x47aa52,_0x766785){return function(){SmsInteractionEvents[_0xddd4('0x4')](_0x47aa52,_0x766785);};}exports['register']=function(_0x333478){for(var _0x2d63c0=0x0,_0x40c693=events['length'];_0x2d63c0<_0x40c693;_0x2d63c0++){var _0x46dd63=events[_0x2d63c0];var _0x40f57b=createListener(_0xddd4('0x5')+_0x46dd63,_0x333478);SmsInteractionEvents['on'](_0x46dd63,_0x40f57b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 1b54ece..a365eab 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 _0x49f8=['smsmessage:create','create','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms'];(function(_0x40eb3f,_0x222bf3){var _0x3255ca=function(_0x44957a){while(--_0x44957a){_0x40eb3f['push'](_0x40eb3f['shift']());}};_0x3255ca(++_0x222bf3);}(_0x49f8,0xff));var _0x849f=function(_0x372ce7,_0x556ad1){_0x372ce7=_0x372ce7-0x0;var _0xf3232a=_0x49f8[_0x372ce7];return _0xf3232a;};'use strict';var multer=require(_0x849f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x849f('0x1'));var express=require(_0x849f('0x2'));var router=express['Router']();var fs_extra=require(_0x849f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x849f('0x4'));var config=require('../../config/environment');var controller=require(_0x849f('0x5'));router['get']('/',auth[_0x849f('0x6')](),controller[_0x849f('0x7')]);router[_0x849f('0x8')](_0x849f('0x9'),auth[_0x849f('0x6')](),controller[_0x849f('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x849f('0xb')]);router[_0x849f('0xc')]('/',auth[_0x849f('0x6')](),interaction[_0x849f('0xd')](_0x849f('0xe'),_0x849f('0xf')),controller[_0x849f('0x10')]);router['post'](_0x849f('0x11'),controller['status']);router[_0x849f('0x12')](_0x849f('0x13'),auth[_0x849f('0x6')](),controller[_0x849f('0x14')]);router['put'](_0x849f('0x15'),auth[_0x849f('0x6')](),controller[_0x849f('0x16')]);router[_0x849f('0x12')](_0x849f('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x849f('0x18')]('/:id',auth[_0x849f('0x6')](),controller[_0x849f('0x19')]);module[_0x849f('0x1a')]=router; \ No newline at end of file +var _0xbf95=['./smsMessage.controller','index','get','/describe','isAuthenticated','/:id','post','tracked','/:id/status','put','/:id/accept','accept','reject','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5662fd,_0x5411a6){var _0x404fb0=function(_0x3f4599){while(--_0x3f4599){_0x5662fd['push'](_0x5662fd['shift']());}};_0x404fb0(++_0x5411a6);}(_0xbf95,0x7d));var _0x5bf9=function(_0x449157,_0x123fd1){_0x449157=_0x449157-0x0;var _0x33ed14=_0xbf95[_0x449157];return _0x33ed14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5bf9('0x0'));var timeout=require('connect-timeout');var express=require(_0x5bf9('0x1'));var router=express[_0x5bf9('0x2')]();var fs_extra=require(_0x5bf9('0x3'));var auth=require(_0x5bf9('0x4'));var interaction=require(_0x5bf9('0x5'));var config=require(_0x5bf9('0x6'));var controller=require(_0x5bf9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5bf9('0x8')]);router[_0x5bf9('0x9')](_0x5bf9('0xa'),auth[_0x5bf9('0xb')](),controller['describe']);router[_0x5bf9('0x9')](_0x5bf9('0xc'),auth[_0x5bf9('0xb')](),controller['show']);router[_0x5bf9('0xd')]('/',auth[_0x5bf9('0xb')](),interaction[_0x5bf9('0xe')]('sms','smsmessage:create'),controller['create']);router[_0x5bf9('0xd')](_0x5bf9('0xf'),controller['status']);router[_0x5bf9('0x10')](_0x5bf9('0xc'),auth[_0x5bf9('0xb')](),controller['update']);router[_0x5bf9('0x10')](_0x5bf9('0x11'),auth['isAuthenticated'](),controller[_0x5bf9('0x12')]);router[_0x5bf9('0x10')]('/:id/reject',auth[_0x5bf9('0xb')](),controller[_0x5bf9('0x13')]);router[_0x5bf9('0x14')](_0x5bf9('0xc'),auth['isAuthenticated'](),controller[_0x5bf9('0x15')]);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 f69e5c5..ffe5982 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 _0x99fb=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x99fb,0x92));var _0xb99f=function(_0x2b8d64,_0x435463){_0x2b8d64=_0x2b8d64-0x0;var _0x3c6040=_0x99fb[_0x2b8d64];return _0x3c6040;};'use strict';var Sequelize=require(_0xb99f('0x0'));module['exports']={'body':{'type':Sequelize[_0xb99f('0x1')](_0xb99f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb99f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb99f('0x4')]('in',_0xb99f('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb99f('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb99f('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xb99f('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb99f('0x6')]},'providerResponse':{'type':Sequelize[_0xb99f('0x1')]}}; \ No newline at end of file +var _0xb1bd=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','medium','ENUM'];(function(_0x55c3f8,_0x5242cb){var _0x3eaf16=function(_0x5eccd0){while(--_0x5eccd0){_0x55c3f8['push'](_0x55c3f8['shift']());}};_0x3eaf16(++_0x5242cb);}(_0xb1bd,0x105));var _0xdb1b=function(_0x5ac226,_0x35c1ea){_0x5ac226=_0x5ac226-0x0;var _0x38a07c=_0xb1bd[_0x5ac226];return _0x38a07c;};'use strict';var Sequelize=require(_0xdb1b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xdb1b('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb1b('0x2')]('in',_0xdb1b('0x3')),'defaultValue':_0xdb1b('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdb1b('0x4')](0xbe)},'phone':{'type':Sequelize[_0xdb1b('0x4')]},'readAt':{'type':Sequelize[_0xdb1b('0x5')]},'secret':{'type':Sequelize[_0xdb1b('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdb1b('0x4')]},'providerResponse':{'type':Sequelize[_0xdb1b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3a60fc5..069dc4a 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 _0x8ad6=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','params','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','user','UserId','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','null','rejectMessage','Sequelize','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','messageId','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format'];(function(_0x2aea4f,_0x5b6f9b){var _0x2648bf=function(_0x8e4b93){while(--_0x8e4b93){_0x2aea4f['push'](_0x2aea4f['shift']());}};_0x2648bf(++_0x5b6f9b);}(_0x8ad6,0x123));var _0x68ad=function(_0x57a1cc,_0x2e2433){_0x57a1cc=_0x57a1cc-0x0;var _0xba0b7d=_0x8ad6[_0x57a1cc];return _0xba0b7d;};'use strict';var emlformat=require(_0x68ad('0x0'));var rimraf=require(_0x68ad('0x1'));var zipdir=require(_0x68ad('0x2'));var jsonpatch=require(_0x68ad('0x3'));var rp=require(_0x68ad('0x4'));var moment=require(_0x68ad('0x5'));var BPromise=require(_0x68ad('0x6'));var Mustache=require('mustache');var util=require(_0x68ad('0x7'));var path=require(_0x68ad('0x8'));var sox=require(_0x68ad('0x9'));var csv=require(_0x68ad('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ad('0xb'));var squel=require(_0x68ad('0xc'));var crypto=require(_0x68ad('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x68ad('0xa'));var querystring=require(_0x68ad('0xe'));var Papa=require(_0x68ad('0xf'));var Redis=require(_0x68ad('0x10'));var authService=require(_0x68ad('0x11'));var qs=require(_0x68ad('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68ad('0x13'));var logger=require(_0x68ad('0x14'))(_0x68ad('0x15'));var utils=require(_0x68ad('0x16'));var config=require(_0x68ad('0x17'));var licenseUtil=require(_0x68ad('0x18'));var db=require('../../mysqldb')['db'];config[_0x68ad('0x19')]=_[_0x68ad('0x1a')](config[_0x68ad('0x19')],{'host':_0x68ad('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x68ad('0x1c'))['register'](socket);var jayson=require(_0x68ad('0x1d'));var client=jayson[_0x68ad('0x1e')][_0x68ad('0x1f')]({'port':0x232c});var client9002=jayson[_0x68ad('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6f8e,_0x141790,_0x478f31,_0x348c78){return new BPromise(function(_0x13907d,_0x29e6c1){var _0xc6e301=_0x348c78||client;return _0xc6e301[_0x68ad('0x20')](_0x4c6f8e,_0x478f31)[_0x68ad('0x21')](function(_0x31ead4){logger[_0x68ad('0x22')](_0x68ad('0x23'),_0x141790,_0x68ad('0x24'));logger['debug'](_0x68ad('0x25'),_0x141790,'request\x20sent',JSON[_0x68ad('0x26')](_0x31ead4));if(_0x31ead4[_0x68ad('0x27')]){if(_0x31ead4[_0x68ad('0x27')][_0x68ad('0x28')]===0x1f4){logger[_0x68ad('0x27')](_0x68ad('0x23'),_0x141790,_0x31ead4[_0x68ad('0x27')][_0x68ad('0x29')]);return _0x29e6c1(_0x31ead4[_0x68ad('0x27')][_0x68ad('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x141790,_0x31ead4[_0x68ad('0x27')]['message']);return _0x13907d(_0x31ead4[_0x68ad('0x27')][_0x68ad('0x29')]);}else{logger[_0x68ad('0x22')](_0x68ad('0x23'),_0x141790,_0x68ad('0x24'));_0x13907d(_0x31ead4['result'][_0x68ad('0x29')]);}})[_0x68ad('0x2a')](function(_0x556711){logger[_0x68ad('0x27')](_0x68ad('0x23'),_0x141790,_0x556711);_0x29e6c1(_0x556711);});});}function respondWithStatusCode(_0x4a7fb0,_0x5d845e){_0x5d845e=_0x5d845e||0xcc;return function(_0x536b05){if(_0x536b05){return _0x4a7fb0['sendStatus'](_0x5d845e);}return _0x4a7fb0[_0x68ad('0x2b')](_0x5d845e)[_0x68ad('0x2c')]();};}function respondWithResult(_0x407790,_0x1ec695){_0x1ec695=_0x1ec695||0xc8;return function(_0x441391){if(_0x441391){return _0x407790[_0x68ad('0x2b')](_0x1ec695)[_0x68ad('0x2d')](_0x441391);}};}function respondWithFilteredResult(_0x4ddfa1,_0x5ce826){return function(_0xdecae7){if(_0xdecae7){var _0x1f7846=typeof _0x5ce826[_0x68ad('0x2e')]===_0x68ad('0x2f')&&typeof _0x5ce826[_0x68ad('0x30')]===_0x68ad('0x2f');var _0x2bbc6f=_0xdecae7[_0x68ad('0x31')];var _0x138948=_0x1f7846?0x0:_0x5ce826[_0x68ad('0x2e')];var _0x4e981=_0x1f7846?_0xdecae7['count']:_0x5ce826[_0x68ad('0x2e')]+_0x5ce826[_0x68ad('0x30')];var _0x301159;if(_0x4e981>=_0x2bbc6f){_0x4e981=_0x2bbc6f;_0x301159=0xc8;}else{_0x301159=0xce;}_0x4ddfa1[_0x68ad('0x2b')](_0x301159);return _0x4ddfa1[_0x68ad('0x32')]('Content-Range',_0x138948+'-'+_0x4e981+'/'+_0x2bbc6f)['json'](_0xdecae7);}return null;};}function patchUpdates(_0x51af33){return function(_0x1505a0){try{jsonpatch[_0x68ad('0x33')](_0x1505a0,_0x51af33,!![]);}catch(_0x50f937){return BPromise[_0x68ad('0x34')](_0x50f937);}return _0x1505a0['save']();};}function saveUpdates(_0x3bfe67,_0x8b7dd6){return function(_0x4083ca){if(_0x4083ca){return _0x4083ca[_0x68ad('0x35')](_0x3bfe67)['then'](function(_0x3d0b40){return _0x3d0b40;});}return null;};}function removeEntity(_0x7de244,_0x3675b5){return function(_0x805381){if(_0x805381){return _0x805381[_0x68ad('0x36')]()[_0x68ad('0x21')](function(){_0x7de244['status'](0xcc)[_0x68ad('0x2c')]();});}};}function handleEntityNotFound(_0x1e7dfe,_0x20da0f){return function(_0x3d796f){if(!_0x3d796f){_0x1e7dfe['sendStatus'](0x194);}return _0x3d796f;};}function handleError(_0x2ca312,_0x743838){_0x743838=_0x743838||0x1f4;return function(_0x32f2ef){logger[_0x68ad('0x27')](_0x32f2ef[_0x68ad('0x37')]);if(_0x32f2ef[_0x68ad('0x38')]){delete _0x32f2ef[_0x68ad('0x38')];}_0x2ca312[_0x68ad('0x2b')](_0x743838)[_0x68ad('0x39')](_0x32f2ef);};}exports[_0x68ad('0x3a')]=function(_0x284d42,_0x2d50fa){var _0x2572ab={},_0x4121fc={},_0x3e75c2={'count':0x0,'rows':[]};var _0x16630f=_[_0x68ad('0x3b')](db[_0x68ad('0x3c')][_0x68ad('0x3d')],function(_0x3534ba){return{'name':_0x3534ba['fieldName'],'type':_0x3534ba[_0x68ad('0x3e')][_0x68ad('0x3f')]};});_0x4121fc[_0x68ad('0x40')]=_[_0x68ad('0x3b')](_0x16630f,_0x68ad('0x38'));_0x4121fc[_0x68ad('0x41')]=_[_0x68ad('0x42')](_0x284d42['query']);_0x4121fc[_0x68ad('0x43')]=_[_0x68ad('0x44')](_0x4121fc[_0x68ad('0x40')],_0x4121fc[_0x68ad('0x41')]);_0x2572ab[_0x68ad('0x45')]=_[_0x68ad('0x44')](_0x4121fc['model'],qs[_0x68ad('0x46')](_0x284d42['query'][_0x68ad('0x46')]));_0x2572ab[_0x68ad('0x45')]=_0x2572ab[_0x68ad('0x45')][_0x68ad('0x47')]?_0x2572ab[_0x68ad('0x45')]:_0x4121fc['model'];if(!_0x284d42['query'][_0x68ad('0x48')](_0x68ad('0x49'))){_0x2572ab[_0x68ad('0x30')]=qs['limit'](_0x284d42[_0x68ad('0x41')]['limit']);_0x2572ab['offset']=qs[_0x68ad('0x2e')](_0x284d42[_0x68ad('0x41')][_0x68ad('0x2e')]);}_0x2572ab[_0x68ad('0x4a')]=qs[_0x68ad('0x4b')](_0x284d42[_0x68ad('0x41')]['sort']);_0x2572ab[_0x68ad('0x4c')]=qs[_0x68ad('0x43')](_[_0x68ad('0x4d')](_0x284d42[_0x68ad('0x41')],_0x4121fc['filters']),_0x16630f);if(_0x284d42[_0x68ad('0x41')]['filter']){_0x2572ab[_0x68ad('0x4c')]=_[_0x68ad('0x4e')](_0x2572ab[_0x68ad('0x4c')],{'$or':_[_0x68ad('0x3b')](_0x16630f,function(_0x33275a){if(_0x33275a[_0x68ad('0x3e')]!=='VIRTUAL'){var _0x4e0c53={};_0x4e0c53[_0x33275a[_0x68ad('0x38')]]={'$like':'%'+_0x284d42[_0x68ad('0x41')][_0x68ad('0x4f')]+'%'};return _0x4e0c53;}})});}_0x2572ab=_[_0x68ad('0x4e')]({},_0x2572ab,_0x284d42[_0x68ad('0x50')]);var _0x349ac6={'where':_0x2572ab[_0x68ad('0x4c')]};return db[_0x68ad('0x3c')][_0x68ad('0x31')](_0x349ac6)[_0x68ad('0x21')](function(_0x19e0d0){_0x3e75c2[_0x68ad('0x31')]=_0x19e0d0;if(_0x284d42['query'][_0x68ad('0x51')]){_0x2572ab[_0x68ad('0x52')]=[{'all':!![]}];}return db[_0x68ad('0x3c')][_0x68ad('0x53')](_0x2572ab);})[_0x68ad('0x21')](function(_0x32ad05){_0x3e75c2[_0x68ad('0x54')]=_0x32ad05;return _0x3e75c2;})['then'](respondWithFilteredResult(_0x2d50fa,_0x2572ab))[_0x68ad('0x2a')](handleError(_0x2d50fa,null));};exports['show']=function(_0x5ed873,_0x3c80ef){var _0x2fa3b5={'raw':!![],'where':{'id':_0x5ed873[_0x68ad('0x55')]['id']}},_0x87b870={};_0x87b870[_0x68ad('0x40')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x87b870['query']=_[_0x68ad('0x42')](_0x5ed873[_0x68ad('0x41')]);_0x87b870[_0x68ad('0x43')]=_[_0x68ad('0x44')](_0x87b870[_0x68ad('0x40')],_0x87b870[_0x68ad('0x41')]);_0x2fa3b5[_0x68ad('0x45')]=_[_0x68ad('0x44')](_0x87b870[_0x68ad('0x40')],qs[_0x68ad('0x46')](_0x5ed873[_0x68ad('0x41')][_0x68ad('0x46')]));_0x2fa3b5[_0x68ad('0x45')]=_0x2fa3b5[_0x68ad('0x45')]['length']?_0x2fa3b5[_0x68ad('0x45')]:_0x87b870[_0x68ad('0x40')];if(_0x5ed873[_0x68ad('0x41')]['includeAll']){_0x2fa3b5[_0x68ad('0x52')]=[{'all':!![]}];}_0x2fa3b5=_[_0x68ad('0x4e')]({},_0x2fa3b5,_0x5ed873[_0x68ad('0x50')]);return db[_0x68ad('0x3c')]['find'](_0x2fa3b5)['then'](handleEntityNotFound(_0x3c80ef,null))['then'](respondWithResult(_0x3c80ef,null))['catch'](handleError(_0x3c80ef,null));};exports[_0x68ad('0x56')]=function(_0x1c1960,_0x547d8c){return db[_0x68ad('0x3c')]['create'](_0x1c1960[_0x68ad('0x57')],{})[_0x68ad('0x21')](respondWithResult(_0x547d8c,0xc9))[_0x68ad('0x2a')](handleError(_0x547d8c,null));};exports[_0x68ad('0x35')]=function(_0x4699f1,_0x2dd017){if(_0x4699f1[_0x68ad('0x57')]['id']){delete _0x4699f1[_0x68ad('0x57')]['id'];}return db['SmsMessage'][_0x68ad('0x58')]({'where':{'id':_0x4699f1[_0x68ad('0x55')]['id']}})[_0x68ad('0x21')](handleEntityNotFound(_0x2dd017,null))[_0x68ad('0x21')](saveUpdates(_0x4699f1['body'],null))[_0x68ad('0x21')](respondWithResult(_0x2dd017,null))[_0x68ad('0x2a')](handleError(_0x2dd017,null));};exports[_0x68ad('0x36')]=function(_0x1b34db,_0x3abfa8){return db[_0x68ad('0x3c')][_0x68ad('0x58')]({'where':{'id':_0x1b34db['params']['id']}})[_0x68ad('0x21')](handleEntityNotFound(_0x3abfa8,null))[_0x68ad('0x21')](removeEntity(_0x3abfa8,null))['catch'](handleError(_0x3abfa8,null));};exports[_0x68ad('0x59')]=function(_0x24f857,_0x34fc0e){return db[_0x68ad('0x3c')][_0x68ad('0x59')]()[_0x68ad('0x21')](respondWithResult(_0x34fc0e,null))[_0x68ad('0x2a')](handleError(_0x34fc0e,null));};var interaction_log=require(_0x68ad('0x14'))(_0x68ad('0x5a'));exports[_0x68ad('0x5b')]=function(_0x58cb98,_0x112d0b,_0x2e9cac){var _0x503444={'agent':{},'channel':_0x68ad('0x5c')};if(_0x58cb98['body']['id']){delete _0x58cb98[_0x68ad('0x57')]['id'];}_0x58cb98['body'][_0x68ad('0x5d')]=!![];_0x58cb98[_0x68ad('0x57')][_0x68ad('0x5e')]=moment()[_0x68ad('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x58cb98[_0x68ad('0x57')]['UserId']=_0x58cb98[_0x68ad('0x57')]['UserId']||_0x58cb98[_0x68ad('0x60')]['id'];_0x503444['agent']['id']=_0x58cb98[_0x68ad('0x57')][_0x68ad('0x61')];return db[_0x68ad('0x3c')]['find']({'where':{'id':_0x58cb98[_0x68ad('0x55')]['id'],'UserId':null}})[_0x68ad('0x21')](handleEntityNotFound(_0x112d0b,null))['then'](saveUpdates(_0x58cb98[_0x68ad('0x57')],null))['then'](function(_0x4fc60c){if(_0x4fc60c){_0x503444[_0x68ad('0x29')]=_0x4fc60c['get']({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4fc60c[_0x68ad('0x62')]}});}return null;})[_0x68ad('0x21')](handleEntityNotFound(_0x112d0b,null))[_0x68ad('0x21')](function(_0x44269d){if(_0x44269d){return _0x44269d[_0x68ad('0x35')]({'UserId':_0x58cb98['body'][_0x68ad('0x61')],'read1stAt':_[_0x68ad('0x63')](_0x44269d[_0x68ad('0x64')])?moment()[_0x68ad('0x5f')](_0x68ad('0x65')):undefined});}return null;})[_0x68ad('0x21')](function(_0x1d1849){if(_0x1d1849){_0x503444['interaction']=_0x1d1849[_0x68ad('0x66')]({'plain':!![]});interaction_log['info'](_0x68ad('0x67'),_0x58cb98[_0x68ad('0x60')]['id'],_0x58cb98[_0x68ad('0x60')]['name'],_0x58cb98[_0x68ad('0x60')][_0x68ad('0x68')],_0x503444[_0x68ad('0x69')]['id'],_0x58cb98[_0x68ad('0x57')]?JSON[_0x68ad('0x26')](_0x58cb98['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x503444);}return null;})[_0x68ad('0x21')](function(_0x14b385){var _0x335ed9=_0x68ad('0x6a')+_0x14b385[_0x68ad('0x29')][_0x68ad('0x6b')];return db[_0x68ad('0x6c')]['query'](_0x335ed9,{'type':db['Sequelize']['QueryTypes'][_0x68ad('0x6d')],'raw':!![]})[_0x68ad('0x21')](function(_0x45a65d){return _0x45a65d;});})[_0x68ad('0x21')](function(_0x4f88d3){if(_0x4f88d3){_0x503444['message'][_0x68ad('0x6e')]=_0x4f88d3[0x0];if(!_0x58cb98[_0x68ad('0x57')][_0x68ad('0x61')])return;return db[_0x68ad('0x6f')][_0x68ad('0x58')]({'where':{'id':_0x58cb98[_0x68ad('0x57')][_0x68ad('0x61')],'role':_0x68ad('0x70')},'attributes':['id',_0x68ad('0x38'),_0x68ad('0x71'),_0x68ad('0x72'),_0x68ad('0x73')],'raw':!![]});}return null;})[_0x68ad('0x21')](function(_0x4ec709){if(!_0x4ec709)return null;_0x503444[_0x68ad('0x29')][_0x68ad('0x70')]=_0x4ec709;return _0x503444;})[_0x68ad('0x21')](function(_0xff7eb4){if(_0xff7eb4){if(_0x58cb98[_0x68ad('0x57')]['manual']){_0x503444[_0x68ad('0x29')][_0x68ad('0x74')]=util['format'](_0x68ad('0x75'),_0x58cb98[_0x68ad('0x60')]['name']);_0x503444[_0x68ad('0x29')][_0x68ad('0x76')]=_0x503444['channel'];_0x503444[_0x68ad('0x29')][_0x68ad('0x77')]=_0x503444[_0x68ad('0x76')];_0x503444[_0x68ad('0x29')][_0x68ad('0x78')]=_0x68ad('0x5b');return respondWithRpcPromise(_0x68ad('0x79'),_0x68ad('0x79'),{'event':_0x68ad('0x7a'),'message':_0x503444[_0x68ad('0x29')]},client9002)[_0x68ad('0x21')](function(){return _0x503444;});}return _0x503444;}return null;})[_0x68ad('0x21')](respondWithResult(_0x112d0b,null))['catch'](handleError(_0x112d0b,null));};var interaction_log=require(_0x68ad('0x14'))(_0x68ad('0x5a'));exports[_0x68ad('0x34')]=function(_0x2a06c4,_0x48872d,_0x4634ed){var _0x3469ec={'agent':{},'channel':_0x68ad('0x5c')};if(_0x2a06c4[_0x68ad('0x57')]['id']){delete _0x2a06c4[_0x68ad('0x57')]['id'];}_0x2a06c4['body'][_0x68ad('0x61')]=_0x2a06c4[_0x68ad('0x57')][_0x68ad('0x61')]||_0x2a06c4[_0x68ad('0x60')]['id'];_0x3469ec[_0x68ad('0x70')]['id']=_0x2a06c4[_0x68ad('0x57')]['UserId'];return db[_0x68ad('0x3c')]['find']({'where':{'id':_0x2a06c4[_0x68ad('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48872d,null))[_0x68ad('0x21')](function(_0x50fde6){if(_0x50fde6){_0x3469ec['message']=_0x50fde6['get']({'plain':!![]});return db[_0x68ad('0x7b')][_0x68ad('0x58')]({'where':{'id':_0x50fde6[_0x68ad('0x62')]}});}return null;})[_0x68ad('0x21')](handleEntityNotFound(_0x48872d,null))[_0x68ad('0x21')](function(_0x292d0e){if(_0x292d0e){_0x3469ec[_0x68ad('0x69')]=_0x292d0e['get']({'plain':!![]});interaction_log[_0x68ad('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a06c4[_0x68ad('0x60')]['id'],_0x2a06c4['user']['name'],_0x2a06c4[_0x68ad('0x60')][_0x68ad('0x68')],_0x3469ec[_0x68ad('0x69')]['id'],_0x2a06c4['body']?JSON['stringify'](_0x2a06c4[_0x68ad('0x57')]):_0x68ad('0x7c'));return respondWithRpcPromise('RejectMessage',_0x68ad('0x7d'),_0x3469ec);}return null;})[_0x68ad('0x21')](function(_0x3f6ae1){var _0x298ea1=_0x68ad('0x6a')+_0x3f6ae1[_0x68ad('0x29')][_0x68ad('0x6b')];return db[_0x68ad('0x6c')][_0x68ad('0x41')](_0x298ea1,{'type':db[_0x68ad('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x68ad('0x21')](function(_0x44ed6a){return _0x44ed6a;});})[_0x68ad('0x21')](function(_0x241b59){if(_0x241b59){_0x3469ec['message'][_0x68ad('0x6e')]=_0x241b59[0x0];if(!_0x2a06c4[_0x68ad('0x57')][_0x68ad('0x61')])return;return db[_0x68ad('0x6f')][_0x68ad('0x58')]({'where':{'id':_0x2a06c4[_0x68ad('0x57')]['UserId'],'role':_0x68ad('0x70')},'attributes':['id',_0x68ad('0x38'),_0x68ad('0x71'),_0x68ad('0x72'),_0x68ad('0x73')],'raw':!![]});}return null;})[_0x68ad('0x21')](function(_0x1c6cf1){if(!_0x1c6cf1)return null;_0x3469ec[_0x68ad('0x29')][_0x68ad('0x70')]=_0x1c6cf1;return _0x3469ec;})[_0x68ad('0x21')](function(_0x256bc4){if(_0x256bc4){_0x256bc4[_0x68ad('0x29')]['interface']=util[_0x68ad('0x5f')]('SIP/%s',_0x2a06c4['user'][_0x68ad('0x38')]);_0x256bc4[_0x68ad('0x29')][_0x68ad('0x76')]=_0x3469ec['channel'];_0x256bc4[_0x68ad('0x29')][_0x68ad('0x77')]=_0x3469ec['channel'];_0x256bc4[_0x68ad('0x29')][_0x68ad('0x78')]=_0x68ad('0x34');respondWithRpcPromise(_0x68ad('0x79'),'EventManager',{'event':_0x68ad('0x7f'),'message':_0x256bc4['message']},client9002);return _0x3469ec;}return null;})[_0x68ad('0x21')](respondWithResult(_0x48872d,null))[_0x68ad('0x2a')](handleError(_0x48872d,null));};exports[_0x68ad('0x2b')]=function(_0x27b4f1,_0x8e85c8,_0xf05910){if(_0x27b4f1['body']['id']){delete _0x27b4f1[_0x68ad('0x57')]['id'];}var _0x24dc9c;return db[_0x68ad('0x3c')][_0x68ad('0x58')]({'where':{'id':_0x27b4f1[_0x68ad('0x55')]['id']}})['then'](handleEntityNotFound(_0x8e85c8,null))[_0x68ad('0x21')](function(_0x4c3055){if(_0x4c3055){_0x24dc9c=_0x4c3055;return db['SmsAccount'][_0x68ad('0x58')]({'where':{'id':_0x4c3055[_0x68ad('0x80')]}});}})[_0x68ad('0x21')](handleEntityNotFound(_0x8e85c8,null))[_0x68ad('0x21')](function(_0x139950){if(_0x139950){logger[_0x68ad('0x81')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x68ad('0x2b'),_0x68ad('0x82'),_0x139950[_0x68ad('0x3e')],util[_0x68ad('0x83')](_0x27b4f1['body'],{'showHidden':![],'depth':null}));switch(_0x139950[_0x68ad('0x3e')]){case'twilio':if(_0x27b4f1[_0x68ad('0x57')]['MessageSid']&&_0x27b4f1[_0x68ad('0x57')]['MessageSid']===_0x24dc9c[_0x68ad('0x84')]){return _0x24dc9c['update']({'read':!![]});}else{logger[_0x68ad('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x68ad('0x2b'),_0x68ad('0x85'),util['inspect'](_0x27b4f1[_0x68ad('0x57')],{'showHidden':![],'depth':null}));}break;case _0x68ad('0x86'):if(_0x27b4f1[_0x68ad('0x57')][_0x68ad('0x87')]&&_0x27b4f1['body'][_0x68ad('0x87')]===_0x24dc9c[_0x68ad('0x84')]&&_[_0x68ad('0x88')]([_0x68ad('0x89'),_0x68ad('0x8a')],_0x27b4f1[_0x68ad('0x57')][_0x68ad('0x8b')])>=0x0){return _0x24dc9c[_0x68ad('0x35')]({'read':!![]});}else{logger[_0x68ad('0x27')](_0x68ad('0x8c'),_0x68ad('0x2b'),_0x68ad('0x8d'),util['inspect'](_0x27b4f1['body'],{'showHidden':![],'depth':null}));}break;case _0x68ad('0x8e'):var _0x155897=_0x27b4f1[_0x68ad('0x57')][_0x68ad('0x8f')][0x0];if(_0x155897['status'][_0x68ad('0x90')]===_0x68ad('0x91')){return _0x24dc9c[_0x68ad('0x35')]({'read':!![]});}else{logger['error'](_0x68ad('0x8c'),_0x68ad('0x2b'),_0x68ad('0x8e'),util[_0x68ad('0x83')](_0x27b4f1[_0x68ad('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x24dc9c;}})[_0x68ad('0x21')](respondWithResult(_0x8e85c8,null))[_0x68ad('0x2a')](handleError(_0x8e85c8,null));}; \ No newline at end of file +var _0xa24d=['interface','channel','motionChannel','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','contact','User','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','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','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','apply','save','destroy','name','send','index','SmsMessage','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','update','find','describe','sms-interactions','accept','sms','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','fullname','email','internal','manual'];(function(_0x348b96,_0xe52070){var _0x47e935=function(_0x8d0a8c){while(--_0x8d0a8c){_0x348b96['push'](_0x348b96['shift']());}};_0x47e935(++_0xe52070);}(_0xa24d,0x1c1));var _0xda24=function(_0x279ce4,_0x13a3c8){_0x279ce4=_0x279ce4-0x0;var _0x3e8bcd=_0xa24d[_0x279ce4];return _0x3e8bcd;};'use strict';var emlformat=require(_0xda24('0x0'));var rimraf=require(_0xda24('0x1'));var zipdir=require(_0xda24('0x2'));var jsonpatch=require(_0xda24('0x3'));var rp=require(_0xda24('0x4'));var moment=require(_0xda24('0x5'));var BPromise=require(_0xda24('0x6'));var Mustache=require('mustache');var util=require(_0xda24('0x7'));var path=require(_0xda24('0x8'));var sox=require(_0xda24('0x9'));var csv=require(_0xda24('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda24('0xb'));var _=require(_0xda24('0xc'));var squel=require('squel');var crypto=require(_0xda24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda24('0xe'));var toCsv=require(_0xda24('0xa'));var querystring=require(_0xda24('0xf'));var Papa=require(_0xda24('0x10'));var Redis=require('ioredis');var authService=require(_0xda24('0x11'));var qs=require(_0xda24('0x12'));var as=require(_0xda24('0x13'));var hardwareService=require(_0xda24('0x14'));var logger=require(_0xda24('0x15'))('api');var utils=require(_0xda24('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda24('0x17'));var db=require(_0xda24('0x18'))['db'];config['redis']=_['defaults'](config[_0xda24('0x19')],{'host':_0xda24('0x1a'),'port':0x18eb});var socket=require(_0xda24('0x1b'))(new Redis(config[_0xda24('0x19')]));require('./smsMessage.socket')[_0xda24('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xda24('0x1d')][_0xda24('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53749f,_0x26764,_0x3b01ae,_0x22216d){return new BPromise(function(_0x3348e0,_0x2754f2){var _0x8f6c65=_0x22216d||client;return _0x8f6c65[_0xda24('0x1f')](_0x53749f,_0x3b01ae)[_0xda24('0x20')](function(_0x516295){logger[_0xda24('0x21')](_0xda24('0x22'),_0x26764,'request\x20sent');logger[_0xda24('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x26764,'request\x20sent',JSON[_0xda24('0x24')](_0x516295));if(_0x516295[_0xda24('0x25')]){if(_0x516295[_0xda24('0x25')][_0xda24('0x26')]===0x1f4){logger[_0xda24('0x25')](_0xda24('0x22'),_0x26764,_0x516295[_0xda24('0x25')]['message']);return _0x2754f2(_0x516295[_0xda24('0x25')]['message']);}logger[_0xda24('0x25')](_0xda24('0x22'),_0x26764,_0x516295[_0xda24('0x25')][_0xda24('0x27')]);return _0x3348e0(_0x516295[_0xda24('0x25')][_0xda24('0x27')]);}else{logger[_0xda24('0x21')](_0xda24('0x22'),_0x26764,_0xda24('0x28'));_0x3348e0(_0x516295[_0xda24('0x29')][_0xda24('0x27')]);}})[_0xda24('0x2a')](function(_0x5edfc0){logger[_0xda24('0x25')](_0xda24('0x22'),_0x26764,_0x5edfc0);_0x2754f2(_0x5edfc0);});});}function respondWithStatusCode(_0xc668d,_0x35ff0f){_0x35ff0f=_0x35ff0f||0xcc;return function(_0x196304){if(_0x196304){return _0xc668d[_0xda24('0x2b')](_0x35ff0f);}return _0xc668d['status'](_0x35ff0f)[_0xda24('0x2c')]();};}function respondWithResult(_0x50f0ad,_0x2406b7){_0x2406b7=_0x2406b7||0xc8;return function(_0x373225){if(_0x373225){return _0x50f0ad['status'](_0x2406b7)[_0xda24('0x2d')](_0x373225);}};}function respondWithFilteredResult(_0xd6d60f,_0x49a311){return function(_0x40487d){if(_0x40487d){var _0xc98aa2=typeof _0x49a311[_0xda24('0x2e')]===_0xda24('0x2f')&&typeof _0x49a311[_0xda24('0x30')]==='undefined';var _0x5e6fe6=_0x40487d[_0xda24('0x31')];var _0x569c99=_0xc98aa2?0x0:_0x49a311['offset'];var _0x3ea9c8=_0xc98aa2?_0x40487d[_0xda24('0x31')]:_0x49a311['offset']+_0x49a311['limit'];var _0x3bd714;if(_0x3ea9c8>=_0x5e6fe6){_0x3ea9c8=_0x5e6fe6;_0x3bd714=0xc8;}else{_0x3bd714=0xce;}_0xd6d60f[_0xda24('0x32')](_0x3bd714);return _0xd6d60f['set']('Content-Range',_0x569c99+'-'+_0x3ea9c8+'/'+_0x5e6fe6)[_0xda24('0x2d')](_0x40487d);}return null;};}function patchUpdates(_0x135148){return function(_0x197716){try{jsonpatch[_0xda24('0x33')](_0x197716,_0x135148,!![]);}catch(_0x2c0322){return BPromise['reject'](_0x2c0322);}return _0x197716[_0xda24('0x34')]();};}function saveUpdates(_0x381ba8,_0x11dd22){return function(_0x1dcb6c){if(_0x1dcb6c){return _0x1dcb6c['update'](_0x381ba8)[_0xda24('0x20')](function(_0x567568){return _0x567568;});}return null;};}function removeEntity(_0x40febe,_0x234b44){return function(_0x491a8d){if(_0x491a8d){return _0x491a8d[_0xda24('0x35')]()[_0xda24('0x20')](function(){_0x40febe['status'](0xcc)[_0xda24('0x2c')]();});}};}function handleEntityNotFound(_0x3cb6cd,_0x15e89d){return function(_0x226be6){if(!_0x226be6){_0x3cb6cd[_0xda24('0x2b')](0x194);}return _0x226be6;};}function handleError(_0x50523a,_0x1e65c6){_0x1e65c6=_0x1e65c6||0x1f4;return function(_0x3d8c34){logger['error'](_0x3d8c34['stack']);if(_0x3d8c34['name']){delete _0x3d8c34[_0xda24('0x36')];}_0x50523a[_0xda24('0x32')](_0x1e65c6)[_0xda24('0x37')](_0x3d8c34);};}exports[_0xda24('0x38')]=function(_0x31b920,_0xb4f489){var _0x568e39={},_0x70fe54={},_0x360b72={'count':0x0,'rows':[]};var _0x2cf7f1=_['map'](db[_0xda24('0x39')]['rawAttributes'],function(_0x25d0cd){return{'name':_0x25d0cd['fieldName'],'type':_0x25d0cd[_0xda24('0x3a')]['key']};});_0x70fe54[_0xda24('0x3b')]=_['map'](_0x2cf7f1,'name');_0x70fe54[_0xda24('0x3c')]=_[_0xda24('0x3d')](_0x31b920[_0xda24('0x3c')]);_0x70fe54[_0xda24('0x3e')]=_[_0xda24('0x3f')](_0x70fe54[_0xda24('0x3b')],_0x70fe54[_0xda24('0x3c')]);_0x568e39['attributes']=_[_0xda24('0x3f')](_0x70fe54[_0xda24('0x3b')],qs[_0xda24('0x40')](_0x31b920[_0xda24('0x3c')][_0xda24('0x40')]));_0x568e39[_0xda24('0x41')]=_0x568e39[_0xda24('0x41')][_0xda24('0x42')]?_0x568e39[_0xda24('0x41')]:_0x70fe54[_0xda24('0x3b')];if(!_0x31b920['query'][_0xda24('0x43')](_0xda24('0x44'))){_0x568e39[_0xda24('0x30')]=qs[_0xda24('0x30')](_0x31b920['query'][_0xda24('0x30')]);_0x568e39[_0xda24('0x2e')]=qs['offset'](_0x31b920['query']['offset']);}_0x568e39['order']=qs['sort'](_0x31b920['query'][_0xda24('0x45')]);_0x568e39[_0xda24('0x46')]=qs[_0xda24('0x3e')](_[_0xda24('0x47')](_0x31b920[_0xda24('0x3c')],_0x70fe54['filters']),_0x2cf7f1);if(_0x31b920[_0xda24('0x3c')][_0xda24('0x48')]){_0x568e39[_0xda24('0x46')]=_[_0xda24('0x49')](_0x568e39['where'],{'$or':_[_0xda24('0x4a')](_0x2cf7f1,function(_0x2dd5c5){if(_0x2dd5c5[_0xda24('0x3a')]!==_0xda24('0x4b')){var _0x15621d={};_0x15621d[_0x2dd5c5['name']]={'$like':'%'+_0x31b920['query'][_0xda24('0x48')]+'%'};return _0x15621d;}})});}_0x568e39=_[_0xda24('0x49')]({},_0x568e39,_0x31b920[_0xda24('0x4c')]);var _0x299d5d={'where':_0x568e39[_0xda24('0x46')]};return db[_0xda24('0x39')][_0xda24('0x31')](_0x299d5d)['then'](function(_0x260a2a){_0x360b72[_0xda24('0x31')]=_0x260a2a;if(_0x31b920['query']['includeAll']){_0x568e39[_0xda24('0x4d')]=[{'all':!![]}];}return db[_0xda24('0x39')][_0xda24('0x4e')](_0x568e39);})['then'](function(_0x36246f){_0x360b72[_0xda24('0x4f')]=_0x36246f;return _0x360b72;})[_0xda24('0x20')](respondWithFilteredResult(_0xb4f489,_0x568e39))['catch'](handleError(_0xb4f489,null));};exports[_0xda24('0x50')]=function(_0x42b454,_0x496c6e){var _0x2c324f={'raw':!![],'where':{'id':_0x42b454[_0xda24('0x51')]['id']}},_0x15b2fb={};_0x15b2fb[_0xda24('0x3b')]=_[_0xda24('0x3d')](db['SmsMessage'][_0xda24('0x52')]);_0x15b2fb[_0xda24('0x3c')]=_[_0xda24('0x3d')](_0x42b454[_0xda24('0x3c')]);_0x15b2fb['filters']=_[_0xda24('0x3f')](_0x15b2fb[_0xda24('0x3b')],_0x15b2fb['query']);_0x2c324f[_0xda24('0x41')]=_[_0xda24('0x3f')](_0x15b2fb['model'],qs[_0xda24('0x40')](_0x42b454[_0xda24('0x3c')][_0xda24('0x40')]));_0x2c324f[_0xda24('0x41')]=_0x2c324f[_0xda24('0x41')][_0xda24('0x42')]?_0x2c324f[_0xda24('0x41')]:_0x15b2fb[_0xda24('0x3b')];if(_0x42b454[_0xda24('0x3c')][_0xda24('0x53')]){_0x2c324f['include']=[{'all':!![]}];}_0x2c324f=_['merge']({},_0x2c324f,_0x42b454[_0xda24('0x4c')]);return db[_0xda24('0x39')]['find'](_0x2c324f)[_0xda24('0x20')](handleEntityNotFound(_0x496c6e,null))[_0xda24('0x20')](respondWithResult(_0x496c6e,null))[_0xda24('0x2a')](handleError(_0x496c6e,null));};exports[_0xda24('0x54')]=function(_0x4db553,_0x29cffd){return db[_0xda24('0x39')][_0xda24('0x54')](_0x4db553[_0xda24('0x55')],{})[_0xda24('0x20')](respondWithResult(_0x29cffd,0xc9))[_0xda24('0x2a')](handleError(_0x29cffd,null));};exports[_0xda24('0x56')]=function(_0x10503e,_0x19a171){if(_0x10503e[_0xda24('0x55')]['id']){delete _0x10503e[_0xda24('0x55')]['id'];}return db[_0xda24('0x39')][_0xda24('0x57')]({'where':{'id':_0x10503e[_0xda24('0x51')]['id']}})[_0xda24('0x20')](handleEntityNotFound(_0x19a171,null))[_0xda24('0x20')](saveUpdates(_0x10503e['body'],null))['then'](respondWithResult(_0x19a171,null))[_0xda24('0x2a')](handleError(_0x19a171,null));};exports[_0xda24('0x35')]=function(_0x5410f1,_0x34f402){return db[_0xda24('0x39')][_0xda24('0x57')]({'where':{'id':_0x5410f1[_0xda24('0x51')]['id']}})[_0xda24('0x20')](handleEntityNotFound(_0x34f402,null))[_0xda24('0x20')](removeEntity(_0x34f402,null))[_0xda24('0x2a')](handleError(_0x34f402,null));};exports[_0xda24('0x58')]=function(_0x2feebf,_0x190573){return db[_0xda24('0x39')]['describe']()[_0xda24('0x20')](respondWithResult(_0x190573,null))['catch'](handleError(_0x190573,null));};var interaction_log=require(_0xda24('0x15'))(_0xda24('0x59'));exports[_0xda24('0x5a')]=function(_0x227dbe,_0x130775,_0x3809f5){var _0x4124a8={'agent':{},'channel':_0xda24('0x5b')};if(_0x227dbe['body']['id']){delete _0x227dbe['body']['id'];}_0x227dbe['body']['read']=!![];_0x227dbe['body']['readAt']=moment()['format'](_0xda24('0x5c'));_0x227dbe[_0xda24('0x55')][_0xda24('0x5d')]=_0x227dbe[_0xda24('0x55')][_0xda24('0x5d')]||_0x227dbe[_0xda24('0x5e')]['id'];_0x4124a8[_0xda24('0x5f')]['id']=_0x227dbe[_0xda24('0x55')][_0xda24('0x5d')];return db[_0xda24('0x39')]['find']({'where':{'id':_0x227dbe['params']['id'],'UserId':null}})[_0xda24('0x20')](handleEntityNotFound(_0x130775,null))[_0xda24('0x20')](saveUpdates(_0x227dbe[_0xda24('0x55')],null))[_0xda24('0x20')](function(_0x145593){if(_0x145593){_0x4124a8[_0xda24('0x27')]=_0x145593[_0xda24('0x60')]({'plain':!![]});return db[_0xda24('0x61')][_0xda24('0x57')]({'where':{'id':_0x145593[_0xda24('0x62')]}});}return null;})[_0xda24('0x20')](handleEntityNotFound(_0x130775,null))[_0xda24('0x20')](function(_0x50b357){if(_0x50b357){return _0x50b357[_0xda24('0x56')]({'UserId':_0x227dbe[_0xda24('0x55')]['UserId'],'read1stAt':_[_0xda24('0x63')](_0x50b357['read1stAt'])?moment()[_0xda24('0x64')](_0xda24('0x5c')):undefined});}return null;})[_0xda24('0x20')](function(_0x25bbc0){if(_0x25bbc0){_0x4124a8['interaction']=_0x25bbc0[_0xda24('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x227dbe[_0xda24('0x5e')]['id'],_0x227dbe[_0xda24('0x5e')][_0xda24('0x36')],_0x227dbe['user'][_0xda24('0x65')],_0x4124a8[_0xda24('0x66')]['id'],_0x227dbe[_0xda24('0x55')]?JSON[_0xda24('0x24')](_0x227dbe[_0xda24('0x55')]):'null');return respondWithRpcPromise(_0xda24('0x67'),_0xda24('0x68'),_0x4124a8);}return null;})[_0xda24('0x20')](function(_0x3a4939){var _0x57e817=_0xda24('0x69')+_0x3a4939[_0xda24('0x27')][_0xda24('0x6a')];return db['sequelize']['query'](_0x57e817,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xda24('0x20')](function(_0x150a00){return _0x150a00;});})[_0xda24('0x20')](function(_0x9359e6){if(_0x9359e6){_0x4124a8[_0xda24('0x27')]['contact']=_0x9359e6[0x0];if(!_0x227dbe[_0xda24('0x55')][_0xda24('0x5d')])return;return db['User'][_0xda24('0x57')]({'where':{'id':_0x227dbe[_0xda24('0x55')]['UserId'],'role':_0xda24('0x5f')},'attributes':['id',_0xda24('0x36'),_0xda24('0x6b'),_0xda24('0x6c'),_0xda24('0x6d')],'raw':!![]});}return null;})[_0xda24('0x20')](function(_0x10e291){if(!_0x10e291)return null;_0x4124a8[_0xda24('0x27')][_0xda24('0x5f')]=_0x10e291;return _0x4124a8;})[_0xda24('0x20')](function(_0x4fda89){if(_0x4fda89){if(_0x227dbe[_0xda24('0x55')][_0xda24('0x6e')]){_0x4124a8[_0xda24('0x27')][_0xda24('0x6f')]=util[_0xda24('0x64')]('SIP/%s',_0x227dbe[_0xda24('0x5e')]['name']);_0x4124a8[_0xda24('0x27')][_0xda24('0x70')]=_0x4124a8['channel'];_0x4124a8[_0xda24('0x27')][_0xda24('0x71')]=_0x4124a8[_0xda24('0x70')];_0x4124a8[_0xda24('0x27')]['event']=_0xda24('0x5a');return respondWithRpcPromise(_0xda24('0x72'),'EventManager',{'event':_0xda24('0x73'),'message':_0x4124a8[_0xda24('0x27')]},client9002)[_0xda24('0x20')](function(){return _0x4124a8;});}return _0x4124a8;}return null;})[_0xda24('0x20')](respondWithResult(_0x130775,null))[_0xda24('0x2a')](handleError(_0x130775,null));};var interaction_log=require(_0xda24('0x15'))('sms-interactions');exports[_0xda24('0x74')]=function(_0x57165e,_0x177a13,_0x5cccbb){var _0x23b850={'agent':{},'channel':_0xda24('0x5b')};if(_0x57165e[_0xda24('0x55')]['id']){delete _0x57165e[_0xda24('0x55')]['id'];}_0x57165e['body'][_0xda24('0x5d')]=_0x57165e[_0xda24('0x55')][_0xda24('0x5d')]||_0x57165e[_0xda24('0x5e')]['id'];_0x23b850[_0xda24('0x5f')]['id']=_0x57165e[_0xda24('0x55')]['UserId'];return db[_0xda24('0x39')][_0xda24('0x57')]({'where':{'id':_0x57165e[_0xda24('0x51')]['id'],'UserId':null}})[_0xda24('0x20')](handleEntityNotFound(_0x177a13,null))[_0xda24('0x20')](function(_0xe85dbe){if(_0xe85dbe){_0x23b850[_0xda24('0x27')]=_0xe85dbe[_0xda24('0x60')]({'plain':!![]});return db[_0xda24('0x61')]['find']({'where':{'id':_0xe85dbe['SmsInteractionId']}});}return null;})[_0xda24('0x20')](handleEntityNotFound(_0x177a13,null))['then'](function(_0x6ba1ff){if(_0x6ba1ff){_0x23b850[_0xda24('0x66')]=_0x6ba1ff[_0xda24('0x60')]({'plain':!![]});interaction_log[_0xda24('0x21')](_0xda24('0x75'),_0x57165e[_0xda24('0x5e')]['id'],_0x57165e[_0xda24('0x5e')][_0xda24('0x36')],_0x57165e[_0xda24('0x5e')][_0xda24('0x65')],_0x23b850[_0xda24('0x66')]['id'],_0x57165e[_0xda24('0x55')]?JSON[_0xda24('0x24')](_0x57165e[_0xda24('0x55')]):_0xda24('0x76'));return respondWithRpcPromise('RejectMessage',_0xda24('0x77'),_0x23b850);}return null;})[_0xda24('0x20')](function(_0x39dcba){var _0x329dcb=_0xda24('0x69')+_0x39dcba['message']['ContactId'];return db[_0xda24('0x78')][_0xda24('0x3c')](_0x329dcb,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xda24('0x20')](function(_0x4c1dbb){return _0x4c1dbb;});})['then'](function(_0x8717ed){if(_0x8717ed){_0x23b850[_0xda24('0x27')][_0xda24('0x79')]=_0x8717ed[0x0];if(!_0x57165e['body'][_0xda24('0x5d')])return;return db[_0xda24('0x7a')][_0xda24('0x57')]({'where':{'id':_0x57165e['body'][_0xda24('0x5d')],'role':_0xda24('0x5f')},'attributes':['id',_0xda24('0x36'),_0xda24('0x6b'),'email',_0xda24('0x6d')],'raw':!![]});}return null;})['then'](function(_0x4e8d39){if(!_0x4e8d39)return null;_0x23b850[_0xda24('0x27')]['agent']=_0x4e8d39;return _0x23b850;})['then'](function(_0x4389aa){if(_0x4389aa){_0x4389aa['message']['interface']=util['format']('SIP/%s',_0x57165e[_0xda24('0x5e')][_0xda24('0x36')]);_0x4389aa[_0xda24('0x27')][_0xda24('0x70')]=_0x23b850[_0xda24('0x70')];_0x4389aa[_0xda24('0x27')][_0xda24('0x71')]=_0x23b850[_0xda24('0x70')];_0x4389aa['message']['event']=_0xda24('0x74');respondWithRpcPromise(_0xda24('0x72'),'EventManager',{'event':_0xda24('0x7b'),'message':_0x4389aa['message']},client9002);return _0x23b850;}return null;})[_0xda24('0x20')](respondWithResult(_0x177a13,null))['catch'](handleError(_0x177a13,null));};exports['status']=function(_0x2a6792,_0x1fe740,_0x1ec573){if(_0x2a6792[_0xda24('0x55')]['id']){delete _0x2a6792['body']['id'];}var _0x302f05;return db[_0xda24('0x39')][_0xda24('0x57')]({'where':{'id':_0x2a6792['params']['id']}})[_0xda24('0x20')](handleEntityNotFound(_0x1fe740,null))['then'](function(_0x59307e){if(_0x59307e){_0x302f05=_0x59307e;return db['SmsAccount'][_0xda24('0x57')]({'where':{'id':_0x59307e[_0xda24('0x7c')]}});}})[_0xda24('0x20')](handleEntityNotFound(_0x1fe740,null))[_0xda24('0x20')](function(_0xa9cc6b){if(_0xa9cc6b){logger[_0xda24('0x23')](_0xda24('0x7d'),_0xda24('0x32'),_0xda24('0x7e'),_0xa9cc6b[_0xda24('0x3a')],util['inspect'](_0x2a6792[_0xda24('0x55')],{'showHidden':![],'depth':null}));switch(_0xa9cc6b['type']){case _0xda24('0x7f'):if(_0x2a6792[_0xda24('0x55')][_0xda24('0x80')]&&_0x2a6792[_0xda24('0x55')][_0xda24('0x80')]===_0x302f05[_0xda24('0x81')]){return _0x302f05[_0xda24('0x56')]({'read':!![]});}else{logger[_0xda24('0x25')](_0xda24('0x82'),'status','twilio',util[_0xda24('0x83')](_0x2a6792[_0xda24('0x55')],{'showHidden':![],'depth':null}));}break;case _0xda24('0x84'):if(_0x2a6792[_0xda24('0x55')][_0xda24('0x85')]&&_0x2a6792[_0xda24('0x55')]['MessageUUID']===_0x302f05['messageId']&&_[_0xda24('0x86')]([_0xda24('0x87'),'delivered'],_0x2a6792[_0xda24('0x55')][_0xda24('0x88')])>=0x0){return _0x302f05[_0xda24('0x56')]({'read':!![]});}else{logger[_0xda24('0x25')](_0xda24('0x82'),_0xda24('0x32'),_0xda24('0x89'),util[_0xda24('0x83')](_0x2a6792[_0xda24('0x55')],{'showHidden':![],'depth':null}));}break;case _0xda24('0x8a'):var _0x579f33=_0x2a6792[_0xda24('0x55')][_0xda24('0x8b')][0x0];if(_0x579f33['status']['groupName']==='DELIVERED'){return _0x302f05[_0xda24('0x56')]({'read':!![]});}else{logger[_0xda24('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xda24('0x32'),_0xda24('0x8a'),util[_0xda24('0x83')](_0x2a6792[_0xda24('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x302f05;}})['then'](respondWithResult(_0x1fe740,null))[_0xda24('0x2a')](handleError(_0x1fe740,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f0562d7..1cb7923 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 _0x0bc2=['events','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b1c73,_0x1a4207){var _0xfab919=function(_0x423a33){while(--_0x423a33){_0x4b1c73['push'](_0x4b1c73['shift']());}};_0xfab919(++_0x1a4207);}(_0x0bc2,0x1e0));var _0x20bc=function(_0x36d61c,_0x1467d2){_0x36d61c=_0x36d61c-0x0;var _0x773eaf=_0x0bc2[_0x36d61c];return _0x773eaf;};'use strict';var EventEmitter=require(_0x20bc('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x20bc('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x20bc('0x2')](0x0);var events={'afterCreate':_0x20bc('0x3'),'afterUpdate':_0x20bc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23205b){return function(_0x199b7a,_0x5136f5,_0x43601a){SmsMessageEvents[_0x20bc('0x5')](_0x23205b+':'+_0x199b7a['id'],_0x199b7a);SmsMessageEvents['emit'](_0x23205b,_0x199b7a);_0x43601a(null);};}for(var e in events){if(events[_0x20bc('0x6')](e)){var event=events[e];SmsMessage[_0x20bc('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x76ef=['events','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x14d6b3,_0x4ae939){var _0x247e13=function(_0x166419){while(--_0x166419){_0x14d6b3['push'](_0x14d6b3['shift']());}};_0x247e13(++_0x4ae939);}(_0x76ef,0xa1));var _0xf76e=function(_0x37670e,_0x3c1ad4){_0x37670e=_0x37670e-0x0;var _0x3bcf82=_0x76ef[_0x37670e];return _0x3bcf82;};'use strict';var EventEmitter=require(_0xf76e('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf76e('0x1')](0x0);var events={'afterCreate':_0xf76e('0x2'),'afterUpdate':_0xf76e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e1759){return function(_0x3cf194,_0x3f2e7d,_0x4a753f){SmsMessageEvents[_0xf76e('0x4')](_0x1e1759+':'+_0x3cf194['id'],_0x3cf194);SmsMessageEvents[_0xf76e('0x4')](_0x1e1759,_0x3cf194);_0x4a753f(null);};}for(var e in events){if(events[_0xf76e('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xf76e('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 19e4b40..e8a731b 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 _0xd139=['accountId','/messages','applicationId','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','plivo','authId','/status?token=','%s:%s','message_uuid','baseUrl','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/'];(function(_0x171d74,_0x387388){var _0x511a7d=function(_0x4cd255){while(--_0x4cd255){_0x171d74['push'](_0x171d74['shift']());}};_0x511a7d(++_0x387388);}(_0xd139,0xfe));var _0x9d13=function(_0x5ddd02,_0xe7c78f){_0x5ddd02=_0x5ddd02-0x0;var _0x39f571=_0xd139[_0x5ddd02];return _0x39f571;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9d13('0x2'));var rp=require(_0x9d13('0x3'));var fs=require('fs');var path=require(_0x9d13('0x4'));var rimraf=require(_0x9d13('0x5'));var config=require(_0x9d13('0x6'));var attributes=require(_0x9d13('0x7'));module[_0x9d13('0x8')]=function(_0x1a1b83,_0x4687e8){return _0x1a1b83['define'](_0x9d13('0x9'),attributes,{'tableName':_0x9d13('0xa'),'paranoid':![],'indexes':[{'name':_0x9d13('0xb'),'fields':[_0x9d13('0xb')]},{'name':'fti_sms_messages','fields':[_0x9d13('0xc')],'type':_0x9d13('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ba7ea,_0x47f5e7,_0x15adf8){var _0x257a2d=_0x1a1b83[_0x9d13('0xe')];var _0x15b6cf=_0x2ba7ea[_0x9d13('0xf')]({'plain':!![]});if(_0x15b6cf[_0x9d13('0x10')][_0x9d13('0x11')]()==='in'||_0x15b6cf[_0x9d13('0x10')]['toLowerCase']()===_0x9d13('0x12')&&!_0x15b6cf[_0x9d13('0x13')]&&!_[_0x9d13('0x14')](_0x15b6cf[_0x9d13('0x15')])&&!_[_0x9d13('0x14')](_0x15b6cf[_0x9d13('0x16')])){_0x257a2d[_0x9d13('0x17')][_0x9d13('0x18')]({'where':{'id':_0x15b6cf[_0x9d13('0x16')]}})[_0x9d13('0x19')](function(_0x5e42c4){if(_0x5e42c4){_0x5e42c4[_0x9d13('0x1a')]({'lastMsgAt':_0x15b6cf[_0x9d13('0x1b')],'lastMsgDirection':_0x15b6cf['direction'][_0x9d13('0x11')]()});}})[_0x9d13('0x1c')](function(_0x3bc8ce){console[_0x9d13('0x1d')](_0x3bc8ce);});}if(_0x15b6cf[_0x9d13('0x10')]===_0x9d13('0x12')&&!_0x15b6cf[_0x9d13('0x13')]){var _0x122995;_0x257a2d['SmsAccount'][_0x9d13('0x1e')]({'where':{'id':_0x15b6cf[_0x9d13('0x1f')]},'raw':!![]})[_0x9d13('0x19')](function(_0x3f4980){_0x122995=_0x3f4980;if(_0x122995&&_0x122995[_0x9d13('0x20')]){switch(_0x122995[_0x9d13('0x20')]){case _0x9d13('0x21'):var _0x160bd8=require(_0x9d13('0x21'));if(_0x122995[_0x9d13('0x22')]&&_0x122995[_0x9d13('0x23')]&&_0x122995['phone']){var _0x311ead=new _0x160bd8(_0x122995[_0x9d13('0x22')],_0x122995[_0x9d13('0x23')]);_0x311ead[_0x9d13('0x24')][_0x9d13('0x25')]({'body':_0x15b6cf[_0x9d13('0xc')],'to':_0x15b6cf[_0x9d13('0x26')],'from':_0x122995['phone'],'statusCallback':_0x122995[_0x9d13('0x27')]+_0x9d13('0x28')+_0x15b6cf['id']+'/status?token='+_0x122995[_0x9d13('0x29')]})[_0x9d13('0x19')](function(_0x52200e){if(_0x52200e[_0x9d13('0x2a')]){return _0x2ba7ea['update']({'messageId':_0x52200e[_0x9d13('0x2a')]});}})[_0x9d13('0x1c')](function(_0x241b06){logger['error'](_0x9d13('0x2b'),'afterCreate',_0x9d13('0x21'),util[_0x9d13('0x2c')](_0x241b06,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x21'),_0x9d13('0x2e'));}break;case _0x9d13('0x2f'):var _0x14370c=_0x9d13('0x30');if(_0x122995[_0x9d13('0x31')]&&_0x122995[_0x9d13('0x32')]){var _0x492cee={'recipient':[_0x15b6cf[_0x9d13('0x26')]],'message':_0x15b6cf[_0x9d13('0xc')],'message_type':_0x122995['smsMethod']};if(_0x122995['smsMethod']&&_0x122995[_0x9d13('0x33')]!=='SI'){_0x492cee[_0x9d13('0x34')]=_0x122995[_0x9d13('0x26')];}var _0x3ab841={'url':_0x14370c+_0x9d13('0x35')+_0x122995[_0x9d13('0x31')]+_0x9d13('0x36')+_0x122995[_0x9d13('0x32')],'method':_0x9d13('0x37')};rp(_0x3ab841)[_0x9d13('0x19')](function(_0x4baec3){var _0x4270e9=_0x4baec3[_0x9d13('0x38')](';');var _0x515cc5={'user_key':_0x4270e9[0x0],'session_key':_0x4270e9[0x1]};_0x3ab841={'url':_0x14370c+'sms','method':_0x9d13('0x39'),'headers':{'user_key':_0x515cc5[_0x9d13('0x3a')],'Session_key':_0x515cc5[_0x9d13('0x3b')]},'json':!![],'body':_0x492cee};return rp(_0x3ab841);})['then'](function(_0x112abe){if(_0x112abe[_0x9d13('0x3c')]>=0x1){var _0x347226={'messageId':_0x112abe[_0x9d13('0x3d')]};if(_0x122995[_0x9d13('0x33')]!=='GP'||!_0x122995[_0x9d13('0x3e')]){_0x347226[_0x9d13('0x3f')]=!![];}return _0x2ba7ea['update'](_0x347226);}else{return logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9d13('0x2f'),util[_0x9d13('0x2c')](_0x112abe,{'showHidden':![],'depth':null}));}})[_0x9d13('0x1c')](function(_0x40c8ca){return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x2f'),util[_0x9d13('0x2c')](_0x40c8ca,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')](_0x9d13('0x2b'),'afterCreate',_0x9d13('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9d13('0x40'):if(_0x122995[_0x9d13('0x23')]){var _0x1446f4={'recipient':_0x15b6cf['phone'],'message':_0x15b6cf[_0x9d13('0xc')],'sender':_0x122995['senderString']||_0x122995[_0x9d13('0x26')],'authorization':_0x122995[_0x9d13('0x23')]};var _0x47f5e7={'method':_0x9d13('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1446f4,'json':!![]};rp(_0x47f5e7)[_0x9d13('0x19')](function(_0x2e4c73){var _0x2178b9={'messageId':_0x2e4c73['requestid']};if(!_0x122995[_0x9d13('0x3e')]){_0x2178b9['read']=!![];}return _0x2ba7ea[_0x9d13('0x1a')](_0x2178b9);})[_0x9d13('0x1c')](function(_0x1cc509){logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x40'),util[_0x9d13('0x2c')](_0x1cc509,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x40'),_0x9d13('0x41'));}break;case'clicksend':if(_0x122995[_0x9d13('0x31')]&&_0x122995[_0x9d13('0x32')]){var _0x1446f4={'messages':[{'source':_0x9d13('0x42'),'to':_0x15b6cf['phone'],'body':_0x15b6cf['body'],'from':_0x122995[_0x9d13('0x43')]||_0x122995[_0x9d13('0x26')]}]};var _0xcdfbc4=util[_0x9d13('0x44')]('%s:%s',_0x122995[_0x9d13('0x31')],_0x122995['password']);var _0x47f5e7={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1446f4,'headers':{'Authorization':util['format'](_0x9d13('0x45'),new Buffer(_0xcdfbc4)[_0x9d13('0x46')]('base64'))},'json':!![]};rp(_0x47f5e7)[_0x9d13('0x19')](function(_0x24ff48){if(_0x24ff48[_0x9d13('0x47')]>=0xc8&&_0x24ff48['http_code']<=0xce){if(_0x24ff48[_0x9d13('0x48')]&&_0x24ff48[_0x9d13('0x48')]['queued_count']>0x0){var _0x66b195=_[_0x9d13('0x49')](_0x24ff48['data'][_0x9d13('0x24')]);var _0xc0ef49={'messageId':_0x66b195[_0x9d13('0x4a')]};if(!_0x122995['deliveryReport']){_0xc0ef49[_0x9d13('0x3f')]=!![];}return _0x2ba7ea[_0x9d13('0x1a')](_0xc0ef49);}else{logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9d13('0x4b'),util[_0x9d13('0x2c')](_0x24ff48,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x4b'),util[_0x9d13('0x2c')](_0x24ff48,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5abbee){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x4b'),util[_0x9d13('0x2c')](_0x5abbee,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9d13('0x4c'):if(_0x122995[_0x9d13('0x4d')]&&_0x122995[_0x9d13('0x23')]){var _0x1446f4={'dst':_0x15b6cf[_0x9d13('0x26')],'text':_0x15b6cf['body'],'src':_0x122995[_0x9d13('0x43')]||_0x122995[_0x9d13('0x26')],'url':_0x122995[_0x9d13('0x27')]+_0x9d13('0x28')+_0x15b6cf['id']+_0x9d13('0x4e')+_0x122995[_0x9d13('0x29')]};var _0xcdfbc4=util[_0x9d13('0x44')](_0x9d13('0x4f'),_0x122995['authId'],_0x122995[_0x9d13('0x23')]);var _0x47f5e7={'method':_0x9d13('0x39'),'uri':util[_0x9d13('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x122995['authId']),'body':_0x1446f4,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xcdfbc4)[_0x9d13('0x46')]('base64'))},'json':!![]};rp(_0x47f5e7)[_0x9d13('0x19')](function(_0x4581fd){var _0x503512={'messageId':_0x4581fd[_0x9d13('0x50')][0x0]};return _0x2ba7ea['update'](_0x503512);})[_0x9d13('0x1c')](function(_0x56639d){logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x4c'),util[_0x9d13('0x2c')](_0x56639d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x122995[_0x9d13('0x31')]&&_0x122995[_0x9d13('0x32')]){if(_0x122995['baseUrl']){var _0x346754={'method':_0x9d13('0x39'),'uri':_0x122995['baseUrl']+'/auth/1/session','body':{'username':_0x122995[_0x9d13('0x31')],'password':_0x122995[_0x9d13('0x32')]},'json':!![]};return rp(_0x346754)[_0x9d13('0x19')](function(_0xcf8c1e){var _0x14c623={'method':_0x9d13('0x39'),'uri':_0x122995[_0x9d13('0x51')]+_0x9d13('0x52'),'body':{'messages':[{'from':_0x122995[_0x9d13('0x26')],'destinations':[{'to':_0x15b6cf[_0x9d13('0x26')]}],'text':_0x15b6cf['body'],'notifyUrl':_0x122995[_0x9d13('0x27')]+'/api/sms/messages/'+_0x15b6cf['id']+_0x9d13('0x4e')+_0x122995[_0x9d13('0x29')],'notifyContentType':_0x9d13('0x53'),'callbackData':_0x122995[_0x9d13('0x26')]+';'+_0x15b6cf[_0x9d13('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xcf8c1e[_0x9d13('0x29')]},'json':!![]};return rp(_0x14c623)[_0x9d13('0x19')](function(_0xf3dd78){if(_0xf3dd78[_0x9d13('0x24')]){var _0x94aea8={'messageId':_0xf3dd78['messages'][0x0][_0x9d13('0xb')]};if(!_0x122995[_0x9d13('0x3e')]){_0x94aea8[_0x9d13('0x3f')]=!![];}return _0x2ba7ea[_0x9d13('0x1a')](_0x94aea8);}else{return logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x54'),util[_0x9d13('0x2c')](_0xf3dd78,{'showHidden':![],'depth':null}));}});})[_0x9d13('0x1c')](function(_0xc10999){return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x54'),util[_0x9d13('0x2c')](_0xc10999,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x54'),_0x9d13('0x55'));}}else{logger['error'](_0x9d13('0x2b'),_0x9d13('0x2d'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0x9d13('0x56'):var _0x1624fd=require(_0x9d13('0x57'));if(_0x122995['apiKey']){var _0x1c9dfe={};_0x1c9dfe[_0x9d13('0x58')]=_0x122995[_0x9d13('0x31')];_0x1c9dfe[_0x9d13('0x26')]=_0x15b6cf['phone'];_0x1c9dfe['sender']=_0x122995[_0x9d13('0x26')];_0x1c9dfe[_0x9d13('0x59')]=_0x15b6cf[_0x9d13('0xc')];_0x1c9dfe[_0x9d13('0x5a')]=+new Date();var _0x3fd303='';var _0x26826b='';var _0x578a10=Object[_0x9d13('0x5b')](_0x1c9dfe);_0x578a10[_0x9d13('0x5c')]();for(var _0x5ab7f7=0x0;_0x5ab7f7<_0x578a10['length'];_0x5ab7f7++){if(_0x3fd303!=''){_0x3fd303+='&';}_0x3fd303+=_0x578a10[_0x5ab7f7]+'='+encodeURIComponent(_0x1c9dfe[_0x578a10[_0x5ab7f7]]);_0x26826b+=_0x1c9dfe[_0x578a10[_0x5ab7f7]];}_0x26826b+=_0x122995[_0x9d13('0x5d')];_0x26826b=_0x1624fd[_0x9d13('0x5e')]('md5')[_0x9d13('0x1a')](_0x26826b)[_0x9d13('0x5f')](_0x9d13('0x60'));if(_0x3fd303!==''){_0x3fd303+='&';}_0x3fd303+=_0x9d13('0x61')+_0x26826b;var _0x3ab841={'method':_0x9d13('0x37'),'uri':_0x122995[_0x9d13('0x51')]+_0x9d13('0x62')+_0x3fd303,'json':!![]};return rp(_0x3ab841)[_0x9d13('0x19')](function(_0x3839aa){var _0x4abc47=Object[_0x9d13('0x5b')](_0x3839aa);if(_0x3839aa[_0x4abc47[0x0]]['error']&&parseInt(_0x3839aa[_0x4abc47[0x0]][_0x9d13('0x1d')])===0x0){var _0x8cf82e={'messageId':_0x3839aa[_0x4abc47[0x0]][_0x9d13('0x63')]};if(!_0x122995[_0x9d13('0x3e')]){_0x8cf82e[_0x9d13('0x3f')]=!![];}return _0x2ba7ea['update'](_0x8cf82e);}else{return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x56'),util['inspect'](_0x3839aa[_0x9d13('0x1d')],{'showHidden':![],'depth':null}));}})[_0x9d13('0x1c')](function(_0x782325){return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x56'),util[_0x9d13('0x2c')](_0x782325,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x56'),_0x9d13('0x64'));}break;case _0x9d13('0x65'):if(_0x122995[_0x9d13('0x5d')]){var _0x3a6dcb={'method':_0x9d13('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x122995[_0x9d13('0x5d')]},'body':{'content':_0x15b6cf[_0x9d13('0xc')],'to':[_0x15b6cf[_0x9d13('0x26')]],'from':_0x122995[_0x9d13('0x26')],'binary':![],'clientMessageId':_0x9d13('0x66'),'charset':'UTF-8'},'json':!![]};rp(_0x3a6dcb)['then'](function(_0x547514){if(!_0x547514['error']){var _0x4dd062={'messageId':_0x547514[_0x9d13('0x24')][0x0][_0x9d13('0x67')]};if(!_0x122995['deliveryReport']){_0x4dd062['read']=!![];}return _0x2ba7ea['update'](_0x4dd062);}else{return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),'afterCreate',_0x9d13('0x65'),util[_0x9d13('0x2c')](_0x547514['error'],{'showHidden':![],'depth':null}));}})[_0x9d13('0x1c')](function(_0x15415d){return logger['error'](_0x9d13('0x2b'),'afterCreate',_0x9d13('0x65'),util[_0x9d13('0x2c')](_0x15415d,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x65'),_0x9d13('0x64'));}break;case _0x9d13('0x68'):if(_0x122995[_0x9d13('0x31')]&&_0x122995[_0x9d13('0x32')]){var _0xcdfbc4=util[_0x9d13('0x44')]('%s:%s',_0x122995[_0x9d13('0x31')],_0x122995[_0x9d13('0x32')]);var _0x47f5e7={'method':_0x9d13('0x39'),'uri':_0x9d13('0x69')+_0x122995[_0x9d13('0x6a')]+_0x9d13('0x6b'),'body':{'to':[_0x15b6cf['phone']],'text':_0x15b6cf[_0x9d13('0xc')],'from':_0x122995[_0x9d13('0x26')],'applicationId':_0x122995[_0x9d13('0x6c')]},'headers':{'Authorization':util[_0x9d13('0x44')](_0x9d13('0x45'),new Buffer(_0xcdfbc4)[_0x9d13('0x46')](_0x9d13('0x6d')))},'json':!![]};rp(_0x47f5e7)[_0x9d13('0x19')](function(_0x3a5997){if(_0x3a5997['id']){var _0x599ad2={'messageId':_0x3a5997['id']};return _0x2ba7ea[_0x9d13('0x1a')](_0x599ad2);}else{logger['error'](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x68'),util['inspect'](_0x3a5997,{'showHidden':![],'depth':null}));}})['catch'](function(_0x7d2243){logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x68'),util[_0x9d13('0x2c')](_0x7d2243,{'showHidden':![],'depth':null}));});}else{logger[_0x9d13('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9d13('0x2d'),_0x9d13('0x68'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9d13('0x6e'):if(_0x122995[_0x9d13('0x5d')]){var _0x4031e6={};var _0x3ab841={'method':'POST','uri':_0x9d13('0x6f'),'headers':{'Authorization':_0x9d13('0x70')+_0x122995[_0x9d13('0x5d')],'Content-Type':_0x9d13('0x53')},'body':{'from':_0x122995[_0x9d13('0x26')],'to':_0x15b6cf['phone'],'text':_0x15b6cf[_0x9d13('0xc')]},'json':!![]};return rp(_0x3ab841)['then'](function(_0x53d781){if(_0x53d781[_0x9d13('0x71')]==0xca){_0x4031e6[_0x9d13('0x72')]=_0x53d781;var _0x2cb7cf={'method':_0x9d13('0x39'),'uri':_0x9d13('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x122995[_0x9d13('0x5d')],'Content-Type':_0x9d13('0x53')},'body':{'refid':_0x4031e6[_0x9d13('0x72')][_0x9d13('0x74')]},'json':!![]};return rp(_0x2cb7cf)['then'](function(_0x50da4e){_0x4031e6[_0x9d13('0x75')]=_0x50da4e;var _0x456641={'messageId':_0x4031e6[_0x9d13('0x72')][_0x9d13('0x74')],'read':!![]};return _0x2ba7ea[_0x9d13('0x1a')](_0x456641);});}else{return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),'intelepeer',util['inspect'](_0x53d781,{'showHidden':![],'depth':null}));}})[_0x9d13('0x1c')](function(_0x4c9e42){return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x6e'),util['inspect'](_0x4c9e42,{'showHidden':![],'depth':null}));});}else{return logger[_0x9d13('0x1d')](_0x9d13('0x2b'),_0x9d13('0x2d'),_0x9d13('0x6e'),_0x9d13('0x76'));}break;}}})['finally'](function(){_0x15adf8();});}else{_0x15adf8();}}},'charset':'utf8mb4','collate':_0x9d13('0x77')});}; \ No newline at end of file +var _0x08f4=['FULLTEXT','models','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','messageId','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','accountId','applicationId','intelepeer','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','fti_sms_messages','body'];(function(_0x13cde9,_0x51a387){var _0x4ffc70=function(_0x2acfe1){while(--_0x2acfe1){_0x13cde9['push'](_0x13cde9['shift']());}};_0x4ffc70(++_0x51a387);}(_0x08f4,0x154));var _0x408f=function(_0x51bf45,_0x4b418e){_0x51bf45=_0x51bf45-0x0;var _0x4a4d73=_0x08f4[_0x51bf45];return _0x4a4d73;};'use strict';var _=require('lodash');var util=require(_0x408f('0x0'));var logger=require(_0x408f('0x1'))(_0x408f('0x2'));var moment=require(_0x408f('0x3'));var BPromise=require(_0x408f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x408f('0x5'));var config=require(_0x408f('0x6'));var attributes=require(_0x408f('0x7'));module[_0x408f('0x8')]=function(_0x5555dc,_0x11ed2b){return _0x5555dc[_0x408f('0x9')](_0x408f('0xa'),attributes,{'tableName':_0x408f('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x408f('0xc'),'fields':[_0x408f('0xd')],'type':_0x408f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c2157,_0x4b7112,_0x364d85){var _0x6d74d=_0x5555dc[_0x408f('0xf')];var _0x969ac6=_0x4c2157['get']({'plain':!![]});if(_0x969ac6[_0x408f('0x10')]['toLowerCase']()==='in'||_0x969ac6[_0x408f('0x10')][_0x408f('0x11')]()===_0x408f('0x12')&&!_0x969ac6[_0x408f('0x13')]&&!_['isNil'](_0x969ac6[_0x408f('0x14')])&&!_['isNil'](_0x969ac6['SmsInteractionId'])){_0x6d74d[_0x408f('0x15')][_0x408f('0x16')]({'where':{'id':_0x969ac6[_0x408f('0x17')]}})[_0x408f('0x18')](function(_0x10ef4f){if(_0x10ef4f){_0x10ef4f['update']({'lastMsgAt':_0x969ac6['createdAt'],'lastMsgDirection':_0x969ac6['direction']['toLowerCase']()});}})[_0x408f('0x19')](function(_0xc3c587){console[_0x408f('0x1a')](_0xc3c587);});}if(_0x969ac6[_0x408f('0x10')]===_0x408f('0x12')&&!_0x969ac6[_0x408f('0x13')]){var _0x293506;_0x6d74d[_0x408f('0x1b')][_0x408f('0x1c')]({'where':{'id':_0x969ac6['SmsAccountId']},'raw':!![]})[_0x408f('0x18')](function(_0x29c4fb){_0x293506=_0x29c4fb;if(_0x293506&&_0x293506[_0x408f('0x1d')]){switch(_0x293506[_0x408f('0x1d')]){case _0x408f('0x1e'):var _0x2fadc8=require(_0x408f('0x1e'));if(_0x293506[_0x408f('0x1f')]&&_0x293506[_0x408f('0x20')]&&_0x293506[_0x408f('0x21')]){var _0x10dd1a=new _0x2fadc8(_0x293506[_0x408f('0x1f')],_0x293506['authToken']);_0x10dd1a[_0x408f('0x22')][_0x408f('0x23')]({'body':_0x969ac6[_0x408f('0xd')],'to':_0x969ac6[_0x408f('0x21')],'from':_0x293506[_0x408f('0x21')],'statusCallback':_0x293506['remote']+_0x408f('0x24')+_0x969ac6['id']+_0x408f('0x25')+_0x293506['token']})[_0x408f('0x18')](function(_0x13b348){if(_0x13b348['sid']){return _0x4c2157[_0x408f('0x26')]({'messageId':_0x13b348[_0x408f('0x27')]});}})[_0x408f('0x19')](function(_0x930cbc){logger['error'](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x1e'),util[_0x408f('0x2a')](_0x930cbc,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),_0x408f('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x408f('0x2b'):var _0x2d73e2=_0x408f('0x2c');if(_0x293506[_0x408f('0x2d')]&&_0x293506[_0x408f('0x2e')]){var _0x4dadf2={'recipient':[_0x969ac6[_0x408f('0x21')]],'message':_0x969ac6[_0x408f('0xd')],'message_type':_0x293506[_0x408f('0x2f')]};if(_0x293506[_0x408f('0x2f')]&&_0x293506['smsMethod']!=='SI'){_0x4dadf2[_0x408f('0x30')]=_0x293506[_0x408f('0x21')];}var _0x402807={'url':_0x2d73e2+_0x408f('0x31')+_0x293506[_0x408f('0x2d')]+_0x408f('0x32')+_0x293506[_0x408f('0x2e')],'method':_0x408f('0x33')};rp(_0x402807)[_0x408f('0x18')](function(_0xac8d4e){var _0x5ea5fa=_0xac8d4e['split'](';');var _0x99dac0={'user_key':_0x5ea5fa[0x0],'session_key':_0x5ea5fa[0x1]};_0x402807={'url':_0x2d73e2+_0x408f('0x34'),'method':_0x408f('0x35'),'headers':{'user_key':_0x99dac0[_0x408f('0x36')],'Session_key':_0x99dac0[_0x408f('0x37')]},'json':!![],'body':_0x4dadf2};return rp(_0x402807);})[_0x408f('0x18')](function(_0x263e3b){if(_0x263e3b[_0x408f('0x38')]>=0x1){var _0x48d6c2={'messageId':_0x263e3b['internal_order_id']};if(_0x293506[_0x408f('0x2f')]!=='GP'||!_0x293506[_0x408f('0x39')]){_0x48d6c2[_0x408f('0x3a')]=!![];}return _0x4c2157[_0x408f('0x26')](_0x48d6c2);}else{return logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x408f('0x2b'),util['inspect'](_0x263e3b,{'showHidden':![],'depth':null}));}})[_0x408f('0x19')](function(_0x29e369){return logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),'skebby',util[_0x408f('0x2a')](_0x29e369,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),'skebby',_0x408f('0x3b'));}break;case'connectel':if(_0x293506[_0x408f('0x20')]){var _0x156cbe={'recipient':_0x969ac6[_0x408f('0x21')],'message':_0x969ac6['body'],'sender':_0x293506[_0x408f('0x3c')]||_0x293506[_0x408f('0x21')],'authorization':_0x293506[_0x408f('0x20')]};var _0x4b7112={'method':_0x408f('0x35'),'uri':_0x408f('0x3d'),'body':_0x156cbe,'json':!![]};rp(_0x4b7112)['then'](function(_0x1d8c5b){var _0x20c702={'messageId':_0x1d8c5b[_0x408f('0x3e')]};if(!_0x293506[_0x408f('0x39')]){_0x20c702[_0x408f('0x3a')]=!![];}return _0x4c2157[_0x408f('0x26')](_0x20c702);})[_0x408f('0x19')](function(_0x33db0c){logger['error'](_0x408f('0x28'),'afterCreate',_0x408f('0x3f'),util[_0x408f('0x2a')](_0x33db0c,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),'afterCreate',_0x408f('0x3f'),_0x408f('0x40'));}break;case _0x408f('0x41'):if(_0x293506['username']&&_0x293506['password']){var _0x156cbe={'messages':[{'source':_0x408f('0x42'),'to':_0x969ac6['phone'],'body':_0x969ac6[_0x408f('0xd')],'from':_0x293506[_0x408f('0x3c')]||_0x293506[_0x408f('0x21')]}]};var _0x4521bf=util[_0x408f('0x43')](_0x408f('0x44'),_0x293506[_0x408f('0x2d')],_0x293506['password']);var _0x4b7112={'method':_0x408f('0x35'),'uri':_0x408f('0x45'),'body':_0x156cbe,'headers':{'Authorization':util[_0x408f('0x43')](_0x408f('0x46'),new Buffer(_0x4521bf)['toString'](_0x408f('0x47')))},'json':!![]};rp(_0x4b7112)[_0x408f('0x18')](function(_0x231679){if(_0x231679[_0x408f('0x48')]>=0xc8&&_0x231679['http_code']<=0xce){if(_0x231679[_0x408f('0x49')]&&_0x231679['data'][_0x408f('0x4a')]>0x0){var _0x378a50=_[_0x408f('0x4b')](_0x231679[_0x408f('0x49')][_0x408f('0x22')]);var _0x408854={'messageId':_0x378a50[_0x408f('0x4c')]};if(!_0x293506[_0x408f('0x39')]){_0x408854['read']=!![];}return _0x4c2157[_0x408f('0x26')](_0x408854);}else{logger[_0x408f('0x1a')](_0x408f('0x28'),'afterCreate',_0x408f('0x4d'),util[_0x408f('0x2a')](_0x231679,{'showHidden':![],'depth':null}));}}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x4d'),util[_0x408f('0x2a')](_0x231679,{'showHidden':![],'depth':null}));}})[_0x408f('0x19')](function(_0x47a911){logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x4d'),util[_0x408f('0x2a')](_0x47a911,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x4d'),_0x408f('0x3b'));}break;case _0x408f('0x4e'):if(_0x293506[_0x408f('0x4f')]&&_0x293506[_0x408f('0x20')]){var _0x156cbe={'dst':_0x969ac6[_0x408f('0x21')],'text':_0x969ac6[_0x408f('0xd')],'src':_0x293506[_0x408f('0x3c')]||_0x293506['phone'],'url':_0x293506['remote']+_0x408f('0x24')+_0x969ac6['id']+_0x408f('0x25')+_0x293506[_0x408f('0x50')]};var _0x4521bf=util[_0x408f('0x43')](_0x408f('0x44'),_0x293506[_0x408f('0x4f')],_0x293506['authToken']);var _0x4b7112={'method':_0x408f('0x35'),'uri':util[_0x408f('0x43')](_0x408f('0x51'),_0x293506[_0x408f('0x4f')]),'body':_0x156cbe,'headers':{'Authorization':util[_0x408f('0x43')](_0x408f('0x46'),new Buffer(_0x4521bf)[_0x408f('0x52')](_0x408f('0x47')))},'json':!![]};rp(_0x4b7112)[_0x408f('0x18')](function(_0x46010c){var _0x340679={'messageId':_0x46010c['message_uuid'][0x0]};return _0x4c2157[_0x408f('0x26')](_0x340679);})[_0x408f('0x19')](function(_0x2d590b){logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x4e'),util[_0x408f('0x2a')](_0x2d590b,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x4e'),_0x408f('0x53'));}break;case _0x408f('0x54'):if(_0x293506['username']&&_0x293506[_0x408f('0x2e')]){if(_0x293506[_0x408f('0x55')]){var _0x34585c={'method':_0x408f('0x35'),'uri':_0x293506[_0x408f('0x55')]+'/auth/1/session','body':{'username':_0x293506[_0x408f('0x2d')],'password':_0x293506[_0x408f('0x2e')]},'json':!![]};return rp(_0x34585c)[_0x408f('0x18')](function(_0x169768){var _0x362825={'method':_0x408f('0x35'),'uri':_0x293506[_0x408f('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x293506[_0x408f('0x21')],'destinations':[{'to':_0x969ac6['phone']}],'text':_0x969ac6[_0x408f('0xd')],'notifyUrl':_0x293506['remote']+_0x408f('0x24')+_0x969ac6['id']+_0x408f('0x25')+_0x293506['token'],'notifyContentType':_0x408f('0x56'),'callbackData':_0x293506[_0x408f('0x21')]+';'+_0x969ac6['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x169768[_0x408f('0x50')]},'json':!![]};return rp(_0x362825)[_0x408f('0x18')](function(_0x52dbe3){if(_0x52dbe3[_0x408f('0x22')]){var _0x532fd3={'messageId':_0x52dbe3[_0x408f('0x22')][0x0][_0x408f('0x57')]};if(!_0x293506[_0x408f('0x39')]){_0x532fd3[_0x408f('0x3a')]=!![];}return _0x4c2157['update'](_0x532fd3);}else{return logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),_0x408f('0x54'),util[_0x408f('0x2a')](_0x52dbe3,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x55d34c){return logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x54'),util[_0x408f('0x2a')](_0x55d34c,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x54'),_0x408f('0x58'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),_0x408f('0x54'),_0x408f('0x3b'));}break;case _0x408f('0x59'):var _0x4bf6b6=require(_0x408f('0x5a'));if(_0x293506[_0x408f('0x5b')]){var _0x16cabe={};_0x16cabe[_0x408f('0x5c')]=_0x293506[_0x408f('0x2d')];_0x16cabe[_0x408f('0x21')]=_0x969ac6[_0x408f('0x21')];_0x16cabe[_0x408f('0x30')]=_0x293506[_0x408f('0x21')];_0x16cabe[_0x408f('0x5d')]=_0x969ac6[_0x408f('0xd')];_0x16cabe[_0x408f('0x5e')]=+new Date();var _0x461174='';var _0x5a64cc='';var _0x43991e=Object[_0x408f('0x5f')](_0x16cabe);_0x43991e[_0x408f('0x60')]();for(var _0x3b3b77=0x0;_0x3b3b77<_0x43991e['length'];_0x3b3b77++){if(_0x461174!=''){_0x461174+='&';}_0x461174+=_0x43991e[_0x3b3b77]+'='+encodeURIComponent(_0x16cabe[_0x43991e[_0x3b3b77]]);_0x5a64cc+=_0x16cabe[_0x43991e[_0x3b3b77]];}_0x5a64cc+=_0x293506[_0x408f('0x5b')];_0x5a64cc=_0x4bf6b6['createHash'](_0x408f('0x61'))[_0x408f('0x26')](_0x5a64cc)['digest'](_0x408f('0x62'));if(_0x461174!==''){_0x461174+='&';}_0x461174+=_0x408f('0x63')+_0x5a64cc;var _0x402807={'method':_0x408f('0x33'),'uri':_0x293506[_0x408f('0x55')]+_0x408f('0x64')+_0x461174,'json':!![]};return rp(_0x402807)[_0x408f('0x18')](function(_0x569ff6){var _0x1a681b=Object[_0x408f('0x5f')](_0x569ff6);if(_0x569ff6[_0x1a681b[0x0]][_0x408f('0x1a')]&&parseInt(_0x569ff6[_0x1a681b[0x0]][_0x408f('0x1a')])===0x0){var _0xaeb287={'messageId':_0x569ff6[_0x1a681b[0x0]][_0x408f('0x65')]};if(!_0x293506[_0x408f('0x39')]){_0xaeb287[_0x408f('0x3a')]=!![];}return _0x4c2157[_0x408f('0x26')](_0xaeb287);}else{return logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),_0x408f('0x59'),util[_0x408f('0x2a')](_0x569ff6[_0x408f('0x1a')],{'showHidden':![],'depth':null}));}})[_0x408f('0x19')](function(_0x5c3d58){return logger['error'](_0x408f('0x28'),_0x408f('0x29'),'csc',util[_0x408f('0x2a')](_0x5c3d58,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),'afterCreate',_0x408f('0x59'),_0x408f('0x66'));}break;case'clickatell':if(_0x293506[_0x408f('0x5b')]){var _0x7cbc48={'method':_0x408f('0x35'),'uri':_0x408f('0x67'),'headers':{'Authorization':_0x293506[_0x408f('0x5b')]},'body':{'content':_0x969ac6[_0x408f('0xd')],'to':[_0x969ac6[_0x408f('0x21')]],'from':_0x293506['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x408f('0x68')},'json':!![]};rp(_0x7cbc48)[_0x408f('0x18')](function(_0x170c44){if(!_0x170c44[_0x408f('0x1a')]){var _0x40b936={'messageId':_0x170c44[_0x408f('0x22')][0x0][_0x408f('0x69')]};if(!_0x293506[_0x408f('0x39')]){_0x40b936[_0x408f('0x3a')]=!![];}return _0x4c2157['update'](_0x40b936);}else{return logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),'clickatell',util['inspect'](_0x170c44[_0x408f('0x1a')],{'showHidden':![],'depth':null}));}})[_0x408f('0x19')](function(_0x561c2f){return logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),'clickatell',util[_0x408f('0x2a')](_0x561c2f,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x6a'),_0x408f('0x66'));}break;case _0x408f('0x6b'):if(_0x293506[_0x408f('0x2d')]&&_0x293506['password']){var _0x4521bf=util[_0x408f('0x43')](_0x408f('0x44'),_0x293506['username'],_0x293506[_0x408f('0x2e')]);var _0x4b7112={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x293506[_0x408f('0x6c')]+'/messages','body':{'to':[_0x969ac6['phone']],'text':_0x969ac6[_0x408f('0xd')],'from':_0x293506[_0x408f('0x21')],'applicationId':_0x293506[_0x408f('0x6d')]},'headers':{'Authorization':util['format'](_0x408f('0x46'),new Buffer(_0x4521bf)[_0x408f('0x52')](_0x408f('0x47')))},'json':!![]};rp(_0x4b7112)['then'](function(_0x3a4f4d){if(_0x3a4f4d['id']){var _0x2da607={'messageId':_0x3a4f4d['id']};return _0x4c2157[_0x408f('0x26')](_0x2da607);}else{logger['error'](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x6b'),util[_0x408f('0x2a')](_0x3a4f4d,{'showHidden':![],'depth':null}));}})[_0x408f('0x19')](function(_0x4eedcb){logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),'bandwidth',util[_0x408f('0x2a')](_0x4eedcb,{'showHidden':![],'depth':null}));});}else{logger[_0x408f('0x1a')](_0x408f('0x28'),'afterCreate',_0x408f('0x6b'),_0x408f('0x3b'));}break;case _0x408f('0x6e'):if(_0x293506[_0x408f('0x5b')]){var _0x576b98={};var _0x402807={'method':_0x408f('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x408f('0x6f')+_0x293506['apiKey'],'Content-Type':_0x408f('0x56')},'body':{'from':_0x293506[_0x408f('0x21')],'to':_0x969ac6[_0x408f('0x21')],'text':_0x969ac6[_0x408f('0xd')]},'json':!![]};return rp(_0x402807)[_0x408f('0x18')](function(_0x90c41d){if(_0x90c41d['code']==0xca){_0x576b98[_0x408f('0x70')]=_0x90c41d;var _0x48cb3e={'method':_0x408f('0x35'),'uri':_0x408f('0x71'),'headers':{'Authorization':_0x408f('0x6f')+_0x293506['apiKey'],'Content-Type':_0x408f('0x56')},'body':{'refid':_0x576b98[_0x408f('0x70')]['refid']},'json':!![]};return rp(_0x48cb3e)[_0x408f('0x18')](function(_0x5c1c12){_0x576b98[_0x408f('0x72')]=_0x5c1c12;var _0x1a8515={'messageId':_0x576b98[_0x408f('0x70')][_0x408f('0x73')],'read':!![]};return _0x4c2157[_0x408f('0x26')](_0x1a8515);});}else{return logger[_0x408f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x408f('0x29'),'intelepeer',util[_0x408f('0x2a')](_0x90c41d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x782eda){return logger[_0x408f('0x1a')](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x6e'),util[_0x408f('0x2a')](_0x782eda,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x408f('0x28'),_0x408f('0x29'),_0x408f('0x6e'),'Token\x20not\x20received');}break;}}})[_0x408f('0x74')](function(){_0x364d85();});}else{_0x364d85();}}},'charset':'utf8mb4','collate':_0x408f('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f79a291..e419578 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 _0xc0c1=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsMessage','SmsMessage','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0xc0c1,0x182));var _0x1c0c=function(_0x1b46e6,_0x43d86b){_0x1b46e6=_0x1b46e6-0x0;var _0xf497c6=_0xc0c1[_0x1b46e6];return _0xf497c6;};'use strict';var _=require('lodash');var util=require(_0x1c0c('0x0'));var moment=require(_0x1c0c('0x1'));var BPromise=require(_0x1c0c('0x2'));var rs=require(_0x1c0c('0x3'));var fs=require('fs');var Redis=require(_0x1c0c('0x4'));var db=require(_0x1c0c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c0c('0x6'))(_0x1c0c('0x7'));var config=require(_0x1c0c('0x8'));var jayson=require(_0x1c0c('0x9'));var client=jayson['client'][_0x1c0c('0xa')]({'port':0x232a});config[_0x1c0c('0xb')]=_[_0x1c0c('0xc')](config[_0x1c0c('0xb')],{'host':_0x1c0c('0xd'),'port':0x18eb});var socket=require(_0x1c0c('0xe'))(new Redis(config[_0x1c0c('0xb')]));require(_0x1c0c('0xf'))[_0x1c0c('0x10')](socket);function respondWithRpcPromise(_0x23d9fe,_0x14fe60,_0x51d732){return new BPromise(function(_0x1c8fbe,_0x5ba6fe){return client[_0x1c0c('0x11')](_0x23d9fe,_0x51d732)[_0x1c0c('0x12')](function(_0x15eddc){logger[_0x1c0c('0x13')](_0x1c0c('0x14'),_0x14fe60,_0x1c0c('0x15'));logger[_0x1c0c('0x16')](_0x1c0c('0x17'),_0x14fe60,_0x1c0c('0x15'),JSON[_0x1c0c('0x18')](_0x15eddc));if(_0x15eddc['error']){if(_0x15eddc[_0x1c0c('0x19')][_0x1c0c('0x1a')]===0x1f4){logger[_0x1c0c('0x19')](_0x1c0c('0x14'),_0x14fe60,_0x15eddc[_0x1c0c('0x19')][_0x1c0c('0x1b')]);return _0x5ba6fe(_0x15eddc[_0x1c0c('0x19')]['message']);}logger[_0x1c0c('0x19')](_0x1c0c('0x14'),_0x14fe60,_0x15eddc[_0x1c0c('0x19')][_0x1c0c('0x1b')]);return _0x1c8fbe(_0x15eddc[_0x1c0c('0x19')][_0x1c0c('0x1b')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x14fe60,'request\x20sent');_0x1c8fbe(_0x15eddc['result'][_0x1c0c('0x1b')]);}})['catch'](function(_0xeec353){logger[_0x1c0c('0x19')]('SmsMessage,\x20%s,\x20%s',_0x14fe60,_0xeec353);_0x5ba6fe(_0xeec353);});});}exports[_0x1c0c('0x1c')]=function(_0x53c401){var _0x4271cc=this;return new Promise(function(_0x588321,_0x59ad83){return db[_0x1c0c('0x1d')][_0x1c0c('0x1e')](_0x53c401[_0x1c0c('0x1f')],{'raw':_0x53c401[_0x1c0c('0x20')]?_0x53c401['options']['raw']===undefined?!![]:![]:!![]})[_0x1c0c('0x12')](function(_0x284d64){logger[_0x1c0c('0x13')]('CreateSmsMessage',_0x53c401);logger[_0x1c0c('0x16')](_0x1c0c('0x1c'),_0x53c401,JSON[_0x1c0c('0x18')](_0x284d64));_0x588321(_0x284d64);})['catch'](function(_0x49f201){logger[_0x1c0c('0x19')](_0x1c0c('0x1c'),_0x49f201['message'],_0x53c401);_0x59ad83(_0x4271cc['error'](0x1f4,_0x49f201[_0x1c0c('0x1b')]));});});}; \ No newline at end of file +var _0x5567=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateSmsMessage','SmsMessage','create','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register'];(function(_0x122c9e,_0x422e0e){var _0x359fd2=function(_0x71833c){while(--_0x71833c){_0x122c9e['push'](_0x122c9e['shift']());}};_0x359fd2(++_0x422e0e);}(_0x5567,0x184));var _0x7556=function(_0x5e5605,_0x3e7c12){_0x5e5605=_0x5e5605-0x0;var _0x201333=_0x5567[_0x5e5605];return _0x201333;};'use strict';var _=require('lodash');var util=require(_0x7556('0x0'));var moment=require(_0x7556('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7556('0x2'));var db=require(_0x7556('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7556('0x4'))(_0x7556('0x5'));var config=require(_0x7556('0x6'));var jayson=require(_0x7556('0x7'));var client=jayson[_0x7556('0x8')]['http']({'port':0x232a});config['redis']=_[_0x7556('0x9')](config[_0x7556('0xa')],{'host':_0x7556('0xb'),'port':0x18eb});var socket=require(_0x7556('0xc'))(new Redis(config[_0x7556('0xa')]));require(_0x7556('0xd'))[_0x7556('0xe')](socket);function respondWithRpcPromise(_0x49def9,_0x1fd708,_0x4a2ae5){return new BPromise(function(_0x3a69e1,_0x5d3e5a){return client[_0x7556('0xf')](_0x49def9,_0x4a2ae5)[_0x7556('0x10')](function(_0x334b37){logger[_0x7556('0x11')](_0x7556('0x12'),_0x1fd708,_0x7556('0x13'));logger[_0x7556('0x14')](_0x7556('0x15'),_0x1fd708,_0x7556('0x13'),JSON['stringify'](_0x334b37));if(_0x334b37['error']){if(_0x334b37[_0x7556('0x16')]['code']===0x1f4){logger[_0x7556('0x16')](_0x7556('0x12'),_0x1fd708,_0x334b37[_0x7556('0x16')][_0x7556('0x17')]);return _0x5d3e5a(_0x334b37[_0x7556('0x16')][_0x7556('0x17')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x1fd708,_0x334b37[_0x7556('0x16')][_0x7556('0x17')]);return _0x3a69e1(_0x334b37[_0x7556('0x16')]['message']);}else{logger[_0x7556('0x11')](_0x7556('0x12'),_0x1fd708,_0x7556('0x13'));_0x3a69e1(_0x334b37[_0x7556('0x18')]['message']);}})['catch'](function(_0x3f7503){logger[_0x7556('0x16')](_0x7556('0x12'),_0x1fd708,_0x3f7503);_0x5d3e5a(_0x3f7503);});});}exports[_0x7556('0x19')]=function(_0x4916b9){var _0x14a6ed=this;return new Promise(function(_0x3a0f89,_0x4e1f8c){return db[_0x7556('0x1a')][_0x7556('0x1b')](_0x4916b9['body'],{'raw':_0x4916b9[_0x7556('0x1c')]?_0x4916b9[_0x7556('0x1c')][_0x7556('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2c1f67){logger[_0x7556('0x11')](_0x7556('0x19'),_0x4916b9);logger[_0x7556('0x14')]('CreateSmsMessage',_0x4916b9,JSON['stringify'](_0x2c1f67));_0x3a0f89(_0x2c1f67);})[_0x7556('0x1e')](function(_0x316f62){logger[_0x7556('0x16')](_0x7556('0x19'),_0x316f62[_0x7556('0x17')],_0x4916b9);_0x4e1f8c(_0x14a6ed['error'](0x1f4,_0x316f62[_0x7556('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c765ef1..6fb0da1 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 _0x603d=['save','remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x5575e2,_0x305209){var _0x36f178=function(_0x1cfe56){while(--_0x1cfe56){_0x5575e2['push'](_0x5575e2['shift']());}};_0x36f178(++_0x305209);}(_0x603d,0x77));var _0xd603=function(_0x1ba540,_0x25bfbd){_0x1ba540=_0x1ba540-0x0;var _0x2aba13=_0x603d[_0x1ba540];return _0x2aba13;};'use strict';var SmsMessageEvents=require(_0xd603('0x0'));var events=[_0xd603('0x1'),_0xd603('0x2'),_0xd603('0x3')];function createListener(_0x58b1e2,_0x14fc55){return function(_0xa6e344){_0x14fc55[_0xd603('0x4')](_0x58b1e2,_0xa6e344);};}function removeListener(_0x1baa28,_0x284878){return function(){SmsMessageEvents[_0xd603('0x5')](_0x1baa28,_0x284878);};}exports['register']=function(_0x5abd2d){for(var _0xe66d92=0x0,_0x54f112=events[_0xd603('0x6')];_0xe66d92<_0x54f112;_0xe66d92++){var _0x53b95e=events[_0xe66d92];var _0x208f07=createListener(_0xd603('0x7')+_0x53b95e,_0x5abd2d);SmsMessageEvents['on'](_0x53b95e,_0x208f07);}}; \ No newline at end of file +var _0xc487=['smsMessage:','save','update','emit','removeListener','register'];(function(_0x5b1b81,_0x5d8aa5){var _0x3596c6=function(_0x29a11c){while(--_0x29a11c){_0x5b1b81['push'](_0x5b1b81['shift']());}};_0x3596c6(++_0x5d8aa5);}(_0xc487,0x79));var _0x7c48=function(_0x48261b,_0xea7b92){_0x48261b=_0x48261b-0x0;var _0xbe8b07=_0xc487[_0x48261b];return _0xbe8b07;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x7c48('0x0'),'remove',_0x7c48('0x1')];function createListener(_0xcba675,_0x48bd97){return function(_0x37d105){_0x48bd97[_0x7c48('0x2')](_0xcba675,_0x37d105);};}function removeListener(_0x1c6c4b,_0x5ea50f){return function(){SmsMessageEvents[_0x7c48('0x3')](_0x1c6c4b,_0x5ea50f);};}exports[_0x7c48('0x4')]=function(_0xbe875){for(var _0x2fa003=0x0,_0x2b51d6=events['length'];_0x2fa003<_0x2b51d6;_0x2fa003++){var _0x4d0499=events[_0x2fa003];var _0x36827c=createListener(_0x7c48('0x5')+_0x4d0499,_0xbe875);SmsMessageEvents['on'](_0x4d0499,_0x36827c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5187c3d..9e80d4b 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 _0x7cee=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','delete','removeTeams','removeAgents'];(function(_0x3a550a,_0x1d317f){var _0x5dc231=function(_0xe6f1ca){while(--_0xe6f1ca){_0x3a550a['push'](_0x3a550a['shift']());}};_0x5dc231(++_0x1d317f);}(_0x7cee,0x135));var _0xe7ce=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0x7cee[_0x132d12];return _0x1c3163;};'use strict';var multer=require(_0xe7ce('0x0'));var util=require(_0xe7ce('0x1'));var path=require(_0xe7ce('0x2'));var timeout=require(_0xe7ce('0x3'));var express=require(_0xe7ce('0x4'));var router=express['Router']();var fs_extra=require(_0xe7ce('0x5'));var auth=require(_0xe7ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe7ce('0x7'));var controller=require(_0xe7ce('0x8'));router[_0xe7ce('0x9')]('/',auth[_0xe7ce('0xa')](),controller['index']);router[_0xe7ce('0x9')](_0xe7ce('0xb'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0xc')]);router['get'](_0xe7ce('0xd'),auth[_0xe7ce('0xa')](),controller['show']);router[_0xe7ce('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xe7ce('0xe')]);router['get']('/:id/teams',auth[_0xe7ce('0xa')](),controller[_0xe7ce('0xf')]);router[_0xe7ce('0x9')](_0xe7ce('0x10'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x11')]);router[_0xe7ce('0x12')]('/',auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x13')]);router[_0xe7ce('0x12')](_0xe7ce('0x14'),auth['isAuthenticated'](),controller[_0xe7ce('0x15')]);router['post'](_0xe7ce('0x10'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x16')]);router['put'](_0xe7ce('0xd'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x17')]);router[_0xe7ce('0x18')]('/:id',auth[_0xe7ce('0xa')](),controller['destroy']);router[_0xe7ce('0x18')](_0xe7ce('0x14'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x19')]);router[_0xe7ce('0x18')](_0xe7ce('0x10'),auth[_0xe7ce('0xa')](),controller[_0xe7ce('0x1a')]);module[_0xe7ce('0x1b')]=router; \ No newline at end of file +var _0x2ffd=['show','/:id/members','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','/:id/teams','removeTeams','removeAgents','util','path','connect-timeout','Router','../../components/interaction/service','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x367e58,_0x2a9e49){var _0x37a2c5=function(_0xbd2d99){while(--_0xbd2d99){_0x367e58['push'](_0x367e58['shift']());}};_0x37a2c5(++_0x2a9e49);}(_0x2ffd,0x138));var _0xd2ff=function(_0x2cd50d,_0x223892){_0x2cd50d=_0x2cd50d-0x0;var _0x23440c=_0x2ffd[_0x2cd50d];return _0x23440c;};'use strict';var multer=require('multer');var util=require(_0xd2ff('0x0'));var path=require(_0xd2ff('0x1'));var timeout=require(_0xd2ff('0x2'));var express=require('express');var router=express[_0xd2ff('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2ff('0x4'));var config=require('../../config/environment');var controller=require(_0xd2ff('0x5'));router[_0xd2ff('0x6')]('/',auth['isAuthenticated'](),controller[_0xd2ff('0x7')]);router[_0xd2ff('0x6')](_0xd2ff('0x8'),auth[_0xd2ff('0x9')](),controller[_0xd2ff('0xa')]);router[_0xd2ff('0x6')](_0xd2ff('0xb'),auth[_0xd2ff('0x9')](),controller[_0xd2ff('0xc')]);router['get'](_0xd2ff('0xd'),auth[_0xd2ff('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xd2ff('0xe')]);router['get'](_0xd2ff('0xf'),auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd2ff('0x11')]);router[_0xd2ff('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd2ff('0x13')]);router['post']('/:id/users',auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x14')]);router['put']('/:id',auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x15')]);router[_0xd2ff('0x16')]('/:id',auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x17')]);router[_0xd2ff('0x16')](_0xd2ff('0x18'),auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x19')]);router['delete'](_0xd2ff('0xf'),auth[_0xd2ff('0x9')](),controller[_0xd2ff('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 02ed478..e6b29ac 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 _0xb6eb=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xb6eb,0x7d));var _0xbb6e=function(_0x9f2386,_0x348f5a){_0x9f2386=_0x9f2386-0x0;var _0x57f7aa=_0xb6eb[_0x9f2386];return _0x57f7aa;};'use strict';var Sequelize=require(_0xbb6e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xbb6e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb6e('0x2')]},'timeout':{'type':Sequelize[_0xbb6e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb6e('0x4')]('rrmemory',_0xbb6e('0x5'),_0xbb6e('0x6'))}}; \ No newline at end of file +var _0x0e05=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x413185,_0x239e8c){var _0x3d39eb=function(_0x2eeac8){while(--_0x2eeac8){_0x413185['push'](_0x413185['shift']());}};_0x3d39eb(++_0x239e8c);}(_0x0e05,0x1be));var _0x50e0=function(_0x4d1316,_0x577ee8){_0x4d1316=_0x4d1316-0x0;var _0x540504=_0x0e05[_0x4d1316];return _0x540504;};'use strict';var Sequelize=require(_0x50e0('0x0'));module['exports']={'name':{'type':Sequelize[_0x50e0('0x1')],'unique':_0x50e0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x50e0('0x1')]},'timeout':{'type':Sequelize[_0x50e0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x50e0('0x4'),_0x50e0('0x5'),_0x50e0('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 7825169..28c4740 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 _0x7d74=['limit','count','apply','reject','update','then','destroy','get','SmsQueues','error','stack','name','send','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','nolimit','pick','SmsQueueId','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','Agents','each','forEach','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','union','compact','value','transaction','isEmpty','emit','userSmsQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined'];(function(_0x3245e5,_0x428f07){var _0x3c9819=function(_0x1ba576){while(--_0x1ba576){_0x3245e5['push'](_0x3245e5['shift']());}};_0x3c9819(++_0x428f07);}(_0x7d74,0x1e2));var _0x47d7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7d74[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x47d7('0x0'));var rimraf=require(_0x47d7('0x1'));var zipdir=require(_0x47d7('0x2'));var jsonpatch=require(_0x47d7('0x3'));var rp=require(_0x47d7('0x4'));var moment=require(_0x47d7('0x5'));var BPromise=require(_0x47d7('0x6'));var Mustache=require(_0x47d7('0x7'));var util=require(_0x47d7('0x8'));var path=require('path');var sox=require(_0x47d7('0x9'));var csv=require(_0x47d7('0xa'));var ejs=require(_0x47d7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47d7('0xc'));var squel=require('squel');var crypto=require(_0x47d7('0xd'));var jsforce=require(_0x47d7('0xe'));var deskjs=require(_0x47d7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x47d7('0x10'));var Papa=require('papaparse');var Redis=require(_0x47d7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x47d7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47d7('0x13'));var utils=require(_0x47d7('0x14'));var config=require(_0x47d7('0x15'));var licenseUtil=require(_0x47d7('0x16'));var db=require('../../mysqldb')['db'];config[_0x47d7('0x17')]=_[_0x47d7('0x18')](config[_0x47d7('0x17')],{'host':_0x47d7('0x19'),'port':0x18eb});var socket=require(_0x47d7('0x1a'))(new Redis(config[_0x47d7('0x17')]));require(_0x47d7('0x1b'))['register'](socket);function respondWithStatusCode(_0x1bd2dc,_0x7674ca){_0x7674ca=_0x7674ca||0xcc;return function(_0x13a868){if(_0x13a868){return _0x1bd2dc[_0x47d7('0x1c')](_0x7674ca);}return _0x1bd2dc[_0x47d7('0x1d')](_0x7674ca)[_0x47d7('0x1e')]();};}function respondWithResult(_0x5e05be,_0x39157d){_0x39157d=_0x39157d||0xc8;return function(_0x60b4a9){if(_0x60b4a9){return _0x5e05be[_0x47d7('0x1d')](_0x39157d)[_0x47d7('0x1f')](_0x60b4a9);}};}function respondWithFilteredResult(_0x5503fe,_0xb80203){return function(_0x220a64){if(_0x220a64){var _0x180323=typeof _0xb80203[_0x47d7('0x20')]===_0x47d7('0x21')&&typeof _0xb80203[_0x47d7('0x22')]===_0x47d7('0x21');var _0x14580b=_0x220a64[_0x47d7('0x23')];var _0x16aaaa=_0x180323?0x0:_0xb80203[_0x47d7('0x20')];var _0x58e317=_0x180323?_0x220a64[_0x47d7('0x23')]:_0xb80203[_0x47d7('0x20')]+_0xb80203['limit'];var _0x23bc9a;if(_0x58e317>=_0x14580b){_0x58e317=_0x14580b;_0x23bc9a=0xc8;}else{_0x23bc9a=0xce;}_0x5503fe[_0x47d7('0x1d')](_0x23bc9a);return _0x5503fe['set']('Content-Range',_0x16aaaa+'-'+_0x58e317+'/'+_0x14580b)[_0x47d7('0x1f')](_0x220a64);}return null;};}function patchUpdates(_0x16e307){return function(_0x547a67){try{jsonpatch[_0x47d7('0x24')](_0x547a67,_0x16e307,!![]);}catch(_0x298936){return BPromise[_0x47d7('0x25')](_0x298936);}return _0x547a67['save']();};}function saveUpdates(_0x179480,_0x13ddd4){return function(_0x3de6c7){if(_0x3de6c7){return _0x3de6c7[_0x47d7('0x26')](_0x179480)[_0x47d7('0x27')](function(_0x5cf201){return _0x5cf201;});}return null;};}function removeEntity(_0x1e589c,_0x2b4ad8){return function(_0x3daba9){if(_0x3daba9){return _0x3daba9[_0x47d7('0x28')]()[_0x47d7('0x27')](function(){var _0x5909bc=_0x3daba9[_0x47d7('0x29')]({'plain':!![]});var _0x53c758=_0x47d7('0x2a');return db['UserProfileResource'][_0x47d7('0x28')]({'where':{'type':_0x53c758,'resourceId':_0x5909bc['id']}})[_0x47d7('0x27')](function(){return _0x3daba9;});})[_0x47d7('0x27')](function(){_0x1e589c[_0x47d7('0x1d')](0xcc)[_0x47d7('0x1e')]();});}};}function handleEntityNotFound(_0x563b27,_0x464141){return function(_0x4cdf8f){if(!_0x4cdf8f){_0x563b27[_0x47d7('0x1c')](0x194);}return _0x4cdf8f;};}function handleError(_0x2c0b4e,_0x403f4e){_0x403f4e=_0x403f4e||0x1f4;return function(_0x74a56a){logger[_0x47d7('0x2b')](_0x74a56a[_0x47d7('0x2c')]);if(_0x74a56a[_0x47d7('0x2d')]){delete _0x74a56a['name'];}_0x2c0b4e[_0x47d7('0x1d')](_0x403f4e)[_0x47d7('0x2e')](_0x74a56a);};}exports['index']=function(_0x2aed22,_0x4ff938){var _0x1eb136={},_0x16d7db={},_0x46c5d4={'count':0x0,'rows':[]};var _0x2b9c12=_[_0x47d7('0x2f')](db[_0x47d7('0x30')][_0x47d7('0x31')],function(_0x2e10ed){return{'name':_0x2e10ed[_0x47d7('0x32')],'type':_0x2e10ed[_0x47d7('0x33')]['key']};});_0x16d7db[_0x47d7('0x34')]=_[_0x47d7('0x2f')](_0x2b9c12,_0x47d7('0x2d'));_0x16d7db[_0x47d7('0x35')]=_[_0x47d7('0x36')](_0x2aed22['query']);_0x16d7db[_0x47d7('0x37')]=_[_0x47d7('0x38')](_0x16d7db['model'],_0x16d7db[_0x47d7('0x35')]);_0x1eb136[_0x47d7('0x39')]=_[_0x47d7('0x38')](_0x16d7db[_0x47d7('0x34')],qs['fields'](_0x2aed22['query'][_0x47d7('0x3a')]));_0x1eb136['attributes']=_0x1eb136[_0x47d7('0x39')][_0x47d7('0x3b')]?_0x1eb136['attributes']:_0x16d7db[_0x47d7('0x34')];if(!_0x2aed22[_0x47d7('0x35')]['hasOwnProperty']('nolimit')){_0x1eb136['limit']=qs[_0x47d7('0x22')](_0x2aed22[_0x47d7('0x35')][_0x47d7('0x22')]);_0x1eb136[_0x47d7('0x20')]=qs[_0x47d7('0x20')](_0x2aed22[_0x47d7('0x35')]['offset']);}_0x1eb136[_0x47d7('0x3c')]=qs[_0x47d7('0x3d')](_0x2aed22[_0x47d7('0x35')][_0x47d7('0x3d')]);_0x1eb136[_0x47d7('0x3e')]=qs[_0x47d7('0x37')](_['pick'](_0x2aed22[_0x47d7('0x35')],_0x16d7db['filters']),_0x2b9c12);if(_0x2aed22['query'][_0x47d7('0x3f')]){_0x1eb136[_0x47d7('0x3e')]=_[_0x47d7('0x40')](_0x1eb136['where'],{'$or':_[_0x47d7('0x2f')](_0x2b9c12,function(_0x25b649){if(_0x25b649[_0x47d7('0x33')]!=='VIRTUAL'){var _0x5a3bd5={};_0x5a3bd5[_0x25b649['name']]={'$like':'%'+_0x2aed22['query']['filter']+'%'};return _0x5a3bd5;}})});}_0x1eb136=_[_0x47d7('0x40')]({},_0x1eb136,_0x2aed22['options']);var _0x22b28a={'where':_0x1eb136['where']};return db[_0x47d7('0x30')][_0x47d7('0x23')](_0x22b28a)[_0x47d7('0x27')](function(_0x353527){_0x46c5d4[_0x47d7('0x23')]=_0x353527;if(_0x2aed22['query'][_0x47d7('0x41')]){_0x1eb136[_0x47d7('0x42')]=[{'all':!![]}];}return db[_0x47d7('0x30')][_0x47d7('0x43')](_0x1eb136);})[_0x47d7('0x27')](function(_0x5936e2){_0x46c5d4[_0x47d7('0x44')]=_0x5936e2;return _0x46c5d4;})[_0x47d7('0x27')](respondWithFilteredResult(_0x4ff938,_0x1eb136))[_0x47d7('0x45')](handleError(_0x4ff938,null));};exports['show']=function(_0x306f4e,_0x4a97b0){var _0x5e51b4={'raw':!![],'where':{'id':_0x306f4e[_0x47d7('0x46')]['id']}},_0x2a939c={};_0x2a939c[_0x47d7('0x34')]=_['keys'](db[_0x47d7('0x30')][_0x47d7('0x31')]);_0x2a939c[_0x47d7('0x35')]=_['keys'](_0x306f4e[_0x47d7('0x35')]);_0x2a939c[_0x47d7('0x37')]=_['intersection'](_0x2a939c[_0x47d7('0x34')],_0x2a939c[_0x47d7('0x35')]);_0x5e51b4[_0x47d7('0x39')]=_[_0x47d7('0x38')](_0x2a939c[_0x47d7('0x34')],qs[_0x47d7('0x3a')](_0x306f4e['query'][_0x47d7('0x3a')]));_0x5e51b4['attributes']=_0x5e51b4[_0x47d7('0x39')][_0x47d7('0x3b')]?_0x5e51b4[_0x47d7('0x39')]:_0x2a939c[_0x47d7('0x34')];if(_0x306f4e[_0x47d7('0x35')]['includeAll']){_0x5e51b4[_0x47d7('0x42')]=[{'all':!![]}];}_0x5e51b4=_[_0x47d7('0x40')]({},_0x5e51b4,_0x306f4e[_0x47d7('0x47')]);return db[_0x47d7('0x30')][_0x47d7('0x48')](_0x5e51b4)[_0x47d7('0x27')](handleEntityNotFound(_0x4a97b0,null))[_0x47d7('0x27')](respondWithResult(_0x4a97b0,null))[_0x47d7('0x45')](handleError(_0x4a97b0,null));};exports[_0x47d7('0x49')]=function(_0x39b141,_0xea4bef){return db['SmsQueue']['create'](_0x39b141[_0x47d7('0x4a')],{})['then'](function(_0x7a072a){var _0x160481=_0x39b141[_0x47d7('0x4b')][_0x47d7('0x29')]({'plain':!![]});if(!_0x160481)throw new Error(_0x47d7('0x4c'));if(_0x160481[_0x47d7('0x4d')]==='user'){var _0x4c01e3=_0x7a072a[_0x47d7('0x29')]({'plain':!![]});var _0x103a93=_0x47d7('0x2a');return db[_0x47d7('0x4e')][_0x47d7('0x48')]({'where':{'name':_0x103a93,'userProfileId':_0x160481[_0x47d7('0x4f')]},'raw':!![]})[_0x47d7('0x27')](function(_0x3b1ae0){if(_0x3b1ae0&&_0x3b1ae0['autoAssociation']===0x0){return db[_0x47d7('0x50')][_0x47d7('0x49')]({'name':_0x4c01e3['name'],'resourceId':_0x4c01e3['id'],'type':_0x3b1ae0[_0x47d7('0x2d')],'sectionId':_0x3b1ae0['id']},{})[_0x47d7('0x27')](function(){return _0x7a072a;});}else{return _0x7a072a;}})[_0x47d7('0x45')](function(_0x3252f2){logger['error'](_0x47d7('0x51'),_0x3252f2);throw _0x3252f2;});}return _0x7a072a;})[_0x47d7('0x27')](respondWithResult(_0xea4bef,0xc9))[_0x47d7('0x45')](handleError(_0xea4bef,null));};exports['update']=function(_0x138206,_0x5a7d4d){if(_0x138206[_0x47d7('0x4a')]['id']){delete _0x138206[_0x47d7('0x4a')]['id'];}return db[_0x47d7('0x30')][_0x47d7('0x48')]({'where':{'id':_0x138206[_0x47d7('0x46')]['id']}})[_0x47d7('0x27')](handleEntityNotFound(_0x5a7d4d,null))[_0x47d7('0x27')](saveUpdates(_0x138206['body'],null))[_0x47d7('0x27')](respondWithResult(_0x5a7d4d,null))[_0x47d7('0x45')](handleError(_0x5a7d4d,null));};exports[_0x47d7('0x28')]=function(_0x1c6506,_0xfb5f8c){return db[_0x47d7('0x30')][_0x47d7('0x48')]({'where':{'id':_0x1c6506['params']['id']}})['then'](handleEntityNotFound(_0xfb5f8c,null))[_0x47d7('0x27')](removeEntity(_0xfb5f8c,null))[_0x47d7('0x45')](handleError(_0xfb5f8c,null));};exports[_0x47d7('0x52')]=function(_0x1aa184,_0x53022f){return db[_0x47d7('0x30')][_0x47d7('0x52')]()[_0x47d7('0x27')](respondWithResult(_0x53022f,null))[_0x47d7('0x45')](handleError(_0x53022f,null));};exports[_0x47d7('0x53')]=function(_0x517fe2,_0x36e6ae,_0x3e9094){var _0x271865={'raw':!![],'where':{}},_0x3a8070={},_0x2ac86a;return db[_0x47d7('0x30')][_0x47d7('0x54')]({'where':{'id':_0x517fe2[_0x47d7('0x46')]['id']}})[_0x47d7('0x27')](handleEntityNotFound(_0x36e6ae,null))[_0x47d7('0x27')](function(_0x5821f1){if(_0x5821f1){_0x2ac86a=_0x5821f1[_0x47d7('0x29')]({'plain':!![]});_0x3a8070[_0x47d7('0x34')]=_[_0x47d7('0x36')](db[_0x47d7('0x55')][_0x47d7('0x31')]);_0x3a8070[_0x47d7('0x35')]=_[_0x47d7('0x36')](_0x517fe2[_0x47d7('0x35')]);_0x3a8070[_0x47d7('0x37')]=_['intersection'](_0x3a8070[_0x47d7('0x34')],_0x3a8070[_0x47d7('0x35')]);_0x271865[_0x47d7('0x39')]=_[_0x47d7('0x38')](_0x3a8070[_0x47d7('0x34')],qs[_0x47d7('0x3a')](_0x517fe2[_0x47d7('0x35')][_0x47d7('0x3a')]));_0x271865[_0x47d7('0x39')]=_0x271865[_0x47d7('0x39')][_0x47d7('0x3b')]?_0x271865['attributes']:_0x3a8070[_0x47d7('0x34')];if(!_0x517fe2[_0x47d7('0x35')][_0x47d7('0x56')](_0x47d7('0x57'))){_0x271865[_0x47d7('0x22')]=qs[_0x47d7('0x22')](_0x517fe2[_0x47d7('0x35')][_0x47d7('0x22')]);_0x271865[_0x47d7('0x20')]=qs[_0x47d7('0x20')](_0x517fe2[_0x47d7('0x35')]['offset']);}_0x271865[_0x47d7('0x3c')]=qs[_0x47d7('0x3d')](_0x517fe2[_0x47d7('0x35')]['sort']);_0x271865['where']=qs[_0x47d7('0x37')](_[_0x47d7('0x58')](_0x517fe2['query'],_0x3a8070[_0x47d7('0x37')]));_0x271865[_0x47d7('0x3e')][_0x47d7('0x59')]=_0x5821f1['id'];if(_0x517fe2[_0x47d7('0x35')][_0x47d7('0x3f')]){_0x271865[_0x47d7('0x3e')]=_['merge'](_0x271865[_0x47d7('0x3e')],{'$or':_[_0x47d7('0x2f')](_0x271865[_0x47d7('0x39')],function(_0x5ed59d){var _0x3cd48e={};_0x3cd48e[_0x5ed59d]={'$like':'%'+_0x517fe2['query'][_0x47d7('0x3f')]+'%'};return _0x3cd48e;})});}_0x271865=_[_0x47d7('0x40')]({},_0x271865,_0x517fe2[_0x47d7('0x47')]);return db[_0x47d7('0x55')][_0x47d7('0x43')](_0x271865);}})[_0x47d7('0x27')](function(_0x3fa357){if(_0x3fa357){return db[_0x47d7('0x5a')]['findAndCountAll']({'where':{'id':_[_0x47d7('0x2f')](_0x3fa357,_0x47d7('0x5b')),'role':_0x47d7('0x5c')},'attributes':['id','name','smsPause',_0x47d7('0x5d'),_0x47d7('0x5e')]});}})[_0x47d7('0x27')](function(_0x5caa35){if(_0x5caa35){return{'count':_0x5caa35[_0x47d7('0x23')],'rows':_[_0x47d7('0x2f')](_0x5caa35['rows'],function(_0x2db443){return{'membername':_0x2db443['name'],'UserId':_0x2db443['id'],'queue_name':_0x2ac86a[_0x47d7('0x2d')],'SmsQueueId':_0x2ac86a['id'],'interface':util['format'](_0x47d7('0x5f'),_0x47d7('0x60'),_0x2db443[_0x47d7('0x2d')]),'penalty':0x0,'paused':_0x2db443['smsPause'],'createdAt':_0x2db443[_0x47d7('0x5e')],'updatedAt':_0x2db443[_0x47d7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36e6ae,_0x271865))[_0x47d7('0x45')](handleError(_0x36e6ae,null));};exports[_0x47d7('0x61')]=function(_0x5223f6,_0x1966f2,_0x49df83){var _0x20717c={};var _0xb26916={};var _0xa8226c;var _0x3026a7;return db[_0x47d7('0x30')][_0x47d7('0x54')]({'where':{'id':_0x5223f6[_0x47d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x1966f2,null))['then'](function(_0x33b134){if(_0x33b134){_0xa8226c=_0x33b134;_0xb26916[_0x47d7('0x34')]=_[_0x47d7('0x36')](db[_0x47d7('0x62')][_0x47d7('0x31')]);_0xb26916[_0x47d7('0x35')]=_['keys'](_0x5223f6['query']);_0xb26916['filters']=_[_0x47d7('0x38')](_0xb26916['model'],_0xb26916[_0x47d7('0x35')]);_0x20717c[_0x47d7('0x39')]=_[_0x47d7('0x38')](_0xb26916['model'],qs['fields'](_0x5223f6[_0x47d7('0x35')][_0x47d7('0x3a')]));_0x20717c[_0x47d7('0x39')]=_0x20717c[_0x47d7('0x39')][_0x47d7('0x3b')]?_0x20717c[_0x47d7('0x39')]:_0xb26916['model'];_0x20717c[_0x47d7('0x3c')]=qs[_0x47d7('0x3d')](_0x5223f6[_0x47d7('0x35')][_0x47d7('0x3d')]);_0x20717c[_0x47d7('0x3e')]=qs[_0x47d7('0x37')](_[_0x47d7('0x58')](_0x5223f6['query'],_0xb26916['filters']));if(_0x5223f6['query']['filter']){_0x20717c[_0x47d7('0x3e')]=_[_0x47d7('0x40')](_0x20717c['where'],{'$or':_[_0x47d7('0x2f')](_0x20717c['attributes'],function(_0x558729){var _0x19d5c5={};_0x19d5c5[_0x558729]={'$like':'%'+_0x5223f6[_0x47d7('0x35')][_0x47d7('0x3f')]+'%'};return _0x19d5c5;})});}_0x20717c=_['merge']({},_0x20717c,_0x5223f6[_0x47d7('0x47')]);return _0xa8226c[_0x47d7('0x61')](_0x20717c);}})['then'](function(_0x2d4fd7){if(_0x2d4fd7){_0x3026a7=_0x2d4fd7[_0x47d7('0x3b')];if(!_0x5223f6[_0x47d7('0x35')][_0x47d7('0x56')](_0x47d7('0x57'))){_0x20717c['limit']=qs[_0x47d7('0x22')](_0x5223f6[_0x47d7('0x35')][_0x47d7('0x22')]);_0x20717c[_0x47d7('0x20')]=qs[_0x47d7('0x20')](_0x5223f6[_0x47d7('0x35')][_0x47d7('0x20')]);}return _0xa8226c[_0x47d7('0x61')](_0x20717c);}})[_0x47d7('0x27')](function(_0x237a13){if(_0x237a13){return _0x237a13?{'count':_0x3026a7,'rows':_0x237a13}:null;}})[_0x47d7('0x27')](respondWithResult(_0x1966f2,null))[_0x47d7('0x45')](handleError(_0x1966f2,null));};exports[_0x47d7('0x63')]=function(_0x1b294b,_0x3a7e41,_0x1b8a5f){var _0x4c1263=_0x1b294b[_0x47d7('0x4a')][_0x47d7('0x64')];return db[_0x47d7('0x62')][_0x47d7('0x43')]({'where':{'id':_0x4c1263},'attributes':['id'],'include':[{'model':db[_0x47d7('0x5a')],'as':'Agents','attributes':['id',_0x47d7('0x2d'),'online',_0x47d7('0x65'),'interface'],'raw':!![]}]})['then'](function(_0x167409){if(_0x167409){var _0x214692=_['flatMap'](_0x167409,function(_0x4ed91b){var _0x2b2f32=_0x4ed91b[_0x47d7('0x29')]({'plain':!![]});return _0x2b2f32[_0x47d7('0x66')];});return db[_0x47d7('0x30')]['find']({'where':{'id':_0x1b294b['params']['id']}})['then'](function(_0x4c7aff){return db['sequelize']['transaction'](function(_0x969880){return _0x4c7aff[_0x47d7('0x63')](_0x4c1263,{'transaction':_0x969880})['then'](function(){return BPromise[_0x47d7('0x67')](_0x214692,function(_0x5d52e7){return db[_0x47d7('0x55')]['findOrCreate']({'where':{'UserId':_0x5d52e7['id'],'SmsQueueId':_0x1b294b[_0x47d7('0x46')]['id']},'transaction':_0x969880});});})[_0x47d7('0x27')](function(){_0x214692[_0x47d7('0x68')](function(_0x2b4271){socket['emit'](_0x47d7('0x69'),{'UserId':_0x2b4271['id'],'SmsQueueId':_0x4c7aff['id']});});});});});}})[_0x47d7('0x27')](respondWithStatusCode(_0x3a7e41,null))[_0x47d7('0x45')](handleError(_0x3a7e41,null));};exports[_0x47d7('0x6a')]=function(_0xb65d08,_0x1807a0,_0x3c1f5f){return db[_0x47d7('0x62')][_0x47d7('0x43')]({'where':{'id':_0xb65d08[_0x47d7('0x35')][_0x47d7('0x64')]},'attributes':['id'],'include':[{'model':db[_0x47d7('0x5a')],'as':_0x47d7('0x66'),'attributes':['id'],'raw':!![]}]})[_0x47d7('0x27')](handleEntityNotFound(_0x1807a0,null))[_0x47d7('0x27')](function(_0x338543){var _0x44b525=_[_0x47d7('0x2f')](_0x338543,'id');var _0x1621cc=[];var _0x5d359a=[];var _0x639eeb=squel[_0x47d7('0x6b')]();_0x639eeb['field'](_0x47d7('0x6c'))[_0x47d7('0x6d')](_0x47d7('0x6e'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x47d7('0x3e')]('SmsQueueId\x20=\x20?',_0xb65d08[_0x47d7('0x46')]['id']);for(var _0x697719=0x0;_0x697719<_0x338543['length'];_0x697719+=0x1){let _0x158c08=_0x338543[_0x697719];for(var _0x2ec39c=0x0;_0x2ec39c<_0x158c08['Agents'][_0x47d7('0x3b')];_0x2ec39c+=0x1){let _0x32c8a3=_0x158c08[_0x47d7('0x66')][_0x2ec39c];var _0x47099a=_0x639eeb[_0x47d7('0x6f')]();_0x47099a[_0x47d7('0x3e')](_0x47d7('0x70'),_0x32c8a3['id']);_0x5d359a['push'](db[_0x47d7('0x71')][_0x47d7('0x35')](_0x47099a[_0x47d7('0x72')](),{'type':db[_0x47d7('0x71')][_0x47d7('0x73')]['SELECT']})[_0x47d7('0x27')](function(_0x5aec33){if(_0x5aec33[_0x47d7('0x3b')]===0x1){return _0x32c8a3['id'];}else{var _0x290b8b=_[_0x47d7('0x74')](_[_0x47d7('0x2f')](_0x5aec33,'TeamId'),function(_0x2d7f6e){return _['includes'](_0x44b525,_0x2d7f6e);});if(_0x290b8b){return _0x32c8a3['id'];}}}));}}return BPromise['all'](_0x5d359a)['then'](function(_0x1fd506){_0x1621cc=_(_0x1621cc)[_0x47d7('0x75')](_0x1fd506)[_0x47d7('0x76')]()[_0x47d7('0x77')]();return db[_0x47d7('0x30')]['find']({'where':{'id':_0xb65d08[_0x47d7('0x46')]['id']}})['then'](function(_0x41f241){return db[_0x47d7('0x71')][_0x47d7('0x78')](function(_0x51fe15){return _0x41f241[_0x47d7('0x6a')](_0xb65d08[_0x47d7('0x35')][_0x47d7('0x64')],{'transaction':_0x51fe15})[_0x47d7('0x27')](function(){if(!_[_0x47d7('0x79')](_0x1621cc)){return _0x41f241['removeAgents'](_0x1621cc,{'transaction':_0x51fe15});}})[_0x47d7('0x27')](function(){_0x1621cc[_0x47d7('0x68')](function(_0x1ca0f6){socket[_0x47d7('0x7a')](_0x47d7('0x7b'),{'UserId':_0x1ca0f6,'SmsQueueId':_0x41f241['id']});});});});});});})[_0x47d7('0x27')](respondWithStatusCode(_0x1807a0,null))[_0x47d7('0x45')](handleError(_0x1807a0,null));};exports['addAgents']=function(_0x282dc5,_0x5de1e7,_0x52bb9b){return db[_0x47d7('0x30')][_0x47d7('0x48')]({'where':{'id':_0x282dc5[_0x47d7('0x46')]['id']}})[_0x47d7('0x27')](handleEntityNotFound(_0x5de1e7,null))[_0x47d7('0x27')](function(_0x54e3b3){if(_0x54e3b3){return _0x54e3b3[_0x47d7('0x7c')](_0x282dc5[_0x47d7('0x4a')][_0x47d7('0x64')],_['omit'](_0x282dc5[_0x47d7('0x4a')],[_0x47d7('0x64'),'id'])||{})[_0x47d7('0x7d')](function(_0x4fcc45){for(var _0x2b437e=0x0;_0x2b437e<_0x282dc5[_0x47d7('0x4a')][_0x47d7('0x64')][_0x47d7('0x3b')];_0x2b437e+=0x1){socket['emit'](_0x47d7('0x69'),{'UserId':Number(_0x282dc5[_0x47d7('0x4a')][_0x47d7('0x64')][_0x2b437e]),'SmsQueueId':Number(_0x282dc5[_0x47d7('0x46')]['id'])});}return _0x4fcc45;});}})[_0x47d7('0x27')](respondWithResult(_0x5de1e7,null))[_0x47d7('0x45')](handleError(_0x5de1e7,null));};exports[_0x47d7('0x7e')]=function(_0x240551,_0x594bda,_0x268c8d){return db[_0x47d7('0x30')][_0x47d7('0x48')]({'where':{'id':_0x240551[_0x47d7('0x46')]['id']}})[_0x47d7('0x27')](handleEntityNotFound(_0x594bda,null))[_0x47d7('0x27')](function(_0x2495ec){if(_0x2495ec){return _0x2495ec['removeAgents'](_0x240551['query'][_0x47d7('0x64')])[_0x47d7('0x27')](function(){if(_[_0x47d7('0x7f')](_0x240551['query']['ids'])){for(var _0x2cb722=0x0;_0x2cb722<_0x240551[_0x47d7('0x35')][_0x47d7('0x64')][_0x47d7('0x3b')];_0x2cb722+=0x1){socket[_0x47d7('0x7a')](_0x47d7('0x7b'),{'UserId':Number(_0x240551[_0x47d7('0x35')][_0x47d7('0x64')][_0x2cb722]),'SmsQueueId':Number(_0x240551['params']['id'])});}}else{socket[_0x47d7('0x7a')](_0x47d7('0x7b'),{'UserId':Number(_0x240551[_0x47d7('0x35')]['ids']),'SmsQueueId':Number(_0x240551[_0x47d7('0x46')]['id'])});}});}})[_0x47d7('0x27')](respondWithStatusCode(_0x594bda,null))['catch'](handleError(_0x594bda,null));};exports[_0x47d7('0x80')]=function(_0x3a0891,_0x38edb7,_0x28cc22){var _0xe9df0={};var _0x5e74b0={};var _0x506d79;var _0x5d1094;return db[_0x47d7('0x30')][_0x47d7('0x54')]({'where':{'id':_0x3a0891[_0x47d7('0x46')]['id']}})[_0x47d7('0x27')](handleEntityNotFound(_0x38edb7,null))['then'](function(_0x1fd529){if(_0x1fd529){_0x506d79=_0x1fd529;_0x5e74b0[_0x47d7('0x34')]=_['keys'](db[_0x47d7('0x5a')][_0x47d7('0x31')]);_0x5e74b0[_0x47d7('0x35')]=_[_0x47d7('0x36')](_0x3a0891[_0x47d7('0x35')]);_0x5e74b0[_0x47d7('0x37')]=_['intersection'](_0x5e74b0['model'],_0x5e74b0[_0x47d7('0x35')]);_0xe9df0[_0x47d7('0x39')]=_[_0x47d7('0x38')](_0x5e74b0['model'],qs[_0x47d7('0x3a')](_0x3a0891[_0x47d7('0x35')][_0x47d7('0x3a')]));_0xe9df0[_0x47d7('0x39')]=_0xe9df0[_0x47d7('0x39')][_0x47d7('0x3b')]?_0xe9df0[_0x47d7('0x39')]:_0x5e74b0[_0x47d7('0x34')];_0xe9df0['order']=qs[_0x47d7('0x3d')](_0x3a0891['query'][_0x47d7('0x3d')]);_0xe9df0[_0x47d7('0x3e')]=qs['filters'](_[_0x47d7('0x58')](_0x3a0891[_0x47d7('0x35')],_0x5e74b0['filters']));if(_0x3a0891[_0x47d7('0x35')][_0x47d7('0x3f')]){_0xe9df0[_0x47d7('0x3e')]=_[_0x47d7('0x40')](_0xe9df0[_0x47d7('0x3e')],{'$or':_[_0x47d7('0x2f')](_0xe9df0[_0x47d7('0x39')],function(_0xa84498){var _0xe6d65b={};_0xe6d65b[_0xa84498]={'$like':'%'+_0x3a0891['query'][_0x47d7('0x3f')]+'%'};return _0xe6d65b;})});}_0xe9df0=_[_0x47d7('0x40')]({},_0xe9df0,_0x3a0891[_0x47d7('0x47')]);return _0x506d79[_0x47d7('0x80')](_0xe9df0);}})[_0x47d7('0x27')](function(_0x233705){if(_0x233705){_0x5d1094=_0x233705['length'];if(!_0x3a0891[_0x47d7('0x35')][_0x47d7('0x56')](_0x47d7('0x57'))){_0xe9df0[_0x47d7('0x22')]=qs['limit'](_0x3a0891[_0x47d7('0x35')]['limit']);_0xe9df0['offset']=qs[_0x47d7('0x20')](_0x3a0891[_0x47d7('0x35')][_0x47d7('0x20')]);}return _0x506d79['getAgents'](_0xe9df0);}})[_0x47d7('0x27')](function(_0x1b2bd2){if(_0x1b2bd2){return _0x1b2bd2?{'count':_0x5d1094,'rows':_0x1b2bd2}:null;}})[_0x47d7('0x27')](respondWithResult(_0x38edb7,null))[_0x47d7('0x45')](handleError(_0x38edb7,null));}; \ No newline at end of file +var _0xa051=['json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','end','name','index','map','SmsQueue','rawAttributes','fieldName','type','query','attributes','model','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','show','keys','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserSmsQueue','intersection','hasOwnProperty','pick','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','findOne','Team','User','Agents','online','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','emit','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus'];(function(_0x14d2e5,_0x47a63d){var _0x39432a=function(_0x4968d2){while(--_0x4968d2){_0x14d2e5['push'](_0x14d2e5['shift']());}};_0x39432a(++_0x47a63d);}(_0xa051,0x189));var _0x1a05=function(_0x1351d5,_0x1d07d4){_0x1351d5=_0x1351d5-0x0;var _0x31c1f2=_0xa051[_0x1351d5];return _0x31c1f2;};'use strict';var emlformat=require(_0x1a05('0x0'));var rimraf=require(_0x1a05('0x1'));var zipdir=require(_0x1a05('0x2'));var jsonpatch=require(_0x1a05('0x3'));var rp=require(_0x1a05('0x4'));var moment=require(_0x1a05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1a05('0x6'));var util=require(_0x1a05('0x7'));var path=require(_0x1a05('0x8'));var sox=require('sox');var csv=require(_0x1a05('0x9'));var ejs=require(_0x1a05('0xa'));var fs=require('fs');var fs_extra=require(_0x1a05('0xb'));var _=require(_0x1a05('0xc'));var squel=require(_0x1a05('0xd'));var crypto=require(_0x1a05('0xe'));var jsforce=require(_0x1a05('0xf'));var deskjs=require(_0x1a05('0x10'));var toCsv=require(_0x1a05('0x9'));var querystring=require('querystring');var Papa=require(_0x1a05('0x11'));var Redis=require(_0x1a05('0x12'));var authService=require(_0x1a05('0x13'));var qs=require(_0x1a05('0x14'));var as=require(_0x1a05('0x15'));var hardwareService=require(_0x1a05('0x16'));var logger=require(_0x1a05('0x17'))(_0x1a05('0x18'));var utils=require(_0x1a05('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1a05('0x1a'));var db=require('../../mysqldb')['db'];config[_0x1a05('0x1b')]=_['defaults'](config[_0x1a05('0x1b')],{'host':_0x1a05('0x1c'),'port':0x18eb});var socket=require(_0x1a05('0x1d'))(new Redis(config[_0x1a05('0x1b')]));require(_0x1a05('0x1e'))[_0x1a05('0x1f')](socket);function respondWithStatusCode(_0x1a618d,_0x143a08){_0x143a08=_0x143a08||0xcc;return function(_0x42add4){if(_0x42add4){return _0x1a618d[_0x1a05('0x20')](_0x143a08);}return _0x1a618d['status'](_0x143a08)['end']();};}function respondWithResult(_0x5db0e0,_0x399109){_0x399109=_0x399109||0xc8;return function(_0x590bbf){if(_0x590bbf){return _0x5db0e0['status'](_0x399109)[_0x1a05('0x21')](_0x590bbf);}};}function respondWithFilteredResult(_0x3ab033,_0x381a32){return function(_0x2aa415){if(_0x2aa415){var _0x376a00=typeof _0x381a32[_0x1a05('0x22')]===_0x1a05('0x23')&&typeof _0x381a32[_0x1a05('0x24')]==='undefined';var _0x42763c=_0x2aa415[_0x1a05('0x25')];var _0x443c51=_0x376a00?0x0:_0x381a32[_0x1a05('0x22')];var _0x3efc9a=_0x376a00?_0x2aa415[_0x1a05('0x25')]:_0x381a32[_0x1a05('0x22')]+_0x381a32[_0x1a05('0x24')];var _0x12399e;if(_0x3efc9a>=_0x42763c){_0x3efc9a=_0x42763c;_0x12399e=0xc8;}else{_0x12399e=0xce;}_0x3ab033[_0x1a05('0x26')](_0x12399e);return _0x3ab033[_0x1a05('0x27')](_0x1a05('0x28'),_0x443c51+'-'+_0x3efc9a+'/'+_0x42763c)[_0x1a05('0x21')](_0x2aa415);}return null;};}function patchUpdates(_0x2a9b0b){return function(_0x43d9ce){try{jsonpatch[_0x1a05('0x29')](_0x43d9ce,_0x2a9b0b,!![]);}catch(_0x267db2){return BPromise[_0x1a05('0x2a')](_0x267db2);}return _0x43d9ce[_0x1a05('0x2b')]();};}function saveUpdates(_0x4470ad,_0x13eb9f){return function(_0x4d08e9){if(_0x4d08e9){return _0x4d08e9[_0x1a05('0x2c')](_0x4470ad)[_0x1a05('0x2d')](function(_0x49ee98){return _0x49ee98;});}return null;};}function removeEntity(_0x4260e6,_0x108de8){return function(_0x1b8bbf){if(_0x1b8bbf){return _0x1b8bbf[_0x1a05('0x2e')]()[_0x1a05('0x2d')](function(){var _0x29a95c=_0x1b8bbf[_0x1a05('0x2f')]({'plain':!![]});var _0x22d4cd='SmsQueues';return db['UserProfileResource'][_0x1a05('0x2e')]({'where':{'type':_0x22d4cd,'resourceId':_0x29a95c['id']}})[_0x1a05('0x2d')](function(){return _0x1b8bbf;});})['then'](function(){_0x4260e6[_0x1a05('0x26')](0xcc)[_0x1a05('0x30')]();});}};}function handleEntityNotFound(_0x2fa244,_0x44c97c){return function(_0x39d209){if(!_0x39d209){_0x2fa244[_0x1a05('0x20')](0x194);}return _0x39d209;};}function handleError(_0x294d97,_0x4bac9d){_0x4bac9d=_0x4bac9d||0x1f4;return function(_0x1c73ee){logger['error'](_0x1c73ee['stack']);if(_0x1c73ee[_0x1a05('0x31')]){delete _0x1c73ee[_0x1a05('0x31')];}_0x294d97[_0x1a05('0x26')](_0x4bac9d)['send'](_0x1c73ee);};}exports[_0x1a05('0x32')]=function(_0x23d6ee,_0x17c0db){var _0x129761={},_0x1a5d7e={},_0x466253={'count':0x0,'rows':[]};var _0x4393c3=_[_0x1a05('0x33')](db[_0x1a05('0x34')][_0x1a05('0x35')],function(_0x2a9957){return{'name':_0x2a9957[_0x1a05('0x36')],'type':_0x2a9957[_0x1a05('0x37')]['key']};});_0x1a5d7e['model']=_[_0x1a05('0x33')](_0x4393c3,_0x1a05('0x31'));_0x1a5d7e[_0x1a05('0x38')]=_['keys'](_0x23d6ee[_0x1a05('0x38')]);_0x1a5d7e['filters']=_['intersection'](_0x1a5d7e['model'],_0x1a5d7e['query']);_0x129761[_0x1a05('0x39')]=_['intersection'](_0x1a5d7e[_0x1a05('0x3a')],qs['fields'](_0x23d6ee[_0x1a05('0x38')][_0x1a05('0x3b')]));_0x129761[_0x1a05('0x39')]=_0x129761[_0x1a05('0x39')][_0x1a05('0x3c')]?_0x129761['attributes']:_0x1a5d7e[_0x1a05('0x3a')];if(!_0x23d6ee[_0x1a05('0x38')]['hasOwnProperty'](_0x1a05('0x3d'))){_0x129761[_0x1a05('0x24')]=qs[_0x1a05('0x24')](_0x23d6ee[_0x1a05('0x38')][_0x1a05('0x24')]);_0x129761[_0x1a05('0x22')]=qs[_0x1a05('0x22')](_0x23d6ee['query']['offset']);}_0x129761[_0x1a05('0x3e')]=qs[_0x1a05('0x3f')](_0x23d6ee[_0x1a05('0x38')][_0x1a05('0x3f')]);_0x129761[_0x1a05('0x40')]=qs[_0x1a05('0x41')](_['pick'](_0x23d6ee['query'],_0x1a5d7e['filters']),_0x4393c3);if(_0x23d6ee[_0x1a05('0x38')][_0x1a05('0x42')]){_0x129761[_0x1a05('0x40')]=_[_0x1a05('0x43')](_0x129761[_0x1a05('0x40')],{'$or':_[_0x1a05('0x33')](_0x4393c3,function(_0x1e7a96){if(_0x1e7a96[_0x1a05('0x37')]!==_0x1a05('0x44')){var _0x65cd14={};_0x65cd14[_0x1e7a96[_0x1a05('0x31')]]={'$like':'%'+_0x23d6ee[_0x1a05('0x38')]['filter']+'%'};return _0x65cd14;}})});}_0x129761=_[_0x1a05('0x43')]({},_0x129761,_0x23d6ee[_0x1a05('0x45')]);var _0x49b8cd={'where':_0x129761[_0x1a05('0x40')]};return db[_0x1a05('0x34')][_0x1a05('0x25')](_0x49b8cd)['then'](function(_0x582b96){_0x466253[_0x1a05('0x25')]=_0x582b96;if(_0x23d6ee[_0x1a05('0x38')]['includeAll']){_0x129761['include']=[{'all':!![]}];}return db['SmsQueue'][_0x1a05('0x46')](_0x129761);})[_0x1a05('0x2d')](function(_0x17eb0c){_0x466253['rows']=_0x17eb0c;return _0x466253;})[_0x1a05('0x2d')](respondWithFilteredResult(_0x17c0db,_0x129761))['catch'](handleError(_0x17c0db,null));};exports[_0x1a05('0x47')]=function(_0xa3f19f,_0x5465df){var _0x2ebd42={'raw':!![],'where':{'id':_0xa3f19f['params']['id']}},_0x113fed={};_0x113fed[_0x1a05('0x3a')]=_[_0x1a05('0x48')](db[_0x1a05('0x34')][_0x1a05('0x35')]);_0x113fed['query']=_[_0x1a05('0x48')](_0xa3f19f[_0x1a05('0x38')]);_0x113fed['filters']=_['intersection'](_0x113fed[_0x1a05('0x3a')],_0x113fed['query']);_0x2ebd42[_0x1a05('0x39')]=_['intersection'](_0x113fed[_0x1a05('0x3a')],qs[_0x1a05('0x3b')](_0xa3f19f['query'][_0x1a05('0x3b')]));_0x2ebd42['attributes']=_0x2ebd42[_0x1a05('0x39')]['length']?_0x2ebd42[_0x1a05('0x39')]:_0x113fed[_0x1a05('0x3a')];if(_0xa3f19f[_0x1a05('0x38')][_0x1a05('0x49')]){_0x2ebd42[_0x1a05('0x4a')]=[{'all':!![]}];}_0x2ebd42=_['merge']({},_0x2ebd42,_0xa3f19f[_0x1a05('0x45')]);return db['SmsQueue'][_0x1a05('0x4b')](_0x2ebd42)[_0x1a05('0x2d')](handleEntityNotFound(_0x5465df,null))[_0x1a05('0x2d')](respondWithResult(_0x5465df,null))[_0x1a05('0x4c')](handleError(_0x5465df,null));};exports[_0x1a05('0x4d')]=function(_0x4e47cc,_0x162e1b){return db[_0x1a05('0x34')][_0x1a05('0x4d')](_0x4e47cc['body'],{})['then'](function(_0x3d6c69){var _0xe6c7bb=_0x4e47cc['user'][_0x1a05('0x2f')]({'plain':!![]});if(!_0xe6c7bb)throw new Error(_0x1a05('0x4e'));if(_0xe6c7bb[_0x1a05('0x4f')]==='user'){var _0x28860b=_0x3d6c69['get']({'plain':!![]});var _0x111e9c=_0x1a05('0x50');return db[_0x1a05('0x51')][_0x1a05('0x4b')]({'where':{'name':_0x111e9c,'userProfileId':_0xe6c7bb[_0x1a05('0x52')]},'raw':!![]})[_0x1a05('0x2d')](function(_0x2dbcdc){if(_0x2dbcdc&&_0x2dbcdc[_0x1a05('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x28860b[_0x1a05('0x31')],'resourceId':_0x28860b['id'],'type':_0x2dbcdc[_0x1a05('0x31')],'sectionId':_0x2dbcdc['id']},{})['then'](function(){return _0x3d6c69;});}else{return _0x3d6c69;}})['catch'](function(_0x4c8bb0){logger[_0x1a05('0x54')](_0x1a05('0x55'),_0x4c8bb0);throw _0x4c8bb0;});}return _0x3d6c69;})[_0x1a05('0x2d')](respondWithResult(_0x162e1b,0xc9))[_0x1a05('0x4c')](handleError(_0x162e1b,null));};exports[_0x1a05('0x2c')]=function(_0x3e2003,_0xecf434){if(_0x3e2003[_0x1a05('0x56')]['id']){delete _0x3e2003[_0x1a05('0x56')]['id'];}return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0x3e2003[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0xecf434,null))['then'](saveUpdates(_0x3e2003[_0x1a05('0x56')],null))[_0x1a05('0x2d')](respondWithResult(_0xecf434,null))[_0x1a05('0x4c')](handleError(_0xecf434,null));};exports[_0x1a05('0x2e')]=function(_0x11fae2,_0x433de){return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0x11fae2['params']['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x433de,null))['then'](removeEntity(_0x433de,null))[_0x1a05('0x4c')](handleError(_0x433de,null));};exports[_0x1a05('0x58')]=function(_0x3904dc,_0x579077){return db[_0x1a05('0x34')][_0x1a05('0x58')]()[_0x1a05('0x2d')](respondWithResult(_0x579077,null))['catch'](handleError(_0x579077,null));};exports[_0x1a05('0x59')]=function(_0x4c3688,_0x19ec11,_0x1faed7){var _0x378a3f={'raw':!![],'where':{}},_0x1ed73f={},_0x12f15c;return db['SmsQueue']['findOne']({'where':{'id':_0x4c3688[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x19ec11,null))[_0x1a05('0x2d')](function(_0x3b4b07){if(_0x3b4b07){_0x12f15c=_0x3b4b07[_0x1a05('0x2f')]({'plain':!![]});_0x1ed73f['model']=_[_0x1a05('0x48')](db[_0x1a05('0x5a')]['rawAttributes']);_0x1ed73f[_0x1a05('0x38')]=_[_0x1a05('0x48')](_0x4c3688[_0x1a05('0x38')]);_0x1ed73f[_0x1a05('0x41')]=_[_0x1a05('0x5b')](_0x1ed73f[_0x1a05('0x3a')],_0x1ed73f[_0x1a05('0x38')]);_0x378a3f[_0x1a05('0x39')]=_[_0x1a05('0x5b')](_0x1ed73f[_0x1a05('0x3a')],qs[_0x1a05('0x3b')](_0x4c3688['query'][_0x1a05('0x3b')]));_0x378a3f[_0x1a05('0x39')]=_0x378a3f[_0x1a05('0x39')][_0x1a05('0x3c')]?_0x378a3f[_0x1a05('0x39')]:_0x1ed73f[_0x1a05('0x3a')];if(!_0x4c3688[_0x1a05('0x38')][_0x1a05('0x5c')]('nolimit')){_0x378a3f['limit']=qs['limit'](_0x4c3688['query'][_0x1a05('0x24')]);_0x378a3f['offset']=qs['offset'](_0x4c3688[_0x1a05('0x38')][_0x1a05('0x22')]);}_0x378a3f[_0x1a05('0x3e')]=qs['sort'](_0x4c3688[_0x1a05('0x38')][_0x1a05('0x3f')]);_0x378a3f[_0x1a05('0x40')]=qs['filters'](_[_0x1a05('0x5d')](_0x4c3688[_0x1a05('0x38')],_0x1ed73f[_0x1a05('0x41')]));_0x378a3f[_0x1a05('0x40')][_0x1a05('0x5e')]=_0x3b4b07['id'];if(_0x4c3688[_0x1a05('0x38')][_0x1a05('0x42')]){_0x378a3f['where']=_[_0x1a05('0x43')](_0x378a3f['where'],{'$or':_[_0x1a05('0x33')](_0x378a3f[_0x1a05('0x39')],function(_0x156734){var _0x5d6dc4={};_0x5d6dc4[_0x156734]={'$like':'%'+_0x4c3688[_0x1a05('0x38')][_0x1a05('0x42')]+'%'};return _0x5d6dc4;})});}_0x378a3f=_[_0x1a05('0x43')]({},_0x378a3f,_0x4c3688[_0x1a05('0x45')]);return db['UserSmsQueue'][_0x1a05('0x46')](_0x378a3f);}})[_0x1a05('0x2d')](function(_0x27b5eb){if(_0x27b5eb){return db['User'][_0x1a05('0x5f')]({'where':{'id':_[_0x1a05('0x33')](_0x27b5eb,_0x1a05('0x60')),'role':_0x1a05('0x61')},'attributes':['id',_0x1a05('0x31'),_0x1a05('0x62'),_0x1a05('0x63'),_0x1a05('0x64')]});}})[_0x1a05('0x2d')](function(_0x42b072){if(_0x42b072){return{'count':_0x42b072[_0x1a05('0x25')],'rows':_[_0x1a05('0x33')](_0x42b072[_0x1a05('0x65')],function(_0xa5499b){return{'membername':_0xa5499b['name'],'UserId':_0xa5499b['id'],'queue_name':_0x12f15c[_0x1a05('0x31')],'SmsQueueId':_0x12f15c['id'],'interface':util['format']('%s/%s','SIP',_0xa5499b[_0x1a05('0x31')]),'penalty':0x0,'paused':_0xa5499b[_0x1a05('0x62')],'createdAt':_0xa5499b[_0x1a05('0x64')],'updatedAt':_0xa5499b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a05('0x2d')](respondWithFilteredResult(_0x19ec11,_0x378a3f))[_0x1a05('0x4c')](handleError(_0x19ec11,null));};exports['getTeams']=function(_0x207101,_0x15ce20,_0x304683){var _0x2c604d={};var _0x56b747={};var _0x59385c;var _0x126a77;return db[_0x1a05('0x34')][_0x1a05('0x66')]({'where':{'id':_0x207101[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x15ce20,null))[_0x1a05('0x2d')](function(_0x1fd397){if(_0x1fd397){_0x59385c=_0x1fd397;_0x56b747[_0x1a05('0x3a')]=_[_0x1a05('0x48')](db[_0x1a05('0x67')][_0x1a05('0x35')]);_0x56b747['query']=_['keys'](_0x207101[_0x1a05('0x38')]);_0x56b747[_0x1a05('0x41')]=_[_0x1a05('0x5b')](_0x56b747['model'],_0x56b747[_0x1a05('0x38')]);_0x2c604d[_0x1a05('0x39')]=_[_0x1a05('0x5b')](_0x56b747[_0x1a05('0x3a')],qs['fields'](_0x207101[_0x1a05('0x38')][_0x1a05('0x3b')]));_0x2c604d['attributes']=_0x2c604d[_0x1a05('0x39')][_0x1a05('0x3c')]?_0x2c604d[_0x1a05('0x39')]:_0x56b747[_0x1a05('0x3a')];_0x2c604d[_0x1a05('0x3e')]=qs['sort'](_0x207101[_0x1a05('0x38')]['sort']);_0x2c604d[_0x1a05('0x40')]=qs[_0x1a05('0x41')](_[_0x1a05('0x5d')](_0x207101[_0x1a05('0x38')],_0x56b747[_0x1a05('0x41')]));if(_0x207101['query']['filter']){_0x2c604d[_0x1a05('0x40')]=_[_0x1a05('0x43')](_0x2c604d['where'],{'$or':_['map'](_0x2c604d[_0x1a05('0x39')],function(_0x5be1a6){var _0x3792cd={};_0x3792cd[_0x5be1a6]={'$like':'%'+_0x207101['query'][_0x1a05('0x42')]+'%'};return _0x3792cd;})});}_0x2c604d=_[_0x1a05('0x43')]({},_0x2c604d,_0x207101[_0x1a05('0x45')]);return _0x59385c['getTeams'](_0x2c604d);}})[_0x1a05('0x2d')](function(_0x3a6e66){if(_0x3a6e66){_0x126a77=_0x3a6e66[_0x1a05('0x3c')];if(!_0x207101[_0x1a05('0x38')]['hasOwnProperty']('nolimit')){_0x2c604d['limit']=qs['limit'](_0x207101[_0x1a05('0x38')][_0x1a05('0x24')]);_0x2c604d[_0x1a05('0x22')]=qs[_0x1a05('0x22')](_0x207101[_0x1a05('0x38')]['offset']);}return _0x59385c['getTeams'](_0x2c604d);}})[_0x1a05('0x2d')](function(_0x3a4bc1){if(_0x3a4bc1){return _0x3a4bc1?{'count':_0x126a77,'rows':_0x3a4bc1}:null;}})[_0x1a05('0x2d')](respondWithResult(_0x15ce20,null))[_0x1a05('0x4c')](handleError(_0x15ce20,null));};exports['addTeams']=function(_0x5630a1,_0x8e9e23,_0x97fe44){var _0x1523a0=_0x5630a1[_0x1a05('0x56')]['ids'];return db[_0x1a05('0x67')][_0x1a05('0x46')]({'where':{'id':_0x1523a0},'attributes':['id'],'include':[{'model':db[_0x1a05('0x68')],'as':_0x1a05('0x69'),'attributes':['id',_0x1a05('0x31'),_0x1a05('0x6a'),_0x1a05('0x6b'),_0x1a05('0x6c')],'raw':!![]}]})['then'](function(_0x1d3575){if(_0x1d3575){var _0x37199d=_['flatMap'](_0x1d3575,function(_0x248ea4){var _0x1b6939=_0x248ea4['get']({'plain':!![]});return _0x1b6939[_0x1a05('0x69')];});return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0x5630a1[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](function(_0x312861){return db[_0x1a05('0x6d')][_0x1a05('0x6e')](function(_0x1ecdbf){return _0x312861[_0x1a05('0x6f')](_0x1523a0,{'transaction':_0x1ecdbf})['then'](function(){return BPromise['each'](_0x37199d,function(_0x200251){return db[_0x1a05('0x5a')][_0x1a05('0x70')]({'where':{'UserId':_0x200251['id'],'SmsQueueId':_0x5630a1[_0x1a05('0x57')]['id']},'transaction':_0x1ecdbf});});})[_0x1a05('0x2d')](function(){_0x37199d['forEach'](function(_0x5185fb){socket[_0x1a05('0x71')](_0x1a05('0x72'),{'UserId':_0x5185fb['id'],'SmsQueueId':_0x312861['id']});});});});});}})[_0x1a05('0x2d')](respondWithStatusCode(_0x8e9e23,null))[_0x1a05('0x4c')](handleError(_0x8e9e23,null));};exports[_0x1a05('0x73')]=function(_0x4af647,_0x337b9b,_0x495cac){return db['Team'][_0x1a05('0x46')]({'where':{'id':_0x4af647[_0x1a05('0x38')][_0x1a05('0x74')]},'attributes':['id'],'include':[{'model':db[_0x1a05('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1a05('0x2d')](handleEntityNotFound(_0x337b9b,null))['then'](function(_0x5c2b26){var _0x169bf8=_['map'](_0x5c2b26,'id');var _0x5211aa=[];var _0x3f2958=[];var _0x1891a8=squel[_0x1a05('0x75')]();_0x1891a8['field'](_0x1a05('0x76'))[_0x1a05('0x77')](_0x1a05('0x78'),'tq')[_0x1a05('0x79')]('user_has_teams','ut',_0x1a05('0x7a'))[_0x1a05('0x40')]('SmsQueueId\x20=\x20?',_0x4af647[_0x1a05('0x57')]['id']);for(var _0x46dae9=0x0;_0x46dae9<_0x5c2b26['length'];_0x46dae9+=0x1){let _0x1e592a=_0x5c2b26[_0x46dae9];for(var _0x40782e=0x0;_0x40782e<_0x1e592a[_0x1a05('0x69')][_0x1a05('0x3c')];_0x40782e+=0x1){let _0x257854=_0x1e592a[_0x1a05('0x69')][_0x40782e];var _0x3cc392=_0x1891a8[_0x1a05('0x7b')]();_0x3cc392[_0x1a05('0x40')](_0x1a05('0x7c'),_0x257854['id']);_0x3f2958[_0x1a05('0x7d')](db[_0x1a05('0x6d')][_0x1a05('0x38')](_0x3cc392[_0x1a05('0x7e')](),{'type':db[_0x1a05('0x6d')]['QueryTypes'][_0x1a05('0x7f')]})[_0x1a05('0x2d')](function(_0x42e695){if(_0x42e695['length']===0x1){return _0x257854['id'];}else{var _0x2a4f33=_[_0x1a05('0x80')](_['map'](_0x42e695,_0x1a05('0x81')),function(_0x18cfb7){return _[_0x1a05('0x82')](_0x169bf8,_0x18cfb7);});if(_0x2a4f33){return _0x257854['id'];}}}));}}return BPromise[_0x1a05('0x83')](_0x3f2958)[_0x1a05('0x2d')](function(_0x17987f){_0x5211aa=_(_0x5211aa)[_0x1a05('0x84')](_0x17987f)[_0x1a05('0x85')]()[_0x1a05('0x86')]();return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0x4af647[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](function(_0x1197ef){return db[_0x1a05('0x6d')][_0x1a05('0x6e')](function(_0x2ce429){return _0x1197ef['removeTeams'](_0x4af647[_0x1a05('0x38')][_0x1a05('0x74')],{'transaction':_0x2ce429})['then'](function(){if(!_[_0x1a05('0x87')](_0x5211aa)){return _0x1197ef[_0x1a05('0x88')](_0x5211aa,{'transaction':_0x2ce429});}})['then'](function(){_0x5211aa['forEach'](function(_0x3c3b9f){socket['emit'](_0x1a05('0x89'),{'UserId':_0x3c3b9f,'SmsQueueId':_0x1197ef['id']});});});});});});})[_0x1a05('0x2d')](respondWithStatusCode(_0x337b9b,null))[_0x1a05('0x4c')](handleError(_0x337b9b,null));};exports[_0x1a05('0x8a')]=function(_0xe856d7,_0x29421a,_0x33a07d){return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0xe856d7[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x29421a,null))[_0x1a05('0x2d')](function(_0x1dff23){if(_0x1dff23){return _0x1dff23['addAgents'](_0xe856d7['body'][_0x1a05('0x74')],_[_0x1a05('0x8b')](_0xe856d7[_0x1a05('0x56')],[_0x1a05('0x74'),'id'])||{})[_0x1a05('0x8c')](function(_0x503a70){for(var _0x48b99e=0x0;_0x48b99e<_0xe856d7[_0x1a05('0x56')][_0x1a05('0x74')]['length'];_0x48b99e+=0x1){socket['emit'](_0x1a05('0x72'),{'UserId':Number(_0xe856d7[_0x1a05('0x56')]['ids'][_0x48b99e]),'SmsQueueId':Number(_0xe856d7[_0x1a05('0x57')]['id'])});}return _0x503a70;});}})[_0x1a05('0x2d')](respondWithResult(_0x29421a,null))['catch'](handleError(_0x29421a,null));};exports[_0x1a05('0x88')]=function(_0x52de89,_0x320b99,_0x112684){return db[_0x1a05('0x34')][_0x1a05('0x4b')]({'where':{'id':_0x52de89[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x320b99,null))[_0x1a05('0x2d')](function(_0x3edde1){if(_0x3edde1){return _0x3edde1[_0x1a05('0x88')](_0x52de89[_0x1a05('0x38')][_0x1a05('0x74')])['then'](function(){if(_['isArray'](_0x52de89[_0x1a05('0x38')][_0x1a05('0x74')])){for(var _0x3d2537=0x0;_0x3d2537<_0x52de89[_0x1a05('0x38')]['ids']['length'];_0x3d2537+=0x1){socket[_0x1a05('0x71')](_0x1a05('0x89'),{'UserId':Number(_0x52de89['query']['ids'][_0x3d2537]),'SmsQueueId':Number(_0x52de89['params']['id'])});}}else{socket[_0x1a05('0x71')](_0x1a05('0x89'),{'UserId':Number(_0x52de89['query'][_0x1a05('0x74')]),'SmsQueueId':Number(_0x52de89[_0x1a05('0x57')]['id'])});}});}})[_0x1a05('0x2d')](respondWithStatusCode(_0x320b99,null))[_0x1a05('0x4c')](handleError(_0x320b99,null));};exports[_0x1a05('0x8d')]=function(_0x2480c7,_0x1b155d,_0x48f1a1){var _0x5373ae={};var _0x1e2fe7={};var _0xe4974b;var _0x40221d;return db[_0x1a05('0x34')][_0x1a05('0x66')]({'where':{'id':_0x2480c7[_0x1a05('0x57')]['id']}})[_0x1a05('0x2d')](handleEntityNotFound(_0x1b155d,null))['then'](function(_0x571e78){if(_0x571e78){_0xe4974b=_0x571e78;_0x1e2fe7[_0x1a05('0x3a')]=_[_0x1a05('0x48')](db[_0x1a05('0x68')][_0x1a05('0x35')]);_0x1e2fe7[_0x1a05('0x38')]=_[_0x1a05('0x48')](_0x2480c7['query']);_0x1e2fe7[_0x1a05('0x41')]=_['intersection'](_0x1e2fe7[_0x1a05('0x3a')],_0x1e2fe7[_0x1a05('0x38')]);_0x5373ae['attributes']=_[_0x1a05('0x5b')](_0x1e2fe7[_0x1a05('0x3a')],qs[_0x1a05('0x3b')](_0x2480c7[_0x1a05('0x38')][_0x1a05('0x3b')]));_0x5373ae[_0x1a05('0x39')]=_0x5373ae[_0x1a05('0x39')]['length']?_0x5373ae['attributes']:_0x1e2fe7['model'];_0x5373ae[_0x1a05('0x3e')]=qs[_0x1a05('0x3f')](_0x2480c7[_0x1a05('0x38')]['sort']);_0x5373ae[_0x1a05('0x40')]=qs[_0x1a05('0x41')](_[_0x1a05('0x5d')](_0x2480c7[_0x1a05('0x38')],_0x1e2fe7[_0x1a05('0x41')]));if(_0x2480c7[_0x1a05('0x38')]['filter']){_0x5373ae[_0x1a05('0x40')]=_[_0x1a05('0x43')](_0x5373ae['where'],{'$or':_[_0x1a05('0x33')](_0x5373ae['attributes'],function(_0x212988){var _0x51a732={};_0x51a732[_0x212988]={'$like':'%'+_0x2480c7[_0x1a05('0x38')][_0x1a05('0x42')]+'%'};return _0x51a732;})});}_0x5373ae=_[_0x1a05('0x43')]({},_0x5373ae,_0x2480c7[_0x1a05('0x45')]);return _0xe4974b[_0x1a05('0x8d')](_0x5373ae);}})[_0x1a05('0x2d')](function(_0x534d2d){if(_0x534d2d){_0x40221d=_0x534d2d[_0x1a05('0x3c')];if(!_0x2480c7[_0x1a05('0x38')][_0x1a05('0x5c')](_0x1a05('0x3d'))){_0x5373ae[_0x1a05('0x24')]=qs['limit'](_0x2480c7['query']['limit']);_0x5373ae[_0x1a05('0x22')]=qs[_0x1a05('0x22')](_0x2480c7[_0x1a05('0x38')][_0x1a05('0x22')]);}return _0xe4974b[_0x1a05('0x8d')](_0x5373ae);}})[_0x1a05('0x2d')](function(_0x5e50ad){if(_0x5e50ad){return _0x5e50ad?{'count':_0x40221d,'rows':_0x5e50ad}:null;}})[_0x1a05('0x2d')](respondWithResult(_0x1b155d,null))[_0x1a05('0x4c')](handleError(_0x1b155d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a724a4b..6e680d1 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 _0x1264=['SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x384056,_0x21bdc7){var _0x2c9517=function(_0x3d0df8){while(--_0x3d0df8){_0x384056['push'](_0x384056['shift']());}};_0x2c9517(++_0x21bdc7);}(_0x1264,0xce));var _0x4126=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x1264[_0x6dd5c];return _0x5a87fa;};'use strict';var EventEmitter=require(_0x4126('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x4126('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4126('0x2')](0x0);var events={'afterCreate':_0x4126('0x3'),'afterUpdate':_0x4126('0x4'),'afterDestroy':'remove'};function emitEvent(_0x41cae7){return function(_0x18f469,_0x5dd754,_0xe918a){SmsQueueEvents[_0x4126('0x5')](_0x41cae7+':'+_0x18f469['id'],_0x18f469);SmsQueueEvents[_0x4126('0x5')](_0x41cae7,_0x18f469);_0xe918a(null);};}for(var e in events){if(events[_0x4126('0x6')](e)){var event=events[e];SmsQueue[_0x4126('0x7')](e,emitEvent(event));}}module[_0x4126('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x0636=['SmsQueue','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x4a24a6,_0x500c05){var _0x31cacb=function(_0x570ad0){while(--_0x570ad0){_0x4a24a6['push'](_0x4a24a6['shift']());}};_0x31cacb(++_0x500c05);}(_0x0636,0x1be));var _0x6063=function(_0x73e511,_0x177034){_0x73e511=_0x73e511-0x0;var _0x533108=_0x0636[_0x73e511];return _0x533108;};'use strict';var EventEmitter=require(_0x6063('0x0'));var SmsQueue=require(_0x6063('0x1'))['db'][_0x6063('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6063('0x3')](0x0);var events={'afterCreate':_0x6063('0x4'),'afterUpdate':_0x6063('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12297d){return function(_0x146858,_0x4e1626,_0x3570ee){SmsQueueEvents[_0x6063('0x6')](_0x12297d+':'+_0x146858['id'],_0x146858);SmsQueueEvents[_0x6063('0x6')](_0x12297d,_0x146858);_0x3570ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x6063('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 72b2a8f..d15054c 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 _0xce84=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','define','SmsQueue','lodash'];(function(_0x339142,_0x2a3e83){var _0x3e5389=function(_0xa1faaa){while(--_0xa1faaa){_0x339142['push'](_0x339142['shift']());}};_0x3e5389(++_0x2a3e83);}(_0xce84,0xdb));var _0x4ce8=function(_0x531064,_0x11972e){_0x531064=_0x531064-0x0;var _0x2f23c3=_0xce84[_0x531064];return _0x2f23c3;};'use strict';var _=require(_0x4ce8('0x0'));var util=require(_0x4ce8('0x1'));var logger=require(_0x4ce8('0x2'))(_0x4ce8('0x3'));var moment=require('moment');var BPromise=require(_0x4ce8('0x4'));var rp=require(_0x4ce8('0x5'));var fs=require('fs');var path=require(_0x4ce8('0x6'));var rimraf=require(_0x4ce8('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ce8('0x8'));module['exports']=function(_0xafd75,_0x435ca0){return _0xafd75[_0x4ce8('0x9')](_0x4ce8('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15ad=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsQueue','sms_queues'];(function(_0x83744f,_0x9c1003){var _0x1632de=function(_0x33b203){while(--_0x33b203){_0x83744f['push'](_0x83744f['shift']());}};_0x1632de(++_0x9c1003);}(_0x15ad,0x6e));var _0xd15a=function(_0x2ae551,_0x4caf39){_0x2ae551=_0x2ae551-0x0;var _0x52a156=_0x15ad[_0x2ae551];return _0x52a156;};'use strict';var _=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var logger=require('../../config/logger')(_0xd15a('0x2'));var moment=require(_0xd15a('0x3'));var BPromise=require(_0xd15a('0x4'));var rp=require(_0xd15a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd15a('0x6'));var config=require(_0xd15a('0x7'));var attributes=require('./smsQueue.attributes');module[_0xd15a('0x8')]=function(_0xa42eac,_0x4e582f){return _0xa42eac['define'](_0xd15a('0x9'),attributes,{'tableName':_0xd15a('0xa'),'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 ffde51d..7a76384 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 _0x248a=['redis','defaults','localhost','socket.io-emitter','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetSmsQueue','options','raw','attributes','limit','include','map','model','stringify','catch','ShowSmsQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x55111c,_0x22bea8){var _0x15035b=function(_0x507bfb){while(--_0x507bfb){_0x55111c['push'](_0x55111c['shift']());}};_0x15035b(++_0x22bea8);}(_0x248a,0x65));var _0xa248=function(_0x148e1e,_0x1694b0){_0x148e1e=_0x148e1e-0x0;var _0x43c39a=_0x248a[_0x148e1e];return _0x43c39a;};'use strict';var _=require(_0xa248('0x0'));var util=require('util');var moment=require(_0xa248('0x1'));var BPromise=require(_0xa248('0x2'));var rs=require(_0xa248('0x3'));var fs=require('fs');var Redis=require(_0xa248('0x4'));var db=require(_0xa248('0x5'))['db'];var utils=require(_0xa248('0x6'));var logger=require(_0xa248('0x7'))(_0xa248('0x8'));var config=require(_0xa248('0x9'));var jayson=require(_0xa248('0xa'));var client=jayson[_0xa248('0xb')][_0xa248('0xc')]({'port':0x232a});config[_0xa248('0xd')]=_[_0xa248('0xe')](config['redis'],{'host':_0xa248('0xf'),'port':0x18eb});var socket=require(_0xa248('0x10'))(new Redis(config[_0xa248('0xd')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3cf724,_0x42d0eb,_0x1359a5){return new BPromise(function(_0x165523,_0x250db8){return client['request'](_0x3cf724,_0x1359a5)[_0xa248('0x11')](function(_0x26a556){logger['info'](_0xa248('0x12'),_0x42d0eb,_0xa248('0x13'));logger[_0xa248('0x14')](_0xa248('0x15'),_0x42d0eb,_0xa248('0x13'),JSON['stringify'](_0x26a556));if(_0x26a556[_0xa248('0x16')]){if(_0x26a556[_0xa248('0x16')]['code']===0x1f4){logger[_0xa248('0x16')](_0xa248('0x12'),_0x42d0eb,_0x26a556['error']['message']);return _0x250db8(_0x26a556[_0xa248('0x16')]['message']);}logger['error'](_0xa248('0x12'),_0x42d0eb,_0x26a556[_0xa248('0x16')][_0xa248('0x17')]);return _0x165523(_0x26a556['error'][_0xa248('0x17')]);}else{logger['info'](_0xa248('0x12'),_0x42d0eb,_0xa248('0x13'));_0x165523(_0x26a556[_0xa248('0x18')][_0xa248('0x17')]);}})['catch'](function(_0x466b79){logger[_0xa248('0x16')](_0xa248('0x12'),_0x42d0eb,_0x466b79);_0x250db8(_0x466b79);});});}exports[_0xa248('0x19')]=function(_0x30a66e){var _0x320e7f=this;return new Promise(function(_0x75a799,_0x37ed00){return db['SmsQueue']['findAll']({'raw':_0x30a66e[_0xa248('0x1a')]?_0x30a66e['options'][_0xa248('0x1b')]===undefined?!![]:![]:!![],'where':_0x30a66e[_0xa248('0x1a')]?_0x30a66e[_0xa248('0x1a')]['where']||null:null,'attributes':_0x30a66e[_0xa248('0x1a')]?_0x30a66e[_0xa248('0x1a')][_0xa248('0x1c')]||null:null,'limit':_0x30a66e[_0xa248('0x1a')]?_0x30a66e[_0xa248('0x1a')][_0xa248('0x1d')]||null:null,'include':_0x30a66e[_0xa248('0x1a')]?_0x30a66e[_0xa248('0x1a')][_0xa248('0x1e')]?_[_0xa248('0x1f')](_0x30a66e[_0xa248('0x1a')]['include'],function(_0x3aabc1){return{'model':db[_0x3aabc1[_0xa248('0x20')]],'as':_0x3aabc1['as'],'attributes':_0x3aabc1[_0xa248('0x1c')],'include':_0x3aabc1[_0xa248('0x1e')]?_[_0xa248('0x1f')](_0x3aabc1[_0xa248('0x1e')],function(_0x27b0a2){return{'model':db[_0x27b0a2[_0xa248('0x20')]],'as':_0x27b0a2['as'],'attributes':_0x27b0a2[_0xa248('0x1c')],'include':_0x27b0a2[_0xa248('0x1e')]?_['map'](_0x27b0a2['include'],function(_0x4344da){return{'model':db[_0x4344da['model']],'as':_0x4344da['as'],'attributes':_0x4344da[_0xa248('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa248('0x11')](function(_0x269602){logger['info'](_0xa248('0x19'),_0x30a66e);logger[_0xa248('0x14')](_0xa248('0x19'),_0x30a66e,JSON[_0xa248('0x21')](_0x269602));_0x75a799(_0x269602);})[_0xa248('0x22')](function(_0x2276da){logger[_0xa248('0x16')]('GetSmsQueue',_0x2276da['message'],_0x30a66e);_0x37ed00(_0x320e7f[_0xa248('0x16')](0x1f4,_0x2276da[_0xa248('0x17')]));});});};exports[_0xa248('0x23')]=function(_0x5bdd06){var _0x5e6854=this;return new Promise(function(_0x4a44fe,_0x264fd4){return db['SmsQueue'][_0xa248('0x24')]({'raw':_0x5bdd06['options']?_0x5bdd06['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bdd06['options']?_0x5bdd06['options']['where']||null:null,'attributes':_0x5bdd06[_0xa248('0x1a')]?_0x5bdd06[_0xa248('0x1a')]['attributes']||null:null,'include':_0x5bdd06[_0xa248('0x1a')]?_0x5bdd06['options']['include']?_[_0xa248('0x1f')](_0x5bdd06['options'][_0xa248('0x1e')],function(_0x3c3941){return{'model':db[_0x3c3941['model']],'as':_0x3c3941['as'],'attributes':_0x3c3941[_0xa248('0x1c')],'include':_0x3c3941[_0xa248('0x1e')]?_['map'](_0x3c3941[_0xa248('0x1e')],function(_0x102ac9){return{'model':db[_0x102ac9[_0xa248('0x20')]],'as':_0x102ac9['as'],'attributes':_0x102ac9[_0xa248('0x1c')],'include':_0x102ac9[_0xa248('0x1e')]?_[_0xa248('0x1f')](_0x102ac9[_0xa248('0x1e')],function(_0x4a8edc){return{'model':db[_0x4a8edc[_0xa248('0x20')]],'as':_0x4a8edc['as'],'attributes':_0x4a8edc[_0xa248('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x385420){logger[_0xa248('0x25')](_0xa248('0x23'),_0x5bdd06);logger[_0xa248('0x14')](_0xa248('0x23'),_0x5bdd06,JSON[_0xa248('0x21')](_0x385420));_0x4a44fe(_0x385420);})[_0xa248('0x22')](function(_0x370a8b){logger[_0xa248('0x16')](_0xa248('0x23'),_0x370a8b[_0xa248('0x17')],_0x5bdd06);_0x264fd4(_0x5e6854[_0xa248('0x16')](0x1f4,_0x370a8b[_0xa248('0x17')]));});});}; \ No newline at end of file +var _0xcfbf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowSmsQueue','find','debug','lodash','util','randomstring','../../mysqldb'];(function(_0xe55e26,_0x321344){var _0x1f0211=function(_0xb5f40d){while(--_0xb5f40d){_0xe55e26['push'](_0xe55e26['shift']());}};_0x1f0211(++_0x321344);}(_0xcfbf,0x152));var _0xfcfb=function(_0x138214,_0x1658ac){_0x138214=_0x138214-0x0;var _0x3d6b9a=_0xcfbf[_0x138214];return _0x3d6b9a;};'use strict';var _=require(_0xfcfb('0x0'));var util=require(_0xfcfb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfcfb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcfb('0x3'))['db'];var utils=require(_0xfcfb('0x4'));var logger=require(_0xfcfb('0x5'))(_0xfcfb('0x6'));var config=require(_0xfcfb('0x7'));var jayson=require(_0xfcfb('0x8'));var client=jayson[_0xfcfb('0x9')][_0xfcfb('0xa')]({'port':0x232a});config['redis']=_[_0xfcfb('0xb')](config[_0xfcfb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcfb('0xc')]));require(_0xfcfb('0xd'))['register'](socket);function respondWithRpcPromise(_0x52c0d5,_0x3526d0,_0x211406){return new BPromise(function(_0x4db46f,_0x7c0a2d){return client['request'](_0x52c0d5,_0x211406)[_0xfcfb('0xe')](function(_0x4f425d){logger[_0xfcfb('0xf')](_0xfcfb('0x10'),_0x3526d0,_0xfcfb('0x11'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3526d0,_0xfcfb('0x11'),JSON['stringify'](_0x4f425d));if(_0x4f425d[_0xfcfb('0x12')]){if(_0x4f425d[_0xfcfb('0x12')][_0xfcfb('0x13')]===0x1f4){logger[_0xfcfb('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3526d0,_0x4f425d[_0xfcfb('0x12')][_0xfcfb('0x14')]);return _0x7c0a2d(_0x4f425d[_0xfcfb('0x12')]['message']);}logger[_0xfcfb('0x12')](_0xfcfb('0x10'),_0x3526d0,_0x4f425d[_0xfcfb('0x12')][_0xfcfb('0x14')]);return _0x4db46f(_0x4f425d[_0xfcfb('0x12')][_0xfcfb('0x14')]);}else{logger['info'](_0xfcfb('0x10'),_0x3526d0,_0xfcfb('0x11'));_0x4db46f(_0x4f425d[_0xfcfb('0x15')][_0xfcfb('0x14')]);}})[_0xfcfb('0x16')](function(_0x29a5d6){logger[_0xfcfb('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3526d0,_0x29a5d6);_0x7c0a2d(_0x29a5d6);});});}exports[_0xfcfb('0x17')]=function(_0x51ce85){var _0x5d5b64=this;return new Promise(function(_0x15ebf8,_0x29f1e2){return db[_0xfcfb('0x18')][_0xfcfb('0x19')]({'raw':_0x51ce85[_0xfcfb('0x1a')]?_0x51ce85['options'][_0xfcfb('0x1b')]===undefined?!![]:![]:!![],'where':_0x51ce85[_0xfcfb('0x1a')]?_0x51ce85['options'][_0xfcfb('0x1c')]||null:null,'attributes':_0x51ce85[_0xfcfb('0x1a')]?_0x51ce85[_0xfcfb('0x1a')][_0xfcfb('0x1d')]||null:null,'limit':_0x51ce85[_0xfcfb('0x1a')]?_0x51ce85['options'][_0xfcfb('0x1e')]||null:null,'include':_0x51ce85[_0xfcfb('0x1a')]?_0x51ce85['options'][_0xfcfb('0x1f')]?_['map'](_0x51ce85[_0xfcfb('0x1a')][_0xfcfb('0x1f')],function(_0x1a48cf){return{'model':db[_0x1a48cf[_0xfcfb('0x20')]],'as':_0x1a48cf['as'],'attributes':_0x1a48cf[_0xfcfb('0x1d')],'include':_0x1a48cf['include']?_[_0xfcfb('0x21')](_0x1a48cf['include'],function(_0x40f8a5){return{'model':db[_0x40f8a5[_0xfcfb('0x20')]],'as':_0x40f8a5['as'],'attributes':_0x40f8a5[_0xfcfb('0x1d')],'include':_0x40f8a5[_0xfcfb('0x1f')]?_[_0xfcfb('0x21')](_0x40f8a5[_0xfcfb('0x1f')],function(_0x526393){return{'model':db[_0x526393[_0xfcfb('0x20')]],'as':_0x526393['as'],'attributes':_0x526393[_0xfcfb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcfb('0xe')](function(_0x529ce7){logger[_0xfcfb('0xf')](_0xfcfb('0x17'),_0x51ce85);logger['debug'](_0xfcfb('0x17'),_0x51ce85,JSON[_0xfcfb('0x22')](_0x529ce7));_0x15ebf8(_0x529ce7);})[_0xfcfb('0x16')](function(_0x4ac93c){logger[_0xfcfb('0x12')](_0xfcfb('0x17'),_0x4ac93c[_0xfcfb('0x14')],_0x51ce85);_0x29f1e2(_0x5d5b64['error'](0x1f4,_0x4ac93c[_0xfcfb('0x14')]));});});};exports[_0xfcfb('0x23')]=function(_0x17ef0e){var _0x545cc3=this;return new Promise(function(_0x2126f2,_0x5aa2c9){return db[_0xfcfb('0x18')][_0xfcfb('0x24')]({'raw':_0x17ef0e['options']?_0x17ef0e[_0xfcfb('0x1a')][_0xfcfb('0x1b')]===undefined?!![]:![]:!![],'where':_0x17ef0e[_0xfcfb('0x1a')]?_0x17ef0e['options'][_0xfcfb('0x1c')]||null:null,'attributes':_0x17ef0e[_0xfcfb('0x1a')]?_0x17ef0e[_0xfcfb('0x1a')][_0xfcfb('0x1d')]||null:null,'include':_0x17ef0e[_0xfcfb('0x1a')]?_0x17ef0e['options'][_0xfcfb('0x1f')]?_[_0xfcfb('0x21')](_0x17ef0e['options'][_0xfcfb('0x1f')],function(_0x11f043){return{'model':db[_0x11f043[_0xfcfb('0x20')]],'as':_0x11f043['as'],'attributes':_0x11f043[_0xfcfb('0x1d')],'include':_0x11f043[_0xfcfb('0x1f')]?_['map'](_0x11f043[_0xfcfb('0x1f')],function(_0x56e672){return{'model':db[_0x56e672[_0xfcfb('0x20')]],'as':_0x56e672['as'],'attributes':_0x56e672[_0xfcfb('0x1d')],'include':_0x56e672['include']?_[_0xfcfb('0x21')](_0x56e672[_0xfcfb('0x1f')],function(_0x83ce6f){return{'model':db[_0x83ce6f[_0xfcfb('0x20')]],'as':_0x83ce6f['as'],'attributes':_0x83ce6f[_0xfcfb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcfb('0xe')](function(_0x1ce218){logger[_0xfcfb('0xf')]('ShowSmsQueue',_0x17ef0e);logger[_0xfcfb('0x25')](_0xfcfb('0x23'),_0x17ef0e,JSON[_0xfcfb('0x22')](_0x1ce218));_0x2126f2(_0x1ce218);})[_0xfcfb('0x16')](function(_0x71c21){logger[_0xfcfb('0x12')]('ShowSmsQueue',_0x71c21[_0xfcfb('0x14')],_0x17ef0e);_0x5aa2c9(_0x545cc3[_0xfcfb('0x12')](0x1f4,_0x71c21['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index b22f297..8d12e6d 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 _0x2525=['emit','removeListener','smsQueue:','./smsQueue.events','save','remove'];(function(_0x26594c,_0x421bae){var _0x5dddcb=function(_0x49d0e9){while(--_0x49d0e9){_0x26594c['push'](_0x26594c['shift']());}};_0x5dddcb(++_0x421bae);}(_0x2525,0x147));var _0x5252=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x2525[_0x4e6ae6];return _0x23c108;};'use strict';var SmsQueueEvents=require(_0x5252('0x0'));var events=[_0x5252('0x1'),_0x5252('0x2'),'update'];function createListener(_0x4924cc,_0x3525fc){return function(_0x34399a){_0x3525fc[_0x5252('0x3')](_0x4924cc,_0x34399a);};}function removeListener(_0x4e627e,_0x5236bf){return function(){SmsQueueEvents[_0x5252('0x4')](_0x4e627e,_0x5236bf);};}exports['register']=function(_0x5aad6a){for(var _0x2988ac=0x0,_0x490bf3=events['length'];_0x2988ac<_0x490bf3;_0x2988ac++){var _0x4cdff0=events[_0x2988ac];var _0x43ad47=createListener(_0x5252('0x5')+_0x4cdff0,_0x5aad6a);SmsQueueEvents['on'](_0x4cdff0,_0x43ad47);}}; \ No newline at end of file +var _0x9eb6=['save','remove','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x9eb6,0x11f));var _0x69eb=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x9eb6[_0xa79977];return _0x109f10;};'use strict';var SmsQueueEvents=require(_0x69eb('0x0'));var events=[_0x69eb('0x1'),_0x69eb('0x2'),'update'];function createListener(_0x1e11e4,_0x4d2a2d){return function(_0x4ed86e){_0x4d2a2d[_0x69eb('0x3')](_0x1e11e4,_0x4ed86e);};}function removeListener(_0x305a4d,_0x4ef19e){return function(){SmsQueueEvents[_0x69eb('0x4')](_0x305a4d,_0x4ef19e);};}exports[_0x69eb('0x5')]=function(_0x24a19c){for(var _0x5c07e1=0x0,_0x338a86=events[_0x69eb('0x6')];_0x5c07e1<_0x338a86;_0x5c07e1++){var _0x561d64=events[_0x5c07e1];var _0x3f3add=createListener(_0x69eb('0x7')+_0x561d64,_0x24a19c);SmsQueueEvents['on'](_0x561d64,_0x3f3add);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 9c30f04..5067b53 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 _0x15dc=['../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x15dc,0x91));var _0xc15d=function(_0x5d7774,_0x10e3db){_0x5d7774=_0x5d7774-0x0;var _0x100409=_0x15dc[_0x5d7774];return _0x100409;};'use strict';var multer=require('multer');var util=require(_0xc15d('0x0'));var path=require(_0xc15d('0x1'));var timeout=require(_0xc15d('0x2'));var express=require(_0xc15d('0x3'));var router=express[_0xc15d('0x4')]();var fs_extra=require(_0xc15d('0x5'));var auth=require(_0xc15d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc15d('0x7'));var controller=require(_0xc15d('0x8'));router['get']('/',auth[_0xc15d('0x9')](),controller[_0xc15d('0xa')]);router[_0xc15d('0xb')](_0xc15d('0xc'),auth[_0xc15d('0x9')](),controller[_0xc15d('0xd')]);router[_0xc15d('0xb')](_0xc15d('0xe'),auth[_0xc15d('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc15d('0xf')]);router['put']('/:id',auth[_0xc15d('0x9')](),controller[_0xc15d('0x10')]);router['delete']('/:id',auth[_0xc15d('0x9')](),controller[_0xc15d('0x11')]);module[_0xc15d('0x12')]=router; \ No newline at end of file +var _0xfb65=['isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','/describe'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0xfb65,0x82));var _0x5fb6=function(_0xcd3806,_0x3182ad){_0xcd3806=_0xcd3806-0x0;var _0x5e3594=_0xfb65[_0xcd3806];return _0x5e3594;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0xe')]('/',auth['isAuthenticated'](),controller[_0x5fb6('0xf')]);router[_0x5fb6('0x10')]('/:id',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x11')]);router[_0x5fb6('0x12')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller['destroy']);module[_0x5fb6('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index aba115f..5481423 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 _0xd6cb=['STRING','DATE','moment','sequelize','exports'];(function(_0x233966,_0x5b6367){var _0x4489eb=function(_0x2fa049){while(--_0x2fa049){_0x233966['push'](_0x233966['shift']());}};_0x4489eb(++_0x5b6367);}(_0xd6cb,0xde));var _0xbd6c=function(_0x426495,_0x54e245){_0x426495=_0x426495-0x0;var _0x53a150=_0xd6cb[_0x426495];return _0x53a150;};'use strict';var moment=require(_0xbd6c('0x0'));var Sequelize=require(_0xbd6c('0x1'));module[_0xbd6c('0x2')]={'uniqueid':{'type':Sequelize[_0xbd6c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbd6c('0x4')]},'leaveAt':{'type':Sequelize[_0xbd6c('0x4')]},'acceptAt':{'type':Sequelize[_0xbd6c('0x4')]},'exitAt':{'type':Sequelize[_0xbd6c('0x4')]},'reason':{'type':Sequelize[_0xbd6c('0x3')]}}; \ No newline at end of file +var _0xaacc=['exports','DATE','STRING','moment'];(function(_0xa17c96,_0x4ebf88){var _0x369fcc=function(_0x5b3373){while(--_0x5b3373){_0xa17c96['push'](_0xa17c96['shift']());}};_0x369fcc(++_0x4ebf88);}(_0xaacc,0x14f));var _0xcaac=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xaacc[_0x1ae5ab];return _0x1ce001;};'use strict';var moment=require(_0xcaac('0x0'));var Sequelize=require('sequelize');module[_0xcaac('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcaac('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xcaac('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index ffbcab0..9a6a938 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 _0xbdc2=['mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','SmsQueueReport','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xbdc2,0x1b6));var _0x2bdc=function(_0x4cdd5a,_0x57e480){_0x4cdd5a=_0x4cdd5a-0x0;var _0x4133d9=_0xbdc2[_0x4cdd5a];return _0x4133d9;};'use strict';var emlformat=require(_0x2bdc('0x0'));var rimraf=require(_0x2bdc('0x1'));var zipdir=require(_0x2bdc('0x2'));var jsonpatch=require(_0x2bdc('0x3'));var rp=require(_0x2bdc('0x4'));var moment=require(_0x2bdc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2bdc('0x6'));var util=require(_0x2bdc('0x7'));var path=require(_0x2bdc('0x8'));var sox=require(_0x2bdc('0x9'));var csv=require(_0x2bdc('0xa'));var ejs=require(_0x2bdc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bdc('0xc'));var squel=require(_0x2bdc('0xd'));var crypto=require('crypto');var jsforce=require(_0x2bdc('0xe'));var deskjs=require(_0x2bdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2bdc('0x10'));var Papa=require('papaparse');var Redis=require(_0x2bdc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2bdc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bdc('0x13'));var logger=require('../../config/logger')(_0x2bdc('0x14'));var utils=require(_0x2bdc('0x15'));var config=require(_0x2bdc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2bdc('0x17'))['db'];function respondWithStatusCode(_0x54222b,_0x341e05){_0x341e05=_0x341e05||0xcc;return function(_0x3c850b){if(_0x3c850b){return _0x54222b[_0x2bdc('0x18')](_0x341e05);}return _0x54222b[_0x2bdc('0x19')](_0x341e05)[_0x2bdc('0x1a')]();};}function respondWithResult(_0x41aff2,_0x499cca){_0x499cca=_0x499cca||0xc8;return function(_0x156246){if(_0x156246){return _0x41aff2[_0x2bdc('0x19')](_0x499cca)['json'](_0x156246);}};}function respondWithFilteredResult(_0xf8009d,_0x1d7ebc){return function(_0x55a9e3){if(_0x55a9e3){var _0x4bd82f=typeof _0x1d7ebc[_0x2bdc('0x1b')]===_0x2bdc('0x1c')&&typeof _0x1d7ebc['limit']===_0x2bdc('0x1c');var _0x457ae3=_0x55a9e3[_0x2bdc('0x1d')];var _0x2de22f=_0x4bd82f?0x0:_0x1d7ebc[_0x2bdc('0x1b')];var _0x96e43c=_0x4bd82f?_0x55a9e3['count']:_0x1d7ebc[_0x2bdc('0x1b')]+_0x1d7ebc[_0x2bdc('0x1e')];var _0x4be007;if(_0x96e43c>=_0x457ae3){_0x96e43c=_0x457ae3;_0x4be007=0xc8;}else{_0x4be007=0xce;}_0xf8009d['status'](_0x4be007);return _0xf8009d[_0x2bdc('0x1f')](_0x2bdc('0x20'),_0x2de22f+'-'+_0x96e43c+'/'+_0x457ae3)[_0x2bdc('0x21')](_0x55a9e3);}return null;};}function patchUpdates(_0x509a55){return function(_0x4e32ef){try{jsonpatch[_0x2bdc('0x22')](_0x4e32ef,_0x509a55,!![]);}catch(_0x25fe7a){return BPromise[_0x2bdc('0x23')](_0x25fe7a);}return _0x4e32ef['save']();};}function saveUpdates(_0x45a6ce,_0x4b38c1){return function(_0x4f70b3){if(_0x4f70b3){return _0x4f70b3[_0x2bdc('0x24')](_0x45a6ce)[_0x2bdc('0x25')](function(_0xdf889){return _0xdf889;});}return null;};}function removeEntity(_0x43e189,_0x388e3a){return function(_0x2d2b12){if(_0x2d2b12){return _0x2d2b12[_0x2bdc('0x26')]()[_0x2bdc('0x25')](function(){_0x43e189['status'](0xcc)[_0x2bdc('0x1a')]();});}};}function handleEntityNotFound(_0x48867d,_0x49586b){return function(_0x4d35b5){if(!_0x4d35b5){_0x48867d['sendStatus'](0x194);}return _0x4d35b5;};}function handleError(_0x41f555,_0x55b647){_0x55b647=_0x55b647||0x1f4;return function(_0x4ba606){logger[_0x2bdc('0x27')](_0x4ba606[_0x2bdc('0x28')]);if(_0x4ba606[_0x2bdc('0x29')]){delete _0x4ba606['name'];}_0x41f555[_0x2bdc('0x19')](_0x55b647)[_0x2bdc('0x2a')](_0x4ba606);};}exports[_0x2bdc('0x2b')]=function(_0x148b87,_0x32e36c){var _0x3b5b34={},_0x1ebda4={},_0xc946d4={'count':0x0,'rows':[]};var _0x501502=_['map'](db[_0x2bdc('0x2c')]['rawAttributes'],function(_0x2d9cac){return{'name':_0x2d9cac['fieldName'],'type':_0x2d9cac['type']['key']};});_0x1ebda4['model']=_[_0x2bdc('0x2d')](_0x501502,_0x2bdc('0x29'));_0x1ebda4[_0x2bdc('0x2e')]=_[_0x2bdc('0x2f')](_0x148b87['query']);_0x1ebda4[_0x2bdc('0x30')]=_[_0x2bdc('0x31')](_0x1ebda4['model'],_0x1ebda4[_0x2bdc('0x2e')]);_0x3b5b34[_0x2bdc('0x32')]=_[_0x2bdc('0x31')](_0x1ebda4[_0x2bdc('0x33')],qs['fields'](_0x148b87['query'][_0x2bdc('0x34')]));_0x3b5b34[_0x2bdc('0x32')]=_0x3b5b34[_0x2bdc('0x32')][_0x2bdc('0x35')]?_0x3b5b34[_0x2bdc('0x32')]:_0x1ebda4[_0x2bdc('0x33')];if(!_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x36')]('nolimit')){_0x3b5b34[_0x2bdc('0x1e')]=qs[_0x2bdc('0x1e')](_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x1e')]);_0x3b5b34[_0x2bdc('0x1b')]=qs['offset'](_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x1b')]);}_0x3b5b34[_0x2bdc('0x37')]=qs[_0x2bdc('0x38')](_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x38')]);_0x3b5b34[_0x2bdc('0x39')]=qs[_0x2bdc('0x30')](_['pick'](_0x148b87[_0x2bdc('0x2e')],_0x1ebda4[_0x2bdc('0x30')]),_0x501502);if(_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x3a')]){_0x3b5b34[_0x2bdc('0x39')]=_[_0x2bdc('0x3b')](_0x3b5b34[_0x2bdc('0x39')],{'$or':_['map'](_0x501502,function(_0x106d43){if(_0x106d43[_0x2bdc('0x3c')]!==_0x2bdc('0x3d')){var _0x3543d4={};_0x3543d4[_0x106d43[_0x2bdc('0x29')]]={'$like':'%'+_0x148b87[_0x2bdc('0x2e')][_0x2bdc('0x3a')]+'%'};return _0x3543d4;}})});}_0x3b5b34=_[_0x2bdc('0x3b')]({},_0x3b5b34,_0x148b87['options']);var _0x3c85ab={'where':_0x3b5b34[_0x2bdc('0x39')]};return db[_0x2bdc('0x2c')][_0x2bdc('0x1d')](_0x3c85ab)[_0x2bdc('0x25')](function(_0x473f1b){_0xc946d4[_0x2bdc('0x1d')]=_0x473f1b;if(_0x148b87['query'][_0x2bdc('0x3e')]){_0x3b5b34['include']=[{'all':!![]}];}return db[_0x2bdc('0x2c')][_0x2bdc('0x3f')](_0x3b5b34);})['then'](function(_0x2814db){_0xc946d4[_0x2bdc('0x40')]=_0x2814db;return _0xc946d4;})[_0x2bdc('0x25')](respondWithFilteredResult(_0x32e36c,_0x3b5b34))[_0x2bdc('0x41')](handleError(_0x32e36c,null));};exports['show']=function(_0x5c0ea5,_0x6b063b){var _0x32b425={'raw':!![],'where':{'id':_0x5c0ea5['params']['id']}},_0x1f1084={};_0x1f1084[_0x2bdc('0x33')]=_[_0x2bdc('0x2f')](db[_0x2bdc('0x2c')][_0x2bdc('0x42')]);_0x1f1084['query']=_[_0x2bdc('0x2f')](_0x5c0ea5[_0x2bdc('0x2e')]);_0x1f1084['filters']=_['intersection'](_0x1f1084[_0x2bdc('0x33')],_0x1f1084['query']);_0x32b425[_0x2bdc('0x32')]=_[_0x2bdc('0x31')](_0x1f1084[_0x2bdc('0x33')],qs[_0x2bdc('0x34')](_0x5c0ea5[_0x2bdc('0x2e')][_0x2bdc('0x34')]));_0x32b425[_0x2bdc('0x32')]=_0x32b425['attributes'][_0x2bdc('0x35')]?_0x32b425[_0x2bdc('0x32')]:_0x1f1084['model'];if(_0x5c0ea5[_0x2bdc('0x2e')]['includeAll']){_0x32b425[_0x2bdc('0x43')]=[{'all':!![]}];}_0x32b425=_['merge']({},_0x32b425,_0x5c0ea5[_0x2bdc('0x44')]);return db[_0x2bdc('0x2c')][_0x2bdc('0x45')](_0x32b425)['then'](handleEntityNotFound(_0x6b063b,null))[_0x2bdc('0x25')](respondWithResult(_0x6b063b,null))['catch'](handleError(_0x6b063b,null));};exports['create']=function(_0xc57bcc,_0x4233dc){return db[_0x2bdc('0x2c')][_0x2bdc('0x46')](_0xc57bcc['body'],{})['then'](respondWithResult(_0x4233dc,0xc9))[_0x2bdc('0x41')](handleError(_0x4233dc,null));};exports[_0x2bdc('0x24')]=function(_0x12addc,_0x2c2f45){if(_0x12addc['body']['id']){delete _0x12addc[_0x2bdc('0x47')]['id'];}return db[_0x2bdc('0x2c')]['find']({'where':{'id':_0x12addc[_0x2bdc('0x48')]['id']}})[_0x2bdc('0x25')](handleEntityNotFound(_0x2c2f45,null))['then'](saveUpdates(_0x12addc['body'],null))[_0x2bdc('0x25')](respondWithResult(_0x2c2f45,null))[_0x2bdc('0x41')](handleError(_0x2c2f45,null));};exports[_0x2bdc('0x26')]=function(_0x126b71,_0x41ea41){return db[_0x2bdc('0x2c')][_0x2bdc('0x45')]({'where':{'id':_0x126b71[_0x2bdc('0x48')]['id']}})[_0x2bdc('0x25')](handleEntityNotFound(_0x41ea41,null))[_0x2bdc('0x25')](removeEntity(_0x41ea41,null))[_0x2bdc('0x41')](handleError(_0x41ea41,null));};exports[_0x2bdc('0x49')]=function(_0x4282b7,_0x5ed2d5){return db[_0x2bdc('0x2c')]['describe']()['then'](respondWithResult(_0x5ed2d5,null))[_0x2bdc('0x41')](handleError(_0x5ed2d5,null));}; \ No newline at end of file +var _0xd5b7=['VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','update','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','set','Content-Range','reject','save','then','end','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge'];(function(_0x140358,_0xe9481d){var _0x324aa1=function(_0x595075){while(--_0x595075){_0x140358['push'](_0x140358['shift']());}};_0x324aa1(++_0xe9481d);}(_0xd5b7,0x1cb));var _0x7d5b=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xd5b7[_0x1d558c];return _0x15767d;};'use strict';var emlformat=require(_0x7d5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d5b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d5b('0x2'));var moment=require('moment');var BPromise=require(_0x7d5b('0x3'));var Mustache=require(_0x7d5b('0x4'));var util=require('util');var path=require(_0x7d5b('0x5'));var sox=require(_0x7d5b('0x6'));var csv=require(_0x7d5b('0x7'));var ejs=require(_0x7d5b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7d5b('0x9'));var crypto=require(_0x7d5b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7d5b('0xb'));var toCsv=require(_0x7d5b('0x7'));var querystring=require(_0x7d5b('0xc'));var Papa=require(_0x7d5b('0xd'));var Redis=require('ioredis');var authService=require(_0x7d5b('0xe'));var qs=require(_0x7d5b('0xf'));var as=require(_0x7d5b('0x10'));var hardwareService=require(_0x7d5b('0x11'));var logger=require('../../config/logger')(_0x7d5b('0x12'));var utils=require(_0x7d5b('0x13'));var config=require(_0x7d5b('0x14'));var licenseUtil=require(_0x7d5b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x143e61,_0x508c15){_0x508c15=_0x508c15||0xcc;return function(_0x4174c5){if(_0x4174c5){return _0x143e61[_0x7d5b('0x16')](_0x508c15);}return _0x143e61[_0x7d5b('0x17')](_0x508c15)['end']();};}function respondWithResult(_0x1f03ab,_0x5a1c53){_0x5a1c53=_0x5a1c53||0xc8;return function(_0x5f48e4){if(_0x5f48e4){return _0x1f03ab[_0x7d5b('0x17')](_0x5a1c53)[_0x7d5b('0x18')](_0x5f48e4);}};}function respondWithFilteredResult(_0x378a0b,_0x36a87d){return function(_0x38909d){if(_0x38909d){var _0x2afc9d=typeof _0x36a87d['offset']==='undefined'&&typeof _0x36a87d['limit']===_0x7d5b('0x19');var _0x2a1666=_0x38909d['count'];var _0x54de53=_0x2afc9d?0x0:_0x36a87d['offset'];var _0x1565ba=_0x2afc9d?_0x38909d[_0x7d5b('0x1a')]:_0x36a87d[_0x7d5b('0x1b')]+_0x36a87d['limit'];var _0xcc6d66;if(_0x1565ba>=_0x2a1666){_0x1565ba=_0x2a1666;_0xcc6d66=0xc8;}else{_0xcc6d66=0xce;}_0x378a0b[_0x7d5b('0x17')](_0xcc6d66);return _0x378a0b[_0x7d5b('0x1c')](_0x7d5b('0x1d'),_0x54de53+'-'+_0x1565ba+'/'+_0x2a1666)['json'](_0x38909d);}return null;};}function patchUpdates(_0x2b3dca){return function(_0x508396){try{jsonpatch['apply'](_0x508396,_0x2b3dca,!![]);}catch(_0x506818){return BPromise[_0x7d5b('0x1e')](_0x506818);}return _0x508396[_0x7d5b('0x1f')]();};}function saveUpdates(_0x4ad743,_0x59c1f6){return function(_0x1edf65){if(_0x1edf65){return _0x1edf65['update'](_0x4ad743)[_0x7d5b('0x20')](function(_0x932e17){return _0x932e17;});}return null;};}function removeEntity(_0x22a28b,_0x33fcdc){return function(_0x49d448){if(_0x49d448){return _0x49d448['destroy']()[_0x7d5b('0x20')](function(){_0x22a28b['status'](0xcc)[_0x7d5b('0x21')]();});}};}function handleEntityNotFound(_0x153b64,_0x2d854f){return function(_0x1e198){if(!_0x1e198){_0x153b64[_0x7d5b('0x16')](0x194);}return _0x1e198;};}function handleError(_0x743ce4,_0x5ee974){_0x5ee974=_0x5ee974||0x1f4;return function(_0x3a8be4){logger['error'](_0x3a8be4[_0x7d5b('0x22')]);if(_0x3a8be4[_0x7d5b('0x23')]){delete _0x3a8be4['name'];}_0x743ce4[_0x7d5b('0x17')](_0x5ee974)[_0x7d5b('0x24')](_0x3a8be4);};}exports[_0x7d5b('0x25')]=function(_0x4779be,_0x2baa05){var _0x106992={},_0xca49b0={},_0x225121={'count':0x0,'rows':[]};var _0x1c7cde=_[_0x7d5b('0x26')](db[_0x7d5b('0x27')][_0x7d5b('0x28')],function(_0x92f987){return{'name':_0x92f987[_0x7d5b('0x29')],'type':_0x92f987[_0x7d5b('0x2a')][_0x7d5b('0x2b')]};});_0xca49b0['model']=_[_0x7d5b('0x26')](_0x1c7cde,_0x7d5b('0x23'));_0xca49b0['query']=_['keys'](_0x4779be[_0x7d5b('0x2c')]);_0xca49b0[_0x7d5b('0x2d')]=_[_0x7d5b('0x2e')](_0xca49b0['model'],_0xca49b0['query']);_0x106992[_0x7d5b('0x2f')]=_[_0x7d5b('0x2e')](_0xca49b0[_0x7d5b('0x30')],qs[_0x7d5b('0x31')](_0x4779be[_0x7d5b('0x2c')]['fields']));_0x106992[_0x7d5b('0x2f')]=_0x106992[_0x7d5b('0x2f')][_0x7d5b('0x32')]?_0x106992[_0x7d5b('0x2f')]:_0xca49b0[_0x7d5b('0x30')];if(!_0x4779be[_0x7d5b('0x2c')][_0x7d5b('0x33')](_0x7d5b('0x34'))){_0x106992[_0x7d5b('0x35')]=qs[_0x7d5b('0x35')](_0x4779be[_0x7d5b('0x2c')]['limit']);_0x106992[_0x7d5b('0x1b')]=qs['offset'](_0x4779be[_0x7d5b('0x2c')][_0x7d5b('0x1b')]);}_0x106992[_0x7d5b('0x36')]=qs['sort'](_0x4779be[_0x7d5b('0x2c')]['sort']);_0x106992['where']=qs['filters'](_[_0x7d5b('0x37')](_0x4779be[_0x7d5b('0x2c')],_0xca49b0[_0x7d5b('0x2d')]),_0x1c7cde);if(_0x4779be[_0x7d5b('0x2c')][_0x7d5b('0x38')]){_0x106992[_0x7d5b('0x39')]=_[_0x7d5b('0x3a')](_0x106992['where'],{'$or':_[_0x7d5b('0x26')](_0x1c7cde,function(_0x44cb6f){if(_0x44cb6f['type']!==_0x7d5b('0x3b')){var _0x12b1ac={};_0x12b1ac[_0x44cb6f[_0x7d5b('0x23')]]={'$like':'%'+_0x4779be[_0x7d5b('0x2c')][_0x7d5b('0x38')]+'%'};return _0x12b1ac;}})});}_0x106992=_[_0x7d5b('0x3a')]({},_0x106992,_0x4779be[_0x7d5b('0x3c')]);var _0x1f5c1f={'where':_0x106992[_0x7d5b('0x39')]};return db[_0x7d5b('0x27')]['count'](_0x1f5c1f)[_0x7d5b('0x20')](function(_0x381bd7){_0x225121[_0x7d5b('0x1a')]=_0x381bd7;if(_0x4779be[_0x7d5b('0x2c')][_0x7d5b('0x3d')]){_0x106992[_0x7d5b('0x3e')]=[{'all':!![]}];}return db[_0x7d5b('0x27')][_0x7d5b('0x3f')](_0x106992);})[_0x7d5b('0x20')](function(_0x222924){_0x225121['rows']=_0x222924;return _0x225121;})['then'](respondWithFilteredResult(_0x2baa05,_0x106992))['catch'](handleError(_0x2baa05,null));};exports[_0x7d5b('0x40')]=function(_0x32434c,_0x53eb54){var _0x54ea96={'raw':!![],'where':{'id':_0x32434c[_0x7d5b('0x41')]['id']}},_0x5a02fa={};_0x5a02fa['model']=_[_0x7d5b('0x42')](db['SmsQueueReport'][_0x7d5b('0x28')]);_0x5a02fa[_0x7d5b('0x2c')]=_['keys'](_0x32434c[_0x7d5b('0x2c')]);_0x5a02fa[_0x7d5b('0x2d')]=_[_0x7d5b('0x2e')](_0x5a02fa['model'],_0x5a02fa[_0x7d5b('0x2c')]);_0x54ea96[_0x7d5b('0x2f')]=_[_0x7d5b('0x2e')](_0x5a02fa['model'],qs[_0x7d5b('0x31')](_0x32434c[_0x7d5b('0x2c')][_0x7d5b('0x31')]));_0x54ea96['attributes']=_0x54ea96[_0x7d5b('0x2f')][_0x7d5b('0x32')]?_0x54ea96[_0x7d5b('0x2f')]:_0x5a02fa[_0x7d5b('0x30')];if(_0x32434c[_0x7d5b('0x2c')][_0x7d5b('0x3d')]){_0x54ea96['include']=[{'all':!![]}];}_0x54ea96=_['merge']({},_0x54ea96,_0x32434c['options']);return db[_0x7d5b('0x27')][_0x7d5b('0x43')](_0x54ea96)[_0x7d5b('0x20')](handleEntityNotFound(_0x53eb54,null))[_0x7d5b('0x20')](respondWithResult(_0x53eb54,null))[_0x7d5b('0x44')](handleError(_0x53eb54,null));};exports['create']=function(_0x1be24a,_0x46a6a2){return db[_0x7d5b('0x27')][_0x7d5b('0x45')](_0x1be24a[_0x7d5b('0x46')],{})[_0x7d5b('0x20')](respondWithResult(_0x46a6a2,0xc9))[_0x7d5b('0x44')](handleError(_0x46a6a2,null));};exports[_0x7d5b('0x47')]=function(_0x3e92ec,_0x25cab3){if(_0x3e92ec[_0x7d5b('0x46')]['id']){delete _0x3e92ec[_0x7d5b('0x46')]['id'];}return db['SmsQueueReport'][_0x7d5b('0x43')]({'where':{'id':_0x3e92ec[_0x7d5b('0x41')]['id']}})[_0x7d5b('0x20')](handleEntityNotFound(_0x25cab3,null))[_0x7d5b('0x20')](saveUpdates(_0x3e92ec[_0x7d5b('0x46')],null))[_0x7d5b('0x20')](respondWithResult(_0x25cab3,null))[_0x7d5b('0x44')](handleError(_0x25cab3,null));};exports[_0x7d5b('0x48')]=function(_0x5a280a,_0xbde228){return db[_0x7d5b('0x27')][_0x7d5b('0x43')]({'where':{'id':_0x5a280a[_0x7d5b('0x41')]['id']}})[_0x7d5b('0x20')](handleEntityNotFound(_0xbde228,null))[_0x7d5b('0x20')](removeEntity(_0xbde228,null))[_0x7d5b('0x44')](handleError(_0xbde228,null));};exports[_0x7d5b('0x49')]=function(_0x3c0764,_0x1d9823){return db['SmsQueueReport'][_0x7d5b('0x49')]()[_0x7d5b('0x20')](respondWithResult(_0x1d9823,null))[_0x7d5b('0x44')](handleError(_0x1d9823,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 782619a..0bf7cd4 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xe706,0xa3));var _0x6e70=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0xe706[_0x37fcda];return _0xf5ed91;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c9ed8b2..faedc2c 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 _0x7b71=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','update','where','attributes','UpdateSmsQueueReport','stringify','catch','lodash'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x7b71,0xcb));var _0x17b7=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x7b71[_0x402c8f];return _0x11e809;};'use strict';var _=require(_0x17b7('0x0'));var util=require(_0x17b7('0x1'));var moment=require(_0x17b7('0x2'));var BPromise=require(_0x17b7('0x3'));var rs=require(_0x17b7('0x4'));var fs=require('fs');var Redis=require(_0x17b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x17b7('0x6'));var logger=require(_0x17b7('0x7'))(_0x17b7('0x8'));var config=require(_0x17b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17b7('0xa')][_0x17b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d02d1,_0x18fc2a,_0x3c6796){return new BPromise(function(_0x282072,_0x1bfd7){return client[_0x17b7('0xc')](_0x2d02d1,_0x3c6796)[_0x17b7('0xd')](function(_0x172d9e){logger['info'](_0x17b7('0xe'),_0x18fc2a,_0x17b7('0xf'));logger[_0x17b7('0x10')](_0x17b7('0x11'),_0x18fc2a,_0x17b7('0xf'),JSON['stringify'](_0x172d9e));if(_0x172d9e[_0x17b7('0x12')]){if(_0x172d9e[_0x17b7('0x12')][_0x17b7('0x13')]===0x1f4){logger['error'](_0x17b7('0xe'),_0x18fc2a,_0x172d9e['error'][_0x17b7('0x14')]);return _0x1bfd7(_0x172d9e[_0x17b7('0x12')]['message']);}logger[_0x17b7('0x12')](_0x17b7('0xe'),_0x18fc2a,_0x172d9e['error'][_0x17b7('0x14')]);return _0x282072(_0x172d9e[_0x17b7('0x12')][_0x17b7('0x14')]);}else{logger[_0x17b7('0x15')](_0x17b7('0xe'),_0x18fc2a,'request\x20sent');_0x282072(_0x172d9e['result'][_0x17b7('0x14')]);}})['catch'](function(_0x5bcbc9){logger['error'](_0x17b7('0xe'),_0x18fc2a,_0x5bcbc9);_0x1bfd7(_0x5bcbc9);});});}exports[_0x17b7('0x16')]=function(_0x32f28b){var _0x339d27=this;return new Promise(function(_0x10661e,_0x340a93){return db[_0x17b7('0x17')][_0x17b7('0x18')](_0x32f28b[_0x17b7('0x19')],{'raw':_0x32f28b[_0x17b7('0x1a')]?_0x32f28b[_0x17b7('0x1a')][_0x17b7('0x1b')]===undefined?!![]:![]:!![]})[_0x17b7('0xd')](function(_0x4c773f){logger[_0x17b7('0x15')](_0x17b7('0x16'),_0x32f28b);logger['debug']('CreateSmsQueueReport',_0x32f28b,JSON['stringify'](_0x4c773f));_0x10661e(_0x4c773f);})['catch'](function(_0x3b6cb1){logger[_0x17b7('0x12')](_0x17b7('0x16'),_0x3b6cb1[_0x17b7('0x14')],_0x32f28b);_0x340a93(_0x339d27['error'](0x1f4,_0x3b6cb1[_0x17b7('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x301064){var _0x5c7a95=this;return new Promise(function(_0x26e5b0,_0x34566b){return db['SmsQueueReport'][_0x17b7('0x1c')](_0x301064[_0x17b7('0x19')],{'raw':_0x301064[_0x17b7('0x1a')]?_0x301064[_0x17b7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x301064[_0x17b7('0x1a')]?_0x301064[_0x17b7('0x1a')][_0x17b7('0x1d')]||null:null,'attributes':_0x301064['options']?_0x301064[_0x17b7('0x1a')][_0x17b7('0x1e')]||null:null,'limit':_0x301064[_0x17b7('0x1a')]?_0x301064[_0x17b7('0x1a')]['limit']||null:null})[_0x17b7('0xd')](function(_0x21f7a3){logger['info'](_0x17b7('0x1f'),_0x301064);logger[_0x17b7('0x10')](_0x17b7('0x1f'),_0x301064,JSON[_0x17b7('0x20')](_0x21f7a3));_0x26e5b0(_0x21f7a3);})[_0x17b7('0x21')](function(_0x11572e){logger['error'](_0x17b7('0x1f'),_0x11572e[_0x17b7('0x14')],_0x301064);_0x34566b(_0x5c7a95[_0x17b7('0x12')](0x1f4,_0x11572e[_0x17b7('0x14')]));});});}; \ No newline at end of file +var _0x6fb9=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','UpdateSmsQueueReport','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c90b2,_0x4d2845){var _0x435635=function(_0x4a2a54){while(--_0x4a2a54){_0x5c90b2['push'](_0x5c90b2['shift']());}};_0x435635(++_0x4d2845);}(_0x6fb9,0x1ab));var _0x96fb=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x6fb9[_0x36de10];return _0x58100f;};'use strict';var _=require(_0x96fb('0x0'));var util=require(_0x96fb('0x1'));var moment=require(_0x96fb('0x2'));var BPromise=require(_0x96fb('0x3'));var rs=require(_0x96fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96fb('0x5'))['db'];var utils=require(_0x96fb('0x6'));var logger=require(_0x96fb('0x7'))('rpc');var config=require(_0x96fb('0x8'));var jayson=require(_0x96fb('0x9'));var client=jayson[_0x96fb('0xa')][_0x96fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f26bc,_0x41f22f,_0x4497c8){return new BPromise(function(_0xc5f45a,_0x4038ac){return client[_0x96fb('0xc')](_0x5f26bc,_0x4497c8)['then'](function(_0x12fa0a){logger[_0x96fb('0xd')](_0x96fb('0xe'),_0x41f22f,_0x96fb('0xf'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x41f22f,_0x96fb('0xf'),JSON['stringify'](_0x12fa0a));if(_0x12fa0a[_0x96fb('0x10')]){if(_0x12fa0a[_0x96fb('0x10')][_0x96fb('0x11')]===0x1f4){logger['error'](_0x96fb('0xe'),_0x41f22f,_0x12fa0a[_0x96fb('0x10')][_0x96fb('0x12')]);return _0x4038ac(_0x12fa0a[_0x96fb('0x10')][_0x96fb('0x12')]);}logger[_0x96fb('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x41f22f,_0x12fa0a[_0x96fb('0x10')][_0x96fb('0x12')]);return _0xc5f45a(_0x12fa0a[_0x96fb('0x10')]['message']);}else{logger[_0x96fb('0xd')](_0x96fb('0xe'),_0x41f22f,'request\x20sent');_0xc5f45a(_0x12fa0a['result']['message']);}})[_0x96fb('0x13')](function(_0x9e9839){logger[_0x96fb('0x10')](_0x96fb('0xe'),_0x41f22f,_0x9e9839);_0x4038ac(_0x9e9839);});});}exports[_0x96fb('0x14')]=function(_0x35a0f9){var _0x23cdc7=this;return new Promise(function(_0x16ee31,_0x39d22e){return db[_0x96fb('0x15')]['create'](_0x35a0f9[_0x96fb('0x16')],{'raw':_0x35a0f9[_0x96fb('0x17')]?_0x35a0f9['options'][_0x96fb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x54e7e3){logger[_0x96fb('0xd')](_0x96fb('0x14'),_0x35a0f9);logger['debug'](_0x96fb('0x14'),_0x35a0f9,JSON[_0x96fb('0x19')](_0x54e7e3));_0x16ee31(_0x54e7e3);})['catch'](function(_0x572260){logger[_0x96fb('0x10')](_0x96fb('0x14'),_0x572260['message'],_0x35a0f9);_0x39d22e(_0x23cdc7['error'](0x1f4,_0x572260[_0x96fb('0x12')]));});});};exports[_0x96fb('0x1a')]=function(_0xfebcff){var _0x4d1512=this;return new Promise(function(_0x1be217,_0x4f0716){return db[_0x96fb('0x15')]['update'](_0xfebcff[_0x96fb('0x16')],{'raw':_0xfebcff[_0x96fb('0x17')]?_0xfebcff['options'][_0x96fb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfebcff[_0x96fb('0x17')]?_0xfebcff['options'][_0x96fb('0x1b')]||null:null,'attributes':_0xfebcff[_0x96fb('0x17')]?_0xfebcff[_0x96fb('0x17')][_0x96fb('0x1c')]||null:null,'limit':_0xfebcff[_0x96fb('0x17')]?_0xfebcff[_0x96fb('0x17')][_0x96fb('0x1d')]||null:null})[_0x96fb('0x1e')](function(_0x7a4efa){logger[_0x96fb('0xd')](_0x96fb('0x1a'),_0xfebcff);logger['debug'](_0x96fb('0x1a'),_0xfebcff,JSON[_0x96fb('0x19')](_0x7a4efa));_0x1be217(_0x7a4efa);})[_0x96fb('0x13')](function(_0x5b1fb0){logger[_0x96fb('0x10')](_0x96fb('0x1a'),_0x5b1fb0['message'],_0xfebcff);_0x4f0716(_0x4d1512[_0x96fb('0x10')](0x1f4,_0x5b1fb0['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 2dec75c..c046221 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 _0x1224=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x97fec0,_0x509666){var _0x5497b4=function(_0x50c713){while(--_0x50c713){_0x97fec0['push'](_0x97fec0['shift']());}};_0x5497b4(++_0x509666);}(_0x1224,0x10d));var _0x4122=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0x1224[_0x566667];return _0x277136;};'use strict';var multer=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var path=require(_0x4122('0x2'));var timeout=require(_0x4122('0x3'));var express=require(_0x4122('0x4'));var router=express[_0x4122('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4122('0x6'));var interaction=require(_0x4122('0x7'));var config=require(_0x4122('0x8'));var controller=require('./smsTransferReport.controller');router[_0x4122('0x9')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0xb')]);router[_0x4122('0x9')](_0x4122('0xc'),auth[_0x4122('0xa')](),controller[_0x4122('0xd')]);router[_0x4122('0x9')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0xf')]);router[_0x4122('0x10')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0x11')]);router[_0x4122('0x12')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0x13')]);router[_0x4122('0x14')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0x15')]);module[_0x4122('0x16')]=router; \ No newline at end of file +var _0x7118=['post','update','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x24658a,_0x2e770b){var _0x2722ce=function(_0x2d0588){while(--_0x2d0588){_0x24658a['push'](_0x24658a['shift']());}};_0x2722ce(++_0x2e770b);}(_0x7118,0x159));var _0x8711=function(_0x494e39,_0x536a0b){_0x494e39=_0x494e39-0x0;var _0x26362b=_0x7118[_0x494e39];return _0x26362b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8711('0x0'));var timeout=require(_0x8711('0x1'));var express=require('express');var router=express[_0x8711('0x2')]();var fs_extra=require(_0x8711('0x3'));var auth=require(_0x8711('0x4'));var interaction=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var controller=require(_0x8711('0x7'));router[_0x8711('0x8')]('/',auth['isAuthenticated'](),controller[_0x8711('0x9')]);router[_0x8711('0x8')](_0x8711('0xa'),auth[_0x8711('0xb')](),controller[_0x8711('0xc')]);router[_0x8711('0x8')](_0x8711('0xd'),auth[_0x8711('0xb')](),controller[_0x8711('0xe')]);router[_0x8711('0xf')]('/',auth[_0x8711('0xb')](),controller['create']);router['put'](_0x8711('0xd'),auth[_0x8711('0xb')](),controller[_0x8711('0x10')]);router['delete']('/:id',auth[_0x8711('0xb')](),controller[_0x8711('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c97a023..996b489 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4c53d9,_0x4d1f04){var _0x44c65a=function(_0x90b92){while(--_0x90b92){_0x4c53d9['push'](_0x4c53d9['shift']());}};_0x44c65a(++_0x4d1f04);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4d9ce8,_0x179b52){_0x4d9ce8=_0x4d9ce8-0x0;var _0x86cac6=_0xf4eb[_0x4d9ce8];return _0x86cac6;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x52b4fb,_0x596c25){_0x52b4fb=_0x52b4fb-0x0;var _0x4d0fae=_0xb43b[_0x52b4fb];return _0x4d0fae;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index eb751f2..f0fa9d9 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 _0x366c=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x28f632,_0x19c6b5){var _0x1bbfa2=function(_0x403808){while(--_0x403808){_0x28f632['push'](_0x28f632['shift']());}};_0x1bbfa2(++_0x19c6b5);}(_0x366c,0x9d));var _0xc366=function(_0x23d73f,_0x3a600b){_0x23d73f=_0x23d73f-0x0;var _0x2ab6c6=_0x366c[_0x23d73f];return _0x2ab6c6;};'use strict';var emlformat=require(_0xc366('0x0'));var rimraf=require(_0xc366('0x1'));var zipdir=require(_0xc366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc366('0x3'));var moment=require(_0xc366('0x4'));var BPromise=require(_0xc366('0x5'));var Mustache=require(_0xc366('0x6'));var util=require(_0xc366('0x7'));var path=require(_0xc366('0x8'));var sox=require(_0xc366('0x9'));var csv=require(_0xc366('0xa'));var ejs=require(_0xc366('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc366('0xc'));var crypto=require(_0xc366('0xd'));var jsforce=require(_0xc366('0xe'));var deskjs=require(_0xc366('0xf'));var toCsv=require(_0xc366('0xa'));var querystring=require(_0xc366('0x10'));var Papa=require(_0xc366('0x11'));var Redis=require(_0xc366('0x12'));var authService=require(_0xc366('0x13'));var qs=require(_0xc366('0x14'));var as=require(_0xc366('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc366('0x16'))(_0xc366('0x17'));var utils=require(_0xc366('0x18'));var config=require(_0xc366('0x19'));var licenseUtil=require(_0xc366('0x1a'));var db=require(_0xc366('0x1b'))['db'];function respondWithStatusCode(_0x1fcb4c,_0x5aa23d){_0x5aa23d=_0x5aa23d||0xcc;return function(_0x2b2063){if(_0x2b2063){return _0x1fcb4c['sendStatus'](_0x5aa23d);}return _0x1fcb4c[_0xc366('0x1c')](_0x5aa23d)['end']();};}function respondWithResult(_0x388fb1,_0x59c61e){_0x59c61e=_0x59c61e||0xc8;return function(_0x3a61f8){if(_0x3a61f8){return _0x388fb1[_0xc366('0x1c')](_0x59c61e)[_0xc366('0x1d')](_0x3a61f8);}};}function respondWithFilteredResult(_0x3d31e7,_0x187972){return function(_0xb88372){if(_0xb88372){var _0x3ccc13=typeof _0x187972['offset']==='undefined'&&typeof _0x187972[_0xc366('0x1e')]===_0xc366('0x1f');var _0x12af48=_0xb88372[_0xc366('0x20')];var _0x384ce3=_0x3ccc13?0x0:_0x187972[_0xc366('0x21')];var _0x43d6e7=_0x3ccc13?_0xb88372[_0xc366('0x20')]:_0x187972[_0xc366('0x21')]+_0x187972['limit'];var _0x136bed;if(_0x43d6e7>=_0x12af48){_0x43d6e7=_0x12af48;_0x136bed=0xc8;}else{_0x136bed=0xce;}_0x3d31e7[_0xc366('0x1c')](_0x136bed);return _0x3d31e7['set'](_0xc366('0x22'),_0x384ce3+'-'+_0x43d6e7+'/'+_0x12af48)[_0xc366('0x1d')](_0xb88372);}return null;};}function patchUpdates(_0x11ba4e){return function(_0x4903ed){try{jsonpatch[_0xc366('0x23')](_0x4903ed,_0x11ba4e,!![]);}catch(_0xa19981){return BPromise[_0xc366('0x24')](_0xa19981);}return _0x4903ed[_0xc366('0x25')]();};}function saveUpdates(_0x15b493,_0x73b1){return function(_0x1dce40){if(_0x1dce40){return _0x1dce40[_0xc366('0x26')](_0x15b493)[_0xc366('0x27')](function(_0x538f25){return _0x538f25;});}return null;};}function removeEntity(_0x3859d8,_0x312bb3){return function(_0x359545){if(_0x359545){return _0x359545['destroy']()[_0xc366('0x27')](function(){_0x3859d8[_0xc366('0x1c')](0xcc)[_0xc366('0x28')]();});}};}function handleEntityNotFound(_0x50c7d7,_0x44603f){return function(_0x443dcd){if(!_0x443dcd){_0x50c7d7[_0xc366('0x29')](0x194);}return _0x443dcd;};}function handleError(_0x314457,_0x3f3f0e){_0x3f3f0e=_0x3f3f0e||0x1f4;return function(_0x6ffe5b){logger[_0xc366('0x2a')](_0x6ffe5b[_0xc366('0x2b')]);if(_0x6ffe5b[_0xc366('0x2c')]){delete _0x6ffe5b[_0xc366('0x2c')];}_0x314457['status'](_0x3f3f0e)[_0xc366('0x2d')](_0x6ffe5b);};}exports[_0xc366('0x2e')]=function(_0x54003c,_0x111fbe){var _0x5f33e5={},_0x1b4276={},_0x55602f={'count':0x0,'rows':[]};var _0x170a52=_[_0xc366('0x2f')](db[_0xc366('0x30')]['rawAttributes'],function(_0x4eb82e){return{'name':_0x4eb82e[_0xc366('0x31')],'type':_0x4eb82e[_0xc366('0x32')][_0xc366('0x33')]};});_0x1b4276[_0xc366('0x34')]=_[_0xc366('0x2f')](_0x170a52,_0xc366('0x2c'));_0x1b4276['query']=_[_0xc366('0x35')](_0x54003c[_0xc366('0x36')]);_0x1b4276[_0xc366('0x37')]=_[_0xc366('0x38')](_0x1b4276[_0xc366('0x34')],_0x1b4276['query']);_0x5f33e5[_0xc366('0x39')]=_[_0xc366('0x38')](_0x1b4276[_0xc366('0x34')],qs[_0xc366('0x3a')](_0x54003c['query'][_0xc366('0x3a')]));_0x5f33e5[_0xc366('0x39')]=_0x5f33e5[_0xc366('0x39')][_0xc366('0x3b')]?_0x5f33e5[_0xc366('0x39')]:_0x1b4276[_0xc366('0x34')];if(!_0x54003c[_0xc366('0x36')][_0xc366('0x3c')](_0xc366('0x3d'))){_0x5f33e5[_0xc366('0x1e')]=qs[_0xc366('0x1e')](_0x54003c[_0xc366('0x36')]['limit']);_0x5f33e5[_0xc366('0x21')]=qs[_0xc366('0x21')](_0x54003c[_0xc366('0x36')][_0xc366('0x21')]);}_0x5f33e5[_0xc366('0x3e')]=qs['sort'](_0x54003c[_0xc366('0x36')]['sort']);_0x5f33e5['where']=qs[_0xc366('0x37')](_[_0xc366('0x3f')](_0x54003c[_0xc366('0x36')],_0x1b4276['filters']),_0x170a52);if(_0x54003c[_0xc366('0x36')][_0xc366('0x40')]){_0x5f33e5[_0xc366('0x41')]=_[_0xc366('0x42')](_0x5f33e5[_0xc366('0x41')],{'$or':_[_0xc366('0x2f')](_0x170a52,function(_0x39c704){if(_0x39c704[_0xc366('0x32')]!==_0xc366('0x43')){var _0x505449={};_0x505449[_0x39c704['name']]={'$like':'%'+_0x54003c[_0xc366('0x36')]['filter']+'%'};return _0x505449;}})});}_0x5f33e5=_[_0xc366('0x42')]({},_0x5f33e5,_0x54003c['options']);var _0x410aae={'where':_0x5f33e5[_0xc366('0x41')]};return db['SmsTransferReport'][_0xc366('0x20')](_0x410aae)[_0xc366('0x27')](function(_0x1f0fce){_0x55602f[_0xc366('0x20')]=_0x1f0fce;if(_0x54003c[_0xc366('0x36')][_0xc366('0x44')]){_0x5f33e5['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xc366('0x45')](_0x5f33e5);})['then'](function(_0x277312){_0x55602f[_0xc366('0x46')]=_0x277312;return _0x55602f;})['then'](respondWithFilteredResult(_0x111fbe,_0x5f33e5))[_0xc366('0x47')](handleError(_0x111fbe,null));};exports['show']=function(_0xff0f3a,_0xea94c0){var _0x3eb743={'raw':!![],'where':{'id':_0xff0f3a[_0xc366('0x48')]['id']}},_0x491d45={};_0x491d45[_0xc366('0x34')]=_[_0xc366('0x35')](db[_0xc366('0x30')][_0xc366('0x49')]);_0x491d45[_0xc366('0x36')]=_[_0xc366('0x35')](_0xff0f3a[_0xc366('0x36')]);_0x491d45[_0xc366('0x37')]=_[_0xc366('0x38')](_0x491d45[_0xc366('0x34')],_0x491d45['query']);_0x3eb743[_0xc366('0x39')]=_[_0xc366('0x38')](_0x491d45[_0xc366('0x34')],qs[_0xc366('0x3a')](_0xff0f3a['query'][_0xc366('0x3a')]));_0x3eb743['attributes']=_0x3eb743[_0xc366('0x39')]['length']?_0x3eb743[_0xc366('0x39')]:_0x491d45[_0xc366('0x34')];if(_0xff0f3a[_0xc366('0x36')][_0xc366('0x44')]){_0x3eb743[_0xc366('0x4a')]=[{'all':!![]}];}_0x3eb743=_[_0xc366('0x42')]({},_0x3eb743,_0xff0f3a[_0xc366('0x4b')]);return db[_0xc366('0x30')][_0xc366('0x4c')](_0x3eb743)[_0xc366('0x27')](handleEntityNotFound(_0xea94c0,null))[_0xc366('0x27')](respondWithResult(_0xea94c0,null))[_0xc366('0x47')](handleError(_0xea94c0,null));};exports[_0xc366('0x4d')]=function(_0x278f50,_0x3b30c7){return db[_0xc366('0x30')][_0xc366('0x4d')](_0x278f50[_0xc366('0x4e')],{})[_0xc366('0x27')](respondWithResult(_0x3b30c7,0xc9))['catch'](handleError(_0x3b30c7,null));};exports[_0xc366('0x26')]=function(_0x6416cf,_0xe399ed){if(_0x6416cf[_0xc366('0x4e')]['id']){delete _0x6416cf[_0xc366('0x4e')]['id'];}return db[_0xc366('0x30')][_0xc366('0x4c')]({'where':{'id':_0x6416cf[_0xc366('0x48')]['id']}})[_0xc366('0x27')](handleEntityNotFound(_0xe399ed,null))['then'](saveUpdates(_0x6416cf[_0xc366('0x4e')],null))[_0xc366('0x27')](respondWithResult(_0xe399ed,null))[_0xc366('0x47')](handleError(_0xe399ed,null));};exports[_0xc366('0x4f')]=function(_0x20bdfe,_0x240ddf){return db['SmsTransferReport']['find']({'where':{'id':_0x20bdfe[_0xc366('0x48')]['id']}})[_0xc366('0x27')](handleEntityNotFound(_0x240ddf,null))[_0xc366('0x27')](removeEntity(_0x240ddf,null))['catch'](handleError(_0x240ddf,null));};exports[_0xc366('0x50')]=function(_0x266be9,_0xb32a73){return db[_0xc366('0x30')][_0xc366('0x50')]()[_0xc366('0x27')](respondWithResult(_0xb32a73,null))[_0xc366('0x47')](handleError(_0xb32a73,null));}; \ No newline at end of file +var _0x18aa=['send','index','map','fieldName','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','SmsTransferReport','include','findAll','rows','show','params','rawAttributes','fields','includeAll','create','body','catch','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name'];(function(_0x18b4e8,_0x30e9e1){var _0x4b6265=function(_0x46bc8b){while(--_0x46bc8b){_0x18b4e8['push'](_0x18b4e8['shift']());}};_0x4b6265(++_0x30e9e1);}(_0x18aa,0xcb));var _0xa18a=function(_0x3aa1c8,_0x569310){_0x3aa1c8=_0x3aa1c8-0x0;var _0x5d4cda=_0x18aa[_0x3aa1c8];return _0x5d4cda;};'use strict';var emlformat=require(_0xa18a('0x0'));var rimraf=require(_0xa18a('0x1'));var zipdir=require(_0xa18a('0x2'));var jsonpatch=require(_0xa18a('0x3'));var rp=require(_0xa18a('0x4'));var moment=require(_0xa18a('0x5'));var BPromise=require(_0xa18a('0x6'));var Mustache=require('mustache');var util=require(_0xa18a('0x7'));var path=require(_0xa18a('0x8'));var sox=require(_0xa18a('0x9'));var csv=require(_0xa18a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa18a('0xb'));var _=require(_0xa18a('0xc'));var squel=require(_0xa18a('0xd'));var crypto=require('crypto');var jsforce=require(_0xa18a('0xe'));var deskjs=require(_0xa18a('0xf'));var toCsv=require(_0xa18a('0xa'));var querystring=require(_0xa18a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa18a('0x11'));var qs=require(_0xa18a('0x12'));var as=require(_0xa18a('0x13'));var hardwareService=require(_0xa18a('0x14'));var logger=require('../../config/logger')(_0xa18a('0x15'));var utils=require(_0xa18a('0x16'));var config=require(_0xa18a('0x17'));var licenseUtil=require(_0xa18a('0x18'));var db=require(_0xa18a('0x19'))['db'];function respondWithStatusCode(_0x5decfd,_0x458c87){_0x458c87=_0x458c87||0xcc;return function(_0x225bf0){if(_0x225bf0){return _0x5decfd['sendStatus'](_0x458c87);}return _0x5decfd[_0xa18a('0x1a')](_0x458c87)['end']();};}function respondWithResult(_0x5c096b,_0x306ed5){_0x306ed5=_0x306ed5||0xc8;return function(_0x4fc450){if(_0x4fc450){return _0x5c096b[_0xa18a('0x1a')](_0x306ed5)[_0xa18a('0x1b')](_0x4fc450);}};}function respondWithFilteredResult(_0x5c4afa,_0x482e83){return function(_0xd21ba4){if(_0xd21ba4){var _0x29d3da=typeof _0x482e83[_0xa18a('0x1c')]===_0xa18a('0x1d')&&typeof _0x482e83[_0xa18a('0x1e')]===_0xa18a('0x1d');var _0x488b3=_0xd21ba4['count'];var _0xde67c6=_0x29d3da?0x0:_0x482e83[_0xa18a('0x1c')];var _0x511377=_0x29d3da?_0xd21ba4[_0xa18a('0x1f')]:_0x482e83[_0xa18a('0x1c')]+_0x482e83[_0xa18a('0x1e')];var _0x5f3316;if(_0x511377>=_0x488b3){_0x511377=_0x488b3;_0x5f3316=0xc8;}else{_0x5f3316=0xce;}_0x5c4afa[_0xa18a('0x1a')](_0x5f3316);return _0x5c4afa[_0xa18a('0x20')](_0xa18a('0x21'),_0xde67c6+'-'+_0x511377+'/'+_0x488b3)[_0xa18a('0x1b')](_0xd21ba4);}return null;};}function patchUpdates(_0xce128d){return function(_0x10c787){try{jsonpatch[_0xa18a('0x22')](_0x10c787,_0xce128d,!![]);}catch(_0x81fda3){return BPromise[_0xa18a('0x23')](_0x81fda3);}return _0x10c787[_0xa18a('0x24')]();};}function saveUpdates(_0x25012c,_0x100e95){return function(_0x1aa8e7){if(_0x1aa8e7){return _0x1aa8e7['update'](_0x25012c)[_0xa18a('0x25')](function(_0x598701){return _0x598701;});}return null;};}function removeEntity(_0x4906d2,_0x57dbdf){return function(_0x2ca779){if(_0x2ca779){return _0x2ca779['destroy']()['then'](function(){_0x4906d2[_0xa18a('0x1a')](0xcc)[_0xa18a('0x26')]();});}};}function handleEntityNotFound(_0x29a40c,_0x279e01){return function(_0x1dfd01){if(!_0x1dfd01){_0x29a40c[_0xa18a('0x27')](0x194);}return _0x1dfd01;};}function handleError(_0x351b28,_0x4b9803){_0x4b9803=_0x4b9803||0x1f4;return function(_0x2e34b1){logger[_0xa18a('0x28')](_0x2e34b1[_0xa18a('0x29')]);if(_0x2e34b1[_0xa18a('0x2a')]){delete _0x2e34b1[_0xa18a('0x2a')];}_0x351b28['status'](_0x4b9803)[_0xa18a('0x2b')](_0x2e34b1);};}exports[_0xa18a('0x2c')]=function(_0x330c72,_0x18327f){var _0x275ba0={},_0xf57358={},_0x741629={'count':0x0,'rows':[]};var _0x478472=_[_0xa18a('0x2d')](db['SmsTransferReport']['rawAttributes'],function(_0x11725e){return{'name':_0x11725e[_0xa18a('0x2e')],'type':_0x11725e['type'][_0xa18a('0x2f')]};});_0xf57358['model']=_['map'](_0x478472,_0xa18a('0x2a'));_0xf57358[_0xa18a('0x30')]=_[_0xa18a('0x31')](_0x330c72['query']);_0xf57358['filters']=_[_0xa18a('0x32')](_0xf57358[_0xa18a('0x33')],_0xf57358[_0xa18a('0x30')]);_0x275ba0['attributes']=_[_0xa18a('0x32')](_0xf57358[_0xa18a('0x33')],qs['fields'](_0x330c72['query']['fields']));_0x275ba0[_0xa18a('0x34')]=_0x275ba0[_0xa18a('0x34')][_0xa18a('0x35')]?_0x275ba0[_0xa18a('0x34')]:_0xf57358['model'];if(!_0x330c72[_0xa18a('0x30')][_0xa18a('0x36')](_0xa18a('0x37'))){_0x275ba0['limit']=qs['limit'](_0x330c72[_0xa18a('0x30')][_0xa18a('0x1e')]);_0x275ba0[_0xa18a('0x1c')]=qs['offset'](_0x330c72[_0xa18a('0x30')][_0xa18a('0x1c')]);}_0x275ba0[_0xa18a('0x38')]=qs[_0xa18a('0x39')](_0x330c72[_0xa18a('0x30')][_0xa18a('0x39')]);_0x275ba0[_0xa18a('0x3a')]=qs['filters'](_[_0xa18a('0x3b')](_0x330c72[_0xa18a('0x30')],_0xf57358[_0xa18a('0x3c')]),_0x478472);if(_0x330c72['query'][_0xa18a('0x3d')]){_0x275ba0[_0xa18a('0x3a')]=_['merge'](_0x275ba0[_0xa18a('0x3a')],{'$or':_[_0xa18a('0x2d')](_0x478472,function(_0x42048e){if(_0x42048e[_0xa18a('0x3e')]!==_0xa18a('0x3f')){var _0x42e9ae={};_0x42e9ae[_0x42048e['name']]={'$like':'%'+_0x330c72['query']['filter']+'%'};return _0x42e9ae;}})});}_0x275ba0=_[_0xa18a('0x40')]({},_0x275ba0,_0x330c72[_0xa18a('0x41')]);var _0x3c1cd1={'where':_0x275ba0[_0xa18a('0x3a')]};return db[_0xa18a('0x42')][_0xa18a('0x1f')](_0x3c1cd1)[_0xa18a('0x25')](function(_0xfdc548){_0x741629[_0xa18a('0x1f')]=_0xfdc548;if(_0x330c72[_0xa18a('0x30')]['includeAll']){_0x275ba0[_0xa18a('0x43')]=[{'all':!![]}];}return db[_0xa18a('0x42')][_0xa18a('0x44')](_0x275ba0);})['then'](function(_0xc8072b){_0x741629[_0xa18a('0x45')]=_0xc8072b;return _0x741629;})[_0xa18a('0x25')](respondWithFilteredResult(_0x18327f,_0x275ba0))['catch'](handleError(_0x18327f,null));};exports[_0xa18a('0x46')]=function(_0x206a05,_0x34cba4){var _0x525bfa={'raw':!![],'where':{'id':_0x206a05[_0xa18a('0x47')]['id']}},_0xbff0ab={};_0xbff0ab[_0xa18a('0x33')]=_['keys'](db[_0xa18a('0x42')][_0xa18a('0x48')]);_0xbff0ab[_0xa18a('0x30')]=_[_0xa18a('0x31')](_0x206a05['query']);_0xbff0ab[_0xa18a('0x3c')]=_[_0xa18a('0x32')](_0xbff0ab['model'],_0xbff0ab[_0xa18a('0x30')]);_0x525bfa[_0xa18a('0x34')]=_[_0xa18a('0x32')](_0xbff0ab[_0xa18a('0x33')],qs[_0xa18a('0x49')](_0x206a05[_0xa18a('0x30')][_0xa18a('0x49')]));_0x525bfa[_0xa18a('0x34')]=_0x525bfa[_0xa18a('0x34')][_0xa18a('0x35')]?_0x525bfa['attributes']:_0xbff0ab[_0xa18a('0x33')];if(_0x206a05[_0xa18a('0x30')][_0xa18a('0x4a')]){_0x525bfa[_0xa18a('0x43')]=[{'all':!![]}];}_0x525bfa=_[_0xa18a('0x40')]({},_0x525bfa,_0x206a05[_0xa18a('0x41')]);return db[_0xa18a('0x42')]['find'](_0x525bfa)[_0xa18a('0x25')](handleEntityNotFound(_0x34cba4,null))[_0xa18a('0x25')](respondWithResult(_0x34cba4,null))['catch'](handleError(_0x34cba4,null));};exports['create']=function(_0x29ba87,_0xbe1a6a){return db['SmsTransferReport'][_0xa18a('0x4b')](_0x29ba87[_0xa18a('0x4c')],{})[_0xa18a('0x25')](respondWithResult(_0xbe1a6a,0xc9))[_0xa18a('0x4d')](handleError(_0xbe1a6a,null));};exports[_0xa18a('0x4e')]=function(_0x248f9a,_0x4745c8){if(_0x248f9a[_0xa18a('0x4c')]['id']){delete _0x248f9a[_0xa18a('0x4c')]['id'];}return db[_0xa18a('0x42')][_0xa18a('0x4f')]({'where':{'id':_0x248f9a['params']['id']}})[_0xa18a('0x25')](handleEntityNotFound(_0x4745c8,null))[_0xa18a('0x25')](saveUpdates(_0x248f9a[_0xa18a('0x4c')],null))[_0xa18a('0x25')](respondWithResult(_0x4745c8,null))['catch'](handleError(_0x4745c8,null));};exports[_0xa18a('0x50')]=function(_0x289f5e,_0x55699a){return db['SmsTransferReport'][_0xa18a('0x4f')]({'where':{'id':_0x289f5e[_0xa18a('0x47')]['id']}})[_0xa18a('0x25')](handleEntityNotFound(_0x55699a,null))[_0xa18a('0x25')](removeEntity(_0x55699a,null))['catch'](handleError(_0x55699a,null));};exports[_0xa18a('0x51')]=function(_0x1424a3,_0x53d6f4){return db[_0xa18a('0x42')][_0xa18a('0x51')]()['then'](respondWithResult(_0x53d6f4,null))[_0xa18a('0x4d')](handleError(_0x53d6f4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index c56b194..e223f28 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 _0x3eb7=['api','moment','request-promise','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger'];(function(_0x138c72,_0x17c4ed){var _0x58d82e=function(_0x3bfee6){while(--_0x3bfee6){_0x138c72['push'](_0x138c72['shift']());}};_0x58d82e(++_0x17c4ed);}(_0x3eb7,0x14e));var _0x73eb=function(_0x3c28d5,_0x51fae4){_0x3c28d5=_0x3c28d5-0x0;var _0x50ce6a=_0x3eb7[_0x3c28d5];return _0x50ce6a;};'use strict';var _=require('lodash');var util=require(_0x73eb('0x0'));var logger=require(_0x73eb('0x1'))(_0x73eb('0x2'));var moment=require(_0x73eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x73eb('0x4'));var fs=require('fs');var path=require(_0x73eb('0x5'));var rimraf=require(_0x73eb('0x6'));var config=require(_0x73eb('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x73eb('0x8')]=function(_0x3c5191,_0x16d7a2){return _0x3c5191['define'](_0x73eb('0x9'),attributes,{'tableName':_0x73eb('0xa'),'paranoid':![],'indexes':[{'name':_0x73eb('0xb'),'fields':[_0x73eb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff9=['SmsTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define'];(function(_0x83eff0,_0x32bda9){var _0x4d2498=function(_0x12fe36){while(--_0x12fe36){_0x83eff0['push'](_0x83eff0['shift']());}};_0x4d2498(++_0x32bda9);}(_0x8ff9,0x188));var _0x98ff=function(_0x4256f5,_0x407318){_0x4256f5=_0x4256f5-0x0;var _0x4ff194=_0x8ff9[_0x4256f5];return _0x4ff194;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))('api');var moment=require(_0x98ff('0x3'));var BPromise=require(_0x98ff('0x4'));var rp=require(_0x98ff('0x5'));var fs=require('fs');var path=require(_0x98ff('0x6'));var rimraf=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var attributes=require(_0x98ff('0x9'));module['exports']=function(_0xe3db15,_0x4e61db){return _0xe3db15[_0x98ff('0xa')](_0x98ff('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x98ff('0xc'),'fields':[_0x98ff('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 2201de4..5b84050 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 _0x49c4=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x2019f9,_0x4b01b4){var _0x22ace4=function(_0x4bdc5f){while(--_0x4bdc5f){_0x2019f9['push'](_0x2019f9['shift']());}};_0x22ace4(++_0x4b01b4);}(_0x49c4,0x9b));var _0x449c=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x49c4[_0x543084];return _0x306a57;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var moment=require(_0x449c('0x1'));var BPromise=require(_0x449c('0x2'));var rs=require(_0x449c('0x3'));var fs=require('fs');var Redis=require(_0x449c('0x4'));var db=require(_0x449c('0x5'))['db'];var utils=require(_0x449c('0x6'));var logger=require(_0x449c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x449c('0x8'));var client=jayson[_0x449c('0x9')][_0x449c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db09a,_0x3e7c19,_0x43cb0e){return new BPromise(function(_0x3e6354,_0x6d76d1){return client[_0x449c('0xb')](_0x2db09a,_0x43cb0e)[_0x449c('0xc')](function(_0x32f061){logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));logger[_0x449c('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3e7c19,'request\x20sent',JSON[_0x449c('0x11')](_0x32f061));if(_0x32f061[_0x449c('0x12')]){if(_0x32f061['error']['code']===0x1f4){logger['error'](_0x449c('0xe'),_0x3e7c19,_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);return _0x6d76d1(_0x32f061[_0x449c('0x12')]['message']);}logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x32f061[_0x449c('0x12')]['message']);return _0x3e6354(_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);}else{logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));_0x3e6354(_0x32f061[_0x449c('0x14')][_0x449c('0x13')]);}})[_0x449c('0x15')](function(_0x132a5b){logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x132a5b);_0x6d76d1(_0x132a5b);});});} \ No newline at end of file +var _0xe132=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x15b065,_0x3b77a7){var _0x4cb0ae=function(_0x5844e6){while(--_0x5844e6){_0x15b065['push'](_0x15b065['shift']());}};_0x4cb0ae(++_0x3b77a7);}(_0xe132,0x162));var _0x2e13=function(_0x4a9973,_0x291c68){_0x4a9973=_0x4a9973-0x0;var _0x445ef9=_0xe132[_0x4a9973];return _0x445ef9;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var moment=require(_0x2e13('0x1'));var BPromise=require(_0x2e13('0x2'));var rs=require(_0x2e13('0x3'));var fs=require('fs');var Redis=require(_0x2e13('0x4'));var db=require(_0x2e13('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e13('0x6'))(_0x2e13('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e13('0x8')][_0x2e13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c670b,_0x71f9d3,_0x3be5dc){return new BPromise(function(_0x2d9487,_0x370a85){return client[_0x2e13('0xa')](_0x1c670b,_0x3be5dc)[_0x2e13('0xb')](function(_0x240bc3){logger['info'](_0x2e13('0xc'),_0x71f9d3,_0x2e13('0xd'));logger[_0x2e13('0xe')](_0x2e13('0xf'),_0x71f9d3,_0x2e13('0xd'),JSON[_0x2e13('0x10')](_0x240bc3));if(_0x240bc3[_0x2e13('0x11')]){if(_0x240bc3['error'][_0x2e13('0x12')]===0x1f4){logger[_0x2e13('0x11')](_0x2e13('0xc'),_0x71f9d3,_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);return _0x370a85(_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);}logger['error'](_0x2e13('0xc'),_0x71f9d3,_0x240bc3[_0x2e13('0x11')][_0x2e13('0x13')]);return _0x2d9487(_0x240bc3['error'][_0x2e13('0x13')]);}else{logger[_0x2e13('0x14')](_0x2e13('0xc'),_0x71f9d3,'request\x20sent');_0x2d9487(_0x240bc3[_0x2e13('0x15')][_0x2e13('0x13')]);}})[_0x2e13('0x16')](function(_0x4a466b){logger['error'](_0x2e13('0xc'),_0x71f9d3,_0x4a466b);_0x370a85(_0x4a466b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 96b2a35..9a0c068 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 _0x3870=['extname','post','single','file','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','now'];(function(_0xcaae5e,_0x58c9b2){var _0x19df62=function(_0x1cdb69){while(--_0x1cdb69){_0xcaae5e['push'](_0xcaae5e['shift']());}};_0x19df62(++_0x58c9b2);}(_0x3870,0x19e));var _0x0387=function(_0x55d74c,_0x1ad8fc){_0x55d74c=_0x55d74c-0x0;var _0x43da87=_0x3870[_0x55d74c];return _0x43da87;};'use strict';var multer=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var path=require('path');var timeout=require(_0x0387('0x2'));var express=require(_0x0387('0x3'));var router=express['Router']();var fs_extra=require(_0x0387('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0387('0x5'));var controller=require(_0x0387('0x6'));router[_0x0387('0x7')]('/',auth[_0x0387('0x8')](),controller[_0x0387('0x9')]);router[_0x0387('0x7')](_0x0387('0xa'),auth[_0x0387('0x8')](),controller[_0x0387('0xb')]);router[_0x0387('0x7')](_0x0387('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x0387('0xd')]({'destination':function(_0x535401,_0x37f669,_0x66ea75){_0x66ea75(null,path['join'](config[_0x0387('0xe')],'server/files/sounds/original/'));},'filename':function(_0x5c86e9,_0x575912,_0x3d587a){_0x575912[_0x0387('0xf')]=_0x575912[_0x0387('0xf')][_0x0387('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d587a(null,util[_0x0387('0x11')](_0x0387('0x12'),path[_0x0387('0x13')](_0x575912['originalname'],path['extname'](_0x575912[_0x0387('0xf')])),Date[_0x0387('0x14')](),path[_0x0387('0x15')](_0x575912[_0x0387('0xf')])));}})});router[_0x0387('0x16')]('/',upload[_0x0387('0x17')](_0x0387('0x18')),controller['create']);router[_0x0387('0x19')]('/:id',auth[_0x0387('0x8')](),controller[_0x0387('0x1a')]);router['delete']('/:id',auth[_0x0387('0x8')](),controller[_0x0387('0x1b')]);module[_0x0387('0x1c')]=router; \ No newline at end of file +var _0x7000=['download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','now','extname','single','file','create','put','delete','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7000,0xa0));var _0x0700=function(_0x22b005,_0x2a6515){_0x22b005=_0x22b005-0x0;var _0x58bd11=_0x7000[_0x22b005];return _0x58bd11;};'use strict';var multer=require(_0x0700('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0700('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0700('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x0700('0x3'));var controller=require(_0x0700('0x4'));router['get']('/',auth[_0x0700('0x5')](),controller['index']);router[_0x0700('0x6')](_0x0700('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x0700('0x6')]('/:id/download',auth[_0x0700('0x5')](),controller[_0x0700('0x8')]);var upload=multer({'storage':multer[_0x0700('0x9')]({'destination':function(_0x3816c3,_0x3ea88b,_0x45ae24){_0x45ae24(null,path[_0x0700('0xa')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x423c09,_0x227544,_0x1a5dec){_0x227544['originalname']=_0x227544[_0x0700('0xb')][_0x0700('0xc')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a5dec(null,util[_0x0700('0xd')](_0x0700('0xe'),path[_0x0700('0xf')](_0x227544[_0x0700('0xb')],path['extname'](_0x227544[_0x0700('0xb')])),Date[_0x0700('0x10')](),path[_0x0700('0x11')](_0x227544['originalname'])));}})});router['post']('/',upload[_0x0700('0x12')](_0x0700('0x13')),controller[_0x0700('0x14')]);router[_0x0700('0x15')](_0x0700('0x7'),auth[_0x0700('0x5')](),controller['update']);router[_0x0700('0x16')](_0x0700('0x7'),auth['isAuthenticated'](),controller[_0x0700('0x16')]);module[_0x0700('0x17')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c060673..8a49825 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 _0x646b=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x646b,0x1b9));var _0xb646=function(_0x12fe86,_0x57ec8d){_0x12fe86=_0x12fe86-0x0;var _0x3c528b=_0x646b[_0x12fe86];return _0x3c528b;};'use strict';var Sequelize=require(_0xb646('0x0'));module[_0xb646('0x1')]={'name':{'type':Sequelize[_0xb646('0x2')],'unique':_0xb646('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb646('0x2')]},'display_name':{'type':Sequelize[_0xb646('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb646('0x2')]},'original_format':{'type':Sequelize[_0xb646('0x2')]},'original_duration':{'type':Sequelize[_0xb646('0x4')]},'original_sampleCount':{'type':Sequelize[_0xb646('0x5')]},'original_channelCount':{'type':Sequelize[_0xb646('0x6')]},'original_bitRate':{'type':Sequelize[_0xb646('0x5')]},'original_sampleRate':{'type':Sequelize[_0xb646('0x6')]},'converted_format':{'type':Sequelize[_0xb646('0x2')]},'converted_duration':{'type':Sequelize[_0xb646('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xb646('0x5')]},'converted_channelCount':{'type':Sequelize[_0xb646('0x6')]},'converted_bitRate':{'type':Sequelize[_0xb646('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd4be=['STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd4be,0x1e4));var _0xed4b=function(_0x4b5d60,_0x4e7df3){_0x4b5d60=_0x4b5d60-0x0;var _0x51f60f=_0xd4be[_0x4b5d60];return _0x51f60f;};'use strict';var Sequelize=require(_0xed4b('0x0'));module['exports']={'name':{'type':Sequelize[_0xed4b('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xed4b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xed4b('0x1')]},'original_format':{'type':Sequelize[_0xed4b('0x1')]},'original_duration':{'type':Sequelize[_0xed4b('0x2')]},'original_sampleCount':{'type':Sequelize[_0xed4b('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xed4b('0x3')]},'original_sampleRate':{'type':Sequelize[_0xed4b('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xed4b('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xed4b('0x3')]},'converted_channelCount':{'type':Sequelize[_0xed4b('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b83dfa5..2b4b9b8 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 _0xfa9a=['info','Sound\x20upload\x20destination:\x20%s','0777','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Sounds','UserProfileResource','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','download','find','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','file','originalname','extname','basename','filename','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xfa9a,0x121));var _0xafa9=function(_0x471b08,_0x402ed9){_0x471b08=_0x471b08-0x0;var _0x45df1d=_0xfa9a[_0x471b08];return _0x45df1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafa9('0x0'));var zipdir=require(_0xafa9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafa9('0x2'));var moment=require(_0xafa9('0x3'));var BPromise=require(_0xafa9('0x4'));var Mustache=require(_0xafa9('0x5'));var util=require('util');var path=require(_0xafa9('0x6'));var sox=require('sox');var csv=require(_0xafa9('0x7'));var ejs=require(_0xafa9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafa9('0x9'));var squel=require(_0xafa9('0xa'));var crypto=require(_0xafa9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xafa9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xafa9('0xd'));var Papa=require(_0xafa9('0xe'));var Redis=require(_0xafa9('0xf'));var authService=require(_0xafa9('0x10'));var qs=require(_0xafa9('0x11'));var as=require(_0xafa9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xafa9('0x13'));var utils=require(_0xafa9('0x14'));var config=require(_0xafa9('0x15'));var licenseUtil=require(_0xafa9('0x16'));var db=require(_0xafa9('0x17'))['db'];function respondWithStatusCode(_0x1094de,_0x3b3ba5){_0x3b3ba5=_0x3b3ba5||0xcc;return function(_0x47ae7b){if(_0x47ae7b){return _0x1094de[_0xafa9('0x18')](_0x3b3ba5);}return _0x1094de[_0xafa9('0x19')](_0x3b3ba5)['end']();};}function respondWithResult(_0x4dbd49,_0x1e7917){_0x1e7917=_0x1e7917||0xc8;return function(_0x230491){if(_0x230491){return _0x4dbd49[_0xafa9('0x19')](_0x1e7917)[_0xafa9('0x1a')](_0x230491);}};}function respondWithFilteredResult(_0x2f227e,_0xb260f7){return function(_0x5127b2){if(_0x5127b2){var _0xc8df20=typeof _0xb260f7[_0xafa9('0x1b')]===_0xafa9('0x1c')&&typeof _0xb260f7[_0xafa9('0x1d')]==='undefined';var _0x3cbe90=_0x5127b2[_0xafa9('0x1e')];var _0x45141f=_0xc8df20?0x0:_0xb260f7[_0xafa9('0x1b')];var _0x2dd947=_0xc8df20?_0x5127b2['count']:_0xb260f7['offset']+_0xb260f7[_0xafa9('0x1d')];var _0xf90f2;if(_0x2dd947>=_0x3cbe90){_0x2dd947=_0x3cbe90;_0xf90f2=0xc8;}else{_0xf90f2=0xce;}_0x2f227e[_0xafa9('0x19')](_0xf90f2);return _0x2f227e[_0xafa9('0x1f')](_0xafa9('0x20'),_0x45141f+'-'+_0x2dd947+'/'+_0x3cbe90)[_0xafa9('0x1a')](_0x5127b2);}return null;};}function patchUpdates(_0x311155){return function(_0x495737){try{jsonpatch[_0xafa9('0x21')](_0x495737,_0x311155,!![]);}catch(_0x52de22){return BPromise['reject'](_0x52de22);}return _0x495737[_0xafa9('0x22')]();};}function saveUpdates(_0x22d708,_0x47fb91){return function(_0x5e9949){if(_0x5e9949){return _0x5e9949[_0xafa9('0x23')](_0x22d708)[_0xafa9('0x24')](function(_0x5bdbcc){return _0x5bdbcc;});}return null;};}function removeEntity(_0x398eb7,_0x372a86){return function(_0x5c7a98){if(_0x5c7a98){return _0x5c7a98[_0xafa9('0x25')]()[_0xafa9('0x24')](function(){var _0x515371=_0x5c7a98['get']({'plain':!![]});var _0x4ca4cf=_0xafa9('0x26');return db[_0xafa9('0x27')][_0xafa9('0x25')]({'where':{'type':_0x4ca4cf,'resourceId':_0x515371['id']}})[_0xafa9('0x24')](function(){return _0x5c7a98;});})[_0xafa9('0x24')](function(){_0x398eb7[_0xafa9('0x19')](0xcc)[_0xafa9('0x28')]();});}};}function handleEntityNotFound(_0x5446bf,_0x4a7f3d){return function(_0x977439){if(!_0x977439){_0x5446bf[_0xafa9('0x18')](0x194);}return _0x977439;};}function handleError(_0x4cfee4,_0xdd679a){_0xdd679a=_0xdd679a||0x1f4;return function(_0x14a957){logger[_0xafa9('0x29')](_0x14a957[_0xafa9('0x2a')]);if(_0x14a957['name']){delete _0x14a957[_0xafa9('0x2b')];}_0x4cfee4[_0xafa9('0x19')](_0xdd679a)[_0xafa9('0x2c')](_0x14a957);};}exports[_0xafa9('0x2d')]=function(_0x1bc2f7,_0x1305c8){var _0x15a301={},_0xfdd050={},_0x4c34ed={'count':0x0,'rows':[]};var _0x32f03b=_[_0xafa9('0x2e')](db[_0xafa9('0x2f')][_0xafa9('0x30')],function(_0x2c101a){return{'name':_0x2c101a[_0xafa9('0x31')],'type':_0x2c101a[_0xafa9('0x32')][_0xafa9('0x33')]};});_0xfdd050[_0xafa9('0x34')]=_[_0xafa9('0x2e')](_0x32f03b,_0xafa9('0x2b'));_0xfdd050[_0xafa9('0x35')]=_['keys'](_0x1bc2f7['query']);_0xfdd050[_0xafa9('0x36')]=_[_0xafa9('0x37')](_0xfdd050[_0xafa9('0x34')],_0xfdd050['query']);_0x15a301[_0xafa9('0x38')]=_[_0xafa9('0x37')](_0xfdd050['model'],qs[_0xafa9('0x39')](_0x1bc2f7[_0xafa9('0x35')][_0xafa9('0x39')]));_0x15a301[_0xafa9('0x38')]=_0x15a301[_0xafa9('0x38')][_0xafa9('0x3a')]?_0x15a301[_0xafa9('0x38')]:_0xfdd050[_0xafa9('0x34')];if(!_0x1bc2f7['query']['hasOwnProperty']('nolimit')){_0x15a301[_0xafa9('0x1d')]=qs['limit'](_0x1bc2f7[_0xafa9('0x35')][_0xafa9('0x1d')]);_0x15a301[_0xafa9('0x1b')]=qs['offset'](_0x1bc2f7['query'][_0xafa9('0x1b')]);}_0x15a301[_0xafa9('0x3b')]=qs['sort'](_0x1bc2f7[_0xafa9('0x35')][_0xafa9('0x3c')]);_0x15a301[_0xafa9('0x3d')]=qs[_0xafa9('0x36')](_['pick'](_0x1bc2f7[_0xafa9('0x35')],_0xfdd050[_0xafa9('0x36')]),_0x32f03b);if(_0x1bc2f7[_0xafa9('0x35')]['filter']){_0x15a301[_0xafa9('0x3d')]=_[_0xafa9('0x3e')](_0x15a301['where'],{'$or':_['map'](_0x32f03b,function(_0x1ce759){if(_0x1ce759[_0xafa9('0x32')]!==_0xafa9('0x3f')){var _0x4022cd={};_0x4022cd[_0x1ce759[_0xafa9('0x2b')]]={'$like':'%'+_0x1bc2f7[_0xafa9('0x35')][_0xafa9('0x40')]+'%'};return _0x4022cd;}})});}_0x15a301=_[_0xafa9('0x3e')]({},_0x15a301,_0x1bc2f7[_0xafa9('0x41')]);var _0x3f2b75={'where':_0x15a301[_0xafa9('0x3d')]};return db[_0xafa9('0x2f')][_0xafa9('0x1e')](_0x3f2b75)[_0xafa9('0x24')](function(_0x1f6682){_0x4c34ed[_0xafa9('0x1e')]=_0x1f6682;if(_0x1bc2f7[_0xafa9('0x35')][_0xafa9('0x42')]){_0x15a301[_0xafa9('0x43')]=[{'all':!![]}];}return db[_0xafa9('0x2f')]['findAll'](_0x15a301);})['then'](function(_0x50e6f7){_0x4c34ed[_0xafa9('0x44')]=_0x50e6f7;return _0x4c34ed;})['then'](respondWithFilteredResult(_0x1305c8,_0x15a301))[_0xafa9('0x45')](handleError(_0x1305c8,null));};exports[_0xafa9('0x46')]=function(_0x2b6a2f,_0x269f3f){var _0x11f00e={'raw':!![],'where':{'id':_0x2b6a2f[_0xafa9('0x47')]['id']}},_0x10cd23={};_0x10cd23[_0xafa9('0x34')]=_[_0xafa9('0x48')](db[_0xafa9('0x2f')][_0xafa9('0x30')]);_0x10cd23[_0xafa9('0x35')]=_[_0xafa9('0x48')](_0x2b6a2f[_0xafa9('0x35')]);_0x10cd23[_0xafa9('0x36')]=_[_0xafa9('0x37')](_0x10cd23[_0xafa9('0x34')],_0x10cd23['query']);_0x11f00e[_0xafa9('0x38')]=_[_0xafa9('0x37')](_0x10cd23[_0xafa9('0x34')],qs[_0xafa9('0x39')](_0x2b6a2f[_0xafa9('0x35')]['fields']));_0x11f00e[_0xafa9('0x38')]=_0x11f00e[_0xafa9('0x38')][_0xafa9('0x3a')]?_0x11f00e[_0xafa9('0x38')]:_0x10cd23[_0xafa9('0x34')];if(_0x2b6a2f[_0xafa9('0x35')]['includeAll']){_0x11f00e['include']=[{'all':!![]}];}_0x11f00e=_[_0xafa9('0x3e')]({},_0x11f00e,_0x2b6a2f[_0xafa9('0x41')]);return db[_0xafa9('0x2f')]['find'](_0x11f00e)[_0xafa9('0x24')](handleEntityNotFound(_0x269f3f,null))['then'](respondWithResult(_0x269f3f,null))['catch'](handleError(_0x269f3f,null));};exports[_0xafa9('0x49')]=function(_0x519660,_0x25bca1,_0x633e57){return db[_0xafa9('0x2f')][_0xafa9('0x4a')]({'where':{'id':_0x519660['params']['id']},'attributes':[_0xafa9('0x2b'),_0xafa9('0x4b'),_0xafa9('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x25bca1,null))[_0xafa9('0x24')](function(_0x1c18ba){if(_0x1c18ba){if(!fs[_0xafa9('0x4d')](path[_0xafa9('0x4e')](config['root'],_0xafa9('0x4f'),_0x1c18ba[_0xafa9('0x4b')]+'.'+_0x1c18ba['converted_format']))){throw new db[(_0xafa9('0x50'))][(_0xafa9('0x51'))](_0xafa9('0x52'));}return _0x25bca1[_0xafa9('0x49')](path['join'](config[_0xafa9('0x53')],'server/files/sounds/converted',util[_0xafa9('0x54')](_0xafa9('0x55'),_0x1c18ba['save_name'],_0x1c18ba[_0xafa9('0x4c')])),util[_0xafa9('0x54')](_0xafa9('0x55'),_0x1c18ba[_0xafa9('0x2b')],_0x1c18ba['converted_format']));}return null;})[_0xafa9('0x45')](handleError(_0x25bca1,null));};exports[_0xafa9('0x56')]=function(_0x470460,_0x45f0d4,_0x2391aa){var _0x5a47b9={'name':path['basename'](_0x470460[_0xafa9('0x57')][_0xafa9('0x58')],path[_0xafa9('0x59')](_0x470460['file'][_0xafa9('0x58')])),'save_name':path[_0xafa9('0x5a')](_0x470460[_0xafa9('0x57')]['filename'],path['extname'](_0x470460[_0xafa9('0x57')][_0xafa9('0x5b')])),'original_format':path[_0xafa9('0x59')](_0x470460[_0xafa9('0x57')]['originalname'])[_0xafa9('0x5c')](0x1),'converted_format':'wav'};var _0x3ff5fa=path[_0xafa9('0x4e')](config['root'],_0xafa9('0x5d'),_0x470460[_0xafa9('0x57')][_0xafa9('0x5b')]);var _0xaec6a2=path[_0xafa9('0x4e')](config[_0xafa9('0x53')],'server/files/sounds/converted',util['format'](_0xafa9('0x55'),path[_0xafa9('0x5a')](_0x470460['file'][_0xafa9('0x5b')],path[_0xafa9('0x59')](_0x470460[_0xafa9('0x57')][_0xafa9('0x5b')])),_0x5a47b9[_0xafa9('0x4c')]));logger['info'](_0xafa9('0x5e'),_0x3ff5fa);logger[_0xafa9('0x5f')](_0xafa9('0x60'),_0xaec6a2);try{fs['chmodSync'](_0x3ff5fa,parseInt(_0xafa9('0x61'),0x8));var _0x34c2bc=sox['transcode'](_0x3ff5fa,_0xaec6a2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34c2bc['on'](_0xafa9('0x29'),function(_0x4a89d6){fs['unlinkSync'](_0x3ff5fa);_0x45f0d4['status'](0x1f4)['send'](_0x4a89d6);});_0x34c2bc['on']('src',function(_0x58390f){_0x5a47b9[_0xafa9('0x62')]=isNaN(_0x58390f['duration'])?null:_0x58390f[_0xafa9('0x63')]*0x3e8;_0x5a47b9[_0xafa9('0x64')]=isNaN(_0x58390f[_0xafa9('0x65')])?null:_0x58390f[_0xafa9('0x65')];_0x5a47b9['original_channelCount']=isNaN(_0x58390f[_0xafa9('0x66')])?null:_0x58390f[_0xafa9('0x66')];_0x5a47b9[_0xafa9('0x67')]=isNaN(_0x58390f[_0xafa9('0x68')])?null:_0x58390f[_0xafa9('0x68')];_0x5a47b9[_0xafa9('0x69')]=isNaN(_0x58390f[_0xafa9('0x6a')])?null:_0x58390f[_0xafa9('0x6a')];});_0x34c2bc['on'](_0xafa9('0x6b'),function(_0x253da0){_0x5a47b9[_0xafa9('0x6c')]=isNaN(_0x253da0[_0xafa9('0x63')])?null:_0x253da0[_0xafa9('0x63')]*0x3e8;_0x5a47b9[_0xafa9('0x6d')]=isNaN(_0x253da0[_0xafa9('0x65')])?null:_0x253da0['sampleCount'];_0x5a47b9['converted_channelCount']=isNaN(_0x253da0['channelCount'])?null:_0x253da0[_0xafa9('0x66')];_0x5a47b9[_0xafa9('0x6e')]=isNaN(_0x253da0[_0xafa9('0x68')])?null:_0x253da0[_0xafa9('0x68')];_0x5a47b9[_0xafa9('0x6f')]=isNaN(_0x253da0['sampleRate'])?null:_0x253da0[_0xafa9('0x6a')];});_0x34c2bc['on'](_0xafa9('0x28'),function(){fs[_0xafa9('0x70')](_0xaec6a2,parseInt(_0xafa9('0x61'),0x8));return db['Sound']['create'](_0x5a47b9)[_0xafa9('0x24')](function(_0x54137e){var _0x426057={'role':_0x470460['body'][_0xafa9('0x71')],'userProfileId':_0x470460[_0xafa9('0x72')][_0xafa9('0x73')]};if(!_0x426057)throw new Error(_0xafa9('0x74'));if(_0x426057[_0xafa9('0x71')]===_0xafa9('0x75')){var _0x48fe0b=_0x54137e[_0xafa9('0x76')]({'plain':!![]});return db[_0xafa9('0x77')]['find']({'where':{'name':'Sounds','userProfileId':_0x426057[_0xafa9('0x73')]},'raw':!![]})[_0xafa9('0x24')](function(_0xef947a){if(_0xef947a&&_0xef947a[_0xafa9('0x78')]===0x0){return db[_0xafa9('0x27')][_0xafa9('0x56')]({'name':_0x48fe0b[_0xafa9('0x2b')],'resourceId':_0x48fe0b['id'],'type':_0xef947a['name'],'sectionId':_0xef947a['id']},{})['then'](function(){return _0x54137e;});}else{return _0x54137e;}})[_0xafa9('0x45')](function(_0x56518d){logger['error'](_0xafa9('0x79'),_0x56518d);throw _0x56518d;});}return _0x54137e;})[_0xafa9('0x24')](respondWithResult(_0x45f0d4,null))['catch'](handleError(_0x45f0d4,null));});_0x34c2bc[_0xafa9('0x7a')]();}catch(_0x3825ce){_0x45f0d4[_0xafa9('0x19')](0x1f4)[_0xafa9('0x2c')](_0x3825ce);}};exports[_0xafa9('0x23')]=function(_0x1f2660,_0x3b5485,_0x253fda){return db[_0xafa9('0x2f')]['find']({'where':{'id':_0x1f2660[_0xafa9('0x47')]['id']}})[_0xafa9('0x24')](handleEntityNotFound(_0x3b5485,null))['then'](saveUpdates(_[_0xafa9('0x7b')](_0x1f2660['body'],[_0xafa9('0x2b'),_0xafa9('0x7c')]),null))['then'](respondWithResult(_0x3b5485,null))[_0xafa9('0x45')](handleError(_0x3b5485,null));};exports[_0xafa9('0x7d')]=function(_0x3cf24d,_0x3e6a28,_0xc52b2e){return db[_0xafa9('0x2f')][_0xafa9('0x4a')]({'where':{'id':_0x3cf24d['params']['id']}})[_0xafa9('0x24')](function(_0x40cf6f){if(_0x40cf6f){return _0x40cf6f['destroy']();}})[_0xafa9('0x24')](function(_0x29940a){var _0x2a8d5c=path[_0xafa9('0x4e')](config[_0xafa9('0x53')],_0xafa9('0x5d'),util[_0xafa9('0x54')](_0xafa9('0x55'),_0x29940a[_0xafa9('0x4b')],_0x29940a[_0xafa9('0x7e')]));var _0x1eb8cb=path[_0xafa9('0x4e')](config[_0xafa9('0x53')],_0xafa9('0x4f'),util['format'](_0xafa9('0x55'),_0x29940a['save_name'],_0x29940a[_0xafa9('0x4c')]));fs[_0xafa9('0x7f')](_0x2a8d5c);fs[_0xafa9('0x7f')](_0x1eb8cb);return _0x29940a;})[_0xafa9('0x24')](function(_0x532789){if(_0x532789){return _0x3e6a28[_0xafa9('0x19')](0xcc)[_0xafa9('0x28')]();}})['then'](handleEntityNotFound(_0x3e6a28,null))[_0xafa9('0x45')](handleError(_0x3e6a28,null));}; \ No newline at end of file +var _0xe69e=['set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','download','find','save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','converted_format','basename','file','originalname','filename','substring','wav','extname','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit'];(function(_0x2354a3,_0x29b908){var _0x1fd14a=function(_0x425635){while(--_0x425635){_0x2354a3['push'](_0x2354a3['shift']());}};_0x1fd14a(++_0x29b908);}(_0xe69e,0xde));var _0xee69=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xe69e[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xee69('0x0'));var rimraf=require(_0xee69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xee69('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee69('0x3'));var util=require(_0xee69('0x4'));var path=require('path');var sox=require(_0xee69('0x5'));var csv=require(_0xee69('0x6'));var ejs=require(_0xee69('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee69('0x8'));var crypto=require(_0xee69('0x9'));var jsforce=require(_0xee69('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xee69('0x6'));var querystring=require(_0xee69('0xb'));var Papa=require(_0xee69('0xc'));var Redis=require(_0xee69('0xd'));var authService=require(_0xee69('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee69('0xf'));var logger=require(_0xee69('0x10'))('api');var utils=require(_0xee69('0x11'));var config=require(_0xee69('0x12'));var licenseUtil=require(_0xee69('0x13'));var db=require(_0xee69('0x14'))['db'];function respondWithStatusCode(_0x1cde63,_0x4b3a08){_0x4b3a08=_0x4b3a08||0xcc;return function(_0x1feda3){if(_0x1feda3){return _0x1cde63['sendStatus'](_0x4b3a08);}return _0x1cde63[_0xee69('0x15')](_0x4b3a08)[_0xee69('0x16')]();};}function respondWithResult(_0x45e064,_0x35624e){_0x35624e=_0x35624e||0xc8;return function(_0xd7282a){if(_0xd7282a){return _0x45e064[_0xee69('0x15')](_0x35624e)[_0xee69('0x17')](_0xd7282a);}};}function respondWithFilteredResult(_0x410c92,_0x54a671){return function(_0x1527ce){if(_0x1527ce){var _0x16adaa=typeof _0x54a671[_0xee69('0x18')]===_0xee69('0x19')&&typeof _0x54a671['limit']==='undefined';var _0x2bc82b=_0x1527ce['count'];var _0x161adf=_0x16adaa?0x0:_0x54a671['offset'];var _0x11a511=_0x16adaa?_0x1527ce[_0xee69('0x1a')]:_0x54a671[_0xee69('0x18')]+_0x54a671[_0xee69('0x1b')];var _0x2156e0;if(_0x11a511>=_0x2bc82b){_0x11a511=_0x2bc82b;_0x2156e0=0xc8;}else{_0x2156e0=0xce;}_0x410c92['status'](_0x2156e0);return _0x410c92[_0xee69('0x1c')](_0xee69('0x1d'),_0x161adf+'-'+_0x11a511+'/'+_0x2bc82b)[_0xee69('0x17')](_0x1527ce);}return null;};}function patchUpdates(_0x37e856){return function(_0x248f66){try{jsonpatch[_0xee69('0x1e')](_0x248f66,_0x37e856,!![]);}catch(_0x1e8881){return BPromise[_0xee69('0x1f')](_0x1e8881);}return _0x248f66[_0xee69('0x20')]();};}function saveUpdates(_0x295d41,_0x418a84){return function(_0x1aab4a){if(_0x1aab4a){return _0x1aab4a[_0xee69('0x21')](_0x295d41)[_0xee69('0x22')](function(_0x3c7edc){return _0x3c7edc;});}return null;};}function removeEntity(_0x17e22e,_0x431931){return function(_0x1bcd61){if(_0x1bcd61){return _0x1bcd61[_0xee69('0x23')]()[_0xee69('0x22')](function(){var _0x2e2796=_0x1bcd61[_0xee69('0x24')]({'plain':!![]});var _0x24b683=_0xee69('0x25');return db[_0xee69('0x26')][_0xee69('0x23')]({'where':{'type':_0x24b683,'resourceId':_0x2e2796['id']}})['then'](function(){return _0x1bcd61;});})[_0xee69('0x22')](function(){_0x17e22e['status'](0xcc)[_0xee69('0x16')]();});}};}function handleEntityNotFound(_0x2cb23d,_0x4f6ac2){return function(_0x5520ae){if(!_0x5520ae){_0x2cb23d[_0xee69('0x27')](0x194);}return _0x5520ae;};}function handleError(_0x54f3f9,_0x1e8849){_0x1e8849=_0x1e8849||0x1f4;return function(_0x2e6de1){logger[_0xee69('0x28')](_0x2e6de1[_0xee69('0x29')]);if(_0x2e6de1[_0xee69('0x2a')]){delete _0x2e6de1[_0xee69('0x2a')];}_0x54f3f9[_0xee69('0x15')](_0x1e8849)[_0xee69('0x2b')](_0x2e6de1);};}exports[_0xee69('0x2c')]=function(_0x409dae,_0x69b822){var _0x5b73d3={},_0x1ac53d={},_0x4c802a={'count':0x0,'rows':[]};var _0x2b9857=_[_0xee69('0x2d')](db[_0xee69('0x2e')][_0xee69('0x2f')],function(_0x41184a){return{'name':_0x41184a['fieldName'],'type':_0x41184a[_0xee69('0x30')]['key']};});_0x1ac53d['model']=_[_0xee69('0x2d')](_0x2b9857,'name');_0x1ac53d['query']=_[_0xee69('0x31')](_0x409dae[_0xee69('0x32')]);_0x1ac53d[_0xee69('0x33')]=_[_0xee69('0x34')](_0x1ac53d[_0xee69('0x35')],_0x1ac53d[_0xee69('0x32')]);_0x5b73d3['attributes']=_[_0xee69('0x34')](_0x1ac53d[_0xee69('0x35')],qs[_0xee69('0x36')](_0x409dae[_0xee69('0x32')][_0xee69('0x36')]));_0x5b73d3['attributes']=_0x5b73d3[_0xee69('0x37')]['length']?_0x5b73d3[_0xee69('0x37')]:_0x1ac53d['model'];if(!_0x409dae['query'][_0xee69('0x38')](_0xee69('0x39'))){_0x5b73d3[_0xee69('0x1b')]=qs['limit'](_0x409dae[_0xee69('0x32')]['limit']);_0x5b73d3[_0xee69('0x18')]=qs[_0xee69('0x18')](_0x409dae[_0xee69('0x32')][_0xee69('0x18')]);}_0x5b73d3[_0xee69('0x3a')]=qs['sort'](_0x409dae[_0xee69('0x32')][_0xee69('0x3b')]);_0x5b73d3['where']=qs[_0xee69('0x33')](_[_0xee69('0x3c')](_0x409dae[_0xee69('0x32')],_0x1ac53d['filters']),_0x2b9857);if(_0x409dae[_0xee69('0x32')]['filter']){_0x5b73d3[_0xee69('0x3d')]=_[_0xee69('0x3e')](_0x5b73d3[_0xee69('0x3d')],{'$or':_[_0xee69('0x2d')](_0x2b9857,function(_0x5f4354){if(_0x5f4354[_0xee69('0x30')]!==_0xee69('0x3f')){var _0x302165={};_0x302165[_0x5f4354[_0xee69('0x2a')]]={'$like':'%'+_0x409dae['query'][_0xee69('0x40')]+'%'};return _0x302165;}})});}_0x5b73d3=_[_0xee69('0x3e')]({},_0x5b73d3,_0x409dae[_0xee69('0x41')]);var _0xe0d47a={'where':_0x5b73d3[_0xee69('0x3d')]};return db[_0xee69('0x2e')]['count'](_0xe0d47a)['then'](function(_0x31fdb7){_0x4c802a[_0xee69('0x1a')]=_0x31fdb7;if(_0x409dae[_0xee69('0x32')][_0xee69('0x42')]){_0x5b73d3[_0xee69('0x43')]=[{'all':!![]}];}return db[_0xee69('0x2e')]['findAll'](_0x5b73d3);})['then'](function(_0x1025c7){_0x4c802a['rows']=_0x1025c7;return _0x4c802a;})[_0xee69('0x22')](respondWithFilteredResult(_0x69b822,_0x5b73d3))[_0xee69('0x44')](handleError(_0x69b822,null));};exports[_0xee69('0x45')]=function(_0x20e49c,_0x113d4f){var _0x5b350f={'raw':!![],'where':{'id':_0x20e49c[_0xee69('0x46')]['id']}},_0x1eafec={};_0x1eafec[_0xee69('0x35')]=_[_0xee69('0x31')](db[_0xee69('0x2e')]['rawAttributes']);_0x1eafec[_0xee69('0x32')]=_[_0xee69('0x31')](_0x20e49c[_0xee69('0x32')]);_0x1eafec['filters']=_[_0xee69('0x34')](_0x1eafec['model'],_0x1eafec[_0xee69('0x32')]);_0x5b350f[_0xee69('0x37')]=_['intersection'](_0x1eafec[_0xee69('0x35')],qs[_0xee69('0x36')](_0x20e49c['query']['fields']));_0x5b350f['attributes']=_0x5b350f[_0xee69('0x37')]['length']?_0x5b350f['attributes']:_0x1eafec[_0xee69('0x35')];if(_0x20e49c[_0xee69('0x32')][_0xee69('0x42')]){_0x5b350f[_0xee69('0x43')]=[{'all':!![]}];}_0x5b350f=_[_0xee69('0x3e')]({},_0x5b350f,_0x20e49c['options']);return db[_0xee69('0x2e')]['find'](_0x5b350f)[_0xee69('0x22')](handleEntityNotFound(_0x113d4f,null))['then'](respondWithResult(_0x113d4f,null))[_0xee69('0x44')](handleError(_0x113d4f,null));};exports[_0xee69('0x47')]=function(_0x1a1f75,_0x3847f3,_0x5410cf){return db[_0xee69('0x2e')][_0xee69('0x48')]({'where':{'id':_0x1a1f75[_0xee69('0x46')]['id']},'attributes':[_0xee69('0x2a'),_0xee69('0x49'),'converted_format'],'raw':!![]})[_0xee69('0x22')](handleEntityNotFound(_0x3847f3,null))[_0xee69('0x22')](function(_0x5c5586){if(_0x5c5586){if(!fs[_0xee69('0x4a')](path[_0xee69('0x4b')](config['root'],_0xee69('0x4c'),_0x5c5586[_0xee69('0x49')]+'.'+_0x5c5586['converted_format']))){throw new db[(_0xee69('0x4d'))][(_0xee69('0x4e'))](_0xee69('0x4f'));}return _0x3847f3[_0xee69('0x47')](path['join'](config[_0xee69('0x50')],_0xee69('0x4c'),util[_0xee69('0x51')](_0xee69('0x52'),_0x5c5586['save_name'],_0x5c5586[_0xee69('0x53')])),util[_0xee69('0x51')](_0xee69('0x52'),_0x5c5586[_0xee69('0x2a')],_0x5c5586[_0xee69('0x53')]));}return null;})['catch'](handleError(_0x3847f3,null));};exports['create']=function(_0x50d52d,_0x9786ef,_0x279595){var _0x33ca1d={'name':path[_0xee69('0x54')](_0x50d52d[_0xee69('0x55')]['originalname'],path['extname'](_0x50d52d[_0xee69('0x55')][_0xee69('0x56')])),'save_name':path['basename'](_0x50d52d['file'][_0xee69('0x57')],path['extname'](_0x50d52d[_0xee69('0x55')][_0xee69('0x57')])),'original_format':path['extname'](_0x50d52d['file'][_0xee69('0x56')])[_0xee69('0x58')](0x1),'converted_format':_0xee69('0x59')};var _0x40bfe1=path[_0xee69('0x4b')](config[_0xee69('0x50')],'server/files/sounds/original',_0x50d52d[_0xee69('0x55')][_0xee69('0x57')]);var _0x39b9dc=path[_0xee69('0x4b')](config[_0xee69('0x50')],_0xee69('0x4c'),util[_0xee69('0x51')](_0xee69('0x52'),path[_0xee69('0x54')](_0x50d52d[_0xee69('0x55')][_0xee69('0x57')],path[_0xee69('0x5a')](_0x50d52d['file'][_0xee69('0x57')])),_0x33ca1d[_0xee69('0x53')]));logger[_0xee69('0x5b')](_0xee69('0x5c'),_0x40bfe1);logger['info'](_0xee69('0x5d'),_0x39b9dc);try{fs[_0xee69('0x5e')](_0x40bfe1,parseInt('0777',0x8));var _0x450475=sox[_0xee69('0x5f')](_0x40bfe1,_0x39b9dc,{'sampleRate':0x1f40,'format':_0xee69('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x450475['on']('error',function(_0xa3443a){fs['unlinkSync'](_0x40bfe1);_0x9786ef[_0xee69('0x15')](0x1f4)[_0xee69('0x2b')](_0xa3443a);});_0x450475['on'](_0xee69('0x60'),function(_0x4525da){_0x33ca1d[_0xee69('0x61')]=isNaN(_0x4525da[_0xee69('0x62')])?null:_0x4525da['duration']*0x3e8;_0x33ca1d['original_sampleCount']=isNaN(_0x4525da[_0xee69('0x63')])?null:_0x4525da[_0xee69('0x63')];_0x33ca1d[_0xee69('0x64')]=isNaN(_0x4525da[_0xee69('0x65')])?null:_0x4525da[_0xee69('0x65')];_0x33ca1d[_0xee69('0x66')]=isNaN(_0x4525da['bitRate'])?null:_0x4525da[_0xee69('0x67')];_0x33ca1d[_0xee69('0x68')]=isNaN(_0x4525da[_0xee69('0x69')])?null:_0x4525da[_0xee69('0x69')];});_0x450475['on']('dest',function(_0x34d2c9){_0x33ca1d[_0xee69('0x6a')]=isNaN(_0x34d2c9[_0xee69('0x62')])?null:_0x34d2c9[_0xee69('0x62')]*0x3e8;_0x33ca1d[_0xee69('0x6b')]=isNaN(_0x34d2c9['sampleCount'])?null:_0x34d2c9[_0xee69('0x63')];_0x33ca1d[_0xee69('0x6c')]=isNaN(_0x34d2c9['channelCount'])?null:_0x34d2c9[_0xee69('0x65')];_0x33ca1d[_0xee69('0x6d')]=isNaN(_0x34d2c9[_0xee69('0x67')])?null:_0x34d2c9[_0xee69('0x67')];_0x33ca1d[_0xee69('0x6e')]=isNaN(_0x34d2c9[_0xee69('0x69')])?null:_0x34d2c9['sampleRate'];});_0x450475['on'](_0xee69('0x16'),function(){fs['chmodSync'](_0x39b9dc,parseInt(_0xee69('0x6f'),0x8));return db[_0xee69('0x2e')]['create'](_0x33ca1d)[_0xee69('0x22')](function(_0x40467f){var _0x4e6641={'role':_0x50d52d[_0xee69('0x70')][_0xee69('0x71')],'userProfileId':_0x50d52d[_0xee69('0x70')][_0xee69('0x72')]};if(!_0x4e6641)throw new Error(_0xee69('0x73'));if(_0x4e6641[_0xee69('0x71')]===_0xee69('0x74')){var _0x1a50fd=_0x40467f[_0xee69('0x24')]({'plain':!![]});return db[_0xee69('0x75')][_0xee69('0x48')]({'where':{'name':_0xee69('0x25'),'userProfileId':_0x4e6641[_0xee69('0x72')]},'raw':!![]})['then'](function(_0x19f00b){if(_0x19f00b&&_0x19f00b[_0xee69('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a50fd[_0xee69('0x2a')],'resourceId':_0x1a50fd['id'],'type':_0x19f00b[_0xee69('0x2a')],'sectionId':_0x19f00b['id']},{})['then'](function(){return _0x40467f;});}else{return _0x40467f;}})[_0xee69('0x44')](function(_0x20da32){logger[_0xee69('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20da32);throw _0x20da32;});}return _0x40467f;})[_0xee69('0x22')](respondWithResult(_0x9786ef,null))[_0xee69('0x44')](handleError(_0x9786ef,null));});_0x450475[_0xee69('0x77')]();}catch(_0x430fcb){_0x9786ef[_0xee69('0x15')](0x1f4)[_0xee69('0x2b')](_0x430fcb);}};exports[_0xee69('0x21')]=function(_0x25df56,_0xc60d75,_0x3d011d){return db[_0xee69('0x2e')][_0xee69('0x48')]({'where':{'id':_0x25df56[_0xee69('0x46')]['id']}})['then'](handleEntityNotFound(_0xc60d75,null))[_0xee69('0x22')](saveUpdates(_[_0xee69('0x3c')](_0x25df56[_0xee69('0x70')],[_0xee69('0x2a'),_0xee69('0x78')]),null))[_0xee69('0x22')](respondWithResult(_0xc60d75,null))[_0xee69('0x44')](handleError(_0xc60d75,null));};exports[_0xee69('0x79')]=function(_0x5ae44d,_0xec529b,_0x35497c){return db['Sound'][_0xee69('0x48')]({'where':{'id':_0x5ae44d[_0xee69('0x46')]['id']}})['then'](function(_0x292009){if(_0x292009){return _0x292009[_0xee69('0x23')]();}})['then'](function(_0x199580){var _0x1f068f=path[_0xee69('0x4b')](config[_0xee69('0x50')],_0xee69('0x7a'),util['format'](_0xee69('0x52'),_0x199580[_0xee69('0x49')],_0x199580[_0xee69('0x7b')]));var _0x4916c1=path['join'](config[_0xee69('0x50')],_0xee69('0x4c'),util[_0xee69('0x51')]('%s.%s',_0x199580[_0xee69('0x49')],_0x199580['converted_format']));fs[_0xee69('0x7c')](_0x1f068f);fs[_0xee69('0x7c')](_0x4916c1);return _0x199580;})[_0xee69('0x22')](function(_0x46bb27){if(_0x46bb27){return _0xec529b[_0xee69('0x15')](0xcc)[_0xee69('0x16')]();}})['then'](handleEntityNotFound(_0xec529b,null))[_0xee69('0x44')](handleError(_0xec529b,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2f84077..4950151 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 _0x93be=['tools_sounds','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x93be,0x1ae));var _0xe93b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x93be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe93b('0x0'));var util=require('util');var logger=require(_0xe93b('0x1'))(_0xe93b('0x2'));var moment=require('moment');var BPromise=require(_0xe93b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe93b('0x4'));var config=require(_0xe93b('0x5'));var attributes=require(_0xe93b('0x6'));module[_0xe93b('0x7')]=function(_0x46b044,_0x1e916d){return _0x46b044[_0xe93b('0x8')](_0xe93b('0x9'),attributes,{'tableName':_0xe93b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a3e=['path','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c7577,_0x46dcf5){var _0x35dde6=function(_0x4f6948){while(--_0x4f6948){_0x3c7577['push'](_0x3c7577['shift']());}};_0x35dde6(++_0x46dcf5);}(_0x1a3e,0x117));var _0xe1a3=function(_0x30450b,_0x4eb469){_0x30450b=_0x30450b-0x0;var _0xbd1b59=_0x1a3e[_0x30450b];return _0xbd1b59;};'use strict';var _=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var logger=require(_0xe1a3('0x2'))(_0xe1a3('0x3'));var moment=require(_0xe1a3('0x4'));var BPromise=require(_0xe1a3('0x5'));var rp=require(_0xe1a3('0x6'));var fs=require('fs');var path=require(_0xe1a3('0x7'));var rimraf=require('rimraf');var config=require(_0xe1a3('0x8'));var attributes=require(_0xe1a3('0x9'));module[_0xe1a3('0xa')]=function(_0x2f05ed,_0x585289){return _0x2f05ed[_0xe1a3('0xb')](_0xe1a3('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index f4ba6ad..2105a47 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 _0x2f23=['options','raw','where','attributes','include','map','model','then','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find'];(function(_0xc20b3d,_0x55a22b){var _0x81b125=function(_0xed5785){while(--_0xed5785){_0xc20b3d['push'](_0xc20b3d['shift']());}};_0x81b125(++_0x55a22b);}(_0x2f23,0xa8));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32f2('0x1'));var rs=require(_0x32f2('0x2'));var fs=require('fs');var Redis=require(_0x32f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x32f2('0x4'));var logger=require(_0x32f2('0x5'))(_0x32f2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x32f2('0x7')][_0x32f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x242b0a,_0x84a84a,_0x2a55ce){return new BPromise(function(_0x458916,_0xe000c7){return client[_0x32f2('0x9')](_0x242b0a,_0x2a55ce)['then'](function(_0x16f63b){logger[_0x32f2('0xa')](_0x32f2('0xb'),_0x84a84a,'request\x20sent');logger[_0x32f2('0xc')](_0x32f2('0xd'),_0x84a84a,_0x32f2('0xe'),JSON[_0x32f2('0xf')](_0x16f63b));if(_0x16f63b[_0x32f2('0x10')]){if(_0x16f63b[_0x32f2('0x10')][_0x32f2('0x11')]===0x1f4){logger[_0x32f2('0x10')]('Sound,\x20%s,\x20%s',_0x84a84a,_0x16f63b[_0x32f2('0x10')][_0x32f2('0x12')]);return _0xe000c7(_0x16f63b[_0x32f2('0x10')][_0x32f2('0x12')]);}logger[_0x32f2('0x10')](_0x32f2('0xb'),_0x84a84a,_0x16f63b[_0x32f2('0x10')][_0x32f2('0x12')]);return _0x458916(_0x16f63b[_0x32f2('0x10')][_0x32f2('0x12')]);}else{logger[_0x32f2('0xa')](_0x32f2('0xb'),_0x84a84a,'request\x20sent');_0x458916(_0x16f63b[_0x32f2('0x13')]['message']);}})[_0x32f2('0x14')](function(_0x59c0c4){logger[_0x32f2('0x10')](_0x32f2('0xb'),_0x84a84a,_0x59c0c4);_0xe000c7(_0x59c0c4);});});}exports[_0x32f2('0x15')]=function(_0x346776){var _0x1ac700=this;return new Promise(function(_0x344cdf,_0x1d0fc3){return db[_0x32f2('0x16')][_0x32f2('0x17')]({'raw':_0x346776['options']?_0x346776[_0x32f2('0x18')][_0x32f2('0x19')]===undefined?!![]:![]:!![],'where':_0x346776['options']?_0x346776[_0x32f2('0x18')][_0x32f2('0x1a')]||null:null,'attributes':_0x346776[_0x32f2('0x18')]?_0x346776[_0x32f2('0x18')][_0x32f2('0x1b')]||null:null,'include':_0x346776[_0x32f2('0x18')]?_0x346776[_0x32f2('0x18')][_0x32f2('0x1c')]?_['map'](_0x346776['options'][_0x32f2('0x1c')],function(_0x1dd2b8){return{'model':db[_0x1dd2b8['model']],'as':_0x1dd2b8['as'],'attributes':_0x1dd2b8[_0x32f2('0x1b')],'include':_0x1dd2b8['include']?_[_0x32f2('0x1d')](_0x1dd2b8[_0x32f2('0x1c')],function(_0x3a416f){return{'model':db[_0x3a416f[_0x32f2('0x1e')]],'as':_0x3a416f['as'],'attributes':_0x3a416f['attributes'],'include':_0x3a416f[_0x32f2('0x1c')]?_['map'](_0x3a416f['include'],function(_0xbf63da){return{'model':db[_0xbf63da['model']],'as':_0xbf63da['as'],'attributes':_0xbf63da['attributes']};}):[]};}):[]};}):[]:[]})[_0x32f2('0x1f')](function(_0xe89983){logger[_0x32f2('0xa')](_0x32f2('0x15'),_0x346776);logger[_0x32f2('0xc')]('ShowSound',_0x346776,JSON[_0x32f2('0xf')](_0xe89983));_0x344cdf(_0xe89983);})[_0x32f2('0x14')](function(_0x4350ab){logger[_0x32f2('0x10')](_0x32f2('0x15'),_0x4350ab[_0x32f2('0x12')],_0x346776);_0x1d0fc3(_0x1ac700[_0x32f2('0x10')](0x1f4,_0x4350ab[_0x32f2('0x12')]));});});}; \ No newline at end of file +var _0xa601=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','then','lodash','util','moment','bluebird'];(function(_0x268b08,_0x15ae4f){var _0x464638=function(_0x22e9a8){while(--_0x22e9a8){_0x268b08['push'](_0x268b08['shift']());}};_0x464638(++_0x15ae4f);}(_0xa601,0xf4));var _0x1a60=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa601[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1a60('0x0'));var util=require(_0x1a60('0x1'));var moment=require(_0x1a60('0x2'));var BPromise=require(_0x1a60('0x3'));var rs=require(_0x1a60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a60('0x5'));var logger=require(_0x1a60('0x6'))(_0x1a60('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a60('0x8'));var client=jayson[_0x1a60('0x9')][_0x1a60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdcf5f2,_0x4a7b4a,_0x49bc97){return new BPromise(function(_0x218e77,_0x1f7886){return client[_0x1a60('0xb')](_0xdcf5f2,_0x49bc97)['then'](function(_0x181568){logger[_0x1a60('0xc')](_0x1a60('0xd'),_0x4a7b4a,_0x1a60('0xe'));logger[_0x1a60('0xf')](_0x1a60('0x10'),_0x4a7b4a,_0x1a60('0xe'),JSON[_0x1a60('0x11')](_0x181568));if(_0x181568['error']){if(_0x181568[_0x1a60('0x12')]['code']===0x1f4){logger[_0x1a60('0x12')]('Sound,\x20%s,\x20%s',_0x4a7b4a,_0x181568[_0x1a60('0x12')][_0x1a60('0x13')]);return _0x1f7886(_0x181568[_0x1a60('0x12')][_0x1a60('0x13')]);}logger[_0x1a60('0x12')](_0x1a60('0xd'),_0x4a7b4a,_0x181568['error'][_0x1a60('0x13')]);return _0x218e77(_0x181568['error'][_0x1a60('0x13')]);}else{logger['info'](_0x1a60('0xd'),_0x4a7b4a,_0x1a60('0xe'));_0x218e77(_0x181568['result'][_0x1a60('0x13')]);}})[_0x1a60('0x14')](function(_0x14abb4){logger['error']('Sound,\x20%s,\x20%s',_0x4a7b4a,_0x14abb4);_0x1f7886(_0x14abb4);});});}exports[_0x1a60('0x15')]=function(_0x2b0191){var _0x2862f4=this;return new Promise(function(_0xf13608,_0x5cae01){return db[_0x1a60('0x16')][_0x1a60('0x17')]({'raw':_0x2b0191[_0x1a60('0x18')]?_0x2b0191[_0x1a60('0x18')][_0x1a60('0x19')]===undefined?!![]:![]:!![],'where':_0x2b0191[_0x1a60('0x18')]?_0x2b0191['options']['where']||null:null,'attributes':_0x2b0191[_0x1a60('0x18')]?_0x2b0191[_0x1a60('0x18')][_0x1a60('0x1a')]||null:null,'include':_0x2b0191['options']?_0x2b0191[_0x1a60('0x18')][_0x1a60('0x1b')]?_[_0x1a60('0x1c')](_0x2b0191[_0x1a60('0x18')]['include'],function(_0x36c776){return{'model':db[_0x36c776[_0x1a60('0x1d')]],'as':_0x36c776['as'],'attributes':_0x36c776[_0x1a60('0x1a')],'include':_0x36c776[_0x1a60('0x1b')]?_['map'](_0x36c776[_0x1a60('0x1b')],function(_0x2fe9f3){return{'model':db[_0x2fe9f3[_0x1a60('0x1d')]],'as':_0x2fe9f3['as'],'attributes':_0x2fe9f3[_0x1a60('0x1a')],'include':_0x2fe9f3[_0x1a60('0x1b')]?_[_0x1a60('0x1c')](_0x2fe9f3[_0x1a60('0x1b')],function(_0xcf80f0){return{'model':db[_0xcf80f0[_0x1a60('0x1d')]],'as':_0xcf80f0['as'],'attributes':_0xcf80f0[_0x1a60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1a60('0x1e')](function(_0x314f39){logger[_0x1a60('0xc')]('ShowSound',_0x2b0191);logger[_0x1a60('0xf')](_0x1a60('0x15'),_0x2b0191,JSON[_0x1a60('0x11')](_0x314f39));_0xf13608(_0x314f39);})[_0x1a60('0x14')](function(_0x42dd94){logger[_0x1a60('0x12')](_0x1a60('0x15'),_0x42dd94[_0x1a60('0x13')],_0x2b0191);_0x5cae01(_0x2862f4[_0x1a60('0x12')](0x1f4,_0x42dd94[_0x1a60('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 818673a..32d1b8f 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x2bff13,_0x47c324){var _0x13e166=function(_0x36c4d0){while(--_0x36c4d0){_0x2bff13['push'](_0x2bff13['shift']());}};_0x13e166(++_0x47c324);}(_0x5eb8,0xb0));var _0x85eb=function(_0x40f5b7,_0xb3243e){_0x40f5b7=_0x40f5b7-0x0;var _0x3c884a=_0x5eb8[_0x40f5b7];return _0x3c884a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x75600b,_0x551b8a){var _0xdc0062=function(_0x3de189){while(--_0x3de189){_0x75600b['push'](_0x75600b['shift']());}};_0xdc0062(++_0x551b8a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4800bf,_0x3f6aa0){_0x4800bf=_0x4800bf-0x0;var _0x4dc339=_0xb10b[_0x4800bf];return _0x4dc339;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 60cca99..cb03425 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 _0x23fd=['medium','out','sequelize','exports','STRING','TEXT'];(function(_0x14b7c5,_0x49d77d){var _0x145bc8=function(_0x3137c1){while(--_0x3137c1){_0x14b7c5['push'](_0x14b7c5['shift']());}};_0x145bc8(++_0x49d77d);}(_0x23fd,0xe6));var _0xd23f=function(_0x109d9a,_0x24a475){_0x109d9a=_0x109d9a-0x0;var _0x25d651=_0x23fd[_0x109d9a];return _0x25d651;};'use strict';var Sequelize=require(_0xd23f('0x0'));module[_0xd23f('0x1')]={'uniqueid':{'type':Sequelize[_0xd23f('0x2')]},'body':{'type':Sequelize[_0xd23f('0x3')](_0xd23f('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd23f('0x5')),'defaultValue':_0xd23f('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xd23f('0x2')]},'providerResponse':{'type':Sequelize[_0xd23f('0x3')]}}; \ No newline at end of file +var _0xbd98=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x3eeab6,_0x16fde7){var _0x566694=function(_0x5d0373){while(--_0x5d0373){_0x3eeab6['push'](_0x3eeab6['shift']());}};_0x566694(++_0x16fde7);}(_0xbd98,0x12f));var _0x8bd9=function(_0xdda920,_0x30a115){_0xdda920=_0xdda920-0x0;var _0x28ee0f=_0xbd98[_0xdda920];return _0x28ee0f;};'use strict';var Sequelize=require(_0x8bd9('0x0'));module[_0x8bd9('0x1')]={'uniqueid':{'type':Sequelize[_0x8bd9('0x2')]},'body':{'type':Sequelize[_0x8bd9('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x8bd9('0x4')]('in',_0x8bd9('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x8bd9('0x2')]},'providerResponse':{'type':Sequelize[_0x8bd9('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 202ba04..8dba933 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 _0xb5fa=['then','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','SquareMessage','includeAll','show','params','keys','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x1b2c14,_0x2534dc){var _0x2b6404=function(_0x541a0e){while(--_0x541a0e){_0x1b2c14['push'](_0x1b2c14['shift']());}};_0x2b6404(++_0x2534dc);}(_0xb5fa,0xf8));var _0xab5f=function(_0x4a9798,_0x576411){_0x4a9798=_0x4a9798-0x0;var _0x3f09d2=_0xb5fa[_0x4a9798];return _0x3f09d2;};'use strict';var emlformat=require(_0xab5f('0x0'));var rimraf=require(_0xab5f('0x1'));var zipdir=require(_0xab5f('0x2'));var jsonpatch=require(_0xab5f('0x3'));var rp=require(_0xab5f('0x4'));var moment=require(_0xab5f('0x5'));var BPromise=require(_0xab5f('0x6'));var Mustache=require(_0xab5f('0x7'));var util=require(_0xab5f('0x8'));var path=require(_0xab5f('0x9'));var sox=require(_0xab5f('0xa'));var csv=require(_0xab5f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab5f('0xc'));var crypto=require(_0xab5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab5f('0xe'));var toCsv=require(_0xab5f('0xb'));var querystring=require(_0xab5f('0xf'));var Papa=require(_0xab5f('0x10'));var Redis=require(_0xab5f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xab5f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab5f('0x13'));var logger=require('../../config/logger')(_0xab5f('0x14'));var utils=require(_0xab5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9f16,_0x32fca3){_0x32fca3=_0x32fca3||0xcc;return function(_0x56d072){if(_0x56d072){return _0x3d9f16[_0xab5f('0x16')](_0x32fca3);}return _0x3d9f16[_0xab5f('0x17')](_0x32fca3)[_0xab5f('0x18')]();};}function respondWithResult(_0x318335,_0x410269){_0x410269=_0x410269||0xc8;return function(_0x4101ee){if(_0x4101ee){return _0x318335[_0xab5f('0x17')](_0x410269)[_0xab5f('0x19')](_0x4101ee);}};}function respondWithFilteredResult(_0x32def2,_0x45bbf6){return function(_0x2dcfb7){if(_0x2dcfb7){var _0x30089f=typeof _0x45bbf6[_0xab5f('0x1a')]===_0xab5f('0x1b')&&typeof _0x45bbf6[_0xab5f('0x1c')]===_0xab5f('0x1b');var _0xecd649=_0x2dcfb7[_0xab5f('0x1d')];var _0x4aca7d=_0x30089f?0x0:_0x45bbf6[_0xab5f('0x1a')];var _0x4da25e=_0x30089f?_0x2dcfb7[_0xab5f('0x1d')]:_0x45bbf6[_0xab5f('0x1a')]+_0x45bbf6[_0xab5f('0x1c')];var _0x1d6c2b;if(_0x4da25e>=_0xecd649){_0x4da25e=_0xecd649;_0x1d6c2b=0xc8;}else{_0x1d6c2b=0xce;}_0x32def2['status'](_0x1d6c2b);return _0x32def2[_0xab5f('0x1e')](_0xab5f('0x1f'),_0x4aca7d+'-'+_0x4da25e+'/'+_0xecd649)[_0xab5f('0x19')](_0x2dcfb7);}return null;};}function patchUpdates(_0x1bc5ae){return function(_0x34aa5e){try{jsonpatch[_0xab5f('0x20')](_0x34aa5e,_0x1bc5ae,!![]);}catch(_0x58cfa4){return BPromise[_0xab5f('0x21')](_0x58cfa4);}return _0x34aa5e[_0xab5f('0x22')]();};}function saveUpdates(_0x41a2af,_0x5377dd){return function(_0xb47124){if(_0xb47124){return _0xb47124[_0xab5f('0x23')](_0x41a2af)[_0xab5f('0x24')](function(_0x237704){return _0x237704;});}return null;};}function removeEntity(_0x297dff,_0x823c5){return function(_0x4b3127){if(_0x4b3127){return _0x4b3127['destroy']()[_0xab5f('0x24')](function(){_0x297dff[_0xab5f('0x17')](0xcc)[_0xab5f('0x18')]();});}};}function handleEntityNotFound(_0x39bf0f,_0x3fb403){return function(_0x49972a){if(!_0x49972a){_0x39bf0f[_0xab5f('0x16')](0x194);}return _0x49972a;};}function handleError(_0x38d793,_0x4944b6){_0x4944b6=_0x4944b6||0x1f4;return function(_0x1dad1d){logger[_0xab5f('0x25')](_0x1dad1d[_0xab5f('0x26')]);if(_0x1dad1d[_0xab5f('0x27')]){delete _0x1dad1d['name'];}_0x38d793[_0xab5f('0x17')](_0x4944b6)[_0xab5f('0x28')](_0x1dad1d);};}exports[_0xab5f('0x29')]=function(_0x239229,_0x5e43a5){var _0x173688={},_0x165ef6={},_0x36ec77={'count':0x0,'rows':[]};var _0x2de322=_[_0xab5f('0x2a')](db['SquareMessage']['rawAttributes'],function(_0x7f5308){return{'name':_0x7f5308[_0xab5f('0x2b')],'type':_0x7f5308[_0xab5f('0x2c')][_0xab5f('0x2d')]};});_0x165ef6['model']=_['map'](_0x2de322,'name');_0x165ef6['query']=_['keys'](_0x239229[_0xab5f('0x2e')]);_0x165ef6[_0xab5f('0x2f')]=_[_0xab5f('0x30')](_0x165ef6[_0xab5f('0x31')],_0x165ef6[_0xab5f('0x2e')]);_0x173688[_0xab5f('0x32')]=_[_0xab5f('0x30')](_0x165ef6['model'],qs[_0xab5f('0x33')](_0x239229[_0xab5f('0x2e')][_0xab5f('0x33')]));_0x173688[_0xab5f('0x32')]=_0x173688[_0xab5f('0x32')][_0xab5f('0x34')]?_0x173688['attributes']:_0x165ef6[_0xab5f('0x31')];if(!_0x239229['query'][_0xab5f('0x35')]('nolimit')){_0x173688['limit']=qs['limit'](_0x239229['query'][_0xab5f('0x1c')]);_0x173688['offset']=qs[_0xab5f('0x1a')](_0x239229[_0xab5f('0x2e')][_0xab5f('0x1a')]);}_0x173688[_0xab5f('0x36')]=qs[_0xab5f('0x37')](_0x239229[_0xab5f('0x2e')][_0xab5f('0x37')]);_0x173688[_0xab5f('0x38')]=qs[_0xab5f('0x2f')](_['pick'](_0x239229[_0xab5f('0x2e')],_0x165ef6['filters']),_0x2de322);if(_0x239229[_0xab5f('0x2e')][_0xab5f('0x39')]){_0x173688[_0xab5f('0x38')]=_['merge'](_0x173688[_0xab5f('0x38')],{'$or':_[_0xab5f('0x2a')](_0x2de322,function(_0xaf7a59){if(_0xaf7a59[_0xab5f('0x2c')]!==_0xab5f('0x3a')){var _0x1390f1={};_0x1390f1[_0xaf7a59[_0xab5f('0x27')]]={'$like':'%'+_0x239229['query'][_0xab5f('0x39')]+'%'};return _0x1390f1;}})});}_0x173688=_[_0xab5f('0x3b')]({},_0x173688,_0x239229[_0xab5f('0x3c')]);var _0x446efc={'where':_0x173688[_0xab5f('0x38')]};return db[_0xab5f('0x3d')][_0xab5f('0x1d')](_0x446efc)[_0xab5f('0x24')](function(_0x4aaaa3){_0x36ec77['count']=_0x4aaaa3;if(_0x239229[_0xab5f('0x2e')][_0xab5f('0x3e')]){_0x173688['include']=[{'all':!![]}];}return db[_0xab5f('0x3d')]['findAll'](_0x173688);})[_0xab5f('0x24')](function(_0x71490a){_0x36ec77['rows']=_0x71490a;return _0x36ec77;})[_0xab5f('0x24')](respondWithFilteredResult(_0x5e43a5,_0x173688))['catch'](handleError(_0x5e43a5,null));};exports[_0xab5f('0x3f')]=function(_0x223681,_0xf58cc){var _0xa78132={'raw':!![],'where':{'id':_0x223681[_0xab5f('0x40')]['id']}},_0x2da96f={};_0x2da96f['model']=_[_0xab5f('0x41')](db[_0xab5f('0x3d')][_0xab5f('0x42')]);_0x2da96f[_0xab5f('0x2e')]=_[_0xab5f('0x41')](_0x223681[_0xab5f('0x2e')]);_0x2da96f['filters']=_[_0xab5f('0x30')](_0x2da96f[_0xab5f('0x31')],_0x2da96f['query']);_0xa78132[_0xab5f('0x32')]=_['intersection'](_0x2da96f[_0xab5f('0x31')],qs[_0xab5f('0x33')](_0x223681['query'][_0xab5f('0x33')]));_0xa78132[_0xab5f('0x32')]=_0xa78132[_0xab5f('0x32')][_0xab5f('0x34')]?_0xa78132[_0xab5f('0x32')]:_0x2da96f[_0xab5f('0x31')];if(_0x223681[_0xab5f('0x2e')][_0xab5f('0x3e')]){_0xa78132['include']=[{'all':!![]}];}_0xa78132=_[_0xab5f('0x3b')]({},_0xa78132,_0x223681[_0xab5f('0x3c')]);return db[_0xab5f('0x3d')]['find'](_0xa78132)[_0xab5f('0x24')](handleEntityNotFound(_0xf58cc,null))[_0xab5f('0x24')](respondWithResult(_0xf58cc,null))[_0xab5f('0x43')](handleError(_0xf58cc,null));};exports[_0xab5f('0x44')]=function(_0x3e699e,_0x14e815){return db[_0xab5f('0x3d')][_0xab5f('0x44')](_0x3e699e[_0xab5f('0x45')],{})[_0xab5f('0x24')](respondWithResult(_0x14e815,0xc9))[_0xab5f('0x43')](handleError(_0x14e815,null));};exports[_0xab5f('0x23')]=function(_0x4502ee,_0x28a126){if(_0x4502ee['body']['id']){delete _0x4502ee[_0xab5f('0x45')]['id'];}return db[_0xab5f('0x3d')][_0xab5f('0x46')]({'where':{'id':_0x4502ee[_0xab5f('0x40')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x28a126,null))['then'](saveUpdates(_0x4502ee['body'],null))[_0xab5f('0x24')](respondWithResult(_0x28a126,null))[_0xab5f('0x43')](handleError(_0x28a126,null));};exports['destroy']=function(_0x409c61,_0x3fb478){return db[_0xab5f('0x3d')][_0xab5f('0x46')]({'where':{'id':_0x409c61['params']['id']}})['then'](handleEntityNotFound(_0x3fb478,null))[_0xab5f('0x24')](removeEntity(_0x3fb478,null))[_0xab5f('0x43')](handleError(_0x3fb478,null));}; \ No newline at end of file +var _0xa775=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','reject','save','then','error','stack','name','index','map','SquareMessage','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa775,0xf6));var _0x5a77=function(_0x57a58a,_0x53cccf){_0x57a58a=_0x57a58a-0x0;var _0x5a1f98=_0xa775[_0x57a58a];return _0x5a1f98;};'use strict';var emlformat=require(_0x5a77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a77('0x2'));var BPromise=require(_0x5a77('0x3'));var Mustache=require(_0x5a77('0x4'));var util=require(_0x5a77('0x5'));var path=require('path');var sox=require(_0x5a77('0x6'));var csv=require(_0x5a77('0x7'));var ejs=require(_0x5a77('0x8'));var fs=require('fs');var fs_extra=require(_0x5a77('0x9'));var _=require(_0x5a77('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a77('0x7'));var querystring=require(_0x5a77('0xb'));var Papa=require(_0x5a77('0xc'));var Redis=require(_0x5a77('0xd'));var authService=require(_0x5a77('0xe'));var qs=require(_0x5a77('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a77('0x10'));var logger=require(_0x5a77('0x11'))('api');var utils=require(_0x5a77('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5a77('0x13'));var db=require(_0x5a77('0x14'))['db'];function respondWithStatusCode(_0x1767cf,_0x1c6431){_0x1c6431=_0x1c6431||0xcc;return function(_0x39efe1){if(_0x39efe1){return _0x1767cf[_0x5a77('0x15')](_0x1c6431);}return _0x1767cf['status'](_0x1c6431)[_0x5a77('0x16')]();};}function respondWithResult(_0x426dca,_0x1bce83){_0x1bce83=_0x1bce83||0xc8;return function(_0x20c918){if(_0x20c918){return _0x426dca['status'](_0x1bce83)[_0x5a77('0x17')](_0x20c918);}};}function respondWithFilteredResult(_0x371a14,_0x4fcc0c){return function(_0x8eafae){if(_0x8eafae){var _0x263dfc=typeof _0x4fcc0c[_0x5a77('0x18')]==='undefined'&&typeof _0x4fcc0c[_0x5a77('0x19')]===_0x5a77('0x1a');var _0x1e5737=_0x8eafae[_0x5a77('0x1b')];var _0x5628e2=_0x263dfc?0x0:_0x4fcc0c[_0x5a77('0x18')];var _0x53c754=_0x263dfc?_0x8eafae[_0x5a77('0x1b')]:_0x4fcc0c[_0x5a77('0x18')]+_0x4fcc0c[_0x5a77('0x19')];var _0x1ee993;if(_0x53c754>=_0x1e5737){_0x53c754=_0x1e5737;_0x1ee993=0xc8;}else{_0x1ee993=0xce;}_0x371a14[_0x5a77('0x1c')](_0x1ee993);return _0x371a14['set']('Content-Range',_0x5628e2+'-'+_0x53c754+'/'+_0x1e5737)[_0x5a77('0x17')](_0x8eafae);}return null;};}function patchUpdates(_0x2271c3){return function(_0x1ff5ec){try{jsonpatch['apply'](_0x1ff5ec,_0x2271c3,!![]);}catch(_0x47b333){return BPromise[_0x5a77('0x1d')](_0x47b333);}return _0x1ff5ec[_0x5a77('0x1e')]();};}function saveUpdates(_0x22a9d5,_0x3a4c3b){return function(_0x204a96){if(_0x204a96){return _0x204a96['update'](_0x22a9d5)[_0x5a77('0x1f')](function(_0x3dc430){return _0x3dc430;});}return null;};}function removeEntity(_0x5db7a2,_0x2439d4){return function(_0x179589){if(_0x179589){return _0x179589['destroy']()[_0x5a77('0x1f')](function(){_0x5db7a2[_0x5a77('0x1c')](0xcc)[_0x5a77('0x16')]();});}};}function handleEntityNotFound(_0x49d0d9,_0x24e89d){return function(_0x3fc1c2){if(!_0x3fc1c2){_0x49d0d9[_0x5a77('0x15')](0x194);}return _0x3fc1c2;};}function handleError(_0x1aa032,_0x2b8a3e){_0x2b8a3e=_0x2b8a3e||0x1f4;return function(_0x2cdb03){logger[_0x5a77('0x20')](_0x2cdb03[_0x5a77('0x21')]);if(_0x2cdb03[_0x5a77('0x22')]){delete _0x2cdb03[_0x5a77('0x22')];}_0x1aa032[_0x5a77('0x1c')](_0x2b8a3e)['send'](_0x2cdb03);};}exports[_0x5a77('0x23')]=function(_0x45119e,_0x1dd0b5){var _0x54d317={},_0x48e547={},_0x5dadc7={'count':0x0,'rows':[]};var _0x4cbf4e=_[_0x5a77('0x24')](db[_0x5a77('0x25')]['rawAttributes'],function(_0xfbeef3){return{'name':_0xfbeef3['fieldName'],'type':_0xfbeef3[_0x5a77('0x26')][_0x5a77('0x27')]};});_0x48e547['model']=_['map'](_0x4cbf4e,_0x5a77('0x22'));_0x48e547[_0x5a77('0x28')]=_[_0x5a77('0x29')](_0x45119e[_0x5a77('0x28')]);_0x48e547[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],_0x48e547[_0x5a77('0x28')]);_0x54d317['attributes']=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x45119e['query'][_0x5a77('0x2d')]));_0x54d317[_0x5a77('0x2e')]=_0x54d317['attributes'][_0x5a77('0x2f')]?_0x54d317[_0x5a77('0x2e')]:_0x48e547[_0x5a77('0x2c')];if(!_0x45119e['query'][_0x5a77('0x30')]('nolimit')){_0x54d317[_0x5a77('0x19')]=qs['limit'](_0x45119e[_0x5a77('0x28')][_0x5a77('0x19')]);_0x54d317[_0x5a77('0x18')]=qs[_0x5a77('0x18')](_0x45119e['query'][_0x5a77('0x18')]);}_0x54d317[_0x5a77('0x31')]=qs['sort'](_0x45119e['query']['sort']);_0x54d317['where']=qs[_0x5a77('0x2a')](_[_0x5a77('0x32')](_0x45119e['query'],_0x48e547[_0x5a77('0x2a')]),_0x4cbf4e);if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]){_0x54d317[_0x5a77('0x34')]=_[_0x5a77('0x35')](_0x54d317[_0x5a77('0x34')],{'$or':_[_0x5a77('0x24')](_0x4cbf4e,function(_0x887e8c){if(_0x887e8c[_0x5a77('0x26')]!==_0x5a77('0x36')){var _0x42d4eb={};_0x42d4eb[_0x887e8c[_0x5a77('0x22')]]={'$like':'%'+_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]+'%'};return _0x42d4eb;}})});}_0x54d317=_[_0x5a77('0x35')]({},_0x54d317,_0x45119e[_0x5a77('0x37')]);var _0x4d8ce9={'where':_0x54d317[_0x5a77('0x34')]};return db[_0x5a77('0x25')][_0x5a77('0x1b')](_0x4d8ce9)['then'](function(_0x1eb4d6){_0x5dadc7[_0x5a77('0x1b')]=_0x1eb4d6;if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x38')]){_0x54d317[_0x5a77('0x39')]=[{'all':!![]}];}return db[_0x5a77('0x25')][_0x5a77('0x3a')](_0x54d317);})[_0x5a77('0x1f')](function(_0xf52b83){_0x5dadc7[_0x5a77('0x3b')]=_0xf52b83;return _0x5dadc7;})['then'](respondWithFilteredResult(_0x1dd0b5,_0x54d317))[_0x5a77('0x3c')](handleError(_0x1dd0b5,null));};exports['show']=function(_0x4269f0,_0x38c6e3){var _0xda875={'raw':!![],'where':{'id':_0x4269f0[_0x5a77('0x3d')]['id']}},_0x27a450={};_0x27a450[_0x5a77('0x2c')]=_['keys'](db['SquareMessage'][_0x5a77('0x3e')]);_0x27a450[_0x5a77('0x28')]=_['keys'](_0x4269f0['query']);_0x27a450[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x27a450[_0x5a77('0x2c')],_0x27a450[_0x5a77('0x28')]);_0xda875[_0x5a77('0x2e')]=_['intersection'](_0x27a450[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x4269f0[_0x5a77('0x28')][_0x5a77('0x2d')]));_0xda875['attributes']=_0xda875[_0x5a77('0x2e')][_0x5a77('0x2f')]?_0xda875[_0x5a77('0x2e')]:_0x27a450['model'];if(_0x4269f0['query'][_0x5a77('0x38')]){_0xda875['include']=[{'all':!![]}];}_0xda875=_[_0x5a77('0x35')]({},_0xda875,_0x4269f0[_0x5a77('0x37')]);return db[_0x5a77('0x25')][_0x5a77('0x3f')](_0xda875)[_0x5a77('0x1f')](handleEntityNotFound(_0x38c6e3,null))[_0x5a77('0x1f')](respondWithResult(_0x38c6e3,null))[_0x5a77('0x3c')](handleError(_0x38c6e3,null));};exports[_0x5a77('0x40')]=function(_0x35a252,_0x1a15d0){return db[_0x5a77('0x25')]['create'](_0x35a252[_0x5a77('0x41')],{})[_0x5a77('0x1f')](respondWithResult(_0x1a15d0,0xc9))[_0x5a77('0x3c')](handleError(_0x1a15d0,null));};exports['update']=function(_0x3ec766,_0x3db645){if(_0x3ec766[_0x5a77('0x41')]['id']){delete _0x3ec766['body']['id'];}return db[_0x5a77('0x25')]['find']({'where':{'id':_0x3ec766[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3db645,null))[_0x5a77('0x1f')](saveUpdates(_0x3ec766[_0x5a77('0x41')],null))[_0x5a77('0x1f')](respondWithResult(_0x3db645,null))[_0x5a77('0x3c')](handleError(_0x3db645,null));};exports['destroy']=function(_0x244c6e,_0x3f3efe){return db[_0x5a77('0x25')][_0x5a77('0x3f')]({'where':{'id':_0x244c6e[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3f3efe,null))[_0x5a77('0x1f')](removeEntity(_0x3f3efe,null))[_0x5a77('0x3c')](handleError(_0x3f3efe,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 90f6d18..bd8f225 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 _0x0cdc=['request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird'];(function(_0x5ba075,_0x232f73){var _0x53a2a5=function(_0x25634d){while(--_0x25634d){_0x5ba075['push'](_0x5ba075['shift']());}};_0x53a2a5(++_0x232f73);}(_0x0cdc,0xf2));var _0xc0cd=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0cdc[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require('lodash');var util=require(_0xc0cd('0x0'));var logger=require(_0xc0cd('0x1'))(_0xc0cd('0x2'));var moment=require(_0xc0cd('0x3'));var BPromise=require(_0xc0cd('0x4'));var rp=require(_0xc0cd('0x5'));var fs=require('fs');var path=require(_0xc0cd('0x6'));var rimraf=require('rimraf');var config=require(_0xc0cd('0x7'));var attributes=require(_0xc0cd('0x8'));module[_0xc0cd('0x9')]=function(_0x2969e9,_0x255ef2){return _0x2969e9[_0xc0cd('0xa')](_0xc0cd('0xb'),attributes,{'tableName':_0xc0cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdb2=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x15ff6f,_0xffd4b3){var _0x48e536=function(_0x242dc5){while(--_0x242dc5){_0x15ff6f['push'](_0x15ff6f['shift']());}};_0x48e536(++_0xffd4b3);}(_0xfdb2,0x185));var _0x2fdb=function(_0x18fb4e,_0x5f9fd){_0x18fb4e=_0x18fb4e-0x0;var _0x479215=_0xfdb2[_0x18fb4e];return _0x479215;};'use strict';var _=require(_0x2fdb('0x0'));var util=require(_0x2fdb('0x1'));var logger=require(_0x2fdb('0x2'))(_0x2fdb('0x3'));var moment=require(_0x2fdb('0x4'));var BPromise=require(_0x2fdb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fdb('0x6'));var rimraf=require('rimraf');var config=require(_0x2fdb('0x7'));var attributes=require(_0x2fdb('0x8'));module[_0x2fdb('0x9')]=function(_0x2bd71b,_0x37ea3e){return _0x2bd71b['define'](_0x2fdb('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 88d07b1..21d1985 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 _0x4da1=['body','options','raw','CreateSquareMessage','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','create'];(function(_0x2b8046,_0x229533){var _0x2749fb=function(_0x3bbfc5){while(--_0x3bbfc5){_0x2b8046['push'](_0x2b8046['shift']());}};_0x2749fb(++_0x229533);}(_0x4da1,0x123));var _0x14da=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4da1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x14da('0x0'));var util=require(_0x14da('0x1'));var moment=require('moment');var BPromise=require(_0x14da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14da('0x3'));var db=require(_0x14da('0x4'))['db'];var utils=require(_0x14da('0x5'));var logger=require(_0x14da('0x6'))(_0x14da('0x7'));var config=require(_0x14da('0x8'));var jayson=require(_0x14da('0x9'));var client=jayson[_0x14da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fae68,_0x4d1fe9,_0x5a2aca){return new BPromise(function(_0x1fc8f7,_0x1b74ec){return client[_0x14da('0xb')](_0x3fae68,_0x5a2aca)['then'](function(_0x32d30a){logger[_0x14da('0xc')](_0x14da('0xd'),_0x4d1fe9,'request\x20sent');logger['debug'](_0x14da('0xe'),_0x4d1fe9,_0x14da('0xf'),JSON[_0x14da('0x10')](_0x32d30a));if(_0x32d30a['error']){if(_0x32d30a[_0x14da('0x11')]['code']===0x1f4){logger[_0x14da('0x11')]('SquareMessage,\x20%s,\x20%s',_0x4d1fe9,_0x32d30a[_0x14da('0x11')][_0x14da('0x12')]);return _0x1b74ec(_0x32d30a[_0x14da('0x11')]['message']);}logger[_0x14da('0x11')](_0x14da('0xd'),_0x4d1fe9,_0x32d30a[_0x14da('0x11')][_0x14da('0x12')]);return _0x1fc8f7(_0x32d30a['error']['message']);}else{logger[_0x14da('0xc')](_0x14da('0xd'),_0x4d1fe9,_0x14da('0xf'));_0x1fc8f7(_0x32d30a['result']['message']);}})[_0x14da('0x13')](function(_0x47de84){logger['error'](_0x14da('0xd'),_0x4d1fe9,_0x47de84);_0x1b74ec(_0x47de84);});});}exports['CreateSquareMessage']=function(_0x1f6013){var _0x48c8a2=this;return new Promise(function(_0x9786e0,_0x1b2150){return db['SquareMessage'][_0x14da('0x14')](_0x1f6013[_0x14da('0x15')],{'raw':_0x1f6013['options']?_0x1f6013[_0x14da('0x16')][_0x14da('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xa2473b){logger[_0x14da('0xc')](_0x14da('0x18'),_0x1f6013);logger[_0x14da('0x19')](_0x14da('0x18'),_0x1f6013,JSON[_0x14da('0x10')](_0xa2473b));_0x9786e0(_0xa2473b);})[_0x14da('0x13')](function(_0x4b40ba){logger[_0x14da('0x11')](_0x14da('0x18'),_0x4b40ba[_0x14da('0x12')],_0x1f6013);_0x1b2150(_0x48c8a2[_0x14da('0x11')](0x1f4,_0x4b40ba[_0x14da('0x12')]));});});}; \ No newline at end of file +var _0xc6c8=['message','result','catch','CreateSquareMessage','body','options','raw','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x19577b,_0x4ba7a5){var _0x14afa8=function(_0x1c20c3){while(--_0x1c20c3){_0x19577b['push'](_0x19577b['shift']());}};_0x14afa8(++_0x4ba7a5);}(_0xc6c8,0xdf));var _0x8c6c=function(_0x5b0828,_0x4744f4){_0x5b0828=_0x5b0828-0x0;var _0x3bd32d=_0xc6c8[_0x5b0828];return _0x3bd32d;};'use strict';var _=require(_0x8c6c('0x0'));var util=require('util');var moment=require(_0x8c6c('0x1'));var BPromise=require(_0x8c6c('0x2'));var rs=require(_0x8c6c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c6c('0x4'));var logger=require(_0x8c6c('0x5'))(_0x8c6c('0x6'));var config=require(_0x8c6c('0x7'));var jayson=require(_0x8c6c('0x8'));var client=jayson['client'][_0x8c6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bc44d,_0x118aab,_0x2675c3){return new BPromise(function(_0x46c347,_0x7baccb){return client[_0x8c6c('0xa')](_0x1bc44d,_0x2675c3)[_0x8c6c('0xb')](function(_0x394fa4){logger[_0x8c6c('0xc')](_0x8c6c('0xd'),_0x118aab,_0x8c6c('0xe'));logger[_0x8c6c('0xf')](_0x8c6c('0x10'),_0x118aab,_0x8c6c('0xe'),JSON[_0x8c6c('0x11')](_0x394fa4));if(_0x394fa4['error']){if(_0x394fa4['error'][_0x8c6c('0x12')]===0x1f4){logger[_0x8c6c('0x13')](_0x8c6c('0xd'),_0x118aab,_0x394fa4[_0x8c6c('0x13')][_0x8c6c('0x14')]);return _0x7baccb(_0x394fa4[_0x8c6c('0x13')][_0x8c6c('0x14')]);}logger['error'](_0x8c6c('0xd'),_0x118aab,_0x394fa4[_0x8c6c('0x13')][_0x8c6c('0x14')]);return _0x46c347(_0x394fa4[_0x8c6c('0x13')][_0x8c6c('0x14')]);}else{logger[_0x8c6c('0xc')](_0x8c6c('0xd'),_0x118aab,_0x8c6c('0xe'));_0x46c347(_0x394fa4[_0x8c6c('0x15')][_0x8c6c('0x14')]);}})[_0x8c6c('0x16')](function(_0x18cab8){logger['error'](_0x8c6c('0xd'),_0x118aab,_0x18cab8);_0x7baccb(_0x18cab8);});});}exports[_0x8c6c('0x17')]=function(_0x540c07){var _0x48410a=this;return new Promise(function(_0x5746fa,_0x5f42aa){return db['SquareMessage']['create'](_0x540c07[_0x8c6c('0x18')],{'raw':_0x540c07['options']?_0x540c07[_0x8c6c('0x19')][_0x8c6c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xf2534f){logger[_0x8c6c('0xc')](_0x8c6c('0x17'),_0x540c07);logger[_0x8c6c('0xf')](_0x8c6c('0x17'),_0x540c07,JSON[_0x8c6c('0x11')](_0xf2534f));_0x5746fa(_0xf2534f);})[_0x8c6c('0x16')](function(_0x500bf0){logger[_0x8c6c('0x13')](_0x8c6c('0x17'),_0x500bf0[_0x8c6c('0x14')],_0x540c07);_0x5f42aa(_0x48410a['error'](0x1f4,_0x500bf0[_0x8c6c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ac2b2fb..21b5d6b 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 _0x699c=['test','post','create','update','delete','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s'];(function(_0x4698bb,_0x40a3f6){var _0x739720=function(_0x6c9ac0){while(--_0x6c9ac0){_0x4698bb['push'](_0x4698bb['shift']());}};_0x739720(++_0x40a3f6);}(_0x699c,0xb9));var _0xc699=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x699c[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xc699('0x0'));var path=require(_0xc699('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc699('0x2')]();var fs_extra=require(_0xc699('0x3'));var auth=require(_0xc699('0x4'));var interaction=require(_0xc699('0x5'));var config=require(_0xc699('0x6'));var controller=require(_0xc699('0x7'));router[_0xc699('0x8')]('/',auth[_0xc699('0x9')](),controller[_0xc699('0xa')]);router['get'](_0xc699('0xb'),auth[_0xc699('0x9')](),controller[_0xc699('0xc')]);router[_0xc699('0x8')](_0xc699('0xd'),auth[_0xc699('0x9')](),timeout(_0xc699('0xe')),controller[_0xc699('0xf')]);router[_0xc699('0x10')]('/',auth['isAuthenticated'](),controller[_0xc699('0x11')]);router['put'](_0xc699('0xb'),auth[_0xc699('0x9')](),controller[_0xc699('0x12')]);router[_0xc699('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1c74=['isAuthenticated','index','show','/:id/test','15s','test','create','put','/:id','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get'];(function(_0x4eefe6,_0x1202ce){var _0x22b387=function(_0xb34c64){while(--_0xb34c64){_0x4eefe6['push'](_0x4eefe6['shift']());}};_0x22b387(++_0x1202ce);}(_0x1c74,0x172));var _0x41c7=function(_0x4885aa,_0xf53a85){_0x4885aa=_0x4885aa-0x0;var _0x5c3b68=_0x1c74[_0x4885aa];return _0x5c3b68;};'use strict';var multer=require(_0x41c7('0x0'));var util=require('util');var path=require(_0x41c7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x41c7('0x2')]();var fs_extra=require(_0x41c7('0x3'));var auth=require(_0x41c7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x41c7('0x5'));var controller=require(_0x41c7('0x6'));router[_0x41c7('0x7')]('/',auth[_0x41c7('0x8')](),controller[_0x41c7('0x9')]);router[_0x41c7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x41c7('0xa')]);router[_0x41c7('0x7')](_0x41c7('0xb'),auth[_0x41c7('0x8')](),timeout(_0x41c7('0xc')),controller[_0x41c7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x41c7('0xe')]);router[_0x41c7('0xf')](_0x41c7('0x10'),auth[_0x41c7('0x8')](),controller['update']);router['delete'](_0x41c7('0x10'),auth[_0x41c7('0x8')](),controller['destroy']);module[_0x41c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 9b67f3f..e7dadde 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 _0xc386=['exports','STRING','sequelize'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xc386,0x1df));var _0x6c38=function(_0x519576,_0x324197){_0x519576=_0x519576-0x0;var _0x6f2a16=_0xc386[_0x519576];return _0x6f2a16;};'use strict';var Sequelize=require(_0x6c38('0x0'));module[_0x6c38('0x1')]={'name':{'type':Sequelize[_0x6c38('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x6c38('0x2')]},'description':{'type':Sequelize[_0x6c38('0x2')]}}; \ No newline at end of file +var _0x1b04=['STRING','sequelize','exports','name'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x1b04,0x131));var _0x41b0=function(_0xa84f31,_0x261b6f){_0xa84f31=_0xa84f31-0x0;var _0x4cc842=_0x1b04[_0xa84f31];return _0x4cc842;};'use strict';var Sequelize=require(_0x41b0('0x0'));module[_0x41b0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x41b0('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x41b0('0x3')]},'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 856ba84..ed5815d 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 _0xc874=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','keys','include','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','test','openSync','dsn','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length'];(function(_0x2e819e,_0xf6ba9){var _0x561416=function(_0x49d814){while(--_0x49d814){_0x2e819e['push'](_0x2e819e['shift']());}};_0x561416(++_0xf6ba9);}(_0xc874,0x16c));var _0x4c87=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xc874[_0x4d674b];return _0x535a1f;};'use strict';var emlformat=require(_0x4c87('0x0'));var rimraf=require(_0x4c87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c87('0x2'));var rp=require(_0x4c87('0x3'));var moment=require(_0x4c87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c87('0x5'));var util=require(_0x4c87('0x6'));var path=require(_0x4c87('0x7'));var sox=require(_0x4c87('0x8'));var csv=require(_0x4c87('0x9'));var ejs=require(_0x4c87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c87('0xb'));var squel=require(_0x4c87('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c87('0xd'));var Papa=require(_0x4c87('0xe'));var Redis=require('ioredis');var authService=require(_0x4c87('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4c87('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c87('0x11'));var utils=require(_0x4c87('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4c87('0x13'));var db=require(_0x4c87('0x14'))['db'];function respondWithStatusCode(_0x4afdc1,_0x2023e6){_0x2023e6=_0x2023e6||0xcc;return function(_0x1b7d5b){if(_0x1b7d5b){return _0x4afdc1[_0x4c87('0x15')](_0x2023e6);}return _0x4afdc1[_0x4c87('0x16')](_0x2023e6)[_0x4c87('0x17')]();};}function respondWithResult(_0x5731ad,_0x25ee4c){_0x25ee4c=_0x25ee4c||0xc8;return function(_0x352831){if(_0x352831){return _0x5731ad[_0x4c87('0x16')](_0x25ee4c)[_0x4c87('0x18')](_0x352831);}};}function respondWithFilteredResult(_0x513dbf,_0x63360){return function(_0x3452ac){if(_0x3452ac){var _0x210fa7=typeof _0x63360['offset']===_0x4c87('0x19')&&typeof _0x63360[_0x4c87('0x1a')]===_0x4c87('0x19');var _0x5bfce8=_0x3452ac[_0x4c87('0x1b')];var _0x57632c=_0x210fa7?0x0:_0x63360[_0x4c87('0x1c')];var _0x9cad4a=_0x210fa7?_0x3452ac[_0x4c87('0x1b')]:_0x63360[_0x4c87('0x1c')]+_0x63360[_0x4c87('0x1a')];var _0x267569;if(_0x9cad4a>=_0x5bfce8){_0x9cad4a=_0x5bfce8;_0x267569=0xc8;}else{_0x267569=0xce;}_0x513dbf['status'](_0x267569);return _0x513dbf[_0x4c87('0x1d')](_0x4c87('0x1e'),_0x57632c+'-'+_0x9cad4a+'/'+_0x5bfce8)[_0x4c87('0x18')](_0x3452ac);}return null;};}function patchUpdates(_0x5acacf){return function(_0xe8cb12){try{jsonpatch[_0x4c87('0x1f')](_0xe8cb12,_0x5acacf,!![]);}catch(_0x3ae1aa){return BPromise[_0x4c87('0x20')](_0x3ae1aa);}return _0xe8cb12[_0x4c87('0x21')]();};}function saveUpdates(_0x246973,_0x445398){return function(_0x44c143){if(_0x44c143){return _0x44c143[_0x4c87('0x22')](_0x246973)[_0x4c87('0x23')](function(_0x222210){return _0x222210;});}return null;};}function removeEntity(_0x37d727,_0x10d090){return function(_0x3e9a36){if(_0x3e9a36){return _0x3e9a36['destroy']()[_0x4c87('0x23')](function(){var _0x56fa21=_0x3e9a36[_0x4c87('0x24')]({'plain':!![]});var _0x21c8ca=_0x4c87('0x25');return db[_0x4c87('0x26')][_0x4c87('0x27')]({'where':{'type':_0x21c8ca,'resourceId':_0x56fa21['id']}})[_0x4c87('0x23')](function(){return _0x3e9a36;});})[_0x4c87('0x23')](function(){_0x37d727[_0x4c87('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26823a,_0x4cb21c){return function(_0x427d95){if(!_0x427d95){_0x26823a[_0x4c87('0x15')](0x194);}return _0x427d95;};}function handleError(_0x2c0ee0,_0x52a42a){_0x52a42a=_0x52a42a||0x1f4;return function(_0x2341f0){logger[_0x4c87('0x28')](_0x2341f0[_0x4c87('0x29')]);if(_0x2341f0['name']){delete _0x2341f0[_0x4c87('0x2a')];}_0x2c0ee0[_0x4c87('0x16')](_0x52a42a)[_0x4c87('0x2b')](_0x2341f0);};}exports['index']=function(_0x4f99ee,_0x21c6ab){var _0x332f5b={},_0xc68b44={},_0x9e4422={'count':0x0,'rows':[]};var _0x26ad31=_[_0x4c87('0x2c')](db[_0x4c87('0x2d')][_0x4c87('0x2e')],function(_0x467c1e){return{'name':_0x467c1e[_0x4c87('0x2f')],'type':_0x467c1e[_0x4c87('0x30')][_0x4c87('0x31')]};});_0xc68b44['model']=_[_0x4c87('0x2c')](_0x26ad31,_0x4c87('0x2a'));_0xc68b44[_0x4c87('0x32')]=_['keys'](_0x4f99ee[_0x4c87('0x32')]);_0xc68b44[_0x4c87('0x33')]=_[_0x4c87('0x34')](_0xc68b44[_0x4c87('0x35')],_0xc68b44[_0x4c87('0x32')]);_0x332f5b[_0x4c87('0x36')]=_[_0x4c87('0x34')](_0xc68b44[_0x4c87('0x35')],qs['fields'](_0x4f99ee[_0x4c87('0x32')]['fields']));_0x332f5b['attributes']=_0x332f5b['attributes'][_0x4c87('0x37')]?_0x332f5b[_0x4c87('0x36')]:_0xc68b44[_0x4c87('0x35')];if(!_0x4f99ee[_0x4c87('0x32')][_0x4c87('0x38')](_0x4c87('0x39'))){_0x332f5b[_0x4c87('0x1a')]=qs[_0x4c87('0x1a')](_0x4f99ee[_0x4c87('0x32')][_0x4c87('0x1a')]);_0x332f5b[_0x4c87('0x1c')]=qs[_0x4c87('0x1c')](_0x4f99ee[_0x4c87('0x32')][_0x4c87('0x1c')]);}_0x332f5b[_0x4c87('0x3a')]=qs[_0x4c87('0x3b')](_0x4f99ee[_0x4c87('0x32')]['sort']);_0x332f5b[_0x4c87('0x3c')]=qs[_0x4c87('0x33')](_[_0x4c87('0x3d')](_0x4f99ee['query'],_0xc68b44['filters']),_0x26ad31);if(_0x4f99ee[_0x4c87('0x32')][_0x4c87('0x3e')]){_0x332f5b[_0x4c87('0x3c')]=_['merge'](_0x332f5b['where'],{'$or':_[_0x4c87('0x2c')](_0x26ad31,function(_0x46e722){if(_0x46e722[_0x4c87('0x30')]!=='VIRTUAL'){var _0x2bf971={};_0x2bf971[_0x46e722[_0x4c87('0x2a')]]={'$like':'%'+_0x4f99ee[_0x4c87('0x32')]['filter']+'%'};return _0x2bf971;}})});}_0x332f5b=_[_0x4c87('0x3f')]({},_0x332f5b,_0x4f99ee['options']);var _0x3c81ca={'where':_0x332f5b[_0x4c87('0x3c')]};return db[_0x4c87('0x2d')][_0x4c87('0x1b')](_0x3c81ca)[_0x4c87('0x23')](function(_0x15918f){_0x9e4422[_0x4c87('0x1b')]=_0x15918f;if(_0x4f99ee[_0x4c87('0x32')][_0x4c87('0x40')]){_0x332f5b['include']=[{'all':!![]}];}return db[_0x4c87('0x2d')]['findAll'](_0x332f5b);})[_0x4c87('0x23')](function(_0x357945){_0x9e4422['rows']=_0x357945;return _0x9e4422;})[_0x4c87('0x23')](respondWithFilteredResult(_0x21c6ab,_0x332f5b))['catch'](handleError(_0x21c6ab,null));};exports['show']=function(_0x56b9b3,_0x49312d){var _0x305db2={'raw':!![],'where':{'id':_0x56b9b3['params']['id']}},_0x4f42df={};_0x4f42df[_0x4c87('0x35')]=_['keys'](db['SquareOdbc'][_0x4c87('0x2e')]);_0x4f42df[_0x4c87('0x32')]=_[_0x4c87('0x41')](_0x56b9b3[_0x4c87('0x32')]);_0x4f42df['filters']=_['intersection'](_0x4f42df[_0x4c87('0x35')],_0x4f42df[_0x4c87('0x32')]);_0x305db2[_0x4c87('0x36')]=_[_0x4c87('0x34')](_0x4f42df[_0x4c87('0x35')],qs['fields'](_0x56b9b3[_0x4c87('0x32')]['fields']));_0x305db2['attributes']=_0x305db2['attributes'][_0x4c87('0x37')]?_0x305db2['attributes']:_0x4f42df[_0x4c87('0x35')];if(_0x56b9b3[_0x4c87('0x32')][_0x4c87('0x40')]){_0x305db2[_0x4c87('0x42')]=[{'all':!![]}];}_0x305db2=_[_0x4c87('0x3f')]({},_0x305db2,_0x56b9b3[_0x4c87('0x43')]);return db[_0x4c87('0x2d')]['find'](_0x305db2)[_0x4c87('0x23')](handleEntityNotFound(_0x49312d,null))['then'](respondWithResult(_0x49312d,null))[_0x4c87('0x44')](handleError(_0x49312d,null));};exports[_0x4c87('0x45')]=function(_0x1c3c1f,_0x117be6){return db[_0x4c87('0x2d')][_0x4c87('0x45')](_0x1c3c1f[_0x4c87('0x46')],{})[_0x4c87('0x23')](function(_0x13fbf1){var _0x109f20=_0x1c3c1f[_0x4c87('0x47')][_0x4c87('0x24')]({'plain':!![]});if(!_0x109f20)throw new Error(_0x4c87('0x48'));if(_0x109f20[_0x4c87('0x49')]===_0x4c87('0x47')){var _0x3e8f6b=_0x13fbf1[_0x4c87('0x24')]({'plain':!![]});var _0x56f66b=_0x4c87('0x25');return db[_0x4c87('0x4a')]['find']({'where':{'name':_0x56f66b,'userProfileId':_0x109f20[_0x4c87('0x4b')]},'raw':!![]})[_0x4c87('0x23')](function(_0x3e7129){if(_0x3e7129&&_0x3e7129[_0x4c87('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e8f6b['name'],'resourceId':_0x3e8f6b['id'],'type':_0x3e7129[_0x4c87('0x2a')],'sectionId':_0x3e7129['id']},{})[_0x4c87('0x23')](function(){return _0x13fbf1;});}else{return _0x13fbf1;}})[_0x4c87('0x44')](function(_0x47551d){logger[_0x4c87('0x28')](_0x4c87('0x4d'),_0x47551d);throw _0x47551d;});}return _0x13fbf1;})[_0x4c87('0x23')](respondWithResult(_0x117be6,0xc9))[_0x4c87('0x44')](handleError(_0x117be6,null));};exports[_0x4c87('0x22')]=function(_0x24e851,_0x1d03ea){if(_0x24e851[_0x4c87('0x46')]['id']){delete _0x24e851['body']['id'];}return db['SquareOdbc'][_0x4c87('0x4e')]({'where':{'id':_0x24e851['params']['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x1d03ea,null))[_0x4c87('0x23')](saveUpdates(_0x24e851[_0x4c87('0x46')],null))[_0x4c87('0x23')](respondWithResult(_0x1d03ea,null))[_0x4c87('0x44')](handleError(_0x1d03ea,null));};exports['destroy']=function(_0x42260d,_0x2ebe01){return db[_0x4c87('0x2d')][_0x4c87('0x4e')]({'where':{'id':_0x42260d[_0x4c87('0x4f')]['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x2ebe01,null))[_0x4c87('0x23')](removeEntity(_0x2ebe01,null))[_0x4c87('0x44')](handleError(_0x2ebe01,null));};exports[_0x4c87('0x50')]=function(_0x407538,_0x3ea7f7,_0x540390){var _0x33936c;return db['SquareOdbc'][_0x4c87('0x4e')]({'where':{'id':_0x407538[_0x4c87('0x4f')]['id']},'attributes':['id','dsn']})[_0x4c87('0x23')](handleEntityNotFound(_0x3ea7f7,null))[_0x4c87('0x23')](function(_0x7854c4){if(_0x7854c4){var _0xd33454=require('odbc')();_0xd33454[_0x4c87('0x51')](_0x7854c4[_0x4c87('0x52')]);_0xd33454[_0x4c87('0x53')]();return _0x7854c4;}})[_0x4c87('0x23')](respondWithResult(_0x3ea7f7,null))[_0x4c87('0x44')](handleError(_0x3ea7f7,null));}; \ No newline at end of file +var _0x96a1=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x13fcab,_0x34ca23){var _0x5bc05d=function(_0x391eb4){while(--_0x391eb4){_0x13fcab['push'](_0x13fcab['shift']());}};_0x5bc05d(++_0x34ca23);}(_0x96a1,0x153));var _0x196a=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x96a1[_0x2d486b];return _0x4291d1;};'use strict';var emlformat=require(_0x196a('0x0'));var rimraf=require(_0x196a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x196a('0x2'));var rp=require('request-promise');var moment=require(_0x196a('0x3'));var BPromise=require(_0x196a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x196a('0x5'));var sox=require(_0x196a('0x6'));var csv=require(_0x196a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x196a('0x8'));var _=require(_0x196a('0x9'));var squel=require(_0x196a('0xa'));var crypto=require(_0x196a('0xb'));var jsforce=require(_0x196a('0xc'));var deskjs=require(_0x196a('0xd'));var toCsv=require(_0x196a('0x7'));var querystring=require('querystring');var Papa=require(_0x196a('0xe'));var Redis=require(_0x196a('0xf'));var authService=require(_0x196a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x196a('0x11'));var logger=require('../../config/logger')(_0x196a('0x12'));var utils=require(_0x196a('0x13'));var config=require(_0x196a('0x14'));var licenseUtil=require(_0x196a('0x15'));var db=require(_0x196a('0x16'))['db'];function respondWithStatusCode(_0x2d472b,_0xc51819){_0xc51819=_0xc51819||0xcc;return function(_0x52823a){if(_0x52823a){return _0x2d472b[_0x196a('0x17')](_0xc51819);}return _0x2d472b[_0x196a('0x18')](_0xc51819)[_0x196a('0x19')]();};}function respondWithResult(_0x3551f9,_0x432cd4){_0x432cd4=_0x432cd4||0xc8;return function(_0x259e03){if(_0x259e03){return _0x3551f9[_0x196a('0x18')](_0x432cd4)[_0x196a('0x1a')](_0x259e03);}};}function respondWithFilteredResult(_0x4a2a66,_0x295b34){return function(_0x58d170){if(_0x58d170){var _0x2064a6=typeof _0x295b34[_0x196a('0x1b')]==='undefined'&&typeof _0x295b34[_0x196a('0x1c')]==='undefined';var _0x414cbb=_0x58d170['count'];var _0x1df5b6=_0x2064a6?0x0:_0x295b34[_0x196a('0x1b')];var _0x301bde=_0x2064a6?_0x58d170[_0x196a('0x1d')]:_0x295b34[_0x196a('0x1b')]+_0x295b34[_0x196a('0x1c')];var _0x5235b4;if(_0x301bde>=_0x414cbb){_0x301bde=_0x414cbb;_0x5235b4=0xc8;}else{_0x5235b4=0xce;}_0x4a2a66[_0x196a('0x18')](_0x5235b4);return _0x4a2a66[_0x196a('0x1e')](_0x196a('0x1f'),_0x1df5b6+'-'+_0x301bde+'/'+_0x414cbb)[_0x196a('0x1a')](_0x58d170);}return null;};}function patchUpdates(_0xde7b84){return function(_0x10667e){try{jsonpatch[_0x196a('0x20')](_0x10667e,_0xde7b84,!![]);}catch(_0x42ad5f){return BPromise[_0x196a('0x21')](_0x42ad5f);}return _0x10667e['save']();};}function saveUpdates(_0x18e9e4,_0x4bd2e7){return function(_0x36fd2a){if(_0x36fd2a){return _0x36fd2a[_0x196a('0x22')](_0x18e9e4)[_0x196a('0x23')](function(_0x1eb9ca){return _0x1eb9ca;});}return null;};}function removeEntity(_0x457c07,_0x2dc245){return function(_0x3effb5){if(_0x3effb5){return _0x3effb5[_0x196a('0x24')]()[_0x196a('0x23')](function(){var _0x17edc2=_0x3effb5['get']({'plain':!![]});var _0x2ee44d='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ee44d,'resourceId':_0x17edc2['id']}})[_0x196a('0x23')](function(){return _0x3effb5;});})['then'](function(){_0x457c07[_0x196a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x891dab,_0x53f62b){return function(_0xcee450){if(!_0xcee450){_0x891dab[_0x196a('0x17')](0x194);}return _0xcee450;};}function handleError(_0x28b0f8,_0x47687d){_0x47687d=_0x47687d||0x1f4;return function(_0x5f230b){logger['error'](_0x5f230b[_0x196a('0x25')]);if(_0x5f230b[_0x196a('0x26')]){delete _0x5f230b['name'];}_0x28b0f8[_0x196a('0x18')](_0x47687d)[_0x196a('0x27')](_0x5f230b);};}exports['index']=function(_0x16cb29,_0xd5c55a){var _0x205351={},_0x54f34a={},_0x394995={'count':0x0,'rows':[]};var _0x53ee45=_[_0x196a('0x28')](db[_0x196a('0x29')][_0x196a('0x2a')],function(_0x509829){return{'name':_0x509829[_0x196a('0x2b')],'type':_0x509829[_0x196a('0x2c')][_0x196a('0x2d')]};});_0x54f34a[_0x196a('0x2e')]=_[_0x196a('0x28')](_0x53ee45,_0x196a('0x26'));_0x54f34a['query']=_[_0x196a('0x2f')](_0x16cb29[_0x196a('0x30')]);_0x54f34a[_0x196a('0x31')]=_[_0x196a('0x32')](_0x54f34a[_0x196a('0x2e')],_0x54f34a[_0x196a('0x30')]);_0x205351[_0x196a('0x33')]=_[_0x196a('0x32')](_0x54f34a['model'],qs[_0x196a('0x34')](_0x16cb29['query']['fields']));_0x205351[_0x196a('0x33')]=_0x205351[_0x196a('0x33')][_0x196a('0x35')]?_0x205351[_0x196a('0x33')]:_0x54f34a[_0x196a('0x2e')];if(!_0x16cb29[_0x196a('0x30')][_0x196a('0x36')](_0x196a('0x37'))){_0x205351[_0x196a('0x1c')]=qs[_0x196a('0x1c')](_0x16cb29[_0x196a('0x30')][_0x196a('0x1c')]);_0x205351[_0x196a('0x1b')]=qs['offset'](_0x16cb29[_0x196a('0x30')][_0x196a('0x1b')]);}_0x205351[_0x196a('0x38')]=qs[_0x196a('0x39')](_0x16cb29[_0x196a('0x30')][_0x196a('0x39')]);_0x205351[_0x196a('0x3a')]=qs[_0x196a('0x31')](_[_0x196a('0x3b')](_0x16cb29['query'],_0x54f34a[_0x196a('0x31')]),_0x53ee45);if(_0x16cb29[_0x196a('0x30')]['filter']){_0x205351[_0x196a('0x3a')]=_[_0x196a('0x3c')](_0x205351[_0x196a('0x3a')],{'$or':_[_0x196a('0x28')](_0x53ee45,function(_0x546c23){if(_0x546c23[_0x196a('0x2c')]!==_0x196a('0x3d')){var _0x37ee4b={};_0x37ee4b[_0x546c23['name']]={'$like':'%'+_0x16cb29[_0x196a('0x30')]['filter']+'%'};return _0x37ee4b;}})});}_0x205351=_[_0x196a('0x3c')]({},_0x205351,_0x16cb29[_0x196a('0x3e')]);var _0x562fb6={'where':_0x205351[_0x196a('0x3a')]};return db[_0x196a('0x29')][_0x196a('0x1d')](_0x562fb6)[_0x196a('0x23')](function(_0x127ad3){_0x394995['count']=_0x127ad3;if(_0x16cb29['query'][_0x196a('0x3f')]){_0x205351[_0x196a('0x40')]=[{'all':!![]}];}return db[_0x196a('0x29')][_0x196a('0x41')](_0x205351);})[_0x196a('0x23')](function(_0x4dbb7f){_0x394995[_0x196a('0x42')]=_0x4dbb7f;return _0x394995;})['then'](respondWithFilteredResult(_0xd5c55a,_0x205351))[_0x196a('0x43')](handleError(_0xd5c55a,null));};exports['show']=function(_0xd6d294,_0x129e3e){var _0x572c63={'raw':!![],'where':{'id':_0xd6d294[_0x196a('0x44')]['id']}},_0x4aa1d0={};_0x4aa1d0[_0x196a('0x2e')]=_[_0x196a('0x2f')](db[_0x196a('0x29')][_0x196a('0x2a')]);_0x4aa1d0[_0x196a('0x30')]=_['keys'](_0xd6d294['query']);_0x4aa1d0[_0x196a('0x31')]=_[_0x196a('0x32')](_0x4aa1d0[_0x196a('0x2e')],_0x4aa1d0[_0x196a('0x30')]);_0x572c63[_0x196a('0x33')]=_[_0x196a('0x32')](_0x4aa1d0[_0x196a('0x2e')],qs['fields'](_0xd6d294['query'][_0x196a('0x34')]));_0x572c63[_0x196a('0x33')]=_0x572c63[_0x196a('0x33')][_0x196a('0x35')]?_0x572c63[_0x196a('0x33')]:_0x4aa1d0[_0x196a('0x2e')];if(_0xd6d294[_0x196a('0x30')][_0x196a('0x3f')]){_0x572c63[_0x196a('0x40')]=[{'all':!![]}];}_0x572c63=_[_0x196a('0x3c')]({},_0x572c63,_0xd6d294[_0x196a('0x3e')]);return db[_0x196a('0x29')][_0x196a('0x45')](_0x572c63)[_0x196a('0x23')](handleEntityNotFound(_0x129e3e,null))[_0x196a('0x23')](respondWithResult(_0x129e3e,null))['catch'](handleError(_0x129e3e,null));};exports[_0x196a('0x46')]=function(_0x2b0177,_0x1cf213){return db[_0x196a('0x29')][_0x196a('0x46')](_0x2b0177[_0x196a('0x47')],{})[_0x196a('0x23')](function(_0x2daf14){var _0x371a71=_0x2b0177['user']['get']({'plain':!![]});if(!_0x371a71)throw new Error(_0x196a('0x48'));if(_0x371a71['role']===_0x196a('0x49')){var _0x306e94=_0x2daf14['get']({'plain':!![]});var _0x6c7205='ODBC';return db[_0x196a('0x4a')][_0x196a('0x45')]({'where':{'name':_0x6c7205,'userProfileId':_0x371a71[_0x196a('0x4b')]},'raw':!![]})[_0x196a('0x23')](function(_0x5a7249){if(_0x5a7249&&_0x5a7249['autoAssociation']===0x0){return db['UserProfileResource'][_0x196a('0x46')]({'name':_0x306e94[_0x196a('0x26')],'resourceId':_0x306e94['id'],'type':_0x5a7249['name'],'sectionId':_0x5a7249['id']},{})[_0x196a('0x23')](function(){return _0x2daf14;});}else{return _0x2daf14;}})[_0x196a('0x43')](function(_0x3f2056){logger[_0x196a('0x4c')](_0x196a('0x4d'),_0x3f2056);throw _0x3f2056;});}return _0x2daf14;})['then'](respondWithResult(_0x1cf213,0xc9))[_0x196a('0x43')](handleError(_0x1cf213,null));};exports[_0x196a('0x22')]=function(_0x3d7094,_0x593efc){if(_0x3d7094[_0x196a('0x47')]['id']){delete _0x3d7094[_0x196a('0x47')]['id'];}return db[_0x196a('0x29')][_0x196a('0x45')]({'where':{'id':_0x3d7094[_0x196a('0x44')]['id']}})[_0x196a('0x23')](handleEntityNotFound(_0x593efc,null))[_0x196a('0x23')](saveUpdates(_0x3d7094[_0x196a('0x47')],null))[_0x196a('0x23')](respondWithResult(_0x593efc,null))['catch'](handleError(_0x593efc,null));};exports['destroy']=function(_0x26f0da,_0x55e1a3){return db['SquareOdbc'][_0x196a('0x45')]({'where':{'id':_0x26f0da[_0x196a('0x44')]['id']}})[_0x196a('0x23')](handleEntityNotFound(_0x55e1a3,null))[_0x196a('0x23')](removeEntity(_0x55e1a3,null))[_0x196a('0x43')](handleError(_0x55e1a3,null));};exports[_0x196a('0x4e')]=function(_0x43924b,_0x4bd437,_0x1ed11){var _0x52446f;return db[_0x196a('0x29')][_0x196a('0x45')]({'where':{'id':_0x43924b[_0x196a('0x44')]['id']},'attributes':['id',_0x196a('0x4f')]})['then'](handleEntityNotFound(_0x4bd437,null))[_0x196a('0x23')](function(_0x499bc0){if(_0x499bc0){var _0x24f819=require(_0x196a('0x50'))();_0x24f819[_0x196a('0x51')](_0x499bc0[_0x196a('0x4f')]);_0x24f819[_0x196a('0x52')]();return _0x499bc0;}})[_0x196a('0x23')](respondWithResult(_0x4bd437,null))[_0x196a('0x43')](handleError(_0x4bd437,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 7937f47..2f0000a 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 _0xec81=['path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4395dd,_0x229b88){var _0x3048fb=function(_0x303178){while(--_0x303178){_0x4395dd['push'](_0x4395dd['shift']());}};_0x3048fb(++_0x229b88);}(_0xec81,0x14c));var _0x1ec8=function(_0x4b0f0e,_0x57d1f0){_0x4b0f0e=_0x4b0f0e-0x0;var _0x36acb4=_0xec81[_0x4b0f0e];return _0x36acb4;};'use strict';var _=require(_0x1ec8('0x0'));var util=require(_0x1ec8('0x1'));var logger=require(_0x1ec8('0x2'))(_0x1ec8('0x3'));var moment=require('moment');var BPromise=require(_0x1ec8('0x4'));var rp=require(_0x1ec8('0x5'));var fs=require('fs');var path=require(_0x1ec8('0x6'));var rimraf=require(_0x1ec8('0x7'));var config=require(_0x1ec8('0x8'));var attributes=require(_0x1ec8('0x9'));module['exports']=function(_0x3a3e4a,_0x17e388){return _0x3a3e4a[_0x1ec8('0xa')](_0x1ec8('0xb'),attributes,{'tableName':_0x1ec8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x321d=['SquareOdbc','square_odbc','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x434173,_0x1c45ba){var _0x5ac3f9=function(_0x3f8602){while(--_0x3f8602){_0x434173['push'](_0x434173['shift']());}};_0x5ac3f9(++_0x1c45ba);}(_0x321d,0x12b));var _0xd321=function(_0x1181cf,_0xe6bd1f){_0x1181cf=_0x1181cf-0x0;var _0x4d747f=_0x321d[_0x1181cf];return _0x4d747f;};'use strict';var _=require('lodash');var util=require(_0xd321('0x0'));var logger=require(_0xd321('0x1'))('api');var moment=require(_0xd321('0x2'));var BPromise=require(_0xd321('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd321('0x4'));var config=require(_0xd321('0x5'));var attributes=require(_0xd321('0x6'));module['exports']=function(_0x1defec,_0x5653f3){return _0x1defec['define'](_0xd321('0x7'),attributes,{'tableName':_0xd321('0x8'),'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 6ce674e..d98666a 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 _0x475f=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','find','options','raw','where','attributes','include','model','ShowSquareOdbc','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2f1cd8,_0x2beb4c){var _0x1cb1b7=function(_0x162790){while(--_0x162790){_0x2f1cd8['push'](_0x2f1cd8['shift']());}};_0x1cb1b7(++_0x2beb4c);}(_0x475f,0x1f1));var _0xf475=function(_0x4a2456,_0x53d6ca){_0x4a2456=_0x4a2456-0x0;var _0x471e32=_0x475f[_0x4a2456];return _0x471e32;};'use strict';var _=require('lodash');var util=require(_0xf475('0x0'));var moment=require(_0xf475('0x1'));var BPromise=require(_0xf475('0x2'));var rs=require(_0xf475('0x3'));var fs=require('fs');var Redis=require(_0xf475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf475('0x5'));var logger=require('../../config/logger')(_0xf475('0x6'));var config=require('../../config/environment');var jayson=require(_0xf475('0x7'));var client=jayson[_0xf475('0x8')][_0xf475('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29122e,_0x29a9dc,_0x1ebdc2){return new BPromise(function(_0x77fa4f,_0x439e11){return client[_0xf475('0xa')](_0x29122e,_0x1ebdc2)[_0xf475('0xb')](function(_0x1826f4){logger[_0xf475('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x29a9dc,_0xf475('0xd'));logger[_0xf475('0xe')](_0xf475('0xf'),_0x29a9dc,_0xf475('0xd'),JSON['stringify'](_0x1826f4));if(_0x1826f4['error']){if(_0x1826f4['error']['code']===0x1f4){logger[_0xf475('0x10')](_0xf475('0x11'),_0x29a9dc,_0x1826f4[_0xf475('0x10')][_0xf475('0x12')]);return _0x439e11(_0x1826f4[_0xf475('0x10')]['message']);}logger[_0xf475('0x10')](_0xf475('0x11'),_0x29a9dc,_0x1826f4[_0xf475('0x10')][_0xf475('0x12')]);return _0x77fa4f(_0x1826f4['error'][_0xf475('0x12')]);}else{logger[_0xf475('0xc')](_0xf475('0x11'),_0x29a9dc,'request\x20sent');_0x77fa4f(_0x1826f4[_0xf475('0x13')][_0xf475('0x12')]);}})[_0xf475('0x14')](function(_0x2831ed){logger['error'](_0xf475('0x11'),_0x29a9dc,_0x2831ed);_0x439e11(_0x2831ed);});});}exports['ShowSquareOdbc']=function(_0x10cc41){var _0x55a66f=this;return new Promise(function(_0x283873,_0x4590af){return db['SquareOdbc'][_0xf475('0x15')]({'raw':_0x10cc41[_0xf475('0x16')]?_0x10cc41[_0xf475('0x16')][_0xf475('0x17')]===undefined?!![]:![]:!![],'where':_0x10cc41[_0xf475('0x16')]?_0x10cc41[_0xf475('0x16')][_0xf475('0x18')]||null:null,'attributes':_0x10cc41['options']?_0x10cc41[_0xf475('0x16')][_0xf475('0x19')]||null:null,'include':_0x10cc41[_0xf475('0x16')]?_0x10cc41['options'][_0xf475('0x1a')]?_['map'](_0x10cc41['options'][_0xf475('0x1a')],function(_0x4ebf12){return{'model':db[_0x4ebf12[_0xf475('0x1b')]],'as':_0x4ebf12['as'],'attributes':_0x4ebf12['attributes'],'include':_0x4ebf12[_0xf475('0x1a')]?_['map'](_0x4ebf12[_0xf475('0x1a')],function(_0x186a6b){return{'model':db[_0x186a6b[_0xf475('0x1b')]],'as':_0x186a6b['as'],'attributes':_0x186a6b[_0xf475('0x19')],'include':_0x186a6b[_0xf475('0x1a')]?_['map'](_0x186a6b[_0xf475('0x1a')],function(_0x4c2f51){return{'model':db[_0x4c2f51[_0xf475('0x1b')]],'as':_0x4c2f51['as'],'attributes':_0x4c2f51['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7a6b3){logger[_0xf475('0xc')](_0xf475('0x1c'),_0x10cc41);logger[_0xf475('0xe')](_0xf475('0x1c'),_0x10cc41,JSON[_0xf475('0x1d')](_0xf7a6b3));_0x283873(_0xf7a6b3);})[_0xf475('0x14')](function(_0x5bc4ff){logger[_0xf475('0x10')](_0xf475('0x1c'),_0x5bc4ff[_0xf475('0x12')],_0x10cc41);_0x4590af(_0x55a66f[_0xf475('0x10')](0x1f4,_0x5bc4ff[_0xf475('0x12')]));});});}; \ No newline at end of file +var _0x79f9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','map','model','lodash'];(function(_0x10d43a,_0x58c6a0){var _0xfa68b9=function(_0x1df35b){while(--_0x1df35b){_0x10d43a['push'](_0x10d43a['shift']());}};_0xfa68b9(++_0x58c6a0);}(_0x79f9,0x173));var _0x979f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x79f9[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x979f('0x0'));var util=require(_0x979f('0x1'));var moment=require(_0x979f('0x2'));var BPromise=require(_0x979f('0x3'));var rs=require(_0x979f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x979f('0x5'))['db'];var utils=require(_0x979f('0x6'));var logger=require(_0x979f('0x7'))('rpc');var config=require(_0x979f('0x8'));var jayson=require(_0x979f('0x9'));var client=jayson[_0x979f('0xa')][_0x979f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31a4fc,_0x176a48,_0x324f06){return new BPromise(function(_0x35df0d,_0x537073){return client[_0x979f('0xc')](_0x31a4fc,_0x324f06)[_0x979f('0xd')](function(_0x3b7142){logger[_0x979f('0xe')](_0x979f('0xf'),_0x176a48,_0x979f('0x10'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x176a48,'request\x20sent',JSON[_0x979f('0x11')](_0x3b7142));if(_0x3b7142['error']){if(_0x3b7142[_0x979f('0x12')][_0x979f('0x13')]===0x1f4){logger['error'](_0x979f('0xf'),_0x176a48,_0x3b7142[_0x979f('0x12')][_0x979f('0x14')]);return _0x537073(_0x3b7142[_0x979f('0x12')]['message']);}logger['error'](_0x979f('0xf'),_0x176a48,_0x3b7142[_0x979f('0x12')][_0x979f('0x14')]);return _0x35df0d(_0x3b7142[_0x979f('0x12')][_0x979f('0x14')]);}else{logger['info'](_0x979f('0xf'),_0x176a48,_0x979f('0x10'));_0x35df0d(_0x3b7142['result']['message']);}})[_0x979f('0x15')](function(_0x468d4d){logger[_0x979f('0x12')](_0x979f('0xf'),_0x176a48,_0x468d4d);_0x537073(_0x468d4d);});});}exports[_0x979f('0x16')]=function(_0x3b1bd5){var _0x163058=this;return new Promise(function(_0x1c36ad,_0x51e631){return db[_0x979f('0x17')][_0x979f('0x18')]({'raw':_0x3b1bd5[_0x979f('0x19')]?_0x3b1bd5[_0x979f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3b1bd5[_0x979f('0x19')]?_0x3b1bd5['options'][_0x979f('0x1a')]||null:null,'attributes':_0x3b1bd5[_0x979f('0x19')]?_0x3b1bd5[_0x979f('0x19')][_0x979f('0x1b')]||null:null,'include':_0x3b1bd5[_0x979f('0x19')]?_0x3b1bd5[_0x979f('0x19')][_0x979f('0x1c')]?_[_0x979f('0x1d')](_0x3b1bd5[_0x979f('0x19')][_0x979f('0x1c')],function(_0x52c473){return{'model':db[_0x52c473[_0x979f('0x1e')]],'as':_0x52c473['as'],'attributes':_0x52c473[_0x979f('0x1b')],'include':_0x52c473[_0x979f('0x1c')]?_['map'](_0x52c473[_0x979f('0x1c')],function(_0xeb0f6f){return{'model':db[_0xeb0f6f[_0x979f('0x1e')]],'as':_0xeb0f6f['as'],'attributes':_0xeb0f6f[_0x979f('0x1b')],'include':_0xeb0f6f[_0x979f('0x1c')]?_[_0x979f('0x1d')](_0xeb0f6f[_0x979f('0x1c')],function(_0x46df43){return{'model':db[_0x46df43['model']],'as':_0x46df43['as'],'attributes':_0x46df43['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35bfc2){logger[_0x979f('0xe')](_0x979f('0x16'),_0x3b1bd5);logger['debug'](_0x979f('0x16'),_0x3b1bd5,JSON[_0x979f('0x11')](_0x35bfc2));_0x1c36ad(_0x35bfc2);})[_0x979f('0x15')](function(_0x566dd7){logger['error'](_0x979f('0x16'),_0x566dd7[_0x979f('0x14')],_0x3b1bd5);_0x51e631(_0x163058[_0x979f('0x12')](0x1f4,_0x566dd7[_0x979f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index bcd9506..6e2cc84 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 _0xd0da=['get','/:id','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','delete','destroy','removeUsers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cd74a,_0x49e786){var _0x3aff81=function(_0x3ae0b0){while(--_0x3ae0b0){_0x1cd74a['push'](_0x1cd74a['shift']());}};_0x3aff81(++_0x49e786);}(_0xd0da,0x1b1));var _0xad0d=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xd0da[_0x57d740];return _0x6607ef;};'use strict';var multer=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var timeout=require(_0xad0d('0x3'));var express=require(_0xad0d('0x4'));var router=express['Router']();var fs_extra=require(_0xad0d('0x5'));var auth=require(_0xad0d('0x6'));var interaction=require(_0xad0d('0x7'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xad0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad0d('0x8')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xb')]);router['get'](_0xad0d('0xc'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xd')]);router[_0xad0d('0xe')]('/',auth[_0xad0d('0xa')](),controller[_0xad0d('0xf')]);router[_0xad0d('0xe')](_0xad0d('0xc'),auth[_0xad0d('0xa')](),controller[_0xad0d('0x10')]);router[_0xad0d('0x11')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller['update']);router[_0xad0d('0x12')](_0xad0d('0x9'),auth['isAuthenticated'](),controller[_0xad0d('0x13')]);router[_0xad0d('0x12')]('/:id/users',auth[_0xad0d('0xa')](),controller[_0xad0d('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdcda=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','create','post','addUsers','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x6120b,_0x5545a3){var _0x3e2766=function(_0x104984){while(--_0x104984){_0x6120b['push'](_0x6120b['shift']());}};_0x3e2766(++_0x5545a3);}(_0xdcda,0xa3));var _0xadcd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdcda[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xadcd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xadcd('0x1'));var express=require(_0xadcd('0x2'));var router=express[_0xadcd('0x3')]();var fs_extra=require(_0xadcd('0x4'));var auth=require(_0xadcd('0x5'));var interaction=require(_0xadcd('0x6'));var config=require(_0xadcd('0x7'));var controller=require(_0xadcd('0x8'));router[_0xadcd('0x9')]('/',auth[_0xadcd('0xa')](),controller[_0xadcd('0xb')]);router[_0xadcd('0x9')](_0xadcd('0xc'),auth[_0xadcd('0xa')](),controller['show']);router['get'](_0xadcd('0xd'),auth[_0xadcd('0xa')](),controller['getUsers']);router['post']('/',auth[_0xadcd('0xa')](),controller[_0xadcd('0xe')]);router[_0xadcd('0xf')]('/:id/users',auth[_0xadcd('0xa')](),controller[_0xadcd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xadcd('0x11')]);router[_0xadcd('0x12')]('/:id',auth[_0xadcd('0xa')](),controller[_0xadcd('0x13')]);router['delete']('/:id/users',auth[_0xadcd('0xa')](),controller['removeUsers']);module[_0xadcd('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 358477e..4054408 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 _0x2782=['exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x21b5e4,_0x45e128){var _0x478953=function(_0x488b18){while(--_0x488b18){_0x21b5e4['push'](_0x21b5e4['shift']());}};_0x478953(++_0x45e128);}(_0x2782,0x17f));var _0x2278=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x2782[_0x15a8fa];return _0x1355c2;};'use strict';var Sequelize=require(_0x2278('0x0'));module[_0x2278('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2278('0x2')]},'notes':{'type':Sequelize[_0x2278('0x3')]},'preproduction':{'type':Sequelize[_0x2278('0x4')](_0x2278('0x5')),'get':function(){if(this[_0x2278('0x6')](_0x2278('0x7'))){return this['getDataValue'](_0x2278('0x7'))[_0x2278('0x8')](_0x2278('0x9'));}}},'production':{'type':Sequelize[_0x2278('0x4')](_0x2278('0x5')),'get':function(){if(this[_0x2278('0x6')](_0x2278('0xa'))){return this[_0x2278('0x6')](_0x2278('0xa'))[_0x2278('0x8')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x2278('0xb')]}}; \ No newline at end of file +var _0x1a2a=['production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','utf8','long'];(function(_0x393ea9,_0x7080c0){var _0x5c7d42=function(_0x3408e4){while(--_0x3408e4){_0x393ea9['push'](_0x393ea9['shift']());}};_0x5c7d42(++_0x7080c0);}(_0x1a2a,0xd3));var _0xa1a2=function(_0x1109eb,_0x68f359){_0x1109eb=_0x1109eb-0x0;var _0x120d4e=_0x1a2a[_0x1109eb];return _0x120d4e;};'use strict';var Sequelize=require(_0xa1a2('0x0'));module[_0xa1a2('0x1')]={'name':{'type':Sequelize[_0xa1a2('0x2')],'unique':_0xa1a2('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xa1a2('0x4')]},'preproduction':{'type':Sequelize[_0xa1a2('0x5')]('long'),'get':function(){if(this[_0xa1a2('0x6')](_0xa1a2('0x7'))){return this[_0xa1a2('0x6')](_0xa1a2('0x7'))['toString'](_0xa1a2('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xa1a2('0x9')),'get':function(){if(this['getDataValue'](_0xa1a2('0xa'))){return this[_0xa1a2('0x6')](_0xa1a2('0xa'))[_0xa1a2('0xb')](_0xa1a2('0x8'));}}},'savedAt':{'type':Sequelize[_0xa1a2('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2292b0f..11c1337 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 _0xaea2=['body','user','get','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','then','UserProfileResource','destroy','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','find','catch','create'];(function(_0x3b7f72,_0x489c77){var _0x59099d=function(_0x3426cf){while(--_0x3426cf){_0x3b7f72['push'](_0x3b7f72['shift']());}};_0x59099d(++_0x489c77);}(_0xaea2,0x77));var _0x2aea=function(_0x4cdf87,_0x200caf){_0x4cdf87=_0x4cdf87-0x0;var _0x14d49d=_0xaea2[_0x4cdf87];return _0x14d49d;};'use strict';var emlformat=require(_0x2aea('0x0'));var rimraf=require(_0x2aea('0x1'));var zipdir=require(_0x2aea('0x2'));var jsonpatch=require(_0x2aea('0x3'));var rp=require(_0x2aea('0x4'));var moment=require(_0x2aea('0x5'));var BPromise=require(_0x2aea('0x6'));var Mustache=require(_0x2aea('0x7'));var util=require('util');var path=require(_0x2aea('0x8'));var sox=require('sox');var csv=require(_0x2aea('0x9'));var ejs=require(_0x2aea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2aea('0xb'));var squel=require(_0x2aea('0xc'));var crypto=require(_0x2aea('0xd'));var jsforce=require(_0x2aea('0xe'));var deskjs=require(_0x2aea('0xf'));var toCsv=require(_0x2aea('0x9'));var querystring=require('querystring');var Papa=require(_0x2aea('0x10'));var Redis=require(_0x2aea('0x11'));var authService=require(_0x2aea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2aea('0x13'));var hardwareService=require(_0x2aea('0x14'));var logger=require(_0x2aea('0x15'))(_0x2aea('0x16'));var utils=require(_0x2aea('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2aea('0x18'))['db'];config[_0x2aea('0x19')]=_[_0x2aea('0x1a')](config[_0x2aea('0x19')],{'host':_0x2aea('0x1b'),'port':0x18eb});var socket=require(_0x2aea('0x1c'))(new Redis(config[_0x2aea('0x19')]));require(_0x2aea('0x1d'))[_0x2aea('0x1e')](socket);function respondWithStatusCode(_0x21b25d,_0x407460){_0x407460=_0x407460||0xcc;return function(_0x1f5308){if(_0x1f5308){return _0x21b25d[_0x2aea('0x1f')](_0x407460);}return _0x21b25d[_0x2aea('0x20')](_0x407460)[_0x2aea('0x21')]();};}function respondWithResult(_0x1fa224,_0x28ce1b){_0x28ce1b=_0x28ce1b||0xc8;return function(_0x2f4ee3){if(_0x2f4ee3){return _0x1fa224[_0x2aea('0x20')](_0x28ce1b)[_0x2aea('0x22')](_0x2f4ee3);}};}function respondWithFilteredResult(_0x56da58,_0x249abb){return function(_0x58a5b3){if(_0x58a5b3){var _0x3b4e2b=typeof _0x249abb[_0x2aea('0x23')]===_0x2aea('0x24')&&typeof _0x249abb[_0x2aea('0x25')]===_0x2aea('0x24');var _0x41097d=_0x58a5b3['count'];var _0x36618b=_0x3b4e2b?0x0:_0x249abb[_0x2aea('0x23')];var _0x5099fb=_0x3b4e2b?_0x58a5b3['count']:_0x249abb[_0x2aea('0x23')]+_0x249abb[_0x2aea('0x25')];var _0x31f422;if(_0x5099fb>=_0x41097d){_0x5099fb=_0x41097d;_0x31f422=0xc8;}else{_0x31f422=0xce;}_0x56da58[_0x2aea('0x20')](_0x31f422);return _0x56da58[_0x2aea('0x26')](_0x2aea('0x27'),_0x36618b+'-'+_0x5099fb+'/'+_0x41097d)[_0x2aea('0x22')](_0x58a5b3);}return null;};}function patchUpdates(_0x18ab58){return function(_0x576a66){try{jsonpatch[_0x2aea('0x28')](_0x576a66,_0x18ab58,!![]);}catch(_0x170980){return BPromise['reject'](_0x170980);}return _0x576a66[_0x2aea('0x29')]();};}function saveUpdates(_0x54fa6f,_0x445039){return function(_0x4b98d2){if(_0x4b98d2){return _0x4b98d2['update'](_0x54fa6f)[_0x2aea('0x2a')](function(_0x32f580){return _0x32f580;});}return null;};}function removeEntity(_0x42e286,_0x40d29f){return function(_0x2b2e7e){if(_0x2b2e7e){return _0x2b2e7e['destroy']()[_0x2aea('0x2a')](function(){var _0x5ee25c=_0x2b2e7e['get']({'plain':!![]});var _0x572532='SquareProjects';return db[_0x2aea('0x2b')][_0x2aea('0x2c')]({'where':{'type':_0x572532,'resourceId':_0x5ee25c['id']}})[_0x2aea('0x2a')](function(){return _0x2b2e7e;});})[_0x2aea('0x2a')](function(){_0x42e286[_0x2aea('0x20')](0xcc)[_0x2aea('0x21')]();});}};}function handleEntityNotFound(_0x29b239,_0x1784c0){return function(_0x1ebcc2){if(!_0x1ebcc2){_0x29b239['sendStatus'](0x194);}return _0x1ebcc2;};}function handleError(_0x152620,_0x24ac26){_0x24ac26=_0x24ac26||0x1f4;return function(_0x48320b){logger[_0x2aea('0x2d')](_0x48320b[_0x2aea('0x2e')]);if(_0x48320b[_0x2aea('0x2f')]){delete _0x48320b[_0x2aea('0x2f')];}_0x152620[_0x2aea('0x20')](_0x24ac26)[_0x2aea('0x30')](_0x48320b);};}exports['index']=function(_0x21a9ea,_0x203404){var _0x4d8793={},_0x342197={},_0x1e509f={'count':0x0,'rows':[]};var _0x1c0391=_[_0x2aea('0x31')](db[_0x2aea('0x32')][_0x2aea('0x33')],function(_0x4270ba){return{'name':_0x4270ba[_0x2aea('0x34')],'type':_0x4270ba['type'][_0x2aea('0x35')]};});_0x342197[_0x2aea('0x36')]=_[_0x2aea('0x31')](_0x1c0391,_0x2aea('0x2f'));_0x342197[_0x2aea('0x37')]=_[_0x2aea('0x38')](_0x21a9ea[_0x2aea('0x37')]);_0x342197[_0x2aea('0x39')]=_[_0x2aea('0x3a')](_0x342197[_0x2aea('0x36')],_0x342197['query']);_0x4d8793[_0x2aea('0x3b')]=_[_0x2aea('0x3a')](_0x342197[_0x2aea('0x36')],qs[_0x2aea('0x3c')](_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x3c')]));_0x4d8793['attributes']=_0x4d8793['attributes'][_0x2aea('0x3d')]?_0x4d8793[_0x2aea('0x3b')]:_0x342197[_0x2aea('0x36')];if(!_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x3e')](_0x2aea('0x3f'))){_0x4d8793[_0x2aea('0x25')]=qs['limit'](_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x25')]);_0x4d8793['offset']=qs[_0x2aea('0x23')](_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x23')]);}_0x4d8793[_0x2aea('0x40')]=qs[_0x2aea('0x41')](_0x21a9ea['query'][_0x2aea('0x41')]);_0x4d8793[_0x2aea('0x42')]=qs[_0x2aea('0x39')](_[_0x2aea('0x43')](_0x21a9ea[_0x2aea('0x37')],_0x342197[_0x2aea('0x39')]),_0x1c0391);if(_0x21a9ea[_0x2aea('0x37')]['filter']){_0x4d8793[_0x2aea('0x42')]=_[_0x2aea('0x44')](_0x4d8793['where'],{'$or':_[_0x2aea('0x31')](_0x1c0391,function(_0x4bfbca){if(_0x4bfbca['type']!==_0x2aea('0x45')){var _0x564fd9={};_0x564fd9[_0x4bfbca['name']]={'$like':'%'+_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x46')]+'%'};return _0x564fd9;}})});}_0x4d8793=_['merge']({},_0x4d8793,_0x21a9ea[_0x2aea('0x47')]);var _0x4da50c={'where':_0x4d8793['where']};return db[_0x2aea('0x32')][_0x2aea('0x48')](_0x4da50c)[_0x2aea('0x2a')](function(_0x201c20){_0x1e509f[_0x2aea('0x48')]=_0x201c20;if(_0x21a9ea[_0x2aea('0x37')][_0x2aea('0x49')]){_0x4d8793['include']=[{'all':!![]}];}return db[_0x2aea('0x32')][_0x2aea('0x4a')](_0x4d8793);})['then'](function(_0x1068fb){_0x1e509f[_0x2aea('0x4b')]=_0x1068fb;return _0x1e509f;})[_0x2aea('0x2a')](respondWithFilteredResult(_0x203404,_0x4d8793))['catch'](handleError(_0x203404,null));};exports['show']=function(_0x38bebb,_0x40df88){var _0x23ff0f={'raw':![],'where':{'id':_0x38bebb['params']['id']}},_0x188ba9={};_0x188ba9[_0x2aea('0x36')]=_['keys'](db['SquareProject'][_0x2aea('0x33')]);_0x188ba9['query']=_[_0x2aea('0x38')](_0x38bebb[_0x2aea('0x37')]);_0x188ba9[_0x2aea('0x39')]=_[_0x2aea('0x3a')](_0x188ba9[_0x2aea('0x36')],_0x188ba9[_0x2aea('0x37')]);_0x23ff0f[_0x2aea('0x3b')]=_[_0x2aea('0x3a')](_0x188ba9[_0x2aea('0x36')],qs[_0x2aea('0x3c')](_0x38bebb['query'][_0x2aea('0x3c')]));_0x23ff0f[_0x2aea('0x3b')]=_0x23ff0f['attributes'][_0x2aea('0x3d')]?_0x23ff0f['attributes']:_0x188ba9[_0x2aea('0x36')];if(_0x38bebb['query'][_0x2aea('0x49')]){_0x23ff0f['include']=[{'all':!![]}];}_0x23ff0f=_[_0x2aea('0x44')]({},_0x23ff0f,_0x38bebb[_0x2aea('0x47')]);return db[_0x2aea('0x32')][_0x2aea('0x4c')](_0x23ff0f)[_0x2aea('0x2a')](handleEntityNotFound(_0x40df88,null))[_0x2aea('0x2a')](respondWithResult(_0x40df88,null))[_0x2aea('0x4d')](handleError(_0x40df88,null));};exports['create']=function(_0x25641a,_0x4ca179){return db['SquareProject'][_0x2aea('0x4e')](_0x25641a[_0x2aea('0x4f')],{})[_0x2aea('0x2a')](function(_0x32927f){var _0x256f56=_0x25641a[_0x2aea('0x50')][_0x2aea('0x51')]({'plain':!![]});if(!_0x256f56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x256f56[_0x2aea('0x52')]===_0x2aea('0x50')){var _0x364eac=_0x32927f[_0x2aea('0x51')]({'plain':!![]});var _0x2b8a7e=_0x2aea('0x53');return db[_0x2aea('0x54')]['find']({'where':{'name':_0x2b8a7e,'userProfileId':_0x256f56[_0x2aea('0x55')]},'raw':!![]})[_0x2aea('0x2a')](function(_0x18154f){if(_0x18154f&&_0x18154f[_0x2aea('0x56')]===0x0){return db[_0x2aea('0x2b')]['create']({'name':_0x364eac[_0x2aea('0x2f')],'resourceId':_0x364eac['id'],'type':_0x18154f[_0x2aea('0x2f')],'sectionId':_0x18154f['id']},{})[_0x2aea('0x2a')](function(){return _0x32927f;});}else{return _0x32927f;}})[_0x2aea('0x4d')](function(_0x594109){logger['error'](_0x2aea('0x57'),_0x594109);throw _0x594109;});}return _0x32927f;})[_0x2aea('0x2a')](respondWithResult(_0x4ca179,0xc9))[_0x2aea('0x4d')](handleError(_0x4ca179,null));};exports[_0x2aea('0x58')]=function(_0x2586de,_0x3813ce){if(_0x2586de[_0x2aea('0x4f')]['id']){delete _0x2586de['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x2586de[_0x2aea('0x59')]['id']}})[_0x2aea('0x2a')](handleEntityNotFound(_0x3813ce,null))['then'](saveUpdates(_0x2586de['body'],null))['then'](respondWithResult(_0x3813ce,null))[_0x2aea('0x4d')](handleError(_0x3813ce,null));};exports[_0x2aea('0x2c')]=function(_0x2b38fc,_0x43966a){return db[_0x2aea('0x32')][_0x2aea('0x4c')]({'where':{'id':_0x2b38fc[_0x2aea('0x59')]['id']}})[_0x2aea('0x2a')](handleEntityNotFound(_0x43966a,null))['then'](removeEntity(_0x43966a,null))['catch'](handleError(_0x43966a,null));};exports[_0x2aea('0x5a')]=function(_0x58a7b9,_0x15fa97,_0x33a054){return db[_0x2aea('0x32')][_0x2aea('0x4c')]({'where':{'id':_0x58a7b9[_0x2aea('0x59')]['id']}})[_0x2aea('0x2a')](handleEntityNotFound(_0x15fa97,null))[_0x2aea('0x2a')](function(_0x94f149){if(_0x94f149){return _0x94f149[_0x2aea('0x5a')](_0x58a7b9[_0x2aea('0x4f')]['ids'],_['omit'](_0x58a7b9[_0x2aea('0x4f')],[_0x2aea('0x5b'),'id'])||{});}})[_0x2aea('0x2a')](respondWithResult(_0x15fa97,null))['catch'](handleError(_0x15fa97,null));};exports[_0x2aea('0x5c')]=function(_0x533d99,_0x157d76,_0x456a52){return db[_0x2aea('0x32')][_0x2aea('0x4c')]({'where':{'id':_0x533d99[_0x2aea('0x59')]['id']}})[_0x2aea('0x2a')](handleEntityNotFound(_0x157d76,null))[_0x2aea('0x2a')](function(_0x552f32){if(_0x552f32){return _0x552f32[_0x2aea('0x5c')](_0x533d99[_0x2aea('0x37')][_0x2aea('0x5b')])[_0x2aea('0x2a')](function(){if(_[_0x2aea('0x5d')](_0x533d99[_0x2aea('0x37')]['ids'])){for(var _0x12acf2=0x0;_0x12acf2<_0x533d99[_0x2aea('0x37')][_0x2aea('0x5b')][_0x2aea('0x3d')];_0x12acf2+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x533d99[_0x2aea('0x37')][_0x2aea('0x5b')][_0x12acf2]),'SquareProjectId':Number(_0x533d99[_0x2aea('0x59')]['id'])});}}else{socket[_0x2aea('0x5e')](_0x2aea('0x5f'),{'UserId':Number(_0x533d99[_0x2aea('0x37')]['ids']),'SquareProjectId':Number(_0x533d99[_0x2aea('0x59')]['id'])});}});}})[_0x2aea('0x2a')](respondWithStatusCode(_0x157d76,null))[_0x2aea('0x4d')](handleError(_0x157d76,null));};exports[_0x2aea('0x60')]=function(_0x4bb338,_0x20a597,_0x28a3cb){var _0x2a0655={};var _0xe1881b={};var _0x1f3e96;var _0xebc89f;return db[_0x2aea('0x32')][_0x2aea('0x61')]({'where':{'id':_0x4bb338[_0x2aea('0x59')]['id']}})[_0x2aea('0x2a')](handleEntityNotFound(_0x20a597,null))[_0x2aea('0x2a')](function(_0x2a1b2f){if(_0x2a1b2f){_0x1f3e96=_0x2a1b2f;_0xe1881b[_0x2aea('0x36')]=_['keys'](db[_0x2aea('0x62')][_0x2aea('0x33')]);_0xe1881b['query']=_[_0x2aea('0x38')](_0x4bb338['query']);_0xe1881b[_0x2aea('0x39')]=_[_0x2aea('0x3a')](_0xe1881b[_0x2aea('0x36')],_0xe1881b[_0x2aea('0x37')]);_0x2a0655['attributes']=_['intersection'](_0xe1881b[_0x2aea('0x36')],qs[_0x2aea('0x3c')](_0x4bb338[_0x2aea('0x37')]['fields']));_0x2a0655[_0x2aea('0x3b')]=_0x2a0655[_0x2aea('0x3b')][_0x2aea('0x3d')]?_0x2a0655[_0x2aea('0x3b')]:_0xe1881b[_0x2aea('0x36')];_0x2a0655[_0x2aea('0x40')]=qs[_0x2aea('0x41')](_0x4bb338[_0x2aea('0x37')]['sort']);_0x2a0655[_0x2aea('0x42')]=qs[_0x2aea('0x39')](_['pick'](_0x4bb338['query'],_0xe1881b[_0x2aea('0x39')]));if(_0x4bb338['query'][_0x2aea('0x46')]){_0x2a0655[_0x2aea('0x42')]=_[_0x2aea('0x44')](_0x2a0655[_0x2aea('0x42')],{'$or':_['map'](_0x2a0655['attributes'],function(_0x379eb6){var _0xbd97b5={};_0xbd97b5[_0x379eb6]={'$like':'%'+_0x4bb338[_0x2aea('0x37')][_0x2aea('0x46')]+'%'};return _0xbd97b5;})});}_0x2a0655=_['merge']({},_0x2a0655,_0x4bb338[_0x2aea('0x47')]);return _0x1f3e96[_0x2aea('0x60')](_0x2a0655);}})[_0x2aea('0x2a')](function(_0xfa00e5){if(_0xfa00e5){_0xebc89f=_0xfa00e5['length'];if(!_0x4bb338[_0x2aea('0x37')][_0x2aea('0x3e')](_0x2aea('0x3f'))){_0x2a0655[_0x2aea('0x25')]=qs[_0x2aea('0x25')](_0x4bb338[_0x2aea('0x37')][_0x2aea('0x25')]);_0x2a0655['offset']=qs[_0x2aea('0x23')](_0x4bb338[_0x2aea('0x37')]['offset']);}return _0x1f3e96[_0x2aea('0x60')](_0x2a0655);}})[_0x2aea('0x2a')](function(_0x184855){if(_0x184855){return _0x184855?{'count':_0xebc89f,'rows':_0x184855}:null;}})['then'](respondWithResult(_0x20a597,null))[_0x2aea('0x4d')](handleError(_0x20a597,null));}; \ No newline at end of file +var _0x815a=['set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','SquareProject','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x815a,0x15e));var _0xa815=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x815a[_0x11946c];return _0x383935;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa815('0x0'));var rp=require(_0xa815('0x1'));var moment=require(_0xa815('0x2'));var BPromise=require(_0xa815('0x3'));var Mustache=require(_0xa815('0x4'));var util=require(_0xa815('0x5'));var path=require(_0xa815('0x6'));var sox=require('sox');var csv=require(_0xa815('0x7'));var ejs=require(_0xa815('0x8'));var fs=require('fs');var fs_extra=require(_0xa815('0x9'));var _=require(_0xa815('0xa'));var squel=require(_0xa815('0xb'));var crypto=require(_0xa815('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa815('0xd'));var toCsv=require(_0xa815('0x7'));var querystring=require(_0xa815('0xe'));var Papa=require(_0xa815('0xf'));var Redis=require(_0xa815('0x10'));var authService=require(_0xa815('0x11'));var qs=require(_0xa815('0x12'));var as=require(_0xa815('0x13'));var hardwareService=require(_0xa815('0x14'));var logger=require(_0xa815('0x15'))(_0xa815('0x16'));var utils=require(_0xa815('0x17'));var config=require(_0xa815('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa815('0x19'))['db'];config[_0xa815('0x1a')]=_['defaults'](config['redis'],{'host':_0xa815('0x1b'),'port':0x18eb});var socket=require(_0xa815('0x1c'))(new Redis(config[_0xa815('0x1a')]));require(_0xa815('0x1d'))[_0xa815('0x1e')](socket);function respondWithStatusCode(_0x592b5d,_0x1afa7a){_0x1afa7a=_0x1afa7a||0xcc;return function(_0x5495b8){if(_0x5495b8){return _0x592b5d[_0xa815('0x1f')](_0x1afa7a);}return _0x592b5d[_0xa815('0x20')](_0x1afa7a)['end']();};}function respondWithResult(_0x4037a6,_0x4199b2){_0x4199b2=_0x4199b2||0xc8;return function(_0x29e99a){if(_0x29e99a){return _0x4037a6[_0xa815('0x20')](_0x4199b2)[_0xa815('0x21')](_0x29e99a);}};}function respondWithFilteredResult(_0x2733da,_0x2df762){return function(_0x26ae7b){if(_0x26ae7b){var _0x320646=typeof _0x2df762['offset']===_0xa815('0x22')&&typeof _0x2df762[_0xa815('0x23')]==='undefined';var _0xf0bae2=_0x26ae7b['count'];var _0x42ae3d=_0x320646?0x0:_0x2df762['offset'];var _0x340cb8=_0x320646?_0x26ae7b[_0xa815('0x24')]:_0x2df762[_0xa815('0x25')]+_0x2df762['limit'];var _0x4d8a49;if(_0x340cb8>=_0xf0bae2){_0x340cb8=_0xf0bae2;_0x4d8a49=0xc8;}else{_0x4d8a49=0xce;}_0x2733da[_0xa815('0x20')](_0x4d8a49);return _0x2733da[_0xa815('0x26')](_0xa815('0x27'),_0x42ae3d+'-'+_0x340cb8+'/'+_0xf0bae2)[_0xa815('0x21')](_0x26ae7b);}return null;};}function patchUpdates(_0x5f4a57){return function(_0x2386a1){try{jsonpatch[_0xa815('0x28')](_0x2386a1,_0x5f4a57,!![]);}catch(_0x50b83b){return BPromise[_0xa815('0x29')](_0x50b83b);}return _0x2386a1[_0xa815('0x2a')]();};}function saveUpdates(_0x3296b2,_0x45d702){return function(_0x3311b9){if(_0x3311b9){return _0x3311b9[_0xa815('0x2b')](_0x3296b2)['then'](function(_0x1c407a){return _0x1c407a;});}return null;};}function removeEntity(_0x455d29,_0x2d6bb4){return function(_0x599c20){if(_0x599c20){return _0x599c20[_0xa815('0x2c')]()[_0xa815('0x2d')](function(){var _0x3e8517=_0x599c20['get']({'plain':!![]});var _0x1bdd9f='SquareProjects';return db[_0xa815('0x2e')]['destroy']({'where':{'type':_0x1bdd9f,'resourceId':_0x3e8517['id']}})[_0xa815('0x2d')](function(){return _0x599c20;});})[_0xa815('0x2d')](function(){_0x455d29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21dc0a,_0x58ffcb){return function(_0x466511){if(!_0x466511){_0x21dc0a[_0xa815('0x1f')](0x194);}return _0x466511;};}function handleError(_0x6f9e2d,_0x428954){_0x428954=_0x428954||0x1f4;return function(_0x504ace){logger[_0xa815('0x2f')](_0x504ace[_0xa815('0x30')]);if(_0x504ace[_0xa815('0x31')]){delete _0x504ace['name'];}_0x6f9e2d[_0xa815('0x20')](_0x428954)[_0xa815('0x32')](_0x504ace);};}exports['index']=function(_0x2e52ee,_0x2befde){var _0xcef621={},_0x50cf5c={},_0x2658eb={'count':0x0,'rows':[]};var _0x12393b=_[_0xa815('0x33')](db['SquareProject'][_0xa815('0x34')],function(_0x53eed4){return{'name':_0x53eed4[_0xa815('0x35')],'type':_0x53eed4[_0xa815('0x36')][_0xa815('0x37')]};});_0x50cf5c[_0xa815('0x38')]=_[_0xa815('0x33')](_0x12393b,_0xa815('0x31'));_0x50cf5c[_0xa815('0x39')]=_['keys'](_0x2e52ee[_0xa815('0x39')]);_0x50cf5c[_0xa815('0x3a')]=_[_0xa815('0x3b')](_0x50cf5c[_0xa815('0x38')],_0x50cf5c[_0xa815('0x39')]);_0xcef621[_0xa815('0x3c')]=_[_0xa815('0x3b')](_0x50cf5c['model'],qs['fields'](_0x2e52ee[_0xa815('0x39')][_0xa815('0x3d')]));_0xcef621['attributes']=_0xcef621['attributes'][_0xa815('0x3e')]?_0xcef621[_0xa815('0x3c')]:_0x50cf5c[_0xa815('0x38')];if(!_0x2e52ee[_0xa815('0x39')][_0xa815('0x3f')]('nolimit')){_0xcef621[_0xa815('0x23')]=qs[_0xa815('0x23')](_0x2e52ee[_0xa815('0x39')][_0xa815('0x23')]);_0xcef621[_0xa815('0x25')]=qs['offset'](_0x2e52ee['query']['offset']);}_0xcef621[_0xa815('0x40')]=qs['sort'](_0x2e52ee[_0xa815('0x39')][_0xa815('0x41')]);_0xcef621['where']=qs[_0xa815('0x3a')](_[_0xa815('0x42')](_0x2e52ee[_0xa815('0x39')],_0x50cf5c[_0xa815('0x3a')]),_0x12393b);if(_0x2e52ee[_0xa815('0x39')][_0xa815('0x43')]){_0xcef621['where']=_[_0xa815('0x44')](_0xcef621[_0xa815('0x45')],{'$or':_[_0xa815('0x33')](_0x12393b,function(_0x49e2c3){if(_0x49e2c3[_0xa815('0x36')]!==_0xa815('0x46')){var _0x56a4a0={};_0x56a4a0[_0x49e2c3[_0xa815('0x31')]]={'$like':'%'+_0x2e52ee[_0xa815('0x39')][_0xa815('0x43')]+'%'};return _0x56a4a0;}})});}_0xcef621=_[_0xa815('0x44')]({},_0xcef621,_0x2e52ee[_0xa815('0x47')]);var _0x3ccd6a={'where':_0xcef621[_0xa815('0x45')]};return db['SquareProject'][_0xa815('0x24')](_0x3ccd6a)[_0xa815('0x2d')](function(_0x5bd759){_0x2658eb[_0xa815('0x24')]=_0x5bd759;if(_0x2e52ee['query']['includeAll']){_0xcef621['include']=[{'all':!![]}];}return db[_0xa815('0x48')]['findAll'](_0xcef621);})[_0xa815('0x2d')](function(_0x35efab){_0x2658eb[_0xa815('0x49')]=_0x35efab;return _0x2658eb;})[_0xa815('0x2d')](respondWithFilteredResult(_0x2befde,_0xcef621))[_0xa815('0x4a')](handleError(_0x2befde,null));};exports[_0xa815('0x4b')]=function(_0x2bf02c,_0x17d0ad){var _0x5957aa={'raw':![],'where':{'id':_0x2bf02c[_0xa815('0x4c')]['id']}},_0x2df904={};_0x2df904[_0xa815('0x38')]=_[_0xa815('0x4d')](db['SquareProject']['rawAttributes']);_0x2df904[_0xa815('0x39')]=_[_0xa815('0x4d')](_0x2bf02c['query']);_0x2df904[_0xa815('0x3a')]=_[_0xa815('0x3b')](_0x2df904[_0xa815('0x38')],_0x2df904[_0xa815('0x39')]);_0x5957aa[_0xa815('0x3c')]=_[_0xa815('0x3b')](_0x2df904[_0xa815('0x38')],qs[_0xa815('0x3d')](_0x2bf02c[_0xa815('0x39')][_0xa815('0x3d')]));_0x5957aa[_0xa815('0x3c')]=_0x5957aa[_0xa815('0x3c')][_0xa815('0x3e')]?_0x5957aa[_0xa815('0x3c')]:_0x2df904['model'];if(_0x2bf02c[_0xa815('0x39')][_0xa815('0x4e')]){_0x5957aa['include']=[{'all':!![]}];}_0x5957aa=_['merge']({},_0x5957aa,_0x2bf02c[_0xa815('0x47')]);return db['SquareProject'][_0xa815('0x4f')](_0x5957aa)[_0xa815('0x2d')](handleEntityNotFound(_0x17d0ad,null))[_0xa815('0x2d')](respondWithResult(_0x17d0ad,null))[_0xa815('0x4a')](handleError(_0x17d0ad,null));};exports[_0xa815('0x50')]=function(_0x2bff9e,_0x402767){return db[_0xa815('0x48')][_0xa815('0x50')](_0x2bff9e[_0xa815('0x51')],{})[_0xa815('0x2d')](function(_0x1cd94c){var _0xf0492=_0x2bff9e['user']['get']({'plain':!![]});if(!_0xf0492)throw new Error(_0xa815('0x52'));if(_0xf0492[_0xa815('0x53')]===_0xa815('0x54')){var _0x552611=_0x1cd94c[_0xa815('0x55')]({'plain':!![]});var _0x1f67e5='SquareProjects';return db['UserProfileSection'][_0xa815('0x4f')]({'where':{'name':_0x1f67e5,'userProfileId':_0xf0492[_0xa815('0x56')]},'raw':!![]})[_0xa815('0x2d')](function(_0x2af847){if(_0x2af847&&_0x2af847[_0xa815('0x57')]===0x0){return db[_0xa815('0x2e')]['create']({'name':_0x552611[_0xa815('0x31')],'resourceId':_0x552611['id'],'type':_0x2af847['name'],'sectionId':_0x2af847['id']},{})[_0xa815('0x2d')](function(){return _0x1cd94c;});}else{return _0x1cd94c;}})[_0xa815('0x4a')](function(_0x6cb53d){logger[_0xa815('0x2f')](_0xa815('0x58'),_0x6cb53d);throw _0x6cb53d;});}return _0x1cd94c;})['then'](respondWithResult(_0x402767,0xc9))[_0xa815('0x4a')](handleError(_0x402767,null));};exports[_0xa815('0x2b')]=function(_0x1a6e83,_0x1758db){if(_0x1a6e83['body']['id']){delete _0x1a6e83[_0xa815('0x51')]['id'];}return db[_0xa815('0x48')][_0xa815('0x4f')]({'where':{'id':_0x1a6e83['params']['id']}})[_0xa815('0x2d')](handleEntityNotFound(_0x1758db,null))[_0xa815('0x2d')](saveUpdates(_0x1a6e83[_0xa815('0x51')],null))['then'](respondWithResult(_0x1758db,null))[_0xa815('0x4a')](handleError(_0x1758db,null));};exports[_0xa815('0x2c')]=function(_0x540b8b,_0xa85cfc){return db[_0xa815('0x48')]['find']({'where':{'id':_0x540b8b[_0xa815('0x4c')]['id']}})[_0xa815('0x2d')](handleEntityNotFound(_0xa85cfc,null))['then'](removeEntity(_0xa85cfc,null))['catch'](handleError(_0xa85cfc,null));};exports[_0xa815('0x59')]=function(_0x2e0254,_0x4a45e6,_0x19dd2d){return db[_0xa815('0x48')][_0xa815('0x4f')]({'where':{'id':_0x2e0254[_0xa815('0x4c')]['id']}})[_0xa815('0x2d')](handleEntityNotFound(_0x4a45e6,null))[_0xa815('0x2d')](function(_0x26a848){if(_0x26a848){return _0x26a848[_0xa815('0x59')](_0x2e0254[_0xa815('0x51')][_0xa815('0x5a')],_[_0xa815('0x5b')](_0x2e0254['body'],[_0xa815('0x5a'),'id'])||{});}})[_0xa815('0x2d')](respondWithResult(_0x4a45e6,null))[_0xa815('0x4a')](handleError(_0x4a45e6,null));};exports['removeUsers']=function(_0xcb1db5,_0x38085e,_0xfe758e){return db[_0xa815('0x48')][_0xa815('0x4f')]({'where':{'id':_0xcb1db5['params']['id']}})[_0xa815('0x2d')](handleEntityNotFound(_0x38085e,null))[_0xa815('0x2d')](function(_0x3a2d80){if(_0x3a2d80){return _0x3a2d80[_0xa815('0x5c')](_0xcb1db5[_0xa815('0x39')]['ids'])[_0xa815('0x2d')](function(){if(_[_0xa815('0x5d')](_0xcb1db5[_0xa815('0x39')][_0xa815('0x5a')])){for(var _0x317aa1=0x0;_0x317aa1<_0xcb1db5['query'][_0xa815('0x5a')]['length'];_0x317aa1+=0x1){socket[_0xa815('0x5e')](_0xa815('0x5f'),{'UserId':Number(_0xcb1db5[_0xa815('0x39')][_0xa815('0x5a')][_0x317aa1]),'SquareProjectId':Number(_0xcb1db5[_0xa815('0x4c')]['id'])});}}else{socket[_0xa815('0x5e')]('userSquareProject:remove',{'UserId':Number(_0xcb1db5[_0xa815('0x39')]['ids']),'SquareProjectId':Number(_0xcb1db5[_0xa815('0x4c')]['id'])});}});}})[_0xa815('0x2d')](respondWithStatusCode(_0x38085e,null))[_0xa815('0x4a')](handleError(_0x38085e,null));};exports['getUsers']=function(_0x277aed,_0x54d53c,_0x2c9cf6){var _0x3892fa={};var _0x422487={};var _0x3b68ac;var _0x50917d;return db[_0xa815('0x48')][_0xa815('0x60')]({'where':{'id':_0x277aed['params']['id']}})[_0xa815('0x2d')](handleEntityNotFound(_0x54d53c,null))[_0xa815('0x2d')](function(_0x21c2c2){if(_0x21c2c2){_0x3b68ac=_0x21c2c2;_0x422487['model']=_[_0xa815('0x4d')](db['User'][_0xa815('0x34')]);_0x422487[_0xa815('0x39')]=_[_0xa815('0x4d')](_0x277aed[_0xa815('0x39')]);_0x422487['filters']=_[_0xa815('0x3b')](_0x422487['model'],_0x422487[_0xa815('0x39')]);_0x3892fa[_0xa815('0x3c')]=_[_0xa815('0x3b')](_0x422487[_0xa815('0x38')],qs[_0xa815('0x3d')](_0x277aed[_0xa815('0x39')][_0xa815('0x3d')]));_0x3892fa[_0xa815('0x3c')]=_0x3892fa['attributes'][_0xa815('0x3e')]?_0x3892fa[_0xa815('0x3c')]:_0x422487[_0xa815('0x38')];_0x3892fa[_0xa815('0x40')]=qs[_0xa815('0x41')](_0x277aed['query'][_0xa815('0x41')]);_0x3892fa[_0xa815('0x45')]=qs[_0xa815('0x3a')](_[_0xa815('0x42')](_0x277aed['query'],_0x422487[_0xa815('0x3a')]));if(_0x277aed['query'][_0xa815('0x43')]){_0x3892fa[_0xa815('0x45')]=_[_0xa815('0x44')](_0x3892fa[_0xa815('0x45')],{'$or':_[_0xa815('0x33')](_0x3892fa[_0xa815('0x3c')],function(_0x1506e9){var _0x8cd561={};_0x8cd561[_0x1506e9]={'$like':'%'+_0x277aed[_0xa815('0x39')][_0xa815('0x43')]+'%'};return _0x8cd561;})});}_0x3892fa=_[_0xa815('0x44')]({},_0x3892fa,_0x277aed[_0xa815('0x47')]);return _0x3b68ac['getUsers'](_0x3892fa);}})[_0xa815('0x2d')](function(_0x14b1c1){if(_0x14b1c1){_0x50917d=_0x14b1c1['length'];if(!_0x277aed['query'][_0xa815('0x3f')]('nolimit')){_0x3892fa[_0xa815('0x23')]=qs[_0xa815('0x23')](_0x277aed[_0xa815('0x39')][_0xa815('0x23')]);_0x3892fa[_0xa815('0x25')]=qs[_0xa815('0x25')](_0x277aed[_0xa815('0x39')][_0xa815('0x25')]);}return _0x3b68ac['getUsers'](_0x3892fa);}})[_0xa815('0x2d')](function(_0x476109){if(_0x476109){return _0x476109?{'count':_0x50917d,'rows':_0x476109}:null;}})[_0xa815('0x2d')](respondWithResult(_0x54d53c,null))['catch'](handleError(_0x54d53c,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9d6cbbe..b7e3152 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 _0xaef5=['update','remove','emit','events','../../mysqldb','setMaxListeners','save'];(function(_0x5e5cf7,_0x3b020d){var _0x3f4e70=function(_0x306ad8){while(--_0x306ad8){_0x5e5cf7['push'](_0x5e5cf7['shift']());}};_0x3f4e70(++_0x3b020d);}(_0xaef5,0x16f));var _0x5aef=function(_0x42ef25,_0x6c72e4){_0x42ef25=_0x42ef25-0x0;var _0x5c93a4=_0xaef5[_0x42ef25];return _0x5c93a4;};'use strict';var EventEmitter=require(_0x5aef('0x0'));var SquareProject=require(_0x5aef('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5aef('0x2')](0x0);var events={'afterCreate':_0x5aef('0x3'),'afterUpdate':_0x5aef('0x4'),'afterDestroy':_0x5aef('0x5')};function emitEvent(_0x13079c){return function(_0x212bd0,_0x5b253e,_0x5948d8){SquareProjectEvents['emit'](_0x13079c+':'+_0x212bd0['id'],_0x212bd0);SquareProjectEvents[_0x5aef('0x6')](_0x13079c,_0x212bd0);_0x5948d8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x3f6b=['emit','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x2f4adf,_0x2fb261){var _0x19831e=function(_0xb477cb){while(--_0xb477cb){_0x2f4adf['push'](_0x2f4adf['shift']());}};_0x19831e(++_0x2fb261);}(_0x3f6b,0xb8));var _0xb3f6=function(_0x5cbb2f,_0x505114){_0x5cbb2f=_0x5cbb2f-0x0;var _0xeecc36=_0x3f6b[_0x5cbb2f];return _0xeecc36;};'use strict';var EventEmitter=require(_0xb3f6('0x0'));var SquareProject=require(_0xb3f6('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb3f6('0x2')](0x0);var events={'afterCreate':_0xb3f6('0x3'),'afterUpdate':_0xb3f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10c61d){return function(_0x1098f4,_0x464298,_0x556ef3){SquareProjectEvents[_0xb3f6('0x5')](_0x10c61d+':'+_0x1098f4['id'],_0x1098f4);SquareProjectEvents[_0xb3f6('0x5')](_0x10c61d,_0x1098f4);_0x556ef3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xb3f6('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 71b90e1..ba88659 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 _0x3e50=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','changed'];(function(_0x20ec3d,_0x2c3c3b){var _0x5a275f=function(_0x72fb86){while(--_0x72fb86){_0x20ec3d['push'](_0x20ec3d['shift']());}};_0x5a275f(++_0x2c3c3b);}(_0x3e50,0x65));var _0x03e5=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x3e50[_0xcd5a3d];return _0xd43207;};'use strict';var _=require(_0x03e5('0x0'));var util=require(_0x03e5('0x1'));var logger=require('../../config/logger')(_0x03e5('0x2'));var moment=require(_0x03e5('0x3'));var BPromise=require(_0x03e5('0x4'));var rp=require(_0x03e5('0x5'));var fs=require('fs');var path=require(_0x03e5('0x6'));var rimraf=require(_0x03e5('0x7'));var config=require(_0x03e5('0x8'));var attributes=require(_0x03e5('0x9'));module['exports']=function(_0x2f5684,_0x2ed988){return _0x2f5684[_0x03e5('0xa')](_0x03e5('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ecc62,_0x4ecbe0,_0x27f15d){if(_0x2ecc62[_0x03e5('0xc')](_0x03e5('0xd'))){_0x2ecc62[_0x03e5('0xe')]=moment()[_0x03e5('0xf')](_0x03e5('0x10'));}if(_0x2ecc62[_0x03e5('0xc')](_0x03e5('0x11'))){_0x2ecc62[_0x03e5('0x12')]=moment()['format'](_0x03e5('0x10'));}_0x27f15d(null,_0x2ecc62);}}});}; \ No newline at end of file +var _0xeda5=['format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction'];(function(_0x2c9fa3,_0x16e92c){var _0x24db0c=function(_0x3d9c6f){while(--_0x3d9c6f){_0x2c9fa3['push'](_0x2c9fa3['shift']());}};_0x24db0c(++_0x16e92c);}(_0xeda5,0x101));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5eda('0x0'));var util=require(_0x5eda('0x1'));var logger=require(_0x5eda('0x2'))(_0x5eda('0x3'));var moment=require(_0x5eda('0x4'));var BPromise=require(_0x5eda('0x5'));var rp=require(_0x5eda('0x6'));var fs=require('fs');var path=require(_0x5eda('0x7'));var rimraf=require(_0x5eda('0x8'));var config=require(_0x5eda('0x9'));var attributes=require(_0x5eda('0xa'));module[_0x5eda('0xb')]=function(_0x2bd382,_0x6b4715){return _0x2bd382[_0x5eda('0xc')](_0x5eda('0xd'),attributes,{'tableName':_0x5eda('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55fc51,_0x28e1cf,_0x294df1){if(_0x55fc51['changed'](_0x5eda('0xf'))){_0x55fc51['savedAt']=moment()[_0x5eda('0x10')](_0x5eda('0x11'));}if(_0x55fc51[_0x5eda('0x12')](_0x5eda('0x13'))){_0x55fc51[_0x5eda('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x294df1(null,_0x55fc51);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 90d7d89..72dd60e 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 _0xac54=['attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./squareProject.socket','request','then','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','ShowSquareProject','find','options','raw','where','include','model','map'];(function(_0x4f540b,_0xa1df51){var _0x148f65=function(_0x1e138e){while(--_0x1e138e){_0x4f540b['push'](_0x4f540b['shift']());}};_0x148f65(++_0xa1df51);}(_0xac54,0x133));var _0x4ac5=function(_0x45e8fe,_0x24c91f){_0x45e8fe=_0x45e8fe-0x0;var _0x4f774b=_0xac54[_0x45e8fe];return _0x4f774b;};'use strict';var _=require(_0x4ac5('0x0'));var util=require(_0x4ac5('0x1'));var moment=require(_0x4ac5('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ac5('0x3'));var fs=require('fs');var Redis=require(_0x4ac5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ac5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ac5('0x6'));var jayson=require(_0x4ac5('0x7'));var client=jayson[_0x4ac5('0x8')][_0x4ac5('0x9')]({'port':0x232a});config[_0x4ac5('0xa')]=_['defaults'](config[_0x4ac5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ac5('0xb'))(new Redis(config['redis']));require(_0x4ac5('0xc'))['register'](socket);function respondWithRpcPromise(_0xf226a6,_0x24282e,_0x14a291){return new BPromise(function(_0x3210db,_0x414a85){return client[_0x4ac5('0xd')](_0xf226a6,_0x14a291)[_0x4ac5('0xe')](function(_0x5d14d1){logger['info'](_0x4ac5('0xf'),_0x24282e,'request\x20sent');logger[_0x4ac5('0x10')](_0x4ac5('0x11'),_0x24282e,'request\x20sent',JSON[_0x4ac5('0x12')](_0x5d14d1));if(_0x5d14d1[_0x4ac5('0x13')]){if(_0x5d14d1[_0x4ac5('0x13')][_0x4ac5('0x14')]===0x1f4){logger[_0x4ac5('0x13')](_0x4ac5('0xf'),_0x24282e,_0x5d14d1[_0x4ac5('0x13')]['message']);return _0x414a85(_0x5d14d1[_0x4ac5('0x13')]['message']);}logger[_0x4ac5('0x13')](_0x4ac5('0xf'),_0x24282e,_0x5d14d1[_0x4ac5('0x13')]['message']);return _0x3210db(_0x5d14d1['error'][_0x4ac5('0x15')]);}else{logger[_0x4ac5('0x16')](_0x4ac5('0xf'),_0x24282e,_0x4ac5('0x17'));_0x3210db(_0x5d14d1['result'][_0x4ac5('0x15')]);}})[_0x4ac5('0x18')](function(_0x219686){logger[_0x4ac5('0x13')](_0x4ac5('0xf'),_0x24282e,_0x219686);_0x414a85(_0x219686);});});}exports[_0x4ac5('0x19')]=function(_0x1debd){var _0x43e06f=this;return new Promise(function(_0x116fe1,_0x394c50){return db['SquareProject'][_0x4ac5('0x1a')]({'raw':_0x1debd[_0x4ac5('0x1b')]?_0x1debd['options'][_0x4ac5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1debd['options']?_0x1debd[_0x4ac5('0x1b')][_0x4ac5('0x1d')]||null:null,'attributes':_0x1debd['options']?_0x1debd[_0x4ac5('0x1b')]['attributes']||null:null,'include':_0x1debd[_0x4ac5('0x1b')]?_0x1debd[_0x4ac5('0x1b')][_0x4ac5('0x1e')]?_['map'](_0x1debd[_0x4ac5('0x1b')][_0x4ac5('0x1e')],function(_0x353cac){return{'model':db[_0x353cac[_0x4ac5('0x1f')]],'as':_0x353cac['as'],'attributes':_0x353cac['attributes'],'include':_0x353cac[_0x4ac5('0x1e')]?_[_0x4ac5('0x20')](_0x353cac['include'],function(_0x4ad2e0){return{'model':db[_0x4ad2e0[_0x4ac5('0x1f')]],'as':_0x4ad2e0['as'],'attributes':_0x4ad2e0[_0x4ac5('0x21')],'include':_0x4ad2e0[_0x4ac5('0x1e')]?_[_0x4ac5('0x20')](_0x4ad2e0[_0x4ac5('0x1e')],function(_0x24c39d){return{'model':db[_0x24c39d['model']],'as':_0x24c39d['as'],'attributes':_0x24c39d[_0x4ac5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4ac5('0xe')](function(_0x3bb4c7){logger['info']('ShowSquareProject',_0x1debd);logger[_0x4ac5('0x10')](_0x4ac5('0x19'),_0x1debd,JSON[_0x4ac5('0x12')](_0x3bb4c7));_0x116fe1(_0x3bb4c7);})[_0x4ac5('0x18')](function(_0x1c89a3){logger[_0x4ac5('0x13')](_0x4ac5('0x19'),_0x1c89a3['message'],_0x1debd);_0x394c50(_0x43e06f[_0x4ac5('0x13')](0x1f4,_0x1c89a3[_0x4ac5('0x15')]));});});}; \ No newline at end of file +var _0xec11=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./squareProject.socket','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','info','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','then','lodash','util'];(function(_0xe4e93b,_0x4f1bf7){var _0x3bfe42=function(_0x2da986){while(--_0x2da986){_0xe4e93b['push'](_0xe4e93b['shift']());}};_0x3bfe42(++_0x4f1bf7);}(_0xec11,0x130));var _0x1ec1=function(_0xf02a78,_0x5210f2){_0xf02a78=_0xf02a78-0x0;var _0x43e90c=_0xec11[_0xf02a78];return _0x43e90c;};'use strict';var _=require(_0x1ec1('0x0'));var util=require(_0x1ec1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ec1('0x2'));var fs=require('fs');var Redis=require(_0x1ec1('0x3'));var db=require(_0x1ec1('0x4'))['db'];var utils=require(_0x1ec1('0x5'));var logger=require('../../config/logger')(_0x1ec1('0x6'));var config=require(_0x1ec1('0x7'));var jayson=require(_0x1ec1('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1ec1('0x9')],{'host':_0x1ec1('0xa'),'port':0x18eb});var socket=require(_0x1ec1('0xb'))(new Redis(config['redis']));require(_0x1ec1('0xc'))['register'](socket);function respondWithRpcPromise(_0x21b559,_0xb03c2f,_0x587fcb){return new BPromise(function(_0x3eb9bb,_0x2c3689){return client['request'](_0x21b559,_0x587fcb)['then'](function(_0x174640){logger['info']('SquareProject,\x20%s,\x20%s',_0xb03c2f,_0x1ec1('0xd'));logger[_0x1ec1('0xe')](_0x1ec1('0xf'),_0xb03c2f,_0x1ec1('0xd'),JSON[_0x1ec1('0x10')](_0x174640));if(_0x174640[_0x1ec1('0x11')]){if(_0x174640[_0x1ec1('0x11')][_0x1ec1('0x12')]===0x1f4){logger[_0x1ec1('0x11')](_0x1ec1('0x13'),_0xb03c2f,_0x174640[_0x1ec1('0x11')][_0x1ec1('0x14')]);return _0x2c3689(_0x174640[_0x1ec1('0x11')]['message']);}logger[_0x1ec1('0x11')](_0x1ec1('0x13'),_0xb03c2f,_0x174640[_0x1ec1('0x11')]['message']);return _0x3eb9bb(_0x174640[_0x1ec1('0x11')][_0x1ec1('0x14')]);}else{logger[_0x1ec1('0x15')](_0x1ec1('0x13'),_0xb03c2f,_0x1ec1('0xd'));_0x3eb9bb(_0x174640[_0x1ec1('0x16')][_0x1ec1('0x14')]);}})[_0x1ec1('0x17')](function(_0x7603c){logger[_0x1ec1('0x11')](_0x1ec1('0x13'),_0xb03c2f,_0x7603c);_0x2c3689(_0x7603c);});});}exports[_0x1ec1('0x18')]=function(_0x42d26f){var _0x221b9b=this;return new Promise(function(_0x4eeb6a,_0x22670a){return db[_0x1ec1('0x19')][_0x1ec1('0x1a')]({'raw':_0x42d26f['options']?_0x42d26f[_0x1ec1('0x1b')][_0x1ec1('0x1c')]===undefined?!![]:![]:!![],'where':_0x42d26f['options']?_0x42d26f[_0x1ec1('0x1b')]['where']||null:null,'attributes':_0x42d26f['options']?_0x42d26f[_0x1ec1('0x1b')][_0x1ec1('0x1d')]||null:null,'include':_0x42d26f['options']?_0x42d26f[_0x1ec1('0x1b')][_0x1ec1('0x1e')]?_[_0x1ec1('0x1f')](_0x42d26f[_0x1ec1('0x1b')][_0x1ec1('0x1e')],function(_0x481683){return{'model':db[_0x481683[_0x1ec1('0x20')]],'as':_0x481683['as'],'attributes':_0x481683[_0x1ec1('0x1d')],'include':_0x481683['include']?_[_0x1ec1('0x1f')](_0x481683[_0x1ec1('0x1e')],function(_0x4901d1){return{'model':db[_0x4901d1[_0x1ec1('0x20')]],'as':_0x4901d1['as'],'attributes':_0x4901d1[_0x1ec1('0x1d')],'include':_0x4901d1[_0x1ec1('0x1e')]?_[_0x1ec1('0x1f')](_0x4901d1['include'],function(_0x2b4932){return{'model':db[_0x2b4932['model']],'as':_0x2b4932['as'],'attributes':_0x2b4932[_0x1ec1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1ec1('0x21')](function(_0x12c6b5){logger[_0x1ec1('0x15')](_0x1ec1('0x18'),_0x42d26f);logger['debug'](_0x1ec1('0x18'),_0x42d26f,JSON[_0x1ec1('0x10')](_0x12c6b5));_0x4eeb6a(_0x12c6b5);})[_0x1ec1('0x17')](function(_0x3b9cd4){logger[_0x1ec1('0x11')](_0x1ec1('0x18'),_0x3b9cd4['message'],_0x42d26f);_0x22670a(_0x221b9b[_0x1ec1('0x11')](0x1f4,_0x3b9cd4[_0x1ec1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a50eead..da36587 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 _0x6f9e=['remove','update','emit','removeListener','length','squareProject:'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x6f9e,0x6c));var _0xe6f9=function(_0x287a78,_0x349b14){_0x287a78=_0x287a78-0x0;var _0x5beae9=_0x6f9e[_0x287a78];return _0x5beae9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xe6f9('0x0'),_0xe6f9('0x1')];function createListener(_0x38f085,_0x4b9c11){return function(_0x19aa21){_0x4b9c11[_0xe6f9('0x2')](_0x38f085,_0x19aa21);};}function removeListener(_0x520880,_0x269425){return function(){SquareProjectEvents[_0xe6f9('0x3')](_0x520880,_0x269425);};}exports['register']=function(_0x432270){for(var _0x51c9f0=0x0,_0x257e86=events[_0xe6f9('0x4')];_0x51c9f0<_0x257e86;_0x51c9f0++){var _0x10dbb1=events[_0x51c9f0];var _0x574083=createListener(_0xe6f9('0x5')+_0x10dbb1,_0x432270);SquareProjectEvents['on'](_0x10dbb1,_0x574083);}}; \ No newline at end of file +var _0x27c0=['removeListener','register','length','squareProject:','update'];(function(_0x5b9942,_0x2ab158){var _0x365576=function(_0x522458){while(--_0x522458){_0x5b9942['push'](_0x5b9942['shift']());}};_0x365576(++_0x2ab158);}(_0x27c0,0x1b7));var _0x027c=function(_0x310519,_0x37253c){_0x310519=_0x310519-0x0;var _0x5a54f4=_0x27c0[_0x310519];return _0x5a54f4;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x027c('0x0')];function createListener(_0x54831c,_0x1948be){return function(_0x53cfd4){_0x1948be['emit'](_0x54831c,_0x53cfd4);};}function removeListener(_0x4fe3df,_0x4aaa17){return function(){SquareProjectEvents[_0x027c('0x1')](_0x4fe3df,_0x4aaa17);};}exports[_0x027c('0x2')]=function(_0xa03537){for(var _0x1183f8=0x0,_0x1171a7=events[_0x027c('0x3')];_0x1183f8<_0x1171a7;_0x1183f8++){var _0x3cb539=events[_0x1183f8];var _0x2682dd=createListener(_0x027c('0x4')+_0x3cb539,_0xa03537);SquareProjectEvents['on'](_0x3cb539,_0x2682dd);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index ec72713..ddd48b4 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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0xc88e83,_0x3a0644){var _0x5027b7=function(_0x4d6c7d){while(--_0x4d6c7d){_0xc88e83['push'](_0xc88e83['shift']());}};_0x5027b7(++_0x3a0644);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4b4dd0,_0x4b7586){_0x4b4dd0=_0x4b4dd0-0x0;var _0x42da25=_0x7fbe[_0x4b4dd0];return _0x42da25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x5206a3,_0x261bb3){var _0x44af0d=function(_0x4a457c){while(--_0x4a457c){_0x5206a3['push'](_0x5206a3['shift']());}};_0x44af0d(++_0x261bb3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x19e81e,_0x1b63db){_0x19e81e=_0x19e81e-0x0;var _0x49a6ac=_0x1cb9[_0x19e81e];return _0x49a6ac;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index d8efeb7..4840380 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 _0x7bae=['savePath','substring','lastIndexOf','STRING','VIRTUAL','getDataValue'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x7bae,0x13b));var _0xe7ba=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x7bae[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7ba('0x0')]},'callerid':{'type':Sequelize[_0xe7ba('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7ba('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe7ba('0x0')]},'accountcode':{'type':Sequelize[_0xe7ba('0x0')]},'dnid':{'type':Sequelize[_0xe7ba('0x0')]},'projectName':{'type':Sequelize[_0xe7ba('0x0')]},'saveName':{'type':Sequelize[_0xe7ba('0x0')]},'filename':{'type':Sequelize[_0xe7ba('0x0')]},'savePath':{'type':Sequelize[_0xe7ba('0x0')]},'format':{'type':Sequelize[_0xe7ba('0x1')],'get':function(){var _0x10b307='';var _0x34fb18=this[_0xe7ba('0x2')](_0xe7ba('0x3'));if(_0x34fb18){_0x10b307=_0x34fb18[_0xe7ba('0x4')](_0x34fb18[_0xe7ba('0x5')]('.'));}return _0x10b307;}}}; \ No newline at end of file +var _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x19ff5a,_0x59d5dd){var _0xb8c3c1=function(_0x7f925a){while(--_0x7f925a){_0x19ff5a['push'](_0x19ff5a['shift']());}};_0xb8c3c1(++_0x59d5dd);}(_0xa41a,0x6b));var _0xaa41=function(_0x3cc621,_0x2e6c1c){_0x3cc621=_0x3cc621-0x0;var _0x2a2e85=_0xa41a[_0x3cc621];return _0x2a2e85;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 46eb450..be48c3d 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 _0xde8c=['set','Content-Range','json','update','destroy','then','error','stack','name','index','SquareRecording','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xde8c,0x109));var _0xcde8=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xde8c[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0xcde8('0x0'));var rimraf=require(_0xcde8('0x1'));var zipdir=require(_0xcde8('0x2'));var jsonpatch=require(_0xcde8('0x3'));var rp=require(_0xcde8('0x4'));var moment=require(_0xcde8('0x5'));var BPromise=require(_0xcde8('0x6'));var Mustache=require('mustache');var util=require(_0xcde8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcde8('0x8'));var ejs=require(_0xcde8('0x9'));var fs=require('fs');var fs_extra=require(_0xcde8('0xa'));var _=require(_0xcde8('0xb'));var squel=require('squel');var crypto=require(_0xcde8('0xc'));var jsforce=require(_0xcde8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcde8('0x8'));var querystring=require(_0xcde8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcde8('0xf'));var qs=require(_0xcde8('0x10'));var as=require(_0xcde8('0x11'));var hardwareService=require(_0xcde8('0x12'));var logger=require(_0xcde8('0x13'))(_0xcde8('0x14'));var utils=require(_0xcde8('0x15'));var config=require(_0xcde8('0x16'));var licenseUtil=require(_0xcde8('0x17'));var db=require(_0xcde8('0x18'))['db'];function respondWithStatusCode(_0x4e1ef0,_0x4c80d3){_0x4c80d3=_0x4c80d3||0xcc;return function(_0x577e9c){if(_0x577e9c){return _0x4e1ef0[_0xcde8('0x19')](_0x4c80d3);}return _0x4e1ef0[_0xcde8('0x1a')](_0x4c80d3)[_0xcde8('0x1b')]();};}function respondWithResult(_0xb0083a,_0x2d433d){_0x2d433d=_0x2d433d||0xc8;return function(_0x1e3dfc){if(_0x1e3dfc){return _0xb0083a[_0xcde8('0x1a')](_0x2d433d)['json'](_0x1e3dfc);}};}function respondWithFilteredResult(_0xb87192,_0x51faa7){return function(_0x1c114e){if(_0x1c114e){var _0xcb071d=typeof _0x51faa7[_0xcde8('0x1c')]==='undefined'&&typeof _0x51faa7['limit']===_0xcde8('0x1d');var _0x28ae64=_0x1c114e[_0xcde8('0x1e')];var _0x55e40a=_0xcb071d?0x0:_0x51faa7[_0xcde8('0x1c')];var _0xf4caed=_0xcb071d?_0x1c114e[_0xcde8('0x1e')]:_0x51faa7[_0xcde8('0x1c')]+_0x51faa7[_0xcde8('0x1f')];var _0x2a94f9;if(_0xf4caed>=_0x28ae64){_0xf4caed=_0x28ae64;_0x2a94f9=0xc8;}else{_0x2a94f9=0xce;}_0xb87192[_0xcde8('0x1a')](_0x2a94f9);return _0xb87192[_0xcde8('0x20')](_0xcde8('0x21'),_0x55e40a+'-'+_0xf4caed+'/'+_0x28ae64)[_0xcde8('0x22')](_0x1c114e);}return null;};}function patchUpdates(_0x3932c4){return function(_0x1cb206){try{jsonpatch['apply'](_0x1cb206,_0x3932c4,!![]);}catch(_0x356001){return BPromise['reject'](_0x356001);}return _0x1cb206['save']();};}function saveUpdates(_0x58b48d,_0x2d2e9e){return function(_0xf11a73){if(_0xf11a73){return _0xf11a73[_0xcde8('0x23')](_0x58b48d)['then'](function(_0x532af3){return _0x532af3;});}return null;};}function removeEntity(_0x530931,_0x5cfd99){return function(_0x7f9d23){if(_0x7f9d23){return _0x7f9d23[_0xcde8('0x24')]()[_0xcde8('0x25')](function(){_0x530931[_0xcde8('0x1a')](0xcc)[_0xcde8('0x1b')]();});}};}function handleEntityNotFound(_0x2a82c7,_0x5e73dc){return function(_0x49fbe5){if(!_0x49fbe5){_0x2a82c7['sendStatus'](0x194);}return _0x49fbe5;};}function handleError(_0x5d5c0c,_0x34961a){_0x34961a=_0x34961a||0x1f4;return function(_0x41cb38){logger[_0xcde8('0x26')](_0x41cb38[_0xcde8('0x27')]);if(_0x41cb38['name']){delete _0x41cb38[_0xcde8('0x28')];}_0x5d5c0c[_0xcde8('0x1a')](_0x34961a)['send'](_0x41cb38);};}exports[_0xcde8('0x29')]=function(_0x16b1e9,_0x210936){var _0x15c912={},_0x178999={},_0x37cf4b={'count':0x0,'rows':[]};var _0x2b3589=_['map'](db[_0xcde8('0x2a')]['rawAttributes'],function(_0x56db6a){return{'name':_0x56db6a[_0xcde8('0x2b')],'type':_0x56db6a[_0xcde8('0x2c')][_0xcde8('0x2d')]};});_0x178999[_0xcde8('0x2e')]=_[_0xcde8('0x2f')](_0x2b3589,_0xcde8('0x28'));_0x178999['query']=_[_0xcde8('0x30')](_0x16b1e9[_0xcde8('0x31')]);_0x178999[_0xcde8('0x32')]=_[_0xcde8('0x33')](_0x178999[_0xcde8('0x2e')],_0x178999[_0xcde8('0x31')]);_0x15c912['attributes']=_['intersection'](_0x178999[_0xcde8('0x2e')],qs[_0xcde8('0x34')](_0x16b1e9['query'][_0xcde8('0x34')]));_0x15c912['attributes']=_0x15c912[_0xcde8('0x35')]['length']?_0x15c912[_0xcde8('0x35')]:_0x178999[_0xcde8('0x2e')];if(!_0x16b1e9[_0xcde8('0x31')][_0xcde8('0x36')](_0xcde8('0x37'))){_0x15c912[_0xcde8('0x1f')]=qs['limit'](_0x16b1e9['query'][_0xcde8('0x1f')]);_0x15c912['offset']=qs[_0xcde8('0x1c')](_0x16b1e9[_0xcde8('0x31')]['offset']);}_0x15c912[_0xcde8('0x38')]=qs[_0xcde8('0x39')](_0x16b1e9[_0xcde8('0x31')][_0xcde8('0x39')]);_0x15c912[_0xcde8('0x3a')]=qs[_0xcde8('0x32')](_[_0xcde8('0x3b')](_0x16b1e9[_0xcde8('0x31')],_0x178999[_0xcde8('0x32')]),_0x2b3589);if(_0x16b1e9['query'][_0xcde8('0x3c')]){_0x15c912['where']=_[_0xcde8('0x3d')](_0x15c912[_0xcde8('0x3a')],{'$or':_[_0xcde8('0x2f')](_0x2b3589,function(_0x2e4c1a){if(_0x2e4c1a[_0xcde8('0x2c')]!==_0xcde8('0x3e')){var _0x17bec7={};_0x17bec7[_0x2e4c1a['name']]={'$like':'%'+_0x16b1e9[_0xcde8('0x31')][_0xcde8('0x3c')]+'%'};return _0x17bec7;}})});}_0x15c912=_[_0xcde8('0x3d')]({},_0x15c912,_0x16b1e9['options']);var _0x35c65b={'where':_0x15c912[_0xcde8('0x3a')]};return db[_0xcde8('0x2a')]['count'](_0x35c65b)[_0xcde8('0x25')](function(_0x14d0ef){_0x37cf4b['count']=_0x14d0ef;if(_0x16b1e9[_0xcde8('0x31')][_0xcde8('0x3f')]){_0x15c912['include']=[{'all':!![]}];}return db[_0xcde8('0x2a')][_0xcde8('0x40')](_0x15c912);})[_0xcde8('0x25')](function(_0x419316){_0x37cf4b[_0xcde8('0x41')]=_0x419316;return _0x37cf4b;})['then'](respondWithFilteredResult(_0x210936,_0x15c912))[_0xcde8('0x42')](handleError(_0x210936,null));};exports[_0xcde8('0x43')]=function(_0x1334aa,_0x528c1c){var _0x25aee5={'raw':!![],'where':{'id':_0x1334aa[_0xcde8('0x44')]['id']}},_0x2c8005={};_0x2c8005['model']=_[_0xcde8('0x30')](db[_0xcde8('0x2a')][_0xcde8('0x45')]);_0x2c8005[_0xcde8('0x31')]=_[_0xcde8('0x30')](_0x1334aa[_0xcde8('0x31')]);_0x2c8005[_0xcde8('0x32')]=_['intersection'](_0x2c8005['model'],_0x2c8005[_0xcde8('0x31')]);_0x25aee5[_0xcde8('0x35')]=_[_0xcde8('0x33')](_0x2c8005[_0xcde8('0x2e')],qs[_0xcde8('0x34')](_0x1334aa[_0xcde8('0x31')]['fields']));_0x25aee5[_0xcde8('0x35')]=_0x25aee5[_0xcde8('0x35')][_0xcde8('0x46')]?_0x25aee5[_0xcde8('0x35')]:_0x2c8005[_0xcde8('0x2e')];if(_0x1334aa[_0xcde8('0x31')][_0xcde8('0x3f')]){_0x25aee5[_0xcde8('0x47')]=[{'all':!![]}];}_0x25aee5=_['merge']({},_0x25aee5,_0x1334aa['options']);return db[_0xcde8('0x2a')][_0xcde8('0x48')](_0x25aee5)[_0xcde8('0x25')](handleEntityNotFound(_0x528c1c,null))['then'](respondWithResult(_0x528c1c,null))[_0xcde8('0x42')](handleError(_0x528c1c,null));};exports[_0xcde8('0x49')]=function(_0x255715,_0x4fc7ec){return db[_0xcde8('0x2a')][_0xcde8('0x49')](_0x255715[_0xcde8('0x4a')],{})[_0xcde8('0x25')](respondWithResult(_0x4fc7ec,0xc9))['catch'](handleError(_0x4fc7ec,null));};exports['update']=function(_0x508e54,_0x1392ee){if(_0x508e54[_0xcde8('0x4a')]['id']){delete _0x508e54[_0xcde8('0x4a')]['id'];}return db[_0xcde8('0x2a')][_0xcde8('0x48')]({'where':{'id':_0x508e54[_0xcde8('0x44')]['id']}})[_0xcde8('0x25')](handleEntityNotFound(_0x1392ee,null))[_0xcde8('0x25')](saveUpdates(_0x508e54[_0xcde8('0x4a')],null))[_0xcde8('0x25')](respondWithResult(_0x1392ee,null))[_0xcde8('0x42')](handleError(_0x1392ee,null));};exports[_0xcde8('0x4b')]=function(_0x2551c5,_0x1814c2,_0x41a417){var _0x397626=require(_0xcde8('0x4c'));var _0x34b3c3=![];var _0x478385={};if(_0x2551c5[_0xcde8('0x31')][_0xcde8('0x2c')]&&_0x2551c5[_0xcde8('0x31')][_0xcde8('0x2c')]===_0xcde8('0x4d')){_0x478385['uniqueid']=_0x2551c5[_0xcde8('0x44')]['id'];}else{_0x478385['id']=_0x2551c5[_0xcde8('0x44')]['id'];}return db[_0xcde8('0x2a')][_0xcde8('0x48')]({'where':_0x478385,'attributes':['id',_0xcde8('0x4e'),_0xcde8('0x4f')],'raw':!![]})[_0xcde8('0x25')](handleEntityNotFound(_0x1814c2,null))[_0xcde8('0x25')](function(_0x4204ba){if(_0x4204ba){var _0xdbee83=_0x4204ba['savePath'];var _0x258993=util['format']('%s.cypher',_0xdbee83);if(fs[_0xcde8('0x50')](_0x258993)){_0x34b3c3=!![];return _0x397626[_0xcde8('0x51')](_0x258993,_0xdbee83,config[_0xcde8('0x52')]['recording'])[_0xcde8('0x25')](function(){return _0x4204ba;});}return _0x4204ba;}})['then'](function(_0x1ca471){if(_0x1ca471){var _0x4b452a=_0x1ca471[_0xcde8('0x4e')];if(!fs[_0xcde8('0x50')](_0x4b452a)){throw new db[(_0xcde8('0x53'))][(_0xcde8('0x54'))]('SquareRecording\x20not\x20found');}if(_0x1ca471['filename']){return _0x1814c2[_0xcde8('0x4b')](_0x4b452a,_0x1ca471[_0xcde8('0x4f')]+path[_0xcde8('0x55')](_0x4b452a),function(){if(_0x34b3c3){fs[_0xcde8('0x56')](_0x4b452a);}});}else{return _0x1814c2[_0xcde8('0x4b')](_0x4b452a,function(_0x2a107e){if(_0x34b3c3){fs['unlink'](_0x4b452a);}});}}})['catch'](function(_0x25ce1d){if(_0x25ce1d[_0xcde8('0x57')]===_0xcde8('0x58')){_0x1814c2[_0xcde8('0x1a')](0x194)[_0xcde8('0x59')](_0xcde8('0x5a'));}else{return handleError(_0x1814c2,null);}});};exports[_0xcde8('0x24')]=function(_0x11c8c8,_0x565ea1){return db['SquareRecording'][_0xcde8('0x48')]({'where':{'id':_0x11c8c8[_0xcde8('0x44')]['id']}})[_0xcde8('0x25')](function(_0xc8bf18){if(_['isNil'](_0xc8bf18)){throw new ReferenceError(_0xcde8('0x5b'));}return _0xc8bf18;})[_0xcde8('0x25')](function(_0x2f0203){var _0x598c9c=_0x2f0203['savePath'];logger[_0xcde8('0x5c')](_0xcde8('0x5d'),_0x598c9c);if(!_[_0xcde8('0x5e')](_0x2f0203['savePath'])&&fs[_0xcde8('0x50')](_0x598c9c)){logger[_0xcde8('0x5c')]('File:\x20\x22'+_0x598c9c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x598c9c);}_0x598c9c=_0x598c9c+_0xcde8('0x5f');if(!_['isNil'](_0x2f0203[_0xcde8('0x4e')])&&fs['existsSync'](_0x598c9c)){logger[_0xcde8('0x5c')](_0xcde8('0x60')+_0x598c9c+_0xcde8('0x61'));fs[_0xcde8('0x62')](_0x598c9c);}return _0x2f0203;})[_0xcde8('0x25')](function(_0x36a7d0){if(!_0x36a7d0)throw new InternalError();return _0x36a7d0[_0xcde8('0x24')]();})['then'](function(){_0x565ea1[_0xcde8('0x1a')](0xcc)['end']();})[_0xcde8('0x42')](handleError(_0x565ea1,null));}; \ No newline at end of file +var _0x9609=['body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','recording','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','params','length','options','find','catch','create'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9609,0x121));var _0x9960=function(_0x427181,_0x52e95c){_0x427181=_0x427181-0x0;var _0x12b50d=_0x9609[_0x427181];return _0x12b50d;};'use strict';var emlformat=require(_0x9960('0x0'));var rimraf=require(_0x9960('0x1'));var zipdir=require(_0x9960('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9960('0x3'));var moment=require(_0x9960('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9960('0x5'));var util=require(_0x9960('0x6'));var path=require(_0x9960('0x7'));var sox=require(_0x9960('0x8'));var csv=require(_0x9960('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9960('0xa'));var squel=require(_0x9960('0xb'));var crypto=require(_0x9960('0xc'));var jsforce=require(_0x9960('0xd'));var deskjs=require(_0x9960('0xe'));var toCsv=require(_0x9960('0x9'));var querystring=require(_0x9960('0xf'));var Papa=require('papaparse');var Redis=require(_0x9960('0x10'));var authService=require(_0x9960('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9960('0x12'));var hardwareService=require(_0x9960('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9960('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9960('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26a488,_0x23fe20){_0x23fe20=_0x23fe20||0xcc;return function(_0x2d064e){if(_0x2d064e){return _0x26a488[_0x9960('0x16')](_0x23fe20);}return _0x26a488[_0x9960('0x17')](_0x23fe20)[_0x9960('0x18')]();};}function respondWithResult(_0x24791b,_0x2f7086){_0x2f7086=_0x2f7086||0xc8;return function(_0x3b9985){if(_0x3b9985){return _0x24791b[_0x9960('0x17')](_0x2f7086)[_0x9960('0x19')](_0x3b9985);}};}function respondWithFilteredResult(_0x3efbb0,_0x344ef1){return function(_0x11cace){if(_0x11cace){var _0x474419=typeof _0x344ef1[_0x9960('0x1a')]===_0x9960('0x1b')&&typeof _0x344ef1[_0x9960('0x1c')]==='undefined';var _0x5173e9=_0x11cace['count'];var _0x22f72d=_0x474419?0x0:_0x344ef1[_0x9960('0x1a')];var _0x2509d5=_0x474419?_0x11cace[_0x9960('0x1d')]:_0x344ef1[_0x9960('0x1a')]+_0x344ef1[_0x9960('0x1c')];var _0x375f62;if(_0x2509d5>=_0x5173e9){_0x2509d5=_0x5173e9;_0x375f62=0xc8;}else{_0x375f62=0xce;}_0x3efbb0[_0x9960('0x17')](_0x375f62);return _0x3efbb0['set'](_0x9960('0x1e'),_0x22f72d+'-'+_0x2509d5+'/'+_0x5173e9)[_0x9960('0x19')](_0x11cace);}return null;};}function patchUpdates(_0x361e23){return function(_0x1163df){try{jsonpatch[_0x9960('0x1f')](_0x1163df,_0x361e23,!![]);}catch(_0x4516cd){return BPromise['reject'](_0x4516cd);}return _0x1163df[_0x9960('0x20')]();};}function saveUpdates(_0x4f4a5b,_0x5284b5){return function(_0x436fc4){if(_0x436fc4){return _0x436fc4[_0x9960('0x21')](_0x4f4a5b)[_0x9960('0x22')](function(_0x472058){return _0x472058;});}return null;};}function removeEntity(_0x557593,_0x272e6f){return function(_0x161e46){if(_0x161e46){return _0x161e46[_0x9960('0x23')]()[_0x9960('0x22')](function(){_0x557593[_0x9960('0x17')](0xcc)[_0x9960('0x18')]();});}};}function handleEntityNotFound(_0x101ba4,_0x49d19e){return function(_0x3c2e91){if(!_0x3c2e91){_0x101ba4['sendStatus'](0x194);}return _0x3c2e91;};}function handleError(_0x2da9f7,_0x3d2986){_0x3d2986=_0x3d2986||0x1f4;return function(_0x5cac15){logger['error'](_0x5cac15[_0x9960('0x24')]);if(_0x5cac15[_0x9960('0x25')]){delete _0x5cac15[_0x9960('0x25')];}_0x2da9f7[_0x9960('0x17')](_0x3d2986)['send'](_0x5cac15);};}exports[_0x9960('0x26')]=function(_0xf373e3,_0x508725){var _0x3fa556={},_0x33f248={},_0x36f50d={'count':0x0,'rows':[]};var _0x314a06=_[_0x9960('0x27')](db[_0x9960('0x28')][_0x9960('0x29')],function(_0x3898fb){return{'name':_0x3898fb['fieldName'],'type':_0x3898fb[_0x9960('0x2a')][_0x9960('0x2b')]};});_0x33f248[_0x9960('0x2c')]=_[_0x9960('0x27')](_0x314a06,_0x9960('0x25'));_0x33f248[_0x9960('0x2d')]=_[_0x9960('0x2e')](_0xf373e3[_0x9960('0x2d')]);_0x33f248[_0x9960('0x2f')]=_[_0x9960('0x30')](_0x33f248['model'],_0x33f248[_0x9960('0x2d')]);_0x3fa556['attributes']=_[_0x9960('0x30')](_0x33f248['model'],qs[_0x9960('0x31')](_0xf373e3[_0x9960('0x2d')][_0x9960('0x31')]));_0x3fa556[_0x9960('0x32')]=_0x3fa556[_0x9960('0x32')]['length']?_0x3fa556[_0x9960('0x32')]:_0x33f248[_0x9960('0x2c')];if(!_0xf373e3[_0x9960('0x2d')]['hasOwnProperty'](_0x9960('0x33'))){_0x3fa556['limit']=qs[_0x9960('0x1c')](_0xf373e3[_0x9960('0x2d')][_0x9960('0x1c')]);_0x3fa556['offset']=qs[_0x9960('0x1a')](_0xf373e3['query'][_0x9960('0x1a')]);}_0x3fa556[_0x9960('0x34')]=qs['sort'](_0xf373e3[_0x9960('0x2d')]['sort']);_0x3fa556[_0x9960('0x35')]=qs['filters'](_[_0x9960('0x36')](_0xf373e3[_0x9960('0x2d')],_0x33f248['filters']),_0x314a06);if(_0xf373e3[_0x9960('0x2d')][_0x9960('0x37')]){_0x3fa556[_0x9960('0x35')]=_['merge'](_0x3fa556[_0x9960('0x35')],{'$or':_[_0x9960('0x27')](_0x314a06,function(_0x3fdfc8){if(_0x3fdfc8['type']!==_0x9960('0x38')){var _0x499b33={};_0x499b33[_0x3fdfc8[_0x9960('0x25')]]={'$like':'%'+_0xf373e3['query'][_0x9960('0x37')]+'%'};return _0x499b33;}})});}_0x3fa556=_[_0x9960('0x39')]({},_0x3fa556,_0xf373e3['options']);var _0x32cfaa={'where':_0x3fa556[_0x9960('0x35')]};return db['SquareRecording'][_0x9960('0x1d')](_0x32cfaa)['then'](function(_0x37a26e){_0x36f50d[_0x9960('0x1d')]=_0x37a26e;if(_0xf373e3[_0x9960('0x2d')][_0x9960('0x3a')]){_0x3fa556[_0x9960('0x3b')]=[{'all':!![]}];}return db[_0x9960('0x28')]['findAll'](_0x3fa556);})['then'](function(_0x2966c7){_0x36f50d[_0x9960('0x3c')]=_0x2966c7;return _0x36f50d;})['then'](respondWithFilteredResult(_0x508725,_0x3fa556))['catch'](handleError(_0x508725,null));};exports['show']=function(_0xc9a18c,_0x1fc930){var _0x54ae96={'raw':!![],'where':{'id':_0xc9a18c[_0x9960('0x3d')]['id']}},_0x54c447={};_0x54c447[_0x9960('0x2c')]=_[_0x9960('0x2e')](db[_0x9960('0x28')]['rawAttributes']);_0x54c447['query']=_['keys'](_0xc9a18c[_0x9960('0x2d')]);_0x54c447[_0x9960('0x2f')]=_[_0x9960('0x30')](_0x54c447['model'],_0x54c447[_0x9960('0x2d')]);_0x54ae96[_0x9960('0x32')]=_[_0x9960('0x30')](_0x54c447['model'],qs['fields'](_0xc9a18c[_0x9960('0x2d')][_0x9960('0x31')]));_0x54ae96['attributes']=_0x54ae96[_0x9960('0x32')][_0x9960('0x3e')]?_0x54ae96[_0x9960('0x32')]:_0x54c447['model'];if(_0xc9a18c[_0x9960('0x2d')][_0x9960('0x3a')]){_0x54ae96[_0x9960('0x3b')]=[{'all':!![]}];}_0x54ae96=_[_0x9960('0x39')]({},_0x54ae96,_0xc9a18c[_0x9960('0x3f')]);return db[_0x9960('0x28')][_0x9960('0x40')](_0x54ae96)[_0x9960('0x22')](handleEntityNotFound(_0x1fc930,null))[_0x9960('0x22')](respondWithResult(_0x1fc930,null))[_0x9960('0x41')](handleError(_0x1fc930,null));};exports['create']=function(_0x5c2f5d,_0x1f3b58){return db[_0x9960('0x28')][_0x9960('0x42')](_0x5c2f5d[_0x9960('0x43')],{})[_0x9960('0x22')](respondWithResult(_0x1f3b58,0xc9))[_0x9960('0x41')](handleError(_0x1f3b58,null));};exports[_0x9960('0x21')]=function(_0x60e24e,_0x584bbf){if(_0x60e24e['body']['id']){delete _0x60e24e['body']['id'];}return db[_0x9960('0x28')]['find']({'where':{'id':_0x60e24e[_0x9960('0x3d')]['id']}})[_0x9960('0x22')](handleEntityNotFound(_0x584bbf,null))[_0x9960('0x22')](saveUpdates(_0x60e24e['body'],null))[_0x9960('0x22')](respondWithResult(_0x584bbf,null))['catch'](handleError(_0x584bbf,null));};exports[_0x9960('0x44')]=function(_0x98a2f3,_0x3091df,_0x5395c3){var _0x189f46=require(_0x9960('0x45'));var _0x3e59b6=![];var _0x57e003={};if(_0x98a2f3['query'][_0x9960('0x2a')]&&_0x98a2f3[_0x9960('0x2d')][_0x9960('0x2a')]==='uniqueid'){_0x57e003[_0x9960('0x46')]=_0x98a2f3[_0x9960('0x3d')]['id'];}else{_0x57e003['id']=_0x98a2f3[_0x9960('0x3d')]['id'];}return db[_0x9960('0x28')][_0x9960('0x40')]({'where':_0x57e003,'attributes':['id','savePath','filename'],'raw':!![]})[_0x9960('0x22')](handleEntityNotFound(_0x3091df,null))[_0x9960('0x22')](function(_0x3a492f){if(_0x3a492f){var _0x255ed5=_0x3a492f[_0x9960('0x47')];var _0x484c05=util['format'](_0x9960('0x48'),_0x255ed5);if(fs[_0x9960('0x49')](_0x484c05)){_0x3e59b6=!![];return _0x189f46['decryptFile'](_0x484c05,_0x255ed5,config['secrets'][_0x9960('0x4a')])[_0x9960('0x22')](function(){return _0x3a492f;});}return _0x3a492f;}})[_0x9960('0x22')](function(_0x11716e){if(_0x11716e){var _0xe8d50e=_0x11716e['savePath'];if(!fs[_0x9960('0x49')](_0xe8d50e)){throw new db['Sequelize'][(_0x9960('0x4b'))](_0x9960('0x4c'));}if(_0x11716e[_0x9960('0x4d')]){return _0x3091df['download'](_0xe8d50e,_0x11716e['filename']+path[_0x9960('0x4e')](_0xe8d50e),function(){if(_0x3e59b6){fs['unlink'](_0xe8d50e);}});}else{return _0x3091df['download'](_0xe8d50e,function(_0x5d61d1){if(_0x3e59b6){fs[_0x9960('0x4f')](_0xe8d50e);}});}}})['catch'](function(_0x55a9f2){if(_0x55a9f2['message']===_0x9960('0x4c')){_0x3091df[_0x9960('0x17')](0x194)[_0x9960('0x50')](_0x9960('0x51'));}else{return handleError(_0x3091df,null);}});};exports['destroy']=function(_0x1952d9,_0x8fa6e8){return db[_0x9960('0x28')][_0x9960('0x40')]({'where':{'id':_0x1952d9[_0x9960('0x3d')]['id']}})[_0x9960('0x22')](function(_0x462ab2){if(_[_0x9960('0x52')](_0x462ab2)){throw new ReferenceError('Entity\x20not\x20found');}return _0x462ab2;})[_0x9960('0x22')](function(_0xa96971){var _0x190059=_0xa96971[_0x9960('0x47')];logger[_0x9960('0x53')](_0x9960('0x54'),_0x190059);if(!_[_0x9960('0x52')](_0xa96971[_0x9960('0x47')])&&fs[_0x9960('0x49')](_0x190059)){logger['info'](_0x9960('0x55')+_0x190059+_0x9960('0x56'));fs[_0x9960('0x57')](_0x190059);}_0x190059=_0x190059+_0x9960('0x58');if(!_['isNil'](_0xa96971[_0x9960('0x47')])&&fs[_0x9960('0x49')](_0x190059)){logger[_0x9960('0x53')](_0x9960('0x55')+_0x190059+_0x9960('0x56'));fs[_0x9960('0x57')](_0x190059);}return _0xa96971;})[_0x9960('0x22')](function(_0x53b231){if(!_0x53b231)throw new InternalError();return _0x53b231[_0x9960('0x23')]();})[_0x9960('0x22')](function(){_0x8fa6e8[_0x9960('0x17')](0xcc)[_0x9960('0x18')]();})[_0x9960('0x41')](handleError(_0x8fa6e8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 98d5cc4..0d0bbcf 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 _0x4975=['./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39220f,_0x17f28b){var _0x54a8f2=function(_0x285646){while(--_0x285646){_0x39220f['push'](_0x39220f['shift']());}};_0x54a8f2(++_0x17f28b);}(_0x4975,0x86));var _0x5497=function(_0xaa1996,_0x625e1b){_0xaa1996=_0xaa1996-0x0;var _0x36d651=_0x4975[_0xaa1996];return _0x36d651;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b0d=['define','SquareRecording','square_recordings','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xdc1dee,_0x281537){var _0x4ee918=function(_0x1638ef){while(--_0x1638ef){_0xdc1dee['push'](_0xdc1dee['shift']());}};_0x4ee918(++_0x281537);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x5854ce,_0xfabf66){_0x5854ce=_0x5854ce-0x0;var _0x484824=_0x9b0d[_0x5854ce];return _0x484824;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var fs=require('fs');var path=require(_0xd9b0('0x5'));var rimraf=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var attributes=require('./squareRecording.attributes');module[_0xd9b0('0x8')]=function(_0x21798d,_0x41dad9){return _0x21798d[_0xd9b0('0x9')](_0xd9b0('0xa'),attributes,{'tableName':_0xd9b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6e4931b..d5c6715 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 _0x47c5=['error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x47c5,0x14a));var _0x547c=function(_0x2340a2,_0x47b63f){_0x2340a2=_0x2340a2-0x0;var _0x2cbb0b=_0x47c5[_0x2340a2];return _0x2cbb0b;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x547c('0x3'));var db=require(_0x547c('0x4'))['db'];var utils=require(_0x547c('0x5'));var logger=require(_0x547c('0x6'))(_0x547c('0x7'));var config=require(_0x547c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x547c('0x9')][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dccce,_0x6c13b0,_0x5c622b){return new BPromise(function(_0x4f1232,_0x89b33c){return client[_0x547c('0xb')](_0x5dccce,_0x5c622b)[_0x547c('0xc')](function(_0x36899){logger[_0x547c('0xd')](_0x547c('0xe'),_0x6c13b0,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x6c13b0,'request\x20sent',JSON['stringify'](_0x36899));if(_0x36899['error']){if(_0x36899['error']['code']===0x1f4){logger['error'](_0x547c('0xe'),_0x6c13b0,_0x36899[_0x547c('0x12')]['message']);return _0x89b33c(_0x36899[_0x547c('0x12')][_0x547c('0x13')]);}logger['error'](_0x547c('0xe'),_0x6c13b0,_0x36899[_0x547c('0x12')]['message']);return _0x4f1232(_0x36899['error'][_0x547c('0x13')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x6c13b0,_0x547c('0xf'));_0x4f1232(_0x36899[_0x547c('0x14')][_0x547c('0x13')]);}})[_0x547c('0x15')](function(_0x43b7d2){logger['error'](_0x547c('0xe'),_0x6c13b0,_0x43b7d2);_0x89b33c(_0x43b7d2);});});}exports[_0x547c('0x16')]=function(_0x4f74f7){var _0xcb3dfb=this;return new Promise(function(_0x21a5cf,_0x110144){return db[_0x547c('0x17')][_0x547c('0x18')](_0x4f74f7[_0x547c('0x19')],{'raw':_0x4f74f7[_0x547c('0x1a')]?_0x4f74f7[_0x547c('0x1a')][_0x547c('0x1b')]===undefined?!![]:![]:!![]})[_0x547c('0xc')](function(_0x45f119){logger['info'](_0x547c('0x16'),_0x4f74f7);logger[_0x547c('0x10')](_0x547c('0x16'),_0x4f74f7,JSON[_0x547c('0x1c')](_0x45f119));_0x21a5cf(_0x45f119);})['catch'](function(_0x5b875a){logger['error'](_0x547c('0x16'),_0x5b875a[_0x547c('0x13')],_0x4f74f7);_0x110144(_0xcb3dfb[_0x547c('0x12')](0x1f4,_0x5b875a['message']));});});}; \ No newline at end of file +var _0x73ea=['options','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x73ea,0x124));var _0xa73e=function(_0x575bca,_0x2d1b1f){_0x575bca=_0x575bca-0x0;var _0x6a0bd=_0x73ea[_0x575bca];return _0x6a0bd;};'use strict';var _=require(_0xa73e('0x0'));var util=require(_0xa73e('0x1'));var moment=require(_0xa73e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa73e('0x3'));var fs=require('fs');var Redis=require(_0xa73e('0x4'));var db=require(_0xa73e('0x5'))['db'];var utils=require(_0xa73e('0x6'));var logger=require(_0xa73e('0x7'))(_0xa73e('0x8'));var config=require(_0xa73e('0x9'));var jayson=require(_0xa73e('0xa'));var client=jayson[_0xa73e('0xb')][_0xa73e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa67711,_0x31a8b9,_0x30140b){return new BPromise(function(_0x5d7990,_0x1f5478){return client[_0xa73e('0xd')](_0xa67711,_0x30140b)['then'](function(_0x1e6985){logger[_0xa73e('0xe')](_0xa73e('0xf'),_0x31a8b9,_0xa73e('0x10'));logger['debug'](_0xa73e('0x11'),_0x31a8b9,'request\x20sent',JSON[_0xa73e('0x12')](_0x1e6985));if(_0x1e6985['error']){if(_0x1e6985[_0xa73e('0x13')][_0xa73e('0x14')]===0x1f4){logger[_0xa73e('0x13')](_0xa73e('0xf'),_0x31a8b9,_0x1e6985[_0xa73e('0x13')][_0xa73e('0x15')]);return _0x1f5478(_0x1e6985[_0xa73e('0x13')][_0xa73e('0x15')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x31a8b9,_0x1e6985[_0xa73e('0x13')][_0xa73e('0x15')]);return _0x5d7990(_0x1e6985[_0xa73e('0x13')][_0xa73e('0x15')]);}else{logger[_0xa73e('0xe')](_0xa73e('0xf'),_0x31a8b9,_0xa73e('0x10'));_0x5d7990(_0x1e6985[_0xa73e('0x16')][_0xa73e('0x15')]);}})[_0xa73e('0x17')](function(_0x4702bc){logger[_0xa73e('0x13')](_0xa73e('0xf'),_0x31a8b9,_0x4702bc);_0x1f5478(_0x4702bc);});});}exports[_0xa73e('0x18')]=function(_0x208e15){var _0x17118c=this;return new Promise(function(_0x748002,_0x2f7e1a){return db[_0xa73e('0x19')]['create'](_0x208e15[_0xa73e('0x1a')],{'raw':_0x208e15['options']?_0x208e15[_0xa73e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa73e('0x1c')](function(_0xbc7f27){logger[_0xa73e('0xe')](_0xa73e('0x18'),_0x208e15);logger['debug'](_0xa73e('0x18'),_0x208e15,JSON[_0xa73e('0x12')](_0xbc7f27));_0x748002(_0xbc7f27);})[_0xa73e('0x17')](function(_0xc9c57e){logger[_0xa73e('0x13')](_0xa73e('0x18'),_0xc9c57e[_0xa73e('0x15')],_0x208e15);_0x2f7e1a(_0x17118c['error'](0x1f4,_0xc9c57e[_0xa73e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index bf6febe..99d2c10 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(_0x2c3bab,_0x3d8913){var _0x2b33f9=function(_0x374e81){while(--_0x374e81){_0x2c3bab['push'](_0x2c3bab['shift']());}};_0x2b33f9(++_0x3d8913);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1a7449,_0x150434){var _0x23a34c=function(_0x139d83){while(--_0x139d83){_0x1a7449['push'](_0x1a7449['shift']());}};_0x23a34c(++_0x150434);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d8b1d,_0x1c0f88){_0x3d8b1d=_0x3d8b1d-0x0;var _0x2bb57a=_0xb10b[_0x3d8b1d];return _0x2bb57a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 170dc77..f402e5c 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 _0xef1c=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x30d4d2,_0xc1e813){var _0x5155b9=function(_0xcca68c){while(--_0xcca68c){_0x30d4d2['push'](_0x30d4d2['shift']());}};_0x5155b9(++_0xc1e813);}(_0xef1c,0x9f));var _0xcef1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcef1('0x0'));module[_0xcef1('0x1')]={'network':{'type':Sequelize[_0xcef1('0x2')]},'network_script':{'type':Sequelize[_0xcef1('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcef1('0x2')]},'language':{'type':Sequelize[_0xcef1('0x2')]},'type':{'type':Sequelize[_0xcef1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xcef1('0x2')]},'callerid':{'type':Sequelize[_0xcef1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xcef1('0x2')]},'callington':{'type':Sequelize[_0xcef1('0x2')]},'callingtns':{'type':Sequelize[_0xcef1('0x2')]},'dnid':{'type':Sequelize[_0xcef1('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcef1('0x2')]},'extension':{'type':Sequelize[_0xcef1('0x2')]},'priority':{'type':Sequelize[_0xcef1('0x2')]},'enhanced':{'type':Sequelize[_0xcef1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xcef1('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcef1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xcef1('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xd79e=['DATE','sequelize','exports','STRING'];(function(_0x2a882d,_0x56b033){var _0xe03db=function(_0x45b0a3){while(--_0x45b0a3){_0x2a882d['push'](_0x2a882d['shift']());}};_0xe03db(++_0x56b033);}(_0xd79e,0x1a5));var _0xed79=function(_0x444e1c,_0x1aadb2){_0x444e1c=_0x444e1c-0x0;var _0x5a8b5d=_0xd79e[_0x444e1c];return _0x5a8b5d;};'use strict';var Sequelize=require(_0xed79('0x0'));module[_0xed79('0x1')]={'network':{'type':Sequelize[_0xed79('0x2')]},'network_script':{'type':Sequelize[_0xed79('0x2')]},'request':{'type':Sequelize[_0xed79('0x2')]},'channel':{'type':Sequelize[_0xed79('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xed79('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xed79('0x2')]},'callerid':{'type':Sequelize[_0xed79('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xed79('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xed79('0x2')]},'context':{'type':Sequelize[_0xed79('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xed79('0x2')]},'enhanced':{'type':Sequelize[_0xed79('0x2')]},'accountcode':{'type':Sequelize[_0xed79('0x2')]},'threadid':{'type':Sequelize[_0xed79('0x2')]},'project_name':{'type':Sequelize[_0xed79('0x2')]},'joinAt':{'type':Sequelize[_0xed79('0x3')]},'leaveAt':{'type':Sequelize[_0xed79('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 70e826f..8dd33b6 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 _0x2dbc=['status','json','undefined','count','offset','set','reject','save','update','destroy','then','end','error','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','length','find','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x4e2843,_0x165222){var _0xe363c7=function(_0x3e8b9c){while(--_0x3e8b9c){_0x4e2843['push'](_0x4e2843['shift']());}};_0xe363c7(++_0x165222);}(_0x2dbc,0x106));var _0xc2db=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x2dbc[_0x3d4876];return _0x58ca9d;};'use strict';var emlformat=require(_0xc2db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2db('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2db('0x2'));var moment=require(_0xc2db('0x3'));var BPromise=require(_0xc2db('0x4'));var Mustache=require('mustache');var util=require(_0xc2db('0x5'));var path=require(_0xc2db('0x6'));var sox=require('sox');var csv=require(_0xc2db('0x7'));var ejs=require(_0xc2db('0x8'));var fs=require('fs');var fs_extra=require(_0xc2db('0x9'));var _=require(_0xc2db('0xa'));var squel=require(_0xc2db('0xb'));var crypto=require(_0xc2db('0xc'));var jsforce=require(_0xc2db('0xd'));var deskjs=require(_0xc2db('0xe'));var toCsv=require(_0xc2db('0x7'));var querystring=require(_0xc2db('0xf'));var Papa=require(_0xc2db('0x10'));var Redis=require(_0xc2db('0x11'));var authService=require(_0xc2db('0x12'));var qs=require(_0xc2db('0x13'));var as=require(_0xc2db('0x14'));var hardwareService=require(_0xc2db('0x15'));var logger=require('../../config/logger')(_0xc2db('0x16'));var utils=require(_0xc2db('0x17'));var config=require(_0xc2db('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x257760,_0x3c7255){_0x3c7255=_0x3c7255||0xcc;return function(_0x138e65){if(_0x138e65){return _0x257760[_0xc2db('0x19')](_0x3c7255);}return _0x257760[_0xc2db('0x1a')](_0x3c7255)['end']();};}function respondWithResult(_0x415404,_0x413590){_0x413590=_0x413590||0xc8;return function(_0x51bc0a){if(_0x51bc0a){return _0x415404['status'](_0x413590)[_0xc2db('0x1b')](_0x51bc0a);}};}function respondWithFilteredResult(_0x30e429,_0x46a14a){return function(_0x371a56){if(_0x371a56){var _0x2abf30=typeof _0x46a14a['offset']===_0xc2db('0x1c')&&typeof _0x46a14a['limit']===_0xc2db('0x1c');var _0xa82bb6=_0x371a56[_0xc2db('0x1d')];var _0x5f1c21=_0x2abf30?0x0:_0x46a14a[_0xc2db('0x1e')];var _0x4bc110=_0x2abf30?_0x371a56[_0xc2db('0x1d')]:_0x46a14a['offset']+_0x46a14a['limit'];var _0x55ec92;if(_0x4bc110>=_0xa82bb6){_0x4bc110=_0xa82bb6;_0x55ec92=0xc8;}else{_0x55ec92=0xce;}_0x30e429[_0xc2db('0x1a')](_0x55ec92);return _0x30e429[_0xc2db('0x1f')]('Content-Range',_0x5f1c21+'-'+_0x4bc110+'/'+_0xa82bb6)['json'](_0x371a56);}return null;};}function patchUpdates(_0x228374){return function(_0x46e23d){try{jsonpatch['apply'](_0x46e23d,_0x228374,!![]);}catch(_0x1cf0fd){return BPromise[_0xc2db('0x20')](_0x1cf0fd);}return _0x46e23d[_0xc2db('0x21')]();};}function saveUpdates(_0xc7e757,_0x11c411){return function(_0x51da9a){if(_0x51da9a){return _0x51da9a[_0xc2db('0x22')](_0xc7e757)['then'](function(_0x1f610b){return _0x1f610b;});}return null;};}function removeEntity(_0x5c2bb8,_0x1457e2){return function(_0x400ec9){if(_0x400ec9){return _0x400ec9[_0xc2db('0x23')]()[_0xc2db('0x24')](function(){_0x5c2bb8[_0xc2db('0x1a')](0xcc)[_0xc2db('0x25')]();});}};}function handleEntityNotFound(_0x29b5f4,_0x2631b0){return function(_0xad5bf4){if(!_0xad5bf4){_0x29b5f4[_0xc2db('0x19')](0x194);}return _0xad5bf4;};}function handleError(_0x20c9a4,_0xb86637){_0xb86637=_0xb86637||0x1f4;return function(_0x1b8510){logger[_0xc2db('0x26')](_0x1b8510['stack']);if(_0x1b8510['name']){delete _0x1b8510[_0xc2db('0x27')];}_0x20c9a4['status'](_0xb86637)[_0xc2db('0x28')](_0x1b8510);};}exports['index']=function(_0x5728a1,_0x445c03){var _0x1f4364={},_0x21d5aa={},_0x1d1b46={'count':0x0,'rows':[]};var _0x43e432=_[_0xc2db('0x29')](db[_0xc2db('0x2a')][_0xc2db('0x2b')],function(_0x40a1f7){return{'name':_0x40a1f7[_0xc2db('0x2c')],'type':_0x40a1f7[_0xc2db('0x2d')][_0xc2db('0x2e')]};});_0x21d5aa[_0xc2db('0x2f')]=_[_0xc2db('0x29')](_0x43e432,_0xc2db('0x27'));_0x21d5aa[_0xc2db('0x30')]=_['keys'](_0x5728a1[_0xc2db('0x30')]);_0x21d5aa[_0xc2db('0x31')]=_['intersection'](_0x21d5aa[_0xc2db('0x2f')],_0x21d5aa[_0xc2db('0x30')]);_0x1f4364['attributes']=_[_0xc2db('0x32')](_0x21d5aa[_0xc2db('0x2f')],qs[_0xc2db('0x33')](_0x5728a1[_0xc2db('0x30')][_0xc2db('0x33')]));_0x1f4364[_0xc2db('0x34')]=_0x1f4364[_0xc2db('0x34')]['length']?_0x1f4364[_0xc2db('0x34')]:_0x21d5aa['model'];if(!_0x5728a1[_0xc2db('0x30')]['hasOwnProperty'](_0xc2db('0x35'))){_0x1f4364[_0xc2db('0x36')]=qs['limit'](_0x5728a1['query'][_0xc2db('0x36')]);_0x1f4364[_0xc2db('0x1e')]=qs['offset'](_0x5728a1[_0xc2db('0x30')][_0xc2db('0x1e')]);}_0x1f4364[_0xc2db('0x37')]=qs[_0xc2db('0x38')](_0x5728a1[_0xc2db('0x30')][_0xc2db('0x38')]);_0x1f4364[_0xc2db('0x39')]=qs[_0xc2db('0x31')](_[_0xc2db('0x3a')](_0x5728a1['query'],_0x21d5aa[_0xc2db('0x31')]),_0x43e432);if(_0x5728a1[_0xc2db('0x30')][_0xc2db('0x3b')]){_0x1f4364[_0xc2db('0x39')]=_[_0xc2db('0x3c')](_0x1f4364[_0xc2db('0x39')],{'$or':_['map'](_0x43e432,function(_0x2dedc8){if(_0x2dedc8[_0xc2db('0x2d')]!==_0xc2db('0x3d')){var _0x2965b3={};_0x2965b3[_0x2dedc8['name']]={'$like':'%'+_0x5728a1['query'][_0xc2db('0x3b')]+'%'};return _0x2965b3;}})});}_0x1f4364=_[_0xc2db('0x3c')]({},_0x1f4364,_0x5728a1[_0xc2db('0x3e')]);var _0x4a311c={'where':_0x1f4364[_0xc2db('0x39')]};return db[_0xc2db('0x2a')][_0xc2db('0x1d')](_0x4a311c)[_0xc2db('0x24')](function(_0x9fbc22){_0x1d1b46[_0xc2db('0x1d')]=_0x9fbc22;if(_0x5728a1['query'][_0xc2db('0x3f')]){_0x1f4364['include']=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x1f4364);})[_0xc2db('0x24')](function(_0x380828){_0x1d1b46[_0xc2db('0x40')]=_0x380828;return _0x1d1b46;})['then'](respondWithFilteredResult(_0x445c03,_0x1f4364))[_0xc2db('0x41')](handleError(_0x445c03,null));};exports['show']=function(_0x1f4ab1,_0x447948){var _0x51bbce={'raw':!![],'where':{'id':_0x1f4ab1[_0xc2db('0x42')]['id']}},_0x2daed7={};_0x2daed7['model']=_[_0xc2db('0x43')](db[_0xc2db('0x2a')]['rawAttributes']);_0x2daed7[_0xc2db('0x30')]=_[_0xc2db('0x43')](_0x1f4ab1[_0xc2db('0x30')]);_0x2daed7['filters']=_[_0xc2db('0x32')](_0x2daed7[_0xc2db('0x2f')],_0x2daed7[_0xc2db('0x30')]);_0x51bbce['attributes']=_[_0xc2db('0x32')](_0x2daed7[_0xc2db('0x2f')],qs['fields'](_0x1f4ab1['query'][_0xc2db('0x33')]));_0x51bbce['attributes']=_0x51bbce[_0xc2db('0x34')][_0xc2db('0x44')]?_0x51bbce[_0xc2db('0x34')]:_0x2daed7[_0xc2db('0x2f')];if(_0x1f4ab1[_0xc2db('0x30')][_0xc2db('0x3f')]){_0x51bbce['include']=[{'all':!![]}];}_0x51bbce=_[_0xc2db('0x3c')]({},_0x51bbce,_0x1f4ab1[_0xc2db('0x3e')]);return db[_0xc2db('0x2a')][_0xc2db('0x45')](_0x51bbce)[_0xc2db('0x24')](handleEntityNotFound(_0x447948,null))[_0xc2db('0x24')](respondWithResult(_0x447948,null))[_0xc2db('0x41')](handleError(_0x447948,null));};exports['create']=function(_0x16fe28,_0x4c544c){return db[_0xc2db('0x2a')]['create'](_0x16fe28[_0xc2db('0x46')],{})[_0xc2db('0x24')](respondWithResult(_0x4c544c,0xc9))[_0xc2db('0x41')](handleError(_0x4c544c,null));};exports[_0xc2db('0x22')]=function(_0x4efd42,_0x18eed9){if(_0x4efd42[_0xc2db('0x46')]['id']){delete _0x4efd42['body']['id'];}return db[_0xc2db('0x2a')]['find']({'where':{'id':_0x4efd42['params']['id']}})[_0xc2db('0x24')](handleEntityNotFound(_0x18eed9,null))[_0xc2db('0x24')](saveUpdates(_0x4efd42[_0xc2db('0x46')],null))[_0xc2db('0x24')](respondWithResult(_0x18eed9,null))[_0xc2db('0x41')](handleError(_0x18eed9,null));};exports[_0xc2db('0x23')]=function(_0x2b44aa,_0x550543){return db['SquareReport'][_0xc2db('0x45')]({'where':{'id':_0x2b44aa[_0xc2db('0x42')]['id']}})[_0xc2db('0x24')](handleEntityNotFound(_0x550543,null))[_0xc2db('0x24')](removeEntity(_0x550543,null))[_0xc2db('0x41')](handleError(_0x550543,null));};exports[_0xc2db('0x47')]=function(_0x4bc14d,_0x3bbccb){return db[_0xc2db('0x2a')]['describe']()[_0xc2db('0x24')](respondWithResult(_0x3bbccb,null))[_0xc2db('0x41')](handleError(_0x3bbccb,null));}; \ No newline at end of file +var _0xbe36=['offset','reject','update','then','destroy','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count'];(function(_0x20f26b,_0x31ba1b){var _0x2b3004=function(_0x352bed){while(--_0x352bed){_0x20f26b['push'](_0x20f26b['shift']());}};_0x2b3004(++_0x31ba1b);}(_0xbe36,0x1f2));var _0x6be3=function(_0x34efca,_0xaa5213){_0x34efca=_0x34efca-0x0;var _0x4cebe8=_0xbe36[_0x34efca];return _0x4cebe8;};'use strict';var emlformat=require(_0x6be3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6be3('0x1'));var jsonpatch=require(_0x6be3('0x2'));var rp=require(_0x6be3('0x3'));var moment=require('moment');var BPromise=require(_0x6be3('0x4'));var Mustache=require(_0x6be3('0x5'));var util=require(_0x6be3('0x6'));var path=require(_0x6be3('0x7'));var sox=require(_0x6be3('0x8'));var csv=require(_0x6be3('0x9'));var ejs=require(_0x6be3('0xa'));var fs=require('fs');var fs_extra=require(_0x6be3('0xb'));var _=require(_0x6be3('0xc'));var squel=require(_0x6be3('0xd'));var crypto=require(_0x6be3('0xe'));var jsforce=require(_0x6be3('0xf'));var deskjs=require(_0x6be3('0x10'));var toCsv=require(_0x6be3('0x9'));var querystring=require('querystring');var Papa=require(_0x6be3('0x11'));var Redis=require(_0x6be3('0x12'));var authService=require(_0x6be3('0x13'));var qs=require(_0x6be3('0x14'));var as=require(_0x6be3('0x15'));var hardwareService=require(_0x6be3('0x16'));var logger=require(_0x6be3('0x17'))(_0x6be3('0x18'));var utils=require(_0x6be3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6be3('0x1a'));var db=require(_0x6be3('0x1b'))['db'];function respondWithStatusCode(_0xac2a5,_0x266a65){_0x266a65=_0x266a65||0xcc;return function(_0x5e6763){if(_0x5e6763){return _0xac2a5['sendStatus'](_0x266a65);}return _0xac2a5[_0x6be3('0x1c')](_0x266a65)[_0x6be3('0x1d')]();};}function respondWithResult(_0x44d6a7,_0x456872){_0x456872=_0x456872||0xc8;return function(_0x36464c){if(_0x36464c){return _0x44d6a7['status'](_0x456872)[_0x6be3('0x1e')](_0x36464c);}};}function respondWithFilteredResult(_0x5a49af,_0x239716){return function(_0xd7a015){if(_0xd7a015){var _0x2af995=typeof _0x239716['offset']===_0x6be3('0x1f')&&typeof _0x239716[_0x6be3('0x20')]===_0x6be3('0x1f');var _0x16c345=_0xd7a015[_0x6be3('0x21')];var _0x27f761=_0x2af995?0x0:_0x239716[_0x6be3('0x22')];var _0x1cd37a=_0x2af995?_0xd7a015[_0x6be3('0x21')]:_0x239716['offset']+_0x239716[_0x6be3('0x20')];var _0x280c18;if(_0x1cd37a>=_0x16c345){_0x1cd37a=_0x16c345;_0x280c18=0xc8;}else{_0x280c18=0xce;}_0x5a49af['status'](_0x280c18);return _0x5a49af['set']('Content-Range',_0x27f761+'-'+_0x1cd37a+'/'+_0x16c345)[_0x6be3('0x1e')](_0xd7a015);}return null;};}function patchUpdates(_0xa3fdad){return function(_0x4bb9b1){try{jsonpatch['apply'](_0x4bb9b1,_0xa3fdad,!![]);}catch(_0x55949f){return BPromise[_0x6be3('0x23')](_0x55949f);}return _0x4bb9b1['save']();};}function saveUpdates(_0xeab08b,_0x319b5b){return function(_0x567fe5){if(_0x567fe5){return _0x567fe5[_0x6be3('0x24')](_0xeab08b)[_0x6be3('0x25')](function(_0x45c4b9){return _0x45c4b9;});}return null;};}function removeEntity(_0x3a8d19,_0x2ba59b){return function(_0x3360c7){if(_0x3360c7){return _0x3360c7[_0x6be3('0x26')]()[_0x6be3('0x25')](function(){_0x3a8d19[_0x6be3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xad965f,_0x21d832){return function(_0x24fca3){if(!_0x24fca3){_0xad965f['sendStatus'](0x194);}return _0x24fca3;};}function handleError(_0x497137,_0x4a0388){_0x4a0388=_0x4a0388||0x1f4;return function(_0xc36a32){logger['error'](_0xc36a32['stack']);if(_0xc36a32[_0x6be3('0x27')]){delete _0xc36a32[_0x6be3('0x27')];}_0x497137[_0x6be3('0x1c')](_0x4a0388)[_0x6be3('0x28')](_0xc36a32);};}exports[_0x6be3('0x29')]=function(_0x26f6b8,_0x3928bd){var _0x275878={},_0x324e61={},_0x4f71d4={'count':0x0,'rows':[]};var _0x5e4002=_[_0x6be3('0x2a')](db[_0x6be3('0x2b')][_0x6be3('0x2c')],function(_0x8b18e7){return{'name':_0x8b18e7[_0x6be3('0x2d')],'type':_0x8b18e7[_0x6be3('0x2e')]['key']};});_0x324e61[_0x6be3('0x2f')]=_['map'](_0x5e4002,_0x6be3('0x27'));_0x324e61[_0x6be3('0x30')]=_[_0x6be3('0x31')](_0x26f6b8[_0x6be3('0x30')]);_0x324e61[_0x6be3('0x32')]=_[_0x6be3('0x33')](_0x324e61[_0x6be3('0x2f')],_0x324e61['query']);_0x275878[_0x6be3('0x34')]=_[_0x6be3('0x33')](_0x324e61['model'],qs[_0x6be3('0x35')](_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x35')]));_0x275878[_0x6be3('0x34')]=_0x275878[_0x6be3('0x34')][_0x6be3('0x36')]?_0x275878[_0x6be3('0x34')]:_0x324e61[_0x6be3('0x2f')];if(!_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x37')](_0x6be3('0x38'))){_0x275878[_0x6be3('0x20')]=qs[_0x6be3('0x20')](_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x20')]);_0x275878[_0x6be3('0x22')]=qs['offset'](_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x22')]);}_0x275878[_0x6be3('0x39')]=qs['sort'](_0x26f6b8['query'][_0x6be3('0x3a')]);_0x275878['where']=qs[_0x6be3('0x32')](_[_0x6be3('0x3b')](_0x26f6b8['query'],_0x324e61[_0x6be3('0x32')]),_0x5e4002);if(_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x3c')]){_0x275878[_0x6be3('0x3d')]=_[_0x6be3('0x3e')](_0x275878[_0x6be3('0x3d')],{'$or':_['map'](_0x5e4002,function(_0x155053){if(_0x155053['type']!==_0x6be3('0x3f')){var _0x10e100={};_0x10e100[_0x155053[_0x6be3('0x27')]]={'$like':'%'+_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x3c')]+'%'};return _0x10e100;}})});}_0x275878=_[_0x6be3('0x3e')]({},_0x275878,_0x26f6b8[_0x6be3('0x40')]);var _0x3bd8f0={'where':_0x275878['where']};return db[_0x6be3('0x2b')][_0x6be3('0x21')](_0x3bd8f0)['then'](function(_0x58880c){_0x4f71d4[_0x6be3('0x21')]=_0x58880c;if(_0x26f6b8[_0x6be3('0x30')][_0x6be3('0x41')]){_0x275878[_0x6be3('0x42')]=[{'all':!![]}];}return db['SquareReport'][_0x6be3('0x43')](_0x275878);})['then'](function(_0x67c33c){_0x4f71d4[_0x6be3('0x44')]=_0x67c33c;return _0x4f71d4;})[_0x6be3('0x25')](respondWithFilteredResult(_0x3928bd,_0x275878))[_0x6be3('0x45')](handleError(_0x3928bd,null));};exports[_0x6be3('0x46')]=function(_0x140dc7,_0x36828a){var _0x483729={'raw':!![],'where':{'id':_0x140dc7[_0x6be3('0x47')]['id']}},_0x3ba914={};_0x3ba914[_0x6be3('0x2f')]=_[_0x6be3('0x31')](db['SquareReport']['rawAttributes']);_0x3ba914['query']=_[_0x6be3('0x31')](_0x140dc7[_0x6be3('0x30')]);_0x3ba914['filters']=_['intersection'](_0x3ba914['model'],_0x3ba914[_0x6be3('0x30')]);_0x483729[_0x6be3('0x34')]=_[_0x6be3('0x33')](_0x3ba914['model'],qs[_0x6be3('0x35')](_0x140dc7[_0x6be3('0x30')]['fields']));_0x483729['attributes']=_0x483729[_0x6be3('0x34')][_0x6be3('0x36')]?_0x483729[_0x6be3('0x34')]:_0x3ba914[_0x6be3('0x2f')];if(_0x140dc7[_0x6be3('0x30')][_0x6be3('0x41')]){_0x483729[_0x6be3('0x42')]=[{'all':!![]}];}_0x483729=_[_0x6be3('0x3e')]({},_0x483729,_0x140dc7['options']);return db[_0x6be3('0x2b')]['find'](_0x483729)[_0x6be3('0x25')](handleEntityNotFound(_0x36828a,null))[_0x6be3('0x25')](respondWithResult(_0x36828a,null))['catch'](handleError(_0x36828a,null));};exports[_0x6be3('0x48')]=function(_0x3d3c8b,_0x33c2e6){return db[_0x6be3('0x2b')][_0x6be3('0x48')](_0x3d3c8b[_0x6be3('0x49')],{})[_0x6be3('0x25')](respondWithResult(_0x33c2e6,0xc9))[_0x6be3('0x45')](handleError(_0x33c2e6,null));};exports['update']=function(_0x47ffaa,_0x2e1958){if(_0x47ffaa['body']['id']){delete _0x47ffaa[_0x6be3('0x49')]['id'];}return db[_0x6be3('0x2b')][_0x6be3('0x4a')]({'where':{'id':_0x47ffaa[_0x6be3('0x47')]['id']}})[_0x6be3('0x25')](handleEntityNotFound(_0x2e1958,null))['then'](saveUpdates(_0x47ffaa[_0x6be3('0x49')],null))[_0x6be3('0x25')](respondWithResult(_0x2e1958,null))[_0x6be3('0x45')](handleError(_0x2e1958,null));};exports[_0x6be3('0x26')]=function(_0x4f4b32,_0x47b126){return db[_0x6be3('0x2b')][_0x6be3('0x4a')]({'where':{'id':_0x4f4b32['params']['id']}})[_0x6be3('0x25')](handleEntityNotFound(_0x47b126,null))[_0x6be3('0x25')](removeEntity(_0x47b126,null))['catch'](handleError(_0x47b126,null));};exports[_0x6be3('0x4b')]=function(_0x46d3dd,_0x341e1c){return db[_0x6be3('0x2b')][_0x6be3('0x4b')]()['then'](respondWithResult(_0x341e1c,null))[_0x6be3('0x45')](handleError(_0x341e1c,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 26195a9..9004a2b 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 _0xf3b2=['SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','define'];(function(_0x80ed03,_0x4cd917){var _0x74b3=function(_0x96f1d9){while(--_0x96f1d9){_0x80ed03['push'](_0x80ed03['shift']());}};_0x74b3(++_0x4cd917);}(_0xf3b2,0x1a5));var _0x2f3b=function(_0x48783c,_0x1f986b){_0x48783c=_0x48783c-0x0;var _0x2ce586=_0xf3b2[_0x48783c];return _0x2ce586;};'use strict';var _=require(_0x2f3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2f3b('0x1'));var moment=require(_0x2f3b('0x2'));var BPromise=require(_0x2f3b('0x3'));var rp=require(_0x2f3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3b('0x5'));var config=require('../../config/environment');var attributes=require(_0x2f3b('0x6'));module['exports']=function(_0x3fde46,_0x1463f4){return _0x3fde46[_0x2f3b('0x7')](_0x2f3b('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x2f3b('0x9'),'fields':[_0x2f3b('0xa'),_0x2f3b('0xb')]},{'name':_0x2f3b('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4df7=['SquareReport','uid_pname','uniqueid','leaveAt','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x384488,_0x4400af){var _0x57f065=function(_0x1925d7){while(--_0x1925d7){_0x384488['push'](_0x384488['shift']());}};_0x57f065(++_0x4400af);}(_0x4df7,0x12a));var _0x74df=function(_0x97ce14,_0x5635a6){_0x97ce14=_0x97ce14-0x0;var _0x30e873=_0x4df7[_0x97ce14];return _0x30e873;};'use strict';var _=require('lodash');var util=require(_0x74df('0x0'));var logger=require('../../config/logger')(_0x74df('0x1'));var moment=require('moment');var BPromise=require(_0x74df('0x2'));var rp=require(_0x74df('0x3'));var fs=require('fs');var path=require(_0x74df('0x4'));var rimraf=require(_0x74df('0x5'));var config=require(_0x74df('0x6'));var attributes=require(_0x74df('0x7'));module[_0x74df('0x8')]=function(_0x30770c,_0xfb02ab){return _0x30770c[_0x74df('0x9')](_0x74df('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x74df('0xb'),'fields':[_0x74df('0xc'),'project_name']},{'name':_0x74df('0xd'),'fields':[_0x74df('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 f593d2e..16569aa 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 _0x6184=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6184,0xdb));var _0x4618=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x6184[_0x460fd7];return _0x44d1c2;};'use strict';var _=require(_0x4618('0x0'));var util=require(_0x4618('0x1'));var moment=require(_0x4618('0x2'));var BPromise=require(_0x4618('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4618('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4618('0x5'));var logger=require(_0x4618('0x6'))(_0x4618('0x7'));var config=require(_0x4618('0x8'));var jayson=require(_0x4618('0x9'));var client=jayson[_0x4618('0xa')][_0x4618('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xffe44f,_0x2ac6ac,_0x89b788){return new BPromise(function(_0x1904bb,_0x5207f4){return client[_0x4618('0xc')](_0xffe44f,_0x89b788)[_0x4618('0xd')](function(_0x3d4bba){logger['info']('SquareReport,\x20%s,\x20%s',_0x2ac6ac,_0x4618('0xe'));logger[_0x4618('0xf')](_0x4618('0x10'),_0x2ac6ac,_0x4618('0xe'),JSON[_0x4618('0x11')](_0x3d4bba));if(_0x3d4bba[_0x4618('0x12')]){if(_0x3d4bba[_0x4618('0x12')][_0x4618('0x13')]===0x1f4){logger[_0x4618('0x12')]('SquareReport,\x20%s,\x20%s',_0x2ac6ac,_0x3d4bba[_0x4618('0x12')][_0x4618('0x14')]);return _0x5207f4(_0x3d4bba[_0x4618('0x12')][_0x4618('0x14')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x2ac6ac,_0x3d4bba['error'][_0x4618('0x14')]);return _0x1904bb(_0x3d4bba['error'][_0x4618('0x14')]);}else{logger[_0x4618('0x15')](_0x4618('0x16'),_0x2ac6ac,_0x4618('0xe'));_0x1904bb(_0x3d4bba[_0x4618('0x17')][_0x4618('0x14')]);}})[_0x4618('0x18')](function(_0x31cc47){logger[_0x4618('0x12')](_0x4618('0x16'),_0x2ac6ac,_0x31cc47);_0x5207f4(_0x31cc47);});});}exports[_0x4618('0x19')]=function(_0x5f239c){var _0xf084b=this;return new Promise(function(_0x512a25,_0x4a8320){return db[_0x4618('0x1a')][_0x4618('0x1b')](_0x5f239c['body'],{'raw':_0x5f239c[_0x4618('0x1c')]?_0x5f239c[_0x4618('0x1c')][_0x4618('0x1d')]===undefined?!![]:![]:!![]})[_0x4618('0xd')](function(_0x1f032f){logger[_0x4618('0x15')](_0x4618('0x19'),_0x5f239c);logger[_0x4618('0xf')]('CreateSquareReport',_0x5f239c,JSON[_0x4618('0x11')](_0x1f032f));_0x512a25(_0x1f032f);})['catch'](function(_0x158ec8){logger['error'](_0x4618('0x19'),_0x158ec8[_0x4618('0x14')],_0x5f239c);_0x4a8320(_0xf084b[_0x4618('0x12')](0x1f4,_0x158ec8['message']));});});};exports[_0x4618('0x1e')]=function(_0x1039b5){var _0x2db979=this;return new Promise(function(_0x1db4a5,_0x1c70fa){return db[_0x4618('0x1a')][_0x4618('0x1f')](_0x1039b5[_0x4618('0x20')],{'raw':_0x1039b5['options']?_0x1039b5[_0x4618('0x1c')][_0x4618('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1039b5[_0x4618('0x1c')]?_0x1039b5[_0x4618('0x1c')][_0x4618('0x21')]||null:null,'attributes':_0x1039b5[_0x4618('0x1c')]?_0x1039b5[_0x4618('0x1c')][_0x4618('0x22')]||null:null,'limit':_0x1039b5[_0x4618('0x1c')]?_0x1039b5[_0x4618('0x1c')][_0x4618('0x23')]||null:null})[_0x4618('0xd')](function(_0x227262){logger['info']('UpdateSquareReport',_0x1039b5);logger[_0x4618('0xf')](_0x4618('0x1e'),_0x1039b5,JSON[_0x4618('0x11')](_0x227262));_0x1db4a5(_0x227262);})[_0x4618('0x18')](function(_0x35bc0f){logger[_0x4618('0x12')](_0x4618('0x1e'),_0x35bc0f[_0x4618('0x14')],_0x1039b5);_0x1c70fa(_0x2db979[_0x4618('0x12')](0x1f4,_0x35bc0f[_0x4618('0x14')]));});});}; \ No newline at end of file +var _0x6b6b=['update','body','where','attributes','limit','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','stringify'];(function(_0x53a269,_0x52c560){var _0x1adaa5=function(_0x63bf6c){while(--_0x63bf6c){_0x53a269['push'](_0x53a269['shift']());}};_0x1adaa5(++_0x52c560);}(_0x6b6b,0xd8));var _0xb6b6=function(_0x2436d0,_0x354b64){_0x2436d0=_0x2436d0-0x0;var _0x47562b=_0x6b6b[_0x2436d0];return _0x47562b;};'use strict';var _=require('lodash');var util=require(_0xb6b6('0x0'));var moment=require(_0xb6b6('0x1'));var BPromise=require(_0xb6b6('0x2'));var rs=require(_0xb6b6('0x3'));var fs=require('fs');var Redis=require(_0xb6b6('0x4'));var db=require(_0xb6b6('0x5'))['db'];var utils=require(_0xb6b6('0x6'));var logger=require('../../config/logger')(_0xb6b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6b6('0x8'));var client=jayson[_0xb6b6('0x9')][_0xb6b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2520eb,_0x549e8f,_0x354d05){return new BPromise(function(_0x3198a7,_0x5da6f1){return client[_0xb6b6('0xb')](_0x2520eb,_0x354d05)[_0xb6b6('0xc')](function(_0x5bcf5a){logger[_0xb6b6('0xd')](_0xb6b6('0xe'),_0x549e8f,_0xb6b6('0xf'));logger[_0xb6b6('0x10')](_0xb6b6('0x11'),_0x549e8f,_0xb6b6('0xf'),JSON['stringify'](_0x5bcf5a));if(_0x5bcf5a[_0xb6b6('0x12')]){if(_0x5bcf5a[_0xb6b6('0x12')][_0xb6b6('0x13')]===0x1f4){logger[_0xb6b6('0x12')](_0xb6b6('0xe'),_0x549e8f,_0x5bcf5a[_0xb6b6('0x12')]['message']);return _0x5da6f1(_0x5bcf5a['error']['message']);}logger[_0xb6b6('0x12')](_0xb6b6('0xe'),_0x549e8f,_0x5bcf5a[_0xb6b6('0x12')][_0xb6b6('0x14')]);return _0x3198a7(_0x5bcf5a[_0xb6b6('0x12')][_0xb6b6('0x14')]);}else{logger[_0xb6b6('0xd')](_0xb6b6('0xe'),_0x549e8f,'request\x20sent');_0x3198a7(_0x5bcf5a[_0xb6b6('0x15')][_0xb6b6('0x14')]);}})[_0xb6b6('0x16')](function(_0x2d49f4){logger[_0xb6b6('0x12')](_0xb6b6('0xe'),_0x549e8f,_0x2d49f4);_0x5da6f1(_0x2d49f4);});});}exports[_0xb6b6('0x17')]=function(_0x1d3c31){var _0x205af4=this;return new Promise(function(_0x3f4e6c,_0x4fcf3a){return db[_0xb6b6('0x18')][_0xb6b6('0x19')](_0x1d3c31['body'],{'raw':_0x1d3c31['options']?_0x1d3c31[_0xb6b6('0x1a')][_0xb6b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee1ee){logger[_0xb6b6('0xd')](_0xb6b6('0x17'),_0x1d3c31);logger[_0xb6b6('0x10')](_0xb6b6('0x17'),_0x1d3c31,JSON[_0xb6b6('0x1c')](_0x1ee1ee));_0x3f4e6c(_0x1ee1ee);})[_0xb6b6('0x16')](function(_0x32f8ba){logger[_0xb6b6('0x12')](_0xb6b6('0x17'),_0x32f8ba[_0xb6b6('0x14')],_0x1d3c31);_0x4fcf3a(_0x205af4[_0xb6b6('0x12')](0x1f4,_0x32f8ba[_0xb6b6('0x14')]));});});};exports['UpdateSquareReport']=function(_0x4325d7){var _0x17b7c9=this;return new Promise(function(_0x2c7eca,_0x3b5354){return db[_0xb6b6('0x18')][_0xb6b6('0x1d')](_0x4325d7[_0xb6b6('0x1e')],{'raw':_0x4325d7[_0xb6b6('0x1a')]?_0x4325d7[_0xb6b6('0x1a')][_0xb6b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4325d7[_0xb6b6('0x1a')]?_0x4325d7[_0xb6b6('0x1a')][_0xb6b6('0x1f')]||null:null,'attributes':_0x4325d7[_0xb6b6('0x1a')]?_0x4325d7[_0xb6b6('0x1a')][_0xb6b6('0x20')]||null:null,'limit':_0x4325d7[_0xb6b6('0x1a')]?_0x4325d7['options'][_0xb6b6('0x21')]||null:null})[_0xb6b6('0xc')](function(_0x50450c){logger[_0xb6b6('0xd')](_0xb6b6('0x22'),_0x4325d7);logger[_0xb6b6('0x10')](_0xb6b6('0x22'),_0x4325d7,JSON['stringify'](_0x50450c));_0x2c7eca(_0x50450c);})[_0xb6b6('0x16')](function(_0x450801){logger[_0xb6b6('0x12')](_0xb6b6('0x22'),_0x450801[_0xb6b6('0x14')],_0x4325d7);_0x3b5354(_0x17b7c9[_0xb6b6('0x12')](0x1f4,_0x450801[_0xb6b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b521c5c..79ad3ef 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 _0x31d1=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x187e86,_0x20e900){var _0x50230b=function(_0x375f58){while(--_0x375f58){_0x187e86['push'](_0x187e86['shift']());}};_0x50230b(++_0x20e900);}(_0x31d1,0x15f));var _0x131d=function(_0x51e40b,_0x32a3ee){_0x51e40b=_0x51e40b-0x0;var _0x56c041=_0x31d1[_0x51e40b];return _0x56c041;};'use strict';var multer=require('multer');var util=require(_0x131d('0x0'));var path=require('path');var timeout=require(_0x131d('0x1'));var express=require('express');var router=express[_0x131d('0x2')]();var fs_extra=require(_0x131d('0x3'));var auth=require(_0x131d('0x4'));var interaction=require(_0x131d('0x5'));var config=require(_0x131d('0x6'));var controller=require(_0x131d('0x7'));router[_0x131d('0x8')]('/',auth[_0x131d('0x9')](),controller[_0x131d('0xa')]);router[_0x131d('0x8')]('/describe',auth[_0x131d('0x9')](),controller[_0x131d('0xb')]);router['get'](_0x131d('0xc'),auth[_0x131d('0x9')](),controller[_0x131d('0xd')]);router['post']('/',auth[_0x131d('0x9')](),controller[_0x131d('0xe')]);router[_0x131d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x131d('0x10')](_0x131d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8268=['Router','fs-extra','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x14de44,_0x1eae71){var _0xda689=function(_0x3e274c){while(--_0x3e274c){_0x14de44['push'](_0x14de44['shift']());}};_0xda689(++_0x1eae71);}(_0x8268,0x1bf));var _0x8826=function(_0x50c9f6,_0x2b9c8c){_0x50c9f6=_0x50c9f6-0x0;var _0x1975aa=_0x8268[_0x50c9f6];return _0x1975aa;};'use strict';var multer=require(_0x8826('0x0'));var util=require('util');var path=require(_0x8826('0x1'));var timeout=require(_0x8826('0x2'));var express=require('express');var router=express[_0x8826('0x3')]();var fs_extra=require(_0x8826('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8826('0x5'));router[_0x8826('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8826('0x7'),auth[_0x8826('0x8')](),controller[_0x8826('0x9')]);router[_0x8826('0x6')](_0x8826('0xa'),auth['isAuthenticated'](),controller[_0x8826('0xb')]);router[_0x8826('0xc')]('/',auth['isAuthenticated'](),controller[_0x8826('0xd')]);router[_0x8826('0xe')](_0x8826('0xa'),auth[_0x8826('0x8')](),controller[_0x8826('0xf')]);router[_0x8826('0x10')](_0x8826('0xa'),auth[_0x8826('0x8')](),controller[_0x8826('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 13b6ec7..0c625ad 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 _0x26f8=['exports','STRING','TEXT'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x26f8,0x12c));var _0x826f=function(_0x44c844,_0x1e3d7d){_0x44c844=_0x44c844-0x0;var _0x1d51b7=_0x26f8[_0x44c844];return _0x1d51b7;};'use strict';var Sequelize=require('sequelize');module[_0x826f('0x0')]={'uniqueid':{'type':Sequelize[_0x826f('0x1')]},'node':{'type':Sequelize[_0x826f('0x1')]},'application':{'type':Sequelize[_0x826f('0x1')]},'data':{'type':Sequelize[_0x826f('0x2')]},'project_name':{'type':Sequelize[_0x826f('0x1')]},'callerid':{'type':Sequelize[_0x826f('0x1')]}}; \ No newline at end of file +var _0xd30b=['STRING','TEXT','exports'];(function(_0x34f213,_0x5b8682){var _0x50b13f=function(_0x1d7e0d){while(--_0x1d7e0d){_0x34f213['push'](_0x34f213['shift']());}};_0x50b13f(++_0x5b8682);}(_0xd30b,0x173));var _0xbd30=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xd30b[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require('sequelize');module[_0xbd30('0x0')]={'uniqueid':{'type':Sequelize[_0xbd30('0x1')]},'node':{'type':Sequelize[_0xbd30('0x1')]},'application':{'type':Sequelize[_0xbd30('0x1')]},'data':{'type':Sequelize[_0xbd30('0x2')]},'project_name':{'type':Sequelize[_0xbd30('0x1')]},'callerid':{'type':Sequelize[_0xbd30('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9ad8e18..9dc511a 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 _0x8252=['apply','save','update','then','destroy','end','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','catch','show','params','keys','fields','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x8252,0xf6));var _0x2825=function(_0x1a03e7,_0x59d3bd){_0x1a03e7=_0x1a03e7-0x0;var _0x14730d=_0x8252[_0x1a03e7];return _0x14730d;};'use strict';var emlformat=require(_0x2825('0x0'));var rimraf=require(_0x2825('0x1'));var zipdir=require(_0x2825('0x2'));var jsonpatch=require(_0x2825('0x3'));var rp=require(_0x2825('0x4'));var moment=require(_0x2825('0x5'));var BPromise=require(_0x2825('0x6'));var Mustache=require('mustache');var util=require(_0x2825('0x7'));var path=require(_0x2825('0x8'));var sox=require(_0x2825('0x9'));var csv=require(_0x2825('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2825('0xb'));var crypto=require('crypto');var jsforce=require(_0x2825('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2825('0xa'));var querystring=require(_0x2825('0xd'));var Papa=require('papaparse');var Redis=require(_0x2825('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2825('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2825('0x10'));var logger=require(_0x2825('0x11'))(_0x2825('0x12'));var utils=require(_0x2825('0x13'));var config=require(_0x2825('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2825('0x15'))['db'];function respondWithStatusCode(_0x5dc5cc,_0x36f357){_0x36f357=_0x36f357||0xcc;return function(_0x1abbc7){if(_0x1abbc7){return _0x5dc5cc[_0x2825('0x16')](_0x36f357);}return _0x5dc5cc['status'](_0x36f357)['end']();};}function respondWithResult(_0x129943,_0xd29517){_0xd29517=_0xd29517||0xc8;return function(_0x133987){if(_0x133987){return _0x129943[_0x2825('0x17')](_0xd29517)['json'](_0x133987);}};}function respondWithFilteredResult(_0x1c700d,_0x17f90b){return function(_0x438aa1){if(_0x438aa1){var _0x487725=typeof _0x17f90b['offset']==='undefined'&&typeof _0x17f90b['limit']==='undefined';var _0x43b986=_0x438aa1[_0x2825('0x18')];var _0x4e60b1=_0x487725?0x0:_0x17f90b['offset'];var _0x1d4281=_0x487725?_0x438aa1[_0x2825('0x18')]:_0x17f90b[_0x2825('0x19')]+_0x17f90b[_0x2825('0x1a')];var _0x32e10c;if(_0x1d4281>=_0x43b986){_0x1d4281=_0x43b986;_0x32e10c=0xc8;}else{_0x32e10c=0xce;}_0x1c700d[_0x2825('0x17')](_0x32e10c);return _0x1c700d[_0x2825('0x1b')](_0x2825('0x1c'),_0x4e60b1+'-'+_0x1d4281+'/'+_0x43b986)[_0x2825('0x1d')](_0x438aa1);}return null;};}function patchUpdates(_0x28f6ed){return function(_0x597c0a){try{jsonpatch[_0x2825('0x1e')](_0x597c0a,_0x28f6ed,!![]);}catch(_0x65af1f){return BPromise['reject'](_0x65af1f);}return _0x597c0a[_0x2825('0x1f')]();};}function saveUpdates(_0x15f4f7,_0x1c81b0){return function(_0x2cb04f){if(_0x2cb04f){return _0x2cb04f[_0x2825('0x20')](_0x15f4f7)[_0x2825('0x21')](function(_0x3987e8){return _0x3987e8;});}return null;};}function removeEntity(_0x238954,_0xff073d){return function(_0x295709){if(_0x295709){return _0x295709[_0x2825('0x22')]()[_0x2825('0x21')](function(){_0x238954[_0x2825('0x17')](0xcc)[_0x2825('0x23')]();});}};}function handleEntityNotFound(_0x7e565c,_0x5df185){return function(_0x440ff0){if(!_0x440ff0){_0x7e565c[_0x2825('0x16')](0x194);}return _0x440ff0;};}function handleError(_0x36e245,_0x7f484e){_0x7f484e=_0x7f484e||0x1f4;return function(_0x258ed4){logger[_0x2825('0x24')](_0x258ed4[_0x2825('0x25')]);if(_0x258ed4['name']){delete _0x258ed4[_0x2825('0x26')];}_0x36e245[_0x2825('0x17')](_0x7f484e)[_0x2825('0x27')](_0x258ed4);};}exports['index']=function(_0x435b86,_0x150f3d){var _0x26c4c0={},_0x4f3c7a={},_0xeffa83={'count':0x0,'rows':[]};var _0x277376=_[_0x2825('0x28')](db[_0x2825('0x29')][_0x2825('0x2a')],function(_0x5ce7bf){return{'name':_0x5ce7bf[_0x2825('0x2b')],'type':_0x5ce7bf['type'][_0x2825('0x2c')]};});_0x4f3c7a[_0x2825('0x2d')]=_[_0x2825('0x28')](_0x277376,_0x2825('0x26'));_0x4f3c7a[_0x2825('0x2e')]=_['keys'](_0x435b86['query']);_0x4f3c7a[_0x2825('0x2f')]=_[_0x2825('0x30')](_0x4f3c7a[_0x2825('0x2d')],_0x4f3c7a[_0x2825('0x2e')]);_0x26c4c0['attributes']=_[_0x2825('0x30')](_0x4f3c7a[_0x2825('0x2d')],qs['fields'](_0x435b86[_0x2825('0x2e')]['fields']));_0x26c4c0[_0x2825('0x31')]=_0x26c4c0['attributes']['length']?_0x26c4c0['attributes']:_0x4f3c7a[_0x2825('0x2d')];if(!_0x435b86['query']['hasOwnProperty']('nolimit')){_0x26c4c0[_0x2825('0x1a')]=qs[_0x2825('0x1a')](_0x435b86[_0x2825('0x2e')][_0x2825('0x1a')]);_0x26c4c0[_0x2825('0x19')]=qs[_0x2825('0x19')](_0x435b86['query'][_0x2825('0x19')]);}_0x26c4c0[_0x2825('0x32')]=qs[_0x2825('0x33')](_0x435b86[_0x2825('0x2e')][_0x2825('0x33')]);_0x26c4c0[_0x2825('0x34')]=qs[_0x2825('0x2f')](_[_0x2825('0x35')](_0x435b86['query'],_0x4f3c7a[_0x2825('0x2f')]),_0x277376);if(_0x435b86[_0x2825('0x2e')][_0x2825('0x36')]){_0x26c4c0[_0x2825('0x34')]=_['merge'](_0x26c4c0['where'],{'$or':_[_0x2825('0x28')](_0x277376,function(_0x19fc01){if(_0x19fc01[_0x2825('0x37')]!==_0x2825('0x38')){var _0x2477cd={};_0x2477cd[_0x19fc01[_0x2825('0x26')]]={'$like':'%'+_0x435b86[_0x2825('0x2e')]['filter']+'%'};return _0x2477cd;}})});}_0x26c4c0=_['merge']({},_0x26c4c0,_0x435b86[_0x2825('0x39')]);var _0x3e03e0={'where':_0x26c4c0[_0x2825('0x34')]};return db[_0x2825('0x29')][_0x2825('0x18')](_0x3e03e0)[_0x2825('0x21')](function(_0x493941){_0xeffa83['count']=_0x493941;if(_0x435b86[_0x2825('0x2e')][_0x2825('0x3a')]){_0x26c4c0[_0x2825('0x3b')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x26c4c0);})[_0x2825('0x21')](function(_0x5e7b67){_0xeffa83['rows']=_0x5e7b67;return _0xeffa83;})[_0x2825('0x21')](respondWithFilteredResult(_0x150f3d,_0x26c4c0))[_0x2825('0x3c')](handleError(_0x150f3d,null));};exports[_0x2825('0x3d')]=function(_0x53b23f,_0x1f3deb){var _0x4eb100={'raw':!![],'where':{'id':_0x53b23f[_0x2825('0x3e')]['id']}},_0x36c601={};_0x36c601[_0x2825('0x2d')]=_[_0x2825('0x3f')](db[_0x2825('0x29')]['rawAttributes']);_0x36c601[_0x2825('0x2e')]=_[_0x2825('0x3f')](_0x53b23f[_0x2825('0x2e')]);_0x36c601[_0x2825('0x2f')]=_[_0x2825('0x30')](_0x36c601[_0x2825('0x2d')],_0x36c601[_0x2825('0x2e')]);_0x4eb100[_0x2825('0x31')]=_['intersection'](_0x36c601[_0x2825('0x2d')],qs[_0x2825('0x40')](_0x53b23f['query']['fields']));_0x4eb100[_0x2825('0x31')]=_0x4eb100[_0x2825('0x31')]['length']?_0x4eb100['attributes']:_0x36c601[_0x2825('0x2d')];if(_0x53b23f['query'][_0x2825('0x3a')]){_0x4eb100[_0x2825('0x3b')]=[{'all':!![]}];}_0x4eb100=_[_0x2825('0x41')]({},_0x4eb100,_0x53b23f[_0x2825('0x39')]);return db[_0x2825('0x29')][_0x2825('0x42')](_0x4eb100)[_0x2825('0x21')](handleEntityNotFound(_0x1f3deb,null))[_0x2825('0x21')](respondWithResult(_0x1f3deb,null))[_0x2825('0x3c')](handleError(_0x1f3deb,null));};exports[_0x2825('0x43')]=function(_0x5e8e5a,_0x4a1dff){return db[_0x2825('0x29')][_0x2825('0x43')](_0x5e8e5a[_0x2825('0x44')],{})[_0x2825('0x21')](respondWithResult(_0x4a1dff,0xc9))[_0x2825('0x3c')](handleError(_0x4a1dff,null));};exports[_0x2825('0x20')]=function(_0x362403,_0x1378ca){if(_0x362403[_0x2825('0x44')]['id']){delete _0x362403[_0x2825('0x44')]['id'];}return db['SquareDetailsReport'][_0x2825('0x42')]({'where':{'id':_0x362403[_0x2825('0x3e')]['id']}})[_0x2825('0x21')](handleEntityNotFound(_0x1378ca,null))[_0x2825('0x21')](saveUpdates(_0x362403[_0x2825('0x44')],null))[_0x2825('0x21')](respondWithResult(_0x1378ca,null))[_0x2825('0x3c')](handleError(_0x1378ca,null));};exports[_0x2825('0x22')]=function(_0x12f663,_0x113785){return db[_0x2825('0x29')][_0x2825('0x42')]({'where':{'id':_0x12f663['params']['id']}})[_0x2825('0x21')](handleEntityNotFound(_0x113785,null))['then'](removeEntity(_0x113785,null))[_0x2825('0x3c')](handleError(_0x113785,null));};exports['describe']=function(_0xba6d1b,_0x790865){return db[_0x2825('0x29')]['describe']()[_0x2825('0x21')](respondWithResult(_0x790865,null))['catch'](handleError(_0x790865,null));}; \ No newline at end of file +var _0x06d0=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','catch','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x06d0,0x197));var _0x006d=function(_0x38e16c,_0x2c9099){_0x38e16c=_0x38e16c-0x0;var _0x2db107=_0x06d0[_0x38e16c];return _0x2db107;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x006d('0x0'));var zipdir=require(_0x006d('0x1'));var jsonpatch=require(_0x006d('0x2'));var rp=require(_0x006d('0x3'));var moment=require(_0x006d('0x4'));var BPromise=require(_0x006d('0x5'));var Mustache=require(_0x006d('0x6'));var util=require(_0x006d('0x7'));var path=require(_0x006d('0x8'));var sox=require(_0x006d('0x9'));var csv=require('to-csv');var ejs=require(_0x006d('0xa'));var fs=require('fs');var fs_extra=require(_0x006d('0xb'));var _=require('lodash');var squel=require(_0x006d('0xc'));var crypto=require(_0x006d('0xd'));var jsforce=require(_0x006d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x006d('0xf'));var querystring=require(_0x006d('0x10'));var Papa=require(_0x006d('0x11'));var Redis=require(_0x006d('0x12'));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('../../config/logger')('api');var utils=require(_0x006d('0x13'));var config=require(_0x006d('0x14'));var licenseUtil=require(_0x006d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ee86,_0x196716){_0x196716=_0x196716||0xcc;return function(_0x3767ab){if(_0x3767ab){return _0x20ee86[_0x006d('0x16')](_0x196716);}return _0x20ee86[_0x006d('0x17')](_0x196716)[_0x006d('0x18')]();};}function respondWithResult(_0x3a7160,_0x5d9d07){_0x5d9d07=_0x5d9d07||0xc8;return function(_0x1089e6){if(_0x1089e6){return _0x3a7160[_0x006d('0x17')](_0x5d9d07)[_0x006d('0x19')](_0x1089e6);}};}function respondWithFilteredResult(_0x148631,_0x515c22){return function(_0x3f51af){if(_0x3f51af){var _0x169ce8=typeof _0x515c22['offset']==='undefined'&&typeof _0x515c22['limit']==='undefined';var _0x29c38c=_0x3f51af[_0x006d('0x1a')];var _0x29b6f7=_0x169ce8?0x0:_0x515c22[_0x006d('0x1b')];var _0x3283d6=_0x169ce8?_0x3f51af[_0x006d('0x1a')]:_0x515c22[_0x006d('0x1b')]+_0x515c22[_0x006d('0x1c')];var _0x22aa2b;if(_0x3283d6>=_0x29c38c){_0x3283d6=_0x29c38c;_0x22aa2b=0xc8;}else{_0x22aa2b=0xce;}_0x148631[_0x006d('0x17')](_0x22aa2b);return _0x148631[_0x006d('0x1d')](_0x006d('0x1e'),_0x29b6f7+'-'+_0x3283d6+'/'+_0x29c38c)[_0x006d('0x19')](_0x3f51af);}return null;};}function patchUpdates(_0x4c54f2){return function(_0xc24d17){try{jsonpatch[_0x006d('0x1f')](_0xc24d17,_0x4c54f2,!![]);}catch(_0x5e15f5){return BPromise['reject'](_0x5e15f5);}return _0xc24d17[_0x006d('0x20')]();};}function saveUpdates(_0x4c60d0,_0x5e3e81){return function(_0x35e136){if(_0x35e136){return _0x35e136['update'](_0x4c60d0)[_0x006d('0x21')](function(_0x12ca68){return _0x12ca68;});}return null;};}function removeEntity(_0x355eeb,_0x22e9bd){return function(_0x545d95){if(_0x545d95){return _0x545d95[_0x006d('0x22')]()[_0x006d('0x21')](function(){_0x355eeb[_0x006d('0x17')](0xcc)[_0x006d('0x18')]();});}};}function handleEntityNotFound(_0x407841,_0x26684d){return function(_0x548105){if(!_0x548105){_0x407841['sendStatus'](0x194);}return _0x548105;};}function handleError(_0xc92769,_0x59177e){_0x59177e=_0x59177e||0x1f4;return function(_0x330b3f){logger['error'](_0x330b3f[_0x006d('0x23')]);if(_0x330b3f[_0x006d('0x24')]){delete _0x330b3f[_0x006d('0x24')];}_0xc92769[_0x006d('0x17')](_0x59177e)[_0x006d('0x25')](_0x330b3f);};}exports['index']=function(_0xc456f4,_0xfd9167){var _0x15eb4b={},_0x5452fa={},_0x1ceb2a={'count':0x0,'rows':[]};var _0x119f35=_[_0x006d('0x26')](db[_0x006d('0x27')][_0x006d('0x28')],function(_0x4cbe88){return{'name':_0x4cbe88[_0x006d('0x29')],'type':_0x4cbe88[_0x006d('0x2a')]['key']};});_0x5452fa[_0x006d('0x2b')]=_['map'](_0x119f35,'name');_0x5452fa[_0x006d('0x2c')]=_[_0x006d('0x2d')](_0xc456f4[_0x006d('0x2c')]);_0x5452fa[_0x006d('0x2e')]=_[_0x006d('0x2f')](_0x5452fa[_0x006d('0x2b')],_0x5452fa['query']);_0x15eb4b[_0x006d('0x30')]=_[_0x006d('0x2f')](_0x5452fa[_0x006d('0x2b')],qs[_0x006d('0x31')](_0xc456f4[_0x006d('0x2c')][_0x006d('0x31')]));_0x15eb4b[_0x006d('0x30')]=_0x15eb4b['attributes'][_0x006d('0x32')]?_0x15eb4b[_0x006d('0x30')]:_0x5452fa[_0x006d('0x2b')];if(!_0xc456f4[_0x006d('0x2c')][_0x006d('0x33')](_0x006d('0x34'))){_0x15eb4b[_0x006d('0x1c')]=qs[_0x006d('0x1c')](_0xc456f4[_0x006d('0x2c')][_0x006d('0x1c')]);_0x15eb4b['offset']=qs['offset'](_0xc456f4[_0x006d('0x2c')]['offset']);}_0x15eb4b[_0x006d('0x35')]=qs[_0x006d('0x36')](_0xc456f4[_0x006d('0x2c')][_0x006d('0x36')]);_0x15eb4b['where']=qs[_0x006d('0x2e')](_['pick'](_0xc456f4[_0x006d('0x2c')],_0x5452fa[_0x006d('0x2e')]),_0x119f35);if(_0xc456f4[_0x006d('0x2c')][_0x006d('0x37')]){_0x15eb4b[_0x006d('0x38')]=_[_0x006d('0x39')](_0x15eb4b[_0x006d('0x38')],{'$or':_[_0x006d('0x26')](_0x119f35,function(_0x422fd0){if(_0x422fd0[_0x006d('0x2a')]!==_0x006d('0x3a')){var _0x57f86f={};_0x57f86f[_0x422fd0[_0x006d('0x24')]]={'$like':'%'+_0xc456f4[_0x006d('0x2c')][_0x006d('0x37')]+'%'};return _0x57f86f;}})});}_0x15eb4b=_[_0x006d('0x39')]({},_0x15eb4b,_0xc456f4[_0x006d('0x3b')]);var _0x2997d5={'where':_0x15eb4b[_0x006d('0x38')]};return db[_0x006d('0x27')][_0x006d('0x1a')](_0x2997d5)[_0x006d('0x21')](function(_0x477c1c){_0x1ceb2a[_0x006d('0x1a')]=_0x477c1c;if(_0xc456f4[_0x006d('0x2c')][_0x006d('0x3c')]){_0x15eb4b[_0x006d('0x3d')]=[{'all':!![]}];}return db[_0x006d('0x27')][_0x006d('0x3e')](_0x15eb4b);})[_0x006d('0x21')](function(_0x438161){_0x1ceb2a[_0x006d('0x3f')]=_0x438161;return _0x1ceb2a;})['then'](respondWithFilteredResult(_0xfd9167,_0x15eb4b))['catch'](handleError(_0xfd9167,null));};exports['show']=function(_0x4b22a3,_0x152478){var _0x2a8acd={'raw':!![],'where':{'id':_0x4b22a3[_0x006d('0x40')]['id']}},_0x25c1e5={};_0x25c1e5[_0x006d('0x2b')]=_[_0x006d('0x2d')](db['SquareDetailsReport'][_0x006d('0x28')]);_0x25c1e5[_0x006d('0x2c')]=_[_0x006d('0x2d')](_0x4b22a3[_0x006d('0x2c')]);_0x25c1e5[_0x006d('0x2e')]=_['intersection'](_0x25c1e5[_0x006d('0x2b')],_0x25c1e5[_0x006d('0x2c')]);_0x2a8acd[_0x006d('0x30')]=_[_0x006d('0x2f')](_0x25c1e5[_0x006d('0x2b')],qs['fields'](_0x4b22a3[_0x006d('0x2c')][_0x006d('0x31')]));_0x2a8acd[_0x006d('0x30')]=_0x2a8acd[_0x006d('0x30')][_0x006d('0x32')]?_0x2a8acd['attributes']:_0x25c1e5['model'];if(_0x4b22a3[_0x006d('0x2c')][_0x006d('0x3c')]){_0x2a8acd[_0x006d('0x3d')]=[{'all':!![]}];}_0x2a8acd=_[_0x006d('0x39')]({},_0x2a8acd,_0x4b22a3[_0x006d('0x3b')]);return db[_0x006d('0x27')][_0x006d('0x41')](_0x2a8acd)[_0x006d('0x21')](handleEntityNotFound(_0x152478,null))[_0x006d('0x21')](respondWithResult(_0x152478,null))['catch'](handleError(_0x152478,null));};exports[_0x006d('0x42')]=function(_0x26a2ad,_0xc0d576){return db[_0x006d('0x27')]['create'](_0x26a2ad[_0x006d('0x43')],{})[_0x006d('0x21')](respondWithResult(_0xc0d576,0xc9))[_0x006d('0x44')](handleError(_0xc0d576,null));};exports[_0x006d('0x45')]=function(_0x600240,_0xb64ca8){if(_0x600240[_0x006d('0x43')]['id']){delete _0x600240[_0x006d('0x43')]['id'];}return db[_0x006d('0x27')][_0x006d('0x41')]({'where':{'id':_0x600240[_0x006d('0x40')]['id']}})[_0x006d('0x21')](handleEntityNotFound(_0xb64ca8,null))[_0x006d('0x21')](saveUpdates(_0x600240[_0x006d('0x43')],null))[_0x006d('0x21')](respondWithResult(_0xb64ca8,null))[_0x006d('0x44')](handleError(_0xb64ca8,null));};exports[_0x006d('0x22')]=function(_0x1dd1b1,_0x39aac1){return db[_0x006d('0x27')][_0x006d('0x41')]({'where':{'id':_0x1dd1b1[_0x006d('0x40')]['id']}})[_0x006d('0x21')](handleEntityNotFound(_0x39aac1,null))[_0x006d('0x21')](removeEntity(_0x39aac1,null))[_0x006d('0x44')](handleError(_0x39aac1,null));};exports[_0x006d('0x46')]=function(_0x26daf7,_0x2ba5e8){return db['SquareDetailsReport'][_0x006d('0x46')]()[_0x006d('0x21')](respondWithResult(_0x2ba5e8,null))[_0x006d('0x44')](handleError(_0x2ba5e8,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b12b8af..d8f45c6 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 _0xb1c7=['define','SquareDetailsReport','report_square_details','lodash','moment','bluebird','request-promise','path','./squareReportDetail.attributes'];(function(_0x4333ff,_0x462bc7){var _0x288e58=function(_0x59208c){while(--_0x59208c){_0x4333ff['push'](_0x4333ff['shift']());}};_0x288e58(++_0x462bc7);}(_0xb1c7,0xa5));var _0x7b1c=function(_0x3265af,_0x505052){_0x3265af=_0x3265af-0x0;var _0x15955b=_0xb1c7[_0x3265af];return _0x15955b;};'use strict';var _=require(_0x7b1c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b1c('0x1'));var BPromise=require(_0x7b1c('0x2'));var rp=require(_0x7b1c('0x3'));var fs=require('fs');var path=require(_0x7b1c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b1c('0x5'));module['exports']=function(_0x261790,_0x3547cb){return _0x261790[_0x7b1c('0x6')](_0x7b1c('0x7'),attributes,{'tableName':_0x7b1c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f15=['request-promise','exports','define','SquareDetailsReport','report_square_details','lodash','util','bluebird'];(function(_0x44f25b,_0x53cda3){var _0x3ac7fa=function(_0x31cc14){while(--_0x31cc14){_0x44f25b['push'](_0x44f25b['shift']());}};_0x3ac7fa(++_0x53cda3);}(_0x9f15,0xf5));var _0x59f1=function(_0x1e77ed,_0x5720c1){_0x1e77ed=_0x1e77ed-0x0;var _0x32ed55=_0x9f15[_0x1e77ed];return _0x32ed55;};'use strict';var _=require(_0x59f1('0x0'));var util=require(_0x59f1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x59f1('0x2'));var rp=require(_0x59f1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x59f1('0x4')]=function(_0x502d6f,_0x5bd2cd){return _0x502d6f[_0x59f1('0x5')](_0x59f1('0x6'),attributes,{'tableName':_0x59f1('0x7'),'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 ac27cb9..e7a6224 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 _0x4bde=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','util'];(function(_0x1f20d6,_0x1b4431){var _0x2a7f7f=function(_0x3d4642){while(--_0x3d4642){_0x1f20d6['push'](_0x1f20d6['shift']());}};_0x2a7f7f(++_0x1b4431);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x598e2d,_0x68935c){_0x598e2d=_0x598e2d-0x0;var _0x38c5b6=_0x4bde[_0x598e2d];return _0x38c5b6;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});}exports[_0xe4bd('0x18')]=function(_0x5982f4){var _0x1731a1=this;return new Promise(function(_0x3dccd4,_0x544b3c){return db[_0xe4bd('0x19')]['create'](_0x5982f4['body'],{'raw':_0x5982f4[_0xe4bd('0x1a')]?_0x5982f4[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![]})[_0xe4bd('0xd')](function(_0x10a234){logger[_0xe4bd('0x15')](_0xe4bd('0x18'),_0x5982f4);logger['debug'](_0xe4bd('0x18'),_0x5982f4,JSON[_0xe4bd('0x1c')](_0x10a234));_0x3dccd4(_0x10a234);})['catch'](function(_0x2a5f40){logger[_0xe4bd('0x11')](_0xe4bd('0x18'),_0x2a5f40[_0xe4bd('0x14')],_0x5982f4);_0x544b3c(_0x1731a1[_0xe4bd('0x11')](0x1f4,_0x2a5f40[_0xe4bd('0x14')]));});});}; \ No newline at end of file +var _0xb7e7=['body','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x4767e9,_0x400195){var _0x31c58d=function(_0x3f066c){while(--_0x3f066c){_0x4767e9['push'](_0x4767e9['shift']());}};_0x31c58d(++_0x400195);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')](_0x242368[_0x7b7e('0x17')],{'raw':_0x242368[_0x7b7e('0x18')]?_0x242368[_0x7b7e('0x18')][_0x7b7e('0x19')]===undefined?!![]:![]:!![]})[_0x7b7e('0x9')](function(_0x49eddb){logger[_0x7b7e('0xa')](_0x7b7e('0x14'),_0x242368);logger[_0x7b7e('0xc')]('CreateSquareDetailsReport',_0x242368,JSON[_0x7b7e('0xf')](_0x49eddb));_0x2acb8c(_0x49eddb);})[_0x7b7e('0x13')](function(_0x14243b){logger[_0x7b7e('0x10')](_0x7b7e('0x14'),_0x14243b[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x14243b[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 15495ba..6a4f5ef 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 _0x10b9=['killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x56d35f,_0x53e1a5){var _0x5bf497=function(_0x4bcf24){while(--_0x4bcf24){_0x56d35f['push'](_0x56d35f['shift']());}};_0x5bf497(++_0x53e1a5);}(_0x10b9,0x197));var _0x910b=function(_0x37464d,_0x29bf11){_0x37464d=_0x37464d-0x0;var _0x4e7573=_0x10b9[_0x37464d];return _0x4e7573;};'use strict';var express=require('express');var router=express[_0x910b('0x0')]();var auth=require(_0x910b('0x1'));var controller=require(_0x910b('0x2'));router[_0x910b('0x3')]('/',auth[_0x910b('0x4')](),controller[_0x910b('0x5')]);router[_0x910b('0x3')](_0x910b('0x6'),auth[_0x910b('0x4')](),controller[_0x910b('0x7')]);module[_0x910b('0x8')]=router; \ No newline at end of file +var _0x857b=['get','/process/:pid/kill','express','../../components/auth/service','./system.controller','isAuthenticated','index'];(function(_0x339f00,_0xd23607){var _0x49cd8a=function(_0x305d89){while(--_0x305d89){_0x339f00['push'](_0x339f00['shift']());}};_0x49cd8a(++_0xd23607);}(_0x857b,0x19f));var _0xb857=function(_0x14e84f,_0x57818b){_0x14e84f=_0x14e84f-0x0;var _0x308101=_0x857b[_0x14e84f];return _0x308101;};'use strict';var express=require(_0xb857('0x0'));var router=express['Router']();var auth=require(_0xb857('0x1'));var controller=require(_0xb857('0x2'));router['get']('/',auth[_0xb857('0x3')](),controller[_0xb857('0x4')]);router[_0xb857('0x5')](_0xb857('0x6'),auth[_0xb857('0x3')](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3f44990..e96559a 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 _0xbf08=['lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','kill','pid','SIGINT','child_process','exec','../../config/logger','api','bluebird'];(function(_0x50a6fc,_0x412d44){var _0x950474=function(_0x2aca78){while(--_0x2aca78){_0x50a6fc['push'](_0x50a6fc['shift']());}};_0x950474(++_0x412d44);}(_0xbf08,0x10e));var _0x8bf0=function(_0x4165ba,_0x599acf){_0x4165ba=_0x4165ba-0x0;var _0x424300=_0xbf08[_0x4165ba];return _0x424300;};'use strict';var info=require('systeminformation');var exec=require(_0x8bf0('0x0'))[_0x8bf0('0x1')];var logger=require(_0x8bf0('0x2'))(_0x8bf0('0x3'));var util=require('util');var BPromise=require(_0x8bf0('0x4'));var _=require(_0x8bf0('0x5'));function handleError(_0x251afe,_0x242f1f,_0x5065c6){_0x242f1f=_0x242f1f||0x1f4;return function(_0x4ce470){logger['error'](_0x8bf0('0x6'),_0x5065c6,_0x242f1f,util[_0x8bf0('0x7')](_0x4ce470,{'showHidden':![],'depth':null}));delete _0x4ce470[_0x8bf0('0x8')];_0x251afe[_0x8bf0('0x9')](_0x242f1f)[_0x8bf0('0xa')](_0x4ce470);};}exports['index']=function(_0x5c0be8,_0x2444e8){return info[_0x8bf0('0xb')]()[_0x8bf0('0xc')](function(_0x562c96){return _0x2444e8[_0x8bf0('0x9')](0xc8)[_0x8bf0('0xd')](_0x562c96);})[_0x8bf0('0xe')](function(_0x31a1e2){return _0x2444e8[_0x8bf0('0x9')](0x1f4)[_0x8bf0('0xd')](_0x31a1e2);});};exports[_0x8bf0('0xf')]=function(_0x3d03db,_0x373cfe){var _0x45aa7f=[_0x8bf0('0x10')];return new BPromise(function(_0x968c9b,_0x396ec4){return exec(util[_0x8bf0('0x11')](_0x8bf0('0x12'),_0x3d03db[_0x8bf0('0x13')]['pid']),function(_0x37519a,_0x54dfb6,_0x42e70e){if(_0x37519a){return _0x396ec4(_0x37519a);}return _0x968c9b(_0x54dfb6);});})['then'](function(_0x207d31){var _0x4bd2b5=![];var _0x364003=_0x207d31[_0x8bf0('0x14')](/\n/);for(var _0x1bf902=0x0,_0x7dbef=_0x45aa7f[_0x8bf0('0x15')];_0x1bf902<_0x7dbef,_0x4bd2b5===![];_0x1bf902+=0x1){if(_0x207d31['indexOf'](_0x45aa7f[_0x1bf902])>=0x0){_0x4bd2b5=!![];}}if(!_0x4bd2b5){throw new Error(util[_0x8bf0('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3d03db[_0x8bf0('0x13')]['pid']));}process[_0x8bf0('0x16')](_0x3d03db[_0x8bf0('0x13')][_0x8bf0('0x17')],_0x8bf0('0x18'));return _0x373cfe['status'](0xc8)[_0x8bf0('0xd')]({'message':util[_0x8bf0('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3d03db['params'][_0x8bf0('0x17')])});})['catch'](handleError(_0x373cfe,null,_0x8bf0('0xf')));}; \ No newline at end of file +var _0x6839=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','params','catch','child_process','exec','../../config/logger','api','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','kill'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6839,0x1e7));var _0x9683=function(_0xb8d37c,_0x10a6a4){_0xb8d37c=_0xb8d37c-0x0;var _0x400f4b=_0x6839[_0xb8d37c];return _0x400f4b;};'use strict';var info=require('systeminformation');var exec=require(_0x9683('0x0'))[_0x9683('0x1')];var logger=require(_0x9683('0x2'))(_0x9683('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x575e73,_0x218d57,_0xa1cc00){_0x218d57=_0x218d57||0x1f4;return function(_0x4ee98b){logger['error'](_0x9683('0x4'),_0xa1cc00,_0x218d57,util[_0x9683('0x5')](_0x4ee98b,{'showHidden':![],'depth':null}));delete _0x4ee98b['name'];_0x575e73[_0x9683('0x6')](_0x218d57)[_0x9683('0x7')](_0x4ee98b);};}exports[_0x9683('0x8')]=function(_0x43a14b,_0x210c96){return info[_0x9683('0x9')]()[_0x9683('0xa')](function(_0x1a927e){return _0x210c96[_0x9683('0x6')](0xc8)[_0x9683('0xb')](_0x1a927e);})['catch'](function(_0x5200a8){return _0x210c96[_0x9683('0x6')](0x1f4)[_0x9683('0xb')](_0x5200a8);});};exports[_0x9683('0xc')]=function(_0x5bed3d,_0x546289){var _0xe86d9a=[_0x9683('0xd')];return new BPromise(function(_0x12a528,_0x4d7560){return exec(util[_0x9683('0xe')](_0x9683('0xf'),_0x5bed3d['params'][_0x9683('0x10')]),function(_0x4f6e95,_0x54e3bd,_0x45423e){if(_0x4f6e95){return _0x4d7560(_0x4f6e95);}return _0x12a528(_0x54e3bd);});})[_0x9683('0xa')](function(_0x52f148){var _0x75422a=![];var _0x272cfe=_0x52f148[_0x9683('0x11')](/\n/);for(var _0x20c481=0x0,_0x25187c=_0xe86d9a['length'];_0x20c481<_0x25187c,_0x75422a===![];_0x20c481+=0x1){if(_0x52f148['indexOf'](_0xe86d9a[_0x20c481])>=0x0){_0x75422a=!![];}}if(!_0x75422a){throw new Error(util[_0x9683('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5bed3d['params'][_0x9683('0x10')]));}process[_0x9683('0x12')](_0x5bed3d['params'][_0x9683('0x10')],_0x9683('0x13'));return _0x546289['status'](0xc8)['json']({'message':util[_0x9683('0xe')](_0x9683('0x14'),_0x5bed3d[_0x9683('0x15')][_0x9683('0x10')])});})[_0x9683('0x16')](handleError(_0x546289,null,_0x9683('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index be16723..a9ecf95 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 _0xef4d=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x1717a0,_0x3df0e9){var _0x4065f3=function(_0x54fce6){while(--_0x54fce6){_0x1717a0['push'](_0x1717a0['shift']());}};_0x4065f3(++_0x3df0e9);}(_0xef4d,0x165));var _0xdef4=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xef4d[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var path=require(_0xdef4('0x2'));var timeout=require(_0xdef4('0x3'));var express=require(_0xdef4('0x4'));var router=express[_0xdef4('0x5')]();var fs_extra=require(_0xdef4('0x6'));var auth=require(_0xdef4('0x7'));var interaction=require(_0xdef4('0x8'));var config=require(_0xdef4('0x9'));var controller=require(_0xdef4('0xa'));router[_0xdef4('0xb')]('/',auth[_0xdef4('0xc')](),controller['index']);router[_0xdef4('0xb')](_0xdef4('0xd'),auth[_0xdef4('0xc')](),controller[_0xdef4('0xe')]);router[_0xdef4('0xf')]('/',auth[_0xdef4('0xc')](),controller[_0xdef4('0x10')]);router[_0xdef4('0x11')](_0xdef4('0xd'),auth['isAuthenticated'](),controller[_0xdef4('0x12')]);router[_0xdef4('0x13')](_0xdef4('0xd'),auth[_0xdef4('0xc')](),controller[_0xdef4('0x14')]);module[_0xdef4('0x15')]=router; \ No newline at end of file +var _0xf7e2=['put','/:id','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','create'];(function(_0x31fdc5,_0x4176e4){var _0x2b9785=function(_0x30f6f2){while(--_0x30f6f2){_0x31fdc5['push'](_0x31fdc5['shift']());}};_0x2b9785(++_0x4176e4);}(_0xf7e2,0x191));var _0x2f7e=function(_0x24bbc9,_0x49c2c2){_0x24bbc9=_0x24bbc9-0x0;var _0x176a0b=_0xf7e2[_0x24bbc9];return _0x176a0b;};'use strict';var multer=require('multer');var util=require(_0x2f7e('0x0'));var path=require(_0x2f7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f7e('0x2'));var router=express['Router']();var fs_extra=require(_0x2f7e('0x3'));var auth=require(_0x2f7e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2f7e('0x5'));var controller=require(_0x2f7e('0x6'));router['get']('/',auth[_0x2f7e('0x7')](),controller[_0x2f7e('0x8')]);router[_0x2f7e('0x9')]('/:id',auth[_0x2f7e('0x7')](),controller[_0x2f7e('0xa')]);router[_0x2f7e('0xb')]('/',auth[_0x2f7e('0x7')](),controller[_0x2f7e('0xc')]);router[_0x2f7e('0xd')](_0x2f7e('0xe'),auth[_0x2f7e('0x7')](),controller['update']);router[_0x2f7e('0xf')](_0x2f7e('0xe'),auth['isAuthenticated'](),controller[_0x2f7e('0x10')]);module[_0x2f7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3589642..c74b9e5 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 _0x315f=['sequelize','STRING','#0091EA'];(function(_0x2d9a48,_0x1a435f){var _0x431da5=function(_0x18ac24){while(--_0x18ac24){_0x2d9a48['push'](_0x2d9a48['shift']());}};_0x431da5(++_0x1a435f);}(_0x315f,0x174));var _0xf315=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x315f[_0x1529a3];return _0x1a0d4b;};'use strict';var Sequelize=require(_0xf315('0x0'));module['exports']={'name':{'type':Sequelize[_0xf315('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xf315('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf151=['STRING','name','#0091EA'];(function(_0x178176,_0x326f1a){var _0x36c404=function(_0x4dfe90){while(--_0x4dfe90){_0x178176['push'](_0x178176['shift']());}};_0x36c404(++_0x326f1a);}(_0xf151,0xab));var _0x1f15=function(_0x4df26a,_0x3b3189){_0x4df26a=_0x4df26a-0x0;var _0x27c690=_0xf151[_0x4df26a];return _0x27c690;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1f15('0x0')],'unique':_0x1f15('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1f15('0x0')],'defaultValue':_0x1f15('0x2')},'description':{'type':Sequelize[_0x1f15('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index afcf858..1b1f79e 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 _0x3eec=['set','Content-Range','apply','reject','save','update','then','get','Tags','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','Tag','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit'];(function(_0xb13ab9,_0x111104){var _0x5bdc18=function(_0x284117){while(--_0x284117){_0xb13ab9['push'](_0xb13ab9['shift']());}};_0x5bdc18(++_0x111104);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x2169ce,_0x103234){_0x2169ce=_0x2169ce-0x0;var _0x696bb3=_0x3eec[_0x2169ce];return _0x696bb3;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){var _0x3f8f7b=_0x238df7[_0xc3ee('0x28')]({'plain':!![]});var _0xfd03bd=_0xc3ee('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd03bd,'resourceId':_0x3f8f7b['id']}})[_0xc3ee('0x27')](function(){return _0x238df7;});})[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x2a')]();});}};}function handleEntityNotFound(_0x836fac,_0x4ecfec){return function(_0x56201a){if(!_0x56201a){_0x836fac['sendStatus'](0x194);}return _0x56201a;};}function handleError(_0x1be005,_0x2f2c29){_0x2f2c29=_0x2f2c29||0x1f4;return function(_0x44678b){logger[_0xc3ee('0x2b')](_0x44678b[_0xc3ee('0x2c')]);if(_0x44678b['name']){delete _0x44678b[_0xc3ee('0x2d')];}_0x1be005[_0xc3ee('0x1b')](_0x2f2c29)[_0xc3ee('0x2e')](_0x44678b);};}exports[_0xc3ee('0x2f')]=function(_0x1f7b3a,_0x8bbe1e){var _0x3b17f7={},_0x4da264={},_0x330b71={'count':0x0,'rows':[]};var _0x35c19a=_[_0xc3ee('0x30')](db['Tag'][_0xc3ee('0x31')],function(_0x240a16){return{'name':_0x240a16[_0xc3ee('0x32')],'type':_0x240a16[_0xc3ee('0x33')][_0xc3ee('0x34')]};});_0x4da264[_0xc3ee('0x35')]=_[_0xc3ee('0x30')](_0x35c19a,'name');_0x4da264[_0xc3ee('0x36')]=_['keys'](_0x1f7b3a[_0xc3ee('0x36')]);_0x4da264[_0xc3ee('0x37')]=_[_0xc3ee('0x38')](_0x4da264[_0xc3ee('0x35')],_0x4da264[_0xc3ee('0x36')]);_0x3b17f7[_0xc3ee('0x39')]=_['intersection'](_0x4da264[_0xc3ee('0x35')],qs[_0xc3ee('0x3a')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3a')]));_0x3b17f7[_0xc3ee('0x39')]=_0x3b17f7[_0xc3ee('0x39')][_0xc3ee('0x3b')]?_0x3b17f7[_0xc3ee('0x39')]:_0x4da264[_0xc3ee('0x35')];if(!_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3c')](_0xc3ee('0x3d'))){_0x3b17f7[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x20')]);_0x3b17f7[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x1f')]);}_0x3b17f7[_0xc3ee('0x3e')]=qs['sort'](_0x1f7b3a[_0xc3ee('0x36')]['sort']);_0x3b17f7[_0xc3ee('0x3f')]=qs[_0xc3ee('0x37')](_[_0xc3ee('0x40')](_0x1f7b3a[_0xc3ee('0x36')],_0x4da264[_0xc3ee('0x37')]),_0x35c19a);if(_0x1f7b3a[_0xc3ee('0x36')]['filter']){_0x3b17f7[_0xc3ee('0x3f')]=_[_0xc3ee('0x41')](_0x3b17f7[_0xc3ee('0x3f')],{'$or':_['map'](_0x35c19a,function(_0x181179){if(_0x181179[_0xc3ee('0x33')]!==_0xc3ee('0x42')){var _0x1fe17f={};_0x1fe17f[_0x181179[_0xc3ee('0x2d')]]={'$like':'%'+_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x43')]+'%'};return _0x1fe17f;}})});}_0x3b17f7=_[_0xc3ee('0x41')]({},_0x3b17f7,_0x1f7b3a[_0xc3ee('0x44')]);var _0x23d365={'where':_0x3b17f7[_0xc3ee('0x3f')]};return db['Tag'][_0xc3ee('0x1e')](_0x23d365)[_0xc3ee('0x27')](function(_0x4a89b7){_0x330b71['count']=_0x4a89b7;if(_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x3b17f7[_0xc3ee('0x46')]=[{'all':!![]}];}return db['Tag'][_0xc3ee('0x47')](_0x3b17f7);})[_0xc3ee('0x27')](function(_0x112e77){_0x330b71[_0xc3ee('0x48')]=_0x112e77;return _0x330b71;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x8bbe1e,_0x3b17f7))[_0xc3ee('0x49')](handleError(_0x8bbe1e,null));};exports[_0xc3ee('0x4a')]=function(_0x724c4e,_0x49b424){var _0x602d47={'raw':!![],'where':{'id':_0x724c4e[_0xc3ee('0x4b')]['id']}},_0xf833d9={};_0xf833d9[_0xc3ee('0x35')]=_[_0xc3ee('0x4c')](db['Tag'][_0xc3ee('0x31')]);_0xf833d9['query']=_['keys'](_0x724c4e[_0xc3ee('0x36')]);_0xf833d9[_0xc3ee('0x37')]=_['intersection'](_0xf833d9[_0xc3ee('0x35')],_0xf833d9[_0xc3ee('0x36')]);_0x602d47['attributes']=_[_0xc3ee('0x38')](_0xf833d9['model'],qs[_0xc3ee('0x3a')](_0x724c4e['query'][_0xc3ee('0x3a')]));_0x602d47[_0xc3ee('0x39')]=_0x602d47['attributes']['length']?_0x602d47['attributes']:_0xf833d9[_0xc3ee('0x35')];if(_0x724c4e[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x602d47[_0xc3ee('0x46')]=[{'all':!![]}];}_0x602d47=_[_0xc3ee('0x41')]({},_0x602d47,_0x724c4e['options']);return db['Tag'][_0xc3ee('0x4d')](_0x602d47)[_0xc3ee('0x27')](handleEntityNotFound(_0x49b424,null))['then'](respondWithResult(_0x49b424,null))[_0xc3ee('0x49')](handleError(_0x49b424,null));};exports['create']=function(_0x60e36a,_0x5d0017){return db[_0xc3ee('0x4e')][_0xc3ee('0x4f')](_0x60e36a[_0xc3ee('0x50')],{})[_0xc3ee('0x27')](function(_0x8c8cc6){var _0x281adc=_0x60e36a[_0xc3ee('0x51')]['get']({'plain':!![]});if(!_0x281adc)throw new Error(_0xc3ee('0x52'));if(_0x281adc[_0xc3ee('0x53')]===_0xc3ee('0x51')){var _0x237aa8=_0x8c8cc6['get']({'plain':!![]});var _0xd246f2=_0xc3ee('0x29');return db[_0xc3ee('0x54')][_0xc3ee('0x4d')]({'where':{'name':_0xd246f2,'userProfileId':_0x281adc[_0xc3ee('0x55')]},'raw':!![]})[_0xc3ee('0x27')](function(_0x14df9d){if(_0x14df9d&&_0x14df9d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x237aa8['name'],'resourceId':_0x237aa8['id'],'type':_0x14df9d[_0xc3ee('0x2d')],'sectionId':_0x14df9d['id']},{})[_0xc3ee('0x27')](function(){return _0x8c8cc6;});}else{return _0x8c8cc6;}})[_0xc3ee('0x49')](function(_0x2b9ea){logger[_0xc3ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b9ea);throw _0x2b9ea;});}return _0x8c8cc6;})['then'](respondWithResult(_0x5d0017,0xc9))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports['update']=function(_0x1ca127,_0x28eca9){if(_0x1ca127[_0xc3ee('0x50')]['id']){delete _0x1ca127['body']['id'];}return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x1ca127[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x28eca9,null))[_0xc3ee('0x27')](saveUpdates(_0x1ca127[_0xc3ee('0x50')],null))[_0xc3ee('0x27')](respondWithResult(_0x28eca9,null))[_0xc3ee('0x49')](handleError(_0x28eca9,null));};exports[_0xc3ee('0x56')]=function(_0x5d5ca5,_0x3fdc8f){return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x5d5ca5[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x3fdc8f,null))[_0xc3ee('0x27')](removeEntity(_0x3fdc8f,null))[_0xc3ee('0x49')](handleError(_0x3fdc8f,null));}; \ No newline at end of file +var _0xde2c=['send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','get','Tags','UserProfileResource','then','error','stack','name'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xde2c,0x7f));var _0xcde2=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xde2c[_0xa79977];return _0x109f10;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){var _0x593aa4=_0xb2123c[_0xcde2('0x26')]({'plain':!![]});var _0x207a12=_0xcde2('0x27');return db[_0xcde2('0x28')][_0xcde2('0x25')]({'where':{'type':_0x207a12,'resourceId':_0x593aa4['id']}})['then'](function(){return _0xb2123c;});})[_0xcde2('0x29')](function(){_0x52368b[_0xcde2('0x1c')](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x513965,_0x2487eb){return function(_0x348ca1){if(!_0x348ca1){_0x513965[_0xcde2('0x1a')](0x194);}return _0x348ca1;};}function handleError(_0x40309d,_0xd7019){_0xd7019=_0xd7019||0x1f4;return function(_0x5b2b7){logger[_0xcde2('0x2a')](_0x5b2b7[_0xcde2('0x2b')]);if(_0x5b2b7['name']){delete _0x5b2b7[_0xcde2('0x2c')];}_0x40309d['status'](_0xd7019)[_0xcde2('0x2d')](_0x5b2b7);};}exports[_0xcde2('0x2e')]=function(_0x43706c,_0x49cb58){var _0xae46dc={},_0x28fedd={},_0x58afb1={'count':0x0,'rows':[]};var _0x26ec42=_[_0xcde2('0x2f')](db[_0xcde2('0x30')][_0xcde2('0x31')],function(_0x14f784){return{'name':_0x14f784[_0xcde2('0x32')],'type':_0x14f784[_0xcde2('0x33')][_0xcde2('0x34')]};});_0x28fedd['model']=_[_0xcde2('0x2f')](_0x26ec42,_0xcde2('0x2c'));_0x28fedd[_0xcde2('0x35')]=_[_0xcde2('0x36')](_0x43706c['query']);_0x28fedd[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],_0x28fedd[_0xcde2('0x35')]);_0xae46dc['attributes']=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x43706c[_0xcde2('0x35')]['fields']));_0xae46dc[_0xcde2('0x3b')]=_0xae46dc[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0xae46dc[_0xcde2('0x3b')]:_0x28fedd[_0xcde2('0x39')];if(!_0x43706c['query'][_0xcde2('0x3d')](_0xcde2('0x3e'))){_0xae46dc[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x43706c['query']['limit']);_0xae46dc[_0xcde2('0x20')]=qs[_0xcde2('0x20')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x20')]);}_0xae46dc[_0xcde2('0x3f')]=qs[_0xcde2('0x40')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x40')]);_0xae46dc[_0xcde2('0x41')]=qs['filters'](_[_0xcde2('0x42')](_0x43706c[_0xcde2('0x35')],_0x28fedd[_0xcde2('0x37')]),_0x26ec42);if(_0x43706c[_0xcde2('0x35')][_0xcde2('0x43')]){_0xae46dc['where']=_['merge'](_0xae46dc[_0xcde2('0x41')],{'$or':_[_0xcde2('0x2f')](_0x26ec42,function(_0x20dfad){if(_0x20dfad[_0xcde2('0x33')]!==_0xcde2('0x44')){var _0x1939a0={};_0x1939a0[_0x20dfad['name']]={'$like':'%'+_0x43706c['query']['filter']+'%'};return _0x1939a0;}})});}_0xae46dc=_[_0xcde2('0x45')]({},_0xae46dc,_0x43706c[_0xcde2('0x46')]);var _0x1cfe20={'where':_0xae46dc[_0xcde2('0x41')]};return db[_0xcde2('0x30')][_0xcde2('0x47')](_0x1cfe20)[_0xcde2('0x29')](function(_0x49b862){_0x58afb1['count']=_0x49b862;if(_0x43706c[_0xcde2('0x35')]['includeAll']){_0xae46dc[_0xcde2('0x48')]=[{'all':!![]}];}return db['Tag'][_0xcde2('0x49')](_0xae46dc);})[_0xcde2('0x29')](function(_0x2cf372){_0x58afb1['rows']=_0x2cf372;return _0x58afb1;})[_0xcde2('0x29')](respondWithFilteredResult(_0x49cb58,_0xae46dc))['catch'](handleError(_0x49cb58,null));};exports[_0xcde2('0x4a')]=function(_0x24a46a,_0x1e661f){var _0x79e073={'raw':!![],'where':{'id':_0x24a46a[_0xcde2('0x4b')]['id']}},_0xcafd7={};_0xcafd7['model']=_['keys'](db[_0xcde2('0x30')]['rawAttributes']);_0xcafd7['query']=_[_0xcde2('0x36')](_0x24a46a['query']);_0xcafd7[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0xcafd7['model'],_0xcafd7[_0xcde2('0x35')]);_0x79e073['attributes']=_['intersection'](_0xcafd7[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x24a46a['query'][_0xcde2('0x3a')]));_0x79e073['attributes']=_0x79e073[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0x79e073[_0xcde2('0x3b')]:_0xcafd7[_0xcde2('0x39')];if(_0x24a46a[_0xcde2('0x35')]['includeAll']){_0x79e073[_0xcde2('0x48')]=[{'all':!![]}];}_0x79e073=_[_0xcde2('0x45')]({},_0x79e073,_0x24a46a[_0xcde2('0x46')]);return db[_0xcde2('0x30')]['find'](_0x79e073)['then'](handleEntityNotFound(_0x1e661f,null))[_0xcde2('0x29')](respondWithResult(_0x1e661f,null))['catch'](handleError(_0x1e661f,null));};exports[_0xcde2('0x4c')]=function(_0x3e9e79,_0x381bd4){return db[_0xcde2('0x30')][_0xcde2('0x4c')](_0x3e9e79[_0xcde2('0x4d')],{})['then'](function(_0x1ce5fe){var _0x5b996d=_0x3e9e79[_0xcde2('0x4e')]['get']({'plain':!![]});if(!_0x5b996d)throw new Error(_0xcde2('0x4f'));if(_0x5b996d[_0xcde2('0x50')]===_0xcde2('0x4e')){var _0x16cddb=_0x1ce5fe[_0xcde2('0x26')]({'plain':!![]});var _0x5071ce='Tags';return db[_0xcde2('0x51')]['find']({'where':{'name':_0x5071ce,'userProfileId':_0x5b996d[_0xcde2('0x52')]},'raw':!![]})[_0xcde2('0x29')](function(_0x3d2ce7){if(_0x3d2ce7&&_0x3d2ce7[_0xcde2('0x53')]===0x0){return db[_0xcde2('0x28')][_0xcde2('0x4c')]({'name':_0x16cddb[_0xcde2('0x2c')],'resourceId':_0x16cddb['id'],'type':_0x3d2ce7[_0xcde2('0x2c')],'sectionId':_0x3d2ce7['id']},{})[_0xcde2('0x29')](function(){return _0x1ce5fe;});}else{return _0x1ce5fe;}})[_0xcde2('0x54')](function(_0x3c5a17){logger[_0xcde2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c5a17);throw _0x3c5a17;});}return _0x1ce5fe;})['then'](respondWithResult(_0x381bd4,0xc9))['catch'](handleError(_0x381bd4,null));};exports[_0xcde2('0x24')]=function(_0x59a64d,_0x1751dd){if(_0x59a64d[_0xcde2('0x4d')]['id']){delete _0x59a64d[_0xcde2('0x4d')]['id'];}return db['Tag'][_0xcde2('0x55')]({'where':{'id':_0x59a64d['params']['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x1751dd,null))['then'](saveUpdates(_0x59a64d[_0xcde2('0x4d')],null))[_0xcde2('0x29')](respondWithResult(_0x1751dd,null))['catch'](handleError(_0x1751dd,null));};exports[_0xcde2('0x25')]=function(_0x4dfabb,_0x5e6fd3){return db[_0xcde2('0x30')][_0xcde2('0x55')]({'where':{'id':_0x4dfabb[_0xcde2('0x4b')]['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x5e6fd3,null))[_0xcde2('0x29')](removeEntity(_0x5e6fd3,null))[_0xcde2('0x54')](handleError(_0x5e6fd3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 00a464e..8d8f141 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 _0x05b1=['./tag.attributes','exports','define','Tag','tools_tags','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x40939b,_0x4e93ce){var _0x41594d=function(_0x182656){while(--_0x182656){_0x40939b['push'](_0x40939b['shift']());}};_0x41594d(++_0x4e93ce);}(_0x05b1,0xf7));var _0x105b=function(_0x22ff00,_0x57f312){_0x22ff00=_0x22ff00-0x0;var _0x5007b8=_0x05b1[_0x22ff00];return _0x5007b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x105b('0x0'))(_0x105b('0x1'));var moment=require('moment');var BPromise=require(_0x105b('0x2'));var rp=require(_0x105b('0x3'));var fs=require('fs');var path=require(_0x105b('0x4'));var rimraf=require('rimraf');var config=require(_0x105b('0x5'));var attributes=require(_0x105b('0x6'));module[_0x105b('0x7')]=function(_0xe15268,_0x12cc5a){return _0xe15268[_0x105b('0x8')](_0x105b('0x9'),attributes,{'tableName':_0x105b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e08=['bluebird','rimraf','./tag.attributes','define','Tag','tools_tags','lodash','../../config/logger','api','moment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8e08,0xa6));var _0x88e0=function(_0x1ec0e8,_0x85b7ec){_0x1ec0e8=_0x1ec0e8-0x0;var _0x1830b8=_0x8e08[_0x1ec0e8];return _0x1830b8;};'use strict';var _=require(_0x88e0('0x0'));var util=require('util');var logger=require(_0x88e0('0x1'))(_0x88e0('0x2'));var moment=require(_0x88e0('0x3'));var BPromise=require(_0x88e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x88e0('0x6'));module['exports']=function(_0x553176,_0x3ff9ea){return _0x553176[_0x88e0('0x7')](_0x88e0('0x8'),attributes,{'tableName':_0x88e0('0x9'),'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 ddc172a..2b109dc 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 _0x5636=['code','Tag,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5636,0x102));var _0x6563=function(_0x2700b6,_0x4d7117){_0x2700b6=_0x2700b6-0x0;var _0x402c58=_0x5636[_0x2700b6];return _0x402c58;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0xc874=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment'];(function(_0x340d96,_0x4ff1fd){var _0x4374d2=function(_0x4f7e28){while(--_0x4f7e28){_0x340d96['push'](_0x340d96['shift']());}};_0x4374d2(++_0x4ff1fd);}(_0xc874,0x154));var _0x4c87=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xc874[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dafe0,_0x30c939,_0xdc4a29){return new BPromise(function(_0x116649,_0x5b7720){return client[_0x4c87('0x9')](_0x3dafe0,_0xdc4a29)['then'](function(_0x384268){logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,_0x4c87('0xc'));logger[_0x4c87('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x30c939,_0x4c87('0xc'),JSON[_0x4c87('0xe')](_0x384268));if(_0x384268['error']){if(_0x384268[_0x4c87('0xf')][_0x4c87('0x10')]===0x1f4){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')]['message']);return _0x5b7720(_0x384268['error']['message']);}logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);return _0x116649(_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);}else{logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,'request\x20sent');_0x116649(_0x384268[_0x4c87('0x12')][_0x4c87('0x11')]);}})['catch'](function(_0x575de5){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x575de5);_0x5b7720(_0x575de5);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index bd6ba8f..858bba9 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 0169c96..e58dcf3 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 _0xe706=['STRING','sequelize','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe706,0xa3));var _0x6e70=function(_0x4a8c17,_0x494a23){_0x4a8c17=_0x4a8c17-0x0;var _0x584d5e=_0xe706[_0x4a8c17];return _0x584d5e;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x166784,_0x3649a2){var _0x58c9d2=function(_0x4a942d){while(--_0x4a942d){_0x166784['push'](_0x166784['shift']());}};_0x58c9d2(++_0x3649a2);}(_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 e4fdc74..7ac189c 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 _0xf0c8=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','rawAttributes','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','user','get','role','Teams','userProfileId','autoAssociation','UserProfileResource','update','find','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','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','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','addQueues','findOne','add','Queues','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','penalty','User','Queue','Queue:save','QueueId','online','UserVoiceQueueRt','upsert','isNil','interface','format','voicePause','TeamVoiceQueue','all','spread','isArray','removeAgents','emit','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x4dfecb,_0x8d2259){var _0x4fc85c=function(_0x10bcf7){while(--_0x10bcf7){_0x4dfecb['push'](_0x4dfecb['shift']());}};_0x4fc85c(++_0x8d2259);}(_0xf0c8,0x88));var _0x8f0c=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xf0c8[_0x37c07d];return _0x10dadc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f0c('0x0'));var zipdir=require(_0x8f0c('0x1'));var jsonpatch=require(_0x8f0c('0x2'));var rp=require(_0x8f0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8f0c('0x4'));var path=require(_0x8f0c('0x5'));var sox=require(_0x8f0c('0x6'));var csv=require('to-csv');var ejs=require(_0x8f0c('0x7'));var fs=require('fs');var fs_extra=require(_0x8f0c('0x8'));var _=require('lodash');var squel=require(_0x8f0c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f0c('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8f0c('0xb'));var Papa=require(_0x8f0c('0xc'));var Redis=require(_0x8f0c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8f0c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f0c('0xf'))(_0x8f0c('0x10'));var utils=require(_0x8f0c('0x11'));var config=require(_0x8f0c('0x12'));var licenseUtil=require(_0x8f0c('0x13'));var db=require(_0x8f0c('0x14'))['db'];config[_0x8f0c('0x15')]=_[_0x8f0c('0x16')](config['redis'],{'host':_0x8f0c('0x17'),'port':0x18eb});var socket=require(_0x8f0c('0x18'))(new Redis(config[_0x8f0c('0x15')]));require(_0x8f0c('0x19'))[_0x8f0c('0x1a')](socket);function respondWithStatusCode(_0x51cca6,_0xedb3b8){_0xedb3b8=_0xedb3b8||0xcc;return function(_0x1d4aeb){if(_0x1d4aeb){return _0x51cca6[_0x8f0c('0x1b')](_0xedb3b8);}return _0x51cca6[_0x8f0c('0x1c')](_0xedb3b8)[_0x8f0c('0x1d')]();};}function respondWithResult(_0x4dfefa,_0x5a0416){_0x5a0416=_0x5a0416||0xc8;return function(_0x46e0ca){if(_0x46e0ca){return _0x4dfefa[_0x8f0c('0x1c')](_0x5a0416)[_0x8f0c('0x1e')](_0x46e0ca);}};}function respondWithFilteredResult(_0x2c0a33,_0x9cea15){return function(_0x43c3f2){if(_0x43c3f2){var _0x3b75dc=typeof _0x9cea15[_0x8f0c('0x1f')]===_0x8f0c('0x20')&&typeof _0x9cea15['limit']==='undefined';var _0x14cf24=_0x43c3f2[_0x8f0c('0x21')];var _0x27e917=_0x3b75dc?0x0:_0x9cea15[_0x8f0c('0x1f')];var _0x3dd90c=_0x3b75dc?_0x43c3f2[_0x8f0c('0x21')]:_0x9cea15[_0x8f0c('0x1f')]+_0x9cea15[_0x8f0c('0x22')];var _0x159bce;if(_0x3dd90c>=_0x14cf24){_0x3dd90c=_0x14cf24;_0x159bce=0xc8;}else{_0x159bce=0xce;}_0x2c0a33[_0x8f0c('0x1c')](_0x159bce);return _0x2c0a33[_0x8f0c('0x23')](_0x8f0c('0x24'),_0x27e917+'-'+_0x3dd90c+'/'+_0x14cf24)[_0x8f0c('0x1e')](_0x43c3f2);}return null;};}function patchUpdates(_0x4fd6a1){return function(_0x582334){try{jsonpatch[_0x8f0c('0x25')](_0x582334,_0x4fd6a1,!![]);}catch(_0x2c1037){return BPromise[_0x8f0c('0x26')](_0x2c1037);}return _0x582334[_0x8f0c('0x27')]();};}function saveUpdates(_0x34898f,_0x3cb6e7){return function(_0x3af69c){if(_0x3af69c){return _0x3af69c['update'](_0x34898f)[_0x8f0c('0x28')](function(_0x351415){return _0x351415;});}return null;};}function handleEntityNotFound(_0x1bc014,_0x5d694d){return function(_0x559721){if(!_0x559721){_0x1bc014[_0x8f0c('0x1b')](0x194);}return _0x559721;};}function handleError(_0x65000,_0x3000c8){_0x3000c8=_0x3000c8||0x1f4;return function(_0x632447){logger[_0x8f0c('0x29')](_0x632447[_0x8f0c('0x2a')]);if(_0x632447[_0x8f0c('0x2b')]){delete _0x632447[_0x8f0c('0x2b')];}_0x65000[_0x8f0c('0x1c')](_0x3000c8)[_0x8f0c('0x2c')](_0x632447);};}exports[_0x8f0c('0x2d')]=function(_0x1e5bc6,_0x488b53){var _0x2f4e58={},_0x4241c0={},_0x3f00ec={'count':0x0,'rows':[]};var _0x333e82=_['map'](db['Team'][_0x8f0c('0x2e')],function(_0x23a573){return{'name':_0x23a573['fieldName'],'type':_0x23a573[_0x8f0c('0x2f')][_0x8f0c('0x30')]};});_0x4241c0['model']=_['map'](_0x333e82,'name');_0x4241c0[_0x8f0c('0x31')]=_[_0x8f0c('0x32')](_0x1e5bc6[_0x8f0c('0x31')]);_0x4241c0['filters']=_['intersection'](_0x4241c0[_0x8f0c('0x33')],_0x4241c0[_0x8f0c('0x31')]);_0x2f4e58[_0x8f0c('0x34')]=_['intersection'](_0x4241c0[_0x8f0c('0x33')],qs[_0x8f0c('0x35')](_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x35')]));_0x2f4e58[_0x8f0c('0x34')]=_0x2f4e58[_0x8f0c('0x34')]['length']?_0x2f4e58['attributes']:_0x4241c0['model'];if(!_0x1e5bc6['query'][_0x8f0c('0x36')](_0x8f0c('0x37'))){_0x2f4e58['limit']=qs[_0x8f0c('0x22')](_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x22')]);_0x2f4e58[_0x8f0c('0x1f')]=qs[_0x8f0c('0x1f')](_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x1f')]);}_0x2f4e58['order']=qs[_0x8f0c('0x38')](_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x38')]);_0x2f4e58[_0x8f0c('0x39')]=qs[_0x8f0c('0x3a')](_[_0x8f0c('0x3b')](_0x1e5bc6[_0x8f0c('0x31')],_0x4241c0[_0x8f0c('0x3a')]),_0x333e82);if(_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x3c')]){_0x2f4e58[_0x8f0c('0x39')]=_[_0x8f0c('0x3d')](_0x2f4e58[_0x8f0c('0x39')],{'$or':_[_0x8f0c('0x3e')](_0x333e82,function(_0x43d159){if(_0x43d159[_0x8f0c('0x2f')]!==_0x8f0c('0x3f')){var _0x1c624c={};_0x1c624c[_0x43d159['name']]={'$like':'%'+_0x1e5bc6['query'][_0x8f0c('0x3c')]+'%'};return _0x1c624c;}})});}_0x2f4e58=_[_0x8f0c('0x3d')]({},_0x2f4e58,_0x1e5bc6[_0x8f0c('0x40')]);var _0x36ca3f={'where':_0x2f4e58['where']};return db[_0x8f0c('0x41')][_0x8f0c('0x21')](_0x36ca3f)[_0x8f0c('0x28')](function(_0x34226c){_0x3f00ec[_0x8f0c('0x21')]=_0x34226c;if(_0x1e5bc6[_0x8f0c('0x31')][_0x8f0c('0x42')]){_0x2f4e58[_0x8f0c('0x43')]=[{'all':!![]}];}return db['Team'][_0x8f0c('0x44')](_0x2f4e58);})['then'](function(_0xe21683){_0x3f00ec[_0x8f0c('0x45')]=_0xe21683;return _0x3f00ec;})[_0x8f0c('0x28')](respondWithFilteredResult(_0x488b53,_0x2f4e58))[_0x8f0c('0x46')](handleError(_0x488b53,null));};exports[_0x8f0c('0x47')]=function(_0x36c3e1,_0x29268a){var _0x38af9a={'raw':![],'where':{'id':_0x36c3e1[_0x8f0c('0x48')]['id']}},_0x227c80={};_0x227c80[_0x8f0c('0x33')]=_[_0x8f0c('0x32')](db[_0x8f0c('0x41')][_0x8f0c('0x2e')]);_0x227c80['query']=_[_0x8f0c('0x32')](_0x36c3e1[_0x8f0c('0x31')]);_0x227c80[_0x8f0c('0x3a')]=_[_0x8f0c('0x49')](_0x227c80[_0x8f0c('0x33')],_0x227c80[_0x8f0c('0x31')]);_0x38af9a['attributes']=_[_0x8f0c('0x49')](_0x227c80[_0x8f0c('0x33')],qs[_0x8f0c('0x35')](_0x36c3e1[_0x8f0c('0x31')][_0x8f0c('0x35')]));_0x38af9a['attributes']=_0x38af9a['attributes'][_0x8f0c('0x4a')]?_0x38af9a[_0x8f0c('0x34')]:_0x227c80[_0x8f0c('0x33')];if(_0x36c3e1['query'][_0x8f0c('0x42')]){_0x38af9a[_0x8f0c('0x43')]=[{'all':!![]}];}_0x38af9a=_[_0x8f0c('0x3d')]({},_0x38af9a,_0x36c3e1['options']);return db[_0x8f0c('0x41')]['find'](_0x38af9a)[_0x8f0c('0x28')](handleEntityNotFound(_0x29268a,null))[_0x8f0c('0x28')](respondWithResult(_0x29268a,null))['catch'](handleError(_0x29268a,null));};exports[_0x8f0c('0x4b')]=function(_0x3a2d84,_0x259bf1){return db[_0x8f0c('0x41')][_0x8f0c('0x4b')](_0x3a2d84[_0x8f0c('0x4c')],{})[_0x8f0c('0x28')](function(_0x50e449){var _0x2098d2=_0x3a2d84[_0x8f0c('0x4d')][_0x8f0c('0x4e')]({'plain':!![]});if(!_0x2098d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2098d2[_0x8f0c('0x4f')]==='user'){var _0x22f7ca=_0x50e449[_0x8f0c('0x4e')]({'plain':!![]});var _0x319d75=_0x8f0c('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x319d75,'userProfileId':_0x2098d2[_0x8f0c('0x51')]},'raw':!![]})[_0x8f0c('0x28')](function(_0x1b65e1){if(_0x1b65e1&&_0x1b65e1[_0x8f0c('0x52')]===0x0){return db[_0x8f0c('0x53')][_0x8f0c('0x4b')]({'name':_0x22f7ca[_0x8f0c('0x2b')],'resourceId':_0x22f7ca['id'],'type':_0x1b65e1[_0x8f0c('0x2b')],'sectionId':_0x1b65e1['id']},{})[_0x8f0c('0x28')](function(){return _0x50e449;});}else{return _0x50e449;}})[_0x8f0c('0x46')](function(_0x18bb00){logger[_0x8f0c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18bb00);throw _0x18bb00;});}return _0x50e449;})[_0x8f0c('0x28')](respondWithResult(_0x259bf1,0xc9))[_0x8f0c('0x46')](handleError(_0x259bf1,null));};exports[_0x8f0c('0x54')]=function(_0x2b80f2,_0x1d5919){if(_0x2b80f2[_0x8f0c('0x4c')]['id']){delete _0x2b80f2['body']['id'];}return db['Team'][_0x8f0c('0x55')]({'where':{'id':_0x2b80f2[_0x8f0c('0x48')]['id']}})[_0x8f0c('0x28')](handleEntityNotFound(_0x1d5919,null))[_0x8f0c('0x28')](saveUpdates(_0x2b80f2['body'],null))[_0x8f0c('0x28')](respondWithResult(_0x1d5919,null))[_0x8f0c('0x46')](handleError(_0x1d5919,null));};exports[_0x8f0c('0x56')]=function(_0x4abed1,_0x243fc2){var _0x492618=_0x4abed1[_0x8f0c('0x48')]['id'];var _0x341656=[];return db[_0x8f0c('0x57')]['transaction'](function(_0x3b938e){var _0x3b8f82=_0x8f0c('0x58')+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x3b8f82,{'type':db[_0x8f0c('0x59')][_0x8f0c('0x5a')][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e})[_0x8f0c('0x28')](function(_0x9548f8){_0x341656=_['map'](_0x9548f8,function(_0xf568ed){return Number(_0xf568ed[_0x8f0c('0x5c')]);});})[_0x8f0c('0x28')](function(){var _0x5e7a48='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x5e7a48,{'type':db[_0x8f0c('0x59')]['QueryTypes'][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x2e35b9){var _0x48753d=_[_0x8f0c('0x3e')](_0x2e35b9,function(_0x5e74dc){return Number(_0x5e74dc[_0x8f0c('0x5d')]);});return db[_0x8f0c('0x5e')][_0x8f0c('0x56')]({'where':{'UserId':{'$in':_0x341656},'VoiceQueueId':{'$in':_0x48753d}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x293b1c=_0x8f0c('0x5f')+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x293b1c,{'type':db[_0x8f0c('0x59')][_0x8f0c('0x5a')][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})['then'](function(_0x14bf15){var _0x251c1f=_[_0x8f0c('0x3e')](_0x14bf15,function(_0x3994e7){return Number(_0x3994e7[_0x8f0c('0x60')]);});return db['UserMailQueue'][_0x8f0c('0x56')]({'where':{'UserId':{'$in':_0x341656},'MailQueueId':{'$in':_0x251c1f}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x3c0d25=_0x8f0c('0x61')+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x3c0d25,{'type':db['Sequelize']['QueryTypes'][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x190421){var _0x48a68e=_[_0x8f0c('0x3e')](_0x190421,function(_0x249929){return Number(_0x249929[_0x8f0c('0x62')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x341656},'SmsQueueId':{'$in':_0x48a68e}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x5617a7=_0x8f0c('0x63')+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x5617a7,{'type':db[_0x8f0c('0x59')][_0x8f0c('0x5a')][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x559642){var _0x2ca57d=_[_0x8f0c('0x3e')](_0x559642,function(_0x3fd441){return Number(_0x3fd441[_0x8f0c('0x64')]);});return db[_0x8f0c('0x65')][_0x8f0c('0x56')]({'where':{'UserId':{'$in':_0x341656},'ChatQueueId':{'$in':_0x2ca57d}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x221626=_0x8f0c('0x66')+_0x492618;return db[_0x8f0c('0x57')]['query'](_0x221626,{'type':db[_0x8f0c('0x59')][_0x8f0c('0x5a')][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x52e515){var _0x155595=_[_0x8f0c('0x3e')](_0x52e515,function(_0x18d006){return Number(_0x18d006[_0x8f0c('0x67')]);});return db[_0x8f0c('0x68')]['destroy']({'where':{'UserId':{'$in':_0x341656},'FaxQueueId':{'$in':_0x155595}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x4a871d=_0x8f0c('0x69')+_0x492618;return db[_0x8f0c('0x57')][_0x8f0c('0x31')](_0x4a871d,{'type':db[_0x8f0c('0x59')][_0x8f0c('0x5a')]['SELECT'],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x3d249a){var _0x1d0bf0=_[_0x8f0c('0x3e')](_0x3d249a,function(_0x1ed366){return Number(_0x1ed366[_0x8f0c('0x6a')]);});return db[_0x8f0c('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x341656},'OpenchannelQueueId':{'$in':_0x1d0bf0}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){var _0x38cbc0='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x492618;return db[_0x8f0c('0x57')]['query'](_0x38cbc0,{'type':db['Sequelize'][_0x8f0c('0x5a')][_0x8f0c('0x5b')],'raw':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x1eeba9){var _0x1f2e62=_[_0x8f0c('0x3e')](_0x1eeba9,function(_0x435e3f){return Number(_0x435e3f['WhatsappQueueId']);});return db[_0x8f0c('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x341656},'WhatsappQueueId':{'$in':_0x1f2e62}},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){return db[_0x8f0c('0x6d')][_0x8f0c('0x55')]({'where':{'TeamId':_0x492618}});})[_0x8f0c('0x28')](function(_0x1730a0){if(_0x1730a0===null){return;}return db[_0x8f0c('0x6e')][_0x8f0c('0x56')]({'where':{'UserId':{'$in':_0x341656},'VoicePrefixId':_0x1730a0[_0x8f0c('0x6f')]},'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(){return db[_0x8f0c('0x41')][_0x8f0c('0x56')]({'where':{'id':_0x492618},'cascade':!![],'transaction':_0x3b938e});})[_0x8f0c('0x28')](function(_0x496ec4){if(_0x496ec4===0x0){_0x243fc2[_0x8f0c('0x1b')](0x194);}else{return db[_0x8f0c('0x53')][_0x8f0c('0x56')]({'where':{'type':'Teams','resourceId':_0x492618},'cascade':!![],'transaction':_0x3b938e})[_0x8f0c('0x28')](function(){_0x243fc2[_0x8f0c('0x1c')](0xcc)[_0x8f0c('0x1d')]();});}})[_0x8f0c('0x46')](function(_0x21efb7){_0x243fc2['status'](0x1f4)[_0x8f0c('0x2c')](_0x21efb7);});});};exports['getQueues']=function(_0x5028c5,_0x148cbf,_0x2c2c09){return db[_0x8f0c('0x41')]['findOne']({'where':{'id':_0x5028c5[_0x8f0c('0x48')]['id']}})['then'](handleEntityNotFound(_0x148cbf,null))[_0x8f0c('0x28')](function(_0x812981){if(!_0x5028c5[_0x8f0c('0x31')]['channel']||!utils[_0x8f0c('0x70')](_0x5028c5[_0x8f0c('0x31')][_0x8f0c('0x71')])){throw new db['Sequelize'][(_0x8f0c('0x72'))](_0x8f0c('0x73'));}var _0x47213b={};var _0x17c38f={};_0x17c38f['model']=_[_0x8f0c('0x32')](db[_[_0x8f0c('0x74')](_0x5028c5[_0x8f0c('0x31')]['channel']['toLowerCase']())+'Queue']['rawAttributes']);_0x17c38f[_0x8f0c('0x31')]=_[_0x8f0c('0x32')](_0x5028c5[_0x8f0c('0x31')]);_0x17c38f[_0x8f0c('0x3a')]=_[_0x8f0c('0x49')](_0x17c38f[_0x8f0c('0x33')],_0x17c38f[_0x8f0c('0x31')]);_0x47213b[_0x8f0c('0x34')]=_[_0x8f0c('0x49')](_0x17c38f[_0x8f0c('0x33')],qs['fields'](_0x5028c5[_0x8f0c('0x31')][_0x8f0c('0x35')]));_0x47213b[_0x8f0c('0x34')]=_0x47213b[_0x8f0c('0x34')]['length']?_0x47213b[_0x8f0c('0x34')]:_0x17c38f[_0x8f0c('0x33')];_0x47213b['limit']=qs[_0x8f0c('0x22')](_0x5028c5[_0x8f0c('0x31')][_0x8f0c('0x22')]);_0x47213b[_0x8f0c('0x1f')]=qs['offset'](_0x5028c5[_0x8f0c('0x31')]['offset']);_0x47213b['order']=qs[_0x8f0c('0x38')](_0x5028c5['query'][_0x8f0c('0x38')]);_0x47213b[_0x8f0c('0x39')]=qs['filters'](_[_0x8f0c('0x3b')](_0x5028c5['query'],_0x17c38f[_0x8f0c('0x3a')]));_0x47213b=_[_0x8f0c('0x3d')]({},_0x47213b,_0x5028c5[_0x8f0c('0x40')]);return _0x812981[_0x8f0c('0x4e')+_[_0x8f0c('0x74')](_0x5028c5[_0x8f0c('0x31')]['channel'][_0x8f0c('0x75')]())+'Queues'](_0x47213b);})[_0x8f0c('0x28')](respondWithResult(_0x148cbf,null))[_0x8f0c('0x46')](handleError(_0x148cbf,null));};exports[_0x8f0c('0x76')]=function(_0x1f131e,_0x5a6c9f,_0x4ff0e8){return db[_0x8f0c('0x41')][_0x8f0c('0x77')]({'where':{'id':_0x1f131e[_0x8f0c('0x48')]['id']}})[_0x8f0c('0x28')](function(_0x1797d7){if(_0x1797d7){if(!_0x1f131e[_0x8f0c('0x4c')][_0x8f0c('0x71')]||!utils[_0x8f0c('0x70')](_0x1f131e[_0x8f0c('0x4c')][_0x8f0c('0x71')])){throw new db[(_0x8f0c('0x59'))][(_0x8f0c('0x72'))]('Unknown\x20channel');}return _0x1797d7[_0x8f0c('0x78')+_[_0x8f0c('0x74')](_0x1f131e[_0x8f0c('0x4c')][_0x8f0c('0x71')][_0x8f0c('0x75')]())+_0x8f0c('0x79')](_0x1f131e[_0x8f0c('0x4c')][_0x8f0c('0x7a')]);}return null;})[_0x8f0c('0x28')](handleEntityNotFound(_0x5a6c9f,null))[_0x8f0c('0x28')](respondWithStatusCode(_0x5a6c9f,null))[_0x8f0c('0x46')](handleError(_0x5a6c9f,null));};exports[_0x8f0c('0x7b')]=function(_0x213cff,_0x5ae796,_0x16384c){return db[_0x8f0c('0x41')][_0x8f0c('0x77')]({'where':{'id':_0x213cff[_0x8f0c('0x48')]['id']}})[_0x8f0c('0x28')](function(_0x29b4f1){if(_0x29b4f1){if(!_0x213cff['query'][_0x8f0c('0x71')]||!utils[_0x8f0c('0x70')](_0x213cff[_0x8f0c('0x31')][_0x8f0c('0x71')])){throw new db[(_0x8f0c('0x59'))][(_0x8f0c('0x72'))]('Unknown\x20channel');}return _0x29b4f1[_0x8f0c('0x7c')+_['capitalize'](_0x213cff[_0x8f0c('0x31')]['channel']['toLowerCase']())+_0x8f0c('0x79')](_0x213cff['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x5ae796,null))['then'](respondWithStatusCode(_0x5ae796,null))['catch'](handleError(_0x5ae796,null));};exports[_0x8f0c('0x7d')]=function(_0x31a22d,_0xae5cc2){var _0x135aca=_['isArray'](_0x31a22d[_0x8f0c('0x4c')][_0x8f0c('0x7a')])?_0x31a22d[_0x8f0c('0x4c')][_0x8f0c('0x7a')]:[_0x31a22d[_0x8f0c('0x4c')]['ids']];var _0x8607c=_0x31a22d['params']['id'];return db[_0x8f0c('0x41')][_0x8f0c('0x55')]({'where':{'id':_0x8607c}})[_0x8f0c('0x28')](handleEntityNotFound(_0xae5cc2,null))['then'](function(_0x397422){if(_0x397422){var _0x1e83ad=['Voice',_0x8f0c('0x7e'),_0x8f0c('0x7f'),_0x8f0c('0x80'),_0x8f0c('0x81'),_0x8f0c('0x82'),_0x8f0c('0x83')];return db[_0x8f0c('0x57')][_0x8f0c('0x84')](function(_0xe5e9d6){var _0x31b127=_[_0x8f0c('0x3e')](_0x1e83ad,function(_0x111479){var _0x5417df={'attributes':['id',_0x8f0c('0x2b')]};if(_0x111479===_0x8f0c('0x85')){_0x5417df[_0x8f0c('0x86')]={'attributes':[_0x8f0c('0x87')]};}return _0x397422[_0x8f0c('0x4e')+_0x111479+_0x8f0c('0x79')](_0x5417df)['then'](function(_0x1d47a2){var _0x3dc48a=_[_0x8f0c('0x3e')](_0x1d47a2,function(_0x222311){var _0x21d576=_[_0x8f0c('0x3e')](_0x135aca,function(_0x137005){var _0x572563={'where':{'UserId':_0x137005,[_0x111479+'QueueId']:_0x222311['id']},'transaction':_0xe5e9d6};if(_0x111479===_0x8f0c('0x85')){_0x572563[_0x8f0c('0x16')]={'penalty':_0x222311['TeamVoiceQueue']['penalty']};}return db[_0x8f0c('0x88')+_0x111479+_0x8f0c('0x89')]['findOrCreate'](_0x572563)[_0x8f0c('0x28')](function(){socket['emit'](_0x8f0c('0x4d')+_0x111479+_0x8f0c('0x8a'),{'UserId':_0x137005,[_0x111479+_0x8f0c('0x8b')]:_0x222311['id']});if(_0x111479!==_0x8f0c('0x85')){return;}return db[_0x8f0c('0x88')]['findAll']({'where':{'id':_0x135aca,'online':0x1},'attributes':['id','name',_0x8f0c('0x8c'),'voicePause','interface'],'raw':!![]})[_0x8f0c('0x28')](function(_0x91097d){var _0x5caae2=_[_0x8f0c('0x3e')](_0x91097d,function(_0x1b4cbc){return db[_0x8f0c('0x8d')][_0x8f0c('0x8e')]({'membername':_0x1b4cbc[_0x8f0c('0x2b')],'UserId':_0x1b4cbc['id'],'queue_name':_0x222311['name'],'VoiceQueueId':_0x222311['id'],'interface':_[_0x8f0c('0x8f')](_0x1b4cbc[_0x8f0c('0x90')])?util[_0x8f0c('0x91')]('SIP/%s',_0x1b4cbc[_0x8f0c('0x2b')]):_0x1b4cbc[_0x8f0c('0x90')],'paused':_0x1b4cbc[_0x8f0c('0x92')]||![],'penalty':_0x222311[_0x8f0c('0x93')][_0x8f0c('0x87')]},{'transaction':_0xe5e9d6});});return Promise[_0x8f0c('0x94')](_0x5caae2);});});});return Promise['all'](_0x21d576);});return Promise[_0x8f0c('0x94')](_0x3dc48a);})[_0x8f0c('0x28')](function(){return db[_0x8f0c('0x6d')]['findOne']({'where':{'teamId':_0x8607c}})[_0x8f0c('0x28')](function(_0x557818){if(_0x557818){var _0x489ba9=_[_0x8f0c('0x3e')](_0x135aca,function(_0x39f1e9){db['UserVoicePrefix']['upsert']({'UserId':_0x39f1e9,'VoicePrefixId':_0x557818[_0x8f0c('0x6f')]});});return Promise[_0x8f0c('0x94')](_0x489ba9);}});});});return Promise[_0x8f0c('0x94')](_0x31b127)[_0x8f0c('0x28')](function(){return _0x397422[_0x8f0c('0x7d')](_0x135aca,{'transaction':_0xe5e9d6})[_0x8f0c('0x95')](function(_0x18f51c){return _0x18f51c;});});});}})[_0x8f0c('0x28')](respondWithResult(_0xae5cc2,null))[_0x8f0c('0x46')](handleError(_0xae5cc2,null));};exports['removeAgents']=function(_0x579142,_0x3f0fbf){var _0x5d553f=_[_0x8f0c('0x96')](_0x579142['query'][_0x8f0c('0x7a')])?_0x579142[_0x8f0c('0x31')][_0x8f0c('0x7a')]:[_0x579142[_0x8f0c('0x31')]['ids']];var _0x154a8d=_0x579142[_0x8f0c('0x48')]['id'];return db['Team'][_0x8f0c('0x55')]({'where':{'id':_0x154a8d}})[_0x8f0c('0x28')](handleEntityNotFound(_0x3f0fbf,null))[_0x8f0c('0x28')](function(_0x48ecb4){if(_0x48ecb4){var _0x179508=['Voice',_0x8f0c('0x7e'),_0x8f0c('0x7f'),'Sms',_0x8f0c('0x81'),'Openchannel',_0x8f0c('0x83')];return db['sequelize'][_0x8f0c('0x84')](function(_0xf67b63){var _0x573a4c=_[_0x8f0c('0x3e')](_0x179508,function(_0x4d02e9){var _0x435655={'attributes':['id',_0x8f0c('0x2b')]};return _0x48ecb4[_0x8f0c('0x4e')+_0x4d02e9+_0x8f0c('0x79')](_0x435655)[_0x8f0c('0x28')](function(_0x295145){var _0x1d3684=_['map'](_0x295145,function(_0x5b4a97){return _0x5b4a97[_0x8f0c('0x97')](_0x5d553f,{'transaction':_0xf67b63})['then'](function(){var _0x217b43=_[_0x8f0c('0x3e')](_0x5d553f,function(_0x3de529){socket[_0x8f0c('0x98')](_0x8f0c('0x4d')+_0x4d02e9+'Queue:remove',{'UserId':Number(_0x3de529),[_0x4d02e9+_0x8f0c('0x8b')]:_0x5b4a97['id']});if(_0x4d02e9!==_0x8f0c('0x85')){return;}return db[_0x8f0c('0x8d')][_0x8f0c('0x56')]({'where':{'VoiceQueueId':_0x5b4a97['id'],'UserId':_0x3de529},'transaction':_0xf67b63});});return Promise[_0x8f0c('0x94')](_0x217b43);});});return Promise[_0x8f0c('0x94')](_0x1d3684);});});return Promise[_0x8f0c('0x94')](_0x573a4c)[_0x8f0c('0x28')](function(){return _0x48ecb4[_0x8f0c('0x97')](_0x5d553f,{'transaction':_0xf67b63});})[_0x8f0c('0x28')](function(){return db[_0x8f0c('0x6d')][_0x8f0c('0x77')]({'where':{'teamId':_0x154a8d}})[_0x8f0c('0x28')](function(_0xb187b2){if(_0xb187b2){var _0x5a230d=_['map'](_0x5d553f,function(_0x3ee434){db[_0x8f0c('0x6e')][_0x8f0c('0x56')]({'where':{'UserId':_0x3ee434,'VoicePrefixId':_0xb187b2['VoicePrefixId']}});});return Promise['all'](_0x5a230d);}});});});}})['then'](respondWithStatusCode(_0x3f0fbf,null))['catch'](handleError(_0x3f0fbf,null));};exports[_0x8f0c('0x99')]=function(_0x4e583d,_0x47cf01,_0x419b22){var _0x88c886={};var _0x149c62={};var _0x45c24;var _0x31f32c;return db[_0x8f0c('0x41')]['findOne']({'where':{'id':_0x4e583d[_0x8f0c('0x48')]['id']}})[_0x8f0c('0x28')](handleEntityNotFound(_0x47cf01,null))[_0x8f0c('0x28')](function(_0x1b612e){if(_0x1b612e){_0x45c24=_0x1b612e;_0x149c62[_0x8f0c('0x33')]=_[_0x8f0c('0x32')](db[_0x8f0c('0x88')][_0x8f0c('0x2e')]);_0x149c62[_0x8f0c('0x31')]=_['keys'](_0x4e583d['query']);_0x149c62['filters']=_[_0x8f0c('0x49')](_0x149c62[_0x8f0c('0x33')],_0x149c62[_0x8f0c('0x31')]);_0x88c886['attributes']=_[_0x8f0c('0x49')](_0x149c62['model'],qs[_0x8f0c('0x35')](_0x4e583d[_0x8f0c('0x31')][_0x8f0c('0x35')]));_0x88c886[_0x8f0c('0x34')]=_0x88c886[_0x8f0c('0x34')][_0x8f0c('0x4a')]?_0x88c886['attributes']:_0x149c62['model'];_0x88c886['order']=qs[_0x8f0c('0x38')](_0x4e583d['query'][_0x8f0c('0x38')]);_0x88c886[_0x8f0c('0x39')]=qs[_0x8f0c('0x3a')](_[_0x8f0c('0x3b')](_0x4e583d[_0x8f0c('0x31')],_0x149c62[_0x8f0c('0x3a')]));if(_0x4e583d[_0x8f0c('0x31')]['filter']){_0x88c886[_0x8f0c('0x39')]=_[_0x8f0c('0x3d')](_0x88c886[_0x8f0c('0x39')],{'$or':_[_0x8f0c('0x3e')](_0x88c886[_0x8f0c('0x34')],function(_0xbf4e55){var _0x419d67={};_0x419d67[_0xbf4e55]={'$like':'%'+_0x4e583d[_0x8f0c('0x31')]['filter']+'%'};return _0x419d67;})});}_0x88c886=_[_0x8f0c('0x3d')]({},_0x88c886,_0x4e583d[_0x8f0c('0x40')]);return _0x45c24['getAgents'](_0x88c886);}})[_0x8f0c('0x28')](function(_0x47bc8c){if(_0x47bc8c){_0x31f32c=_0x47bc8c['length'];if(!_0x4e583d[_0x8f0c('0x31')][_0x8f0c('0x36')]('nolimit')){_0x88c886[_0x8f0c('0x22')]=qs[_0x8f0c('0x22')](_0x4e583d[_0x8f0c('0x31')]['limit']);_0x88c886[_0x8f0c('0x1f')]=qs['offset'](_0x4e583d[_0x8f0c('0x31')][_0x8f0c('0x1f')]);}return _0x45c24[_0x8f0c('0x99')](_0x88c886);}})[_0x8f0c('0x28')](function(_0x188262){if(_0x188262){return _0x188262?{'count':_0x31f32c,'rows':_0x188262}:null;}})[_0x8f0c('0x28')](respondWithResult(_0x47cf01,null))[_0x8f0c('0x46')](handleError(_0x47cf01,null));}; \ No newline at end of file +var _0x22d5=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','offset','undefined','limit','set','apply','reject','save','update','then','error','stack','send','index','map','Team','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','length','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','Teams','findOne','channel','ValidationError','capitalize','toLowerCase','Queues','isValidChannel','Unknown\x20channel','add','ids','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','penalty','get','QueueId','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','VoicePrefixId','removeAgents','Fax','Whatsapp','Queue:remove','TeamVoicePrefix','getAgents','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto'];(function(_0x322d02,_0x3652cc){var _0x43c01c=function(_0x2dca59){while(--_0x2dca59){_0x322d02['push'](_0x322d02['shift']());}};_0x43c01c(++_0x3652cc);}(_0x22d5,0x92));var _0x522d=function(_0x2d5f67,_0x125f70){_0x2d5f67=_0x2d5f67-0x0;var _0x4c0890=_0x22d5[_0x2d5f67];return _0x4c0890;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x522d('0x0'));var zipdir=require(_0x522d('0x1'));var jsonpatch=require(_0x522d('0x2'));var rp=require(_0x522d('0x3'));var moment=require('moment');var BPromise=require(_0x522d('0x4'));var Mustache=require(_0x522d('0x5'));var util=require(_0x522d('0x6'));var path=require(_0x522d('0x7'));var sox=require(_0x522d('0x8'));var csv=require('to-csv');var ejs=require(_0x522d('0x9'));var fs=require('fs');var fs_extra=require(_0x522d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x522d('0xb'));var jsforce=require(_0x522d('0xc'));var deskjs=require(_0x522d('0xd'));var toCsv=require(_0x522d('0xe'));var querystring=require(_0x522d('0xf'));var Papa=require(_0x522d('0x10'));var Redis=require(_0x522d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x522d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x522d('0x13'));var logger=require(_0x522d('0x14'))(_0x522d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x522d('0x16'));var db=require(_0x522d('0x17'))['db'];config[_0x522d('0x18')]=_[_0x522d('0x19')](config[_0x522d('0x18')],{'host':_0x522d('0x1a'),'port':0x18eb});var socket=require(_0x522d('0x1b'))(new Redis(config[_0x522d('0x18')]));require(_0x522d('0x1c'))['register'](socket);function respondWithStatusCode(_0x2e73e2,_0x2e2ab4){_0x2e2ab4=_0x2e2ab4||0xcc;return function(_0x4a5ae7){if(_0x4a5ae7){return _0x2e73e2[_0x522d('0x1d')](_0x2e2ab4);}return _0x2e73e2[_0x522d('0x1e')](_0x2e2ab4)[_0x522d('0x1f')]();};}function respondWithResult(_0x4fb60e,_0x336553){_0x336553=_0x336553||0xc8;return function(_0x1c8155){if(_0x1c8155){return _0x4fb60e[_0x522d('0x1e')](_0x336553)['json'](_0x1c8155);}};}function respondWithFilteredResult(_0x5bb0f3,_0x52a95d){return function(_0x161a9a){if(_0x161a9a){var _0x5632b8=typeof _0x52a95d[_0x522d('0x20')]===_0x522d('0x21')&&typeof _0x52a95d[_0x522d('0x22')]===_0x522d('0x21');var _0x29f86e=_0x161a9a['count'];var _0x2b47a3=_0x5632b8?0x0:_0x52a95d[_0x522d('0x20')];var _0x4471ee=_0x5632b8?_0x161a9a['count']:_0x52a95d[_0x522d('0x20')]+_0x52a95d[_0x522d('0x22')];var _0x3fe586;if(_0x4471ee>=_0x29f86e){_0x4471ee=_0x29f86e;_0x3fe586=0xc8;}else{_0x3fe586=0xce;}_0x5bb0f3[_0x522d('0x1e')](_0x3fe586);return _0x5bb0f3[_0x522d('0x23')]('Content-Range',_0x2b47a3+'-'+_0x4471ee+'/'+_0x29f86e)['json'](_0x161a9a);}return null;};}function patchUpdates(_0x2a0492){return function(_0x36b2cd){try{jsonpatch[_0x522d('0x24')](_0x36b2cd,_0x2a0492,!![]);}catch(_0xacea72){return BPromise[_0x522d('0x25')](_0xacea72);}return _0x36b2cd[_0x522d('0x26')]();};}function saveUpdates(_0x37f9d2,_0x65a45c){return function(_0x4d6d59){if(_0x4d6d59){return _0x4d6d59[_0x522d('0x27')](_0x37f9d2)[_0x522d('0x28')](function(_0x3430c5){return _0x3430c5;});}return null;};}function handleEntityNotFound(_0x5f59f8,_0x3e7729){return function(_0x4443f1){if(!_0x4443f1){_0x5f59f8[_0x522d('0x1d')](0x194);}return _0x4443f1;};}function handleError(_0x46f328,_0x46bcb9){_0x46bcb9=_0x46bcb9||0x1f4;return function(_0x5a2658){logger[_0x522d('0x29')](_0x5a2658[_0x522d('0x2a')]);if(_0x5a2658['name']){delete _0x5a2658['name'];}_0x46f328['status'](_0x46bcb9)[_0x522d('0x2b')](_0x5a2658);};}exports[_0x522d('0x2c')]=function(_0x27eaa8,_0x1b8b97){var _0x3d982e={},_0x6ef1ac={},_0x2e6138={'count':0x0,'rows':[]};var _0x58729a=_[_0x522d('0x2d')](db[_0x522d('0x2e')][_0x522d('0x2f')],function(_0x3a3923){return{'name':_0x3a3923[_0x522d('0x30')],'type':_0x3a3923[_0x522d('0x31')][_0x522d('0x32')]};});_0x6ef1ac['model']=_[_0x522d('0x2d')](_0x58729a,_0x522d('0x33'));_0x6ef1ac['query']=_[_0x522d('0x34')](_0x27eaa8[_0x522d('0x35')]);_0x6ef1ac[_0x522d('0x36')]=_[_0x522d('0x37')](_0x6ef1ac[_0x522d('0x38')],_0x6ef1ac[_0x522d('0x35')]);_0x3d982e[_0x522d('0x39')]=_[_0x522d('0x37')](_0x6ef1ac[_0x522d('0x38')],qs['fields'](_0x27eaa8[_0x522d('0x35')][_0x522d('0x3a')]));_0x3d982e[_0x522d('0x39')]=_0x3d982e['attributes']['length']?_0x3d982e[_0x522d('0x39')]:_0x6ef1ac[_0x522d('0x38')];if(!_0x27eaa8['query'][_0x522d('0x3b')](_0x522d('0x3c'))){_0x3d982e['limit']=qs['limit'](_0x27eaa8[_0x522d('0x35')][_0x522d('0x22')]);_0x3d982e['offset']=qs['offset'](_0x27eaa8[_0x522d('0x35')]['offset']);}_0x3d982e['order']=qs[_0x522d('0x3d')](_0x27eaa8[_0x522d('0x35')][_0x522d('0x3d')]);_0x3d982e[_0x522d('0x3e')]=qs[_0x522d('0x36')](_[_0x522d('0x3f')](_0x27eaa8['query'],_0x6ef1ac[_0x522d('0x36')]),_0x58729a);if(_0x27eaa8[_0x522d('0x35')][_0x522d('0x40')]){_0x3d982e['where']=_[_0x522d('0x41')](_0x3d982e['where'],{'$or':_['map'](_0x58729a,function(_0x2be4f6){if(_0x2be4f6[_0x522d('0x31')]!==_0x522d('0x42')){var _0x1c161d={};_0x1c161d[_0x2be4f6[_0x522d('0x33')]]={'$like':'%'+_0x27eaa8[_0x522d('0x35')][_0x522d('0x40')]+'%'};return _0x1c161d;}})});}_0x3d982e=_[_0x522d('0x41')]({},_0x3d982e,_0x27eaa8['options']);var _0xd201be={'where':_0x3d982e['where']};return db['Team'][_0x522d('0x43')](_0xd201be)[_0x522d('0x28')](function(_0x447f07){_0x2e6138[_0x522d('0x43')]=_0x447f07;if(_0x27eaa8['query']['includeAll']){_0x3d982e[_0x522d('0x44')]=[{'all':!![]}];}return db['Team'][_0x522d('0x45')](_0x3d982e);})[_0x522d('0x28')](function(_0x3618be){_0x2e6138[_0x522d('0x46')]=_0x3618be;return _0x2e6138;})[_0x522d('0x28')](respondWithFilteredResult(_0x1b8b97,_0x3d982e))['catch'](handleError(_0x1b8b97,null));};exports[_0x522d('0x47')]=function(_0x93ef30,_0x52d709){var _0x57b87f={'raw':![],'where':{'id':_0x93ef30[_0x522d('0x48')]['id']}},_0x5db0ba={};_0x5db0ba['model']=_[_0x522d('0x34')](db[_0x522d('0x2e')][_0x522d('0x2f')]);_0x5db0ba[_0x522d('0x35')]=_[_0x522d('0x34')](_0x93ef30[_0x522d('0x35')]);_0x5db0ba[_0x522d('0x36')]=_[_0x522d('0x37')](_0x5db0ba['model'],_0x5db0ba[_0x522d('0x35')]);_0x57b87f['attributes']=_[_0x522d('0x37')](_0x5db0ba[_0x522d('0x38')],qs[_0x522d('0x3a')](_0x93ef30[_0x522d('0x35')]['fields']));_0x57b87f[_0x522d('0x39')]=_0x57b87f[_0x522d('0x39')][_0x522d('0x49')]?_0x57b87f[_0x522d('0x39')]:_0x5db0ba[_0x522d('0x38')];if(_0x93ef30[_0x522d('0x35')][_0x522d('0x4a')]){_0x57b87f[_0x522d('0x44')]=[{'all':!![]}];}_0x57b87f=_[_0x522d('0x41')]({},_0x57b87f,_0x93ef30[_0x522d('0x4b')]);return db[_0x522d('0x2e')][_0x522d('0x4c')](_0x57b87f)[_0x522d('0x28')](handleEntityNotFound(_0x52d709,null))['then'](respondWithResult(_0x52d709,null))[_0x522d('0x4d')](handleError(_0x52d709,null));};exports[_0x522d('0x4e')]=function(_0x12405a,_0x3e3d00){return db[_0x522d('0x2e')][_0x522d('0x4e')](_0x12405a[_0x522d('0x4f')],{})[_0x522d('0x28')](function(_0x29379a){var _0x39b4c5=_0x12405a[_0x522d('0x50')]['get']({'plain':!![]});if(!_0x39b4c5)throw new Error(_0x522d('0x51'));if(_0x39b4c5['role']===_0x522d('0x50')){var _0x401d2b=_0x29379a['get']({'plain':!![]});var _0x39c5c8='Teams';return db[_0x522d('0x52')]['find']({'where':{'name':_0x39c5c8,'userProfileId':_0x39b4c5[_0x522d('0x53')]},'raw':!![]})[_0x522d('0x28')](function(_0x4ccecb){if(_0x4ccecb&&_0x4ccecb[_0x522d('0x54')]===0x0){return db[_0x522d('0x55')][_0x522d('0x4e')]({'name':_0x401d2b[_0x522d('0x33')],'resourceId':_0x401d2b['id'],'type':_0x4ccecb['name'],'sectionId':_0x4ccecb['id']},{})[_0x522d('0x28')](function(){return _0x29379a;});}else{return _0x29379a;}})['catch'](function(_0x27b6cf){logger[_0x522d('0x29')](_0x522d('0x56'),_0x27b6cf);throw _0x27b6cf;});}return _0x29379a;})[_0x522d('0x28')](respondWithResult(_0x3e3d00,0xc9))[_0x522d('0x4d')](handleError(_0x3e3d00,null));};exports['update']=function(_0x27af9f,_0x4c1c4d){if(_0x27af9f[_0x522d('0x4f')]['id']){delete _0x27af9f['body']['id'];}return db[_0x522d('0x2e')][_0x522d('0x4c')]({'where':{'id':_0x27af9f[_0x522d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c1c4d,null))[_0x522d('0x28')](saveUpdates(_0x27af9f[_0x522d('0x4f')],null))['then'](respondWithResult(_0x4c1c4d,null))[_0x522d('0x4d')](handleError(_0x4c1c4d,null));};exports['destroy']=function(_0x415de0,_0x4e2f51){var _0x1dfadb=_0x415de0[_0x522d('0x48')]['id'];var _0x59a516=[];return db['sequelize'][_0x522d('0x57')](function(_0xb2522d){var _0x1e3341=_0x522d('0x58')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x1e3341,{'type':db[_0x522d('0x5a')][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d})[_0x522d('0x28')](function(_0x40a582){_0x59a516=_[_0x522d('0x2d')](_0x40a582,function(_0x5785b9){return Number(_0x5785b9[_0x522d('0x5d')]);});})['then'](function(){var _0x41d906=_0x522d('0x5e')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x41d906,{'type':db['Sequelize'][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x3d5a62){var _0x276d7e=_[_0x522d('0x2d')](_0x3d5a62,function(_0x258fbe){return Number(_0x258fbe[_0x522d('0x5f')]);});return db[_0x522d('0x60')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'VoiceQueueId':{'$in':_0x276d7e}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x306d9a=_0x522d('0x62')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x306d9a,{'type':db[_0x522d('0x5a')][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x11aa23){var _0xcf572d=_[_0x522d('0x2d')](_0x11aa23,function(_0x3e0c1a){return Number(_0x3e0c1a[_0x522d('0x63')]);});return db[_0x522d('0x64')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'MailQueueId':{'$in':_0xcf572d}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x560c34=_0x522d('0x65')+_0x1dfadb;return db[_0x522d('0x59')]['query'](_0x560c34,{'type':db['Sequelize'][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x41f9d3){var _0x2fb95=_[_0x522d('0x2d')](_0x41f9d3,function(_0x18c47e){return Number(_0x18c47e[_0x522d('0x66')]);});return db[_0x522d('0x67')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'SmsQueueId':{'$in':_0x2fb95}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x42200c=_0x522d('0x68')+_0x1dfadb;return db[_0x522d('0x59')]['query'](_0x42200c,{'type':db[_0x522d('0x5a')][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x552924){var _0x57fc77=_[_0x522d('0x2d')](_0x552924,function(_0x2de1b7){return Number(_0x2de1b7[_0x522d('0x69')]);});return db[_0x522d('0x6a')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'ChatQueueId':{'$in':_0x57fc77}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x481615=_0x522d('0x6b')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x481615,{'type':db[_0x522d('0x5a')]['QueryTypes'][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})['then'](function(_0x4069bc){var _0x221daf=_[_0x522d('0x2d')](_0x4069bc,function(_0xd40820){return Number(_0xd40820[_0x522d('0x6c')]);});return db['UserFaxQueue'][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'FaxQueueId':{'$in':_0x221daf}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x3e2fbb=_0x522d('0x6d')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x3e2fbb,{'type':db[_0x522d('0x5a')][_0x522d('0x5b')]['SELECT'],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x10b144){var _0x5c732f=_['map'](_0x10b144,function(_0x19c433){return Number(_0x19c433[_0x522d('0x6e')]);});return db[_0x522d('0x6f')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'OpenchannelQueueId':{'$in':_0x5c732f}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){var _0x1d56a7=_0x522d('0x70')+_0x1dfadb;return db[_0x522d('0x59')][_0x522d('0x35')](_0x1d56a7,{'type':db[_0x522d('0x5a')][_0x522d('0x5b')][_0x522d('0x5c')],'raw':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0x2fa71f){var _0x499f53=_[_0x522d('0x2d')](_0x2fa71f,function(_0x39a145){return Number(_0x39a145['WhatsappQueueId']);});return db[_0x522d('0x71')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'WhatsappQueueId':{'$in':_0x499f53}},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){return db['TeamVoicePrefix'][_0x522d('0x4c')]({'where':{'TeamId':_0x1dfadb}});})[_0x522d('0x28')](function(_0x2d7ebe){if(_0x2d7ebe===null){return;}return db[_0x522d('0x72')][_0x522d('0x61')]({'where':{'UserId':{'$in':_0x59a516},'VoicePrefixId':_0x2d7ebe['VoicePrefixId']},'transaction':_0xb2522d});})[_0x522d('0x28')](function(){return db[_0x522d('0x2e')][_0x522d('0x61')]({'where':{'id':_0x1dfadb},'cascade':!![],'transaction':_0xb2522d});})[_0x522d('0x28')](function(_0xecaced){if(_0xecaced===0x0){_0x4e2f51['sendStatus'](0x194);}else{return db[_0x522d('0x55')][_0x522d('0x61')]({'where':{'type':_0x522d('0x73'),'resourceId':_0x1dfadb},'cascade':!![],'transaction':_0xb2522d})['then'](function(){_0x4e2f51['status'](0xcc)['end']();});}})[_0x522d('0x4d')](function(_0x227947){_0x4e2f51[_0x522d('0x1e')](0x1f4)[_0x522d('0x2b')](_0x227947);});});};exports['getQueues']=function(_0x307ab7,_0x597d2a,_0x3b6a5c){return db['Team'][_0x522d('0x74')]({'where':{'id':_0x307ab7[_0x522d('0x48')]['id']}})[_0x522d('0x28')](handleEntityNotFound(_0x597d2a,null))[_0x522d('0x28')](function(_0x5b622d){if(!_0x307ab7['query'][_0x522d('0x75')]||!utils['isValidChannel'](_0x307ab7[_0x522d('0x35')]['channel'])){throw new db[(_0x522d('0x5a'))][(_0x522d('0x76'))]('Unknown\x20channel');}var _0xa43eba={};var _0x2c3dcb={};_0x2c3dcb[_0x522d('0x38')]=_['keys'](db[_[_0x522d('0x77')](_0x307ab7['query'][_0x522d('0x75')][_0x522d('0x78')]())+'Queue'][_0x522d('0x2f')]);_0x2c3dcb[_0x522d('0x35')]=_[_0x522d('0x34')](_0x307ab7[_0x522d('0x35')]);_0x2c3dcb[_0x522d('0x36')]=_[_0x522d('0x37')](_0x2c3dcb[_0x522d('0x38')],_0x2c3dcb['query']);_0xa43eba[_0x522d('0x39')]=_[_0x522d('0x37')](_0x2c3dcb[_0x522d('0x38')],qs['fields'](_0x307ab7['query'][_0x522d('0x3a')]));_0xa43eba[_0x522d('0x39')]=_0xa43eba['attributes'][_0x522d('0x49')]?_0xa43eba[_0x522d('0x39')]:_0x2c3dcb[_0x522d('0x38')];_0xa43eba[_0x522d('0x22')]=qs[_0x522d('0x22')](_0x307ab7[_0x522d('0x35')][_0x522d('0x22')]);_0xa43eba[_0x522d('0x20')]=qs[_0x522d('0x20')](_0x307ab7[_0x522d('0x35')]['offset']);_0xa43eba['order']=qs[_0x522d('0x3d')](_0x307ab7['query'][_0x522d('0x3d')]);_0xa43eba['where']=qs[_0x522d('0x36')](_[_0x522d('0x3f')](_0x307ab7[_0x522d('0x35')],_0x2c3dcb['filters']));_0xa43eba=_[_0x522d('0x41')]({},_0xa43eba,_0x307ab7['options']);return _0x5b622d['get'+_[_0x522d('0x77')](_0x307ab7[_0x522d('0x35')][_0x522d('0x75')][_0x522d('0x78')]())+_0x522d('0x79')](_0xa43eba);})[_0x522d('0x28')](respondWithResult(_0x597d2a,null))[_0x522d('0x4d')](handleError(_0x597d2a,null));};exports['addQueues']=function(_0x4aa1b4,_0x437efc,_0x1e9733){return db['Team']['findOne']({'where':{'id':_0x4aa1b4[_0x522d('0x48')]['id']}})[_0x522d('0x28')](function(_0x195a37){if(_0x195a37){if(!_0x4aa1b4[_0x522d('0x4f')][_0x522d('0x75')]||!utils[_0x522d('0x7a')](_0x4aa1b4['body'][_0x522d('0x75')])){throw new db[(_0x522d('0x5a'))][(_0x522d('0x76'))](_0x522d('0x7b'));}return _0x195a37[_0x522d('0x7c')+_[_0x522d('0x77')](_0x4aa1b4[_0x522d('0x4f')][_0x522d('0x75')][_0x522d('0x78')]())+_0x522d('0x79')](_0x4aa1b4['body'][_0x522d('0x7d')]);}return null;})[_0x522d('0x28')](handleEntityNotFound(_0x437efc,null))[_0x522d('0x28')](respondWithStatusCode(_0x437efc,null))[_0x522d('0x4d')](handleError(_0x437efc,null));};exports['removeQueues']=function(_0x18cbf3,_0x5af85e,_0x46e368){return db[_0x522d('0x2e')][_0x522d('0x74')]({'where':{'id':_0x18cbf3['params']['id']}})[_0x522d('0x28')](function(_0x132ba0){if(_0x132ba0){if(!_0x18cbf3[_0x522d('0x35')][_0x522d('0x75')]||!utils[_0x522d('0x7a')](_0x18cbf3[_0x522d('0x35')][_0x522d('0x75')])){throw new db[(_0x522d('0x5a'))][(_0x522d('0x76'))]('Unknown\x20channel');}return _0x132ba0[_0x522d('0x7e')+_[_0x522d('0x77')](_0x18cbf3[_0x522d('0x35')]['channel'][_0x522d('0x78')]())+_0x522d('0x79')](_0x18cbf3['query'][_0x522d('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x5af85e,null))['then'](respondWithStatusCode(_0x5af85e,null))[_0x522d('0x4d')](handleError(_0x5af85e,null));};exports[_0x522d('0x7f')]=function(_0x1fbc68,_0x5ca45b){var _0x4a6d79=_[_0x522d('0x80')](_0x1fbc68[_0x522d('0x4f')]['ids'])?_0x1fbc68['body']['ids']:[_0x1fbc68[_0x522d('0x4f')][_0x522d('0x7d')]];var _0x3d7a0f=_0x1fbc68['params']['id'];return db[_0x522d('0x2e')][_0x522d('0x4c')]({'where':{'id':_0x3d7a0f}})[_0x522d('0x28')](handleEntityNotFound(_0x5ca45b,null))[_0x522d('0x28')](function(_0x1a6ec9){if(_0x1a6ec9){var _0x5b77cb=[_0x522d('0x81'),_0x522d('0x82'),_0x522d('0x83'),_0x522d('0x84'),'Fax',_0x522d('0x85'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x33b0b3){var _0x2c4273=_['map'](_0x5b77cb,function(_0x37b445){var _0x59c15f={'attributes':['id',_0x522d('0x33')]};if(_0x37b445==='Voice'){_0x59c15f['through']={'attributes':[_0x522d('0x86')]};}return _0x1a6ec9[_0x522d('0x87')+_0x37b445+'Queues'](_0x59c15f)[_0x522d('0x28')](function(_0x31be97){var _0x3ace78=_[_0x522d('0x2d')](_0x31be97,function(_0x11a5ca){var _0x2b781e=_[_0x522d('0x2d')](_0x4a6d79,function(_0x52d152){var _0x2cc03b={'where':{'UserId':_0x52d152,[_0x37b445+_0x522d('0x88')]:_0x11a5ca['id']},'transaction':_0x33b0b3};if(_0x37b445===_0x522d('0x81')){_0x2cc03b[_0x522d('0x19')]={'penalty':_0x11a5ca['TeamVoiceQueue']['penalty']};}return db[_0x522d('0x89')+_0x37b445+_0x522d('0x8a')][_0x522d('0x8b')](_0x2cc03b)[_0x522d('0x28')](function(){socket[_0x522d('0x8c')](_0x522d('0x50')+_0x37b445+_0x522d('0x8d'),{'UserId':_0x52d152,[_0x37b445+_0x522d('0x88')]:_0x11a5ca['id']});if(_0x37b445!=='Voice'){return;}return db['User']['findAll']({'where':{'id':_0x4a6d79,'online':0x1},'attributes':['id',_0x522d('0x33'),_0x522d('0x8e'),_0x522d('0x8f'),_0x522d('0x90')],'raw':!![]})[_0x522d('0x28')](function(_0xb170cd){var _0x46f99b=_[_0x522d('0x2d')](_0xb170cd,function(_0x2a0fc0){return db[_0x522d('0x91')][_0x522d('0x92')]({'membername':_0x2a0fc0[_0x522d('0x33')],'UserId':_0x2a0fc0['id'],'queue_name':_0x11a5ca[_0x522d('0x33')],'VoiceQueueId':_0x11a5ca['id'],'interface':_['isNil'](_0x2a0fc0[_0x522d('0x90')])?util[_0x522d('0x93')](_0x522d('0x94'),_0x2a0fc0[_0x522d('0x33')]):_0x2a0fc0[_0x522d('0x90')],'paused':_0x2a0fc0[_0x522d('0x8f')]||![],'penalty':_0x11a5ca['TeamVoiceQueue'][_0x522d('0x86')]},{'transaction':_0x33b0b3});});return Promise[_0x522d('0x95')](_0x46f99b);});});});return Promise['all'](_0x2b781e);});return Promise[_0x522d('0x95')](_0x3ace78);})[_0x522d('0x28')](function(){return db['TeamVoicePrefix'][_0x522d('0x74')]({'where':{'teamId':_0x3d7a0f}})[_0x522d('0x28')](function(_0x9bbbbe){if(_0x9bbbbe){var _0x4e51ba=_['map'](_0x4a6d79,function(_0x187bf0){db[_0x522d('0x72')]['upsert']({'UserId':_0x187bf0,'VoicePrefixId':_0x9bbbbe[_0x522d('0x96')]});});return Promise['all'](_0x4e51ba);}});});});return Promise['all'](_0x2c4273)[_0x522d('0x28')](function(){return _0x1a6ec9[_0x522d('0x7f')](_0x4a6d79,{'transaction':_0x33b0b3})['spread'](function(_0x1ef007){return _0x1ef007;});});});}})[_0x522d('0x28')](respondWithResult(_0x5ca45b,null))['catch'](handleError(_0x5ca45b,null));};exports[_0x522d('0x97')]=function(_0x3f62fa,_0x4ec20a){var _0x179194=_[_0x522d('0x80')](_0x3f62fa[_0x522d('0x35')][_0x522d('0x7d')])?_0x3f62fa[_0x522d('0x35')][_0x522d('0x7d')]:[_0x3f62fa[_0x522d('0x35')][_0x522d('0x7d')]];var _0x3802ef=_0x3f62fa['params']['id'];return db[_0x522d('0x2e')][_0x522d('0x4c')]({'where':{'id':_0x3802ef}})['then'](handleEntityNotFound(_0x4ec20a,null))[_0x522d('0x28')](function(_0x4c0a7a){if(_0x4c0a7a){var _0x3062cf=['Voice',_0x522d('0x82'),_0x522d('0x83'),_0x522d('0x84'),_0x522d('0x98'),_0x522d('0x85'),_0x522d('0x99')];return db[_0x522d('0x59')][_0x522d('0x57')](function(_0x5580c3){var _0x2189c9=_[_0x522d('0x2d')](_0x3062cf,function(_0x5ef3b6){var _0x4afd84={'attributes':['id','name']};return _0x4c0a7a[_0x522d('0x87')+_0x5ef3b6+'Queues'](_0x4afd84)['then'](function(_0x3ba8a3){var _0x1a0be2=_['map'](_0x3ba8a3,function(_0x2f9674){return _0x2f9674[_0x522d('0x97')](_0x179194,{'transaction':_0x5580c3})[_0x522d('0x28')](function(){var _0x5b3bee=_[_0x522d('0x2d')](_0x179194,function(_0xd8acd8){socket[_0x522d('0x8c')](_0x522d('0x50')+_0x5ef3b6+_0x522d('0x9a'),{'UserId':Number(_0xd8acd8),[_0x5ef3b6+_0x522d('0x88')]:_0x2f9674['id']});if(_0x5ef3b6!=='Voice'){return;}return db[_0x522d('0x91')]['destroy']({'where':{'VoiceQueueId':_0x2f9674['id'],'UserId':_0xd8acd8},'transaction':_0x5580c3});});return Promise[_0x522d('0x95')](_0x5b3bee);});});return Promise[_0x522d('0x95')](_0x1a0be2);});});return Promise[_0x522d('0x95')](_0x2189c9)['then'](function(){return _0x4c0a7a['removeAgents'](_0x179194,{'transaction':_0x5580c3});})[_0x522d('0x28')](function(){return db[_0x522d('0x9b')][_0x522d('0x74')]({'where':{'teamId':_0x3802ef}})['then'](function(_0x42c8bd){if(_0x42c8bd){var _0x5e5fd7=_[_0x522d('0x2d')](_0x179194,function(_0x1f506e){db[_0x522d('0x72')][_0x522d('0x61')]({'where':{'UserId':_0x1f506e,'VoicePrefixId':_0x42c8bd[_0x522d('0x96')]}});});return Promise[_0x522d('0x95')](_0x5e5fd7);}});});});}})[_0x522d('0x28')](respondWithStatusCode(_0x4ec20a,null))[_0x522d('0x4d')](handleError(_0x4ec20a,null));};exports[_0x522d('0x9c')]=function(_0x731533,_0x4785c8,_0x1c8e8d){var _0x40b8e5={};var _0x236773={};var _0x15e648;var _0x454196;return db[_0x522d('0x2e')][_0x522d('0x74')]({'where':{'id':_0x731533['params']['id']}})[_0x522d('0x28')](handleEntityNotFound(_0x4785c8,null))['then'](function(_0x32d109){if(_0x32d109){_0x15e648=_0x32d109;_0x236773[_0x522d('0x38')]=_[_0x522d('0x34')](db[_0x522d('0x89')][_0x522d('0x2f')]);_0x236773['query']=_[_0x522d('0x34')](_0x731533[_0x522d('0x35')]);_0x236773['filters']=_['intersection'](_0x236773[_0x522d('0x38')],_0x236773[_0x522d('0x35')]);_0x40b8e5['attributes']=_[_0x522d('0x37')](_0x236773['model'],qs[_0x522d('0x3a')](_0x731533[_0x522d('0x35')][_0x522d('0x3a')]));_0x40b8e5[_0x522d('0x39')]=_0x40b8e5['attributes'][_0x522d('0x49')]?_0x40b8e5['attributes']:_0x236773[_0x522d('0x38')];_0x40b8e5[_0x522d('0x9d')]=qs[_0x522d('0x3d')](_0x731533[_0x522d('0x35')][_0x522d('0x3d')]);_0x40b8e5['where']=qs[_0x522d('0x36')](_[_0x522d('0x3f')](_0x731533[_0x522d('0x35')],_0x236773[_0x522d('0x36')]));if(_0x731533[_0x522d('0x35')][_0x522d('0x40')]){_0x40b8e5[_0x522d('0x3e')]=_[_0x522d('0x41')](_0x40b8e5[_0x522d('0x3e')],{'$or':_['map'](_0x40b8e5[_0x522d('0x39')],function(_0x2c5d57){var _0x478c02={};_0x478c02[_0x2c5d57]={'$like':'%'+_0x731533[_0x522d('0x35')]['filter']+'%'};return _0x478c02;})});}_0x40b8e5=_['merge']({},_0x40b8e5,_0x731533[_0x522d('0x4b')]);return _0x15e648[_0x522d('0x9c')](_0x40b8e5);}})[_0x522d('0x28')](function(_0x242048){if(_0x242048){_0x454196=_0x242048[_0x522d('0x49')];if(!_0x731533[_0x522d('0x35')]['hasOwnProperty'](_0x522d('0x3c'))){_0x40b8e5[_0x522d('0x22')]=qs[_0x522d('0x22')](_0x731533[_0x522d('0x35')][_0x522d('0x22')]);_0x40b8e5[_0x522d('0x20')]=qs[_0x522d('0x20')](_0x731533[_0x522d('0x35')][_0x522d('0x20')]);}return _0x15e648[_0x522d('0x9c')](_0x40b8e5);}})['then'](function(_0x3f7394){if(_0x3f7394){return _0x3f7394?{'count':_0x454196,'rows':_0x3f7394}:null;}})[_0x522d('0x28')](respondWithResult(_0x4785c8,null))[_0x522d('0x4d')](handleError(_0x4785c8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index fd55e1e..87f9c02 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 _0x710e=['remove','emit','hook','exports','events','../../mysqldb','Team','save','update'];(function(_0x2a06dc,_0x66efcf){var _0xe4b93f=function(_0x1eff37){while(--_0x1eff37){_0x2a06dc['push'](_0x2a06dc['shift']());}};_0xe4b93f(++_0x66efcf);}(_0x710e,0xca));var _0xe710=function(_0x2070f3,_0x27a6d1){_0x2070f3=_0x2070f3-0x0;var _0x1220cb=_0x710e[_0x2070f3];return _0x1220cb;};'use strict';var EventEmitter=require(_0xe710('0x0'));var Team=require(_0xe710('0x1'))['db'][_0xe710('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe710('0x3'),'afterUpdate':_0xe710('0x4'),'afterDestroy':_0xe710('0x5')};function emitEvent(_0x3be2ea){return function(_0x35a49b,_0x5df81a,_0x283e46){TeamEvents[_0xe710('0x6')](_0x3be2ea+':'+_0x35a49b['id'],_0x35a49b);TeamEvents[_0xe710('0x6')](_0x3be2ea,_0x35a49b);_0x283e46(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe710('0x7')](e,emitEvent(event));}}module[_0xe710('0x8')]=TeamEvents; \ No newline at end of file +var _0x33ea=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x33ea,0xf0));var _0xa33e=function(_0x481da7,_0x294699){_0x481da7=_0x481da7-0x0;var _0x4505f6=_0x33ea[_0x481da7];return _0x4505f6;};'use strict';var EventEmitter=require(_0xa33e('0x0'));var Team=require(_0xa33e('0x1'))['db'][_0xa33e('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xa33e('0x3')](0x0);var events={'afterCreate':_0xa33e('0x4'),'afterUpdate':_0xa33e('0x5'),'afterDestroy':_0xa33e('0x6')};function emitEvent(_0x4cf452){return function(_0x334a49,_0x34e505,_0x598ca5){TeamEvents[_0xa33e('0x7')](_0x4cf452+':'+_0x334a49['id'],_0x334a49);TeamEvents[_0xa33e('0x7')](_0x4cf452,_0x334a49);_0x598ca5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xa33e('0x8')](e,emitEvent(event));}}module[_0xa33e('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a32f244..65d2701 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 _0x4121=['./team.attributes','define','Team','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x4121,0x116));var _0x1412=function(_0xbc8bd,_0x4d97c1){_0xbc8bd=_0xbc8bd-0x0;var _0x910371=_0x4121[_0xbc8bd];return _0x910371;};'use strict';var _=require(_0x1412('0x0'));var util=require('util');var logger=require(_0x1412('0x1'))(_0x1412('0x2'));var moment=require(_0x1412('0x3'));var BPromise=require('bluebird');var rp=require(_0x1412('0x4'));var fs=require('fs');var path=require(_0x1412('0x5'));var rimraf=require(_0x1412('0x6'));var config=require(_0x1412('0x7'));var attributes=require(_0x1412('0x8'));module['exports']=function(_0x457979,_0x1d3c88){return _0x457979[_0x1412('0x9')](_0x1412('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5a4=['../../config/logger','api','moment','bluebird','path','rimraf','exports','Team','teams','util'];(function(_0x5dd9ff,_0x358323){var _0x102b28=function(_0x2d8f71){while(--_0x2d8f71){_0x5dd9ff['push'](_0x5dd9ff['shift']());}};_0x102b28(++_0x358323);}(_0xa5a4,0x171));var _0x4a5a=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xa5a4[_0x2ff238];return _0x204a56;};'use strict';var _=require('lodash');var util=require(_0x4a5a('0x0'));var logger=require(_0x4a5a('0x1'))(_0x4a5a('0x2'));var moment=require(_0x4a5a('0x3'));var BPromise=require(_0x4a5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a5a('0x5'));var rimraf=require(_0x4a5a('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x4a5a('0x7')]=function(_0xc25fab,_0x5c90d0){return _0xc25fab['define'](_0x4a5a('0x8'),attributes,{'tableName':_0x4a5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a79ed44..a19f9ea 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 _0x7649=['result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./team.socket','register','request','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x13a836,_0x4c2ba2){var _0x1f5bee=function(_0x129c8d){while(--_0x129c8d){_0x13a836['push'](_0x13a836['shift']());}};_0x1f5bee(++_0x4c2ba2);}(_0x7649,0x121));var _0x9764=function(_0x5d1c41,_0x444ef4){_0x5d1c41=_0x5d1c41-0x0;var _0x43bd67=_0x7649[_0x5d1c41];return _0x43bd67;};'use strict';var _=require(_0x9764('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9764('0x1'));var fs=require('fs');var Redis=require(_0x9764('0x2'));var db=require(_0x9764('0x3'))['db'];var utils=require(_0x9764('0x4'));var logger=require(_0x9764('0x5'))('rpc');var config=require(_0x9764('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9764('0x7')][_0x9764('0x8')]({'port':0x232a});config[_0x9764('0x9')]=_['defaults'](config[_0x9764('0x9')],{'host':_0x9764('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9764('0x9')]));require(_0x9764('0xb'))[_0x9764('0xc')](socket);function respondWithRpcPromise(_0x142923,_0x35f738,_0x105822){return new BPromise(function(_0x177e49,_0x29adde){return client[_0x9764('0xd')](_0x142923,_0x105822)['then'](function(_0x473faf){logger[_0x9764('0xe')](_0x9764('0xf'),_0x35f738,'request\x20sent');logger[_0x9764('0x10')](_0x9764('0x11'),_0x35f738,_0x9764('0x12'),JSON[_0x9764('0x13')](_0x473faf));if(_0x473faf[_0x9764('0x14')]){if(_0x473faf['error'][_0x9764('0x15')]===0x1f4){logger[_0x9764('0x14')](_0x9764('0xf'),_0x35f738,_0x473faf[_0x9764('0x14')][_0x9764('0x16')]);return _0x29adde(_0x473faf[_0x9764('0x14')][_0x9764('0x16')]);}logger[_0x9764('0x14')](_0x9764('0xf'),_0x35f738,_0x473faf[_0x9764('0x14')][_0x9764('0x16')]);return _0x177e49(_0x473faf[_0x9764('0x14')]['message']);}else{logger['info'](_0x9764('0xf'),_0x35f738,_0x9764('0x12'));_0x177e49(_0x473faf[_0x9764('0x17')]['message']);}})['catch'](function(_0xb107d3){logger['error'](_0x9764('0xf'),_0x35f738,_0xb107d3);_0x29adde(_0xb107d3);});});} \ No newline at end of file +var _0xa563=['request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x20f2a5,_0x43b025){var _0x4ffd4b=function(_0x3bd178){while(--_0x3bd178){_0x20f2a5['push'](_0x20f2a5['shift']());}};_0x4ffd4b(++_0x43b025);}(_0xa563,0x11c));var _0x3a56=function(_0x5ab08e,_0x2cf537){_0x5ab08e=_0x5ab08e-0x0;var _0x52234e=_0xa563[_0x5ab08e];return _0x52234e;};'use strict';var _=require(_0x3a56('0x0'));var util=require(_0x3a56('0x1'));var moment=require(_0x3a56('0x2'));var BPromise=require(_0x3a56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a56('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a56('0x5'))(_0x3a56('0x6'));var config=require(_0x3a56('0x7'));var jayson=require(_0x3a56('0x8'));var client=jayson[_0x3a56('0x9')][_0x3a56('0xa')]({'port':0x232a});config[_0x3a56('0xb')]=_[_0x3a56('0xc')](config[_0x3a56('0xb')],{'host':_0x3a56('0xd'),'port':0x18eb});var socket=require(_0x3a56('0xe'))(new Redis(config[_0x3a56('0xb')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x4defff,_0x4dba2d,_0x3ccbce){return new BPromise(function(_0x371a1e,_0x2f1362){return client[_0x3a56('0xf')](_0x4defff,_0x3ccbce)[_0x3a56('0x10')](function(_0x73c4c8){logger[_0x3a56('0x11')](_0x3a56('0x12'),_0x4dba2d,_0x3a56('0x13'));logger[_0x3a56('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x4dba2d,_0x3a56('0x13'),JSON['stringify'](_0x73c4c8));if(_0x73c4c8[_0x3a56('0x15')]){if(_0x73c4c8[_0x3a56('0x15')]['code']===0x1f4){logger[_0x3a56('0x15')](_0x3a56('0x12'),_0x4dba2d,_0x73c4c8['error'][_0x3a56('0x16')]);return _0x2f1362(_0x73c4c8['error'][_0x3a56('0x16')]);}logger[_0x3a56('0x15')](_0x3a56('0x12'),_0x4dba2d,_0x73c4c8['error'][_0x3a56('0x16')]);return _0x371a1e(_0x73c4c8['error'][_0x3a56('0x16')]);}else{logger[_0x3a56('0x11')](_0x3a56('0x12'),_0x4dba2d,_0x3a56('0x13'));_0x371a1e(_0x73c4c8['result'][_0x3a56('0x16')]);}})['catch'](function(_0x39b326){logger[_0x3a56('0x15')]('Team,\x20%s,\x20%s',_0x4dba2d,_0x39b326);_0x2f1362(_0x39b326);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4d19f65..a231c75 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 _0x4255=['register','length','team:','./team.events','remove','update','emit','removeListener'];(function(_0x1a74b1,_0x5eaa43){var _0x1ca6c5=function(_0x4e86f0){while(--_0x4e86f0){_0x1a74b1['push'](_0x1a74b1['shift']());}};_0x1ca6c5(++_0x5eaa43);}(_0x4255,0x1bb));var _0x5425=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x4255[_0x1793de];return _0x4f0309;};'use strict';var TeamEvents=require(_0x5425('0x0'));var events=['save',_0x5425('0x1'),_0x5425('0x2')];function createListener(_0x41d664,_0x35d785){return function(_0x49fbf3){_0x35d785[_0x5425('0x3')](_0x41d664,_0x49fbf3);};}function removeListener(_0x475891,_0x21d258){return function(){TeamEvents[_0x5425('0x4')](_0x475891,_0x21d258);};}exports[_0x5425('0x5')]=function(_0x439f1b){for(var _0xb9e88c=0x0,_0x37d5f9=events[_0x5425('0x6')];_0xb9e88c<_0x37d5f9;_0xb9e88c++){var _0x18c7e3=events[_0xb9e88c];var _0x44bae9=createListener(_0x5425('0x7')+_0x18c7e3,_0x439f1b);TeamEvents['on'](_0x18c7e3,_0x44bae9);}}; \ No newline at end of file +var _0x4edf=['./team.events','save','emit','removeListener','register','length','team:'];(function(_0x1226eb,_0x264bc4){var _0x4dcc9b=function(_0x84f7ab){while(--_0x84f7ab){_0x1226eb['push'](_0x1226eb['shift']());}};_0x4dcc9b(++_0x264bc4);}(_0x4edf,0x196));var _0xf4ed=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x4edf[_0xdeefbd];return _0x4ff63f;};'use strict';var TeamEvents=require(_0xf4ed('0x0'));var events=[_0xf4ed('0x1'),'remove','update'];function createListener(_0x1dd68d,_0x34de53){return function(_0x14e106){_0x34de53[_0xf4ed('0x2')](_0x1dd68d,_0x14e106);};}function removeListener(_0x452003,_0x3cf60c){return function(){TeamEvents[_0xf4ed('0x3')](_0x452003,_0x3cf60c);};}exports[_0xf4ed('0x4')]=function(_0x5a1e1c){for(var _0x1d9a9e=0x0,_0x174d4b=events[_0xf4ed('0x5')];_0x1d9a9e<_0x174d4b;_0x1d9a9e++){var _0x2f0995=events[_0x1d9a9e];var _0x5cb6ac=createListener(_0xf4ed('0x6')+_0x2f0995,_0x5a1e1c);TeamEvents['on'](_0x2f0995,_0x5cb6ac);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7fccca0..a8e24f2 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 _0x2b85=['INTEGER','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x2b85,0x197));var _0x52b8=function(_0x2459bc,_0x5a16a9){_0x2459bc=_0x2459bc-0x0;var _0x368b7f=_0x2b85[_0x2459bc];return _0x368b7f;};'use strict';var Sequelize=require('sequelize');module[_0x52b8('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x52b8('0x1')]}}; \ No newline at end of file +var _0xe356=['exports','INTEGER','sequelize'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xe356,0x1ee));var _0x6e35=function(_0x55fa24,_0x54255b){_0x55fa24=_0x55fa24-0x0;var _0x485cfe=_0xe356[_0x55fa24];return _0x485cfe;};'use strict';var Sequelize=require(_0x6e35('0x0'));module[_0x6e35('0x1')]={'TeamId':{'type':Sequelize[_0x6e35('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6e35('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 0d2371c..dde8dcd 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 _0xe605=['exports','define','team_has_voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x1052f0,_0x1d9a3e){var _0x3b40c5=function(_0x1fe836){while(--_0x1fe836){_0x1052f0['push'](_0x1052f0['shift']());}};_0x3b40c5(++_0x1d9a3e);}(_0xe605,0x92));var _0x5e60=function(_0x4f7bf5,_0x632c76){_0x4f7bf5=_0x4f7bf5-0x0;var _0x38ae61=_0xe605[_0x4f7bf5];return _0x38ae61;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var fs=require('fs');var path=require(_0x5e60('0x6'));var rimraf=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var attributes=require(_0x5e60('0x9'));module[_0x5e60('0xa')]=function(_0xc41535,_0x1d4a08){return _0xc41535[_0x5e60('0xb')]('TeamVoicePrefix',attributes,{'tableName':_0x5e60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b08=['path','rimraf','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0x7b08,0x163));var _0x87b0=function(_0x15f21c,_0x49b35b){_0x15f21c=_0x15f21c-0x0;var _0xe8f3a3=_0x7b08[_0x15f21c];return _0xe8f3a3;};'use strict';var _=require(_0x87b0('0x0'));var util=require('util');var logger=require(_0x87b0('0x1'))(_0x87b0('0x2'));var moment=require(_0x87b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x87b0('0x4'));var fs=require('fs');var path=require(_0x87b0('0x5'));var rimraf=require(_0x87b0('0x6'));var config=require(_0x87b0('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x87b0('0x8')]=function(_0x2b7526,_0x233040){return _0x2b7526[_0x87b0('0x9')](_0x87b0('0xa'),attributes,{'tableName':_0x87b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b7066df..3615499 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x47064c,_0x26064d){var _0x1710de=function(_0x24c8f8){while(--_0x24c8f8){_0x47064c['push'](_0x47064c['shift']());}};_0x1710de(++_0x26064d);}(_0x70e0,0x17b));var _0x070e=function(_0x413c51,_0x265dd2){_0x413c51=_0x413c51-0x0;var _0xd1be5d=_0x70e0[_0x413c51];return _0xd1be5d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x11b809,_0x3eeaa9){var _0x4a81db=function(_0x343b5d){while(--_0x343b5d){_0x11b809['push'](_0x11b809['shift']());}};_0x4a81db(++_0x3eeaa9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 2422eb6..ef51aab 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 _0x99b0=['INTEGER','exports'];(function(_0x4cc6a9,_0x249bd8){var _0x3d9aa3=function(_0x3d1362){while(--_0x3d1362){_0x4cc6a9['push'](_0x4cc6a9['shift']());}};_0x3d9aa3(++_0x249bd8);}(_0x99b0,0xcb));var _0x099b=function(_0x2f1bc1,_0x58250e){_0x2f1bc1=_0x2f1bc1-0x0;var _0x5116ee=_0x99b0[_0x2f1bc1];return _0x5116ee;};'use strict';var Sequelize=require('sequelize');module[_0x099b('0x0')]={'penalty':{'type':Sequelize[_0x099b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x054c=['INTEGER','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x054c,0x18a));var _0xc054=function(_0x5b5bc2,_0x3f39b0){_0x5b5bc2=_0x5b5bc2-0x0;var _0x395834=_0x054c[_0x5b5bc2];return _0x395834;};'use strict';var Sequelize=require(_0xc054('0x0'));module[_0xc054('0x1')]={'penalty':{'type':Sequelize[_0xc054('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 1c0673b..410f50a 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 _0xdab2=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x251ae7,_0xa8af83){var _0x38aed7=function(_0x1518c9){while(--_0x1518c9){_0x251ae7['push'](_0x251ae7['shift']());}};_0x38aed7(++_0xa8af83);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var logger=require('../../config/logger')(_0x2dab('0x2'));var moment=require(_0x2dab('0x3'));var BPromise=require(_0x2dab('0x4'));var rp=require(_0x2dab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var attributes=require(_0x2dab('0x8'));module[_0x2dab('0x9')]=function(_0x4562bb,_0x1421d5){return _0x4562bb[_0x2dab('0xa')](_0x2dab('0xb'),attributes,{'tableName':_0x2dab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','bluebird'];(function(_0x16ab47,_0x1925f4){var _0x30d88d=function(_0x3a1c90){while(--_0x3a1c90){_0x16ab47['push'](_0x16ab47['shift']());}};_0x30d88d(++_0x1925f4);}(_0xb821,0xa7));var _0x1b82=function(_0x584ae8,_0x5b82b0){_0x584ae8=_0x584ae8-0x0;var _0xa7b607=_0xb821[_0x584ae8];return _0xa7b607;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 14fab20..7b00fc9 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 _0xea70=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x3ab6b1,_0x4e668d){var _0xac613e=function(_0x240446){while(--_0x240446){_0x3ab6b1['push'](_0x3ab6b1['shift']());}};_0xac613e(++_0x4e668d);}(_0xea70,0x175));var _0x0ea7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xea70[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x0ea7('0x0'));var util=require(_0x0ea7('0x1'));var moment=require(_0x0ea7('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ea7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ea7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ea7('0x5'))(_0x0ea7('0x6'));var config=require(_0x0ea7('0x7'));var jayson=require(_0x0ea7('0x8'));var client=jayson[_0x0ea7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x144497,_0x1ebefe,_0x51b516){return new BPromise(function(_0x48dedd,_0xc97410){return client['request'](_0x144497,_0x51b516)[_0x0ea7('0xa')](function(_0x107f04){logger[_0x0ea7('0xb')](_0x0ea7('0xc'),_0x1ebefe,'request\x20sent');logger[_0x0ea7('0xd')](_0x0ea7('0xe'),_0x1ebefe,_0x0ea7('0xf'),JSON[_0x0ea7('0x10')](_0x107f04));if(_0x107f04[_0x0ea7('0x11')]){if(_0x107f04['error'][_0x0ea7('0x12')]===0x1f4){logger[_0x0ea7('0x11')](_0x0ea7('0xc'),_0x1ebefe,_0x107f04['error']['message']);return _0xc97410(_0x107f04['error'][_0x0ea7('0x13')]);}logger[_0x0ea7('0x11')](_0x0ea7('0xc'),_0x1ebefe,_0x107f04[_0x0ea7('0x11')]['message']);return _0x48dedd(_0x107f04['error']['message']);}else{logger[_0x0ea7('0xb')](_0x0ea7('0xc'),_0x1ebefe,_0x0ea7('0xf'));_0x48dedd(_0x107f04['result']['message']);}})[_0x0ea7('0x14')](function(_0x2aa4e9){logger[_0x0ea7('0x11')](_0x0ea7('0xc'),_0x1ebefe,_0x2aa4e9);_0xc97410(_0x2aa4e9);});});} \ No newline at end of file +var _0xe50a=['info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe50a,0xf0));var _0xae50=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0xe50a[_0x30faee];return _0x3a90ab;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var moment=require(_0xae50('0x2'));var BPromise=require('bluebird');var rs=require(_0xae50('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae50('0x4'))['db'];var utils=require(_0xae50('0x5'));var logger=require('../../config/logger')(_0xae50('0x6'));var config=require(_0xae50('0x7'));var jayson=require(_0xae50('0x8'));var client=jayson['client'][_0xae50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59011e,_0x12639d,_0x533cc7){return new BPromise(function(_0x319294,_0x16e57b){return client[_0xae50('0xa')](_0x59011e,_0x533cc7)[_0xae50('0xb')](function(_0x1a3964){logger[_0xae50('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x12639d,_0xae50('0xd'));logger[_0xae50('0xe')](_0xae50('0xf'),_0x12639d,'request\x20sent',JSON['stringify'](_0x1a3964));if(_0x1a3964[_0xae50('0x10')]){if(_0x1a3964[_0xae50('0x10')][_0xae50('0x11')]===0x1f4){logger[_0xae50('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x12639d,_0x1a3964[_0xae50('0x10')][_0xae50('0x12')]);return _0x16e57b(_0x1a3964[_0xae50('0x10')][_0xae50('0x12')]);}logger['error'](_0xae50('0x13'),_0x12639d,_0x1a3964[_0xae50('0x10')][_0xae50('0x12')]);return _0x319294(_0x1a3964[_0xae50('0x10')][_0xae50('0x12')]);}else{logger[_0xae50('0xc')](_0xae50('0x13'),_0x12639d,_0xae50('0xd'));_0x319294(_0x1a3964['result'][_0xae50('0x12')]);}})[_0xae50('0x14')](function(_0x852470){logger[_0xae50('0x10')](_0xae50('0x13'),_0x12639d,_0x852470);_0x16e57b(_0x852470);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d7ae339..b612352 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 _0xc373=['create','put','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','/:id','isAuthenticated','show','post'];(function(_0x2d1a1a,_0x1b217c){var _0x234ee5=function(_0x225295){while(--_0x225295){_0x2d1a1a['push'](_0x2d1a1a['shift']());}};_0x234ee5(++_0x1b217c);}(_0xc373,0x1c7));var _0x3c37=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xc373[_0x528575];return _0x3063b7;};'use strict';var multer=require('multer');var util=require(_0x3c37('0x0'));var path=require(_0x3c37('0x1'));var timeout=require(_0x3c37('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3c37('0x3'));var auth=require(_0x3c37('0x4'));var interaction=require(_0x3c37('0x5'));var config=require(_0x3c37('0x6'));var controller=require(_0x3c37('0x7'));router[_0x3c37('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3c37('0x8')](_0x3c37('0x9'),auth[_0x3c37('0xa')](),controller[_0x3c37('0xb')]);router[_0x3c37('0xc')]('/',auth[_0x3c37('0xa')](),controller[_0x3c37('0xd')]);router[_0x3c37('0xe')](_0x3c37('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3c37('0xf')](_0x3c37('0x9'),auth[_0x3c37('0xa')](),controller[_0x3c37('0x10')]);module[_0x3c37('0x11')]=router; \ No newline at end of file +var _0x1c52=['create','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','post'];(function(_0x5bec0d,_0x462ab5){var _0xa69029=function(_0x2f6bf7){while(--_0x2f6bf7){_0x5bec0d['push'](_0x5bec0d['shift']());}};_0xa69029(++_0x462ab5);}(_0x1c52,0x7c));var _0x21c5=function(_0x2edd68,_0x1f6bcb){_0x2edd68=_0x2edd68-0x0;var _0x5b3ec1=_0x1c52[_0x2edd68];return _0x5b3ec1;};'use strict';var multer=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var path=require(_0x21c5('0x2'));var timeout=require(_0x21c5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x21c5('0x4'));var interaction=require(_0x21c5('0x5'));var config=require('../../config/environment');var controller=require(_0x21c5('0x6'));router[_0x21c5('0x7')]('/',auth[_0x21c5('0x8')](),controller[_0x21c5('0x9')]);router['get'](_0x21c5('0xa'),auth[_0x21c5('0x8')](),controller['show']);router[_0x21c5('0xb')]('/',auth[_0x21c5('0x8')](),controller[_0x21c5('0xc')]);router[_0x21c5('0xd')]('/:id',auth[_0x21c5('0x8')](),controller[_0x21c5('0xe')]);router[_0x21c5('0xf')]('/:id',auth[_0x21c5('0x8')](),controller['destroy']);module[_0x21c5('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 61b03be..34fefc8 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 _0xb0c3=['STRING','TEXT'];(function(_0x2f8cd1,_0x578ea3){var _0x1d8600=function(_0x3bbec6){while(--_0x3bbec6){_0x2f8cd1['push'](_0x2f8cd1['shift']());}};_0x1d8600(++_0x578ea3);}(_0xb0c3,0xca));var _0x3b0c=function(_0x533a23,_0x599429){_0x533a23=_0x533a23-0x0;var _0xbddcde=_0xb0c3[_0x533a23];return _0xbddcde;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3b0c('0x0')]},'description':{'type':Sequelize[_0x3b0c('0x0')]},'html':{'type':Sequelize[_0x3b0c('0x1')]}}; \ No newline at end of file +var _0x761b=['exports','STRING','TEXT','sequelize'];(function(_0x21ed04,_0x491420){var _0x357859=function(_0x539819){while(--_0x539819){_0x21ed04['push'](_0x21ed04['shift']());}};_0x357859(++_0x491420);}(_0x761b,0x17b));var _0xb761=function(_0x2c7377,_0x32ade5){_0x2c7377=_0x2c7377-0x0;var _0x35e181=_0x761b[_0x2c7377];return _0x35e181;};'use strict';var Sequelize=require(_0xb761('0x0'));module[_0xb761('0x1')]={'name':{'type':Sequelize[_0xb761('0x2')]},'description':{'type':Sequelize[_0xb761('0x2')]},'html':{'type':Sequelize[_0xb761('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9290d48..7a44654 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 _0xac73=['../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','Template','includeAll','include','findAll','catch','show','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','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','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4fe401,_0x3ce546){var _0x491572=function(_0x5567fd){while(--_0x5567fd){_0x4fe401['push'](_0x4fe401['shift']());}};_0x491572(++_0x3ce546);}(_0xac73,0x1e1));var _0x3ac7=function(_0x494dd7,_0x5525e0){_0x494dd7=_0x494dd7-0x0;var _0x20bc9b=_0xac73[_0x494dd7];return _0x20bc9b;};'use strict';var emlformat=require(_0x3ac7('0x0'));var rimraf=require(_0x3ac7('0x1'));var zipdir=require(_0x3ac7('0x2'));var jsonpatch=require(_0x3ac7('0x3'));var rp=require(_0x3ac7('0x4'));var moment=require(_0x3ac7('0x5'));var BPromise=require(_0x3ac7('0x6'));var Mustache=require('mustache');var util=require(_0x3ac7('0x7'));var path=require(_0x3ac7('0x8'));var sox=require(_0x3ac7('0x9'));var csv=require('to-csv');var ejs=require(_0x3ac7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ac7('0xb'));var squel=require('squel');var crypto=require(_0x3ac7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3ac7('0xd'));var toCsv=require(_0x3ac7('0xe'));var querystring=require(_0x3ac7('0xf'));var Papa=require(_0x3ac7('0x10'));var Redis=require(_0x3ac7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3ac7('0x12'));var as=require(_0x3ac7('0x13'));var hardwareService=require(_0x3ac7('0x14'));var logger=require(_0x3ac7('0x15'))(_0x3ac7('0x16'));var utils=require(_0x3ac7('0x17'));var config=require(_0x3ac7('0x18'));var licenseUtil=require(_0x3ac7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22838f,_0xb79c81){_0xb79c81=_0xb79c81||0xcc;return function(_0x5ac2d9){if(_0x5ac2d9){return _0x22838f['sendStatus'](_0xb79c81);}return _0x22838f['status'](_0xb79c81)[_0x3ac7('0x1a')]();};}function respondWithResult(_0xe1b84e,_0x47d348){_0x47d348=_0x47d348||0xc8;return function(_0x5a08af){if(_0x5a08af){return _0xe1b84e['status'](_0x47d348)[_0x3ac7('0x1b')](_0x5a08af);}};}function respondWithFilteredResult(_0x2454ab,_0x3ff06c){return function(_0x2fd198){if(_0x2fd198){var _0x4653f5=typeof _0x3ff06c[_0x3ac7('0x1c')]===_0x3ac7('0x1d')&&typeof _0x3ff06c[_0x3ac7('0x1e')]===_0x3ac7('0x1d');var _0x157966=_0x2fd198['count'];var _0x4ef6fe=_0x4653f5?0x0:_0x3ff06c['offset'];var _0x39f54f=_0x4653f5?_0x2fd198[_0x3ac7('0x1f')]:_0x3ff06c[_0x3ac7('0x1c')]+_0x3ff06c[_0x3ac7('0x1e')];var _0x40dbca;if(_0x39f54f>=_0x157966){_0x39f54f=_0x157966;_0x40dbca=0xc8;}else{_0x40dbca=0xce;}_0x2454ab[_0x3ac7('0x20')](_0x40dbca);return _0x2454ab['set'](_0x3ac7('0x21'),_0x4ef6fe+'-'+_0x39f54f+'/'+_0x157966)[_0x3ac7('0x1b')](_0x2fd198);}return null;};}function patchUpdates(_0x9f39bc){return function(_0x4f6ed7){try{jsonpatch[_0x3ac7('0x22')](_0x4f6ed7,_0x9f39bc,!![]);}catch(_0x1e28a5){return BPromise[_0x3ac7('0x23')](_0x1e28a5);}return _0x4f6ed7[_0x3ac7('0x24')]();};}function saveUpdates(_0x20175d,_0x3d5a7a){return function(_0x5924da){if(_0x5924da){return _0x5924da['update'](_0x20175d)[_0x3ac7('0x25')](function(_0x20f498){return _0x20f498;});}return null;};}function removeEntity(_0x31bc59,_0x113c67){return function(_0x5d8428){if(_0x5d8428){return _0x5d8428['destroy']()[_0x3ac7('0x25')](function(){var _0x4b7a89=_0x5d8428['get']({'plain':!![]});var _0x293ab3='Templates';return db[_0x3ac7('0x26')][_0x3ac7('0x27')]({'where':{'type':_0x293ab3,'resourceId':_0x4b7a89['id']}})[_0x3ac7('0x25')](function(){return _0x5d8428;});})[_0x3ac7('0x25')](function(){_0x31bc59[_0x3ac7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55291b,_0x53bd7a){return function(_0x17a6d6){if(!_0x17a6d6){_0x55291b[_0x3ac7('0x28')](0x194);}return _0x17a6d6;};}function handleError(_0x3f81ef,_0x4b99a3){_0x4b99a3=_0x4b99a3||0x1f4;return function(_0x2c00c6){logger[_0x3ac7('0x29')](_0x2c00c6[_0x3ac7('0x2a')]);if(_0x2c00c6[_0x3ac7('0x2b')]){delete _0x2c00c6[_0x3ac7('0x2b')];}_0x3f81ef[_0x3ac7('0x20')](_0x4b99a3)[_0x3ac7('0x2c')](_0x2c00c6);};}exports[_0x3ac7('0x2d')]=function(_0x598116,_0x146da1){var _0x5662c6={},_0x5e923c={},_0x5a4629={'count':0x0,'rows':[]};var _0x354823=_['map'](db['Template'][_0x3ac7('0x2e')],function(_0x6c4cbb){return{'name':_0x6c4cbb[_0x3ac7('0x2f')],'type':_0x6c4cbb['type']['key']};});_0x5e923c['model']=_[_0x3ac7('0x30')](_0x354823,'name');_0x5e923c[_0x3ac7('0x31')]=_[_0x3ac7('0x32')](_0x598116[_0x3ac7('0x31')]);_0x5e923c[_0x3ac7('0x33')]=_[_0x3ac7('0x34')](_0x5e923c[_0x3ac7('0x35')],_0x5e923c['query']);_0x5662c6[_0x3ac7('0x36')]=_[_0x3ac7('0x34')](_0x5e923c[_0x3ac7('0x35')],qs[_0x3ac7('0x37')](_0x598116[_0x3ac7('0x31')][_0x3ac7('0x37')]));_0x5662c6[_0x3ac7('0x36')]=_0x5662c6[_0x3ac7('0x36')][_0x3ac7('0x38')]?_0x5662c6[_0x3ac7('0x36')]:_0x5e923c[_0x3ac7('0x35')];if(!_0x598116[_0x3ac7('0x31')][_0x3ac7('0x39')](_0x3ac7('0x3a'))){_0x5662c6['limit']=qs[_0x3ac7('0x1e')](_0x598116[_0x3ac7('0x31')][_0x3ac7('0x1e')]);_0x5662c6[_0x3ac7('0x1c')]=qs[_0x3ac7('0x1c')](_0x598116['query'][_0x3ac7('0x1c')]);}_0x5662c6[_0x3ac7('0x3b')]=qs[_0x3ac7('0x3c')](_0x598116['query'][_0x3ac7('0x3c')]);_0x5662c6[_0x3ac7('0x3d')]=qs['filters'](_[_0x3ac7('0x3e')](_0x598116[_0x3ac7('0x31')],_0x5e923c['filters']),_0x354823);if(_0x598116[_0x3ac7('0x31')]['filter']){_0x5662c6['where']=_[_0x3ac7('0x3f')](_0x5662c6['where'],{'$or':_['map'](_0x354823,function(_0x3b1500){if(_0x3b1500[_0x3ac7('0x40')]!==_0x3ac7('0x41')){var _0x4b77ec={};_0x4b77ec[_0x3b1500['name']]={'$like':'%'+_0x598116[_0x3ac7('0x31')][_0x3ac7('0x42')]+'%'};return _0x4b77ec;}})});}_0x5662c6=_[_0x3ac7('0x3f')]({},_0x5662c6,_0x598116['options']);var _0x19724f={'where':_0x5662c6['where']};return db[_0x3ac7('0x43')][_0x3ac7('0x1f')](_0x19724f)[_0x3ac7('0x25')](function(_0x23cf5d){_0x5a4629[_0x3ac7('0x1f')]=_0x23cf5d;if(_0x598116[_0x3ac7('0x31')][_0x3ac7('0x44')]){_0x5662c6[_0x3ac7('0x45')]=[{'all':!![]}];}return db['Template'][_0x3ac7('0x46')](_0x5662c6);})[_0x3ac7('0x25')](function(_0x116cfe){_0x5a4629['rows']=_0x116cfe;return _0x5a4629;})[_0x3ac7('0x25')](respondWithFilteredResult(_0x146da1,_0x5662c6))[_0x3ac7('0x47')](handleError(_0x146da1,null));};exports[_0x3ac7('0x48')]=function(_0x16699a,_0x1f48cb){var _0x997e78={'raw':!![],'where':{'id':_0x16699a['params']['id']}},_0x4b3316={};_0x4b3316[_0x3ac7('0x35')]=_['keys'](db[_0x3ac7('0x43')]['rawAttributes']);_0x4b3316[_0x3ac7('0x31')]=_[_0x3ac7('0x32')](_0x16699a[_0x3ac7('0x31')]);_0x4b3316[_0x3ac7('0x33')]=_['intersection'](_0x4b3316[_0x3ac7('0x35')],_0x4b3316['query']);_0x997e78[_0x3ac7('0x36')]=_['intersection'](_0x4b3316[_0x3ac7('0x35')],qs[_0x3ac7('0x37')](_0x16699a[_0x3ac7('0x31')]['fields']));_0x997e78[_0x3ac7('0x36')]=_0x997e78[_0x3ac7('0x36')]['length']?_0x997e78[_0x3ac7('0x36')]:_0x4b3316[_0x3ac7('0x35')];if(_0x16699a[_0x3ac7('0x31')][_0x3ac7('0x44')]){_0x997e78[_0x3ac7('0x45')]=[{'all':!![]}];}_0x997e78=_[_0x3ac7('0x3f')]({},_0x997e78,_0x16699a[_0x3ac7('0x49')]);return db[_0x3ac7('0x43')][_0x3ac7('0x4a')](_0x997e78)[_0x3ac7('0x25')](handleEntityNotFound(_0x1f48cb,null))['then'](respondWithResult(_0x1f48cb,null))[_0x3ac7('0x47')](handleError(_0x1f48cb,null));};exports[_0x3ac7('0x4b')]=function(_0x58ecc4,_0x54cf26){return db['Template'][_0x3ac7('0x4b')](_0x58ecc4[_0x3ac7('0x4c')],{})[_0x3ac7('0x25')](function(_0x11422b){var _0x2d6aec=_0x58ecc4['user'][_0x3ac7('0x4d')]({'plain':!![]});if(!_0x2d6aec)throw new Error(_0x3ac7('0x4e'));if(_0x2d6aec[_0x3ac7('0x4f')]===_0x3ac7('0x50')){var _0x5bbcf6=_0x11422b[_0x3ac7('0x4d')]({'plain':!![]});var _0xd5b443='Templates';return db[_0x3ac7('0x51')][_0x3ac7('0x4a')]({'where':{'name':_0xd5b443,'userProfileId':_0x2d6aec[_0x3ac7('0x52')]},'raw':!![]})[_0x3ac7('0x25')](function(_0x55d4bb){if(_0x55d4bb&&_0x55d4bb['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ac7('0x4b')]({'name':_0x5bbcf6['name'],'resourceId':_0x5bbcf6['id'],'type':_0x55d4bb[_0x3ac7('0x2b')],'sectionId':_0x55d4bb['id']},{})['then'](function(){return _0x11422b;});}else{return _0x11422b;}})[_0x3ac7('0x47')](function(_0x2c5385){logger[_0x3ac7('0x29')](_0x3ac7('0x53'),_0x2c5385);throw _0x2c5385;});}return _0x11422b;})[_0x3ac7('0x25')](respondWithResult(_0x54cf26,0xc9))[_0x3ac7('0x47')](handleError(_0x54cf26,null));};exports['update']=function(_0x2468d7,_0x372e0a){if(_0x2468d7[_0x3ac7('0x4c')]['id']){delete _0x2468d7[_0x3ac7('0x4c')]['id'];}return db[_0x3ac7('0x43')][_0x3ac7('0x4a')]({'where':{'id':_0x2468d7['params']['id']}})[_0x3ac7('0x25')](handleEntityNotFound(_0x372e0a,null))[_0x3ac7('0x25')](saveUpdates(_0x2468d7[_0x3ac7('0x4c')],null))[_0x3ac7('0x25')](respondWithResult(_0x372e0a,null))[_0x3ac7('0x47')](handleError(_0x372e0a,null));};exports[_0x3ac7('0x27')]=function(_0x278138,_0x571bd2){return db[_0x3ac7('0x43')][_0x3ac7('0x4a')]({'where':{'id':_0x278138['params']['id']}})[_0x3ac7('0x25')](handleEntityNotFound(_0x571bd2,null))[_0x3ac7('0x25')](removeEntity(_0x571bd2,null))[_0x3ac7('0x47')](handleError(_0x571bd2,null));}; \ No newline at end of file +var _0x31b8=['merge','VIRTUAL','options','catch','show','params','rawAttributes','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','Templates','UserProfileResource','name','send','index','map','Template','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x6210e,_0x10bbaa){var _0x4b7830=function(_0x59a093){while(--_0x59a093){_0x6210e['push'](_0x6210e['shift']());}};_0x4b7830(++_0x10bbaa);}(_0x31b8,0xa9));var _0x831b=function(_0x48db26,_0x27feba){_0x48db26=_0x48db26-0x0;var _0x420c4d=_0x31b8[_0x48db26];return _0x420c4d;};'use strict';var emlformat=require(_0x831b('0x0'));var rimraf=require(_0x831b('0x1'));var zipdir=require(_0x831b('0x2'));var jsonpatch=require(_0x831b('0x3'));var rp=require(_0x831b('0x4'));var moment=require(_0x831b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x831b('0x6'));var util=require(_0x831b('0x7'));var path=require(_0x831b('0x8'));var sox=require(_0x831b('0x9'));var csv=require(_0x831b('0xa'));var ejs=require(_0x831b('0xb'));var fs=require('fs');var fs_extra=require(_0x831b('0xc'));var _=require(_0x831b('0xd'));var squel=require('squel');var crypto=require(_0x831b('0xe'));var jsforce=require(_0x831b('0xf'));var deskjs=require(_0x831b('0x10'));var toCsv=require(_0x831b('0xa'));var querystring=require('querystring');var Papa=require(_0x831b('0x11'));var Redis=require(_0x831b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x831b('0x13'));var as=require(_0x831b('0x14'));var hardwareService=require(_0x831b('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x831b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x831b('0x17'));var db=require(_0x831b('0x18'))['db'];function respondWithStatusCode(_0x59ac51,_0x35d48a){_0x35d48a=_0x35d48a||0xcc;return function(_0x13df97){if(_0x13df97){return _0x59ac51['sendStatus'](_0x35d48a);}return _0x59ac51[_0x831b('0x19')](_0x35d48a)[_0x831b('0x1a')]();};}function respondWithResult(_0x507bda,_0x23e45d){_0x23e45d=_0x23e45d||0xc8;return function(_0x4a7923){if(_0x4a7923){return _0x507bda[_0x831b('0x19')](_0x23e45d)[_0x831b('0x1b')](_0x4a7923);}};}function respondWithFilteredResult(_0x3b4e2b,_0x4013aa){return function(_0x211c49){if(_0x211c49){var _0x2fefa9=typeof _0x4013aa[_0x831b('0x1c')]===_0x831b('0x1d')&&typeof _0x4013aa[_0x831b('0x1e')]==='undefined';var _0x257239=_0x211c49[_0x831b('0x1f')];var _0x5c7273=_0x2fefa9?0x0:_0x4013aa['offset'];var _0x3ac7d3=_0x2fefa9?_0x211c49[_0x831b('0x1f')]:_0x4013aa['offset']+_0x4013aa[_0x831b('0x1e')];var _0x1c656a;if(_0x3ac7d3>=_0x257239){_0x3ac7d3=_0x257239;_0x1c656a=0xc8;}else{_0x1c656a=0xce;}_0x3b4e2b[_0x831b('0x19')](_0x1c656a);return _0x3b4e2b[_0x831b('0x20')](_0x831b('0x21'),_0x5c7273+'-'+_0x3ac7d3+'/'+_0x257239)[_0x831b('0x1b')](_0x211c49);}return null;};}function patchUpdates(_0x22c8d4){return function(_0x4d7c02){try{jsonpatch[_0x831b('0x22')](_0x4d7c02,_0x22c8d4,!![]);}catch(_0x10a1ca){return BPromise['reject'](_0x10a1ca);}return _0x4d7c02['save']();};}function saveUpdates(_0x3ee180,_0x5b2d1d){return function(_0x14cf13){if(_0x14cf13){return _0x14cf13['update'](_0x3ee180)[_0x831b('0x23')](function(_0x125bb1){return _0x125bb1;});}return null;};}function removeEntity(_0x24d71a,_0x35b444){return function(_0x224ca0){if(_0x224ca0){return _0x224ca0['destroy']()[_0x831b('0x23')](function(){var _0x534d9e=_0x224ca0['get']({'plain':!![]});var _0x514f56=_0x831b('0x24');return db[_0x831b('0x25')]['destroy']({'where':{'type':_0x514f56,'resourceId':_0x534d9e['id']}})['then'](function(){return _0x224ca0;});})[_0x831b('0x23')](function(){_0x24d71a['status'](0xcc)[_0x831b('0x1a')]();});}};}function handleEntityNotFound(_0x57a9ed,_0x373740){return function(_0x390a1b){if(!_0x390a1b){_0x57a9ed['sendStatus'](0x194);}return _0x390a1b;};}function handleError(_0x7d2cec,_0x182795){_0x182795=_0x182795||0x1f4;return function(_0x19b0f0){logger['error'](_0x19b0f0['stack']);if(_0x19b0f0[_0x831b('0x26')]){delete _0x19b0f0['name'];}_0x7d2cec['status'](_0x182795)[_0x831b('0x27')](_0x19b0f0);};}exports[_0x831b('0x28')]=function(_0x5d6191,_0x1825ff){var _0x3380c3={},_0x4f0263={},_0x549efc={'count':0x0,'rows':[]};var _0x5dab44=_[_0x831b('0x29')](db[_0x831b('0x2a')]['rawAttributes'],function(_0x3a5e08){return{'name':_0x3a5e08[_0x831b('0x2b')],'type':_0x3a5e08[_0x831b('0x2c')]['key']};});_0x4f0263[_0x831b('0x2d')]=_[_0x831b('0x29')](_0x5dab44,'name');_0x4f0263[_0x831b('0x2e')]=_[_0x831b('0x2f')](_0x5d6191['query']);_0x4f0263['filters']=_['intersection'](_0x4f0263[_0x831b('0x2d')],_0x4f0263['query']);_0x3380c3[_0x831b('0x30')]=_[_0x831b('0x31')](_0x4f0263[_0x831b('0x2d')],qs['fields'](_0x5d6191[_0x831b('0x2e')][_0x831b('0x32')]));_0x3380c3['attributes']=_0x3380c3[_0x831b('0x30')][_0x831b('0x33')]?_0x3380c3[_0x831b('0x30')]:_0x4f0263[_0x831b('0x2d')];if(!_0x5d6191[_0x831b('0x2e')]['hasOwnProperty'](_0x831b('0x34'))){_0x3380c3[_0x831b('0x1e')]=qs['limit'](_0x5d6191[_0x831b('0x2e')][_0x831b('0x1e')]);_0x3380c3['offset']=qs[_0x831b('0x1c')](_0x5d6191['query'][_0x831b('0x1c')]);}_0x3380c3[_0x831b('0x35')]=qs[_0x831b('0x36')](_0x5d6191[_0x831b('0x2e')][_0x831b('0x36')]);_0x3380c3[_0x831b('0x37')]=qs[_0x831b('0x38')](_[_0x831b('0x39')](_0x5d6191[_0x831b('0x2e')],_0x4f0263[_0x831b('0x38')]),_0x5dab44);if(_0x5d6191[_0x831b('0x2e')][_0x831b('0x3a')]){_0x3380c3[_0x831b('0x37')]=_[_0x831b('0x3b')](_0x3380c3[_0x831b('0x37')],{'$or':_['map'](_0x5dab44,function(_0x57c7ab){if(_0x57c7ab[_0x831b('0x2c')]!==_0x831b('0x3c')){var _0x5bac0f={};_0x5bac0f[_0x57c7ab[_0x831b('0x26')]]={'$like':'%'+_0x5d6191[_0x831b('0x2e')][_0x831b('0x3a')]+'%'};return _0x5bac0f;}})});}_0x3380c3=_[_0x831b('0x3b')]({},_0x3380c3,_0x5d6191[_0x831b('0x3d')]);var _0x5aaf53={'where':_0x3380c3[_0x831b('0x37')]};return db[_0x831b('0x2a')][_0x831b('0x1f')](_0x5aaf53)[_0x831b('0x23')](function(_0x2e74bc){_0x549efc[_0x831b('0x1f')]=_0x2e74bc;if(_0x5d6191['query']['includeAll']){_0x3380c3['include']=[{'all':!![]}];}return db[_0x831b('0x2a')]['findAll'](_0x3380c3);})[_0x831b('0x23')](function(_0x2a83ba){_0x549efc['rows']=_0x2a83ba;return _0x549efc;})[_0x831b('0x23')](respondWithFilteredResult(_0x1825ff,_0x3380c3))[_0x831b('0x3e')](handleError(_0x1825ff,null));};exports[_0x831b('0x3f')]=function(_0xf49db5,_0x8e6e0c){var _0x38d4d6={'raw':!![],'where':{'id':_0xf49db5[_0x831b('0x40')]['id']}},_0x2528d9={};_0x2528d9['model']=_[_0x831b('0x2f')](db['Template'][_0x831b('0x41')]);_0x2528d9[_0x831b('0x2e')]=_[_0x831b('0x2f')](_0xf49db5[_0x831b('0x2e')]);_0x2528d9[_0x831b('0x38')]=_['intersection'](_0x2528d9[_0x831b('0x2d')],_0x2528d9[_0x831b('0x2e')]);_0x38d4d6[_0x831b('0x30')]=_[_0x831b('0x31')](_0x2528d9['model'],qs[_0x831b('0x32')](_0xf49db5['query'][_0x831b('0x32')]));_0x38d4d6[_0x831b('0x30')]=_0x38d4d6[_0x831b('0x30')][_0x831b('0x33')]?_0x38d4d6[_0x831b('0x30')]:_0x2528d9['model'];if(_0xf49db5[_0x831b('0x2e')]['includeAll']){_0x38d4d6['include']=[{'all':!![]}];}_0x38d4d6=_['merge']({},_0x38d4d6,_0xf49db5[_0x831b('0x3d')]);return db[_0x831b('0x2a')][_0x831b('0x42')](_0x38d4d6)[_0x831b('0x23')](handleEntityNotFound(_0x8e6e0c,null))[_0x831b('0x23')](respondWithResult(_0x8e6e0c,null))[_0x831b('0x3e')](handleError(_0x8e6e0c,null));};exports[_0x831b('0x43')]=function(_0x1e0b5a,_0x4396b5){return db[_0x831b('0x2a')][_0x831b('0x43')](_0x1e0b5a[_0x831b('0x44')],{})['then'](function(_0x21638c){var _0x5353d6=_0x1e0b5a[_0x831b('0x45')][_0x831b('0x46')]({'plain':!![]});if(!_0x5353d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5353d6['role']===_0x831b('0x45')){var _0x4ae5d0=_0x21638c[_0x831b('0x46')]({'plain':!![]});var _0x3c7057='Templates';return db[_0x831b('0x47')]['find']({'where':{'name':_0x3c7057,'userProfileId':_0x5353d6[_0x831b('0x48')]},'raw':!![]})[_0x831b('0x23')](function(_0x555a5a){if(_0x555a5a&&_0x555a5a[_0x831b('0x49')]===0x0){return db['UserProfileResource'][_0x831b('0x43')]({'name':_0x4ae5d0['name'],'resourceId':_0x4ae5d0['id'],'type':_0x555a5a[_0x831b('0x26')],'sectionId':_0x555a5a['id']},{})['then'](function(){return _0x21638c;});}else{return _0x21638c;}})[_0x831b('0x3e')](function(_0x3b3742){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b3742);throw _0x3b3742;});}return _0x21638c;})[_0x831b('0x23')](respondWithResult(_0x4396b5,0xc9))['catch'](handleError(_0x4396b5,null));};exports[_0x831b('0x4a')]=function(_0x27c583,_0x19dc62){if(_0x27c583[_0x831b('0x44')]['id']){delete _0x27c583[_0x831b('0x44')]['id'];}return db[_0x831b('0x2a')][_0x831b('0x42')]({'where':{'id':_0x27c583['params']['id']}})[_0x831b('0x23')](handleEntityNotFound(_0x19dc62,null))['then'](saveUpdates(_0x27c583['body'],null))[_0x831b('0x23')](respondWithResult(_0x19dc62,null))[_0x831b('0x3e')](handleError(_0x19dc62,null));};exports[_0x831b('0x4b')]=function(_0xc23a7e,_0x5077c3){return db[_0x831b('0x2a')][_0x831b('0x42')]({'where':{'id':_0xc23a7e[_0x831b('0x40')]['id']}})[_0x831b('0x23')](handleEntityNotFound(_0x5077c3,null))[_0x831b('0x23')](removeEntity(_0x5077c3,null))[_0x831b('0x3e')](handleError(_0x5077c3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c4b7103..d28a04a 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 _0x10ea=['./template.attributes','exports','tools_templates','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x200eb6,_0x5591a1){var _0x47397b=function(_0x4602c6){while(--_0x4602c6){_0x200eb6['push'](_0x200eb6['shift']());}};_0x47397b(++_0x5591a1);}(_0x10ea,0xa3));var _0xa10e=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x10ea[_0x2a7b50];return _0x4224c9;};'use strict';var _=require(_0xa10e('0x0'));var util=require(_0xa10e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa10e('0x2'));var BPromise=require(_0xa10e('0x3'));var rp=require(_0xa10e('0x4'));var fs=require('fs');var path=require(_0xa10e('0x5'));var rimraf=require(_0xa10e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa10e('0x7'));module[_0xa10e('0x8')]=function(_0x47da99,_0x32b9b9){return _0x47da99['define']('Template',attributes,{'tableName':_0xa10e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5c2=['bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x488aee,_0x4724c3){var _0x7e0d53=function(_0x7aaa18){while(--_0x7aaa18){_0x488aee['push'](_0x488aee['shift']());}};_0x7e0d53(++_0x4724c3);}(_0xe5c2,0x19f));var _0x2e5c=function(_0xfae341,_0x444243){_0xfae341=_0xfae341-0x0;var _0x37fe9e=_0xe5c2[_0xfae341];return _0x37fe9e;};'use strict';var _=require(_0x2e5c('0x0'));var util=require(_0x2e5c('0x1'));var logger=require(_0x2e5c('0x2'))(_0x2e5c('0x3'));var moment=require(_0x2e5c('0x4'));var BPromise=require(_0x2e5c('0x5'));var rp=require(_0x2e5c('0x6'));var fs=require('fs');var path=require(_0x2e5c('0x7'));var rimraf=require(_0x2e5c('0x8'));var config=require('../../config/environment');var attributes=require(_0x2e5c('0x9'));module[_0x2e5c('0xa')]=function(_0x3df2bf,_0x2c8c16){return _0x3df2bf[_0x2e5c('0xb')](_0x2e5c('0xc'),attributes,{'tableName':_0x2e5c('0xd'),'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 090f4a4..a13dd66 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 _0xe17e=['GetTemplate','Template','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xe17e,0xc9));var _0xee17=function(_0x12accc,_0x323f15){_0x12accc=_0x12accc-0x0;var _0x2d2608=_0xe17e[_0x12accc];return _0x2d2608;};'use strict';var _=require(_0xee17('0x0'));var util=require(_0xee17('0x1'));var moment=require(_0xee17('0x2'));var BPromise=require('bluebird');var rs=require(_0xee17('0x3'));var fs=require('fs');var Redis=require(_0xee17('0x4'));var db=require(_0xee17('0x5'))['db'];var utils=require(_0xee17('0x6'));var logger=require(_0xee17('0x7'))('rpc');var config=require(_0xee17('0x8'));var jayson=require(_0xee17('0x9'));var client=jayson[_0xee17('0xa')][_0xee17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3307ac,_0x55abf3,_0x5f4ccc){return new BPromise(function(_0x47c05e,_0x1aaefd){return client[_0xee17('0xc')](_0x3307ac,_0x5f4ccc)[_0xee17('0xd')](function(_0x18dc21){logger[_0xee17('0xe')](_0xee17('0xf'),_0x55abf3,_0xee17('0x10'));logger['debug'](_0xee17('0x11'),_0x55abf3,'request\x20sent',JSON[_0xee17('0x12')](_0x18dc21));if(_0x18dc21[_0xee17('0x13')]){if(_0x18dc21[_0xee17('0x13')][_0xee17('0x14')]===0x1f4){logger[_0xee17('0x13')]('Template,\x20%s,\x20%s',_0x55abf3,_0x18dc21['error'][_0xee17('0x15')]);return _0x1aaefd(_0x18dc21[_0xee17('0x13')]['message']);}logger[_0xee17('0x13')]('Template,\x20%s,\x20%s',_0x55abf3,_0x18dc21[_0xee17('0x13')][_0xee17('0x15')]);return _0x47c05e(_0x18dc21[_0xee17('0x13')][_0xee17('0x15')]);}else{logger[_0xee17('0xe')](_0xee17('0xf'),_0x55abf3,_0xee17('0x10'));_0x47c05e(_0x18dc21[_0xee17('0x16')][_0xee17('0x15')]);}})['catch'](function(_0xfb48fa){logger['error'](_0xee17('0xf'),_0x55abf3,_0xfb48fa);_0x1aaefd(_0xfb48fa);});});}exports[_0xee17('0x17')]=function(_0x2b78ea){var _0x1bf1c3=this;return new Promise(function(_0x51f623,_0x94caa9){return db[_0xee17('0x18')]['findAll']({'raw':_0x2b78ea[_0xee17('0x19')]?_0x2b78ea[_0xee17('0x19')][_0xee17('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b78ea[_0xee17('0x19')]?_0x2b78ea['options'][_0xee17('0x1b')]||null:null,'attributes':_0x2b78ea[_0xee17('0x19')]?_0x2b78ea[_0xee17('0x19')][_0xee17('0x1c')]||null:null,'limit':_0x2b78ea['options']?_0x2b78ea[_0xee17('0x19')]['limit']||null:null,'include':_0x2b78ea['options']?_0x2b78ea['options'][_0xee17('0x1d')]?_[_0xee17('0x1e')](_0x2b78ea[_0xee17('0x19')][_0xee17('0x1d')],function(_0x94773b){return{'model':db[_0x94773b[_0xee17('0x1f')]],'as':_0x94773b['as'],'attributes':_0x94773b[_0xee17('0x1c')],'include':_0x94773b[_0xee17('0x1d')]?_['map'](_0x94773b['include'],function(_0x5ac584){return{'model':db[_0x5ac584[_0xee17('0x1f')]],'as':_0x5ac584['as'],'attributes':_0x5ac584['attributes'],'include':_0x5ac584[_0xee17('0x1d')]?_[_0xee17('0x1e')](_0x5ac584[_0xee17('0x1d')],function(_0x11459f){return{'model':db[_0x11459f['model']],'as':_0x11459f['as'],'attributes':_0x11459f[_0xee17('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xee17('0xd')](function(_0x2b9892){logger[_0xee17('0xe')](_0xee17('0x17'),_0x2b78ea);logger['debug'](_0xee17('0x17'),_0x2b78ea,JSON[_0xee17('0x12')](_0x2b9892));_0x51f623(_0x2b9892);})['catch'](function(_0x1dafe2){logger[_0xee17('0x13')](_0xee17('0x17'),_0x1dafe2['message'],_0x2b78ea);_0x94caa9(_0x1bf1c3[_0xee17('0x13')](0x1f4,_0x1dafe2['message']));});});}; \ No newline at end of file +var _0xe33c=['client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xe33c,0x1a4));var _0xce33=function(_0x4de051,_0x562ce0){_0x4de051=_0x4de051-0x0;var _0x4a6adc=_0xe33c[_0x4de051];return _0x4a6adc;};'use strict';var _=require('lodash');var util=require(_0xce33('0x0'));var moment=require('moment');var BPromise=require(_0xce33('0x1'));var rs=require(_0xce33('0x2'));var fs=require('fs');var Redis=require(_0xce33('0x3'));var db=require(_0xce33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce33('0x5'))(_0xce33('0x6'));var config=require(_0xce33('0x7'));var jayson=require(_0xce33('0x8'));var client=jayson[_0xce33('0x9')][_0xce33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c0de,_0x41f42f,_0x21cd17){return new BPromise(function(_0x18b060,_0x168733){return client[_0xce33('0xb')](_0x32c0de,_0x21cd17)[_0xce33('0xc')](function(_0x3e0217){logger['info'](_0xce33('0xd'),_0x41f42f,_0xce33('0xe'));logger[_0xce33('0xf')](_0xce33('0x10'),_0x41f42f,'request\x20sent',JSON['stringify'](_0x3e0217));if(_0x3e0217[_0xce33('0x11')]){if(_0x3e0217[_0xce33('0x11')][_0xce33('0x12')]===0x1f4){logger[_0xce33('0x11')]('Template,\x20%s,\x20%s',_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x168733(_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);}logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x18b060(_0x3e0217[_0xce33('0x11')]['message']);}else{logger[_0xce33('0x14')](_0xce33('0xd'),_0x41f42f,'request\x20sent');_0x18b060(_0x3e0217[_0xce33('0x15')][_0xce33('0x13')]);}})[_0xce33('0x16')](function(_0x24b026){logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x24b026);_0x168733(_0x24b026);});});}exports[_0xce33('0x17')]=function(_0x50bfff){var _0x39e6ec=this;return new Promise(function(_0x46a911,_0x565617){return db[_0xce33('0x18')]['findAll']({'raw':_0x50bfff['options']?_0x50bfff[_0xce33('0x19')][_0xce33('0x1a')]===undefined?!![]:![]:!![],'where':_0x50bfff[_0xce33('0x19')]?_0x50bfff[_0xce33('0x19')][_0xce33('0x1b')]||null:null,'attributes':_0x50bfff[_0xce33('0x19')]?_0x50bfff[_0xce33('0x19')][_0xce33('0x1c')]||null:null,'limit':_0x50bfff[_0xce33('0x19')]?_0x50bfff['options'][_0xce33('0x1d')]||null:null,'include':_0x50bfff[_0xce33('0x19')]?_0x50bfff[_0xce33('0x19')][_0xce33('0x1e')]?_[_0xce33('0x1f')](_0x50bfff['options']['include'],function(_0x892b5){return{'model':db[_0x892b5[_0xce33('0x20')]],'as':_0x892b5['as'],'attributes':_0x892b5[_0xce33('0x1c')],'include':_0x892b5[_0xce33('0x1e')]?_[_0xce33('0x1f')](_0x892b5[_0xce33('0x1e')],function(_0x2f914c){return{'model':db[_0x2f914c[_0xce33('0x20')]],'as':_0x2f914c['as'],'attributes':_0x2f914c['attributes'],'include':_0x2f914c['include']?_['map'](_0x2f914c[_0xce33('0x1e')],function(_0x3e2d83){return{'model':db[_0x3e2d83['model']],'as':_0x3e2d83['as'],'attributes':_0x3e2d83[_0xce33('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xce33('0xc')](function(_0x510cce){logger[_0xce33('0x14')]('GetTemplate',_0x50bfff);logger[_0xce33('0xf')](_0xce33('0x17'),_0x50bfff,JSON['stringify'](_0x510cce));_0x46a911(_0x510cce);})[_0xce33('0x16')](function(_0x150de3){logger[_0xce33('0x11')](_0xce33('0x17'),_0x150de3[_0xce33('0x13')],_0x50bfff);_0x565617(_0x39e6ec[_0xce33('0x11')](0x1f4,_0x150de3[_0xce33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ba8fca6..04238dc 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 _0x9ba6=['show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id'];(function(_0x28d34e,_0x3b3ae1){var _0x491759=function(_0x13f7e9){while(--_0x13f7e9){_0x28d34e['push'](_0x28d34e['shift']());}};_0x491759(++_0x3b3ae1);}(_0x9ba6,0x13b));var _0x69ba=function(_0x2e8083,_0x2a847b){_0x2e8083=_0x2e8083-0x0;var _0x28a5ef=_0x9ba6[_0x2e8083];return _0x28a5ef;};'use strict';var multer=require(_0x69ba('0x0'));var util=require('util');var path=require(_0x69ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x69ba('0x2'));var router=express['Router']();var fs_extra=require(_0x69ba('0x3'));var auth=require(_0x69ba('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x69ba('0x5'));router[_0x69ba('0x6')]('/',auth[_0x69ba('0x7')](),controller[_0x69ba('0x8')]);router[_0x69ba('0x6')](_0x69ba('0x9'),auth[_0x69ba('0x7')](),controller[_0x69ba('0xa')]);router['get'](_0x69ba('0xb'),auth[_0x69ba('0x7')](),controller['getAllConditions']);router['get'](_0x69ba('0xc'),auth[_0x69ba('0x7')](),controller[_0x69ba('0xd')]);router['get'](_0x69ba('0xe'),auth[_0x69ba('0x7')](),controller[_0x69ba('0xf')]);router[_0x69ba('0x10')]('/',auth['isAuthenticated'](),controller[_0x69ba('0x11')]);router[_0x69ba('0x10')](_0x69ba('0xb'),auth[_0x69ba('0x7')](),controller[_0x69ba('0x12')]);router[_0x69ba('0x10')]('/:id/any_conditions',auth[_0x69ba('0x7')](),controller[_0x69ba('0x13')]);router[_0x69ba('0x10')](_0x69ba('0xe'),auth[_0x69ba('0x7')](),controller[_0x69ba('0x14')]);router['put'](_0x69ba('0x9'),auth[_0x69ba('0x7')](),controller[_0x69ba('0x15')]);router[_0x69ba('0x16')](_0x69ba('0x9'),auth[_0x69ba('0x7')](),controller[_0x69ba('0x17')]);module[_0x69ba('0x18')]=router; \ No newline at end of file +var _0x7c87=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x7c87,0x1a1));var _0x77c8=function(_0x4ae525,_0x2ebe1a){_0x4ae525=_0x4ae525-0x0;var _0x522bdc=_0x7c87[_0x4ae525];return _0x522bdc;};'use strict';var multer=require(_0x77c8('0x0'));var util=require(_0x77c8('0x1'));var path=require(_0x77c8('0x2'));var timeout=require(_0x77c8('0x3'));var express=require(_0x77c8('0x4'));var router=express['Router']();var fs_extra=require(_0x77c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77c8('0x6'));var config=require(_0x77c8('0x7'));var controller=require(_0x77c8('0x8'));router[_0x77c8('0x9')]('/',auth['isAuthenticated'](),controller[_0x77c8('0xa')]);router[_0x77c8('0x9')](_0x77c8('0xb'),auth[_0x77c8('0xc')](),controller[_0x77c8('0xd')]);router[_0x77c8('0x9')](_0x77c8('0xe'),auth[_0x77c8('0xc')](),controller['getAllConditions']);router[_0x77c8('0x9')](_0x77c8('0xf'),auth[_0x77c8('0xc')](),controller[_0x77c8('0x10')]);router[_0x77c8('0x9')](_0x77c8('0x11'),auth[_0x77c8('0xc')](),controller[_0x77c8('0x12')]);router[_0x77c8('0x13')]('/',auth['isAuthenticated'](),controller[_0x77c8('0x14')]);router[_0x77c8('0x13')](_0x77c8('0xe'),auth[_0x77c8('0xc')](),controller['addAllCondition']);router[_0x77c8('0x13')]('/:id/any_conditions',auth[_0x77c8('0xc')](),controller[_0x77c8('0x15')]);router['post'](_0x77c8('0x11'),auth[_0x77c8('0xc')](),controller[_0x77c8('0x16')]);router[_0x77c8('0x17')](_0x77c8('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x77c8('0x18')](_0x77c8('0xb'),auth['isAuthenticated'](),controller[_0x77c8('0x19')]);module[_0x77c8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 61cb841..313d19b 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 _0x3e7b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3e7b,0x12c));var _0xb3e7=function(_0x332075,_0x24582d){_0x332075=_0x332075-0x0;var _0x2c7c50=_0x3e7b[_0x332075];return _0x2c7c50;};'use strict';var Sequelize=require(_0xb3e7('0x0'));module[_0xb3e7('0x1')]={'name':{'type':Sequelize[_0xb3e7('0x2')]},'channel':{'type':Sequelize[_0xb3e7('0x2')]},'description':{'type':Sequelize[_0xb3e7('0x2')]},'status':{'type':Sequelize[_0xb3e7('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9188=['sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9188,0x1ca));var _0x8918=function(_0x4803db,_0x4ff469){_0x4803db=_0x4803db-0x0;var _0x26c2b6=_0x9188[_0x4803db];return _0x26c2b6;};'use strict';var Sequelize=require(_0x8918('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8918('0x1')]},'description':{'type':Sequelize[_0x8918('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index bd0d6af..9ff9a4a 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 _0x4fb0=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','user','role','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','hasOwnProperty','addAction','TriggerId','Action','getActions','eml-format'];(function(_0x4cf47b,_0x2ff8ad){var _0x4667e7=function(_0x16863a){while(--_0x16863a){_0x4cf47b['push'](_0x4cf47b['shift']());}};_0x4667e7(++_0x2ff8ad);}(_0x4fb0,0x173));var _0x04fb=function(_0x2a7a80,_0x188689){_0x2a7a80=_0x2a7a80-0x0;var _0x2ff160=_0x4fb0[_0x2a7a80];return _0x2ff160;};'use strict';var emlformat=require(_0x04fb('0x0'));var rimraf=require(_0x04fb('0x1'));var zipdir=require(_0x04fb('0x2'));var jsonpatch=require(_0x04fb('0x3'));var rp=require('request-promise');var moment=require(_0x04fb('0x4'));var BPromise=require(_0x04fb('0x5'));var Mustache=require(_0x04fb('0x6'));var util=require('util');var path=require(_0x04fb('0x7'));var sox=require(_0x04fb('0x8'));var csv=require(_0x04fb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04fb('0xa'));var _=require(_0x04fb('0xb'));var squel=require(_0x04fb('0xc'));var crypto=require('crypto');var jsforce=require(_0x04fb('0xd'));var deskjs=require(_0x04fb('0xe'));var toCsv=require(_0x04fb('0x9'));var querystring=require(_0x04fb('0xf'));var Papa=require(_0x04fb('0x10'));var Redis=require(_0x04fb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04fb('0x12'));var hardwareService=require(_0x04fb('0x13'));var logger=require(_0x04fb('0x14'))(_0x04fb('0x15'));var utils=require(_0x04fb('0x16'));var config=require(_0x04fb('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4478e2,_0x28a007){_0x28a007=_0x28a007||0xcc;return function(_0x3e6548){if(_0x3e6548){return _0x4478e2[_0x04fb('0x18')](_0x28a007);}return _0x4478e2['status'](_0x28a007)[_0x04fb('0x19')]();};}function respondWithResult(_0x4fc9ba,_0x551da1){_0x551da1=_0x551da1||0xc8;return function(_0x2026ef){if(_0x2026ef){return _0x4fc9ba[_0x04fb('0x1a')](_0x551da1)[_0x04fb('0x1b')](_0x2026ef);}};}function respondWithFilteredResult(_0x580064,_0x47224e){return function(_0x350bb1){if(_0x350bb1){var _0x4de816=typeof _0x47224e['offset']===_0x04fb('0x1c')&&typeof _0x47224e[_0x04fb('0x1d')]==='undefined';var _0x4bd384=_0x350bb1[_0x04fb('0x1e')];var _0x153464=_0x4de816?0x0:_0x47224e[_0x04fb('0x1f')];var _0x41ac7e=_0x4de816?_0x350bb1[_0x04fb('0x1e')]:_0x47224e['offset']+_0x47224e[_0x04fb('0x1d')];var _0xffa8f2;if(_0x41ac7e>=_0x4bd384){_0x41ac7e=_0x4bd384;_0xffa8f2=0xc8;}else{_0xffa8f2=0xce;}_0x580064['status'](_0xffa8f2);return _0x580064[_0x04fb('0x20')]('Content-Range',_0x153464+'-'+_0x41ac7e+'/'+_0x4bd384)[_0x04fb('0x1b')](_0x350bb1);}return null;};}function patchUpdates(_0x444494){return function(_0x4cd741){try{jsonpatch[_0x04fb('0x21')](_0x4cd741,_0x444494,!![]);}catch(_0x38d88d){return BPromise[_0x04fb('0x22')](_0x38d88d);}return _0x4cd741[_0x04fb('0x23')]();};}function saveUpdates(_0x1e63d7,_0x58f4c3){return function(_0x4231f3){if(_0x4231f3){return _0x4231f3['update'](_0x1e63d7)[_0x04fb('0x24')](function(_0x3e851e){return _0x3e851e;});}return null;};}function removeEntity(_0xfe1113,_0x540ac5){return function(_0x188076){if(_0x188076){return _0x188076['destroy']()[_0x04fb('0x24')](function(){var _0xa95132=_0x188076[_0x04fb('0x25')]({'plain':!![]});var _0x49c838=_0x04fb('0x26');return db[_0x04fb('0x27')][_0x04fb('0x28')]({'where':{'type':_0x49c838,'resourceId':_0xa95132['id']}})['then'](function(){return _0x188076;});})[_0x04fb('0x24')](function(){_0xfe1113[_0x04fb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563365,_0x412579){return function(_0xaf8c6a){if(!_0xaf8c6a){_0x563365[_0x04fb('0x18')](0x194);}return _0xaf8c6a;};}function handleError(_0x25ac81,_0x2594b1){_0x2594b1=_0x2594b1||0x1f4;return function(_0x26217e){logger[_0x04fb('0x29')](_0x26217e[_0x04fb('0x2a')]);if(_0x26217e[_0x04fb('0x2b')]){delete _0x26217e['name'];}_0x25ac81[_0x04fb('0x1a')](_0x2594b1)[_0x04fb('0x2c')](_0x26217e);};}exports[_0x04fb('0x2d')]=function(_0x40aec3,_0x1b8803){var _0x19533c={},_0x22a91c={},_0x1a1e82={'count':0x0,'rows':[]};var _0x2d7d32=_[_0x04fb('0x2e')](db[_0x04fb('0x2f')]['rawAttributes'],function(_0x1a3d20){return{'name':_0x1a3d20['fieldName'],'type':_0x1a3d20[_0x04fb('0x30')][_0x04fb('0x31')]};});_0x22a91c[_0x04fb('0x32')]=_[_0x04fb('0x2e')](_0x2d7d32,'name');_0x22a91c['query']=_[_0x04fb('0x33')](_0x40aec3['query']);_0x22a91c[_0x04fb('0x34')]=_[_0x04fb('0x35')](_0x22a91c['model'],_0x22a91c[_0x04fb('0x36')]);_0x19533c['attributes']=_[_0x04fb('0x35')](_0x22a91c[_0x04fb('0x32')],qs['fields'](_0x40aec3[_0x04fb('0x36')][_0x04fb('0x37')]));_0x19533c['attributes']=_0x19533c[_0x04fb('0x38')][_0x04fb('0x39')]?_0x19533c['attributes']:_0x22a91c[_0x04fb('0x32')];if(!_0x40aec3[_0x04fb('0x36')]['hasOwnProperty'](_0x04fb('0x3a'))){_0x19533c[_0x04fb('0x1d')]=qs['limit'](_0x40aec3[_0x04fb('0x36')][_0x04fb('0x1d')]);_0x19533c['offset']=qs[_0x04fb('0x1f')](_0x40aec3[_0x04fb('0x36')][_0x04fb('0x1f')]);}_0x19533c[_0x04fb('0x3b')]=qs['sort'](_0x40aec3[_0x04fb('0x36')][_0x04fb('0x3c')]);_0x19533c[_0x04fb('0x3d')]=qs[_0x04fb('0x34')](_[_0x04fb('0x3e')](_0x40aec3[_0x04fb('0x36')],_0x22a91c['filters']),_0x2d7d32);if(_0x40aec3[_0x04fb('0x36')][_0x04fb('0x3f')]){_0x19533c[_0x04fb('0x3d')]=_['merge'](_0x19533c[_0x04fb('0x3d')],{'$or':_['map'](_0x2d7d32,function(_0x5646a6){if(_0x5646a6[_0x04fb('0x30')]!=='VIRTUAL'){var _0x5c36f0={};_0x5c36f0[_0x5646a6[_0x04fb('0x2b')]]={'$like':'%'+_0x40aec3[_0x04fb('0x36')]['filter']+'%'};return _0x5c36f0;}})});}_0x19533c=_[_0x04fb('0x40')]({},_0x19533c,_0x40aec3[_0x04fb('0x41')]);var _0x2178e3={'where':_0x19533c[_0x04fb('0x3d')]};return db[_0x04fb('0x2f')][_0x04fb('0x1e')](_0x2178e3)[_0x04fb('0x24')](function(_0x292bcc){_0x1a1e82[_0x04fb('0x1e')]=_0x292bcc;if(_0x40aec3[_0x04fb('0x36')][_0x04fb('0x42')]){_0x19533c[_0x04fb('0x43')]=[{'all':!![]}];}return db[_0x04fb('0x2f')][_0x04fb('0x44')](_0x19533c);})[_0x04fb('0x24')](function(_0x379ddd){_0x1a1e82[_0x04fb('0x45')]=_0x379ddd;return _0x1a1e82;})['then'](respondWithFilteredResult(_0x1b8803,_0x19533c))['catch'](handleError(_0x1b8803,null));};exports[_0x04fb('0x46')]=function(_0x2d904f,_0x1cb79b){var _0x52d5bf={'raw':![],'where':{'id':_0x2d904f['params']['id']}},_0x418691={};_0x418691[_0x04fb('0x32')]=_[_0x04fb('0x33')](db[_0x04fb('0x2f')][_0x04fb('0x47')]);_0x418691[_0x04fb('0x36')]=_['keys'](_0x2d904f['query']);_0x418691[_0x04fb('0x34')]=_[_0x04fb('0x35')](_0x418691[_0x04fb('0x32')],_0x418691[_0x04fb('0x36')]);_0x52d5bf[_0x04fb('0x38')]=_[_0x04fb('0x35')](_0x418691[_0x04fb('0x32')],qs[_0x04fb('0x37')](_0x2d904f[_0x04fb('0x36')][_0x04fb('0x37')]));_0x52d5bf[_0x04fb('0x38')]=_0x52d5bf[_0x04fb('0x38')][_0x04fb('0x39')]?_0x52d5bf['attributes']:_0x418691[_0x04fb('0x32')];if(_0x2d904f[_0x04fb('0x36')][_0x04fb('0x42')]){_0x52d5bf[_0x04fb('0x43')]=[{'all':!![]}];}_0x52d5bf=_[_0x04fb('0x40')]({},_0x52d5bf,_0x2d904f[_0x04fb('0x41')]);return db[_0x04fb('0x2f')][_0x04fb('0x48')](_0x52d5bf)[_0x04fb('0x24')](handleEntityNotFound(_0x1cb79b,null))[_0x04fb('0x24')](respondWithResult(_0x1cb79b,null))['catch'](handleError(_0x1cb79b,null));};exports[_0x04fb('0x49')]=function(_0xa846aa,_0x2bdd20){return db[_0x04fb('0x2f')]['create'](_0xa846aa['body'],{})[_0x04fb('0x24')](function(_0x11c781){var _0x45cc0f=_0xa846aa[_0x04fb('0x4a')][_0x04fb('0x25')]({'plain':!![]});if(!_0x45cc0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45cc0f[_0x04fb('0x4b')]===_0x04fb('0x4a')){var _0x53f3c2=_0x11c781[_0x04fb('0x25')]({'plain':!![]});var _0x4f8eb3=_0x04fb('0x26');return db['UserProfileSection'][_0x04fb('0x48')]({'where':{'name':_0x4f8eb3,'userProfileId':_0x45cc0f['userProfileId']},'raw':!![]})[_0x04fb('0x24')](function(_0x14e96e){if(_0x14e96e&&_0x14e96e['autoAssociation']===0x0){return db[_0x04fb('0x27')][_0x04fb('0x49')]({'name':_0x53f3c2[_0x04fb('0x2b')],'resourceId':_0x53f3c2['id'],'type':_0x14e96e[_0x04fb('0x2b')],'sectionId':_0x14e96e['id']},{})[_0x04fb('0x24')](function(){return _0x11c781;});}else{return _0x11c781;}})[_0x04fb('0x4c')](function(_0x122d97){logger[_0x04fb('0x29')](_0x04fb('0x4d'),_0x122d97);throw _0x122d97;});}return _0x11c781;})[_0x04fb('0x24')](respondWithResult(_0x2bdd20,0xc9))['catch'](handleError(_0x2bdd20,null));};exports[_0x04fb('0x4e')]=function(_0x22558e,_0x445ef4){if(_0x22558e[_0x04fb('0x4f')]['id']){delete _0x22558e[_0x04fb('0x4f')]['id'];}return db[_0x04fb('0x2f')][_0x04fb('0x48')]({'where':{'id':_0x22558e[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x445ef4,null))[_0x04fb('0x24')](saveUpdates(_0x22558e['body'],null))[_0x04fb('0x24')](respondWithResult(_0x445ef4,null))['catch'](handleError(_0x445ef4,null));};exports[_0x04fb('0x28')]=function(_0x3e87b5,_0x27847f){return db[_0x04fb('0x2f')]['find']({'where':{'id':_0x3e87b5['params']['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x27847f,null))['then'](removeEntity(_0x27847f,null))[_0x04fb('0x4c')](handleError(_0x27847f,null));};exports[_0x04fb('0x51')]=function(_0x3f73ce,_0x305be7,_0x56ba61){if(_0x3f73ce[_0x04fb('0x4f')]['id']){delete _0x3f73ce[_0x04fb('0x4f')]['id'];}return db['Trigger'][_0x04fb('0x48')]({'where':{'id':_0x3f73ce[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x305be7,null))[_0x04fb('0x24')](function(_0x2b7290){if(_0x2b7290){_0x3f73ce[_0x04fb('0x4f')][_0x04fb('0x52')]=_0x2b7290['id'];return db[_0x04fb('0x53')]['create'](_0x3f73ce[_0x04fb('0x4f')]);}})[_0x04fb('0x24')](respondWithResult(_0x305be7,null))[_0x04fb('0x4c')](handleError(_0x305be7,null));};exports['addAnyCondition']=function(_0x1148d1,_0x11b94d,_0x1c755b){if(_0x1148d1[_0x04fb('0x4f')]['id']){delete _0x1148d1[_0x04fb('0x4f')]['id'];}return db[_0x04fb('0x2f')][_0x04fb('0x48')]({'where':{'id':_0x1148d1[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x11b94d,null))[_0x04fb('0x24')](function(_0x2fa9a6){if(_0x2fa9a6){_0x1148d1[_0x04fb('0x4f')][_0x04fb('0x54')]=_0x2fa9a6['id'];return db['Condition']['create'](_0x1148d1[_0x04fb('0x4f')]);}})[_0x04fb('0x24')](respondWithResult(_0x11b94d,null))[_0x04fb('0x4c')](handleError(_0x11b94d,null));};exports[_0x04fb('0x55')]=function(_0xd88528,_0x5d57a9,_0x171f7a){var _0x55638c={};var _0x2905e1={};var _0x4caa76;var _0x2cbbd1;return db[_0x04fb('0x2f')]['findOne']({'where':{'id':_0xd88528[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x5d57a9,null))[_0x04fb('0x24')](function(_0x31680f){if(_0x31680f){_0x4caa76=_0x31680f;_0x2905e1[_0x04fb('0x32')]=_['keys'](db[_0x04fb('0x53')][_0x04fb('0x47')]);_0x2905e1[_0x04fb('0x36')]=_['keys'](_0xd88528['query']);_0x2905e1[_0x04fb('0x34')]=_[_0x04fb('0x35')](_0x2905e1[_0x04fb('0x32')],_0x2905e1[_0x04fb('0x36')]);_0x55638c['attributes']=_[_0x04fb('0x35')](_0x2905e1[_0x04fb('0x32')],qs['fields'](_0xd88528[_0x04fb('0x36')]['fields']));_0x55638c[_0x04fb('0x38')]=_0x55638c['attributes'][_0x04fb('0x39')]?_0x55638c[_0x04fb('0x38')]:_0x2905e1[_0x04fb('0x32')];_0x55638c[_0x04fb('0x3b')]=qs['sort'](_0xd88528[_0x04fb('0x36')][_0x04fb('0x3c')]);_0x55638c['where']=qs['filters'](_[_0x04fb('0x3e')](_0xd88528[_0x04fb('0x36')],_0x2905e1[_0x04fb('0x34')]));if(_0xd88528[_0x04fb('0x36')][_0x04fb('0x3f')]){_0x55638c['where']=_['merge'](_0x55638c[_0x04fb('0x3d')],{'$or':_[_0x04fb('0x2e')](_0x55638c['attributes'],function(_0x1e15f8){var _0x547f05={};_0x547f05[_0x1e15f8]={'$like':'%'+_0xd88528[_0x04fb('0x36')]['filter']+'%'};return _0x547f05;})});}_0x55638c=_[_0x04fb('0x40')]({},_0x55638c,_0xd88528[_0x04fb('0x41')]);return _0x4caa76[_0x04fb('0x55')](_0x55638c);}})[_0x04fb('0x24')](function(_0x26a675){if(_0x26a675){_0x2cbbd1=_0x26a675[_0x04fb('0x39')];if(!_0xd88528[_0x04fb('0x36')]['hasOwnProperty'](_0x04fb('0x3a'))){_0x55638c[_0x04fb('0x1d')]=qs[_0x04fb('0x1d')](_0xd88528[_0x04fb('0x36')][_0x04fb('0x1d')]);_0x55638c[_0x04fb('0x1f')]=qs[_0x04fb('0x1f')](_0xd88528[_0x04fb('0x36')][_0x04fb('0x1f')]);}return _0x4caa76[_0x04fb('0x55')](_0x55638c);}})[_0x04fb('0x24')](function(_0x40c94c){if(_0x40c94c){return _0x40c94c?{'count':_0x2cbbd1,'rows':_0x40c94c}:null;}})[_0x04fb('0x24')](respondWithResult(_0x5d57a9,null))[_0x04fb('0x4c')](handleError(_0x5d57a9,null));};exports[_0x04fb('0x56')]=function(_0x50aeea,_0x48586f,_0x281066){var _0x4b9afc={};var _0x75af6c={};var _0x324dbb;var _0x5c01b7;return db[_0x04fb('0x2f')][_0x04fb('0x57')]({'where':{'id':_0x50aeea[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x48586f,null))[_0x04fb('0x24')](function(_0x30a2f5){if(_0x30a2f5){_0x324dbb=_0x30a2f5;_0x75af6c[_0x04fb('0x32')]=_['keys'](db['Condition']['rawAttributes']);_0x75af6c[_0x04fb('0x36')]=_['keys'](_0x50aeea[_0x04fb('0x36')]);_0x75af6c[_0x04fb('0x34')]=_['intersection'](_0x75af6c[_0x04fb('0x32')],_0x75af6c['query']);_0x4b9afc[_0x04fb('0x38')]=_[_0x04fb('0x35')](_0x75af6c['model'],qs[_0x04fb('0x37')](_0x50aeea[_0x04fb('0x36')][_0x04fb('0x37')]));_0x4b9afc[_0x04fb('0x38')]=_0x4b9afc[_0x04fb('0x38')][_0x04fb('0x39')]?_0x4b9afc[_0x04fb('0x38')]:_0x75af6c['model'];_0x4b9afc[_0x04fb('0x3b')]=qs[_0x04fb('0x3c')](_0x50aeea[_0x04fb('0x36')][_0x04fb('0x3c')]);_0x4b9afc[_0x04fb('0x3d')]=qs['filters'](_[_0x04fb('0x3e')](_0x50aeea[_0x04fb('0x36')],_0x75af6c[_0x04fb('0x34')]));if(_0x50aeea[_0x04fb('0x36')]['filter']){_0x4b9afc[_0x04fb('0x3d')]=_[_0x04fb('0x40')](_0x4b9afc[_0x04fb('0x3d')],{'$or':_['map'](_0x4b9afc[_0x04fb('0x38')],function(_0x3205c){var _0x2464d1={};_0x2464d1[_0x3205c]={'$like':'%'+_0x50aeea['query'][_0x04fb('0x3f')]+'%'};return _0x2464d1;})});}_0x4b9afc=_[_0x04fb('0x40')]({},_0x4b9afc,_0x50aeea['options']);return _0x324dbb[_0x04fb('0x56')](_0x4b9afc);}})[_0x04fb('0x24')](function(_0x3d98f2){if(_0x3d98f2){_0x5c01b7=_0x3d98f2[_0x04fb('0x39')];if(!_0x50aeea['query'][_0x04fb('0x58')]('nolimit')){_0x4b9afc['limit']=qs[_0x04fb('0x1d')](_0x50aeea['query'][_0x04fb('0x1d')]);_0x4b9afc['offset']=qs['offset'](_0x50aeea[_0x04fb('0x36')][_0x04fb('0x1f')]);}return _0x324dbb[_0x04fb('0x56')](_0x4b9afc);}})[_0x04fb('0x24')](function(_0x75f278){if(_0x75f278){return _0x75f278?{'count':_0x5c01b7,'rows':_0x75f278}:null;}})[_0x04fb('0x24')](respondWithResult(_0x48586f,null))[_0x04fb('0x4c')](handleError(_0x48586f,null));};exports[_0x04fb('0x59')]=function(_0x48038c,_0x4fec72,_0x3e1547){if(_0x48038c['body']['id']){delete _0x48038c[_0x04fb('0x4f')]['id'];}return db[_0x04fb('0x2f')][_0x04fb('0x48')]({'where':{'id':_0x48038c[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x4fec72,null))[_0x04fb('0x24')](function(_0x224ed1){if(_0x224ed1){_0x48038c[_0x04fb('0x4f')][_0x04fb('0x5a')]=_0x224ed1['id'];return db[_0x04fb('0x5b')]['create'](_0x48038c[_0x04fb('0x4f')]);}})[_0x04fb('0x24')](respondWithResult(_0x4fec72,null))[_0x04fb('0x4c')](handleError(_0x4fec72,null));};exports[_0x04fb('0x5c')]=function(_0x5c7171,_0x2fe860,_0x4268d7){var _0x2aaf06={};var _0x1959f1={};var _0x2d9061;var _0x337d2d;return db['Trigger'][_0x04fb('0x57')]({'where':{'id':_0x5c7171[_0x04fb('0x50')]['id']}})[_0x04fb('0x24')](handleEntityNotFound(_0x2fe860,null))[_0x04fb('0x24')](function(_0x583666){if(_0x583666){_0x2d9061=_0x583666;_0x1959f1[_0x04fb('0x32')]=_[_0x04fb('0x33')](db['Action'][_0x04fb('0x47')]);_0x1959f1[_0x04fb('0x36')]=_[_0x04fb('0x33')](_0x5c7171['query']);_0x1959f1[_0x04fb('0x34')]=_[_0x04fb('0x35')](_0x1959f1['model'],_0x1959f1[_0x04fb('0x36')]);_0x2aaf06[_0x04fb('0x38')]=_['intersection'](_0x1959f1[_0x04fb('0x32')],qs['fields'](_0x5c7171[_0x04fb('0x36')]['fields']));_0x2aaf06['attributes']=_0x2aaf06['attributes'][_0x04fb('0x39')]?_0x2aaf06['attributes']:_0x1959f1[_0x04fb('0x32')];_0x2aaf06[_0x04fb('0x3b')]=qs[_0x04fb('0x3c')](_0x5c7171[_0x04fb('0x36')][_0x04fb('0x3c')]);_0x2aaf06[_0x04fb('0x3d')]=qs[_0x04fb('0x34')](_[_0x04fb('0x3e')](_0x5c7171[_0x04fb('0x36')],_0x1959f1[_0x04fb('0x34')]));if(_0x5c7171['query'][_0x04fb('0x3f')]){_0x2aaf06['where']=_[_0x04fb('0x40')](_0x2aaf06[_0x04fb('0x3d')],{'$or':_['map'](_0x2aaf06['attributes'],function(_0x6f9318){var _0xdac199={};_0xdac199[_0x6f9318]={'$like':'%'+_0x5c7171[_0x04fb('0x36')][_0x04fb('0x3f')]+'%'};return _0xdac199;})});}_0x2aaf06=_[_0x04fb('0x40')]({},_0x2aaf06,_0x5c7171[_0x04fb('0x41')]);return _0x2d9061[_0x04fb('0x5c')](_0x2aaf06);}})['then'](function(_0x2c2916){if(_0x2c2916){_0x337d2d=_0x2c2916[_0x04fb('0x39')];if(!_0x5c7171['query'][_0x04fb('0x58')](_0x04fb('0x3a'))){_0x2aaf06['limit']=qs[_0x04fb('0x1d')](_0x5c7171[_0x04fb('0x36')][_0x04fb('0x1d')]);_0x2aaf06['offset']=qs[_0x04fb('0x1f')](_0x5c7171[_0x04fb('0x36')]['offset']);}return _0x2d9061[_0x04fb('0x5c')](_0x2aaf06);}})['then'](function(_0x5353d5){if(_0x5353d5){return _0x5353d5?{'count':_0x337d2d,'rows':_0x5353d5}:null;}})[_0x04fb('0x24')](respondWithResult(_0x2fe860,null))['catch'](handleError(_0x2fe860,null));}; \ No newline at end of file +var _0x25ab=['addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params'];(function(_0x3e8d91,_0x58d564){var _0x310cba=function(_0x2ea18c){while(--_0x2ea18c){_0x3e8d91['push'](_0x3e8d91['shift']());}};_0x310cba(++_0x58d564);}(_0x25ab,0x123));var _0xb25a=function(_0x48f9ac,_0x5dd84b){_0x48f9ac=_0x48f9ac-0x0;var _0xd68227=_0x25ab[_0x48f9ac];return _0xd68227;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb25a('0x0'));var zipdir=require(_0xb25a('0x1'));var jsonpatch=require(_0xb25a('0x2'));var rp=require(_0xb25a('0x3'));var moment=require('moment');var BPromise=require(_0xb25a('0x4'));var Mustache=require(_0xb25a('0x5'));var util=require(_0xb25a('0x6'));var path=require('path');var sox=require(_0xb25a('0x7'));var csv=require(_0xb25a('0x8'));var ejs=require(_0xb25a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb25a('0xa'));var squel=require(_0xb25a('0xb'));var crypto=require('crypto');var jsforce=require(_0xb25a('0xc'));var deskjs=require(_0xb25a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb25a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb25a('0xf'));var as=require(_0xb25a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb25a('0x11'));var utils=require('../../config/utils');var config=require(_0xb25a('0x12'));var licenseUtil=require(_0xb25a('0x13'));var db=require(_0xb25a('0x14'))['db'];function respondWithStatusCode(_0x129cd6,_0x1810b3){_0x1810b3=_0x1810b3||0xcc;return function(_0x2aef27){if(_0x2aef27){return _0x129cd6[_0xb25a('0x15')](_0x1810b3);}return _0x129cd6[_0xb25a('0x16')](_0x1810b3)[_0xb25a('0x17')]();};}function respondWithResult(_0x2fe653,_0x148604){_0x148604=_0x148604||0xc8;return function(_0x49695b){if(_0x49695b){return _0x2fe653['status'](_0x148604)[_0xb25a('0x18')](_0x49695b);}};}function respondWithFilteredResult(_0x337a4c,_0x176eb6){return function(_0x4f8e3b){if(_0x4f8e3b){var _0x4caf27=typeof _0x176eb6[_0xb25a('0x19')]===_0xb25a('0x1a')&&typeof _0x176eb6[_0xb25a('0x1b')]===_0xb25a('0x1a');var _0x5be6f4=_0x4f8e3b['count'];var _0x4ad39e=_0x4caf27?0x0:_0x176eb6[_0xb25a('0x19')];var _0x268ca8=_0x4caf27?_0x4f8e3b[_0xb25a('0x1c')]:_0x176eb6[_0xb25a('0x19')]+_0x176eb6[_0xb25a('0x1b')];var _0x3ed3b5;if(_0x268ca8>=_0x5be6f4){_0x268ca8=_0x5be6f4;_0x3ed3b5=0xc8;}else{_0x3ed3b5=0xce;}_0x337a4c[_0xb25a('0x16')](_0x3ed3b5);return _0x337a4c[_0xb25a('0x1d')](_0xb25a('0x1e'),_0x4ad39e+'-'+_0x268ca8+'/'+_0x5be6f4)[_0xb25a('0x18')](_0x4f8e3b);}return null;};}function patchUpdates(_0x214902){return function(_0xb336d){try{jsonpatch[_0xb25a('0x1f')](_0xb336d,_0x214902,!![]);}catch(_0x5d2089){return BPromise['reject'](_0x5d2089);}return _0xb336d[_0xb25a('0x20')]();};}function saveUpdates(_0xc8acb,_0x3a40ff){return function(_0x150e35){if(_0x150e35){return _0x150e35[_0xb25a('0x21')](_0xc8acb)[_0xb25a('0x22')](function(_0x1bb0af){return _0x1bb0af;});}return null;};}function removeEntity(_0x635bd4,_0x917351){return function(_0x7f7b0c){if(_0x7f7b0c){return _0x7f7b0c[_0xb25a('0x23')]()[_0xb25a('0x22')](function(){var _0x37d62e=_0x7f7b0c[_0xb25a('0x24')]({'plain':!![]});var _0x2bca0b='Triggers';return db[_0xb25a('0x25')]['destroy']({'where':{'type':_0x2bca0b,'resourceId':_0x37d62e['id']}})[_0xb25a('0x22')](function(){return _0x7f7b0c;});})[_0xb25a('0x22')](function(){_0x635bd4[_0xb25a('0x16')](0xcc)[_0xb25a('0x17')]();});}};}function handleEntityNotFound(_0x2e52f6,_0x7f679a){return function(_0x3cb795){if(!_0x3cb795){_0x2e52f6['sendStatus'](0x194);}return _0x3cb795;};}function handleError(_0x200122,_0x1a95ce){_0x1a95ce=_0x1a95ce||0x1f4;return function(_0xe66bda){logger[_0xb25a('0x26')](_0xe66bda[_0xb25a('0x27')]);if(_0xe66bda['name']){delete _0xe66bda[_0xb25a('0x28')];}_0x200122[_0xb25a('0x16')](_0x1a95ce)['send'](_0xe66bda);};}exports[_0xb25a('0x29')]=function(_0x3305d9,_0xa83bc8){var _0x1b8581={},_0x102fff={},_0xb2ba4={'count':0x0,'rows':[]};var _0x38988a=_[_0xb25a('0x2a')](db[_0xb25a('0x2b')][_0xb25a('0x2c')],function(_0x445381){return{'name':_0x445381[_0xb25a('0x2d')],'type':_0x445381[_0xb25a('0x2e')][_0xb25a('0x2f')]};});_0x102fff[_0xb25a('0x30')]=_[_0xb25a('0x2a')](_0x38988a,_0xb25a('0x28'));_0x102fff[_0xb25a('0x31')]=_[_0xb25a('0x32')](_0x3305d9[_0xb25a('0x31')]);_0x102fff[_0xb25a('0x33')]=_[_0xb25a('0x34')](_0x102fff[_0xb25a('0x30')],_0x102fff[_0xb25a('0x31')]);_0x1b8581[_0xb25a('0x35')]=_[_0xb25a('0x34')](_0x102fff[_0xb25a('0x30')],qs[_0xb25a('0x36')](_0x3305d9[_0xb25a('0x31')]['fields']));_0x1b8581[_0xb25a('0x35')]=_0x1b8581[_0xb25a('0x35')][_0xb25a('0x37')]?_0x1b8581['attributes']:_0x102fff['model'];if(!_0x3305d9[_0xb25a('0x31')]['hasOwnProperty'](_0xb25a('0x38'))){_0x1b8581[_0xb25a('0x1b')]=qs[_0xb25a('0x1b')](_0x3305d9['query'][_0xb25a('0x1b')]);_0x1b8581['offset']=qs[_0xb25a('0x19')](_0x3305d9[_0xb25a('0x31')][_0xb25a('0x19')]);}_0x1b8581[_0xb25a('0x39')]=qs['sort'](_0x3305d9[_0xb25a('0x31')][_0xb25a('0x3a')]);_0x1b8581['where']=qs[_0xb25a('0x33')](_[_0xb25a('0x3b')](_0x3305d9[_0xb25a('0x31')],_0x102fff['filters']),_0x38988a);if(_0x3305d9[_0xb25a('0x31')][_0xb25a('0x3c')]){_0x1b8581[_0xb25a('0x3d')]=_[_0xb25a('0x3e')](_0x1b8581[_0xb25a('0x3d')],{'$or':_[_0xb25a('0x2a')](_0x38988a,function(_0x93ea51){if(_0x93ea51[_0xb25a('0x2e')]!==_0xb25a('0x3f')){var _0x67c30a={};_0x67c30a[_0x93ea51[_0xb25a('0x28')]]={'$like':'%'+_0x3305d9['query']['filter']+'%'};return _0x67c30a;}})});}_0x1b8581=_[_0xb25a('0x3e')]({},_0x1b8581,_0x3305d9['options']);var _0x463448={'where':_0x1b8581['where']};return db[_0xb25a('0x2b')][_0xb25a('0x1c')](_0x463448)[_0xb25a('0x22')](function(_0x22fd6c){_0xb2ba4[_0xb25a('0x1c')]=_0x22fd6c;if(_0x3305d9[_0xb25a('0x31')][_0xb25a('0x40')]){_0x1b8581[_0xb25a('0x41')]=[{'all':!![]}];}return db['Trigger'][_0xb25a('0x42')](_0x1b8581);})[_0xb25a('0x22')](function(_0x5c4a14){_0xb2ba4['rows']=_0x5c4a14;return _0xb2ba4;})[_0xb25a('0x22')](respondWithFilteredResult(_0xa83bc8,_0x1b8581))[_0xb25a('0x43')](handleError(_0xa83bc8,null));};exports[_0xb25a('0x44')]=function(_0x291fff,_0x30d886){var _0xcca01f={'raw':![],'where':{'id':_0x291fff['params']['id']}},_0x247983={};_0x247983[_0xb25a('0x30')]=_[_0xb25a('0x32')](db[_0xb25a('0x2b')][_0xb25a('0x2c')]);_0x247983[_0xb25a('0x31')]=_[_0xb25a('0x32')](_0x291fff[_0xb25a('0x31')]);_0x247983['filters']=_[_0xb25a('0x34')](_0x247983[_0xb25a('0x30')],_0x247983['query']);_0xcca01f['attributes']=_[_0xb25a('0x34')](_0x247983[_0xb25a('0x30')],qs['fields'](_0x291fff['query'][_0xb25a('0x36')]));_0xcca01f[_0xb25a('0x35')]=_0xcca01f[_0xb25a('0x35')][_0xb25a('0x37')]?_0xcca01f[_0xb25a('0x35')]:_0x247983[_0xb25a('0x30')];if(_0x291fff[_0xb25a('0x31')][_0xb25a('0x40')]){_0xcca01f[_0xb25a('0x41')]=[{'all':!![]}];}_0xcca01f=_[_0xb25a('0x3e')]({},_0xcca01f,_0x291fff[_0xb25a('0x45')]);return db['Trigger'][_0xb25a('0x46')](_0xcca01f)[_0xb25a('0x22')](handleEntityNotFound(_0x30d886,null))['then'](respondWithResult(_0x30d886,null))[_0xb25a('0x43')](handleError(_0x30d886,null));};exports[_0xb25a('0x47')]=function(_0x9848da,_0x5825b7){return db[_0xb25a('0x2b')][_0xb25a('0x47')](_0x9848da['body'],{})[_0xb25a('0x22')](function(_0x3ca033){var _0x38998b=_0x9848da[_0xb25a('0x48')]['get']({'plain':!![]});if(!_0x38998b)throw new Error(_0xb25a('0x49'));if(_0x38998b['role']===_0xb25a('0x48')){var _0x4c4c05=_0x3ca033[_0xb25a('0x24')]({'plain':!![]});var _0x412271=_0xb25a('0x4a');return db[_0xb25a('0x4b')][_0xb25a('0x46')]({'where':{'name':_0x412271,'userProfileId':_0x38998b[_0xb25a('0x4c')]},'raw':!![]})[_0xb25a('0x22')](function(_0x4d3aff){if(_0x4d3aff&&_0x4d3aff[_0xb25a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c4c05[_0xb25a('0x28')],'resourceId':_0x4c4c05['id'],'type':_0x4d3aff[_0xb25a('0x28')],'sectionId':_0x4d3aff['id']},{})['then'](function(){return _0x3ca033;});}else{return _0x3ca033;}})[_0xb25a('0x43')](function(_0x40c61a){logger[_0xb25a('0x26')](_0xb25a('0x4e'),_0x40c61a);throw _0x40c61a;});}return _0x3ca033;})[_0xb25a('0x22')](respondWithResult(_0x5825b7,0xc9))[_0xb25a('0x43')](handleError(_0x5825b7,null));};exports[_0xb25a('0x21')]=function(_0x104e45,_0x26967c){if(_0x104e45[_0xb25a('0x4f')]['id']){delete _0x104e45[_0xb25a('0x4f')]['id'];}return db[_0xb25a('0x2b')][_0xb25a('0x46')]({'where':{'id':_0x104e45[_0xb25a('0x50')]['id']}})[_0xb25a('0x22')](handleEntityNotFound(_0x26967c,null))[_0xb25a('0x22')](saveUpdates(_0x104e45[_0xb25a('0x4f')],null))[_0xb25a('0x22')](respondWithResult(_0x26967c,null))['catch'](handleError(_0x26967c,null));};exports[_0xb25a('0x23')]=function(_0x4a0b3a,_0x1a128f){return db['Trigger']['find']({'where':{'id':_0x4a0b3a[_0xb25a('0x50')]['id']}})[_0xb25a('0x22')](handleEntityNotFound(_0x1a128f,null))[_0xb25a('0x22')](removeEntity(_0x1a128f,null))['catch'](handleError(_0x1a128f,null));};exports[_0xb25a('0x51')]=function(_0x22b549,_0x4c40e3,_0x157b23){if(_0x22b549[_0xb25a('0x4f')]['id']){delete _0x22b549[_0xb25a('0x4f')]['id'];}return db[_0xb25a('0x2b')][_0xb25a('0x46')]({'where':{'id':_0x22b549[_0xb25a('0x50')]['id']}})['then'](handleEntityNotFound(_0x4c40e3,null))[_0xb25a('0x22')](function(_0x221111){if(_0x221111){_0x22b549[_0xb25a('0x4f')][_0xb25a('0x52')]=_0x221111['id'];return db[_0xb25a('0x53')][_0xb25a('0x47')](_0x22b549[_0xb25a('0x4f')]);}})[_0xb25a('0x22')](respondWithResult(_0x4c40e3,null))[_0xb25a('0x43')](handleError(_0x4c40e3,null));};exports[_0xb25a('0x54')]=function(_0x14eae7,_0x540006,_0x4aa1da){if(_0x14eae7['body']['id']){delete _0x14eae7['body']['id'];}return db['Trigger'][_0xb25a('0x46')]({'where':{'id':_0x14eae7[_0xb25a('0x50')]['id']}})[_0xb25a('0x22')](handleEntityNotFound(_0x540006,null))[_0xb25a('0x22')](function(_0xec5403){if(_0xec5403){_0x14eae7['body']['TriggerAnyId']=_0xec5403['id'];return db['Condition'][_0xb25a('0x47')](_0x14eae7[_0xb25a('0x4f')]);}})[_0xb25a('0x22')](respondWithResult(_0x540006,null))['catch'](handleError(_0x540006,null));};exports[_0xb25a('0x55')]=function(_0x1f6f7e,_0x42ac15,_0x4aa579){var _0x368b74={};var _0x3f7615={};var _0x32f80d;var _0x5b87b9;return db['Trigger'][_0xb25a('0x56')]({'where':{'id':_0x1f6f7e[_0xb25a('0x50')]['id']}})['then'](handleEntityNotFound(_0x42ac15,null))[_0xb25a('0x22')](function(_0xf345ce){if(_0xf345ce){_0x32f80d=_0xf345ce;_0x3f7615[_0xb25a('0x30')]=_[_0xb25a('0x32')](db['Condition'][_0xb25a('0x2c')]);_0x3f7615[_0xb25a('0x31')]=_[_0xb25a('0x32')](_0x1f6f7e[_0xb25a('0x31')]);_0x3f7615[_0xb25a('0x33')]=_[_0xb25a('0x34')](_0x3f7615[_0xb25a('0x30')],_0x3f7615[_0xb25a('0x31')]);_0x368b74[_0xb25a('0x35')]=_['intersection'](_0x3f7615[_0xb25a('0x30')],qs['fields'](_0x1f6f7e['query'][_0xb25a('0x36')]));_0x368b74[_0xb25a('0x35')]=_0x368b74[_0xb25a('0x35')][_0xb25a('0x37')]?_0x368b74[_0xb25a('0x35')]:_0x3f7615['model'];_0x368b74[_0xb25a('0x39')]=qs[_0xb25a('0x3a')](_0x1f6f7e[_0xb25a('0x31')][_0xb25a('0x3a')]);_0x368b74['where']=qs[_0xb25a('0x33')](_[_0xb25a('0x3b')](_0x1f6f7e[_0xb25a('0x31')],_0x3f7615[_0xb25a('0x33')]));if(_0x1f6f7e['query']['filter']){_0x368b74[_0xb25a('0x3d')]=_[_0xb25a('0x3e')](_0x368b74[_0xb25a('0x3d')],{'$or':_['map'](_0x368b74[_0xb25a('0x35')],function(_0x4743f1){var _0x3cf13f={};_0x3cf13f[_0x4743f1]={'$like':'%'+_0x1f6f7e[_0xb25a('0x31')][_0xb25a('0x3c')]+'%'};return _0x3cf13f;})});}_0x368b74=_['merge']({},_0x368b74,_0x1f6f7e[_0xb25a('0x45')]);return _0x32f80d[_0xb25a('0x55')](_0x368b74);}})[_0xb25a('0x22')](function(_0x4631e6){if(_0x4631e6){_0x5b87b9=_0x4631e6[_0xb25a('0x37')];if(!_0x1f6f7e[_0xb25a('0x31')][_0xb25a('0x57')](_0xb25a('0x38'))){_0x368b74['limit']=qs['limit'](_0x1f6f7e[_0xb25a('0x31')]['limit']);_0x368b74[_0xb25a('0x19')]=qs[_0xb25a('0x19')](_0x1f6f7e[_0xb25a('0x31')][_0xb25a('0x19')]);}return _0x32f80d[_0xb25a('0x55')](_0x368b74);}})[_0xb25a('0x22')](function(_0x5885e8){if(_0x5885e8){return _0x5885e8?{'count':_0x5b87b9,'rows':_0x5885e8}:null;}})['then'](respondWithResult(_0x42ac15,null))['catch'](handleError(_0x42ac15,null));};exports[_0xb25a('0x58')]=function(_0x127d0b,_0x356ca2,_0x47a193){var _0x3a3f97={};var _0x5e23b6={};var _0x1382cb;var _0x41d027;return db[_0xb25a('0x2b')][_0xb25a('0x56')]({'where':{'id':_0x127d0b[_0xb25a('0x50')]['id']}})[_0xb25a('0x22')](handleEntityNotFound(_0x356ca2,null))[_0xb25a('0x22')](function(_0x1d85fc){if(_0x1d85fc){_0x1382cb=_0x1d85fc;_0x5e23b6['model']=_[_0xb25a('0x32')](db[_0xb25a('0x53')][_0xb25a('0x2c')]);_0x5e23b6[_0xb25a('0x31')]=_['keys'](_0x127d0b['query']);_0x5e23b6[_0xb25a('0x33')]=_[_0xb25a('0x34')](_0x5e23b6[_0xb25a('0x30')],_0x5e23b6[_0xb25a('0x31')]);_0x3a3f97[_0xb25a('0x35')]=_[_0xb25a('0x34')](_0x5e23b6[_0xb25a('0x30')],qs['fields'](_0x127d0b[_0xb25a('0x31')][_0xb25a('0x36')]));_0x3a3f97['attributes']=_0x3a3f97[_0xb25a('0x35')][_0xb25a('0x37')]?_0x3a3f97[_0xb25a('0x35')]:_0x5e23b6[_0xb25a('0x30')];_0x3a3f97[_0xb25a('0x39')]=qs[_0xb25a('0x3a')](_0x127d0b[_0xb25a('0x31')][_0xb25a('0x3a')]);_0x3a3f97[_0xb25a('0x3d')]=qs[_0xb25a('0x33')](_[_0xb25a('0x3b')](_0x127d0b[_0xb25a('0x31')],_0x5e23b6[_0xb25a('0x33')]));if(_0x127d0b[_0xb25a('0x31')]['filter']){_0x3a3f97[_0xb25a('0x3d')]=_[_0xb25a('0x3e')](_0x3a3f97[_0xb25a('0x3d')],{'$or':_[_0xb25a('0x2a')](_0x3a3f97[_0xb25a('0x35')],function(_0x379547){var _0x1c0406={};_0x1c0406[_0x379547]={'$like':'%'+_0x127d0b[_0xb25a('0x31')][_0xb25a('0x3c')]+'%'};return _0x1c0406;})});}_0x3a3f97=_[_0xb25a('0x3e')]({},_0x3a3f97,_0x127d0b[_0xb25a('0x45')]);return _0x1382cb[_0xb25a('0x58')](_0x3a3f97);}})[_0xb25a('0x22')](function(_0xc261da){if(_0xc261da){_0x41d027=_0xc261da[_0xb25a('0x37')];if(!_0x127d0b[_0xb25a('0x31')][_0xb25a('0x57')](_0xb25a('0x38'))){_0x3a3f97['limit']=qs[_0xb25a('0x1b')](_0x127d0b[_0xb25a('0x31')][_0xb25a('0x1b')]);_0x3a3f97['offset']=qs['offset'](_0x127d0b[_0xb25a('0x31')][_0xb25a('0x19')]);}return _0x1382cb[_0xb25a('0x58')](_0x3a3f97);}})[_0xb25a('0x22')](function(_0x357462){if(_0x357462){return _0x357462?{'count':_0x41d027,'rows':_0x357462}:null;}})['then'](respondWithResult(_0x356ca2,null))[_0xb25a('0x43')](handleError(_0x356ca2,null));};exports[_0xb25a('0x59')]=function(_0x388f63,_0x1d24ef,_0x23872b){if(_0x388f63[_0xb25a('0x4f')]['id']){delete _0x388f63[_0xb25a('0x4f')]['id'];}return db[_0xb25a('0x2b')][_0xb25a('0x46')]({'where':{'id':_0x388f63[_0xb25a('0x50')]['id']}})[_0xb25a('0x22')](handleEntityNotFound(_0x1d24ef,null))[_0xb25a('0x22')](function(_0x3ab256){if(_0x3ab256){_0x388f63[_0xb25a('0x4f')][_0xb25a('0x5a')]=_0x3ab256['id'];return db[_0xb25a('0x5b')][_0xb25a('0x47')](_0x388f63[_0xb25a('0x4f')]);}})[_0xb25a('0x22')](respondWithResult(_0x1d24ef,null))[_0xb25a('0x43')](handleError(_0x1d24ef,null));};exports[_0xb25a('0x5c')]=function(_0x1b8778,_0x5d0024,_0x93b6d2){var _0x34bf7d={};var _0x11b2df={};var _0x460192;var _0xbaca24;return db[_0xb25a('0x2b')][_0xb25a('0x56')]({'where':{'id':_0x1b8778[_0xb25a('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0024,null))['then'](function(_0x1cf42b){if(_0x1cf42b){_0x460192=_0x1cf42b;_0x11b2df[_0xb25a('0x30')]=_['keys'](db[_0xb25a('0x5b')][_0xb25a('0x2c')]);_0x11b2df[_0xb25a('0x31')]=_[_0xb25a('0x32')](_0x1b8778['query']);_0x11b2df[_0xb25a('0x33')]=_['intersection'](_0x11b2df['model'],_0x11b2df['query']);_0x34bf7d[_0xb25a('0x35')]=_[_0xb25a('0x34')](_0x11b2df[_0xb25a('0x30')],qs['fields'](_0x1b8778[_0xb25a('0x31')][_0xb25a('0x36')]));_0x34bf7d[_0xb25a('0x35')]=_0x34bf7d[_0xb25a('0x35')][_0xb25a('0x37')]?_0x34bf7d['attributes']:_0x11b2df[_0xb25a('0x30')];_0x34bf7d[_0xb25a('0x39')]=qs[_0xb25a('0x3a')](_0x1b8778[_0xb25a('0x31')][_0xb25a('0x3a')]);_0x34bf7d[_0xb25a('0x3d')]=qs[_0xb25a('0x33')](_[_0xb25a('0x3b')](_0x1b8778[_0xb25a('0x31')],_0x11b2df['filters']));if(_0x1b8778['query']['filter']){_0x34bf7d[_0xb25a('0x3d')]=_[_0xb25a('0x3e')](_0x34bf7d['where'],{'$or':_['map'](_0x34bf7d[_0xb25a('0x35')],function(_0x255428){var _0x10f536={};_0x10f536[_0x255428]={'$like':'%'+_0x1b8778[_0xb25a('0x31')][_0xb25a('0x3c')]+'%'};return _0x10f536;})});}_0x34bf7d=_['merge']({},_0x34bf7d,_0x1b8778['options']);return _0x460192[_0xb25a('0x5c')](_0x34bf7d);}})[_0xb25a('0x22')](function(_0x5d1ad3){if(_0x5d1ad3){_0xbaca24=_0x5d1ad3['length'];if(!_0x1b8778[_0xb25a('0x31')][_0xb25a('0x57')](_0xb25a('0x38'))){_0x34bf7d[_0xb25a('0x1b')]=qs[_0xb25a('0x1b')](_0x1b8778[_0xb25a('0x31')][_0xb25a('0x1b')]);_0x34bf7d['offset']=qs[_0xb25a('0x19')](_0x1b8778[_0xb25a('0x31')][_0xb25a('0x19')]);}return _0x460192[_0xb25a('0x5c')](_0x34bf7d);}})['then'](function(_0x189928){if(_0x189928){return _0x189928?{'count':_0xbaca24,'rows':_0x189928}:null;}})['then'](respondWithResult(_0x5d0024,null))[_0xb25a('0x43')](handleError(_0x5d0024,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index eea8d2f..d4d6081 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 _0xce9b=['exports','define','Trigger','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./trigger.attributes'];(function(_0x385509,_0x39394b){var _0x452d52=function(_0x1d6645){while(--_0x1d6645){_0x385509['push'](_0x385509['shift']());}};_0x452d52(++_0x39394b);}(_0xce9b,0xc6));var _0xbce9=function(_0x59b1f3,_0xef7589){_0x59b1f3=_0x59b1f3-0x0;var _0x31671a=_0xce9b[_0x59b1f3];return _0x31671a;};'use strict';var _=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var moment=require(_0xbce9('0x4'));var BPromise=require(_0xbce9('0x5'));var rp=require(_0xbce9('0x6'));var fs=require('fs');var path=require(_0xbce9('0x7'));var rimraf=require('rimraf');var config=require(_0xbce9('0x8'));var attributes=require(_0xbce9('0x9'));module[_0xbce9('0xa')]=function(_0x256ce6,_0x1c40fa){return _0x256ce6[_0xbce9('0xb')](_0xbce9('0xc'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bc3=['moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash','../../config/logger'];(function(_0x106466,_0xe55a0){var _0x4ae2aa=function(_0x201332){while(--_0x201332){_0x106466['push'](_0x106466['shift']());}};_0x4ae2aa(++_0xe55a0);}(_0x8bc3,0x82));var _0x38bc=function(_0x1a1ee5,_0x5c2452){_0x1a1ee5=_0x1a1ee5-0x0;var _0x38a63d=_0x8bc3[_0x1a1ee5];return _0x38a63d;};'use strict';var _=require(_0x38bc('0x0'));var util=require('util');var logger=require(_0x38bc('0x1'))('api');var moment=require(_0x38bc('0x2'));var BPromise=require(_0x38bc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38bc('0x4'));var rimraf=require(_0x38bc('0x5'));var config=require(_0x38bc('0x6'));var attributes=require(_0x38bc('0x7'));module['exports']=function(_0x29ac4e,_0x2165ed){return _0x29ac4e[_0x38bc('0x8')](_0x38bc('0x9'),attributes,{'tableName':_0x38bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 09f94a0..035ee1e 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 _0x0d33=['error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','options','attributes','limit','include','map','model','debug','stringify','catch','Trigger','find','where','then','info','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent'];(function(_0x393a68,_0x4f92d4){var _0x15e19b=function(_0x2d717d){while(--_0x2d717d){_0x393a68['push'](_0x393a68['shift']());}};_0x15e19b(++_0x4f92d4);}(_0x0d33,0x147));var _0x30d3=function(_0x48ecd2,_0x481ad3){_0x48ecd2=_0x48ecd2-0x0;var _0x5a4457=_0x0d33[_0x48ecd2];return _0x5a4457;};'use strict';var _=require(_0x30d3('0x0'));var util=require(_0x30d3('0x1'));var moment=require(_0x30d3('0x2'));var BPromise=require(_0x30d3('0x3'));var rs=require(_0x30d3('0x4'));var fs=require('fs');var Redis=require(_0x30d3('0x5'));var db=require(_0x30d3('0x6'))['db'];var utils=require(_0x30d3('0x7'));var logger=require(_0x30d3('0x8'))(_0x30d3('0x9'));var config=require('../../config/environment');var jayson=require(_0x30d3('0xa'));var client=jayson[_0x30d3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7983,_0x4a8b04,_0x27933e){return new BPromise(function(_0x1bbe67,_0x3f661f){return client['request'](_0x3c7983,_0x27933e)['then'](function(_0x5564ec){logger['info']('Trigger,\x20%s,\x20%s',_0x4a8b04,_0x30d3('0xc'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4a8b04,_0x30d3('0xc'),JSON['stringify'](_0x5564ec));if(_0x5564ec[_0x30d3('0xd')]){if(_0x5564ec['error'][_0x30d3('0xe')]===0x1f4){logger[_0x30d3('0xd')](_0x30d3('0xf'),_0x4a8b04,_0x5564ec[_0x30d3('0xd')]['message']);return _0x3f661f(_0x5564ec[_0x30d3('0xd')][_0x30d3('0x10')]);}logger[_0x30d3('0xd')]('Trigger,\x20%s,\x20%s',_0x4a8b04,_0x5564ec[_0x30d3('0xd')][_0x30d3('0x10')]);return _0x1bbe67(_0x5564ec[_0x30d3('0xd')][_0x30d3('0x10')]);}else{logger['info'](_0x30d3('0xf'),_0x4a8b04,_0x30d3('0xc'));_0x1bbe67(_0x5564ec[_0x30d3('0x11')][_0x30d3('0x10')]);}})['catch'](function(_0x50a238){logger[_0x30d3('0xd')](_0x30d3('0xf'),_0x4a8b04,_0x50a238);_0x3f661f(_0x50a238);});});}exports[_0x30d3('0x12')]=function(_0x3c51d5){var _0x1d443e=this;return new Promise(function(_0x2ba226,_0xf83f85){return db['Trigger']['findAll']({'raw':_0x3c51d5['options']?_0x3c51d5[_0x30d3('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3c51d5[_0x30d3('0x13')]?_0x3c51d5[_0x30d3('0x13')]['where']||null:null,'attributes':_0x3c51d5[_0x30d3('0x13')]?_0x3c51d5[_0x30d3('0x13')][_0x30d3('0x14')]||null:null,'limit':_0x3c51d5[_0x30d3('0x13')]?_0x3c51d5['options'][_0x30d3('0x15')]||null:null,'include':_0x3c51d5[_0x30d3('0x13')]?_0x3c51d5[_0x30d3('0x13')][_0x30d3('0x16')]?_[_0x30d3('0x17')](_0x3c51d5[_0x30d3('0x13')][_0x30d3('0x16')],function(_0x3524a1){return{'model':db[_0x3524a1['model']],'as':_0x3524a1['as'],'attributes':_0x3524a1[_0x30d3('0x14')],'include':_0x3524a1[_0x30d3('0x16')]?_[_0x30d3('0x17')](_0x3524a1[_0x30d3('0x16')],function(_0x23e40d){return{'model':db[_0x23e40d[_0x30d3('0x18')]],'as':_0x23e40d['as'],'attributes':_0x23e40d[_0x30d3('0x14')],'include':_0x23e40d[_0x30d3('0x16')]?_[_0x30d3('0x17')](_0x23e40d['include'],function(_0x2ca412){return{'model':db[_0x2ca412[_0x30d3('0x18')]],'as':_0x2ca412['as'],'attributes':_0x2ca412['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x403fe8){logger['info'](_0x30d3('0x12'),_0x3c51d5);logger[_0x30d3('0x19')](_0x30d3('0x12'),_0x3c51d5,JSON[_0x30d3('0x1a')](_0x403fe8));_0x2ba226(_0x403fe8);})[_0x30d3('0x1b')](function(_0x7aee97){logger[_0x30d3('0xd')](_0x30d3('0x12'),_0x7aee97['message'],_0x3c51d5);_0xf83f85(_0x1d443e[_0x30d3('0xd')](0x1f4,_0x7aee97[_0x30d3('0x10')]));});});};exports['ShowTrigger']=function(_0x3fe6b3){var _0x1bc1c1=this;return new Promise(function(_0x382c9,_0x47aa20){return db[_0x30d3('0x1c')][_0x30d3('0x1d')]({'raw':_0x3fe6b3[_0x30d3('0x13')]?_0x3fe6b3[_0x30d3('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3fe6b3[_0x30d3('0x13')]?_0x3fe6b3[_0x30d3('0x13')][_0x30d3('0x1e')]||null:null,'attributes':_0x3fe6b3['options']?_0x3fe6b3[_0x30d3('0x13')][_0x30d3('0x14')]||null:null,'include':_0x3fe6b3[_0x30d3('0x13')]?_0x3fe6b3[_0x30d3('0x13')][_0x30d3('0x16')]?_[_0x30d3('0x17')](_0x3fe6b3[_0x30d3('0x13')][_0x30d3('0x16')],function(_0xcf32ba){return{'model':db[_0xcf32ba['model']],'as':_0xcf32ba['as'],'attributes':_0xcf32ba['attributes'],'include':_0xcf32ba[_0x30d3('0x16')]?_[_0x30d3('0x17')](_0xcf32ba['include'],function(_0x1a8f96){return{'model':db[_0x1a8f96[_0x30d3('0x18')]],'as':_0x1a8f96['as'],'attributes':_0x1a8f96['attributes'],'include':_0x1a8f96[_0x30d3('0x16')]?_['map'](_0x1a8f96[_0x30d3('0x16')],function(_0xdd3a1c){return{'model':db[_0xdd3a1c[_0x30d3('0x18')]],'as':_0xdd3a1c['as'],'attributes':_0xdd3a1c[_0x30d3('0x14')]};}):[]};}):[]};}):[]:[]})[_0x30d3('0x1f')](function(_0x4b58d0){logger[_0x30d3('0x20')](_0x30d3('0x21'),_0x3fe6b3);logger[_0x30d3('0x19')](_0x30d3('0x21'),_0x3fe6b3,JSON[_0x30d3('0x1a')](_0x4b58d0));_0x382c9(_0x4b58d0);})['catch'](function(_0x44a01f){logger['error'](_0x30d3('0x21'),_0x44a01f[_0x30d3('0x10')],_0x3fe6b3);_0x47aa20(_0x1bc1c1[_0x30d3('0xd')](0x1f4,_0x44a01f[_0x30d3('0x10')]));});});}; \ No newline at end of file +var _0x3897=['code','message','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','model','map','include','stringify','ShowTrigger','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0x3897,0xa4));var _0x7389=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x3897[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x7389('0x0'));var util=require(_0x7389('0x1'));var moment=require('moment');var BPromise=require(_0x7389('0x2'));var rs=require(_0x7389('0x3'));var fs=require('fs');var Redis=require(_0x7389('0x4'));var db=require(_0x7389('0x5'))['db'];var utils=require(_0x7389('0x6'));var logger=require(_0x7389('0x7'))(_0x7389('0x8'));var config=require(_0x7389('0x9'));var jayson=require(_0x7389('0xa'));var client=jayson[_0x7389('0xb')][_0x7389('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c120d,_0x2850b2,_0x1b79bf){return new BPromise(function(_0x934600,_0x59eb64){return client[_0x7389('0xd')](_0x3c120d,_0x1b79bf)[_0x7389('0xe')](function(_0x15c8a3){logger[_0x7389('0xf')](_0x7389('0x10'),_0x2850b2,_0x7389('0x11'));logger[_0x7389('0x12')](_0x7389('0x13'),_0x2850b2,_0x7389('0x11'),JSON['stringify'](_0x15c8a3));if(_0x15c8a3[_0x7389('0x14')]){if(_0x15c8a3[_0x7389('0x14')][_0x7389('0x15')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2850b2,_0x15c8a3[_0x7389('0x14')][_0x7389('0x16')]);return _0x59eb64(_0x15c8a3[_0x7389('0x14')]['message']);}logger[_0x7389('0x14')]('Trigger,\x20%s,\x20%s',_0x2850b2,_0x15c8a3[_0x7389('0x14')][_0x7389('0x16')]);return _0x934600(_0x15c8a3['error'][_0x7389('0x16')]);}else{logger[_0x7389('0xf')]('Trigger,\x20%s,\x20%s',_0x2850b2,_0x7389('0x11'));_0x934600(_0x15c8a3['result'][_0x7389('0x16')]);}})[_0x7389('0x17')](function(_0x1481c8){logger[_0x7389('0x14')](_0x7389('0x10'),_0x2850b2,_0x1481c8);_0x59eb64(_0x1481c8);});});}exports[_0x7389('0x18')]=function(_0x285441){var _0x5d8f1b=this;return new Promise(function(_0x41eee6,_0x145ca3){return db[_0x7389('0x19')][_0x7389('0x1a')]({'raw':_0x285441[_0x7389('0x1b')]?_0x285441['options']['raw']===undefined?!![]:![]:!![],'where':_0x285441[_0x7389('0x1b')]?_0x285441[_0x7389('0x1b')][_0x7389('0x1c')]||null:null,'attributes':_0x285441[_0x7389('0x1b')]?_0x285441[_0x7389('0x1b')][_0x7389('0x1d')]||null:null,'limit':_0x285441[_0x7389('0x1b')]?_0x285441[_0x7389('0x1b')][_0x7389('0x1e')]||null:null,'include':_0x285441[_0x7389('0x1b')]?_0x285441[_0x7389('0x1b')]['include']?_['map'](_0x285441['options']['include'],function(_0xf9f1ba){return{'model':db[_0xf9f1ba[_0x7389('0x1f')]],'as':_0xf9f1ba['as'],'attributes':_0xf9f1ba['attributes'],'include':_0xf9f1ba['include']?_[_0x7389('0x20')](_0xf9f1ba['include'],function(_0x3b1b19){return{'model':db[_0x3b1b19[_0x7389('0x1f')]],'as':_0x3b1b19['as'],'attributes':_0x3b1b19[_0x7389('0x1d')],'include':_0x3b1b19[_0x7389('0x21')]?_[_0x7389('0x20')](_0x3b1b19[_0x7389('0x21')],function(_0x148142){return{'model':db[_0x148142[_0x7389('0x1f')]],'as':_0x148142['as'],'attributes':_0x148142[_0x7389('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7389('0xe')](function(_0x4cb391){logger[_0x7389('0xf')]('GetTrigger',_0x285441);logger[_0x7389('0x12')](_0x7389('0x18'),_0x285441,JSON[_0x7389('0x22')](_0x4cb391));_0x41eee6(_0x4cb391);})[_0x7389('0x17')](function(_0x3d3e6d){logger[_0x7389('0x14')](_0x7389('0x18'),_0x3d3e6d[_0x7389('0x16')],_0x285441);_0x145ca3(_0x5d8f1b[_0x7389('0x14')](0x1f4,_0x3d3e6d[_0x7389('0x16')]));});});};exports[_0x7389('0x23')]=function(_0x65145b){var _0x2ddfed=this;return new Promise(function(_0x407c1f,_0x27afd5){return db[_0x7389('0x19')]['find']({'raw':_0x65145b[_0x7389('0x1b')]?_0x65145b[_0x7389('0x1b')][_0x7389('0x24')]===undefined?!![]:![]:!![],'where':_0x65145b['options']?_0x65145b[_0x7389('0x1b')][_0x7389('0x1c')]||null:null,'attributes':_0x65145b['options']?_0x65145b[_0x7389('0x1b')][_0x7389('0x1d')]||null:null,'include':_0x65145b['options']?_0x65145b[_0x7389('0x1b')]['include']?_[_0x7389('0x20')](_0x65145b['options']['include'],function(_0x4b884b){return{'model':db[_0x4b884b[_0x7389('0x1f')]],'as':_0x4b884b['as'],'attributes':_0x4b884b['attributes'],'include':_0x4b884b['include']?_[_0x7389('0x20')](_0x4b884b[_0x7389('0x21')],function(_0x5819bd){return{'model':db[_0x5819bd['model']],'as':_0x5819bd['as'],'attributes':_0x5819bd['attributes'],'include':_0x5819bd['include']?_[_0x7389('0x20')](_0x5819bd[_0x7389('0x21')],function(_0x4b3d62){return{'model':db[_0x4b3d62[_0x7389('0x1f')]],'as':_0x4b3d62['as'],'attributes':_0x4b3d62[_0x7389('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7389('0xe')](function(_0x23c88c){logger[_0x7389('0xf')]('ShowTrigger',_0x65145b);logger[_0x7389('0x12')](_0x7389('0x23'),_0x65145b,JSON[_0x7389('0x22')](_0x23c88c));_0x407c1f(_0x23c88c);})[_0x7389('0x17')](function(_0x518fe5){logger[_0x7389('0x14')](_0x7389('0x23'),_0x518fe5[_0x7389('0x16')],_0x65145b);_0x27afd5(_0x2ddfed[_0x7389('0x14')](0x1f4,_0x518fe5[_0x7389('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 85a1c4d..e0c90d6 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 _0xffa6=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','/:id/clone','create','put','/:id','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xffa6,0xaa));var _0x6ffa=function(_0x539c94,_0x12bd99){_0x539c94=_0x539c94-0x0;var _0x2ac54f=_0xffa6[_0x539c94];return _0x2ac54f;};'use strict';var multer=require(_0x6ffa('0x0'));var util=require(_0x6ffa('0x1'));var path=require(_0x6ffa('0x2'));var timeout=require(_0x6ffa('0x3'));var express=require(_0x6ffa('0x4'));var router=express['Router']();var fs_extra=require(_0x6ffa('0x5'));var auth=require(_0x6ffa('0x6'));var interaction=require(_0x6ffa('0x7'));var config=require(_0x6ffa('0x8'));var controller=require('./trunk.controller');router[_0x6ffa('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ffa('0xa')]);router[_0x6ffa('0x9')]('/:id',auth[_0x6ffa('0xb')](),controller[_0x6ffa('0xc')]);router[_0x6ffa('0xd')](_0x6ffa('0xe'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0x6ffa('0xf')]);router[_0x6ffa('0x10')](_0x6ffa('0x11'),auth[_0x6ffa('0xb')](),controller[_0x6ffa('0x12')]);router[_0x6ffa('0x13')]('/:id',auth[_0x6ffa('0xb')](),controller[_0x6ffa('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd712=['isAuthenticated','show','post','clone','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./trunk.controller','get','index'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd712,0x6e));var _0x2d71=function(_0x509061,_0x1e86d9){_0x509061=_0x509061-0x0;var _0x2ba6b6=_0xd712[_0x509061];return _0x2ba6b6;};'use strict';var multer=require(_0x2d71('0x0'));var util=require(_0x2d71('0x1'));var path=require(_0x2d71('0x2'));var timeout=require(_0x2d71('0x3'));var express=require('express');var router=express[_0x2d71('0x4')]();var fs_extra=require(_0x2d71('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d71('0x6'));var controller=require(_0x2d71('0x7'));router[_0x2d71('0x8')]('/',auth['isAuthenticated'](),controller[_0x2d71('0x9')]);router[_0x2d71('0x8')]('/:id',auth[_0x2d71('0xa')](),controller[_0x2d71('0xb')]);router[_0x2d71('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x2d71('0xd')]);router['post']('/',auth[_0x2d71('0xa')](),controller[_0x2d71('0xe')]);router[_0x2d71('0xf')](_0x2d71('0x10'),auth[_0x2d71('0xa')](),controller[_0x2d71('0x11')]);router[_0x2d71('0x12')](_0x2d71('0x10'),auth[_0x2d71('0xa')](),controller['destroy']);module[_0x2d71('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index f1f6410..9ea89f1 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 _0x6a60=['never','always','accept','refuse','INTEGER','uas','pai','fingerprint','active','passive','update,nonat','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport','split','rfc2833','info','shortinfo','inband','auto','nonat','update','yes','force_rport,comedia','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6a60,0x154));var _0x06a6=function(_0x1d4d1e,_0x2f680e){_0x1d4d1e=_0x1d4d1e-0x0;var _0x38c95f=_0x6a60[_0x1d4d1e];return _0x38c95f;};'use strict';var Sequelize=require(_0x06a6('0x0'));module[_0x06a6('0x1')]={'name':{'type':Sequelize[_0x06a6('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x06a6('0x3'),_0x06a6('0x4'),_0x06a6('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x06a6('0x2')],'allowNull':![],'defaultValue':_0x06a6('0x6')},'callingpres':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x8'),_0x06a6('0x9'),_0x06a6('0xa'),_0x06a6('0xb'),'PROHIB_NOT_SCREENED',_0x06a6('0xc'),_0x06a6('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x06a6('0x2')]},'secret':{'type':Sequelize[_0x06a6('0x2')]},'md5secret':{'type':Sequelize[_0x06a6('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x06a6('0xe'),'set':function(_0x34a5bd){this['setDataValue']('transport',_0x34a5bd?_0x34a5bd[_0x06a6('0xf')](','):null);},'get':function(){return this[_0x06a6('0x10')](_0x06a6('0x11'))?this['getDataValue'](_0x06a6('0x11'))[_0x06a6('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x13'),_0x06a6('0x14'),_0x06a6('0x15'),_0x06a6('0x16'),_0x06a6('0x17')),'defaultValue':_0x06a6('0x13')},'directmedia':{'type':Sequelize[_0x06a6('0x7')]('yes','no',_0x06a6('0x18'),_0x06a6('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x06a6('0x2')]},'directmediadeny':{'type':Sequelize[_0x06a6('0x2')]},'nat':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':_0x06a6('0x1b'),'set':function(_0x3fff10){this['setDataValue']('nat',_0x3fff10?_0x3fff10[_0x06a6('0xf')](','):null);},'get':function(){return this[_0x06a6('0x10')]('nat')?this[_0x06a6('0x10')]('nat')[_0x06a6('0x12')](','):null;},'comment':_0x06a6('0x1c')},'callgroup':{'type':Sequelize[_0x06a6('0x2')]},'namedcallgroup':{'type':Sequelize[_0x06a6('0x2')]},'pickupgroup':{'type':Sequelize[_0x06a6('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x06a6('0x2')]},'language':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x06a6('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':_0x06a6('0x1d')},'allow':{'type':Sequelize[_0x06a6('0x2')],'allowNull':![],'defaultValue':_0x06a6('0x1e'),'set':function(_0x408e92){this[_0x06a6('0x1f')](_0x06a6('0x20'),_0x408e92?_0x408e92[_0x06a6('0xf')](';'):_0x06a6('0x1e'));},'get':function(){return this['getDataValue'](_0x06a6('0x20'))?this[_0x06a6('0x10')]('allow')['split'](';'):null;},'comment':_0x06a6('0x21')},'autoframing':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'insecure':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':'port,invite','set':function(_0x585e6e){this[_0x06a6('0x1f')](_0x06a6('0x22'),_0x585e6e?_0x585e6e[_0x06a6('0xf')](','):null);},'get':function(){return this[_0x06a6('0x10')](_0x06a6('0x22'))?this[_0x06a6('0x10')](_0x06a6('0x22'))[_0x06a6('0x12')](','):null;},'comment':_0x06a6('0x23')},'trustrpid':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x06a6('0x7')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no',_0x06a6('0x24'))},'promiscredir':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x06a6('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x06a6('0x2')]},'callcounter':{'type':Sequelize[_0x06a6('0x7')]('yes','no'),'defaultValue':_0x06a6('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x06a6('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x06a6('0x2')]},'template':{'type':Sequelize[_0x06a6('0x2')]},'videosupport':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no',_0x06a6('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x06a6('0x2')]},'session_timers':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x26'),_0x06a6('0x27'),'originate')},'session_expires':{'type':Sequelize[_0x06a6('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x06a6('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x06a6('0x7')]('uac',_0x06a6('0x29')),'defaultValue':_0x06a6('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x06a6('0x2')]},'regexten':{'type':Sequelize[_0x06a6('0x2')]},'fromdomain':{'type':Sequelize[_0x06a6('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x06a6('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x06a6('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x06a6('0x2')]},'defaultuser':{'type':Sequelize[_0x06a6('0x2')]},'rtptimeout':{'type':Sequelize[_0x06a6('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x06a6('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x06a6('0x28')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no',_0x06a6('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x06a6('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x06a6('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x06a6('0x2')]},'contactdeny':{'type':Sequelize[_0x06a6('0x2')]},'contactacl':{'type':Sequelize[_0x06a6('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x06a6('0x2')]},'use_q850_reason':{'type':Sequelize[_0x06a6('0x2')]},'maxforwards':{'type':Sequelize[_0x06a6('0x28')](0xb)},'encryption':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no',_0x06a6('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x06a6('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x06a6('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x06a6('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x06a6('0x2')]},'dtlscapath':{'type':Sequelize[_0x06a6('0x2')]},'dtlssetup':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x2c'),_0x06a6('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x06a6('0x2')]},'usereqphone':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x06a6('0x2')]},'call_limit':{'type':Sequelize[_0x06a6('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x06a6('0x7')](_0x06a6('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x06a6('0x2')]},'mohinterpret':{'type':Sequelize[_0x06a6('0x2')]},'mohsuggest':{'type':Sequelize[_0x06a6('0x2')]},'parkinglot':{'type':Sequelize[_0x06a6('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x06a6('0x1a'),'no','nonat',_0x06a6('0x19'),_0x06a6('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x06a6('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xd0c5=['info','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','originate','uac','uas','certificate','passive','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0xcb56d2,_0x18c194){var _0x57bed4=function(_0x194ed8){while(--_0x194ed8){_0xcb56d2['push'](_0xcb56d2['shift']());}};_0x57bed4(++_0x18c194);}(_0xd0c5,0x148));var _0x5d0c=function(_0x429d12,_0x5645e2){_0x429d12=_0x429d12-0x0;var _0x67eba8=_0xd0c5[_0x429d12];return _0x67eba8;};'use strict';var Sequelize=require('sequelize');module[_0x5d0c('0x0')]={'name':{'type':Sequelize[_0x5d0c('0x1')],'allowNull':![],'unique':_0x5d0c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x4'),_0x5d0c('0x5'),_0x5d0c('0x6')),'allowNull':![],'defaultValue':_0x5d0c('0x4')},'context':{'type':Sequelize[_0x5d0c('0x1')],'allowNull':![],'defaultValue':_0x5d0c('0x7')},'callingpres':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x8'),_0x5d0c('0x9'),'ALLOWED_FAILED_SCREEN',_0x5d0c('0xa'),_0x5d0c('0xb'),_0x5d0c('0xc'),'PROHIB_FAILED_SCREEN',_0x5d0c('0xd'))},'deny':{'type':Sequelize[_0x5d0c('0x1')]},'permit':{'type':Sequelize[_0x5d0c('0x1')]},'secret':{'type':Sequelize[_0x5d0c('0x1')]},'md5secret':{'type':Sequelize[_0x5d0c('0x1')]},'remotesecret':{'type':Sequelize[_0x5d0c('0x1')]},'transport':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':_0x5d0c('0xe'),'set':function(_0x31731f){this[_0x5d0c('0xf')]('transport',_0x31731f?_0x31731f[_0x5d0c('0x10')](','):null);},'get':function(){return this[_0x5d0c('0x11')](_0x5d0c('0x12'))?this['getDataValue'](_0x5d0c('0x12'))[_0x5d0c('0x13')](','):null;},'comment':_0x5d0c('0x14')},'dtmfmode':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x15'),_0x5d0c('0x16'),'shortinfo',_0x5d0c('0x17'),_0x5d0c('0x18')),'defaultValue':_0x5d0c('0x15')},'directmedia':{'type':Sequelize['ENUM'](_0x5d0c('0x19'),'no','nonat',_0x5d0c('0x1a'),_0x5d0c('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5d0c('0x1')]},'directmediadeny':{'type':Sequelize[_0x5d0c('0x1')]},'nat':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':_0x5d0c('0x1c'),'set':function(_0x2961e9){this[_0x5d0c('0xf')]('nat',_0x2961e9?_0x2961e9[_0x5d0c('0x10')](','):null);},'get':function(){return this[_0x5d0c('0x11')](_0x5d0c('0x1d'))?this[_0x5d0c('0x11')](_0x5d0c('0x1d'))[_0x5d0c('0x13')](','):null;},'comment':_0x5d0c('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x5d0c('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x5d0c('0x1')]},'language':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5d0c('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x5d0c('0x1f')},'allow':{'type':Sequelize[_0x5d0c('0x1')],'allowNull':![],'defaultValue':_0x5d0c('0x20'),'set':function(_0x56f03b){this['setDataValue'](_0x5d0c('0x21'),_0x56f03b?_0x56f03b[_0x5d0c('0x10')](';'):_0x5d0c('0x20'));},'get':function(){return this[_0x5d0c('0x11')](_0x5d0c('0x21'))?this['getDataValue'](_0x5d0c('0x21'))[_0x5d0c('0x13')](';'):null;},'comment':_0x5d0c('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x5d0c('0x19'),'no')},'insecure':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':_0x5d0c('0x23'),'set':function(_0x3de3ca){this['setDataValue'](_0x5d0c('0x24'),_0x3de3ca?_0x3de3ca[_0x5d0c('0x10')](','):null);},'get':function(){return this[_0x5d0c('0x11')](_0x5d0c('0x24'))?this['getDataValue'](_0x5d0c('0x24'))[_0x5d0c('0x13')](','):null;},'comment':_0x5d0c('0x25')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no',_0x5d0c('0x26'))},'promiscredir':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'accountcode':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'setvar':{'type':Sequelize[_0x5d0c('0x1')]},'callerid':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5d0c('0x1')]},'callcounter':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no'),'defaultValue':_0x5d0c('0x19')},'busylevel':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x5d0c('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x5d0c('0x1')]},'videosupport':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no',_0x5d0c('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5d0c('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x5d0c('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x5d0c('0x29'),'refuse',_0x5d0c('0x2a'))},'session_expires':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x2b'),_0x5d0c('0x2c')),'defaultValue':_0x5d0c('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x5d0c('0x1')]},'regexten':{'type':Sequelize[_0x5d0c('0x1')]},'fromdomain':{'type':Sequelize[_0x5d0c('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x5d0c('0x27')](0x5)},'qualify':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x5d0c('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x5d0c('0x1')]},'timert1':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'timerb':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x5d0c('0x1')]},'contactacl':{'type':Sequelize[_0x5d0c('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x5d0c('0x1')]},'use_q850_reason':{'type':Sequelize[_0x5d0c('0x1')]},'maxforwards':{'type':Sequelize[_0x5d0c('0x27')](0xb)},'encryption':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5d0c('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x5d0c('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x5d0c('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x5d0c('0x19'),'no','fingerprint',_0x5d0c('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x5d0c('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x5d0c('0x1')]},'dtlscipher':{'type':Sequelize[_0x5d0c('0x1')]},'dtlscafile':{'type':Sequelize[_0x5d0c('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x5d0c('0x3')]('active',_0x5d0c('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5d0c('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5d0c('0x1')]},'recordofffeature':{'type':Sequelize[_0x5d0c('0x1')]},'call_limit':{'type':Sequelize[_0x5d0c('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5d0c('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x5d0c('0x3')](_0x5d0c('0x19'),'no')},'vmexten':{'type':Sequelize[_0x5d0c('0x1')]},'mohinterpret':{'type':Sequelize[_0x5d0c('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x5d0c('0x1')]},'description':{'type':Sequelize[_0x5d0c('0x1')]},'host':{'type':Sequelize[_0x5d0c('0x1')],'defaultValue':_0x5d0c('0x2f')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x5d0c('0x30'),_0x5d0c('0x1a'),_0x5d0c('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5d0c('0x1')]},'otherFields':{'type':Sequelize[_0x5d0c('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x5d0c('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 382c844..577d345 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 _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x225a9f,_0x74bfe0){var _0x32e807=function(_0x451220){while(--_0x451220){_0x225a9f['push'](_0x225a9f['shift']());}};_0x32e807(++_0x74bfe0);}(_0xbec5,0xe5));var _0x5bec=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xbec5[_0x187279];return _0x3da59d;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x203b9d,_0x6695e8){var _0x5c44bf=function(_0x58089e){while(--_0x58089e){_0x203b9d['push'](_0x203b9d['shift']());}};_0x5c44bf(++_0x6695e8);}(_0xb821,0xa7));var _0x1b82=function(_0x13ecda,_0xca1a21){_0x13ecda=_0x13ecda-0x0;var _0x4cbaf3=_0xb821[_0x13ecda];return _0x4cbaf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 7f79546..b378fce 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 _0xbeff=['moment','bluebird','request-promise','path','rimraf','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x4bbaba,_0x15097c){var _0x34ff2b=function(_0x190d49){while(--_0x190d49){_0x4bbaba['push'](_0x4bbaba['shift']());}};_0x34ff2b(++_0x15097c);}(_0xbeff,0x168));var _0xfbef=function(_0x214648,_0x16265d){_0x214648=_0x214648-0x0;var _0x520e6f=_0xbeff[_0x214648];return _0x520e6f;};'use strict';var _=require(_0xfbef('0x0'));var util=require(_0xfbef('0x1'));var logger=require(_0xfbef('0x2'))(_0xfbef('0x3'));var moment=require(_0xfbef('0x4'));var BPromise=require(_0xfbef('0x5'));var rp=require(_0xfbef('0x6'));var fs=require('fs');var path=require(_0xfbef('0x7'));var rimraf=require(_0xfbef('0x8'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xfbef('0x9')]=function(_0x2f07fe,_0x418277){return _0x2f07fe[_0xfbef('0xa')](_0xfbef('0xb'),attributes,{'tableName':_0xfbef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4bc=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xc4bc,0x137));var _0xcc4b=function(_0x4e65b5,_0x196d14){_0x4e65b5=_0x4e65b5-0x0;var _0x474800=_0xc4bc[_0x4e65b5];return _0x474800;};'use strict';var _=require(_0xcc4b('0x0'));var util=require(_0xcc4b('0x1'));var logger=require(_0xcc4b('0x2'))('api');var moment=require(_0xcc4b('0x3'));var BPromise=require(_0xcc4b('0x4'));var rp=require(_0xcc4b('0x5'));var fs=require('fs');var path=require(_0xcc4b('0x6'));var rimraf=require('rimraf');var config=require(_0xcc4b('0x7'));var attributes=require(_0xcc4b('0x8'));module[_0xcc4b('0x9')]=function(_0x270ae5,_0xe47bf2){return _0x270ae5[_0xcc4b('0xa')](_0xcc4b('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 3049fd5..1eb02fa 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 _0x196f=['../../config/logger','rpc','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowTrunk','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0x525365,_0x439ae8){var _0x2be29a=function(_0x3a94e0){while(--_0x3a94e0){_0x525365['push'](_0x525365['shift']());}};_0x2be29a(++_0x439ae8);}(_0x196f,0x1ec));var _0xf196=function(_0x52aeff,_0x3e2ee7){_0x52aeff=_0x52aeff-0x0;var _0x1216e6=_0x196f[_0x52aeff];return _0x1216e6;};'use strict';var _=require(_0xf196('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf196('0x1'));var db=require(_0xf196('0x2'))['db'];var utils=require(_0xf196('0x3'));var logger=require(_0xf196('0x4'))(_0xf196('0x5'));var config=require('../../config/environment');var jayson=require(_0xf196('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec2e0,_0x3c8613,_0xf8add4){return new BPromise(function(_0x61c5f4,_0x5c581f){return client[_0xf196('0x7')](_0x5ec2e0,_0xf8add4)[_0xf196('0x8')](function(_0xf0ed83){logger[_0xf196('0x9')](_0xf196('0xa'),_0x3c8613,_0xf196('0xb'));logger['debug'](_0xf196('0xc'),_0x3c8613,_0xf196('0xb'),JSON[_0xf196('0xd')](_0xf0ed83));if(_0xf0ed83[_0xf196('0xe')]){if(_0xf0ed83[_0xf196('0xe')]['code']===0x1f4){logger['error'](_0xf196('0xa'),_0x3c8613,_0xf0ed83[_0xf196('0xe')][_0xf196('0xf')]);return _0x5c581f(_0xf0ed83[_0xf196('0xe')][_0xf196('0xf')]);}logger['error'](_0xf196('0xa'),_0x3c8613,_0xf0ed83[_0xf196('0xe')]['message']);return _0x61c5f4(_0xf0ed83[_0xf196('0xe')][_0xf196('0xf')]);}else{logger[_0xf196('0x9')]('Trunk,\x20%s,\x20%s',_0x3c8613,_0xf196('0xb'));_0x61c5f4(_0xf0ed83[_0xf196('0x10')]['message']);}})[_0xf196('0x11')](function(_0xd73caa){logger[_0xf196('0xe')](_0xf196('0xa'),_0x3c8613,_0xd73caa);_0x5c581f(_0xd73caa);});});}exports[_0xf196('0x12')]=function(_0x14ab04){var _0x720e58=this;return new Promise(function(_0x243e31,_0x32f741){return db[_0xf196('0x13')][_0xf196('0x14')]({'raw':_0x14ab04['options']?_0x14ab04[_0xf196('0x15')][_0xf196('0x16')]===undefined?!![]:![]:!![],'where':_0x14ab04[_0xf196('0x15')]?_0x14ab04[_0xf196('0x15')][_0xf196('0x17')]||null:null,'attributes':_0x14ab04[_0xf196('0x15')]?_0x14ab04[_0xf196('0x15')][_0xf196('0x18')]||null:null,'limit':_0x14ab04[_0xf196('0x15')]?_0x14ab04[_0xf196('0x15')][_0xf196('0x19')]||null:null,'include':_0x14ab04[_0xf196('0x15')]?_0x14ab04['options'][_0xf196('0x1a')]?_[_0xf196('0x1b')](_0x14ab04['options'][_0xf196('0x1a')],function(_0x55f3dd){return{'model':db[_0x55f3dd['model']],'as':_0x55f3dd['as'],'attributes':_0x55f3dd[_0xf196('0x18')],'include':_0x55f3dd[_0xf196('0x1a')]?_[_0xf196('0x1b')](_0x55f3dd[_0xf196('0x1a')],function(_0x10ca4d){return{'model':db[_0x10ca4d[_0xf196('0x1c')]],'as':_0x10ca4d['as'],'attributes':_0x10ca4d[_0xf196('0x18')],'include':_0x10ca4d[_0xf196('0x1a')]?_['map'](_0x10ca4d['include'],function(_0x24971d){return{'model':db[_0x24971d['model']],'as':_0x24971d['as'],'attributes':_0x24971d[_0xf196('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf196('0x8')](function(_0x13b43f){logger['info']('GetTrunk',_0x14ab04);logger['debug'](_0xf196('0x12'),_0x14ab04,JSON[_0xf196('0xd')](_0x13b43f));_0x243e31(_0x13b43f);})[_0xf196('0x11')](function(_0x446f70){logger[_0xf196('0xe')](_0xf196('0x12'),_0x446f70[_0xf196('0xf')],_0x14ab04);_0x32f741(_0x720e58[_0xf196('0xe')](0x1f4,_0x446f70[_0xf196('0xf')]));});});};exports['ShowTrunk']=function(_0x3e1d49){var _0x18ca0a=this;return new Promise(function(_0x2abd9e,_0x187dad){return db[_0xf196('0x13')]['find']({'raw':_0x3e1d49[_0xf196('0x15')]?_0x3e1d49[_0xf196('0x15')][_0xf196('0x16')]===undefined?!![]:![]:!![],'where':_0x3e1d49[_0xf196('0x15')]?_0x3e1d49[_0xf196('0x15')][_0xf196('0x17')]||null:null,'attributes':_0x3e1d49[_0xf196('0x15')]?_0x3e1d49[_0xf196('0x15')][_0xf196('0x18')]||null:null,'include':_0x3e1d49['options']?_0x3e1d49['options'][_0xf196('0x1a')]?_[_0xf196('0x1b')](_0x3e1d49[_0xf196('0x15')][_0xf196('0x1a')],function(_0x2ac3ad){return{'model':db[_0x2ac3ad[_0xf196('0x1c')]],'as':_0x2ac3ad['as'],'attributes':_0x2ac3ad[_0xf196('0x18')],'include':_0x2ac3ad['include']?_[_0xf196('0x1b')](_0x2ac3ad['include'],function(_0x153a2c){return{'model':db[_0x153a2c[_0xf196('0x1c')]],'as':_0x153a2c['as'],'attributes':_0x153a2c[_0xf196('0x18')],'include':_0x153a2c[_0xf196('0x1a')]?_['map'](_0x153a2c[_0xf196('0x1a')],function(_0x3719b5){return{'model':db[_0x3719b5[_0xf196('0x1c')]],'as':_0x3719b5['as'],'attributes':_0x3719b5[_0xf196('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf196('0x8')](function(_0x1f6ed4){logger[_0xf196('0x9')]('ShowTrunk',_0x3e1d49);logger[_0xf196('0x1d')](_0xf196('0x1e'),_0x3e1d49,JSON['stringify'](_0x1f6ed4));_0x2abd9e(_0x1f6ed4);})[_0xf196('0x11')](function(_0x5a3a63){logger['error'](_0xf196('0x1e'),_0x5a3a63['message'],_0x3e1d49);_0x187dad(_0x18ca0a[_0xf196('0xe')](0x1f4,_0x5a3a63['message']));});});}; \ No newline at end of file +var _0x69d6=['catch','Trunk','options','raw','where','attributes','limit','include','map','model','GetTrunk','ShowTrunk','find','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trunk,\x20%s,\x20%s','message','result'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x69d6,0x1b2));var _0x669d=function(_0x27773e,_0x1fb5bd){_0x27773e=_0x27773e-0x0;var _0x24895c=_0x69d6[_0x27773e];return _0x24895c;};'use strict';var _=require(_0x669d('0x0'));var util=require(_0x669d('0x1'));var moment=require(_0x669d('0x2'));var BPromise=require('bluebird');var rs=require(_0x669d('0x3'));var fs=require('fs');var Redis=require(_0x669d('0x4'));var db=require(_0x669d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x669d('0x6'))('rpc');var config=require(_0x669d('0x7'));var jayson=require(_0x669d('0x8'));var client=jayson[_0x669d('0x9')][_0x669d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17cbcb,_0x9db0be,_0x1ee57b){return new BPromise(function(_0x3a1213,_0x45b0a8){return client[_0x669d('0xb')](_0x17cbcb,_0x1ee57b)['then'](function(_0x2e2abe){logger[_0x669d('0xc')]('Trunk,\x20%s,\x20%s',_0x9db0be,'request\x20sent');logger[_0x669d('0xd')](_0x669d('0xe'),_0x9db0be,_0x669d('0xf'),JSON[_0x669d('0x10')](_0x2e2abe));if(_0x2e2abe[_0x669d('0x11')]){if(_0x2e2abe[_0x669d('0x11')]['code']===0x1f4){logger[_0x669d('0x11')](_0x669d('0x12'),_0x9db0be,_0x2e2abe[_0x669d('0x11')]['message']);return _0x45b0a8(_0x2e2abe[_0x669d('0x11')][_0x669d('0x13')]);}logger[_0x669d('0x11')](_0x669d('0x12'),_0x9db0be,_0x2e2abe[_0x669d('0x11')][_0x669d('0x13')]);return _0x3a1213(_0x2e2abe['error'][_0x669d('0x13')]);}else{logger[_0x669d('0xc')]('Trunk,\x20%s,\x20%s',_0x9db0be,_0x669d('0xf'));_0x3a1213(_0x2e2abe[_0x669d('0x14')][_0x669d('0x13')]);}})[_0x669d('0x15')](function(_0x14cb89){logger[_0x669d('0x11')](_0x669d('0x12'),_0x9db0be,_0x14cb89);_0x45b0a8(_0x14cb89);});});}exports['GetTrunk']=function(_0x58249d){var _0x550f77=this;return new Promise(function(_0x496ae8,_0x2f7733){return db[_0x669d('0x16')]['findAll']({'raw':_0x58249d['options']?_0x58249d[_0x669d('0x17')][_0x669d('0x18')]===undefined?!![]:![]:!![],'where':_0x58249d[_0x669d('0x17')]?_0x58249d[_0x669d('0x17')][_0x669d('0x19')]||null:null,'attributes':_0x58249d[_0x669d('0x17')]?_0x58249d[_0x669d('0x17')][_0x669d('0x1a')]||null:null,'limit':_0x58249d[_0x669d('0x17')]?_0x58249d[_0x669d('0x17')][_0x669d('0x1b')]||null:null,'include':_0x58249d[_0x669d('0x17')]?_0x58249d['options'][_0x669d('0x1c')]?_[_0x669d('0x1d')](_0x58249d[_0x669d('0x17')][_0x669d('0x1c')],function(_0x17ffd7){return{'model':db[_0x17ffd7[_0x669d('0x1e')]],'as':_0x17ffd7['as'],'attributes':_0x17ffd7[_0x669d('0x1a')],'include':_0x17ffd7[_0x669d('0x1c')]?_[_0x669d('0x1d')](_0x17ffd7[_0x669d('0x1c')],function(_0x5378e7){return{'model':db[_0x5378e7[_0x669d('0x1e')]],'as':_0x5378e7['as'],'attributes':_0x5378e7[_0x669d('0x1a')],'include':_0x5378e7[_0x669d('0x1c')]?_['map'](_0x5378e7[_0x669d('0x1c')],function(_0x2fdf73){return{'model':db[_0x2fdf73[_0x669d('0x1e')]],'as':_0x2fdf73['as'],'attributes':_0x2fdf73[_0x669d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b011d){logger[_0x669d('0xc')](_0x669d('0x1f'),_0x58249d);logger[_0x669d('0xd')](_0x669d('0x1f'),_0x58249d,JSON[_0x669d('0x10')](_0x1b011d));_0x496ae8(_0x1b011d);})['catch'](function(_0x509f4e){logger['error'](_0x669d('0x1f'),_0x509f4e['message'],_0x58249d);_0x2f7733(_0x550f77['error'](0x1f4,_0x509f4e[_0x669d('0x13')]));});});};exports[_0x669d('0x20')]=function(_0x353dd7){var _0x2a76ff=this;return new Promise(function(_0x3e2c39,_0x4d65ef){return db['Trunk'][_0x669d('0x21')]({'raw':_0x353dd7[_0x669d('0x17')]?_0x353dd7[_0x669d('0x17')][_0x669d('0x18')]===undefined?!![]:![]:!![],'where':_0x353dd7[_0x669d('0x17')]?_0x353dd7[_0x669d('0x17')][_0x669d('0x19')]||null:null,'attributes':_0x353dd7['options']?_0x353dd7[_0x669d('0x17')][_0x669d('0x1a')]||null:null,'include':_0x353dd7[_0x669d('0x17')]?_0x353dd7[_0x669d('0x17')][_0x669d('0x1c')]?_[_0x669d('0x1d')](_0x353dd7[_0x669d('0x17')]['include'],function(_0x1aece8){return{'model':db[_0x1aece8[_0x669d('0x1e')]],'as':_0x1aece8['as'],'attributes':_0x1aece8[_0x669d('0x1a')],'include':_0x1aece8[_0x669d('0x1c')]?_[_0x669d('0x1d')](_0x1aece8[_0x669d('0x1c')],function(_0xa78655){return{'model':db[_0xa78655[_0x669d('0x1e')]],'as':_0xa78655['as'],'attributes':_0xa78655[_0x669d('0x1a')],'include':_0xa78655[_0x669d('0x1c')]?_[_0x669d('0x1d')](_0xa78655['include'],function(_0x354e5e){return{'model':db[_0x354e5e[_0x669d('0x1e')]],'as':_0x354e5e['as'],'attributes':_0x354e5e['attributes']};}):[]};}):[]};}):[]:[]})[_0x669d('0x22')](function(_0x24d402){logger[_0x669d('0xc')](_0x669d('0x20'),_0x353dd7);logger['debug'](_0x669d('0x20'),_0x353dd7,JSON[_0x669d('0x10')](_0x24d402));_0x3e2c39(_0x24d402);})[_0x669d('0x15')](function(_0x12c0cb){logger[_0x669d('0x11')](_0x669d('0x20'),_0x12c0cb[_0x669d('0x13')],_0x353dd7);_0x4d65ef(_0x2a76ff['error'](0x1f4,_0x12c0cb['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 6f94209..4d621cb 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 _0xb3a6=['/:id/api_key','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeSquareProjects','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','describe','isAuthenticated','whoami','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','/:id/avatar','single','file','/:id/login','login','/:id/logout','logout','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb3a6,0x1eb));var _0x6b3a=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0xb3a6[_0x3a7634];return _0x23bbe9;};'use strict';var multer=require(_0x6b3a('0x0'));var util=require(_0x6b3a('0x1'));var path=require(_0x6b3a('0x2'));var timeout=require(_0x6b3a('0x3'));var express=require('express');var router=express[_0x6b3a('0x4')]();var fs_extra=require(_0x6b3a('0x5'));var auth=require(_0x6b3a('0x6'));var interaction=require(_0x6b3a('0x7'));var config=require(_0x6b3a('0x8'));var controller=require(_0x6b3a('0x9'));router[_0x6b3a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6b3a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6b3a('0xb')]);router[_0x6b3a('0xa')]('/whoami',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0xd')]);router[_0x6b3a('0xa')]('/presence',auth[_0x6b3a('0xc')](),controller['getPresence']);router[_0x6b3a('0xa')](_0x6b3a('0xe'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0xf')]);router[_0x6b3a('0xa')]('/:id/avatar',controller[_0x6b3a('0x10')]);router[_0x6b3a('0xa')](_0x6b3a('0x11'),auth[_0x6b3a('0xc')](),controller['getOpenTabs']);router[_0x6b3a('0xa')](_0x6b3a('0x12'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x13')]);router[_0x6b3a('0xa')](_0x6b3a('0x14'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x15')]);router[_0x6b3a('0xa')](_0x6b3a('0x16'),auth[_0x6b3a('0xc')](),controller['getVoiceQueuesRt']);router['get'](_0x6b3a('0x17'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x18')]);router[_0x6b3a('0xa')]('/:id/recordings',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x19')]);router[_0x6b3a('0xa')](_0x6b3a('0x1a'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x1b')]);router[_0x6b3a('0xa')](_0x6b3a('0x1c'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x1d')]);router[_0x6b3a('0xa')](_0x6b3a('0x1e'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x1f')]);router[_0x6b3a('0xa')]('/:id/sms/interactions',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x20')]);router[_0x6b3a('0xa')](_0x6b3a('0x21'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x22')]);router[_0x6b3a('0xa')](_0x6b3a('0x23'),auth[_0x6b3a('0xc')](),controller['getWhatsappInteractions']);router['get'](_0x6b3a('0x24'),auth['isAuthenticated'](),controller[_0x6b3a('0x25')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x6b3a('0x26')]);router[_0x6b3a('0xa')](_0x6b3a('0x27'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x28')]);router[_0x6b3a('0xa')]('/:id/prefixes',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x29')]);router[_0x6b3a('0xa')](_0x6b3a('0x2a'),auth[_0x6b3a('0xc')](),controller['getFaxAccounts']);router[_0x6b3a('0xa')](_0x6b3a('0x2b'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x2c')]);router[_0x6b3a('0xa')](_0x6b3a('0x2d'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x2e')]);router[_0x6b3a('0xa')]('/:id/sms_accounts',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x2f')]);router[_0x6b3a('0xa')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x6b3a('0x30')]);router['get'](_0x6b3a('0x31'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x32')]);router[_0x6b3a('0xa')](_0x6b3a('0x33'),auth['isAuthenticated'](),controller[_0x6b3a('0x34')]);router[_0x6b3a('0xa')](_0x6b3a('0x35'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x36')]);router['get']('/:id/api_key',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x37')]);router[_0x6b3a('0x38')](_0x6b3a('0x12'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x39')]);router['post']('/',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x3a')]);router[_0x6b3a('0x38')]('/create_many',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x3b')]);router[_0x6b3a('0x38')](_0x6b3a('0x14'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x3c')]);var upload=multer({'storage':multer[_0x6b3a('0x3d')]({'destination':function(_0x5caf59,_0xa1a656,_0x535092){_0x535092(null,path[_0x6b3a('0x3e')](config[_0x6b3a('0x3f')],_0x6b3a('0x40')));},'filename':function(_0x449a59,_0x3cdf6c,_0x2ad258){_0x2ad258(null,util[_0x6b3a('0x41')]('%s-%s',Date[_0x6b3a('0x42')](),_0x3cdf6c[_0x6b3a('0x43')]));}})});router['post'](_0x6b3a('0x44'),upload[_0x6b3a('0x45')](_0x6b3a('0x46')),controller['addAvatar']);router[_0x6b3a('0x38')](_0x6b3a('0x47'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x48')]);router[_0x6b3a('0x38')](_0x6b3a('0x49'),auth['isAuthenticated'](),controller[_0x6b3a('0x4a')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller['pause']);router[_0x6b3a('0x38')](_0x6b3a('0x4b'),auth[_0x6b3a('0xc')](),controller['unpause']);router[_0x6b3a('0x38')](_0x6b3a('0x24'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x4c')]);router['post'](_0x6b3a('0x4d'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x4e')]);router[_0x6b3a('0x38')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x6b3a('0x38')]('/:id/fax_interactions',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x4f')]);router[_0x6b3a('0x38')](_0x6b3a('0x50'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x51')]);router['post'](_0x6b3a('0x52'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x53')]);router[_0x6b3a('0x38')](_0x6b3a('0x54'),auth['isAuthenticated'](),controller[_0x6b3a('0x55')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x6b3a('0x56')]);router[_0x6b3a('0x38')]('/:id/mail_accounts',auth[_0x6b3a('0xc')](),controller['addMailAccounts']);router[_0x6b3a('0x38')](_0x6b3a('0x2d'),auth['isAuthenticated'](),controller[_0x6b3a('0x57')]);router[_0x6b3a('0x38')](_0x6b3a('0x58'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x59')]);router[_0x6b3a('0x38')](_0x6b3a('0x5a'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x5b')]);router['post']('/:id/whatsapp_accounts',auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x5c')]);router[_0x6b3a('0x38')](_0x6b3a('0x33'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x5d')]);router[_0x6b3a('0x38')](_0x6b3a('0x5e'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x5f')]);router['put'](_0x6b3a('0xe'),auth['isAuthenticated'](),controller[_0x6b3a('0x60')]);router[_0x6b3a('0x61')](_0x6b3a('0x62'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x63')]);router[_0x6b3a('0x64')](_0x6b3a('0x14'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x65')]);router[_0x6b3a('0x64')](_0x6b3a('0x24'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x66')]);router[_0x6b3a('0x64')](_0x6b3a('0xe'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x67')]);router[_0x6b3a('0x64')](_0x6b3a('0x4d'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x6b3a('0x64')](_0x6b3a('0x68'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x69')]);router[_0x6b3a('0x64')](_0x6b3a('0x6a'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x6b')]);router[_0x6b3a('0x64')](_0x6b3a('0x50'),auth['isAuthenticated'](),controller[_0x6b3a('0x6c')]);router[_0x6b3a('0x64')](_0x6b3a('0x52'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x6d')]);router['delete'](_0x6b3a('0x54'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x6e')]);router['delete'](_0x6b3a('0x2a'),auth['isAuthenticated'](),controller[_0x6b3a('0x6f')]);router[_0x6b3a('0x64')](_0x6b3a('0x2b'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x70')]);router[_0x6b3a('0x64')](_0x6b3a('0x2d'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x71')]);router[_0x6b3a('0x64')](_0x6b3a('0x58'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x72')]);router['delete']('/:id/chat_websites',auth[_0x6b3a('0xc')](),controller['removeChatWebsites']);router['delete'](_0x6b3a('0x31'),auth[_0x6b3a('0xc')](),controller['removeWhatsappAccounts']);router[_0x6b3a('0x64')](_0x6b3a('0x33'),auth[_0x6b3a('0xc')](),controller[_0x6b3a('0x73')]);router[_0x6b3a('0x64')](_0x6b3a('0x5e'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0x6b3a('0x74')]=router; \ No newline at end of file +var _0xd1de=['/:id/agents','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getApiKey','/:id/contacts','addContacts','create','post','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','login','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','changePassword','removeQueues','removeTeams','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/whoami','/presence','/:id','show','/:id/avatar','/:id/open_tabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists'];(function(_0x3fd2dd,_0x33a20f){var _0x5a279b=function(_0x3828d8){while(--_0x3828d8){_0x3fd2dd['push'](_0x3fd2dd['shift']());}};_0x5a279b(++_0x33a20f);}(_0xd1de,0xbe));var _0xed1d=function(_0x4cd684,_0x137855){_0x4cd684=_0x4cd684-0x0;var _0x261286=_0xd1de[_0x4cd684];return _0x261286;};'use strict';var multer=require('multer');var util=require(_0xed1d('0x0'));var path=require(_0xed1d('0x1'));var timeout=require(_0xed1d('0x2'));var express=require(_0xed1d('0x3'));var router=express[_0xed1d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed1d('0x5'));var interaction=require(_0xed1d('0x6'));var config=require(_0xed1d('0x7'));var controller=require('./user.controller');router[_0xed1d('0x8')]('/',auth[_0xed1d('0x9')](),controller[_0xed1d('0xa')]);router['get']('/describe',auth[_0xed1d('0x9')](),controller[_0xed1d('0xb')]);router[_0xed1d('0x8')](_0xed1d('0xc'),auth[_0xed1d('0x9')](),controller['whoami']);router[_0xed1d('0x8')](_0xed1d('0xd'),auth[_0xed1d('0x9')](),controller['getPresence']);router[_0xed1d('0x8')](_0xed1d('0xe'),auth[_0xed1d('0x9')](),controller[_0xed1d('0xf')]);router[_0xed1d('0x8')](_0xed1d('0x10'),controller['getAvatar']);router[_0xed1d('0x8')](_0xed1d('0x11'),auth[_0xed1d('0x9')](),controller['getOpenTabs']);router[_0xed1d('0x8')]('/:id/contacts',auth[_0xed1d('0x9')](),controller[_0xed1d('0x12')]);router[_0xed1d('0x8')]('/:id/queues',auth[_0xed1d('0x9')](),controller['getQueues']);router[_0xed1d('0x8')](_0xed1d('0x13'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x14')]);router[_0xed1d('0x8')](_0xed1d('0x15'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x16')]);router[_0xed1d('0x8')]('/:id/recordings',auth[_0xed1d('0x9')](),controller[_0xed1d('0x17')]);router[_0xed1d('0x8')](_0xed1d('0x18'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x19')]);router['get'](_0xed1d('0x1a'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x1b')]);router[_0xed1d('0x8')](_0xed1d('0x1c'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x1d')]);router[_0xed1d('0x8')]('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xed1d('0x8')](_0xed1d('0x1e'),auth['isAuthenticated'](),controller[_0xed1d('0x1f')]);router['get']('/:id/fax/interactions',auth[_0xed1d('0x9')](),controller[_0xed1d('0x20')]);router[_0xed1d('0x8')](_0xed1d('0x21'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x22')]);router['get'](_0xed1d('0x23'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x24')]);router[_0xed1d('0x8')](_0xed1d('0x25'),auth['isAuthenticated'](),controller['getLists']);router[_0xed1d('0x8')](_0xed1d('0x26'),auth[_0xed1d('0x9')](),controller['getAgents']);router[_0xed1d('0x8')]('/:id/prefixes',auth[_0xed1d('0x9')](),controller['getVoicePrefixes']);router[_0xed1d('0x8')]('/:id/fax_accounts',auth[_0xed1d('0x9')](),controller[_0xed1d('0x27')]);router[_0xed1d('0x8')](_0xed1d('0x28'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x29')]);router['get'](_0xed1d('0x2a'),auth[_0xed1d('0x9')](),controller['getOpenchannelAccounts']);router[_0xed1d('0x8')](_0xed1d('0x2b'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x2c')]);router[_0xed1d('0x8')](_0xed1d('0x2d'),auth[_0xed1d('0x9')](),controller['getChatWebsites']);router['get'](_0xed1d('0x2e'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x2f')]);router[_0xed1d('0x8')](_0xed1d('0x30'),auth[_0xed1d('0x9')](),controller['getSquareProjects']);router['get'](_0xed1d('0x31'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0xed1d('0x9')](),controller[_0xed1d('0x32')]);router['post'](_0xed1d('0x33'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x34')]);router['post']('/',auth[_0xed1d('0x9')](),controller[_0xed1d('0x35')]);router[_0xed1d('0x36')](_0xed1d('0x37'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x38')]);router[_0xed1d('0x36')](_0xed1d('0x39'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x3a')]);var upload=multer({'storage':multer[_0xed1d('0x3b')]({'destination':function(_0x460a71,_0x1a25fe,_0x421e9d){_0x421e9d(null,path[_0xed1d('0x3c')](config[_0xed1d('0x3d')],_0xed1d('0x3e')));},'filename':function(_0x39df2b,_0x37b3c5,_0x357b63){_0x357b63(null,util[_0xed1d('0x3f')](_0xed1d('0x40'),Date[_0xed1d('0x41')](),_0x37b3c5['originalname']));}})});router[_0xed1d('0x36')](_0xed1d('0x10'),upload[_0xed1d('0x42')](_0xed1d('0x43')),controller['addAvatar']);router[_0xed1d('0x36')]('/:id/login',auth[_0xed1d('0x9')](),controller[_0xed1d('0x44')]);router[_0xed1d('0x36')]('/:id/logout',auth[_0xed1d('0x9')](),controller[_0xed1d('0x45')]);router[_0xed1d('0x36')](_0xed1d('0x46'),auth['isAuthenticated'](),controller[_0xed1d('0x47')]);router['post'](_0xed1d('0x48'),auth['isAuthenticated'](),controller['unpause']);router[_0xed1d('0x36')](_0xed1d('0x23'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x49')]);router[_0xed1d('0x36')](_0xed1d('0x4a'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x4b')]);router['post']('/:id/mail_interactions',auth[_0xed1d('0x9')](),controller['addMailInteractions']);router[_0xed1d('0x36')](_0xed1d('0x4c'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x4d')]);router['post'](_0xed1d('0x4e'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x4f')]);router[_0xed1d('0x36')](_0xed1d('0x50'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x51')]);router[_0xed1d('0x36')](_0xed1d('0x52'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x53')]);router[_0xed1d('0x36')](_0xed1d('0x54'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x55')]);router[_0xed1d('0x36')](_0xed1d('0x28'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x56')]);router[_0xed1d('0x36')](_0xed1d('0x2a'),auth['isAuthenticated'](),controller[_0xed1d('0x57')]);router[_0xed1d('0x36')](_0xed1d('0x2b'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x58')]);router[_0xed1d('0x36')](_0xed1d('0x2d'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x59')]);router[_0xed1d('0x36')](_0xed1d('0x2e'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x5a')]);router[_0xed1d('0x36')](_0xed1d('0x30'),auth['isAuthenticated'](),controller[_0xed1d('0x5b')]);router[_0xed1d('0x36')](_0xed1d('0x5c'),auth['isAuthenticated'](),controller[_0xed1d('0x5d')]);router['put'](_0xed1d('0xe'),auth[_0xed1d('0x9')](),controller['update']);router[_0xed1d('0x5e')](_0xed1d('0x5f'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x60')]);router['delete'](_0xed1d('0x39'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x61')]);router['delete'](_0xed1d('0x23'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x62')]);router[_0xed1d('0x63')](_0xed1d('0xe'),auth['isAuthenticated'](),controller[_0xed1d('0x64')]);router[_0xed1d('0x63')](_0xed1d('0x4a'),auth['isAuthenticated'](),controller[_0xed1d('0x65')]);router[_0xed1d('0x63')](_0xed1d('0x66'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x67')]);router[_0xed1d('0x63')](_0xed1d('0x4c'),auth[_0xed1d('0x9')](),controller['removeFaxInteractions']);router[_0xed1d('0x63')]('/:id/sms_interactions',auth[_0xed1d('0x9')](),controller[_0xed1d('0x68')]);router[_0xed1d('0x63')](_0xed1d('0x50'),auth[_0xed1d('0x9')](),controller[_0xed1d('0x69')]);router['delete']('/:id/whatsapp_interactions',auth[_0xed1d('0x9')](),controller[_0xed1d('0x6a')]);router[_0xed1d('0x63')]('/:id/fax_accounts',auth[_0xed1d('0x9')](),controller[_0xed1d('0x6b')]);router[_0xed1d('0x63')](_0xed1d('0x28'),auth['isAuthenticated'](),controller[_0xed1d('0x6c')]);router[_0xed1d('0x63')](_0xed1d('0x2a'),auth['isAuthenticated'](),controller[_0xed1d('0x6d')]);router['delete'](_0xed1d('0x2b'),auth[_0xed1d('0x9')](),controller['removeSmsAccounts']);router[_0xed1d('0x63')]('/:id/chat_websites',auth[_0xed1d('0x9')](),controller[_0xed1d('0x6e')]);router[_0xed1d('0x63')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xed1d('0x63')](_0xed1d('0x30'),auth['isAuthenticated'](),controller[_0xed1d('0x6f')]);router[_0xed1d('0x63')](_0xed1d('0x5c'),auth['isAuthenticated'](),controller[_0xed1d('0x70')]);module[_0xed1d('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a57e7b6..d8d442a 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 _0xc30d=['/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','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]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','dtlssetup','/etc/pki/tls/certs/motion.crt'];(function(_0x1cbf6c,_0x40f14e){var _0x565aa2=function(_0x404cbc){while(--_0x404cbc){_0x1cbf6c['push'](_0x1cbf6c['shift']());}};_0x565aa2(++_0x40f14e);}(_0xc30d,0x6e));var _0xdc30=function(_0x5c365f,_0x3b40ed){_0x5c365f=_0x5c365f-0x0;var _0x295e1b=_0xc30d[_0x5c365f];return _0x295e1b;};'use strict';var Sequelize=require(_0xdc30('0x0'));var moment=require('moment');var util=require(_0xdc30('0x1'));var _=require(_0xdc30('0x2'));module[_0xdc30('0x3')]={'name':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'unique':_0xdc30('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x50c802){this[_0xdc30('0x6')]('name',_0x50c802);this[_0xdc30('0x6')](_0xdc30('0x7'),_0x50c802);},'comment':_0xdc30('0x8')},'fullname':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'set':function(_0x4011da){this[_0xdc30('0x6')]('fullname',_0x4011da);this[_0xdc30('0x6')](_0xdc30('0x9'),util[_0xdc30('0xa')](_0xdc30('0xb'),_0x4011da,this[_0xdc30('0xc')](_0xdc30('0xd'))));}},'alias':{'type':Sequelize[_0xdc30('0x4')]},'email':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'unique':_0xdc30('0xe'),'validate':{'isEmail':!![]},'set':function(_0x593143){if(_0x593143){this['setDataValue']('email',_0x593143[_0xdc30('0xf')]());}}},'role':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x11'),_0xdc30('0x12'),_0xdc30('0x13'),_0xdc30('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xdc30('0x15')},'internal':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':![],'unique':_0xdc30('0xd'),'set':function(_0x502425){this['setDataValue'](_0xdc30('0xd'),_0x502425);this[_0xdc30('0x6')](_0xdc30('0x17'),_0x502425);this['setDataValue'](_0xdc30('0x9'),util[_0xdc30('0xa')](_0xdc30('0xb'),this[_0xdc30('0xc')](_0xdc30('0x18')),_0x502425));}},'salt':{'type':Sequelize[_0xdc30('0x4')]},'phone':{'type':Sequelize[_0xdc30('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xdc30('0x4')]},'zipcode':{'type':Sequelize[_0xdc30('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdc30('0x4')]},'online':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdc30('0x1a')]},'voicePause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xdc30('0x4')],'defaultValue':_0xdc30('0x1b')},'lastPauseAt':{'type':Sequelize[_0xdc30('0x1a')]},'chatCapacity':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdc30('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdc30('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xdc30('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x1c'),_0xdc30('0x12'),_0xdc30('0x1d')),'allowNull':!![],'defaultValue':_0xdc30('0x1c')},'context':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x1e'),_0xdc30('0x1f'),_0xdc30('0x20'),_0xdc30('0x21'),'PROHIB_NOT_SCREENED',_0xdc30('0x22'),_0xdc30('0x23'),_0xdc30('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'defaultValue':_0xdc30('0x25'),'set':function(_0x24233b){this[_0xdc30('0x6')](_0xdc30('0x26'),_0x24233b?_0x24233b[_0xdc30('0x27')](','):null);},'get':function(){return this[_0xdc30('0xc')]('transport')?this[_0xdc30('0xc')](_0xdc30('0x26'))[_0xdc30('0x28')](','):null;},'comment':_0xdc30('0x29')},'dtmfmode':{'type':Sequelize[_0xdc30('0x10')]('rfc2833',_0xdc30('0x2a'),_0xdc30('0x2b'),_0xdc30('0x2c'),_0xdc30('0x2d')),'allowNull':!![],'defaultValue':_0xdc30('0x2e')},'directmedia':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no',_0xdc30('0x30'),_0xdc30('0x31'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'defaultValue':_0xdc30('0x32'),'set':function(_0x3d11e5){this[_0xdc30('0x6')](_0xdc30('0x33'),_0x3d11e5?_0x3d11e5[_0xdc30('0x27')](','):null);},'get':function(){return this[_0xdc30('0xc')](_0xdc30('0x33'))?this[_0xdc30('0xc')](_0xdc30('0x33'))[_0xdc30('0x28')](','):null;},'comment':_0xdc30('0x34')},'callgroup':{'type':Sequelize[_0xdc30('0x4')]},'namedcallgroup':{'type':Sequelize[_0xdc30('0x4')]},'pickupgroup':{'type':Sequelize[_0xdc30('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xdc30('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdc30('0x4')]},'disallow':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'defaultValue':_0xdc30('0x35')},'allow':{'type':Sequelize[_0xdc30('0x4')],'allowNull':![],'defaultValue':_0xdc30('0x36'),'set':function(_0x1d42af){this['setDataValue'](_0xdc30('0x37'),_0x1d42af?_0x1d42af['join'](';'):_0xdc30('0x36'));},'get':function(){return this[_0xdc30('0xc')]('allow')?this[_0xdc30('0xc')](_0xdc30('0x37'))[_0xdc30('0x28')](';'):null;},'comment':_0xdc30('0x38')},'autoframing':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'set':function(_0x432ade){this[_0xdc30('0x6')](_0xdc30('0x39'),_0x432ade?_0x432ade[_0xdc30('0x27')](','):null);},'get':function(){return this['getDataValue'](_0xdc30('0x39'))?this['getDataValue'](_0xdc30('0x39'))['split'](','):null;},'comment':_0xdc30('0x3a')},'trustrpid':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdc30('0x10')]('yes','no',_0xdc30('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdc30('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![],'defaultValue':_0xdc30('0x3c')},'amaflags':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':_0xdc30('0x2f')},'busylevel':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdc30('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xdc30('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no',_0xdc30('0x3d')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdc30('0x10')]('accept',_0xdc30('0x3e'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x3f'),_0xdc30('0x40')),'allowNull':!![],'defaultValue':_0xdc30('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':_0xdc30('0x2f')},'keepalive':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdc30('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xdc30('0x2f'),'no',_0xdc30('0x41'),_0xdc30('0x42')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x43'),_0xdc30('0x44'),_0xdc30('0x45')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdc30('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdc30('0x10')](_0xdc30('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xdc30('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdc30('0x10')]('yes','no',_0xdc30('0x30'),_0xdc30('0x31'),_0xdc30('0x46')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xdc30('0x1a')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdc30('0x47')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3bd4dd){this['setDataValue']('showWebBar',_0x3bd4dd);var _0x29e325=this[_0xdc30('0x48')]({'plain':!![]});switch(_0x3bd4dd){case 0x0:case 0x1:var _0x48fa4d=_0x29e325[_0xdc30('0x26')]?_['isArray'](_0x29e325['transport'])?_0x29e325['transport'][_0xdc30('0x27')]():_0x29e325[_0xdc30('0x26')]:_0xdc30('0x25');if(_0x48fa4d==='wss'){_0x48fa4d='udp';}this['setDataValue']('transport',_0x48fa4d);this[_0xdc30('0x6')](_0xdc30('0x49'),'no');this[_0xdc30('0x6')](_0xdc30('0x4a'),null);this[_0xdc30('0x6')](_0xdc30('0x4b'),null);this[_0xdc30('0x6')]('icesupport',null);this[_0xdc30('0x6')](_0xdc30('0x4c'),null);this[_0xdc30('0x6')](_0xdc30('0x4d'),null);this[_0xdc30('0x6')]('dtlssetup',null);this[_0xdc30('0x6')](_0xdc30('0x4e'),null);this[_0xdc30('0x6')](_0xdc30('0x4f'),null);this[_0xdc30('0x6')](_0xdc30('0x50'),'no');break;case 0x2:this['setDataValue'](_0xdc30('0x26'),'wss');this[_0xdc30('0x6')](_0xdc30('0x49'),_0xdc30('0x2f'));this[_0xdc30('0x6')]('avpf',_0xdc30('0x2f'));this['setDataValue'](_0xdc30('0x4b'),_0xdc30('0x2f'));this[_0xdc30('0x6')](_0xdc30('0x51'),_0xdc30('0x2f'));this[_0xdc30('0x6')](_0xdc30('0x4c'),_0xdc30('0x2f'));this[_0xdc30('0x6')](_0xdc30('0x4d'),'no');this['setDataValue'](_0xdc30('0x52'),_0xdc30('0x45'));this[_0xdc30('0x6')]('dtlscertfile',_0x29e325[_0xdc30('0x4e')]||_0xdc30('0x53'));this[_0xdc30('0x6')](_0xdc30('0x4f'),_0x29e325[_0xdc30('0x4f')]||_0xdc30('0x54'));this['setDataValue'](_0xdc30('0x50'),_0xdc30('0x2f'));break;default:}}},'permissions':{'type':Sequelize[_0xdc30('0x47')],'set':function(_0x3cdf6a){this[_0xdc30('0x6')](_0xdc30('0x55'),_0x3cdf6a?_0x3cdf6a['join'](','):[]);},'get':function(){return this[_0xdc30('0xc')](_0xdc30('0x55'))?_[_0xdc30('0x56')](this[_0xdc30('0xc')]('permissions')[_0xdc30('0x28')](','),function(_0x54db1c){return parseInt(_0x54db1c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdc30('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdc30('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdc30('0x10')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xdc30('0x57')],'get':function(){return this[_0xdc30('0xc')](_0xdc30('0x58'))?this[_0xdc30('0xc')](_0xdc30('0x58')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'interface':{'type':Sequelize[_0xdc30('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdc30('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![],'set':function(_0x473a95){if(typeof _0x473a95===_0xdc30('0x59')){var _0x27c1fd=_0x473a95==='1'?!![]:_0x473a95==='0'?![]:_0x473a95===_0xdc30('0x5a')?!![]:_0x473a95===_0xdc30('0x5b')?![]:![];this[_0xdc30('0x6')](_0xdc30('0x5c'),_0x27c1fd);}else{this[_0xdc30('0x6')]('screenrecording',_0x473a95);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x18d1ff){this['setDataValue'](_0xdc30('0x5d'),_0x18d1ff);if(_0x18d1ff===!![]){this[_0xdc30('0x6')](_0xdc30('0x5e'),moment());this[_0xdc30('0x6')](_0xdc30('0x5f'),0x0);}else{this[_0xdc30('0x6')](_0xdc30('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0xdc30('0x1a')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdc30('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xdc30('0x16')](0x5)[_0xdc30('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xdc30('0x19')],'defaultValue':![]}}; \ No newline at end of file +var _0xd737=['join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','isArray','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','avpf','force_avp','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','exports','STRING','name','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','internal','email','toLowerCase','admin','user','telephone','local','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','ENUM','peer','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure'];(function(_0x47e84a,_0x2ca88a){var _0x827058=function(_0x4c7d0a){while(--_0x4c7d0a){_0x47e84a['push'](_0x47e84a['shift']());}};_0x827058(++_0x2ca88a);}(_0xd737,0x85));var _0x7d73=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xd737[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x7d73('0x0'));var moment=require('moment');var util=require(_0x7d73('0x1'));var _=require('lodash');module[_0x7d73('0x2')]={'name':{'type':Sequelize[_0x7d73('0x3')],'allowNull':![],'unique':_0x7d73('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5cfa01){this['setDataValue'](_0x7d73('0x4'),_0x5cfa01);this['setDataValue']('defaultuser',_0x5cfa01);},'comment':_0x7d73('0x5')},'fullname':{'type':Sequelize[_0x7d73('0x3')],'allowNull':![],'set':function(_0x70a9f1){this[_0x7d73('0x6')](_0x7d73('0x7'),_0x70a9f1);this[_0x7d73('0x6')](_0x7d73('0x8'),util[_0x7d73('0x9')]('\x22%s\x22\x20<%s>',_0x70a9f1,this['getDataValue'](_0x7d73('0xa'))));}},'alias':{'type':Sequelize[_0x7d73('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d73('0xb'),'validate':{'isEmail':!![]},'set':function(_0x589ee7){if(_0x589ee7){this[_0x7d73('0x6')](_0x7d73('0xb'),_0x589ee7[_0x7d73('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0x7d73('0xd'),_0x7d73('0xe'),'agent',_0x7d73('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x7d73('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7d73('0x3')],'defaultValue':_0x7d73('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x7d73('0xa'),'set':function(_0x499223){this['setDataValue'](_0x7d73('0xa'),_0x499223);this[_0x7d73('0x6')](_0x7d73('0x11'),_0x499223);this['setDataValue'](_0x7d73('0x8'),util[_0x7d73('0x9')](_0x7d73('0x12'),this[_0x7d73('0x13')](_0x7d73('0x7')),_0x499223));}},'salt':{'type':Sequelize[_0x7d73('0x3')]},'phone':{'type':Sequelize[_0x7d73('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x7d73('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7d73('0x3')]},'country':{'type':Sequelize[_0x7d73('0x3')]},'online':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x7d73('0x15')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x7d73('0x3')],'defaultValue':_0x7d73('0x16')},'lastPauseAt':{'type':Sequelize[_0x7d73('0x15')]},'chatCapacity':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x7d73('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x7d73('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7d73('0x18')]('friend','user',_0x7d73('0x19')),'allowNull':!![],'defaultValue':_0x7d73('0x1a')},'context':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![],'defaultValue':_0x7d73('0x1b')},'callingpres':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x1c'),_0x7d73('0x1d'),_0x7d73('0x1e'),_0x7d73('0x1f'),_0x7d73('0x20'),_0x7d73('0x21'),_0x7d73('0x22'),_0x7d73('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![],'defaultValue':_0x7d73('0x24'),'set':function(_0x21a8ce){this[_0x7d73('0x6')](_0x7d73('0x25'),_0x21a8ce?_0x21a8ce['join'](','):null);},'get':function(){return this[_0x7d73('0x13')](_0x7d73('0x25'))?this[_0x7d73('0x13')](_0x7d73('0x25'))['split'](','):null;},'comment':_0x7d73('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x7d73('0x27'),_0x7d73('0x28'),_0x7d73('0x29'),_0x7d73('0x2a'),_0x7d73('0x2b')),'allowNull':!![],'defaultValue':_0x7d73('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0x7d73('0x2c'),'no',_0x7d73('0x2d'),_0x7d73('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![],'defaultValue':_0x7d73('0x2f'),'set':function(_0x3b5a85){this[_0x7d73('0x6')]('nat',_0x3b5a85?_0x3b5a85['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x7d73('0x13')](_0x7d73('0x30'))[_0x7d73('0x31')](','):null;},'comment':_0x7d73('0x32')},'callgroup':{'type':Sequelize[_0x7d73('0x3')]},'namedcallgroup':{'type':Sequelize[_0x7d73('0x3')]},'pickupgroup':{'type':Sequelize[_0x7d73('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x7d73('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7d73('0x3')]},'disallow':{'type':Sequelize[_0x7d73('0x3')],'allowNull':![],'defaultValue':_0x7d73('0x33')},'allow':{'type':Sequelize[_0x7d73('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3fbc1d){this['setDataValue']('allow',_0x3fbc1d?_0x3fbc1d['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x7d73('0x34'))[_0x7d73('0x31')](';'):null;},'comment':_0x7d73('0x35')},'autoframing':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![],'set':function(_0x4445fe){this['setDataValue'](_0x7d73('0x36'),_0x4445fe?_0x4445fe[_0x7d73('0x37')](','):null);},'get':function(){return this[_0x7d73('0x13')](_0x7d73('0x36'))?this[_0x7d73('0x13')]('insecure')[_0x7d73('0x31')](','):null;},'comment':_0x7d73('0x38')},'trustrpid':{'type':Sequelize['ENUM'](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7d73('0x18')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![],'defaultValue':_0x7d73('0x39')},'amaflags':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x7d73('0x2c')},'busylevel':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x7d73('0x18')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7d73('0x18')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7d73('0x18')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7d73('0x18')]('yes','no',_0x7d73('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x7d73('0x3b'),_0x7d73('0x3c'),_0x7d73('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x7d73('0x3e'),_0x7d73('0x3f')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x7d73('0x18')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no','fingerprint',_0x7d73('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x7d73('0x41'),_0x7d73('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7d73('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7d73('0x18')](_0x7d73('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x7d73('0x2c'),'no','nonat',_0x7d73('0x2e'),_0x7d73('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x7d73('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x7d73('0x15')]},'passwordResetAt':{'type':Sequelize[_0x7d73('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x7d73('0x44')]},'showWebBar':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0,'set':function(_0x4ed5bc){this[_0x7d73('0x6')](_0x7d73('0x45'),_0x4ed5bc);var _0x43b115=this['get']({'plain':!![]});switch(_0x4ed5bc){case 0x0:case 0x1:var _0xd89ad0=_0x43b115['transport']?_[_0x7d73('0x46')](_0x43b115[_0x7d73('0x25')])?_0x43b115[_0x7d73('0x25')]['join']():_0x43b115[_0x7d73('0x25')]:_0x7d73('0x24');if(_0xd89ad0==='wss'){_0xd89ad0=_0x7d73('0x24');}this['setDataValue']('transport',_0xd89ad0);this['setDataValue']('encryption','no');this[_0x7d73('0x6')]('avpf',null);this[_0x7d73('0x6')]('force_avp',null);this[_0x7d73('0x6')](_0x7d73('0x47'),null);this['setDataValue'](_0x7d73('0x48'),null);this[_0x7d73('0x6')](_0x7d73('0x49'),null);this['setDataValue'](_0x7d73('0x4a'),null);this[_0x7d73('0x6')](_0x7d73('0x4b'),null);this[_0x7d73('0x6')](_0x7d73('0x4c'),null);this[_0x7d73('0x6')](_0x7d73('0x4d'),'no');break;case 0x2:this['setDataValue'](_0x7d73('0x25'),_0x7d73('0x4e'));this[_0x7d73('0x6')](_0x7d73('0x4f'),_0x7d73('0x2c'));this['setDataValue'](_0x7d73('0x50'),'yes');this[_0x7d73('0x6')](_0x7d73('0x51'),_0x7d73('0x2c'));this[_0x7d73('0x6')](_0x7d73('0x47'),_0x7d73('0x2c'));this[_0x7d73('0x6')](_0x7d73('0x48'),_0x7d73('0x2c'));this['setDataValue']('dtlsverify','no');this['setDataValue']('dtlssetup',_0x7d73('0x42'));this[_0x7d73('0x6')](_0x7d73('0x4b'),_0x43b115['dtlscertfile']||_0x7d73('0x52'));this['setDataValue']('dtlsprivatekey',_0x43b115[_0x7d73('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0x7d73('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x7d73('0x44')],'set':function(_0x5a9e37){this[_0x7d73('0x6')](_0x7d73('0x53'),_0x5a9e37?_0x5a9e37['join'](','):[]);},'get':function(){return this[_0x7d73('0x13')](_0x7d73('0x53'))?_[_0x7d73('0x54')](this[_0x7d73('0x13')](_0x7d73('0x53'))['split'](','),function(_0x3e51cb){return parseInt(_0x3e51cb,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7d73('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7d73('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x7d73('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7d73('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7d73('0x55')],'get':function(){return this[_0x7d73('0x13')](_0x7d73('0x56'))?this['getDataValue'](_0x7d73('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x7d73('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7d73('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![],'set':function(_0x5be590){if(typeof _0x5be590===_0x7d73('0x57')){var _0x263524=_0x5be590==='1'?!![]:_0x5be590==='0'?![]:_0x5be590==='true'?!![]:_0x5be590===_0x7d73('0x58')?![]:![];this[_0x7d73('0x6')]('screenrecording',_0x263524);}else{this['setDataValue'](_0x7d73('0x59'),_0x5be590);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x372350){this[_0x7d73('0x6')](_0x7d73('0x5a'),_0x372350);if(_0x372350===!![]){this['setDataValue'](_0x7d73('0x5b'),moment());this[_0x7d73('0x6')](_0x7d73('0x5c'),0x0);}else{this['setDataValue'](_0x7d73('0x5b'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x7d73('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x7d73('0x17')](0x5)[_0x7d73('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7d73('0x14')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 8f46f09..bedaaa4 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 _0xe2fe=['Whatsapp','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','Chat','getMailQueues','Mail','flatten','removeAgent','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','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','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','firstName','lastName','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','queues','teams','desc','asc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','offline','idle','unknown','ringing','voiceStatus','busy','slice','toUpperCase','SELECT','ui.','field','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','register','localhost','request','then','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','Users','Agents','agent','telephone','map','value','includes','find','name','stack','send','index','User','rawAttributes','fieldName','type','key','password','includeAll','attributes','push','findAll','openTabs','true','length','chat','rows','dataValues','sms','mail','openchannel','whatsapp','model','keys','salt','query','intersection','fields','include','merge','fax','body','describe','params','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','102','110','104','106','108','109','100','111','114','115','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','UserProfileResource','bulkCreate','Unauthorized','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','all','each','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','remove','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','root','existsSync','join','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','FAX','createdAt','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','filters','sort','where','filter','options','List','Tag','Tags','color','tag','nolimit','getQueues','isValidChannel','order','Queue','hasOwnProperty','getVoiceQueuesRt','pick','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:%s','headers','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','concat','isMiddleware','resolve','QueuePause','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','getSmsQueues','Sms','getWhatsappQueues'];(function(_0x37a226,_0x1c02c6){var _0xf06da6=function(_0x1d4f35){while(--_0x1d4f35){_0x37a226['push'](_0x37a226['shift']());}};_0xf06da6(++_0x1c02c6);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xee2f('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xee2f('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xee2f('0x2'));var jayson=require(_0xee2f('0x3'));var Redis=require(_0xee2f('0x4'));var authService=require(_0xee2f('0x5'));var qs=require(_0xee2f('0x6'));var logger=require('../../config/logger')(_0xee2f('0x7'));var utils=require(_0xee2f('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0xee2f('0x9'));var db=require(_0xee2f('0xa'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0xb')]));require('./user.socket')[_0xee2f('0xc')](socket);config[_0xee2f('0xb')]=_['defaults'](config[_0xee2f('0xb')],{'host':_0xee2f('0xd'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4818df,_0x56bbea,_0x2b8fb1,_0x4cb4bf){return new BPromise(function(_0x481ea7,_0x53047d){var _0x25ddf7=_0x4cb4bf||client;return _0x25ddf7[_0xee2f('0xe')](_0x4818df,_0x2b8fb1)[_0xee2f('0xf')](function(_0x100449){logger[_0xee2f('0x10')](_0xee2f('0x11'),_0x56bbea,'request\x20sent');logger[_0xee2f('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x56bbea,_0xee2f('0x13'),JSON[_0xee2f('0x14')](_0x100449));if(_0x100449['error']){if(_0x100449[_0xee2f('0x15')][_0xee2f('0x16')]===0x1f4){logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x100449[_0xee2f('0x15')]['message']);return _0x53047d(_0x100449[_0xee2f('0x15')]['message']);}logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x100449['error']['message']);return _0x481ea7(_0x100449[_0xee2f('0x15')]['message']);}else{logger[_0xee2f('0x10')](_0xee2f('0x11'),_0x56bbea,_0xee2f('0x13'));_0x481ea7(_0x100449['result'][_0xee2f('0x17')]);}})[_0xee2f('0x18')](function(_0x4db2cc){logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x4db2cc);_0x53047d(_0x4db2cc);});});}function respondWithStatusCode(_0x5d36d4,_0x5e73ad){_0x5e73ad=_0x5e73ad||0xcc;return function(_0x40d1fd){if(_0x40d1fd){return _0x5d36d4[_0xee2f('0x19')](_0x5e73ad);}return _0x5d36d4[_0xee2f('0x1a')](_0x5e73ad)[_0xee2f('0x1b')]();};}function respondWithResult(_0x472e3b,_0xf278cc){_0xf278cc=_0xf278cc||0xc8;return function(_0x39a39c){if(_0x39a39c){return _0x472e3b['status'](_0xf278cc)[_0xee2f('0x1c')](_0x39a39c);}};}function respondWithFilteredResult(_0x2c47c5,_0x15ceda){return function(_0x70e308){if(_0x70e308){var _0x820101=typeof _0x15ceda[_0xee2f('0x1d')]===_0xee2f('0x1e')&&typeof _0x15ceda[_0xee2f('0x1f')]===_0xee2f('0x1e');var _0x1e394f=_0x70e308[_0xee2f('0x20')];var _0x168adc=_0x820101?0x0:_0x15ceda[_0xee2f('0x1d')];var _0x45c4a0=_0x820101?_0x70e308['count']:_0x15ceda['offset']+_0x15ceda['limit'];var _0x18bdbb;if(_0x45c4a0>=_0x1e394f){_0x45c4a0=_0x1e394f;_0x18bdbb=0xc8;}else{_0x18bdbb=0xce;}_0x2c47c5[_0xee2f('0x1a')](_0x18bdbb);return _0x2c47c5[_0xee2f('0x21')](_0xee2f('0x22'),_0x168adc+'-'+_0x45c4a0+'/'+_0x1e394f)[_0xee2f('0x1c')](_0x70e308);}return null;};}function saveUpdates(_0x3737fd){return function(_0x4d8398){if(_0x4d8398){return _0x4d8398[_0xee2f('0x23')](_0x3737fd)['then'](function(_0x235697){return _0x235697;});}return null;};}function removeEntity(_0x180429){return function(_0x25ee9c){if(_0x25ee9c){return _0x25ee9c[_0xee2f('0x24')]()[_0xee2f('0xf')](function(){var _0x47d5a6=_0x25ee9c[_0xee2f('0x25')]({'plain':!![]});if(_0x47d5a6[_0xee2f('0x26')]==='admin')return;var _0x4ee0e1=[{'name':_0xee2f('0x27'),'value':'user','ignore':!![]},{'name':_0xee2f('0x28'),'value':_0xee2f('0x29'),'ignore':![]},{'name':'Telephones','value':_0xee2f('0x2a'),'ignore':![]}];var _0x5ca9f6=_(_0x4ee0e1)['filter']('ignore')[_0xee2f('0x2b')](_0xee2f('0x2c'))['value']();if(_[_0xee2f('0x2d')](_0x5ca9f6,_0x47d5a6[_0xee2f('0x26')])){return;}var _0xd64b7=_[_0xee2f('0x2e')](_0x4ee0e1,[_0xee2f('0x2c'),_0x47d5a6['role']])[_0xee2f('0x2f')];return db['UserProfileResource'][_0xee2f('0x24')]({'where':{'type':_0xd64b7,'resourceId':_0x47d5a6['id']}})[_0xee2f('0xf')](function(){return _0x25ee9c;});})[_0xee2f('0xf')](function(){_0x180429['status'](0xcc)[_0xee2f('0x1b')]();});}};}function handleEntityNotFound(_0x5ed71e){return function(_0xd3aaa9){if(!_0xd3aaa9){_0x5ed71e['sendStatus'](0x194);}return _0xd3aaa9;};}function handleError(_0x3e6dcc,_0x13a824){_0x13a824=_0x13a824||0x1f4;return function(_0x13149e){logger[_0xee2f('0x15')](_0x13149e[_0xee2f('0x30')]);if(_0x13149e[_0xee2f('0x2f')]){delete _0x13149e[_0xee2f('0x2f')];}_0x3e6dcc[_0xee2f('0x1a')](_0x13a824)[_0xee2f('0x31')](_0x13149e);};}exports[_0xee2f('0x32')]=function(_0x433547,_0x5ad0a7){var _0x4584b8={},_0x47e54b={'count':0x0,'rows':[]};var _0x46166f=_(db[_0xee2f('0x33')][_0xee2f('0x34')])[_0xee2f('0x2b')](function(_0xaddf3b){return{'name':_0xaddf3b[_0xee2f('0x35')],'type':_0xaddf3b[_0xee2f('0x36')][_0xee2f('0x37')]};})['filter'](function(_0x562d58){return!_['includes']([_0xee2f('0x38'),'salt'],_0x562d58[_0xee2f('0x2f')]);})['value']();_0x4584b8=qs['getOptions'](_0x46166f,_0x433547);var _0x5027a6={'where':_0x4584b8['where']};return db[_0xee2f('0x33')][_0xee2f('0x20')](_0x5027a6)[_0xee2f('0xf')](function(_0x268775){_0x47e54b['count']=_0x268775;if(_0x433547['query'][_0xee2f('0x39')]){_0x4584b8['include']=[{'all':!![]}];}if(!_['includes'](_0x4584b8[_0xee2f('0x3a')],'id')){_0x4584b8[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x3c')](_0x4584b8);})[_0xee2f('0xf')](function(_0x19bd4d){_0x47e54b['rows']=_0x19bd4d;if(_0x433547['query'][_0xee2f('0x3d')]===_0xee2f('0x3e')){var _0x3bf382=[];for(var _0x2b9b33=0x0;_0x2b9b33<_0x47e54b['rows'][_0xee2f('0x3f')];_0x2b9b33++){_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x40'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs('fax',_0x47e54b['rows'][_0x2b9b33]['dataValues']));_0x3bf382['push'](get_open_tabs(_0xee2f('0x44'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x47e54b['rows'][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33]['dataValues']));}return BPromise['all'](_0x3bf382)['then'](function(_0x1609f0){return _0x47e54b;});}else{return _0x47e54b;}})['then'](respondWithFilteredResult(_0x5ad0a7,_0x4584b8))['catch'](handleError(_0x5ad0a7,null));};exports['show']=function(_0x5f39b4,_0x3834d1){var _0x3ebb54={'raw':![],'where':{'id':_0x5f39b4['params']['id']}},_0x32da72={};_0x32da72[_0xee2f('0x47')]=_['differenceBy'](_[_0xee2f('0x48')](db[_0xee2f('0x33')][_0xee2f('0x34')]),[_0xee2f('0x38'),_0xee2f('0x49')]);_0x32da72['query']=_['keys'](_0x5f39b4[_0xee2f('0x4a')]);_0x32da72['filters']=_[_0xee2f('0x4b')](_0x32da72[_0xee2f('0x47')],_0x32da72[_0xee2f('0x4a')]);_0x3ebb54[_0xee2f('0x3a')]=_['intersection'](_0x32da72['model'],qs[_0xee2f('0x4c')](_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x4c')]));_0x3ebb54[_0xee2f('0x3a')]=_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3f')]?_0x3ebb54[_0xee2f('0x3a')]:_0x32da72[_0xee2f('0x47')];if(_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x39')]){_0x3ebb54[_0xee2f('0x4d')]=[{'all':!![]}];}_0x3ebb54=_[_0xee2f('0x4e')]({},_0x3ebb54,_0x5f39b4['options']);if(!_[_0xee2f('0x2d')](_0x3ebb54[_0xee2f('0x3a')],'id')){_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x2e')](_0x3ebb54)[_0xee2f('0xf')](handleEntityNotFound(_0x3834d1,null))[_0xee2f('0xf')](function(_0xda9ad5){var _0xa88c4c=[];values=_0xda9ad5;if(_0x5f39b4['query'][_0xee2f('0x3d')]==='true'){_0xa88c4c['push'](get_open_tabs(_0xee2f('0x40'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0xda9ad5['dataValues']));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0xda9ad5[_0xee2f('0x42')]));return BPromise['all'](_0xa88c4c);}else{return values;}})[_0xee2f('0xf')](function(_0x4b9d29){return values;})[_0xee2f('0xf')](respondWithResult(_0x3834d1,null))[_0xee2f('0x18')](handleError(_0x3834d1,null));};exports[_0xee2f('0x23')]=function(_0x11ba31,_0x2f3891){if(_0x11ba31['body']['id']){delete _0x11ba31[_0xee2f('0x50')]['id'];}delete _0x11ba31[_0xee2f('0x50')][_0xee2f('0x26')];return db[_0xee2f('0x33')]['find']({'where':{'id':_0x11ba31['params']['id']}})['then'](handleEntityNotFound(_0x2f3891,null))['then'](saveUpdates(_0x11ba31['body'],null))[_0xee2f('0xf')](respondWithResult(_0x2f3891,null))['catch'](handleError(_0x2f3891,null));};exports[_0xee2f('0x51')]=function(_0x1421da,_0xd967e9){return db[_0xee2f('0x33')][_0xee2f('0x51')]()[_0xee2f('0xf')](respondWithResult(_0xd967e9,null))['catch'](handleError(_0xd967e9,null));};exports['addContacts']=function(_0x1708c5,_0x58e464){return db[_0xee2f('0x33')]['find']({'where':{'id':_0x1708c5[_0xee2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x58e464,null))[_0xee2f('0xf')](function(_0x38616b){if(_0x38616b){return _0x38616b[_0xee2f('0x53')](_0x1708c5['body'][_0xee2f('0x54')],_[_0xee2f('0x55')](_0x1708c5[_0xee2f('0x50')],[_0xee2f('0x54'),'id'])||{});}})[_0xee2f('0xf')](respondWithResult(_0x58e464,null))[_0xee2f('0x18')](handleError(_0x58e464,null));};function validateUser(_0xf0c721){return new BPromise(function(_0x54f48f,_0x3ee766){if(_0xf0c721[_0xee2f('0x56')])return _0x54f48f(_0xf0c721);return db[_0xee2f('0x57')][_0xee2f('0x58')](0x1)[_0xee2f('0xf')](function(_0x3c9d47){if(_0x3c9d47[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0xf0c721[_0xee2f('0x38')]);db[_0xee2f('0x33')][_0xee2f('0x5b')]('internal')[_0xee2f('0xf')](function(_0xf15bc1){if(_['isNil'](_0xf15bc1)){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47['min_internal']||0x1;return;}if(_[_0xee2f('0x5c')](_0x3c9d47['min_internal'])||_0x3c9d47['min_internal']===_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;return;}if(_0x3c9d47[_0xee2f('0x5d')]>_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];return;}return db[_0xee2f('0x5e')]['query'](_0xee2f('0x5f'),{'type':db[_0xee2f('0x5e')][_0xee2f('0x60')]['SELECT']})[_0xee2f('0xf')](function(_0x413d70){if(_0x413d70&&_0x413d70['length']){for(var _0x1f1c55=0x0,_0x32800d=_0x413d70[_0xee2f('0x3f')];_0x1f1c55<_0x32800d&&_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')]);_0x1f1c55++){if(_0x3c9d47[_0xee2f('0x5d')]<=_0x413d70[_0x1f1c55][_0xee2f('0x61')]){_0xf0c721[_0xee2f('0x56')]=_0x413d70[_0x1f1c55][_0xee2f('0x61')];}else if(_0x3c9d47['min_internal']>_0x413d70[_0x1f1c55]['from']&&_0x3c9d47['min_internal']<=_0x413d70[_0x1f1c55]['to']){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];}}}if(_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')])){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;}return _0x54f48f(_0xf0c721);});});})['catch'](function(_0x2b69f0){_0x3ee766(_0x2b69f0);});});}function updateUser(_0x3a4464){return new BPromise(function(_0x4e39ba,_0x2c4a18){try{if(_0x3a4464[_0xee2f('0x62')]){_0x3a4464[_0xee2f('0x63')]=_0x3a4464['internal'];_0x3a4464[_0xee2f('0x64')]={'mailbox':_0x3a4464['internal'],'password':_0x3a4464[_0xee2f('0x38')],'fullname':_0x3a4464[_0xee2f('0x65')],'email':_0x3a4464['email']};}if(_0x3a4464[_0xee2f('0x26')]===_0xee2f('0x29')){if(!_0x3a4464['permissions'])_0x3a4464['permissions']=['101',_0xee2f('0x66'),'103','113',_0xee2f('0x67'),_0xee2f('0x68'),'105',_0xee2f('0x69'),'107',_0xee2f('0x6a'),_0xee2f('0x6b'),_0xee2f('0x6c'),_0xee2f('0x6d'),_0xee2f('0x6e'),_0xee2f('0x6f')];}_0x4e39ba(_0x3a4464);}catch(_0x20990f){_0x2c4a18(_0x20990f);}});}exports['create']=function(_0x86eb61,_0x2989a8){if(_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error('Unauthorized');if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]===_0xee2f('0x70')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x86eb61['body'][_0xee2f('0x26')]===_0xee2f('0x71')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x72'));}return licenseUtil[_0xee2f('0x73')]([_0x86eb61['body']])['then'](function(){return validateUser(_0x86eb61[_0xee2f('0x50')]);})[_0xee2f('0xf')](function(_0x12c4f9){return updateUser(_0x12c4f9)[_0xee2f('0xf')](function(_0x38ee46){if(_0x38ee46[_0xee2f('0x26')]===_0xee2f('0x71')){_0x38ee46[_0xee2f('0x74')]=_0x86eb61[_0xee2f('0x70')][_0xee2f('0x74')];delete _0x38ee46[_0xee2f('0x75')];}return _0x38ee46;});})[_0xee2f('0xf')](function(_0x563d01){return db['User'][_0xee2f('0x76')](_0x563d01,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5a1fdc){if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]==='user')return _0x5a1fdc;if(_0x86eb61['user'][_0xee2f('0x26')]!==_0xee2f('0x70'))return _0x5a1fdc;return db[_0xee2f('0x77')]['find']({'where':{'name':_0x5a1fdc['role']===_0xee2f('0x29')?_0xee2f('0x28'):_0xee2f('0x78'),'userProfileId':_0x86eb61['user'][_0xee2f('0x75')]},'raw':!![]})['then'](function(_0x1afacf){if(!_0x1afacf||_0x1afacf['autoAssociation']!=0x0)return _0x5a1fdc;return db[_0xee2f('0x79')][_0xee2f('0x76')]({'name':_0x5a1fdc[_0xee2f('0x2f')],'resourceId':_0x5a1fdc['id'],'type':_0x1afacf['name'],'sectionId':_0x1afacf['id']},{})['then'](function(){return _0x5a1fdc;});})[_0xee2f('0x18')](function(_0x4448a6){logger[_0xee2f('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4448a6);throw _0x4448a6;});})[_0xee2f('0xf')](respondWithResult(_0x2989a8,0xc9))[_0xee2f('0x18')](handleError(_0x2989a8,null));};exports[_0xee2f('0x7a')]=function(_0x346fc2,_0x413340){var _0x2c14f=_0x346fc2[_0xee2f('0x50')];var _0x16326e=[];if(_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error(_0xee2f('0x7b'));if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),'user'])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7d'));}if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),_0xee2f('0x71')])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7e'));}return licenseUtil['checkUserLimits'](_0x2c14f)[_0xee2f('0xf')](function(){return validateUser(_0x2c14f[0x0]);})[_0xee2f('0xf')](function(){for(var _0x1422e9=0x1;_0x1422e9<_0x2c14f[_0xee2f('0x3f')];_0x1422e9++){var _0x53d769=_0x2c14f[_0x1422e9-0x1][_0xee2f('0x56')];if(!_0x2c14f[_0x1422e9][_0xee2f('0x56')])_0x2c14f[_0x1422e9][_0xee2f('0x56')]=_0x53d769+0x1;_0x16326e['push'](validateUser(_0x2c14f[_0x1422e9]));}return BPromise['all'](_0x16326e);})[_0xee2f('0xf')](function(){_0x16326e=[];for(var _0x48fe47=0x0;_0x48fe47<_0x2c14f['length'];_0x48fe47++){_0x16326e['push'](updateUser(_0x2c14f[_0x48fe47]));}return BPromise[_0xee2f('0x7f')](_0x16326e);})[_0xee2f('0xf')](function(){return BPromise[_0xee2f('0x80')](_0x2c14f,function(_0x172cee){return db['User'][_0xee2f('0x76')](_0x172cee,{'include':[{'model':db[_0xee2f('0x64')],'as':_0xee2f('0x64')}]})['then'](function(_0x20e5db){_0x172cee['id']=_0x20e5db['id'];return _0x172cee;});});})['then'](function(_0x150445){if(_0x346fc2['body']['role']===_0xee2f('0x70'))return _0x150445;if(_0x346fc2['user'][_0xee2f('0x26')]!=='user')return _0x150445;var _0x4e585b=_[_0xee2f('0x7c')](_0x150445,function(_0x20bc03){return _0x20bc03['role']===_0xee2f('0x29')||_0x20bc03[_0xee2f('0x26')]==='telephone';});if(!_0x4e585b)return _0x150445;return db['UserProfileSection'][_0xee2f('0x3c')]({'where':{'name':{'$or':[_0xee2f('0x28'),'Telephones']},'userProfileId':_0x346fc2[_0xee2f('0x70')][_0xee2f('0x75')]},'raw':!![]})[_0xee2f('0xf')](function(_0x2238c2){if(_[_0xee2f('0x81')](_0x2238c2)||!_['some'](_0x2238c2,['autoAssociation',0x0]))return _0x150445;_0x16326e=[];var _0x567de2=_(_0x2238c2)[_0xee2f('0x2b')](function(_0x1fe927){if(_0x1fe927[_0xee2f('0x82')]===0x1)return;return _0x1fe927[_0xee2f('0x2f')]===_0xee2f('0x28')?_0xee2f('0x29'):_0xee2f('0x2a');})[_0xee2f('0x83')]()[_0xee2f('0x2c')]();for(var _0x173f5f=0x0;_0x173f5f<_0x150445[_0xee2f('0x3f')];_0x173f5f++){if(!_[_0xee2f('0x2d')](_0x567de2,_0x150445[_0x173f5f][_0xee2f('0x26')]))return;var _0x470780=_0x150445[_0x173f5f][_0xee2f('0x26')]===_0xee2f('0x29')?'Agents':'Telephones';_0x16326e[_0xee2f('0x3b')](db[_0xee2f('0x79')]['create']({'name':_0x150445[_0x173f5f][_0xee2f('0x2f')],'resourceId':_0x150445[_0x173f5f]['id'],'type':_0x470780,'sectionId':_[_0xee2f('0x2e')](_0x2238c2,[_0xee2f('0x2f'),_0x470780])['id']},{}));}return BPromise['all'](_0x16326e);});})[_0xee2f('0xf')](respondWithResult(_0x413340,0xc9))[_0xee2f('0x18')](handleError(_0x413340,null));};exports[_0xee2f('0x84')]=function(_0x609bd9,_0x1954b5){if(_0x609bd9[_0xee2f('0x50')]['id']){delete _0x609bd9[_0xee2f('0x50')]['id'];}return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x609bd9['params']['id']}})[_0xee2f('0xf')](function(_0x16b101){if(!_0x16b101)return null;if(_0x16b101['id']===_0x609bd9[_0xee2f('0x70')]['id']){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]||!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x88'));}if(!_0x16b101[_0xee2f('0x89')](_0x609bd9['body'][_0xee2f('0x85')])){throw new db['Sequelize']['ValidationError'](_0xee2f('0x8a'));}if(_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]===_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x8b'));}}else if(_0x609bd9[_0xee2f('0x70')]['role']===_0xee2f('0x71')){if(!_0x609bd9[_0xee2f('0x50')]['newPassword']){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}}else if(_0x609bd9[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x70')){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}if(_0x16b101[_0xee2f('0x26')]!=='agent'){throw new db[(_0xee2f('0x87'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize'][(_0xee2f('0x8c'))]('Unauthorized');}return _0x16b101;})[_0xee2f('0xf')](handleEntityNotFound(_0x1954b5,null))[_0xee2f('0xf')](function(_0x344a3a){return db['Setting'][_0xee2f('0x8e')]({'attributes':['id',_0xee2f('0x59'),'enforcePasswordHistory',_0xee2f('0x8f')]})[_0xee2f('0xf')](function(_0x392446){if(_0x392446[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]);if(!_0x392446['enforcePasswordHistory']||!_0x344a3a[_0xee2f('0x90')])return _0x344a3a;authService[_0xee2f('0x91')](_0x609bd9['body'][_0xee2f('0x86')],_0x344a3a[_0xee2f('0x90')],_0x392446[_0xee2f('0x8f')]);return _0x344a3a;})['then'](saveUpdates({'password':_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')],'passwordResetAt':_0x609bd9[_0xee2f('0x70')]['id']==_0x609bd9[_0xee2f('0x52')]['id']?moment():null,'previousPasswords':authService[_0xee2f('0x92')](_0x609bd9[_0xee2f('0x50')]['newPassword'],_0x344a3a[_0xee2f('0x90')])},null));})[_0xee2f('0xf')](respondWithResult(_0x1954b5,null))[_0xee2f('0x18')](handleError(_0x1954b5,null));};exports['addQueues']=function(_0x50670a,_0xd39c00){var _0x52bb33=_0x50670a[_0xee2f('0x50')][_0xee2f('0x93')];return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x50670a[_0xee2f('0x52')]['id']},'attributes':['id','name','role',_0xee2f('0x94'),_0xee2f('0x95'),'voicePause',_0xee2f('0x96')]})[_0xee2f('0xf')](handleEntityNotFound(_0xd39c00,null))[_0xee2f('0xf')](function(_0xd98eab){if(_0xd98eab){if(!utils['isValidChannel'](_0x52bb33)){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0xd98eab['add'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x50670a[_0xee2f('0x50')]['ids'],{'penalty':_0x50670a['body'][_0xee2f('0x9b')]||0x0})[_0xee2f('0x9c')](function(_0x1fff43){for(var _0x56abfb=0x0;_0x56abfb<_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]['length'];_0x56abfb+=0x1){var _0x969efe={'UserId':Number(_0x50670a[_0xee2f('0x52')]['id'])};_0x969efe[_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')][_0x56abfb]);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9f'),_0x969efe);}return _0x1fff43;})['then'](function(){if(_0x52bb33===_0xee2f('0xa0')){return db[_0xee2f('0xa1')][_0xee2f('0x3c')]({'where':{'id':_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]||[]},'raw':!![],'attributes':['id',_0xee2f('0x2f')]});}})[_0xee2f('0xf')](function(_0x3a71fa){var _0x298dfa=_0xd98eab[_0xee2f('0x25')]({'plain':!![]});var _0x2bf351=[];if(_0x52bb33===_0xee2f('0xa0')&&_0x298dfa['role']===_0xee2f('0x29')&&_0x298dfa['online']){for(var _0xc1d07e=0x0;_0xc1d07e<_0x3a71fa[_0xee2f('0x3f')];_0xc1d07e+=0x1){_0x2bf351['push']({'membername':_0x298dfa[_0xee2f('0x2f')],'UserId':_0x298dfa['id'],'queue_name':_0x3a71fa[_0xc1d07e][_0xee2f('0x2f')],'VoiceQueueId':_0x3a71fa[_0xc1d07e]['id'],'interface':_[_0xee2f('0x5c')](_0x298dfa[_0xee2f('0x96')])?util[_0xee2f('0xa2')](_0xee2f('0xa3'),_0x298dfa['name']):_0x298dfa[_0xee2f('0x96')],'paused':_0x298dfa[_0xee2f('0xa4')]||![],'penalty':_0x50670a[_0xee2f('0x50')][_0xee2f('0x9b')]||0x0});}return BPromise[_0xee2f('0x80')](_0x2bf351,function(_0x31b0f7){return db[_0xee2f('0xa5')][_0xee2f('0xa6')](_0x31b0f7);});}return _0xd98eab;});}})[_0xee2f('0xf')](respondWithStatusCode(_0xd39c00,null))[_0xee2f('0x18')](handleError(_0xd39c00,null));};exports['removeQueues']=function(_0x1d4d12,_0x3ab6c7){var _0x37ebf7;return db['User']['find']({'where':{'id':_0x1d4d12[_0xee2f('0x52')]['id']},'attributes':['id',_0xee2f('0x2f'),_0xee2f('0x26')]})[_0xee2f('0xf')](handleEntityNotFound(_0x3ab6c7,null))[_0xee2f('0xf')](function(_0x4a91ca){if(_0x4a91ca){_0x37ebf7=_0x4a91ca;if(!_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')]||!utils['isValidChannel'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')])){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0x4a91ca[_0xee2f('0xa7')+_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')]);}})[_0xee2f('0xf')](function(_0x2bd952){if(_[_0xee2f('0xa8')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')])){for(var _0x5010eb=0x0;_0x5010eb<_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')][_0xee2f('0x3f')];_0x5010eb+=0x1){var _0x11e4f5={'UserId':Number(_0x1d4d12[_0xee2f('0x52')]['id'])};_0x11e4f5[_[_0xee2f('0x98')](_0x1d4d12['query'][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x1d4d12[_0xee2f('0x4a')]['ids'][_0x5010eb]);socket[_0xee2f('0x9e')](_0xee2f('0x70')+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0xa9'),_0x11e4f5);}}else{var _0x11e4f5={'UserId':Number(_0x1d4d12['params']['id'])};_0x11e4f5[_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+'QueueId']=Number(_0x1d4d12[_0xee2f('0x4a')]['ids']);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')]['channel'][_0xee2f('0x99')]())+'Queue:remove',_0x11e4f5);}return _0x2bd952;})[_0xee2f('0xf')](function(){if(_0x1d4d12['query'][_0xee2f('0x93')]===_0xee2f('0xa0')){return db[_0xee2f('0xa5')][_0xee2f('0x24')]({'where':{'UserId':_0x1d4d12[_0xee2f('0x52')]['id'],'VoiceQueueId':_0x1d4d12['query'][_0xee2f('0x54')]},'individualHooks':!![]})[_0xee2f('0xf')](function(){return _0x37ebf7;});}return _0x37ebf7;})[_0xee2f('0xf')](respondWithStatusCode(_0x3ab6c7,null))[_0xee2f('0x18')](handleError(_0x3ab6c7,null));};exports[_0xee2f('0xaa')]=function(_0x73e99a,_0x55f1bd){_0x73e99a[_0xee2f('0x50')][_0xee2f('0xab')]=_0x73e99a[_0xee2f('0xac')]['filename'];return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x73e99a[_0xee2f('0x52')]['id']}})[_0xee2f('0xf')](handleEntityNotFound(_0x55f1bd,null))[_0xee2f('0xf')](saveUpdates(_0x73e99a[_0xee2f('0x50')],null))[_0xee2f('0xf')](respondWithResult(_0x55f1bd,null))[_0xee2f('0x18')](handleError(_0x55f1bd,null));};exports[_0xee2f('0xad')]=function(_0x2dc4ff,_0x351e10){var _0x3f0ef6=path['join'](config[_0xee2f('0xae')],'server/files/images/logos/default_profile.png');return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x2dc4ff['params']['id']},'attributes':['id',_0xee2f('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0x351e10,null))[_0xee2f('0xf')](function(_0x34a358){if(_0x34a358){if(_[_0xee2f('0x5c')](_0x34a358[_0xee2f('0xab')])){return _0x351e10['download'](_0x3f0ef6);}else{if(!fs[_0xee2f('0xaf')](path[_0xee2f('0xb0')](config[_0xee2f('0xae')],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]))){return _0x351e10[_0xee2f('0xb2')](_0x3f0ef6);}return _0x351e10['download'](path[_0xee2f('0xb0')](config['root'],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]));}}})['catch'](handleError(_0x351e10,null));};exports[_0xee2f('0xb3')]=function(_0x44c1a8,_0x4b9d27){return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x44c1a8[_0xee2f('0x52')]['id']},'attributes':['id']})[_0xee2f('0xf')](handleEntityNotFound(_0x4b9d27,null))[_0xee2f('0xf')](function(_0x2f5a60){var _0x33182c=[];values=_0x2f5a60['dataValues'];_0x33182c[_0xee2f('0x3b')](get_open_tabs('chat',_0x2f5a60['dataValues']));_0x33182c['push'](get_open_tabs(_0xee2f('0x43'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x2f5a60[_0xee2f('0x42')]));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0x2f5a60[_0xee2f('0x42')]));return BPromise[_0xee2f('0x7f')](_0x33182c);})[_0xee2f('0xf')](function(_0x1cbce0){var _0x6e5a1d=[];if(_0x1cbce0){for(var _0xf2d880=0x0;_0xf2d880=_0x2a6832){_0x2155f1=_0x2a6832;_0x297df7=0xc8;}else{_0x297df7=0xce;}_0x53181b[_0xef61('0x20')](_0x297df7);return _0x53181b[_0xef61('0x24')](_0xef61('0x25'),_0x2419a9+'-'+_0x2155f1+'/'+_0x2a6832)[_0xef61('0x26')](_0x3782c6);}return null;};}function saveUpdates(_0x63edd4){return function(_0x1f3572){if(_0x1f3572){return _0x1f3572[_0xef61('0x27')](_0x63edd4)[_0xef61('0x16')](function(_0x393ea9){return _0x393ea9;});}return null;};}function removeEntity(_0x587e26){return function(_0x2fe908){if(_0x2fe908){return _0x2fe908[_0xef61('0x28')]()[_0xef61('0x16')](function(){var _0x4f35ad=_0x2fe908['get']({'plain':!![]});if(_0x4f35ad[_0xef61('0x29')]===_0xef61('0x2a'))return;var _0x122176=[{'name':'Users','value':_0xef61('0x2b'),'ignore':!![]},{'name':_0xef61('0x2c'),'value':'agent','ignore':![]},{'name':_0xef61('0x2d'),'value':'telephone','ignore':![]}];var _0x4c7fd3=_(_0x122176)[_0xef61('0x2e')]('ignore')[_0xef61('0x2f')]('value')[_0xef61('0x30')]();if(_[_0xef61('0x31')](_0x4c7fd3,_0x4f35ad[_0xef61('0x29')])){return;}var _0x14c05c=_[_0xef61('0x32')](_0x122176,[_0xef61('0x30'),_0x4f35ad[_0xef61('0x29')]])[_0xef61('0x33')];return db[_0xef61('0x34')][_0xef61('0x28')]({'where':{'type':_0x14c05c,'resourceId':_0x4f35ad['id']}})['then'](function(){return _0x2fe908;});})[_0xef61('0x16')](function(){_0x587e26[_0xef61('0x20')](0xcc)[_0xef61('0x35')]();});}};}function handleEntityNotFound(_0x1c1760){return function(_0x310954){if(!_0x310954){_0x1c1760['sendStatus'](0x194);}return _0x310954;};}function handleError(_0x1c38dc,_0x3b7373){_0x3b7373=_0x3b7373||0x1f4;return function(_0x291944){logger['error'](_0x291944['stack']);if(_0x291944['name']){delete _0x291944[_0xef61('0x33')];}_0x1c38dc['status'](_0x3b7373)['send'](_0x291944);};}exports['index']=function(_0x3ee764,_0x294063){var _0x54e37a={},_0x508dc7={'count':0x0,'rows':[]};var _0x53c9ef=_(db['User'][_0xef61('0x36')])[_0xef61('0x2f')](function(_0x5e1128){return{'name':_0x5e1128[_0xef61('0x37')],'type':_0x5e1128[_0xef61('0x38')][_0xef61('0x39')]};})[_0xef61('0x2e')](function(_0x49e7c4){return!_[_0xef61('0x31')]([_0xef61('0x3a'),_0xef61('0x3b')],_0x49e7c4[_0xef61('0x33')]);})['value']();_0x54e37a=qs['getOptions'](_0x53c9ef,_0x3ee764);var _0x32109d={'where':_0x54e37a[_0xef61('0x3c')]};return db[_0xef61('0x3d')]['count'](_0x32109d)[_0xef61('0x16')](function(_0x361705){_0x508dc7[_0xef61('0x23')]=_0x361705;if(_0x3ee764[_0xef61('0x3e')]['includeAll']){_0x54e37a['include']=[{'all':!![]}];}if(!_['includes'](_0x54e37a[_0xef61('0x3f')],'id')){_0x54e37a[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db[_0xef61('0x3d')][_0xef61('0x41')](_0x54e37a);})[_0xef61('0x16')](function(_0xc9b467){_0x508dc7['rows']=_0xc9b467;if(_0x3ee764[_0xef61('0x3e')][_0xef61('0x42')]===_0xef61('0x43')){var _0x898c74=[];for(var _0x51fac1=0x0;_0x51fac1<_0x508dc7[_0xef61('0x44')][_0xef61('0x45')];_0x51fac1++){_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x48'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x49'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x508dc7['rows'][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));}return BPromise[_0xef61('0x4d')](_0x898c74)[_0xef61('0x16')](function(_0x5e614b){return _0x508dc7;});}else{return _0x508dc7;}})['then'](respondWithFilteredResult(_0x294063,_0x54e37a))[_0xef61('0x1f')](handleError(_0x294063,null));};exports[_0xef61('0x4e')]=function(_0x53bd30,_0xe9d203){var _0x132c77={'raw':![],'where':{'id':_0x53bd30[_0xef61('0x4f')]['id']}},_0x13d0f8={};_0x13d0f8[_0xef61('0x50')]=_[_0xef61('0x51')](_[_0xef61('0x52')](db['User'][_0xef61('0x36')]),['password',_0xef61('0x3b')]);_0x13d0f8[_0xef61('0x3e')]=_[_0xef61('0x52')](_0x53bd30[_0xef61('0x3e')]);_0x13d0f8[_0xef61('0x53')]=_[_0xef61('0x54')](_0x13d0f8[_0xef61('0x50')],_0x13d0f8[_0xef61('0x3e')]);_0x132c77[_0xef61('0x3f')]=_['intersection'](_0x13d0f8[_0xef61('0x50')],qs[_0xef61('0x55')](_0x53bd30['query']['fields']));_0x132c77[_0xef61('0x3f')]=_0x132c77[_0xef61('0x3f')]['length']?_0x132c77[_0xef61('0x3f')]:_0x13d0f8['model'];if(_0x53bd30[_0xef61('0x3e')][_0xef61('0x56')]){_0x132c77[_0xef61('0x57')]=[{'all':!![]}];}_0x132c77=_[_0xef61('0x58')]({},_0x132c77,_0x53bd30[_0xef61('0x59')]);if(!_[_0xef61('0x31')](_0x132c77['attributes'],'id')){_0x132c77[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db['User'][_0xef61('0x32')](_0x132c77)[_0xef61('0x16')](handleEntityNotFound(_0xe9d203,null))['then'](function(_0x54a936){var _0x93441a=[];values=_0x54a936;if(_0x53bd30['query']['openTabs']==='true'){_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x54a936['dataValues']));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x54a936['dataValues']));_0x93441a['push'](get_open_tabs(_0xef61('0x49'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x54a936[_0xef61('0x47')]));return BPromise['all'](_0x93441a);}else{return values;}})[_0xef61('0x16')](function(_0x572d5f){return values;})['then'](respondWithResult(_0xe9d203,null))[_0xef61('0x1f')](handleError(_0xe9d203,null));};exports[_0xef61('0x27')]=function(_0x224f3a,_0x525a5e){if(_0x224f3a[_0xef61('0x5a')]['id']){delete _0x224f3a[_0xef61('0x5a')]['id'];}delete _0x224f3a[_0xef61('0x5a')][_0xef61('0x29')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x224f3a[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x525a5e,null))[_0xef61('0x16')](saveUpdates(_0x224f3a[_0xef61('0x5a')],null))['then'](respondWithResult(_0x525a5e,null))[_0xef61('0x1f')](handleError(_0x525a5e,null));};exports['describe']=function(_0x503e8c,_0x4386a7){return db[_0xef61('0x3d')][_0xef61('0x5b')]()[_0xef61('0x16')](respondWithResult(_0x4386a7,null))[_0xef61('0x1f')](handleError(_0x4386a7,null));};exports[_0xef61('0x5c')]=function(_0x5e98a9,_0x4c7a9a){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x5e98a9[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x4c7a9a,null))[_0xef61('0x16')](function(_0x3ae98c){if(_0x3ae98c){return _0x3ae98c[_0xef61('0x5c')](_0x5e98a9[_0xef61('0x5a')][_0xef61('0x5d')],_[_0xef61('0x5e')](_0x5e98a9[_0xef61('0x5a')],['ids','id'])||{});}})[_0xef61('0x16')](respondWithResult(_0x4c7a9a,null))[_0xef61('0x1f')](handleError(_0x4c7a9a,null));};function validateUser(_0x485945){return new BPromise(function(_0x4559a6,_0x1856ee){if(_0x485945[_0xef61('0x5f')])return _0x4559a6(_0x485945);return db[_0xef61('0x60')][_0xef61('0x61')](0x1)[_0xef61('0x16')](function(_0x3e4678){if(_0x3e4678[_0xef61('0x62')])authService['validatePasswordPattern'](_0x485945[_0xef61('0x3a')]);db['User']['max']('internal')[_0xef61('0x16')](function(_0x205f80){if(_[_0xef61('0x63')](_0x205f80)){_0x485945['internal']=_0x3e4678[_0xef61('0x64')]||0x1;return;}if(_[_0xef61('0x63')](_0x3e4678[_0xef61('0x64')])||_0x3e4678[_0xef61('0x64')]===_0x205f80){_0x485945[_0xef61('0x5f')]=_0x205f80+0x1;return;}if(_0x3e4678[_0xef61('0x64')]>_0x205f80){_0x485945[_0xef61('0x5f')]=_0x3e4678[_0xef61('0x64')];return;}return db[_0xef61('0x65')][_0xef61('0x3e')](_0xef61('0x66'),{'type':db[_0xef61('0x65')][_0xef61('0x67')][_0xef61('0x68')]})[_0xef61('0x16')](function(_0x5931a4){if(_0x5931a4&&_0x5931a4[_0xef61('0x45')]){for(var _0x117d37=0x0,_0x529a78=_0x5931a4[_0xef61('0x45')];_0x117d37<_0x529a78&&_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')]);_0x117d37++){if(_0x3e4678[_0xef61('0x64')]<=_0x5931a4[_0x117d37][_0xef61('0x69')]){_0x485945[_0xef61('0x5f')]=_0x5931a4[_0x117d37]['from'];}else if(_0x3e4678[_0xef61('0x64')]>_0x5931a4[_0x117d37][_0xef61('0x69')]&&_0x3e4678['min_internal']<=_0x5931a4[_0x117d37]['to']){_0x485945[_0xef61('0x5f')]=_0x3e4678['min_internal'];}}}if(_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')])){_0x485945['internal']=_0x205f80+0x1;}return _0x4559a6(_0x485945);});});})[_0xef61('0x1f')](function(_0x512415){_0x1856ee(_0x512415);});});}function updateUser(_0x3cba7f){return new BPromise(function(_0x3f9882,_0x4c880e){try{if(_0x3cba7f['voicemail']){_0x3cba7f[_0xef61('0x6a')]=_0x3cba7f[_0xef61('0x5f')];_0x3cba7f[_0xef61('0x6b')]={'mailbox':_0x3cba7f[_0xef61('0x5f')],'password':_0x3cba7f[_0xef61('0x3a')],'fullname':_0x3cba7f['fullname'],'email':_0x3cba7f[_0xef61('0x6c')]};}if(_0x3cba7f[_0xef61('0x29')]===_0xef61('0x6d')){if(!_0x3cba7f[_0xef61('0x6e')])_0x3cba7f[_0xef61('0x6e')]=[_0xef61('0x6f'),'102',_0xef61('0x70'),'113',_0xef61('0x71'),_0xef61('0x72'),_0xef61('0x73'),_0xef61('0x74'),_0xef61('0x75'),_0xef61('0x76'),_0xef61('0x77'),_0xef61('0x78'),_0xef61('0x79'),_0xef61('0x7a'),_0xef61('0x7b')];}_0x3f9882(_0x3cba7f);}catch(_0x253b51){_0x4c880e(_0x253b51);}});}exports[_0xef61('0x7c')]=function(_0x5c2166,_0x3f4ff8){if(_0x5c2166[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error('Unauthorized');if(_0x5c2166[_0xef61('0x5a')]['role']==='user'&&_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5c2166['body'][_0xef61('0x29')]===_0xef61('0x2a')&&_0x5c2166['user'][_0xef61('0x29')]!=='admin'){throw new Error(_0xef61('0x7d'));}return licenseUtil[_0xef61('0x7e')]([_0x5c2166[_0xef61('0x5a')]])[_0xef61('0x16')](function(){return validateUser(_0x5c2166['body']);})[_0xef61('0x16')](function(_0x59813e){return updateUser(_0x59813e)[_0xef61('0x16')](function(_0x2ddf83){if(_0x2ddf83[_0xef61('0x29')]===_0xef61('0x2a')){_0x2ddf83[_0xef61('0x7f')]=_0x5c2166[_0xef61('0x2b')][_0xef61('0x7f')];delete _0x2ddf83[_0xef61('0x80')];}return _0x2ddf83;});})[_0xef61('0x16')](function(_0x540b68){return db[_0xef61('0x3d')]['create'](_0x540b68,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]});})['then'](function(_0x43eb12){if(_0x5c2166['body']['role']===_0xef61('0x2b'))return _0x43eb12;if(_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2b'))return _0x43eb12;return db[_0xef61('0x81')]['find']({'where':{'name':_0x43eb12[_0xef61('0x29')]===_0xef61('0x6d')?'Agents':_0xef61('0x2d'),'userProfileId':_0x5c2166['user'][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x1d0dd8){if(!_0x1d0dd8||_0x1d0dd8[_0xef61('0x82')]!=0x0)return _0x43eb12;return db['UserProfileResource'][_0xef61('0x7c')]({'name':_0x43eb12[_0xef61('0x33')],'resourceId':_0x43eb12['id'],'type':_0x1d0dd8[_0xef61('0x33')],'sectionId':_0x1d0dd8['id']},{})['then'](function(){return _0x43eb12;});})[_0xef61('0x1f')](function(_0x2a0edb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a0edb);throw _0x2a0edb;});})[_0xef61('0x16')](respondWithResult(_0x3f4ff8,0xc9))[_0xef61('0x1f')](handleError(_0x3f4ff8,null));};exports[_0xef61('0x83')]=function(_0x3d829e,_0x15ddb0){var _0x1b3b78=_0x3d829e[_0xef61('0x5a')];var _0x113f9c=[];if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error(_0xef61('0x84'));if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2b')])&&_0x3d829e[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error(_0xef61('0x86'));}if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2a')])&&_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2a')){throw new Error(_0xef61('0x87'));}return licenseUtil[_0xef61('0x7e')](_0x1b3b78)[_0xef61('0x16')](function(){return validateUser(_0x1b3b78[0x0]);})[_0xef61('0x16')](function(){for(var _0x4e8a39=0x1;_0x4e8a39<_0x1b3b78[_0xef61('0x45')];_0x4e8a39++){var _0xe465b9=_0x1b3b78[_0x4e8a39-0x1]['internal'];if(!_0x1b3b78[_0x4e8a39][_0xef61('0x5f')])_0x1b3b78[_0x4e8a39][_0xef61('0x5f')]=_0xe465b9+0x1;_0x113f9c[_0xef61('0x40')](validateUser(_0x1b3b78[_0x4e8a39]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){_0x113f9c=[];for(var _0x51a988=0x0;_0x51a988<_0x1b3b78[_0xef61('0x45')];_0x51a988++){_0x113f9c['push'](updateUser(_0x1b3b78[_0x51a988]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){return BPromise[_0xef61('0x88')](_0x1b3b78,function(_0x19b1a0){return db[_0xef61('0x3d')][_0xef61('0x7c')](_0x19b1a0,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]})['then'](function(_0x3f68db){_0x19b1a0['id']=_0x3f68db['id'];return _0x19b1a0;});});})[_0xef61('0x16')](function(_0x28f142){if(_0x3d829e[_0xef61('0x5a')][_0xef61('0x29')]===_0xef61('0x2b'))return _0x28f142;if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2b'))return _0x28f142;var _0x53678e=_[_0xef61('0x85')](_0x28f142,function(_0xe57b4d){return _0xe57b4d[_0xef61('0x29')]===_0xef61('0x6d')||_0xe57b4d['role']==='telephone';});if(!_0x53678e)return _0x28f142;return db[_0xef61('0x81')][_0xef61('0x41')]({'where':{'name':{'$or':[_0xef61('0x2c'),_0xef61('0x2d')]},'userProfileId':_0x3d829e[_0xef61('0x2b')][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x4c2d94){if(_[_0xef61('0x89')](_0x4c2d94)||!_[_0xef61('0x85')](_0x4c2d94,[_0xef61('0x82'),0x0]))return _0x28f142;_0x113f9c=[];var _0x22e342=_(_0x4c2d94)[_0xef61('0x2f')](function(_0x4fa56b){if(_0x4fa56b[_0xef61('0x82')]===0x1)return;return _0x4fa56b['name']===_0xef61('0x2c')?_0xef61('0x6d'):_0xef61('0x8a');})[_0xef61('0x8b')]()[_0xef61('0x30')]();for(var _0xa23aa9=0x0;_0xa23aa9<_0x28f142['length'];_0xa23aa9++){if(!_[_0xef61('0x31')](_0x22e342,_0x28f142[_0xa23aa9][_0xef61('0x29')]))return;var _0xc67b1b=_0x28f142[_0xa23aa9][_0xef61('0x29')]===_0xef61('0x6d')?_0xef61('0x2c'):_0xef61('0x2d');_0x113f9c['push'](db[_0xef61('0x34')][_0xef61('0x7c')]({'name':_0x28f142[_0xa23aa9][_0xef61('0x33')],'resourceId':_0x28f142[_0xa23aa9]['id'],'type':_0xc67b1b,'sectionId':_['find'](_0x4c2d94,['name',_0xc67b1b])['id']},{}));}return BPromise[_0xef61('0x4d')](_0x113f9c);});})[_0xef61('0x16')](respondWithResult(_0x15ddb0,0xc9))['catch'](handleError(_0x15ddb0,null));};exports[_0xef61('0x8c')]=function(_0x1a9418,_0x30e931){if(_0x1a9418[_0xef61('0x5a')]['id']){delete _0x1a9418[_0xef61('0x5a')]['id'];}return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x1a9418[_0xef61('0x4f')]['id']}})['then'](function(_0x321b02){if(!_0x321b02)return null;if(_0x321b02['id']===_0x1a9418[_0xef61('0x2b')]['id']){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x8d')]||!_0x1a9418[_0xef61('0x5a')]['newPassword']){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x8f'));}if(!_0x321b02[_0xef61('0x90')](_0x1a9418[_0xef61('0x5a')]['oldPassword'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0x92'));}if(_0x1a9418['body']['oldPassword']===_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x94'));}}else if(_0x1a9418[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x2a')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x95'));}}else if(_0x1a9418[_0xef61('0x2b')]['role']===_0xef61('0x2b')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x95'));}if(_0x321b02['role']!==_0xef61('0x6d')){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x84'));}}else{throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))]('Unauthorized');}return _0x321b02;})['then'](handleEntityNotFound(_0x30e931,null))[_0xef61('0x16')](function(_0x13d2f4){return db[_0xef61('0x60')][_0xef61('0x96')]({'attributes':['id',_0xef61('0x62'),_0xef61('0x97'),_0xef61('0x98')]})['then'](function(_0x569dc7){if(_0x569dc7[_0xef61('0x62')])authService[_0xef61('0x99')](_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]);if(!_0x569dc7[_0xef61('0x97')]||!_0x13d2f4['previousPasswords'])return _0x13d2f4;authService[_0xef61('0x9a')](_0x1a9418['body'][_0xef61('0x93')],_0x13d2f4['previousPasswords'],_0x569dc7[_0xef61('0x98')]);return _0x13d2f4;})['then'](saveUpdates({'password':_0x1a9418['body'][_0xef61('0x93')],'passwordResetAt':_0x1a9418[_0xef61('0x2b')]['id']==_0x1a9418[_0xef61('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xef61('0x9b')](_0x1a9418[_0xef61('0x5a')]['newPassword'],_0x13d2f4['previousPasswords'])},null));})['then'](respondWithResult(_0x30e931,null))[_0xef61('0x1f')](handleError(_0x30e931,null));};exports['addQueues']=function(_0x35155e,_0x132875){var _0x2ba1e7=_0x35155e[_0xef61('0x5a')][_0xef61('0x9c')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x35155e['params']['id']},'attributes':['id',_0xef61('0x33'),'role',_0xef61('0x9d'),_0xef61('0x9e'),_0xef61('0x9f'),_0xef61('0xa0')]})['then'](handleEntityNotFound(_0x132875,null))[_0xef61('0x16')](function(_0x45c0f4){if(_0x45c0f4){if(!utils[_0xef61('0xa1')](_0x2ba1e7)){throw new db['Sequelize']['ValidationError'](_0xef61('0xa2'));}return _0x45c0f4[_0xef61('0xa3')+_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa5')](_0x35155e['body']['ids'],{'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0})['spread'](function(_0x1090ba){for(var _0x5d2765=0x0;_0x5d2765<_0x35155e[_0xef61('0x5a')]['ids'][_0xef61('0x45')];_0x5d2765+=0x1){var _0x4be6f2={'UserId':Number(_0x35155e[_0xef61('0x4f')]['id'])};_0x4be6f2[_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x35155e['body'][_0xef61('0x5d')][_0x5d2765]);socket[_0xef61('0xa8')](_0xef61('0x2b')+_['capitalize'](_0x2ba1e7['toLowerCase']())+_0xef61('0xa9'),_0x4be6f2);}return _0x1090ba;})[_0xef61('0x16')](function(){if(_0x2ba1e7==='voice'){return db['VoiceQueue'][_0xef61('0x41')]({'where':{'id':_0x35155e[_0xef61('0x5a')]['ids']||[]},'raw':!![],'attributes':['id',_0xef61('0x33')]});}})['then'](function(_0x3dc1f2){var _0x87fe0e=_0x45c0f4[_0xef61('0xaa')]({'plain':!![]});var _0x128ddc=[];if(_0x2ba1e7===_0xef61('0xab')&&_0x87fe0e[_0xef61('0x29')]==='agent'&&_0x87fe0e['online']){for(var _0x780325=0x0;_0x780325<_0x3dc1f2[_0xef61('0x45')];_0x780325+=0x1){_0x128ddc[_0xef61('0x40')]({'membername':_0x87fe0e[_0xef61('0x33')],'UserId':_0x87fe0e['id'],'queue_name':_0x3dc1f2[_0x780325][_0xef61('0x33')],'VoiceQueueId':_0x3dc1f2[_0x780325]['id'],'interface':_[_0xef61('0x63')](_0x87fe0e[_0xef61('0xa0')])?util[_0xef61('0xac')]('SIP/%s',_0x87fe0e[_0xef61('0x33')]):_0x87fe0e[_0xef61('0xa0')],'paused':_0x87fe0e[_0xef61('0x9f')]||![],'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0});}return BPromise[_0xef61('0x88')](_0x128ddc,function(_0x6b01f9){return db['UserVoiceQueueRt'][_0xef61('0xad')](_0x6b01f9);});}return _0x45c0f4;});}})[_0xef61('0x16')](respondWithStatusCode(_0x132875,null))[_0xef61('0x1f')](handleError(_0x132875,null));};exports[_0xef61('0xae')]=function(_0x318887,_0x3f77d1){var _0x4216f8;return db['User'][_0xef61('0x32')]({'where':{'id':_0x318887[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0x33'),_0xef61('0x29')]})[_0xef61('0x16')](handleEntityNotFound(_0x3f77d1,null))[_0xef61('0x16')](function(_0x3ef5fd){if(_0x3ef5fd){_0x4216f8=_0x3ef5fd;if(!_0x318887['query'][_0xef61('0x9c')]||!utils[_0xef61('0xa1')](_0x318887['query']['channel'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0xa2'));}return _0x3ef5fd[_0xef61('0xaf')+_['capitalize'](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa5')](_0x318887['query'][_0xef61('0x5d')]);}})[_0xef61('0x16')](function(_0x23a826){if(_[_0xef61('0xb0')](_0x318887[_0xef61('0x3e')]['ids'])){for(var _0x471206=0x0;_0x471206<_0x318887[_0xef61('0x3e')][_0xef61('0x5d')][_0xef61('0x45')];_0x471206+=0x1){var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x318887['query'][_0xef61('0x5d')][_0x471206]);socket['emit']('user'+_['capitalize'](_0x318887['query'][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}}else{var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_['capitalize'](_0x318887['query'][_0xef61('0x9c')]['toLowerCase']())+_0xef61('0xa7')]=Number(_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]);socket['emit'](_0xef61('0x2b')+_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}return _0x23a826;})['then'](function(){if(_0x318887[_0xef61('0x3e')][_0xef61('0x9c')]===_0xef61('0xab')){return db[_0xef61('0xb3')]['destroy']({'where':{'UserId':_0x318887['params']['id'],'VoiceQueueId':_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]},'individualHooks':!![]})[_0xef61('0x16')](function(){return _0x4216f8;});}return _0x4216f8;})['then'](respondWithStatusCode(_0x3f77d1,null))[_0xef61('0x1f')](handleError(_0x3f77d1,null));};exports[_0xef61('0xb4')]=function(_0x527c04,_0x3a40e9){_0x527c04[_0xef61('0x5a')]['userpic']=_0x527c04[_0xef61('0xb5')][_0xef61('0xb6')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x527c04[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x3a40e9,null))[_0xef61('0x16')](saveUpdates(_0x527c04['body'],null))[_0xef61('0x16')](respondWithResult(_0x3a40e9,null))[_0xef61('0x1f')](handleError(_0x3a40e9,null));};exports['getAvatar']=function(_0xf43ed,_0x50ca36){var _0x38e790=path[_0xef61('0xb7')](config[_0xef61('0xb8')],_0xef61('0xb9'));return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0xf43ed[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0x50ca36,null))[_0xef61('0x16')](function(_0x392cb9){if(_0x392cb9){if(_['isNil'](_0x392cb9[_0xef61('0xba')])){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}else{if(!fs[_0xef61('0xbc')](path['join'](config[_0xef61('0xb8')],_0xef61('0xbd'),_0x392cb9['userpic']))){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}return _0x50ca36['download'](path['join'](config[_0xef61('0xb8')],'server/files/images/',_0x392cb9[_0xef61('0xba')]));}}})[_0xef61('0x1f')](handleError(_0x50ca36,null));};exports[_0xef61('0xbe')]=function(_0x3bf8a9,_0x227940){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x3bf8a9[_0xef61('0x4f')]['id']},'attributes':['id']})[_0xef61('0x16')](handleEntityNotFound(_0x227940,null))[_0xef61('0x16')](function(_0x2998f1){var _0x57fa3e=[];values=_0x2998f1[_0xef61('0x47')];_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x2998f1['dataValues']));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x49'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x2998f1[_0xef61('0x47')]));return BPromise[_0xef61('0x4d')](_0x57fa3e);})['then'](function(_0x54bad6){var _0x4fb086=[];if(_0x54bad6){for(var _0x432f67=0x0;_0x432f67=_0x6d239f[_0xacf3('0x52')]){throw new Error(_0xacf3('0x53'));}})['then'](function(){if(_0x2f1549){return db['UserVoiceQueueRt'][_0xacf3('0x54')]({'where':{'membername':_0x2f1549['name']},'individualHooks':!![]});}})[_0xacf3('0x29')](function(){if(_0x2f1549){return _0x2f1549[_0xacf3('0x55')]({'raw':!![]});}})[_0xacf3('0x29')](function(_0x89a784){if(_0x2f1549){if(_0x89a784){var _0x1b7d64=[];_0x1e5ab8=_0x89a784;if(_0x1e5ab8['length']){for(var _0x58b0b2=0x0;_0x58b0b2<_0x1e5ab8[_0xacf3('0x35')];_0x58b0b2++){_0x1b7d64[_0xacf3('0x3a')](db[_0xacf3('0x31')][_0xacf3('0x56')]({'membername':_0x2f1549[_0xacf3('0x2e')],'UserId':_0x2f1549['id'],'queue_name':_0x1e5ab8[_0x58b0b2][_0xacf3('0x2e')],'VoiceQueueId':_0x1e5ab8[_0x58b0b2]['id'],'interface':_0x5c1016,'paused':_0x2f1549['loginInPause']||![],'penalty':_0x1e5ab8[_0x58b0b2][_0xacf3('0x57')]||0x0}));}return BPromise[_0xacf3('0x4d')](_0x1b7d64);}}}})[_0xacf3('0x29')](function(){if(_0x2f1549){return db['MemberReport'][_0xacf3('0x20')]({'where':{'membername':_0x2f1549['name'],'exitAt':null}});}})[_0xacf3('0x29')](function(_0x375151){if(_0x2f1549){if(_0x375151&&_0x375151[_0xacf3('0x35')]){var _0x451920=[];_0x375151['forEach'](function(_0x526ecf){_0x451920[_0xacf3('0x3a')](_0x526ecf[_0xacf3('0x32')]({'exitAt':moment()[_0xacf3('0x36')](_0xacf3('0x3d'))}));});return BPromise[_0xacf3('0x4d')](_0x451920);}}})[_0xacf3('0x29')](function(_0x245526){if(_0x2f1549){var _0x4ade11=[];var _0x295a68=[];var _0x1fac6e=utils[_0xacf3('0x38')]();var _0x14eef6={'membername':_0x2f1549[_0xacf3('0x2e')],'interface':_0x5c1016,'enterAt':moment()[_0xacf3('0x36')](_0xacf3('0x3d')),'role':_0x2f1549[_0xacf3('0x2f')],'internal':_0x2f1549[_0xacf3('0x30')]};_0x1fac6e[_0xacf3('0x39')](function(_0x41a746){_0x4ade11['push'](_[_0xacf3('0x58')]({'channel':_0x41a746,'type':_0xacf3('0x59'),'data1':_0xacf3('0x5a'),'data2':_0x5c1016},_0x14eef6));if(_0x2f1549[_0xacf3('0x5b')]){_0x295a68[_0xacf3('0x3a')](_['merge']({'channel':_0x41a746,'type':'PAUSE','data1':_0xacf3('0x5c')},_0x14eef6));}});return db[_0xacf3('0x33')][_0xacf3('0x40')](_0x4ade11[_0xacf3('0x5d')](_0x295a68),{'individualHooks':!![]});}})['then'](function(){if(_0x2f1549){return _0x2f1549[_0xacf3('0x32')]({'online':!![],'lastLoginAt':moment()[_0xacf3('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2f1549[_0xacf3('0x5b')]||![],'mailPause':_0x2f1549[_0xacf3('0x5b')]||![],'chatPause':_0x2f1549[_0xacf3('0x5b')]||![],'faxPause':_0x2f1549[_0xacf3('0x5b')]||![],'smsPause':_0x2f1549['loginInPause']||![],'openchannelPause':_0x2f1549[_0xacf3('0x5b')]||![],'pauseType':_0x2f1549[_0xacf3('0x5b')]?_0xacf3('0x5c'):null,'lastPauseAt':moment()[_0xacf3('0x36')](_0xacf3('0x3d')),'interface':_0x5c1016});}})['then'](function(_0x22e4b8){_0x170060(_0x22e4b8);})[_0xacf3('0x1e')](function(_0x41d105){_0x48d225(_0x3e9534[_0xacf3('0x19')](0x1f4,_0x41d105[_0xacf3('0x1b')]));});});}; \ No newline at end of file +var _0x7636=['bulkCreate','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','User,\x20%s,\x20%s','info','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowUser','find','debug','stringify','name','update','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','interface','PAUSE','format','body','DEFAULT\x20PAUSE','internal','uniqueid','type','UnpauseUser','findOne','channel','isValidChannel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','all','LogoutUser','destroy','LoginUser','mobile','loginInPause','SIP/%s','agent','../../config/license/util','getLicense','upsert','UserVoiceQueue.penalty','role','LOGIN','callysquare','merge','LOGININPAUSE'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0x7636,0x11f));var _0x6763=function(_0x356d1b,_0x2a9fb7){_0x356d1b=_0x356d1b-0x0;var _0x4c2ca4=_0x7636[_0x356d1b];return _0x4c2ca4;};'use strict';var _=require(_0x6763('0x0'));var util=require(_0x6763('0x1'));var moment=require(_0x6763('0x2'));var BPromise=require(_0x6763('0x3'));var rs=require(_0x6763('0x4'));var fs=require('fs');var Redis=require(_0x6763('0x5'));var db=require(_0x6763('0x6'))['db'];var utils=require(_0x6763('0x7'));var logger=require(_0x6763('0x8'))(_0x6763('0x9'));var config=require(_0x6763('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6763('0xb')][_0x6763('0xc')]({'port':0x232a});config[_0x6763('0xd')]=_[_0x6763('0xe')](config[_0x6763('0xd')],{'host':_0x6763('0xf'),'port':0x18eb});var socket=require(_0x6763('0x10'))(new Redis(config[_0x6763('0xd')]));require(_0x6763('0x11'))[_0x6763('0x12')](socket);function respondWithRpcPromise(_0x110778,_0x27b04d,_0x13ebcf){return new BPromise(function(_0x7cb353,_0x4904a8){return client[_0x6763('0x13')](_0x110778,_0x13ebcf)['then'](function(_0x3c5fc0){logger['info']('User,\x20%s,\x20%s',_0x27b04d,_0x6763('0x14'));logger['debug'](_0x6763('0x15'),_0x27b04d,'request\x20sent',JSON['stringify'](_0x3c5fc0));if(_0x3c5fc0[_0x6763('0x16')]){if(_0x3c5fc0['error'][_0x6763('0x17')]===0x1f4){logger[_0x6763('0x16')]('User,\x20%s,\x20%s',_0x27b04d,_0x3c5fc0[_0x6763('0x16')][_0x6763('0x18')]);return _0x4904a8(_0x3c5fc0[_0x6763('0x16')][_0x6763('0x18')]);}logger[_0x6763('0x16')](_0x6763('0x19'),_0x27b04d,_0x3c5fc0[_0x6763('0x16')]['message']);return _0x7cb353(_0x3c5fc0[_0x6763('0x16')][_0x6763('0x18')]);}else{logger[_0x6763('0x1a')]('User,\x20%s,\x20%s',_0x27b04d,_0x6763('0x14'));_0x7cb353(_0x3c5fc0['result'][_0x6763('0x18')]);}})[_0x6763('0x1b')](function(_0x3bbaff){logger[_0x6763('0x16')](_0x6763('0x19'),_0x27b04d,_0x3bbaff);_0x4904a8(_0x3bbaff);});});}exports[_0x6763('0x1c')]=function(_0x9e32ca){var _0x5ebbe8=this;return new Promise(function(_0x16f8a0,_0xc18015){return db[_0x6763('0x1d')][_0x6763('0x1e')]({'raw':_0x9e32ca[_0x6763('0x1f')]?_0x9e32ca[_0x6763('0x1f')][_0x6763('0x20')]===undefined?!![]:![]:!![],'where':_0x9e32ca['options']?_0x9e32ca[_0x6763('0x1f')][_0x6763('0x21')]||null:null,'attributes':_0x9e32ca[_0x6763('0x1f')]?_0x9e32ca['options'][_0x6763('0x22')]||null:null,'limit':_0x9e32ca[_0x6763('0x1f')]?_0x9e32ca[_0x6763('0x1f')][_0x6763('0x23')]||null:null,'include':_0x9e32ca[_0x6763('0x1f')]?_0x9e32ca[_0x6763('0x1f')][_0x6763('0x24')]?_[_0x6763('0x25')](_0x9e32ca[_0x6763('0x1f')]['include'],function(_0x568c30){return{'model':db[_0x568c30[_0x6763('0x26')]],'as':_0x568c30['as'],'attributes':_0x568c30['attributes'],'include':_0x568c30['include']?_[_0x6763('0x25')](_0x568c30['include'],function(_0x51ec84){return{'model':db[_0x51ec84[_0x6763('0x26')]],'as':_0x51ec84['as'],'attributes':_0x51ec84[_0x6763('0x22')],'include':_0x51ec84[_0x6763('0x24')]?_[_0x6763('0x25')](_0x51ec84[_0x6763('0x24')],function(_0x3b7f84){return{'model':db[_0x3b7f84[_0x6763('0x26')]],'as':_0x3b7f84['as'],'attributes':_0x3b7f84[_0x6763('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6763('0x27')](function(_0x4f0503){logger[_0x6763('0x1a')](_0x6763('0x1c'),_0x9e32ca);logger['debug'](_0x6763('0x1c'),_0x9e32ca,JSON['stringify'](_0x4f0503));_0x16f8a0(_0x4f0503);})['catch'](function(_0x12e34){logger['error'](_0x6763('0x1c'),_0x12e34[_0x6763('0x18')],_0x9e32ca);_0xc18015(_0x5ebbe8[_0x6763('0x16')](0x1f4,_0x12e34[_0x6763('0x18')]));});});};exports[_0x6763('0x28')]=function(_0x403447){var _0x4d6884=this;return new Promise(function(_0x8ba975,_0x3991a0){return db[_0x6763('0x1d')][_0x6763('0x29')]({'raw':_0x403447[_0x6763('0x1f')]?_0x403447[_0x6763('0x1f')][_0x6763('0x20')]===undefined?!![]:![]:!![],'where':_0x403447[_0x6763('0x1f')]?_0x403447[_0x6763('0x1f')]['where']||null:null,'attributes':_0x403447[_0x6763('0x1f')]?_0x403447[_0x6763('0x1f')]['attributes']||null:null,'include':_0x403447[_0x6763('0x1f')]?_0x403447[_0x6763('0x1f')][_0x6763('0x24')]?_[_0x6763('0x25')](_0x403447[_0x6763('0x1f')][_0x6763('0x24')],function(_0x35d2e4){return{'model':db[_0x35d2e4['model']],'as':_0x35d2e4['as'],'attributes':_0x35d2e4[_0x6763('0x22')],'include':_0x35d2e4[_0x6763('0x24')]?_[_0x6763('0x25')](_0x35d2e4[_0x6763('0x24')],function(_0x110d1b){return{'model':db[_0x110d1b['model']],'as':_0x110d1b['as'],'attributes':_0x110d1b['attributes'],'include':_0x110d1b[_0x6763('0x24')]?_[_0x6763('0x25')](_0x110d1b[_0x6763('0x24')],function(_0x100fe2){return{'model':db[_0x100fe2[_0x6763('0x26')]],'as':_0x100fe2['as'],'attributes':_0x100fe2['attributes']};}):[]};}):[]};}):[]:[]})[_0x6763('0x27')](function(_0x1ab926){logger['info'](_0x6763('0x28'),_0x403447);logger[_0x6763('0x2a')](_0x6763('0x28'),_0x403447,JSON[_0x6763('0x2b')](_0x1ab926));_0x8ba975(_0x1ab926);})[_0x6763('0x1b')](function(_0x412373){logger[_0x6763('0x16')](_0x6763('0x28'),_0x412373[_0x6763('0x18')],_0x403447);_0x3991a0(_0x4d6884[_0x6763('0x16')](0x1f4,_0x412373[_0x6763('0x18')]));});});};exports['PauseUser']=function(_0x514bfe){var _0x182b9c=this;return new Promise(function(_0x230c95,_0x9afe38){var _0x402140;return db[_0x6763('0x1d')][_0x6763('0x29')]({'where':_0x514bfe['options'][_0x6763('0x21')]||{},'attributes':['id',_0x6763('0x2c'),'role','internal','interface']})['then'](function(_0x2e044d){if(_0x2e044d){_0x402140=_0x2e044d;return db['UserVoiceQueueRt'][_0x6763('0x2d')]({'paused':0x1},{'where':{'UserId':_0x402140['id']},'individualHooks':!![]});}})['then'](function(){if(_0x402140){return db[_0x6763('0x2e')]['findAll']({'where':{'membername':_0x402140[_0x6763('0x2c')],'type':'PAUSE','exitAt':null}});}})[_0x6763('0x27')](function(_0x147699){if(_0x402140){if(_0x147699&&_0x147699[_0x6763('0x2f')]){var _0x22f4c6=moment()['format'](_0x6763('0x30'));for(var _0x4cf239=0x0,_0x6f3bae=_0x147699[_0x6763('0x2f')];_0x4cf239<_0x6f3bae;_0x4cf239++){_0x147699[_0x4cf239][_0x6763('0x31')]({'exitAt':_0x22f4c6});}}}})[_0x6763('0x27')](function(){if(_0x402140){var _0x5748f4=[];var _0x4a8f60=utils['getChannels']();_0x4a8f60[_0x6763('0x32')](function(_0x1219d6){_0x5748f4[_0x6763('0x33')]({'channel':_0x1219d6,'membername':_0x402140[_0x6763('0x2c')],'interface':_[_0x6763('0x34')](_0x402140[_0x6763('0x35')])?util['format']('SIP/%s',_0x402140[_0x6763('0x2c')]):_0x402140[_0x6763('0x35')],'type':_0x6763('0x36'),'enterAt':moment()[_0x6763('0x37')](_0x6763('0x30')),'data1':_0x514bfe[_0x6763('0x38')]['type']||_0x6763('0x39'),'role':_0x402140['role'],'internal':_0x402140[_0x6763('0x3a')],'uniqueid':_0x514bfe[_0x6763('0x38')][_0x6763('0x3b')]||null});});return db[_0x6763('0x2e')]['bulkCreate'](_0x5748f4,{'individualHooks':!![]});}})[_0x6763('0x27')](function(){if(_0x402140){return _0x402140[_0x6763('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x514bfe['body'][_0x6763('0x3c')]||_0x6763('0x39'),'lastPauseAt':moment()[_0x6763('0x37')](_0x6763('0x30'))});}})[_0x6763('0x27')](function(_0x1e6847){_0x230c95(_0x1e6847);})[_0x6763('0x1b')](function(_0x1da3c7){_0x9afe38(_0x182b9c[_0x6763('0x16')](0x1f4,_0x1da3c7[_0x6763('0x18')]));});});};exports[_0x6763('0x3d')]=function(_0x22fc2c){var _0x1b4f02=this;return new Promise(function(_0x19375e,_0x1c30dc){var _0x5c9c6d;return db[_0x6763('0x1d')][_0x6763('0x3e')]({'where':_0x22fc2c[_0x6763('0x1f')][_0x6763('0x21')]||{},'attributes':['id',_0x6763('0x2c')]})[_0x6763('0x27')](function(_0x4dd58e){if(_0x4dd58e){_0x5c9c6d=_0x4dd58e;if(_0x22fc2c['body'][_0x6763('0x3f')]&&!utils[_0x6763('0x40')](_0x22fc2c[_0x6763('0x38')][_0x6763('0x3f')])){throw new Error('Unknown\x20channel');}switch(_0x22fc2c['body'][_0x6763('0x3f')]){case _0x6763('0x41'):return db[_0x6763('0x42')][_0x6763('0x2d')]({'paused':0x0},{'where':{'UserId':_0x5c9c6d['id']}})[_0x6763('0x27')](function(){return db[_0x6763('0x2e')]['find']({'where':{'channel':_0x22fc2c[_0x6763('0x38')][_0x6763('0x3f')],'membername':_0x5c9c6d[_0x6763('0x2c')],'type':_0x6763('0x36'),'exitAt':null}});})[_0x6763('0x27')](function(_0x4012f8){if(_0x4012f8){return _0x4012f8[_0x6763('0x2d')]({'exitAt':moment()[_0x6763('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6763('0x43')},{'individualHooks':!![]});}return null;})[_0x6763('0x27')](function(){return _0x5c9c6d[_0x6763('0x2d')]({'voicePause':![]});});case _0x6763('0x44'):case _0x6763('0x45'):case _0x6763('0x46'):case _0x6763('0x47'):case _0x6763('0x48'):case _0x6763('0x49'):return db[_0x6763('0x2e')][_0x6763('0x29')]({'where':{'channel':_0x22fc2c['body']['channel'],'membername':_0x5c9c6d[_0x6763('0x2c')],'type':_0x6763('0x36'),'exitAt':null}})[_0x6763('0x27')](function(_0x12ae0a){return _0x12ae0a[_0x6763('0x2d')]({'exitAt':moment()[_0x6763('0x37')](_0x6763('0x30')),'data2':_0x6763('0x43')},{'individualHooks':!![]});})[_0x6763('0x27')](function(){var _0x1c0584={};_[_0x6763('0x4a')](_0x1c0584,util[_0x6763('0x37')](_0x6763('0x4b'),_0x22fc2c['body'][_0x6763('0x3f')],'Pause'),![]);return _0x5c9c6d[_0x6763('0x2d')](_0x1c0584);});default:return db[_0x6763('0x42')]['update']({'paused':0x0},{'where':{'UserId':_0x5c9c6d['id']}})[_0x6763('0x27')](function(){return db[_0x6763('0x2e')][_0x6763('0x1e')]({'where':{'membername':_0x5c9c6d['name'],'type':_0x6763('0x36'),'exitAt':null}});})['then'](function(_0x354cd9){var _0x2ae03d=[];_0x354cd9[_0x6763('0x32')](function(_0xde5580){_0x2ae03d[_0x6763('0x33')](_0xde5580[_0x6763('0x2d')]({'exitAt':moment()[_0x6763('0x37')](_0x6763('0x30')),'data2':'system'}));});return BPromise[_0x6763('0x4c')](_0x2ae03d);})['then'](function(){return _0x5c9c6d[_0x6763('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6763('0x27')](function(_0x2cd790){_0x19375e(_0x2cd790);})[_0x6763('0x1b')](function(_0x1fc0c4){_0x1c30dc(_0x1b4f02[_0x6763('0x16')](0x1f4,_0x1fc0c4[_0x6763('0x18')]));});});};exports[_0x6763('0x4d')]=function(_0x3acd81){var _0x6686d9=this;return new Promise(function(_0x59c32d,_0x201910){var _0x25a046;return db[_0x6763('0x1d')][_0x6763('0x3e')]({'where':_0x3acd81[_0x6763('0x1f')][_0x6763('0x21')]||{},'attributes':['id','name']})[_0x6763('0x27')](function(_0x30fcaa){if(_0x30fcaa){_0x25a046=_0x30fcaa;return db['UserVoiceQueueRt'][_0x6763('0x4e')]({'where':{'membername':_0x25a046[_0x6763('0x2c')]},'individualHooks':!![]});}})[_0x6763('0x27')](function(){if(_0x25a046){return db[_0x6763('0x2e')][_0x6763('0x1e')]({'where':{'membername':_0x25a046['name'],'exitAt':null}});}})[_0x6763('0x27')](function(_0x4211b2){if(_0x25a046){if(_0x4211b2&&_0x4211b2[_0x6763('0x2f')]){var _0x4d02e1=[];_0x4211b2[_0x6763('0x32')](function(_0x1dea61){_0x4d02e1[_0x6763('0x33')](_0x1dea61['update']({'exitAt':moment()[_0x6763('0x37')](_0x6763('0x30'))}));});return BPromise[_0x6763('0x4c')](_0x4d02e1);}}})[_0x6763('0x27')](function(){if(_0x25a046){return _0x25a046[_0x6763('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6763('0x27')](function(_0x2fd3dc){_0x59c32d(_0x2fd3dc);})[_0x6763('0x1b')](function(_0x1af730){_0x201910(_0x6686d9[_0x6763('0x16')](0x1f4,_0x1af730[_0x6763('0x18')]));});});};exports[_0x6763('0x4f')]=function(_0x1d721f){var _0x487165=this;return new Promise(function(_0x9ee94d,_0x380dc7){var _0x495cb7;var _0x44f728;var _0x395764;var _0x410288;return db[_0x6763('0x1d')][_0x6763('0x3e')]({'where':_0x1d721f[_0x6763('0x1f')][_0x6763('0x21')]||{},'attributes':['id',_0x6763('0x2c'),'role',_0x6763('0x50'),'phone','internal',_0x6763('0x51'),_0x6763('0x35')]})[_0x6763('0x27')](function(_0x23abfc){if(_0x23abfc){_0x495cb7=_0x23abfc;_0x410288=_0x1d721f['body'][_0x6763('0x35')]?_0x1d721f[_0x6763('0x38')]['interface']:util[_0x6763('0x37')](_0x6763('0x52'),_0x495cb7[_0x6763('0x2c')]);return db[_0x6763('0x1d')]['count']({'where':{'role':_0x6763('0x53'),'online':!![],'id':{'$ne':_0x495cb7['id']}}});}})[_0x6763('0x27')](function(_0x5f0563){if(_0x5f0563){_0x395764=_0x5f0563;return require(_0x6763('0x54'))[_0x6763('0x55')]();}})[_0x6763('0x27')](function(_0xe9c6cf){if(_0xe9c6cf&&_0xe9c6cf['agents']&&_0x395764>=_0xe9c6cf['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x6763('0x27')](function(){if(_0x495cb7){return db[_0x6763('0x42')][_0x6763('0x4e')]({'where':{'membername':_0x495cb7['name']},'individualHooks':!![]});}})['then'](function(){if(_0x495cb7){return _0x495cb7['getVoiceQueues']({'raw':!![]});}})[_0x6763('0x27')](function(_0x43a6e6){if(_0x495cb7){if(_0x43a6e6){var _0x20eff0=[];_0x44f728=_0x43a6e6;if(_0x44f728[_0x6763('0x2f')]){for(var _0x48ff0f=0x0;_0x48ff0f<_0x44f728['length'];_0x48ff0f++){_0x20eff0[_0x6763('0x33')](db[_0x6763('0x42')][_0x6763('0x56')]({'membername':_0x495cb7[_0x6763('0x2c')],'UserId':_0x495cb7['id'],'queue_name':_0x44f728[_0x48ff0f][_0x6763('0x2c')],'VoiceQueueId':_0x44f728[_0x48ff0f]['id'],'interface':_0x410288,'paused':_0x495cb7[_0x6763('0x51')]||![],'penalty':_0x44f728[_0x48ff0f][_0x6763('0x57')]||0x0}));}return BPromise['all'](_0x20eff0);}}}})[_0x6763('0x27')](function(){if(_0x495cb7){return db[_0x6763('0x2e')][_0x6763('0x1e')]({'where':{'membername':_0x495cb7['name'],'exitAt':null}});}})[_0x6763('0x27')](function(_0x136c9d){if(_0x495cb7){if(_0x136c9d&&_0x136c9d['length']){var _0x49705f=[];_0x136c9d[_0x6763('0x32')](function(_0x2940f0){_0x49705f['push'](_0x2940f0[_0x6763('0x2d')]({'exitAt':moment()[_0x6763('0x37')](_0x6763('0x30'))}));});return BPromise[_0x6763('0x4c')](_0x49705f);}}})[_0x6763('0x27')](function(_0x43b87a){if(_0x495cb7){var _0x13e553=[];var _0x549ec4=[];var _0x4818ea=utils['getChannels']();var _0x4474be={'membername':_0x495cb7['name'],'interface':_0x410288,'enterAt':moment()[_0x6763('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x495cb7[_0x6763('0x58')],'internal':_0x495cb7[_0x6763('0x3a')]};_0x4818ea['forEach'](function(_0x3a820b){_0x13e553[_0x6763('0x33')](_['merge']({'channel':_0x3a820b,'type':_0x6763('0x59'),'data1':_0x6763('0x5a'),'data2':_0x410288},_0x4474be));if(_0x495cb7[_0x6763('0x51')]){_0x549ec4['push'](_[_0x6763('0x5b')]({'channel':_0x3a820b,'type':_0x6763('0x36'),'data1':_0x6763('0x5c')},_0x4474be));}});return db[_0x6763('0x2e')][_0x6763('0x5d')](_0x13e553[_0x6763('0x5e')](_0x549ec4),{'individualHooks':!![]});}})[_0x6763('0x27')](function(){if(_0x495cb7){return _0x495cb7[_0x6763('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x6763('0x37')](_0x6763('0x30')),'voicePause':_0x495cb7['loginInPause']||![],'mailPause':_0x495cb7[_0x6763('0x51')]||![],'chatPause':_0x495cb7['loginInPause']||![],'faxPause':_0x495cb7['loginInPause']||![],'smsPause':_0x495cb7[_0x6763('0x51')]||![],'openchannelPause':_0x495cb7[_0x6763('0x51')]||![],'pauseType':_0x495cb7['loginInPause']?_0x6763('0x5c'):null,'lastPauseAt':moment()['format'](_0x6763('0x30')),'interface':_0x410288});}})[_0x6763('0x27')](function(_0x174b49){_0x9ee94d(_0x174b49);})[_0x6763('0x1b')](function(_0x1bbbbe){_0x380dc7(_0x487165[_0x6763('0x16')](0x1f4,_0x1bbbbe['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a5c3045..92a93e5 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 _0x0fb4=['register','length','save','remove','update','emit','removeListener'];(function(_0x1692a2,_0xa769cc){var _0x56d460=function(_0x2b4e8e){while(--_0x2b4e8e){_0x1692a2['push'](_0x1692a2['shift']());}};_0x56d460(++_0xa769cc);}(_0x0fb4,0xaa));var _0x40fb=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x0fb4[_0x71b765];return _0x34cb24;};'use strict';var UserEvents=require('./user.events');var events=[_0x40fb('0x0'),_0x40fb('0x1'),_0x40fb('0x2')];function createListener(_0x150737,_0x55bd16){return function(_0x2dce11){_0x55bd16[_0x40fb('0x3')](_0x150737,_0x2dce11);};}function removeListener(_0x3e7d42,_0x1c4885){return function(){UserEvents[_0x40fb('0x4')](_0x3e7d42,_0x1c4885);};}exports[_0x40fb('0x5')]=function(_0x22d8e5){for(var _0x44c59b=0x0,_0x59ebd5=events[_0x40fb('0x6')];_0x44c59b<_0x59ebd5;_0x44c59b++){var _0x46beaa=events[_0x44c59b];var _0x232cc1=createListener('user:'+_0x46beaa,_0x22d8e5);UserEvents['on'](_0x46beaa,_0x232cc1);}}; \ No newline at end of file +var _0x0208=['emit','removeListener','register','length','user:','./user.events','update'];(function(_0x47f15b,_0x6ef57c){var _0x4029d8=function(_0x3aabbc){while(--_0x3aabbc){_0x47f15b['push'](_0x47f15b['shift']());}};_0x4029d8(++_0x6ef57c);}(_0x0208,0x147));var _0x8020=function(_0x5d3550,_0x107033){_0x5d3550=_0x5d3550-0x0;var _0x5d1299=_0x0208[_0x5d3550];return _0x5d1299;};'use strict';var UserEvents=require(_0x8020('0x0'));var events=['save','remove',_0x8020('0x1')];function createListener(_0x41d3b7,_0x1dfe56){return function(_0x4b79aa){_0x1dfe56[_0x8020('0x2')](_0x41d3b7,_0x4b79aa);};}function removeListener(_0x12a7a3,_0xd2a192){return function(){UserEvents[_0x8020('0x3')](_0x12a7a3,_0xd2a192);};}exports[_0x8020('0x4')]=function(_0x36ac3e){for(var _0x3a0c19=0x0,_0x2c5c2d=events[_0x8020('0x5')];_0x3a0c19<_0x2c5c2d;_0x3a0c19++){var _0x3244a8=events[_0x3a0c19];var _0x15eb72=createListener(_0x8020('0x6')+_0x3244a8,_0x36ac3e);UserEvents['on'](_0x3244a8,_0x15eb72);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 2424eaf..2634635 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5f4f94,_0x554716){var _0xd38cfd=function(_0x12a097){while(--_0x12a097){_0x5f4f94['push'](_0x5f4f94['shift']());}};_0xd38cfd(++_0x554716);}(_0xedd9,0xfc));var _0x9edd=function(_0xa59132,_0xf05537){_0xa59132=_0xa59132-0x0;var _0xa7fcf2=_0xedd9[_0xa59132];return _0xa7fcf2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xc1ec3c,_0x2c27a6){var _0x130ae3=function(_0x1a185e){while(--_0x1a185e){_0xc1ec3c['push'](_0xc1ec3c['shift']());}};_0x130ae3(++_0x2c27a6);}(_0xe706,0xa3));var _0x6e70=function(_0x56de0b,_0x1c39c1){_0x56de0b=_0x56de0b-0x0;var _0x1c05f0=_0xe706[_0x56de0b];return _0x1c05f0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ac49a7e..b8d5e99 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 _0xced4=['INTEGER','sequelize','exports'];(function(_0x58e39a,_0x474e33){var _0x5233f4=function(_0x3fa875){while(--_0x3fa875){_0x58e39a['push'](_0x58e39a['shift']());}};_0x5233f4(++_0x474e33);}(_0xced4,0x1c3));var _0x4ced=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0xced4[_0x560448];return _0x550276;};'use strict';var Sequelize=require(_0x4ced('0x0'));module[_0x4ced('0x1')]={'penalty':{'type':Sequelize[_0x4ced('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ef4=['exports','INTEGER','sequelize'];(function(_0x351d79,_0x4f3124){var _0x34f0a4=function(_0x5a3c84){while(--_0x5a3c84){_0x351d79['push'](_0x351d79['shift']());}};_0x34f0a4(++_0x4f3124);}(_0x7ef4,0x1d0));var _0x47ef=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7ef4[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x47ef('0x0'));module[_0x47ef('0x1')]={'penalty':{'type':Sequelize[_0x47ef('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7992496..b226c53 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 _0x526e=['../../config/logger','api','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x55d6e3,_0xacdb0f){var _0x4ded90=function(_0x6dded){while(--_0x6dded){_0x55d6e3['push'](_0x55d6e3['shift']());}};_0x4ded90(++_0xacdb0f);}(_0x526e,0x1ba));var _0xe526=function(_0x2e712f,_0x60d75f){_0x2e712f=_0x2e712f-0x0;var _0x2fb152=_0x526e[_0x2e712f];return _0x2fb152;};'use strict';var _=require(_0xe526('0x0'));var util=require(_0xe526('0x1'));var logger=require(_0xe526('0x2'))(_0xe526('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe526('0x4'));var fs=require('fs');var path=require(_0xe526('0x5'));var rimraf=require(_0xe526('0x6'));var config=require('../../config/environment');var attributes=require(_0xe526('0x7'));module[_0xe526('0x8')]=function(_0x16bd5f,_0x1ee26d){return _0x16bd5f[_0xe526('0x9')](_0xe526('0xa'),attributes,{'tableName':_0xe526('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb192=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0xb192,0xb0));var _0x2b19=function(_0x47ad7a,_0x360d50){_0x47ad7a=_0x47ad7a-0x0;var _0x5e8f51=_0xb192[_0x47ad7a];return _0x5e8f51;};'use strict';var _=require(_0x2b19('0x0'));var util=require(_0x2b19('0x1'));var logger=require(_0x2b19('0x2'))(_0x2b19('0x3'));var moment=require(_0x2b19('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b19('0x5'));var rimraf=require(_0x2b19('0x6'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x2b19('0x7')]=function(_0x559eb3,_0x487c7b){return _0x559eb3[_0x2b19('0x8')](_0x2b19('0x9'),attributes,{'tableName':_0x2b19('0xa'),'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 e3ac230..107e921 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 _0x79ae=['util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','UserChatQueue,\x20%s,\x20%s','message','error','result','catch','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79ae,0x149));var _0xe79a=function(_0x39bf6a,_0x275429){_0x39bf6a=_0x39bf6a-0x0;var _0x453aec=_0x79ae[_0x39bf6a];return _0x453aec;};'use strict';var _=require(_0xe79a('0x0'));var util=require(_0xe79a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe79a('0x2'));var db=require(_0xe79a('0x3'))['db'];var utils=require(_0xe79a('0x4'));var logger=require('../../config/logger')(_0xe79a('0x5'));var config=require(_0xe79a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe79a('0x7')][_0xe79a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x295d7c,_0x1b2e5f,_0x478a94){return new BPromise(function(_0x527fe2,_0x4b601b){return client[_0xe79a('0x9')](_0x295d7c,_0x478a94)[_0xe79a('0xa')](function(_0x1b7072){logger[_0xe79a('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x1b2e5f,_0xe79a('0xc'));logger[_0xe79a('0xd')](_0xe79a('0xe'),_0x1b2e5f,_0xe79a('0xc'),JSON[_0xe79a('0xf')](_0x1b7072));if(_0x1b7072['error']){if(_0x1b7072['error'][_0xe79a('0x10')]===0x1f4){logger['error'](_0xe79a('0x11'),_0x1b2e5f,_0x1b7072['error'][_0xe79a('0x12')]);return _0x4b601b(_0x1b7072['error']['message']);}logger[_0xe79a('0x13')](_0xe79a('0x11'),_0x1b2e5f,_0x1b7072[_0xe79a('0x13')][_0xe79a('0x12')]);return _0x527fe2(_0x1b7072[_0xe79a('0x13')][_0xe79a('0x12')]);}else{logger['info'](_0xe79a('0x11'),_0x1b2e5f,_0xe79a('0xc'));_0x527fe2(_0x1b7072[_0xe79a('0x14')][_0xe79a('0x12')]);}})[_0xe79a('0x15')](function(_0x46d705){logger[_0xe79a('0x13')](_0xe79a('0x11'),_0x1b2e5f,_0x46d705);_0x4b601b(_0x46d705);});});} \ No newline at end of file +var _0x26de=['randomstring','ioredis','../../config/logger','client','http','request','then','info','request\x20sent','debug','error','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x2089d0,_0x4a0177){var _0x30c40f=function(_0x3d3854){while(--_0x3d3854){_0x2089d0['push'](_0x2089d0['shift']());}};_0x30c40f(++_0x4a0177);}(_0x26de,0x1e2));var _0xe26d=function(_0x2d9fa3,_0x11ab3a){_0x2d9fa3=_0x2d9fa3-0x0;var _0x560a6c=_0x26de[_0x2d9fa3];return _0x560a6c;};'use strict';var _=require(_0xe26d('0x0'));var util=require(_0xe26d('0x1'));var moment=require(_0xe26d('0x2'));var BPromise=require(_0xe26d('0x3'));var rs=require(_0xe26d('0x4'));var fs=require('fs');var Redis=require(_0xe26d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe26d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe26d('0x7')][_0xe26d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e22d1,_0x186bbf,_0x4b9812){return new BPromise(function(_0x353ca2,_0x27960d){return client[_0xe26d('0x9')](_0x3e22d1,_0x4b9812)[_0xe26d('0xa')](function(_0x5d77b0){logger[_0xe26d('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x186bbf,_0xe26d('0xc'));logger[_0xe26d('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x186bbf,_0xe26d('0xc'),JSON['stringify'](_0x5d77b0));if(_0x5d77b0[_0xe26d('0xe')]){if(_0x5d77b0[_0xe26d('0xe')]['code']===0x1f4){logger[_0xe26d('0xe')](_0xe26d('0xf'),_0x186bbf,_0x5d77b0[_0xe26d('0xe')][_0xe26d('0x10')]);return _0x27960d(_0x5d77b0[_0xe26d('0xe')][_0xe26d('0x10')]);}logger[_0xe26d('0xe')](_0xe26d('0xf'),_0x186bbf,_0x5d77b0[_0xe26d('0xe')]['message']);return _0x353ca2(_0x5d77b0[_0xe26d('0xe')][_0xe26d('0x10')]);}else{logger[_0xe26d('0xb')](_0xe26d('0xf'),_0x186bbf,'request\x20sent');_0x353ca2(_0x5d77b0[_0xe26d('0x11')][_0xe26d('0x10')]);}})['catch'](function(_0x2aec00){logger[_0xe26d('0xe')](_0xe26d('0xf'),_0x186bbf,_0x2aec00);_0x27960d(_0x2aec00);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index babb255..d403b0b 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xd1814a,_0x413152){var _0x41fbf8=function(_0x3f098e){while(--_0x3f098e){_0xd1814a['push'](_0xd1814a['shift']());}};_0x41fbf8(++_0x413152);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0xcb91[_0x22431e];return _0xd978e9;};'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(_0x379af2,_0x17b9fc){var _0x419ad9=function(_0x53688f){while(--_0x53688f){_0x379af2['push'](_0x379af2['shift']());}};_0x419ad9(++_0x17b9fc);}(_0xe706,0xa3));var _0x6e70=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0xe706[_0x3b5587];return _0x3fbb62;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 8ec69a0..5fdfc16 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 _0xb552=['INTEGER','exports'];(function(_0x3be20a,_0x223336){var _0x7382f6=function(_0x41c98f){while(--_0x41c98f){_0x3be20a['push'](_0x3be20a['shift']());}};_0x7382f6(++_0x223336);}(_0xb552,0x165));var _0x2b55=function(_0xf4cb64,_0x2676e9){_0xf4cb64=_0xf4cb64-0x0;var _0x4d1beb=_0xb552[_0xf4cb64];return _0x4d1beb;};'use strict';var Sequelize=require('sequelize');module[_0x2b55('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2b55('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa5e0=['INTEGER','STRING','exports'];(function(_0x276388,_0x333691){var _0x483bd0=function(_0x11794a){while(--_0x11794a){_0x276388['push'](_0x276388['shift']());}};_0x483bd0(++_0x333691);}(_0xa5e0,0x1e5));var _0x0a5e=function(_0x3af391,_0x499300){_0x3af391=_0x3af391-0x0;var _0x5b4d9b=_0xa5e0[_0x3af391];return _0x5b4d9b;};'use strict';var Sequelize=require('sequelize');module[_0x0a5e('0x0')]={'penalty':{'type':Sequelize[_0x0a5e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0a5e('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0a5e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 81ff015..db920a7 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 _0xf51c=['./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','api','bluebird','path','rimraf'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0xf51c,0x1d0));var _0xcf51=function(_0x5a2fdb,_0x7175e){_0x5a2fdb=_0x5a2fdb-0x0;var _0x464f4b=_0xf51c[_0x5a2fdb];return _0x464f4b;};'use strict';var _=require(_0xcf51('0x0'));var util=require(_0xcf51('0x1'));var logger=require('../../config/logger')(_0xcf51('0x2'));var moment=require('moment');var BPromise=require(_0xcf51('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf51('0x4'));var rimraf=require(_0xcf51('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf51('0x6'));module[_0xcf51('0x7')]=function(_0x424dba,_0xd41ce4){return _0x424dba['define'](_0xcf51('0x8'),attributes,{'tableName':_0xcf51('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0007=['api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0007,0x15d));var _0x7000=function(_0x2f66fe,_0x46be8b){_0x2f66fe=_0x2f66fe-0x0;var _0x1a1d22=_0x0007[_0x2f66fe];return _0x1a1d22;};'use strict';var _=require(_0x7000('0x0'));var util=require(_0x7000('0x1'));var logger=require(_0x7000('0x2'))(_0x7000('0x3'));var moment=require(_0x7000('0x4'));var BPromise=require(_0x7000('0x5'));var rp=require(_0x7000('0x6'));var fs=require('fs');var path=require(_0x7000('0x7'));var rimraf=require('rimraf');var config=require(_0x7000('0x8'));var attributes=require(_0x7000('0x9'));module['exports']=function(_0x1d5d9a,_0x5c1ac0){return _0x1d5d9a['define']('UserFaxQueue',attributes,{'tableName':_0x7000('0xa'),'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 54542be..bfecea4 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 _0x60c6=['message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x60c6,0x16b));var _0x660c=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x60c6[_0x1d94d1];return _0x23c397;};'use strict';var _=require(_0x660c('0x0'));var util=require(_0x660c('0x1'));var moment=require('moment');var BPromise=require(_0x660c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x660c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x660c('0x4'));var logger=require(_0x660c('0x5'))(_0x660c('0x6'));var config=require('../../config/environment');var jayson=require(_0x660c('0x7'));var client=jayson[_0x660c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45fc61,_0x3bb712,_0x42053b){return new BPromise(function(_0x46d8df,_0xd2993e){return client['request'](_0x45fc61,_0x42053b)[_0x660c('0x9')](function(_0x559543){logger[_0x660c('0xa')](_0x660c('0xb'),_0x3bb712,_0x660c('0xc'));logger[_0x660c('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x3bb712,'request\x20sent',JSON[_0x660c('0xe')](_0x559543));if(_0x559543[_0x660c('0xf')]){if(_0x559543['error'][_0x660c('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3bb712,_0x559543['error'][_0x660c('0x11')]);return _0xd2993e(_0x559543[_0x660c('0xf')]['message']);}logger[_0x660c('0xf')](_0x660c('0xb'),_0x3bb712,_0x559543['error']['message']);return _0x46d8df(_0x559543['error'][_0x660c('0x11')]);}else{logger[_0x660c('0xa')](_0x660c('0xb'),_0x3bb712,'request\x20sent');_0x46d8df(_0x559543[_0x660c('0x12')][_0x660c('0x11')]);}})['catch'](function(_0x139fe6){logger[_0x660c('0xf')](_0x660c('0xb'),_0x3bb712,_0x139fe6);_0xd2993e(_0x139fe6);});});} \ No newline at end of file +var _0x4dcf=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0xe8360c,_0x4b51d5){var _0x377630=function(_0x2561a9){while(--_0x2561a9){_0xe8360c['push'](_0xe8360c['shift']());}};_0x377630(++_0x4b51d5);}(_0x4dcf,0x68));var _0xf4dc=function(_0x1b4027,_0x228aaf){_0x1b4027=_0x1b4027-0x0;var _0x399ed6=_0x4dcf[_0x1b4027];return _0x399ed6;};'use strict';var _=require(_0xf4dc('0x0'));var util=require(_0xf4dc('0x1'));var moment=require(_0xf4dc('0x2'));var BPromise=require(_0xf4dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4dc('0x4'));var db=require(_0xf4dc('0x5'))['db'];var utils=require(_0xf4dc('0x6'));var logger=require(_0xf4dc('0x7'))(_0xf4dc('0x8'));var config=require('../../config/environment');var jayson=require(_0xf4dc('0x9'));var client=jayson[_0xf4dc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d4384,_0x5f5854,_0x1f92c0){return new BPromise(function(_0x9d8106,_0x5de4b6){return client[_0xf4dc('0xb')](_0x2d4384,_0x1f92c0)[_0xf4dc('0xc')](function(_0x958b78){logger[_0xf4dc('0xd')](_0xf4dc('0xe'),_0x5f5854,_0xf4dc('0xf'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5f5854,_0xf4dc('0xf'),JSON[_0xf4dc('0x10')](_0x958b78));if(_0x958b78[_0xf4dc('0x11')]){if(_0x958b78[_0xf4dc('0x11')][_0xf4dc('0x12')]===0x1f4){logger[_0xf4dc('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x5f5854,_0x958b78['error']['message']);return _0x5de4b6(_0x958b78[_0xf4dc('0x11')][_0xf4dc('0x13')]);}logger[_0xf4dc('0x11')](_0xf4dc('0xe'),_0x5f5854,_0x958b78[_0xf4dc('0x11')][_0xf4dc('0x13')]);return _0x9d8106(_0x958b78[_0xf4dc('0x11')]['message']);}else{logger[_0xf4dc('0xd')](_0xf4dc('0xe'),_0x5f5854,_0xf4dc('0xf'));_0x9d8106(_0x958b78['result'][_0xf4dc('0x13')]);}})[_0xf4dc('0x14')](function(_0xa87e7f){logger[_0xf4dc('0x11')](_0xf4dc('0xe'),_0x5f5854,_0xa87e7f);_0x5de4b6(_0xa87e7f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index eede9e6..be5cdac 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4e9862,_0x512616){var _0x2dd040=function(_0x5d9cca){while(--_0x5d9cca){_0x4e9862['push'](_0x4e9862['shift']());}};_0x2dd040(++_0x512616);}(_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(_0x35d568,_0x4d47ae){var _0x5dac84=function(_0x265aaf){while(--_0x265aaf){_0x35d568['push'](_0x35d568['shift']());}};_0x5dac84(++_0x4d47ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 676ab47..c96a908 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 _0xb42c=['exports','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb42c,0x165));var _0xcb42=function(_0x2dbe69,_0x2cf8b0){_0x2dbe69=_0x2dbe69-0x0;var _0x37cd49=_0xb42c[_0x2dbe69];return _0x37cd49;};'use strict';var Sequelize=require(_0xcb42('0x0'));module[_0xcb42('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ad3=['sequelize','exports','INTEGER'];(function(_0x4e553c,_0x1e0ee3){var _0x555354=function(_0x5573a7){while(--_0x5573a7){_0x4e553c['push'](_0x4e553c['shift']());}};_0x555354(++_0x1e0ee3);}(_0x4ad3,0x150));var _0x34ad=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0x4ad3[_0x1a9390];return _0x2b4514;};'use strict';var Sequelize=require(_0x34ad('0x0'));module[_0x34ad('0x1')]={'penalty':{'type':Sequelize[_0x34ad('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f156126..eb37483 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 _0x9a6f=['bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_0x9a6f,0xf3));var _0xf9a6=function(_0x5e38a4,_0x333514){_0x5e38a4=_0x5e38a4-0x0;var _0x401332=_0x9a6f[_0x5e38a4];return _0x401332;};'use strict';var _=require(_0xf9a6('0x0'));var util=require(_0xf9a6('0x1'));var logger=require('../../config/logger')(_0xf9a6('0x2'));var moment=require(_0xf9a6('0x3'));var BPromise=require(_0xf9a6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9a6('0x5'));var rimraf=require(_0xf9a6('0x6'));var config=require(_0xf9a6('0x7'));var attributes=require(_0xf9a6('0x8'));module[_0xf9a6('0x9')]=function(_0x2b0bea,_0x34daf1){return _0x2b0bea[_0xf9a6('0xa')](_0xf9a6('0xb'),attributes,{'tableName':_0xf9a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x717d=['define','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports'];(function(_0x5036df,_0xead159){var _0x348bf1=function(_0x5ac0ce){while(--_0x5ac0ce){_0x5036df['push'](_0x5036df['shift']());}};_0x348bf1(++_0xead159);}(_0x717d,0x13c));var _0xd717=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x717d[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0xd717('0x0'));var util=require(_0xd717('0x1'));var logger=require(_0xd717('0x2'))(_0xd717('0x3'));var moment=require('moment');var BPromise=require(_0xd717('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd717('0x5'));var rimraf=require(_0xd717('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xd717('0x7')]=function(_0x35eec0,_0x30fc33){return _0x35eec0[_0xd717('0x8')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 229cc6d..f9c67f8 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x41d390,_0xfb65c1){var _0x293151=function(_0x2ad8db){while(--_0x2ad8db){_0x41d390['push'](_0x41d390['shift']());}};_0x293151(++_0xfb65c1);}(_0xe14b,0x93));var _0xbe14=function(_0x4f67b5,_0xc1b1cb){_0x4f67b5=_0x4f67b5-0x0;var _0x1ab1dc=_0xe14b[_0x4f67b5];return _0x1ab1dc;};'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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x461a2b,_0x1af9a0){var _0x29ef69=function(_0x5879eb){while(--_0x5879eb){_0x461a2b['push'](_0x461a2b['shift']());}};_0x29ef69(++_0x1af9a0);}(_0x6aa7,0x178));var _0x76aa=function(_0x1f68a9,_0x3ef10b){_0x1f68a9=_0x1f68a9-0x0;var _0x225aab=_0x6aa7[_0x1f68a9];return _0x225aab;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c9a38d0..fbe4198 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 _0x33ba=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','util'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0x33ba,0x1b7));var _0xa33b=function(_0x594aac,_0x55b3d1){_0x594aac=_0x594aac-0x0;var _0x3ecccf=_0x33ba[_0x594aac];return _0x3ecccf;};'use strict';var multer=require('multer');var util=require(_0xa33b('0x0'));var path=require(_0xa33b('0x1'));var timeout=require(_0xa33b('0x2'));var express=require(_0xa33b('0x3'));var router=express[_0xa33b('0x4')]();var fs_extra=require(_0xa33b('0x5'));var auth=require(_0xa33b('0x6'));var interaction=require(_0xa33b('0x7'));var config=require(_0xa33b('0x8'));var controller=require(_0xa33b('0x9'));router[_0xa33b('0xa')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x896a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','sendUserNotification','exports','util','path','connect-timeout'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x896a,0xe4));var _0xa896=function(_0x423cd7,_0x15139e){_0x423cd7=_0x423cd7-0x0;var _0x5ba608=_0x896a[_0x423cd7];return _0x5ba608;};'use strict';var multer=require('multer');var util=require(_0xa896('0x0'));var path=require(_0xa896('0x1'));var timeout=require(_0xa896('0x2'));var express=require(_0xa896('0x3'));var router=express[_0xa896('0x4')]();var fs_extra=require(_0xa896('0x5'));var auth=require(_0xa896('0x6'));var interaction=require(_0xa896('0x7'));var config=require('../../config/environment');var controller=require(_0xa896('0x8'));router['post']('/',auth['isAuthenticated'](),controller[_0xa896('0x9')]);module[_0xa896('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 000593c..862c422 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 _0xfba6=['STRING','TEXT','sequelize','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfba6,0x16a));var _0x6fba=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xfba6[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x6fba('0x0'));module[_0x6fba('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x6fba('0x2')]},'recipientsId':{'type':Sequelize[_0x6fba('0x3')]},'recipientsDescription':{'type':Sequelize[_0x6fba('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xd27c=['STRING','exports','TEXT'];(function(_0x8d8f96,_0x272aff){var _0x4c7d71=function(_0x44e864){while(--_0x44e864){_0x8d8f96['push'](_0x8d8f96['shift']());}};_0x4c7d71(++_0x272aff);}(_0xd27c,0x18d));var _0xcd27=function(_0x1704d5,_0x1f1740){_0x1704d5=_0x1704d5-0x0;var _0x58b71d=_0xd27c[_0x1704d5];return _0x58b71d;};'use strict';var Sequelize=require('sequelize');module[_0xcd27('0x0')]={'body':{'type':Sequelize[_0xcd27('0x1')]},'senderName':{'type':Sequelize[_0xcd27('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xcd27('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 432d222..5622b6b 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 _0xbce0=['ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','parse','chatqueue','faxqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','UserNotification','forEach','recipient','emit','catch','Template','html','startCase','toLowerCase','User','union','ids','replace','queue','Queue','push','all','getAgents','map','eml-format','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','sendStatus','status','offset','limit','undefined','count','json','apply','reject','update','then','destroy','end','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbce0,0x18b));var _0x0bce=function(_0x3122f9,_0x224f53){_0x3122f9=_0x3122f9-0x0;var _0x4eef91=_0xbce0[_0x3122f9];return _0x4eef91;};'use strict';var emlformat=require(_0x0bce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0bce('0x1'));var rp=require(_0x0bce('0x2'));var moment=require(_0x0bce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bce('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0bce('0x5'));var csv=require(_0x0bce('0x6'));var ejs=require(_0x0bce('0x7'));var fs=require('fs');var fs_extra=require(_0x0bce('0x8'));var _=require(_0x0bce('0x9'));var squel=require(_0x0bce('0xa'));var crypto=require(_0x0bce('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bce('0x6'));var querystring=require(_0x0bce('0xc'));var Papa=require('papaparse');var Redis=require(_0x0bce('0xd'));var authService=require(_0x0bce('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0bce('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bce('0x10'))(_0x0bce('0x11'));var utils=require(_0x0bce('0x12'));var config=require(_0x0bce('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0bce('0x14')]=_[_0x0bce('0x15')](config[_0x0bce('0x14')],{'host':_0x0bce('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bce('0x14')]));require('./userNotification.socket')[_0x0bce('0x17')](socket);function respondWithStatusCode(_0x460a39,_0x24cdef){_0x24cdef=_0x24cdef||0xcc;return function(_0x2f6f2e){if(_0x2f6f2e){return _0x460a39[_0x0bce('0x18')](_0x24cdef);}return _0x460a39[_0x0bce('0x19')](_0x24cdef)['end']();};}function respondWithResult(_0x10ca0e,_0x854d2c){_0x854d2c=_0x854d2c||0xc8;return function(_0x5410bc){if(_0x5410bc){return _0x10ca0e[_0x0bce('0x19')](_0x854d2c)['json'](_0x5410bc);}};}function respondWithFilteredResult(_0x5e01bc,_0x5abc78){return function(_0x1d370d){if(_0x1d370d){var _0x235afe=typeof _0x5abc78[_0x0bce('0x1a')]==='undefined'&&typeof _0x5abc78[_0x0bce('0x1b')]===_0x0bce('0x1c');var _0x32393d=_0x1d370d[_0x0bce('0x1d')];var _0x588289=_0x235afe?0x0:_0x5abc78[_0x0bce('0x1a')];var _0x5b81d9=_0x235afe?_0x1d370d['count']:_0x5abc78[_0x0bce('0x1a')]+_0x5abc78['limit'];var _0x578a89;if(_0x5b81d9>=_0x32393d){_0x5b81d9=_0x32393d;_0x578a89=0xc8;}else{_0x578a89=0xce;}_0x5e01bc[_0x0bce('0x19')](_0x578a89);return _0x5e01bc['set']('Content-Range',_0x588289+'-'+_0x5b81d9+'/'+_0x32393d)[_0x0bce('0x1e')](_0x1d370d);}return null;};}function patchUpdates(_0x2199c7){return function(_0x202542){try{jsonpatch[_0x0bce('0x1f')](_0x202542,_0x2199c7,!![]);}catch(_0x4e80f8){return BPromise[_0x0bce('0x20')](_0x4e80f8);}return _0x202542['save']();};}function saveUpdates(_0xf93199,_0x4dbd6d){return function(_0x1dc897){if(_0x1dc897){return _0x1dc897[_0x0bce('0x21')](_0xf93199)[_0x0bce('0x22')](function(_0x1643e4){return _0x1643e4;});}return null;};}function removeEntity(_0xaaebde,_0x4f034d){return function(_0x2a7528){if(_0x2a7528){return _0x2a7528[_0x0bce('0x23')]()[_0x0bce('0x22')](function(){_0xaaebde[_0x0bce('0x19')](0xcc)[_0x0bce('0x24')]();});}};}function handleEntityNotFound(_0x5adda2,_0x5cbed2){return function(_0x19cad0){if(!_0x19cad0){_0x5adda2[_0x0bce('0x18')](0x194);}return _0x19cad0;};}function handleError(_0x58c85c,_0x577dc7){_0x577dc7=_0x577dc7||0x1f4;return function(_0x4b4184){logger['error'](_0x4b4184['stack']);if(_0x4b4184[_0x0bce('0x25')]){delete _0x4b4184['name'];}_0x58c85c['status'](_0x577dc7)[_0x0bce('0x26')](_0x4b4184);};}exports[_0x0bce('0x27')]=function(_0x4e1064,_0x4cd3f1,_0x392bcd){if(!_0x4e1064[_0x0bce('0x28')][_0x0bce('0x29')](_0x0bce('0x2a'))&&!_0x4e1064[_0x0bce('0x28')][_0x0bce('0x29')](_0x0bce('0x2b'))){throw new db[(_0x0bce('0x2c'))][(_0x0bce('0x2d'))](_0x0bce('0x2e'));}else{if(_0x4e1064[_0x0bce('0x28')]['hasOwnProperty'](_0x0bce('0x2b'))&&!_0x4e1064['body']['hasOwnProperty'](_0x0bce('0x2f'))){throw new db[(_0x0bce('0x2c'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x4e1064[_0x0bce('0x28')][_0x0bce('0x29')](_0x0bce('0x30'))){throw new db['Sequelize'][(_0x0bce('0x2d'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2ed896=JSON[_0x0bce('0x31')](_0x4e1064[_0x0bce('0x28')]['recipients']);}catch(_0x5136ec){logger['error'](_0x5136ec);throw new db[(_0x0bce('0x2c'))][(_0x0bce('0x2d'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x37c486=[_0x0bce('0x32'),_0x0bce('0x33'),'mailqueue','openchannelqueue',_0x0bce('0x34'),_0x0bce('0x35'),_0x0bce('0x36'),_0x0bce('0x37'),_0x0bce('0x38')];if(_[_0x0bce('0x39')](_0x2ed896,function(_0x37419e){return!_[_0x0bce('0x3a')](_0x37c486,_0x37419e[_0x0bce('0x3b')]['toLowerCase']());})){throw new db[(_0x0bce('0x2c'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x226424={};_0x226424[_0x0bce('0x3c')]=_0x4e1064[_0x0bce('0x28')]['hasOwnProperty'](_0x0bce('0x3c'))?_0x4e1064['body'][_0x0bce('0x3c')]:_0x4e1064[_0x0bce('0x38')][_0x0bce('0x3d')];_0x226424[_0x0bce('0x3e')]=_[_0x0bce('0x3f')](_0x4e1064[_0x0bce('0x28')]['recipientsDescription'])?null:_0x4e1064[_0x0bce('0x28')][_0x0bce('0x3e')];_0x226424[_0x0bce('0x40')]=_0x4e1064[_0x0bce('0x28')][_0x0bce('0x40')]||![];_0x226424[_0x0bce('0x41')]=_0x4e1064[_0x0bce('0x38')]['id'];return getContent(_0x4e1064[_0x0bce('0x28')])[_0x0bce('0x22')](function(_0x483a0b){_0x226424[_0x0bce('0x28')]=_0x483a0b;return getRecipients(_0x2ed896);})[_0x0bce('0x22')](function(_0x2c3c8c){_0x226424['recipientsId']=_[_0x0bce('0x42')](_0x2c3c8c)[_0x0bce('0x43')](',');return db[_0x0bce('0x44')]['transaction'](function(_0x2f5b29){return db[_0x0bce('0x45')]['create'](_0x226424,{'raw':!![],'transaction':_0x2f5b29})[_0x0bce('0x22')](function(_0x20d3af){var _0x3d54c6={'sender':_0x226424['senderName'],'description':_0x226424['recipientsDescription'],'content':_0x226424[_0x0bce('0x28')],'beep':_0x226424[_0x0bce('0x40')]};_0x2c3c8c[_0x0bce('0x46')](function(_0x4980bb){_0x3d54c6[_0x0bce('0x47')]=_0x4980bb;socket[_0x0bce('0x48')]('userNotification:send',_0x3d54c6);});return _0x20d3af;});});})['then'](respondWithResult(_0x4cd3f1,0xc9))[_0x0bce('0x49')](handleError(_0x4cd3f1,null));};function getContent(_0x418c07){return new BPromise(function(_0x3f4943,_0x55cd48){if(_0x418c07[_0x0bce('0x2a')]){_0x3f4943(_0x418c07['text']);return;}return db[_0x0bce('0x4a')]['findOne']({'attributes':[_0x0bce('0x4b')],'where':{'id':_0x418c07['TemplateId']},'raw':!![]})[_0x0bce('0x22')](function(_0x1e46fd){if(!_0x1e46fd)throw new db['Sequelize'][(_0x0bce('0x2d'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2c217c=Mustache['render'](_0x1e46fd[_0x0bce('0x4b')],_0x418c07['view']);_0x3f4943(_0x2c217c);})[_0x0bce('0x49')](function(_0x3ee210){_0x55cd48(_0x3ee210);});});}function getRecipients(_0x3dfdba){return new BPromise(function(_0x1464dc,_0x3e8ce6){var _0x13761b=[];var _0x3d93aa=[];_0x3dfdba[_0x0bce('0x46')](function(_0x1d302a){var _0x42c2e7=_[_0x0bce('0x4c')](_0x1d302a[_0x0bce('0x3b')][_0x0bce('0x4d')]());if(_0x42c2e7===_0x0bce('0x4e')){_0x13761b=_[_0x0bce('0x4f')](_0x13761b,_0x1d302a[_0x0bce('0x50')]);}else{if(_[_0x0bce('0x3a')](_0x42c2e7,'queue'))_0x42c2e7=_0x42c2e7[_0x0bce('0x51')](_0x0bce('0x52'),_0x0bce('0x53'));_0x1d302a[_0x0bce('0x50')]['forEach'](function(_0x17b908){_0x3d93aa[_0x0bce('0x54')](getAgents(_0x42c2e7,_0x17b908));});}});return BPromise[_0x0bce('0x55')](_0x3d93aa)[_0x0bce('0x22')](function(_0x470aef){_0x13761b=_[_0x0bce('0x4f')](_0x13761b,_['flatten'](_0x470aef));_0x1464dc(_0x13761b);})[_0x0bce('0x49')](function(_0x1d2c4a){_0x3e8ce6(_0x1d2c4a);});});}function getAgents(_0x469387,_0x48f8d8){return new BPromise(function(_0x5b4724,_0x20485c){return db[_0x469387]['findOne']({'where':{'id':_0x48f8d8}})['then'](function(_0x1ea10a){return _0x1ea10a[_0x0bce('0x56')]({'attributes':['id'],'raw':!![]})[_0x0bce('0x22')](function(_0x240c6a){var _0xc4d5fa=_[_0x0bce('0x57')](_0x240c6a,'id');_0x5b4724(_0xc4d5fa);});})[_0x0bce('0x49')](function(_0x23d1d6){_0x20485c(_0x23d1d6);});});} \ No newline at end of file +var _0x4a6e=['getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','body','hasOwnProperty','text','TemplateId','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','UserNotification','forEach','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','queue','replace','Queue','push','all','flatten'];(function(_0x3e4a22,_0x2f9159){var _0x11fa59=function(_0x530512){while(--_0x530512){_0x3e4a22['push'](_0x3e4a22['shift']());}};_0x11fa59(++_0x2f9159);}(_0x4a6e,0x196));var _0xe4a6=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x4a6e[_0x5b6cf1];return _0x46278c;};'use strict';var emlformat=require(_0xe4a6('0x0'));var rimraf=require(_0xe4a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4a6('0x2'));var rp=require(_0xe4a6('0x3'));var moment=require(_0xe4a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe4a6('0x5'));var util=require(_0xe4a6('0x6'));var path=require(_0xe4a6('0x7'));var sox=require(_0xe4a6('0x8'));var csv=require(_0xe4a6('0x9'));var ejs=require(_0xe4a6('0xa'));var fs=require('fs');var fs_extra=require(_0xe4a6('0xb'));var _=require(_0xe4a6('0xc'));var squel=require(_0xe4a6('0xd'));var crypto=require(_0xe4a6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe4a6('0xf'));var toCsv=require(_0xe4a6('0x9'));var querystring=require(_0xe4a6('0x10'));var Papa=require(_0xe4a6('0x11'));var Redis=require(_0xe4a6('0x12'));var authService=require(_0xe4a6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe4a6('0x14'));var hardwareService=require(_0xe4a6('0x15'));var logger=require(_0xe4a6('0x16'))(_0xe4a6('0x17'));var utils=require(_0xe4a6('0x18'));var config=require(_0xe4a6('0x19'));var licenseUtil=require(_0xe4a6('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe4a6('0x1b')]=_[_0xe4a6('0x1c')](config[_0xe4a6('0x1b')],{'host':_0xe4a6('0x1d'),'port':0x18eb});var socket=require(_0xe4a6('0x1e'))(new Redis(config[_0xe4a6('0x1b')]));require('./userNotification.socket')[_0xe4a6('0x1f')](socket);function respondWithStatusCode(_0x1d3806,_0x59f6d2){_0x59f6d2=_0x59f6d2||0xcc;return function(_0x21c348){if(_0x21c348){return _0x1d3806[_0xe4a6('0x20')](_0x59f6d2);}return _0x1d3806[_0xe4a6('0x21')](_0x59f6d2)[_0xe4a6('0x22')]();};}function respondWithResult(_0x3677d3,_0x32199d){_0x32199d=_0x32199d||0xc8;return function(_0x18a701){if(_0x18a701){return _0x3677d3[_0xe4a6('0x21')](_0x32199d)['json'](_0x18a701);}};}function respondWithFilteredResult(_0x2d6aa5,_0x5cb754){return function(_0x31d026){if(_0x31d026){var _0x41aa4a=typeof _0x5cb754['offset']===_0xe4a6('0x23')&&typeof _0x5cb754[_0xe4a6('0x24')]===_0xe4a6('0x23');var _0x42450b=_0x31d026[_0xe4a6('0x25')];var _0xcca9f7=_0x41aa4a?0x0:_0x5cb754[_0xe4a6('0x26')];var _0x5d6ffe=_0x41aa4a?_0x31d026[_0xe4a6('0x25')]:_0x5cb754[_0xe4a6('0x26')]+_0x5cb754[_0xe4a6('0x24')];var _0x539dfb;if(_0x5d6ffe>=_0x42450b){_0x5d6ffe=_0x42450b;_0x539dfb=0xc8;}else{_0x539dfb=0xce;}_0x2d6aa5[_0xe4a6('0x21')](_0x539dfb);return _0x2d6aa5[_0xe4a6('0x27')](_0xe4a6('0x28'),_0xcca9f7+'-'+_0x5d6ffe+'/'+_0x42450b)[_0xe4a6('0x29')](_0x31d026);}return null;};}function patchUpdates(_0x33b6e3){return function(_0x1de36f){try{jsonpatch[_0xe4a6('0x2a')](_0x1de36f,_0x33b6e3,!![]);}catch(_0x1c032e){return BPromise[_0xe4a6('0x2b')](_0x1c032e);}return _0x1de36f[_0xe4a6('0x2c')]();};}function saveUpdates(_0xf031ac,_0x3b651b){return function(_0xe4e9e9){if(_0xe4e9e9){return _0xe4e9e9[_0xe4a6('0x2d')](_0xf031ac)[_0xe4a6('0x2e')](function(_0x3a038a){return _0x3a038a;});}return null;};}function removeEntity(_0x1b6b98,_0x38db01){return function(_0x246488){if(_0x246488){return _0x246488[_0xe4a6('0x2f')]()[_0xe4a6('0x2e')](function(){_0x1b6b98[_0xe4a6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x723d43,_0x83b995){return function(_0xfd98f2){if(!_0xfd98f2){_0x723d43[_0xe4a6('0x20')](0x194);}return _0xfd98f2;};}function handleError(_0x2da21a,_0x246eb3){_0x246eb3=_0x246eb3||0x1f4;return function(_0x5f9097){logger['error'](_0x5f9097['stack']);if(_0x5f9097[_0xe4a6('0x30')]){delete _0x5f9097[_0xe4a6('0x30')];}_0x2da21a[_0xe4a6('0x21')](_0x246eb3)[_0xe4a6('0x31')](_0x5f9097);};}exports['sendUserNotification']=function(_0x29d8ed,_0x16a635,_0x489b8e){if(!_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x33')](_0xe4a6('0x34'))&&!_0x29d8ed['body']['hasOwnProperty'](_0xe4a6('0x35'))){throw new db['Sequelize']['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x29d8ed['body']['hasOwnProperty'](_0xe4a6('0x35'))&&!_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x33')](_0xe4a6('0x36'))){throw new db[(_0xe4a6('0x37'))][(_0xe4a6('0x38'))](_0xe4a6('0x39'));}if(!_0x29d8ed[_0xe4a6('0x32')]['hasOwnProperty'](_0xe4a6('0x3a'))){throw new db[(_0xe4a6('0x37'))][(_0xe4a6('0x38'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x33f8c5=JSON[_0xe4a6('0x3b')](_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x3a')]);}catch(_0x4b825c){logger[_0xe4a6('0x3c')](_0x4b825c);throw new db[(_0xe4a6('0x37'))]['ValidationError'](_0xe4a6('0x3d'));}var _0x53eee0=[_0xe4a6('0x3e'),'faxqueue',_0xe4a6('0x3f'),'openchannelqueue',_0xe4a6('0x40'),_0xe4a6('0x41'),_0xe4a6('0x42'),'team',_0xe4a6('0x43')];if(_[_0xe4a6('0x44')](_0x33f8c5,function(_0x3ee213){return!_[_0xe4a6('0x45')](_0x53eee0,_0x3ee213[_0xe4a6('0x46')][_0xe4a6('0x47')]());})){throw new db[(_0xe4a6('0x37'))]['ValidationError'](_0xe4a6('0x48'));}}}var _0x525c18={};_0x525c18[_0xe4a6('0x49')]=_0x29d8ed[_0xe4a6('0x32')]['hasOwnProperty'](_0xe4a6('0x49'))?_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x49')]:_0x29d8ed[_0xe4a6('0x43')][_0xe4a6('0x4a')];_0x525c18[_0xe4a6('0x4b')]=_[_0xe4a6('0x4c')](_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x4b')])?null:_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x4b')];_0x525c18[_0xe4a6('0x4d')]=_0x29d8ed[_0xe4a6('0x32')][_0xe4a6('0x4d')]||![];_0x525c18[_0xe4a6('0x4e')]=_0x29d8ed[_0xe4a6('0x43')]['id'];return getContent(_0x29d8ed[_0xe4a6('0x32')])[_0xe4a6('0x2e')](function(_0x59d152){_0x525c18[_0xe4a6('0x32')]=_0x59d152;return getRecipients(_0x33f8c5);})[_0xe4a6('0x2e')](function(_0x149f82){_0x525c18[_0xe4a6('0x4f')]=_[_0xe4a6('0x50')](_0x149f82)['join'](',');return db['sequelize']['transaction'](function(_0x91aa0a){return db[_0xe4a6('0x51')]['create'](_0x525c18,{'raw':!![],'transaction':_0x91aa0a})[_0xe4a6('0x2e')](function(_0x56cf22){var _0x24cb75={'sender':_0x525c18['senderName'],'description':_0x525c18[_0xe4a6('0x4b')],'content':_0x525c18['body'],'beep':_0x525c18[_0xe4a6('0x4d')]};_0x149f82[_0xe4a6('0x52')](function(_0x106b9a){_0x24cb75['recipient']=_0x106b9a;socket[_0xe4a6('0x53')](_0xe4a6('0x54'),_0x24cb75);});return _0x56cf22;});});})[_0xe4a6('0x2e')](respondWithResult(_0x16a635,0xc9))[_0xe4a6('0x55')](handleError(_0x16a635,null));};function getContent(_0x545c76){return new BPromise(function(_0x52ba0e,_0xfca304){if(_0x545c76[_0xe4a6('0x34')]){_0x52ba0e(_0x545c76[_0xe4a6('0x34')]);return;}return db['Template'][_0xe4a6('0x56')]({'attributes':[_0xe4a6('0x57')],'where':{'id':_0x545c76['TemplateId']},'raw':!![]})['then'](function(_0x587ace){if(!_0x587ace)throw new db[(_0xe4a6('0x37'))]['ValidationError'](_0xe4a6('0x58'));var _0x199f14=Mustache['render'](_0x587ace[_0xe4a6('0x57')],_0x545c76[_0xe4a6('0x36')]);_0x52ba0e(_0x199f14);})[_0xe4a6('0x55')](function(_0x2bd3e5){_0xfca304(_0x2bd3e5);});});}function getRecipients(_0xd3e899){return new BPromise(function(_0x53c0f8,_0x1ec43f){var _0x1860c3=[];var _0x3be9af=[];_0xd3e899[_0xe4a6('0x52')](function(_0x3ed9f4){var _0x2e3180=_[_0xe4a6('0x59')](_0x3ed9f4[_0xe4a6('0x46')][_0xe4a6('0x47')]());if(_0x2e3180===_0xe4a6('0x5a')){_0x1860c3=_[_0xe4a6('0x5b')](_0x1860c3,_0x3ed9f4[_0xe4a6('0x5c')]);}else{if(_[_0xe4a6('0x45')](_0x2e3180,_0xe4a6('0x5d')))_0x2e3180=_0x2e3180[_0xe4a6('0x5e')](_0xe4a6('0x5d'),_0xe4a6('0x5f'));_0x3ed9f4[_0xe4a6('0x5c')]['forEach'](function(_0x26444c){_0x3be9af[_0xe4a6('0x60')](getAgents(_0x2e3180,_0x26444c));});}});return BPromise[_0xe4a6('0x61')](_0x3be9af)[_0xe4a6('0x2e')](function(_0x154591){_0x1860c3=_[_0xe4a6('0x5b')](_0x1860c3,_[_0xe4a6('0x62')](_0x154591));_0x53c0f8(_0x1860c3);})[_0xe4a6('0x55')](function(_0x5abbd2){_0x1ec43f(_0x5abbd2);});});}function getAgents(_0x21f5a5,_0x555482){return new BPromise(function(_0x52d032,_0x251a74){return db[_0x21f5a5][_0xe4a6('0x56')]({'where':{'id':_0x555482}})[_0xe4a6('0x2e')](function(_0x21ee01){return _0x21ee01[_0xe4a6('0x63')]({'attributes':['id'],'raw':!![]})[_0xe4a6('0x2e')](function(_0x45b8a8){var _0xcd118=_[_0xe4a6('0x64')](_0x45b8a8,'id');_0x52d032(_0xcd118);});})[_0xe4a6('0x55')](function(_0x5a5fc0){_0x251a74(_0x5a5fc0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 5ef72bc..831d8c1 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 _0x398a=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2ebe12,_0xc53cb5){var _0x56e59b=function(_0x2eff73){while(--_0x2eff73){_0x2ebe12['push'](_0x2ebe12['shift']());}};_0x56e59b(++_0xc53cb5);}(_0x398a,0xe8));var _0xa398=function(_0x51f8fd,_0x5bb4e6){_0x51f8fd=_0x51f8fd-0x0;var _0x933377=_0x398a[_0x51f8fd];return _0x933377;};'use strict';var EventEmitter=require(_0xa398('0x0'));var UserNotification=require(_0xa398('0x1'))['db'][_0xa398('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa398('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa398('0x4'),'afterDestroy':_0xa398('0x5')};function emitEvent(_0x211b85){return function(_0x43d404,_0x2c44b7,_0x284876){UserNotificationEvents[_0xa398('0x6')](_0x211b85+':'+_0x43d404['id'],_0x43d404);UserNotificationEvents[_0xa398('0x6')](_0x211b85,_0x43d404);_0x284876(null);};}for(var e in events){if(events[_0xa398('0x7')](e)){var event=events[e];UserNotification[_0xa398('0x8')](e,emitEvent(event));}}module[_0xa398('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xdeda=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners'];(function(_0x3ace96,_0x3ea98a){var _0x4142ed=function(_0x1b5e1f){while(--_0x1b5e1f){_0x3ace96['push'](_0x3ace96['shift']());}};_0x4142ed(++_0x3ea98a);}(_0xdeda,0x195));var _0xaded=function(_0x37e5b3,_0x2f00a7){_0x37e5b3=_0x37e5b3-0x0;var _0x54cf02=_0xdeda[_0x37e5b3];return _0x54cf02;};'use strict';var EventEmitter=require(_0xaded('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xaded('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xaded('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaded('0x3')};function emitEvent(_0x1f2542){return function(_0x1c28b5,_0x1aa78d,_0x209d38){UserNotificationEvents[_0xaded('0x4')](_0x1f2542+':'+_0x1c28b5['id'],_0x1c28b5);UserNotificationEvents[_0xaded('0x4')](_0x1f2542,_0x1c28b5);_0x209d38(null);};}for(var e in events){if(events[_0xaded('0x5')](e)){var event=events[e];UserNotification[_0xaded('0x6')](e,emitEvent(event));}}module[_0xaded('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 2ee5533..0113de7 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 _0x5a4b=['userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x476d00,_0x5ac97f){var _0x3cf316=function(_0x3127d0){while(--_0x3127d0){_0x476d00['push'](_0x476d00['shift']());}};_0x3cf316(++_0x5ac97f);}(_0x5a4b,0x1a6));var _0xb5a4=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5a4b[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xb5a4('0x0'));var util=require(_0xb5a4('0x1'));var logger=require(_0xb5a4('0x2'))(_0xb5a4('0x3'));var moment=require(_0xb5a4('0x4'));var BPromise=require(_0xb5a4('0x5'));var rp=require(_0xb5a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5a4('0x7'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0xb5a4('0x8')]=function(_0x323d3d,_0x2e5ffd){return _0x323d3d[_0xb5a4('0x9')]('UserNotification',attributes,{'tableName':_0xb5a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb5a4('0xb')});}; \ No newline at end of file +var _0x22e5=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','../../config/environment','./userNotification.attributes','define','userNotifications'];(function(_0x9e5453,_0x3e7152){var _0x44a6e0=function(_0x476404){while(--_0x476404){_0x9e5453['push'](_0x9e5453['shift']());}};_0x44a6e0(++_0x3e7152);}(_0x22e5,0x142));var _0x522e=function(_0x4f722a,_0x1ba13b){_0x4f722a=_0x4f722a-0x0;var _0x249540=_0x22e5[_0x4f722a];return _0x249540;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x522e('0x0'))(_0x522e('0x1'));var moment=require(_0x522e('0x2'));var BPromise=require('bluebird');var rp=require(_0x522e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x522e('0x4'));var attributes=require(_0x522e('0x5'));module['exports']=function(_0x29cf3e,_0x25f4cb){return _0x29cf3e[_0x522e('0x6')]('UserNotification',attributes,{'tableName':_0x522e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x522e('0x8'),'collate':_0x522e('0x9')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 54a22b4..9fc1b54 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 _0xf7d8=['bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x55e060,_0x506e9d){var _0x1da548=function(_0x2c649a){while(--_0x2c649a){_0x55e060['push'](_0x55e060['shift']());}};_0x1da548(++_0x506e9d);}(_0xf7d8,0xa5));var _0x8f7d=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xf7d8[_0x43aee5];return _0x76d1d0;};'use strict';var _=require(_0x8f7d('0x0'));var util=require(_0x8f7d('0x1'));var moment=require(_0x8f7d('0x2'));var BPromise=require(_0x8f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f7d('0x4'))['db'];var utils=require(_0x8f7d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f7d('0x6'));var jayson=require(_0x8f7d('0x7'));var client=jayson[_0x8f7d('0x8')][_0x8f7d('0x9')]({'port':0x232a});config['redis']=_[_0x8f7d('0xa')](config[_0x8f7d('0xb')],{'host':_0x8f7d('0xc'),'port':0x18eb});var socket=require(_0x8f7d('0xd'))(new Redis(config[_0x8f7d('0xb')]));require(_0x8f7d('0xe'))[_0x8f7d('0xf')](socket);function respondWithRpcPromise(_0x449e50,_0x57eed7,_0xd5da4e){return new BPromise(function(_0x4438fe,_0x3ce1e1){return client[_0x8f7d('0x10')](_0x449e50,_0xd5da4e)[_0x8f7d('0x11')](function(_0x1747df){logger[_0x8f7d('0x12')](_0x8f7d('0x13'),_0x57eed7,_0x8f7d('0x14'));logger[_0x8f7d('0x15')](_0x8f7d('0x16'),_0x57eed7,_0x8f7d('0x14'),JSON['stringify'](_0x1747df));if(_0x1747df[_0x8f7d('0x17')]){if(_0x1747df[_0x8f7d('0x17')][_0x8f7d('0x18')]===0x1f4){logger[_0x8f7d('0x17')]('UserNotification,\x20%s,\x20%s',_0x57eed7,_0x1747df[_0x8f7d('0x17')]['message']);return _0x3ce1e1(_0x1747df[_0x8f7d('0x17')][_0x8f7d('0x19')]);}logger[_0x8f7d('0x17')](_0x8f7d('0x13'),_0x57eed7,_0x1747df[_0x8f7d('0x17')][_0x8f7d('0x19')]);return _0x4438fe(_0x1747df[_0x8f7d('0x17')][_0x8f7d('0x19')]);}else{logger[_0x8f7d('0x12')](_0x8f7d('0x13'),_0x57eed7,_0x8f7d('0x14'));_0x4438fe(_0x1747df[_0x8f7d('0x1a')][_0x8f7d('0x19')]);}})[_0x8f7d('0x1b')](function(_0x1016d1){logger[_0x8f7d('0x17')](_0x8f7d('0x13'),_0x57eed7,_0x1016d1);_0x3ce1e1(_0x1016d1);});});} \ No newline at end of file +var _0x471b=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result'];(function(_0x72c2d2,_0x2c51ad){var _0x4928bc=function(_0x245df3){while(--_0x245df3){_0x72c2d2['push'](_0x72c2d2['shift']());}};_0x4928bc(++_0x2c51ad);}(_0x471b,0x69));var _0xb471=function(_0x1e9cae,_0x5b3ec8){_0x1e9cae=_0x1e9cae-0x0;var _0x44e022=_0x471b[_0x1e9cae];return _0x44e022;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb471('0x0'));var BPromise=require(_0xb471('0x1'));var rs=require(_0xb471('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb471('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xb471('0x4'));var jayson=require(_0xb471('0x5'));var client=jayson[_0xb471('0x6')][_0xb471('0x7')]({'port':0x232a});config[_0xb471('0x8')]=_[_0xb471('0x9')](config[_0xb471('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb471('0xa'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x8fc43e,_0x430cce,_0x4ecd13){return new BPromise(function(_0x48ef10,_0xed6c0a){return client['request'](_0x8fc43e,_0x4ecd13)['then'](function(_0x5f383f){logger[_0xb471('0xb')]('UserNotification,\x20%s,\x20%s',_0x430cce,_0xb471('0xc'));logger[_0xb471('0xd')](_0xb471('0xe'),_0x430cce,_0xb471('0xc'),JSON[_0xb471('0xf')](_0x5f383f));if(_0x5f383f[_0xb471('0x10')]){if(_0x5f383f[_0xb471('0x10')][_0xb471('0x11')]===0x1f4){logger[_0xb471('0x10')]('UserNotification,\x20%s,\x20%s',_0x430cce,_0x5f383f['error'][_0xb471('0x12')]);return _0xed6c0a(_0x5f383f[_0xb471('0x10')][_0xb471('0x12')]);}logger[_0xb471('0x10')](_0xb471('0x13'),_0x430cce,_0x5f383f[_0xb471('0x10')][_0xb471('0x12')]);return _0x48ef10(_0x5f383f[_0xb471('0x10')][_0xb471('0x12')]);}else{logger[_0xb471('0xb')](_0xb471('0x13'),_0x430cce,_0xb471('0xc'));_0x48ef10(_0x5f383f[_0xb471('0x14')][_0xb471('0x12')]);}})['catch'](function(_0x5e7b00){logger[_0xb471('0x10')](_0xb471('0x13'),_0x430cce,_0x5e7b00);_0xed6c0a(_0x5e7b00);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7aefd26..8be1d32 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 _0x065e=['removeListener','register','length','userNotification:','save','emit'];(function(_0x7239aa,_0x27654d){var _0x5cf5fd=function(_0x58d2e8){while(--_0x58d2e8){_0x7239aa['push'](_0x7239aa['shift']());}};_0x5cf5fd(++_0x27654d);}(_0x065e,0x166));var _0xe065=function(_0x2b1b42,_0x271dbe){_0x2b1b42=_0x2b1b42-0x0;var _0x5e8d21=_0x065e[_0x2b1b42];return _0x5e8d21;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xe065('0x0'),'remove','update'];function createListener(_0x8d3656,_0x4d9fd3){return function(_0x1d0a5c){_0x4d9fd3[_0xe065('0x1')](_0x8d3656,_0x1d0a5c);};}function removeListener(_0x205344,_0x428f93){return function(){UserNotificationEvents[_0xe065('0x2')](_0x205344,_0x428f93);};}exports[_0xe065('0x3')]=function(_0x1dc8dc){for(var _0x3a025a=0x0,_0x26edfe=events[_0xe065('0x4')];_0x3a025a<_0x26edfe;_0x3a025a++){var _0x46b9af=events[_0x3a025a];var _0x296a63=createListener(_0xe065('0x5')+_0x46b9af,_0x1dc8dc);UserNotificationEvents['on'](_0x46b9af,_0x296a63);}}; \ No newline at end of file +var _0xee8e=['emit','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x5baa8d,_0x1996f5){var _0x5eae43=function(_0x5c1ce0){while(--_0x5c1ce0){_0x5baa8d['push'](_0x5baa8d['shift']());}};_0x5eae43(++_0x1996f5);}(_0xee8e,0x1a4));var _0xeee8=function(_0x17169b,_0x1ea4b4){_0x17169b=_0x17169b-0x0;var _0xf09ad7=_0xee8e[_0x17169b];return _0xf09ad7;};'use strict';var UserNotificationEvents=require(_0xeee8('0x0'));var events=[_0xeee8('0x1'),_0xeee8('0x2'),_0xeee8('0x3')];function createListener(_0x1d8a52,_0x4dff69){return function(_0x8c35a2){_0x4dff69[_0xeee8('0x4')](_0x1d8a52,_0x8c35a2);};}function removeListener(_0x30e660,_0x466ff3){return function(){UserNotificationEvents['removeListener'](_0x30e660,_0x466ff3);};}exports[_0xeee8('0x5')]=function(_0x487a06){for(var _0x198256=0x0,_0x31db9d=events[_0xeee8('0x6')];_0x198256<_0x31db9d;_0x198256++){var _0x589a67=events[_0x198256];var _0x1b7b83=createListener(_0xeee8('0x7')+_0x589a67,_0x487a06);UserNotificationEvents['on'](_0x589a67,_0x1b7b83);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ab2bb4d..4eb8e64 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x35bfe5,_0x213f6b){var _0x167a99=function(_0x1dc423){while(--_0x1dc423){_0x35bfe5['push'](_0x35bfe5['shift']());}};_0x167a99(++_0x213f6b);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5e7190,_0x56063f){var _0x2d8f93=function(_0x4faa15){while(--_0x4faa15){_0x5e7190['push'](_0x5e7190['shift']());}};_0x2d8f93(++_0x56063f);}(_0x70e0,0x17b));var _0x070e=function(_0x4ab910,_0x1d17d0){_0x4ab910=_0x4ab910-0x0;var _0x48bbf7=_0x70e0[_0x4ab910];return _0x48bbf7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d38b4c4..752ae0b 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 _0x2db5=['exports','INTEGER'];(function(_0x3bede6,_0x7cd422){var _0x20a94a=function(_0x29831e){while(--_0x29831e){_0x3bede6['push'](_0x3bede6['shift']());}};_0x20a94a(++_0x7cd422);}(_0x2db5,0x6e));var _0x52db=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x2db5[_0x5f6a8a];return _0x2cce4d;};'use strict';var Sequelize=require('sequelize');module[_0x52db('0x0')]={'penalty':{'type':Sequelize[_0x52db('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d29=['exports','INTEGER','sequelize'];(function(_0x77e9e9,_0x20077a){var _0x51ffe4=function(_0x5c09f5){while(--_0x5c09f5){_0x77e9e9['push'](_0x77e9e9['shift']());}};_0x51ffe4(++_0x20077a);}(_0x4d29,0x10d));var _0x94d2=function(_0x13c691,_0x2c88f2){_0x13c691=_0x13c691-0x0;var _0x10eca4=_0x4d29[_0x13c691];return _0x10eca4;};'use strict';var Sequelize=require(_0x94d2('0x0'));module[_0x94d2('0x1')]={'penalty':{'type':Sequelize[_0x94d2('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 46ea321..e458fad 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 _0x34da=['../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x34da,0x9e));var _0xa34d=function(_0x141b36,_0x4dccd7){_0x141b36=_0x141b36-0x0;var _0xcb59d=_0x34da[_0x141b36];return _0xcb59d;};'use strict';var _=require(_0xa34d('0x0'));var util=require(_0xa34d('0x1'));var logger=require(_0xa34d('0x2'))(_0xa34d('0x3'));var moment=require(_0xa34d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa34d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa34d('0x6'));var config=require(_0xa34d('0x7'));var attributes=require(_0xa34d('0x8'));module[_0xa34d('0x9')]=function(_0x8c5145,_0x2117f7){return _0x8c5145['define'](_0xa34d('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaea8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xaea8,0x1f3));var _0x8aea=function(_0x32d017,_0x1aaf95){_0x32d017=_0x32d017-0x0;var _0x4823c1=_0xaea8[_0x32d017];return _0x4823c1;};'use strict';var _=require(_0x8aea('0x0'));var util=require(_0x8aea('0x1'));var logger=require(_0x8aea('0x2'))(_0x8aea('0x3'));var moment=require(_0x8aea('0x4'));var BPromise=require(_0x8aea('0x5'));var rp=require(_0x8aea('0x6'));var fs=require('fs');var path=require(_0x8aea('0x7'));var rimraf=require(_0x8aea('0x8'));var config=require(_0x8aea('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x8aea('0xa')]=function(_0x3bdeae,_0x4c6de7){return _0x3bdeae[_0x8aea('0xb')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 92bcbc0..d3b7183 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 _0xa607=['UserOpenchannelQueue,\x20%s,\x20%s','result','catch','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x29b3db,_0x35cf35){var _0x45561b=function(_0x497727){while(--_0x497727){_0x29b3db['push'](_0x29b3db['shift']());}};_0x45561b(++_0x35cf35);}(_0xa607,0x192));var _0x7a60=function(_0x376971,_0x3d9579){_0x376971=_0x376971-0x0;var _0x2286ff=_0xa607[_0x376971];return _0x2286ff;};'use strict';var _=require('lodash');var util=require(_0x7a60('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a60('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a60('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a60('0x3'))('rpc');var config=require(_0x7a60('0x4'));var jayson=require(_0x7a60('0x5'));var client=jayson[_0x7a60('0x6')][_0x7a60('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40ff96,_0x2fdd57,_0x3fae25){return new BPromise(function(_0x517faa,_0x37a246){return client[_0x7a60('0x8')](_0x40ff96,_0x3fae25)['then'](function(_0x45a120){logger[_0x7a60('0x9')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fdd57,'request\x20sent');logger[_0x7a60('0xa')](_0x7a60('0xb'),_0x2fdd57,_0x7a60('0xc'),JSON[_0x7a60('0xd')](_0x45a120));if(_0x45a120[_0x7a60('0xe')]){if(_0x45a120[_0x7a60('0xe')]['code']===0x1f4){logger[_0x7a60('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fdd57,_0x45a120['error']['message']);return _0x37a246(_0x45a120[_0x7a60('0xe')][_0x7a60('0xf')]);}logger[_0x7a60('0xe')](_0x7a60('0x10'),_0x2fdd57,_0x45a120[_0x7a60('0xe')][_0x7a60('0xf')]);return _0x517faa(_0x45a120['error'][_0x7a60('0xf')]);}else{logger[_0x7a60('0x9')](_0x7a60('0x10'),_0x2fdd57,_0x7a60('0xc'));_0x517faa(_0x45a120[_0x7a60('0x11')][_0x7a60('0xf')]);}})[_0x7a60('0x12')](function(_0x18585e){logger[_0x7a60('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fdd57,_0x18585e);_0x37a246(_0x18585e);});});} \ No newline at end of file +var _0xe338=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x2641f9,_0x458ce6){var _0x283319=function(_0x1e744a){while(--_0x1e744a){_0x2641f9['push'](_0x2641f9['shift']());}};_0x283319(++_0x458ce6);}(_0xe338,0x1d5));var _0x8e33=function(_0x4d14e4,_0x1c8c39){_0x4d14e4=_0x4d14e4-0x0;var _0xcd88b=_0xe338[_0x4d14e4];return _0xcd88b;};'use strict';var _=require(_0x8e33('0x0'));var util=require(_0x8e33('0x1'));var moment=require(_0x8e33('0x2'));var BPromise=require(_0x8e33('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e33('0x4'))['db'];var utils=require(_0x8e33('0x5'));var logger=require(_0x8e33('0x6'))(_0x8e33('0x7'));var config=require(_0x8e33('0x8'));var jayson=require(_0x8e33('0x9'));var client=jayson[_0x8e33('0xa')][_0x8e33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36028d,_0x15458f,_0x4a9bf4){return new BPromise(function(_0x228523,_0x59e5fe){return client[_0x8e33('0xc')](_0x36028d,_0x4a9bf4)['then'](function(_0x2310b6){logger['info'](_0x8e33('0xd'),_0x15458f,_0x8e33('0xe'));logger[_0x8e33('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x15458f,'request\x20sent',JSON[_0x8e33('0x10')](_0x2310b6));if(_0x2310b6[_0x8e33('0x11')]){if(_0x2310b6[_0x8e33('0x11')]['code']===0x1f4){logger[_0x8e33('0x11')](_0x8e33('0xd'),_0x15458f,_0x2310b6[_0x8e33('0x11')]['message']);return _0x59e5fe(_0x2310b6[_0x8e33('0x11')][_0x8e33('0x12')]);}logger['error'](_0x8e33('0xd'),_0x15458f,_0x2310b6[_0x8e33('0x11')][_0x8e33('0x12')]);return _0x228523(_0x2310b6['error']['message']);}else{logger['info'](_0x8e33('0xd'),_0x15458f,_0x8e33('0xe'));_0x228523(_0x2310b6[_0x8e33('0x13')][_0x8e33('0x12')]);}})[_0x8e33('0x14')](function(_0xc3c8ef){logger[_0x8e33('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x15458f,_0xc3c8ef);_0x59e5fe(_0xc3c8ef);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3b00493..25754e7 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 _0x6e55=['/describe','describe','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index'];(function(_0x4ec8a7,_0x168681){var _0x5bcd71=function(_0x2b59f9){while(--_0x2b59f9){_0x4ec8a7['push'](_0x4ec8a7['shift']());}};_0x5bcd71(++_0x168681);}(_0x6e55,0x14a));var _0x56e5=function(_0xfb5fa5,_0x59aee1){_0xfb5fa5=_0xfb5fa5-0x0;var _0x41d6b7=_0x6e55[_0xfb5fa5];return _0x41d6b7;};'use strict';var multer=require(_0x56e5('0x0'));var util=require(_0x56e5('0x1'));var path=require(_0x56e5('0x2'));var timeout=require(_0x56e5('0x3'));var express=require(_0x56e5('0x4'));var router=express[_0x56e5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x56e5('0x6'));var config=require('../../config/environment');var controller=require(_0x56e5('0x7'));router[_0x56e5('0x8')]('/',auth[_0x56e5('0x9')](),controller[_0x56e5('0xa')]);router[_0x56e5('0x8')](_0x56e5('0xb'),auth['isAuthenticated'](),controller[_0x56e5('0xc')]);router[_0x56e5('0x8')]('/:id',auth[_0x56e5('0x9')](),controller[_0x56e5('0xd')]);router[_0x56e5('0x8')](_0x56e5('0xe'),auth['isAuthenticated'](),controller[_0x56e5('0xf')]);router[_0x56e5('0x8')](_0x56e5('0x10'),auth[_0x56e5('0x9')](),controller[_0x56e5('0x11')]);router['post']('/',auth[_0x56e5('0x9')](),controller[_0x56e5('0x12')]);router[_0x56e5('0x13')](_0x56e5('0x14'),auth['isAuthenticated'](),controller[_0x56e5('0x15')]);router[_0x56e5('0x13')]('/:id/sections',auth['isAuthenticated'](),controller[_0x56e5('0x16')]);router[_0x56e5('0x13')](_0x56e5('0x10'),auth[_0x56e5('0x9')](),controller[_0x56e5('0x17')]);router['put']('/:id',auth[_0x56e5('0x9')](),controller[_0x56e5('0x18')]);router[_0x56e5('0x19')](_0x56e5('0x1a'),auth['isAuthenticated'](),controller[_0x56e5('0x1b')]);router[_0x56e5('0x19')](_0x56e5('0xe'),auth['isAuthenticated'](),controller[_0x56e5('0x1c')]);router[_0x56e5('0x19')](_0x56e5('0x10'),auth['isAuthenticated'](),controller[_0x56e5('0x1d')]);module[_0x56e5('0x1e')]=router; \ No newline at end of file +var _0x9a7f=['fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','put','update','delete','removeResources','exports','multer','util','path','connect-timeout','express'];(function(_0x1c7e36,_0x2346da){var _0x320ecd=function(_0x236bd3){while(--_0x236bd3){_0x1c7e36['push'](_0x1c7e36['shift']());}};_0x320ecd(++_0x2346da);}(_0x9a7f,0x1cf));var _0xf9a7=function(_0x1755a9,_0x1b0e63){_0x1755a9=_0x1755a9-0x0;var _0x307035=_0x9a7f[_0x1755a9];return _0x307035;};'use strict';var multer=require(_0xf9a7('0x0'));var util=require(_0xf9a7('0x1'));var path=require(_0xf9a7('0x2'));var timeout=require(_0xf9a7('0x3'));var express=require(_0xf9a7('0x4'));var router=express['Router']();var fs_extra=require(_0xf9a7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf9a7('0x6'));var config=require(_0xf9a7('0x7'));var controller=require(_0xf9a7('0x8'));router[_0xf9a7('0x9')]('/',auth[_0xf9a7('0xa')](),controller['index']);router[_0xf9a7('0x9')](_0xf9a7('0xb'),auth['isAuthenticated'](),controller[_0xf9a7('0xc')]);router[_0xf9a7('0x9')](_0xf9a7('0xd'),auth[_0xf9a7('0xa')](),controller['show']);router[_0xf9a7('0x9')](_0xf9a7('0xe'),auth[_0xf9a7('0xa')](),controller[_0xf9a7('0xf')]);router[_0xf9a7('0x9')](_0xf9a7('0x10'),auth[_0xf9a7('0xa')](),controller[_0xf9a7('0x11')]);router[_0xf9a7('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9a7('0x12')]('/:id/clone',auth[_0xf9a7('0xa')](),controller[_0xf9a7('0x13')]);router[_0xf9a7('0x12')](_0xf9a7('0xe'),auth[_0xf9a7('0xa')](),controller[_0xf9a7('0x14')]);router['post'](_0xf9a7('0x10'),auth[_0xf9a7('0xa')](),controller['addResources']);router[_0xf9a7('0x15')](_0xf9a7('0xd'),auth['isAuthenticated'](),controller[_0xf9a7('0x16')]);router['delete'](_0xf9a7('0xd'),auth[_0xf9a7('0xa')](),controller['destroy']);router[_0xf9a7('0x17')](_0xf9a7('0xe'),auth['isAuthenticated'](),controller['removeSections']);router[_0xf9a7('0x17')]('/:id/resources',auth[_0xf9a7('0xa')](),controller[_0xf9a7('0x18')]);module[_0xf9a7('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e5b2e91..1b7b27f 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 _0xf4f4=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','name','STRING','setDataValue'];(function(_0xe14da8,_0x18e71b){var _0x4609b8=function(_0x52ceb9){while(--_0x52ceb9){_0xe14da8['push'](_0xe14da8['shift']());}};_0x4609b8(++_0x18e71b);}(_0xf4f4,0x1e5));var _0x4f4f=function(_0x40c09c,_0x3efd32){_0x40c09c=_0x40c09c-0x0;var _0x260c44=_0xf4f4[_0x40c09c];return _0x260c44;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4f4f('0x2')},'crudPermissions':{'type':Sequelize[_0x4f4f('0x3')],'set':function(_0x16afc3){this[_0x4f4f('0x4')](_0x4f4f('0x5'),_0x16afc3?_0x16afc3[_0x4f4f('0x6')](''):[]);},'get':function(){return this[_0x4f4f('0x7')]('crudPermissions')?this[_0x4f4f('0x7')](_0x4f4f('0x5'))[_0x4f4f('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4f4f('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4f4f('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4f4f('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4f4f('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4f4f('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa6e6=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','getDataValue'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xa6e6,0x77));var _0x6a6e=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0xa6e6[_0x40b3f2];return _0x4ce90c;};'use strict';var Sequelize=require(_0x6a6e('0x0'));module[_0x6a6e('0x1')]={'name':{'type':Sequelize[_0x6a6e('0x2')],'allowNull':![],'unique':_0x6a6e('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x56da56){this[_0x6a6e('0x4')](_0x6a6e('0x5'),_0x56da56?_0x56da56['join'](''):[]);},'get':function(){return this[_0x6a6e('0x6')](_0x6a6e('0x5'))?this[_0x6a6e('0x6')](_0x6a6e('0x5'))[_0x6a6e('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6a6e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6a6e('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d3a2092..f19e3ce 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 _0x032e=['addResources','userProfileId','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','UserProfile','findAll','rows','catch','show','keys','merge','find','create','body','clone','length','get','omit','createdAt','updatedAt','params','each','autoAssociation','UserProfileResource','Resources','describe','sequelize','transaction','UserProfileSection','sectionId','removeSections','filter','enabled','includes','isEmpty','subsections','findOne','forEach','push','resourceId','Plugin'];(function(_0x2b93ac,_0x317bd8){var _0x4f7d06=function(_0xa3b554){while(--_0xa3b554){_0x2b93ac['push'](_0x2b93ac['shift']());}};_0x4f7d06(++_0x317bd8);}(_0x032e,0x1cc));var _0xe032=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x032e[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe032('0x0'));var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require(_0xe032('0x3'));var moment=require(_0xe032('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe032('0x5'));var util=require(_0xe032('0x6'));var path=require(_0xe032('0x7'));var sox=require(_0xe032('0x8'));var csv=require(_0xe032('0x9'));var ejs=require(_0xe032('0xa'));var fs=require('fs');var fs_extra=require(_0xe032('0xb'));var _=require('lodash');var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x9'));var querystring=require(_0xe032('0x10'));var Papa=require('papaparse');var Redis=require(_0xe032('0x11'));var authService=require(_0xe032('0x12'));var qs=require(_0xe032('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe032('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe032('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe032('0x16'))['db'];config['redis']=_[_0xe032('0x17')](config[_0xe032('0x18')],{'host':_0xe032('0x19'),'port':0x18eb});var socket=require(_0xe032('0x1a'))(new Redis(config[_0xe032('0x18')]));require(_0xe032('0x1b'))[_0xe032('0x1c')](socket);function respondWithStatusCode(_0x1cc0bb,_0x1bf9e3){_0x1bf9e3=_0x1bf9e3||0xcc;return function(_0xec005){if(_0xec005){return _0x1cc0bb[_0xe032('0x1d')](_0x1bf9e3);}return _0x1cc0bb[_0xe032('0x1e')](_0x1bf9e3)[_0xe032('0x1f')]();};}function respondWithResult(_0x40a175,_0x2dc16f){_0x2dc16f=_0x2dc16f||0xc8;return function(_0x2e868b){if(_0x2e868b){return _0x40a175['status'](_0x2dc16f)['json'](_0x2e868b);}};}function respondWithFilteredResult(_0x13b1f9,_0x58c786){return function(_0xd43d01){if(_0xd43d01){var _0x3e0d8c=typeof _0x58c786[_0xe032('0x20')]===_0xe032('0x21')&&typeof _0x58c786[_0xe032('0x22')]===_0xe032('0x21');var _0x39031b=_0xd43d01[_0xe032('0x23')];var _0x1a6281=_0x3e0d8c?0x0:_0x58c786[_0xe032('0x20')];var _0x31496e=_0x3e0d8c?_0xd43d01[_0xe032('0x23')]:_0x58c786[_0xe032('0x20')]+_0x58c786[_0xe032('0x22')];var _0x1a159d;if(_0x31496e>=_0x39031b){_0x31496e=_0x39031b;_0x1a159d=0xc8;}else{_0x1a159d=0xce;}_0x13b1f9[_0xe032('0x1e')](_0x1a159d);return _0x13b1f9[_0xe032('0x24')](_0xe032('0x25'),_0x1a6281+'-'+_0x31496e+'/'+_0x39031b)[_0xe032('0x26')](_0xd43d01);}return null;};}function patchUpdates(_0x5e37f9){return function(_0xf936af){try{jsonpatch['apply'](_0xf936af,_0x5e37f9,!![]);}catch(_0x3122db){return BPromise[_0xe032('0x27')](_0x3122db);}return _0xf936af[_0xe032('0x28')]();};}function saveUpdates(_0x36b8f7,_0x51d0e5){return function(_0x143e1f){if(_0x143e1f){return _0x143e1f[_0xe032('0x29')](_0x36b8f7)[_0xe032('0x2a')](function(_0x52db98){return _0x52db98;});}return null;};}function removeEntity(_0x4f4cc7,_0x2cf48c){return function(_0x441fe9){if(_0x441fe9){return _0x441fe9[_0xe032('0x2b')]()[_0xe032('0x2a')](function(){_0x4f4cc7[_0xe032('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3542c7,_0x19226c){return function(_0x282ec0){if(!_0x282ec0){_0x3542c7['sendStatus'](0x194);}return _0x282ec0;};}function handleError(_0x43c355,_0x5b917d){_0x5b917d=_0x5b917d||0x1f4;return function(_0x24435d){logger[_0xe032('0x2c')](_0x24435d[_0xe032('0x2d')]);if(_0x24435d[_0xe032('0x2e')]){delete _0x24435d['name'];}_0x43c355[_0xe032('0x1e')](_0x5b917d)['send'](_0x24435d);};}exports['index']=function(_0x5cf753,_0x4bfcf2){var _0x597b4c={},_0x159484={},_0x19235c={'count':0x0,'rows':[]};var _0x3ce75a=_['map'](db['UserProfile'][_0xe032('0x2f')],function(_0x35aab8){return{'name':_0x35aab8[_0xe032('0x30')],'type':_0x35aab8[_0xe032('0x31')][_0xe032('0x32')]};});_0x159484[_0xe032('0x33')]=_[_0xe032('0x34')](_0x3ce75a,_0xe032('0x2e'));_0x159484[_0xe032('0x35')]=_['keys'](_0x5cf753['query']);_0x159484[_0xe032('0x36')]=_[_0xe032('0x37')](_0x159484['model'],_0x159484[_0xe032('0x35')]);_0x597b4c[_0xe032('0x38')]=_[_0xe032('0x37')](_0x159484[_0xe032('0x33')],qs[_0xe032('0x39')](_0x5cf753[_0xe032('0x35')][_0xe032('0x39')]));_0x597b4c[_0xe032('0x38')]=_0x597b4c[_0xe032('0x38')]['length']?_0x597b4c[_0xe032('0x38')]:_0x159484[_0xe032('0x33')];if(!_0x5cf753[_0xe032('0x35')][_0xe032('0x3a')](_0xe032('0x3b'))){_0x597b4c[_0xe032('0x22')]=qs[_0xe032('0x22')](_0x5cf753[_0xe032('0x35')]['limit']);_0x597b4c['offset']=qs[_0xe032('0x20')](_0x5cf753[_0xe032('0x35')][_0xe032('0x20')]);}_0x597b4c[_0xe032('0x3c')]=qs['sort'](_0x5cf753[_0xe032('0x35')][_0xe032('0x3d')]);_0x597b4c[_0xe032('0x3e')]=qs[_0xe032('0x36')](_[_0xe032('0x3f')](_0x5cf753[_0xe032('0x35')],_0x159484[_0xe032('0x36')]),_0x3ce75a);if(_0x5cf753[_0xe032('0x35')]['filter']){_0x597b4c[_0xe032('0x3e')]=_['merge'](_0x597b4c[_0xe032('0x3e')],{'$or':_[_0xe032('0x34')](_0x3ce75a,function(_0x13c3fd){if(_0x13c3fd[_0xe032('0x31')]!==_0xe032('0x40')){var _0x20959c={};_0x20959c[_0x13c3fd['name']]={'$like':'%'+_0x5cf753[_0xe032('0x35')]['filter']+'%'};return _0x20959c;}})});}_0x597b4c=_['merge']({},_0x597b4c,_0x5cf753[_0xe032('0x41')]);var _0x538d68={'where':_0x597b4c[_0xe032('0x3e')]};return db['UserProfile']['count'](_0x538d68)['then'](function(_0x24e0bc){_0x19235c[_0xe032('0x23')]=_0x24e0bc;if(_0x5cf753[_0xe032('0x35')][_0xe032('0x42')]){_0x597b4c[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')][_0xe032('0x45')](_0x597b4c);})[_0xe032('0x2a')](function(_0x177c47){_0x19235c[_0xe032('0x46')]=_0x177c47;return _0x19235c;})[_0xe032('0x2a')](respondWithFilteredResult(_0x4bfcf2,_0x597b4c))[_0xe032('0x47')](handleError(_0x4bfcf2,null));};exports[_0xe032('0x48')]=function(_0x2840b1,_0x2ab67d){var _0x1d65fa={'raw':![],'where':{'id':_0x2840b1['params']['id']}},_0x4ae5d7={};_0x4ae5d7[_0xe032('0x33')]=_[_0xe032('0x49')](db[_0xe032('0x44')][_0xe032('0x2f')]);_0x4ae5d7[_0xe032('0x35')]=_[_0xe032('0x49')](_0x2840b1['query']);_0x4ae5d7[_0xe032('0x36')]=_[_0xe032('0x37')](_0x4ae5d7[_0xe032('0x33')],_0x4ae5d7[_0xe032('0x35')]);_0x1d65fa[_0xe032('0x38')]=_[_0xe032('0x37')](_0x4ae5d7[_0xe032('0x33')],qs[_0xe032('0x39')](_0x2840b1['query']['fields']));_0x1d65fa['attributes']=_0x1d65fa[_0xe032('0x38')]['length']?_0x1d65fa[_0xe032('0x38')]:_0x4ae5d7[_0xe032('0x33')];if(_0x2840b1[_0xe032('0x35')][_0xe032('0x42')]){_0x1d65fa[_0xe032('0x43')]=[{'all':!![]}];}_0x1d65fa=_[_0xe032('0x4a')]({},_0x1d65fa,_0x2840b1['options']);return db[_0xe032('0x44')][_0xe032('0x4b')](_0x1d65fa)[_0xe032('0x2a')](handleEntityNotFound(_0x2ab67d,null))[_0xe032('0x2a')](respondWithResult(_0x2ab67d,null))[_0xe032('0x47')](handleError(_0x2ab67d,null));};exports['create']=function(_0x523c92,_0x31fd6a){return db[_0xe032('0x44')][_0xe032('0x4c')](_0x523c92[_0xe032('0x4d')],{})[_0xe032('0x2a')](respondWithResult(_0x31fd6a,0xc9))[_0xe032('0x47')](handleError(_0x31fd6a,null));};exports[_0xe032('0x4e')]=function(_0xbbfb43,_0x466c7b){var _0x502a6f={'where':{'id':_0xbbfb43['params']['id']}},_0x4772c5={};_0x4772c5['model']=_['keys'](db[_0xe032('0x44')][_0xe032('0x2f')]);_0x502a6f[_0xe032('0x38')]=_['intersection'](_0x4772c5[_0xe032('0x33')],qs['fields'](_0xbbfb43['query']['fields']));_0x502a6f['attributes']=_0x502a6f[_0xe032('0x38')][_0xe032('0x4f')]?_0x502a6f[_0xe032('0x38')]:_0x4772c5['model'];if(_0xbbfb43[_0xe032('0x35')]['includeAll']){_0x502a6f[_0xe032('0x43')]=[{'all':!![]}];}_0x502a6f=_[_0xe032('0x4a')]({},_0x502a6f,_0xbbfb43['options']);return db['UserProfile'][_0xe032('0x4b')](_0x502a6f)[_0xe032('0x2a')](handleEntityNotFound(_0x466c7b,null))[_0xe032('0x2a')](function(_0x13cb92){if(_0x13cb92){var _0x500df9=_0x13cb92[_0xe032('0x50')]({'plain':!![]});_0x500df9=qs[_0xe032('0x51')](_0x500df9,['id',_0xe032('0x52'),_0xe032('0x53'),'crudPermissions']);_0xbbfb43[_0xe032('0x4d')]=_[_0xe032('0x51')](_0xbbfb43[_0xe032('0x4d')],['id',_0xe032('0x52'),'updatedAt']);return db['sequelize']['transaction'](function(_0x576a88){return db[_0xe032('0x44')][_0xe032('0x4c')](_['merge'](_0x500df9,_0xbbfb43[_0xe032('0x4d')]),{'include':_0xbbfb43['query'][_0xe032('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x576a88})[_0xe032('0x2a')](function(_0x378ca8){var _0x908f0a=_0x378ca8[_0xe032('0x50')]({'plain':!![]});return db['UserProfileSection'][_0xe032('0x45')]({'where':{'userProfileId':_0xbbfb43[_0xe032('0x54')]['id']},'raw':!![]})[_0xe032('0x2a')](function(_0x3bd644){if(_0x3bd644){return BPromise[_0xe032('0x55')](_0x3bd644,function(_0xf0e2b4){return new BPromise(function(_0x12f844,_0xcd2054){if(_0xf0e2b4[_0xe032('0x56')]===null||_0xf0e2b4[_0xe032('0x56')]===0x1)_0x12f844(null);return db[_0xe032('0x57')][_0xe032('0x45')]({'where':{'sectionId':_0xf0e2b4['id']},'raw':!![]})['then'](function(_0x36dea6){var _0x36deae=_[_0xe032('0x34')](_0x36dea6,function(_0x6a0171){return qs[_0xe032('0x51')](_0x6a0171,['id',_0xe032('0x52'),_0xe032('0x53'),'sectionId']);});_0x12f844(_0x36deae);})['catch'](function(_0x38ec09){_0xcd2054(_0x38ec09);});})[_0xe032('0x2a')](function(_0x1c9370){var _0x5ca083=qs[_0xe032('0x51')](_0xf0e2b4,['id',_0xe032('0x52'),_0xe032('0x53')]);_0x5ca083['userProfileId']=_0x908f0a['id'];if(_0x1c9370)_0x5ca083[_0xe032('0x58')]=_0x1c9370;return _0x5ca083;})[_0xe032('0x2a')](function(_0x5dd792){return db['UserProfileSection'][_0xe032('0x4c')](_0x5dd792,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x576a88});});})[_0xe032('0x2a')](function(){return _0x908f0a;});}});});});}})['then'](respondWithResult(_0x466c7b,0xc9))['catch'](handleError(_0x466c7b,null));};exports[_0xe032('0x29')]=function(_0x4934d7,_0x4a8bcc){if(_0x4934d7['body']['id']){delete _0x4934d7[_0xe032('0x4d')]['id'];}return db[_0xe032('0x44')][_0xe032('0x4b')]({'where':{'id':_0x4934d7[_0xe032('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a8bcc,null))['then'](saveUpdates(_0x4934d7[_0xe032('0x4d')],null))[_0xe032('0x2a')](respondWithResult(_0x4a8bcc,null))[_0xe032('0x47')](handleError(_0x4a8bcc,null));};exports['destroy']=function(_0x25c05c,_0xbd2848){return db[_0xe032('0x44')][_0xe032('0x4b')]({'where':{'id':_0x25c05c['params']['id']}})[_0xe032('0x2a')](handleEntityNotFound(_0xbd2848,null))[_0xe032('0x2a')](removeEntity(_0xbd2848,null))[_0xe032('0x47')](handleError(_0xbd2848,null));};exports[_0xe032('0x59')]=function(_0xa58359,_0xa44807){return db[_0xe032('0x44')][_0xe032('0x59')]()['then'](respondWithResult(_0xa44807,null))[_0xe032('0x47')](handleError(_0xa44807,null));};exports['addSections']=function(_0x155bf,_0x180468){var _0x33b92e=_0x155bf[_0xe032('0x4d')];return db[_0xe032('0x44')]['find']({'where':{'id':_0x155bf[_0xe032('0x54')]['id']}})[_0xe032('0x2a')](handleEntityNotFound(_0x180468,null))[_0xe032('0x2a')](function(_0x12ebec){if(_0x12ebec){return db[_0xe032('0x5a')][_0xe032('0x5b')](function(_0x140d43){return db[_0xe032('0x5c')][_0xe032('0x2b')]({'where':{'userProfileId':_0x155bf['params']['id'],'sectionId':_[_0xe032('0x34')](_0x33b92e,function(_0x399797){return _0x399797[_0xe032('0x5d')];})},'transaction':_0x140d43})[_0xe032('0x2a')](function(){var _0x5007b0=_['map'](_0x33b92e,function(_0xc94fab){_0xc94fab['userProfileId']=_0x155bf[_0xe032('0x54')]['id'];return _0xc94fab;});var _0x187eb2=[];return BPromise[_0xe032('0x55')](_0x5007b0,function(_0xb9b91f){return db[_0xe032('0x5c')][_0xe032('0x4c')](_0xb9b91f,{'include':[{'model':db[_0xe032('0x57')],'as':_0xe032('0x58')}],'raw':!![],'transaction':_0x140d43})[_0xe032('0x2a')](function(_0x266a7f){_0x187eb2['push'](_0x266a7f[_0xe032('0x50')]({'plain':!![]}));});})[_0xe032('0x2a')](function(){return _0x187eb2;});});});}})['then'](function(_0x2cb105){return _0x2cb105;})[_0xe032('0x2a')](respondWithResult(_0x180468,null))[_0xe032('0x47')](handleError(_0x180468,null));};exports[_0xe032('0x5e')]=function(_0x5157bc,_0x8b719b){var _0x3cb1d9;return db[_0xe032('0x44')][_0xe032('0x4b')]({'where':{'id':_0x5157bc[_0xe032('0x54')]['id']},'attributes':['id','name']})[_0xe032('0x2a')](handleEntityNotFound(_0x8b719b,null))[_0xe032('0x2a')](function(_0x3dea3d){if(_0x3dea3d){_0x3cb1d9=_0x3dea3d;return db['UserProfileSection'][_0xe032('0x2b')]({'where':{'userProfileId':_0x5157bc[_0xe032('0x54')]['id'],'sectionId':_0x5157bc[_0xe032('0x35')]['ids']}});}})[_0xe032('0x2a')](function(){return _0x3cb1d9;})[_0xe032('0x2a')](respondWithStatusCode(_0x8b719b,null))[_0xe032('0x47')](handleError(_0x8b719b,null));};exports['getSections']=function(_0x59f3c3,_0x46563e){var _0x2a25eb=[];var _0x4c8473=[];return db[_0xe032('0x5c')][_0xe032('0x45')]({'where':{'userProfileId':_0x59f3c3[_0xe032('0x54')]['id']},'raw':!![]})[_0xe032('0x2a')](function(_0x4b5cda){_0x2a25eb=_[_0xe032('0x5f')](_0x4b5cda,function(_0x5aa80b){return _0x5aa80b[_0xe032('0x60')]===0x1||_[_0xe032('0x61')]([0x3eb,0x709],_0x5aa80b[_0xe032('0x5d')]);});if(!_[_0xe032('0x62')](_0x2a25eb)){return _[_0xe032('0x34')](_0x2a25eb,function(_0x11efcc){return _0x11efcc[_0xe032('0x5d')];});}else{return;}})[_0xe032('0x2a')](function(_0xda7f8c){if(_0xda7f8c)_0x4c8473=_0xda7f8c;if(_[_0xe032('0x61')](_0x4c8473,0x64)){var _0xc93618=_['find'](_0x2a25eb,{'sectionId':0x64});return hasDefaultDashboard(_0xc93618)[_0xe032('0x2a')](function(_0x89d2f1){return _[_0xe032('0x34')](_0x2a25eb,function(_0xe2e92d){if(_0xe2e92d[_0xe032('0x5d')]===0x64){_0xe2e92d[_0xe032('0x63')]=_0x89d2f1;}return _0xe2e92d;});});}else{return;}})['then'](function(_0x430df0){if(_0x430df0)_0x2a25eb=_0x430df0;if(_[_0xe032('0x61')](_0x4c8473,0x3eb)){var _0x221594=_[_0xe032('0x4b')](_0x2a25eb,{'sectionId':0x3eb});return getCustomDashboards(_0x221594)[_0xe032('0x2a')](function(_0x2a0019){return _['map'](_0x2a25eb,function(_0x215c3f){if(_0x221594['enabled']){if(_0x215c3f[_0xe032('0x5d')]===0x3eb){_0x215c3f[_0xe032('0x63')]=_0x2a0019;}}else{if(_0x215c3f[_0xe032('0x5d')]===0x64){_0x215c3f[_0xe032('0x63')]=_0x2a0019;}}return _0x215c3f;});});}else{return;}})['then'](function(_0x2c4b4b){if(_0x2c4b4b)_0x2a25eb=_0x2c4b4b;if(_[_0xe032('0x61')](_0x4c8473,0x709)){var _0x42dbcf=_[_0xe032('0x4b')](_0x2a25eb,{'sectionId':0x709});return getPlugins(_0x42dbcf)['then'](function(_0x2f2b8d){if(_0x42dbcf['enabled']){return _['map'](_0x2a25eb,function(_0x4c5754){if(_0x4c5754['sectionId']===0x709){_0x4c5754[_0xe032('0x63')]=_0x2f2b8d;}return _0x4c5754;});}else{var _0x3564ac={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2f2b8d};var _0x1ed6e2=_[_0xe032('0x34')](_0x2a25eb);_0x1ed6e2['push'](_0x3564ac);return _0x1ed6e2;}});}else{return;}})['then'](function(_0x5d64a8){if(_0x5d64a8)_0x2a25eb=_0x5d64a8;return _[_0xe032('0x5f')](_0x2a25eb,[_0xe032('0x60'),0x1]);})['then'](respondWithResult(_0x46563e,null))['catch'](handleError(_0x46563e,null));};function hasDefaultDashboard(_0x149ca2){var _0x4de7b4=[0x65];return new BPromise(function(_0x56be7f,_0x4ffec3){try{if(_0x149ca2[_0xe032('0x56')]){_0x56be7f(_0x4de7b4);}else{return db['UserProfileResource'][_0xe032('0x64')]({'where':{'sectionId':_0x149ca2['id']},'raw':!![]})[_0xe032('0x2a')](function(_0x4236f8){_0x4236f8?_0x56be7f(_0x4de7b4):_0x56be7f();});}}catch(_0x116807){_0x4ffec3(_0x116807);}});}function getCustomDashboards(_0x35eb1d){var _0xe29bd9=[];return new BPromise(function(_0x182a1f,_0x935b55){try{if(_0x35eb1d[_0xe032('0x56')]){return db['Dashboard'][_0xe032('0x45')]({'raw':!![]})[_0xe032('0x2a')](function(_0x28abd6){_0x28abd6[_0xe032('0x65')](function(_0x5056a2){_0xe29bd9[_0xe032('0x66')](_0x5056a2['id']+0x1869f);});_0x182a1f(_0xe29bd9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x35eb1d['id']},'raw':!![]})[_0xe032('0x2a')](function(_0x490033){_0x490033[_0xe032('0x65')](function(_0x3e22ef){_0xe29bd9[_0xe032('0x66')](_0x3e22ef[_0xe032('0x67')]+0x1869f);});_0x182a1f(_0xe29bd9);});}}catch(_0x4b56df){_0x935b55(_0x4b56df);}});}function getPlugins(_0x3c142e){var _0x4f051e=[];return new BPromise(function(_0x5073af,_0xc0852f){try{if(_0x3c142e[_0xe032('0x56')]){return db[_0xe032('0x68')][_0xe032('0x45')]({'raw':!![]})['then'](function(_0x194fe0){_0x194fe0[_0xe032('0x65')](function(_0x1ab562){_0x4f051e[_0xe032('0x66')](_0x1ab562['id']+0x15b38);});_0x5073af(_0x4f051e);});}else{return db[_0xe032('0x57')][_0xe032('0x45')]({'where':{'sectionId':_0x3c142e['id']},'raw':!![]})['then'](function(_0xae831a){_0xae831a[_0xe032('0x65')](function(_0x4f95e3){_0x4f051e[_0xe032('0x66')](_0x4f95e3[_0xe032('0x67')]+0x15b38);});_0x5073af(_0x4f051e);});}}catch(_0x3da17c){_0xc0852f(_0x3da17c);}});}exports[_0xe032('0x69')]=function(_0xf10af3,_0x40eef3){return db['UserProfile'][_0xe032('0x4b')]({'where':{'id':_0xf10af3['params']['id']}})[_0xe032('0x2a')](handleEntityNotFound(_0x40eef3,null))[_0xe032('0x2a')](function(_0x34f1ee){if(_0x34f1ee){return db[_0xe032('0x5a')][_0xe032('0x5b')](function(_0x299c77){return db['UserProfileSection'][_0xe032('0x45')]({'where':{'userProfileId':_0xf10af3['params']['id']},'attributes':['id'],'raw':!![]})[_0xe032('0x2a')](function(_0x240bf9){if(_0x240bf9){return db[_0xe032('0x5c')]['destroy']({'where':{'userProfileId':_0xf10af3[_0xe032('0x54')]['id'],'id':_[_0xe032('0x34')](_0x240bf9,function(_0x3f4190){return _0x3f4190['id'];})},'transaction':_0x299c77});}})[_0xe032('0x2a')](function(_0x173e22){var _0x21249f=_[_0xe032('0x34')](_0xf10af3[_0xe032('0x4d')],function(_0x4f0a9b){_0x4f0a9b[_0xe032('0x6a')]=_0xf10af3[_0xe032('0x54')]['id'];return _0x4f0a9b;});return db[_0xe032('0x5c')]['bulkCreate'](_0x21249f,{'raw':!![],'transaction':_0x299c77});})[_0xe032('0x2a')](function(_0x4d9a02){var _0x639979=_[_0xe032('0x5f')](_[_0xe032('0x34')](_0x4d9a02,function(_0x117954){return _0x117954[_0xe032('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x639979){return db[_0xe032('0x5c')][_0xe032('0x45')]({'where':{'userProfileId':_0xf10af3[_0xe032('0x54')]['id'],'sectionId':_['map'](_0x639979,function(_0x2681c6){return _0x2681c6[_0xe032('0x5d')];})},'attributes':['id',_0xe032('0x5d')],'raw':!![]})[_0xe032('0x2a')](function(_0x33c321){var _0x5944d1=_[_0xe032('0x34')](_0xf10af3[_0xe032('0x4d')],function(_0x387a6c){_0x387a6c[_0xe032('0x6a')]=_0xf10af3[_0xe032('0x54')]['id'];return _0x387a6c;});return db['UserProfileResource']['bulkCreate'](_0x5944d1,{'raw':!![],'transaction':_0x299c77});});}})[_0xe032('0x47')](handleError(_0x40eef3,null));});}})[_0xe032('0x2a')](function(_0x1a153a){var _0x245b68=_[_0xe032('0x34')](_0x1a153a,function(_0x220f20){return _0x220f20['get']({'plain':!![]});});})[_0xe032('0x2a')](respondWithResult(_0x40eef3,null))[_0xe032('0x47')](handleError(_0x40eef3,null));};exports['removeResources']=function(_0x347abc,_0x370dc6,_0x27807b){return db[_0xe032('0x44')]['find']({'where':{'id':_0x347abc[_0xe032('0x54')]['id']}})['then'](handleEntityNotFound(_0x370dc6,null))[_0xe032('0x2a')](function(_0xe7dfb9){if(_0xe7dfb9){return _0xe7dfb9[_0xe032('0x6b')](_0x347abc[_0xe032('0x35')][_0xe032('0x6c')]);}})['then'](respondWithStatusCode(_0x370dc6,null))[_0xe032('0x47')](handleError(_0x370dc6,null));};exports[_0xe032('0x6d')]=function(_0x2d944b,_0x3c1da0){var _0x5caf55={};if(!_0x2d944b[_0xe032('0x35')][_0xe032('0x6e')])throw new Error(_0xe032('0x6f'));if(!_0x2d944b['query'][_0xe032('0x3a')](_0xe032('0x3b'))){_0x5caf55[_0xe032('0x22')]=qs[_0xe032('0x22')](_0x2d944b[_0xe032('0x35')][_0xe032('0x22')]);_0x5caf55[_0xe032('0x20')]=qs[_0xe032('0x20')](_0x2d944b['query'][_0xe032('0x20')]);}return db['UserProfile'][_0xe032('0x4b')]({'where':{'id':_0x2d944b[_0xe032('0x54')]['id']}})['then'](function(_0x24d6ac){if(!_0x24d6ac)throw new Error(_0xe032('0x70')+_0x2d944b[_0xe032('0x54')]['id']);return db[_0xe032('0x44')][_0xe032('0x6d')](_0x2d944b);})[_0xe032('0x2a')](respondWithFilteredResult(_0x3c1da0,_0x5caf55))['catch'](handleError(_0x3c1da0,null));}; \ No newline at end of file +var _0xd4ad=['createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','userProfileId','Resources','UserProfileResource','update','describe','addSections','destroy','sectionId','removeSections','ids','enabled','includes','subsections','push','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','end','status','json','offset','limit','undefined','count','apply','save','then','error','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','create','body','clone','find','get','omit','crudPermissions'];(function(_0x1df956,_0x2944cd){var _0x2eadc7=function(_0x3bfa3b){while(--_0x3bfa3b){_0x1df956['push'](_0x1df956['shift']());}};_0x2eadc7(++_0x2944cd);}(_0xd4ad,0x158));var _0xdd4a=function(_0x2ba9e7,_0x43b983){_0x2ba9e7=_0x2ba9e7-0x0;var _0x1934c7=_0xd4ad[_0x2ba9e7];return _0x1934c7;};'use strict';var emlformat=require(_0xdd4a('0x0'));var rimraf=require(_0xdd4a('0x1'));var zipdir=require(_0xdd4a('0x2'));var jsonpatch=require(_0xdd4a('0x3'));var rp=require('request-promise');var moment=require(_0xdd4a('0x4'));var BPromise=require(_0xdd4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdd4a('0x6'));var sox=require(_0xdd4a('0x7'));var csv=require('to-csv');var ejs=require(_0xdd4a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd4a('0x9'));var squel=require(_0xdd4a('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd4a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdd4a('0xc'));var querystring=require(_0xdd4a('0xd'));var Papa=require(_0xdd4a('0xe'));var Redis=require(_0xdd4a('0xf'));var authService=require(_0xdd4a('0x10'));var qs=require(_0xdd4a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd4a('0x12'))('api');var utils=require(_0xdd4a('0x13'));var config=require(_0xdd4a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd4a('0x15'))['db'];config[_0xdd4a('0x16')]=_['defaults'](config[_0xdd4a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd4a('0x17'))(new Redis(config['redis']));require(_0xdd4a('0x18'))['register'](socket);function respondWithStatusCode(_0x4d4e47,_0x17f1c3){_0x17f1c3=_0x17f1c3||0xcc;return function(_0x52d623){if(_0x52d623){return _0x4d4e47['sendStatus'](_0x17f1c3);}return _0x4d4e47['status'](_0x17f1c3)[_0xdd4a('0x19')]();};}function respondWithResult(_0x898d87,_0xe41bc0){_0xe41bc0=_0xe41bc0||0xc8;return function(_0x2bdd14){if(_0x2bdd14){return _0x898d87[_0xdd4a('0x1a')](_0xe41bc0)[_0xdd4a('0x1b')](_0x2bdd14);}};}function respondWithFilteredResult(_0x154364,_0x1e68ec){return function(_0x4ffe09){if(_0x4ffe09){var _0x3c3fdd=typeof _0x1e68ec[_0xdd4a('0x1c')]==='undefined'&&typeof _0x1e68ec[_0xdd4a('0x1d')]===_0xdd4a('0x1e');var _0x571224=_0x4ffe09[_0xdd4a('0x1f')];var _0x2d690a=_0x3c3fdd?0x0:_0x1e68ec[_0xdd4a('0x1c')];var _0x2cb507=_0x3c3fdd?_0x4ffe09[_0xdd4a('0x1f')]:_0x1e68ec[_0xdd4a('0x1c')]+_0x1e68ec[_0xdd4a('0x1d')];var _0x4ce555;if(_0x2cb507>=_0x571224){_0x2cb507=_0x571224;_0x4ce555=0xc8;}else{_0x4ce555=0xce;}_0x154364['status'](_0x4ce555);return _0x154364['set']('Content-Range',_0x2d690a+'-'+_0x2cb507+'/'+_0x571224)[_0xdd4a('0x1b')](_0x4ffe09);}return null;};}function patchUpdates(_0x3ae056){return function(_0x40bf7f){try{jsonpatch[_0xdd4a('0x20')](_0x40bf7f,_0x3ae056,!![]);}catch(_0x3a71f5){return BPromise['reject'](_0x3a71f5);}return _0x40bf7f[_0xdd4a('0x21')]();};}function saveUpdates(_0x1b3840,_0x46cb1e){return function(_0xe348a5){if(_0xe348a5){return _0xe348a5['update'](_0x1b3840)['then'](function(_0x5301ee){return _0x5301ee;});}return null;};}function removeEntity(_0x48fc3a,_0x3f80e3){return function(_0x516667){if(_0x516667){return _0x516667['destroy']()[_0xdd4a('0x22')](function(){_0x48fc3a[_0xdd4a('0x1a')](0xcc)[_0xdd4a('0x19')]();});}};}function handleEntityNotFound(_0xc29ce4,_0x6eaea3){return function(_0x28e499){if(!_0x28e499){_0xc29ce4['sendStatus'](0x194);}return _0x28e499;};}function handleError(_0x29ca5c,_0x3baba8){_0x3baba8=_0x3baba8||0x1f4;return function(_0x540597){logger[_0xdd4a('0x23')](_0x540597['stack']);if(_0x540597[_0xdd4a('0x24')]){delete _0x540597[_0xdd4a('0x24')];}_0x29ca5c[_0xdd4a('0x1a')](_0x3baba8)[_0xdd4a('0x25')](_0x540597);};}exports['index']=function(_0x117d2a,_0x10e531){var _0x292d67={},_0x4d02fd={},_0x2b6d01={'count':0x0,'rows':[]};var _0x4f9ef0=_[_0xdd4a('0x26')](db[_0xdd4a('0x27')][_0xdd4a('0x28')],function(_0x5395a3){return{'name':_0x5395a3[_0xdd4a('0x29')],'type':_0x5395a3[_0xdd4a('0x2a')]['key']};});_0x4d02fd[_0xdd4a('0x2b')]=_[_0xdd4a('0x26')](_0x4f9ef0,'name');_0x4d02fd[_0xdd4a('0x2c')]=_['keys'](_0x117d2a[_0xdd4a('0x2c')]);_0x4d02fd[_0xdd4a('0x2d')]=_[_0xdd4a('0x2e')](_0x4d02fd[_0xdd4a('0x2b')],_0x4d02fd[_0xdd4a('0x2c')]);_0x292d67['attributes']=_[_0xdd4a('0x2e')](_0x4d02fd[_0xdd4a('0x2b')],qs[_0xdd4a('0x2f')](_0x117d2a[_0xdd4a('0x2c')][_0xdd4a('0x2f')]));_0x292d67['attributes']=_0x292d67['attributes'][_0xdd4a('0x30')]?_0x292d67[_0xdd4a('0x31')]:_0x4d02fd['model'];if(!_0x117d2a[_0xdd4a('0x2c')]['hasOwnProperty'](_0xdd4a('0x32'))){_0x292d67[_0xdd4a('0x1d')]=qs['limit'](_0x117d2a[_0xdd4a('0x2c')][_0xdd4a('0x1d')]);_0x292d67['offset']=qs[_0xdd4a('0x1c')](_0x117d2a['query']['offset']);}_0x292d67[_0xdd4a('0x33')]=qs[_0xdd4a('0x34')](_0x117d2a[_0xdd4a('0x2c')][_0xdd4a('0x34')]);_0x292d67[_0xdd4a('0x35')]=qs[_0xdd4a('0x2d')](_[_0xdd4a('0x36')](_0x117d2a['query'],_0x4d02fd['filters']),_0x4f9ef0);if(_0x117d2a[_0xdd4a('0x2c')][_0xdd4a('0x37')]){_0x292d67['where']=_[_0xdd4a('0x38')](_0x292d67[_0xdd4a('0x35')],{'$or':_[_0xdd4a('0x26')](_0x4f9ef0,function(_0x3be38e){if(_0x3be38e['type']!=='VIRTUAL'){var _0x9ec698={};_0x9ec698[_0x3be38e[_0xdd4a('0x24')]]={'$like':'%'+_0x117d2a[_0xdd4a('0x2c')]['filter']+'%'};return _0x9ec698;}})});}_0x292d67=_[_0xdd4a('0x38')]({},_0x292d67,_0x117d2a[_0xdd4a('0x39')]);var _0x2f14ed={'where':_0x292d67[_0xdd4a('0x35')]};return db[_0xdd4a('0x27')]['count'](_0x2f14ed)[_0xdd4a('0x22')](function(_0x36aaa0){_0x2b6d01[_0xdd4a('0x1f')]=_0x36aaa0;if(_0x117d2a[_0xdd4a('0x2c')][_0xdd4a('0x3a')]){_0x292d67['include']=[{'all':!![]}];}return db[_0xdd4a('0x27')][_0xdd4a('0x3b')](_0x292d67);})['then'](function(_0x2f5e5b){_0x2b6d01[_0xdd4a('0x3c')]=_0x2f5e5b;return _0x2b6d01;})[_0xdd4a('0x22')](respondWithFilteredResult(_0x10e531,_0x292d67))[_0xdd4a('0x3d')](handleError(_0x10e531,null));};exports['show']=function(_0x4b608f,_0xf4ffc4){var _0x5ccff2={'raw':![],'where':{'id':_0x4b608f[_0xdd4a('0x3e')]['id']}},_0x13d261={};_0x13d261[_0xdd4a('0x2b')]=_[_0xdd4a('0x3f')](db[_0xdd4a('0x27')][_0xdd4a('0x28')]);_0x13d261[_0xdd4a('0x2c')]=_['keys'](_0x4b608f[_0xdd4a('0x2c')]);_0x13d261[_0xdd4a('0x2d')]=_[_0xdd4a('0x2e')](_0x13d261[_0xdd4a('0x2b')],_0x13d261[_0xdd4a('0x2c')]);_0x5ccff2['attributes']=_[_0xdd4a('0x2e')](_0x13d261[_0xdd4a('0x2b')],qs[_0xdd4a('0x2f')](_0x4b608f[_0xdd4a('0x2c')][_0xdd4a('0x2f')]));_0x5ccff2[_0xdd4a('0x31')]=_0x5ccff2[_0xdd4a('0x31')][_0xdd4a('0x30')]?_0x5ccff2[_0xdd4a('0x31')]:_0x13d261[_0xdd4a('0x2b')];if(_0x4b608f[_0xdd4a('0x2c')][_0xdd4a('0x3a')]){_0x5ccff2[_0xdd4a('0x40')]=[{'all':!![]}];}_0x5ccff2=_[_0xdd4a('0x38')]({},_0x5ccff2,_0x4b608f[_0xdd4a('0x39')]);return db[_0xdd4a('0x27')]['find'](_0x5ccff2)[_0xdd4a('0x22')](handleEntityNotFound(_0xf4ffc4,null))['then'](respondWithResult(_0xf4ffc4,null))[_0xdd4a('0x3d')](handleError(_0xf4ffc4,null));};exports[_0xdd4a('0x41')]=function(_0x3bec31,_0x3e1937){return db[_0xdd4a('0x27')]['create'](_0x3bec31[_0xdd4a('0x42')],{})['then'](respondWithResult(_0x3e1937,0xc9))['catch'](handleError(_0x3e1937,null));};exports[_0xdd4a('0x43')]=function(_0x24da0c,_0x1df8ee){var _0x5ef072={'where':{'id':_0x24da0c[_0xdd4a('0x3e')]['id']}},_0x36d033={};_0x36d033['model']=_[_0xdd4a('0x3f')](db[_0xdd4a('0x27')]['rawAttributes']);_0x5ef072[_0xdd4a('0x31')]=_[_0xdd4a('0x2e')](_0x36d033['model'],qs[_0xdd4a('0x2f')](_0x24da0c[_0xdd4a('0x2c')]['fields']));_0x5ef072[_0xdd4a('0x31')]=_0x5ef072[_0xdd4a('0x31')][_0xdd4a('0x30')]?_0x5ef072[_0xdd4a('0x31')]:_0x36d033[_0xdd4a('0x2b')];if(_0x24da0c['query']['includeAll']){_0x5ef072[_0xdd4a('0x40')]=[{'all':!![]}];}_0x5ef072=_[_0xdd4a('0x38')]({},_0x5ef072,_0x24da0c[_0xdd4a('0x39')]);return db[_0xdd4a('0x27')][_0xdd4a('0x44')](_0x5ef072)['then'](handleEntityNotFound(_0x1df8ee,null))[_0xdd4a('0x22')](function(_0x46bff4){if(_0x46bff4){var _0x1cbaf0=_0x46bff4[_0xdd4a('0x45')]({'plain':!![]});_0x1cbaf0=qs[_0xdd4a('0x46')](_0x1cbaf0,['id','createdAt','updatedAt',_0xdd4a('0x47')]);_0x24da0c['body']=_[_0xdd4a('0x46')](_0x24da0c[_0xdd4a('0x42')],['id',_0xdd4a('0x48'),_0xdd4a('0x49')]);return db[_0xdd4a('0x4a')][_0xdd4a('0x4b')](function(_0x5144d3){return db[_0xdd4a('0x27')][_0xdd4a('0x41')](_[_0xdd4a('0x38')](_0x1cbaf0,_0x24da0c['body']),{'include':_0x24da0c[_0xdd4a('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5144d3})[_0xdd4a('0x22')](function(_0x3a9be7){var _0x5e33fe=_0x3a9be7['get']({'plain':!![]});return db[_0xdd4a('0x4c')][_0xdd4a('0x3b')]({'where':{'userProfileId':_0x24da0c[_0xdd4a('0x3e')]['id']},'raw':!![]})['then'](function(_0x448aff){if(_0x448aff){return BPromise[_0xdd4a('0x4d')](_0x448aff,function(_0x5dcfe1){return new BPromise(function(_0x2183cd,_0x3240da){if(_0x5dcfe1[_0xdd4a('0x4e')]===null||_0x5dcfe1['autoAssociation']===0x1)_0x2183cd(null);return db['UserProfileResource'][_0xdd4a('0x3b')]({'where':{'sectionId':_0x5dcfe1['id']},'raw':!![]})[_0xdd4a('0x22')](function(_0x2cdcff){var _0x36a6d3=_[_0xdd4a('0x26')](_0x2cdcff,function(_0x34ab40){return qs['omit'](_0x34ab40,['id',_0xdd4a('0x48'),_0xdd4a('0x49'),'sectionId']);});_0x2183cd(_0x36a6d3);})[_0xdd4a('0x3d')](function(_0x5040b4){_0x3240da(_0x5040b4);});})[_0xdd4a('0x22')](function(_0x14fbb9){var _0x371ca3=qs[_0xdd4a('0x46')](_0x5dcfe1,['id',_0xdd4a('0x48'),_0xdd4a('0x49')]);_0x371ca3[_0xdd4a('0x4f')]=_0x5e33fe['id'];if(_0x14fbb9)_0x371ca3[_0xdd4a('0x50')]=_0x14fbb9;return _0x371ca3;})[_0xdd4a('0x22')](function(_0x102040){return db[_0xdd4a('0x4c')][_0xdd4a('0x41')](_0x102040,{'include':[{'model':db[_0xdd4a('0x51')],'as':_0xdd4a('0x50')}],'raw':!![],'transaction':_0x5144d3});});})['then'](function(){return _0x5e33fe;});}});});});}})[_0xdd4a('0x22')](respondWithResult(_0x1df8ee,0xc9))[_0xdd4a('0x3d')](handleError(_0x1df8ee,null));};exports[_0xdd4a('0x52')]=function(_0x1623cd,_0x17a6d2){if(_0x1623cd[_0xdd4a('0x42')]['id']){delete _0x1623cd[_0xdd4a('0x42')]['id'];}return db[_0xdd4a('0x27')][_0xdd4a('0x44')]({'where':{'id':_0x1623cd[_0xdd4a('0x3e')]['id']}})[_0xdd4a('0x22')](handleEntityNotFound(_0x17a6d2,null))['then'](saveUpdates(_0x1623cd[_0xdd4a('0x42')],null))[_0xdd4a('0x22')](respondWithResult(_0x17a6d2,null))[_0xdd4a('0x3d')](handleError(_0x17a6d2,null));};exports['destroy']=function(_0x463636,_0x4d04eb){return db[_0xdd4a('0x27')]['find']({'where':{'id':_0x463636['params']['id']}})[_0xdd4a('0x22')](handleEntityNotFound(_0x4d04eb,null))[_0xdd4a('0x22')](removeEntity(_0x4d04eb,null))['catch'](handleError(_0x4d04eb,null));};exports[_0xdd4a('0x53')]=function(_0x14b225,_0x2330b2){return db[_0xdd4a('0x27')][_0xdd4a('0x53')]()[_0xdd4a('0x22')](respondWithResult(_0x2330b2,null))['catch'](handleError(_0x2330b2,null));};exports[_0xdd4a('0x54')]=function(_0x1f450b,_0x3dbc43){var _0xb0057d=_0x1f450b[_0xdd4a('0x42')];return db['UserProfile'][_0xdd4a('0x44')]({'where':{'id':_0x1f450b[_0xdd4a('0x3e')]['id']}})[_0xdd4a('0x22')](handleEntityNotFound(_0x3dbc43,null))[_0xdd4a('0x22')](function(_0x91dcdd){if(_0x91dcdd){return db['sequelize'][_0xdd4a('0x4b')](function(_0x405657){return db[_0xdd4a('0x4c')][_0xdd4a('0x55')]({'where':{'userProfileId':_0x1f450b[_0xdd4a('0x3e')]['id'],'sectionId':_[_0xdd4a('0x26')](_0xb0057d,function(_0x540c6a){return _0x540c6a[_0xdd4a('0x56')];})},'transaction':_0x405657})['then'](function(){var _0x4055d6=_[_0xdd4a('0x26')](_0xb0057d,function(_0x4e6fd1){_0x4e6fd1[_0xdd4a('0x4f')]=_0x1f450b[_0xdd4a('0x3e')]['id'];return _0x4e6fd1;});var _0x3362fd=[];return BPromise['each'](_0x4055d6,function(_0x4230b3){return db[_0xdd4a('0x4c')][_0xdd4a('0x41')](_0x4230b3,{'include':[{'model':db[_0xdd4a('0x51')],'as':'Resources'}],'raw':!![],'transaction':_0x405657})[_0xdd4a('0x22')](function(_0x27fd05){_0x3362fd['push'](_0x27fd05[_0xdd4a('0x45')]({'plain':!![]}));});})[_0xdd4a('0x22')](function(){return _0x3362fd;});});});}})['then'](function(_0xca443b){return _0xca443b;})['then'](respondWithResult(_0x3dbc43,null))[_0xdd4a('0x3d')](handleError(_0x3dbc43,null));};exports[_0xdd4a('0x57')]=function(_0x2d6679,_0x31ee1e){var _0x36949b;return db[_0xdd4a('0x27')][_0xdd4a('0x44')]({'where':{'id':_0x2d6679[_0xdd4a('0x3e')]['id']},'attributes':['id','name']})[_0xdd4a('0x22')](handleEntityNotFound(_0x31ee1e,null))[_0xdd4a('0x22')](function(_0x28055e){if(_0x28055e){_0x36949b=_0x28055e;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2d6679[_0xdd4a('0x3e')]['id'],'sectionId':_0x2d6679[_0xdd4a('0x2c')][_0xdd4a('0x58')]}});}})['then'](function(){return _0x36949b;})['then'](respondWithStatusCode(_0x31ee1e,null))[_0xdd4a('0x3d')](handleError(_0x31ee1e,null));};exports['getSections']=function(_0x1f3b7b,_0x36f1dd){var _0x19977e=[];var _0x1096d7=[];return db[_0xdd4a('0x4c')]['findAll']({'where':{'userProfileId':_0x1f3b7b[_0xdd4a('0x3e')]['id']},'raw':!![]})[_0xdd4a('0x22')](function(_0x4ade3c){_0x19977e=_['filter'](_0x4ade3c,function(_0x55a9e9){return _0x55a9e9[_0xdd4a('0x59')]===0x1||_[_0xdd4a('0x5a')]([0x3eb,0x709],_0x55a9e9[_0xdd4a('0x56')]);});if(!_['isEmpty'](_0x19977e)){return _[_0xdd4a('0x26')](_0x19977e,function(_0x1a1e12){return _0x1a1e12[_0xdd4a('0x56')];});}else{return;}})['then'](function(_0x1e6800){if(_0x1e6800)_0x1096d7=_0x1e6800;if(_[_0xdd4a('0x5a')](_0x1096d7,0x64)){var _0x376d1b=_[_0xdd4a('0x44')](_0x19977e,{'sectionId':0x64});return hasDefaultDashboard(_0x376d1b)[_0xdd4a('0x22')](function(_0xd24f78){return _['map'](_0x19977e,function(_0x5b3808){if(_0x5b3808[_0xdd4a('0x56')]===0x64){_0x5b3808[_0xdd4a('0x5b')]=_0xd24f78;}return _0x5b3808;});});}else{return;}})[_0xdd4a('0x22')](function(_0x2e97ac){if(_0x2e97ac)_0x19977e=_0x2e97ac;if(_[_0xdd4a('0x5a')](_0x1096d7,0x3eb)){var _0x4c6006=_[_0xdd4a('0x44')](_0x19977e,{'sectionId':0x3eb});return getCustomDashboards(_0x4c6006)[_0xdd4a('0x22')](function(_0x474118){return _[_0xdd4a('0x26')](_0x19977e,function(_0x30a045){if(_0x4c6006[_0xdd4a('0x59')]){if(_0x30a045[_0xdd4a('0x56')]===0x3eb){_0x30a045[_0xdd4a('0x5b')]=_0x474118;}}else{if(_0x30a045[_0xdd4a('0x56')]===0x64){_0x30a045[_0xdd4a('0x5b')]=_0x474118;}}return _0x30a045;});});}else{return;}})[_0xdd4a('0x22')](function(_0x3cd812){if(_0x3cd812)_0x19977e=_0x3cd812;if(_['includes'](_0x1096d7,0x709)){var _0x17c918=_[_0xdd4a('0x44')](_0x19977e,{'sectionId':0x709});return getPlugins(_0x17c918)[_0xdd4a('0x22')](function(_0x25a840){if(_0x17c918[_0xdd4a('0x59')]){return _[_0xdd4a('0x26')](_0x19977e,function(_0x1d97f8){if(_0x1d97f8[_0xdd4a('0x56')]===0x709){_0x1d97f8['subsections']=_0x25a840;}return _0x1d97f8;});}else{var _0x4b1fc3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x25a840};var _0x388c6f=_[_0xdd4a('0x26')](_0x19977e);_0x388c6f[_0xdd4a('0x5c')](_0x4b1fc3);return _0x388c6f;}});}else{return;}})[_0xdd4a('0x22')](function(_0x1bca5f){if(_0x1bca5f)_0x19977e=_0x1bca5f;return _[_0xdd4a('0x37')](_0x19977e,[_0xdd4a('0x59'),0x1]);})['then'](respondWithResult(_0x36f1dd,null))[_0xdd4a('0x3d')](handleError(_0x36f1dd,null));};function hasDefaultDashboard(_0xa43a7){var _0xd7c3ab=[0x65];return new BPromise(function(_0x14b6a3,_0x1b667b){try{if(_0xa43a7['autoAssociation']){_0x14b6a3(_0xd7c3ab);}else{return db[_0xdd4a('0x51')]['findOne']({'where':{'sectionId':_0xa43a7['id']},'raw':!![]})[_0xdd4a('0x22')](function(_0x471d4f){_0x471d4f?_0x14b6a3(_0xd7c3ab):_0x14b6a3();});}}catch(_0x307a58){_0x1b667b(_0x307a58);}});}function getCustomDashboards(_0x54259a){var _0x51cc55=[];return new BPromise(function(_0x5e98cd,_0x2c1db3){try{if(_0x54259a[_0xdd4a('0x4e')]){return db[_0xdd4a('0x5d')]['findAll']({'raw':!![]})[_0xdd4a('0x22')](function(_0x5865d4){_0x5865d4[_0xdd4a('0x5e')](function(_0x59d132){_0x51cc55[_0xdd4a('0x5c')](_0x59d132['id']+0x1869f);});_0x5e98cd(_0x51cc55);});}else{return db[_0xdd4a('0x51')][_0xdd4a('0x3b')]({'where':{'sectionId':_0x54259a['id']},'raw':!![]})[_0xdd4a('0x22')](function(_0xc55d43){_0xc55d43[_0xdd4a('0x5e')](function(_0x147732){_0x51cc55[_0xdd4a('0x5c')](_0x147732[_0xdd4a('0x5f')]+0x1869f);});_0x5e98cd(_0x51cc55);});}}catch(_0x41966b){_0x2c1db3(_0x41966b);}});}function getPlugins(_0x33eadb){var _0x57caff=[];return new BPromise(function(_0x517cda,_0x5c2ed9){try{if(_0x33eadb[_0xdd4a('0x4e')]){return db[_0xdd4a('0x60')][_0xdd4a('0x3b')]({'raw':!![]})[_0xdd4a('0x22')](function(_0x16f343){_0x16f343[_0xdd4a('0x5e')](function(_0x58bf32){_0x57caff[_0xdd4a('0x5c')](_0x58bf32['id']+0x15b38);});_0x517cda(_0x57caff);});}else{return db[_0xdd4a('0x51')]['findAll']({'where':{'sectionId':_0x33eadb['id']},'raw':!![]})[_0xdd4a('0x22')](function(_0x45ebf0){_0x45ebf0['forEach'](function(_0x30de2c){_0x57caff[_0xdd4a('0x5c')](_0x30de2c[_0xdd4a('0x5f')]+0x15b38);});_0x517cda(_0x57caff);});}}catch(_0x2f86dd){_0x5c2ed9(_0x2f86dd);}});}exports['addResources']=function(_0x1861f5,_0x303f9f){return db[_0xdd4a('0x27')][_0xdd4a('0x44')]({'where':{'id':_0x1861f5[_0xdd4a('0x3e')]['id']}})[_0xdd4a('0x22')](handleEntityNotFound(_0x303f9f,null))[_0xdd4a('0x22')](function(_0x3d5ccc){if(_0x3d5ccc){return db['sequelize']['transaction'](function(_0x12be5c){return db[_0xdd4a('0x4c')][_0xdd4a('0x3b')]({'where':{'userProfileId':_0x1861f5[_0xdd4a('0x3e')]['id']},'attributes':['id'],'raw':!![]})[_0xdd4a('0x22')](function(_0x4218bf){if(_0x4218bf){return db['UserProfileSection'][_0xdd4a('0x55')]({'where':{'userProfileId':_0x1861f5[_0xdd4a('0x3e')]['id'],'id':_[_0xdd4a('0x26')](_0x4218bf,function(_0x159beb){return _0x159beb['id'];})},'transaction':_0x12be5c});}})[_0xdd4a('0x22')](function(_0x43c6cd){var _0x9319c5=_['map'](_0x1861f5[_0xdd4a('0x42')],function(_0x1fa8de){_0x1fa8de[_0xdd4a('0x4f')]=_0x1861f5[_0xdd4a('0x3e')]['id'];return _0x1fa8de;});return db[_0xdd4a('0x4c')]['bulkCreate'](_0x9319c5,{'raw':!![],'transaction':_0x12be5c});})['then'](function(_0x2ea153){var _0xac130f=_[_0xdd4a('0x37')](_[_0xdd4a('0x26')](_0x2ea153,function(_0x5ef71b){return _0x5ef71b[_0xdd4a('0x45')]({'plain':!![]});}),{'includeAll':![]});if(_0xac130f){return db[_0xdd4a('0x4c')][_0xdd4a('0x3b')]({'where':{'userProfileId':_0x1861f5[_0xdd4a('0x3e')]['id'],'sectionId':_[_0xdd4a('0x26')](_0xac130f,function(_0x4ea056){return _0x4ea056[_0xdd4a('0x56')];})},'attributes':['id',_0xdd4a('0x56')],'raw':!![]})[_0xdd4a('0x22')](function(_0x533dcd){var _0x55c145=_[_0xdd4a('0x26')](_0x1861f5[_0xdd4a('0x42')],function(_0x494030){_0x494030[_0xdd4a('0x4f')]=_0x1861f5[_0xdd4a('0x3e')]['id'];return _0x494030;});return db[_0xdd4a('0x51')][_0xdd4a('0x61')](_0x55c145,{'raw':!![],'transaction':_0x12be5c});});}})[_0xdd4a('0x3d')](handleError(_0x303f9f,null));});}})['then'](function(_0xc3d81f){var _0x585979=_[_0xdd4a('0x26')](_0xc3d81f,function(_0x11591f){return _0x11591f[_0xdd4a('0x45')]({'plain':!![]});});})['then'](respondWithResult(_0x303f9f,null))[_0xdd4a('0x3d')](handleError(_0x303f9f,null));};exports[_0xdd4a('0x62')]=function(_0x344e80,_0x537e0,_0xfb8a75){return db[_0xdd4a('0x27')]['find']({'where':{'id':_0x344e80[_0xdd4a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x537e0,null))[_0xdd4a('0x22')](function(_0x5d35db){if(_0x5d35db){return _0x5d35db[_0xdd4a('0x62')](_0x344e80[_0xdd4a('0x2c')][_0xdd4a('0x58')]);}})[_0xdd4a('0x22')](respondWithStatusCode(_0x537e0,null))['catch'](handleError(_0x537e0,null));};exports[_0xdd4a('0x63')]=function(_0x218a34,_0x5810a5){var _0x5ed60e={};if(!_0x218a34[_0xdd4a('0x2c')][_0xdd4a('0x64')])throw new Error(_0xdd4a('0x65'));if(!_0x218a34[_0xdd4a('0x2c')][_0xdd4a('0x66')](_0xdd4a('0x32'))){_0x5ed60e[_0xdd4a('0x1d')]=qs['limit'](_0x218a34[_0xdd4a('0x2c')]['limit']);_0x5ed60e[_0xdd4a('0x1c')]=qs['offset'](_0x218a34[_0xdd4a('0x2c')][_0xdd4a('0x1c')]);}return db[_0xdd4a('0x27')][_0xdd4a('0x44')]({'where':{'id':_0x218a34[_0xdd4a('0x3e')]['id']}})[_0xdd4a('0x22')](function(_0x1a7464){if(!_0x1a7464)throw new Error(_0xdd4a('0x67')+_0x218a34[_0xdd4a('0x3e')]['id']);return db[_0xdd4a('0x27')]['getResources'](_0x218a34);})[_0xdd4a('0x22')](respondWithFilteredResult(_0x5810a5,_0x5ed60e))[_0xdd4a('0x3d')](handleError(_0x5810a5,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d9b5382..0d755d9 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 _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','update','remove'];(function(_0x34c4e9,_0x2b4d90){var _0x144dd4=function(_0x86304f){while(--_0x86304f){_0x34c4e9['push'](_0x34c4e9['shift']());}};_0x144dd4(++_0x2b4d90);}(_0xd634,0xf4));var _0x4d63=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0xd634[_0x237da8];return _0x558825;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){UserProfileEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);UserProfileEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];UserProfile[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xe2bc=['save','update','remove','emit','hasOwnProperty','hook','events','UserProfile'];(function(_0x57ee13,_0x379364){var _0x272ad2=function(_0x497fc8){while(--_0x497fc8){_0x57ee13['push'](_0x57ee13['shift']());}};_0x272ad2(++_0x379364);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe2bc[_0x1203f];return _0x365f0a;};'use strict';var EventEmitter=require(_0xce2b('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xce2b('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce2b('0x2'),'afterUpdate':_0xce2b('0x3'),'afterDestroy':_0xce2b('0x4')};function emitEvent(_0x231ea2){return function(_0x3f7887,_0x5af322,_0x29382b){UserProfileEvents[_0xce2b('0x5')](_0x231ea2+':'+_0x3f7887['id'],_0x3f7887);UserProfileEvents[_0xce2b('0x5')](_0x231ea2,_0x3f7887);_0x29382b(null);};}for(var e in events){if(events[_0xce2b('0x6')](e)){var event=events[e];UserProfile[_0xce2b('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index d850d6e..f502a9c 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 _0x3831=['faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceContext','voicemails','VoiceRecording','membername','User','role','agent','telephone','VoiceQueues','queue','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','Agents','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','UserProfileSection','find','all','ignore','isEmpty','union','push','autoAssociation','length','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','CustomReports','count','rows','tag','ThroughTags','color','true','chat','dataValues','fax','mail','openchannel','lodash','../../components/parsers/qs','squel','exports','filter','field','value','findAll','then','associatedResources','map','model','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareProjects','name','projectName','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3831,0x14c));var _0x1383=function(_0xf3b525,_0x419b48){_0xf3b525=_0xf3b525-0x0;var _0x1f98b3=_0x3831[_0xf3b525];return _0x1f98b3;};'use strict';var _=require(_0x1383('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x1383('0x1'));var squel=require(_0x1383('0x2'));module[_0x1383('0x3')]=function(_0x15e6b5){var _0x391bef=_0x15e6b5['models'];function _0x2fdf72(_0x573874,_0x21ea2c){return new Promise(function(_0x53b708,_0x5b64b1){if(!_0x21ea2c)return _0x53b708(null);var _0x5eb4d8=_0x21ea2c[_0x1383('0x4')]?{[_0x21ea2c['filter'][_0x1383('0x5')]]:_0x21ea2c[_0x1383('0x4')][_0x1383('0x6')]}:undefined;return _0x391bef[_0x573874][_0x1383('0x7')]({'where':_0x5eb4d8,'raw':!![]})[_0x1383('0x8')](function(_0x7cb670){_0x21ea2c[_0x1383('0x9')]=_[_0x1383('0xa')](_0x7cb670,'id');_0x53b708(_0x21ea2c);})['catch'](function(_0x998e2f){_0x5b64b1(_0x998e2f);});});}function _0x34be26(_0x627ec3,_0xb11599){return new Promise(function(_0x3675cb,_0x5d5ee2){var _0x275046=_0x627ec3[_0x1383('0x4')]?{[_0x627ec3[_0x1383('0x4')]['field']]:_0x627ec3['filter'][_0x1383('0x6')]}:undefined;return _0x391bef[_0x627ec3[_0x1383('0xb')]][_0x1383('0x7')]({'where':_0x275046,'raw':!![]})[_0x1383('0x8')](function(_0x1e02d7){_0xb11599[_0x1383('0x9')]=_[_0x1383('0xa')](_0x1e02d7,function(_0x22895c){return _0x22895c['name'];});_0x3675cb(_0xb11599);})[_0x1383('0xc')](function(_0x1f46de){_0x5d5ee2(_0x1f46de);});});}function _0x41d895(_0x1c6d7b,_0x29fbd7,_0x388b94){if(!_0x29fbd7)return Promise[_0x1383('0xd')](null);return new Promise(function(_0x5ca7fc,_0x564e3f){return _0x391bef[_0x1383('0xe')]['findAll']({'where':{'sectionId':_0x29fbd7['id']},'raw':!![]})[_0x1383('0x8')](function(_0x5b3705){if(_0x1c6d7b['field']&&_0x1c6d7b['field']!=='id'){_0x29fbd7[_0x1383('0x9')]=_['map'](_0x5b3705,function(_0x2aa3b6){return _0x2aa3b6[_0x1c6d7b['field']];});}else{if(_0x388b94===_0x1383('0xf')){_0x29fbd7[_0x1383('0x9')]=_[_0x1383('0xa')](_0x5b3705,function(_0x39884b){return{'id':_0x39884b[_0x1383('0x10')],'type':_0x39884b[_0x1383('0x11')]};});}else{_0x29fbd7[_0x1383('0x9')]=_[_0x1383('0xa')](_0x5b3705,function(_0x2afbd2){return _0x2afbd2['resourceId'];});}}_0x5ca7fc(_0x29fbd7);})[_0x1383('0xc')](function(_0x24f914){_0x564e3f(_0x24f914);});});}function _0x39fea2(_0x241c3d,_0x186524){var _0x2a9502={'parentSections':[]};switch(_0x241c3d[_0x1383('0x12')]()){case'squareprojects':_0x2a9502['childModel']=_0x1383('0x13');break;case _0x1383('0x14'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x16');break;case _0x1383('0x17'):_0x2a9502['childModel']='SquareRecording';_0x2a9502['parentSections']=[{'name':_0x1383('0x18'),'field':_0x1383('0x19'),'foreignKey':_0x1383('0x1a')}];break;case _0x1383('0x1b'):_0x2a9502['childModel']=_0x1383('0x1c');break;case'contacts':_0x2a9502[_0x1383('0x15')]=_0x1383('0x1d');_0x2a9502[_0x1383('0x1e')]=[{'name':_0x1383('0x1f'),'field':'id','foreignKey':_0x1383('0x20')}];break;case _0x1383('0x21'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x22');break;case _0x1383('0x23'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x24');break;case _0x1383('0x25'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x26');break;case'chatqueues':_0x2a9502[_0x1383('0x15')]=_0x1383('0x27');break;case _0x1383('0x28'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x29');break;case _0x1383('0x2a'):_0x2a9502['childModel']=_0x1383('0x2b');break;case _0x1383('0x2c'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x2d');break;case _0x1383('0x2e'):case _0x1383('0x2f'):case'outboundroutes':_0x2a9502[_0x1383('0x15')]='VoiceExtension';break;case'contexts':_0x2a9502[_0x1383('0x15')]=_0x1383('0x30');break;case _0x1383('0x31'):_0x2a9502['childModel']='VoiceMail';break;case'voicerecordings':_0x2a9502[_0x1383('0x15')]=_0x1383('0x32');_0x2a9502[_0x1383('0x1e')]=[{'name':'Agents','field':'name','foreignKey':_0x1383('0x33'),'model':_0x1383('0x34'),'filter':{'field':_0x1383('0x35'),'value':[_0x1383('0x36')]}},{'name':'Telephones','field':'name','foreignKey':_0x1383('0x33'),'model':_0x1383('0x34'),'filter':{'field':_0x1383('0x35'),'value':[_0x1383('0x37')]}},{'name':_0x1383('0x38'),'field':_0x1383('0x19'),'foreignKey':_0x1383('0x39'),'model':'VoiceQueue','filter':{'field':_0x1383('0x11'),'value':['inbound']}},{'name':_0x1383('0x3a'),'field':_0x1383('0x19'),'foreignKey':_0x1383('0x39'),'model':'VoiceQueue','filter':{'field':_0x1383('0x11'),'value':['outbound']}}];break;case'musiconholds':_0x2a9502[_0x1383('0x15')]=_0x1383('0x3b');break;case _0x1383('0x3c'):_0x2a9502['childModel']=_0x1383('0x3d');break;case _0x1383('0x3e'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x3f');break;case'ivrcampaigns':_0x2a9502[_0x1383('0x15')]='Campaign';break;case'mailqueues':_0x2a9502[_0x1383('0x15')]=_0x1383('0x40');break;case'mailaccounts':_0x2a9502['childModel']='MailAccount';break;case _0x1383('0x41'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x42');break;case _0x1383('0x43'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x44');break;case _0x1383('0x45'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x46');break;case'smsqueues':_0x2a9502[_0x1383('0x15')]=_0x1383('0x47');break;case _0x1383('0x48'):_0x2a9502['childModel']=_0x1383('0x49');break;case'whatsappqueues':_0x2a9502[_0x1383('0x15')]=_0x1383('0x4a');break;case _0x1383('0x4b'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x4c');break;case _0x1383('0x4d'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x4e');break;case _0x1383('0x4f'):case'queuecampaigns':_0x2a9502['childModel']='VoiceQueue';if(_0x186524){_0x2a9502[_0x1383('0x1e')]=[{'name':_0x1383('0x38')},{'name':_0x1383('0x3a')}];}break;case _0x1383('0x50'):case _0x1383('0x51'):case _0x1383('0x52'):_0x2a9502['childModel']=_0x1383('0x34');if(_0x186524){_0x2a9502[_0x1383('0x1e')]=[{'name':_0x1383('0x53'),'filter':{'field':'role','value':[_0x1383('0x54'),_0x1383('0x55')]},'ignore':!![]},{'name':_0x1383('0x56')},{'name':_0x1383('0x57')}];}break;case _0x1383('0x58'):_0x2a9502['childModel']=_0x1383('0x59');break;case'salesforceaccounts':_0x2a9502[_0x1383('0x15')]=_0x1383('0x5a');break;case'freshdeskaccounts':_0x2a9502[_0x1383('0x15')]=_0x1383('0x5b');break;case _0x1383('0x5c'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x5d');break;case _0x1383('0x5e'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x5f');break;case _0x1383('0x60'):_0x2a9502[_0x1383('0x15')]='ZohoAccount';break;case _0x1383('0x61'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x34');break;case _0x1383('0x62'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x63');break;case _0x1383('0x64'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x65');break;case'customdashboards':_0x2a9502[_0x1383('0x15')]=_0x1383('0x66');break;case _0x1383('0x67'):_0x2a9502['childModel']=_0x1383('0x68');break;case _0x1383('0x69'):_0x2a9502['childModel']=_0x1383('0x6a');break;case _0x1383('0x6b'):_0x2a9502['childModel']='Schedule';break;case _0x1383('0x6c'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x6d');break;case'tags':_0x2a9502[_0x1383('0x15')]=_0x1383('0x6e');break;case'templates':_0x2a9502[_0x1383('0x15')]='Template';break;case _0x1383('0x6f'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x70');break;case _0x1383('0x71'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x72');break;case _0x1383('0x73'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x74');break;case _0x1383('0x75'):_0x2a9502[_0x1383('0x15')]=_0x1383('0x76');break;case _0x1383('0x77'):_0x2a9502[_0x1383('0x15')]=_0x1383('0xf');_0x2a9502[_0x1383('0x1e')]=[{'name':_0x1383('0x78'),'field':'id','foreignKey':_0x1383('0x79')}];break;case'metrics':_0x2a9502[_0x1383('0x15')]=_0x1383('0x7a');break;}return _0x2a9502;}function _0x316e36(_0x1f78b2,_0x255db9){var _0x1b9eda=_0x1f78b2[_0x1383('0x7b')](0x0)[_0x1383('0x7c')]()+_0x1f78b2[_0x1383('0x7d')](0x1);var _0x32a9fb={'type':_0x391bef[_0x1383('0x7e')][_0x1383('0x7f')][_0x1383('0x80')],'raw':!![]};return new Promise(function(_0xcae0c2,_0x4f6a51){var _0x1f1b08=squel['select']()[_0x1383('0x5')](_0x1383('0x81')+_0x1b9eda+'InteractionId','id')[_0x1383('0x5')](_0x1383('0x82'))[_0x1383('0x83')](_0x1383('0x84')+_0x1f78b2+'_interactions','ui')['where'](_0x1383('0x85'),_0x255db9['id']);return _0x391bef[_0x1383('0x86')][_0x1383('0x87')](_0x1f1b08[_0x1383('0x88')](),_0x32a9fb)['then'](function(_0x69e495){_0x255db9[_0x1b9eda+_0x1383('0x89')]=_0x69e495;_0xcae0c2(_0x69e495);})[_0x1383('0xc')](function(_0x58a80b){_0x4f6a51(_0x58a80b);});});}return _0x15e6b5[_0x1383('0x8a')]('UserProfile',attributes,{'tableName':_0x1383('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4ae832){var _0x200e76={'raw':![],'where':{}};var _0x45363e={};var _0x15b538={'count':0x0,'rows':[]};var _0x1cd59b=_0x4ae832[_0x1383('0x87')][_0x1383('0x8c')];var _0x15a08e=_0x4ae832[_0x1383('0x87')][_0x1383('0x8d')]||![];var _0x448e13=_0x39fea2(_0x1cd59b,_0x15a08e);if(!_0x448e13[_0x1383('0x15')])throw new Error(_0x1383('0x8e')+_0x1cd59b+'\x27');var _0x38b24b=[{'name':_0x1cd59b}];if(!_['isEmpty'](_0x448e13[_0x1383('0x1e')]))_0x38b24b=_0x448e13[_0x1383('0x1e')];var _0x11f612=[];for(var _0x2db88e=0x0;_0x2db88e<_0x38b24b['length'];_0x2db88e++){_0x11f612['push'](_0x391bef[_0x1383('0x8f')][_0x1383('0x90')]({'where':{'userProfileId':_0x4ae832['params']['id'],'name':_0x38b24b[_0x2db88e]['name']},'raw':!![]}));}return Promise[_0x1383('0x91')](_0x11f612)[_0x1383('0x8')](function(_0x1be3bd){var _0x27351e=_[_0x1383('0x4')](_0x1be3bd,function(_0x5b9a0c){return _0x5b9a0c?_0x5b9a0c:undefined;});var _0x3fcc3f=_[_0x1383('0x4')](_0x38b24b,[_0x1383('0x92'),!![]]);var _0x13d830=_[_0x1383('0x93')](_0x27351e)&&_[_0x1383('0x93')](_0x3fcc3f)?null:_[_0x1383('0x94')](_0x3fcc3f,_0x27351e);if(!_0x13d830)return null;var _0x574641=[];for(var _0x337df8=0x0;_0x337df8<_0x13d830['length'];_0x337df8++){var _0x32e44a=_['find'](_0x38b24b,function(_0x7feade){return _0x13d830[_0x337df8]?_0x7feade['name']===_0x13d830[_0x337df8][_0x1383('0x19')]:null;});if(_0x32e44a){if(_0x13d830[_0x337df8][_0x1383('0x92')]){_0x574641[_0x1383('0x95')](_0x2fdf72(_0x448e13['childModel'],_0x13d830[_0x337df8]));}else{if(!_0x13d830[_0x337df8][_0x1383('0x96')]){_0x574641['push'](_0x41d895(_0x32e44a,_0x13d830[_0x337df8],_0x448e13[_0x1383('0x15')]));}else{if(_0x32e44a['model']){_0x574641[_0x1383('0x95')](_0x34be26(_0x32e44a,_0x13d830[_0x337df8]));}}}}}return Promise['all'](_0x574641);})['then'](function(_0x357ab1){var _0x2a1aa8=_0x357ab1;var _0x42e576=null;if(_0x2a1aa8){_0x42e576=_0x2a1aa8[_0x1383('0x97')]===0x1?_0x2a1aa8[0x0]:null;}if(!_0x42e576&&!_0x2a1aa8)return _0x15b538;var _0x20ee6b=_0x391bef[_0x448e13[_0x1383('0x15')]][_0x1383('0x98')];_0x45363e[_0x1383('0xb')]=_[_0x1383('0x99')](_0x20ee6b);_0x45363e[_0x1383('0x87')]=_[_0x1383('0x99')](_0x4ae832[_0x1383('0x87')]);_0x45363e[_0x1383('0x9a')]=_['intersection'](_0x45363e[_0x1383('0xb')],_0x45363e[_0x1383('0x87')]);_0x200e76[_0x1383('0x9b')]=_[_0x1383('0x9c')](_0x45363e[_0x1383('0xb')],qs[_0x1383('0x9d')](_0x4ae832[_0x1383('0x87')][_0x1383('0x9d')]));_0x200e76[_0x1383('0x9b')]=_0x200e76[_0x1383('0x9b')][_0x1383('0x97')]?_0x200e76[_0x1383('0x9b')]:_0x45363e[_0x1383('0xb')];if(!_0x4ae832['query'][_0x1383('0x9e')]('nolimit')){_0x200e76[_0x1383('0x9f')]=qs['limit'](_0x4ae832['query'][_0x1383('0x9f')]);_0x200e76[_0x1383('0xa0')]=qs['offset'](_0x4ae832['query'][_0x1383('0xa0')]);}_0x200e76[_0x1383('0xa1')]=qs[_0x1383('0xa2')](_0x4ae832['query'][_0x1383('0xa2')]);_0x200e76[_0x1383('0xa3')]=qs['filters'](_[_0x1383('0xa4')](_0x4ae832[_0x1383('0x87')],_0x45363e['filters']));if(_0x4ae832[_0x1383('0x87')][_0x1383('0x4')]){_0x200e76[_0x1383('0xa3')]=_[_0x1383('0xa5')](_0x200e76[_0x1383('0xa3')],{'$or':_[_0x1383('0xa')](_0x20ee6b,function(_0x452dc9){if(_0x452dc9['type'][_0x1383('0xa6')]!==_0x1383('0xa7')){var _0x50815e={};_0x50815e[_0x452dc9['field']]={'$like':'%'+_0x4ae832[_0x1383('0x87')][_0x1383('0x4')]+'%'};return _0x50815e;}})});}var _0x1f247d=[];var _0x35d60f=null;var _0x5f079d={};if(_0x42e576){_0x35d60f=_[_0x1383('0x90')](_0x38b24b,[_0x1383('0x19'),_0x42e576[_0x1383('0x19')]]);if(_0x35d60f[_0x1383('0x5')]){_0x5f079d={};if(_0x448e13[_0x1383('0x15')]===_0x1383('0xf')){_0x5f079d[_0x35d60f[_0x1383('0xa8')]]=_[_0x1383('0xa')](_0x42e576[_0x1383('0x9')],'id');}else{_0x5f079d[_0x35d60f[_0x1383('0xa8')]]=_0x42e576['associatedResources'];}_0x1f247d['push'](_0x5f079d);}else{_0x200e76[_0x1383('0xa3')]['id']=_0x42e576[_0x1383('0x9')];}}else{for(var _0x540924=0x0;_0x540924<_0x2a1aa8[_0x1383('0x97')];_0x540924++){_0x35d60f=_[_0x1383('0x90')](_0x38b24b,[_0x1383('0x19'),_0x2a1aa8[_0x540924][_0x1383('0x19')]]);if(_0x35d60f[_0x1383('0x5')]){_0x5f079d={};_0x5f079d[_0x35d60f[_0x1383('0xa8')]]=_0x2a1aa8[_0x540924][_0x1383('0x9')];_0x1f247d[_0x1383('0x95')](_0x5f079d);}else{if(!_0x200e76[_0x1383('0xa3')]['id'])_0x200e76[_0x1383('0xa3')]['id']=[];_0x2a1aa8[_0x540924][_0x1383('0x9')][_0x1383('0xa9')](function(_0xe10b76){_0x200e76[_0x1383('0xa3')]['id'][_0x1383('0x95')](_0xe10b76);});}}}if(!_['isEmpty'](_0x1f247d)){_0x200e76[_0x1383('0xa3')]=_['merge'](_0x200e76[_0x1383('0xa3')],{'$and':{'$or':_0x1f247d}});}_0x200e76=_[_0x1383('0xa5')]({},_0x200e76,_0x4ae832['options']);if(_0x42e576&&!_0x42e576[_0x1383('0x96')]&&_0x448e13['childModel']===_0x1383('0xf')){if(_0x4ae832[_0x1383('0x87')][_0x1383('0xaa')]){_0x200e76[_0x1383('0xab')]=[{'all':!![]}];}return _0x391bef[_0x448e13['childModel']][_0x1383('0x7')](_0x200e76)['then'](function(_0x1aeef5){var _0x39ad3b=[];_0x1aeef5[_0x1383('0xa9')](function(_0x51217b){var _0x2026fd;switch(_0x51217b[_0x1383('0xac')]){case _0x1383('0xad'):_0x2026fd=_[_0x1383('0x90')](_0x42e576['associatedResources'],function(_0x5cd5c8){return _0x5cd5c8['id']===_0x51217b['reportId']&&_0x5cd5c8['type']===_0x1383('0xae');});break;case'custom':_0x2026fd=_['find'](_0x42e576[_0x1383('0x9')],function(_0x1b10fe){return _0x1b10fe['id']===_0x51217b[_0x1383('0x79')]&&_0x1b10fe[_0x1383('0x11')]===_0x1383('0xaf');});break;}if(_0x2026fd)_0x39ad3b[_0x1383('0x95')](_0x51217b);});_0x15b538[_0x1383('0xb0')]=_0x39ad3b[_0x1383('0x97')];_0x15b538[_0x1383('0xb1')]=_0x39ad3b;return _0x15b538;});}else{return _0x391bef[_0x448e13[_0x1383('0x15')]]['count']({'where':_0x200e76['where']})[_0x1383('0x8')](function(_0x56aaa7){_0x15b538[_0x1383('0xb0')]=_0x56aaa7;if(_0x4ae832[_0x1383('0x87')]['includeAll']){if(_0x448e13['childModel']===_0x1383('0x1d')){_0x200e76[_0x1383('0xab')]=[{'model':_0x391bef[_0x1383('0x6e')],'as':'Tags','attributes':['id',_0x1383('0x19'),'color'],'required':_0x4ae832[_0x1383('0x87')][_0x1383('0xb2')]?!![]:![]},{'model':_0x391bef['Tag'],'as':_0x1383('0xb3'),'attributes':['id',_0x1383('0x19'),_0x1383('0xb4')],'through':_0x4ae832['query'][_0x1383('0xb2')]?{'attributes':[],'where':{'TagId':_0x4ae832['query'][_0x1383('0xb2')]||undefined}}:{},'required':_0x4ae832['query'][_0x1383('0xb2')]?!![]:![]}];}else{_0x200e76[_0x1383('0xab')]=[{'all':!![]}];}}return _0x391bef[_0x448e13['childModel']][_0x1383('0x7')](_0x200e76);})['then'](function(_0x337243){_0x15b538[_0x1383('0xb1')]=_0x337243;if(_0x1cd59b===_0x1383('0x56')&&_0x4ae832[_0x1383('0x87')]['openTabs']===_0x1383('0xb5')){var _0x10b1d2=[];for(var _0x1790bf=0x0;_0x1790bf<_0x15b538[_0x1383('0xb1')][_0x1383('0x97')];_0x1790bf++){_0x10b1d2[_0x1383('0x95')](_0x316e36(_0x1383('0xb6'),_0x15b538[_0x1383('0xb1')][_0x1790bf][_0x1383('0xb7')]));_0x10b1d2[_0x1383('0x95')](_0x316e36('sms',_0x15b538[_0x1383('0xb1')][_0x1790bf][_0x1383('0xb7')]));_0x10b1d2[_0x1383('0x95')](_0x316e36(_0x1383('0xb8'),_0x15b538['rows'][_0x1790bf][_0x1383('0xb7')]));_0x10b1d2[_0x1383('0x95')](_0x316e36(_0x1383('0xb9'),_0x15b538[_0x1383('0xb1')][_0x1790bf][_0x1383('0xb7')]));_0x10b1d2[_0x1383('0x95')](_0x316e36(_0x1383('0xba'),_0x15b538[_0x1383('0xb1')][_0x1790bf][_0x1383('0xb7')]));_0x10b1d2[_0x1383('0x95')](_0x316e36('whatsapp',_0x15b538[_0x1383('0xb1')][_0x1790bf]['dataValues']));}return Promise[_0x1383('0x91')](_0x10b1d2)['then'](function(){return _0x15b538;});}return _0x15b538;});}});}}});}; \ No newline at end of file +var _0xf61e=['forEach','reportType','default','DefaultReports','CustomReports','count','rows','includeAll','include','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','openchannel','whatsapp','all','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','associatedResources','map','catch','findAll','then','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','VoiceQueues','queue','QueueCampaigns','VoiceQueue','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','queuecampaigns','agents','telephones','Users','user','Telephones','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Dashboard','pauses','Pause','scheduler','Schedule','Sound','Tag','Template','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','find','params','ignore','union','length','push','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','key','foreignKey','merge','options'];(function(_0x39f3f8,_0x447299){var _0x946011=function(_0x361815){while(--_0x361815){_0x39f3f8['push'](_0x39f3f8['shift']());}};_0x946011(++_0x447299);}(_0xf61e,0x191));var _0xef61=function(_0x3746bf,_0x34a715){_0x3746bf=_0x3746bf-0x0;var _0x56c54f=_0xf61e[_0x3746bf];return _0x56c54f;};'use strict';var _=require(_0xef61('0x0'));var attributes=require(_0xef61('0x1'));var qs=require(_0xef61('0x2'));var squel=require(_0xef61('0x3'));module[_0xef61('0x4')]=function(_0xeccd26){var _0x3613e6=_0xeccd26[_0xef61('0x5')];function _0x2bd1d0(_0x14122a,_0x239fa9){return new Promise(function(_0x45a18d,_0x5b00b2){if(!_0x239fa9)return _0x45a18d(null);var _0x9e17f4=_0x239fa9[_0xef61('0x6')]?{[_0x239fa9['filter'][_0xef61('0x7')]]:_0x239fa9[_0xef61('0x6')][_0xef61('0x8')]}:undefined;return _0x3613e6[_0x14122a]['findAll']({'where':_0x9e17f4,'raw':!![]})['then'](function(_0x188894){_0x239fa9[_0xef61('0x9')]=_[_0xef61('0xa')](_0x188894,'id');_0x45a18d(_0x239fa9);})[_0xef61('0xb')](function(_0x2af74c){_0x5b00b2(_0x2af74c);});});}function _0xdcd707(_0x1394af,_0x129874){return new Promise(function(_0x237f43,_0x66e7b2){var _0x28d4f7=_0x1394af[_0xef61('0x6')]?{[_0x1394af[_0xef61('0x6')][_0xef61('0x7')]]:_0x1394af['filter'][_0xef61('0x8')]}:undefined;return _0x3613e6[_0x1394af['model']][_0xef61('0xc')]({'where':_0x28d4f7,'raw':!![]})[_0xef61('0xd')](function(_0x370ee0){_0x129874[_0xef61('0x9')]=_['map'](_0x370ee0,function(_0x2ac1b2){return _0x2ac1b2[_0xef61('0xe')];});_0x237f43(_0x129874);})[_0xef61('0xb')](function(_0x78ff22){_0x66e7b2(_0x78ff22);});});}function _0x588a61(_0x66fa62,_0xbe23a7,_0x4f7a62){if(!_0xbe23a7)return Promise[_0xef61('0xf')](null);return new Promise(function(_0x408541,_0x36f558){return _0x3613e6[_0xef61('0x10')][_0xef61('0xc')]({'where':{'sectionId':_0xbe23a7['id']},'raw':!![]})[_0xef61('0xd')](function(_0xdd5e38){if(_0x66fa62['field']&&_0x66fa62[_0xef61('0x7')]!=='id'){_0xbe23a7[_0xef61('0x9')]=_['map'](_0xdd5e38,function(_0xb7ba69){return _0xb7ba69[_0x66fa62[_0xef61('0x7')]];});}else{if(_0x4f7a62===_0xef61('0x11')){_0xbe23a7[_0xef61('0x9')]=_[_0xef61('0xa')](_0xdd5e38,function(_0x2ed61e){return{'id':_0x2ed61e[_0xef61('0x12')],'type':_0x2ed61e['type']};});}else{_0xbe23a7['associatedResources']=_[_0xef61('0xa')](_0xdd5e38,function(_0x58bd7d){return _0x58bd7d[_0xef61('0x12')];});}}_0x408541(_0xbe23a7);})['catch'](function(_0x488b47){_0x36f558(_0x488b47);});});}function _0x2f0569(_0x5ce99d,_0x53181b){var _0xfbee94={'parentSections':[]};switch(_0x5ce99d[_0xef61('0x13')]()){case _0xef61('0x14'):_0xfbee94[_0xef61('0x15')]='SquareProject';break;case _0xef61('0x16'):_0xfbee94['childModel']=_0xef61('0x17');break;case _0xef61('0x18'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x19');_0xfbee94[_0xef61('0x1a')]=[{'name':_0xef61('0x1b'),'field':_0xef61('0xe'),'foreignKey':_0xef61('0x1c')}];break;case _0xef61('0x1d'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x1e');break;case _0xef61('0x1f'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x20');_0xfbee94[_0xef61('0x1a')]=[{'name':_0xef61('0x21'),'field':'id','foreignKey':_0xef61('0x22')}];break;case _0xef61('0x23'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x24');break;case _0xef61('0x25'):_0xfbee94[_0xef61('0x15')]='CmCompany';break;case'globalcustomfields':_0xfbee94[_0xef61('0x15')]=_0xef61('0x26');break;case _0xef61('0x27'):_0xfbee94['childModel']=_0xef61('0x28');break;case _0xef61('0x29'):_0xfbee94['childModel']=_0xef61('0x2a');break;case'faxqueues':_0xfbee94['childModel']=_0xef61('0x2b');break;case'faxaccounts':_0xfbee94[_0xef61('0x15')]='FaxAccount';break;case _0xef61('0x2c'):case _0xef61('0x2d'):case _0xef61('0x2e'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x2f');break;case _0xef61('0x30'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x31');break;case _0xef61('0x32'):_0xfbee94[_0xef61('0x15')]='VoiceMail';break;case _0xef61('0x33'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x34');_0xfbee94[_0xef61('0x1a')]=[{'name':_0xef61('0x35'),'field':'name','foreignKey':_0xef61('0x36'),'model':_0xef61('0x37'),'filter':{'field':_0xef61('0x38'),'value':['agent']}},{'name':'Telephones','field':'name','foreignKey':_0xef61('0x36'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0xef61('0x39'),'field':_0xef61('0xe'),'foreignKey':_0xef61('0x3a'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0xef61('0x3b'),'field':_0xef61('0xe'),'foreignKey':'queue','model':_0xef61('0x3c'),'filter':{'field':_0xef61('0x3d'),'value':[_0xef61('0x3e')]}}];break;case _0xef61('0x3f'):_0xfbee94['childModel']=_0xef61('0x40');break;case _0xef61('0x41'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x42');break;case'voiceprefixes':_0xfbee94['childModel']=_0xef61('0x43');break;case _0xef61('0x44'):_0xfbee94[_0xef61('0x15')]='Campaign';break;case _0xef61('0x45'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x46');break;case _0xef61('0x47'):_0xfbee94['childModel']='MailAccount';break;case'mailsubstatuses':_0xfbee94[_0xef61('0x15')]=_0xef61('0x48');break;case _0xef61('0x49'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x4a');break;case _0xef61('0x4b'):_0xfbee94[_0xef61('0x15')]='OpenchannelAccount';break;case _0xef61('0x4c'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x4d');break;case _0xef61('0x4e'):_0xfbee94['childModel']=_0xef61('0x4f');break;case _0xef61('0x50'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x51');break;case _0xef61('0x52'):_0xfbee94[_0xef61('0x15')]='WhatsappAccount';break;case _0xef61('0x53'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x54');break;case'voicequeues':case _0xef61('0x55'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x3c');if(_0x53181b){_0xfbee94[_0xef61('0x1a')]=[{'name':_0xef61('0x39')},{'name':_0xef61('0x3b')}];}break;case'users':case _0xef61('0x56'):case _0xef61('0x57'):_0xfbee94['childModel']=_0xef61('0x37');if(_0x53181b){_0xfbee94[_0xef61('0x1a')]=[{'name':_0xef61('0x58'),'filter':{'field':_0xef61('0x38'),'value':['admin',_0xef61('0x59')]},'ignore':!![]},{'name':_0xef61('0x35')},{'name':_0xef61('0x5a')}];}break;case'zendeskaccounts':_0xfbee94[_0xef61('0x15')]=_0xef61('0x5b');break;case'salesforceaccounts':_0xfbee94[_0xef61('0x15')]=_0xef61('0x5c');break;case _0xef61('0x5d'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x5e');break;case _0xef61('0x5f'):_0xfbee94[_0xef61('0x15')]='SugarcrmAccount';break;case _0xef61('0x60'):_0xfbee94['childModel']=_0xef61('0x61');break;case _0xef61('0x62'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x63');break;case _0xef61('0x64'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x37');break;case _0xef61('0x65'):_0xfbee94[_0xef61('0x15')]='CannedAnswer';break;case _0xef61('0x66'):_0xfbee94[_0xef61('0x15')]='Disposition';break;case'customdashboards':_0xfbee94[_0xef61('0x15')]=_0xef61('0x67');break;case'intervals':_0xfbee94[_0xef61('0x15')]='Interval';break;case _0xef61('0x68'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x69');break;case _0xef61('0x6a'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x6b');break;case'sounds':_0xfbee94[_0xef61('0x15')]=_0xef61('0x6c');break;case'tags':_0xfbee94[_0xef61('0x15')]=_0xef61('0x6d');break;case'templates':_0xfbee94['childModel']=_0xef61('0x6e');break;case'triggers':_0xfbee94['childModel']='Trigger';break;case _0xef61('0x6f'):_0xfbee94[_0xef61('0x15')]='Trunk';break;case _0xef61('0x70'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x71');break;case _0xef61('0x72'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x73');break;case _0xef61('0x74'):_0xfbee94[_0xef61('0x15')]='AnalyticExtractedReport';_0xfbee94['parentSections']=[{'name':_0xef61('0x75'),'field':'id','foreignKey':_0xef61('0x76')}];break;case _0xef61('0x77'):_0xfbee94[_0xef61('0x15')]=_0xef61('0x78');break;}return _0xfbee94;}function _0x5a6d4b(_0x258d9d,_0x572d5f){var _0x5f3b97=_0x258d9d[_0xef61('0x79')](0x0)[_0xef61('0x7a')]()+_0x258d9d[_0xef61('0x7b')](0x1);var _0x525a5e={'type':_0x3613e6[_0xef61('0x7c')][_0xef61('0x7d')][_0xef61('0x7e')],'raw':!![]};return new Promise(function(_0x824157,_0x156888){var _0x2946c6=squel[_0xef61('0x7f')]()[_0xef61('0x7')](_0xef61('0x80')+_0x5f3b97+_0xef61('0x81'),'id')['field'](_0xef61('0x82'))['from']('user_has_'+_0x258d9d+_0xef61('0x83'),'ui')[_0xef61('0x84')](_0xef61('0x85'),_0x572d5f['id']);return _0x3613e6[_0xef61('0x86')][_0xef61('0x87')](_0x2946c6[_0xef61('0x88')](),_0x525a5e)['then'](function(_0x4c7a9a){_0x572d5f[_0x5f3b97+_0xef61('0x89')]=_0x4c7a9a;_0x824157(_0x4c7a9a);})[_0xef61('0xb')](function(_0x362c13){_0x156888(_0x362c13);});});}return _0xeccd26[_0xef61('0x8a')](_0xef61('0x8b'),attributes,{'tableName':_0xef61('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x7f4a77){var _0x33f585={'raw':![],'where':{}};var _0x6d36e5={};var _0x5733c7={'count':0x0,'rows':[]};var _0x4433ed=_0x7f4a77['query'][_0xef61('0x8d')];var _0x1e6b02=_0x7f4a77['query'][_0xef61('0x8e')]||![];var _0x1856ee=_0x2f0569(_0x4433ed,_0x1e6b02);if(!_0x1856ee[_0xef61('0x15')])throw new Error(_0xef61('0x8f')+_0x4433ed+'\x27');var _0x2cc99d=[{'name':_0x4433ed}];if(!_[_0xef61('0x90')](_0x1856ee[_0xef61('0x1a')]))_0x2cc99d=_0x1856ee[_0xef61('0x1a')];var _0x5eccb3=[];for(var _0x3ecb8d=0x0;_0x3ecb8d<_0x2cc99d['length'];_0x3ecb8d++){_0x5eccb3['push'](_0x3613e6['UserProfileSection'][_0xef61('0x91')]({'where':{'userProfileId':_0x7f4a77[_0xef61('0x92')]['id'],'name':_0x2cc99d[_0x3ecb8d][_0xef61('0xe')]},'raw':!![]}));}return Promise['all'](_0x5eccb3)[_0xef61('0xd')](function(_0x261859){var _0x27df9b=_[_0xef61('0x6')](_0x261859,function(_0x2cdac9){return _0x2cdac9?_0x2cdac9:undefined;});var _0x8708d6=_[_0xef61('0x6')](_0x2cc99d,[_0xef61('0x93'),!![]]);var _0x235458=_[_0xef61('0x90')](_0x27df9b)&&_[_0xef61('0x90')](_0x8708d6)?null:_[_0xef61('0x94')](_0x8708d6,_0x27df9b);if(!_0x235458)return null;var _0x3b3916=[];for(var _0x2bb5f5=0x0;_0x2bb5f5<_0x235458[_0xef61('0x95')];_0x2bb5f5++){var _0x5931a4=_[_0xef61('0x91')](_0x2cc99d,function(_0x117d37){return _0x235458[_0x2bb5f5]?_0x117d37['name']===_0x235458[_0x2bb5f5][_0xef61('0xe')]:null;});if(_0x5931a4){if(_0x235458[_0x2bb5f5][_0xef61('0x93')]){_0x3b3916[_0xef61('0x96')](_0x2bd1d0(_0x1856ee[_0xef61('0x15')],_0x235458[_0x2bb5f5]));}else{if(!_0x235458[_0x2bb5f5][_0xef61('0x97')]){_0x3b3916[_0xef61('0x96')](_0x588a61(_0x5931a4,_0x235458[_0x2bb5f5],_0x1856ee['childModel']));}else{if(_0x5931a4[_0xef61('0x98')]){_0x3b3916[_0xef61('0x96')](_0xdcd707(_0x5931a4,_0x235458[_0x2bb5f5]));}}}}}return Promise['all'](_0x3b3916);})[_0xef61('0xd')](function(_0x54777a){var _0xe62ec2=_0x54777a;var _0x381336=null;if(_0xe62ec2){_0x381336=_0xe62ec2['length']===0x1?_0xe62ec2[0x0]:null;}if(!_0x381336&&!_0xe62ec2)return _0x5733c7;var _0x22575e=_0x3613e6[_0x1856ee['childModel']][_0xef61('0x99')];_0x6d36e5[_0xef61('0x98')]=_['keys'](_0x22575e);_0x6d36e5['query']=_[_0xef61('0x9a')](_0x7f4a77[_0xef61('0x87')]);_0x6d36e5[_0xef61('0x9b')]=_[_0xef61('0x9c')](_0x6d36e5[_0xef61('0x98')],_0x6d36e5['query']);_0x33f585[_0xef61('0x9d')]=_[_0xef61('0x9c')](_0x6d36e5[_0xef61('0x98')],qs[_0xef61('0x9e')](_0x7f4a77[_0xef61('0x87')][_0xef61('0x9e')]));_0x33f585['attributes']=_0x33f585[_0xef61('0x9d')]['length']?_0x33f585[_0xef61('0x9d')]:_0x6d36e5[_0xef61('0x98')];if(!_0x7f4a77[_0xef61('0x87')][_0xef61('0x9f')](_0xef61('0xa0'))){_0x33f585[_0xef61('0xa1')]=qs[_0xef61('0xa1')](_0x7f4a77[_0xef61('0x87')][_0xef61('0xa1')]);_0x33f585[_0xef61('0xa2')]=qs[_0xef61('0xa2')](_0x7f4a77[_0xef61('0x87')][_0xef61('0xa2')]);}_0x33f585['order']=qs[_0xef61('0xa3')](_0x7f4a77[_0xef61('0x87')][_0xef61('0xa3')]);_0x33f585[_0xef61('0x84')]=qs['filters'](_[_0xef61('0xa4')](_0x7f4a77['query'],_0x6d36e5['filters']));if(_0x7f4a77[_0xef61('0x87')]['filter']){_0x33f585[_0xef61('0x84')]=_['merge'](_0x33f585['where'],{'$or':_[_0xef61('0xa')](_0x22575e,function(_0x303829){if(_0x303829['type'][_0xef61('0xa5')]!=='VIRTUAL'){var _0x11f9c8={};_0x11f9c8[_0x303829[_0xef61('0x7')]]={'$like':'%'+_0x7f4a77[_0xef61('0x87')][_0xef61('0x6')]+'%'};return _0x11f9c8;}})});}var _0x531587=[];var _0x1488c0=null;var _0x59813e={};if(_0x381336){_0x1488c0=_[_0xef61('0x91')](_0x2cc99d,[_0xef61('0xe'),_0x381336[_0xef61('0xe')]]);if(_0x1488c0[_0xef61('0x7')]){_0x59813e={};if(_0x1856ee[_0xef61('0x15')]===_0xef61('0x11')){_0x59813e[_0x1488c0[_0xef61('0xa6')]]=_[_0xef61('0xa')](_0x381336[_0xef61('0x9')],'id');}else{_0x59813e[_0x1488c0['foreignKey']]=_0x381336[_0xef61('0x9')];}_0x531587['push'](_0x59813e);}else{_0x33f585[_0xef61('0x84')]['id']=_0x381336[_0xef61('0x9')];}}else{for(var _0x5db4a0=0x0;_0x5db4a0<_0xe62ec2[_0xef61('0x95')];_0x5db4a0++){_0x1488c0=_['find'](_0x2cc99d,['name',_0xe62ec2[_0x5db4a0][_0xef61('0xe')]]);if(_0x1488c0[_0xef61('0x7')]){_0x59813e={};_0x59813e[_0x1488c0['foreignKey']]=_0xe62ec2[_0x5db4a0][_0xef61('0x9')];_0x531587[_0xef61('0x96')](_0x59813e);}else{if(!_0x33f585['where']['id'])_0x33f585[_0xef61('0x84')]['id']=[];_0xe62ec2[_0x5db4a0][_0xef61('0x9')]['forEach'](function(_0x6539a5){_0x33f585['where']['id'][_0xef61('0x96')](_0x6539a5);});}}}if(!_[_0xef61('0x90')](_0x531587)){_0x33f585[_0xef61('0x84')]=_[_0xef61('0xa7')](_0x33f585['where'],{'$and':{'$or':_0x531587}});}_0x33f585=_[_0xef61('0xa7')]({},_0x33f585,_0x7f4a77[_0xef61('0xa8')]);if(_0x381336&&!_0x381336[_0xef61('0x97')]&&_0x1856ee['childModel']===_0xef61('0x11')){if(_0x7f4a77[_0xef61('0x87')]['includeAll']){_0x33f585['include']=[{'all':!![]}];}return _0x3613e6[_0x1856ee[_0xef61('0x15')]][_0xef61('0xc')](_0x33f585)[_0xef61('0xd')](function(_0x3d829e){var _0x15ddb0=[];_0x3d829e[_0xef61('0xa9')](function(_0x1b669a){var _0x113f9c;switch(_0x1b669a[_0xef61('0xaa')]){case _0xef61('0xab'):_0x113f9c=_[_0xef61('0x91')](_0x381336[_0xef61('0x9')],function(_0x1cd4b6){return _0x1cd4b6['id']===_0x1b669a[_0xef61('0x76')]&&_0x1cd4b6[_0xef61('0x3d')]===_0xef61('0xac');});break;case'custom':_0x113f9c=_[_0xef61('0x91')](_0x381336[_0xef61('0x9')],function(_0x29ef7f){return _0x29ef7f['id']===_0x1b669a[_0xef61('0x76')]&&_0x29ef7f[_0xef61('0x3d')]===_0xef61('0xad');});break;}if(_0x113f9c)_0x15ddb0[_0xef61('0x96')](_0x1b669a);});_0x5733c7[_0xef61('0xae')]=_0x15ddb0[_0xef61('0x95')];_0x5733c7[_0xef61('0xaf')]=_0x15ddb0;return _0x5733c7;});}else{return _0x3613e6[_0x1856ee[_0xef61('0x15')]][_0xef61('0xae')]({'where':_0x33f585['where']})[_0xef61('0xd')](function(_0xe465b9){_0x5733c7['count']=_0xe465b9;if(_0x7f4a77[_0xef61('0x87')][_0xef61('0xb0')]){if(_0x1856ee[_0xef61('0x15')]===_0xef61('0x20')){_0x33f585[_0xef61('0xb1')]=[{'model':_0x3613e6['Tag'],'as':_0xef61('0xb2'),'attributes':['id','name',_0xef61('0xb3')],'required':_0x7f4a77[_0xef61('0x87')][_0xef61('0xb4')]?!![]:![]},{'model':_0x3613e6[_0xef61('0x6d')],'as':_0xef61('0xb5'),'attributes':['id',_0xef61('0xe'),_0xef61('0xb3')],'through':_0x7f4a77[_0xef61('0x87')]['tag']?{'attributes':[],'where':{'TagId':_0x7f4a77[_0xef61('0x87')][_0xef61('0xb4')]||undefined}}:{},'required':_0x7f4a77[_0xef61('0x87')][_0xef61('0xb4')]?!![]:![]}];}else{_0x33f585[_0xef61('0xb1')]=[{'all':!![]}];}}return _0x3613e6[_0x1856ee[_0xef61('0x15')]][_0xef61('0xc')](_0x33f585);})[_0xef61('0xd')](function(_0x338d4f){_0x5733c7['rows']=_0x338d4f;if(_0x4433ed===_0xef61('0x35')&&_0x7f4a77[_0xef61('0x87')][_0xef61('0xb6')]===_0xef61('0xb7')){var _0x5d8ee9=[];for(var _0x56535f=0x0;_0x56535f<_0x5733c7[_0xef61('0xaf')][_0xef61('0x95')];_0x56535f++){_0x5d8ee9[_0xef61('0x96')](_0x5a6d4b(_0xef61('0xb8'),_0x5733c7[_0xef61('0xaf')][_0x56535f][_0xef61('0xb9')]));_0x5d8ee9[_0xef61('0x96')](_0x5a6d4b('sms',_0x5733c7[_0xef61('0xaf')][_0x56535f][_0xef61('0xb9')]));_0x5d8ee9[_0xef61('0x96')](_0x5a6d4b(_0xef61('0xba'),_0x5733c7[_0xef61('0xaf')][_0x56535f]['dataValues']));_0x5d8ee9[_0xef61('0x96')](_0x5a6d4b('mail',_0x5733c7[_0xef61('0xaf')][_0x56535f][_0xef61('0xb9')]));_0x5d8ee9[_0xef61('0x96')](_0x5a6d4b(_0xef61('0xbb'),_0x5733c7[_0xef61('0xaf')][_0x56535f][_0xef61('0xb9')]));_0x5d8ee9['push'](_0x5a6d4b(_0xef61('0xbc'),_0x5733c7[_0xef61('0xaf')][_0x56535f][_0xef61('0xb9')]));}return Promise[_0xef61('0xbd')](_0x5d8ee9)[_0xef61('0xd')](function(){return _0x5733c7;});}return _0x5733c7;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6de4308..1339e84 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 _0x6299=['request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register'];(function(_0x188fc,_0x142cd0){var _0x51a287=function(_0x3e1cc0){while(--_0x3e1cc0){_0x188fc['push'](_0x188fc['shift']());}};_0x51a287(++_0x142cd0);}(_0x6299,0x169));var _0x9629=function(_0x27a5b4,_0x394324){_0x27a5b4=_0x27a5b4-0x0;var _0xead9a=_0x6299[_0x27a5b4];return _0xead9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9629('0x0'));var BPromise=require(_0x9629('0x1'));var rs=require(_0x9629('0x2'));var fs=require('fs');var Redis=require(_0x9629('0x3'));var db=require(_0x9629('0x4'))['db'];var utils=require(_0x9629('0x5'));var logger=require('../../config/logger')(_0x9629('0x6'));var config=require(_0x9629('0x7'));var jayson=require(_0x9629('0x8'));var client=jayson[_0x9629('0x9')][_0x9629('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9629('0xb')],{'host':_0x9629('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x9629('0xd')](socket);function respondWithRpcPromise(_0x377d78,_0x452f02,_0x5108db){return new BPromise(function(_0x2f2382,_0x3493de){return client[_0x9629('0xe')](_0x377d78,_0x5108db)['then'](function(_0x3d7b90){logger[_0x9629('0xf')](_0x9629('0x10'),_0x452f02,_0x9629('0x11'));logger[_0x9629('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x452f02,_0x9629('0x11'),JSON[_0x9629('0x13')](_0x3d7b90));if(_0x3d7b90[_0x9629('0x14')]){if(_0x3d7b90[_0x9629('0x14')][_0x9629('0x15')]===0x1f4){logger[_0x9629('0x14')]('UserProfile,\x20%s,\x20%s',_0x452f02,_0x3d7b90[_0x9629('0x14')][_0x9629('0x16')]);return _0x3493de(_0x3d7b90[_0x9629('0x14')][_0x9629('0x16')]);}logger[_0x9629('0x14')](_0x9629('0x10'),_0x452f02,_0x3d7b90['error'][_0x9629('0x16')]);return _0x2f2382(_0x3d7b90[_0x9629('0x14')][_0x9629('0x16')]);}else{logger[_0x9629('0xf')](_0x9629('0x10'),_0x452f02,_0x9629('0x11'));_0x2f2382(_0x3d7b90[_0x9629('0x17')][_0x9629('0x16')]);}})[_0x9629('0x18')](function(_0x59e86b){logger[_0x9629('0x14')]('UserProfile,\x20%s,\x20%s',_0x452f02,_0x59e86b);_0x3493de(_0x59e86b);});});} \ No newline at end of file +var _0xc359=['./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','localhost','socket.io-emitter'];(function(_0x39a3b2,_0x15f086){var _0x18f6e6=function(_0x1dc121){while(--_0x1dc121){_0x39a3b2['push'](_0x39a3b2['shift']());}};_0x18f6e6(++_0x15f086);}(_0xc359,0x1d9));var _0x9c35=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xc359[_0x421196];return _0x2738af;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var moment=require('moment');var BPromise=require(_0x9c35('0x1'));var rs=require(_0x9c35('0x2'));var fs=require('fs');var Redis=require(_0x9c35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c35('0x4'));var logger=require('../../config/logger')(_0x9c35('0x5'));var config=require('../../config/environment');var jayson=require(_0x9c35('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9c35('0x7')],{'host':_0x9c35('0x8'),'port':0x18eb});var socket=require(_0x9c35('0x9'))(new Redis(config[_0x9c35('0x7')]));require(_0x9c35('0xa'))[_0x9c35('0xb')](socket);function respondWithRpcPromise(_0x56d3fb,_0x21df9a,_0x467add){return new BPromise(function(_0x500420,_0x4e3834){return client['request'](_0x56d3fb,_0x467add)[_0x9c35('0xc')](function(_0x4d012f){logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));logger['debug'](_0x9c35('0x10'),_0x21df9a,_0x9c35('0xf'),JSON[_0x9c35('0x11')](_0x4d012f));if(_0x4d012f[_0x9c35('0x12')]){if(_0x4d012f[_0x9c35('0x12')]['code']===0x1f4){logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x4e3834(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x500420(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}else{logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));_0x500420(_0x4d012f['result'][_0x9c35('0x13')]);}})[_0x9c35('0x14')](function(_0x26911d){logger[_0x9c35('0x12')]('UserProfile,\x20%s,\x20%s',_0x21df9a,_0x26911d);_0x4e3834(_0x26911d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d19b148..2a5d8f1 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 _0xb580=['update','removeListener','length','./userProfile.events','save'];(function(_0x1c3584,_0x520835){var _0x289bc0=function(_0x50da22){while(--_0x50da22){_0x1c3584['push'](_0x1c3584['shift']());}};_0x289bc0(++_0x520835);}(_0xb580,0x7b));var _0x0b58=function(_0x389e28,_0x2e7c7b){_0x389e28=_0x389e28-0x0;var _0x280391=_0xb580[_0x389e28];return _0x280391;};'use strict';var UserProfileEvents=require(_0x0b58('0x0'));var events=[_0x0b58('0x1'),'remove',_0x0b58('0x2')];function createListener(_0x1e0469,_0x49f2e1){return function(_0x1dcfcd){_0x49f2e1['emit'](_0x1e0469,_0x1dcfcd);};}function removeListener(_0x39b4e6,_0x4aaee8){return function(){UserProfileEvents[_0x0b58('0x3')](_0x39b4e6,_0x4aaee8);};}exports['register']=function(_0x302ffd){for(var _0x128a9c=0x0,_0x1a25ad=events[_0x0b58('0x4')];_0x128a9c<_0x1a25ad;_0x128a9c++){var _0x5bc334=events[_0x128a9c];var _0x1f1c74=createListener('userProfile:'+_0x5bc334,_0x302ffd);UserProfileEvents['on'](_0x5bc334,_0x1f1c74);}}; \ No newline at end of file +var _0x5367=['userProfile:','./userProfile.events','save','remove','removeListener','register'];(function(_0x4a5122,_0x2e99c4){var _0x1a0459=function(_0x576ce7){while(--_0x576ce7){_0x4a5122['push'](_0x4a5122['shift']());}};_0x1a0459(++_0x2e99c4);}(_0x5367,0x115));var _0x7536=function(_0xa13973,_0x5a73ca){_0xa13973=_0xa13973-0x0;var _0x64c757=_0x5367[_0xa13973];return _0x64c757;};'use strict';var UserProfileEvents=require(_0x7536('0x0'));var events=[_0x7536('0x1'),_0x7536('0x2'),'update'];function createListener(_0x5c6943,_0x4e047b){return function(_0x436332){_0x4e047b['emit'](_0x5c6943,_0x436332);};}function removeListener(_0x48450d,_0x47032c){return function(){UserProfileEvents[_0x7536('0x3')](_0x48450d,_0x47032c);};}exports[_0x7536('0x4')]=function(_0xc64971){for(var _0x326177=0x0,_0x5542e3=events['length'];_0x326177<_0x5542e3;_0x326177++){var _0xd45a=events[_0x326177];var _0x509181=createListener(_0x7536('0x5')+_0xd45a,_0xc64971);UserProfileEvents['on'](_0xd45a,_0x509181);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 000c4e3..89bd9c4 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 _0x924e=['destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x924e,0xce));var _0xe924=function(_0x4e0e36,_0x5ded03){_0x4e0e36=_0x4e0e36-0x0;var _0x44943b=_0x924e[_0x4e0e36];return _0x44943b;};'use strict';var multer=require('multer');var util=require(_0xe924('0x0'));var path=require('path');var timeout=require(_0xe924('0x1'));var express=require(_0xe924('0x2'));var router=express[_0xe924('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe924('0x4'));var interaction=require(_0xe924('0x5'));var config=require(_0xe924('0x6'));var controller=require(_0xe924('0x7'));router[_0xe924('0x8')]('/',auth[_0xe924('0x9')](),controller[_0xe924('0xa')]);router[_0xe924('0x8')]('/describe',auth[_0xe924('0x9')](),controller[_0xe924('0xb')]);router[_0xe924('0x8')]('/:id',auth[_0xe924('0x9')](),controller['show']);router['post']('/',auth[_0xe924('0x9')](),controller['create']);router['put'](_0xe924('0xc'),auth[_0xe924('0x9')](),controller[_0xe924('0xd')]);router[_0xe924('0xe')](_0xe924('0xc'),auth[_0xe924('0x9')](),controller[_0xe924('0xf')]);module[_0xe924('0x10')]=router; \ No newline at end of file +var _0x45a7=['update','delete','destroy','multer','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put'];(function(_0x113d98,_0x1ee5f6){var _0x2fb52b=function(_0x1935b7){while(--_0x1935b7){_0x113d98['push'](_0x113d98['shift']());}};_0x2fb52b(++_0x1ee5f6);}(_0x45a7,0x19b));var _0x745a=function(_0x2bf8f2,_0x27c758){_0x2bf8f2=_0x2bf8f2-0x0;var _0x1ba2fa=_0x45a7[_0x2bf8f2];return _0x1ba2fa;};'use strict';var multer=require(_0x745a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x745a('0x1'));var router=express['Router']();var fs_extra=require(_0x745a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x745a('0x3'));var config=require(_0x745a('0x4'));var controller=require(_0x745a('0x5'));router[_0x745a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x745a('0x6')](_0x745a('0x7'),auth[_0x745a('0x8')](),controller[_0x745a('0x9')]);router[_0x745a('0x6')](_0x745a('0xa'),auth[_0x745a('0x8')](),controller['show']);router[_0x745a('0xb')]('/',auth['isAuthenticated'](),controller[_0x745a('0xc')]);router[_0x745a('0xd')](_0x745a('0xa'),auth[_0x745a('0x8')](),controller[_0x745a('0xe')]);router[_0x745a('0xf')](_0x745a('0xa'),auth[_0x745a('0x8')](),controller[_0x745a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 7e8c4bb..dc6b1ba 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 _0xc73e=['sequelize','exports','STRING','INTEGER'];(function(_0x42cb8d,_0x273bca){var _0x2713b6=function(_0x15b77f){while(--_0x15b77f){_0x42cb8d['push'](_0x42cb8d['shift']());}};_0x2713b6(++_0x273bca);}(_0xc73e,0x1b4));var _0xec73=function(_0x490c8b,_0x420b27){_0x490c8b=_0x490c8b-0x0;var _0x19ea10=_0xc73e[_0x490c8b];return _0x19ea10;};'use strict';var Sequelize=require(_0xec73('0x0'));module[_0xec73('0x1')]={'name':{'type':Sequelize[_0xec73('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xec73('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xec73('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1568=['exports','STRING','INTEGER','sequelize'];(function(_0x7ebb5b,_0xd9348b){var _0x52bc52=function(_0x15c6f4){while(--_0x15c6f4){_0x7ebb5b['push'](_0x7ebb5b['shift']());}};_0x52bc52(++_0xd9348b);}(_0x1568,0x1ab));var _0x8156=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1568[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8156('0x0'));module[_0x8156('0x1')]={'name':{'type':Sequelize[_0x8156('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8156('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 7133c67..be65db1 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 _0x5f66=['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','UserProfileResource','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','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x19ef2b,_0x354f66){var _0x4df537=function(_0x576738){while(--_0x576738){_0x19ef2b['push'](_0x19ef2b['shift']());}};_0x4df537(++_0x354f66);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file +var _0x2a07=['index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a07,0x74));var _0x72a0=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0x2a07[_0x16b55f];return _0x391c2f;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['UserProfileResource'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['UserProfileResource']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index dc1c87a..2663e98 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 _0x6185=['compositeIndex','resourceId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_profile_has_resources'];(function(_0x297dcf,_0x448cf5){var _0xe1699b=function(_0x8b1e0f){while(--_0x8b1e0f){_0x297dcf['push'](_0x297dcf['shift']());}};_0xe1699b(++_0x448cf5);}(_0x6185,0x1bc));var _0x5618=function(_0x1291f5,_0x559085){_0x1291f5=_0x1291f5-0x0;var _0x561062=_0x6185[_0x1291f5];return _0x561062;};'use strict';var _=require(_0x5618('0x0'));var util=require(_0x5618('0x1'));var logger=require(_0x5618('0x2'))('api');var moment=require(_0x5618('0x3'));var BPromise=require(_0x5618('0x4'));var rp=require(_0x5618('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5618('0x6'));var config=require(_0x5618('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x5618('0x8')]=function(_0xf38834,_0x4dd05f){return _0xf38834[_0x5618('0x9')]('UserProfileResource',attributes,{'tableName':_0x5618('0xa'),'paranoid':![],'indexes':[{'name':_0x5618('0xb'),'fields':[_0x5618('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7ef=['define','user_profile_has_resources','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userProfileResource.attributes','exports'];(function(_0x25ad11,_0x5baa9c){var _0x539a40=function(_0x38676a){while(--_0x38676a){_0x25ad11['push'](_0x25ad11['shift']());}};_0x539a40(++_0x5baa9c);}(_0xf7ef,0x16f));var _0xff7e=function(_0x476c36,_0x556ceb){_0x476c36=_0x476c36-0x0;var _0x5f3b27=_0xf7ef[_0x476c36];return _0x5f3b27;};'use strict';var _=require(_0xff7e('0x0'));var util=require(_0xff7e('0x1'));var logger=require(_0xff7e('0x2'))(_0xff7e('0x3'));var moment=require(_0xff7e('0x4'));var BPromise=require(_0xff7e('0x5'));var rp=require(_0xff7e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff7e('0x7'));var config=require('../../config/environment');var attributes=require(_0xff7e('0x8'));module[_0xff7e('0x9')]=function(_0x148957,_0x2fb31a){return _0x148957[_0xff7e('0xa')]('UserProfileResource',attributes,{'tableName':_0xff7e('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xff7e('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 59e78b4..57b0356 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 _0x308b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x308b,0x1d4));var _0xb308=function(_0x545e17,_0x4c622f){_0x545e17=_0x545e17-0x0;var _0x54bf28=_0x308b[_0x545e17];return _0x54bf28;};'use strict';var _=require(_0xb308('0x0'));var util=require(_0xb308('0x1'));var moment=require(_0xb308('0x2'));var BPromise=require(_0xb308('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb308('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb308('0x5'));var logger=require(_0xb308('0x6'))(_0xb308('0x7'));var config=require(_0xb308('0x8'));var jayson=require(_0xb308('0x9'));var client=jayson[_0xb308('0xa')][_0xb308('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x120f6c,_0x295aa3,_0x36cfe2){return new BPromise(function(_0x158db5,_0x5e4c75){return client[_0xb308('0xc')](_0x120f6c,_0x36cfe2)[_0xb308('0xd')](function(_0x41ec5e){logger[_0xb308('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x295aa3,_0xb308('0xf'));logger[_0xb308('0x10')](_0xb308('0x11'),_0x295aa3,_0xb308('0xf'),JSON[_0xb308('0x12')](_0x41ec5e));if(_0x41ec5e[_0xb308('0x13')]){if(_0x41ec5e[_0xb308('0x13')][_0xb308('0x14')]===0x1f4){logger[_0xb308('0x13')](_0xb308('0x15'),_0x295aa3,_0x41ec5e[_0xb308('0x13')][_0xb308('0x16')]);return _0x5e4c75(_0x41ec5e['error'][_0xb308('0x16')]);}logger[_0xb308('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x295aa3,_0x41ec5e[_0xb308('0x13')]['message']);return _0x158db5(_0x41ec5e[_0xb308('0x13')][_0xb308('0x16')]);}else{logger[_0xb308('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x295aa3,_0xb308('0xf'));_0x158db5(_0x41ec5e[_0xb308('0x17')][_0xb308('0x16')]);}})[_0xb308('0x18')](function(_0x1bc12b){logger['error'](_0xb308('0x15'),_0x295aa3,_0x1bc12b);_0x5e4c75(_0x1bc12b);});});} \ No newline at end of file +var _0x5ae9=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','error'];(function(_0x202c6e,_0xce0333){var _0x340491=function(_0x4228ec){while(--_0x4228ec){_0x202c6e['push'](_0x202c6e['shift']());}};_0x340491(++_0xce0333);}(_0x5ae9,0x143));var _0x95ae=function(_0x2ecbfd,_0x5bacbc){_0x2ecbfd=_0x2ecbfd-0x0;var _0x2c65a2=_0x5ae9[_0x2ecbfd];return _0x2c65a2;};'use strict';var _=require(_0x95ae('0x0'));var util=require(_0x95ae('0x1'));var moment=require(_0x95ae('0x2'));var BPromise=require(_0x95ae('0x3'));var rs=require(_0x95ae('0x4'));var fs=require('fs');var Redis=require(_0x95ae('0x5'));var db=require(_0x95ae('0x6'))['db'];var utils=require(_0x95ae('0x7'));var logger=require(_0x95ae('0x8'))('rpc');var config=require(_0x95ae('0x9'));var jayson=require(_0x95ae('0xa'));var client=jayson['client'][_0x95ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27ab87,_0x57452f,_0x21e209){return new BPromise(function(_0x30b6b3,_0x33674b){return client[_0x95ae('0xc')](_0x27ab87,_0x21e209)['then'](function(_0x34336b){logger[_0x95ae('0xd')](_0x95ae('0xe'),_0x57452f,_0x95ae('0xf'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x57452f,_0x95ae('0xf'),JSON['stringify'](_0x34336b));if(_0x34336b[_0x95ae('0x10')]){if(_0x34336b[_0x95ae('0x10')]['code']===0x1f4){logger[_0x95ae('0x10')](_0x95ae('0xe'),_0x57452f,_0x34336b[_0x95ae('0x10')][_0x95ae('0x11')]);return _0x33674b(_0x34336b[_0x95ae('0x10')][_0x95ae('0x11')]);}logger[_0x95ae('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x57452f,_0x34336b[_0x95ae('0x10')][_0x95ae('0x11')]);return _0x30b6b3(_0x34336b[_0x95ae('0x10')]['message']);}else{logger[_0x95ae('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x57452f,_0x95ae('0xf'));_0x30b6b3(_0x34336b[_0x95ae('0x12')][_0x95ae('0x11')]);}})[_0x95ae('0x13')](function(_0x9d205){logger[_0x95ae('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x57452f,_0x9d205);_0x33674b(_0x9d205);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c526c94..50c11ce 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 _0x78df=['../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x49b934,_0x5c1416){var _0xea4057=function(_0x4c2ee6){while(--_0x4c2ee6){_0x49b934['push'](_0x49b934['shift']());}};_0xea4057(++_0x5c1416);}(_0x78df,0x1f0));var _0xf78d=function(_0x543f90,_0x4a2e23){_0x543f90=_0x543f90-0x0;var _0x33afda=_0x78df[_0x543f90];return _0x33afda;};'use strict';var multer=require(_0xf78d('0x0'));var util=require(_0xf78d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf78d('0x2'));var auth=require(_0xf78d('0x3'));var interaction=require(_0xf78d('0x4'));var config=require('../../config/environment');var controller=require(_0xf78d('0x5'));router[_0xf78d('0x6')]('/',auth[_0xf78d('0x7')](),controller[_0xf78d('0x8')]);router[_0xf78d('0x6')](_0xf78d('0x9'),auth[_0xf78d('0x7')](),controller[_0xf78d('0xa')]);router[_0xf78d('0x6')](_0xf78d('0xb'),auth[_0xf78d('0x7')](),controller[_0xf78d('0xc')]);router[_0xf78d('0xd')]('/',auth[_0xf78d('0x7')](),controller[_0xf78d('0xe')]);router[_0xf78d('0xf')]('/:id',auth[_0xf78d('0x7')](),controller[_0xf78d('0x10')]);router[_0xf78d('0x11')](_0xf78d('0xb'),auth[_0xf78d('0x7')](),controller[_0xf78d('0x12')]);module[_0xf78d('0x13')]=router; \ No newline at end of file +var _0xe76a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x51e0ef,_0x3942b4){var _0x465f5f=function(_0x237bc4){while(--_0x237bc4){_0x51e0ef['push'](_0x51e0ef['shift']());}};_0x465f5f(++_0x3942b4);}(_0xe76a,0x18b));var _0xae76=function(_0x32f75b,_0x233dcb){_0x32f75b=_0x32f75b-0x0;var _0x146381=_0xe76a[_0x32f75b];return _0x146381;};'use strict';var multer=require('multer');var util=require(_0xae76('0x0'));var path=require(_0xae76('0x1'));var timeout=require(_0xae76('0x2'));var express=require(_0xae76('0x3'));var router=express['Router']();var fs_extra=require(_0xae76('0x4'));var auth=require(_0xae76('0x5'));var interaction=require(_0xae76('0x6'));var config=require(_0xae76('0x7'));var controller=require('./userProfileSection.controller');router[_0xae76('0x8')]('/',auth[_0xae76('0x9')](),controller[_0xae76('0xa')]);router[_0xae76('0x8')](_0xae76('0xb'),auth['isAuthenticated'](),controller[_0xae76('0xc')]);router[_0xae76('0x8')](_0xae76('0xd'),auth[_0xae76('0x9')](),controller[_0xae76('0xe')]);router['post']('/',auth[_0xae76('0x9')](),controller[_0xae76('0xf')]);router[_0xae76('0x10')](_0xae76('0xd'),auth[_0xae76('0x9')](),controller['update']);router[_0xae76('0x11')](_0xae76('0xd'),auth[_0xae76('0x9')](),controller[_0xae76('0x12')]);module[_0xae76('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dadd115..29b90da 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 _0xe1e3=['getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x404863,_0x188c60){_0x404863=_0x404863-0x0;var _0x501ee9=_0xe1e3[_0x404863];return _0x501ee9;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3e1e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3bacc){this[_0x3e1e('0x4')](_0x3e1e('0x5'),_0x3bacc?_0x3bacc[_0x3e1e('0x6')](''):[]);},'get':function(){return this[_0x3e1e('0x7')](_0x3e1e('0x5'))?this['getDataValue'](_0x3e1e('0x5'))[_0x3e1e('0x8')](''):[];}}}; \ No newline at end of file +var _0xe5b5=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x3199ea,_0x4d36e5){var _0x41abc4=function(_0x1da2e8){while(--_0x1da2e8){_0x3199ea['push'](_0x3199ea['shift']());}};_0x41abc4(++_0x4d36e5);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0xe5b5[_0x98db33];return _0x5ae63a;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'name':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5e5b('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5e5b('0x2')],'set':function(_0xf20c6a){this[_0x5e5b('0x5')](_0x5e5b('0x6'),_0xf20c6a?_0xf20c6a[_0x5e5b('0x7')](''):[]);},'get':function(){return this[_0x5e5b('0x8')](_0x5e5b('0x6'))?this[_0x5e5b('0x8')](_0x5e5b('0x6'))[_0x5e5b('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 93d2466..ea67d26 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 _0x50b5=['path','to-csv','ejs','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x100643,_0x74979e){var _0x4f1253=function(_0x3d01df){while(--_0x3d01df){_0x100643['push'](_0x100643['shift']());}};_0x4f1253(++_0x74979e);}(_0x50b5,0x1dd));var _0x550b=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x50b5[_0x257642];return _0x3d813b;};'use strict';var emlformat=require(_0x550b('0x0'));var rimraf=require(_0x550b('0x1'));var zipdir=require(_0x550b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x550b('0x3'));var moment=require(_0x550b('0x4'));var BPromise=require(_0x550b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x550b('0x6'));var sox=require('sox');var csv=require(_0x550b('0x7'));var ejs=require(_0x550b('0x8'));var fs=require('fs');var fs_extra=require(_0x550b('0x9'));var _=require(_0x550b('0xa'));var squel=require('squel');var crypto=require(_0x550b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x550b('0x7'));var querystring=require(_0x550b('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x550b('0xd'));var qs=require(_0x550b('0xe'));var as=require(_0x550b('0xf'));var hardwareService=require(_0x550b('0x10'));var logger=require(_0x550b('0x11'))(_0x550b('0x12'));var utils=require(_0x550b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x550b('0x14'));var db=require(_0x550b('0x15'))['db'];function respondWithStatusCode(_0x5ad49b,_0x542211){_0x542211=_0x542211||0xcc;return function(_0x48d153){if(_0x48d153){return _0x5ad49b[_0x550b('0x16')](_0x542211);}return _0x5ad49b[_0x550b('0x17')](_0x542211)[_0x550b('0x18')]();};}function respondWithResult(_0x2388fb,_0x482b9c){_0x482b9c=_0x482b9c||0xc8;return function(_0xf1c343){if(_0xf1c343){return _0x2388fb[_0x550b('0x17')](_0x482b9c)['json'](_0xf1c343);}};}function respondWithFilteredResult(_0x121969,_0x51f951){return function(_0x45ad78){if(_0x45ad78){var _0x9fa4bd=typeof _0x51f951[_0x550b('0x19')]===_0x550b('0x1a')&&typeof _0x51f951[_0x550b('0x1b')]===_0x550b('0x1a');var _0x59403a=_0x45ad78[_0x550b('0x1c')];var _0x2ad12b=_0x9fa4bd?0x0:_0x51f951[_0x550b('0x19')];var _0x3fcd7a=_0x9fa4bd?_0x45ad78['count']:_0x51f951['offset']+_0x51f951[_0x550b('0x1b')];var _0x141f42;if(_0x3fcd7a>=_0x59403a){_0x3fcd7a=_0x59403a;_0x141f42=0xc8;}else{_0x141f42=0xce;}_0x121969[_0x550b('0x17')](_0x141f42);return _0x121969[_0x550b('0x1d')](_0x550b('0x1e'),_0x2ad12b+'-'+_0x3fcd7a+'/'+_0x59403a)[_0x550b('0x1f')](_0x45ad78);}return null;};}function patchUpdates(_0x4b4ce2){return function(_0xdf97d0){try{jsonpatch[_0x550b('0x20')](_0xdf97d0,_0x4b4ce2,!![]);}catch(_0x3d2890){return BPromise['reject'](_0x3d2890);}return _0xdf97d0['save']();};}function saveUpdates(_0xe0e9d1,_0x32a3e5){return function(_0x1f9f89){if(_0x1f9f89){return _0x1f9f89[_0x550b('0x21')](_0xe0e9d1)['then'](function(_0x3eefef){return _0x3eefef;});}return null;};}function removeEntity(_0x34a482,_0x12d032){return function(_0x46b5d2){if(_0x46b5d2){return _0x46b5d2[_0x550b('0x22')]()[_0x550b('0x23')](function(){_0x34a482[_0x550b('0x17')](0xcc)[_0x550b('0x18')]();});}};}function handleEntityNotFound(_0x4cc31b,_0x16ca5f){return function(_0xe978af){if(!_0xe978af){_0x4cc31b['sendStatus'](0x194);}return _0xe978af;};}function handleError(_0x3819b1,_0x51f527){_0x51f527=_0x51f527||0x1f4;return function(_0x4bd5c2){logger[_0x550b('0x24')](_0x4bd5c2[_0x550b('0x25')]);if(_0x4bd5c2[_0x550b('0x26')]){delete _0x4bd5c2[_0x550b('0x26')];}_0x3819b1['status'](_0x51f527)['send'](_0x4bd5c2);};}exports['index']=function(_0x30484f,_0x515da2){var _0x2ab7ea={},_0x532e6e={},_0x273116={'count':0x0,'rows':[]};var _0x1c1d0d=_[_0x550b('0x27')](db[_0x550b('0x28')][_0x550b('0x29')],function(_0x40c4be){return{'name':_0x40c4be[_0x550b('0x2a')],'type':_0x40c4be[_0x550b('0x2b')]['key']};});_0x532e6e[_0x550b('0x2c')]=_[_0x550b('0x27')](_0x1c1d0d,_0x550b('0x26'));_0x532e6e[_0x550b('0x2d')]=_[_0x550b('0x2e')](_0x30484f[_0x550b('0x2d')]);_0x532e6e[_0x550b('0x2f')]=_[_0x550b('0x30')](_0x532e6e[_0x550b('0x2c')],_0x532e6e[_0x550b('0x2d')]);_0x2ab7ea[_0x550b('0x31')]=_[_0x550b('0x30')](_0x532e6e[_0x550b('0x2c')],qs[_0x550b('0x32')](_0x30484f['query'][_0x550b('0x32')]));_0x2ab7ea[_0x550b('0x31')]=_0x2ab7ea[_0x550b('0x31')][_0x550b('0x33')]?_0x2ab7ea[_0x550b('0x31')]:_0x532e6e['model'];if(!_0x30484f['query']['hasOwnProperty'](_0x550b('0x34'))){_0x2ab7ea[_0x550b('0x1b')]=qs[_0x550b('0x1b')](_0x30484f[_0x550b('0x2d')]['limit']);_0x2ab7ea['offset']=qs['offset'](_0x30484f['query'][_0x550b('0x19')]);}_0x2ab7ea[_0x550b('0x35')]=qs[_0x550b('0x36')](_0x30484f['query'][_0x550b('0x36')]);_0x2ab7ea[_0x550b('0x37')]=qs['filters'](_['pick'](_0x30484f[_0x550b('0x2d')],_0x532e6e[_0x550b('0x2f')]),_0x1c1d0d);if(_0x30484f[_0x550b('0x2d')]['filter']){_0x2ab7ea[_0x550b('0x37')]=_[_0x550b('0x38')](_0x2ab7ea[_0x550b('0x37')],{'$or':_[_0x550b('0x27')](_0x1c1d0d,function(_0x461232){if(_0x461232['type']!==_0x550b('0x39')){var _0x4d82c4={};_0x4d82c4[_0x461232[_0x550b('0x26')]]={'$like':'%'+_0x30484f['query']['filter']+'%'};return _0x4d82c4;}})});}_0x2ab7ea=_[_0x550b('0x38')]({},_0x2ab7ea,_0x30484f[_0x550b('0x3a')]);var _0x50fcbb={'where':_0x2ab7ea[_0x550b('0x37')]};return db[_0x550b('0x28')][_0x550b('0x1c')](_0x50fcbb)['then'](function(_0x4d4764){_0x273116[_0x550b('0x1c')]=_0x4d4764;if(_0x30484f[_0x550b('0x2d')][_0x550b('0x3b')]){_0x2ab7ea[_0x550b('0x3c')]=[{'all':!![]}];}return db[_0x550b('0x28')][_0x550b('0x3d')](_0x2ab7ea);})[_0x550b('0x23')](function(_0x4fce02){_0x273116['rows']=_0x4fce02;return _0x273116;})[_0x550b('0x23')](respondWithFilteredResult(_0x515da2,_0x2ab7ea))['catch'](handleError(_0x515da2,null));};exports[_0x550b('0x3e')]=function(_0x511268,_0x596717){var _0x35d452={'raw':![],'where':{'id':_0x511268[_0x550b('0x3f')]['id']}},_0x1f4d95={};_0x1f4d95['model']=_['keys'](db[_0x550b('0x28')][_0x550b('0x29')]);_0x1f4d95[_0x550b('0x2d')]=_['keys'](_0x511268[_0x550b('0x2d')]);_0x1f4d95[_0x550b('0x2f')]=_[_0x550b('0x30')](_0x1f4d95[_0x550b('0x2c')],_0x1f4d95[_0x550b('0x2d')]);_0x35d452[_0x550b('0x31')]=_[_0x550b('0x30')](_0x1f4d95['model'],qs[_0x550b('0x32')](_0x511268[_0x550b('0x2d')]['fields']));_0x35d452[_0x550b('0x31')]=_0x35d452[_0x550b('0x31')][_0x550b('0x33')]?_0x35d452[_0x550b('0x31')]:_0x1f4d95['model'];if(_0x511268[_0x550b('0x2d')][_0x550b('0x3b')]){_0x35d452[_0x550b('0x3c')]=[{'all':!![]}];}_0x35d452=_[_0x550b('0x38')]({},_0x35d452,_0x511268['options']);return db[_0x550b('0x28')][_0x550b('0x40')](_0x35d452)['then'](handleEntityNotFound(_0x596717,null))['then'](respondWithResult(_0x596717,null))['catch'](handleError(_0x596717,null));};exports[_0x550b('0x41')]=function(_0x15e126,_0x55266a){return db['UserProfileSection'][_0x550b('0x41')](_0x15e126[_0x550b('0x42')],{})[_0x550b('0x23')](respondWithResult(_0x55266a,0xc9))[_0x550b('0x43')](handleError(_0x55266a,null));};exports[_0x550b('0x21')]=function(_0x3e7b4e,_0x263898){if(_0x3e7b4e[_0x550b('0x42')]['id']){delete _0x3e7b4e[_0x550b('0x42')]['id'];}return db[_0x550b('0x28')][_0x550b('0x40')]({'where':{'id':_0x3e7b4e[_0x550b('0x3f')]['id']}})[_0x550b('0x23')](handleEntityNotFound(_0x263898,null))[_0x550b('0x23')](saveUpdates(_0x3e7b4e[_0x550b('0x42')],null))[_0x550b('0x23')](respondWithResult(_0x263898,null))[_0x550b('0x43')](handleError(_0x263898,null));};exports[_0x550b('0x22')]=function(_0x532d15,_0x5f487a){return db[_0x550b('0x28')][_0x550b('0x40')]({'where':{'id':_0x532d15[_0x550b('0x3f')]['id']}})[_0x550b('0x23')](handleEntityNotFound(_0x5f487a,null))[_0x550b('0x23')](removeEntity(_0x5f487a,null))[_0x550b('0x43')](handleError(_0x5f487a,null));};exports[_0x550b('0x44')]=function(_0xb6f2b7,_0x183c46){return db['UserProfileSection'][_0x550b('0x44')]()[_0x550b('0x23')](respondWithResult(_0x183c46,null))[_0x550b('0x43')](handleError(_0x183c46,null));}; \ No newline at end of file +var _0x3c18=['key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','keys','include','options','create','body','find','params','describe','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','index','map','UserProfileSection','rawAttributes','fieldName','type'];(function(_0x448c50,_0x5835a2){var _0x5a97fc=function(_0xbeb1fe){while(--_0xbeb1fe){_0x448c50['push'](_0x448c50['shift']());}};_0x5a97fc(++_0x5835a2);}(_0x3c18,0x18f));var _0x83c1=function(_0x41577b,_0x78569a){_0x41577b=_0x41577b-0x0;var _0x1f4e99=_0x3c18[_0x41577b];return _0x1f4e99;};'use strict';var emlformat=require(_0x83c1('0x0'));var rimraf=require(_0x83c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83c1('0x2'));var rp=require(_0x83c1('0x3'));var moment=require(_0x83c1('0x4'));var BPromise=require(_0x83c1('0x5'));var Mustache=require('mustache');var util=require(_0x83c1('0x6'));var path=require(_0x83c1('0x7'));var sox=require('sox');var csv=require(_0x83c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83c1('0x9'));var _=require(_0x83c1('0xa'));var squel=require(_0x83c1('0xb'));var crypto=require(_0x83c1('0xc'));var jsforce=require(_0x83c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x83c1('0x8'));var querystring=require(_0x83c1('0xe'));var Papa=require(_0x83c1('0xf'));var Redis=require(_0x83c1('0x10'));var authService=require(_0x83c1('0x11'));var qs=require(_0x83c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83c1('0x13'));var logger=require(_0x83c1('0x14'))(_0x83c1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x83c1('0x16'))['db'];function respondWithStatusCode(_0x2ea551,_0x2d30fb){_0x2d30fb=_0x2d30fb||0xcc;return function(_0x4171b6){if(_0x4171b6){return _0x2ea551[_0x83c1('0x17')](_0x2d30fb);}return _0x2ea551[_0x83c1('0x18')](_0x2d30fb)[_0x83c1('0x19')]();};}function respondWithResult(_0x2769a9,_0x47a89c){_0x47a89c=_0x47a89c||0xc8;return function(_0x5e762e){if(_0x5e762e){return _0x2769a9[_0x83c1('0x18')](_0x47a89c)[_0x83c1('0x1a')](_0x5e762e);}};}function respondWithFilteredResult(_0x2307f1,_0x22f733){return function(_0x3b5d16){if(_0x3b5d16){var _0x477d94=typeof _0x22f733['offset']===_0x83c1('0x1b')&&typeof _0x22f733['limit']===_0x83c1('0x1b');var _0x588155=_0x3b5d16[_0x83c1('0x1c')];var _0xeed09c=_0x477d94?0x0:_0x22f733[_0x83c1('0x1d')];var _0x3b7e5d=_0x477d94?_0x3b5d16[_0x83c1('0x1c')]:_0x22f733['offset']+_0x22f733[_0x83c1('0x1e')];var _0x4e07ea;if(_0x3b7e5d>=_0x588155){_0x3b7e5d=_0x588155;_0x4e07ea=0xc8;}else{_0x4e07ea=0xce;}_0x2307f1['status'](_0x4e07ea);return _0x2307f1[_0x83c1('0x1f')](_0x83c1('0x20'),_0xeed09c+'-'+_0x3b7e5d+'/'+_0x588155)[_0x83c1('0x1a')](_0x3b5d16);}return null;};}function patchUpdates(_0x1faf3e){return function(_0x5ea776){try{jsonpatch['apply'](_0x5ea776,_0x1faf3e,!![]);}catch(_0x3eb3f1){return BPromise[_0x83c1('0x21')](_0x3eb3f1);}return _0x5ea776['save']();};}function saveUpdates(_0x2d3309,_0x5474c0){return function(_0x413a25){if(_0x413a25){return _0x413a25[_0x83c1('0x22')](_0x2d3309)[_0x83c1('0x23')](function(_0x3c457b){return _0x3c457b;});}return null;};}function removeEntity(_0x261951,_0x4f2d79){return function(_0x21080a){if(_0x21080a){return _0x21080a[_0x83c1('0x24')]()['then'](function(){_0x261951[_0x83c1('0x18')](0xcc)[_0x83c1('0x19')]();});}};}function handleEntityNotFound(_0x1316f1,_0x502f84){return function(_0x239845){if(!_0x239845){_0x1316f1[_0x83c1('0x17')](0x194);}return _0x239845;};}function handleError(_0x10cdcd,_0x1a37a){_0x1a37a=_0x1a37a||0x1f4;return function(_0x2353b7){logger[_0x83c1('0x25')](_0x2353b7[_0x83c1('0x26')]);if(_0x2353b7['name']){delete _0x2353b7['name'];}_0x10cdcd['status'](_0x1a37a)['send'](_0x2353b7);};}exports[_0x83c1('0x27')]=function(_0x4294bc,_0x3cb6b1){var _0x3f2e32={},_0x310b97={},_0x5e1dba={'count':0x0,'rows':[]};var _0x48c166=_[_0x83c1('0x28')](db[_0x83c1('0x29')][_0x83c1('0x2a')],function(_0x5a8c5b){return{'name':_0x5a8c5b[_0x83c1('0x2b')],'type':_0x5a8c5b[_0x83c1('0x2c')][_0x83c1('0x2d')]};});_0x310b97[_0x83c1('0x2e')]=_[_0x83c1('0x28')](_0x48c166,_0x83c1('0x2f'));_0x310b97[_0x83c1('0x30')]=_['keys'](_0x4294bc[_0x83c1('0x30')]);_0x310b97[_0x83c1('0x31')]=_[_0x83c1('0x32')](_0x310b97[_0x83c1('0x2e')],_0x310b97['query']);_0x3f2e32[_0x83c1('0x33')]=_[_0x83c1('0x32')](_0x310b97[_0x83c1('0x2e')],qs[_0x83c1('0x34')](_0x4294bc[_0x83c1('0x30')][_0x83c1('0x34')]));_0x3f2e32[_0x83c1('0x33')]=_0x3f2e32[_0x83c1('0x33')][_0x83c1('0x35')]?_0x3f2e32['attributes']:_0x310b97[_0x83c1('0x2e')];if(!_0x4294bc[_0x83c1('0x30')][_0x83c1('0x36')](_0x83c1('0x37'))){_0x3f2e32[_0x83c1('0x1e')]=qs['limit'](_0x4294bc[_0x83c1('0x30')][_0x83c1('0x1e')]);_0x3f2e32[_0x83c1('0x1d')]=qs[_0x83c1('0x1d')](_0x4294bc[_0x83c1('0x30')][_0x83c1('0x1d')]);}_0x3f2e32[_0x83c1('0x38')]=qs[_0x83c1('0x39')](_0x4294bc[_0x83c1('0x30')][_0x83c1('0x39')]);_0x3f2e32['where']=qs[_0x83c1('0x31')](_['pick'](_0x4294bc['query'],_0x310b97['filters']),_0x48c166);if(_0x4294bc[_0x83c1('0x30')][_0x83c1('0x3a')]){_0x3f2e32[_0x83c1('0x3b')]=_[_0x83c1('0x3c')](_0x3f2e32[_0x83c1('0x3b')],{'$or':_[_0x83c1('0x28')](_0x48c166,function(_0x4896e6){if(_0x4896e6[_0x83c1('0x2c')]!==_0x83c1('0x3d')){var _0x23de7e={};_0x23de7e[_0x4896e6['name']]={'$like':'%'+_0x4294bc[_0x83c1('0x30')][_0x83c1('0x3a')]+'%'};return _0x23de7e;}})});}_0x3f2e32=_['merge']({},_0x3f2e32,_0x4294bc['options']);var _0x5be863={'where':_0x3f2e32[_0x83c1('0x3b')]};return db[_0x83c1('0x29')]['count'](_0x5be863)[_0x83c1('0x23')](function(_0x39047a){_0x5e1dba['count']=_0x39047a;if(_0x4294bc[_0x83c1('0x30')][_0x83c1('0x3e')]){_0x3f2e32['include']=[{'all':!![]}];}return db[_0x83c1('0x29')][_0x83c1('0x3f')](_0x3f2e32);})['then'](function(_0x39e17f){_0x5e1dba['rows']=_0x39e17f;return _0x5e1dba;})[_0x83c1('0x23')](respondWithFilteredResult(_0x3cb6b1,_0x3f2e32))[_0x83c1('0x40')](handleError(_0x3cb6b1,null));};exports[_0x83c1('0x41')]=function(_0x43cbd4,_0x1c5600){var _0x225c7c={'raw':![],'where':{'id':_0x43cbd4['params']['id']}},_0xd97d85={};_0xd97d85['model']=_[_0x83c1('0x42')](db[_0x83c1('0x29')][_0x83c1('0x2a')]);_0xd97d85[_0x83c1('0x30')]=_[_0x83c1('0x42')](_0x43cbd4[_0x83c1('0x30')]);_0xd97d85[_0x83c1('0x31')]=_[_0x83c1('0x32')](_0xd97d85['model'],_0xd97d85[_0x83c1('0x30')]);_0x225c7c[_0x83c1('0x33')]=_[_0x83c1('0x32')](_0xd97d85[_0x83c1('0x2e')],qs['fields'](_0x43cbd4['query']['fields']));_0x225c7c[_0x83c1('0x33')]=_0x225c7c[_0x83c1('0x33')][_0x83c1('0x35')]?_0x225c7c['attributes']:_0xd97d85[_0x83c1('0x2e')];if(_0x43cbd4[_0x83c1('0x30')][_0x83c1('0x3e')]){_0x225c7c[_0x83c1('0x43')]=[{'all':!![]}];}_0x225c7c=_['merge']({},_0x225c7c,_0x43cbd4[_0x83c1('0x44')]);return db[_0x83c1('0x29')]['find'](_0x225c7c)[_0x83c1('0x23')](handleEntityNotFound(_0x1c5600,null))[_0x83c1('0x23')](respondWithResult(_0x1c5600,null))[_0x83c1('0x40')](handleError(_0x1c5600,null));};exports[_0x83c1('0x45')]=function(_0x4a68fc,_0x45e3bc){return db[_0x83c1('0x29')][_0x83c1('0x45')](_0x4a68fc[_0x83c1('0x46')],{})[_0x83c1('0x23')](respondWithResult(_0x45e3bc,0xc9))[_0x83c1('0x40')](handleError(_0x45e3bc,null));};exports[_0x83c1('0x22')]=function(_0x435634,_0x223786){if(_0x435634[_0x83c1('0x46')]['id']){delete _0x435634[_0x83c1('0x46')]['id'];}return db[_0x83c1('0x29')][_0x83c1('0x47')]({'where':{'id':_0x435634[_0x83c1('0x48')]['id']}})[_0x83c1('0x23')](handleEntityNotFound(_0x223786,null))[_0x83c1('0x23')](saveUpdates(_0x435634['body'],null))[_0x83c1('0x23')](respondWithResult(_0x223786,null))[_0x83c1('0x40')](handleError(_0x223786,null));};exports[_0x83c1('0x24')]=function(_0x379853,_0x4f8fb8){return db['UserProfileSection'][_0x83c1('0x47')]({'where':{'id':_0x379853[_0x83c1('0x48')]['id']}})[_0x83c1('0x23')](handleEntityNotFound(_0x4f8fb8,null))[_0x83c1('0x23')](removeEntity(_0x4f8fb8,null))[_0x83c1('0x40')](handleError(_0x4f8fb8,null));};exports[_0x83c1('0x49')]=function(_0x462173,_0x50092c){return db[_0x83c1('0x29')][_0x83c1('0x49')]()[_0x83c1('0x23')](respondWithResult(_0x50092c,null))['catch'](handleError(_0x50092c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 18c9aa3..c063fed 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 _0xcc77=['./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x92a987,_0x4415b6){var _0x331f4c=function(_0x223e9d){while(--_0x223e9d){_0x92a987['push'](_0x92a987['shift']());}};_0x331f4c(++_0x4415b6);}(_0xcc77,0x89));var _0x7cc7=function(_0x28fedd,_0x21976f){_0x28fedd=_0x28fedd-0x0;var _0xc5519b=_0xcc77[_0x28fedd];return _0xc5519b;};'use strict';var _=require(_0x7cc7('0x0'));var util=require('util');var logger=require(_0x7cc7('0x1'))(_0x7cc7('0x2'));var moment=require(_0x7cc7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7cc7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cc7('0x5'));var config=require('../../config/environment');var attributes=require(_0x7cc7('0x6'));module[_0x7cc7('0x7')]=function(_0x56b5ee,_0x1ce313){return _0x56b5ee['define'](_0x7cc7('0x8'),attributes,{'tableName':_0x7cc7('0x9'),'paranoid':![],'indexes':[{'name':_0x7cc7('0xa'),'fields':[_0x7cc7('0xb'),_0x7cc7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4969=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0xc918c4,_0x54b028){var _0x1d2b31=function(_0x37eab8){while(--_0x37eab8){_0xc918c4['push'](_0xc918c4['shift']());}};_0x1d2b31(++_0x54b028);}(_0x4969,0x1ec));var _0x9496=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x4969[_0x525798];return _0x57da9a;};'use strict';var _=require('lodash');var util=require(_0x9496('0x0'));var logger=require(_0x9496('0x1'))(_0x9496('0x2'));var moment=require('moment');var BPromise=require(_0x9496('0x3'));var rp=require(_0x9496('0x4'));var fs=require('fs');var path=require(_0x9496('0x5'));var rimraf=require(_0x9496('0x6'));var config=require(_0x9496('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x4f1a56,_0x33dc3e){return _0x4f1a56['define']('UserProfileSection',attributes,{'tableName':_0x9496('0x8'),'paranoid':![],'indexes':[{'name':_0x9496('0x9'),'fields':[_0x9496('0xa'),_0x9496('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 1552724..20baf9b 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 _0xf16b=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xf16b,0x1e0));var _0xbf16=function(_0x218c01,_0x48cced){_0x218c01=_0x218c01-0x0;var _0x47dadc=_0xf16b[_0x218c01];return _0x47dadc;};'use strict';var _=require(_0xbf16('0x0'));var util=require(_0xbf16('0x1'));var moment=require(_0xbf16('0x2'));var BPromise=require(_0xbf16('0x3'));var rs=require(_0xbf16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbf16('0x5'));var logger=require(_0xbf16('0x6'))(_0xbf16('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf16('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e0ee7,_0x1a3e32,_0x17e044){return new BPromise(function(_0x513204,_0x2ffa19){return client[_0xbf16('0x9')](_0x1e0ee7,_0x17e044)[_0xbf16('0xa')](function(_0x5b2b51){logger[_0xbf16('0xb')](_0xbf16('0xc'),_0x1a3e32,'request\x20sent');logger[_0xbf16('0xd')](_0xbf16('0xe'),_0x1a3e32,_0xbf16('0xf'),JSON[_0xbf16('0x10')](_0x5b2b51));if(_0x5b2b51[_0xbf16('0x11')]){if(_0x5b2b51[_0xbf16('0x11')][_0xbf16('0x12')]===0x1f4){logger[_0xbf16('0x11')](_0xbf16('0xc'),_0x1a3e32,_0x5b2b51[_0xbf16('0x11')][_0xbf16('0x13')]);return _0x2ffa19(_0x5b2b51[_0xbf16('0x11')]['message']);}logger['error'](_0xbf16('0xc'),_0x1a3e32,_0x5b2b51[_0xbf16('0x11')][_0xbf16('0x13')]);return _0x513204(_0x5b2b51[_0xbf16('0x11')]['message']);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x1a3e32,_0xbf16('0xf'));_0x513204(_0x5b2b51[_0xbf16('0x14')][_0xbf16('0x13')]);}})['catch'](function(_0x4cb810){logger[_0xbf16('0x11')](_0xbf16('0xc'),_0x1a3e32,_0x4cb810);_0x2ffa19(_0x4cb810);});});} \ No newline at end of file +var _0x8cf1=['../../config/environment','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x8cf1,0xea));var _0x18cf=function(_0x15f63a,_0x13c203){_0x15f63a=_0x15f63a-0x0;var _0x44738a=_0x8cf1[_0x15f63a];return _0x44738a;};'use strict';var _=require('lodash');var util=require(_0x18cf('0x0'));var moment=require(_0x18cf('0x1'));var BPromise=require(_0x18cf('0x2'));var rs=require(_0x18cf('0x3'));var fs=require('fs');var Redis=require(_0x18cf('0x4'));var db=require(_0x18cf('0x5'))['db'];var utils=require(_0x18cf('0x6'));var logger=require(_0x18cf('0x7'))('rpc');var config=require(_0x18cf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x18cf('0x9')][_0x18cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa828,_0xdbc3e9,_0x38b542){return new BPromise(function(_0x43c89e,_0x26210c){return client[_0x18cf('0xb')](_0x5aa828,_0x38b542)['then'](function(_0x403973){logger[_0x18cf('0xc')](_0x18cf('0xd'),_0xdbc3e9,_0x18cf('0xe'));logger[_0x18cf('0xf')](_0x18cf('0x10'),_0xdbc3e9,_0x18cf('0xe'),JSON[_0x18cf('0x11')](_0x403973));if(_0x403973[_0x18cf('0x12')]){if(_0x403973[_0x18cf('0x12')][_0x18cf('0x13')]===0x1f4){logger[_0x18cf('0x12')](_0x18cf('0xd'),_0xdbc3e9,_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);return _0x26210c(_0x403973['error']['message']);}logger[_0x18cf('0x12')](_0x18cf('0xd'),_0xdbc3e9,_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);return _0x43c89e(_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);}else{logger[_0x18cf('0xc')](_0x18cf('0xd'),_0xdbc3e9,'request\x20sent');_0x43c89e(_0x403973[_0x18cf('0x15')][_0x18cf('0x14')]);}})['catch'](function(_0x134250){logger[_0x18cf('0x12')]('UserProfileSection,\x20%s,\x20%s',_0xdbc3e9,_0x134250);_0x26210c(_0x134250);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 5d4d0e3..94403d9 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x121ddc,_0xaba176){var _0x552862=function(_0x43787e){while(--_0x43787e){_0x121ddc['push'](_0x121ddc['shift']());}};_0x552862(++_0xaba176);}(_0xe706,0xa3));var _0x6e70=function(_0x5c47d8,_0x47eff2){_0x5c47d8=_0x5c47d8-0x0;var _0x5988c7=_0xe706[_0x5c47d8];return _0x5988c7;};'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(_0x21cdb6,_0x3fd385){var _0x9481f5=function(_0x401aaa){while(--_0x401aaa){_0x21cdb6['push'](_0x21cdb6['shift']());}};_0x9481f5(++_0x3fd385);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xcb91[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index fb55d06..1542ff8 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 _0x0734=['INTEGER','sequelize','exports'];(function(_0x581fcd,_0x288436){var _0x491ec4=function(_0x5cccd4){while(--_0x5cccd4){_0x581fcd['push'](_0x581fcd['shift']());}};_0x491ec4(++_0x288436);}(_0x0734,0xfa));var _0x4073=function(_0x4bc817,_0x21ab36){_0x4bc817=_0x4bc817-0x0;var _0x47b431=_0x0734[_0x4bc817];return _0x47b431;};'use strict';var Sequelize=require(_0x4073('0x0'));module[_0x4073('0x1')]={'penalty':{'type':Sequelize[_0x4073('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb764=['INTEGER','sequelize'];(function(_0x36a5d0,_0x477b0f){var _0x2b0076=function(_0x4f78d0){while(--_0x4f78d0){_0x36a5d0['push'](_0x36a5d0['shift']());}};_0x2b0076(++_0x477b0f);}(_0xb764,0x11d));var _0x4b76=function(_0x2de792,_0x49af17){_0x2de792=_0x2de792-0x0;var _0x5a01b4=_0xb764[_0x2de792];return _0x5a01b4;};'use strict';var Sequelize=require(_0x4b76('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4b76('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index c65635c..87bb445 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 _0x8085=['define','UserSmsQueue','user_has_sms_queues','lodash','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes'];(function(_0x3ef8a9,_0x59a7c2){var _0x424f63=function(_0x7c1873){while(--_0x7c1873){_0x3ef8a9['push'](_0x3ef8a9['shift']());}};_0x424f63(++_0x59a7c2);}(_0x8085,0x71));var _0x5808=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x8085[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x5808('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5808('0x1'));var moment=require(_0x5808('0x2'));var BPromise=require(_0x5808('0x3'));var rp=require(_0x5808('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5808('0x5'));var attributes=require(_0x5808('0x6'));module['exports']=function(_0x17f899,_0x749306){return _0x17f899[_0x5808('0x7')](_0x5808('0x8'),attributes,{'tableName':_0x5808('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96f2=['request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment'];(function(_0x45be7a,_0x150ca7){var _0x4a9234=function(_0x59f220){while(--_0x59f220){_0x45be7a['push'](_0x45be7a['shift']());}};_0x4a9234(++_0x150ca7);}(_0x96f2,0xb0));var _0x296f=function(_0x426f40,_0x270da6){_0x426f40=_0x426f40-0x0;var _0x560774=_0x96f2[_0x426f40];return _0x560774;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var logger=require(_0x296f('0x1'))(_0x296f('0x2'));var moment=require(_0x296f('0x3'));var BPromise=require('bluebird');var rp=require(_0x296f('0x4'));var fs=require('fs');var path=require(_0x296f('0x5'));var rimraf=require(_0x296f('0x6'));var config=require('../../config/environment');var attributes=require(_0x296f('0x7'));module[_0x296f('0x8')]=function(_0x4c3626,_0x4c55c7){return _0x4c3626[_0x296f('0x9')](_0x296f('0xa'),attributes,{'tableName':_0x296f('0xb'),'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 e0302d8..d24ff03 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 _0xd908=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xd908,0x12c));var _0x8d90=function(_0x5e7967,_0x3e21b7){_0x5e7967=_0x5e7967-0x0;var _0x24a124=_0xd908[_0x5e7967];return _0x24a124;};'use strict';var _=require(_0x8d90('0x0'));var util=require(_0x8d90('0x1'));var moment=require(_0x8d90('0x2'));var BPromise=require(_0x8d90('0x3'));var rs=require(_0x8d90('0x4'));var fs=require('fs');var Redis=require(_0x8d90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d90('0x6'));var logger=require(_0x8d90('0x7'))(_0x8d90('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d90('0x9'));var client=jayson[_0x8d90('0xa')][_0x8d90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x76f7bb,_0x18bd90,_0x5304f9){return new BPromise(function(_0x4a9675,_0xe3c3bb){return client['request'](_0x76f7bb,_0x5304f9)[_0x8d90('0xc')](function(_0x4cfcff){logger[_0x8d90('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x18bd90,_0x8d90('0xe'));logger['debug'](_0x8d90('0xf'),_0x18bd90,_0x8d90('0xe'),JSON[_0x8d90('0x10')](_0x4cfcff));if(_0x4cfcff[_0x8d90('0x11')]){if(_0x4cfcff[_0x8d90('0x11')]['code']===0x1f4){logger[_0x8d90('0x11')](_0x8d90('0x12'),_0x18bd90,_0x4cfcff[_0x8d90('0x11')][_0x8d90('0x13')]);return _0xe3c3bb(_0x4cfcff[_0x8d90('0x11')][_0x8d90('0x13')]);}logger[_0x8d90('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x18bd90,_0x4cfcff[_0x8d90('0x11')][_0x8d90('0x13')]);return _0x4a9675(_0x4cfcff[_0x8d90('0x11')]['message']);}else{logger[_0x8d90('0xd')](_0x8d90('0x12'),_0x18bd90,'request\x20sent');_0x4a9675(_0x4cfcff['result'][_0x8d90('0x13')]);}})['catch'](function(_0x11cc53){logger[_0x8d90('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x18bd90,_0x11cc53);_0xe3c3bb(_0x11cc53);});});} \ No newline at end of file +var _0x8532=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8532,0x1dd));var _0x2853=function(_0x291cbe,_0x47931d){_0x291cbe=_0x291cbe-0x0;var _0xf22230=_0x8532[_0x291cbe];return _0xf22230;};'use strict';var _=require(_0x2853('0x0'));var util=require(_0x2853('0x1'));var moment=require(_0x2853('0x2'));var BPromise=require(_0x2853('0x3'));var rs=require(_0x2853('0x4'));var fs=require('fs');var Redis=require(_0x2853('0x5'));var db=require(_0x2853('0x6'))['db'];var utils=require(_0x2853('0x7'));var logger=require(_0x2853('0x8'))('rpc');var config=require(_0x2853('0x9'));var jayson=require(_0x2853('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ae591,_0x36d01e,_0x3dd27a){return new BPromise(function(_0x4db249,_0x2e4db0){return client['request'](_0x4ae591,_0x3dd27a)[_0x2853('0xb')](function(_0x5b85ab){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x36d01e,_0x2853('0xc'));logger[_0x2853('0xd')](_0x2853('0xe'),_0x36d01e,'request\x20sent',JSON[_0x2853('0xf')](_0x5b85ab));if(_0x5b85ab[_0x2853('0x10')]){if(_0x5b85ab[_0x2853('0x10')]['code']===0x1f4){logger[_0x2853('0x10')](_0x2853('0x11'),_0x36d01e,_0x5b85ab[_0x2853('0x10')][_0x2853('0x12')]);return _0x2e4db0(_0x5b85ab[_0x2853('0x10')][_0x2853('0x12')]);}logger[_0x2853('0x10')](_0x2853('0x11'),_0x36d01e,_0x5b85ab['error'][_0x2853('0x12')]);return _0x4db249(_0x5b85ab[_0x2853('0x10')][_0x2853('0x12')]);}else{logger[_0x2853('0x13')](_0x2853('0x11'),_0x36d01e,'request\x20sent');_0x4db249(_0x5b85ab[_0x2853('0x14')][_0x2853('0x12')]);}})['catch'](function(_0x6b7435){logger[_0x2853('0x10')](_0x2853('0x11'),_0x36d01e,_0x6b7435);_0x2e4db0(_0x6b7435);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 01a8117..395b602 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 _0x16a9=['sequelize','exports','INTEGER'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x16a9,0xe4));var _0x916a=function(_0x5e010a,_0x15e47a){_0x5e010a=_0x5e010a-0x0;var _0x3376af=_0x16a9[_0x5e010a];return _0x3376af;};'use strict';var Sequelize=require(_0x916a('0x0'));module[_0x916a('0x1')]={'UserId':{'type':Sequelize[_0x916a('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x916a('0x2')]}}; \ No newline at end of file +var _0x9702=['exports','INTEGER','sequelize'];(function(_0x2fc4a9,_0x5706b8){var _0x4e15eb=function(_0x46a1d2){while(--_0x46a1d2){_0x2fc4a9['push'](_0x2fc4a9['shift']());}};_0x4e15eb(++_0x5706b8);}(_0x9702,0x179));var _0x2970=function(_0x5ee8a0,_0x3d7f97){_0x5ee8a0=_0x5ee8a0-0x0;var _0x37fb42=_0x9702[_0x5ee8a0];return _0x37fb42;};'use strict';var Sequelize=require(_0x2970('0x0'));module[_0x2970('0x1')]={'UserId':{'type':Sequelize[_0x2970('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2970('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 0e3c30c..1e15745 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(_0x3162ed,_0x1c0e48){var _0x449a1f=function(_0x18974e){while(--_0x18974e){_0x3162ed['push'](_0x3162ed['shift']());}};_0x449a1f(++_0x1c0e48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x18f9a6,_0x58f442){var _0x479fff=function(_0x164956){while(--_0x164956){_0x18f9a6['push'](_0x18f9a6['shift']());}};_0x479fff(++_0x58f442);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 364e062..52a1cdc 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x368a0a,_0x532d1c){var _0x111593=function(_0x1b56b0){while(--_0x1b56b0){_0x368a0a['push'](_0x368a0a['shift']());}};_0x111593(++_0x532d1c);}(_0x70e0,0x17b));var _0x070e=function(_0x21fccd,_0x20b907){_0x21fccd=_0x21fccd-0x0;var _0x1e4c71=_0x70e0[_0x21fccd];return _0x1e4c71;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x26a183,_0x1f9c48){var _0x1fec0e=function(_0x239115){while(--_0x239115){_0x26a183['push'](_0x26a183['shift']());}};_0x1fec0e(++_0x1f9c48);}(_0x70e0,0x17b));var _0x070e=function(_0x3af4fd,_0x506e6b){_0x3af4fd=_0x3af4fd-0x0;var _0x56f111=_0x70e0[_0x3af4fd];return _0x56f111;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 50fd067..915f49d 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 _0xaa57=['sequelize'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0xaa57,0x182));var _0x7aa5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xaa57[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x7aa5('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2480=['INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2480,0x1d8));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x0248('0x0'));module[_0x0248('0x1')]={'penalty':{'type':Sequelize[_0x0248('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 2243277..93f42aa 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 _0xed88=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','api','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed88,0x163));var _0x8ed8=function(_0x1f6d47,_0x2ae1ea){_0x1f6d47=_0x1f6d47-0x0;var _0x54a0a7=_0xed88[_0x1f6d47];return _0x54a0a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8ed8('0x0'));var moment=require(_0x8ed8('0x1'));var BPromise=require(_0x8ed8('0x2'));var rp=require(_0x8ed8('0x3'));var fs=require('fs');var path=require(_0x8ed8('0x4'));var rimraf=require(_0x8ed8('0x5'));var config=require(_0x8ed8('0x6'));var attributes=require(_0x8ed8('0x7'));module['exports']=function(_0x52cead,_0x2074b3){return _0x52cead[_0x8ed8('0x8')](_0x8ed8('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf31=['../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d7b0f,_0x2e93ae){var _0xa91a33=function(_0x38a1ba){while(--_0x38a1ba){_0x5d7b0f['push'](_0x5d7b0f['shift']());}};_0xa91a33(++_0x2e93ae);}(_0xdf31,0x13d));var _0x1df3=function(_0x1a312c,_0x502385){_0x1a312c=_0x1a312c-0x0;var _0x36225d=_0xdf31[_0x1a312c];return _0x36225d;};'use strict';var _=require(_0x1df3('0x0'));var util=require(_0x1df3('0x1'));var logger=require(_0x1df3('0x2'))('api');var moment=require(_0x1df3('0x3'));var BPromise=require(_0x1df3('0x4'));var rp=require(_0x1df3('0x5'));var fs=require('fs');var path=require(_0x1df3('0x6'));var rimraf=require(_0x1df3('0x7'));var config=require(_0x1df3('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x1df3('0x9')]=function(_0x4bcdcc,_0x41c090){return _0x4bcdcc[_0x1df3('0xa')](_0x1df3('0xb'),attributes,{'tableName':_0x1df3('0xc'),'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 94d19ad..349b379 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 _0xfb38=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31857c,_0x2c0239){var _0x46c473=function(_0x39ef36){while(--_0x39ef36){_0x31857c['push'](_0x31857c['shift']());}};_0x46c473(++_0x2c0239);}(_0xfb38,0xd2));var _0x8fb3=function(_0x46dedf,_0xa59cac){_0x46dedf=_0x46dedf-0x0;var _0x3851dc=_0xfb38[_0x46dedf];return _0x3851dc;};'use strict';var _=require(_0x8fb3('0x0'));var util=require(_0x8fb3('0x1'));var moment=require(_0x8fb3('0x2'));var BPromise=require(_0x8fb3('0x3'));var rs=require(_0x8fb3('0x4'));var fs=require('fs');var Redis=require(_0x8fb3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fb3('0x6'));var logger=require(_0x8fb3('0x7'))('rpc');var config=require(_0x8fb3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8fb3('0x9')][_0x8fb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ee883,_0x4654fb,_0x20755f){return new BPromise(function(_0x314f22,_0x4af162){return client[_0x8fb3('0xb')](_0x5ee883,_0x20755f)[_0x8fb3('0xc')](function(_0x45de65){logger[_0x8fb3('0xd')](_0x8fb3('0xe'),_0x4654fb,_0x8fb3('0xf'));logger['debug'](_0x8fb3('0x10'),_0x4654fb,'request\x20sent',JSON[_0x8fb3('0x11')](_0x45de65));if(_0x45de65[_0x8fb3('0x12')]){if(_0x45de65[_0x8fb3('0x12')][_0x8fb3('0x13')]===0x1f4){logger[_0x8fb3('0x12')](_0x8fb3('0xe'),_0x4654fb,_0x45de65['error']['message']);return _0x4af162(_0x45de65[_0x8fb3('0x12')][_0x8fb3('0x14')]);}logger['error'](_0x8fb3('0xe'),_0x4654fb,_0x45de65[_0x8fb3('0x12')]['message']);return _0x314f22(_0x45de65[_0x8fb3('0x12')][_0x8fb3('0x14')]);}else{logger[_0x8fb3('0xd')](_0x8fb3('0xe'),_0x4654fb,_0x8fb3('0xf'));_0x314f22(_0x45de65[_0x8fb3('0x15')][_0x8fb3('0x14')]);}})[_0x8fb3('0x16')](function(_0x3f0e22){logger['error'](_0x8fb3('0xe'),_0x4654fb,_0x3f0e22);_0x4af162(_0x3f0e22);});});} \ No newline at end of file +var _0xbeee=['result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2c35c6,_0x1e063c){var _0x343135=function(_0x5472ec){while(--_0x5472ec){_0x2c35c6['push'](_0x2c35c6['shift']());}};_0x343135(++_0x1e063c);}(_0xbeee,0x10a));var _0xebee=function(_0x230629,_0x506d55){_0x230629=_0x230629-0x0;var _0x5eaa3a=_0xbeee[_0x230629];return _0x5eaa3a;};'use strict';var _=require('lodash');var util=require(_0xebee('0x0'));var moment=require(_0xebee('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xebee('0x2'));var db=require(_0xebee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xebee('0x4'))(_0xebee('0x5'));var config=require(_0xebee('0x6'));var jayson=require(_0xebee('0x7'));var client=jayson[_0xebee('0x8')][_0xebee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ee1c0,_0x48c8e1,_0x5b23c7){return new BPromise(function(_0x26f6b4,_0x58f2fc){return client[_0xebee('0xa')](_0x1ee1c0,_0x5b23c7)['then'](function(_0x412624){logger['info'](_0xebee('0xb'),_0x48c8e1,_0xebee('0xc'));logger[_0xebee('0xd')](_0xebee('0xe'),_0x48c8e1,_0xebee('0xc'),JSON[_0xebee('0xf')](_0x412624));if(_0x412624[_0xebee('0x10')]){if(_0x412624[_0xebee('0x10')][_0xebee('0x11')]===0x1f4){logger[_0xebee('0x10')](_0xebee('0xb'),_0x48c8e1,_0x412624[_0xebee('0x10')][_0xebee('0x12')]);return _0x58f2fc(_0x412624['error'][_0xebee('0x12')]);}logger['error'](_0xebee('0xb'),_0x48c8e1,_0x412624[_0xebee('0x10')][_0xebee('0x12')]);return _0x26f6b4(_0x412624[_0xebee('0x10')][_0xebee('0x12')]);}else{logger[_0xebee('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x48c8e1,_0xebee('0xc'));_0x26f6b4(_0x412624[_0xebee('0x14')][_0xebee('0x12')]);}})[_0xebee('0x15')](function(_0x838b12){logger[_0xebee('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x48c8e1,_0x838b12);_0x58f2fc(_0x838b12);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index da411a8..619c3bf 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3a6ed6,_0x3fda09){var _0x558e9d=function(_0x4ad699){while(--_0x4ad699){_0x3a6ed6['push'](_0x3a6ed6['shift']());}};_0x558e9d(++_0x3fda09);}(_0x70e0,0x17b));var _0x070e=function(_0x35655e,_0x231a24){_0x35655e=_0x35655e-0x0;var _0x501d18=_0x70e0[_0x35655e];return _0x501d18;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f2c308a..782b30b 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 _0x05de=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0xdffef1,_0x4facfc){var _0x2859aa=function(_0x3f3d28){while(--_0x3f3d28){_0xdffef1['push'](_0xdffef1['shift']());}};_0x2859aa(++_0x4facfc);}(_0x05de,0x135));var _0xe05d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x05de[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe05d('0x0'));module[_0xe05d('0x1')]={'uniqueid':{'type':Sequelize[_0xe05d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe05d('0x3')},'membername':{'type':Sequelize[_0xe05d('0x4')],'allowNull':![],'comment':_0xe05d('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe05d('0x4')],'allowNull':![],'unique':_0xe05d('0x5'),'comment':_0xe05d('0x3')},'VoiceQueueId':{'type':Sequelize[_0xe05d('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe05d('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xe05d('0x3')},'paused':{'type':Sequelize[_0xe05d('0x2')](0xb),'defaultValue':0x0,'comment':_0xe05d('0x3')}}; \ No newline at end of file +var _0x019f=['queue_interface','INTEGER','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x83b36f,_0x36f797){var _0x3a2c15=function(_0x5d2788){while(--_0x5d2788){_0x83b36f['push'](_0x83b36f['shift']());}};_0x3a2c15(++_0x36f797);}(_0x019f,0xfc));var _0xf019=function(_0x29e7fb,_0x5b2ff3){_0x29e7fb=_0x29e7fb-0x0;var _0x171dad=_0x019f[_0x29e7fb];return _0x171dad;};'use strict';var Sequelize=require('sequelize');module[_0xf019('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf019('0x1')},'membername':{'type':Sequelize[_0xf019('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf019('0x2')],'allowNull':![],'unique':_0xf019('0x3'),'comment':_0xf019('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf019('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xf019('0x4')](0xb),'defaultValue':0x0,'comment':_0xf019('0x1')},'paused':{'type':Sequelize[_0xf019('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3630a40..cc0f02c 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 _0x7bca=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x30225a,_0x233ad6){var _0x3551ef=function(_0x1a32d5){while(--_0x1a32d5){_0x30225a['push'](_0x30225a['shift']());}};_0x3551ef(++_0x233ad6);}(_0x7bca,0x102));var _0xa7bc=function(_0x3c60fc,_0x593ef5){_0x3c60fc=_0x3c60fc-0x0;var _0x495fd2=_0x7bca[_0x3c60fc];return _0x495fd2;};'use strict';var EventEmitter=require(_0xa7bc('0x0'));var UserVoiceQueueRt=require(_0xa7bc('0x1'))['db'][_0xa7bc('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa7bc('0x3')](0x0);var events={'afterCreate':_0xa7bc('0x4'),'afterUpdate':_0xa7bc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e2265){return function(_0x187a77,_0x538bb0,_0x3e1294){UserVoiceQueueRtEvents[_0xa7bc('0x6')](_0x4e2265+':'+_0x187a77['id'],_0x187a77);UserVoiceQueueRtEvents['emit'](_0x4e2265,_0x187a77);_0x3e1294(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xa7bc('0x7')](e,emitEvent(event));}}module[_0xa7bc('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4384=['UserVoiceQueueRt','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4a47e7,_0x5f0f82){var _0xe46953=function(_0x43c27a){while(--_0x43c27a){_0x4a47e7['push'](_0x4a47e7['shift']());}};_0xe46953(++_0x5f0f82);}(_0x4384,0x96));var _0x4438=function(_0x3cf514,_0x44e54f){_0x3cf514=_0x3cf514-0x0;var _0x509cab=_0x4384[_0x3cf514];return _0x509cab;};'use strict';var EventEmitter=require(_0x4438('0x0'));var UserVoiceQueueRt=require(_0x4438('0x1'))['db'][_0x4438('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4438('0x3'),'afterUpdate':_0x4438('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa70fb9){return function(_0x17849e,_0x12d7c5,_0x285f9e){UserVoiceQueueRtEvents['emit'](_0xa70fb9+':'+_0x17849e['id'],_0x17849e);UserVoiceQueueRtEvents[_0x4438('0x5')](_0xa70fb9,_0x17849e);_0x285f9e(null);};}for(var e in events){if(events[_0x4438('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4438('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index f3180e0..675db37 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 _0x34c2=['moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34c2,0xa9));var _0x234c=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x34c2[_0x229d7e];return _0xa78280;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x234c('0x0'));var moment=require(_0x234c('0x1'));var BPromise=require(_0x234c('0x2'));var rp=require(_0x234c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x234c('0x4'));var config=require(_0x234c('0x5'));var attributes=require(_0x234c('0x6'));module[_0x234c('0x7')]=function(_0x2f0820,_0x5b5ff4){return _0x2f0820[_0x234c('0x8')](_0x234c('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0734=['./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x581fd0,_0x3bf43){var _0x5064aa=function(_0x516244){while(--_0x516244){_0x581fd0['push'](_0x581fd0['shift']());}};_0x5064aa(++_0x3bf43);}(_0x0734,0xf6));var _0x4073=function(_0x32df00,_0x449ab7){_0x32df00=_0x32df00-0x0;var _0x5f074a=_0x0734[_0x32df00];return _0x5f074a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4073('0x0'));var moment=require('moment');var BPromise=require(_0x4073('0x1'));var rp=require(_0x4073('0x2'));var fs=require('fs');var path=require(_0x4073('0x3'));var rimraf=require(_0x4073('0x4'));var config=require(_0x4073('0x5'));var attributes=require(_0x4073('0x6'));module[_0x4073('0x7')]=function(_0x203319,_0x313c7f){return _0x203319['define']('UserVoiceQueueRt',attributes,{'tableName':_0x4073('0x8'),'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 86ee45c..56cfa22 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 _0x5733=['register','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','catch','UserVoiceQueueRt','findAll','options','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x16a349,_0x3a4213){var _0xa0b392=function(_0x3182c1){while(--_0x3182c1){_0x16a349['push'](_0x16a349['shift']());}};_0xa0b392(++_0x3a4213);}(_0x5733,0x1b6));var _0x3573=function(_0x1a13df,_0x31c8b3){_0x1a13df=_0x1a13df-0x0;var _0x22b5f7=_0x5733[_0x1a13df];return _0x22b5f7;};'use strict';var _=require(_0x3573('0x0'));var util=require(_0x3573('0x1'));var moment=require(_0x3573('0x2'));var BPromise=require(_0x3573('0x3'));var rs=require(_0x3573('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3573('0x5'))['db'];var utils=require(_0x3573('0x6'));var logger=require(_0x3573('0x7'))(_0x3573('0x8'));var config=require(_0x3573('0x9'));var jayson=require(_0x3573('0xa'));var client=jayson[_0x3573('0xb')][_0x3573('0xc')]({'port':0x232a});config[_0x3573('0xd')]=_[_0x3573('0xe')](config[_0x3573('0xd')],{'host':_0x3573('0xf'),'port':0x18eb});var socket=require(_0x3573('0x10'))(new Redis(config['redis']));require(_0x3573('0x11'))[_0x3573('0x12')](socket);function respondWithRpcPromise(_0x3c1c35,_0x127aec,_0x2d834f){return new BPromise(function(_0x20861c,_0x27d16b){return client['request'](_0x3c1c35,_0x2d834f)[_0x3573('0x13')](function(_0x407466){logger[_0x3573('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x127aec,'request\x20sent');logger[_0x3573('0x15')](_0x3573('0x16'),_0x127aec,_0x3573('0x17'),JSON[_0x3573('0x18')](_0x407466));if(_0x407466[_0x3573('0x19')]){if(_0x407466[_0x3573('0x19')][_0x3573('0x1a')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x127aec,_0x407466[_0x3573('0x19')]['message']);return _0x27d16b(_0x407466['error'][_0x3573('0x1b')]);}logger['error'](_0x3573('0x1c'),_0x127aec,_0x407466[_0x3573('0x19')][_0x3573('0x1b')]);return _0x20861c(_0x407466[_0x3573('0x19')][_0x3573('0x1b')]);}else{logger['info'](_0x3573('0x1c'),_0x127aec,_0x3573('0x17'));_0x20861c(_0x407466['result'][_0x3573('0x1b')]);}})[_0x3573('0x1d')](function(_0xb02e79){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x127aec,_0xb02e79);_0x27d16b(_0xb02e79);});});}exports['GetVoiceQueueRtPauses']=function(_0x3a9be4){var _0x2e3997=this;return new Promise(function(_0x2b43f2,_0x2114a1){return db[_0x3573('0x1e')][_0x3573('0x1f')]({'raw':_0x3a9be4[_0x3573('0x20')]?_0x3a9be4[_0x3573('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3a9be4[_0x3573('0x20')]?_0x3a9be4[_0x3573('0x20')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x3573('0x21'),db[_0x3573('0x22')]['fn']('IF',db[_0x3573('0x22')][_0x3573('0x23')](_0x3573('0x24')))),'outboundQueuePauses']]})[_0x3573('0x13')](function(_0x3cbcd0){logger['info'](_0x3573('0x25'),_0x3a9be4);logger[_0x3573('0x15')]('GetVoiceQueueRtPauses',_0x3a9be4,JSON[_0x3573('0x18')](_0x3cbcd0));_0x2b43f2(_0x3cbcd0);})[_0x3573('0x1d')](function(_0x5b2cad){logger[_0x3573('0x19')]('GetVoiceQueueRtPauses',_0x5b2cad[_0x3573('0x1b')],_0x3a9be4);_0x2114a1(_0x2e3997[_0x3573('0x19')](0x1f4,_0x5b2cad[_0x3573('0x1b')]));});});}; \ No newline at end of file +var _0xdbd3=['raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options'];(function(_0x31c49e,_0x27e99b){var _0x384474=function(_0xbfc466){while(--_0xbfc466){_0x31c49e['push'](_0x31c49e['shift']());}};_0x384474(++_0x27e99b);}(_0xdbd3,0x103));var _0x3dbd=function(_0x347541,_0x137cf){_0x347541=_0x347541-0x0;var _0x5c0e38=_0xdbd3[_0x347541];return _0x5c0e38;};'use strict';var _=require(_0x3dbd('0x0'));var util=require(_0x3dbd('0x1'));var moment=require(_0x3dbd('0x2'));var BPromise=require(_0x3dbd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dbd('0x4'));var db=require(_0x3dbd('0x5'))['db'];var utils=require(_0x3dbd('0x6'));var logger=require(_0x3dbd('0x7'))(_0x3dbd('0x8'));var config=require(_0x3dbd('0x9'));var jayson=require(_0x3dbd('0xa'));var client=jayson[_0x3dbd('0xb')][_0x3dbd('0xc')]({'port':0x232a});config[_0x3dbd('0xd')]=_[_0x3dbd('0xe')](config[_0x3dbd('0xd')],{'host':_0x3dbd('0xf'),'port':0x18eb});var socket=require(_0x3dbd('0x10'))(new Redis(config[_0x3dbd('0xd')]));require(_0x3dbd('0x11'))[_0x3dbd('0x12')](socket);function respondWithRpcPromise(_0x3e754a,_0x196f47,_0x5ce26f){return new BPromise(function(_0x535daa,_0x2d4559){return client[_0x3dbd('0x13')](_0x3e754a,_0x5ce26f)[_0x3dbd('0x14')](function(_0x529b31){logger[_0x3dbd('0x15')](_0x3dbd('0x16'),_0x196f47,_0x3dbd('0x17'));logger[_0x3dbd('0x18')](_0x3dbd('0x19'),_0x196f47,_0x3dbd('0x17'),JSON[_0x3dbd('0x1a')](_0x529b31));if(_0x529b31[_0x3dbd('0x1b')]){if(_0x529b31[_0x3dbd('0x1b')][_0x3dbd('0x1c')]===0x1f4){logger['error'](_0x3dbd('0x16'),_0x196f47,_0x529b31['error']['message']);return _0x2d4559(_0x529b31[_0x3dbd('0x1b')][_0x3dbd('0x1d')]);}logger['error'](_0x3dbd('0x16'),_0x196f47,_0x529b31[_0x3dbd('0x1b')][_0x3dbd('0x1d')]);return _0x535daa(_0x529b31[_0x3dbd('0x1b')][_0x3dbd('0x1d')]);}else{logger[_0x3dbd('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x196f47,'request\x20sent');_0x535daa(_0x529b31[_0x3dbd('0x1e')][_0x3dbd('0x1d')]);}})[_0x3dbd('0x1f')](function(_0x286217){logger[_0x3dbd('0x1b')](_0x3dbd('0x16'),_0x196f47,_0x286217);_0x2d4559(_0x286217);});});}exports['GetVoiceQueueRtPauses']=function(_0x47f588){var _0x52eebc=this;return new Promise(function(_0x555121,_0x3431d7){return db[_0x3dbd('0x20')][_0x3dbd('0x21')]({'raw':_0x47f588[_0x3dbd('0x22')]?_0x47f588[_0x3dbd('0x22')][_0x3dbd('0x23')]===undefined?!![]:![]:!![],'where':_0x47f588[_0x3dbd('0x22')]?_0x47f588[_0x3dbd('0x22')][_0x3dbd('0x24')]||null:null,'attributes':[[db[_0x3dbd('0x25')]['fn'](_0x3dbd('0x26'),db[_0x3dbd('0x25')]['fn']('IF',db['sequelize'][_0x3dbd('0x27')]('`paused`\x20=\x201,\x201,\x20null'))),_0x3dbd('0x28')]]})[_0x3dbd('0x14')](function(_0x4a2acd){logger[_0x3dbd('0x15')](_0x3dbd('0x29'),_0x47f588);logger[_0x3dbd('0x18')]('GetVoiceQueueRtPauses',_0x47f588,JSON[_0x3dbd('0x1a')](_0x4a2acd));_0x555121(_0x4a2acd);})['catch'](function(_0x4fcd99){logger[_0x3dbd('0x1b')](_0x3dbd('0x29'),_0x4fcd99[_0x3dbd('0x1d')],_0x47f588);_0x3431d7(_0x52eebc[_0x3dbd('0x1b')](0x1f4,_0x4fcd99['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 38d9e79..dd44e25 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 _0x770d=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','removeListener','register'];(function(_0x403e17,_0x460986){var _0x181298=function(_0xd26f){while(--_0xd26f){_0x403e17['push'](_0x403e17['shift']());}};_0x181298(++_0x460986);}(_0x770d,0x122));var _0xd770=function(_0x3aefde,_0x2b26ee){_0x3aefde=_0x3aefde-0x0;var _0x40da7a=_0x770d[_0x3aefde];return _0x40da7a;};'use strict';var UserVoiceQueueRtEvents=require(_0xd770('0x0'));var events=[_0xd770('0x1'),_0xd770('0x2'),_0xd770('0x3')];function createListener(_0x286d89,_0x2b9932){return function(_0x742a9a){_0x2b9932['emit'](_0x286d89,_0x742a9a);};}function removeListener(_0x2ce50a,_0x3ac59f){return function(){UserVoiceQueueRtEvents[_0xd770('0x4')](_0x2ce50a,_0x3ac59f);};}exports[_0xd770('0x5')]=function(_0x5d3b18){for(var _0x554c5e=0x0,_0x2d73bd=events[_0xd770('0x6')];_0x554c5e<_0x2d73bd;_0x554c5e++){var _0x2224c4=events[_0x554c5e];var _0x433e3d=createListener(_0xd770('0x7')+_0x2224c4,_0x5d3b18);UserVoiceQueueRtEvents['on'](_0x2224c4,_0x433e3d);}}; \ No newline at end of file +var _0x0024=['save','update','length','userVoiceQueueRt:'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0024,0xa8));var _0x4002=function(_0x300a72,_0x24ec0c){_0x300a72=_0x300a72-0x0;var _0x172d04=_0x0024[_0x300a72];return _0x172d04;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x4002('0x0'),'remove',_0x4002('0x1')];function createListener(_0x4a4ac0,_0x3db8e9){return function(_0x5d7431){_0x3db8e9['emit'](_0x4a4ac0,_0x5d7431);};}function removeListener(_0x423907,_0x1190e7){return function(){UserVoiceQueueRtEvents['removeListener'](_0x423907,_0x1190e7);};}exports['register']=function(_0x36c011){for(var _0x144717=0x0,_0x15d53a=events[_0x4002('0x2')];_0x144717<_0x15d53a;_0x144717++){var _0x47b0bb=events[_0x144717];var _0x41ed1e=createListener(_0x4002('0x3')+_0x47b0bb,_0x36c011);UserVoiceQueueRtEvents['on'](_0x47b0bb,_0x41ed1e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5839365..76d0991 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5ea51f,_0x1e3a5b){var _0x28f6ab=function(_0x3bb09f){while(--_0x3bb09f){_0x5ea51f['push'](_0x5ea51f['shift']());}};_0x28f6ab(++_0x1e3a5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x130f86,_0x40452c){var _0x2c5f7e=function(_0x398bed){while(--_0x398bed){_0x130f86['push'](_0x130f86['shift']());}};_0x2c5f7e(++_0x40452c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xcb91[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 90f90e8..ad35301 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 _0x538a=['INTEGER','sequelize','exports'];(function(_0x162599,_0x51a949){var _0xdebb8d=function(_0x1b81a4){while(--_0x1b81a4){_0x162599['push'](_0x162599['shift']());}};_0xdebb8d(++_0x51a949);}(_0x538a,0x196));var _0xa538=function(_0x128ece,_0x3542c6){_0x128ece=_0x128ece-0x0;var _0x5d4a29=_0x538a[_0x128ece];return _0x5d4a29;};'use strict';var Sequelize=require(_0xa538('0x0'));module[_0xa538('0x1')]={'penalty':{'type':Sequelize[_0xa538('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd230=['exports','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd230,0xd5));var _0x0d23=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xd230[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x0d23('0x0'));module[_0x0d23('0x1')]={'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 e5583fa..f717c93 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 _0xcba6=['define','util','api','moment','bluebird','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xcba6,0x1b3));var _0x6cba=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xcba6[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x6cba('0x0'));var logger=require('../../config/logger')(_0x6cba('0x1'));var moment=require(_0x6cba('0x2'));var BPromise=require(_0x6cba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6cba('0x4'));var attributes=require(_0x6cba('0x5'));module['exports']=function(_0x598184,_0x798a9d){return _0x598184[_0x6cba('0x6')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64df=['moment','request-promise','path','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api'];(function(_0x2f84f3,_0x3f4a3f){var _0x141311=function(_0x5d8428){while(--_0x5d8428){_0x2f84f3['push'](_0x2f84f3['shift']());}};_0x141311(++_0x3f4a3f);}(_0x64df,0x197));var _0xf64d=function(_0x2c60db,_0x15e884){_0x2c60db=_0x2c60db-0x0;var _0x1017ba=_0x64df[_0x2c60db];return _0x1017ba;};'use strict';var _=require('lodash');var util=require(_0xf64d('0x0'));var logger=require(_0xf64d('0x1'))(_0xf64d('0x2'));var moment=require(_0xf64d('0x3'));var BPromise=require('bluebird');var rp=require(_0xf64d('0x4'));var fs=require('fs');var path=require(_0xf64d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf64d('0x6'));module[_0xf64d('0x7')]=function(_0x69545c,_0x295bb5){return _0x69545c['define'](_0xf64d('0x8'),attributes,{'tableName':_0xf64d('0x9'),'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 ba0aed1..a98ec82 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 _0xeb0f=['request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1e758c,_0x4ea39a){var _0x32081e=function(_0x39438a){while(--_0x39438a){_0x1e758c['push'](_0x1e758c['shift']());}};_0x32081e(++_0x4ea39a);}(_0xeb0f,0x8e));var _0xfeb0=function(_0x18bb0f,_0x721020){_0x18bb0f=_0x18bb0f-0x0;var _0x33424a=_0xeb0f[_0x18bb0f];return _0x33424a;};'use strict';var _=require('lodash');var util=require(_0xfeb0('0x0'));var moment=require('moment');var BPromise=require(_0xfeb0('0x1'));var rs=require(_0xfeb0('0x2'));var fs=require('fs');var Redis=require(_0xfeb0('0x3'));var db=require(_0xfeb0('0x4'))['db'];var utils=require(_0xfeb0('0x5'));var logger=require(_0xfeb0('0x6'))('rpc');var config=require(_0xfeb0('0x7'));var jayson=require(_0xfeb0('0x8'));var client=jayson[_0xfeb0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4448e6,_0x4ab82d,_0x2c4dcf){return new BPromise(function(_0x1c53ba,_0x38ffec){return client[_0xfeb0('0xa')](_0x4448e6,_0x2c4dcf)['then'](function(_0x2ee789){logger[_0xfeb0('0xb')](_0xfeb0('0xc'),_0x4ab82d,_0xfeb0('0xd'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4ab82d,'request\x20sent',JSON[_0xfeb0('0xe')](_0x2ee789));if(_0x2ee789[_0xfeb0('0xf')]){if(_0x2ee789[_0xfeb0('0xf')][_0xfeb0('0x10')]===0x1f4){logger['error'](_0xfeb0('0xc'),_0x4ab82d,_0x2ee789[_0xfeb0('0xf')][_0xfeb0('0x11')]);return _0x38ffec(_0x2ee789['error'][_0xfeb0('0x11')]);}logger[_0xfeb0('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ab82d,_0x2ee789[_0xfeb0('0xf')][_0xfeb0('0x11')]);return _0x1c53ba(_0x2ee789[_0xfeb0('0xf')][_0xfeb0('0x11')]);}else{logger[_0xfeb0('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ab82d,_0xfeb0('0xd'));_0x1c53ba(_0x2ee789['result']['message']);}})[_0xfeb0('0x12')](function(_0xc63671){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x4ab82d,_0xc63671);_0x38ffec(_0xc63671);});});} \ No newline at end of file +var _0xeec2=['then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x230ce8,_0xd18fcc){var _0x31714f=function(_0x2535cb){while(--_0x2535cb){_0x230ce8['push'](_0x230ce8['shift']());}};_0x31714f(++_0xd18fcc);}(_0xeec2,0xf8));var _0x2eec=function(_0x44c8a,_0x4d4d19){_0x44c8a=_0x44c8a-0x0;var _0x2ddca7=_0xeec2[_0x44c8a];return _0x2ddca7;};'use strict';var _=require(_0x2eec('0x0'));var util=require('util');var moment=require(_0x2eec('0x1'));var BPromise=require('bluebird');var rs=require(_0x2eec('0x2'));var fs=require('fs');var Redis=require(_0x2eec('0x3'));var db=require(_0x2eec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2eec('0x5'))(_0x2eec('0x6'));var config=require(_0x2eec('0x7'));var jayson=require(_0x2eec('0x8'));var client=jayson[_0x2eec('0x9')][_0x2eec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc90412,_0x3bbeba,_0xff6816){return new BPromise(function(_0x5e8734,_0x40cca9){return client[_0x2eec('0xb')](_0xc90412,_0xff6816)[_0x2eec('0xc')](function(_0x5efccd){logger[_0x2eec('0xd')](_0x2eec('0xe'),_0x3bbeba,_0x2eec('0xf'));logger['debug'](_0x2eec('0x10'),_0x3bbeba,_0x2eec('0xf'),JSON['stringify'](_0x5efccd));if(_0x5efccd[_0x2eec('0x11')]){if(_0x5efccd[_0x2eec('0x11')][_0x2eec('0x12')]===0x1f4){logger[_0x2eec('0x11')](_0x2eec('0xe'),_0x3bbeba,_0x5efccd[_0x2eec('0x11')][_0x2eec('0x13')]);return _0x40cca9(_0x5efccd[_0x2eec('0x11')][_0x2eec('0x13')]);}logger[_0x2eec('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3bbeba,_0x5efccd[_0x2eec('0x11')][_0x2eec('0x13')]);return _0x5e8734(_0x5efccd['error']['message']);}else{logger[_0x2eec('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3bbeba,_0x2eec('0xf'));_0x5e8734(_0x5efccd['result'][_0x2eec('0x13')]);}})['catch'](function(_0x1760f8){logger[_0x2eec('0x11')](_0x2eec('0xe'),_0x3bbeba,_0x1760f8);_0x40cca9(_0x1760f8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3bb6beb..d9d2cca 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 _0xeb0d=['put','/:id','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','create'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x1f547a,_0x3e066d){_0x1f547a=_0x1f547a-0x0;var _0x4da3e8=_0xeb0d[_0x1f547a];return _0x4da3e8;};'use strict';var multer=require(_0xdeb0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdeb0('0x1'));var router=express[_0xdeb0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdeb0('0x3'));var interaction=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var controller=require(_0xdeb0('0x6'));router[_0xdeb0('0x7')]('/',auth[_0xdeb0('0x8')](),controller[_0xdeb0('0x9')]);router[_0xdeb0('0x7')]('/:id',auth[_0xdeb0('0x8')](),controller[_0xdeb0('0xa')]);router['post']('/',auth[_0xdeb0('0x8')](),controller[_0xdeb0('0xb')]);router[_0xdeb0('0xc')](_0xdeb0('0xd'),auth[_0xdeb0('0x8')](),controller[_0xdeb0('0xe')]);router[_0xdeb0('0xf')](_0xdeb0('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xdeb0('0x10')]=router; \ No newline at end of file +var _0x1c42=['isAuthenticated','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x1dd18a,_0x52c221){var _0x208b81=function(_0x595264){while(--_0x595264){_0x1dd18a['push'](_0x1dd18a['shift']());}};_0x208b81(++_0x52c221);}(_0x1c42,0x13a));var _0x21c4=function(_0x59f6c2,_0x521635){_0x59f6c2=_0x59f6c2-0x0;var _0x1d2b07=_0x1c42[_0x59f6c2];return _0x1d2b07;};'use strict';var multer=require('multer');var util=require(_0x21c4('0x0'));var path=require(_0x21c4('0x1'));var timeout=require(_0x21c4('0x2'));var express=require('express');var router=express[_0x21c4('0x3')]();var fs_extra=require(_0x21c4('0x4'));var auth=require(_0x21c4('0x5'));var interaction=require(_0x21c4('0x6'));var config=require(_0x21c4('0x7'));var controller=require(_0x21c4('0x8'));router[_0x21c4('0x9')]('/',auth[_0x21c4('0xa')](),controller['index']);router[_0x21c4('0x9')](_0x21c4('0xb'),auth['isAuthenticated'](),controller[_0x21c4('0xc')]);router['post']('/',auth[_0x21c4('0xa')](),controller[_0x21c4('0xd')]);router[_0x21c4('0xe')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller[_0x21c4('0xf')]);router[_0x21c4('0x10')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller['destroy']);module[_0x21c4('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 6975253..8533a49 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 _0x4a81=['exports','STRING','name','sequelize'];(function(_0x125558,_0xdda8ba){var _0xe17ad1=function(_0x1d7cb1){while(--_0x1d7cb1){_0x125558['push'](_0x125558['shift']());}};_0xe17ad1(++_0xdda8ba);}(_0x4a81,0x1b7));var _0x14a8=function(_0x2a5248,_0x4c9948){_0x2a5248=_0x2a5248-0x0;var _0x2536af=_0x4a81[_0x2a5248];return _0x2536af;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'name':{'type':Sequelize[_0x14a8('0x2')],'unique':_0x14a8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x824b=['STRING','name'];(function(_0x5505ef,_0x6e6591){var _0x140883=function(_0x2b4f69){while(--_0x2b4f69){_0x5505ef['push'](_0x5505ef['shift']());}};_0x140883(++_0x6e6591);}(_0x824b,0x10e));var _0xb824=function(_0x1070e6,_0x14a3b0){_0x1070e6=_0x1070e6-0x0;var _0x15925b=_0x824b[_0x1070e6];return _0x15925b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb824('0x0')],'unique':_0xb824('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb824('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 52eefce..6820f46 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 _0xc7ba=['update','destroy','then','get','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','user','role','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save'];(function(_0x4f46c7,_0x224f6e){var _0x738c0c=function(_0x311e0d){while(--_0x311e0d){_0x4f46c7['push'](_0x4f46c7['shift']());}};_0x738c0c(++_0x224f6e);}(_0xc7ba,0x1d4));var _0xac7b=function(_0x3aadc5,_0x3ad6e7){_0x3aadc5=_0x3aadc5-0x0;var _0x5a6285=_0xc7ba[_0x3aadc5];return _0x5a6285;};'use strict';var emlformat=require(_0xac7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac7b('0x1'));var jsonpatch=require(_0xac7b('0x2'));var rp=require('request-promise');var moment=require(_0xac7b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac7b('0x4'));var util=require('util');var path=require(_0xac7b('0x5'));var sox=require(_0xac7b('0x6'));var csv=require('to-csv');var ejs=require(_0xac7b('0x7'));var fs=require('fs');var fs_extra=require(_0xac7b('0x8'));var _=require(_0xac7b('0x9'));var squel=require(_0xac7b('0xa'));var crypto=require(_0xac7b('0xb'));var jsforce=require(_0xac7b('0xc'));var deskjs=require(_0xac7b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xac7b('0xe'));var Papa=require('papaparse');var Redis=require(_0xac7b('0xf'));var authService=require(_0xac7b('0x10'));var qs=require(_0xac7b('0x11'));var as=require(_0xac7b('0x12'));var hardwareService=require(_0xac7b('0x13'));var logger=require(_0xac7b('0x14'))(_0xac7b('0x15'));var utils=require(_0xac7b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xac7b('0x17'));var db=require(_0xac7b('0x18'))['db'];function respondWithStatusCode(_0x284ca4,_0x72b511){_0x72b511=_0x72b511||0xcc;return function(_0x54c92f){if(_0x54c92f){return _0x284ca4['sendStatus'](_0x72b511);}return _0x284ca4[_0xac7b('0x19')](_0x72b511)[_0xac7b('0x1a')]();};}function respondWithResult(_0x337108,_0x343ddb){_0x343ddb=_0x343ddb||0xc8;return function(_0x4a11b4){if(_0x4a11b4){return _0x337108[_0xac7b('0x19')](_0x343ddb)[_0xac7b('0x1b')](_0x4a11b4);}};}function respondWithFilteredResult(_0x441c82,_0x50fb9a){return function(_0x4ced11){if(_0x4ced11){var _0x655bc8=typeof _0x50fb9a[_0xac7b('0x1c')]===_0xac7b('0x1d')&&typeof _0x50fb9a['limit']===_0xac7b('0x1d');var _0x2091b2=_0x4ced11[_0xac7b('0x1e')];var _0x54cc86=_0x655bc8?0x0:_0x50fb9a[_0xac7b('0x1c')];var _0x5e3e87=_0x655bc8?_0x4ced11[_0xac7b('0x1e')]:_0x50fb9a[_0xac7b('0x1c')]+_0x50fb9a[_0xac7b('0x1f')];var _0x1e0a4a;if(_0x5e3e87>=_0x2091b2){_0x5e3e87=_0x2091b2;_0x1e0a4a=0xc8;}else{_0x1e0a4a=0xce;}_0x441c82[_0xac7b('0x19')](_0x1e0a4a);return _0x441c82[_0xac7b('0x20')]('Content-Range',_0x54cc86+'-'+_0x5e3e87+'/'+_0x2091b2)[_0xac7b('0x1b')](_0x4ced11);}return null;};}function patchUpdates(_0x1c11fd){return function(_0x26a169){try{jsonpatch[_0xac7b('0x21')](_0x26a169,_0x1c11fd,!![]);}catch(_0x4af9aa){return BPromise[_0xac7b('0x22')](_0x4af9aa);}return _0x26a169[_0xac7b('0x23')]();};}function saveUpdates(_0x330d42,_0x1f583e){return function(_0x198931){if(_0x198931){return _0x198931[_0xac7b('0x24')](_0x330d42)['then'](function(_0x118aa5){return _0x118aa5;});}return null;};}function removeEntity(_0x2491fe,_0x47a897){return function(_0x556f23){if(_0x556f23){return _0x556f23[_0xac7b('0x25')]()[_0xac7b('0x26')](function(){var _0xab5356=_0x556f23[_0xac7b('0x27')]({'plain':!![]});var _0x10e63a='Variables';return db['UserProfileResource']['destroy']({'where':{'type':_0x10e63a,'resourceId':_0xab5356['id']}})['then'](function(){return _0x556f23;});})[_0xac7b('0x26')](function(){_0x2491fe[_0xac7b('0x19')](0xcc)[_0xac7b('0x1a')]();});}};}function handleEntityNotFound(_0x563be2,_0x27758e){return function(_0x3b7b54){if(!_0x3b7b54){_0x563be2['sendStatus'](0x194);}return _0x3b7b54;};}function handleError(_0xe7e082,_0xae77e){_0xae77e=_0xae77e||0x1f4;return function(_0x1e0318){logger[_0xac7b('0x28')](_0x1e0318['stack']);if(_0x1e0318[_0xac7b('0x29')]){delete _0x1e0318[_0xac7b('0x29')];}_0xe7e082[_0xac7b('0x19')](_0xae77e)[_0xac7b('0x2a')](_0x1e0318);};}exports[_0xac7b('0x2b')]=function(_0x4c9644,_0x181f3e){var _0x402e8e={},_0x1c1284={},_0x17b269={'count':0x0,'rows':[]};var _0x2bb366=_[_0xac7b('0x2c')](db[_0xac7b('0x2d')][_0xac7b('0x2e')],function(_0x20dfb1){return{'name':_0x20dfb1[_0xac7b('0x2f')],'type':_0x20dfb1[_0xac7b('0x30')][_0xac7b('0x31')]};});_0x1c1284['model']=_[_0xac7b('0x2c')](_0x2bb366,_0xac7b('0x29'));_0x1c1284[_0xac7b('0x32')]=_[_0xac7b('0x33')](_0x4c9644[_0xac7b('0x32')]);_0x1c1284[_0xac7b('0x34')]=_['intersection'](_0x1c1284['model'],_0x1c1284[_0xac7b('0x32')]);_0x402e8e[_0xac7b('0x35')]=_[_0xac7b('0x36')](_0x1c1284['model'],qs[_0xac7b('0x37')](_0x4c9644['query'][_0xac7b('0x37')]));_0x402e8e['attributes']=_0x402e8e[_0xac7b('0x35')][_0xac7b('0x38')]?_0x402e8e['attributes']:_0x1c1284[_0xac7b('0x39')];if(!_0x4c9644[_0xac7b('0x32')][_0xac7b('0x3a')](_0xac7b('0x3b'))){_0x402e8e[_0xac7b('0x1f')]=qs[_0xac7b('0x1f')](_0x4c9644[_0xac7b('0x32')][_0xac7b('0x1f')]);_0x402e8e['offset']=qs[_0xac7b('0x1c')](_0x4c9644[_0xac7b('0x32')][_0xac7b('0x1c')]);}_0x402e8e[_0xac7b('0x3c')]=qs['sort'](_0x4c9644[_0xac7b('0x32')][_0xac7b('0x3d')]);_0x402e8e['where']=qs[_0xac7b('0x34')](_[_0xac7b('0x3e')](_0x4c9644['query'],_0x1c1284[_0xac7b('0x34')]),_0x2bb366);if(_0x4c9644[_0xac7b('0x32')][_0xac7b('0x3f')]){_0x402e8e[_0xac7b('0x40')]=_['merge'](_0x402e8e['where'],{'$or':_[_0xac7b('0x2c')](_0x2bb366,function(_0x4091a5){if(_0x4091a5['type']!==_0xac7b('0x41')){var _0x1cc274={};_0x1cc274[_0x4091a5[_0xac7b('0x29')]]={'$like':'%'+_0x4c9644[_0xac7b('0x32')][_0xac7b('0x3f')]+'%'};return _0x1cc274;}})});}_0x402e8e=_[_0xac7b('0x42')]({},_0x402e8e,_0x4c9644[_0xac7b('0x43')]);var _0x126eb8={'where':_0x402e8e['where']};return db[_0xac7b('0x2d')]['count'](_0x126eb8)[_0xac7b('0x26')](function(_0x46921f){_0x17b269[_0xac7b('0x1e')]=_0x46921f;if(_0x4c9644['query'][_0xac7b('0x44')]){_0x402e8e[_0xac7b('0x45')]=[{'all':!![]}];}return db[_0xac7b('0x2d')]['findAll'](_0x402e8e);})[_0xac7b('0x26')](function(_0x5d884d){_0x17b269[_0xac7b('0x46')]=_0x5d884d;return _0x17b269;})[_0xac7b('0x26')](respondWithFilteredResult(_0x181f3e,_0x402e8e))[_0xac7b('0x47')](handleError(_0x181f3e,null));};exports['show']=function(_0x2686ea,_0x587599){var _0x17c5ab={'raw':!![],'where':{'id':_0x2686ea[_0xac7b('0x48')]['id']}},_0x43507b={};_0x43507b[_0xac7b('0x39')]=_[_0xac7b('0x33')](db[_0xac7b('0x2d')][_0xac7b('0x2e')]);_0x43507b[_0xac7b('0x32')]=_[_0xac7b('0x33')](_0x2686ea[_0xac7b('0x32')]);_0x43507b[_0xac7b('0x34')]=_['intersection'](_0x43507b['model'],_0x43507b['query']);_0x17c5ab['attributes']=_[_0xac7b('0x36')](_0x43507b['model'],qs[_0xac7b('0x37')](_0x2686ea[_0xac7b('0x32')]['fields']));_0x17c5ab[_0xac7b('0x35')]=_0x17c5ab[_0xac7b('0x35')][_0xac7b('0x38')]?_0x17c5ab[_0xac7b('0x35')]:_0x43507b[_0xac7b('0x39')];if(_0x2686ea[_0xac7b('0x32')][_0xac7b('0x44')]){_0x17c5ab[_0xac7b('0x45')]=[{'all':!![]}];}_0x17c5ab=_[_0xac7b('0x42')]({},_0x17c5ab,_0x2686ea[_0xac7b('0x43')]);return db[_0xac7b('0x2d')][_0xac7b('0x49')](_0x17c5ab)[_0xac7b('0x26')](handleEntityNotFound(_0x587599,null))[_0xac7b('0x26')](respondWithResult(_0x587599,null))[_0xac7b('0x47')](handleError(_0x587599,null));};exports[_0xac7b('0x4a')]=function(_0x228539,_0x4ac554){return db[_0xac7b('0x2d')]['create'](_0x228539[_0xac7b('0x4b')],{})[_0xac7b('0x26')](function(_0x33c5a4){var _0x5e6ed4=_0x228539[_0xac7b('0x4c')][_0xac7b('0x27')]({'plain':!![]});if(!_0x5e6ed4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e6ed4[_0xac7b('0x4d')]==='user'){var _0x1d9cf2=_0x33c5a4[_0xac7b('0x27')]({'plain':!![]});var _0x24da94=_0xac7b('0x4e');return db[_0xac7b('0x4f')][_0xac7b('0x49')]({'where':{'name':_0x24da94,'userProfileId':_0x5e6ed4[_0xac7b('0x50')]},'raw':!![]})[_0xac7b('0x26')](function(_0x189b9a){if(_0x189b9a&&_0x189b9a[_0xac7b('0x51')]===0x0){return db[_0xac7b('0x52')][_0xac7b('0x4a')]({'name':_0x1d9cf2[_0xac7b('0x29')],'resourceId':_0x1d9cf2['id'],'type':_0x189b9a[_0xac7b('0x29')],'sectionId':_0x189b9a['id']},{})[_0xac7b('0x26')](function(){return _0x33c5a4;});}else{return _0x33c5a4;}})['catch'](function(_0x5d1f30){logger[_0xac7b('0x28')](_0xac7b('0x53'),_0x5d1f30);throw _0x5d1f30;});}return _0x33c5a4;})[_0xac7b('0x26')](respondWithResult(_0x4ac554,0xc9))[_0xac7b('0x47')](handleError(_0x4ac554,null));};exports[_0xac7b('0x24')]=function(_0x5ec576,_0x1b313b){if(_0x5ec576[_0xac7b('0x4b')]['id']){delete _0x5ec576[_0xac7b('0x4b')]['id'];}return db[_0xac7b('0x2d')][_0xac7b('0x49')]({'where':{'id':_0x5ec576['params']['id']}})[_0xac7b('0x26')](handleEntityNotFound(_0x1b313b,null))[_0xac7b('0x26')](saveUpdates(_0x5ec576[_0xac7b('0x4b')],null))[_0xac7b('0x26')](respondWithResult(_0x1b313b,null))[_0xac7b('0x47')](handleError(_0x1b313b,null));};exports[_0xac7b('0x25')]=function(_0x339d0c,_0x3665bd){return db['Variable']['find']({'where':{'id':_0x339d0c[_0xac7b('0x48')]['id']}})[_0xac7b('0x26')](handleEntityNotFound(_0x3665bd,null))['then'](removeEntity(_0x3665bd,null))[_0xac7b('0x47')](handleError(_0x3665bd,null));}; \ No newline at end of file +var _0x94e3=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','Variable','includeAll','include','findAll','rows','catch','show','params','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','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs'];(function(_0x2da1bf,_0x398c68){var _0x11ce86=function(_0x5113ad){while(--_0x5113ad){_0x2da1bf['push'](_0x2da1bf['shift']());}};_0x11ce86(++_0x398c68);}(_0x94e3,0xab));var _0x394e=function(_0x482794,_0x4e1672){_0x482794=_0x482794-0x0;var _0x5b4cf6=_0x94e3[_0x482794];return _0x5b4cf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x394e('0x0'));var zipdir=require(_0x394e('0x1'));var jsonpatch=require(_0x394e('0x2'));var rp=require(_0x394e('0x3'));var moment=require(_0x394e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x394e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x394e('0x6'));var csv=require(_0x394e('0x7'));var ejs=require(_0x394e('0x8'));var fs=require('fs');var fs_extra=require(_0x394e('0x9'));var _=require(_0x394e('0xa'));var squel=require(_0x394e('0xb'));var crypto=require(_0x394e('0xc'));var jsforce=require(_0x394e('0xd'));var deskjs=require(_0x394e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x394e('0xf'));var Papa=require('papaparse');var Redis=require(_0x394e('0x10'));var authService=require(_0x394e('0x11'));var qs=require(_0x394e('0x12'));var as=require(_0x394e('0x13'));var hardwareService=require(_0x394e('0x14'));var logger=require(_0x394e('0x15'))(_0x394e('0x16'));var utils=require(_0x394e('0x17'));var config=require(_0x394e('0x18'));var licenseUtil=require(_0x394e('0x19'));var db=require(_0x394e('0x1a'))['db'];function respondWithStatusCode(_0x592fce,_0x19bf6b){_0x19bf6b=_0x19bf6b||0xcc;return function(_0x3882c8){if(_0x3882c8){return _0x592fce[_0x394e('0x1b')](_0x19bf6b);}return _0x592fce[_0x394e('0x1c')](_0x19bf6b)[_0x394e('0x1d')]();};}function respondWithResult(_0x101cd8,_0x34ce14){_0x34ce14=_0x34ce14||0xc8;return function(_0x46efa7){if(_0x46efa7){return _0x101cd8[_0x394e('0x1c')](_0x34ce14)[_0x394e('0x1e')](_0x46efa7);}};}function respondWithFilteredResult(_0x3c9113,_0x4471d7){return function(_0xc2738e){if(_0xc2738e){var _0x34e9be=typeof _0x4471d7[_0x394e('0x1f')]===_0x394e('0x20')&&typeof _0x4471d7[_0x394e('0x21')]==='undefined';var _0x5a6d1b=_0xc2738e['count'];var _0x475cae=_0x34e9be?0x0:_0x4471d7['offset'];var _0x76ff25=_0x34e9be?_0xc2738e[_0x394e('0x22')]:_0x4471d7[_0x394e('0x1f')]+_0x4471d7['limit'];var _0xfa00d4;if(_0x76ff25>=_0x5a6d1b){_0x76ff25=_0x5a6d1b;_0xfa00d4=0xc8;}else{_0xfa00d4=0xce;}_0x3c9113[_0x394e('0x1c')](_0xfa00d4);return _0x3c9113[_0x394e('0x23')](_0x394e('0x24'),_0x475cae+'-'+_0x76ff25+'/'+_0x5a6d1b)[_0x394e('0x1e')](_0xc2738e);}return null;};}function patchUpdates(_0x3b10c3){return function(_0x3ef29e){try{jsonpatch[_0x394e('0x25')](_0x3ef29e,_0x3b10c3,!![]);}catch(_0x4f1894){return BPromise[_0x394e('0x26')](_0x4f1894);}return _0x3ef29e[_0x394e('0x27')]();};}function saveUpdates(_0x4b9279,_0x2df31f){return function(_0x50ab32){if(_0x50ab32){return _0x50ab32[_0x394e('0x28')](_0x4b9279)[_0x394e('0x29')](function(_0xe1189c){return _0xe1189c;});}return null;};}function removeEntity(_0x1ed75a,_0x2161cf){return function(_0x5975be){if(_0x5975be){return _0x5975be[_0x394e('0x2a')]()['then'](function(){var _0x2f4793=_0x5975be['get']({'plain':!![]});var _0x4d4d02=_0x394e('0x2b');return db[_0x394e('0x2c')][_0x394e('0x2a')]({'where':{'type':_0x4d4d02,'resourceId':_0x2f4793['id']}})[_0x394e('0x29')](function(){return _0x5975be;});})['then'](function(){_0x1ed75a[_0x394e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2d87,_0x5323a8){return function(_0x1fd5fa){if(!_0x1fd5fa){_0x3b2d87['sendStatus'](0x194);}return _0x1fd5fa;};}function handleError(_0x45fdce,_0x449428){_0x449428=_0x449428||0x1f4;return function(_0x260b7b){logger[_0x394e('0x2d')](_0x260b7b[_0x394e('0x2e')]);if(_0x260b7b[_0x394e('0x2f')]){delete _0x260b7b[_0x394e('0x2f')];}_0x45fdce[_0x394e('0x1c')](_0x449428)[_0x394e('0x30')](_0x260b7b);};}exports[_0x394e('0x31')]=function(_0xfd7060,_0x241e4e){var _0x38acce={},_0x31f311={},_0x4c8f87={'count':0x0,'rows':[]};var _0x59843b=_[_0x394e('0x32')](db['Variable'][_0x394e('0x33')],function(_0x2fb083){return{'name':_0x2fb083[_0x394e('0x34')],'type':_0x2fb083[_0x394e('0x35')][_0x394e('0x36')]};});_0x31f311[_0x394e('0x37')]=_[_0x394e('0x32')](_0x59843b,_0x394e('0x2f'));_0x31f311[_0x394e('0x38')]=_[_0x394e('0x39')](_0xfd7060[_0x394e('0x38')]);_0x31f311[_0x394e('0x3a')]=_[_0x394e('0x3b')](_0x31f311[_0x394e('0x37')],_0x31f311[_0x394e('0x38')]);_0x38acce[_0x394e('0x3c')]=_[_0x394e('0x3b')](_0x31f311['model'],qs[_0x394e('0x3d')](_0xfd7060[_0x394e('0x38')][_0x394e('0x3d')]));_0x38acce['attributes']=_0x38acce[_0x394e('0x3c')][_0x394e('0x3e')]?_0x38acce['attributes']:_0x31f311[_0x394e('0x37')];if(!_0xfd7060['query'][_0x394e('0x3f')](_0x394e('0x40'))){_0x38acce[_0x394e('0x21')]=qs[_0x394e('0x21')](_0xfd7060[_0x394e('0x38')][_0x394e('0x21')]);_0x38acce[_0x394e('0x1f')]=qs[_0x394e('0x1f')](_0xfd7060['query'][_0x394e('0x1f')]);}_0x38acce['order']=qs['sort'](_0xfd7060[_0x394e('0x38')][_0x394e('0x41')]);_0x38acce['where']=qs['filters'](_[_0x394e('0x42')](_0xfd7060[_0x394e('0x38')],_0x31f311[_0x394e('0x3a')]),_0x59843b);if(_0xfd7060[_0x394e('0x38')][_0x394e('0x43')]){_0x38acce[_0x394e('0x44')]=_[_0x394e('0x45')](_0x38acce['where'],{'$or':_['map'](_0x59843b,function(_0x15d020){if(_0x15d020[_0x394e('0x35')]!==_0x394e('0x46')){var _0x31d08c={};_0x31d08c[_0x15d020[_0x394e('0x2f')]]={'$like':'%'+_0xfd7060['query'][_0x394e('0x43')]+'%'};return _0x31d08c;}})});}_0x38acce=_[_0x394e('0x45')]({},_0x38acce,_0xfd7060['options']);var _0x11783f={'where':_0x38acce[_0x394e('0x44')]};return db[_0x394e('0x47')]['count'](_0x11783f)['then'](function(_0x27af1e){_0x4c8f87[_0x394e('0x22')]=_0x27af1e;if(_0xfd7060[_0x394e('0x38')][_0x394e('0x48')]){_0x38acce[_0x394e('0x49')]=[{'all':!![]}];}return db['Variable'][_0x394e('0x4a')](_0x38acce);})[_0x394e('0x29')](function(_0x7c044a){_0x4c8f87[_0x394e('0x4b')]=_0x7c044a;return _0x4c8f87;})[_0x394e('0x29')](respondWithFilteredResult(_0x241e4e,_0x38acce))[_0x394e('0x4c')](handleError(_0x241e4e,null));};exports[_0x394e('0x4d')]=function(_0x371643,_0x1d4c61){var _0x2abbb6={'raw':!![],'where':{'id':_0x371643[_0x394e('0x4e')]['id']}},_0x5dda0f={};_0x5dda0f['model']=_[_0x394e('0x39')](db[_0x394e('0x47')][_0x394e('0x33')]);_0x5dda0f[_0x394e('0x38')]=_[_0x394e('0x39')](_0x371643[_0x394e('0x38')]);_0x5dda0f[_0x394e('0x3a')]=_[_0x394e('0x3b')](_0x5dda0f[_0x394e('0x37')],_0x5dda0f[_0x394e('0x38')]);_0x2abbb6['attributes']=_[_0x394e('0x3b')](_0x5dda0f[_0x394e('0x37')],qs[_0x394e('0x3d')](_0x371643[_0x394e('0x38')]['fields']));_0x2abbb6['attributes']=_0x2abbb6[_0x394e('0x3c')][_0x394e('0x3e')]?_0x2abbb6['attributes']:_0x5dda0f[_0x394e('0x37')];if(_0x371643[_0x394e('0x38')][_0x394e('0x48')]){_0x2abbb6[_0x394e('0x49')]=[{'all':!![]}];}_0x2abbb6=_[_0x394e('0x45')]({},_0x2abbb6,_0x371643[_0x394e('0x4f')]);return db[_0x394e('0x47')][_0x394e('0x50')](_0x2abbb6)[_0x394e('0x29')](handleEntityNotFound(_0x1d4c61,null))[_0x394e('0x29')](respondWithResult(_0x1d4c61,null))[_0x394e('0x4c')](handleError(_0x1d4c61,null));};exports[_0x394e('0x51')]=function(_0xe3fdd0,_0x427ed3){return db[_0x394e('0x47')][_0x394e('0x51')](_0xe3fdd0[_0x394e('0x52')],{})[_0x394e('0x29')](function(_0x1efc3b){var _0x11a9cd=_0xe3fdd0[_0x394e('0x53')][_0x394e('0x54')]({'plain':!![]});if(!_0x11a9cd)throw new Error(_0x394e('0x55'));if(_0x11a9cd[_0x394e('0x56')]===_0x394e('0x53')){var _0x3fa18c=_0x1efc3b[_0x394e('0x54')]({'plain':!![]});var _0x1580e6=_0x394e('0x2b');return db[_0x394e('0x57')]['find']({'where':{'name':_0x1580e6,'userProfileId':_0x11a9cd[_0x394e('0x58')]},'raw':!![]})['then'](function(_0x3ca416){if(_0x3ca416&&_0x3ca416['autoAssociation']===0x0){return db[_0x394e('0x2c')][_0x394e('0x51')]({'name':_0x3fa18c[_0x394e('0x2f')],'resourceId':_0x3fa18c['id'],'type':_0x3ca416['name'],'sectionId':_0x3ca416['id']},{})[_0x394e('0x29')](function(){return _0x1efc3b;});}else{return _0x1efc3b;}})['catch'](function(_0x5a7cfe){logger[_0x394e('0x2d')](_0x394e('0x59'),_0x5a7cfe);throw _0x5a7cfe;});}return _0x1efc3b;})[_0x394e('0x29')](respondWithResult(_0x427ed3,0xc9))['catch'](handleError(_0x427ed3,null));};exports[_0x394e('0x28')]=function(_0xca74b6,_0x2e83d9){if(_0xca74b6[_0x394e('0x52')]['id']){delete _0xca74b6['body']['id'];}return db['Variable'][_0x394e('0x50')]({'where':{'id':_0xca74b6['params']['id']}})['then'](handleEntityNotFound(_0x2e83d9,null))[_0x394e('0x29')](saveUpdates(_0xca74b6[_0x394e('0x52')],null))['then'](respondWithResult(_0x2e83d9,null))['catch'](handleError(_0x2e83d9,null));};exports[_0x394e('0x2a')]=function(_0x1d4cb7,_0x959bf6){return db['Variable'][_0x394e('0x50')]({'where':{'id':_0x1d4cb7[_0x394e('0x4e')]['id']}})[_0x394e('0x29')](handleEntityNotFound(_0x959bf6,null))[_0x394e('0x29')](removeEntity(_0x959bf6,null))['catch'](handleError(_0x959bf6,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f40b4f1..e702adf 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 _0x2eab=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Variable','lodash'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0x2eab,0x175));var _0xb2ea=function(_0x420ec6,_0x2eb3ef){_0x420ec6=_0x420ec6-0x0;var _0x1454b5=_0x2eab[_0x420ec6];return _0x1454b5;};'use strict';var _=require(_0xb2ea('0x0'));var util=require(_0xb2ea('0x1'));var logger=require(_0xb2ea('0x2'))(_0xb2ea('0x3'));var moment=require('moment');var BPromise=require(_0xb2ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ea('0x5'));var rimraf=require(_0xb2ea('0x6'));var config=require(_0xb2ea('0x7'));var attributes=require('./variable.attributes');module[_0xb2ea('0x8')]=function(_0x333111,_0x44bd53){return _0x333111[_0xb2ea('0x9')](_0xb2ea('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb9=['lodash','util','../../config/environment','./variable.attributes','define','tools_variables'];(function(_0x1b80b9,_0x538e38){var _0x4426c3=function(_0x6ed6d){while(--_0x6ed6d){_0x1b80b9['push'](_0x1b80b9['shift']());}};_0x4426c3(++_0x538e38);}(_0x5eb9,0x1e6));var _0x95eb=function(_0x2d3711,_0x43d60d){_0x2d3711=_0x2d3711-0x0;var _0x477858=_0x5eb9[_0x2d3711];return _0x477858;};'use strict';var _=require(_0x95eb('0x0'));var util=require(_0x95eb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x95eb('0x2'));var attributes=require(_0x95eb('0x3'));module['exports']=function(_0x456f9e,_0x5e513d){return _0x456f9e[_0x95eb('0x4')]('Variable',attributes,{'tableName':_0x95eb('0x5'),'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 4f3dec1..1442627 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2b4d26,_0x279b45){var _0x1b5a40=function(_0x42837d){while(--_0x42837d){_0x2b4d26['push'](_0x2b4d26['shift']());}};_0x1b5a40(++_0x279b45);}(_0x8ef6,0xf2));var _0x68ef=function(_0x586a8b,_0x57e00e){_0x586a8b=_0x586a8b-0x0;var _0x21e9a9=_0x8ef6[_0x586a8b];return _0x21e9a9;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x5fc3[_0x25662e];return _0x59b7bc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index ac4094a..ce72b1d 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 _0x1ac2=['express','Router','./version.controller','get','/fetch','canUpdate','reset','/pull','pull','/restart','isAuthenticated','restart','/migrations','exports'];(function(_0x4a690d,_0x51473d){var _0x31e44c=function(_0x442593){while(--_0x442593){_0x4a690d['push'](_0x4a690d['shift']());}};_0x31e44c(++_0x51473d);}(_0x1ac2,0x196));var _0x21ac=function(_0x2f7338,_0xfa2367){_0x2f7338=_0x2f7338-0x0;var _0x2d1ced=_0x1ac2[_0x2f7338];return _0x2d1ced;};'use strict';var express=require(_0x21ac('0x0'));var router=express[_0x21ac('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x21ac('0x2'));router[_0x21ac('0x3')]('/',controller['index']);router['get'](_0x21ac('0x4'),auth['isAuthenticated'](),auth[_0x21ac('0x5')](),controller['fetch']);router[_0x21ac('0x3')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x21ac('0x6')]);router[_0x21ac('0x3')](_0x21ac('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x21ac('0x8')]);router[_0x21ac('0x3')](_0x21ac('0x9'),auth[_0x21ac('0xa')](),controller[_0x21ac('0xb')]);router[_0x21ac('0x3')](_0x21ac('0xc'),controller['migrations']);module[_0x21ac('0xd')]=router; \ No newline at end of file +var _0xb2f5=['/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get','index'];(function(_0x387556,_0x4b326f){var _0x23ad01=function(_0x59ddb8){while(--_0x59ddb8){_0x387556['push'](_0x387556['shift']());}};_0x23ad01(++_0x4b326f);}(_0xb2f5,0x12d));var _0x5b2f=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb2f5[_0x2aecb2];return _0x3ebb80;};'use strict';var express=require(_0x5b2f('0x0'));var router=express[_0x5b2f('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5b2f('0x2'));router[_0x5b2f('0x3')]('/',controller[_0x5b2f('0x4')]);router[_0x5b2f('0x3')](_0x5b2f('0x5'),auth[_0x5b2f('0x6')](),auth[_0x5b2f('0x7')](),controller[_0x5b2f('0x8')]);router[_0x5b2f('0x3')]('/reset',auth[_0x5b2f('0x6')](),auth[_0x5b2f('0x7')](),controller[_0x5b2f('0x9')]);router[_0x5b2f('0x3')](_0x5b2f('0xa'),auth['isAuthenticated'](),auth[_0x5b2f('0x7')](),controller[_0x5b2f('0xb')]);router['get'](_0x5b2f('0xc'),auth[_0x5b2f('0x6')](),controller[_0x5b2f('0xd')]);router[_0x5b2f('0x3')](_0x5b2f('0xe'),controller[_0x5b2f('0xf')]);module[_0x5b2f('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e5f574b..96b9185 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 _0x1037=['info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length','replace','.js','push','sequelize','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/logger','update','root','index','exports','query','tags','latest','status','json','fetch','origin','master','error'];(function(_0x262593,_0x382dae){var _0x26c00e=function(_0x5c6c10){while(--_0x5c6c10){_0x262593['push'](_0x262593['shift']());}};_0x26c00e(++_0x382dae);}(_0x1037,0x83));var _0x7103=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x1037[_0x27c068];return _0xe5a67f;};'use strict';var Umzug=require(_0x7103('0x0'));var path=require(_0x7103('0x1'));var fs=require('fs');var _=require(_0x7103('0x2'));var pkginfo=require(_0x7103('0x3'))(module,_0x7103('0x4'));var compareVersions=require(_0x7103('0x5'));var exec=require(_0x7103('0x6'))[_0x7103('0x7')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x7103('0x8'))(_0x7103('0x9'));var git=require('simple-git')(config[_0x7103('0xa')]);exports[_0x7103('0xb')]=function(_0x14ca47,_0x18d888){var _0x348be6={'current':module[_0x7103('0xc')]['version'],'phonebar':0x2};if(_0x14ca47[_0x7103('0xd')]&&_0x14ca47[_0x7103('0xd')]['latest']){return git['fetch']()[_0x7103('0xe')](function(_0x1351fd,_0x187fe9){_0x348be6[_0x7103('0xf')]=(_0x1351fd?module[_0x7103('0xc')][_0x7103('0x4')]:_0x187fe9[_0x7103('0xf')])||'2.0.0';return _0x18d888[_0x7103('0x10')](0xc8)[_0x7103('0x11')](_0x348be6);});}else{return _0x18d888['status'](0xc8)[_0x7103('0x11')](_0x348be6);}};exports[_0x7103('0x12')]=function(_0x1305e1,_0x6131be){return git[_0x7103('0x12')]([_0x7103('0x13'),_0x7103('0x14')],function(_0x3b057a){if(_0x3b057a){logger[_0x7103('0x15')](_0x3b057a);return _0x6131be[_0x7103('0x10')](0x1f4)[_0x7103('0x11')](_0x3b057a);}logger[_0x7103('0x16')](_0x7103('0x17'));return _0x6131be[_0x7103('0x10')](0xc8)[_0x7103('0x11')]({'output':_0x7103('0x18')});});};exports['reset']=function(_0x325595,_0x4213ad){return git[_0x7103('0x19')]([_0x7103('0x1a'),_0x7103('0x1b')],function(_0x59351d){if(_0x59351d){logger['error'](_0x59351d);return _0x4213ad[_0x7103('0x10')](0x1f4)[_0x7103('0x11')](_0x59351d);}logger['info'](_0x7103('0x1c'));return _0x4213ad[_0x7103('0x10')](0xc8)[_0x7103('0x11')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x4a8fa8,_0x520f33){exec(_0x7103('0x1d'),function(_0x244038,_0xc06251,_0x4a9068){logger[_0x7103('0x16')](_0xc06251);logger[_0x7103('0x16')](_0x4a9068);if(_0x244038){logger['error'](_0x244038);return _0x520f33[_0x7103('0x10')](0x1f4)[_0x7103('0x11')](_0x244038);}return _0x520f33['status'](0xc8)[_0x7103('0x11')]({'output':_0xc06251});});};exports['restart']=function(_0x3fbb6a,_0x1a283e){return pm2[_0x7103('0x1e')](_0x7103('0x1f'))[_0x7103('0x20')](function(_0x5ab7f5){logger['info']('pm2\x20restart\x20motion\x20%s',_0x5ab7f5);return _0x1a283e[_0x7103('0x10')](0xc8)[_0x7103('0x11')]({'output':_0x7103('0x21')});})['catch'](function(_0x2e2f93){logger['error'](_0x2e2f93);return _0x1a283e[_0x7103('0x10')](0x1f4)[_0x7103('0x11')](_0x2e2f93);});};exports[_0x7103('0x22')]=function(_0x52000c,_0x4d0fb6){var _0x2b455a=fs[_0x7103('0x23')](path['join'](config[_0x7103('0xa')],_0x7103('0x24'),_0x7103('0x22')));var _0xa16c9e=[];for(var _0x5832af=0x0;_0x5832af<_0x2b455a[_0x7103('0x25')];_0x5832af++){var _0x74d081=_0x2b455a[_0x5832af][_0x7103('0x26')](_0x7103('0x27'),'');if(compareVersions(module[_0x7103('0xc')][_0x7103('0x4')],_0x74d081)===-0x1){_0xa16c9e[_0x7103('0x28')](_0x74d081);}}if(_0xa16c9e[_0x7103('0x25')]){var _0x57ddda=_0xa16c9e['sort'](compareVersions);var _0x38a78b=new Umzug({'storage':_0x7103('0x29'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x7103('0x4')},'migrations':{'params':[db['sequelize'][_0x7103('0x2a')](),db[_0x7103('0x29')][_0x7103('0x2b')],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['join'](config[_0x7103('0xa')],'server',_0x7103('0x22')),'pattern':/\.js$/}});_0x38a78b['up']({'migrations':_[_0x7103('0x2c')](_0x57ddda,function(_0x212f52){return _0x212f52+_0x7103('0x27');})})[_0x7103('0x20')](function(){return _0x4d0fb6['status'](0xc8)[_0x7103('0x11')]({'output':_0x7103('0x2d')+module['exports']['version']+_0x7103('0x2e')+_[_0x7103('0x2f')](_0x57ddda),'migrations':_[_0x7103('0x30')](_0x57ddda)});})['catch'](function(_0x2ee2b2){if(_0x2ee2b2 instanceof db['sequelize'][_0x7103('0x31')]){return _0x4d0fb6[_0x7103('0x10')](0xc8)['json']({'output':_0x7103('0x32')});}else{return _0x4d0fb6['status'](0x1f4)[_0x7103('0x11')](_0x2ee2b2);}});}else{return _0x4d0fb6[_0x7103('0x10')](0xc8)[_0x7103('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x2e53=['simple-git','root','index','version','query','latest','fetch','tags','exports','status','json','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','push','length','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','.js','catch','Database\x20already\x20up-to-date','umzug','../../config/environment','update'];(function(_0x487f15,_0x1cf5fb){var _0x32c8a1=function(_0x255c2f){while(--_0x255c2f){_0x487f15['push'](_0x487f15['shift']());}};_0x32c8a1(++_0x1cf5fb);}(_0x2e53,0x1d6));var _0x32e5=function(_0xb4bdb3,_0x48dca0){_0xb4bdb3=_0xb4bdb3-0x0;var _0x4c8c02=_0x2e53[_0xb4bdb3];return _0x4c8c02;};'use strict';var Umzug=require(_0x32e5('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x32e5('0x1'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x32e5('0x2'));var git=require(_0x32e5('0x3'))(config[_0x32e5('0x4')]);exports[_0x32e5('0x5')]=function(_0x452549,_0x2ecbae){var _0x3e2385={'current':module['exports'][_0x32e5('0x6')],'phonebar':0x2};if(_0x452549['query']&&_0x452549[_0x32e5('0x7')][_0x32e5('0x8')]){return git[_0x32e5('0x9')]()[_0x32e5('0xa')](function(_0x18ea43,_0x5b799f){_0x3e2385[_0x32e5('0x8')]=(_0x18ea43?module[_0x32e5('0xb')]['version']:_0x5b799f[_0x32e5('0x8')])||'2.0.0';return _0x2ecbae[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')](_0x3e2385);});}else{return _0x2ecbae[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')](_0x3e2385);}};exports[_0x32e5('0x9')]=function(_0x21c130,_0x2680bf){return git['fetch'](['origin',_0x32e5('0xe')],function(_0x10544d){if(_0x10544d){logger['error'](_0x10544d);return _0x2680bf[_0x32e5('0xc')](0x1f4)[_0x32e5('0xd')](_0x10544d);}logger[_0x32e5('0xf')]('git\x20fetch');return _0x2680bf['status'](0xc8)['json']({'output':_0x32e5('0x10')});});};exports[_0x32e5('0x11')]=function(_0x5d1e6c,_0x3bcc45){return git[_0x32e5('0x11')]([_0x32e5('0x12'),_0x32e5('0x13')],function(_0xc9410d){if(_0xc9410d){logger[_0x32e5('0x14')](_0xc9410d);return _0x3bcc45[_0x32e5('0xc')](0x1f4)[_0x32e5('0xd')](_0xc9410d);}logger[_0x32e5('0xf')](_0x32e5('0x15'));return _0x3bcc45[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')]({'output':_0x32e5('0x16')});});};exports[_0x32e5('0x17')]=function(_0x32e06c,_0x54bdd1){exec(_0x32e5('0x18'),function(_0x1cb26e,_0x50736c,_0x244d8f){logger['info'](_0x50736c);logger[_0x32e5('0xf')](_0x244d8f);if(_0x1cb26e){logger[_0x32e5('0x14')](_0x1cb26e);return _0x54bdd1['status'](0x1f4)[_0x32e5('0xd')](_0x1cb26e);}return _0x54bdd1['status'](0xc8)[_0x32e5('0xd')]({'output':_0x50736c});});};exports[_0x32e5('0x19')]=function(_0x21aee1,_0x2bb356){return pm2[_0x32e5('0x19')](_0x32e5('0x1a'))['then'](function(_0x4ef24e){logger[_0x32e5('0xf')](_0x32e5('0x1b'),_0x4ef24e);return _0x2bb356[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')]({'output':_0x32e5('0x1c')});})['catch'](function(_0x5216a5){logger['error'](_0x5216a5);return _0x2bb356[_0x32e5('0xc')](0x1f4)['json'](_0x5216a5);});};exports[_0x32e5('0x1d')]=function(_0x2bb926,_0x6bc715){var _0x225bfd=fs[_0x32e5('0x1e')](path[_0x32e5('0x1f')](config['root'],'server','migrations'));var _0x43d211=[];for(var _0x4750a3=0x0;_0x4750a3<_0x225bfd['length'];_0x4750a3++){var _0x83bc30=_0x225bfd[_0x4750a3]['replace']('.js','');if(compareVersions(module[_0x32e5('0xb')]['version'],_0x83bc30)===-0x1){_0x43d211[_0x32e5('0x20')](_0x83bc30);}}if(_0x43d211[_0x32e5('0x21')]){var _0x306ec5=_0x43d211[_0x32e5('0x22')](compareVersions);var _0x292d7f=new Umzug({'storage':_0x32e5('0x23'),'storageOptions':{'model':db[_0x32e5('0x24')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x32e5('0x23')]['getQueryInterface'](),db[_0x32e5('0x23')][_0x32e5('0x25')],function(){throw new Error(_0x32e5('0x26'));}],'path':path[_0x32e5('0x1f')](config[_0x32e5('0x4')],_0x32e5('0x27'),_0x32e5('0x1d')),'pattern':/\.js$/}});_0x292d7f['up']({'migrations':_['map'](_0x306ec5,function(_0x32ab45){return _0x32ab45+_0x32e5('0x28');})})['then'](function(){return _0x6bc715[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x32e5('0xb')]['version']+'\x20to\x20'+_['last'](_0x306ec5),'migrations':_[_0x32e5('0x1f')](_0x306ec5)});})[_0x32e5('0x29')](function(_0x484512){if(_0x484512 instanceof db[_0x32e5('0x23')]['UniqueConstraintError']){return _0x6bc715[_0x32e5('0xc')](0xc8)['json']({'output':_0x32e5('0x2a')});}else{return _0x6bc715[_0x32e5('0xc')](0x1f4)[_0x32e5('0xd')](_0x484512);}});}else{return _0x6bc715[_0x32e5('0xc')](0xc8)[_0x32e5('0xd')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4b94554..8c7b0f3 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 _0x4118=['get','/describe','describe','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','express','fs-extra','../../components/auth/service','./voiceAgentReport.controller'];(function(_0x12744e,_0x4dafae){var _0x3e5b56=function(_0x468ce0){while(--_0x468ce0){_0x12744e['push'](_0x12744e['shift']());}};_0x3e5b56(++_0x4dafae);}(_0x4118,0x109));var _0x8411=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x4118[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require(_0x8411('0x0'));var util=require(_0x8411('0x1'));var path=require(_0x8411('0x2'));var timeout=require('connect-timeout');var express=require(_0x8411('0x3'));var router=express['Router']();var fs_extra=require(_0x8411('0x4'));var auth=require(_0x8411('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8411('0x6'));router[_0x8411('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8411('0x7')](_0x8411('0x8'),auth['isAuthenticated'](),controller[_0x8411('0x9')]);router[_0x8411('0x7')]('/:id',auth[_0x8411('0xa')](),controller[_0x8411('0xb')]);router[_0x8411('0xc')]('/',auth[_0x8411('0xa')](),controller[_0x8411('0xd')]);router[_0x8411('0xe')](_0x8411('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8411('0x10')](_0x8411('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0173=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x524165,_0x458a20){var _0x140abf=function(_0x362f82){while(--_0x362f82){_0x524165['push'](_0x524165['shift']());}};_0x140abf(++_0x458a20);}(_0x0173,0x1b7));var _0x3017=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0173[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3017('0x0'));var util=require(_0x3017('0x1'));var path=require(_0x3017('0x2'));var timeout=require(_0x3017('0x3'));var express=require('express');var router=express[_0x3017('0x4')]();var fs_extra=require(_0x3017('0x5'));var auth=require(_0x3017('0x6'));var interaction=require(_0x3017('0x7'));var config=require(_0x3017('0x8'));var controller=require(_0x3017('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3017('0xa')](_0x3017('0xb'),auth[_0x3017('0xc')](),controller[_0x3017('0xd')]);router['get'](_0x3017('0xe'),auth[_0x3017('0xc')](),controller[_0x3017('0xf')]);router[_0x3017('0x10')]('/',auth[_0x3017('0xc')](),controller[_0x3017('0x11')]);router[_0x3017('0x12')](_0x3017('0xe'),auth[_0x3017('0xc')](),controller[_0x3017('0x13')]);router[_0x3017('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3017('0x15')]);module[_0x3017('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b479312..0ca2439 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 _0x5f66=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x65f6('0x1')]},'calleridnum':{'type':Sequelize[_0x65f6('0x1')]},'calleridname':{'type':Sequelize[_0x65f6('0x1')]},'queue':{'type':Sequelize[_0x65f6('0x1')]},'interface':{'type':Sequelize[_0x65f6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x65f6('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x65f6('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x65f6('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x65f6('0x4')]},'agentacw':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x65f6('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x65f6('0x1')]},'channelstate':{'type':Sequelize[_0x65f6('0x4')]},'channelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x65f6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x65f6('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x65f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridname':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x65f6('0x1')]},'destlanguage':{'type':Sequelize[_0x65f6('0x1')]},'destaccountcode':{'type':Sequelize[_0x65f6('0x1')]},'destcontext':{'type':Sequelize[_0x65f6('0x1')]},'destexten':{'type':Sequelize[_0x65f6('0x1')]},'destpriority':{'type':Sequelize[_0x65f6('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x65f6('0x1')],'comment':_0x65f6('0x5')},'transferexten':{'type':Sequelize[_0x65f6('0x1')]},'transferuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'agententerreason':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c4d=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x220b36,_0x396e35){var _0x13a7ac=function(_0x4d1473){while(--_0x4d1473){_0x220b36['push'](_0x220b36['shift']());}};_0x13a7ac(++_0x396e35);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x105c57,_0x1cccca){_0x105c57=_0x105c57-0x0;var _0xb71be5=_0x4c4d[_0x105c57];return _0xb71be5;};'use strict';var Sequelize=require(_0xd4c4('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd4c4('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd4c4('0x1')]},'membername':{'type':Sequelize[_0xd4c4('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentconnectAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd4c4('0x3')]},'agentcomplete':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd4c4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd4c4('0x3')]},'reason':{'type':Sequelize[_0xd4c4('0x1')]},'lastevent':{'type':Sequelize[_0xd4c4('0x1')]},'channel':{'type':Sequelize[_0xd4c4('0x1')]},'channelstate':{'type':Sequelize[_0xd4c4('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd4c4('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd4c4('0x1')]},'connectedlinename':{'type':Sequelize[_0xd4c4('0x1')]},'language':{'type':Sequelize[_0xd4c4('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd4c4('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd4c4('0x1')]},'destchannel':{'type':Sequelize[_0xd4c4('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd4c4('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd4c4('0x1')]},'destaccountcode':{'type':Sequelize[_0xd4c4('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd4c4('0x1')]},'destpriority':{'type':Sequelize[_0xd4c4('0x1')]},'destuniqueid':{'type':Sequelize[_0xd4c4('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd4c4('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd4c4('0x1')]},'transfer':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd4c4('0x1')],'comment':_0xd4c4('0x5')},'transferexten':{'type':Sequelize[_0xd4c4('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 32ab39e..8646409 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_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(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 4432380..144b1ca 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 _0xa63f=['request-promise','path','rimraf','../../config/environment','define','VoiceAgentReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa63f,0x1b6));var _0xfa63=function(_0x4730bd,_0x1e9541){_0x4730bd=_0x4730bd-0x0;var _0x1b2849=_0xa63f[_0x4730bd];return _0x1b2849;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var logger=require(_0xfa63('0x2'))(_0xfa63('0x3'));var moment=require(_0xfa63('0x4'));var BPromise=require(_0xfa63('0x5'));var rp=require(_0xfa63('0x6'));var fs=require('fs');var path=require(_0xfa63('0x7'));var rimraf=require(_0xfa63('0x8'));var config=require(_0xfa63('0x9'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x20d4f6,_0x41efce){return _0x20d4f6[_0xfa63('0xa')](_0xfa63('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a59=['uniqueid','destuniqueid','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a59,0x16e));var _0x97a5=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x7a59[_0x12a554];return _0x244ba0;};'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':[{'fields':[_0x97a5('0xc'),_0x97a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 9d79819..f73c718 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 _0x87c9=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','then','debug','UpdateVoiceAgentReport','options','attributes','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x29cf89,_0x10ce1f){var _0x34ac61=function(_0x5b29c2){while(--_0x5b29c2){_0x29cf89['push'](_0x29cf89['shift']());}};_0x34ac61(++_0x10ce1f);}(_0x87c9,0x1c3));var _0x987c=function(_0x1be12c,_0x70621e){_0x1be12c=_0x1be12c-0x0;var _0x35d69a=_0x87c9[_0x1be12c];return _0x35d69a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x987c('0x0'));var BPromise=require(_0x987c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x987c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x987c('0x3'))(_0x987c('0x4'));var config=require(_0x987c('0x5'));var jayson=require(_0x987c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb72391,_0x517069,_0x50fb3b){return new BPromise(function(_0x2d5761,_0x1a772d){return client[_0x987c('0x7')](_0xb72391,_0x50fb3b)['then'](function(_0x5e6d23){logger[_0x987c('0x8')](_0x987c('0x9'),_0x517069,_0x987c('0xa'));logger['debug'](_0x987c('0xb'),_0x517069,_0x987c('0xa'),JSON[_0x987c('0xc')](_0x5e6d23));if(_0x5e6d23[_0x987c('0xd')]){if(_0x5e6d23[_0x987c('0xd')][_0x987c('0xe')]===0x1f4){logger['error'](_0x987c('0x9'),_0x517069,_0x5e6d23[_0x987c('0xd')][_0x987c('0xf')]);return _0x1a772d(_0x5e6d23[_0x987c('0xd')][_0x987c('0xf')]);}logger[_0x987c('0xd')](_0x987c('0x9'),_0x517069,_0x5e6d23[_0x987c('0xd')]['message']);return _0x2d5761(_0x5e6d23['error'][_0x987c('0xf')]);}else{logger['info'](_0x987c('0x9'),_0x517069,_0x987c('0xa'));_0x2d5761(_0x5e6d23['result'][_0x987c('0xf')]);}})[_0x987c('0x10')](function(_0x2eed58){logger[_0x987c('0xd')](_0x987c('0x9'),_0x517069,_0x2eed58);_0x1a772d(_0x2eed58);});});}exports[_0x987c('0x11')]=function(_0x3b7566){var _0x21e364=this;return new Promise(function(_0x54f0bd,_0x4def26){return db[_0x987c('0x12')][_0x987c('0x13')](_0x3b7566[_0x987c('0x14')],{'raw':_0x3b7566['options']?_0x3b7566['options'][_0x987c('0x15')]===undefined?!![]:![]:!![]})[_0x987c('0x16')](function(_0x17f496){logger[_0x987c('0x8')](_0x987c('0x11'),_0x3b7566);logger[_0x987c('0x17')](_0x987c('0x11'),_0x3b7566,JSON[_0x987c('0xc')](_0x17f496));_0x54f0bd(_0x17f496);})['catch'](function(_0x22efe8){logger[_0x987c('0xd')](_0x987c('0x11'),_0x22efe8['message'],_0x3b7566);_0x4def26(_0x21e364[_0x987c('0xd')](0x1f4,_0x22efe8['message']));});});};exports[_0x987c('0x18')]=function(_0x5dc287){var _0x3d8dfe=this;return new Promise(function(_0x445c29,_0xd24c5){return db[_0x987c('0x12')]['update'](_0x5dc287[_0x987c('0x14')],{'raw':_0x5dc287[_0x987c('0x19')]?_0x5dc287['options'][_0x987c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dc287[_0x987c('0x19')]?_0x5dc287['options']['where']||null:null,'attributes':_0x5dc287[_0x987c('0x19')]?_0x5dc287[_0x987c('0x19')][_0x987c('0x1a')]||null:null,'limit':_0x5dc287[_0x987c('0x19')]?_0x5dc287[_0x987c('0x19')]['limit']||null:null})[_0x987c('0x16')](function(_0x35b8ce){logger[_0x987c('0x8')](_0x987c('0x18'),_0x5dc287);logger['debug']('UpdateVoiceAgentReport',_0x5dc287,JSON[_0x987c('0xc')](_0x35b8ce));_0x445c29(_0x35b8ce);})[_0x987c('0x10')](function(_0x4f9438){logger['error'](_0x987c('0x18'),_0x4f9438[_0x987c('0xf')],_0x5dc287);_0xd24c5(_0x3d8dfe[_0x987c('0xd')](0x1f4,_0x4f9438[_0x987c('0xf')]));});});}; \ No newline at end of file +var _0x2372=['stringify','where','limit','info','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw'];(function(_0x40f7dc,_0x3d0c06){var _0x261115=function(_0x2dc3e5){while(--_0x2dc3e5){_0x40f7dc['push'](_0x40f7dc['shift']());}};_0x261115(++_0x3d0c06);}(_0x2372,0x8d));var _0x2237=function(_0x25f531,_0x1209ae){_0x25f531=_0x25f531-0x0;var _0x6ac282=_0x2372[_0x25f531];return _0x6ac282;};'use strict';var _=require(_0x2237('0x0'));var util=require(_0x2237('0x1'));var moment=require(_0x2237('0x2'));var BPromise=require(_0x2237('0x3'));var rs=require(_0x2237('0x4'));var fs=require('fs');var Redis=require(_0x2237('0x5'));var db=require(_0x2237('0x6'))['db'];var utils=require(_0x2237('0x7'));var logger=require(_0x2237('0x8'))(_0x2237('0x9'));var config=require('../../config/environment');var jayson=require(_0x2237('0xa'));var client=jayson[_0x2237('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf88484,_0x176c4c,_0x2f8ec1){return new BPromise(function(_0x6ef8d1,_0x4d3658){return client[_0x2237('0xc')](_0xf88484,_0x2f8ec1)[_0x2237('0xd')](function(_0x25557a){logger['info'](_0x2237('0xe'),_0x176c4c,_0x2237('0xf'));logger[_0x2237('0x10')](_0x2237('0x11'),_0x176c4c,_0x2237('0xf'),JSON['stringify'](_0x25557a));if(_0x25557a[_0x2237('0x12')]){if(_0x25557a[_0x2237('0x12')][_0x2237('0x13')]===0x1f4){logger[_0x2237('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x176c4c,_0x25557a[_0x2237('0x12')]['message']);return _0x4d3658(_0x25557a[_0x2237('0x12')][_0x2237('0x14')]);}logger[_0x2237('0x12')](_0x2237('0xe'),_0x176c4c,_0x25557a[_0x2237('0x12')][_0x2237('0x14')]);return _0x6ef8d1(_0x25557a[_0x2237('0x12')][_0x2237('0x14')]);}else{logger['info'](_0x2237('0xe'),_0x176c4c,'request\x20sent');_0x6ef8d1(_0x25557a[_0x2237('0x15')][_0x2237('0x14')]);}})[_0x2237('0x16')](function(_0x2579b9){logger[_0x2237('0x12')](_0x2237('0xe'),_0x176c4c,_0x2579b9);_0x4d3658(_0x2579b9);});});}exports[_0x2237('0x17')]=function(_0x4c7f55){var _0x1a5fd3=this;return new Promise(function(_0x22270f,_0x4c501d){return db[_0x2237('0x18')][_0x2237('0x19')](_0x4c7f55[_0x2237('0x1a')],{'raw':_0x4c7f55[_0x2237('0x1b')]?_0x4c7f55['options'][_0x2237('0x1c')]===undefined?!![]:![]:!![]})[_0x2237('0xd')](function(_0x34f1eb){logger['info'](_0x2237('0x17'),_0x4c7f55);logger[_0x2237('0x10')]('CreateVoiceAgentReport',_0x4c7f55,JSON[_0x2237('0x1d')](_0x34f1eb));_0x22270f(_0x34f1eb);})[_0x2237('0x16')](function(_0x2bda3c){logger[_0x2237('0x12')](_0x2237('0x17'),_0x2bda3c[_0x2237('0x14')],_0x4c7f55);_0x4c501d(_0x1a5fd3[_0x2237('0x12')](0x1f4,_0x2bda3c[_0x2237('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x422701){var _0x451c72=this;return new Promise(function(_0x5ae543,_0x440b6f){return db['VoiceAgentReport']['update'](_0x422701[_0x2237('0x1a')],{'raw':_0x422701['options']?_0x422701[_0x2237('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422701[_0x2237('0x1b')]?_0x422701[_0x2237('0x1b')][_0x2237('0x1e')]||null:null,'attributes':_0x422701[_0x2237('0x1b')]?_0x422701[_0x2237('0x1b')]['attributes']||null:null,'limit':_0x422701[_0x2237('0x1b')]?_0x422701['options'][_0x2237('0x1f')]||null:null})[_0x2237('0xd')](function(_0x970790){logger[_0x2237('0x20')]('UpdateVoiceAgentReport',_0x422701);logger[_0x2237('0x10')](_0x2237('0x21'),_0x422701,JSON['stringify'](_0x970790));_0x5ae543(_0x970790);})['catch'](function(_0x187863){logger[_0x2237('0x12')](_0x2237('0x21'),_0x187863[_0x2237('0x14')],_0x422701);_0x440b6f(_0x451c72[_0x2237('0x12')](0x1f4,_0x187863[_0x2237('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e849d44..dfd0fae 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 _0x44e8=['show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x478754,_0x1ceb87){var _0x30b765=function(_0x312383){while(--_0x312383){_0x478754['push'](_0x478754['shift']());}};_0x30b765(++_0x1ceb87);}(_0x44e8,0xd7));var _0x844e=function(_0x3ff380,_0x281f64){_0x3ff380=_0x3ff380-0x0;var _0x2f4d89=_0x44e8[_0x3ff380];return _0x2f4d89;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0xf')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);router[_0x844e('0x11')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller['destroy']);module[_0x844e('0x12')]=router; \ No newline at end of file +var _0x5ad3=['isAuthenticated','index','describe','create','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x2c9ea1,_0xc2a289){var _0xf171eb=function(_0x4d7739){while(--_0x4d7739){_0x2c9ea1['push'](_0x2c9ea1['shift']());}};_0xf171eb(++_0xc2a289);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0x5ad3[_0x3d11be];return _0x4b657b;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/describe',auth[_0x35ad('0xb')](),controller[_0x35ad('0xd')]);router[_0x35ad('0xa')]('/:id',auth[_0x35ad('0xb')](),controller['show']);router['post']('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xe')]);router['put'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['update']);router['delete'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['destroy']);module[_0x35ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 6cc5f5c..a67aa98 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 _0x34b7=['inbound','internal','outbound','inbound-fax','DATE','INTEGER','STRING','ENUM'];(function(_0x5c8f85,_0x7957cc){var _0x319d90=function(_0x173e1f){while(--_0x173e1f){_0x5c8f85['push'](_0x5c8f85['shift']());}};_0x319d90(++_0x7957cc);}(_0x34b7,0x196));var _0x734b=function(_0x5d1dad,_0x2cbdd4){_0x5d1dad=_0x5d1dad-0x0;var _0x334f8d=_0x34b7[_0x5d1dad];return _0x334f8d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x734b('0x0')]},'type':{'type':Sequelize[_0x734b('0x1')](_0x734b('0x2'),_0x734b('0x3'),_0x734b('0x4'),_0x734b('0x5'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x734b('0x0')]},'accountcode':{'type':Sequelize[_0x734b('0x0')]},'source':{'type':Sequelize[_0x734b('0x0')]},'destination':{'type':Sequelize[_0x734b('0x0')]},'destinationcontext':{'type':Sequelize[_0x734b('0x0')]},'callerid':{'type':Sequelize[_0x734b('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x734b('0x0')]},'lastapplication':{'type':Sequelize[_0x734b('0x0')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x734b('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x734b('0x7')]},'billableseconds':{'type':Sequelize[_0x734b('0x7')]},'mohtime':{'type':Sequelize[_0x734b('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x734b('0x0')]},'amaflags':{'type':Sequelize[_0x734b('0x0')]},'userfield':{'type':Sequelize[_0x734b('0x0')]},'userDisposition':{'type':Sequelize[_0x734b('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x734b('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x734b('0x0')]},'note':{'type':Sequelize[_0x734b('0x0')]},'prefix':{'type':Sequelize[_0x734b('0x0')]},'routeid':{'type':Sequelize[_0x734b('0x7')]},'sipcallid':{'type':Sequelize[_0x734b('0x0')]}}; \ No newline at end of file +var _0x9a67=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9a67,0x117));var _0x79a6=function(_0x5d7463,_0x3dbc4a){_0x5d7463=_0x5d7463-0x0;var _0x316d29=_0x9a67[_0x5d7463];return _0x316d29;};'use strict';var Sequelize=require(_0x79a6('0x0'));module[_0x79a6('0x1')]={'uniqueid':{'type':Sequelize[_0x79a6('0x2')]},'type':{'type':Sequelize[_0x79a6('0x3')](_0x79a6('0x4'),_0x79a6('0x5'),'outbound',_0x79a6('0x6'),'outbound-fax',_0x79a6('0x7'))},'tag':{'type':Sequelize[_0x79a6('0x2')]},'accountcode':{'type':Sequelize[_0x79a6('0x2')]},'source':{'type':Sequelize[_0x79a6('0x2')]},'destination':{'type':Sequelize[_0x79a6('0x2')]},'destinationcontext':{'type':Sequelize[_0x79a6('0x2')]},'callerid':{'type':Sequelize[_0x79a6('0x2')]},'channel':{'type':Sequelize[_0x79a6('0x2')]},'destinationchannel':{'type':Sequelize[_0x79a6('0x2')]},'lastapplication':{'type':Sequelize[_0x79a6('0x2')]},'lastdata':{'type':Sequelize[_0x79a6('0x8')]},'starttime':{'type':Sequelize[_0x79a6('0x9')]},'systemanswertime':{'type':Sequelize[_0x79a6('0x9')]},'answertime':{'type':Sequelize[_0x79a6('0x9')]},'endtime':{'type':Sequelize[_0x79a6('0x9')]},'duration':{'type':Sequelize[_0x79a6('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x79a6('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x79a6('0x2')]},'userfield':{'type':Sequelize[_0x79a6('0x2')]},'userDisposition':{'type':Sequelize[_0x79a6('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x79a6('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x79a6('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x79a6('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x79a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1522d9a..d83ae82 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 _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(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cbd54,_0x55d78b){_0x3cbd54=_0x3cbd54-0x0;var _0x39fb39=_0x5f2f[_0x3cbd54];return _0x39fb39;};'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 +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d4385aa..e041293 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 _0x8daa=['path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','moment','request-promise'];(function(_0x36b4ca,_0xb11792){var _0x209478=function(_0x854bd4){while(--_0x854bd4){_0x36b4ca['push'](_0x36b4ca['shift']());}};_0x209478(++_0xb11792);}(_0x8daa,0x188));var _0xa8da=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x8daa[_0x562362];return _0x3a18ce;};'use strict';var _=require(_0xa8da('0x0'));var util=require('util');var logger=require(_0xa8da('0x1'))('api');var moment=require(_0xa8da('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8da('0x3'));var fs=require('fs');var path=require(_0xa8da('0x4'));var rimraf=require(_0xa8da('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8da('0x6'));module[_0xa8da('0x7')]=function(_0x440d1c,_0x3b3abc){return _0x440d1c[_0xa8da('0x8')](_0xa8da('0x9'),attributes,{'tableName':_0xa8da('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa8da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc5e=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x24b1a2,_0x70069d){var _0x4c9f5a=function(_0x5ee915){while(--_0x5ee915){_0x24b1a2['push'](_0x24b1a2['shift']());}};_0x4c9f5a(++_0x70069d);}(_0xbc5e,0xda));var _0xebc5=function(_0x11af12,_0x284964){_0x11af12=_0x11af12-0x0;var _0x44788d=_0xbc5e[_0x11af12];return _0x44788d;};'use strict';var _=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var logger=require(_0xebc5('0x2'))(_0xebc5('0x3'));var moment=require(_0xebc5('0x4'));var BPromise=require(_0xebc5('0x5'));var rp=require(_0xebc5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebc5('0x7'));var config=require(_0xebc5('0x8'));var attributes=require(_0xebc5('0x9'));module['exports']=function(_0x1d4bf2,_0x34a53a){return _0x1d4bf2['define'](_0xebc5('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xebc5('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 b6486c5..1c51100 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 _0x5830=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceCallReport','stringify','CreateVoiceCallReport','body','debug','UpdateVoiceCallReport','update','lodash'];(function(_0x2d7419,_0x4e03c6){var _0x189dbc=function(_0x18de34){while(--_0x18de34){_0x2d7419['push'](_0x2d7419['shift']());}};_0x189dbc(++_0x4e03c6);}(_0x5830,0xf4));var _0x0583=function(_0x37de1c,_0x2e0138){_0x37de1c=_0x37de1c-0x0;var _0x41d26c=_0x5830[_0x37de1c];return _0x41d26c;};'use strict';var _=require(_0x0583('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0583('0x1'));var rs=require(_0x0583('0x2'));var fs=require('fs');var Redis=require(_0x0583('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0583('0x4'));var logger=require(_0x0583('0x5'))(_0x0583('0x6'));var config=require(_0x0583('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0583('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dac0d,_0x26b20a,_0x18c457){return new BPromise(function(_0x44225d,_0x4aee70){return client['request'](_0x4dac0d,_0x18c457)['then'](function(_0x43b764){logger[_0x0583('0x9')](_0x0583('0xa'),_0x26b20a,_0x0583('0xb'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x26b20a,_0x0583('0xb'),JSON['stringify'](_0x43b764));if(_0x43b764[_0x0583('0xc')]){if(_0x43b764['error'][_0x0583('0xd')]===0x1f4){logger['error'](_0x0583('0xa'),_0x26b20a,_0x43b764['error']['message']);return _0x4aee70(_0x43b764[_0x0583('0xc')][_0x0583('0xe')]);}logger[_0x0583('0xc')](_0x0583('0xa'),_0x26b20a,_0x43b764[_0x0583('0xc')][_0x0583('0xe')]);return _0x44225d(_0x43b764[_0x0583('0xc')]['message']);}else{logger[_0x0583('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x26b20a,'request\x20sent');_0x44225d(_0x43b764[_0x0583('0xf')][_0x0583('0xe')]);}})[_0x0583('0x10')](function(_0x5ce017){logger[_0x0583('0xc')](_0x0583('0xa'),_0x26b20a,_0x5ce017);_0x4aee70(_0x5ce017);});});}exports['GetVoiceCallReport']=function(_0x158b8b){var _0x4f2382=this;return new Promise(function(_0x583276,_0x306deb){return db[_0x0583('0x11')][_0x0583('0x12')]({'raw':_0x158b8b[_0x0583('0x13')]?_0x158b8b['options'][_0x0583('0x14')]===undefined?!![]:![]:!![],'where':_0x158b8b[_0x0583('0x13')]?_0x158b8b[_0x0583('0x13')][_0x0583('0x15')]||null:null,'attributes':_0x158b8b[_0x0583('0x13')]?_0x158b8b[_0x0583('0x13')][_0x0583('0x16')]||null:null,'limit':_0x158b8b['options']?_0x158b8b[_0x0583('0x13')][_0x0583('0x17')]||null:null,'include':_0x158b8b[_0x0583('0x13')]?_0x158b8b['options'][_0x0583('0x18')]?_[_0x0583('0x19')](_0x158b8b[_0x0583('0x13')][_0x0583('0x18')],function(_0x1eca77){return{'model':db[_0x1eca77['model']],'as':_0x1eca77['as'],'attributes':_0x1eca77[_0x0583('0x16')],'include':_0x1eca77[_0x0583('0x18')]?_[_0x0583('0x19')](_0x1eca77['include'],function(_0x3686ef){return{'model':db[_0x3686ef[_0x0583('0x1a')]],'as':_0x3686ef['as'],'attributes':_0x3686ef[_0x0583('0x16')],'include':_0x3686ef[_0x0583('0x18')]?_[_0x0583('0x19')](_0x3686ef[_0x0583('0x18')],function(_0x1a0741){return{'model':db[_0x1a0741['model']],'as':_0x1a0741['as'],'attributes':_0x1a0741[_0x0583('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0583('0x1b')](function(_0x55e71c){logger['info'](_0x0583('0x1c'),_0x158b8b);logger['debug'](_0x0583('0x1c'),_0x158b8b,JSON[_0x0583('0x1d')](_0x55e71c));_0x583276(_0x55e71c);})[_0x0583('0x10')](function(_0x46b611){logger[_0x0583('0xc')](_0x0583('0x1c'),_0x46b611[_0x0583('0xe')],_0x158b8b);_0x306deb(_0x4f2382['error'](0x1f4,_0x46b611['message']));});});};exports[_0x0583('0x1e')]=function(_0x13b720){var _0x5c2f1d=this;return new Promise(function(_0x4ca96b,_0x5d1138){return db['VoiceCallReport']['create'](_0x13b720[_0x0583('0x1f')],{'raw':_0x13b720[_0x0583('0x13')]?_0x13b720['options']['raw']===undefined?!![]:![]:!![]})[_0x0583('0x1b')](function(_0x3f54f6){logger[_0x0583('0x9')]('CreateVoiceCallReport',_0x13b720);logger[_0x0583('0x20')]('CreateVoiceCallReport',_0x13b720,JSON[_0x0583('0x1d')](_0x3f54f6));_0x4ca96b(_0x3f54f6);})[_0x0583('0x10')](function(_0x4a82b1){logger['error'](_0x0583('0x1e'),_0x4a82b1[_0x0583('0xe')],_0x13b720);_0x5d1138(_0x5c2f1d['error'](0x1f4,_0x4a82b1[_0x0583('0xe')]));});});};exports[_0x0583('0x21')]=function(_0x40bff4){var _0x4a9e0a=this;return new Promise(function(_0x33adae,_0x1a8961){return db[_0x0583('0x11')][_0x0583('0x22')](_0x40bff4[_0x0583('0x1f')],{'raw':_0x40bff4[_0x0583('0x13')]?_0x40bff4[_0x0583('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40bff4[_0x0583('0x13')]?_0x40bff4['options']['where']||null:null,'attributes':_0x40bff4[_0x0583('0x13')]?_0x40bff4[_0x0583('0x13')][_0x0583('0x16')]||null:null,'limit':_0x40bff4[_0x0583('0x13')]?_0x40bff4[_0x0583('0x13')][_0x0583('0x17')]||null:null})[_0x0583('0x1b')](function(_0x2bbab6){logger['info'](_0x0583('0x21'),_0x40bff4);logger[_0x0583('0x20')](_0x0583('0x21'),_0x40bff4,JSON[_0x0583('0x1d')](_0x2bbab6));_0x33adae(_0x2bbab6);})[_0x0583('0x10')](function(_0x4e95a8){logger[_0x0583('0xc')]('UpdateVoiceCallReport',_0x4e95a8[_0x0583('0xe')],_0x40bff4);_0x1a8961(_0x4a9e0a[_0x0583('0xc')](0x1f4,_0x4e95a8[_0x0583('0xe')]));});});}; \ No newline at end of file +var _0xf806=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','include','map','model','then','debug','stringify','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4d7988,_0x4c62e3){var _0x97e287=function(_0x223966){while(--_0x223966){_0x4d7988['push'](_0x4d7988['shift']());}};_0x97e287(++_0x4c62e3);}(_0xf806,0xdf));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6f80('0x0'));var moment=require(_0x6f80('0x1'));var BPromise=require(_0x6f80('0x2'));var rs=require(_0x6f80('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f80('0x4'))['db'];var utils=require(_0x6f80('0x5'));var logger=require(_0x6f80('0x6'))('rpc');var config=require(_0x6f80('0x7'));var jayson=require(_0x6f80('0x8'));var client=jayson[_0x6f80('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42a1aa,_0x1d576c,_0x2e74fc){return new BPromise(function(_0x302293,_0x302a5c){return client[_0x6f80('0xa')](_0x42a1aa,_0x2e74fc)['then'](function(_0x57b2f2){logger['info'](_0x6f80('0xb'),_0x1d576c,'request\x20sent');logger['debug'](_0x6f80('0xc'),_0x1d576c,_0x6f80('0xd'),JSON['stringify'](_0x57b2f2));if(_0x57b2f2[_0x6f80('0xe')]){if(_0x57b2f2[_0x6f80('0xe')][_0x6f80('0xf')]===0x1f4){logger[_0x6f80('0xe')](_0x6f80('0xb'),_0x1d576c,_0x57b2f2[_0x6f80('0xe')][_0x6f80('0x10')]);return _0x302a5c(_0x57b2f2['error'][_0x6f80('0x10')]);}logger[_0x6f80('0xe')](_0x6f80('0xb'),_0x1d576c,_0x57b2f2[_0x6f80('0xe')]['message']);return _0x302293(_0x57b2f2[_0x6f80('0xe')][_0x6f80('0x10')]);}else{logger[_0x6f80('0x11')](_0x6f80('0xb'),_0x1d576c,_0x6f80('0xd'));_0x302293(_0x57b2f2[_0x6f80('0x12')]['message']);}})['catch'](function(_0x3936cc){logger['error'](_0x6f80('0xb'),_0x1d576c,_0x3936cc);_0x302a5c(_0x3936cc);});});}exports[_0x6f80('0x13')]=function(_0x4b715b){var _0x453d40=this;return new Promise(function(_0xc62735,_0x14454d){return db[_0x6f80('0x14')]['findAll']({'raw':_0x4b715b[_0x6f80('0x15')]?_0x4b715b['options'][_0x6f80('0x16')]===undefined?!![]:![]:!![],'where':_0x4b715b['options']?_0x4b715b['options'][_0x6f80('0x17')]||null:null,'attributes':_0x4b715b[_0x6f80('0x15')]?_0x4b715b['options'][_0x6f80('0x18')]||null:null,'limit':_0x4b715b[_0x6f80('0x15')]?_0x4b715b[_0x6f80('0x15')]['limit']||null:null,'include':_0x4b715b['options']?_0x4b715b[_0x6f80('0x15')][_0x6f80('0x19')]?_[_0x6f80('0x1a')](_0x4b715b[_0x6f80('0x15')][_0x6f80('0x19')],function(_0x2940b4){return{'model':db[_0x2940b4[_0x6f80('0x1b')]],'as':_0x2940b4['as'],'attributes':_0x2940b4[_0x6f80('0x18')],'include':_0x2940b4[_0x6f80('0x19')]?_[_0x6f80('0x1a')](_0x2940b4[_0x6f80('0x19')],function(_0x964444){return{'model':db[_0x964444['model']],'as':_0x964444['as'],'attributes':_0x964444[_0x6f80('0x18')],'include':_0x964444[_0x6f80('0x19')]?_[_0x6f80('0x1a')](_0x964444[_0x6f80('0x19')],function(_0x5daff4){return{'model':db[_0x5daff4['model']],'as':_0x5daff4['as'],'attributes':_0x5daff4['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f80('0x1c')](function(_0x4f9e31){logger[_0x6f80('0x11')](_0x6f80('0x13'),_0x4b715b);logger[_0x6f80('0x1d')](_0x6f80('0x13'),_0x4b715b,JSON[_0x6f80('0x1e')](_0x4f9e31));_0xc62735(_0x4f9e31);})[_0x6f80('0x1f')](function(_0x53436f){logger[_0x6f80('0xe')](_0x6f80('0x13'),_0x53436f['message'],_0x4b715b);_0x14454d(_0x453d40[_0x6f80('0xe')](0x1f4,_0x53436f[_0x6f80('0x10')]));});});};exports[_0x6f80('0x20')]=function(_0x25660f){var _0x21fdf5=this;return new Promise(function(_0x35b7b6,_0x21cac4){return db[_0x6f80('0x14')][_0x6f80('0x21')](_0x25660f[_0x6f80('0x22')],{'raw':_0x25660f[_0x6f80('0x15')]?_0x25660f[_0x6f80('0x15')][_0x6f80('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24f619){logger['info']('CreateVoiceCallReport',_0x25660f);logger['debug'](_0x6f80('0x20'),_0x25660f,JSON[_0x6f80('0x1e')](_0x24f619));_0x35b7b6(_0x24f619);})[_0x6f80('0x1f')](function(_0x1d1a93){logger['error'](_0x6f80('0x20'),_0x1d1a93[_0x6f80('0x10')],_0x25660f);_0x21cac4(_0x21fdf5[_0x6f80('0xe')](0x1f4,_0x1d1a93[_0x6f80('0x10')]));});});};exports[_0x6f80('0x23')]=function(_0x4ff873){var _0x48152e=this;return new Promise(function(_0x46bde3,_0x28ee1a){return db[_0x6f80('0x14')][_0x6f80('0x24')](_0x4ff873['body'],{'raw':_0x4ff873[_0x6f80('0x15')]?_0x4ff873[_0x6f80('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff873[_0x6f80('0x15')]?_0x4ff873[_0x6f80('0x15')][_0x6f80('0x17')]||null:null,'attributes':_0x4ff873['options']?_0x4ff873[_0x6f80('0x15')]['attributes']||null:null,'limit':_0x4ff873[_0x6f80('0x15')]?_0x4ff873[_0x6f80('0x15')][_0x6f80('0x25')]||null:null})[_0x6f80('0x1c')](function(_0x162830){logger[_0x6f80('0x11')]('UpdateVoiceCallReport',_0x4ff873);logger['debug'](_0x6f80('0x23'),_0x4ff873,JSON[_0x6f80('0x1e')](_0x162830));_0x46bde3(_0x162830);})['catch'](function(_0x52136c){logger['error'](_0x6f80('0x23'),_0x52136c[_0x6f80('0x10')],_0x4ff873);_0x28ee1a(_0x48152e[_0x6f80('0xe')](0x1f4,_0x52136c[_0x6f80('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9bc8dbd..071c84d 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 _0xe143=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy','exports','multer','util','path'];(function(_0x38b431,_0x26b793){var _0x205832=function(_0x2ecd86){while(--_0x2ecd86){_0x38b431['push'](_0x38b431['shift']());}};_0x205832(++_0x26b793);}(_0xe143,0x89));var _0x3e14=function(_0x19cae9,_0xd6039b){_0x19cae9=_0x19cae9-0x0;var _0x163452=_0xe143[_0x19cae9];return _0x163452;};'use strict';var multer=require(_0x3e14('0x0'));var util=require(_0x3e14('0x1'));var path=require(_0x3e14('0x2'));var timeout=require(_0x3e14('0x3'));var express=require(_0x3e14('0x4'));var router=express[_0x3e14('0x5')]();var fs_extra=require(_0x3e14('0x6'));var auth=require(_0x3e14('0x7'));var interaction=require(_0x3e14('0x8'));var config=require(_0x3e14('0x9'));var controller=require(_0x3e14('0xa'));router[_0x3e14('0xb')]('/',auth[_0x3e14('0xc')](),controller[_0x3e14('0xd')]);router[_0x3e14('0xb')]('/:id',auth[_0x3e14('0xc')](),controller[_0x3e14('0xe')]);router[_0x3e14('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3e14('0x10'),auth[_0x3e14('0xc')](),controller['update']);router[_0x3e14('0x11')](_0x3e14('0x10'),auth['isAuthenticated'](),controller[_0x3e14('0x12')]);module[_0x3e14('0x13')]=router; \ No newline at end of file +var _0xcefd=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4428b3,_0x294e86){var _0x393e2b=function(_0x3ed3a8){while(--_0x3ed3a8){_0x4428b3['push'](_0x4428b3['shift']());}};_0x393e2b(++_0x294e86);}(_0xcefd,0x1bd));var _0xdcef=function(_0x56a987,_0x2c1ee5){_0x56a987=_0x56a987-0x0;var _0xf30558=_0xcefd[_0x56a987];return _0xf30558;};'use strict';var multer=require('multer');var util=require(_0xdcef('0x0'));var path=require(_0xdcef('0x1'));var timeout=require(_0xdcef('0x2'));var express=require(_0xdcef('0x3'));var router=express[_0xdcef('0x4')]();var fs_extra=require(_0xdcef('0x5'));var auth=require(_0xdcef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdcef('0x7'));var controller=require(_0xdcef('0x8'));router[_0xdcef('0x9')]('/',auth[_0xdcef('0xa')](),controller[_0xdcef('0xb')]);router['get'](_0xdcef('0xc'),auth[_0xdcef('0xa')](),controller[_0xdcef('0xd')]);router[_0xdcef('0xe')]('/',auth['isAuthenticated'](),controller[_0xdcef('0xf')]);router[_0xdcef('0x10')](_0xdcef('0xc'),auth['isAuthenticated'](),controller[_0xdcef('0x11')]);router['delete'](_0xdcef('0xc'),auth[_0xdcef('0xa')](),controller[_0xdcef('0x12')]);module[_0xdcef('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 067c3b9..1a67043 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 _0x0601=['sequelize','STRING','name','options','join','split','BOOLEAN'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0601,0x7e));var _0x1060=function(_0x5bde78,_0xef666d){_0x5bde78=_0x5bde78-0x0;var _0x587f12=_0x0601[_0x5bde78];return _0x587f12;};'use strict';var Sequelize=require(_0x1060('0x0'));module['exports']={'name':{'type':Sequelize[_0x1060('0x1')]},'prefix':{'type':Sequelize[_0x1060('0x1')],'unique':_0x1060('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1060('0x1')],'set':function(_0x552ed7){this['setDataValue'](_0x1060('0x3'),_0x552ed7?_0x552ed7[_0x1060('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x1060('0x3'))?this['getDataValue'](_0x1060('0x3'))[_0x1060('0x5')](''):[];}},'auth':{'type':Sequelize[_0x1060('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x1060('0x1')]},'record':{'type':Sequelize[_0x1060('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1060('0x1')]}}; \ No newline at end of file +var _0x5436=['setDataValue','join','getDataValue','options','split','BOOLEAN','STRING'];(function(_0x26466d,_0x1aef59){var _0x3f7789=function(_0x2f17f5){while(--_0x2f17f5){_0x26466d['push'](_0x26466d['shift']());}};_0x3f7789(++_0x1aef59);}(_0x5436,0xd8));var _0x6543=function(_0x233669,_0x1a05b7){_0x233669=_0x233669-0x0;var _0x159d64=_0x5436[_0x233669];return _0x159d64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6543('0x0')]},'prefix':{'type':Sequelize[_0x6543('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x6543('0x0')],'set':function(_0x59e45e){this[_0x6543('0x1')]('options',_0x59e45e?_0x59e45e[_0x6543('0x2')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x6543('0x3')](_0x6543('0x4'))[_0x6543('0x5')](''):[];}},'auth':{'type':Sequelize[_0x6543('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x6543('0x0')]},'record':{'type':Sequelize[_0x6543('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6543('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d87a423..a4632f6 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 _0x342e=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','VoiceChanSpy','catch','show','params','include','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x342e,0xde));var _0xe342=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x342e[_0x2786ea];return _0x5c38e5;};'use strict';var emlformat=require(_0xe342('0x0'));var rimraf=require(_0xe342('0x1'));var zipdir=require(_0xe342('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe342('0x5'));var sox=require(_0xe342('0x6'));var csv=require(_0xe342('0x7'));var ejs=require(_0xe342('0x8'));var fs=require('fs');var fs_extra=require(_0xe342('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe342('0xa'));var jsforce=require(_0xe342('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe342('0xc'));var Papa=require(_0xe342('0xd'));var Redis=require(_0xe342('0xe'));var authService=require(_0xe342('0xf'));var qs=require(_0xe342('0x10'));var as=require(_0xe342('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe342('0x12'))(_0xe342('0x13'));var utils=require(_0xe342('0x14'));var config=require(_0xe342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe342('0x16'))['db'];function respondWithStatusCode(_0x50c16e,_0x2fff81){_0x2fff81=_0x2fff81||0xcc;return function(_0x419815){if(_0x419815){return _0x50c16e[_0xe342('0x17')](_0x2fff81);}return _0x50c16e[_0xe342('0x18')](_0x2fff81)['end']();};}function respondWithResult(_0x428c0b,_0x404989){_0x404989=_0x404989||0xc8;return function(_0x59434c){if(_0x59434c){return _0x428c0b[_0xe342('0x18')](_0x404989)[_0xe342('0x19')](_0x59434c);}};}function respondWithFilteredResult(_0xe384cd,_0x8a23f0){return function(_0xe8b832){if(_0xe8b832){var _0x219f51=typeof _0x8a23f0[_0xe342('0x1a')]===_0xe342('0x1b')&&typeof _0x8a23f0[_0xe342('0x1c')]===_0xe342('0x1b');var _0x144b24=_0xe8b832['count'];var _0xf70e61=_0x219f51?0x0:_0x8a23f0['offset'];var _0x5df492=_0x219f51?_0xe8b832[_0xe342('0x1d')]:_0x8a23f0[_0xe342('0x1a')]+_0x8a23f0[_0xe342('0x1c')];var _0x273865;if(_0x5df492>=_0x144b24){_0x5df492=_0x144b24;_0x273865=0xc8;}else{_0x273865=0xce;}_0xe384cd[_0xe342('0x18')](_0x273865);return _0xe384cd[_0xe342('0x1e')](_0xe342('0x1f'),_0xf70e61+'-'+_0x5df492+'/'+_0x144b24)[_0xe342('0x19')](_0xe8b832);}return null;};}function patchUpdates(_0x420036){return function(_0x5731e8){try{jsonpatch[_0xe342('0x20')](_0x5731e8,_0x420036,!![]);}catch(_0x45d096){return BPromise['reject'](_0x45d096);}return _0x5731e8[_0xe342('0x21')]();};}function saveUpdates(_0x56cd1e,_0x2fe50d){return function(_0x26d2a2){if(_0x26d2a2){return _0x26d2a2[_0xe342('0x22')](_0x56cd1e)[_0xe342('0x23')](function(_0x4e3950){return _0x4e3950;});}return null;};}function removeEntity(_0x2e70f5,_0x415aaf){return function(_0x212a7e){if(_0x212a7e){return _0x212a7e['destroy']()['then'](function(){var _0x16dff3=_0x212a7e[_0xe342('0x24')]({'plain':!![]});var _0x5e6e3f=_0xe342('0x25');return db[_0xe342('0x26')][_0xe342('0x27')]({'where':{'type':_0x5e6e3f,'resourceId':_0x16dff3['id']}})[_0xe342('0x23')](function(){return _0x212a7e;});})[_0xe342('0x23')](function(){_0x2e70f5[_0xe342('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e28a,_0x5a63f9){return function(_0x2625a7){if(!_0x2625a7){_0x36e28a[_0xe342('0x17')](0x194);}return _0x2625a7;};}function handleError(_0x59ddce,_0x509192){_0x509192=_0x509192||0x1f4;return function(_0x1c7c97){logger[_0xe342('0x28')](_0x1c7c97[_0xe342('0x29')]);if(_0x1c7c97[_0xe342('0x2a')]){delete _0x1c7c97[_0xe342('0x2a')];}_0x59ddce[_0xe342('0x18')](_0x509192)[_0xe342('0x2b')](_0x1c7c97);};}exports[_0xe342('0x2c')]=function(_0x1cb746,_0x334f7d){var _0x539d3d={},_0x368e45={},_0x2313be={'count':0x0,'rows':[]};var _0xc1b5d0=_['map'](db['VoiceChanSpy'][_0xe342('0x2d')],function(_0x4aa534){return{'name':_0x4aa534[_0xe342('0x2e')],'type':_0x4aa534[_0xe342('0x2f')][_0xe342('0x30')]};});_0x368e45[_0xe342('0x31')]=_[_0xe342('0x32')](_0xc1b5d0,_0xe342('0x2a'));_0x368e45[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1cb746[_0xe342('0x33')]);_0x368e45[_0xe342('0x35')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],_0x368e45['query']);_0x539d3d[_0xe342('0x37')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],qs['fields'](_0x1cb746['query'][_0xe342('0x38')]));_0x539d3d[_0xe342('0x37')]=_0x539d3d['attributes'][_0xe342('0x39')]?_0x539d3d[_0xe342('0x37')]:_0x368e45[_0xe342('0x31')];if(!_0x1cb746[_0xe342('0x33')][_0xe342('0x3a')](_0xe342('0x3b'))){_0x539d3d['limit']=qs[_0xe342('0x1c')](_0x1cb746[_0xe342('0x33')]['limit']);_0x539d3d[_0xe342('0x1a')]=qs['offset'](_0x1cb746[_0xe342('0x33')][_0xe342('0x1a')]);}_0x539d3d[_0xe342('0x3c')]=qs[_0xe342('0x3d')](_0x1cb746[_0xe342('0x33')][_0xe342('0x3d')]);_0x539d3d[_0xe342('0x3e')]=qs['filters'](_[_0xe342('0x3f')](_0x1cb746[_0xe342('0x33')],_0x368e45[_0xe342('0x35')]),_0xc1b5d0);if(_0x1cb746[_0xe342('0x33')][_0xe342('0x40')]){_0x539d3d['where']=_['merge'](_0x539d3d[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0xc1b5d0,function(_0x4331bd){if(_0x4331bd['type']!==_0xe342('0x41')){var _0x41efbb={};_0x41efbb[_0x4331bd['name']]={'$like':'%'+_0x1cb746['query'][_0xe342('0x40')]+'%'};return _0x41efbb;}})});}_0x539d3d=_[_0xe342('0x42')]({},_0x539d3d,_0x1cb746['options']);var _0x1c454f={'where':_0x539d3d[_0xe342('0x3e')]};return db['VoiceChanSpy'][_0xe342('0x1d')](_0x1c454f)[_0xe342('0x23')](function(_0x36f66e){_0x2313be[_0xe342('0x1d')]=_0x36f66e;if(_0x1cb746[_0xe342('0x33')]['includeAll']){_0x539d3d['include']=[{'all':!![]}];}return db[_0xe342('0x43')]['findAll'](_0x539d3d);})['then'](function(_0x174855){_0x2313be['rows']=_0x174855;return _0x2313be;})['then'](respondWithFilteredResult(_0x334f7d,_0x539d3d))[_0xe342('0x44')](handleError(_0x334f7d,null));};exports[_0xe342('0x45')]=function(_0x1f4373,_0x59c8d2){var _0x183b98={'raw':![],'where':{'id':_0x1f4373[_0xe342('0x46')]['id']}},_0x540f6c={};_0x540f6c['model']=_[_0xe342('0x34')](db['VoiceChanSpy'][_0xe342('0x2d')]);_0x540f6c[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1f4373[_0xe342('0x33')]);_0x540f6c[_0xe342('0x35')]=_[_0xe342('0x36')](_0x540f6c['model'],_0x540f6c[_0xe342('0x33')]);_0x183b98['attributes']=_['intersection'](_0x540f6c[_0xe342('0x31')],qs['fields'](_0x1f4373[_0xe342('0x33')][_0xe342('0x38')]));_0x183b98[_0xe342('0x37')]=_0x183b98[_0xe342('0x37')][_0xe342('0x39')]?_0x183b98['attributes']:_0x540f6c['model'];if(_0x1f4373[_0xe342('0x33')]['includeAll']){_0x183b98[_0xe342('0x47')]=[{'all':!![]}];}_0x183b98=_['merge']({},_0x183b98,_0x1f4373['options']);return db[_0xe342('0x43')][_0xe342('0x48')](_0x183b98)[_0xe342('0x23')](handleEntityNotFound(_0x59c8d2,null))[_0xe342('0x23')](respondWithResult(_0x59c8d2,null))['catch'](handleError(_0x59c8d2,null));};exports['create']=function(_0x48fc25,_0x535f50){return db[_0xe342('0x43')]['create'](_0x48fc25[_0xe342('0x49')],{})[_0xe342('0x23')](function(_0x962aa1){var _0x3ce025=_0x48fc25[_0xe342('0x4a')][_0xe342('0x24')]({'plain':!![]});if(!_0x3ce025)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ce025[_0xe342('0x4b')]==='user'){var _0x304dbf=_0x962aa1[_0xe342('0x24')]({'plain':!![]});var _0x216cc3=_0xe342('0x25');return db[_0xe342('0x4c')]['find']({'where':{'name':_0x216cc3,'userProfileId':_0x3ce025[_0xe342('0x4d')]},'raw':!![]})[_0xe342('0x23')](function(_0x34a3e2){if(_0x34a3e2&&_0x34a3e2[_0xe342('0x4e')]===0x0){return db[_0xe342('0x26')][_0xe342('0x4f')]({'name':_0x304dbf['name'],'resourceId':_0x304dbf['id'],'type':_0x34a3e2['name'],'sectionId':_0x34a3e2['id']},{})[_0xe342('0x23')](function(){return _0x962aa1;});}else{return _0x962aa1;}})[_0xe342('0x44')](function(_0x139855){logger[_0xe342('0x28')](_0xe342('0x50'),_0x139855);throw _0x139855;});}return _0x962aa1;})['then'](respondWithResult(_0x535f50,0xc9))[_0xe342('0x44')](handleError(_0x535f50,null));};exports[_0xe342('0x22')]=function(_0x35ae19,_0x505574){if(_0x35ae19[_0xe342('0x49')]['id']){delete _0x35ae19[_0xe342('0x49')]['id'];}return db[_0xe342('0x43')]['find']({'where':{'id':_0x35ae19[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x505574,null))['then'](saveUpdates(_0x35ae19[_0xe342('0x49')],null))['then'](respondWithResult(_0x505574,null))[_0xe342('0x44')](handleError(_0x505574,null));};exports['destroy']=function(_0xd00c46,_0x35c6bd){return db[_0xe342('0x43')][_0xe342('0x48')]({'where':{'id':_0xd00c46['params']['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x35c6bd,null))[_0xe342('0x23')](removeEntity(_0x35c6bd,null))['catch'](handleError(_0x35c6bd,null));}; \ No newline at end of file +var _0xad13=['update','then','get','ChanSpies','UserProfileResource','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','options','includeAll','include','rows','catch','show','params','find','create','user','role','autoAssociation','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x550f89,_0x1f9668){var _0x99c17c=function(_0x33d05c){while(--_0x33d05c){_0x550f89['push'](_0x550f89['shift']());}};_0x99c17c(++_0x1f9668);}(_0xad13,0x79));var _0x3ad1=function(_0x420b0e,_0xe0ec4){_0x420b0e=_0x420b0e-0x0;var _0x5e538a=_0xad13[_0x420b0e];return _0x5e538a;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){var _0x466d91=_0x2fd5e6[_0x3ad1('0x27')]({'plain':!![]});var _0x2ee2e8=_0x3ad1('0x28');return db[_0x3ad1('0x29')]['destroy']({'where':{'type':_0x2ee2e8,'resourceId':_0x466d91['id']}})['then'](function(){return _0x2fd5e6;});})[_0x3ad1('0x26')](function(){_0x2365f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x322a9a,_0x2408d5){return function(_0xf5d14c){if(!_0xf5d14c){_0x322a9a[_0x3ad1('0x19')](0x194);}return _0xf5d14c;};}function handleError(_0x5b200c,_0x5b7461){_0x5b7461=_0x5b7461||0x1f4;return function(_0xc56f8a){logger[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2b')]);if(_0xc56f8a[_0x3ad1('0x2c')]){delete _0xc56f8a['name'];}_0x5b200c['status'](_0x5b7461)[_0x3ad1('0x2d')](_0xc56f8a);};}exports['index']=function(_0x7def7b,_0x1d28d6){var _0x266d0d={},_0x255924={},_0x1f5887={'count':0x0,'rows':[]};var _0x7c001=_[_0x3ad1('0x2e')](db[_0x3ad1('0x2f')][_0x3ad1('0x30')],function(_0x567e85){return{'name':_0x567e85[_0x3ad1('0x31')],'type':_0x567e85['type'][_0x3ad1('0x32')]};});_0x255924[_0x3ad1('0x33')]=_[_0x3ad1('0x2e')](_0x7c001,_0x3ad1('0x2c'));_0x255924[_0x3ad1('0x34')]=_[_0x3ad1('0x35')](_0x7def7b[_0x3ad1('0x34')]);_0x255924['filters']=_[_0x3ad1('0x36')](_0x255924['model'],_0x255924['query']);_0x266d0d['attributes']=_[_0x3ad1('0x36')](_0x255924[_0x3ad1('0x33')],qs[_0x3ad1('0x37')](_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x37')]));_0x266d0d[_0x3ad1('0x38')]=_0x266d0d['attributes']['length']?_0x266d0d[_0x3ad1('0x38')]:_0x255924[_0x3ad1('0x33')];if(!_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x39')](_0x3ad1('0x3a'))){_0x266d0d['limit']=qs['limit'](_0x7def7b['query']['limit']);_0x266d0d[_0x3ad1('0x1d')]=qs['offset'](_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x1d')]);}_0x266d0d[_0x3ad1('0x3b')]=qs['sort'](_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x3c')]);_0x266d0d['where']=qs[_0x3ad1('0x3d')](_['pick'](_0x7def7b[_0x3ad1('0x34')],_0x255924[_0x3ad1('0x3d')]),_0x7c001);if(_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x3e')]){_0x266d0d['where']=_['merge'](_0x266d0d[_0x3ad1('0x3f')],{'$or':_[_0x3ad1('0x2e')](_0x7c001,function(_0xd38d0){if(_0xd38d0[_0x3ad1('0x40')]!=='VIRTUAL'){var _0x10f027={};_0x10f027[_0xd38d0[_0x3ad1('0x2c')]]={'$like':'%'+_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x3e')]+'%'};return _0x10f027;}})});}_0x266d0d=_['merge']({},_0x266d0d,_0x7def7b[_0x3ad1('0x41')]);var _0x4fd158={'where':_0x266d0d['where']};return db[_0x3ad1('0x2f')]['count'](_0x4fd158)['then'](function(_0x534b5d){_0x1f5887[_0x3ad1('0x20')]=_0x534b5d;if(_0x7def7b[_0x3ad1('0x34')][_0x3ad1('0x42')]){_0x266d0d[_0x3ad1('0x43')]=[{'all':!![]}];}return db[_0x3ad1('0x2f')]['findAll'](_0x266d0d);})['then'](function(_0xf267d0){_0x1f5887[_0x3ad1('0x44')]=_0xf267d0;return _0x1f5887;})['then'](respondWithFilteredResult(_0x1d28d6,_0x266d0d))[_0x3ad1('0x45')](handleError(_0x1d28d6,null));};exports[_0x3ad1('0x46')]=function(_0x48532c,_0x235189){var _0x347dee={'raw':![],'where':{'id':_0x48532c[_0x3ad1('0x47')]['id']}},_0x4cf9bb={};_0x4cf9bb['model']=_[_0x3ad1('0x35')](db[_0x3ad1('0x2f')][_0x3ad1('0x30')]);_0x4cf9bb[_0x3ad1('0x34')]=_[_0x3ad1('0x35')](_0x48532c[_0x3ad1('0x34')]);_0x4cf9bb[_0x3ad1('0x3d')]=_['intersection'](_0x4cf9bb['model'],_0x4cf9bb[_0x3ad1('0x34')]);_0x347dee[_0x3ad1('0x38')]=_[_0x3ad1('0x36')](_0x4cf9bb[_0x3ad1('0x33')],qs['fields'](_0x48532c['query'][_0x3ad1('0x37')]));_0x347dee['attributes']=_0x347dee[_0x3ad1('0x38')]['length']?_0x347dee[_0x3ad1('0x38')]:_0x4cf9bb['model'];if(_0x48532c[_0x3ad1('0x34')][_0x3ad1('0x42')]){_0x347dee[_0x3ad1('0x43')]=[{'all':!![]}];}_0x347dee=_['merge']({},_0x347dee,_0x48532c[_0x3ad1('0x41')]);return db[_0x3ad1('0x2f')][_0x3ad1('0x48')](_0x347dee)[_0x3ad1('0x26')](handleEntityNotFound(_0x235189,null))['then'](respondWithResult(_0x235189,null))[_0x3ad1('0x45')](handleError(_0x235189,null));};exports[_0x3ad1('0x49')]=function(_0x21bda3,_0x456e31){return db[_0x3ad1('0x2f')][_0x3ad1('0x49')](_0x21bda3['body'],{})['then'](function(_0x4c40ee){var _0x994136=_0x21bda3[_0x3ad1('0x4a')]['get']({'plain':!![]});if(!_0x994136)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x994136[_0x3ad1('0x4b')]===_0x3ad1('0x4a')){var _0x16add6=_0x4c40ee[_0x3ad1('0x27')]({'plain':!![]});var _0x516a3d=_0x3ad1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x516a3d,'userProfileId':_0x994136['userProfileId']},'raw':!![]})[_0x3ad1('0x26')](function(_0x46b25b){if(_0x46b25b&&_0x46b25b[_0x3ad1('0x4c')]===0x0){return db[_0x3ad1('0x29')][_0x3ad1('0x49')]({'name':_0x16add6['name'],'resourceId':_0x16add6['id'],'type':_0x46b25b[_0x3ad1('0x2c')],'sectionId':_0x46b25b['id']},{})[_0x3ad1('0x26')](function(){return _0x4c40ee;});}else{return _0x4c40ee;}})[_0x3ad1('0x45')](function(_0x4081d4){logger[_0x3ad1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4081d4);throw _0x4081d4;});}return _0x4c40ee;})[_0x3ad1('0x26')](respondWithResult(_0x456e31,0xc9))[_0x3ad1('0x45')](handleError(_0x456e31,null));};exports[_0x3ad1('0x25')]=function(_0x300faf,_0x350d40){if(_0x300faf[_0x3ad1('0x4d')]['id']){delete _0x300faf[_0x3ad1('0x4d')]['id'];}return db[_0x3ad1('0x2f')][_0x3ad1('0x48')]({'where':{'id':_0x300faf[_0x3ad1('0x47')]['id']}})['then'](handleEntityNotFound(_0x350d40,null))['then'](saveUpdates(_0x300faf[_0x3ad1('0x4d')],null))['then'](respondWithResult(_0x350d40,null))[_0x3ad1('0x45')](handleError(_0x350d40,null));};exports[_0x3ad1('0x4e')]=function(_0x28864d,_0x590b70){return db[_0x3ad1('0x2f')]['find']({'where':{'id':_0x28864d[_0x3ad1('0x47')]['id']}})['then'](handleEntityNotFound(_0x590b70,null))[_0x3ad1('0x26')](removeEntity(_0x590b70,null))[_0x3ad1('0x45')](handleError(_0x590b70,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c3915f0..ac4d480 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 _0x91bd=['concat','internal','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x91bd,0xe6));var _0xd91b=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x91bd[_0x48999d];return _0x1ad0d1;};'use strict';var _=require('lodash');var util=require(_0xd91b('0x0'));var BPromise=require(_0xd91b('0x1'));var attributes=require(_0xd91b('0x2'));var getUserApplications=function(_0x5dd7ed,_0x53f8b5,_0xd83906){var _0x43a3a2=0x1;var _0x4887f6=[];var _0x2ddaaf={'context':_0x53f8b5[_0xd91b('0x3')]||_0xd91b('0x4'),'exten':util[_0xd91b('0x5')]('%s%s',_0x5dd7ed[_0xd91b('0x6')],_0xd83906),'type':'system','isApp':![],'ChanSpyId':_0x5dd7ed['id'],'UserId':_0x53f8b5['id']};_0x4887f6[_0xd91b('0x7')](_[_0xd91b('0x8')]({'app':'Set','appdata':util[_0xd91b('0x5')](_0xd91b('0x9'),_0xd91b('0xa')),'priority':_0x43a3a2++},_0x2ddaaf));if(_0x5dd7ed[_0xd91b('0xb')]){_0x4887f6[_0xd91b('0x7')](_['merge']({'app':'MixMonitor','appdata':util[_0xd91b('0x5')](_0xd91b('0xc'),_0x5dd7ed['recordingFormat']),'priority':_0x43a3a2++},_0x2ddaaf));}if(_0x5dd7ed[_0xd91b('0xd')]){_0x4887f6[_0xd91b('0x7')](_['merge']({'app':_0xd91b('0xe'),'appdata':_0x5dd7ed[_0xd91b('0xf')],'priority':_0x43a3a2++},_0x2ddaaf));}_0x4887f6[_0xd91b('0x7')](_[_0xd91b('0x8')]({'app':_0xd91b('0x10'),'appdata':util[_0xd91b('0x5')](_0xd91b('0x11'),_0x53f8b5[_0xd91b('0x12')],_0x5dd7ed[_0xd91b('0x13')]?_0x5dd7ed[_0xd91b('0x13')][_0xd91b('0x14')](''):''),'priority':_0x43a3a2++},_0x2ddaaf));if(_0x5dd7ed[_0xd91b('0xb')]){_0x4887f6[_0xd91b('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x43a3a2++},_0x2ddaaf));}return _0x4887f6;};var getChanSpyApplications=function(_0x1b4af6,_0x4cc16c){var _0x3f090a=[];for(var _0x74a65d=0x0,_0x4cb73b=0x1;_0x74a65d<_0x4cc16c[_0xd91b('0x15')];_0x74a65d++,_0x4cb73b=0x1){_0x3f090a=_0x3f090a[_0xd91b('0x16')](getUserApplications(_0x1b4af6,_0x4cc16c[_0x74a65d],_0x4cc16c[_0x74a65d][_0xd91b('0x17')]));if(_0x4cc16c[_0x74a65d][_0xd91b('0x17')]!=_0x4cc16c[_0x74a65d][_0xd91b('0x12')]){_0x3f090a=_0x3f090a[_0xd91b('0x16')](getUserApplications(_0x1b4af6,_0x4cc16c[_0x74a65d],_0x4cc16c[_0x74a65d][_0xd91b('0x12')]));}}return _0x3f090a;};var getChanSpyPromise=function(_0x523d39,_0x4ab8a2){return new BPromise(function(_0x4b6866,_0x3b3a46){return _0x523d39[_0xd91b('0x18')][_0xd91b('0x19')]({'attributes':['id',_0xd91b('0x12'),_0xd91b('0x17')],'where':{'role':_0xd91b('0x1a'),'chanspy':!![]},'raw':!![]})[_0xd91b('0x1b')](function(_0x4ac5b3){if(_0x4ac5b3){return _0x4b6866(getChanSpyApplications(_0x4ab8a2,_0x4ac5b3));}return _0x4b6866([]);})[_0xd91b('0x1c')](function(_0x5502d9){_0x3b3a46(_0x5502d9);});});};module[_0xd91b('0x1d')]=function(_0x168978,_0xc149a6){var _0x1f9074=_0x168978[_0xd91b('0x1e')];return _0x168978[_0xd91b('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0xd91b('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x273183,_0x133bcf,_0x35d01f){return getChanSpyPromise(_0x1f9074,_0x273183)['then'](function(_0x1a3d55){if(_0x1a3d55&&_0x1a3d55[_0xd91b('0x15')]){return _0x1f9074[_0xd91b('0x21')][_0xd91b('0x22')](_0x1a3d55);}})[_0xd91b('0x1b')](function(){_0x35d01f();})[_0xd91b('0x1c')](function(_0x2e7fe6){_0x35d01f(_0x2e7fe6);});},'afterUpdate':function(_0x4cb892,_0x5dc3c6,_0x4b4970){return _0x1f9074['VoiceExtension'][_0xd91b('0x23')]({'where':{'ChanSpyId':_0x4cb892['id']}})['then'](function(){return getChanSpyPromise(_0x1f9074,_0x4cb892);})[_0xd91b('0x1b')](function(_0x5a9554){if(_0x5a9554&&_0x5a9554[_0xd91b('0x15')]){return _0x1f9074['VoiceExtension'][_0xd91b('0x22')](_0x5a9554);}})['then'](function(){_0x4b4970();})[_0xd91b('0x1c')](function(_0x1cc01a){_0x4b4970(_0x1cc01a);});},'afterDestroy':function(_0x5c6560,_0x40c64b,_0x2179ca){return _0x1f9074['VoiceExtension'][_0xd91b('0x23')]({'where':{'ChanSpyId':_0x5c6560['id']}})['then'](function(){_0x2179ca();})['catch'](function(_0x2f859e){_0x2179ca(_0x2f859e);});}}});}; \ No newline at end of file +var _0x5736=['MixMonitor','recordingFormat','auth','push','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','from-sip','format','prefix','system','Set','CDR(type)=%s','chanspy','record','merge'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x5736,0x15c));var _0x6573=function(_0x3b9521,_0x1562bb){_0x3b9521=_0x3b9521-0x0;var _0xd3bd55=_0x5736[_0x3b9521];return _0xd3bd55;};'use strict';var _=require(_0x6573('0x0'));var util=require(_0x6573('0x1'));var BPromise=require('bluebird');var attributes=require(_0x6573('0x2'));var getUserApplications=function(_0x1f1839,_0x2237d6,_0x227516){var _0x47aa20=0x1;var _0x45831e=[];var _0x25eccd={'context':_0x2237d6['context']||_0x6573('0x3'),'exten':util[_0x6573('0x4')]('%s%s',_0x1f1839[_0x6573('0x5')],_0x227516),'type':_0x6573('0x6'),'isApp':![],'ChanSpyId':_0x1f1839['id'],'UserId':_0x2237d6['id']};_0x45831e['push'](_['merge']({'app':_0x6573('0x7'),'appdata':util[_0x6573('0x4')](_0x6573('0x8'),_0x6573('0x9')),'priority':_0x47aa20++},_0x25eccd));if(_0x1f1839[_0x6573('0xa')]){_0x45831e['push'](_[_0x6573('0xb')]({'app':_0x6573('0xc'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x1f1839[_0x6573('0xd')]),'priority':_0x47aa20++},_0x25eccd));}if(_0x1f1839[_0x6573('0xe')]){_0x45831e[_0x6573('0xf')](_[_0x6573('0xb')]({'app':_0x6573('0x10'),'appdata':_0x1f1839['password'],'priority':_0x47aa20++},_0x25eccd));}_0x45831e[_0x6573('0xf')](_[_0x6573('0xb')]({'app':_0x6573('0x11'),'appdata':util['format'](_0x6573('0x12'),_0x2237d6[_0x6573('0x13')],_0x1f1839['options']?_0x1f1839[_0x6573('0x14')][_0x6573('0x15')](''):''),'priority':_0x47aa20++},_0x25eccd));if(_0x1f1839[_0x6573('0xa')]){_0x45831e[_0x6573('0xf')](_[_0x6573('0xb')]({'app':_0x6573('0x16'),'priority':_0x47aa20++},_0x25eccd));}return _0x45831e;};var getChanSpyApplications=function(_0x184985,_0xb4cb66){var _0x524ed2=[];for(var _0x592a02=0x0,_0x4baf0b=0x1;_0x592a02<_0xb4cb66[_0x6573('0x17')];_0x592a02++,_0x4baf0b=0x1){_0x524ed2=_0x524ed2[_0x6573('0x18')](getUserApplications(_0x184985,_0xb4cb66[_0x592a02],_0xb4cb66[_0x592a02][_0x6573('0x19')]));if(_0xb4cb66[_0x592a02][_0x6573('0x19')]!=_0xb4cb66[_0x592a02][_0x6573('0x13')]){_0x524ed2=_0x524ed2[_0x6573('0x18')](getUserApplications(_0x184985,_0xb4cb66[_0x592a02],_0xb4cb66[_0x592a02][_0x6573('0x13')]));}}return _0x524ed2;};var getChanSpyPromise=function(_0x5d7451,_0x15829c){return new BPromise(function(_0x552e88,_0x471ad9){return _0x5d7451['User'][_0x6573('0x1a')]({'attributes':['id',_0x6573('0x13'),'internal'],'where':{'role':_0x6573('0x1b'),'chanspy':!![]},'raw':!![]})[_0x6573('0x1c')](function(_0x33aca2){if(_0x33aca2){return _0x552e88(getChanSpyApplications(_0x15829c,_0x33aca2));}return _0x552e88([]);})[_0x6573('0x1d')](function(_0x3d5fda){_0x471ad9(_0x3d5fda);});});};module['exports']=function(_0x5c97db,_0x190837){var _0x12f3e3=_0x5c97db[_0x6573('0x1e')];return _0x5c97db[_0x6573('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x6573('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c2297,_0x20e691,_0x2dc3d2){return getChanSpyPromise(_0x12f3e3,_0x5c2297)[_0x6573('0x1c')](function(_0x3e8206){if(_0x3e8206&&_0x3e8206[_0x6573('0x17')]){return _0x12f3e3[_0x6573('0x21')][_0x6573('0x22')](_0x3e8206);}})['then'](function(){_0x2dc3d2();})['catch'](function(_0x3a4f62){_0x2dc3d2(_0x3a4f62);});},'afterUpdate':function(_0x222cbe,_0x50a38a,_0x59bbd5){return _0x12f3e3[_0x6573('0x21')]['destroy']({'where':{'ChanSpyId':_0x222cbe['id']}})[_0x6573('0x1c')](function(){return getChanSpyPromise(_0x12f3e3,_0x222cbe);})[_0x6573('0x1c')](function(_0x24be08){if(_0x24be08&&_0x24be08['length']){return _0x12f3e3['VoiceExtension']['bulkCreate'](_0x24be08);}})[_0x6573('0x1c')](function(){_0x59bbd5();})[_0x6573('0x1d')](function(_0x2e0460){_0x59bbd5(_0x2e0460);});},'afterDestroy':function(_0x158541,_0x3c844f,_0x4eb3df){return _0x12f3e3[_0x6573('0x21')][_0x6573('0x23')]({'where':{'ChanSpyId':_0x158541['id']}})[_0x6573('0x1c')](function(){_0x4eb3df();})[_0x6573('0x1d')](function(_0x36ba29){_0x4eb3df(_0x36ba29);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 34484e8..976d50d 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 _0xa699=['request','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x8473f6,_0x45390a){var _0x22439b=function(_0x4112ed){while(--_0x4112ed){_0x8473f6['push'](_0x8473f6['shift']());}};_0x22439b(++_0x45390a);}(_0xa699,0x6b));var _0x9a69=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xa699[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});} \ No newline at end of file +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x217f78,_0x110ee7){var _0x5da1e4=function(_0xbb7ef6){while(--_0xbb7ef6){_0x217f78['push'](_0x217f78['shift']());}};_0x5da1e4(++_0x110ee7);}(_0x2bb0,0xf3));var _0x02bb=function(_0x3e385e,_0x5b02b3){_0x3e385e=_0x3e385e-0x0;var _0x3bfdaf=_0x2bb0[_0x3e385e];return _0x3bfdaf;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 67a831f..c4faa42 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 _0x9660=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xbf6caf,_0x101a1c){var _0x217d65=function(_0x464be6){while(--_0x464be6){_0xbf6caf['push'](_0xbf6caf['shift']());}};_0x217d65(++_0x101a1c);}(_0x9660,0x1c6));var _0x0966=function(_0x3330ea,_0xa13041){_0x3330ea=_0x3330ea-0x0;var _0x239177=_0x9660[_0x3330ea];return _0x239177;};'use strict';var multer=require(_0x0966('0x0'));var util=require(_0x0966('0x1'));var path=require(_0x0966('0x2'));var timeout=require(_0x0966('0x3'));var express=require(_0x0966('0x4'));var router=express[_0x0966('0x5')]();var fs_extra=require(_0x0966('0x6'));var auth=require(_0x0966('0x7'));var interaction=require(_0x0966('0x8'));var config=require(_0x0966('0x9'));var controller=require('./voiceContext.controller');router[_0x0966('0xa')]('/',auth[_0x0966('0xb')](),controller[_0x0966('0xc')]);router['get'](_0x0966('0xd'),auth[_0x0966('0xb')](),controller[_0x0966('0xe')]);router[_0x0966('0xf')]('/',auth['isAuthenticated'](),controller[_0x0966('0x10')]);router[_0x0966('0x11')](_0x0966('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0966('0x12')](_0x0966('0xd'),auth[_0x0966('0xb')](),controller[_0x0966('0x13')]);module[_0x0966('0x14')]=router; \ No newline at end of file +var _0x613b=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer'];(function(_0x28a4f3,_0x2b8e72){var _0x20b749=function(_0x5a9c72){while(--_0x5a9c72){_0x28a4f3['push'](_0x28a4f3['shift']());}};_0x20b749(++_0x2b8e72);}(_0x613b,0x65));var _0xb613=function(_0x288b5a,_0x337e71){_0x288b5a=_0x288b5a-0x0;var _0x1f5241=_0x613b[_0x288b5a];return _0x1f5241;};'use strict';var multer=require(_0xb613('0x0'));var util=require(_0xb613('0x1'));var path=require(_0xb613('0x2'));var timeout=require(_0xb613('0x3'));var express=require('express');var router=express[_0xb613('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb613('0x5'));var interaction=require(_0xb613('0x6'));var config=require(_0xb613('0x7'));var controller=require(_0xb613('0x8'));router['get']('/',auth[_0xb613('0x9')](),controller[_0xb613('0xa')]);router['get'](_0xb613('0xb'),auth[_0xb613('0x9')](),controller['show']);router['post']('/',auth[_0xb613('0x9')](),controller['create']);router[_0xb613('0xc')]('/:id',auth[_0xb613('0x9')](),controller[_0xb613('0xd')]);router[_0xb613('0xe')](_0xb613('0xb'),auth['isAuthenticated'](),controller[_0xb613('0xf')]);module[_0xb613('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 7dcbc7d..bb68529 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 _0xf0ea=['STRING','sequelize'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xf0ea,0xdd));var _0xaf0e=function(_0x34c4e0,_0x42cd17){_0x34c4e0=_0x34c4e0-0x0;var _0x105ba5=_0xf0ea[_0x34c4e0];return _0x105ba5;};'use strict';var Sequelize=require(_0xaf0e('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf0e('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xaf0e('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdb80=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2385f6,_0x50b841){var _0x4a110c=function(_0x19639c){while(--_0x19639c){_0x2385f6['push'](_0x2385f6['shift']());}};_0x4a110c(++_0x50b841);}(_0xdb80,0xaf));var _0x0db8=function(_0xc8780d,_0x42db41){_0xc8780d=_0xc8780d-0x0;var _0x326db1=_0xdb80[_0xc8780d];return _0x326db1;};'use strict';var Sequelize=require(_0x0db8('0x0'));module[_0x0db8('0x1')]={'name':{'type':Sequelize[_0x0db8('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x0db8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0db8('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4d855bf..a1be319 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 _0xcda4=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','get','Contexts','stack','name','send','index','map','VoiceContext','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','count','includeAll','findAll','show','params','rawAttributes','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','writeFileSync','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5a0b83,_0x375001){var _0xff5670=function(_0x113b62){while(--_0x113b62){_0x5a0b83['push'](_0x5a0b83['shift']());}};_0xff5670(++_0x375001);}(_0xcda4,0x12d));var _0x4cda=function(_0x1e604c,_0x24c960){_0x1e604c=_0x1e604c-0x0;var _0x4cd34f=_0xcda4[_0x1e604c];return _0x4cd34f;};'use strict';var emlformat=require(_0x4cda('0x0'));var rimraf=require(_0x4cda('0x1'));var zipdir=require(_0x4cda('0x2'));var jsonpatch=require(_0x4cda('0x3'));var rp=require(_0x4cda('0x4'));var moment=require('moment');var BPromise=require(_0x4cda('0x5'));var Mustache=require(_0x4cda('0x6'));var util=require(_0x4cda('0x7'));var path=require(_0x4cda('0x8'));var sox=require(_0x4cda('0x9'));var csv=require(_0x4cda('0xa'));var ejs=require(_0x4cda('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cda('0xc'));var squel=require(_0x4cda('0xd'));var crypto=require(_0x4cda('0xe'));var jsforce=require(_0x4cda('0xf'));var deskjs=require(_0x4cda('0x10'));var toCsv=require(_0x4cda('0xa'));var querystring=require(_0x4cda('0x11'));var Papa=require(_0x4cda('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4cda('0x13'));var as=require(_0x4cda('0x14'));var hardwareService=require(_0x4cda('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4cda('0x16'));var config=require(_0x4cda('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cda('0x18'))['db'];var jayson=require(_0x4cda('0x19'));var client=jayson['client'][_0x4cda('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2af07c,_0x171673,_0x40425b,_0xe60f51){return new BPromise(function(_0x50fd7b,_0x196d6b){var _0x27e556=_0xe60f51||client;return _0x27e556[_0x4cda('0x1b')](_0x2af07c,_0x40425b)[_0x4cda('0x1c')](function(_0x533120){logger[_0x4cda('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x171673,_0x4cda('0x1e'));logger[_0x4cda('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x171673,_0x4cda('0x1e'),JSON[_0x4cda('0x20')](_0x533120));if(_0x533120[_0x4cda('0x21')]){if(_0x533120['error']['code']===0x1f4){logger['error'](_0x4cda('0x22'),_0x171673,_0x533120[_0x4cda('0x21')]['message']);return _0x196d6b(_0x533120[_0x4cda('0x21')][_0x4cda('0x23')]);}logger[_0x4cda('0x21')](_0x4cda('0x22'),_0x171673,_0x533120[_0x4cda('0x21')][_0x4cda('0x23')]);return _0x50fd7b(_0x533120[_0x4cda('0x21')][_0x4cda('0x23')]);}else{logger[_0x4cda('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x171673,_0x4cda('0x1e'));_0x50fd7b(_0x533120[_0x4cda('0x24')][_0x4cda('0x23')]);}})[_0x4cda('0x25')](function(_0x47b955){logger[_0x4cda('0x21')](_0x4cda('0x22'),_0x171673,_0x47b955);_0x196d6b(_0x47b955);});});}function respondWithStatusCode(_0x2fbc72,_0x101414){_0x101414=_0x101414||0xcc;return function(_0x563662){if(_0x563662){return _0x2fbc72[_0x4cda('0x26')](_0x101414);}return _0x2fbc72[_0x4cda('0x27')](_0x101414)[_0x4cda('0x28')]();};}function respondWithResult(_0x28f9bc,_0x1a3c37){_0x1a3c37=_0x1a3c37||0xc8;return function(_0x177c3a){if(_0x177c3a){return _0x28f9bc[_0x4cda('0x27')](_0x1a3c37)[_0x4cda('0x29')](_0x177c3a);}};}function respondWithFilteredResult(_0x453b4d,_0x3e3aef){return function(_0x4862ea){if(_0x4862ea){var _0x35a21b=typeof _0x3e3aef[_0x4cda('0x2a')]===_0x4cda('0x2b')&&typeof _0x3e3aef[_0x4cda('0x2c')]===_0x4cda('0x2b');var _0xd7bdc6=_0x4862ea['count'];var _0x5aa010=_0x35a21b?0x0:_0x3e3aef[_0x4cda('0x2a')];var _0x48ce61=_0x35a21b?_0x4862ea['count']:_0x3e3aef['offset']+_0x3e3aef['limit'];var _0x590859;if(_0x48ce61>=_0xd7bdc6){_0x48ce61=_0xd7bdc6;_0x590859=0xc8;}else{_0x590859=0xce;}_0x453b4d[_0x4cda('0x27')](_0x590859);return _0x453b4d[_0x4cda('0x2d')](_0x4cda('0x2e'),_0x5aa010+'-'+_0x48ce61+'/'+_0xd7bdc6)[_0x4cda('0x29')](_0x4862ea);}return null;};}function patchUpdates(_0x493f6f){return function(_0x4e7bff){try{jsonpatch[_0x4cda('0x2f')](_0x4e7bff,_0x493f6f,!![]);}catch(_0x55a022){return BPromise['reject'](_0x55a022);}return _0x4e7bff[_0x4cda('0x30')]();};}function saveUpdates(_0x37cb15,_0x5ef1f8){return function(_0x3e22f4){if(_0x3e22f4){return _0x3e22f4['update'](_0x37cb15)[_0x4cda('0x1c')](function(_0x5f3b6e){return _0x5f3b6e;});}return null;};}function removeEntity(_0x33f896,_0x3377a5){return function(_0xa8961f){if(_0xa8961f){return _0xa8961f[_0x4cda('0x31')]()[_0x4cda('0x1c')](function(){var _0x3984ad=_0xa8961f[_0x4cda('0x32')]({'plain':!![]});var _0x27bfcc=_0x4cda('0x33');return db['UserProfileResource'][_0x4cda('0x31')]({'where':{'type':_0x27bfcc,'resourceId':_0x3984ad['id']}})[_0x4cda('0x1c')](function(){return _0xa8961f;});})['then'](function(){_0x33f896['status'](0xcc)[_0x4cda('0x28')]();});}};}function handleEntityNotFound(_0x33e997,_0x2b90d6){return function(_0x205fa0){if(!_0x205fa0){_0x33e997[_0x4cda('0x26')](0x194);}return _0x205fa0;};}function handleError(_0x3cd280,_0x106291){_0x106291=_0x106291||0x1f4;return function(_0x4d8bc4){logger['error'](_0x4d8bc4[_0x4cda('0x34')]);if(_0x4d8bc4['name']){delete _0x4d8bc4[_0x4cda('0x35')];}_0x3cd280[_0x4cda('0x27')](_0x106291)[_0x4cda('0x36')](_0x4d8bc4);};}exports[_0x4cda('0x37')]=function(_0x6616fd,_0x2727ca){var _0x30ad8f={},_0x47cf24={},_0x4106c3={'count':0x0,'rows':[]};var _0x2ef89d=_[_0x4cda('0x38')](db[_0x4cda('0x39')]['rawAttributes'],function(_0x122eae){return{'name':_0x122eae[_0x4cda('0x3a')],'type':_0x122eae['type']['key']};});_0x47cf24[_0x4cda('0x3b')]=_['map'](_0x2ef89d,_0x4cda('0x35'));_0x47cf24[_0x4cda('0x3c')]=_[_0x4cda('0x3d')](_0x6616fd[_0x4cda('0x3c')]);_0x47cf24[_0x4cda('0x3e')]=_[_0x4cda('0x3f')](_0x47cf24[_0x4cda('0x3b')],_0x47cf24[_0x4cda('0x3c')]);_0x30ad8f[_0x4cda('0x40')]=_[_0x4cda('0x3f')](_0x47cf24['model'],qs[_0x4cda('0x41')](_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x41')]));_0x30ad8f[_0x4cda('0x40')]=_0x30ad8f[_0x4cda('0x40')][_0x4cda('0x42')]?_0x30ad8f[_0x4cda('0x40')]:_0x47cf24[_0x4cda('0x3b')];if(!_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x43')](_0x4cda('0x44'))){_0x30ad8f[_0x4cda('0x2c')]=qs[_0x4cda('0x2c')](_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x2c')]);_0x30ad8f[_0x4cda('0x2a')]=qs[_0x4cda('0x2a')](_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x2a')]);}_0x30ad8f[_0x4cda('0x45')]=qs[_0x4cda('0x46')](_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x46')]);_0x30ad8f[_0x4cda('0x47')]=qs[_0x4cda('0x3e')](_[_0x4cda('0x48')](_0x6616fd['query'],_0x47cf24['filters']),_0x2ef89d);if(_0x6616fd[_0x4cda('0x3c')]['filter']){_0x30ad8f[_0x4cda('0x47')]=_[_0x4cda('0x49')](_0x30ad8f['where'],{'$or':_['map'](_0x2ef89d,function(_0x2d2fa4){if(_0x2d2fa4[_0x4cda('0x4a')]!=='VIRTUAL'){var _0x2ba2c4={};_0x2ba2c4[_0x2d2fa4[_0x4cda('0x35')]]={'$like':'%'+_0x6616fd[_0x4cda('0x3c')][_0x4cda('0x4b')]+'%'};return _0x2ba2c4;}})});}_0x30ad8f=_['merge']({},_0x30ad8f,_0x6616fd[_0x4cda('0x4c')]);var _0x46e902={'where':_0x30ad8f['where']};return db['VoiceContext'][_0x4cda('0x4d')](_0x46e902)[_0x4cda('0x1c')](function(_0x3356d4){_0x4106c3[_0x4cda('0x4d')]=_0x3356d4;if(_0x6616fd['query'][_0x4cda('0x4e')]){_0x30ad8f['include']=[{'all':!![]}];}return db[_0x4cda('0x39')][_0x4cda('0x4f')](_0x30ad8f);})[_0x4cda('0x1c')](function(_0x985a13){_0x4106c3['rows']=_0x985a13;return _0x4106c3;})[_0x4cda('0x1c')](respondWithFilteredResult(_0x2727ca,_0x30ad8f))['catch'](handleError(_0x2727ca,null));};exports[_0x4cda('0x50')]=function(_0x318315,_0x369a57){var _0x4bc89a={'raw':![],'where':{'id':_0x318315[_0x4cda('0x51')]['id']}},_0x1e21fa={};_0x1e21fa[_0x4cda('0x3b')]=_[_0x4cda('0x3d')](db[_0x4cda('0x39')][_0x4cda('0x52')]);_0x1e21fa[_0x4cda('0x3c')]=_[_0x4cda('0x3d')](_0x318315[_0x4cda('0x3c')]);_0x1e21fa[_0x4cda('0x3e')]=_['intersection'](_0x1e21fa[_0x4cda('0x3b')],_0x1e21fa[_0x4cda('0x3c')]);_0x4bc89a[_0x4cda('0x40')]=_[_0x4cda('0x3f')](_0x1e21fa[_0x4cda('0x3b')],qs['fields'](_0x318315['query'][_0x4cda('0x41')]));_0x4bc89a[_0x4cda('0x40')]=_0x4bc89a[_0x4cda('0x40')][_0x4cda('0x42')]?_0x4bc89a[_0x4cda('0x40')]:_0x1e21fa[_0x4cda('0x3b')];if(_0x318315[_0x4cda('0x3c')][_0x4cda('0x4e')]){_0x4bc89a[_0x4cda('0x53')]=[{'all':!![]}];}_0x4bc89a=_[_0x4cda('0x49')]({},_0x4bc89a,_0x318315[_0x4cda('0x4c')]);return db[_0x4cda('0x39')][_0x4cda('0x54')](_0x4bc89a)[_0x4cda('0x1c')](handleEntityNotFound(_0x369a57,null))['then'](respondWithResult(_0x369a57,null))[_0x4cda('0x25')](handleError(_0x369a57,null));};exports['create']=function(_0x5af055,_0x417e31,_0x5ef5ae){var _0x26e78b;return db[_0x4cda('0x39')][_0x4cda('0x55')](_0x5af055[_0x4cda('0x56')],{'raw':!![]})[_0x4cda('0x1c')](function(_0x3ef532){_0x26e78b=_0x3ef532;return db[_0x4cda('0x39')][_0x4cda('0x4f')]({'raw':!![]});})[_0x4cda('0x1c')](function(_0x5540d3){var _0x49aaa0=fs[_0x4cda('0x57')](path[_0x4cda('0x58')](config[_0x4cda('0x59')],_0x4cda('0x5a')),_0x4cda('0x5b'));var _0x53b548=ejs[_0x4cda('0x5c')](_0x49aaa0,{'contexts':_0x5540d3||[]});fs['writeFileSync'](_0x4cda('0x5d'),_0x53b548);})[_0x4cda('0x1c')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x4cda('0x1c')](function(){var _0x4f4270=_0x5af055[_0x4cda('0x5e')][_0x4cda('0x32')]({'plain':!![]});if(!_0x4f4270)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4270['role']==='user'){var _0xa14484=_0x26e78b[_0x4cda('0x32')]({'plain':!![]});return db[_0x4cda('0x5f')][_0x4cda('0x54')]({'where':{'name':'Contexts','userProfileId':_0x4f4270[_0x4cda('0x60')]},'raw':!![]})[_0x4cda('0x1c')](function(_0x150db4){if(_0x150db4&&_0x150db4[_0x4cda('0x61')]===0x0){return db[_0x4cda('0x62')]['create']({'name':_0xa14484[_0x4cda('0x35')],'resourceId':_0xa14484['id'],'type':_0x150db4['name'],'sectionId':_0x150db4['id']},{})[_0x4cda('0x1c')](function(){return _0x26e78b;});}else{return _0x26e78b;}})[_0x4cda('0x25')](function(_0x3bb4f9){logger[_0x4cda('0x21')](_0x4cda('0x63'),_0x3bb4f9);throw _0x3bb4f9;});}return _0x26e78b;})[_0x4cda('0x1c')](respondWithResult(_0x417e31,0xc9))[_0x4cda('0x25')](handleError(_0x417e31,null));};exports[_0x4cda('0x64')]=function(_0x14f28f,_0x4ac2b6,_0x39248c){var _0x21ca88;return db[_0x4cda('0x39')][_0x4cda('0x54')]({'where':{'id':_0x14f28f[_0x4cda('0x51')]['id']}})[_0x4cda('0x1c')](handleEntityNotFound(_0x4ac2b6,null))[_0x4cda('0x1c')](saveUpdates(_0x14f28f['body'],null))[_0x4cda('0x1c')](function(_0x51d074){if(_0x51d074){_0x21ca88=_0x51d074;return db[_0x4cda('0x39')][_0x4cda('0x4f')]({'raw':!![]});}})['then'](function(_0x3f390f){var _0x327f4d=fs[_0x4cda('0x57')](path[_0x4cda('0x58')](config[_0x4cda('0x59')],_0x4cda('0x5a')),'utf8');var _0x80951f=ejs[_0x4cda('0x5c')](_0x327f4d,{'contexts':_0x3f390f||[]});fs[_0x4cda('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x80951f);})[_0x4cda('0x1c')](function(){return respondWithRpcPromise(_0x4cda('0x66'),_0x4cda('0x64'),{'module':_0x4cda('0x67')});})[_0x4cda('0x1c')](function(){return _0x21ca88;})['then'](respondWithResult(_0x4ac2b6,null))[_0x4cda('0x25')](handleError(_0x4ac2b6,null));};exports[_0x4cda('0x31')]=function(_0x5f0d71,_0x3e74ab,_0x51074e){var _0x459a2a;return db[_0x4cda('0x39')][_0x4cda('0x54')]({'where':{'id':_0x5f0d71['params']['id']}})['then'](handleEntityNotFound(_0x3e74ab,null))[_0x4cda('0x1c')](removeEntity(_0x3e74ab,null))[_0x4cda('0x1c')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x463b5a){var _0x98d2f8=fs[_0x4cda('0x57')](path[_0x4cda('0x58')](config['root'],'server/files/templates/context.ejs'),_0x4cda('0x5b'));var _0x496d87=ejs[_0x4cda('0x5c')](_0x98d2f8,{'contexts':_0x463b5a});fs[_0x4cda('0x65')](_0x4cda('0x5d'),_0x496d87);return respondWithRpcPromise(_0x4cda('0x66'),_0x4cda('0x31'),{'module':_0x4cda('0x67')});})['catch'](handleError(_0x3e74ab,null));}; \ No newline at end of file +var _0x4e28=['sendStatus','stack','name','send','index','VoiceContext','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','writeFileSync','chan_sip.so','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource'];(function(_0xe7a680,_0x173a43){var _0x4d2c92=function(_0x16667a){while(--_0x16667a){_0xe7a680['push'](_0xe7a680['shift']());}};_0x4d2c92(++_0x173a43);}(_0x4e28,0x100));var _0x84e2=function(_0x503480,_0x60f3db){_0x503480=_0x503480-0x0;var _0x2405df=_0x4e28[_0x503480];return _0x2405df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x84e2('0x0'));var zipdir=require(_0x84e2('0x1'));var jsonpatch=require(_0x84e2('0x2'));var rp=require(_0x84e2('0x3'));var moment=require(_0x84e2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x84e2('0x5'));var path=require(_0x84e2('0x6'));var sox=require(_0x84e2('0x7'));var csv=require(_0x84e2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84e2('0x9'));var squel=require(_0x84e2('0xa'));var crypto=require('crypto');var jsforce=require(_0x84e2('0xb'));var deskjs=require(_0x84e2('0xc'));var toCsv=require(_0x84e2('0x8'));var querystring=require(_0x84e2('0xd'));var Papa=require('papaparse');var Redis=require(_0x84e2('0xe'));var authService=require(_0x84e2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84e2('0x10'));var logger=require('../../config/logger')(_0x84e2('0x11'));var utils=require(_0x84e2('0x12'));var config=require(_0x84e2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x84e2('0x14'))['db'];var jayson=require(_0x84e2('0x15'));var client=jayson[_0x84e2('0x16')][_0x84e2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x1842df,_0x4e6acb,_0x5a9c8f,_0x543331){return new BPromise(function(_0x52b16e,_0x51b99d){var _0x3822ab=_0x543331||client;return _0x3822ab[_0x84e2('0x18')](_0x1842df,_0x5a9c8f)[_0x84e2('0x19')](function(_0x1247eb){logger['info'](_0x84e2('0x1a'),_0x4e6acb,_0x84e2('0x1b'));logger['debug'](_0x84e2('0x1c'),_0x4e6acb,_0x84e2('0x1b'),JSON[_0x84e2('0x1d')](_0x1247eb));if(_0x1247eb[_0x84e2('0x1e')]){if(_0x1247eb[_0x84e2('0x1e')][_0x84e2('0x1f')]===0x1f4){logger['error'](_0x84e2('0x1a'),_0x4e6acb,_0x1247eb[_0x84e2('0x1e')][_0x84e2('0x20')]);return _0x51b99d(_0x1247eb[_0x84e2('0x1e')][_0x84e2('0x20')]);}logger[_0x84e2('0x1e')](_0x84e2('0x1a'),_0x4e6acb,_0x1247eb['error']['message']);return _0x52b16e(_0x1247eb[_0x84e2('0x1e')][_0x84e2('0x20')]);}else{logger['info'](_0x84e2('0x1a'),_0x4e6acb,_0x84e2('0x1b'));_0x52b16e(_0x1247eb['result'][_0x84e2('0x20')]);}})[_0x84e2('0x21')](function(_0x34fbf1){logger['error'](_0x84e2('0x1a'),_0x4e6acb,_0x34fbf1);_0x51b99d(_0x34fbf1);});});}function respondWithStatusCode(_0x4cca83,_0x35d691){_0x35d691=_0x35d691||0xcc;return function(_0x56a6f6){if(_0x56a6f6){return _0x4cca83['sendStatus'](_0x35d691);}return _0x4cca83['status'](_0x35d691)[_0x84e2('0x22')]();};}function respondWithResult(_0x1e7dd5,_0x48290c){_0x48290c=_0x48290c||0xc8;return function(_0x4df7a3){if(_0x4df7a3){return _0x1e7dd5[_0x84e2('0x23')](_0x48290c)[_0x84e2('0x24')](_0x4df7a3);}};}function respondWithFilteredResult(_0x1127d0,_0x419609){return function(_0x18eafc){if(_0x18eafc){var _0x4a1e3e=typeof _0x419609['offset']===_0x84e2('0x25')&&typeof _0x419609['limit']==='undefined';var _0x464654=_0x18eafc[_0x84e2('0x26')];var _0x4a953d=_0x4a1e3e?0x0:_0x419609[_0x84e2('0x27')];var _0x47154d=_0x4a1e3e?_0x18eafc[_0x84e2('0x26')]:_0x419609[_0x84e2('0x27')]+_0x419609[_0x84e2('0x28')];var _0x52122e;if(_0x47154d>=_0x464654){_0x47154d=_0x464654;_0x52122e=0xc8;}else{_0x52122e=0xce;}_0x1127d0[_0x84e2('0x23')](_0x52122e);return _0x1127d0[_0x84e2('0x29')](_0x84e2('0x2a'),_0x4a953d+'-'+_0x47154d+'/'+_0x464654)[_0x84e2('0x24')](_0x18eafc);}return null;};}function patchUpdates(_0x280938){return function(_0x567f03){try{jsonpatch[_0x84e2('0x2b')](_0x567f03,_0x280938,!![]);}catch(_0x5c3976){return BPromise[_0x84e2('0x2c')](_0x5c3976);}return _0x567f03[_0x84e2('0x2d')]();};}function saveUpdates(_0x4a6d26,_0x52294f){return function(_0x5d7864){if(_0x5d7864){return _0x5d7864[_0x84e2('0x2e')](_0x4a6d26)[_0x84e2('0x19')](function(_0x594b99){return _0x594b99;});}return null;};}function removeEntity(_0x24cea8,_0x33ecea){return function(_0x18350c){if(_0x18350c){return _0x18350c[_0x84e2('0x2f')]()[_0x84e2('0x19')](function(){var _0x3db493=_0x18350c['get']({'plain':!![]});var _0xa78736=_0x84e2('0x30');return db[_0x84e2('0x31')][_0x84e2('0x2f')]({'where':{'type':_0xa78736,'resourceId':_0x3db493['id']}})['then'](function(){return _0x18350c;});})[_0x84e2('0x19')](function(){_0x24cea8['status'](0xcc)[_0x84e2('0x22')]();});}};}function handleEntityNotFound(_0x3afeea,_0x131138){return function(_0x57c1ab){if(!_0x57c1ab){_0x3afeea[_0x84e2('0x32')](0x194);}return _0x57c1ab;};}function handleError(_0x5b6116,_0x542d29){_0x542d29=_0x542d29||0x1f4;return function(_0x14333e){logger[_0x84e2('0x1e')](_0x14333e[_0x84e2('0x33')]);if(_0x14333e[_0x84e2('0x34')]){delete _0x14333e[_0x84e2('0x34')];}_0x5b6116[_0x84e2('0x23')](_0x542d29)[_0x84e2('0x35')](_0x14333e);};}exports[_0x84e2('0x36')]=function(_0x13b1cb,_0x30408e){var _0x1a690c={},_0x51e832={},_0x160d81={'count':0x0,'rows':[]};var _0x39d821=_['map'](db[_0x84e2('0x37')][_0x84e2('0x38')],function(_0x1eb748){return{'name':_0x1eb748['fieldName'],'type':_0x1eb748[_0x84e2('0x39')][_0x84e2('0x3a')]};});_0x51e832[_0x84e2('0x3b')]=_[_0x84e2('0x3c')](_0x39d821,_0x84e2('0x34'));_0x51e832[_0x84e2('0x3d')]=_[_0x84e2('0x3e')](_0x13b1cb[_0x84e2('0x3d')]);_0x51e832[_0x84e2('0x3f')]=_['intersection'](_0x51e832[_0x84e2('0x3b')],_0x51e832['query']);_0x1a690c[_0x84e2('0x40')]=_[_0x84e2('0x41')](_0x51e832[_0x84e2('0x3b')],qs[_0x84e2('0x42')](_0x13b1cb[_0x84e2('0x3d')][_0x84e2('0x42')]));_0x1a690c[_0x84e2('0x40')]=_0x1a690c[_0x84e2('0x40')][_0x84e2('0x43')]?_0x1a690c['attributes']:_0x51e832[_0x84e2('0x3b')];if(!_0x13b1cb['query']['hasOwnProperty'](_0x84e2('0x44'))){_0x1a690c['limit']=qs['limit'](_0x13b1cb[_0x84e2('0x3d')][_0x84e2('0x28')]);_0x1a690c[_0x84e2('0x27')]=qs[_0x84e2('0x27')](_0x13b1cb['query'][_0x84e2('0x27')]);}_0x1a690c[_0x84e2('0x45')]=qs[_0x84e2('0x46')](_0x13b1cb[_0x84e2('0x3d')]['sort']);_0x1a690c[_0x84e2('0x47')]=qs['filters'](_['pick'](_0x13b1cb[_0x84e2('0x3d')],_0x51e832[_0x84e2('0x3f')]),_0x39d821);if(_0x13b1cb[_0x84e2('0x3d')][_0x84e2('0x48')]){_0x1a690c['where']=_['merge'](_0x1a690c[_0x84e2('0x47')],{'$or':_[_0x84e2('0x3c')](_0x39d821,function(_0x42b0cf){if(_0x42b0cf['type']!==_0x84e2('0x49')){var _0x279420={};_0x279420[_0x42b0cf[_0x84e2('0x34')]]={'$like':'%'+_0x13b1cb[_0x84e2('0x3d')][_0x84e2('0x48')]+'%'};return _0x279420;}})});}_0x1a690c=_[_0x84e2('0x4a')]({},_0x1a690c,_0x13b1cb[_0x84e2('0x4b')]);var _0x5669bf={'where':_0x1a690c[_0x84e2('0x47')]};return db[_0x84e2('0x37')][_0x84e2('0x26')](_0x5669bf)[_0x84e2('0x19')](function(_0x415747){_0x160d81[_0x84e2('0x26')]=_0x415747;if(_0x13b1cb[_0x84e2('0x3d')][_0x84e2('0x4c')]){_0x1a690c[_0x84e2('0x4d')]=[{'all':!![]}];}return db['VoiceContext'][_0x84e2('0x4e')](_0x1a690c);})['then'](function(_0x28f3a1){_0x160d81[_0x84e2('0x4f')]=_0x28f3a1;return _0x160d81;})[_0x84e2('0x19')](respondWithFilteredResult(_0x30408e,_0x1a690c))[_0x84e2('0x21')](handleError(_0x30408e,null));};exports['show']=function(_0x4a00f2,_0x466dc2){var _0x3c90f0={'raw':![],'where':{'id':_0x4a00f2['params']['id']}},_0x27820b={};_0x27820b[_0x84e2('0x3b')]=_[_0x84e2('0x3e')](db[_0x84e2('0x37')][_0x84e2('0x38')]);_0x27820b[_0x84e2('0x3d')]=_[_0x84e2('0x3e')](_0x4a00f2[_0x84e2('0x3d')]);_0x27820b[_0x84e2('0x3f')]=_[_0x84e2('0x41')](_0x27820b[_0x84e2('0x3b')],_0x27820b[_0x84e2('0x3d')]);_0x3c90f0['attributes']=_['intersection'](_0x27820b[_0x84e2('0x3b')],qs[_0x84e2('0x42')](_0x4a00f2[_0x84e2('0x3d')]['fields']));_0x3c90f0[_0x84e2('0x40')]=_0x3c90f0['attributes']['length']?_0x3c90f0[_0x84e2('0x40')]:_0x27820b[_0x84e2('0x3b')];if(_0x4a00f2['query'][_0x84e2('0x4c')]){_0x3c90f0[_0x84e2('0x4d')]=[{'all':!![]}];}_0x3c90f0=_[_0x84e2('0x4a')]({},_0x3c90f0,_0x4a00f2['options']);return db['VoiceContext']['find'](_0x3c90f0)[_0x84e2('0x19')](handleEntityNotFound(_0x466dc2,null))[_0x84e2('0x19')](respondWithResult(_0x466dc2,null))[_0x84e2('0x21')](handleError(_0x466dc2,null));};exports[_0x84e2('0x50')]=function(_0x36a351,_0x544b58,_0x2b9bb6){var _0x5137d7;return db['VoiceContext']['create'](_0x36a351[_0x84e2('0x51')],{'raw':!![]})[_0x84e2('0x19')](function(_0x5d6fb0){_0x5137d7=_0x5d6fb0;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x84e2('0x19')](function(_0x81192){var _0x18014d=fs[_0x84e2('0x52')](path[_0x84e2('0x53')](config['root'],_0x84e2('0x54')),_0x84e2('0x55'));var _0x3af8a9=ejs[_0x84e2('0x56')](_0x18014d,{'contexts':_0x81192||[]});fs['writeFileSync'](_0x84e2('0x57'),_0x3af8a9);})[_0x84e2('0x19')](function(){return respondWithRpcPromise(_0x84e2('0x58'),_0x84e2('0x50'),{'module':'chan_sip.so'});})[_0x84e2('0x19')](function(){var _0x12abef=_0x36a351[_0x84e2('0x59')][_0x84e2('0x5a')]({'plain':!![]});if(!_0x12abef)throw new Error(_0x84e2('0x5b'));if(_0x12abef[_0x84e2('0x5c')]===_0x84e2('0x59')){var _0x344141=_0x5137d7[_0x84e2('0x5a')]({'plain':!![]});return db[_0x84e2('0x5d')][_0x84e2('0x5e')]({'where':{'name':_0x84e2('0x30'),'userProfileId':_0x12abef[_0x84e2('0x5f')]},'raw':!![]})[_0x84e2('0x19')](function(_0x261a9c){if(_0x261a9c&&_0x261a9c[_0x84e2('0x60')]===0x0){return db[_0x84e2('0x31')][_0x84e2('0x50')]({'name':_0x344141[_0x84e2('0x34')],'resourceId':_0x344141['id'],'type':_0x261a9c[_0x84e2('0x34')],'sectionId':_0x261a9c['id']},{})[_0x84e2('0x19')](function(){return _0x5137d7;});}else{return _0x5137d7;}})[_0x84e2('0x21')](function(_0x259e8d){logger[_0x84e2('0x1e')](_0x84e2('0x61'),_0x259e8d);throw _0x259e8d;});}return _0x5137d7;})[_0x84e2('0x19')](respondWithResult(_0x544b58,0xc9))['catch'](handleError(_0x544b58,null));};exports[_0x84e2('0x2e')]=function(_0x14467e,_0x1e38a2,_0x532c1e){var _0xee7a1e;return db[_0x84e2('0x37')][_0x84e2('0x5e')]({'where':{'id':_0x14467e['params']['id']}})['then'](handleEntityNotFound(_0x1e38a2,null))[_0x84e2('0x19')](saveUpdates(_0x14467e['body'],null))['then'](function(_0x2ba2c4){if(_0x2ba2c4){_0xee7a1e=_0x2ba2c4;return db['VoiceContext'][_0x84e2('0x4e')]({'raw':!![]});}})['then'](function(_0x1e3d47){var _0x5928a1=fs[_0x84e2('0x52')](path['join'](config[_0x84e2('0x62')],'server/files/templates/context.ejs'),'utf8');var _0x1b7578=ejs[_0x84e2('0x56')](_0x5928a1,{'contexts':_0x1e3d47||[]});fs[_0x84e2('0x63')](_0x84e2('0x57'),_0x1b7578);})[_0x84e2('0x19')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x84e2('0x64')});})[_0x84e2('0x19')](function(){return _0xee7a1e;})[_0x84e2('0x19')](respondWithResult(_0x1e38a2,null))[_0x84e2('0x21')](handleError(_0x1e38a2,null));};exports[_0x84e2('0x2f')]=function(_0x401ed2,_0x27d398,_0x16cbc4){var _0x5bf9a1;return db[_0x84e2('0x37')][_0x84e2('0x5e')]({'where':{'id':_0x401ed2[_0x84e2('0x65')]['id']}})[_0x84e2('0x19')](handleEntityNotFound(_0x27d398,null))['then'](removeEntity(_0x27d398,null))[_0x84e2('0x19')](function(){return db[_0x84e2('0x37')][_0x84e2('0x4e')]({'raw':!![]});})[_0x84e2('0x19')](function(_0xa05b49){var _0x7c93f8=fs[_0x84e2('0x52')](path[_0x84e2('0x53')](config[_0x84e2('0x62')],'server/files/templates/context.ejs'),'utf8');var _0x13e309=ejs[_0x84e2('0x56')](_0x7c93f8,{'contexts':_0xa05b49});fs['writeFileSync'](_0x84e2('0x57'),_0x13e309);return respondWithRpcPromise(_0x84e2('0x58'),_0x84e2('0x2f'),{'module':_0x84e2('0x64')});})[_0x84e2('0x21')](handleError(_0x27d398,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 70f8e5e..b03626c 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 _0x2966=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash','util','../../config/logger','api','request-promise'];(function(_0x19d7e9,_0x359dd7){var _0x3b74db=function(_0x5bb01f){while(--_0x5bb01f){_0x19d7e9['push'](_0x19d7e9['shift']());}};_0x3b74db(++_0x359dd7);}(_0x2966,0x187));var _0x6296=function(_0x4bb806,_0x244e25){_0x4bb806=_0x4bb806-0x0;var _0x435fcd=_0x2966[_0x4bb806];return _0x435fcd;};'use strict';var _=require(_0x6296('0x0'));var util=require(_0x6296('0x1'));var logger=require(_0x6296('0x2'))(_0x6296('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6296('0x4'));var fs=require('fs');var path=require(_0x6296('0x5'));var rimraf=require(_0x6296('0x6'));var config=require(_0x6296('0x7'));var attributes=require(_0x6296('0x8'));module[_0x6296('0x9')]=function(_0x333c2d,_0x42bacf){return _0x333c2d['define'](_0x6296('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6a3=['request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash','util','../../config/logger','api'];(function(_0x4f4de0,_0x5a7b40){var _0x2727bd=function(_0x3a9642){while(--_0x3a9642){_0x4f4de0['push'](_0x4f4de0['shift']());}};_0x2727bd(++_0x5a7b40);}(_0xe6a3,0x11e));var _0x3e6a=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xe6a3[_0x7275e9];return _0x17b99d;};'use strict';var _=require(_0x3e6a('0x0'));var util=require(_0x3e6a('0x1'));var logger=require(_0x3e6a('0x2'))(_0x3e6a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e6a('0x4'));var fs=require('fs');var path=require(_0x3e6a('0x5'));var rimraf=require('rimraf');var config=require(_0x3e6a('0x6'));var attributes=require(_0x3e6a('0x7'));module[_0x3e6a('0x8')]=function(_0x511667,_0x28bb64){return _0x511667['define'](_0x3e6a('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 29ba604..e3adca2 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 _0x9e6b=['request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e6b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var moment=require('moment');var BPromise=require(_0xb9e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9e6('0x3'))['db'];var utils=require(_0xb9e6('0x4'));var logger=require(_0xb9e6('0x5'))(_0xb9e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9e6('0x7'));var client=jayson[_0xb9e6('0x8')][_0xb9e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bb674,_0x2cbcf7,_0x49565c){return new BPromise(function(_0x5a54db,_0x4cc018){return client[_0xb9e6('0xa')](_0x4bb674,_0x49565c)['then'](function(_0x378e17){logger[_0xb9e6('0xb')](_0xb9e6('0xc'),_0x2cbcf7,_0xb9e6('0xd'));logger[_0xb9e6('0xe')](_0xb9e6('0xf'),_0x2cbcf7,_0xb9e6('0xd'),JSON[_0xb9e6('0x10')](_0x378e17));if(_0x378e17[_0xb9e6('0x11')]){if(_0x378e17[_0xb9e6('0x11')]['code']===0x1f4){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);return _0x4cc018(_0x378e17['error'][_0xb9e6('0x12')]);}logger[_0xb9e6('0x11')]('VoiceContext,\x20%s,\x20%s',_0x2cbcf7,_0x378e17['error'][_0xb9e6('0x12')]);return _0x5a54db(_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);}else{logger[_0xb9e6('0xb')]('VoiceContext,\x20%s,\x20%s',_0x2cbcf7,_0xb9e6('0xd'));_0x5a54db(_0x378e17[_0xb9e6('0x13')][_0xb9e6('0x12')]);}})[_0xb9e6('0x14')](function(_0x15aa3d){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x15aa3d);_0x4cc018(_0x15aa3d);});});} \ No newline at end of file +var _0xd027=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d02('0x1'));var fs=require('fs');var Redis=require(_0x7d02('0x2'));var db=require(_0x7d02('0x3'))['db'];var utils=require(_0x7d02('0x4'));var logger=require(_0x7d02('0x5'))(_0x7d02('0x6'));var config=require(_0x7d02('0x7'));var jayson=require(_0x7d02('0x8'));var client=jayson['client'][_0x7d02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a3b4,_0x2f59e2,_0x4442c5){return new BPromise(function(_0x10647b,_0x310426){return client[_0x7d02('0xa')](_0x19a3b4,_0x4442c5)[_0x7d02('0xb')](function(_0x10af16){logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,_0x7d02('0xe'));logger[_0x7d02('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2f59e2,_0x7d02('0xe'),JSON[_0x7d02('0x10')](_0x10af16));if(_0x10af16['error']){if(_0x10af16[_0x7d02('0x11')][_0x7d02('0x12')]===0x1f4){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x10af16['error'][_0x7d02('0x13')]);return _0x310426(_0x10af16['error'][_0x7d02('0x13')]);}logger[_0x7d02('0x11')]('VoiceContext,\x20%s,\x20%s',_0x2f59e2,_0x10af16[_0x7d02('0x11')][_0x7d02('0x13')]);return _0x10647b(_0x10af16['error'][_0x7d02('0x13')]);}else{logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,'request\x20sent');_0x10647b(_0x10af16[_0x7d02('0x14')][_0x7d02('0x13')]);}})[_0x7d02('0x15')](function(_0x2017f0){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x2017f0);_0x310426(_0x2017f0);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e59eb4b..64e188a 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 _0x4d53=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x7085dc,_0x5e16de){var _0x5b9862=function(_0x3a2ee3){while(--_0x3a2ee3){_0x7085dc['push'](_0x7085dc['shift']());}};_0x5b9862(++_0x5e16de);}(_0x4d53,0x1e3));var _0x34d5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4d53[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require(_0x34d5('0x0'));var path=require(_0x34d5('0x1'));var timeout=require(_0x34d5('0x2'));var express=require(_0x34d5('0x3'));var router=express[_0x34d5('0x4')]();var fs_extra=require(_0x34d5('0x5'));var auth=require(_0x34d5('0x6'));var interaction=require(_0x34d5('0x7'));var config=require(_0x34d5('0x8'));var controller=require(_0x34d5('0x9'));router['get']('/',auth[_0x34d5('0xa')](),controller[_0x34d5('0xb')]);router[_0x34d5('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x34d5('0xd')]);router[_0x34d5('0xc')](_0x34d5('0xe'),auth[_0x34d5('0xa')](),controller[_0x34d5('0xf')]);router[_0x34d5('0x10')]('/',auth['isAuthenticated'](),controller[_0x34d5('0x11')]);router[_0x34d5('0x12')](_0x34d5('0xe'),auth[_0x34d5('0xa')](),controller[_0x34d5('0x13')]);router[_0x34d5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x34d5('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe26e=['/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','multer','path','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x25a3fc,_0x29855c){var _0x13891f=function(_0x2c28c0){while(--_0x2c28c0){_0x25a3fc['push'](_0x25a3fc['shift']());}};_0x13891f(++_0x29855c);}(_0xe26e,0x1e9));var _0xee26=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe26e[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xee26('0x0'));var util=require('util');var path=require(_0xee26('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xee26('0x2'));var config=require(_0xee26('0x3'));var controller=require(_0xee26('0x4'));router[_0xee26('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee26('0x5')](_0xee26('0x6'),auth[_0xee26('0x7')](),controller[_0xee26('0x8')]);router[_0xee26('0x5')](_0xee26('0x9'),auth[_0xee26('0x7')](),controller[_0xee26('0xa')]);router[_0xee26('0xb')]('/',auth[_0xee26('0x7')](),controller['create']);router[_0xee26('0xc')](_0xee26('0x9'),auth[_0xee26('0x7')](),controller[_0xee26('0xd')]);router['delete'](_0xee26('0x9'),auth['isAuthenticated'](),controller[_0xee26('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8b4711e..7eee771 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 _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0xa0d6e8,_0x41e320){var _0x4ba300=function(_0x5ad796){while(--_0x5ad796){_0xa0d6e8['push'](_0xa0d6e8['shift']());}};_0x4ba300(++_0x41e320);}(_0x84ab,0x12f));var _0xb84a=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x84ab[_0x188d31];return _0x30ed33;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x46071e,_0x5d24dd){var _0x1bc841=function(_0x5d6435){while(--_0x5d6435){_0x46071e['push'](_0x46071e['shift']());}};_0x1bc841(++_0x5d24dd);}(_0xedd9,0xfc));var _0x9edd=function(_0x29ecfd,_0x37c8a8){_0x29ecfd=_0x29ecfd-0x0;var _0x1211de=_0xedd9[_0x29ecfd];return _0x1211de;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 52afa12..c50b897 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 _0xf1fd=['findAll','rows','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','name','send','index','map','VoiceDialReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0xf1fd,0xe7));var _0xdf1f=function(_0x185a4f,_0x3c5d5c){_0x185a4f=_0x185a4f-0x0;var _0x3dd3ab=_0xf1fd[_0x185a4f];return _0x3dd3ab;};'use strict';var emlformat=require(_0xdf1f('0x0'));var rimraf=require(_0xdf1f('0x1'));var zipdir=require(_0xdf1f('0x2'));var jsonpatch=require(_0xdf1f('0x3'));var rp=require(_0xdf1f('0x4'));var moment=require(_0xdf1f('0x5'));var BPromise=require(_0xdf1f('0x6'));var Mustache=require(_0xdf1f('0x7'));var util=require('util');var path=require(_0xdf1f('0x8'));var sox=require(_0xdf1f('0x9'));var csv=require(_0xdf1f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf1f('0xb'));var _=require(_0xdf1f('0xc'));var squel=require(_0xdf1f('0xd'));var crypto=require(_0xdf1f('0xe'));var jsforce=require(_0xdf1f('0xf'));var deskjs=require(_0xdf1f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xdf1f('0x11'));var Papa=require(_0xdf1f('0x12'));var Redis=require(_0xdf1f('0x13'));var authService=require(_0xdf1f('0x14'));var qs=require(_0xdf1f('0x15'));var as=require(_0xdf1f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf1f('0x17'))('api');var utils=require(_0xdf1f('0x18'));var config=require(_0xdf1f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf1f('0x1a'))['db'];function respondWithStatusCode(_0x28bc7a,_0x2a5f14){_0x2a5f14=_0x2a5f14||0xcc;return function(_0x7e26a8){if(_0x7e26a8){return _0x28bc7a['sendStatus'](_0x2a5f14);}return _0x28bc7a[_0xdf1f('0x1b')](_0x2a5f14)[_0xdf1f('0x1c')]();};}function respondWithResult(_0x5e70bb,_0x12d636){_0x12d636=_0x12d636||0xc8;return function(_0x137fdb){if(_0x137fdb){return _0x5e70bb[_0xdf1f('0x1b')](_0x12d636)['json'](_0x137fdb);}};}function respondWithFilteredResult(_0x5576ef,_0x2a5a59){return function(_0x339453){if(_0x339453){var _0x4aa08f=typeof _0x2a5a59['offset']===_0xdf1f('0x1d')&&typeof _0x2a5a59[_0xdf1f('0x1e')]===_0xdf1f('0x1d');var _0x1624a8=_0x339453[_0xdf1f('0x1f')];var _0x22483c=_0x4aa08f?0x0:_0x2a5a59['offset'];var _0x5372d7=_0x4aa08f?_0x339453[_0xdf1f('0x1f')]:_0x2a5a59[_0xdf1f('0x20')]+_0x2a5a59[_0xdf1f('0x1e')];var _0xe345f;if(_0x5372d7>=_0x1624a8){_0x5372d7=_0x1624a8;_0xe345f=0xc8;}else{_0xe345f=0xce;}_0x5576ef['status'](_0xe345f);return _0x5576ef[_0xdf1f('0x21')](_0xdf1f('0x22'),_0x22483c+'-'+_0x5372d7+'/'+_0x1624a8)['json'](_0x339453);}return null;};}function patchUpdates(_0x43ff85){return function(_0x39ef7b){try{jsonpatch[_0xdf1f('0x23')](_0x39ef7b,_0x43ff85,!![]);}catch(_0x396036){return BPromise['reject'](_0x396036);}return _0x39ef7b['save']();};}function saveUpdates(_0x38282b,_0x43d90c){return function(_0x273cba){if(_0x273cba){return _0x273cba[_0xdf1f('0x24')](_0x38282b)[_0xdf1f('0x25')](function(_0x11f195){return _0x11f195;});}return null;};}function removeEntity(_0x41e804,_0x13b9c8){return function(_0x44c014){if(_0x44c014){return _0x44c014[_0xdf1f('0x26')]()[_0xdf1f('0x25')](function(){_0x41e804[_0xdf1f('0x1b')](0xcc)[_0xdf1f('0x1c')]();});}};}function handleEntityNotFound(_0x275351,_0x158500){return function(_0x231329){if(!_0x231329){_0x275351['sendStatus'](0x194);}return _0x231329;};}function handleError(_0x1936a7,_0x261da2){_0x261da2=_0x261da2||0x1f4;return function(_0x5d77aa){logger['error'](_0x5d77aa['stack']);if(_0x5d77aa[_0xdf1f('0x27')]){delete _0x5d77aa['name'];}_0x1936a7[_0xdf1f('0x1b')](_0x261da2)[_0xdf1f('0x28')](_0x5d77aa);};}exports[_0xdf1f('0x29')]=function(_0x16482d,_0x2508ee){var _0x23f70d={},_0x1e71c5={},_0x26faf9={'count':0x0,'rows':[]};var _0x41ff44=_[_0xdf1f('0x2a')](db[_0xdf1f('0x2b')][_0xdf1f('0x2c')],function(_0x5dd1d4){return{'name':_0x5dd1d4['fieldName'],'type':_0x5dd1d4['type'][_0xdf1f('0x2d')]};});_0x1e71c5[_0xdf1f('0x2e')]=_[_0xdf1f('0x2a')](_0x41ff44,_0xdf1f('0x27'));_0x1e71c5[_0xdf1f('0x2f')]=_[_0xdf1f('0x30')](_0x16482d[_0xdf1f('0x2f')]);_0x1e71c5[_0xdf1f('0x31')]=_[_0xdf1f('0x32')](_0x1e71c5[_0xdf1f('0x2e')],_0x1e71c5[_0xdf1f('0x2f')]);_0x23f70d['attributes']=_[_0xdf1f('0x32')](_0x1e71c5[_0xdf1f('0x2e')],qs[_0xdf1f('0x33')](_0x16482d[_0xdf1f('0x2f')][_0xdf1f('0x33')]));_0x23f70d['attributes']=_0x23f70d[_0xdf1f('0x34')][_0xdf1f('0x35')]?_0x23f70d[_0xdf1f('0x34')]:_0x1e71c5[_0xdf1f('0x2e')];if(!_0x16482d[_0xdf1f('0x2f')][_0xdf1f('0x36')](_0xdf1f('0x37'))){_0x23f70d[_0xdf1f('0x1e')]=qs[_0xdf1f('0x1e')](_0x16482d[_0xdf1f('0x2f')]['limit']);_0x23f70d[_0xdf1f('0x20')]=qs[_0xdf1f('0x20')](_0x16482d[_0xdf1f('0x2f')]['offset']);}_0x23f70d[_0xdf1f('0x38')]=qs['sort'](_0x16482d['query']['sort']);_0x23f70d[_0xdf1f('0x39')]=qs[_0xdf1f('0x31')](_[_0xdf1f('0x3a')](_0x16482d[_0xdf1f('0x2f')],_0x1e71c5[_0xdf1f('0x31')]),_0x41ff44);if(_0x16482d[_0xdf1f('0x2f')][_0xdf1f('0x3b')]){_0x23f70d['where']=_[_0xdf1f('0x3c')](_0x23f70d[_0xdf1f('0x39')],{'$or':_[_0xdf1f('0x2a')](_0x41ff44,function(_0x4cdd05){if(_0x4cdd05['type']!=='VIRTUAL'){var _0x40c08e={};_0x40c08e[_0x4cdd05[_0xdf1f('0x27')]]={'$like':'%'+_0x16482d[_0xdf1f('0x2f')][_0xdf1f('0x3b')]+'%'};return _0x40c08e;}})});}_0x23f70d=_[_0xdf1f('0x3c')]({},_0x23f70d,_0x16482d['options']);var _0x4d4ef5={'where':_0x23f70d['where']};return db[_0xdf1f('0x2b')]['count'](_0x4d4ef5)[_0xdf1f('0x25')](function(_0x47ebed){_0x26faf9[_0xdf1f('0x1f')]=_0x47ebed;if(_0x16482d[_0xdf1f('0x2f')]['includeAll']){_0x23f70d['include']=[{'all':!![]}];}return db[_0xdf1f('0x2b')][_0xdf1f('0x3d')](_0x23f70d);})[_0xdf1f('0x25')](function(_0x201e5d){_0x26faf9[_0xdf1f('0x3e')]=_0x201e5d;return _0x26faf9;})['then'](respondWithFilteredResult(_0x2508ee,_0x23f70d))[_0xdf1f('0x3f')](handleError(_0x2508ee,null));};exports[_0xdf1f('0x40')]=function(_0x3bac7d,_0x351e3f){var _0x507cdb={'raw':!![],'where':{'id':_0x3bac7d[_0xdf1f('0x41')]['id']}},_0x999adb={};_0x999adb[_0xdf1f('0x2e')]=_[_0xdf1f('0x30')](db[_0xdf1f('0x2b')]['rawAttributes']);_0x999adb[_0xdf1f('0x2f')]=_[_0xdf1f('0x30')](_0x3bac7d[_0xdf1f('0x2f')]);_0x999adb[_0xdf1f('0x31')]=_[_0xdf1f('0x32')](_0x999adb[_0xdf1f('0x2e')],_0x999adb[_0xdf1f('0x2f')]);_0x507cdb[_0xdf1f('0x34')]=_['intersection'](_0x999adb['model'],qs[_0xdf1f('0x33')](_0x3bac7d[_0xdf1f('0x2f')]['fields']));_0x507cdb[_0xdf1f('0x34')]=_0x507cdb[_0xdf1f('0x34')][_0xdf1f('0x35')]?_0x507cdb[_0xdf1f('0x34')]:_0x999adb[_0xdf1f('0x2e')];if(_0x3bac7d[_0xdf1f('0x2f')][_0xdf1f('0x42')]){_0x507cdb[_0xdf1f('0x43')]=[{'all':!![]}];}_0x507cdb=_[_0xdf1f('0x3c')]({},_0x507cdb,_0x3bac7d[_0xdf1f('0x44')]);return db[_0xdf1f('0x2b')][_0xdf1f('0x45')](_0x507cdb)[_0xdf1f('0x25')](handleEntityNotFound(_0x351e3f,null))[_0xdf1f('0x25')](respondWithResult(_0x351e3f,null))[_0xdf1f('0x3f')](handleError(_0x351e3f,null));};exports['create']=function(_0x5e90cc,_0x1dd061){return db['VoiceDialReport'][_0xdf1f('0x46')](_0x5e90cc[_0xdf1f('0x47')],{})[_0xdf1f('0x25')](respondWithResult(_0x1dd061,0xc9))['catch'](handleError(_0x1dd061,null));};exports[_0xdf1f('0x24')]=function(_0x49fc8e,_0x4e0b36){if(_0x49fc8e['body']['id']){delete _0x49fc8e['body']['id'];}return db['VoiceDialReport'][_0xdf1f('0x45')]({'where':{'id':_0x49fc8e[_0xdf1f('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e0b36,null))[_0xdf1f('0x25')](saveUpdates(_0x49fc8e[_0xdf1f('0x47')],null))[_0xdf1f('0x25')](respondWithResult(_0x4e0b36,null))['catch'](handleError(_0x4e0b36,null));};exports[_0xdf1f('0x26')]=function(_0x189553,_0x3b33da){return db['VoiceDialReport']['find']({'where':{'id':_0x189553[_0xdf1f('0x41')]['id']}})[_0xdf1f('0x25')](handleEntityNotFound(_0x3b33da,null))[_0xdf1f('0x25')](removeEntity(_0x3b33da,null))['catch'](handleError(_0x3b33da,null));};exports['describe']=function(_0x51f28c,_0x5d141e){return db[_0xdf1f('0x2b')][_0xdf1f('0x48')]()[_0xdf1f('0x25')](respondWithResult(_0x5d141e,null))[_0xdf1f('0x3f')](handleError(_0x5d141e,null));}; \ No newline at end of file +var _0x2308=['desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','fields','options','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce'];(function(_0x40a5c7,_0x3ad2dc){var _0x235627=function(_0x370e44){while(--_0x370e44){_0x40a5c7['push'](_0x40a5c7['shift']());}};_0x235627(++_0x3ad2dc);}(_0x2308,0x1bb));var _0x8230=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x2308[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x8230('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8230('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8230('0x2'));var moment=require(_0x8230('0x3'));var BPromise=require(_0x8230('0x4'));var Mustache=require(_0x8230('0x5'));var util=require(_0x8230('0x6'));var path=require(_0x8230('0x7'));var sox=require(_0x8230('0x8'));var csv=require(_0x8230('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8230('0xa'));var squel=require('squel');var crypto=require(_0x8230('0xb'));var jsforce=require(_0x8230('0xc'));var deskjs=require(_0x8230('0xd'));var toCsv=require(_0x8230('0x9'));var querystring=require('querystring');var Papa=require(_0x8230('0xe'));var Redis=require('ioredis');var authService=require(_0x8230('0xf'));var qs=require(_0x8230('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8230('0x11'));var utils=require(_0x8230('0x12'));var config=require(_0x8230('0x13'));var licenseUtil=require(_0x8230('0x14'));var db=require(_0x8230('0x15'))['db'];function respondWithStatusCode(_0x3c4568,_0x3bd60a){_0x3bd60a=_0x3bd60a||0xcc;return function(_0x498828){if(_0x498828){return _0x3c4568[_0x8230('0x16')](_0x3bd60a);}return _0x3c4568[_0x8230('0x17')](_0x3bd60a)[_0x8230('0x18')]();};}function respondWithResult(_0x56895a,_0x5b17b1){_0x5b17b1=_0x5b17b1||0xc8;return function(_0x81f26e){if(_0x81f26e){return _0x56895a['status'](_0x5b17b1)[_0x8230('0x19')](_0x81f26e);}};}function respondWithFilteredResult(_0x513c99,_0x34f939){return function(_0x1407b9){if(_0x1407b9){var _0x311239=typeof _0x34f939[_0x8230('0x1a')]===_0x8230('0x1b')&&typeof _0x34f939[_0x8230('0x1c')]===_0x8230('0x1b');var _0xfe7cf4=_0x1407b9[_0x8230('0x1d')];var _0x50d8bd=_0x311239?0x0:_0x34f939[_0x8230('0x1a')];var _0x328be2=_0x311239?_0x1407b9['count']:_0x34f939[_0x8230('0x1a')]+_0x34f939[_0x8230('0x1c')];var _0x1cf5d3;if(_0x328be2>=_0xfe7cf4){_0x328be2=_0xfe7cf4;_0x1cf5d3=0xc8;}else{_0x1cf5d3=0xce;}_0x513c99[_0x8230('0x17')](_0x1cf5d3);return _0x513c99[_0x8230('0x1e')]('Content-Range',_0x50d8bd+'-'+_0x328be2+'/'+_0xfe7cf4)[_0x8230('0x19')](_0x1407b9);}return null;};}function patchUpdates(_0x3de022){return function(_0x6b14f8){try{jsonpatch['apply'](_0x6b14f8,_0x3de022,!![]);}catch(_0x3de91f){return BPromise[_0x8230('0x1f')](_0x3de91f);}return _0x6b14f8[_0x8230('0x20')]();};}function saveUpdates(_0x596fbc,_0x303582){return function(_0x5b9892){if(_0x5b9892){return _0x5b9892[_0x8230('0x21')](_0x596fbc)[_0x8230('0x22')](function(_0x30f680){return _0x30f680;});}return null;};}function removeEntity(_0x385e92,_0x48b205){return function(_0x3361ea){if(_0x3361ea){return _0x3361ea[_0x8230('0x23')]()[_0x8230('0x22')](function(){_0x385e92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42eaf1,_0x31166e){return function(_0x2124f1){if(!_0x2124f1){_0x42eaf1['sendStatus'](0x194);}return _0x2124f1;};}function handleError(_0x481fc4,_0x5522c9){_0x5522c9=_0x5522c9||0x1f4;return function(_0x468fbb){logger[_0x8230('0x24')](_0x468fbb[_0x8230('0x25')]);if(_0x468fbb[_0x8230('0x26')]){delete _0x468fbb[_0x8230('0x26')];}_0x481fc4[_0x8230('0x17')](_0x5522c9)[_0x8230('0x27')](_0x468fbb);};}exports[_0x8230('0x28')]=function(_0x411188,_0x8805bd){var _0x47d5cf={},_0x3c39c5={},_0x56b03b={'count':0x0,'rows':[]};var _0x1b6b46=_[_0x8230('0x29')](db[_0x8230('0x2a')][_0x8230('0x2b')],function(_0x461ff4){return{'name':_0x461ff4[_0x8230('0x2c')],'type':_0x461ff4[_0x8230('0x2d')][_0x8230('0x2e')]};});_0x3c39c5[_0x8230('0x2f')]=_[_0x8230('0x29')](_0x1b6b46,_0x8230('0x26'));_0x3c39c5[_0x8230('0x30')]=_[_0x8230('0x31')](_0x411188[_0x8230('0x30')]);_0x3c39c5[_0x8230('0x32')]=_[_0x8230('0x33')](_0x3c39c5[_0x8230('0x2f')],_0x3c39c5[_0x8230('0x30')]);_0x47d5cf[_0x8230('0x34')]=_[_0x8230('0x33')](_0x3c39c5['model'],qs['fields'](_0x411188['query']['fields']));_0x47d5cf[_0x8230('0x34')]=_0x47d5cf[_0x8230('0x34')][_0x8230('0x35')]?_0x47d5cf[_0x8230('0x34')]:_0x3c39c5[_0x8230('0x2f')];if(!_0x411188[_0x8230('0x30')][_0x8230('0x36')](_0x8230('0x37'))){_0x47d5cf[_0x8230('0x1c')]=qs['limit'](_0x411188[_0x8230('0x30')][_0x8230('0x1c')]);_0x47d5cf[_0x8230('0x1a')]=qs[_0x8230('0x1a')](_0x411188['query']['offset']);}_0x47d5cf[_0x8230('0x38')]=qs[_0x8230('0x39')](_0x411188[_0x8230('0x30')][_0x8230('0x39')]);_0x47d5cf[_0x8230('0x3a')]=qs['filters'](_[_0x8230('0x3b')](_0x411188[_0x8230('0x30')],_0x3c39c5['filters']),_0x1b6b46);if(_0x411188[_0x8230('0x30')]['filter']){_0x47d5cf[_0x8230('0x3a')]=_[_0x8230('0x3c')](_0x47d5cf[_0x8230('0x3a')],{'$or':_[_0x8230('0x29')](_0x1b6b46,function(_0x5b5103){if(_0x5b5103[_0x8230('0x2d')]!==_0x8230('0x3d')){var _0x284e42={};_0x284e42[_0x5b5103[_0x8230('0x26')]]={'$like':'%'+_0x411188[_0x8230('0x30')][_0x8230('0x3e')]+'%'};return _0x284e42;}})});}_0x47d5cf=_[_0x8230('0x3c')]({},_0x47d5cf,_0x411188['options']);var _0x27781f={'where':_0x47d5cf[_0x8230('0x3a')]};return db[_0x8230('0x2a')][_0x8230('0x1d')](_0x27781f)[_0x8230('0x22')](function(_0x483896){_0x56b03b[_0x8230('0x1d')]=_0x483896;if(_0x411188[_0x8230('0x30')][_0x8230('0x3f')]){_0x47d5cf[_0x8230('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x8230('0x41')](_0x47d5cf);})[_0x8230('0x22')](function(_0x10605a){_0x56b03b[_0x8230('0x42')]=_0x10605a;return _0x56b03b;})['then'](respondWithFilteredResult(_0x8805bd,_0x47d5cf))[_0x8230('0x43')](handleError(_0x8805bd,null));};exports[_0x8230('0x44')]=function(_0x2a9b90,_0x34b4f7){var _0x5721c6={'raw':!![],'where':{'id':_0x2a9b90[_0x8230('0x45')]['id']}},_0x1c54b8={};_0x1c54b8['model']=_[_0x8230('0x31')](db['VoiceDialReport'][_0x8230('0x2b')]);_0x1c54b8[_0x8230('0x30')]=_[_0x8230('0x31')](_0x2a9b90[_0x8230('0x30')]);_0x1c54b8[_0x8230('0x32')]=_['intersection'](_0x1c54b8['model'],_0x1c54b8[_0x8230('0x30')]);_0x5721c6[_0x8230('0x34')]=_[_0x8230('0x33')](_0x1c54b8[_0x8230('0x2f')],qs[_0x8230('0x46')](_0x2a9b90[_0x8230('0x30')]['fields']));_0x5721c6[_0x8230('0x34')]=_0x5721c6['attributes'][_0x8230('0x35')]?_0x5721c6[_0x8230('0x34')]:_0x1c54b8[_0x8230('0x2f')];if(_0x2a9b90[_0x8230('0x30')][_0x8230('0x3f')]){_0x5721c6[_0x8230('0x40')]=[{'all':!![]}];}_0x5721c6=_['merge']({},_0x5721c6,_0x2a9b90[_0x8230('0x47')]);return db[_0x8230('0x2a')]['find'](_0x5721c6)[_0x8230('0x22')](handleEntityNotFound(_0x34b4f7,null))['then'](respondWithResult(_0x34b4f7,null))['catch'](handleError(_0x34b4f7,null));};exports[_0x8230('0x48')]=function(_0x4c456e,_0x321f99){return db[_0x8230('0x2a')][_0x8230('0x48')](_0x4c456e[_0x8230('0x49')],{})['then'](respondWithResult(_0x321f99,0xc9))[_0x8230('0x43')](handleError(_0x321f99,null));};exports[_0x8230('0x21')]=function(_0x3f2930,_0x772222){if(_0x3f2930[_0x8230('0x49')]['id']){delete _0x3f2930[_0x8230('0x49')]['id'];}return db['VoiceDialReport'][_0x8230('0x4a')]({'where':{'id':_0x3f2930[_0x8230('0x45')]['id']}})[_0x8230('0x22')](handleEntityNotFound(_0x772222,null))[_0x8230('0x22')](saveUpdates(_0x3f2930[_0x8230('0x49')],null))[_0x8230('0x22')](respondWithResult(_0x772222,null))[_0x8230('0x43')](handleError(_0x772222,null));};exports[_0x8230('0x23')]=function(_0x30f439,_0x323291){return db[_0x8230('0x2a')][_0x8230('0x4a')]({'where':{'id':_0x30f439[_0x8230('0x45')]['id']}})[_0x8230('0x22')](handleEntityNotFound(_0x323291,null))['then'](removeEntity(_0x323291,null))[_0x8230('0x43')](handleError(_0x323291,null));};exports[_0x8230('0x4b')]=function(_0x3ce381,_0x5a8733){return db[_0x8230('0x2a')]['describe']()[_0x8230('0x22')](respondWithResult(_0x5a8733,null))[_0x8230('0x43')](handleError(_0x5a8733,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index eddca98..937f177 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 _0x465b=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x5a3803,_0x1c9b95){var _0x4b5615=function(_0x314be5){while(--_0x314be5){_0x5a3803['push'](_0x5a3803['shift']());}};_0x4b5615(++_0x1c9b95);}(_0x465b,0x1dc));var _0xb465=function(_0x3be442,_0x3e5a61){_0x3be442=_0x3be442-0x0;var _0x3860b9=_0x465b[_0x3be442];return _0x3860b9;};'use strict';var _=require(_0xb465('0x0'));var util=require(_0xb465('0x1'));var logger=require('../../config/logger')(_0xb465('0x2'));var moment=require(_0xb465('0x3'));var BPromise=require(_0xb465('0x4'));var rp=require(_0xb465('0x5'));var fs=require('fs');var path=require(_0xb465('0x6'));var rimraf=require('rimraf');var config=require(_0xb465('0x7'));var attributes=require(_0xb465('0x8'));module[_0xb465('0x9')]=function(_0x96948b,_0x48c5f5){return _0x96948b[_0xb465('0xa')](_0xb465('0xb'),attributes,{'tableName':_0xb465('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb465('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c29=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','moment','bluebird','request-promise'];(function(_0x3b4d87,_0x54936a){var _0x4974b7=function(_0x3162fb){while(--_0x3162fb){_0x3b4d87['push'](_0x3b4d87['shift']());}};_0x4974b7(++_0x54936a);}(_0x0c29,0xb7));var _0x90c2=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x0c29[_0x13b7fd];return _0x32a74a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90c2('0x0'))('api');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rp=require(_0x90c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x90c2('0x4'));var attributes=require(_0x90c2('0x5'));module[_0x90c2('0x6')]=function(_0x1aa5a4,_0xfbe17b){return _0x1aa5a4[_0x90c2('0x7')](_0x90c2('0x8'),attributes,{'tableName':_0x90c2('0x9'),'paranoid':![],'indexes':[{'fields':[_0x90c2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2b5dcd1..a311cf4 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 _0xa9ea=['bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','attributes','limit','lodash','util','moment'];(function(_0x52ab01,_0x2fee0e){var _0x38c386=function(_0x38bd3a){while(--_0x38bd3a){_0x52ab01['push'](_0x52ab01['shift']());}};_0x38c386(++_0x2fee0e);}(_0xa9ea,0x1dd));var _0xaa9e=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0xa9ea[_0x1e830c];return _0x3196e9;};'use strict';var _=require(_0xaa9e('0x0'));var util=require(_0xaa9e('0x1'));var moment=require(_0xaa9e('0x2'));var BPromise=require(_0xaa9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa9e('0x4'));var logger=require('../../config/logger')(_0xaa9e('0x5'));var config=require(_0xaa9e('0x6'));var jayson=require(_0xaa9e('0x7'));var client=jayson[_0xaa9e('0x8')][_0xaa9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1965d1,_0x4914d7,_0x223f43){return new BPromise(function(_0x3c80d2,_0x5ba466){return client[_0xaa9e('0xa')](_0x1965d1,_0x223f43)[_0xaa9e('0xb')](function(_0x4213bf){logger[_0xaa9e('0xc')](_0xaa9e('0xd'),_0x4914d7,'request\x20sent');logger['debug'](_0xaa9e('0xe'),_0x4914d7,_0xaa9e('0xf'),JSON[_0xaa9e('0x10')](_0x4213bf));if(_0x4213bf[_0xaa9e('0x11')]){if(_0x4213bf[_0xaa9e('0x11')][_0xaa9e('0x12')]===0x1f4){logger['error'](_0xaa9e('0xd'),_0x4914d7,_0x4213bf['error']['message']);return _0x5ba466(_0x4213bf[_0xaa9e('0x11')][_0xaa9e('0x13')]);}logger['error'](_0xaa9e('0xd'),_0x4914d7,_0x4213bf['error']['message']);return _0x3c80d2(_0x4213bf[_0xaa9e('0x11')][_0xaa9e('0x13')]);}else{logger[_0xaa9e('0xc')](_0xaa9e('0xd'),_0x4914d7,_0xaa9e('0xf'));_0x3c80d2(_0x4213bf[_0xaa9e('0x14')][_0xaa9e('0x13')]);}})[_0xaa9e('0x15')](function(_0x9bd85e){logger[_0xaa9e('0x11')](_0xaa9e('0xd'),_0x4914d7,_0x9bd85e);_0x5ba466(_0x9bd85e);});});}exports[_0xaa9e('0x16')]=function(_0xcc6dd2){var _0x357241=this;return new Promise(function(_0x170fb4,_0x258f23){return db[_0xaa9e('0x17')][_0xaa9e('0x18')](_0xcc6dd2[_0xaa9e('0x19')],{'raw':_0xcc6dd2[_0xaa9e('0x1a')]?_0xcc6dd2[_0xaa9e('0x1a')][_0xaa9e('0x1b')]===undefined?!![]:![]:!![]})[_0xaa9e('0xb')](function(_0x3154f5){logger['info']('CreateVoiceDialReport',_0xcc6dd2);logger[_0xaa9e('0x1c')](_0xaa9e('0x16'),_0xcc6dd2,JSON[_0xaa9e('0x10')](_0x3154f5));_0x170fb4(_0x3154f5);})[_0xaa9e('0x15')](function(_0x415e33){logger[_0xaa9e('0x11')]('CreateVoiceDialReport',_0x415e33['message'],_0xcc6dd2);_0x258f23(_0x357241[_0xaa9e('0x11')](0x1f4,_0x415e33[_0xaa9e('0x13')]));});});};exports[_0xaa9e('0x1d')]=function(_0x312e3b){var _0x3148fb=this;return new Promise(function(_0x538cbe,_0x6f8464){return db[_0xaa9e('0x17')]['update'](_0x312e3b[_0xaa9e('0x19')],{'raw':_0x312e3b[_0xaa9e('0x1a')]?_0x312e3b[_0xaa9e('0x1a')][_0xaa9e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x312e3b[_0xaa9e('0x1a')]?_0x312e3b['options']['where']||null:null,'attributes':_0x312e3b[_0xaa9e('0x1a')]?_0x312e3b['options'][_0xaa9e('0x1e')]||null:null,'limit':_0x312e3b[_0xaa9e('0x1a')]?_0x312e3b[_0xaa9e('0x1a')][_0xaa9e('0x1f')]||null:null})[_0xaa9e('0xb')](function(_0x4c2c04){logger[_0xaa9e('0xc')](_0xaa9e('0x1d'),_0x312e3b);logger[_0xaa9e('0x1c')](_0xaa9e('0x1d'),_0x312e3b,JSON[_0xaa9e('0x10')](_0x4c2c04));_0x538cbe(_0x4c2c04);})['catch'](function(_0x1570a3){logger[_0xaa9e('0x11')]('UpdateVoiceDialReport',_0x1570a3['message'],_0x312e3b);_0x6f8464(_0x3148fb['error'](0x1f4,_0x1570a3['message']));});});}; \ No newline at end of file +var _0xd223=['raw','where','attributes','limit','then','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','VoiceDialReport','create','body','options','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update'];(function(_0x239cfb,_0x1061fe){var _0x5667d8=function(_0x30e1d4){while(--_0x30e1d4){_0x239cfb['push'](_0x239cfb['shift']());}};_0x5667d8(++_0x1061fe);}(_0xd223,0x145));var _0x3d22=function(_0x83eb3b,_0x3c7335){_0x83eb3b=_0x83eb3b-0x0;var _0x45b45a=_0xd223[_0x83eb3b];return _0x45b45a;};'use strict';var _=require('lodash');var util=require(_0x3d22('0x0'));var moment=require(_0x3d22('0x1'));var BPromise=require(_0x3d22('0x2'));var rs=require(_0x3d22('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d22('0x4'));var logger=require(_0x3d22('0x5'))(_0x3d22('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d22('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56c24d,_0x3f3ee0,_0x19243e){return new BPromise(function(_0x43ae94,_0x1b7600){return client[_0x3d22('0x8')](_0x56c24d,_0x19243e)['then'](function(_0x55789b){logger[_0x3d22('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x3f3ee0,_0x3d22('0xa'));logger['debug'](_0x3d22('0xb'),_0x3f3ee0,'request\x20sent',JSON[_0x3d22('0xc')](_0x55789b));if(_0x55789b[_0x3d22('0xd')]){if(_0x55789b[_0x3d22('0xd')][_0x3d22('0xe')]===0x1f4){logger[_0x3d22('0xd')](_0x3d22('0xf'),_0x3f3ee0,_0x55789b[_0x3d22('0xd')][_0x3d22('0x10')]);return _0x1b7600(_0x55789b[_0x3d22('0xd')]['message']);}logger[_0x3d22('0xd')](_0x3d22('0xf'),_0x3f3ee0,_0x55789b[_0x3d22('0xd')][_0x3d22('0x10')]);return _0x43ae94(_0x55789b[_0x3d22('0xd')][_0x3d22('0x10')]);}else{logger['info'](_0x3d22('0xf'),_0x3f3ee0,_0x3d22('0xa'));_0x43ae94(_0x55789b[_0x3d22('0x11')]['message']);}})[_0x3d22('0x12')](function(_0x3d74df){logger['error'](_0x3d22('0xf'),_0x3f3ee0,_0x3d74df);_0x1b7600(_0x3d74df);});});}exports['CreateVoiceDialReport']=function(_0x1afcc8){var _0x2c092b=this;return new Promise(function(_0x24a677,_0x578ac0){return db[_0x3d22('0x13')][_0x3d22('0x14')](_0x1afcc8[_0x3d22('0x15')],{'raw':_0x1afcc8[_0x3d22('0x16')]?_0x1afcc8[_0x3d22('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x218433){logger['info'](_0x3d22('0x17'),_0x1afcc8);logger[_0x3d22('0x18')](_0x3d22('0x17'),_0x1afcc8,JSON[_0x3d22('0xc')](_0x218433));_0x24a677(_0x218433);})[_0x3d22('0x12')](function(_0x54ce46){logger[_0x3d22('0xd')](_0x3d22('0x17'),_0x54ce46[_0x3d22('0x10')],_0x1afcc8);_0x578ac0(_0x2c092b[_0x3d22('0xd')](0x1f4,_0x54ce46[_0x3d22('0x10')]));});});};exports[_0x3d22('0x19')]=function(_0x257994){var _0x4fffe9=this;return new Promise(function(_0xcbe2ac,_0x23a54f){return db['VoiceDialReport'][_0x3d22('0x1a')](_0x257994[_0x3d22('0x15')],{'raw':_0x257994[_0x3d22('0x16')]?_0x257994['options'][_0x3d22('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257994['options']?_0x257994['options'][_0x3d22('0x1c')]||null:null,'attributes':_0x257994[_0x3d22('0x16')]?_0x257994[_0x3d22('0x16')][_0x3d22('0x1d')]||null:null,'limit':_0x257994['options']?_0x257994['options'][_0x3d22('0x1e')]||null:null})[_0x3d22('0x1f')](function(_0x5d6784){logger[_0x3d22('0x9')](_0x3d22('0x19'),_0x257994);logger['debug'](_0x3d22('0x19'),_0x257994,JSON[_0x3d22('0xc')](_0x5d6784));_0xcbe2ac(_0x5d6784);})['catch'](function(_0xfa3590){logger['error'](_0x3d22('0x19'),_0xfa3590[_0x3d22('0x10')],_0x257994);_0x23a54f(_0x4fffe9['error'](0x1f4,_0xfa3590['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 410c0ff..52b8331 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 _0x21c4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','create','post','delete','exports','multer','util','path'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x21c4,0x1ad));var _0x421c=function(_0x304386,_0x319535){_0x304386=_0x304386-0x0;var _0x2696b2=_0x21c4[_0x304386];return _0x2696b2;};'use strict';var multer=require(_0x421c('0x0'));var util=require(_0x421c('0x1'));var path=require(_0x421c('0x2'));var timeout=require(_0x421c('0x3'));var express=require(_0x421c('0x4'));var router=express[_0x421c('0x5')]();var fs_extra=require(_0x421c('0x6'));var auth=require(_0x421c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x421c('0x8'));var controller=require(_0x421c('0x9'));router[_0x421c('0xa')]('/',auth[_0x421c('0xb')](),controller['index']);router[_0x421c('0xa')](_0x421c('0xc'),auth['isAuthenticated'](),controller[_0x421c('0xd')]);router['post']('/',auth[_0x421c('0xb')](),controller[_0x421c('0xe')]);router[_0x421c('0xf')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x421c('0xc'),auth[_0x421c('0xb')](),controller['update']);router[_0x421c('0x10')](_0x421c('0xc'),auth[_0x421c('0xb')](),controller['destroy']);module[_0x421c('0x11')]=router; \ No newline at end of file +var _0x79e3=['isAuthenticated','index','show','post','create','/:id/applications','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x358028,_0xdb6151){var _0x3075b0=function(_0x3e0895){while(--_0x3e0895){_0x358028['push'](_0x358028['shift']());}};_0x3075b0(++_0xdb6151);}(_0x79e3,0xd1));var _0x379e=function(_0x51ab6c,_0x1d2df8){_0x51ab6c=_0x51ab6c-0x0;var _0xa826bc=_0x79e3[_0x51ab6c];return _0xa826bc;};'use strict';var multer=require(_0x379e('0x0'));var util=require(_0x379e('0x1'));var path=require(_0x379e('0x2'));var timeout=require('connect-timeout');var express=require(_0x379e('0x3'));var router=express[_0x379e('0x4')]();var fs_extra=require(_0x379e('0x5'));var auth=require(_0x379e('0x6'));var interaction=require(_0x379e('0x7'));var config=require(_0x379e('0x8'));var controller=require(_0x379e('0x9'));router[_0x379e('0xa')]('/',auth[_0x379e('0xb')](),controller[_0x379e('0xc')]);router[_0x379e('0xa')]('/:id',auth[_0x379e('0xb')](),controller[_0x379e('0xd')]);router[_0x379e('0xe')]('/',auth[_0x379e('0xb')](),controller[_0x379e('0xf')]);router[_0x379e('0xe')](_0x379e('0x10'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x379e('0x11'),auth['isAuthenticated'](),controller[_0x379e('0x12')]);router[_0x379e('0x13')](_0x379e('0x11'),auth[_0x379e('0xb')](),controller[_0x379e('0x14')]);module[_0x379e('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 611f99a..1d38d41 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 _0xee35=['VIRTUAL','exten','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x16e97e,_0xb9f845){var _0x107434=function(_0x36ca37){while(--_0x36ca37){_0x16e97e['push'](_0x16e97e['shift']());}};_0x107434(++_0xb9f845);}(_0xee35,0x17c));var _0x5ee3=function(_0x2e10b1,_0x845b82){_0x2e10b1=_0x2e10b1-0x0;var _0x41de8b=_0xee35[_0x2e10b1];return _0x41de8b;};'use strict';var Sequelize=require('sequelize');module[_0x5ee3('0x0')]={'context':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'unique':_0x5ee3('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'unique':_0x5ee3('0x2')},'priority':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x5ee3('0x2')},'tag':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'defaultValue':_0x5ee3('0x3')},'appdata':{'type':Sequelize[_0x5ee3('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x5ee3('0x4'),_0x5ee3('0x5'),_0x5ee3('0x6'),'inbound-fax',_0x5ee3('0x7'),'system',_0x5ee3('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x5ee3('0x1')]},'interval':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':![],'defaultValue':_0x5ee3('0x9')},'IntervalId':{'type':Sequelize[_0x5ee3('0xa')]},'isApp':{'type':Sequelize[_0x5ee3('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x5ee3('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5ee3('0xa')]},'recordingFormat':{'type':Sequelize[_0x5ee3('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x5ee3('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5ee3('0xc')],'get':function(_0x43153d){return this['getDataValue'](_0x5ee3('0xd'));}},'alias':{'type':Sequelize[_0x5ee3('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xf60e=['compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','exten','sequelize','STRING'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xf60e,0xde));var _0xef60=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xf60e[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xef60('0x0'));module['exports']={'context':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'unique':_0xef60('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'unique':_0xef60('0x2')},'priority':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xef60('0x2')},'tag':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'defaultValue':_0xef60('0x3')},'appdata':{'type':Sequelize[_0xef60('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xef60('0x4')]('inbound',_0xef60('0x5'),_0xef60('0x6'),_0xef60('0x7'),'outbound-fax',_0xef60('0x8'),_0xef60('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xef60('0x1')]},'interval':{'type':Sequelize[_0xef60('0x1')],'allowNull':![],'defaultValue':_0xef60('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xef60('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xef60('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xef60('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xef60('0xc')]},'recordingFormat':{'type':Sequelize[_0xef60('0x1')],'defaultValue':_0xef60('0xd')},'answer':{'type':Sequelize[_0xef60('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xef60('0xe')],'get':function(_0x639acd){return this['getDataValue'](_0xef60('0xf'));}},'alias':{'type':Sequelize[_0xef60('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 ea8aefb..e50f66d 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 _0x611f=['findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','findAndCountAll','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','json','offset','undefined','limit','count','destroy','then','get','InboundRoutes','InternalRoutes','filter','ignore','map','value','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','outbound','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','recordingFormat','cutdigits','alias','context','addApplications'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x611f,0x1ac));var _0xf611=function(_0x4a8f4b,_0x2e5c36){_0x4a8f4b=_0x4a8f4b-0x0;var _0x58a9ef=_0x611f[_0x4a8f4b];return _0x58a9ef;};'use strict';var _=require(_0xf611('0x0'));var Redis=require('ioredis');var qs=require(_0xf611('0x1'));var logger=require(_0xf611('0x2'))(_0xf611('0x3'));var config=require('../../config/environment');var db=require(_0xf611('0x4'))['db'];config[_0xf611('0x5')]=_[_0xf611('0x6')](config['redis'],{'host':_0xf611('0x7'),'port':0x18eb});var socket=require(_0xf611('0x8'))(new Redis(config[_0xf611('0x5')]));require(_0xf611('0x9'))['register'](socket);function respondWithStatusCode(_0x16575d,_0x209fec){_0x209fec=_0x209fec||0xcc;return function(_0x2e41cf){if(_0x2e41cf){return _0x16575d[_0xf611('0xa')](_0x209fec);}return _0x16575d['status'](_0x209fec)[_0xf611('0xb')]();};}function respondWithResult(_0x39141c,_0x373cc5){_0x373cc5=_0x373cc5||0xc8;return function(_0x18cf53){if(_0x18cf53){return _0x39141c[_0xf611('0xc')](_0x373cc5)[_0xf611('0xd')](_0x18cf53);}};}function respondWithFilteredResult(_0x527612,_0x1ef261){return function(_0x3bb4fa){if(_0x3bb4fa){var _0x40cc16=typeof _0x1ef261[_0xf611('0xe')]===_0xf611('0xf')&&typeof _0x1ef261[_0xf611('0x10')]==='undefined';var _0x422cac=_0x3bb4fa[_0xf611('0x11')];var _0x5480b2=_0x40cc16?0x0:_0x1ef261[_0xf611('0xe')];var _0x1df182=_0x40cc16?_0x3bb4fa['count']:_0x1ef261[_0xf611('0xe')]+_0x1ef261[_0xf611('0x10')];var _0x2467d7;if(_0x1df182>=_0x422cac){_0x1df182=_0x422cac;_0x2467d7=0xc8;}else{_0x2467d7=0xce;}_0x527612[_0xf611('0xc')](_0x2467d7);return _0x527612['set']('Content-Range',_0x5480b2+'-'+_0x1df182+'/'+_0x422cac)[_0xf611('0xd')](_0x3bb4fa);}return null;};}function removeEntity(_0x2a450b){return function(_0x3d224a){if(_0x3d224a){return _0x3d224a[_0xf611('0x12')]()[_0xf611('0x13')](function(){var _0x329f68=_0x3d224a[_0xf611('0x14')]({'plain':!![]});var _0x3445f4=[{'name':_0xf611('0x15'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xf611('0x16'),'value':'internal','ignore':![]}];var _0x785e68=_(_0x3445f4)[_0xf611('0x17')](_0xf611('0x18'))[_0xf611('0x19')](_0xf611('0x1a'))[_0xf611('0x1a')]();if(_['includes'](_0x785e68,_0x329f68[_0xf611('0x1b')])){return;}var _0x1db3ff=_['find'](_0x3445f4,[_0xf611('0x1a'),_0x329f68[_0xf611('0x1b')]])[_0xf611('0x1c')];return db[_0xf611('0x1d')]['destroy']({'where':{'type':_0x1db3ff,'resourceId':_0x329f68['id']}})[_0xf611('0x13')](function(){return _0x3d224a;});})['then'](function(){_0x2a450b[_0xf611('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a5eb){return function(_0x23d983){if(!_0x23d983){_0x54a5eb['sendStatus'](0x194);}return _0x23d983;};}function handleError(_0x1faa3e,_0x48eb40){_0x48eb40=_0x48eb40||0x1f4;return function(_0x875790){logger[_0xf611('0x1e')](_0x875790[_0xf611('0x1f')]);if(_0x875790[_0xf611('0x1c')]){delete _0x875790[_0xf611('0x1c')];}_0x1faa3e[_0xf611('0xc')](_0x48eb40)[_0xf611('0x20')](_0x875790);};}exports[_0xf611('0x21')]=function(_0x1d18e1,_0x3b8f02){var _0x446a48={},_0x698795={},_0x1ee8a9={'count':0x0,'rows':[]};var _0x237d8e=_['map'](db[_0xf611('0x22')][_0xf611('0x23')],function(_0x5b4c57){return{'name':_0x5b4c57[_0xf611('0x24')],'type':_0x5b4c57[_0xf611('0x1b')]['key']};});_0x698795[_0xf611('0x25')]=_['map'](_0x237d8e,_0xf611('0x1c'));_0x698795[_0xf611('0x26')]=_[_0xf611('0x27')](_0x1d18e1['query']);_0x698795[_0xf611('0x28')]=_[_0xf611('0x29')](_0x698795[_0xf611('0x25')],_0x698795[_0xf611('0x26')]);_0x446a48[_0xf611('0x2a')]=_[_0xf611('0x29')](_0x698795[_0xf611('0x25')],qs[_0xf611('0x2b')](_0x1d18e1[_0xf611('0x26')]['fields']));_0x446a48['attributes']=_0x446a48[_0xf611('0x2a')][_0xf611('0x2c')]?_0x446a48[_0xf611('0x2a')]:_0x698795[_0xf611('0x25')];if(!_0x1d18e1['query'][_0xf611('0x2d')](_0xf611('0x2e'))){_0x446a48[_0xf611('0x10')]=qs[_0xf611('0x10')](_0x1d18e1[_0xf611('0x26')][_0xf611('0x10')]);_0x446a48[_0xf611('0xe')]=qs[_0xf611('0xe')](_0x1d18e1[_0xf611('0x26')][_0xf611('0xe')]);}_0x446a48['order']=qs['sort'](_0x1d18e1[_0xf611('0x26')][_0xf611('0x2f')]);_0x446a48[_0xf611('0x30')]=qs[_0xf611('0x28')](_['pick'](_0x1d18e1[_0xf611('0x26')],_0x698795['filters']),_0x237d8e);if(_0x1d18e1[_0xf611('0x26')][_0xf611('0x17')]){_0x446a48[_0xf611('0x30')]=_['merge'](_0x446a48[_0xf611('0x30')],{'$or':_[_0xf611('0x19')](_0x237d8e,function(_0x1ecac5){if(_0x1ecac5[_0xf611('0x1b')]!==_0xf611('0x31')){var _0x51f8ae={};_0x51f8ae[_0x1ecac5[_0xf611('0x1c')]]={'$like':'%'+_0x1d18e1[_0xf611('0x26')][_0xf611('0x17')]+'%'};return _0x51f8ae;}})});}_0x446a48=_['merge']({},_0x446a48,_0x1d18e1[_0xf611('0x32')]);var _0x6693d1={'where':_0x446a48[_0xf611('0x30')]};return db[_0xf611('0x22')][_0xf611('0x11')](_0x6693d1)['then'](function(_0x14da40){_0x1ee8a9[_0xf611('0x11')]=_0x14da40;if(_0x1d18e1[_0xf611('0x26')]['includeAll']){_0x446a48[_0xf611('0x33')]=[{'all':!![]}];}return db[_0xf611('0x22')][_0xf611('0x34')](_0x446a48);})[_0xf611('0x13')](function(_0x12faaf){_0x1ee8a9[_0xf611('0x35')]=_0x12faaf;return _0x1ee8a9;})[_0xf611('0x13')](respondWithFilteredResult(_0x3b8f02,_0x446a48))[_0xf611('0x36')](handleError(_0x3b8f02,null));};exports[_0xf611('0x37')]=function(_0xbc5407,_0x34d649){var _0x431330={'raw':![],'where':{'id':_0xbc5407[_0xf611('0x38')]['id']}},_0x27229e={};_0x27229e[_0xf611('0x25')]=_[_0xf611('0x27')](db[_0xf611('0x22')][_0xf611('0x23')]);_0x27229e[_0xf611('0x26')]=_['keys'](_0xbc5407['query']);_0x27229e[_0xf611('0x28')]=_[_0xf611('0x29')](_0x27229e[_0xf611('0x25')],_0x27229e['query']);_0x431330[_0xf611('0x2a')]=_[_0xf611('0x29')](_0x27229e[_0xf611('0x25')],qs[_0xf611('0x2b')](_0xbc5407[_0xf611('0x26')][_0xf611('0x2b')]));_0x431330[_0xf611('0x2a')]=_0x431330[_0xf611('0x2a')][_0xf611('0x2c')]?_0x431330['attributes']:_0x27229e[_0xf611('0x25')];if(_0xbc5407[_0xf611('0x26')]['includeAll']){_0x431330[_0xf611('0x33')]=[{'all':!![]}];}_0x431330=_['merge']({},_0x431330,_0xbc5407[_0xf611('0x32')]);return db['VoiceExtension'][_0xf611('0x39')](_0x431330)[_0xf611('0x13')](handleEntityNotFound(_0x34d649,null))[_0xf611('0x13')](respondWithResult(_0x34d649,null))[_0xf611('0x36')](handleError(_0x34d649,null));};exports[_0xf611('0x12')]=function(_0x52febb,_0x877b49){return db['VoiceExtension']['find']({'where':{'id':_0x52febb[_0xf611('0x38')]['id']}})[_0xf611('0x13')](handleEntityNotFound(_0x877b49,null))[_0xf611('0x13')](removeEntity(_0x877b49,null))[_0xf611('0x36')](handleError(_0x877b49,null));};exports[_0xf611('0x3a')]=function(_0x14a65c,_0x3311f6){if(_0x14a65c['body']['type']===_0xf611('0x3b')&&!_[_0xf611('0x3c')](_0x14a65c[_0xf611('0x3d')][_0xf611('0x3e')],'_')){_0x14a65c[_0xf611('0x3d')][_0xf611('0x3e')]='_'[_0xf611('0x3f')](_0x14a65c[_0xf611('0x3d')][_0xf611('0x3e')]);}return db[_0xf611('0x22')][_0xf611('0x3a')](_0x14a65c[_0xf611('0x3d')],{'raw':![]})[_0xf611('0x13')](function(_0x1316bc){var _0xdb7270=_0x14a65c[_0xf611('0x40')]['get']({'plain':!![]});if(!_0xdb7270)throw new Error(_0xf611('0x41'));if(_0xdb7270[_0xf611('0x42')]===_0xf611('0x40')){var _0x3bbe9b=_0x1316bc['get']({'plain':!![]});var _0x10a6df=[{'name':_0xf611('0x15'),'value':_0xf611('0x43')},{'name':'OutboundRoutes','value':_0xf611('0x3b')},{'name':_0xf611('0x16'),'value':'internal'}];var _0x3ac89d=_[_0xf611('0x39')](_0x10a6df,['value',_0x3bbe9b[_0xf611('0x1b')]])[_0xf611('0x1c')];return db[_0xf611('0x44')][_0xf611('0x39')]({'where':{'name':_0x3ac89d,'userProfileId':_0xdb7270['userProfileId']},'raw':!![]})['then'](function(_0x38c980){if(_0x38c980&&_0x38c980['autoAssociation']===0x0){return db[_0xf611('0x1d')][_0xf611('0x3a')]({'name':_0x3bbe9b[_0xf611('0x1c')],'resourceId':_0x3bbe9b['id'],'type':_0x38c980[_0xf611('0x1c')],'sectionId':_0x38c980['id']},{})[_0xf611('0x13')](function(){return _0x1316bc;});}else{return _0x1316bc;}})[_0xf611('0x36')](function(_0x151b09){logger[_0xf611('0x1e')](_0xf611('0x45'),_0x151b09);throw _0x151b09;});}return _0x1316bc;})[_0xf611('0x13')](respondWithResult(_0x3311f6,0xc9))[_0xf611('0x36')](handleError(_0x3311f6,null));};exports['update']=function(_0x56b8f4,_0x416cc9){if(_0x56b8f4[_0xf611('0x3d')]['id']){delete _0x56b8f4[_0xf611('0x3d')]['id'];}return db[_0xf611('0x22')][_0xf611('0x39')]({'where':{'id':_0x56b8f4['params']['id']}})['then'](handleEntityNotFound(_0x416cc9,null))[_0xf611('0x13')](function(_0x75643){if(_0x75643){return db[_0xf611('0x22')]['update'](_[_0xf611('0x46')](_0x56b8f4[_0xf611('0x3d')],[_0xf611('0x3e'),'context','description',_0xf611('0x47'),_0xf611('0x48'),'mandatoryDisposition',_0xf611('0x49')]),{'where':{'context':_0x75643[_0xf611('0x4a')],'exten':_0x75643[_0xf611('0x3e')]},'individualHooks':!![]})['then'](function(_0x23e093){return _0x23e093;});}return null;})[_0xf611('0x13')](respondWithStatusCode(_0x416cc9,null))[_0xf611('0x36')](handleError(_0x416cc9,null));};exports[_0xf611('0x4b')]=function(_0x105d49,_0x59cd36){return db['VoiceExtension'][_0xf611('0x4c')]({'where':{'id':_0x105d49[_0xf611('0x38')]['id']}})['then'](function(_0x1a793d){if(_0x1a793d){return db[_0xf611('0x4d')][_0xf611('0x4e')](function(_0x5d15b7){return db['VoiceExtension'][_0xf611('0x12')]({'where':{'VoiceExtensionId':_0x105d49[_0xf611('0x38')]['id']},'transaction':_0x5d15b7})['then'](function(){var _0x226b5c=_[_0xf611('0x19')](_0x105d49[_0xf611('0x3d')],function(_0x3af513){_0x3af513[_0xf611('0x4f')]=_0x105d49['params']['id'];_0x3af513[_0xf611('0x50')]=!![];return _0x3af513;});return _0x1a793d[_0xf611('0x51')](_0x226b5c);})['then'](function(_0x3dee7f){console[_0xf611('0x52')]('LOG\x20~\x20.then\x20~\x20routing',_0x3dee7f);return db[_0xf611('0x22')]['bulkCreate'](_0x3dee7f,{'transaction':_0x5d15b7});});})[_0xf611('0x13')](function(){return db['VoiceExtension'][_0xf611('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x105d49[_0xf611('0x38')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x59cd36,null))[_0xf611('0x36')](handleError(_0x59cd36,null));}; \ No newline at end of file +var _0xe3af=['include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','outbound','value','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','isApp','LOG\x20~\x20.then\x20~\x20routing','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','json','undefined','offset','count','limit','status','set','Content-Range','destroy','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','includes','type','name','UserProfileResource','then','end','error','stack','send','index','VoiceExtension','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','includeAll'];(function(_0xf5388e,_0x43269f){var _0x283c89=function(_0x3bd11a){while(--_0x3bd11a){_0xf5388e['push'](_0xf5388e['shift']());}};_0x283c89(++_0x43269f);}(_0xe3af,0x18f));var _0xfe3a=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0xe3af[_0x133851];return _0x188215;};'use strict';var _=require(_0xfe3a('0x0'));var Redis=require(_0xfe3a('0x1'));var qs=require(_0xfe3a('0x2'));var logger=require(_0xfe3a('0x3'))('api');var config=require(_0xfe3a('0x4'));var db=require(_0xfe3a('0x5'))['db'];config[_0xfe3a('0x6')]=_[_0xfe3a('0x7')](config[_0xfe3a('0x6')],{'host':_0xfe3a('0x8'),'port':0x18eb});var socket=require(_0xfe3a('0x9'))(new Redis(config[_0xfe3a('0x6')]));require(_0xfe3a('0xa'))[_0xfe3a('0xb')](socket);function respondWithStatusCode(_0x70040a,_0x2fa6ee){_0x2fa6ee=_0x2fa6ee||0xcc;return function(_0x1ba5d4){if(_0x1ba5d4){return _0x70040a[_0xfe3a('0xc')](_0x2fa6ee);}return _0x70040a['status'](_0x2fa6ee)['end']();};}function respondWithResult(_0x5f066a,_0xbfdc0a){_0xbfdc0a=_0xbfdc0a||0xc8;return function(_0x2b675c){if(_0x2b675c){return _0x5f066a['status'](_0xbfdc0a)[_0xfe3a('0xd')](_0x2b675c);}};}function respondWithFilteredResult(_0x40eae4,_0x2e8b1c){return function(_0x105a97){if(_0x105a97){var _0xeb25fe=typeof _0x2e8b1c['offset']==='undefined'&&typeof _0x2e8b1c['limit']===_0xfe3a('0xe');var _0x4cef4c=_0x105a97['count'];var _0x205994=_0xeb25fe?0x0:_0x2e8b1c[_0xfe3a('0xf')];var _0x356b5a=_0xeb25fe?_0x105a97[_0xfe3a('0x10')]:_0x2e8b1c[_0xfe3a('0xf')]+_0x2e8b1c[_0xfe3a('0x11')];var _0x3ca564;if(_0x356b5a>=_0x4cef4c){_0x356b5a=_0x4cef4c;_0x3ca564=0xc8;}else{_0x3ca564=0xce;}_0x40eae4[_0xfe3a('0x12')](_0x3ca564);return _0x40eae4[_0xfe3a('0x13')](_0xfe3a('0x14'),_0x205994+'-'+_0x356b5a+'/'+_0x4cef4c)[_0xfe3a('0xd')](_0x105a97);}return null;};}function removeEntity(_0x1cdab5){return function(_0x5562e9){if(_0x5562e9){return _0x5562e9[_0xfe3a('0x15')]()['then'](function(){var _0xc96127=_0x5562e9['get']({'plain':!![]});var _0x7ca495=[{'name':_0xfe3a('0x16'),'value':_0xfe3a('0x17'),'ignore':![]},{'name':_0xfe3a('0x18'),'value':'outbound','ignore':![]},{'name':_0xfe3a('0x19'),'value':_0xfe3a('0x1a'),'ignore':![]}];var _0x3c44dd=_(_0x7ca495)[_0xfe3a('0x1b')]('ignore')[_0xfe3a('0x1c')]('value')['value']();if(_[_0xfe3a('0x1d')](_0x3c44dd,_0xc96127[_0xfe3a('0x1e')])){return;}var _0x41c8f3=_['find'](_0x7ca495,['value',_0xc96127[_0xfe3a('0x1e')]])[_0xfe3a('0x1f')];return db[_0xfe3a('0x20')][_0xfe3a('0x15')]({'where':{'type':_0x41c8f3,'resourceId':_0xc96127['id']}})[_0xfe3a('0x21')](function(){return _0x5562e9;});})['then'](function(){_0x1cdab5[_0xfe3a('0x12')](0xcc)[_0xfe3a('0x22')]();});}};}function handleEntityNotFound(_0x5cae9d){return function(_0x4ee22a){if(!_0x4ee22a){_0x5cae9d[_0xfe3a('0xc')](0x194);}return _0x4ee22a;};}function handleError(_0x2e6db2,_0x590da2){_0x590da2=_0x590da2||0x1f4;return function(_0x2c68a2){logger[_0xfe3a('0x23')](_0x2c68a2[_0xfe3a('0x24')]);if(_0x2c68a2[_0xfe3a('0x1f')]){delete _0x2c68a2[_0xfe3a('0x1f')];}_0x2e6db2[_0xfe3a('0x12')](_0x590da2)[_0xfe3a('0x25')](_0x2c68a2);};}exports[_0xfe3a('0x26')]=function(_0x3c96df,_0x12ad7e){var _0x9fb32c={},_0x3b5d33={},_0x2a8c58={'count':0x0,'rows':[]};var _0x317a2e=_[_0xfe3a('0x1c')](db[_0xfe3a('0x27')]['rawAttributes'],function(_0x18078d){return{'name':_0x18078d['fieldName'],'type':_0x18078d[_0xfe3a('0x1e')][_0xfe3a('0x28')]};});_0x3b5d33[_0xfe3a('0x29')]=_[_0xfe3a('0x1c')](_0x317a2e,_0xfe3a('0x1f'));_0x3b5d33['query']=_['keys'](_0x3c96df[_0xfe3a('0x2a')]);_0x3b5d33[_0xfe3a('0x2b')]=_[_0xfe3a('0x2c')](_0x3b5d33[_0xfe3a('0x29')],_0x3b5d33['query']);_0x9fb32c[_0xfe3a('0x2d')]=_[_0xfe3a('0x2c')](_0x3b5d33[_0xfe3a('0x29')],qs['fields'](_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x2e')]));_0x9fb32c['attributes']=_0x9fb32c[_0xfe3a('0x2d')]['length']?_0x9fb32c['attributes']:_0x3b5d33[_0xfe3a('0x29')];if(!_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x2f')](_0xfe3a('0x30'))){_0x9fb32c[_0xfe3a('0x11')]=qs[_0xfe3a('0x11')](_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x11')]);_0x9fb32c[_0xfe3a('0xf')]=qs[_0xfe3a('0xf')](_0x3c96df[_0xfe3a('0x2a')]['offset']);}_0x9fb32c[_0xfe3a('0x31')]=qs[_0xfe3a('0x32')](_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x32')]);_0x9fb32c['where']=qs[_0xfe3a('0x2b')](_[_0xfe3a('0x33')](_0x3c96df['query'],_0x3b5d33['filters']),_0x317a2e);if(_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x1b')]){_0x9fb32c['where']=_[_0xfe3a('0x34')](_0x9fb32c[_0xfe3a('0x35')],{'$or':_[_0xfe3a('0x1c')](_0x317a2e,function(_0x4abef3){if(_0x4abef3[_0xfe3a('0x1e')]!==_0xfe3a('0x36')){var _0x4f83df={};_0x4f83df[_0x4abef3[_0xfe3a('0x1f')]]={'$like':'%'+_0x3c96df['query'][_0xfe3a('0x1b')]+'%'};return _0x4f83df;}})});}_0x9fb32c=_[_0xfe3a('0x34')]({},_0x9fb32c,_0x3c96df['options']);var _0x5aab2e={'where':_0x9fb32c[_0xfe3a('0x35')]};return db[_0xfe3a('0x27')][_0xfe3a('0x10')](_0x5aab2e)[_0xfe3a('0x21')](function(_0x1e3828){_0x2a8c58[_0xfe3a('0x10')]=_0x1e3828;if(_0x3c96df[_0xfe3a('0x2a')][_0xfe3a('0x37')]){_0x9fb32c[_0xfe3a('0x38')]=[{'all':!![]}];}return db[_0xfe3a('0x27')][_0xfe3a('0x39')](_0x9fb32c);})[_0xfe3a('0x21')](function(_0x45156e){_0x2a8c58[_0xfe3a('0x3a')]=_0x45156e;return _0x2a8c58;})[_0xfe3a('0x21')](respondWithFilteredResult(_0x12ad7e,_0x9fb32c))[_0xfe3a('0x3b')](handleError(_0x12ad7e,null));};exports[_0xfe3a('0x3c')]=function(_0x5c87f7,_0x311b01){var _0x31591b={'raw':![],'where':{'id':_0x5c87f7[_0xfe3a('0x3d')]['id']}},_0x95b802={};_0x95b802[_0xfe3a('0x29')]=_[_0xfe3a('0x3e')](db[_0xfe3a('0x27')][_0xfe3a('0x3f')]);_0x95b802[_0xfe3a('0x2a')]=_['keys'](_0x5c87f7[_0xfe3a('0x2a')]);_0x95b802['filters']=_[_0xfe3a('0x2c')](_0x95b802[_0xfe3a('0x29')],_0x95b802[_0xfe3a('0x2a')]);_0x31591b[_0xfe3a('0x2d')]=_[_0xfe3a('0x2c')](_0x95b802[_0xfe3a('0x29')],qs[_0xfe3a('0x2e')](_0x5c87f7[_0xfe3a('0x2a')]['fields']));_0x31591b['attributes']=_0x31591b[_0xfe3a('0x2d')][_0xfe3a('0x40')]?_0x31591b[_0xfe3a('0x2d')]:_0x95b802[_0xfe3a('0x29')];if(_0x5c87f7[_0xfe3a('0x2a')]['includeAll']){_0x31591b[_0xfe3a('0x38')]=[{'all':!![]}];}_0x31591b=_[_0xfe3a('0x34')]({},_0x31591b,_0x5c87f7['options']);return db[_0xfe3a('0x27')][_0xfe3a('0x41')](_0x31591b)[_0xfe3a('0x21')](handleEntityNotFound(_0x311b01,null))[_0xfe3a('0x21')](respondWithResult(_0x311b01,null))[_0xfe3a('0x3b')](handleError(_0x311b01,null));};exports[_0xfe3a('0x15')]=function(_0x374ec8,_0x17ac97){return db[_0xfe3a('0x27')]['find']({'where':{'id':_0x374ec8[_0xfe3a('0x3d')]['id']}})[_0xfe3a('0x21')](handleEntityNotFound(_0x17ac97,null))['then'](removeEntity(_0x17ac97,null))[_0xfe3a('0x3b')](handleError(_0x17ac97,null));};exports[_0xfe3a('0x42')]=function(_0x4bfd1a,_0x31fbdb){if(_0x4bfd1a['body'][_0xfe3a('0x1e')]==='outbound'&&!_['startsWith'](_0x4bfd1a[_0xfe3a('0x43')][_0xfe3a('0x44')],'_')){_0x4bfd1a[_0xfe3a('0x43')][_0xfe3a('0x44')]='_'[_0xfe3a('0x45')](_0x4bfd1a[_0xfe3a('0x43')][_0xfe3a('0x44')]);}return db['VoiceExtension']['create'](_0x4bfd1a['body'],{'raw':![]})['then'](function(_0x10bf09){var _0x21f50a=_0x4bfd1a[_0xfe3a('0x46')]['get']({'plain':!![]});if(!_0x21f50a)throw new Error(_0xfe3a('0x47'));if(_0x21f50a[_0xfe3a('0x48')]==='user'){var _0xa554a4=_0x10bf09[_0xfe3a('0x49')]({'plain':!![]});var _0x3f817c=[{'name':'InboundRoutes','value':_0xfe3a('0x17')},{'name':_0xfe3a('0x18'),'value':_0xfe3a('0x4a')},{'name':'InternalRoutes','value':_0xfe3a('0x1a')}];var _0x2927da=_[_0xfe3a('0x41')](_0x3f817c,[_0xfe3a('0x4b'),_0xa554a4[_0xfe3a('0x1e')]])['name'];return db[_0xfe3a('0x4c')][_0xfe3a('0x41')]({'where':{'name':_0x2927da,'userProfileId':_0x21f50a[_0xfe3a('0x4d')]},'raw':!![]})['then'](function(_0x55ff18){if(_0x55ff18&&_0x55ff18[_0xfe3a('0x4e')]===0x0){return db[_0xfe3a('0x20')][_0xfe3a('0x42')]({'name':_0xa554a4[_0xfe3a('0x1f')],'resourceId':_0xa554a4['id'],'type':_0x55ff18['name'],'sectionId':_0x55ff18['id']},{})[_0xfe3a('0x21')](function(){return _0x10bf09;});}else{return _0x10bf09;}})['catch'](function(_0x506431){logger['error'](_0xfe3a('0x4f'),_0x506431);throw _0x506431;});}return _0x10bf09;})[_0xfe3a('0x21')](respondWithResult(_0x31fbdb,0xc9))[_0xfe3a('0x3b')](handleError(_0x31fbdb,null));};exports['update']=function(_0x18d603,_0x58175e){if(_0x18d603[_0xfe3a('0x43')]['id']){delete _0x18d603['body']['id'];}return db[_0xfe3a('0x27')][_0xfe3a('0x41')]({'where':{'id':_0x18d603[_0xfe3a('0x3d')]['id']}})[_0xfe3a('0x21')](handleEntityNotFound(_0x58175e,null))['then'](function(_0x3e9ea2){if(_0x3e9ea2){return db[_0xfe3a('0x27')][_0xfe3a('0x50')](_[_0xfe3a('0x33')](_0x18d603[_0xfe3a('0x43')],[_0xfe3a('0x44'),'context',_0xfe3a('0x51'),_0xfe3a('0x52'),_0xfe3a('0x53'),_0xfe3a('0x54'),'alias']),{'where':{'context':_0x3e9ea2['context'],'exten':_0x3e9ea2[_0xfe3a('0x44')]},'individualHooks':!![]})[_0xfe3a('0x21')](function(_0x53bbc9){return _0x53bbc9;});}return null;})[_0xfe3a('0x21')](respondWithStatusCode(_0x58175e,null))[_0xfe3a('0x3b')](handleError(_0x58175e,null));};exports[_0xfe3a('0x55')]=function(_0x375652,_0x868bab){return db['VoiceExtension'][_0xfe3a('0x56')]({'where':{'id':_0x375652[_0xfe3a('0x3d')]['id']}})[_0xfe3a('0x21')](function(_0x26d5ff){if(_0x26d5ff){return db[_0xfe3a('0x57')][_0xfe3a('0x58')](function(_0x454d0d){return db['VoiceExtension'][_0xfe3a('0x15')]({'where':{'VoiceExtensionId':_0x375652[_0xfe3a('0x3d')]['id']},'transaction':_0x454d0d})[_0xfe3a('0x21')](function(){var _0xe68e1b=_[_0xfe3a('0x1c')](_0x375652[_0xfe3a('0x43')],function(_0x272b52){_0x272b52['VoiceExtensionId']=_0x375652['params']['id'];_0x272b52[_0xfe3a('0x59')]=!![];return _0x272b52;});return _0x26d5ff['createRouting'](_0xe68e1b);})[_0xfe3a('0x21')](function(_0x43fd73){console['log'](_0xfe3a('0x5a'),_0x43fd73);return db[_0xfe3a('0x27')]['bulkCreate'](_0x43fd73,{'transaction':_0x454d0d});});})[_0xfe3a('0x21')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x375652['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x868bab,null))[_0xfe3a('0x3b')](handleError(_0x868bab,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index e20d472..2f55833 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 _0xc831=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x308740,_0x401ab3){var _0x1e6893=function(_0x17f28d){while(--_0x17f28d){_0x308740['push'](_0x308740['shift']());}};_0x1e6893(++_0x401ab3);}(_0xc831,0x1cd));var _0x1c83=function(_0x109cd5,_0x2470bb){_0x109cd5=_0x109cd5-0x0;var _0x85b469=_0xc831[_0x109cd5];return _0x85b469;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x1c83('0x0'))['db'][_0x1c83('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1c83('0x2')](0x0);var events={'afterCreate':_0x1c83('0x3'),'afterUpdate':'update','afterDestroy':_0x1c83('0x4')};function emitEvent(_0x3b5d70){return function(_0x2b2a0b,_0x1dd52e,_0xa9ebe){VoiceExtensionEvents[_0x1c83('0x5')](_0x3b5d70+':'+_0x2b2a0b['id'],_0x2b2a0b);VoiceExtensionEvents[_0x1c83('0x5')](_0x3b5d70,_0x2b2a0b);_0xa9ebe(null);};}for(var e in events){if(events[_0x1c83('0x6')](e)){var event=events[e];VoiceExtension[_0x1c83('0x7')](e,emitEvent(event));}}module[_0x1c83('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xcaf4=['remove','emit','hasOwnProperty','hook','events','VoiceExtension','update'];(function(_0x14cbfb,_0x2e08b5){var _0x16078f=function(_0x1dd5b1){while(--_0x1dd5b1){_0x14cbfb['push'](_0x14cbfb['shift']());}};_0x16078f(++_0x2e08b5);}(_0xcaf4,0x185));var _0x4caf=function(_0x43fb15,_0x4b3f5b){_0x43fb15=_0x43fb15-0x0;var _0x42d47a=_0xcaf4[_0x43fb15];return _0x42d47a;};'use strict';var EventEmitter=require(_0x4caf('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x4caf('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4caf('0x2'),'afterDestroy':_0x4caf('0x3')};function emitEvent(_0x4d3591){return function(_0x39d8e9,_0x18518a,_0x4f2123){VoiceExtensionEvents[_0x4caf('0x4')](_0x4d3591+':'+_0x39d8e9['id'],_0x39d8e9);VoiceExtensionEvents[_0x4caf('0x4')](_0x4d3591,_0x39d8e9);_0x4f2123(null);};}for(var e in events){if(events[_0x4caf('0x5')](e)){var event=events[e];VoiceExtension[_0x4caf('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 54be27f..07daaa1 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 _0xa87e=['CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','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','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','param','phone','prefix','SIP','join','none','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag'];(function(_0x310e35,_0x323aea){var _0x3f8850=function(_0x3f3fcd){while(--_0x3f3fcd){_0x310e35['push'](_0x310e35['shift']());}};_0x3f8850(++_0x323aea);}(_0xa87e,0x1c2));var _0xea87=function(_0x1c4d7c,_0x4d6128){_0x1c4d7c=_0x1c4d7c-0x0;var _0xfd005d=_0xa87e[_0x1c4d7c];return _0xfd005d;};'use strict';var _=require(_0xea87('0x0'));var attributes=require(_0xea87('0x1'));module[_0xea87('0x2')]=function(_0x339efc){var _0x5a5a20=_0x339efc[_0xea87('0x3')];function _0x434a5a(_0x2ae388){var _0x55c9af=0x2;var _0x43d37e=[{'type':_0x2ae388[_0xea87('0x4')],'app':_0xea87('0x5'),'appdata':_0xea87('0x6')+_0x2ae388['type'],'context':_0x2ae388[_0xea87('0x7')],'exten':_0x2ae388[_0xea87('0x8')],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']},{'type':_0x2ae388[_0xea87('0x4')],'app':_0x2ae388[_0xea87('0x9')]?_0xea87('0x5'):_0xea87('0xa'),'appdata':_0x2ae388[_0xea87('0x9')]?_0xea87('0xb')+_0x2ae388[_0xea87('0x9')]:_0xea87('0xc'),'context':_0x2ae388[_0xea87('0x7')],'exten':_0x2ae388[_0xea87('0x8')],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']}];if(_0x2ae388['type']===_0xea87('0xd')){_0x43d37e[_0xea87('0xe')]({'type':_0xea87('0xd'),'app':'Set','appdata':_0xea87('0xf')+_0x2ae388['id'],'context':_0x2ae388['context'],'exten':_0x2ae388[_0xea87('0x8')],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']});}_0x43d37e[_0xea87('0xe')]({'type':_0x2ae388[_0xea87('0x4')],'app':'Set','appdata':_0xea87('0x10'),'context':_0x2ae388[_0xea87('0x7')],'exten':_0x2ae388[_0xea87('0x8')],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']},{'type':_0x2ae388[_0xea87('0x4')],'app':_0xea87('0x5'),'appdata':_0xea87('0x11'),'context':_0x2ae388[_0xea87('0x7')],'exten':_0x2ae388['exten'],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']},{'type':_0x2ae388[_0xea87('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x2ae388['context'],'exten':_0x2ae388['exten'],'priority':_0x55c9af++,'VoiceExtensionId':_0x2ae388['id']});return _0x43d37e;}function _0x27be9b(_0x5c92a9){var _0x25af8f=0x2;var _0x5af98c=[{'type':'outbound','app':'Set','appdata':_0xea87('0x12'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0x5c92a9['alias']?_0xea87('0x5'):_0xea87('0xa'),'appdata':_0x5c92a9[_0xea87('0x9')]?'CDR(routeAlias)='+_0x5c92a9['alias']:_0xea87('0xc'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0x14')+(_0x5c92a9[_0xea87('0x15')]?_0xea87('0x16')+_0x5c92a9['cutdigits']+'}':_0xea87('0x17')),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9['exten'],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0xf')+_0x5c92a9['id'],'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9['exten'],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x25af8f+0x2)+_0xea87('0x19')+(_0x25af8f+0x1)+')','context':_0x5c92a9['context'],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0x5c92a9[_0xea87('0x15')]?_0xea87('0x1a')+_0x5c92a9[_0xea87('0x15')]+'}':_0xea87('0x1b'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':'outbound','app':'Set','appdata':_0xea87('0x10'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0x11'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':'outbound','app':'Set','appdata':_0xea87('0x1c'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9['exten'],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0x1d')+_0x5c92a9['id'],'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9['exten'],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']}];if(_0x5c92a9[_0xea87('0x1e')](_0xea87('0x1f'))&&_0x5c92a9[_0xea87('0x1f')]!=='none'){_0x5af98c['push']({'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0x20'),'context':_0x5c92a9['context'],'exten':_0x5c92a9[_0xea87('0x8')],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']},{'type':_0xea87('0x13'),'app':_0xea87('0x5'),'appdata':_0xea87('0x21')+_0x5c92a9[_0xea87('0x1f')]||_0xea87('0x22'),'context':_0x5c92a9[_0xea87('0x7')],'exten':_0x5c92a9['exten'],'priority':_0x25af8f++,'VoiceExtensionId':_0x5c92a9['id']});}return _0x5af98c;}function _0x20696e(_0x559a09,_0x235e2f){var _0x1b9daf=[{'name':_0xea87('0x23'),'param':0x0},{'name':_0xea87('0x24'),'param':0x1},{'name':_0xea87('0x25'),'param':0x2},{'name':_0xea87('0x26'),'param':0x3}];var _0x3160b6={};var _0x4d794f=_0x235e2f[_0xea87('0x27')](',');var _0x494c53=[];for(var _0x3c5aaa=0x0;_0x3c5aaa<_0x1b9daf[_0xea87('0x28')];_0x3c5aaa++){switch(_0x1b9daf[_0x3c5aaa]['name']){case'trunk':_0x3160b6[_0xea87('0x23')]=_0x4d794f[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]][_0xea87('0x27')]('/')[0x1];_0x3160b6[_0xea87('0x2a')]=_0x4d794f[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]][_0xea87('0x27')]('/')[0x2];_0x3160b6['prefix']=_0x3160b6['phone']?_0x3160b6['phone']['split']('$')[0x0]:undefined;_0x3160b6['phone']=_0x559a09['cutdigits']?(_0x3160b6['prefix']||'')+_0xea87('0x16')+_0x559a09['cutdigits']+'}':(_0x3160b6[_0xea87('0x2b')]||'')+_0xea87('0x17');_0x494c53[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]]=[_0xea87('0x2c'),_0x3160b6['trunk'],_0x3160b6[_0xea87('0x2a')]][_0xea87('0x2d')]('/');break;case'options':_0x3160b6['options']=_0x4d794f[_0x1b9daf[_0x3c5aaa]['param']];if(_0x559a09[_0xea87('0x1f')]!==_0xea87('0x2e')){if(_0x3160b6['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3160b6[_0xea87('0x25')]+='U(xcally-mixmonitor-context)';}}else{_0x3160b6[_0xea87('0x25')]=_0x3160b6['options'][_0xea87('0x2f')](_0xea87('0x30'),'');}_0x494c53[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]]=_0x3160b6[_0xea87('0x25')];break;default:_0x494c53[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]]=_0x4d794f[_0x1b9daf[_0x3c5aaa][_0xea87('0x29')]];}}return _0x494c53[_0xea87('0x2d')](',');}function _0x5a7552(_0x7e8145,_0x1738c5,_0x2eb6f3){return new Promise(function(_0x2cd028,_0x42f70b){var _0x1506a1=[];if(_[_0xea87('0x31')](_0x1738c5))return _0x2cd028(_0x1506a1);_0x5a5a20[_0xea87('0x32')][_0xea87('0x33')]({'attributes':['id',_0xea87('0x34'),_0xea87('0x35')],'raw':!![]})['then'](function(_0x89e993){for(var _0x268965=0x0,_0x164b02=0x0;_0x268965<_0x1738c5[_0xea87('0x28')];_0x268965++,_0x164b02=0x0){var _0x5647cf=_0x1738c5[_0x268965];var _0x18b48a=[];var _0x3b8973=[];delete _0x5647cf['id'];if(_0x5647cf[_0xea87('0x34')]!==_0xea87('0x36')){_0x5647cf[_0xea87('0x37')]=[_0x5647cf[_0xea87('0x34')]];}else{_0x5647cf[_0xea87('0x37')]=_0x5647cf[_0xea87('0x35')]?_[_0xea87('0x38')](_[_0xea87('0x39')](_0x89e993,{'IntervalId':_0x5647cf[_0xea87('0x35')]}),_0xea87('0x34')):[];}_0x5647cf[_0xea87('0x7')]=_0x7e8145[_0xea87('0x7')];_0x5647cf[_0xea87('0x8')]=_0x7e8145['exten'];if(_0x5647cf[_0xea87('0x4')])_0x5647cf[_0xea87('0x4')]=_0x5647cf[_0xea87('0x4')][_0xea87('0x3a')]();if(_0x7e8145[_0xea87('0x4')]===_0xea87('0x13')){if(_0x5647cf[_0xea87('0x1e')]('tag')&&_0x5647cf[_0xea87('0x3b')]&&_0x5647cf[_0xea87('0x3b')]!=='--'){_0x18b48a[_0xea87('0xe')]({'type':_0x5647cf['type'][_0xea87('0x3a')](),'app':_0xea87('0x5'),'appdata':_0xea87('0x3c')+_0x5647cf[_0xea87('0x3b')],'context':_0x7e8145['context'],'exten':_0x7e8145['exten'],'priority':_0x5647cf[_0xea87('0x37')][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});}_0x18b48a['push']({'type':_0x5647cf[_0xea87('0x4')][_0xea87('0x3a')](),'app':_0xea87('0x18'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x5647cf['callerID']?_0xea87('0x3d')+_0x5647cf[_0xea87('0x3e')]+')':_0xea87('0x3f')),'context':_0x7e8145[_0xea87('0x7')],'exten':_0x7e8145[_0xea87('0x8')],'priority':_0x5647cf[_0xea87('0x37')][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});}else{if(_0x5647cf[_0xea87('0x1e')](_0xea87('0x40'))){if([_0xea87('0x41'),_0xea87('0x42')]['includes'](_0x5647cf[_0xea87('0x43')][_0xea87('0x3a')]())&&_0x5647cf[_0xea87('0x44')]!==_0xea87('0x45')){if(_0x5647cf[_0xea87('0x40')]){_0x18b48a[_0xea87('0xe')]({'type':_0x5647cf[_0xea87('0x4')][_0xea87('0x3a')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x7e8145[_0xea87('0x7')],'exten':_0x7e8145[_0xea87('0x8')],'priority':_0x5647cf[_0xea87('0x37')][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});_0x18b48a[_0xea87('0xe')]({'type':_0x5647cf[_0xea87('0x4')][_0xea87('0x3a')](),'app':_0xea87('0x5'),'appdata':_0xea87('0x46'),'context':_0x7e8145[_0xea87('0x7')],'exten':_0x7e8145['exten'],'priority':_0x5647cf['intervals'][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});}else{_0x18b48a[_0xea87('0xe')]({'type':_0x5647cf[_0xea87('0x4')]['toLowerCase'](),'app':_0xea87('0x18'),'appdata':_0xea87('0x47'),'context':_0x7e8145['context'],'exten':_0x7e8145[_0xea87('0x8')],'priority':_0x5647cf['intervals'][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});_0x18b48a['push']({'type':_0x5647cf['type']['toLowerCase'](),'app':_0xea87('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x7e8145[_0xea87('0x7')],'exten':_0x7e8145[_0xea87('0x8')],'priority':_0x5647cf[_0xea87('0x37')][_0xea87('0x28')]+_0x2eb6f3+_0x164b02++,'VoiceExtensionId':_0x7e8145['id']});}}}}for(var _0x541e2d=0x0;_0x541e2d<_0x5647cf['intervals']['length'];_0x541e2d++){var _0x16ea1a=_0x2eb6f3+_0x5647cf['intervals'][_0xea87('0x28')];var _0x19da1a=_0x541e2d===_0x5647cf[_0xea87('0x37')][_0xea87('0x28')]-0x1?_0x2eb6f3+_0x18b48a[_0xea87('0x28')]+_0x3b8973['length']+0x2:_0x2eb6f3+_0x541e2d+0x1;_0x18b48a['splice'](_0x541e2d,0x0,{'type':_0x7e8145['type'],'app':_0xea87('0x48'),'appdata':_0x5647cf['intervals'][_0x541e2d]+'?'+_0x7e8145[_0xea87('0x7')]+',${EXTEN},'+_0x16ea1a+':'+_0x7e8145[_0xea87('0x7')]+',${EXTEN},'+_0x19da1a,'exten':_0x7e8145[_0xea87('0x8')],'context':_0x7e8145['context'],'priority':_0x2eb6f3+_0x541e2d,'VoiceExtensionId':_0x7e8145['id']});}if(_0x5647cf[_0xea87('0x44')]===_0xea87('0x49'))_0x5647cf['appdata']=_0x20696e(_0x7e8145,_0x5647cf[_0xea87('0x4a')]);_0x5647cf[_0xea87('0x4b')]=_0x18b48a[_0xea87('0x28')]?_['last'](_0x18b48a)[_0xea87('0x4b')]+0x1:_0x2eb6f3;_0x1506a1=_[_0xea87('0x4c')](_0x1506a1,_0x18b48a,[_0x5647cf],_0x3b8973);_0x2eb6f3=_[_0xea87('0x4d')](_0x1506a1)[_0xea87('0x4b')]+0x1;}return _0x2cd028(_0x1506a1);})[_0xea87('0x4e')](function(_0x42081f){_0x42f70b(_0x42081f);});});}return _0x339efc[_0xea87('0x4f')](_0xea87('0x50'),attributes,{'tableName':_0xea87('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5c28c2){var _0x192a5e=this[_0xea87('0x52')]({'plain':!![]});var _0xbec932=_0x192a5e[_0xea87('0x4')]===_0xea87('0x13')?_0x27be9b(_0x192a5e):_0x434a5a(_0x192a5e);return _0x5a7552(_0x192a5e,_0x5c28c2,_[_0xea87('0x4d')](_0xbec932)['priority']+0x1)[_0xea87('0x53')](function(_0x3dad35){var _0x550c28=_[_0xea87('0x4c')](_0xbec932,_0x3dad35);_0x550c28[_0xea87('0xe')]({'type':_0x192a5e[_0xea87('0x4')],'app':_0xea87('0x54'),'exten':_0x192a5e[_0xea87('0x8')],'context':_0x192a5e[_0xea87('0x7')],'priority':_[_0xea87('0x4d')](_0x550c28)[_0xea87('0x4b')]+0x1,'VoiceExtensionId':_0x192a5e['id']});return _0x550c28;});}}});}; \ No newline at end of file +var _0xc70b=['exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','split','length','name','trunk','param','phone','prefix','indexOf','U(xcally-mixmonitor-context)','replace','join','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','last','concat','catch','define','VoiceExtension','priority','Hangup','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc70b,0x13b));var _0xbc70=function(_0xadced9,_0x5765da){_0xadced9=_0xadced9-0x0;var _0x2fd116=_0xc70b[_0xadced9];return _0x2fd116;};'use strict';var _=require(_0xbc70('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xbc70('0x1')]=function(_0x524f08){var _0x81b5f1=_0x524f08[_0xbc70('0x2')];function _0x3a5205(_0x419559){var _0x9706bd=0x2;var _0x50b76d=[{'type':_0x419559[_0xbc70('0x3')],'app':_0xbc70('0x4'),'appdata':_0xbc70('0x5')+_0x419559[_0xbc70('0x3')],'context':_0x419559[_0xbc70('0x6')],'exten':_0x419559[_0xbc70('0x7')],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']},{'type':_0x419559[_0xbc70('0x3')],'app':_0x419559[_0xbc70('0x8')]?_0xbc70('0x4'):_0xbc70('0x9'),'appdata':_0x419559['alias']?_0xbc70('0xa')+_0x419559[_0xbc70('0x8')]:_0xbc70('0xb'),'context':_0x419559[_0xbc70('0x6')],'exten':_0x419559[_0xbc70('0x7')],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']}];if(_0x419559[_0xbc70('0x3')]==='inbound'){_0x50b76d[_0xbc70('0xc')]({'type':_0xbc70('0xd'),'app':'Set','appdata':_0xbc70('0xe')+_0x419559['id'],'context':_0x419559[_0xbc70('0x6')],'exten':_0x419559[_0xbc70('0x7')],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']});}_0x50b76d[_0xbc70('0xc')]({'type':_0x419559[_0xbc70('0x3')],'app':_0xbc70('0x4'),'appdata':_0xbc70('0xf'),'context':_0x419559[_0xbc70('0x6')],'exten':_0x419559[_0xbc70('0x7')],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']},{'type':_0x419559[_0xbc70('0x3')],'app':_0xbc70('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x419559[_0xbc70('0x6')],'exten':_0x419559[_0xbc70('0x7')],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']},{'type':_0x419559[_0xbc70('0x3')],'app':'Set','appdata':_0xbc70('0x10'),'context':_0x419559[_0xbc70('0x6')],'exten':_0x419559['exten'],'priority':_0x9706bd++,'VoiceExtensionId':_0x419559['id']});return _0x50b76d;}function _0x1a350d(_0x3e6cdd){var _0xf0c4ca=0x2;var _0x316431=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':_0x3e6cdd[_0xbc70('0x8')]?'Set':'NoOp','appdata':_0x3e6cdd[_0xbc70('0x8')]?_0xbc70('0xa')+_0x3e6cdd[_0xbc70('0x8')]:_0xbc70('0xb'),'context':_0x3e6cdd['context'],'exten':_0x3e6cdd['exten'],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':_0xbc70('0x4'),'appdata':'CDR(destination)='+(_0x3e6cdd[_0xbc70('0x12')]?_0xbc70('0x13')+_0x3e6cdd[_0xbc70('0x12')]+'}':_0xbc70('0x14')),'context':_0x3e6cdd['context'],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':_0xbc70('0x4'),'appdata':_0xbc70('0xe')+_0x3e6cdd['id'],'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':'outbound','app':_0xbc70('0x15'),'appdata':_0xbc70('0x16')+(_0xf0c4ca+0x2)+_0xbc70('0x17')+(_0xf0c4ca+0x1)+')','context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':'outbound','app':_0xbc70('0x4'),'appdata':_0x3e6cdd[_0xbc70('0x12')]?_0xbc70('0x18')+_0x3e6cdd[_0xbc70('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':'Set','appdata':_0xbc70('0xf'),'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':'Set','appdata':_0xbc70('0x19'),'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':'outbound','app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x3e6cdd['context'],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':_0xbc70('0x4'),'appdata':'outboundrouteid='+_0x3e6cdd['id'],'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd['exten'],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']}];if(_0x3e6cdd[_0xbc70('0x1a')](_0xbc70('0x1b'))&&_0x3e6cdd['recordingFormat']!==_0xbc70('0x1c')){_0x316431[_0xbc70('0xc')]({'type':'outbound','app':_0xbc70('0x4'),'appdata':_0xbc70('0x1d'),'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']},{'type':_0xbc70('0x11'),'app':'Set','appdata':_0xbc70('0x1e')+_0x3e6cdd[_0xbc70('0x1b')]||_0xbc70('0x1f'),'context':_0x3e6cdd[_0xbc70('0x6')],'exten':_0x3e6cdd[_0xbc70('0x7')],'priority':_0xf0c4ca++,'VoiceExtensionId':_0x3e6cdd['id']});}return _0x316431;}function _0x24bb0f(_0x4b5e61,_0x14d2f6){var _0x3972f7=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xbc70('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x59faaa={};var _0x58e4c8=_0x14d2f6[_0xbc70('0x21')](',');var _0x4a3eb4=[];for(var _0x230f20=0x0;_0x230f20<_0x3972f7[_0xbc70('0x22')];_0x230f20++){switch(_0x3972f7[_0x230f20][_0xbc70('0x23')]){case _0xbc70('0x24'):_0x59faaa[_0xbc70('0x24')]=_0x58e4c8[_0x3972f7[_0x230f20][_0xbc70('0x25')]][_0xbc70('0x21')]('/')[0x1];_0x59faaa[_0xbc70('0x26')]=_0x58e4c8[_0x3972f7[_0x230f20][_0xbc70('0x25')]][_0xbc70('0x21')]('/')[0x2];_0x59faaa['prefix']=_0x59faaa[_0xbc70('0x26')]?_0x59faaa['phone'][_0xbc70('0x21')]('$')[0x0]:undefined;_0x59faaa['phone']=_0x4b5e61[_0xbc70('0x12')]?(_0x59faaa['prefix']||'')+_0xbc70('0x13')+_0x4b5e61[_0xbc70('0x12')]+'}':(_0x59faaa[_0xbc70('0x27')]||'')+_0xbc70('0x14');_0x4a3eb4[_0x3972f7[_0x230f20]['param']]=['SIP',_0x59faaa['trunk'],_0x59faaa['phone']]['join']('/');break;case _0xbc70('0x20'):_0x59faaa[_0xbc70('0x20')]=_0x58e4c8[_0x3972f7[_0x230f20][_0xbc70('0x25')]];if(_0x4b5e61['recordingFormat']!==_0xbc70('0x1c')){if(_0x59faaa[_0xbc70('0x20')][_0xbc70('0x28')](_0xbc70('0x29'))<0x0){_0x59faaa[_0xbc70('0x20')]+=_0xbc70('0x29');}}else{_0x59faaa[_0xbc70('0x20')]=_0x59faaa[_0xbc70('0x20')][_0xbc70('0x2a')]('U(xcally-mixmonitor-context)','');}_0x4a3eb4[_0x3972f7[_0x230f20]['param']]=_0x59faaa[_0xbc70('0x20')];break;default:_0x4a3eb4[_0x3972f7[_0x230f20][_0xbc70('0x25')]]=_0x58e4c8[_0x3972f7[_0x230f20]['param']];}}return _0x4a3eb4[_0xbc70('0x2b')](',');}function _0x464c78(_0x9b1a0e,_0x863887,_0x48b25b){return new Promise(function(_0xf470f1,_0x5812a4){var _0x348a86=[];if(_['isEmpty'](_0x863887))return _0xf470f1(_0x348a86);_0x81b5f1[_0xbc70('0x2c')][_0xbc70('0x2d')]({'attributes':['id','interval',_0xbc70('0x2e')],'raw':!![]})[_0xbc70('0x2f')](function(_0x4ff234){for(var _0x3024cc=0x0,_0x30993f=0x0;_0x3024cc<_0x863887[_0xbc70('0x22')];_0x3024cc++,_0x30993f=0x0){var _0x37e78a=_0x863887[_0x3024cc];var _0x9d0d07=[];var _0x34ca57=[];delete _0x37e78a['id'];if(_0x37e78a[_0xbc70('0x30')]!==_0xbc70('0x31')){_0x37e78a[_0xbc70('0x32')]=[_0x37e78a[_0xbc70('0x30')]];}else{_0x37e78a['intervals']=_0x37e78a['IntervalId']?_[_0xbc70('0x33')](_['filter'](_0x4ff234,{'IntervalId':_0x37e78a[_0xbc70('0x2e')]}),'interval'):[];}_0x37e78a[_0xbc70('0x6')]=_0x9b1a0e[_0xbc70('0x6')];_0x37e78a['exten']=_0x9b1a0e[_0xbc70('0x7')];if(_0x37e78a[_0xbc70('0x3')])_0x37e78a[_0xbc70('0x3')]=_0x37e78a[_0xbc70('0x3')][_0xbc70('0x34')]();if(_0x9b1a0e['type']===_0xbc70('0x11')){if(_0x37e78a[_0xbc70('0x1a')]('tag')&&_0x37e78a[_0xbc70('0x35')]&&_0x37e78a[_0xbc70('0x35')]!=='--'){_0x9d0d07[_0xbc70('0xc')]({'type':_0x37e78a[_0xbc70('0x3')][_0xbc70('0x34')](),'app':'Set','appdata':_0xbc70('0x36')+_0x37e78a[_0xbc70('0x35')],'context':_0x9b1a0e['context'],'exten':_0x9b1a0e['exten'],'priority':_0x37e78a['intervals'][_0xbc70('0x22')]+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});}_0x9d0d07['push']({'type':_0x37e78a['type'][_0xbc70('0x34')](),'app':'ExecIf','appdata':_0xbc70('0x37')+(_0x37e78a[_0xbc70('0x38')]?_0xbc70('0x39')+_0x37e78a[_0xbc70('0x38')]+')':_0xbc70('0x3a')),'context':_0x9b1a0e[_0xbc70('0x6')],'exten':_0x9b1a0e[_0xbc70('0x7')],'priority':_0x37e78a['intervals']['length']+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});}else{if(_0x37e78a[_0xbc70('0x1a')]('answer')){if([_0xbc70('0x3b'),'playback'][_0xbc70('0x3c')](_0x37e78a['app'][_0xbc70('0x34')]())&&_0x37e78a['appType']!==_0xbc70('0x3d')){if(_0x37e78a[_0xbc70('0x3e')]){_0x9d0d07[_0xbc70('0xc')]({'type':_0x37e78a[_0xbc70('0x3')][_0xbc70('0x34')](),'app':'ExecIf','appdata':_0xbc70('0x3f'),'context':_0x9b1a0e[_0xbc70('0x6')],'exten':_0x9b1a0e[_0xbc70('0x7')],'priority':_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')]+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});_0x9d0d07[_0xbc70('0xc')]({'type':_0x37e78a[_0xbc70('0x3')][_0xbc70('0x34')](),'app':_0xbc70('0x4'),'appdata':_0xbc70('0x40'),'context':_0x9b1a0e['context'],'exten':_0x9b1a0e[_0xbc70('0x7')],'priority':_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')]+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});}else{_0x9d0d07[_0xbc70('0xc')]({'type':_0x37e78a['type'][_0xbc70('0x34')](),'app':'ExecIf','appdata':_0xbc70('0x41'),'context':_0x9b1a0e['context'],'exten':_0x9b1a0e[_0xbc70('0x7')],'priority':_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')]+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});_0x9d0d07['push']({'type':_0x37e78a[_0xbc70('0x3')]['toLowerCase'](),'app':_0xbc70('0x4'),'appdata':_0xbc70('0x42'),'context':_0x9b1a0e['context'],'exten':_0x9b1a0e[_0xbc70('0x7')],'priority':_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')]+_0x48b25b+_0x30993f++,'VoiceExtensionId':_0x9b1a0e['id']});}}}}for(var _0x5b64a0=0x0;_0x5b64a0<_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')];_0x5b64a0++){var _0xc16464=_0x48b25b+_0x37e78a[_0xbc70('0x32')]['length'];var _0x24384c=_0x5b64a0===_0x37e78a[_0xbc70('0x32')][_0xbc70('0x22')]-0x1?_0x48b25b+_0x9d0d07[_0xbc70('0x22')]+_0x34ca57[_0xbc70('0x22')]+0x2:_0x48b25b+_0x5b64a0+0x1;_0x9d0d07[_0xbc70('0x43')](_0x5b64a0,0x0,{'type':_0x9b1a0e[_0xbc70('0x3')],'app':'GotoIfTime','appdata':_0x37e78a[_0xbc70('0x32')][_0x5b64a0]+'?'+_0x9b1a0e['context']+_0xbc70('0x44')+_0xc16464+':'+_0x9b1a0e[_0xbc70('0x6')]+_0xbc70('0x44')+_0x24384c,'exten':_0x9b1a0e[_0xbc70('0x7')],'context':_0x9b1a0e['context'],'priority':_0x48b25b+_0x5b64a0,'VoiceExtensionId':_0x9b1a0e['id']});}if(_0x37e78a[_0xbc70('0x45')]===_0xbc70('0x46'))_0x37e78a[_0xbc70('0x47')]=_0x24bb0f(_0x9b1a0e,_0x37e78a[_0xbc70('0x47')]);_0x37e78a['priority']=_0x9d0d07[_0xbc70('0x22')]?_[_0xbc70('0x48')](_0x9d0d07)['priority']+0x1:_0x48b25b;_0x348a86=_[_0xbc70('0x49')](_0x348a86,_0x9d0d07,[_0x37e78a],_0x34ca57);_0x48b25b=_['last'](_0x348a86)['priority']+0x1;}return _0xf470f1(_0x348a86);})[_0xbc70('0x4a')](function(_0x408f90){_0x5812a4(_0x408f90);});});}return _0x524f08[_0xbc70('0x4b')](_0xbc70('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3c19dc){var _0x35555b=this['get']({'plain':!![]});var _0x3b0116=_0x35555b['type']===_0xbc70('0x11')?_0x1a350d(_0x35555b):_0x3a5205(_0x35555b);return _0x464c78(_0x35555b,_0x3c19dc,_['last'](_0x3b0116)[_0xbc70('0x4d')]+0x1)[_0xbc70('0x2f')](function(_0x1d3cdd){var _0x1e2280=_[_0xbc70('0x49')](_0x3b0116,_0x1d3cdd);_0x1e2280[_0xbc70('0xc')]({'type':_0x35555b[_0xbc70('0x3')],'app':_0xbc70('0x4e'),'exten':_0x35555b[_0xbc70('0x7')],'context':_0x35555b['context'],'priority':_[_0xbc70('0x48')](_0x1e2280)['priority']+0x1,'VoiceExtensionId':_0x35555b['id']});return _0x1e2280;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 67021e3..7858968 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 _0x294b=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceExtension','findAll','options','raw','limit','map','include','model','attributes','stringify','lodash','moment','bluebird','randomstring'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var moment=require(_0xb294('0x1'));var BPromise=require(_0xb294('0x2'));var rs=require(_0xb294('0x3'));var fs=require('fs');var Redis=require(_0xb294('0x4'));var db=require(_0xb294('0x5'))['db'];var utils=require(_0xb294('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb294('0x7'));var jayson=require(_0xb294('0x8'));var client=jayson[_0xb294('0x9')][_0xb294('0xa')]({'port':0x232a});config[_0xb294('0xb')]=_['defaults'](config[_0xb294('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb294('0xc'))[_0xb294('0xd')](socket);function respondWithRpcPromise(_0x222992,_0x4f0a43,_0x4a437d){return new BPromise(function(_0x4d3c40,_0x3f311a){return client[_0xb294('0xe')](_0x222992,_0x4a437d)[_0xb294('0xf')](function(_0x20ca2c){logger[_0xb294('0x10')](_0xb294('0x11'),_0x4f0a43,_0xb294('0x12'));logger[_0xb294('0x13')](_0xb294('0x14'),_0x4f0a43,_0xb294('0x12'),JSON['stringify'](_0x20ca2c));if(_0x20ca2c['error']){if(_0x20ca2c[_0xb294('0x15')]['code']===0x1f4){logger['error'](_0xb294('0x11'),_0x4f0a43,_0x20ca2c[_0xb294('0x15')][_0xb294('0x16')]);return _0x3f311a(_0x20ca2c[_0xb294('0x15')][_0xb294('0x16')]);}logger[_0xb294('0x15')](_0xb294('0x11'),_0x4f0a43,_0x20ca2c[_0xb294('0x15')][_0xb294('0x16')]);return _0x4d3c40(_0x20ca2c[_0xb294('0x15')][_0xb294('0x16')]);}else{logger['info'](_0xb294('0x11'),_0x4f0a43,_0xb294('0x12'));_0x4d3c40(_0x20ca2c['result']['message']);}})[_0xb294('0x17')](function(_0x1f0d9c){logger[_0xb294('0x15')](_0xb294('0x11'),_0x4f0a43,_0x1f0d9c);_0x3f311a(_0x1f0d9c);});});}exports[_0xb294('0x18')]=function(_0x4baf08){var _0x4b1325=this;return new Promise(function(_0x3f3e08,_0x46b2ac){return db['VoiceExtension'][_0xb294('0x19')]({'raw':_0x4baf08[_0xb294('0x1a')]?_0x4baf08['options'][_0xb294('0x1b')]===undefined?!![]:![]:!![],'where':_0x4baf08[_0xb294('0x1a')]?_0x4baf08[_0xb294('0x1a')]['where']||null:null,'attributes':_0x4baf08['options']?_0x4baf08[_0xb294('0x1a')]['attributes']||null:null,'limit':_0x4baf08[_0xb294('0x1a')]?_0x4baf08[_0xb294('0x1a')][_0xb294('0x1c')]||null:null,'include':_0x4baf08['options']?_0x4baf08[_0xb294('0x1a')]['include']?_[_0xb294('0x1d')](_0x4baf08[_0xb294('0x1a')][_0xb294('0x1e')],function(_0xabcb26){return{'model':db[_0xabcb26[_0xb294('0x1f')]],'as':_0xabcb26['as'],'attributes':_0xabcb26[_0xb294('0x20')],'include':_0xabcb26[_0xb294('0x1e')]?_[_0xb294('0x1d')](_0xabcb26[_0xb294('0x1e')],function(_0x56c240){return{'model':db[_0x56c240['model']],'as':_0x56c240['as'],'attributes':_0x56c240[_0xb294('0x20')],'include':_0x56c240[_0xb294('0x1e')]?_[_0xb294('0x1d')](_0x56c240[_0xb294('0x1e')],function(_0x47fca9){return{'model':db[_0x47fca9['model']],'as':_0x47fca9['as'],'attributes':_0x47fca9[_0xb294('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb294('0xf')](function(_0x1efdb6){logger[_0xb294('0x10')]('GetVoiceExtension',_0x4baf08);logger['debug']('GetVoiceExtension',_0x4baf08,JSON[_0xb294('0x21')](_0x1efdb6));_0x3f3e08(_0x1efdb6);})[_0xb294('0x17')](function(_0x1c6138){logger[_0xb294('0x15')](_0xb294('0x18'),_0x1c6138[_0xb294('0x16')],_0x4baf08);_0x46b2ac(_0x4b1325[_0xb294('0x15')](0x1f4,_0x1c6138[_0xb294('0x16')]));});});}; \ No newline at end of file +var _0xf961=['info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','findAll','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then'];(function(_0x4f9d31,_0x11e1f3){var _0x125aed=function(_0x9a7a0b){while(--_0x9a7a0b){_0x4f9d31['push'](_0x4f9d31['shift']());}};_0x125aed(++_0x11e1f3);}(_0xf961,0x1cf));var _0x1f96=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xf961[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var moment=require(_0x1f96('0x2'));var BPromise=require(_0x1f96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f96('0x4'));var db=require(_0x1f96('0x5'))['db'];var utils=require(_0x1f96('0x6'));var logger=require('../../config/logger')(_0x1f96('0x7'));var config=require(_0x1f96('0x8'));var jayson=require(_0x1f96('0x9'));var client=jayson['client'][_0x1f96('0xa')]({'port':0x232a});config['redis']=_[_0x1f96('0xb')](config[_0x1f96('0xc')],{'host':_0x1f96('0xd'),'port':0x18eb});var socket=require(_0x1f96('0xe'))(new Redis(config[_0x1f96('0xc')]));require(_0x1f96('0xf'))['register'](socket);function respondWithRpcPromise(_0x523b60,_0x40f9f1,_0x54ae99){return new BPromise(function(_0x32b621,_0x2e1fdb){return client[_0x1f96('0x10')](_0x523b60,_0x54ae99)[_0x1f96('0x11')](function(_0x577c76){logger[_0x1f96('0x12')](_0x1f96('0x13'),_0x40f9f1,_0x1f96('0x14'));logger['debug'](_0x1f96('0x15'),_0x40f9f1,_0x1f96('0x14'),JSON[_0x1f96('0x16')](_0x577c76));if(_0x577c76[_0x1f96('0x17')]){if(_0x577c76[_0x1f96('0x17')][_0x1f96('0x18')]===0x1f4){logger['error'](_0x1f96('0x13'),_0x40f9f1,_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);return _0x2e1fdb(_0x577c76[_0x1f96('0x17')]['message']);}logger[_0x1f96('0x17')](_0x1f96('0x13'),_0x40f9f1,_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);return _0x32b621(_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);}else{logger[_0x1f96('0x12')](_0x1f96('0x13'),_0x40f9f1,'request\x20sent');_0x32b621(_0x577c76[_0x1f96('0x1a')][_0x1f96('0x19')]);}})['catch'](function(_0x1569ca){logger[_0x1f96('0x17')](_0x1f96('0x13'),_0x40f9f1,_0x1569ca);_0x2e1fdb(_0x1569ca);});});}exports[_0x1f96('0x1b')]=function(_0xf301f3){var _0x112c35=this;return new Promise(function(_0x4c7402,_0x3b2f83){return db['VoiceExtension'][_0x1f96('0x1c')]({'raw':_0xf301f3[_0x1f96('0x1d')]?_0xf301f3[_0x1f96('0x1d')][_0x1f96('0x1e')]===undefined?!![]:![]:!![],'where':_0xf301f3['options']?_0xf301f3[_0x1f96('0x1d')][_0x1f96('0x1f')]||null:null,'attributes':_0xf301f3['options']?_0xf301f3['options'][_0x1f96('0x20')]||null:null,'limit':_0xf301f3[_0x1f96('0x1d')]?_0xf301f3[_0x1f96('0x1d')]['limit']||null:null,'include':_0xf301f3[_0x1f96('0x1d')]?_0xf301f3[_0x1f96('0x1d')][_0x1f96('0x21')]?_[_0x1f96('0x22')](_0xf301f3[_0x1f96('0x1d')][_0x1f96('0x21')],function(_0x987bd9){return{'model':db[_0x987bd9[_0x1f96('0x23')]],'as':_0x987bd9['as'],'attributes':_0x987bd9['attributes'],'include':_0x987bd9['include']?_['map'](_0x987bd9['include'],function(_0x50d182){return{'model':db[_0x50d182[_0x1f96('0x23')]],'as':_0x50d182['as'],'attributes':_0x50d182[_0x1f96('0x20')],'include':_0x50d182[_0x1f96('0x21')]?_[_0x1f96('0x22')](_0x50d182['include'],function(_0x2f9b5c){return{'model':db[_0x2f9b5c[_0x1f96('0x23')]],'as':_0x2f9b5c['as'],'attributes':_0x2f9b5c[_0x1f96('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xff1c50){logger[_0x1f96('0x12')]('GetVoiceExtension',_0xf301f3);logger['debug'](_0x1f96('0x1b'),_0xf301f3,JSON[_0x1f96('0x16')](_0xff1c50));_0x4c7402(_0xff1c50);})[_0x1f96('0x24')](function(_0x1f182a){logger[_0x1f96('0x17')](_0x1f96('0x1b'),_0x1f182a['message'],_0xf301f3);_0x3b2f83(_0x112c35[_0x1f96('0x17')](0x1f4,_0x1f182a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6c2a682..647921f 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x5edaad,_0xcbbe7f){var _0x1fd812=function(_0x39779d){while(--_0x39779d){_0x5edaad['push'](_0x5edaad['shift']());}};_0x1fd812(++_0xcbbe7f);}(_0xe14b,0x93));var _0xbe14=function(_0x5f178a,_0x4f63ab){_0x5f178a=_0x5f178a-0x0;var _0x26155f=_0xe14b[_0x5f178a];return _0x26155f;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x5d5951,_0x174325){var _0x171d4a=function(_0x2c2f56){while(--_0x2c2f56){_0x5d5951['push'](_0x5d5951['shift']());}};_0x171d4a(++_0x174325);}(_0xf494,0x1c6));var _0x4f49=function(_0xbeaba,_0x746073){_0xbeaba=_0xbeaba-0x0;var _0x420107=_0xf494[_0xbeaba];return _0x420107;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 00d8a22..aebdc60 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 _0x4137=['getMessages','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','/:id/messages'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['show']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0x7ee1=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','/:id/messages','create','/:id','update','delete','exports','multer','express','Router'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3dfb93,_0x34ee70){_0x3dfb93=_0x3dfb93-0x0;var _0x48e8bc=_0x7ee1[_0x3dfb93];return _0x48e8bc;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/:id',auth[_0x17ee('0x9')](),controller['show']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x17ee('0xb')]);router['put'](_0x17ee('0xc'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xd')]);router[_0x17ee('0xe')]('/:id',auth[_0x17ee('0x9')](),controller['destroy']);module[_0x17ee('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 5d2a3f1..f330be3 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 _0x3e30=['fullname','\x20-\x20','exports','STRING','from-voicemail','contest_mailbox','email','trim','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0xdd11f3,_0x470101){var _0xcdce43=function(_0x277f0b){while(--_0x277f0b){_0xdd11f3['push'](_0xdd11f3['shift']());}};_0xcdce43(++_0x470101);}(_0x3e30,0x1b5));var _0x03e3=function(_0x126e05,_0xf80ede){_0x126e05=_0x126e05-0x0;var _0x41c9b9=_0x3e30[_0x126e05];return _0x41c9b9;};'use strict';var Sequelize=require('sequelize');module[_0x03e3('0x0')]={'customer_id':{'type':Sequelize[_0x03e3('0x1')]},'context':{'type':Sequelize[_0x03e3('0x1')],'defaultValue':_0x03e3('0x2'),'unique':_0x03e3('0x3')},'mailbox':{'type':Sequelize[_0x03e3('0x1')],'defaultValue':'','allowNull':![],'unique':_0x03e3('0x3')},'password':{'type':Sequelize[_0x03e3('0x1')]},'fullname':{'type':Sequelize[_0x03e3('0x1')]},'email':{'type':Sequelize[_0x03e3('0x1')],'validate':{'isEmail':!![]},'set':function(_0x36b170){this['setDataValue'](_0x03e3('0x4'),typeof _0x36b170==='string'&&_0x36b170['trim']()?_0x36b170[_0x03e3('0x5')]():null);}},'pager':{'type':Sequelize[_0x03e3('0x1')]},'tz':{'type':Sequelize[_0x03e3('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x03e3('0x6'),'no'),'defaultValue':_0x03e3('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x03e3('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x03e3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x03e3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x03e3('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x03e3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x03e3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x03e3('0x7')](_0x03e3('0x6'),'no'),'defaultValue':_0x03e3('0x6'),'allowNull':![]},'stamp':{'type':_0x03e3('0x9')},'emailsubject':{'type':Sequelize[_0x03e3('0x1')]},'emailbody':{'type':Sequelize[_0x03e3('0x1')]},'maxsecs':{'type':Sequelize[_0x03e3('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x03e3('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x03e3('0xb')],'get':function(){return this[_0x03e3('0xc')](_0x03e3('0xd'))+_0x03e3('0xe')+this[_0x03e3('0xc')]('mailbox');}}}; \ No newline at end of file +var _0x801d=['fullname','\x20-\x20','mailbox','exports','from-voicemail','contest_mailbox','STRING','string','trim','ENUM','yes','INTEGER','VIRTUAL','getDataValue'];(function(_0x4bb3e0,_0x1e1dda){var _0x2ae0f6=function(_0x58710a){while(--_0x58710a){_0x4bb3e0['push'](_0x4bb3e0['shift']());}};_0x2ae0f6(++_0x1e1dda);}(_0x801d,0x1c3));var _0xd801=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x801d[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require('sequelize');module[_0xd801('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xd801('0x1'),'unique':_0xd801('0x2')},'mailbox':{'type':Sequelize[_0xd801('0x3')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xd801('0x3')]},'fullname':{'type':Sequelize[_0xd801('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x486fa9){this['setDataValue']('email',typeof _0x486fa9===_0xd801('0x4')&&_0x486fa9[_0xd801('0x5')]()?_0x486fa9[_0xd801('0x5')]():null);}},'pager':{'type':Sequelize[_0xd801('0x3')]},'tz':{'type':Sequelize[_0xd801('0x3')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':_0xd801('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xd801('0x3')]},'callback':{'type':Sequelize[_0xd801('0x3')]},'review':{'type':Sequelize['ENUM'](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xd801('0x7'),'no'),'defaultValue':_0xd801('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xd801('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd801('0x6')](_0xd801('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xd801('0x3')]},'emailbody':{'type':Sequelize[_0xd801('0x3')]},'maxsecs':{'type':Sequelize[_0xd801('0x8')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd801('0x8')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd801('0x9')],'get':function(){return this[_0xd801('0xa')](_0xd801('0xb'))+_0xd801('0xc')+this[_0xd801('0xa')](_0xd801('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 816e43c..121fc7a 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 _0x7916=['update','then','get','destroy','end','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getMessages','VoiceMailMessage','hasOwnProperty','pick','mailbox','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7916,0x128));var _0x6791=function(_0x3aeb08,_0x2f30da){_0x3aeb08=_0x3aeb08-0x0;var _0x45f6d1=_0x7916[_0x3aeb08];return _0x45f6d1;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];function respondWithStatusCode(_0x61ac73,_0x16c62b){_0x16c62b=_0x16c62b||0xcc;return function(_0x423e22){if(_0x423e22){return _0x61ac73[_0x6791('0x17')](_0x16c62b);}return _0x61ac73[_0x6791('0x18')](_0x16c62b)['end']();};}function respondWithResult(_0x4b1719,_0x34b28d){_0x34b28d=_0x34b28d||0xc8;return function(_0x5122f9){if(_0x5122f9){return _0x4b1719[_0x6791('0x18')](_0x34b28d)['json'](_0x5122f9);}};}function respondWithFilteredResult(_0x3be9f0,_0x163898){return function(_0x517910){if(_0x517910){var _0x3e4792=typeof _0x163898['offset']===_0x6791('0x19')&&typeof _0x163898[_0x6791('0x1a')]==='undefined';var _0xbc35d=_0x517910[_0x6791('0x1b')];var _0x5bec14=_0x3e4792?0x0:_0x163898[_0x6791('0x1c')];var _0x4d8a79=_0x3e4792?_0x517910[_0x6791('0x1b')]:_0x163898[_0x6791('0x1c')]+_0x163898[_0x6791('0x1a')];var _0x3a72ce;if(_0x4d8a79>=_0xbc35d){_0x4d8a79=_0xbc35d;_0x3a72ce=0xc8;}else{_0x3a72ce=0xce;}_0x3be9f0[_0x6791('0x18')](_0x3a72ce);return _0x3be9f0[_0x6791('0x1d')](_0x6791('0x1e'),_0x5bec14+'-'+_0x4d8a79+'/'+_0xbc35d)['json'](_0x517910);}return null;};}function patchUpdates(_0x4a2922){return function(_0x306acb){try{jsonpatch['apply'](_0x306acb,_0x4a2922,!![]);}catch(_0x21ef16){return BPromise[_0x6791('0x1f')](_0x21ef16);}return _0x306acb['save']();};}function saveUpdates(_0x17f200,_0x309610){return function(_0x15b9ab){if(_0x15b9ab){return _0x15b9ab[_0x6791('0x20')](_0x17f200)['then'](function(_0x3e17b3){return _0x3e17b3;});}return null;};}function removeEntity(_0x1b516d,_0x4a8717){return function(_0x53bb44){if(_0x53bb44){return _0x53bb44['destroy']()[_0x6791('0x21')](function(){var _0x502043=_0x53bb44[_0x6791('0x22')]({'plain':!![]});var _0x5409f1='Voicemails';return db['UserProfileResource'][_0x6791('0x23')]({'where':{'type':_0x5409f1,'resourceId':_0x502043['id']}})[_0x6791('0x21')](function(){return _0x53bb44;});})[_0x6791('0x21')](function(){_0x1b516d['status'](0xcc)[_0x6791('0x24')]();});}};}function handleEntityNotFound(_0x30cc17,_0x493a59){return function(_0x342107){if(!_0x342107){_0x30cc17['sendStatus'](0x194);}return _0x342107;};}function handleError(_0x424b0e,_0x49dd24){_0x49dd24=_0x49dd24||0x1f4;return function(_0x4fc5d5){logger[_0x6791('0x25')](_0x4fc5d5['stack']);if(_0x4fc5d5[_0x6791('0x26')]){delete _0x4fc5d5[_0x6791('0x26')];}_0x424b0e['status'](_0x49dd24)[_0x6791('0x27')](_0x4fc5d5);};}exports[_0x6791('0x28')]=function(_0x234c5e,_0xd36448){var _0x5d9d54={},_0x4f91d6={},_0x348b9c={'count':0x0,'rows':[]};var _0x5e5ac3=_[_0x6791('0x29')](db[_0x6791('0x2a')][_0x6791('0x2b')],function(_0x2b98b8){return{'name':_0x2b98b8[_0x6791('0x2c')],'type':_0x2b98b8[_0x6791('0x2d')][_0x6791('0x2e')]};});_0x4f91d6[_0x6791('0x2f')]=_[_0x6791('0x29')](_0x5e5ac3,_0x6791('0x26'));_0x4f91d6['query']=_[_0x6791('0x30')](_0x234c5e[_0x6791('0x31')]);_0x4f91d6[_0x6791('0x32')]=_[_0x6791('0x33')](_0x4f91d6[_0x6791('0x2f')],_0x4f91d6[_0x6791('0x31')]);_0x5d9d54['attributes']=_['intersection'](_0x4f91d6['model'],qs[_0x6791('0x34')](_0x234c5e[_0x6791('0x31')][_0x6791('0x34')]));_0x5d9d54['attributes']=_0x5d9d54['attributes'][_0x6791('0x35')]?_0x5d9d54[_0x6791('0x36')]:_0x4f91d6[_0x6791('0x2f')];if(!_0x234c5e[_0x6791('0x31')]['hasOwnProperty'](_0x6791('0x37'))){_0x5d9d54[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x234c5e['query'][_0x6791('0x1a')]);_0x5d9d54['offset']=qs['offset'](_0x234c5e[_0x6791('0x31')][_0x6791('0x1c')]);}_0x5d9d54['order']=qs[_0x6791('0x38')](_0x234c5e[_0x6791('0x31')][_0x6791('0x38')]);_0x5d9d54[_0x6791('0x39')]=qs[_0x6791('0x32')](_['pick'](_0x234c5e[_0x6791('0x31')],_0x4f91d6[_0x6791('0x32')]),_0x5e5ac3);if(_0x234c5e[_0x6791('0x31')]['filter']){_0x5d9d54[_0x6791('0x39')]=_[_0x6791('0x3a')](_0x5d9d54[_0x6791('0x39')],{'$or':_['map'](_0x5e5ac3,function(_0x11a012){if(_0x11a012[_0x6791('0x2d')]!==_0x6791('0x3b')){var _0x122aa5={};_0x122aa5[_0x11a012['name']]={'$like':'%'+_0x234c5e[_0x6791('0x31')][_0x6791('0x3c')]+'%'};return _0x122aa5;}})});}_0x5d9d54=_[_0x6791('0x3a')]({},_0x5d9d54,_0x234c5e[_0x6791('0x3d')]);var _0x12f121={'where':_0x5d9d54[_0x6791('0x39')]};return db[_0x6791('0x2a')][_0x6791('0x1b')](_0x12f121)[_0x6791('0x21')](function(_0x4e4004){_0x348b9c['count']=_0x4e4004;if(_0x234c5e[_0x6791('0x31')][_0x6791('0x3e')]){_0x5d9d54['include']=[{'all':!![]}];}return db[_0x6791('0x2a')][_0x6791('0x3f')](_0x5d9d54);})[_0x6791('0x21')](function(_0x3edb86){_0x348b9c[_0x6791('0x40')]=_0x3edb86;return _0x348b9c;})[_0x6791('0x21')](respondWithFilteredResult(_0xd36448,_0x5d9d54))[_0x6791('0x41')](handleError(_0xd36448,null));};exports['show']=function(_0xb3bea8,_0x4b9fca){var _0x17ecf0={'raw':!![],'where':{'id':_0xb3bea8[_0x6791('0x42')]['id']}},_0xfc170e={};_0xfc170e[_0x6791('0x2f')]=_['keys'](db[_0x6791('0x2a')][_0x6791('0x2b')]);_0xfc170e[_0x6791('0x31')]=_[_0x6791('0x30')](_0xb3bea8[_0x6791('0x31')]);_0xfc170e[_0x6791('0x32')]=_[_0x6791('0x33')](_0xfc170e[_0x6791('0x2f')],_0xfc170e['query']);_0x17ecf0[_0x6791('0x36')]=_[_0x6791('0x33')](_0xfc170e[_0x6791('0x2f')],qs[_0x6791('0x34')](_0xb3bea8['query'][_0x6791('0x34')]));_0x17ecf0[_0x6791('0x36')]=_0x17ecf0['attributes'][_0x6791('0x35')]?_0x17ecf0['attributes']:_0xfc170e[_0x6791('0x2f')];if(_0xb3bea8[_0x6791('0x31')][_0x6791('0x3e')]){_0x17ecf0[_0x6791('0x43')]=[{'all':!![]}];}_0x17ecf0=_[_0x6791('0x3a')]({},_0x17ecf0,_0xb3bea8[_0x6791('0x3d')]);return db[_0x6791('0x2a')][_0x6791('0x44')](_0x17ecf0)[_0x6791('0x21')](handleEntityNotFound(_0x4b9fca,null))['then'](respondWithResult(_0x4b9fca,null))[_0x6791('0x41')](handleError(_0x4b9fca,null));};exports['create']=function(_0x10e806,_0x2bb86a){return db[_0x6791('0x2a')][_0x6791('0x45')](_0x10e806[_0x6791('0x46')],{})['then'](function(_0x2bc08d){var _0x35e087=_0x10e806[_0x6791('0x47')][_0x6791('0x22')]({'plain':!![]});if(!_0x35e087)throw new Error(_0x6791('0x48'));if(_0x35e087['role']===_0x6791('0x47')){var _0x42948b=_0x2bc08d['get']({'plain':!![]});var _0x3df699='Voicemails';return db[_0x6791('0x49')][_0x6791('0x44')]({'where':{'name':_0x3df699,'userProfileId':_0x35e087[_0x6791('0x4a')]},'raw':!![]})[_0x6791('0x21')](function(_0x558069){if(_0x558069&&_0x558069[_0x6791('0x4b')]===0x0){return db[_0x6791('0x4c')]['create']({'name':_0x42948b[_0x6791('0x26')],'resourceId':_0x42948b['id'],'type':_0x558069[_0x6791('0x26')],'sectionId':_0x558069['id']},{})[_0x6791('0x21')](function(){return _0x2bc08d;});}else{return _0x2bc08d;}})['catch'](function(_0x355e97){logger[_0x6791('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x355e97);throw _0x355e97;});}return _0x2bc08d;})[_0x6791('0x21')](respondWithResult(_0x2bb86a,0xc9))[_0x6791('0x41')](handleError(_0x2bb86a,null));};exports['update']=function(_0x169531,_0x216498){if(_0x169531[_0x6791('0x46')]['id']){delete _0x169531[_0x6791('0x46')]['id'];}return db['VoiceMail'][_0x6791('0x44')]({'where':{'id':_0x169531[_0x6791('0x42')]['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x216498,null))['then'](saveUpdates(_0x169531['body'],null))[_0x6791('0x21')](respondWithResult(_0x216498,null))[_0x6791('0x41')](handleError(_0x216498,null));};exports[_0x6791('0x23')]=function(_0x45756f,_0x288f05){return db['VoiceMail']['find']({'where':{'id':_0x45756f[_0x6791('0x42')]['id']}})['then'](handleEntityNotFound(_0x288f05,null))['then'](removeEntity(_0x288f05,null))[_0x6791('0x41')](handleError(_0x288f05,null));};exports[_0x6791('0x4d')]=function(_0x2cb48e,_0x10b41b,_0x13089d){return db[_0x6791('0x2a')]['findOne']({'where':{'id':_0x2cb48e['params']['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x10b41b,null))[_0x6791('0x21')](function(_0x56e424){var _0x44b1df;var _0x535ecf={},_0x473443={};_0x473443[_0x6791('0x2f')]=_['keys'](db[_0x6791('0x4e')][_0x6791('0x2b')]);_0x473443[_0x6791('0x31')]=_['keys'](_0x2cb48e[_0x6791('0x31')]);_0x473443[_0x6791('0x32')]=_[_0x6791('0x33')](_0x473443[_0x6791('0x2f')],_0x473443[_0x6791('0x31')]);_0x535ecf['attributes']=_['intersection'](_0x473443[_0x6791('0x2f')],qs[_0x6791('0x34')](_0x2cb48e['query'][_0x6791('0x34')]));_0x535ecf[_0x6791('0x36')]=_0x535ecf[_0x6791('0x36')][_0x6791('0x35')]?_0x535ecf[_0x6791('0x36')]:_0x473443[_0x6791('0x2f')];if(!_0x2cb48e[_0x6791('0x31')][_0x6791('0x4f')]('nolimit')){_0x535ecf[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x1a')]);_0x535ecf['offset']=qs[_0x6791('0x1c')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x1c')]);}_0x535ecf['order']=qs[_0x6791('0x38')](_0x2cb48e[_0x6791('0x31')][_0x6791('0x38')]);_0x535ecf[_0x6791('0x39')]=qs['filters'](_[_0x6791('0x50')](_0x2cb48e[_0x6791('0x31')],_0x473443['filters']));if(_0x2cb48e[_0x6791('0x31')][_0x6791('0x3c')]){_0x535ecf[_0x6791('0x39')]=_[_0x6791('0x3a')](_0x535ecf[_0x6791('0x39')],{'$or':_[_0x6791('0x29')](_0x535ecf['attributes'],function(_0x301f2f){var _0x33caf0={};_0x33caf0[_0x301f2f]={'$like':'%'+_0x2cb48e[_0x6791('0x31')]['filter']+'%'};return _0x33caf0;})});}_0x535ecf[_0x6791('0x39')]=_['merge'](_0x535ecf[_0x6791('0x39')],{'mailboxuser':_0x56e424[_0x6791('0x51')]});_0x535ecf=_[_0x6791('0x3a')]({},_0x535ecf,_0x2cb48e[_0x6791('0x3d')]);return db[_0x6791('0x4e')]['findAndCountAll'](_0x535ecf)[_0x6791('0x21')](respondWithFilteredResult(_0x10b41b,_0x535ecf));})[_0x6791('0x41')](handleError(_0x10b41b,null));}; \ No newline at end of file +var _0x58a4=['catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','pick','mailbox','VoiceMailMessage','findAndCountAll','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x43f2eb,_0x11f31b){var _0x13ac50=function(_0x5d476c){while(--_0x5d476c){_0x43f2eb['push'](_0x43f2eb['shift']());}};_0x13ac50(++_0x11f31b);}(_0x58a4,0xbf));var _0x458a=function(_0x5870c1,_0x173ba3){_0x5870c1=_0x5870c1-0x0;var _0x344685=_0x58a4[_0x5870c1];return _0x344685;};'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'];function respondWithStatusCode(_0xee09c6,_0x2a4934){_0x2a4934=_0x2a4934||0xcc;return function(_0x2e788b){if(_0x2e788b){return _0xee09c6['sendStatus'](_0x2a4934);}return _0xee09c6['status'](_0x2a4934)[_0x458a('0x1a')]();};}function respondWithResult(_0x56436f,_0x2c7528){_0x2c7528=_0x2c7528||0xc8;return function(_0x44f683){if(_0x44f683){return _0x56436f[_0x458a('0x1b')](_0x2c7528)[_0x458a('0x1c')](_0x44f683);}};}function respondWithFilteredResult(_0xad80f9,_0x29acee){return function(_0x507b0f){if(_0x507b0f){var _0x4b26be=typeof _0x29acee['offset']===_0x458a('0x1d')&&typeof _0x29acee[_0x458a('0x1e')]===_0x458a('0x1d');var _0x5c5b41=_0x507b0f[_0x458a('0x1f')];var _0x260c87=_0x4b26be?0x0:_0x29acee[_0x458a('0x20')];var _0x392986=_0x4b26be?_0x507b0f[_0x458a('0x1f')]:_0x29acee['offset']+_0x29acee['limit'];var _0x178db9;if(_0x392986>=_0x5c5b41){_0x392986=_0x5c5b41;_0x178db9=0xc8;}else{_0x178db9=0xce;}_0xad80f9['status'](_0x178db9);return _0xad80f9[_0x458a('0x21')](_0x458a('0x22'),_0x260c87+'-'+_0x392986+'/'+_0x5c5b41)['json'](_0x507b0f);}return null;};}function patchUpdates(_0x468416){return function(_0x55a588){try{jsonpatch[_0x458a('0x23')](_0x55a588,_0x468416,!![]);}catch(_0x1c79cb){return BPromise['reject'](_0x1c79cb);}return _0x55a588[_0x458a('0x24')]();};}function saveUpdates(_0xead884,_0x5a2bcb){return function(_0xa6b8ff){if(_0xa6b8ff){return _0xa6b8ff['update'](_0xead884)[_0x458a('0x25')](function(_0x5bca42){return _0x5bca42;});}return null;};}function removeEntity(_0x4080fc,_0x5dfc6c){return function(_0x36b08e){if(_0x36b08e){return _0x36b08e[_0x458a('0x26')]()[_0x458a('0x25')](function(){var _0xcda8cc=_0x36b08e[_0x458a('0x27')]({'plain':!![]});var _0x19bd5=_0x458a('0x28');return db[_0x458a('0x29')][_0x458a('0x26')]({'where':{'type':_0x19bd5,'resourceId':_0xcda8cc['id']}})[_0x458a('0x25')](function(){return _0x36b08e;});})[_0x458a('0x25')](function(){_0x4080fc[_0x458a('0x1b')](0xcc)[_0x458a('0x1a')]();});}};}function handleEntityNotFound(_0x5a55b7,_0xb94bd9){return function(_0x112fa6){if(!_0x112fa6){_0x5a55b7['sendStatus'](0x194);}return _0x112fa6;};}function handleError(_0x5df150,_0x41b23d){_0x41b23d=_0x41b23d||0x1f4;return function(_0x596fe2){logger[_0x458a('0x2a')](_0x596fe2[_0x458a('0x2b')]);if(_0x596fe2[_0x458a('0x2c')]){delete _0x596fe2['name'];}_0x5df150[_0x458a('0x1b')](_0x41b23d)[_0x458a('0x2d')](_0x596fe2);};}exports[_0x458a('0x2e')]=function(_0x562c36,_0x47e20d){var _0x18c890={},_0x4cf059={},_0x185f1c={'count':0x0,'rows':[]};var _0x56e0b9=_[_0x458a('0x2f')](db[_0x458a('0x30')]['rawAttributes'],function(_0x309a6a){return{'name':_0x309a6a[_0x458a('0x31')],'type':_0x309a6a[_0x458a('0x32')]['key']};});_0x4cf059[_0x458a('0x33')]=_[_0x458a('0x2f')](_0x56e0b9,_0x458a('0x2c'));_0x4cf059[_0x458a('0x34')]=_[_0x458a('0x35')](_0x562c36['query']);_0x4cf059[_0x458a('0x36')]=_[_0x458a('0x37')](_0x4cf059[_0x458a('0x33')],_0x4cf059[_0x458a('0x34')]);_0x18c890[_0x458a('0x38')]=_[_0x458a('0x37')](_0x4cf059['model'],qs[_0x458a('0x39')](_0x562c36[_0x458a('0x34')][_0x458a('0x39')]));_0x18c890[_0x458a('0x38')]=_0x18c890[_0x458a('0x38')][_0x458a('0x3a')]?_0x18c890[_0x458a('0x38')]:_0x4cf059[_0x458a('0x33')];if(!_0x562c36[_0x458a('0x34')]['hasOwnProperty'](_0x458a('0x3b'))){_0x18c890[_0x458a('0x1e')]=qs[_0x458a('0x1e')](_0x562c36[_0x458a('0x34')][_0x458a('0x1e')]);_0x18c890[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x562c36[_0x458a('0x34')][_0x458a('0x20')]);}_0x18c890[_0x458a('0x3c')]=qs[_0x458a('0x3d')](_0x562c36[_0x458a('0x34')][_0x458a('0x3d')]);_0x18c890[_0x458a('0x3e')]=qs[_0x458a('0x36')](_['pick'](_0x562c36[_0x458a('0x34')],_0x4cf059[_0x458a('0x36')]),_0x56e0b9);if(_0x562c36[_0x458a('0x34')][_0x458a('0x3f')]){_0x18c890[_0x458a('0x3e')]=_[_0x458a('0x40')](_0x18c890[_0x458a('0x3e')],{'$or':_[_0x458a('0x2f')](_0x56e0b9,function(_0x41d125){if(_0x41d125[_0x458a('0x32')]!==_0x458a('0x41')){var _0x4efbeb={};_0x4efbeb[_0x41d125[_0x458a('0x2c')]]={'$like':'%'+_0x562c36[_0x458a('0x34')]['filter']+'%'};return _0x4efbeb;}})});}_0x18c890=_[_0x458a('0x40')]({},_0x18c890,_0x562c36[_0x458a('0x42')]);var _0x4286a3={'where':_0x18c890['where']};return db[_0x458a('0x30')][_0x458a('0x1f')](_0x4286a3)[_0x458a('0x25')](function(_0x1e51d2){_0x185f1c[_0x458a('0x1f')]=_0x1e51d2;if(_0x562c36[_0x458a('0x34')][_0x458a('0x43')]){_0x18c890[_0x458a('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0x458a('0x45')](_0x18c890);})[_0x458a('0x25')](function(_0x2b9030){_0x185f1c['rows']=_0x2b9030;return _0x185f1c;})[_0x458a('0x25')](respondWithFilteredResult(_0x47e20d,_0x18c890))[_0x458a('0x46')](handleError(_0x47e20d,null));};exports['show']=function(_0x598707,_0x124f64){var _0x2be08f={'raw':!![],'where':{'id':_0x598707[_0x458a('0x47')]['id']}},_0x36c391={};_0x36c391['model']=_['keys'](db[_0x458a('0x30')][_0x458a('0x48')]);_0x36c391[_0x458a('0x34')]=_[_0x458a('0x35')](_0x598707['query']);_0x36c391[_0x458a('0x36')]=_[_0x458a('0x37')](_0x36c391['model'],_0x36c391[_0x458a('0x34')]);_0x2be08f['attributes']=_[_0x458a('0x37')](_0x36c391[_0x458a('0x33')],qs[_0x458a('0x39')](_0x598707['query'][_0x458a('0x39')]));_0x2be08f[_0x458a('0x38')]=_0x2be08f[_0x458a('0x38')]['length']?_0x2be08f['attributes']:_0x36c391[_0x458a('0x33')];if(_0x598707[_0x458a('0x34')][_0x458a('0x43')]){_0x2be08f['include']=[{'all':!![]}];}_0x2be08f=_['merge']({},_0x2be08f,_0x598707[_0x458a('0x42')]);return db[_0x458a('0x30')][_0x458a('0x49')](_0x2be08f)[_0x458a('0x25')](handleEntityNotFound(_0x124f64,null))[_0x458a('0x25')](respondWithResult(_0x124f64,null))[_0x458a('0x46')](handleError(_0x124f64,null));};exports[_0x458a('0x4a')]=function(_0x30cdaf,_0xb22232){return db[_0x458a('0x30')][_0x458a('0x4a')](_0x30cdaf[_0x458a('0x4b')],{})[_0x458a('0x25')](function(_0x1b0c11){var _0x1ddc39=_0x30cdaf[_0x458a('0x4c')]['get']({'plain':!![]});if(!_0x1ddc39)throw new Error(_0x458a('0x4d'));if(_0x1ddc39[_0x458a('0x4e')]===_0x458a('0x4c')){var _0x396bb3=_0x1b0c11[_0x458a('0x27')]({'plain':!![]});var _0x5630cf='Voicemails';return db['UserProfileSection'][_0x458a('0x49')]({'where':{'name':_0x5630cf,'userProfileId':_0x1ddc39['userProfileId']},'raw':!![]})[_0x458a('0x25')](function(_0x58946){if(_0x58946&&_0x58946[_0x458a('0x4f')]===0x0){return db[_0x458a('0x29')][_0x458a('0x4a')]({'name':_0x396bb3['name'],'resourceId':_0x396bb3['id'],'type':_0x58946['name'],'sectionId':_0x58946['id']},{})[_0x458a('0x25')](function(){return _0x1b0c11;});}else{return _0x1b0c11;}})[_0x458a('0x46')](function(_0x2587a1){logger[_0x458a('0x2a')](_0x458a('0x50'),_0x2587a1);throw _0x2587a1;});}return _0x1b0c11;})['then'](respondWithResult(_0xb22232,0xc9))[_0x458a('0x46')](handleError(_0xb22232,null));};exports['update']=function(_0xa51e28,_0x5b428c){if(_0xa51e28[_0x458a('0x4b')]['id']){delete _0xa51e28['body']['id'];}return db['VoiceMail']['find']({'where':{'id':_0xa51e28[_0x458a('0x47')]['id']}})[_0x458a('0x25')](handleEntityNotFound(_0x5b428c,null))['then'](saveUpdates(_0xa51e28[_0x458a('0x4b')],null))[_0x458a('0x25')](respondWithResult(_0x5b428c,null))[_0x458a('0x46')](handleError(_0x5b428c,null));};exports['destroy']=function(_0x2c1230,_0x212de5){return db[_0x458a('0x30')][_0x458a('0x49')]({'where':{'id':_0x2c1230[_0x458a('0x47')]['id']}})[_0x458a('0x25')](handleEntityNotFound(_0x212de5,null))['then'](removeEntity(_0x212de5,null))[_0x458a('0x46')](handleError(_0x212de5,null));};exports[_0x458a('0x51')]=function(_0x45325f,_0x39e5b5,_0x3ab86a){return db[_0x458a('0x30')][_0x458a('0x52')]({'where':{'id':_0x45325f[_0x458a('0x47')]['id']}})['then'](handleEntityNotFound(_0x39e5b5,null))[_0x458a('0x25')](function(_0x4abe93){var _0x1f93ad;var _0x2921ba={},_0x222aa4={};_0x222aa4[_0x458a('0x33')]=_['keys'](db['VoiceMailMessage'][_0x458a('0x48')]);_0x222aa4[_0x458a('0x34')]=_[_0x458a('0x35')](_0x45325f[_0x458a('0x34')]);_0x222aa4[_0x458a('0x36')]=_[_0x458a('0x37')](_0x222aa4['model'],_0x222aa4[_0x458a('0x34')]);_0x2921ba[_0x458a('0x38')]=_['intersection'](_0x222aa4[_0x458a('0x33')],qs['fields'](_0x45325f[_0x458a('0x34')][_0x458a('0x39')]));_0x2921ba[_0x458a('0x38')]=_0x2921ba[_0x458a('0x38')][_0x458a('0x3a')]?_0x2921ba[_0x458a('0x38')]:_0x222aa4[_0x458a('0x33')];if(!_0x45325f[_0x458a('0x34')]['hasOwnProperty'](_0x458a('0x3b'))){_0x2921ba[_0x458a('0x1e')]=qs['limit'](_0x45325f[_0x458a('0x34')][_0x458a('0x1e')]);_0x2921ba['offset']=qs[_0x458a('0x20')](_0x45325f[_0x458a('0x34')]['offset']);}_0x2921ba[_0x458a('0x3c')]=qs[_0x458a('0x3d')](_0x45325f['query'][_0x458a('0x3d')]);_0x2921ba[_0x458a('0x3e')]=qs[_0x458a('0x36')](_[_0x458a('0x53')](_0x45325f[_0x458a('0x34')],_0x222aa4[_0x458a('0x36')]));if(_0x45325f[_0x458a('0x34')][_0x458a('0x3f')]){_0x2921ba['where']=_[_0x458a('0x40')](_0x2921ba[_0x458a('0x3e')],{'$or':_[_0x458a('0x2f')](_0x2921ba[_0x458a('0x38')],function(_0x250238){var _0x2930ae={};_0x2930ae[_0x250238]={'$like':'%'+_0x45325f[_0x458a('0x34')][_0x458a('0x3f')]+'%'};return _0x2930ae;})});}_0x2921ba[_0x458a('0x3e')]=_[_0x458a('0x40')](_0x2921ba['where'],{'mailboxuser':_0x4abe93[_0x458a('0x54')]});_0x2921ba=_['merge']({},_0x2921ba,_0x45325f[_0x458a('0x42')]);return db[_0x458a('0x55')][_0x458a('0x56')](_0x2921ba)[_0x458a('0x25')](respondWithFilteredResult(_0x39e5b5,_0x2921ba));})[_0x458a('0x46')](handleError(_0x39e5b5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 34bf9df..8e3e030 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 _0xbbdf=['path','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2224b7,_0x595e7b){var _0x41a0b5=function(_0x1df6f3){while(--_0x1df6f3){_0x2224b7['push'](_0x2224b7['shift']());}};_0x41a0b5(++_0x595e7b);}(_0xbbdf,0x1d0));var _0xfbbd=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0xbbdf[_0x435044];return _0x33d4c6;};'use strict';var _=require(_0xfbbd('0x0'));var util=require('util');var logger=require(_0xfbbd('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfbbd('0x2'));var rp=require(_0xfbbd('0x3'));var fs=require('fs');var path=require(_0xfbbd('0x4'));var rimraf=require('rimraf');var config=require(_0xfbbd('0x5'));var attributes=require('./voiceMail.attributes');module[_0xfbbd('0x6')]=function(_0x3e6b9d,_0x475a65){return _0x3e6b9d[_0xfbbd('0x7')](_0xfbbd('0x8'),attributes,{'tableName':_0xfbbd('0x9'),'paranoid':![],'indexes':[{'name':_0xfbbd('0xa'),'fields':[_0xfbbd('0xb'),_0xfbbd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe34=['context','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe34,0x187));var _0x4fe3=function(_0x579fef,_0x1cb661){_0x579fef=_0x579fef-0x0;var _0x395c61=_0xfe34[_0x579fef];return _0x395c61;};'use strict';var _=require(_0x4fe3('0x0'));var util=require('util');var logger=require(_0x4fe3('0x1'))(_0x4fe3('0x2'));var moment=require(_0x4fe3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fe3('0x4'));var rimraf=require(_0x4fe3('0x5'));var config=require(_0x4fe3('0x6'));var attributes=require(_0x4fe3('0x7'));module[_0x4fe3('0x8')]=function(_0x4512d9,_0xe81d9a){return _0x4512d9[_0x4fe3('0x9')](_0x4fe3('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x4fe3('0xb'),_0x4fe3('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 0dc95e3..24c8e9c 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 _0x2665=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xb77872,_0x207e06){var _0x2be677=function(_0xec1ccc){while(--_0xec1ccc){_0xb77872['push'](_0xb77872['shift']());}};_0x2be677(++_0x207e06);}(_0x2665,0x18a));var _0x5266=function(_0x3bde18,_0x576e68){_0x3bde18=_0x3bde18-0x0;var _0x3a0505=_0x2665[_0x3bde18];return _0x3a0505;};'use strict';var _=require('lodash');var util=require(_0x5266('0x0'));var moment=require(_0x5266('0x1'));var BPromise=require('bluebird');var rs=require(_0x5266('0x2'));var fs=require('fs');var Redis=require(_0x5266('0x3'));var db=require(_0x5266('0x4'))['db'];var utils=require(_0x5266('0x5'));var logger=require(_0x5266('0x6'))(_0x5266('0x7'));var config=require(_0x5266('0x8'));var jayson=require(_0x5266('0x9'));var client=jayson[_0x5266('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ae392,_0x20defb,_0x5e09f3){return new BPromise(function(_0xa7d6ff,_0x1d5862){return client['request'](_0x4ae392,_0x5e09f3)['then'](function(_0x5a97c4){logger[_0x5266('0xb')](_0x5266('0xc'),_0x20defb,'request\x20sent');logger[_0x5266('0xd')](_0x5266('0xe'),_0x20defb,_0x5266('0xf'),JSON[_0x5266('0x10')](_0x5a97c4));if(_0x5a97c4[_0x5266('0x11')]){if(_0x5a97c4[_0x5266('0x11')][_0x5266('0x12')]===0x1f4){logger[_0x5266('0x11')](_0x5266('0xc'),_0x20defb,_0x5a97c4[_0x5266('0x11')]['message']);return _0x1d5862(_0x5a97c4[_0x5266('0x11')][_0x5266('0x13')]);}logger['error'](_0x5266('0xc'),_0x20defb,_0x5a97c4[_0x5266('0x11')][_0x5266('0x13')]);return _0xa7d6ff(_0x5a97c4['error'][_0x5266('0x13')]);}else{logger[_0x5266('0xb')]('VoiceMail,\x20%s,\x20%s',_0x20defb,_0x5266('0xf'));_0xa7d6ff(_0x5a97c4[_0x5266('0x14')][_0x5266('0x13')]);}})['catch'](function(_0x28f4d6){logger[_0x5266('0x11')](_0x5266('0xc'),_0x20defb,_0x28f4d6);_0x1d5862(_0x28f4d6);});});} \ No newline at end of file +var _0x3f89=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment'];(function(_0x56fb79,_0x454ded){var _0x568510=function(_0x1acaf8){while(--_0x1acaf8){_0x56fb79['push'](_0x56fb79['shift']());}};_0x568510(++_0x454ded);}(_0x3f89,0x196));var _0x93f8=function(_0x2290fc,_0x1e9ff8){_0x2290fc=_0x2290fc-0x0;var _0x366fdb=_0x3f89[_0x2290fc];return _0x366fdb;};'use strict';var _=require('lodash');var util=require(_0x93f8('0x0'));var moment=require(_0x93f8('0x1'));var BPromise=require(_0x93f8('0x2'));var rs=require(_0x93f8('0x3'));var fs=require('fs');var Redis=require(_0x93f8('0x4'));var db=require(_0x93f8('0x5'))['db'];var utils=require(_0x93f8('0x6'));var logger=require(_0x93f8('0x7'))(_0x93f8('0x8'));var config=require('../../config/environment');var jayson=require(_0x93f8('0x9'));var client=jayson[_0x93f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5dd9e,_0x2afd29,_0x370084){return new BPromise(function(_0x1bcffc,_0xc5c7ae){return client[_0x93f8('0xb')](_0xe5dd9e,_0x370084)[_0x93f8('0xc')](function(_0x3c663b){logger[_0x93f8('0xd')](_0x93f8('0xe'),_0x2afd29,_0x93f8('0xf'));logger[_0x93f8('0x10')](_0x93f8('0x11'),_0x2afd29,_0x93f8('0xf'),JSON[_0x93f8('0x12')](_0x3c663b));if(_0x3c663b['error']){if(_0x3c663b['error'][_0x93f8('0x13')]===0x1f4){logger[_0x93f8('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2afd29,_0x3c663b[_0x93f8('0x14')]['message']);return _0xc5c7ae(_0x3c663b['error'][_0x93f8('0x15')]);}logger[_0x93f8('0x14')](_0x93f8('0xe'),_0x2afd29,_0x3c663b['error'][_0x93f8('0x15')]);return _0x1bcffc(_0x3c663b[_0x93f8('0x14')][_0x93f8('0x15')]);}else{logger['info'](_0x93f8('0xe'),_0x2afd29,_0x93f8('0xf'));_0x1bcffc(_0x3c663b[_0x93f8('0x16')][_0x93f8('0x15')]);}})[_0x93f8('0x17')](function(_0x52f64f){logger[_0x93f8('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2afd29,_0x52f64f);_0xc5c7ae(_0x52f64f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 8a117e0..c52c541 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 _0xdb83=['../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x2904e0,_0xa137b4){var _0x56c8f5=function(_0x221812){while(--_0x221812){_0x2904e0['push'](_0x2904e0['shift']());}};_0x56c8f5(++_0xa137b4);}(_0xdb83,0x7b));var _0x3db8=function(_0x553b22,_0x5f048d){_0x553b22=_0x553b22-0x0;var _0xf76744=_0xdb83[_0x553b22];return _0xf76744;};'use strict';var multer=require(_0x3db8('0x0'));var util=require('util');var path=require(_0x3db8('0x1'));var timeout=require(_0x3db8('0x2'));var express=require('express');var router=express[_0x3db8('0x3')]();var fs_extra=require(_0x3db8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3db8('0x5'));var controller=require('./voiceMailMessage.controller');router[_0x3db8('0x6')]('/',auth[_0x3db8('0x7')](),controller[_0x3db8('0x8')]);router[_0x3db8('0x6')](_0x3db8('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x3db8('0xa'),auth['isAuthenticated'](),controller[_0x3db8('0xb')]);router['post']('/',auth[_0x3db8('0x7')](),controller[_0x3db8('0xc')]);router['put'](_0x3db8('0x9'),auth[_0x3db8('0x7')](),controller[_0x3db8('0xd')]);router['delete'](_0x3db8('0x9'),auth['isAuthenticated'](),controller[_0x3db8('0xe')]);module[_0x3db8('0xf')]=router; \ No newline at end of file +var _0x23d6=['get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x2a4aaf,_0x54ff40){var _0x3f8631=function(_0x5419e0){while(--_0x5419e0){_0x2a4aaf['push'](_0x2a4aaf['shift']());}};_0x3f8631(++_0x54ff40);}(_0x23d6,0x199));var _0x623d=function(_0x508276,_0x56c804){_0x508276=_0x508276-0x0;var _0xfc4c3=_0x23d6[_0x508276];return _0xfc4c3;};'use strict';var multer=require(_0x623d('0x0'));var util=require(_0x623d('0x1'));var path=require(_0x623d('0x2'));var timeout=require(_0x623d('0x3'));var express=require('express');var router=express[_0x623d('0x4')]();var fs_extra=require(_0x623d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x623d('0x6'));var config=require(_0x623d('0x7'));var controller=require(_0x623d('0x8'));router[_0x623d('0x9')]('/',auth['isAuthenticated'](),controller[_0x623d('0xa')]);router['get'](_0x623d('0xb'),auth['isAuthenticated'](),controller[_0x623d('0xc')]);router['get'](_0x623d('0xd'),auth[_0x623d('0xe')](),controller[_0x623d('0xf')]);router[_0x623d('0x10')]('/',auth['isAuthenticated'](),controller[_0x623d('0x11')]);router[_0x623d('0x12')](_0x623d('0xb'),auth[_0x623d('0xe')](),controller[_0x623d('0x13')]);router[_0x623d('0x14')]('/:id',auth[_0x623d('0xe')](),controller[_0x623d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4944131..263b057 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 _0x1f1d=['BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING'];(function(_0x122206,_0x1ee8c0){var _0x446679=function(_0x2c1021){while(--_0x2c1021){_0x122206['push'](_0x122206['shift']());}};_0x446679(++_0x1ee8c0);}(_0x1f1d,0x192));var _0xd1f1=function(_0x471cbc,_0x5cb952){_0x471cbc=_0x471cbc-0x0;var _0x459c94=_0x1f1d[_0x471cbc];return _0x459c94;};'use strict';var Sequelize=require(_0xd1f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1f1('0x1')],'get':function(_0x4e8d95){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xd1f1('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd1f1('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':''},'stamp':{'type':_0xd1f1('0x5'),'defaultValue':Sequelize['literal'](_0xd1f1('0x6'))}}; \ No newline at end of file +var _0x6bf9=['STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x6bf9,0x137));var _0x96bf=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6bf9[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x96bf('0x0'));module['exports']={'name':{'type':Sequelize[_0x96bf('0x1')],'get':function(_0x3ed5c0){return this[_0x96bf('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x96bf('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x96bf('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x96bf('0x4')],'defaultValue':''},'stamp':{'type':_0x96bf('0x6'),'defaultValue':Sequelize[_0x96bf('0x7')](_0x96bf('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 200d02c..3355307 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 _0x36cb=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','name','query','keys','filters'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x36cb,0x1ea));var _0xb36c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x36cb[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xb36c('0x0'));var rimraf=require(_0xb36c('0x1'));var zipdir=require(_0xb36c('0x2'));var jsonpatch=require(_0xb36c('0x3'));var rp=require('request-promise');var moment=require(_0xb36c('0x4'));var BPromise=require(_0xb36c('0x5'));var Mustache=require('mustache');var util=require(_0xb36c('0x6'));var path=require(_0xb36c('0x7'));var sox=require(_0xb36c('0x8'));var csv=require(_0xb36c('0x9'));var ejs=require(_0xb36c('0xa'));var fs=require('fs');var fs_extra=require(_0xb36c('0xb'));var _=require('lodash');var squel=require(_0xb36c('0xc'));var crypto=require(_0xb36c('0xd'));var jsforce=require(_0xb36c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb36c('0x9'));var querystring=require(_0xb36c('0xf'));var Papa=require(_0xb36c('0x10'));var Redis=require(_0xb36c('0x11'));var authService=require(_0xb36c('0x12'));var qs=require(_0xb36c('0x13'));var as=require(_0xb36c('0x14'));var hardwareService=require(_0xb36c('0x15'));var logger=require('../../config/logger')(_0xb36c('0x16'));var utils=require(_0xb36c('0x17'));var config=require(_0xb36c('0x18'));var licenseUtil=require(_0xb36c('0x19'));var db=require(_0xb36c('0x1a'))['db'];function respondWithStatusCode(_0x1ffa24,_0x48319b){_0x48319b=_0x48319b||0xcc;return function(_0x40efae){if(_0x40efae){return _0x1ffa24[_0xb36c('0x1b')](_0x48319b);}return _0x1ffa24[_0xb36c('0x1c')](_0x48319b)[_0xb36c('0x1d')]();};}function respondWithResult(_0x461abd,_0x5842a3){_0x5842a3=_0x5842a3||0xc8;return function(_0x248b6a){if(_0x248b6a){return _0x461abd[_0xb36c('0x1c')](_0x5842a3)[_0xb36c('0x1e')](_0x248b6a);}};}function respondWithFilteredResult(_0x2cfbcc,_0x1e37ae){return function(_0x3001fc){if(_0x3001fc){var _0x50dcc3=typeof _0x1e37ae[_0xb36c('0x1f')]===_0xb36c('0x20')&&typeof _0x1e37ae[_0xb36c('0x21')]===_0xb36c('0x20');var _0x43aa6b=_0x3001fc[_0xb36c('0x22')];var _0x5d0ef8=_0x50dcc3?0x0:_0x1e37ae[_0xb36c('0x1f')];var _0x34cc0c=_0x50dcc3?_0x3001fc[_0xb36c('0x22')]:_0x1e37ae[_0xb36c('0x1f')]+_0x1e37ae[_0xb36c('0x21')];var _0x37db18;if(_0x34cc0c>=_0x43aa6b){_0x34cc0c=_0x43aa6b;_0x37db18=0xc8;}else{_0x37db18=0xce;}_0x2cfbcc[_0xb36c('0x1c')](_0x37db18);return _0x2cfbcc[_0xb36c('0x23')](_0xb36c('0x24'),_0x5d0ef8+'-'+_0x34cc0c+'/'+_0x43aa6b)['json'](_0x3001fc);}return null;};}function patchUpdates(_0x771b0c){return function(_0x1e6ef0){try{jsonpatch[_0xb36c('0x25')](_0x1e6ef0,_0x771b0c,!![]);}catch(_0x4a94e2){return BPromise[_0xb36c('0x26')](_0x4a94e2);}return _0x1e6ef0[_0xb36c('0x27')]();};}function saveUpdates(_0xfe4221,_0x4d257b){return function(_0x211d57){if(_0x211d57){return _0x211d57[_0xb36c('0x28')](_0xfe4221)[_0xb36c('0x29')](function(_0x2a61c8){return _0x2a61c8;});}return null;};}function removeEntity(_0x34e8e9,_0x4ff689){return function(_0x1c80c9){if(_0x1c80c9){return _0x1c80c9[_0xb36c('0x2a')]()['then'](function(){_0x34e8e9[_0xb36c('0x1c')](0xcc)[_0xb36c('0x1d')]();});}};}function handleEntityNotFound(_0x4f81ba,_0x41474f){return function(_0x3d8001){if(!_0x3d8001){_0x4f81ba[_0xb36c('0x1b')](0x194);}return _0x3d8001;};}function handleError(_0x31e670,_0x31e1e0){_0x31e1e0=_0x31e1e0||0x1f4;return function(_0x413f2d){logger['error'](_0x413f2d[_0xb36c('0x2b')]);if(_0x413f2d['name']){delete _0x413f2d['name'];}_0x31e670[_0xb36c('0x1c')](_0x31e1e0)['send'](_0x413f2d);};}exports[_0xb36c('0x2c')]=function(_0x39c83f,_0x41d481){var _0x492ffd={},_0x1ffcc1={},_0x5583f8={'count':0x0,'rows':[]};var _0x3fcee7=_[_0xb36c('0x2d')](db[_0xb36c('0x2e')][_0xb36c('0x2f')],function(_0x38e7b3){return{'name':_0x38e7b3['fieldName'],'type':_0x38e7b3[_0xb36c('0x30')][_0xb36c('0x31')]};});_0x1ffcc1[_0xb36c('0x32')]=_[_0xb36c('0x33')](_['map'](_0x3fcee7,_0xb36c('0x34')),[_0xb36c('0x34')]);_0x1ffcc1[_0xb36c('0x35')]=_[_0xb36c('0x36')](_0x39c83f['query']);_0x1ffcc1[_0xb36c('0x37')]=_[_0xb36c('0x38')](_0x1ffcc1[_0xb36c('0x32')],_0x1ffcc1[_0xb36c('0x35')]);_0x492ffd[_0xb36c('0x39')]=_[_0xb36c('0x38')](_0x1ffcc1[_0xb36c('0x32')],qs[_0xb36c('0x3a')](_0x39c83f['query'][_0xb36c('0x3a')]));_0x492ffd[_0xb36c('0x39')]=_0x492ffd[_0xb36c('0x39')][_0xb36c('0x3b')]?_0x492ffd['attributes']:_0x1ffcc1[_0xb36c('0x32')];if(!_0x39c83f[_0xb36c('0x35')][_0xb36c('0x3c')](_0xb36c('0x3d'))){_0x492ffd[_0xb36c('0x21')]=qs[_0xb36c('0x21')](_0x39c83f[_0xb36c('0x35')]['limit']);_0x492ffd['offset']=qs[_0xb36c('0x1f')](_0x39c83f['query']['offset']);}_0x492ffd['order']=qs['sort'](_0x39c83f[_0xb36c('0x35')][_0xb36c('0x3e')]);_0x492ffd['where']=qs[_0xb36c('0x37')](_[_0xb36c('0x3f')](_0x39c83f[_0xb36c('0x35')],_0x1ffcc1[_0xb36c('0x37')]),_0x3fcee7);if(_0x39c83f['query'][_0xb36c('0x40')]){_0x492ffd[_0xb36c('0x41')]=_[_0xb36c('0x42')](_0x492ffd[_0xb36c('0x41')],{'$or':_[_0xb36c('0x2d')](_0x3fcee7,function(_0x3f6e5d){if(_0x3f6e5d[_0xb36c('0x30')]!==_0xb36c('0x43')){var _0x4b601b={};_0x4b601b[_0x3f6e5d[_0xb36c('0x34')]]={'$like':'%'+_0x39c83f['query'][_0xb36c('0x40')]+'%'};return _0x4b601b;}})});}_0x492ffd=_[_0xb36c('0x42')]({},_0x492ffd,_0x39c83f['options']);var _0x2238e5={'where':_0x492ffd[_0xb36c('0x41')]};return db[_0xb36c('0x2e')][_0xb36c('0x22')](_0x2238e5)[_0xb36c('0x29')](function(_0x57165b){_0x5583f8[_0xb36c('0x22')]=_0x57165b;if(_0x39c83f[_0xb36c('0x35')]['includeAll']){_0x492ffd[_0xb36c('0x44')]=[{'all':!![]}];}return db[_0xb36c('0x2e')][_0xb36c('0x45')](_0x492ffd);})[_0xb36c('0x29')](function(_0x1850eb){_0x5583f8[_0xb36c('0x46')]=_0x1850eb;return _0x5583f8;})[_0xb36c('0x29')](respondWithFilteredResult(_0x41d481,_0x492ffd))[_0xb36c('0x47')](handleError(_0x41d481,null));};exports[_0xb36c('0x48')]=function(_0x234529,_0x4e607a){var _0x5e01ad={'raw':!![],'where':{'id':_0x234529[_0xb36c('0x49')]['id']}},_0x3454b9={};_0x3454b9['model']=_[_0xb36c('0x36')](db[_0xb36c('0x2e')][_0xb36c('0x2f')]);_0x3454b9[_0xb36c('0x35')]=_[_0xb36c('0x36')](_0x234529['query']);_0x3454b9['filters']=_[_0xb36c('0x38')](_0x3454b9[_0xb36c('0x32')],_0x3454b9[_0xb36c('0x35')]);_0x5e01ad[_0xb36c('0x39')]=_[_0xb36c('0x38')](_0x3454b9[_0xb36c('0x32')],qs[_0xb36c('0x3a')](_0x234529[_0xb36c('0x35')][_0xb36c('0x3a')]));_0x5e01ad['attributes']=_0x5e01ad[_0xb36c('0x39')][_0xb36c('0x3b')]?_0x5e01ad[_0xb36c('0x39')]:_0x3454b9['model'];if(_0x234529[_0xb36c('0x35')][_0xb36c('0x4a')]){_0x5e01ad[_0xb36c('0x44')]=[{'all':!![]}];}_0x5e01ad=_[_0xb36c('0x42')]({},_0x5e01ad,_0x234529[_0xb36c('0x4b')]);return db[_0xb36c('0x2e')][_0xb36c('0x4c')](_0x5e01ad)[_0xb36c('0x29')](handleEntityNotFound(_0x4e607a,null))[_0xb36c('0x29')](respondWithResult(_0x4e607a,null))['catch'](handleError(_0x4e607a,null));};exports[_0xb36c('0x4d')]=function(_0x698a83,_0x12eb26){return db[_0xb36c('0x2e')][_0xb36c('0x4d')](_0x698a83['body'],{})[_0xb36c('0x29')](respondWithResult(_0x12eb26,0xc9))[_0xb36c('0x47')](handleError(_0x12eb26,null));};exports[_0xb36c('0x28')]=function(_0x54f74b,_0x376ce8){if(_0x54f74b['body']['id']){delete _0x54f74b[_0xb36c('0x4e')]['id'];}return db[_0xb36c('0x2e')][_0xb36c('0x4c')]({'where':{'id':_0x54f74b['params']['id']}})[_0xb36c('0x29')](handleEntityNotFound(_0x376ce8,null))[_0xb36c('0x29')](saveUpdates(_0x54f74b['body'],null))[_0xb36c('0x29')](respondWithResult(_0x376ce8,null))[_0xb36c('0x47')](handleError(_0x376ce8,null));};exports[_0xb36c('0x2a')]=function(_0x2b1d5b,_0x206bc3){return db['VoiceMailMessage'][_0xb36c('0x4c')]({'where':{'id':_0x2b1d5b['params']['id']}})[_0xb36c('0x29')](handleEntityNotFound(_0x206bc3,null))[_0xb36c('0x29')](removeEntity(_0x206bc3,null))[_0xb36c('0x47')](handleError(_0x206bc3,null));};exports[_0xb36c('0x4f')]=function(_0x24044d,_0x3647a9,_0x4b3bf8){return db['VoiceMailMessage'][_0xb36c('0x4c')]({'where':{'id':_0x24044d[_0xb36c('0x49')]['id']},'attributes':['id',_0xb36c('0x50'),_0xb36c('0x51')]})['then'](handleEntityNotFound(_0x3647a9,null))[_0xb36c('0x29')](function(_0x524485){if(_0x524485){if(!_0x524485[_0xb36c('0x50')]){throw new db[(_0xb36c('0x52'))][(_0xb36c('0x53'))](_0xb36c('0x54'));}var _0x1f385a={'Content-Type':_0xb36c('0x55'),'Content-Disposition':_0xb36c('0x56')};if(_0x524485[_0xb36c('0x51')]){_0x1f385a[_0xb36c('0x57')]=_0xb36c('0x58')+_0x524485[_0xb36c('0x51')]+_0xb36c('0x59');}_0x3647a9[_0xb36c('0x23')](_0x1f385a);return _0x3647a9[_0xb36c('0x5a')](new Buffer(_0x524485[_0xb36c('0x50')]));}})['catch'](handleError(_0x3647a9,null));}; \ No newline at end of file +var _0x5ea0=['count','limit','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceMailMessage','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','set','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x5ea0,0x12f));var _0x05ea=function(_0x403760,_0x2d056a){_0x403760=_0x403760-0x0;var _0x2c9db5=_0x5ea0[_0x403760];return _0x2c9db5;};'use strict';var emlformat=require(_0x05ea('0x0'));var rimraf=require(_0x05ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05ea('0x2'));var rp=require(_0x05ea('0x3'));var moment=require(_0x05ea('0x4'));var BPromise=require(_0x05ea('0x5'));var Mustache=require('mustache');var util=require(_0x05ea('0x6'));var path=require(_0x05ea('0x7'));var sox=require(_0x05ea('0x8'));var csv=require('to-csv');var ejs=require(_0x05ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05ea('0xa'));var squel=require('squel');var crypto=require(_0x05ea('0xb'));var jsforce=require(_0x05ea('0xc'));var deskjs=require(_0x05ea('0xd'));var toCsv=require('to-csv');var querystring=require(_0x05ea('0xe'));var Papa=require(_0x05ea('0xf'));var Redis=require(_0x05ea('0x10'));var authService=require(_0x05ea('0x11'));var qs=require(_0x05ea('0x12'));var as=require(_0x05ea('0x13'));var hardwareService=require(_0x05ea('0x14'));var logger=require(_0x05ea('0x15'))(_0x05ea('0x16'));var utils=require(_0x05ea('0x17'));var config=require(_0x05ea('0x18'));var licenseUtil=require(_0x05ea('0x19'));var db=require(_0x05ea('0x1a'))['db'];function respondWithStatusCode(_0xaa939,_0x2258e3){_0x2258e3=_0x2258e3||0xcc;return function(_0x233831){if(_0x233831){return _0xaa939[_0x05ea('0x1b')](_0x2258e3);}return _0xaa939[_0x05ea('0x1c')](_0x2258e3)[_0x05ea('0x1d')]();};}function respondWithResult(_0x2a4c37,_0x553649){_0x553649=_0x553649||0xc8;return function(_0x2091ed){if(_0x2091ed){return _0x2a4c37[_0x05ea('0x1c')](_0x553649)[_0x05ea('0x1e')](_0x2091ed);}};}function respondWithFilteredResult(_0x58ac89,_0x4cd826){return function(_0x108324){if(_0x108324){var _0x2f3b7d=typeof _0x4cd826[_0x05ea('0x1f')]==='undefined'&&typeof _0x4cd826['limit']===_0x05ea('0x20');var _0x2b9859=_0x108324[_0x05ea('0x21')];var _0x19ff9f=_0x2f3b7d?0x0:_0x4cd826[_0x05ea('0x1f')];var _0xeca14d=_0x2f3b7d?_0x108324[_0x05ea('0x21')]:_0x4cd826[_0x05ea('0x1f')]+_0x4cd826[_0x05ea('0x22')];var _0x34c333;if(_0xeca14d>=_0x2b9859){_0xeca14d=_0x2b9859;_0x34c333=0xc8;}else{_0x34c333=0xce;}_0x58ac89['status'](_0x34c333);return _0x58ac89['set']('Content-Range',_0x19ff9f+'-'+_0xeca14d+'/'+_0x2b9859)[_0x05ea('0x1e')](_0x108324);}return null;};}function patchUpdates(_0x2f7e08){return function(_0x4c340b){try{jsonpatch[_0x05ea('0x23')](_0x4c340b,_0x2f7e08,!![]);}catch(_0x343ee1){return BPromise[_0x05ea('0x24')](_0x343ee1);}return _0x4c340b[_0x05ea('0x25')]();};}function saveUpdates(_0x33a540,_0x17ca65){return function(_0x374496){if(_0x374496){return _0x374496[_0x05ea('0x26')](_0x33a540)[_0x05ea('0x27')](function(_0x38a9dd){return _0x38a9dd;});}return null;};}function removeEntity(_0x59ee82,_0x3265cb){return function(_0x319053){if(_0x319053){return _0x319053[_0x05ea('0x28')]()[_0x05ea('0x27')](function(){_0x59ee82['status'](0xcc)[_0x05ea('0x1d')]();});}};}function handleEntityNotFound(_0x3e453f,_0x17fb8a){return function(_0x52d427){if(!_0x52d427){_0x3e453f[_0x05ea('0x1b')](0x194);}return _0x52d427;};}function handleError(_0x50c043,_0x4150ec){_0x4150ec=_0x4150ec||0x1f4;return function(_0x28dfcc){logger[_0x05ea('0x29')](_0x28dfcc['stack']);if(_0x28dfcc[_0x05ea('0x2a')]){delete _0x28dfcc[_0x05ea('0x2a')];}_0x50c043[_0x05ea('0x1c')](_0x4150ec)[_0x05ea('0x2b')](_0x28dfcc);};}exports[_0x05ea('0x2c')]=function(_0x4cf672,_0x1a60c1){var _0x444912={},_0x9784c3={},_0xff74e6={'count':0x0,'rows':[]};var _0x21ef10=_[_0x05ea('0x2d')](db[_0x05ea('0x2e')]['rawAttributes'],function(_0x279b7b){return{'name':_0x279b7b['fieldName'],'type':_0x279b7b[_0x05ea('0x2f')][_0x05ea('0x30')]};});_0x9784c3[_0x05ea('0x31')]=_['differenceBy'](_[_0x05ea('0x2d')](_0x21ef10,_0x05ea('0x2a')),['name']);_0x9784c3[_0x05ea('0x32')]=_['keys'](_0x4cf672[_0x05ea('0x32')]);_0x9784c3[_0x05ea('0x33')]=_['intersection'](_0x9784c3[_0x05ea('0x31')],_0x9784c3['query']);_0x444912[_0x05ea('0x34')]=_[_0x05ea('0x35')](_0x9784c3[_0x05ea('0x31')],qs[_0x05ea('0x36')](_0x4cf672['query'][_0x05ea('0x36')]));_0x444912[_0x05ea('0x34')]=_0x444912['attributes'][_0x05ea('0x37')]?_0x444912[_0x05ea('0x34')]:_0x9784c3[_0x05ea('0x31')];if(!_0x4cf672[_0x05ea('0x32')][_0x05ea('0x38')](_0x05ea('0x39'))){_0x444912[_0x05ea('0x22')]=qs['limit'](_0x4cf672['query'][_0x05ea('0x22')]);_0x444912[_0x05ea('0x1f')]=qs[_0x05ea('0x1f')](_0x4cf672[_0x05ea('0x32')]['offset']);}_0x444912[_0x05ea('0x3a')]=qs[_0x05ea('0x3b')](_0x4cf672[_0x05ea('0x32')][_0x05ea('0x3b')]);_0x444912['where']=qs['filters'](_[_0x05ea('0x3c')](_0x4cf672[_0x05ea('0x32')],_0x9784c3[_0x05ea('0x33')]),_0x21ef10);if(_0x4cf672[_0x05ea('0x32')][_0x05ea('0x3d')]){_0x444912[_0x05ea('0x3e')]=_['merge'](_0x444912[_0x05ea('0x3e')],{'$or':_[_0x05ea('0x2d')](_0x21ef10,function(_0x147fe2){if(_0x147fe2[_0x05ea('0x2f')]!=='VIRTUAL'){var _0x2d0fae={};_0x2d0fae[_0x147fe2['name']]={'$like':'%'+_0x4cf672[_0x05ea('0x32')][_0x05ea('0x3d')]+'%'};return _0x2d0fae;}})});}_0x444912=_[_0x05ea('0x3f')]({},_0x444912,_0x4cf672[_0x05ea('0x40')]);var _0x1a50a1={'where':_0x444912['where']};return db[_0x05ea('0x2e')]['count'](_0x1a50a1)[_0x05ea('0x27')](function(_0x570731){_0xff74e6[_0x05ea('0x21')]=_0x570731;if(_0x4cf672[_0x05ea('0x32')][_0x05ea('0x41')]){_0x444912['include']=[{'all':!![]}];}return db[_0x05ea('0x2e')][_0x05ea('0x42')](_0x444912);})['then'](function(_0x5f3d60){_0xff74e6[_0x05ea('0x43')]=_0x5f3d60;return _0xff74e6;})[_0x05ea('0x27')](respondWithFilteredResult(_0x1a60c1,_0x444912))[_0x05ea('0x44')](handleError(_0x1a60c1,null));};exports[_0x05ea('0x45')]=function(_0x5ae80d,_0x346e7b){var _0x48b502={'raw':!![],'where':{'id':_0x5ae80d[_0x05ea('0x46')]['id']}},_0x3d7e81={};_0x3d7e81['model']=_[_0x05ea('0x47')](db[_0x05ea('0x2e')][_0x05ea('0x48')]);_0x3d7e81[_0x05ea('0x32')]=_[_0x05ea('0x47')](_0x5ae80d['query']);_0x3d7e81[_0x05ea('0x33')]=_[_0x05ea('0x35')](_0x3d7e81[_0x05ea('0x31')],_0x3d7e81[_0x05ea('0x32')]);_0x48b502[_0x05ea('0x34')]=_[_0x05ea('0x35')](_0x3d7e81[_0x05ea('0x31')],qs['fields'](_0x5ae80d[_0x05ea('0x32')][_0x05ea('0x36')]));_0x48b502[_0x05ea('0x34')]=_0x48b502[_0x05ea('0x34')][_0x05ea('0x37')]?_0x48b502[_0x05ea('0x34')]:_0x3d7e81[_0x05ea('0x31')];if(_0x5ae80d[_0x05ea('0x32')][_0x05ea('0x41')]){_0x48b502[_0x05ea('0x49')]=[{'all':!![]}];}_0x48b502=_['merge']({},_0x48b502,_0x5ae80d[_0x05ea('0x40')]);return db[_0x05ea('0x2e')][_0x05ea('0x4a')](_0x48b502)[_0x05ea('0x27')](handleEntityNotFound(_0x346e7b,null))['then'](respondWithResult(_0x346e7b,null))['catch'](handleError(_0x346e7b,null));};exports[_0x05ea('0x4b')]=function(_0x14e403,_0x14daa4){return db[_0x05ea('0x2e')][_0x05ea('0x4b')](_0x14e403[_0x05ea('0x4c')],{})[_0x05ea('0x27')](respondWithResult(_0x14daa4,0xc9))[_0x05ea('0x44')](handleError(_0x14daa4,null));};exports[_0x05ea('0x26')]=function(_0x6ecf0c,_0x3ef8da){if(_0x6ecf0c[_0x05ea('0x4c')]['id']){delete _0x6ecf0c[_0x05ea('0x4c')]['id'];}return db['VoiceMailMessage'][_0x05ea('0x4a')]({'where':{'id':_0x6ecf0c[_0x05ea('0x46')]['id']}})[_0x05ea('0x27')](handleEntityNotFound(_0x3ef8da,null))[_0x05ea('0x27')](saveUpdates(_0x6ecf0c[_0x05ea('0x4c')],null))[_0x05ea('0x27')](respondWithResult(_0x3ef8da,null))['catch'](handleError(_0x3ef8da,null));};exports[_0x05ea('0x28')]=function(_0x265e5b,_0x560d12){return db['VoiceMailMessage'][_0x05ea('0x4a')]({'where':{'id':_0x265e5b[_0x05ea('0x46')]['id']}})[_0x05ea('0x27')](handleEntityNotFound(_0x560d12,null))[_0x05ea('0x27')](removeEntity(_0x560d12,null))[_0x05ea('0x44')](handleError(_0x560d12,null));};exports[_0x05ea('0x4d')]=function(_0x387d90,_0x1185f6,_0x289c5d){return db[_0x05ea('0x2e')]['find']({'where':{'id':_0x387d90[_0x05ea('0x46')]['id']},'attributes':['id',_0x05ea('0x4e'),_0x05ea('0x4f')]})[_0x05ea('0x27')](handleEntityNotFound(_0x1185f6,null))['then'](function(_0x16e3dd){if(_0x16e3dd){if(!_0x16e3dd['recording']){throw new db[(_0x05ea('0x50'))]['ValidationError'](_0x05ea('0x51'));}var _0x6d2530={'Content-Type':_0x05ea('0x52'),'Content-Disposition':'attachment'};if(_0x16e3dd['msg_id']){_0x6d2530['Content-Disposition']='attachment;\x20filename=\x22'+_0x16e3dd[_0x05ea('0x4f')]+'.wav\x22';}_0x1185f6[_0x05ea('0x53')](_0x6d2530);return _0x1185f6[_0x05ea('0x2b')](new Buffer(_0x16e3dd[_0x05ea('0x4e')]));}})['catch'](handleError(_0x1185f6,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9fff21c..f55393f 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 _0xf2dd=['api','moment','request-promise','path','rimraf','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x4d1c5c,_0x32cf69){var _0x314f6b=function(_0x1dd1be){while(--_0x1dd1be){_0x4d1c5c['push'](_0x4d1c5c['shift']());}};_0x314f6b(++_0x32cf69);}(_0xf2dd,0x1c4));var _0xdf2d=function(_0x318dda,_0x1aa800){_0x318dda=_0x318dda-0x0;var _0x3f97ca=_0xf2dd[_0x318dda];return _0x3f97ca;};'use strict';var _=require(_0xdf2d('0x0'));var util=require(_0xdf2d('0x1'));var logger=require(_0xdf2d('0x2'))(_0xdf2d('0x3'));var moment=require(_0xdf2d('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf2d('0x5'));var fs=require('fs');var path=require(_0xdf2d('0x6'));var rimraf=require(_0xdf2d('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf2d('0x8'));module['exports']=function(_0x2cdf5b,_0x4b5e0d){return _0x2cdf5b[_0xdf2d('0x9')](_0xdf2d('0xa'),attributes,{'tableName':_0xdf2d('0xb'),'paranoid':![],'indexes':[{'name':_0xdf2d('0xc'),'fields':[_0xdf2d('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb34f=['path','exports','VoiceMailMessage','voice_voicemail_messages','dir','api','moment','bluebird'];(function(_0x57955c,_0x2d45c7){var _0x369f81=function(_0x140549){while(--_0x140549){_0x57955c['push'](_0x57955c['shift']());}};_0x369f81(++_0x2d45c7);}(_0xb34f,0x145));var _0xfb34=function(_0x582cc1,_0x3d171c){_0x582cc1=_0x582cc1-0x0;var _0x3a2c57=_0xb34f[_0x582cc1];return _0x3a2c57;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xfb34('0x0'));var moment=require(_0xfb34('0x1'));var BPromise=require(_0xfb34('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb34('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xfb34('0x4')]=function(_0xc139d5,_0x464123){return _0xc139d5['define'](_0xfb34('0x5'),attributes,{'tableName':_0xfb34('0x6'),'paranoid':![],'indexes':[{'name':_0xfb34('0x7'),'fields':[_0xfb34('0x7')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c04a28d..f7469d3 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 _0xedf5=['http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0xedf5,0xc5));var _0x5edf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xedf5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5edf('0x0'));var moment=require(_0x5edf('0x1'));var BPromise=require(_0x5edf('0x2'));var rs=require(_0x5edf('0x3'));var fs=require('fs');var Redis=require(_0x5edf('0x4'));var db=require(_0x5edf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5edf('0x6'))('rpc');var config=require(_0x5edf('0x7'));var jayson=require(_0x5edf('0x8'));var client=jayson[_0x5edf('0x9')][_0x5edf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x552d5a,_0x24c45c,_0x4e77e3){return new BPromise(function(_0x47c7eb,_0x3cfd8){return client[_0x5edf('0xb')](_0x552d5a,_0x4e77e3)[_0x5edf('0xc')](function(_0x2fb2c9){logger[_0x5edf('0xd')](_0x5edf('0xe'),_0x24c45c,_0x5edf('0xf'));logger[_0x5edf('0x10')](_0x5edf('0x11'),_0x24c45c,_0x5edf('0xf'),JSON['stringify'](_0x2fb2c9));if(_0x2fb2c9[_0x5edf('0x12')]){if(_0x2fb2c9[_0x5edf('0x12')][_0x5edf('0x13')]===0x1f4){logger[_0x5edf('0x12')](_0x5edf('0xe'),_0x24c45c,_0x2fb2c9['error'][_0x5edf('0x14')]);return _0x3cfd8(_0x2fb2c9[_0x5edf('0x12')][_0x5edf('0x14')]);}logger[_0x5edf('0x12')](_0x5edf('0xe'),_0x24c45c,_0x2fb2c9[_0x5edf('0x12')][_0x5edf('0x14')]);return _0x47c7eb(_0x2fb2c9['error'][_0x5edf('0x14')]);}else{logger[_0x5edf('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x24c45c,'request\x20sent');_0x47c7eb(_0x2fb2c9[_0x5edf('0x15')][_0x5edf('0x14')]);}})[_0x5edf('0x16')](function(_0x123b30){logger[_0x5edf('0x12')](_0x5edf('0xe'),_0x24c45c,_0x123b30);_0x3cfd8(_0x123b30);});});} \ No newline at end of file +var _0x14e8=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x216c53,_0x135d35){var _0x3b95d1=function(_0x2d7b01){while(--_0x2d7b01){_0x216c53['push'](_0x216c53['shift']());}};_0x3b95d1(++_0x135d35);}(_0x14e8,0x1b2));var _0x814e=function(_0x29445a,_0x440f31){_0x29445a=_0x29445a-0x0;var _0x13349e=_0x14e8[_0x29445a];return _0x13349e;};'use strict';var _=require(_0x814e('0x0'));var util=require(_0x814e('0x1'));var moment=require(_0x814e('0x2'));var BPromise=require(_0x814e('0x3'));var rs=require(_0x814e('0x4'));var fs=require('fs');var Redis=require(_0x814e('0x5'));var db=require(_0x814e('0x6'))['db'];var utils=require(_0x814e('0x7'));var logger=require(_0x814e('0x8'))(_0x814e('0x9'));var config=require(_0x814e('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5149,_0x5ac55a,_0x1a7bab){return new BPromise(function(_0x3955e5,_0x414aed){return client[_0x814e('0xb')](_0x2d5149,_0x1a7bab)[_0x814e('0xc')](function(_0x477068){logger[_0x814e('0xd')](_0x814e('0xe'),_0x5ac55a,_0x814e('0xf'));logger[_0x814e('0x10')](_0x814e('0x11'),_0x5ac55a,_0x814e('0xf'),JSON[_0x814e('0x12')](_0x477068));if(_0x477068[_0x814e('0x13')]){if(_0x477068[_0x814e('0x13')][_0x814e('0x14')]===0x1f4){logger[_0x814e('0x13')](_0x814e('0xe'),_0x5ac55a,_0x477068[_0x814e('0x13')][_0x814e('0x15')]);return _0x414aed(_0x477068['error'][_0x814e('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5ac55a,_0x477068['error'][_0x814e('0x15')]);return _0x3955e5(_0x477068['error'][_0x814e('0x15')]);}else{logger[_0x814e('0xd')](_0x814e('0xe'),_0x5ac55a,'request\x20sent');_0x3955e5(_0x477068[_0x814e('0x16')][_0x814e('0x15')]);}})[_0x814e('0x17')](function(_0xbaf1b0){logger[_0x814e('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ac55a,_0xbaf1b0);_0x414aed(_0xbaf1b0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8490968..2295f9a 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 _0xa548=['update','delete','/:id','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0xa548,0x1a3));var _0x8a54=function(_0x296911,_0x137738){_0x296911=_0x296911-0x0;var _0x47bf1f=_0xa548[_0x296911];return _0x47bf1f;};'use strict';var multer=require(_0x8a54('0x0'));var util=require(_0x8a54('0x1'));var path=require(_0x8a54('0x2'));var timeout=require(_0x8a54('0x3'));var express=require(_0x8a54('0x4'));var router=express[_0x8a54('0x5')]();var fs_extra=require(_0x8a54('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8a54('0x7'));router[_0x8a54('0x8')]('/',auth[_0x8a54('0x9')](),controller[_0x8a54('0xa')]);router['get']('/:id',auth[_0x8a54('0x9')](),controller[_0x8a54('0xb')]);router[_0x8a54('0x8')](_0x8a54('0xc'),auth['isAuthenticated'](),controller[_0x8a54('0xd')]);router[_0x8a54('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a54('0xf')]);router[_0x8a54('0xe')](_0x8a54('0xc'),auth[_0x8a54('0x9')](),controller[_0x8a54('0x10')]);router[_0x8a54('0x11')]('/:id',auth[_0x8a54('0x9')](),controller[_0x8a54('0x12')]);router[_0x8a54('0x13')](_0x8a54('0x14'),auth[_0x8a54('0x9')](),controller['destroy']);router[_0x8a54('0x13')](_0x8a54('0x15'),auth['isAuthenticated'](),controller['removeSound']);module[_0x8a54('0x16')]=router; \ No newline at end of file +var _0x3b37=['post','create','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x226dc1,_0x594c11){var _0xabb710=function(_0x2a4354){while(--_0x2a4354){_0x226dc1['push'](_0x226dc1['shift']());}};_0xabb710(++_0x594c11);}(_0x3b37,0xd3));var _0x73b3=function(_0x372987,_0x34dd55){_0x372987=_0x372987-0x0;var _0x3b67ab=_0x3b37[_0x372987];return _0x3b67ab;};'use strict';var multer=require(_0x73b3('0x0'));var util=require(_0x73b3('0x1'));var path=require(_0x73b3('0x2'));var timeout=require(_0x73b3('0x3'));var express=require(_0x73b3('0x4'));var router=express[_0x73b3('0x5')]();var fs_extra=require(_0x73b3('0x6'));var auth=require(_0x73b3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x73b3('0x8'));var controller=require(_0x73b3('0x9'));router[_0x73b3('0xa')]('/',auth[_0x73b3('0xb')](),controller[_0x73b3('0xc')]);router[_0x73b3('0xa')](_0x73b3('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/sounds',auth[_0x73b3('0xb')](),controller['getSounds']);router[_0x73b3('0xe')]('/',auth[_0x73b3('0xb')](),controller[_0x73b3('0xf')]);router[_0x73b3('0xe')](_0x73b3('0x10'),auth[_0x73b3('0xb')](),controller[_0x73b3('0x11')]);router[_0x73b3('0x12')]('/:id',auth[_0x73b3('0xb')](),controller[_0x73b3('0x13')]);router[_0x73b3('0x14')](_0x73b3('0xd'),auth[_0x73b3('0xb')](),controller[_0x73b3('0x15')]);router[_0x73b3('0x14')](_0x73b3('0x16'),auth['isAuthenticated'](),controller[_0x73b3('0x17')]);module[_0x73b3('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 03c9ec4..66d829f 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 _0xac32=['name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x3e04c4,_0x48101b){var _0x543e0f=function(_0x240c8b){while(--_0x240c8b){_0x3e04c4['push'](_0x3e04c4['shift']());}};_0x543e0f(++_0x48101b);}(_0xac32,0x1de));var _0x2ac3=function(_0x1915e2,_0x51f382){_0x1915e2=_0x1915e2-0x0;var _0x550ab2=_0xac32[_0x1915e2];return _0x550ab2;};'use strict';var Sequelize=require(_0x2ac3('0x0'));module[_0x2ac3('0x1')]={'name':{'type':Sequelize[_0x2ac3('0x2')],'allowNull':![],'unique':_0x2ac3('0x3')},'mode':{'type':Sequelize[_0x2ac3('0x4')](_0x2ac3('0x5'),'files',_0x2ac3('0x6'),_0x2ac3('0x7'),_0x2ac3('0x8'),_0x2ac3('0x9')),'allowNull':!![],'defaultValue':_0x2ac3('0xa')},'directory':{'type':Sequelize[_0x2ac3('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x2ac3('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2ac3('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2ac3('0x2')],'allowNull':!![]},'stamp':{'type':_0x2ac3('0xb')},'defaultEntry':{'type':Sequelize[_0x2ac3('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x24a0=['BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x53b816,_0x513ac9){var _0x10c36d=function(_0x571b4c){while(--_0x571b4c){_0x53b816['push'](_0x53b816['shift']());}};_0x10c36d(++_0x513ac9);}(_0x24a0,0x160));var _0x024a=function(_0x41eb49,_0x3357eb){_0x41eb49=_0x41eb49-0x0;var _0x51fd61=_0x24a0[_0x41eb49];return _0x51fd61;};'use strict';var Sequelize=require(_0x024a('0x0'));module['exports']={'name':{'type':Sequelize[_0x024a('0x1')],'allowNull':![],'unique':_0x024a('0x2')},'mode':{'type':Sequelize[_0x024a('0x3')](_0x024a('0x4'),_0x024a('0x5'),_0x024a('0x6'),_0x024a('0x7'),_0x024a('0x8'),_0x024a('0x9')),'allowNull':!![],'defaultValue':_0x024a('0x5')},'directory':{'type':Sequelize[_0x024a('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x024a('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x024a('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x024a('0x1')],'allowNull':!![],'defaultValue':_0x024a('0xa')},'format':{'type':Sequelize[_0x024a('0x1')],'allowNull':!![]},'stamp':{'type':_0x024a('0xb')},'defaultEntry':{'type':Sequelize[_0x024a('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 7d3531a..642c902 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 _0xdf28=['autoAssociation','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','save_name','extname','symlinkSync','removeSound','id2','Sound','nolimit','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','update','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId'];(function(_0x360b36,_0x5da2ae){var _0x566705=function(_0x3c84af){while(--_0x3c84af){_0x360b36['push'](_0x360b36['shift']());}};_0x566705(++_0x5da2ae);}(_0xdf28,0x104));var _0x8df2=function(_0x54ba5b,_0x5b7508){_0x54ba5b=_0x54ba5b-0x0;var _0x5e16ac=_0xdf28[_0x54ba5b];return _0x5e16ac;};'use strict';var emlformat=require(_0x8df2('0x0'));var rimraf=require(_0x8df2('0x1'));var zipdir=require(_0x8df2('0x2'));var jsonpatch=require(_0x8df2('0x3'));var rp=require('request-promise');var moment=require(_0x8df2('0x4'));var BPromise=require(_0x8df2('0x5'));var Mustache=require(_0x8df2('0x6'));var util=require(_0x8df2('0x7'));var path=require(_0x8df2('0x8'));var sox=require(_0x8df2('0x9'));var csv=require(_0x8df2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8df2('0xb'));var _=require('lodash');var squel=require(_0x8df2('0xc'));var crypto=require(_0x8df2('0xd'));var jsforce=require(_0x8df2('0xe'));var deskjs=require(_0x8df2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8df2('0x10'));var Papa=require(_0x8df2('0x11'));var Redis=require('ioredis');var authService=require(_0x8df2('0x12'));var qs=require(_0x8df2('0x13'));var as=require(_0x8df2('0x14'));var hardwareService=require(_0x8df2('0x15'));var logger=require(_0x8df2('0x16'))('api');var utils=require(_0x8df2('0x17'));var config=require(_0x8df2('0x18'));var licenseUtil=require(_0x8df2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x385f51,_0x4830ac){_0x4830ac=_0x4830ac||0xcc;return function(_0x26b2a8){if(_0x26b2a8){return _0x385f51[_0x8df2('0x1a')](_0x4830ac);}return _0x385f51[_0x8df2('0x1b')](_0x4830ac)[_0x8df2('0x1c')]();};}function respondWithResult(_0x30e9f7,_0x384315){_0x384315=_0x384315||0xc8;return function(_0x16ea70){if(_0x16ea70){return _0x30e9f7[_0x8df2('0x1b')](_0x384315)['json'](_0x16ea70);}};}function respondWithFilteredResult(_0x3da476,_0x331859){return function(_0xa1edaf){if(_0xa1edaf){var _0x1038c2=typeof _0x331859[_0x8df2('0x1d')]===_0x8df2('0x1e')&&typeof _0x331859[_0x8df2('0x1f')]==='undefined';var _0x3383af=_0xa1edaf['count'];var _0x4ebbe4=_0x1038c2?0x0:_0x331859[_0x8df2('0x1d')];var _0x266b96=_0x1038c2?_0xa1edaf[_0x8df2('0x20')]:_0x331859[_0x8df2('0x1d')]+_0x331859[_0x8df2('0x1f')];var _0x1ac549;if(_0x266b96>=_0x3383af){_0x266b96=_0x3383af;_0x1ac549=0xc8;}else{_0x1ac549=0xce;}_0x3da476[_0x8df2('0x1b')](_0x1ac549);return _0x3da476[_0x8df2('0x21')](_0x8df2('0x22'),_0x4ebbe4+'-'+_0x266b96+'/'+_0x3383af)[_0x8df2('0x23')](_0xa1edaf);}return null;};}function patchUpdates(_0x31ce92){return function(_0xcb1668){try{jsonpatch[_0x8df2('0x24')](_0xcb1668,_0x31ce92,!![]);}catch(_0x1b3e0f){return BPromise[_0x8df2('0x25')](_0x1b3e0f);}return _0xcb1668[_0x8df2('0x26')]();};}function saveUpdates(_0x43372f,_0x405d30){return function(_0x3094a0){if(_0x3094a0){return _0x3094a0['update'](_0x43372f)['then'](function(_0x233188){return _0x233188;});}return null;};}function removeEntity(_0x452994,_0x24c626){return function(_0x46292b){if(_0x46292b){return _0x46292b['destroy']()[_0x8df2('0x27')](function(){var _0x234c58=_0x46292b[_0x8df2('0x28')]({'plain':!![]});var _0x1e8772=_0x8df2('0x29');return db[_0x8df2('0x2a')][_0x8df2('0x2b')]({'where':{'type':_0x1e8772,'resourceId':_0x234c58['id']}})[_0x8df2('0x27')](function(){return _0x46292b;});})[_0x8df2('0x27')](function(){_0x452994[_0x8df2('0x1b')](0xcc)[_0x8df2('0x1c')]();});}};}function handleEntityNotFound(_0x4b5acc,_0x8b24ef){return function(_0x4d55a8){if(!_0x4d55a8){_0x4b5acc[_0x8df2('0x1a')](0x194);}return _0x4d55a8;};}function handleError(_0x594c3a,_0x3cfdbc){_0x3cfdbc=_0x3cfdbc||0x1f4;return function(_0x82790f){logger[_0x8df2('0x2c')](_0x82790f[_0x8df2('0x2d')]);if(_0x82790f[_0x8df2('0x2e')]){delete _0x82790f[_0x8df2('0x2e')];}_0x594c3a[_0x8df2('0x1b')](_0x3cfdbc)[_0x8df2('0x2f')](_0x82790f);};}exports[_0x8df2('0x30')]=function(_0x545a94,_0x40690f){var _0x4833fe={},_0x28ee73={},_0x395309={'count':0x0,'rows':[]};var _0x1ed436=_['map'](db[_0x8df2('0x31')][_0x8df2('0x32')],function(_0x42622d){return{'name':_0x42622d[_0x8df2('0x33')],'type':_0x42622d['type'][_0x8df2('0x34')]};});_0x28ee73[_0x8df2('0x35')]=_[_0x8df2('0x36')](_0x1ed436,_0x8df2('0x2e'));_0x28ee73[_0x8df2('0x37')]=_[_0x8df2('0x38')](_0x545a94['query']);_0x28ee73[_0x8df2('0x39')]=_[_0x8df2('0x3a')](_0x28ee73[_0x8df2('0x35')],_0x28ee73[_0x8df2('0x37')]);_0x4833fe[_0x8df2('0x3b')]=_[_0x8df2('0x3a')](_0x28ee73[_0x8df2('0x35')],qs[_0x8df2('0x3c')](_0x545a94[_0x8df2('0x37')]['fields']));_0x4833fe[_0x8df2('0x3b')]=_0x4833fe[_0x8df2('0x3b')][_0x8df2('0x3d')]?_0x4833fe[_0x8df2('0x3b')]:_0x28ee73[_0x8df2('0x35')];if(!_0x545a94[_0x8df2('0x37')][_0x8df2('0x3e')]('nolimit')){_0x4833fe[_0x8df2('0x1f')]=qs[_0x8df2('0x1f')](_0x545a94['query']['limit']);_0x4833fe[_0x8df2('0x1d')]=qs['offset'](_0x545a94[_0x8df2('0x37')][_0x8df2('0x1d')]);}_0x4833fe[_0x8df2('0x3f')]=qs['sort'](_0x545a94[_0x8df2('0x37')][_0x8df2('0x40')]);delete _0x545a94['query'][_0x8df2('0x40')];_0x4833fe[_0x8df2('0x41')]=qs[_0x8df2('0x39')](_[_0x8df2('0x42')](_0x545a94['query'],_0x28ee73[_0x8df2('0x39')]),_0x1ed436);if(_0x545a94['query']['filter']){_0x4833fe[_0x8df2('0x41')]=_[_0x8df2('0x43')](_0x4833fe[_0x8df2('0x41')],{'$or':_['map'](_0x1ed436,function(_0x1d70cb){if(_0x1d70cb[_0x8df2('0x44')]!==_0x8df2('0x45')){var _0x212b6={};_0x212b6[_0x1d70cb[_0x8df2('0x2e')]]={'$like':'%'+_0x545a94[_0x8df2('0x37')][_0x8df2('0x46')]+'%'};return _0x212b6;}})});}_0x4833fe=_[_0x8df2('0x43')]({},_0x4833fe,_0x545a94[_0x8df2('0x47')]);var _0x43ded3={'where':_0x4833fe[_0x8df2('0x41')]};return db[_0x8df2('0x31')][_0x8df2('0x20')](_0x43ded3)[_0x8df2('0x27')](function(_0xef74e6){_0x395309['count']=_0xef74e6;if(_0x545a94[_0x8df2('0x37')][_0x8df2('0x48')]){_0x4833fe[_0x8df2('0x49')]=[{'all':!![]}];}return db[_0x8df2('0x31')][_0x8df2('0x4a')](_0x4833fe);})[_0x8df2('0x27')](function(_0x10bafc){_0x395309[_0x8df2('0x4b')]=_0x10bafc;return _0x395309;})[_0x8df2('0x27')](respondWithFilteredResult(_0x40690f,_0x4833fe))['catch'](handleError(_0x40690f,null));};exports[_0x8df2('0x4c')]=function(_0x503252,_0x2603bb){var _0x2fd2e8={'raw':![],'where':{'id':_0x503252[_0x8df2('0x4d')]['id']}},_0x3b3819={};_0x3b3819[_0x8df2('0x35')]=_[_0x8df2('0x38')](db[_0x8df2('0x31')]['rawAttributes']);_0x3b3819[_0x8df2('0x37')]=_[_0x8df2('0x38')](_0x503252[_0x8df2('0x37')]);_0x3b3819[_0x8df2('0x39')]=_[_0x8df2('0x3a')](_0x3b3819[_0x8df2('0x35')],_0x3b3819[_0x8df2('0x37')]);_0x2fd2e8[_0x8df2('0x3b')]=_[_0x8df2('0x3a')](_0x3b3819[_0x8df2('0x35')],qs[_0x8df2('0x3c')](_0x503252['query'][_0x8df2('0x3c')]));_0x2fd2e8['attributes']=_0x2fd2e8['attributes'][_0x8df2('0x3d')]?_0x2fd2e8['attributes']:_0x3b3819['model'];if(_0x503252[_0x8df2('0x37')][_0x8df2('0x48')]){_0x2fd2e8['include']=[{'all':!![]}];}_0x2fd2e8=_[_0x8df2('0x43')]({},_0x2fd2e8,_0x503252[_0x8df2('0x47')]);return db[_0x8df2('0x31')][_0x8df2('0x4e')](_0x2fd2e8)[_0x8df2('0x27')](handleEntityNotFound(_0x2603bb,null))['then'](respondWithResult(_0x2603bb,null))[_0x8df2('0x4f')](handleError(_0x2603bb,null));};exports[_0x8df2('0x50')]=function(_0x39a1f3,_0x418d88){if(_0x39a1f3[_0x8df2('0x51')]['id']){delete _0x39a1f3[_0x8df2('0x51')]['id'];}return db[_0x8df2('0x31')][_0x8df2('0x4e')]({'where':{'id':_0x39a1f3[_0x8df2('0x4d')]['id']}})[_0x8df2('0x27')](handleEntityNotFound(_0x418d88,null))[_0x8df2('0x27')](saveUpdates(_0x39a1f3[_0x8df2('0x51')],null))[_0x8df2('0x27')](respondWithResult(_0x418d88,null))[_0x8df2('0x4f')](handleError(_0x418d88,null));};exports[_0x8df2('0x52')]=function(_0x406380,_0x2beea7,_0x485e3c){return db[_0x8df2('0x53')][_0x8df2('0x54')](function(_0x26d330){if(_0x406380['body'][_0x8df2('0x55')]===_0x8df2('0x56')){_0x406380[_0x8df2('0x51')][_0x8df2('0x57')]=path['join'](config[_0x8df2('0x58')],_0x8df2('0x59'),_0x406380['body']['name']);}return db[_0x8df2('0x31')][_0x8df2('0x52')](_0x406380[_0x8df2('0x51')],{'transaction':_0x26d330})['then'](function(_0x323a67){if(_0x406380[_0x8df2('0x51')]['mode']===_0x8df2('0x56')){fs[_0x8df2('0x5a')](_0x323a67[_0x8df2('0x57')],parseInt('0777',0x8));}var _0x24ab92=_0x406380[_0x8df2('0x5b')][_0x8df2('0x28')]({'plain':!![]});if(!_0x24ab92)throw new Error(_0x8df2('0x5c'));if(_0x24ab92['role']===_0x8df2('0x5b')){var _0x10e110=_0x323a67[_0x8df2('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x8df2('0x4e')]({'where':{'name':_0x8df2('0x29'),'userProfileId':_0x24ab92[_0x8df2('0x5d')]},'raw':!![]})[_0x8df2('0x27')](function(_0x4b4be9){if(_0x4b4be9&&_0x4b4be9[_0x8df2('0x5e')]===0x0){return db['UserProfileResource'][_0x8df2('0x52')]({'name':_0x10e110[_0x8df2('0x2e')],'resourceId':_0x10e110['id'],'type':_0x4b4be9[_0x8df2('0x2e')],'sectionId':_0x4b4be9['id']},{})['then'](function(){return _0x323a67;});}else{return _0x323a67;}})[_0x8df2('0x4f')](function(_0x457722){logger[_0x8df2('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x457722);});}return _0x323a67;});})[_0x8df2('0x27')](respondWithResult(_0x2beea7,0xc9))[_0x8df2('0x4f')](handleError(_0x2beea7,null));};exports[_0x8df2('0x2b')]=function(_0x518eff,_0x2ba117,_0x5f6d16){var _0x3084c8;return db[_0x8df2('0x31')][_0x8df2('0x4e')]({'where':{'id':_0x518eff[_0x8df2('0x4d')]['id']}})['then'](function(_0x326770){if(_0x326770){return db['sequelize']['transaction'](function(_0x424036){return _0x326770[_0x8df2('0x2b')]({'transaction':_0x424036,'raw':!![]})[_0x8df2('0x27')](function(_0x2f1a52){if(_0x2f1a52['directory']){fs[_0x8df2('0x5f')](_0x2f1a52[_0x8df2('0x57')])[_0x8df2('0x60')](function(_0x2d5f84){fs[_0x8df2('0x61')](path['join'](_0x2f1a52[_0x8df2('0x57')],_0x2d5f84));});fs[_0x8df2('0x62')](_0x2f1a52[_0x8df2('0x57')]);}return _0x2f1a52;});})['catch'](function(_0x3c1cdd){throw new db[(_0x8df2('0x63'))][(_0x8df2('0x64'))](_0x3c1cdd[_0x8df2('0x65')]);});}})[_0x8df2('0x27')](handleEntityNotFound(_0x2ba117,null))['then'](removeEntity(_0x2ba117,null))[_0x8df2('0x4f')](handleError(_0x2ba117,null));};exports['addSound']=function(_0x175527,_0x3bd37f,_0x2e69a2){return db[_0x8df2('0x53')][_0x8df2('0x54')](function(_0x3b98f0){var _0x3615e1;return db[_0x8df2('0x31')][_0x8df2('0x4e')]({'where':{'id':_0x175527[_0x8df2('0x4d')]['id']}})['then'](function(_0x479109){if(_0x479109){_0x3615e1=_0x479109;return _0x479109[_0x8df2('0x66')](_0x175527[_0x8df2('0x51')]['id'],{'transaction':_0x3b98f0});}})[_0x8df2('0x27')](function(_0x2c5d67){if(_0x2c5d67){return db['Sound'][_0x8df2('0x67')]({'where':{'id':_0x175527[_0x8df2('0x51')]['id']},'attributes':['id',_0x8df2('0x2e'),'save_name',_0x8df2('0x68'),_0x8df2('0x69')],'raw':!![]});}})[_0x8df2('0x27')](function(_0x5efe5f){if(_0x5efe5f){var _0xbe7e95=path[_0x8df2('0x6a')](config[_0x8df2('0x58')],_0x8df2('0x6b'),util[_0x8df2('0x6c')](_0x8df2('0x6d'),path['basename'](_0x5efe5f[_0x8df2('0x6e')],path[_0x8df2('0x6f')](_0x5efe5f['save_name'])),_0x5efe5f[_0x8df2('0x68')]));var _0x2c1c6f=path['join'](config[_0x8df2('0x58')],_0x8df2('0x59'),_0x3615e1[_0x8df2('0x2e')],util[_0x8df2('0x6c')](_0x8df2('0x6d'),_0x5efe5f[_0x8df2('0x2e')],_0x5efe5f['converted_format']));fs[_0x8df2('0x70')](_0xbe7e95,_0x2c1c6f);return _0x5efe5f;}})[_0x8df2('0x4f')](function(_0x5d7c6b){throw new db['Sequelize'][(_0x8df2('0x64'))](_0x5d7c6b[_0x8df2('0x65')]);});})[_0x8df2('0x27')](handleEntityNotFound(_0x3bd37f,null))[_0x8df2('0x27')](respondWithResult(_0x3bd37f,0xc9))[_0x8df2('0x4f')](handleError(_0x3bd37f,null));};exports['removeSound']=function(_0x1b41b3,_0x34523e,_0x56150f){return db[_0x8df2('0x53')][_0x8df2('0x54')](function(_0x41a031){var _0x2e1112;return db[_0x8df2('0x31')]['findOne']({'where':{'id':_0x1b41b3[_0x8df2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34523e,null))[_0x8df2('0x27')](function(_0x427874){if(_0x427874){_0x2e1112=_0x427874;return _0x427874[_0x8df2('0x71')](_0x1b41b3['params']['id2']);}})[_0x8df2('0x27')](function(_0x16ab29){if(_0x16ab29){return db['Sound'][_0x8df2('0x67')]({'where':{'id':_0x1b41b3[_0x8df2('0x4d')][_0x8df2('0x72')]},'attributes':['id','name','save_name',_0x8df2('0x68'),'createdAt'],'raw':!![]});}})[_0x8df2('0x27')](function(_0x36b3a6){if(_0x36b3a6){fs[_0x8df2('0x61')](path[_0x8df2('0x6a')](_0x2e1112[_0x8df2('0x57')],util[_0x8df2('0x6c')]('%s.%s',_0x36b3a6[_0x8df2('0x2e')],_0x36b3a6[_0x8df2('0x68')])));return _0x36b3a6;}})[_0x8df2('0x4f')](function(_0x3bb7d2){throw new db[(_0x8df2('0x63'))][(_0x8df2('0x64'))](_0x3bb7d2[_0x8df2('0x65')]);});})[_0x8df2('0x27')](handleEntityNotFound(_0x34523e,null))[_0x8df2('0x27')](respondWithStatusCode(_0x34523e,0xcc))[_0x8df2('0x4f')](handleError(_0x34523e,null));};exports['getSounds']=function(_0x46a6ed,_0xba6ad3,_0x51a419){var _0x215cc6={};var _0x1a5bb2={};var _0x53f85c;var _0x4d7b3c;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x46a6ed[_0x8df2('0x4d')]['id']}})[_0x8df2('0x27')](handleEntityNotFound(_0xba6ad3,null))[_0x8df2('0x27')](function(_0x4039da){if(_0x4039da){_0x53f85c=_0x4039da;_0x1a5bb2[_0x8df2('0x35')]=_[_0x8df2('0x38')](db[_0x8df2('0x73')][_0x8df2('0x32')]);_0x1a5bb2[_0x8df2('0x37')]=_[_0x8df2('0x38')](_0x46a6ed[_0x8df2('0x37')]);_0x1a5bb2[_0x8df2('0x39')]=_['intersection'](_0x1a5bb2[_0x8df2('0x35')],_0x1a5bb2[_0x8df2('0x37')]);_0x215cc6[_0x8df2('0x3b')]=_[_0x8df2('0x3a')](_0x1a5bb2[_0x8df2('0x35')],qs[_0x8df2('0x3c')](_0x46a6ed['query'][_0x8df2('0x3c')]));_0x215cc6[_0x8df2('0x3b')]=_0x215cc6[_0x8df2('0x3b')][_0x8df2('0x3d')]?_0x215cc6['attributes']:_0x1a5bb2[_0x8df2('0x35')];_0x215cc6[_0x8df2('0x3f')]=qs[_0x8df2('0x40')](_0x46a6ed['query'][_0x8df2('0x40')]);_0x215cc6[_0x8df2('0x41')]=qs[_0x8df2('0x39')](_[_0x8df2('0x42')](_0x46a6ed[_0x8df2('0x37')],_0x1a5bb2[_0x8df2('0x39')]));if(_0x46a6ed[_0x8df2('0x37')][_0x8df2('0x46')]){_0x215cc6[_0x8df2('0x41')]=_['merge'](_0x215cc6[_0x8df2('0x41')],{'$or':_[_0x8df2('0x36')](_0x215cc6[_0x8df2('0x3b')],function(_0x10930f){var _0x1437d9={};_0x1437d9[_0x10930f]={'$like':'%'+_0x46a6ed['query'][_0x8df2('0x46')]+'%'};return _0x1437d9;})});}_0x215cc6=_[_0x8df2('0x43')]({},_0x215cc6,_0x46a6ed['options']);return _0x53f85c['getSounds'](_0x215cc6);}})[_0x8df2('0x27')](function(_0x4703fe){if(_0x4703fe){_0x4d7b3c=_0x4703fe['length'];if(!_0x46a6ed[_0x8df2('0x37')]['hasOwnProperty'](_0x8df2('0x74'))){_0x215cc6[_0x8df2('0x1f')]=qs['limit'](_0x46a6ed['query'][_0x8df2('0x1f')]);_0x215cc6['offset']=qs['offset'](_0x46a6ed[_0x8df2('0x37')]['offset']);}return _0x53f85c[_0x8df2('0x75')](_0x215cc6);}})[_0x8df2('0x27')](function(_0x4e3d49){if(_0x4e3d49){return _0x4e3d49?{'count':_0x4d7b3c,'rows':_0x4e3d49}:null;}})['then'](respondWithResult(_0xba6ad3,null))['catch'](handleError(_0xba6ad3,null));}; \ No newline at end of file +var _0x1e98=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','body','sequelize','transaction','mode','files','directory','join','server/files/moh','create','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','root','format','%s.%s','symlinkSync','removeSound','id2','getSounds','Sound','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x15fe44,_0x253029){var _0x155108=function(_0x266b2b){while(--_0x266b2b){_0x15fe44['push'](_0x15fe44['shift']());}};_0x155108(++_0x253029);}(_0x1e98,0x1b1));var _0x81e9=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0x1e98[_0x105045];return _0x2487d0;};'use strict';var emlformat=require(_0x81e9('0x0'));var rimraf=require(_0x81e9('0x1'));var zipdir=require(_0x81e9('0x2'));var jsonpatch=require(_0x81e9('0x3'));var rp=require(_0x81e9('0x4'));var moment=require(_0x81e9('0x5'));var BPromise=require(_0x81e9('0x6'));var Mustache=require(_0x81e9('0x7'));var util=require(_0x81e9('0x8'));var path=require('path');var sox=require(_0x81e9('0x9'));var csv=require('to-csv');var ejs=require(_0x81e9('0xa'));var fs=require('fs');var fs_extra=require(_0x81e9('0xb'));var _=require(_0x81e9('0xc'));var squel=require('squel');var crypto=require(_0x81e9('0xd'));var jsforce=require(_0x81e9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x81e9('0xf'));var querystring=require(_0x81e9('0x10'));var Papa=require(_0x81e9('0x11'));var Redis=require('ioredis');var authService=require(_0x81e9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x81e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81e9('0x14'))(_0x81e9('0x15'));var utils=require(_0x81e9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x81e9('0x17'));var db=require(_0x81e9('0x18'))['db'];function respondWithStatusCode(_0x304480,_0x23af3b){_0x23af3b=_0x23af3b||0xcc;return function(_0x3b87ea){if(_0x3b87ea){return _0x304480['sendStatus'](_0x23af3b);}return _0x304480[_0x81e9('0x19')](_0x23af3b)[_0x81e9('0x1a')]();};}function respondWithResult(_0x557257,_0x25ca3c){_0x25ca3c=_0x25ca3c||0xc8;return function(_0x5a48b6){if(_0x5a48b6){return _0x557257[_0x81e9('0x19')](_0x25ca3c)[_0x81e9('0x1b')](_0x5a48b6);}};}function respondWithFilteredResult(_0x2d7dd1,_0x297006){return function(_0x25f8d2){if(_0x25f8d2){var _0x3de0c6=typeof _0x297006[_0x81e9('0x1c')]===_0x81e9('0x1d')&&typeof _0x297006[_0x81e9('0x1e')]===_0x81e9('0x1d');var _0x3fd820=_0x25f8d2[_0x81e9('0x1f')];var _0x20849f=_0x3de0c6?0x0:_0x297006[_0x81e9('0x1c')];var _0x5bdfe7=_0x3de0c6?_0x25f8d2['count']:_0x297006[_0x81e9('0x1c')]+_0x297006[_0x81e9('0x1e')];var _0x4e2922;if(_0x5bdfe7>=_0x3fd820){_0x5bdfe7=_0x3fd820;_0x4e2922=0xc8;}else{_0x4e2922=0xce;}_0x2d7dd1[_0x81e9('0x19')](_0x4e2922);return _0x2d7dd1[_0x81e9('0x20')](_0x81e9('0x21'),_0x20849f+'-'+_0x5bdfe7+'/'+_0x3fd820)[_0x81e9('0x1b')](_0x25f8d2);}return null;};}function patchUpdates(_0x261bbb){return function(_0x2ecc48){try{jsonpatch[_0x81e9('0x22')](_0x2ecc48,_0x261bbb,!![]);}catch(_0x5d12e2){return BPromise[_0x81e9('0x23')](_0x5d12e2);}return _0x2ecc48[_0x81e9('0x24')]();};}function saveUpdates(_0x3f191e,_0xc3ad6a){return function(_0x3e2764){if(_0x3e2764){return _0x3e2764[_0x81e9('0x25')](_0x3f191e)[_0x81e9('0x26')](function(_0x4fd567){return _0x4fd567;});}return null;};}function removeEntity(_0x39b545,_0x13d541){return function(_0x4eee3f){if(_0x4eee3f){return _0x4eee3f[_0x81e9('0x27')]()['then'](function(){var _0x16f9ee=_0x4eee3f[_0x81e9('0x28')]({'plain':!![]});var _0x453cd0=_0x81e9('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x453cd0,'resourceId':_0x16f9ee['id']}})['then'](function(){return _0x4eee3f;});})[_0x81e9('0x26')](function(){_0x39b545[_0x81e9('0x19')](0xcc)[_0x81e9('0x1a')]();});}};}function handleEntityNotFound(_0x57baf5,_0x446efa){return function(_0x33c740){if(!_0x33c740){_0x57baf5['sendStatus'](0x194);}return _0x33c740;};}function handleError(_0x357668,_0x4ab44f){_0x4ab44f=_0x4ab44f||0x1f4;return function(_0x440d85){logger[_0x81e9('0x2a')](_0x440d85[_0x81e9('0x2b')]);if(_0x440d85[_0x81e9('0x2c')]){delete _0x440d85[_0x81e9('0x2c')];}_0x357668['status'](_0x4ab44f)[_0x81e9('0x2d')](_0x440d85);};}exports['index']=function(_0x409cb2,_0x3a3949){var _0x154236={},_0x263cd1={},_0x14d915={'count':0x0,'rows':[]};var _0x3511c8=_['map'](db[_0x81e9('0x2e')][_0x81e9('0x2f')],function(_0x1761d0){return{'name':_0x1761d0[_0x81e9('0x30')],'type':_0x1761d0[_0x81e9('0x31')][_0x81e9('0x32')]};});_0x263cd1['model']=_[_0x81e9('0x33')](_0x3511c8,_0x81e9('0x2c'));_0x263cd1[_0x81e9('0x34')]=_[_0x81e9('0x35')](_0x409cb2['query']);_0x263cd1[_0x81e9('0x36')]=_[_0x81e9('0x37')](_0x263cd1[_0x81e9('0x38')],_0x263cd1[_0x81e9('0x34')]);_0x154236[_0x81e9('0x39')]=_[_0x81e9('0x37')](_0x263cd1[_0x81e9('0x38')],qs[_0x81e9('0x3a')](_0x409cb2[_0x81e9('0x34')][_0x81e9('0x3a')]));_0x154236[_0x81e9('0x39')]=_0x154236['attributes'][_0x81e9('0x3b')]?_0x154236['attributes']:_0x263cd1['model'];if(!_0x409cb2[_0x81e9('0x34')]['hasOwnProperty']('nolimit')){_0x154236[_0x81e9('0x1e')]=qs[_0x81e9('0x1e')](_0x409cb2['query'][_0x81e9('0x1e')]);_0x154236['offset']=qs[_0x81e9('0x1c')](_0x409cb2[_0x81e9('0x34')][_0x81e9('0x1c')]);}_0x154236[_0x81e9('0x3c')]=qs[_0x81e9('0x3d')](_0x409cb2[_0x81e9('0x34')][_0x81e9('0x3d')]);delete _0x409cb2['query'][_0x81e9('0x3d')];_0x154236[_0x81e9('0x3e')]=qs[_0x81e9('0x36')](_[_0x81e9('0x3f')](_0x409cb2[_0x81e9('0x34')],_0x263cd1[_0x81e9('0x36')]),_0x3511c8);if(_0x409cb2[_0x81e9('0x34')]['filter']){_0x154236[_0x81e9('0x3e')]=_[_0x81e9('0x40')](_0x154236[_0x81e9('0x3e')],{'$or':_[_0x81e9('0x33')](_0x3511c8,function(_0x532d31){if(_0x532d31[_0x81e9('0x31')]!==_0x81e9('0x41')){var _0x4d5069={};_0x4d5069[_0x532d31[_0x81e9('0x2c')]]={'$like':'%'+_0x409cb2['query'][_0x81e9('0x42')]+'%'};return _0x4d5069;}})});}_0x154236=_[_0x81e9('0x40')]({},_0x154236,_0x409cb2[_0x81e9('0x43')]);var _0x28adbb={'where':_0x154236[_0x81e9('0x3e')]};return db['VoiceMusicOnHold'][_0x81e9('0x1f')](_0x28adbb)[_0x81e9('0x26')](function(_0x3991c1){_0x14d915['count']=_0x3991c1;if(_0x409cb2[_0x81e9('0x34')][_0x81e9('0x44')]){_0x154236['include']=[{'all':!![]}];}return db[_0x81e9('0x2e')][_0x81e9('0x45')](_0x154236);})[_0x81e9('0x26')](function(_0x2927ee){_0x14d915['rows']=_0x2927ee;return _0x14d915;})['then'](respondWithFilteredResult(_0x3a3949,_0x154236))['catch'](handleError(_0x3a3949,null));};exports[_0x81e9('0x46')]=function(_0x5ca0c9,_0x179dc8){var _0x8f13a7={'raw':![],'where':{'id':_0x5ca0c9[_0x81e9('0x47')]['id']}},_0x543695={};_0x543695['model']=_[_0x81e9('0x35')](db[_0x81e9('0x2e')]['rawAttributes']);_0x543695[_0x81e9('0x34')]=_[_0x81e9('0x35')](_0x5ca0c9[_0x81e9('0x34')]);_0x543695['filters']=_[_0x81e9('0x37')](_0x543695[_0x81e9('0x38')],_0x543695[_0x81e9('0x34')]);_0x8f13a7[_0x81e9('0x39')]=_['intersection'](_0x543695[_0x81e9('0x38')],qs['fields'](_0x5ca0c9['query'][_0x81e9('0x3a')]));_0x8f13a7[_0x81e9('0x39')]=_0x8f13a7[_0x81e9('0x39')][_0x81e9('0x3b')]?_0x8f13a7[_0x81e9('0x39')]:_0x543695[_0x81e9('0x38')];if(_0x5ca0c9[_0x81e9('0x34')]['includeAll']){_0x8f13a7[_0x81e9('0x48')]=[{'all':!![]}];}_0x8f13a7=_[_0x81e9('0x40')]({},_0x8f13a7,_0x5ca0c9[_0x81e9('0x43')]);return db['VoiceMusicOnHold'][_0x81e9('0x49')](_0x8f13a7)[_0x81e9('0x26')](handleEntityNotFound(_0x179dc8,null))['then'](respondWithResult(_0x179dc8,null))[_0x81e9('0x4a')](handleError(_0x179dc8,null));};exports[_0x81e9('0x25')]=function(_0x4e11ca,_0x5c9ac2){if(_0x4e11ca[_0x81e9('0x4b')]['id']){delete _0x4e11ca[_0x81e9('0x4b')]['id'];}return db[_0x81e9('0x2e')][_0x81e9('0x49')]({'where':{'id':_0x4e11ca[_0x81e9('0x47')]['id']}})[_0x81e9('0x26')](handleEntityNotFound(_0x5c9ac2,null))[_0x81e9('0x26')](saveUpdates(_0x4e11ca['body'],null))['then'](respondWithResult(_0x5c9ac2,null))[_0x81e9('0x4a')](handleError(_0x5c9ac2,null));};exports['create']=function(_0x3eb3a0,_0x386b0d,_0x4707f3){return db[_0x81e9('0x4c')][_0x81e9('0x4d')](function(_0x55d84c){if(_0x3eb3a0[_0x81e9('0x4b')][_0x81e9('0x4e')]===_0x81e9('0x4f')){_0x3eb3a0[_0x81e9('0x4b')][_0x81e9('0x50')]=path[_0x81e9('0x51')](config['root'],_0x81e9('0x52'),_0x3eb3a0['body'][_0x81e9('0x2c')]);}return db['VoiceMusicOnHold'][_0x81e9('0x53')](_0x3eb3a0[_0x81e9('0x4b')],{'transaction':_0x55d84c})[_0x81e9('0x26')](function(_0x61ef75){if(_0x3eb3a0[_0x81e9('0x4b')]['mode']==='files'){fs[_0x81e9('0x54')](_0x61ef75['directory'],parseInt('0777',0x8));}var _0x3f6ad2=_0x3eb3a0[_0x81e9('0x55')][_0x81e9('0x28')]({'plain':!![]});if(!_0x3f6ad2)throw new Error(_0x81e9('0x56'));if(_0x3f6ad2[_0x81e9('0x57')]==='user'){var _0x2a083d=_0x61ef75[_0x81e9('0x28')]({'plain':!![]});return db[_0x81e9('0x58')][_0x81e9('0x49')]({'where':{'name':'MusicOnHolds','userProfileId':_0x3f6ad2[_0x81e9('0x59')]},'raw':!![]})[_0x81e9('0x26')](function(_0x147cb8){if(_0x147cb8&&_0x147cb8[_0x81e9('0x5a')]===0x0){return db[_0x81e9('0x5b')][_0x81e9('0x53')]({'name':_0x2a083d[_0x81e9('0x2c')],'resourceId':_0x2a083d['id'],'type':_0x147cb8['name'],'sectionId':_0x147cb8['id']},{})[_0x81e9('0x26')](function(){return _0x61ef75;});}else{return _0x61ef75;}})[_0x81e9('0x4a')](function(_0xdd3c48){logger[_0x81e9('0x2a')](_0x81e9('0x5c'),_0xdd3c48);});}return _0x61ef75;});})[_0x81e9('0x26')](respondWithResult(_0x386b0d,0xc9))[_0x81e9('0x4a')](handleError(_0x386b0d,null));};exports[_0x81e9('0x27')]=function(_0x48930d,_0x5e10ff,_0xaa9199){var _0x5d9c84;return db[_0x81e9('0x2e')]['find']({'where':{'id':_0x48930d[_0x81e9('0x47')]['id']}})[_0x81e9('0x26')](function(_0x59b6a8){if(_0x59b6a8){return db[_0x81e9('0x4c')][_0x81e9('0x4d')](function(_0x17d7e9){return _0x59b6a8[_0x81e9('0x27')]({'transaction':_0x17d7e9,'raw':!![]})['then'](function(_0x4ee232){if(_0x4ee232['directory']){fs[_0x81e9('0x5d')](_0x4ee232[_0x81e9('0x50')])[_0x81e9('0x5e')](function(_0x27ee46){fs[_0x81e9('0x5f')](path['join'](_0x4ee232['directory'],_0x27ee46));});fs['rmdirSync'](_0x4ee232[_0x81e9('0x50')]);}return _0x4ee232;});})[_0x81e9('0x4a')](function(_0x2309d9){throw new db[(_0x81e9('0x60'))][(_0x81e9('0x61'))](_0x2309d9[_0x81e9('0x62')]);});}})[_0x81e9('0x26')](handleEntityNotFound(_0x5e10ff,null))[_0x81e9('0x26')](removeEntity(_0x5e10ff,null))[_0x81e9('0x4a')](handleError(_0x5e10ff,null));};exports[_0x81e9('0x63')]=function(_0x1d5223,_0x283186,_0x372fd7){return db[_0x81e9('0x4c')]['transaction'](function(_0x40a771){var _0x271425;return db[_0x81e9('0x2e')][_0x81e9('0x49')]({'where':{'id':_0x1d5223[_0x81e9('0x47')]['id']}})[_0x81e9('0x26')](function(_0x4a29e0){if(_0x4a29e0){_0x271425=_0x4a29e0;return _0x4a29e0[_0x81e9('0x63')](_0x1d5223[_0x81e9('0x4b')]['id'],{'transaction':_0x40a771});}})['then'](function(_0x584079){if(_0x584079){return db['Sound'][_0x81e9('0x64')]({'where':{'id':_0x1d5223[_0x81e9('0x4b')]['id']},'attributes':['id',_0x81e9('0x2c'),_0x81e9('0x65'),_0x81e9('0x66'),_0x81e9('0x67')],'raw':!![]});}})[_0x81e9('0x26')](function(_0xc2e68f){if(_0xc2e68f){var _0x1a487b=path[_0x81e9('0x51')](config[_0x81e9('0x68')],'server/files/sounds/converted',util[_0x81e9('0x69')](_0x81e9('0x6a'),path['basename'](_0xc2e68f[_0x81e9('0x65')],path['extname'](_0xc2e68f[_0x81e9('0x65')])),_0xc2e68f[_0x81e9('0x66')]));var _0x2ead5a=path[_0x81e9('0x51')](config[_0x81e9('0x68')],'server/files/moh',_0x271425[_0x81e9('0x2c')],util[_0x81e9('0x69')]('%s.%s',_0xc2e68f[_0x81e9('0x2c')],_0xc2e68f[_0x81e9('0x66')]));fs[_0x81e9('0x6b')](_0x1a487b,_0x2ead5a);return _0xc2e68f;}})[_0x81e9('0x4a')](function(_0xfa762a){throw new db[(_0x81e9('0x60'))][(_0x81e9('0x61'))](_0xfa762a[_0x81e9('0x62')]);});})['then'](handleEntityNotFound(_0x283186,null))[_0x81e9('0x26')](respondWithResult(_0x283186,0xc9))[_0x81e9('0x4a')](handleError(_0x283186,null));};exports[_0x81e9('0x6c')]=function(_0x3bb8ad,_0x4dd8a8,_0x17697f){return db[_0x81e9('0x4c')][_0x81e9('0x4d')](function(_0x2b5965){var _0x25f4d3;return db['VoiceMusicOnHold'][_0x81e9('0x64')]({'where':{'id':_0x3bb8ad[_0x81e9('0x47')]['id']}})[_0x81e9('0x26')](handleEntityNotFound(_0x4dd8a8,null))[_0x81e9('0x26')](function(_0x1b20fa){if(_0x1b20fa){_0x25f4d3=_0x1b20fa;return _0x1b20fa['removeSound'](_0x3bb8ad[_0x81e9('0x47')][_0x81e9('0x6d')]);}})[_0x81e9('0x26')](function(_0x2a53f6){if(_0x2a53f6){return db['Sound'][_0x81e9('0x64')]({'where':{'id':_0x3bb8ad[_0x81e9('0x47')][_0x81e9('0x6d')]},'attributes':['id',_0x81e9('0x2c'),_0x81e9('0x65'),_0x81e9('0x66'),_0x81e9('0x67')],'raw':!![]});}})['then'](function(_0x2a573){if(_0x2a573){fs[_0x81e9('0x5f')](path[_0x81e9('0x51')](_0x25f4d3[_0x81e9('0x50')],util[_0x81e9('0x69')](_0x81e9('0x6a'),_0x2a573[_0x81e9('0x2c')],_0x2a573[_0x81e9('0x66')])));return _0x2a573;}})['catch'](function(_0xcdf53){throw new db[(_0x81e9('0x60'))]['ValidationError'](_0xcdf53[_0x81e9('0x62')]);});})['then'](handleEntityNotFound(_0x4dd8a8,null))[_0x81e9('0x26')](respondWithStatusCode(_0x4dd8a8,0xcc))[_0x81e9('0x4a')](handleError(_0x4dd8a8,null));};exports[_0x81e9('0x6e')]=function(_0x595cf0,_0x590949,_0x4d4f42){var _0x49d9f5={};var _0x3aa4c8={};var _0xfe7636;var _0x4a7b3f;return db[_0x81e9('0x2e')][_0x81e9('0x64')]({'where':{'id':_0x595cf0[_0x81e9('0x47')]['id']}})[_0x81e9('0x26')](handleEntityNotFound(_0x590949,null))[_0x81e9('0x26')](function(_0x167706){if(_0x167706){_0xfe7636=_0x167706;_0x3aa4c8[_0x81e9('0x38')]=_['keys'](db[_0x81e9('0x6f')][_0x81e9('0x2f')]);_0x3aa4c8['query']=_[_0x81e9('0x35')](_0x595cf0['query']);_0x3aa4c8[_0x81e9('0x36')]=_['intersection'](_0x3aa4c8['model'],_0x3aa4c8[_0x81e9('0x34')]);_0x49d9f5[_0x81e9('0x39')]=_['intersection'](_0x3aa4c8[_0x81e9('0x38')],qs['fields'](_0x595cf0[_0x81e9('0x34')][_0x81e9('0x3a')]));_0x49d9f5['attributes']=_0x49d9f5['attributes'][_0x81e9('0x3b')]?_0x49d9f5[_0x81e9('0x39')]:_0x3aa4c8[_0x81e9('0x38')];_0x49d9f5[_0x81e9('0x3c')]=qs[_0x81e9('0x3d')](_0x595cf0[_0x81e9('0x34')][_0x81e9('0x3d')]);_0x49d9f5[_0x81e9('0x3e')]=qs['filters'](_[_0x81e9('0x3f')](_0x595cf0[_0x81e9('0x34')],_0x3aa4c8['filters']));if(_0x595cf0[_0x81e9('0x34')]['filter']){_0x49d9f5[_0x81e9('0x3e')]=_[_0x81e9('0x40')](_0x49d9f5[_0x81e9('0x3e')],{'$or':_[_0x81e9('0x33')](_0x49d9f5[_0x81e9('0x39')],function(_0x2a6229){var _0x5c7d81={};_0x5c7d81[_0x2a6229]={'$like':'%'+_0x595cf0[_0x81e9('0x34')][_0x81e9('0x42')]+'%'};return _0x5c7d81;})});}_0x49d9f5=_['merge']({},_0x49d9f5,_0x595cf0[_0x81e9('0x43')]);return _0xfe7636[_0x81e9('0x6e')](_0x49d9f5);}})[_0x81e9('0x26')](function(_0x176393){if(_0x176393){_0x4a7b3f=_0x176393[_0x81e9('0x3b')];if(!_0x595cf0['query'][_0x81e9('0x70')](_0x81e9('0x71'))){_0x49d9f5[_0x81e9('0x1e')]=qs[_0x81e9('0x1e')](_0x595cf0[_0x81e9('0x34')][_0x81e9('0x1e')]);_0x49d9f5['offset']=qs[_0x81e9('0x1c')](_0x595cf0[_0x81e9('0x34')][_0x81e9('0x1c')]);}return _0xfe7636['getSounds'](_0x49d9f5);}})[_0x81e9('0x26')](function(_0xe2cfd1){if(_0xe2cfd1){return _0xe2cfd1?{'count':_0x4a7b3f,'rows':_0xe2cfd1}:null;}})[_0x81e9('0x26')](respondWithResult(_0x590949,null))[_0x81e9('0x4a')](handleError(_0x590949,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0b9edb7..2c6fb46 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 _0x2e87=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e87,0x68));var _0x72e8=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0x2e87[_0x5c883f];return _0x4210cc;};'use strict';var _=require(_0x72e8('0x0'));var util=require('util');var logger=require(_0x72e8('0x1'))(_0x72e8('0x2'));var moment=require(_0x72e8('0x3'));var BPromise=require(_0x72e8('0x4'));var rp=require(_0x72e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72e8('0x6'));var config=require(_0x72e8('0x7'));var attributes=require(_0x72e8('0x8'));module[_0x72e8('0x9')]=function(_0x2d25ef,_0x493106){return _0x2d25ef[_0x72e8('0xa')](_0x72e8('0xb'),attributes,{'tableName':_0x72e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa901=['VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define'];(function(_0x163505,_0x233525){var _0x2d45f4=function(_0x4e083d){while(--_0x4e083d){_0x163505['push'](_0x163505['shift']());}};_0x2d45f4(++_0x233525);}(_0xa901,0xfe));var _0x1a90=function(_0x5f4724,_0x19919a){_0x5f4724=_0x5f4724-0x0;var _0x598fe1=_0xa901[_0x5f4724];return _0x598fe1;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var logger=require(_0x1a90('0x1'))(_0x1a90('0x2'));var moment=require('moment');var BPromise=require(_0x1a90('0x3'));var rp=require(_0x1a90('0x4'));var fs=require('fs');var path=require(_0x1a90('0x5'));var rimraf=require(_0x1a90('0x6'));var config=require(_0x1a90('0x7'));var attributes=require(_0x1a90('0x8'));module['exports']=function(_0x55acbd,_0x35d3b3){return _0x55acbd[_0x1a90('0x9')](_0x1a90('0xa'),attributes,{'tableName':_0x1a90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index dfaf158..69efb23 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1876fb,_0x20162c){var _0x5992ca=function(_0x417923){while(--_0x417923){_0x1876fb['push'](_0x1876fb['shift']());}};_0x5992ca(++_0x20162c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xcb91[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x5600c5,_0xca1b8c){var _0x24ce4b=function(_0x204fbd){while(--_0x204fbd){_0x5600c5['push'](_0x5600c5['shift']());}};_0x24ce4b(++_0xca1b8c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xcb91[_0x1dbaf7];return _0x593f05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3b02dcd..a7d16cd 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 _0x3916=['index','describe','/:id','show','get','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3916,0x18d));var _0x6391=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0x3916[_0x32e649];return _0x14d386;};'use strict';var multer=require(_0x6391('0x0'));var util=require('util');var path=require(_0x6391('0x1'));var timeout=require(_0x6391('0x2'));var express=require('express');var router=express[_0x6391('0x3')]();var fs_extra=require(_0x6391('0x4'));var auth=require(_0x6391('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6391('0x6'));var controller=require(_0x6391('0x7'));router['get']('/',auth[_0x6391('0x8')](),controller[_0x6391('0x9')]);router['get']('/describe',auth[_0x6391('0x8')](),controller[_0x6391('0xa')]);router['get'](_0x6391('0xb'),auth[_0x6391('0x8')](),controller[_0x6391('0xc')]);router[_0x6391('0xd')](_0x6391('0xe'),auth[_0x6391('0x8')](),controller[_0x6391('0xf')]);router[_0x6391('0xd')](_0x6391('0x10'),auth['isAuthenticated'](),controller[_0x6391('0x11')]);router[_0x6391('0x12')]('/',auth[_0x6391('0x8')](),controller[_0x6391('0x13')]);router['post']('/:id/users',auth[_0x6391('0x8')](),controller[_0x6391('0x14')]);router[_0x6391('0x12')](_0x6391('0x10'),auth[_0x6391('0x8')](),controller[_0x6391('0x15')]);router[_0x6391('0x16')](_0x6391('0xb'),auth['isAuthenticated'](),controller[_0x6391('0x17')]);router[_0x6391('0x18')]('/:id',auth[_0x6391('0x8')](),controller[_0x6391('0x19')]);router[_0x6391('0x18')](_0x6391('0xe'),auth[_0x6391('0x8')](),controller[_0x6391('0x1a')]);router[_0x6391('0x18')]('/:id/teams',auth[_0x6391('0x8')](),controller[_0x6391('0x1b')]);module[_0x6391('0x1c')]=router; \ No newline at end of file +var _0xc4a1=['post','addTeams','put','/:id','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','/:id/teams','getTeams'];(function(_0x42a9c6,_0x445728){var _0xe12b5c=function(_0x46fdf3){while(--_0x46fdf3){_0x42a9c6['push'](_0x42a9c6['shift']());}};_0xe12b5c(++_0x445728);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x2f8d0c,_0x468609){_0x2f8d0c=_0x2f8d0c-0x0;var _0x3241fa=_0xc4a1[_0x2f8d0c];return _0x3241fa;};'use strict';var multer=require(_0x1c4a('0x0'));var util=require('util');var path=require(_0x1c4a('0x1'));var timeout=require(_0x1c4a('0x2'));var express=require(_0x1c4a('0x3'));var router=express['Router']();var fs_extra=require(_0x1c4a('0x4'));var auth=require(_0x1c4a('0x5'));var interaction=require(_0x1c4a('0x6'));var config=require(_0x1c4a('0x7'));var controller=require(_0x1c4a('0x8'));router[_0x1c4a('0x9')]('/',auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xb')]);router[_0x1c4a('0x9')](_0x1c4a('0xc'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xd')]);router[_0x1c4a('0x9')]('/:id',auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xe')]);router['get'](_0x1c4a('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x1c4a('0x9')](_0x1c4a('0x10'),auth['isAuthenticated'](),controller[_0x1c4a('0x11')]);router[_0x1c4a('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1c4a('0x12')](_0x1c4a('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1c4a('0x12')](_0x1c4a('0x10'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0x13')]);router[_0x1c4a('0x14')](_0x1c4a('0x15'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0x16')]);router[_0x1c4a('0x17')](_0x1c4a('0x15'),auth['isAuthenticated'](),controller[_0x1c4a('0x18')]);router[_0x1c4a('0x17')](_0x1c4a('0xf'),auth[_0x1c4a('0xa')](),controller['removeAgents']);router['delete'](_0x1c4a('0x10'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0x19')]);module[_0x1c4a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 911a185..af14d4b 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 _0x415c=['sequelize','exports','STRING','name','system-','getDataValue','INTEGER'];(function(_0x5432e6,_0x6ccbc1){var _0x38face=function(_0x3fb664){while(--_0x3fb664){_0x5432e6['push'](_0x5432e6['shift']());}};_0x38face(++_0x6ccbc1);}(_0x415c,0x15e));var _0xc415=function(_0x3bf722,_0x5d28e8){_0x3bf722=_0x3bf722-0x0;var _0x19e9cf=_0x415c[_0x3bf722];return _0x19e9cf;};'use strict';var Sequelize=require(_0xc415('0x0'));module[_0xc415('0x1')]={'name':{'type':Sequelize[_0xc415('0x2')],'allowNull':![],'unique':_0xc415('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4dd9ed){return _0xc415('0x4')+this[_0xc415('0x5')](_0xc415('0x3'))+'-';}},'description':{'type':Sequelize[_0xc415('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xc415('0x6')]}}; \ No newline at end of file +var _0xa49d=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa49d,0x195));var _0xda49=function(_0x6e8234,_0x12d337){_0x6e8234=_0x6e8234-0x0;var _0x5c7229=_0xa49d[_0x6e8234];return _0x5c7229;};'use strict';var Sequelize=require(_0xda49('0x0'));module[_0xda49('0x1')]={'name':{'type':Sequelize[_0xda49('0x2')],'allowNull':![],'unique':_0xda49('0x3')},'prefix':{'type':Sequelize[_0xda49('0x4')],'get':function(_0xaf04ab){return _0xda49('0x5')+this[_0xda49('0x6')](_0xda49('0x3'))+'-';}},'description':{'type':Sequelize[_0xda49('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xda49('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 3260b7e..00a3dca 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 _0x8952=['rawAttributes','fieldName','type','map','keys','filters','intersection','query','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','params','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','context','from-sip','exten','system','Voice\x20Prefix\x20Extension','prefix','Voice\x20Prefix','VoicePrefixId','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','interface','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','every','includes','all','union','compact','value','removeTeams','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','VoicePrefixes','error','stack','name','send','index','VoicePrefix'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x8952,0x17e));var _0x2895=function(_0x58cce4,_0x1663d0){_0x58cce4=_0x58cce4-0x0;var _0x72c2e=_0x8952[_0x58cce4];return _0x72c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];config[_0x2895('0x15')]=_['defaults'](config[_0x2895('0x15')],{'host':_0x2895('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2895('0x17'))[_0x2895('0x18')](socket);function respondWithStatusCode(_0x5777a0,_0x2198c3){_0x2198c3=_0x2198c3||0xcc;return function(_0xd8192e){if(_0xd8192e){return _0x5777a0[_0x2895('0x19')](_0x2198c3);}return _0x5777a0[_0x2895('0x1a')](_0x2198c3)[_0x2895('0x1b')]();};}function respondWithResult(_0x2627e6,_0x6a5c7e){_0x6a5c7e=_0x6a5c7e||0xc8;return function(_0x31bb7f){if(_0x31bb7f){return _0x2627e6[_0x2895('0x1a')](_0x6a5c7e)[_0x2895('0x1c')](_0x31bb7f);}};}function respondWithFilteredResult(_0x10a1bf,_0x183b05){return function(_0xbf8b63){if(_0xbf8b63){var _0x2cb505=typeof _0x183b05[_0x2895('0x1d')]===_0x2895('0x1e')&&typeof _0x183b05[_0x2895('0x1f')]===_0x2895('0x1e');var _0x5a8eab=_0xbf8b63['count'];var _0x493851=_0x2cb505?0x0:_0x183b05[_0x2895('0x1d')];var _0x12c2fb=_0x2cb505?_0xbf8b63[_0x2895('0x20')]:_0x183b05['offset']+_0x183b05[_0x2895('0x1f')];var _0x190b79;if(_0x12c2fb>=_0x5a8eab){_0x12c2fb=_0x5a8eab;_0x190b79=0xc8;}else{_0x190b79=0xce;}_0x10a1bf[_0x2895('0x1a')](_0x190b79);return _0x10a1bf[_0x2895('0x21')](_0x2895('0x22'),_0x493851+'-'+_0x12c2fb+'/'+_0x5a8eab)['json'](_0xbf8b63);}return null;};}function patchUpdates(_0x30c6c3){return function(_0x5e93a4){try{jsonpatch['apply'](_0x5e93a4,_0x30c6c3,!![]);}catch(_0x142e58){return BPromise[_0x2895('0x23')](_0x142e58);}return _0x5e93a4[_0x2895('0x24')]();};}function saveUpdates(_0x511286,_0x4e884f){return function(_0x3a72fa){if(_0x3a72fa){return _0x3a72fa[_0x2895('0x25')](_0x511286)[_0x2895('0x26')](function(_0x4a21cf){return _0x4a21cf;});}return null;};}function removeEntity(_0x3d3320,_0x3690ce){return function(_0x480604){if(_0x480604){return _0x480604[_0x2895('0x27')]()[_0x2895('0x26')](function(){var _0x2cd4df=_0x480604['get']({'plain':!![]});var _0x320661=_0x2895('0x28');return db['UserProfileResource'][_0x2895('0x27')]({'where':{'type':_0x320661,'resourceId':_0x2cd4df['id']}})['then'](function(){return _0x480604;});})['then'](function(){_0x3d3320[_0x2895('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfa4f85,_0x381538){return function(_0x4fdd94){if(!_0x4fdd94){_0xfa4f85['sendStatus'](0x194);}return _0x4fdd94;};}function handleError(_0x32db49,_0x30dc2f){_0x30dc2f=_0x30dc2f||0x1f4;return function(_0x190e07){logger[_0x2895('0x29')](_0x190e07[_0x2895('0x2a')]);if(_0x190e07[_0x2895('0x2b')]){delete _0x190e07[_0x2895('0x2b')];}_0x32db49['status'](_0x30dc2f)[_0x2895('0x2c')](_0x190e07);};}exports[_0x2895('0x2d')]=function(_0x3625ba,_0x5546eb){var _0x1e9c13={},_0x458a55={},_0x31ab90={'count':0x0,'rows':[]};var _0x35a2e8=_['map'](db[_0x2895('0x2e')][_0x2895('0x2f')],function(_0x4765c9){return{'name':_0x4765c9[_0x2895('0x30')],'type':_0x4765c9[_0x2895('0x31')]['key']};});_0x458a55['model']=_[_0x2895('0x32')](_0x35a2e8,_0x2895('0x2b'));_0x458a55['query']=_[_0x2895('0x33')](_0x3625ba['query']);_0x458a55[_0x2895('0x34')]=_[_0x2895('0x35')](_0x458a55['model'],_0x458a55[_0x2895('0x36')]);_0x1e9c13['attributes']=_[_0x2895('0x35')](_0x458a55['model'],qs['fields'](_0x3625ba[_0x2895('0x36')][_0x2895('0x37')]));_0x1e9c13[_0x2895('0x38')]=_0x1e9c13['attributes'][_0x2895('0x39')]?_0x1e9c13[_0x2895('0x38')]:_0x458a55[_0x2895('0x3a')];if(!_0x3625ba[_0x2895('0x36')][_0x2895('0x3b')](_0x2895('0x3c'))){_0x1e9c13[_0x2895('0x1f')]=qs[_0x2895('0x1f')](_0x3625ba[_0x2895('0x36')][_0x2895('0x1f')]);_0x1e9c13['offset']=qs[_0x2895('0x1d')](_0x3625ba[_0x2895('0x36')][_0x2895('0x1d')]);}_0x1e9c13[_0x2895('0x3d')]=qs[_0x2895('0x3e')](_0x3625ba[_0x2895('0x36')][_0x2895('0x3e')]);_0x1e9c13['where']=qs['filters'](_[_0x2895('0x3f')](_0x3625ba[_0x2895('0x36')],_0x458a55[_0x2895('0x34')]),_0x35a2e8);if(_0x3625ba[_0x2895('0x36')][_0x2895('0x40')]){_0x1e9c13[_0x2895('0x41')]=_['merge'](_0x1e9c13['where'],{'$or':_[_0x2895('0x32')](_0x35a2e8,function(_0x20208f){if(_0x20208f['type']!=='VIRTUAL'){var _0x2a0eaf={};_0x2a0eaf[_0x20208f[_0x2895('0x2b')]]={'$like':'%'+_0x3625ba[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x2a0eaf;}})});}_0x1e9c13=_[_0x2895('0x42')]({},_0x1e9c13,_0x3625ba[_0x2895('0x43')]);var _0x5d4e23={'where':_0x1e9c13[_0x2895('0x41')]};return db[_0x2895('0x2e')][_0x2895('0x20')](_0x5d4e23)[_0x2895('0x26')](function(_0x4af6d6){_0x31ab90[_0x2895('0x20')]=_0x4af6d6;if(_0x3625ba[_0x2895('0x36')][_0x2895('0x44')]){_0x1e9c13[_0x2895('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x1e9c13);})[_0x2895('0x26')](function(_0x19ce85){_0x31ab90[_0x2895('0x46')]=_0x19ce85;return _0x31ab90;})[_0x2895('0x26')](respondWithFilteredResult(_0x5546eb,_0x1e9c13))[_0x2895('0x47')](handleError(_0x5546eb,null));};exports['show']=function(_0x5bd425,_0x4b336c){var _0x28dd37={'raw':![],'where':{'id':_0x5bd425[_0x2895('0x48')]['id']}},_0x2130b2={};_0x2130b2[_0x2895('0x3a')]=_[_0x2895('0x33')](db[_0x2895('0x2e')]['rawAttributes']);_0x2130b2[_0x2895('0x36')]=_[_0x2895('0x33')](_0x5bd425[_0x2895('0x36')]);_0x2130b2[_0x2895('0x34')]=_[_0x2895('0x35')](_0x2130b2[_0x2895('0x3a')],_0x2130b2[_0x2895('0x36')]);_0x28dd37[_0x2895('0x38')]=_['intersection'](_0x2130b2[_0x2895('0x3a')],qs[_0x2895('0x37')](_0x5bd425[_0x2895('0x36')]['fields']));_0x28dd37[_0x2895('0x38')]=_0x28dd37[_0x2895('0x38')]['length']?_0x28dd37[_0x2895('0x38')]:_0x2130b2[_0x2895('0x3a')];if(_0x5bd425[_0x2895('0x36')][_0x2895('0x44')]){_0x28dd37[_0x2895('0x45')]=[{'all':!![]}];}_0x28dd37=_[_0x2895('0x42')]({},_0x28dd37,_0x5bd425[_0x2895('0x43')]);return db['VoicePrefix'][_0x2895('0x49')](_0x28dd37)[_0x2895('0x26')](handleEntityNotFound(_0x4b336c,null))['then'](respondWithResult(_0x4b336c,null))['catch'](handleError(_0x4b336c,null));};exports['destroy']=function(_0x212a1f,_0xe552b6){return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x212a1f[_0x2895('0x48')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0xe552b6,null))[_0x2895('0x26')](removeEntity(_0xe552b6,null))[_0x2895('0x47')](handleError(_0xe552b6,null));};exports[_0x2895('0x4a')]=function(_0x3d043c,_0x45302c){return db[_0x2895('0x2e')][_0x2895('0x4a')]()[_0x2895('0x26')](respondWithResult(_0x45302c,null))[_0x2895('0x47')](handleError(_0x45302c,null));};exports[_0x2895('0x4b')]=function(_0x2116a6,_0x3e0fde){var _0xbcf98;return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x90ed5d){return db[_0x2895('0x2e')][_0x2895('0x4b')](_0x2116a6[_0x2895('0x4e')],{'transaction':_0x90ed5d})[_0x2895('0x26')](function(_0x16ff3d){_0xbcf98=_0x16ff3d[_0x2895('0x4f')]({'plain':!![]});return db[_0x2895('0x50')][_0x2895('0x49')]({'where':{'id':_0xbcf98[_0x2895('0x51')]},'raw':!![]})['then'](function(_0xbc538a){return createVoicePrefixExtensions(_0xbcf98,_0xbc538a,_0x90ed5d);});});})[_0x2895('0x26')](function(){var _0x2bc573=_0x2116a6[_0x2895('0x52')][_0x2895('0x4f')]({'plain':!![]});if(!_0x2bc573)throw new Error(_0x2895('0x53'));if(_0x2bc573['role']===_0x2895('0x52')){var _0x5579b3=_0xbcf98;return db[_0x2895('0x54')][_0x2895('0x49')]({'where':{'name':_0x2895('0x28'),'userProfileId':_0x2bc573[_0x2895('0x55')]},'raw':!![]})[_0x2895('0x26')](function(_0x56a2c0){if(_0x56a2c0&&_0x56a2c0['autoAssociation']===0x0){return db[_0x2895('0x56')][_0x2895('0x4b')]({'name':_0x5579b3[_0x2895('0x2b')],'resourceId':_0x5579b3['id'],'type':_0x56a2c0['name'],'sectionId':_0x56a2c0['id']},{})[_0x2895('0x26')](function(){return _0xbcf98;});}else{return _0xbcf98;}})['catch'](function(_0x3c1f50){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1f50);throw _0x3c1f50;});}return _0xbcf98;})['then'](respondWithResult(_0x3e0fde,null))['catch'](handleError(_0x3e0fde,null));};function Extension(_0x36177d,_0x2ff725,_0x402e00,_0x4336c){this[_0x2895('0x57')]=_0x2895('0x58');this[_0x2895('0x59')]=_0x36177d;this['app']=_0x402e00;this[_0x2895('0x31')]=_0x2895('0x5a');this['description']=_0x2895('0x5b');this['priority']=_0x2ff725;this['appdata']=_0x4336c;}function createVoicePrefixExtensions(_0x2a9194,_0x14d7f9,_0x50299a){return new BPromise(function(_0xf5be,_0x3c5e32){var _0x35d979=new Extension(formatPrefixName(_0x2a9194[_0x2895('0x5c')]),0x1,'NoOp',_0x2895('0x5d'));_0x35d979['VoicePrefixId']=_0x2a9194['id'];return db[_0x2895('0x50')]['create'](_0x35d979,{'transaction':_0x50299a})['then'](function(_0x1af031){var _0x58f96a=_0x1af031[_0x2895('0x4f')]({'plain':!![]});var _0x39a28b=_[_0x2895('0x32')](addVoicePrefixExtensions(_0x2a9194,_0x14d7f9),function(_0x559ef3){_0x559ef3[_0x2895('0x51')]=_0x58f96a['id'];_0x559ef3[_0x2895('0x5e')]=_0x2a9194['id'];return _0x559ef3;});return db['VoiceExtension']['bulkCreate'](_0x39a28b,{'transaction':_0x50299a})[_0x2895('0x26')](function(_0x347445){if(!_0x347445){return _0x3c5e32('Extensions\x20creation\x20failed');}else{return _0xf5be(_0x347445);}})[_0x2895('0x47')](function(_0x53f9d8){return _0x3c5e32(_0x53f9d8);});});;});};function addVoicePrefixExtensions(_0x567520,_0x98b64d){var _0x3241cb=[];var _0x16b39c=formatPrefixName(_0x567520['prefix']);_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x2,_0x2895('0x60'),_0x2895('0x61')+_0x567520[_0x2895('0x2b')]));if(_0x567520[_0x2895('0x62')]){_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x3,_0x2895('0x60'),'PREFIX-CALLERIDALL='+_0x567520[_0x2895('0x62')]));}else{_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x3,_0x2895('0x63'),_0x2895('0x64')));}_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x4,_0x2895('0x65'),_0x98b64d[_0x2895('0x57')]+','+_0x2895('0x66')+(0x8+_0x567520['name'][_0x2895('0x39')])+'}'+','+0x1));return _0x3241cb;}function formatPrefixName(_0x354718){var _0x16f369='_';for(var _0x2288ff=0x0;_0x2288ff<_0x354718[_0x2895('0x39')];_0x2288ff++){if(_0x354718[_0x2895('0x67')](_0x2288ff)=='-'){_0x16f369+=_0x354718[_0x2895('0x67')](_0x2288ff);}else{_0x16f369+='['+_0x354718[_0x2895('0x67')](_0x2288ff)+']';}}_0x16f369+='.';return _0x16f369;}exports[_0x2895('0x25')]=function(_0x2862aa,_0x53a270,_0x477385){var _0x1a2045=_0x2862aa[_0x2895('0x4e')];_0x1a2045[_0x2895('0x5c')]=_0x2895('0x68')+_0x1a2045[_0x2895('0x2b')]+'-';return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x203609){return db[_0x2895('0x2e')]['update'](_0x1a2045,{'where':{'id':_0x1a2045['id']},'transaction':_0x203609})[_0x2895('0x26')](function(){return db[_0x2895('0x50')][_0x2895('0x27')]({'where':{'VoicePrefixId':_0x1a2045['id']},'transaction':_0x203609})[_0x2895('0x26')](function(){return db[_0x2895('0x50')]['find']({'where':{'id':_0x1a2045[_0x2895('0x51')]},'raw':!![]})[_0x2895('0x26')](function(_0x4c569e){return createVoicePrefixExtensions(_0x1a2045,_0x4c569e,_0x203609);});});});})['then'](function(){return db['VoicePrefix'][_0x2895('0x69')](_0x1a2045['id']);})[_0x2895('0x26')](respondWithResult(_0x53a270,null))[_0x2895('0x47')](handleError(_0x53a270,null));};exports[_0x2895('0x6a')]=function(_0x31e21a,_0x48c014,_0x5e6a1f){return db[_0x2895('0x2e')]['find']({'where':{'id':_0x31e21a[_0x2895('0x48')]['id']}})['then'](handleEntityNotFound(_0x48c014,null))[_0x2895('0x26')](function(_0x3de634){if(_0x3de634){return _0x3de634['addAgents'](_0x31e21a[_0x2895('0x4e')][_0x2895('0x6b')],_[_0x2895('0x6c')](_0x31e21a[_0x2895('0x4e')],['ids','id'])||{})['spread'](function(_0x10ca0f){for(var _0x5dde20=0x0;_0x5dde20<_0x31e21a['body'][_0x2895('0x6b')][_0x2895('0x39')];_0x5dde20+=0x1){socket[_0x2895('0x6d')](_0x2895('0x6e'),{'UserId':Number(_0x31e21a['body'][_0x2895('0x6b')][_0x5dde20]),'VoicePrefixId':Number(_0x31e21a[_0x2895('0x48')]['id'])});}return _0x10ca0f;});}})[_0x2895('0x26')](respondWithResult(_0x48c014,null))[_0x2895('0x47')](handleError(_0x48c014,null));};exports[_0x2895('0x6f')]=function(_0x45e80c,_0x21d3dd,_0x3346c2){return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x45e80c[_0x2895('0x48')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0x21d3dd,null))['then'](function(_0x1a9c84){if(_0x1a9c84){return _0x1a9c84[_0x2895('0x6f')](_0x45e80c[_0x2895('0x36')]['ids'])[_0x2895('0x26')](function(){if(_[_0x2895('0x70')](_0x45e80c['query'][_0x2895('0x6b')])){for(var _0x1693b6=0x0;_0x1693b6<_0x45e80c[_0x2895('0x36')]['ids'][_0x2895('0x39')];_0x1693b6+=0x1){socket[_0x2895('0x6d')](_0x2895('0x71'),{'UserId':Number(_0x45e80c[_0x2895('0x36')]['ids'][_0x1693b6]),'VoicePrefixId':Number(_0x45e80c[_0x2895('0x48')]['id'])});}}else{socket[_0x2895('0x6d')](_0x2895('0x71'),{'UserId':Number(_0x45e80c['query'][_0x2895('0x6b')]),'VoicePrefixId':Number(_0x45e80c['params']['id'])});}});}})[_0x2895('0x26')](respondWithStatusCode(_0x21d3dd,null))[_0x2895('0x47')](handleError(_0x21d3dd,null));};exports[_0x2895('0x72')]=function(_0x253e07,_0x570dd9,_0x6eef86){var _0x46bbca={};var _0x413aa4={};var _0x5e892a;var _0x34898e;return db['VoicePrefix'][_0x2895('0x73')]({'where':{'id':_0x253e07[_0x2895('0x48')]['id']}})['then'](handleEntityNotFound(_0x570dd9,null))['then'](function(_0x3bd07c){if(_0x3bd07c){_0x5e892a=_0x3bd07c;_0x413aa4[_0x2895('0x3a')]=_['keys'](db[_0x2895('0x74')][_0x2895('0x2f')]);_0x413aa4['query']=_[_0x2895('0x33')](_0x253e07[_0x2895('0x36')]);_0x413aa4[_0x2895('0x34')]=_[_0x2895('0x35')](_0x413aa4[_0x2895('0x3a')],_0x413aa4['query']);_0x46bbca[_0x2895('0x38')]=_[_0x2895('0x35')](_0x413aa4[_0x2895('0x3a')],qs[_0x2895('0x37')](_0x253e07[_0x2895('0x36')]['fields']));_0x46bbca[_0x2895('0x38')]=_0x46bbca[_0x2895('0x38')][_0x2895('0x39')]?_0x46bbca[_0x2895('0x38')]:_0x413aa4['model'];_0x46bbca[_0x2895('0x3d')]=qs[_0x2895('0x3e')](_0x253e07[_0x2895('0x36')][_0x2895('0x3e')]);_0x46bbca['where']=qs[_0x2895('0x34')](_[_0x2895('0x3f')](_0x253e07[_0x2895('0x36')],_0x413aa4[_0x2895('0x34')]));if(_0x253e07[_0x2895('0x36')][_0x2895('0x40')]){_0x46bbca['where']=_[_0x2895('0x42')](_0x46bbca[_0x2895('0x41')],{'$or':_[_0x2895('0x32')](_0x46bbca['attributes'],function(_0x553af0){var _0x1ff21e={};_0x1ff21e[_0x553af0]={'$like':'%'+_0x253e07[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x1ff21e;})});}_0x46bbca=_[_0x2895('0x42')]({},_0x46bbca,_0x253e07[_0x2895('0x43')]);return _0x5e892a['getAgents'](_0x46bbca);}})[_0x2895('0x26')](function(_0x837eef){if(_0x837eef){_0x34898e=_0x837eef[_0x2895('0x39')];if(!_0x253e07['query']['hasOwnProperty'](_0x2895('0x3c'))){_0x46bbca[_0x2895('0x1f')]=qs[_0x2895('0x1f')](_0x253e07['query'][_0x2895('0x1f')]);_0x46bbca[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x253e07[_0x2895('0x36')]['offset']);}return _0x5e892a[_0x2895('0x72')](_0x46bbca);}})[_0x2895('0x26')](function(_0x71d436){if(_0x71d436){return _0x71d436?{'count':_0x34898e,'rows':_0x71d436}:null;}})[_0x2895('0x26')](respondWithResult(_0x570dd9,null))[_0x2895('0x47')](handleError(_0x570dd9,null));};exports[_0x2895('0x75')]=function(_0x3ae81f,_0x25f5c9,_0x2d6167){var _0x265c7a={};var _0x32baef={};var _0x3d2996;var _0x3d47d0;return db[_0x2895('0x2e')]['findOne']({'where':{'id':_0x3ae81f['params']['id']}})['then'](handleEntityNotFound(_0x25f5c9,null))['then'](function(_0x440fbf){if(_0x440fbf){_0x3d2996=_0x440fbf;_0x32baef[_0x2895('0x3a')]=_[_0x2895('0x33')](db[_0x2895('0x76')][_0x2895('0x2f')]);_0x32baef[_0x2895('0x36')]=_[_0x2895('0x33')](_0x3ae81f[_0x2895('0x36')]);_0x32baef[_0x2895('0x34')]=_[_0x2895('0x35')](_0x32baef[_0x2895('0x3a')],_0x32baef[_0x2895('0x36')]);_0x265c7a[_0x2895('0x38')]=_[_0x2895('0x35')](_0x32baef['model'],qs[_0x2895('0x37')](_0x3ae81f[_0x2895('0x36')][_0x2895('0x37')]));_0x265c7a['attributes']=_0x265c7a['attributes'][_0x2895('0x39')]?_0x265c7a[_0x2895('0x38')]:_0x32baef['model'];_0x265c7a[_0x2895('0x3d')]=qs['sort'](_0x3ae81f[_0x2895('0x36')][_0x2895('0x3e')]);_0x265c7a[_0x2895('0x41')]=qs[_0x2895('0x34')](_[_0x2895('0x3f')](_0x3ae81f[_0x2895('0x36')],_0x32baef[_0x2895('0x34')]));if(_0x3ae81f['query'][_0x2895('0x40')]){_0x265c7a[_0x2895('0x41')]=_['merge'](_0x265c7a[_0x2895('0x41')],{'$or':_[_0x2895('0x32')](_0x265c7a['attributes'],function(_0x1cf787){var _0x3c8ea2={};_0x3c8ea2[_0x1cf787]={'$like':'%'+_0x3ae81f[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x3c8ea2;})});}_0x265c7a=_[_0x2895('0x42')]({},_0x265c7a,_0x3ae81f[_0x2895('0x43')]);return _0x3d2996[_0x2895('0x75')](_0x265c7a);}})[_0x2895('0x26')](function(_0xdbd16a){if(_0xdbd16a){_0x3d47d0=_0xdbd16a[_0x2895('0x39')];if(!_0x3ae81f[_0x2895('0x36')][_0x2895('0x3b')](_0x2895('0x3c'))){_0x265c7a[_0x2895('0x1f')]=qs['limit'](_0x3ae81f[_0x2895('0x36')][_0x2895('0x1f')]);_0x265c7a[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x3ae81f[_0x2895('0x36')][_0x2895('0x1d')]);}return _0x3d2996[_0x2895('0x75')](_0x265c7a);}})['then'](function(_0x17055a){if(_0x17055a){return _0x17055a?{'count':_0x3d47d0,'rows':_0x17055a}:null;}})['then'](respondWithResult(_0x25f5c9,null))[_0x2895('0x47')](handleError(_0x25f5c9,null));};exports['addTeams']=function(_0x204af3,_0x3e2994,_0x1e85d9){var _0x53ccff=_0x204af3[_0x2895('0x4e')]['ids'];var _0x3f024f;return db[_0x2895('0x76')][_0x2895('0x77')]({'where':{'id':_0x53ccff},'attributes':['id'],'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x78'),'attributes':['id',_0x2895('0x2b'),_0x2895('0x79'),'voicePause',_0x2895('0x7a')],'raw':!![]}]})[_0x2895('0x26')](function(_0x1b8f32){if(_0x1b8f32){_0x3f024f=_0x1b8f32;var _0x4b7c11=_['flatMap'](_0x1b8f32,function(_0x335da0){var _0x13e113=_0x335da0[_0x2895('0x4f')]({'plain':!![]});return _0x13e113['Agents'];});return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x204af3[_0x2895('0x48')]['id']}})[_0x2895('0x26')](function(_0x1dcc85){return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x2d6109){return _0x1dcc85[_0x2895('0x7b')](_0x53ccff,{'transaction':_0x2d6109})[_0x2895('0x26')](function(){return BPromise[_0x2895('0x7c')](_0x3f024f,function(_0x16ec29){return db[_0x2895('0x7d')][_0x2895('0x7e')]({'TeamId':_0x16ec29['id'],'VoicePrefixId':_0x204af3[_0x2895('0x48')]['id']},{'transaction':_0x2d6109});});})[_0x2895('0x26')](function(){return BPromise[_0x2895('0x7c')](_0x4b7c11,function(_0x2c6df4){return db[_0x2895('0x7f')]['findOrCreate']({'where':{'UserId':_0x2c6df4['id'],'VoicePrefixId':_0x204af3['params']['id']},'transaction':_0x2d6109});});})[_0x2895('0x26')](function(){_0x4b7c11[_0x2895('0x80')](function(_0x366ca5){socket[_0x2895('0x6d')](_0x2895('0x6e'),{'UserId':_0x366ca5['id'],'VoicePrefixId':_0x1dcc85['id']});});});});});}})[_0x2895('0x26')](respondWithStatusCode(_0x3e2994,null))['catch'](handleError(_0x3e2994,null));};exports['removeTeams']=function(_0x51b96a,_0x40d48c,_0x4f0b85){return db[_0x2895('0x76')][_0x2895('0x77')]({'where':{'id':_0x51b96a[_0x2895('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x78'),'attributes':['id'],'raw':!![]}]})[_0x2895('0x26')](handleEntityNotFound(_0x40d48c,null))['then'](function(_0x340cb7){var _0x2458f1=_[_0x2895('0x32')](_0x340cb7,'id');var _0x2e3651=[];var _0x2187ce=[];var _0x175202=squel[_0x2895('0x81')]();_0x175202[_0x2895('0x82')]('tq.TeamId')[_0x2895('0x83')](_0x2895('0x84'),'tq')[_0x2895('0x85')](_0x2895('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2895('0x87'),_0x51b96a[_0x2895('0x48')]['id']);for(var _0x53eef2=0x0;_0x53eef2<_0x340cb7[_0x2895('0x39')];_0x53eef2+=0x1){let _0x1e2311=_0x340cb7[_0x53eef2];for(var _0x368a30=0x0;_0x368a30<_0x1e2311['Agents'][_0x2895('0x39')];_0x368a30+=0x1){let _0x2dd3d9=_0x1e2311[_0x2895('0x78')][_0x368a30];var _0x233136=_0x175202['clone']();_0x233136[_0x2895('0x41')]('ut.UserId\x20=\x20?',_0x2dd3d9['id']);_0x2187ce['push'](db['sequelize'][_0x2895('0x36')](_0x233136['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x2bbb3e){if(_0x2bbb3e[_0x2895('0x39')]===0x1){return _0x2dd3d9['id'];}else{var _0x25969b=_[_0x2895('0x88')](_['map'](_0x2bbb3e,'TeamId'),function(_0x5cc9fc){return _[_0x2895('0x89')](_0x2458f1,_0x5cc9fc);});if(_0x25969b){return _0x2dd3d9['id'];}}}));}}return BPromise[_0x2895('0x8a')](_0x2187ce)[_0x2895('0x26')](function(_0x2ccc9f){_0x2e3651=_(_0x2e3651)[_0x2895('0x8b')](_0x2ccc9f)[_0x2895('0x8c')]()[_0x2895('0x8d')]();return db[_0x2895('0x2e')]['find']({'where':{'id':_0x51b96a[_0x2895('0x48')]['id']}})[_0x2895('0x26')](function(_0x16f74a){return db['sequelize'][_0x2895('0x4d')](function(_0x5d05d3){return _0x16f74a[_0x2895('0x8e')](_0x51b96a[_0x2895('0x36')][_0x2895('0x6b')],{'transaction':_0x5d05d3})[_0x2895('0x26')](function(){if(!_['isEmpty'](_0x2e3651)){return _0x16f74a[_0x2895('0x6f')](_0x2e3651,{'transaction':_0x5d05d3});}})[_0x2895('0x26')](function(){_0x2e3651[_0x2895('0x80')](function(_0x3fb18a){socket[_0x2895('0x6d')]('userVoicePrefix:remove',{'UserId':_0x3fb18a,'VoicePrefixId':_0x16f74a['id']});});});});});});})[_0x2895('0x26')](respondWithStatusCode(_0x40d48c,null))[_0x2895('0x47')](handleError(_0x40d48c,null));}; \ No newline at end of file +var _0x3de3=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','VoicePrefixes','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoicePrefix','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','find','params','describe','create','transaction','body','get','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','callerIdAll','No\x20callerid\x20available','push','goto','${EXTEN:','charAt','system-','findById','ids','omit','spread','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','emit','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto'];(function(_0x530213,_0x3e1ebc){var _0x207910=function(_0x3d7e86){while(--_0x3d7e86){_0x530213['push'](_0x530213['shift']());}};_0x207910(++_0x3e1ebc);}(_0x3de3,0x1ce));var _0x33de=function(_0x3d6f9c,_0x18b667){_0x3d6f9c=_0x3d6f9c-0x0;var _0x2e6be5=_0x3de3[_0x3d6f9c];return _0x2e6be5;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];config[_0x33de('0x19')]=_['defaults'](config[_0x33de('0x19')],{'host':_0x33de('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33de('0x1b'))[_0x33de('0x1c')](socket);function respondWithStatusCode(_0x2b3748,_0x57a2a1){_0x57a2a1=_0x57a2a1||0xcc;return function(_0x57aa73){if(_0x57aa73){return _0x2b3748[_0x33de('0x1d')](_0x57a2a1);}return _0x2b3748[_0x33de('0x1e')](_0x57a2a1)['end']();};}function respondWithResult(_0x4ff69f,_0x185849){_0x185849=_0x185849||0xc8;return function(_0x16c050){if(_0x16c050){return _0x4ff69f[_0x33de('0x1e')](_0x185849)['json'](_0x16c050);}};}function respondWithFilteredResult(_0x2db887,_0x1203cf){return function(_0x52cfa0){if(_0x52cfa0){var _0x2815a7=typeof _0x1203cf[_0x33de('0x1f')]==='undefined'&&typeof _0x1203cf['limit']===_0x33de('0x20');var _0x52d718=_0x52cfa0[_0x33de('0x21')];var _0x2f0529=_0x2815a7?0x0:_0x1203cf[_0x33de('0x1f')];var _0x315c9b=_0x2815a7?_0x52cfa0[_0x33de('0x21')]:_0x1203cf[_0x33de('0x1f')]+_0x1203cf[_0x33de('0x22')];var _0x493263;if(_0x315c9b>=_0x52d718){_0x315c9b=_0x52d718;_0x493263=0xc8;}else{_0x493263=0xce;}_0x2db887['status'](_0x493263);return _0x2db887[_0x33de('0x23')]('Content-Range',_0x2f0529+'-'+_0x315c9b+'/'+_0x52d718)[_0x33de('0x24')](_0x52cfa0);}return null;};}function patchUpdates(_0x4cd8db){return function(_0x28ed17){try{jsonpatch[_0x33de('0x25')](_0x28ed17,_0x4cd8db,!![]);}catch(_0x575e88){return BPromise[_0x33de('0x26')](_0x575e88);}return _0x28ed17['save']();};}function saveUpdates(_0x67d040,_0x5c602d){return function(_0x62743b){if(_0x62743b){return _0x62743b[_0x33de('0x27')](_0x67d040)[_0x33de('0x28')](function(_0x5b79d7){return _0x5b79d7;});}return null;};}function removeEntity(_0x3bdba4,_0x2d206b){return function(_0x140979){if(_0x140979){return _0x140979['destroy']()[_0x33de('0x28')](function(){var _0x5585a2=_0x140979['get']({'plain':!![]});var _0x1c8de9=_0x33de('0x29');return db[_0x33de('0x2a')][_0x33de('0x2b')]({'where':{'type':_0x1c8de9,'resourceId':_0x5585a2['id']}})[_0x33de('0x28')](function(){return _0x140979;});})[_0x33de('0x28')](function(){_0x3bdba4[_0x33de('0x1e')](0xcc)[_0x33de('0x2c')]();});}};}function handleEntityNotFound(_0x59bc3b,_0x5ae0e8){return function(_0x2755e6){if(!_0x2755e6){_0x59bc3b[_0x33de('0x1d')](0x194);}return _0x2755e6;};}function handleError(_0xaeaec5,_0x451ff5){_0x451ff5=_0x451ff5||0x1f4;return function(_0x167cec){logger[_0x33de('0x2d')](_0x167cec[_0x33de('0x2e')]);if(_0x167cec['name']){delete _0x167cec[_0x33de('0x2f')];}_0xaeaec5[_0x33de('0x1e')](_0x451ff5)[_0x33de('0x30')](_0x167cec);};}exports[_0x33de('0x31')]=function(_0x49e857,_0xe5dc68){var _0xf5d78a={},_0x5a9c43={},_0x5d2da4={'count':0x0,'rows':[]};var _0x57fcf3=_[_0x33de('0x32')](db[_0x33de('0x33')]['rawAttributes'],function(_0x1d0194){return{'name':_0x1d0194['fieldName'],'type':_0x1d0194['type'][_0x33de('0x34')]};});_0x5a9c43[_0x33de('0x35')]=_[_0x33de('0x32')](_0x57fcf3,_0x33de('0x2f'));_0x5a9c43[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49e857[_0x33de('0x36')]);_0x5a9c43[_0x33de('0x38')]=_['intersection'](_0x5a9c43[_0x33de('0x35')],_0x5a9c43['query']);_0xf5d78a[_0x33de('0x39')]=_['intersection'](_0x5a9c43['model'],qs[_0x33de('0x3a')](_0x49e857[_0x33de('0x36')][_0x33de('0x3a')]));_0xf5d78a[_0x33de('0x39')]=_0xf5d78a[_0x33de('0x39')][_0x33de('0x3b')]?_0xf5d78a['attributes']:_0x5a9c43[_0x33de('0x35')];if(!_0x49e857[_0x33de('0x36')][_0x33de('0x3c')](_0x33de('0x3d'))){_0xf5d78a[_0x33de('0x22')]=qs[_0x33de('0x22')](_0x49e857[_0x33de('0x36')]['limit']);_0xf5d78a[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x49e857[_0x33de('0x36')][_0x33de('0x1f')]);}_0xf5d78a[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x49e857[_0x33de('0x36')]['sort']);_0xf5d78a[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x49e857[_0x33de('0x36')],_0x5a9c43[_0x33de('0x38')]),_0x57fcf3);if(_0x49e857[_0x33de('0x36')]['filter']){_0xf5d78a[_0x33de('0x40')]=_['merge'](_0xf5d78a[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x57fcf3,function(_0x4da2a5){if(_0x4da2a5[_0x33de('0x42')]!==_0x33de('0x43')){var _0x15918c={};_0x15918c[_0x4da2a5[_0x33de('0x2f')]]={'$like':'%'+_0x49e857[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x15918c;}})});}_0xf5d78a=_[_0x33de('0x45')]({},_0xf5d78a,_0x49e857[_0x33de('0x46')]);var _0x48e0fc={'where':_0xf5d78a['where']};return db['VoicePrefix'][_0x33de('0x21')](_0x48e0fc)[_0x33de('0x28')](function(_0x20d04f){_0x5d2da4[_0x33de('0x21')]=_0x20d04f;if(_0x49e857['query'][_0x33de('0x47')]){_0xf5d78a['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x33de('0x48')](_0xf5d78a);})[_0x33de('0x28')](function(_0x384b12){_0x5d2da4[_0x33de('0x49')]=_0x384b12;return _0x5d2da4;})[_0x33de('0x28')](respondWithFilteredResult(_0xe5dc68,_0xf5d78a))[_0x33de('0x4a')](handleError(_0xe5dc68,null));};exports[_0x33de('0x4b')]=function(_0x49b067,_0x3b5530){var _0x5de38b={'raw':![],'where':{'id':_0x49b067['params']['id']}},_0x2fbca6={};_0x2fbca6[_0x33de('0x35')]=_[_0x33de('0x37')](db['VoicePrefix'][_0x33de('0x4c')]);_0x2fbca6[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49b067['query']);_0x2fbca6['filters']=_[_0x33de('0x4d')](_0x2fbca6[_0x33de('0x35')],_0x2fbca6['query']);_0x5de38b['attributes']=_[_0x33de('0x4d')](_0x2fbca6['model'],qs['fields'](_0x49b067['query'][_0x33de('0x3a')]));_0x5de38b[_0x33de('0x39')]=_0x5de38b[_0x33de('0x39')][_0x33de('0x3b')]?_0x5de38b['attributes']:_0x2fbca6['model'];if(_0x49b067[_0x33de('0x36')][_0x33de('0x47')]){_0x5de38b['include']=[{'all':!![]}];}_0x5de38b=_[_0x33de('0x45')]({},_0x5de38b,_0x49b067[_0x33de('0x46')]);return db[_0x33de('0x33')][_0x33de('0x4e')](_0x5de38b)[_0x33de('0x28')](handleEntityNotFound(_0x3b5530,null))['then'](respondWithResult(_0x3b5530,null))[_0x33de('0x4a')](handleError(_0x3b5530,null));};exports[_0x33de('0x2b')]=function(_0x4fe3a2,_0x302573){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x4fe3a2[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x302573,null))[_0x33de('0x28')](removeEntity(_0x302573,null))[_0x33de('0x4a')](handleError(_0x302573,null));};exports[_0x33de('0x50')]=function(_0x24e428,_0x1b4397){return db['VoicePrefix'][_0x33de('0x50')]()[_0x33de('0x28')](respondWithResult(_0x1b4397,null))[_0x33de('0x4a')](handleError(_0x1b4397,null));};exports[_0x33de('0x51')]=function(_0xe6d59,_0x3fe65d){var _0x5c91e7;return db['sequelize'][_0x33de('0x52')](function(_0x32042e){return db[_0x33de('0x33')]['create'](_0xe6d59[_0x33de('0x53')],{'transaction':_0x32042e})[_0x33de('0x28')](function(_0x379224){_0x5c91e7=_0x379224[_0x33de('0x54')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x5c91e7[_0x33de('0x55')]},'raw':!![]})[_0x33de('0x28')](function(_0x232da5){return createVoicePrefixExtensions(_0x5c91e7,_0x232da5,_0x32042e);});});})[_0x33de('0x28')](function(){var _0x379784=_0xe6d59['user']['get']({'plain':!![]});if(!_0x379784)throw new Error(_0x33de('0x56'));if(_0x379784[_0x33de('0x57')]===_0x33de('0x58')){var _0x7112db=_0x5c91e7;return db[_0x33de('0x59')][_0x33de('0x4e')]({'where':{'name':_0x33de('0x29'),'userProfileId':_0x379784[_0x33de('0x5a')]},'raw':!![]})[_0x33de('0x28')](function(_0x5de12f){if(_0x5de12f&&_0x5de12f[_0x33de('0x5b')]===0x0){return db[_0x33de('0x2a')][_0x33de('0x51')]({'name':_0x7112db['name'],'resourceId':_0x7112db['id'],'type':_0x5de12f[_0x33de('0x2f')],'sectionId':_0x5de12f['id']},{})['then'](function(){return _0x5c91e7;});}else{return _0x5c91e7;}})['catch'](function(_0x4dae6d){logger['error'](_0x33de('0x5c'),_0x4dae6d);throw _0x4dae6d;});}return _0x5c91e7;})[_0x33de('0x28')](respondWithResult(_0x3fe65d,null))['catch'](handleError(_0x3fe65d,null));};function Extension(_0x397179,_0x232840,_0x56542f,_0x42c8b9){this[_0x33de('0x5d')]='from-sip';this[_0x33de('0x5e')]=_0x397179;this[_0x33de('0x5f')]=_0x56542f;this[_0x33de('0x42')]=_0x33de('0x60');this[_0x33de('0x61')]=_0x33de('0x62');this[_0x33de('0x63')]=_0x232840;this['appdata']=_0x42c8b9;}function createVoicePrefixExtensions(_0x533863,_0x409e2e,_0x49516d){return new BPromise(function(_0x2af340,_0x3eef03){var _0x4ca20f=new Extension(formatPrefixName(_0x533863[_0x33de('0x64')]),0x1,'NoOp',_0x33de('0x65'));_0x4ca20f[_0x33de('0x66')]=_0x533863['id'];return db['VoiceExtension']['create'](_0x4ca20f,{'transaction':_0x49516d})[_0x33de('0x28')](function(_0x1b2d6f){var _0x17845c=_0x1b2d6f[_0x33de('0x54')]({'plain':!![]});var _0x24d936=_['map'](addVoicePrefixExtensions(_0x533863,_0x409e2e),function(_0x221038){_0x221038[_0x33de('0x55')]=_0x17845c['id'];_0x221038['VoicePrefixId']=_0x533863['id'];return _0x221038;});return db[_0x33de('0x67')][_0x33de('0x68')](_0x24d936,{'transaction':_0x49516d})['then'](function(_0x151551){if(!_0x151551){return _0x3eef03(_0x33de('0x69'));}else{return _0x2af340(_0x151551);}})['catch'](function(_0x4aa203){return _0x3eef03(_0x4aa203);});});;});};function addVoicePrefixExtensions(_0xc2504a,_0x55d7ef){var _0x31a511=[];var _0x4803b8=formatPrefixName(_0xc2504a[_0x33de('0x64')]);_0x31a511['push'](new Extension(_0x4803b8,0x2,'Set','CDR(prefix)='+_0xc2504a['name']));if(_0xc2504a['callerIdAll']){_0x31a511['push'](new Extension(_0x4803b8,0x3,_0x33de('0x6a'),'PREFIX-CALLERIDALL='+_0xc2504a[_0x33de('0x6b')]));}else{_0x31a511['push'](new Extension(_0x4803b8,0x3,'NoOp',_0x33de('0x6c')));}_0x31a511[_0x33de('0x6d')](new Extension(_0x4803b8,0x4,_0x33de('0x6e'),_0x55d7ef[_0x33de('0x5d')]+','+_0x33de('0x6f')+(0x8+_0xc2504a[_0x33de('0x2f')][_0x33de('0x3b')])+'}'+','+0x1));return _0x31a511;}function formatPrefixName(_0x659652){var _0x4893d2='_';for(var _0x297a84=0x0;_0x297a84<_0x659652['length'];_0x297a84++){if(_0x659652[_0x33de('0x70')](_0x297a84)=='-'){_0x4893d2+=_0x659652[_0x33de('0x70')](_0x297a84);}else{_0x4893d2+='['+_0x659652[_0x33de('0x70')](_0x297a84)+']';}}_0x4893d2+='.';return _0x4893d2;}exports[_0x33de('0x27')]=function(_0x8a9729,_0x3f5d52,_0x2a6004){var _0x355b7d=_0x8a9729[_0x33de('0x53')];_0x355b7d[_0x33de('0x64')]=_0x33de('0x71')+_0x355b7d['name']+'-';return db['sequelize'][_0x33de('0x52')](function(_0x1179f6){return db[_0x33de('0x33')][_0x33de('0x27')](_0x355b7d,{'where':{'id':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x2b')]({'where':{'VoicePrefixId':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x4e')]({'where':{'id':_0x355b7d['VoiceExtensionId']},'raw':!![]})[_0x33de('0x28')](function(_0x43eb19){return createVoicePrefixExtensions(_0x355b7d,_0x43eb19,_0x1179f6);});});});})[_0x33de('0x28')](function(){return db[_0x33de('0x33')][_0x33de('0x72')](_0x355b7d['id']);})[_0x33de('0x28')](respondWithResult(_0x3f5d52,null))['catch'](handleError(_0x3f5d52,null));};exports['addAgents']=function(_0x558c26,_0x1370ac,_0x2d2b02){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x558c26['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x1370ac,null))[_0x33de('0x28')](function(_0x484827){if(_0x484827){return _0x484827['addAgents'](_0x558c26['body'][_0x33de('0x73')],_[_0x33de('0x74')](_0x558c26[_0x33de('0x53')],[_0x33de('0x73'),'id'])||{})[_0x33de('0x75')](function(_0x545555){for(var _0x2e6389=0x0;_0x2e6389<_0x558c26['body'][_0x33de('0x73')][_0x33de('0x3b')];_0x2e6389+=0x1){socket['emit'](_0x33de('0x76'),{'UserId':Number(_0x558c26[_0x33de('0x53')]['ids'][_0x2e6389]),'VoicePrefixId':Number(_0x558c26[_0x33de('0x4f')]['id'])});}return _0x545555;});}})['then'](respondWithResult(_0x1370ac,null))['catch'](handleError(_0x1370ac,null));};exports[_0x33de('0x77')]=function(_0x2ef94d,_0x3fbbaf,_0x46e3d6){return db[_0x33de('0x33')]['find']({'where':{'id':_0x2ef94d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x3fbbaf,null))[_0x33de('0x28')](function(_0x1e0637){if(_0x1e0637){return _0x1e0637['removeAgents'](_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')])[_0x33de('0x28')](function(){if(_['isArray'](_0x2ef94d['query']['ids'])){for(var _0x586c51=0x0;_0x586c51<_0x2ef94d['query'][_0x33de('0x73')][_0x33de('0x3b')];_0x586c51+=0x1){socket['emit'](_0x33de('0x78'),{'UserId':Number(_0x2ef94d['query']['ids'][_0x586c51]),'VoicePrefixId':Number(_0x2ef94d[_0x33de('0x4f')]['id'])});}}else{socket[_0x33de('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')]),'VoicePrefixId':Number(_0x2ef94d['params']['id'])});}});}})[_0x33de('0x28')](respondWithStatusCode(_0x3fbbaf,null))['catch'](handleError(_0x3fbbaf,null));};exports[_0x33de('0x7a')]=function(_0x1d060d,_0x487dac,_0x30d749){var _0x2cd94f={};var _0x53ec24={};var _0x4fa42c;var _0x130bbd;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x1d060d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x487dac,null))[_0x33de('0x28')](function(_0x4ef18b){if(_0x4ef18b){_0x4fa42c=_0x4ef18b;_0x53ec24[_0x33de('0x35')]=_[_0x33de('0x37')](db[_0x33de('0x7c')][_0x33de('0x4c')]);_0x53ec24[_0x33de('0x36')]=_[_0x33de('0x37')](_0x1d060d[_0x33de('0x36')]);_0x53ec24[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],_0x53ec24[_0x33de('0x36')]);_0x2cd94f[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x1d060d[_0x33de('0x36')]['fields']));_0x2cd94f[_0x33de('0x39')]=_0x2cd94f[_0x33de('0x39')][_0x33de('0x3b')]?_0x2cd94f[_0x33de('0x39')]:_0x53ec24[_0x33de('0x35')];_0x2cd94f['order']=qs[_0x33de('0x3f')](_0x1d060d[_0x33de('0x36')][_0x33de('0x3f')]);_0x2cd94f[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x1d060d[_0x33de('0x36')],_0x53ec24[_0x33de('0x38')]));if(_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]){_0x2cd94f['where']=_['merge'](_0x2cd94f[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x2cd94f[_0x33de('0x39')],function(_0xa0b337){var _0x5b8928={};_0x5b8928[_0xa0b337]={'$like':'%'+_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x5b8928;})});}_0x2cd94f=_[_0x33de('0x45')]({},_0x2cd94f,_0x1d060d['options']);return _0x4fa42c['getAgents'](_0x2cd94f);}})[_0x33de('0x28')](function(_0xe6b940){if(_0xe6b940){_0x130bbd=_0xe6b940[_0x33de('0x3b')];if(!_0x1d060d['query'][_0x33de('0x3c')](_0x33de('0x3d'))){_0x2cd94f[_0x33de('0x22')]=qs['limit'](_0x1d060d[_0x33de('0x36')][_0x33de('0x22')]);_0x2cd94f['offset']=qs[_0x33de('0x1f')](_0x1d060d['query'][_0x33de('0x1f')]);}return _0x4fa42c[_0x33de('0x7a')](_0x2cd94f);}})['then'](function(_0x42546c){if(_0x42546c){return _0x42546c?{'count':_0x130bbd,'rows':_0x42546c}:null;}})[_0x33de('0x28')](respondWithResult(_0x487dac,null))[_0x33de('0x4a')](handleError(_0x487dac,null));};exports['getTeams']=function(_0x52b4e2,_0x48a039,_0xfb0042){var _0x5f46d7={};var _0x5817e3={};var _0x3df0d3;var _0xebf05f;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x52b4e2['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x48a039,null))[_0x33de('0x28')](function(_0x27072a){if(_0x27072a){_0x3df0d3=_0x27072a;_0x5817e3['model']=_[_0x33de('0x37')](db[_0x33de('0x7d')][_0x33de('0x4c')]);_0x5817e3[_0x33de('0x36')]=_[_0x33de('0x37')](_0x52b4e2[_0x33de('0x36')]);_0x5817e3[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],_0x5817e3[_0x33de('0x36')]);_0x5f46d7[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3a')]));_0x5f46d7[_0x33de('0x39')]=_0x5f46d7[_0x33de('0x39')][_0x33de('0x3b')]?_0x5f46d7['attributes']:_0x5817e3[_0x33de('0x35')];_0x5f46d7[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3f')]);_0x5f46d7['where']=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x52b4e2[_0x33de('0x36')],_0x5817e3[_0x33de('0x38')]));if(_0x52b4e2[_0x33de('0x36')][_0x33de('0x44')]){_0x5f46d7[_0x33de('0x40')]=_[_0x33de('0x45')](_0x5f46d7[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x5f46d7['attributes'],function(_0x3af223){var _0x258238={};_0x258238[_0x3af223]={'$like':'%'+_0x52b4e2['query'][_0x33de('0x44')]+'%'};return _0x258238;})});}_0x5f46d7=_[_0x33de('0x45')]({},_0x5f46d7,_0x52b4e2['options']);return _0x3df0d3['getTeams'](_0x5f46d7);}})['then'](function(_0x1f1bd4){if(_0x1f1bd4){_0xebf05f=_0x1f1bd4['length'];if(!_0x52b4e2[_0x33de('0x36')][_0x33de('0x3c')]('nolimit')){_0x5f46d7[_0x33de('0x22')]=qs['limit'](_0x52b4e2[_0x33de('0x36')][_0x33de('0x22')]);_0x5f46d7[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x52b4e2[_0x33de('0x36')]['offset']);}return _0x3df0d3[_0x33de('0x7e')](_0x5f46d7);}})[_0x33de('0x28')](function(_0x24dcfe){if(_0x24dcfe){return _0x24dcfe?{'count':_0xebf05f,'rows':_0x24dcfe}:null;}})['then'](respondWithResult(_0x48a039,null))[_0x33de('0x4a')](handleError(_0x48a039,null));};exports[_0x33de('0x7f')]=function(_0x24af54,_0x2baee6,_0x56fadb){var _0x5ce00e=_0x24af54[_0x33de('0x53')][_0x33de('0x73')];var _0x2127ab;return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x5ce00e},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id',_0x33de('0x2f'),_0x33de('0x81'),_0x33de('0x82'),_0x33de('0x83')],'raw':!![]}]})[_0x33de('0x28')](function(_0x371e4d){if(_0x371e4d){_0x2127ab=_0x371e4d;var _0x17d367=_[_0x33de('0x84')](_0x371e4d,function(_0x21a70f){var _0x5e11f1=_0x21a70f[_0x33de('0x54')]({'plain':!![]});return _0x5e11f1[_0x33de('0x80')];});return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x24af54[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x5120f5){return db[_0x33de('0x85')][_0x33de('0x52')](function(_0x51b000){return _0x5120f5[_0x33de('0x7f')](_0x5ce00e,{'transaction':_0x51b000})[_0x33de('0x28')](function(){return BPromise[_0x33de('0x86')](_0x2127ab,function(_0x131d87){return db[_0x33de('0x87')][_0x33de('0x88')]({'TeamId':_0x131d87['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},{'transaction':_0x51b000});});})['then'](function(){return BPromise['each'](_0x17d367,function(_0x446257){return db[_0x33de('0x89')]['findOrCreate']({'where':{'UserId':_0x446257['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},'transaction':_0x51b000});});})[_0x33de('0x28')](function(){_0x17d367[_0x33de('0x8a')](function(_0xf06806){socket[_0x33de('0x79')]('userVoicePrefix:save',{'UserId':_0xf06806['id'],'VoicePrefixId':_0x5120f5['id']});});});});});}})[_0x33de('0x28')](respondWithStatusCode(_0x2baee6,null))[_0x33de('0x4a')](handleError(_0x2baee6,null));};exports[_0x33de('0x8b')]=function(_0x1f5872,_0x38d880,_0x40758b){return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x1f5872[_0x33de('0x36')][_0x33de('0x73')]},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38d880,null))[_0x33de('0x28')](function(_0xd41b76){var _0x24fa73=_['map'](_0xd41b76,'id');var _0x93313d=[];var _0x3c854d=[];var _0x3e00b7=squel['select']();_0x3e00b7['field'](_0x33de('0x8c'))['from'](_0x33de('0x8d'),'tq')[_0x33de('0x8e')](_0x33de('0x8f'),'ut',_0x33de('0x90'))[_0x33de('0x40')](_0x33de('0x91'),_0x1f5872[_0x33de('0x4f')]['id']);for(var _0x23b8e9=0x0;_0x23b8e9<_0xd41b76[_0x33de('0x3b')];_0x23b8e9+=0x1){let _0x64836b=_0xd41b76[_0x23b8e9];for(var _0x72b745=0x0;_0x72b745<_0x64836b[_0x33de('0x80')]['length'];_0x72b745+=0x1){let _0x4eacef=_0x64836b[_0x33de('0x80')][_0x72b745];var _0x13cd17=_0x3e00b7[_0x33de('0x92')]();_0x13cd17[_0x33de('0x40')]('ut.UserId\x20=\x20?',_0x4eacef['id']);_0x3c854d[_0x33de('0x6d')](db['sequelize']['query'](_0x13cd17[_0x33de('0x93')](),{'type':db[_0x33de('0x85')][_0x33de('0x94')][_0x33de('0x95')]})[_0x33de('0x28')](function(_0x251b71){if(_0x251b71['length']===0x1){return _0x4eacef['id'];}else{var _0x341b23=_[_0x33de('0x96')](_[_0x33de('0x32')](_0x251b71,_0x33de('0x97')),function(_0x29eda7){return _[_0x33de('0x98')](_0x24fa73,_0x29eda7);});if(_0x341b23){return _0x4eacef['id'];}}}));}}return BPromise[_0x33de('0x99')](_0x3c854d)['then'](function(_0x572532){_0x93313d=_(_0x93313d)[_0x33de('0x9a')](_0x572532)[_0x33de('0x9b')]()[_0x33de('0x9c')]();return db[_0x33de('0x33')]['find']({'where':{'id':_0x1f5872[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x24edf8){return db['sequelize'][_0x33de('0x52')](function(_0x1ad90f){return _0x24edf8['removeTeams'](_0x1f5872['query'][_0x33de('0x73')],{'transaction':_0x1ad90f})[_0x33de('0x28')](function(){if(!_[_0x33de('0x9d')](_0x93313d)){return _0x24edf8['removeAgents'](_0x93313d,{'transaction':_0x1ad90f});}})[_0x33de('0x28')](function(){_0x93313d[_0x33de('0x8a')](function(_0x4d56df){socket[_0x33de('0x79')](_0x33de('0x78'),{'UserId':_0x4d56df,'VoicePrefixId':_0x24edf8['id']});});});});});});})['then'](respondWithStatusCode(_0x38d880,null))['catch'](handleError(_0x38d880,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 257744b..c69b6f5 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 _0x54c4=['emit','hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x24161e,_0x5e3d59){var _0x49fb89=function(_0x532e79){while(--_0x532e79){_0x24161e['push'](_0x24161e['shift']());}};_0x49fb89(++_0x5e3d59);}(_0x54c4,0x112));var _0x454c=function(_0x5136b7,_0x6df915){_0x5136b7=_0x5136b7-0x0;var _0x468df3=_0x54c4[_0x5136b7];return _0x468df3;};'use strict';var EventEmitter=require(_0x454c('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x454c('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x454c('0x2')](0x0);var events={'afterCreate':_0x454c('0x3'),'afterUpdate':_0x454c('0x4'),'afterDestroy':_0x454c('0x5')};function emitEvent(_0x363196){return function(_0x5b70bf,_0x2a5234,_0xccb936){VoicePrefixEvents[_0x454c('0x6')](_0x363196+':'+_0x5b70bf['id'],_0x5b70bf);VoicePrefixEvents[_0x454c('0x6')](_0x363196,_0x5b70bf);_0xccb936(null);};}for(var e in events){if(events[_0x454c('0x7')](e)){var event=events[e];VoicePrefix[_0x454c('0x8')](e,emitEvent(event));}}module[_0x454c('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x2b1e=['events','VoicePrefix','emit','hasOwnProperty','hook','exports'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x2b1e,0x162));var _0xe2b1=function(_0x37348f,_0xa0dc92){_0x37348f=_0x37348f-0x0;var _0x4304f0=_0x2b1e[_0x37348f];return _0x4304f0;};'use strict';var EventEmitter=require(_0xe2b1('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xe2b1('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3bd2b3){return function(_0x29eead,_0x16ced2,_0x81e9d2){VoicePrefixEvents[_0xe2b1('0x2')](_0x3bd2b3+':'+_0x29eead['id'],_0x29eead);VoicePrefixEvents[_0xe2b1('0x2')](_0x3bd2b3,_0x29eead);_0x81e9d2(null);};}for(var e in events){if(events[_0xe2b1('0x3')](e)){var event=events[e];VoicePrefix[_0xe2b1('0x4')](e,emitEvent(event));}}module[_0xe2b1('0x5')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 399eca8..b157e18 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 _0xcb69=['lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','voice_prefixes'];(function(_0x4707f3,_0x17d932){var _0x27cbfe=function(_0x10072e){while(--_0x10072e){_0x4707f3['push'](_0x4707f3['shift']());}};_0x27cbfe(++_0x17d932);}(_0xcb69,0x171));var _0x9cb6=function(_0x5469b4,_0x36c488){_0x5469b4=_0x5469b4-0x0;var _0x458380=_0xcb69[_0x5469b4];return _0x458380;};'use strict';var _=require(_0x9cb6('0x0'));var util=require(_0x9cb6('0x1'));var logger=require(_0x9cb6('0x2'))(_0x9cb6('0x3'));var moment=require('moment');var BPromise=require(_0x9cb6('0x4'));var rp=require(_0x9cb6('0x5'));var fs=require('fs');var path=require(_0x9cb6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x9cb6('0x7')]=function(_0x3c4991,_0x3a9bea){return _0x3c4991['define']('VoicePrefix',attributes,{'tableName':_0x9cb6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27d4=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x386f13,_0x33d758){var _0x3008ee=function(_0x5db2cf){while(--_0x5db2cf){_0x386f13['push'](_0x386f13['shift']());}};_0x3008ee(++_0x33d758);}(_0x27d4,0xfe));var _0x427d=function(_0x976e42,_0x2a5e83){_0x976e42=_0x976e42-0x0;var _0x450176=_0x27d4[_0x976e42];return _0x450176;};'use strict';var _=require(_0x427d('0x0'));var util=require('util');var logger=require(_0x427d('0x1'))(_0x427d('0x2'));var moment=require(_0x427d('0x3'));var BPromise=require(_0x427d('0x4'));var rp=require(_0x427d('0x5'));var fs=require('fs');var path=require(_0x427d('0x6'));var rimraf=require(_0x427d('0x7'));var config=require(_0x427d('0x8'));var attributes=require(_0x427d('0x9'));module[_0x427d('0xa')]=function(_0x39a0d3,_0x306d41){return _0x39a0d3[_0x427d('0xb')](_0x427d('0xc'),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 cbf1670..73bdd12 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 _0x5b6e=['VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug'];(function(_0x335866,_0x42f50e){var _0x3e8588=function(_0x2950e7){while(--_0x2950e7){_0x335866['push'](_0x335866['shift']());}};_0x3e8588(++_0x42f50e);}(_0x5b6e,0x14c));var _0xe5b6=function(_0xb13fb5,_0x157137){_0xb13fb5=_0xb13fb5-0x0;var _0x3ab9c5=_0x5b6e[_0xb13fb5];return _0x3ab9c5;};'use strict';var _=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var moment=require('moment');var BPromise=require(_0xe5b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5b6('0x3'));var db=require(_0xe5b6('0x4'))['db'];var utils=require(_0xe5b6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe5b6('0x6'));var jayson=require(_0xe5b6('0x7'));var client=jayson[_0xe5b6('0x8')][_0xe5b6('0x9')]({'port':0x232a});config['redis']=_[_0xe5b6('0xa')](config[_0xe5b6('0xb')],{'host':_0xe5b6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5b6('0xb')]));require('./voicePrefix.socket')[_0xe5b6('0xd')](socket);function respondWithRpcPromise(_0x46f384,_0x4faece,_0x2278eb){return new BPromise(function(_0x2b4b08,_0x5b8371){return client[_0xe5b6('0xe')](_0x46f384,_0x2278eb)[_0xe5b6('0xf')](function(_0x58ca4b){logger[_0xe5b6('0x10')](_0xe5b6('0x11'),_0x4faece,'request\x20sent');logger[_0xe5b6('0x12')](_0xe5b6('0x13'),_0x4faece,_0xe5b6('0x14'),JSON[_0xe5b6('0x15')](_0x58ca4b));if(_0x58ca4b[_0xe5b6('0x16')]){if(_0x58ca4b['error'][_0xe5b6('0x17')]===0x1f4){logger[_0xe5b6('0x16')](_0xe5b6('0x11'),_0x4faece,_0x58ca4b[_0xe5b6('0x16')][_0xe5b6('0x18')]);return _0x5b8371(_0x58ca4b[_0xe5b6('0x16')][_0xe5b6('0x18')]);}logger[_0xe5b6('0x16')](_0xe5b6('0x11'),_0x4faece,_0x58ca4b[_0xe5b6('0x16')][_0xe5b6('0x18')]);return _0x2b4b08(_0x58ca4b['error'][_0xe5b6('0x18')]);}else{logger['info'](_0xe5b6('0x11'),_0x4faece,_0xe5b6('0x14'));_0x2b4b08(_0x58ca4b[_0xe5b6('0x19')]['message']);}})[_0xe5b6('0x1a')](function(_0x64de88){logger[_0xe5b6('0x16')](_0xe5b6('0x11'),_0x4faece,_0x64de88);_0x5b8371(_0x64de88);});});} \ No newline at end of file +var _0x5f71=['catch','lodash','moment','randomstring','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x295d4d,_0x289951){var _0x395cd0=function(_0x8eb6d1){while(--_0x8eb6d1){_0x295d4d['push'](_0x295d4d['shift']());}};_0x395cd0(++_0x289951);}(_0x5f71,0xc9));var _0x15f7=function(_0x9270ec,_0x3b35a0){_0x9270ec=_0x9270ec-0x0;var _0x5e381b=_0x5f71[_0x9270ec];return _0x5e381b;};'use strict';var _=require(_0x15f7('0x0'));var util=require('util');var moment=require(_0x15f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x15f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15f7('0x3'))(_0x15f7('0x4'));var config=require('../../config/environment');var jayson=require(_0x15f7('0x5'));var client=jayson[_0x15f7('0x6')][_0x15f7('0x7')]({'port':0x232a});config[_0x15f7('0x8')]=_[_0x15f7('0x9')](config[_0x15f7('0x8')],{'host':_0x15f7('0xa'),'port':0x18eb});var socket=require(_0x15f7('0xb'))(new Redis(config[_0x15f7('0x8')]));require(_0x15f7('0xc'))[_0x15f7('0xd')](socket);function respondWithRpcPromise(_0x40dbfa,_0x4b53ab,_0x4f09e7){return new BPromise(function(_0x4fddfc,_0x121607){return client['request'](_0x40dbfa,_0x4f09e7)[_0x15f7('0xe')](function(_0x9cbf6){logger[_0x15f7('0xf')](_0x15f7('0x10'),_0x4b53ab,_0x15f7('0x11'));logger[_0x15f7('0x12')](_0x15f7('0x13'),_0x4b53ab,'request\x20sent',JSON[_0x15f7('0x14')](_0x9cbf6));if(_0x9cbf6[_0x15f7('0x15')]){if(_0x9cbf6[_0x15f7('0x15')]['code']===0x1f4){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6['error'][_0x15f7('0x16')]);return _0x121607(_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);}logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);return _0x4fddfc(_0x9cbf6['error'][_0x15f7('0x16')]);}else{logger[_0x15f7('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x4b53ab,_0x15f7('0x11'));_0x4fddfc(_0x9cbf6[_0x15f7('0x17')][_0x15f7('0x16')]);}})[_0x15f7('0x18')](function(_0x26627b){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x26627b);_0x121607(_0x26627b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index b148a8c..a92b153 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 _0xac4a=['save','remove','update','removeListener','./voicePrefix.events'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xac4a,0x13f));var _0xaac4=function(_0x5a2521,_0x3e33d5){_0x5a2521=_0x5a2521-0x0;var _0x298f72=_0xac4a[_0x5a2521];return _0x298f72;};'use strict';var VoicePrefixEvents=require(_0xaac4('0x0'));var events=[_0xaac4('0x1'),_0xaac4('0x2'),_0xaac4('0x3')];function createListener(_0x38f4f4,_0x1dc251){return function(_0x5aeb7d){_0x1dc251['emit'](_0x38f4f4,_0x5aeb7d);};}function removeListener(_0x2af0f6,_0x2a5762){return function(){VoicePrefixEvents[_0xaac4('0x4')](_0x2af0f6,_0x2a5762);};}exports['register']=function(_0x1283a5){for(var _0x53d03a=0x0,_0x1cdfc5=events['length'];_0x53d03a<_0x1cdfc5;_0x53d03a++){var _0x1e4283=events[_0x53d03a];var _0x27354c=createListener('voicePrefix:'+_0x1e4283,_0x1283a5);VoicePrefixEvents['on'](_0x1e4283,_0x27354c);}}; \ No newline at end of file +var _0x6e77=['emit','voicePrefix:','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e77,0xef));var _0x76e7=function(_0x2e5981,_0xe4e846){_0x2e5981=_0x2e5981-0x0;var _0x6e4fef=_0x6e77[_0x2e5981];return _0x6e4fef;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x76e7('0x0'),'remove','update'];function createListener(_0x389715,_0x2aea10){return function(_0x57a8b3){_0x2aea10[_0x76e7('0x1')](_0x389715,_0x57a8b3);};}function removeListener(_0x305900,_0xcc6627){return function(){VoicePrefixEvents['removeListener'](_0x305900,_0xcc6627);};}exports['register']=function(_0x423b7a){for(var _0xf4d008=0x0,_0xac49d0=events['length'];_0xf4d008<_0xac49d0;_0xf4d008++){var _0x433ae3=events[_0xf4d008];var _0x464a99=createListener(_0x76e7('0x2')+_0x433ae3,_0x423b7a);VoicePrefixEvents['on'](_0x433ae3,_0x464a99);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 45883da..52fcd5d 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x4eaa9c,_0x3a879a){var _0x46b796=function(_0x41f4bc){while(--_0x41f4bc){_0x4eaa9c['push'](_0x4eaa9c['shift']());}};_0x46b796(++_0x3a879a);}(_0xb10b,0x12a));var _0xbb10=function(_0x24ae93,_0x364bd5){_0x24ae93=_0x24ae93-0x0;var _0x2fc1f3=_0xb10b[_0x24ae93];return _0x2fc1f3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c68e4,_0x20e968){_0x3c68e4=_0x3c68e4-0x0;var _0x2b35e7=_0xb10b[_0x3c68e4];return _0x2b35e7;};'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 e3679ed..bf2be1d 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 _0xa549=['random','linear','ringall','setDataValue','rrmemory','type','getDataValue','dialMethod','booked','predictive','power','INTEGER','STRING','yes','all','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','name','ENUM','inbound','leastrecent'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0xa549,0x1c8));var _0x9a54=function(_0x34b765,_0x4ef22a){_0x34b765=_0x34b765-0x0;var _0x3b5b72=_0xa549[_0x34b765];return _0x3b5b72;};'use strict';var Sequelize=require(_0x9a54('0x0'));module[_0x9a54('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a54('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x9a54('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x9a54('0x3')]('rr','ringall',_0x9a54('0x5'),'fewestcalls',_0x9a54('0x6'),'rrmemory',_0x9a54('0x7'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x9a54('0x8'),'set':function(_0x4bf937){this[_0x9a54('0x9')]('strategy',_0x4bf937?_0x4bf937:_0x9a54('0xa'));},'get':function(){var _0xa8cf7f=this['getDataValue'](_0x9a54('0xb'));var _0x25e967=this[_0x9a54('0xc')](_0x9a54('0xd'));var _0x2192ce=this['getDataValue']('strategy');if(_0xa8cf7f===_0x9a54('0x4')){return _0x2192ce;}if(_0x25e967===_0x9a54('0xe')&&_0x2192ce===_0x9a54('0xa')||_0x25e967===_0x9a54('0xe')&&_0x2192ce==='roundrobin'){return _0x2192ce;}if(_0x25e967==='progressive'||_0x25e967===_0x9a54('0xf')||_0x25e967===_0x9a54('0x10')){return _0x2192ce;}return null;}},'servicelevel':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9a54('0x11')](0xb)},'timeout':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9a54('0x12')]},'weight':{'type':Sequelize[_0x9a54('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':_0x9a54('0x13')},'autopause':{'type':Sequelize['ENUM'](_0x9a54('0x13'),'no',_0x9a54('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9a54('0x11')](0xb)},'autopausebusy':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9a54('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9a54('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9a54('0x13')},'announce_holdtime':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no',_0x9a54('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x9a54('0x11')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9a54('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9a54('0x12')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9a54('0x12')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9a54('0x12')]},'queue_quantity1':{'type':Sequelize[_0x9a54('0x12')]},'queue_quantity2':{'type':Sequelize[_0x9a54('0x12')]},'queue_periodic_announce':{'type':Sequelize[_0x9a54('0x12')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x9a54('0x16')],'set':function(_0x1ef581){this[_0x9a54('0x9')](_0x9a54('0x17'),_0x1ef581?_0x1ef581['join'](','):[]);},'get':function(){return this['getDataValue'](_0x9a54('0x17'))?this[_0x9a54('0xc')](_0x9a54('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':'yes','set':function(_0x2aa408){this[_0x9a54('0x9')](_0x9a54('0x18'),_0x2aa408?_0x2aa408[_0x9a54('0x19')](','):undefined);},'get':function(){return this[_0x9a54('0xc')]('joinempty')?this[_0x9a54('0xc')](_0x9a54('0x18'))[_0x9a54('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':'no','set':function(_0x1392dc){this[_0x9a54('0x9')](_0x9a54('0x1b'),_0x1392dc?_0x1392dc[_0x9a54('0x19')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x9a54('0xc')](_0x9a54('0x1b'))[_0x9a54('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x9a54('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9a54('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9a54('0x12')]},'acw':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':0x0,'set':function(_0x43f435){this[_0x9a54('0x9')](_0x9a54('0x1d'),_0x43f435);if(_0x43f435){if(this[_0x9a54('0xc')](_0x9a54('0x1e'))<0x2){this['setDataValue'](_0x9a54('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9a54('0x11')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x1f'),_0x9a54('0x20'),_0x9a54('0x10'),'predictive','booked'),'defaultValue':'progressive','comment':_0x9a54('0x21')},'dialLimitChannel':{'type':Sequelize[_0x9a54('0x11')](0x4)[_0x9a54('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a54('0x23')},'dialLimitQueue':{'type':Sequelize[_0x9a54('0x11')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a54('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9a54('0x25')](0x2)[_0x9a54('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x26'),_0x9a54('0x27')),'defaultValue':_0x9a54('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9a54('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9a54('0x12')]},'dialOriginateTimeout':{'type':Sequelize[_0x9a54('0x11')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x29')},'dialQueueOptions':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':_0x9a54('0x2a'),'comment':_0x9a54('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x2c')},'dialQueueProject':{'type':Sequelize[_0x9a54('0x12')],'comment':_0x9a54('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'comment':_0x9a54('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9a54('0x31')},'dialTimezone':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':_0x9a54('0x32')},'dialPrefix':{'type':Sequelize[_0x9a54('0x12')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x33'),_0x9a54('0x34'),_0x9a54('0x35')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':0x0,'comment':_0x9a54('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x9a54('0x11')](0x9)[_0x9a54('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9a54('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x9a54('0x11')](0x9)[_0x9a54('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9a54('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9a54('0x11')](0x9)[_0x9a54('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9a54('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9a54('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a54('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x9a54('0x11')](0x9)[_0x9a54('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9a54('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9a54('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9a54('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9a54('0x11')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9a54('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9a54('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9a54('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':0x0,'comment':_0x9a54('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9a54('0x3')](_0x9a54('0x40'),_0x9a54('0x41')),'defaultValue':_0x9a54('0x40')},'dialQueueProject2':{'type':Sequelize[_0x9a54('0x12')],'comment':_0x9a54('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9a54('0x11')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9a54('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a54('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9a54('0x11')](0x3)[_0x9a54('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9a54('0x11')](0x5)[_0x9a54('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a54('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':![],'comment':_0x9a54('0x4c'),'set':function(_0x206f8b){if(!_0x206f8b)this[_0x9a54('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x206f8b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9a54('0x11')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x9a54('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9a54('0x1c')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4c31=['fewestcalls','random','rrmemory','wrandom','rrordered','getDataValue','type','dialMethod','booked','roundrobin','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','predictive','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','#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','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize','exports','name','ENUM','inbound','outbound','default','STRING','ringall','leastrecent'];(function(_0x5c0275,_0x565293){var _0x386d97=function(_0x3a825a){while(--_0x3a825a){_0x5c0275['push'](_0x5c0275['shift']());}};_0x386d97(++_0x565293);}(_0x4c31,0xdd));var _0x14c3=function(_0x39986b,_0x29a43b){_0x39986b=_0x39986b-0x0;var _0x40b9d5=_0x4c31[_0x39986b];return _0x40b9d5;};'use strict';var Sequelize=require(_0x14c3('0x0'));module[_0x14c3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x14c3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x4'),_0x14c3('0x5')),'allowNull':![],'defaultValue':_0x14c3('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x14c3('0x6')},'announce':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':''},'strategy':{'type':Sequelize[_0x14c3('0x3')]('rr',_0x14c3('0x8'),_0x14c3('0x9'),_0x14c3('0xa'),_0x14c3('0xb'),_0x14c3('0xc'),'linear',_0x14c3('0xd'),_0x14c3('0xe')),'allowNull':![],'defaultValue':_0x14c3('0x8'),'set':function(_0x22b32a){this['setDataValue']('strategy',_0x22b32a?_0x22b32a:_0x14c3('0xc'));},'get':function(){var _0x1d812c=this[_0x14c3('0xf')](_0x14c3('0x10'));var _0x23dfe8=this[_0x14c3('0xf')](_0x14c3('0x11'));var _0x4bc233=this[_0x14c3('0xf')]('strategy');if(_0x1d812c==='inbound'){return _0x4bc233;}if(_0x23dfe8===_0x14c3('0x12')&&_0x4bc233===_0x14c3('0xc')||_0x23dfe8===_0x14c3('0x12')&&_0x4bc233===_0x14c3('0x13')){return _0x4bc233;}if(_0x23dfe8==='progressive'||_0x23dfe8==='predictive'||_0x23dfe8===_0x14c3('0x14')){return _0x4bc233;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x14c3('0x15')](0xb)},'timeout':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x14c3('0x7')]},'weight':{'type':Sequelize[_0x14c3('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x14c3('0x3')]('yes','no'),'defaultValue':_0x14c3('0x16')},'autopause':{'type':Sequelize[_0x14c3('0x3')]('yes','no',_0x14c3('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x14c3('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x14c3('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x14c3('0x7')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x14c3('0x7')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x14c3('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x14c3('0x16'),'no',_0x14c3('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x14c3('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x14c3('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x14c3('0x7')]},'queue_youarenext':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x14c3('0x7')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x14c3('0x7')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x14c3('0x7')]},'queue_periodic_announce':{'type':Sequelize[_0x14c3('0x7')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x14c3('0x19')],'set':function(_0x72edb4){this['setDataValue'](_0x14c3('0x1a'),_0x72edb4?_0x72edb4[_0x14c3('0x1b')](','):[]);},'get':function(){return this[_0x14c3('0xf')](_0x14c3('0x1a'))?this[_0x14c3('0xf')](_0x14c3('0x1a'))[_0x14c3('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':_0x14c3('0x16'),'set':function(_0x5cf621){this[_0x14c3('0x1d')](_0x14c3('0x1e'),_0x5cf621?_0x5cf621[_0x14c3('0x1b')](','):undefined);},'get':function(){return this[_0x14c3('0xf')](_0x14c3('0x1e'))?this[_0x14c3('0xf')](_0x14c3('0x1e'))[_0x14c3('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':'no','set':function(_0x4e7f32){this[_0x14c3('0x1d')](_0x14c3('0x1f'),_0x4e7f32?_0x4e7f32[_0x14c3('0x1b')](','):undefined);},'get':function(){return this[_0x14c3('0xf')](_0x14c3('0x1f'))?this[_0x14c3('0xf')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x14c3('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x14c3('0x7')]},'description':{'type':Sequelize[_0x14c3('0x7')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x18e31f){this[_0x14c3('0x1d')](_0x14c3('0x20'),_0x18e31f);if(_0x18e31f){if(this[_0x14c3('0xf')]('wrapuptime')<0x2){this[_0x14c3('0x1d')](_0x14c3('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x14c3('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x14c3('0x22')],'defaultValue':0x0,'comment':_0x14c3('0x23')},'dialMethod':{'type':Sequelize['ENUM'](_0x14c3('0x24'),_0x14c3('0x25'),'power',_0x14c3('0x26'),_0x14c3('0x12')),'defaultValue':'progressive','comment':_0x14c3('0x27')},'dialLimitChannel':{'type':Sequelize[_0x14c3('0x15')](0x4)[_0x14c3('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14c3('0x29')},'dialLimitQueue':{'type':Sequelize[_0x14c3('0x15')](0x4)[_0x14c3('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14c3('0x2a')},'dialPowerLevel':{'type':Sequelize[_0x14c3('0x2b')](0x2)[_0x14c3('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x14c3('0x2c'),_0x14c3('0x2d')),'defaultValue':_0x14c3('0x2d'),'comment':_0x14c3('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x14c3('0x2b')](0x2)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x14c3('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x14c3('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0x14c3('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14c3('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x14c3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x31')},'dialQueueOptions':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':_0x14c3('0x32'),'comment':_0x14c3('0x33')},'dialQueueTimeout':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x14c3('0x7')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14c3('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'comment':_0x14c3('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14c3('0x38')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14c3('0x39')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x14c3('0x3a')},'dialPrefix':{'type':Sequelize[_0x14c3('0x7')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x3b'),'never','onlyIfOpen'),'defaultValue':_0x14c3('0x3b')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x14c3('0x3c')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x14c3('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x14c3('0x15')](0x9)[_0x14c3('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14c3('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14c3('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x14c3('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14c3('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14c3('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x14c3('0x15')](0x9)[_0x14c3('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x14c3('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14c3('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x14c3('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x14c3('0x15')](0x9)[_0x14c3('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14c3('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x14c3('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x14c3('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x14c3('0x22')],'defaultValue':0x0,'comment':_0x14c3('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x14c3('0x3')](_0x14c3('0x44'),_0x14c3('0x45')),'defaultValue':_0x14c3('0x44')},'dialQueueProject2':{'type':Sequelize[_0x14c3('0x7')],'comment':_0x14c3('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14c3('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x14c3('0x15')](0x5)[_0x14c3('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14c3('0x15')](0x3)[_0x14c3('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14c3('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14c3('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x14c3('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x14c3('0x22')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ef1f8){if(!_0x4ef1f8)this[_0x14c3('0x1d')]('mandatoryDispositionPauseId',null);this[_0x14c3('0x1d')]('mandatoryDisposition',_0x4ef1f8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x14c3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x14c3('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x14c3('0x22')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a6aeb48..0c8eeed 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 _0x1bbd=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','all','union','compact','userVoiceQueue:remove','addAgents','isEmpty','online','isNil','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','fromQuery','COALESCE(phone,\x27\x27)','cm_contacts','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','insert','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','update','destroy','then','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','error','name','send','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','params','create','body','user','VoiceQueues','userProfileId','autoAssociation','catch','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','TeamVoiceQueue','upsert','each','findOrCreate','UserVoiceQueueRt','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues'];(function(_0x3e177d,_0x25be5e){var _0x17c545=function(_0x36ccbc){while(--_0x36ccbc){_0x3e177d['push'](_0x3e177d['shift']());}};_0x17c545(++_0x25be5e);}(_0x1bbd,0xec));var _0xd1bb=function(_0x1a6cb9,_0xe5f0a5){_0x1a6cb9=_0x1a6cb9-0x0;var _0x80e1ca=_0x1bbd[_0x1a6cb9];return _0x80e1ca;};'use strict';var emlformat=require(_0xd1bb('0x0'));var rimraf=require(_0xd1bb('0x1'));var zipdir=require(_0xd1bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd1bb('0x3'));var moment=require(_0xd1bb('0x4'));var BPromise=require(_0xd1bb('0x5'));var Mustache=require(_0xd1bb('0x6'));var util=require(_0xd1bb('0x7'));var path=require(_0xd1bb('0x8'));var sox=require(_0xd1bb('0x9'));var csv=require(_0xd1bb('0xa'));var ejs=require(_0xd1bb('0xb'));var fs=require('fs');var fs_extra=require(_0xd1bb('0xc'));var _=require(_0xd1bb('0xd'));var squel=require(_0xd1bb('0xe'));var crypto=require('crypto');var jsforce=require(_0xd1bb('0xf'));var deskjs=require(_0xd1bb('0x10'));var toCsv=require(_0xd1bb('0xa'));var querystring=require(_0xd1bb('0x11'));var Papa=require(_0xd1bb('0x12'));var Redis=require(_0xd1bb('0x13'));var authService=require(_0xd1bb('0x14'));var qs=require(_0xd1bb('0x15'));var as=require(_0xd1bb('0x16'));var hardwareService=require(_0xd1bb('0x17'));var logger=require(_0xd1bb('0x18'))(_0xd1bb('0x19'));var utils=require(_0xd1bb('0x1a'));var config=require(_0xd1bb('0x1b'));var licenseUtil=require(_0xd1bb('0x1c'));var db=require(_0xd1bb('0x1d'))['db'];config[_0xd1bb('0x1e')]=_[_0xd1bb('0x1f')](config[_0xd1bb('0x1e')],{'host':_0xd1bb('0x20'),'port':0x18eb});var socket=require(_0xd1bb('0x21'))(new Redis(config[_0xd1bb('0x1e')]));require(_0xd1bb('0x22'))[_0xd1bb('0x23')](socket);function respondWithStatusCode(_0x3c24c6,_0x567419){_0x567419=_0x567419||0xcc;return function(_0x3947d6){if(_0x3947d6){return _0x3c24c6[_0xd1bb('0x24')](_0x567419);}return _0x3c24c6[_0xd1bb('0x25')](_0x567419)[_0xd1bb('0x26')]();};}function respondWithResult(_0x5dc953,_0x58ef48){_0x58ef48=_0x58ef48||0xc8;return function(_0x237a5c){if(_0x237a5c){return _0x5dc953[_0xd1bb('0x25')](_0x58ef48)['json'](_0x237a5c);}};}function respondWithFilteredResult(_0x271425,_0x35ebf7){return function(_0x5ed55b){if(_0x5ed55b){var _0x33b31d=typeof _0x35ebf7[_0xd1bb('0x27')]===_0xd1bb('0x28')&&typeof _0x35ebf7[_0xd1bb('0x29')]===_0xd1bb('0x28');var _0x3c66b4=_0x5ed55b[_0xd1bb('0x2a')];var _0x1971c1=_0x33b31d?0x0:_0x35ebf7['offset'];var _0x4f5df6=_0x33b31d?_0x5ed55b[_0xd1bb('0x2a')]:_0x35ebf7[_0xd1bb('0x27')]+_0x35ebf7[_0xd1bb('0x29')];var _0x47f0bd;if(_0x4f5df6>=_0x3c66b4){_0x4f5df6=_0x3c66b4;_0x47f0bd=0xc8;}else{_0x47f0bd=0xce;}_0x271425['status'](_0x47f0bd);return _0x271425[_0xd1bb('0x2b')]('Content-Range',_0x1971c1+'-'+_0x4f5df6+'/'+_0x3c66b4)['json'](_0x5ed55b);}return null;};}function patchUpdates(_0x566b5c){return function(_0x5fd79){try{jsonpatch[_0xd1bb('0x2c')](_0x5fd79,_0x566b5c,!![]);}catch(_0x185a4c){return BPromise['reject'](_0x185a4c);}return _0x5fd79['save']();};}function saveUpdates(_0x248817,_0x1d3d10){return function(_0x39fde9){if(_0x39fde9){return _0x39fde9[_0xd1bb('0x2d')](_0x248817)['then'](function(_0x16e244){return _0x16e244;});}return null;};}function removeEntity(_0x112dd6,_0x53ca45){return function(_0x5ab277){if(_0x5ab277){return _0x5ab277[_0xd1bb('0x2e')]()[_0xd1bb('0x2f')](function(){var _0x4ef30d=_0x5ab277[_0xd1bb('0x30')]({'plain':!![]});var _0x53e756=[{'name':'VoiceQueues','value':_0xd1bb('0x31'),'ignore':![]},{'name':_0xd1bb('0x32'),'value':_0xd1bb('0x33'),'ignore':![]}];var _0x19b33d=_(_0x53e756)[_0xd1bb('0x34')](_0xd1bb('0x35'))[_0xd1bb('0x36')]('value')[_0xd1bb('0x37')]();if(_['includes'](_0x19b33d,_0x4ef30d[_0xd1bb('0x38')])){return;}var _0xbea659=_[_0xd1bb('0x39')](_0x53e756,[_0xd1bb('0x37'),_0x4ef30d['type']])['name'];return db[_0xd1bb('0x3a')][_0xd1bb('0x2e')]({'where':{'type':_0xbea659,'resourceId':_0x4ef30d['id']}})[_0xd1bb('0x2f')](function(){return _0x5ab277;});})['then'](function(){_0x112dd6[_0xd1bb('0x25')](0xcc)[_0xd1bb('0x26')]();});}};}function handleEntityNotFound(_0x2685fb,_0x3ce0d2){return function(_0x412f74){if(!_0x412f74){_0x2685fb[_0xd1bb('0x24')](0x194);}return _0x412f74;};}function handleError(_0x485702,_0x572ab5){_0x572ab5=_0x572ab5||0x1f4;return function(_0x339eb7){logger[_0xd1bb('0x3b')](_0x339eb7['stack']);if(_0x339eb7[_0xd1bb('0x3c')]){delete _0x339eb7[_0xd1bb('0x3c')];}_0x485702['status'](_0x572ab5)[_0xd1bb('0x3d')](_0x339eb7);};}exports['index']=function(_0x4c87cc,_0x36d334){var _0x5a65d4={},_0x2c23eb={},_0x323f0b={'count':0x0,'rows':[]};var _0x430981=_[_0xd1bb('0x36')](db['VoiceQueue'][_0xd1bb('0x3e')],function(_0x2c6c95){return{'name':_0x2c6c95['fieldName'],'type':_0x2c6c95['type'][_0xd1bb('0x3f')]};});_0x2c23eb[_0xd1bb('0x40')]=_[_0xd1bb('0x36')](_0x430981,'name');_0x2c23eb[_0xd1bb('0x41')]=_[_0xd1bb('0x42')](_0x4c87cc[_0xd1bb('0x41')]);_0x2c23eb[_0xd1bb('0x43')]=_['intersection'](_0x2c23eb[_0xd1bb('0x40')],_0x2c23eb[_0xd1bb('0x41')]);_0x5a65d4[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x2c23eb[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x4c87cc[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x5a65d4[_0xd1bb('0x44')]=_0x5a65d4['attributes'][_0xd1bb('0x47')]?_0x5a65d4[_0xd1bb('0x44')]:_0x2c23eb[_0xd1bb('0x40')];if(!_0x4c87cc[_0xd1bb('0x41')][_0xd1bb('0x48')]('nolimit')){_0x5a65d4[_0xd1bb('0x29')]=qs['limit'](_0x4c87cc[_0xd1bb('0x41')][_0xd1bb('0x29')]);_0x5a65d4[_0xd1bb('0x27')]=qs['offset'](_0x4c87cc['query'][_0xd1bb('0x27')]);}_0x5a65d4[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0x4c87cc[_0xd1bb('0x41')][_0xd1bb('0x4a')]);_0x5a65d4[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_['pick'](_0x4c87cc[_0xd1bb('0x41')],_0x2c23eb['filters']),_0x430981);if(_0x4c87cc['query'][_0xd1bb('0x34')]){_0x5a65d4[_0xd1bb('0x4b')]=_[_0xd1bb('0x4c')](_0x5a65d4[_0xd1bb('0x4b')],{'$or':_[_0xd1bb('0x36')](_0x430981,function(_0x5522e4){if(_0x5522e4[_0xd1bb('0x38')]!==_0xd1bb('0x4d')){var _0x2e7947={};_0x2e7947[_0x5522e4['name']]={'$like':'%'+_0x4c87cc[_0xd1bb('0x41')][_0xd1bb('0x34')]+'%'};return _0x2e7947;}})});}_0x5a65d4=_[_0xd1bb('0x4c')]({},_0x5a65d4,_0x4c87cc[_0xd1bb('0x4e')]);var _0x102966={'where':_0x5a65d4['where']};return db[_0xd1bb('0x4f')][_0xd1bb('0x2a')](_0x102966)[_0xd1bb('0x2f')](function(_0x403405){_0x323f0b[_0xd1bb('0x2a')]=_0x403405;if(_0x4c87cc['query'][_0xd1bb('0x50')]){_0x5a65d4[_0xd1bb('0x51')]=[{'all':!![]}];}return db[_0xd1bb('0x4f')][_0xd1bb('0x52')](_0x5a65d4);})[_0xd1bb('0x2f')](function(_0x57ca60){_0x323f0b[_0xd1bb('0x53')]=_0x57ca60;return _0x323f0b;})[_0xd1bb('0x2f')](respondWithFilteredResult(_0x36d334,_0x5a65d4))['catch'](handleError(_0x36d334,null));};exports['show']=function(_0x526947,_0x1be7a7){var _0x6eac27={'raw':![],'where':{'id':_0x526947[_0xd1bb('0x54')]['id']}},_0x4cc893={};_0x4cc893[_0xd1bb('0x40')]=_['keys'](db[_0xd1bb('0x4f')][_0xd1bb('0x3e')]);_0x4cc893[_0xd1bb('0x41')]=_['keys'](_0x526947['query']);_0x4cc893[_0xd1bb('0x43')]=_[_0xd1bb('0x45')](_0x4cc893[_0xd1bb('0x40')],_0x4cc893[_0xd1bb('0x41')]);_0x6eac27[_0xd1bb('0x44')]=_['intersection'](_0x4cc893[_0xd1bb('0x40')],qs['fields'](_0x526947[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x6eac27[_0xd1bb('0x44')]=_0x6eac27['attributes'][_0xd1bb('0x47')]?_0x6eac27[_0xd1bb('0x44')]:_0x4cc893[_0xd1bb('0x40')];if(_0x526947[_0xd1bb('0x41')][_0xd1bb('0x50')]){_0x6eac27['include']=[{'all':!![]}];}_0x6eac27=_['merge']({},_0x6eac27,_0x526947[_0xd1bb('0x4e')]);return db[_0xd1bb('0x4f')][_0xd1bb('0x39')](_0x6eac27)[_0xd1bb('0x2f')](handleEntityNotFound(_0x1be7a7,null))[_0xd1bb('0x2f')](respondWithResult(_0x1be7a7,null))['catch'](handleError(_0x1be7a7,null));};exports[_0xd1bb('0x55')]=function(_0x425b40,_0x2616b5){return db[_0xd1bb('0x4f')][_0xd1bb('0x55')](_0x425b40[_0xd1bb('0x56')],{})[_0xd1bb('0x2f')](function(_0xef49ef){var _0x55167f=_0x425b40[_0xd1bb('0x57')]['get']({'plain':!![]});if(!_0x55167f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55167f['role']===_0xd1bb('0x57')){var _0x1b6bb3=_0xef49ef[_0xd1bb('0x30')]({'plain':!![]});var _0x23e170=[{'name':_0xd1bb('0x58'),'value':_0xd1bb('0x31')},{'name':'QueueCampaigns','value':'outbound'}];var _0x257167=_[_0xd1bb('0x39')](_0x23e170,[_0xd1bb('0x37'),_0x1b6bb3['type']])[_0xd1bb('0x3c')];return db['UserProfileSection'][_0xd1bb('0x39')]({'where':{'name':_0x257167,'userProfileId':_0x55167f[_0xd1bb('0x59')]},'raw':!![]})[_0xd1bb('0x2f')](function(_0x524552){if(_0x524552&&_0x524552[_0xd1bb('0x5a')]===0x0){return db[_0xd1bb('0x3a')][_0xd1bb('0x55')]({'name':_0x1b6bb3['name'],'resourceId':_0x1b6bb3['id'],'type':_0x524552[_0xd1bb('0x3c')],'sectionId':_0x524552['id']},{})[_0xd1bb('0x2f')](function(){return _0xef49ef;});}else{return _0xef49ef;}})[_0xd1bb('0x5b')](function(_0x513f3f){logger[_0xd1bb('0x3b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x513f3f);throw _0x513f3f;});}return _0xef49ef;})[_0xd1bb('0x2f')](respondWithResult(_0x2616b5,0xc9))[_0xd1bb('0x5b')](handleError(_0x2616b5,null));};exports[_0xd1bb('0x5c')]=function(_0x8edb97,_0x38279e){var _0x222e91={'where':{'id':_0x8edb97[_0xd1bb('0x54')]['id']}},_0x314615={};_0x314615['model']=_[_0xd1bb('0x42')](db[_0xd1bb('0x4f')][_0xd1bb('0x3e')]);_0x222e91[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x314615[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x8edb97['query'][_0xd1bb('0x46')]));_0x222e91[_0xd1bb('0x44')]=_0x222e91[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x222e91[_0xd1bb('0x44')]:_0x314615['model'];if(_0x8edb97[_0xd1bb('0x41')]['includeAll']){_0x222e91['include']=[{'all':!![]}];}_0x222e91=_['merge']({},_0x222e91,_0x8edb97['options']);return db[_0xd1bb('0x4f')]['find'](_0x222e91)['then'](handleEntityNotFound(_0x38279e,null))[_0xd1bb('0x2f')](function(_0x5b8c94){if(_0x5b8c94){var _0x800609=_0x5b8c94[_0xd1bb('0x30')]({'plain':!![]});_0x800609=qs[_0xd1bb('0x5d')](_0x800609,['id',_0xd1bb('0x5e'),'updatedAt']);_0x8edb97[_0xd1bb('0x56')]=_['omit'](_0x8edb97['body'],['id',_0xd1bb('0x5e'),_0xd1bb('0x5f')]);return db[_0xd1bb('0x4f')][_0xd1bb('0x55')](_['merge'](_0x800609,_0x8edb97['body']),{'include':_0x8edb97[_0xd1bb('0x41')][_0xd1bb('0x50')]?[{'all':!![]}]:undefined})[_0xd1bb('0x2f')](function(_0x1e2d85){var _0x459751=_0x8edb97[_0xd1bb('0x57')][_0xd1bb('0x30')]({'plain':!![]});if(!_0x459751)throw new Error(_0xd1bb('0x60'));if(_0x459751[_0xd1bb('0x61')]===_0xd1bb('0x57')){var _0x17606d=_0x1e2d85['get']({'plain':!![]});var _0x2ff91c=[{'name':'VoiceQueues','value':_0xd1bb('0x31')},{'name':_0xd1bb('0x32'),'value':'outbound'}];var _0x438175=_['find'](_0x2ff91c,[_0xd1bb('0x37'),_0x17606d[_0xd1bb('0x38')]])['name'];return db['UserProfileSection'][_0xd1bb('0x39')]({'where':{'name':_0x438175,'userProfileId':_0x459751[_0xd1bb('0x59')]},'raw':!![]})[_0xd1bb('0x2f')](function(_0x4d5f44){if(_0x4d5f44&&_0x4d5f44[_0xd1bb('0x5a')]===0x0){return db[_0xd1bb('0x3a')][_0xd1bb('0x55')]({'name':_0x17606d[_0xd1bb('0x3c')],'resourceId':_0x17606d['id'],'type':_0x4d5f44['name'],'sectionId':_0x4d5f44['id']},{})[_0xd1bb('0x2f')](function(){return _0x1e2d85;});}else{return _0x1e2d85;}})[_0xd1bb('0x5b')](function(_0x25513a){logger[_0xd1bb('0x3b')](_0xd1bb('0x62'),_0x25513a);throw _0x25513a;});}return _0x1e2d85;});}})[_0xd1bb('0x2f')](respondWithResult(_0x38279e,0xc9))[_0xd1bb('0x5b')](handleError(_0x38279e,null));};exports[_0xd1bb('0x2d')]=function(_0x4d38e8,_0x199038){if(_0x4d38e8[_0xd1bb('0x56')]['id']){delete _0x4d38e8[_0xd1bb('0x56')]['id'];}return db[_0xd1bb('0x4f')]['find']({'where':{'id':_0x4d38e8[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x199038,null))['then'](saveUpdates(_0x4d38e8[_0xd1bb('0x56')],null))['then'](respondWithResult(_0x199038,null))[_0xd1bb('0x5b')](handleError(_0x199038,null));};exports['destroy']=function(_0x4d8bbe,_0x5a79a2){return db[_0xd1bb('0x4f')][_0xd1bb('0x39')]({'where':{'id':_0x4d8bbe[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x5a79a2,null))[_0xd1bb('0x2f')](removeEntity(_0x5a79a2,null))[_0xd1bb('0x5b')](handleError(_0x5a79a2,null));};exports[_0xd1bb('0x63')]=function(_0x1a8844,_0xc9148c,_0x38a416){var _0x5c44d1={'raw':![],'where':{}};var _0x47006e={};var _0x5168cd={'count':0x0,'rows':[]};return db[_0xd1bb('0x4f')][_0xd1bb('0x64')]({'where':{'id':_0x1a8844['params']['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0xc9148c,null))[_0xd1bb('0x2f')](function(_0x135357){if(_0x135357){_0x47006e[_0xd1bb('0x40')]=_[_0xd1bb('0x42')](db[_0xd1bb('0x65')][_0xd1bb('0x3e')]);_0x47006e[_0xd1bb('0x41')]=_[_0xd1bb('0x42')](_0x1a8844[_0xd1bb('0x41')]);_0x47006e['filters']=_[_0xd1bb('0x45')](_0x47006e[_0xd1bb('0x40')],_0x47006e[_0xd1bb('0x41')]);_0x5c44d1[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x47006e[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x1a8844['query'][_0xd1bb('0x46')]));_0x5c44d1[_0xd1bb('0x44')]=_0x5c44d1['attributes']['length']?_0x5c44d1['attributes']:_0x47006e[_0xd1bb('0x40')];if(!_0x1a8844[_0xd1bb('0x41')][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x5c44d1[_0xd1bb('0x29')]=qs[_0xd1bb('0x29')](_0x1a8844['query'][_0xd1bb('0x29')]);_0x5c44d1[_0xd1bb('0x27')]=qs[_0xd1bb('0x27')](_0x1a8844[_0xd1bb('0x41')][_0xd1bb('0x27')]);}_0x5c44d1[_0xd1bb('0x49')]=qs['sort'](_0x1a8844[_0xd1bb('0x41')]['sort']);_0x5c44d1[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x1a8844[_0xd1bb('0x41')],_0x47006e[_0xd1bb('0x43')]));_0x5c44d1[_0xd1bb('0x4b')][_0xd1bb('0x68')]=_0x135357['id'];if(_0x1a8844[_0xd1bb('0x41')][_0xd1bb('0x34')]){_0x5c44d1[_0xd1bb('0x4b')]=_[_0xd1bb('0x4c')](_0x5c44d1[_0xd1bb('0x4b')],{'$or':_['map'](_0x5c44d1['attributes'],function(_0x5c9805){var _0x3eb2d4={};_0x3eb2d4[_0x5c9805]={'$like':'%'+_0x1a8844[_0xd1bb('0x41')][_0xd1bb('0x34')]+'%'};return _0x3eb2d4;})});}_0x5c44d1=_['merge']({},_0x5c44d1,_0x1a8844[_0xd1bb('0x4e')]);return db['CmHopper'][_0xd1bb('0x2a')]({'where':_0x5c44d1[_0xd1bb('0x4b')]})[_0xd1bb('0x2f')](function(_0x193842){_0x5168cd[_0xd1bb('0x2a')]=_0x193842;if(_0x1a8844['query'][_0xd1bb('0x50')]){_0x5c44d1['include']=[{'all':!![]}];}return db['CmHopper'][_0xd1bb('0x52')](_0x5c44d1);})[_0xd1bb('0x2f')](function(_0x383df){_0x5168cd['rows']=_0x383df;return _0x5168cd;});}})['then'](respondWithFilteredResult(_0xc9148c,_0x5c44d1))[_0xd1bb('0x5b')](handleError(_0xc9148c,null));};exports[_0xd1bb('0x69')]=function(_0x341f0a,_0x5b16a,_0x445367){var _0x474782={'raw':!![],'where':{}};var _0x5193c9={};var _0x27a6eb={'count':0x0,'rows':[]};return db[_0xd1bb('0x4f')]['findOne']({'where':{'id':_0x341f0a['params']['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x5b16a,null))[_0xd1bb('0x2f')](function(_0x4d0eef){if(_0x4d0eef){_0x5193c9[_0xd1bb('0x40')]=_[_0xd1bb('0x42')](db[_0xd1bb('0x6a')][_0xd1bb('0x3e')]);_0x5193c9['query']=_['keys'](_0x341f0a[_0xd1bb('0x41')]);_0x5193c9['filters']=_['intersection'](_0x5193c9['model'],_0x5193c9[_0xd1bb('0x41')]);_0x474782[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x5193c9[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x341f0a['query']['fields']));_0x474782[_0xd1bb('0x44')]=_0x474782['attributes'][_0xd1bb('0x47')]?_0x474782['attributes']:_0x5193c9[_0xd1bb('0x40')];if(!_0x341f0a[_0xd1bb('0x41')]['hasOwnProperty'](_0xd1bb('0x66'))){_0x474782[_0xd1bb('0x29')]=qs[_0xd1bb('0x29')](_0x341f0a['query'][_0xd1bb('0x29')]);_0x474782[_0xd1bb('0x27')]=qs[_0xd1bb('0x27')](_0x341f0a[_0xd1bb('0x41')]['offset']);}_0x474782['order']=qs[_0xd1bb('0x4a')](_0x341f0a[_0xd1bb('0x41')]['sort']);_0x474782[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x341f0a[_0xd1bb('0x41')],_0x5193c9[_0xd1bb('0x43')]));_0x474782[_0xd1bb('0x4b')][_0xd1bb('0x68')]=_0x4d0eef['id'];if(_0x341f0a[_0xd1bb('0x41')][_0xd1bb('0x34')]){_0x474782['where']=_[_0xd1bb('0x4c')](_0x474782['where'],{'$or':_[_0xd1bb('0x36')](_0x474782[_0xd1bb('0x44')],function(_0x357224){var _0x33bddc={};_0x33bddc[_0x357224]={'$like':'%'+_0x341f0a[_0xd1bb('0x41')][_0xd1bb('0x34')]+'%'};return _0x33bddc;})});}_0x474782=_[_0xd1bb('0x4c')]({},_0x474782,_0x341f0a[_0xd1bb('0x4e')]);return db[_0xd1bb('0x6a')]['count']({'where':_0x474782[_0xd1bb('0x4b')]})['then'](function(_0x127d7d){_0x27a6eb[_0xd1bb('0x2a')]=_0x127d7d;if(_0x341f0a[_0xd1bb('0x41')]['includeAll']){_0x474782[_0xd1bb('0x51')]=[{'all':!![]}];}return db[_0xd1bb('0x6a')][_0xd1bb('0x52')](_0x474782);})[_0xd1bb('0x2f')](function(_0x52483b){_0x27a6eb[_0xd1bb('0x53')]=_0x52483b;return _0x27a6eb;});}})[_0xd1bb('0x2f')](respondWithFilteredResult(_0x5b16a,_0x474782))[_0xd1bb('0x5b')](handleError(_0x5b16a,null));};exports[_0xd1bb('0x6b')]=function(_0x1c1fd4,_0x2b6896,_0x430428){var _0x19f5c2={'raw':!![],'where':{}};var _0x50df82={};var _0x3484a8={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1c1fd4[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x2b6896,null))[_0xd1bb('0x2f')](function(_0x186328){if(_0x186328){_0x50df82['model']=_[_0xd1bb('0x42')](db[_0xd1bb('0x6c')][_0xd1bb('0x3e')]);_0x50df82[_0xd1bb('0x41')]=_[_0xd1bb('0x42')](_0x1c1fd4[_0xd1bb('0x41')]);_0x50df82[_0xd1bb('0x43')]=_[_0xd1bb('0x45')](_0x50df82[_0xd1bb('0x40')],_0x50df82[_0xd1bb('0x41')]);_0x19f5c2[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x50df82[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x1c1fd4[_0xd1bb('0x41')]['fields']));_0x19f5c2[_0xd1bb('0x44')]=_0x19f5c2[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x19f5c2[_0xd1bb('0x44')]:_0x50df82[_0xd1bb('0x40')];if(!_0x1c1fd4['query'][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x19f5c2[_0xd1bb('0x29')]=qs['limit'](_0x1c1fd4[_0xd1bb('0x41')][_0xd1bb('0x29')]);_0x19f5c2[_0xd1bb('0x27')]=qs[_0xd1bb('0x27')](_0x1c1fd4[_0xd1bb('0x41')][_0xd1bb('0x27')]);}_0x19f5c2['order']=qs[_0xd1bb('0x4a')](_0x1c1fd4[_0xd1bb('0x41')][_0xd1bb('0x4a')]);_0x19f5c2['where']=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x1c1fd4[_0xd1bb('0x41')],_0x50df82[_0xd1bb('0x43')]));_0x19f5c2[_0xd1bb('0x4b')][_0xd1bb('0x68')]=_0x186328['id'];if(_0x1c1fd4['query'][_0xd1bb('0x34')]){_0x19f5c2['where']=_[_0xd1bb('0x4c')](_0x19f5c2['where'],{'$or':_['map'](_0x19f5c2['attributes'],function(_0x442ff5){var _0x1b6312={};_0x1b6312[_0x442ff5]={'$like':'%'+_0x1c1fd4[_0xd1bb('0x41')]['filter']+'%'};return _0x1b6312;})});}_0x19f5c2=_[_0xd1bb('0x4c')]({},_0x19f5c2,_0x1c1fd4[_0xd1bb('0x4e')]);return db['CmHopperFinal'][_0xd1bb('0x2a')]({'where':_0x19f5c2[_0xd1bb('0x4b')]})['then'](function(_0xa3dc1e){_0x3484a8['count']=_0xa3dc1e;if(_0x1c1fd4[_0xd1bb('0x41')][_0xd1bb('0x50')]){_0x19f5c2[_0xd1bb('0x51')]=[{'all':!![]}];}return db[_0xd1bb('0x6c')][_0xd1bb('0x52')](_0x19f5c2);})[_0xd1bb('0x2f')](function(_0x378a30){_0x3484a8[_0xd1bb('0x53')]=_0x378a30;return _0x3484a8;});}})['then'](respondWithFilteredResult(_0x2b6896,_0x19f5c2))[_0xd1bb('0x5b')](handleError(_0x2b6896,null));};exports[_0xd1bb('0x6d')]=function(_0x3e729f,_0x3f7a40,_0x1f112e){var _0x13f3db={'raw':!![],'where':{}};var _0x7cb75={};var _0x3e52fc={'count':0x0,'rows':[]};return db[_0xd1bb('0x4f')][_0xd1bb('0x64')]({'where':{'id':_0x3e729f[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x3f7a40,null))[_0xd1bb('0x2f')](function(_0x3c6682){if(_0x3c6682){_0x7cb75[_0xd1bb('0x40')]=_[_0xd1bb('0x42')](db[_0xd1bb('0x6e')]['rawAttributes']);_0x7cb75['query']=_['keys'](_0x3e729f['query']);_0x7cb75[_0xd1bb('0x43')]=_[_0xd1bb('0x45')](_0x7cb75['model'],_0x7cb75[_0xd1bb('0x41')]);_0x13f3db[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x7cb75['model'],qs['fields'](_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x13f3db[_0xd1bb('0x44')]=_0x13f3db[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x13f3db['attributes']:_0x7cb75[_0xd1bb('0x40')];if(!_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x13f3db['limit']=qs['limit'](_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x29')]);_0x13f3db['offset']=qs[_0xd1bb('0x27')](_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x27')]);}_0x13f3db['order']=qs[_0xd1bb('0x4a')](_0x3e729f['query'][_0xd1bb('0x4a')]);_0x13f3db['where']=qs[_0xd1bb('0x43')](_['pick'](_0x3e729f[_0xd1bb('0x41')],_0x7cb75[_0xd1bb('0x43')]));_0x13f3db[_0xd1bb('0x4b')][_0xd1bb('0x68')]=_0x3c6682['id'];if(_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x34')]){_0x13f3db[_0xd1bb('0x4b')]=_['merge'](_0x13f3db[_0xd1bb('0x4b')],{'$or':_[_0xd1bb('0x36')](_0x13f3db['attributes'],function(_0x482fc1){var _0x17799f={};_0x17799f[_0x482fc1]={'$like':'%'+_0x3e729f[_0xd1bb('0x41')][_0xd1bb('0x34')]+'%'};return _0x17799f;})});}_0x13f3db=_[_0xd1bb('0x4c')]({},_0x13f3db,_0x3e729f[_0xd1bb('0x4e')]);return db['CmHopperBlack']['count']({'where':_0x13f3db[_0xd1bb('0x4b')]})[_0xd1bb('0x2f')](function(_0x1a0ce4){_0x3e52fc['count']=_0x1a0ce4;if(_0x3e729f['query']['includeAll']){_0x13f3db[_0xd1bb('0x51')]=[{'all':!![]}];}return db[_0xd1bb('0x6e')][_0xd1bb('0x52')](_0x13f3db);})[_0xd1bb('0x2f')](function(_0x55886f){_0x3e52fc[_0xd1bb('0x53')]=_0x55886f;return _0x3e52fc;});}})[_0xd1bb('0x2f')](respondWithFilteredResult(_0x3f7a40,_0x13f3db))[_0xd1bb('0x5b')](handleError(_0x3f7a40,null));};exports['getTeams']=function(_0x5e98f9,_0x5a336b,_0x273055){var _0x5a400f={};var _0xb4ba9e={};var _0x1c8ef7;var _0x2ec398;return db[_0xd1bb('0x4f')][_0xd1bb('0x64')]({'where':{'id':_0x5e98f9[_0xd1bb('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a336b,null))[_0xd1bb('0x2f')](function(_0x56c24d){if(_0x56c24d){_0x1c8ef7=_0x56c24d;_0xb4ba9e[_0xd1bb('0x40')]=_[_0xd1bb('0x42')](db[_0xd1bb('0x6f')][_0xd1bb('0x3e')]);_0xb4ba9e[_0xd1bb('0x41')]=_[_0xd1bb('0x42')](_0x5e98f9[_0xd1bb('0x41')]);_0xb4ba9e[_0xd1bb('0x43')]=_['intersection'](_0xb4ba9e[_0xd1bb('0x40')],_0xb4ba9e[_0xd1bb('0x41')]);_0x5a400f[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0xb4ba9e[_0xd1bb('0x40')],qs['fields'](_0x5e98f9[_0xd1bb('0x41')]['fields']));_0x5a400f['attributes']=_0x5a400f[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x5a400f[_0xd1bb('0x44')]:_0xb4ba9e[_0xd1bb('0x40')];_0x5a400f[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0x5e98f9['query'][_0xd1bb('0x4a')]);_0x5a400f[_0xd1bb('0x4b')]=qs['filters'](_[_0xd1bb('0x67')](_0x5e98f9[_0xd1bb('0x41')],_0xb4ba9e[_0xd1bb('0x43')]));if(_0x5e98f9[_0xd1bb('0x41')][_0xd1bb('0x34')]){_0x5a400f['where']=_[_0xd1bb('0x4c')](_0x5a400f['where'],{'$or':_['map'](_0x5a400f[_0xd1bb('0x44')],function(_0x2c7778){var _0x2e3840={};_0x2e3840[_0x2c7778]={'$like':'%'+_0x5e98f9[_0xd1bb('0x41')][_0xd1bb('0x34')]+'%'};return _0x2e3840;})});}_0x5a400f=_[_0xd1bb('0x4c')]({},_0x5a400f,_0x5e98f9['options']);return _0x1c8ef7[_0xd1bb('0x70')](_0x5a400f);}})[_0xd1bb('0x2f')](function(_0x1f62f0){if(_0x1f62f0){_0x2ec398=_0x1f62f0[_0xd1bb('0x47')];if(!_0x5e98f9[_0xd1bb('0x41')][_0xd1bb('0x48')]('nolimit')){_0x5a400f[_0xd1bb('0x29')]=qs[_0xd1bb('0x29')](_0x5e98f9[_0xd1bb('0x41')][_0xd1bb('0x29')]);_0x5a400f['offset']=qs[_0xd1bb('0x27')](_0x5e98f9[_0xd1bb('0x41')][_0xd1bb('0x27')]);}return _0x1c8ef7[_0xd1bb('0x70')](_0x5a400f);}})[_0xd1bb('0x2f')](function(_0x2219c8){if(_0x2219c8){return _0x2219c8?{'count':_0x2ec398,'rows':_0x2219c8}:null;}})[_0xd1bb('0x2f')](respondWithResult(_0x5a336b,null))['catch'](handleError(_0x5a336b,null));};exports['addTeams']=function(_0x6b388a,_0x4ccfde,_0x79f3b0){var _0x5e102a=_0x6b388a[_0xd1bb('0x56')][_0xd1bb('0x71')];var _0x191330=_[_0xd1bb('0x36')](_0x5e102a,'id');return db[_0xd1bb('0x6f')]['findAll']({'where':{'id':_0x191330},'attributes':['id'],'include':[{'model':db[_0xd1bb('0x72')],'as':_0xd1bb('0x73'),'attributes':['id',_0xd1bb('0x3c'),'online',_0xd1bb('0x74'),_0xd1bb('0x75')],'raw':!![]}]})['then'](function(_0x4c2a4d){if(_0x4c2a4d){var _0x4e5fae=_['flatMap'](_0x4c2a4d,function(_0xd5b20a){var _0x10586b=_0xd5b20a[_0xd1bb('0x30')]({'plain':!![]});_0x10586b['Agents'][_0xd1bb('0x76')](function(_0xb65228){_0xb65228['penalty']=_['find'](_0x5e102a,{'id':_0x10586b['id']})[_0xd1bb('0x77')];});return _0x10586b[_0xd1bb('0x73')];});return db[_0xd1bb('0x4f')][_0xd1bb('0x39')]({'where':{'id':_0x6b388a[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](function(_0x2e8c58){return db[_0xd1bb('0x78')][_0xd1bb('0x79')](function(_0x20599e){return _0x2e8c58[_0xd1bb('0x7a')](_0x191330,{'transaction':_0x20599e})[_0xd1bb('0x2f')](function(){return BPromise['each'](_0x5e102a,function(_0x917e05){return db[_0xd1bb('0x7b')][_0xd1bb('0x7c')]({'TeamId':_0x917e05['id'],'VoiceQueueId':_0x6b388a[_0xd1bb('0x54')]['id'],'penalty':_0x917e05[_0xd1bb('0x77')]},{'transaction':_0x20599e});});})[_0xd1bb('0x2f')](function(){return BPromise[_0xd1bb('0x7d')](_0x4e5fae,function(_0x546f79){return db['UserVoiceQueue'][_0xd1bb('0x7e')]({'where':{'UserId':_0x546f79['id'],'VoiceQueueId':_0x6b388a['params']['id']},'defaults':{'penalty':_0x546f79[_0xd1bb('0x77')]},'transaction':_0x20599e});});})['then'](function(){return BPromise[_0xd1bb('0x7d')](_[_0xd1bb('0x34')](_0x4e5fae,{'online':!![]}),function(_0x4f173a){return db[_0xd1bb('0x7f')][_0xd1bb('0x7c')]({'membername':_0x4f173a[_0xd1bb('0x3c')],'UserId':_0x4f173a['id'],'queue_name':_0x2e8c58[_0xd1bb('0x3c')],'VoiceQueueId':_0x2e8c58['id'],'interface':_['isNil'](_0x4f173a[_0xd1bb('0x75')])?util[_0xd1bb('0x80')](_0xd1bb('0x81'),_0x4f173a[_0xd1bb('0x3c')]):_0x4f173a[_0xd1bb('0x75')],'paused':_0x4f173a[_0xd1bb('0x74')]||![],'penalty':_0x4f173a[_0xd1bb('0x77')]},{'transaction':_0x20599e});});})[_0xd1bb('0x2f')](function(){_0x4e5fae['forEach'](function(_0x459e41){socket[_0xd1bb('0x82')](_0xd1bb('0x83'),{'UserId':_0x459e41['id'],'VoiceQueueId':_0x2e8c58['id']});});});});});}})[_0xd1bb('0x2f')](respondWithStatusCode(_0x4ccfde,null))['catch'](handleError(_0x4ccfde,null));};exports['removeTeams']=function(_0x11b579,_0x273e05,_0x5e3899){return db[_0xd1bb('0x6f')][_0xd1bb('0x52')]({'where':{'id':_0x11b579['query'][_0xd1bb('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd1bb('0x73'),'attributes':['id'],'raw':!![]}]})[_0xd1bb('0x2f')](handleEntityNotFound(_0x273e05,null))['then'](function(_0x5793f7){var _0x59d027=_[_0xd1bb('0x36')](_0x5793f7,'id');var _0x33806a=[];var _0xb9aaa2=[];var _0x5c411=squel[_0xd1bb('0x85')]();_0x5c411[_0xd1bb('0x86')](_0xd1bb('0x87'))[_0xd1bb('0x88')](_0xd1bb('0x89'),'tq')[_0xd1bb('0x8a')](_0xd1bb('0x8b'),'ut',_0xd1bb('0x8c'))[_0xd1bb('0x4b')](_0xd1bb('0x8d'),_0x11b579[_0xd1bb('0x54')]['id']);for(var _0x426b62=0x0;_0x426b62<_0x5793f7[_0xd1bb('0x47')];_0x426b62+=0x1){let _0x28f7a9=_0x5793f7[_0x426b62];for(var _0x47dad5=0x0;_0x47dad5<_0x28f7a9[_0xd1bb('0x73')]['length'];_0x47dad5+=0x1){let _0x22abf2=_0x28f7a9[_0xd1bb('0x73')][_0x47dad5];var _0x335839=_0x5c411[_0xd1bb('0x5c')]();_0x335839[_0xd1bb('0x4b')](_0xd1bb('0x8e'),_0x22abf2['id']);_0xb9aaa2[_0xd1bb('0x8f')](db[_0xd1bb('0x78')][_0xd1bb('0x41')](_0x335839[_0xd1bb('0x90')](),{'type':db[_0xd1bb('0x78')]['QueryTypes']['SELECT']})['then'](function(_0x3e51ce){if(_0x3e51ce[_0xd1bb('0x47')]===0x1){return _0x22abf2['id'];}else{var _0x4eb402=_[_0xd1bb('0x91')](_[_0xd1bb('0x36')](_0x3e51ce,'TeamId'),function(_0x4c7e01){return _['includes'](_0x59d027,_0x4c7e01);});if(_0x4eb402){return _0x22abf2['id'];}}}));}}return BPromise[_0xd1bb('0x92')](_0xb9aaa2)[_0xd1bb('0x2f')](function(_0x24c9dc){_0x33806a=_(_0x33806a)[_0xd1bb('0x93')](_0x24c9dc)[_0xd1bb('0x94')]()['value']();return db[_0xd1bb('0x4f')]['find']({'where':{'id':_0x11b579[_0xd1bb('0x54')]['id']}})['then'](function(_0x588b10){return db[_0xd1bb('0x78')][_0xd1bb('0x79')](function(_0x2dcb32){return _0x588b10['removeTeams'](_0x11b579['query']['ids'],{'transaction':_0x2dcb32})[_0xd1bb('0x2f')](function(){if(!_['isEmpty'](_0x33806a)){return _0x588b10['removeAgents'](_0x33806a,{'transaction':_0x2dcb32})['then'](function(){return db[_0xd1bb('0x7f')][_0xd1bb('0x2e')]({'where':{'VoiceQueueId':_0x11b579[_0xd1bb('0x54')]['id'],'UserId':_0x33806a},'transaction':_0x2dcb32});});}})[_0xd1bb('0x2f')](function(){_0x33806a[_0xd1bb('0x76')](function(_0x2f3c98){socket[_0xd1bb('0x82')](_0xd1bb('0x95'),{'UserId':_0x2f3c98,'VoiceQueueId':_0x588b10['id']});});});});});});})[_0xd1bb('0x2f')](respondWithStatusCode(_0x273e05,null))['catch'](handleError(_0x273e05,null));};exports[_0xd1bb('0x96')]=function(_0x128e8b,_0x2a88e3,_0x5391b7){var _0x10b20b,_0x5ec46b;return db[_0xd1bb('0x4f')][_0xd1bb('0x39')]({'where':{'id':_0x128e8b['params']['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x2a88e3,null))[_0xd1bb('0x2f')](function(_0x1e5d29){if(_0x1e5d29){_0x5ec46b=_0x1e5d29;return _0x1e5d29['addAgents'](_0x128e8b[_0xd1bb('0x56')]['ids'],_['omit'](_0x128e8b[_0xd1bb('0x56')],[_0xd1bb('0x84'),'id'])||{})['spread'](function(_0x7c0803){for(var _0x57ba03=0x0;_0x57ba03<_0x128e8b[_0xd1bb('0x56')]['ids'][_0xd1bb('0x47')];_0x57ba03+=0x1){socket[_0xd1bb('0x82')](_0xd1bb('0x83'),{'UserId':Number(_0x128e8b[_0xd1bb('0x56')][_0xd1bb('0x84')][_0x57ba03]),'VoiceQueueId':Number(_0x128e8b['params']['id'])});}return _0x7c0803;});}})[_0xd1bb('0x2f')](function(_0x3af4a2){_0x10b20b=_0x3af4a2||[];if(_0x5ec46b){return db[_0xd1bb('0x72')][_0xd1bb('0x52')]({'where':{'id':_0x128e8b[_0xd1bb('0x56')][_0xd1bb('0x84')]},'attributes':['id',_0xd1bb('0x3c'),'online','voicePause',_0xd1bb('0x75')],'raw':!![]});}})[_0xd1bb('0x2f')](function(_0x429bdd){if(!_[_0xd1bb('0x97')](_0x429bdd)){var _0x4930f1=[];for(var _0x2f89d2=0x0;_0x2f89d2<_0x429bdd[_0xd1bb('0x47')];_0x2f89d2++){if(_0x429bdd[_0x2f89d2][_0xd1bb('0x98')]){_0x4930f1[_0xd1bb('0x8f')](db[_0xd1bb('0x7f')][_0xd1bb('0x7c')]({'membername':_0x429bdd[_0x2f89d2][_0xd1bb('0x3c')],'UserId':_0x429bdd[_0x2f89d2]['id'],'queue_name':_0x5ec46b[_0xd1bb('0x3c')],'VoiceQueueId':_0x5ec46b['id'],'interface':_[_0xd1bb('0x99')](_0x429bdd[_0x2f89d2][_0xd1bb('0x75')])?util[_0xd1bb('0x80')](_0xd1bb('0x81'),_0x429bdd[_0x2f89d2][_0xd1bb('0x3c')]):_0x429bdd[_0x2f89d2][_0xd1bb('0x75')],'paused':_0x429bdd[_0x2f89d2]['voicePause']||![],'penalty':_0x128e8b[_0xd1bb('0x56')][_0xd1bb('0x77')]||0x0}));}}return BPromise['all'](_0x4930f1);}})[_0xd1bb('0x2f')](function(){return _0x10b20b;})['then'](respondWithResult(_0x2a88e3,null))[_0xd1bb('0x5b')](handleError(_0x2a88e3,null));};exports['removeAgents']=function(_0x3b16de,_0x2e9e04,_0x28c555){return db['VoiceQueue'][_0xd1bb('0x39')]({'where':{'id':_0x3b16de[_0xd1bb('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e9e04,null))[_0xd1bb('0x2f')](function(_0x44e2ff){if(_0x44e2ff){return _0x44e2ff['removeAgents'](_0x3b16de[_0xd1bb('0x41')][_0xd1bb('0x84')])[_0xd1bb('0x2f')](function(){if(_[_0xd1bb('0x9a')](_0x3b16de['query'][_0xd1bb('0x84')])){for(var _0x5d07d2=0x0;_0x5d07d2<_0x3b16de[_0xd1bb('0x41')]['ids']['length'];_0x5d07d2+=0x1){socket[_0xd1bb('0x82')](_0xd1bb('0x95'),{'UserId':Number(_0x3b16de[_0xd1bb('0x41')]['ids'][_0x5d07d2]),'VoiceQueueId':Number(_0x3b16de[_0xd1bb('0x54')]['id'])});}}else{socket[_0xd1bb('0x82')](_0xd1bb('0x95'),{'UserId':Number(_0x3b16de[_0xd1bb('0x41')][_0xd1bb('0x84')]),'VoiceQueueId':Number(_0x3b16de[_0xd1bb('0x54')]['id'])});}});}})[_0xd1bb('0x2f')](function(_0x1688f3){return db[_0xd1bb('0x7f')][_0xd1bb('0x2e')]({'where':{'VoiceQueueId':_0x3b16de[_0xd1bb('0x54')]['id'],'UserId':_0x3b16de['query'][_0xd1bb('0x84')]}})[_0xd1bb('0x2f')](function(){return _0x1688f3;});})['then'](respondWithStatusCode(_0x2e9e04,null))[_0xd1bb('0x5b')](handleError(_0x2e9e04,null));};exports[_0xd1bb('0x9b')]=function(_0x1e4e75,_0x5d8c09,_0x2df42){var _0x2946b3={};var _0x20b910={};var _0x3bae0a;var _0x481387;return db[_0xd1bb('0x4f')]['findOne']({'where':{'id':_0x1e4e75['params']['id']}})['then'](handleEntityNotFound(_0x5d8c09,null))[_0xd1bb('0x2f')](function(_0x430407){if(_0x430407){_0x3bae0a=_0x430407;_0x20b910[_0xd1bb('0x40')]=_['keys'](db[_0xd1bb('0x72')]['rawAttributes']);_0x20b910[_0xd1bb('0x41')]=_[_0xd1bb('0x42')](_0x1e4e75[_0xd1bb('0x41')]);_0x20b910['filters']=_['intersection'](_0x20b910['model'],_0x20b910['query']);_0x2946b3['attributes']=_[_0xd1bb('0x45')](_0x20b910[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x1e4e75[_0xd1bb('0x41')]['fields']));_0x2946b3[_0xd1bb('0x44')]=_0x2946b3[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x2946b3['attributes']:_0x20b910['model'];_0x2946b3[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0x1e4e75['query'][_0xd1bb('0x4a')]);_0x2946b3[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x1e4e75[_0xd1bb('0x41')],_0x20b910[_0xd1bb('0x43')]));if(_0x1e4e75[_0xd1bb('0x41')]['filter']){_0x2946b3['where']=_[_0xd1bb('0x4c')](_0x2946b3['where'],{'$or':_[_0xd1bb('0x36')](_0x2946b3[_0xd1bb('0x44')],function(_0x5bbdcc){var _0x5d8505={};_0x5d8505[_0x5bbdcc]={'$like':'%'+_0x1e4e75['query'][_0xd1bb('0x34')]+'%'};return _0x5d8505;})});}_0x2946b3=_['merge']({},_0x2946b3,_0x1e4e75[_0xd1bb('0x4e')]);return _0x3bae0a['getAgents'](_0x2946b3);}})[_0xd1bb('0x2f')](function(_0x432086){if(_0x432086){_0x481387=_0x432086[_0xd1bb('0x47')];if(!_0x1e4e75[_0xd1bb('0x41')]['hasOwnProperty'](_0xd1bb('0x66'))){_0x2946b3['limit']=qs[_0xd1bb('0x29')](_0x1e4e75[_0xd1bb('0x41')]['limit']);_0x2946b3[_0xd1bb('0x27')]=qs['offset'](_0x1e4e75[_0xd1bb('0x41')][_0xd1bb('0x27')]);}return _0x3bae0a[_0xd1bb('0x9b')](_0x2946b3);}})[_0xd1bb('0x2f')](function(_0x50b846){if(_0x50b846){return _0x50b846?{'count':_0x481387,'rows':_0x50b846}:null;}})[_0xd1bb('0x2f')](respondWithResult(_0x5d8c09,null))[_0xd1bb('0x5b')](handleError(_0x5d8c09,null));};exports['getMembers']=function(_0xf086d2,_0x3bc01f,_0x58a51d){var _0x4d3727={};var _0x3645b7={};var _0x5ee783;var _0x3ede62;return db['VoiceQueue']['findOne']({'where':{'id':_0xf086d2['params']['id']}})['then'](handleEntityNotFound(_0x3bc01f,null))[_0xd1bb('0x2f')](function(_0x5935fd){if(_0x5935fd){_0x5ee783=_0x5935fd;_0x3645b7['model']=_['keys'](db[_0xd1bb('0x7f')][_0xd1bb('0x3e')]);_0x3645b7['query']=_['keys'](_0xf086d2[_0xd1bb('0x41')]);_0x3645b7[_0xd1bb('0x43')]=_[_0xd1bb('0x45')](_0x3645b7[_0xd1bb('0x40')],_0x3645b7[_0xd1bb('0x41')]);_0x4d3727[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x3645b7[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0xf086d2[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x4d3727[_0xd1bb('0x44')]=_0x4d3727['attributes']['length']?_0x4d3727[_0xd1bb('0x44')]:_0x3645b7[_0xd1bb('0x40')];_0x4d3727[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0xf086d2['query'][_0xd1bb('0x4a')]);_0x4d3727[_0xd1bb('0x4b')]=qs['filters'](_['pick'](_0xf086d2['query'],_0x3645b7['filters']));if(_0xf086d2['query']['filter']){_0x4d3727[_0xd1bb('0x4b')]=_[_0xd1bb('0x4c')](_0x4d3727[_0xd1bb('0x4b')],{'$or':_[_0xd1bb('0x36')](_0x4d3727[_0xd1bb('0x44')],function(_0x4a7f2d){var _0x5b545c={};_0x5b545c[_0x4a7f2d]={'$like':'%'+_0xf086d2['query'][_0xd1bb('0x34')]+'%'};return _0x5b545c;})});}_0x4d3727=_['merge']({},_0x4d3727,_0xf086d2[_0xd1bb('0x4e')]);return _0x5ee783[_0xd1bb('0x9c')](_0x4d3727);}})['then'](function(_0x5eef2e){if(_0x5eef2e){_0x3ede62=_0x5eef2e['length'];if(!_0xf086d2[_0xd1bb('0x41')][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x4d3727[_0xd1bb('0x29')]=qs[_0xd1bb('0x29')](_0xf086d2[_0xd1bb('0x41')][_0xd1bb('0x29')]);_0x4d3727[_0xd1bb('0x27')]=qs[_0xd1bb('0x27')](_0xf086d2[_0xd1bb('0x41')][_0xd1bb('0x27')]);}return _0x5ee783[_0xd1bb('0x9c')](_0x4d3727);}})[_0xd1bb('0x2f')](function(_0x59d1eb){return _0x59d1eb?{'count':_0x3ede62,'rows':_0x59d1eb}:null;})[_0xd1bb('0x2f')](respondWithResult(_0x3bc01f,null))[_0xd1bb('0x5b')](handleError(_0x3bc01f,null));};exports[_0xd1bb('0x9d')]=function(_0x95e8b0,_0xea4dc2,_0x5259f5){var _0x368c67={};var _0x5d3bb5={};var _0x220e0a;var _0x8cab54;return db[_0xd1bb('0x4f')][_0xd1bb('0x64')]({'where':{'id':_0x95e8b0[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0xea4dc2,null))[_0xd1bb('0x2f')](function(_0x4b27bc){if(_0x4b27bc){_0x220e0a=_0x4b27bc;_0x5d3bb5[_0xd1bb('0x40')]=_['keys'](db['CmList'][_0xd1bb('0x3e')]);_0x5d3bb5[_0xd1bb('0x41')]=_['keys'](_0x95e8b0[_0xd1bb('0x41')]);_0x5d3bb5['filters']=_[_0xd1bb('0x45')](_0x5d3bb5[_0xd1bb('0x40')],_0x5d3bb5[_0xd1bb('0x41')]);_0x368c67[_0xd1bb('0x44')]=_[_0xd1bb('0x45')](_0x5d3bb5[_0xd1bb('0x40')],qs[_0xd1bb('0x46')](_0x95e8b0[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x368c67['attributes']=_0x368c67[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x368c67[_0xd1bb('0x44')]:_0x5d3bb5['model'];_0x368c67[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0x95e8b0['query'][_0xd1bb('0x4a')]);_0x368c67[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x95e8b0[_0xd1bb('0x41')],_0x5d3bb5[_0xd1bb('0x43')]));if(_0x95e8b0['query'][_0xd1bb('0x34')]){_0x368c67['where']=_['merge'](_0x368c67['where'],{'$or':_['map'](_0x368c67[_0xd1bb('0x44')],function(_0x432e03){var _0x5c17a9={};_0x5c17a9[_0x432e03]={'$like':'%'+_0x95e8b0['query'][_0xd1bb('0x34')]+'%'};return _0x5c17a9;})});}_0x368c67=_[_0xd1bb('0x4c')]({},_0x368c67,_0x95e8b0[_0xd1bb('0x4e')]);return _0x220e0a[_0xd1bb('0x9d')](_0x368c67);}})['then'](function(_0x56b34a){if(_0x56b34a){_0x8cab54=_0x56b34a[_0xd1bb('0x47')];if(!_0x95e8b0[_0xd1bb('0x41')][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x368c67['limit']=qs[_0xd1bb('0x29')](_0x95e8b0[_0xd1bb('0x41')]['limit']);_0x368c67[_0xd1bb('0x27')]=qs['offset'](_0x95e8b0[_0xd1bb('0x41')][_0xd1bb('0x27')]);}return _0x220e0a[_0xd1bb('0x9d')](_0x368c67);}})[_0xd1bb('0x2f')](function(_0x4d26fd){if(_0x4d26fd){return _0x4d26fd?{'count':_0x8cab54,'rows':_0x4d26fd}:null;}})[_0xd1bb('0x2f')](respondWithResult(_0xea4dc2,null))[_0xd1bb('0x5b')](handleError(_0xea4dc2,null));};exports[_0xd1bb('0x9e')]=function(_0x4a1926,_0x5ed777,_0x13abe3){var _0x34874d,_0x4386ff;return db[_0xd1bb('0x4f')]['find']({'where':{'id':_0x4a1926['params']['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x5ed777,null))['then'](function(_0xdfa6e6){if(_0xdfa6e6){_0x4386ff=_0xdfa6e6;return _0xdfa6e6[_0xd1bb('0x9e')](_0x4a1926[_0xd1bb('0x56')][_0xd1bb('0x84')],_[_0xd1bb('0x5d')](_0x4a1926['body'],[_0xd1bb('0x84'),'id'])||{});}return null;})[_0xd1bb('0x9f')](function(_0x25c8e0){var _0x406598;_0x34874d=_0x25c8e0||[];var _0x5a256b=[];if(_0x25c8e0){for(var _0x26aa4e=0x0;_0x26aa4e<_0x25c8e0[_0xd1bb('0x47')];_0x26aa4e+=0x1){var _0x43da1a=_0x25c8e0[_0x26aa4e][_0xd1bb('0x30')]({'plain':!![]});_0x4386ff[_0xd1bb('0xa0')]=_0x4a1926[_0xd1bb('0x56')]['dialCheckDuplicateType']?_0x4a1926[_0xd1bb('0x56')][_0xd1bb('0xa0')]:_0x4386ff[_0xd1bb('0xa0')];switch(_0x4386ff[_0xd1bb('0xa0')]){case _0xd1bb('0xa1'):_0x406598=squel['insert']()[_0xd1bb('0xa2')](_0xd1bb('0xa3'))['fromQuery']([_0xd1bb('0xa4'),_0xd1bb('0xa5'),_0xd1bb('0xa6'),_0xd1bb('0xa7'),_0xd1bb('0x68'),_0xd1bb('0x5e'),_0xd1bb('0x5f')],squel['select']()[_0xd1bb('0x86')](_0xd1bb('0xa4'),_0xd1bb('0xa4'))[_0xd1bb('0x86')](_0xd1bb('0xa8'),_0xd1bb('0xa5'))[_0xd1bb('0x86')]('id','ContactId')['field'](_0x43da1a[_0xd1bb('0xa9')][_0xd1bb('0x90')](),_0xd1bb('0xa7'))[_0xd1bb('0x86')](_0x4a1926[_0xd1bb('0x54')]['id'][_0xd1bb('0x90')](),_0xd1bb('0x68'))[_0xd1bb('0x86')]('NOW()',_0xd1bb('0x5e'))['field'](_0xd1bb('0xa8'),'updatedAt')[_0xd1bb('0x88')]('cm_contacts')['where'](_0xd1bb('0xaa'))[_0xd1bb('0x4b')](_0xd1bb('0xab'),_0x43da1a[_0xd1bb('0xa9')][_0xd1bb('0x90')]())[_0xd1bb('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xd1bb('0x4b')](_0xd1bb('0xac'),squel[_0xd1bb('0x85')]()[_0xd1bb('0x86')](_0xd1bb('0xad'))[_0xd1bb('0x88')](_0xd1bb('0xae'))[_0xd1bb('0x4b')]('VoiceQueueId\x20=\x20?',_0x4a1926[_0xd1bb('0x54')]['id'][_0xd1bb('0x90')]()))['where'](_0xd1bb('0xac'),squel[_0xd1bb('0x85')]()[_0xd1bb('0x86')]('COALESCE(phone,\x27\x27)')[_0xd1bb('0x88')]('cm_hopper')[_0xd1bb('0x4b')](_0xd1bb('0x8d'),_0x4a1926[_0xd1bb('0x54')]['id'][_0xd1bb('0x90')]())))[_0xd1bb('0x90')]();break;case _0xd1bb('0xaf'):_0x406598=squel['insert']()[_0xd1bb('0xa2')](_0xd1bb('0xa3'))[_0xd1bb('0xb0')]([_0xd1bb('0xa4'),_0xd1bb('0xa5'),'ContactId','ListId','VoiceQueueId',_0xd1bb('0x5e'),_0xd1bb('0x5f')],squel['select']()['field'](_0xd1bb('0xa4'),'phone')[_0xd1bb('0x86')](_0xd1bb('0xa8'),_0xd1bb('0xa5'))['field']('id','ContactId')['field'](_0x43da1a['CmListId'][_0xd1bb('0x90')](),_0xd1bb('0xa7'))['field'](_0x4a1926[_0xd1bb('0x54')]['id'][_0xd1bb('0x90')](),_0xd1bb('0x68'))[_0xd1bb('0x86')](_0xd1bb('0xa8'),_0xd1bb('0x5e'))[_0xd1bb('0x86')](_0xd1bb('0xa8'),_0xd1bb('0x5f'))[_0xd1bb('0x88')]('cm_contacts')[_0xd1bb('0x4b')](_0xd1bb('0xaa'))['where'](_0xd1bb('0xab'),_0x43da1a[_0xd1bb('0xa9')][_0xd1bb('0x90')]())[_0xd1bb('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xd1bb('0x4b')](_0xd1bb('0xac'),squel['select']()[_0xd1bb('0x86')](_0xd1bb('0xb1'))['from']('cm_hopper')[_0xd1bb('0x4b')]('VoiceQueueId\x20=\x20?',_0x4a1926['params']['id']['toString']())))[_0xd1bb('0x90')]();break;default:_0x406598=squel['insert']()[_0xd1bb('0xa2')](_0xd1bb('0xa3'))[_0xd1bb('0xb0')]([_0xd1bb('0xa4'),_0xd1bb('0xa5'),_0xd1bb('0xa6'),_0xd1bb('0xa7'),'VoiceQueueId',_0xd1bb('0x5e'),_0xd1bb('0x5f')],squel[_0xd1bb('0x85')]()[_0xd1bb('0x86')]('phone',_0xd1bb('0xa4'))['field'](_0xd1bb('0xa8'),'scheduledAt')['field']('id',_0xd1bb('0xa6'))[_0xd1bb('0x86')](_0x43da1a['CmListId'][_0xd1bb('0x90')](),_0xd1bb('0xa7'))[_0xd1bb('0x86')](_0x4a1926[_0xd1bb('0x54')]['id'][_0xd1bb('0x90')](),_0xd1bb('0x68'))[_0xd1bb('0x86')](_0xd1bb('0xa8'),'createdAt')[_0xd1bb('0x86')]('NOW()',_0xd1bb('0x5f'))[_0xd1bb('0x88')](_0xd1bb('0xb2'))[_0xd1bb('0x4b')](_0xd1bb('0xaa'))[_0xd1bb('0x4b')]('ListId\x20=\x20?',_0x43da1a[_0xd1bb('0xa9')][_0xd1bb('0x90')]())[_0xd1bb('0x4b')](_0xd1bb('0xb3')))[_0xd1bb('0x90')]();}_0x5a256b[_0xd1bb('0x8f')](db[_0xd1bb('0x78')][_0xd1bb('0x41')](_0x406598));}return BPromise[_0xd1bb('0x92')](_0x5a256b);}})[_0xd1bb('0x2f')](function(){return _0x34874d;})[_0xd1bb('0x2f')](respondWithResult(_0x5ed777,null))[_0xd1bb('0x5b')](handleError(_0x5ed777,null));};exports[_0xd1bb('0xb4')]=function(_0x3d5149,_0x22827d,_0x35da7f){return db['VoiceQueue']['find']({'where':{'id':_0x3d5149[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x22827d,null))[_0xd1bb('0x2f')](function(_0x10b765){if(_0x10b765){return _0x10b765[_0xd1bb('0xb4')](_0x3d5149[_0xd1bb('0x41')]['ids']);}})[_0xd1bb('0x2f')](function(_0x582d0c){if(_0x582d0c){return db[_0xd1bb('0x65')][_0xd1bb('0x2e')]({'where':{'ListId':_0x3d5149['query'][_0xd1bb('0x84')],'VoiceQueueId':_0x3d5149['params']['id']}})['then'](function(){return _0x582d0c;});}})[_0xd1bb('0x2f')](respondWithStatusCode(_0x22827d,null))['catch'](handleError(_0x22827d,null));};exports[_0xd1bb('0xb5')]=function(_0x156b61,_0x349ca2,_0x23251c){var _0x230c94={};var _0x3926d2={};var _0x2122bc;var _0x458fa3;return db['VoiceQueue'][_0xd1bb('0x64')]({'where':{'id':_0x156b61[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x349ca2,null))[_0xd1bb('0x2f')](function(_0x4ac8c9){if(_0x4ac8c9){_0x2122bc=_0x4ac8c9;_0x3926d2[_0xd1bb('0x40')]=_[_0xd1bb('0x42')](db[_0xd1bb('0xb6')]['rawAttributes']);_0x3926d2['query']=_[_0xd1bb('0x42')](_0x156b61[_0xd1bb('0x41')]);_0x3926d2[_0xd1bb('0x43')]=_['intersection'](_0x3926d2[_0xd1bb('0x40')],_0x3926d2[_0xd1bb('0x41')]);_0x230c94['attributes']=_['intersection'](_0x3926d2[_0xd1bb('0x40')],qs['fields'](_0x156b61[_0xd1bb('0x41')][_0xd1bb('0x46')]));_0x230c94[_0xd1bb('0x44')]=_0x230c94[_0xd1bb('0x44')][_0xd1bb('0x47')]?_0x230c94[_0xd1bb('0x44')]:_0x3926d2['model'];_0x230c94[_0xd1bb('0x49')]=qs[_0xd1bb('0x4a')](_0x156b61[_0xd1bb('0x41')][_0xd1bb('0x4a')]);_0x230c94[_0xd1bb('0x4b')]=qs[_0xd1bb('0x43')](_[_0xd1bb('0x67')](_0x156b61['query'],_0x3926d2[_0xd1bb('0x43')]));if(_0x156b61[_0xd1bb('0x41')][_0xd1bb('0x34')]){_0x230c94['where']=_[_0xd1bb('0x4c')](_0x230c94[_0xd1bb('0x4b')],{'$or':_['map'](_0x230c94['attributes'],function(_0x30739f){var _0x35643f={};_0x35643f[_0x30739f]={'$like':'%'+_0x156b61[_0xd1bb('0x41')]['filter']+'%'};return _0x35643f;})});}_0x230c94=_[_0xd1bb('0x4c')]({},_0x230c94,_0x156b61[_0xd1bb('0x4e')]);return _0x2122bc[_0xd1bb('0xb5')](_0x230c94);}})['then'](function(_0x5bc596){if(_0x5bc596){_0x458fa3=_0x5bc596['length'];if(!_0x156b61[_0xd1bb('0x41')][_0xd1bb('0x48')](_0xd1bb('0x66'))){_0x230c94[_0xd1bb('0x29')]=qs[_0xd1bb('0x29')](_0x156b61[_0xd1bb('0x41')]['limit']);_0x230c94[_0xd1bb('0x27')]=qs[_0xd1bb('0x27')](_0x156b61['query']['offset']);}return _0x2122bc[_0xd1bb('0xb5')](_0x230c94);}})[_0xd1bb('0x2f')](function(_0x1d8869){if(_0x1d8869){return _0x1d8869?{'count':_0x458fa3,'rows':_0x1d8869}:null;}})[_0xd1bb('0x2f')](respondWithResult(_0x349ca2,null))['catch'](handleError(_0x349ca2,null));};exports['addBlackLists']=function(_0x58d6eb,_0x5e8686,_0x60989c){var _0x4e9abd,_0x540da1;return db[_0xd1bb('0x4f')][_0xd1bb('0x39')]({'where':{'id':_0x58d6eb[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x5e8686,null))[_0xd1bb('0x2f')](function(_0xd20d59){if(_0xd20d59){_0x540da1=_0xd20d59;return _0xd20d59[_0xd1bb('0xb7')](_0x58d6eb['body']['ids'],_[_0xd1bb('0x5d')](_0x58d6eb['body'],[_0xd1bb('0x84'),'id'])||{});}return null;})['spread'](function(_0x469320){var _0x1868cf;_0x4e9abd=_0x469320||[];var _0x3c10cc=[];if(_0x469320){for(var _0x45bea1=0x0;_0x45bea1<_0x469320[_0xd1bb('0x47')];_0x45bea1+=0x1){var _0x1997bb=_0x469320[_0x45bea1][_0xd1bb('0x30')]({'plain':!![]});_0x1868cf=squel[_0xd1bb('0xb8')]()[_0xd1bb('0xa2')](_0xd1bb('0xb9'))[_0xd1bb('0xb0')]([_0xd1bb('0xa4'),_0xd1bb('0xa6'),_0xd1bb('0xa7'),_0xd1bb('0x68'),'createdAt',_0xd1bb('0x5f')],squel[_0xd1bb('0x85')]()[_0xd1bb('0x86')](_0xd1bb('0xa4'),'phone')[_0xd1bb('0x86')]('id',_0xd1bb('0xa6'))[_0xd1bb('0x86')](_0x1997bb[_0xd1bb('0xa9')]['toString'](),'ListId')[_0xd1bb('0x86')](_0x58d6eb['params']['id'][_0xd1bb('0x90')](),_0xd1bb('0x68'))[_0xd1bb('0x86')]('NOW()',_0xd1bb('0x5e'))[_0xd1bb('0x86')]('NOW()',_0xd1bb('0x5f'))['from'](_0xd1bb('0xb2'))[_0xd1bb('0x4b')](_0xd1bb('0xaa'))[_0xd1bb('0x4b')](_0xd1bb('0xab'),_0x1997bb['CmListId'][_0xd1bb('0x90')]())[_0xd1bb('0x4b')](_0xd1bb('0xb3')))[_0xd1bb('0x90')]();_0x3c10cc['push'](db[_0xd1bb('0x78')]['query'](_0x1868cf));}return BPromise[_0xd1bb('0x92')](_0x3c10cc);}})[_0xd1bb('0x2f')](function(){return _0x4e9abd;})[_0xd1bb('0x2f')](respondWithResult(_0x5e8686,null))[_0xd1bb('0x5b')](handleError(_0x5e8686,null));};exports[_0xd1bb('0xba')]=function(_0x17ac4d,_0x1719fd,_0x294226){return db[_0xd1bb('0x4f')]['find']({'where':{'id':_0x17ac4d[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](handleEntityNotFound(_0x1719fd,null))['then'](function(_0x2c7f25){if(_0x2c7f25){return _0x2c7f25[_0xd1bb('0xba')](_0x17ac4d['query'][_0xd1bb('0x84')]);}})[_0xd1bb('0x2f')](function(_0x4c3a91){if(_0x4c3a91){return db['CmHopperBlack'][_0xd1bb('0x2e')]({'where':{'ListId':_0x17ac4d[_0xd1bb('0x41')]['ids'],'VoiceQueueId':_0x17ac4d[_0xd1bb('0x54')]['id']}})[_0xd1bb('0x2f')](function(){return _0x4c3a91;});}})['then'](respondWithStatusCode(_0x1719fd,null))['catch'](handleError(_0x1719fd,null));}; \ No newline at end of file +var _0x38bb=['index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','VoiceQueue','includeAll','include','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','findOne','CmHopper','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','toString','QueryTypes','includes','all','union','ids','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','push','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','fromQuery','phone','ContactId','ListId','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','scheduledAt','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','end','stack','send'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x38bb,0x131));var _0xb38b=function(_0x380974,_0x2e3728){_0x380974=_0x380974-0x0;var _0x3b6974=_0x38bb[_0x380974];return _0x3b6974;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb38b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb38b('0x1'));var moment=require('moment');var BPromise=require(_0xb38b('0x2'));var Mustache=require('mustache');var util=require(_0xb38b('0x3'));var path=require(_0xb38b('0x4'));var sox=require(_0xb38b('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb38b('0x6'));var _=require(_0xb38b('0x7'));var squel=require('squel');var crypto=require(_0xb38b('0x8'));var jsforce=require(_0xb38b('0x9'));var deskjs=require(_0xb38b('0xa'));var toCsv=require(_0xb38b('0xb'));var querystring=require(_0xb38b('0xc'));var Papa=require(_0xb38b('0xd'));var Redis=require('ioredis');var authService=require(_0xb38b('0xe'));var qs=require(_0xb38b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb38b('0x10'));var logger=require(_0xb38b('0x11'))(_0xb38b('0x12'));var utils=require(_0xb38b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb38b('0x14'));var db=require(_0xb38b('0x15'))['db'];config['redis']=_[_0xb38b('0x16')](config[_0xb38b('0x17')],{'host':_0xb38b('0x18'),'port':0x18eb});var socket=require(_0xb38b('0x19'))(new Redis(config['redis']));require(_0xb38b('0x1a'))['register'](socket);function respondWithStatusCode(_0x35a97a,_0x3899f9){_0x3899f9=_0x3899f9||0xcc;return function(_0x34d95a){if(_0x34d95a){return _0x35a97a[_0xb38b('0x1b')](_0x3899f9);}return _0x35a97a[_0xb38b('0x1c')](_0x3899f9)['end']();};}function respondWithResult(_0x242ff8,_0x1f2a43){_0x1f2a43=_0x1f2a43||0xc8;return function(_0x42ecd2){if(_0x42ecd2){return _0x242ff8[_0xb38b('0x1c')](_0x1f2a43)[_0xb38b('0x1d')](_0x42ecd2);}};}function respondWithFilteredResult(_0x2645da,_0x251df0){return function(_0x14fd5f){if(_0x14fd5f){var _0x9d8c4c=typeof _0x251df0[_0xb38b('0x1e')]===_0xb38b('0x1f')&&typeof _0x251df0[_0xb38b('0x20')]===_0xb38b('0x1f');var _0x1fb5fe=_0x14fd5f[_0xb38b('0x21')];var _0x3bc16c=_0x9d8c4c?0x0:_0x251df0[_0xb38b('0x1e')];var _0x35d219=_0x9d8c4c?_0x14fd5f[_0xb38b('0x21')]:_0x251df0['offset']+_0x251df0[_0xb38b('0x20')];var _0x1f182e;if(_0x35d219>=_0x1fb5fe){_0x35d219=_0x1fb5fe;_0x1f182e=0xc8;}else{_0x1f182e=0xce;}_0x2645da[_0xb38b('0x1c')](_0x1f182e);return _0x2645da[_0xb38b('0x22')](_0xb38b('0x23'),_0x3bc16c+'-'+_0x35d219+'/'+_0x1fb5fe)[_0xb38b('0x1d')](_0x14fd5f);}return null;};}function patchUpdates(_0x1fbe91){return function(_0x7e1136){try{jsonpatch[_0xb38b('0x24')](_0x7e1136,_0x1fbe91,!![]);}catch(_0x512d6d){return BPromise['reject'](_0x512d6d);}return _0x7e1136[_0xb38b('0x25')]();};}function saveUpdates(_0x4ddfc5,_0x59fa4f){return function(_0x4e2bd8){if(_0x4e2bd8){return _0x4e2bd8[_0xb38b('0x26')](_0x4ddfc5)[_0xb38b('0x27')](function(_0x4c27f2){return _0x4c27f2;});}return null;};}function removeEntity(_0x3d6235,_0x436cb9){return function(_0x45ec96){if(_0x45ec96){return _0x45ec96[_0xb38b('0x28')]()['then'](function(){var _0xae1918=_0x45ec96[_0xb38b('0x29')]({'plain':!![]});var _0x1af1b8=[{'name':_0xb38b('0x2a'),'value':_0xb38b('0x2b'),'ignore':![]},{'name':_0xb38b('0x2c'),'value':_0xb38b('0x2d'),'ignore':![]}];var _0x242edd=_(_0x1af1b8)[_0xb38b('0x2e')](_0xb38b('0x2f'))[_0xb38b('0x30')](_0xb38b('0x31'))[_0xb38b('0x31')]();if(_['includes'](_0x242edd,_0xae1918[_0xb38b('0x32')])){return;}var _0x1b1f97=_[_0xb38b('0x33')](_0x1af1b8,[_0xb38b('0x31'),_0xae1918[_0xb38b('0x32')]])[_0xb38b('0x34')];return db[_0xb38b('0x35')][_0xb38b('0x28')]({'where':{'type':_0x1b1f97,'resourceId':_0xae1918['id']}})[_0xb38b('0x27')](function(){return _0x45ec96;});})[_0xb38b('0x27')](function(){_0x3d6235[_0xb38b('0x1c')](0xcc)[_0xb38b('0x36')]();});}};}function handleEntityNotFound(_0x31f58a,_0x3c2c5e){return function(_0x413e47){if(!_0x413e47){_0x31f58a[_0xb38b('0x1b')](0x194);}return _0x413e47;};}function handleError(_0x5b4a4a,_0x22b60d){_0x22b60d=_0x22b60d||0x1f4;return function(_0x211ced){logger['error'](_0x211ced[_0xb38b('0x37')]);if(_0x211ced[_0xb38b('0x34')]){delete _0x211ced['name'];}_0x5b4a4a[_0xb38b('0x1c')](_0x22b60d)[_0xb38b('0x38')](_0x211ced);};}exports[_0xb38b('0x39')]=function(_0x3f9201,_0x39319f){var _0x19199d={},_0x10d772={},_0xddd65b={'count':0x0,'rows':[]};var _0x4114c8=_[_0xb38b('0x30')](db['VoiceQueue'][_0xb38b('0x3a')],function(_0x22565f){return{'name':_0x22565f[_0xb38b('0x3b')],'type':_0x22565f[_0xb38b('0x32')][_0xb38b('0x3c')]};});_0x10d772[_0xb38b('0x3d')]=_[_0xb38b('0x30')](_0x4114c8,'name');_0x10d772[_0xb38b('0x3e')]=_[_0xb38b('0x3f')](_0x3f9201[_0xb38b('0x3e')]);_0x10d772['filters']=_[_0xb38b('0x40')](_0x10d772[_0xb38b('0x3d')],_0x10d772['query']);_0x19199d[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x10d772[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x3f9201['query'][_0xb38b('0x42')]));_0x19199d[_0xb38b('0x41')]=_0x19199d[_0xb38b('0x41')][_0xb38b('0x43')]?_0x19199d[_0xb38b('0x41')]:_0x10d772[_0xb38b('0x3d')];if(!_0x3f9201[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x19199d[_0xb38b('0x20')]=qs[_0xb38b('0x20')](_0x3f9201[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x19199d[_0xb38b('0x1e')]=qs['offset'](_0x3f9201[_0xb38b('0x3e')][_0xb38b('0x1e')]);}_0x19199d['order']=qs['sort'](_0x3f9201[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x19199d[_0xb38b('0x47')]=qs['filters'](_[_0xb38b('0x48')](_0x3f9201['query'],_0x10d772[_0xb38b('0x49')]),_0x4114c8);if(_0x3f9201['query']['filter']){_0x19199d[_0xb38b('0x47')]=_[_0xb38b('0x4a')](_0x19199d[_0xb38b('0x47')],{'$or':_[_0xb38b('0x30')](_0x4114c8,function(_0x5ed8d7){if(_0x5ed8d7[_0xb38b('0x32')]!==_0xb38b('0x4b')){var _0x242872={};_0x242872[_0x5ed8d7['name']]={'$like':'%'+_0x3f9201[_0xb38b('0x3e')][_0xb38b('0x2e')]+'%'};return _0x242872;}})});}_0x19199d=_[_0xb38b('0x4a')]({},_0x19199d,_0x3f9201['options']);var _0x298eff={'where':_0x19199d[_0xb38b('0x47')]};return db[_0xb38b('0x4c')][_0xb38b('0x21')](_0x298eff)['then'](function(_0x12ce72){_0xddd65b[_0xb38b('0x21')]=_0x12ce72;if(_0x3f9201['query'][_0xb38b('0x4d')]){_0x19199d[_0xb38b('0x4e')]=[{'all':!![]}];}return db[_0xb38b('0x4c')]['findAll'](_0x19199d);})[_0xb38b('0x27')](function(_0x496826){_0xddd65b['rows']=_0x496826;return _0xddd65b;})['then'](respondWithFilteredResult(_0x39319f,_0x19199d))[_0xb38b('0x4f')](handleError(_0x39319f,null));};exports[_0xb38b('0x50')]=function(_0x43e15c,_0x15c3fd){var _0x3ea4cf={'raw':![],'where':{'id':_0x43e15c[_0xb38b('0x51')]['id']}},_0x2c8c09={};_0x2c8c09[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x4c')][_0xb38b('0x3a')]);_0x2c8c09['query']=_['keys'](_0x43e15c['query']);_0x2c8c09[_0xb38b('0x49')]=_[_0xb38b('0x40')](_0x2c8c09['model'],_0x2c8c09[_0xb38b('0x3e')]);_0x3ea4cf['attributes']=_[_0xb38b('0x40')](_0x2c8c09[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x43e15c['query'][_0xb38b('0x42')]));_0x3ea4cf[_0xb38b('0x41')]=_0x3ea4cf[_0xb38b('0x41')][_0xb38b('0x43')]?_0x3ea4cf[_0xb38b('0x41')]:_0x2c8c09[_0xb38b('0x3d')];if(_0x43e15c[_0xb38b('0x3e')][_0xb38b('0x4d')]){_0x3ea4cf[_0xb38b('0x4e')]=[{'all':!![]}];}_0x3ea4cf=_[_0xb38b('0x4a')]({},_0x3ea4cf,_0x43e15c[_0xb38b('0x52')]);return db['VoiceQueue'][_0xb38b('0x33')](_0x3ea4cf)[_0xb38b('0x27')](handleEntityNotFound(_0x15c3fd,null))['then'](respondWithResult(_0x15c3fd,null))[_0xb38b('0x4f')](handleError(_0x15c3fd,null));};exports[_0xb38b('0x53')]=function(_0x56df1c,_0x53d97e){return db[_0xb38b('0x4c')]['create'](_0x56df1c[_0xb38b('0x54')],{})[_0xb38b('0x27')](function(_0x160a58){var _0x58a909=_0x56df1c[_0xb38b('0x55')][_0xb38b('0x29')]({'plain':!![]});if(!_0x58a909)throw new Error(_0xb38b('0x56'));if(_0x58a909['role']==='user'){var _0x4d462f=_0x160a58[_0xb38b('0x29')]({'plain':!![]});var _0x6af24f=[{'name':'VoiceQueues','value':_0xb38b('0x2b')},{'name':_0xb38b('0x2c'),'value':_0xb38b('0x2d')}];var _0x51c1c3=_[_0xb38b('0x33')](_0x6af24f,[_0xb38b('0x31'),_0x4d462f[_0xb38b('0x32')]])[_0xb38b('0x34')];return db[_0xb38b('0x57')][_0xb38b('0x33')]({'where':{'name':_0x51c1c3,'userProfileId':_0x58a909[_0xb38b('0x58')]},'raw':!![]})[_0xb38b('0x27')](function(_0x5d88b1){if(_0x5d88b1&&_0x5d88b1['autoAssociation']===0x0){return db[_0xb38b('0x35')][_0xb38b('0x53')]({'name':_0x4d462f[_0xb38b('0x34')],'resourceId':_0x4d462f['id'],'type':_0x5d88b1['name'],'sectionId':_0x5d88b1['id']},{})[_0xb38b('0x27')](function(){return _0x160a58;});}else{return _0x160a58;}})[_0xb38b('0x4f')](function(_0xb5486d){logger[_0xb38b('0x59')](_0xb38b('0x5a'),_0xb5486d);throw _0xb5486d;});}return _0x160a58;})[_0xb38b('0x27')](respondWithResult(_0x53d97e,0xc9))[_0xb38b('0x4f')](handleError(_0x53d97e,null));};exports[_0xb38b('0x5b')]=function(_0xcf92bb,_0x39a651){var _0x2b0842={'where':{'id':_0xcf92bb[_0xb38b('0x51')]['id']}},_0x158265={};_0x158265[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x4c')][_0xb38b('0x3a')]);_0x2b0842[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x158265[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0xcf92bb[_0xb38b('0x3e')]['fields']));_0x2b0842['attributes']=_0x2b0842[_0xb38b('0x41')]['length']?_0x2b0842[_0xb38b('0x41')]:_0x158265[_0xb38b('0x3d')];if(_0xcf92bb[_0xb38b('0x3e')][_0xb38b('0x4d')]){_0x2b0842[_0xb38b('0x4e')]=[{'all':!![]}];}_0x2b0842=_[_0xb38b('0x4a')]({},_0x2b0842,_0xcf92bb[_0xb38b('0x52')]);return db[_0xb38b('0x4c')]['find'](_0x2b0842)[_0xb38b('0x27')](handleEntityNotFound(_0x39a651,null))[_0xb38b('0x27')](function(_0x32b56a){if(_0x32b56a){var _0x3f8676=_0x32b56a[_0xb38b('0x29')]({'plain':!![]});_0x3f8676=qs['omit'](_0x3f8676,['id','createdAt',_0xb38b('0x5c')]);_0xcf92bb['body']=_[_0xb38b('0x5d')](_0xcf92bb[_0xb38b('0x54')],['id',_0xb38b('0x5e'),_0xb38b('0x5c')]);return db['VoiceQueue']['create'](_[_0xb38b('0x4a')](_0x3f8676,_0xcf92bb[_0xb38b('0x54')]),{'include':_0xcf92bb[_0xb38b('0x3e')][_0xb38b('0x4d')]?[{'all':!![]}]:undefined})[_0xb38b('0x27')](function(_0x45d040){var _0x2fbbe4=_0xcf92bb['user'][_0xb38b('0x29')]({'plain':!![]});if(!_0x2fbbe4)throw new Error(_0xb38b('0x56'));if(_0x2fbbe4['role']===_0xb38b('0x55')){var _0xd1aa2a=_0x45d040[_0xb38b('0x29')]({'plain':!![]});var _0x3bb84c=[{'name':_0xb38b('0x2a'),'value':_0xb38b('0x2b')},{'name':_0xb38b('0x2c'),'value':_0xb38b('0x2d')}];var _0xbc781b=_[_0xb38b('0x33')](_0x3bb84c,['value',_0xd1aa2a[_0xb38b('0x32')]])['name'];return db[_0xb38b('0x57')][_0xb38b('0x33')]({'where':{'name':_0xbc781b,'userProfileId':_0x2fbbe4[_0xb38b('0x58')]},'raw':!![]})[_0xb38b('0x27')](function(_0x4b00bd){if(_0x4b00bd&&_0x4b00bd['autoAssociation']===0x0){return db[_0xb38b('0x35')][_0xb38b('0x53')]({'name':_0xd1aa2a['name'],'resourceId':_0xd1aa2a['id'],'type':_0x4b00bd[_0xb38b('0x34')],'sectionId':_0x4b00bd['id']},{})['then'](function(){return _0x45d040;});}else{return _0x45d040;}})['catch'](function(_0x38d949){logger[_0xb38b('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38d949);throw _0x38d949;});}return _0x45d040;});}})[_0xb38b('0x27')](respondWithResult(_0x39a651,0xc9))['catch'](handleError(_0x39a651,null));};exports[_0xb38b('0x26')]=function(_0x4a4df3,_0x44c121){if(_0x4a4df3['body']['id']){delete _0x4a4df3[_0xb38b('0x54')]['id'];}return db[_0xb38b('0x4c')][_0xb38b('0x33')]({'where':{'id':_0x4a4df3[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x44c121,null))[_0xb38b('0x27')](saveUpdates(_0x4a4df3[_0xb38b('0x54')],null))[_0xb38b('0x27')](respondWithResult(_0x44c121,null))[_0xb38b('0x4f')](handleError(_0x44c121,null));};exports[_0xb38b('0x28')]=function(_0xaa95d5,_0x444ad1){return db[_0xb38b('0x4c')]['find']({'where':{'id':_0xaa95d5['params']['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x444ad1,null))['then'](removeEntity(_0x444ad1,null))[_0xb38b('0x4f')](handleError(_0x444ad1,null));};exports['getHoppers']=function(_0x31b49a,_0x1729b5,_0x5be07d){var _0x3542fa={'raw':![],'where':{}};var _0xfea894={};var _0x522f52={'count':0x0,'rows':[]};return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x31b49a[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x1729b5,null))[_0xb38b('0x27')](function(_0x1c382b){if(_0x1c382b){_0xfea894[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x60')][_0xb38b('0x3a')]);_0xfea894[_0xb38b('0x3e')]=_[_0xb38b('0x3f')](_0x31b49a[_0xb38b('0x3e')]);_0xfea894[_0xb38b('0x49')]=_['intersection'](_0xfea894[_0xb38b('0x3d')],_0xfea894[_0xb38b('0x3e')]);_0x3542fa['attributes']=_[_0xb38b('0x40')](_0xfea894['model'],qs[_0xb38b('0x42')](_0x31b49a[_0xb38b('0x3e')][_0xb38b('0x42')]));_0x3542fa[_0xb38b('0x41')]=_0x3542fa['attributes'][_0xb38b('0x43')]?_0x3542fa[_0xb38b('0x41')]:_0xfea894[_0xb38b('0x3d')];if(!_0x31b49a[_0xb38b('0x3e')]['hasOwnProperty'](_0xb38b('0x45'))){_0x3542fa['limit']=qs[_0xb38b('0x20')](_0x31b49a[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x3542fa[_0xb38b('0x1e')]=qs[_0xb38b('0x1e')](_0x31b49a['query'][_0xb38b('0x1e')]);}_0x3542fa['order']=qs[_0xb38b('0x46')](_0x31b49a[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x3542fa[_0xb38b('0x47')]=qs['filters'](_['pick'](_0x31b49a[_0xb38b('0x3e')],_0xfea894[_0xb38b('0x49')]));_0x3542fa[_0xb38b('0x47')][_0xb38b('0x61')]=_0x1c382b['id'];if(_0x31b49a['query'][_0xb38b('0x2e')]){_0x3542fa[_0xb38b('0x47')]=_[_0xb38b('0x4a')](_0x3542fa[_0xb38b('0x47')],{'$or':_[_0xb38b('0x30')](_0x3542fa[_0xb38b('0x41')],function(_0x194951){var _0x2289bd={};_0x2289bd[_0x194951]={'$like':'%'+_0x31b49a['query'][_0xb38b('0x2e')]+'%'};return _0x2289bd;})});}_0x3542fa=_[_0xb38b('0x4a')]({},_0x3542fa,_0x31b49a[_0xb38b('0x52')]);return db[_0xb38b('0x60')][_0xb38b('0x21')]({'where':_0x3542fa['where']})[_0xb38b('0x27')](function(_0x372718){_0x522f52[_0xb38b('0x21')]=_0x372718;if(_0x31b49a[_0xb38b('0x3e')]['includeAll']){_0x3542fa[_0xb38b('0x4e')]=[{'all':!![]}];}return db[_0xb38b('0x60')][_0xb38b('0x62')](_0x3542fa);})[_0xb38b('0x27')](function(_0x393e4f){_0x522f52[_0xb38b('0x63')]=_0x393e4f;return _0x522f52;});}})[_0xb38b('0x27')](respondWithFilteredResult(_0x1729b5,_0x3542fa))[_0xb38b('0x4f')](handleError(_0x1729b5,null));};exports[_0xb38b('0x64')]=function(_0x5e3d48,_0x1448c6,_0x423a03){var _0x57a102={'raw':!![],'where':{}};var _0xd223c4={};var _0x14febe={'count':0x0,'rows':[]};return db[_0xb38b('0x4c')]['findOne']({'where':{'id':_0x5e3d48[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x1448c6,null))['then'](function(_0x69b1b4){if(_0x69b1b4){_0xd223c4[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x65')][_0xb38b('0x3a')]);_0xd223c4['query']=_['keys'](_0x5e3d48[_0xb38b('0x3e')]);_0xd223c4[_0xb38b('0x49')]=_['intersection'](_0xd223c4['model'],_0xd223c4[_0xb38b('0x3e')]);_0x57a102[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0xd223c4[_0xb38b('0x3d')],qs['fields'](_0x5e3d48[_0xb38b('0x3e')]['fields']));_0x57a102[_0xb38b('0x41')]=_0x57a102[_0xb38b('0x41')]['length']?_0x57a102[_0xb38b('0x41')]:_0xd223c4[_0xb38b('0x3d')];if(!_0x5e3d48[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x57a102[_0xb38b('0x20')]=qs[_0xb38b('0x20')](_0x5e3d48[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x57a102['offset']=qs['offset'](_0x5e3d48[_0xb38b('0x3e')][_0xb38b('0x1e')]);}_0x57a102['order']=qs[_0xb38b('0x46')](_0x5e3d48[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x57a102[_0xb38b('0x47')]=qs[_0xb38b('0x49')](_['pick'](_0x5e3d48[_0xb38b('0x3e')],_0xd223c4[_0xb38b('0x49')]));_0x57a102[_0xb38b('0x47')][_0xb38b('0x61')]=_0x69b1b4['id'];if(_0x5e3d48['query']['filter']){_0x57a102['where']=_[_0xb38b('0x4a')](_0x57a102[_0xb38b('0x47')],{'$or':_[_0xb38b('0x30')](_0x57a102[_0xb38b('0x41')],function(_0x2a0e28){var _0x3b0670={};_0x3b0670[_0x2a0e28]={'$like':'%'+_0x5e3d48[_0xb38b('0x3e')][_0xb38b('0x2e')]+'%'};return _0x3b0670;})});}_0x57a102=_[_0xb38b('0x4a')]({},_0x57a102,_0x5e3d48['options']);return db['CmHopperHistory']['count']({'where':_0x57a102[_0xb38b('0x47')]})[_0xb38b('0x27')](function(_0x44fb83){_0x14febe[_0xb38b('0x21')]=_0x44fb83;if(_0x5e3d48[_0xb38b('0x3e')]['includeAll']){_0x57a102[_0xb38b('0x4e')]=[{'all':!![]}];}return db[_0xb38b('0x65')][_0xb38b('0x62')](_0x57a102);})[_0xb38b('0x27')](function(_0x36781a){_0x14febe[_0xb38b('0x63')]=_0x36781a;return _0x14febe;});}})[_0xb38b('0x27')](respondWithFilteredResult(_0x1448c6,_0x57a102))[_0xb38b('0x4f')](handleError(_0x1448c6,null));};exports[_0xb38b('0x66')]=function(_0x5a2031,_0x56572d,_0x4fba51){var _0x8749f4={'raw':!![],'where':{}};var _0x1eeb68={};var _0xc3b60b={'count':0x0,'rows':[]};return db[_0xb38b('0x4c')]['findOne']({'where':{'id':_0x5a2031[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x56572d,null))['then'](function(_0x199af7){if(_0x199af7){_0x1eeb68[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x67')][_0xb38b('0x3a')]);_0x1eeb68[_0xb38b('0x3e')]=_['keys'](_0x5a2031[_0xb38b('0x3e')]);_0x1eeb68[_0xb38b('0x49')]=_[_0xb38b('0x40')](_0x1eeb68['model'],_0x1eeb68['query']);_0x8749f4[_0xb38b('0x41')]=_['intersection'](_0x1eeb68[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x5a2031[_0xb38b('0x3e')][_0xb38b('0x42')]));_0x8749f4['attributes']=_0x8749f4[_0xb38b('0x41')][_0xb38b('0x43')]?_0x8749f4[_0xb38b('0x41')]:_0x1eeb68[_0xb38b('0x3d')];if(!_0x5a2031[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x8749f4[_0xb38b('0x20')]=qs[_0xb38b('0x20')](_0x5a2031[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x8749f4[_0xb38b('0x1e')]=qs[_0xb38b('0x1e')](_0x5a2031[_0xb38b('0x3e')]['offset']);}_0x8749f4[_0xb38b('0x68')]=qs[_0xb38b('0x46')](_0x5a2031[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x8749f4[_0xb38b('0x47')]=qs[_0xb38b('0x49')](_[_0xb38b('0x48')](_0x5a2031[_0xb38b('0x3e')],_0x1eeb68[_0xb38b('0x49')]));_0x8749f4['where'][_0xb38b('0x61')]=_0x199af7['id'];if(_0x5a2031[_0xb38b('0x3e')]['filter']){_0x8749f4[_0xb38b('0x47')]=_[_0xb38b('0x4a')](_0x8749f4[_0xb38b('0x47')],{'$or':_['map'](_0x8749f4['attributes'],function(_0x1c54ff){var _0x3444a6={};_0x3444a6[_0x1c54ff]={'$like':'%'+_0x5a2031['query']['filter']+'%'};return _0x3444a6;})});}_0x8749f4=_[_0xb38b('0x4a')]({},_0x8749f4,_0x5a2031[_0xb38b('0x52')]);return db[_0xb38b('0x67')][_0xb38b('0x21')]({'where':_0x8749f4[_0xb38b('0x47')]})['then'](function(_0x53e94f){_0xc3b60b['count']=_0x53e94f;if(_0x5a2031[_0xb38b('0x3e')][_0xb38b('0x4d')]){_0x8749f4['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xb38b('0x62')](_0x8749f4);})[_0xb38b('0x27')](function(_0x569bf6){_0xc3b60b['rows']=_0x569bf6;return _0xc3b60b;});}})[_0xb38b('0x27')](respondWithFilteredResult(_0x56572d,_0x8749f4))[_0xb38b('0x4f')](handleError(_0x56572d,null));};exports[_0xb38b('0x69')]=function(_0x5a0c3d,_0x3d7fd6,_0x1b4d92){var _0x41a05b={'raw':!![],'where':{}};var _0x38ef0f={};var _0x3cb1d7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb38b('0x5f')]({'where':{'id':_0x5a0c3d['params']['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x3d7fd6,null))[_0xb38b('0x27')](function(_0x641db1){if(_0x641db1){_0x38ef0f['model']=_[_0xb38b('0x3f')](db[_0xb38b('0x6a')]['rawAttributes']);_0x38ef0f[_0xb38b('0x3e')]=_['keys'](_0x5a0c3d[_0xb38b('0x3e')]);_0x38ef0f[_0xb38b('0x49')]=_[_0xb38b('0x40')](_0x38ef0f[_0xb38b('0x3d')],_0x38ef0f[_0xb38b('0x3e')]);_0x41a05b[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x38ef0f['model'],qs['fields'](_0x5a0c3d['query'][_0xb38b('0x42')]));_0x41a05b['attributes']=_0x41a05b[_0xb38b('0x41')][_0xb38b('0x43')]?_0x41a05b[_0xb38b('0x41')]:_0x38ef0f[_0xb38b('0x3d')];if(!_0x5a0c3d['query'][_0xb38b('0x44')](_0xb38b('0x45'))){_0x41a05b[_0xb38b('0x20')]=qs['limit'](_0x5a0c3d[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x41a05b['offset']=qs[_0xb38b('0x1e')](_0x5a0c3d[_0xb38b('0x3e')]['offset']);}_0x41a05b['order']=qs[_0xb38b('0x46')](_0x5a0c3d[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x41a05b[_0xb38b('0x47')]=qs['filters'](_['pick'](_0x5a0c3d[_0xb38b('0x3e')],_0x38ef0f[_0xb38b('0x49')]));_0x41a05b[_0xb38b('0x47')][_0xb38b('0x61')]=_0x641db1['id'];if(_0x5a0c3d[_0xb38b('0x3e')][_0xb38b('0x2e')]){_0x41a05b[_0xb38b('0x47')]=_[_0xb38b('0x4a')](_0x41a05b['where'],{'$or':_['map'](_0x41a05b[_0xb38b('0x41')],function(_0x2640f5){var _0x1696f4={};_0x1696f4[_0x2640f5]={'$like':'%'+_0x5a0c3d[_0xb38b('0x3e')][_0xb38b('0x2e')]+'%'};return _0x1696f4;})});}_0x41a05b=_[_0xb38b('0x4a')]({},_0x41a05b,_0x5a0c3d[_0xb38b('0x52')]);return db[_0xb38b('0x6a')][_0xb38b('0x21')]({'where':_0x41a05b['where']})['then'](function(_0x4b3730){_0x3cb1d7[_0xb38b('0x21')]=_0x4b3730;if(_0x5a0c3d[_0xb38b('0x3e')]['includeAll']){_0x41a05b[_0xb38b('0x4e')]=[{'all':!![]}];}return db[_0xb38b('0x6a')][_0xb38b('0x62')](_0x41a05b);})[_0xb38b('0x27')](function(_0x48b9fd){_0x3cb1d7[_0xb38b('0x63')]=_0x48b9fd;return _0x3cb1d7;});}})[_0xb38b('0x27')](respondWithFilteredResult(_0x3d7fd6,_0x41a05b))[_0xb38b('0x4f')](handleError(_0x3d7fd6,null));};exports[_0xb38b('0x6b')]=function(_0x4cb058,_0x22ad98,_0x1a9313){var _0x14f1dd={};var _0x1f2256={};var _0x2f64b3;var _0x52c3d5;return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x4cb058[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x22ad98,null))['then'](function(_0x3c18e4){if(_0x3c18e4){_0x2f64b3=_0x3c18e4;_0x1f2256[_0xb38b('0x3d')]=_[_0xb38b('0x3f')](db[_0xb38b('0x6c')][_0xb38b('0x3a')]);_0x1f2256['query']=_[_0xb38b('0x3f')](_0x4cb058[_0xb38b('0x3e')]);_0x1f2256[_0xb38b('0x49')]=_['intersection'](_0x1f2256[_0xb38b('0x3d')],_0x1f2256[_0xb38b('0x3e')]);_0x14f1dd[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x1f2256[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x4cb058[_0xb38b('0x3e')][_0xb38b('0x42')]));_0x14f1dd[_0xb38b('0x41')]=_0x14f1dd[_0xb38b('0x41')]['length']?_0x14f1dd['attributes']:_0x1f2256['model'];_0x14f1dd['order']=qs[_0xb38b('0x46')](_0x4cb058[_0xb38b('0x3e')]['sort']);_0x14f1dd[_0xb38b('0x47')]=qs[_0xb38b('0x49')](_[_0xb38b('0x48')](_0x4cb058['query'],_0x1f2256[_0xb38b('0x49')]));if(_0x4cb058[_0xb38b('0x3e')]['filter']){_0x14f1dd[_0xb38b('0x47')]=_['merge'](_0x14f1dd[_0xb38b('0x47')],{'$or':_[_0xb38b('0x30')](_0x14f1dd[_0xb38b('0x41')],function(_0xa34980){var _0x3bfa35={};_0x3bfa35[_0xa34980]={'$like':'%'+_0x4cb058['query'][_0xb38b('0x2e')]+'%'};return _0x3bfa35;})});}_0x14f1dd=_[_0xb38b('0x4a')]({},_0x14f1dd,_0x4cb058[_0xb38b('0x52')]);return _0x2f64b3[_0xb38b('0x6b')](_0x14f1dd);}})['then'](function(_0x77478f){if(_0x77478f){_0x52c3d5=_0x77478f[_0xb38b('0x43')];if(!_0x4cb058[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x14f1dd['limit']=qs[_0xb38b('0x20')](_0x4cb058[_0xb38b('0x3e')]['limit']);_0x14f1dd['offset']=qs[_0xb38b('0x1e')](_0x4cb058[_0xb38b('0x3e')][_0xb38b('0x1e')]);}return _0x2f64b3[_0xb38b('0x6b')](_0x14f1dd);}})[_0xb38b('0x27')](function(_0x26bf85){if(_0x26bf85){return _0x26bf85?{'count':_0x52c3d5,'rows':_0x26bf85}:null;}})['then'](respondWithResult(_0x22ad98,null))[_0xb38b('0x4f')](handleError(_0x22ad98,null));};exports[_0xb38b('0x6d')]=function(_0x26e066,_0x2dfcc3,_0x47fce8){var _0x469e12=_0x26e066['body'][_0xb38b('0x6e')];var _0x5ec708=_[_0xb38b('0x30')](_0x469e12,'id');return db[_0xb38b('0x6c')][_0xb38b('0x62')]({'where':{'id':_0x5ec708},'attributes':['id'],'include':[{'model':db[_0xb38b('0x6f')],'as':_0xb38b('0x70'),'attributes':['id','name',_0xb38b('0x71'),_0xb38b('0x72'),'interface'],'raw':!![]}]})[_0xb38b('0x27')](function(_0x2990a2){if(_0x2990a2){var _0x1a4a47=_[_0xb38b('0x73')](_0x2990a2,function(_0xbbb0ac){var _0x479763=_0xbbb0ac[_0xb38b('0x29')]({'plain':!![]});_0x479763[_0xb38b('0x70')][_0xb38b('0x74')](function(_0x8487e0){_0x8487e0[_0xb38b('0x75')]=_['find'](_0x469e12,{'id':_0x479763['id']})[_0xb38b('0x75')];});return _0x479763[_0xb38b('0x70')];});return db[_0xb38b('0x4c')][_0xb38b('0x33')]({'where':{'id':_0x26e066[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](function(_0x32977b){return db[_0xb38b('0x76')][_0xb38b('0x77')](function(_0x28c1d2){return _0x32977b[_0xb38b('0x6d')](_0x5ec708,{'transaction':_0x28c1d2})[_0xb38b('0x27')](function(){return BPromise[_0xb38b('0x78')](_0x469e12,function(_0x23de0f){return db[_0xb38b('0x79')][_0xb38b('0x7a')]({'TeamId':_0x23de0f['id'],'VoiceQueueId':_0x26e066[_0xb38b('0x51')]['id'],'penalty':_0x23de0f[_0xb38b('0x75')]},{'transaction':_0x28c1d2});});})[_0xb38b('0x27')](function(){return BPromise[_0xb38b('0x78')](_0x1a4a47,function(_0x357168){return db['UserVoiceQueue'][_0xb38b('0x7b')]({'where':{'UserId':_0x357168['id'],'VoiceQueueId':_0x26e066[_0xb38b('0x51')]['id']},'defaults':{'penalty':_0x357168[_0xb38b('0x75')]},'transaction':_0x28c1d2});});})[_0xb38b('0x27')](function(){return BPromise['each'](_[_0xb38b('0x2e')](_0x1a4a47,{'online':!![]}),function(_0x13854a){return db['UserVoiceQueueRt'][_0xb38b('0x7a')]({'membername':_0x13854a[_0xb38b('0x34')],'UserId':_0x13854a['id'],'queue_name':_0x32977b[_0xb38b('0x34')],'VoiceQueueId':_0x32977b['id'],'interface':_[_0xb38b('0x7c')](_0x13854a[_0xb38b('0x7d')])?util[_0xb38b('0x7e')](_0xb38b('0x7f'),_0x13854a[_0xb38b('0x34')]):_0x13854a[_0xb38b('0x7d')],'paused':_0x13854a[_0xb38b('0x72')]||![],'penalty':_0x13854a['penalty']},{'transaction':_0x28c1d2});});})[_0xb38b('0x27')](function(){_0x1a4a47[_0xb38b('0x74')](function(_0x42f147){socket[_0xb38b('0x80')](_0xb38b('0x81'),{'UserId':_0x42f147['id'],'VoiceQueueId':_0x32977b['id']});});});});});}})[_0xb38b('0x27')](respondWithStatusCode(_0x2dfcc3,null))[_0xb38b('0x4f')](handleError(_0x2dfcc3,null));};exports['removeTeams']=function(_0x2fdf15,_0x44f3dc,_0x640eaa){return db['Team']['findAll']({'where':{'id':_0x2fdf15[_0xb38b('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb38b('0x6f')],'as':_0xb38b('0x70'),'attributes':['id'],'raw':!![]}]})[_0xb38b('0x27')](handleEntityNotFound(_0x44f3dc,null))[_0xb38b('0x27')](function(_0x5a6882){var _0xd47a99=_[_0xb38b('0x30')](_0x5a6882,'id');var _0xdb8925=[];var _0x4cff65=[];var _0x2c8a1a=squel[_0xb38b('0x82')]();_0x2c8a1a['field'](_0xb38b('0x83'))[_0xb38b('0x84')]('team_has_voice_queues','tq')[_0xb38b('0x85')](_0xb38b('0x86'),'ut',_0xb38b('0x87'))['where'](_0xb38b('0x88'),_0x2fdf15[_0xb38b('0x51')]['id']);for(var _0x5ecc2f=0x0;_0x5ecc2f<_0x5a6882['length'];_0x5ecc2f+=0x1){let _0x2bf164=_0x5a6882[_0x5ecc2f];for(var _0x500cfd=0x0;_0x500cfd<_0x2bf164[_0xb38b('0x70')][_0xb38b('0x43')];_0x500cfd+=0x1){let _0x7bea3e=_0x2bf164['Agents'][_0x500cfd];var _0x2bd30d=_0x2c8a1a[_0xb38b('0x5b')]();_0x2bd30d[_0xb38b('0x47')]('ut.UserId\x20=\x20?',_0x7bea3e['id']);_0x4cff65['push'](db[_0xb38b('0x76')][_0xb38b('0x3e')](_0x2bd30d[_0xb38b('0x89')](),{'type':db['sequelize'][_0xb38b('0x8a')]['SELECT']})[_0xb38b('0x27')](function(_0x44ce83){if(_0x44ce83[_0xb38b('0x43')]===0x1){return _0x7bea3e['id'];}else{var _0x11a622=_['every'](_[_0xb38b('0x30')](_0x44ce83,'TeamId'),function(_0x27796f){return _[_0xb38b('0x8b')](_0xd47a99,_0x27796f);});if(_0x11a622){return _0x7bea3e['id'];}}}));}}return BPromise[_0xb38b('0x8c')](_0x4cff65)[_0xb38b('0x27')](function(_0x2fdc74){_0xdb8925=_(_0xdb8925)[_0xb38b('0x8d')](_0x2fdc74)['compact']()[_0xb38b('0x31')]();return db[_0xb38b('0x4c')][_0xb38b('0x33')]({'where':{'id':_0x2fdf15[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](function(_0x3d8382){return db[_0xb38b('0x76')][_0xb38b('0x77')](function(_0x16fa8a){return _0x3d8382['removeTeams'](_0x2fdf15[_0xb38b('0x3e')][_0xb38b('0x8e')],{'transaction':_0x16fa8a})['then'](function(){if(!_[_0xb38b('0x8f')](_0xdb8925)){return _0x3d8382['removeAgents'](_0xdb8925,{'transaction':_0x16fa8a})[_0xb38b('0x27')](function(){return db[_0xb38b('0x90')][_0xb38b('0x28')]({'where':{'VoiceQueueId':_0x2fdf15['params']['id'],'UserId':_0xdb8925},'transaction':_0x16fa8a});});}})[_0xb38b('0x27')](function(){_0xdb8925[_0xb38b('0x74')](function(_0x3f5db1){socket[_0xb38b('0x80')](_0xb38b('0x91'),{'UserId':_0x3f5db1,'VoiceQueueId':_0x3d8382['id']});});});});});});})[_0xb38b('0x27')](respondWithStatusCode(_0x44f3dc,null))[_0xb38b('0x4f')](handleError(_0x44f3dc,null));};exports[_0xb38b('0x92')]=function(_0x164c42,_0x5d57f9,_0x26cbc3){var _0x331faa,_0x515f67;return db['VoiceQueue'][_0xb38b('0x33')]({'where':{'id':_0x164c42[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5d57f9,null))['then'](function(_0xfb6c45){if(_0xfb6c45){_0x515f67=_0xfb6c45;return _0xfb6c45[_0xb38b('0x92')](_0x164c42[_0xb38b('0x54')][_0xb38b('0x8e')],_['omit'](_0x164c42[_0xb38b('0x54')],[_0xb38b('0x8e'),'id'])||{})[_0xb38b('0x93')](function(_0x4c05b7){for(var _0x34de75=0x0;_0x34de75<_0x164c42[_0xb38b('0x54')][_0xb38b('0x8e')][_0xb38b('0x43')];_0x34de75+=0x1){socket[_0xb38b('0x80')](_0xb38b('0x81'),{'UserId':Number(_0x164c42[_0xb38b('0x54')]['ids'][_0x34de75]),'VoiceQueueId':Number(_0x164c42['params']['id'])});}return _0x4c05b7;});}})[_0xb38b('0x27')](function(_0x4bbffb){_0x331faa=_0x4bbffb||[];if(_0x515f67){return db[_0xb38b('0x6f')]['findAll']({'where':{'id':_0x164c42[_0xb38b('0x54')][_0xb38b('0x8e')]},'attributes':['id',_0xb38b('0x34'),_0xb38b('0x71'),_0xb38b('0x72'),_0xb38b('0x7d')],'raw':!![]});}})[_0xb38b('0x27')](function(_0x52a80f){if(!_[_0xb38b('0x8f')](_0x52a80f)){var _0x5b341a=[];for(var _0x5b3c92=0x0;_0x5b3c92<_0x52a80f[_0xb38b('0x43')];_0x5b3c92++){if(_0x52a80f[_0x5b3c92][_0xb38b('0x71')]){_0x5b341a[_0xb38b('0x94')](db['UserVoiceQueueRt'][_0xb38b('0x7a')]({'membername':_0x52a80f[_0x5b3c92]['name'],'UserId':_0x52a80f[_0x5b3c92]['id'],'queue_name':_0x515f67[_0xb38b('0x34')],'VoiceQueueId':_0x515f67['id'],'interface':_[_0xb38b('0x7c')](_0x52a80f[_0x5b3c92][_0xb38b('0x7d')])?util[_0xb38b('0x7e')](_0xb38b('0x7f'),_0x52a80f[_0x5b3c92][_0xb38b('0x34')]):_0x52a80f[_0x5b3c92]['interface'],'paused':_0x52a80f[_0x5b3c92][_0xb38b('0x72')]||![],'penalty':_0x164c42[_0xb38b('0x54')]['penalty']||0x0}));}}return BPromise[_0xb38b('0x8c')](_0x5b341a);}})['then'](function(){return _0x331faa;})[_0xb38b('0x27')](respondWithResult(_0x5d57f9,null))['catch'](handleError(_0x5d57f9,null));};exports[_0xb38b('0x95')]=function(_0x586d7c,_0x5eac96,_0x5f1dd4){return db[_0xb38b('0x4c')][_0xb38b('0x33')]({'where':{'id':_0x586d7c[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5eac96,null))[_0xb38b('0x27')](function(_0x449ac4){if(_0x449ac4){return _0x449ac4[_0xb38b('0x95')](_0x586d7c[_0xb38b('0x3e')][_0xb38b('0x8e')])[_0xb38b('0x27')](function(){if(_[_0xb38b('0x96')](_0x586d7c[_0xb38b('0x3e')][_0xb38b('0x8e')])){for(var _0x293392=0x0;_0x293392<_0x586d7c[_0xb38b('0x3e')][_0xb38b('0x8e')][_0xb38b('0x43')];_0x293392+=0x1){socket[_0xb38b('0x80')](_0xb38b('0x91'),{'UserId':Number(_0x586d7c[_0xb38b('0x3e')]['ids'][_0x293392]),'VoiceQueueId':Number(_0x586d7c[_0xb38b('0x51')]['id'])});}}else{socket[_0xb38b('0x80')](_0xb38b('0x91'),{'UserId':Number(_0x586d7c[_0xb38b('0x3e')]['ids']),'VoiceQueueId':Number(_0x586d7c[_0xb38b('0x51')]['id'])});}});}})['then'](function(_0x1db3c4){return db[_0xb38b('0x90')]['destroy']({'where':{'VoiceQueueId':_0x586d7c['params']['id'],'UserId':_0x586d7c[_0xb38b('0x3e')][_0xb38b('0x8e')]}})['then'](function(){return _0x1db3c4;});})[_0xb38b('0x27')](respondWithStatusCode(_0x5eac96,null))['catch'](handleError(_0x5eac96,null));};exports[_0xb38b('0x97')]=function(_0x5a3fb,_0x14e93c,_0x18bd9c){var _0x3f427e={};var _0x5dbe82={};var _0x11f90c;var _0x52572b;return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x5a3fb[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x14e93c,null))['then'](function(_0x4f1948){if(_0x4f1948){_0x11f90c=_0x4f1948;_0x5dbe82[_0xb38b('0x3d')]=_['keys'](db[_0xb38b('0x6f')]['rawAttributes']);_0x5dbe82[_0xb38b('0x3e')]=_['keys'](_0x5a3fb[_0xb38b('0x3e')]);_0x5dbe82[_0xb38b('0x49')]=_[_0xb38b('0x40')](_0x5dbe82[_0xb38b('0x3d')],_0x5dbe82[_0xb38b('0x3e')]);_0x3f427e[_0xb38b('0x41')]=_['intersection'](_0x5dbe82[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x5a3fb[_0xb38b('0x3e')][_0xb38b('0x42')]));_0x3f427e[_0xb38b('0x41')]=_0x3f427e[_0xb38b('0x41')][_0xb38b('0x43')]?_0x3f427e[_0xb38b('0x41')]:_0x5dbe82[_0xb38b('0x3d')];_0x3f427e['order']=qs[_0xb38b('0x46')](_0x5a3fb[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x3f427e[_0xb38b('0x47')]=qs[_0xb38b('0x49')](_[_0xb38b('0x48')](_0x5a3fb[_0xb38b('0x3e')],_0x5dbe82[_0xb38b('0x49')]));if(_0x5a3fb['query'][_0xb38b('0x2e')]){_0x3f427e['where']=_['merge'](_0x3f427e['where'],{'$or':_[_0xb38b('0x30')](_0x3f427e[_0xb38b('0x41')],function(_0x1198d4){var _0x44c4c5={};_0x44c4c5[_0x1198d4]={'$like':'%'+_0x5a3fb[_0xb38b('0x3e')]['filter']+'%'};return _0x44c4c5;})});}_0x3f427e=_['merge']({},_0x3f427e,_0x5a3fb[_0xb38b('0x52')]);return _0x11f90c[_0xb38b('0x97')](_0x3f427e);}})[_0xb38b('0x27')](function(_0x22857a){if(_0x22857a){_0x52572b=_0x22857a[_0xb38b('0x43')];if(!_0x5a3fb[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x3f427e['limit']=qs[_0xb38b('0x20')](_0x5a3fb[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x3f427e[_0xb38b('0x1e')]=qs[_0xb38b('0x1e')](_0x5a3fb['query'][_0xb38b('0x1e')]);}return _0x11f90c[_0xb38b('0x97')](_0x3f427e);}})[_0xb38b('0x27')](function(_0x2d296c){if(_0x2d296c){return _0x2d296c?{'count':_0x52572b,'rows':_0x2d296c}:null;}})['then'](respondWithResult(_0x14e93c,null))[_0xb38b('0x4f')](handleError(_0x14e93c,null));};exports[_0xb38b('0x98')]=function(_0x31e8c7,_0x3a96b7,_0x24c390){var _0x8beaae={};var _0x215771={};var _0x29003e;var _0x5147b7;return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x31e8c7[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x3a96b7,null))['then'](function(_0xcee2e3){if(_0xcee2e3){_0x29003e=_0xcee2e3;_0x215771[_0xb38b('0x3d')]=_['keys'](db[_0xb38b('0x90')]['rawAttributes']);_0x215771[_0xb38b('0x3e')]=_['keys'](_0x31e8c7[_0xb38b('0x3e')]);_0x215771[_0xb38b('0x49')]=_['intersection'](_0x215771[_0xb38b('0x3d')],_0x215771['query']);_0x8beaae[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x215771[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x31e8c7[_0xb38b('0x3e')]['fields']));_0x8beaae[_0xb38b('0x41')]=_0x8beaae[_0xb38b('0x41')][_0xb38b('0x43')]?_0x8beaae['attributes']:_0x215771[_0xb38b('0x3d')];_0x8beaae[_0xb38b('0x68')]=qs[_0xb38b('0x46')](_0x31e8c7['query'][_0xb38b('0x46')]);_0x8beaae[_0xb38b('0x47')]=qs['filters'](_['pick'](_0x31e8c7[_0xb38b('0x3e')],_0x215771[_0xb38b('0x49')]));if(_0x31e8c7[_0xb38b('0x3e')][_0xb38b('0x2e')]){_0x8beaae[_0xb38b('0x47')]=_[_0xb38b('0x4a')](_0x8beaae[_0xb38b('0x47')],{'$or':_['map'](_0x8beaae[_0xb38b('0x41')],function(_0x3b00c8){var _0x771ac9={};_0x771ac9[_0x3b00c8]={'$like':'%'+_0x31e8c7['query']['filter']+'%'};return _0x771ac9;})});}_0x8beaae=_[_0xb38b('0x4a')]({},_0x8beaae,_0x31e8c7[_0xb38b('0x52')]);return _0x29003e[_0xb38b('0x98')](_0x8beaae);}})[_0xb38b('0x27')](function(_0x19e38e){if(_0x19e38e){_0x5147b7=_0x19e38e[_0xb38b('0x43')];if(!_0x31e8c7[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x8beaae[_0xb38b('0x20')]=qs[_0xb38b('0x20')](_0x31e8c7['query']['limit']);_0x8beaae[_0xb38b('0x1e')]=qs[_0xb38b('0x1e')](_0x31e8c7['query'][_0xb38b('0x1e')]);}return _0x29003e[_0xb38b('0x98')](_0x8beaae);}})['then'](function(_0x4d8ea0){return _0x4d8ea0?{'count':_0x5147b7,'rows':_0x4d8ea0}:null;})[_0xb38b('0x27')](respondWithResult(_0x3a96b7,null))['catch'](handleError(_0x3a96b7,null));};exports['getLists']=function(_0x5740d2,_0x4e8219,_0xd1302b){var _0x5a585c={};var _0x5ef9ee={};var _0x5723c1;var _0x7a5bbe;return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x5740d2[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e8219,null))[_0xb38b('0x27')](function(_0xc258aa){if(_0xc258aa){_0x5723c1=_0xc258aa;_0x5ef9ee[_0xb38b('0x3d')]=_['keys'](db['CmList']['rawAttributes']);_0x5ef9ee['query']=_[_0xb38b('0x3f')](_0x5740d2['query']);_0x5ef9ee[_0xb38b('0x49')]=_[_0xb38b('0x40')](_0x5ef9ee[_0xb38b('0x3d')],_0x5ef9ee['query']);_0x5a585c[_0xb38b('0x41')]=_[_0xb38b('0x40')](_0x5ef9ee[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x5740d2['query']['fields']));_0x5a585c[_0xb38b('0x41')]=_0x5a585c[_0xb38b('0x41')][_0xb38b('0x43')]?_0x5a585c[_0xb38b('0x41')]:_0x5ef9ee[_0xb38b('0x3d')];_0x5a585c[_0xb38b('0x68')]=qs[_0xb38b('0x46')](_0x5740d2[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x5a585c['where']=qs['filters'](_[_0xb38b('0x48')](_0x5740d2['query'],_0x5ef9ee[_0xb38b('0x49')]));if(_0x5740d2[_0xb38b('0x3e')][_0xb38b('0x2e')]){_0x5a585c['where']=_[_0xb38b('0x4a')](_0x5a585c[_0xb38b('0x47')],{'$or':_[_0xb38b('0x30')](_0x5a585c[_0xb38b('0x41')],function(_0x5ab655){var _0x5a2878={};_0x5a2878[_0x5ab655]={'$like':'%'+_0x5740d2[_0xb38b('0x3e')]['filter']+'%'};return _0x5a2878;})});}_0x5a585c=_[_0xb38b('0x4a')]({},_0x5a585c,_0x5740d2[_0xb38b('0x52')]);return _0x5723c1['getLists'](_0x5a585c);}})[_0xb38b('0x27')](function(_0x3129f2){if(_0x3129f2){_0x7a5bbe=_0x3129f2[_0xb38b('0x43')];if(!_0x5740d2['query']['hasOwnProperty'](_0xb38b('0x45'))){_0x5a585c['limit']=qs[_0xb38b('0x20')](_0x5740d2[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x5a585c[_0xb38b('0x1e')]=qs[_0xb38b('0x1e')](_0x5740d2[_0xb38b('0x3e')]['offset']);}return _0x5723c1[_0xb38b('0x99')](_0x5a585c);}})[_0xb38b('0x27')](function(_0x332eb1){if(_0x332eb1){return _0x332eb1?{'count':_0x7a5bbe,'rows':_0x332eb1}:null;}})[_0xb38b('0x27')](respondWithResult(_0x4e8219,null))[_0xb38b('0x4f')](handleError(_0x4e8219,null));};exports[_0xb38b('0x9a')]=function(_0x3cc7a7,_0x365bf1,_0x5ebf9a){var _0x39cb65,_0x1e6fdd;return db['VoiceQueue'][_0xb38b('0x33')]({'where':{'id':_0x3cc7a7[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x365bf1,null))[_0xb38b('0x27')](function(_0x516d24){if(_0x516d24){_0x1e6fdd=_0x516d24;return _0x516d24[_0xb38b('0x9a')](_0x3cc7a7['body'][_0xb38b('0x8e')],_[_0xb38b('0x5d')](_0x3cc7a7[_0xb38b('0x54')],[_0xb38b('0x8e'),'id'])||{});}return null;})[_0xb38b('0x93')](function(_0x64930e){var _0x37a313;_0x39cb65=_0x64930e||[];var _0xc4cee4=[];if(_0x64930e){for(var _0x37e122=0x0;_0x37e122<_0x64930e['length'];_0x37e122+=0x1){var _0x89a22f=_0x64930e[_0x37e122][_0xb38b('0x29')]({'plain':!![]});_0x1e6fdd['dialCheckDuplicateType']=_0x3cc7a7['body'][_0xb38b('0x9b')]?_0x3cc7a7[_0xb38b('0x54')][_0xb38b('0x9b')]:_0x1e6fdd[_0xb38b('0x9b')];switch(_0x1e6fdd[_0xb38b('0x9b')]){case'always':_0x37a313=squel['insert']()['into']('cm_hopper')[_0xb38b('0x9c')]([_0xb38b('0x9d'),'scheduledAt',_0xb38b('0x9e'),_0xb38b('0x9f'),'VoiceQueueId',_0xb38b('0x5e'),'updatedAt'],squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0x9d'),_0xb38b('0x9d'))[_0xb38b('0xa0')](_0xb38b('0xa1'),'scheduledAt')[_0xb38b('0xa0')]('id',_0xb38b('0x9e'))[_0xb38b('0xa0')](_0x89a22f[_0xb38b('0xa2')][_0xb38b('0x89')](),'ListId')[_0xb38b('0xa0')](_0x3cc7a7[_0xb38b('0x51')]['id'][_0xb38b('0x89')](),_0xb38b('0x61'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0x5e'))[_0xb38b('0xa0')]('NOW()','updatedAt')[_0xb38b('0x84')](_0xb38b('0xa3'))[_0xb38b('0x47')](_0xb38b('0xa4'))['where'](_0xb38b('0xa5'),_0x89a22f[_0xb38b('0xa2')][_0xb38b('0x89')]())['where'](_0xb38b('0xa6'))['where'](_0xb38b('0xa7'),squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0xa8'))[_0xb38b('0x84')]('cm_hopper_final')[_0xb38b('0x47')](_0xb38b('0x88'),_0x3cc7a7[_0xb38b('0x51')]['id'][_0xb38b('0x89')]()))[_0xb38b('0x47')](_0xb38b('0xa7'),squel[_0xb38b('0x82')]()['field'](_0xb38b('0xa9'))['from'](_0xb38b('0xaa'))[_0xb38b('0x47')](_0xb38b('0x88'),_0x3cc7a7[_0xb38b('0x51')]['id'][_0xb38b('0x89')]())))['toString']();break;case _0xb38b('0xab'):_0x37a313=squel[_0xb38b('0xac')]()[_0xb38b('0xad')](_0xb38b('0xaa'))[_0xb38b('0x9c')]([_0xb38b('0x9d'),_0xb38b('0xae'),_0xb38b('0x9e'),_0xb38b('0x9f'),_0xb38b('0x61'),_0xb38b('0x5e'),_0xb38b('0x5c')],squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0x9d'),_0xb38b('0x9d'))[_0xb38b('0xa0')]('NOW()',_0xb38b('0xae'))[_0xb38b('0xa0')]('id',_0xb38b('0x9e'))['field'](_0x89a22f[_0xb38b('0xa2')][_0xb38b('0x89')](),'ListId')['field'](_0x3cc7a7[_0xb38b('0x51')]['id'][_0xb38b('0x89')](),_0xb38b('0x61'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0x5e'))[_0xb38b('0xa0')]('NOW()',_0xb38b('0x5c'))['from'](_0xb38b('0xa3'))[_0xb38b('0x47')](_0xb38b('0xa4'))[_0xb38b('0x47')](_0xb38b('0xa5'),_0x89a22f[_0xb38b('0xa2')]['toString']())['where'](_0xb38b('0xa6'))[_0xb38b('0x47')](_0xb38b('0xa7'),squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0xa9'))[_0xb38b('0x84')](_0xb38b('0xaa'))[_0xb38b('0x47')](_0xb38b('0x88'),_0x3cc7a7[_0xb38b('0x51')]['id'][_0xb38b('0x89')]())))[_0xb38b('0x89')]();break;default:_0x37a313=squel[_0xb38b('0xac')]()[_0xb38b('0xad')](_0xb38b('0xaa'))[_0xb38b('0x9c')]([_0xb38b('0x9d'),_0xb38b('0xae'),_0xb38b('0x9e'),'ListId','VoiceQueueId',_0xb38b('0x5e'),_0xb38b('0x5c')],squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0x9d'),_0xb38b('0x9d'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0xae'))['field']('id','ContactId')[_0xb38b('0xa0')](_0x89a22f['CmListId'][_0xb38b('0x89')](),_0xb38b('0x9f'))['field'](_0x3cc7a7['params']['id']['toString'](),_0xb38b('0x61'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0x5e'))[_0xb38b('0xa0')]('NOW()',_0xb38b('0x5c'))[_0xb38b('0x84')](_0xb38b('0xa3'))[_0xb38b('0x47')](_0xb38b('0xa4'))[_0xb38b('0x47')]('ListId\x20=\x20?',_0x89a22f[_0xb38b('0xa2')]['toString']())[_0xb38b('0x47')](_0xb38b('0xa6')))[_0xb38b('0x89')]();}_0xc4cee4[_0xb38b('0x94')](db[_0xb38b('0x76')][_0xb38b('0x3e')](_0x37a313));}return BPromise[_0xb38b('0x8c')](_0xc4cee4);}})['then'](function(){return _0x39cb65;})[_0xb38b('0x27')](respondWithResult(_0x365bf1,null))[_0xb38b('0x4f')](handleError(_0x365bf1,null));};exports['removeLists']=function(_0x4dbd1b,_0x893767,_0x2edadb){return db[_0xb38b('0x4c')][_0xb38b('0x33')]({'where':{'id':_0x4dbd1b[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x893767,null))[_0xb38b('0x27')](function(_0xb6a4d6){if(_0xb6a4d6){return _0xb6a4d6[_0xb38b('0xaf')](_0x4dbd1b['query'][_0xb38b('0x8e')]);}})['then'](function(_0xecec81){if(_0xecec81){return db[_0xb38b('0x60')][_0xb38b('0x28')]({'where':{'ListId':_0x4dbd1b[_0xb38b('0x3e')][_0xb38b('0x8e')],'VoiceQueueId':_0x4dbd1b[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](function(){return _0xecec81;});}})[_0xb38b('0x27')](respondWithStatusCode(_0x893767,null))[_0xb38b('0x4f')](handleError(_0x893767,null));};exports[_0xb38b('0xb0')]=function(_0x2953fb,_0x516084,_0x157464){var _0x163ba8={};var _0x3f6f4b={};var _0x1bbd32;var _0x49fd5a;return db[_0xb38b('0x4c')][_0xb38b('0x5f')]({'where':{'id':_0x2953fb[_0xb38b('0x51')]['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x516084,null))['then'](function(_0x1a1c46){if(_0x1a1c46){_0x1bbd32=_0x1a1c46;_0x3f6f4b[_0xb38b('0x3d')]=_['keys'](db[_0xb38b('0xb1')][_0xb38b('0x3a')]);_0x3f6f4b[_0xb38b('0x3e')]=_['keys'](_0x2953fb['query']);_0x3f6f4b['filters']=_[_0xb38b('0x40')](_0x3f6f4b[_0xb38b('0x3d')],_0x3f6f4b[_0xb38b('0x3e')]);_0x163ba8[_0xb38b('0x41')]=_['intersection'](_0x3f6f4b[_0xb38b('0x3d')],qs[_0xb38b('0x42')](_0x2953fb[_0xb38b('0x3e')]['fields']));_0x163ba8[_0xb38b('0x41')]=_0x163ba8['attributes'][_0xb38b('0x43')]?_0x163ba8[_0xb38b('0x41')]:_0x3f6f4b[_0xb38b('0x3d')];_0x163ba8['order']=qs['sort'](_0x2953fb[_0xb38b('0x3e')][_0xb38b('0x46')]);_0x163ba8[_0xb38b('0x47')]=qs[_0xb38b('0x49')](_[_0xb38b('0x48')](_0x2953fb[_0xb38b('0x3e')],_0x3f6f4b[_0xb38b('0x49')]));if(_0x2953fb[_0xb38b('0x3e')][_0xb38b('0x2e')]){_0x163ba8[_0xb38b('0x47')]=_['merge'](_0x163ba8[_0xb38b('0x47')],{'$or':_['map'](_0x163ba8['attributes'],function(_0x55bd43){var _0x4e1c78={};_0x4e1c78[_0x55bd43]={'$like':'%'+_0x2953fb[_0xb38b('0x3e')][_0xb38b('0x2e')]+'%'};return _0x4e1c78;})});}_0x163ba8=_[_0xb38b('0x4a')]({},_0x163ba8,_0x2953fb[_0xb38b('0x52')]);return _0x1bbd32['getBlackLists'](_0x163ba8);}})[_0xb38b('0x27')](function(_0x3f352a){if(_0x3f352a){_0x49fd5a=_0x3f352a[_0xb38b('0x43')];if(!_0x2953fb[_0xb38b('0x3e')][_0xb38b('0x44')](_0xb38b('0x45'))){_0x163ba8[_0xb38b('0x20')]=qs[_0xb38b('0x20')](_0x2953fb[_0xb38b('0x3e')][_0xb38b('0x20')]);_0x163ba8['offset']=qs['offset'](_0x2953fb['query'][_0xb38b('0x1e')]);}return _0x1bbd32[_0xb38b('0xb0')](_0x163ba8);}})[_0xb38b('0x27')](function(_0x38340c){if(_0x38340c){return _0x38340c?{'count':_0x49fd5a,'rows':_0x38340c}:null;}})[_0xb38b('0x27')](respondWithResult(_0x516084,null))[_0xb38b('0x4f')](handleError(_0x516084,null));};exports[_0xb38b('0xb2')]=function(_0x3e7c6d,_0x10121b,_0x6a1798){var _0x134c71,_0x4fe1d1;return db[_0xb38b('0x4c')]['find']({'where':{'id':_0x3e7c6d['params']['id']}})[_0xb38b('0x27')](handleEntityNotFound(_0x10121b,null))['then'](function(_0x67985a){if(_0x67985a){_0x4fe1d1=_0x67985a;return _0x67985a[_0xb38b('0xb2')](_0x3e7c6d[_0xb38b('0x54')]['ids'],_['omit'](_0x3e7c6d['body'],[_0xb38b('0x8e'),'id'])||{});}return null;})['spread'](function(_0x1c4594){var _0x15bc1f;_0x134c71=_0x1c4594||[];var _0x1816a0=[];if(_0x1c4594){for(var _0x36ebcc=0x0;_0x36ebcc<_0x1c4594[_0xb38b('0x43')];_0x36ebcc+=0x1){var _0x2fe2f5=_0x1c4594[_0x36ebcc][_0xb38b('0x29')]({'plain':!![]});_0x15bc1f=squel['insert']()[_0xb38b('0xad')](_0xb38b('0xb3'))[_0xb38b('0x9c')](['phone',_0xb38b('0x9e'),_0xb38b('0x9f'),_0xb38b('0x61'),_0xb38b('0x5e'),_0xb38b('0x5c')],squel[_0xb38b('0x82')]()[_0xb38b('0xa0')](_0xb38b('0x9d'),_0xb38b('0x9d'))['field']('id',_0xb38b('0x9e'))[_0xb38b('0xa0')](_0x2fe2f5[_0xb38b('0xa2')][_0xb38b('0x89')](),_0xb38b('0x9f'))[_0xb38b('0xa0')](_0x3e7c6d[_0xb38b('0x51')]['id'][_0xb38b('0x89')](),_0xb38b('0x61'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0x5e'))[_0xb38b('0xa0')](_0xb38b('0xa1'),_0xb38b('0x5c'))[_0xb38b('0x84')](_0xb38b('0xa3'))[_0xb38b('0x47')](_0xb38b('0xa4'))[_0xb38b('0x47')](_0xb38b('0xa5'),_0x2fe2f5[_0xb38b('0xa2')][_0xb38b('0x89')]())[_0xb38b('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0xb38b('0x89')]();_0x1816a0[_0xb38b('0x94')](db['sequelize'][_0xb38b('0x3e')](_0x15bc1f));}return BPromise['all'](_0x1816a0);}})[_0xb38b('0x27')](function(){return _0x134c71;})['then'](respondWithResult(_0x10121b,null))[_0xb38b('0x4f')](handleError(_0x10121b,null));};exports[_0xb38b('0xb4')]=function(_0x11b72f,_0x40b63b,_0xbfd54b){return db['VoiceQueue']['find']({'where':{'id':_0x11b72f[_0xb38b('0x51')]['id']}})['then'](handleEntityNotFound(_0x40b63b,null))[_0xb38b('0x27')](function(_0x47364e){if(_0x47364e){return _0x47364e[_0xb38b('0xb4')](_0x11b72f[_0xb38b('0x3e')][_0xb38b('0x8e')]);}})[_0xb38b('0x27')](function(_0x51d228){if(_0x51d228){return db['CmHopperBlack'][_0xb38b('0x28')]({'where':{'ListId':_0x11b72f[_0xb38b('0x3e')][_0xb38b('0x8e')],'VoiceQueueId':_0x11b72f['params']['id']}})[_0xb38b('0x27')](function(){return _0x51d228;});}})[_0xb38b('0x27')](respondWithStatusCode(_0x40b63b,null))[_0xb38b('0x4f')](handleError(_0x40b63b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0d9fff9..2b6acac 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 _0x0076=['hasOwnProperty','hook','events','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x4d87cb,_0x19a8d8){var _0x477d78=function(_0x2ab68d){while(--_0x2ab68d){_0x4d87cb['push'](_0x4d87cb['shift']());}};_0x477d78(++_0x19a8d8);}(_0x0076,0x102));var _0x6007=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x0076[_0x49d41c];return _0xb64c5f;};'use strict';var EventEmitter=require(_0x6007('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x6007('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6007('0x2')](0x0);var events={'afterCreate':_0x6007('0x3'),'afterUpdate':'update','afterDestroy':_0x6007('0x4')};function emitEvent(_0xe4df68){return function(_0x55c784,_0x5c96dc,_0x527a48){VoiceQueueEvents[_0x6007('0x5')](_0xe4df68+':'+_0x55c784['id'],_0x55c784);VoiceQueueEvents[_0x6007('0x5')](_0xe4df68,_0x55c784);_0x527a48(null);};}for(var e in events){if(events[_0x6007('0x6')](e)){var event=events[e];VoiceQueue[_0x6007('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x09fd=['VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x14e405,_0x387732){var _0x34822a=function(_0x29c0ab){while(--_0x29c0ab){_0x14e405['push'](_0x14e405['shift']());}};_0x34822a(++_0x387732);}(_0x09fd,0x120));var _0xd09f=function(_0x223235,_0x1dafbb){_0x223235=_0x223235-0x0;var _0x3fe560=_0x09fd[_0x223235];return _0x3fe560;};'use strict';var EventEmitter=require(_0xd09f('0x0'));var VoiceQueue=require(_0xd09f('0x1'))['db'][_0xd09f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd09f('0x3')](0x0);var events={'afterCreate':_0xd09f('0x4'),'afterUpdate':_0xd09f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15461f){return function(_0x5419c3,_0x334c16,_0x14f300){VoiceQueueEvents['emit'](_0x15461f+':'+_0x5419c3['id'],_0x5419c3);VoiceQueueEvents[_0xd09f('0x6')](_0x15461f,_0x5419c3);_0x14f300(null);};}for(var e in events){if(events[_0xd09f('0x7')](e)){var event=events[e];VoiceQueue[_0xd09f('0x8')](e,emitEvent(event));}}module[_0xd09f('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index a4110f9..4bb2045 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x530ed9,_0x547826){var _0x73a82a=function(_0x16730a){while(--_0x16730a){_0x530ed9['push'](_0x530ed9['shift']());}};_0x73a82a(++_0x547826);}(_0xedd9,0xfc));var _0x9edd=function(_0x600af3,_0x2145c9){_0x600af3=_0x600af3-0x0;var _0x5044fe=_0xedd9[_0x600af3];return _0x5044fe;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x3e74,0x175));var _0x43e7=function(_0x54d129,_0x1ef3d7){_0x54d129=_0x54d129-0x0;var _0x3a996f=_0x3e74[_0x54d129];return _0x3a996f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 75b7e59..e804479 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 _0xb843=['code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowVoiceQueue','where','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','error'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xb843,0xca));var _0x3b84=function(_0x55fe55,_0x33abc2){_0x55fe55=_0x55fe55-0x0;var _0x3d4da6=_0xb843[_0x55fe55];return _0x3d4da6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b84('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b84('0x1'));var db=require(_0x3b84('0x2'))['db'];var utils=require(_0x3b84('0x3'));var logger=require(_0x3b84('0x4'))('rpc');var config=require(_0x3b84('0x5'));var jayson=require(_0x3b84('0x6'));var client=jayson[_0x3b84('0x7')][_0x3b84('0x8')]({'port':0x232a});config[_0x3b84('0x9')]=_[_0x3b84('0xa')](config['redis'],{'host':_0x3b84('0xb'),'port':0x18eb});var socket=require(_0x3b84('0xc'))(new Redis(config[_0x3b84('0x9')]));require(_0x3b84('0xd'))[_0x3b84('0xe')](socket);function respondWithRpcPromise(_0x659673,_0x4115ae,_0x5e85c9){return new BPromise(function(_0x299cc5,_0x57d7df){return client['request'](_0x659673,_0x5e85c9)[_0x3b84('0xf')](function(_0x58b7f2){logger[_0x3b84('0x10')](_0x3b84('0x11'),_0x4115ae,_0x3b84('0x12'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4115ae,_0x3b84('0x12'),JSON['stringify'](_0x58b7f2));if(_0x58b7f2[_0x3b84('0x13')]){if(_0x58b7f2[_0x3b84('0x13')][_0x3b84('0x14')]===0x1f4){logger[_0x3b84('0x13')](_0x3b84('0x11'),_0x4115ae,_0x58b7f2[_0x3b84('0x13')]['message']);return _0x57d7df(_0x58b7f2[_0x3b84('0x13')][_0x3b84('0x15')]);}logger['error'](_0x3b84('0x11'),_0x4115ae,_0x58b7f2[_0x3b84('0x13')][_0x3b84('0x15')]);return _0x299cc5(_0x58b7f2[_0x3b84('0x13')][_0x3b84('0x15')]);}else{logger['info'](_0x3b84('0x11'),_0x4115ae,_0x3b84('0x12'));_0x299cc5(_0x58b7f2['result'][_0x3b84('0x15')]);}})[_0x3b84('0x16')](function(_0x3eadeb){logger[_0x3b84('0x13')](_0x3b84('0x11'),_0x4115ae,_0x3eadeb);_0x57d7df(_0x3eadeb);});});}exports[_0x3b84('0x17')]=function(_0xbf3aa4){var _0x57a469=this;return new Promise(function(_0x5ebe39,_0x411b39){return db[_0x3b84('0x18')][_0x3b84('0x19')]({'raw':_0xbf3aa4['options']?_0xbf3aa4[_0x3b84('0x1a')][_0x3b84('0x1b')]===undefined?!![]:![]:!![],'where':_0xbf3aa4[_0x3b84('0x1a')]?_0xbf3aa4[_0x3b84('0x1a')]['where']||null:null,'attributes':_0xbf3aa4['options']?_0xbf3aa4['options'][_0x3b84('0x1c')]||null:null,'limit':_0xbf3aa4[_0x3b84('0x1a')]?_0xbf3aa4[_0x3b84('0x1a')][_0x3b84('0x1d')]||null:null,'include':_0xbf3aa4[_0x3b84('0x1a')]?_0xbf3aa4[_0x3b84('0x1a')][_0x3b84('0x1e')]?_[_0x3b84('0x1f')](_0xbf3aa4[_0x3b84('0x1a')]['include'],function(_0x49754a){return{'model':db[_0x49754a[_0x3b84('0x20')]],'as':_0x49754a['as'],'attributes':_0x49754a[_0x3b84('0x1c')],'include':_0x49754a[_0x3b84('0x1e')]?_[_0x3b84('0x1f')](_0x49754a['include'],function(_0x11c72c){return{'model':db[_0x11c72c['model']],'as':_0x11c72c['as'],'attributes':_0x11c72c[_0x3b84('0x1c')],'include':_0x11c72c[_0x3b84('0x1e')]?_[_0x3b84('0x1f')](_0x11c72c[_0x3b84('0x1e')],function(_0x4c9ae3){return{'model':db[_0x4c9ae3['model']],'as':_0x4c9ae3['as'],'attributes':_0x4c9ae3['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b84('0xf')](function(_0xc7dbac){logger['info'](_0x3b84('0x17'),_0xbf3aa4);logger[_0x3b84('0x21')](_0x3b84('0x17'),_0xbf3aa4,JSON[_0x3b84('0x22')](_0xc7dbac));_0x5ebe39(_0xc7dbac);})[_0x3b84('0x16')](function(_0x5255f3){logger[_0x3b84('0x13')](_0x3b84('0x17'),_0x5255f3[_0x3b84('0x15')],_0xbf3aa4);_0x411b39(_0x57a469['error'](0x1f4,_0x5255f3[_0x3b84('0x15')]));});});};exports[_0x3b84('0x23')]=function(_0x4a0a88){var _0x545b4d=this;return new Promise(function(_0x4d57e5,_0x3c2dbe){return db[_0x3b84('0x18')]['find']({'raw':_0x4a0a88[_0x3b84('0x1a')]?_0x4a0a88[_0x3b84('0x1a')][_0x3b84('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a0a88[_0x3b84('0x1a')]?_0x4a0a88[_0x3b84('0x1a')][_0x3b84('0x24')]||null:null,'attributes':_0x4a0a88['options']?_0x4a0a88[_0x3b84('0x1a')][_0x3b84('0x1c')]||null:null,'include':_0x4a0a88[_0x3b84('0x1a')]?_0x4a0a88[_0x3b84('0x1a')]['include']?_[_0x3b84('0x1f')](_0x4a0a88[_0x3b84('0x1a')][_0x3b84('0x1e')],function(_0x19f8c7){return{'model':db[_0x19f8c7[_0x3b84('0x20')]],'as':_0x19f8c7['as'],'attributes':_0x19f8c7[_0x3b84('0x1c')],'include':_0x19f8c7['include']?_[_0x3b84('0x1f')](_0x19f8c7[_0x3b84('0x1e')],function(_0x931396){return{'model':db[_0x931396[_0x3b84('0x20')]],'as':_0x931396['as'],'attributes':_0x931396[_0x3b84('0x1c')],'include':_0x931396[_0x3b84('0x1e')]?_[_0x3b84('0x1f')](_0x931396[_0x3b84('0x1e')],function(_0x2017d3){return{'model':db[_0x2017d3[_0x3b84('0x20')]],'as':_0x2017d3['as'],'attributes':_0x2017d3[_0x3b84('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4385e5){logger[_0x3b84('0x10')](_0x3b84('0x23'),_0x4a0a88);logger[_0x3b84('0x21')](_0x3b84('0x23'),_0x4a0a88,JSON[_0x3b84('0x22')](_0x4385e5));_0x4d57e5(_0x4385e5);})[_0x3b84('0x16')](function(_0x703159){logger[_0x3b84('0x13')](_0x3b84('0x23'),_0x703159[_0x3b84('0x15')],_0x4a0a88);_0x3c2dbe(_0x545b4d[_0x3b84('0x13')](0x1f4,_0x703159[_0x3b84('0x15')]));});});}; \ No newline at end of file +var _0x32b2=['include','model','find','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map'];(function(_0x3aca3d,_0x444f9c){var _0x5846eb=function(_0x1953c0){while(--_0x1953c0){_0x3aca3d['push'](_0x3aca3d['shift']());}};_0x5846eb(++_0x444f9c);}(_0x32b2,0xc7));var _0x232b=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x32b2[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require('lodash');var util=require(_0x232b('0x0'));var moment=require(_0x232b('0x1'));var BPromise=require(_0x232b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x232b('0x3'));var db=require(_0x232b('0x4'))['db'];var utils=require(_0x232b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x232b('0x6'));var jayson=require(_0x232b('0x7'));var client=jayson[_0x232b('0x8')][_0x232b('0x9')]({'port':0x232a});config['redis']=_[_0x232b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x232b('0xb'))(new Redis(config[_0x232b('0xc')]));require('./voiceQueue.socket')[_0x232b('0xd')](socket);function respondWithRpcPromise(_0x22ecd0,_0x41ae13,_0x2e22b0){return new BPromise(function(_0x43258e,_0x20edb6){return client[_0x232b('0xe')](_0x22ecd0,_0x2e22b0)[_0x232b('0xf')](function(_0x495a94){logger[_0x232b('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x41ae13,_0x232b('0x11'));logger[_0x232b('0x12')](_0x232b('0x13'),_0x41ae13,_0x232b('0x11'),JSON[_0x232b('0x14')](_0x495a94));if(_0x495a94[_0x232b('0x15')]){if(_0x495a94[_0x232b('0x15')]['code']===0x1f4){logger['error'](_0x232b('0x16'),_0x41ae13,_0x495a94[_0x232b('0x15')][_0x232b('0x17')]);return _0x20edb6(_0x495a94['error'][_0x232b('0x17')]);}logger[_0x232b('0x15')](_0x232b('0x16'),_0x41ae13,_0x495a94[_0x232b('0x15')][_0x232b('0x17')]);return _0x43258e(_0x495a94['error'][_0x232b('0x17')]);}else{logger[_0x232b('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x41ae13,_0x232b('0x11'));_0x43258e(_0x495a94[_0x232b('0x18')][_0x232b('0x17')]);}})[_0x232b('0x19')](function(_0x10b072){logger[_0x232b('0x15')](_0x232b('0x16'),_0x41ae13,_0x10b072);_0x20edb6(_0x10b072);});});}exports[_0x232b('0x1a')]=function(_0x4887ad){var _0x4df9d5=this;return new Promise(function(_0x44d5e5,_0x524fb5){return db[_0x232b('0x1b')][_0x232b('0x1c')]({'raw':_0x4887ad[_0x232b('0x1d')]?_0x4887ad[_0x232b('0x1d')][_0x232b('0x1e')]===undefined?!![]:![]:!![],'where':_0x4887ad[_0x232b('0x1d')]?_0x4887ad[_0x232b('0x1d')][_0x232b('0x1f')]||null:null,'attributes':_0x4887ad[_0x232b('0x1d')]?_0x4887ad[_0x232b('0x1d')][_0x232b('0x20')]||null:null,'limit':_0x4887ad[_0x232b('0x1d')]?_0x4887ad[_0x232b('0x1d')][_0x232b('0x21')]||null:null,'include':_0x4887ad[_0x232b('0x1d')]?_0x4887ad[_0x232b('0x1d')]['include']?_[_0x232b('0x22')](_0x4887ad['options'][_0x232b('0x23')],function(_0xebbd35){return{'model':db[_0xebbd35['model']],'as':_0xebbd35['as'],'attributes':_0xebbd35[_0x232b('0x20')],'include':_0xebbd35[_0x232b('0x23')]?_[_0x232b('0x22')](_0xebbd35[_0x232b('0x23')],function(_0x460ebb){return{'model':db[_0x460ebb[_0x232b('0x24')]],'as':_0x460ebb['as'],'attributes':_0x460ebb['attributes'],'include':_0x460ebb[_0x232b('0x23')]?_['map'](_0x460ebb['include'],function(_0x2449c1){return{'model':db[_0x2449c1[_0x232b('0x24')]],'as':_0x2449c1['as'],'attributes':_0x2449c1[_0x232b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x232b('0xf')](function(_0x6eafd0){logger[_0x232b('0x10')](_0x232b('0x1a'),_0x4887ad);logger[_0x232b('0x12')]('GetVoiceQueue',_0x4887ad,JSON['stringify'](_0x6eafd0));_0x44d5e5(_0x6eafd0);})[_0x232b('0x19')](function(_0x35cddd){logger[_0x232b('0x15')](_0x232b('0x1a'),_0x35cddd[_0x232b('0x17')],_0x4887ad);_0x524fb5(_0x4df9d5[_0x232b('0x15')](0x1f4,_0x35cddd[_0x232b('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x1f97d2){var _0x576283=this;return new Promise(function(_0x5b7d67,_0x2af991){return db['VoiceQueue'][_0x232b('0x25')]({'raw':_0x1f97d2[_0x232b('0x1d')]?_0x1f97d2[_0x232b('0x1d')][_0x232b('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f97d2[_0x232b('0x1d')]?_0x1f97d2[_0x232b('0x1d')]['where']||null:null,'attributes':_0x1f97d2['options']?_0x1f97d2['options']['attributes']||null:null,'include':_0x1f97d2[_0x232b('0x1d')]?_0x1f97d2[_0x232b('0x1d')]['include']?_[_0x232b('0x22')](_0x1f97d2[_0x232b('0x1d')]['include'],function(_0x1c77c8){return{'model':db[_0x1c77c8[_0x232b('0x24')]],'as':_0x1c77c8['as'],'attributes':_0x1c77c8['attributes'],'include':_0x1c77c8[_0x232b('0x23')]?_[_0x232b('0x22')](_0x1c77c8['include'],function(_0x1b8b34){return{'model':db[_0x1b8b34[_0x232b('0x24')]],'as':_0x1b8b34['as'],'attributes':_0x1b8b34[_0x232b('0x20')],'include':_0x1b8b34['include']?_[_0x232b('0x22')](_0x1b8b34['include'],function(_0x2776ae){return{'model':db[_0x2776ae['model']],'as':_0x2776ae['as'],'attributes':_0x2776ae['attributes']};}):[]};}):[]};}):[]:[]})[_0x232b('0xf')](function(_0x5210ee){logger[_0x232b('0x10')](_0x232b('0x26'),_0x1f97d2);logger[_0x232b('0x12')](_0x232b('0x26'),_0x1f97d2,JSON['stringify'](_0x5210ee));_0x5b7d67(_0x5210ee);})[_0x232b('0x19')](function(_0x52271b){logger[_0x232b('0x15')](_0x232b('0x26'),_0x52271b[_0x232b('0x17')],_0x1f97d2);_0x2af991(_0x576283[_0x232b('0x15')](0x1f4,_0x52271b[_0x232b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 79e0bbb..20b559a 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 _0x1f66=['update','emit','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x4d6c16,_0x518dac){var _0x584ce9=function(_0x28fbd9){while(--_0x28fbd9){_0x4d6c16['push'](_0x4d6c16['shift']());}};_0x584ce9(++_0x518dac);}(_0x1f66,0x1d5));var _0x61f6=function(_0x784c92,_0x1e104e){_0x784c92=_0x784c92-0x0;var _0xc1eafe=_0x1f66[_0x784c92];return _0xc1eafe;};'use strict';var VoiceQueueEvents=require(_0x61f6('0x0'));var events=[_0x61f6('0x1'),_0x61f6('0x2'),_0x61f6('0x3')];function createListener(_0x19e571,_0x106c38){return function(_0x4bad3e){_0x106c38[_0x61f6('0x4')](_0x19e571,_0x4bad3e);};}function removeListener(_0x3f0018,_0x446de9){return function(){VoiceQueueEvents['removeListener'](_0x3f0018,_0x446de9);};}exports[_0x61f6('0x5')]=function(_0x27d538){for(var _0x58a471=0x0,_0x2b3c2b=events[_0x61f6('0x6')];_0x58a471<_0x2b3c2b;_0x58a471++){var _0x50101e=events[_0x58a471];var _0x203f21=createListener(_0x61f6('0x7')+_0x50101e,_0x27d538);VoiceQueueEvents['on'](_0x50101e,_0x203f21);}}; \ No newline at end of file +var _0x8add=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','remove'];(function(_0x32ca2e,_0x49e777){var _0x446941=function(_0x1bd49c){while(--_0x1bd49c){_0x32ca2e['push'](_0x32ca2e['shift']());}};_0x446941(++_0x49e777);}(_0x8add,0x7c));var _0xd8ad=function(_0x39ad2f,_0x1b6276){_0x39ad2f=_0x39ad2f-0x0;var _0x410376=_0x8add[_0x39ad2f];return _0x410376;};'use strict';var VoiceQueueEvents=require(_0xd8ad('0x0'));var events=['save',_0xd8ad('0x1'),'update'];function createListener(_0x58e967,_0x429b88){return function(_0xc06ccc){_0x429b88[_0xd8ad('0x2')](_0x58e967,_0xc06ccc);};}function removeListener(_0x4b9edf,_0x427605){return function(){VoiceQueueEvents[_0xd8ad('0x3')](_0x4b9edf,_0x427605);};}exports[_0xd8ad('0x4')]=function(_0x2b7b93){for(var _0x246d3d=0x0,_0x1692e7=events['length'];_0x246d3d<_0x1692e7;_0x246d3d++){var _0x3bc73d=events[_0x246d3d];var _0x372ddf=createListener(_0xd8ad('0x5')+_0x3bc73d,_0x2b7b93);VoiceQueueEvents['on'](_0x3bc73d,_0x372ddf);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9a51a17..3ab96b9 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 _0x54d6=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','exports','util','express','Router','fs-extra'];(function(_0x2fd136,_0x1f14df){var _0x54df65=function(_0x388f2c){while(--_0x388f2c){_0x2fd136['push'](_0x2fd136['shift']());}};_0x54df65(++_0x1f14df);}(_0x54d6,0x65));var _0x654d=function(_0x444984,_0x39b7aa){_0x444984=_0x444984-0x0;var _0x30745c=_0x54d6[_0x444984];return _0x30745c;};'use strict';var multer=require('multer');var util=require(_0x654d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x654d('0x1'));var router=express[_0x654d('0x2')]();var fs_extra=require(_0x654d('0x3'));var auth=require(_0x654d('0x4'));var interaction=require(_0x654d('0x5'));var config=require(_0x654d('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x654d('0x7')]('/',auth[_0x654d('0x8')](),controller['index']);router[_0x654d('0x7')](_0x654d('0x9'),auth[_0x654d('0x8')](),controller[_0x654d('0xa')]);router['get'](_0x654d('0xb'),auth[_0x654d('0x8')](),controller[_0x654d('0xc')]);router['get'](_0x654d('0xd'),auth[_0x654d('0x8')](),controller[_0x654d('0xe')]);router[_0x654d('0xf')]('/',auth[_0x654d('0x8')](),controller['create']);router[_0x654d('0x10')](_0x654d('0xd'),auth[_0x654d('0x8')](),controller[_0x654d('0x11')]);router[_0x654d('0x12')]('/:id',auth[_0x654d('0x8')](),controller[_0x654d('0x13')]);module[_0x654d('0x14')]=router; \ No newline at end of file +var _0x03c0=['getVoiceQueuesReport','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index'];(function(_0xff8092,_0x33bb13){var _0x2d47d9=function(_0x336ee9){while(--_0x336ee9){_0xff8092['push'](_0xff8092['shift']());}};_0x2d47d9(++_0x33bb13);}(_0x03c0,0x162));var _0x003c=function(_0xaecaca,_0x34fcb1){_0xaecaca=_0xaecaca-0x0;var _0x348518=_0x03c0[_0xaecaca];return _0x348518;};'use strict';var multer=require('multer');var util=require(_0x003c('0x0'));var path=require(_0x003c('0x1'));var timeout=require(_0x003c('0x2'));var express=require(_0x003c('0x3'));var router=express[_0x003c('0x4')]();var fs_extra=require(_0x003c('0x5'));var auth=require(_0x003c('0x6'));var interaction=require(_0x003c('0x7'));var config=require(_0x003c('0x8'));var controller=require(_0x003c('0x9'));router[_0x003c('0xa')]('/',auth[_0x003c('0xb')](),controller['index']);router[_0x003c('0xa')]('/describe',auth[_0x003c('0xb')](),controller[_0x003c('0xc')]);router[_0x003c('0xa')](_0x003c('0xd'),auth[_0x003c('0xb')](),controller[_0x003c('0xe')]);router[_0x003c('0xa')](_0x003c('0xf'),auth['isAuthenticated'](),controller[_0x003c('0x10')]);router[_0x003c('0x11')]('/',auth[_0x003c('0xb')](),controller[_0x003c('0x12')]);router['put'](_0x003c('0xf'),auth[_0x003c('0xb')](),controller[_0x003c('0x13')]);router[_0x003c('0x14')](_0x003c('0xf'),auth['isAuthenticated'](),controller[_0x003c('0x15')]);module[_0x003c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 985dc6f..837a41b 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 _0x2c3a=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x2c3a,0x15c));var _0xa2c3=function(_0x2de730,_0x3e14f3){_0x2de730=_0x2de730-0x0;var _0x3959eb=_0x2c3a[_0x2de730];return _0x3959eb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa2c3('0x0'));module[_0xa2c3('0x1')]={'type':{'type':Sequelize[_0xa2c3('0x2')]},'uniqueid':{'type':Sequelize[_0xa2c3('0x2')]},'calleridnum':{'type':Sequelize[_0xa2c3('0x2')]},'calleridname':{'type':Sequelize[_0xa2c3('0x2')]},'queue':{'type':Sequelize[_0xa2c3('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xa2c3('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2a428c){var _0x236f22=moment(_0x2a428c);var _0x3f96be=moment(this[_0xa2c3('0x4')](_0xa2c3('0x5')))[_0xa2c3('0x6')](_0xa2c3('0x7'));var _0x5239c7=_0x236f22[_0xa2c3('0x8')](_0x3f96be,'seconds');this[_0xa2c3('0x9')](_0xa2c3('0xa'),_0x2a428c);this[_0xa2c3('0x9')]('holdtime',_0x5239c7||null);}},'position':{'type':Sequelize[_0xa2c3('0xb')]},'count':{'type':Sequelize[_0xa2c3('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa2c3('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xa2c3('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa2c3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa2c3('0x2')]},'priority':{'type':Sequelize[_0xa2c3('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa2c3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa2c3('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa2c3('0x2')]},'transfer':{'type':Sequelize[_0xa2c3('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa2c3('0x2')],'comment':_0xa2c3('0xd')},'transferexten':{'type':Sequelize[_0xa2c3('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa2c3('0x2')]},'disposition':{'type':Sequelize[_0xa2c3('0x2')]},'secondDisposition':{'type':Sequelize[_0xa2c3('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa2c3('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xa2c3('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdcb2=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x4211bb,_0x424082){var _0x36d8e8=function(_0x8665dc){while(--_0x8665dc){_0x4211bb['push'](_0x4211bb['shift']());}};_0x36d8e8(++_0x424082);}(_0xdcb2,0xc9));var _0x2dcb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xdcb2[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x2dcb('0x0'));var moment=require(_0x2dcb('0x1'));module[_0x2dcb('0x2')]={'type':{'type':Sequelize[_0x2dcb('0x3')]},'uniqueid':{'type':Sequelize[_0x2dcb('0x3')]},'calleridnum':{'type':Sequelize[_0x2dcb('0x3')]},'calleridname':{'type':Sequelize[_0x2dcb('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x2dcb('0x4')],'set':function(_0x51cad2){var _0x58c2ed=moment(_0x51cad2);var _0x2537b3=moment(this[_0x2dcb('0x5')]('queuecallerjoinAt'))[_0x2dcb('0x6')](_0x2dcb('0x7'));var _0x52136=_0x58c2ed[_0x2dcb('0x8')](_0x2537b3,_0x2dcb('0x9'));this[_0x2dcb('0xa')](_0x2dcb('0xb'),_0x51cad2);this[_0x2dcb('0xa')](_0x2dcb('0xc'),_0x52136||null);}},'position':{'type':Sequelize[_0x2dcb('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x2dcb('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2dcb('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x2dcb('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2dcb('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x2dcb('0xd')]},'channel':{'type':Sequelize[_0x2dcb('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2dcb('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2dcb('0x3')]},'exten':{'type':Sequelize[_0x2dcb('0x3')]},'priority':{'type':Sequelize[_0x2dcb('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2dcb('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2dcb('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2dcb('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2dcb('0x3')]},'disposition':{'type':Sequelize[_0x2dcb('0x3')]},'secondDisposition':{'type':Sequelize[_0x2dcb('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2dcb('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x2dcb('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 048ff64..e9b8821 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 _0x2962=['body','destroy','describe','getVoiceQueuesReport','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create'];(function(_0x42c797,_0x16382b){var _0x320035=function(_0x39f50b){while(--_0x39f50b){_0x42c797['push'](_0x42c797['shift']());}};_0x320035(++_0x16382b);}(_0x2962,0x1e4));var _0x2296=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2962[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2296('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2296('0x1'));var moment=require('moment');var BPromise=require(_0x2296('0x2'));var Mustache=require(_0x2296('0x3'));var util=require(_0x2296('0x4'));var path=require(_0x2296('0x5'));var sox=require(_0x2296('0x6'));var csv=require(_0x2296('0x7'));var ejs=require(_0x2296('0x8'));var fs=require('fs');var fs_extra=require(_0x2296('0x9'));var _=require(_0x2296('0xa'));var squel=require(_0x2296('0xb'));var crypto=require(_0x2296('0xc'));var jsforce=require(_0x2296('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2296('0x7'));var querystring=require('querystring');var Papa=require(_0x2296('0xe'));var Redis=require('ioredis');var authService=require(_0x2296('0xf'));var qs=require(_0x2296('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2296('0x11'))('api');var utils=require(_0x2296('0x12'));var config=require(_0x2296('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2296('0x14'))['db'];config['redis']=_[_0x2296('0x15')](config[_0x2296('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2296('0x17'))(new Redis(config[_0x2296('0x16')]));require(_0x2296('0x18'))[_0x2296('0x19')](socket);function respondWithStatusCode(_0xb8090c,_0x35ce8b){_0x35ce8b=_0x35ce8b||0xcc;return function(_0x4d1077){if(_0x4d1077){return _0xb8090c[_0x2296('0x1a')](_0x35ce8b);}return _0xb8090c[_0x2296('0x1b')](_0x35ce8b)[_0x2296('0x1c')]();};}function respondWithResult(_0x31c50d,_0x5ea6a2){_0x5ea6a2=_0x5ea6a2||0xc8;return function(_0x342333){if(_0x342333){return _0x31c50d[_0x2296('0x1b')](_0x5ea6a2)[_0x2296('0x1d')](_0x342333);}};}function respondWithFilteredResult(_0x456cd4,_0x151c2f){return function(_0x414c20){if(_0x414c20){var _0x131b63=typeof _0x151c2f[_0x2296('0x1e')]===_0x2296('0x1f')&&typeof _0x151c2f[_0x2296('0x20')]==='undefined';var _0x5a0a5d=_0x414c20[_0x2296('0x21')];var _0x5304b3=_0x131b63?0x0:_0x151c2f['offset'];var _0x4bd4f1=_0x131b63?_0x414c20[_0x2296('0x21')]:_0x151c2f[_0x2296('0x1e')]+_0x151c2f[_0x2296('0x20')];var _0xf81fe3;if(_0x4bd4f1>=_0x5a0a5d){_0x4bd4f1=_0x5a0a5d;_0xf81fe3=0xc8;}else{_0xf81fe3=0xce;}_0x456cd4[_0x2296('0x1b')](_0xf81fe3);return _0x456cd4['set']('Content-Range',_0x5304b3+'-'+_0x4bd4f1+'/'+_0x5a0a5d)[_0x2296('0x1d')](_0x414c20);}return null;};}function patchUpdates(_0x1d5e71){return function(_0x162f41){try{jsonpatch[_0x2296('0x22')](_0x162f41,_0x1d5e71,!![]);}catch(_0x2355ab){return BPromise[_0x2296('0x23')](_0x2355ab);}return _0x162f41[_0x2296('0x24')]();};}function saveUpdates(_0x4749e4,_0x234c16){return function(_0x371021){if(_0x371021){return _0x371021[_0x2296('0x25')](_0x4749e4)[_0x2296('0x26')](function(_0x467d0d){return _0x467d0d;});}return null;};}function removeEntity(_0x5342ed,_0x2bcb68){return function(_0x17a852){if(_0x17a852){return _0x17a852['destroy']()[_0x2296('0x26')](function(){_0x5342ed[_0x2296('0x1b')](0xcc)[_0x2296('0x1c')]();});}};}function handleEntityNotFound(_0x2d2797,_0x5c2cd7){return function(_0xc1383e){if(!_0xc1383e){_0x2d2797[_0x2296('0x1a')](0x194);}return _0xc1383e;};}function handleError(_0x445314,_0x585261){_0x585261=_0x585261||0x1f4;return function(_0x3f5cb6){logger[_0x2296('0x27')](_0x3f5cb6[_0x2296('0x28')]);if(_0x3f5cb6['name']){delete _0x3f5cb6[_0x2296('0x29')];}_0x445314[_0x2296('0x1b')](_0x585261)[_0x2296('0x2a')](_0x3f5cb6);};}exports[_0x2296('0x2b')]=function(_0x1a4873,_0x5e1ccb){var _0x5f9fe0={},_0x3baa89={},_0x3a4c6b={'count':0x0,'rows':[]};var _0x1566d3=_[_0x2296('0x2c')](db[_0x2296('0x2d')][_0x2296('0x2e')],function(_0x3143df){return{'name':_0x3143df[_0x2296('0x2f')],'type':_0x3143df[_0x2296('0x30')]['key']};});_0x3baa89[_0x2296('0x31')]=_[_0x2296('0x2c')](_0x1566d3,_0x2296('0x29'));_0x3baa89['query']=_['keys'](_0x1a4873['query']);_0x3baa89[_0x2296('0x32')]=_[_0x2296('0x33')](_0x3baa89['model'],_0x3baa89['query']);_0x5f9fe0[_0x2296('0x34')]=_[_0x2296('0x33')](_0x3baa89['model'],qs['fields'](_0x1a4873[_0x2296('0x35')]['fields']));_0x5f9fe0[_0x2296('0x34')]=_0x5f9fe0[_0x2296('0x34')][_0x2296('0x36')]?_0x5f9fe0[_0x2296('0x34')]:_0x3baa89['model'];if(!_0x1a4873[_0x2296('0x35')][_0x2296('0x37')](_0x2296('0x38'))){_0x5f9fe0[_0x2296('0x20')]=qs[_0x2296('0x20')](_0x1a4873[_0x2296('0x35')][_0x2296('0x20')]);_0x5f9fe0[_0x2296('0x1e')]=qs[_0x2296('0x1e')](_0x1a4873[_0x2296('0x35')]['offset']);}_0x5f9fe0[_0x2296('0x39')]=qs[_0x2296('0x3a')](_0x1a4873[_0x2296('0x35')][_0x2296('0x3a')]);_0x5f9fe0[_0x2296('0x3b')]=qs['filters'](_[_0x2296('0x3c')](_0x1a4873['query'],_0x3baa89[_0x2296('0x32')]),_0x1566d3);if(_0x1a4873['query'][_0x2296('0x3d')]){_0x5f9fe0[_0x2296('0x3b')]=_[_0x2296('0x3e')](_0x5f9fe0[_0x2296('0x3b')],{'$or':_[_0x2296('0x2c')](_0x1566d3,function(_0x30b9e3){if(_0x30b9e3[_0x2296('0x30')]!==_0x2296('0x3f')){var _0x422c79={};_0x422c79[_0x30b9e3[_0x2296('0x29')]]={'$like':'%'+_0x1a4873['query'][_0x2296('0x3d')]+'%'};return _0x422c79;}})});}_0x5f9fe0=_[_0x2296('0x3e')]({},_0x5f9fe0,_0x1a4873[_0x2296('0x40')]);var _0x3918b6={'where':_0x5f9fe0[_0x2296('0x3b')]};return db[_0x2296('0x2d')][_0x2296('0x21')](_0x3918b6)[_0x2296('0x26')](function(_0x3d7a5c){_0x3a4c6b[_0x2296('0x21')]=_0x3d7a5c;if(_0x1a4873[_0x2296('0x35')]['includeAll']){_0x5f9fe0[_0x2296('0x41')]=[{'all':!![]}];}return db[_0x2296('0x2d')][_0x2296('0x42')](_0x5f9fe0);})[_0x2296('0x26')](function(_0x4c21e7){_0x3a4c6b[_0x2296('0x43')]=_0x4c21e7;return _0x3a4c6b;})[_0x2296('0x26')](respondWithFilteredResult(_0x5e1ccb,_0x5f9fe0))[_0x2296('0x44')](handleError(_0x5e1ccb,null));};exports[_0x2296('0x45')]=function(_0xc780fa,_0x31eeb4){var _0x206fba={'raw':![],'where':{'id':_0xc780fa[_0x2296('0x46')]['id']}},_0x1ac8b4={};_0x1ac8b4[_0x2296('0x31')]=_[_0x2296('0x47')](db[_0x2296('0x2d')][_0x2296('0x2e')]);_0x1ac8b4[_0x2296('0x35')]=_[_0x2296('0x47')](_0xc780fa[_0x2296('0x35')]);_0x1ac8b4[_0x2296('0x32')]=_[_0x2296('0x33')](_0x1ac8b4[_0x2296('0x31')],_0x1ac8b4['query']);_0x206fba['attributes']=_['intersection'](_0x1ac8b4['model'],qs[_0x2296('0x48')](_0xc780fa['query']['fields']));_0x206fba[_0x2296('0x34')]=_0x206fba[_0x2296('0x34')][_0x2296('0x36')]?_0x206fba['attributes']:_0x1ac8b4[_0x2296('0x31')];if(_0xc780fa[_0x2296('0x35')][_0x2296('0x49')]){_0x206fba[_0x2296('0x41')]=[{'all':!![]}];}_0x206fba=_[_0x2296('0x3e')]({},_0x206fba,_0xc780fa['options']);return db[_0x2296('0x2d')][_0x2296('0x4a')](_0x206fba)[_0x2296('0x26')](handleEntityNotFound(_0x31eeb4,null))[_0x2296('0x26')](respondWithResult(_0x31eeb4,null))[_0x2296('0x44')](handleError(_0x31eeb4,null));};exports['create']=function(_0x2bbbd6,_0x258f86){return db[_0x2296('0x2d')][_0x2296('0x4b')](_0x2bbbd6['body'],{})[_0x2296('0x26')](respondWithResult(_0x258f86,0xc9))['catch'](handleError(_0x258f86,null));};exports[_0x2296('0x25')]=function(_0x39211c,_0x9cb05){if(_0x39211c[_0x2296('0x4c')]['id']){delete _0x39211c[_0x2296('0x4c')]['id'];}return db[_0x2296('0x2d')]['find']({'where':{'id':_0x39211c[_0x2296('0x46')]['id']}})[_0x2296('0x26')](handleEntityNotFound(_0x9cb05,null))['then'](saveUpdates(_0x39211c[_0x2296('0x4c')],null))[_0x2296('0x26')](respondWithResult(_0x9cb05,null))[_0x2296('0x44')](handleError(_0x9cb05,null));};exports[_0x2296('0x4d')]=function(_0x58ab05,_0x2abab2){return db[_0x2296('0x2d')][_0x2296('0x4a')]({'where':{'id':_0x58ab05[_0x2296('0x46')]['id']}})[_0x2296('0x26')](handleEntityNotFound(_0x2abab2,null))[_0x2296('0x26')](removeEntity(_0x2abab2,null))[_0x2296('0x44')](handleError(_0x2abab2,null));};exports[_0x2296('0x4e')]=function(_0x1c8bd5,_0x404001){return db['VoiceQueueReport']['describe']()[_0x2296('0x26')](respondWithResult(_0x404001,null))[_0x2296('0x44')](handleError(_0x404001,null));};exports['getVoiceQueuesReport']=function(_0x1d5902,_0x3a21e2){var _0x50e80b={},_0x285f2d={},_0x3c0e9a={'count':0x0,'rows':[]};_0x285f2d[_0x2296('0x31')]=_[_0x2296('0x47')](db[_0x2296('0x2d')][_0x2296('0x2e')]);_0x285f2d[_0x2296('0x35')]=_[_0x2296('0x47')](_0x1d5902['query']);_0x285f2d['filters']=_['intersection'](_0x285f2d[_0x2296('0x31')],_0x285f2d[_0x2296('0x35')]);_0x50e80b['attributes']=_['intersection'](_0x285f2d['model'],qs[_0x2296('0x48')](_0x1d5902[_0x2296('0x35')][_0x2296('0x48')]));_0x50e80b[_0x2296('0x34')]=_0x50e80b['attributes']['length']?_0x50e80b[_0x2296('0x34')]:_0x285f2d[_0x2296('0x31')];if(!_0x1d5902[_0x2296('0x35')][_0x2296('0x37')](_0x2296('0x38'))){_0x50e80b['limit']=qs['limit'](_0x1d5902[_0x2296('0x35')]['limit']);_0x50e80b[_0x2296('0x1e')]=qs['offset'](_0x1d5902[_0x2296('0x35')][_0x2296('0x1e')]);}_0x50e80b['order']=qs[_0x2296('0x3a')](_0x1d5902['query'][_0x2296('0x3a')]);_0x50e80b['where']=qs[_0x2296('0x32')](_[_0x2296('0x3c')](_0x1d5902[_0x2296('0x35')],_0x285f2d[_0x2296('0x32')]));if(_0x1d5902['query'][_0x2296('0x3d')]){_0x50e80b[_0x2296('0x3b')]=_[_0x2296('0x3e')](_0x50e80b[_0x2296('0x3b')],{'$or':_[_0x2296('0x2c')](_0x50e80b[_0x2296('0x34')],function(_0x2da4d3){var _0x2e252f={};_0x2e252f[_0x2da4d3]={'$like':'%'+_0x1d5902[_0x2296('0x35')][_0x2296('0x3d')]+'%'};return _0x2e252f;})});}_0x50e80b=_[_0x2296('0x3e')]({},_0x50e80b,_0x1d5902[_0x2296('0x40')]);var _0x5c7ad7={'where':_0x50e80b[_0x2296('0x3b')]};return db[_0x2296('0x2d')][_0x2296('0x21')](_0x5c7ad7)[_0x2296('0x26')](function(_0x4cfab4){_0x3c0e9a[_0x2296('0x21')]=_0x4cfab4;if(_0x1d5902[_0x2296('0x35')]['includeAll']){_0x50e80b['include']=[{'all':!![]}];}return db[_0x2296('0x2d')][_0x2296('0x42')](_0x50e80b);})[_0x2296('0x26')](function(_0x12383d){_0x3c0e9a[_0x2296('0x43')]=_0x12383d;return _0x3c0e9a;})['then'](respondWithFilteredResult(_0x3a21e2,_0x50e80b,_0x2296('0x4f')))['catch'](handleError(_0x3a21e2,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x4a48=['sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','includeAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','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','defaults','redis','localhost','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4a48,0xb5));var _0x84a4=function(_0x4d18d7,_0x46fb3f){_0x4d18d7=_0x4d18d7-0x0;var _0x5cff6a=_0x4a48[_0x4d18d7];return _0x5cff6a;};'use strict';var emlformat=require(_0x84a4('0x0'));var rimraf=require(_0x84a4('0x1'));var zipdir=require(_0x84a4('0x2'));var jsonpatch=require(_0x84a4('0x3'));var rp=require(_0x84a4('0x4'));var moment=require('moment');var BPromise=require(_0x84a4('0x5'));var Mustache=require(_0x84a4('0x6'));var util=require(_0x84a4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x84a4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84a4('0x9'));var squel=require(_0x84a4('0xa'));var crypto=require(_0x84a4('0xb'));var jsforce=require(_0x84a4('0xc'));var deskjs=require(_0x84a4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x84a4('0xe'));var Papa=require(_0x84a4('0xf'));var Redis=require('ioredis');var authService=require(_0x84a4('0x10'));var qs=require(_0x84a4('0x11'));var as=require(_0x84a4('0x12'));var hardwareService=require(_0x84a4('0x13'));var logger=require(_0x84a4('0x14'))(_0x84a4('0x15'));var utils=require('../../config/utils');var config=require(_0x84a4('0x16'));var licenseUtil=require(_0x84a4('0x17'));var db=require(_0x84a4('0x18'))['db'];config['redis']=_[_0x84a4('0x19')](config[_0x84a4('0x1a')],{'host':_0x84a4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84a4('0x1a')]));require('./voiceQueueReport.socket')[_0x84a4('0x1c')](socket);function respondWithStatusCode(_0x3e8c8c,_0x560b4a){_0x560b4a=_0x560b4a||0xcc;return function(_0x17e64a){if(_0x17e64a){return _0x3e8c8c[_0x84a4('0x1d')](_0x560b4a);}return _0x3e8c8c['status'](_0x560b4a)['end']();};}function respondWithResult(_0x281e5c,_0x5a6bea){_0x5a6bea=_0x5a6bea||0xc8;return function(_0x222416){if(_0x222416){return _0x281e5c[_0x84a4('0x1e')](_0x5a6bea)['json'](_0x222416);}};}function respondWithFilteredResult(_0x39f2a3,_0x2e8eb9){return function(_0x146e98){if(_0x146e98){var _0x36d694=typeof _0x2e8eb9['offset']===_0x84a4('0x1f')&&typeof _0x2e8eb9[_0x84a4('0x20')]===_0x84a4('0x1f');var _0x3d85a0=_0x146e98[_0x84a4('0x21')];var _0x5a86b0=_0x36d694?0x0:_0x2e8eb9['offset'];var _0x30f4df=_0x36d694?_0x146e98['count']:_0x2e8eb9[_0x84a4('0x22')]+_0x2e8eb9['limit'];var _0x58f7c1;if(_0x30f4df>=_0x3d85a0){_0x30f4df=_0x3d85a0;_0x58f7c1=0xc8;}else{_0x58f7c1=0xce;}_0x39f2a3[_0x84a4('0x1e')](_0x58f7c1);return _0x39f2a3[_0x84a4('0x23')](_0x84a4('0x24'),_0x5a86b0+'-'+_0x30f4df+'/'+_0x3d85a0)['json'](_0x146e98);}return null;};}function patchUpdates(_0x133d3c){return function(_0x5d270c){try{jsonpatch['apply'](_0x5d270c,_0x133d3c,!![]);}catch(_0x3e2479){return BPromise[_0x84a4('0x25')](_0x3e2479);}return _0x5d270c['save']();};}function saveUpdates(_0x5be809,_0xf2fc23){return function(_0x1d7c19){if(_0x1d7c19){return _0x1d7c19[_0x84a4('0x26')](_0x5be809)[_0x84a4('0x27')](function(_0x85e959){return _0x85e959;});}return null;};}function removeEntity(_0x43d0bc,_0xedb495){return function(_0x3c7f81){if(_0x3c7f81){return _0x3c7f81[_0x84a4('0x28')]()[_0x84a4('0x27')](function(){_0x43d0bc[_0x84a4('0x1e')](0xcc)[_0x84a4('0x29')]();});}};}function handleEntityNotFound(_0x510d54,_0x213793){return function(_0x233a1f){if(!_0x233a1f){_0x510d54[_0x84a4('0x1d')](0x194);}return _0x233a1f;};}function handleError(_0xfc953d,_0x43d1e5){_0x43d1e5=_0x43d1e5||0x1f4;return function(_0x53f13d){logger[_0x84a4('0x2a')](_0x53f13d[_0x84a4('0x2b')]);if(_0x53f13d[_0x84a4('0x2c')]){delete _0x53f13d[_0x84a4('0x2c')];}_0xfc953d['status'](_0x43d1e5)[_0x84a4('0x2d')](_0x53f13d);};}exports[_0x84a4('0x2e')]=function(_0x1f9ad0,_0x122fb5){var _0x1fe261={},_0x37a612={},_0x1f0eb0={'count':0x0,'rows':[]};var _0x33d9aa=_[_0x84a4('0x2f')](db[_0x84a4('0x30')][_0x84a4('0x31')],function(_0x33a3c7){return{'name':_0x33a3c7['fieldName'],'type':_0x33a3c7[_0x84a4('0x32')][_0x84a4('0x33')]};});_0x37a612[_0x84a4('0x34')]=_[_0x84a4('0x2f')](_0x33d9aa,_0x84a4('0x2c'));_0x37a612[_0x84a4('0x35')]=_[_0x84a4('0x36')](_0x1f9ad0['query']);_0x37a612[_0x84a4('0x37')]=_[_0x84a4('0x38')](_0x37a612[_0x84a4('0x34')],_0x37a612['query']);_0x1fe261['attributes']=_[_0x84a4('0x38')](_0x37a612[_0x84a4('0x34')],qs[_0x84a4('0x39')](_0x1f9ad0[_0x84a4('0x35')][_0x84a4('0x39')]));_0x1fe261['attributes']=_0x1fe261[_0x84a4('0x3a')][_0x84a4('0x3b')]?_0x1fe261['attributes']:_0x37a612[_0x84a4('0x34')];if(!_0x1f9ad0[_0x84a4('0x35')][_0x84a4('0x3c')]('nolimit')){_0x1fe261[_0x84a4('0x20')]=qs['limit'](_0x1f9ad0[_0x84a4('0x35')][_0x84a4('0x20')]);_0x1fe261[_0x84a4('0x22')]=qs[_0x84a4('0x22')](_0x1f9ad0[_0x84a4('0x35')]['offset']);}_0x1fe261[_0x84a4('0x3d')]=qs[_0x84a4('0x3e')](_0x1f9ad0[_0x84a4('0x35')][_0x84a4('0x3e')]);_0x1fe261[_0x84a4('0x3f')]=qs[_0x84a4('0x37')](_[_0x84a4('0x40')](_0x1f9ad0[_0x84a4('0x35')],_0x37a612[_0x84a4('0x37')]),_0x33d9aa);if(_0x1f9ad0[_0x84a4('0x35')][_0x84a4('0x41')]){_0x1fe261['where']=_[_0x84a4('0x42')](_0x1fe261[_0x84a4('0x3f')],{'$or':_[_0x84a4('0x2f')](_0x33d9aa,function(_0x287041){if(_0x287041[_0x84a4('0x32')]!==_0x84a4('0x43')){var _0x119f21={};_0x119f21[_0x287041[_0x84a4('0x2c')]]={'$like':'%'+_0x1f9ad0['query']['filter']+'%'};return _0x119f21;}})});}_0x1fe261=_['merge']({},_0x1fe261,_0x1f9ad0[_0x84a4('0x44')]);var _0x5a966={'where':_0x1fe261[_0x84a4('0x3f')]};return db['VoiceQueueReport']['count'](_0x5a966)[_0x84a4('0x27')](function(_0x3e0270){_0x1f0eb0[_0x84a4('0x21')]=_0x3e0270;if(_0x1f9ad0[_0x84a4('0x35')]['includeAll']){_0x1fe261[_0x84a4('0x45')]=[{'all':!![]}];}return db[_0x84a4('0x30')][_0x84a4('0x46')](_0x1fe261);})[_0x84a4('0x27')](function(_0x4d46f5){_0x1f0eb0[_0x84a4('0x47')]=_0x4d46f5;return _0x1f0eb0;})[_0x84a4('0x27')](respondWithFilteredResult(_0x122fb5,_0x1fe261))[_0x84a4('0x48')](handleError(_0x122fb5,null));};exports[_0x84a4('0x49')]=function(_0x4d1557,_0x13de99){var _0x170f8c={'raw':![],'where':{'id':_0x4d1557[_0x84a4('0x4a')]['id']}},_0x2fa50e={};_0x2fa50e[_0x84a4('0x34')]=_[_0x84a4('0x36')](db[_0x84a4('0x30')][_0x84a4('0x31')]);_0x2fa50e['query']=_[_0x84a4('0x36')](_0x4d1557[_0x84a4('0x35')]);_0x2fa50e['filters']=_[_0x84a4('0x38')](_0x2fa50e['model'],_0x2fa50e[_0x84a4('0x35')]);_0x170f8c['attributes']=_[_0x84a4('0x38')](_0x2fa50e[_0x84a4('0x34')],qs[_0x84a4('0x39')](_0x4d1557[_0x84a4('0x35')][_0x84a4('0x39')]));_0x170f8c['attributes']=_0x170f8c[_0x84a4('0x3a')]['length']?_0x170f8c[_0x84a4('0x3a')]:_0x2fa50e[_0x84a4('0x34')];if(_0x4d1557[_0x84a4('0x35')]['includeAll']){_0x170f8c[_0x84a4('0x45')]=[{'all':!![]}];}_0x170f8c=_[_0x84a4('0x42')]({},_0x170f8c,_0x4d1557[_0x84a4('0x44')]);return db[_0x84a4('0x30')][_0x84a4('0x4b')](_0x170f8c)['then'](handleEntityNotFound(_0x13de99,null))['then'](respondWithResult(_0x13de99,null))[_0x84a4('0x48')](handleError(_0x13de99,null));};exports[_0x84a4('0x4c')]=function(_0x2048d4,_0x5ab937){return db[_0x84a4('0x30')]['create'](_0x2048d4[_0x84a4('0x4d')],{})[_0x84a4('0x27')](respondWithResult(_0x5ab937,0xc9))[_0x84a4('0x48')](handleError(_0x5ab937,null));};exports[_0x84a4('0x26')]=function(_0x19100e,_0x31981b){if(_0x19100e[_0x84a4('0x4d')]['id']){delete _0x19100e[_0x84a4('0x4d')]['id'];}return db[_0x84a4('0x30')][_0x84a4('0x4b')]({'where':{'id':_0x19100e[_0x84a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31981b,null))[_0x84a4('0x27')](saveUpdates(_0x19100e[_0x84a4('0x4d')],null))['then'](respondWithResult(_0x31981b,null))[_0x84a4('0x48')](handleError(_0x31981b,null));};exports[_0x84a4('0x28')]=function(_0x2a175e,_0x97236){return db[_0x84a4('0x30')][_0x84a4('0x4b')]({'where':{'id':_0x2a175e[_0x84a4('0x4a')]['id']}})[_0x84a4('0x27')](handleEntityNotFound(_0x97236,null))[_0x84a4('0x27')](removeEntity(_0x97236,null))[_0x84a4('0x48')](handleError(_0x97236,null));};exports[_0x84a4('0x4e')]=function(_0x3eb68b,_0x222ff6){return db[_0x84a4('0x30')][_0x84a4('0x4e')]()[_0x84a4('0x27')](respondWithResult(_0x222ff6,null))['catch'](handleError(_0x222ff6,null));};exports['getVoiceQueuesReport']=function(_0xc2b6a5,_0x1c77c1){var _0x1a5d77={},_0x57d3bd={},_0x47fee1={'count':0x0,'rows':[]};_0x57d3bd[_0x84a4('0x34')]=_['keys'](db[_0x84a4('0x30')]['rawAttributes']);_0x57d3bd[_0x84a4('0x35')]=_[_0x84a4('0x36')](_0xc2b6a5[_0x84a4('0x35')]);_0x57d3bd['filters']=_[_0x84a4('0x38')](_0x57d3bd[_0x84a4('0x34')],_0x57d3bd[_0x84a4('0x35')]);_0x1a5d77['attributes']=_['intersection'](_0x57d3bd[_0x84a4('0x34')],qs[_0x84a4('0x39')](_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x39')]));_0x1a5d77[_0x84a4('0x3a')]=_0x1a5d77[_0x84a4('0x3a')][_0x84a4('0x3b')]?_0x1a5d77[_0x84a4('0x3a')]:_0x57d3bd['model'];if(!_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x3c')]('nolimit')){_0x1a5d77['limit']=qs['limit'](_0xc2b6a5['query'][_0x84a4('0x20')]);_0x1a5d77[_0x84a4('0x22')]=qs[_0x84a4('0x22')](_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x22')]);}_0x1a5d77[_0x84a4('0x3d')]=qs['sort'](_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x3e')]);_0x1a5d77[_0x84a4('0x3f')]=qs[_0x84a4('0x37')](_['pick'](_0xc2b6a5['query'],_0x57d3bd[_0x84a4('0x37')]));if(_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x41')]){_0x1a5d77['where']=_[_0x84a4('0x42')](_0x1a5d77[_0x84a4('0x3f')],{'$or':_[_0x84a4('0x2f')](_0x1a5d77[_0x84a4('0x3a')],function(_0x20d6bf){var _0x47f945={};_0x47f945[_0x20d6bf]={'$like':'%'+_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x41')]+'%'};return _0x47f945;})});}_0x1a5d77=_[_0x84a4('0x42')]({},_0x1a5d77,_0xc2b6a5[_0x84a4('0x44')]);var _0x17e7c9={'where':_0x1a5d77[_0x84a4('0x3f')]};return db['VoiceQueueReport']['count'](_0x17e7c9)[_0x84a4('0x27')](function(_0x3cab91){_0x47fee1['count']=_0x3cab91;if(_0xc2b6a5[_0x84a4('0x35')][_0x84a4('0x4f')]){_0x1a5d77[_0x84a4('0x45')]=[{'all':!![]}];}return db[_0x84a4('0x30')]['findAll'](_0x1a5d77);})[_0x84a4('0x27')](function(_0x59161a){_0x47fee1['rows']=_0x59161a;return _0x47fee1;})[_0x84a4('0x27')](respondWithFilteredResult(_0x1c77c1,_0x1a5d77,_0x84a4('0x50')))['catch'](handleError(_0x1c77c1,null,_0x84a4('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 3335d4c..5e92845 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 _0x080f=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x080f,0x117));var _0xf080=function(_0x2151da,_0x4e6a48){_0x2151da=_0x2151da-0x0;var _0x2dc595=_0x080f[_0x2151da];return _0x2dc595;};'use strict';var EventEmitter=require(_0xf080('0x0'));var VoiceQueueReport=require(_0xf080('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf080('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf080('0x3'),'afterDestroy':_0xf080('0x4')};function emitEvent(_0x55f470){return function(_0x36868d,_0x1d11ed,_0x8fcc3c){VoiceQueueReportEvents[_0xf080('0x5')](_0x55f470+':'+_0x36868d['id'],_0x36868d);VoiceQueueReportEvents[_0xf080('0x5')](_0x55f470,_0x36868d);_0x8fcc3c(null);};}for(var e in events){if(events[_0xf080('0x6')](e)){var event=events[e];VoiceQueueReport[_0xf080('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xea2e=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hook','exports','events'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0xea2e,0x67));var _0xeea2=function(_0x46a4e9,_0x1ba3f9){_0x46a4e9=_0x46a4e9-0x0;var _0x5931ed=_0xea2e[_0x46a4e9];return _0x5931ed;};'use strict';var EventEmitter=require(_0xeea2('0x0'));var VoiceQueueReport=require(_0xeea2('0x1'))['db'][_0xeea2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeea2('0x3')](0x0);var events={'afterCreate':_0xeea2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2bed7d){return function(_0x2d1e58,_0x4a93fd,_0x271090){VoiceQueueReportEvents[_0xeea2('0x5')](_0x2bed7d+':'+_0x2d1e58['id'],_0x2d1e58);VoiceQueueReportEvents[_0xeea2('0x5')](_0x2bed7d,_0x2d1e58);_0x271090(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xeea2('0x6')](e,emitEvent(event));}}module[_0xeea2('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 374ad93..a4ef540 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 _0x022e=['../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid','calleridnum','lodash','../../config/logger','request-promise','path'];(function(_0x27f024,_0x5ade12){var _0x4410fd=function(_0x471264){while(--_0x471264){_0x27f024['push'](_0x27f024['shift']());}};_0x4410fd(++_0x5ade12);}(_0x022e,0xc4));var _0xe022=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x022e[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xe022('0x0'));var util=require('util');var logger=require(_0xe022('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe022('0x2'));var fs=require('fs');var path=require(_0xe022('0x3'));var rimraf=require('rimraf');var config=require(_0xe022('0x4'));var attributes=require(_0xe022('0x5'));module[_0xe022('0x6')]=function(_0x491aa7,_0x5ca8d6){return _0x491aa7[_0xe022('0x7')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe022('0x8')]},{'fields':[_0xe022('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e6=['uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0xa9e6,0x160));var _0x6a9e=function(_0x2d92eb,_0x2ee6dc){_0x2d92eb=_0x2d92eb-0x0;var _0x4dd5f=_0xa9e6[_0x2d92eb];return _0x4dd5f;};'use strict';var _=require(_0x6a9e('0x0'));var util=require(_0x6a9e('0x1'));var logger=require(_0x6a9e('0x2'))(_0x6a9e('0x3'));var moment=require(_0x6a9e('0x4'));var BPromise=require('bluebird');var rp=require(_0x6a9e('0x5'));var fs=require('fs');var path=require(_0x6a9e('0x6'));var rimraf=require(_0x6a9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a9e('0x8'));module[_0x6a9e('0x9')]=function(_0x314286,_0x4a9d2b){return _0x314286['define'](_0x6a9e('0xa'),attributes,{'tableName':_0x6a9e('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6a9e('0xc')]},{'fields':[_0x6a9e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 0159aba..9fce057 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 _0xec0a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','catch','lodash'];(function(_0x1be238,_0x4869c3){var _0x37d0f5=function(_0x479028){while(--_0x479028){_0x1be238['push'](_0x1be238['shift']());}};_0x37d0f5(++_0x4869c3);}(_0xec0a,0xe0));var _0xaec0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xec0a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xaec0('0x0'));var util=require('util');var moment=require(_0xaec0('0x1'));var BPromise=require(_0xaec0('0x2'));var rs=require(_0xaec0('0x3'));var fs=require('fs');var Redis=require(_0xaec0('0x4'));var db=require(_0xaec0('0x5'))['db'];var utils=require(_0xaec0('0x6'));var logger=require('../../config/logger')(_0xaec0('0x7'));var config=require(_0xaec0('0x8'));var jayson=require(_0xaec0('0x9'));var client=jayson[_0xaec0('0xa')][_0xaec0('0xb')]({'port':0x232a});config[_0xaec0('0xc')]=_[_0xaec0('0xd')](config[_0xaec0('0xc')],{'host':_0xaec0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaec0('0xc')]));require(_0xaec0('0xf'))[_0xaec0('0x10')](socket);function respondWithRpcPromise(_0x47e84e,_0x4832d9,_0x5e2e4c){return new BPromise(function(_0x1daaaf,_0x25000a){return client[_0xaec0('0x11')](_0x47e84e,_0x5e2e4c)[_0xaec0('0x12')](function(_0x3deaeb){logger['info'](_0xaec0('0x13'),_0x4832d9,_0xaec0('0x14'));logger[_0xaec0('0x15')](_0xaec0('0x16'),_0x4832d9,_0xaec0('0x14'),JSON[_0xaec0('0x17')](_0x3deaeb));if(_0x3deaeb['error']){if(_0x3deaeb['error'][_0xaec0('0x18')]===0x1f4){logger[_0xaec0('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x4832d9,_0x3deaeb[_0xaec0('0x19')]['message']);return _0x25000a(_0x3deaeb[_0xaec0('0x19')]['message']);}logger[_0xaec0('0x19')](_0xaec0('0x13'),_0x4832d9,_0x3deaeb[_0xaec0('0x19')][_0xaec0('0x1a')]);return _0x1daaaf(_0x3deaeb[_0xaec0('0x19')][_0xaec0('0x1a')]);}else{logger[_0xaec0('0x1b')](_0xaec0('0x13'),_0x4832d9,_0xaec0('0x14'));_0x1daaaf(_0x3deaeb[_0xaec0('0x1c')][_0xaec0('0x1a')]);}})['catch'](function(_0x265e2e){logger['error'](_0xaec0('0x13'),_0x4832d9,_0x265e2e);_0x25000a(_0x265e2e);});});}exports[_0xaec0('0x1d')]=function(_0x1ee030){var _0x1f1d74=this;return new Promise(function(_0x5ebab7,_0x384c83){return db[_0xaec0('0x1e')][_0xaec0('0x1f')]({'raw':_0x1ee030[_0xaec0('0x20')]?_0x1ee030[_0xaec0('0x20')][_0xaec0('0x21')]===undefined?!![]:![]:!![],'where':_0x1ee030[_0xaec0('0x20')]?_0x1ee030[_0xaec0('0x20')][_0xaec0('0x22')]||null:null,'attributes':_0x1ee030[_0xaec0('0x20')]?_0x1ee030[_0xaec0('0x20')]['attributes']||null:null,'limit':_0x1ee030['options']?_0x1ee030[_0xaec0('0x20')][_0xaec0('0x23')]||null:null,'include':_0x1ee030[_0xaec0('0x20')]?_0x1ee030['options'][_0xaec0('0x24')]?_[_0xaec0('0x25')](_0x1ee030[_0xaec0('0x20')][_0xaec0('0x24')],function(_0x4c28cd){return{'model':db[_0x4c28cd[_0xaec0('0x26')]],'as':_0x4c28cd['as'],'attributes':_0x4c28cd[_0xaec0('0x27')],'include':_0x4c28cd[_0xaec0('0x24')]?_[_0xaec0('0x25')](_0x4c28cd[_0xaec0('0x24')],function(_0x54e4c9){return{'model':db[_0x54e4c9[_0xaec0('0x26')]],'as':_0x54e4c9['as'],'attributes':_0x54e4c9[_0xaec0('0x27')],'include':_0x54e4c9[_0xaec0('0x24')]?_['map'](_0x54e4c9[_0xaec0('0x24')],function(_0x182954){return{'model':db[_0x182954['model']],'as':_0x182954['as'],'attributes':_0x182954['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22cab8){logger[_0xaec0('0x1b')](_0xaec0('0x1d'),_0x1ee030);logger[_0xaec0('0x15')](_0xaec0('0x1d'),_0x1ee030,JSON[_0xaec0('0x17')](_0x22cab8));_0x5ebab7(_0x22cab8);})['catch'](function(_0xe9fbc3){logger[_0xaec0('0x19')](_0xaec0('0x1d'),_0xe9fbc3[_0xaec0('0x1a')],_0x1ee030);_0x384c83(_0x1f1d74[_0xaec0('0x19')](0x1f4,_0xe9fbc3[_0xaec0('0x1a')]));});});};exports[_0xaec0('0x28')]=function(_0x27ea2c){var _0x44020f=this;return new Promise(function(_0x120e0e,_0x2edae5){return db[_0xaec0('0x1e')][_0xaec0('0x29')](_0x27ea2c['body'],{'raw':_0x27ea2c['options']?_0x27ea2c['options'][_0xaec0('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x1d7be3){logger[_0xaec0('0x1b')](_0xaec0('0x28'),_0x27ea2c);logger[_0xaec0('0x15')](_0xaec0('0x28'),_0x27ea2c,JSON[_0xaec0('0x17')](_0x1d7be3));_0x120e0e(_0x1d7be3);})['catch'](function(_0x3602c4){logger[_0xaec0('0x19')](_0xaec0('0x28'),_0x3602c4[_0xaec0('0x1a')],_0x27ea2c);_0x2edae5(_0x44020f[_0xaec0('0x19')](0x1f4,_0x3602c4['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x47f0a7){var _0x430d4a=this;return new Promise(function(_0x34cf8b,_0xf802bf){return db[_0xaec0('0x1e')]['update'](_0x47f0a7[_0xaec0('0x2a')],{'raw':_0x47f0a7['options']?_0x47f0a7[_0xaec0('0x20')][_0xaec0('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47f0a7['options']?_0x47f0a7[_0xaec0('0x20')][_0xaec0('0x22')]||null:null,'attributes':_0x47f0a7[_0xaec0('0x20')]?_0x47f0a7[_0xaec0('0x20')][_0xaec0('0x27')]||null:null,'limit':_0x47f0a7['options']?_0x47f0a7[_0xaec0('0x20')][_0xaec0('0x23')]||null:null})['then'](function(_0x1c36de){logger[_0xaec0('0x1b')](_0xaec0('0x2b'),_0x47f0a7);logger[_0xaec0('0x15')](_0xaec0('0x2b'),_0x47f0a7,JSON['stringify'](_0x1c36de));_0x34cf8b(_0x1c36de);})[_0xaec0('0x2c')](function(_0xab6489){logger[_0xaec0('0x19')]('UpdateVoiceQueueReport',_0xab6489[_0xaec0('0x1a')],_0x47f0a7);_0xf802bf(_0x430d4a[_0xaec0('0x19')](0x1f4,_0xab6489[_0xaec0('0x1a')]));});});}; \ No newline at end of file +var _0x07ac=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','raw','UpdateVoiceQueueReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5a79b0,_0x3d0bb1){var _0x1f1159=function(_0x5641d7){while(--_0x5641d7){_0x5a79b0['push'](_0x5a79b0['shift']());}};_0x1f1159(++_0x3d0bb1);}(_0x07ac,0x13c));var _0xc07a=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x07ac[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require('lodash');var util=require(_0xc07a('0x0'));var moment=require(_0xc07a('0x1'));var BPromise=require(_0xc07a('0x2'));var rs=require(_0xc07a('0x3'));var fs=require('fs');var Redis=require(_0xc07a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc07a('0x5'));var logger=require(_0xc07a('0x6'))(_0xc07a('0x7'));var config=require(_0xc07a('0x8'));var jayson=require(_0xc07a('0x9'));var client=jayson['client'][_0xc07a('0xa')]({'port':0x232a});config[_0xc07a('0xb')]=_[_0xc07a('0xc')](config[_0xc07a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc07a('0xd'))(new Redis(config['redis']));require(_0xc07a('0xe'))[_0xc07a('0xf')](socket);function respondWithRpcPromise(_0x576e22,_0x41b263,_0x15ba80){return new BPromise(function(_0x3513eb,_0xff1520){return client['request'](_0x576e22,_0x15ba80)[_0xc07a('0x10')](function(_0x16f81b){logger[_0xc07a('0x11')](_0xc07a('0x12'),_0x41b263,_0xc07a('0x13'));logger[_0xc07a('0x14')](_0xc07a('0x15'),_0x41b263,_0xc07a('0x13'),JSON[_0xc07a('0x16')](_0x16f81b));if(_0x16f81b['error']){if(_0x16f81b[_0xc07a('0x17')][_0xc07a('0x18')]===0x1f4){logger[_0xc07a('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x41b263,_0x16f81b[_0xc07a('0x17')][_0xc07a('0x19')]);return _0xff1520(_0x16f81b[_0xc07a('0x17')][_0xc07a('0x19')]);}logger['error'](_0xc07a('0x12'),_0x41b263,_0x16f81b[_0xc07a('0x17')][_0xc07a('0x19')]);return _0x3513eb(_0x16f81b[_0xc07a('0x17')][_0xc07a('0x19')]);}else{logger[_0xc07a('0x11')](_0xc07a('0x12'),_0x41b263,_0xc07a('0x13'));_0x3513eb(_0x16f81b[_0xc07a('0x1a')][_0xc07a('0x19')]);}})[_0xc07a('0x1b')](function(_0x2bc96b){logger[_0xc07a('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x41b263,_0x2bc96b);_0xff1520(_0x2bc96b);});});}exports[_0xc07a('0x1c')]=function(_0x491f12){var _0x1f69f1=this;return new Promise(function(_0xae7b25,_0xb79081){return db[_0xc07a('0x1d')][_0xc07a('0x1e')]({'raw':_0x491f12[_0xc07a('0x1f')]?_0x491f12[_0xc07a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x491f12[_0xc07a('0x1f')]?_0x491f12[_0xc07a('0x1f')][_0xc07a('0x20')]||null:null,'attributes':_0x491f12[_0xc07a('0x1f')]?_0x491f12[_0xc07a('0x1f')][_0xc07a('0x21')]||null:null,'limit':_0x491f12[_0xc07a('0x1f')]?_0x491f12[_0xc07a('0x1f')][_0xc07a('0x22')]||null:null,'include':_0x491f12['options']?_0x491f12['options'][_0xc07a('0x23')]?_[_0xc07a('0x24')](_0x491f12[_0xc07a('0x1f')]['include'],function(_0x44ea25){return{'model':db[_0x44ea25[_0xc07a('0x25')]],'as':_0x44ea25['as'],'attributes':_0x44ea25[_0xc07a('0x21')],'include':_0x44ea25[_0xc07a('0x23')]?_[_0xc07a('0x24')](_0x44ea25[_0xc07a('0x23')],function(_0x57d99e){return{'model':db[_0x57d99e[_0xc07a('0x25')]],'as':_0x57d99e['as'],'attributes':_0x57d99e[_0xc07a('0x21')],'include':_0x57d99e[_0xc07a('0x23')]?_['map'](_0x57d99e['include'],function(_0x2f1b38){return{'model':db[_0x2f1b38[_0xc07a('0x25')]],'as':_0x2f1b38['as'],'attributes':_0x2f1b38[_0xc07a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb5f292){logger['info']('GetVoiceQueueReport',_0x491f12);logger[_0xc07a('0x14')](_0xc07a('0x1c'),_0x491f12,JSON[_0xc07a('0x16')](_0xb5f292));_0xae7b25(_0xb5f292);})[_0xc07a('0x1b')](function(_0x4c2109){logger[_0xc07a('0x17')](_0xc07a('0x1c'),_0x4c2109[_0xc07a('0x19')],_0x491f12);_0xb79081(_0x1f69f1[_0xc07a('0x17')](0x1f4,_0x4c2109[_0xc07a('0x19')]));});});};exports[_0xc07a('0x26')]=function(_0x161dae){var _0x3d0c42=this;return new Promise(function(_0x3d1805,_0x2410f2){return db[_0xc07a('0x1d')][_0xc07a('0x27')](_0x161dae['body'],{'raw':_0x161dae[_0xc07a('0x1f')]?_0x161dae[_0xc07a('0x1f')][_0xc07a('0x28')]===undefined?!![]:![]:!![]})[_0xc07a('0x10')](function(_0x32fedb){logger[_0xc07a('0x11')](_0xc07a('0x26'),_0x161dae);logger['debug'](_0xc07a('0x26'),_0x161dae,JSON[_0xc07a('0x16')](_0x32fedb));_0x3d1805(_0x32fedb);})[_0xc07a('0x1b')](function(_0x6d5b8c){logger[_0xc07a('0x17')](_0xc07a('0x26'),_0x6d5b8c[_0xc07a('0x19')],_0x161dae);_0x2410f2(_0x3d0c42[_0xc07a('0x17')](0x1f4,_0x6d5b8c[_0xc07a('0x19')]));});});};exports[_0xc07a('0x29')]=function(_0x56d621){var _0xd7cf74=this;return new Promise(function(_0x2b295e,_0x5b3d10){return db[_0xc07a('0x1d')][_0xc07a('0x2a')](_0x56d621['body'],{'raw':_0x56d621['options']?_0x56d621[_0xc07a('0x1f')][_0xc07a('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56d621[_0xc07a('0x1f')]?_0x56d621['options']['where']||null:null,'attributes':_0x56d621[_0xc07a('0x1f')]?_0x56d621[_0xc07a('0x1f')][_0xc07a('0x21')]||null:null,'limit':_0x56d621[_0xc07a('0x1f')]?_0x56d621[_0xc07a('0x1f')]['limit']||null:null})[_0xc07a('0x10')](function(_0x5cabfa){logger[_0xc07a('0x11')](_0xc07a('0x29'),_0x56d621);logger[_0xc07a('0x14')](_0xc07a('0x29'),_0x56d621,JSON[_0xc07a('0x16')](_0x5cabfa));_0x2b295e(_0x5cabfa);})['catch'](function(_0x2b1823){logger[_0xc07a('0x17')]('UpdateVoiceQueueReport',_0x2b1823[_0xc07a('0x19')],_0x56d621);_0x5b3d10(_0xd7cf74['error'](0x1f4,_0x2b1823['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e534f70..52cd9f6 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 _0x7429=['register','length','voiceQueueReport:','remove','emit','removeListener'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7429,0x6f));var _0x9742=function(_0x57ad89,_0x44bede){_0x57ad89=_0x57ad89-0x0;var _0x4b4486=_0x7429[_0x57ad89];return _0x4b4486;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x9742('0x0'),'update'];function createListener(_0xd6ed3d,_0x33fdc8){return function(_0x51aa52){_0x33fdc8[_0x9742('0x1')](_0xd6ed3d,_0x51aa52);};}function removeListener(_0x1b74f8,_0x3f19a6){return function(){VoiceQueueReportEvents[_0x9742('0x2')](_0x1b74f8,_0x3f19a6);};}exports[_0x9742('0x3')]=function(_0x5a1528){for(var _0x5a7ef9=0x0,_0xaae8db=events[_0x9742('0x4')];_0x5a7ef9<_0xaae8db;_0x5a7ef9++){var _0x4ead4b=events[_0x5a7ef9];var _0x240a9f=createListener(_0x9742('0x5')+_0x4ead4b,_0x5a1528);VoiceQueueReportEvents['on'](_0x4ead4b,_0x240a9f);}}; \ No newline at end of file +var _0x24ce=['register','voiceQueueReport:','save','remove','update','emit','removeListener'];(function(_0x506bba,_0x43a5de){var _0x38a8a0=function(_0x12bffb){while(--_0x12bffb){_0x506bba['push'](_0x506bba['shift']());}};_0x38a8a0(++_0x43a5de);}(_0x24ce,0x1de));var _0xe24c=function(_0x501c39,_0x27dd59){_0x501c39=_0x501c39-0x0;var _0x235cc6=_0x24ce[_0x501c39];return _0x235cc6;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe24c('0x0'),_0xe24c('0x1'),_0xe24c('0x2')];function createListener(_0x1ce128,_0x493bd8){return function(_0x5d60b2){_0x493bd8[_0xe24c('0x3')](_0x1ce128,_0x5d60b2);};}function removeListener(_0x48f802,_0x4d6727){return function(){VoiceQueueReportEvents[_0xe24c('0x4')](_0x48f802,_0x4d6727);};}exports[_0xe24c('0x5')]=function(_0x6f92e0){for(var _0x1ac59c=0x0,_0xe1d970=events['length'];_0x1ac59c<_0xe1d970;_0x1ac59c++){var _0x6d00e=events[_0x1ac59c];var _0x2d8dde=createListener(_0xe24c('0x6')+_0x6d00e,_0x6f92e0);VoiceQueueReportEvents['on'](_0x6d00e,_0x2d8dde);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ccdafc1..b6fe0b3 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 _0x0993=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x316371,_0x3c225f){var _0x576f72=function(_0x109308){while(--_0x109308){_0x316371['push'](_0x316371['shift']());}};_0x576f72(++_0x3c225f);}(_0x0993,0x13c));var _0x3099=function(_0x1cc197,_0xf3ac01){_0x1cc197=_0x1cc197-0x0;var _0x336d9f=_0x0993[_0x1cc197];return _0x336d9f;};'use strict';var multer=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var path=require(_0x3099('0x2'));var timeout=require(_0x3099('0x3'));var express=require(_0x3099('0x4'));var router=express[_0x3099('0x5')]();var fs_extra=require(_0x3099('0x6'));var auth=require(_0x3099('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3099('0x8'));var controller=require(_0x3099('0x9'));router[_0x3099('0xa')]('/',auth[_0x3099('0xb')](),controller['index']);router['get'](_0x3099('0xc'),auth[_0x3099('0xb')](),controller['show']);router[_0x3099('0xd')]('/',auth[_0x3099('0xb')](),controller[_0x3099('0xe')]);router[_0x3099('0xf')](_0x3099('0xc'),auth[_0x3099('0xb')](),controller['update']);router[_0x3099('0x10')]('/:id',auth[_0x3099('0xb')](),controller['destroy']);module[_0x3099('0x11')]=router; \ No newline at end of file +var _0x76cd=['isAuthenticated','get','show','post','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x495d83,_0x4f86ac){var _0x5e803f=function(_0x465ebc){while(--_0x465ebc){_0x495d83['push'](_0x495d83['shift']());}};_0x5e803f(++_0x4f86ac);}(_0x76cd,0x1b7));var _0xd76c=function(_0x336c,_0x16c44f){_0x336c=_0x336c-0x0;var _0x31d4c6=_0x76cd[_0x336c];return _0x31d4c6;};'use strict';var multer=require(_0xd76c('0x0'));var util=require(_0xd76c('0x1'));var path=require(_0xd76c('0x2'));var timeout=require(_0xd76c('0x3'));var express=require(_0xd76c('0x4'));var router=express[_0xd76c('0x5')]();var fs_extra=require(_0xd76c('0x6'));var auth=require(_0xd76c('0x7'));var interaction=require(_0xd76c('0x8'));var config=require(_0xd76c('0x9'));var controller=require(_0xd76c('0xa'));router['get']('/',auth[_0xd76c('0xb')](),controller['index']);router[_0xd76c('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd76c('0xd')]);router[_0xd76c('0xe')]('/',auth[_0xd76c('0xb')](),controller['create']);router[_0xd76c('0xf')](_0xd76c('0x10'),auth[_0xd76c('0xb')](),controller['update']);router['delete'](_0xd76c('0x10'),auth[_0xd76c('0xb')](),controller['destroy']);module[_0xd76c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6e7a7f0..02ba07a 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 _0x6f58=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x6f58,0xaa));var _0x86f5=function(_0x5d83f6,_0xf2b374){_0x5d83f6=_0x5d83f6-0x0;var _0x3b0492=_0x6f58[_0x5d83f6];return _0x3b0492;};'use strict';var Sequelize=require(_0x86f5('0x0'));var moment=require(_0x86f5('0x1'));module[_0x86f5('0x2')]={'time':{'type':Sequelize[_0x86f5('0x3')]},'callid':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x86f5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x86f5('0x4')](_0x86f5('0x5'))}}; \ No newline at end of file +var _0x0379=['sequelize','moment','STRING','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2bbfbb,_0x4b0723){var _0x4ad9dd=function(_0x112498){while(--_0x112498){_0x2bbfbb['push'](_0x2bbfbb['shift']());}};_0x4ad9dd(++_0x4b0723);}(_0x0379,0xe8));var _0x9037=function(_0x14d68d,_0x19141f){_0x14d68d=_0x14d68d-0x0;var _0x46e9c2=_0x0379[_0x14d68d];return _0x46e9c2;};'use strict';var Sequelize=require(_0x9037('0x0'));var moment=require(_0x9037('0x1'));module['exports']={'time':{'type':Sequelize[_0x9037('0x2')]},'callid':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9037('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()['format'](_0x9037('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 5b9eb36..8b88669 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 _0x20bc=['intersection','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x338891,_0x171613){var _0x3b76c6=function(_0x910ece){while(--_0x910ece){_0x338891['push'](_0x338891['shift']());}};_0x3b76c6(++_0x171613);}(_0x20bc,0xdf));var _0xc20b=function(_0x5e8d3a,_0x2ac363){_0x5e8d3a=_0x5e8d3a-0x0;var _0x3a0dbb=_0x20bc[_0x5e8d3a];return _0x3a0dbb;};'use strict';var emlformat=require(_0xc20b('0x0'));var rimraf=require(_0xc20b('0x1'));var zipdir=require(_0xc20b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc20b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc20b('0x4'));var util=require(_0xc20b('0x5'));var path=require(_0xc20b('0x6'));var sox=require(_0xc20b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc20b('0x8'));var _=require(_0xc20b('0x9'));var squel=require('squel');var crypto=require(_0xc20b('0xa'));var jsforce=require(_0xc20b('0xb'));var deskjs=require(_0xc20b('0xc'));var toCsv=require(_0xc20b('0xd'));var querystring=require(_0xc20b('0xe'));var Papa=require('papaparse');var Redis=require(_0xc20b('0xf'));var authService=require(_0xc20b('0x10'));var qs=require(_0xc20b('0x11'));var as=require(_0xc20b('0x12'));var hardwareService=require(_0xc20b('0x13'));var logger=require(_0xc20b('0x14'))(_0xc20b('0x15'));var utils=require(_0xc20b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc20b('0x17'))['db'];function respondWithStatusCode(_0x1b3908,_0x3f716c){_0x3f716c=_0x3f716c||0xcc;return function(_0x238e34){if(_0x238e34){return _0x1b3908[_0xc20b('0x18')](_0x3f716c);}return _0x1b3908[_0xc20b('0x19')](_0x3f716c)[_0xc20b('0x1a')]();};}function respondWithResult(_0x1e6b65,_0x84a90f){_0x84a90f=_0x84a90f||0xc8;return function(_0x6e7c48){if(_0x6e7c48){return _0x1e6b65[_0xc20b('0x19')](_0x84a90f)[_0xc20b('0x1b')](_0x6e7c48);}};}function respondWithFilteredResult(_0x5840fa,_0x30724e){return function(_0x293cb3){if(_0x293cb3){var _0x2e8644=typeof _0x30724e['offset']===_0xc20b('0x1c')&&typeof _0x30724e[_0xc20b('0x1d')]===_0xc20b('0x1c');var _0xad4aab=_0x293cb3[_0xc20b('0x1e')];var _0x5637fe=_0x2e8644?0x0:_0x30724e[_0xc20b('0x1f')];var _0x15de32=_0x2e8644?_0x293cb3[_0xc20b('0x1e')]:_0x30724e['offset']+_0x30724e[_0xc20b('0x1d')];var _0x4dbe39;if(_0x15de32>=_0xad4aab){_0x15de32=_0xad4aab;_0x4dbe39=0xc8;}else{_0x4dbe39=0xce;}_0x5840fa[_0xc20b('0x19')](_0x4dbe39);return _0x5840fa['set'](_0xc20b('0x20'),_0x5637fe+'-'+_0x15de32+'/'+_0xad4aab)[_0xc20b('0x1b')](_0x293cb3);}return null;};}function patchUpdates(_0x291bf6){return function(_0x34dcb3){try{jsonpatch[_0xc20b('0x21')](_0x34dcb3,_0x291bf6,!![]);}catch(_0x32cfc1){return BPromise[_0xc20b('0x22')](_0x32cfc1);}return _0x34dcb3[_0xc20b('0x23')]();};}function saveUpdates(_0x17e308,_0x25dd7e){return function(_0x1ea3f3){if(_0x1ea3f3){return _0x1ea3f3[_0xc20b('0x24')](_0x17e308)[_0xc20b('0x25')](function(_0x37cf94){return _0x37cf94;});}return null;};}function removeEntity(_0x512a71,_0x25671c){return function(_0x903841){if(_0x903841){return _0x903841[_0xc20b('0x26')]()[_0xc20b('0x25')](function(){_0x512a71[_0xc20b('0x19')](0xcc)[_0xc20b('0x1a')]();});}};}function handleEntityNotFound(_0x403853,_0x52f331){return function(_0x35f587){if(!_0x35f587){_0x403853[_0xc20b('0x18')](0x194);}return _0x35f587;};}function handleError(_0x30314c,_0x474c58){_0x474c58=_0x474c58||0x1f4;return function(_0x399488){logger[_0xc20b('0x27')](_0x399488['stack']);if(_0x399488[_0xc20b('0x28')]){delete _0x399488[_0xc20b('0x28')];}_0x30314c['status'](_0x474c58)['send'](_0x399488);};}exports[_0xc20b('0x29')]=function(_0x3d5b5f,_0x50832b){var _0x2b0122={},_0x4984fa={},_0x17a477={'count':0x0,'rows':[]};var _0x24e0b1=_[_0xc20b('0x2a')](db[_0xc20b('0x2b')][_0xc20b('0x2c')],function(_0x311510){return{'name':_0x311510[_0xc20b('0x2d')],'type':_0x311510[_0xc20b('0x2e')][_0xc20b('0x2f')]};});_0x4984fa[_0xc20b('0x30')]=_['map'](_0x24e0b1,'name');_0x4984fa[_0xc20b('0x31')]=_['keys'](_0x3d5b5f[_0xc20b('0x31')]);_0x4984fa[_0xc20b('0x32')]=_['intersection'](_0x4984fa[_0xc20b('0x30')],_0x4984fa[_0xc20b('0x31')]);_0x2b0122[_0xc20b('0x33')]=_['intersection'](_0x4984fa[_0xc20b('0x30')],qs[_0xc20b('0x34')](_0x3d5b5f['query'][_0xc20b('0x34')]));_0x2b0122[_0xc20b('0x33')]=_0x2b0122[_0xc20b('0x33')]['length']?_0x2b0122[_0xc20b('0x33')]:_0x4984fa[_0xc20b('0x30')];if(!_0x3d5b5f['query'][_0xc20b('0x35')]('nolimit')){_0x2b0122[_0xc20b('0x1d')]=qs[_0xc20b('0x1d')](_0x3d5b5f[_0xc20b('0x31')][_0xc20b('0x1d')]);_0x2b0122[_0xc20b('0x1f')]=qs['offset'](_0x3d5b5f[_0xc20b('0x31')]['offset']);}_0x2b0122[_0xc20b('0x36')]=qs[_0xc20b('0x37')](_0x3d5b5f['query'][_0xc20b('0x37')]);_0x2b0122[_0xc20b('0x38')]=qs['filters'](_['pick'](_0x3d5b5f[_0xc20b('0x31')],_0x4984fa[_0xc20b('0x32')]),_0x24e0b1);if(_0x3d5b5f[_0xc20b('0x31')][_0xc20b('0x39')]){_0x2b0122[_0xc20b('0x38')]=_[_0xc20b('0x3a')](_0x2b0122[_0xc20b('0x38')],{'$or':_[_0xc20b('0x2a')](_0x24e0b1,function(_0x32f317){if(_0x32f317[_0xc20b('0x2e')]!==_0xc20b('0x3b')){var _0x41f7cb={};_0x41f7cb[_0x32f317[_0xc20b('0x28')]]={'$like':'%'+_0x3d5b5f['query'][_0xc20b('0x39')]+'%'};return _0x41f7cb;}})});}_0x2b0122=_['merge']({},_0x2b0122,_0x3d5b5f[_0xc20b('0x3c')]);var _0x34397f={'where':_0x2b0122[_0xc20b('0x38')]};return db['VoiceQueuesLog'][_0xc20b('0x1e')](_0x34397f)[_0xc20b('0x25')](function(_0x189fc9){_0x17a477[_0xc20b('0x1e')]=_0x189fc9;if(_0x3d5b5f[_0xc20b('0x31')][_0xc20b('0x3d')]){_0x2b0122[_0xc20b('0x3e')]=[{'all':!![]}];}return db[_0xc20b('0x2b')][_0xc20b('0x3f')](_0x2b0122);})[_0xc20b('0x25')](function(_0x509a84){_0x17a477[_0xc20b('0x40')]=_0x509a84;return _0x17a477;})['then'](respondWithFilteredResult(_0x50832b,_0x2b0122))[_0xc20b('0x41')](handleError(_0x50832b,null));};exports[_0xc20b('0x42')]=function(_0x47c79e,_0x1ab69e){var _0x5eea39={'raw':!![],'where':{'id':_0x47c79e[_0xc20b('0x43')]['id']}},_0x32b212={};_0x32b212['model']=_[_0xc20b('0x44')](db['VoiceQueuesLog'][_0xc20b('0x2c')]);_0x32b212[_0xc20b('0x31')]=_[_0xc20b('0x44')](_0x47c79e[_0xc20b('0x31')]);_0x32b212[_0xc20b('0x32')]=_['intersection'](_0x32b212['model'],_0x32b212[_0xc20b('0x31')]);_0x5eea39['attributes']=_[_0xc20b('0x45')](_0x32b212[_0xc20b('0x30')],qs[_0xc20b('0x34')](_0x47c79e[_0xc20b('0x31')]['fields']));_0x5eea39[_0xc20b('0x33')]=_0x5eea39['attributes']['length']?_0x5eea39[_0xc20b('0x33')]:_0x32b212[_0xc20b('0x30')];if(_0x47c79e['query'][_0xc20b('0x3d')]){_0x5eea39[_0xc20b('0x3e')]=[{'all':!![]}];}_0x5eea39=_[_0xc20b('0x3a')]({},_0x5eea39,_0x47c79e[_0xc20b('0x3c')]);return db[_0xc20b('0x2b')][_0xc20b('0x46')](_0x5eea39)[_0xc20b('0x25')](handleEntityNotFound(_0x1ab69e,null))['then'](respondWithResult(_0x1ab69e,null))[_0xc20b('0x41')](handleError(_0x1ab69e,null));};exports[_0xc20b('0x47')]=function(_0x4331d2,_0x4d19e7){return db['VoiceQueuesLog'][_0xc20b('0x47')](_0x4331d2[_0xc20b('0x48')],{})[_0xc20b('0x25')](respondWithResult(_0x4d19e7,0xc9))['catch'](handleError(_0x4d19e7,null));};exports[_0xc20b('0x24')]=function(_0x1d1e6f,_0x2b2514){if(_0x1d1e6f[_0xc20b('0x48')]['id']){delete _0x1d1e6f[_0xc20b('0x48')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x1d1e6f[_0xc20b('0x43')]['id']}})[_0xc20b('0x25')](handleEntityNotFound(_0x2b2514,null))[_0xc20b('0x25')](saveUpdates(_0x1d1e6f['body'],null))['then'](respondWithResult(_0x2b2514,null))[_0xc20b('0x41')](handleError(_0x2b2514,null));};exports[_0xc20b('0x26')]=function(_0x219f03,_0x4ec9ef){return db['VoiceQueuesLog'][_0xc20b('0x46')]({'where':{'id':_0x219f03[_0xc20b('0x43')]['id']}})[_0xc20b('0x25')](handleEntityNotFound(_0x4ec9ef,null))[_0xc20b('0x25')](removeEntity(_0x4ec9ef,null))[_0xc20b('0x41')](handleError(_0x4ec9ef,null));}; \ No newline at end of file +var _0x0bb9=['show','params','keys','rawAttributes','includeAll','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','offset','limit','undefined','count','apply','save','update','sendStatus','error','name','send','index','map','VoiceQueuesLog','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','include','findAll','rows','catch'];(function(_0x3cf0e9,_0x2162cf){var _0x2a58db=function(_0x5b4266){while(--_0x5b4266){_0x3cf0e9['push'](_0x3cf0e9['shift']());}};_0x2a58db(++_0x2162cf);}(_0x0bb9,0x9b));var _0x90bb=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x0bb9[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x90bb('0x0'));var rimraf=require(_0x90bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90bb('0x2'));var rp=require(_0x90bb('0x3'));var moment=require(_0x90bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x90bb('0x5'));var util=require(_0x90bb('0x6'));var path=require(_0x90bb('0x7'));var sox=require(_0x90bb('0x8'));var csv=require(_0x90bb('0x9'));var ejs=require(_0x90bb('0xa'));var fs=require('fs');var fs_extra=require(_0x90bb('0xb'));var _=require(_0x90bb('0xc'));var squel=require(_0x90bb('0xd'));var crypto=require('crypto');var jsforce=require(_0x90bb('0xe'));var deskjs=require(_0x90bb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90bb('0x10'));var authService=require(_0x90bb('0x11'));var qs=require(_0x90bb('0x12'));var as=require(_0x90bb('0x13'));var hardwareService=require(_0x90bb('0x14'));var logger=require(_0x90bb('0x15'))(_0x90bb('0x16'));var utils=require(_0x90bb('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41fcb9,_0x369dee){_0x369dee=_0x369dee||0xcc;return function(_0x187881){if(_0x187881){return _0x41fcb9['sendStatus'](_0x369dee);}return _0x41fcb9['status'](_0x369dee)[_0x90bb('0x18')]();};}function respondWithResult(_0x9ff91b,_0x2b1e0d){_0x2b1e0d=_0x2b1e0d||0xc8;return function(_0x269dda){if(_0x269dda){return _0x9ff91b[_0x90bb('0x19')](_0x2b1e0d)[_0x90bb('0x1a')](_0x269dda);}};}function respondWithFilteredResult(_0x40e0b9,_0x4c9324){return function(_0x5e7d28){if(_0x5e7d28){var _0x4aabff=typeof _0x4c9324[_0x90bb('0x1b')]==='undefined'&&typeof _0x4c9324[_0x90bb('0x1c')]===_0x90bb('0x1d');var _0x4ff6c6=_0x5e7d28['count'];var _0x2431e8=_0x4aabff?0x0:_0x4c9324[_0x90bb('0x1b')];var _0x1803fe=_0x4aabff?_0x5e7d28[_0x90bb('0x1e')]:_0x4c9324[_0x90bb('0x1b')]+_0x4c9324[_0x90bb('0x1c')];var _0x802017;if(_0x1803fe>=_0x4ff6c6){_0x1803fe=_0x4ff6c6;_0x802017=0xc8;}else{_0x802017=0xce;}_0x40e0b9[_0x90bb('0x19')](_0x802017);return _0x40e0b9['set']('Content-Range',_0x2431e8+'-'+_0x1803fe+'/'+_0x4ff6c6)[_0x90bb('0x1a')](_0x5e7d28);}return null;};}function patchUpdates(_0x3e4469){return function(_0x1858b0){try{jsonpatch[_0x90bb('0x1f')](_0x1858b0,_0x3e4469,!![]);}catch(_0x40749e){return BPromise['reject'](_0x40749e);}return _0x1858b0[_0x90bb('0x20')]();};}function saveUpdates(_0x428eb6,_0x1b2491){return function(_0x49a582){if(_0x49a582){return _0x49a582[_0x90bb('0x21')](_0x428eb6)['then'](function(_0x48434a){return _0x48434a;});}return null;};}function removeEntity(_0x305f27,_0x36a47f){return function(_0x25fc4c){if(_0x25fc4c){return _0x25fc4c['destroy']()['then'](function(){_0x305f27[_0x90bb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222124,_0x384078){return function(_0x568a4e){if(!_0x568a4e){_0x222124[_0x90bb('0x22')](0x194);}return _0x568a4e;};}function handleError(_0x35625c,_0x1d5241){_0x1d5241=_0x1d5241||0x1f4;return function(_0x1223ca){logger[_0x90bb('0x23')](_0x1223ca['stack']);if(_0x1223ca[_0x90bb('0x24')]){delete _0x1223ca[_0x90bb('0x24')];}_0x35625c[_0x90bb('0x19')](_0x1d5241)[_0x90bb('0x25')](_0x1223ca);};}exports[_0x90bb('0x26')]=function(_0x343c94,_0x55a2de){var _0x273907={},_0x309a06={},_0x5be12f={'count':0x0,'rows':[]};var _0x2f6b7e=_[_0x90bb('0x27')](db[_0x90bb('0x28')]['rawAttributes'],function(_0x50b703){return{'name':_0x50b703[_0x90bb('0x29')],'type':_0x50b703['type']['key']};});_0x309a06[_0x90bb('0x2a')]=_[_0x90bb('0x27')](_0x2f6b7e,_0x90bb('0x24'));_0x309a06['query']=_['keys'](_0x343c94[_0x90bb('0x2b')]);_0x309a06[_0x90bb('0x2c')]=_['intersection'](_0x309a06[_0x90bb('0x2a')],_0x309a06[_0x90bb('0x2b')]);_0x273907[_0x90bb('0x2d')]=_[_0x90bb('0x2e')](_0x309a06['model'],qs[_0x90bb('0x2f')](_0x343c94[_0x90bb('0x2b')][_0x90bb('0x2f')]));_0x273907[_0x90bb('0x2d')]=_0x273907['attributes'][_0x90bb('0x30')]?_0x273907[_0x90bb('0x2d')]:_0x309a06[_0x90bb('0x2a')];if(!_0x343c94['query'][_0x90bb('0x31')](_0x90bb('0x32'))){_0x273907[_0x90bb('0x1c')]=qs[_0x90bb('0x1c')](_0x343c94['query'][_0x90bb('0x1c')]);_0x273907[_0x90bb('0x1b')]=qs[_0x90bb('0x1b')](_0x343c94['query']['offset']);}_0x273907[_0x90bb('0x33')]=qs[_0x90bb('0x34')](_0x343c94['query'][_0x90bb('0x34')]);_0x273907[_0x90bb('0x35')]=qs['filters'](_[_0x90bb('0x36')](_0x343c94[_0x90bb('0x2b')],_0x309a06[_0x90bb('0x2c')]),_0x2f6b7e);if(_0x343c94['query']['filter']){_0x273907[_0x90bb('0x35')]=_[_0x90bb('0x37')](_0x273907[_0x90bb('0x35')],{'$or':_[_0x90bb('0x27')](_0x2f6b7e,function(_0x5d5154){if(_0x5d5154['type']!==_0x90bb('0x38')){var _0x5d3422={};_0x5d3422[_0x5d5154[_0x90bb('0x24')]]={'$like':'%'+_0x343c94[_0x90bb('0x2b')][_0x90bb('0x39')]+'%'};return _0x5d3422;}})});}_0x273907=_[_0x90bb('0x37')]({},_0x273907,_0x343c94[_0x90bb('0x3a')]);var _0x542b09={'where':_0x273907['where']};return db[_0x90bb('0x28')][_0x90bb('0x1e')](_0x542b09)[_0x90bb('0x3b')](function(_0x55fe4a){_0x5be12f[_0x90bb('0x1e')]=_0x55fe4a;if(_0x343c94['query']['includeAll']){_0x273907[_0x90bb('0x3c')]=[{'all':!![]}];}return db[_0x90bb('0x28')][_0x90bb('0x3d')](_0x273907);})[_0x90bb('0x3b')](function(_0x3acabb){_0x5be12f[_0x90bb('0x3e')]=_0x3acabb;return _0x5be12f;})[_0x90bb('0x3b')](respondWithFilteredResult(_0x55a2de,_0x273907))[_0x90bb('0x3f')](handleError(_0x55a2de,null));};exports[_0x90bb('0x40')]=function(_0x273c7e,_0xd722d){var _0x3f4317={'raw':!![],'where':{'id':_0x273c7e[_0x90bb('0x41')]['id']}},_0x136296={};_0x136296[_0x90bb('0x2a')]=_[_0x90bb('0x42')](db['VoiceQueuesLog'][_0x90bb('0x43')]);_0x136296[_0x90bb('0x2b')]=_['keys'](_0x273c7e[_0x90bb('0x2b')]);_0x136296['filters']=_[_0x90bb('0x2e')](_0x136296[_0x90bb('0x2a')],_0x136296['query']);_0x3f4317[_0x90bb('0x2d')]=_[_0x90bb('0x2e')](_0x136296[_0x90bb('0x2a')],qs[_0x90bb('0x2f')](_0x273c7e['query'][_0x90bb('0x2f')]));_0x3f4317[_0x90bb('0x2d')]=_0x3f4317[_0x90bb('0x2d')]['length']?_0x3f4317[_0x90bb('0x2d')]:_0x136296[_0x90bb('0x2a')];if(_0x273c7e[_0x90bb('0x2b')][_0x90bb('0x44')]){_0x3f4317['include']=[{'all':!![]}];}_0x3f4317=_[_0x90bb('0x37')]({},_0x3f4317,_0x273c7e[_0x90bb('0x3a')]);return db['VoiceQueuesLog'][_0x90bb('0x45')](_0x3f4317)[_0x90bb('0x3b')](handleEntityNotFound(_0xd722d,null))[_0x90bb('0x3b')](respondWithResult(_0xd722d,null))[_0x90bb('0x3f')](handleError(_0xd722d,null));};exports[_0x90bb('0x46')]=function(_0x2eaccb,_0x4862fd){return db[_0x90bb('0x28')][_0x90bb('0x46')](_0x2eaccb[_0x90bb('0x47')],{})[_0x90bb('0x3b')](respondWithResult(_0x4862fd,0xc9))[_0x90bb('0x3f')](handleError(_0x4862fd,null));};exports[_0x90bb('0x21')]=function(_0x3f2097,_0x2b081a){if(_0x3f2097[_0x90bb('0x47')]['id']){delete _0x3f2097[_0x90bb('0x47')]['id'];}return db[_0x90bb('0x28')][_0x90bb('0x45')]({'where':{'id':_0x3f2097[_0x90bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b081a,null))[_0x90bb('0x3b')](saveUpdates(_0x3f2097[_0x90bb('0x47')],null))[_0x90bb('0x3b')](respondWithResult(_0x2b081a,null))[_0x90bb('0x3f')](handleError(_0x2b081a,null));};exports[_0x90bb('0x48')]=function(_0x16b392,_0x18380f){return db['VoiceQueuesLog'][_0x90bb('0x45')]({'where':{'id':_0x16b392['params']['id']}})[_0x90bb('0x3b')](handleEntityNotFound(_0x18380f,null))[_0x90bb('0x3b')](removeEntity(_0x18380f,null))['catch'](handleError(_0x18380f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c56090b..1ff204f 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 _0x5216=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','util','../../config/logger','api','request-promise'];(function(_0x2b8ef1,_0x28380f){var _0x262f55=function(_0xe1280){while(--_0xe1280){_0x2b8ef1['push'](_0x2b8ef1['shift']());}};_0x262f55(++_0x28380f);}(_0x5216,0x146));var _0x6521=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5216[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x6521('0x0'));var logger=require(_0x6521('0x1'))(_0x6521('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6521('0x3'));var fs=require('fs');var path=require(_0x6521('0x4'));var rimraf=require(_0x6521('0x5'));var config=require(_0x6521('0x6'));var attributes=require(_0x6521('0x7'));module['exports']=function(_0x29d75d,_0x2ccd16){return _0x29d75d['define']('VoiceQueuesLog',attributes,{'tableName':_0x6521('0x8'),'paranoid':![],'indexes':[{'name':_0x6521('0x9'),'fields':[_0x6521('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xb545=['bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','api','moment'];(function(_0x5ea4c6,_0x4bb0b7){var _0x4e2c13=function(_0x5627b1){while(--_0x5627b1){_0x5ea4c6['push'](_0x5ea4c6['shift']());}};_0x4e2c13(++_0x4bb0b7);}(_0xb545,0xcf));var _0x5b54=function(_0x424f1e,_0x186a7d){_0x424f1e=_0x424f1e-0x0;var _0x1be7d1=_0xb545[_0x424f1e];return _0x1be7d1;};'use strict';var _=require('lodash');var util=require(_0x5b54('0x0'));var logger=require('../../config/logger')(_0x5b54('0x1'));var moment=require(_0x5b54('0x2'));var BPromise=require(_0x5b54('0x3'));var rp=require(_0x5b54('0x4'));var fs=require('fs');var path=require(_0x5b54('0x5'));var rimraf=require('rimraf');var config=require(_0x5b54('0x6'));var attributes=require(_0x5b54('0x7'));module[_0x5b54('0x8')]=function(_0x867d4d,_0x5abda8){return _0x867d4d['define'](_0x5b54('0x9'),attributes,{'tableName':_0x5b54('0xa'),'paranoid':![],'indexes':[{'name':_0x5b54('0xb'),'fields':[_0x5b54('0xc'),_0x5b54('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e78355f..b214227 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 _0x17b6=['lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x139681,_0x1af09a){var _0x85cb36=function(_0x45525c){while(--_0x45525c){_0x139681['push'](_0x139681['shift']());}};_0x85cb36(++_0x1af09a);}(_0x17b6,0xf7));var _0x617b=function(_0x3f93df,_0x163e2e){_0x3f93df=_0x3f93df-0x0;var _0x5a201b=_0x17b6[_0x3f93df];return _0x5a201b;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x617b('0x2'))['db'];var utils=require(_0x617b('0x3'));var logger=require(_0x617b('0x4'))('rpc');var config=require(_0x617b('0x5'));var jayson=require(_0x617b('0x6'));var client=jayson['client'][_0x617b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ca647,_0x502d56,_0x4ddd96){return new BPromise(function(_0x3e9f8c,_0x19729e){return client['request'](_0x2ca647,_0x4ddd96)[_0x617b('0x8')](function(_0x81347a){logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));logger[_0x617b('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x502d56,'request\x20sent',JSON[_0x617b('0xd')](_0x81347a));if(_0x81347a['error']){if(_0x81347a[_0x617b('0xe')][_0x617b('0xf')]===0x1f4){logger['error'](_0x617b('0xa'),_0x502d56,_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);return _0x19729e(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}logger[_0x617b('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x502d56,_0x81347a['error'][_0x617b('0x10')]);return _0x3e9f8c(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}else{logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));_0x3e9f8c(_0x81347a[_0x617b('0x11')]['message']);}})[_0x617b('0x12')](function(_0x51e650){logger[_0x617b('0xe')](_0x617b('0xa'),_0x502d56,_0x51e650);_0x19729e(_0x51e650);});});} \ No newline at end of file +var _0x30c4=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis'];(function(_0x7a695e,_0x3517c8){var _0x4438a1=function(_0x18f274){while(--_0x18f274){_0x7a695e['push'](_0x7a695e['shift']());}};_0x4438a1(++_0x3517c8);}(_0x30c4,0x152));var _0x430c=function(_0x2e05f0,_0x3f4374){_0x2e05f0=_0x2e05f0-0x0;var _0x198663=_0x30c4[_0x2e05f0];return _0x198663;};'use strict';var _=require(_0x430c('0x0'));var util=require(_0x430c('0x1'));var moment=require(_0x430c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x430c('0x3'));var db=require(_0x430c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x430c('0x5'))(_0x430c('0x6'));var config=require('../../config/environment');var jayson=require(_0x430c('0x7'));var client=jayson['client'][_0x430c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x224dea,_0x24470f,_0xbec393){return new BPromise(function(_0x5abc05,_0x54dfa4){return client['request'](_0x224dea,_0xbec393)[_0x430c('0x9')](function(_0x32814a){logger[_0x430c('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24470f,_0x430c('0xb'));logger[_0x430c('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x24470f,'request\x20sent',JSON[_0x430c('0xd')](_0x32814a));if(_0x32814a[_0x430c('0xe')]){if(_0x32814a['error'][_0x430c('0xf')]===0x1f4){logger[_0x430c('0xe')](_0x430c('0x10'),_0x24470f,_0x32814a[_0x430c('0xe')]['message']);return _0x54dfa4(_0x32814a['error'][_0x430c('0x11')]);}logger[_0x430c('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24470f,_0x32814a['error'][_0x430c('0x11')]);return _0x5abc05(_0x32814a['error'][_0x430c('0x11')]);}else{logger[_0x430c('0xa')](_0x430c('0x10'),_0x24470f,_0x430c('0xb'));_0x5abc05(_0x32814a[_0x430c('0x12')][_0x430c('0x11')]);}})['catch'](function(_0xe7b1d0){logger[_0x430c('0xe')](_0x430c('0x10'),_0x24470f,_0xe7b1d0);_0x54dfa4(_0xe7b1d0);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 80e2e50..aa22493 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 _0xc84e=['download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/download'];(function(_0x3a5c58,_0x366091){var _0x3a2d98=function(_0x52253c){while(--_0x52253c){_0x3a5c58['push'](_0x3a5c58['shift']());}};_0x3a2d98(++_0x366091);}(_0xc84e,0x15c));var _0xec84=function(_0x3f28da,_0x2d1409){_0x3f28da=_0x3f28da-0x0;var _0x5effb2=_0xc84e[_0x3f28da];return _0x5effb2;};'use strict';var multer=require(_0xec84('0x0'));var util=require(_0xec84('0x1'));var path=require(_0xec84('0x2'));var timeout=require('connect-timeout');var express=require(_0xec84('0x3'));var router=express[_0xec84('0x4')]();var fs_extra=require(_0xec84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec84('0x6'));var config=require(_0xec84('0x7'));var controller=require(_0xec84('0x8'));router['get']('/',auth[_0xec84('0x9')](),controller[_0xec84('0xa')]);router[_0xec84('0xb')](_0xec84('0xc'),auth[_0xec84('0x9')](),controller[_0xec84('0xd')]);router['get'](_0xec84('0xe'),auth[_0xec84('0x9')](),controller['show']);router[_0xec84('0xb')](_0xec84('0xf'),auth['isAuthenticated'](),controller[_0xec84('0x10')]);router[_0xec84('0xb')]('/:id/downloads',controller[_0xec84('0x11')]);router[_0xec84('0xb')](_0xec84('0x12'),auth['isAuthenticated'](),controller[_0xec84('0x13')]);router[_0xec84('0x14')]('/',auth[_0xec84('0x9')](),controller[_0xec84('0x15')]);router['post'](_0xec84('0x12'),auth[_0xec84('0x9')](),controller[_0xec84('0x16')]);router[_0xec84('0x17')](_0xec84('0xe'),auth[_0xec84('0x9')](),controller[_0xec84('0x18')]);router[_0xec84('0x19')](_0xec84('0xe'),auth['isAuthenticated'](),controller[_0xec84('0x1a')]);module[_0xec84('0x1b')]=router; \ No newline at end of file +var _0x5f3b=['show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','describe'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x5f3b,0x17b));var _0xb5f3=function(_0x41a334,_0x2dd2f1){_0x41a334=_0x41a334-0x0;var _0x575579=_0x5f3b[_0x41a334];return _0x575579;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5f3('0x0'));var timeout=require(_0xb5f3('0x1'));var express=require(_0xb5f3('0x2'));var router=express[_0xb5f3('0x3')]();var fs_extra=require(_0xb5f3('0x4'));var auth=require(_0xb5f3('0x5'));var interaction=require(_0xb5f3('0x6'));var config=require('../../config/environment');var controller=require(_0xb5f3('0x7'));router[_0xb5f3('0x8')]('/',auth[_0xb5f3('0x9')](),controller[_0xb5f3('0xa')]);router[_0xb5f3('0x8')]('/describe',auth[_0xb5f3('0x9')](),controller[_0xb5f3('0xb')]);router[_0xb5f3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb5f3('0xc')]);router[_0xb5f3('0x8')](_0xb5f3('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xb5f3('0x8')](_0xb5f3('0xe'),controller[_0xb5f3('0xf')]);router[_0xb5f3('0x8')](_0xb5f3('0x10'),auth[_0xb5f3('0x9')](),controller[_0xb5f3('0x11')]);router['post']('/',auth[_0xb5f3('0x9')](),controller[_0xb5f3('0x12')]);router['post']('/:id/transcribe',auth[_0xb5f3('0x9')](),controller[_0xb5f3('0x13')]);router['put']('/:id',auth[_0xb5f3('0x9')](),controller[_0xb5f3('0x14')]);router[_0xb5f3('0x15')]('/:id',auth[_0xb5f3('0x9')](),controller['destroy']);module[_0xb5f3('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 21411fe..c0252f1 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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 225909d..ff5b61a 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 _0x7d4e=['length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','sequelize','MD5','token','$and','push','decryptFile','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','File:\x20\x22','listBuckets','createBucket','TranscribeService','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','differenceBy','keys','query','filters','intersection','model','fields','attributes'];(function(_0x2a9951,_0xfd2eb3){var _0x31592c=function(_0x31c700){while(--_0x31c700){_0x2a9951['push'](_0x2a9951['shift']());}};_0x31592c(++_0xfd2eb3);}(_0x7d4e,0x194));var _0xe7d4=function(_0x3cb80b,_0x217e2f){_0x3cb80b=_0x3cb80b-0x0;var _0x2d7f93=_0x7d4e[_0x3cb80b];return _0x2d7f93;};'use strict';var emlformat=require(_0xe7d4('0x0'));var rimraf=require(_0xe7d4('0x1'));var zipdir=require(_0xe7d4('0x2'));var jsonpatch=require(_0xe7d4('0x3'));var rp=require(_0xe7d4('0x4'));var moment=require('moment');var BPromise=require(_0xe7d4('0x5'));var Mustache=require('mustache');var util=require(_0xe7d4('0x6'));var path=require(_0xe7d4('0x7'));var sox=require(_0xe7d4('0x8'));var csv=require(_0xe7d4('0x9'));var ejs=require(_0xe7d4('0xa'));var fs=require('fs');var fs_extra=require(_0xe7d4('0xb'));var _=require(_0xe7d4('0xc'));var squel=require(_0xe7d4('0xd'));var crypto=require(_0xe7d4('0xe'));var jsforce=require(_0xe7d4('0xf'));var deskjs=require(_0xe7d4('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe7d4('0x11'));var Papa=require(_0xe7d4('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0xe7d4('0x13'));var Redis=require('ioredis');var authService=require(_0xe7d4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe7d4('0x15'));var hardwareService=require(_0xe7d4('0x16'));var logger=require(_0xe7d4('0x17'))(_0xe7d4('0x18'));var utils=require(_0xe7d4('0x19'));var config=require(_0xe7d4('0x1a'));var licenseUtil=require(_0xe7d4('0x1b'));var db=require(_0xe7d4('0x1c'))['db'];function respondWithStatusCode(_0x4eb9bc,_0x5c0513){_0x5c0513=_0x5c0513||0xcc;return function(_0x37639e){if(_0x37639e){return _0x4eb9bc[_0xe7d4('0x1d')](_0x5c0513);}return _0x4eb9bc['status'](_0x5c0513)[_0xe7d4('0x1e')]();};}function respondWithResult(_0x583836,_0x1251bb){_0x1251bb=_0x1251bb||0xc8;return function(_0x30976a){if(_0x30976a){return _0x583836['status'](_0x1251bb)['json'](_0x30976a);}};}function respondWithFilteredResult(_0xeba72c,_0x8f3be0){return function(_0x2a51e7){if(_0x2a51e7){var _0x2f4289=typeof _0x8f3be0[_0xe7d4('0x1f')]===_0xe7d4('0x20')&&typeof _0x8f3be0[_0xe7d4('0x21')]===_0xe7d4('0x20');var _0x420561=_0x2a51e7[_0xe7d4('0x22')];var _0x5e688d=_0x2f4289?0x0:_0x8f3be0[_0xe7d4('0x1f')];var _0x3d67be=_0x2f4289?_0x2a51e7[_0xe7d4('0x22')]:_0x8f3be0[_0xe7d4('0x1f')]+_0x8f3be0['limit'];var _0x389fd4;if(_0x3d67be>=_0x420561){_0x3d67be=_0x420561;_0x389fd4=0xc8;}else{_0x389fd4=0xce;}_0xeba72c[_0xe7d4('0x23')](_0x389fd4);return _0xeba72c[_0xe7d4('0x24')](_0xe7d4('0x25'),_0x5e688d+'-'+_0x3d67be+'/'+_0x420561)[_0xe7d4('0x26')](_0x2a51e7);}return null;};}function patchUpdates(_0x220f2d){return function(_0x2e6afe){try{jsonpatch['apply'](_0x2e6afe,_0x220f2d,!![]);}catch(_0x41b1e8){return BPromise['reject'](_0x41b1e8);}return _0x2e6afe[_0xe7d4('0x27')]();};}function saveUpdates(_0x126ed4,_0x403263){return function(_0x26de93){if(_0x26de93){return _0x26de93[_0xe7d4('0x28')](_0x126ed4)[_0xe7d4('0x29')](function(_0x5a5e56){return _0x5a5e56;});}return null;};}function removeEntity(_0x1d17f4,_0x2f6ea8){return function(_0x284da0){if(_0x284da0){return _0x284da0[_0xe7d4('0x2a')]()['then'](function(){_0x1d17f4[_0xe7d4('0x23')](0xcc)[_0xe7d4('0x1e')]();});}};}function handleEntityNotFound(_0x527eb9,_0x612205){return function(_0x5469ef){if(!_0x5469ef){_0x527eb9[_0xe7d4('0x1d')](0x194);}return _0x5469ef;};}function handleError(_0x14ada9,_0x4c9b70){_0x4c9b70=_0x4c9b70||0x1f4;return function(_0x659efd){logger[_0xe7d4('0x2b')](_0x659efd[_0xe7d4('0x2c')]);if(_0x659efd['name']){delete _0x659efd[_0xe7d4('0x2d')];}_0x14ada9[_0xe7d4('0x23')](_0x4c9b70)[_0xe7d4('0x2e')](_0x659efd);};}exports[_0xe7d4('0x2f')]=function(_0x5b972a,_0x54b5ee){var _0x1b1a00={},_0x21a055={},_0x48c878={'count':0x0,'rows':[]};var _0x2f0bdb=_[_0xe7d4('0x30')](db[_0xe7d4('0x31')][_0xe7d4('0x32')],function(_0x46791c){return{'name':_0x46791c[_0xe7d4('0x33')],'type':_0x46791c[_0xe7d4('0x34')]['key']};});_0x21a055['model']=_[_0xe7d4('0x35')](_['map'](_0x2f0bdb,'name'),['format']);_0x21a055['query']=_[_0xe7d4('0x36')](_0x5b972a[_0xe7d4('0x37')]);_0x21a055[_0xe7d4('0x38')]=_[_0xe7d4('0x39')](_0x21a055['model'],_0x21a055['query']);_0x1b1a00['attributes']=_[_0xe7d4('0x39')](_0x21a055[_0xe7d4('0x3a')],qs[_0xe7d4('0x3b')](_0x5b972a['query'][_0xe7d4('0x3b')]));_0x1b1a00['attributes']=_0x1b1a00[_0xe7d4('0x3c')][_0xe7d4('0x3d')]?_0x1b1a00[_0xe7d4('0x3c')]:_0x21a055[_0xe7d4('0x3a')];if(!_0x5b972a[_0xe7d4('0x37')]['hasOwnProperty'](_0xe7d4('0x3e'))){_0x1b1a00[_0xe7d4('0x21')]=qs[_0xe7d4('0x21')](_0x5b972a[_0xe7d4('0x37')]['limit']);_0x1b1a00[_0xe7d4('0x1f')]=qs[_0xe7d4('0x1f')](_0x5b972a['query'][_0xe7d4('0x1f')]);}_0x1b1a00[_0xe7d4('0x3f')]=qs[_0xe7d4('0x40')](_0x5b972a['query']['sort']);_0x1b1a00['where']=qs[_0xe7d4('0x38')](_[_0xe7d4('0x41')](_0x5b972a['query'],_0x21a055[_0xe7d4('0x38')]),_0x2f0bdb);if(_0x5b972a[_0xe7d4('0x37')]['filter']){_0x1b1a00[_0xe7d4('0x42')]=_[_0xe7d4('0x43')](_0x1b1a00[_0xe7d4('0x42')],{'$or':_[_0xe7d4('0x30')](_0x2f0bdb,function(_0x28b151){if(_0x28b151[_0xe7d4('0x34')]!==_0xe7d4('0x44')){var _0x509379={};_0x509379[_0x28b151['name']]={'$like':'%'+_0x5b972a[_0xe7d4('0x37')][_0xe7d4('0x45')]+'%'};return _0x509379;}})});}_0x1b1a00=_[_0xe7d4('0x43')]({},_0x1b1a00,_0x5b972a['options']);var _0x385c59={'where':_0x1b1a00[_0xe7d4('0x42')]};return db[_0xe7d4('0x31')][_0xe7d4('0x22')](_0x385c59)['then'](function(_0x5e6a5a){_0x48c878[_0xe7d4('0x22')]=_0x5e6a5a;if(_0x5b972a[_0xe7d4('0x37')]['includeAll']){_0x1b1a00[_0xe7d4('0x46')]=[{'all':!![]}];}return db[_0xe7d4('0x31')][_0xe7d4('0x47')](_0x1b1a00);})[_0xe7d4('0x29')](function(_0x49272b){_0x48c878[_0xe7d4('0x48')]=_0x49272b;return _0x48c878;})[_0xe7d4('0x29')](respondWithFilteredResult(_0x54b5ee,_0x1b1a00))[_0xe7d4('0x49')](handleError(_0x54b5ee,null));};exports[_0xe7d4('0x4a')]=function(_0x3b1468,_0x1364b7){var _0x312798={'raw':![],'where':{'id':_0x3b1468[_0xe7d4('0x4b')]['id']}},_0x106d05={};_0x106d05['model']=_[_0xe7d4('0x36')](db[_0xe7d4('0x31')][_0xe7d4('0x32')]);_0x106d05[_0xe7d4('0x37')]=_['keys'](_0x3b1468['query']);_0x106d05[_0xe7d4('0x38')]=_[_0xe7d4('0x39')](_0x106d05[_0xe7d4('0x3a')],_0x106d05['query']);_0x312798[_0xe7d4('0x3c')]=_[_0xe7d4('0x39')](_0x106d05[_0xe7d4('0x3a')],qs[_0xe7d4('0x3b')](_0x3b1468['query']['fields']));_0x312798[_0xe7d4('0x3c')]=_0x312798[_0xe7d4('0x3c')]['length']?_0x312798['attributes']:_0x106d05['model'];if(_0x3b1468['query'][_0xe7d4('0x4c')]){_0x312798[_0xe7d4('0x46')]=[{'all':!![]}];}_0x312798=_['merge']({},_0x312798,_0x3b1468[_0xe7d4('0x4d')]);return db[_0xe7d4('0x31')][_0xe7d4('0x4e')](_0x312798)[_0xe7d4('0x29')](handleEntityNotFound(_0x1364b7,null))[_0xe7d4('0x29')](respondWithResult(_0x1364b7,null))[_0xe7d4('0x49')](handleError(_0x1364b7,null));};exports[_0xe7d4('0x4f')]=function(_0xdbe261,_0x25cf31){return db[_0xe7d4('0x31')][_0xe7d4('0x4f')](_0xdbe261[_0xe7d4('0x50')],{})[_0xe7d4('0x29')](respondWithResult(_0x25cf31,0xc9))['catch'](handleError(_0x25cf31,null));};exports[_0xe7d4('0x28')]=function(_0x22e809,_0x146414){if(_0x22e809[_0xe7d4('0x50')]['id']){delete _0x22e809[_0xe7d4('0x50')]['id'];}return db[_0xe7d4('0x31')][_0xe7d4('0x4e')]({'where':{'id':_0x22e809[_0xe7d4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x146414,null))[_0xe7d4('0x29')](saveUpdates(_0x22e809[_0xe7d4('0x50')],null))['then'](respondWithResult(_0x146414,null))[_0xe7d4('0x49')](handleError(_0x146414,null));};exports['describe']=function(_0x139c66,_0x3806a4){return db['VoiceRecording']['describe']()[_0xe7d4('0x29')](respondWithResult(_0x3806a4,null))[_0xe7d4('0x49')](handleError(_0x3806a4,null));};exports['download']=function(_0x377bb3,_0x1c1bfc,_0x3b777c){var _0x18eebf=require(_0xe7d4('0x51'));var _0x13b606=![];var _0x504086={};if(_0x377bb3[_0xe7d4('0x37')][_0xe7d4('0x34')]&&_0x377bb3[_0xe7d4('0x37')]['type']===_0xe7d4('0x52')){_0x504086[_0xe7d4('0x52')]=_0x377bb3[_0xe7d4('0x4b')]['id'];}else{_0x504086['id']=_0x377bb3[_0xe7d4('0x4b')]['id'];}return db['VoiceRecording']['find']({'where':_0x504086,'attributes':['id',_0xe7d4('0x53')],'raw':!![]})[_0xe7d4('0x29')](handleEntityNotFound(_0x1c1bfc,null))['then'](function(_0x15297e){if(_0x15297e){var _0x1744ef=_0x15297e[_0xe7d4('0x53')];var _0x264a02=util[_0xe7d4('0x54')](_0xe7d4('0x55'),_0x1744ef);if(fs[_0xe7d4('0x56')](_0x264a02)){_0x13b606=!![];return _0x18eebf['decryptFile'](_0x264a02,_0x1744ef,config[_0xe7d4('0x57')][_0xe7d4('0x58')])[_0xe7d4('0x29')](function(){return _0x15297e;});}return _0x15297e;}})['then'](function(_0x99944a){if(_0x99944a){var _0x29b14c=_0x99944a[_0xe7d4('0x53')];if(!fs[_0xe7d4('0x56')](_0x29b14c)){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x5b'));}if(_0x99944a[_0xe7d4('0x5c')]){return _0x1c1bfc[_0xe7d4('0x5d')](_0x29b14c,_0x99944a['filename']+path[_0xe7d4('0x5e')](_0x29b14c),function(){if(_0x13b606){fs[_0xe7d4('0x5f')](_0x29b14c);}});}else{return _0x1c1bfc[_0xe7d4('0x5d')](_0x29b14c,function(_0xf25ce){if(_0x13b606){fs[_0xe7d4('0x5f')](_0x29b14c);}});}}})[_0xe7d4('0x49')](function(_0x421c78){if(_0x421c78[_0xe7d4('0x60')]===_0xe7d4('0x5b')){_0x1c1bfc[_0xe7d4('0x23')](0x194)['send'](_0xe7d4('0x61'));}else{return handleError(_0x1c1bfc,null);}});};exports['downloads']=function(_0x3d2cb4,_0x249025,_0x2e93dd){var _0x2265bd=require(_0xe7d4('0x51'));var _0x4b883b=![];var _0x48027a={'$and':[db[_0xe7d4('0x62')]['where'](db['sequelize']['fn'](_0xe7d4('0x63'),db[_0xe7d4('0x62')]['col']('uniqueid')),_0x3d2cb4['query'][_0xe7d4('0x64')])]};if(_0x3d2cb4[_0xe7d4('0x37')][_0xe7d4('0x34')]&&_0x3d2cb4['query'][_0xe7d4('0x34')]===_0xe7d4('0x52')){_0x48027a[_0xe7d4('0x65')][_0xe7d4('0x66')]({'uniqueid':_0x3d2cb4['params']['id']});}else{_0x48027a['$and'][_0xe7d4('0x66')]({'id':_0x3d2cb4['params']['id']});}return db[_0xe7d4('0x31')][_0xe7d4('0x4e')]({'where':_0x48027a,'attributes':['id',_0xe7d4('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x249025,null))[_0xe7d4('0x29')](function(_0x5d294a){if(_0x5d294a){var _0x27783b=util[_0xe7d4('0x54')](_0xe7d4('0x55'),_0x5d294a[_0xe7d4('0x53')]);if(fs[_0xe7d4('0x56')](_0x27783b)){_0x4b883b=!![];return _0x2265bd[_0xe7d4('0x67')](_0x27783b,_0x5d294a[_0xe7d4('0x53')],config[_0xe7d4('0x57')][_0xe7d4('0x58')])[_0xe7d4('0x29')](function(){return _0x5d294a;});}return _0x5d294a;}})[_0xe7d4('0x29')](function(_0x23ea4e){if(_0x23ea4e){if(!fs[_0xe7d4('0x56')](_0x23ea4e[_0xe7d4('0x53')])){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x5b'));}if(_0x23ea4e[_0xe7d4('0x5c')]){return _0x249025[_0xe7d4('0x5d')](_0x23ea4e[_0xe7d4('0x53')],_0x23ea4e['filename']+path[_0xe7d4('0x5e')](_0x23ea4e[_0xe7d4('0x53')]),function(){if(_0x4b883b){fs[_0xe7d4('0x5f')](_0x23ea4e['value']);}});}else{return _0x249025[_0xe7d4('0x5d')](_0x23ea4e[_0xe7d4('0x53')],function(_0x33f611){if(_0x4b883b){fs['unlink'](_0x23ea4e[_0xe7d4('0x53')]);}});}}})['catch'](handleError(_0x249025,null));};exports[_0xe7d4('0x2a')]=function(_0x38cc8f,_0x4f6a47){return db[_0xe7d4('0x31')][_0xe7d4('0x4e')]({'where':{'id':_0x38cc8f[_0xe7d4('0x4b')]['id']}})['then'](function(_0x214af6){if(_[_0xe7d4('0x68')](_0x214af6)){throw new ReferenceError(_0xe7d4('0x69'));}return _0x214af6;})[_0xe7d4('0x29')](function(_0x3618c5){var _0xcbe298=_0x3618c5['value'];logger['info'](_0xe7d4('0x6a'),_0xcbe298);if(!_[_0xe7d4('0x68')](_0x3618c5['value'])&&fs[_0xe7d4('0x56')](_0xcbe298)){logger['info']('File:\x20\x22'+_0xcbe298+_0xe7d4('0x6b'));fs[_0xe7d4('0x6c')](_0xcbe298);}_0xcbe298=_0xcbe298+_0xe7d4('0x6d');if(!_[_0xe7d4('0x68')](_0x3618c5[_0xe7d4('0x53')])&&fs[_0xe7d4('0x56')](_0xcbe298)){logger[_0xe7d4('0x6e')](_0xe7d4('0x6f')+_0xcbe298+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xcbe298);}return _0x3618c5;})[_0xe7d4('0x29')](function(_0xa22fbf){if(!_0xa22fbf)throw new InternalError();return _0xa22fbf['destroy']();})[_0xe7d4('0x29')](function(){_0x4f6a47['status'](0xcc)['end']();})[_0xe7d4('0x49')](handleError(_0x4f6a47,null));};function getBucketslist(_0x51c638,_0x3a25e3,_0x58d1da){return new Promise(function(_0x58773b,_0x297c08){var _0x5e46e0=new AWS['S3']({'accessKeyId':_0x3a25e3,'secretAccessKey':_0x51c638,'region':_0x58d1da});_0x5e46e0[_0xe7d4('0x70')]({},function(_0x570c89,_0x23e82c){if(_0x570c89){return _0x297c08(_0x570c89);}else{return _0x58773b(_0x23e82c);}});});}function createBucket(_0xab5564,_0x3a664e,_0xd530bd,_0x4ca804){return new Promise(function(_0x4acc33,_0x46b6d3){var _0x23c56c=new AWS['S3']({'accessKeyId':_0x3a664e,'secretAccessKey':_0xab5564,'region':_0xd530bd});_0x23c56c[_0xe7d4('0x71')]({'Bucket':_0x4ca804},function(_0x456dfd,_0x2a21b7){if(_0x456dfd){return _0x46b6d3(_0x456dfd);}else{return _0x4acc33(_0x2a21b7);}});});}function uploadFile(_0x44bc7c,_0x3d4d42,_0x1c81af,_0x3e6b13,_0x19a2eb,_0x56b8a2){return new Promise(function(_0x22cedf,_0xe93b3e){var _0x54a1fe=new AWS['S3']({'accessKeyId':_0x3d4d42,'secretAccessKey':_0x44bc7c,'region':_0x1c81af});_0x54a1fe['upload']({'Bucket':_0x3e6b13,'Key':_0x19a2eb,'Body':_0x56b8a2},function(_0x5dded2,_0x15bb2c){if(_0x5dded2){return _0xe93b3e(_0x5dded2);}else{return _0x22cedf(_0x15bb2c);}});});}function startTranscribe(_0x2df2bd,_0x544fc9,_0x15d043,_0x2889b1,_0x332d7d,_0x2f6586){return new Promise(function(_0x3bb752,_0x4d58db){var _0xd53acf=new AWS[(_0xe7d4('0x72'))]({'accessKeyId':_0x544fc9,'secretAccessKey':_0x2df2bd,'region':_0x15d043});_0xd53acf['startTranscriptionJob']({'TranscriptionJobName':_0x2889b1,'LanguageCode':_0x332d7d,'Media':{'MediaFileUri':_0x2f6586}},function(_0x6386c6,_0x25d3de){if(_0x6386c6){return _0x4d58db(_0x6386c6);}else{return _0x3bb752(_0x25d3de);}});});}function transcribe(_0x10a3dd,_0x58c52a,_0x2e8e76,_0x3096a6,_0x216cb8,_0x24d715,_0x42a00){return new Promise(function(_0x163dde,_0x579538){var _0x53c582={};logger['info'](util[_0xe7d4('0x54')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x10a3dd,_0x216cb8));return uploadFile(_0x58c52a,_0x2e8e76,_0x3096a6,_0x216cb8,path['basename'](_0x24d715),fs[_0xe7d4('0x73')](_0x24d715))[_0xe7d4('0x29')](function(_0x18c198){logger[_0xe7d4('0x6e')](util[_0xe7d4('0x54')](_0xe7d4('0x74'),_0x10a3dd,_0x216cb8,_0x18c198[_0xe7d4('0x75')]));_0x53c582[_0xe7d4('0x76')]=_0x18c198['Bucket'];_0x53c582[_0xe7d4('0x77')]=_0x18c198[_0xe7d4('0x75')];logger['info'](util[_0xe7d4('0x54')](_0xe7d4('0x78'),_0x10a3dd));return startTranscribe(_0x58c52a,_0x2e8e76,_0x3096a6,uuidv4(),_0x42a00,_0x18c198[_0xe7d4('0x75')]);})[_0xe7d4('0x29')](function(_0xab015){logger['info'](util[_0xe7d4('0x54')](_0xe7d4('0x79'),_0x10a3dd,_0xab015[_0xe7d4('0x7a')][_0xe7d4('0x7b')]));_0x53c582[_0xe7d4('0x7c')]=_0xab015[_0xe7d4('0x7a')]['TranscriptionJobName'];_0x53c582[_0xe7d4('0x7d')]=_0xab015['TranscriptionJob'][_0xe7d4('0x7e')];return _0x163dde(_0x53c582);})[_0xe7d4('0x49')](function(_0x44fc1e){return _0x579538(_0x44fc1e);});});}exports[_0xe7d4('0x7f')]=function(_0xd8d27d,_0x7c3dd3,_0x400b16){var _0x4df5b8;var _0x2b77fa;var _0x47e0aa;var _0x4b1358=require(_0xe7d4('0x51'));return db[_0xe7d4('0x31')][_0xe7d4('0x80')]({'where':{'id':_0xd8d27d[_0xe7d4('0x4b')]['id']}})[_0xe7d4('0x29')](function(_0x2d5069){if(_0x2d5069){var _0x1420ce=util[_0xe7d4('0x54')]('%s.cypher',_0x2d5069[_0xe7d4('0x53')]);if(fs['existsSync'](_0x1420ce)){cypher=!![];return _0x4b1358[_0xe7d4('0x67')](_0x1420ce,_0x2d5069[_0xe7d4('0x53')],config[_0xe7d4('0x57')][_0xe7d4('0x58')])['then'](function(){return _0x2d5069;});}return _0x2d5069;}})['then'](function(_0x4a2ebe){if(!_0x4a2ebe){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x81'));}_0x2b77fa=_0x4a2ebe;return db[_0xe7d4('0x82')][_0xe7d4('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x7c3dd3,null))[_0xe7d4('0x29')](function(_0x458b26){if(_0x458b26){_0x4df5b8=_0x458b26;if(!_0x4df5b8['transcribe']||!_0x4df5b8[_0xe7d4('0x83')]||!_0x4df5b8[_0xe7d4('0x84')]||!_0x4df5b8['language']||!_0x4df5b8['bucket']){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x85'));}if(_0xd8d27d['body'][_0xe7d4('0x86')]&&(!_0x4df5b8['sentiment']||!_0x4df5b8[_0xe7d4('0x87')]||!_0x4df5b8[_0xe7d4('0x88')]||!_0x4df5b8[_0xe7d4('0x89')]||!_0x4df5b8[_0xe7d4('0x76')])){throw new db[(_0xe7d4('0x59'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xe7d4('0x8a')]['findOne']({'where':{'id':_0x4df5b8[_0xe7d4('0x83')]}});}})[_0xe7d4('0x29')](function(_0x5afc1e){if(!_0x5afc1e){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x8b'));}if(!_0x5afc1e[_0xe7d4('0x8c')]||!_0x5afc1e[_0xe7d4('0x8d')]){throw new db[(_0xe7d4('0x59'))][(_0xe7d4('0x5a'))](_0xe7d4('0x8e'));}_0x47e0aa=_0x5afc1e;return getBucketslist(_0x47e0aa[_0xe7d4('0x8c')],_0x47e0aa[_0xe7d4('0x8d')],_0x4df5b8['transcribeRegion']);})[_0xe7d4('0x29')](function(_0x520ad4){if(_0x520ad4&&_0x520ad4[_0xe7d4('0x8f')]){var _0x25a6c0=_[_0xe7d4('0x4e')](_0x520ad4['Buckets'],function(_0x4f84ae){return _0x4f84ae[_0xe7d4('0x90')]===_0x4df5b8[_0xe7d4('0x76')];});if(!_0x25a6c0){logger['info'](util[_0xe7d4('0x54')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xd8d27d[_0xe7d4('0x4b')]['id'],_0x4df5b8[_0xe7d4('0x76')]));return createBucket(_0x47e0aa['data1'],_0x47e0aa['data2'],_0x4df5b8[_0xe7d4('0x84')],_0x4df5b8[_0xe7d4('0x76')]);}logger['info'](util[_0xe7d4('0x54')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xd8d27d['params']['id'],_0x4df5b8[_0xe7d4('0x76')]));return;}})[_0xe7d4('0x29')](function(_0x4fae3f){if(_0x2b77fa[_0xe7d4('0x7d')]===_0xe7d4('0x91')){return transcribe(_0xd8d27d[_0xe7d4('0x4b')]['id'],_0x47e0aa['data1'],_0x47e0aa[_0xe7d4('0x8d')],_0x4df5b8[_0xe7d4('0x84')],_0x4df5b8[_0xe7d4('0x76')],_0x2b77fa[_0xe7d4('0x53')],_0x4df5b8[_0xe7d4('0x89')]);}else{logger['info'](util[_0xe7d4('0x54')](_0xe7d4('0x92'),_0xd8d27d[_0xe7d4('0x4b')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xe7d4('0x29')](function(_0x50c809){if(_0x50c809){_0x50c809[_0xe7d4('0x93')]=_0xd8d27d[_0xe7d4('0x50')]['runSentiment'];return _0x2b77fa[_0xe7d4('0x94')](_0x50c809);}})[_0xe7d4('0x29')](respondWithResult(_0x7c3dd3,null))[_0xe7d4('0x49')](handleError(_0x7c3dd3,null));};function writeFile(_0x194ad8,_0x55a9c7){return new Promise(function(_0x2c4ab3,_0x5335b2){fs[_0xe7d4('0x95')](_0x55a9c7,_0x194ad8,function(_0x3dc5ba,_0x2565af){if(_0x3dc5ba){return _0x5335b2(_0x3dc5ba);}else{return _0x2c4ab3(_0x2565af);}});});}exports[_0xe7d4('0x96')]=function(_0x4ed7d4,_0x3f6387,_0x5b77d8){return db[_0xe7d4('0x31')][_0xe7d4('0x80')]({'where':{'id':_0x4ed7d4[_0xe7d4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f6387))['then'](function(_0x39b6db){if(_0x39b6db&&_0x39b6db[_0xe7d4('0x97')]){var _0x41431f=_0x39b6db[_0xe7d4('0x97')];var _0x567261=config[_0xe7d4('0x98')]+_0xe7d4('0x99')+_0x39b6db['id']+'.txt';if(fs[_0xe7d4('0x56')](_0x567261)){return _0x567261;}return writeFile(_0x41431f,_0x567261)[_0xe7d4('0x29')](function(){return _0x567261;});}else{throw new db['Sequelize'][(_0xe7d4('0x5a'))](_0xe7d4('0x9a'));}})['then'](function(_0x570966){return _0x3f6387[_0xe7d4('0x5d')](_0x570966);})['catch'](handleError(_0x3f6387));}; \ No newline at end of file +var _0x0e54=['readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','update','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','merge','find','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','MD5','sequelize','token','$and','push','decryptFile','secrets','isNil','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename'];(function(_0x84e9c,_0x388b14){var _0x36198f=function(_0x18b022){while(--_0x18b022){_0x84e9c['push'](_0x84e9c['shift']());}};_0x36198f(++_0x388b14);}(_0x0e54,0x151));var _0x40e5=function(_0x431ce2,_0x47a544){_0x431ce2=_0x431ce2-0x0;var _0x43ce99=_0x0e54[_0x431ce2];return _0x43ce99;};'use strict';var emlformat=require(_0x40e5('0x0'));var rimraf=require(_0x40e5('0x1'));var zipdir=require(_0x40e5('0x2'));var jsonpatch=require(_0x40e5('0x3'));var rp=require(_0x40e5('0x4'));var moment=require(_0x40e5('0x5'));var BPromise=require(_0x40e5('0x6'));var Mustache=require(_0x40e5('0x7'));var util=require(_0x40e5('0x8'));var path=require(_0x40e5('0x9'));var sox=require(_0x40e5('0xa'));var csv=require(_0x40e5('0xb'));var ejs=require(_0x40e5('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40e5('0xd'));var crypto=require(_0x40e5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x40e5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x40e5('0xf'));var uuidv4=require(_0x40e5('0x10'));var Redis=require(_0x40e5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x40e5('0x12'));var hardwareService=require(_0x40e5('0x13'));var logger=require(_0x40e5('0x14'))(_0x40e5('0x15'));var utils=require(_0x40e5('0x16'));var config=require(_0x40e5('0x17'));var licenseUtil=require(_0x40e5('0x18'));var db=require(_0x40e5('0x19'))['db'];function respondWithStatusCode(_0x2fcb5a,_0x890bd4){_0x890bd4=_0x890bd4||0xcc;return function(_0x5fec6f){if(_0x5fec6f){return _0x2fcb5a[_0x40e5('0x1a')](_0x890bd4);}return _0x2fcb5a[_0x40e5('0x1b')](_0x890bd4)[_0x40e5('0x1c')]();};}function respondWithResult(_0x35790e,_0x413183){_0x413183=_0x413183||0xc8;return function(_0x4988f9){if(_0x4988f9){return _0x35790e['status'](_0x413183)[_0x40e5('0x1d')](_0x4988f9);}};}function respondWithFilteredResult(_0x3f7661,_0x54ec80){return function(_0x4c6f94){if(_0x4c6f94){var _0x2578d1=typeof _0x54ec80['offset']===_0x40e5('0x1e')&&typeof _0x54ec80['limit']===_0x40e5('0x1e');var _0x503e2b=_0x4c6f94['count'];var _0x593dfa=_0x2578d1?0x0:_0x54ec80['offset'];var _0x37b673=_0x2578d1?_0x4c6f94[_0x40e5('0x1f')]:_0x54ec80[_0x40e5('0x20')]+_0x54ec80[_0x40e5('0x21')];var _0x1e44f8;if(_0x37b673>=_0x503e2b){_0x37b673=_0x503e2b;_0x1e44f8=0xc8;}else{_0x1e44f8=0xce;}_0x3f7661[_0x40e5('0x1b')](_0x1e44f8);return _0x3f7661['set']('Content-Range',_0x593dfa+'-'+_0x37b673+'/'+_0x503e2b)[_0x40e5('0x1d')](_0x4c6f94);}return null;};}function patchUpdates(_0xba1956){return function(_0x4bc3bb){try{jsonpatch[_0x40e5('0x22')](_0x4bc3bb,_0xba1956,!![]);}catch(_0x5bca44){return BPromise['reject'](_0x5bca44);}return _0x4bc3bb['save']();};}function saveUpdates(_0x2ee2bd,_0x25d984){return function(_0x3ce53f){if(_0x3ce53f){return _0x3ce53f[_0x40e5('0x23')](_0x2ee2bd)[_0x40e5('0x24')](function(_0x2f00e0){return _0x2f00e0;});}return null;};}function removeEntity(_0x3a6456,_0x3a5a13){return function(_0x436adf){if(_0x436adf){return _0x436adf[_0x40e5('0x25')]()[_0x40e5('0x24')](function(){_0x3a6456[_0x40e5('0x1b')](0xcc)[_0x40e5('0x1c')]();});}};}function handleEntityNotFound(_0x5c832f,_0x7f6927){return function(_0x2bf742){if(!_0x2bf742){_0x5c832f[_0x40e5('0x1a')](0x194);}return _0x2bf742;};}function handleError(_0x53023e,_0x16e224){_0x16e224=_0x16e224||0x1f4;return function(_0x4481c0){logger['error'](_0x4481c0[_0x40e5('0x26')]);if(_0x4481c0[_0x40e5('0x27')]){delete _0x4481c0[_0x40e5('0x27')];}_0x53023e[_0x40e5('0x1b')](_0x16e224)[_0x40e5('0x28')](_0x4481c0);};}exports[_0x40e5('0x29')]=function(_0x1b6f98,_0x2f03b3){var _0x191592={},_0x775bbc={},_0x10be7e={'count':0x0,'rows':[]};var _0xbde8c9=_['map'](db[_0x40e5('0x2a')][_0x40e5('0x2b')],function(_0x48c0d3){return{'name':_0x48c0d3['fieldName'],'type':_0x48c0d3[_0x40e5('0x2c')]['key']};});_0x775bbc[_0x40e5('0x2d')]=_[_0x40e5('0x2e')](_[_0x40e5('0x2f')](_0xbde8c9,'name'),[_0x40e5('0x30')]);_0x775bbc['query']=_[_0x40e5('0x31')](_0x1b6f98[_0x40e5('0x32')]);_0x775bbc[_0x40e5('0x33')]=_[_0x40e5('0x34')](_0x775bbc[_0x40e5('0x2d')],_0x775bbc[_0x40e5('0x32')]);_0x191592['attributes']=_[_0x40e5('0x34')](_0x775bbc[_0x40e5('0x2d')],qs[_0x40e5('0x35')](_0x1b6f98[_0x40e5('0x32')][_0x40e5('0x35')]));_0x191592[_0x40e5('0x36')]=_0x191592['attributes'][_0x40e5('0x37')]?_0x191592[_0x40e5('0x36')]:_0x775bbc[_0x40e5('0x2d')];if(!_0x1b6f98[_0x40e5('0x32')][_0x40e5('0x38')](_0x40e5('0x39'))){_0x191592[_0x40e5('0x21')]=qs['limit'](_0x1b6f98[_0x40e5('0x32')]['limit']);_0x191592['offset']=qs[_0x40e5('0x20')](_0x1b6f98[_0x40e5('0x32')][_0x40e5('0x20')]);}_0x191592[_0x40e5('0x3a')]=qs[_0x40e5('0x3b')](_0x1b6f98[_0x40e5('0x32')]['sort']);_0x191592[_0x40e5('0x3c')]=qs['filters'](_['pick'](_0x1b6f98['query'],_0x775bbc['filters']),_0xbde8c9);if(_0x1b6f98[_0x40e5('0x32')][_0x40e5('0x3d')]){_0x191592[_0x40e5('0x3c')]=_['merge'](_0x191592['where'],{'$or':_[_0x40e5('0x2f')](_0xbde8c9,function(_0x2e8d53){if(_0x2e8d53[_0x40e5('0x2c')]!==_0x40e5('0x3e')){var _0x4213a0={};_0x4213a0[_0x2e8d53[_0x40e5('0x27')]]={'$like':'%'+_0x1b6f98[_0x40e5('0x32')]['filter']+'%'};return _0x4213a0;}})});}_0x191592=_['merge']({},_0x191592,_0x1b6f98[_0x40e5('0x3f')]);var _0xdb5ec={'where':_0x191592[_0x40e5('0x3c')]};return db[_0x40e5('0x2a')]['count'](_0xdb5ec)[_0x40e5('0x24')](function(_0x1ca121){_0x10be7e['count']=_0x1ca121;if(_0x1b6f98[_0x40e5('0x32')][_0x40e5('0x40')]){_0x191592[_0x40e5('0x41')]=[{'all':!![]}];}return db[_0x40e5('0x2a')]['findAll'](_0x191592);})['then'](function(_0x3a3059){_0x10be7e[_0x40e5('0x42')]=_0x3a3059;return _0x10be7e;})['then'](respondWithFilteredResult(_0x2f03b3,_0x191592))[_0x40e5('0x43')](handleError(_0x2f03b3,null));};exports[_0x40e5('0x44')]=function(_0x533ee9,_0x597fda){var _0x1cb1fe={'raw':![],'where':{'id':_0x533ee9['params']['id']}},_0x34f684={};_0x34f684[_0x40e5('0x2d')]=_['keys'](db[_0x40e5('0x2a')][_0x40e5('0x2b')]);_0x34f684[_0x40e5('0x32')]=_[_0x40e5('0x31')](_0x533ee9[_0x40e5('0x32')]);_0x34f684[_0x40e5('0x33')]=_[_0x40e5('0x34')](_0x34f684[_0x40e5('0x2d')],_0x34f684[_0x40e5('0x32')]);_0x1cb1fe[_0x40e5('0x36')]=_[_0x40e5('0x34')](_0x34f684[_0x40e5('0x2d')],qs[_0x40e5('0x35')](_0x533ee9[_0x40e5('0x32')][_0x40e5('0x35')]));_0x1cb1fe[_0x40e5('0x36')]=_0x1cb1fe[_0x40e5('0x36')][_0x40e5('0x37')]?_0x1cb1fe['attributes']:_0x34f684[_0x40e5('0x2d')];if(_0x533ee9[_0x40e5('0x32')][_0x40e5('0x40')]){_0x1cb1fe[_0x40e5('0x41')]=[{'all':!![]}];}_0x1cb1fe=_[_0x40e5('0x45')]({},_0x1cb1fe,_0x533ee9[_0x40e5('0x3f')]);return db['VoiceRecording'][_0x40e5('0x46')](_0x1cb1fe)[_0x40e5('0x24')](handleEntityNotFound(_0x597fda,null))[_0x40e5('0x24')](respondWithResult(_0x597fda,null))[_0x40e5('0x43')](handleError(_0x597fda,null));};exports['create']=function(_0x52c2b3,_0x4414d6){return db['VoiceRecording']['create'](_0x52c2b3[_0x40e5('0x47')],{})[_0x40e5('0x24')](respondWithResult(_0x4414d6,0xc9))[_0x40e5('0x43')](handleError(_0x4414d6,null));};exports[_0x40e5('0x23')]=function(_0xb7690,_0x3d600b){if(_0xb7690[_0x40e5('0x47')]['id']){delete _0xb7690[_0x40e5('0x47')]['id'];}return db[_0x40e5('0x2a')][_0x40e5('0x46')]({'where':{'id':_0xb7690[_0x40e5('0x48')]['id']}})[_0x40e5('0x24')](handleEntityNotFound(_0x3d600b,null))['then'](saveUpdates(_0xb7690[_0x40e5('0x47')],null))[_0x40e5('0x24')](respondWithResult(_0x3d600b,null))[_0x40e5('0x43')](handleError(_0x3d600b,null));};exports[_0x40e5('0x49')]=function(_0x211cdd,_0xbb7799){return db['VoiceRecording'][_0x40e5('0x49')]()[_0x40e5('0x24')](respondWithResult(_0xbb7799,null))[_0x40e5('0x43')](handleError(_0xbb7799,null));};exports[_0x40e5('0x4a')]=function(_0x33e058,_0x2d83a4,_0x3825eb){var _0x5cdab3=require(_0x40e5('0x4b'));var _0x54e17f=![];var _0x1d3cf5={};if(_0x33e058['query']['type']&&_0x33e058[_0x40e5('0x32')]['type']===_0x40e5('0x4c')){_0x1d3cf5[_0x40e5('0x4c')]=_0x33e058[_0x40e5('0x48')]['id'];}else{_0x1d3cf5['id']=_0x33e058[_0x40e5('0x48')]['id'];}return db[_0x40e5('0x2a')][_0x40e5('0x46')]({'where':_0x1d3cf5,'attributes':['id','value'],'raw':!![]})[_0x40e5('0x24')](handleEntityNotFound(_0x2d83a4,null))[_0x40e5('0x24')](function(_0x4cefee){if(_0x4cefee){var _0x5ef85e=_0x4cefee[_0x40e5('0x4d')];var _0x1bf45e=util[_0x40e5('0x30')](_0x40e5('0x4e'),_0x5ef85e);if(fs[_0x40e5('0x4f')](_0x1bf45e)){_0x54e17f=!![];return _0x5cdab3['decryptFile'](_0x1bf45e,_0x5ef85e,config['secrets'][_0x40e5('0x50')])[_0x40e5('0x24')](function(){return _0x4cefee;});}return _0x4cefee;}})[_0x40e5('0x24')](function(_0x56150d){if(_0x56150d){var _0x483a90=_0x56150d[_0x40e5('0x4d')];if(!fs['existsSync'](_0x483a90)){throw new db[(_0x40e5('0x51'))][(_0x40e5('0x52'))](_0x40e5('0x53'));}if(_0x56150d['filename']){return _0x2d83a4[_0x40e5('0x4a')](_0x483a90,_0x56150d[_0x40e5('0x54')]+path[_0x40e5('0x55')](_0x483a90),function(){if(_0x54e17f){fs[_0x40e5('0x56')](_0x483a90);}});}else{return _0x2d83a4['download'](_0x483a90,function(_0x212b50){if(_0x54e17f){fs[_0x40e5('0x56')](_0x483a90);}});}}})[_0x40e5('0x43')](function(_0x150217){if(_0x150217[_0x40e5('0x57')]===_0x40e5('0x53')){_0x2d83a4['status'](0x194)['send'](_0x40e5('0x58'));}else{return handleError(_0x2d83a4,null);}});};exports[_0x40e5('0x59')]=function(_0x585993,_0x4c66d6,_0x47c5d4){var _0x5d1e62=require(_0x40e5('0x4b'));var _0x22d3b3=![];var _0x502a30={'$and':[db['sequelize'][_0x40e5('0x3c')](db['sequelize']['fn'](_0x40e5('0x5a'),db[_0x40e5('0x5b')]['col'](_0x40e5('0x4c'))),_0x585993[_0x40e5('0x32')][_0x40e5('0x5c')])]};if(_0x585993[_0x40e5('0x32')][_0x40e5('0x2c')]&&_0x585993['query'][_0x40e5('0x2c')]===_0x40e5('0x4c')){_0x502a30[_0x40e5('0x5d')][_0x40e5('0x5e')]({'uniqueid':_0x585993[_0x40e5('0x48')]['id']});}else{_0x502a30[_0x40e5('0x5d')][_0x40e5('0x5e')]({'id':_0x585993[_0x40e5('0x48')]['id']});}return db[_0x40e5('0x2a')][_0x40e5('0x46')]({'where':_0x502a30,'attributes':['id','value'],'raw':!![]})[_0x40e5('0x24')](handleEntityNotFound(_0x4c66d6,null))[_0x40e5('0x24')](function(_0x1709a1){if(_0x1709a1){var _0x4a8e17=util[_0x40e5('0x30')](_0x40e5('0x4e'),_0x1709a1[_0x40e5('0x4d')]);if(fs['existsSync'](_0x4a8e17)){_0x22d3b3=!![];return _0x5d1e62[_0x40e5('0x5f')](_0x4a8e17,_0x1709a1[_0x40e5('0x4d')],config[_0x40e5('0x60')][_0x40e5('0x50')])[_0x40e5('0x24')](function(){return _0x1709a1;});}return _0x1709a1;}})[_0x40e5('0x24')](function(_0x5202f5){if(_0x5202f5){if(!fs[_0x40e5('0x4f')](_0x5202f5['value'])){throw new db[(_0x40e5('0x51'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x5202f5[_0x40e5('0x54')]){return _0x4c66d6[_0x40e5('0x4a')](_0x5202f5[_0x40e5('0x4d')],_0x5202f5[_0x40e5('0x54')]+path[_0x40e5('0x55')](_0x5202f5[_0x40e5('0x4d')]),function(){if(_0x22d3b3){fs[_0x40e5('0x56')](_0x5202f5[_0x40e5('0x4d')]);}});}else{return _0x4c66d6[_0x40e5('0x4a')](_0x5202f5[_0x40e5('0x4d')],function(_0x47e895){if(_0x22d3b3){fs[_0x40e5('0x56')](_0x5202f5[_0x40e5('0x4d')]);}});}}})[_0x40e5('0x43')](handleError(_0x4c66d6,null));};exports[_0x40e5('0x25')]=function(_0x72a439,_0x491d74){return db[_0x40e5('0x2a')][_0x40e5('0x46')]({'where':{'id':_0x72a439[_0x40e5('0x48')]['id']}})[_0x40e5('0x24')](function(_0x33eff4){if(_[_0x40e5('0x61')](_0x33eff4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x33eff4;})[_0x40e5('0x24')](function(_0x5acb0e){var _0x1d0fd4=_0x5acb0e[_0x40e5('0x4d')];logger['info'](_0x40e5('0x62'),_0x1d0fd4);if(!_[_0x40e5('0x61')](_0x5acb0e[_0x40e5('0x4d')])&&fs[_0x40e5('0x4f')](_0x1d0fd4)){logger['info'](_0x40e5('0x63')+_0x1d0fd4+_0x40e5('0x64'));fs[_0x40e5('0x65')](_0x1d0fd4);}_0x1d0fd4=_0x1d0fd4+_0x40e5('0x66');if(!_['isNil'](_0x5acb0e[_0x40e5('0x4d')])&&fs['existsSync'](_0x1d0fd4)){logger[_0x40e5('0x67')]('File:\x20\x22'+_0x1d0fd4+_0x40e5('0x64'));fs[_0x40e5('0x65')](_0x1d0fd4);}return _0x5acb0e;})[_0x40e5('0x24')](function(_0x29a2db){if(!_0x29a2db)throw new InternalError();return _0x29a2db[_0x40e5('0x25')]();})[_0x40e5('0x24')](function(){_0x491d74[_0x40e5('0x1b')](0xcc)['end']();})[_0x40e5('0x43')](handleError(_0x491d74,null));};function getBucketslist(_0x4ae1a4,_0x1e7da5,_0x4661bf){return new Promise(function(_0x5715a2,_0x13d687){var _0x552459=new AWS['S3']({'accessKeyId':_0x1e7da5,'secretAccessKey':_0x4ae1a4,'region':_0x4661bf});_0x552459[_0x40e5('0x68')]({},function(_0x428f7f,_0x1dd468){if(_0x428f7f){return _0x13d687(_0x428f7f);}else{return _0x5715a2(_0x1dd468);}});});}function createBucket(_0x2f7ce9,_0x256bd5,_0x71e92f,_0xc56130){return new Promise(function(_0x472b38,_0x11dcee){var _0x5a4620=new AWS['S3']({'accessKeyId':_0x256bd5,'secretAccessKey':_0x2f7ce9,'region':_0x71e92f});_0x5a4620[_0x40e5('0x69')]({'Bucket':_0xc56130},function(_0x5d6012,_0x22bdda){if(_0x5d6012){return _0x11dcee(_0x5d6012);}else{return _0x472b38(_0x22bdda);}});});}function uploadFile(_0x35f148,_0x4c7027,_0x5d67f3,_0x4c02b6,_0x31c5f3,_0x2d81e9){return new Promise(function(_0x301321,_0x345d65){var _0x3d90ce=new AWS['S3']({'accessKeyId':_0x4c7027,'secretAccessKey':_0x35f148,'region':_0x5d67f3});_0x3d90ce[_0x40e5('0x6a')]({'Bucket':_0x4c02b6,'Key':_0x31c5f3,'Body':_0x2d81e9},function(_0x566d18,_0x1989de){if(_0x566d18){return _0x345d65(_0x566d18);}else{return _0x301321(_0x1989de);}});});}function startTranscribe(_0x236ecb,_0x35c341,_0x15f31d,_0x434f94,_0x2f6cd8,_0x504a61){return new Promise(function(_0x10e90c,_0x1f7199){var _0x1fd4d0=new AWS[(_0x40e5('0x6b'))]({'accessKeyId':_0x35c341,'secretAccessKey':_0x236ecb,'region':_0x15f31d});_0x1fd4d0['startTranscriptionJob']({'TranscriptionJobName':_0x434f94,'LanguageCode':_0x2f6cd8,'Media':{'MediaFileUri':_0x504a61}},function(_0x59585b,_0x29c4f9){if(_0x59585b){return _0x1f7199(_0x59585b);}else{return _0x10e90c(_0x29c4f9);}});});}function transcribe(_0x574a21,_0x583795,_0x1f9f06,_0x3908f4,_0x27ef0c,_0x4fc883,_0x9754d2){return new Promise(function(_0x4ea54d,_0x845496){var _0x25093d={};logger[_0x40e5('0x67')](util[_0x40e5('0x30')](_0x40e5('0x6c'),_0x574a21,_0x27ef0c));return uploadFile(_0x583795,_0x1f9f06,_0x3908f4,_0x27ef0c,path[_0x40e5('0x6d')](_0x4fc883),fs[_0x40e5('0x6e')](_0x4fc883))[_0x40e5('0x24')](function(_0x33f86d){logger[_0x40e5('0x67')](util[_0x40e5('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x574a21,_0x27ef0c,_0x33f86d['Location']));_0x25093d[_0x40e5('0x6f')]=_0x33f86d[_0x40e5('0x70')];_0x25093d[_0x40e5('0x71')]=_0x33f86d[_0x40e5('0x72')];logger[_0x40e5('0x67')](util[_0x40e5('0x30')](_0x40e5('0x73'),_0x574a21));return startTranscribe(_0x583795,_0x1f9f06,_0x3908f4,uuidv4(),_0x9754d2,_0x33f86d[_0x40e5('0x72')]);})[_0x40e5('0x24')](function(_0x5fd09e){logger[_0x40e5('0x67')](util[_0x40e5('0x30')](_0x40e5('0x74'),_0x574a21,_0x5fd09e[_0x40e5('0x75')][_0x40e5('0x76')]));_0x25093d[_0x40e5('0x77')]=_0x5fd09e['TranscriptionJob']['TranscriptionJobName'];_0x25093d[_0x40e5('0x78')]=_0x5fd09e[_0x40e5('0x75')][_0x40e5('0x79')];return _0x4ea54d(_0x25093d);})[_0x40e5('0x43')](function(_0x516e97){return _0x845496(_0x516e97);});});}exports[_0x40e5('0x7a')]=function(_0x500142,_0x55939a,_0x3286a6){var _0x2d5e1b;var _0xb7dbe6;var _0x365adf;var _0x10e93b=require('../../components/encryptor');return db[_0x40e5('0x2a')][_0x40e5('0x7b')]({'where':{'id':_0x500142[_0x40e5('0x48')]['id']}})['then'](function(_0x3b6fa4){if(_0x3b6fa4){var _0x344801=util['format'](_0x40e5('0x4e'),_0x3b6fa4[_0x40e5('0x4d')]);if(fs['existsSync'](_0x344801)){cypher=!![];return _0x10e93b['decryptFile'](_0x344801,_0x3b6fa4[_0x40e5('0x4d')],config[_0x40e5('0x60')][_0x40e5('0x50')])['then'](function(){return _0x3b6fa4;});}return _0x3b6fa4;}})['then'](function(_0x247535){if(!_0x247535){throw new db[(_0x40e5('0x51'))][(_0x40e5('0x52'))](_0x40e5('0x7c'));}_0xb7dbe6=_0x247535;return db[_0x40e5('0x7d')]['findOne']({'where':{'id':0x1}});})[_0x40e5('0x24')](handleEntityNotFound(_0x55939a,null))['then'](function(_0x3b1394){if(_0x3b1394){_0x2d5e1b=_0x3b1394;if(!_0x2d5e1b[_0x40e5('0x7e')]||!_0x2d5e1b['transcribeAccountId']||!_0x2d5e1b['transcribeRegion']||!_0x2d5e1b['language']||!_0x2d5e1b['bucket']){throw new db['Sequelize']['ValidationError'](_0x40e5('0x7f'));}if(_0x500142[_0x40e5('0x47')][_0x40e5('0x80')]&&(!_0x2d5e1b['sentiment']||!_0x2d5e1b[_0x40e5('0x81')]||!_0x2d5e1b[_0x40e5('0x82')]||!_0x2d5e1b[_0x40e5('0x83')]||!_0x2d5e1b[_0x40e5('0x6f')])){throw new db[(_0x40e5('0x51'))][(_0x40e5('0x52'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x40e5('0x84')]['findOne']({'where':{'id':_0x2d5e1b[_0x40e5('0x85')]}});}})[_0x40e5('0x24')](function(_0x12a14a){if(!_0x12a14a){throw new db[(_0x40e5('0x51'))]['ValidationError'](_0x40e5('0x86'));}if(!_0x12a14a[_0x40e5('0x87')]||!_0x12a14a[_0x40e5('0x88')]){throw new db[(_0x40e5('0x51'))][(_0x40e5('0x52'))]('Cloud\x20Provider\x20not\x20configured');}_0x365adf=_0x12a14a;return getBucketslist(_0x365adf[_0x40e5('0x87')],_0x365adf['data2'],_0x2d5e1b['transcribeRegion']);})[_0x40e5('0x24')](function(_0x3178da){if(_0x3178da&&_0x3178da['Buckets']){var _0x4f3601=_[_0x40e5('0x46')](_0x3178da[_0x40e5('0x89')],function(_0x3b2519){return _0x3b2519[_0x40e5('0x8a')]===_0x2d5e1b[_0x40e5('0x6f')];});if(!_0x4f3601){logger[_0x40e5('0x67')](util['format'](_0x40e5('0x8b'),_0x500142[_0x40e5('0x48')]['id'],_0x2d5e1b[_0x40e5('0x6f')]));return createBucket(_0x365adf[_0x40e5('0x87')],_0x365adf[_0x40e5('0x88')],_0x2d5e1b[_0x40e5('0x8c')],_0x2d5e1b[_0x40e5('0x6f')]);}logger[_0x40e5('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x500142[_0x40e5('0x48')]['id'],_0x2d5e1b[_0x40e5('0x6f')]));return;}})[_0x40e5('0x24')](function(_0x2a6e7){if(_0xb7dbe6['transcribeStatus']==='NEW'){return transcribe(_0x500142[_0x40e5('0x48')]['id'],_0x365adf[_0x40e5('0x87')],_0x365adf[_0x40e5('0x88')],_0x2d5e1b[_0x40e5('0x8c')],_0x2d5e1b[_0x40e5('0x6f')],_0xb7dbe6[_0x40e5('0x4d')],_0x2d5e1b['language']);}else{logger[_0x40e5('0x67')](util[_0x40e5('0x30')](_0x40e5('0x8d'),_0x500142[_0x40e5('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x40e5('0x24')](function(_0x3bc1c6){if(_0x3bc1c6){_0x3bc1c6[_0x40e5('0x8e')]=_0x500142[_0x40e5('0x47')]['runSentiment'];return _0xb7dbe6[_0x40e5('0x8f')](_0x3bc1c6);}})[_0x40e5('0x24')](respondWithResult(_0x55939a,null))[_0x40e5('0x43')](handleError(_0x55939a,null));};function writeFile(_0x837376,_0x20534e){return new Promise(function(_0x279b23,_0x29d109){fs[_0x40e5('0x90')](_0x20534e,_0x837376,function(_0x2d007d,_0x592796){if(_0x2d007d){return _0x29d109(_0x2d007d);}else{return _0x279b23(_0x592796);}});});}exports['downloadTranscribe']=function(_0x4fb5a0,_0x50f127,_0x24ea74){return db[_0x40e5('0x2a')]['findOne']({'where':{'id':_0x4fb5a0[_0x40e5('0x48')]['id']}})['then'](handleEntityNotFound(_0x50f127))[_0x40e5('0x24')](function(_0x261ce5){if(_0x261ce5&&_0x261ce5[_0x40e5('0x91')]){var _0x1de5b0=_0x261ce5['fileText'];var _0x4873f1=config[_0x40e5('0x92')]+_0x40e5('0x93')+_0x261ce5['id']+'.txt';if(fs[_0x40e5('0x4f')](_0x4873f1)){return _0x4873f1;}return writeFile(_0x1de5b0,_0x4873f1)[_0x40e5('0x24')](function(){return _0x4873f1;});}else{throw new db['Sequelize'][(_0x40e5('0x52'))](_0x40e5('0x94'));}})[_0x40e5('0x24')](function(_0x1a3e24){return _0x50f127[_0x40e5('0x4a')](_0x1a3e24);})[_0x40e5('0x43')](handleError(_0x50f127));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 58410be..0c4d38f 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 _0x64a3=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x64a3,0xe7));var _0x364a=function(_0x55a41a,_0x451237){_0x55a41a=_0x55a41a-0x0;var _0x1010eb=_0x64a3[_0x55a41a];return _0x1010eb;};'use strict';var _=require(_0x364a('0x0'));var util=require(_0x364a('0x1'));var logger=require(_0x364a('0x2'))('api');var moment=require(_0x364a('0x3'));var BPromise=require('bluebird');var rp=require(_0x364a('0x4'));var fs=require('fs');var path=require(_0x364a('0x5'));var rimraf=require('rimraf');var config=require(_0x364a('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x364a('0x7')]=function(_0x3cfdf5,_0x2d6f88){return _0x3cfdf5['define'](_0x364a('0x8'),attributes,{'tableName':_0x364a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x364a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d8=['voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x5a4d9c,_0x29ad54){var _0xb25bed=function(_0x549108){while(--_0x549108){_0x5a4d9c['push'](_0x5a4d9c['shift']());}};_0xb25bed(++_0x29ad54);}(_0xa3d8,0xd2));var _0x8a3d=function(_0xdb5985,_0x39d9be){_0xdb5985=_0xdb5985-0x0;var _0x252cc0=_0xa3d8[_0xdb5985];return _0x252cc0;};'use strict';var _=require(_0x8a3d('0x0'));var util=require(_0x8a3d('0x1'));var logger=require('../../config/logger')(_0x8a3d('0x2'));var moment=require(_0x8a3d('0x3'));var BPromise=require(_0x8a3d('0x4'));var rp=require(_0x8a3d('0x5'));var fs=require('fs');var path=require(_0x8a3d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a3d('0x7'));module[_0x8a3d('0x8')]=function(_0x4b1e8c,_0x2f1527){return _0x4b1e8c[_0x8a3d('0x9')](_0x8a3d('0xa'),attributes,{'tableName':_0x8a3d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a3d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 04a76f8..adc6407 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 _0xd7d1=['unlink','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x44f758,_0x5c3458){_0x44f758=_0x44f758-0x0;var _0x2d9dcd=_0xd7d1[_0x44f758];return _0x2d9dcd;};'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']('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('VoiceRecording,\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);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['VoiceRecording'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2['options'][_0x1d7d('0x1e')]||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['attributes']||null:null,'limit':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['limit']||null:null})['then'](function(_0x1dcaf2){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger['debug'](_0x1d7d('0x19'),_0x4db4f2,JSON[_0x1d7d('0x13')](_0x1dcaf2));_0x191024(_0x1dcaf2);})[_0x1d7d('0x18')](function(_0x21e59){logger['error'](_0x1d7d('0x19'),_0x21e59[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f['error'](0x1f4,_0x21e59['message']));});});};exports[_0x1d7d('0x1f')]=function(_0x52c618){var _0x38c323=this;return new Promise(function(_0x2d4de4,_0x3bc6e8){var _0x22c40d=require(_0x1d7d('0x20'));var _0x59f827;return db[_0x1d7d('0x21')][_0x1d7d('0x22')]({'attributes':['id',_0x1d7d('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x78adbe){_0x59f827=_0x78adbe;return db[_0x1d7d('0x24')][_0x1d7d('0x25')](_0x52c618['body']);})['then'](function(_0x53e25c){if(_0x59f827[_0x1d7d('0x23')]&&fs[_0x1d7d('0x26')](_0x53e25c['value'])){var _0x1ebcbc=util[_0x1d7d('0x27')](_0x1d7d('0x28'),_0x53e25c[_0x1d7d('0x29')]);return _0x22c40d[_0x1d7d('0x2a')](_0x53e25c[_0x1d7d('0x29')],_0x1ebcbc,config[_0x1d7d('0x2b')][_0x1d7d('0x2c')])[_0x1d7d('0xe')](function(){fs[_0x1d7d('0x2d')](_0x53e25c['value']);logger['info'](_0x1d7d('0x2e'));return _0x53e25c;});}return _0x53e25c;})[_0x1d7d('0xe')](function(_0x90e852){logger[_0x1d7d('0xf')](_0x1d7d('0x1f'),_0x52c618);logger[_0x1d7d('0x2f')](_0x1d7d('0x1f'),_0x52c618,JSON[_0x1d7d('0x13')](_0x90e852));_0x2d4de4(_0x90e852);})[_0x1d7d('0x18')](function(_0x47b6b2){logger[_0x1d7d('0x14')](_0x1d7d('0x1f'),_0x47b6b2[_0x1d7d('0x16')],_0x52c618);_0x3bc6e8(_0x38c323[_0x1d7d('0x14')](0x1f4,_0x47b6b2['message']));});});}; \ No newline at end of file +var _0xfcf0=['request\x20sent','stringify','error','message','result','UpdateVoiceRecording','update','body','options','attributes','limit','then','catch','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfcf0,0x138));var _0x0fcf=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0xfcf0[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['VoiceRecording'][_0x0fcf('0x16')](_0x19cfbd[_0x0fcf('0x17')],{'raw':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')]['where']||null:null,'attributes':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x19')]||null:null,'limit':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x1a')]||null:null})[_0x0fcf('0x1b')](function(_0x41b20b){logger[_0x0fcf('0xd')](_0x0fcf('0x15'),_0x19cfbd);logger['debug'](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x41b20b));_0x18ea32(_0x41b20b);})[_0x0fcf('0x1c')](function(_0xd6f8b5){logger[_0x0fcf('0x12')](_0x0fcf('0x15'),_0xd6f8b5[_0x0fcf('0x13')],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0xd6f8b5[_0x0fcf('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x18965e){var _0xc107a=this;return new Promise(function(_0x41b7a2,_0x2f198b){var _0x3876ed=require(_0x0fcf('0x1d'));var _0x2730b0;return db['Setting'][_0x0fcf('0x1e')]({'attributes':['id',_0x0fcf('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x0fcf('0x1b')](function(_0x35180d){_0x2730b0=_0x35180d;return db['VoiceRecording']['create'](_0x18965e['body']);})[_0x0fcf('0x1b')](function(_0x50b7df){if(_0x2730b0[_0x0fcf('0x1f')]&&fs[_0x0fcf('0x20')](_0x50b7df['value'])){var _0xdfd3ec=util[_0x0fcf('0x21')](_0x0fcf('0x22'),_0x50b7df[_0x0fcf('0x23')]);return _0x3876ed[_0x0fcf('0x24')](_0x50b7df[_0x0fcf('0x23')],_0xdfd3ec,config['secrets'][_0x0fcf('0x25')])[_0x0fcf('0x1b')](function(){fs[_0x0fcf('0x26')](_0x50b7df[_0x0fcf('0x23')]);logger[_0x0fcf('0xd')](_0x0fcf('0x27'));return _0x50b7df;});}return _0x50b7df;})['then'](function(_0x208433){logger[_0x0fcf('0xd')](_0x0fcf('0x28'),_0x18965e);logger[_0x0fcf('0xf')](_0x0fcf('0x28'),_0x18965e,JSON[_0x0fcf('0x11')](_0x208433));_0x41b7a2(_0x208433);})[_0x0fcf('0x1c')](function(_0x344957){logger[_0x0fcf('0x12')](_0x0fcf('0x28'),_0x344957[_0x0fcf('0x13')],_0x18965e);_0x2f198b(_0xc107a[_0x0fcf('0x12')](0x1f4,_0x344957[_0x0fcf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e96f47f..a33c3b8 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 _0xdb63=['destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x351820,_0xc0c913){var _0x28b36a=function(_0x5160d4){while(--_0x5160d4){_0x351820['push'](_0x351820['shift']());}};_0x28b36a(++_0xc0c913);}(_0xdb63,0x192));var _0x3db6=function(_0x53a9ac,_0x47e703){_0x53a9ac=_0x53a9ac-0x0;var _0x1bdfa5=_0xdb63[_0x53a9ac];return _0x1bdfa5;};'use strict';var multer=require(_0x3db6('0x0'));var util=require('util');var path=require(_0x3db6('0x1'));var timeout=require('connect-timeout');var express=require(_0x3db6('0x2'));var router=express[_0x3db6('0x3')]();var fs_extra=require(_0x3db6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3db6('0x5'));var controller=require(_0x3db6('0x6'));router[_0x3db6('0x7')]('/',auth[_0x3db6('0x8')](),controller[_0x3db6('0x9')]);router['get'](_0x3db6('0xa'),auth[_0x3db6('0x8')](),controller[_0x3db6('0xb')]);router[_0x3db6('0x7')](_0x3db6('0xc'),auth[_0x3db6('0x8')](),controller[_0x3db6('0xd')]);router[_0x3db6('0xe')]('/',auth[_0x3db6('0x8')](),controller[_0x3db6('0xf')]);router[_0x3db6('0x10')](_0x3db6('0xc'),auth[_0x3db6('0x8')](),controller['update']);router[_0x3db6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3db6('0x12')]);module[_0x3db6('0x13')]=router; \ No newline at end of file +var _0xc7fa=['../../config/environment','./voiceTransferReport.controller','isAuthenticated','get','/describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x16e99c,_0x38bf61){var _0x4972cf=function(_0x438f5d){while(--_0x438f5d){_0x16e99c['push'](_0x16e99c['shift']());}};_0x4972cf(++_0x38bf61);}(_0xc7fa,0x1ce));var _0xac7f=function(_0x384ab5,_0x103dbd){_0x384ab5=_0x384ab5-0x0;var _0x1e6e58=_0xc7fa[_0x384ab5];return _0x1e6e58;};'use strict';var multer=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var path=require(_0xac7f('0x2'));var timeout=require(_0xac7f('0x3'));var express=require(_0xac7f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xac7f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac7f('0x6'));var controller=require(_0xac7f('0x7'));router['get']('/',auth[_0xac7f('0x8')](),controller['index']);router[_0xac7f('0x9')](_0xac7f('0xa'),auth[_0xac7f('0x8')](),controller['describe']);router['get']('/:id',auth[_0xac7f('0x8')](),controller[_0xac7f('0xb')]);router['post']('/',auth[_0xac7f('0x8')](),controller[_0xac7f('0xc')]);router[_0xac7f('0xd')](_0xac7f('0xe'),auth[_0xac7f('0x8')](),controller[_0xac7f('0xf')]);router[_0xac7f('0x10')](_0xac7f('0xe'),auth[_0xac7f('0x8')](),controller[_0xac7f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index eea9795..fb67111 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 _0x8d17=['sequelize','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x256a07,_0x10ca31){var _0x205d61=function(_0x595eaa){while(--_0x595eaa){_0x256a07['push'](_0x256a07['shift']());}};_0x205d61(++_0x10ca31);}(_0x8d17,0x111));var _0x78d1=function(_0x34495a,_0x1cc447){_0x34495a=_0x34495a-0x0;var _0x399993=_0x8d17[_0x34495a];return _0x399993;};'use strict';var Sequelize=require(_0x78d1('0x0'));var moment=require('moment');module[_0x78d1('0x1')]={'type':{'type':Sequelize[_0x78d1('0x2')](_0x78d1('0x3'),_0x78d1('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x78d1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x78d1('0x5')]},'transferercalleridname':{'type':Sequelize[_0x78d1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x78d1('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x78d1('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x78d1('0x5')]},'transfereechannel':{'type':Sequelize[_0x78d1('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x78d1('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x78d1('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x78d1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x78d1('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x78d1('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x78d1('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x78d1('0x6'),'No')},'context':{'type':Sequelize[_0x78d1('0x5')]},'extension':{'type':Sequelize[_0x78d1('0x5')]}}; \ No newline at end of file +var _0x08d1=['ENUM','blind','attended','STRING','Yes','sequelize','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x08d1,0xe5));var _0x108d=function(_0x51560e,_0x5d29ac){_0x51560e=_0x51560e-0x0;var _0x2a44f1=_0x08d1[_0x51560e];return _0x2a44f1;};'use strict';var Sequelize=require(_0x108d('0x0'));var moment=require('moment');module[_0x108d('0x1')]={'type':{'type':Sequelize[_0x108d('0x2')](_0x108d('0x3'),_0x108d('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x108d('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x108d('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x108d('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x108d('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x108d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x108d('0x5')]},'transfereechannel':{'type':Sequelize[_0x108d('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x108d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x108d('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x108d('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x108d('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x108d('0x6'),'No')},'context':{'type':Sequelize[_0x108d('0x5')]},'extension':{'type':Sequelize[_0x108d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5548e49..10d7aa5 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 _0xf125=['hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','VoiceTransferReport','rawAttributes','key','model','query','filters','intersection','attributes','fields'];(function(_0x1dbbce,_0x48410a){var _0x30b20d=function(_0x239d3e){while(--_0x239d3e){_0x1dbbce['push'](_0x1dbbce['shift']());}};_0x30b20d(++_0x48410a);}(_0xf125,0x1c0));var _0x5f12=function(_0x3f87b7,_0x1ec4d9){_0x3f87b7=_0x3f87b7-0x0;var _0x223750=_0xf125[_0x3f87b7];return _0x223750;};'use strict';var emlformat=require(_0x5f12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f12('0x1'));var jsonpatch=require(_0x5f12('0x2'));var rp=require(_0x5f12('0x3'));var moment=require(_0x5f12('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f12('0x5'));var util=require(_0x5f12('0x6'));var path=require('path');var sox=require(_0x5f12('0x7'));var csv=require(_0x5f12('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f12('0x9'));var squel=require(_0x5f12('0xa'));var crypto=require(_0x5f12('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5f12('0xc'));var toCsv=require(_0x5f12('0x8'));var querystring=require(_0x5f12('0xd'));var Papa=require(_0x5f12('0xe'));var Redis=require(_0x5f12('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5f12('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f12('0x11'));var logger=require(_0x5f12('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x5f12('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f12('0x14'))['db'];function respondWithStatusCode(_0x282549,_0x3eb5ba){_0x3eb5ba=_0x3eb5ba||0xcc;return function(_0x546484){if(_0x546484){return _0x282549[_0x5f12('0x15')](_0x3eb5ba);}return _0x282549[_0x5f12('0x16')](_0x3eb5ba)['end']();};}function respondWithResult(_0x93a01e,_0xaa3323){_0xaa3323=_0xaa3323||0xc8;return function(_0x4547ca){if(_0x4547ca){return _0x93a01e[_0x5f12('0x16')](_0xaa3323)[_0x5f12('0x17')](_0x4547ca);}};}function respondWithFilteredResult(_0x1a3481,_0x29fd42){return function(_0x4ba170){if(_0x4ba170){var _0x4b87a6=typeof _0x29fd42['offset']===_0x5f12('0x18')&&typeof _0x29fd42['limit']===_0x5f12('0x18');var _0x3d710c=_0x4ba170[_0x5f12('0x19')];var _0x1d17c6=_0x4b87a6?0x0:_0x29fd42[_0x5f12('0x1a')];var _0x418097=_0x4b87a6?_0x4ba170[_0x5f12('0x19')]:_0x29fd42[_0x5f12('0x1a')]+_0x29fd42[_0x5f12('0x1b')];var _0x83aef2;if(_0x418097>=_0x3d710c){_0x418097=_0x3d710c;_0x83aef2=0xc8;}else{_0x83aef2=0xce;}_0x1a3481[_0x5f12('0x16')](_0x83aef2);return _0x1a3481[_0x5f12('0x1c')](_0x5f12('0x1d'),_0x1d17c6+'-'+_0x418097+'/'+_0x3d710c)[_0x5f12('0x17')](_0x4ba170);}return null;};}function patchUpdates(_0x343f89){return function(_0x5e5d1f){try{jsonpatch[_0x5f12('0x1e')](_0x5e5d1f,_0x343f89,!![]);}catch(_0x4c6880){return BPromise['reject'](_0x4c6880);}return _0x5e5d1f[_0x5f12('0x1f')]();};}function saveUpdates(_0x3e64c1,_0x1733f1){return function(_0x32247b){if(_0x32247b){return _0x32247b[_0x5f12('0x20')](_0x3e64c1)[_0x5f12('0x21')](function(_0x464961){return _0x464961;});}return null;};}function removeEntity(_0x589cbc,_0x5c0bde){return function(_0xe6c2c){if(_0xe6c2c){return _0xe6c2c[_0x5f12('0x22')]()['then'](function(){_0x589cbc['status'](0xcc)[_0x5f12('0x23')]();});}};}function handleEntityNotFound(_0x5ab9e6,_0x4e669c){return function(_0x52cfa9){if(!_0x52cfa9){_0x5ab9e6[_0x5f12('0x15')](0x194);}return _0x52cfa9;};}function handleError(_0x4aae5b,_0x2d114a){_0x2d114a=_0x2d114a||0x1f4;return function(_0x18273e){logger[_0x5f12('0x24')](_0x18273e[_0x5f12('0x25')]);if(_0x18273e[_0x5f12('0x26')]){delete _0x18273e[_0x5f12('0x26')];}_0x4aae5b[_0x5f12('0x16')](_0x2d114a)['send'](_0x18273e);};}exports['index']=function(_0x32ab1c,_0x51738d){var _0x416f74={},_0x1b3a46={},_0x4afd97={'count':0x0,'rows':[]};var _0x40de90=_[_0x5f12('0x27')](db[_0x5f12('0x28')][_0x5f12('0x29')],function(_0x200662){return{'name':_0x200662['fieldName'],'type':_0x200662['type'][_0x5f12('0x2a')]};});_0x1b3a46[_0x5f12('0x2b')]=_[_0x5f12('0x27')](_0x40de90,_0x5f12('0x26'));_0x1b3a46[_0x5f12('0x2c')]=_['keys'](_0x32ab1c['query']);_0x1b3a46[_0x5f12('0x2d')]=_[_0x5f12('0x2e')](_0x1b3a46[_0x5f12('0x2b')],_0x1b3a46[_0x5f12('0x2c')]);_0x416f74[_0x5f12('0x2f')]=_[_0x5f12('0x2e')](_0x1b3a46[_0x5f12('0x2b')],qs[_0x5f12('0x30')](_0x32ab1c[_0x5f12('0x2c')][_0x5f12('0x30')]));_0x416f74[_0x5f12('0x2f')]=_0x416f74[_0x5f12('0x2f')]['length']?_0x416f74[_0x5f12('0x2f')]:_0x1b3a46[_0x5f12('0x2b')];if(!_0x32ab1c['query'][_0x5f12('0x31')](_0x5f12('0x32'))){_0x416f74[_0x5f12('0x1b')]=qs[_0x5f12('0x1b')](_0x32ab1c[_0x5f12('0x2c')][_0x5f12('0x1b')]);_0x416f74['offset']=qs[_0x5f12('0x1a')](_0x32ab1c[_0x5f12('0x2c')][_0x5f12('0x1a')]);}_0x416f74[_0x5f12('0x33')]=qs[_0x5f12('0x34')](_0x32ab1c[_0x5f12('0x2c')]['sort']);_0x416f74[_0x5f12('0x35')]=qs[_0x5f12('0x2d')](_[_0x5f12('0x36')](_0x32ab1c['query'],_0x1b3a46['filters']),_0x40de90);if(_0x32ab1c['query'][_0x5f12('0x37')]){_0x416f74[_0x5f12('0x35')]=_['merge'](_0x416f74[_0x5f12('0x35')],{'$or':_['map'](_0x40de90,function(_0x43bc50){if(_0x43bc50[_0x5f12('0x38')]!==_0x5f12('0x39')){var _0x3e4dc9={};_0x3e4dc9[_0x43bc50[_0x5f12('0x26')]]={'$like':'%'+_0x32ab1c[_0x5f12('0x2c')][_0x5f12('0x37')]+'%'};return _0x3e4dc9;}})});}_0x416f74=_['merge']({},_0x416f74,_0x32ab1c[_0x5f12('0x3a')]);var _0x3e91f2={'where':_0x416f74[_0x5f12('0x35')]};return db[_0x5f12('0x28')]['count'](_0x3e91f2)[_0x5f12('0x21')](function(_0x5cb45f){_0x4afd97['count']=_0x5cb45f;if(_0x32ab1c[_0x5f12('0x2c')][_0x5f12('0x3b')]){_0x416f74[_0x5f12('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x5f12('0x3d')](_0x416f74);})[_0x5f12('0x21')](function(_0x461a91){_0x4afd97[_0x5f12('0x3e')]=_0x461a91;return _0x4afd97;})[_0x5f12('0x21')](respondWithFilteredResult(_0x51738d,_0x416f74))[_0x5f12('0x3f')](handleError(_0x51738d,null));};exports[_0x5f12('0x40')]=function(_0x113a9d,_0x3c475a){var _0x69daf9={'raw':!![],'where':{'id':_0x113a9d[_0x5f12('0x41')]['id']}},_0x2d7a8b={};_0x2d7a8b[_0x5f12('0x2b')]=_['keys'](db[_0x5f12('0x28')][_0x5f12('0x29')]);_0x2d7a8b['query']=_['keys'](_0x113a9d[_0x5f12('0x2c')]);_0x2d7a8b[_0x5f12('0x2d')]=_[_0x5f12('0x2e')](_0x2d7a8b[_0x5f12('0x2b')],_0x2d7a8b['query']);_0x69daf9['attributes']=_['intersection'](_0x2d7a8b[_0x5f12('0x2b')],qs[_0x5f12('0x30')](_0x113a9d[_0x5f12('0x2c')][_0x5f12('0x30')]));_0x69daf9[_0x5f12('0x2f')]=_0x69daf9[_0x5f12('0x2f')][_0x5f12('0x42')]?_0x69daf9[_0x5f12('0x2f')]:_0x2d7a8b[_0x5f12('0x2b')];if(_0x113a9d[_0x5f12('0x2c')][_0x5f12('0x3b')]){_0x69daf9['include']=[{'all':!![]}];}_0x69daf9=_[_0x5f12('0x43')]({},_0x69daf9,_0x113a9d[_0x5f12('0x3a')]);return db[_0x5f12('0x28')][_0x5f12('0x44')](_0x69daf9)['then'](handleEntityNotFound(_0x3c475a,null))[_0x5f12('0x21')](respondWithResult(_0x3c475a,null))['catch'](handleError(_0x3c475a,null));};exports[_0x5f12('0x45')]=function(_0xa7854d,_0x42fd2d){return db[_0x5f12('0x28')]['create'](_0xa7854d[_0x5f12('0x46')],{})[_0x5f12('0x21')](respondWithResult(_0x42fd2d,0xc9))[_0x5f12('0x3f')](handleError(_0x42fd2d,null));};exports[_0x5f12('0x20')]=function(_0x32133d,_0x5d41dd){if(_0x32133d[_0x5f12('0x46')]['id']){delete _0x32133d['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x32133d[_0x5f12('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d41dd,null))[_0x5f12('0x21')](saveUpdates(_0x32133d[_0x5f12('0x46')],null))[_0x5f12('0x21')](respondWithResult(_0x5d41dd,null))['catch'](handleError(_0x5d41dd,null));};exports[_0x5f12('0x22')]=function(_0x2cab6b,_0x8f1b26){return db[_0x5f12('0x28')][_0x5f12('0x44')]({'where':{'id':_0x2cab6b[_0x5f12('0x41')]['id']}})[_0x5f12('0x21')](handleEntityNotFound(_0x8f1b26,null))[_0x5f12('0x21')](removeEntity(_0x8f1b26,null))['catch'](handleError(_0x8f1b26,null));};exports['describe']=function(_0x2d2c0a,_0x165335){return db[_0x5f12('0x28')]['describe']()[_0x5f12('0x21')](respondWithResult(_0x165335,null))[_0x5f12('0x3f')](handleError(_0x165335,null));}; \ No newline at end of file +var _0x1e18=['error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','VoiceTransferReport','findAll','rows','find','create','body','catch','params','destroy','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x4cd685,_0x472697){var _0x37743e=function(_0x238ec8){while(--_0x238ec8){_0x4cd685['push'](_0x4cd685['shift']());}};_0x37743e(++_0x472697);}(_0x1e18,0xbc));var _0x81e1=function(_0x219e9b,_0x295d91){_0x219e9b=_0x219e9b-0x0;var _0x332e80=_0x1e18[_0x219e9b];return _0x332e80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81e1('0x0'));var zipdir=require(_0x81e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81e1('0x2'));var moment=require(_0x81e1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x81e1('0x4'));var util=require(_0x81e1('0x5'));var path=require(_0x81e1('0x6'));var sox=require(_0x81e1('0x7'));var csv=require(_0x81e1('0x8'));var ejs=require(_0x81e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81e1('0xa'));var squel=require(_0x81e1('0xb'));var crypto=require(_0x81e1('0xc'));var jsforce=require(_0x81e1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x81e1('0x8'));var querystring=require(_0x81e1('0xe'));var Papa=require(_0x81e1('0xf'));var Redis=require(_0x81e1('0x10'));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(_0x81e1('0x11'))(_0x81e1('0x12'));var utils=require(_0x81e1('0x13'));var config=require(_0x81e1('0x14'));var licenseUtil=require(_0x81e1('0x15'));var db=require(_0x81e1('0x16'))['db'];function respondWithStatusCode(_0x93d92d,_0x1256f3){_0x1256f3=_0x1256f3||0xcc;return function(_0x547184){if(_0x547184){return _0x93d92d[_0x81e1('0x17')](_0x1256f3);}return _0x93d92d[_0x81e1('0x18')](_0x1256f3)[_0x81e1('0x19')]();};}function respondWithResult(_0x541c78,_0x519c6f){_0x519c6f=_0x519c6f||0xc8;return function(_0x1600f7){if(_0x1600f7){return _0x541c78[_0x81e1('0x18')](_0x519c6f)[_0x81e1('0x1a')](_0x1600f7);}};}function respondWithFilteredResult(_0x3f15d3,_0x1c7dc5){return function(_0x388a57){if(_0x388a57){var _0x5d8c90=typeof _0x1c7dc5[_0x81e1('0x1b')]===_0x81e1('0x1c')&&typeof _0x1c7dc5[_0x81e1('0x1d')]===_0x81e1('0x1c');var _0x4c7643=_0x388a57[_0x81e1('0x1e')];var _0x27531e=_0x5d8c90?0x0:_0x1c7dc5[_0x81e1('0x1b')];var _0x23a095=_0x5d8c90?_0x388a57[_0x81e1('0x1e')]:_0x1c7dc5[_0x81e1('0x1b')]+_0x1c7dc5[_0x81e1('0x1d')];var _0x504fe4;if(_0x23a095>=_0x4c7643){_0x23a095=_0x4c7643;_0x504fe4=0xc8;}else{_0x504fe4=0xce;}_0x3f15d3[_0x81e1('0x18')](_0x504fe4);return _0x3f15d3[_0x81e1('0x1f')](_0x81e1('0x20'),_0x27531e+'-'+_0x23a095+'/'+_0x4c7643)[_0x81e1('0x1a')](_0x388a57);}return null;};}function patchUpdates(_0x3d94cb){return function(_0x45b48e){try{jsonpatch[_0x81e1('0x21')](_0x45b48e,_0x3d94cb,!![]);}catch(_0x9e055f){return BPromise['reject'](_0x9e055f);}return _0x45b48e[_0x81e1('0x22')]();};}function saveUpdates(_0xc70364,_0x3543b0){return function(_0x3e7cc5){if(_0x3e7cc5){return _0x3e7cc5[_0x81e1('0x23')](_0xc70364)[_0x81e1('0x24')](function(_0x3de816){return _0x3de816;});}return null;};}function removeEntity(_0x3ac091,_0x59af6a){return function(_0x168a8b){if(_0x168a8b){return _0x168a8b['destroy']()[_0x81e1('0x24')](function(){_0x3ac091[_0x81e1('0x18')](0xcc)[_0x81e1('0x19')]();});}};}function handleEntityNotFound(_0x540274,_0x5c7ddc){return function(_0x157caa){if(!_0x157caa){_0x540274[_0x81e1('0x17')](0x194);}return _0x157caa;};}function handleError(_0x339c3e,_0x5c55a9){_0x5c55a9=_0x5c55a9||0x1f4;return function(_0x383383){logger[_0x81e1('0x25')](_0x383383[_0x81e1('0x26')]);if(_0x383383[_0x81e1('0x27')]){delete _0x383383[_0x81e1('0x27')];}_0x339c3e[_0x81e1('0x18')](_0x5c55a9)[_0x81e1('0x28')](_0x383383);};}exports[_0x81e1('0x29')]=function(_0x632c64,_0x3fa3b1){var _0x4e902c={},_0x73cd84={},_0x3730e0={'count':0x0,'rows':[]};var _0x11d255=_[_0x81e1('0x2a')](db['VoiceTransferReport'][_0x81e1('0x2b')],function(_0x40dce6){return{'name':_0x40dce6[_0x81e1('0x2c')],'type':_0x40dce6['type'][_0x81e1('0x2d')]};});_0x73cd84[_0x81e1('0x2e')]=_[_0x81e1('0x2a')](_0x11d255,_0x81e1('0x27'));_0x73cd84[_0x81e1('0x2f')]=_['keys'](_0x632c64[_0x81e1('0x2f')]);_0x73cd84['filters']=_[_0x81e1('0x30')](_0x73cd84['model'],_0x73cd84['query']);_0x4e902c[_0x81e1('0x31')]=_[_0x81e1('0x30')](_0x73cd84[_0x81e1('0x2e')],qs[_0x81e1('0x32')](_0x632c64[_0x81e1('0x2f')][_0x81e1('0x32')]));_0x4e902c[_0x81e1('0x31')]=_0x4e902c[_0x81e1('0x31')][_0x81e1('0x33')]?_0x4e902c[_0x81e1('0x31')]:_0x73cd84[_0x81e1('0x2e')];if(!_0x632c64[_0x81e1('0x2f')][_0x81e1('0x34')](_0x81e1('0x35'))){_0x4e902c[_0x81e1('0x1d')]=qs[_0x81e1('0x1d')](_0x632c64['query']['limit']);_0x4e902c[_0x81e1('0x1b')]=qs[_0x81e1('0x1b')](_0x632c64['query'][_0x81e1('0x1b')]);}_0x4e902c[_0x81e1('0x36')]=qs['sort'](_0x632c64['query'][_0x81e1('0x37')]);_0x4e902c[_0x81e1('0x38')]=qs[_0x81e1('0x39')](_[_0x81e1('0x3a')](_0x632c64[_0x81e1('0x2f')],_0x73cd84[_0x81e1('0x39')]),_0x11d255);if(_0x632c64[_0x81e1('0x2f')]['filter']){_0x4e902c['where']=_['merge'](_0x4e902c[_0x81e1('0x38')],{'$or':_[_0x81e1('0x2a')](_0x11d255,function(_0x1a8bf4){if(_0x1a8bf4['type']!==_0x81e1('0x3b')){var _0x28768c={};_0x28768c[_0x1a8bf4[_0x81e1('0x27')]]={'$like':'%'+_0x632c64[_0x81e1('0x2f')][_0x81e1('0x3c')]+'%'};return _0x28768c;}})});}_0x4e902c=_[_0x81e1('0x3d')]({},_0x4e902c,_0x632c64[_0x81e1('0x3e')]);var _0x5065ef={'where':_0x4e902c[_0x81e1('0x38')]};return db['VoiceTransferReport'][_0x81e1('0x1e')](_0x5065ef)[_0x81e1('0x24')](function(_0x3570f5){_0x3730e0['count']=_0x3570f5;if(_0x632c64[_0x81e1('0x2f')][_0x81e1('0x3f')]){_0x4e902c[_0x81e1('0x40')]=[{'all':!![]}];}return db[_0x81e1('0x41')][_0x81e1('0x42')](_0x4e902c);})[_0x81e1('0x24')](function(_0x3110bf){_0x3730e0[_0x81e1('0x43')]=_0x3110bf;return _0x3730e0;})['then'](respondWithFilteredResult(_0x3fa3b1,_0x4e902c))['catch'](handleError(_0x3fa3b1,null));};exports['show']=function(_0x2467e0,_0x55c09f){var _0x4ca463={'raw':!![],'where':{'id':_0x2467e0['params']['id']}},_0xf23328={};_0xf23328[_0x81e1('0x2e')]=_['keys'](db[_0x81e1('0x41')][_0x81e1('0x2b')]);_0xf23328['query']=_['keys'](_0x2467e0[_0x81e1('0x2f')]);_0xf23328[_0x81e1('0x39')]=_[_0x81e1('0x30')](_0xf23328[_0x81e1('0x2e')],_0xf23328['query']);_0x4ca463[_0x81e1('0x31')]=_[_0x81e1('0x30')](_0xf23328[_0x81e1('0x2e')],qs[_0x81e1('0x32')](_0x2467e0['query'][_0x81e1('0x32')]));_0x4ca463[_0x81e1('0x31')]=_0x4ca463[_0x81e1('0x31')][_0x81e1('0x33')]?_0x4ca463[_0x81e1('0x31')]:_0xf23328['model'];if(_0x2467e0[_0x81e1('0x2f')]['includeAll']){_0x4ca463['include']=[{'all':!![]}];}_0x4ca463=_[_0x81e1('0x3d')]({},_0x4ca463,_0x2467e0[_0x81e1('0x3e')]);return db[_0x81e1('0x41')][_0x81e1('0x44')](_0x4ca463)['then'](handleEntityNotFound(_0x55c09f,null))['then'](respondWithResult(_0x55c09f,null))['catch'](handleError(_0x55c09f,null));};exports['create']=function(_0x47308f,_0x52beb6){return db['VoiceTransferReport'][_0x81e1('0x45')](_0x47308f[_0x81e1('0x46')],{})[_0x81e1('0x24')](respondWithResult(_0x52beb6,0xc9))[_0x81e1('0x47')](handleError(_0x52beb6,null));};exports[_0x81e1('0x23')]=function(_0x48db0a,_0x57f7c6){if(_0x48db0a[_0x81e1('0x46')]['id']){delete _0x48db0a['body']['id'];}return db['VoiceTransferReport'][_0x81e1('0x44')]({'where':{'id':_0x48db0a[_0x81e1('0x48')]['id']}})[_0x81e1('0x24')](handleEntityNotFound(_0x57f7c6,null))[_0x81e1('0x24')](saveUpdates(_0x48db0a[_0x81e1('0x46')],null))['then'](respondWithResult(_0x57f7c6,null))[_0x81e1('0x47')](handleError(_0x57f7c6,null));};exports[_0x81e1('0x49')]=function(_0x383f12,_0xf17174){return db['VoiceTransferReport']['find']({'where':{'id':_0x383f12[_0x81e1('0x48')]['id']}})[_0x81e1('0x24')](handleEntityNotFound(_0xf17174,null))[_0x81e1('0x24')](removeEntity(_0xf17174,null))['catch'](handleError(_0xf17174,null));};exports[_0x81e1('0x4a')]=function(_0x30507d,_0xd3be30){return db[_0x81e1('0x41')][_0x81e1('0x4a')]()[_0x81e1('0x24')](respondWithResult(_0xd3be30,null))[_0x81e1('0x47')](handleError(_0xd3be30,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8744959..fe80293 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 _0x3d49=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','api','bluebird'];(function(_0x4f0920,_0x598017){var _0x33ff91=function(_0x460345){while(--_0x460345){_0x4f0920['push'](_0x4f0920['shift']());}};_0x33ff91(++_0x598017);}(_0x3d49,0x1ab));var _0x93d4=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x3d49[_0x60df74];return _0x5ee872;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x93d4('0x0'));var moment=require('moment');var BPromise=require(_0x93d4('0x1'));var rp=require(_0x93d4('0x2'));var fs=require('fs');var path=require(_0x93d4('0x3'));var rimraf=require(_0x93d4('0x4'));var config=require(_0x93d4('0x5'));var attributes=require(_0x93d4('0x6'));module[_0x93d4('0x7')]=function(_0x2344d6,_0x31b319){return _0x2344d6[_0x93d4('0x8')](_0x93d4('0x9'),attributes,{'tableName':_0x93d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad0a=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','request-promise'];(function(_0x41d881,_0x349d8c){var _0x12d897=function(_0x525ed4){while(--_0x525ed4){_0x41d881['push'](_0x41d881['shift']());}};_0x12d897(++_0x349d8c);}(_0xad0a,0x97));var _0xaad0=function(_0x1c07ad,_0x44b91c){_0x1c07ad=_0x1c07ad-0x0;var _0xda11b0=_0xad0a[_0x1c07ad];return _0xda11b0;};'use strict';var _=require(_0xaad0('0x0'));var util=require(_0xaad0('0x1'));var logger=require(_0xaad0('0x2'))(_0xaad0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaad0('0x4'));var fs=require('fs');var path=require(_0xaad0('0x5'));var rimraf=require(_0xaad0('0x6'));var config=require(_0xaad0('0x7'));var attributes=require(_0xaad0('0x8'));module[_0xaad0('0x9')]=function(_0x17fe89,_0x41ad55){return _0x17fe89[_0xaad0('0xa')](_0xaad0('0xb'),attributes,{'tableName':_0xaad0('0xc'),'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 678189d..4ff0e60 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 _0x9a47=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','CreateVoiceTransferReport','create','options','raw','catch','util','moment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9a47,0x186));var _0x79a4=function(_0x4c1a98,_0xfa2d95){_0x4c1a98=_0x4c1a98-0x0;var _0x32ccaf=_0x9a47[_0x4c1a98];return _0x32ccaf;};'use strict';var _=require('lodash');var util=require(_0x79a4('0x0'));var moment=require(_0x79a4('0x1'));var BPromise=require(_0x79a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79a4('0x3'));var db=require(_0x79a4('0x4'))['db'];var utils=require(_0x79a4('0x5'));var logger=require(_0x79a4('0x6'))(_0x79a4('0x7'));var config=require(_0x79a4('0x8'));var jayson=require(_0x79a4('0x9'));var client=jayson[_0x79a4('0xa')][_0x79a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xac9802,_0x1ed645,_0x251296){return new BPromise(function(_0x3b3225,_0x92a964){return client[_0x79a4('0xc')](_0xac9802,_0x251296)[_0x79a4('0xd')](function(_0xebe997){logger['info'](_0x79a4('0xe'),_0x1ed645,'request\x20sent');logger[_0x79a4('0xf')](_0x79a4('0x10'),_0x1ed645,'request\x20sent',JSON['stringify'](_0xebe997));if(_0xebe997['error']){if(_0xebe997['error'][_0x79a4('0x11')]===0x1f4){logger[_0x79a4('0x12')](_0x79a4('0xe'),_0x1ed645,_0xebe997['error'][_0x79a4('0x13')]);return _0x92a964(_0xebe997['error'][_0x79a4('0x13')]);}logger[_0x79a4('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x1ed645,_0xebe997['error'][_0x79a4('0x13')]);return _0x3b3225(_0xebe997['error'][_0x79a4('0x13')]);}else{logger[_0x79a4('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x1ed645,_0x79a4('0x15'));_0x3b3225(_0xebe997[_0x79a4('0x16')]['message']);}})['catch'](function(_0x313d0e){logger[_0x79a4('0x12')](_0x79a4('0xe'),_0x1ed645,_0x313d0e);_0x92a964(_0x313d0e);});});}exports[_0x79a4('0x17')]=function(_0x3dce82){var _0x4c7984=this;return new Promise(function(_0x2ed085,_0x4ca121){return db['VoiceTransferReport'][_0x79a4('0x18')](_0x3dce82['body'],{'raw':_0x3dce82[_0x79a4('0x19')]?_0x3dce82[_0x79a4('0x19')][_0x79a4('0x1a')]===undefined?!![]:![]:!![]})[_0x79a4('0xd')](function(_0x5c2465){logger[_0x79a4('0x14')](_0x79a4('0x17'),_0x3dce82);logger[_0x79a4('0xf')](_0x79a4('0x17'),_0x3dce82,JSON['stringify'](_0x5c2465));_0x2ed085(_0x5c2465);})[_0x79a4('0x1b')](function(_0x147a07){logger['error'](_0x79a4('0x17'),_0x147a07['message'],_0x3dce82);_0x4ca121(_0x4c7984[_0x79a4('0x12')](0x1f4,_0x147a07[_0x79a4('0x13')]));});});}; \ No newline at end of file +var _0x93c3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateVoiceTransferReport','create','body','options','raw','util','moment','bluebird','randomstring'];(function(_0x2565d5,_0xe6c944){var _0x1b546c=function(_0xe00d3a){while(--_0xe00d3a){_0x2565d5['push'](_0x2565d5['shift']());}};_0x1b546c(++_0xe6c944);}(_0x93c3,0xab));var _0x393c=function(_0x33dbb4,_0x1ae76a){_0x33dbb4=_0x33dbb4-0x0;var _0x3f98c0=_0x93c3[_0x33dbb4];return _0x3f98c0;};'use strict';var _=require('lodash');var util=require(_0x393c('0x0'));var moment=require(_0x393c('0x1'));var BPromise=require(_0x393c('0x2'));var rs=require(_0x393c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x393c('0x4'));var logger=require(_0x393c('0x5'))('rpc');var config=require(_0x393c('0x6'));var jayson=require(_0x393c('0x7'));var client=jayson['client'][_0x393c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf1b342,_0x3a8e8f,_0x352333){return new BPromise(function(_0x54874e,_0x5df688){return client['request'](_0xf1b342,_0x352333)[_0x393c('0x9')](function(_0x5b86e8){logger[_0x393c('0xa')](_0x393c('0xb'),_0x3a8e8f,'request\x20sent');logger[_0x393c('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3a8e8f,'request\x20sent',JSON[_0x393c('0xd')](_0x5b86e8));if(_0x5b86e8[_0x393c('0xe')]){if(_0x5b86e8[_0x393c('0xe')][_0x393c('0xf')]===0x1f4){logger[_0x393c('0xe')](_0x393c('0xb'),_0x3a8e8f,_0x5b86e8['error'][_0x393c('0x10')]);return _0x5df688(_0x5b86e8[_0x393c('0xe')]['message']);}logger['error'](_0x393c('0xb'),_0x3a8e8f,_0x5b86e8[_0x393c('0xe')][_0x393c('0x10')]);return _0x54874e(_0x5b86e8['error'][_0x393c('0x10')]);}else{logger[_0x393c('0xa')](_0x393c('0xb'),_0x3a8e8f,_0x393c('0x11'));_0x54874e(_0x5b86e8[_0x393c('0x12')][_0x393c('0x10')]);}})[_0x393c('0x13')](function(_0x4433f6){logger['error'](_0x393c('0xb'),_0x3a8e8f,_0x4433f6);_0x5df688(_0x4433f6);});});}exports[_0x393c('0x14')]=function(_0x275fac){var _0x56c30e=this;return new Promise(function(_0x5bcb70,_0x2252ea){return db['VoiceTransferReport'][_0x393c('0x15')](_0x275fac[_0x393c('0x16')],{'raw':_0x275fac[_0x393c('0x17')]?_0x275fac[_0x393c('0x17')][_0x393c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x414181){logger[_0x393c('0xa')](_0x393c('0x14'),_0x275fac);logger[_0x393c('0xc')](_0x393c('0x14'),_0x275fac,JSON[_0x393c('0xd')](_0x414181));_0x5bcb70(_0x414181);})[_0x393c('0x13')](function(_0x2322aa){logger[_0x393c('0xe')](_0x393c('0x14'),_0x2322aa[_0x393c('0x10')],_0x275fac);_0x2252ea(_0x56c30e[_0x393c('0xe')](0x1f4,_0x2322aa[_0x393c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 903dfe3..5f1e848 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 _0x1d0d=['hangup','post','/answer','answer','/hold','hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','canUpdate','originate'];(function(_0x3582ad,_0x537419){var _0x369744=function(_0x574616){while(--_0x574616){_0x3582ad['push'](_0x3582ad['shift']());}};_0x369744(++_0x537419);}(_0x1d0d,0x174));var _0xd1d0=function(_0x148d64,_0x55b931){_0x148d64=_0x148d64-0x0;var _0x7a914e=_0x1d0d[_0x148d64];return _0x7a914e;};'use strict';var express=require(_0xd1d0('0x0'));var router=express[_0xd1d0('0x1')]();var auth=require(_0xd1d0('0x2'));var controller=require(_0xd1d0('0x3'));router['post'](_0xd1d0('0x4'),auth[_0xd1d0('0x5')](),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0x7')]);router['post']('/hangup',auth['isAuthenticated'](),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0x8')]);router[_0xd1d0('0x9')](_0xd1d0('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xd1d0('0xb')]);router[_0xd1d0('0x9')](_0xd1d0('0xc'),auth[_0xd1d0('0x5')](),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0xd')]);router[_0xd1d0('0x9')](_0xd1d0('0xe'),auth['isAuthenticated'](),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0xf')]);router['post']('/calls',auth[_0xd1d0('0x5')](),auth[_0xd1d0('0x6')](),controller[_0xd1d0('0x10')]);router[_0xd1d0('0x9')](_0xd1d0('0x11'),auth[_0xd1d0('0x5')](),auth['canUpdate'](),controller[_0xd1d0('0x12')]);module[_0xd1d0('0x13')]=router; \ No newline at end of file +var _0x5d89=['hold','unhold','/calls','calls','transfer','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','hangup','/answer','/hold'];(function(_0x4c7149,_0x335342){var _0x200122=function(_0x358259){while(--_0x358259){_0x4c7149['push'](_0x4c7149['shift']());}};_0x200122(++_0x335342);}(_0x5d89,0x15e));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x95d8('0x0')]();var auth=require(_0x95d8('0x1'));var controller=require('./webbar.controller');router[_0x95d8('0x2')](_0x95d8('0x3'),auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller[_0x95d8('0x6')]);router[_0x95d8('0x2')]('/hangup',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x95d8('0x7')]);router['post'](_0x95d8('0x8'),auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller['answer']);router['post'](_0x95d8('0x9'),auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller[_0x95d8('0xa')]);router[_0x95d8('0x2')]('/unhold',auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller[_0x95d8('0xb')]);router[_0x95d8('0x2')](_0x95d8('0xc'),auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller[_0x95d8('0xd')]);router[_0x95d8('0x2')]('/transfer',auth[_0x95d8('0x4')](),auth[_0x95d8('0x5')](),controller[_0x95d8('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 88bdcae..a604546 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 _0xa37e=['unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','../../mysqldb','../../config/environment','util','bluebird','client','../../config/logger','webbarapi','ioredis','redis','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','request','then','error','code','message','catch','User','findOne','agent','VoiceChannels','all','rows','sessionId','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!'];(function(_0xb7b269,_0xf52b7c){var _0x50e687=function(_0x477399){while(--_0x477399){_0xb7b269['push'](_0xb7b269['shift']());}};_0x50e687(++_0xf52b7c);}(_0xa37e,0x97));var _0xea37=function(_0x14612b,_0x52fc15){_0x14612b=_0x14612b-0x0;var _0xdaad4f=_0xa37e[_0x14612b];return _0xdaad4f;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xea37('0x0'))['db'];var config=require(_0xea37('0x1'));var util=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xea37('0x4')]['http']({'port':0x232a});var logger=require(_0xea37('0x5'))(_0xea37('0x6'));var Redis=require(_0xea37('0x7'));config['redis']=_['defaults'](config[_0xea37('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea37('0x8')]));var Schema=require(_0xea37('0x9'));var originateValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'callNumber':{'type':'string','required':[!![],_0xea37('0xc')]},'callerId':{'type':_0xea37('0xd')},'callbackUrl':{'type':_0xea37('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xea37('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'sessionId':{'type':_0xea37('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xea37('0xd'),'required':[!![],_0xea37('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xea37('0xb')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xea37('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x18e4b8,_0x58f979,_0x49604a){logger[_0xea37('0xf')](_0x18e4b8,_0x58f979,JSON['stringify'](_0x49604a));io['to'](_0x18e4b8)[_0xea37('0x10')](_0x58f979,_0x49604a);}function handleError(_0x421f7d){return function(_0x4ef3c9){console[_0xea37('0x11')](_0xea37('0x12'),_0x4ef3c9,_0x4ef3c9 instanceof RangeError);logger['error'](_0x4ef3c9[_0xea37('0x13')]);if(_0x4ef3c9 instanceof RangeError){if(_0x4ef3c9[_0xea37('0x14')]){delete _0x4ef3c9[_0xea37('0x14')];}_0x421f7d[_0xea37('0x15')](0x194)[_0xea37('0x16')](_0x4ef3c9);}else{if(_0x4ef3c9[_0xea37('0x14')]){delete _0x4ef3c9[_0xea37('0x14')];}_0x421f7d[_0xea37('0x15')](0x1f4)[_0xea37('0x16')](_0x4ef3c9);}};}function checkError(){return function(_0x3e00cb){if(!_0x3e00cb){throw new RangeError('NotFound');}return _0x3e00cb;};}function respondWithRpcPromise(_0x23bb57,_0x2a81f5){return new BPromise(function(_0x356f04,_0x536eff){var _0x4aa2ae=amiClient;return _0x4aa2ae[_0xea37('0x17')](_0x23bb57,_0x2a81f5)[_0xea37('0x18')](function(_0x98c6de){if(_0x98c6de[_0xea37('0x19')]){if(_0x98c6de['error'][_0xea37('0x1a')]===0x1f4){return _0x536eff(_0x98c6de['error']['message']);}return _0x356f04(_0x98c6de['error'][_0xea37('0x1b')]);}else{_0x356f04(_0x98c6de['result']);}})[_0xea37('0x1c')](function(_0x11dfbb){_0x536eff(_0x11dfbb);});});}function getAgent(_0x15a0f5){return db[_0xea37('0x1d')][_0xea37('0x1e')]({'where':{'id':_0x15a0f5,'role':_0xea37('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x57a7cc,_0x55880c){return new BPromise(function(_0x477e25,_0x3e272e){var _0x4ffcf1=respondWithRpcPromise(_0xea37('0x20'));var _0x10d556=getAgent(_0x57a7cc);Promise[_0xea37('0x21')]([_0x4ffcf1,_0x10d556])['then'](function(_0xe5b07a){var _0x366acb=_0xe5b07a[0x0];var _0xc07758=_0xe5b07a[0x1];var _0x2e745c=_['filter'](_0x366acb[_0xea37('0x22')],function(_0x55388b){return _0x55388b['UserId']==_0xc07758['id']&&_0x55388b[_0xea37('0x23')]==_0x55880c;});if(_0x2e745c['length']==0x1){_0x477e25(_0xc07758);}else{_0x3e272e(new RangeError('sessionId\x20'+_0x55880c+'\x20not\x20found!'));}});});}exports[_0xea37('0x24')]=function(_0x1e4bc0,_0x3ec6af){logger[_0xea37('0xf')](_0xea37('0x25'),_0x1e4bc0[_0xea37('0x26')]);var _0x5e2526=originateValidation[_0xea37('0x9')](_0x1e4bc0[_0xea37('0x26')]);if(_0x5e2526[_0xea37('0x27')]>0x0){return _0x3ec6af[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x5e2526);}var _0x33717c=_0x1e4bc0['body'][_0xea37('0x29')];var _0x4c75d7=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2a')];var _0x1cca3e=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2b')];var _0x321200=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2c')];return getAgent(_0x33717c)['then'](function(_0x405c44){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x405c44[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x405c44['name']),'webbar:originate',{'callNumber':_0x4c75d7,'callerId':_0x1cca3e,'callbackUrl':_0x321200});return _0x3ec6af['status'](0xc8)[_0xea37('0x28')]({'error':![],'message':'originate\x20executed!'});})[_0xea37('0x1c')](handleError(_0x3ec6af));};exports['hangup']=function(_0x5e91ef,_0x5652a4){logger['info'](_0xea37('0x30'),_0x5e91ef[_0xea37('0x26')]);var _0x46114b=hangupValidation[_0xea37('0x9')](_0x5e91ef[_0xea37('0x26')]);if(_0x46114b[_0xea37('0x27')]>0x0){return _0x5652a4[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x46114b);}var _0x267456=_0x5e91ef['body'][_0xea37('0x29')];var _0x565c66=_0x5e91ef[_0xea37('0x26')][_0xea37('0x23')];return getAgent(_0x267456)[_0xea37('0x18')](function(_0x537f75){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x537f75[_0xea37('0x14')]);emit(util[_0xea37('0x2e')]('user:%s',_0x537f75[_0xea37('0x14')]),'webbar:hangup',{'sessionId':_0x565c66});return _0x5652a4[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':_0xea37('0x31')});})[_0xea37('0x1c')](handleError(_0x5652a4));};exports[_0xea37('0x32')]=function(_0x435300,_0x57c88d){logger[_0xea37('0xf')](_0xea37('0x33'),_0x435300['body']);var _0x15de2c=answerValidation[_0xea37('0x9')](_0x435300[_0xea37('0x26')]);if(_0x15de2c[_0xea37('0x27')]>0x0){return _0x57c88d[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x15de2c);}var _0x2281d9=_0x435300[_0xea37('0x26')][_0xea37('0x29')];var _0x71760a=_0x435300[_0xea37('0x26')][_0xea37('0x23')];return getAgent(_0x2281d9)[_0xea37('0x18')](function(_0x36d053){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x36d053[_0xea37('0x14')]);emit(util['format'](_0xea37('0x2f'),_0x36d053[_0xea37('0x14')]),_0xea37('0x34'),{'sessionId':_0x71760a});return _0x57c88d[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':'answer\x20executed!'});})[_0xea37('0x1c')](handleError(_0x57c88d));};exports[_0xea37('0x35')]=function(_0x9a5dd,_0x10fcd5){logger[_0xea37('0xf')](_0xea37('0x36'),_0x9a5dd['body']);var _0x422d24=holdValidation[_0xea37('0x9')](_0x9a5dd[_0xea37('0x26')]);if(_0x422d24[_0xea37('0x27')]>0x0){return _0x10fcd5[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x422d24);}var _0x2cd612=_0x9a5dd[_0xea37('0x26')]['userId'];var _0x34f2f9=_0x9a5dd[_0xea37('0x26')]['sessionId'];return getAgent(_0x2cd612)[_0xea37('0x18')](function(_0x2ff803){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x2ff803[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x2ff803[_0xea37('0x14')]),'webbar:hold',{'sessionId':_0x34f2f9});return _0x10fcd5[_0xea37('0x15')](0xc8)['json']({'error':![],'message':_0xea37('0x37')});})['catch'](handleError(_0x10fcd5));};exports[_0xea37('0x38')]=function(_0x14c119,_0x43e269){logger[_0xea37('0xf')](_0xea37('0x39'),_0x14c119[_0xea37('0x26')]);var _0x3628cd=unholdValidation[_0xea37('0x9')](_0x14c119['body']);if(_0x3628cd['length']>0x0){return _0x43e269[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x3628cd);}var _0x19223c=_0x14c119['body'][_0xea37('0x29')];var _0x1c1cf9=_0x14c119['body'][_0xea37('0x23')];return getAgent(_0x19223c)[_0xea37('0x18')](function(_0x32d36d){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x32d36d[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x32d36d[_0xea37('0x14')]),_0xea37('0x3a'),{'sessionId':_0x1c1cf9});return _0x43e269[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':_0xea37('0x3b')});})[_0xea37('0x1c')](handleError(_0x43e269));};exports[_0xea37('0x3c')]=function(_0x57811b,_0x6727d5){logger[_0xea37('0xf')](_0xea37('0x3d'),_0x6727d5[_0xea37('0x26')]);var _0x40d747=callsValidation[_0xea37('0x9')](_0x57811b['body']);if(_0x40d747[_0xea37('0x27')]>0x0){return _0x6727d5[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x40d747);}var _0x150a87=_0x57811b[_0xea37('0x26')]['userId'];var _0x2d9e5e=respondWithRpcPromise(_0xea37('0x20'));var _0x57430c=getAgent(_0x150a87);return Promise['all']([_0x2d9e5e,_0x57430c])['then'](function(_0x41d730){var _0x39c8c6=_0x41d730[0x0];var _0x356e6c=_0x41d730[0x1];var _0x1d882d=_[_0xea37('0x3e')](_0x39c8c6['rows'],function(_0x2dc886){return _0x2dc886[_0xea37('0x3f')]==_0x356e6c['id'];});return _0x6727d5[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'count':_0x1d882d[_0xea37('0x27')],'rows':_0x1d882d});})[_0xea37('0x1c')](handleError(_0x6727d5));};exports[_0xea37('0x40')]=function(_0x440267,_0xb60e2f){logger[_0xea37('0xf')](_0xea37('0x41'),_0x440267[_0xea37('0x26')]);var _0x21a35e=conferenceValidation[_0xea37('0x9')](_0x440267[_0xea37('0x26')]);if(_0x21a35e[_0xea37('0x27')]>0x0){return _0xb60e2f[_0xea37('0x15')](0x190)['json'](_0x21a35e);}var _0x37c2c4=_0x440267['body'][_0xea37('0x29')];return getAgent(_0x37c2c4)[_0xea37('0x18')](function(_0x409fba){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x409fba[_0xea37('0x14')]);emit(util[_0xea37('0x2e')]('user:%s',_0x409fba['name']),'webbar:conference');return _0xb60e2f[_0xea37('0x15')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0xea37('0x1c')](handleError(_0xb60e2f));};exports[_0xea37('0x42')]=function(_0x1a037f,_0x50229d){logger[_0xea37('0xf')](_0xea37('0x43'),_0x1a037f[_0xea37('0x26')]);var _0x4ffecd=transferValidation['validate'](_0x1a037f[_0xea37('0x26')]);if(_0x4ffecd[_0xea37('0x27')]>0x0){return _0x50229d[_0xea37('0x15')](0x190)['json'](_0x4ffecd);}var _0x21b3da=_0x1a037f[_0xea37('0x26')][_0xea37('0x29')];var _0xde6af6=_0x1a037f[_0xea37('0x26')]['sessionId'];var _0x29c0ed=_0x1a037f[_0xea37('0x26')][_0xea37('0x44')];return getAgent(_0x21b3da)[_0xea37('0x18')](function(_0x54eeff){logger[_0xea37('0xf')]('entityFound:',_0x54eeff[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x54eeff[_0xea37('0x14')]),'webbar:transfer',{'sessionId':_0xde6af6,'transferNumber':_0x29c0ed});return _0x50229d[_0xea37('0x15')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0xea37('0x1c')](handleError(_0x50229d));}; \ No newline at end of file +var _0x9f62=['user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','entityFound:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','log','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','originate','originate\x20fired:','body','json','userId','callNumber','callerId','format'];(function(_0x55cdc5,_0x2b2297){var _0x29acd5=function(_0x405234){while(--_0x405234){_0x55cdc5['push'](_0x55cdc5['shift']());}};_0x29acd5(++_0x2b2297);}(_0x9f62,0x154));var _0x29f6=function(_0x2ebf5b,_0x1ae52f){_0x2ebf5b=_0x2ebf5b-0x0;var _0x910672=_0x9f62[_0x2ebf5b];return _0x910672;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x29f6('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x29f6('0x1'));var util=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x29f6('0x4')]({'port':0x232a});var logger=require(_0x29f6('0x5'))(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));config['redis']=_[_0x29f6('0x8')](config[_0x29f6('0x9')],{'host':_0x29f6('0xa'),'port':0x18eb});var io=require(_0x29f6('0xb'))(new Redis(config[_0x29f6('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x29f6('0xc')]},'callerId':{'type':_0x29f6('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x29f6('0xd'),'required':[!![],_0x29f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});function emit(_0x1dde97,_0x3a75d0,_0x25e5a2){logger[_0x29f6('0x11')](_0x1dde97,_0x3a75d0,JSON[_0x29f6('0x12')](_0x25e5a2));io['to'](_0x1dde97)['emit'](_0x3a75d0,_0x25e5a2);}function handleError(_0x51c92f){return function(_0x2e66d3){console[_0x29f6('0x13')](_0x29f6('0x14'),_0x2e66d3,_0x2e66d3 instanceof RangeError);logger['error'](_0x2e66d3[_0x29f6('0x15')]);if(_0x2e66d3 instanceof RangeError){if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3['name'];}_0x51c92f[_0x29f6('0x17')](0x194)[_0x29f6('0x18')](_0x2e66d3);}else{if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3[_0x29f6('0x16')];}_0x51c92f[_0x29f6('0x17')](0x1f4)[_0x29f6('0x18')](_0x2e66d3);}};}function checkError(){return function(_0x5673c8){if(!_0x5673c8){throw new RangeError(_0x29f6('0x19'));}return _0x5673c8;};}function respondWithRpcPromise(_0x59def4,_0x4acb15){return new BPromise(function(_0x470019,_0x1fa159){var _0x39c6b3=amiClient;return _0x39c6b3[_0x29f6('0x1a')](_0x59def4,_0x4acb15)['then'](function(_0x2c672e){if(_0x2c672e['error']){if(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){return _0x1fa159(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1d')]);}return _0x470019(_0x2c672e['error'][_0x29f6('0x1d')]);}else{_0x470019(_0x2c672e[_0x29f6('0x1e')]);}})['catch'](function(_0x1401fb){_0x1fa159(_0x1401fb);});});}function getAgent(_0x45f792){return db[_0x29f6('0x1f')][_0x29f6('0x20')]({'where':{'id':_0x45f792,'role':_0x29f6('0x21')}})[_0x29f6('0x22')](checkError());}function getAgentCheckSession(_0x23c630,_0x50cdd2){return new BPromise(function(_0x2183b7,_0x454a4a){var _0x1ab8d8=respondWithRpcPromise(_0x29f6('0x23'));var _0xda0a63=getAgent(_0x23c630);Promise[_0x29f6('0x24')]([_0x1ab8d8,_0xda0a63])[_0x29f6('0x22')](function(_0x17b2f2){var _0x3d88db=_0x17b2f2[0x0];var _0x13a3a2=_0x17b2f2[0x1];var _0x2915bc=_[_0x29f6('0x25')](_0x3d88db[_0x29f6('0x26')],function(_0x304c28){return _0x304c28[_0x29f6('0x27')]==_0x13a3a2['id']&&_0x304c28[_0x29f6('0x28')]==_0x50cdd2;});if(_0x2915bc[_0x29f6('0x29')]==0x1){_0x2183b7(_0x13a3a2);}else{_0x454a4a(new RangeError('sessionId\x20'+_0x50cdd2+'\x20not\x20found!'));}});});}exports[_0x29f6('0x2a')]=function(_0x489897,_0x341071){logger[_0x29f6('0x11')](_0x29f6('0x2b'),_0x489897[_0x29f6('0x2c')]);var _0x5e5d89=originateValidation['validate'](_0x489897[_0x29f6('0x2c')]);if(_0x5e5d89[_0x29f6('0x29')]>0x0){return _0x341071[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e5d89);}var _0x3a223b=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x1c3f0f=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2f')];var _0x46d0d0=_0x489897[_0x29f6('0x2c')][_0x29f6('0x30')];var _0x23ad1a=_0x489897['body']['callbackUrl'];return getAgent(_0x3a223b)[_0x29f6('0x22')](function(_0x44cf19){logger[_0x29f6('0x11')]('entityFound:',_0x44cf19[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x44cf19[_0x29f6('0x16')]),_0x29f6('0x33'),{'callNumber':_0x1c3f0f,'callerId':_0x46d0d0,'callbackUrl':_0x23ad1a});return _0x341071['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x34')});})[_0x29f6('0x35')](handleError(_0x341071));};exports[_0x29f6('0x36')]=function(_0x4f5fe1,_0x30d747){logger[_0x29f6('0x11')](_0x29f6('0x37'),_0x4f5fe1[_0x29f6('0x2c')]);var _0x5ddc09=hangupValidation['validate'](_0x4f5fe1[_0x29f6('0x2c')]);if(_0x5ddc09['length']>0x0){return _0x30d747[_0x29f6('0x17')](0x190)['json'](_0x5ddc09);}var _0x3a1a75=_0x4f5fe1['body'][_0x29f6('0x2e')];var _0x11fb2d=_0x4f5fe1['body'][_0x29f6('0x28')];return getAgent(_0x3a1a75)['then'](function(_0x3f3475){logger[_0x29f6('0x11')]('entityFound:',_0x3f3475[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x3f3475[_0x29f6('0x16')]),'webbar:hangup',{'sessionId':_0x11fb2d});return _0x30d747[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x38')});})[_0x29f6('0x35')](handleError(_0x30d747));};exports[_0x29f6('0x39')]=function(_0x4d4189,_0xb5f2b1){logger['info'](_0x29f6('0x3a'),_0x4d4189['body']);var _0xbfe671=answerValidation[_0x29f6('0x3b')](_0x4d4189['body']);if(_0xbfe671[_0x29f6('0x29')]>0x0){return _0xb5f2b1[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0xbfe671);}var _0x27d655=_0x4d4189['body'][_0x29f6('0x2e')];var _0x2a83b7=_0x4d4189[_0x29f6('0x2c')]['sessionId'];return getAgent(_0x27d655)[_0x29f6('0x22')](function(_0x4a5f35){logger[_0x29f6('0x11')]('entityFound:',_0x4a5f35['name']);emit(util['format'](_0x29f6('0x32'),_0x4a5f35[_0x29f6('0x16')]),_0x29f6('0x3c'),{'sessionId':_0x2a83b7});return _0xb5f2b1[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x3d')});})[_0x29f6('0x35')](handleError(_0xb5f2b1));};exports[_0x29f6('0x3e')]=function(_0x352119,_0x1bde93){logger['info']('hold\x20fired:',_0x352119[_0x29f6('0x2c')]);var _0x450e76=holdValidation[_0x29f6('0x3b')](_0x352119[_0x29f6('0x2c')]);if(_0x450e76['length']>0x0){return _0x1bde93[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x450e76);}var _0x532df5=_0x352119[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x123e2f=_0x352119[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x532df5)[_0x29f6('0x22')](function(_0x320b5e){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x320b5e[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x320b5e['name']),_0x29f6('0x40'),{'sessionId':_0x123e2f});return _0x1bde93[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x41')});})[_0x29f6('0x35')](handleError(_0x1bde93));};exports['unhold']=function(_0x2e29e3,_0x52be22){logger['info'](_0x29f6('0x42'),_0x2e29e3[_0x29f6('0x2c')]);var _0x3194fa=unholdValidation[_0x29f6('0x3b')](_0x2e29e3[_0x29f6('0x2c')]);if(_0x3194fa['length']>0x0){return _0x52be22[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3194fa);}var _0x5f42f3=_0x2e29e3[_0x29f6('0x2c')]['userId'];var _0x288cf2=_0x2e29e3[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x5f42f3)[_0x29f6('0x22')](function(_0x5c9113){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5c9113[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5c9113[_0x29f6('0x16')]),_0x29f6('0x43'),{'sessionId':_0x288cf2});return _0x52be22['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x44')});})[_0x29f6('0x35')](handleError(_0x52be22));};exports[_0x29f6('0x45')]=function(_0x36e52c,_0x1ac20d){logger[_0x29f6('0x11')](_0x29f6('0x46'),_0x1ac20d[_0x29f6('0x2c')]);var _0x3dbd19=callsValidation['validate'](_0x36e52c['body']);if(_0x3dbd19[_0x29f6('0x29')]>0x0){return _0x1ac20d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3dbd19);}var _0x5ab84e=_0x36e52c[_0x29f6('0x2c')]['userId'];var _0x550190=respondWithRpcPromise(_0x29f6('0x23'));var _0x234d30=getAgent(_0x5ab84e);return Promise['all']([_0x550190,_0x234d30])['then'](function(_0x3e22f8){var _0x46998c=_0x3e22f8[0x0];var _0x439c0b=_0x3e22f8[0x1];var _0x58694e=_[_0x29f6('0x25')](_0x46998c[_0x29f6('0x26')],function(_0x4284fd){return _0x4284fd[_0x29f6('0x27')]==_0x439c0b['id'];});return _0x1ac20d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'count':_0x58694e[_0x29f6('0x29')],'rows':_0x58694e});})[_0x29f6('0x35')](handleError(_0x1ac20d));};exports[_0x29f6('0x47')]=function(_0x192525,_0x2d4c8d){logger[_0x29f6('0x11')](_0x29f6('0x48'),_0x192525['body']);var _0x5e25c0=conferenceValidation[_0x29f6('0x3b')](_0x192525['body']);if(_0x5e25c0[_0x29f6('0x29')]>0x0){return _0x2d4c8d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e25c0);}var _0x40b4d7=_0x192525[_0x29f6('0x2c')]['userId'];return getAgent(_0x40b4d7)[_0x29f6('0x22')](function(_0x38d684){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x38d684[_0x29f6('0x16')]);emit(util['format'](_0x29f6('0x32'),_0x38d684['name']),'webbar:conference');return _0x2d4c8d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0x29f6('0x35')](handleError(_0x2d4c8d));};exports[_0x29f6('0x49')]=function(_0x58bdf4,_0x44b3ee){logger[_0x29f6('0x11')](_0x29f6('0x4a'),_0x58bdf4[_0x29f6('0x2c')]);var _0xf3c5f1=transferValidation[_0x29f6('0x3b')](_0x58bdf4[_0x29f6('0x2c')]);if(_0xf3c5f1['length']>0x0){return _0x44b3ee[_0x29f6('0x17')](0x190)['json'](_0xf3c5f1);}var _0x37162d=_0x58bdf4['body']['userId'];var _0x1a3357=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x28')];var _0x536b0c=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x4b')];return getAgent(_0x37162d)[_0x29f6('0x22')](function(_0x5625b1){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5625b1[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5625b1[_0x29f6('0x16')]),_0x29f6('0x4c'),{'sessionId':_0x1a3357,'transferNumber':_0x536b0c});return _0x44b3ee[_0x29f6('0x17')](0xc8)['json']({'error':![],'message':_0x29f6('0x4d')});})[_0x29f6('0x35')](handleError(_0x44b3ee));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f391624..56d289d 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 _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b8050,_0x4d12c6){_0x1b8050=_0x1b8050-0x0;var _0x1ec2b1=_0x0b0e[_0x1b8050];return _0x1ec2b1;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file +var _0x896e=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x896e,0x1e9));var _0xe896=function(_0x959eb2,_0x867da1){_0x959eb2=_0x959eb2-0x0;var _0x1809d7=_0x896e[_0x959eb2];return _0x1809d7;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['get'](_0xe896('0x12'),auth['isAuthenticated'](),controller[_0xe896('0x13')]);router['get'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);router['get'](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x17')]);router['get'](_0xe896('0x18'),auth[_0xe896('0xe')](),controller[_0xe896('0x19')]);router['post']('/',auth[_0xe896('0xe')](),controller[_0xe896('0x1a')]);router[_0xe896('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe896('0x1c')]);router[_0xe896('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe896('0x1d')]);router[_0xe896('0x1b')]('/:id/users',auth[_0xe896('0xe')](),controller['addAgents']);router[_0xe896('0x1b')](_0xe896('0x18'),auth[_0xe896('0xe')](),controller['addApplications']);router[_0xe896('0x1b')](_0xe896('0x1e'),controller[_0xe896('0x1f')]);router[_0xe896('0x1b')](_0xe896('0x20'),auth[_0xe896('0xe')](),controller[_0xe896('0x21')]);router[_0xe896('0x22')]('/:id',auth[_0xe896('0xe')](),controller['update']);router['delete'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x23')]);router[_0xe896('0x24')]('/:id/dispositions',auth[_0xe896('0xe')](),controller['removeDispositions']);router['delete'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x25')]);router[_0xe896('0x24')](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1db58f6..ca1a218 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 _0x856d=['mandatoryDisposition','randomstring','exports','STRING','ENUM','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(_0x2cfdb0,_0x5ad544){var _0xc2c5eb=function(_0x561d65){while(--_0x561d65){_0x2cfdb0['push'](_0x2cfdb0['shift']());}};_0xc2c5eb(++_0x5ad544);}(_0x856d,0xcd));var _0xd856=function(_0xe08d18,_0x45688b){_0xe08d18=_0xe08d18-0x0;var _0x39990f=_0x856d[_0xe08d18];return _0x39990f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd856('0x0'));module[_0xd856('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd856('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd856('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd856('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd856('0x2')]},'type':{'type':Sequelize[_0xd856('0x3')]('twilio')},'accountSid':{'type':Sequelize[_0xd856('0x2')]},'authToken':{'type':Sequelize[_0xd856('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd856('0x4')],'defaultValue':function(){return _0xd856('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd856('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd856('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd856('0x7')],'comment':_0xd856('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd856('0x6')],'defaultValue':![],'comment':_0xd856('0x9'),'set':function(_0x43ebe2){if(!_0x43ebe2){this[_0xd856('0xa')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0xd856('0xb'),_0x43ebe2);}},'description':{'type':Sequelize[_0xd856('0x2')]}}; \ No newline at end of file +var _0xa442=['name','twilio','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x36477b,_0x14acc4){var _0x222514=function(_0x109ac3){while(--_0x109ac3){_0x36477b['push'](_0x36477b['shift']());}};_0x222514(++_0x14acc4);}(_0xa442,0x89));var _0x2a44=function(_0x15cf17,_0x5a050f){_0x15cf17=_0x15cf17-0x0;var _0x1f3b85=_0xa442[_0x15cf17];return _0x1f3b85;};'use strict';var Sequelize=require(_0x2a44('0x0'));var rs=require('randomstring');module[_0x2a44('0x1')]={'name':{'type':Sequelize[_0x2a44('0x2')],'unique':_0x2a44('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2a44('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x2a44('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2a44('0x4'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x2a44('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2a44('0x5')],'defaultValue':function(){return _0x2a44('0x6');}},'notificationSound':{'type':Sequelize[_0x2a44('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2a44('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2a44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2a44('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a44('0x8')],'comment':_0x2a44('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2a44('0xa'),'set':function(_0x29e999){if(!_0x29e999){this['setDataValue'](_0x2a44('0xb'),null);}this[_0x2a44('0xc')](_0x2a44('0xd'),_0x29e999);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d8c4bb7..e7b5141 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 _0x4faa=['limit','count','set','Content-Range','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','twilio','From','replace','Body','MessageSid','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','ListId','Contacts','DESC','list','WhatsappInteraction','interaction','created','push','close','unmanaged','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','receiveMessage','info','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','\x0a','to\x20is\x20mandatory','List','out','dataValues','Messages','eml-format','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x262fd7,_0x5a096d){var _0x4669c6=function(_0x5a7398){while(--_0x5a7398){_0x262fd7['push'](_0x262fd7['shift']());}};_0x4669c6(++_0x5a096d);}(_0x4faa,0x12e));var _0xa4fa=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x4faa[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0xa4fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa4fa('0x1'));var moment=require('moment');var BPromise=require(_0xa4fa('0x2'));var Mustache=require(_0xa4fa('0x3'));var util=require('util');var path=require(_0xa4fa('0x4'));var sox=require('sox');var csv=require(_0xa4fa('0x5'));var ejs=require(_0xa4fa('0x6'));var fs=require('fs');var fs_extra=require(_0xa4fa('0x7'));var _=require(_0xa4fa('0x8'));var squel=require(_0xa4fa('0x9'));var crypto=require(_0xa4fa('0xa'));var jsforce=require(_0xa4fa('0xb'));var deskjs=require(_0xa4fa('0xc'));var toCsv=require(_0xa4fa('0x5'));var querystring=require(_0xa4fa('0xd'));var Papa=require(_0xa4fa('0xe'));var Redis=require(_0xa4fa('0xf'));var authService=require(_0xa4fa('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4fa('0x11'))(_0xa4fa('0x12'));var utils=require('../../config/utils');var config=require(_0xa4fa('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4fa('0x14'))['db'];config[_0xa4fa('0x15')]=_[_0xa4fa('0x16')](config[_0xa4fa('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4fa('0x17'))(new Redis(config[_0xa4fa('0x15')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xa4fa('0x18'));var client=jayson['client'][_0xa4fa('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x3eb1a7,_0x6d2a30,_0x4c3005,_0x227cfc){return new BPromise(function(_0x2cc1aa,_0xd6bae0){var _0x546346=_0x227cfc||client;return _0x546346[_0xa4fa('0x1a')](_0x3eb1a7,_0x4c3005)[_0xa4fa('0x1b')](function(_0xfe3598){logger['info'](_0xa4fa('0x1c'),_0x6d2a30,'request\x20sent');logger[_0xa4fa('0x1d')](_0xa4fa('0x1e'),_0x6d2a30,'request\x20sent',JSON[_0xa4fa('0x1f')](_0xfe3598));if(_0xfe3598['error']){if(_0xfe3598[_0xa4fa('0x20')][_0xa4fa('0x21')]===0x1f4){logger[_0xa4fa('0x20')](_0xa4fa('0x1c'),_0x6d2a30,_0xfe3598[_0xa4fa('0x20')][_0xa4fa('0x22')]);return _0xd6bae0(_0xfe3598['error']['message']);}logger['error'](_0xa4fa('0x1c'),_0x6d2a30,_0xfe3598[_0xa4fa('0x20')][_0xa4fa('0x22')]);return _0x2cc1aa(_0xfe3598[_0xa4fa('0x20')][_0xa4fa('0x22')]);}else{logger['info'](_0xa4fa('0x1c'),_0x6d2a30,'request\x20sent');_0x2cc1aa(_0xfe3598['result'][_0xa4fa('0x22')]);}})[_0xa4fa('0x23')](function(_0x2d70b7){logger[_0xa4fa('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x6d2a30,_0x2d70b7);_0xd6bae0(_0x2d70b7);});});}function respondWithStatusCode(_0x169747,_0x16f7cc){_0x16f7cc=_0x16f7cc||0xcc;return function(_0x40eb4b){if(_0x40eb4b){return _0x169747[_0xa4fa('0x24')](_0x16f7cc);}return _0x169747[_0xa4fa('0x25')](_0x16f7cc)[_0xa4fa('0x26')]();};}function respondWithResult(_0x5702e2,_0x2e8547){_0x2e8547=_0x2e8547||0xc8;return function(_0xcd72db){if(_0xcd72db){return _0x5702e2[_0xa4fa('0x25')](_0x2e8547)[_0xa4fa('0x27')](_0xcd72db);}};}function respondWithFilteredResult(_0x794e68,_0x4cee96){return function(_0x526a66){if(_0x526a66){var _0x44da11=typeof _0x4cee96[_0xa4fa('0x28')]===_0xa4fa('0x29')&&typeof _0x4cee96[_0xa4fa('0x2a')]===_0xa4fa('0x29');var _0x17086c=_0x526a66['count'];var _0x1a05f4=_0x44da11?0x0:_0x4cee96[_0xa4fa('0x28')];var _0x166c0c=_0x44da11?_0x526a66[_0xa4fa('0x2b')]:_0x4cee96[_0xa4fa('0x28')]+_0x4cee96[_0xa4fa('0x2a')];var _0x2639e4;if(_0x166c0c>=_0x17086c){_0x166c0c=_0x17086c;_0x2639e4=0xc8;}else{_0x2639e4=0xce;}_0x794e68[_0xa4fa('0x25')](_0x2639e4);return _0x794e68[_0xa4fa('0x2c')](_0xa4fa('0x2d'),_0x1a05f4+'-'+_0x166c0c+'/'+_0x17086c)[_0xa4fa('0x27')](_0x526a66);}return null;};}function patchUpdates(_0x398dac){return function(_0x250a64){try{jsonpatch['apply'](_0x250a64,_0x398dac,!![]);}catch(_0x579b43){return BPromise[_0xa4fa('0x2e')](_0x579b43);}return _0x250a64['save']();};}function saveUpdates(_0x221706,_0x27b0e0){return function(_0x516c49){if(_0x516c49){return _0x516c49[_0xa4fa('0x2f')](_0x221706)[_0xa4fa('0x1b')](function(_0x519eed){return _0x519eed;});}return null;};}function removeEntity(_0x4cafe8,_0x10c80d){return function(_0x5560d8){if(_0x5560d8){return _0x5560d8[_0xa4fa('0x30')]()[_0xa4fa('0x1b')](function(){var _0x53c2f8=_0x5560d8[_0xa4fa('0x31')]({'plain':!![]});var _0x2bb432=_0xa4fa('0x32');return db[_0xa4fa('0x33')][_0xa4fa('0x30')]({'where':{'type':_0x2bb432,'resourceId':_0x53c2f8['id']}})[_0xa4fa('0x1b')](function(){return _0x5560d8;});})[_0xa4fa('0x1b')](function(){_0x4cafe8['status'](0xcc)[_0xa4fa('0x26')]();});}};}function handleEntityNotFound(_0x4eedf0,_0x3bb268){return function(_0x4d4f2d){if(!_0x4d4f2d){_0x4eedf0[_0xa4fa('0x24')](0x194);}return _0x4d4f2d;};}function handleError(_0x1f0390,_0x5476cf){_0x5476cf=_0x5476cf||0x1f4;return function(_0xdb49bb){logger['error'](_0xdb49bb[_0xa4fa('0x34')]);if(_0xdb49bb[_0xa4fa('0x35')]){delete _0xdb49bb[_0xa4fa('0x35')];}_0x1f0390[_0xa4fa('0x25')](_0x5476cf)[_0xa4fa('0x36')](_0xdb49bb);};}exports[_0xa4fa('0x37')]=function(_0x48f21a,_0x42ab4b){var _0x37a032={'include':[{'model':db['Pause'],'as':_0xa4fa('0x38')}]},_0x18aa9f={},_0x4410ec={'count':0x0,'rows':[]};var _0xc4fec5=_[_0xa4fa('0x39')](db[_0xa4fa('0x3a')][_0xa4fa('0x3b')],function(_0x476680){return{'name':_0x476680[_0xa4fa('0x3c')],'type':_0x476680[_0xa4fa('0x3d')][_0xa4fa('0x3e')]};});_0x18aa9f[_0xa4fa('0x3f')]=_['map'](_0xc4fec5,_0xa4fa('0x35'));_0x18aa9f[_0xa4fa('0x40')]=_[_0xa4fa('0x41')](_0x48f21a[_0xa4fa('0x40')]);_0x18aa9f[_0xa4fa('0x42')]=_[_0xa4fa('0x43')](_0x18aa9f['model'],_0x18aa9f[_0xa4fa('0x40')]);_0x37a032[_0xa4fa('0x44')]=_[_0xa4fa('0x43')](_0x18aa9f['model'],qs[_0xa4fa('0x45')](_0x48f21a[_0xa4fa('0x40')]['fields']));_0x37a032[_0xa4fa('0x44')]=_0x37a032[_0xa4fa('0x44')][_0xa4fa('0x46')]?_0x37a032[_0xa4fa('0x44')]:_0x18aa9f['model'];if(!_0x48f21a[_0xa4fa('0x40')][_0xa4fa('0x47')]('nolimit')){_0x37a032[_0xa4fa('0x2a')]=qs[_0xa4fa('0x2a')](_0x48f21a[_0xa4fa('0x40')][_0xa4fa('0x2a')]);_0x37a032[_0xa4fa('0x28')]=qs['offset'](_0x48f21a[_0xa4fa('0x40')]['offset']);}_0x37a032[_0xa4fa('0x48')]=qs[_0xa4fa('0x49')](_0x48f21a[_0xa4fa('0x40')]['sort']);_0x37a032[_0xa4fa('0x4a')]=qs['filters'](_['pick'](_0x48f21a['query'],_0x18aa9f[_0xa4fa('0x42')]),_0xc4fec5);if(_0x48f21a[_0xa4fa('0x40')][_0xa4fa('0x4b')]){_0x37a032[_0xa4fa('0x4a')]=_['merge'](_0x37a032[_0xa4fa('0x4a')],{'$or':_[_0xa4fa('0x39')](_0xc4fec5,function(_0x374dd5){if(_0x374dd5[_0xa4fa('0x3d')]!==_0xa4fa('0x4c')){var _0xd2faca={};_0xd2faca[_0x374dd5[_0xa4fa('0x35')]]={'$like':'%'+_0x48f21a[_0xa4fa('0x40')][_0xa4fa('0x4b')]+'%'};return _0xd2faca;}})});}_0x37a032=_[_0xa4fa('0x4d')]({},_0x37a032,_0x48f21a[_0xa4fa('0x4e')]);var _0x3039fb={'where':_0x37a032['where']};return db[_0xa4fa('0x3a')]['count'](_0x3039fb)['then'](function(_0xe29cd8){_0x4410ec[_0xa4fa('0x2b')]=_0xe29cd8;if(_0x48f21a[_0xa4fa('0x40')][_0xa4fa('0x4f')]){_0x37a032[_0xa4fa('0x50')]=[{'all':!![]}];}return db[_0xa4fa('0x3a')][_0xa4fa('0x51')](_0x37a032);})[_0xa4fa('0x1b')](function(_0x33ef66){_0x4410ec[_0xa4fa('0x52')]=_0x33ef66;return _0x4410ec;})[_0xa4fa('0x1b')](respondWithFilteredResult(_0x42ab4b,_0x37a032))['catch'](handleError(_0x42ab4b,null));};exports[_0xa4fa('0x53')]=function(_0x425e55,_0x3edbc2){var _0x123bfc={'raw':![],'where':{'id':_0x425e55[_0xa4fa('0x54')]['id']},'include':[{'model':db[_0xa4fa('0x55')],'as':_0xa4fa('0x38')}]},_0x53a3b5={};_0x53a3b5[_0xa4fa('0x3f')]=_[_0xa4fa('0x41')](db['WhatsappAccount'][_0xa4fa('0x3b')]);_0x53a3b5[_0xa4fa('0x40')]=_['keys'](_0x425e55[_0xa4fa('0x40')]);_0x53a3b5[_0xa4fa('0x42')]=_[_0xa4fa('0x43')](_0x53a3b5['model'],_0x53a3b5[_0xa4fa('0x40')]);_0x123bfc[_0xa4fa('0x44')]=_[_0xa4fa('0x43')](_0x53a3b5[_0xa4fa('0x3f')],qs[_0xa4fa('0x45')](_0x425e55[_0xa4fa('0x40')][_0xa4fa('0x45')]));_0x123bfc['attributes']=_0x123bfc['attributes'][_0xa4fa('0x46')]?_0x123bfc[_0xa4fa('0x44')]:_0x53a3b5[_0xa4fa('0x3f')];if(_0x425e55['query'][_0xa4fa('0x4f')]){_0x123bfc[_0xa4fa('0x50')]=[{'all':!![]}];}_0x123bfc=_[_0xa4fa('0x4d')]({},_0x123bfc,_0x425e55[_0xa4fa('0x4e')]);return db[_0xa4fa('0x3a')][_0xa4fa('0x56')](_0x123bfc)[_0xa4fa('0x1b')](handleEntityNotFound(_0x3edbc2,null))[_0xa4fa('0x1b')](respondWithResult(_0x3edbc2,null))[_0xa4fa('0x23')](handleError(_0x3edbc2,null));};exports['create']=function(_0x209b72,_0xfe78b4){return db[_0xa4fa('0x3a')][_0xa4fa('0x57')](_0x209b72[_0xa4fa('0x58')],{})[_0xa4fa('0x1b')](function(_0x4ff802){var _0x52ed02=_0x209b72[_0xa4fa('0x59')][_0xa4fa('0x31')]({'plain':!![]});if(!_0x52ed02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52ed02['role']===_0xa4fa('0x59')){var _0x3564bb=_0x4ff802[_0xa4fa('0x31')]({'plain':!![]});var _0x27479d=_0xa4fa('0x32');return db[_0xa4fa('0x5a')][_0xa4fa('0x56')]({'where':{'name':_0x27479d,'userProfileId':_0x52ed02['userProfileId']},'raw':!![]})[_0xa4fa('0x1b')](function(_0x46515a){if(_0x46515a&&_0x46515a[_0xa4fa('0x5b')]===0x0){return db[_0xa4fa('0x33')][_0xa4fa('0x57')]({'name':_0x3564bb[_0xa4fa('0x35')],'resourceId':_0x3564bb['id'],'type':_0x46515a[_0xa4fa('0x35')],'sectionId':_0x46515a['id']},{})[_0xa4fa('0x1b')](function(){return _0x4ff802;});}else{return _0x4ff802;}})[_0xa4fa('0x23')](function(_0xb2bc20){logger[_0xa4fa('0x20')](_0xa4fa('0x5c'),_0xb2bc20);throw _0xb2bc20;});}return _0x4ff802;})[_0xa4fa('0x1b')](respondWithResult(_0xfe78b4,0xc9))[_0xa4fa('0x23')](handleError(_0xfe78b4,null));};exports[_0xa4fa('0x2f')]=function(_0x59fabd,_0x285628){if(_0x59fabd['body']['id']){delete _0x59fabd[_0xa4fa('0x58')]['id'];}return db['WhatsappAccount'][_0xa4fa('0x56')]({'where':{'id':_0x59fabd[_0xa4fa('0x54')]['id']},'include':[{'model':db[_0xa4fa('0x55')],'as':_0xa4fa('0x38')}]})['then'](handleEntityNotFound(_0x285628,null))[_0xa4fa('0x1b')](saveUpdates(_0x59fabd[_0xa4fa('0x58')],null))[_0xa4fa('0x1b')](respondWithResult(_0x285628,null))['catch'](handleError(_0x285628,null));};exports[_0xa4fa('0x30')]=function(_0x1844c1,_0x7b7bc9){return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x1844c1[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x7b7bc9,null))[_0xa4fa('0x1b')](removeEntity(_0x7b7bc9,null))[_0xa4fa('0x23')](handleError(_0x7b7bc9,null));};exports['describe']=function(_0x42c7cc,_0x2264a7){return db[_0xa4fa('0x3a')]['describe']()[_0xa4fa('0x1b')](respondWithResult(_0x2264a7,null))[_0xa4fa('0x23')](handleError(_0x2264a7,null));};exports[_0xa4fa('0x5d')]=function(_0x3695ad,_0x366282,_0x2f2cac){if(_0x3695ad['body']['id']){delete _0x3695ad[_0xa4fa('0x58')]['id'];}return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x3695ad['params']['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x366282,null))[_0xa4fa('0x1b')](function(_0x541f2a){if(_0x541f2a){_0x3695ad[_0xa4fa('0x58')][_0xa4fa('0x5e')]=_0x541f2a['id'];return db[_0xa4fa('0x5f')][_0xa4fa('0x57')](_0x3695ad[_0xa4fa('0x58')]);}})[_0xa4fa('0x1b')](respondWithResult(_0x366282,null))[_0xa4fa('0x23')](handleError(_0x366282,null));};exports[_0xa4fa('0x60')]=function(_0x318224,_0x191ca4,_0x1fe054){var _0x506178={'raw':![],'where':{}};var _0x522f34={};var _0x4a6710={'count':0x0,'rows':[]};return db[_0xa4fa('0x3a')][_0xa4fa('0x61')]({'where':{'id':_0x318224[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x191ca4,null))['then'](function(_0x165f63){if(_0x165f63){_0x522f34[_0xa4fa('0x3f')]=_['keys'](db['Disposition'][_0xa4fa('0x3b')]);_0x522f34[_0xa4fa('0x40')]=_['keys'](_0x318224['query']);_0x522f34[_0xa4fa('0x42')]=_[_0xa4fa('0x43')](_0x522f34[_0xa4fa('0x3f')],_0x522f34['query']);_0x506178['attributes']=_[_0xa4fa('0x43')](_0x522f34[_0xa4fa('0x3f')],qs['fields'](_0x318224[_0xa4fa('0x40')][_0xa4fa('0x45')]));_0x506178[_0xa4fa('0x44')]=_0x506178['attributes']['length']?_0x506178[_0xa4fa('0x44')]:_0x522f34['model'];if(!_0x318224[_0xa4fa('0x40')]['hasOwnProperty'](_0xa4fa('0x62'))){_0x506178[_0xa4fa('0x2a')]=qs[_0xa4fa('0x2a')](_0x318224[_0xa4fa('0x40')][_0xa4fa('0x2a')]);_0x506178[_0xa4fa('0x28')]=qs[_0xa4fa('0x28')](_0x318224[_0xa4fa('0x40')][_0xa4fa('0x28')]);}_0x506178['order']=qs[_0xa4fa('0x49')](_0x318224[_0xa4fa('0x40')][_0xa4fa('0x49')]);_0x506178['where']=qs[_0xa4fa('0x42')](_[_0xa4fa('0x63')](_0x318224[_0xa4fa('0x40')],_0x522f34[_0xa4fa('0x42')]));_0x506178[_0xa4fa('0x4a')]['WhatsappAccountId']=_0x165f63['id'];if(_0x318224['query'][_0xa4fa('0x4b')]){_0x506178[_0xa4fa('0x4a')]=_['merge'](_0x506178[_0xa4fa('0x4a')],{'$or':_[_0xa4fa('0x39')](_0x506178[_0xa4fa('0x44')],function(_0x19e874){var _0x22984c={};_0x22984c[_0x19e874]={'$like':'%'+_0x318224[_0xa4fa('0x40')][_0xa4fa('0x4b')]+'%'};return _0x22984c;})});}_0x506178=_['merge']({},_0x506178,_0x318224[_0xa4fa('0x4e')]);return db[_0xa4fa('0x5f')][_0xa4fa('0x2b')]({'where':_0x506178[_0xa4fa('0x4a')]})[_0xa4fa('0x1b')](function(_0x2d3791){_0x4a6710['count']=_0x2d3791;if(_0x318224['query'][_0xa4fa('0x4f')]){_0x506178[_0xa4fa('0x50')]=[{'all':!![]}];}return db[_0xa4fa('0x5f')][_0xa4fa('0x51')](_0x506178);})['then'](function(_0x32c71c){_0x4a6710[_0xa4fa('0x52')]=_0x32c71c;return _0x4a6710;});}})[_0xa4fa('0x1b')](respondWithFilteredResult(_0x191ca4,_0x506178))['catch'](handleError(_0x191ca4,null));};exports[_0xa4fa('0x64')]=function(_0x1cab4d,_0xe53a3,_0x1f55b1){return db['WhatsappAccount'][_0xa4fa('0x56')]({'where':{'id':_0x1cab4d['params']['id']}})['then'](handleEntityNotFound(_0xe53a3,null))[_0xa4fa('0x1b')](function(_0x24716e){if(_0x24716e){return _0x24716e[_0xa4fa('0x64')](_0x1cab4d[_0xa4fa('0x40')][_0xa4fa('0x65')]);}})['then'](respondWithStatusCode(_0xe53a3,null))[_0xa4fa('0x23')](handleError(_0xe53a3,null));};exports['addAnswer']=function(_0x5d71e2,_0x195a3b,_0x9be277){if(_0x5d71e2['body']['id']){delete _0x5d71e2[_0xa4fa('0x58')]['id'];}return db[_0xa4fa('0x3a')]['find']({'where':{'id':_0x5d71e2[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x195a3b,null))[_0xa4fa('0x1b')](function(_0xf0163f){if(_0xf0163f){_0x5d71e2['body'][_0xa4fa('0x5e')]=_0xf0163f['id'];return db[_0xa4fa('0x66')][_0xa4fa('0x57')](_0x5d71e2[_0xa4fa('0x58')]);}})[_0xa4fa('0x1b')](respondWithResult(_0x195a3b,null))['catch'](handleError(_0x195a3b,null));};exports[_0xa4fa('0x67')]=function(_0x1e62cf,_0x3d493b,_0x3f515c){var _0x4820a1={'raw':![],'where':{}};var _0x4a040d={};var _0xd62b1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xa4fa('0x61')]({'where':{'id':_0x1e62cf[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x3d493b,null))['then'](function(_0x39ab58){if(_0x39ab58){_0x4a040d['model']=_['keys'](db['CannedAnswer'][_0xa4fa('0x3b')]);_0x4a040d[_0xa4fa('0x40')]=_[_0xa4fa('0x41')](_0x1e62cf[_0xa4fa('0x40')]);_0x4a040d[_0xa4fa('0x42')]=_[_0xa4fa('0x43')](_0x4a040d[_0xa4fa('0x3f')],_0x4a040d[_0xa4fa('0x40')]);_0x4820a1[_0xa4fa('0x44')]=_[_0xa4fa('0x43')](_0x4a040d[_0xa4fa('0x3f')],qs['fields'](_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x45')]));_0x4820a1[_0xa4fa('0x44')]=_0x4820a1[_0xa4fa('0x44')][_0xa4fa('0x46')]?_0x4820a1[_0xa4fa('0x44')]:_0x4a040d[_0xa4fa('0x3f')];if(!_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x47')](_0xa4fa('0x62'))){_0x4820a1['limit']=qs[_0xa4fa('0x2a')](_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x2a')]);_0x4820a1['offset']=qs['offset'](_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x28')]);}_0x4820a1['order']=qs[_0xa4fa('0x49')](_0x1e62cf['query']['sort']);_0x4820a1[_0xa4fa('0x4a')]=qs[_0xa4fa('0x42')](_['pick'](_0x1e62cf['query'],_0x4a040d[_0xa4fa('0x42')]));_0x4820a1[_0xa4fa('0x4a')][_0xa4fa('0x5e')]=_0x39ab58['id'];if(_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x4b')]){_0x4820a1['where']=_[_0xa4fa('0x4d')](_0x4820a1[_0xa4fa('0x4a')],{'$or':_['map'](_0x4820a1[_0xa4fa('0x44')],function(_0x4fa688){var _0x426144={};_0x426144[_0x4fa688]={'$like':'%'+_0x1e62cf[_0xa4fa('0x40')][_0xa4fa('0x4b')]+'%'};return _0x426144;})});}_0x4820a1=_[_0xa4fa('0x4d')]({},_0x4820a1,_0x1e62cf[_0xa4fa('0x4e')]);return db[_0xa4fa('0x66')][_0xa4fa('0x2b')]({'where':_0x4820a1[_0xa4fa('0x4a')]})['then'](function(_0x12c07b){_0xd62b1[_0xa4fa('0x2b')]=_0x12c07b;if(_0x1e62cf[_0xa4fa('0x40')]['includeAll']){_0x4820a1[_0xa4fa('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4820a1);})[_0xa4fa('0x1b')](function(_0x446642){_0xd62b1[_0xa4fa('0x52')]=_0x446642;return _0xd62b1;});}})[_0xa4fa('0x1b')](respondWithFilteredResult(_0x3d493b,_0x4820a1))[_0xa4fa('0x23')](handleError(_0x3d493b,null));};exports[_0xa4fa('0x68')]=function(_0x355343,_0x6e0cfe,_0x54f84e){return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x355343[_0xa4fa('0x54')]['id']}})['then'](handleEntityNotFound(_0x6e0cfe,null))[_0xa4fa('0x1b')](function(_0x3fe145){if(_0x3fe145){return _0x3fe145[_0xa4fa('0x68')](_0x355343['query'][_0xa4fa('0x65')]);}})['then'](respondWithStatusCode(_0x6e0cfe,null))[_0xa4fa('0x23')](handleError(_0x6e0cfe,null));};exports[_0xa4fa('0x69')]=function(_0x1e7fb2,_0x53a73c,_0x2a6a58){return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x1e7fb2[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x53a73c,null))[_0xa4fa('0x1b')](function(_0x2476d8){if(_0x2476d8){return _0x2476d8[_0xa4fa('0x69')](_0x1e7fb2[_0xa4fa('0x58')]['ids'],_[_0xa4fa('0x6a')](_0x1e7fb2[_0xa4fa('0x58')],['ids','id'])||{})[_0xa4fa('0x6b')](function(_0x4bd990){for(var _0x594abb=0x0;_0x594abb<_0x1e7fb2[_0xa4fa('0x58')][_0xa4fa('0x65')][_0xa4fa('0x46')];_0x594abb+=0x1){socket[_0xa4fa('0x6c')]('userWhatsappAccount:save',{'UserId':Number(_0x1e7fb2['body'][_0xa4fa('0x65')][_0x594abb]),'WhatsappAccountId':Number(_0x1e7fb2[_0xa4fa('0x54')]['id'])});}return _0x4bd990;});}})[_0xa4fa('0x1b')](respondWithResult(_0x53a73c,null))[_0xa4fa('0x23')](handleError(_0x53a73c,null));};exports[_0xa4fa('0x6d')]=function(_0x3e6c68,_0x28775f,_0x5bd1e8){return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x3e6c68[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x28775f,null))[_0xa4fa('0x1b')](function(_0x509ad8){if(_0x509ad8){return _0x509ad8[_0xa4fa('0x6d')](_0x3e6c68[_0xa4fa('0x40')][_0xa4fa('0x65')])[_0xa4fa('0x1b')](function(){if(_['isArray'](_0x3e6c68[_0xa4fa('0x40')][_0xa4fa('0x65')])){for(var _0x48e825=0x0;_0x48e825<_0x3e6c68[_0xa4fa('0x40')][_0xa4fa('0x65')][_0xa4fa('0x46')];_0x48e825+=0x1){socket['emit'](_0xa4fa('0x6e'),{'UserId':Number(_0x3e6c68[_0xa4fa('0x40')][_0xa4fa('0x65')][_0x48e825]),'WhatsappAccountId':Number(_0x3e6c68[_0xa4fa('0x54')]['id'])});}}else{socket[_0xa4fa('0x6c')](_0xa4fa('0x6e'),{'UserId':Number(_0x3e6c68['query'][_0xa4fa('0x65')]),'WhatsappAccountId':Number(_0x3e6c68[_0xa4fa('0x54')]['id'])});}});}})[_0xa4fa('0x1b')](respondWithStatusCode(_0x28775f,null))['catch'](handleError(_0x28775f,null));};exports[_0xa4fa('0x6f')]=function(_0x1c9937,_0x1f3836,_0x457f4c){var _0x1961a7={};var _0x269f8b={};var _0x28010d;var _0x17b77;return db[_0xa4fa('0x3a')][_0xa4fa('0x61')]({'where':{'id':_0x1c9937[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x1f3836,null))[_0xa4fa('0x1b')](function(_0x46fd85){if(_0x46fd85){_0x28010d=_0x46fd85;_0x269f8b[_0xa4fa('0x3f')]=_[_0xa4fa('0x41')](db[_0xa4fa('0x70')][_0xa4fa('0x3b')]);_0x269f8b[_0xa4fa('0x40')]=_['keys'](_0x1c9937[_0xa4fa('0x40')]);_0x269f8b[_0xa4fa('0x42')]=_[_0xa4fa('0x43')](_0x269f8b[_0xa4fa('0x3f')],_0x269f8b['query']);_0x1961a7[_0xa4fa('0x44')]=_[_0xa4fa('0x43')](_0x269f8b[_0xa4fa('0x3f')],qs[_0xa4fa('0x45')](_0x1c9937[_0xa4fa('0x40')][_0xa4fa('0x45')]));_0x1961a7[_0xa4fa('0x44')]=_0x1961a7[_0xa4fa('0x44')][_0xa4fa('0x46')]?_0x1961a7[_0xa4fa('0x44')]:_0x269f8b[_0xa4fa('0x3f')];_0x1961a7[_0xa4fa('0x48')]=qs[_0xa4fa('0x49')](_0x1c9937[_0xa4fa('0x40')][_0xa4fa('0x49')]);_0x1961a7[_0xa4fa('0x4a')]=qs[_0xa4fa('0x42')](_[_0xa4fa('0x63')](_0x1c9937[_0xa4fa('0x40')],_0x269f8b[_0xa4fa('0x42')]));if(_0x1c9937[_0xa4fa('0x40')][_0xa4fa('0x4b')]){_0x1961a7['where']=_[_0xa4fa('0x4d')](_0x1961a7['where'],{'$or':_['map'](_0x1961a7[_0xa4fa('0x44')],function(_0x2add1f){var _0x4dfb6e={};_0x4dfb6e[_0x2add1f]={'$like':'%'+_0x1c9937[_0xa4fa('0x40')]['filter']+'%'};return _0x4dfb6e;})});}_0x1961a7=_[_0xa4fa('0x4d')]({},_0x1961a7,_0x1c9937['options']);return _0x28010d[_0xa4fa('0x6f')](_0x1961a7);}})['then'](function(_0x5b5ebe){if(_0x5b5ebe){_0x17b77=_0x5b5ebe[_0xa4fa('0x46')];if(!_0x1c9937[_0xa4fa('0x40')][_0xa4fa('0x47')]('nolimit')){_0x1961a7[_0xa4fa('0x2a')]=qs[_0xa4fa('0x2a')](_0x1c9937[_0xa4fa('0x40')]['limit']);_0x1961a7[_0xa4fa('0x28')]=qs[_0xa4fa('0x28')](_0x1c9937[_0xa4fa('0x40')]['offset']);}return _0x28010d[_0xa4fa('0x6f')](_0x1961a7);}})[_0xa4fa('0x1b')](function(_0x58bca3){if(_0x58bca3){return _0x58bca3?{'count':_0x17b77,'rows':_0x58bca3}:null;}})['then'](respondWithResult(_0x1f3836,null))[_0xa4fa('0x23')](handleError(_0x1f3836,null));};exports[_0xa4fa('0x71')]=function(_0x15f50b,_0x5e7c2f,_0x2735df){return db['WhatsappAccount'][_0xa4fa('0x61')]({'where':{'id':_0x15f50b[_0xa4fa('0x54')]['id']}})['then'](handleEntityNotFound(_0x5e7c2f,null))[_0xa4fa('0x1b')](function(_0x584daa){if(_0x584daa){return db[_0xa4fa('0x72')][_0xa4fa('0x73')](function(_0x382e4a){return db[_0xa4fa('0x74')][_0xa4fa('0x30')]({'where':{'WhatsappAccountId':_0x15f50b[_0xa4fa('0x54')]['id']},'transaction':_0x382e4a})[_0xa4fa('0x1b')](function(_0x1713e2){var _0x3d212a=_[_0xa4fa('0x39')](_0x15f50b['body'],function(_0x1105b1){_0x1105b1[_0xa4fa('0x5e')]=_0x15f50b[_0xa4fa('0x54')]['id'];return _0x1105b1;});return db[_0xa4fa('0x74')]['bulkCreate'](_0x3d212a,{'transaction':_0x382e4a});});})[_0xa4fa('0x1b')](function(){return db['WhatsappApplication'][_0xa4fa('0x75')]({'where':{'WhatsappAccountId':_0x15f50b['params']['id']},'order':'priority'});});}})[_0xa4fa('0x1b')](respondWithResult(_0x5e7c2f,null))[_0xa4fa('0x23')](handleError(_0x5e7c2f,null));};exports['getApplications']=function(_0x38d465,_0x1d20f6,_0x53b8e9){var _0xaff7ff={};var _0x5cd2cd={};var _0x473747;var _0x30355d;return db[_0xa4fa('0x3a')][_0xa4fa('0x61')]({'where':{'id':_0x38d465[_0xa4fa('0x54')]['id']}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x1d20f6,null))[_0xa4fa('0x1b')](function(_0x24ae8b){if(_0x24ae8b){_0x473747=_0x24ae8b;_0x5cd2cd[_0xa4fa('0x3f')]=_[_0xa4fa('0x41')](db[_0xa4fa('0x74')][_0xa4fa('0x3b')]);_0x5cd2cd[_0xa4fa('0x40')]=_['keys'](_0x38d465[_0xa4fa('0x40')]);_0x5cd2cd[_0xa4fa('0x42')]=_['intersection'](_0x5cd2cd[_0xa4fa('0x3f')],_0x5cd2cd[_0xa4fa('0x40')]);_0xaff7ff['attributes']=_[_0xa4fa('0x43')](_0x5cd2cd[_0xa4fa('0x3f')],qs[_0xa4fa('0x45')](_0x38d465[_0xa4fa('0x40')]['fields']));_0xaff7ff[_0xa4fa('0x44')]=_0xaff7ff[_0xa4fa('0x44')][_0xa4fa('0x46')]?_0xaff7ff[_0xa4fa('0x44')]:_0x5cd2cd['model'];_0xaff7ff['order']=qs['sort'](_0x38d465[_0xa4fa('0x40')]['sort']);_0xaff7ff[_0xa4fa('0x4a')]=qs[_0xa4fa('0x42')](_[_0xa4fa('0x63')](_0x38d465['query'],_0x5cd2cd[_0xa4fa('0x42')]));if(_0x38d465[_0xa4fa('0x40')]['filter']){_0xaff7ff[_0xa4fa('0x4a')]=_[_0xa4fa('0x4d')](_0xaff7ff[_0xa4fa('0x4a')],{'$or':_[_0xa4fa('0x39')](_0xaff7ff[_0xa4fa('0x44')],function(_0x43f2f1){var _0x4f1615={};_0x4f1615[_0x43f2f1]={'$like':'%'+_0x38d465['query'][_0xa4fa('0x4b')]+'%'};return _0x4f1615;})});}_0xaff7ff=_[_0xa4fa('0x4d')]({},_0xaff7ff,_0x38d465[_0xa4fa('0x4e')]);return _0x473747[_0xa4fa('0x76')](_0xaff7ff);}})[_0xa4fa('0x1b')](function(_0x368be6){if(_0x368be6){_0x30355d=_0x368be6[_0xa4fa('0x46')];if(!_0x38d465[_0xa4fa('0x40')][_0xa4fa('0x47')](_0xa4fa('0x62'))){_0xaff7ff[_0xa4fa('0x2a')]=qs[_0xa4fa('0x2a')](_0x38d465['query']['limit']);_0xaff7ff[_0xa4fa('0x28')]=qs['offset'](_0x38d465[_0xa4fa('0x40')][_0xa4fa('0x28')]);}return _0x473747[_0xa4fa('0x76')](_0xaff7ff);}})[_0xa4fa('0x1b')](function(_0x1d2858){if(_0x1d2858){return _0x1d2858?{'count':_0x30355d,'rows':_0x1d2858}:null;}})[_0xa4fa('0x1b')](respondWithResult(_0x1d20f6,null))[_0xa4fa('0x23')](handleError(_0x1d20f6,null));};exports[_0xa4fa('0x77')]=function(_0xef7e64,_0x1c53f3,_0x5dfd2e){var _0xd43e4c={'channel':_0xa4fa('0x78')};var _0x147b1f=[];var _0x513c22=[];var _0x2e4e20={};return db['WhatsappAccount'][_0xa4fa('0x56')]({'where':{'id':_0xef7e64[_0xa4fa('0x54')]['id']},'include':[{'model':db[_0xa4fa('0x74')],'as':_0xa4fa('0x79')}]})[_0xa4fa('0x1b')](handleEntityNotFound(_0x1c53f3,null))['then'](function(_0x3becdc){_0xd43e4c[_0xa4fa('0x7a')]=_0x3becdc;_0xd43e4c[_0xa4fa('0x7b')]=_[_0xa4fa('0x7c')](_0x3becdc[_0xa4fa('0x79')],['priority'],[_0xa4fa('0x7d')]);if(_0xd43e4c[_0xa4fa('0x7a')][_0xa4fa('0x79')]){delete _0xd43e4c[_0xa4fa('0x7a')][_0xa4fa('0x79')];}return db[_0xa4fa('0x7e')][_0xa4fa('0x7f')]();})[_0xa4fa('0x1b')](function(_0x59ee4f){if(!_0x59ee4f){throw new db[(_0xa4fa('0x80'))]['ValidationError'](_0xa4fa('0x81'));}_0x147b1f=_[_0xa4fa('0x82')](_[_0xa4fa('0x41')](_0x59ee4f),[_0xa4fa('0x83'),_0xa4fa('0x84')]);_0x513c22=_['difference'](_['keys'](_0x59ee4f),['createdAt','updatedAt','CompanyId','ListId']);_0xd43e4c[_0xa4fa('0x58')]={'mapKey':_0xa4fa('0x85')};if(_0xd43e4c[_0xa4fa('0x7a')][_0xa4fa('0x3d')]&&_0xd43e4c['account'][_0xa4fa('0x3d')]===_0xa4fa('0x86')){_0xd43e4c[_0xa4fa('0x58')]['from']=_0xef7e64[_0xa4fa('0x58')][_0xa4fa('0x87')][_0xa4fa('0x88')]('whatsapp:','');_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x58')]=_0xef7e64[_0xa4fa('0x58')][_0xa4fa('0x89')];_0xd43e4c[_0xa4fa('0x58')]['messageId']=_0xef7e64[_0xa4fa('0x58')][_0xa4fa('0x8a')];}if(_0xd43e4c[_0xa4fa('0x58')]['id']){delete _0xd43e4c[_0xa4fa('0x58')]['id'];}if(_[_0xa4fa('0x8b')](_0xd43e4c['body'][_0xa4fa('0x8c')])){throw new db[(_0xa4fa('0x80'))][(_0xa4fa('0x8d'))]('from\x20is\x20mandatory');}if(_[_0xa4fa('0x8b')](_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x58')])||_0xd43e4c[_0xa4fa('0x58')]['body']===''){throw new db[(_0xa4fa('0x80'))][(_0xa4fa('0x8d'))](_0xa4fa('0x8e'));}if(_['isNil'](_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x8f')])){throw new db[(_0xa4fa('0x80'))][(_0xa4fa('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x513c22);}if(!_['includes'](_0x513c22,_0xd43e4c[_0xa4fa('0x58')]['mapKey'])){throw new db['Sequelize'][(_0xa4fa('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x513c22);}_0x2e4e20[_0xd43e4c[_0xa4fa('0x58')]['mapKey']]=_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x8c')];return db[_0xa4fa('0x90')][_0xa4fa('0x56')]({'where':{'id':_0xd43e4c[_0xa4fa('0x7a')][_0xa4fa('0x91')]},'include':[{'model':db[_0xa4fa('0x7e')],'as':_0xa4fa('0x92'),'where':_0x2e4e20,'limit':0x1,'order':[[_0xa4fa('0x84'),_0xa4fa('0x93')]]}]});})[_0xa4fa('0x1b')](handleEntityNotFound(_0x1c53f3,null))[_0xa4fa('0x1b')](function(_0x30b95f){if(_0x30b95f){_0xd43e4c[_0xa4fa('0x94')]=_[_0xa4fa('0x6a')](_0x30b95f,['Contacts']);if(_0x30b95f[_0xa4fa('0x92')][_0xa4fa('0x46')]){return _0x30b95f[_0xa4fa('0x92')][0x0];}var _0x5339d9=_['defaults'](_0xd43e4c['body'],{'firstName':_0xd43e4c['body']['from'],'ListId':_0x30b95f['id']});_0x5339d9[_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x8f')]]=_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x8c')];return db[_0xa4fa('0x7e')][_0xa4fa('0x57')](_0x5339d9,{'fields':_0x147b1f,'raw':!![]});}})[_0xa4fa('0x1b')](handleEntityNotFound(_0x1c53f3,null))[_0xa4fa('0x1b')](function(_0x4e1509){if(_0x4e1509){_0xd43e4c['contact']=_0x4e1509;var _0x5a7378={'ContactId':_0x4e1509['id'],'phone':_0xd43e4c[_0xa4fa('0x58')]['from'],'WhatsappAccountId':_0xef7e64[_0xa4fa('0x54')]['id']};var _0x3fc217={'ContactId':_0x4e1509['id'],'WhatsappAccountId':_0xef7e64['params']['id'],'closed':![]};return db[_0xa4fa('0x95')][_0xa4fa('0x56')]({'where':_0x3fc217})[_0xa4fa('0x1b')](function(_0x20476d){if(_0x20476d){return[_0x20476d,![]];}return db[_0xa4fa('0x95')][_0xa4fa('0x57')](_0x5a7378)[_0xa4fa('0x1b')](function(_0x4b2d7e){return[_0x4b2d7e,!![]];});});}})[_0xa4fa('0x6b')](function(_0x352479,_0x105488){_0xd43e4c[_0xa4fa('0x96')]=_0x352479[_0xa4fa('0x31')]({'plain':!![]});_0xd43e4c['interaction'][_0xa4fa('0x97')]=![];if(_0x105488){if(_0xd43e4c[_0xa4fa('0x7a')]['autoclose']){_0xd43e4c['applications'][_0xa4fa('0x98')]({'id':0x0,'priority':_0xd43e4c['applications'][_0xa4fa('0x46')]+0x1,'app':_0xa4fa('0x99'),'appdata':_0xa4fa('0x9a'),'interval':'*,*,*,*'});}_0xd43e4c[_0xa4fa('0x96')][_0xa4fa('0x97')]=!![];}return db['WhatsappMessage'][_0xa4fa('0x57')]({'phone':_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x8c')],'messageId':_0xd43e4c[_0xa4fa('0x58')]['messageId'],'body':_0xd43e4c[_0xa4fa('0x58')][_0xa4fa('0x58')],'WhatsappAccountId':_0xef7e64[_0xa4fa('0x54')]['id'],'WhatsappInteractionId':_0x352479['id'],'direction':'in','ContactId':_0x352479[_0xa4fa('0x9b')],'AttachmentId':_0xd43e4c['body']['AttachmentId']});})[_0xa4fa('0x1b')](function(_0x1dd06c){_0xd43e4c['message']=_0x1dd06c;if(_0xd43e4c[_0xa4fa('0x96')][_0xa4fa('0x9c')]){return db[_0xa4fa('0x70')][_0xa4fa('0x56')]({'attributes':['id',_0xa4fa('0x35')],'where':{'id':_0xd43e4c['interaction'][_0xa4fa('0x9c')]}})['then'](function(_0x3fc3bc){if(_0x3fc3bc){_0xd43e4c[_0xa4fa('0x7b')][_0xa4fa('0x9d')]({'id':0x0,'priority':0x0,'app':_0xa4fa('0x9e'),'appdata':_0x3fc3bc['name']+','+(_0xd43e4c[_0xa4fa('0x7a')][_0xa4fa('0x9f')]||0xa),'interval':_0xa4fa('0xa0')});}return respondWithRpcPromise(_0xa4fa('0xa1'),'startRouting',_0xd43e4c);});}return respondWithRpcPromise(_0xa4fa('0xa1'),'startRouting',_0xd43e4c);})[_0xa4fa('0x1b')](function(_0x189641){if(_0x189641){var _0x40142c=0xc8;var _0x2d4329=_0xa4fa('0xa2');logger[_0xa4fa('0xa3')](_0xa4fa('0x1e'),_0x2d4329,_0x40142c,_0xa4fa('0xa4'));logger['debug'](_0xa4fa('0xa5'),_0x2d4329,_0x40142c,_0xa4fa('0xa4'),JSON['stringify'](_0x189641));if(_0xd43e4c[_0xa4fa('0x7a')]['type']===_0xa4fa('0x86')){return _0x1c53f3['status'](_0x40142c)['set']('Content-Type','text/xml')[_0xa4fa('0x36')](_0xa4fa('0xa6'));}else{return _0x1c53f3[_0xa4fa('0x25')](_0x40142c)[_0xa4fa('0x27')](_0x189641);}}})[_0xa4fa('0x23')](handleError(_0x1c53f3,null));};exports['send']=function(_0x41be98,_0x43f3d7,_0x25180c){var _0x13d601,_0x4c4225,_0x5b9f4f;if(_[_0xa4fa('0x8b')](_0x41be98[_0xa4fa('0x58')][_0xa4fa('0x58')])||_0x41be98['body'][_0xa4fa('0x58')]===''){throw new db[(_0xa4fa('0x80'))]['ValidationError'](_0xa4fa('0x8e'));}if(_[_0xa4fa('0x8b')](_0x41be98[_0xa4fa('0x58')]['to'])){throw new db[(_0xa4fa('0x80'))][(_0xa4fa('0x8d'))](_0xa4fa('0xa7'));}_0x13d601=_0x41be98[_0xa4fa('0x58')]['to'];return db[_0xa4fa('0x3a')][_0xa4fa('0x56')]({'where':{'id':_0x41be98[_0xa4fa('0x54')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xa4fa('0x7e')],'as':_0xa4fa('0x92'),'where':{'mobile':_0x13d601},'limit':0x1,'order':[[_0xa4fa('0x84'),_0xa4fa('0x93')]]}]}]})[_0xa4fa('0x1b')](handleEntityNotFound(_0x43f3d7,null))[_0xa4fa('0x1b')](function(_0x42cefb){if(_0x42cefb&&_0x42cefb[_0xa4fa('0xa8')]){_0x4c4225=_0x42cefb[_0xa4fa('0x31')]({'plain':!![]});if(_0x4c4225[_0xa4fa('0xa8')]&&_0x4c4225['List'][_0xa4fa('0x92')][_0xa4fa('0x46')]){return _0x4c4225['List'][_0xa4fa('0x92')][0x0];}return db[_0xa4fa('0x7e')][_0xa4fa('0x57')](_[_0xa4fa('0x16')](_0x41be98[_0xa4fa('0x58')],{'firstName':_0x13d601,'mobile':_0x13d601,'phone':_0x13d601,'ListId':_0x4c4225[_0xa4fa('0x91')]}));}})['then'](handleEntityNotFound(_0x43f3d7,null))['then'](function(_0x5d7c95){if(_0x5d7c95){_0x5b9f4f=_0x5d7c95;return db['WhatsappInteraction'][_0xa4fa('0x56')]({'where':{'ContactId':_0x5b9f4f['id'],'closed':![],'WhatsappAccountId':_0x4c4225['id']}})[_0xa4fa('0x1b')](function(_0x379836){if(_0x379836){return[_0x379836,![]];}return db[_0xa4fa('0x95')][_0xa4fa('0x57')]({'UserId':_0x41be98[_0xa4fa('0x59')]['id'],'ContactId':_0x5b9f4f['id'],'WhatsappAccountId':_0x4c4225['id'],'phone':_0x13d601,'firstMsgDirection':_0xa4fa('0xa9'),'Messages':[_['merge'](_0x41be98[_0xa4fa('0x58')],{'read':![],'body':_0x41be98[_0xa4fa('0x58')][_0xa4fa('0x58')],'phone':_0x13d601,'WhatsappAccountId':_0x4c4225['id'],'UserId':_0x41be98[_0xa4fa('0x59')]['id'],'ContactId':_0x5b9f4f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0xa4fa('0x1b')](function(_0x584b32){return[_0x584b32,!![]];});});}})[_0xa4fa('0x6b')](function(_0x4bacf5,_0x304f7a){if(_0x304f7a){return _0x4bacf5;}return db['WhatsappMessage'][_0xa4fa('0x57')](_[_0xa4fa('0x4d')](_0x41be98['body'],{'read':![],'body':_0x41be98[_0xa4fa('0x58')][_0xa4fa('0x58')],'phone':_0x13d601,'WhatsappAccountId':_0x4c4225['id'],'WhatsappInteractionId':_0x4bacf5['id'],'UserId':_0x41be98[_0xa4fa('0x59')]['id'],'ContactId':_0x5b9f4f['id']}))['then'](function(_0x1b18b3){_0x4bacf5[_0xa4fa('0xaa')][_0xa4fa('0xab')]=[];_0x4bacf5[_0xa4fa('0xaa')][_0xa4fa('0xab')]['push'](_0x1b18b3[_0xa4fa('0xaa')]);return _0x4bacf5;});})[_0xa4fa('0x1b')](respondWithResult(_0x43f3d7,null))[_0xa4fa('0x23')](handleError(_0x43f3d7,null));}; \ No newline at end of file +var _0x0685=['removeAnswers','addAgents','ids','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','priority','getApplications','whatsapp','Applications','account','applications','orderBy','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','isNil','Sequelize','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','CmContact','Contacts','DESC','omit','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','name','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','WhatsappAccount','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','findOne','length','nolimit','order','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers'];(function(_0x2d6b69,_0x3d0a97){var _0x40b8f1=function(_0x49893c){while(--_0x49893c){_0x2d6b69['push'](_0x2d6b69['shift']());}};_0x40b8f1(++_0x3d0a97);}(_0x0685,0x10d));var _0x5068=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0685[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x5068('0x0'));var rimraf=require(_0x5068('0x1'));var zipdir=require(_0x5068('0x2'));var jsonpatch=require(_0x5068('0x3'));var rp=require(_0x5068('0x4'));var moment=require(_0x5068('0x5'));var BPromise=require(_0x5068('0x6'));var Mustache=require(_0x5068('0x7'));var util=require(_0x5068('0x8'));var path=require(_0x5068('0x9'));var sox=require(_0x5068('0xa'));var csv=require(_0x5068('0xb'));var ejs=require(_0x5068('0xc'));var fs=require('fs');var fs_extra=require(_0x5068('0xd'));var _=require(_0x5068('0xe'));var squel=require(_0x5068('0xf'));var crypto=require('crypto');var jsforce=require(_0x5068('0x10'));var deskjs=require(_0x5068('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5068('0x12'));var Papa=require(_0x5068('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5068('0x14'));var as=require(_0x5068('0x15'));var hardwareService=require(_0x5068('0x16'));var logger=require(_0x5068('0x17'))(_0x5068('0x18'));var utils=require(_0x5068('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5068('0x1a'))['db'];config[_0x5068('0x1b')]=_[_0x5068('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5068('0x1d'))(new Redis(config['redis']));require(_0x5068('0x1e'))['register'](socket);var jayson=require(_0x5068('0x1f'));var client=jayson[_0x5068('0x20')][_0x5068('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x1b4405,_0x1630fa,_0x2d7deb,_0x3e9de3){return new BPromise(function(_0x455b8e,_0x1ca103){var _0x2a3a90=_0x3e9de3||client;return _0x2a3a90[_0x5068('0x22')](_0x1b4405,_0x2d7deb)[_0x5068('0x23')](function(_0xb1048f){logger[_0x5068('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x1630fa,_0x5068('0x25'));logger[_0x5068('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1630fa,_0x5068('0x25'),JSON[_0x5068('0x27')](_0xb1048f));if(_0xb1048f[_0x5068('0x28')]){if(_0xb1048f[_0x5068('0x28')][_0x5068('0x29')]===0x1f4){logger['error'](_0x5068('0x2a'),_0x1630fa,_0xb1048f[_0x5068('0x28')][_0x5068('0x2b')]);return _0x1ca103(_0xb1048f['error']['message']);}logger[_0x5068('0x28')](_0x5068('0x2a'),_0x1630fa,_0xb1048f[_0x5068('0x28')][_0x5068('0x2b')]);return _0x455b8e(_0xb1048f['error'][_0x5068('0x2b')]);}else{logger[_0x5068('0x24')](_0x5068('0x2a'),_0x1630fa,_0x5068('0x25'));_0x455b8e(_0xb1048f[_0x5068('0x2c')][_0x5068('0x2b')]);}})[_0x5068('0x2d')](function(_0x55c0d8){logger['error'](_0x5068('0x2a'),_0x1630fa,_0x55c0d8);_0x1ca103(_0x55c0d8);});});}function respondWithStatusCode(_0x12b250,_0x50d6c7){_0x50d6c7=_0x50d6c7||0xcc;return function(_0x227627){if(_0x227627){return _0x12b250[_0x5068('0x2e')](_0x50d6c7);}return _0x12b250[_0x5068('0x2f')](_0x50d6c7)[_0x5068('0x30')]();};}function respondWithResult(_0x8bee4c,_0xafe134){_0xafe134=_0xafe134||0xc8;return function(_0x2fa818){if(_0x2fa818){return _0x8bee4c['status'](_0xafe134)[_0x5068('0x31')](_0x2fa818);}};}function respondWithFilteredResult(_0x96bc64,_0x2440a8){return function(_0x37f6c6){if(_0x37f6c6){var _0x5b505e=typeof _0x2440a8['offset']===_0x5068('0x32')&&typeof _0x2440a8[_0x5068('0x33')]===_0x5068('0x32');var _0x48ad85=_0x37f6c6[_0x5068('0x34')];var _0x249a3c=_0x5b505e?0x0:_0x2440a8[_0x5068('0x35')];var _0x468cf2=_0x5b505e?_0x37f6c6[_0x5068('0x34')]:_0x2440a8['offset']+_0x2440a8[_0x5068('0x33')];var _0x180614;if(_0x468cf2>=_0x48ad85){_0x468cf2=_0x48ad85;_0x180614=0xc8;}else{_0x180614=0xce;}_0x96bc64['status'](_0x180614);return _0x96bc64[_0x5068('0x36')](_0x5068('0x37'),_0x249a3c+'-'+_0x468cf2+'/'+_0x48ad85)[_0x5068('0x31')](_0x37f6c6);}return null;};}function patchUpdates(_0x3647d2){return function(_0x1a6f86){try{jsonpatch[_0x5068('0x38')](_0x1a6f86,_0x3647d2,!![]);}catch(_0x4759b2){return BPromise[_0x5068('0x39')](_0x4759b2);}return _0x1a6f86['save']();};}function saveUpdates(_0x54351c,_0x2b5ce5){return function(_0x14d058){if(_0x14d058){return _0x14d058[_0x5068('0x3a')](_0x54351c)['then'](function(_0x2c4cd7){return _0x2c4cd7;});}return null;};}function removeEntity(_0x222d26,_0x99c278){return function(_0x394e8f){if(_0x394e8f){return _0x394e8f[_0x5068('0x3b')]()['then'](function(){var _0x5f30d4=_0x394e8f[_0x5068('0x3c')]({'plain':!![]});var _0x10680b=_0x5068('0x3d');return db[_0x5068('0x3e')]['destroy']({'where':{'type':_0x10680b,'resourceId':_0x5f30d4['id']}})[_0x5068('0x23')](function(){return _0x394e8f;});})[_0x5068('0x23')](function(){_0x222d26[_0x5068('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4948f6,_0x18cd4b){return function(_0x482d2c){if(!_0x482d2c){_0x4948f6['sendStatus'](0x194);}return _0x482d2c;};}function handleError(_0x35c053,_0x24654e){_0x24654e=_0x24654e||0x1f4;return function(_0x90578a){logger[_0x5068('0x28')](_0x90578a['stack']);if(_0x90578a[_0x5068('0x3f')]){delete _0x90578a['name'];}_0x35c053['status'](_0x24654e)['send'](_0x90578a);};}exports['index']=function(_0x2984b6,_0x1a32be){var _0x3102ee={'include':[{'model':db[_0x5068('0x40')],'as':_0x5068('0x41')}]},_0x245151={},_0x3e602c={'count':0x0,'rows':[]};var _0x3f53bd=_[_0x5068('0x42')](db['WhatsappAccount'][_0x5068('0x43')],function(_0x2d7ecf){return{'name':_0x2d7ecf['fieldName'],'type':_0x2d7ecf['type'][_0x5068('0x44')]};});_0x245151[_0x5068('0x45')]=_[_0x5068('0x42')](_0x3f53bd,'name');_0x245151[_0x5068('0x46')]=_[_0x5068('0x47')](_0x2984b6['query']);_0x245151[_0x5068('0x48')]=_[_0x5068('0x49')](_0x245151[_0x5068('0x45')],_0x245151[_0x5068('0x46')]);_0x3102ee[_0x5068('0x4a')]=_['intersection'](_0x245151[_0x5068('0x45')],qs[_0x5068('0x4b')](_0x2984b6['query']['fields']));_0x3102ee['attributes']=_0x3102ee['attributes']['length']?_0x3102ee[_0x5068('0x4a')]:_0x245151[_0x5068('0x45')];if(!_0x2984b6[_0x5068('0x46')][_0x5068('0x4c')]('nolimit')){_0x3102ee['limit']=qs[_0x5068('0x33')](_0x2984b6['query']['limit']);_0x3102ee[_0x5068('0x35')]=qs[_0x5068('0x35')](_0x2984b6[_0x5068('0x46')]['offset']);}_0x3102ee['order']=qs['sort'](_0x2984b6[_0x5068('0x46')][_0x5068('0x4d')]);_0x3102ee[_0x5068('0x4e')]=qs['filters'](_[_0x5068('0x4f')](_0x2984b6['query'],_0x245151['filters']),_0x3f53bd);if(_0x2984b6[_0x5068('0x46')][_0x5068('0x50')]){_0x3102ee[_0x5068('0x4e')]=_[_0x5068('0x51')](_0x3102ee['where'],{'$or':_[_0x5068('0x42')](_0x3f53bd,function(_0x49bcec){if(_0x49bcec[_0x5068('0x52')]!==_0x5068('0x53')){var _0x201cb3={};_0x201cb3[_0x49bcec[_0x5068('0x3f')]]={'$like':'%'+_0x2984b6['query'][_0x5068('0x50')]+'%'};return _0x201cb3;}})});}_0x3102ee=_[_0x5068('0x51')]({},_0x3102ee,_0x2984b6[_0x5068('0x54')]);var _0x312535={'where':_0x3102ee['where']};return db['WhatsappAccount'][_0x5068('0x34')](_0x312535)[_0x5068('0x23')](function(_0x5607da){_0x3e602c['count']=_0x5607da;if(_0x2984b6[_0x5068('0x46')][_0x5068('0x55')]){_0x3102ee['include']=[{'all':!![]}];}return db[_0x5068('0x56')][_0x5068('0x57')](_0x3102ee);})['then'](function(_0x43cd2e){_0x3e602c[_0x5068('0x58')]=_0x43cd2e;return _0x3e602c;})['then'](respondWithFilteredResult(_0x1a32be,_0x3102ee))[_0x5068('0x2d')](handleError(_0x1a32be,null));};exports[_0x5068('0x59')]=function(_0x4c1320,_0x507f22){var _0x4c9a82={'raw':![],'where':{'id':_0x4c1320[_0x5068('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5a85ff={};_0x5a85ff[_0x5068('0x45')]=_[_0x5068('0x47')](db[_0x5068('0x56')][_0x5068('0x43')]);_0x5a85ff[_0x5068('0x46')]=_[_0x5068('0x47')](_0x4c1320['query']);_0x5a85ff[_0x5068('0x48')]=_[_0x5068('0x49')](_0x5a85ff[_0x5068('0x45')],_0x5a85ff[_0x5068('0x46')]);_0x4c9a82[_0x5068('0x4a')]=_[_0x5068('0x49')](_0x5a85ff[_0x5068('0x45')],qs['fields'](_0x4c1320[_0x5068('0x46')]['fields']));_0x4c9a82['attributes']=_0x4c9a82[_0x5068('0x4a')]['length']?_0x4c9a82[_0x5068('0x4a')]:_0x5a85ff[_0x5068('0x45')];if(_0x4c1320['query']['includeAll']){_0x4c9a82[_0x5068('0x5b')]=[{'all':!![]}];}_0x4c9a82=_[_0x5068('0x51')]({},_0x4c9a82,_0x4c1320['options']);return db[_0x5068('0x56')][_0x5068('0x5c')](_0x4c9a82)[_0x5068('0x23')](handleEntityNotFound(_0x507f22,null))[_0x5068('0x23')](respondWithResult(_0x507f22,null))['catch'](handleError(_0x507f22,null));};exports[_0x5068('0x5d')]=function(_0x42b02d,_0x3cc17f){return db['WhatsappAccount'][_0x5068('0x5d')](_0x42b02d[_0x5068('0x5e')],{})[_0x5068('0x23')](function(_0x5ce748){var _0x53f924=_0x42b02d['user']['get']({'plain':!![]});if(!_0x53f924)throw new Error(_0x5068('0x5f'));if(_0x53f924['role']===_0x5068('0x60')){var _0x43b7c4=_0x5ce748['get']({'plain':!![]});var _0xf8dea8=_0x5068('0x3d');return db[_0x5068('0x61')][_0x5068('0x5c')]({'where':{'name':_0xf8dea8,'userProfileId':_0x53f924[_0x5068('0x62')]},'raw':!![]})['then'](function(_0x1316e6){if(_0x1316e6&&_0x1316e6[_0x5068('0x63')]===0x0){return db['UserProfileResource'][_0x5068('0x5d')]({'name':_0x43b7c4[_0x5068('0x3f')],'resourceId':_0x43b7c4['id'],'type':_0x1316e6['name'],'sectionId':_0x1316e6['id']},{})[_0x5068('0x23')](function(){return _0x5ce748;});}else{return _0x5ce748;}})[_0x5068('0x2d')](function(_0x2529a4){logger[_0x5068('0x28')](_0x5068('0x64'),_0x2529a4);throw _0x2529a4;});}return _0x5ce748;})[_0x5068('0x23')](respondWithResult(_0x3cc17f,0xc9))[_0x5068('0x2d')](handleError(_0x3cc17f,null));};exports[_0x5068('0x3a')]=function(_0x4a8030,_0x4f56ca){if(_0x4a8030['body']['id']){delete _0x4a8030['body']['id'];}return db[_0x5068('0x56')]['find']({'where':{'id':_0x4a8030[_0x5068('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x5068('0x41')}]})[_0x5068('0x23')](handleEntityNotFound(_0x4f56ca,null))[_0x5068('0x23')](saveUpdates(_0x4a8030[_0x5068('0x5e')],null))[_0x5068('0x23')](respondWithResult(_0x4f56ca,null))[_0x5068('0x2d')](handleError(_0x4f56ca,null));};exports[_0x5068('0x3b')]=function(_0x1bd26c,_0x497229){return db['WhatsappAccount'][_0x5068('0x5c')]({'where':{'id':_0x1bd26c[_0x5068('0x5a')]['id']}})['then'](handleEntityNotFound(_0x497229,null))[_0x5068('0x23')](removeEntity(_0x497229,null))[_0x5068('0x2d')](handleError(_0x497229,null));};exports['describe']=function(_0x4478d2,_0x6c0310){return db[_0x5068('0x56')][_0x5068('0x65')]()[_0x5068('0x23')](respondWithResult(_0x6c0310,null))[_0x5068('0x2d')](handleError(_0x6c0310,null));};exports[_0x5068('0x66')]=function(_0x23114e,_0x3c9717,_0x3f987d){if(_0x23114e[_0x5068('0x5e')]['id']){delete _0x23114e[_0x5068('0x5e')]['id'];}return db['WhatsappAccount'][_0x5068('0x5c')]({'where':{'id':_0x23114e[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x3c9717,null))[_0x5068('0x23')](function(_0x22842e){if(_0x22842e){_0x23114e['body'][_0x5068('0x67')]=_0x22842e['id'];return db['Disposition'][_0x5068('0x5d')](_0x23114e[_0x5068('0x5e')]);}})[_0x5068('0x23')](respondWithResult(_0x3c9717,null))['catch'](handleError(_0x3c9717,null));};exports['getDispositions']=function(_0x130df7,_0x21ec5b,_0x5824e0){var _0x56f938={'raw':![],'where':{}};var _0x52e7d4={};var _0x3c8712={'count':0x0,'rows':[]};return db[_0x5068('0x56')][_0x5068('0x68')]({'where':{'id':_0x130df7[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x21ec5b,null))[_0x5068('0x23')](function(_0x4f7b6d){if(_0x4f7b6d){_0x52e7d4[_0x5068('0x45')]=_[_0x5068('0x47')](db['Disposition']['rawAttributes']);_0x52e7d4[_0x5068('0x46')]=_[_0x5068('0x47')](_0x130df7[_0x5068('0x46')]);_0x52e7d4[_0x5068('0x48')]=_[_0x5068('0x49')](_0x52e7d4['model'],_0x52e7d4[_0x5068('0x46')]);_0x56f938[_0x5068('0x4a')]=_[_0x5068('0x49')](_0x52e7d4[_0x5068('0x45')],qs[_0x5068('0x4b')](_0x130df7['query'][_0x5068('0x4b')]));_0x56f938[_0x5068('0x4a')]=_0x56f938[_0x5068('0x4a')][_0x5068('0x69')]?_0x56f938[_0x5068('0x4a')]:_0x52e7d4[_0x5068('0x45')];if(!_0x130df7[_0x5068('0x46')][_0x5068('0x4c')](_0x5068('0x6a'))){_0x56f938['limit']=qs[_0x5068('0x33')](_0x130df7[_0x5068('0x46')][_0x5068('0x33')]);_0x56f938[_0x5068('0x35')]=qs[_0x5068('0x35')](_0x130df7[_0x5068('0x46')][_0x5068('0x35')]);}_0x56f938[_0x5068('0x6b')]=qs[_0x5068('0x4d')](_0x130df7[_0x5068('0x46')]['sort']);_0x56f938['where']=qs[_0x5068('0x48')](_[_0x5068('0x4f')](_0x130df7['query'],_0x52e7d4[_0x5068('0x48')]));_0x56f938[_0x5068('0x4e')][_0x5068('0x67')]=_0x4f7b6d['id'];if(_0x130df7[_0x5068('0x46')]['filter']){_0x56f938[_0x5068('0x4e')]=_[_0x5068('0x51')](_0x56f938[_0x5068('0x4e')],{'$or':_['map'](_0x56f938['attributes'],function(_0x1d4e6a){var _0x433143={};_0x433143[_0x1d4e6a]={'$like':'%'+_0x130df7['query'][_0x5068('0x50')]+'%'};return _0x433143;})});}_0x56f938=_[_0x5068('0x51')]({},_0x56f938,_0x130df7[_0x5068('0x54')]);return db[_0x5068('0x6c')][_0x5068('0x34')]({'where':_0x56f938[_0x5068('0x4e')]})[_0x5068('0x23')](function(_0x5e3ce4){_0x3c8712[_0x5068('0x34')]=_0x5e3ce4;if(_0x130df7[_0x5068('0x46')][_0x5068('0x55')]){_0x56f938[_0x5068('0x5b')]=[{'all':!![]}];}return db[_0x5068('0x6c')][_0x5068('0x57')](_0x56f938);})[_0x5068('0x23')](function(_0xb5e9cf){_0x3c8712[_0x5068('0x58')]=_0xb5e9cf;return _0x3c8712;});}})[_0x5068('0x23')](respondWithFilteredResult(_0x21ec5b,_0x56f938))[_0x5068('0x2d')](handleError(_0x21ec5b,null));};exports['removeDispositions']=function(_0x4ec219,_0x525196,_0x421906){return db[_0x5068('0x56')][_0x5068('0x5c')]({'where':{'id':_0x4ec219[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x525196,null))[_0x5068('0x23')](function(_0xc94dc5){if(_0xc94dc5){return _0xc94dc5[_0x5068('0x6d')](_0x4ec219[_0x5068('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x525196,null))[_0x5068('0x2d')](handleError(_0x525196,null));};exports[_0x5068('0x6e')]=function(_0x2714bb,_0x55f188,_0x17f90c){if(_0x2714bb['body']['id']){delete _0x2714bb[_0x5068('0x5e')]['id'];}return db[_0x5068('0x56')]['find']({'where':{'id':_0x2714bb[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x55f188,null))[_0x5068('0x23')](function(_0x1c03a8){if(_0x1c03a8){_0x2714bb[_0x5068('0x5e')][_0x5068('0x67')]=_0x1c03a8['id'];return db[_0x5068('0x6f')][_0x5068('0x5d')](_0x2714bb[_0x5068('0x5e')]);}})[_0x5068('0x23')](respondWithResult(_0x55f188,null))[_0x5068('0x2d')](handleError(_0x55f188,null));};exports[_0x5068('0x70')]=function(_0x2b8765,_0x7ca1e4,_0x23abcd){var _0x37f34c={'raw':![],'where':{}};var _0xf301d2={};var _0x3a58a1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5068('0x68')]({'where':{'id':_0x2b8765[_0x5068('0x5a')]['id']}})['then'](handleEntityNotFound(_0x7ca1e4,null))[_0x5068('0x23')](function(_0x17a902){if(_0x17a902){_0xf301d2[_0x5068('0x45')]=_['keys'](db[_0x5068('0x6f')][_0x5068('0x43')]);_0xf301d2[_0x5068('0x46')]=_[_0x5068('0x47')](_0x2b8765[_0x5068('0x46')]);_0xf301d2['filters']=_[_0x5068('0x49')](_0xf301d2[_0x5068('0x45')],_0xf301d2['query']);_0x37f34c[_0x5068('0x4a')]=_[_0x5068('0x49')](_0xf301d2['model'],qs[_0x5068('0x4b')](_0x2b8765['query'][_0x5068('0x4b')]));_0x37f34c[_0x5068('0x4a')]=_0x37f34c[_0x5068('0x4a')][_0x5068('0x69')]?_0x37f34c[_0x5068('0x4a')]:_0xf301d2[_0x5068('0x45')];if(!_0x2b8765[_0x5068('0x46')][_0x5068('0x4c')](_0x5068('0x6a'))){_0x37f34c[_0x5068('0x33')]=qs[_0x5068('0x33')](_0x2b8765[_0x5068('0x46')][_0x5068('0x33')]);_0x37f34c[_0x5068('0x35')]=qs['offset'](_0x2b8765[_0x5068('0x46')][_0x5068('0x35')]);}_0x37f34c['order']=qs[_0x5068('0x4d')](_0x2b8765[_0x5068('0x46')]['sort']);_0x37f34c[_0x5068('0x4e')]=qs[_0x5068('0x48')](_[_0x5068('0x4f')](_0x2b8765[_0x5068('0x46')],_0xf301d2[_0x5068('0x48')]));_0x37f34c['where'][_0x5068('0x67')]=_0x17a902['id'];if(_0x2b8765[_0x5068('0x46')][_0x5068('0x50')]){_0x37f34c['where']=_['merge'](_0x37f34c['where'],{'$or':_['map'](_0x37f34c[_0x5068('0x4a')],function(_0x509b51){var _0x57d4eb={};_0x57d4eb[_0x509b51]={'$like':'%'+_0x2b8765[_0x5068('0x46')][_0x5068('0x50')]+'%'};return _0x57d4eb;})});}_0x37f34c=_[_0x5068('0x51')]({},_0x37f34c,_0x2b8765[_0x5068('0x54')]);return db[_0x5068('0x6f')][_0x5068('0x34')]({'where':_0x37f34c[_0x5068('0x4e')]})[_0x5068('0x23')](function(_0x1ae1ec){_0x3a58a1[_0x5068('0x34')]=_0x1ae1ec;if(_0x2b8765[_0x5068('0x46')][_0x5068('0x55')]){_0x37f34c[_0x5068('0x5b')]=[{'all':!![]}];}return db[_0x5068('0x6f')]['findAll'](_0x37f34c);})[_0x5068('0x23')](function(_0x583aa5){_0x3a58a1[_0x5068('0x58')]=_0x583aa5;return _0x3a58a1;});}})[_0x5068('0x23')](respondWithFilteredResult(_0x7ca1e4,_0x37f34c))[_0x5068('0x2d')](handleError(_0x7ca1e4,null));};exports['removeAnswers']=function(_0x4a551f,_0x2a589b,_0x576b56){return db[_0x5068('0x56')][_0x5068('0x5c')]({'where':{'id':_0x4a551f[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x2a589b,null))[_0x5068('0x23')](function(_0x59514d){if(_0x59514d){return _0x59514d[_0x5068('0x71')](_0x4a551f['query']['ids']);}})[_0x5068('0x23')](respondWithStatusCode(_0x2a589b,null))['catch'](handleError(_0x2a589b,null));};exports[_0x5068('0x72')]=function(_0x37dd27,_0x51b205,_0x55a863){return db['WhatsappAccount'][_0x5068('0x5c')]({'where':{'id':_0x37dd27['params']['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x51b205,null))['then'](function(_0x1c04ca){if(_0x1c04ca){return _0x1c04ca[_0x5068('0x72')](_0x37dd27[_0x5068('0x5e')]['ids'],_['omit'](_0x37dd27[_0x5068('0x5e')],[_0x5068('0x73'),'id'])||{})[_0x5068('0x74')](function(_0x42adeb){for(var _0x7a1843=0x0;_0x7a1843<_0x37dd27['body'][_0x5068('0x73')][_0x5068('0x69')];_0x7a1843+=0x1){socket[_0x5068('0x75')](_0x5068('0x76'),{'UserId':Number(_0x37dd27[_0x5068('0x5e')][_0x5068('0x73')][_0x7a1843]),'WhatsappAccountId':Number(_0x37dd27[_0x5068('0x5a')]['id'])});}return _0x42adeb;});}})[_0x5068('0x23')](respondWithResult(_0x51b205,null))[_0x5068('0x2d')](handleError(_0x51b205,null));};exports[_0x5068('0x77')]=function(_0x252f97,_0x480ea9,_0x4f0f49){return db[_0x5068('0x56')]['find']({'where':{'id':_0x252f97[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x480ea9,null))[_0x5068('0x23')](function(_0x3a5993){if(_0x3a5993){return _0x3a5993['removeAgents'](_0x252f97[_0x5068('0x46')][_0x5068('0x73')])['then'](function(){if(_[_0x5068('0x78')](_0x252f97[_0x5068('0x46')][_0x5068('0x73')])){for(var _0x5e7124=0x0;_0x5e7124<_0x252f97[_0x5068('0x46')][_0x5068('0x73')][_0x5068('0x69')];_0x5e7124+=0x1){socket[_0x5068('0x75')](_0x5068('0x79'),{'UserId':Number(_0x252f97['query'][_0x5068('0x73')][_0x5e7124]),'WhatsappAccountId':Number(_0x252f97[_0x5068('0x5a')]['id'])});}}else{socket[_0x5068('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x252f97['query'][_0x5068('0x73')]),'WhatsappAccountId':Number(_0x252f97['params']['id'])});}});}})[_0x5068('0x23')](respondWithStatusCode(_0x480ea9,null))[_0x5068('0x2d')](handleError(_0x480ea9,null));};exports['getAgents']=function(_0x47d187,_0x2fb733,_0x4f1b87){var _0x3aa2a9={};var _0x2211eb={};var _0x3f1693;var _0x55628f;return db[_0x5068('0x56')][_0x5068('0x68')]({'where':{'id':_0x47d187[_0x5068('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2fb733,null))[_0x5068('0x23')](function(_0x1f2dd2){if(_0x1f2dd2){_0x3f1693=_0x1f2dd2;_0x2211eb[_0x5068('0x45')]=_['keys'](db['User'][_0x5068('0x43')]);_0x2211eb[_0x5068('0x46')]=_[_0x5068('0x47')](_0x47d187['query']);_0x2211eb['filters']=_[_0x5068('0x49')](_0x2211eb[_0x5068('0x45')],_0x2211eb['query']);_0x3aa2a9['attributes']=_[_0x5068('0x49')](_0x2211eb['model'],qs['fields'](_0x47d187[_0x5068('0x46')]['fields']));_0x3aa2a9['attributes']=_0x3aa2a9[_0x5068('0x4a')][_0x5068('0x69')]?_0x3aa2a9['attributes']:_0x2211eb[_0x5068('0x45')];_0x3aa2a9[_0x5068('0x6b')]=qs[_0x5068('0x4d')](_0x47d187[_0x5068('0x46')][_0x5068('0x4d')]);_0x3aa2a9[_0x5068('0x4e')]=qs['filters'](_['pick'](_0x47d187[_0x5068('0x46')],_0x2211eb[_0x5068('0x48')]));if(_0x47d187[_0x5068('0x46')]['filter']){_0x3aa2a9[_0x5068('0x4e')]=_['merge'](_0x3aa2a9['where'],{'$or':_[_0x5068('0x42')](_0x3aa2a9[_0x5068('0x4a')],function(_0x18ded9){var _0x3eff5b={};_0x3eff5b[_0x18ded9]={'$like':'%'+_0x47d187['query'][_0x5068('0x50')]+'%'};return _0x3eff5b;})});}_0x3aa2a9=_[_0x5068('0x51')]({},_0x3aa2a9,_0x47d187[_0x5068('0x54')]);return _0x3f1693[_0x5068('0x7a')](_0x3aa2a9);}})[_0x5068('0x23')](function(_0x49b9cd){if(_0x49b9cd){_0x55628f=_0x49b9cd[_0x5068('0x69')];if(!_0x47d187[_0x5068('0x46')][_0x5068('0x4c')](_0x5068('0x6a'))){_0x3aa2a9[_0x5068('0x33')]=qs[_0x5068('0x33')](_0x47d187[_0x5068('0x46')]['limit']);_0x3aa2a9['offset']=qs[_0x5068('0x35')](_0x47d187[_0x5068('0x46')][_0x5068('0x35')]);}return _0x3f1693[_0x5068('0x7a')](_0x3aa2a9);}})[_0x5068('0x23')](function(_0x2aabb2){if(_0x2aabb2){return _0x2aabb2?{'count':_0x55628f,'rows':_0x2aabb2}:null;}})[_0x5068('0x23')](respondWithResult(_0x2fb733,null))[_0x5068('0x2d')](handleError(_0x2fb733,null));};exports[_0x5068('0x7b')]=function(_0x3a4f0d,_0x2791b0,_0x3d27f2){return db[_0x5068('0x56')][_0x5068('0x68')]({'where':{'id':_0x3a4f0d[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x2791b0,null))[_0x5068('0x23')](function(_0xdee177){if(_0xdee177){return db[_0x5068('0x7c')][_0x5068('0x7d')](function(_0x3419fb){return db['WhatsappApplication'][_0x5068('0x3b')]({'where':{'WhatsappAccountId':_0x3a4f0d[_0x5068('0x5a')]['id']},'transaction':_0x3419fb})[_0x5068('0x23')](function(_0x214498){var _0x247728=_['map'](_0x3a4f0d['body'],function(_0x4efe80){_0x4efe80['WhatsappAccountId']=_0x3a4f0d[_0x5068('0x5a')]['id'];return _0x4efe80;});return db[_0x5068('0x7e')]['bulkCreate'](_0x247728,{'transaction':_0x3419fb});});})[_0x5068('0x23')](function(){return db[_0x5068('0x7e')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x3a4f0d['params']['id']},'order':_0x5068('0x7f')});});}})[_0x5068('0x23')](respondWithResult(_0x2791b0,null))[_0x5068('0x2d')](handleError(_0x2791b0,null));};exports['getApplications']=function(_0x181ed7,_0x3d0f54,_0x4a7c72){var _0x1c7734={};var _0x57aac1={};var _0x1ca6c6;var _0x5c34de;return db[_0x5068('0x56')][_0x5068('0x68')]({'where':{'id':_0x181ed7[_0x5068('0x5a')]['id']}})[_0x5068('0x23')](handleEntityNotFound(_0x3d0f54,null))['then'](function(_0x1770cf){if(_0x1770cf){_0x1ca6c6=_0x1770cf;_0x57aac1[_0x5068('0x45')]=_['keys'](db[_0x5068('0x7e')][_0x5068('0x43')]);_0x57aac1['query']=_['keys'](_0x181ed7['query']);_0x57aac1[_0x5068('0x48')]=_[_0x5068('0x49')](_0x57aac1['model'],_0x57aac1[_0x5068('0x46')]);_0x1c7734[_0x5068('0x4a')]=_[_0x5068('0x49')](_0x57aac1[_0x5068('0x45')],qs[_0x5068('0x4b')](_0x181ed7[_0x5068('0x46')]['fields']));_0x1c7734[_0x5068('0x4a')]=_0x1c7734[_0x5068('0x4a')][_0x5068('0x69')]?_0x1c7734[_0x5068('0x4a')]:_0x57aac1[_0x5068('0x45')];_0x1c7734[_0x5068('0x6b')]=qs[_0x5068('0x4d')](_0x181ed7['query'][_0x5068('0x4d')]);_0x1c7734[_0x5068('0x4e')]=qs[_0x5068('0x48')](_['pick'](_0x181ed7[_0x5068('0x46')],_0x57aac1[_0x5068('0x48')]));if(_0x181ed7[_0x5068('0x46')][_0x5068('0x50')]){_0x1c7734[_0x5068('0x4e')]=_[_0x5068('0x51')](_0x1c7734[_0x5068('0x4e')],{'$or':_[_0x5068('0x42')](_0x1c7734[_0x5068('0x4a')],function(_0x3beee3){var _0x576855={};_0x576855[_0x3beee3]={'$like':'%'+_0x181ed7[_0x5068('0x46')][_0x5068('0x50')]+'%'};return _0x576855;})});}_0x1c7734=_['merge']({},_0x1c7734,_0x181ed7[_0x5068('0x54')]);return _0x1ca6c6[_0x5068('0x80')](_0x1c7734);}})[_0x5068('0x23')](function(_0x2d8070){if(_0x2d8070){_0x5c34de=_0x2d8070[_0x5068('0x69')];if(!_0x181ed7['query'][_0x5068('0x4c')]('nolimit')){_0x1c7734[_0x5068('0x33')]=qs['limit'](_0x181ed7[_0x5068('0x46')][_0x5068('0x33')]);_0x1c7734[_0x5068('0x35')]=qs[_0x5068('0x35')](_0x181ed7[_0x5068('0x46')][_0x5068('0x35')]);}return _0x1ca6c6['getApplications'](_0x1c7734);}})['then'](function(_0x5f2e8f){if(_0x5f2e8f){return _0x5f2e8f?{'count':_0x5c34de,'rows':_0x5f2e8f}:null;}})[_0x5068('0x23')](respondWithResult(_0x3d0f54,null))[_0x5068('0x2d')](handleError(_0x3d0f54,null));};exports['notify']=function(_0x24b28c,_0x4a2703,_0x49b961){var _0x1531c5={'channel':_0x5068('0x81')};var _0x2efeb8=[];var _0x24c088=[];var _0x5b08c3={};return db[_0x5068('0x56')][_0x5068('0x5c')]({'where':{'id':_0x24b28c[_0x5068('0x5a')]['id']},'include':[{'model':db[_0x5068('0x7e')],'as':_0x5068('0x82')}]})['then'](handleEntityNotFound(_0x4a2703,null))[_0x5068('0x23')](function(_0x4aedb5){_0x1531c5[_0x5068('0x83')]=_0x4aedb5;_0x1531c5[_0x5068('0x84')]=_[_0x5068('0x85')](_0x4aedb5[_0x5068('0x82')],[_0x5068('0x7f')],['asc']);if(_0x1531c5[_0x5068('0x83')][_0x5068('0x82')]){delete _0x1531c5[_0x5068('0x83')][_0x5068('0x82')];}return db['CmContact'][_0x5068('0x65')]();})[_0x5068('0x23')](function(_0x4c7f9c){if(!_0x4c7f9c){throw new db['Sequelize'][(_0x5068('0x86'))](_0x5068('0x87'));}_0x2efeb8=_[_0x5068('0x88')](_[_0x5068('0x47')](_0x4c7f9c),[_0x5068('0x89'),_0x5068('0x8a')]);_0x24c088=_[_0x5068('0x88')](_[_0x5068('0x47')](_0x4c7f9c),[_0x5068('0x89'),'updatedAt',_0x5068('0x8b'),_0x5068('0x8c')]);_0x1531c5[_0x5068('0x5e')]={'mapKey':_0x5068('0x8d')};if(_0x1531c5[_0x5068('0x83')][_0x5068('0x52')]&&_0x1531c5[_0x5068('0x83')][_0x5068('0x52')]===_0x5068('0x8e')){_0x1531c5[_0x5068('0x5e')][_0x5068('0x8f')]=_0x24b28c[_0x5068('0x5e')][_0x5068('0x90')][_0x5068('0x91')](_0x5068('0x92'),'');_0x1531c5[_0x5068('0x5e')][_0x5068('0x5e')]=_0x24b28c['body']['Body'];_0x1531c5[_0x5068('0x5e')][_0x5068('0x93')]=_0x24b28c[_0x5068('0x5e')][_0x5068('0x94')];}if(_0x1531c5[_0x5068('0x5e')]['id']){delete _0x1531c5[_0x5068('0x5e')]['id'];}if(_[_0x5068('0x95')](_0x1531c5[_0x5068('0x5e')][_0x5068('0x8f')])){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0x97'));}if(_['isNil'](_0x1531c5[_0x5068('0x5e')][_0x5068('0x5e')])||_0x1531c5[_0x5068('0x5e')][_0x5068('0x5e')]===''){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0x98'));}if(_[_0x5068('0x95')](_0x1531c5[_0x5068('0x5e')]['mapKey'])){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0x99')+_0x24c088);}if(!_[_0x5068('0x9a')](_0x24c088,_0x1531c5[_0x5068('0x5e')]['mapKey'])){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0x9b')+_0x24c088);}_0x5b08c3[_0x1531c5[_0x5068('0x5e')][_0x5068('0x9c')]]=_0x1531c5[_0x5068('0x5e')][_0x5068('0x8f')];return db['CmList'][_0x5068('0x5c')]({'where':{'id':_0x1531c5[_0x5068('0x83')][_0x5068('0x8c')]},'include':[{'model':db[_0x5068('0x9d')],'as':_0x5068('0x9e'),'where':_0x5b08c3,'limit':0x1,'order':[[_0x5068('0x8a'),_0x5068('0x9f')]]}]});})[_0x5068('0x23')](handleEntityNotFound(_0x4a2703,null))[_0x5068('0x23')](function(_0x178a24){if(_0x178a24){_0x1531c5['list']=_[_0x5068('0xa0')](_0x178a24,[_0x5068('0x9e')]);if(_0x178a24[_0x5068('0x9e')][_0x5068('0x69')]){return _0x178a24['Contacts'][0x0];}var _0x1a274d=_['defaults'](_0x1531c5['body'],{'firstName':_0x1531c5[_0x5068('0x5e')][_0x5068('0x8f')],'ListId':_0x178a24['id']});_0x1a274d[_0x1531c5[_0x5068('0x5e')][_0x5068('0x9c')]]=_0x1531c5['body']['from'];return db['CmContact'][_0x5068('0x5d')](_0x1a274d,{'fields':_0x2efeb8,'raw':!![]});}})[_0x5068('0x23')](handleEntityNotFound(_0x4a2703,null))['then'](function(_0x329d66){if(_0x329d66){_0x1531c5[_0x5068('0xa1')]=_0x329d66;var _0x3d1471={'ContactId':_0x329d66['id'],'phone':_0x1531c5['body'][_0x5068('0x8f')],'WhatsappAccountId':_0x24b28c[_0x5068('0x5a')]['id']};var _0x27b584={'ContactId':_0x329d66['id'],'WhatsappAccountId':_0x24b28c[_0x5068('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x5068('0x5c')]({'where':_0x27b584})['then'](function(_0x88bd60){if(_0x88bd60){return[_0x88bd60,![]];}return db[_0x5068('0xa2')]['create'](_0x3d1471)[_0x5068('0x23')](function(_0x4f037a){return[_0x4f037a,!![]];});});}})[_0x5068('0x74')](function(_0x19e912,_0x17b632){_0x1531c5[_0x5068('0xa3')]=_0x19e912[_0x5068('0x3c')]({'plain':!![]});_0x1531c5[_0x5068('0xa3')]['created']=![];if(_0x17b632){if(_0x1531c5[_0x5068('0x83')][_0x5068('0xa4')]){_0x1531c5[_0x5068('0x84')][_0x5068('0xa5')]({'id':0x0,'priority':_0x1531c5['applications'][_0x5068('0x69')]+0x1,'app':_0x5068('0xa6'),'appdata':_0x5068('0xa7'),'interval':_0x5068('0xa8')});}_0x1531c5[_0x5068('0xa3')][_0x5068('0xa9')]=!![];}return db[_0x5068('0xaa')][_0x5068('0x5d')]({'phone':_0x1531c5[_0x5068('0x5e')][_0x5068('0x8f')],'messageId':_0x1531c5[_0x5068('0x5e')][_0x5068('0x93')],'body':_0x1531c5[_0x5068('0x5e')][_0x5068('0x5e')],'WhatsappAccountId':_0x24b28c[_0x5068('0x5a')]['id'],'WhatsappInteractionId':_0x19e912['id'],'direction':'in','ContactId':_0x19e912[_0x5068('0xab')],'AttachmentId':_0x1531c5[_0x5068('0x5e')]['AttachmentId']});})[_0x5068('0x23')](function(_0x886b29){_0x1531c5['message']=_0x886b29;if(_0x1531c5[_0x5068('0xa3')][_0x5068('0xac')]){return db[_0x5068('0xad')]['find']({'attributes':['id',_0x5068('0x3f')],'where':{'id':_0x1531c5[_0x5068('0xa3')]['UserId']}})[_0x5068('0x23')](function(_0x21da51){if(_0x21da51){_0x1531c5[_0x5068('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5068('0xae'),'appdata':_0x21da51['name']+','+(_0x1531c5[_0x5068('0x83')][_0x5068('0xaf')]||0xa),'interval':_0x5068('0xa8')});}return respondWithRpcPromise(_0x5068('0xb0'),_0x5068('0xb1'),_0x1531c5);});}return respondWithRpcPromise(_0x5068('0xb0'),_0x5068('0xb1'),_0x1531c5);})['then'](function(_0x24099f){if(_0x24099f){var _0x50beba=0xc8;var _0x4cb6ab=_0x5068('0xb2');logger[_0x5068('0x24')](_0x5068('0xb3'),_0x4cb6ab,_0x50beba,_0x5068('0xb4'));logger[_0x5068('0x26')](_0x5068('0xb5'),_0x4cb6ab,_0x50beba,'entity\x20found',JSON[_0x5068('0x27')](_0x24099f));if(_0x1531c5[_0x5068('0x83')][_0x5068('0x52')]===_0x5068('0x8e')){return _0x4a2703[_0x5068('0x2f')](_0x50beba)[_0x5068('0x36')](_0x5068('0xb6'),_0x5068('0xb7'))[_0x5068('0xb8')](_0x5068('0xb9'));}else{return _0x4a2703[_0x5068('0x2f')](_0x50beba)[_0x5068('0x31')](_0x24099f);}}})[_0x5068('0x2d')](handleError(_0x4a2703,null));};exports['send']=function(_0x10b571,_0x5581d8,_0x2afe7d){var _0x4fe97a,_0x157e7b,_0x49704d;if(_[_0x5068('0x95')](_0x10b571[_0x5068('0x5e')][_0x5068('0x5e')])||_0x10b571['body'][_0x5068('0x5e')]===''){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0x98'));}if(_[_0x5068('0x95')](_0x10b571[_0x5068('0x5e')]['to'])){throw new db[(_0x5068('0x96'))][(_0x5068('0x86'))](_0x5068('0xba'));}_0x4fe97a=_0x10b571[_0x5068('0x5e')]['to'];return db[_0x5068('0x56')]['find']({'where':{'id':_0x10b571[_0x5068('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x5068('0x9d')],'as':_0x5068('0x9e'),'where':{'mobile':_0x4fe97a},'limit':0x1,'order':[[_0x5068('0x8a'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5581d8,null))[_0x5068('0x23')](function(_0x54ad2c){if(_0x54ad2c&&_0x54ad2c[_0x5068('0xbb')]){_0x157e7b=_0x54ad2c[_0x5068('0x3c')]({'plain':!![]});if(_0x157e7b['List']&&_0x157e7b['List'][_0x5068('0x9e')][_0x5068('0x69')]){return _0x157e7b[_0x5068('0xbb')][_0x5068('0x9e')][0x0];}return db['CmContact']['create'](_[_0x5068('0x1c')](_0x10b571['body'],{'firstName':_0x4fe97a,'mobile':_0x4fe97a,'phone':_0x4fe97a,'ListId':_0x157e7b['ListId']}));}})[_0x5068('0x23')](handleEntityNotFound(_0x5581d8,null))[_0x5068('0x23')](function(_0xa974cf){if(_0xa974cf){_0x49704d=_0xa974cf;return db[_0x5068('0xa2')][_0x5068('0x5c')]({'where':{'ContactId':_0x49704d['id'],'closed':![],'WhatsappAccountId':_0x157e7b['id']}})['then'](function(_0x286d8a){if(_0x286d8a){return[_0x286d8a,![]];}return db['WhatsappInteraction'][_0x5068('0x5d')]({'UserId':_0x10b571[_0x5068('0x60')]['id'],'ContactId':_0x49704d['id'],'WhatsappAccountId':_0x157e7b['id'],'phone':_0x4fe97a,'firstMsgDirection':_0x5068('0xbc'),'Messages':[_[_0x5068('0x51')](_0x10b571[_0x5068('0x5e')],{'read':![],'body':_0x10b571[_0x5068('0x5e')][_0x5068('0x5e')],'phone':_0x4fe97a,'WhatsappAccountId':_0x157e7b['id'],'UserId':_0x10b571['user']['id'],'ContactId':_0x49704d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x5068('0xbd')}]})[_0x5068('0x23')](function(_0xfb08b3){return[_0xfb08b3,!![]];});});}})[_0x5068('0x74')](function(_0x3eba2c,_0x26add9){if(_0x26add9){return _0x3eba2c;}return db[_0x5068('0xaa')][_0x5068('0x5d')](_[_0x5068('0x51')](_0x10b571[_0x5068('0x5e')],{'read':![],'body':_0x10b571[_0x5068('0x5e')][_0x5068('0x5e')],'phone':_0x4fe97a,'WhatsappAccountId':_0x157e7b['id'],'WhatsappInteractionId':_0x3eba2c['id'],'UserId':_0x10b571[_0x5068('0x60')]['id'],'ContactId':_0x49704d['id']}))[_0x5068('0x23')](function(_0x48e69b){_0x3eba2c[_0x5068('0xbe')][_0x5068('0xbd')]=[];_0x3eba2c[_0x5068('0xbe')][_0x5068('0xbd')][_0x5068('0xa5')](_0x48e69b[_0x5068('0xbe')]);return _0x3eba2c;});})['then'](respondWithResult(_0x5581d8,null))['catch'](handleError(_0x5581d8,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 5d8db3a..ebf48bb 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 _0x8a85=['exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2ee9cb,_0x347ce1){var _0x195f0d=function(_0x12628e){while(--_0x12628e){_0x2ee9cb['push'](_0x2ee9cb['shift']());}};_0x195f0d(++_0x347ce1);}(_0x8a85,0x1a8));var _0x58a8=function(_0x49106d,_0x44e2d1){_0x49106d=_0x49106d-0x0;var _0x80b783=_0x8a85[_0x49106d];return _0x80b783;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x58a8('0x0'))['db'][_0x58a8('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x58a8('0x2')](0x0);var events={'afterCreate':_0x58a8('0x3'),'afterUpdate':_0x58a8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1430c2){return function(_0x506e43,_0xbe9abd,_0x24c6ce){WhatsappAccountEvents[_0x58a8('0x5')](_0x1430c2+':'+_0x506e43['id'],_0x506e43);WhatsappAccountEvents[_0x58a8('0x5')](_0x1430c2,_0x506e43);_0x24c6ce(null);};}for(var e in events){if(events[_0x58a8('0x6')](e)){var event=events[e];WhatsappAccount[_0x58a8('0x7')](e,emitEvent(event));}}module[_0x58a8('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x55f8=['events','save','remove','emit','hasOwnProperty','exports'];(function(_0x3b7ab2,_0x5b30fc){var _0x14d2b0=function(_0x13df9f){while(--_0x13df9f){_0x3b7ab2['push'](_0x3b7ab2['shift']());}};_0x14d2b0(++_0x5b30fc);}(_0x55f8,0xcc));var _0x855f=function(_0x51faf9,_0x37e501){_0x51faf9=_0x51faf9-0x0;var _0x3ee3b1=_0x55f8[_0x51faf9];return _0x3ee3b1;};'use strict';var EventEmitter=require(_0x855f('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x855f('0x1'),'afterUpdate':'update','afterDestroy':_0x855f('0x2')};function emitEvent(_0x3fd907){return function(_0x60423e,_0x256ca4,_0x1c7ee9){WhatsappAccountEvents[_0x855f('0x3')](_0x3fd907+':'+_0x60423e['id'],_0x60423e);WhatsappAccountEvents[_0x855f('0x3')](_0x3fd907,_0x60423e);_0x1c7ee9(null);};}for(var e in events){if(events[_0x855f('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x855f('0x5')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 01acc6a..16fe02e 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 _0xc661=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x5a1fb4,_0x421542){var _0x2b9e28=function(_0x111331){while(--_0x111331){_0x5a1fb4['push'](_0x5a1fb4['shift']());}};_0x2b9e28(++_0x421542);}(_0xc661,0x1a7));var _0x1c66=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xc661[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x1c66('0x0'));var util=require(_0x1c66('0x1'));var logger=require(_0x1c66('0x2'))(_0x1c66('0x3'));var moment=require(_0x1c66('0x4'));var BPromise=require(_0x1c66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c66('0x6'));var rimraf=require(_0x1c66('0x7'));var config=require(_0x1c66('0x8'));var attributes=require(_0x1c66('0x9'));module[_0x1c66('0xa')]=function(_0x3eaa50,_0x1fb804){return _0x3eaa50[_0x1c66('0xb')](_0x1c66('0xc'),attributes,{'tableName':_0x1c66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d0f=['../../config/logger','api','path','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x4973d9,_0x3a824c){var _0x350282=function(_0x54a9fc){while(--_0x54a9fc){_0x4973d9['push'](_0x4973d9['shift']());}};_0x350282(++_0x3a824c);}(_0x6d0f,0x15c));var _0xf6d0=function(_0x5e651e,_0x3a63b9){_0x5e651e=_0x5e651e-0x0;var _0x49db9e=_0x6d0f[_0x5e651e];return _0x49db9e;};'use strict';var _=require(_0xf6d0('0x0'));var util=require(_0xf6d0('0x1'));var logger=require(_0xf6d0('0x2'))(_0xf6d0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6d0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6d0('0x5'));module[_0xf6d0('0x6')]=function(_0x3a58ec,_0x3516da){return _0x3a58ec[_0xf6d0('0x7')](_0xf6d0('0x8'),attributes,{'tableName':_0xf6d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 16eaa38..0f07527 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 _0x4e63=['options','raw','where','attributes','include','map','model','ShowWhatsappAccount','stringify','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','WhatsappAccount','find'];(function(_0x443902,_0x343be3){var _0xb95314=function(_0x1f7eb5){while(--_0x1f7eb5){_0x443902['push'](_0x443902['shift']());}};_0xb95314(++_0x343be3);}(_0x4e63,0x1ad));var _0x34e6=function(_0x25aca7,_0x449084){_0x25aca7=_0x25aca7-0x0;var _0x7589aa=_0x4e63[_0x25aca7];return _0x7589aa;};'use strict';var _=require('lodash');var util=require(_0x34e6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x34e6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34e6('0x2'));var logger=require(_0x34e6('0x3'))('rpc');var config=require(_0x34e6('0x4'));var jayson=require(_0x34e6('0x5'));var client=jayson[_0x34e6('0x6')][_0x34e6('0x7')]({'port':0x232a});config[_0x34e6('0x8')]=_['defaults'](config[_0x34e6('0x8')],{'host':_0x34e6('0x9'),'port':0x18eb});var socket=require(_0x34e6('0xa'))(new Redis(config['redis']));require(_0x34e6('0xb'))[_0x34e6('0xc')](socket);function respondWithRpcPromise(_0x5ef17a,_0x2ded99,_0x5f37aa){return new BPromise(function(_0x4763eb,_0x1e8376){return client[_0x34e6('0xd')](_0x5ef17a,_0x5f37aa)[_0x34e6('0xe')](function(_0x21a3b4){logger[_0x34e6('0xf')](_0x34e6('0x10'),_0x2ded99,_0x34e6('0x11'));logger[_0x34e6('0x12')](_0x34e6('0x13'),_0x2ded99,_0x34e6('0x11'),JSON['stringify'](_0x21a3b4));if(_0x21a3b4[_0x34e6('0x14')]){if(_0x21a3b4[_0x34e6('0x14')][_0x34e6('0x15')]===0x1f4){logger[_0x34e6('0x14')](_0x34e6('0x10'),_0x2ded99,_0x21a3b4[_0x34e6('0x14')][_0x34e6('0x16')]);return _0x1e8376(_0x21a3b4[_0x34e6('0x14')]['message']);}logger['error'](_0x34e6('0x10'),_0x2ded99,_0x21a3b4[_0x34e6('0x14')]['message']);return _0x4763eb(_0x21a3b4[_0x34e6('0x14')][_0x34e6('0x16')]);}else{logger[_0x34e6('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x2ded99,_0x34e6('0x11'));_0x4763eb(_0x21a3b4[_0x34e6('0x17')][_0x34e6('0x16')]);}})['catch'](function(_0x5a4bc7){logger['error'](_0x34e6('0x10'),_0x2ded99,_0x5a4bc7);_0x1e8376(_0x5a4bc7);});});}exports['ShowWhatsappAccount']=function(_0x31feae){var _0x53e1c6=this;return new Promise(function(_0x42a7b2,_0x451468){return db[_0x34e6('0x18')][_0x34e6('0x19')]({'raw':_0x31feae[_0x34e6('0x1a')]?_0x31feae[_0x34e6('0x1a')][_0x34e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x31feae[_0x34e6('0x1a')]?_0x31feae[_0x34e6('0x1a')][_0x34e6('0x1c')]||null:null,'attributes':_0x31feae[_0x34e6('0x1a')]?_0x31feae[_0x34e6('0x1a')][_0x34e6('0x1d')]||null:null,'include':_0x31feae[_0x34e6('0x1a')]?_0x31feae[_0x34e6('0x1a')][_0x34e6('0x1e')]?_[_0x34e6('0x1f')](_0x31feae['options'][_0x34e6('0x1e')],function(_0x3b2348){return{'model':db[_0x3b2348[_0x34e6('0x20')]],'as':_0x3b2348['as'],'attributes':_0x3b2348['attributes'],'include':_0x3b2348[_0x34e6('0x1e')]?_[_0x34e6('0x1f')](_0x3b2348[_0x34e6('0x1e')],function(_0x45691a){return{'model':db[_0x45691a[_0x34e6('0x20')]],'as':_0x45691a['as'],'attributes':_0x45691a[_0x34e6('0x1d')],'include':_0x45691a[_0x34e6('0x1e')]?_['map'](_0x45691a[_0x34e6('0x1e')],function(_0x8239a1){return{'model':db[_0x8239a1[_0x34e6('0x20')]],'as':_0x8239a1['as'],'attributes':_0x8239a1[_0x34e6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x34e6('0xe')](function(_0x2c5642){logger[_0x34e6('0xf')](_0x34e6('0x21'),_0x31feae);logger[_0x34e6('0x12')](_0x34e6('0x21'),_0x31feae,JSON[_0x34e6('0x22')](_0x2c5642));_0x42a7b2(_0x2c5642);})['catch'](function(_0x3eb9d7){logger[_0x34e6('0x14')](_0x34e6('0x21'),_0x3eb9d7[_0x34e6('0x16')],_0x31feae);_0x451468(_0x53e1c6['error'](0x1f4,_0x3eb9d7[_0x34e6('0x16')]));});});}; \ No newline at end of file +var _0x1175=['model','ShowWhatsappAccount','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','WhatsappAccount','find','options','where','attributes','include','map'];(function(_0xc299a5,_0x579d65){var _0x13d138=function(_0x18aa91){while(--_0x18aa91){_0xc299a5['push'](_0xc299a5['shift']());}};_0x13d138(++_0x579d65);}(_0x1175,0x134));var _0x5117=function(_0x700bae,_0x1c9b24){_0x700bae=_0x700bae-0x0;var _0x29e604=_0x1175[_0x700bae];return _0x29e604;};'use strict';var _=require(_0x5117('0x0'));var util=require(_0x5117('0x1'));var moment=require(_0x5117('0x2'));var BPromise=require(_0x5117('0x3'));var rs=require(_0x5117('0x4'));var fs=require('fs');var Redis=require(_0x5117('0x5'));var db=require(_0x5117('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5117('0x7'))('rpc');var config=require(_0x5117('0x8'));var jayson=require(_0x5117('0x9'));var client=jayson[_0x5117('0xa')][_0x5117('0xb')]({'port':0x232a});config[_0x5117('0xc')]=_[_0x5117('0xd')](config[_0x5117('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5117('0xe'))(new Redis(config[_0x5117('0xc')]));require(_0x5117('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c946a,_0x34f0b8,_0x27ca88){return new BPromise(function(_0x1834ca,_0x42512b){return client[_0x5117('0x10')](_0x3c946a,_0x27ca88)[_0x5117('0x11')](function(_0x5a4d48){logger[_0x5117('0x12')](_0x5117('0x13'),_0x34f0b8,_0x5117('0x14'));logger[_0x5117('0x15')](_0x5117('0x16'),_0x34f0b8,_0x5117('0x14'),JSON['stringify'](_0x5a4d48));if(_0x5a4d48[_0x5117('0x17')]){if(_0x5a4d48[_0x5117('0x17')][_0x5117('0x18')]===0x1f4){logger[_0x5117('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x34f0b8,_0x5a4d48['error'][_0x5117('0x19')]);return _0x42512b(_0x5a4d48[_0x5117('0x17')][_0x5117('0x19')]);}logger[_0x5117('0x17')](_0x5117('0x13'),_0x34f0b8,_0x5a4d48[_0x5117('0x17')][_0x5117('0x19')]);return _0x1834ca(_0x5a4d48[_0x5117('0x17')][_0x5117('0x19')]);}else{logger[_0x5117('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x34f0b8,_0x5117('0x14'));_0x1834ca(_0x5a4d48[_0x5117('0x1a')][_0x5117('0x19')]);}})['catch'](function(_0x44c45c){logger[_0x5117('0x17')](_0x5117('0x13'),_0x34f0b8,_0x44c45c);_0x42512b(_0x44c45c);});});}exports['ShowWhatsappAccount']=function(_0x2682df){var _0x57e9c4=this;return new Promise(function(_0x437564,_0x48076f){return db[_0x5117('0x1b')][_0x5117('0x1c')]({'raw':_0x2682df[_0x5117('0x1d')]?_0x2682df['options']['raw']===undefined?!![]:![]:!![],'where':_0x2682df[_0x5117('0x1d')]?_0x2682df[_0x5117('0x1d')][_0x5117('0x1e')]||null:null,'attributes':_0x2682df['options']?_0x2682df['options'][_0x5117('0x1f')]||null:null,'include':_0x2682df[_0x5117('0x1d')]?_0x2682df[_0x5117('0x1d')][_0x5117('0x20')]?_[_0x5117('0x21')](_0x2682df[_0x5117('0x1d')][_0x5117('0x20')],function(_0x4684b1){return{'model':db[_0x4684b1[_0x5117('0x22')]],'as':_0x4684b1['as'],'attributes':_0x4684b1['attributes'],'include':_0x4684b1[_0x5117('0x20')]?_[_0x5117('0x21')](_0x4684b1[_0x5117('0x20')],function(_0x5cb73a){return{'model':db[_0x5cb73a['model']],'as':_0x5cb73a['as'],'attributes':_0x5cb73a[_0x5117('0x1f')],'include':_0x5cb73a['include']?_[_0x5117('0x21')](_0x5cb73a[_0x5117('0x20')],function(_0x5f0c6c){return{'model':db[_0x5f0c6c['model']],'as':_0x5f0c6c['as'],'attributes':_0x5f0c6c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5117('0x11')](function(_0xbb8ca3){logger[_0x5117('0x12')](_0x5117('0x23'),_0x2682df);logger[_0x5117('0x15')](_0x5117('0x23'),_0x2682df,JSON[_0x5117('0x24')](_0xbb8ca3));_0x437564(_0xbb8ca3);})[_0x5117('0x25')](function(_0x5118a7){logger[_0x5117('0x17')](_0x5117('0x23'),_0x5118a7[_0x5117('0x19')],_0x2682df);_0x48076f(_0x57e9c4[_0x5117('0x17')](0x1f4,_0x5118a7[_0x5117('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d2f9e84..cd937d2 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 _0x6483=['removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove','emit'];(function(_0x197d48,_0x3679d8){var _0x4cdcce=function(_0x28ab3a){while(--_0x28ab3a){_0x197d48['push'](_0x197d48['shift']());}};_0x4cdcce(++_0x3679d8);}(_0x6483,0x161));var _0x3648=function(_0x5a14e6,_0x315b97){_0x5a14e6=_0x5a14e6-0x0;var _0x5a7462=_0x6483[_0x5a14e6];return _0x5a7462;};'use strict';var WhatsappAccountEvents=require(_0x3648('0x0'));var events=[_0x3648('0x1'),_0x3648('0x2'),'update'];function createListener(_0x22f93b,_0x144900){return function(_0x466839){_0x144900[_0x3648('0x3')](_0x22f93b,_0x466839);};}function removeListener(_0x5a00a9,_0x4fe310){return function(){WhatsappAccountEvents[_0x3648('0x4')](_0x5a00a9,_0x4fe310);};}exports[_0x3648('0x5')]=function(_0x38e110){for(var _0x22c587=0x0,_0x176593=events['length'];_0x22c587<_0x176593;_0x22c587++){var _0x4c251d=events[_0x22c587];var _0x56ec0d=createListener(_0x3648('0x6')+_0x4c251d,_0x38e110);WhatsappAccountEvents['on'](_0x4c251d,_0x56ec0d);}}; \ No newline at end of file +var _0x3835=['register','whatsappAccount:','./whatsappAccount.events','remove','update','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3835,0x86));var _0x5383=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0x3835[_0x1b8b95];return _0x3657ae;};'use strict';var WhatsappAccountEvents=require(_0x5383('0x0'));var events=['save',_0x5383('0x1'),_0x5383('0x2')];function createListener(_0x5b4792,_0x427d42){return function(_0xe501c){_0x427d42[_0x5383('0x3')](_0x5b4792,_0xe501c);};}function removeListener(_0x27b949,_0x4f8903){return function(){WhatsappAccountEvents['removeListener'](_0x27b949,_0x4f8903);};}exports[_0x5383('0x4')]=function(_0x1bf4dd){for(var _0x51b48c=0x0,_0x344ba1=events['length'];_0x51b48c<_0x344ba1;_0x51b48c++){var _0x221e69=events[_0x51b48c];var _0x4105b8=createListener(_0x5383('0x5')+_0x221e69,_0x1bf4dd);WhatsappAccountEvents['on'](_0x221e69,_0x4105b8);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index a48177e..ddb76fb 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 _0x5318=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','show','post','create','put','update','isAuthenticated','destroy','exports'];(function(_0x1fce5f,_0x4717ba){var _0x25c0de=function(_0x2e5828){while(--_0x2e5828){_0x1fce5f['push'](_0x1fce5f['shift']());}};_0x25c0de(++_0x4717ba);}(_0x5318,0xc8));var _0x8531=function(_0x488b4d,_0x233540){_0x488b4d=_0x488b4d-0x0;var _0x51ee8f=_0x5318[_0x488b4d];return _0x51ee8f;};'use strict';var multer=require(_0x8531('0x0'));var util=require(_0x8531('0x1'));var path=require(_0x8531('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8531('0x3')]();var fs_extra=require(_0x8531('0x4'));var auth=require(_0x8531('0x5'));var interaction=require(_0x8531('0x6'));var config=require(_0x8531('0x7'));var controller=require(_0x8531('0x8'));router[_0x8531('0x9')]('/',auth['isAuthenticated'](),controller[_0x8531('0xa')]);router[_0x8531('0x9')](_0x8531('0xb'),auth['isAuthenticated'](),controller[_0x8531('0xc')]);router[_0x8531('0xd')]('/',auth['isAuthenticated'](),controller[_0x8531('0xe')]);router[_0x8531('0xf')](_0x8531('0xb'),auth['isAuthenticated'](),controller[_0x8531('0x10')]);router['delete']('/:id',auth[_0x8531('0x11')](),controller[_0x8531('0x12')]);module[_0x8531('0x13')]=router; \ No newline at end of file +var _0x904a=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x44156e,_0x86d51){var _0x34453d=function(_0x5dc451){while(--_0x5dc451){_0x44156e['push'](_0x44156e['shift']());}};_0x34453d(++_0x86d51);}(_0x904a,0x1f0));var _0xa904=function(_0x153230,_0x1ae7df){_0x153230=_0x153230-0x0;var _0x574ccc=_0x904a[_0x153230];return _0x574ccc;};'use strict';var multer=require(_0xa904('0x0'));var util=require(_0xa904('0x1'));var path=require('path');var timeout=require(_0xa904('0x2'));var express=require(_0xa904('0x3'));var router=express[_0xa904('0x4')]();var fs_extra=require(_0xa904('0x5'));var auth=require(_0xa904('0x6'));var interaction=require(_0xa904('0x7'));var config=require(_0xa904('0x8'));var controller=require(_0xa904('0x9'));router['get']('/',auth[_0xa904('0xa')](),controller[_0xa904('0xb')]);router[_0xa904('0xc')](_0xa904('0xd'),auth[_0xa904('0xa')](),controller[_0xa904('0xe')]);router[_0xa904('0xf')]('/',auth[_0xa904('0xa')](),controller['create']);router[_0xa904('0x10')](_0xa904('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa904('0xa')](),controller[_0xa904('0x11')]);module[_0xa904('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index a341063..0c6d48a 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 _0x9483=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4dd641,_0x3c3970){var _0x297254=function(_0x5864a6){while(--_0x5864a6){_0x4dd641['push'](_0x4dd641['shift']());}};_0x297254(++_0x3c3970);}(_0x9483,0xc3));var _0x3948=function(_0x2a69c7,_0x156320){_0x2a69c7=_0x2a69c7-0x0;var _0x1c9cf6=_0x9483[_0x2a69c7];return _0x1c9cf6;};'use strict';var Sequelize=require(_0x3948('0x0'));module[_0x3948('0x1')]={'priority':{'type':Sequelize[_0x3948('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3948('0x3')],'allowNull':![],'defaultValue':_0x3948('0x4')},'appdata':{'type':Sequelize[_0x3948('0x5')]()},'description':{'type':Sequelize[_0x3948('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3948('0x6')}}; \ No newline at end of file +var _0xd2ad=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xd2ad,0x1b5));var _0xdd2a=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xd2ad[_0xa9eaa0];return _0x30897a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xdd2a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xdd2a('0x1')],'allowNull':![],'defaultValue':_0xdd2a('0x2')},'appdata':{'type':Sequelize[_0xdd2a('0x3')]()},'description':{'type':Sequelize[_0xdd2a('0x1')]},'interval':{'type':Sequelize[_0xdd2a('0x1')],'defaultValue':_0xdd2a('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 0fde510..3e8a5e4 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 _0xfaf2=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','update','then','destroy','error','stack','name','send','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','filters','attributes','intersection'];(function(_0x19f49f,_0x26b049){var _0x33e7c3=function(_0x170ba1){while(--_0x170ba1){_0x19f49f['push'](_0x19f49f['shift']());}};_0x33e7c3(++_0x26b049);}(_0xfaf2,0x169));var _0x2faf=function(_0x52f3de,_0x1fd41e){_0x52f3de=_0x52f3de-0x0;var _0x1de67b=_0xfaf2[_0x52f3de];return _0x1de67b;};'use strict';var emlformat=require(_0x2faf('0x0'));var rimraf=require(_0x2faf('0x1'));var zipdir=require(_0x2faf('0x2'));var jsonpatch=require(_0x2faf('0x3'));var rp=require(_0x2faf('0x4'));var moment=require('moment');var BPromise=require(_0x2faf('0x5'));var Mustache=require(_0x2faf('0x6'));var util=require(_0x2faf('0x7'));var path=require(_0x2faf('0x8'));var sox=require(_0x2faf('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2faf('0xa'));var squel=require(_0x2faf('0xb'));var crypto=require(_0x2faf('0xc'));var jsforce=require(_0x2faf('0xd'));var deskjs=require(_0x2faf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2faf('0xf'));var Redis=require(_0x2faf('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2faf('0x11'));var hardwareService=require(_0x2faf('0x12'));var logger=require(_0x2faf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x2faf('0x14'));var licenseUtil=require(_0x2faf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x335730,_0x509157){_0x509157=_0x509157||0xcc;return function(_0x1945fe){if(_0x1945fe){return _0x335730[_0x2faf('0x16')](_0x509157);}return _0x335730[_0x2faf('0x17')](_0x509157)[_0x2faf('0x18')]();};}function respondWithResult(_0x1be421,_0x27d2c1){_0x27d2c1=_0x27d2c1||0xc8;return function(_0x4c44bb){if(_0x4c44bb){return _0x1be421[_0x2faf('0x17')](_0x27d2c1)[_0x2faf('0x19')](_0x4c44bb);}};}function respondWithFilteredResult(_0x5167af,_0x1fd4d3){return function(_0x3be136){if(_0x3be136){var _0x45cd2c=typeof _0x1fd4d3[_0x2faf('0x1a')]==='undefined'&&typeof _0x1fd4d3[_0x2faf('0x1b')]===_0x2faf('0x1c');var _0x30213e=_0x3be136[_0x2faf('0x1d')];var _0x5a0728=_0x45cd2c?0x0:_0x1fd4d3[_0x2faf('0x1a')];var _0xfc6439=_0x45cd2c?_0x3be136[_0x2faf('0x1d')]:_0x1fd4d3[_0x2faf('0x1a')]+_0x1fd4d3[_0x2faf('0x1b')];var _0x40d8bf;if(_0xfc6439>=_0x30213e){_0xfc6439=_0x30213e;_0x40d8bf=0xc8;}else{_0x40d8bf=0xce;}_0x5167af[_0x2faf('0x17')](_0x40d8bf);return _0x5167af['set']('Content-Range',_0x5a0728+'-'+_0xfc6439+'/'+_0x30213e)['json'](_0x3be136);}return null;};}function patchUpdates(_0x219f13){return function(_0x1a6f89){try{jsonpatch['apply'](_0x1a6f89,_0x219f13,!![]);}catch(_0x4295b9){return BPromise['reject'](_0x4295b9);}return _0x1a6f89['save']();};}function saveUpdates(_0x328814,_0x2cb862){return function(_0x5d8cb7){if(_0x5d8cb7){return _0x5d8cb7[_0x2faf('0x1e')](_0x328814)[_0x2faf('0x1f')](function(_0x3545cf){return _0x3545cf;});}return null;};}function removeEntity(_0x3f598c,_0xfe4559){return function(_0x2d7e18){if(_0x2d7e18){return _0x2d7e18[_0x2faf('0x20')]()[_0x2faf('0x1f')](function(){_0x3f598c[_0x2faf('0x17')](0xcc)[_0x2faf('0x18')]();});}};}function handleEntityNotFound(_0x770d45,_0x2114f7){return function(_0x5f1359){if(!_0x5f1359){_0x770d45[_0x2faf('0x16')](0x194);}return _0x5f1359;};}function handleError(_0x13b655,_0xa092f6){_0xa092f6=_0xa092f6||0x1f4;return function(_0x53f72c){logger[_0x2faf('0x21')](_0x53f72c[_0x2faf('0x22')]);if(_0x53f72c[_0x2faf('0x23')]){delete _0x53f72c[_0x2faf('0x23')];}_0x13b655[_0x2faf('0x17')](_0xa092f6)[_0x2faf('0x24')](_0x53f72c);};}exports['index']=function(_0x3df9b1,_0x583d48){var _0x14acde={},_0x1133a0={},_0x147730={'count':0x0,'rows':[]};var _0x37398e=_[_0x2faf('0x25')](db[_0x2faf('0x26')][_0x2faf('0x27')],function(_0x266dce){return{'name':_0x266dce[_0x2faf('0x28')],'type':_0x266dce['type'][_0x2faf('0x29')]};});_0x1133a0[_0x2faf('0x2a')]=_[_0x2faf('0x25')](_0x37398e,_0x2faf('0x23'));_0x1133a0[_0x2faf('0x2b')]=_['keys'](_0x3df9b1[_0x2faf('0x2b')]);_0x1133a0[_0x2faf('0x2c')]=_['intersection'](_0x1133a0[_0x2faf('0x2a')],_0x1133a0[_0x2faf('0x2b')]);_0x14acde[_0x2faf('0x2d')]=_[_0x2faf('0x2e')](_0x1133a0['model'],qs[_0x2faf('0x2f')](_0x3df9b1['query']['fields']));_0x14acde[_0x2faf('0x2d')]=_0x14acde[_0x2faf('0x2d')][_0x2faf('0x30')]?_0x14acde[_0x2faf('0x2d')]:_0x1133a0['model'];if(!_0x3df9b1['query'][_0x2faf('0x31')](_0x2faf('0x32'))){_0x14acde[_0x2faf('0x1b')]=qs[_0x2faf('0x1b')](_0x3df9b1[_0x2faf('0x2b')][_0x2faf('0x1b')]);_0x14acde['offset']=qs[_0x2faf('0x1a')](_0x3df9b1[_0x2faf('0x2b')][_0x2faf('0x1a')]);}_0x14acde[_0x2faf('0x33')]=qs[_0x2faf('0x34')](_0x3df9b1[_0x2faf('0x2b')][_0x2faf('0x34')]);_0x14acde[_0x2faf('0x35')]=qs[_0x2faf('0x2c')](_[_0x2faf('0x36')](_0x3df9b1[_0x2faf('0x2b')],_0x1133a0[_0x2faf('0x2c')]),_0x37398e);if(_0x3df9b1[_0x2faf('0x2b')]['filter']){_0x14acde['where']=_[_0x2faf('0x37')](_0x14acde[_0x2faf('0x35')],{'$or':_['map'](_0x37398e,function(_0x532017){if(_0x532017[_0x2faf('0x38')]!==_0x2faf('0x39')){var _0x2d0bfb={};_0x2d0bfb[_0x532017[_0x2faf('0x23')]]={'$like':'%'+_0x3df9b1[_0x2faf('0x2b')][_0x2faf('0x3a')]+'%'};return _0x2d0bfb;}})});}_0x14acde=_[_0x2faf('0x37')]({},_0x14acde,_0x3df9b1['options']);var _0x51fd42={'where':_0x14acde[_0x2faf('0x35')]};return db['WhatsappApplication']['count'](_0x51fd42)['then'](function(_0x5198bf){_0x147730[_0x2faf('0x1d')]=_0x5198bf;if(_0x3df9b1[_0x2faf('0x2b')][_0x2faf('0x3b')]){_0x14acde['include']=[{'all':!![]}];}return db[_0x2faf('0x26')]['findAll'](_0x14acde);})['then'](function(_0x22662a){_0x147730[_0x2faf('0x3c')]=_0x22662a;return _0x147730;})[_0x2faf('0x1f')](respondWithFilteredResult(_0x583d48,_0x14acde))[_0x2faf('0x3d')](handleError(_0x583d48,null));};exports[_0x2faf('0x3e')]=function(_0x5a731b,_0x386887){var _0x450509={'raw':!![],'where':{'id':_0x5a731b[_0x2faf('0x3f')]['id']}},_0x294e5c={};_0x294e5c[_0x2faf('0x2a')]=_[_0x2faf('0x40')](db[_0x2faf('0x26')][_0x2faf('0x27')]);_0x294e5c[_0x2faf('0x2b')]=_[_0x2faf('0x40')](_0x5a731b[_0x2faf('0x2b')]);_0x294e5c[_0x2faf('0x2c')]=_['intersection'](_0x294e5c[_0x2faf('0x2a')],_0x294e5c[_0x2faf('0x2b')]);_0x450509[_0x2faf('0x2d')]=_[_0x2faf('0x2e')](_0x294e5c[_0x2faf('0x2a')],qs[_0x2faf('0x2f')](_0x5a731b[_0x2faf('0x2b')]['fields']));_0x450509[_0x2faf('0x2d')]=_0x450509[_0x2faf('0x2d')][_0x2faf('0x30')]?_0x450509[_0x2faf('0x2d')]:_0x294e5c[_0x2faf('0x2a')];if(_0x5a731b[_0x2faf('0x2b')][_0x2faf('0x3b')]){_0x450509['include']=[{'all':!![]}];}_0x450509=_[_0x2faf('0x37')]({},_0x450509,_0x5a731b['options']);return db[_0x2faf('0x26')][_0x2faf('0x41')](_0x450509)[_0x2faf('0x1f')](handleEntityNotFound(_0x386887,null))[_0x2faf('0x1f')](respondWithResult(_0x386887,null))[_0x2faf('0x3d')](handleError(_0x386887,null));};exports[_0x2faf('0x42')]=function(_0x489b88,_0x2d2171){return db[_0x2faf('0x26')][_0x2faf('0x42')](_0x489b88[_0x2faf('0x43')],{})[_0x2faf('0x1f')](respondWithResult(_0x2d2171,0xc9))[_0x2faf('0x3d')](handleError(_0x2d2171,null));};exports[_0x2faf('0x1e')]=function(_0x3d0f6e,_0x274a4e){if(_0x3d0f6e[_0x2faf('0x43')]['id']){delete _0x3d0f6e['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x3d0f6e[_0x2faf('0x3f')]['id']}})[_0x2faf('0x1f')](handleEntityNotFound(_0x274a4e,null))['then'](saveUpdates(_0x3d0f6e[_0x2faf('0x43')],null))['then'](respondWithResult(_0x274a4e,null))[_0x2faf('0x3d')](handleError(_0x274a4e,null));};exports['destroy']=function(_0x2b730e,_0x46c132){return db[_0x2faf('0x26')]['find']({'where':{'id':_0x2b730e['params']['id']}})[_0x2faf('0x1f')](handleEntityNotFound(_0x46c132,null))[_0x2faf('0x1f')](removeEntity(_0x46c132,null))['catch'](handleError(_0x46c132,null));}; \ No newline at end of file +var _0x7031=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','WhatsappApplication','include','findAll','rows','show','params','includeAll','catch','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','save','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x301e03,_0xfd3ffb){var _0x3b776e=function(_0x5375d0){while(--_0x5375d0){_0x301e03['push'](_0x301e03['shift']());}};_0x3b776e(++_0xfd3ffb);}(_0x7031,0x19a));var _0x1703=function(_0x5a7da7,_0x4f132a){_0x5a7da7=_0x5a7da7-0x0;var _0x14459e=_0x7031[_0x5a7da7];return _0x14459e;};'use strict';var emlformat=require(_0x1703('0x0'));var rimraf=require(_0x1703('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1703('0x2'));var rp=require(_0x1703('0x3'));var moment=require('moment');var BPromise=require(_0x1703('0x4'));var Mustache=require(_0x1703('0x5'));var util=require('util');var path=require(_0x1703('0x6'));var sox=require(_0x1703('0x7'));var csv=require('to-csv');var ejs=require(_0x1703('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1703('0x9'));var squel=require(_0x1703('0xa'));var crypto=require(_0x1703('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1703('0xc'));var toCsv=require(_0x1703('0xd'));var querystring=require(_0x1703('0xe'));var Papa=require('papaparse');var Redis=require(_0x1703('0xf'));var authService=require(_0x1703('0x10'));var qs=require(_0x1703('0x11'));var as=require(_0x1703('0x12'));var hardwareService=require(_0x1703('0x13'));var logger=require(_0x1703('0x14'))(_0x1703('0x15'));var utils=require(_0x1703('0x16'));var config=require(_0x1703('0x17'));var licenseUtil=require(_0x1703('0x18'));var db=require(_0x1703('0x19'))['db'];function respondWithStatusCode(_0x3cfcec,_0x157055){_0x157055=_0x157055||0xcc;return function(_0x24b81e){if(_0x24b81e){return _0x3cfcec[_0x1703('0x1a')](_0x157055);}return _0x3cfcec[_0x1703('0x1b')](_0x157055)[_0x1703('0x1c')]();};}function respondWithResult(_0x572b96,_0x51b2b8){_0x51b2b8=_0x51b2b8||0xc8;return function(_0x3bea9e){if(_0x3bea9e){return _0x572b96[_0x1703('0x1b')](_0x51b2b8)['json'](_0x3bea9e);}};}function respondWithFilteredResult(_0x5c5371,_0x46e1bc){return function(_0x3f6367){if(_0x3f6367){var _0x4c41a3=typeof _0x46e1bc[_0x1703('0x1d')]===_0x1703('0x1e')&&typeof _0x46e1bc['limit']===_0x1703('0x1e');var _0x77b9ea=_0x3f6367[_0x1703('0x1f')];var _0x3c0695=_0x4c41a3?0x0:_0x46e1bc[_0x1703('0x1d')];var _0x5c9668=_0x4c41a3?_0x3f6367[_0x1703('0x1f')]:_0x46e1bc['offset']+_0x46e1bc['limit'];var _0x4ccc42;if(_0x5c9668>=_0x77b9ea){_0x5c9668=_0x77b9ea;_0x4ccc42=0xc8;}else{_0x4ccc42=0xce;}_0x5c5371[_0x1703('0x1b')](_0x4ccc42);return _0x5c5371['set'](_0x1703('0x20'),_0x3c0695+'-'+_0x5c9668+'/'+_0x77b9ea)[_0x1703('0x21')](_0x3f6367);}return null;};}function patchUpdates(_0xda335){return function(_0x56444e){try{jsonpatch['apply'](_0x56444e,_0xda335,!![]);}catch(_0x3de8a8){return BPromise[_0x1703('0x22')](_0x3de8a8);}return _0x56444e[_0x1703('0x23')]();};}function saveUpdates(_0x2bf640,_0x4b7323){return function(_0x374175){if(_0x374175){return _0x374175['update'](_0x2bf640)[_0x1703('0x24')](function(_0x30c2b5){return _0x30c2b5;});}return null;};}function removeEntity(_0x962021,_0x2d6cdf){return function(_0x2a931d){if(_0x2a931d){return _0x2a931d['destroy']()['then'](function(){_0x962021[_0x1703('0x1b')](0xcc)[_0x1703('0x1c')]();});}};}function handleEntityNotFound(_0x203205,_0x4ee3c1){return function(_0x3c23ea){if(!_0x3c23ea){_0x203205[_0x1703('0x1a')](0x194);}return _0x3c23ea;};}function handleError(_0x2be6a7,_0x18e983){_0x18e983=_0x18e983||0x1f4;return function(_0x59b809){logger['error'](_0x59b809[_0x1703('0x25')]);if(_0x59b809[_0x1703('0x26')]){delete _0x59b809['name'];}_0x2be6a7[_0x1703('0x1b')](_0x18e983)[_0x1703('0x27')](_0x59b809);};}exports[_0x1703('0x28')]=function(_0x25be97,_0x525f06){var _0x5d5ded={},_0x4e2d3e={},_0x393fec={'count':0x0,'rows':[]};var _0x3c4ccf=_[_0x1703('0x29')](db['WhatsappApplication'][_0x1703('0x2a')],function(_0x179082){return{'name':_0x179082[_0x1703('0x2b')],'type':_0x179082[_0x1703('0x2c')][_0x1703('0x2d')]};});_0x4e2d3e[_0x1703('0x2e')]=_['map'](_0x3c4ccf,_0x1703('0x26'));_0x4e2d3e[_0x1703('0x2f')]=_[_0x1703('0x30')](_0x25be97[_0x1703('0x2f')]);_0x4e2d3e['filters']=_[_0x1703('0x31')](_0x4e2d3e['model'],_0x4e2d3e[_0x1703('0x2f')]);_0x5d5ded[_0x1703('0x32')]=_['intersection'](_0x4e2d3e['model'],qs[_0x1703('0x33')](_0x25be97[_0x1703('0x2f')]['fields']));_0x5d5ded[_0x1703('0x32')]=_0x5d5ded[_0x1703('0x32')][_0x1703('0x34')]?_0x5d5ded[_0x1703('0x32')]:_0x4e2d3e['model'];if(!_0x25be97['query'][_0x1703('0x35')](_0x1703('0x36'))){_0x5d5ded[_0x1703('0x37')]=qs[_0x1703('0x37')](_0x25be97[_0x1703('0x2f')][_0x1703('0x37')]);_0x5d5ded[_0x1703('0x1d')]=qs[_0x1703('0x1d')](_0x25be97[_0x1703('0x2f')]['offset']);}_0x5d5ded[_0x1703('0x38')]=qs['sort'](_0x25be97[_0x1703('0x2f')][_0x1703('0x39')]);_0x5d5ded[_0x1703('0x3a')]=qs[_0x1703('0x3b')](_[_0x1703('0x3c')](_0x25be97[_0x1703('0x2f')],_0x4e2d3e['filters']),_0x3c4ccf);if(_0x25be97['query'][_0x1703('0x3d')]){_0x5d5ded[_0x1703('0x3a')]=_['merge'](_0x5d5ded[_0x1703('0x3a')],{'$or':_[_0x1703('0x29')](_0x3c4ccf,function(_0x35e8e0){if(_0x35e8e0[_0x1703('0x2c')]!==_0x1703('0x3e')){var _0x1c5488={};_0x1c5488[_0x35e8e0[_0x1703('0x26')]]={'$like':'%'+_0x25be97[_0x1703('0x2f')][_0x1703('0x3d')]+'%'};return _0x1c5488;}})});}_0x5d5ded=_[_0x1703('0x3f')]({},_0x5d5ded,_0x25be97[_0x1703('0x40')]);var _0x15d9db={'where':_0x5d5ded[_0x1703('0x3a')]};return db[_0x1703('0x41')][_0x1703('0x1f')](_0x15d9db)[_0x1703('0x24')](function(_0x26c7af){_0x393fec['count']=_0x26c7af;if(_0x25be97['query']['includeAll']){_0x5d5ded[_0x1703('0x42')]=[{'all':!![]}];}return db[_0x1703('0x41')][_0x1703('0x43')](_0x5d5ded);})['then'](function(_0x648f15){_0x393fec[_0x1703('0x44')]=_0x648f15;return _0x393fec;})[_0x1703('0x24')](respondWithFilteredResult(_0x525f06,_0x5d5ded))['catch'](handleError(_0x525f06,null));};exports[_0x1703('0x45')]=function(_0x194b4e,_0x37ac42){var _0x320723={'raw':!![],'where':{'id':_0x194b4e[_0x1703('0x46')]['id']}},_0x34b455={};_0x34b455['model']=_['keys'](db[_0x1703('0x41')]['rawAttributes']);_0x34b455[_0x1703('0x2f')]=_[_0x1703('0x30')](_0x194b4e[_0x1703('0x2f')]);_0x34b455[_0x1703('0x3b')]=_[_0x1703('0x31')](_0x34b455[_0x1703('0x2e')],_0x34b455[_0x1703('0x2f')]);_0x320723['attributes']=_[_0x1703('0x31')](_0x34b455[_0x1703('0x2e')],qs[_0x1703('0x33')](_0x194b4e[_0x1703('0x2f')][_0x1703('0x33')]));_0x320723[_0x1703('0x32')]=_0x320723['attributes'][_0x1703('0x34')]?_0x320723[_0x1703('0x32')]:_0x34b455['model'];if(_0x194b4e[_0x1703('0x2f')][_0x1703('0x47')]){_0x320723[_0x1703('0x42')]=[{'all':!![]}];}_0x320723=_[_0x1703('0x3f')]({},_0x320723,_0x194b4e[_0x1703('0x40')]);return db[_0x1703('0x41')]['find'](_0x320723)[_0x1703('0x24')](handleEntityNotFound(_0x37ac42,null))['then'](respondWithResult(_0x37ac42,null))[_0x1703('0x48')](handleError(_0x37ac42,null));};exports[_0x1703('0x49')]=function(_0x3682ce,_0x55d96f){return db['WhatsappApplication']['create'](_0x3682ce[_0x1703('0x4a')],{})[_0x1703('0x24')](respondWithResult(_0x55d96f,0xc9))[_0x1703('0x48')](handleError(_0x55d96f,null));};exports['update']=function(_0x1bb341,_0x11c759){if(_0x1bb341[_0x1703('0x4a')]['id']){delete _0x1bb341[_0x1703('0x4a')]['id'];}return db[_0x1703('0x41')][_0x1703('0x4b')]({'where':{'id':_0x1bb341[_0x1703('0x46')]['id']}})[_0x1703('0x24')](handleEntityNotFound(_0x11c759,null))[_0x1703('0x24')](saveUpdates(_0x1bb341['body'],null))[_0x1703('0x24')](respondWithResult(_0x11c759,null))[_0x1703('0x48')](handleError(_0x11c759,null));};exports[_0x1703('0x4c')]=function(_0x2541b6,_0xb08f79){return db[_0x1703('0x41')]['find']({'where':{'id':_0x2541b6['params']['id']}})['then'](handleEntityNotFound(_0xb08f79,null))[_0x1703('0x24')](removeEntity(_0xb08f79,null))['catch'](handleError(_0xb08f79,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1ebaaf8..2b7a6b4 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 _0xa4fb=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x475278,_0x38c7a9){var _0x26da4e=function(_0x263a41){while(--_0x263a41){_0x475278['push'](_0x475278['shift']());}};_0x26da4e(++_0x38c7a9);}(_0xa4fb,0x150));var _0xba4f=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xa4fb[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var logger=require(_0xba4f('0x2'))(_0xba4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba4f('0x4'));var fs=require('fs');var path=require(_0xba4f('0x5'));var rimraf=require(_0xba4f('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4f('0x7'));module[_0xba4f('0x8')]=function(_0x379b0f,_0x18baa8){return _0x379b0f[_0xba4f('0x9')](_0xba4f('0xa'),attributes,{'tableName':_0xba4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba4f('0xc'),'collate':_0xba4f('0xd')});}; \ No newline at end of file +var _0xa990=['exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappApplication.attributes'];(function(_0x3cee78,_0x10669e){var _0x431806=function(_0x2e086c){while(--_0x2e086c){_0x3cee78['push'](_0x3cee78['shift']());}};_0x431806(++_0x10669e);}(_0xa990,0xc9));var _0x0a99=function(_0x283f6a,_0x20b078){_0x283f6a=_0x283f6a-0x0;var _0x2c2cc8=_0xa990[_0x283f6a];return _0x2c2cc8;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a99('0xd'),'collate':_0x0a99('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f51ab4c..c5bff44 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4d4d9e,_0x5af397){var _0x296c01=function(_0x2f2622){while(--_0x2f2622){_0x4d4d9e['push'](_0x4d4d9e['shift']());}};_0x296c01(++_0x5af397);}(_0x4c4e,0x152));var _0xe4c4=function(_0x540872,_0x1907e7){_0x540872=_0x540872-0x0;var _0x328b8e=_0x4c4e[_0x540872];return _0x328b8e;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x11c6d6,_0x48bc32){var _0x5186ec=function(_0x1a2ef8){while(--_0x1a2ef8){_0x11c6d6['push'](_0x11c6d6['shift']());}};_0x5186ec(++_0x48bc32);}(_0xac9d,0x14d));var _0xdac9=function(_0x5aabcb,_0x219fbd){_0x5aabcb=_0x5aabcb-0x0;var _0x4b6e71=_0xac9d[_0x5aabcb];return _0x4b6e71;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 90f25b6..f3b6257 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 _0xb4c7=['post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','create'];(function(_0xe16fcf,_0x2b5918){var _0x5981e9=function(_0x494df2){while(--_0x494df2){_0xe16fcf['push'](_0xe16fcf['shift']());}};_0x5981e9(++_0x2b5918);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x517d51,_0x30c9d8){_0x517d51=_0x517d51-0x0;var _0x5acff7=_0xb4c7[_0x517d51];return _0x5acff7;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0xc')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0xc')](_0x7b4c('0x12'),auth[_0x7b4c('0xa')](),controller['download']);router['post']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x14')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x15')]);router[_0x7b4c('0x14')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x18')),controller[_0x7b4c('0x19')]);router[_0x7b4c('0x1a')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')](_0x7b4c('0x1b'),_0x7b4c('0x1c')),controller['update']);router[_0x7b4c('0x1d')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x1e')),controller[_0x7b4c('0x1f')]);router[_0x7b4c('0x1d')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x20')]);module[_0x7b4c('0x21')]=router; \ No newline at end of file +var _0x446c=['describe','get','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x43525b,_0x31bac2){var _0x33577f=function(_0x105248){while(--_0x105248){_0x43525b['push'](_0x43525b['shift']());}};_0x33577f(++_0x31bac2);}(_0x446c,0x156));var _0xc446=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x446c[_0x17882c];return _0x355a59;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var fs_extra=require(_0xc446('0x5'));var auth=require(_0xc446('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc446('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc446('0x8')](),controller[_0xc446('0x9')]);router['get']('/describe',auth[_0xc446('0x8')](),controller[_0xc446('0xa')]);router[_0xc446('0xb')](_0xc446('0xc'),auth[_0xc446('0x8')](),controller['show']);router[_0xc446('0xb')](_0xc446('0xd'),auth[_0xc446('0x8')](),controller[_0xc446('0xe')]);router['get'](_0xc446('0xf'),auth[_0xc446('0x8')](),controller[_0xc446('0x10')]);router[_0xc446('0x11')]('/',auth[_0xc446('0x8')](),controller[_0xc446('0x12')]);router[_0xc446('0x11')](_0xc446('0xd'),auth[_0xc446('0x8')](),controller[_0xc446('0x13')]);router[_0xc446('0x11')](_0xc446('0x14'),auth[_0xc446('0x8')](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x17')),controller[_0xc446('0x18')]);router[_0xc446('0x19')](_0xc446('0xc'),auth['isAuthenticated'](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x1a')),controller[_0xc446('0x1b')]);router[_0xc446('0x1c')](_0xc446('0xc'),auth[_0xc446('0x8')](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x1d')),controller['destroy']);router[_0xc446('0x1c')](_0xc446('0x14'),auth['isAuthenticated'](),controller[_0xc446('0x1e')]);module[_0xc446('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 7692180..7ef9000 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 _0xcdd0=['out','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x2dc03e,_0x5e5154){var _0x342a2b=function(_0x2d8af5){while(--_0x2d8af5){_0x2dc03e['push'](_0x2dc03e['shift']());}};_0x342a2b(++_0x5e5154);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xcdd0[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0x0cdd('0x0'));var moment=require(_0x0cdd('0x1'));module[_0x0cdd('0x2')]={'closed':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0cdd('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0cdd('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0cdd('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x0cdd('0x6')]('in',_0x0cdd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0cdd('0x6')]('in',_0x0cdd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x294b=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x3c2cf0,_0x4329f5){var _0x18c5df=function(_0x9cfbee){while(--_0x9cfbee){_0x3c2cf0['push'](_0x3c2cf0['shift']());}};_0x18c5df(++_0x4329f5);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));var moment=require('moment');module[_0xb294('0x1')]={'closed':{'type':Sequelize[_0xb294('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb294('0x3')]},'disposition':{'type':Sequelize[_0xb294('0x4')]},'secondDisposition':{'type':Sequelize[_0xb294('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb294('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb294('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb294('0x5')]('in',_0xb294('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb294('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb294('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb294('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index eccbcbe..eda4e5b 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 _0xc964=['ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','include','merge','options','catch','create','describe','ids','getMessages','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','Account','get','mkdirSync','Whatsapp','Owner','closed','closedAt','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','views','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue'];(function(_0x2c9708,_0x1d042b){var _0x1da302=function(_0x49102c){while(--_0x49102c){_0x2c9708['push'](_0x2c9708['shift']());}};_0x1da302(++_0x1d042b);}(_0xc964,0x7e));var _0x4c96=function(_0x1efdee,_0x5c4cb8){_0x1efdee=_0x1efdee-0x0;var _0x14057d=_0xc964[_0x1efdee];return _0x14057d;};'use strict';var emlformat=require(_0x4c96('0x0'));var rimraf=require(_0x4c96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c96('0x2'));var rp=require(_0x4c96('0x3'));var moment=require(_0x4c96('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c96('0x5'));var util=require('util');var path=require(_0x4c96('0x6'));var sox=require(_0x4c96('0x7'));var csv=require(_0x4c96('0x8'));var ejs=require(_0x4c96('0x9'));var fs=require('fs');var fs_extra=require(_0x4c96('0xa'));var _=require(_0x4c96('0xb'));var squel=require(_0x4c96('0xc'));var crypto=require('crypto');var jsforce=require(_0x4c96('0xd'));var deskjs=require(_0x4c96('0xe'));var toCsv=require(_0x4c96('0x8'));var querystring=require('querystring');var Papa=require(_0x4c96('0xf'));var Redis=require(_0x4c96('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4c96('0x11'));var hardwareService=require(_0x4c96('0x12'));var logger=require(_0x4c96('0x13'))('api');var utils=require(_0x4c96('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c96('0x15'))['db'];config[_0x4c96('0x16')]=_[_0x4c96('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c96('0x18'))(new Redis(config[_0x4c96('0x16')]));require(_0x4c96('0x19'))['register'](socket);function respondWithStatusCode(_0xe42458,_0x334165){_0x334165=_0x334165||0xcc;return function(_0x167537){if(_0x167537){return _0xe42458[_0x4c96('0x1a')](_0x334165);}return _0xe42458[_0x4c96('0x1b')](_0x334165)[_0x4c96('0x1c')]();};}function respondWithResult(_0xeb18f3,_0x4a3fca){_0x4a3fca=_0x4a3fca||0xc8;return function(_0x388237){if(_0x388237){return _0xeb18f3['status'](_0x4a3fca)[_0x4c96('0x1d')](_0x388237);}};}function respondWithFilteredResult(_0x4d82ac,_0x2453e0){return function(_0x494a26){if(_0x494a26){var _0x17891b=typeof _0x2453e0[_0x4c96('0x1e')]===_0x4c96('0x1f')&&typeof _0x2453e0[_0x4c96('0x20')]===_0x4c96('0x1f');var _0x32552d=_0x494a26[_0x4c96('0x21')];var _0x3595e6=_0x17891b?0x0:_0x2453e0[_0x4c96('0x1e')];var _0x9546c5=_0x17891b?_0x494a26[_0x4c96('0x21')]:_0x2453e0['offset']+_0x2453e0['limit'];var _0x5ea092;if(_0x9546c5>=_0x32552d){_0x9546c5=_0x32552d;_0x5ea092=0xc8;}else{_0x5ea092=0xce;}_0x4d82ac[_0x4c96('0x1b')](_0x5ea092);return _0x4d82ac[_0x4c96('0x22')](_0x4c96('0x23'),_0x3595e6+'-'+_0x9546c5+'/'+_0x32552d)[_0x4c96('0x1d')](_0x494a26);}return null;};}function patchUpdates(_0x3b9a10){return function(_0x422fc6){try{jsonpatch['apply'](_0x422fc6,_0x3b9a10,!![]);}catch(_0x25d9a0){return BPromise[_0x4c96('0x24')](_0x25d9a0);}return _0x422fc6[_0x4c96('0x25')]();};}function saveUpdates(_0x31a854,_0x2f6f93){return function(_0x23fbfa){if(_0x23fbfa){return _0x23fbfa['update'](_0x31a854)[_0x4c96('0x26')](function(_0x2bfd69){return _0x2bfd69;});}return null;};}function removeEntity(_0x4aeb36,_0x146f8a){return function(_0x53ea2f){if(_0x53ea2f){return _0x53ea2f[_0x4c96('0x27')]()[_0x4c96('0x26')](function(){_0x4aeb36[_0x4c96('0x1b')](0xcc)[_0x4c96('0x1c')]();});}};}function handleEntityNotFound(_0x59a913,_0x20c94f){return function(_0x80b4fb){if(!_0x80b4fb){_0x59a913[_0x4c96('0x1a')](0x194);}return _0x80b4fb;};}function handleError(_0x498938,_0x280c6b){_0x280c6b=_0x280c6b||0x1f4;return function(_0x2c1d1a){logger['error'](_0x2c1d1a[_0x4c96('0x28')]);if(_0x2c1d1a[_0x4c96('0x29')]){delete _0x2c1d1a[_0x4c96('0x29')];}_0x498938[_0x4c96('0x1b')](_0x280c6b)[_0x4c96('0x2a')](_0x2c1d1a);};}function getInteractionUsers(_0x1712c4,_0x4c5e1a){return new BPromise(function(_0x5e2683,_0x290e9e){try{if(_0x4c5e1a[_0x1712c4['id']]){_0x1712c4[_0x4c96('0x2b')]=_[_0x4c96('0x2c')](_0x4c5e1a[_0x1712c4['id']],function(_0xa64090){return{'id':_0xa64090['id'],'fullname':_0xa64090[_0x4c96('0x2d')]};});}}catch(_0x5dee7c){_0x290e9e(_0x5dee7c);}_0x5e2683(_0x1712c4);});}function getInteractionTags(_0x3d68e5,_0x585f7b){return new BPromise(function(_0x18e3d5,_0x5b81fc){try{if(_0x3d68e5[_0x4c96('0x2e')]){_0x3d68e5[_0x4c96('0x2f')]=[];_0x3d68e5[_0x4c96('0x2e')][_0x4c96('0x30')](',')[_0x4c96('0x31')](function(_0x1faf24){_0x3d68e5[_0x4c96('0x2f')][_0x4c96('0x32')](_0x585f7b[_0x1faf24]);});}delete _0x3d68e5[_0x4c96('0x2e')];}catch(_0x3d8e63){_0x5b81fc(_0x3d8e63);}_0x18e3d5(_0x3d68e5);});}function updateWhatsappInteraction(_0x20afe2,_0x39a7ae,_0x4255c5){return new BPromise(function(_0xa1e751,_0x209274){return getInteractionUsers(_0x20afe2,_0x4255c5)['then'](function(_0x374a49){return getInteractionTags(_0x374a49,_0x39a7ae);})[_0x4c96('0x26')](function(_0x266e53){_0xa1e751(_0x266e53);})['catch'](function(_0x299939){_0x209274(_0x299939);});});}exports['index']=function(_0xf9424b,_0x5e2f8a){var _0x27bbbc={},_0x1dde52={},_0x11bb1a={'count':0x0,'rows':[]};var _0x47c1ce=_['map'](db[_0x4c96('0x33')][_0x4c96('0x34')],function(_0x4f9cad){return{'name':_0x4f9cad[_0x4c96('0x35')],'type':_0x4f9cad[_0x4c96('0x36')][_0x4c96('0x37')]};});_0x1dde52[_0x4c96('0x38')]=_['map'](_0x47c1ce,_0x4c96('0x29'));_0x1dde52[_0x4c96('0x39')]=_[_0x4c96('0x3a')](_0xf9424b[_0x4c96('0x39')]);_0x1dde52[_0x4c96('0x3b')]=_['intersection'](_0x1dde52[_0x4c96('0x38')],_0x1dde52[_0x4c96('0x39')]);_0x27bbbc['attributes']=_[_0x4c96('0x3c')](_0x1dde52[_0x4c96('0x38')],qs[_0x4c96('0x3d')](_0xf9424b[_0x4c96('0x39')][_0x4c96('0x3d')]));_0x27bbbc[_0x4c96('0x3e')]=_0x27bbbc[_0x4c96('0x3e')]['length']?_0x27bbbc[_0x4c96('0x3e')]:_0x1dde52[_0x4c96('0x38')];if(!_0xf9424b[_0x4c96('0x39')][_0x4c96('0x3f')](_0x4c96('0x40'))){_0x27bbbc[_0x4c96('0x20')]=qs[_0x4c96('0x20')](_0xf9424b[_0x4c96('0x39')][_0x4c96('0x20')]);_0x27bbbc[_0x4c96('0x1e')]=qs['offset'](_0xf9424b[_0x4c96('0x39')][_0x4c96('0x1e')]);}_0x27bbbc[_0x4c96('0x41')]=qs[_0x4c96('0x42')](_0xf9424b[_0x4c96('0x39')]['sort']);_0x27bbbc[_0x4c96('0x43')]=qs[_0x4c96('0x3b')](_[_0x4c96('0x44')](_0xf9424b[_0x4c96('0x39')],_0x1dde52['filters']),_0x47c1ce);var _0x43311f=[];var _0xd789ec=squel[_0x4c96('0x45')]()[_0x4c96('0x46')]('id')[_0x4c96('0x46')]('name')[_0x4c96('0x46')](_0x4c96('0x47'))[_0x4c96('0x48')](_0x4c96('0x49'));var _0x3f45a2=squel['select']()['field'](_0x4c96('0x4a'))['field']('u.fullname')[_0x4c96('0x46')](_0x4c96('0x4b'))[_0x4c96('0x48')](_0x4c96('0x4c'),'ui')[_0x4c96('0x4d')](_0x4c96('0x4e'),'u',_0x4c96('0x4f'));var _0x8da47c=squel[_0x4c96('0x45')]()['from'](_0x4c96('0x50'),'i')[_0x4c96('0x4d')](_0x4c96('0x51'),'c',_0x4c96('0x52'))[_0x4c96('0x4d')]('users','o',_0x4c96('0x53'))[_0x4c96('0x4d')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x4c96('0x4d')](_0x4c96('0x54'),'me',_0x4c96('0x55'))['left_join'](_0x4c96('0x56'),'it',_0x4c96('0x57'))['left_join'](_0x4c96('0x49'),'t',_0x4c96('0x58'));var _0x407688=squel['expr']();var _0x4fb9b6=[];var _0x5d6449=squel['expr']();var _0x2f6884;if(_0xf9424b[_0x4c96('0x39')][_0x4c96('0x59')]){_0x2f6884=as[_0x4c96('0x5a')](_0xf9424b[_0x4c96('0x39')][_0x4c96('0x59')]);var _0x175a8a=_0x2f6884[_0x4c96('0x5b')];for(var _0x3efc6a=0x0;_0x3efc6a<_0x2f6884[_0x4c96('0x5c')][_0x4c96('0x5d')];_0x3efc6a++){var _0xa1f865=_0x2f6884['conditions'][_0x3efc6a];var _0x4b9077='i';var _0x252c64=_[_0x4c96('0x5e')](_0x47c1ce,['name',_0xa1f865[_0x4c96('0x46')]]);if(!_0x252c64){switch(_0xa1f865[_0x4c96('0x46')]){case _0x4c96('0x5f'):if(_0xa1f865[_0x4c96('0x60')]==0x1){_0x8da47c[_0x4c96('0x61')]('`'+_0xa1f865[_0x4c96('0x46')]+'`\x20=\x200');}else{_0x8da47c[_0x4c96('0x61')]('`'+_0xa1f865['field']+_0x4c96('0x62'));}break;case _0x4c96('0x63'):if(_0xa1f865[_0x4c96('0x64')]===_0x4c96('0x65')){if(_0xa1f865[_0x4c96('0x60')][_0x4c96('0x30')]('\x20')['length']>0x1){_0x407688[_0x175a8a](_0x4c96('0x66'),qs[_0x4c96('0x67')](_0xa1f865[_0x4c96('0x60')]),null);}else{var _0x58d687='%'+_0xa1f865[_0x4c96('0x60')]+'%';_0x407688[_0x175a8a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x58d687,_0x58d687,_0x58d687);}}else{_0x252c64=_[_0x4c96('0x5e')](_0x47c1ce,[_0x4c96('0x29'),'ContactId']);_0xa1f865['field']=_0x4c96('0x68');_0x18944b=as[_0x4c96('0x69')](_0x4b9077,_0x252c64[_0x4c96('0x36')],_0xa1f865);_0x407688[_0x175a8a](_0x18944b[_0x4c96('0x6a')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x6b')],_0x18944b['value'][_0x4c96('0x1c')]);}break;case _0x4c96('0x6c'):var _0x3316ae=_0xa1f865[_0x4c96('0x60')][_0x4c96('0x30')](',')['map'](function(_0x3b0456){return Number(_0x3b0456);});_0x3316ae[_0x4c96('0x31')](function(_0x28e2a4){_0x5d6449['or'](_0x4c96('0x6d'),'%,'+_0x28e2a4+',%');});_0x4fb9b6=_['union'](_0x4fb9b6,_0x3316ae);break;case _0x4c96('0x6e'):if(_0xa1f865[_0x4c96('0x64')]===_0x4c96('0x65')){_0x407688[_0x175a8a](_0x4c96('0x6f'),'%'+_0xa1f865['value']+'%',null);}else{_0x252c64=_['find'](_0x47c1ce,[_0x4c96('0x29'),'UserId']);_0xa1f865[_0x4c96('0x46')]=_0x4c96('0x70');_0x18944b=as['buildExpression'](_0x4b9077,_0x252c64[_0x4c96('0x36')],_0xa1f865);_0x407688[_0x175a8a](_0x18944b[_0x4c96('0x6a')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x6b')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x1c')]);}break;case _0x4c96('0x71'):_0x18944b=as[_0x4c96('0x69')]('me',null,_0xa1f865);_0x407688[_0x175a8a](_0x18944b[_0x4c96('0x6a')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x6b')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x1c')]);break;}}else{var _0x18944b=as[_0x4c96('0x69')](_0x4b9077,_0x252c64[_0x4c96('0x36')],_0xa1f865);_0x407688[_0x175a8a](_0x18944b[_0x4c96('0x6a')],_0x18944b[_0x4c96('0x60')][_0x4c96('0x6b')],_0x18944b[_0x4c96('0x60')]['end']);}}}else{var _0x14782b=_(_0xf9424b['query'])[_0x4c96('0x3a')]()[_0x4c96('0x2c')](function(_0xb55203){return _['some'](_0x47c1ce,[_0x4c96('0x29'),_0xb55203])?_0xb55203:undefined;})[_0x4c96('0x72')]()['value']();if(!_['isEmpty'](_0x14782b)){_0x14782b[_0x4c96('0x31')](function(_0x625761){if(_0x625761===_0x4c96('0x73')){_0x8da47c[_0x4c96('0x43')](_0x4c96('0x74'),[]['concat'](_0xf9424b[_0x4c96('0x39')][_0x625761]));}else if(_0x625761===_0x4c96('0x75')){var _0x412814=JSON[_0x4c96('0x76')](_0xf9424b[_0x4c96('0x39')][_0x625761])[_0x4c96('0x77')];var _0x4a47ca=JSON[_0x4c96('0x76')](_0xf9424b[_0x4c96('0x39')][_0x625761])[_0x4c96('0x78')];_0x8da47c['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x412814,_0x4a47ca);}else{if(_0xf9424b[_0x4c96('0x39')][_0x625761]===_0x4c96('0x79')){_0x8da47c[_0x4c96('0x43')]('i.'+_0x625761+_0x4c96('0x7a'));}else{_0x8da47c['where']('i.'+_0x625761+_0x4c96('0x7b'),_0xf9424b['query'][_0x625761]);}}});}if(_0xf9424b[_0x4c96('0x39')]['read']){if(_0xf9424b[_0x4c96('0x39')][_0x4c96('0x7c')]==0x1){_0x8da47c[_0x4c96('0x61')]('`unreadMessages`\x20=\x200');}else{_0x8da47c[_0x4c96('0x61')](_0x4c96('0x7d'));}}if(_0xf9424b[_0x4c96('0x39')][_0x4c96('0x7e')]){_0x4fb9b6=_[_0x4c96('0x7f')](_0xf9424b[_0x4c96('0x39')][_0x4c96('0x7e')])?_0xf9424b[_0x4c96('0x39')][_0x4c96('0x7e')]:new Array(_0xf9424b[_0x4c96('0x39')]['tag']);_0x4fb9b6[_0x4c96('0x31')](function(_0x2a959a){_0x5d6449['or'](_0x4c96('0x6d'),'%,'+_0x2a959a+',%');});}if(_0xf9424b[_0x4c96('0x39')][_0x4c96('0x80')]){var _0x399499=_0xf9424b['query'][_0x4c96('0x80')]['replace']('\x5c','\x5c\x5c')[_0x4c96('0x81')](/'/g,'\x27\x27');if(qs[_0x4c96('0x82')](_0x399499)){_0x407688['or'](_0x4c96('0x83'),_0x399499+'%')['or']('i.phone\x20LIKE\x20?',_0x399499+'%');}else{_0x407688['or'](_0x4c96('0x84'),qs[_0x4c96('0x67')](_0x399499))['or'](_0x4c96('0x85'),_0x399499+'%');}}}_0x8da47c[_0x4c96('0x43')](_0x407688);_0x8da47c[_0x4c96('0x86')]('i.id');var _0x55420a={'type':db[_0x4c96('0x87')][_0x4c96('0x88')][_0x4c96('0x89')],'raw':!![]};var _0xed969d=_0x8da47c[_0x4c96('0x8a')]();_0xed969d[_0x4c96('0x46')]('i.id');_0xed969d[_0x4c96('0x46')](_0x4c96('0x8b'),_0x4c96('0x5f'));if(_0x27bbbc[_0x4c96('0x41')]){_0x27bbbc[_0x4c96('0x41')][_0x4c96('0x31')](function(_0x133413){var _0xaf4eb5=_0x133413[0x0]==='contactName'?_0x133413[0x0]:'i.'+_0x133413[0x0];_0x8da47c[_0x4c96('0x41')](_0xaf4eb5,_0x133413[0x1]===_0x4c96('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x4fb9b6)){_0x8da47c[_0x4c96('0x61')](_0x5d6449);_0xed969d[_0x4c96('0x43')](_0x4c96('0x8d'),_0x4fb9b6);}BPromise['resolve']()[_0x4c96('0x26')](function(){if(!_0x2f6884){if(_0xf9424b['query'][_0x4c96('0x73')])return;_0xed969d['where'](_0x4c96('0x8e'));_0x8da47c[_0x4c96('0x43')](_0x4c96('0x8e'));return;}if(_0xf9424b['user']['role']!==_0x4c96('0x8f'))return;return _0xf9424b[_0x4c96('0x90')][_0x4c96('0x91')]({'attributes':['id'],'raw':!![]})[_0x4c96('0x26')](function(_0x4eeb77){if(_['isEmpty'](_0x4eeb77)){_0xed969d['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x8da47c['where'](_0x4c96('0x92'));}else{_0xed969d[_0x4c96('0x43')](_0x4c96('0x74'),_[_0x4c96('0x2c')](_0x4eeb77,'id'));_0x8da47c[_0x4c96('0x43')](_0x4c96('0x74'),_['map'](_0x4eeb77,'id'));}});})[_0x4c96('0x26')](function(){if(_0xf9424b[_0x4c96('0x90')][_0x4c96('0x93')]===_0x4c96('0x8f')&&!_0x2f6884&&!_0xf9424b[_0x4c96('0x39')][_0x4c96('0x73')])return[];return db['sequelize'][_0x4c96('0x39')](_0xed969d[_0x4c96('0x94')](),_0x55420a);})[_0x4c96('0x26')](function(_0x241db5){_0x11bb1a[_0x4c96('0x21')]=_0x241db5[_0x4c96('0x5d')];if(_0x11bb1a[_0x4c96('0x21')]===0x0)return[];return db['sequelize'][_0x4c96('0x39')](_0xd789ec[_0x4c96('0x94')](),_0x55420a)[_0x4c96('0x26')](function(_0x382720){_0x43311f=_['keyBy'](_0x382720,'id');_0x55420a=_['merge'](_0x55420a,{'model':db[_0x4c96('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf9424b[_0x4c96('0x39')][_0x4c96('0x3d')]){_0x27bbbc['attributes'][_0x4c96('0x31')](function(_0x1f29e0){_0x8da47c[_0x4c96('0x46')]('i.'+_0x1f29e0);});}else{_0x8da47c[_0x4c96('0x46')](_0x4c96('0x8b'),_0x4c96('0x5f'));_0x8da47c['field'](_0x4c96('0x95'),'Account.key');_0x8da47c[_0x4c96('0x46')](_0x4c96('0x96'),_0x4c96('0x97'));_0x8da47c[_0x4c96('0x46')](_0x4c96('0x98'),'contactName');_0x8da47c['field'](_0x4c96('0x99'));_0x8da47c[_0x4c96('0x46')](_0x4c96('0x9a'),_0x4c96('0x9b'));_0x8da47c['field'](_0x4c96('0x9c'),_0x4c96('0x9d'));_0x8da47c[_0x4c96('0x46')](_0x4c96('0x9e'),'Contact.email');_0x8da47c['field'](_0x4c96('0x9f'),_0x4c96('0xa0'));_0x8da47c[_0x4c96('0x46')](_0x4c96('0xa1'),'Contact.mobile');_0x8da47c['field']('c.fax',_0x4c96('0xa2'));_0x8da47c['field']('o.fullname','Owner.fullname');_0x8da47c[_0x4c96('0x46')](_0x4c96('0xa3'),_0x4c96('0xa4'));_0x8da47c[_0x4c96('0x46')](_0x4c96('0xa5'),'TagIds');}if(_0x27bbbc['limit'])_0x8da47c[_0x4c96('0x20')](_0x27bbbc[_0x4c96('0x20')]);if(_0x27bbbc[_0x4c96('0x1e')])_0x8da47c['offset'](_0x27bbbc[_0x4c96('0x1e')]);return db[_0x4c96('0xa6')][_0x4c96('0x39')](_0x8da47c[_0x4c96('0x94')](),_0x55420a);})['then'](function(_0x1dd30e){if(_0x1dd30e[_0x4c96('0x5d')]>0x0)_0x3f45a2[_0x4c96('0x43')](_0x4c96('0xa7'),_[_0x4c96('0x2c')](_0x1dd30e,'id'));return db[_0x4c96('0xa6')]['query'](_0x3f45a2['toString'](),_0x55420a)['then'](function(_0x247a1d){var _0x3beffa=_[_0x4c96('0xa8')](_0x247a1d,_0x4c96('0xa9'));var _0x309f79=[];_0x1dd30e[_0x4c96('0x31')](function(_0x3744ec){_0x309f79[_0x4c96('0x32')](updateWhatsappInteraction(_0x3744ec,_0x43311f,_0x3beffa));});return BPromise[_0x4c96('0xaa')](_0x309f79);});});})[_0x4c96('0x26')](function(_0x344145){_0x11bb1a[_0x4c96('0xab')]=_0x344145;return _0x11bb1a;})[_0x4c96('0x26')](respondWithFilteredResult(_0x5e2f8a,_0x27bbbc))['catch'](handleError(_0x5e2f8a,null));};exports[_0x4c96('0xac')]=function(_0x142505,_0x452168){var _0x113524={'raw':![],'where':{'id':_0x142505[_0x4c96('0xad')]['id']}},_0x55cdc9={};_0x55cdc9[_0x4c96('0x38')]=_['keys'](db[_0x4c96('0x33')][_0x4c96('0x34')]);_0x55cdc9['query']=_[_0x4c96('0x3a')](_0x142505[_0x4c96('0x39')]);_0x55cdc9['filters']=_[_0x4c96('0x3c')](_0x55cdc9['model'],_0x55cdc9[_0x4c96('0x39')]);_0x113524[_0x4c96('0x3e')]=_['intersection'](_0x55cdc9[_0x4c96('0x38')],qs[_0x4c96('0x3d')](_0x142505[_0x4c96('0x39')][_0x4c96('0x3d')]));_0x113524[_0x4c96('0x3e')]=_0x113524[_0x4c96('0x3e')][_0x4c96('0x5d')]?_0x113524[_0x4c96('0x3e')]:_0x55cdc9[_0x4c96('0x38')];if(_0x142505[_0x4c96('0x39')][_0x4c96('0xae')]){_0x113524[_0x4c96('0xaf')]=[{'all':!![]}];}_0x113524=_[_0x4c96('0xb0')]({},_0x113524,_0x142505[_0x4c96('0xb1')]);return db[_0x4c96('0x33')]['find'](_0x113524)['then'](handleEntityNotFound(_0x452168,null))[_0x4c96('0x26')](respondWithResult(_0x452168,null))[_0x4c96('0xb2')](handleError(_0x452168,null));};exports[_0x4c96('0xb3')]=function(_0x2f6a2c,_0x1a4755){return db[_0x4c96('0x33')][_0x4c96('0xb3')](_0x2f6a2c[_0x4c96('0x71')],{})[_0x4c96('0x26')](respondWithResult(_0x1a4755,0xc9))[_0x4c96('0xb2')](handleError(_0x1a4755,null));};exports['update']=function(_0xd6b414,_0x5bb21f){if(_0xd6b414[_0x4c96('0x71')]['id']){delete _0xd6b414[_0x4c96('0x71')]['id'];}return db[_0x4c96('0x33')]['find']({'where':{'id':_0xd6b414[_0x4c96('0xad')]['id']}})[_0x4c96('0x26')](handleEntityNotFound(_0x5bb21f,null))[_0x4c96('0x26')](saveUpdates(_0xd6b414[_0x4c96('0x71')],null))[_0x4c96('0x26')](respondWithResult(_0x5bb21f,null))[_0x4c96('0xb2')](handleError(_0x5bb21f,null));};exports['destroy']=function(_0x196f05,_0x2d4082){return db[_0x4c96('0x33')][_0x4c96('0x5e')]({'where':{'id':_0x196f05['params']['id']}})['then'](handleEntityNotFound(_0x2d4082,null))[_0x4c96('0x26')](removeEntity(_0x2d4082,null))[_0x4c96('0xb2')](handleError(_0x2d4082,null));};exports[_0x4c96('0xb4')]=function(_0x319850,_0x575138){return db[_0x4c96('0x33')][_0x4c96('0xb4')]()[_0x4c96('0x26')](respondWithResult(_0x575138,null))[_0x4c96('0xb2')](handleError(_0x575138,null));};exports['addMessage']=function(_0x5f5be0,_0x3f2c6a,_0x16100f){return db['WhatsappMessage'][_0x4c96('0x5e')]({'where':{'id':_0x5f5be0['params']['id']}})[_0x4c96('0x26')](handleEntityNotFound(_0x3f2c6a,null))[_0x4c96('0x26')](function(_0x1afa23){if(_0x1afa23){return _0x1afa23['addMessage'](_0x5f5be0[_0x4c96('0x71')][_0x4c96('0xb5')],_['omit'](_0x5f5be0[_0x4c96('0x71')],[_0x4c96('0xb5'),'id'])||{});}})[_0x4c96('0x26')](respondWithResult(_0x3f2c6a,null))[_0x4c96('0xb2')](handleError(_0x3f2c6a,null));};exports[_0x4c96('0xb6')]=function(_0x5cc615,_0x5f0f69,_0x7b7cb5){var _0x112d57={'raw':![],'where':{}};var _0x1696b0={};var _0xfb66ec={'count':0x0,'rows':[]};return db[_0x4c96('0x33')][_0x4c96('0xb7')]({'where':{'id':_0x5cc615[_0x4c96('0xad')]['id']}})[_0x4c96('0x26')](handleEntityNotFound(_0x5f0f69,null))[_0x4c96('0x26')](function(_0x416314){if(_0x416314){_0x1696b0[_0x4c96('0x38')]=_['keys'](db[_0x4c96('0xb8')][_0x4c96('0x34')]);_0x1696b0[_0x4c96('0x39')]=_[_0x4c96('0x3a')](_0x5cc615['query']);_0x1696b0['filters']=_[_0x4c96('0x3c')](_0x1696b0[_0x4c96('0x38')],_0x1696b0[_0x4c96('0x39')]);_0x112d57[_0x4c96('0x3e')]=_[_0x4c96('0x3c')](_0x1696b0[_0x4c96('0x38')],qs['fields'](_0x5cc615[_0x4c96('0x39')][_0x4c96('0x3d')]));_0x112d57[_0x4c96('0x3e')]=_0x112d57[_0x4c96('0x3e')]['length']?_0x112d57['attributes']:_0x1696b0['model'];if(!_0x5cc615[_0x4c96('0x39')][_0x4c96('0x3f')](_0x4c96('0x40'))){_0x112d57['limit']=qs[_0x4c96('0x20')](_0x5cc615[_0x4c96('0x39')]['limit']);_0x112d57[_0x4c96('0x1e')]=qs['offset'](_0x5cc615[_0x4c96('0x39')]['offset']);}_0x112d57[_0x4c96('0x41')]=qs[_0x4c96('0x42')](_0x5cc615[_0x4c96('0x39')][_0x4c96('0x42')]);_0x112d57[_0x4c96('0x43')]=qs[_0x4c96('0x3b')](_['pick'](_0x5cc615[_0x4c96('0x39')],_0x1696b0[_0x4c96('0x3b')]));_0x112d57['where']['WhatsappInteractionId']=_0x416314['id'];if(_0x5cc615[_0x4c96('0x39')]['filter']){_0x112d57[_0x4c96('0x43')]=_[_0x4c96('0xb0')](_0x112d57[_0x4c96('0x43')],{'$or':_[_0x4c96('0x2c')](_0x112d57[_0x4c96('0x3e')],function(_0x2d1803){var _0xbbe11={};_0xbbe11[_0x2d1803]={'$like':'%'+_0x5cc615[_0x4c96('0x39')][_0x4c96('0x80')]+'%'};return _0xbbe11;})});}if(_0x5cc615['query'][_0x4c96('0x77')]){var _0x3ec633=_0x5cc615[_0x4c96('0x39')][_0x4c96('0x77')][_0x4c96('0x30')](',');var _0x2bdbb0={};_0x2bdbb0[_0x3ec633[0x0]]={'$gte':moment(_0x3ec633[0x1])[_0x4c96('0xb9')](_0x4c96('0xba'))};_0x112d57[_0x4c96('0x43')]=_[_0x4c96('0xb0')](_0x112d57[_0x4c96('0x43')],_0x2bdbb0);}_0x112d57=_[_0x4c96('0xb0')]({},_0x112d57,_0x5cc615[_0x4c96('0xb1')]);return db['WhatsappMessage'][_0x4c96('0x21')]({'where':_0x112d57[_0x4c96('0x43')]})[_0x4c96('0x26')](function(_0x40b229){_0xfb66ec[_0x4c96('0x21')]=_0x40b229;if(_0x5cc615[_0x4c96('0x39')][_0x4c96('0xae')]){_0x112d57[_0x4c96('0xaf')]=[{'all':!![]}];}return db[_0x4c96('0xb8')][_0x4c96('0xbb')](_0x112d57);})['then'](function(_0x799fd){_0xfb66ec[_0x4c96('0xab')]=_0x799fd;return _0xfb66ec;});}})[_0x4c96('0x26')](respondWithFilteredResult(_0x5f0f69,_0x112d57))[_0x4c96('0xb2')](handleError(_0x5f0f69,null));};exports[_0x4c96('0xbc')]=function(_0x4c1177,_0x46f87d,_0x3f7b25){return db[_0x4c96('0x33')][_0x4c96('0x5e')]({'where':{'id':_0x4c1177[_0x4c96('0xad')]['id']}})[_0x4c96('0x26')](handleEntityNotFound(_0x46f87d,null))[_0x4c96('0x26')](function(_0x398af4){if(_0x398af4){return _0x398af4[_0x4c96('0xbd')](_0x4c1177['body']['ids'],_[_0x4c96('0xbe')](_0x4c1177[_0x4c96('0x71')],[_0x4c96('0xb5'),'id'])||{})['spread'](function(){return db[_0x4c96('0x6c')][_0x4c96('0xbb')]({'attributes':['id',_0x4c96('0x29'),_0x4c96('0x47')],'where':{'id':_0x4c1177[_0x4c96('0x71')][_0x4c96('0xb5')]}});})['then'](function(_0x49000e){socket[_0x4c96('0xbf')](_0x4c96('0xc0'),{'id':Number(_0x4c1177['params']['id']),'tags':_0x49000e||[]});return{'id':Number(_0x4c1177[_0x4c96('0xad')]['id']),'tags':_0x49000e||[]};});}})[_0x4c96('0x26')](respondWithResult(_0x46f87d,null))['catch'](handleError(_0x46f87d,null));};exports[_0x4c96('0xc1')]=function(_0x118020,_0x94b53d,_0xad3a74){return db[_0x4c96('0x33')]['find']({'where':{'id':_0x118020[_0x4c96('0xad')]['id']}})['then'](handleEntityNotFound(_0x94b53d,null))[_0x4c96('0x26')](function(_0x22a937){if(_0x22a937){return _0x22a937[_0x4c96('0xc1')](_0x118020[_0x4c96('0x39')][_0x4c96('0xb5')]);}})[_0x4c96('0x26')](respondWithStatusCode(_0x94b53d,null))['catch'](handleError(_0x94b53d,null));};exports[_0x4c96('0xc2')]=function(_0x47adfc,_0x3efe6b){var _0x13957e=moment()[_0x4c96('0xc3')]()[_0x4c96('0x94')]();var _0x3c269e=path[_0x4c96('0xc4')](config[_0x4c96('0xc5')],_0x4c96('0xc6'),_0x4c96('0xc7'),_0x4c96('0xc8'));var _0x5d9687=path[_0x4c96('0xc4')](config[_0x4c96('0xc5')],'server',_0x4c96('0xc7'),_0x4c96('0xc9'));var _0x142788=path[_0x4c96('0xc4')](_0x3c269e,_0x13957e);var _0x4ad887=util['format'](_0x4c96('0xca'),_0x47adfc[_0x4c96('0xad')]['id'],_0x13957e);var _0x462716=path['join'](_0x3c269e,_0x4ad887);var _0x62c66a=[];_0x62c66a[_0x4c96('0x32')]({'model':db['User'],'as':_0x4c96('0x6e'),'attributes':['id','fullname'],'raw':!![]});_0x62c66a[_0x4c96('0x32')]({'model':db[_0x4c96('0xcb')],'as':_0x4c96('0x63'),'attributes':['id',_0x4c96('0xcc'),_0x4c96('0xcd')],'raw':!![]});if(_0x47adfc[_0x4c96('0x39')][_0x4c96('0xc9')]){_0x62c66a[_0x4c96('0x32')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1c9ece=[{'model':db[_0x4c96('0xb8')],'as':_0x4c96('0xce'),'attributes':['id',_0x4c96('0x71'),_0x4c96('0x75'),_0x4c96('0xcf'),_0x4c96('0xd0'),_0x4c96('0x7c')],'include':_0x62c66a}];_0x1c9ece['push']({'model':db['WhatsappAccount'],'as':_0x4c96('0xd1'),'attributes':['id',_0x4c96('0x29')]});_0x1c9ece[_0x4c96('0x32')]({'model':db[_0x4c96('0x6e')],'as':'Owner','attributes':['id',_0x4c96('0x2d')]});return db['WhatsappInteraction'][_0x4c96('0x5e')]({'where':{'id':_0x47adfc[_0x4c96('0xad')]['id']},'include':_0x1c9ece})[_0x4c96('0x26')](handleEntityNotFound(_0x3efe6b,null))['then'](function(_0x534ee){if(_0x534ee){var _0x17b926=_0x534ee[_0x4c96('0xd2')]({'plain':!![]});fs[_0x4c96('0xd3')](_0x142788);var _0x1d283f={'channel':_0x4c96('0xd4'),'account':_0x17b926[_0x4c96('0xd1')][_0x4c96('0x29')],'agent':_0x17b926[_0x4c96('0xd5')]?_0x17b926[_0x4c96('0xd5')][_0x4c96('0x2d')]:'N.A.','createdAt':moment(_0x17b926[_0x4c96('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4c96('0x94')](),'closedAt':_0x17b926[_0x4c96('0xd6')]?moment(_0x17b926[_0x4c96('0xd7')])[_0x4c96('0xb9')](_0x4c96('0xba'))[_0x4c96('0x94')]():'','disposition':_0x17b926['disposition'],'messages':_(_0x17b926[_0x4c96('0xce')])['filter']({'secret':![]})[_0x4c96('0x2c')](function(_0x296329){if(_0x296329[_0x4c96('0xd8')]){var _0x567931=path['join'](_0x5d9687,_0x296329['Attachment'][_0x4c96('0xd9')]);if(fs[_0x4c96('0xda')](_0x567931)){fs[_0x4c96('0xdb')](_0x567931)[_0x4c96('0xdc')](fs[_0x4c96('0xdd')](path['join'](_0x142788,_0x296329[_0x4c96('0xd8')][_0x4c96('0xd9')])));}}return{'date':moment(_0x296329[_0x4c96('0x75')])[_0x4c96('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4c96('0x94')](),'sender':_0x296329[_0x4c96('0xcf')]==='out'?_0x296329[_0x4c96('0x6e')]?_0x296329[_0x4c96('0x6e')][_0x4c96('0x2d')]:_0x4c96('0xde'):_0x296329[_0x4c96('0x63')][_0x4c96('0xcc')]+(_0x296329[_0x4c96('0x63')]['lastName']?'\x20'+_0x296329[_0x4c96('0x63')][_0x4c96('0xcd')]:''),'body':_0x296329[_0x4c96('0xd8')]?_0x296329[_0x4c96('0xd8')][_0x4c96('0xd9')]:_0x296329[_0x4c96('0x71')],'direction':_0x296329[_0x4c96('0xcf')]===_0x4c96('0xdf')?'A':'C','secret':_0x296329[_0x4c96('0xd0')],'read':_0x296329[_0x4c96('0x7c')],'attachment':_0x296329[_0x4c96('0xd8')]};})[_0x4c96('0x60')]()};return ejs['renderFile'](path[_0x4c96('0xc4')](config[_0x4c96('0xc5')],'server',_0x4c96('0xe0'),'downloadInteraction.ejs'),{'interaction':_0x1d283f})[_0x4c96('0x26')](function(_0x497993){var _0x560ca3=path[_0x4c96('0xc4')](_0x142788,_0x4c96('0xe1')+_0x17b926['id']+'-'+_0x13957e+'.pdf');var _0x11cb45={'path':_0x560ca3,'channel':_0x4c96('0xd4'),'interactionId':_0x17b926['id']};return pdf[_0x4c96('0xe2')](_0x497993,_0x11cb45);})[_0x4c96('0x26')](function(){return new BPromise(function(_0x217cc7,_0x19556a){zipdir(_0x142788,{'saveTo':_0x462716},function(_0x37579f,_0x1516d1){if(_0x37579f)return _0x19556a(_0x37579f);return _0x217cc7(_0x1516d1);});})[_0x4c96('0x26')](function(){return new BPromise(function(_0x1f0f4e,_0x1fd174){rimraf(_0x142788,function(_0x2ffa9e){if(_0x2ffa9e)_0x1fd174(_0x2ffa9e);return _0x1f0f4e();});});})['then'](function(){return _0x3efe6b[_0x4c96('0xc2')](_0x462716,_0x4ad887,function(_0x1ca80e){if(_0x1ca80e){console[_0x4c96('0xe3')](_0x4c96('0xe4'),_0x1ca80e);}else{fs[_0x4c96('0xe5')](_0x462716);}});});});}else{return _0x3efe6b[_0x4c96('0x1a')](0xc8);}})[_0x4c96('0xb2')](handleError(_0x3efe6b,null));}; \ No newline at end of file +var _0x0911=['type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','field','color','from','tools_tags','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','whatsapp_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','WhatsappAccountId','where','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','sequelize','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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.lastName','Contact.lastName','c.phone','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','WhatsappMessage','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Contact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','Users','fullname','TagIds','Tags','forEach','push','catch','index','map','WhatsappInteraction','rawAttributes','fieldName'];(function(_0x40faf4,_0x2fb96){var _0x1a43df=function(_0x1a3c08){while(--_0x1a3c08){_0x40faf4['push'](_0x40faf4['shift']());}};_0x1a43df(++_0x2fb96);}(_0x0911,0x1a9));var _0x1091=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x0911[_0x43dc7e];return _0x21e12d;};'use strict';var emlformat=require(_0x1091('0x0'));var rimraf=require(_0x1091('0x1'));var zipdir=require(_0x1091('0x2'));var jsonpatch=require(_0x1091('0x3'));var rp=require(_0x1091('0x4'));var moment=require('moment');var BPromise=require(_0x1091('0x5'));var Mustache=require('mustache');var util=require(_0x1091('0x6'));var path=require(_0x1091('0x7'));var sox=require(_0x1091('0x8'));var csv=require(_0x1091('0x9'));var ejs=require(_0x1091('0xa'));var fs=require('fs');var fs_extra=require(_0x1091('0xb'));var _=require(_0x1091('0xc'));var squel=require(_0x1091('0xd'));var crypto=require(_0x1091('0xe'));var jsforce=require(_0x1091('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1091('0x9'));var querystring=require(_0x1091('0x10'));var Papa=require(_0x1091('0x11'));var Redis=require(_0x1091('0x12'));var authService=require(_0x1091('0x13'));var qs=require(_0x1091('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1091('0x15'));var hardwareService=require(_0x1091('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1091('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1091('0x18'));var db=require('../../mysqldb')['db'];config[_0x1091('0x19')]=_[_0x1091('0x1a')](config[_0x1091('0x19')],{'host':_0x1091('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1091('0x19')]));require(_0x1091('0x1c'))['register'](socket);function respondWithStatusCode(_0x5815db,_0x5bb24c){_0x5bb24c=_0x5bb24c||0xcc;return function(_0x5c3b99){if(_0x5c3b99){return _0x5815db[_0x1091('0x1d')](_0x5bb24c);}return _0x5815db[_0x1091('0x1e')](_0x5bb24c)[_0x1091('0x1f')]();};}function respondWithResult(_0x58c366,_0x2a21ed){_0x2a21ed=_0x2a21ed||0xc8;return function(_0xf69de4){if(_0xf69de4){return _0x58c366[_0x1091('0x1e')](_0x2a21ed)[_0x1091('0x20')](_0xf69de4);}};}function respondWithFilteredResult(_0x14f787,_0x5c01c3){return function(_0x841623){if(_0x841623){var _0x46e3d5=typeof _0x5c01c3[_0x1091('0x21')]===_0x1091('0x22')&&typeof _0x5c01c3[_0x1091('0x23')]==='undefined';var _0x2d9a4a=_0x841623[_0x1091('0x24')];var _0x5bd10d=_0x46e3d5?0x0:_0x5c01c3['offset'];var _0x4bbf0b=_0x46e3d5?_0x841623[_0x1091('0x24')]:_0x5c01c3[_0x1091('0x21')]+_0x5c01c3[_0x1091('0x23')];var _0x2f84d2;if(_0x4bbf0b>=_0x2d9a4a){_0x4bbf0b=_0x2d9a4a;_0x2f84d2=0xc8;}else{_0x2f84d2=0xce;}_0x14f787[_0x1091('0x1e')](_0x2f84d2);return _0x14f787[_0x1091('0x25')](_0x1091('0x26'),_0x5bd10d+'-'+_0x4bbf0b+'/'+_0x2d9a4a)[_0x1091('0x20')](_0x841623);}return null;};}function patchUpdates(_0x3daff2){return function(_0x12691c){try{jsonpatch[_0x1091('0x27')](_0x12691c,_0x3daff2,!![]);}catch(_0x197355){return BPromise[_0x1091('0x28')](_0x197355);}return _0x12691c[_0x1091('0x29')]();};}function saveUpdates(_0xffe7a6,_0x371f83){return function(_0x5778d5){if(_0x5778d5){return _0x5778d5[_0x1091('0x2a')](_0xffe7a6)[_0x1091('0x2b')](function(_0x266d34){return _0x266d34;});}return null;};}function removeEntity(_0x5a4886,_0x2a74cc){return function(_0x598216){if(_0x598216){return _0x598216[_0x1091('0x2c')]()[_0x1091('0x2b')](function(){_0x5a4886[_0x1091('0x1e')](0xcc)[_0x1091('0x1f')]();});}};}function handleEntityNotFound(_0x515c10,_0xf92795){return function(_0x28343b){if(!_0x28343b){_0x515c10[_0x1091('0x1d')](0x194);}return _0x28343b;};}function handleError(_0x31d65b,_0x17e118){_0x17e118=_0x17e118||0x1f4;return function(_0x40a8b4){logger['error'](_0x40a8b4[_0x1091('0x2d')]);if(_0x40a8b4[_0x1091('0x2e')]){delete _0x40a8b4[_0x1091('0x2e')];}_0x31d65b[_0x1091('0x1e')](_0x17e118)['send'](_0x40a8b4);};}function getInteractionUsers(_0x5d57cf,_0x447f15){return new BPromise(function(_0x2ef4a9,_0xa8d68e){try{if(_0x447f15[_0x5d57cf['id']]){_0x5d57cf[_0x1091('0x2f')]=_['map'](_0x447f15[_0x5d57cf['id']],function(_0x5995ec){return{'id':_0x5995ec['id'],'fullname':_0x5995ec[_0x1091('0x30')]};});}}catch(_0x4feaf7){_0xa8d68e(_0x4feaf7);}_0x2ef4a9(_0x5d57cf);});}function getInteractionTags(_0x55e2d3,_0x109602){return new BPromise(function(_0xc5af40,_0x1b7d04){try{if(_0x55e2d3[_0x1091('0x31')]){_0x55e2d3[_0x1091('0x32')]=[];_0x55e2d3[_0x1091('0x31')]['split'](',')[_0x1091('0x33')](function(_0x123341){_0x55e2d3[_0x1091('0x32')][_0x1091('0x34')](_0x109602[_0x123341]);});}delete _0x55e2d3['TagIds'];}catch(_0x105204){_0x1b7d04(_0x105204);}_0xc5af40(_0x55e2d3);});}function updateWhatsappInteraction(_0x60eaa,_0x4a4d88,_0x2ef1b8){return new BPromise(function(_0x3a2372,_0x3b552e){return getInteractionUsers(_0x60eaa,_0x2ef1b8)['then'](function(_0xe89ec4){return getInteractionTags(_0xe89ec4,_0x4a4d88);})[_0x1091('0x2b')](function(_0x574503){_0x3a2372(_0x574503);})[_0x1091('0x35')](function(_0x3dc598){_0x3b552e(_0x3dc598);});});}exports[_0x1091('0x36')]=function(_0x463243,_0x59287c){var _0x5abc3e={},_0x4759b7={},_0x8ff924={'count':0x0,'rows':[]};var _0x4bb745=_[_0x1091('0x37')](db[_0x1091('0x38')][_0x1091('0x39')],function(_0x5574dd){return{'name':_0x5574dd[_0x1091('0x3a')],'type':_0x5574dd[_0x1091('0x3b')][_0x1091('0x3c')]};});_0x4759b7[_0x1091('0x3d')]=_[_0x1091('0x37')](_0x4bb745,_0x1091('0x2e'));_0x4759b7['query']=_[_0x1091('0x3e')](_0x463243[_0x1091('0x3f')]);_0x4759b7[_0x1091('0x40')]=_['intersection'](_0x4759b7[_0x1091('0x3d')],_0x4759b7[_0x1091('0x3f')]);_0x5abc3e[_0x1091('0x41')]=_[_0x1091('0x42')](_0x4759b7[_0x1091('0x3d')],qs[_0x1091('0x43')](_0x463243[_0x1091('0x3f')]['fields']));_0x5abc3e[_0x1091('0x41')]=_0x5abc3e[_0x1091('0x41')][_0x1091('0x44')]?_0x5abc3e['attributes']:_0x4759b7[_0x1091('0x3d')];if(!_0x463243['query'][_0x1091('0x45')](_0x1091('0x46'))){_0x5abc3e[_0x1091('0x23')]=qs[_0x1091('0x23')](_0x463243[_0x1091('0x3f')][_0x1091('0x23')]);_0x5abc3e[_0x1091('0x21')]=qs['offset'](_0x463243[_0x1091('0x3f')][_0x1091('0x21')]);}_0x5abc3e['order']=qs[_0x1091('0x47')](_0x463243[_0x1091('0x3f')][_0x1091('0x47')]);_0x5abc3e['where']=qs[_0x1091('0x40')](_[_0x1091('0x48')](_0x463243[_0x1091('0x3f')],_0x4759b7[_0x1091('0x40')]),_0x4bb745);var _0x18243c=[];var _0x4bc58d=squel['select']()['field']('id')['field'](_0x1091('0x2e'))[_0x1091('0x49')](_0x1091('0x4a'))[_0x1091('0x4b')](_0x1091('0x4c'));var _0x316ffa=squel[_0x1091('0x4d')]()[_0x1091('0x49')]('u.id')['field'](_0x1091('0x4e'))[_0x1091('0x49')](_0x1091('0x4f'))[_0x1091('0x4b')](_0x1091('0x50'),'ui')['left_join'](_0x1091('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x1a7c22=squel[_0x1091('0x4d')]()[_0x1091('0x4b')](_0x1091('0x52'),'i')[_0x1091('0x53')](_0x1091('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1091('0x53')](_0x1091('0x51'),'o',_0x1091('0x55'))[_0x1091('0x53')](_0x1091('0x56'),'a',_0x1091('0x57'))['left_join'](_0x1091('0x58'),'me',_0x1091('0x59'))[_0x1091('0x53')](_0x1091('0x5a'),'it',_0x1091('0x5b'))[_0x1091('0x53')](_0x1091('0x4c'),'t',_0x1091('0x5c'));var _0xc77cee=squel[_0x1091('0x5d')]();var _0x2d5bc3=[];var _0x20163f=squel[_0x1091('0x5d')]();var _0x33816a;if(_0x463243[_0x1091('0x3f')][_0x1091('0x5e')]){_0x33816a=as[_0x1091('0x5f')](_0x463243[_0x1091('0x3f')][_0x1091('0x5e')]);var _0x5575e0=_0x33816a['sqlOperator'];for(var _0xe062cf=0x0;_0xe062cf<_0x33816a[_0x1091('0x60')][_0x1091('0x44')];_0xe062cf++){var _0x127979=_0x33816a[_0x1091('0x60')][_0xe062cf];var _0x540813='i';var _0x3a1d25=_[_0x1091('0x61')](_0x4bb745,[_0x1091('0x2e'),_0x127979[_0x1091('0x49')]]);if(!_0x3a1d25){switch(_0x127979[_0x1091('0x49')]){case'unreadMessages':if(_0x127979[_0x1091('0x62')]==0x1){_0x1a7c22[_0x1091('0x63')]('`'+_0x127979['field']+_0x1091('0x64'));}else{_0x1a7c22['having']('`'+_0x127979['field']+_0x1091('0x65'));}break;case'Contact':if(_0x127979[_0x1091('0x66')]==='$substring'){if(_0x127979[_0x1091('0x62')][_0x1091('0x67')]('\x20')[_0x1091('0x44')]>0x1){_0xc77cee[_0x5575e0](_0x1091('0x68'),qs[_0x1091('0x69')](_0x127979[_0x1091('0x62')]),null);}else{var _0x367cdf='%'+_0x127979[_0x1091('0x62')]+'%';_0xc77cee[_0x5575e0](_0x1091('0x6a'),_0x367cdf,_0x367cdf,_0x367cdf);}}else{_0x3a1d25=_[_0x1091('0x61')](_0x4bb745,[_0x1091('0x2e'),_0x1091('0x6b')]);_0x127979['field']=_0x1091('0x6b');_0x50aeb7=as[_0x1091('0x6c')](_0x540813,_0x3a1d25['type'],_0x127979);_0xc77cee[_0x5575e0](_0x50aeb7[_0x1091('0x6d')],_0x50aeb7['value'][_0x1091('0x6e')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x1f')]);}break;case _0x1091('0x6f'):var _0x1d61fe=_0x127979['value'][_0x1091('0x67')](',')[_0x1091('0x37')](function(_0x4cafb2){return Number(_0x4cafb2);});_0x1d61fe['forEach'](function(_0xd5d410){_0x20163f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd5d410+',%');});_0x2d5bc3=_[_0x1091('0x70')](_0x2d5bc3,_0x1d61fe);break;case _0x1091('0x71'):if(_0x127979[_0x1091('0x66')]===_0x1091('0x72')){_0xc77cee[_0x5575e0](_0x1091('0x73'),'%'+_0x127979['value']+'%',null);}else{_0x3a1d25=_['find'](_0x4bb745,[_0x1091('0x2e'),_0x1091('0x74')]);_0x127979[_0x1091('0x49')]='UserId';_0x50aeb7=as['buildExpression'](_0x540813,_0x3a1d25[_0x1091('0x3b')],_0x127979);_0xc77cee[_0x5575e0](_0x50aeb7[_0x1091('0x6d')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x6e')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x1f')]);}break;case'body':_0x50aeb7=as[_0x1091('0x6c')]('me',null,_0x127979);_0xc77cee[_0x5575e0](_0x50aeb7[_0x1091('0x6d')],_0x50aeb7['value'][_0x1091('0x6e')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x1f')]);break;}}else{var _0x50aeb7=as[_0x1091('0x6c')](_0x540813,_0x3a1d25[_0x1091('0x3b')],_0x127979);_0xc77cee[_0x5575e0](_0x50aeb7[_0x1091('0x6d')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x6e')],_0x50aeb7[_0x1091('0x62')][_0x1091('0x1f')]);}}}else{var _0xdb14c5=_(_0x463243['query'])['keys']()['map'](function(_0x2ea4cd){return _[_0x1091('0x75')](_0x4bb745,[_0x1091('0x2e'),_0x2ea4cd])?_0x2ea4cd:undefined;})[_0x1091('0x76')]()[_0x1091('0x62')]();if(!_[_0x1091('0x77')](_0xdb14c5)){_0xdb14c5[_0x1091('0x33')](function(_0x10c847){if(_0x10c847===_0x1091('0x78')){_0x1a7c22[_0x1091('0x79')]('i.WhatsappAccountId\x20IN\x20?',[][_0x1091('0x7a')](_0x463243[_0x1091('0x3f')][_0x10c847]));}else if(_0x10c847===_0x1091('0x7b')){var _0x293ae8=JSON[_0x1091('0x7c')](_0x463243['query'][_0x10c847])[_0x1091('0x7d')];var _0x296051=JSON[_0x1091('0x7c')](_0x463243[_0x1091('0x3f')][_0x10c847])[_0x1091('0x7e')];_0x1a7c22['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x293ae8,_0x296051);}else{if(_0x463243[_0x1091('0x3f')][_0x10c847]===_0x1091('0x7f')){_0x1a7c22['where']('i.'+_0x10c847+_0x1091('0x80'));}else{_0x1a7c22['where']('i.'+_0x10c847+_0x1091('0x81'),_0x463243[_0x1091('0x3f')][_0x10c847]);}}});}if(_0x463243['query'][_0x1091('0x82')]){if(_0x463243[_0x1091('0x3f')][_0x1091('0x82')]==0x1){_0x1a7c22[_0x1091('0x63')](_0x1091('0x83'));}else{_0x1a7c22[_0x1091('0x63')](_0x1091('0x84'));}}if(_0x463243[_0x1091('0x3f')][_0x1091('0x85')]){_0x2d5bc3=_[_0x1091('0x86')](_0x463243[_0x1091('0x3f')]['tag'])?_0x463243[_0x1091('0x3f')][_0x1091('0x85')]:new Array(_0x463243[_0x1091('0x3f')][_0x1091('0x85')]);_0x2d5bc3[_0x1091('0x33')](function(_0x2f40d5){_0x20163f['or'](_0x1091('0x87'),'%,'+_0x2f40d5+',%');});}if(_0x463243[_0x1091('0x3f')][_0x1091('0x88')]){var _0x128d67=_0x463243[_0x1091('0x3f')][_0x1091('0x88')][_0x1091('0x89')]('\x5c','\x5c\x5c')[_0x1091('0x89')](/'/g,'\x27\x27');if(qs[_0x1091('0x8a')](_0x128d67)){_0xc77cee['or'](_0x1091('0x8b'),_0x128d67+'%')['or']('i.phone\x20LIKE\x20?',_0x128d67+'%');}else{_0xc77cee['or'](_0x1091('0x8c'),qs[_0x1091('0x69')](_0x128d67))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x128d67+'%');}}}_0x1a7c22[_0x1091('0x79')](_0xc77cee);_0x1a7c22['group']('i.id');var _0x4243dd={'type':db[_0x1091('0x8d')][_0x1091('0x8e')][_0x1091('0x8f')],'raw':!![]};var _0x3008c2=_0x1a7c22[_0x1091('0x90')]();_0x3008c2[_0x1091('0x49')](_0x1091('0x91'));_0x3008c2[_0x1091('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5abc3e[_0x1091('0x92')]){_0x5abc3e['order'][_0x1091('0x33')](function(_0x5e12ae){var _0x56399c=_0x5e12ae[0x0]===_0x1091('0x93')?_0x5e12ae[0x0]:'i.'+_0x5e12ae[0x0];_0x1a7c22['order'](_0x56399c,_0x5e12ae[0x1]===_0x1091('0x94')?![]:!![]);});}if(!_[_0x1091('0x77')](_0x2d5bc3)){_0x1a7c22[_0x1091('0x63')](_0x20163f);_0x3008c2[_0x1091('0x79')](_0x1091('0x95'),_0x2d5bc3);}BPromise[_0x1091('0x96')]()[_0x1091('0x2b')](function(){if(!_0x33816a){if(_0x463243[_0x1091('0x3f')][_0x1091('0x78')])return;_0x3008c2[_0x1091('0x79')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1a7c22[_0x1091('0x79')](_0x1091('0x97'));return;}if(_0x463243[_0x1091('0x98')][_0x1091('0x99')]!==_0x1091('0x9a'))return;return _0x463243[_0x1091('0x98')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3c91ea){if(_[_0x1091('0x77')](_0x3c91ea)){_0x3008c2[_0x1091('0x79')](_0x1091('0x9b'));_0x1a7c22[_0x1091('0x79')](_0x1091('0x9b'));}else{_0x3008c2[_0x1091('0x79')](_0x1091('0x9c'),_[_0x1091('0x37')](_0x3c91ea,'id'));_0x1a7c22[_0x1091('0x79')](_0x1091('0x9c'),_[_0x1091('0x37')](_0x3c91ea,'id'));}});})[_0x1091('0x2b')](function(){if(_0x463243[_0x1091('0x98')][_0x1091('0x99')]===_0x1091('0x9a')&&!_0x33816a&&!_0x463243[_0x1091('0x3f')]['WhatsappAccountId'])return[];return db['sequelize'][_0x1091('0x3f')](_0x3008c2[_0x1091('0x9d')](),_0x4243dd);})[_0x1091('0x2b')](function(_0x495ec6){_0x8ff924['count']=_0x495ec6[_0x1091('0x44')];if(_0x8ff924[_0x1091('0x24')]===0x0)return[];return db[_0x1091('0x9e')][_0x1091('0x3f')](_0x4bc58d[_0x1091('0x9d')](),_0x4243dd)[_0x1091('0x2b')](function(_0x4f244f){_0x18243c=_[_0x1091('0x9f')](_0x4f244f,'id');_0x4243dd=_['merge'](_0x4243dd,{'model':db[_0x1091('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x463243[_0x1091('0x3f')][_0x1091('0x43')]){_0x5abc3e[_0x1091('0x41')][_0x1091('0x33')](function(_0x313b37){_0x1a7c22[_0x1091('0x49')]('i.'+_0x313b37);});}else{_0x1a7c22['field'](_0x1091('0xa0'),'unreadMessages');_0x1a7c22[_0x1091('0x49')](_0x1091('0xa1'),_0x1091('0xa2'));_0x1a7c22[_0x1091('0x49')](_0x1091('0xa3'),_0x1091('0xa4'));_0x1a7c22[_0x1091('0x49')](_0x1091('0xa5'),_0x1091('0x93'));_0x1a7c22['field'](_0x1091('0xa6'));_0x1a7c22[_0x1091('0x49')]('c.firstName','Contact.firstName');_0x1a7c22[_0x1091('0x49')](_0x1091('0xa7'),_0x1091('0xa8'));_0x1a7c22[_0x1091('0x49')]('c.email','Contact.email');_0x1a7c22['field'](_0x1091('0xa9'),'Contact.phone');_0x1a7c22[_0x1091('0x49')]('c.mobile',_0x1091('0xaa'));_0x1a7c22[_0x1091('0x49')]('c.fax',_0x1091('0xab'));_0x1a7c22['field']('o.fullname','Owner.fullname');_0x1a7c22[_0x1091('0x49')](_0x1091('0xac'),_0x1091('0xad'));_0x1a7c22[_0x1091('0x49')](_0x1091('0xae'),'TagIds');}if(_0x5abc3e[_0x1091('0x23')])_0x1a7c22[_0x1091('0x23')](_0x5abc3e['limit']);if(_0x5abc3e[_0x1091('0x21')])_0x1a7c22['offset'](_0x5abc3e[_0x1091('0x21')]);return db['sequelize'][_0x1091('0x3f')](_0x1a7c22[_0x1091('0x9d')](),_0x4243dd);})['then'](function(_0x351d9f){if(_0x351d9f['length']>0x0)_0x316ffa['where'](_0x1091('0xaf'),_['map'](_0x351d9f,'id'));return db[_0x1091('0x9e')][_0x1091('0x3f')](_0x316ffa[_0x1091('0x9d')](),_0x4243dd)[_0x1091('0x2b')](function(_0x554660){var _0x1756c0=_[_0x1091('0xb0')](_0x554660,'WhatsappInteractionId');var _0x184679=[];_0x351d9f[_0x1091('0x33')](function(_0x9645cf){_0x184679['push'](updateWhatsappInteraction(_0x9645cf,_0x18243c,_0x1756c0));});return BPromise[_0x1091('0xb1')](_0x184679);});});})[_0x1091('0x2b')](function(_0x120b39){_0x8ff924[_0x1091('0xb2')]=_0x120b39;return _0x8ff924;})['then'](respondWithFilteredResult(_0x59287c,_0x5abc3e))['catch'](handleError(_0x59287c,null));};exports[_0x1091('0xb3')]=function(_0x33a6eb,_0x4f963c){var _0x25822b={'raw':![],'where':{'id':_0x33a6eb[_0x1091('0xb4')]['id']}},_0x270a26={};_0x270a26[_0x1091('0x3d')]=_[_0x1091('0x3e')](db[_0x1091('0x38')]['rawAttributes']);_0x270a26[_0x1091('0x3f')]=_['keys'](_0x33a6eb['query']);_0x270a26[_0x1091('0x40')]=_[_0x1091('0x42')](_0x270a26[_0x1091('0x3d')],_0x270a26['query']);_0x25822b[_0x1091('0x41')]=_[_0x1091('0x42')](_0x270a26[_0x1091('0x3d')],qs['fields'](_0x33a6eb[_0x1091('0x3f')][_0x1091('0x43')]));_0x25822b[_0x1091('0x41')]=_0x25822b[_0x1091('0x41')][_0x1091('0x44')]?_0x25822b[_0x1091('0x41')]:_0x270a26['model'];if(_0x33a6eb[_0x1091('0x3f')][_0x1091('0xb5')]){_0x25822b[_0x1091('0xb6')]=[{'all':!![]}];}_0x25822b=_[_0x1091('0xb7')]({},_0x25822b,_0x33a6eb[_0x1091('0xb8')]);return db[_0x1091('0x38')][_0x1091('0x61')](_0x25822b)[_0x1091('0x2b')](handleEntityNotFound(_0x4f963c,null))[_0x1091('0x2b')](respondWithResult(_0x4f963c,null))['catch'](handleError(_0x4f963c,null));};exports[_0x1091('0xb9')]=function(_0x3ab4fb,_0x11fcc7){return db[_0x1091('0x38')]['create'](_0x3ab4fb[_0x1091('0xba')],{})['then'](respondWithResult(_0x11fcc7,0xc9))['catch'](handleError(_0x11fcc7,null));};exports[_0x1091('0x2a')]=function(_0x3b4947,_0x240fe0){if(_0x3b4947[_0x1091('0xba')]['id']){delete _0x3b4947[_0x1091('0xba')]['id'];}return db[_0x1091('0x38')][_0x1091('0x61')]({'where':{'id':_0x3b4947[_0x1091('0xb4')]['id']}})[_0x1091('0x2b')](handleEntityNotFound(_0x240fe0,null))[_0x1091('0x2b')](saveUpdates(_0x3b4947[_0x1091('0xba')],null))['then'](respondWithResult(_0x240fe0,null))['catch'](handleError(_0x240fe0,null));};exports[_0x1091('0x2c')]=function(_0x1eaf01,_0x3900e9){return db[_0x1091('0x38')][_0x1091('0x61')]({'where':{'id':_0x1eaf01['params']['id']}})[_0x1091('0x2b')](handleEntityNotFound(_0x3900e9,null))[_0x1091('0x2b')](removeEntity(_0x3900e9,null))['catch'](handleError(_0x3900e9,null));};exports['describe']=function(_0x54235a,_0x5d8e34){return db[_0x1091('0x38')][_0x1091('0xbb')]()[_0x1091('0x2b')](respondWithResult(_0x5d8e34,null))[_0x1091('0x35')](handleError(_0x5d8e34,null));};exports[_0x1091('0xbc')]=function(_0x350be4,_0x781bb4,_0x2befa0){return db['WhatsappMessage'][_0x1091('0x61')]({'where':{'id':_0x350be4[_0x1091('0xb4')]['id']}})['then'](handleEntityNotFound(_0x781bb4,null))['then'](function(_0xdfe781){if(_0xdfe781){return _0xdfe781['addMessage'](_0x350be4[_0x1091('0xba')][_0x1091('0xbd')],_[_0x1091('0xbe')](_0x350be4['body'],[_0x1091('0xbd'),'id'])||{});}})[_0x1091('0x2b')](respondWithResult(_0x781bb4,null))['catch'](handleError(_0x781bb4,null));};exports[_0x1091('0xbf')]=function(_0x4c6b84,_0x149719,_0xffdbde){var _0x41c73d={'raw':![],'where':{}};var _0x2223d6={};var _0x117214={'count':0x0,'rows':[]};return db[_0x1091('0x38')][_0x1091('0xc0')]({'where':{'id':_0x4c6b84[_0x1091('0xb4')]['id']}})[_0x1091('0x2b')](handleEntityNotFound(_0x149719,null))[_0x1091('0x2b')](function(_0x283666){if(_0x283666){_0x2223d6[_0x1091('0x3d')]=_[_0x1091('0x3e')](db['WhatsappMessage'][_0x1091('0x39')]);_0x2223d6[_0x1091('0x3f')]=_[_0x1091('0x3e')](_0x4c6b84[_0x1091('0x3f')]);_0x2223d6['filters']=_[_0x1091('0x42')](_0x2223d6['model'],_0x2223d6['query']);_0x41c73d[_0x1091('0x41')]=_[_0x1091('0x42')](_0x2223d6[_0x1091('0x3d')],qs['fields'](_0x4c6b84[_0x1091('0x3f')][_0x1091('0x43')]));_0x41c73d[_0x1091('0x41')]=_0x41c73d['attributes'][_0x1091('0x44')]?_0x41c73d[_0x1091('0x41')]:_0x2223d6[_0x1091('0x3d')];if(!_0x4c6b84['query']['hasOwnProperty'](_0x1091('0x46'))){_0x41c73d['limit']=qs['limit'](_0x4c6b84['query'][_0x1091('0x23')]);_0x41c73d['offset']=qs[_0x1091('0x21')](_0x4c6b84['query'][_0x1091('0x21')]);}_0x41c73d[_0x1091('0x92')]=qs[_0x1091('0x47')](_0x4c6b84[_0x1091('0x3f')][_0x1091('0x47')]);_0x41c73d['where']=qs[_0x1091('0x40')](_[_0x1091('0x48')](_0x4c6b84[_0x1091('0x3f')],_0x2223d6[_0x1091('0x40')]));_0x41c73d[_0x1091('0x79')][_0x1091('0xc1')]=_0x283666['id'];if(_0x4c6b84['query'][_0x1091('0x88')]){_0x41c73d['where']=_[_0x1091('0xb7')](_0x41c73d[_0x1091('0x79')],{'$or':_[_0x1091('0x37')](_0x41c73d[_0x1091('0x41')],function(_0x1ee1c1){var _0x3caf77={};_0x3caf77[_0x1ee1c1]={'$like':'%'+_0x4c6b84[_0x1091('0x3f')][_0x1091('0x88')]+'%'};return _0x3caf77;})});}if(_0x4c6b84[_0x1091('0x3f')][_0x1091('0x7d')]){var _0x54a228=_0x4c6b84[_0x1091('0x3f')][_0x1091('0x7d')]['split'](',');var _0x337de7={};_0x337de7[_0x54a228[0x0]]={'$gte':moment(_0x54a228[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x41c73d[_0x1091('0x79')]=_['merge'](_0x41c73d[_0x1091('0x79')],_0x337de7);}_0x41c73d=_[_0x1091('0xb7')]({},_0x41c73d,_0x4c6b84['options']);return db[_0x1091('0xc2')][_0x1091('0x24')]({'where':_0x41c73d[_0x1091('0x79')]})[_0x1091('0x2b')](function(_0x2287c6){_0x117214['count']=_0x2287c6;if(_0x4c6b84['query'][_0x1091('0xb5')]){_0x41c73d[_0x1091('0xb6')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x41c73d);})[_0x1091('0x2b')](function(_0x28d255){_0x117214[_0x1091('0xb2')]=_0x28d255;return _0x117214;});}})[_0x1091('0x2b')](respondWithFilteredResult(_0x149719,_0x41c73d))[_0x1091('0x35')](handleError(_0x149719,null));};exports[_0x1091('0xc3')]=function(_0x434d62,_0x208d6e,_0x224cec){return db[_0x1091('0x38')][_0x1091('0x61')]({'where':{'id':_0x434d62['params']['id']}})['then'](handleEntityNotFound(_0x208d6e,null))['then'](function(_0x2667c7){if(_0x2667c7){return _0x2667c7[_0x1091('0xc4')](_0x434d62[_0x1091('0xba')]['ids'],_[_0x1091('0xbe')](_0x434d62[_0x1091('0xba')],[_0x1091('0xbd'),'id'])||{})[_0x1091('0xc5')](function(){return db[_0x1091('0x6f')][_0x1091('0xc6')]({'attributes':['id',_0x1091('0x2e'),'color'],'where':{'id':_0x434d62['body'][_0x1091('0xbd')]}});})[_0x1091('0x2b')](function(_0x305185){socket[_0x1091('0xc7')](_0x1091('0xc8'),{'id':Number(_0x434d62[_0x1091('0xb4')]['id']),'tags':_0x305185||[]});return{'id':Number(_0x434d62[_0x1091('0xb4')]['id']),'tags':_0x305185||[]};});}})[_0x1091('0x2b')](respondWithResult(_0x208d6e,null))[_0x1091('0x35')](handleError(_0x208d6e,null));};exports[_0x1091('0xc9')]=function(_0x2375b1,_0x3cdee6,_0x23d49c){return db[_0x1091('0x38')]['find']({'where':{'id':_0x2375b1[_0x1091('0xb4')]['id']}})[_0x1091('0x2b')](handleEntityNotFound(_0x3cdee6,null))[_0x1091('0x2b')](function(_0x268886){if(_0x268886){return _0x268886['removeTags'](_0x2375b1[_0x1091('0x3f')][_0x1091('0xbd')]);}})[_0x1091('0x2b')](respondWithStatusCode(_0x3cdee6,null))[_0x1091('0x35')](handleError(_0x3cdee6,null));};exports[_0x1091('0xca')]=function(_0x245ba3,_0x21ea31){var _0x39ded6=moment()[_0x1091('0xcb')]()[_0x1091('0x9d')]();var _0x446139=path['join'](config[_0x1091('0xcc')],_0x1091('0xcd'),_0x1091('0xce'),_0x1091('0xcf'));var _0x1eb932=path[_0x1091('0xd0')](config[_0x1091('0xcc')],_0x1091('0xcd'),_0x1091('0xce'),_0x1091('0xd1'));var _0xdbd11=path[_0x1091('0xd0')](_0x446139,_0x39ded6);var _0x41faad=util[_0x1091('0xd2')](_0x1091('0xd3'),_0x245ba3[_0x1091('0xb4')]['id'],_0x39ded6);var _0x3f8f51=path['join'](_0x446139,_0x41faad);var _0x20dfe0=[];_0x20dfe0[_0x1091('0x34')]({'model':db[_0x1091('0x71')],'as':_0x1091('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x20dfe0[_0x1091('0x34')]({'model':db['CmContact'],'as':_0x1091('0xd4'),'attributes':['id','firstName',_0x1091('0xd5')],'raw':!![]});if(_0x245ba3[_0x1091('0x3f')]['attachments']){_0x20dfe0[_0x1091('0x34')]({'model':db['Attachment'],'as':_0x1091('0xd6'),'raw':!![]});}var _0x42ee92=[{'model':db[_0x1091('0xc2')],'as':'Messages','attributes':['id',_0x1091('0xba'),_0x1091('0x7b'),_0x1091('0xd7'),_0x1091('0xd8'),_0x1091('0x82')],'include':_0x20dfe0}];_0x42ee92[_0x1091('0x34')]({'model':db[_0x1091('0xd9')],'as':_0x1091('0xda'),'attributes':['id','name']});_0x42ee92[_0x1091('0x34')]({'model':db['User'],'as':_0x1091('0xdb'),'attributes':['id',_0x1091('0x30')]});return db[_0x1091('0x38')][_0x1091('0x61')]({'where':{'id':_0x245ba3['params']['id']},'include':_0x42ee92})[_0x1091('0x2b')](handleEntityNotFound(_0x21ea31,null))[_0x1091('0x2b')](function(_0x290a1e){if(_0x290a1e){var _0x94d66=_0x290a1e[_0x1091('0xdc')]({'plain':!![]});fs[_0x1091('0xdd')](_0xdbd11);var _0xa42a4f={'channel':_0x1091('0xde'),'account':_0x94d66[_0x1091('0xda')][_0x1091('0x2e')],'agent':_0x94d66[_0x1091('0xdb')]?_0x94d66[_0x1091('0xdb')]['fullname']:_0x1091('0xdf'),'createdAt':moment(_0x94d66['createdAt'])['format'](_0x1091('0xe0'))[_0x1091('0x9d')](),'closedAt':_0x94d66['closed']?moment(_0x94d66[_0x1091('0xe1')])['format'](_0x1091('0xe0'))[_0x1091('0x9d')]():'','disposition':_0x94d66[_0x1091('0xe2')],'messages':_(_0x94d66['Messages'])[_0x1091('0x88')]({'secret':![]})[_0x1091('0x37')](function(_0x1ba8fc){if(_0x1ba8fc[_0x1091('0xd6')]){var _0x4856d2=path['join'](_0x1eb932,_0x1ba8fc['Attachment']['basename']);if(fs[_0x1091('0xe3')](_0x4856d2)){fs[_0x1091('0xe4')](_0x4856d2)[_0x1091('0xe5')](fs[_0x1091('0xe6')](path['join'](_0xdbd11,_0x1ba8fc[_0x1091('0xd6')][_0x1091('0xe7')])));}}return{'date':moment(_0x1ba8fc[_0x1091('0x7b')])[_0x1091('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1091('0x9d')](),'sender':_0x1ba8fc['direction']===_0x1091('0xe8')?_0x1ba8fc[_0x1091('0x71')]?_0x1ba8fc[_0x1091('0x71')][_0x1091('0x30')]:_0x1091('0xe9'):_0x1ba8fc['Contact'][_0x1091('0xea')]+(_0x1ba8fc['Contact'][_0x1091('0xd5')]?'\x20'+_0x1ba8fc[_0x1091('0xd4')][_0x1091('0xd5')]:''),'body':_0x1ba8fc[_0x1091('0xd6')]?_0x1ba8fc['Attachment'][_0x1091('0xe7')]:_0x1ba8fc[_0x1091('0xba')],'direction':_0x1ba8fc[_0x1091('0xd7')]==='out'?'A':'C','secret':_0x1ba8fc['secret'],'read':_0x1ba8fc[_0x1091('0x82')],'attachment':_0x1ba8fc[_0x1091('0xd6')]};})[_0x1091('0x62')]()};return ejs[_0x1091('0xeb')](path[_0x1091('0xd0')](config[_0x1091('0xcc')],_0x1091('0xcd'),_0x1091('0xec'),_0x1091('0xed')),{'interaction':_0xa42a4f})[_0x1091('0x2b')](function(_0x29683c){var _0x58d26e=path[_0x1091('0xd0')](_0xdbd11,'transcript-'+_0x94d66['id']+'-'+_0x39ded6+_0x1091('0xee'));var _0x4115ed={'path':_0x58d26e,'channel':_0x1091('0xde'),'interactionId':_0x94d66['id']};return pdf[_0x1091('0xef')](_0x29683c,_0x4115ed);})[_0x1091('0x2b')](function(){return new BPromise(function(_0x440c5b,_0x35e967){zipdir(_0xdbd11,{'saveTo':_0x3f8f51},function(_0x3ef3fe,_0xe6ff8f){if(_0x3ef3fe)return _0x35e967(_0x3ef3fe);return _0x440c5b(_0xe6ff8f);});})[_0x1091('0x2b')](function(){return new BPromise(function(_0x35f1fd,_0x441bf7){rimraf(_0xdbd11,function(_0x492386){if(_0x492386)_0x441bf7(_0x492386);return _0x35f1fd();});});})[_0x1091('0x2b')](function(){return _0x21ea31[_0x1091('0xca')](_0x3f8f51,_0x41faad,function(_0x331d12){if(_0x331d12){console[_0x1091('0xf0')](_0x1091('0xf1'),_0x331d12);}else{fs['unlinkSync'](_0x3f8f51);}});});});}else{return _0x21ea31['sendStatus'](0xc8);}})[_0x1091('0x35')](handleError(_0x21ea31,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 8877847..f599689 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 _0x3667=['save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x66af57,_0x1336e5){var _0x3caa2e=function(_0x5aae46){while(--_0x5aae46){_0x66af57['push'](_0x66af57['shift']());}};_0x3caa2e(++_0x1336e5);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7366('0x0'));var WhatsappInteraction=require(_0x7366('0x1'))['db'][_0x7366('0x2')];var WhatsappMessage=require(_0x7366('0x1'))['db'][_0x7366('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7366('0x4'),'afterUpdate':_0x7366('0x5'),'afterDestroy':'remove'};function emitEvent(_0x27726b){return function(_0x22bfc0,_0x1a35f8,_0x1c0cf4){_0x22bfc0[_0x7366('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28f6c8){_0x22bfc0[_0x7366('0x7')](_0x7366('0x8'),_0x28f6c8[_0x7366('0x9')](function(_0x171fe2){return{'id':_0x171fe2['id']};}));return WhatsappMessage[_0x7366('0xa')]({'where':{'WhatsappInteractionId':_0x22bfc0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7366('0xb')](function(_0x417559){_0x22bfc0[_0x7366('0x7')](_0x7366('0xc'),_0x417559[_0x7366('0xd')]);WhatsappInteractionEvents[_0x7366('0xe')](_0x27726b+':'+_0x22bfc0['id'],_0x22bfc0);WhatsappInteractionEvents[_0x7366('0xe')](_0x27726b,_0x22bfc0);_0x1c0cf4(null);})[_0x7366('0xf')](_0x1c0cf4(null));};}for(var e in events){if(events[_0x7366('0x10')](e)){var event=events[e];WhatsappInteraction[_0x7366('0x11')](e,emitEvent(event));}}module[_0x7366('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xfdb5=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xfdb5[_0x20ef64];return _0x3707d8;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var WhatsappInteraction=require(_0x5fdb('0x1'))['db'][_0x5fdb('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x5fdb('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5fdb('0x4')](0x0);var events={'afterCreate':_0x5fdb('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff059){return function(_0x4e6ad9,_0xc837cf,_0x4a2149){_0x4e6ad9[_0x5fdb('0x6')]({'attributes':['id'],'raw':!![]})[_0x5fdb('0x7')](function(_0x4b6fe0){_0x4e6ad9['setDataValue']('Users',_0x4b6fe0[_0x5fdb('0x8')](function(_0x28ad92){return{'id':_0x28ad92['id']};}));return WhatsappMessage[_0x5fdb('0x9')]({'where':{'WhatsappInteractionId':_0x4e6ad9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5fdb('0x7')](function(_0x4034fd){_0x4e6ad9[_0x5fdb('0xa')](_0x5fdb('0xb'),_0x4034fd['length']);WhatsappInteractionEvents[_0x5fdb('0xc')](_0x3ff059+':'+_0x4e6ad9['id'],_0x4e6ad9);WhatsappInteractionEvents['emit'](_0x3ff059,_0x4e6ad9);_0x4a2149(null);})[_0x5fdb('0xd')](_0x4a2149(null));};}for(var e in events){if(events[_0x5fdb('0xe')](e)){var event=events[e];WhatsappInteraction[_0x5fdb('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 897f307..4cc246d 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 _0xe51e=['../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xe51e,0x163));var _0xee51=function(_0x30390a,_0x495bf8){_0x30390a=_0x30390a-0x0;var _0x3fbd37=_0xe51e[_0x30390a];return _0x3fbd37;};'use strict';var _=require(_0xee51('0x0'));var util=require(_0xee51('0x1'));var logger=require(_0xee51('0x2'))(_0xee51('0x3'));var moment=require(_0xee51('0x4'));var BPromise=require(_0xee51('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee51('0x6'));var rimraf=require('rimraf');var config=require(_0xee51('0x7'));var attributes=require(_0xee51('0x8'));module[_0xee51('0x9')]=function(_0x4deb73,_0x100f0d){return _0x4deb73[_0xee51('0xa')](_0xee51('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50a006,_0x55bdbf,_0x1b8de2){if(_0x50a006[_0xee51('0xc')](_0xee51('0xd'))){_0x50a006[_0xee51('0xe')]=moment()[_0xee51('0xf')](_0xee51('0x10'));}_0x1b8de2(null,_0x50a006);}}});}; \ No newline at end of file +var _0x9b6b=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x9b6b,0x9d));var _0xb9b6=function(_0x2fbe8d,_0x1f3ba3){_0x2fbe8d=_0x2fbe8d-0x0;var _0x18939e=_0x9b6b[_0x2fbe8d];return _0x18939e;};'use strict';var _=require('lodash');var util=require(_0xb9b6('0x0'));var logger=require(_0xb9b6('0x1'))(_0xb9b6('0x2'));var moment=require(_0xb9b6('0x3'));var BPromise=require(_0xb9b6('0x4'));var rp=require(_0xb9b6('0x5'));var fs=require('fs');var path=require(_0xb9b6('0x6'));var rimraf=require('rimraf');var config=require(_0xb9b6('0x7'));var attributes=require(_0xb9b6('0x8'));module[_0xb9b6('0x9')]=function(_0x486136,_0x28356e){return _0x486136[_0xb9b6('0xa')](_0xb9b6('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2329e8,_0x4ae90a,_0x28ba63){if(_0x2329e8[_0xb9b6('0xc')](_0xb9b6('0xd'))){_0x2329e8[_0xb9b6('0xe')]=moment()[_0xb9b6('0xf')](_0xb9b6('0x10'));}_0x28ba63(null,_0x2329e8);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 29cb5f4..84c6377 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 _0x11cc=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','stringify','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1834fb,_0x38bfa4){var _0x578b25=function(_0xb3980e){while(--_0xb3980e){_0x1834fb['push'](_0x1834fb['shift']());}};_0x578b25(++_0x38bfa4);}(_0x11cc,0x18f));var _0xc11c=function(_0x4d8b12,_0x29c0a7){_0x4d8b12=_0x4d8b12-0x0;var _0xb889bc=_0x11cc[_0x4d8b12];return _0xb889bc;};'use strict';var _=require(_0xc11c('0x0'));var util=require(_0xc11c('0x1'));var moment=require(_0xc11c('0x2'));var BPromise=require(_0xc11c('0x3'));var rs=require(_0xc11c('0x4'));var fs=require('fs');var Redis=require(_0xc11c('0x5'));var db=require(_0xc11c('0x6'))['db'];var utils=require(_0xc11c('0x7'));var logger=require(_0xc11c('0x8'))('rpc');var config=require(_0xc11c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc11c('0xa')]({'port':0x232a});config[_0xc11c('0xb')]=_[_0xc11c('0xc')](config[_0xc11c('0xb')],{'host':_0xc11c('0xd'),'port':0x18eb});var socket=require(_0xc11c('0xe'))(new Redis(config[_0xc11c('0xb')]));require(_0xc11c('0xf'))[_0xc11c('0x10')](socket);function respondWithRpcPromise(_0x1056b1,_0x37914b,_0x14969b){return new BPromise(function(_0x236917,_0x22314d){return client[_0xc11c('0x11')](_0x1056b1,_0x14969b)[_0xc11c('0x12')](function(_0x2277dd){logger['info'](_0xc11c('0x13'),_0x37914b,_0xc11c('0x14'));logger[_0xc11c('0x15')](_0xc11c('0x16'),_0x37914b,_0xc11c('0x14'),JSON['stringify'](_0x2277dd));if(_0x2277dd[_0xc11c('0x17')]){if(_0x2277dd[_0xc11c('0x17')][_0xc11c('0x18')]===0x1f4){logger[_0xc11c('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x37914b,_0x2277dd[_0xc11c('0x17')]['message']);return _0x22314d(_0x2277dd[_0xc11c('0x17')][_0xc11c('0x19')]);}logger[_0xc11c('0x17')](_0xc11c('0x13'),_0x37914b,_0x2277dd[_0xc11c('0x17')]['message']);return _0x236917(_0x2277dd['error'][_0xc11c('0x19')]);}else{logger[_0xc11c('0x1a')](_0xc11c('0x13'),_0x37914b,_0xc11c('0x14'));_0x236917(_0x2277dd[_0xc11c('0x1b')][_0xc11c('0x19')]);}})['catch'](function(_0x5a0962){logger[_0xc11c('0x17')](_0xc11c('0x13'),_0x37914b,_0x5a0962);_0x22314d(_0x5a0962);});});}exports[_0xc11c('0x1c')]=function(_0x134a20){var _0x1951c8=this;return new Promise(function(_0x5d403f,_0x309dc6){return db[_0xc11c('0x1d')][_0xc11c('0x1e')](_0x134a20[_0xc11c('0x1f')],{'raw':_0x134a20['options']?_0x134a20[_0xc11c('0x20')][_0xc11c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134a20[_0xc11c('0x20')]?_0x134a20[_0xc11c('0x20')][_0xc11c('0x22')]||null:null,'attributes':_0x134a20[_0xc11c('0x20')]?_0x134a20[_0xc11c('0x20')][_0xc11c('0x23')]||null:null,'limit':_0x134a20[_0xc11c('0x20')]?_0x134a20[_0xc11c('0x20')]['limit']||null:null})[_0xc11c('0x12')](function(_0x1d911c){logger[_0xc11c('0x1a')](_0xc11c('0x1c'),_0x134a20);logger[_0xc11c('0x15')](_0xc11c('0x1c'),_0x134a20,JSON[_0xc11c('0x24')](_0x1d911c));_0x5d403f(_0x1d911c);})[_0xc11c('0x25')](function(_0x13ba30){logger[_0xc11c('0x17')](_0xc11c('0x1c'),_0x13ba30[_0xc11c('0x19')],_0x134a20);_0x309dc6(_0x1951c8[_0xc11c('0x17')](0x1f4,_0x13ba30[_0xc11c('0x19')]));});});};exports[_0xc11c('0x26')]=function(_0x122faa){return new Promise(function(_0x5330d2,_0x169d60){return db[_0xc11c('0x1d')][_0xc11c('0x27')]({'where':_0x122faa[_0xc11c('0x20')]?_0x122faa[_0xc11c('0x20')]['where']||null:null})[_0xc11c('0x12')](function(_0x4d76bc){if(_0x4d76bc){return _0x4d76bc[_0xc11c('0x28')](_0x122faa[_0xc11c('0x1f')][_0xc11c('0x29')],_[_0xc11c('0x2a')](_0x122faa[_0xc11c('0x1f')],['ids','id'])||{});}})[_0xc11c('0x2b')](function(_0x5e25c7){logger[_0xc11c('0x1a')](_0xc11c('0x2c'),_0x122faa);logger[_0xc11c('0x15')](_0xc11c('0x2c'),_0x122faa,JSON[_0xc11c('0x24')](_0x5e25c7));_0x5330d2(_0x5e25c7);})[_0xc11c('0x25')](function(_0x2bddad){logger[_0xc11c('0x17')](_0xc11c('0x2c'),_0x2bddad[_0xc11c('0x19')],_0x122faa);_0x169d60(_this[_0xc11c('0x17')](0x1f4,_0x2bddad[_0xc11c('0x19')]));});});}; \ No newline at end of file +var _0xf869=['UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','update','body','options','attributes','limit'];(function(_0xd5a479,_0x20e757){var _0x2c2677=function(_0x4c5c12){while(--_0x4c5c12){_0xd5a479['push'](_0xd5a479['shift']());}};_0x2c2677(++_0x20e757);}(_0xf869,0x151));var _0x9f86=function(_0x35c1db,_0xd75c15){_0x35c1db=_0x35c1db-0x0;var _0x4173ff=_0xf869[_0x35c1db];return _0x4173ff;};'use strict';var _=require(_0x9f86('0x0'));var util=require(_0x9f86('0x1'));var moment=require(_0x9f86('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f86('0x3'));var fs=require('fs');var Redis=require(_0x9f86('0x4'));var db=require(_0x9f86('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9f86('0x6'));var config=require(_0x9f86('0x7'));var jayson=require(_0x9f86('0x8'));var client=jayson[_0x9f86('0x9')][_0x9f86('0xa')]({'port':0x232a});config[_0x9f86('0xb')]=_[_0x9f86('0xc')](config[_0x9f86('0xb')],{'host':_0x9f86('0xd'),'port':0x18eb});var socket=require(_0x9f86('0xe'))(new Redis(config[_0x9f86('0xb')]));require('./whatsappInteraction.socket')[_0x9f86('0xf')](socket);function respondWithRpcPromise(_0x3add53,_0x5ad721,_0xcad65f){return new BPromise(function(_0x471f73,_0x2f557b){return client[_0x9f86('0x10')](_0x3add53,_0xcad65f)[_0x9f86('0x11')](function(_0x384ea0){logger[_0x9f86('0x12')](_0x9f86('0x13'),_0x5ad721,_0x9f86('0x14'));logger[_0x9f86('0x15')](_0x9f86('0x16'),_0x5ad721,_0x9f86('0x14'),JSON[_0x9f86('0x17')](_0x384ea0));if(_0x384ea0[_0x9f86('0x18')]){if(_0x384ea0[_0x9f86('0x18')]['code']===0x1f4){logger[_0x9f86('0x18')](_0x9f86('0x13'),_0x5ad721,_0x384ea0['error']['message']);return _0x2f557b(_0x384ea0[_0x9f86('0x18')][_0x9f86('0x19')]);}logger['error'](_0x9f86('0x13'),_0x5ad721,_0x384ea0[_0x9f86('0x18')][_0x9f86('0x19')]);return _0x471f73(_0x384ea0[_0x9f86('0x18')][_0x9f86('0x19')]);}else{logger['info'](_0x9f86('0x13'),_0x5ad721,_0x9f86('0x14'));_0x471f73(_0x384ea0['result'][_0x9f86('0x19')]);}})[_0x9f86('0x1a')](function(_0x51c2c3){logger[_0x9f86('0x18')](_0x9f86('0x13'),_0x5ad721,_0x51c2c3);_0x2f557b(_0x51c2c3);});});}exports['UpdateWhatsappInteraction']=function(_0x228e4f){var _0x3f8e30=this;return new Promise(function(_0x3267ae,_0x11ce2){return db['WhatsappInteraction'][_0x9f86('0x1b')](_0x228e4f[_0x9f86('0x1c')],{'raw':_0x228e4f[_0x9f86('0x1d')]?_0x228e4f[_0x9f86('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228e4f[_0x9f86('0x1d')]?_0x228e4f[_0x9f86('0x1d')]['where']||null:null,'attributes':_0x228e4f[_0x9f86('0x1d')]?_0x228e4f[_0x9f86('0x1d')][_0x9f86('0x1e')]||null:null,'limit':_0x228e4f['options']?_0x228e4f['options'][_0x9f86('0x1f')]||null:null})[_0x9f86('0x11')](function(_0x2fb28b){logger[_0x9f86('0x12')](_0x9f86('0x20'),_0x228e4f);logger[_0x9f86('0x15')]('UpdateWhatsappInteraction',_0x228e4f,JSON[_0x9f86('0x17')](_0x2fb28b));_0x3267ae(_0x2fb28b);})[_0x9f86('0x1a')](function(_0x4e2d40){logger['error'](_0x9f86('0x20'),_0x4e2d40[_0x9f86('0x19')],_0x228e4f);_0x11ce2(_0x3f8e30['error'](0x1f4,_0x4e2d40[_0x9f86('0x19')]));});});};exports[_0x9f86('0x21')]=function(_0x1fc26b){return new Promise(function(_0x4239c7,_0x5728c3){return db[_0x9f86('0x22')][_0x9f86('0x23')]({'where':_0x1fc26b[_0x9f86('0x1d')]?_0x1fc26b[_0x9f86('0x1d')][_0x9f86('0x24')]||null:null})[_0x9f86('0x11')](function(_0x45e9ca){if(_0x45e9ca){return _0x45e9ca[_0x9f86('0x25')](_0x1fc26b[_0x9f86('0x1c')][_0x9f86('0x26')],_[_0x9f86('0x27')](_0x1fc26b[_0x9f86('0x1c')],[_0x9f86('0x26'),'id'])||{});}})['spread'](function(_0x30c3b0){logger[_0x9f86('0x12')]('AddTags',_0x1fc26b);logger[_0x9f86('0x15')](_0x9f86('0x28'),_0x1fc26b,JSON[_0x9f86('0x17')](_0x30c3b0));_0x4239c7(_0x30c3b0);})[_0x9f86('0x1a')](function(_0x44eebf){logger[_0x9f86('0x18')](_0x9f86('0x28'),_0x44eebf[_0x9f86('0x19')],_0x1fc26b);_0x5728c3(_this[_0x9f86('0x18')](0x1f4,_0x44eebf[_0x9f86('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 136ecd0..b667f28 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 _0x32e0=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x549a09,_0x2fe584){var _0x3ef978=function(_0x245752){while(--_0x245752){_0x549a09['push'](_0x549a09['shift']());}};_0x3ef978(++_0x2fe584);}(_0x32e0,0x16a));var _0x032e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x32e0[_0x40ac5e];return _0x2839d6;};'use strict';var WhatsappInteractionEvents=require(_0x032e('0x0'));var events=[_0x032e('0x1'),_0x032e('0x2'),_0x032e('0x3')];function createListener(_0x26a378,_0x586c24){return function(_0x309b31){_0x586c24[_0x032e('0x4')](_0x26a378,_0x309b31);};}function removeListener(_0x397bbd,_0x1a12fe){return function(){WhatsappInteractionEvents[_0x032e('0x5')](_0x397bbd,_0x1a12fe);};}exports[_0x032e('0x6')]=function(_0x319fb4){for(var _0x578285=0x0,_0x37408e=events[_0x032e('0x7')];_0x578285<_0x37408e;_0x578285++){var _0x549178=events[_0x578285];var _0x331567=createListener(_0x032e('0x8')+_0x549178,_0x319fb4);WhatsappInteractionEvents['on'](_0x549178,_0x331567);}}; \ No newline at end of file +var _0xbbe1=['whatsappInteraction:','./whatsappInteraction.events','save','update','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbe1,0xe1));var _0x1bbe=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xbbe1[_0x57f8c0];return _0x117f08;};'use strict';var WhatsappInteractionEvents=require(_0x1bbe('0x0'));var events=[_0x1bbe('0x1'),'remove',_0x1bbe('0x2')];function createListener(_0x33c183,_0x56475a){return function(_0x4a1826){_0x56475a[_0x1bbe('0x3')](_0x33c183,_0x4a1826);};}function removeListener(_0x5a885a,_0x242cea){return function(){WhatsappInteractionEvents[_0x1bbe('0x4')](_0x5a885a,_0x242cea);};}exports['register']=function(_0x52abb3){for(var _0x4c36ad=0x0,_0x283224=events[_0x1bbe('0x5')];_0x4c36ad<_0x283224;_0x4c36ad++){var _0x1de48b=events[_0x4c36ad];var _0x2fbc29=createListener(_0x1bbe('0x6')+_0x1de48b,_0x52abb3);WhatsappInteractionEvents['on'](_0x1de48b,_0x2fbc29);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 31d959e..7287ba3 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 _0x7bdb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path'];(function(_0x159424,_0x401a52){var _0x1eabe4=function(_0x17a835){while(--_0x17a835){_0x159424['push'](_0x159424['shift']());}};_0x1eabe4(++_0x401a52);}(_0x7bdb,0x69));var _0xb7bd=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x7bdb[_0x3f8282];return _0x50f918;};'use strict';var multer=require(_0xb7bd('0x0'));var util=require(_0xb7bd('0x1'));var path=require(_0xb7bd('0x2'));var timeout=require(_0xb7bd('0x3'));var express=require(_0xb7bd('0x4'));var router=express[_0xb7bd('0x5')]();var fs_extra=require(_0xb7bd('0x6'));var auth=require(_0xb7bd('0x7'));var interaction=require(_0xb7bd('0x8'));var config=require(_0xb7bd('0x9'));var controller=require(_0xb7bd('0xa'));router[_0xb7bd('0xb')]('/',auth[_0xb7bd('0xc')](),controller['index']);router[_0xb7bd('0xb')](_0xb7bd('0xd'),auth['isAuthenticated'](),controller[_0xb7bd('0xe')]);router['get'](_0xb7bd('0xf'),auth[_0xb7bd('0xc')](),controller['show']);router[_0xb7bd('0x10')]('/',auth[_0xb7bd('0xc')](),interaction[_0xb7bd('0x11')]('whatsapp','whatsappmessage:create'),controller['create']);router['post'](_0xb7bd('0x12'),controller[_0xb7bd('0x13')]);router[_0xb7bd('0x14')](_0xb7bd('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xb7bd('0x14')](_0xb7bd('0x15'),auth['isAuthenticated'](),controller[_0xb7bd('0x16')]);router[_0xb7bd('0x14')](_0xb7bd('0x17'),auth[_0xb7bd('0xc')](),controller['reject']);router[_0xb7bd('0x18')](_0xb7bd('0xf'),auth['isAuthenticated'](),controller[_0xb7bd('0x19')]);module[_0xb7bd('0x1a')]=router; \ No newline at end of file +var _0xab24=['reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept'];(function(_0xf28e5d,_0x203020){var _0x293141=function(_0x550544){while(--_0x550544){_0xf28e5d['push'](_0xf28e5d['shift']());}};_0x293141(++_0x203020);}(_0xab24,0x1e4));var _0x4ab2=function(_0x4960c5,_0x34560c){_0x4960c5=_0x4960c5-0x0;var _0x369420=_0xab24[_0x4960c5];return _0x369420;};'use strict';var multer=require(_0x4ab2('0x0'));var util=require('util');var path=require(_0x4ab2('0x1'));var timeout=require(_0x4ab2('0x2'));var express=require(_0x4ab2('0x3'));var router=express[_0x4ab2('0x4')]();var fs_extra=require(_0x4ab2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ab2('0x6'));var config=require(_0x4ab2('0x7'));var controller=require(_0x4ab2('0x8'));router[_0x4ab2('0x9')]('/',auth[_0x4ab2('0xa')](),controller[_0x4ab2('0xb')]);router[_0x4ab2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x4ab2('0xc')]);router['get'](_0x4ab2('0xd'),auth[_0x4ab2('0xa')](),controller[_0x4ab2('0xe')]);router[_0x4ab2('0xf')]('/',auth[_0x4ab2('0xa')](),interaction[_0x4ab2('0x10')](_0x4ab2('0x11'),_0x4ab2('0x12')),controller[_0x4ab2('0x13')]);router['post'](_0x4ab2('0x14'),controller[_0x4ab2('0x15')]);router[_0x4ab2('0x16')](_0x4ab2('0xd'),auth[_0x4ab2('0xa')](),controller[_0x4ab2('0x17')]);router['put'](_0x4ab2('0x18'),auth[_0x4ab2('0xa')](),controller[_0x4ab2('0x19')]);router[_0x4ab2('0x16')]('/:id/reject',auth[_0x4ab2('0xa')](),controller[_0x4ab2('0x1a')]);router[_0x4ab2('0x1b')]('/:id',auth[_0x4ab2('0xa')](),controller[_0x4ab2('0x1c')]);module[_0x4ab2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 008058b..333b8b4 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 _0xb71d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x1599e4,_0x38d92a){var _0xec1cc4=function(_0xd89f7d){while(--_0xd89f7d){_0x1599e4['push'](_0x1599e4['shift']());}};_0xec1cc4(++_0x38d92a);}(_0xb71d,0xc0));var _0xdb71=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb71d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xdb71('0x0'));module[_0xdb71('0x1')]={'body':{'type':Sequelize[_0xdb71('0x2')](_0xdb71('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdb71('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb71('0x5')]('in','out'),'defaultValue':_0xdb71('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdb71('0x7')](0xbe)},'phone':{'type':Sequelize[_0xdb71('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdb71('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x20e7=['sequelize','exports','medium','BOOLEAN','out','STRING','DATE','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20e7,0x178));var _0x720e=function(_0x341f4d,_0x453bb3){_0x341f4d=_0x341f4d-0x0;var _0x1809d1=_0x20e7[_0x341f4d];return _0x1809d1;};'use strict';var Sequelize=require(_0x720e('0x0'));module[_0x720e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x720e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x720e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x720e('0x4')),'defaultValue':_0x720e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x720e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x720e('0x5')]},'readAt':{'type':Sequelize[_0x720e('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x720e('0x5')]},'providerResponse':{'type':Sequelize[_0x720e('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 07f60db..078b0e8 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 _0xf76f=['inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','params','describe','../../config/logger','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','null','rejectMessage','Sequelize','SELECT','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x186d7c,_0xd079b5){var _0x46e348=function(_0x597e73){while(--_0x597e73){_0x186d7c['push'](_0x186d7c['shift']());}};_0x46e348(++_0xd079b5);}(_0xf76f,0x1ab));var _0xff76=function(_0x170310,_0x31acf9){_0x170310=_0x170310-0x0;var _0x1b6006=_0xf76f[_0x170310];return _0x1b6006;};'use strict';var emlformat=require(_0xff76('0x0'));var rimraf=require(_0xff76('0x1'));var zipdir=require(_0xff76('0x2'));var jsonpatch=require(_0xff76('0x3'));var rp=require(_0xff76('0x4'));var moment=require(_0xff76('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xff76('0x6'));var util=require(_0xff76('0x7'));var path=require('path');var sox=require(_0xff76('0x8'));var csv=require(_0xff76('0x9'));var ejs=require(_0xff76('0xa'));var fs=require('fs');var fs_extra=require(_0xff76('0xb'));var _=require(_0xff76('0xc'));var squel=require(_0xff76('0xd'));var crypto=require(_0xff76('0xe'));var jsforce=require(_0xff76('0xf'));var deskjs=require(_0xff76('0x10'));var toCsv=require(_0xff76('0x9'));var querystring=require(_0xff76('0x11'));var Papa=require(_0xff76('0x12'));var Redis=require('ioredis');var authService=require(_0xff76('0x13'));var qs=require(_0xff76('0x14'));var as=require(_0xff76('0x15'));var hardwareService=require(_0xff76('0x16'));var logger=require('../../config/logger')(_0xff76('0x17'));var utils=require(_0xff76('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xff76('0x19'));var db=require(_0xff76('0x1a'))['db'];config[_0xff76('0x1b')]=_[_0xff76('0x1c')](config[_0xff76('0x1b')],{'host':_0xff76('0x1d'),'port':0x18eb});var socket=require(_0xff76('0x1e'))(new Redis(config['redis']));require(_0xff76('0x1f'))[_0xff76('0x20')](socket);var jayson=require(_0xff76('0x21'));var client=jayson[_0xff76('0x22')][_0xff76('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xff76('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xeb8ed2,_0x3052ea,_0x123418,_0x35992f){return new BPromise(function(_0x1f740b,_0x376de8){var _0x454f37=_0x35992f||client;return _0x454f37[_0xff76('0x24')](_0xeb8ed2,_0x123418)['then'](function(_0x3ae2dd){logger[_0xff76('0x25')](_0xff76('0x26'),_0x3052ea,_0xff76('0x27'));logger[_0xff76('0x28')](_0xff76('0x29'),_0x3052ea,_0xff76('0x27'),JSON[_0xff76('0x2a')](_0x3ae2dd));if(_0x3ae2dd[_0xff76('0x2b')]){if(_0x3ae2dd[_0xff76('0x2b')]['code']===0x1f4){logger[_0xff76('0x2b')](_0xff76('0x26'),_0x3052ea,_0x3ae2dd[_0xff76('0x2b')][_0xff76('0x2c')]);return _0x376de8(_0x3ae2dd[_0xff76('0x2b')][_0xff76('0x2c')]);}logger[_0xff76('0x2b')](_0xff76('0x26'),_0x3052ea,_0x3ae2dd['error'][_0xff76('0x2c')]);return _0x1f740b(_0x3ae2dd['error'][_0xff76('0x2c')]);}else{logger['info'](_0xff76('0x26'),_0x3052ea,_0xff76('0x27'));_0x1f740b(_0x3ae2dd[_0xff76('0x2d')][_0xff76('0x2c')]);}})[_0xff76('0x2e')](function(_0x2580b8){logger[_0xff76('0x2b')](_0xff76('0x26'),_0x3052ea,_0x2580b8);_0x376de8(_0x2580b8);});});}function respondWithStatusCode(_0x370100,_0x2b169f){_0x2b169f=_0x2b169f||0xcc;return function(_0x3ff0ee){if(_0x3ff0ee){return _0x370100[_0xff76('0x2f')](_0x2b169f);}return _0x370100[_0xff76('0x30')](_0x2b169f)[_0xff76('0x31')]();};}function respondWithResult(_0x27377c,_0xef5747){_0xef5747=_0xef5747||0xc8;return function(_0x27f09f){if(_0x27f09f){return _0x27377c[_0xff76('0x30')](_0xef5747)[_0xff76('0x32')](_0x27f09f);}};}function respondWithFilteredResult(_0x257d99,_0x5be425){return function(_0x2f1e03){if(_0x2f1e03){var _0x54efe5=typeof _0x5be425[_0xff76('0x33')]===_0xff76('0x34')&&typeof _0x5be425[_0xff76('0x35')]===_0xff76('0x34');var _0x2d2641=_0x2f1e03[_0xff76('0x36')];var _0x1c052e=_0x54efe5?0x0:_0x5be425['offset'];var _0x453dbe=_0x54efe5?_0x2f1e03[_0xff76('0x36')]:_0x5be425[_0xff76('0x33')]+_0x5be425[_0xff76('0x35')];var _0x384ab0;if(_0x453dbe>=_0x2d2641){_0x453dbe=_0x2d2641;_0x384ab0=0xc8;}else{_0x384ab0=0xce;}_0x257d99['status'](_0x384ab0);return _0x257d99['set'](_0xff76('0x37'),_0x1c052e+'-'+_0x453dbe+'/'+_0x2d2641)[_0xff76('0x32')](_0x2f1e03);}return null;};}function patchUpdates(_0x782c40){return function(_0xfd429b){try{jsonpatch['apply'](_0xfd429b,_0x782c40,!![]);}catch(_0x553257){return BPromise[_0xff76('0x38')](_0x553257);}return _0xfd429b['save']();};}function saveUpdates(_0x47375a,_0x1141dd){return function(_0x5a3379){if(_0x5a3379){return _0x5a3379[_0xff76('0x39')](_0x47375a)[_0xff76('0x3a')](function(_0x798495){return _0x798495;});}return null;};}function removeEntity(_0x5f1ff2,_0x5f4bcf){return function(_0x5a79ab){if(_0x5a79ab){return _0x5a79ab[_0xff76('0x3b')]()[_0xff76('0x3a')](function(){_0x5f1ff2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37be9d,_0x30f4a9){return function(_0xf142fc){if(!_0xf142fc){_0x37be9d[_0xff76('0x2f')](0x194);}return _0xf142fc;};}function handleError(_0x4f5612,_0x4a17b1){_0x4a17b1=_0x4a17b1||0x1f4;return function(_0xdb6333){logger['error'](_0xdb6333[_0xff76('0x3c')]);if(_0xdb6333[_0xff76('0x3d')]){delete _0xdb6333[_0xff76('0x3d')];}_0x4f5612[_0xff76('0x30')](_0x4a17b1)[_0xff76('0x3e')](_0xdb6333);};}exports['index']=function(_0x3b14c9,_0x1a62b3){var _0xaa2b1d={},_0x3220a5={},_0x1e28c0={'count':0x0,'rows':[]};var _0x42cb8f=_[_0xff76('0x3f')](db[_0xff76('0x40')][_0xff76('0x41')],function(_0x39956f){return{'name':_0x39956f[_0xff76('0x42')],'type':_0x39956f[_0xff76('0x43')][_0xff76('0x44')]};});_0x3220a5[_0xff76('0x45')]=_['map'](_0x42cb8f,_0xff76('0x3d'));_0x3220a5[_0xff76('0x46')]=_[_0xff76('0x47')](_0x3b14c9[_0xff76('0x46')]);_0x3220a5[_0xff76('0x48')]=_[_0xff76('0x49')](_0x3220a5[_0xff76('0x45')],_0x3220a5[_0xff76('0x46')]);_0xaa2b1d[_0xff76('0x4a')]=_['intersection'](_0x3220a5[_0xff76('0x45')],qs[_0xff76('0x4b')](_0x3b14c9[_0xff76('0x46')][_0xff76('0x4b')]));_0xaa2b1d[_0xff76('0x4a')]=_0xaa2b1d[_0xff76('0x4a')][_0xff76('0x4c')]?_0xaa2b1d[_0xff76('0x4a')]:_0x3220a5['model'];if(!_0x3b14c9[_0xff76('0x46')][_0xff76('0x4d')](_0xff76('0x4e'))){_0xaa2b1d[_0xff76('0x35')]=qs[_0xff76('0x35')](_0x3b14c9[_0xff76('0x46')][_0xff76('0x35')]);_0xaa2b1d['offset']=qs[_0xff76('0x33')](_0x3b14c9[_0xff76('0x46')][_0xff76('0x33')]);}_0xaa2b1d['order']=qs['sort'](_0x3b14c9[_0xff76('0x46')][_0xff76('0x4f')]);_0xaa2b1d[_0xff76('0x50')]=qs[_0xff76('0x48')](_[_0xff76('0x51')](_0x3b14c9[_0xff76('0x46')],_0x3220a5[_0xff76('0x48')]),_0x42cb8f);if(_0x3b14c9['query']['filter']){_0xaa2b1d[_0xff76('0x50')]=_[_0xff76('0x52')](_0xaa2b1d['where'],{'$or':_['map'](_0x42cb8f,function(_0x5d6a13){if(_0x5d6a13[_0xff76('0x43')]!==_0xff76('0x53')){var _0x29fc32={};_0x29fc32[_0x5d6a13[_0xff76('0x3d')]]={'$like':'%'+_0x3b14c9[_0xff76('0x46')]['filter']+'%'};return _0x29fc32;}})});}_0xaa2b1d=_[_0xff76('0x52')]({},_0xaa2b1d,_0x3b14c9[_0xff76('0x54')]);var _0x29ab7d={'where':_0xaa2b1d[_0xff76('0x50')]};return db[_0xff76('0x40')][_0xff76('0x36')](_0x29ab7d)[_0xff76('0x3a')](function(_0x2afe5e){_0x1e28c0['count']=_0x2afe5e;if(_0x3b14c9[_0xff76('0x46')][_0xff76('0x55')]){_0xaa2b1d[_0xff76('0x56')]=[{'all':!![]}];}return db[_0xff76('0x40')][_0xff76('0x57')](_0xaa2b1d);})[_0xff76('0x3a')](function(_0x3721ec){_0x1e28c0[_0xff76('0x58')]=_0x3721ec;return _0x1e28c0;})[_0xff76('0x3a')](respondWithFilteredResult(_0x1a62b3,_0xaa2b1d))['catch'](handleError(_0x1a62b3,null));};exports['show']=function(_0x5a0251,_0xdb24ab){var _0x38db2a={'raw':!![],'where':{'id':_0x5a0251['params']['id']}},_0x53f0dd={};_0x53f0dd[_0xff76('0x45')]=_['keys'](db[_0xff76('0x40')][_0xff76('0x41')]);_0x53f0dd[_0xff76('0x46')]=_['keys'](_0x5a0251[_0xff76('0x46')]);_0x53f0dd['filters']=_[_0xff76('0x49')](_0x53f0dd[_0xff76('0x45')],_0x53f0dd[_0xff76('0x46')]);_0x38db2a['attributes']=_[_0xff76('0x49')](_0x53f0dd[_0xff76('0x45')],qs[_0xff76('0x4b')](_0x5a0251[_0xff76('0x46')][_0xff76('0x4b')]));_0x38db2a[_0xff76('0x4a')]=_0x38db2a[_0xff76('0x4a')][_0xff76('0x4c')]?_0x38db2a[_0xff76('0x4a')]:_0x53f0dd[_0xff76('0x45')];if(_0x5a0251[_0xff76('0x46')][_0xff76('0x55')]){_0x38db2a[_0xff76('0x56')]=[{'all':!![]}];}_0x38db2a=_[_0xff76('0x52')]({},_0x38db2a,_0x5a0251[_0xff76('0x54')]);return db[_0xff76('0x40')][_0xff76('0x59')](_0x38db2a)[_0xff76('0x3a')](handleEntityNotFound(_0xdb24ab,null))[_0xff76('0x3a')](respondWithResult(_0xdb24ab,null))[_0xff76('0x2e')](handleError(_0xdb24ab,null));};exports[_0xff76('0x5a')]=function(_0x3c60ba,_0x25a3f7){return db[_0xff76('0x40')]['create'](_0x3c60ba[_0xff76('0x5b')],{})[_0xff76('0x3a')](respondWithResult(_0x25a3f7,0xc9))['catch'](handleError(_0x25a3f7,null));};exports[_0xff76('0x39')]=function(_0x357551,_0x2bd409){if(_0x357551['body']['id']){delete _0x357551[_0xff76('0x5b')]['id'];}return db[_0xff76('0x40')][_0xff76('0x59')]({'where':{'id':_0x357551[_0xff76('0x5c')]['id']}})[_0xff76('0x3a')](handleEntityNotFound(_0x2bd409,null))[_0xff76('0x3a')](saveUpdates(_0x357551[_0xff76('0x5b')],null))['then'](respondWithResult(_0x2bd409,null))[_0xff76('0x2e')](handleError(_0x2bd409,null));};exports['destroy']=function(_0x32f955,_0xb2b0a0){return db[_0xff76('0x40')][_0xff76('0x59')]({'where':{'id':_0x32f955[_0xff76('0x5c')]['id']}})[_0xff76('0x3a')](handleEntityNotFound(_0xb2b0a0,null))[_0xff76('0x3a')](removeEntity(_0xb2b0a0,null))[_0xff76('0x2e')](handleError(_0xb2b0a0,null));};exports[_0xff76('0x5d')]=function(_0x117545,_0x304d0d){return db[_0xff76('0x40')][_0xff76('0x5d')]()[_0xff76('0x3a')](respondWithResult(_0x304d0d,null))['catch'](handleError(_0x304d0d,null));};var interaction_log=require(_0xff76('0x5e'))('whatsapp-interactions');exports[_0xff76('0x5f')]=function(_0x8041d1,_0x1c2fa4,_0x3135f1){var _0x384f83={'agent':{},'channel':'whatsapp'};if(_0x8041d1[_0xff76('0x5b')]['id']){delete _0x8041d1['body']['id'];}_0x8041d1[_0xff76('0x5b')][_0xff76('0x60')]=!![];_0x8041d1[_0xff76('0x5b')]['readAt']=moment()[_0xff76('0x61')](_0xff76('0x62'));_0x8041d1[_0xff76('0x5b')][_0xff76('0x63')]=_0x8041d1[_0xff76('0x5b')]['UserId']||_0x8041d1[_0xff76('0x64')]['id'];_0x384f83[_0xff76('0x65')]['id']=_0x8041d1[_0xff76('0x5b')][_0xff76('0x63')];return db[_0xff76('0x40')][_0xff76('0x59')]({'where':{'id':_0x8041d1[_0xff76('0x5c')]['id'],'UserId':null}})[_0xff76('0x3a')](handleEntityNotFound(_0x1c2fa4,null))[_0xff76('0x3a')](saveUpdates(_0x8041d1[_0xff76('0x5b')],null))[_0xff76('0x3a')](function(_0x38cf1f){if(_0x38cf1f){_0x384f83['message']=_0x38cf1f[_0xff76('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0xff76('0x59')]({'where':{'id':_0x38cf1f[_0xff76('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1c2fa4,null))['then'](function(_0x262998){if(_0x262998){return _0x262998['update']({'UserId':_0x8041d1[_0xff76('0x5b')][_0xff76('0x63')],'read1stAt':_[_0xff76('0x68')](_0x262998['read1stAt'])?moment()[_0xff76('0x61')](_0xff76('0x62')):undefined});}return null;})['then'](function(_0x538c49){if(_0x538c49){_0x384f83[_0xff76('0x69')]=_0x538c49[_0xff76('0x66')]({'plain':!![]});interaction_log[_0xff76('0x25')](_0xff76('0x6a'),_0x8041d1[_0xff76('0x64')]['id'],_0x8041d1[_0xff76('0x64')][_0xff76('0x3d')],_0x8041d1[_0xff76('0x64')][_0xff76('0x6b')],_0x384f83[_0xff76('0x69')]['id'],_0x8041d1[_0xff76('0x5b')]?JSON[_0xff76('0x2a')](_0x8041d1[_0xff76('0x5b')]):'null');return respondWithRpcPromise(_0xff76('0x6c'),_0xff76('0x6d'),_0x384f83);}return null;})[_0xff76('0x3a')](function(_0x4215df){var _0x466585=_0xff76('0x6e')+_0x4215df[_0xff76('0x2c')][_0xff76('0x6f')];return db[_0xff76('0x70')]['query'](_0x466585,{'type':db['Sequelize'][_0xff76('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x2348d5){return _0x2348d5;});})[_0xff76('0x3a')](function(_0x349e12){if(_0x349e12){_0x384f83[_0xff76('0x2c')]['contact']=_0x349e12[0x0];if(!_0x8041d1[_0xff76('0x5b')][_0xff76('0x63')])return;return db[_0xff76('0x72')][_0xff76('0x59')]({'where':{'id':_0x8041d1[_0xff76('0x5b')]['UserId'],'role':_0xff76('0x65')},'attributes':['id',_0xff76('0x3d'),_0xff76('0x73'),_0xff76('0x74'),_0xff76('0x75')],'raw':!![]});}return null;})[_0xff76('0x3a')](function(_0x48524d){if(!_0x48524d)return null;_0x384f83[_0xff76('0x2c')][_0xff76('0x65')]=_0x48524d;return _0x384f83;})[_0xff76('0x3a')](function(_0x190174){if(_0x190174){if(_0x8041d1[_0xff76('0x5b')]['manual']){_0x384f83['message'][_0xff76('0x76')]=util['format'](_0xff76('0x77'),_0x8041d1[_0xff76('0x64')]['name']);_0x384f83['message'][_0xff76('0x78')]=_0x384f83[_0xff76('0x78')];_0x384f83[_0xff76('0x2c')][_0xff76('0x79')]=_0x384f83[_0xff76('0x78')];_0x384f83[_0xff76('0x2c')][_0xff76('0x7a')]=_0xff76('0x5f');return respondWithRpcPromise(_0xff76('0x7b'),'EventManager',{'event':_0xff76('0x7c'),'message':_0x384f83[_0xff76('0x2c')]},client9002)[_0xff76('0x3a')](function(){return _0x384f83;});}return _0x384f83;}return null;})[_0xff76('0x3a')](respondWithResult(_0x1c2fa4,null))['catch'](handleError(_0x1c2fa4,null));};var interaction_log=require(_0xff76('0x5e'))('whatsapp-interactions');exports[_0xff76('0x38')]=function(_0x3e3945,_0x492c6a,_0x4d1e5f){var _0x4d771b={'agent':{},'channel':'whatsapp'};if(_0x3e3945[_0xff76('0x5b')]['id']){delete _0x3e3945[_0xff76('0x5b')]['id'];}_0x3e3945[_0xff76('0x5b')][_0xff76('0x63')]=_0x3e3945[_0xff76('0x5b')][_0xff76('0x63')]||_0x3e3945[_0xff76('0x64')]['id'];_0x4d771b[_0xff76('0x65')]['id']=_0x3e3945[_0xff76('0x5b')]['UserId'];return db[_0xff76('0x40')][_0xff76('0x59')]({'where':{'id':_0x3e3945['params']['id'],'UserId':null}})[_0xff76('0x3a')](handleEntityNotFound(_0x492c6a,null))[_0xff76('0x3a')](function(_0xbb1c9b){if(_0xbb1c9b){_0x4d771b[_0xff76('0x2c')]=_0xbb1c9b['get']({'plain':!![]});return db[_0xff76('0x7d')][_0xff76('0x59')]({'where':{'id':_0xbb1c9b['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x492c6a,null))['then'](function(_0x257e40){if(_0x257e40){_0x4d771b[_0xff76('0x69')]=_0x257e40[_0xff76('0x66')]({'plain':!![]});interaction_log[_0xff76('0x25')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e3945[_0xff76('0x64')]['id'],_0x3e3945['user'][_0xff76('0x3d')],_0x3e3945['user'][_0xff76('0x6b')],_0x4d771b[_0xff76('0x69')]['id'],_0x3e3945[_0xff76('0x5b')]?JSON['stringify'](_0x3e3945[_0xff76('0x5b')]):_0xff76('0x7e'));return respondWithRpcPromise('RejectMessage',_0xff76('0x7f'),_0x4d771b);}return null;})['then'](function(_0x1c34c8){var _0x50b8fb=_0xff76('0x6e')+_0x1c34c8[_0xff76('0x2c')][_0xff76('0x6f')];return db[_0xff76('0x70')]['query'](_0x50b8fb,{'type':db[_0xff76('0x80')][_0xff76('0x71')][_0xff76('0x81')],'raw':!![]})['then'](function(_0x4e873d){return _0x4e873d;});})[_0xff76('0x3a')](function(_0x3cecb5){if(_0x3cecb5){_0x4d771b['message'][_0xff76('0x82')]=_0x3cecb5[0x0];if(!_0x3e3945[_0xff76('0x5b')][_0xff76('0x63')])return;return db[_0xff76('0x72')]['find']({'where':{'id':_0x3e3945[_0xff76('0x5b')]['UserId'],'role':'agent'},'attributes':['id','name',_0xff76('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xff76('0x3a')](function(_0x4a8d21){if(!_0x4a8d21)return null;_0x4d771b[_0xff76('0x2c')][_0xff76('0x65')]=_0x4a8d21;return _0x4d771b;})[_0xff76('0x3a')](function(_0x15626a){if(_0x15626a){_0x15626a['message'][_0xff76('0x76')]=util[_0xff76('0x61')]('SIP/%s',_0x3e3945[_0xff76('0x64')][_0xff76('0x3d')]);_0x15626a[_0xff76('0x2c')]['channel']=_0x4d771b[_0xff76('0x78')];_0x15626a[_0xff76('0x2c')][_0xff76('0x79')]=_0x4d771b[_0xff76('0x78')];_0x15626a[_0xff76('0x2c')][_0xff76('0x7a')]='reject';respondWithRpcPromise(_0xff76('0x7b'),_0xff76('0x7b'),{'event':_0xff76('0x83'),'message':_0x15626a[_0xff76('0x2c')]},client9002);return _0x4d771b;}return null;})[_0xff76('0x3a')](respondWithResult(_0x492c6a,null))[_0xff76('0x2e')](handleError(_0x492c6a,null));};exports[_0xff76('0x30')]=function(_0x4834a9,_0x54698d,_0x2bf3f2){if(_0x4834a9[_0xff76('0x5b')]['id']){delete _0x4834a9[_0xff76('0x5b')]['id'];}var _0x2437f8;return db[_0xff76('0x40')][_0xff76('0x59')]({'where':{'id':_0x4834a9[_0xff76('0x5c')]['id']}})[_0xff76('0x3a')](handleEntityNotFound(_0x54698d,null))[_0xff76('0x3a')](function(_0x141b5c){if(_0x141b5c){_0x2437f8=_0x141b5c;return db[_0xff76('0x84')][_0xff76('0x59')]({'where':{'id':_0x141b5c[_0xff76('0x85')]}});}})[_0xff76('0x3a')](handleEntityNotFound(_0x54698d,null))['then'](function(_0x159f51){if(_0x159f51){logger[_0xff76('0x28')](_0xff76('0x86'),_0xff76('0x30'),_0xff76('0x87'),_0x159f51[_0xff76('0x43')],util['inspect'](_0x4834a9['body'],{'showHidden':![],'depth':null}));switch(_0x159f51[_0xff76('0x43')]){case _0xff76('0x88'):if(_0x4834a9[_0xff76('0x5b')]['MessageSid']&&_0x4834a9[_0xff76('0x5b')][_0xff76('0x89')]===_0x2437f8[_0xff76('0x8a')]&&_0x4834a9['body'][_0xff76('0x8b')]&&_0x4834a9[_0xff76('0x5b')][_0xff76('0x8b')]===_0xff76('0x60')){return _0x2437f8[_0xff76('0x39')]({'read':!![]});}else{logger[_0xff76('0x2b')](_0xff76('0x8c'),_0xff76('0x30'),_0xff76('0x88'),util[_0xff76('0x8d')](_0x4834a9[_0xff76('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2437f8;}})[_0xff76('0x3a')](respondWithResult(_0x54698d,null))[_0xff76('0x2e')](handleError(_0x54698d,null));}; \ No newline at end of file +var _0xd23b=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','motionChannel','event','accept','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','SELECT','interface','EventManager','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xd23b,0x199));var _0xbd23=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xd23b[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0xbd23('0x0'));var rimraf=require(_0xbd23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd23('0x2'));var BPromise=require(_0xbd23('0x3'));var Mustache=require('mustache');var util=require(_0xbd23('0x4'));var path=require(_0xbd23('0x5'));var sox=require(_0xbd23('0x6'));var csv=require(_0xbd23('0x7'));var ejs=require(_0xbd23('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbd23('0x9'));var crypto=require(_0xbd23('0xa'));var jsforce=require(_0xbd23('0xb'));var deskjs=require(_0xbd23('0xc'));var toCsv=require(_0xbd23('0x7'));var querystring=require(_0xbd23('0xd'));var Papa=require(_0xbd23('0xe'));var Redis=require('ioredis');var authService=require(_0xbd23('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbd23('0x10'));var hardwareService=require(_0xbd23('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xbd23('0x12'));var config=require(_0xbd23('0x13'));var licenseUtil=require(_0xbd23('0x14'));var db=require(_0xbd23('0x15'))['db'];config['redis']=_[_0xbd23('0x16')](config[_0xbd23('0x17')],{'host':_0xbd23('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd23('0x17')]));require(_0xbd23('0x19'))[_0xbd23('0x1a')](socket);var jayson=require(_0xbd23('0x1b'));var client=jayson[_0xbd23('0x1c')][_0xbd23('0x1d')]({'port':0x232c});var client9002=jayson[_0xbd23('0x1c')][_0xbd23('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x401b6a,_0x9c135e,_0x4e9d3e,_0x2b6456){return new BPromise(function(_0x1e026b,_0x1470d4){var _0x5a3654=_0x2b6456||client;return _0x5a3654[_0xbd23('0x1e')](_0x401b6a,_0x4e9d3e)['then'](function(_0x457952){logger[_0xbd23('0x1f')](_0xbd23('0x20'),_0x9c135e,_0xbd23('0x21'));logger[_0xbd23('0x22')](_0xbd23('0x23'),_0x9c135e,_0xbd23('0x21'),JSON[_0xbd23('0x24')](_0x457952));if(_0x457952['error']){if(_0x457952[_0xbd23('0x25')][_0xbd23('0x26')]===0x1f4){logger[_0xbd23('0x25')](_0xbd23('0x20'),_0x9c135e,_0x457952[_0xbd23('0x25')][_0xbd23('0x27')]);return _0x1470d4(_0x457952[_0xbd23('0x25')]['message']);}logger[_0xbd23('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x9c135e,_0x457952[_0xbd23('0x25')][_0xbd23('0x27')]);return _0x1e026b(_0x457952[_0xbd23('0x25')][_0xbd23('0x27')]);}else{logger['info'](_0xbd23('0x20'),_0x9c135e,_0xbd23('0x21'));_0x1e026b(_0x457952[_0xbd23('0x28')][_0xbd23('0x27')]);}})[_0xbd23('0x29')](function(_0x1c3d32){logger[_0xbd23('0x25')](_0xbd23('0x20'),_0x9c135e,_0x1c3d32);_0x1470d4(_0x1c3d32);});});}function respondWithStatusCode(_0x1f60fd,_0x151d0d){_0x151d0d=_0x151d0d||0xcc;return function(_0x4f0074){if(_0x4f0074){return _0x1f60fd[_0xbd23('0x2a')](_0x151d0d);}return _0x1f60fd['status'](_0x151d0d)[_0xbd23('0x2b')]();};}function respondWithResult(_0x52939b,_0x52b9de){_0x52b9de=_0x52b9de||0xc8;return function(_0x50435e){if(_0x50435e){return _0x52939b[_0xbd23('0x2c')](_0x52b9de)['json'](_0x50435e);}};}function respondWithFilteredResult(_0x26ad04,_0x22ead2){return function(_0x4c91f8){if(_0x4c91f8){var _0x49a148=typeof _0x22ead2[_0xbd23('0x2d')]===_0xbd23('0x2e')&&typeof _0x22ead2[_0xbd23('0x2f')]===_0xbd23('0x2e');var _0x2be95d=_0x4c91f8[_0xbd23('0x30')];var _0x3ba3cf=_0x49a148?0x0:_0x22ead2[_0xbd23('0x2d')];var _0x2038a6=_0x49a148?_0x4c91f8[_0xbd23('0x30')]:_0x22ead2[_0xbd23('0x2d')]+_0x22ead2[_0xbd23('0x2f')];var _0x1b0526;if(_0x2038a6>=_0x2be95d){_0x2038a6=_0x2be95d;_0x1b0526=0xc8;}else{_0x1b0526=0xce;}_0x26ad04['status'](_0x1b0526);return _0x26ad04[_0xbd23('0x31')](_0xbd23('0x32'),_0x3ba3cf+'-'+_0x2038a6+'/'+_0x2be95d)[_0xbd23('0x33')](_0x4c91f8);}return null;};}function patchUpdates(_0x5b6beb){return function(_0x270b74){try{jsonpatch[_0xbd23('0x34')](_0x270b74,_0x5b6beb,!![]);}catch(_0x24bb67){return BPromise[_0xbd23('0x35')](_0x24bb67);}return _0x270b74[_0xbd23('0x36')]();};}function saveUpdates(_0x1a06bb,_0x1eeaa4){return function(_0x32f8d4){if(_0x32f8d4){return _0x32f8d4[_0xbd23('0x37')](_0x1a06bb)[_0xbd23('0x38')](function(_0x3182b4){return _0x3182b4;});}return null;};}function removeEntity(_0x4c501e,_0x3562cd){return function(_0x52f424){if(_0x52f424){return _0x52f424[_0xbd23('0x39')]()[_0xbd23('0x38')](function(){_0x4c501e[_0xbd23('0x2c')](0xcc)[_0xbd23('0x2b')]();});}};}function handleEntityNotFound(_0x5e2421,_0x1a5bf0){return function(_0x363380){if(!_0x363380){_0x5e2421[_0xbd23('0x2a')](0x194);}return _0x363380;};}function handleError(_0xe6a45,_0x7d0ffb){_0x7d0ffb=_0x7d0ffb||0x1f4;return function(_0x39d44e){logger[_0xbd23('0x25')](_0x39d44e['stack']);if(_0x39d44e[_0xbd23('0x3a')]){delete _0x39d44e[_0xbd23('0x3a')];}_0xe6a45[_0xbd23('0x2c')](_0x7d0ffb)[_0xbd23('0x3b')](_0x39d44e);};}exports['index']=function(_0x4ac446,_0x594b03){var _0xa44a57={},_0x1d1d8c={},_0x819f10={'count':0x0,'rows':[]};var _0x3f4976=_[_0xbd23('0x3c')](db[_0xbd23('0x3d')][_0xbd23('0x3e')],function(_0x303b93){return{'name':_0x303b93[_0xbd23('0x3f')],'type':_0x303b93[_0xbd23('0x40')]['key']};});_0x1d1d8c['model']=_[_0xbd23('0x3c')](_0x3f4976,_0xbd23('0x3a'));_0x1d1d8c[_0xbd23('0x41')]=_[_0xbd23('0x42')](_0x4ac446[_0xbd23('0x41')]);_0x1d1d8c['filters']=_[_0xbd23('0x43')](_0x1d1d8c[_0xbd23('0x44')],_0x1d1d8c[_0xbd23('0x41')]);_0xa44a57['attributes']=_[_0xbd23('0x43')](_0x1d1d8c[_0xbd23('0x44')],qs['fields'](_0x4ac446['query'][_0xbd23('0x45')]));_0xa44a57['attributes']=_0xa44a57[_0xbd23('0x46')][_0xbd23('0x47')]?_0xa44a57[_0xbd23('0x46')]:_0x1d1d8c[_0xbd23('0x44')];if(!_0x4ac446[_0xbd23('0x41')]['hasOwnProperty']('nolimit')){_0xa44a57[_0xbd23('0x2f')]=qs[_0xbd23('0x2f')](_0x4ac446[_0xbd23('0x41')]['limit']);_0xa44a57[_0xbd23('0x2d')]=qs[_0xbd23('0x2d')](_0x4ac446['query'][_0xbd23('0x2d')]);}_0xa44a57[_0xbd23('0x48')]=qs[_0xbd23('0x49')](_0x4ac446['query'][_0xbd23('0x49')]);_0xa44a57[_0xbd23('0x4a')]=qs[_0xbd23('0x4b')](_['pick'](_0x4ac446[_0xbd23('0x41')],_0x1d1d8c['filters']),_0x3f4976);if(_0x4ac446[_0xbd23('0x41')]['filter']){_0xa44a57[_0xbd23('0x4a')]=_[_0xbd23('0x4c')](_0xa44a57[_0xbd23('0x4a')],{'$or':_['map'](_0x3f4976,function(_0x29c6e6){if(_0x29c6e6[_0xbd23('0x40')]!=='VIRTUAL'){var _0x5b8e2a={};_0x5b8e2a[_0x29c6e6['name']]={'$like':'%'+_0x4ac446['query']['filter']+'%'};return _0x5b8e2a;}})});}_0xa44a57=_['merge']({},_0xa44a57,_0x4ac446[_0xbd23('0x4d')]);var _0x358c0d={'where':_0xa44a57[_0xbd23('0x4a')]};return db[_0xbd23('0x3d')][_0xbd23('0x30')](_0x358c0d)[_0xbd23('0x38')](function(_0x3fa973){_0x819f10[_0xbd23('0x30')]=_0x3fa973;if(_0x4ac446[_0xbd23('0x41')][_0xbd23('0x4e')]){_0xa44a57[_0xbd23('0x4f')]=[{'all':!![]}];}return db[_0xbd23('0x3d')][_0xbd23('0x50')](_0xa44a57);})['then'](function(_0x3452ed){_0x819f10[_0xbd23('0x51')]=_0x3452ed;return _0x819f10;})['then'](respondWithFilteredResult(_0x594b03,_0xa44a57))['catch'](handleError(_0x594b03,null));};exports[_0xbd23('0x52')]=function(_0x11d9f0,_0x138987){var _0x5f4fe0={'raw':!![],'where':{'id':_0x11d9f0[_0xbd23('0x53')]['id']}},_0x45ca25={};_0x45ca25['model']=_[_0xbd23('0x42')](db[_0xbd23('0x3d')][_0xbd23('0x3e')]);_0x45ca25[_0xbd23('0x41')]=_[_0xbd23('0x42')](_0x11d9f0[_0xbd23('0x41')]);_0x45ca25['filters']=_[_0xbd23('0x43')](_0x45ca25['model'],_0x45ca25[_0xbd23('0x41')]);_0x5f4fe0['attributes']=_['intersection'](_0x45ca25[_0xbd23('0x44')],qs[_0xbd23('0x45')](_0x11d9f0[_0xbd23('0x41')][_0xbd23('0x45')]));_0x5f4fe0[_0xbd23('0x46')]=_0x5f4fe0[_0xbd23('0x46')][_0xbd23('0x47')]?_0x5f4fe0[_0xbd23('0x46')]:_0x45ca25['model'];if(_0x11d9f0['query']['includeAll']){_0x5f4fe0[_0xbd23('0x4f')]=[{'all':!![]}];}_0x5f4fe0=_[_0xbd23('0x4c')]({},_0x5f4fe0,_0x11d9f0[_0xbd23('0x4d')]);return db['WhatsappMessage'][_0xbd23('0x54')](_0x5f4fe0)[_0xbd23('0x38')](handleEntityNotFound(_0x138987,null))[_0xbd23('0x38')](respondWithResult(_0x138987,null))['catch'](handleError(_0x138987,null));};exports[_0xbd23('0x55')]=function(_0x1a74df,_0xadae71){return db[_0xbd23('0x3d')]['create'](_0x1a74df[_0xbd23('0x56')],{})[_0xbd23('0x38')](respondWithResult(_0xadae71,0xc9))[_0xbd23('0x29')](handleError(_0xadae71,null));};exports[_0xbd23('0x37')]=function(_0x4b3f37,_0x3ee3a9){if(_0x4b3f37[_0xbd23('0x56')]['id']){delete _0x4b3f37[_0xbd23('0x56')]['id'];}return db[_0xbd23('0x3d')][_0xbd23('0x54')]({'where':{'id':_0x4b3f37[_0xbd23('0x53')]['id']}})[_0xbd23('0x38')](handleEntityNotFound(_0x3ee3a9,null))[_0xbd23('0x38')](saveUpdates(_0x4b3f37[_0xbd23('0x56')],null))[_0xbd23('0x38')](respondWithResult(_0x3ee3a9,null))['catch'](handleError(_0x3ee3a9,null));};exports[_0xbd23('0x39')]=function(_0x20a465,_0x1f0d7c){return db[_0xbd23('0x3d')][_0xbd23('0x54')]({'where':{'id':_0x20a465[_0xbd23('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f0d7c,null))['then'](removeEntity(_0x1f0d7c,null))[_0xbd23('0x29')](handleError(_0x1f0d7c,null));};exports[_0xbd23('0x57')]=function(_0x322ddd,_0x14f712){return db[_0xbd23('0x3d')]['describe']()[_0xbd23('0x38')](respondWithResult(_0x14f712,null))['catch'](handleError(_0x14f712,null));};var interaction_log=require(_0xbd23('0x58'))('whatsapp-interactions');exports['accept']=function(_0x21ea79,_0x1a9eb6,_0x14a5e2){var _0x2106a3={'agent':{},'channel':_0xbd23('0x59')};if(_0x21ea79[_0xbd23('0x56')]['id']){delete _0x21ea79['body']['id'];}_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5a')]=!![];_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5b')]=moment()[_0xbd23('0x5c')](_0xbd23('0x5d'));_0x21ea79['body'][_0xbd23('0x5e')]=_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5e')]||_0x21ea79[_0xbd23('0x5f')]['id'];_0x2106a3['agent']['id']=_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5e')];return db[_0xbd23('0x3d')][_0xbd23('0x54')]({'where':{'id':_0x21ea79[_0xbd23('0x53')]['id'],'UserId':null}})[_0xbd23('0x38')](handleEntityNotFound(_0x1a9eb6,null))[_0xbd23('0x38')](saveUpdates(_0x21ea79[_0xbd23('0x56')],null))[_0xbd23('0x38')](function(_0x259b6b){if(_0x259b6b){_0x2106a3[_0xbd23('0x27')]=_0x259b6b[_0xbd23('0x60')]({'plain':!![]});return db[_0xbd23('0x61')][_0xbd23('0x54')]({'where':{'id':_0x259b6b[_0xbd23('0x62')]}});}return null;})[_0xbd23('0x38')](handleEntityNotFound(_0x1a9eb6,null))[_0xbd23('0x38')](function(_0x5e9bff){if(_0x5e9bff){return _0x5e9bff[_0xbd23('0x37')]({'UserId':_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5e')],'read1stAt':_[_0xbd23('0x63')](_0x5e9bff['read1stAt'])?moment()[_0xbd23('0x5c')](_0xbd23('0x5d')):undefined});}return null;})[_0xbd23('0x38')](function(_0xd47048){if(_0xd47048){_0x2106a3[_0xbd23('0x64')]=_0xd47048['get']({'plain':!![]});interaction_log[_0xbd23('0x1f')](_0xbd23('0x65'),_0x21ea79[_0xbd23('0x5f')]['id'],_0x21ea79['user'][_0xbd23('0x3a')],_0x21ea79[_0xbd23('0x5f')][_0xbd23('0x66')],_0x2106a3[_0xbd23('0x64')]['id'],_0x21ea79[_0xbd23('0x56')]?JSON['stringify'](_0x21ea79['body']):_0xbd23('0x67'));return respondWithRpcPromise(_0xbd23('0x68'),'acceptMessage',_0x2106a3);}return null;})[_0xbd23('0x38')](function(_0x25ab61){var _0x5cef19=_0xbd23('0x69')+_0x25ab61['message'][_0xbd23('0x6a')];return db[_0xbd23('0x6b')][_0xbd23('0x41')](_0x5cef19,{'type':db[_0xbd23('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbd23('0x38')](function(_0x102bce){return _0x102bce;});})[_0xbd23('0x38')](function(_0x49f074){if(_0x49f074){_0x2106a3[_0xbd23('0x27')][_0xbd23('0x6d')]=_0x49f074[0x0];if(!_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5e')])return;return db[_0xbd23('0x6e')][_0xbd23('0x54')]({'where':{'id':_0x21ea79[_0xbd23('0x56')][_0xbd23('0x5e')],'role':'agent'},'attributes':['id',_0xbd23('0x3a'),_0xbd23('0x6f'),_0xbd23('0x70'),_0xbd23('0x71')],'raw':!![]});}return null;})['then'](function(_0x13fc25){if(!_0x13fc25)return null;_0x2106a3[_0xbd23('0x27')][_0xbd23('0x72')]=_0x13fc25;return _0x2106a3;})[_0xbd23('0x38')](function(_0x40080d){if(_0x40080d){if(_0x21ea79[_0xbd23('0x56')][_0xbd23('0x73')]){_0x2106a3[_0xbd23('0x27')]['interface']=util[_0xbd23('0x5c')](_0xbd23('0x74'),_0x21ea79['user'][_0xbd23('0x3a')]);_0x2106a3[_0xbd23('0x27')][_0xbd23('0x75')]=_0x2106a3[_0xbd23('0x75')];_0x2106a3['message'][_0xbd23('0x76')]=_0x2106a3[_0xbd23('0x75')];_0x2106a3[_0xbd23('0x27')][_0xbd23('0x77')]=_0xbd23('0x78');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xbd23('0x79'),'message':_0x2106a3[_0xbd23('0x27')]},client9002)[_0xbd23('0x38')](function(){return _0x2106a3;});}return _0x2106a3;}return null;})[_0xbd23('0x38')](respondWithResult(_0x1a9eb6,null))[_0xbd23('0x29')](handleError(_0x1a9eb6,null));};var interaction_log=require(_0xbd23('0x58'))(_0xbd23('0x7a'));exports[_0xbd23('0x35')]=function(_0x1c4e91,_0x5244b9,_0x55dda7){var _0x173812={'agent':{},'channel':'whatsapp'};if(_0x1c4e91[_0xbd23('0x56')]['id']){delete _0x1c4e91[_0xbd23('0x56')]['id'];}_0x1c4e91[_0xbd23('0x56')][_0xbd23('0x5e')]=_0x1c4e91[_0xbd23('0x56')][_0xbd23('0x5e')]||_0x1c4e91['user']['id'];_0x173812[_0xbd23('0x72')]['id']=_0x1c4e91[_0xbd23('0x56')][_0xbd23('0x5e')];return db[_0xbd23('0x3d')][_0xbd23('0x54')]({'where':{'id':_0x1c4e91[_0xbd23('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5244b9,null))[_0xbd23('0x38')](function(_0x3a7344){if(_0x3a7344){_0x173812[_0xbd23('0x27')]=_0x3a7344['get']({'plain':!![]});return db[_0xbd23('0x61')][_0xbd23('0x54')]({'where':{'id':_0x3a7344[_0xbd23('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5244b9,null))[_0xbd23('0x38')](function(_0x29cb0b){if(_0x29cb0b){_0x173812[_0xbd23('0x64')]=_0x29cb0b['get']({'plain':!![]});interaction_log[_0xbd23('0x1f')](_0xbd23('0x7b'),_0x1c4e91[_0xbd23('0x5f')]['id'],_0x1c4e91['user'][_0xbd23('0x3a')],_0x1c4e91[_0xbd23('0x5f')]['role'],_0x173812[_0xbd23('0x64')]['id'],_0x1c4e91[_0xbd23('0x56')]?JSON['stringify'](_0x1c4e91[_0xbd23('0x56')]):'null');return respondWithRpcPromise(_0xbd23('0x7c'),'rejectMessage',_0x173812);}return null;})[_0xbd23('0x38')](function(_0x5eb784){var _0x2264bc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5eb784[_0xbd23('0x27')][_0xbd23('0x6a')];return db[_0xbd23('0x6b')][_0xbd23('0x41')](_0x2264bc,{'type':db['Sequelize'][_0xbd23('0x7d')][_0xbd23('0x7e')],'raw':!![]})['then'](function(_0x40eb67){return _0x40eb67;});})[_0xbd23('0x38')](function(_0x4e9ee7){if(_0x4e9ee7){_0x173812[_0xbd23('0x27')]['contact']=_0x4e9ee7[0x0];if(!_0x1c4e91[_0xbd23('0x56')][_0xbd23('0x5e')])return;return db['User'][_0xbd23('0x54')]({'where':{'id':_0x1c4e91[_0xbd23('0x56')][_0xbd23('0x5e')],'role':_0xbd23('0x72')},'attributes':['id',_0xbd23('0x3a'),_0xbd23('0x6f'),_0xbd23('0x70'),_0xbd23('0x71')],'raw':!![]});}return null;})[_0xbd23('0x38')](function(_0x470443){if(!_0x470443)return null;_0x173812[_0xbd23('0x27')][_0xbd23('0x72')]=_0x470443;return _0x173812;})[_0xbd23('0x38')](function(_0xd26f01){if(_0xd26f01){_0xd26f01[_0xbd23('0x27')][_0xbd23('0x7f')]=util[_0xbd23('0x5c')](_0xbd23('0x74'),_0x1c4e91[_0xbd23('0x5f')][_0xbd23('0x3a')]);_0xd26f01[_0xbd23('0x27')]['channel']=_0x173812['channel'];_0xd26f01['message'][_0xbd23('0x76')]=_0x173812[_0xbd23('0x75')];_0xd26f01[_0xbd23('0x27')][_0xbd23('0x77')]=_0xbd23('0x35');respondWithRpcPromise('EventManager',_0xbd23('0x80'),{'event':_0xbd23('0x81'),'message':_0xd26f01[_0xbd23('0x27')]},client9002);return _0x173812;}return null;})['then'](respondWithResult(_0x5244b9,null))[_0xbd23('0x29')](handleError(_0x5244b9,null));};exports[_0xbd23('0x2c')]=function(_0x495d86,_0x4ba73f,_0x19e5f6){if(_0x495d86[_0xbd23('0x56')]['id']){delete _0x495d86[_0xbd23('0x56')]['id'];}var _0x268269;return db[_0xbd23('0x3d')]['find']({'where':{'id':_0x495d86[_0xbd23('0x53')]['id']}})[_0xbd23('0x38')](handleEntityNotFound(_0x4ba73f,null))[_0xbd23('0x38')](function(_0x127f69){if(_0x127f69){_0x268269=_0x127f69;return db['WhatsappAccount'][_0xbd23('0x54')]({'where':{'id':_0x127f69[_0xbd23('0x82')]}});}})[_0xbd23('0x38')](handleEntityNotFound(_0x4ba73f,null))['then'](function(_0x228a98){if(_0x228a98){logger[_0xbd23('0x22')](_0xbd23('0x83'),'status',_0xbd23('0x84'),_0x228a98[_0xbd23('0x40')],util[_0xbd23('0x85')](_0x495d86[_0xbd23('0x56')],{'showHidden':![],'depth':null}));switch(_0x228a98['type']){case'twilio':if(_0x495d86[_0xbd23('0x56')]['MessageSid']&&_0x495d86[_0xbd23('0x56')][_0xbd23('0x86')]===_0x268269[_0xbd23('0x87')]&&_0x495d86[_0xbd23('0x56')][_0xbd23('0x88')]&&_0x495d86['body'][_0xbd23('0x88')]===_0xbd23('0x5a')){return _0x268269[_0xbd23('0x37')]({'read':!![]});}else{logger[_0xbd23('0x25')](_0xbd23('0x89'),_0xbd23('0x2c'),_0xbd23('0x8a'),util[_0xbd23('0x85')](_0x495d86[_0xbd23('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x268269;}})['then'](respondWithResult(_0x4ba73f,null))[_0xbd23('0x29')](handleError(_0x4ba73f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 714dc76..4b53fff 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 _0xd139=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xa0dc4b,_0x2a89d1){var _0x1e4a3f=function(_0x1d5ef3){while(--_0x1d5ef3){_0xa0dc4b['push'](_0xa0dc4b['shift']());}};_0x1e4a3f(++_0x2a89d1);}(_0xd139,0x14e));var _0x9d13=function(_0x24325b,_0x28fe0f){_0x24325b=_0x24325b-0x0;var _0x1cf842=_0xd139[_0x24325b];return _0x1cf842;};'use strict';var EventEmitter=require(_0x9d13('0x0'));var WhatsappMessage=require(_0x9d13('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d13('0x2'),'afterUpdate':_0x9d13('0x3'),'afterDestroy':_0x9d13('0x4')};function emitEvent(_0x1994e8){return function(_0x1d39f0,_0xdeacf6,_0x16b9f2){WhatsappMessageEvents['emit'](_0x1994e8+':'+_0x1d39f0['id'],_0x1d39f0);WhatsappMessageEvents[_0x9d13('0x5')](_0x1994e8,_0x1d39f0);_0x16b9f2(null);};}for(var e in events){if(events[_0x9d13('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x9d13('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7fce=['remove','emit','hook','exports','events','../../mysqldb','WhatsappMessage','save'];(function(_0x126c21,_0x20cde8){var _0x49c80d=function(_0x4a318b){while(--_0x4a318b){_0x126c21['push'](_0x126c21['shift']());}};_0x49c80d(++_0x20cde8);}(_0x7fce,0xdc));var _0xe7fc=function(_0x57f680,_0x515ee2){_0x57f680=_0x57f680-0x0;var _0x139851=_0x7fce[_0x57f680];return _0x139851;};'use strict';var EventEmitter=require(_0xe7fc('0x0'));var WhatsappMessage=require(_0xe7fc('0x1'))['db'][_0xe7fc('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7fc('0x3'),'afterUpdate':'update','afterDestroy':_0xe7fc('0x4')};function emitEvent(_0x51b19d){return function(_0x11cdec,_0x337972,_0x5810de){WhatsappMessageEvents['emit'](_0x51b19d+':'+_0x11cdec['id'],_0x11cdec);WhatsappMessageEvents[_0xe7fc('0x5')](_0x51b19d,_0x11cdec);_0x5810de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xe7fc('0x6')](e,emitEvent(event));}}module[_0xe7fc('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 0e904e0..d41f278 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 _0x744b=['then','update','toLowerCase','catch','error','WhatsappAccount','find','type','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','direction','out','secret','isNil','findOne'];(function(_0x50a7b0,_0x5caba9){var _0x473b48=function(_0x2f6ba3){while(--_0x2f6ba3){_0x50a7b0['push'](_0x50a7b0['shift']());}};_0x473b48(++_0x5caba9);}(_0x744b,0xff));var _0xb744=function(_0x46bfdd,_0x342b59){_0x46bfdd=_0x46bfdd-0x0;var _0x5e42c5=_0x744b[_0x46bfdd];return _0x5e42c5;};'use strict';var _=require(_0xb744('0x0'));var util=require(_0xb744('0x1'));var logger=require(_0xb744('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb744('0x3'));var rp=require(_0xb744('0x4'));var fs=require('fs');var path=require(_0xb744('0x5'));var rimraf=require(_0xb744('0x6'));var config=require(_0xb744('0x7'));var attributes=require(_0xb744('0x8'));module['exports']=function(_0x17c7d5,_0x28f40b){return _0x17c7d5[_0xb744('0x9')](_0xb744('0xa'),attributes,{'tableName':_0xb744('0xb'),'paranoid':![],'indexes':[{'name':_0xb744('0xc'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xb744('0xd')],'type':_0xb744('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a1833,_0x1ec836,_0x235306){var _0x4ef7ed=_0x17c7d5[_0xb744('0xf')];var _0x554cbe=_0x1a1833['get']({'plain':!![]});if(_0x554cbe[_0xb744('0x10')]['toLowerCase']()==='in'||_0x554cbe['direction']['toLowerCase']()===_0xb744('0x11')&&!_0x554cbe[_0xb744('0x12')]&&!_[_0xb744('0x13')](_0x554cbe['UserId'])){_0x4ef7ed['WhatsappInteraction'][_0xb744('0x14')]({'where':{'id':_0x554cbe['WhatsappInteractionId']}})[_0xb744('0x15')](function(_0x4d63ee){if(_0x4d63ee){_0x4d63ee[_0xb744('0x16')]({'lastMsgAt':_0x554cbe['createdAt'],'lastMsgDirection':_0x554cbe[_0xb744('0x10')][_0xb744('0x17')]()});}})[_0xb744('0x18')](function(_0x4784b5){console[_0xb744('0x19')](_0x4784b5);});}if(_0x554cbe[_0xb744('0x10')]==='out'&&!_0x554cbe[_0xb744('0x12')]){var _0x228c17;_0x4ef7ed[_0xb744('0x1a')][_0xb744('0x1b')]({'where':{'id':_0x554cbe['WhatsappAccountId']},'raw':!![]})[_0xb744('0x15')](function(_0x4383e2){_0x228c17=_0x4383e2;if(_0x228c17&&_0x228c17[_0xb744('0x1c')]){switch(_0x228c17['type']){case'twilio':var _0x2e25dc=require('twilio');if(_0x228c17[_0xb744('0x1d')]&&_0x228c17[_0xb744('0x1e')]&&_0x228c17[_0xb744('0x1f')]){var _0x43aa99=new _0x2e25dc(_0x228c17[_0xb744('0x1d')],_0x228c17[_0xb744('0x1e')]);_0x43aa99['messages'][_0xb744('0x20')]({'body':_0x554cbe[_0xb744('0xd')],'to':_0xb744('0x21')+_0x554cbe['phone'],'from':_0xb744('0x21')+_0x228c17[_0xb744('0x1f')],'statusCallback':_0x228c17[_0xb744('0x22')]+_0xb744('0x23')+_0x554cbe['id']+_0xb744('0x24')+_0x228c17[_0xb744('0x25')]})[_0xb744('0x15')](function(_0x2a0832){if(_0x2a0832['sid']){return _0x1a1833[_0xb744('0x16')]({'messageId':_0x2a0832[_0xb744('0x26')]});}})[_0xb744('0x18')](function(_0x14d08f){logger[_0xb744('0x19')](_0xb744('0x27'),_0xb744('0x28'),'twilio',util[_0xb744('0x29')](_0x14d08f,{'showHidden':![],'depth':null}));});}else{logger[_0xb744('0x19')](_0xb744('0x27'),_0xb744('0x28'),_0xb744('0x2a'),_0xb744('0x2b'));}break;}}})['finally'](function(){_0x235306();});}else{_0x235306();}}},'charset':_0xb744('0x2c'),'collate':_0xb744('0x2d')});}; \ No newline at end of file +var _0xbb90=['UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','lodash','../../config/logger','moment','bluebird','request-promise','path','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x5c4185,_0x3026c5){var _0x592c7b=function(_0x14ad9d){while(--_0x14ad9d){_0x5c4185['push'](_0x5c4185['shift']());}};_0x592c7b(++_0x3026c5);}(_0xbb90,0x193));var _0x0bb9=function(_0x3f52eb,_0x2a8ded){_0x3f52eb=_0x3f52eb-0x0;var _0x456ed6=_0xbb90[_0x3f52eb];return _0x456ed6;};'use strict';var _=require(_0x0bb9('0x0'));var util=require('util');var logger=require(_0x0bb9('0x1'))('api');var moment=require(_0x0bb9('0x2'));var BPromise=require(_0x0bb9('0x3'));var rp=require(_0x0bb9('0x4'));var fs=require('fs');var path=require(_0x0bb9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0bb9('0x6'));module[_0x0bb9('0x7')]=function(_0x4ab1ac,_0x5d1fc4){return _0x4ab1ac[_0x0bb9('0x8')](_0x0bb9('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x0bb9('0xa'),'fields':[_0x0bb9('0xa')]},{'name':_0x0bb9('0xb'),'fields':['body'],'type':_0x0bb9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44b04a,_0x198fa0,_0x33ac5c){var _0x2833ad=_0x4ab1ac[_0x0bb9('0xd')];var _0x3111a3=_0x44b04a[_0x0bb9('0xe')]({'plain':!![]});if(_0x3111a3[_0x0bb9('0xf')][_0x0bb9('0x10')]()==='in'||_0x3111a3[_0x0bb9('0xf')]['toLowerCase']()===_0x0bb9('0x11')&&!_0x3111a3[_0x0bb9('0x12')]&&!_[_0x0bb9('0x13')](_0x3111a3[_0x0bb9('0x14')])){_0x2833ad[_0x0bb9('0x15')]['findOne']({'where':{'id':_0x3111a3[_0x0bb9('0x16')]}})['then'](function(_0x16f6af){if(_0x16f6af){_0x16f6af[_0x0bb9('0x17')]({'lastMsgAt':_0x3111a3[_0x0bb9('0x18')],'lastMsgDirection':_0x3111a3[_0x0bb9('0xf')][_0x0bb9('0x10')]()});}})[_0x0bb9('0x19')](function(_0x59f8bf){console[_0x0bb9('0x1a')](_0x59f8bf);});}if(_0x3111a3[_0x0bb9('0xf')]===_0x0bb9('0x11')&&!_0x3111a3[_0x0bb9('0x12')]){var _0x1b5681;_0x2833ad[_0x0bb9('0x1b')][_0x0bb9('0x1c')]({'where':{'id':_0x3111a3['WhatsappAccountId']},'raw':!![]})[_0x0bb9('0x1d')](function(_0x3e9855){_0x1b5681=_0x3e9855;if(_0x1b5681&&_0x1b5681[_0x0bb9('0x1e')]){switch(_0x1b5681['type']){case'twilio':var _0x5b6709=require(_0x0bb9('0x1f'));if(_0x1b5681[_0x0bb9('0x20')]&&_0x1b5681[_0x0bb9('0x21')]&&_0x1b5681[_0x0bb9('0x22')]){var _0x11aa2a=new _0x5b6709(_0x1b5681[_0x0bb9('0x20')],_0x1b5681[_0x0bb9('0x21')]);_0x11aa2a[_0x0bb9('0x23')][_0x0bb9('0x24')]({'body':_0x3111a3[_0x0bb9('0x25')],'to':_0x0bb9('0x26')+_0x3111a3['phone'],'from':_0x0bb9('0x26')+_0x1b5681[_0x0bb9('0x22')],'statusCallback':_0x1b5681[_0x0bb9('0x27')]+_0x0bb9('0x28')+_0x3111a3['id']+'/status?token='+_0x1b5681[_0x0bb9('0x29')]})[_0x0bb9('0x1d')](function(_0x1e6fb1){if(_0x1e6fb1[_0x0bb9('0x2a')]){return _0x44b04a['update']({'messageId':_0x1e6fb1['sid']});}})[_0x0bb9('0x19')](function(_0x5daecb){logger[_0x0bb9('0x1a')](_0x0bb9('0x2b'),_0x0bb9('0x2c'),_0x0bb9('0x1f'),util['inspect'](_0x5daecb,{'showHidden':![],'depth':null}));});}else{logger[_0x0bb9('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x0bb9('0x2c'),_0x0bb9('0x1f'),_0x0bb9('0x2d'));}break;}}})[_0x0bb9('0x2e')](function(){_0x33ac5c();});}else{_0x33ac5c();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 169d3fb..7e7861e 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 _0x5a1b=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','WhatsappMessage','create','CreateWhatsappMessage','stringify','lodash','util','moment','randomstring'];(function(_0x1025ae,_0x5ebb6a){var _0x86e388=function(_0x2fddc6){while(--_0x2fddc6){_0x1025ae['push'](_0x1025ae['shift']());}};_0x86e388(++_0x5ebb6a);}(_0x5a1b,0xec));var _0xb5a1=function(_0x4f160c,_0x26f177){_0x4f160c=_0x4f160c-0x0;var _0xa12ce=_0x5a1b[_0x4f160c];return _0xa12ce;};'use strict';var _=require(_0xb5a1('0x0'));var util=require(_0xb5a1('0x1'));var moment=require(_0xb5a1('0x2'));var BPromise=require('bluebird');var rs=require(_0xb5a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5a1('0x4'))['db'];var utils=require(_0xb5a1('0x5'));var logger=require(_0xb5a1('0x6'))(_0xb5a1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5a1('0x8')][_0xb5a1('0x9')]({'port':0x232a});config['redis']=_[_0xb5a1('0xa')](config[_0xb5a1('0xb')],{'host':_0xb5a1('0xc'),'port':0x18eb});var socket=require(_0xb5a1('0xd'))(new Redis(config['redis']));require(_0xb5a1('0xe'))['register'](socket);function respondWithRpcPromise(_0x3e9ce2,_0x3e1f65,_0x2f0e1c){return new BPromise(function(_0xa1b7f4,_0x3bcce2){return client[_0xb5a1('0xf')](_0x3e9ce2,_0x2f0e1c)[_0xb5a1('0x10')](function(_0x5c46ec){logger[_0xb5a1('0x11')](_0xb5a1('0x12'),_0x3e1f65,_0xb5a1('0x13'));logger[_0xb5a1('0x14')](_0xb5a1('0x15'),_0x3e1f65,_0xb5a1('0x13'),JSON['stringify'](_0x5c46ec));if(_0x5c46ec['error']){if(_0x5c46ec[_0xb5a1('0x16')][_0xb5a1('0x17')]===0x1f4){logger[_0xb5a1('0x16')](_0xb5a1('0x12'),_0x3e1f65,_0x5c46ec[_0xb5a1('0x16')][_0xb5a1('0x18')]);return _0x3bcce2(_0x5c46ec[_0xb5a1('0x16')][_0xb5a1('0x18')]);}logger[_0xb5a1('0x16')](_0xb5a1('0x12'),_0x3e1f65,_0x5c46ec[_0xb5a1('0x16')][_0xb5a1('0x18')]);return _0xa1b7f4(_0x5c46ec[_0xb5a1('0x16')][_0xb5a1('0x18')]);}else{logger[_0xb5a1('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x3e1f65,_0xb5a1('0x13'));_0xa1b7f4(_0x5c46ec['result'][_0xb5a1('0x18')]);}})[_0xb5a1('0x19')](function(_0xab090d){logger[_0xb5a1('0x16')](_0xb5a1('0x12'),_0x3e1f65,_0xab090d);_0x3bcce2(_0xab090d);});});}exports['CreateWhatsappMessage']=function(_0x2a5e7b){var _0x3ce573=this;return new Promise(function(_0x58c507,_0x3e2ca2){return db[_0xb5a1('0x1a')][_0xb5a1('0x1b')](_0x2a5e7b['body'],{'raw':_0x2a5e7b['options']?_0x2a5e7b['options']['raw']===undefined?!![]:![]:!![]})[_0xb5a1('0x10')](function(_0x21d99d){logger[_0xb5a1('0x11')](_0xb5a1('0x1c'),_0x2a5e7b);logger['debug'](_0xb5a1('0x1c'),_0x2a5e7b,JSON[_0xb5a1('0x1d')](_0x21d99d));_0x58c507(_0x21d99d);})[_0xb5a1('0x19')](function(_0x2d4657){logger[_0xb5a1('0x16')](_0xb5a1('0x1c'),_0x2d4657['message'],_0x2a5e7b);_0x3e2ca2(_0x3ce573['error'](0x1f4,_0x2d4657[_0xb5a1('0x18')]));});});}; \ No newline at end of file +var _0xb3f7=['body','options','raw','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','create'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb3f7,0x1cb));var _0x7b3f=function(_0x3abb8c,_0x1cbac1){_0x3abb8c=_0x3abb8c-0x0;var _0x566f02=_0xb3f7[_0x3abb8c];return _0x566f02;};'use strict';var _=require('lodash');var util=require(_0x7b3f('0x0'));var moment=require(_0x7b3f('0x1'));var BPromise=require(_0x7b3f('0x2'));var rs=require(_0x7b3f('0x3'));var fs=require('fs');var Redis=require(_0x7b3f('0x4'));var db=require(_0x7b3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b3f('0x6'))(_0x7b3f('0x7'));var config=require(_0x7b3f('0x8'));var jayson=require(_0x7b3f('0x9'));var client=jayson[_0x7b3f('0xa')][_0x7b3f('0xb')]({'port':0x232a});config['redis']=_[_0x7b3f('0xc')](config[_0x7b3f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b3f('0xe'))(new Redis(config[_0x7b3f('0xd')]));require(_0x7b3f('0xf'))[_0x7b3f('0x10')](socket);function respondWithRpcPromise(_0x1eccaf,_0x203a9b,_0x24fdb8){return new BPromise(function(_0x18d7a0,_0x10229d){return client[_0x7b3f('0x11')](_0x1eccaf,_0x24fdb8)[_0x7b3f('0x12')](function(_0x315144){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x203a9b,_0x7b3f('0x13'));logger[_0x7b3f('0x14')](_0x7b3f('0x15'),_0x203a9b,_0x7b3f('0x13'),JSON['stringify'](_0x315144));if(_0x315144[_0x7b3f('0x16')]){if(_0x315144[_0x7b3f('0x16')][_0x7b3f('0x17')]===0x1f4){logger[_0x7b3f('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x203a9b,_0x315144[_0x7b3f('0x16')][_0x7b3f('0x18')]);return _0x10229d(_0x315144[_0x7b3f('0x16')][_0x7b3f('0x18')]);}logger[_0x7b3f('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x203a9b,_0x315144['error'][_0x7b3f('0x18')]);return _0x18d7a0(_0x315144[_0x7b3f('0x16')]['message']);}else{logger['info'](_0x7b3f('0x19'),_0x203a9b,_0x7b3f('0x13'));_0x18d7a0(_0x315144[_0x7b3f('0x1a')][_0x7b3f('0x18')]);}})[_0x7b3f('0x1b')](function(_0x2b1699){logger['error'](_0x7b3f('0x19'),_0x203a9b,_0x2b1699);_0x10229d(_0x2b1699);});});}exports[_0x7b3f('0x1c')]=function(_0x514a81){var _0x45b936=this;return new Promise(function(_0x5c3718,_0x7967e1){return db[_0x7b3f('0x1d')][_0x7b3f('0x1e')](_0x514a81[_0x7b3f('0x1f')],{'raw':_0x514a81[_0x7b3f('0x20')]?_0x514a81['options'][_0x7b3f('0x21')]===undefined?!![]:![]:!![]})[_0x7b3f('0x12')](function(_0x15fba5){logger[_0x7b3f('0x22')](_0x7b3f('0x1c'),_0x514a81);logger[_0x7b3f('0x14')](_0x7b3f('0x1c'),_0x514a81,JSON['stringify'](_0x15fba5));_0x5c3718(_0x15fba5);})[_0x7b3f('0x1b')](function(_0x14d945){logger['error'](_0x7b3f('0x1c'),_0x14d945[_0x7b3f('0x18')],_0x514a81);_0x7967e1(_0x45b936[_0x7b3f('0x16')](0x1f4,_0x14d945[_0x7b3f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 6b0276b..2e55315 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 _0xc832=['emit','register','length','./whatsappMessage.events','remove'];(function(_0x6221f8,_0xc78fdc){var _0x3c935c=function(_0x1189a1){while(--_0x1189a1){_0x6221f8['push'](_0x6221f8['shift']());}};_0x3c935c(++_0xc78fdc);}(_0xc832,0x1e8));var _0x2c83=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc832[_0x21549c];return _0x426cbd;};'use strict';var WhatsappMessageEvents=require(_0x2c83('0x0'));var events=['save',_0x2c83('0x1'),'update'];function createListener(_0x563e6e,_0x5ee2df){return function(_0x5c8596){_0x5ee2df[_0x2c83('0x2')](_0x563e6e,_0x5c8596);};}function removeListener(_0x3f8db7,_0x573de6){return function(){WhatsappMessageEvents['removeListener'](_0x3f8db7,_0x573de6);};}exports[_0x2c83('0x3')]=function(_0x1e58b8){for(var _0x4263ba=0x0,_0xe1d659=events[_0x2c83('0x4')];_0x4263ba<_0xe1d659;_0x4263ba++){var _0x2c80db=events[_0x4263ba];var _0x169dc2=createListener('whatsappMessage:'+_0x2c80db,_0x1e58b8);WhatsappMessageEvents['on'](_0x2c80db,_0x169dc2);}}; \ No newline at end of file +var _0x505d=['./whatsappMessage.events','emit','removeListener','length','whatsappMessage:'];(function(_0x1b3938,_0x1c5799){var _0x4ee099=function(_0x3abb44){while(--_0x3abb44){_0x1b3938['push'](_0x1b3938['shift']());}};_0x4ee099(++_0x1c5799);}(_0x505d,0xe1));var _0xd505=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x505d[_0x261e29];return _0x25ef43;};'use strict';var WhatsappMessageEvents=require(_0xd505('0x0'));var events=['save','remove','update'];function createListener(_0x3be4f3,_0xb9337e){return function(_0x103ccb){_0xb9337e[_0xd505('0x1')](_0x3be4f3,_0x103ccb);};}function removeListener(_0x49a92d,_0x3bf306){return function(){WhatsappMessageEvents[_0xd505('0x2')](_0x49a92d,_0x3bf306);};}exports['register']=function(_0x1a11a9){for(var _0x2c4922=0x0,_0x174cce=events[_0xd505('0x3')];_0x2c4922<_0x174cce;_0x2c4922++){var _0x2fb190=events[_0x2c4922];var _0x421958=createListener(_0xd505('0x4')+_0x2fb190,_0x1a11a9);WhatsappMessageEvents['on'](_0x2fb190,_0x421958);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index f5273e2..fa085c2 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 _0xc1c5=['/:id/teams','/:id/users','post','addAgents','put','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers'];(function(_0x37d81f,_0x5e1a2d){var _0x2f4ced=function(_0x242c8a){while(--_0x242c8a){_0x37d81f['push'](_0x37d81f['shift']());}};_0x2f4ced(++_0x5e1a2d);}(_0xc1c5,0x75));var _0x5c1c=function(_0x44b514,_0x2db9bb){_0x44b514=_0x44b514-0x0;var _0x28bb0e=_0xc1c5[_0x44b514];return _0x28bb0e;};'use strict';var multer=require(_0x5c1c('0x0'));var util=require(_0x5c1c('0x1'));var path=require(_0x5c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c1c('0x3'));var router=express[_0x5c1c('0x4')]();var fs_extra=require(_0x5c1c('0x5'));var auth=require(_0x5c1c('0x6'));var interaction=require(_0x5c1c('0x7'));var config=require(_0x5c1c('0x8'));var controller=require(_0x5c1c('0x9'));router[_0x5c1c('0xa')]('/',auth[_0x5c1c('0xb')](),controller[_0x5c1c('0xc')]);router[_0x5c1c('0xa')](_0x5c1c('0xd'),auth['isAuthenticated'](),controller[_0x5c1c('0xe')]);router['get'](_0x5c1c('0xf'),auth[_0x5c1c('0xb')](),controller[_0x5c1c('0x10')]);router['get']('/:id/members',auth[_0x5c1c('0xb')](),controller[_0x5c1c('0x11')]);router['get'](_0x5c1c('0x12'),auth[_0x5c1c('0xb')](),controller['getTeams']);router[_0x5c1c('0xa')](_0x5c1c('0x13'),auth[_0x5c1c('0xb')](),controller['getAgents']);router[_0x5c1c('0x14')]('/',auth[_0x5c1c('0xb')](),controller['create']);router[_0x5c1c('0x14')](_0x5c1c('0x12'),auth[_0x5c1c('0xb')](),controller['addTeams']);router[_0x5c1c('0x14')](_0x5c1c('0x13'),auth['isAuthenticated'](),controller[_0x5c1c('0x15')]);router[_0x5c1c('0x16')](_0x5c1c('0xf'),auth[_0x5c1c('0xb')](),controller[_0x5c1c('0x17')]);router['delete'](_0x5c1c('0xf'),auth[_0x5c1c('0xb')](),controller['destroy']);router[_0x5c1c('0x18')](_0x5c1c('0x12'),auth[_0x5c1c('0xb')](),controller['removeTeams']);router[_0x5c1c('0x18')]('/:id/users',auth[_0x5c1c('0xb')](),controller[_0x5c1c('0x19')]);module[_0x5c1c('0x1a')]=router; \ No newline at end of file +var _0x5f10=['put','/:id','update','delete','destroy','removeTeams','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addAgents'];(function(_0x43c01f,_0x435bb1){var _0x87522e=function(_0x92d18b){while(--_0x92d18b){_0x43c01f['push'](_0x43c01f['shift']());}};_0x87522e(++_0x435bb1);}(_0x5f10,0x1bc));var _0x05f1=function(_0x38ecda,_0x3b551e){_0x38ecda=_0x38ecda-0x0;var _0x3fa8f3=_0x5f10[_0x38ecda];return _0x3fa8f3;};'use strict';var multer=require('multer');var util=require(_0x05f1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x05f1('0x1'));var auth=require(_0x05f1('0x2'));var interaction=require(_0x05f1('0x3'));var config=require('../../config/environment');var controller=require(_0x05f1('0x4'));router[_0x05f1('0x5')]('/',auth[_0x05f1('0x6')](),controller['index']);router[_0x05f1('0x5')](_0x05f1('0x7'),auth[_0x05f1('0x6')](),controller[_0x05f1('0x8')]);router[_0x05f1('0x5')]('/:id',auth[_0x05f1('0x6')](),controller['show']);router[_0x05f1('0x5')](_0x05f1('0x9'),auth[_0x05f1('0x6')](),controller[_0x05f1('0xa')]);router[_0x05f1('0x5')](_0x05f1('0xb'),auth['isAuthenticated'](),controller['getTeams']);router[_0x05f1('0x5')](_0x05f1('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x05f1('0xd')]('/',auth[_0x05f1('0x6')](),controller[_0x05f1('0xe')]);router['post'](_0x05f1('0xb'),auth[_0x05f1('0x6')](),controller['addTeams']);router[_0x05f1('0xd')](_0x05f1('0xc'),auth[_0x05f1('0x6')](),controller[_0x05f1('0xf')]);router[_0x05f1('0x10')](_0x05f1('0x11'),auth[_0x05f1('0x6')](),controller[_0x05f1('0x12')]);router[_0x05f1('0x13')](_0x05f1('0x11'),auth['isAuthenticated'](),controller[_0x05f1('0x14')]);router[_0x05f1('0x13')](_0x05f1('0xb'),auth[_0x05f1('0x6')](),controller[_0x05f1('0x15')]);router['delete'](_0x05f1('0xc'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x05f1('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ba6d7cf..32219e6 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(_0x3d2a37,_0x1209a1){var _0x4d6eb3=function(_0x309851){while(--_0x309851){_0x3d2a37['push'](_0x3d2a37['shift']());}};_0x4d6eb3(++_0x1209a1);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0xb7fc[_0x337eeb];return _0x2dfdd8;};'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 _0x7ae7=['STRING','sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x38f9e1,_0x247873){var _0x2aad78=function(_0x3d1217){while(--_0x3d1217){_0x38f9e1['push'](_0x38f9e1['shift']());}};_0x2aad78(++_0x247873);}(_0x7ae7,0xd9));var _0x77ae=function(_0x39ef0e,_0x1dd6b9){_0x39ef0e=_0x39ef0e-0x0;var _0x1b96e6=_0x7ae7[_0x39ef0e];return _0x1b96e6;};'use strict';var Sequelize=require(_0x77ae('0x0'));module[_0x77ae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x77ae('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x77ae('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77ae('0x4')](_0x77ae('0x5'),_0x77ae('0x6'),_0x77ae('0x7'))},'description':{'type':Sequelize[_0x77ae('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 2b1a4ce..856515d 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 _0xfe29=['rimraf','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','UserWhatsappQueue','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','getTeams','Team','order','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format'];(function(_0x866bd2,_0x267503){var _0x3ea2b0=function(_0x832f49){while(--_0x832f49){_0x866bd2['push'](_0x866bd2['shift']());}};_0x3ea2b0(++_0x267503);}(_0xfe29,0x1bb));var _0x9fe2=function(_0x260c8c,_0x3761cf){_0x260c8c=_0x260c8c-0x0;var _0x137518=_0xfe29[_0x260c8c];return _0x137518;};'use strict';var emlformat=require(_0x9fe2('0x0'));var rimraf=require(_0x9fe2('0x1'));var zipdir=require(_0x9fe2('0x2'));var jsonpatch=require(_0x9fe2('0x3'));var rp=require(_0x9fe2('0x4'));var moment=require(_0x9fe2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9fe2('0x6'));var util=require(_0x9fe2('0x7'));var path=require(_0x9fe2('0x8'));var sox=require(_0x9fe2('0x9'));var csv=require(_0x9fe2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fe2('0xb'));var _=require(_0x9fe2('0xc'));var squel=require(_0x9fe2('0xd'));var crypto=require(_0x9fe2('0xe'));var jsforce=require(_0x9fe2('0xf'));var deskjs=require(_0x9fe2('0x10'));var toCsv=require(_0x9fe2('0xa'));var querystring=require(_0x9fe2('0x11'));var Papa=require(_0x9fe2('0x12'));var Redis=require('ioredis');var authService=require(_0x9fe2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9fe2('0x14'));var hardwareService=require(_0x9fe2('0x15'));var logger=require(_0x9fe2('0x16'))(_0x9fe2('0x17'));var utils=require(_0x9fe2('0x18'));var config=require(_0x9fe2('0x19'));var licenseUtil=require(_0x9fe2('0x1a'));var db=require(_0x9fe2('0x1b'))['db'];config[_0x9fe2('0x1c')]=_[_0x9fe2('0x1d')](config[_0x9fe2('0x1c')],{'host':_0x9fe2('0x1e'),'port':0x18eb});var socket=require(_0x9fe2('0x1f'))(new Redis(config[_0x9fe2('0x1c')]));require(_0x9fe2('0x20'))[_0x9fe2('0x21')](socket);function respondWithStatusCode(_0x180edb,_0x3ed498){_0x3ed498=_0x3ed498||0xcc;return function(_0x38673e){if(_0x38673e){return _0x180edb[_0x9fe2('0x22')](_0x3ed498);}return _0x180edb['status'](_0x3ed498)[_0x9fe2('0x23')]();};}function respondWithResult(_0x28a7b6,_0x7cb2ac){_0x7cb2ac=_0x7cb2ac||0xc8;return function(_0x5e0e4a){if(_0x5e0e4a){return _0x28a7b6[_0x9fe2('0x24')](_0x7cb2ac)[_0x9fe2('0x25')](_0x5e0e4a);}};}function respondWithFilteredResult(_0x4f2534,_0xaf69e0){return function(_0x5872c8){if(_0x5872c8){var _0x1477b4=typeof _0xaf69e0[_0x9fe2('0x26')]===_0x9fe2('0x27')&&typeof _0xaf69e0[_0x9fe2('0x28')]==='undefined';var _0x480ef1=_0x5872c8[_0x9fe2('0x29')];var _0x42ef6f=_0x1477b4?0x0:_0xaf69e0[_0x9fe2('0x26')];var _0x5d9eb0=_0x1477b4?_0x5872c8[_0x9fe2('0x29')]:_0xaf69e0['offset']+_0xaf69e0[_0x9fe2('0x28')];var _0x35425e;if(_0x5d9eb0>=_0x480ef1){_0x5d9eb0=_0x480ef1;_0x35425e=0xc8;}else{_0x35425e=0xce;}_0x4f2534[_0x9fe2('0x24')](_0x35425e);return _0x4f2534[_0x9fe2('0x2a')](_0x9fe2('0x2b'),_0x42ef6f+'-'+_0x5d9eb0+'/'+_0x480ef1)[_0x9fe2('0x25')](_0x5872c8);}return null;};}function patchUpdates(_0x260897){return function(_0x46b95c){try{jsonpatch[_0x9fe2('0x2c')](_0x46b95c,_0x260897,!![]);}catch(_0x2f3d3d){return BPromise[_0x9fe2('0x2d')](_0x2f3d3d);}return _0x46b95c[_0x9fe2('0x2e')]();};}function saveUpdates(_0x320e72,_0x4267c7){return function(_0x1f42f4){if(_0x1f42f4){return _0x1f42f4[_0x9fe2('0x2f')](_0x320e72)[_0x9fe2('0x30')](function(_0x5a538b){return _0x5a538b;});}return null;};}function removeEntity(_0xe89576,_0x1f0118){return function(_0x18c747){if(_0x18c747){return _0x18c747[_0x9fe2('0x31')]()[_0x9fe2('0x30')](function(){var _0x48590d=_0x18c747[_0x9fe2('0x32')]({'plain':!![]});var _0xe6c65d=_0x9fe2('0x33');return db[_0x9fe2('0x34')][_0x9fe2('0x31')]({'where':{'type':_0xe6c65d,'resourceId':_0x48590d['id']}})[_0x9fe2('0x30')](function(){return _0x18c747;});})[_0x9fe2('0x30')](function(){_0xe89576['status'](0xcc)[_0x9fe2('0x23')]();});}};}function handleEntityNotFound(_0x481be1,_0xba9d58){return function(_0x5dc5c5){if(!_0x5dc5c5){_0x481be1[_0x9fe2('0x22')](0x194);}return _0x5dc5c5;};}function handleError(_0x241d2a,_0xe103ee){_0xe103ee=_0xe103ee||0x1f4;return function(_0x44a6b5){logger[_0x9fe2('0x35')](_0x44a6b5[_0x9fe2('0x36')]);if(_0x44a6b5[_0x9fe2('0x37')]){delete _0x44a6b5[_0x9fe2('0x37')];}_0x241d2a[_0x9fe2('0x24')](_0xe103ee)[_0x9fe2('0x38')](_0x44a6b5);};}exports[_0x9fe2('0x39')]=function(_0x56df94,_0x17e475){var _0x2dabfe={},_0x481ed0={},_0x1125c6={'count':0x0,'rows':[]};var _0x400289=_['map'](db[_0x9fe2('0x3a')][_0x9fe2('0x3b')],function(_0x336628){return{'name':_0x336628[_0x9fe2('0x3c')],'type':_0x336628[_0x9fe2('0x3d')][_0x9fe2('0x3e')]};});_0x481ed0[_0x9fe2('0x3f')]=_[_0x9fe2('0x40')](_0x400289,_0x9fe2('0x37'));_0x481ed0[_0x9fe2('0x41')]=_[_0x9fe2('0x42')](_0x56df94[_0x9fe2('0x41')]);_0x481ed0[_0x9fe2('0x43')]=_[_0x9fe2('0x44')](_0x481ed0['model'],_0x481ed0['query']);_0x2dabfe[_0x9fe2('0x45')]=_[_0x9fe2('0x44')](_0x481ed0[_0x9fe2('0x3f')],qs[_0x9fe2('0x46')](_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x46')]));_0x2dabfe['attributes']=_0x2dabfe['attributes'][_0x9fe2('0x47')]?_0x2dabfe[_0x9fe2('0x45')]:_0x481ed0[_0x9fe2('0x3f')];if(!_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x48')]('nolimit')){_0x2dabfe[_0x9fe2('0x28')]=qs[_0x9fe2('0x28')](_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x28')]);_0x2dabfe['offset']=qs[_0x9fe2('0x26')](_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x26')]);}_0x2dabfe['order']=qs[_0x9fe2('0x49')](_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x49')]);_0x2dabfe['where']=qs[_0x9fe2('0x43')](_[_0x9fe2('0x4a')](_0x56df94['query'],_0x481ed0[_0x9fe2('0x43')]),_0x400289);if(_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x4b')]){_0x2dabfe[_0x9fe2('0x4c')]=_[_0x9fe2('0x4d')](_0x2dabfe[_0x9fe2('0x4c')],{'$or':_[_0x9fe2('0x40')](_0x400289,function(_0x154d43){if(_0x154d43[_0x9fe2('0x3d')]!==_0x9fe2('0x4e')){var _0x5c41ef={};_0x5c41ef[_0x154d43[_0x9fe2('0x37')]]={'$like':'%'+_0x56df94[_0x9fe2('0x41')][_0x9fe2('0x4b')]+'%'};return _0x5c41ef;}})});}_0x2dabfe=_[_0x9fe2('0x4d')]({},_0x2dabfe,_0x56df94[_0x9fe2('0x4f')]);var _0x3bd9f9={'where':_0x2dabfe['where']};return db[_0x9fe2('0x3a')][_0x9fe2('0x29')](_0x3bd9f9)['then'](function(_0x4f9334){_0x1125c6[_0x9fe2('0x29')]=_0x4f9334;if(_0x56df94['query'][_0x9fe2('0x50')]){_0x2dabfe['include']=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x2dabfe);})[_0x9fe2('0x30')](function(_0x3538f8){_0x1125c6[_0x9fe2('0x51')]=_0x3538f8;return _0x1125c6;})['then'](respondWithFilteredResult(_0x17e475,_0x2dabfe))[_0x9fe2('0x52')](handleError(_0x17e475,null));};exports['show']=function(_0x10e9ae,_0x40fb52){var _0x420a09={'raw':!![],'where':{'id':_0x10e9ae[_0x9fe2('0x53')]['id']}},_0x43a0da={};_0x43a0da[_0x9fe2('0x3f')]=_[_0x9fe2('0x42')](db[_0x9fe2('0x3a')]['rawAttributes']);_0x43a0da[_0x9fe2('0x41')]=_[_0x9fe2('0x42')](_0x10e9ae[_0x9fe2('0x41')]);_0x43a0da[_0x9fe2('0x43')]=_[_0x9fe2('0x44')](_0x43a0da[_0x9fe2('0x3f')],_0x43a0da[_0x9fe2('0x41')]);_0x420a09['attributes']=_['intersection'](_0x43a0da[_0x9fe2('0x3f')],qs[_0x9fe2('0x46')](_0x10e9ae[_0x9fe2('0x41')][_0x9fe2('0x46')]));_0x420a09[_0x9fe2('0x45')]=_0x420a09[_0x9fe2('0x45')]['length']?_0x420a09['attributes']:_0x43a0da['model'];if(_0x10e9ae['query'][_0x9fe2('0x50')]){_0x420a09[_0x9fe2('0x54')]=[{'all':!![]}];}_0x420a09=_[_0x9fe2('0x4d')]({},_0x420a09,_0x10e9ae['options']);return db['WhatsappQueue'][_0x9fe2('0x55')](_0x420a09)[_0x9fe2('0x30')](handleEntityNotFound(_0x40fb52,null))[_0x9fe2('0x30')](respondWithResult(_0x40fb52,null))['catch'](handleError(_0x40fb52,null));};exports[_0x9fe2('0x56')]=function(_0x205c5b,_0x12704e){return db['WhatsappQueue'][_0x9fe2('0x56')](_0x205c5b['body'],{})[_0x9fe2('0x30')](function(_0x1edeca){var _0x2d454f=_0x205c5b[_0x9fe2('0x57')][_0x9fe2('0x32')]({'plain':!![]});if(!_0x2d454f)throw new Error(_0x9fe2('0x58'));if(_0x2d454f['role']===_0x9fe2('0x57')){var _0x255466=_0x1edeca[_0x9fe2('0x32')]({'plain':!![]});var _0x54f635=_0x9fe2('0x33');return db['UserProfileSection'][_0x9fe2('0x55')]({'where':{'name':_0x54f635,'userProfileId':_0x2d454f[_0x9fe2('0x59')]},'raw':!![]})['then'](function(_0x5d8ebb){if(_0x5d8ebb&&_0x5d8ebb['autoAssociation']===0x0){return db['UserProfileResource'][_0x9fe2('0x56')]({'name':_0x255466['name'],'resourceId':_0x255466['id'],'type':_0x5d8ebb[_0x9fe2('0x37')],'sectionId':_0x5d8ebb['id']},{})[_0x9fe2('0x30')](function(){return _0x1edeca;});}else{return _0x1edeca;}})['catch'](function(_0x281519){logger[_0x9fe2('0x35')](_0x9fe2('0x5a'),_0x281519);throw _0x281519;});}return _0x1edeca;})[_0x9fe2('0x30')](respondWithResult(_0x12704e,0xc9))[_0x9fe2('0x52')](handleError(_0x12704e,null));};exports[_0x9fe2('0x2f')]=function(_0x37630b,_0x245132){if(_0x37630b['body']['id']){delete _0x37630b[_0x9fe2('0x5b')]['id'];}return db[_0x9fe2('0x3a')][_0x9fe2('0x55')]({'where':{'id':_0x37630b['params']['id']}})[_0x9fe2('0x30')](handleEntityNotFound(_0x245132,null))[_0x9fe2('0x30')](saveUpdates(_0x37630b[_0x9fe2('0x5b')],null))[_0x9fe2('0x30')](respondWithResult(_0x245132,null))[_0x9fe2('0x52')](handleError(_0x245132,null));};exports[_0x9fe2('0x31')]=function(_0x3dca57,_0x43c2b6){return db[_0x9fe2('0x3a')][_0x9fe2('0x55')]({'where':{'id':_0x3dca57[_0x9fe2('0x53')]['id']}})['then'](handleEntityNotFound(_0x43c2b6,null))['then'](removeEntity(_0x43c2b6,null))[_0x9fe2('0x52')](handleError(_0x43c2b6,null));};exports['describe']=function(_0x5f3623,_0x1f6a85){return db['WhatsappQueue'][_0x9fe2('0x5c')]()[_0x9fe2('0x30')](respondWithResult(_0x1f6a85,null))[_0x9fe2('0x52')](handleError(_0x1f6a85,null));};exports[_0x9fe2('0x5d')]=function(_0x519688,_0x219de2,_0x5f322d){var _0xd6fc67={'raw':!![],'where':{}},_0x395f53={},_0x3e4cb3;return db[_0x9fe2('0x3a')][_0x9fe2('0x5e')]({'where':{'id':_0x519688[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](handleEntityNotFound(_0x219de2,null))[_0x9fe2('0x30')](function(_0x11be9a){if(_0x11be9a){_0x3e4cb3=_0x11be9a[_0x9fe2('0x32')]({'plain':!![]});_0x395f53[_0x9fe2('0x3f')]=_['keys'](db['UserWhatsappQueue'][_0x9fe2('0x3b')]);_0x395f53['query']=_[_0x9fe2('0x42')](_0x519688['query']);_0x395f53[_0x9fe2('0x43')]=_[_0x9fe2('0x44')](_0x395f53[_0x9fe2('0x3f')],_0x395f53[_0x9fe2('0x41')]);_0xd6fc67[_0x9fe2('0x45')]=_['intersection'](_0x395f53[_0x9fe2('0x3f')],qs[_0x9fe2('0x46')](_0x519688[_0x9fe2('0x41')]['fields']));_0xd6fc67['attributes']=_0xd6fc67['attributes']['length']?_0xd6fc67[_0x9fe2('0x45')]:_0x395f53[_0x9fe2('0x3f')];if(!_0x519688[_0x9fe2('0x41')][_0x9fe2('0x48')](_0x9fe2('0x5f'))){_0xd6fc67[_0x9fe2('0x28')]=qs[_0x9fe2('0x28')](_0x519688[_0x9fe2('0x41')][_0x9fe2('0x28')]);_0xd6fc67[_0x9fe2('0x26')]=qs[_0x9fe2('0x26')](_0x519688[_0x9fe2('0x41')]['offset']);}_0xd6fc67['order']=qs[_0x9fe2('0x49')](_0x519688[_0x9fe2('0x41')][_0x9fe2('0x49')]);_0xd6fc67[_0x9fe2('0x4c')]=qs[_0x9fe2('0x43')](_['pick'](_0x519688[_0x9fe2('0x41')],_0x395f53[_0x9fe2('0x43')]));_0xd6fc67[_0x9fe2('0x4c')]['WhatsappQueueId']=_0x11be9a['id'];if(_0x519688['query'][_0x9fe2('0x4b')]){_0xd6fc67[_0x9fe2('0x4c')]=_[_0x9fe2('0x4d')](_0xd6fc67['where'],{'$or':_[_0x9fe2('0x40')](_0xd6fc67['attributes'],function(_0x549ecb){var _0x3436be={};_0x3436be[_0x549ecb]={'$like':'%'+_0x519688[_0x9fe2('0x41')][_0x9fe2('0x4b')]+'%'};return _0x3436be;})});}_0xd6fc67=_['merge']({},_0xd6fc67,_0x519688[_0x9fe2('0x4f')]);return db[_0x9fe2('0x60')]['findAll'](_0xd6fc67);}})[_0x9fe2('0x30')](function(_0x1b9048){if(_0x1b9048){return db[_0x9fe2('0x61')][_0x9fe2('0x62')]({'where':{'id':_[_0x9fe2('0x40')](_0x1b9048,'UserId'),'role':_0x9fe2('0x63')},'attributes':['id',_0x9fe2('0x37'),'whatsappPause',_0x9fe2('0x64'),_0x9fe2('0x65')]});}})[_0x9fe2('0x30')](function(_0x5be514){if(_0x5be514){return{'count':_0x5be514[_0x9fe2('0x29')],'rows':_[_0x9fe2('0x40')](_0x5be514['rows'],function(_0x488c9b){return{'membername':_0x488c9b[_0x9fe2('0x37')],'UserId':_0x488c9b['id'],'queue_name':_0x3e4cb3[_0x9fe2('0x37')],'WhatsappQueueId':_0x3e4cb3['id'],'interface':util[_0x9fe2('0x66')](_0x9fe2('0x67'),_0x9fe2('0x68'),_0x488c9b['name']),'penalty':0x0,'paused':_0x488c9b[_0x9fe2('0x69')],'createdAt':_0x488c9b[_0x9fe2('0x65')],'updatedAt':_0x488c9b[_0x9fe2('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x219de2,_0xd6fc67))[_0x9fe2('0x52')](handleError(_0x219de2,null));};exports[_0x9fe2('0x6a')]=function(_0x3c871c,_0x216a8a,_0x58746f){var _0x4609e4={};var _0x23062b={};var _0x3e4ccd;var _0x42ce34;return db[_0x9fe2('0x3a')][_0x9fe2('0x5e')]({'where':{'id':_0x3c871c[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](handleEntityNotFound(_0x216a8a,null))[_0x9fe2('0x30')](function(_0x5dcc3c){if(_0x5dcc3c){_0x3e4ccd=_0x5dcc3c;_0x23062b['model']=_[_0x9fe2('0x42')](db[_0x9fe2('0x6b')][_0x9fe2('0x3b')]);_0x23062b[_0x9fe2('0x41')]=_[_0x9fe2('0x42')](_0x3c871c['query']);_0x23062b[_0x9fe2('0x43')]=_['intersection'](_0x23062b[_0x9fe2('0x3f')],_0x23062b[_0x9fe2('0x41')]);_0x4609e4['attributes']=_['intersection'](_0x23062b[_0x9fe2('0x3f')],qs[_0x9fe2('0x46')](_0x3c871c[_0x9fe2('0x41')][_0x9fe2('0x46')]));_0x4609e4[_0x9fe2('0x45')]=_0x4609e4[_0x9fe2('0x45')][_0x9fe2('0x47')]?_0x4609e4[_0x9fe2('0x45')]:_0x23062b['model'];_0x4609e4[_0x9fe2('0x6c')]=qs[_0x9fe2('0x49')](_0x3c871c['query'][_0x9fe2('0x49')]);_0x4609e4['where']=qs[_0x9fe2('0x43')](_[_0x9fe2('0x4a')](_0x3c871c[_0x9fe2('0x41')],_0x23062b[_0x9fe2('0x43')]));if(_0x3c871c[_0x9fe2('0x41')][_0x9fe2('0x4b')]){_0x4609e4[_0x9fe2('0x4c')]=_[_0x9fe2('0x4d')](_0x4609e4['where'],{'$or':_['map'](_0x4609e4[_0x9fe2('0x45')],function(_0x52d61f){var _0x2a5792={};_0x2a5792[_0x52d61f]={'$like':'%'+_0x3c871c[_0x9fe2('0x41')][_0x9fe2('0x4b')]+'%'};return _0x2a5792;})});}_0x4609e4=_['merge']({},_0x4609e4,_0x3c871c[_0x9fe2('0x4f')]);return _0x3e4ccd[_0x9fe2('0x6a')](_0x4609e4);}})[_0x9fe2('0x30')](function(_0x33c3a9){if(_0x33c3a9){_0x42ce34=_0x33c3a9[_0x9fe2('0x47')];if(!_0x3c871c['query'][_0x9fe2('0x48')](_0x9fe2('0x5f'))){_0x4609e4['limit']=qs['limit'](_0x3c871c[_0x9fe2('0x41')][_0x9fe2('0x28')]);_0x4609e4[_0x9fe2('0x26')]=qs[_0x9fe2('0x26')](_0x3c871c[_0x9fe2('0x41')][_0x9fe2('0x26')]);}return _0x3e4ccd['getTeams'](_0x4609e4);}})[_0x9fe2('0x30')](function(_0x5785d5){if(_0x5785d5){return _0x5785d5?{'count':_0x42ce34,'rows':_0x5785d5}:null;}})['then'](respondWithResult(_0x216a8a,null))[_0x9fe2('0x52')](handleError(_0x216a8a,null));};exports[_0x9fe2('0x6d')]=function(_0x23670e,_0x34952e,_0x5be524){var _0x37324a=_0x23670e['body'][_0x9fe2('0x6e')];return db[_0x9fe2('0x6b')][_0x9fe2('0x6f')]({'where':{'id':_0x37324a},'attributes':['id'],'include':[{'model':db[_0x9fe2('0x61')],'as':'Agents','attributes':['id','name',_0x9fe2('0x70'),_0x9fe2('0x71'),_0x9fe2('0x72')],'raw':!![]}]})[_0x9fe2('0x30')](function(_0x2af6fe){if(_0x2af6fe){var _0x184511=_[_0x9fe2('0x73')](_0x2af6fe,function(_0x1ee612){var _0x8a2b2f=_0x1ee612[_0x9fe2('0x32')]({'plain':!![]});return _0x8a2b2f[_0x9fe2('0x74')];});return db[_0x9fe2('0x3a')]['find']({'where':{'id':_0x23670e[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](function(_0x32d6fd){return db[_0x9fe2('0x75')]['transaction'](function(_0x569ba3){return _0x32d6fd[_0x9fe2('0x6d')](_0x37324a,{'transaction':_0x569ba3})[_0x9fe2('0x30')](function(){return BPromise[_0x9fe2('0x76')](_0x184511,function(_0x2b0ccb){return db[_0x9fe2('0x60')][_0x9fe2('0x77')]({'where':{'UserId':_0x2b0ccb['id'],'WhatsappQueueId':_0x23670e[_0x9fe2('0x53')]['id']},'transaction':_0x569ba3});});})[_0x9fe2('0x30')](function(){_0x184511['forEach'](function(_0xa4108a){socket[_0x9fe2('0x78')](_0x9fe2('0x79'),{'UserId':_0xa4108a['id'],'WhatsappQueueId':_0x32d6fd['id']});});});});});}})[_0x9fe2('0x30')](respondWithStatusCode(_0x34952e,null))[_0x9fe2('0x52')](handleError(_0x34952e,null));};exports[_0x9fe2('0x7a')]=function(_0x29b6a0,_0x3645bf,_0x516231){return db[_0x9fe2('0x6b')]['findAll']({'where':{'id':_0x29b6a0['query'][_0x9fe2('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x9fe2('0x61')],'as':_0x9fe2('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3645bf,null))['then'](function(_0x4a4eea){var _0x5e614e=_[_0x9fe2('0x40')](_0x4a4eea,'id');var _0x2f911a=[];var _0x33edb4=[];var _0x1bc833=squel[_0x9fe2('0x7b')]();_0x1bc833[_0x9fe2('0x7c')](_0x9fe2('0x7d'))['from'](_0x9fe2('0x7e'),'tq')[_0x9fe2('0x7f')]('user_has_teams','ut',_0x9fe2('0x80'))[_0x9fe2('0x4c')]('WhatsappQueueId\x20=\x20?',_0x29b6a0[_0x9fe2('0x53')]['id']);for(var _0x1f8304=0x0;_0x1f8304<_0x4a4eea['length'];_0x1f8304+=0x1){let _0xcf768f=_0x4a4eea[_0x1f8304];for(var _0x270b3d=0x0;_0x270b3d<_0xcf768f['Agents'][_0x9fe2('0x47')];_0x270b3d+=0x1){let _0x44a679=_0xcf768f['Agents'][_0x270b3d];var _0x48bb02=_0x1bc833[_0x9fe2('0x81')]();_0x48bb02[_0x9fe2('0x4c')](_0x9fe2('0x82'),_0x44a679['id']);_0x33edb4['push'](db['sequelize'][_0x9fe2('0x41')](_0x48bb02[_0x9fe2('0x83')](),{'type':db[_0x9fe2('0x75')][_0x9fe2('0x84')][_0x9fe2('0x85')]})[_0x9fe2('0x30')](function(_0x103506){if(_0x103506[_0x9fe2('0x47')]===0x1){return _0x44a679['id'];}else{var _0x12f4b0=_[_0x9fe2('0x86')](_[_0x9fe2('0x40')](_0x103506,_0x9fe2('0x87')),function(_0x74aaba){return _[_0x9fe2('0x88')](_0x5e614e,_0x74aaba);});if(_0x12f4b0){return _0x44a679['id'];}}}));}}return BPromise[_0x9fe2('0x89')](_0x33edb4)[_0x9fe2('0x30')](function(_0x28eb98){_0x2f911a=_(_0x2f911a)[_0x9fe2('0x8a')](_0x28eb98)[_0x9fe2('0x8b')]()[_0x9fe2('0x8c')]();return db[_0x9fe2('0x3a')]['find']({'where':{'id':_0x29b6a0[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](function(_0x5c695e){return db['sequelize'][_0x9fe2('0x8d')](function(_0x24dd3d){return _0x5c695e[_0x9fe2('0x7a')](_0x29b6a0['query'][_0x9fe2('0x6e')],{'transaction':_0x24dd3d})[_0x9fe2('0x30')](function(){if(!_[_0x9fe2('0x8e')](_0x2f911a)){return _0x5c695e['removeAgents'](_0x2f911a,{'transaction':_0x24dd3d});}})['then'](function(){_0x2f911a['forEach'](function(_0x17df58){socket[_0x9fe2('0x78')](_0x9fe2('0x8f'),{'UserId':_0x17df58,'WhatsappQueueId':_0x5c695e['id']});});});});});});})[_0x9fe2('0x30')](respondWithStatusCode(_0x3645bf,null))[_0x9fe2('0x52')](handleError(_0x3645bf,null));};exports[_0x9fe2('0x90')]=function(_0x4e42a1,_0x4ce8cc,_0xd112b2){return db['WhatsappQueue'][_0x9fe2('0x55')]({'where':{'id':_0x4e42a1[_0x9fe2('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ce8cc,null))['then'](function(_0x5e7d3c){if(_0x5e7d3c){return _0x5e7d3c['addAgents'](_0x4e42a1[_0x9fe2('0x5b')][_0x9fe2('0x6e')],_[_0x9fe2('0x91')](_0x4e42a1[_0x9fe2('0x5b')],[_0x9fe2('0x6e'),'id'])||{})['spread'](function(_0x341a85){for(var _0x276670=0x0;_0x276670<_0x4e42a1['body'][_0x9fe2('0x6e')]['length'];_0x276670+=0x1){socket[_0x9fe2('0x78')](_0x9fe2('0x79'),{'UserId':Number(_0x4e42a1[_0x9fe2('0x5b')]['ids'][_0x276670]),'WhatsappQueueId':Number(_0x4e42a1['params']['id'])});}return _0x341a85;});}})[_0x9fe2('0x30')](respondWithResult(_0x4ce8cc,null))['catch'](handleError(_0x4ce8cc,null));};exports['removeAgents']=function(_0x311321,_0x340da6,_0x3e0f16){return db[_0x9fe2('0x3a')][_0x9fe2('0x55')]({'where':{'id':_0x311321[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](handleEntityNotFound(_0x340da6,null))['then'](function(_0x540023){if(_0x540023){return _0x540023['removeAgents'](_0x311321['query'][_0x9fe2('0x6e')])['then'](function(){if(_[_0x9fe2('0x92')](_0x311321[_0x9fe2('0x41')][_0x9fe2('0x6e')])){for(var _0x4c663e=0x0;_0x4c663e<_0x311321[_0x9fe2('0x41')][_0x9fe2('0x6e')][_0x9fe2('0x47')];_0x4c663e+=0x1){socket[_0x9fe2('0x78')](_0x9fe2('0x8f'),{'UserId':Number(_0x311321[_0x9fe2('0x41')][_0x9fe2('0x6e')][_0x4c663e]),'WhatsappQueueId':Number(_0x311321[_0x9fe2('0x53')]['id'])});}}else{socket[_0x9fe2('0x78')](_0x9fe2('0x8f'),{'UserId':Number(_0x311321[_0x9fe2('0x41')]['ids']),'WhatsappQueueId':Number(_0x311321['params']['id'])});}});}})['then'](respondWithStatusCode(_0x340da6,null))[_0x9fe2('0x52')](handleError(_0x340da6,null));};exports['getAgents']=function(_0x4fc6da,_0x17b83c,_0x14de25){var _0x5a3bb0={};var _0x58a262={};var _0x117ca3;var _0x49ff18;return db[_0x9fe2('0x3a')][_0x9fe2('0x5e')]({'where':{'id':_0x4fc6da[_0x9fe2('0x53')]['id']}})[_0x9fe2('0x30')](handleEntityNotFound(_0x17b83c,null))[_0x9fe2('0x30')](function(_0x133666){if(_0x133666){_0x117ca3=_0x133666;_0x58a262[_0x9fe2('0x3f')]=_[_0x9fe2('0x42')](db[_0x9fe2('0x61')]['rawAttributes']);_0x58a262[_0x9fe2('0x41')]=_[_0x9fe2('0x42')](_0x4fc6da[_0x9fe2('0x41')]);_0x58a262['filters']=_['intersection'](_0x58a262['model'],_0x58a262['query']);_0x5a3bb0[_0x9fe2('0x45')]=_['intersection'](_0x58a262[_0x9fe2('0x3f')],qs[_0x9fe2('0x46')](_0x4fc6da['query'][_0x9fe2('0x46')]));_0x5a3bb0['attributes']=_0x5a3bb0[_0x9fe2('0x45')][_0x9fe2('0x47')]?_0x5a3bb0[_0x9fe2('0x45')]:_0x58a262['model'];_0x5a3bb0[_0x9fe2('0x6c')]=qs[_0x9fe2('0x49')](_0x4fc6da[_0x9fe2('0x41')][_0x9fe2('0x49')]);_0x5a3bb0[_0x9fe2('0x4c')]=qs[_0x9fe2('0x43')](_[_0x9fe2('0x4a')](_0x4fc6da[_0x9fe2('0x41')],_0x58a262['filters']));if(_0x4fc6da[_0x9fe2('0x41')][_0x9fe2('0x4b')]){_0x5a3bb0[_0x9fe2('0x4c')]=_['merge'](_0x5a3bb0['where'],{'$or':_['map'](_0x5a3bb0[_0x9fe2('0x45')],function(_0x544077){var _0x31ea9d={};_0x31ea9d[_0x544077]={'$like':'%'+_0x4fc6da[_0x9fe2('0x41')]['filter']+'%'};return _0x31ea9d;})});}_0x5a3bb0=_['merge']({},_0x5a3bb0,_0x4fc6da['options']);return _0x117ca3[_0x9fe2('0x93')](_0x5a3bb0);}})[_0x9fe2('0x30')](function(_0x109a6c){if(_0x109a6c){_0x49ff18=_0x109a6c[_0x9fe2('0x47')];if(!_0x4fc6da['query'][_0x9fe2('0x48')](_0x9fe2('0x5f'))){_0x5a3bb0[_0x9fe2('0x28')]=qs[_0x9fe2('0x28')](_0x4fc6da[_0x9fe2('0x41')]['limit']);_0x5a3bb0[_0x9fe2('0x26')]=qs[_0x9fe2('0x26')](_0x4fc6da['query'][_0x9fe2('0x26')]);}return _0x117ca3[_0x9fe2('0x93')](_0x5a3bb0);}})[_0x9fe2('0x30')](function(_0x54828a){if(_0x54828a){return _0x54828a?{'count':_0x49ff18,'rows':_0x54828a}:null;}})[_0x9fe2('0x30')](respondWithResult(_0x17b83c,null))[_0x9fe2('0x52')](handleError(_0x17b83c,null));}; \ No newline at end of file +var _0x7683=['create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserWhatsappQueue','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userWhatsappQueue:save','removeTeams','User','select','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','isEmpty','removeAgents','forEach','emit','omit','spread','isArray','userWhatsappQueue:remove','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','WhatsappQueues','destroy','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','show','keys','options','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x4202ba,_0x2c52fa){var _0x1feba3=function(_0x185520){while(--_0x185520){_0x4202ba['push'](_0x4202ba['shift']());}};_0x1feba3(++_0x2c52fa);}(_0x7683,0x1ed));var _0x3768=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x7683[_0x26da89];return _0xc95b7b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3768('0x0'));var rp=require(_0x3768('0x1'));var moment=require(_0x3768('0x2'));var BPromise=require(_0x3768('0x3'));var Mustache=require(_0x3768('0x4'));var util=require(_0x3768('0x5'));var path=require(_0x3768('0x6'));var sox=require(_0x3768('0x7'));var csv=require(_0x3768('0x8'));var ejs=require(_0x3768('0x9'));var fs=require('fs');var fs_extra=require(_0x3768('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3768('0xb'));var jsforce=require(_0x3768('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3768('0xd'));var Papa=require(_0x3768('0xe'));var Redis=require(_0x3768('0xf'));var authService=require(_0x3768('0x10'));var qs=require(_0x3768('0x11'));var as=require(_0x3768('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3768('0x13'))(_0x3768('0x14'));var utils=require(_0x3768('0x15'));var config=require(_0x3768('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3768('0x17'))['db'];config[_0x3768('0x18')]=_[_0x3768('0x19')](config[_0x3768('0x18')],{'host':_0x3768('0x1a'),'port':0x18eb});var socket=require(_0x3768('0x1b'))(new Redis(config[_0x3768('0x18')]));require(_0x3768('0x1c'))[_0x3768('0x1d')](socket);function respondWithStatusCode(_0x560a33,_0x365e82){_0x365e82=_0x365e82||0xcc;return function(_0x22c804){if(_0x22c804){return _0x560a33[_0x3768('0x1e')](_0x365e82);}return _0x560a33[_0x3768('0x1f')](_0x365e82)[_0x3768('0x20')]();};}function respondWithResult(_0x48f3c3,_0x5c00aa){_0x5c00aa=_0x5c00aa||0xc8;return function(_0x5f40f5){if(_0x5f40f5){return _0x48f3c3[_0x3768('0x1f')](_0x5c00aa)['json'](_0x5f40f5);}};}function respondWithFilteredResult(_0x4ea361,_0x4707ee){return function(_0x2532a7){if(_0x2532a7){var _0x3198f7=typeof _0x4707ee[_0x3768('0x21')]===_0x3768('0x22')&&typeof _0x4707ee[_0x3768('0x23')]===_0x3768('0x22');var _0x3a8770=_0x2532a7[_0x3768('0x24')];var _0x2d8b54=_0x3198f7?0x0:_0x4707ee[_0x3768('0x21')];var _0x21c8a9=_0x3198f7?_0x2532a7[_0x3768('0x24')]:_0x4707ee['offset']+_0x4707ee[_0x3768('0x23')];var _0x32c7ea;if(_0x21c8a9>=_0x3a8770){_0x21c8a9=_0x3a8770;_0x32c7ea=0xc8;}else{_0x32c7ea=0xce;}_0x4ea361['status'](_0x32c7ea);return _0x4ea361[_0x3768('0x25')]('Content-Range',_0x2d8b54+'-'+_0x21c8a9+'/'+_0x3a8770)[_0x3768('0x26')](_0x2532a7);}return null;};}function patchUpdates(_0x4f9ec4){return function(_0x1ca48e){try{jsonpatch[_0x3768('0x27')](_0x1ca48e,_0x4f9ec4,!![]);}catch(_0x438079){return BPromise[_0x3768('0x28')](_0x438079);}return _0x1ca48e[_0x3768('0x29')]();};}function saveUpdates(_0x3940da,_0x21639d){return function(_0x2fc5a2){if(_0x2fc5a2){return _0x2fc5a2[_0x3768('0x2a')](_0x3940da)[_0x3768('0x2b')](function(_0xd4800e){return _0xd4800e;});}return null;};}function removeEntity(_0x49c41f,_0x1dbe01){return function(_0x13c095){if(_0x13c095){return _0x13c095['destroy']()['then'](function(){var _0x5dcf20=_0x13c095[_0x3768('0x2c')]({'plain':!![]});var _0x5bfd69=_0x3768('0x2d');return db['UserProfileResource'][_0x3768('0x2e')]({'where':{'type':_0x5bfd69,'resourceId':_0x5dcf20['id']}})[_0x3768('0x2b')](function(){return _0x13c095;});})[_0x3768('0x2b')](function(){_0x49c41f[_0x3768('0x1f')](0xcc)[_0x3768('0x20')]();});}};}function handleEntityNotFound(_0x878667,_0x1879ce){return function(_0x41a44c){if(!_0x41a44c){_0x878667[_0x3768('0x1e')](0x194);}return _0x41a44c;};}function handleError(_0x3dd1bd,_0x4bfc99){_0x4bfc99=_0x4bfc99||0x1f4;return function(_0xffc674){logger['error'](_0xffc674[_0x3768('0x2f')]);if(_0xffc674['name']){delete _0xffc674[_0x3768('0x30')];}_0x3dd1bd[_0x3768('0x1f')](_0x4bfc99)[_0x3768('0x31')](_0xffc674);};}exports[_0x3768('0x32')]=function(_0x1bf10b,_0x2a08a8){var _0x547e20={},_0x22c70f={},_0x4586b3={'count':0x0,'rows':[]};var _0x274f9c=_['map'](db[_0x3768('0x33')][_0x3768('0x34')],function(_0x499784){return{'name':_0x499784[_0x3768('0x35')],'type':_0x499784['type']['key']};});_0x22c70f[_0x3768('0x36')]=_[_0x3768('0x37')](_0x274f9c,_0x3768('0x30'));_0x22c70f[_0x3768('0x38')]=_['keys'](_0x1bf10b['query']);_0x22c70f[_0x3768('0x39')]=_[_0x3768('0x3a')](_0x22c70f[_0x3768('0x36')],_0x22c70f[_0x3768('0x38')]);_0x547e20[_0x3768('0x3b')]=_[_0x3768('0x3a')](_0x22c70f['model'],qs[_0x3768('0x3c')](_0x1bf10b['query'][_0x3768('0x3c')]));_0x547e20[_0x3768('0x3b')]=_0x547e20[_0x3768('0x3b')][_0x3768('0x3d')]?_0x547e20[_0x3768('0x3b')]:_0x22c70f['model'];if(!_0x1bf10b[_0x3768('0x38')][_0x3768('0x3e')](_0x3768('0x3f'))){_0x547e20[_0x3768('0x23')]=qs[_0x3768('0x23')](_0x1bf10b['query']['limit']);_0x547e20[_0x3768('0x21')]=qs['offset'](_0x1bf10b[_0x3768('0x38')][_0x3768('0x21')]);}_0x547e20[_0x3768('0x40')]=qs[_0x3768('0x41')](_0x1bf10b[_0x3768('0x38')]['sort']);_0x547e20[_0x3768('0x42')]=qs[_0x3768('0x39')](_[_0x3768('0x43')](_0x1bf10b[_0x3768('0x38')],_0x22c70f[_0x3768('0x39')]),_0x274f9c);if(_0x1bf10b[_0x3768('0x38')]['filter']){_0x547e20[_0x3768('0x42')]=_[_0x3768('0x44')](_0x547e20[_0x3768('0x42')],{'$or':_[_0x3768('0x37')](_0x274f9c,function(_0x57d1ad){if(_0x57d1ad[_0x3768('0x45')]!=='VIRTUAL'){var _0x364fc8={};_0x364fc8[_0x57d1ad['name']]={'$like':'%'+_0x1bf10b[_0x3768('0x38')][_0x3768('0x46')]+'%'};return _0x364fc8;}})});}_0x547e20=_[_0x3768('0x44')]({},_0x547e20,_0x1bf10b['options']);var _0x3361dc={'where':_0x547e20['where']};return db[_0x3768('0x33')][_0x3768('0x24')](_0x3361dc)['then'](function(_0x2b6d40){_0x4586b3[_0x3768('0x24')]=_0x2b6d40;if(_0x1bf10b['query'][_0x3768('0x47')]){_0x547e20[_0x3768('0x48')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x3768('0x49')](_0x547e20);})[_0x3768('0x2b')](function(_0x1922ae){_0x4586b3[_0x3768('0x4a')]=_0x1922ae;return _0x4586b3;})[_0x3768('0x2b')](respondWithFilteredResult(_0x2a08a8,_0x547e20))['catch'](handleError(_0x2a08a8,null));};exports[_0x3768('0x4b')]=function(_0x17b5e8,_0x49a1f1){var _0x427d3e={'raw':!![],'where':{'id':_0x17b5e8['params']['id']}},_0x5d54f2={};_0x5d54f2[_0x3768('0x36')]=_[_0x3768('0x4c')](db['WhatsappQueue'][_0x3768('0x34')]);_0x5d54f2[_0x3768('0x38')]=_[_0x3768('0x4c')](_0x17b5e8[_0x3768('0x38')]);_0x5d54f2['filters']=_[_0x3768('0x3a')](_0x5d54f2[_0x3768('0x36')],_0x5d54f2[_0x3768('0x38')]);_0x427d3e['attributes']=_['intersection'](_0x5d54f2[_0x3768('0x36')],qs[_0x3768('0x3c')](_0x17b5e8[_0x3768('0x38')][_0x3768('0x3c')]));_0x427d3e['attributes']=_0x427d3e['attributes'][_0x3768('0x3d')]?_0x427d3e[_0x3768('0x3b')]:_0x5d54f2['model'];if(_0x17b5e8['query'][_0x3768('0x47')]){_0x427d3e[_0x3768('0x48')]=[{'all':!![]}];}_0x427d3e=_[_0x3768('0x44')]({},_0x427d3e,_0x17b5e8[_0x3768('0x4d')]);return db[_0x3768('0x33')][_0x3768('0x4e')](_0x427d3e)['then'](handleEntityNotFound(_0x49a1f1,null))[_0x3768('0x2b')](respondWithResult(_0x49a1f1,null))[_0x3768('0x4f')](handleError(_0x49a1f1,null));};exports['create']=function(_0xcc8198,_0x40a843){return db[_0x3768('0x33')]['create'](_0xcc8198['body'],{})[_0x3768('0x2b')](function(_0x2cfa92){var _0x471061=_0xcc8198[_0x3768('0x50')][_0x3768('0x2c')]({'plain':!![]});if(!_0x471061)throw new Error(_0x3768('0x51'));if(_0x471061[_0x3768('0x52')]===_0x3768('0x50')){var _0x5eb4ed=_0x2cfa92['get']({'plain':!![]});var _0x44c796=_0x3768('0x2d');return db[_0x3768('0x53')]['find']({'where':{'name':_0x44c796,'userProfileId':_0x471061[_0x3768('0x54')]},'raw':!![]})[_0x3768('0x2b')](function(_0x2b1b6c){if(_0x2b1b6c&&_0x2b1b6c[_0x3768('0x55')]===0x0){return db[_0x3768('0x56')][_0x3768('0x57')]({'name':_0x5eb4ed['name'],'resourceId':_0x5eb4ed['id'],'type':_0x2b1b6c['name'],'sectionId':_0x2b1b6c['id']},{})[_0x3768('0x2b')](function(){return _0x2cfa92;});}else{return _0x2cfa92;}})[_0x3768('0x4f')](function(_0x41c93a){logger[_0x3768('0x58')](_0x3768('0x59'),_0x41c93a);throw _0x41c93a;});}return _0x2cfa92;})[_0x3768('0x2b')](respondWithResult(_0x40a843,0xc9))[_0x3768('0x4f')](handleError(_0x40a843,null));};exports[_0x3768('0x2a')]=function(_0x38719b,_0x3ed746){if(_0x38719b[_0x3768('0x5a')]['id']){delete _0x38719b['body']['id'];}return db[_0x3768('0x33')][_0x3768('0x4e')]({'where':{'id':_0x38719b['params']['id']}})['then'](handleEntityNotFound(_0x3ed746,null))[_0x3768('0x2b')](saveUpdates(_0x38719b['body'],null))['then'](respondWithResult(_0x3ed746,null))['catch'](handleError(_0x3ed746,null));};exports[_0x3768('0x2e')]=function(_0x2ce996,_0xc1aa67){return db[_0x3768('0x33')]['find']({'where':{'id':_0x2ce996[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](handleEntityNotFound(_0xc1aa67,null))['then'](removeEntity(_0xc1aa67,null))['catch'](handleError(_0xc1aa67,null));};exports[_0x3768('0x5c')]=function(_0x3143ea,_0x20b08c){return db[_0x3768('0x33')]['describe']()[_0x3768('0x2b')](respondWithResult(_0x20b08c,null))[_0x3768('0x4f')](handleError(_0x20b08c,null));};exports[_0x3768('0x5d')]=function(_0xca7190,_0x2ca6a4,_0x37532c){var _0x5f4d14={'raw':!![],'where':{}},_0x1d522f={},_0xc3fc53;return db['WhatsappQueue']['findOne']({'where':{'id':_0xca7190[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](handleEntityNotFound(_0x2ca6a4,null))[_0x3768('0x2b')](function(_0xc71bc0){if(_0xc71bc0){_0xc3fc53=_0xc71bc0['get']({'plain':!![]});_0x1d522f[_0x3768('0x36')]=_[_0x3768('0x4c')](db[_0x3768('0x5e')][_0x3768('0x34')]);_0x1d522f[_0x3768('0x38')]=_[_0x3768('0x4c')](_0xca7190['query']);_0x1d522f[_0x3768('0x39')]=_['intersection'](_0x1d522f['model'],_0x1d522f['query']);_0x5f4d14[_0x3768('0x3b')]=_[_0x3768('0x3a')](_0x1d522f[_0x3768('0x36')],qs['fields'](_0xca7190[_0x3768('0x38')][_0x3768('0x3c')]));_0x5f4d14[_0x3768('0x3b')]=_0x5f4d14[_0x3768('0x3b')]['length']?_0x5f4d14[_0x3768('0x3b')]:_0x1d522f[_0x3768('0x36')];if(!_0xca7190[_0x3768('0x38')][_0x3768('0x3e')](_0x3768('0x3f'))){_0x5f4d14[_0x3768('0x23')]=qs['limit'](_0xca7190[_0x3768('0x38')][_0x3768('0x23')]);_0x5f4d14[_0x3768('0x21')]=qs['offset'](_0xca7190[_0x3768('0x38')][_0x3768('0x21')]);}_0x5f4d14[_0x3768('0x40')]=qs[_0x3768('0x41')](_0xca7190[_0x3768('0x38')]['sort']);_0x5f4d14[_0x3768('0x42')]=qs[_0x3768('0x39')](_['pick'](_0xca7190[_0x3768('0x38')],_0x1d522f[_0x3768('0x39')]));_0x5f4d14[_0x3768('0x42')]['WhatsappQueueId']=_0xc71bc0['id'];if(_0xca7190[_0x3768('0x38')][_0x3768('0x46')]){_0x5f4d14[_0x3768('0x42')]=_[_0x3768('0x44')](_0x5f4d14[_0x3768('0x42')],{'$or':_[_0x3768('0x37')](_0x5f4d14['attributes'],function(_0x17a2d4){var _0x29c8f4={};_0x29c8f4[_0x17a2d4]={'$like':'%'+_0xca7190['query'][_0x3768('0x46')]+'%'};return _0x29c8f4;})});}_0x5f4d14=_[_0x3768('0x44')]({},_0x5f4d14,_0xca7190[_0x3768('0x4d')]);return db['UserWhatsappQueue'][_0x3768('0x49')](_0x5f4d14);}})[_0x3768('0x2b')](function(_0x22a16a){if(_0x22a16a){return db['User'][_0x3768('0x5f')]({'where':{'id':_['map'](_0x22a16a,_0x3768('0x60')),'role':'agent'},'attributes':['id',_0x3768('0x30'),_0x3768('0x61'),_0x3768('0x62'),_0x3768('0x63')]});}})[_0x3768('0x2b')](function(_0x5a3340){if(_0x5a3340){return{'count':_0x5a3340[_0x3768('0x24')],'rows':_[_0x3768('0x37')](_0x5a3340['rows'],function(_0x2f0864){return{'membername':_0x2f0864[_0x3768('0x30')],'UserId':_0x2f0864['id'],'queue_name':_0xc3fc53[_0x3768('0x30')],'WhatsappQueueId':_0xc3fc53['id'],'interface':util[_0x3768('0x64')](_0x3768('0x65'),_0x3768('0x66'),_0x2f0864[_0x3768('0x30')]),'penalty':0x0,'paused':_0x2f0864['whatsappPause'],'createdAt':_0x2f0864[_0x3768('0x63')],'updatedAt':_0x2f0864['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3768('0x2b')](respondWithFilteredResult(_0x2ca6a4,_0x5f4d14))[_0x3768('0x4f')](handleError(_0x2ca6a4,null));};exports[_0x3768('0x67')]=function(_0x7e701c,_0x59681a,_0x59665e){var _0xb3afe4={};var _0x5d35ae={};var _0x1a879c;var _0x1f8b05;return db[_0x3768('0x33')][_0x3768('0x68')]({'where':{'id':_0x7e701c[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](handleEntityNotFound(_0x59681a,null))[_0x3768('0x2b')](function(_0x4a1307){if(_0x4a1307){_0x1a879c=_0x4a1307;_0x5d35ae[_0x3768('0x36')]=_[_0x3768('0x4c')](db[_0x3768('0x69')][_0x3768('0x34')]);_0x5d35ae[_0x3768('0x38')]=_['keys'](_0x7e701c['query']);_0x5d35ae[_0x3768('0x39')]=_['intersection'](_0x5d35ae[_0x3768('0x36')],_0x5d35ae['query']);_0xb3afe4[_0x3768('0x3b')]=_[_0x3768('0x3a')](_0x5d35ae[_0x3768('0x36')],qs['fields'](_0x7e701c[_0x3768('0x38')][_0x3768('0x3c')]));_0xb3afe4['attributes']=_0xb3afe4[_0x3768('0x3b')][_0x3768('0x3d')]?_0xb3afe4['attributes']:_0x5d35ae[_0x3768('0x36')];_0xb3afe4[_0x3768('0x40')]=qs[_0x3768('0x41')](_0x7e701c[_0x3768('0x38')][_0x3768('0x41')]);_0xb3afe4['where']=qs[_0x3768('0x39')](_[_0x3768('0x43')](_0x7e701c[_0x3768('0x38')],_0x5d35ae[_0x3768('0x39')]));if(_0x7e701c[_0x3768('0x38')]['filter']){_0xb3afe4[_0x3768('0x42')]=_[_0x3768('0x44')](_0xb3afe4['where'],{'$or':_[_0x3768('0x37')](_0xb3afe4[_0x3768('0x3b')],function(_0x3383a4){var _0x3d4e72={};_0x3d4e72[_0x3383a4]={'$like':'%'+_0x7e701c[_0x3768('0x38')][_0x3768('0x46')]+'%'};return _0x3d4e72;})});}_0xb3afe4=_[_0x3768('0x44')]({},_0xb3afe4,_0x7e701c[_0x3768('0x4d')]);return _0x1a879c[_0x3768('0x67')](_0xb3afe4);}})['then'](function(_0x333cb6){if(_0x333cb6){_0x1f8b05=_0x333cb6[_0x3768('0x3d')];if(!_0x7e701c['query'][_0x3768('0x3e')](_0x3768('0x3f'))){_0xb3afe4[_0x3768('0x23')]=qs[_0x3768('0x23')](_0x7e701c['query'][_0x3768('0x23')]);_0xb3afe4[_0x3768('0x21')]=qs[_0x3768('0x21')](_0x7e701c[_0x3768('0x38')]['offset']);}return _0x1a879c[_0x3768('0x67')](_0xb3afe4);}})[_0x3768('0x2b')](function(_0x507958){if(_0x507958){return _0x507958?{'count':_0x1f8b05,'rows':_0x507958}:null;}})[_0x3768('0x2b')](respondWithResult(_0x59681a,null))['catch'](handleError(_0x59681a,null));};exports[_0x3768('0x6a')]=function(_0x3d668a,_0x33957f,_0x4fd903){var _0x2a0354=_0x3d668a['body'][_0x3768('0x6b')];return db[_0x3768('0x69')][_0x3768('0x49')]({'where':{'id':_0x2a0354},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3768('0x6c'),'attributes':['id','name',_0x3768('0x6d'),_0x3768('0x6e'),_0x3768('0x6f')],'raw':!![]}]})[_0x3768('0x2b')](function(_0x28086c){if(_0x28086c){var _0x5cdae9=_[_0x3768('0x70')](_0x28086c,function(_0x445bfb){var _0x215a9e=_0x445bfb[_0x3768('0x2c')]({'plain':!![]});return _0x215a9e[_0x3768('0x6c')];});return db[_0x3768('0x33')][_0x3768('0x4e')]({'where':{'id':_0x3d668a['params']['id']}})[_0x3768('0x2b')](function(_0x26f22d){return db[_0x3768('0x71')][_0x3768('0x72')](function(_0x194777){return _0x26f22d[_0x3768('0x6a')](_0x2a0354,{'transaction':_0x194777})[_0x3768('0x2b')](function(){return BPromise[_0x3768('0x73')](_0x5cdae9,function(_0x372f1e){return db['UserWhatsappQueue'][_0x3768('0x74')]({'where':{'UserId':_0x372f1e['id'],'WhatsappQueueId':_0x3d668a[_0x3768('0x5b')]['id']},'transaction':_0x194777});});})[_0x3768('0x2b')](function(){_0x5cdae9['forEach'](function(_0xcd6e4e){socket['emit'](_0x3768('0x75'),{'UserId':_0xcd6e4e['id'],'WhatsappQueueId':_0x26f22d['id']});});});});});}})['then'](respondWithStatusCode(_0x33957f,null))[_0x3768('0x4f')](handleError(_0x33957f,null));};exports[_0x3768('0x76')]=function(_0x46bfd2,_0x47755f,_0xaa927c){return db['Team'][_0x3768('0x49')]({'where':{'id':_0x46bfd2[_0x3768('0x38')][_0x3768('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x3768('0x77')],'as':_0x3768('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x3768('0x2b')](handleEntityNotFound(_0x47755f,null))[_0x3768('0x2b')](function(_0x2ba56b){var _0x370801=_['map'](_0x2ba56b,'id');var _0x434070=[];var _0x4db285=[];var _0x54408d=squel[_0x3768('0x78')]();_0x54408d['field'](_0x3768('0x79'))['from'](_0x3768('0x7a'),'tq')[_0x3768('0x7b')](_0x3768('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3768('0x7d'),_0x46bfd2[_0x3768('0x5b')]['id']);for(var _0x1e1b29=0x0;_0x1e1b29<_0x2ba56b[_0x3768('0x3d')];_0x1e1b29+=0x1){let _0x2ad1e7=_0x2ba56b[_0x1e1b29];for(var _0x4455a9=0x0;_0x4455a9<_0x2ad1e7[_0x3768('0x6c')][_0x3768('0x3d')];_0x4455a9+=0x1){let _0x5918fc=_0x2ad1e7[_0x3768('0x6c')][_0x4455a9];var _0x2dedd3=_0x54408d[_0x3768('0x7e')]();_0x2dedd3['where'](_0x3768('0x7f'),_0x5918fc['id']);_0x4db285[_0x3768('0x80')](db[_0x3768('0x71')][_0x3768('0x38')](_0x2dedd3[_0x3768('0x81')](),{'type':db[_0x3768('0x71')][_0x3768('0x82')][_0x3768('0x83')]})['then'](function(_0x9ad55f){if(_0x9ad55f['length']===0x1){return _0x5918fc['id'];}else{var _0x3b088a=_['every'](_[_0x3768('0x37')](_0x9ad55f,_0x3768('0x84')),function(_0x1206a2){return _[_0x3768('0x85')](_0x370801,_0x1206a2);});if(_0x3b088a){return _0x5918fc['id'];}}}));}}return BPromise[_0x3768('0x86')](_0x4db285)[_0x3768('0x2b')](function(_0x379a92){_0x434070=_(_0x434070)[_0x3768('0x87')](_0x379a92)['compact']()['value']();return db[_0x3768('0x33')][_0x3768('0x4e')]({'where':{'id':_0x46bfd2[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](function(_0x2798bb){return db['sequelize'][_0x3768('0x72')](function(_0x1894b4){return _0x2798bb[_0x3768('0x76')](_0x46bfd2[_0x3768('0x38')][_0x3768('0x6b')],{'transaction':_0x1894b4})[_0x3768('0x2b')](function(){if(!_[_0x3768('0x88')](_0x434070)){return _0x2798bb[_0x3768('0x89')](_0x434070,{'transaction':_0x1894b4});}})[_0x3768('0x2b')](function(){_0x434070[_0x3768('0x8a')](function(_0x23a1e5){socket[_0x3768('0x8b')]('userWhatsappQueue:remove',{'UserId':_0x23a1e5,'WhatsappQueueId':_0x2798bb['id']});});});});});});})[_0x3768('0x2b')](respondWithStatusCode(_0x47755f,null))[_0x3768('0x4f')](handleError(_0x47755f,null));};exports['addAgents']=function(_0x41bad3,_0x58874f,_0x418de6){return db['WhatsappQueue']['find']({'where':{'id':_0x41bad3[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](handleEntityNotFound(_0x58874f,null))[_0x3768('0x2b')](function(_0xab880e){if(_0xab880e){return _0xab880e['addAgents'](_0x41bad3['body'][_0x3768('0x6b')],_[_0x3768('0x8c')](_0x41bad3['body'],[_0x3768('0x6b'),'id'])||{})[_0x3768('0x8d')](function(_0x3bfcce){for(var _0x4d6338=0x0;_0x4d6338<_0x41bad3['body'][_0x3768('0x6b')]['length'];_0x4d6338+=0x1){socket[_0x3768('0x8b')](_0x3768('0x75'),{'UserId':Number(_0x41bad3[_0x3768('0x5a')]['ids'][_0x4d6338]),'WhatsappQueueId':Number(_0x41bad3[_0x3768('0x5b')]['id'])});}return _0x3bfcce;});}})[_0x3768('0x2b')](respondWithResult(_0x58874f,null))['catch'](handleError(_0x58874f,null));};exports['removeAgents']=function(_0x61e9a2,_0x9df15c,_0x55f671){return db['WhatsappQueue']['find']({'where':{'id':_0x61e9a2[_0x3768('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9df15c,null))['then'](function(_0x53c62e){if(_0x53c62e){return _0x53c62e[_0x3768('0x89')](_0x61e9a2[_0x3768('0x38')]['ids'])[_0x3768('0x2b')](function(){if(_[_0x3768('0x8e')](_0x61e9a2[_0x3768('0x38')][_0x3768('0x6b')])){for(var _0x2de96e=0x0;_0x2de96e<_0x61e9a2[_0x3768('0x38')][_0x3768('0x6b')][_0x3768('0x3d')];_0x2de96e+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x61e9a2[_0x3768('0x38')]['ids'][_0x2de96e]),'WhatsappQueueId':Number(_0x61e9a2[_0x3768('0x5b')]['id'])});}}else{socket[_0x3768('0x8b')](_0x3768('0x8f'),{'UserId':Number(_0x61e9a2[_0x3768('0x38')]['ids']),'WhatsappQueueId':Number(_0x61e9a2[_0x3768('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x9df15c,null))[_0x3768('0x4f')](handleError(_0x9df15c,null));};exports[_0x3768('0x90')]=function(_0x312499,_0x3b57ca,_0x3decc6){var _0x4fb6c0={};var _0x3eead5={};var _0x55b388;var _0x12b42a;return db[_0x3768('0x33')][_0x3768('0x68')]({'where':{'id':_0x312499[_0x3768('0x5b')]['id']}})[_0x3768('0x2b')](handleEntityNotFound(_0x3b57ca,null))[_0x3768('0x2b')](function(_0x42809c){if(_0x42809c){_0x55b388=_0x42809c;_0x3eead5['model']=_[_0x3768('0x4c')](db['User']['rawAttributes']);_0x3eead5['query']=_[_0x3768('0x4c')](_0x312499['query']);_0x3eead5[_0x3768('0x39')]=_['intersection'](_0x3eead5[_0x3768('0x36')],_0x3eead5['query']);_0x4fb6c0[_0x3768('0x3b')]=_['intersection'](_0x3eead5[_0x3768('0x36')],qs[_0x3768('0x3c')](_0x312499[_0x3768('0x38')][_0x3768('0x3c')]));_0x4fb6c0[_0x3768('0x3b')]=_0x4fb6c0[_0x3768('0x3b')][_0x3768('0x3d')]?_0x4fb6c0[_0x3768('0x3b')]:_0x3eead5[_0x3768('0x36')];_0x4fb6c0[_0x3768('0x40')]=qs[_0x3768('0x41')](_0x312499[_0x3768('0x38')][_0x3768('0x41')]);_0x4fb6c0['where']=qs[_0x3768('0x39')](_['pick'](_0x312499[_0x3768('0x38')],_0x3eead5['filters']));if(_0x312499[_0x3768('0x38')][_0x3768('0x46')]){_0x4fb6c0['where']=_[_0x3768('0x44')](_0x4fb6c0['where'],{'$or':_['map'](_0x4fb6c0['attributes'],function(_0x179868){var _0x1e3ea4={};_0x1e3ea4[_0x179868]={'$like':'%'+_0x312499['query'][_0x3768('0x46')]+'%'};return _0x1e3ea4;})});}_0x4fb6c0=_[_0x3768('0x44')]({},_0x4fb6c0,_0x312499[_0x3768('0x4d')]);return _0x55b388[_0x3768('0x90')](_0x4fb6c0);}})[_0x3768('0x2b')](function(_0x1a289){if(_0x1a289){_0x12b42a=_0x1a289['length'];if(!_0x312499[_0x3768('0x38')][_0x3768('0x3e')](_0x3768('0x3f'))){_0x4fb6c0[_0x3768('0x23')]=qs[_0x3768('0x23')](_0x312499[_0x3768('0x38')][_0x3768('0x23')]);_0x4fb6c0[_0x3768('0x21')]=qs[_0x3768('0x21')](_0x312499[_0x3768('0x38')][_0x3768('0x21')]);}return _0x55b388[_0x3768('0x90')](_0x4fb6c0);}})[_0x3768('0x2b')](function(_0x15d405){if(_0x15d405){return _0x15d405?{'count':_0x12b42a,'rows':_0x15d405}:null;}})['then'](respondWithResult(_0x3b57ca,null))['catch'](handleError(_0x3b57ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 902c2fd..49662cf 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 _0xfb78=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x224b47,_0x1037eb){var _0x470840=function(_0x1b9a91){while(--_0x1b9a91){_0x224b47['push'](_0x224b47['shift']());}};_0x470840(++_0x1037eb);}(_0xfb78,0x1b4));var _0x8fb7=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0xfb78[_0x38f5f8];return _0x34e820;};'use strict';var EventEmitter=require(_0x8fb7('0x0'));var WhatsappQueue=require(_0x8fb7('0x1'))['db'][_0x8fb7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8fb7('0x3')](0x0);var events={'afterCreate':_0x8fb7('0x4'),'afterUpdate':'update','afterDestroy':_0x8fb7('0x5')};function emitEvent(_0x535bbb){return function(_0x127494,_0x2ae636,_0x5429a0){WhatsappQueueEvents['emit'](_0x535bbb+':'+_0x127494['id'],_0x127494);WhatsappQueueEvents['emit'](_0x535bbb,_0x127494);_0x5429a0(null);};}for(var e in events){if(events[_0x8fb7('0x6')](e)){var event=events[e];WhatsappQueue[_0x8fb7('0x7')](e,emitEvent(event));}}module[_0x8fb7('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbd70=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1a14f4,_0x49b402){var _0x1551eb=function(_0x380d1b){while(--_0x380d1b){_0x1a14f4['push'](_0x1a14f4['shift']());}};_0x1551eb(++_0x49b402);}(_0xbd70,0x1b9));var _0x0bd7=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbd70[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x0bd7('0x0'));var WhatsappQueue=require(_0x0bd7('0x1'))['db'][_0x0bd7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0bd7('0x3')](0x0);var events={'afterCreate':_0x0bd7('0x4'),'afterUpdate':_0x0bd7('0x5'),'afterDestroy':_0x0bd7('0x6')};function emitEvent(_0x3da87f){return function(_0x4d917,_0x72eafc,_0x506b68){WhatsappQueueEvents['emit'](_0x3da87f+':'+_0x4d917['id'],_0x4d917);WhatsappQueueEvents[_0x0bd7('0x7')](_0x3da87f,_0x4d917);_0x506b68(null);};}for(var e in events){if(events[_0x0bd7('0x8')](e)){var event=events[e];WhatsappQueue[_0x0bd7('0x9')](e,emitEvent(event));}}module[_0x0bd7('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 0bba05c..a3865cc 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 _0x21a8=['../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','moment','bluebird','request-promise'];(function(_0x1bc931,_0x203cd3){var _0x51e2f4=function(_0x8aa8d0){while(--_0x8aa8d0){_0x1bc931['push'](_0x1bc931['shift']());}};_0x51e2f4(++_0x203cd3);}(_0x21a8,0x135));var _0x821a=function(_0x2f8cef,_0x281d83){_0x2f8cef=_0x2f8cef-0x0;var _0x389bdd=_0x21a8[_0x2f8cef];return _0x389bdd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x821a('0x0'));var BPromise=require(_0x821a('0x1'));var rp=require(_0x821a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x821a('0x3'));var attributes=require('./whatsappQueue.attributes');module[_0x821a('0x4')]=function(_0xd9e0f4,_0x227e9e){return _0xd9e0f4[_0x821a('0x5')](_0x821a('0x6'),attributes,{'tableName':_0x821a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53f7=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3db1de,_0x229d12){var _0x570342=function(_0x1cad04){while(--_0x1cad04){_0x3db1de['push'](_0x3db1de['shift']());}};_0x570342(++_0x229d12);}(_0x53f7,0xf0));var _0x753f=function(_0x1c0028,_0x1ffe06){_0x1c0028=_0x1c0028-0x0;var _0x4c3b77=_0x53f7[_0x1c0028];return _0x4c3b77;};'use strict';var _=require(_0x753f('0x0'));var util=require(_0x753f('0x1'));var logger=require(_0x753f('0x2'))(_0x753f('0x3'));var moment=require(_0x753f('0x4'));var BPromise=require('bluebird');var rp=require(_0x753f('0x5'));var fs=require('fs');var path=require(_0x753f('0x6'));var rimraf=require(_0x753f('0x7'));var config=require(_0x753f('0x8'));var attributes=require(_0x753f('0x9'));module[_0x753f('0xa')]=function(_0x425e08,_0x5316e5){return _0x425e08[_0x753f('0xb')](_0x753f('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 665a8f9..e35b186 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 _0x688a=['include','model','map','catch','find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x688a,0x1c9));var _0xa688=function(_0xa973a1,_0x5192b3){_0xa973a1=_0xa973a1-0x0;var _0x3314db=_0x688a[_0xa973a1];return _0x3314db;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require(_0xa688('0x3'));var rs=require(_0xa688('0x4'));var fs=require('fs');var Redis=require(_0xa688('0x5'));var db=require(_0xa688('0x6'))['db'];var utils=require(_0xa688('0x7'));var logger=require(_0xa688('0x8'))(_0xa688('0x9'));var config=require(_0xa688('0xa'));var jayson=require(_0xa688('0xb'));var client=jayson[_0xa688('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xa688('0xd')],{'host':_0xa688('0xe'),'port':0x18eb});var socket=require(_0xa688('0xf'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xa688('0x10')](socket);function respondWithRpcPromise(_0x5a286d,_0x79f8fb,_0x931168){return new BPromise(function(_0x369265,_0x3d7114){return client['request'](_0x5a286d,_0x931168)[_0xa688('0x11')](function(_0x149a92){logger[_0xa688('0x12')](_0xa688('0x13'),_0x79f8fb,'request\x20sent');logger[_0xa688('0x14')](_0xa688('0x15'),_0x79f8fb,_0xa688('0x16'),JSON[_0xa688('0x17')](_0x149a92));if(_0x149a92[_0xa688('0x18')]){if(_0x149a92[_0xa688('0x18')][_0xa688('0x19')]===0x1f4){logger[_0xa688('0x18')](_0xa688('0x13'),_0x79f8fb,_0x149a92[_0xa688('0x18')][_0xa688('0x1a')]);return _0x3d7114(_0x149a92['error'][_0xa688('0x1a')]);}logger['error'](_0xa688('0x13'),_0x79f8fb,_0x149a92[_0xa688('0x18')][_0xa688('0x1a')]);return _0x369265(_0x149a92['error'][_0xa688('0x1a')]);}else{logger[_0xa688('0x12')](_0xa688('0x13'),_0x79f8fb,_0xa688('0x16'));_0x369265(_0x149a92[_0xa688('0x1b')]['message']);}})['catch'](function(_0x4f4a57){logger[_0xa688('0x18')](_0xa688('0x13'),_0x79f8fb,_0x4f4a57);_0x3d7114(_0x4f4a57);});});}exports[_0xa688('0x1c')]=function(_0x2829ca){var _0x5bd766=this;return new Promise(function(_0x5a9824,_0x5184b4){return db[_0xa688('0x1d')]['findAll']({'raw':_0x2829ca['options']?_0x2829ca[_0xa688('0x1e')][_0xa688('0x1f')]===undefined?!![]:![]:!![],'where':_0x2829ca[_0xa688('0x1e')]?_0x2829ca[_0xa688('0x1e')][_0xa688('0x20')]||null:null,'attributes':_0x2829ca[_0xa688('0x1e')]?_0x2829ca[_0xa688('0x1e')][_0xa688('0x21')]||null:null,'limit':_0x2829ca['options']?_0x2829ca[_0xa688('0x1e')][_0xa688('0x22')]||null:null,'include':_0x2829ca[_0xa688('0x1e')]?_0x2829ca[_0xa688('0x1e')][_0xa688('0x23')]?_['map'](_0x2829ca[_0xa688('0x1e')][_0xa688('0x23')],function(_0x55d3f8){return{'model':db[_0x55d3f8[_0xa688('0x24')]],'as':_0x55d3f8['as'],'attributes':_0x55d3f8[_0xa688('0x21')],'include':_0x55d3f8[_0xa688('0x23')]?_[_0xa688('0x25')](_0x55d3f8['include'],function(_0x403967){return{'model':db[_0x403967[_0xa688('0x24')]],'as':_0x403967['as'],'attributes':_0x403967[_0xa688('0x21')],'include':_0x403967['include']?_[_0xa688('0x25')](_0x403967['include'],function(_0x1f1bac){return{'model':db[_0x1f1bac[_0xa688('0x24')]],'as':_0x1f1bac['as'],'attributes':_0x1f1bac[_0xa688('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55a3f0){logger[_0xa688('0x12')](_0xa688('0x1c'),_0x2829ca);logger['debug'](_0xa688('0x1c'),_0x2829ca,JSON['stringify'](_0x55a3f0));_0x5a9824(_0x55a3f0);})[_0xa688('0x26')](function(_0x4aa0f0){logger[_0xa688('0x18')](_0xa688('0x1c'),_0x4aa0f0[_0xa688('0x1a')],_0x2829ca);_0x5184b4(_0x5bd766['error'](0x1f4,_0x4aa0f0[_0xa688('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x2a523c){var _0x5ece64=this;return new Promise(function(_0x379ac8,_0x4ad229){return db['WhatsappQueue'][_0xa688('0x27')]({'raw':_0x2a523c[_0xa688('0x1e')]?_0x2a523c[_0xa688('0x1e')][_0xa688('0x1f')]===undefined?!![]:![]:!![],'where':_0x2a523c[_0xa688('0x1e')]?_0x2a523c[_0xa688('0x1e')][_0xa688('0x20')]||null:null,'attributes':_0x2a523c['options']?_0x2a523c[_0xa688('0x1e')][_0xa688('0x21')]||null:null,'include':_0x2a523c[_0xa688('0x1e')]?_0x2a523c[_0xa688('0x1e')][_0xa688('0x23')]?_[_0xa688('0x25')](_0x2a523c[_0xa688('0x1e')][_0xa688('0x23')],function(_0x43f375){return{'model':db[_0x43f375['model']],'as':_0x43f375['as'],'attributes':_0x43f375[_0xa688('0x21')],'include':_0x43f375[_0xa688('0x23')]?_[_0xa688('0x25')](_0x43f375[_0xa688('0x23')],function(_0x820678){return{'model':db[_0x820678[_0xa688('0x24')]],'as':_0x820678['as'],'attributes':_0x820678[_0xa688('0x21')],'include':_0x820678[_0xa688('0x23')]?_[_0xa688('0x25')](_0x820678[_0xa688('0x23')],function(_0x2d5107){return{'model':db[_0x2d5107[_0xa688('0x24')]],'as':_0x2d5107['as'],'attributes':_0x2d5107[_0xa688('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa688('0x11')](function(_0x1282fe){logger['info'](_0xa688('0x28'),_0x2a523c);logger[_0xa688('0x14')](_0xa688('0x28'),_0x2a523c,JSON['stringify'](_0x1282fe));_0x379ac8(_0x1282fe);})[_0xa688('0x26')](function(_0x58b80e){logger[_0xa688('0x18')]('ShowWhatsappQueue',_0x58b80e['message'],_0x2a523c);_0x4ad229(_0x5ece64['error'](0x1f4,_0x58b80e[_0xa688('0x1a')]));});});}; \ No newline at end of file +var _0x458c=['stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','include','model','map','ShowWhatsappQueue','find','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x52f259,_0x4a5baf){var _0x37bcb8=function(_0x4c5f15){while(--_0x4c5f15){_0x52f259['push'](_0x52f259['shift']());}};_0x37bcb8(++_0x4a5baf);}(_0x458c,0xe2));var _0xc458=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x458c[_0xb3b452];return _0x238983;};'use strict';var _=require(_0xc458('0x0'));var util=require('util');var moment=require(_0xc458('0x1'));var BPromise=require(_0xc458('0x2'));var rs=require(_0xc458('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc458('0x4'))('rpc');var config=require(_0xc458('0x5'));var jayson=require(_0xc458('0x6'));var client=jayson[_0xc458('0x7')][_0xc458('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc458('0x9'),'port':0x18eb});var socket=require(_0xc458('0xa'))(new Redis(config['redis']));require(_0xc458('0xb'))[_0xc458('0xc')](socket);function respondWithRpcPromise(_0x48af07,_0x166dfa,_0x38e442){return new BPromise(function(_0xd8b818,_0x13d974){return client[_0xc458('0xd')](_0x48af07,_0x38e442)[_0xc458('0xe')](function(_0x49dea5){logger[_0xc458('0xf')](_0xc458('0x10'),_0x166dfa,_0xc458('0x11'));logger[_0xc458('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x166dfa,_0xc458('0x11'),JSON[_0xc458('0x13')](_0x49dea5));if(_0x49dea5[_0xc458('0x14')]){if(_0x49dea5[_0xc458('0x14')]['code']===0x1f4){logger[_0xc458('0x14')](_0xc458('0x10'),_0x166dfa,_0x49dea5[_0xc458('0x14')][_0xc458('0x15')]);return _0x13d974(_0x49dea5[_0xc458('0x14')]['message']);}logger[_0xc458('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x166dfa,_0x49dea5[_0xc458('0x14')]['message']);return _0xd8b818(_0x49dea5[_0xc458('0x14')][_0xc458('0x15')]);}else{logger[_0xc458('0xf')](_0xc458('0x10'),_0x166dfa,_0xc458('0x11'));_0xd8b818(_0x49dea5[_0xc458('0x16')][_0xc458('0x15')]);}})[_0xc458('0x17')](function(_0x179999){logger['error'](_0xc458('0x10'),_0x166dfa,_0x179999);_0x13d974(_0x179999);});});}exports[_0xc458('0x18')]=function(_0x3ce61a){var _0x2add71=this;return new Promise(function(_0x3dc6a0,_0x5498d1){return db[_0xc458('0x19')]['findAll']({'raw':_0x3ce61a[_0xc458('0x1a')]?_0x3ce61a[_0xc458('0x1a')][_0xc458('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ce61a[_0xc458('0x1a')]?_0x3ce61a[_0xc458('0x1a')][_0xc458('0x1c')]||null:null,'attributes':_0x3ce61a[_0xc458('0x1a')]?_0x3ce61a[_0xc458('0x1a')][_0xc458('0x1d')]||null:null,'limit':_0x3ce61a[_0xc458('0x1a')]?_0x3ce61a[_0xc458('0x1a')]['limit']||null:null,'include':_0x3ce61a[_0xc458('0x1a')]?_0x3ce61a[_0xc458('0x1a')][_0xc458('0x1e')]?_['map'](_0x3ce61a[_0xc458('0x1a')][_0xc458('0x1e')],function(_0x3bb105){return{'model':db[_0x3bb105[_0xc458('0x1f')]],'as':_0x3bb105['as'],'attributes':_0x3bb105[_0xc458('0x1d')],'include':_0x3bb105[_0xc458('0x1e')]?_[_0xc458('0x20')](_0x3bb105[_0xc458('0x1e')],function(_0x5bbf0e){return{'model':db[_0x5bbf0e[_0xc458('0x1f')]],'as':_0x5bbf0e['as'],'attributes':_0x5bbf0e[_0xc458('0x1d')],'include':_0x5bbf0e[_0xc458('0x1e')]?_['map'](_0x5bbf0e['include'],function(_0x2d8875){return{'model':db[_0x2d8875[_0xc458('0x1f')]],'as':_0x2d8875['as'],'attributes':_0x2d8875[_0xc458('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc458('0xe')](function(_0x4eced7){logger[_0xc458('0xf')](_0xc458('0x18'),_0x3ce61a);logger[_0xc458('0x12')](_0xc458('0x18'),_0x3ce61a,JSON[_0xc458('0x13')](_0x4eced7));_0x3dc6a0(_0x4eced7);})[_0xc458('0x17')](function(_0x31cb4c){logger[_0xc458('0x14')](_0xc458('0x18'),_0x31cb4c[_0xc458('0x15')],_0x3ce61a);_0x5498d1(_0x2add71[_0xc458('0x14')](0x1f4,_0x31cb4c['message']));});});};exports[_0xc458('0x21')]=function(_0x353f7a){var _0x36597e=this;return new Promise(function(_0x2a4e43,_0x5cb108){return db[_0xc458('0x19')][_0xc458('0x22')]({'raw':_0x353f7a[_0xc458('0x1a')]?_0x353f7a[_0xc458('0x1a')][_0xc458('0x1b')]===undefined?!![]:![]:!![],'where':_0x353f7a[_0xc458('0x1a')]?_0x353f7a['options'][_0xc458('0x1c')]||null:null,'attributes':_0x353f7a[_0xc458('0x1a')]?_0x353f7a[_0xc458('0x1a')][_0xc458('0x1d')]||null:null,'include':_0x353f7a['options']?_0x353f7a[_0xc458('0x1a')][_0xc458('0x1e')]?_[_0xc458('0x20')](_0x353f7a[_0xc458('0x1a')][_0xc458('0x1e')],function(_0x8775f5){return{'model':db[_0x8775f5[_0xc458('0x1f')]],'as':_0x8775f5['as'],'attributes':_0x8775f5[_0xc458('0x1d')],'include':_0x8775f5[_0xc458('0x1e')]?_[_0xc458('0x20')](_0x8775f5[_0xc458('0x1e')],function(_0x2c6abe){return{'model':db[_0x2c6abe['model']],'as':_0x2c6abe['as'],'attributes':_0x2c6abe['attributes'],'include':_0x2c6abe['include']?_[_0xc458('0x20')](_0x2c6abe['include'],function(_0x1648cb){return{'model':db[_0x1648cb[_0xc458('0x1f')]],'as':_0x1648cb['as'],'attributes':_0x1648cb[_0xc458('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc458('0xe')](function(_0x3aeab2){logger[_0xc458('0xf')](_0xc458('0x21'),_0x353f7a);logger['debug'](_0xc458('0x21'),_0x353f7a,JSON[_0xc458('0x13')](_0x3aeab2));_0x2a4e43(_0x3aeab2);})[_0xc458('0x17')](function(_0x1e6497){logger[_0xc458('0x14')](_0xc458('0x21'),_0x1e6497[_0xc458('0x15')],_0x353f7a);_0x5cb108(_0x36597e[_0xc458('0x14')](0x1f4,_0x1e6497['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 36d5947..4bcf6f6 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 _0x79e6=['register','length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x79e6,0xcb));var _0x679e=function(_0x22e3dd,_0x1b0be9){_0x22e3dd=_0x22e3dd-0x0;var _0x456ad0=_0x79e6[_0x22e3dd];return _0x456ad0;};'use strict';var WhatsappQueueEvents=require(_0x679e('0x0'));var events=['save',_0x679e('0x1'),_0x679e('0x2')];function createListener(_0x1d4793,_0x339a1a){return function(_0xd3facc){_0x339a1a[_0x679e('0x3')](_0x1d4793,_0xd3facc);};}function removeListener(_0x439ea2,_0x3e8df0){return function(){WhatsappQueueEvents[_0x679e('0x4')](_0x439ea2,_0x3e8df0);};}exports[_0x679e('0x5')]=function(_0x2e1849){for(var _0x2ab4bc=0x0,_0x394421=events[_0x679e('0x6')];_0x2ab4bc<_0x394421;_0x2ab4bc++){var _0x34966a=events[_0x2ab4bc];var _0x27cc8e=createListener(_0x679e('0x7')+_0x34966a,_0x2e1849);WhatsappQueueEvents['on'](_0x34966a,_0x27cc8e);}}; \ No newline at end of file +var _0x1e80=['removeListener','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x3b9ccf,_0x418317){var _0x333e9e=function(_0x33dd9c){while(--_0x33dd9c){_0x3b9ccf['push'](_0x3b9ccf['shift']());}};_0x333e9e(++_0x418317);}(_0x1e80,0x110));var _0x01e8=function(_0x31198e,_0x3e405b){_0x31198e=_0x31198e-0x0;var _0x164524=_0x1e80[_0x31198e];return _0x164524;};'use strict';var WhatsappQueueEvents=require(_0x01e8('0x0'));var events=[_0x01e8('0x1'),_0x01e8('0x2'),'update'];function createListener(_0x2d0f0d,_0x1a8b4d){return function(_0xbbfb82){_0x1a8b4d['emit'](_0x2d0f0d,_0xbbfb82);};}function removeListener(_0x33c44f,_0x2633a7){return function(){WhatsappQueueEvents[_0x01e8('0x3')](_0x33c44f,_0x2633a7);};}exports['register']=function(_0x4551eb){for(var _0xa648ff=0x0,_0x3d99d2=events['length'];_0xa648ff<_0x3d99d2;_0xa648ff++){var _0x3cb784=events[_0xa648ff];var _0x3f2842=createListener(_0x01e8('0x4')+_0x3cb784,_0x4551eb);WhatsappQueueEvents['on'](_0x3cb784,_0x3f2842);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index db95a8f..9fcad21 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 _0xb8e0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','put','update','delete','destroy','exports','multer'];(function(_0x2a1389,_0x51ebd5){var _0x4a01b3=function(_0x517612){while(--_0x517612){_0x2a1389['push'](_0x2a1389['shift']());}};_0x4a01b3(++_0x51ebd5);}(_0xb8e0,0xe6));var _0x0b8e=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xb8e0[_0x5471ec];return _0x121d4c;};'use strict';var multer=require(_0x0b8e('0x0'));var util=require('util');var path=require(_0x0b8e('0x1'));var timeout=require(_0x0b8e('0x2'));var express=require(_0x0b8e('0x3'));var router=express[_0x0b8e('0x4')]();var fs_extra=require(_0x0b8e('0x5'));var auth=require(_0x0b8e('0x6'));var interaction=require(_0x0b8e('0x7'));var config=require(_0x0b8e('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0x0b8e('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b8e('0xa')]);router[_0x0b8e('0x9')](_0x0b8e('0xb'),auth[_0x0b8e('0xc')](),controller[_0x0b8e('0xd')]);router[_0x0b8e('0x9')]('/:id',auth[_0x0b8e('0xc')](),controller[_0x0b8e('0xe')]);router[_0x0b8e('0xf')]('/',auth[_0x0b8e('0xc')](),controller['create']);router[_0x0b8e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0b8e('0x11')]);router[_0x0b8e('0x12')]('/:id',auth[_0x0b8e('0xc')](),controller[_0x0b8e('0x13')]);module[_0x0b8e('0x14')]=router; \ No newline at end of file +var _0x3054=['index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x5799c9,_0x4fa2de){var _0x4ca9f5=function(_0x4a858a){while(--_0x4a858a){_0x5799c9['push'](_0x5799c9['shift']());}};_0x4ca9f5(++_0x4fa2de);}(_0x3054,0x9b));var _0x4305=function(_0xfdc975,_0x374054){_0xfdc975=_0xfdc975-0x0;var _0x356c7e=_0x3054[_0xfdc975];return _0x356c7e;};'use strict';var multer=require(_0x4305('0x0'));var util=require(_0x4305('0x1'));var path=require(_0x4305('0x2'));var timeout=require(_0x4305('0x3'));var express=require(_0x4305('0x4'));var router=express[_0x4305('0x5')]();var fs_extra=require(_0x4305('0x6'));var auth=require(_0x4305('0x7'));var interaction=require(_0x4305('0x8'));var config=require(_0x4305('0x9'));var controller=require(_0x4305('0xa'));router[_0x4305('0xb')]('/',auth[_0x4305('0xc')](),controller[_0x4305('0xd')]);router[_0x4305('0xb')](_0x4305('0xe'),auth[_0x4305('0xc')](),controller[_0x4305('0xf')]);router[_0x4305('0xb')](_0x4305('0x10'),auth[_0x4305('0xc')](),controller['show']);router[_0x4305('0x11')]('/',auth[_0x4305('0xc')](),controller[_0x4305('0x12')]);router[_0x4305('0x13')](_0x4305('0x10'),auth[_0x4305('0xc')](),controller[_0x4305('0x14')]);router[_0x4305('0x15')](_0x4305('0x10'),auth[_0x4305('0xc')](),controller[_0x4305('0x16')]);module[_0x4305('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index cac905e..9488736 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x285a6e,_0x8595b1){var _0x1af356=function(_0x577e9b){while(--_0x577e9b){_0x285a6e['push'](_0x285a6e['shift']());}};_0x1af356(++_0x8595b1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3315ad,_0x2fd5f7){var _0x4aff03=function(_0x1a279e){while(--_0x1a279e){_0x3315ad['push'](_0x3315ad['shift']());}};_0x4aff03(++_0x2fd5f7);}(_0x7a54,0x106));var _0x47a5=function(_0x589931,_0xc77d2b){_0x589931=_0x589931-0x0;var _0x255c3f=_0x7a54[_0x589931];return _0x255c3f;};'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 c225d74..8a72411 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 _0xe605=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x54c1fc,_0x1b72fd){var _0x97eed8=function(_0x62bcc2){while(--_0x62bcc2){_0x54c1fc['push'](_0x54c1fc['shift']());}};_0x97eed8(++_0x1b72fd);}(_0xe605,0x92));var _0x5e60=function(_0x22e5ee,_0xf04ac){_0x22e5ee=_0x22e5ee-0x0;var _0x360f76=_0xe605[_0x22e5ee];return _0x360f76;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2a499e[_0x5e60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x19')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x1a')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=_[_0x5e60('0x2c')](db[_0x5e60('0x2d')][_0x5e60('0x2e')],function(_0x558197){return{'name':_0x558197[_0x5e60('0x2f')],'type':_0x558197[_0x5e60('0x30')]['key']};});_0x52f668[_0x5e60('0x31')]=_['map'](_0x235cc7,'name');_0x52f668[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0xac9c7a[_0x5e60('0x32')]);_0x52f668[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],_0x52f668[_0x5e60('0x32')]);_0x5431a8[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],qs['fields'](_0xac9c7a[_0x5e60('0x32')]['fields']));_0x5431a8['attributes']=_0x5431a8[_0x5e60('0x36')][_0x5e60('0x37')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x31')];if(!_0xac9c7a['query'][_0x5e60('0x38')](_0x5e60('0x39'))){_0x5431a8[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x1e')]);_0x5431a8[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0xac9c7a['query'][_0x5e60('0x1d')]);}_0x5431a8[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3b')]);_0x5431a8[_0x5e60('0x3c')]=qs[_0x5e60('0x34')](_['pick'](_0xac9c7a[_0x5e60('0x32')],_0x52f668[_0x5e60('0x34')]),_0x235cc7);if(_0xac9c7a['query']['filter']){_0x5431a8[_0x5e60('0x3c')]=_[_0x5e60('0x3d')](_0x5431a8[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2c')](_0x235cc7,function(_0x31b900){if(_0x31b900['type']!==_0x5e60('0x3e')){var _0x413bf0={};_0x413bf0[_0x31b900[_0x5e60('0x2a')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3f')]+'%'};return _0x413bf0;}})});}_0x5431a8=_[_0x5e60('0x3d')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x40')]);var _0x54022a={'where':_0x5431a8[_0x5e60('0x3c')]};return db[_0x5e60('0x2d')]['count'](_0x54022a)['then'](function(_0x47a6df){_0xf25956[_0x5e60('0x20')]=_0x47a6df;if(_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x41')]){_0x5431a8[_0x5e60('0x42')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x26')](function(_0x4b6192){_0xf25956['rows']=_0x4b6192;return _0xf25956;})[_0x5e60('0x26')](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x44')](handleError(_0x52c97c,null));};exports[_0x5e60('0x45')]=function(_0x38ff1d,_0x39ab09){var _0x3899ae={'raw':!![],'where':{'id':_0x38ff1d[_0x5e60('0x46')]['id']}},_0x2522d2={};_0x2522d2[_0x5e60('0x31')]=_['keys'](db[_0x5e60('0x2d')][_0x5e60('0x2e')]);_0x2522d2['query']=_[_0x5e60('0x33')](_0x38ff1d[_0x5e60('0x32')]);_0x2522d2[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],_0x2522d2['query']);_0x3899ae[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],qs[_0x5e60('0x47')](_0x38ff1d['query']['fields']));_0x3899ae['attributes']=_0x3899ae[_0x5e60('0x36')][_0x5e60('0x37')]?_0x3899ae[_0x5e60('0x36')]:_0x2522d2[_0x5e60('0x31')];if(_0x38ff1d[_0x5e60('0x32')][_0x5e60('0x41')]){_0x3899ae['include']=[{'all':!![]}];}_0x3899ae=_[_0x5e60('0x3d')]({},_0x3899ae,_0x38ff1d[_0x5e60('0x40')]);return db[_0x5e60('0x2d')][_0x5e60('0x48')](_0x3899ae)[_0x5e60('0x26')](handleEntityNotFound(_0x39ab09,null))[_0x5e60('0x26')](respondWithResult(_0x39ab09,null))[_0x5e60('0x44')](handleError(_0x39ab09,null));};exports['create']=function(_0x24c757,_0x3ed45d){return db[_0x5e60('0x2d')][_0x5e60('0x49')](_0x24c757[_0x5e60('0x4a')],{})[_0x5e60('0x26')](respondWithResult(_0x3ed45d,0xc9))[_0x5e60('0x44')](handleError(_0x3ed45d,null));};exports[_0x5e60('0x25')]=function(_0x1518bd,_0x350d6d){if(_0x1518bd[_0x5e60('0x4a')]['id']){delete _0x1518bd[_0x5e60('0x4a')]['id'];}return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x1518bd[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x350d6d,null))[_0x5e60('0x26')](saveUpdates(_0x1518bd[_0x5e60('0x4a')],null))['then'](respondWithResult(_0x350d6d,null))['catch'](handleError(_0x350d6d,null));};exports[_0x5e60('0x27')]=function(_0x4d3588,_0x3525d){return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x4d3588[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x3525d,null))[_0x5e60('0x26')](removeEntity(_0x3525d,null))['catch'](handleError(_0x3525d,null));};exports['describe']=function(_0xd7d32c,_0x1e4e41){return db[_0x5e60('0x2d')]['describe']()['then'](respondWithResult(_0x1e4e41,null))[_0x5e60('0x44')](handleError(_0x1e4e41,null));}; \ No newline at end of file +var _0xa478=['filters','intersection','fields','attributes','length','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','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys'];(function(_0x4b8ce2,_0xa3e256){var _0xedc657=function(_0x1bd9b9){while(--_0x1bd9b9){_0x4b8ce2['push'](_0x4b8ce2['shift']());}};_0xedc657(++_0xa3e256);}(_0xa478,0x136));var _0x8a47=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0xa478[_0x4a1353];return _0x3805cc;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x5bed3e,_0x2bb0d4){return function(_0xb4590d){if(!_0xb4590d){_0x5bed3e[_0x8a47('0x1a')](0x194);}return _0xb4590d;};}function handleError(_0xfb9ae0,_0x44cf20){_0x44cf20=_0x44cf20||0x1f4;return function(_0xd06be6){logger[_0x8a47('0x28')](_0xd06be6['stack']);if(_0xd06be6[_0x8a47('0x29')]){delete _0xd06be6['name'];}_0xfb9ae0[_0x8a47('0x1c')](_0x44cf20)[_0x8a47('0x2a')](_0xd06be6);};}exports['index']=function(_0x1e89b1,_0x526571){var _0x4d5d32={},_0x12470a={},_0x9b51b8={'count':0x0,'rows':[]};var _0x1ddbcf=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')][_0x8a47('0x2d')],function(_0x58aa06){return{'name':_0x58aa06[_0x8a47('0x2e')],'type':_0x58aa06['type']['key']};});_0x12470a[_0x8a47('0x2f')]=_[_0x8a47('0x2b')](_0x1ddbcf,_0x8a47('0x29'));_0x12470a[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x1e89b1[_0x8a47('0x30')]);_0x12470a[_0x8a47('0x32')]=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],_0x12470a[_0x8a47('0x30')]);_0x4d5d32['attributes']=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],qs[_0x8a47('0x34')](_0x1e89b1['query'][_0x8a47('0x34')]));_0x4d5d32[_0x8a47('0x35')]=_0x4d5d32['attributes'][_0x8a47('0x36')]?_0x4d5d32[_0x8a47('0x35')]:_0x12470a[_0x8a47('0x2f')];if(!_0x1e89b1[_0x8a47('0x30')]['hasOwnProperty']('nolimit')){_0x4d5d32[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x20')]);_0x4d5d32[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x1e89b1[_0x8a47('0x30')]['offset']);}_0x4d5d32['order']=qs[_0x8a47('0x37')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x37')]);_0x4d5d32[_0x8a47('0x38')]=qs[_0x8a47('0x32')](_[_0x8a47('0x39')](_0x1e89b1[_0x8a47('0x30')],_0x12470a[_0x8a47('0x32')]),_0x1ddbcf);if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]){_0x4d5d32[_0x8a47('0x38')]=_['merge'](_0x4d5d32[_0x8a47('0x38')],{'$or':_['map'](_0x1ddbcf,function(_0x541832){if(_0x541832['type']!=='VIRTUAL'){var _0x57d38e={};_0x57d38e[_0x541832[_0x8a47('0x29')]]={'$like':'%'+_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]+'%'};return _0x57d38e;}})});}_0x4d5d32=_[_0x8a47('0x3b')]({},_0x4d5d32,_0x1e89b1[_0x8a47('0x3c')]);var _0x20ba1c={'where':_0x4d5d32[_0x8a47('0x38')]};return db[_0x8a47('0x2c')]['count'](_0x20ba1c)['then'](function(_0x442870){_0x9b51b8[_0x8a47('0x21')]=_0x442870;if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x4d5d32['include']=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3e')](_0x4d5d32);})[_0x8a47('0x27')](function(_0x369dd5){_0x9b51b8[_0x8a47('0x3f')]=_0x369dd5;return _0x9b51b8;})['then'](respondWithFilteredResult(_0x526571,_0x4d5d32))[_0x8a47('0x40')](handleError(_0x526571,null));};exports[_0x8a47('0x41')]=function(_0x3010af,_0x5d23ed){var _0x2b3874={'raw':!![],'where':{'id':_0x3010af[_0x8a47('0x42')]['id']}},_0x2c70ea={};_0x2c70ea[_0x8a47('0x2f')]=_['keys'](db[_0x8a47('0x2c')][_0x8a47('0x2d')]);_0x2c70ea[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x3010af[_0x8a47('0x30')]);_0x2c70ea[_0x8a47('0x32')]=_['intersection'](_0x2c70ea['model'],_0x2c70ea[_0x8a47('0x30')]);_0x2b3874[_0x8a47('0x35')]=_[_0x8a47('0x33')](_0x2c70ea['model'],qs[_0x8a47('0x34')](_0x3010af[_0x8a47('0x30')]['fields']));_0x2b3874['attributes']=_0x2b3874[_0x8a47('0x35')]['length']?_0x2b3874[_0x8a47('0x35')]:_0x2c70ea[_0x8a47('0x2f')];if(_0x3010af[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x2b3874[_0x8a47('0x43')]=[{'all':!![]}];}_0x2b3874=_[_0x8a47('0x3b')]({},_0x2b3874,_0x3010af['options']);return db['WhatsappQueueReport'][_0x8a47('0x44')](_0x2b3874)[_0x8a47('0x27')](handleEntityNotFound(_0x5d23ed,null))[_0x8a47('0x27')](respondWithResult(_0x5d23ed,null))[_0x8a47('0x40')](handleError(_0x5d23ed,null));};exports[_0x8a47('0x45')]=function(_0x55dd7c,_0x4898d0){return db[_0x8a47('0x2c')]['create'](_0x55dd7c[_0x8a47('0x46')],{})[_0x8a47('0x27')](respondWithResult(_0x4898d0,0xc9))['catch'](handleError(_0x4898d0,null));};exports[_0x8a47('0x26')]=function(_0x237ed1,_0x14e22c){if(_0x237ed1[_0x8a47('0x46')]['id']){delete _0x237ed1[_0x8a47('0x46')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x237ed1[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e22c,null))[_0x8a47('0x27')](saveUpdates(_0x237ed1[_0x8a47('0x46')],null))[_0x8a47('0x27')](respondWithResult(_0x14e22c,null))[_0x8a47('0x40')](handleError(_0x14e22c,null));};exports['destroy']=function(_0x11db4e,_0xa428dd){return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x11db4e[_0x8a47('0x42')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0xa428dd,null))['then'](removeEntity(_0xa428dd,null))['catch'](handleError(_0xa428dd,null));};exports[_0x8a47('0x47')]=function(_0x5db5d3,_0x1da8b7){return db[_0x8a47('0x2c')]['describe']()[_0x8a47('0x27')](respondWithResult(_0x1da8b7,null))['catch'](handleError(_0x1da8b7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7f1a147..5e67192 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 _0xecf1=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x1f653b,_0x47c9c8){var _0x5e064d=function(_0x4091c8){while(--_0x4091c8){_0x1f653b['push'](_0x1f653b['shift']());}};_0x5e064d(++_0x47c9c8);}(_0xecf1,0x18a));var _0x1ecf=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0xecf1[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x1ecf('0x0'));var util=require(_0x1ecf('0x1'));var logger=require(_0x1ecf('0x2'))(_0x1ecf('0x3'));var moment=require('moment');var BPromise=require(_0x1ecf('0x4'));var rp=require(_0x1ecf('0x5'));var fs=require('fs');var path=require(_0x1ecf('0x6'));var rimraf=require(_0x1ecf('0x7'));var config=require(_0x1ecf('0x8'));var attributes=require(_0x1ecf('0x9'));module[_0x1ecf('0xa')]=function(_0x51073d,_0x5bf0ca){return _0x51073d[_0x1ecf('0xb')](_0x1ecf('0xc'),attributes,{'tableName':_0x1ecf('0xd'),'paranoid':![],'indexes':[{'name':_0x1ecf('0xe'),'fields':[_0x1ecf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9520=['uniqueid','lodash','util','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9520,0x64));var _0x0952=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9520[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0952('0x0'));var util=require(_0x0952('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0952('0x2'));var rp=require(_0x0952('0x3'));var fs=require('fs');var path=require(_0x0952('0x4'));var rimraf=require(_0x0952('0x5'));var config=require('../../config/environment');var attributes=require(_0x0952('0x6'));module['exports']=function(_0x51c936,_0x2f9a9a){return _0x51c936[_0x0952('0x7')](_0x0952('0x8'),attributes,{'tableName':_0x0952('0x9'),'paranoid':![],'indexes':[{'name':_0x0952('0xa'),'fields':[_0x0952('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4c80561..bb130d3 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 _0x50b9=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3c6377,_0x2c6b91){var _0x351bd9=function(_0x102abf){while(--_0x102abf){_0x3c6377['push'](_0x3c6377['shift']());}};_0x351bd9(++_0x2c6b91);}(_0x50b9,0x1f4));var _0x950b=function(_0x59cf41,_0x292757){_0x59cf41=_0x59cf41-0x0;var _0x3d7568=_0x50b9[_0x59cf41];return _0x3d7568;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x950b('0x0'));var rs=require(_0x950b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x950b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x950b('0x3'))(_0x950b('0x4'));var config=require(_0x950b('0x5'));var jayson=require(_0x950b('0x6'));var client=jayson[_0x950b('0x7')][_0x950b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1755fa,_0x406490,_0x283114){return new BPromise(function(_0x557dc8,_0xd257de){return client['request'](_0x1755fa,_0x283114)[_0x950b('0x9')](function(_0x1dbcca){logger[_0x950b('0xa')](_0x950b('0xb'),_0x406490,_0x950b('0xc'));logger[_0x950b('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x406490,_0x950b('0xc'),JSON[_0x950b('0xe')](_0x1dbcca));if(_0x1dbcca[_0x950b('0xf')]){if(_0x1dbcca[_0x950b('0xf')][_0x950b('0x10')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x406490,_0x1dbcca[_0x950b('0xf')][_0x950b('0x11')]);return _0xd257de(_0x1dbcca['error'][_0x950b('0x11')]);}logger[_0x950b('0xf')](_0x950b('0xb'),_0x406490,_0x1dbcca[_0x950b('0xf')]['message']);return _0x557dc8(_0x1dbcca['error']['message']);}else{logger[_0x950b('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x406490,'request\x20sent');_0x557dc8(_0x1dbcca[_0x950b('0x12')][_0x950b('0x11')]);}})[_0x950b('0x13')](function(_0x2d70c6){logger[_0x950b('0xf')](_0x950b('0xb'),_0x406490,_0x2d70c6);_0xd257de(_0x2d70c6);});});}exports[_0x950b('0x14')]=function(_0x419651){var _0x392cec=this;return new Promise(function(_0x297407,_0x34b8b2){return db[_0x950b('0x15')][_0x950b('0x16')](_0x419651[_0x950b('0x17')],{'raw':_0x419651[_0x950b('0x18')]?_0x419651['options'][_0x950b('0x19')]===undefined?!![]:![]:!![]})[_0x950b('0x9')](function(_0x1ed57a){logger[_0x950b('0xa')]('CreateWhatsappQueueReport',_0x419651);logger['debug'](_0x950b('0x14'),_0x419651,JSON[_0x950b('0xe')](_0x1ed57a));_0x297407(_0x1ed57a);})['catch'](function(_0xc6b659){logger[_0x950b('0xf')]('CreateWhatsappQueueReport',_0xc6b659[_0x950b('0x11')],_0x419651);_0x34b8b2(_0x392cec[_0x950b('0xf')](0x1f4,_0xc6b659[_0x950b('0x11')]));});});};exports[_0x950b('0x1a')]=function(_0x404a03){var _0x503d14=this;return new Promise(function(_0xac2bdb,_0x16ecbf){return db[_0x950b('0x15')]['update'](_0x404a03['body'],{'raw':_0x404a03[_0x950b('0x18')]?_0x404a03[_0x950b('0x18')][_0x950b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404a03['options']?_0x404a03['options'][_0x950b('0x1b')]||null:null,'attributes':_0x404a03[_0x950b('0x18')]?_0x404a03['options'][_0x950b('0x1c')]||null:null,'limit':_0x404a03[_0x950b('0x18')]?_0x404a03[_0x950b('0x18')][_0x950b('0x1d')]||null:null})['then'](function(_0x3b7c5c){logger[_0x950b('0xa')](_0x950b('0x1a'),_0x404a03);logger[_0x950b('0xd')]('UpdateWhatsappQueueReport',_0x404a03,JSON[_0x950b('0xe')](_0x3b7c5c));_0xac2bdb(_0x3b7c5c);})[_0x950b('0x13')](function(_0x3dbe1c){logger[_0x950b('0xf')](_0x950b('0x1a'),_0x3dbe1c[_0x950b('0x11')],_0x404a03);_0x16ecbf(_0x503d14['error'](0x1f4,_0x3dbe1c[_0x950b('0x11')]));});});}; \ No newline at end of file +var _0x84be=['UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','body','options','WhatsappQueueReport','update','where','attributes'];(function(_0x13d06d,_0x58b44f){var _0x20514e=function(_0x2cfeb1){while(--_0x2cfeb1){_0x13d06d['push'](_0x13d06d['shift']());}};_0x20514e(++_0x58b44f);}(_0x84be,0xc7));var _0xe84b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x84be[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xe84b('0x0'));var util=require(_0xe84b('0x1'));var moment=require(_0xe84b('0x2'));var BPromise=require(_0xe84b('0x3'));var rs=require(_0xe84b('0x4'));var fs=require('fs');var Redis=require(_0xe84b('0x5'));var db=require(_0xe84b('0x6'))['db'];var utils=require(_0xe84b('0x7'));var logger=require(_0xe84b('0x8'))('rpc');var config=require(_0xe84b('0x9'));var jayson=require(_0xe84b('0xa'));var client=jayson[_0xe84b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3a2,_0x545154,_0x11409){return new BPromise(function(_0x200b7f,_0x223d97){return client[_0xe84b('0xc')](_0x56e3a2,_0x11409)[_0xe84b('0xd')](function(_0x3ac04f){logger[_0xe84b('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x545154,_0xe84b('0xf'));logger[_0xe84b('0x10')](_0xe84b('0x11'),_0x545154,'request\x20sent',JSON[_0xe84b('0x12')](_0x3ac04f));if(_0x3ac04f[_0xe84b('0x13')]){if(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x14')]===0x1f4){logger[_0xe84b('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x545154,_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);return _0x223d97(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);}logger[_0xe84b('0x13')](_0xe84b('0x16'),_0x545154,_0x3ac04f[_0xe84b('0x13')]['message']);return _0x200b7f(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);}else{logger[_0xe84b('0xe')](_0xe84b('0x16'),_0x545154,_0xe84b('0xf'));_0x200b7f(_0x3ac04f[_0xe84b('0x17')][_0xe84b('0x15')]);}})[_0xe84b('0x18')](function(_0x11dc65){logger['error'](_0xe84b('0x16'),_0x545154,_0x11dc65);_0x223d97(_0x11dc65);});});}exports[_0xe84b('0x19')]=function(_0x12211d){var _0x31349f=this;return new Promise(function(_0x48f921,_0x20820d){return db['WhatsappQueueReport']['create'](_0x12211d[_0xe84b('0x1a')],{'raw':_0x12211d['options']?_0x12211d[_0xe84b('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xe84b('0xd')](function(_0x506f4c){logger['info'](_0xe84b('0x19'),_0x12211d);logger[_0xe84b('0x10')](_0xe84b('0x19'),_0x12211d,JSON['stringify'](_0x506f4c));_0x48f921(_0x506f4c);})[_0xe84b('0x18')](function(_0x20d019){logger[_0xe84b('0x13')]('CreateWhatsappQueueReport',_0x20d019[_0xe84b('0x15')],_0x12211d);_0x20820d(_0x31349f[_0xe84b('0x13')](0x1f4,_0x20d019[_0xe84b('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x40eb96){var _0x14c093=this;return new Promise(function(_0x21c819,_0x4faa39){return db[_0xe84b('0x1c')][_0xe84b('0x1d')](_0x40eb96['body'],{'raw':_0x40eb96[_0xe84b('0x1b')]?_0x40eb96['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40eb96['options']?_0x40eb96['options'][_0xe84b('0x1e')]||null:null,'attributes':_0x40eb96[_0xe84b('0x1b')]?_0x40eb96[_0xe84b('0x1b')][_0xe84b('0x1f')]||null:null,'limit':_0x40eb96['options']?_0x40eb96['options']['limit']||null:null})[_0xe84b('0xd')](function(_0x507418){logger[_0xe84b('0xe')](_0xe84b('0x20'),_0x40eb96);logger[_0xe84b('0x10')](_0xe84b('0x20'),_0x40eb96,JSON[_0xe84b('0x12')](_0x507418));_0x21c819(_0x507418);})[_0xe84b('0x18')](function(_0x529335){logger[_0xe84b('0x13')](_0xe84b('0x20'),_0x529335[_0xe84b('0x15')],_0x40eb96);_0x4faa39(_0x14c093[_0xe84b('0x13')](0x1f4,_0x529335[_0xe84b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index ed6c677..5b25a0e 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 _0x0f71=['/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x2c5ce4,_0x1b4766){var _0x4060a3=function(_0x3d4b86){while(--_0x3d4b86){_0x2c5ce4['push'](_0x2c5ce4['shift']());}};_0x4060a3(++_0x1b4766);}(_0x0f71,0x120));var _0x10f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x10f7('0x0'));var util=require(_0x10f7('0x1'));var path=require('path');var timeout=require(_0x10f7('0x2'));var express=require(_0x10f7('0x3'));var router=express[_0x10f7('0x4')]();var fs_extra=require(_0x10f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x10f7('0x6'));var config=require(_0x10f7('0x7'));var controller=require(_0x10f7('0x8'));router[_0x10f7('0x9')]('/',auth[_0x10f7('0xa')](),controller['index']);router[_0x10f7('0x9')](_0x10f7('0xb'),auth[_0x10f7('0xa')](),controller['describe']);router[_0x10f7('0x9')](_0x10f7('0xc'),auth['isAuthenticated'](),controller[_0x10f7('0xd')]);router[_0x10f7('0xe')]('/',auth[_0x10f7('0xa')](),controller[_0x10f7('0xf')]);router['put'](_0x10f7('0xc'),auth[_0x10f7('0xa')](),controller[_0x10f7('0x10')]);router[_0x10f7('0x11')](_0x10f7('0xc'),auth['isAuthenticated'](),controller[_0x10f7('0x12')]);module[_0x10f7('0x13')]=router; \ No newline at end of file +var _0x1b19=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b19,0x130));var _0x91b1=function(_0x479fa3,_0x473c51){_0x479fa3=_0x479fa3-0x0;var _0x158cfb=_0x1b19[_0x479fa3];return _0x158cfb;};'use strict';var multer=require('multer');var util=require(_0x91b1('0x0'));var path=require(_0x91b1('0x1'));var timeout=require(_0x91b1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x91b1('0x3'));var auth=require(_0x91b1('0x4'));var interaction=require(_0x91b1('0x5'));var config=require(_0x91b1('0x6'));var controller=require(_0x91b1('0x7'));router[_0x91b1('0x8')]('/',auth[_0x91b1('0x9')](),controller[_0x91b1('0xa')]);router[_0x91b1('0x8')](_0x91b1('0xb'),auth[_0x91b1('0x9')](),controller['describe']);router[_0x91b1('0x8')](_0x91b1('0xc'),auth[_0x91b1('0x9')](),controller[_0x91b1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x91b1('0xe')](_0x91b1('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x91b1('0xf')](_0x91b1('0xc'),auth[_0x91b1('0x9')](),controller[_0x91b1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 68678f1..8056ac8 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 _0xc5df=['STRING','ENUM','queue','DATE'];(function(_0x2d1a05,_0x31a1b5){var _0x36b160=function(_0xda41cd){while(--_0xda41cd){_0x2d1a05['push'](_0x2d1a05['shift']());}};_0x36b160(++_0x31a1b5);}(_0xc5df,0x80));var _0xfc5d=function(_0x32b50d,_0x28918f){_0x32b50d=_0x32b50d-0x0;var _0x4a7e1d=_0xc5df[_0x32b50d];return _0x4a7e1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xfc5d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xfc5d('0x1')]('account','agent',_0xfc5d('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfc5d('0x3')]}}; \ No newline at end of file +var _0x4b17=['DATE','sequelize','STRING','account','agent'];(function(_0x1864eb,_0x5b8fbe){var _0x5d3f40=function(_0x45c6c8){while(--_0x45c6c8){_0x1864eb['push'](_0x1864eb['shift']());}};_0x5d3f40(++_0x5b8fbe);}(_0x4b17,0x10f));var _0x74b1=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x4b17[_0x31b9cf];return _0x357b8a;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x74b1('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x74b1('0x2'),_0x74b1('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x74b1('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index df82f73..f485606 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 _0x01e4=['update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save'];(function(_0x329de8,_0x2c4fc2){var _0x506e48=function(_0x4517b0){while(--_0x4517b0){_0x329de8['push'](_0x329de8['shift']());}};_0x506e48(++_0x2c4fc2);}(_0x01e4,0xc2));var _0x401e=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x01e4[_0x118c30];return _0x569999;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x401e('0x0'));var jsonpatch=require(_0x401e('0x1'));var rp=require(_0x401e('0x2'));var moment=require('moment');var BPromise=require(_0x401e('0x3'));var Mustache=require(_0x401e('0x4'));var util=require(_0x401e('0x5'));var path=require('path');var sox=require(_0x401e('0x6'));var csv=require(_0x401e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x401e('0x8'));var _=require(_0x401e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x401e('0xa'));var deskjs=require(_0x401e('0xb'));var toCsv=require(_0x401e('0x7'));var querystring=require(_0x401e('0xc'));var Papa=require(_0x401e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x401e('0xe'));var as=require(_0x401e('0xf'));var hardwareService=require(_0x401e('0x10'));var logger=require(_0x401e('0x11'))(_0x401e('0x12'));var utils=require(_0x401e('0x13'));var config=require(_0x401e('0x14'));var licenseUtil=require(_0x401e('0x15'));var db=require(_0x401e('0x16'))['db'];function respondWithStatusCode(_0x29b3b1,_0x44925f){_0x44925f=_0x44925f||0xcc;return function(_0x435778){if(_0x435778){return _0x29b3b1['sendStatus'](_0x44925f);}return _0x29b3b1[_0x401e('0x17')](_0x44925f)[_0x401e('0x18')]();};}function respondWithResult(_0x2c7630,_0x301d92){_0x301d92=_0x301d92||0xc8;return function(_0x59b6a4){if(_0x59b6a4){return _0x2c7630['status'](_0x301d92)[_0x401e('0x19')](_0x59b6a4);}};}function respondWithFilteredResult(_0x4be276,_0x37972e){return function(_0x3cf763){if(_0x3cf763){var _0x188908=typeof _0x37972e['offset']===_0x401e('0x1a')&&typeof _0x37972e[_0x401e('0x1b')]===_0x401e('0x1a');var _0x499425=_0x3cf763[_0x401e('0x1c')];var _0x5e82b9=_0x188908?0x0:_0x37972e[_0x401e('0x1d')];var _0x14f1da=_0x188908?_0x3cf763[_0x401e('0x1c')]:_0x37972e[_0x401e('0x1d')]+_0x37972e['limit'];var _0x36152d;if(_0x14f1da>=_0x499425){_0x14f1da=_0x499425;_0x36152d=0xc8;}else{_0x36152d=0xce;}_0x4be276['status'](_0x36152d);return _0x4be276[_0x401e('0x1e')](_0x401e('0x1f'),_0x5e82b9+'-'+_0x14f1da+'/'+_0x499425)[_0x401e('0x19')](_0x3cf763);}return null;};}function patchUpdates(_0x35e4ba){return function(_0x5ecde7){try{jsonpatch['apply'](_0x5ecde7,_0x35e4ba,!![]);}catch(_0x71aa86){return BPromise[_0x401e('0x20')](_0x71aa86);}return _0x5ecde7[_0x401e('0x21')]();};}function saveUpdates(_0x48961a,_0xb8167d){return function(_0x3e598d){if(_0x3e598d){return _0x3e598d[_0x401e('0x22')](_0x48961a)[_0x401e('0x23')](function(_0x3c46da){return _0x3c46da;});}return null;};}function removeEntity(_0x46c672,_0x2bb2a8){return function(_0x33b85b){if(_0x33b85b){return _0x33b85b[_0x401e('0x24')]()[_0x401e('0x23')](function(){_0x46c672[_0x401e('0x17')](0xcc)[_0x401e('0x18')]();});}};}function handleEntityNotFound(_0x2a2abf,_0x22fa8d){return function(_0x129f65){if(!_0x129f65){_0x2a2abf[_0x401e('0x25')](0x194);}return _0x129f65;};}function handleError(_0x5a737b,_0x35ec50){_0x35ec50=_0x35ec50||0x1f4;return function(_0x419648){logger[_0x401e('0x26')](_0x419648[_0x401e('0x27')]);if(_0x419648[_0x401e('0x28')]){delete _0x419648[_0x401e('0x28')];}_0x5a737b[_0x401e('0x17')](_0x35ec50)[_0x401e('0x29')](_0x419648);};}exports[_0x401e('0x2a')]=function(_0x14c639,_0x5859db){var _0x40b8e6={},_0x5915df={},_0x1ff402={'count':0x0,'rows':[]};var _0x405bc4=_[_0x401e('0x2b')](db[_0x401e('0x2c')][_0x401e('0x2d')],function(_0x3cf260){return{'name':_0x3cf260[_0x401e('0x2e')],'type':_0x3cf260['type'][_0x401e('0x2f')]};});_0x5915df[_0x401e('0x30')]=_[_0x401e('0x2b')](_0x405bc4,_0x401e('0x28'));_0x5915df['query']=_['keys'](_0x14c639['query']);_0x5915df[_0x401e('0x31')]=_[_0x401e('0x32')](_0x5915df['model'],_0x5915df['query']);_0x40b8e6[_0x401e('0x33')]=_['intersection'](_0x5915df[_0x401e('0x30')],qs[_0x401e('0x34')](_0x14c639['query'][_0x401e('0x34')]));_0x40b8e6[_0x401e('0x33')]=_0x40b8e6[_0x401e('0x33')][_0x401e('0x35')]?_0x40b8e6[_0x401e('0x33')]:_0x5915df[_0x401e('0x30')];if(!_0x14c639[_0x401e('0x36')][_0x401e('0x37')](_0x401e('0x38'))){_0x40b8e6['limit']=qs['limit'](_0x14c639[_0x401e('0x36')]['limit']);_0x40b8e6[_0x401e('0x1d')]=qs[_0x401e('0x1d')](_0x14c639[_0x401e('0x36')][_0x401e('0x1d')]);}_0x40b8e6[_0x401e('0x39')]=qs[_0x401e('0x3a')](_0x14c639[_0x401e('0x36')][_0x401e('0x3a')]);_0x40b8e6[_0x401e('0x3b')]=qs[_0x401e('0x31')](_[_0x401e('0x3c')](_0x14c639[_0x401e('0x36')],_0x5915df[_0x401e('0x31')]),_0x405bc4);if(_0x14c639[_0x401e('0x36')]['filter']){_0x40b8e6['where']=_[_0x401e('0x3d')](_0x40b8e6[_0x401e('0x3b')],{'$or':_[_0x401e('0x2b')](_0x405bc4,function(_0x2c74fe){if(_0x2c74fe[_0x401e('0x3e')]!=='VIRTUAL'){var _0x5959fd={};_0x5959fd[_0x2c74fe[_0x401e('0x28')]]={'$like':'%'+_0x14c639['query'][_0x401e('0x3f')]+'%'};return _0x5959fd;}})});}_0x40b8e6=_['merge']({},_0x40b8e6,_0x14c639[_0x401e('0x40')]);var _0x1a8507={'where':_0x40b8e6[_0x401e('0x3b')]};return db[_0x401e('0x2c')][_0x401e('0x1c')](_0x1a8507)[_0x401e('0x23')](function(_0x5c9e0b){_0x1ff402[_0x401e('0x1c')]=_0x5c9e0b;if(_0x14c639[_0x401e('0x36')][_0x401e('0x41')]){_0x40b8e6[_0x401e('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x40b8e6);})[_0x401e('0x23')](function(_0x3d6dc0){_0x1ff402[_0x401e('0x43')]=_0x3d6dc0;return _0x1ff402;})['then'](respondWithFilteredResult(_0x5859db,_0x40b8e6))[_0x401e('0x44')](handleError(_0x5859db,null));};exports[_0x401e('0x45')]=function(_0x2b1f32,_0x12facb){var _0x2b06e7={'raw':!![],'where':{'id':_0x2b1f32[_0x401e('0x46')]['id']}},_0x2b4665={};_0x2b4665[_0x401e('0x30')]=_[_0x401e('0x47')](db[_0x401e('0x2c')][_0x401e('0x2d')]);_0x2b4665[_0x401e('0x36')]=_[_0x401e('0x47')](_0x2b1f32['query']);_0x2b4665[_0x401e('0x31')]=_[_0x401e('0x32')](_0x2b4665['model'],_0x2b4665[_0x401e('0x36')]);_0x2b06e7['attributes']=_[_0x401e('0x32')](_0x2b4665[_0x401e('0x30')],qs[_0x401e('0x34')](_0x2b1f32['query'][_0x401e('0x34')]));_0x2b06e7['attributes']=_0x2b06e7[_0x401e('0x33')][_0x401e('0x35')]?_0x2b06e7[_0x401e('0x33')]:_0x2b4665[_0x401e('0x30')];if(_0x2b1f32[_0x401e('0x36')][_0x401e('0x41')]){_0x2b06e7[_0x401e('0x42')]=[{'all':!![]}];}_0x2b06e7=_['merge']({},_0x2b06e7,_0x2b1f32['options']);return db[_0x401e('0x2c')]['find'](_0x2b06e7)[_0x401e('0x23')](handleEntityNotFound(_0x12facb,null))['then'](respondWithResult(_0x12facb,null))['catch'](handleError(_0x12facb,null));};exports[_0x401e('0x48')]=function(_0x22b018,_0x454259){return db[_0x401e('0x2c')][_0x401e('0x48')](_0x22b018['body'],{})[_0x401e('0x23')](respondWithResult(_0x454259,0xc9))['catch'](handleError(_0x454259,null));};exports[_0x401e('0x22')]=function(_0xb3cbc2,_0x59c529){if(_0xb3cbc2[_0x401e('0x49')]['id']){delete _0xb3cbc2[_0x401e('0x49')]['id'];}return db[_0x401e('0x2c')]['find']({'where':{'id':_0xb3cbc2[_0x401e('0x46')]['id']}})[_0x401e('0x23')](handleEntityNotFound(_0x59c529,null))[_0x401e('0x23')](saveUpdates(_0xb3cbc2[_0x401e('0x49')],null))[_0x401e('0x23')](respondWithResult(_0x59c529,null))[_0x401e('0x44')](handleError(_0x59c529,null));};exports[_0x401e('0x24')]=function(_0x2ca84f,_0x3322c7){return db['WhatsappTransferReport'][_0x401e('0x4a')]({'where':{'id':_0x2ca84f['params']['id']}})[_0x401e('0x23')](handleEntityNotFound(_0x3322c7,null))[_0x401e('0x23')](removeEntity(_0x3322c7,null))[_0x401e('0x44')](handleError(_0x3322c7,null));};exports[_0x401e('0x4b')]=function(_0x34a5c1,_0x29c4a3){return db[_0x401e('0x2c')][_0x401e('0x4b')]()['then'](respondWithResult(_0x29c4a3,null))[_0x401e('0x44')](handleError(_0x29c4a3,null));}; \ No newline at end of file +var _0x3eae=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis'];(function(_0x17cf80,_0x28f68f){var _0x873913=function(_0x971599){while(--_0x971599){_0x17cf80['push'](_0x17cf80['shift']());}};_0x873913(++_0x28f68f);}(_0x3eae,0x126));var _0xe3ea=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x3eae[_0x576170];return _0x397c70;};'use strict';var emlformat=require(_0xe3ea('0x0'));var rimraf=require(_0xe3ea('0x1'));var zipdir=require(_0xe3ea('0x2'));var jsonpatch=require(_0xe3ea('0x3'));var rp=require('request-promise');var moment=require(_0xe3ea('0x4'));var BPromise=require(_0xe3ea('0x5'));var Mustache=require('mustache');var util=require(_0xe3ea('0x6'));var path=require(_0xe3ea('0x7'));var sox=require(_0xe3ea('0x8'));var csv=require('to-csv');var ejs=require(_0xe3ea('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ea('0xa'));var _=require(_0xe3ea('0xb'));var squel=require(_0xe3ea('0xc'));var crypto=require(_0xe3ea('0xd'));var jsforce=require(_0xe3ea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe3ea('0xf'));var querystring=require(_0xe3ea('0x10'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0x11'));var authService=require(_0xe3ea('0x12'));var qs=require(_0xe3ea('0x13'));var as=require(_0xe3ea('0x14'));var hardwareService=require(_0xe3ea('0x15'));var logger=require('../../config/logger')(_0xe3ea('0x16'));var utils=require(_0xe3ea('0x17'));var config=require(_0xe3ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x19'))['db'];function respondWithStatusCode(_0x3fa991,_0x470912){_0x470912=_0x470912||0xcc;return function(_0x1312e0){if(_0x1312e0){return _0x3fa991[_0xe3ea('0x1a')](_0x470912);}return _0x3fa991[_0xe3ea('0x1b')](_0x470912)['end']();};}function respondWithResult(_0x544dfe,_0x1701d3){_0x1701d3=_0x1701d3||0xc8;return function(_0x335689){if(_0x335689){return _0x544dfe[_0xe3ea('0x1b')](_0x1701d3)[_0xe3ea('0x1c')](_0x335689);}};}function respondWithFilteredResult(_0x45ba02,_0x4ac0ea){return function(_0x4c92b2){if(_0x4c92b2){var _0x27885e=typeof _0x4ac0ea[_0xe3ea('0x1d')]==='undefined'&&typeof _0x4ac0ea[_0xe3ea('0x1e')]===_0xe3ea('0x1f');var _0x4af35e=_0x4c92b2['count'];var _0x2af916=_0x27885e?0x0:_0x4ac0ea[_0xe3ea('0x1d')];var _0x417b88=_0x27885e?_0x4c92b2[_0xe3ea('0x20')]:_0x4ac0ea[_0xe3ea('0x1d')]+_0x4ac0ea[_0xe3ea('0x1e')];var _0x4d611a;if(_0x417b88>=_0x4af35e){_0x417b88=_0x4af35e;_0x4d611a=0xc8;}else{_0x4d611a=0xce;}_0x45ba02['status'](_0x4d611a);return _0x45ba02[_0xe3ea('0x21')]('Content-Range',_0x2af916+'-'+_0x417b88+'/'+_0x4af35e)['json'](_0x4c92b2);}return null;};}function patchUpdates(_0xcbb4db){return function(_0xe8e88){try{jsonpatch[_0xe3ea('0x22')](_0xe8e88,_0xcbb4db,!![]);}catch(_0x181720){return BPromise[_0xe3ea('0x23')](_0x181720);}return _0xe8e88[_0xe3ea('0x24')]();};}function saveUpdates(_0x161c0e,_0x2f763b){return function(_0x342192){if(_0x342192){return _0x342192[_0xe3ea('0x25')](_0x161c0e)[_0xe3ea('0x26')](function(_0x37be78){return _0x37be78;});}return null;};}function removeEntity(_0x196fac,_0x580da3){return function(_0x3f728c){if(_0x3f728c){return _0x3f728c[_0xe3ea('0x27')]()[_0xe3ea('0x26')](function(){_0x196fac[_0xe3ea('0x1b')](0xcc)[_0xe3ea('0x28')]();});}};}function handleEntityNotFound(_0x3c7131,_0x145cf4){return function(_0x5305e1){if(!_0x5305e1){_0x3c7131[_0xe3ea('0x1a')](0x194);}return _0x5305e1;};}function handleError(_0x1b143a,_0x5d0108){_0x5d0108=_0x5d0108||0x1f4;return function(_0x2e09f7){logger[_0xe3ea('0x29')](_0x2e09f7[_0xe3ea('0x2a')]);if(_0x2e09f7[_0xe3ea('0x2b')]){delete _0x2e09f7['name'];}_0x1b143a['status'](_0x5d0108)[_0xe3ea('0x2c')](_0x2e09f7);};}exports['index']=function(_0x3032b1,_0x372b7c){var _0x168c9b={},_0x5292b4={},_0x115a78={'count':0x0,'rows':[]};var _0x505550=_[_0xe3ea('0x2d')](db[_0xe3ea('0x2e')][_0xe3ea('0x2f')],function(_0x530948){return{'name':_0x530948[_0xe3ea('0x30')],'type':_0x530948['type'][_0xe3ea('0x31')]};});_0x5292b4[_0xe3ea('0x32')]=_[_0xe3ea('0x2d')](_0x505550,_0xe3ea('0x2b'));_0x5292b4['query']=_['keys'](_0x3032b1[_0xe3ea('0x33')]);_0x5292b4[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x5292b4[_0xe3ea('0x32')],_0x5292b4[_0xe3ea('0x33')]);_0x168c9b['attributes']=_[_0xe3ea('0x35')](_0x5292b4['model'],qs['fields'](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x36')]));_0x168c9b['attributes']=_0x168c9b['attributes'][_0xe3ea('0x37')]?_0x168c9b[_0xe3ea('0x38')]:_0x5292b4[_0xe3ea('0x32')];if(!_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x39')](_0xe3ea('0x3a'))){_0x168c9b['limit']=qs[_0xe3ea('0x1e')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x1e')]);_0x168c9b[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x1d')]);}_0x168c9b[_0xe3ea('0x3b')]=qs[_0xe3ea('0x3c')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x3c')]);_0x168c9b[_0xe3ea('0x3d')]=qs[_0xe3ea('0x34')](_[_0xe3ea('0x3e')](_0x3032b1['query'],_0x5292b4['filters']),_0x505550);if(_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x3f')]){_0x168c9b[_0xe3ea('0x3d')]=_['merge'](_0x168c9b[_0xe3ea('0x3d')],{'$or':_[_0xe3ea('0x2d')](_0x505550,function(_0x16fbb9){if(_0x16fbb9[_0xe3ea('0x40')]!==_0xe3ea('0x41')){var _0x4a28a4={};_0x4a28a4[_0x16fbb9[_0xe3ea('0x2b')]]={'$like':'%'+_0x3032b1['query']['filter']+'%'};return _0x4a28a4;}})});}_0x168c9b=_[_0xe3ea('0x42')]({},_0x168c9b,_0x3032b1[_0xe3ea('0x43')]);var _0x24202b={'where':_0x168c9b[_0xe3ea('0x3d')]};return db[_0xe3ea('0x2e')][_0xe3ea('0x20')](_0x24202b)[_0xe3ea('0x26')](function(_0x105726){_0x115a78['count']=_0x105726;if(_0x3032b1['query'][_0xe3ea('0x44')]){_0x168c9b[_0xe3ea('0x45')]=[{'all':!![]}];}return db[_0xe3ea('0x2e')]['findAll'](_0x168c9b);})[_0xe3ea('0x26')](function(_0x58df4e){_0x115a78[_0xe3ea('0x46')]=_0x58df4e;return _0x115a78;})[_0xe3ea('0x26')](respondWithFilteredResult(_0x372b7c,_0x168c9b))['catch'](handleError(_0x372b7c,null));};exports['show']=function(_0x28e714,_0x387f1c){var _0x3a248a={'raw':!![],'where':{'id':_0x28e714[_0xe3ea('0x47')]['id']}},_0x5d18ec={};_0x5d18ec['model']=_[_0xe3ea('0x48')](db[_0xe3ea('0x2e')]['rawAttributes']);_0x5d18ec[_0xe3ea('0x33')]=_['keys'](_0x28e714['query']);_0x5d18ec[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x5d18ec[_0xe3ea('0x32')],_0x5d18ec[_0xe3ea('0x33')]);_0x3a248a[_0xe3ea('0x38')]=_[_0xe3ea('0x35')](_0x5d18ec[_0xe3ea('0x32')],qs['fields'](_0x28e714[_0xe3ea('0x33')][_0xe3ea('0x36')]));_0x3a248a['attributes']=_0x3a248a[_0xe3ea('0x38')][_0xe3ea('0x37')]?_0x3a248a[_0xe3ea('0x38')]:_0x5d18ec[_0xe3ea('0x32')];if(_0x28e714[_0xe3ea('0x33')]['includeAll']){_0x3a248a[_0xe3ea('0x45')]=[{'all':!![]}];}_0x3a248a=_[_0xe3ea('0x42')]({},_0x3a248a,_0x28e714[_0xe3ea('0x43')]);return db['WhatsappTransferReport']['find'](_0x3a248a)['then'](handleEntityNotFound(_0x387f1c,null))[_0xe3ea('0x26')](respondWithResult(_0x387f1c,null))[_0xe3ea('0x49')](handleError(_0x387f1c,null));};exports['create']=function(_0x2a57b4,_0x219819){return db[_0xe3ea('0x2e')][_0xe3ea('0x4a')](_0x2a57b4[_0xe3ea('0x4b')],{})[_0xe3ea('0x26')](respondWithResult(_0x219819,0xc9))['catch'](handleError(_0x219819,null));};exports[_0xe3ea('0x25')]=function(_0x4d71a9,_0x3b9e62){if(_0x4d71a9['body']['id']){delete _0x4d71a9[_0xe3ea('0x4b')]['id'];}return db[_0xe3ea('0x2e')]['find']({'where':{'id':_0x4d71a9[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x3b9e62,null))[_0xe3ea('0x26')](saveUpdates(_0x4d71a9[_0xe3ea('0x4b')],null))[_0xe3ea('0x26')](respondWithResult(_0x3b9e62,null))[_0xe3ea('0x49')](handleError(_0x3b9e62,null));};exports[_0xe3ea('0x27')]=function(_0x41c1a7,_0x46d079){return db[_0xe3ea('0x2e')][_0xe3ea('0x4c')]({'where':{'id':_0x41c1a7[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x46d079,null))['then'](removeEntity(_0x46d079,null))[_0xe3ea('0x49')](handleError(_0x46d079,null));};exports[_0xe3ea('0x4d')]=function(_0x58cd2d,_0x242030){return db[_0xe3ea('0x2e')][_0xe3ea('0x4d')]()[_0xe3ea('0x26')](respondWithResult(_0x242030,null))[_0xe3ea('0x49')](handleError(_0x242030,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f477862..1f57966 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 _0x3dbe=['report_whatsapp_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','WhatsappTransferReport'];(function(_0x405702,_0x2af44c){var _0x58d46c=function(_0x366e52){while(--_0x366e52){_0x405702['push'](_0x405702['shift']());}};_0x58d46c(++_0x2af44c);}(_0x3dbe,0x156));var _0xe3db=function(_0x57d704,_0x13fe42){_0x57d704=_0x57d704-0x0;var _0x32edea=_0x3dbe[_0x57d704];return _0x32edea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3db('0x0'))(_0xe3db('0x1'));var moment=require('moment');var BPromise=require(_0xe3db('0x2'));var rp=require(_0xe3db('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe3db('0x4'));var attributes=require('./whatsappTransferReport.attributes');module[_0xe3db('0x5')]=function(_0x54a371,_0x4e0b5f){return _0x54a371[_0xe3db('0x6')](_0xe3db('0x7'),attributes,{'tableName':_0xe3db('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe3db('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6910=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6910,0x87));var _0x0691=function(_0x2c8802,_0x4ad8e4){_0x2c8802=_0x2c8802-0x0;var _0x29fefc=_0x6910[_0x2c8802];return _0x29fefc;};'use strict';var _=require(_0x0691('0x0'));var util=require(_0x0691('0x1'));var logger=require(_0x0691('0x2'))(_0x0691('0x3'));var moment=require('moment');var BPromise=require(_0x0691('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0691('0x5'));var rimraf=require('rimraf');var config=require(_0x0691('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x0691('0x7')]=function(_0x1924ce,_0x1fadfd){return _0x1924ce[_0x0691('0x8')](_0x0691('0x9'),attributes,{'tableName':_0x0691('0xa'),'paranoid':![],'indexes':[{'name':_0x0691('0xb'),'fields':[_0x0691('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 459a088..8ed4f31 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 _0xe5f8=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x55a00b,_0x53b221){var _0x2e0591=function(_0xaf6a93){while(--_0xaf6a93){_0x55a00b['push'](_0x55a00b['shift']());}};_0x2e0591(++_0x53b221);}(_0xe5f8,0x1a9));var _0x8e5f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe5f8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x8e5f('0x0'));var util=require('util');var moment=require(_0x8e5f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e5f('0x2'));var db=require(_0x8e5f('0x3'))['db'];var utils=require(_0x8e5f('0x4'));var logger=require(_0x8e5f('0x5'))(_0x8e5f('0x6'));var config=require(_0x8e5f('0x7'));var jayson=require(_0x8e5f('0x8'));var client=jayson['client'][_0x8e5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bd9d,_0x3ca427,_0xbe7821){return new BPromise(function(_0x1b89e3,_0x3326ce){return client[_0x8e5f('0xa')](_0x2bd9d,_0xbe7821)['then'](function(_0xae3415){logger[_0x8e5f('0xb')](_0x8e5f('0xc'),_0x3ca427,_0x8e5f('0xd'));logger[_0x8e5f('0xe')](_0x8e5f('0xf'),_0x3ca427,_0x8e5f('0xd'),JSON[_0x8e5f('0x10')](_0xae3415));if(_0xae3415[_0x8e5f('0x11')]){if(_0xae3415[_0x8e5f('0x11')][_0x8e5f('0x12')]===0x1f4){logger['error'](_0x8e5f('0xc'),_0x3ca427,_0xae3415[_0x8e5f('0x11')][_0x8e5f('0x13')]);return _0x3326ce(_0xae3415[_0x8e5f('0x11')][_0x8e5f('0x13')]);}logger[_0x8e5f('0x11')](_0x8e5f('0xc'),_0x3ca427,_0xae3415['error'][_0x8e5f('0x13')]);return _0x1b89e3(_0xae3415[_0x8e5f('0x11')]['message']);}else{logger[_0x8e5f('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3ca427,_0x8e5f('0xd'));_0x1b89e3(_0xae3415[_0x8e5f('0x14')][_0x8e5f('0x13')]);}})[_0x8e5f('0x15')](function(_0x2ada41){logger[_0x8e5f('0x11')](_0x8e5f('0xc'),_0x3ca427,_0x2ada41);_0x3326ce(_0x2ada41);});});} \ No newline at end of file +var _0xcf49=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x85cfdb,_0x54de23){var _0x54d7de=function(_0x33bbcb){while(--_0x33bbcb){_0x85cfdb['push'](_0x85cfdb['shift']());}};_0x54d7de(++_0x54de23);}(_0xcf49,0x1a2));var _0x9cf4=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0xcf49[_0x403cff];return _0x5a7c56;};'use strict';var _=require(_0x9cf4('0x0'));var util=require(_0x9cf4('0x1'));var moment=require(_0x9cf4('0x2'));var BPromise=require(_0x9cf4('0x3'));var rs=require(_0x9cf4('0x4'));var fs=require('fs');var Redis=require(_0x9cf4('0x5'));var db=require(_0x9cf4('0x6'))['db'];var utils=require(_0x9cf4('0x7'));var logger=require(_0x9cf4('0x8'))(_0x9cf4('0x9'));var config=require(_0x9cf4('0xa'));var jayson=require(_0x9cf4('0xb'));var client=jayson[_0x9cf4('0xc')][_0x9cf4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x50af3e,_0x5d0ff7,_0x24fac4){return new BPromise(function(_0xcd8c11,_0x43a34e){return client[_0x9cf4('0xe')](_0x50af3e,_0x24fac4)[_0x9cf4('0xf')](function(_0x2b80dd){logger[_0x9cf4('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5d0ff7,_0x9cf4('0x11'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5d0ff7,_0x9cf4('0x11'),JSON[_0x9cf4('0x12')](_0x2b80dd));if(_0x2b80dd[_0x9cf4('0x13')]){if(_0x2b80dd[_0x9cf4('0x13')][_0x9cf4('0x14')]===0x1f4){logger[_0x9cf4('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5d0ff7,_0x2b80dd[_0x9cf4('0x13')]['message']);return _0x43a34e(_0x2b80dd[_0x9cf4('0x13')][_0x9cf4('0x15')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x5d0ff7,_0x2b80dd[_0x9cf4('0x13')][_0x9cf4('0x15')]);return _0xcd8c11(_0x2b80dd[_0x9cf4('0x13')][_0x9cf4('0x15')]);}else{logger[_0x9cf4('0x10')](_0x9cf4('0x16'),_0x5d0ff7,'request\x20sent');_0xcd8c11(_0x2b80dd[_0x9cf4('0x17')][_0x9cf4('0x15')]);}})[_0x9cf4('0x18')](function(_0x44220a){logger[_0x9cf4('0x13')](_0x9cf4('0x16'),_0x5d0ff7,_0x44220a);_0x43a34e(_0x44220a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 01007c8..535409a 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc79=['then','listen','info','start','map','filter','online','join','Offline\x20apps:','status','name','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize'];(function(_0x4ad688,_0x3c5767){var _0x535408=function(_0x26356e){while(--_0x26356e){_0x4ad688['push'](_0x4ad688['shift']());}};_0x535408(++_0x3c5767);}(_0xfc79,0x1d3));var _0x9fc7=function(_0x221582,_0x186c21){_0x221582=_0x221582-0x0;var _0x2d0c50=_0xfc79[_0x221582];return _0x2d0c50;};'use strict';var _=require(_0x9fc7('0x0'));var mysqldb=require(_0x9fc7('0x1'));var rpc=require(_0x9fc7('0x2'));var config=require(_0x9fc7('0x3'));var logger=require(_0x9fc7('0x4'))(_0x9fc7('0x5'));var pm2=require(_0x9fc7('0x6'));var pm2Config=require(_0x9fc7('0x7'));var schedule=require(_0x9fc7('0x8'));var chat=require(_0x9fc7('0x9'));var whatsapp=require(_0x9fc7('0xa'));var transcribe=require(_0x9fc7('0xb'));function main(){return mysqldb['db'][_0x9fc7('0xc')]['sync']()[_0x9fc7('0xd')](function(){return rpc[_0x9fc7('0xe')]();})[_0x9fc7('0xd')](function(_0x17c231){logger[_0x9fc7('0xf')](_0x17c231);return chat[_0x9fc7('0x10')]();})[_0x9fc7('0xd')](function(){return whatsapp['start']();})[_0x9fc7('0xd')](function(){return schedule[_0x9fc7('0x10')]();})[_0x9fc7('0xd')](function(){return transcribe[_0x9fc7('0x10')]();})[_0x9fc7('0xd')](function(_0x5cdf64){logger[_0x9fc7('0xf')](_0x5cdf64);return pm2['start'](pm2Config);})[_0x9fc7('0xd')](function(_0x45a18f){logger[_0x9fc7('0xf')]('Online\x20apps:',_[_0x9fc7('0x11')](_[_0x9fc7('0x12')](_0x45a18f,{'status':_0x9fc7('0x13')}),'name')[_0x9fc7('0x14')]());logger[_0x9fc7('0xf')](_0x9fc7('0x15'),_[_0x9fc7('0x11')](_[_0x9fc7('0x12')](_0x45a18f,function(_0x48fc2c){return _0x48fc2c[_0x9fc7('0x16')]!==_0x9fc7('0x13');}),_0x9fc7('0x17'))[_0x9fc7('0x14')]()||'None');config['seedDB']&&require(_0x9fc7('0x18'))[_0x9fc7('0x19')]();require(_0x9fc7('0x1a'))[_0x9fc7('0x19')]();})['catch'](function(_0x3b1c47){logger[_0x9fc7('0x1b')](_0x9fc7('0x1c'),_0x3b1c47);process[_0x9fc7('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x334d=['./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','Offline\x20apps:','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x334d,0x79));var _0xd334=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x334d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd334('0x0'));var mysqldb=require(_0xd334('0x1'));var rpc=require(_0xd334('0x2'));var config=require(_0xd334('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0xd334('0x4'));var pm2Config=require(_0xd334('0x5'));var schedule=require(_0xd334('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xd334('0x7'));var transcribe=require(_0xd334('0x8'));function main(){return mysqldb['db'][_0xd334('0x9')][_0xd334('0xa')]()[_0xd334('0xb')](function(){return rpc[_0xd334('0xc')]();})[_0xd334('0xb')](function(_0x2591a9){logger[_0xd334('0xd')](_0x2591a9);return chat[_0xd334('0xe')]();})[_0xd334('0xb')](function(){return whatsapp[_0xd334('0xe')]();})[_0xd334('0xb')](function(){return schedule[_0xd334('0xe')]();})['then'](function(){return transcribe[_0xd334('0xe')]();})['then'](function(_0x2ea0f5){logger[_0xd334('0xd')](_0x2ea0f5);return pm2[_0xd334('0xe')](pm2Config);})[_0xd334('0xb')](function(_0x56c52b){logger[_0xd334('0xd')](_0xd334('0xf'),_[_0xd334('0x10')](_[_0xd334('0x11')](_0x56c52b,{'status':_0xd334('0x12')}),_0xd334('0x13'))['join']());logger[_0xd334('0xd')](_0xd334('0x14'),_['map'](_[_0xd334('0x11')](_0x56c52b,function(_0x4c25c4){return _0x4c25c4['status']!==_0xd334('0x12');}),_0xd334('0x13'))[_0xd334('0x15')]()||_0xd334('0x16'));config[_0xd334('0x17')]&&require(_0xd334('0x18'))[_0xd334('0x19')]();require(_0xd334('0x1a'))[_0xd334('0x19')]();})[_0xd334('0x1b')](function(_0x46161a){logger[_0xd334('0x1c')](_0xd334('0x1d'),_0x46161a);process[_0xd334('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4041513..91e48af 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 _0xb41a=['../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','mailPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','ChatInteraction','then','closed','status','unmanaged','Unmanaged.','Forbidden.','use','headers','authorization','Basic','find','authenticate','json','user','Unknown\x20authorization\x20format','getUuid','query','User','sub','Setting','findOne','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','catch','Invalid\x20API\x20access\x20key','User\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apikey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','session','randomBytes','toString','hex','floor','HS512','../../config/environment','../../config/license/hardware','../../config/license/util'];(function(_0x253b20,_0x5f53da){var _0x2c45f0=function(_0x6cc3a4){while(--_0x6cc3a4){_0x253b20['push'](_0x253b20['shift']());}};_0x2c45f0(++_0x5f53da);}(_0xb41a,0x76));var _0xab41=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xb41a[_0x547af];return _0x22f7f4;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xab41('0x0'));var hardwareConf=require(_0xab41('0x1'));var licenseUtil=require(_0xab41('0x2'));var encryptor=require(_0xab41('0x3'));var _=require(_0xab41('0x4'));var jwt=require(_0xab41('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xab41('0x6'));var basicAuth=require(_0xab41('0x7'));var crypto=require(_0xab41('0x8'));var BPromise=require(_0xab41('0x9'));var util=require(_0xab41('0xa'));var moment=require(_0xab41('0xb'));var validateJwt=expressJwt({'secret':config[_0xab41('0xc')]['session']});var userAttributes=['id',_0xab41('0xd'),_0xab41('0xe'),_0xab41('0xf'),_0xab41('0x10'),_0xab41('0x11'),_0xab41('0x12'),_0xab41('0x13'),_0xab41('0x14'),'voicePause','chatPause',_0xab41('0x15'),'faxPause',_0xab41('0x16'),_0xab41('0x17'),'pauseType',_0xab41('0x18'),_0xab41('0x19'),_0xab41('0x1a'),'crudPermissions','allowmessenger',_0xab41('0x1b'),_0xab41('0x1c'),'phoneBarAutoAnswer',_0xab41('0x1d'),'phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone',_0xab41('0x1e'),'phoneBarExpires',_0xab41('0x1f'),_0xab41('0x20'),_0xab41('0x21'),_0xab41('0x22'),_0xab41('0x23'),_0xab41('0x24'),_0xab41('0x25'),_0xab41('0x26'),_0xab41('0x27'),_0xab41('0x28'),'downloadOmnichannelInteractions',_0xab41('0x29'),_0xab41('0x2a'),_0xab41('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0xab41('0x2c')](!![])['use'](function(_0x404ab9,_0x3cf311,_0x6176a9){if(_0x404ab9['user']){_0x6176a9();}else{return db[_0xab41('0x2d')]['findOne']({'where':{'id':_0x404ab9['params']['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xab41('0x2e')](function(_0x12a73c){if(_0x12a73c&&_0x12a73c[_0xab41('0x2f')]){return _0x3cf311[_0xab41('0x30')](_0x12a73c['disposition']===_0xab41('0x31')?0x195:0x193)['json']({'message':_0x12a73c['disposition']===_0xab41('0x31')?_0xab41('0x32'):_0xab41('0x33')});}else{_0x6176a9();}})['catch'](function(_0xf9ea41){_0x6176a9(_0xf9ea41);});}});};exports[_0xab41('0x2c')]=function isAuthenticated(_0x5c420a){return compose()[_0xab41('0x34')](function(_0x15622b,_0x5c9229,_0x774a82){var _0x479e67;if(_0x15622b[_0xab41('0x35')][_0xab41('0x36')]){if(_['startsWith'](_0x15622b['headers']['authorization'],_0xab41('0x37'))){var _0x1cdcc8=basicAuth(_0x15622b);db['User'][_0xab41('0x38')]({'where':{'name':_0x1cdcc8[_0xab41('0xf')]}})['then'](function(_0x2a0ad4){if(!_0x2a0ad4||!_0x2a0ad4[_0xab41('0x39')](_0x1cdcc8['pass'])){return _0x5c9229['status'](0x191)[_0xab41('0x3a')]({'message':'Wrong\x20credentials.'});}_0x15622b[_0xab41('0x3b')]={'id':_0x2a0ad4['id']};_0x774a82();})['catch'](function(_0x29f792){_0x774a82(_0x29f792);});}else if(_['startsWith'](_0x15622b['headers'][_0xab41('0x36')],'Bearer')){validateJwt(_0x15622b,_0x5c9229,_0x774a82);}else{if(_0x5c420a){_0x774a82();}else{return _0x5c9229[_0xab41('0x30')](0x193)[_0xab41('0x3a')]({'message':_0xab41('0x3c')});}}}else if(_0x15622b['query']['apikey']){try{var _0x2d7a99={'audience':hardwareConf[_0xab41('0x3d')](),'issuer':hardwareConf[_0xab41('0x3d')]()};verifyJwt(_0x15622b[_0xab41('0x3e')]['apikey'],_0x2d7a99)[_0xab41('0x2e')](function(_0x171698){return db[_0xab41('0x3f')]['find']({'where':{'id':_0x171698[_0xab41('0x40')]}})[_0xab41('0x2e')](function(_0x5a30f9){_0x479e67=_0x5a30f9;return db[_0xab41('0x41')][_0xab41('0x42')]({'where':{'id':0x1},'attributes':[_0xab41('0x43'),_0xab41('0x44')],'raw':!![]});})[_0xab41('0x2e')](function(_0x5837b9){if(!_0x479e67||!_['isEqual'](_0x479e67[_0xab41('0x45')],_0x171698[_0xab41('0x46')])){return _0x5c9229[_0xab41('0x30')](0x191)[_0xab41('0x3a')]({'message':_0xab41('0x47')});}if(_0x479e67[_0xab41('0x48')]){return _0x5c9229[_0xab41('0x30')](0x191)[_0xab41('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x479e67[_0xab41('0x49')]){if(_0x5837b9['blockDuration']>0x0){if(moment(_0x479e67[_0xab41('0x4a')])[_0xab41('0x4b')](_0x5837b9[_0xab41('0x44')],_0xab41('0x4c'))>moment()){return _0x5c9229[_0xab41('0x30')](0x191)[_0xab41('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5c9229['status'](0x191)[_0xab41('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x15622b[_0xab41('0x3b')]={'id':_0x479e67['id']};_0x774a82();});})[_0xab41('0x4d')](function(){return _0x5c9229['status'](0x191)['json']({'message':_0xab41('0x4e')});});}catch(_0x434ac3){_0x774a82(_0x434ac3);}}else if(_0x5c420a){_0x774a82();}else{return _0x5c9229['status'](0x193)[_0xab41('0x3a')]({'message':_0xab41('0x3c')});}})['use'](function(_0x4c00ca,_0xa4e52f,_0x26a032){if(_0x4c00ca[_0xab41('0x3b')]){db[_0xab41('0x3f')][_0xab41('0x38')]({'where':{'id':_0x4c00ca[_0xab41('0x3b')]['id']},'attributes':userAttributes})[_0xab41('0x2e')](function(_0x543c49){if(!_0x543c49){return _0xa4e52f[_0xab41('0x30')](0x194)[_0xab41('0x3a')]({'message':_0xab41('0x4f')});}_0x4c00ca[_0xab41('0x3b')]=_0x543c49;_0x26a032();})['catch'](function(_0x4ffb6e){_0x26a032(_0x4ffb6e);});}else if(_0x5c420a){_0x26a032();}else{return _0xa4e52f[_0xab41('0x30')](0x194)[_0xab41('0x3a')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xab41('0x34')](function(_0x49bdab,_0x1d4667,_0x19d2bb){return licenseUtil[_0xab41('0x50')]()[_0xab41('0x2e')](function(_0x2354fe){if(_0x2354fe[_0xab41('0x51')]){_0x19d2bb();}else{return _0x1d4667['status'](0x193)['json']({'message':_0xab41('0x52')});}})[_0xab41('0x4d')](function(_0x2d1972){_0x19d2bb(_0x2d1972);});});};exports[_0xab41('0x53')]=function(_0x473110,_0x5d5680,_0x1b8871){_0x473110[_0xab41('0x53')]=!![];return _0x1b8871();};exports[_0xab41('0x54')]=function signToken(_0x21983b){return signJwt(_0x21983b);};exports[_0xab41('0x55')]=function(_0x28445c,_0x5c9dc6){if(!_0x28445c[_0xab41('0x3b')]){return _0x5c9dc6[_0xab41('0x30')](0x194)[_0xab41('0x3a')]({'message':_0xab41('0x56')});}var _0x578ddb={'payload':{'id':_0x28445c[_0xab41('0x3b')]['id'],'role':_0x28445c[_0xab41('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x578ddb)['then'](function(_0x529fc0){_0x5c9dc6['cookie'](_0xab41('0x57'),_0x529fc0);_0x5c9dc6['redirect'](_0xab41('0x58'));})['catch'](function(_0x499e67){return _0x5c9dc6[_0xab41('0x30')](0x1f4)[_0xab41('0x59')](_0x499e67);});};exports[_0xab41('0x5a')]=function(_0x309ac2){if(_[_0xab41('0x5b')](_0x309ac2['apiKeyNonce'])||_['isNil'](_0x309ac2[_0xab41('0x5c')])){return null;}else{return createJwt(_0x309ac2);}};exports[_0xab41('0x5d')]=function(_0x4bfec7){_0x4bfec7['apiKeyNonce']=generateNonce();_0x4bfec7[_0xab41('0x5c')]=generateIssuedAt();return createJwt(_0x4bfec7);};exports['regenerateApiKey']=function(_0x270b7e,_0xef6b8a){var _0x2b0232=_0x270b7e[_0xab41('0x3e')][_0xab41('0x5e')];if(_0x2b0232){var _0xf2d133={'nonce':_0xef6b8a[_0xab41('0x45')],'iat':_0xef6b8a[_0xab41('0x5c')],'audience':hardwareConf[_0xab41('0x3d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2b0232,_0xf2d133)[_0xab41('0x2e')](function(){return generateApiKey(_0xef6b8a);});}else{throw{'message':_0xab41('0x5f')};}};exports[_0xab41('0x60')]=function(_0x4cec8f){var _0xb9db40=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xb9db40['test'](_0x4cec8f))throw new db[(_0xab41('0x61'))][(_0xab41('0x62'))](_0xab41('0x63'));return;};exports['validatePasswordHistory']=function(_0x15be3a,_0x55d58e,_0x4442e7){var _0x4dc517=encryptor[_0xab41('0x64')](_0x55d58e)[_0xab41('0x65')](',');for(var _0x1418e8=0x0;_0x1418e8<_0x4442e7;_0x1418e8++){if(!_0x4dc517[_0x1418e8])break;if(_0x15be3a[_0xab41('0x66')]()===_0x4dc517[_0x1418e8][_0xab41('0x66')]()){var _0x5a6824=util[_0xab41('0x67')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4442e7);if(_0x4442e7===0x1){_0x5a6824='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xab41('0x61'))]['ValidationError'](_0x5a6824);}}return;};exports[_0xab41('0x68')]=function(_0x35974c,_0xa00b0b){var _0x4992d1=_0xa00b0b?encryptor[_0xab41('0x64')](_0xa00b0b)['split'](','):[];if(_0x4992d1[_0xab41('0x69')]===0x5){_0x4992d1[_0xab41('0x6a')](-0x1,0x1);}_0x4992d1[_0xab41('0x6b')](_0x35974c);return encryptor[_0xab41('0x6c')](_0x4992d1[_0xab41('0x6d')](','));};function signJwt(_0x3df1a5){var _0xf5f509=BPromise[_0xab41('0x6e')](jwt['sign'],{'context':jwt});var _0x165326=_0x3df1a5[_0xab41('0x6f')]||config['secrets']['session'];return new BPromise(function(_0x96124e,_0x48a3c0){_0xf5f509(_0x3df1a5[_0xab41('0x70')],_0x165326,_0x3df1a5[_0xab41('0x71')])[_0xab41('0x2e')](function(_0x15b4f9){_0x96124e(_0x15b4f9);})[_0xab41('0x4d')](function(_0x59412b){_0x48a3c0(_0x59412b);});});}function verifyJwt(_0x23a9e5,_0x4ee576,_0x2ea64e){var _0x31f7ae=BPromise[_0xab41('0x6e')](jwt[_0xab41('0x72')],{'context':jwt});var _0x2a4b8c=_0x2ea64e||config[_0xab41('0xc')][_0xab41('0x73')];return new BPromise(function(_0x2ed21d,_0x5aa5dc){_0x31f7ae(_0x23a9e5,_0x2a4b8c,_0x4ee576)[_0xab41('0x2e')](function(_0x490118){_0x2ed21d(_0x490118);})[_0xab41('0x4d')](function(_0x5a711e){_0x5aa5dc(_0x5a711e);});});}function generateNonce(){return crypto[_0xab41('0x74')](0x10)[_0xab41('0x75')](_0xab41('0x76'));}function generateIssuedAt(){return Math[_0xab41('0x77')](Date['now']()/0x3e8)[_0xab41('0x75')]();}function createJwt(_0x59f0e7){var _0xa16662={'payload':{'iat':_0x59f0e7[_0xab41('0x5c')],'nonce':_0x59f0e7[_0xab41('0x45')]},'options':{'algorithm':_0xab41('0x78'),'subject':_0x59f0e7['id'][_0xab41('0x75')](),'issuer':hardwareConf[_0xab41('0x3d')](),'audience':hardwareConf[_0xab41('0x3d')]()}};return signJwt(_0xa16662)[_0xab41('0x2e')](function(_0x20a5e5){return{'iat':_0x59f0e7[_0xab41('0x5c')],'nonce':_0x59f0e7[_0xab41('0x45')],'token':_0x20a5e5};});} \ No newline at end of file +var _0x0e4b=['Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','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','split','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','decryptString','length','unshift','encryptString','join','promisify','options','randomBytes','hex','floor','toString','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','moment','secrets','session','fullname','name','email','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','then','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','blockDuration','minutes','Invalid\x20API\x20access\x20key','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update'];(function(_0x5435ae,_0x5d381b){var _0x49caf2=function(_0x437646){while(--_0x437646){_0x5435ae['push'](_0x5435ae['shift']());}};_0x49caf2(++_0x5d381b);}(_0x0e4b,0x120));var _0xb0e4=function(_0x3be128,_0x1eef7d){_0x3be128=_0x3be128-0x0;var _0x5e4369=_0x0e4b[_0x3be128];return _0x5e4369;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xb0e4('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xb0e4('0x1'));var encryptor=require(_0xb0e4('0x2'));var _=require(_0xb0e4('0x3'));var jwt=require(_0xb0e4('0x4'));var expressJwt=require(_0xb0e4('0x5'));var compose=require(_0xb0e4('0x6'));var basicAuth=require(_0xb0e4('0x7'));var crypto=require('crypto');var BPromise=require(_0xb0e4('0x8'));var util=require('util');var moment=require(_0xb0e4('0x9'));var validateJwt=expressJwt({'secret':config[_0xb0e4('0xa')][_0xb0e4('0xb')]});var userAttributes=['id','role',_0xb0e4('0xc'),_0xb0e4('0xd'),'internal',_0xb0e4('0xe'),'userpic',_0xb0e4('0xf'),_0xb0e4('0x10'),'voicePause',_0xb0e4('0x11'),_0xb0e4('0x12'),_0xb0e4('0x13'),_0xb0e4('0x14'),_0xb0e4('0x15'),'pauseType',_0xb0e4('0x16'),_0xb0e4('0x17'),_0xb0e4('0x18'),_0xb0e4('0x19'),'allowmessenger','passwordResetAt',_0xb0e4('0x1a'),'phoneBarAutoAnswer',_0xb0e4('0x1b'),_0xb0e4('0x1c'),_0xb0e4('0x1d'),_0xb0e4('0x1e'),'phoneBarEnableSettings',_0xb0e4('0x1f'),'phoneBarPrefixRequired',_0xb0e4('0x20'),_0xb0e4('0x21'),_0xb0e4('0x22'),_0xb0e4('0x23'),_0xb0e4('0x24'),_0xb0e4('0x25'),'settingsEnabled',_0xb0e4('0x26'),'downloadVoiceRecordings',_0xb0e4('0x27'),_0xb0e4('0x28'),_0xb0e4('0x29'),_0xb0e4('0x2a')];exports[_0xb0e4('0x2b')]=function(){return this[_0xb0e4('0x2c')](!![])[_0xb0e4('0x2d')](function(_0x24bdf8,_0x1feb9c,_0x4f8c11){if(_0x24bdf8[_0xb0e4('0x2e')]){_0x4f8c11();}else{return db['ChatInteraction'][_0xb0e4('0x2f')]({'where':{'id':_0x24bdf8[_0xb0e4('0x30')]['id']},'attributes':['id',_0xb0e4('0x31'),'disposition'],'raw':!![]})[_0xb0e4('0x32')](function(_0x52ac19){if(_0x52ac19&&_0x52ac19['closed']){return _0x1feb9c[_0xb0e4('0x33')](_0x52ac19['disposition']===_0xb0e4('0x34')?0x195:0x193)[_0xb0e4('0x35')]({'message':_0x52ac19[_0xb0e4('0x36')]==='unmanaged'?_0xb0e4('0x37'):_0xb0e4('0x38')});}else{_0x4f8c11();}})[_0xb0e4('0x39')](function(_0x3c2aec){_0x4f8c11(_0x3c2aec);});}});};exports[_0xb0e4('0x2c')]=function isAuthenticated(_0x50cf79){return compose()['use'](function(_0x19ca54,_0x2fd5c7,_0x9c0770){var _0x2f9e4a;if(_0x19ca54[_0xb0e4('0x3a')][_0xb0e4('0x3b')]){if(_[_0xb0e4('0x3c')](_0x19ca54[_0xb0e4('0x3a')]['authorization'],'Basic')){var _0x242324=basicAuth(_0x19ca54);db['User']['find']({'where':{'name':_0x242324[_0xb0e4('0xd')]}})[_0xb0e4('0x32')](function(_0x4af4c2){if(!_0x4af4c2||!_0x4af4c2[_0xb0e4('0x3d')](_0x242324[_0xb0e4('0x3e')])){return _0x2fd5c7[_0xb0e4('0x33')](0x191)[_0xb0e4('0x35')]({'message':_0xb0e4('0x3f')});}_0x19ca54[_0xb0e4('0x2e')]={'id':_0x4af4c2['id']};_0x9c0770();})[_0xb0e4('0x39')](function(_0x304735){_0x9c0770(_0x304735);});}else if(_[_0xb0e4('0x3c')](_0x19ca54[_0xb0e4('0x3a')][_0xb0e4('0x3b')],_0xb0e4('0x40'))){validateJwt(_0x19ca54,_0x2fd5c7,_0x9c0770);}else{if(_0x50cf79){_0x9c0770();}else{return _0x2fd5c7[_0xb0e4('0x33')](0x193)[_0xb0e4('0x35')]({'message':_0xb0e4('0x41')});}}}else if(_0x19ca54[_0xb0e4('0x42')][_0xb0e4('0x43')]){try{var _0x13b323={'audience':hardwareConf[_0xb0e4('0x44')](),'issuer':hardwareConf[_0xb0e4('0x44')]()};verifyJwt(_0x19ca54[_0xb0e4('0x42')]['apikey'],_0x13b323)['then'](function(_0x19838e){return db[_0xb0e4('0x45')]['find']({'where':{'id':_0x19838e['sub']}})[_0xb0e4('0x32')](function(_0x3ecf32){_0x2f9e4a=_0x3ecf32;return db[_0xb0e4('0x46')][_0xb0e4('0x2f')]({'where':{'id':0x1},'attributes':[_0xb0e4('0x47'),'blockDuration'],'raw':!![]});})['then'](function(_0x53b6c7){if(!_0x2f9e4a||!_['isEqual'](_0x2f9e4a[_0xb0e4('0x48')],_0x19838e[_0xb0e4('0x49')])){return _0x2fd5c7[_0xb0e4('0x33')](0x191)['json']({'message':_0xb0e4('0x4a')});}if(_0x2f9e4a[_0xb0e4('0x4b')]){return _0x2fd5c7['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x2f9e4a[_0xb0e4('0x4c')]){if(_0x53b6c7['blockDuration']>0x0){if(moment(_0x2f9e4a[_0xb0e4('0x4d')])['add'](_0x53b6c7[_0xb0e4('0x4e')],_0xb0e4('0x4f'))>moment()){return _0x2fd5c7[_0xb0e4('0x33')](0x191)[_0xb0e4('0x35')]({'message':_0xb0e4('0x50')});}}else{return _0x2fd5c7[_0xb0e4('0x33')](0x191)[_0xb0e4('0x35')]({'message':_0xb0e4('0x50')});}}_0x19ca54[_0xb0e4('0x2e')]={'id':_0x2f9e4a['id']};_0x9c0770();});})['catch'](function(){return _0x2fd5c7[_0xb0e4('0x33')](0x191)['json']({'message':_0xb0e4('0x50')});});}catch(_0x202169){_0x9c0770(_0x202169);}}else if(_0x50cf79){_0x9c0770();}else{return _0x2fd5c7[_0xb0e4('0x33')](0x193)[_0xb0e4('0x35')]({'message':_0xb0e4('0x41')});}})[_0xb0e4('0x2d')](function(_0x5e5489,_0x7f2409,_0x4307c5){if(_0x5e5489[_0xb0e4('0x2e')]){db[_0xb0e4('0x45')][_0xb0e4('0x51')]({'where':{'id':_0x5e5489['user']['id']},'attributes':userAttributes})[_0xb0e4('0x32')](function(_0x3e0284){if(!_0x3e0284){return _0x7f2409['status'](0x194)['json']({'message':_0xb0e4('0x52')});}_0x5e5489[_0xb0e4('0x2e')]=_0x3e0284;_0x4307c5();})[_0xb0e4('0x39')](function(_0x5f0b06){_0x4307c5(_0x5f0b06);});}else if(_0x50cf79){_0x4307c5();}else{return _0x7f2409[_0xb0e4('0x33')](0x194)[_0xb0e4('0x35')]({'message':_0xb0e4('0x53')});}});};exports[_0xb0e4('0x54')]=function canUpdate(){return compose()[_0xb0e4('0x2d')](function(_0x33252d,_0x79faa6,_0x5dac5d){return licenseUtil[_0xb0e4('0x55')]()['then'](function(_0x4552dd){if(_0x4552dd[_0xb0e4('0x56')]){_0x5dac5d();}else{return _0x79faa6[_0xb0e4('0x33')](0x193)[_0xb0e4('0x35')]({'message':_0xb0e4('0x57')});}})[_0xb0e4('0x39')](function(_0x30f854){_0x5dac5d(_0x30f854);});});};exports[_0xb0e4('0x58')]=function(_0x14ca6d,_0x55432d,_0xbcf4db){_0x14ca6d['isMiddleware']=!![];return _0xbcf4db();};exports[_0xb0e4('0x59')]=function signToken(_0x432573){return signJwt(_0x432573);};exports['setTokenCookie']=function(_0x15841c,_0x5f1f36){if(!_0x15841c[_0xb0e4('0x2e')]){return _0x5f1f36['status'](0x194)[_0xb0e4('0x35')]({'message':_0xb0e4('0x5a')});}var _0x19238d={'payload':{'id':_0x15841c[_0xb0e4('0x2e')]['id'],'role':_0x15841c[_0xb0e4('0x2e')][_0xb0e4('0x5b')]},'options':{'expiresIn':0x15180}};return signJwt(_0x19238d)['then'](function(_0x254dd2){_0x5f1f36[_0xb0e4('0x5c')](_0xb0e4('0x5d'),_0x254dd2);_0x5f1f36[_0xb0e4('0x5e')](_0xb0e4('0x5f'));})[_0xb0e4('0x39')](function(_0x1e0d65){return _0x5f1f36[_0xb0e4('0x33')](0x1f4)[_0xb0e4('0x60')](_0x1e0d65);});};exports[_0xb0e4('0x61')]=function(_0x5437ed){if(_[_0xb0e4('0x62')](_0x5437ed[_0xb0e4('0x48')])||_['isNil'](_0x5437ed[_0xb0e4('0x63')])){return null;}else{return createJwt(_0x5437ed);}};exports[_0xb0e4('0x64')]=function(_0xe1da9c){_0xe1da9c['apiKeyNonce']=generateNonce();_0xe1da9c[_0xb0e4('0x63')]=generateIssuedAt();return createJwt(_0xe1da9c);};exports['regenerateApiKey']=function(_0x2374db,_0x464488){var _0x404ae1=_0x2374db['query'][_0xb0e4('0x43')];if(_0x404ae1){var _0x1b6bc9={'nonce':_0x464488['apiKeyNonce'],'iat':_0x464488[_0xb0e4('0x63')],'audience':hardwareConf[_0xb0e4('0x44')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x404ae1,_0x1b6bc9)[_0xb0e4('0x32')](function(){return generateApiKey(_0x464488);});}else{throw{'message':_0xb0e4('0x65')};}};exports[_0xb0e4('0x66')]=function(_0x12061e){var _0x2430fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2430fb[_0xb0e4('0x67')](_0x12061e))throw new db[(_0xb0e4('0x68'))][(_0xb0e4('0x69'))](_0xb0e4('0x6a'));return;};exports[_0xb0e4('0x6b')]=function(_0x7f2eab,_0x2353a1,_0x15244e){var _0x26333d=encryptor['decryptString'](_0x2353a1)[_0xb0e4('0x6c')](',');for(var _0x499464=0x0;_0x499464<_0x15244e;_0x499464++){if(!_0x26333d[_0x499464])break;if(_0x7f2eab[_0xb0e4('0x6d')]()===_0x26333d[_0x499464][_0xb0e4('0x6d')]()){var _0x557eed=util[_0xb0e4('0x6e')](_0xb0e4('0x6f'),_0x15244e);if(_0x15244e===0x1){_0x557eed=_0xb0e4('0x70');}throw new db['Sequelize'][(_0xb0e4('0x69'))](_0x557eed);}}return;};exports[_0xb0e4('0x71')]=function(_0x3d79f5,_0x3af7ee){var _0x470075=_0x3af7ee?encryptor[_0xb0e4('0x72')](_0x3af7ee)[_0xb0e4('0x6c')](','):[];if(_0x470075[_0xb0e4('0x73')]===0x5){_0x470075['splice'](-0x1,0x1);}_0x470075[_0xb0e4('0x74')](_0x3d79f5);return encryptor[_0xb0e4('0x75')](_0x470075[_0xb0e4('0x76')](','));};function signJwt(_0x22dec4){var _0x4dfb2c=BPromise[_0xb0e4('0x77')](jwt['sign'],{'context':jwt});var _0x4c288d=_0x22dec4['secret']||config[_0xb0e4('0xa')][_0xb0e4('0xb')];return new BPromise(function(_0x23d691,_0x1c2d6f){_0x4dfb2c(_0x22dec4['payload'],_0x4c288d,_0x22dec4[_0xb0e4('0x78')])['then'](function(_0x4a1e00){_0x23d691(_0x4a1e00);})[_0xb0e4('0x39')](function(_0x4ab6bd){_0x1c2d6f(_0x4ab6bd);});});}function verifyJwt(_0x55109e,_0x66c54a,_0x3367bb){var _0x3a02a2=BPromise[_0xb0e4('0x77')](jwt['verify'],{'context':jwt});var _0x375974=_0x3367bb||config[_0xb0e4('0xa')][_0xb0e4('0xb')];return new BPromise(function(_0x50ec2d,_0x3a1c89){_0x3a02a2(_0x55109e,_0x375974,_0x66c54a)[_0xb0e4('0x32')](function(_0x293c3d){_0x50ec2d(_0x293c3d);})[_0xb0e4('0x39')](function(_0x10ddd4){_0x3a1c89(_0x10ddd4);});});}function generateNonce(){return crypto[_0xb0e4('0x79')](0x10)['toString'](_0xb0e4('0x7a'));}function generateIssuedAt(){return Math[_0xb0e4('0x7b')](Date['now']()/0x3e8)[_0xb0e4('0x7c')]();}function createJwt(_0x3850bb){var _0x12213f={'payload':{'iat':_0x3850bb['apiKeyIat'],'nonce':_0x3850bb[_0xb0e4('0x48')]},'options':{'algorithm':'HS512','subject':_0x3850bb['id'][_0xb0e4('0x7c')](),'issuer':hardwareConf[_0xb0e4('0x44')](),'audience':hardwareConf[_0xb0e4('0x44')]()}};return signJwt(_0x12213f)[_0xb0e4('0x32')](function(_0x330c3c){return{'iat':_0x3850bb[_0xb0e4('0x63')],'nonce':_0x3850bb[_0xb0e4('0x48')],'token':_0x330c3c};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index f3ec23d..1458ef9 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 _0x94ee=['close','unlink','decryptFile','createDecipher','secret','createCipher','utf8','base64','decryptString','../../config/environment','app','secrets','session','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final'];(function(_0x2ced25,_0x3ae658){var _0x3736bd=function(_0x32e224){while(--_0x32e224){_0x2ced25['push'](_0x2ced25['shift']());}};_0x3736bd(++_0x3ae658);}(_0x94ee,0x15e));var _0xe94e=function(_0x4a8a51,_0x16618c){_0x4a8a51=_0x4a8a51-0x0;var _0x105833=_0x94ee[_0x4a8a51];return _0x105833;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xe94e('0x0'));var logger=require('../../config/logger')(_0xe94e('0x1'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe94e('0x2')][_0xe94e('0x3')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xe94e('0x4')]&&config[_0xe94e('0x4')][_0xe94e('0x5')]){var isSupported=isAlgorithmSupported(config[_0xe94e('0x4')]['algorithm']);if(isSupported){fileOptions[_0xe94e('0x5')]=config['encrypt'][_0xe94e('0x5')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe94e('0x6')](',\x20');logger[_0xe94e('0x7')](config['encrypt']['algorithm'],_0xe94e('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x2a981d){return AES_SUPPORTED_RX['test'](_0x2a981d);}function getSupportedCiphers(){return crypto[_0xe94e('0x9')]()[_0xe94e('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x483587){return getSupportedCiphers()[_0xe94e('0xb')](_0x483587)>-0x1;}function combineOptions(_0x4548d9){var _0x4d15ee={};for(var _0x2c5f10 in fileOptions){if(fileOptions[_0xe94e('0xc')](_0x2c5f10)){_0x4d15ee[_0x2c5f10]=fileOptions[_0x2c5f10];}}if(_0x4548d9){for(var _0x4bdb37 in _0x4548d9){if(_0x4548d9['hasOwnProperty'](_0x4bdb37)){_0x4d15ee[_0x4bdb37]=_0x4548d9[_0x4bdb37];}}}return _0x4d15ee;}exports[_0xe94e('0xd')]=function(_0x31175f,_0x327e37,_0x483c52,_0x2d0d7b){return new BPromise(function(_0x1429c7,_0xa43ca8){_0x2d0d7b=combineOptions(_0x2d0d7b);var _0x1db5d7=new Buffer(_0x483c52);var _0x4243a5=fs[_0xe94e('0xe')](_0x31175f);var _0x4158bc=fs[_0xe94e('0xf')](_0x327e37);var _0x4bf059=crypto['createCipher'](_0x2d0d7b[_0xe94e('0x5')],_0x1db5d7);_0x4243a5['on'](_0xe94e('0x10'),function(_0x405a38){var _0x5a4a9a=new Buffer(_0x4bf059[_0xe94e('0x11')](_0x405a38),_0xe94e('0x12'));_0x4158bc[_0xe94e('0x13')](_0x5a4a9a);});_0x4243a5['on'](_0xe94e('0x14'),function(){try{var _0x552fdb=new Buffer(_0x4bf059[_0xe94e('0x15')](_0xe94e('0x12')),_0xe94e('0x12'));_0x4158bc[_0xe94e('0x13')](_0x552fdb);_0x4158bc[_0xe94e('0x14')]();_0x4158bc['on'](_0xe94e('0x16'),function(){return _0x1429c7(_0x327e37);});}catch(_0x153d73){fs[_0xe94e('0x17')](_0x327e37);return _0xa43ca8(_0x153d73);}});});};exports[_0xe94e('0x18')]=function(_0x55a06e,_0x573151,_0x11a251,_0x342680){return new BPromise(function(_0x3bd720,_0x5280a6){_0x342680=combineOptions(_0x342680);var _0x1d8612=new Buffer(_0x11a251);var _0x3c20dd=fs[_0xe94e('0xe')](_0x55a06e);var _0x16daad=fs[_0xe94e('0xf')](_0x573151);var _0x30b2cc=crypto[_0xe94e('0x19')](_0x342680['algorithm'],_0x1d8612);_0x3c20dd['on'](_0xe94e('0x10'),function(_0xa9e536){var _0x5acea3=new Buffer(_0x30b2cc[_0xe94e('0x11')](_0xa9e536),'binary');_0x16daad['write'](_0x5acea3);});_0x3c20dd['on']('end',function(){try{var _0x57dd94=new Buffer(_0x30b2cc[_0xe94e('0x15')](_0xe94e('0x12')),_0xe94e('0x12'));_0x16daad[_0xe94e('0x13')](_0x57dd94);_0x16daad[_0xe94e('0x14')]();_0x16daad['on'](_0xe94e('0x16'),function(){return _0x3bd720(_0x573151);});}catch(_0x240090){fs[_0xe94e('0x17')](_0x573151);return _0x5280a6(_0x240090);}});});};exports['encryptString']=function(_0xaa223f,_0x53cbbb,_0x30feb6){var _0x336ae1=_0x30feb6||stringOptions[_0xe94e('0x5')];var _0x83f783=_0x53cbbb||stringOptions[_0xe94e('0x1a')];var _0x5483aa=crypto[_0xe94e('0x1b')](_0x336ae1,_0x83f783);var _0xc65376=_0x5483aa[_0xe94e('0x11')](_0xaa223f,_0xe94e('0x1c'),'base64');_0xc65376+=_0x5483aa[_0xe94e('0x15')](_0xe94e('0x1d'));return _0xc65376;};exports[_0xe94e('0x1e')]=function(_0x5f200d,_0x5a9d9c,_0x3324dd){var _0x4326ad=_0x3324dd||stringOptions['algorithm'];var _0x1951c7=_0x5a9d9c||stringOptions[_0xe94e('0x1a')];var _0x974328=crypto['createDecipher'](_0x4326ad,_0x1951c7);var _0x9050bf=_0x974328[_0xe94e('0x11')](_0x5f200d,_0xe94e('0x1d'),'utf8');_0x9050bf+=_0x974328[_0xe94e('0x15')]('utf8');return _0x9050bf;}; \ No newline at end of file +var _0x62f2=['secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','write','end','binary','close','unlink','decryptFile','createDecipher','final','encryptString'];(function(_0x34e5a1,_0x2b9ea4){var _0xb98a87=function(_0x452159){while(--_0x452159){_0x34e5a1['push'](_0x34e5a1['shift']());}};_0xb98a87(++_0x2b9ea4);}(_0x62f2,0x6e));var _0x262f=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x62f2[_0x2b4411];return _0x8e41ef;};'use strict';var crypto=require(_0x262f('0x0'));var fs=require('fs');var BPromise=require(_0x262f('0x1'));var _=require(_0x262f('0x2'));var config=require(_0x262f('0x3'));var logger=require('../../config/logger')(_0x262f('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x262f('0x5')][_0x262f('0x6')],'algorithm':_0x262f('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x262f('0x8')]&&config['encrypt'][_0x262f('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x262f('0x9')]);if(isSupported){fileOptions[_0x262f('0x9')]=config[_0x262f('0x8')][_0x262f('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x262f('0xa')](',\x20');logger['error'](config[_0x262f('0x8')][_0x262f('0x9')],_0x262f('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x3ec683){return AES_SUPPORTED_RX[_0x262f('0xc')](_0x3ec683);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x262f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x132b91){return getSupportedCiphers()[_0x262f('0xe')](_0x132b91)>-0x1;}function combineOptions(_0x581586){var _0xa98ecb={};for(var _0x1568d0 in fileOptions){if(fileOptions['hasOwnProperty'](_0x1568d0)){_0xa98ecb[_0x1568d0]=fileOptions[_0x1568d0];}}if(_0x581586){for(var _0x5caf87 in _0x581586){if(_0x581586[_0x262f('0xf')](_0x5caf87)){_0xa98ecb[_0x5caf87]=_0x581586[_0x5caf87];}}}return _0xa98ecb;}exports[_0x262f('0x10')]=function(_0x1bf78d,_0x41dd07,_0x29b599,_0x2e3da6){return new BPromise(function(_0x40acfb,_0x24af75){_0x2e3da6=combineOptions(_0x2e3da6);var _0x297058=new Buffer(_0x29b599);var _0x1c6ad0=fs[_0x262f('0x11')](_0x1bf78d);var _0xe6076f=fs[_0x262f('0x12')](_0x41dd07);var _0x1d140f=crypto['createCipher'](_0x2e3da6[_0x262f('0x9')],_0x297058);_0x1c6ad0['on'](_0x262f('0x13'),function(_0x5b2a66){var _0x2dc5ee=new Buffer(_0x1d140f[_0x262f('0x14')](_0x5b2a66),'binary');_0xe6076f[_0x262f('0x15')](_0x2dc5ee);});_0x1c6ad0['on'](_0x262f('0x16'),function(){try{var _0x40071d=new Buffer(_0x1d140f['final'](_0x262f('0x17')),_0x262f('0x17'));_0xe6076f[_0x262f('0x15')](_0x40071d);_0xe6076f[_0x262f('0x16')]();_0xe6076f['on'](_0x262f('0x18'),function(){return _0x40acfb(_0x41dd07);});}catch(_0x7d08cd){fs[_0x262f('0x19')](_0x41dd07);return _0x24af75(_0x7d08cd);}});});};exports[_0x262f('0x1a')]=function(_0x1555b5,_0x22c11d,_0x39d569,_0xd936bf){return new BPromise(function(_0x3ca844,_0x14b2f2){_0xd936bf=combineOptions(_0xd936bf);var _0x387c9d=new Buffer(_0x39d569);var _0x21ed24=fs[_0x262f('0x11')](_0x1555b5);var _0x50d859=fs[_0x262f('0x12')](_0x22c11d);var _0x5eb8cc=crypto[_0x262f('0x1b')](_0xd936bf[_0x262f('0x9')],_0x387c9d);_0x21ed24['on'](_0x262f('0x13'),function(_0x3afc26){var _0x249421=new Buffer(_0x5eb8cc[_0x262f('0x14')](_0x3afc26),_0x262f('0x17'));_0x50d859['write'](_0x249421);});_0x21ed24['on']('end',function(){try{var _0x40170b=new Buffer(_0x5eb8cc[_0x262f('0x1c')](_0x262f('0x17')),_0x262f('0x17'));_0x50d859['write'](_0x40170b);_0x50d859[_0x262f('0x16')]();_0x50d859['on'](_0x262f('0x18'),function(){return _0x3ca844(_0x22c11d);});}catch(_0x2ab83f){fs[_0x262f('0x19')](_0x22c11d);return _0x14b2f2(_0x2ab83f);}});});};exports[_0x262f('0x1d')]=function(_0x5d080a,_0x57f862,_0x499cce){var _0x13fb5c=_0x499cce||stringOptions[_0x262f('0x9')];var _0x56f1bc=_0x57f862||stringOptions[_0x262f('0x1e')];var _0xea8c88=crypto[_0x262f('0x1f')](_0x13fb5c,_0x56f1bc);var _0x2da98c=_0xea8c88[_0x262f('0x14')](_0x5d080a,_0x262f('0x20'),_0x262f('0x21'));_0x2da98c+=_0xea8c88[_0x262f('0x1c')]('base64');return _0x2da98c;};exports[_0x262f('0x22')]=function(_0x9c766d,_0xfdd3d2,_0x3b3ce8){var _0x5ef525=_0x3b3ce8||stringOptions[_0x262f('0x9')];var _0x1259ef=_0xfdd3d2||stringOptions[_0x262f('0x1e')];var _0x4766b5=crypto[_0x262f('0x1b')](_0x5ef525,_0x1259ef);var _0x27ed5e=_0x4766b5[_0x262f('0x14')](_0x9c766d,_0x262f('0x21'),_0x262f('0x20'));_0x27ed5e+=_0x4766b5[_0x262f('0x1c')]('utf8');return _0x27ed5e;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 594f036..9e3a891 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 _0xd204=['splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','Empty','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','mkdirSync','each','join','csv','%s.%s','writeFileSync','zip','info','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','Failed','exit','util','path','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split'];(function(_0x1326db,_0x37c2a3){var _0x501368=function(_0x59ad77){while(--_0x59ad77){_0x1326db['push'](_0x1326db['shift']());}};_0x501368(++_0x37c2a3);}(_0xd204,0x1d8));var _0x4d20=function(_0x82a3e7,_0x598150){_0x82a3e7=_0x82a3e7-0x0;var _0x14ea97=_0xd204[_0x82a3e7];return _0x14ea97;};'use strict';var util=require(_0x4d20('0x0'));var path=require(_0x4d20('0x1'));var _=require('lodash');var csv=require(_0x4d20('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x4d20('0x3'));var rimraf=require(_0x4d20('0x4'));var db=require(_0x4d20('0x5'))['db'];var dbH=require(_0x4d20('0x5'))['dbH'];var logger=require(_0x4d20('0x6'))(_0x4d20('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x4d20('0x8')][0x2]);var QUERY=process[_0x4d20('0x8')][0x3];var PATH=process[_0x4d20('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x35ba02,_0x31d15b){var _0x5535b1={'status':_0x35ba02};var _0x2e5c24={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x31d15b){_0x5535b1[_0x4d20('0x9')]=_0x31d15b;}return db[_0x4d20('0xa')][_0x4d20('0xb')](_0x5535b1,_0x2e5c24);}function main(){var _0x599390=0x1388;var _0x2bcb69;logger['info'](util[_0x4d20('0xc')](_0x4d20('0xd'),EXTRACTED_REPORT_ID,_0x4d20('0xe')));return db[_0x4d20('0xf')][_0x4d20('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4d20('0x11'),'splitSizeCsv']})['then'](function(_0x163b89){if(_0x163b89){_0x2bcb69=_0x163b89;_0x599390=_0x2bcb69[_0x4d20('0x12')]||0x1388;}})['then'](function(){return dbH[_0x4d20('0x13')][_0x4d20('0x14')](util[_0x4d20('0xc')](_0x4d20('0x15'),QUERY),{'type':dbH[_0x4d20('0x13')][_0x4d20('0x16')][_0x4d20('0x17')]});})[_0x4d20('0x18')](function(_0x5e3c79){if(!_0x5e3c79[0x0]['num']){return analyticExtractedReport(_0x4d20('0x19'));}var _0x37459d=[];var _0x2dbae8=0x0;if(_0x2bcb69[_0x4d20('0x11')]){if(_0x5e3c79&&_0x5e3c79[_0x4d20('0x1a')]){var _0x25160c=_[_0x4d20('0x1b')](_0x5e3c79[0x0]['num']/_0x599390);var _0x4ef967=Number['isInteger'](_0x5e3c79[0x0][_0x4d20('0x1c')]/_0x599390)?_0x5e3c79[0x0][_0x4d20('0x1c')]%_0x599390:0x0;_0x25160c[_0x4d20('0x1d')](function(_0x1ab51a){if(_0x1ab51a>0x0){_0x2dbae8+=_0x599390;}_0x37459d[_0x4d20('0x1e')](dbH['sequelize'][_0x4d20('0x14')](util[_0x4d20('0xc')](_0x4d20('0x1f'),QUERY,_0x599390,_0x2dbae8),{'type':dbH['sequelize'][_0x4d20('0x16')][_0x4d20('0x17')]}));});if(_0x4ef967>0x0){_0x2dbae8+=_0x599390;_0x37459d[_0x4d20('0x1e')](dbH['sequelize'][_0x4d20('0x14')](util[_0x4d20('0xc')](_0x4d20('0x1f'),QUERY,_0x4ef967,_0x2dbae8),{'type':dbH[_0x4d20('0x13')][_0x4d20('0x16')]['SELECT']}));}}}else{_0x37459d[_0x4d20('0x1e')](dbH[_0x4d20('0x13')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4d20('0x17')]}));}var _0x4e5209=path[_0x4d20('0x20')](PATH);var _0x298dc4=path[_0x4d20('0x21')](PATH,'.csv');var _0x269a48=_0x2bcb69['split']&&_0x37459d[_0x4d20('0x1a')]>0x1;var _0x5e07a6=[];if(!fs[_0x4d20('0x22')](path['join'](_0x4e5209,_0x298dc4))&&_0x269a48){fs[_0x4d20('0x23')](path['join'](_0x4e5209,_0x298dc4));}return BPromise[_0x4d20('0x24')](_0x37459d,function(_0x26ea79){_0x5e07a6[_0x4d20('0x1e')](_0x26ea79);})[_0x4d20('0x18')](function(){for(var _0x5b8540=0x0;_0x5b8540<_0x5e07a6[_0x4d20('0x1a')];_0x5b8540+=0x1){var _0xafead0;var _0x2b6cf6=_0x5e07a6[_0x5b8540];if(_0x269a48){_0xafead0=path[_0x4d20('0x25')](_0x4e5209,_0x298dc4,util[_0x4d20('0xc')]('%s%d.%s',_0x298dc4,_0x5b8540,_0x4d20('0x26')));}else{_0xafead0=path[_0x4d20('0x25')](_0x4e5209,util[_0x4d20('0xc')](_0x4d20('0x27'),_0x298dc4,_0x4d20('0x26')));}fs[_0x4d20('0x28')](_0xafead0,csv(_0x2b6cf6));}})[_0x4d20('0x18')](function(){if(_0x269a48){return new Promise(function(_0x1061ee){zipdir(path[_0x4d20('0x25')](_0x4e5209,_0x298dc4),{'saveTo':path['join'](_0x4e5209,util[_0x4d20('0xc')](_0x4d20('0x27'),_0x298dc4,_0x4d20('0x29')))},function(_0x1d0ca0,_0x4fc266){rimraf(path[_0x4d20('0x25')](_0x4e5209,_0x298dc4),function(){});_0x1061ee('zip\x20finished');});});}})['then'](function(){logger[_0x4d20('0x2a')](util[_0x4d20('0xc')](_0x4d20('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x4d20('0x2c'),_0x269a48?util['format'](_0x4d20('0x27'),_0x298dc4,_0x269a48?_0x4d20('0x29'):_0x4d20('0x26')):null);});})[_0x4d20('0x2d')](function(_0x214f5d){logger[_0x4d20('0x2a')](util['format'](_0x4d20('0x2e'),EXTRACTED_REPORT_ID,_0x4d20('0xe')),util['inspect'](_0x214f5d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4d20('0x2f'));})['finally'](function(){process[_0x4d20('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x300b=['inspect','Failed','finally','util','path','to-csv','bluebird','rimraf','dbH','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','push','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','join','each','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x6f8934,_0x48c88f){var _0x21af99=function(_0x4c62ff){while(--_0x4c62ff){_0x6f8934['push'](_0x6f8934['shift']());}};_0x21af99(++_0x48c88f);}(_0x300b,0xee));var _0xb300=function(_0x25d8e5,_0x4b446e){_0x25d8e5=_0x25d8e5-0x0;var _0x429a85=_0x300b[_0x25d8e5];return _0x429a85;};'use strict';var util=require(_0xb300('0x0'));var path=require(_0xb300('0x1'));var _=require('lodash');var csv=require(_0xb300('0x2'));var fs=require('fs');var BPromise=require(_0xb300('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb300('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xb300('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb300('0x6')][0x2]);var QUERY=process[_0xb300('0x6')][0x3];var PATH=process[_0xb300('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2063d1,_0x168a32){var _0x1ee253={'status':_0x2063d1};var _0x133b56={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x168a32){_0x1ee253[_0xb300('0x7')]=_0x168a32;}return db[_0xb300('0x8')]['update'](_0x1ee253,_0x133b56);}function main(){var _0x451e6d=0x1388;var _0x958ba;logger[_0xb300('0x9')](util['format'](_0xb300('0xa'),EXTRACTED_REPORT_ID,_0xb300('0xb')));return db[_0xb300('0xc')][_0xb300('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb300('0xe'),_0xb300('0xf')]})[_0xb300('0x10')](function(_0x5565dc){if(_0x5565dc){_0x958ba=_0x5565dc;_0x451e6d=_0x958ba['splitSizeCsv']||0x1388;}})[_0xb300('0x10')](function(){return dbH[_0xb300('0x11')][_0xb300('0x12')](util[_0xb300('0x13')](_0xb300('0x14'),QUERY),{'type':dbH[_0xb300('0x11')]['QueryTypes']['SELECT']});})[_0xb300('0x10')](function(_0x4e29be){if(!_0x4e29be[0x0][_0xb300('0x15')]){return analyticExtractedReport(_0xb300('0x16'));}var _0x37e01d=[];var _0x4d65e1=0x0;if(_0x958ba[_0xb300('0xe')]){if(_0x4e29be&&_0x4e29be[_0xb300('0x17')]){var _0x566c26=_[_0xb300('0x18')](_0x4e29be[0x0][_0xb300('0x15')]/_0x451e6d);var _0x3e0052=Number[_0xb300('0x19')](_0x4e29be[0x0][_0xb300('0x15')]/_0x451e6d)?_0x4e29be[0x0][_0xb300('0x15')]%_0x451e6d:0x0;_0x566c26['forEach'](function(_0x44b5d6){if(_0x44b5d6>0x0){_0x4d65e1+=_0x451e6d;}_0x37e01d[_0xb300('0x1a')](dbH['sequelize'][_0xb300('0x12')](util[_0xb300('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x451e6d,_0x4d65e1),{'type':dbH['sequelize'][_0xb300('0x1b')][_0xb300('0x1c')]}));});if(_0x3e0052>0x0){_0x4d65e1+=_0x451e6d;_0x37e01d[_0xb300('0x1a')](dbH['sequelize']['query'](util[_0xb300('0x13')](_0xb300('0x1d'),QUERY,_0x3e0052,_0x4d65e1),{'type':dbH[_0xb300('0x11')][_0xb300('0x1b')][_0xb300('0x1c')]}));}}}else{_0x37e01d[_0xb300('0x1a')](dbH[_0xb300('0x11')][_0xb300('0x12')](QUERY,{'type':dbH[_0xb300('0x11')][_0xb300('0x1b')][_0xb300('0x1c')]}));}var _0x1d6fb6=path[_0xb300('0x1e')](PATH);var _0x3954ff=path[_0xb300('0x1f')](PATH,_0xb300('0x20'));var _0x561759=_0x958ba[_0xb300('0xe')]&&_0x37e01d[_0xb300('0x17')]>0x1;var _0xfb0b80=[];if(!fs['existsSync'](path[_0xb300('0x21')](_0x1d6fb6,_0x3954ff))&&_0x561759){fs['mkdirSync'](path[_0xb300('0x21')](_0x1d6fb6,_0x3954ff));}return BPromise[_0xb300('0x22')](_0x37e01d,function(_0x20b441){_0xfb0b80[_0xb300('0x1a')](_0x20b441);})[_0xb300('0x10')](function(){for(var _0x3ecfc8=0x0;_0x3ecfc8<_0xfb0b80['length'];_0x3ecfc8+=0x1){var _0xb18dd;var _0x55f1ab=_0xfb0b80[_0x3ecfc8];if(_0x561759){_0xb18dd=path[_0xb300('0x21')](_0x1d6fb6,_0x3954ff,util[_0xb300('0x13')]('%s%d.%s',_0x3954ff,_0x3ecfc8,_0xb300('0x23')));}else{_0xb18dd=path[_0xb300('0x21')](_0x1d6fb6,util[_0xb300('0x13')](_0xb300('0x24'),_0x3954ff,'csv'));}fs[_0xb300('0x25')](_0xb18dd,csv(_0x55f1ab));}})[_0xb300('0x10')](function(){if(_0x561759){return new Promise(function(_0x57783f){zipdir(path[_0xb300('0x21')](_0x1d6fb6,_0x3954ff),{'saveTo':path['join'](_0x1d6fb6,util['format'](_0xb300('0x24'),_0x3954ff,'zip'))},function(_0x220365,_0x54eae8){rimraf(path[_0xb300('0x21')](_0x1d6fb6,_0x3954ff),function(){});_0x57783f(_0xb300('0x26'));});});}})[_0xb300('0x10')](function(){logger['info'](util[_0xb300('0x13')](_0xb300('0x27'),EXTRACTED_REPORT_ID,_0xb300('0xb')));return analyticExtractedReport(_0xb300('0x28'),_0x561759?util[_0xb300('0x13')](_0xb300('0x24'),_0x3954ff,_0x561759?_0xb300('0x29'):_0xb300('0x23')):null);});})[_0xb300('0x2a')](function(_0x5cccf7){logger[_0xb300('0x9')](util[_0xb300('0x13')](_0xb300('0x2b'),EXTRACTED_REPORT_ID,_0xb300('0xb')),util[_0xb300('0x2c')](_0x5cccf7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb300('0x2d'));})[_0xb300('0x2e')](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 0443023..e3bcbe7 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 _0xa2bc=['format','endDate','push','header','pageBreak','before','landscape','toString','\x20/\x20','footer','black','num','Empty','Setting','then','splitSizePdf','split','range','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','fill','length','auto','body','concat','chunk','keys'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xa2bc,0x142));var _0xca2b=function(_0x133b41,_0x5aa7a6){_0x133b41=_0x133b41-0x0;var _0x236eb0=_0xa2bc[_0x133b41];return _0x236eb0;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xca2b('0x0'));var path=require(_0xca2b('0x1'));var moment=require(_0xca2b('0x2'));var htmlToPdfmake=require(_0xca2b('0x3'));var PdfPrinter=require(_0xca2b('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xca2b('0x5'));var JSDOM=require(_0xca2b('0x6'))[_0xca2b('0x7')];var window=new JSDOM('')[_0xca2b('0x8')];var BPromise=require(_0xca2b('0x9'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xca2b('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xca2b('0xb')][0x2]);var QUERY=process[_0xca2b('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xca2b('0xb')][0x5];var FORMAT=_0xca2b('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xb57c04,_0x1fe90d){var _0x25f9c4={'status':_0xb57c04};var _0x54b61f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fe90d){_0x25f9c4[_0xca2b('0xd')]=_0x1fe90d;}return db[_0xca2b('0xe')][_0xca2b('0xf')](_0x25f9c4,_0x54b61f);}function getHeaders(_0x197104){return _[_0xca2b('0x10')](_0x197104,function(_0x588b4c){return{'text':_0x588b4c,'style':_0xca2b('0x11')};});}function getRows(_0x599f15,_0xae2d7d){return _[_0xca2b('0x10')](_0xae2d7d,function(_0x420766){return _(_0x420766)[_0xca2b('0x12')](_0x599f15)[_0xca2b('0x10')](function(_0x49ab4f){return _0x49ab4f?_['toString'](_0x49ab4f):'';})['value']();});}function createTable(_0x18eb87,_0x1ed3ef){var _0x4f2a2a={'widths':_[_0xca2b('0x13')](Array(_0x18eb87[_0xca2b('0x14')]),0x91),'heights':function(_0x2e8842){return _0x2e8842===0x0?_0xca2b('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x458180=getHeaders(_0x18eb87);_0x4f2a2a[_0xca2b('0x16')]['push'](_0x458180);var _0x12b4fd=getRows(_0x18eb87,_0x1ed3ef);_0x4f2a2a[_0xca2b('0x16')]=_0x4f2a2a[_0xca2b('0x16')][_0xca2b('0x17')](_0x12b4fd);return _0x4f2a2a;}function createTables(_0x4d02bb){var _0x3fdcf4=[];var _0x24670d=_[_0xca2b('0x18')](Object[_0xca2b('0x19')](_0x4d02bb[0x0]),0x5);_0x24670d['forEach'](function(_0x3d2946){_0x3fdcf4['push'](createTable(_0x3d2946,_0x4d02bb));});return _0x3fdcf4;}function getPDFDocDefinition(_0x4ea63a){var _0xb0c3cd=util[_0xca2b('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xca2b('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xca2b('0x1b')])[_0xca2b('0x1a')](FORMAT));var _0x433d00=[];for(var _0xadef40=0x0;_0xadef40<_0x4ea63a[_0xca2b('0x14')];_0xadef40++){var _0x44ab74=[];if(_0xadef40===0x0){_0x44ab74[_0xca2b('0x1c')]({'text':_0xb0c3cd,'style':_0xca2b('0x1d')});}var _0x21c67c={'table':_0x4ea63a[_0xadef40]};if(_0xadef40>0x0){_0x21c67c[_0xca2b('0x1e')]=_0xca2b('0x1f');_0x21c67c['margin']=[0x0,0x46,0x0,0x0];}_0x44ab74[_0xca2b('0x1c')](_0x21c67c);_0x433d00[_0xca2b('0x1c')](_0x44ab74);}return{'pageSize':'A4','pageOrientation':_0xca2b('0x20'),'content':_0x433d00,'footer':function(_0x12774e,_0x51b87a){return{'text':_0x12774e[_0xca2b('0x21')]()+_0xca2b('0x22')+_0x51b87a,'style':_0xca2b('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xca2b('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43eeb8){var _0xe2e73e=0x1388;var _0x4d54b0;if(!_0x43eeb8[0x0][_0xca2b('0x25')]){return analyticExtractedReport(_0xca2b('0x26'));}return db[_0xca2b('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xca2b('0x28')](function(_0x2fadb1){if(_0x2fadb1){_0x4d54b0=_0x2fadb1;_0xe2e73e=_0x4d54b0[_0xca2b('0x29')]||0x3e8;}})[_0xca2b('0x28')](function(){var _0x3a38b1=[];var _0x4a1085=0x0;if(_0x4d54b0[_0xca2b('0x2a')]){if(_0x43eeb8&&_0x43eeb8[_0xca2b('0x14')]){var _0x19cb88=_[_0xca2b('0x2b')](_0x43eeb8[0x0][_0xca2b('0x25')]/_0xe2e73e);var _0x2b53e4=Number['isInteger'](_0x43eeb8[0x0]['num']/_0xe2e73e)?_0x43eeb8[0x0][_0xca2b('0x25')]%_0xe2e73e:0x0;_0x19cb88[_0xca2b('0x2c')](function(_0x4985ef){if(_0x4985ef>0x0){_0x4a1085+=_0xe2e73e;}_0x3a38b1[_0xca2b('0x1c')](dbH[_0xca2b('0x2d')][_0xca2b('0x2e')](util[_0xca2b('0x1a')](_0xca2b('0x2f'),QUERY,_0xe2e73e,_0x4a1085),{'type':dbH[_0xca2b('0x2d')][_0xca2b('0x30')][_0xca2b('0x31')]}));});if(_0x2b53e4>0x0){_0x4a1085+=_0xe2e73e;_0x3a38b1[_0xca2b('0x1c')](dbH[_0xca2b('0x2d')][_0xca2b('0x2e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2b53e4,_0x4a1085),{'type':dbH[_0xca2b('0x2d')][_0xca2b('0x30')][_0xca2b('0x31')]}));}}}else{_0x3a38b1[_0xca2b('0x1c')](dbH[_0xca2b('0x2d')]['query'](QUERY,{'type':dbH[_0xca2b('0x2d')][_0xca2b('0x30')][_0xca2b('0x31')]}));}var _0x19298c=path[_0xca2b('0x32')](PATH);var _0x1a5108=path[_0xca2b('0x33')](PATH,_0xca2b('0x34'));var _0x19c7b4=_0x4d54b0[_0xca2b('0x2a')]&&_0x3a38b1[_0xca2b('0x14')]>0x1;var _0x144ff9=[];if(!fs['existsSync'](path[_0xca2b('0x35')](_0x19298c,_0x1a5108))&&_0x19c7b4){fs[_0xca2b('0x36')](path[_0xca2b('0x35')](_0x19298c,_0x1a5108));}return BPromise['each'](_0x3a38b1,function(_0x17718d){_0x144ff9[_0xca2b('0x1c')](_0x17718d);})[_0xca2b('0x28')](function(){var _0x101572=[];for(var _0x3e6f05=0x0;_0x3e6f05<_0x144ff9['length'];_0x3e6f05+=0x1){var _0xb87ea5=_0x144ff9[_0x3e6f05];var _0x409f13=createTables(_[_0xca2b('0x37')](_0xb87ea5));var _0x947e1f;var _0x5b7e6e=getPDFDocDefinition(_0x409f13);var _0x322171=getPDFPrinter();var _0x491bc1=_0x322171[_0xca2b('0x38')](_0x5b7e6e);if(_0x19c7b4){_0x947e1f=path[_0xca2b('0x35')](_0x19298c,_0x1a5108,util[_0xca2b('0x1a')](_0xca2b('0x39'),_0x1a5108,_0x3e6f05,_0xca2b('0x3a')));}else{_0x947e1f=path[_0xca2b('0x35')](_0x19298c,util['format']('%s.%s',_0x1a5108,'pdf'));}_0x101572[_0xca2b('0x1c')](writePDFDocument(_0x491bc1,_0x947e1f));}return Promise[_0xca2b('0x3b')](_0x101572);})[_0xca2b('0x28')](function(){if(_0x19c7b4){return new Promise(function(_0x4dff29){zipdir(path[_0xca2b('0x35')](_0x19298c,_0x1a5108),{'saveTo':path[_0xca2b('0x35')](_0x19298c,util[_0xca2b('0x1a')](_0xca2b('0x3c'),_0x1a5108,_0xca2b('0x3d')))},function(){rimraf(path[_0xca2b('0x35')](_0x19298c,_0x1a5108),function(){});_0x4dff29(_0xca2b('0x3e'));});});}})[_0xca2b('0x28')](function(){if(!_0x19c7b4)return;rimraf(path[_0xca2b('0x35')](_0x19298c,_0x1a5108),function(){});})[_0xca2b('0x28')](function(){logger[_0xca2b('0x3f')](util['format'](_0xca2b('0x40'),EXTRACTED_REPORT_ID,_0xca2b('0x41')));return analyticExtractedReport(_0xca2b('0x42'),_0x19c7b4?util[_0xca2b('0x1a')]('%s.%s',_0x1a5108,_0x19c7b4?'zip':_0xca2b('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xca2b('0x1a')](_0xca2b('0x43'),EXTRACTED_REPORT_ID,_0xca2b('0x41')));return db['AnalyticExtractedReport'][_0xca2b('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xca2b('0x28')](function(_0x196da8){EXTRACTED_REPORT=_0x196da8;return dbH[_0xca2b('0x2d')][_0xca2b('0x2e')](util[_0xca2b('0x1a')](_0xca2b('0x45'),QUERY),{'type':dbH[_0xca2b('0x2d')][_0xca2b('0x30')][_0xca2b('0x31')]});})[_0xca2b('0x28')](extractReport)['catch'](function(_0x43dec8){logger[_0xca2b('0x3f')](util['format'](_0xca2b('0x46'),EXTRACTED_REPORT_ID,_0xca2b('0x41')),util[_0xca2b('0x47')](_0x43dec8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xca2b('0x48'));})[_0xca2b('0x49')](function(){process[_0xca2b('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x15431c=new PdfPrinter({'Arial':{'normal':__dirname+_0xca2b('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xca2b('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x15431c;}function getPDFDocDefinitionFromHTML(_0x42c023,_0x4ebc00){var _0x545d72=util['format'](_0xca2b('0x4d'),_0x4ebc00[_0xca2b('0x4e')],_0x4ebc00['interactionId']);var _0x130fa2=moment()[_0xca2b('0x1a')]('YYYY-MM-DD')['toString']();var _0x5e4ba0=htmlToPdfmake(_0x42c023,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5e4ba0],'defaultStyle':{'font':_0xca2b('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xca2b('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xca2b('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xca2b('0x50')}},'header':function(){return[{'text':_0xca2b('0x51'),'style':'header'}];},'footer':function(_0x12457b,_0xf3e796){return[{'text':util[_0xca2b('0x1a')](_0xca2b('0x52'),_0x545d72,_0x12457b,_0xf3e796,_0x130fa2),'style':_0xca2b('0x23')}];}};}function writePDFDocument(_0x19e56c,_0x38beb4){return new Promise(function(_0x1ade27,_0x2e492a){var _0x2b3cdb=_0x19e56c['pipe'](fs[_0xca2b('0x53')](_0x38beb4));_0x2b3cdb['on'](_0xca2b('0x54'),function(){_0x1ade27(_0xca2b('0x54'));});_0x2b3cdb['on'](_0xca2b('0x55'),function(_0x485029){_0x2e492a(_0x485029);});_0x19e56c[_0xca2b('0x56')]();});}exports['createPdfFromHTML']=function(_0x3da76c,_0x328c2a){var _0x2c1859=getPDFPrinter();var _0x262a84=getPDFDocDefinitionFromHTML(_0x3da76c,_0x328c2a);var _0x484cd4=_0x2c1859[_0xca2b('0x38')](_0x262a84);return writePDFDocument(_0x484cd4,_0x328c2a[_0xca2b('0x1')])['catch'](function(_0x5ebb3f){throw _0x5ebb3f;});}; \ No newline at end of file +var _0x0d1e=['moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','tableHeader','pick','map','toString','fill','length','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','each','flatten','createPdfKitDocument','join','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path'];(function(_0x36c063,_0x233be3){var _0x1b6102=function(_0x2c88dd){while(--_0x2c88dd){_0x36c063['push'](_0x36c063['shift']());}};_0x1b6102(++_0x233be3);}(_0x0d1e,0x10b));var _0xe0d1=function(_0xc14a52,_0x5b84b9){_0xc14a52=_0xc14a52-0x0;var _0x2e5227=_0x0d1e[_0xc14a52];return _0x2e5227;};'use strict';var _=require(_0xe0d1('0x0'));var fs=require('fs');var util=require(_0xe0d1('0x1'));var path=require(_0xe0d1('0x2'));var moment=require(_0xe0d1('0x3'));var htmlToPdfmake=require(_0xe0d1('0x4'));var PdfPrinter=require(_0xe0d1('0x5'));var zipdir=require(_0xe0d1('0x6'));var rimraf=require(_0xe0d1('0x7'));var JSDOM=require(_0xe0d1('0x8'))[_0xe0d1('0x9')];var window=new JSDOM('')[_0xe0d1('0xa')];var BPromise=require('bluebird');var db=require(_0xe0d1('0xb'))['db'];var dbH=require(_0xe0d1('0xb'))[_0xe0d1('0xc')];var logger=require(_0xe0d1('0xd'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe0d1('0xe')][0x2]);var QUERY=process[_0xe0d1('0xe')][0x3];var PATH=process[_0xe0d1('0xe')][0x4];var NAME=process[_0xe0d1('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x19f9a4,_0x2ef9e5){var _0x4af20b={'status':_0x19f9a4};var _0x184a3a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ef9e5){_0x4af20b[_0xe0d1('0xf')]=_0x2ef9e5;}return db[_0xe0d1('0x10')]['update'](_0x4af20b,_0x184a3a);}function getHeaders(_0x1a0aeb){return _['map'](_0x1a0aeb,function(_0x173f02){return{'text':_0x173f02,'style':_0xe0d1('0x11')};});}function getRows(_0x355269,_0x5e1c95){return _['map'](_0x5e1c95,function(_0x555350){return _(_0x555350)[_0xe0d1('0x12')](_0x355269)[_0xe0d1('0x13')](function(_0x29d95f){return _0x29d95f?_[_0xe0d1('0x14')](_0x29d95f):'';})['value']();});}function createTable(_0x42ac71,_0x294225){var _0x59a2f6={'widths':_[_0xe0d1('0x15')](Array(_0x42ac71[_0xe0d1('0x16')]),0x91),'heights':function(_0x3890d7){return _0x3890d7===0x0?_0xe0d1('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2db067=getHeaders(_0x42ac71);_0x59a2f6[_0xe0d1('0x18')]['push'](_0x2db067);var _0x12296f=getRows(_0x42ac71,_0x294225);_0x59a2f6[_0xe0d1('0x18')]=_0x59a2f6['body']['concat'](_0x12296f);return _0x59a2f6;}function createTables(_0x3de6f3){var _0xfac3a5=[];var _0x9a8301=_['chunk'](Object[_0xe0d1('0x19')](_0x3de6f3[0x0]),0x5);_0x9a8301[_0xe0d1('0x1a')](function(_0x633db8){_0xfac3a5[_0xe0d1('0x1b')](createTable(_0x633db8,_0x3de6f3));});return _0xfac3a5;}function getPDFDocDefinition(_0x4496b0){var _0x446ead=util[_0xe0d1('0x1c')](_0xe0d1('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xe0d1('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xe0d1('0x1e')])[_0xe0d1('0x1c')](FORMAT));var _0x27e6bd=[];for(var _0x11d786=0x0;_0x11d786<_0x4496b0['length'];_0x11d786++){var _0x5c8856=[];if(_0x11d786===0x0){_0x5c8856[_0xe0d1('0x1b')]({'text':_0x446ead,'style':'header'});}var _0x5cf1f3={'table':_0x4496b0[_0x11d786]};if(_0x11d786>0x0){_0x5cf1f3[_0xe0d1('0x1f')]=_0xe0d1('0x20');_0x5cf1f3[_0xe0d1('0x21')]=[0x0,0x46,0x0,0x0];}_0x5c8856[_0xe0d1('0x1b')](_0x5cf1f3);_0x27e6bd['push'](_0x5c8856);}return{'pageSize':'A4','pageOrientation':_0xe0d1('0x22'),'content':_0x27e6bd,'footer':function(_0x2bfa2b,_0x165f31){return{'text':_0x2bfa2b[_0xe0d1('0x14')]()+_0xe0d1('0x23')+_0x165f31,'style':_0xe0d1('0x24')};},'defaultStyle':{'font':_0xe0d1('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe0d1('0x26')},'footer':{'alignment':_0xe0d1('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2b3155){var _0x3e5dac=0x1388;var _0x19298e;if(!_0x2b3155[0x0][_0xe0d1('0x28')]){return analyticExtractedReport(_0xe0d1('0x29'));}return db[_0xe0d1('0x2a')][_0xe0d1('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe0d1('0x2c'),_0xe0d1('0x2d')]})[_0xe0d1('0x2e')](function(_0xb05891){if(_0xb05891){_0x19298e=_0xb05891;_0x3e5dac=_0x19298e[_0xe0d1('0x2d')]||0x3e8;}})[_0xe0d1('0x2e')](function(){var _0x14e4bd=[];var _0x352397=0x0;if(_0x19298e[_0xe0d1('0x2c')]){if(_0x2b3155&&_0x2b3155[_0xe0d1('0x16')]){var _0x4a3a79=_['range'](_0x2b3155[0x0][_0xe0d1('0x28')]/_0x3e5dac);var _0x45c729=Number[_0xe0d1('0x2f')](_0x2b3155[0x0][_0xe0d1('0x28')]/_0x3e5dac)?_0x2b3155[0x0][_0xe0d1('0x28')]%_0x3e5dac:0x0;_0x4a3a79[_0xe0d1('0x1a')](function(_0x5225e3){if(_0x5225e3>0x0){_0x352397+=_0x3e5dac;}_0x14e4bd[_0xe0d1('0x1b')](dbH['sequelize'][_0xe0d1('0x30')](util[_0xe0d1('0x1c')](_0xe0d1('0x31'),QUERY,_0x3e5dac,_0x352397),{'type':dbH[_0xe0d1('0x32')][_0xe0d1('0x33')]['SELECT']}));});if(_0x45c729>0x0){_0x352397+=_0x3e5dac;_0x14e4bd[_0xe0d1('0x1b')](dbH['sequelize']['query'](util[_0xe0d1('0x1c')](_0xe0d1('0x31'),QUERY,_0x45c729,_0x352397),{'type':dbH[_0xe0d1('0x32')][_0xe0d1('0x33')][_0xe0d1('0x34')]}));}}}else{_0x14e4bd[_0xe0d1('0x1b')](dbH[_0xe0d1('0x32')][_0xe0d1('0x30')](QUERY,{'type':dbH[_0xe0d1('0x32')][_0xe0d1('0x33')][_0xe0d1('0x34')]}));}var _0x2b42eb=path[_0xe0d1('0x35')](PATH);var _0x5d3b93=path['basename'](PATH,_0xe0d1('0x36'));var _0x55c275=_0x19298e[_0xe0d1('0x2c')]&&_0x14e4bd[_0xe0d1('0x16')]>0x1;var _0x55cf6e=[];if(!fs[_0xe0d1('0x37')](path['join'](_0x2b42eb,_0x5d3b93))&&_0x55c275){fs['mkdirSync'](path['join'](_0x2b42eb,_0x5d3b93));}return BPromise[_0xe0d1('0x38')](_0x14e4bd,function(_0x24f192){_0x55cf6e['push'](_0x24f192);})['then'](function(){var _0x17ad16=[];for(var _0xeab823=0x0;_0xeab823<_0x55cf6e[_0xe0d1('0x16')];_0xeab823+=0x1){var _0x560fdd=_0x55cf6e[_0xeab823];var _0x35bacf=createTables(_[_0xe0d1('0x39')](_0x560fdd));var _0x25b25a;var _0x56e044=getPDFDocDefinition(_0x35bacf);var _0x17ecc6=getPDFPrinter();var _0x12f9a6=_0x17ecc6[_0xe0d1('0x3a')](_0x56e044);if(_0x55c275){_0x25b25a=path[_0xe0d1('0x3b')](_0x2b42eb,_0x5d3b93,util[_0xe0d1('0x1c')]('%s%d.%s',_0x5d3b93,_0xeab823,'pdf'));}else{_0x25b25a=path[_0xe0d1('0x3b')](_0x2b42eb,util['format'](_0xe0d1('0x3c'),_0x5d3b93,_0xe0d1('0x3d')));}_0x17ad16['push'](writePDFDocument(_0x12f9a6,_0x25b25a));}return Promise[_0xe0d1('0x3e')](_0x17ad16);})[_0xe0d1('0x2e')](function(){if(_0x55c275){return new Promise(function(_0x482ce6){zipdir(path[_0xe0d1('0x3b')](_0x2b42eb,_0x5d3b93),{'saveTo':path['join'](_0x2b42eb,util[_0xe0d1('0x1c')](_0xe0d1('0x3c'),_0x5d3b93,_0xe0d1('0x3f')))},function(){rimraf(path['join'](_0x2b42eb,_0x5d3b93),function(){});_0x482ce6(_0xe0d1('0x40'));});});}})[_0xe0d1('0x2e')](function(){if(!_0x55c275)return;rimraf(path['join'](_0x2b42eb,_0x5d3b93),function(){});})['then'](function(){logger[_0xe0d1('0x41')](util[_0xe0d1('0x1c')](_0xe0d1('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x55c275?util[_0xe0d1('0x1c')](_0xe0d1('0x3c'),_0x5d3b93,_0x55c275?_0xe0d1('0x3f'):_0xe0d1('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe0d1('0x41')](util[_0xe0d1('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xe0d1('0x10')][_0xe0d1('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xcd13c1){EXTRACTED_REPORT=_0xcd13c1;return dbH['sequelize'][_0xe0d1('0x30')](util[_0xe0d1('0x1c')](_0xe0d1('0x44'),QUERY),{'type':dbH[_0xe0d1('0x32')][_0xe0d1('0x33')]['SELECT']});})[_0xe0d1('0x2e')](extractReport)[_0xe0d1('0x45')](function(_0x4daf81){logger[_0xe0d1('0x41')](util['format'](_0xe0d1('0x46'),EXTRACTED_REPORT_ID,_0xe0d1('0x47')),util[_0xe0d1('0x48')](_0x4daf81,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe0d1('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2a2e38=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xe0d1('0x4a'),'italics':__dirname+_0xe0d1('0x4b'),'bolditalics':__dirname+_0xe0d1('0x4c')}});return _0x2a2e38;}function getPDFDocDefinitionFromHTML(_0x2c8acd,_0x3b6e94){var _0x1a0b1e=util[_0xe0d1('0x1c')](_0xe0d1('0x4d'),_0x3b6e94[_0xe0d1('0x4e')],_0x3b6e94[_0xe0d1('0x4f')]);var _0x30ef19=moment()[_0xe0d1('0x1c')](_0xe0d1('0x50'))[_0xe0d1('0x14')]();var _0x489c5a=htmlToPdfmake(_0x2c8acd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x489c5a],'defaultStyle':{'font':_0xe0d1('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe0d1('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe0d1('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xe0d1('0x52'),'style':_0xe0d1('0x53')}];},'footer':function(_0xd028cd,_0x5de723){return[{'text':util['format'](_0xe0d1('0x54'),_0x1a0b1e,_0xd028cd,_0x5de723,_0x30ef19),'style':_0xe0d1('0x24')}];}};}function writePDFDocument(_0x41260f,_0x1224e6){return new Promise(function(_0x5e82b0,_0x4f7bec){var _0x2e3de9=_0x41260f['pipe'](fs[_0xe0d1('0x55')](_0x1224e6));_0x2e3de9['on'](_0xe0d1('0x56'),function(){_0x5e82b0(_0xe0d1('0x56'));});_0x2e3de9['on'](_0xe0d1('0x57'),function(_0x517d51){_0x4f7bec(_0x517d51);});_0x41260f[_0xe0d1('0x58')]();});}exports[_0xe0d1('0x59')]=function(_0x21a39b,_0x407924){var _0x17c31d=getPDFPrinter();var _0x240db1=getPDFDocDefinitionFromHTML(_0x21a39b,_0x407924);var _0x53a31a=_0x17c31d[_0xe0d1('0x3a')](_0x240db1);return writePDFDocument(_0x53a31a,_0x407924[_0xe0d1('0x2')])['catch'](function(_0x257dd5){throw _0x257dd5;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ccc465a..80ae5bb 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 _0xb88c=['isInteger','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','join','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','split','length','range'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xb88c,0xd5));var _0xcb88=function(_0x347999,_0x315e31){_0x347999=_0x347999-0x0;var _0x48aec3=_0xb88c[_0x347999];return _0x48aec3;};'use strict';var util=require(_0xcb88('0x0'));var path=require(_0xcb88('0x1'));var _=require(_0xcb88('0x2'));var fs=require('fs');var json2xls=require(_0xcb88('0x3'));var BPromise=require(_0xcb88('0x4'));var zipdir=require(_0xcb88('0x5'));var rimraf=require(_0xcb88('0x6'));var db=require(_0xcb88('0x7'))['db'];var dbH=require(_0xcb88('0x7'))['dbH'];var logger=require(_0xcb88('0x8'))(_0xcb88('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xcb88('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38f1e3,_0x3a0b9a){var _0x490dea={'status':_0x38f1e3};var _0x15ee2d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a0b9a){_0x490dea['savename']=_0x3a0b9a;}return db[_0xcb88('0xb')][_0xcb88('0xc')](_0x490dea,_0x15ee2d);}function main(){var _0x39f918=0x1388;var _0x58bdc9;logger[_0xcb88('0xd')](util['format'](_0xcb88('0xe'),EXTRACTED_REPORT_ID,_0xcb88('0xf')));return db['Setting'][_0xcb88('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcb88('0x11')](function(_0x5d5c51){if(_0x5d5c51){_0x58bdc9=_0x5d5c51;_0x39f918=_0x58bdc9['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xcb88('0x12')][_0xcb88('0x13')](util[_0xcb88('0x14')](_0xcb88('0x15'),QUERY),{'type':dbH[_0xcb88('0x12')][_0xcb88('0x16')][_0xcb88('0x17')]});})[_0xcb88('0x11')](function(_0x2542d7){if(!_0x2542d7[0x0]['num']){return analyticExtractedReport('Empty');}var _0x35d649=[];var _0x4be000=0x0;if(_0x58bdc9[_0xcb88('0x18')]){if(_0x2542d7&&_0x2542d7[_0xcb88('0x19')]){var _0x463835=_[_0xcb88('0x1a')](_0x2542d7[0x0]['num']/_0x39f918);var _0x4b5710=Number[_0xcb88('0x1b')](_0x2542d7[0x0][_0xcb88('0x1c')]/_0x39f918)?_0x2542d7[0x0][_0xcb88('0x1c')]%_0x39f918:0x0;_0x463835[_0xcb88('0x1d')](function(_0x29c247){if(_0x29c247>0x0){_0x4be000+=_0x39f918;}_0x35d649[_0xcb88('0x1e')](dbH[_0xcb88('0x12')][_0xcb88('0x13')](util['format'](_0xcb88('0x1f'),QUERY,_0x39f918,_0x4be000),{'type':dbH[_0xcb88('0x12')][_0xcb88('0x16')][_0xcb88('0x17')]}));});if(_0x4b5710>0x0){_0x4be000+=_0x39f918;_0x35d649[_0xcb88('0x1e')](dbH[_0xcb88('0x12')][_0xcb88('0x13')](util['format'](_0xcb88('0x1f'),QUERY,_0x4b5710,_0x4be000),{'type':dbH[_0xcb88('0x12')][_0xcb88('0x16')][_0xcb88('0x17')]}));}}}else{_0x35d649[_0xcb88('0x1e')](dbH['sequelize'][_0xcb88('0x13')](QUERY,{'type':dbH[_0xcb88('0x12')][_0xcb88('0x16')]['SELECT']}));}var _0x410a09=path['dirname'](PATH);var _0x13ae30=path[_0xcb88('0x20')](PATH,_0xcb88('0x21'));var _0x4182ea=_0x58bdc9[_0xcb88('0x18')]&&_0x35d649[_0xcb88('0x19')]>0x1;var _0x5c5406=[];if(!fs['existsSync'](path[_0xcb88('0x22')](_0x410a09,_0x13ae30))&&_0x4182ea){fs['mkdirSync'](path[_0xcb88('0x22')](_0x410a09,_0x13ae30));}return BPromise['each'](_0x35d649,function(_0x13e36e){_0x5c5406[_0xcb88('0x1e')](_0x13e36e);})[_0xcb88('0x11')](function(){for(var _0x193ff2=0x0;_0x193ff2<_0x5c5406['length'];_0x193ff2+=0x1){var _0x24b3b0;var _0x5b4113=_0x5c5406[_0x193ff2];if(_0x4182ea){_0x24b3b0=path['join'](_0x410a09,_0x13ae30,util[_0xcb88('0x14')](_0xcb88('0x23'),_0x13ae30,_0x193ff2,_0xcb88('0x24')));}else{_0x24b3b0=path[_0xcb88('0x22')](_0x410a09,util[_0xcb88('0x14')](_0xcb88('0x25'),_0x13ae30,_0xcb88('0x24')));}fs[_0xcb88('0x26')](_0x24b3b0,json2xls(_0x5b4113),_0xcb88('0x27'));}})[_0xcb88('0x11')](function(){if(_0x4182ea){return new Promise(function(_0x49c419){zipdir(path[_0xcb88('0x22')](_0x410a09,_0x13ae30),{'saveTo':path[_0xcb88('0x22')](_0x410a09,util[_0xcb88('0x14')](_0xcb88('0x25'),_0x13ae30,'zip'))},function(_0x3f6076,_0x336e5f){rimraf(path[_0xcb88('0x22')](_0x410a09,_0x13ae30),function(){});_0x49c419(_0xcb88('0x28'));});});}})[_0xcb88('0x11')](function(){logger[_0xcb88('0xd')](util['format'](_0xcb88('0x29'),EXTRACTED_REPORT_ID,_0xcb88('0xf')));return analyticExtractedReport(_0xcb88('0x2a'),_0x4182ea?util['format'](_0xcb88('0x25'),_0x13ae30,_0x4182ea?'zip':_0xcb88('0x24')):null);});})[_0xcb88('0x2b')](function(_0x1af1d8){logger['info'](util[_0xcb88('0x14')](_0xcb88('0x2c'),EXTRACTED_REPORT_ID,_0xcb88('0xf')),util['inspect'](_0x1af1d8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcb88('0x2d'));})[_0xcb88('0x2e')](function(){process[_0xcb88('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9529=['finally','exit','util','path','bluebird','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT','length','range','num','push','QueryTypes','dirname','basename','existsSync','join','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed'];(function(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0x9529,0x12f));var _0x9952=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9529[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x9952('0x0'));var path=require(_0x9952('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x9952('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x9952('0x3'))['db'];var dbH=require(_0x9952('0x3'))['dbH'];var logger=require(_0x9952('0x4'))(_0x9952('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9952('0x6')][0x3];var PATH=process[_0x9952('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xeeaa4b,_0x297c14){var _0x3c4b54={'status':_0xeeaa4b};var _0x1a5c66={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x297c14){_0x3c4b54[_0x9952('0x7')]=_0x297c14;}return db[_0x9952('0x8')][_0x9952('0x9')](_0x3c4b54,_0x1a5c66);}function main(){var _0x438d40=0x1388;var _0x39d874;logger[_0x9952('0xa')](util[_0x9952('0xb')](_0x9952('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9952('0xd')][_0x9952('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9952('0xf')]})[_0x9952('0x10')](function(_0x21fa57){if(_0x21fa57){_0x39d874=_0x21fa57;_0x438d40=_0x39d874['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x9952('0x11')][_0x9952('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x9952('0x13')]});})[_0x9952('0x10')](function(_0x2a1a75){if(!_0x2a1a75[0x0]['num']){return analyticExtractedReport('Empty');}var _0x55aee3=[];var _0x54ee60=0x0;if(_0x39d874['split']){if(_0x2a1a75&&_0x2a1a75[_0x9952('0x14')]){var _0x1183ba=_[_0x9952('0x15')](_0x2a1a75[0x0][_0x9952('0x16')]/_0x438d40);var _0x50a2e8=Number['isInteger'](_0x2a1a75[0x0]['num']/_0x438d40)?_0x2a1a75[0x0]['num']%_0x438d40:0x0;_0x1183ba['forEach'](function(_0x24eb7a){if(_0x24eb7a>0x0){_0x54ee60+=_0x438d40;}_0x55aee3[_0x9952('0x17')](dbH['sequelize'][_0x9952('0x12')](util[_0x9952('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x438d40,_0x54ee60),{'type':dbH[_0x9952('0x11')][_0x9952('0x18')]['SELECT']}));});if(_0x50a2e8>0x0){_0x54ee60+=_0x438d40;_0x55aee3[_0x9952('0x17')](dbH['sequelize'][_0x9952('0x12')](util[_0x9952('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x50a2e8,_0x54ee60),{'type':dbH[_0x9952('0x11')][_0x9952('0x18')][_0x9952('0x13')]}));}}}else{_0x55aee3[_0x9952('0x17')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x174a02=path[_0x9952('0x19')](PATH);var _0x235e0f=path[_0x9952('0x1a')](PATH,'.xlsx');var _0x283f8e=_0x39d874['split']&&_0x55aee3[_0x9952('0x14')]>0x1;var _0x170dba=[];if(!fs[_0x9952('0x1b')](path['join'](_0x174a02,_0x235e0f))&&_0x283f8e){fs['mkdirSync'](path[_0x9952('0x1c')](_0x174a02,_0x235e0f));}return BPromise['each'](_0x55aee3,function(_0x6b65f5){_0x170dba[_0x9952('0x17')](_0x6b65f5);})[_0x9952('0x10')](function(){for(var _0xad042c=0x0;_0xad042c<_0x170dba[_0x9952('0x14')];_0xad042c+=0x1){var _0x324725;var _0x31bd5c=_0x170dba[_0xad042c];if(_0x283f8e){_0x324725=path[_0x9952('0x1c')](_0x174a02,_0x235e0f,util[_0x9952('0xb')](_0x9952('0x1d'),_0x235e0f,_0xad042c,_0x9952('0x1e')));}else{_0x324725=path[_0x9952('0x1c')](_0x174a02,util[_0x9952('0xb')](_0x9952('0x1f'),_0x235e0f,_0x9952('0x1e')));}fs[_0x9952('0x20')](_0x324725,json2xls(_0x31bd5c),_0x9952('0x21'));}})[_0x9952('0x10')](function(){if(_0x283f8e){return new Promise(function(_0x4e465e){zipdir(path[_0x9952('0x1c')](_0x174a02,_0x235e0f),{'saveTo':path[_0x9952('0x1c')](_0x174a02,util['format'](_0x9952('0x1f'),_0x235e0f,_0x9952('0x22')))},function(_0x2869ee,_0x11c7b0){rimraf(path[_0x9952('0x1c')](_0x174a02,_0x235e0f),function(){});_0x4e465e(_0x9952('0x23'));});});}})['then'](function(){logger['info'](util[_0x9952('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9952('0x24')));return analyticExtractedReport(_0x9952('0x25'),_0x283f8e?util[_0x9952('0xb')]('%s.%s',_0x235e0f,_0x283f8e?_0x9952('0x22'):_0x9952('0x1e')):null);});})[_0x9952('0x26')](function(_0x52921b){logger[_0x9952('0xa')](util['format'](_0x9952('0x27'),EXTRACTED_REPORT_ID,_0x9952('0x24')),util['inspect'](_0x52921b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9952('0x28'));})[_0x9952('0x29')](function(){process[_0x9952('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 69f89b6..3c9b6da 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 _0x78f5=['uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','find','push','Set','format','CDR(type)=%s','type','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','context','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','hasOwnProperty','CDR(tag)=','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','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},','last','concat','Hangup','destroy','bulkCreate','catch','rewrite','util','findAll','intervals','models','VoiceExtension','then'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x78f5,0x1f2));var _0x578f=function(_0x316565,_0x1b017a){_0x316565=_0x316565-0x0;var _0x589a55=_0x78f5[_0x316565];return _0x589a55;};'use strict';var _=require('lodash');var util=require(_0x578f('0x0'));function rewrite(_0x37e0b8,_0x27b0dc){var _0x12085f=this;return _0x37e0b8['models']['Interval'][_0x578f('0x1')]({'raw':!![]})['then'](function(_0x2ad024){_0x12085f[_0x578f('0x2')]=_0x2ad024;return _0x37e0b8[_0x578f('0x3')][_0x578f('0x4')][_0x578f('0x1')]({'where':{'IntervalId':_0x27b0dc['IntervalId']},'raw':!![]});})[_0x578f('0x5')](function(_0x310269){return _0x37e0b8[_0x578f('0x3')]['VoiceExtension'][_0x578f('0x1')]({'where':{'exten':{'$in':_[_0x578f('0x6')](_['map'](_0x310269,_0x578f('0x7')))}},'order':[{'raw':_0x578f('0x8')}],'raw':!![]});})[_0x578f('0x5')](function(_0x17aad6){var _0x4d1e51=_[_0x578f('0x9')](_0x17aad6,{'priority':'1'});var _0x9b1f6d=_['filter'](_0x17aad6,{'isApp':0x1});var _0x9f03e1=_[_0x578f('0xa')](_0x9b1f6d,_0x578f('0x7'));var _0x3c833b=[_0x578f('0xb'),'playback'];var _0x31b312=[];var _0x28a84e=[];for(var _0x25140b in _0x9f03e1){if(_0x9f03e1['hasOwnProperty'](_0x25140b)){_0x12085f[_0x578f('0xc')]=0x2;_0x12085f[_0x578f('0xd')]=[];_0x12085f['extension']=_[_0x578f('0xe')](_0x4d1e51,{'exten':_0x9f03e1[_0x25140b][0x0]['exten']});_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0]['type'],'app':_0x578f('0x10'),'appdata':util[_0x578f('0x11')](_0x578f('0x12'),_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')]),'context':_0x9f03e1[_0x25140b][0x0]['context'],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0]['VoiceExtensionId']});if(_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')]===_0x578f('0x14')){_0x12085f['extensions'][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0]['type'],'app':_0x578f('0x10'),'appdata':_0x578f('0x15')+_0x9f03e1[_0x25140b][0x0]['VoiceExtensionId'],'context':_0x9f03e1[_0x25140b][0x0]['context'],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});}else if(_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')]===_0x578f('0x17')){if(_0x12085f['extension']){_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x578f('0x18')+(_0x12085f[_0x578f('0x19')][_0x578f('0x1a')]?_0x578f('0x1b')+_0x12085f['extension'][_0x578f('0x1a')]+'}':_0x578f('0x1c')),'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});}_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')],'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});var _0x3b2cb3=_0x12085f[_0x578f('0xc')]++;_0x12085f['extensions'][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3b2cb3+0x2)+_0x578f('0x1e')+(_0x3b2cb3+0x1)+')','context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x3b2cb3,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});if(_0x12085f[_0x578f('0x19')]){_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x12085f['extension'][_0x578f('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x12085f['extension'][_0x578f('0x1a')]+'}':_0x578f('0x1f'),'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});}_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x578f('0x20')+_0x9f03e1[_0x25140b][0x0]['VoiceExtensionId'],'context':_0x9f03e1[_0x25140b][0x0]['context'],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0]['VoiceExtensionId']});if(_0x12085f[_0x578f('0x19')]&&_0x12085f['extension']['hasOwnProperty'](_0x578f('0x21'))&&_0x12085f[_0x578f('0x19')][_0x578f('0x21')]!==_0x578f('0x22')){_0x12085f[_0x578f('0xd')]['push']({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x578f('0x23'),'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f['priority']++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x578f('0x24')+_0x12085f[_0x578f('0x19')][_0x578f('0x21')]||_0x578f('0x25'),'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});}}_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':_0x578f('0x26'),'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x10'),'appdata':'MONITOR_OPTIONS=ab','context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'exten':_0x9f03e1[_0x25140b][0x0][_0x578f('0x7')],'priority':_0x12085f[_0x578f('0xc')]++,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});for(var _0x4fab10=0x0,_0x5c73f8=0x0;_0x4fab10<_0x9f03e1[_0x25140b][_0x578f('0x27')];_0x4fab10+=0x1,_0x5c73f8=0x0){var _0x2d5f08=_0x9f03e1[_0x25140b][_0x4fab10];if(_0x2d5f08[_0x578f('0x13')]){_0x2d5f08['type']=_0x2d5f08[_0x578f('0x13')][_0x578f('0x28')]();}var _0xc529be=[];var _0x1cd2fc=[];delete _0x2d5f08['id'];delete _0x2d5f08[_0x578f('0x29')];delete _0x2d5f08[_0x578f('0x2a')];var _0x5ed721=_0x2d5f08[_0x578f('0x2b')]!==_0x578f('0x2c')?[_0x2d5f08[_0x578f('0x2b')]]:_0x2d5f08[_0x578f('0x2d')]?_[_0x578f('0x2e')](_[_0x578f('0x9')](_0x12085f[_0x578f('0x2')],{'IntervalId':_0x2d5f08[_0x578f('0x2d')]}),'interval'):[];if(_0x2d5f08[_0x578f('0x2f')]('tag')){if(_0x2d5f08['tag']&&_0x2d5f08['tag']!=='--'){_0xc529be[_0x578f('0xf')]({'type':_0x2d5f08[_0x578f('0x13')],'app':'Set','appdata':_0x578f('0x30')+_0x2d5f08[_0x578f('0x31')],'context':_0x2d5f08['context'],'exten':_0x2d5f08['exten'],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f['priority']+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});}}if(_0x2d5f08[_0x578f('0x13')]===_0x578f('0x17')&&_0x2d5f08[_0x578f('0x2f')](_0x578f('0x32'))){if(_0x2d5f08[_0x578f('0x32')]){_0xc529be[_0x578f('0xf')]({'type':_0x2d5f08[_0x578f('0x13')],'app':_0x578f('0x33'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2d5f08['callerID']+')','context':_0x2d5f08[_0x578f('0x1d')],'exten':_0x2d5f08[_0x578f('0x7')],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f[_0x578f('0xc')]+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});}else{_0xc529be['push']({'type':_0x2d5f08['type'],'app':_0x578f('0x33'),'appdata':_0x578f('0x34'),'context':_0x2d5f08['context'],'exten':_0x2d5f08[_0x578f('0x7')],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f['priority']+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});}}if(_0x2d5f08[_0x578f('0x2f')]('answer')){if(_0x3c833b[_0x578f('0x35')](_0x2d5f08[_0x578f('0x36')][_0x578f('0x28')]())>=0x0&&_0x2d5f08[_0x578f('0x37')]!==_0x578f('0x38')){if(_0x2d5f08[_0x578f('0x39')]){_0xc529be[_0x578f('0xf')]({'type':_0x2d5f08[_0x578f('0x13')],'app':_0x578f('0x33'),'appdata':_0x578f('0x3a'),'context':_0x2d5f08[_0x578f('0x1d')],'exten':_0x2d5f08['exten'],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f['priority']+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});_0xc529be[_0x578f('0xf')]({'type':_0x2d5f08[_0x578f('0x13')],'app':'Set','appdata':_0x578f('0x3b'),'context':_0x2d5f08['context'],'exten':_0x2d5f08[_0x578f('0x7')],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f[_0x578f('0xc')]+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});}else{_0xc529be[_0x578f('0xf')]({'type':_0x2d5f08[_0x578f('0x13')],'app':'ExecIf','appdata':_0x578f('0x3c'),'context':_0x2d5f08[_0x578f('0x1d')],'exten':_0x2d5f08[_0x578f('0x7')],'priority':_0x5ed721[_0x578f('0x27')]+_0x12085f[_0x578f('0xc')]+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});_0xc529be['push']({'type':_0x2d5f08[_0x578f('0x13')],'app':'Set','appdata':_0x578f('0x3d'),'context':_0x2d5f08[_0x578f('0x1d')],'exten':_0x2d5f08[_0x578f('0x7')],'priority':_0x5ed721['length']+_0x12085f[_0x578f('0xc')]+_0x5c73f8++,'VoiceExtensionId':_0x2d5f08[_0x578f('0x16')]});}}}for(var _0x355717=0x0;_0x355717<_0x5ed721[_0x578f('0x27')];_0x355717+=0x1){var _0x3bcae6=_0x12085f['priority']+_0x5ed721[_0x578f('0x27')];var _0x8ead54=_0x355717===_0x5ed721['length']-0x1?_0x12085f[_0x578f('0xc')]+_0xc529be[_0x578f('0x27')]+_0x1cd2fc['length']+0x2:_0x12085f['priority']+_0x355717+0x1;_0xc529be[_0x578f('0x3e')](_0x355717,0x0,{'type':_0x2d5f08[_0x578f('0x13')],'app':_0x578f('0x3f'),'appdata':_0x5ed721[_0x355717]+'?'+_0x2d5f08[_0x578f('0x1d')]+',${EXTEN},'+_0x3bcae6+':'+_0x2d5f08['context']+_0x578f('0x40')+_0x8ead54,'exten':_0x2d5f08['exten'],'context':_0x2d5f08[_0x578f('0x1d')],'priority':_0x12085f[_0x578f('0xc')]+_0x355717,'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});}_0x2d5f08[_0x578f('0xc')]=_0xc529be[_0x578f('0x27')]?_[_0x578f('0x41')](_0xc529be)[_0x578f('0xc')]+0x1:_0x12085f[_0x578f('0xc')];_0x12085f[_0x578f('0xc')]=(_0x1cd2fc[_0x578f('0x27')]?_['last'](_0x1cd2fc)['priority']:_0x2d5f08[_0x578f('0xc')])+0x1;_0x12085f['extensions']=_[_0x578f('0x42')](_0x12085f[_0x578f('0xd')],_0xc529be,[_0x2d5f08],_0x1cd2fc);}_0x12085f[_0x578f('0xd')][_0x578f('0xf')]({'type':_0x9f03e1[_0x25140b][0x0][_0x578f('0x13')],'app':_0x578f('0x43'),'exten':_0x9f03e1[_0x25140b][0x0]['exten'],'context':_0x9f03e1[_0x25140b][0x0][_0x578f('0x1d')],'priority':_0x12085f[_0x578f('0xc')],'VoiceExtensionId':_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]});_0x31b312['push'](_0x9f03e1[_0x25140b][0x0][_0x578f('0x16')]);_0x28a84e=_[_0x578f('0x42')](_0x28a84e,_0x12085f[_0x578f('0xd')]);}}return _0x37e0b8['transaction'](function(_0x1b6825){return _0x37e0b8[_0x578f('0x3')]['VoiceExtension'][_0x578f('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x31b312}},'transaction':_0x1b6825})['then'](function(_0x45ce23){return _0x37e0b8[_0x578f('0x3')][_0x578f('0x4')][_0x578f('0x45')](_['sortBy'](_0x28a84e,_0x578f('0xc')),{'transaction':_0x1b6825});});});})[_0x578f('0x46')](function(_0x5d5b10){console['error'](_0x5d5b10);});}exports[_0x578f('0x47')]=rewrite; \ No newline at end of file +var _0x6bc1=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','push','type','Set','format','context','VoiceExtensionId','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x323a8a,_0x4cf6b6){var _0x1789d7=function(_0x4953f6){while(--_0x4953f6){_0x323a8a['push'](_0x323a8a['shift']());}};_0x1789d7(++_0x4cf6b6);}(_0x6bc1,0x1ee));var _0x16bc=function(_0x40edb9,_0x108ce6){_0x40edb9=_0x40edb9-0x0;var _0x41795f=_0x6bc1[_0x40edb9];return _0x41795f;};'use strict';var _=require(_0x16bc('0x0'));var util=require(_0x16bc('0x1'));function rewrite(_0x4b84ac,_0x1f6f39){var _0x2c4bfb=this;return _0x4b84ac[_0x16bc('0x2')][_0x16bc('0x3')][_0x16bc('0x4')]({'raw':!![]})[_0x16bc('0x5')](function(_0x40e10e){_0x2c4bfb[_0x16bc('0x6')]=_0x40e10e;return _0x4b84ac['models']['VoiceExtension'][_0x16bc('0x4')]({'where':{'IntervalId':_0x1f6f39[_0x16bc('0x7')]},'raw':!![]});})[_0x16bc('0x5')](function(_0xb73ac5){return _0x4b84ac[_0x16bc('0x2')][_0x16bc('0x8')]['findAll']({'where':{'exten':{'$in':_[_0x16bc('0x9')](_[_0x16bc('0xa')](_0xb73ac5,_0x16bc('0xb')))}},'order':[{'raw':_0x16bc('0xc')}],'raw':!![]});})[_0x16bc('0x5')](function(_0x55bd5b){var _0xe344e0=_[_0x16bc('0xd')](_0x55bd5b,{'priority':'1'});var _0x56f0da=_[_0x16bc('0xd')](_0x55bd5b,{'isApp':0x1});var _0x1d1246=_[_0x16bc('0xe')](_0x56f0da,'exten');var _0x3ec8b6=[_0x16bc('0xf'),_0x16bc('0x10')];var _0x498dcf=[];var _0x4acde5=[];for(var _0x5956dd in _0x1d1246){if(_0x1d1246['hasOwnProperty'](_0x5956dd)){_0x2c4bfb[_0x16bc('0x11')]=0x2;_0x2c4bfb[_0x16bc('0x12')]=[];_0x2c4bfb[_0x16bc('0x13')]=_['find'](_0xe344e0,{'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')]});_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':util[_0x16bc('0x17')]('CDR(type)=%s',_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')]),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});if(_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')]==='inbound'){_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x1a')+_0x1d1246[_0x5956dd][0x0]['VoiceExtensionId'],'context':_0x1d1246[_0x5956dd][0x0]['context'],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb['priority']++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});}else if(_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')]===_0x16bc('0x1b')){if(_0x2c4bfb[_0x16bc('0x13')]){_0x2c4bfb['extensions']['push']({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':'Set','appdata':'CDR(destination)='+(_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x1c')]?_0x16bc('0x1d')+_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x1c')]+'}':_0x16bc('0x1e')),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});}_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0]['type'],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x1a')+_0x1d1246[_0x5956dd][0x0]['VoiceExtensionId'],'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});var _0x456125=_0x2c4bfb[_0x16bc('0x11')]++;_0x2c4bfb['extensions'][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x456125+0x2)+_0x16bc('0x20')+(_0x456125+0x1)+')','context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x456125,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});if(_0x2c4bfb[_0x16bc('0x13')]){_0x2c4bfb['extensions'][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x1c')]?_0x16bc('0x21')+_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0]['exten'],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});}_0x2c4bfb['extensions'][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0]['type'],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x22')+_0x1d1246[_0x5956dd][0x0]['VoiceExtensionId'],'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0]['exten'],'priority':_0x2c4bfb['priority']++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});if(_0x2c4bfb[_0x16bc('0x13')]&&_0x2c4bfb[_0x16bc('0x13')]['hasOwnProperty'](_0x16bc('0x23'))&&_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x23')]!==_0x16bc('0x24')){_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0]['VoiceExtensionId']});_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x25')+_0x2c4bfb[_0x16bc('0x13')][_0x16bc('0x23')]||_0x16bc('0x26'),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0]['exten'],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});}}_0x2c4bfb['extensions']['push']({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x27'),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x28'),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0]['exten'],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x29'),'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'exten':_0x1d1246[_0x5956dd][0x0]['exten'],'priority':_0x2c4bfb[_0x16bc('0x11')]++,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});for(var _0x5c8c0c=0x0,_0x532572=0x0;_0x5c8c0c<_0x1d1246[_0x5956dd]['length'];_0x5c8c0c+=0x1,_0x532572=0x0){var _0xced40d=_0x1d1246[_0x5956dd][_0x5c8c0c];if(_0xced40d[_0x16bc('0x15')]){_0xced40d['type']=_0xced40d[_0x16bc('0x15')][_0x16bc('0x2a')]();}var _0x4dd9a0=[];var _0x3c1765=[];delete _0xced40d['id'];delete _0xced40d['createdAt'];delete _0xced40d[_0x16bc('0x2b')];var _0x17c0d9=_0xced40d[_0x16bc('0x2c')]!==_0x16bc('0x2d')?[_0xced40d[_0x16bc('0x2c')]]:_0xced40d[_0x16bc('0x7')]?_['map'](_['filter'](_0x2c4bfb[_0x16bc('0x6')],{'IntervalId':_0xced40d[_0x16bc('0x7')]}),_0x16bc('0x2c')):[];if(_0xced40d[_0x16bc('0x2e')](_0x16bc('0x2f'))){if(_0xced40d[_0x16bc('0x2f')]&&_0xced40d[_0x16bc('0x2f')]!=='--'){_0x4dd9a0['push']({'type':_0xced40d[_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x30')+_0xced40d['tag'],'context':_0xced40d[_0x16bc('0x18')],'exten':_0xced40d[_0x16bc('0xb')],'priority':_0x17c0d9[_0x16bc('0x31')]+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d[_0x16bc('0x19')]});}}if(_0xced40d[_0x16bc('0x15')]==='outbound'&&_0xced40d[_0x16bc('0x2e')](_0x16bc('0x32'))){if(_0xced40d[_0x16bc('0x32')]){_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d[_0x16bc('0x15')],'app':_0x16bc('0x1f'),'appdata':_0x16bc('0x33')+_0xced40d['callerID']+')','context':_0xced40d['context'],'exten':_0xced40d[_0x16bc('0xb')],'priority':_0x17c0d9['length']+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d[_0x16bc('0x19')]});}else{_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xced40d[_0x16bc('0x18')],'exten':_0xced40d[_0x16bc('0xb')],'priority':_0x17c0d9[_0x16bc('0x31')]+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d['VoiceExtensionId']});}}if(_0xced40d[_0x16bc('0x2e')](_0x16bc('0x34'))){if(_0x3ec8b6['indexOf'](_0xced40d[_0x16bc('0x35')][_0x16bc('0x2a')]())>=0x0&&_0xced40d[_0x16bc('0x36')]!==_0x16bc('0x37')){if(_0xced40d[_0x16bc('0x34')]){_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d[_0x16bc('0x15')],'app':'ExecIf','appdata':_0x16bc('0x38'),'context':_0xced40d[_0x16bc('0x18')],'exten':_0xced40d['exten'],'priority':_0x17c0d9['length']+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d['VoiceExtensionId']});_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d['type'],'app':_0x16bc('0x16'),'appdata':_0x16bc('0x39'),'context':_0xced40d['context'],'exten':_0xced40d[_0x16bc('0xb')],'priority':_0x17c0d9[_0x16bc('0x31')]+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d[_0x16bc('0x19')]});}else{_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d['type'],'app':_0x16bc('0x1f'),'appdata':_0x16bc('0x3a'),'context':_0xced40d[_0x16bc('0x18')],'exten':_0xced40d[_0x16bc('0xb')],'priority':_0x17c0d9['length']+_0x2c4bfb['priority']+_0x532572++,'VoiceExtensionId':_0xced40d[_0x16bc('0x19')]});_0x4dd9a0[_0x16bc('0x14')]({'type':_0xced40d[_0x16bc('0x15')],'app':_0x16bc('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xced40d[_0x16bc('0x18')],'exten':_0xced40d['exten'],'priority':_0x17c0d9[_0x16bc('0x31')]+_0x2c4bfb[_0x16bc('0x11')]+_0x532572++,'VoiceExtensionId':_0xced40d[_0x16bc('0x19')]});}}}for(var _0x45cf15=0x0;_0x45cf15<_0x17c0d9['length'];_0x45cf15+=0x1){var _0x31ff4c=_0x2c4bfb[_0x16bc('0x11')]+_0x17c0d9[_0x16bc('0x31')];var _0x24872a=_0x45cf15===_0x17c0d9[_0x16bc('0x31')]-0x1?_0x2c4bfb[_0x16bc('0x11')]+_0x4dd9a0[_0x16bc('0x31')]+_0x3c1765[_0x16bc('0x31')]+0x2:_0x2c4bfb[_0x16bc('0x11')]+_0x45cf15+0x1;_0x4dd9a0['splice'](_0x45cf15,0x0,{'type':_0xced40d[_0x16bc('0x15')],'app':_0x16bc('0x3b'),'appdata':_0x17c0d9[_0x45cf15]+'?'+_0xced40d['context']+_0x16bc('0x3c')+_0x31ff4c+':'+_0xced40d['context']+_0x16bc('0x3c')+_0x24872a,'exten':_0xced40d[_0x16bc('0xb')],'context':_0xced40d[_0x16bc('0x18')],'priority':_0x2c4bfb[_0x16bc('0x11')]+_0x45cf15,'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});}_0xced40d[_0x16bc('0x11')]=_0x4dd9a0['length']?_[_0x16bc('0x3d')](_0x4dd9a0)[_0x16bc('0x11')]+0x1:_0x2c4bfb['priority'];_0x2c4bfb['priority']=(_0x3c1765['length']?_[_0x16bc('0x3d')](_0x3c1765)[_0x16bc('0x11')]:_0xced40d[_0x16bc('0x11')])+0x1;_0x2c4bfb[_0x16bc('0x12')]=_[_0x16bc('0x3e')](_0x2c4bfb['extensions'],_0x4dd9a0,[_0xced40d],_0x3c1765);}_0x2c4bfb[_0x16bc('0x12')][_0x16bc('0x14')]({'type':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x15')],'app':_0x16bc('0x3f'),'exten':_0x1d1246[_0x5956dd][0x0][_0x16bc('0xb')],'context':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x18')],'priority':_0x2c4bfb[_0x16bc('0x11')],'VoiceExtensionId':_0x1d1246[_0x5956dd][0x0][_0x16bc('0x19')]});_0x498dcf[_0x16bc('0x14')](_0x1d1246[_0x5956dd][0x0]['VoiceExtensionId']);_0x4acde5=_[_0x16bc('0x3e')](_0x4acde5,_0x2c4bfb[_0x16bc('0x12')]);}}return _0x4b84ac[_0x16bc('0x40')](function(_0x23a0bb){return _0x4b84ac[_0x16bc('0x2')][_0x16bc('0x8')][_0x16bc('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x498dcf}},'transaction':_0x23a0bb})[_0x16bc('0x5')](function(_0xba3604){return _0x4b84ac[_0x16bc('0x2')][_0x16bc('0x8')]['bulkCreate'](_['sortBy'](_0x4acde5,_0x16bc('0x11')),{'transaction':_0x23a0bb});});});})[_0x16bc('0x42')](function(_0x18628d){console[_0x16bc('0x43')](_0x18628d);});}exports[_0x16bc('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 11ad873..01a977d 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 _0xd703=['phone\x20NOT\x20IN\x20(?)','\x20=\x20?','calleridnum','cm_hopper_final','str','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','always','sequelize','query','VoiceQueueId','BlackLists','get','all','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','undefined','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','data','firstName\x20not\x20specified!','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','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','phone','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x474bd1,_0x210d7f){var _0x2963ad=function(_0x37ce68){while(--_0x37ce68){_0x474bd1['push'](_0x474bd1['shift']());}};_0x2963ad(++_0x210d7f);}(_0xd703,0x17b));var _0x3d70=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd703[_0x1a72f3];return _0x57ef47;};'use strict';var BPromise=require(_0x3d70('0x0'));var util=require(_0x3d70('0x1'));var _=require(_0x3d70('0x2'));var fs=require('fs');var squel=require(_0x3d70('0x3'));var Papa=require(_0x3d70('0x4'));var Redis=require(_0x3d70('0x5'));var db=require(_0x3d70('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x3d70('0x7'))(_0x3d70('0x8'));config['redis']=_[_0x3d70('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d70('0xa'))(new Redis(config[_0x3d70('0xb')]));require(_0x3d70('0xc'))[_0x3d70('0xd')](socket);try{if(!process[_0x3d70('0xe')][0x2]||process[_0x3d70('0xe')][0x2]==='undefined'||process['argv'][0x2]===_0x3d70('0xf')){throw new Error(_0x3d70('0x10'));}var FILEPATH=process[_0x3d70('0xe')][0x2];if(!process['argv'][0x3]||process[_0x3d70('0xe')][0x3]==='undefined'||process[_0x3d70('0xe')][0x3]===_0x3d70('0xf')||!process[_0x3d70('0xe')][0x4]||process[_0x3d70('0xe')][0x4]==='undefined'||process[_0x3d70('0xe')][0x4]===_0x3d70('0xf')){throw new Error(_0x3d70('0x11'));}var FIELDS=_[_0x3d70('0x12')](process[_0x3d70('0xe')][0x3][_0x3d70('0x13')](','),process['argv'][0x4][_0x3d70('0x13')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x3d70('0x14')||process[_0x3d70('0xe')][0x5]===_0x3d70('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x3d70('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x3d70('0x14')&&process[_0x3d70('0xe')][0x6]!==_0x3d70('0xf')?process[_0x3d70('0xe')][0x6]:null;var DUPLICATES=process[_0x3d70('0xe')][0x7]&&process[_0x3d70('0xe')][0x7]!==_0x3d70('0x14')&&process['argv'][0x7]!==_0x3d70('0xf')?process['argv'][0x7]:null;if(!process[_0x3d70('0xe')][0x8]||process[_0x3d70('0xe')][0x8]===_0x3d70('0x14')||process[_0x3d70('0xe')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3d70('0xe')][0x8];}catch(_0x55ad95){logger[_0x3d70('0x15')](_0x55ad95);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(_0x47417d,_0x1f69ef,_0x3db9c5,_0x31a7de){var _0x30c791={'message':_0x1f69ef};_0x30c791[_0x47417d]=!![];if(_0x3db9c5){_0x30c791['contact']=_0x3db9c5;}if(_0x31a7de){_0x30c791[_0x3d70('0x16')]=_0x31a7de;}return _0x30c791;}function isEmail(_0x5bfdb4){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'](_0x5bfdb4);}function checkRow(_0x45944b,_0x363bdb,_0x25c4b1){return new BPromise(function(_0x1aa65d,_0x37adfd){if(_[_0x3d70('0x17')](_0x45944b)){return _0x37adfd(handleCheckRowError('error',_0x3d70('0x18'),null,_0x25c4b1));}if(_0x45944b[_0x3d70('0x19')]&&_0x45944b[_0x3d70('0x19')]['length']){var _0x12ffac=_[_0x3d70('0x1a')](_0x45944b[_0x3d70('0x19')],'message')[_0x3d70('0x1b')](';');return _0x37adfd(handleCheckRowError(_0x3d70('0x15'),_0x12ffac,null,_0x25c4b1));}var _0xe5c957={};for(var _0x108fde in FIELDS){if(FIELDS['hasOwnProperty'](_0x108fde)&&FIELDS[_0x108fde]){_0xe5c957[_0x108fde]=_0x45944b['data'][0x0][FIELDS[_0x108fde]]||_0x45944b[_0x3d70('0x1c')][0x0]['\ufeff'+FIELDS[_0x108fde]];}}if(!_0xe5c957['firstName']){return _0x37adfd(handleCheckRowError(_0x3d70('0x15'),_0x3d70('0x1d'),null,_0x25c4b1));}if(!_0xe5c957['phone']){return _0x37adfd(handleCheckRowError(_0x3d70('0x15'),_0x3d70('0x1e'),null,_0x25c4b1));}if(_0xe5c957['birthDate']){var _0x2206b3=moment(_0xe5c957[_0x3d70('0x1f')],_0x3d70('0x20'));if(!_0x2206b3[_0x3d70('0x21')]()){return _0x37adfd(handleCheckRowError('error',_0x3d70('0x22'),null,_0x25c4b1));}}if(_0xe5c957[_0x3d70('0x23')]){if(!isEmail(_0xe5c957[_0x3d70('0x23')])){return _0x37adfd(handleCheckRowError('error',_0x3d70('0x24'),null,_0x25c4b1));}}_0xe5c957[_0x3d70('0x25')]=LISTID;_0xe5c957[_0x3d70('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3d70('0x27')]&&_0x363bdb){var _0x4c37e5={};for(var _0x500fee=0x0,_0x23d8ab=DUPLICATES[_0x3d70('0x27')];_0x500fee<_0x23d8ab;_0x500fee+=0x1){_0x4c37e5[DUPLICATES[_0x500fee]]=_0xe5c957[DUPLICATES[_0x500fee]];}var _0x932b7d=_[_0x3d70('0x28')](_0x363bdb,_0x4c37e5);if(_0x932b7d){return _0x37adfd(handleCheckRowError(_0x3d70('0x29'),_0x3d70('0x2a'),_0x932b7d,_0x25c4b1));}}return db[_0x3d70('0x2b')][_0x3d70('0x2c')](_0xe5c957,{'raw':!![],'hooks':![],'fields':_[_0x3d70('0x2d')](_0xe5c957)})['then'](function(_0x267bf2){if(DUPLICATES&&DUPLICATES[_0x3d70('0x27')]&&_0x363bdb){_0x363bdb[_0x3d70('0x2e')](_[_0x3d70('0x2f')](_0xe5c957,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x267bf2['id'];return _0x1aa65d();})[_0x3d70('0x30')](function(_0x4c738b){return _0x37adfd(handleCheckRowError(_0x3d70('0x15'),_0x3d70('0x31')+(_0x4c738b[_0x3d70('0x32')]||JSON['stringify'](_0x4c738b)),null,_0x25c4b1));});});}function checkHopper(){function _0xd33e3a(){return function(_0xc20884){logger[_0x3d70('0x15')](_0x3d70('0x33'),_0x3d70('0x34'),util[_0x3d70('0x35')](_0xc20884,{'showHidden':![],'depth':null}));};}var _0x11568d=function(_0x287a41,_0x506652){var _0x343c30=squel[_0x3d70('0x36')]()[_0x3d70('0x37')](_0x3d70('0x38'))[_0x3d70('0x39')](['phone',_0x3d70('0x3a'),_0x3d70('0x3b'),_0x3d70('0x25'),_0x506652,_0x3d70('0x3c'),_0x3d70('0x3d')],squel[_0x3d70('0x3e')]()['field'](_0x3d70('0x3f'),_0x3d70('0x3f'))[_0x3d70('0x40')](_0x3d70('0x41'),'scheduledAt')[_0x3d70('0x40')]('id','ContactId')[_0x3d70('0x40')](LISTID[_0x3d70('0x42')](),_0x3d70('0x25'))[_0x3d70('0x40')](_0x287a41['id'][_0x3d70('0x42')](),_0x506652)[_0x3d70('0x40')](_0x3d70('0x41'),'createdAt')[_0x3d70('0x40')](_0x3d70('0x41'),'updatedAt')[_0x3d70('0x43')](_0x3d70('0x44'))[_0x3d70('0x45')](_0x3d70('0x46'))[_0x3d70('0x45')](_0x3d70('0x47'),LISTID[_0x3d70('0x42')]())['where'](_0x3d70('0x48'))[_0x3d70('0x45')](_0x3d70('0x49'),squel[_0x3d70('0x3e')]()[_0x3d70('0x40')](_0x3d70('0x3f'))[_0x3d70('0x43')](_0x3d70('0x38'))['where'](_0x506652+_0x3d70('0x4a'),_0x287a41['id'][_0x3d70('0x42')]())))['toString']();return _0x343c30;};var _0x420b48=function(_0x12f252,_0x16d38d){var _0x43e6e5=squel[_0x3d70('0x36')]()[_0x3d70('0x37')](_0x3d70('0x38'))[_0x3d70('0x39')]([_0x3d70('0x3f'),_0x3d70('0x3a'),_0x3d70('0x3b'),_0x3d70('0x25'),_0x16d38d,_0x3d70('0x3c'),_0x3d70('0x3d')],squel[_0x3d70('0x3e')]()[_0x3d70('0x40')](_0x3d70('0x3f'),_0x3d70('0x3f'))[_0x3d70('0x40')]('NOW()',_0x3d70('0x3a'))[_0x3d70('0x40')]('id','ContactId')[_0x3d70('0x40')](LISTID[_0x3d70('0x42')](),_0x3d70('0x25'))['field'](_0x12f252['id'][_0x3d70('0x42')](),_0x16d38d)[_0x3d70('0x40')](_0x3d70('0x41'),_0x3d70('0x3c'))[_0x3d70('0x40')](_0x3d70('0x41'),_0x3d70('0x3d'))['from'](_0x3d70('0x44'))[_0x3d70('0x45')](_0x3d70('0x46'))[_0x3d70('0x45')](_0x3d70('0x47'),LISTID[_0x3d70('0x42')]())[_0x3d70('0x45')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x3d70('0x45')](_0x3d70('0x48'))[_0x3d70('0x45')](_0x3d70('0x49'),squel[_0x3d70('0x3e')]()[_0x3d70('0x40')](_0x3d70('0x4b'))[_0x3d70('0x43')](_0x3d70('0x4c'))['where'](_0x16d38d+_0x3d70('0x4a'),_0x12f252['id']['toString']()))[_0x3d70('0x45')](_0x3d70('0x49'),squel['select']()[_0x3d70('0x40')](_0x3d70('0x3f'))[_0x3d70('0x43')](_0x3d70('0x38'))[_0x3d70('0x45')](_0x16d38d+'\x20=\x20?',_0x12f252['id'][_0x3d70('0x42')]())))['toString']();return _0x43e6e5;};function _0x2dbc72(_0x5bc3bd,_0x1b9f1f){var _0x2644c3=squel[_0x3d70('0x36')]()[_0x3d70('0x37')](_0x3d70('0x38'))[_0x3d70('0x39')]([_0x3d70('0x3f'),_0x3d70('0x3a'),'ContactId',_0x3d70('0x25'),_0x1b9f1f,_0x3d70('0x3c'),_0x3d70('0x3d')],squel[_0x3d70('0x3e')]()[_0x3d70('0x40')]('phone','phone')['field'](_0x3d70('0x41'),_0x3d70('0x3a'))[_0x3d70('0x40')]('id',_0x3d70('0x3b'))['field'](LISTID[_0x3d70('0x42')](),_0x3d70('0x25'))[_0x3d70('0x40')](_0x5bc3bd['id'][_0x3d70('0x42')](),_0x1b9f1f)[_0x3d70('0x40')](_0x3d70('0x41'),_0x3d70('0x3c'))['field'](_0x3d70('0x41'),_0x3d70('0x3d'))[_0x3d70('0x43')](_0x3d70('0x44'))[_0x3d70('0x45')]('deletedAt\x20IS\x20NULL')[_0x3d70('0x45')](_0x3d70('0x47'),LISTID[_0x3d70('0x42')]())['where']('id\x20IN\x20?',squel[_0x3d70('0x4d')](hopperContacts))['where'](_0x3d70('0x48')))[_0x3d70('0x42')]();return _0x2644c3;}function _0x573b04(_0x733be7,_0x31871a){var _0x4d851b=squel[_0x3d70('0x36')]()['into'](_0x3d70('0x4e'))[_0x3d70('0x39')](['phone',_0x3d70('0x3b'),_0x3d70('0x25'),_0x31871a,_0x3d70('0x3c'),_0x3d70('0x3d')],squel['select']()[_0x3d70('0x40')](_0x3d70('0x3f'),'phone')[_0x3d70('0x40')]('id',_0x3d70('0x3b'))['field'](LISTID[_0x3d70('0x42')](),_0x3d70('0x25'))[_0x3d70('0x40')](_0x733be7['id']['toString'](),_0x31871a)[_0x3d70('0x40')](_0x3d70('0x41'),_0x3d70('0x3c'))[_0x3d70('0x40')]('NOW()',_0x3d70('0x3d'))[_0x3d70('0x43')]('cm_contacts')[_0x3d70('0x45')]('deletedAt\x20IS\x20NULL')[_0x3d70('0x45')](_0x3d70('0x47'),LISTID['toString']())[_0x3d70('0x45')](_0x3d70('0x4f'),squel[_0x3d70('0x4d')](hopperContacts))[_0x3d70('0x45')](_0x3d70('0x48')))[_0x3d70('0x42')]();return _0x4d851b;}return db[_0x3d70('0x50')][_0x3d70('0x51')]({'where':{'type':_0x3d70('0x52')},'attributes':['id',_0x3d70('0x53')],'include':[{'model':db[_0x3d70('0x54')],'as':_0x3d70('0x55'),'where':{'id':LISTID}}]})[_0x3d70('0x56')](function(_0x1a92ee){var _0x525db1=[];if(_0x1a92ee){var _0x46260f;for(var _0x5af039=0x0,_0x1e7acc;_0x5af039<_0x1a92ee[_0x3d70('0x27')];_0x5af039+=0x1){_0x1e7acc=_0x1a92ee[_0x5af039]['get']({'plain':!![]});switch(_0x1e7acc[_0x3d70('0x53')]){case _0x3d70('0x57'):_0x525db1[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x420b48(_0x1e7acc,_0x3d70('0x5a')))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));break;case'onlyIfOpen':_0x525db1['push'](db[_0x3d70('0x58')]['query'](_0x11568d(_0x1e7acc,'VoiceQueueId'))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));break;default:_0x525db1[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x2dbc72(_0x1e7acc,_0x3d70('0x5a')))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));}}}return _0x525db1;})['all']()[_0x3d70('0x56')](function(){return db[_0x3d70('0x50')][_0x3d70('0x51')]({'where':{'type':_0x3d70('0x52')},'attributes':['id'],'include':[{'model':db[_0x3d70('0x54')],'as':_0x3d70('0x5b'),'where':{'id':LISTID}}]})[_0x3d70('0x56')](function(_0xc350bc){var _0x5545cd=[];if(_0xc350bc){var _0x5458fa;for(var _0x52dd5b=0x0,_0x1dfd09;_0x52dd5b<_0xc350bc[_0x3d70('0x27')];_0x52dd5b+=0x1){_0x1dfd09=_0xc350bc[_0x52dd5b][_0x3d70('0x5c')]({'plain':!![]});_0x5545cd[_0x3d70('0x2e')](db['sequelize'][_0x3d70('0x59')](_0x573b04(_0x1dfd09,_0x3d70('0x5a')))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));}}return _0x5545cd;})[_0x3d70('0x5d')]();})[_0x3d70('0x56')](function(){return db[_0x3d70('0x5e')]['findAll']({'attributes':['id',_0x3d70('0x53')],'include':[{'model':db[_0x3d70('0x54')],'as':_0x3d70('0x55'),'where':{'id':LISTID}}]})[_0x3d70('0x56')](function(_0x170851){var _0x55a55f=[];if(_0x170851){for(var _0x5758e7=0x0,_0x28c641;_0x5758e7<_0x170851[_0x3d70('0x27')];_0x5758e7+=0x1){_0x28c641=_0x170851[_0x5758e7][_0x3d70('0x5c')]({'plain':!![]});switch(_0x28c641[_0x3d70('0x53')]){case _0x3d70('0x57'):_0x55a55f[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x420b48(_0x28c641,_0x3d70('0x5f')))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));break;case _0x3d70('0x60'):_0x55a55f[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x11568d(_0x28c641,_0x3d70('0x5f')))['then'](function(){})[_0x3d70('0x30')](_0xd33e3a()));break;default:_0x55a55f[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x2dbc72(_0x28c641,'CampaignId'))[_0x3d70('0x56')](function(){})[_0x3d70('0x30')](_0xd33e3a()));}}}return _0x55a55f;})[_0x3d70('0x5d')]();})[_0x3d70('0x56')](function(){return db[_0x3d70('0x5e')][_0x3d70('0x51')]({'attributes':['id'],'include':[{'model':db[_0x3d70('0x54')],'as':_0x3d70('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x1b379b){var _0x1eb00f=[];if(_0x1b379b){for(var _0x4076ec=0x0,_0x18b8bc;_0x4076ec<_0x1b379b[_0x3d70('0x27')];_0x4076ec+=0x1){_0x18b8bc=_0x1b379b[_0x4076ec][_0x3d70('0x5c')]({'plain':!![]});_0x1eb00f[_0x3d70('0x2e')](db[_0x3d70('0x58')][_0x3d70('0x59')](_0x573b04(_0x18b8bc,'CampaignId'))['then'](function(){})[_0x3d70('0x30')](_0xd33e3a()));}}return _0x1eb00f;})[_0x3d70('0x5d')]();})['catch'](function(_0x27c840){logger[_0x3d70('0x15')](_0x3d70('0x61'),_0x3d70('0x62'),_0x27c840[_0x3d70('0x32')]);});}var processPromises=function(_0x1a1d5f){return BPromise['all'](promises)[_0x3d70('0x56')](function(_0x4336a5){})['catch'](function(_0x5cabe7){logger[_0x3d70('0x15')](_0x3d70('0x63'),JSON[_0x3d70('0x64')](_0x5cabe7));})[_0x3d70('0x65')](function(){socket[_0x3d70('0x66')](_0x3d70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1a1d5f){return _0x1a1d5f['resume']();}});};var endCsv=function(){return BPromise[_0x3d70('0x68')]()[_0x3d70('0x56')](function(){if(hopperContacts){return checkHopper();}})[_0x3d70('0x56')](function(){socket['emit'](_0x3d70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x4fa697){logger[_0x3d70('0x15')](_0x3d70('0x69'),JSON[_0x3d70('0x64')](_0x4fa697));}finally{process[_0x3d70('0x6a')](0x0);}});};process['on'](_0x3d70('0x6b'),function(){logger[_0x3d70('0x6c')](_0x3d70('0x6d'));endCsv();});function main(){return BPromise[_0x3d70('0x68')]()[_0x3d70('0x56')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3d70('0x13')](',');return db[_0x3d70('0x2b')][_0x3d70('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x498534){var _0x44c4ea=fs[_0x3d70('0x6e')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3d70('0x6f')](_0x44c4ea,{'header':!![],'skipEmptyLines':!![],'step':function(_0x32bc6a,_0x536b5a){total+=0x1;var _0x4eac9d=total;promises[_0x3d70('0x2e')](checkRow(_0x32bc6a,_0x498534,_0x4eac9d)[_0x3d70('0x56')](function(){success+=0x1;})['catch'](function(_0x240111){if(_0x240111['error']){errors+=0x1;delete _0x240111[_0x3d70('0x15')];}else if(_0x240111[_0x3d70('0x29')]){duplicates+=0x1;delete _0x240111[_0x3d70('0x29')];}rows['push'](_0x240111);}));if(total%0xc8===0x0){_0x536b5a['pause']();return processPromises(_0x536b5a);}},'complete':function(){return processPromises()[_0x3d70('0x56')](function(){logger[_0x3d70('0x6c')](_0x3d70('0x70'));endCsv();});},'error':function(_0x5ac505,_0x853757){logger[_0x3d70('0x6c')]('CSV\x20parse\x20error',JSON[_0x3d70('0x64')](_0x5ac505));endCsv();}});})[_0x3d70('0x30')](function(_0x30267d){logger[_0x3d70('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x3d70('0x64')](_0x30267d));});}main(); \ No newline at end of file +var _0x6282=['ListId','CompanyId','length','find','CmContact','create','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper_final','id\x20IN\x20?','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','catch','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','map','message','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!'];(function(_0x33bb3c,_0x397352){var _0x2f21ef=function(_0x2b3009){while(--_0x2b3009){_0x33bb3c['push'](_0x33bb3c['shift']());}};_0x2f21ef(++_0x397352);}(_0x6282,0x184));var _0x2628=function(_0x2b04bf,_0x4703ae){_0x2b04bf=_0x2b04bf-0x0;var _0x176f42=_0x6282[_0x2b04bf];return _0x176f42;};'use strict';var BPromise=require('bluebird');var util=require(_0x2628('0x0'));var _=require(_0x2628('0x1'));var fs=require('fs');var squel=require(_0x2628('0x2'));var Papa=require(_0x2628('0x3'));var Redis=require(_0x2628('0x4'));var db=require(_0x2628('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x2628('0x6'));config[_0x2628('0x7')]=_[_0x2628('0x8')](config['redis'],{'host':_0x2628('0x9'),'port':0x18eb});var socket=require(_0x2628('0xa'))(new Redis(config[_0x2628('0x7')]));require(_0x2628('0xb'))['register'](socket);try{if(!process[_0x2628('0xc')][0x2]||process[_0x2628('0xc')][0x2]===_0x2628('0xd')||process[_0x2628('0xc')][0x2]===_0x2628('0xe')){throw new Error(_0x2628('0xf'));}var FILEPATH=process[_0x2628('0xc')][0x2];if(!process['argv'][0x3]||process[_0x2628('0xc')][0x3]===_0x2628('0xd')||process[_0x2628('0xc')][0x3]===_0x2628('0xe')||!process[_0x2628('0xc')][0x4]||process['argv'][0x4]===_0x2628('0xd')||process[_0x2628('0xc')][0x4]===_0x2628('0xe')){throw new Error(_0x2628('0x10'));}var FIELDS=_[_0x2628('0x11')](process['argv'][0x3][_0x2628('0x12')](','),process[_0x2628('0xc')][0x4][_0x2628('0x12')](','));if(!process['argv'][0x5]||process[_0x2628('0xc')][0x5]===_0x2628('0xd')||process[_0x2628('0xc')][0x5]===_0x2628('0xe')){throw new Error(_0x2628('0x13'));}var LISTID=process[_0x2628('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x2628('0xc')][0x6]!==_0x2628('0xd')&&process['argv'][0x6]!==_0x2628('0xe')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x2628('0xc')][0x7]!==_0x2628('0xd')&&process[_0x2628('0xc')][0x7]!==_0x2628('0xe')?process[_0x2628('0xc')][0x7]:null;if(!process[_0x2628('0xc')][0x8]||process['argv'][0x8]===_0x2628('0xd')||process[_0x2628('0xc')][0x8]==='null'){throw new Error(_0x2628('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x8cfb93){logger[_0x2628('0x15')](_0x8cfb93);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(_0x50651e,_0x267eec,_0x469e95,_0x3cc7c1){var _0x304611={'message':_0x267eec};_0x304611[_0x50651e]=!![];if(_0x469e95){_0x304611[_0x2628('0x16')]=_0x469e95;}if(_0x3cc7c1){_0x304611[_0x2628('0x17')]=_0x3cc7c1;}return _0x304611;}function isEmail(_0x5ba494){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))*$/[_0x2628('0x18')](_0x5ba494);}function checkRow(_0x1e7f54,_0x449f02,_0x586631){return new BPromise(function(_0x3feea3,_0xdad8e3){if(_[_0x2628('0x19')](_0x1e7f54)){return _0xdad8e3(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x586631));}if(_0x1e7f54[_0x2628('0x1a')]&&_0x1e7f54[_0x2628('0x1a')]['length']){var _0x54fc4c=_[_0x2628('0x1b')](_0x1e7f54[_0x2628('0x1a')],_0x2628('0x1c'))['join'](';');return _0xdad8e3(handleCheckRowError(_0x2628('0x15'),_0x54fc4c,null,_0x586631));}var _0x4847ba={};for(var _0x13f48a in FIELDS){if(FIELDS[_0x2628('0x1d')](_0x13f48a)&&FIELDS[_0x13f48a]){_0x4847ba[_0x13f48a]=_0x1e7f54['data'][0x0][FIELDS[_0x13f48a]]||_0x1e7f54['data'][0x0]['\ufeff'+FIELDS[_0x13f48a]];}}if(!_0x4847ba[_0x2628('0x1e')]){return _0xdad8e3(handleCheckRowError(_0x2628('0x15'),_0x2628('0x1f'),null,_0x586631));}if(!_0x4847ba[_0x2628('0x20')]){return _0xdad8e3(handleCheckRowError(_0x2628('0x15'),_0x2628('0x21'),null,_0x586631));}if(_0x4847ba[_0x2628('0x22')]){var _0x8cd74b=moment(_0x4847ba[_0x2628('0x22')],_0x2628('0x23'));if(!_0x8cd74b[_0x2628('0x24')]()){return _0xdad8e3(handleCheckRowError(_0x2628('0x15'),_0x2628('0x25'),null,_0x586631));}}if(_0x4847ba['email']){if(!isEmail(_0x4847ba[_0x2628('0x26')])){return _0xdad8e3(handleCheckRowError(_0x2628('0x15'),_0x2628('0x27'),null,_0x586631));}}_0x4847ba[_0x2628('0x28')]=LISTID;_0x4847ba[_0x2628('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2628('0x2a')]&&_0x449f02){var _0x2ac23c={};for(var _0x39cb2d=0x0,_0x5c664b=DUPLICATES['length'];_0x39cb2d<_0x5c664b;_0x39cb2d+=0x1){_0x2ac23c[DUPLICATES[_0x39cb2d]]=_0x4847ba[DUPLICATES[_0x39cb2d]];}var _0x14b49f=_[_0x2628('0x2b')](_0x449f02,_0x2ac23c);if(_0x14b49f){return _0xdad8e3(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x14b49f,_0x586631));}}return db[_0x2628('0x2c')][_0x2628('0x2d')](_0x4847ba,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4847ba)})[_0x2628('0x2e')](function(_0x140a79){if(DUPLICATES&&DUPLICATES['length']&&_0x449f02){_0x449f02[_0x2628('0x2f')](_['pick'](_0x4847ba,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x140a79['id'];return _0x3feea3();})['catch'](function(_0x19131d){return _0xdad8e3(handleCheckRowError('error',_0x2628('0x30')+(_0x19131d['message']||JSON[_0x2628('0x31')](_0x19131d)),null,_0x586631));});});}function checkHopper(){function _0x253ec6(){return function(_0x5edd34){logger[_0x2628('0x15')](_0x2628('0x32'),'checkHopper',util[_0x2628('0x33')](_0x5edd34,{'showHidden':![],'depth':null}));};}var _0x190398=function(_0x2be58c,_0x4aa041){var _0x233179=squel[_0x2628('0x34')]()[_0x2628('0x35')](_0x2628('0x36'))[_0x2628('0x37')]([_0x2628('0x20'),_0x2628('0x38'),_0x2628('0x39'),'ListId',_0x4aa041,_0x2628('0x3a'),'updatedAt'],squel[_0x2628('0x3b')]()['field'](_0x2628('0x20'),'phone')[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x38'))[_0x2628('0x3c')]('id',_0x2628('0x39'))[_0x2628('0x3c')](LISTID['toString'](),_0x2628('0x28'))[_0x2628('0x3c')](_0x2be58c['id']['toString'](),_0x4aa041)[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x3a'))[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x3e'))[_0x2628('0x3f')](_0x2628('0x40'))[_0x2628('0x41')](_0x2628('0x42'))[_0x2628('0x41')](_0x2628('0x43'),LISTID[_0x2628('0x44')]())[_0x2628('0x41')](_0x2628('0x45'))[_0x2628('0x41')](_0x2628('0x46'),squel[_0x2628('0x3b')]()[_0x2628('0x3c')](_0x2628('0x20'))[_0x2628('0x3f')](_0x2628('0x36'))[_0x2628('0x41')](_0x4aa041+_0x2628('0x47'),_0x2be58c['id'][_0x2628('0x44')]())))['toString']();return _0x233179;};var _0x3acb12=function(_0x2c79a9,_0x48ce0b){var _0x1a6d58=squel[_0x2628('0x34')]()[_0x2628('0x35')](_0x2628('0x36'))[_0x2628('0x37')]([_0x2628('0x20'),'scheduledAt','ContactId',_0x2628('0x28'),_0x48ce0b,_0x2628('0x3a'),_0x2628('0x3e')],squel[_0x2628('0x3b')]()[_0x2628('0x3c')](_0x2628('0x20'),'phone')['field'](_0x2628('0x3d'),_0x2628('0x38'))[_0x2628('0x3c')]('id',_0x2628('0x39'))[_0x2628('0x3c')](LISTID[_0x2628('0x44')](),_0x2628('0x28'))[_0x2628('0x3c')](_0x2c79a9['id'][_0x2628('0x44')](),_0x48ce0b)[_0x2628('0x3c')]('NOW()',_0x2628('0x3a'))[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x3e'))[_0x2628('0x3f')]('cm_contacts')[_0x2628('0x41')](_0x2628('0x42'))['where']('ListId\x20=\x20?',LISTID[_0x2628('0x44')]())[_0x2628('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x2628('0x45'))['where'](_0x2628('0x46'),squel[_0x2628('0x3b')]()[_0x2628('0x3c')]('calleridnum')['from'](_0x2628('0x48'))[_0x2628('0x41')](_0x48ce0b+'\x20=\x20?',_0x2c79a9['id'][_0x2628('0x44')]()))[_0x2628('0x41')](_0x2628('0x46'),squel['select']()[_0x2628('0x3c')]('phone')[_0x2628('0x3f')]('cm_hopper')[_0x2628('0x41')](_0x48ce0b+'\x20=\x20?',_0x2c79a9['id'][_0x2628('0x44')]())))[_0x2628('0x44')]();return _0x1a6d58;};function _0x208046(_0x210e03,_0xfb49a0){var _0x39a4d3=squel[_0x2628('0x34')]()[_0x2628('0x35')]('cm_hopper')[_0x2628('0x37')]([_0x2628('0x20'),_0x2628('0x38'),_0x2628('0x39'),_0x2628('0x28'),_0xfb49a0,_0x2628('0x3a'),_0x2628('0x3e')],squel[_0x2628('0x3b')]()['field'](_0x2628('0x20'),_0x2628('0x20'))[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x38'))[_0x2628('0x3c')]('id','ContactId')[_0x2628('0x3c')](LISTID[_0x2628('0x44')](),'ListId')[_0x2628('0x3c')](_0x210e03['id'][_0x2628('0x44')](),_0xfb49a0)['field'](_0x2628('0x3d'),_0x2628('0x3a'))[_0x2628('0x3c')](_0x2628('0x3d'),_0x2628('0x3e'))['from'](_0x2628('0x40'))[_0x2628('0x41')](_0x2628('0x42'))[_0x2628('0x41')](_0x2628('0x43'),LISTID[_0x2628('0x44')]())[_0x2628('0x41')](_0x2628('0x49'),squel[_0x2628('0x4a')](hopperContacts))[_0x2628('0x41')](_0x2628('0x45')))['toString']();return _0x39a4d3;}function _0x2c5627(_0x45890c,_0x25a456){var _0x15ed79=squel['insert']()[_0x2628('0x35')]('cm_hopper_black')['fromQuery'](['phone',_0x2628('0x39'),_0x2628('0x28'),_0x25a456,'createdAt',_0x2628('0x3e')],squel[_0x2628('0x3b')]()[_0x2628('0x3c')](_0x2628('0x20'),_0x2628('0x20'))['field']('id',_0x2628('0x39'))[_0x2628('0x3c')](LISTID['toString'](),_0x2628('0x28'))['field'](_0x45890c['id'][_0x2628('0x44')](),_0x25a456)[_0x2628('0x3c')]('NOW()',_0x2628('0x3a'))[_0x2628('0x3c')](_0x2628('0x3d'),'updatedAt')[_0x2628('0x3f')](_0x2628('0x40'))['where'](_0x2628('0x42'))[_0x2628('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x2628('0x41')](_0x2628('0x45')))[_0x2628('0x44')]();return _0x15ed79;}return db[_0x2628('0x4b')][_0x2628('0x4c')]({'where':{'type':_0x2628('0x4d')},'attributes':['id',_0x2628('0x4e')],'include':[{'model':db[_0x2628('0x4f')],'as':_0x2628('0x50'),'where':{'id':LISTID}}]})[_0x2628('0x2e')](function(_0x4f70e1){var _0x5d53c3=[];if(_0x4f70e1){var _0x51ac17;for(var _0x55213f=0x0,_0x1a9ae6;_0x55213f<_0x4f70e1[_0x2628('0x2a')];_0x55213f+=0x1){_0x1a9ae6=_0x4f70e1[_0x55213f][_0x2628('0x51')]({'plain':!![]});switch(_0x1a9ae6[_0x2628('0x4e')]){case _0x2628('0x52'):_0x5d53c3[_0x2628('0x2f')](db[_0x2628('0x53')][_0x2628('0x54')](_0x3acb12(_0x1a9ae6,_0x2628('0x55')))[_0x2628('0x2e')](function(){})[_0x2628('0x56')](_0x253ec6()));break;case'onlyIfOpen':_0x5d53c3[_0x2628('0x2f')](db[_0x2628('0x53')][_0x2628('0x54')](_0x190398(_0x1a9ae6,'VoiceQueueId'))[_0x2628('0x2e')](function(){})[_0x2628('0x56')](_0x253ec6()));break;default:_0x5d53c3[_0x2628('0x2f')](db['sequelize'][_0x2628('0x54')](_0x208046(_0x1a9ae6,_0x2628('0x55')))['then'](function(){})[_0x2628('0x56')](_0x253ec6()));}}}return _0x5d53c3;})[_0x2628('0x57')]()[_0x2628('0x2e')](function(){return db[_0x2628('0x4b')]['findAll']({'where':{'type':_0x2628('0x4d')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x2628('0x2e')](function(_0xf735f5){var _0x2c89d0=[];if(_0xf735f5){var _0x46fc15;for(var _0x2216b5=0x0,_0x389cb6;_0x2216b5<_0xf735f5[_0x2628('0x2a')];_0x2216b5+=0x1){_0x389cb6=_0xf735f5[_0x2216b5][_0x2628('0x51')]({'plain':!![]});_0x2c89d0[_0x2628('0x2f')](db[_0x2628('0x53')]['query'](_0x2c5627(_0x389cb6,_0x2628('0x55')))[_0x2628('0x2e')](function(){})[_0x2628('0x56')](_0x253ec6()));}}return _0x2c89d0;})[_0x2628('0x57')]();})[_0x2628('0x2e')](function(){return db[_0x2628('0x58')]['findAll']({'attributes':['id',_0x2628('0x4e')],'include':[{'model':db[_0x2628('0x4f')],'as':_0x2628('0x50'),'where':{'id':LISTID}}]})[_0x2628('0x2e')](function(_0x236b4f){var _0x496d4f=[];if(_0x236b4f){for(var _0x377844=0x0,_0x48d789;_0x377844<_0x236b4f[_0x2628('0x2a')];_0x377844+=0x1){_0x48d789=_0x236b4f[_0x377844][_0x2628('0x51')]({'plain':!![]});switch(_0x48d789[_0x2628('0x4e')]){case _0x2628('0x52'):_0x496d4f[_0x2628('0x2f')](db['sequelize'][_0x2628('0x54')](_0x3acb12(_0x48d789,'CampaignId'))['then'](function(){})[_0x2628('0x56')](_0x253ec6()));break;case'onlyIfOpen':_0x496d4f[_0x2628('0x2f')](db[_0x2628('0x53')][_0x2628('0x54')](_0x190398(_0x48d789,_0x2628('0x59')))['then'](function(){})[_0x2628('0x56')](_0x253ec6()));break;default:_0x496d4f[_0x2628('0x2f')](db['sequelize']['query'](_0x208046(_0x48d789,_0x2628('0x59')))[_0x2628('0x2e')](function(){})['catch'](_0x253ec6()));}}}return _0x496d4f;})[_0x2628('0x57')]();})['then'](function(){return db['Campaign'][_0x2628('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x2628('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x3541f6){var _0x329568=[];if(_0x3541f6){for(var _0x3f99c7=0x0,_0x2e30b8;_0x3f99c7<_0x3541f6[_0x2628('0x2a')];_0x3f99c7+=0x1){_0x2e30b8=_0x3541f6[_0x3f99c7]['get']({'plain':!![]});_0x329568[_0x2628('0x2f')](db[_0x2628('0x53')][_0x2628('0x54')](_0x2c5627(_0x2e30b8,_0x2628('0x59')))[_0x2628('0x2e')](function(){})[_0x2628('0x56')](_0x253ec6()));}}return _0x329568;})['all']();})[_0x2628('0x56')](function(_0x168237){logger[_0x2628('0x15')](_0x2628('0x5b'),_0x2628('0x5c'),_0x168237['message']);});}var processPromises=function(_0x5470e5){return BPromise[_0x2628('0x57')](promises)['then'](function(_0x6e23b6){})[_0x2628('0x56')](function(_0x3b7438){logger[_0x2628('0x15')](_0x2628('0x5d'),JSON[_0x2628('0x31')](_0x3b7438));})['finally'](function(){socket[_0x2628('0x5e')](_0x2628('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5470e5){return _0x5470e5[_0x2628('0x60')]();}});};var endCsv=function(){return BPromise[_0x2628('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x2628('0x2e')](function(){socket['emit'](_0x2628('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2628('0x62')](FILEPATH);}catch(_0x6f628b){logger[_0x2628('0x15')](_0x2628('0x63'),JSON[_0x2628('0x31')](_0x6f628b));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x2628('0x64')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x2628('0x61')]()[_0x2628('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2628('0x12')](',');return db[_0x2628('0x2c')][_0x2628('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2628('0x2e')](function(_0x556511){var _0x15afd6=fs[_0x2628('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2628('0x66')](_0x15afd6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2db955,_0x1d025a){total+=0x1;var _0x341fd6=total;promises[_0x2628('0x2f')](checkRow(_0x2db955,_0x556511,_0x341fd6)[_0x2628('0x2e')](function(){success+=0x1;})['catch'](function(_0x5594ef){if(_0x5594ef[_0x2628('0x15')]){errors+=0x1;delete _0x5594ef[_0x2628('0x15')];}else if(_0x5594ef[_0x2628('0x67')]){duplicates+=0x1;delete _0x5594ef[_0x2628('0x67')];}rows[_0x2628('0x2f')](_0x5594ef);}));if(total%0xc8===0x0){_0x1d025a[_0x2628('0x68')]();return processPromises(_0x1d025a);}},'complete':function(){return processPromises()[_0x2628('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x539d79,_0x446b7b){logger[_0x2628('0x64')](_0x2628('0x69'),JSON['stringify'](_0x539d79));endCsv();}});})[_0x2628('0x56')](function(_0x36dc8c){logger[_0x2628('0x15')](_0x2628('0x6a'),JSON[_0x2628('0x31')](_0x36dc8c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c5e5c50..6a8ecae 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 _0xf9f9=['ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','where','\x22always\x22','cm_contacts.ListId','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x20=\x20?','toString','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','Received\x20SIGINT','error','message','exit','errors','push','code','info','sequelize','query','spread','catch','main','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','length','rows','trim','data','replace','isValid','isNaN','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xf9f9,0x16f));var _0x9f9f=function(_0x133935,_0x127704){_0x133935=_0x133935-0x0;var _0x5f169=_0xf9f9[_0x133935];return _0x5f169;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x9f9f('0x0'));var Papa=require(_0x9f9f('0x1'));var util=require(_0x9f9f('0x2'));var BPromise=require(_0x9f9f('0x3'));var moment=require(_0x9f9f('0x4'));var squel=require(_0x9f9f('0x5'));var Redis=require(_0x9f9f('0x6'));var db=require(_0x9f9f('0x7'))['db'];var config=require(_0x9f9f('0x8'));var logger=require(_0x9f9f('0x9'))(_0x9f9f('0xa'));config['redis']=_[_0x9f9f('0xb')](config[_0x9f9f('0xc')],{'host':_0x9f9f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f9f('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9f9f('0xe')](_0x9f9f('0xf'));function isEmail(_0x3e9114){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))*$/[_0x9f9f('0x10')](_0x3e9114);}function selectNotIn(_0x1a20f5,_0x4ee109,_0x551279,_0x3d4813,_0x4adb20){return squel[_0x9f9f('0x11')]()[_0x9f9f('0x12')](_0x9f9f('0x13'))[_0x9f9f('0x14')](_0x3d4813)[_0x9f9f('0x15')](_0x4ee109,null,_0x4ee109+_0x9f9f('0x16')+_0x3d4813+'.'+_0x551279)['where'](_0x3d4813+'.'+_0x551279+_0x9f9f('0x17')+_0x1a20f5+'.'+_0x551279)['where'](_0x4ee109+_0x9f9f('0x18')+_0x4adb20['join']()+')');}function insertCmHopper(_0x58c939,_0x112733,_0x2e4cea,_0x755898,_0x274000){var _0x1472eb=[_0x9f9f('0x19'),'cm_contacts.scheduledat',_0x9f9f('0x1a'),'cm_contacts.ListId',_0x112733+'.'+_0x755898,_0x9f9f('0x1b'),_0x9f9f('0x1c'),_0x9f9f('0x1d'),_0x9f9f('0x1e'),'\x22'+_0x274000+'\x22'];return squel[_0x9f9f('0x1f')]()[_0x9f9f('0x20')](_0x9f9f('0x21'))[_0x9f9f('0x22')]([_0x9f9f('0x13'),'scheduledat',_0x9f9f('0x23'),_0x9f9f('0x24'),_0x755898,_0x9f9f('0x25'),_0x9f9f('0x26'),_0x9f9f('0x27'),_0x9f9f('0x28'),_0x9f9f('0x29')],squel[_0x9f9f('0x11')]()[_0x9f9f('0x2a')](_0x1472eb)[_0x9f9f('0x14')](_0x112733)['join'](_0x9f9f('0x2b'),null,_0x9f9f('0x2c')+_0x112733+_0x9f9f('0x2d'))[_0x9f9f('0x15')](_0x2e4cea,null,_0x2e4cea+_0x9f9f('0x16')+_0x112733+'.'+_0x755898)['where'](_0x112733+_0x9f9f('0x2e'),_0x58c939)[_0x9f9f('0x2f')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9f9f('0x2f')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x112733,_0x2e4cea,_0x755898,_0x9f9f('0x21'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x9f9f('0x2f')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x112733,_0x2e4cea,_0x755898,_0x9f9f('0x21'),[_0x9f9f('0x30')])))['toString']();}function insertCmHopperBlack(_0x3a5e04,_0x5bea47,_0x40c53d,_0x577865){var _0x43577b=['cm_contacts.phone',_0x9f9f('0x1a'),_0x9f9f('0x31'),_0x5bea47+'.'+_0x577865,_0x9f9f('0x1b'),'cm_contacts.updatedAt'];return squel['insert']()[_0x9f9f('0x20')](_0x9f9f('0x32'))[_0x9f9f('0x22')](['phone',_0x9f9f('0x23'),_0x9f9f('0x24'),_0x577865,_0x9f9f('0x25'),'updatedAt'],squel[_0x9f9f('0x11')]()[_0x9f9f('0x2a')](_0x43577b)['from'](_0x5bea47)[_0x9f9f('0x15')](_0x9f9f('0x2b'),null,_0x9f9f('0x2c')+_0x5bea47+_0x9f9f('0x2d'))[_0x9f9f('0x15')](_0x40c53d,null,_0x40c53d+'.id\x20=\x20'+_0x5bea47+'.'+_0x577865)['where'](_0x5bea47+_0x9f9f('0x2e'),_0x3a5e04)['where'](_0x9f9f('0x33'),NOW)[_0x9f9f('0x2f')](_0x9f9f('0x34'),squel[_0x9f9f('0x11')]()[_0x9f9f('0x12')](_0x9f9f('0x13'))[_0x9f9f('0x14')](_0x9f9f('0x32'))[_0x9f9f('0x2f')]('ListId\x20=\x20?',_0x3a5e04)[_0x9f9f('0x2f')](_0x577865+_0x9f9f('0x35'),_0x5bea47+'.'+_0x577865)))[_0x9f9f('0x36')]();}function insertCmContact(_0x157761,_0x306247,_0x354e1e,_0x337c3a){var _0x30457e=_[_0x9f9f('0x37')](_['keys'](_0x337c3a),[_0x9f9f('0x24'),_0x9f9f('0x38'),'createdAt','updatedAt']);return squel[_0x9f9f('0x1f')]()[_0x9f9f('0x20')](_0x9f9f('0x2b'))[_0x9f9f('0x22')](_0x30457e,squel['select']()['fields'](_0x30457e)[_0x9f9f('0x14')](_0x306247)[_0x9f9f('0x2f')]('('+_0x354e1e[_0x9f9f('0x15')](',')+_0x9f9f('0x39'),squel[_0x9f9f('0x11')]()[_0x9f9f('0x2a')](_0x354e1e)[_0x9f9f('0x14')]('cm_contacts')[_0x9f9f('0x2f')](_0x9f9f('0x3a'),_0x157761)['where'](_0x9f9f('0x3b')))[_0x9f9f('0x2f')](_0x9f9f('0x3c'),squel['select']()['field']('MIN(id)','min_id')[_0x9f9f('0x14')](_0x306247)['group'](_0x354e1e[_0x9f9f('0x15')](','))))['toString']();}function handleStop(){logger['info'](_0x9f9f('0x3d'));stopped=!![];}function handleUncaughtException(_0x35055c){logger[_0x9f9f('0x3e')](_0x35055c[_0x9f9f('0x3f')]);process[_0x9f9f('0x40')](0x1);}function handleError(_0x2bc8ad,_0x21a09b){stats[_0x9f9f('0x41')][_0x9f9f('0x42')]({'name':_0x21a09b[_0x9f9f('0x43')],'message':_0x21a09b[_0x9f9f('0x3f')],'row':_0x2bc8ad});}function handleQuery(_0x445550){logger[_0x9f9f('0x44')](_0x445550);return db[_0x9f9f('0x45')][_0x9f9f('0x46')](_0x445550)[_0x9f9f('0x47')](function(_0xbd42ac){results['push'](_0xbd42ac);})[_0x9f9f('0x48')](function(_0x274b6a){logger[_0x9f9f('0x3e')](_0x274b6a[_0x9f9f('0x3f')]);});}function main(_0x5a648b,_0x53c678,_0x150e71,_0x128367){logger[_0x9f9f('0x44')](_0x9f9f('0x49'),_0x5a648b,JSON[_0x9f9f('0x4a')](_0x53c678));process['send']('start');var _0x3e2a6c=_0x53c678[_0x9f9f('0x4b')];var _0x12a074=_0x53c678[_0x9f9f('0x4c')];var _0xc37cc8=path[_0x9f9f('0x15')](config[_0x9f9f('0x4d')],_0x9f9f('0x4e'),_0x12a074+_0x9f9f('0x4f'));var _0x2004b3=_['keys'](_0x3e2a6c)[_0x9f9f('0x15')]();logger[_0x9f9f('0x44')]('header',_0x2004b3);fs[_0x9f9f('0x50')](_0xc37cc8,_0x2004b3+'\x0a');Papa[_0x9f9f('0x51')](fs[_0x9f9f('0x52')](_0x5a648b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c74e8,_0x2ba598){try{for(var _0x17ff5e=0x0,_0x3e5de5=[];_0x17ff5e<_0x1c74e8['data'][_0x9f9f('0x53')];_0x17ff5e++){stats[_0x9f9f('0x54')]+=0x1;if(_0x1c74e8['errors'][_0x17ff5e]){handleError(_0x1c74e8['data'][_0x17ff5e],_0x1c74e8[_0x9f9f('0x41')][_0x17ff5e]);}else{var _0x298deb=[];for(var _0x4b9488 in _0x3e2a6c){if(_0x3e2a6c['hasOwnProperty'](_0x4b9488)){if(_0x1c74e8['data'][_0x17ff5e][_0x3e2a6c[_0x4b9488]]){var _0x265d17=_[_0x9f9f('0x55')](_0x1c74e8[_0x9f9f('0x56')][_0x17ff5e][_0x3e2a6c[_0x4b9488]][_0x9f9f('0x57')](/"/g,'\x27'));switch(_0x4b9488){case'scheduledat':var _0x252164=moment(_0x265d17,_0x9f9f('0xf'),!![]);if(_0x252164[_0x9f9f('0x58')]()){_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x265d17+'\x22');}else{_0x298deb[_0x9f9f('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x9f9f('0x27'):var _0x13e404=parseInt(_0x265d17);_0x265d17=_[_0x9f9f('0x59')](_0x13e404)||_0x13e404<0x0||_0x13e404>0x4?_0x128367?0x3:0x2:_0x13e404;_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x265d17+'\x22');break;case _0x9f9f('0x28'):var _0x41c366=parseInt(_0x265d17);if(_['isNumber'](_0x41c366)&&_[_0x9f9f('0x5a')](_0x150e71,_0x41c366)){_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x41c366+'\x22');}else{_0x298deb[_0x9f9f('0x42')](_0x9f9f('0x5b'));}break;case _0x9f9f('0x5c'):if(isEmail(_0x265d17)){_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x265d17+'\x22');}else{_0x298deb['push']('email\x20wrong\x20format');}break;case _0x9f9f('0x5d'):var _0xa5b581=moment(_0x265d17,_0x9f9f('0x5e'),!![]);if(_0xa5b581[_0x9f9f('0x58')]()){_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x265d17+'\x22');}else{_0x298deb[_0x9f9f('0x42')](_0x9f9f('0x5f'));}break;default:_0x3e5de5[_0x9f9f('0x42')]('\x22'+_0x265d17+'\x22');}}else{switch(_0x4b9488){case _0x9f9f('0x60'):case _0x9f9f('0x13'):_0x298deb[_0x9f9f('0x42')](_0x4b9488+'\x20not\x20specified');break;default:_0x3e5de5[_0x9f9f('0x42')]('\x22\x22');}}}}if(_0x298deb[_0x9f9f('0x53')]){handleError(_0x1c74e8['data'][_0x17ff5e],{'code':_0x9f9f('0x61'),'message':_0x298deb[_0x9f9f('0x15')]()});}else{fs[_0x9f9f('0x62')](_0xc37cc8,_0x3e5de5[_0x9f9f('0x15')]()+'\x0a');}_0x3e5de5=[];}if(!(stats['rows']%0xc8)){socket[_0x9f9f('0x63')](_0x9f9f('0x64')+_0x12a074,stats);stats[_0x9f9f('0x41')]=[];}}if(stopped){logger[_0x9f9f('0x44')](_0x9f9f('0x65'));_0x2ba598['abort']();}}catch(_0x3c88a6){handleError(_0x1c74e8[_0x9f9f('0x56')][_0x17ff5e],{'code':_0x9f9f('0x66'),'message':_0x3c88a6[_0x9f9f('0x3f')]});logger['error'](_0x9f9f('0x67'),_0x3c88a6[_0x9f9f('0x3f')]);}},'complete':function(){try{var _0x1be14b=[];var _0x772b8a=_0x9f9f('0x2b');if(_0x53c678[_0x9f9f('0x68')]&&_0x53c678[_0x9f9f('0x68')]['length']){_0x772b8a=_0x9f9f('0x69')+_0x12a074;_0x1be14b[_0x9f9f('0x42')]('CREATE\x20TABLE\x20'+_0x772b8a+_0x9f9f('0x6a'));}var _0x4703ce=util[_0x9f9f('0xe')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0xc37cc8,_0x772b8a,_0x2004b3,_0x53c678['ListId'],_0x53c678[_0x9f9f('0x38')]||null,NOW,NOW);if(_[_0x9f9f('0x6b')](_0x3e2a6c[_0x9f9f('0x6c')])){_0x4703ce+=_0x9f9f('0x6d');}_0x1be14b['push'](_0x4703ce);if(_0x53c678[_0x9f9f('0x68')]&&_0x53c678[_0x9f9f('0x68')][_0x9f9f('0x53')]){_0x1be14b['push'](insertCmContact(_0x53c678[_0x9f9f('0x24')],_0x772b8a,_0x53c678['duplicates'],_0x3e2a6c));_0x1be14b[_0x9f9f('0x42')](_0x9f9f('0x6e')+_0x772b8a+';');}_0x1be14b[_0x9f9f('0x42')](insertCmHopper(_0x53c678['ListId'],_0x9f9f('0x6f'),_0x9f9f('0x70'),_0x9f9f('0x71'),_0x128367));_0x1be14b['push'](insertCmHopperBlack(_0x53c678[_0x9f9f('0x24')],'voice_queues_has_cm_blacklists',_0x9f9f('0x70'),_0x9f9f('0x71')));_0x1be14b[_0x9f9f('0x42')](insertCmHopper(_0x53c678[_0x9f9f('0x24')],_0x9f9f('0x72'),_0x9f9f('0x73'),_0x9f9f('0x74'),_0x128367));_0x1be14b[_0x9f9f('0x42')](insertCmHopperBlack(_0x53c678['ListId'],_0x9f9f('0x75'),'campaigns',_0x9f9f('0x74')));BPromise[_0x9f9f('0x76')](_0x1be14b,handleQuery)['then'](function(_0x231d1a){stats[_0x9f9f('0x77')]=!![];stats[_0x9f9f('0x78')]=_0x53c678[_0x9f9f('0x68')]&&_0x53c678[_0x9f9f('0x68')][_0x9f9f('0x53')]?results[0x2][_0x9f9f('0x78')]:results[0x0][_0x9f9f('0x78')];socket[_0x9f9f('0x63')](_0x9f9f('0x64')+_0x12a074,stats);fs['unlink'](_0x5a648b);fs[_0x9f9f('0x79')](_0xc37cc8);process['exit'](0x0);})['catch'](function(_0x13d6ab){logger[_0x9f9f('0x3e')](_0x13d6ab['message']);process['exit'](0x1);});}catch(_0x1b841f){logger[_0x9f9f('0x3e')](_0x9f9f('0x7a'),_0x1b841f[_0x9f9f('0x3f')]);process[_0x9f9f('0x40')](0x1);}},'error':function(_0x2fd60d,_0x176be4,_0x1991ad,_0x3bcf3f){throw new Error(_0x3bcf3f);}});}function validate(){if(process[_0x9f9f('0x7b')]&&process['argv'][_0x9f9f('0x53')]<0x4){throw new Error(_0x9f9f('0x7c'));}var _0x3a34df=path[_0x9f9f('0x15')](config['root'],'server/files/tmp',process[_0x9f9f('0x7b')][0x2]);if(!fs[_0x9f9f('0x7d')](_0x3a34df)){throw new Error(_0x9f9f('0x7e'));}var _0x33c794={};try{_0x33c794=JSON['parse'](process[_0x9f9f('0x7b')][0x3]);if(!_0x33c794[_0x9f9f('0x4b')]){throw new Error(_0x9f9f('0x7f'));}if(!_0x33c794[_0x9f9f('0x4b')][_0x9f9f('0x13')]){throw new Error(_0x9f9f('0x80'));}if(!_0x33c794['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x4e1953=0x0;if(_0x33c794[_0x9f9f('0x4b')][_0x9f9f('0x28')]){_0x4e1953=0x1;}if(!_0x33c794[_0x9f9f('0x24')]){throw new Error(_0x9f9f('0x81'));}}catch(_0x47175f){throw new Error(_0x9f9f('0x82'));}var _0x3c28b4=[];try{_0x3c28b4=_[_0x9f9f('0x83')](JSON[_0x9f9f('0x51')](process[_0x9f9f('0x7b')][0x4]),'id');}catch(_0x40b50a){logger['info']('No\x20agent\x20available');}main(_0x3a34df,_0x33c794,_0x3c28b4,_0x4e1953);}validate();process['on'](_0x9f9f('0x84'),handleStop);process['on'](_0x9f9f('0x85'),handleUncaughtException); \ No newline at end of file +var _0x02b5=['start','socket_timestamp','root','server/files/tmp','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','then','finish','affectedRows','unlink','argv','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','cm_hopper_black','cm_contacts','\x20=\x20?','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','query','spread','catch','main','stringify'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x02b5,0x1c1));var _0x502b=function(_0xd8baf3,_0x238fd0){_0xd8baf3=_0xd8baf3-0x0;var _0x492838=_0x02b5[_0xd8baf3];return _0x492838;};'use strict';var fs=require('fs');var path=require(_0x502b('0x0'));var _=require(_0x502b('0x1'));var Papa=require('papaparse');var util=require(_0x502b('0x2'));var BPromise=require(_0x502b('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x502b('0x4'));var db=require(_0x502b('0x5'))['db'];var config=require(_0x502b('0x6'));var logger=require('../../../config/logger')(_0x502b('0x7'));config[_0x502b('0x8')]=_[_0x502b('0x9')](config['redis'],{'host':_0x502b('0xa'),'port':0x18eb});var socket=require(_0x502b('0xb'))(new Redis(config[_0x502b('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x502b('0xc'));function isEmail(_0x2c2a30){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'](_0x2c2a30);}function selectNotIn(_0x3bfd73,_0x2f0f8f,_0x4007ed,_0x286cd0,_0xb1d9e0){return squel[_0x502b('0xd')]()[_0x502b('0xe')](_0x502b('0xf'))[_0x502b('0x10')](_0x286cd0)[_0x502b('0x11')](_0x2f0f8f,null,_0x2f0f8f+_0x502b('0x12')+_0x286cd0+'.'+_0x4007ed)['where'](_0x286cd0+'.'+_0x4007ed+_0x502b('0x13')+_0x3bfd73+'.'+_0x4007ed)[_0x502b('0x14')](_0x2f0f8f+'.dialCheckDuplicateType\x20IN\x20('+_0xb1d9e0[_0x502b('0x11')]()+')');}function insertCmHopper(_0x1a97bc,_0x299c1b,_0x37f184,_0x4dc342,_0x2e0588){var _0x559bbc=[_0x502b('0x15'),'cm_contacts.scheduledat',_0x502b('0x16'),_0x502b('0x17'),_0x299c1b+'.'+_0x4dc342,_0x502b('0x18'),_0x502b('0x19'),_0x502b('0x1a'),_0x502b('0x1b'),'\x22'+_0x2e0588+'\x22'];return squel[_0x502b('0x1c')]()['into'](_0x502b('0x1d'))[_0x502b('0x1e')]([_0x502b('0xf'),_0x502b('0x1f'),_0x502b('0x20'),'ListId',_0x4dc342,_0x502b('0x21'),_0x502b('0x22'),_0x502b('0x23'),_0x502b('0x24'),'recallme'],squel[_0x502b('0xd')]()[_0x502b('0x25')](_0x559bbc)[_0x502b('0x10')](_0x299c1b)['join']('cm_contacts',null,_0x502b('0x26')+_0x299c1b+'.CmListId')['join'](_0x37f184,null,_0x37f184+'.id\x20=\x20'+_0x299c1b+'.'+_0x4dc342)[_0x502b('0x14')](_0x299c1b+_0x502b('0x27'),_0x1a97bc)['where'](_0x502b('0x28'),NOW)[_0x502b('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x299c1b,_0x37f184,_0x4dc342,_0x502b('0x1d'),[_0x502b('0x29'),_0x502b('0x2a')]))[_0x502b('0x14')](_0x502b('0x2b'),selectNotIn(_0x299c1b,_0x37f184,_0x4dc342,_0x502b('0x1d'),[_0x502b('0x29')])))[_0x502b('0x2c')]();}function insertCmHopperBlack(_0x25b42e,_0x53bfab,_0x55c16c,_0x1b88a7){var _0x37a552=['cm_contacts.phone',_0x502b('0x16'),_0x502b('0x17'),_0x53bfab+'.'+_0x1b88a7,_0x502b('0x18'),_0x502b('0x19')];return squel['insert']()[_0x502b('0x2d')](_0x502b('0x2e'))['fromQuery']([_0x502b('0xf'),'ContactId','ListId',_0x1b88a7,_0x502b('0x21'),_0x502b('0x22')],squel[_0x502b('0xd')]()[_0x502b('0x25')](_0x37a552)['from'](_0x53bfab)['join'](_0x502b('0x2f'),null,'cm_contacts.ListId\x20=\x20'+_0x53bfab+'.CmListId')[_0x502b('0x11')](_0x55c16c,null,_0x55c16c+_0x502b('0x12')+_0x53bfab+'.'+_0x1b88a7)['where'](_0x53bfab+_0x502b('0x27'),_0x25b42e)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x502b('0xe')]('phone')['from'](_0x502b('0x2e'))[_0x502b('0x14')]('ListId\x20=\x20?',_0x25b42e)[_0x502b('0x14')](_0x1b88a7+_0x502b('0x30'),_0x53bfab+'.'+_0x1b88a7)))[_0x502b('0x2c')]();}function insertCmContact(_0x2617de,_0x30b3f9,_0x254382,_0x1195ee){var _0x3ea361=_['concat'](_[_0x502b('0x31')](_0x1195ee),[_0x502b('0x32'),_0x502b('0x33'),'createdAt','updatedAt']);return squel[_0x502b('0x1c')]()[_0x502b('0x2d')](_0x502b('0x2f'))[_0x502b('0x1e')](_0x3ea361,squel[_0x502b('0xd')]()[_0x502b('0x25')](_0x3ea361)[_0x502b('0x10')](_0x30b3f9)[_0x502b('0x14')]('('+_0x254382[_0x502b('0x11')](',')+_0x502b('0x34'),squel[_0x502b('0xd')]()[_0x502b('0x25')](_0x254382)[_0x502b('0x10')](_0x502b('0x2f'))[_0x502b('0x14')]('ListId\x20=\x20?',_0x2617de)[_0x502b('0x14')](_0x502b('0x35')))[_0x502b('0x14')](_0x502b('0x36'),squel[_0x502b('0xd')]()[_0x502b('0xe')](_0x502b('0x37'),_0x502b('0x38'))['from'](_0x30b3f9)[_0x502b('0x39')](_0x254382['join'](','))))[_0x502b('0x2c')]();}function handleStop(){logger[_0x502b('0x3a')](_0x502b('0x3b'));stopped=!![];}function handleUncaughtException(_0x57303b){logger[_0x502b('0x3c')](_0x57303b[_0x502b('0x3d')]);process[_0x502b('0x3e')](0x1);}function handleError(_0x206a72,_0x46cde0){stats[_0x502b('0x3f')][_0x502b('0x40')]({'name':_0x46cde0[_0x502b('0x41')],'message':_0x46cde0['message'],'row':_0x206a72});}function handleQuery(_0x5d29e6){logger[_0x502b('0x3a')](_0x5d29e6);return db['sequelize'][_0x502b('0x42')](_0x5d29e6)[_0x502b('0x43')](function(_0x861b88){results[_0x502b('0x40')](_0x861b88);})[_0x502b('0x44')](function(_0x59e80d){logger[_0x502b('0x3c')](_0x59e80d['message']);});}function main(_0xd85985,_0x1b4eca,_0x5956bd,_0xc4c1bb){logger[_0x502b('0x3a')](_0x502b('0x45'),_0xd85985,JSON[_0x502b('0x46')](_0x1b4eca));process['send'](_0x502b('0x47'));var _0x4956ce=_0x1b4eca['binding'];var _0x1b893a=_0x1b4eca[_0x502b('0x48')];var _0x4670eb=path[_0x502b('0x11')](config[_0x502b('0x49')],_0x502b('0x4a'),_0x1b893a+'.csv');var _0xb05bb4=_[_0x502b('0x31')](_0x4956ce)['join']();logger['info']('header',_0xb05bb4);fs[_0x502b('0x4b')](_0x4670eb,_0xb05bb4+'\x0a');Papa[_0x502b('0x4c')](fs[_0x502b('0x4d')](_0xd85985),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1b3ed9,_0x1a9091){try{for(var _0x4a3200=0x0,_0x5ed675=[];_0x4a3200<_0x1b3ed9[_0x502b('0x4e')][_0x502b('0x4f')];_0x4a3200++){stats[_0x502b('0x50')]+=0x1;if(_0x1b3ed9[_0x502b('0x3f')][_0x4a3200]){handleError(_0x1b3ed9['data'][_0x4a3200],_0x1b3ed9['errors'][_0x4a3200]);}else{var _0x52995e=[];for(var _0x10e589 in _0x4956ce){if(_0x4956ce[_0x502b('0x51')](_0x10e589)){if(_0x1b3ed9[_0x502b('0x4e')][_0x4a3200][_0x4956ce[_0x10e589]]){var _0x259507=_[_0x502b('0x52')](_0x1b3ed9['data'][_0x4a3200][_0x4956ce[_0x10e589]][_0x502b('0x53')](/"/g,'\x27'));switch(_0x10e589){case'scheduledat':var _0x587855=moment(_0x259507,_0x502b('0xc'),!![]);if(_0x587855[_0x502b('0x54')]()){_0x5ed675[_0x502b('0x40')]('\x22'+_0x259507+'\x22');}else{_0x52995e[_0x502b('0x40')](_0x502b('0x55'));}break;case'priority':var _0x384d34=parseInt(_0x259507);_0x259507=_['isNaN'](_0x384d34)||_0x384d34<0x0||_0x384d34>0x4?_0xc4c1bb?0x3:0x2:_0x384d34;_0x5ed675['push']('\x22'+_0x259507+'\x22');break;case _0x502b('0x24'):var _0x445f96=parseInt(_0x259507);if(_[_0x502b('0x56')](_0x445f96)&&_[_0x502b('0x57')](_0x5956bd,_0x445f96)){_0x5ed675[_0x502b('0x40')]('\x22'+_0x445f96+'\x22');}else{_0x52995e['push']('agent\x20not\x20exists');}break;case _0x502b('0x58'):if(isEmail(_0x259507)){_0x5ed675[_0x502b('0x40')]('\x22'+_0x259507+'\x22');}else{_0x52995e['push'](_0x502b('0x59'));}break;case _0x502b('0x5a'):var _0x57c1ca=moment(_0x259507,_0x502b('0x5b'),!![]);if(_0x57c1ca[_0x502b('0x54')]()){_0x5ed675['push']('\x22'+_0x259507+'\x22');}else{_0x52995e['push'](_0x502b('0x5c'));}break;default:_0x5ed675['push']('\x22'+_0x259507+'\x22');}}else{switch(_0x10e589){case _0x502b('0x5d'):case _0x502b('0xf'):_0x52995e[_0x502b('0x40')](_0x10e589+'\x20not\x20specified');break;default:_0x5ed675[_0x502b('0x40')]('\x22\x22');}}}}if(_0x52995e[_0x502b('0x4f')]){handleError(_0x1b3ed9[_0x502b('0x4e')][_0x4a3200],{'code':_0x502b('0x5e'),'message':_0x52995e[_0x502b('0x11')]()});}else{fs[_0x502b('0x5f')](_0x4670eb,_0x5ed675[_0x502b('0x11')]()+'\x0a');}_0x5ed675=[];}if(!(stats[_0x502b('0x50')]%0xc8)){socket[_0x502b('0x60')](_0x502b('0x61')+_0x1b893a,stats);stats[_0x502b('0x3f')]=[];}}if(stopped){logger[_0x502b('0x3a')]('Abort\x20parser');_0x1a9091['abort']();}}catch(_0x591e4b){handleError(_0x1b3ed9[_0x502b('0x4e')][_0x4a3200],{'code':_0x502b('0x62'),'message':_0x591e4b[_0x502b('0x3d')]});logger[_0x502b('0x3c')]('step',_0x591e4b['message']);}},'complete':function(){try{var _0x57eed7=[];var _0x30ac56=_0x502b('0x2f');if(_0x1b4eca['duplicates']&&_0x1b4eca[_0x502b('0x63')][_0x502b('0x4f')]){_0x30ac56=_0x502b('0x64')+_0x1b893a;_0x57eed7[_0x502b('0x40')](_0x502b('0x65')+_0x30ac56+_0x502b('0x66'));}var _0x415a1d=util[_0x502b('0x67')](_0x502b('0x68'),_0x4670eb,_0x30ac56,_0xb05bb4,_0x1b4eca[_0x502b('0x32')],_0x1b4eca[_0x502b('0x33')]||null,NOW,NOW);if(_[_0x502b('0x69')](_0x4956ce[_0x502b('0x1f')])){_0x415a1d+=_0x502b('0x6a');}_0x57eed7['push'](_0x415a1d);if(_0x1b4eca[_0x502b('0x63')]&&_0x1b4eca['duplicates'][_0x502b('0x4f')]){_0x57eed7[_0x502b('0x40')](insertCmContact(_0x1b4eca[_0x502b('0x32')],_0x30ac56,_0x1b4eca[_0x502b('0x63')],_0x4956ce));_0x57eed7[_0x502b('0x40')](_0x502b('0x6b')+_0x30ac56+';');}_0x57eed7['push'](insertCmHopper(_0x1b4eca[_0x502b('0x32')],_0x502b('0x6c'),'voice_queues',_0x502b('0x6d'),_0xc4c1bb));_0x57eed7[_0x502b('0x40')](insertCmHopperBlack(_0x1b4eca['ListId'],_0x502b('0x6e'),_0x502b('0x6f'),_0x502b('0x6d')));_0x57eed7['push'](insertCmHopper(_0x1b4eca[_0x502b('0x32')],_0x502b('0x70'),_0x502b('0x71'),_0x502b('0x72'),_0xc4c1bb));_0x57eed7[_0x502b('0x40')](insertCmHopperBlack(_0x1b4eca[_0x502b('0x32')],'campaigns_has_cm_blacklists',_0x502b('0x71'),'CampaignId'));BPromise['each'](_0x57eed7,handleQuery)[_0x502b('0x73')](function(_0x1bf3c4){stats[_0x502b('0x74')]=!![];stats[_0x502b('0x75')]=_0x1b4eca['duplicates']&&_0x1b4eca[_0x502b('0x63')][_0x502b('0x4f')]?results[0x2][_0x502b('0x75')]:results[0x0]['affectedRows'];socket['emit'](_0x502b('0x61')+_0x1b893a,stats);fs[_0x502b('0x76')](_0xd85985);fs[_0x502b('0x76')](_0x4670eb);process[_0x502b('0x3e')](0x0);})['catch'](function(_0xe53099){logger['error'](_0xe53099[_0x502b('0x3d')]);process[_0x502b('0x3e')](0x1);});}catch(_0x55ac72){logger['error']('complete',_0x55ac72[_0x502b('0x3d')]);process[_0x502b('0x3e')](0x1);}},'error':function(_0x1f0495,_0x9fc1dc,_0x3598ac,_0x1658ab){throw new Error(_0x1658ab);}});}function validate(){if(process[_0x502b('0x77')]&&process['argv']['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x121cd5=path[_0x502b('0x11')](config['root'],_0x502b('0x4a'),process[_0x502b('0x77')][0x2]);if(!fs[_0x502b('0x78')](_0x121cd5)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x578433={};try{_0x578433=JSON[_0x502b('0x4c')](process[_0x502b('0x77')][0x3]);if(!_0x578433[_0x502b('0x79')]){throw new Error(_0x502b('0x7a'));}if(!_0x578433[_0x502b('0x79')][_0x502b('0xf')]){throw new Error(_0x502b('0x7b'));}if(!_0x578433[_0x502b('0x79')]['firstName']){throw new Error(_0x502b('0x7c'));}var _0x5ce71a=0x0;if(_0x578433[_0x502b('0x79')][_0x502b('0x24')]){_0x5ce71a=0x1;}if(!_0x578433[_0x502b('0x32')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x554d9d){throw new Error(_0x502b('0x7d'));}var _0x111c67=[];try{_0x111c67=_[_0x502b('0x7e')](JSON[_0x502b('0x4c')](process['argv'][0x4]),'id');}catch(_0x4cae59){logger[_0x502b('0x3a')](_0x502b('0x7f'));}main(_0x121cd5,_0x578433,_0x111c67,_0x5ce71a);}validate();process['on'](_0x502b('0x80'),handleStop);process['on'](_0x502b('0x81'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7962bd7..e7d3b63 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 _0x91ff=['outbound','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','membername','Date','starttime','***\x20Time\x20Info\x20***','answertime','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','variable','queue','push','calleridnum'];(function(_0x5da7af,_0x339c6c){var _0xcb820d=function(_0x560695){while(--_0x560695){_0x5da7af['push'](_0x5da7af['shift']());}};_0xcb820d(++_0x339c6c);}(_0x91ff,0xa3));var _0xf91f=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x91ff[_0x50f392];return _0x5926f2;};'use strict';exports[_0xf91f('0x0')]=function(_0x130abf,_0x1e3c15){var _0x46449f=[{'type':_0xf91f('0x1'),'content':_0xf91f('0x2'),'variableName':null}];switch(_0x130abf['toLowerCase']()){case _0xf91f('0x3'):switch(_0x1e3c15[_0xf91f('0x4')]()){case'inbound':_0x46449f['push']({'type':_0xf91f('0x5'),'content':'','variableName':_0xf91f('0x6')});_0x46449f[_0xf91f('0x7')]({'type':_0xf91f('0x5'),'content':'','variableName':_0xf91f('0x8')});break;case _0xf91f('0x9'):_0x46449f[_0xf91f('0x7')]({'type':_0xf91f('0x1'),'content':'Outbound\x20Call','variableName':null});_0x46449f['push']({'type':'variable','content':'','variableName':_0xf91f('0xa')});break;}}return _0x46449f;};exports[_0xf91f('0xb')]=function(_0x271252,_0x518a3f){var _0x554ada=[];switch(_0x271252[_0xf91f('0x4')]()){case'voice':switch(_0x518a3f['toLowerCase']()){case _0xf91f('0xc'):_0x554ada=[{'type':_0xf91f('0x1'),'content':_0xf91f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0xf'),'keyType':'variable','variableName':_0xf91f('0x8')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x10'),'keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x11')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x12'),'keyType':'variable','variableName':_0xf91f('0x13')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x14'),'keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x6')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x15'),'keyType':'variable','variableName':_0xf91f('0x16')},{'type':_0xf91f('0xe'),'content':'','key':'Date','keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x17')},{'type':_0xf91f('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf91f('0x18'),'keyType':'variable','variableName':_0xf91f('0x19')},{'type':_0xf91f('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xf91f('0x5'),'variableName':_0xf91f('0xa')},{'type':_0xf91f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x1a'),'keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x17')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x1b'),'keyType':'variable','variableName':_0xf91f('0x1c')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x1d'),'keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x1e')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x1f'),'keyType':_0xf91f('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0xf91f('0x20'),'keyType':_0xf91f('0x5'),'variableName':_0xf91f('0x21')}];break;case _0xf91f('0x9'):_0x554ada=[{'type':_0xf91f('0x1'),'content':_0xf91f('0xd'),'variableName':null},{'type':_0xf91f('0xe'),'content':'','key':'Called\x20Number','keyType':_0xf91f('0x5'),'keyContent':'','variableName':_0xf91f('0xa')},{'type':_0xf91f('0xe'),'content':'','key':'Member\x20Name','keyType':_0xf91f('0x5'),'keyContent':'','variableName':_0xf91f('0x22')},{'type':_0xf91f('0xe'),'content':'','key':'UniqueId','keyType':_0xf91f('0x5'),'keyContent':'','variableName':_0xf91f('0x16')},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x23'),'keyType':_0xf91f('0x5'),'keyContent':'','variableName':_0xf91f('0x24')},{'type':'string','content':_0xf91f('0x25')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xf91f('0x26')},{'type':'keyValue','content':'','key':_0xf91f('0x27'),'keyType':_0xf91f('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xf91f('0xe'),'content':'','key':_0xf91f('0x28'),'keyType':_0xf91f('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xf91f('0x29'),'keyType':'variable','keyContent':'','variableName':_0xf91f('0x2a')}];break;}}return _0x554ada;}; \ No newline at end of file +var _0x556e=['UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue'];(function(_0x4ce81c,_0x52ec09){var _0x12427f=function(_0x5ee34d){while(--_0x5ee34d){_0x4ce81c['push'](_0x4ce81c['shift']());}};_0x12427f(++_0x52ec09);}(_0x556e,0xd9));var _0xe556=function(_0x4f3949,_0x1b28b5){_0x4f3949=_0x4f3949-0x0;var _0x2bbb60=_0x556e[_0x4f3949];return _0x2bbb60;};'use strict';exports['getSubjects']=function(_0x271d89,_0x2cd6b4){var _0x433f94=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x271d89[_0xe556('0x0')]()){case'voice':switch(_0x2cd6b4[_0xe556('0x0')]()){case _0xe556('0x1'):_0x433f94['push']({'type':_0xe556('0x2'),'content':'','variableName':_0xe556('0x3')});_0x433f94[_0xe556('0x4')]({'type':'variable','content':'','variableName':_0xe556('0x5')});break;case _0xe556('0x6'):_0x433f94['push']({'type':_0xe556('0x7'),'content':_0xe556('0x8'),'variableName':null});_0x433f94[_0xe556('0x4')]({'type':_0xe556('0x2'),'content':'','variableName':_0xe556('0x9')});break;}}return _0x433f94;};exports[_0xe556('0xa')]=function(_0x20150b,_0x4ba225){var _0x49cf86=[];switch(_0x20150b['toLowerCase']()){case'voice':switch(_0x4ba225[_0xe556('0x0')]()){case _0xe556('0x1'):_0x49cf86=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xe556('0xb'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x5')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0xd'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0xe')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0xf'),'keyType':'variable','variableName':_0xe556('0x10')},{'type':'keyValue','content':'','key':_0xe556('0x11'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x3')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x12'),'keyType':'variable','variableName':_0xe556('0x13')},{'type':_0xe556('0xc'),'content':'','key':'Date','keyType':'variable','variableName':_0xe556('0x14')},{'type':_0xe556('0x7'),'content':_0xe556('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x16'),'keyType':'variable','variableName':_0xe556('0x17')},{'type':_0xe556('0xc'),'content':'','key':'Agent\x20Number','keyType':_0xe556('0x2'),'variableName':_0xe556('0x9')},{'type':'string','content':_0xe556('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x19'),'keyType':_0xe556('0x2'),'variableName':'agentcalledAt'},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x1a'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x1b')},{'type':'keyValue','content':'','key':_0xe556('0x1c'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x1d')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x1e'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x1f')},{'type':'keyValue','content':'','key':_0xe556('0x20'),'keyType':_0xe556('0x2'),'variableName':_0xe556('0x21')}];break;case _0xe556('0x6'):_0x49cf86=[{'type':_0xe556('0x7'),'content':_0xe556('0x22'),'variableName':null},{'type':'keyValue','content':'','key':_0xe556('0x23'),'keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x9')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x24'),'keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x25')},{'type':'keyValue','content':'','key':_0xe556('0x12'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xe556('0x26'),'keyType':'variable','keyContent':'','variableName':_0xe556('0x27')},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0xe556('0x28'),'keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x29')},{'type':_0xe556('0xc'),'content':'','key':_0xe556('0x2a'),'keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x2b')},{'type':'keyValue','content':'','key':'Duration','keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x2c')},{'type':'keyValue','content':'','key':_0xe556('0x2d'),'keyType':_0xe556('0x2'),'keyContent':'','variableName':_0xe556('0x2e')}];break;}}return _0x49cf86;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index abff5cc..f599ece 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 _0x2c06=['phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null','then','update','info','catch','error','tracked','query','clone','body','omit'];(function(_0x1241fa,_0x6175cd){var _0x32b48a=function(_0x1d8598){while(--_0x1d8598){_0x1241fa['push'](_0x1241fa['shift']());}};_0x32b48a(++_0x6175cd);}(_0x2c06,0xb1));var _0x62c0=function(_0x57cbe3,_0x1a62e5){_0x57cbe3=_0x57cbe3-0x0;var _0x14b3c5=_0x2c06[_0x57cbe3];return _0x14b3c5;};'use strict';var _=require(_0x62c0('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x62c0('0x1'))(_0x62c0('0x2')),'mail':require('../../config/logger')(_0x62c0('0x3')),'fax':require(_0x62c0('0x1'))(_0x62c0('0x4')),'sms':require(_0x62c0('0x1'))(_0x62c0('0x5')),'chat':require(_0x62c0('0x1'))(_0x62c0('0x6')),'whatsapp':require(_0x62c0('0x1'))(_0x62c0('0x7'))};function getInteractionId(_0x159d4a,_0x36380b,_0x237924){if(_0x159d4a&&_0x159d4a[_[_0x62c0('0x8')](_0x237924)+_0x62c0('0x9')]){return _0x159d4a[_['upperFirst'](_0x237924)+_0x62c0('0x9')];}else if(_0x159d4a&&_0x159d4a['id']){return _0x159d4a['id'];}else if(_0x36380b&&_0x36380b['id']){return _0x36380b['id'];}else{return _0x62c0('0xa');}}function log(_0x1b7053,_0x531c63,_0x152fb8,_0x15a391,_0xecee26,_0x503bfe){loggers[_0xecee26[_0x62c0('0xb')]()][_0x1b7053](_0x62c0('0xc'),_0x503bfe[_0x62c0('0xd')](),_0x531c63?_0x531c63['id']:null,_0x531c63?_0x531c63['name']:null,_0x531c63?_0x531c63[_0x62c0('0xe')]:null,getInteractionId(_0x152fb8,_0x15a391,_0xecee26),_0x152fb8?JSON['stringify'](_0x152fb8):_0x62c0('0xf'));}function updateUser(_0xac92a,_0x50ce1a,_0x5baf35,_0x516d9b,_0x3c4202){db[_['upperFirst'](_0x516d9b)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x50ce1a,_0x5baf35,_0x516d9b)}})[_0x62c0('0x10')](function(_0x424d47){if(_0x424d47){return _0x424d47[_0x62c0('0x11')]({'UserId':_0xac92a?_0xac92a['id']:null});}})[_0x62c0('0x10')](function(_0x4ff05){if(_0x4ff05){log(_0x62c0('0x12'),_0xac92a,_0x50ce1a,_0x5baf35,_0x516d9b,_0x3c4202);}})[_0x62c0('0x13')](function(){log(_0x62c0('0x14'),_0xac92a,_0x50ce1a,_0x5baf35,_0x516d9b,_0x3c4202);});}exports[_0x62c0('0x15')]=function(_0x363807,_0x4cfb38){return function(_0x2992b1,_0x1c9078,_0x41c06e){var _0x35c482=_0x2992b1['user'];var _0x7d048f={};var _0x4f3b63=_0x2992b1[_0x62c0('0x16')];if(_0x7d048f){_0x7d048f=_[_0x62c0('0x17')](_0x2992b1[_0x62c0('0x18')]);_0x7d048f=_[_0x62c0('0x19')](_0x7d048f,['body','html',_0x62c0('0x1a'),_0x62c0('0x1b'),_0x62c0('0x1c')]);}updateUser(_0x35c482,_0x7d048f,_0x4f3b63,_0x363807,_0x4cfb38);_0x41c06e(null);};}; \ No newline at end of file +var _0x93a8=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','findOne','then','update','info','catch','error','tracked','user','query','body','omit','html','fax','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions'];(function(_0x5b39f9,_0x219266){var _0x464918=function(_0x30232b){while(--_0x30232b){_0x5b39f9['push'](_0x5b39f9['shift']());}};_0x464918(++_0x219266);}(_0x93a8,0x172));var _0x893a=function(_0x415e88,_0xa67890){_0x415e88=_0x415e88-0x0;var _0x4cebd3=_0x93a8[_0x415e88];return _0x4cebd3;};'use strict';var _=require(_0x893a('0x0'));var db=require(_0x893a('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x893a('0x2')),'mail':require(_0x893a('0x3'))('mail-interactions'),'fax':require(_0x893a('0x3'))('fax-interactions'),'sms':require(_0x893a('0x3'))(_0x893a('0x4')),'chat':require(_0x893a('0x3'))(_0x893a('0x5')),'whatsapp':require('../../config/logger')(_0x893a('0x6'))};function getInteractionId(_0x5233c7,_0x4509c5,_0x23eb48){if(_0x5233c7&&_0x5233c7[_[_0x893a('0x7')](_0x23eb48)+_0x893a('0x8')]){return _0x5233c7[_['upperFirst'](_0x23eb48)+'InteractionId'];}else if(_0x5233c7&&_0x5233c7['id']){return _0x5233c7['id'];}else if(_0x4509c5&&_0x4509c5['id']){return _0x4509c5['id'];}else{return _0x893a('0x9');}}function log(_0x5d5d57,_0x40641e,_0x216d2c,_0x586554,_0x1cb9fc,_0x51e624){loggers[_0x1cb9fc[_0x893a('0xa')]()][_0x5d5d57](_0x893a('0xb'),_0x51e624[_0x893a('0xc')](),_0x40641e?_0x40641e['id']:null,_0x40641e?_0x40641e[_0x893a('0xd')]:null,_0x40641e?_0x40641e[_0x893a('0xe')]:null,getInteractionId(_0x216d2c,_0x586554,_0x1cb9fc),_0x216d2c?JSON['stringify'](_0x216d2c):'null');}function updateUser(_0x414ecd,_0x26166c,_0x5e9b42,_0x59296a,_0x3ebb75){db[_[_0x893a('0x7')](_0x59296a)+'Interaction'][_0x893a('0xf')]({'where':{'id':getInteractionId(_0x26166c,_0x5e9b42,_0x59296a)}})[_0x893a('0x10')](function(_0x5d0ff1){if(_0x5d0ff1){return _0x5d0ff1[_0x893a('0x11')]({'UserId':_0x414ecd?_0x414ecd['id']:null});}})[_0x893a('0x10')](function(_0x350643){if(_0x350643){log(_0x893a('0x12'),_0x414ecd,_0x26166c,_0x5e9b42,_0x59296a,_0x3ebb75);}})[_0x893a('0x13')](function(){log(_0x893a('0x14'),_0x414ecd,_0x26166c,_0x5e9b42,_0x59296a,_0x3ebb75);});}exports[_0x893a('0x15')]=function(_0x5caae8,_0x1f6909){return function(_0x2fb139,_0x46af26,_0x14d481){var _0xc431c5=_0x2fb139[_0x893a('0x16')];var _0x83baa3={};var _0x3bd9a9=_0x2fb139[_0x893a('0x17')];if(_0x83baa3){_0x83baa3=_['clone'](_0x2fb139[_0x893a('0x18')]);_0x83baa3=_[_0x893a('0x19')](_0x83baa3,[_0x893a('0x18'),_0x893a('0x1a'),'phone',_0x893a('0x1b'),_0x893a('0x1c')]);}updateUser(_0xc431c5,_0x83baa3,_0x3bd9a9,_0x5caae8,_0x1f6909);_0x14d481(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index bf36fc2..1318e29 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 _0xb995=['data1','license','split','format','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','user','isUserLimit','util','composable-middleware','../../mysqldb'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xb995,0xe4));var _0x5b99=function(_0x29e466,_0xc80c92){_0x29e466=_0x29e466-0x0;var _0x6684ae=_0xb995[_0x29e466];return _0x6684ae;};'use strict';var crypto=require('crypto');var util=require(_0x5b99('0x0'));var compose=require(_0x5b99('0x1'));var db=require(_0x5b99('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x51b9ad,_0x34ec6d){if(_0x51b9ad&&_0x34ec6d){if(_0x34ec6d['data1']&&_0x34ec6d['license']){var _0x301f9d=_0x34ec6d[_0x5b99('0x3')];var _0x2c1953=_0x34ec6d[_0x5b99('0x4')];var _0x500ffe=_0x301f9d['split']('-')[0x4];var _0x2bb9cf=_0x301f9d[_0x5b99('0x5')]('-')[0x0];var _0x430dad=crypto['createDecipher']('aes-256-ctr',util[_0x5b99('0x6')]('%s:%s:%s',_0x500ffe,_0x301f9d,_0x2bb9cf));var _0x3df7d7=_0x430dad[_0x5b99('0x7')](_0x2c1953,_0x5b99('0x8'),_0x5b99('0x9'));_0x3df7d7+=_0x430dad[_0x5b99('0xa')](_0x5b99('0x9'));var _0x52dbab=JSON['parse'](_0x3df7d7);return _0x52dbab[_0x5b99('0xb')](_0x51b9ad)?_0x52dbab[_0x51b9ad]:null;}}return null;}function isLimit(_0x587d06,_0x48872e,_0x3a3ebc,_0x45cb1c){var _0x38589e=_0x48872e;return compose()[_0x5b99('0xc')](function(_0x2f25ab,_0x3928e7,_0x1a4142){return db[_0x5b99('0xd')][_0x5b99('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5b99('0xf')](function(_0x5ec5dc){var _0x351f4e=getValueFromLicense(_0x587d06,_0x5ec5dc);return _0x351f4e?_0x351f4e:_0x38589e;})['then'](function(_0x1804d8){_0x38589e=_0x1804d8;return _0x3a3ebc['count'](_0x45cb1c);})[_0x5b99('0xf')](function(_0x447794){if(_0x447794>=_0x38589e){return _0x3928e7[_0x5b99('0x10')](0x193)['json']({'message':util[_0x5b99('0x6')](_0x5b99('0x11'),_0x587d06)});}_0x1a4142();})['catch'](function(_0x47938f){_0x1a4142(_0x47938f);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x5b99('0x12')],{'where':{'$or':[{'role':'admin'},{'role':_0x5b99('0x13')}]}});}exports[_0x5b99('0x14')]=isUserLimit; \ No newline at end of file +var _0x1d1c=['data1','license','split','createDecipher','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','format','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment'];(function(_0x10f05b,_0x690018){var _0x5b53d2=function(_0x51d874){while(--_0x51d874){_0x10f05b['push'](_0x10f05b['shift']());}};_0x5b53d2(++_0x690018);}(_0x1d1c,0x9e));var _0xc1d1=function(_0xbf8b24,_0x15a25e){_0xbf8b24=_0xbf8b24-0x0;var _0x3c71c1=_0x1d1c[_0xbf8b24];return _0x3c71c1;};'use strict';var crypto=require('crypto');var util=require(_0xc1d1('0x0'));var compose=require(_0xc1d1('0x1'));var db=require(_0xc1d1('0x2'))['db'];var config=require(_0xc1d1('0x3'));function getValueFromLicense(_0xa3c41,_0x485633){if(_0xa3c41&&_0x485633){if(_0x485633[_0xc1d1('0x4')]&&_0x485633['license']){var _0x225c1c=_0x485633[_0xc1d1('0x4')];var _0x14feb6=_0x485633[_0xc1d1('0x5')];var _0x48fc3a=_0x225c1c[_0xc1d1('0x6')]('-')[0x4];var _0x1fa43a=_0x225c1c[_0xc1d1('0x6')]('-')[0x0];var _0x188f91=crypto[_0xc1d1('0x7')]('aes-256-ctr',util['format'](_0xc1d1('0x8'),_0x48fc3a,_0x225c1c,_0x1fa43a));var _0x444b48=_0x188f91[_0xc1d1('0x9')](_0x14feb6,_0xc1d1('0xa'),_0xc1d1('0xb'));_0x444b48+=_0x188f91[_0xc1d1('0xc')]('utf8');var _0x2ce4e2=JSON[_0xc1d1('0xd')](_0x444b48);return _0x2ce4e2[_0xc1d1('0xe')](_0xa3c41)?_0x2ce4e2[_0xa3c41]:null;}}return null;}function isLimit(_0xe30429,_0x264485,_0x3556e2,_0x13fcb2){var _0x142dec=_0x264485;return compose()[_0xc1d1('0xf')](function(_0x3c283b,_0x3072a4,_0x56d50d){return db[_0xc1d1('0x10')][_0xc1d1('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x4b2116){var _0xc0e3dd=getValueFromLicense(_0xe30429,_0x4b2116);return _0xc0e3dd?_0xc0e3dd:_0x142dec;})[_0xc1d1('0x12')](function(_0x504b06){_0x142dec=_0x504b06;return _0x3556e2[_0xc1d1('0x13')](_0x13fcb2);})[_0xc1d1('0x12')](function(_0x2968b0){if(_0x2968b0>=_0x142dec){return _0x3072a4[_0xc1d1('0x14')](0x193)[_0xc1d1('0x15')]({'message':util[_0xc1d1('0x16')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xe30429)});}_0x56d50d();})['catch'](function(_0x4b7f70){_0x56d50d(_0x4b7f70);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc1d1('0x17')],{'where':{'$or':[{'role':_0xc1d1('0x18')},{'role':_0xc1d1('0x19')}]}});}exports[_0xc1d1('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9de3b32..e282797 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 _0xc860=['$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','match','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','includes','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','=\x20?','$substring'];(function(_0x5a449d,_0x30ebf2){var _0x5037ec=function(_0x3bf02f){while(--_0x3bf02f){_0x5a449d['push'](_0x5a449d['shift']());}};_0x5037ec(++_0x30ebf2);}(_0xc860,0x1d7));var _0x0c86=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xc860[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0c86('0x0'));var moment=require('moment');exports[_0x0c86('0x1')]=function(_0x385652){var _0x24f879={'conditions':[]};_0x24f879[_0x0c86('0x2')]=_[_0x0c86('0x3')](_0x385652,_0x0c86('0x4'))?'or':_0x0c86('0x5');var _0xeaf63e=_0x385652[_0x0c86('0x6')]('[$and]','')[_0x0c86('0x6')]('[$or]','')[_0x0c86('0x7')]('||');for(var _0x46a779=0x0;_0x46a779<_0xeaf63e[_0x0c86('0x8')];_0x46a779++){var _0x47707e=_0xeaf63e[_0x46a779][_0x0c86('0x7')](':=');var _0x2739b7=_0x47707e[0x0];var _0x523133=_0x47707e[_0x0c86('0x9')](0x1);_0x523133[_0x0c86('0xa')](function(_0x2905db){var _0x5409a4=_0x2905db['split']('[')['shift']();var _0x339384=_0x2905db[_0x0c86('0xb')](/\[(.*?)\]/g);_0x339384[_0x0c86('0xa')](function(_0x13ac96){var _0x218134=_0x13ac96['split']('[')[_0x0c86('0xc')](function(_0x585a21){return _0x585a21[_0x0c86('0xd')](']')>-0x1;})['map'](function(_0x1ff96f){return _0x1ff96f[_0x0c86('0x7')](']')[0x0];})[0x0];_0x24f879[_0x0c86('0xe')][_0x0c86('0xf')]({'field':_0x2739b7,'operator':_0x5409a4,'value':_0x218134});});});}return _0x24f879;};exports[_0x0c86('0x10')]=function(_0x126d9b,_0xc63ff3,_0x37a03a){var _0x5d809c={};if(_0xc63ff3===_0x0c86('0x11')){if(_0x37a03a[_0x0c86('0x12')]===_0x0c86('0x13')){_0x37a03a[_0x0c86('0x12')]=_0x0c86('0x14');_0x37a03a[_0x0c86('0x15')]+=','+_0x37a03a[_0x0c86('0x15')];}else if(_['includes']([_0x0c86('0x16'),_0x0c86('0x17')],_0x37a03a[_0x0c86('0x12')])){_0x37a03a[_0x0c86('0x15')]=moment(_0x37a03a[_0x0c86('0x15')])[_0x0c86('0x18')](0x1,_0x0c86('0x19'))[_0x0c86('0x1a')](_0x0c86('0x1b'));}}if(_0x37a03a[_0x0c86('0x1c')]){_0xc63ff3=_0x37a03a[_0x0c86('0x1c')];_0x5d809c[_0x0c86('0x1d')]=_0x0c86('0x1e')+_0x126d9b+'.'+_0x37a03a['field']+_0x0c86('0x1f')+_0x37a03a['castTo']+')\x20'+parseOperator(_0x37a03a[_0x0c86('0x12')]);}else{_0x5d809c['text']=_0x126d9b+'.'+_0x37a03a[_0x0c86('0x20')]+'\x20'+parseOperator(_0x37a03a[_0x0c86('0x12')]);}if(_[_0x0c86('0x21')]([_0x0c86('0x22'),'$notIn'],_0x37a03a[_0x0c86('0x12')]))_0x5d809c[_0x0c86('0x1d')]='('+_0x5d809c[_0x0c86('0x1d')]+_0x0c86('0x23')+_0x126d9b+'.'+_0x37a03a['field']+_0x0c86('0x24');_0x5d809c[_0x0c86('0x15')]=parseValue(_0xc63ff3,_0x37a03a[_0x0c86('0x12')],_0x37a03a['value']);return _0x5d809c;};function parseOperator(_0x2288cc){var _0x7f85d4;switch(_0x2288cc){case _0x0c86('0x25'):_0x7f85d4=_0x0c86('0x26');break;case _0x0c86('0x27'):_0x7f85d4='NOT\x20IN\x20?';break;case _0x0c86('0x13'):_0x7f85d4=_0x0c86('0x28');break;case _0x0c86('0x22'):_0x7f85d4='<>\x20?';break;case _0x0c86('0x29'):case _0x0c86('0x2a'):case _0x0c86('0x2b'):_0x7f85d4=_0x0c86('0x2c');break;case _0x0c86('0x2d'):_0x7f85d4=_0x0c86('0x2e');break;case _0x0c86('0x16'):_0x7f85d4=_0x0c86('0x2f');break;case _0x0c86('0x17'):_0x7f85d4='<=\x20?';break;case _0x0c86('0x30'):_0x7f85d4=_0x0c86('0x31');break;case _0x0c86('0x14'):_0x7f85d4=_0x0c86('0x32');break;}return _0x7f85d4;}function parseValue(_0x3a86b7,_0x2c466c,_0x4b06c5){var _0x2218ad={'start':undefined,'end':undefined};switch(_0x2c466c){case'$in':case _0x0c86('0x27'):_0x2218ad[_0x0c86('0x33')]=_0x4b06c5['split'](',');break;case'$substring':_0x2218ad[_0x0c86('0x33')]='%'+_0x4b06c5+'%';break;case'$startsWith':_0x2218ad[_0x0c86('0x33')]=_0x4b06c5+'%';break;case'$endsWith':_0x2218ad[_0x0c86('0x33')]='%'+_0x4b06c5;break;case _0x0c86('0x14'):var _0x379ebc=_0x4b06c5[_0x0c86('0x7')](',');var _0x4b06c5=_0x379ebc[_0x0c86('0x34')]();var _0x2b9808=_0x379ebc[_0x0c86('0x35')]();if(_0x3a86b7===_0x0c86('0x11')){_0x4b06c5=moment(_0x4b06c5)[_0x0c86('0x36')](0x0,!![])[_0x0c86('0x1a')]();_0x2b9808=moment(_0x2b9808)[_0x0c86('0x36')](0x0,!![])[_0x0c86('0x18')](0x17,'hours')[_0x0c86('0x18')](0x3b,_0x0c86('0x37'))['add'](0x3b,_0x0c86('0x38'))[_0x0c86('0x1a')]();}_0x2218ad={'start':_0x4b06c5,'end':_0x2b9808};break;default:_0x2218ad[_0x0c86('0x33')]=_0x4b06c5;break;}return _0x2218ad;} \ No newline at end of file +var _0x91d3=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','and','[$and]','length','split','slice','forEach','shift','match','indexOf','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x15ea16,_0x5b0112){var _0x1f2078=function(_0x4ba73a){while(--_0x4ba73a){_0x15ea16['push'](_0x15ea16['shift']());}};_0x1f2078(++_0x5b0112);}(_0x91d3,0x157));var _0x391d=function(_0x300186,_0x3b67fe){_0x300186=_0x300186-0x0;var _0x154fb4=_0x91d3[_0x300186];return _0x154fb4;};'use strict';var _=require(_0x391d('0x0'));var moment=require('moment');exports[_0x391d('0x1')]=function(_0x3877d5){var _0x3d29d9={'conditions':[]};_0x3d29d9[_0x391d('0x2')]=_['startsWith'](_0x3877d5,_0x391d('0x3'))?'or':_0x391d('0x4');var _0x3d0f91=_0x3877d5['replace'](_0x391d('0x5'),'')['replace'](_0x391d('0x3'),'')['split']('||');for(var _0x4707af=0x0;_0x4707af<_0x3d0f91[_0x391d('0x6')];_0x4707af++){var _0x3781e6=_0x3d0f91[_0x4707af][_0x391d('0x7')](':=');var _0x4a157f=_0x3781e6[0x0];var _0x39f6cb=_0x3781e6[_0x391d('0x8')](0x1);_0x39f6cb[_0x391d('0x9')](function(_0x308b43){var _0x353b3a=_0x308b43['split']('[')[_0x391d('0xa')]();var _0xc8d571=_0x308b43[_0x391d('0xb')](/\[(.*?)\]/g);_0xc8d571[_0x391d('0x9')](function(_0xd6c247){var _0x2923df=_0xd6c247[_0x391d('0x7')]('[')['filter'](function(_0x54f53f){return _0x54f53f[_0x391d('0xc')](']')>-0x1;})['map'](function(_0x358960){return _0x358960[_0x391d('0x7')](']')[0x0];})[0x0];_0x3d29d9[_0x391d('0xd')][_0x391d('0xe')]({'field':_0x4a157f,'operator':_0x353b3a,'value':_0x2923df});});});}return _0x3d29d9;};exports[_0x391d('0xf')]=function(_0x223ca6,_0x1dad42,_0x29a635){var _0x4fd7d8={};if(_0x1dad42===_0x391d('0x10')){if(_0x29a635[_0x391d('0x11')]===_0x391d('0x12')){_0x29a635[_0x391d('0x11')]='$between';_0x29a635[_0x391d('0x13')]+=','+_0x29a635[_0x391d('0x13')];}else if(_[_0x391d('0x14')]([_0x391d('0x15'),_0x391d('0x16')],_0x29a635[_0x391d('0x11')])){_0x29a635[_0x391d('0x13')]=moment(_0x29a635[_0x391d('0x13')])[_0x391d('0x17')](0x1,_0x391d('0x18'))[_0x391d('0x19')](_0x391d('0x1a'));}}if(_0x29a635['castTo']){_0x1dad42=_0x29a635[_0x391d('0x1b')];_0x4fd7d8[_0x391d('0x1c')]='CAST('+_0x223ca6+'.'+_0x29a635[_0x391d('0x1d')]+_0x391d('0x1e')+_0x29a635['castTo']+')\x20'+parseOperator(_0x29a635[_0x391d('0x11')]);}else{_0x4fd7d8[_0x391d('0x1c')]=_0x223ca6+'.'+_0x29a635[_0x391d('0x1d')]+'\x20'+parseOperator(_0x29a635[_0x391d('0x11')]);}if(_[_0x391d('0x14')]([_0x391d('0x1f'),_0x391d('0x20')],_0x29a635[_0x391d('0x11')]))_0x4fd7d8['text']='('+_0x4fd7d8[_0x391d('0x1c')]+_0x391d('0x21')+_0x223ca6+'.'+_0x29a635['field']+_0x391d('0x22');_0x4fd7d8['value']=parseValue(_0x1dad42,_0x29a635[_0x391d('0x11')],_0x29a635[_0x391d('0x13')]);return _0x4fd7d8;};function parseOperator(_0x2be637){var _0x581cb9;switch(_0x2be637){case _0x391d('0x23'):_0x581cb9=_0x391d('0x24');break;case'$notIn':_0x581cb9=_0x391d('0x25');break;case _0x391d('0x12'):_0x581cb9=_0x391d('0x26');break;case _0x391d('0x1f'):_0x581cb9=_0x391d('0x27');break;case _0x391d('0x28'):case _0x391d('0x29'):case'$endsWith':_0x581cb9='LIKE\x20?';break;case _0x391d('0x2a'):_0x581cb9=_0x391d('0x2b');break;case _0x391d('0x15'):_0x581cb9=_0x391d('0x2c');break;case'$lte':_0x581cb9='<=\x20?';break;case'$gte':_0x581cb9=_0x391d('0x2d');break;case _0x391d('0x2e'):_0x581cb9=_0x391d('0x2f');break;}return _0x581cb9;}function parseValue(_0x179c9d,_0x197ada,_0x345b9d){var _0x39ca80={'start':undefined,'end':undefined};switch(_0x197ada){case _0x391d('0x23'):case _0x391d('0x20'):_0x39ca80[_0x391d('0x30')]=_0x345b9d[_0x391d('0x7')](',');break;case'$substring':_0x39ca80[_0x391d('0x30')]='%'+_0x345b9d+'%';break;case _0x391d('0x29'):_0x39ca80[_0x391d('0x30')]=_0x345b9d+'%';break;case _0x391d('0x31'):_0x39ca80['start']='%'+_0x345b9d;break;case _0x391d('0x2e'):var _0x826dab=_0x345b9d[_0x391d('0x7')](',');var _0x345b9d=_0x826dab[_0x391d('0xa')]();var _0x4d296e=_0x826dab[_0x391d('0x32')]();if(_0x179c9d===_0x391d('0x10')){_0x345b9d=moment(_0x345b9d)['utcOffset'](0x0,!![])[_0x391d('0x19')]();_0x4d296e=moment(_0x4d296e)[_0x391d('0x33')](0x0,!![])['add'](0x17,'hours')[_0x391d('0x17')](0x3b,_0x391d('0x34'))['add'](0x3b,_0x391d('0x35'))[_0x391d('0x19')]();}_0x39ca80={'start':_0x345b9d,'end':_0x4d296e};break;default:_0x39ca80[_0x391d('0x30')]=_0x345b9d;break;}return _0x39ca80;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6ddd130..a776027 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 _0x68ea=['fields','pick','filter','where','type','VIRTUAL','lower','merge','lodash','sequelize','moment','parse','keys','includes','filters','isEmpty','find','DATE','format','YYYY-MM-DD','utc','$lte','subtract','isArray','split','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','length','omit','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','name','intersection','attributes','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68ea,0xb0));var _0xa68e=function(_0x1f2c8c,_0x14e047){_0x1f2c8c=_0x1f2c8c-0x0;var _0x15086b=_0x68ea[_0x1f2c8c];return _0x15086b;};'use strict';var _=require(_0xa68e('0x0'));var sequelize=require(_0xa68e('0x1'));var moment=require(_0xa68e('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f0c01){var _0x50b100=['ne'];try{var _0xdeee63=JSON[_0xa68e('0x3')](_0x1f0c01);var _0x15742b=Object[_0xa68e('0x4')](_0xdeee63)[0x0];return _0x50b100[_0xa68e('0x5')](_0x15742b);}catch(_0x6d2ec6){return![];}}function getOperatorValue(_0x5313f8){var _0x520ef9=JSON[_0xa68e('0x3')](_0x5313f8);var _0x28f664=Object[_0xa68e('0x4')](_0x520ef9)[0x0];var _0x30fddc=_0x520ef9[_0x28f664];return{['$'+_0x28f664]:_0x30fddc};}exports['fields']=function(_0x3981ca){var _0x5eb89c=null;if(_0x3981ca){_0x5eb89c=_0x3981ca['split'](',');}return _0x5eb89c;};exports[_0xa68e('0x6')]=function(_0x3bae11,_0x3eb394){var _0x543910={};if(!_[_0xa68e('0x7')](_0x3bae11)){_['forOwn'](_0x3bae11,function(_0x31f643,_0x2e37a2){try{if(_0x3eb394){var _0x48a825=_[_0xa68e('0x8')](_0x3eb394,{'name':_0x2e37a2})||{};if(hasSequelizeOperator(_0x31f643)){_0x543910[_0x2e37a2]=getOperatorValue(_0x31f643);}else if(_0x48a825['type']===_0xa68e('0x9')&&_['isPlainObject'](_0x31f643)){var _0x29d06c=JSON[_0xa68e('0x3')](_0x31f643);var _0xffac97={'$gte':moment(moment(_0x29d06c['$gte'])[_0xa68e('0xa')](_0xa68e('0xb')))[_0xa68e('0xc')]()[_0xa68e('0xa')](),'$lte':moment(moment(_0x29d06c[_0xa68e('0xd')])[_0xa68e('0xa')]('YYYY-MM-DD'))[_0xa68e('0xc')]()[_0xa68e('0xe')](0x1,'s')['format']()};_0x543910[_0x2e37a2]=_0xffac97;}else if(_0x48a825['name']==='uniqueid'){_0x543910[_0x2e37a2]=_0x31f643;}else{_0x543910[_0x2e37a2]=_[_0xa68e('0xf')](_0x31f643)?_0x31f643:JSON[_0xa68e('0x3')](_0x31f643);}}else{_0x543910[_0x2e37a2]=_['isArray'](_0x31f643)?_0x31f643:JSON['parse'](_0x31f643);}}catch(_0x1ca066){_0x543910[_0x2e37a2]=_0x31f643[_0xa68e('0x10')](',');}});}return _0x543910;};exports[_0xa68e('0x11')]=function(_0x5e5d6b){_0x5e5d6b=parseInt(_0x5e5d6b,0xa);if(!_0x5e5d6b||_0x5e5d6b<0x0){_0x5e5d6b=LIMIT_VALUE;}return _0x5e5d6b;};exports[_0xa68e('0x12')]=function(_0x5abf2a){_0x5abf2a=parseInt(_0x5abf2a,0xa);if(!_0x5abf2a||_0x5abf2a<0x0){_0x5abf2a=0x0;}return _0x5abf2a;};exports[_0xa68e('0x13')]=function(_0x31ac15){var _0xc803f4,_0x49dde2=null;if(_0x31ac15){_0xc803f4=_0x31ac15[_0xa68e('0x10')](',');_0x49dde2=_[_0xa68e('0x14')](_0xc803f4,function(_0x5cdf54){if(_0x5cdf54[_0xa68e('0x15')]('-')===0x0){return[_0x5cdf54===_0xa68e('0x16')?sequelize[_0xa68e('0x17')](sequelize[_0xa68e('0x18')](_0xa68e('0x16')),_0xa68e('0x19')):_0x5cdf54[_0xa68e('0x1a')](0x1),'DESC'];}else{return[_0x5cdf54===_0xa68e('0x16')?sequelize[_0xa68e('0x17')](sequelize[_0xa68e('0x18')](_0xa68e('0x16')),_0xa68e('0x19')):_0x5cdf54,_0xa68e('0x1b')];}});}return _0x49dde2;};exports['omit']=function(_0x5aef11,_0x1ae63e){if(_[_0xa68e('0x7')](_0x5aef11)){return _0x5aef11;}if(_[_0xa68e('0xf')](_0x5aef11)){for(var _0x4f7fc1=0x0;_0x4f7fc1<_0x5aef11[_0xa68e('0x1c')];_0x4f7fc1+=0x1){_0x5aef11[_0x4f7fc1]=this[_0xa68e('0x1d')](_0x5aef11[_0x4f7fc1],_0x1ae63e);}return _0x5aef11;}if(!_['isObject'](_0x5aef11)){return _0x5aef11;}if(_[_0xa68e('0x1e')](_0x1ae63e)){_0x1ae63e=[_0x1ae63e];}if(!_[_0xa68e('0xf')](_0x1ae63e)){return _0x5aef11;}for(var _0x2bcccc=0x0;_0x2bcccc<_0x1ae63e[_0xa68e('0x1c')];_0x2bcccc+=0x1){_[_0xa68e('0x1f')](_0x5aef11,_0x1ae63e[_0x2bcccc]);}for(var _0x5b00be in _0x5aef11){if(_0x5aef11[_0xa68e('0x20')](_0x5b00be)){_0x5aef11[_0x5b00be]=this[_0xa68e('0x1d')](_0x5aef11[_0x5b00be],_0x1ae63e);}}return _0x5aef11;};exports[_0xa68e('0x21')]=function(_0x5c3319){return _0x5c3319[_0xa68e('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xa68e('0x23')]=function(_0x4974f5){return _0x4974f5['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa68e('0x24')]=function(_0x18cb69){var _0x2ba779=[];_0x18cb69[_0xa68e('0x10')](/[ ,]+/)[_0xa68e('0x25')](function(_0x52e548){_0x52e548=_0x52e548[_0xa68e('0x26')](/([^:]")"+/g,'$1');_0x52e548='+'+_0x52e548+'*';if(_0x52e548['includes']('@'))_0x52e548='\x22'+_0x52e548+'\x22';_0x2ba779[_0xa68e('0x27')](_0x52e548);});return _0x2ba779[_0xa68e('0x28')]('\x20');};exports[_0xa68e('0x29')]=function(_0x21d00a,_0x212fa7,_0x1e744d){var _0x20b2c8={},_0x439db5={};if(_0x212fa7[_0xa68e('0x2a')][_0xa68e('0x2b')]){_0x212fa7['query']['id']=_0x212fa7['query'][_0xa68e('0x2b')];delete _0x212fa7['query'][_0xa68e('0x2b')];}_0x20b2c8['model']=_[_0xa68e('0x14')](_0x21d00a,_0xa68e('0x2c'));_0x20b2c8['query']=_[_0xa68e('0x4')](_0x212fa7['query']);_0x20b2c8[_0xa68e('0x6')]=_[_0xa68e('0x2d')](_0x20b2c8['model'],_0x20b2c8[_0xa68e('0x2a')]);_0x439db5[_0xa68e('0x2e')]=_[_0xa68e('0x2d')](_0x20b2c8[_0xa68e('0x2f')],this[_0xa68e('0x30')](_0x212fa7[_0xa68e('0x2a')][_0xa68e('0x30')]));_0x439db5[_0xa68e('0x2e')]=_0x439db5[_0xa68e('0x2e')][_0xa68e('0x1c')]?_0x439db5[_0xa68e('0x2e')]:_0x20b2c8['model'];if(!_0x212fa7[_0xa68e('0x2a')]['hasOwnProperty']('nolimit')){_0x439db5[_0xa68e('0x11')]=this[_0xa68e('0x11')](_0x212fa7[_0xa68e('0x2a')][_0xa68e('0x11')]);_0x439db5['offset']=this['offset'](_0x212fa7[_0xa68e('0x2a')]['offset']);}_0x439db5['order']=this['sort'](_0x212fa7['query']['sort']);_0x439db5['where']=this['filters'](_[_0xa68e('0x31')](_0x212fa7[_0xa68e('0x2a')],_0x20b2c8[_0xa68e('0x6')]),_0x21d00a);if(_0x212fa7[_0xa68e('0x2a')][_0xa68e('0x32')]){_0x439db5[_0xa68e('0x33')]=_['merge'](_0x439db5[_0xa68e('0x33')],{'$or':_[_0xa68e('0x14')](_0x21d00a,function(_0x1b19ca){if(_0x1b19ca[_0xa68e('0x34')]!==_0xa68e('0x35')){if(_0x1e744d){return sequelize[_0xa68e('0x33')](sequelize['fn'](_0xa68e('0x36'),sequelize[_0xa68e('0x18')](_0x1b19ca['name'])),{'$like':sequelize['fn'](_0xa68e('0x36'),'%'+_0x212fa7[_0xa68e('0x2a')][_0xa68e('0x32')]+'%')});}else{var _0x404044={};_0x404044[_0x1b19ca[_0xa68e('0x2c')]]={'$like':'%'+_0x212fa7[_0xa68e('0x2a')]['filter']+'%'};return _0x404044;}}})});}_0x439db5=_[_0xa68e('0x37')]({},_0x439db5,_0x212fa7['options']);return _0x439db5;}; \ No newline at end of file +var _0xe828=['attributes','intersection','order','where','pick','filter','merge','lower','sequelize','moment','parse','keys','includes','fields','split','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','join','query','$id','model'];(function(_0xecbb24,_0x4a0957){var _0x194540=function(_0x42aac8){while(--_0x42aac8){_0xecbb24['push'](_0xecbb24['shift']());}};_0x194540(++_0x4a0957);}(_0xe828,0xb0));var _0x8e82=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xe828[_0x2e76a7];return _0x454cde;};'use strict';var _=require('lodash');var sequelize=require(_0x8e82('0x0'));var moment=require(_0x8e82('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x111e98){var _0x233837=['ne'];try{var _0x45a106=JSON[_0x8e82('0x2')](_0x111e98);var _0x1f14fc=Object[_0x8e82('0x3')](_0x45a106)[0x0];return _0x233837[_0x8e82('0x4')](_0x1f14fc);}catch(_0x56aa87){return![];}}function getOperatorValue(_0x543553){var _0x55310e=JSON['parse'](_0x543553);var _0x3d4efb=Object['keys'](_0x55310e)[0x0];var _0x30571b=_0x55310e[_0x3d4efb];return{['$'+_0x3d4efb]:_0x30571b};}exports[_0x8e82('0x5')]=function(_0x1ac5b9){var _0x24cde1=null;if(_0x1ac5b9){_0x24cde1=_0x1ac5b9[_0x8e82('0x6')](',');}return _0x24cde1;};exports['filters']=function(_0x175cb1,_0x342145){var _0x1c3a11={};if(!_[_0x8e82('0x7')](_0x175cb1)){_['forOwn'](_0x175cb1,function(_0x4601c8,_0x5e8206){try{if(_0x342145){var _0x2d3625=_[_0x8e82('0x8')](_0x342145,{'name':_0x5e8206})||{};if(hasSequelizeOperator(_0x4601c8)){_0x1c3a11[_0x5e8206]=getOperatorValue(_0x4601c8);}else if(_0x2d3625[_0x8e82('0x9')]===_0x8e82('0xa')&&_[_0x8e82('0xb')](_0x4601c8)){var _0x2413ac=JSON[_0x8e82('0x2')](_0x4601c8);var _0x2c5073={'$gte':moment(moment(_0x2413ac[_0x8e82('0xc')])[_0x8e82('0xd')](_0x8e82('0xe')))[_0x8e82('0xf')]()['format'](),'$lte':moment(moment(_0x2413ac[_0x8e82('0x10')])['format']('YYYY-MM-DD'))[_0x8e82('0xf')]()[_0x8e82('0x11')](0x1,'s')[_0x8e82('0xd')]()};_0x1c3a11[_0x5e8206]=_0x2c5073;}else if(_0x2d3625[_0x8e82('0x12')]===_0x8e82('0x13')){_0x1c3a11[_0x5e8206]=_0x4601c8;}else{_0x1c3a11[_0x5e8206]=_['isArray'](_0x4601c8)?_0x4601c8:JSON[_0x8e82('0x2')](_0x4601c8);}}else{_0x1c3a11[_0x5e8206]=_[_0x8e82('0x14')](_0x4601c8)?_0x4601c8:JSON[_0x8e82('0x2')](_0x4601c8);}}catch(_0x4ba68d){_0x1c3a11[_0x5e8206]=_0x4601c8['split'](',');}});}return _0x1c3a11;};exports[_0x8e82('0x15')]=function(_0x5783c6){_0x5783c6=parseInt(_0x5783c6,0xa);if(!_0x5783c6||_0x5783c6<0x0){_0x5783c6=LIMIT_VALUE;}return _0x5783c6;};exports[_0x8e82('0x16')]=function(_0x52bf1a){_0x52bf1a=parseInt(_0x52bf1a,0xa);if(!_0x52bf1a||_0x52bf1a<0x0){_0x52bf1a=0x0;}return _0x52bf1a;};exports[_0x8e82('0x17')]=function(_0x47b167){var _0x23cd9b,_0x478b0f=null;if(_0x47b167){_0x23cd9b=_0x47b167[_0x8e82('0x6')](',');_0x478b0f=_[_0x8e82('0x18')](_0x23cd9b,function(_0xeaa2c1){if(_0xeaa2c1[_0x8e82('0x19')]('-')===0x0){return[_0xeaa2c1===_0x8e82('0x1a')?sequelize['cast'](sequelize[_0x8e82('0x1b')](_0x8e82('0x1a')),_0x8e82('0x1c')):_0xeaa2c1[_0x8e82('0x1d')](0x1),_0x8e82('0x1e')];}else{return[_0xeaa2c1==='priority'?sequelize['cast'](sequelize[_0x8e82('0x1b')](_0x8e82('0x1a')),_0x8e82('0x1c')):_0xeaa2c1,'ASC'];}});}return _0x478b0f;};exports[_0x8e82('0x1f')]=function(_0x18c859,_0x3a552f){if(_['isEmpty'](_0x18c859)){return _0x18c859;}if(_[_0x8e82('0x14')](_0x18c859)){for(var _0x153c05=0x0;_0x153c05<_0x18c859[_0x8e82('0x20')];_0x153c05+=0x1){_0x18c859[_0x153c05]=this[_0x8e82('0x1f')](_0x18c859[_0x153c05],_0x3a552f);}return _0x18c859;}if(!_[_0x8e82('0x21')](_0x18c859)){return _0x18c859;}if(_[_0x8e82('0x22')](_0x3a552f)){_0x3a552f=[_0x3a552f];}if(!_[_0x8e82('0x14')](_0x3a552f)){return _0x18c859;}for(var _0xc3b3d4=0x0;_0xc3b3d4<_0x3a552f[_0x8e82('0x20')];_0xc3b3d4+=0x1){_[_0x8e82('0x23')](_0x18c859,_0x3a552f[_0xc3b3d4]);}for(var _0x378cd7 in _0x18c859){if(_0x18c859[_0x8e82('0x24')](_0x378cd7)){_0x18c859[_0x378cd7]=this['omit'](_0x18c859[_0x378cd7],_0x3a552f);}}return _0x18c859;};exports[_0x8e82('0x25')]=function(_0x2d5722){return _0x2d5722['match'](RegExp(_0x8e82('0x26')))?!![]:![];};exports[_0x8e82('0x27')]=function(_0x2cc844){return _0x2cc844[_0x8e82('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x8e82('0x29')]=function(_0x17a4e5){var _0xc12785=[];_0x17a4e5['split'](/[ ,]+/)[_0x8e82('0x2a')](function(_0x1c3716){_0x1c3716=_0x1c3716[_0x8e82('0x2b')](/([^:]")"+/g,'$1');_0x1c3716='+'+_0x1c3716+'*';if(_0x1c3716['includes']('@'))_0x1c3716='\x22'+_0x1c3716+'\x22';_0xc12785['push'](_0x1c3716);});return _0xc12785[_0x8e82('0x2c')]('\x20');};exports['getOptions']=function(_0x47825d,_0xf87fd3,_0x49b2ca){var _0x1b4ff6={},_0x187be3={};if(_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x2e')]){_0xf87fd3[_0x8e82('0x2d')]['id']=_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x2e')];delete _0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x2e')];}_0x1b4ff6[_0x8e82('0x2f')]=_[_0x8e82('0x18')](_0x47825d,_0x8e82('0x12'));_0x1b4ff6[_0x8e82('0x2d')]=_[_0x8e82('0x3')](_0xf87fd3[_0x8e82('0x2d')]);_0x1b4ff6['filters']=_['intersection'](_0x1b4ff6[_0x8e82('0x2f')],_0x1b4ff6['query']);_0x187be3[_0x8e82('0x30')]=_[_0x8e82('0x31')](_0x1b4ff6[_0x8e82('0x2f')],this[_0x8e82('0x5')](_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x5')]));_0x187be3['attributes']=_0x187be3[_0x8e82('0x30')]['length']?_0x187be3['attributes']:_0x1b4ff6['model'];if(!_0xf87fd3['query']['hasOwnProperty']('nolimit')){_0x187be3[_0x8e82('0x15')]=this[_0x8e82('0x15')](_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x15')]);_0x187be3[_0x8e82('0x16')]=this[_0x8e82('0x16')](_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x16')]);}_0x187be3[_0x8e82('0x32')]=this['sort'](_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x17')]);_0x187be3[_0x8e82('0x33')]=this['filters'](_[_0x8e82('0x34')](_0xf87fd3['query'],_0x1b4ff6['filters']),_0x47825d);if(_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x35')]){_0x187be3['where']=_[_0x8e82('0x36')](_0x187be3['where'],{'$or':_[_0x8e82('0x18')](_0x47825d,function(_0x1a60ab){if(_0x1a60ab['type']!=='VIRTUAL'){if(_0x49b2ca){return sequelize[_0x8e82('0x33')](sequelize['fn']('lower',sequelize[_0x8e82('0x1b')](_0x1a60ab['name'])),{'$like':sequelize['fn'](_0x8e82('0x37'),'%'+_0xf87fd3['query']['filter']+'%')});}else{var _0x2301d1={};_0x2301d1[_0x1a60ab[_0x8e82('0x12')]]={'$like':'%'+_0xf87fd3[_0x8e82('0x2d')][_0x8e82('0x35')]+'%'};return _0x2301d1;}}})});}_0x187be3=_['merge']({},_0x187be3,_0xf87fd3['options']);return _0x187be3;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6d5185f..a4e03cd 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x929a=['get','env','production','set','appPath','root','development','test','client','use','json\x20replacer','toISOString','static','views','/server/views','html','ejs','renderFile','urlencoded','50mb','json','initialize','serve-favicon','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x929a,0x13f));var _0xa929=function(_0x3a8db1,_0x57eab1){_0x3a8db1=_0x3a8db1-0x0;var _0x4406fd=_0x929a[_0x3a8db1];return _0x4406fd;};'use strict';var express=require('express');var favicon=require(_0xa929('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0xa929('0x1'));var cookieParser=require(_0xa929('0x2'));var errorHandler=require(_0xa929('0x3'));var path=require(_0xa929('0x4'));var passport=require(_0xa929('0x5'));var cors=require(_0xa929('0x6'));var moment=require(_0xa929('0x7'));var config=require(_0xa929('0x8'));var db=require(_0xa929('0x9'))['db'];exports[_0xa929('0xa')]=function(_0x17c34d){var _0x5f2dc9=_0x17c34d[_0xa929('0xb')](_0xa929('0xc'));if(_0x5f2dc9===_0xa929('0xd')){_0x17c34d[_0xa929('0xe')](_0xa929('0xf'),path['join'](config[_0xa929('0x10')],'public'));}if(_0x5f2dc9===_0xa929('0x11')||_0x5f2dc9===_0xa929('0x12')){_0x17c34d[_0xa929('0xe')](_0xa929('0xf'),path['join'](config[_0xa929('0x10')],_0xa929('0x13')));_0x17c34d[_0xa929('0x14')](errorHandler());}_0x17c34d[_0xa929('0xe')](_0xa929('0x15'),function(_0x5def2e,_0x5313ee){if(this[_0x5def2e]instanceof Date){_0x5313ee=this[_0x5def2e][_0xa929('0x16')]()['split']('.')[0x0]+'Z';}return _0x5313ee;});_0x17c34d['use'](express[_0xa929('0x17')](_0x17c34d[_0xa929('0xb')](_0xa929('0xf'))));_0x17c34d['set'](_0xa929('0x18'),config[_0xa929('0x10')]+_0xa929('0x19'));_0x17c34d['engine'](_0xa929('0x1a'),require(_0xa929('0x1b'))[_0xa929('0x1c')]);_0x17c34d[_0xa929('0xe')]('view\x20engine',_0xa929('0x1a'));_0x17c34d[_0xa929('0x14')](bodyParser[_0xa929('0x1d')]({'limit':_0xa929('0x1e'),'extended':!![]}));_0x17c34d[_0xa929('0x14')](bodyParser[_0xa929('0x1f')]({'limit':'50mb'}));_0x17c34d['use'](cors());_0x17c34d['use'](methodOverride());_0x17c34d[_0xa929('0x14')](cookieParser());_0x17c34d[_0xa929('0x14')](passport[_0xa929('0x20')]());}; \ No newline at end of file +var _0x2359=['method-override','errorhandler','path','passport','cors','moment','../mysqldb','get','production','set','appPath','root','public','development','join','use','split','static','views','ejs','view\x20engine','urlencoded','50mb','initialize','express','serve-favicon','body-parser'];(function(_0x101ed8,_0x454f4b){var _0x53d697=function(_0x452278){while(--_0x452278){_0x101ed8['push'](_0x101ed8['shift']());}};_0x53d697(++_0x454f4b);}(_0x2359,0x10b));var _0x9235=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x2359[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require(_0x9235('0x0'));var favicon=require(_0x9235('0x1'));var bodyParser=require(_0x9235('0x2'));var methodOverride=require(_0x9235('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x9235('0x4'));var path=require(_0x9235('0x5'));var passport=require(_0x9235('0x6'));var cors=require(_0x9235('0x7'));var moment=require(_0x9235('0x8'));var config=require('./environment');var db=require(_0x9235('0x9'))['db'];exports['default']=function(_0x5c3d56){var _0x5a46ab=_0x5c3d56[_0x9235('0xa')]('env');if(_0x5a46ab===_0x9235('0xb')){_0x5c3d56[_0x9235('0xc')](_0x9235('0xd'),path['join'](config[_0x9235('0xe')],_0x9235('0xf')));}if(_0x5a46ab===_0x9235('0x10')||_0x5a46ab==='test'){_0x5c3d56[_0x9235('0xc')](_0x9235('0xd'),path[_0x9235('0x11')](config[_0x9235('0xe')],'client'));_0x5c3d56[_0x9235('0x12')](errorHandler());}_0x5c3d56[_0x9235('0xc')]('json\x20replacer',function(_0xfa30c0,_0x1a6d4d){if(this[_0xfa30c0]instanceof Date){_0x1a6d4d=this[_0xfa30c0]['toISOString']()[_0x9235('0x13')]('.')[0x0]+'Z';}return _0x1a6d4d;});_0x5c3d56[_0x9235('0x12')](express[_0x9235('0x14')](_0x5c3d56[_0x9235('0xa')](_0x9235('0xd'))));_0x5c3d56['set'](_0x9235('0x15'),config[_0x9235('0xe')]+'/server/views');_0x5c3d56['engine']('html',require(_0x9235('0x16'))['renderFile']);_0x5c3d56['set'](_0x9235('0x17'),'html');_0x5c3d56[_0x9235('0x12')](bodyParser[_0x9235('0x18')]({'limit':_0x9235('0x19'),'extended':!![]}));_0x5c3d56['use'](bodyParser['json']({'limit':_0x9235('0x19')}));_0x5c3d56[_0x9235('0x12')](cors());_0x5c3d56[_0x9235('0x12')](methodOverride());_0x5c3d56[_0x9235('0x12')](cookieParser());_0x5c3d56['use'](passport[_0x9235('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a2379f4..8c67013 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 _0x1a66=['hostname','macAddress','ipAddress','hex','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','filter','family','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','createHash','md5','update','digest','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x3d83fe,_0x1b9438){var _0x5b130d=function(_0x450385){while(--_0x450385){_0x3d83fe['push'](_0x3d83fe['shift']());}};_0x5b130d(++_0x1b9438);}(_0x1a66,0x85));var _0x61a6=function(_0x10b644,_0x4eb9b0){_0x10b644=_0x10b644-0x0;var _0x4bfc6b=_0x1a66[_0x10b644];return _0x4bfc6b;};'use strict';var _=require(_0x61a6('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x61a6('0x1'));var exec=require('child_process')[_0x61a6('0x2')];var config=require('../environment');function getInterfaces(){var _0x3dc840=[];var _0x30c4fc=os[_0x61a6('0x3')]();var _0x42bd45=_[_0x61a6('0x4')](_[_0x61a6('0x5')](_0x30c4fc));for(var _0x1c67d9=0x0;_0x1c67d9<_0x42bd45['length'];_0x1c67d9++){var _0x561f71=_0x30c4fc[_0x42bd45[_0x1c67d9]][_0x61a6('0x6')](function(_0x1697ca){return _0x1697ca[_0x61a6('0x7')]==='IPv4'&&_0x1697ca['internal']===![];});_0x3dc840=_0x3dc840['concat'](_0x561f71);}return _0x3dc840;}function getFirstInterface(){var _0x38eb39=_[_0x61a6('0x8')](getInterfaces());return{'macAddress':_0x38eb39&&_0x38eb39[_0x61a6('0x9')]?_0x38eb39[_0x61a6('0x9')]:_0x61a6('0xa'),'ipAddress':_0x38eb39&&_0x38eb39[_0x61a6('0xb')]?_0x38eb39[_0x61a6('0xb')]:'127.0.0.1'};}exports[_0x61a6('0xc')]=getFirstInterface;function getCPUhash(){var _0x62a92c=_['orderBy'](os[_0x61a6('0xd')]()[_0x61a6('0xe')](function(_0x423eca){return _0x423eca[_0x61a6('0xf')];}))['join'](':');return crypto[_0x61a6('0x10')](_0x61a6('0x11'))[_0x61a6('0x12')](_0x62a92c)[_0x61a6('0x13')]('hex');}exports['getUuid']=function(){var _0x491aa0=os[_0x61a6('0x14')]();var _0x15282d=/[0-9a-f-]{36}/;if(config[_0x61a6('0x15')]&&_0x15282d[_0x61a6('0x16')](config[_0x61a6('0x15')])){return config[_0x61a6('0x15')];}else if(_0x491aa0===_0x61a6('0x17')){return exec(_0x61a6('0x18'),{'encoding':_0x61a6('0x19')})[_0x61a6('0x1a')]('\x0d\x0a','');}else{var _0x505a95=getFirstInterface();var _0xc26dcb=getCPUhash();var _0x3299cc=_0xc26dcb+'|'+os[_0x61a6('0x1b')]()+'|'+_0x505a95[_0x61a6('0x1c')]+'|'+_0x505a95[_0x61a6('0x1d')];var _0x372358=crypto[_0x61a6('0x10')](_0x61a6('0x11'))[_0x61a6('0x12')](_0x3299cc)[_0x61a6('0x13')](_0x61a6('0x1e'));return _0x372358[_0x61a6('0x1f')](0x0,0x8)+'-'+_0x372358[_0x61a6('0x1f')](0x8,0xc)+'-'+_0x372358['substring'](0xc,0x10)+'-'+_0x372358[_0x61a6('0x1f')](0x10,0x14)+'-'+_0x372358[_0x61a6('0x1f')](0x14);}}; \ No newline at end of file +var _0xbb3a=['update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','00:00:00:00:00:00','address','getFirstInterface','cpus','model','join','createHash','md5','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xbb3a,0x188));var _0xabb3=function(_0x5493ee,_0x3df8e4){_0x5493ee=_0x5493ee-0x0;var _0x229b01=_0xbb3a[_0x5493ee];return _0x229b01;};'use strict';var _=require(_0xabb3('0x0'));var os=require('os');var crypto=require(_0xabb3('0x1'));var machine=require(_0xabb3('0x2'));var exec=require(_0xabb3('0x3'))[_0xabb3('0x4')];var config=require(_0xabb3('0x5'));function getInterfaces(){var _0x270638=[];var _0x510559=os[_0xabb3('0x6')]();var _0x512ad4=_[_0xabb3('0x7')](_[_0xabb3('0x8')](_0x510559));for(var _0x226e3b=0x0;_0x226e3b<_0x512ad4[_0xabb3('0x9')];_0x226e3b++){var _0x17d9e7=_0x510559[_0x512ad4[_0x226e3b]][_0xabb3('0xa')](function(_0x638c2){return _0x638c2[_0xabb3('0xb')]===_0xabb3('0xc')&&_0x638c2[_0xabb3('0xd')]===![];});_0x270638=_0x270638[_0xabb3('0xe')](_0x17d9e7);}return _0x270638;}function getFirstInterface(){var _0x58a9c9=_[_0xabb3('0xf')](getInterfaces());return{'macAddress':_0x58a9c9&&_0x58a9c9['mac']?_0x58a9c9['mac']:_0xabb3('0x10'),'ipAddress':_0x58a9c9&&_0x58a9c9[_0xabb3('0x11')]?_0x58a9c9[_0xabb3('0x11')]:'127.0.0.1'};}exports[_0xabb3('0x12')]=getFirstInterface;function getCPUhash(){var _0x506a65=_[_0xabb3('0x7')](os[_0xabb3('0x13')]()['map'](function(_0x2a4b43){return _0x2a4b43[_0xabb3('0x14')];}))[_0xabb3('0x15')](':');return crypto[_0xabb3('0x16')](_0xabb3('0x17'))['update'](_0x506a65)[_0xabb3('0x18')](_0xabb3('0x19'));}exports[_0xabb3('0x1a')]=function(){var _0x344bad=os[_0xabb3('0x1b')]();var _0x26defd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x26defd[_0xabb3('0x1c')](config[_0xabb3('0x1d')])){return config[_0xabb3('0x1d')];}else if(_0x344bad===_0xabb3('0x1e')){return exec(_0xabb3('0x1f'),{'encoding':_0xabb3('0x20')})[_0xabb3('0x21')]('\x0d\x0a','');}else{var _0xc1cf04=getFirstInterface();var _0x17bebe=getCPUhash();var _0x4f164b=_0x17bebe+'|'+os[_0xabb3('0x22')]()+'|'+_0xc1cf04[_0xabb3('0x23')]+'|'+_0xc1cf04[_0xabb3('0x24')];var _0x56cb9b=crypto[_0xabb3('0x16')](_0xabb3('0x17'))[_0xabb3('0x25')](_0x4f164b)[_0xabb3('0x18')]('hex');return _0x56cb9b[_0xabb3('0x26')](0x0,0x8)+'-'+_0x56cb9b[_0xabb3('0x26')](0x8,0xc)+'-'+_0x56cb9b['substring'](0xc,0x10)+'-'+_0x56cb9b['substring'](0x10,0x14)+'-'+_0x56cb9b[_0xabb3('0x26')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 125eca1..5e59de5 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 _0x1328=['Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0x1328,0x9c));var _0x8132=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1328[_0x618414];return _0x21c19a;};'use strict';var util=require(_0x8132('0x0'));var moment=require(_0x8132('0x1'));var rp=require(_0x8132('0x2'));var BPromise=require(_0x8132('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x8132('0x4'))['db'];var encryptor=require(_0x8132('0x5'));var hardware=require(_0x8132('0x6'));var logger=require('../logger')(_0x8132('0x7'));var HOST=_0x8132('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x592e3d){return new BPromise(function(_0x51a5cb,_0x2db8a6){var _0x5a9a1f=util[_0x8132('0x9')](_0x8132('0xa'),HOST,_0x592e3d,module[_0x8132('0xb')][_0x8132('0xc')]);if(oldToken){_0x5a9a1f=util[_0x8132('0x9')](_0x8132('0xd'),HOST,_0x592e3d,module[_0x8132('0xb')]['version'],oldToken);}var _0x1bacb2={'uri':_0x5a9a1f,'method':_0x8132('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x1bacb2)[_0x8132('0xf')](function(_0x2350ba){_0x51a5cb(_0x2350ba);})[_0x8132('0x10')](function(_0x5a7d12){_0x2db8a6(_0x5a7d12);});});}function manageLicense(_0x3c87d7,_0x45aa24){var _0x1cf99c=_0x45aa24[_0x8132('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x1cf99c[_0x8132('0x12')]!==_0x3c87d7&&!_0x1cf99c[_0x8132('0x13')]){oldToken=_0x1cf99c[_0x8132('0x12')];}httpRequest(_0x3c87d7)[_0x8132('0xf')](function(_0x2c8f1b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2c8f1b[_0x8132('0x14')]){isOldTokenSent=![];if(!_0x1cf99c[_0x8132('0x7')]&&_0x1cf99c[_0x8132('0x7')]!=_0x2c8f1b[_0x8132('0x7')]||_0x1cf99c[_0x8132('0x7')]&&_0x1cf99c[_0x8132('0x13')]){logger[_0x8132('0x15')](_0x8132('0x16'));}if(_0x1cf99c['license']&&!_0x1cf99c['data2']&&_0x1cf99c['license']!=_0x2c8f1b[_0x8132('0x7')]){logger['info'](_0x8132('0x17'));}if(_0x1cf99c[_0x8132('0x7')]&&!_0x1cf99c['data2']&&_0x1cf99c['license']==_0x2c8f1b[_0x8132('0x7')]){return _0x45aa24;}return _0x45aa24['update']({'data1':_0x3c87d7,'data2':null,'license':_0x2c8f1b[_0x8132('0x7')]});}else{if(_0x2c8f1b[_0x8132('0x7')]||_0x1cf99c[_0x8132('0x7')]){if(!_0x1cf99c[_0x8132('0x13')]){if(_0x1cf99c['data1']==_0x3c87d7){GRAY_PERIOD_REASON=_0x8132('0x18');logger[_0x8132('0x15')](_0x8132('0x19'));}else{GRAY_PERIOD_REASON=_0x8132('0x1a');logger[_0x8132('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1cf99c['data1'],_0x3c87d7);}logger[_0x8132('0x15')](_0x8132('0x1b'),GRAY_PERIOD_REASON[_0x8132('0x1c')](),moment()[_0x8132('0x9')](_0x8132('0x1d')));return _0x45aa24[_0x8132('0x1e')]({'data2':encryptor[_0x8132('0x1f')](moment()[_0x8132('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x8132('0x20')](encryptor[_0x8132('0x21')](_0x1cf99c[_0x8132('0x13')]),_0x8132('0x22'))>DAYS){logger[_0x8132('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x8132('0x9')](_0x8132('0x1d')));isOldTokenSent=![];return _0x45aa24[_0x8132('0x1e')]({'data1':_0x3c87d7,'data2':null,'license':null});}}}else{if(_0x1cf99c[_0x8132('0x12')]!=_0x3c87d7){logger[_0x8132('0x15')](_0x8132('0x23'),_0x1cf99c[_0x8132('0x12')],_0x3c87d7);return _0x45aa24['update']({'data1':_0x3c87d7,'data2':null,'license':null});}}}return _0x45aa24;})[_0x8132('0xf')](function(_0x879c4b){_0x45aa24=_0x879c4b;})['catch'](function(_0x36b55d){logger[_0x8132('0x24')](_0x36b55d[_0x8132('0x25')]);})[_0x8132('0x26')](function(){setTimeout(function(){manageLicense(hardware[_0x8132('0x27')](),_0x45aa24);},TIME);});}function defaultLicense(){var _0x4e7e7a=hardware[_0x8132('0x27')]();if(_0x4e7e7a){return db[_0x8132('0x28')][_0x8132('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x4e7e7a}})[_0x8132('0x2a')](function(_0x4dda57,_0x4ed69c){logger['info'](_0x8132('0x2b'),_0x4e7e7a);manageLicense(_0x4e7e7a,_0x4dda57);})[_0x8132('0x10')](function(_0x39ef67){logger[_0x8132('0x24')](_0x39ef67['message']);});}}exports[_0x8132('0x2c')]=defaultLicense; \ No newline at end of file +var _0xf95e=['bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data2','data1','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','catch','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise'];(function(_0x36daf3,_0x2ea0dd){var _0x3e4e26=function(_0x31999a){while(--_0x31999a){_0x36daf3['push'](_0x36daf3['shift']());}};_0x3e4e26(++_0x2ea0dd);}(_0xf95e,0x78));var _0xef95=function(_0x349561,_0x576f91){_0x349561=_0x349561-0x0;var _0x243f24=_0xf95e[_0x349561];return _0x243f24;};'use strict';var util=require(_0xef95('0x0'));var moment=require(_0xef95('0x1'));var rp=require(_0xef95('0x2'));var BPromise=require(_0xef95('0x3'));var pkginfo=require(_0xef95('0x4'))(module,_0xef95('0x5'));var db=require(_0xef95('0x6'))['db'];var encryptor=require(_0xef95('0x7'));var hardware=require('./hardware');var logger=require(_0xef95('0x8'))(_0xef95('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2df8eb){return new BPromise(function(_0x4c53ee,_0x3074e1){var _0x590cc2=util[_0xef95('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x2df8eb,module[_0xef95('0xb')][_0xef95('0x5')]);if(oldToken){_0x590cc2=util[_0xef95('0xa')](_0xef95('0xc'),HOST,_0x2df8eb,module[_0xef95('0xb')][_0xef95('0x5')],oldToken);}var _0x36f046={'uri':_0x590cc2,'method':_0xef95('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x36f046)['then'](function(_0x186669){_0x4c53ee(_0x186669);})['catch'](function(_0x2fa72d){_0x3074e1(_0x2fa72d);});});}function manageLicense(_0x1fa768,_0xe7a0d4){var _0x370a09=_0xe7a0d4[_0xef95('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x370a09['data1']!==_0x1fa768&&!_0x370a09[_0xef95('0xf')]){oldToken=_0x370a09[_0xef95('0x10')];}httpRequest(_0x1fa768)[_0xef95('0x11')](function(_0x22ba73){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x22ba73[_0xef95('0x12')]){isOldTokenSent=![];if(!_0x370a09[_0xef95('0x9')]&&_0x370a09[_0xef95('0x9')]!=_0x22ba73[_0xef95('0x9')]||_0x370a09['license']&&_0x370a09['data2']){logger[_0xef95('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x370a09[_0xef95('0x9')]&&!_0x370a09[_0xef95('0xf')]&&_0x370a09[_0xef95('0x9')]!=_0x22ba73[_0xef95('0x9')]){logger[_0xef95('0x13')](_0xef95('0x14'));}if(_0x370a09[_0xef95('0x9')]&&!_0x370a09[_0xef95('0xf')]&&_0x370a09[_0xef95('0x9')]==_0x22ba73['license']){return _0xe7a0d4;}return _0xe7a0d4[_0xef95('0x15')]({'data1':_0x1fa768,'data2':null,'license':_0x22ba73[_0xef95('0x9')]});}else{if(_0x22ba73[_0xef95('0x9')]||_0x370a09[_0xef95('0x9')]){if(!_0x370a09['data2']){if(_0x370a09[_0xef95('0x10')]==_0x1fa768){GRAY_PERIOD_REASON=_0xef95('0x16');logger[_0xef95('0x13')](_0xef95('0x17'));}else{GRAY_PERIOD_REASON=_0xef95('0x18');logger[_0xef95('0x13')](_0xef95('0x19'),_0x370a09[_0xef95('0x10')],_0x1fa768);}logger[_0xef95('0x13')](_0xef95('0x1a'),GRAY_PERIOD_REASON[_0xef95('0x1b')](),moment()[_0xef95('0xa')](_0xef95('0x1c')));return _0xe7a0d4[_0xef95('0x15')]({'data2':encryptor[_0xef95('0x1d')](moment()[_0xef95('0xa')](_0xef95('0x1c')))});}else{if(moment()[_0xef95('0x1e')](encryptor[_0xef95('0x1f')](_0x370a09[_0xef95('0xf')]),_0xef95('0x20'))>DAYS){logger[_0xef95('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0xef95('0xa')](_0xef95('0x1c')));isOldTokenSent=![];return _0xe7a0d4[_0xef95('0x15')]({'data1':_0x1fa768,'data2':null,'license':null});}}}else{if(_0x370a09[_0xef95('0x10')]!=_0x1fa768){logger[_0xef95('0x13')](_0xef95('0x19'),_0x370a09[_0xef95('0x10')],_0x1fa768);return _0xe7a0d4[_0xef95('0x15')]({'data1':_0x1fa768,'data2':null,'license':null});}}}return _0xe7a0d4;})[_0xef95('0x11')](function(_0x34d315){_0xe7a0d4=_0x34d315;})[_0xef95('0x21')](function(_0x27f596){logger[_0xef95('0x22')](_0x27f596[_0xef95('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xe7a0d4);},TIME);});}function defaultLicense(){var _0x2d2313=hardware[_0xef95('0x24')]();if(_0x2d2313){return db['License'][_0xef95('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x2d2313}})[_0xef95('0x26')](function(_0x520d1f,_0x565be6){logger['info'](_0xef95('0x27'),_0x2d2313);manageLicense(_0x2d2313,_0x520d1f);})[_0xef95('0x21')](function(_0x2a17b8){logger[_0xef95('0x22')](_0x2a17b8['message']);});}}exports[_0xef95('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index da35fa6..bbd0073 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 _0x6f19=['2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','machineUuid','gray','deadline','add','days','grayReason','changed','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephones','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license'];(function(_0x4ea9d8,_0x21de2c){var _0x33d2fa=function(_0x2e61c0){while(--_0x2e61c0){_0x4ea9d8['push'](_0x4ea9d8['shift']());}};_0x33d2fa(++_0x21de2c);}(_0x6f19,0xb2));var _0x96f1=function(_0x5653cb,_0x5d09f9){_0x5653cb=_0x5653cb-0x0;var _0x3aed9a=_0x6f19[_0x5653cb];return _0x3aed9a;};'use strict';var util=require('util');var _=require(_0x96f1('0x0'));var moment=require(_0x96f1('0x1'));var BPromise=require(_0x96f1('0x2'));var hardware=require(_0x96f1('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x96f1('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':_0x96f1('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x96f1('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x96f1('0x7'),'machineUuid':hardware[_0x96f1('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x20c540){return new BPromise(function(_0x4987c6,_0x571e8b){return db[_0x96f1('0x9')][_0x96f1('0xa')](_[_0x96f1('0xb')](_0x20c540,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2c50bf){return checkLicense(_0x2c50bf,null);})[_0x96f1('0xc')](function(_0xc22fa4){_0x4987c6(_0xc22fa4);return;})[_0x96f1('0xd')](function(_0x285a6d){_0x571e8b(_0x285a6d);});});}function checkLicense(_0x10a104,_0x914a1a){if(!_0x10a104){demoLicense[_0x96f1('0xe')]=_0x10a104[_0x96f1('0xf')];return demoLicense;}try{var _0x3029f8=_0x914a1a||_0x10a104[_0x96f1('0x10')];if(_[_0x96f1('0x11')](_0x3029f8)){throw new Error(_0x96f1('0x12'));}var _0x25fb6c=_0x10a104[_0x96f1('0xf')];var _0x19a45e=_0x10a104[_0x96f1('0x13')];var _0x3374b2=_0x25fb6c[_0x96f1('0x14')]('-')[0x4];var _0x4b9a68=_0x25fb6c[_0x96f1('0x14')]('-')[0x0];var _0x34da18=encryptor[_0x96f1('0x15')](_0x3029f8,util[_0x96f1('0x16')](_0x96f1('0x17'),_0x3374b2,_0x25fb6c,_0x4b9a68));var _0x4ed6f3=JSON['parse'](_0x34da18);_0x4ed6f3['demo']=![];_0x4ed6f3[_0x96f1('0xe')]=_0x25fb6c;_0x4ed6f3[_0x96f1('0x18')]=hardware[_0x96f1('0x8')]();if(_0x19a45e){var _0x36e236=encryptor[_0x96f1('0x15')](_0x19a45e);_0x4ed6f3[_0x96f1('0x19')]=_0x36e236;_0x4ed6f3[_0x96f1('0x1a')]=moment(_0x36e236)[_0x96f1('0x1b')](0x7,_0x96f1('0x1c'))['format']();_0x4ed6f3[_0x96f1('0x1d')]=_0x4ed6f3[_0x96f1('0xe')]!=_0x4ed6f3[_0x96f1('0x18')]?_0x96f1('0x1e'):'disabled';}return _0x4ed6f3;}catch(_0x12e169){breakingLicense['uuid']=_0x10a104['data1'];breakingLicense['message']=_0x12e169['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3098de,_0xe65f2f){getLicense()[_0x96f1('0xc')](function(_0x5f3b53){return db[_0x96f1('0x1f')][_0x96f1('0x20')]({'attributes':['role',[db[_0x96f1('0x21')]['fn'](_0x96f1('0x22'),db['sequelize'][_0x96f1('0x23')](_0x96f1('0x24'))),_0x96f1('0x25')]],'group':_0x96f1('0x24'),'where':{'role':{'$or':[_0x96f1('0x26'),_0x96f1('0x27'),'telephone']}},'raw':!![]})[_0x96f1('0xc')](function(_0x54217b){var _0xa5101b={'user':_0x5f3b53['users']||0x0,'telephone':_0x5f3b53[_0x96f1('0x28')]||0x0};_0x54217b['forEach'](function(_0x663c34){var _0x15ce0a=_0x663c34[_0x96f1('0x24')]==='admin'?_0x96f1('0x27'):_0x663c34[_0x96f1('0x24')];_0xa5101b[_0x15ce0a]-=_0x663c34[_0x96f1('0x25')];if(_0xa5101b[_0x15ce0a]<0x0)_0xa5101b[_0x15ce0a]=0x0;});_0x3098de(_0xa5101b);return;});})[_0x96f1('0xd')](function(_0x57c31f){_0xe65f2f(_0x57c31f);});});}function checkUserLimits(_0x5cec64){return new BPromise(function(_0x154c62,_0x36ae4d){getLimits()[_0x96f1('0xc')](function(_0xcf43d3){var _0x34d557=_[_0x96f1('0x29')](_['countBy'](_0x5cec64,_0x96f1('0x24')),[_0x96f1('0x26'),_0x96f1('0x27'),'telephone']);var _0x4ae342=(_0x34d557['admin']||0x0)+(_0x34d557['user']||0x0);var _0xcedf55=_0x34d557[_0x96f1('0x2a')]||0x0;if(_0x4ae342>_0xcf43d3[_0x96f1('0x27')])return _0x36ae4d(_0x96f1('0x2b'));if(_0xcedf55>_0xcf43d3[_0x96f1('0x2a')])return _0x36ae4d(_0x96f1('0x2c'));return _0x154c62();})[_0x96f1('0xd')](function(_0xbe685e){_0x36ae4d(_0xbe685e);});});}module[_0x96f1('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb10c=['%s:%s:%s','parse','machineUuid','gray','deadline','add','days','grayReason','changed','message','findAll','COUNT','sequelize','col','role','count','admin','telephone','users','telephones','forEach','user','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format'];(function(_0xc527f5,_0x1f7c5c){var _0x41f85c=function(_0x1a1d7a){while(--_0x1a1d7a){_0xc527f5['push'](_0xc527f5['shift']());}};_0x41f85c(++_0x1f7c5c);}(_0xb10c,0x13f));var _0xcb10=function(_0x313b89,_0xbcda6){_0x313b89=_0x313b89-0x0;var _0x48dcf9=_0xb10c[_0x313b89];return _0x48dcf9;};'use strict';var util=require(_0xcb10('0x0'));var _=require(_0xcb10('0x1'));var moment=require(_0xcb10('0x2'));var BPromise=require(_0xcb10('0x3'));var hardware=require(_0xcb10('0x4'));var encryptor=require(_0xcb10('0x5'));var db=require(_0xcb10('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcb10('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xcb10('0x8'),'machineUuid':hardware[_0xcb10('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcb10('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xcb10('0xa'),'machineUuid':hardware[_0xcb10('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3a3312){return new BPromise(function(_0x39fe75,_0x2dae5b){return db[_0xcb10('0xb')][_0xcb10('0xc')](_['defaults'](_0x3a3312,{'raw':!![],'where':{'id':0x1}}))[_0xcb10('0xd')](function(_0x1455f5){return checkLicense(_0x1455f5,null);})[_0xcb10('0xd')](function(_0x2ecad4){_0x39fe75(_0x2ecad4);return;})[_0xcb10('0xe')](function(_0x5d330a){_0x2dae5b(_0x5d330a);});});}function checkLicense(_0x22d1e5,_0xcfa650){if(!_0x22d1e5){demoLicense[_0xcb10('0xf')]=_0x22d1e5['data1'];return demoLicense;}try{var _0x188b78=_0xcfa650||_0x22d1e5[_0xcb10('0x10')];if(_[_0xcb10('0x11')](_0x188b78)){throw new Error(_0xcb10('0x12'));}var _0x2a279f=_0x22d1e5[_0xcb10('0x13')];var _0x3e19c6=_0x22d1e5[_0xcb10('0x14')];var _0x2c2c41=_0x2a279f[_0xcb10('0x15')]('-')[0x4];var _0x2c1667=_0x2a279f[_0xcb10('0x15')]('-')[0x0];var _0x16210f=encryptor[_0xcb10('0x16')](_0x188b78,util[_0xcb10('0x17')](_0xcb10('0x18'),_0x2c2c41,_0x2a279f,_0x2c1667));var _0x3debf3=JSON[_0xcb10('0x19')](_0x16210f);_0x3debf3['demo']=![];_0x3debf3[_0xcb10('0xf')]=_0x2a279f;_0x3debf3[_0xcb10('0x1a')]=hardware[_0xcb10('0x9')]();if(_0x3e19c6){var _0x386aa0=encryptor[_0xcb10('0x16')](_0x3e19c6);_0x3debf3[_0xcb10('0x1b')]=_0x386aa0;_0x3debf3[_0xcb10('0x1c')]=moment(_0x386aa0)[_0xcb10('0x1d')](0x7,_0xcb10('0x1e'))[_0xcb10('0x17')]();_0x3debf3[_0xcb10('0x1f')]=_0x3debf3[_0xcb10('0xf')]!=_0x3debf3['machineUuid']?_0xcb10('0x20'):'disabled';}return _0x3debf3;}catch(_0x47deaf){breakingLicense[_0xcb10('0xf')]=_0x22d1e5[_0xcb10('0x13')];breakingLicense[_0xcb10('0x21')]=_0x47deaf[_0xcb10('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2436dc,_0x7cba9a){getLicense()[_0xcb10('0xd')](function(_0x10c900){return db['User'][_0xcb10('0x22')]({'attributes':['role',[db['sequelize']['fn'](_0xcb10('0x23'),db[_0xcb10('0x24')][_0xcb10('0x25')](_0xcb10('0x26'))),_0xcb10('0x27')]],'group':'role','where':{'role':{'$or':[_0xcb10('0x28'),'user',_0xcb10('0x29')]}},'raw':!![]})[_0xcb10('0xd')](function(_0x4ae5d0){var _0x40f3cd={'user':_0x10c900[_0xcb10('0x2a')]||0x0,'telephone':_0x10c900[_0xcb10('0x2b')]||0x0};_0x4ae5d0[_0xcb10('0x2c')](function(_0x2fca39){var _0x4f3c05=_0x2fca39[_0xcb10('0x26')]===_0xcb10('0x28')?_0xcb10('0x2d'):_0x2fca39[_0xcb10('0x26')];_0x40f3cd[_0x4f3c05]-=_0x2fca39[_0xcb10('0x27')];if(_0x40f3cd[_0x4f3c05]<0x0)_0x40f3cd[_0x4f3c05]=0x0;});_0x2436dc(_0x40f3cd);return;});})[_0xcb10('0xe')](function(_0x4c06d4){_0x7cba9a(_0x4c06d4);});});}function checkUserLimits(_0x4b1f40){return new BPromise(function(_0x22c586,_0x518de6){getLimits()[_0xcb10('0xd')](function(_0x2ef351){var _0x58e767=_['pick'](_[_0xcb10('0x2e')](_0x4b1f40,_0xcb10('0x26')),[_0xcb10('0x28'),_0xcb10('0x2d'),'telephone']);var _0x50ebbf=(_0x58e767['admin']||0x0)+(_0x58e767[_0xcb10('0x2d')]||0x0);var _0x2eba1e=_0x58e767[_0xcb10('0x29')]||0x0;if(_0x50ebbf>_0x2ef351[_0xcb10('0x2d')])return _0x518de6(_0xcb10('0x2f'));if(_0x2eba1e>_0x2ef351['telephone'])return _0x518de6(_0xcb10('0x30'));return _0x22c586();})[_0xcb10('0xe')](function(_0x13f571){_0x518de6(_0x13f571);});});}module['exports']={'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 76f3941..aba5f9b 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 _0x583c=['http://localhost:9000','myappanuglar-secret','app-id','exports'];(function(_0x2090eb,_0x49384f){var _0x530d65=function(_0x2fba43){while(--_0x2fba43){_0x2090eb['push'](_0x2090eb['shift']());}};_0x530d65(++_0x49384f);}(_0x583c,0x12b));var _0xc583=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x583c[_0x4bdf64];return _0x9a1a19;};'use strict';module[_0xc583('0x0')]={'DOMAIN':_0xc583('0x1'),'SESSION_SECRET':_0xc583('0x2'),'GOOGLE_ID':_0xc583('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x3de3=['exports','myappanuglar-secret','app-id'];(function(_0x341382,_0x3fe3da){var _0x315226=function(_0x10a737){while(--_0x10a737){_0x341382['push'](_0x341382['shift']());}};_0x315226(++_0x3fe3da);}(_0x3de3,0x1ce));var _0x33de=function(_0xd4b336,_0xe9fccd){_0xd4b336=_0xd4b336-0x0;var _0x466b1a=_0x3de3[_0xd4b336];return _0x466b1a;};'use strict';module[_0x33de('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x33de('0x1'),'GOOGLE_ID':_0x33de('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index e3eebcf..dc3b805 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0852=['transports','env','debugLevel','moment','util','path','join','/var','log','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','%s-%s','error','File','info'];(function(_0x1b9dc1,_0x1b5131){var _0x177240=function(_0x2c21ad){while(--_0x2c21ad){_0x1b9dc1['push'](_0x1b9dc1['shift']());}};_0x177240(++_0x1b5131);}(_0x0852,0x8d));var _0x2085=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0852[_0x25e7cb];return _0x375d92;};'use strict';var moment=require(_0x2085('0x0'));var winston=require('winston');var util=require(_0x2085('0x1'));var path=require(_0x2085('0x2'));var debugLevel='INFO';function filename(_0x300a27,_0x474e1a){return path[_0x2085('0x3')](_0x2085('0x4'),_0x2085('0x5'),'xcally',util[_0x2085('0x6')]('%s-%s.log',_0x300a27,_0x474e1a));}function formatter(_0x54938a,_0x6c2938){_0x6c2938[_0x2085('0x7')]=_0x6c2938[_0x2085('0x7')][_0x2085('0x8')](/@@{/g,'{{{')[_0x2085('0x8')](/}@@/g,_0x2085('0x9'))['replace'](/@{/g,'{{')[_0x2085('0x8')](/}@/g,'}}');return util[_0x2085('0x6')](_0x2085('0xa'),moment()[_0x2085('0x6')](_0x2085('0xb')),_0x6c2938[_0x2085('0xc')][_0x2085('0xd')](),_0x54938a,_0x6c2938[_0x2085('0x7')]);}module[_0x2085('0xe')]=function(_0x34aede){return new winston[(_0x2085('0xf'))]({'transports':[new winston['transports']['File']({'name':util[_0x2085('0x6')](_0x2085('0x10'),_0x34aede,_0x2085('0x11')),'filename':filename(_0x34aede,_0x2085('0x11')),'level':_0x2085('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x532471){return formatter(_0x34aede,_0x532471);}}),new winston['transports'][(_0x2085('0x12'))]({'name':util[_0x2085('0x6')](_0x2085('0x10'),_0x34aede,_0x2085('0x13')),'filename':filename(_0x34aede,_0x2085('0x13')),'level':_0x2085('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b5b20){return formatter(_0x34aede,_0x2b5b20);}}),new winston[(_0x2085('0x14'))]['Console']({'level':process[_0x2085('0x15')][_0x2085('0x16')]||debugLevel,'json':![],'formatter':function(_0x18e7c8){return formatter(_0x34aede,_0x18e7c8);}})]});}; \ No newline at end of file +var _0xee40=['info','Console','debugLevel','util','join','/var','xcally','format','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','File','error','%s-%s'];(function(_0x46b8bb,_0x40ec7b){var _0x3731d7=function(_0x4bb710){while(--_0x4bb710){_0x46b8bb['push'](_0x46b8bb['shift']());}};_0x3731d7(++_0x40ec7b);}(_0xee40,0x67));var _0x0ee4=function(_0x262378,_0x84a1bf){_0x262378=_0x262378-0x0;var _0x2c169e=_0xee40[_0x262378];return _0x2c169e;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x0ee4('0x0'));var path=require('path');var debugLevel='INFO';function filename(_0x2a6b29,_0x525ebe){return path[_0x0ee4('0x1')](_0x0ee4('0x2'),'log',_0x0ee4('0x3'),util[_0x0ee4('0x4')]('%s-%s.log',_0x2a6b29,_0x525ebe));}function formatter(_0x5d12dc,_0x38c007){_0x38c007[_0x0ee4('0x5')]=_0x38c007[_0x0ee4('0x5')][_0x0ee4('0x6')](/@@{/g,_0x0ee4('0x7'))[_0x0ee4('0x6')](/}@@/g,_0x0ee4('0x8'))[_0x0ee4('0x6')](/@{/g,'{{')[_0x0ee4('0x6')](/}@/g,'}}');return util[_0x0ee4('0x4')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x0ee4('0x9')),_0x38c007['level'][_0x0ee4('0xa')](),_0x5d12dc,_0x38c007[_0x0ee4('0x5')]);}module[_0x0ee4('0xb')]=function(_0xec6db5){return new winston[(_0x0ee4('0xc'))]({'transports':[new winston[(_0x0ee4('0xd'))][(_0x0ee4('0xe'))]({'name':util[_0x0ee4('0x4')]('%s-%s',_0xec6db5,'error'),'filename':filename(_0xec6db5,_0x0ee4('0xf')),'level':_0x0ee4('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3e8e88){return formatter(_0xec6db5,_0x3e8e88);}}),new winston[(_0x0ee4('0xd'))][(_0x0ee4('0xe'))]({'name':util[_0x0ee4('0x4')](_0x0ee4('0x10'),_0xec6db5,_0x0ee4('0x11')),'filename':filename(_0xec6db5,_0x0ee4('0x11')),'level':_0x0ee4('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x566150){return formatter(_0xec6db5,_0x566150);}}),new winston['transports'][(_0x0ee4('0x12'))]({'level':process['env'][_0x0ee4('0x13')]||debugLevel,'json':![],'formatter':function(_0x4783ee){return formatter(_0xec6db5,_0x4783ee);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index eea2f88..7f6e749 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 _0x803c=['../../services/routing/index.js','../../services/xdr/index.js','exports','express','../../services/ami/index.js','agi','join','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0x47396a,_0x13736a){var _0x18239e=function(_0x1bae85){while(--_0x1bae85){_0x47396a['push'](_0x47396a['shift']());}};_0x18239e(++_0x13736a);}(_0x803c,0x189));var _0xc803=function(_0x318f61,_0x509ae0){_0x318f61=_0x318f61-0x0;var _0x223433=_0x803c[_0x318f61];return _0x223433;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc803('0x0'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':'ami','script':path['join'](__dirname,_0xc803('0x1'))},{'name':_0xc803('0x2'),'script':path[_0xc803('0x3')](__dirname,_0xc803('0x4'))},{'name':'email','script':path[_0xc803('0x3')](__dirname,_0xc803('0x5'))},{'name':_0xc803('0x6'),'script':path['join'](__dirname,_0xc803('0x7'))},{'name':'xdr','script':path['join'](__dirname,_0xc803('0x8'))}]};module[_0xc803('0x9')]=config; \ No newline at end of file +var _0xcb92=['express','join','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','exports','path'];(function(_0x21d0e5,_0x3bb805){var _0x15a2f0=function(_0x16c962){while(--_0x16c962){_0x21d0e5['push'](_0x21d0e5['shift']());}};_0x15a2f0(++_0x3bb805);}(_0xcb92,0x11f));var _0x2cb9=function(_0x43f06e,_0x37c352){_0x43f06e=_0x43f06e-0x0;var _0x223132=_0xcb92[_0x43f06e];return _0x223132;};'use strict';var path=require(_0x2cb9('0x0'));var os=require('os');var config={'apps':[{'name':_0x2cb9('0x1'),'script':path[_0x2cb9('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x2cb9('0x3'),'script':path[_0x2cb9('0x2')](__dirname,_0x2cb9('0x4'))},{'name':'agi','script':path[_0x2cb9('0x2')](__dirname,_0x2cb9('0x5'))},{'name':'email','script':path[_0x2cb9('0x2')](__dirname,_0x2cb9('0x6'))},{'name':_0x2cb9('0x7'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x2cb9('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index cf0d8e7..5aae42a 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 _0x91be=['connect','start','disconnect','stop','restart','then','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x3f88e5,_0x404191){var _0x3a5984=function(_0x1f7608){while(--_0x1f7608){_0x3f88e5['push'](_0x3f88e5['shift']());}};_0x3a5984(++_0x404191);}(_0x91be,0x123));var _0xe91b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x91be[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0xe91b('0x0'));var BPromise=require(_0xe91b('0x1'));var config=require(_0xe91b('0x2'));function connect(){return new BPromise(function(_0x5d2e21,_0x1bb9b4){return pm2[_0xe91b('0x3')](function(_0x201365){if(_0x201365){return _0x1bb9b4(_0x201365);}return _0x5d2e21('connected');});});};exports[_0xe91b('0x4')]=function(_0x46e16b){return connect()['then'](function(){return new BPromise(function(_0x1b3cb9,_0x3d90c8){return pm2[_0xe91b('0x4')](_0x46e16b,function(_0x47432b,_0x194fc3){if(_0x47432b){return _0x3d90c8(_0x47432b);}pm2[_0xe91b('0x5')]();return _0x1b3cb9(_0x194fc3);});});});};exports[_0xe91b('0x6')]=function(_0x27d7c3){return connect()['then'](function(){return new BPromise(function(_0x23637c,_0x432d9f){return pm2[_0xe91b('0x6')](_0x27d7c3,function(_0x1b8405,_0x44d238){if(_0x1b8405){return _0x432d9f(_0x1b8405);}pm2[_0xe91b('0x5')]();return _0x23637c(_0x44d238);});});});};exports[_0xe91b('0x7')]=function(_0x58242a){return connect()[_0xe91b('0x8')](function(){return new BPromise(function(_0x16822f,_0x29bcb9){return pm2[_0xe91b('0x7')](_0x58242a,function(_0x2a9902,_0x153905){if(_0x2a9902){return _0x29bcb9(_0x2a9902);}pm2[_0xe91b('0x5')]();return _0x16822f(_0x153905);});});});};exports['list']=function(){return connect()[_0xe91b('0x8')](function(){return new BPromise(function(_0x457df2,_0x1f5316){return pm2[_0xe91b('0x9')](function(_0xd1f0aa,_0x2d3e68){if(_0xd1f0aa){return _0x1f5316(_0xd1f0aa);}pm2['disconnect']();return _0x457df2(_0x2d3e68);});});});};exports[_0xe91b('0xa')]=function(_0xf067ac){return connect()['then'](function(){return new BPromise(function(_0x53faae,_0x414c40){return pm2[_0xe91b('0xa')](_0xf067ac,function(_0x3dc4cc,_0x4070df){if(_0x3dc4cc){return _0x414c40(_0x3dc4cc);}pm2[_0xe91b('0x5')]();return _0x53faae(_0x4070df);});});});};exports[_0xe91b('0xb')]=function(_0x53841d){return connect()[_0xe91b('0x8')](function(){return new BPromise(function(_0x5bb14a,_0x5c4c5f){return pm2[_0xe91b('0xb')](_0x53841d,function(_0x218128,_0x14e295){if(_0x218128){return _0x5c4c5f(_0x218128);}pm2[_0xe91b('0x5')]();return _0x5bb14a(_0x14e295);});});});};exports[_0xe91b('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x40bda9,_0x1345d2){return pm2[_0xe91b('0xc')](function(_0x46bf42){if(_0x46bf42){return _0x1345d2(_0x46bf42);}return _0x40bda9(_0xe91b('0xd'));});});});}; \ No newline at end of file +var _0x991e=['start','then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','connect','connected'];(function(_0x113e4b,_0x36ed8b){var _0x3a9ef9=function(_0x3412d7){while(--_0x3412d7){_0x113e4b['push'](_0x113e4b['shift']());}};_0x3a9ef9(++_0x36ed8b);}(_0x991e,0x169));var _0xe991=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x991e[_0x138adb];return _0x1b27f2;};'use strict';var pm2=require(_0xe991('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x522e57,_0x177c58){return pm2[_0xe991('0x1')](function(_0x4691b9){if(_0x4691b9){return _0x177c58(_0x4691b9);}return _0x522e57(_0xe991('0x2'));});});};exports[_0xe991('0x3')]=function(_0x52b841){return connect()['then'](function(){return new BPromise(function(_0x1f0941,_0x5ac58c){return pm2[_0xe991('0x3')](_0x52b841,function(_0x2c5640,_0x1cdaf1){if(_0x2c5640){return _0x5ac58c(_0x2c5640);}pm2['disconnect']();return _0x1f0941(_0x1cdaf1);});});});};exports['stop']=function(_0x1be2ff){return connect()[_0xe991('0x4')](function(){return new BPromise(function(_0x449c99,_0x284cc1){return pm2[_0xe991('0x5')](_0x1be2ff,function(_0x42869e,_0x536930){if(_0x42869e){return _0x284cc1(_0x42869e);}pm2[_0xe991('0x6')]();return _0x449c99(_0x536930);});});});};exports[_0xe991('0x7')]=function(_0x43e2f3){return connect()['then'](function(){return new BPromise(function(_0x3c7e88,_0x12f9d9){return pm2[_0xe991('0x7')](_0x43e2f3,function(_0x32c854,_0x497969){if(_0x32c854){return _0x12f9d9(_0x32c854);}pm2[_0xe991('0x6')]();return _0x3c7e88(_0x497969);});});});};exports[_0xe991('0x8')]=function(){return connect()[_0xe991('0x4')](function(){return new BPromise(function(_0x46a155,_0x481337){return pm2[_0xe991('0x8')](function(_0x398a30,_0x447cac){if(_0x398a30){return _0x481337(_0x398a30);}pm2['disconnect']();return _0x46a155(_0x447cac);});});});};exports[_0xe991('0x9')]=function(_0x5a17ac){return connect()[_0xe991('0x4')](function(){return new BPromise(function(_0x457e8b,_0x2a7e15){return pm2[_0xe991('0x9')](_0x5a17ac,function(_0x180e2e,_0x25fb94){if(_0x180e2e){return _0x2a7e15(_0x180e2e);}pm2[_0xe991('0x6')]();return _0x457e8b(_0x25fb94);});});});};exports[_0xe991('0xa')]=function(_0x19733b){return connect()[_0xe991('0x4')](function(){return new BPromise(function(_0x485673,_0x370130){return pm2[_0xe991('0xa')](_0x19733b,function(_0x4c94c3,_0x5cd233){if(_0x4c94c3){return _0x370130(_0x4c94c3);}pm2[_0xe991('0x6')]();return _0x485673(_0x5cd233);});});});};exports[_0xe991('0xb')]=function(){return connect()[_0xe991('0x4')](function(){return new BPromise(function(_0x22bd8f,_0xa13c87){return pm2[_0xe991('0xb')](function(_0x32629b){if(_0x32629b){return _0xa13c87(_0x32629b);}return _0x22bd8f(_0xe991('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fb1095d..6a65418 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 _0x9ddd=['ChatInteraction','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then'];(function(_0x589364,_0x176a3a){var _0x28aedf=function(_0x4a0d24){while(--_0x4a0d24){_0x589364['push'](_0x589364['shift']());}};_0x28aedf(++_0x176a3a);}(_0x9ddd,0x152));var _0xd9dd=function(_0x500a1b,_0x5a7007){_0x500a1b=_0x500a1b-0x0;var _0x383276=_0x9ddd[_0x500a1b];return _0x383276;};'use strict';var _=require('lodash');var moment=require(_0xd9dd('0x0'));var Redis=require(_0xd9dd('0x1'));var util=require(_0xd9dd('0x2'));var config=require('../../config/environment');var db=require(_0xd9dd('0x3'))['db'];var logger=require('../logger')(_0xd9dd('0x4'));config[_0xd9dd('0x5')]=_[_0xd9dd('0x6')](config[_0xd9dd('0x5')],{'host':_0xd9dd('0x7'),'port':0x18eb});var io=require(_0xd9dd('0x8'))(new Redis(config[_0xd9dd('0x5')]));function closeInteractions(){var _0x5a3ddd=0x0;var _0x40a753=[];return db['Setting'][_0xd9dd('0x9')]({'raw':!![],'attributes':['id',_0xd9dd('0xa')],'where':{'id':0x1}})[_0xd9dd('0xb')](function(_0x3d2d1c){_0x5a3ddd=_0x3d2d1c['chatTimeout'];if(_0x5a3ddd){return db[_0xd9dd('0xc')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3d2d1c['chatTimeout'],'minutes')}}});}else{return[];}})[_0xd9dd('0xb')](function(_0x903b8b){if(_0x903b8b&&_0x903b8b[_0xd9dd('0xd')]){_0x40a753=_[_0xd9dd('0xe')](_0x903b8b||[],'id');logger['info'](_0xd9dd('0xf'),_0x40a753[_0xd9dd('0x10')]());return db[_0xd9dd('0xc')]['update']({'closeReason':_0xd9dd('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x40a753}});}})[_0xd9dd('0xb')](function(){if(_0x40a753&&_0x40a753[_0xd9dd('0xd')]){logger[_0xd9dd('0x12')](_0xd9dd('0x13'),_0x40a753[_0xd9dd('0x10')]());for(var _0x3ef500=0x0;_0x3ef500<_0x40a753[_0xd9dd('0xd')];_0x3ef500++){io[_0xd9dd('0x14')](_0xd9dd('0x15'),{'id':_0x40a753[_0x3ef500],'closed':!![]});}}})[_0xd9dd('0x16')](function(_0x479c4c){logger[_0xd9dd('0x17')]('[CHAT]\x20Error\x20closing\x20interactions',_0x479c4c?util[_0xd9dd('0x18')](_0x479c4c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2156=['schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','chatInteraction:update','error','inspect','start','lodash','moment','ioredis','../../config/environment','../logger'];(function(_0x16ca65,_0x1bce71){var _0x440573=function(_0x16317c){while(--_0x16317c){_0x16ca65['push'](_0x16ca65['shift']());}};_0x440573(++_0x1bce71);}(_0x2156,0x109));var _0x6215=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x2156[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x6215('0x0'));var moment=require(_0x6215('0x1'));var Redis=require(_0x6215('0x2'));var util=require('util');var config=require(_0x6215('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6215('0x4'))(_0x6215('0x5'));config[_0x6215('0x6')]=_[_0x6215('0x7')](config['redis'],{'host':_0x6215('0x8'),'port':0x18eb});var io=require(_0x6215('0x9'))(new Redis(config[_0x6215('0x6')]));function closeInteractions(){var _0x394a0b=0x0;var _0x255bda=[];return db[_0x6215('0xa')][_0x6215('0xb')]({'raw':!![],'attributes':['id',_0x6215('0xc')],'where':{'id':0x1}})[_0x6215('0xd')](function(_0x17c387){_0x394a0b=_0x17c387[_0x6215('0xc')];if(_0x394a0b){return db[_0x6215('0xe')][_0x6215('0xf')]({'raw':!![],'attributes':['id',_0x6215('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6215('0x11')](_0x17c387[_0x6215('0xc')],_0x6215('0x12'))}}});}else{return[];}})[_0x6215('0xd')](function(_0x109ecf){if(_0x109ecf&&_0x109ecf['length']){_0x255bda=_['map'](_0x109ecf||[],'id');logger[_0x6215('0x13')](_0x6215('0x14'),_0x255bda['join']());return db[_0x6215('0xe')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x6215('0x15')](_0x6215('0x16'))},{'where':{'id':_0x255bda}});}})[_0x6215('0xd')](function(){if(_0x255bda&&_0x255bda[_0x6215('0x17')]){logger[_0x6215('0x13')](_0x6215('0x18'),_0x255bda[_0x6215('0x19')]());for(var _0x44fb25=0x0;_0x44fb25<_0x255bda[_0x6215('0x17')];_0x44fb25++){io['emit'](_0x6215('0x1a'),{'id':_0x255bda[_0x44fb25],'closed':!![]});}}})['catch'](function(_0x267a00){logger[_0x6215('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0x267a00?util[_0x6215('0x1c')](_0x267a00,{'showHidden':![],'depth':null}):'');});}exports[_0x6215('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index b3c2ded..05a4baf 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 _0x1edf=['authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','savename','%s.%s','join','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','difference','length','exists','stop','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','add','start','add\x20cron','deleteJob','stop\x20cron','isBetween','endAt','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','email','Smtp','service','host','MailAccount','port','secure'];(function(_0x24ea4a,_0x149521){var _0x5c54c9=function(_0x1a0cfc){while(--_0x1a0cfc){_0x24ea4a['push'](_0x24ea4a['shift']());}};_0x5c54c9(++_0x149521);}(_0x1edf,0xed));var _0xf1ed=function(_0x1bfaf3,_0xb49bdf){_0x1bfaf3=_0x1bfaf3-0x0;var _0x2ede1f=_0x1edf[_0x1bfaf3];return _0x2ede1f;};'use strict';var fs=require('fs');var util=require(_0xf1ed('0x0'));var path=require(_0xf1ed('0x1'));var _=require(_0xf1ed('0x2'));var moment=require(_0xf1ed('0x3'));var CronJobManager=require(_0xf1ed('0x4'));var jayson=require(_0xf1ed('0x5'));var BPromise=require(_0xf1ed('0x6'));var logger=require(_0xf1ed('0x7'))(_0xf1ed('0x8'));var db=require(_0xf1ed('0x9'))['db'];var analyticCustomReportController=require(_0xf1ed('0xa'));var analyticDefaultReportController=require(_0xf1ed('0xb'));var client=jayson['client'][_0xf1ed('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x22dda,_0x6cf2d7){return function(){logger[_0xf1ed('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x22dda[_0xf1ed('0xe')]);var _0x59aea8=!![];var _0x32cc81={'tls':{'rejectUnauthorized':![]}};if(_0x22dda['MailAccount'][_0xf1ed('0xf')][_0xf1ed('0x10')]){_0x32cc81[_0xf1ed('0x10')]=_0x22dda['MailAccount'][_0xf1ed('0xf')][_0xf1ed('0x10')];}else{_0x32cc81[_0xf1ed('0x11')]=_0x22dda[_0xf1ed('0x12')][_0xf1ed('0xf')][_0xf1ed('0x11')];_0x32cc81[_0xf1ed('0x13')]=_0x22dda['MailAccount'][_0xf1ed('0xf')][_0xf1ed('0x13')];_0x32cc81['secure']=_0x22dda[_0xf1ed('0x12')]['Smtp'][_0xf1ed('0x14')];}if(_0x22dda['MailAccount'][_0xf1ed('0xf')][_0xf1ed('0x15')]){_0x32cc81[_0xf1ed('0x16')]={'user':_0x22dda[_0xf1ed('0x12')][_0xf1ed('0xf')][_0xf1ed('0x17')],'pass':_0x22dda[_0xf1ed('0x12')][_0xf1ed('0xf')]['pass']};}var _0x3d6c31={'account':_0x32cc81,'message':{'from':util[_0xf1ed('0x18')](_0xf1ed('0x19'),_0x22dda[_0xf1ed('0x12')][_0xf1ed('0x1a')],_0x22dda[_0xf1ed('0x12')][_0xf1ed('0xe')]||_0x22dda[_0xf1ed('0x12')]['Smtp']['user']),'to':_0x22dda[_0xf1ed('0xe')],'cc':_0x22dda['cc'],'bcc':_0x22dda[_0xf1ed('0x1b')],'subject':util[_0xf1ed('0x18')](_0xf1ed('0x1c'),_0x6cf2d7['name'],_0x22dda[_0xf1ed('0x1d')],_0x22dda[_0xf1ed('0x1e')])}};var _0x17d0a4=path['join'](__dirname,'../../files/reports');var _0x22cf5f=_0x6cf2d7[_0xf1ed('0x1f')];var _0x114a2f=util[_0xf1ed('0x18')](_0xf1ed('0x20'),path['basename'](_0x6cf2d7[_0xf1ed('0x1f')],path['extname'](_0x6cf2d7['savename'])),'zip');var _0xae8098=path[_0xf1ed('0x21')](_0x17d0a4,_0x22cf5f);var _0x21a129=path[_0xf1ed('0x21')](_0x17d0a4,_0x114a2f);if(fs[_0xf1ed('0x22')](_0xae8098)){_0x6cf2d7[_0xf1ed('0x23')]='Sent';_0x3d6c31[_0xf1ed('0x24')][_0xf1ed('0x25')]=[{'filename':_0x22cf5f,'path':_0xae8098}];_0x3d6c31[_0xf1ed('0x24')][_0xf1ed('0x26')]=util[_0xf1ed('0x18')](_0xf1ed('0x27'),JSON[_0xf1ed('0x28')](_0x6cf2d7,null,0x2));}else if(fs['existsSync'](_0x21a129)){_0x6cf2d7['status']=_0xf1ed('0x29');_0x3d6c31['message'][_0xf1ed('0x25')]=[{'filename':_0x114a2f,'path':_0x21a129}];}else{_0x3d6c31[_0xf1ed('0x24')][_0xf1ed('0x26')]=_0xf1ed('0x2a');if(!_0x22dda[_0xf1ed('0x2b')]){_0x59aea8=![];logger['info'](_0xf1ed('0x2c'));}}if(_0x59aea8){return client['request']('SendMail',_0x3d6c31)[_0xf1ed('0x2d')](function(_0x2bf377){if(_0x2bf377['error']){return logger[_0xf1ed('0x2e')](_0xf1ed('0x2f'),JSON[_0xf1ed('0x28')](_0x2bf377));}return logger[_0xf1ed('0xd')](_0xf1ed('0x30'));})[_0xf1ed('0x31')](function(_0x9c4709){return logger[_0xf1ed('0x2e')]('error\x20mail',JSON[_0xf1ed('0x28')](_0x9c4709));});}};}function handleError(){return function(_0x274baf){return logger[_0xf1ed('0x2e')](JSON[_0xf1ed('0x28')](_0x274baf));};}function handleResult(_0x3b20ff){return function(_0x1761a2){logger[_0xf1ed('0xd')](_0xf1ed('0x32'),JSON[_0xf1ed('0x28')](_0x1761a2));if(_0x3b20ff[_0xf1ed('0x12')]&&_0x3b20ff[_0xf1ed('0x12')][_0xf1ed('0xf')]&&!_[_0xf1ed('0x33')](_0x3b20ff[_0xf1ed('0xe')])){setTimeout(handleSendEmail(_0x3b20ff,_0x1761a2),0x3c*0x3e8);}};}function handleJob(_0x10fe9b){return function(){try{if(_[_0xf1ed('0x33')](_0x10fe9b[_0xf1ed('0x1d')])){return logger[_0xf1ed('0xd')](_0xf1ed('0x34'));}if(_[_0xf1ed('0x33')](_0x10fe9b[_0xf1ed('0x1e')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x2bb56f={'startDate':moment()[_0xf1ed('0x35')](_0x10fe9b[_0xf1ed('0x1d')],_0x10fe9b[_0xf1ed('0x1e')])[_0xf1ed('0x18')](_0xf1ed('0x36')),'endDate':moment()[_0xf1ed('0x18')](_0xf1ed('0x36')),'type':'scheduled','output':_0x10fe9b['output'],'name':_0x10fe9b[_0xf1ed('0x1a')]};if(!_[_0xf1ed('0x33')](_0x10fe9b[_0xf1ed('0x37')])){logger[_0xf1ed('0xd')](_0xf1ed('0x38'),_0x10fe9b['DefaultReportId']);return analyticDefaultReportController[_0xf1ed('0x39')]({'id':_0x10fe9b[_0xf1ed('0x37')]},_0x2bb56f)[_0xf1ed('0x2d')](handleResult(_0x10fe9b))[_0xf1ed('0x31')](handleError());}if(!_[_0xf1ed('0x33')](_0x10fe9b[_0xf1ed('0x3a')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x10fe9b[_0xf1ed('0x3a')]);return analyticCustomReportController['runReport']({'id':_0x10fe9b[_0xf1ed('0x3a')]},_0x2bb56f)[_0xf1ed('0x2d')](handleResult(_0x10fe9b))[_0xf1ed('0x31')](handleError());}}catch(_0x4e3c09){logger[_0xf1ed('0x2e')](JSON[_0xf1ed('0x28')](_0x4e3c09));}return logger[_0xf1ed('0xd')](_0xf1ed('0x3b'));};}function getJobs(_0x5038f9){var _0x559808={};if(_0x5038f9){_0x559808['id']=_0x5038f9;}return db[_0xf1ed('0x3c')][_0xf1ed('0x3d')]({'where':_0x559808,'include':[{'model':db[_0xf1ed('0x12')],'attributes':['id',_0xf1ed('0x1a'),_0xf1ed('0xe')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})['then'](function(_0x27eeb7){var _0x351bd5=_[_0xf1ed('0x3e')](manager[_0xf1ed('0x3f')]);var _0x502661=_['map'](_0x27eeb7,function(_0x269f39){return _0x269f39['id'][_0xf1ed('0x40')]();});var _0x426556=_['keyBy'](_0x27eeb7,function(_0x3c60dc){return _0x3c60dc['id'][_0xf1ed('0x40')]();});var _0x2bfb18=_0x5038f9?_0x502661:_[_0xf1ed('0x41')](_0x502661,_0x351bd5);var _0x4c4a38=_['intersection'](_0x502661,_0x351bd5);var _0x48a5ee=_[_0xf1ed('0x41')](_0x351bd5,_0x502661);var _0x356280;var _0x24c313;for(_0x356280=0x0;_0x356280<_0x48a5ee[_0xf1ed('0x42')]&&!_0x5038f9;_0x356280+=0x1){_0x24c313=_0x48a5ee[_0x356280][_0xf1ed('0x40')]();if(manager[_0xf1ed('0x43')](_0x24c313)){manager[_0xf1ed('0x44')](_0x24c313);manager['deleteJob'](_0x24c313);logger['info']('delete\x20cron',_0x24c313);}}logger[_0xf1ed('0xd')](_0xf1ed('0x45'),JSON[_0xf1ed('0x28')](_0x2bfb18));for(_0x356280=0x0;_0x356280<_0x2bfb18['length'];_0x356280+=0x1){_0x24c313=_0x2bfb18[_0x356280][_0xf1ed('0x40')]();logger[_0xf1ed('0xd')](_0xf1ed('0x46'),_0x24c313);if(_0x5038f9){logger[_0xf1ed('0xd')](_0xf1ed('0x47'),_0x5038f9);logger[_0xf1ed('0xd')](JSON[_0xf1ed('0x28')](_0x426556[_0x24c313]));BPromise[_0xf1ed('0x48')]()[_0xf1ed('0x2d')](handleJob(_0x426556[_0x24c313]));logger[_0xf1ed('0xd')](_0xf1ed('0x49'),_0x426556[_0x24c313][_0xf1ed('0x1a')],_0x426556[_0x24c313][_0xf1ed('0x4a')]);}else if(_0x426556[_0x24c313]['cron']&&_0x426556[_0x24c313][_0xf1ed('0x4b')]&&moment()['isBetween'](_0x426556[_0x24c313][_0xf1ed('0x4c')],_0x426556[_0x24c313]['endAt'])){manager[_0xf1ed('0x4d')](_0x24c313,_0x426556[_0x24c313][_0xf1ed('0x4a')],handleJob(_0x426556[_0x24c313]));manager[_0xf1ed('0x4e')](_0x24c313);logger[_0xf1ed('0xd')](_0xf1ed('0x4f'),_0x426556[_0x24c313]['name'],_0x426556[_0x24c313][_0xf1ed('0x4a')]);}else if(manager[_0xf1ed('0x43')](_0x24c313)){manager['stop'](_0x24c313);manager[_0xf1ed('0x50')](_0x24c313);logger[_0xf1ed('0xd')](_0xf1ed('0x51'),_0x426556[_0x24c313]['name'],_0x426556[_0x24c313][_0xf1ed('0x4a')]);}}for(_0x356280=0x0,_0x24c313;_0x356280<_0x4c4a38[_0xf1ed('0x42')]&&!_0x5038f9;_0x356280+=0x1){_0x24c313=_0x4c4a38[_0x356280][_0xf1ed('0x40')]();if(manager[_0xf1ed('0x43')](_0x24c313)){if(_0x426556[_0x24c313][_0xf1ed('0x4a')]&&_0x426556[_0x24c313][_0xf1ed('0x4b')]&&moment()[_0xf1ed('0x52')](_0x426556[_0x24c313][_0xf1ed('0x4c')],_0x426556[_0x24c313][_0xf1ed('0x53')])){manager['update'](_0x24c313,_0x426556[_0x24c313]['cron'],handleJob(_0x426556[_0x24c313]));logger[_0xf1ed('0xd')](_0xf1ed('0x54'),_0x426556[_0x24c313][_0xf1ed('0x1a')],_0x426556[_0x24c313][_0xf1ed('0x4a')]);}else{manager[_0xf1ed('0x44')](_0x24c313);manager[_0xf1ed('0x50')](_0x24c313);logger['info'](_0xf1ed('0x51'),_0x426556[_0x24c313][_0xf1ed('0x1a')],_0x426556[_0x24c313]['cron']);}}}})[_0xf1ed('0x31')](function(_0x5dd3dc){logger['error'](JSON[_0xf1ed('0x28')](_0x5dd3dc));});}exports[_0xf1ed('0x55')]=function(_0x24a45e){return getJobs(_0x24a45e);};exports[_0xf1ed('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2373=['run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop','endAt','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','jobs','map','keyBy','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','resolve'];(function(_0x49c3b6,_0x5d624f){var _0x4f43eb=function(_0x23636b){while(--_0x23636b){_0x49c3b6['push'](_0x49c3b6['shift']());}};_0x4f43eb(++_0x5d624f);}(_0x2373,0x175));var _0x3237=function(_0x5b65b5,_0x4abd19){_0x5b65b5=_0x5b65b5-0x0;var _0x2e904a=_0x2373[_0x5b65b5];return _0x2e904a;};'use strict';var fs=require('fs');var util=require(_0x3237('0x0'));var path=require(_0x3237('0x1'));var _=require(_0x3237('0x2'));var moment=require(_0x3237('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x3237('0x4'));var BPromise=require(_0x3237('0x5'));var logger=require('../logger')(_0x3237('0x6'));var db=require(_0x3237('0x7'))['db'];var analyticCustomReportController=require(_0x3237('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x3237('0x9')][_0x3237('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2942b0,_0x2ccb47){return function(){logger['info'](_0x3237('0xb'),_0x2942b0['email']);var _0xb32302=!![];var _0x184c01={'tls':{'rejectUnauthorized':![]}};if(_0x2942b0[_0x3237('0xc')][_0x3237('0xd')]['service']){_0x184c01[_0x3237('0xe')]=_0x2942b0[_0x3237('0xc')][_0x3237('0xd')]['service'];}else{_0x184c01[_0x3237('0xf')]=_0x2942b0['MailAccount'][_0x3237('0xd')][_0x3237('0xf')];_0x184c01[_0x3237('0x10')]=_0x2942b0[_0x3237('0xc')][_0x3237('0xd')][_0x3237('0x10')];_0x184c01['secure']=_0x2942b0[_0x3237('0xc')]['Smtp'][_0x3237('0x11')];}if(_0x2942b0[_0x3237('0xc')][_0x3237('0xd')][_0x3237('0x12')]){_0x184c01['auth']={'user':_0x2942b0[_0x3237('0xc')][_0x3237('0xd')][_0x3237('0x13')],'pass':_0x2942b0[_0x3237('0xc')][_0x3237('0xd')][_0x3237('0x14')]};}var _0x3025f6={'account':_0x184c01,'message':{'from':util[_0x3237('0x15')]('\x22%s\x22\x20<%s>',_0x2942b0['MailAccount'][_0x3237('0x16')],_0x2942b0[_0x3237('0xc')][_0x3237('0x17')]||_0x2942b0[_0x3237('0xc')]['Smtp']['user']),'to':_0x2942b0['email'],'cc':_0x2942b0['cc'],'bcc':_0x2942b0[_0x3237('0x18')],'subject':util[_0x3237('0x15')](_0x3237('0x19'),_0x2ccb47[_0x3237('0x16')],_0x2942b0[_0x3237('0x1a')],_0x2942b0[_0x3237('0x1b')])}};var _0x3aa54d=path[_0x3237('0x1c')](__dirname,'../../files/reports');var _0x242fbc=_0x2ccb47[_0x3237('0x1d')];var _0x5e7fcc=util[_0x3237('0x15')](_0x3237('0x1e'),path[_0x3237('0x1f')](_0x2ccb47[_0x3237('0x1d')],path['extname'](_0x2ccb47[_0x3237('0x1d')])),'zip');var _0x38c742=path[_0x3237('0x1c')](_0x3aa54d,_0x242fbc);var _0x543749=path['join'](_0x3aa54d,_0x5e7fcc);if(fs[_0x3237('0x20')](_0x38c742)){_0x2ccb47[_0x3237('0x21')]=_0x3237('0x22');_0x3025f6[_0x3237('0x23')][_0x3237('0x24')]=[{'filename':_0x242fbc,'path':_0x38c742}];_0x3025f6['message'][_0x3237('0x25')]=util['format'](_0x3237('0x26'),JSON[_0x3237('0x27')](_0x2ccb47,null,0x2));}else if(fs['existsSync'](_0x543749)){_0x2ccb47[_0x3237('0x21')]='Sent';_0x3025f6['message']['attachments']=[{'filename':_0x5e7fcc,'path':_0x543749}];}else{_0x3025f6[_0x3237('0x23')][_0x3237('0x25')]=_0x3237('0x28');if(!_0x2942b0[_0x3237('0x29')]){_0xb32302=![];logger[_0x3237('0x2a')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xb32302){return client[_0x3237('0x2b')](_0x3237('0x2c'),_0x3025f6)[_0x3237('0x2d')](function(_0x171283){if(_0x171283[_0x3237('0x2e')]){return logger[_0x3237('0x2e')](_0x3237('0x2f'),JSON['stringify'](_0x171283));}return logger[_0x3237('0x2a')](_0x3237('0x30'));})[_0x3237('0x31')](function(_0x3bfb67){return logger['error'](_0x3237('0x2f'),JSON[_0x3237('0x27')](_0x3bfb67));});}};}function handleError(){return function(_0x5518bf){return logger[_0x3237('0x2e')](JSON[_0x3237('0x27')](_0x5518bf));};}function handleResult(_0x4e94e4){return function(_0x37a873){logger[_0x3237('0x2a')](_0x3237('0x32'),JSON[_0x3237('0x27')](_0x37a873));if(_0x4e94e4[_0x3237('0xc')]&&_0x4e94e4['MailAccount'][_0x3237('0xd')]&&!_[_0x3237('0x33')](_0x4e94e4[_0x3237('0x17')])){setTimeout(handleSendEmail(_0x4e94e4,_0x37a873),0x3c*0x3e8);}};}function handleJob(_0x35de41){return function(){try{if(_[_0x3237('0x33')](_0x35de41[_0x3237('0x1a')])){return logger[_0x3237('0x2a')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3237('0x33')](_0x35de41[_0x3237('0x1b')])){return logger[_0x3237('0x2a')](_0x3237('0x34'));}var _0x2f34f3={'startDate':moment()[_0x3237('0x35')](_0x35de41[_0x3237('0x1a')],_0x35de41['subtractUnit'])[_0x3237('0x15')](_0x3237('0x36')),'endDate':moment()[_0x3237('0x15')](_0x3237('0x36')),'type':_0x3237('0x37'),'output':_0x35de41[_0x3237('0x38')],'name':_0x35de41[_0x3237('0x16')]};if(!_[_0x3237('0x33')](_0x35de41['DefaultReportId'])){logger[_0x3237('0x2a')](_0x3237('0x39'),_0x35de41['DefaultReportId']);return analyticDefaultReportController[_0x3237('0x3a')]({'id':_0x35de41[_0x3237('0x3b')]},_0x2f34f3)['then'](handleResult(_0x35de41))[_0x3237('0x31')](handleError());}if(!_[_0x3237('0x33')](_0x35de41[_0x3237('0x3c')])){logger[_0x3237('0x2a')](_0x3237('0x3d'),_0x35de41[_0x3237('0x3c')]);return analyticCustomReportController['runReport']({'id':_0x35de41[_0x3237('0x3c')]},_0x2f34f3)[_0x3237('0x2d')](handleResult(_0x35de41))[_0x3237('0x31')](handleError());}}catch(_0x3c93db){logger[_0x3237('0x2e')](JSON[_0x3237('0x27')](_0x3c93db));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x56de41){var _0x48b9b7={};if(_0x56de41){_0x48b9b7['id']=_0x56de41;}return db['Schedule'][_0x3237('0x3e')]({'where':_0x48b9b7,'include':[{'model':db['MailAccount'],'attributes':['id',_0x3237('0x16'),_0x3237('0x17')],'include':[{'model':db[_0x3237('0x3f')],'as':_0x3237('0xd')}]}]})[_0x3237('0x2d')](function(_0x38f0a3){var _0x5de352=_['keys'](manager[_0x3237('0x40')]);var _0x18ffb6=_[_0x3237('0x41')](_0x38f0a3,function(_0xec26f1){return _0xec26f1['id']['toString']();});var _0x240905=_[_0x3237('0x42')](_0x38f0a3,function(_0x50b0d1){return _0x50b0d1['id'][_0x3237('0x43')]();});var _0x441b2e=_0x56de41?_0x18ffb6:_[_0x3237('0x44')](_0x18ffb6,_0x5de352);var _0x30c5d6=_[_0x3237('0x45')](_0x18ffb6,_0x5de352);var _0x13ef27=_[_0x3237('0x44')](_0x5de352,_0x18ffb6);var _0x241ca7;var _0x5af369;for(_0x241ca7=0x0;_0x241ca7<_0x13ef27[_0x3237('0x46')]&&!_0x56de41;_0x241ca7+=0x1){_0x5af369=_0x13ef27[_0x241ca7][_0x3237('0x43')]();if(manager[_0x3237('0x47')](_0x5af369)){manager['stop'](_0x5af369);manager[_0x3237('0x48')](_0x5af369);logger[_0x3237('0x2a')](_0x3237('0x49'),_0x5af369);}}logger[_0x3237('0x2a')](_0x3237('0x4a'),JSON[_0x3237('0x27')](_0x441b2e));for(_0x241ca7=0x0;_0x241ca7<_0x441b2e[_0x3237('0x46')];_0x241ca7+=0x1){_0x5af369=_0x441b2e[_0x241ca7][_0x3237('0x43')]();logger[_0x3237('0x2a')](_0x3237('0x4b'),_0x5af369);if(_0x56de41){logger[_0x3237('0x2a')]('my\x20id',_0x56de41);logger[_0x3237('0x2a')](JSON['stringify'](_0x240905[_0x5af369]));BPromise[_0x3237('0x4c')]()[_0x3237('0x2d')](handleJob(_0x240905[_0x5af369]));logger[_0x3237('0x2a')](_0x3237('0x4d'),_0x240905[_0x5af369][_0x3237('0x16')],_0x240905[_0x5af369]['cron']);}else if(_0x240905[_0x5af369][_0x3237('0x4e')]&&_0x240905[_0x5af369][_0x3237('0x4f')]&&moment()[_0x3237('0x50')](_0x240905[_0x5af369][_0x3237('0x51')],_0x240905[_0x5af369]['endAt'])){manager[_0x3237('0x52')](_0x5af369,_0x240905[_0x5af369][_0x3237('0x4e')],handleJob(_0x240905[_0x5af369]));manager[_0x3237('0x53')](_0x5af369);logger[_0x3237('0x2a')](_0x3237('0x54'),_0x240905[_0x5af369][_0x3237('0x16')],_0x240905[_0x5af369]['cron']);}else if(manager[_0x3237('0x47')](_0x5af369)){manager[_0x3237('0x55')](_0x5af369);manager[_0x3237('0x48')](_0x5af369);logger['info']('stop\x20cron',_0x240905[_0x5af369]['name'],_0x240905[_0x5af369][_0x3237('0x4e')]);}}for(_0x241ca7=0x0,_0x5af369;_0x241ca7<_0x30c5d6[_0x3237('0x46')]&&!_0x56de41;_0x241ca7+=0x1){_0x5af369=_0x30c5d6[_0x241ca7]['toString']();if(manager['exists'](_0x5af369)){if(_0x240905[_0x5af369]['cron']&&_0x240905[_0x5af369]['active']&&moment()[_0x3237('0x50')](_0x240905[_0x5af369][_0x3237('0x51')],_0x240905[_0x5af369][_0x3237('0x56')])){manager[_0x3237('0x57')](_0x5af369,_0x240905[_0x5af369][_0x3237('0x4e')],handleJob(_0x240905[_0x5af369]));logger['info'](_0x3237('0x58'),_0x240905[_0x5af369]['name'],_0x240905[_0x5af369][_0x3237('0x4e')]);}else{manager[_0x3237('0x55')](_0x5af369);manager['deleteJob'](_0x5af369);logger[_0x3237('0x2a')]('stop\x20cron',_0x240905[_0x5af369]['name'],_0x240905[_0x5af369][_0x3237('0x4e')]);}}}})[_0x3237('0x31')](function(_0x311e23){logger['error'](JSON[_0x3237('0x27')](_0x311e23));});}exports[_0x3237('0x59')]=function(_0x205464){return getJobs(_0x205464);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index f4452a5..ae20bb3 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 _0xc961=['Settings\x20not\x20available','Transcribe\x20not\x20configured','forEach','push','all','catch','error','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','bucket','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x14941c,_0x25cb16){var _0x76d911=function(_0x80a394){while(--_0x80a394){_0x14941c['push'](_0x14941c['shift']());}};_0x76d911(++_0x25cb16);}(_0xc961,0x17a));var _0x1c96=function(_0x5e1248,_0x42b862){_0x5e1248=_0x5e1248-0x0;var _0x1b4201=_0xc961[_0x5e1248];return _0x1b4201;};var _=require(_0x1c96('0x0'));var AWS=require(_0x1c96('0x1'));var rp=require(_0x1c96('0x2'));var util=require(_0x1c96('0x3'));var BPromise=require(_0x1c96('0x4'));var db=require(_0x1c96('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x4e5884,_0x30d2e0,_0x494d92,_0x180969){return new Promise(function(_0x5594ee,_0x19d78b){var _0x2d4b23=new AWS[(_0x1c96('0x6'))]({'accessKeyId':_0x30d2e0,'secretAccessKey':_0x4e5884,'region':_0x494d92});_0x2d4b23[_0x1c96('0x7')]({'TranscriptionJobName':_0x180969},function(_0x2e4fa5,_0x473a4c){if(_0x2e4fa5){return _0x19d78b(_0x2e4fa5);}else{return _0x5594ee(_0x473a4c);}});});}function sentiment(_0x5523de,_0x360c75,_0x362e46,_0x691a95,_0x34497e){return new Promise(function(_0x11a521,_0x14ae4a){var _0x435739=new AWS[(_0x1c96('0x8'))]({'accessKeyId':_0x360c75,'secretAccessKey':_0x5523de,'region':_0x362e46});_0x435739[_0x1c96('0x9')]({'Text':_0x691a95,'LanguageCode':_0x34497e[_0x1c96('0xa')](0x0,0x2)},function(_0x262165,_0x26b8f3){if(_0x262165){return _0x14ae4a(_0x262165);}else{return _0x11a521(_0x26b8f3);}});});}function checkTranscribeJob(_0x5bb3c3,_0x1e0663,_0x3c9850){var _0x5a8f97;return new BPromise(function(_0x425345,_0x2d44f0){logger[_0x1c96('0xb')](util[_0x1c96('0xc')](_0x1c96('0xd'),_0x5bb3c3['id'],_0x5bb3c3[_0x1c96('0xe')]));return getTranscriptionJob(_0x3c9850[_0x1c96('0xf')],_0x3c9850[_0x1c96('0x10')],_0x1e0663[_0x1c96('0x11')],_0x5bb3c3[_0x1c96('0xe')])[_0x1c96('0x12')](function(_0x7cfdeb){logger[_0x1c96('0xb')](util['format'](_0x1c96('0x13'),_0x5bb3c3['id'],_0x5bb3c3['transcribeName'],_0x7cfdeb[_0x1c96('0x14')][_0x1c96('0x15')]));if(!_0x5bb3c3['fileText']){switch(_0x7cfdeb[_0x1c96('0x14')]['TranscriptionJobStatus']){case'COMPLETED':var _0x15b1de={'transcribeStatus':_0x7cfdeb[_0x1c96('0x14')][_0x1c96('0x15')],'fileUri':_0x7cfdeb['TranscriptionJob'][_0x1c96('0x16')]['TranscriptFileUri']};logger[_0x1c96('0xb')](util[_0x1c96('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x5bb3c3['id']));return rp({'uri':_0x7cfdeb[_0x1c96('0x14')]['Transcript'][_0x1c96('0x17')],'json':!![]})[_0x1c96('0x12')](function(_0x23722c){logger[_0x1c96('0xb')](util[_0x1c96('0xc')](_0x1c96('0x18'),_0x5bb3c3['id']));if(_0x23722c&&_0x23722c[_0x1c96('0x19')]&&_0x23722c[_0x1c96('0x19')][_0x1c96('0x1a')]&&_0x23722c[_0x1c96('0x19')]['transcripts'][_0x1c96('0x1b')]){_0x15b1de[_0x1c96('0x1c')]='';for(var _0x289ee5=0x0;_0x289ee5<_0x23722c['results']['transcripts'][_0x1c96('0x1b')];_0x289ee5++){_0x15b1de[_0x1c96('0x1c')]+=_0x23722c['results'][_0x1c96('0x1a')][_0x289ee5][_0x1c96('0x1d')]+'';}}return _0x5bb3c3[_0x1c96('0x1e')](_0x15b1de);})['then'](function(){logger['info'](util[_0x1c96('0xc')](_0x1c96('0x1f'),_0x5bb3c3['id']));if(!_0x5bb3c3['tempSentiment']){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x22'));}if(!_0x1e0663[_0x1c96('0x23')]||!_0x1e0663['sentimentAccountId']||!_0x1e0663['sentimentRegion']||!_0x1e0663[_0x1c96('0x24')]||!_0x1e0663['bucket']){throw new db[(_0x1c96('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x15b1de[_0x1c96('0x1c')]){throw new Error(_0x1c96('0x25'));}if(_0x1e0663[_0x1c96('0x26')]===_0x3c9850['id']){return _0x3c9850;}else{return db[_0x1c96('0x27')][_0x1c96('0x28')]({'where':{'id':_settings[_0x1c96('0x26')]}});}})['then'](function(_0x569dd9){if(!_0x569dd9){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x29'));}if(!_0x569dd9[_0x1c96('0xf')]||!_0x569dd9[_0x1c96('0x10')]){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x2a'));}_0x5a8f97=_0x569dd9;logger[_0x1c96('0xb')](util['format'](_0x1c96('0x2b'),_0x5bb3c3['id']));return sentiment(_0x5a8f97[_0x1c96('0xf')],_0x5a8f97[_0x1c96('0x10')],_0x1e0663[_0x1c96('0x2c')],_0x15b1de[_0x1c96('0x1c')],_0x1e0663[_0x1c96('0x24')]);})['then'](function(_0x353732){logger[_0x1c96('0xb')](util['format'](_0x1c96('0x2d'),_0x5bb3c3['id']));return _0x5bb3c3[_0x1c96('0x1e')]({'sentiment':_0x353732[_0x1c96('0x2e')],'sPositive':_0x353732[_0x1c96('0x2f')][_0x1c96('0x30')],'sNegative':_0x353732[_0x1c96('0x2f')][_0x1c96('0x31')],'sMixed':_0x353732['SentimentScore']['Mixed'],'sNeutral':_0x353732[_0x1c96('0x2f')][_0x1c96('0x32')]});})['then'](function(){logger[_0x1c96('0xb')](util['format'](_0x1c96('0x1f'),_0x5bb3c3['id']));_0x425345();});case _0x1c96('0x33'):return _0x5bb3c3['update']({'transcribeStatus':'FAILED','failureReason':_0x7cfdeb[_0x1c96('0x14')][_0x1c96('0x34')]})[_0x1c96('0x12')](function(){logger[_0x1c96('0xb')](util[_0x1c96('0xc')](_0x1c96('0x1f'),_0x5bb3c3['id']));_0x425345();});default:logger[_0x1c96('0xb')](util['format'](_0x1c96('0x35'),_0x5bb3c3['id']));break;}}else{return BPromise[_0x1c96('0x36')]()['then'](function(){if(!_0x5bb3c3[_0x1c96('0x37')]){throw new db['Sequelize'][(_0x1c96('0x21'))](_0x1c96('0x22'));}if(!_0x1e0663[_0x1c96('0x23')]||!_0x1e0663[_0x1c96('0x26')]||!_0x1e0663['sentimentRegion']||!_0x1e0663[_0x1c96('0x24')]||!_0x1e0663[_0x1c96('0x38')]){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5bb3c3[_0x1c96('0x1c')]){throw new Error(_0x1c96('0x25'));}if(_0x1e0663['sentimentAccountId']===_0x3c9850['id']){return _0x3c9850;}else{return db[_0x1c96('0x27')][_0x1c96('0x28')]({'where':{'id':_settings[_0x1c96('0x26')]}});}})[_0x1c96('0x12')](function(_0x1ade48){if(!_0x1ade48){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x29'));}if(!_0x1ade48['data1']||!_0x1ade48[_0x1c96('0x10')]){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x2a'));}_0x5a8f97=_0x1ade48;logger[_0x1c96('0xb')](util[_0x1c96('0xc')](_0x1c96('0x2b'),_0x5bb3c3['id']));return sentiment(_0x5a8f97[_0x1c96('0xf')],_0x5a8f97[_0x1c96('0x10')],_0x1e0663['sentimentRegion'],_0x5bb3c3['fileText'],_0x1e0663[_0x1c96('0x24')]);})[_0x1c96('0x12')](function(_0xaf5b6f){logger[_0x1c96('0xb')](util[_0x1c96('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5bb3c3['id']));return _0x5bb3c3['update']({'sentiment':_0xaf5b6f[_0x1c96('0x2e')],'sPositive':_0xaf5b6f[_0x1c96('0x2f')][_0x1c96('0x30')],'sNegative':_0xaf5b6f['SentimentScore'][_0x1c96('0x31')],'sMixed':_0xaf5b6f[_0x1c96('0x2f')]['Mixed'],'sNeutral':_0xaf5b6f[_0x1c96('0x2f')]['Neutral'],'transcribeStatus':'COMPLETED'});})[_0x1c96('0x12')](function(){logger[_0x1c96('0xb')](util[_0x1c96('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5bb3c3['id']));_0x425345();});}})['catch'](function(_0x4fd7de){if(_0x4fd7de){if(!_0x4fd7de[_0x1c96('0x39')]||_0x4fd7de['name']!==_0x1c96('0x3a')){logger['error'](util[_0x1c96('0xc')](_0x1c96('0x3b'),_0x5bb3c3['id']),util[_0x1c96('0x3c')](_0x4fd7de,{'showHidden':![],'depth':null}));}}_0x425345();});});}function checkTranscribe(){var _0x1f0a98;var _0x5c7720;var _0x200fc9;return db[_0x1c96('0x3d')][_0x1c96('0x3e')]({'where':{'transcribeStatus':_0x1c96('0x3f')}})['then'](function(_0x271a10){if(!_0x271a10||!_0x271a10[_0x1c96('0x1b')]){throw new db[(_0x1c96('0x20'))][(_0x1c96('0x21'))](_0x1c96('0x40'));}_0x1f0a98=_0x271a10;return db[_0x1c96('0x41')][_0x1c96('0x28')]({'where':{'id':0x1}});})['then'](function(_0x2a4249){if(!_0x2a4249){throw new db['Sequelize'][(_0x1c96('0x21'))](_0x1c96('0x42'));}_0x5c7720=_0x2a4249;if(!_0x5c7720['transcribe']||!_0x5c7720['transcribeAccountId']||!_0x5c7720[_0x1c96('0x11')]||!_0x5c7720[_0x1c96('0x24')]||!_0x5c7720[_0x1c96('0x38')]){throw new db['Sequelize'][(_0x1c96('0x21'))](_0x1c96('0x43'));}return db[_0x1c96('0x27')]['findOne']({'where':{'id':_0x5c7720['transcribeAccountId']}});})[_0x1c96('0x12')](function(_0x534f61){if(!_0x534f61){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x534f61[_0x1c96('0xf')]||!_0x534f61['data2']){throw new db['Sequelize']['ValidationError'](_0x1c96('0x2a'));}_0x200fc9=_0x534f61;var _0x75d719=[];_0x1f0a98[_0x1c96('0x44')](function(_0x1630e){_0x75d719[_0x1c96('0x45')](checkTranscribeJob(_0x1630e,_0x5c7720,_0x200fc9));});return BPromise[_0x1c96('0x46')](_0x75d719);})[_0x1c96('0x47')](function(_0x365116){if(_0x365116){if(!_0x365116[_0x1c96('0x39')]||_0x365116['name']!==_0x1c96('0x3a')){logger[_0x1c96('0x48')](util[_0x1c96('0x3c')](_0x365116,{'showHidden':![],'depth':null}));}}});}exports[_0x1c96('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2f68=['No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','start','aws-sdk','request-promise','util','bluebird','../../config/logger','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll'];(function(_0x55b22a,_0x569581){var _0x4619dd=function(_0x28d653){while(--_0x28d653){_0x55b22a['push'](_0x55b22a['shift']());}};_0x4619dd(++_0x569581);}(_0x2f68,0x9a));var _0x82f6=function(_0x3ac71f,_0x26f30a){_0x3ac71f=_0x3ac71f-0x0;var _0xa68c6d=_0x2f68[_0x3ac71f];return _0xa68c6d;};var _=require('lodash');var AWS=require(_0x82f6('0x0'));var rp=require(_0x82f6('0x1'));var util=require(_0x82f6('0x2'));var BPromise=require(_0x82f6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x82f6('0x4'))('transcribe');function getTranscriptionJob(_0x2a06dc,_0x2ab73d,_0x5dad09,_0x3ad120){return new Promise(function(_0x2c4302,_0x542737){var _0x5a8089=new AWS[(_0x82f6('0x5'))]({'accessKeyId':_0x2ab73d,'secretAccessKey':_0x2a06dc,'region':_0x5dad09});_0x5a8089['getTranscriptionJob']({'TranscriptionJobName':_0x3ad120},function(_0x5daa3c,_0x864400){if(_0x5daa3c){return _0x542737(_0x5daa3c);}else{return _0x2c4302(_0x864400);}});});}function sentiment(_0xbd30d5,_0x250d71,_0x5ee0e5,_0x27db58,_0x432289){return new Promise(function(_0x4e7c12,_0x1cf88e){var _0x1eec2f=new AWS[(_0x82f6('0x6'))]({'accessKeyId':_0x250d71,'secretAccessKey':_0xbd30d5,'region':_0x5ee0e5});_0x1eec2f[_0x82f6('0x7')]({'Text':_0x27db58,'LanguageCode':_0x432289[_0x82f6('0x8')](0x0,0x2)},function(_0x34bd7c,_0x4c870e){if(_0x34bd7c){return _0x1cf88e(_0x34bd7c);}else{return _0x4e7c12(_0x4c870e);}});});}function checkTranscribeJob(_0x12c5bc,_0x442262,_0x4cc967){var _0x194da7;return new BPromise(function(_0x1f8bf5,_0x397527){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0xb'),_0x12c5bc['id'],_0x12c5bc[_0x82f6('0xc')]));return getTranscriptionJob(_0x4cc967[_0x82f6('0xd')],_0x4cc967[_0x82f6('0xe')],_0x442262['transcribeRegion'],_0x12c5bc[_0x82f6('0xc')])['then'](function(_0x249222){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0xf'),_0x12c5bc['id'],_0x12c5bc[_0x82f6('0xc')],_0x249222[_0x82f6('0x10')][_0x82f6('0x11')]));if(!_0x12c5bc[_0x82f6('0x12')]){switch(_0x249222[_0x82f6('0x10')][_0x82f6('0x11')]){case _0x82f6('0x13'):var _0x1d9091={'transcribeStatus':_0x249222[_0x82f6('0x10')][_0x82f6('0x11')],'fileUri':_0x249222[_0x82f6('0x10')]['Transcript'][_0x82f6('0x14')]};logger[_0x82f6('0x9')](util['format'](_0x82f6('0x15'),_0x12c5bc['id']));return rp({'uri':_0x249222[_0x82f6('0x10')][_0x82f6('0x16')][_0x82f6('0x14')],'json':!![]})['then'](function(_0xdc4dea){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x17'),_0x12c5bc['id']));if(_0xdc4dea&&_0xdc4dea['results']&&_0xdc4dea['results'][_0x82f6('0x18')]&&_0xdc4dea[_0x82f6('0x19')]['transcripts']['length']){_0x1d9091[_0x82f6('0x12')]='';for(var _0x31face=0x0;_0x31face<_0xdc4dea['results'][_0x82f6('0x18')][_0x82f6('0x1a')];_0x31face++){_0x1d9091['fileText']+=_0xdc4dea['results'][_0x82f6('0x18')][_0x31face]['transcript']+'';}}return _0x12c5bc[_0x82f6('0x1b')](_0x1d9091);})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x1d'),_0x12c5bc['id']));if(!_0x12c5bc[_0x82f6('0x1e')]){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x20'));}if(!_0x442262[_0x82f6('0x21')]||!_0x442262[_0x82f6('0x22')]||!_0x442262[_0x82f6('0x23')]||!_0x442262[_0x82f6('0x24')]||!_0x442262[_0x82f6('0x25')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x27'));}if(!_0x1d9091[_0x82f6('0x12')]){throw new Error(_0x82f6('0x28'));}if(_0x442262[_0x82f6('0x22')]===_0x4cc967['id']){return _0x4cc967;}else{return db[_0x82f6('0x29')][_0x82f6('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x82f6('0x1c')](function(_0x2c764f){if(!_0x2c764f){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x2b'));}if(!_0x2c764f[_0x82f6('0xd')]||!_0x2c764f[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x194da7=_0x2c764f;logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2d'),_0x12c5bc['id']));return sentiment(_0x194da7[_0x82f6('0xd')],_0x194da7[_0x82f6('0xe')],_0x442262[_0x82f6('0x23')],_0x1d9091[_0x82f6('0x12')],_0x442262[_0x82f6('0x24')]);})['then'](function(_0x13a409){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2e'),_0x12c5bc['id']));return _0x12c5bc[_0x82f6('0x1b')]({'sentiment':_0x13a409[_0x82f6('0x2f')],'sPositive':_0x13a409[_0x82f6('0x30')][_0x82f6('0x31')],'sNegative':_0x13a409[_0x82f6('0x30')][_0x82f6('0x32')],'sMixed':_0x13a409[_0x82f6('0x30')][_0x82f6('0x33')],'sNeutral':_0x13a409[_0x82f6('0x30')][_0x82f6('0x34')]});})['then'](function(){logger[_0x82f6('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x12c5bc['id']));_0x1f8bf5();});case _0x82f6('0x35'):return _0x12c5bc[_0x82f6('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x249222[_0x82f6('0x10')][_0x82f6('0x36')]})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x12c5bc['id']));_0x1f8bf5();});default:logger[_0x82f6('0x9')](util['format'](_0x82f6('0x37'),_0x12c5bc['id']));break;}}else{return BPromise['resolve']()[_0x82f6('0x1c')](function(){if(!_0x12c5bc[_0x82f6('0x1e')]){throw new db['Sequelize'][(_0x82f6('0x26'))](_0x82f6('0x20'));}if(!_0x442262[_0x82f6('0x21')]||!_0x442262[_0x82f6('0x22')]||!_0x442262['sentimentRegion']||!_0x442262[_0x82f6('0x24')]||!_0x442262[_0x82f6('0x25')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x12c5bc[_0x82f6('0x12')]){throw new Error(_0x82f6('0x28'));}if(_0x442262['sentimentAccountId']===_0x4cc967['id']){return _0x4cc967;}else{return db[_0x82f6('0x29')][_0x82f6('0x2a')]({'where':{'id':_settings[_0x82f6('0x22')]}});}})[_0x82f6('0x1c')](function(_0xc3e250){if(!_0xc3e250){throw new db['Sequelize'][(_0x82f6('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xc3e250[_0x82f6('0xd')]||!_0xc3e250[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x194da7=_0xc3e250;logger[_0x82f6('0x9')](util[_0x82f6('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x12c5bc['id']));return sentiment(_0x194da7[_0x82f6('0xd')],_0x194da7[_0x82f6('0xe')],_0x442262[_0x82f6('0x23')],_0x12c5bc[_0x82f6('0x12')],_0x442262['language']);})[_0x82f6('0x1c')](function(_0x4797af){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2e'),_0x12c5bc['id']));return _0x12c5bc[_0x82f6('0x1b')]({'sentiment':_0x4797af[_0x82f6('0x2f')],'sPositive':_0x4797af[_0x82f6('0x30')]['Positive'],'sNegative':_0x4797af[_0x82f6('0x30')][_0x82f6('0x32')],'sMixed':_0x4797af[_0x82f6('0x30')][_0x82f6('0x33')],'sNeutral':_0x4797af[_0x82f6('0x30')][_0x82f6('0x34')],'transcribeStatus':_0x82f6('0x13')});})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x1d'),_0x12c5bc['id']));_0x1f8bf5();});}})['catch'](function(_0xfedf51){if(_0xfedf51){if(!_0xfedf51['name']||_0xfedf51[_0x82f6('0x38')]!=='SequelizeValidationError'){logger[_0x82f6('0x39')](util[_0x82f6('0xa')](_0x82f6('0x3a'),_0x12c5bc['id']),util[_0x82f6('0x3b')](_0xfedf51,{'showHidden':![],'depth':null}));}}_0x1f8bf5();});});}function checkTranscribe(){var _0x17a5ae;var _0x2fdcc6;var _0x53f7d4;return db[_0x82f6('0x3c')][_0x82f6('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x3868cc){if(!_0x3868cc||!_0x3868cc[_0x82f6('0x1a')]){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x3e'));}_0x17a5ae=_0x3868cc;return db[_0x82f6('0x3f')][_0x82f6('0x2a')]({'where':{'id':0x1}});})[_0x82f6('0x1c')](function(_0x4e9e13){if(!_0x4e9e13){throw new db['Sequelize'][(_0x82f6('0x26'))](_0x82f6('0x40'));}_0x2fdcc6=_0x4e9e13;if(!_0x2fdcc6[_0x82f6('0x41')]||!_0x2fdcc6['transcribeAccountId']||!_0x2fdcc6[_0x82f6('0x42')]||!_0x2fdcc6[_0x82f6('0x24')]||!_0x2fdcc6['bucket']){throw new db['Sequelize']['ValidationError'](_0x82f6('0x43'));}return db['CloudProvider'][_0x82f6('0x2a')]({'where':{'id':_0x2fdcc6['transcribeAccountId']}});})[_0x82f6('0x1c')](function(_0x4f69de){if(!_0x4f69de){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x2b'));}if(!_0x4f69de[_0x82f6('0xd')]||!_0x4f69de[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x53f7d4=_0x4f69de;var _0x597844=[];_0x17a5ae[_0x82f6('0x44')](function(_0x1c8304){_0x597844[_0x82f6('0x45')](checkTranscribeJob(_0x1c8304,_0x2fdcc6,_0x53f7d4));});return BPromise['all'](_0x597844);})['catch'](function(_0x13406f){if(_0x13406f){if(!_0x13406f[_0x82f6('0x38')]||_0x13406f[_0x82f6('0x38')]!==_0x82f6('0x46')){logger['error'](util[_0x82f6('0x3b')](_0x13406f,{'showHidden':![],'depth':null}));}}});}exports[_0x82f6('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 845b653..ec4a735 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 _0xbd1f=['then','length','map','info','join','update','timeout','format','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours'];(function(_0x1b035a,_0x463a53){var _0x42bbb6=function(_0xceec6c){while(--_0xceec6c){_0x1b035a['push'](_0x1b035a['shift']());}};_0x42bbb6(++_0x463a53);}(_0xbd1f,0x145));var _0xfbd1=function(_0x1eff1a,_0x5d05a9){_0x1eff1a=_0x1eff1a-0x0;var _0x478b4b=_0xbd1f[_0x1eff1a];return _0x478b4b;};'use strict';var _=require(_0xfbd1('0x0'));var moment=require(_0xfbd1('0x1'));var Redis=require(_0xfbd1('0x2'));var util=require(_0xfbd1('0x3'));var config=require(_0xfbd1('0x4'));var db=require(_0xfbd1('0x5'))['db'];var logger=require('../logger')(_0xfbd1('0x6'));config[_0xfbd1('0x7')]=_[_0xfbd1('0x8')](config[_0xfbd1('0x7')],{'host':_0xfbd1('0x9'),'port':0x18eb});var io=require(_0xfbd1('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x25cc49=[];return db[_0xfbd1('0xb')][_0xfbd1('0xc')]({'raw':!![],'attributes':['id',_0xfbd1('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfbd1('0xe')](0x18,_0xfbd1('0xf'))}}})[_0xfbd1('0x10')](function(_0x127c27){if(_0x127c27&&_0x127c27[_0xfbd1('0x11')]){_0x25cc49=_[_0xfbd1('0x12')](_0x127c27||[],'id');logger[_0xfbd1('0x13')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x25cc49[_0xfbd1('0x14')]());return db['WhatsappInteraction'][_0xfbd1('0x15')]({'closeReason':'system','disposition':_0xfbd1('0x16'),'closed':!![],'closedAt':moment()[_0xfbd1('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x25cc49}});}})[_0xfbd1('0x10')](function(){if(_0x25cc49&&_0x25cc49[_0xfbd1('0x11')]){logger[_0xfbd1('0x13')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x25cc49['join']());for(var _0x5e596e=0x0;_0x5e596e<_0x25cc49['length'];_0x5e596e++){io[_0xfbd1('0x18')](_0xfbd1('0x19'),{'id':_0x25cc49[_0x5e596e],'closed':!![]});}}})[_0xfbd1('0x1a')](function(_0x9377be){logger[_0xfbd1('0x1b')](_0xfbd1('0x1c'),_0x9377be?util[_0xfbd1('0x1d')](_0x9377be,{'showHidden':![],'depth':null}):'');});}exports[_0xfbd1('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5a27=['lodash','ioredis','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x475e33,_0x42824a){var _0x318871=function(_0x54394c){while(--_0x54394c){_0x475e33['push'](_0x475e33['shift']());}};_0x318871(++_0x42824a);}(_0x5a27,0x8c));var _0x75a2=function(_0xb5a4c9,_0x55bc32){_0xb5a4c9=_0xb5a4c9-0x0;var _0x40b411=_0x5a27[_0xb5a4c9];return _0x40b411;};'use strict';var _=require(_0x75a2('0x0'));var moment=require('moment');var Redis=require(_0x75a2('0x1'));var util=require('util');var config=require(_0x75a2('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x75a2('0x3'))(_0x75a2('0x4'));config[_0x75a2('0x5')]=_[_0x75a2('0x6')](config[_0x75a2('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x75a2('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x42015d=[];return db[_0x75a2('0x8')][_0x75a2('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x75a2('0xa')](0x18,_0x75a2('0xb'))}}})[_0x75a2('0xc')](function(_0x3ad955){if(_0x3ad955&&_0x3ad955[_0x75a2('0xd')]){_0x42015d=_[_0x75a2('0xe')](_0x3ad955||[],'id');logger['info'](_0x75a2('0xf'),_0x42015d[_0x75a2('0x10')]());return db[_0x75a2('0x8')][_0x75a2('0x11')]({'closeReason':'system','disposition':_0x75a2('0x12'),'closed':!![],'closedAt':moment()[_0x75a2('0x13')](_0x75a2('0x14'))},{'where':{'id':_0x42015d}});}})[_0x75a2('0xc')](function(){if(_0x42015d&&_0x42015d['length']){logger[_0x75a2('0x15')](_0x75a2('0x16'),_0x42015d[_0x75a2('0x10')]());for(var _0x46e6b2=0x0;_0x46e6b2<_0x42015d[_0x75a2('0xd')];_0x46e6b2++){io[_0x75a2('0x17')]('whatsappInteraction:update',{'id':_0x42015d[_0x46e6b2],'closed':!![]});}}})['catch'](function(_0x239c53){logger[_0x75a2('0x18')](_0x75a2('0x19'),_0x239c53?util[_0x75a2('0x1a')](_0x239c53,{'showHidden':![],'depth':null}):'');});}exports[_0x75a2('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 0a7d813..0f6fa0b 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52d2=['Biondo','innocenzo.biondo','now','push','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','Innocenzo'];(function(_0x39f6a3,_0x3a980c){var _0x6ba7d1=function(_0x327089){while(--_0x327089){_0x39f6a3['push'](_0x39f6a3['shift']());}};_0x6ba7d1(++_0x3a980c);}(_0x52d2,0x95));var _0x252d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x52d2[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x252d('0x0'));var db=require(_0x252d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x252d('0x2')+i,'lastName':_0x252d('0x3')+i,'phone':0xf879fb460+i,'email':_0x252d('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x252d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x252d('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x252d('0x6')]({'id':i,'firstName':_0x252d('0x2')+i,'lastName':_0x252d('0x3')+i,'phone':0xf879fb460+i,'email':_0x252d('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x252d('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x252d('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x252d('0x5')](),'updatedAt':Date[_0x252d('0x5')]()});}db[_0x252d('0x7')][_0x252d('0x8')]({'where':{}})[_0x252d('0x9')](function(){return db[_0x252d('0x7')][_0x252d('0xa')](contacts);})['then'](function(){console[_0x252d('0xb')](_0x252d('0xc'),_0x252d('0xd'));return db[_0x252d('0xe')][_0x252d('0x8')]({'where':{}});})[_0x252d('0x9')](function(){return db[_0x252d('0xe')][_0x252d('0xa')](hopper);})[_0x252d('0x9')](function(){console[_0x252d('0xb')]('finished\x20populating',_0x252d('0xf'));return db[_0x252d('0x7')][_0x252d('0xa')](contacts2);})[_0x252d('0x9')](function(){console[_0x252d('0xb')]('finished\x20populating',_0x252d('0x10'));return db[_0x252d('0xe')]['bulkCreate'](hopper2);})['then'](function(){console[_0x252d('0xb')](_0x252d('0xc'),_0x252d('0x11'));})[_0x252d('0x12')](function(_0x1bdc66){console[_0x252d('0xb')](_0x1bdc66);}); \ No newline at end of file +var _0xf1cc=['../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1cc,0x168));var _0xcf1c=function(_0x2d89f7,_0x41f4d0){_0x2d89f7=_0x2d89f7-0x0;var _0x5c5880=_0xf1cc[_0x2d89f7];return _0x5c5880;};'use strict';var util=require('util');var db=require(_0xcf1c('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xcf1c('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xcf1c('0x2')+i,'phone':0xf879fb460+i,'email':_0xcf1c('0x3')+i+_0xcf1c('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcf1c('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcf1c('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcf1c('0x1')]({'id':i,'firstName':_0xcf1c('0x6')+i,'lastName':_0xcf1c('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcf1c('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xcf1c('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcf1c('0x5')](),'updatedAt':Date[_0xcf1c('0x5')]()});}db[_0xcf1c('0x7')][_0xcf1c('0x8')]({'where':{}})['then'](function(){return db[_0xcf1c('0x7')][_0xcf1c('0x9')](contacts);})[_0xcf1c('0xa')](function(){console[_0xcf1c('0xb')](_0xcf1c('0xc'),_0xcf1c('0xd'));return db[_0xcf1c('0xe')][_0xcf1c('0x8')]({'where':{}});})[_0xcf1c('0xa')](function(){return db[_0xcf1c('0xe')]['bulkCreate'](hopper);})[_0xcf1c('0xa')](function(){console['log'](_0xcf1c('0xc'),_0xcf1c('0xf'));return db[_0xcf1c('0x7')][_0xcf1c('0x9')](contacts2);})[_0xcf1c('0xa')](function(){console[_0xcf1c('0xb')](_0xcf1c('0xc'),_0xcf1c('0x10'));return db['CmHopper'][_0xcf1c('0x9')](hopper2);})[_0xcf1c('0xa')](function(){console['log'](_0xcf1c('0xc'),_0xcf1c('0x11'));})['catch'](function(_0x27c539){console['log'](_0x27c539);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index eba5840..ce1d8f2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc667=['friend','udp','wss','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x5d2eff,_0x33900d){var _0x4319f0=function(_0x568ea0){while(--_0x568ea0){_0x5d2eff['push'](_0x5d2eff['shift']());}};_0x4319f0(++_0x33900d);}(_0xc667,0x12b));var _0x7c66=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc667[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var db=require(_0x7c66('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7c66('0x1')]({'name':util[_0x7c66('0x2')](_0x7c66('0x3'),_0x7c66('0x4'),i),'fullname':util[_0x7c66('0x2')](_0x7c66('0x3'),_0x7c66('0x4'),i),'email':util[_0x7c66('0x2')](_0x7c66('0x5'),_0x7c66('0x4'),i),'role':_0x7c66('0x4'),'password':_0x7c66('0x6'),'internal':0xfa0+i,'type':_0x7c66('0x7'),'transport':[_0x7c66('0x8'),'ws',_0x7c66('0x9')],'disallow':['all'],'allow':[_0x7c66('0xa')],'defaultuser':util[_0x7c66('0x2')](_0x7c66('0x3'),_0x7c66('0x4'),i),'encryption':_0x7c66('0xb'),'avpf':_0x7c66('0xb'),'force_avp':_0x7c66('0xb'),'icesupport':_0x7c66('0xb'),'dtlsenable':_0x7c66('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x7c66('0xc'),'callerid':util['format'](_0x7c66('0xd'),util[_0x7c66('0x2')](_0x7c66('0x3'),_0x7c66('0x4'),i),0xfa0+i)});}db[_0x7c66('0xe')][_0x7c66('0xf')](users)['then'](function(){console[_0x7c66('0x10')](_0x7c66('0x11'));})['catch'](function(_0x2eb8b0){console['log'](_0x2eb8b0);}); \ No newline at end of file +var _0x61ba=['friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x4d9940,_0x33cf28){var _0x484586=function(_0x40a883){while(--_0x40a883){_0x4d9940['push'](_0x4d9940['shift']());}};_0x484586(++_0x33cf28);}(_0x61ba,0x174));var _0xa61b=function(_0xc7dda6,_0x45d05e){_0xc7dda6=_0xc7dda6-0x0;var _0x562edb=_0x61ba[_0xc7dda6];return _0x562edb;};'use strict';var util=require(_0xa61b('0x0'));var db=require(_0xa61b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa61b('0x2')]({'name':util[_0xa61b('0x3')](_0xa61b('0x4'),_0xa61b('0x5'),i),'fullname':util[_0xa61b('0x3')](_0xa61b('0x4'),_0xa61b('0x5'),i),'email':util[_0xa61b('0x3')](_0xa61b('0x6'),'agent',i),'role':_0xa61b('0x5'),'password':_0xa61b('0x7'),'internal':0xfa0+i,'type':_0xa61b('0x8'),'transport':[_0xa61b('0x9'),'ws',_0xa61b('0xa')],'disallow':['all'],'allow':[_0xa61b('0xb')],'defaultuser':util[_0xa61b('0x3')](_0xa61b('0x4'),_0xa61b('0x5'),i),'encryption':_0xa61b('0xc'),'avpf':'yes','force_avp':_0xa61b('0xc'),'icesupport':_0xa61b('0xc'),'dtlsenable':_0xa61b('0xc'),'dtlsverify':'no','dtlscertfile':_0xa61b('0xd'),'dtlsprivatekey':_0xa61b('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0xa61b('0xf'),util[_0xa61b('0x3')](_0xa61b('0x4'),_0xa61b('0x5'),i),0xfa0+i)});}db[_0xa61b('0x10')][_0xa61b('0x11')](users)[_0xa61b('0x12')](function(){console[_0xa61b('0x13')]('add\x20user');})['catch'](function(_0x294f58){console['log'](_0x294f58);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index e09ed21..34cb1d6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1156=['admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','Campaign','user','userProfileId','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','format','query','User','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0x1156,0x93));var _0x6115=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x1156[_0x11a55c];return _0x26c390;};'use strict';var _=require(_0x6115('0x0'));var util=require(_0x6115('0x1'));var BPromise=require(_0x6115('0x2'));var db=require(_0x6115('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6115('0x4')],'include':[{'as':_0x6115('0x5'),'model':db['User'],'attributes':['id',_0x6115('0x4'),'role'],'raw':!![],'where':{'role':_0x6115('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6115('0x4')],'where':{'role':_0x6115('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x6115('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x6115('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6115('0x4'),_0x6115('0x8')],'where':{'type':_0x6115('0x9')}};function getAssociatedResources(_0x1da1ad,_0x549edd,_0x314740){return db[_0x6115('0xa')][_0x6115('0xb')]({'where':{'name':_0x1da1ad,'userProfileId':_0x549edd},'raw':!![]})[_0x6115('0xc')](function(_0x4f650f){if(_0x4f650f){if(_0x4f650f[_0x6115('0xd')]){switch(_0x1da1ad){case _0x6115('0xe'):case _0x6115('0xf'):case _0x6115('0x10'):case _0x6115('0x11'):case _0x6115('0x12'):case _0x6115('0x13'):case _0x6115('0x14'):return db[_0x314740][_0x6115('0x15')](queryQueues);case _0x6115('0x16'):return db[_0x314740]['findAll'](queryTelephones);case _0x6115('0x17'):return db[_0x314740][_0x6115('0x15')](queryTrunks);case _0x6115('0x18'):return db[_0x314740][_0x6115('0x15')](queryCampaigns);}}else{return db[_0x6115('0x19')][_0x6115('0x15')]({'attributes':[_0x6115('0x1a')],'where':{'sectionId':_0x4f650f['id']},'raw':!![]})[_0x6115('0xc')](function(_0x170cd5){if(_0x170cd5){var _0x463925={'where':{'id':_[_0x6115('0x1b')](_0x170cd5,_0x6115('0x1a'))},'raw':!![]};switch(_0x314740){case'User':_0x463925[_0x6115('0x1c')][_0x6115('0x1d')]=_0x6115('0x7');break;case'Campaign':_0x463925['where'][_0x6115('0x8')]=_0x6115('0x9');break;}return db[_0x314740]['findAll'](_0x463925);}else{return[];}});}}else{return[];}})[_0x6115('0xc')](function(_0x1b77aa){return _0x1b77aa;});}function joinOrLeaveQueues(_0xa5192f,_0x5dbe09,_0x218f1d,_0x4e4041){_0xa5192f[_0x5dbe09](util[_0x6115('0x1e')]('%s:queue:%s',_0x218f1d,_0x4e4041[_0x6115('0x4')]));if(_0x4e4041[_0x6115('0x5')]){for(var _0x4d6fc2=0x0;_0x4d6fc2<_0x4e4041[_0x6115('0x5')]['length'];_0x4d6fc2+=0x1){_0xa5192f[_0x5dbe09](util[_0x6115('0x1e')]('user:%s',_0x4e4041[_0x6115('0x5')][_0x4d6fc2][_0x6115('0x4')]));}}}function joinOrLeave(_0x2aeddc,_0x49f7a0,_0x5b8c46){var _0x2ed108;if(_0x2aeddc['handshake'][_0x6115('0x1f')]['id']){db[_0x6115('0x20')]['find']({'attributes':['id','name',_0x6115('0x1d'),'userProfileId'],'where':{'id':_0x2aeddc[_0x6115('0x21')][_0x6115('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x6115('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x6115('0x23')],'as':_0x6115('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x6115('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x6115('0x26')],'as':_0x6115('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x6115('0x28')],'as':_0x6115('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x6115('0x2a')],'as':_0x6115('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x482ff8){if(_0x482ff8){_0x2ed108=_0x482ff8;_0x2aeddc[_0x49f7a0](util['format'](_0x6115('0x2c'),_0x482ff8[_0x6115('0x4')]));var _0x55e08c=[];switch(_0x482ff8[_0x6115('0x1d')]){case _0x6115('0x2d'):_0x2aeddc[_0x49f7a0](_0x6115('0x2e'));_0x2aeddc[_0x49f7a0](_0x6115('0x2f'));if(queryQueues[_0x6115('0x30')](_0x6115('0x31'))){delete queryQueues['include'];}_0x55e08c[_0x6115('0x32')](db[_0x6115('0x33')][_0x6115('0x15')](queryQueues));_0x55e08c['push'](db[_0x6115('0x34')]['findAll'](queryQueues));_0x55e08c['push'](db[_0x6115('0x35')][_0x6115('0x15')](queryQueues));_0x55e08c['push'](db[_0x6115('0x36')][_0x6115('0x15')](queryQueues));_0x55e08c[_0x6115('0x32')](db[_0x6115('0x37')]['findAll'](queryQueues));_0x55e08c[_0x6115('0x32')](db['OpenchannelQueue'][_0x6115('0x15')](queryQueues));_0x55e08c[_0x6115('0x32')](db[_0x6115('0x38')][_0x6115('0x15')](queryQueues));_0x55e08c[_0x6115('0x32')](db[_0x6115('0x20')][_0x6115('0x15')](queryTelephones));_0x55e08c['push'](db[_0x6115('0x39')][_0x6115('0x15')](queryTrunks));_0x55e08c['push'](db[_0x6115('0x3a')][_0x6115('0x15')](queryCampaigns));_0x55e08c[_0x6115('0x32')](db['User'][_0x6115('0x15')](queryAgents));break;case _0x6115('0x3b'):_0x2aeddc[_0x49f7a0](_0x6115('0x2e'));_0x2aeddc[_0x49f7a0]('voice:outbound');_0x55e08c['push'](getAssociatedResources(_0x6115('0xe'),_0x482ff8[_0x6115('0x3c')],_0x6115('0x33')));_0x55e08c['push'](getAssociatedResources(_0x6115('0xf'),_0x482ff8[_0x6115('0x3c')],_0x6115('0x34')));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x10'),_0x482ff8[_0x6115('0x3c')],_0x6115('0x35')));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x11'),_0x482ff8[_0x6115('0x3c')],_0x6115('0x36')));_0x55e08c[_0x6115('0x32')](getAssociatedResources('MailQueues',_0x482ff8[_0x6115('0x3c')],'MailQueue'));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x13'),_0x482ff8[_0x6115('0x3c')],'OpenchannelQueue'));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x14'),_0x482ff8[_0x6115('0x3c')],'WhatsappQueue'));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x16'),_0x482ff8[_0x6115('0x3c')],'User'));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x17'),_0x482ff8['userProfileId'],_0x6115('0x39')));_0x55e08c[_0x6115('0x32')](getAssociatedResources(_0x6115('0x18'),_0x482ff8[_0x6115('0x3c')],_0x6115('0x3a')));_0x55e08c[_0x6115('0x32')](db[_0x6115('0x20')]['findAll'](queryAgents));break;case'agent':_0x2aeddc[_0x49f7a0]('voice:inbound');_0x2aeddc[_0x49f7a0](_0x6115('0x2f'));_0x55e08c['push'](_0x482ff8[_0x6115('0x3d')]({'attributes':['id',_0x6115('0x4')]}));_0x55e08c['push'](_0x482ff8['getChatQueues']({'attributes':['id',_0x6115('0x4')]}));_0x55e08c[_0x6115('0x32')](_0x482ff8['getFaxQueues']({'attributes':['id',_0x6115('0x4')]}));_0x55e08c[_0x6115('0x32')](_0x482ff8[_0x6115('0x3e')]({'attributes':['id',_0x6115('0x4')]}));_0x55e08c[_0x6115('0x32')](_0x482ff8[_0x6115('0x3f')]({'attributes':['id',_0x6115('0x4')]}));_0x55e08c[_0x6115('0x32')](_0x482ff8[_0x6115('0x40')]({'attributes':['id','name']}));_0x55e08c[_0x6115('0x32')](_0x482ff8[_0x6115('0x41')]({'attributes':['id',_0x6115('0x4')]}));break;}return BPromise[_0x6115('0x42')](_0x55e08c);}})[_0x6115('0xc')](function(_0x3bfad4){if(_0x3bfad4&&_0x3bfad4['length']){for(var _0x2f11cd=0x0;_0x2f11cd<_0x3bfad4['length'];_0x2f11cd+=0x1){for(var _0xc1a5df=0x0;_0xc1a5df<_0x3bfad4[_0x2f11cd][_0x6115('0x43')];_0xc1a5df+=0x1){switch(_0x2f11cd){case 0x0:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,'voice',_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x1:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,_0x6115('0x44'),_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x2:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,'fax',_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x3:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,_0x6115('0x45'),_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x4:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,_0x6115('0x46'),_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x5:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,'openchannel',_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x6:joinOrLeaveQueues(_0x2aeddc,_0x49f7a0,'whatsapp',_0x3bfad4[_0x2f11cd][_0xc1a5df]);break;case 0x7:if(_0x2ed108[_0x6115('0x1d')]!==_0x6115('0x6'))_0x2aeddc[_0x49f7a0](util[_0x6115('0x1e')](_0x6115('0x47'),_0x3bfad4[_0x2f11cd][_0xc1a5df][_0x6115('0x4')]));break;case 0x8:if(_0x2ed108[_0x6115('0x1d')]!==_0x6115('0x6'))_0x2aeddc[_0x49f7a0](util[_0x6115('0x1e')](_0x6115('0x48'),_0x3bfad4[_0x2f11cd][_0xc1a5df][_0x6115('0x4')]));break;case 0x9:if(_0x2ed108['role']!=='agent')_0x2aeddc[_0x49f7a0](util['format'](_0x6115('0x49'),_0x3bfad4[_0x2f11cd][_0xc1a5df][_0x6115('0x8')],_0x3bfad4[_0x2f11cd][_0xc1a5df]['name']));break;case 0xa:_0x2aeddc[_0x49f7a0](util[_0x6115('0x1e')]('user:%s',_0x3bfad4[_0x2f11cd][_0xc1a5df][_0x6115('0x4')]));break;}}}}})[_0x6115('0xc')](function(){if(_0x49f7a0==='leave'){var _0x1da5a8=_[_0x6115('0x1b')](_0x2ed108['ChatInteractions'],'id');return _0x2ed108[_0x6115('0x4a')](_0x1da5a8)[_0x6115('0xc')](function(){for(var _0x45d0d9=0x0;_0x45d0d9<_0x1da5a8[_0x6115('0x43')];_0x45d0d9+=0x1){_0x5b8c46[_0x6115('0x4b')](_0x6115('0x4c'),{'ChatInteractionId':Number(_0x1da5a8[_0x45d0d9]),'UserId':Number(_0x2ed108['id'])});}});}})[_0x6115('0xc')](function(){if(_0x49f7a0===_0x6115('0x4d')){var _0x48ac1c=_[_0x6115('0x1b')](_0x2ed108[_0x6115('0x24')],'id');return _0x2ed108[_0x6115('0x4e')](_0x48ac1c)['then'](function(){for(var _0x4c6058=0x0;_0x4c6058<_0x48ac1c[_0x6115('0x43')];_0x4c6058+=0x1){_0x5b8c46[_0x6115('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x48ac1c[_0x4c6058]),'UserId':Number(_0x2ed108['id'])});}});}})['then'](function(){if(_0x49f7a0===_0x6115('0x4d')){var _0x59508d=_[_0x6115('0x1b')](_0x2ed108[_0x6115('0x25')],'id');return _0x2ed108['removeFaxInteractions'](_0x59508d)[_0x6115('0xc')](function(){for(var _0x367d3e=0x0;_0x367d3e<_0x59508d[_0x6115('0x43')];_0x367d3e+=0x1){_0x5b8c46[_0x6115('0x4b')](_0x6115('0x4f'),{'FaxInteractionId':Number(_0x59508d[_0x367d3e]),'UserId':Number(_0x2ed108['id'])});}});}})['then'](function(){if(_0x49f7a0==='leave'){var _0x4ad9c5=_['map'](_0x2ed108[_0x6115('0x27')],'id');return _0x2ed108[_0x6115('0x50')](_0x4ad9c5)[_0x6115('0xc')](function(){for(var _0x5e0922=0x0;_0x5e0922<_0x4ad9c5[_0x6115('0x43')];_0x5e0922+=0x1){_0x5b8c46[_0x6115('0x4b')](_0x6115('0x51'),{'SmsInteractionId':Number(_0x4ad9c5[_0x5e0922]),'UserId':Number(_0x2ed108['id'])});}});}})[_0x6115('0xc')](function(){if(_0x49f7a0===_0x6115('0x4d')){var _0xdc4b80=_[_0x6115('0x1b')](_0x2ed108[_0x6115('0x29')],'id');return _0x2ed108[_0x6115('0x52')](_0xdc4b80)['then'](function(){for(var _0x6aaaf1=0x0;_0x6aaaf1<_0xdc4b80[_0x6115('0x43')];_0x6aaaf1+=0x1){_0x5b8c46[_0x6115('0x4b')](_0x6115('0x53'),{'OpenchannelInteractionId':Number(_0xdc4b80[_0x6aaaf1]),'UserId':Number(_0x2ed108['id'])});}});}})['then'](function(){if(_0x49f7a0===_0x6115('0x4d')){var _0xe816cb=_[_0x6115('0x1b')](_0x2ed108[_0x6115('0x2b')],'id');return _0x2ed108[_0x6115('0x54')](_0xe816cb)['then'](function(){for(var _0x270bac=0x0;_0x270bac<_0xe816cb[_0x6115('0x43')];_0x270bac+=0x1){_0x5b8c46[_0x6115('0x4b')](_0x6115('0x55'),{'WhatsappInteractionId':Number(_0xe816cb[_0x270bac]),'UserId':Number(_0x2ed108['id'])});}});}})['catch'](function(_0x51ff2a){_0x2aeddc[_0x6115('0x56')](_0x51ff2a);});}}function onDisconnect(_0x54ce51,_0x143ad5){joinOrLeave(_0x54ce51,_0x6115('0x4d'),_0x143ad5);}function onConnect(_0x2f1d90){joinOrLeave(_0x2f1d90,_0x6115('0x57'));}exports[_0x6115('0x58')]=function(_0x31e4d5){_0x31e4d5['on'](_0x6115('0x59'),function(_0x20d36b){_0x20d36b[_0x6115('0x5a')](0x0);_0x20d36b[_0x6115('0x5b')]=_0x20d36b[_0x6115('0x5c')][_0x6115('0x59')][_0x6115('0x5d')]+':'+_0x20d36b[_0x6115('0x5c')]['connection']['remotePort'];_0x20d36b['connectedAt']=new Date();_0x20d36b[_0x6115('0x56')]=function(_0x239738){console['log']('SocketIO\x20'+_0x20d36b['nsp'][_0x6115('0x4')]+'['+_0x20d36b[_0x6115('0x5b')]+']',_0x239738);};_0x20d36b['on'](_0x6115('0x5e'),function(){onDisconnect(_0x20d36b,_0x31e4d5);_0x20d36b[_0x6115('0x56')](_0x6115('0x5f'));});onConnect(_0x20d36b);_0x20d36b[_0x6115('0x56')]('CONNECTED');});}; \ No newline at end of file +var _0x2ba6=['VoiceQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:outbound','ChatQueues','ChatQueue','OpenchannelQueues','WhatsappQueues','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','fax','sms','mail','openchannel','campaign:%s:%s','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','type','UserProfileSection','findOne','then','autoAssociation'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x39415f,_0x2044e7){_0x39415f=_0x39415f-0x0;var _0x4b4bf8=_0x2ba6[_0x39415f];return _0x4b4bf8;};'use strict';var _=require(_0x62ba('0x0'));var util=require(_0x62ba('0x1'));var BPromise=require(_0x62ba('0x2'));var db=require(_0x62ba('0x3'))['db'];var config=require(_0x62ba('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x62ba('0x5'),'model':db[_0x62ba('0x6')],'attributes':['id',_0x62ba('0x7'),_0x62ba('0x8')],'raw':!![],'where':{'role':_0x62ba('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x62ba('0x7')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x62ba('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x62ba('0x7')],'where':{'role':_0x62ba('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x62ba('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0xb60414,_0xc1cb24,_0x2bc3da){return db[_0x62ba('0xb')][_0x62ba('0xc')]({'where':{'name':_0xb60414,'userProfileId':_0xc1cb24},'raw':!![]})[_0x62ba('0xd')](function(_0x22e81e){if(_0x22e81e){if(_0x22e81e[_0x62ba('0xe')]){switch(_0xb60414){case _0x62ba('0xf'):case'ChatQueues':case _0x62ba('0x10'):case _0x62ba('0x11'):case _0x62ba('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2bc3da][_0x62ba('0x13')](queryQueues);case _0x62ba('0x14'):return db[_0x2bc3da][_0x62ba('0x13')](queryTelephones);case _0x62ba('0x15'):return db[_0x2bc3da][_0x62ba('0x13')](queryTrunks);case _0x62ba('0x16'):return db[_0x2bc3da][_0x62ba('0x13')](queryCampaigns);}}else{return db[_0x62ba('0x17')][_0x62ba('0x13')]({'attributes':[_0x62ba('0x18')],'where':{'sectionId':_0x22e81e['id']},'raw':!![]})[_0x62ba('0xd')](function(_0x2ebaa3){if(_0x2ebaa3){var _0x5456b9={'where':{'id':_[_0x62ba('0x19')](_0x2ebaa3,_0x62ba('0x18'))},'raw':!![]};switch(_0x2bc3da){case _0x62ba('0x6'):_0x5456b9[_0x62ba('0x1a')]['role']=_0x62ba('0x1b');break;case _0x62ba('0x1c'):_0x5456b9[_0x62ba('0x1a')][_0x62ba('0xa')]=_0x62ba('0x1d');break;}return db[_0x2bc3da][_0x62ba('0x13')](_0x5456b9);}else{return[];}});}}else{return[];}})['then'](function(_0x2f7404){return _0x2f7404;});}function joinOrLeaveQueues(_0x96492,_0x6163f0,_0x4318cc,_0xf00b36){_0x96492[_0x6163f0](util[_0x62ba('0x1e')](_0x62ba('0x1f'),_0x4318cc,_0xf00b36[_0x62ba('0x7')]));if(_0xf00b36[_0x62ba('0x5')]){for(var _0x44ecb3=0x0;_0x44ecb3<_0xf00b36[_0x62ba('0x5')][_0x62ba('0x20')];_0x44ecb3+=0x1){_0x96492[_0x6163f0](util[_0x62ba('0x1e')](_0x62ba('0x21'),_0xf00b36[_0x62ba('0x5')][_0x44ecb3][_0x62ba('0x7')]));}}}function joinOrLeave(_0x1bf810,_0x447ae4,_0x204679){var _0x84cd96;if(_0x1bf810[_0x62ba('0x22')][_0x62ba('0x23')]['id']){db[_0x62ba('0x6')]['find']({'attributes':['id',_0x62ba('0x7'),_0x62ba('0x8'),_0x62ba('0x24')],'where':{'id':_0x1bf810[_0x62ba('0x22')][_0x62ba('0x23')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x62ba('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x62ba('0x26')],'as':_0x62ba('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x62ba('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x62ba('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x62ba('0x2a')],'as':_0x62ba('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x62ba('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x62ba('0xd')](function(_0x3323a3){if(_0x3323a3){_0x84cd96=_0x3323a3;_0x1bf810[_0x447ae4](util[_0x62ba('0x1e')](_0x62ba('0x21'),_0x3323a3[_0x62ba('0x7')]));var _0x15597a=[];switch(_0x3323a3['role']){case _0x62ba('0x2d'):_0x1bf810[_0x447ae4](_0x62ba('0x2e'));_0x1bf810[_0x447ae4]('voice:outbound');if(queryQueues[_0x62ba('0x2f')](_0x62ba('0x30'))){delete queryQueues[_0x62ba('0x30')];}_0x15597a['push'](db['VoiceQueue'][_0x62ba('0x13')](queryQueues));_0x15597a[_0x62ba('0x31')](db['ChatQueue']['findAll'](queryQueues));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x32')][_0x62ba('0x13')](queryQueues));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x33')][_0x62ba('0x13')](queryQueues));_0x15597a['push'](db[_0x62ba('0x34')][_0x62ba('0x13')](queryQueues));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x35')][_0x62ba('0x13')](queryQueues));_0x15597a['push'](db[_0x62ba('0x36')]['findAll'](queryQueues));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x6')]['findAll'](queryTelephones));_0x15597a[_0x62ba('0x31')](db['Trunk'][_0x62ba('0x13')](queryTrunks));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x1c')][_0x62ba('0x13')](queryCampaigns));_0x15597a[_0x62ba('0x31')](db['User']['findAll'](queryAgents));break;case _0x62ba('0x37'):_0x1bf810[_0x447ae4](_0x62ba('0x2e'));_0x1bf810[_0x447ae4](_0x62ba('0x38'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0xf'),_0x3323a3[_0x62ba('0x24')],'VoiceQueue'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x39'),_0x3323a3['userProfileId'],_0x62ba('0x3a')));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x10'),_0x3323a3[_0x62ba('0x24')],_0x62ba('0x32')));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x11'),_0x3323a3[_0x62ba('0x24')],'SmsQueue'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x12'),_0x3323a3[_0x62ba('0x24')],'MailQueue'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x3b'),_0x3323a3[_0x62ba('0x24')],_0x62ba('0x35')));_0x15597a['push'](getAssociatedResources(_0x62ba('0x3c'),_0x3323a3[_0x62ba('0x24')],'WhatsappQueue'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x14'),_0x3323a3[_0x62ba('0x24')],'User'));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x15'),_0x3323a3['userProfileId'],_0x62ba('0x3d')));_0x15597a[_0x62ba('0x31')](getAssociatedResources(_0x62ba('0x16'),_0x3323a3['userProfileId'],_0x62ba('0x1c')));_0x15597a[_0x62ba('0x31')](db[_0x62ba('0x6')][_0x62ba('0x13')](queryAgents));break;case _0x62ba('0x9'):_0x1bf810[_0x447ae4]('voice:inbound');_0x1bf810[_0x447ae4](_0x62ba('0x38'));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x3e')]({'attributes':['id','name']}));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x3f')]({'attributes':['id',_0x62ba('0x7')]}));_0x15597a[_0x62ba('0x31')](_0x3323a3['getFaxQueues']({'attributes':['id',_0x62ba('0x7')]}));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x40')]({'attributes':['id',_0x62ba('0x7')]}));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x41')]({'attributes':['id',_0x62ba('0x7')]}));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x42')]({'attributes':['id','name']}));_0x15597a[_0x62ba('0x31')](_0x3323a3[_0x62ba('0x43')]({'attributes':['id',_0x62ba('0x7')]}));break;}return BPromise[_0x62ba('0x44')](_0x15597a);}})[_0x62ba('0xd')](function(_0x3b61c3){if(_0x3b61c3&&_0x3b61c3[_0x62ba('0x20')]){for(var _0xb853d0=0x0;_0xb853d0<_0x3b61c3['length'];_0xb853d0+=0x1){for(var _0x373594=0x0;_0x373594<_0x3b61c3[_0xb853d0][_0x62ba('0x20')];_0x373594+=0x1){switch(_0xb853d0){case 0x0:joinOrLeaveQueues(_0x1bf810,_0x447ae4,'voice',_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x1:joinOrLeaveQueues(_0x1bf810,_0x447ae4,'chat',_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x2:joinOrLeaveQueues(_0x1bf810,_0x447ae4,_0x62ba('0x45'),_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x3:joinOrLeaveQueues(_0x1bf810,_0x447ae4,_0x62ba('0x46'),_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x4:joinOrLeaveQueues(_0x1bf810,_0x447ae4,_0x62ba('0x47'),_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x5:joinOrLeaveQueues(_0x1bf810,_0x447ae4,_0x62ba('0x48'),_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x6:joinOrLeaveQueues(_0x1bf810,_0x447ae4,'whatsapp',_0x3b61c3[_0xb853d0][_0x373594]);break;case 0x7:if(_0x84cd96[_0x62ba('0x8')]!=='agent')_0x1bf810[_0x447ae4](util['format']('telephone:%s',_0x3b61c3[_0xb853d0][_0x373594][_0x62ba('0x7')]));break;case 0x8:if(_0x84cd96[_0x62ba('0x8')]!==_0x62ba('0x9'))_0x1bf810[_0x447ae4](util['format']('trunk:%s',_0x3b61c3[_0xb853d0][_0x373594]['name']));break;case 0x9:if(_0x84cd96[_0x62ba('0x8')]!==_0x62ba('0x9'))_0x1bf810[_0x447ae4](util[_0x62ba('0x1e')](_0x62ba('0x49'),_0x3b61c3[_0xb853d0][_0x373594][_0x62ba('0xa')],_0x3b61c3[_0xb853d0][_0x373594][_0x62ba('0x7')]));break;case 0xa:_0x1bf810[_0x447ae4](util['format'](_0x62ba('0x21'),_0x3b61c3[_0xb853d0][_0x373594][_0x62ba('0x7')]));break;}}}}})[_0x62ba('0xd')](function(){if(_0x447ae4==='leave'){var _0x15589a=_[_0x62ba('0x19')](_0x84cd96[_0x62ba('0x25')],'id');return _0x84cd96['removeChatInteractions'](_0x15589a)[_0x62ba('0xd')](function(){for(var _0x2d48e3=0x0;_0x2d48e3<_0x15589a[_0x62ba('0x20')];_0x2d48e3+=0x1){_0x204679[_0x62ba('0x4a')](_0x62ba('0x4b'),{'ChatInteractionId':Number(_0x15589a[_0x2d48e3]),'UserId':Number(_0x84cd96['id'])});}});}})[_0x62ba('0xd')](function(){if(_0x447ae4===_0x62ba('0x4c')){var _0x454b9c=_[_0x62ba('0x19')](_0x84cd96[_0x62ba('0x27')],'id');return _0x84cd96[_0x62ba('0x4d')](_0x454b9c)[_0x62ba('0xd')](function(){for(var _0x1d8d2f=0x0;_0x1d8d2f<_0x454b9c['length'];_0x1d8d2f+=0x1){_0x204679['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x454b9c[_0x1d8d2f]),'UserId':Number(_0x84cd96['id'])});}});}})[_0x62ba('0xd')](function(){if(_0x447ae4===_0x62ba('0x4c')){var _0x13339a=_['map'](_0x84cd96[_0x62ba('0x28')],'id');return _0x84cd96[_0x62ba('0x4e')](_0x13339a)[_0x62ba('0xd')](function(){for(var _0x286ef2=0x0;_0x286ef2<_0x13339a[_0x62ba('0x20')];_0x286ef2+=0x1){_0x204679[_0x62ba('0x4a')](_0x62ba('0x4f'),{'FaxInteractionId':Number(_0x13339a[_0x286ef2]),'UserId':Number(_0x84cd96['id'])});}});}})['then'](function(){if(_0x447ae4===_0x62ba('0x4c')){var _0x499e85=_[_0x62ba('0x19')](_0x84cd96[_0x62ba('0x50')],'id');return _0x84cd96['removeSmsInteractions'](_0x499e85)['then'](function(){for(var _0x401944=0x0;_0x401944<_0x499e85['length'];_0x401944+=0x1){_0x204679[_0x62ba('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x499e85[_0x401944]),'UserId':Number(_0x84cd96['id'])});}});}})[_0x62ba('0xd')](function(){if(_0x447ae4===_0x62ba('0x4c')){var _0x168cd4=_[_0x62ba('0x19')](_0x84cd96[_0x62ba('0x2b')],'id');return _0x84cd96[_0x62ba('0x51')](_0x168cd4)[_0x62ba('0xd')](function(){for(var _0x1d90de=0x0;_0x1d90de<_0x168cd4[_0x62ba('0x20')];_0x1d90de+=0x1){_0x204679[_0x62ba('0x4a')](_0x62ba('0x52'),{'OpenchannelInteractionId':Number(_0x168cd4[_0x1d90de]),'UserId':Number(_0x84cd96['id'])});}});}})['then'](function(){if(_0x447ae4===_0x62ba('0x4c')){var _0x19eb49=_[_0x62ba('0x19')](_0x84cd96[_0x62ba('0x53')],'id');return _0x84cd96[_0x62ba('0x54')](_0x19eb49)[_0x62ba('0xd')](function(){for(var _0x23b2c2=0x0;_0x23b2c2<_0x19eb49[_0x62ba('0x20')];_0x23b2c2+=0x1){_0x204679[_0x62ba('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x19eb49[_0x23b2c2]),'UserId':Number(_0x84cd96['id'])});}});}})[_0x62ba('0x55')](function(_0x14bd87){_0x1bf810[_0x62ba('0x56')](_0x14bd87);});}}function onDisconnect(_0xe57e77,_0xa59034){joinOrLeave(_0xe57e77,_0x62ba('0x4c'),_0xa59034);}function onConnect(_0x40c31d){joinOrLeave(_0x40c31d,_0x62ba('0x57'));}exports[_0x62ba('0x58')]=function(_0x27a945){_0x27a945['on'](_0x62ba('0x59'),function(_0x2b2aee){_0x2b2aee[_0x62ba('0x5a')](0x0);_0x2b2aee[_0x62ba('0x5b')]=_0x2b2aee[_0x62ba('0x5c')]['connection'][_0x62ba('0x5d')]+':'+_0x2b2aee[_0x62ba('0x5c')][_0x62ba('0x59')][_0x62ba('0x5e')];_0x2b2aee[_0x62ba('0x5f')]=new Date();_0x2b2aee[_0x62ba('0x56')]=function(_0x7457e0){console[_0x62ba('0x56')](_0x62ba('0x60')+_0x2b2aee[_0x62ba('0x61')][_0x62ba('0x7')]+'['+_0x2b2aee['address']+']',_0x7457e0);};_0x2b2aee['on'](_0x62ba('0x62'),function(){onDisconnect(_0x2b2aee,_0x27a945);_0x2b2aee[_0x62ba('0x56')](_0x62ba('0x63'));});onConnect(_0x2b2aee);_0x2b2aee[_0x62ba('0x56')](_0x62ba('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 829248c..4cf16ba 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 _0xa55c=['UserId','find','name','fullname','email','format','SIP/%s','incomingmessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','changed','closed','substatus','internal','interface','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','newinteraction','Chat','afterUpdate','afterCreate','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','closedinteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','newmessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','ContactId','sequelize','query','QueryTypes','SELECT','contact'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xa55c,0xed));var _0xca55=function(_0x5b56ea,_0x20e691){_0x5b56ea=_0x5b56ea-0x0;var _0x14ae0b=_0xa55c[_0x5b56ea];return _0x14ae0b;};'use strict';var util=require('util');var db=require(_0xca55('0x0'))['db'];var jayson=require(_0xca55('0x1'));var logger=require(_0xca55('0x2'))(_0xca55('0x3'));var client=jayson[_0xca55('0x4')][_0xca55('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xca55('0x6'),'event':'afterCreate','condition':_0xca55('0x7'),'callback':afterCreate},{'channel':_0xca55('0x8'),'model':_0xca55('0x6'),'event':_0xca55('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca55('0x8'),'model':'ChatMessage','event':_0xca55('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca55('0xb'),'model':'SmsInteraction','event':'afterCreate','condition':_0xca55('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0xca55('0xc'),'event':_0xca55('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca55('0xb'),'model':_0xca55('0xd'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca55('0xe'),'model':'WhatsappInteraction','event':'afterCreate','condition':_0xca55('0x7'),'callback':afterCreate},{'channel':_0xca55('0xe'),'model':_0xca55('0xf'),'event':_0xca55('0x9'),'condition':_0xca55('0x10'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xca55('0x11'),'event':_0xca55('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca55('0x12'),'model':_0xca55('0x13'),'event':'afterCreate','condition':_0xca55('0x7'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0xca55('0x9'),'condition':_0xca55('0x10'),'callback':afterUpdate},{'channel':'Fax','model':_0xca55('0x14'),'event':_0xca55('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca55('0x15'),'model':_0xca55('0x16'),'event':_0xca55('0xa'),'condition':_0xca55('0x7'),'callback':afterCreate},{'channel':_0xca55('0x15'),'model':_0xca55('0x16'),'event':_0xca55('0x9'),'condition':_0xca55('0x10'),'callback':afterUpdate},{'channel':'Mail','model':_0xca55('0x17'),'event':_0xca55('0xa'),'condition':_0xca55('0x18'),'callback':afterCreateMessage},{'channel':_0xca55('0x19'),'model':_0xca55('0x1a'),'event':'afterCreate','condition':_0xca55('0x7'),'callback':afterCreate},{'channel':_0xca55('0x19'),'model':_0xca55('0x1a'),'event':_0xca55('0x9'),'condition':_0xca55('0x10'),'callback':afterUpdate},{'channel':_0xca55('0x19'),'model':_0xca55('0x1b'),'event':_0xca55('0xa'),'condition':_0xca55('0x18'),'callback':afterCreateMessage}];function request(_0x42899b){return client[_0xca55('0x1c')](_0xca55('0x1d'),_0x42899b)[_0xca55('0x1e')](function(_0x358375){logger[_0xca55('0x1f')](_0xca55('0x20'),_0xca55('0x1d'),_0x358375);if(_0x358375[_0xca55('0x21')]){if(_0x358375[_0xca55('0x21')][_0xca55('0x22')]===0x1f4){logger[_0xca55('0x21')]('Trigger,\x20%s',_0xca55('0x1d'),_0x358375[_0xca55('0x21')]);}}})[_0xca55('0x23')](function(_0x3297d2){logger[_0xca55('0x21')](_0xca55('0x20'),_0xca55('0x1d'),_0x3297d2);});}function afterCreateMessage(_0x1155d0){return function(_0x4a8968){_0x4a8968=_0x4a8968[_0xca55('0x24')]({'plain':!![]});_0x4a8968[_0xca55('0x25')]=_0x1155d0;_0x4a8968[_0xca55('0x26')]=_0x1155d0;_0x4a8968[_0xca55('0x27')]=_0x4a8968[_0xca55('0x28')];Promise['resolve']()['then'](function(){if(typeof _0x4a8968[_0xca55('0x29')]==='undefined')return null;var _0x17338a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a8968[_0xca55('0x29')];return db[_0xca55('0x2a')][_0xca55('0x2b')](_0x17338a,{'type':db['Sequelize'][_0xca55('0x2c')][_0xca55('0x2d')],'raw':!![]});})[_0xca55('0x1e')](function(_0x5a0471){if(_0x5a0471){_0x4a8968[_0xca55('0x2e')]=_0x5a0471[0x0];}if(_0x4a8968[_0xca55('0x2f')]){return db['User'][_0xca55('0x30')]({'where':{'id':_0x4a8968['UserId']},'attributes':['id',_0xca55('0x31'),_0xca55('0x32'),_0xca55('0x33'),'internal'],'raw':!![]})['then'](function(_0x30c142){_0x4a8968['interface']=util[_0xca55('0x34')](_0xca55('0x35'),_0x30c142['name']);_0x4a8968[_0xca55('0x25')]=_0x1155d0;_0x4a8968['agent']=_0x30c142;return request({'event':_0xca55('0x36'),'message':_0x4a8968});})[_0xca55('0x23')](function(_0x2bf729){logger['error'](_0xca55('0x20'),'AfterCreateMessage',_0x2bf729);});}else{return request({'event':_0xca55('0x37'),'message':_0x4a8968});}});};}function afterCreate(_0x3a7a94,_0x542f71){return function(_0x5917f5){_0x5917f5=_0x5917f5[_0xca55('0x24')]({'plain':!![]});_0x5917f5[_0xca55('0x25')]=_0x3a7a94;_0x5917f5[_0xca55('0x26')]=_0x3a7a94;_0x5917f5['event']=_0xca55('0x38');var _0xe63492=_0xca55('0x39')+_0x5917f5[_0xca55('0x29')];return db['sequelize'][_0xca55('0x2b')](_0xe63492,{'type':db[_0xca55('0x3a')][_0xca55('0x2c')][_0xca55('0x2d')],'raw':!![]})[_0xca55('0x1e')](function(_0x3373fc){return _0x3373fc;})[_0xca55('0x1e')](function(_0x5e4429){if(_0x5e4429){_0x5917f5[_0xca55('0x2e')]=_0x5e4429[0x0];}return request({'event':_0x542f71,'message':_0x5917f5});});};}function afterUpdate(_0x1443ef){return function(_0x2cee90){var _0x502719=_0x2cee90[_0xca55('0x3b')](_0xca55('0x3c'))&&_0x2cee90[_0xca55('0x3c')];var _0xcf55e2=_0x2cee90['changed'](_0xca55('0x3d'));if(_0x502719||_0xcf55e2){var _0x3b1e1c=_0x502719?'closedinteraction':_0xca55('0x3d');var _0x10d32a=_0x2cee90[_0xca55('0x24')]({'plain':!![]});_0x10d32a[_0xca55('0x25')]=_0x1443ef;_0x10d32a[_0xca55('0x26')]=_0x1443ef;_0x10d32a[_0xca55('0x27')]=_0x502719?_0xca55('0x3c'):_0xca55('0x3d');var _0x494ab3=_0xca55('0x39')+_0x10d32a[_0xca55('0x29')];return db[_0xca55('0x2a')]['query'](_0x494ab3,{'type':db[_0xca55('0x3a')][_0xca55('0x2c')]['SELECT'],'raw':!![]})[_0xca55('0x1e')](function(_0x489c73){if(_0x489c73){_0x10d32a['contact']=_0x489c73[0x0];}if(_0x10d32a['UserId']){return db['User']['find']({'where':{'id':_0x10d32a['UserId']},'attributes':['id',_0xca55('0x31'),_0xca55('0x32'),'email',_0xca55('0x3e')],'raw':!![]})[_0xca55('0x1e')](function(_0x5e4508){_0x10d32a[_0xca55('0x3f')]=util[_0xca55('0x34')]('SIP/%s',_0x5e4508[_0xca55('0x31')]);_0x10d32a['agent']=_0x5e4508;return request({'event':_0x3b1e1c,'message':_0x10d32a});})['catch'](function(_0xd5f7d9){logger[_0xca55('0x21')](_0xca55('0x20'),'AfterUpdate',_0xd5f7d9);});}else{return request({'event':_0x3b1e1c,'message':_0x10d32a});}});}};}exports['default']=function(){for(var _0x3f464a=0x0;_0x3f464a=_0x4dfaff[_0xe5fd('0x14')]){throw Error(_0xe5fd('0x15'));}_0x2e22b7(_0xb05512);})[_0xe5fd('0x16')](function(_0x2fbe1f){_0x595661(_0x2fbe1f);});});}; \ No newline at end of file +var _0x996b=['clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','includes'];(function(_0x5d536e,_0x5bd5ed){var _0x1c8bb6=function(_0x16054b){while(--_0x16054b){_0x5d536e['push'](_0x5d536e['shift']());}};_0x1c8bb6(++_0x5bd5ed);}(_0x996b,0xa5));var _0xb996=function(_0x425d3d,_0x2eabf6){_0x425d3d=_0x425d3d-0x0;var _0x3b3a34=_0x996b[_0x425d3d];return _0x3b3a34;};'use strict';var _=require(_0xb996('0x0'));var BPromise=require(_0xb996('0x1'));var db=require(_0xb996('0x2'))['db'];var util=require('./license/util');var channels=['voice',_0xb996('0x3'),_0xb996('0x4'),_0xb996('0x5'),_0xb996('0x6'),_0xb996('0x7'),'openchannel'];exports[_0xb996('0x8')]=function(){return channels;};exports[_0xb996('0x9')]=function(_0x25aff4){_0x25aff4=_0x25aff4['toLowerCase']();return _[_0xb996('0xa')](channels,_0x25aff4);};exports[_0xb996('0xb')]=function(_0x237c2f,_0xcd917f,_0x366859,_0x130435){var _0xa512cf={'loginAttempts':_0xcd917f,'blocked':_0x366859};if(!_[_0xb996('0xc')](_0x130435)){_0xa512cf[_0xb996('0xd')]=_0x130435;}return _0x237c2f[_0xb996('0xe')](_0xa512cf);};exports[_0xb996('0xf')]=function(_0x1c570b){return new BPromise(function(_0x58c905,_0x2b7e9c){var _0x4f7a91=0x0;if(_0x1c570b[_0xb996('0x10')]!=='agent'){_0x58c905(_0x1c570b);}db[_0xb996('0x11')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1c570b['id']}}})[_0xb996('0x12')](function(_0x4c6766){_0x4f7a91=_0x4c6766;return util['getLicense']();})[_0xb996('0x12')](function(_0x7c4945){if(_0x7c4945&&_0x7c4945[_0xb996('0x13')]&&_0x4f7a91>=_0x7c4945[_0xb996('0x13')]){throw Error(_0xb996('0x14'));}_0x58c905(_0x1c570b);})[_0xb996('0x15')](function(_0x18b104){_0x2b7e9c(_0x18b104);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6d3b98a..bcb1d1a 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7d0=['exports','status','render','json','send'];(function(_0x5d7dd0,_0x4ed7e0){var _0x4d5ea2=function(_0x219b74){while(--_0x219b74){_0x5d7dd0['push'](_0x5d7dd0['shift']());}};_0x4d5ea2(++_0x4ed7e0);}(_0xe7d0,0x78));var _0x0e7d=function(_0x12e0bc,_0x55600e){_0x12e0bc=_0x12e0bc-0x0;var _0xdabd4d=_0xe7d0[_0x12e0bc];return _0xdabd4d;};'use strict';module[_0x0e7d('0x0')][0x194]=function pageNotFound(_0x43e5b4,_0x5a56f3){var _0x1503c3='404';var _0x53c84f=0x194;var _0x28fa9a={'status':_0x53c84f};_0x5a56f3[_0x0e7d('0x1')](_0x28fa9a[_0x0e7d('0x1')]);_0x5a56f3[_0x0e7d('0x2')](_0x1503c3,{},function(_0x4f9a2f,_0x55a421){if(_0x4f9a2f){return _0x5a56f3[_0x0e7d('0x1')](_0x28fa9a['status'])[_0x0e7d('0x3')](_0x28fa9a);}_0x5a56f3[_0x0e7d('0x4')](_0x55a421);});}; \ No newline at end of file +var _0x6df1=['404','status','json','send'];(function(_0x136bad,_0x59aa87){var _0x14df2c=function(_0x2d66a6){while(--_0x2d66a6){_0x136bad['push'](_0x136bad['shift']());}};_0x14df2c(++_0x59aa87);}(_0x6df1,0x1e8));var _0x16df=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0x6df1[_0x4452dc];return _0x52b892;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1e28ca,_0x34f16f){var _0x3a61a6=_0x16df('0x0');var _0x3b4677=0x194;var _0x394247={'status':_0x3b4677};_0x34f16f[_0x16df('0x1')](_0x394247['status']);_0x34f16f['render'](_0x3a61a6,{},function(_0x427bfa,_0x40c7c4){if(_0x427bfa){return _0x34f16f[_0x16df('0x1')](_0x394247['status'])[_0x16df('0x2')](_0x394247);}_0x34f16f[_0x16df('0x3')](_0x40c7c4);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index e916f66..ada5ef7 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','hasMany','Recordings','UserId','UserVoiceQueueRt','VoiceQueuesRt','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','FaxQueues','SmsQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','Applications','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','Trunk','Interval','mandatoryDispositionPause','mandatoryDispositionPauseId','CmList','voice_queues_has_cm_lists','Agents','BlackLists','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Messages','Interactions','MailApplication','ListId','TemplateId','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','TagId','DashboardItem','FaxAccount','Answers','FaxAccountId','FaxMessage','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','team_has_fax_queues','Teams','List','SmsMessage','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','AttachmentId','UserChatQueue','team_has_chat_queues','ChatGroupId','Contacts','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Campaign','CampaignId','OwnerId','OneAll','AutomationAllId','Any','AutomationAnyId','AutomationId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Trigger','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Action','TriggerId','AnalyticFieldReport','Fields','Configurations','AccountId','SubjectId','SalesforceField','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Subjects','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesAccount','FreshsalesField','ChatQueueReport','FromId','SessionId','SmsQueueReport','ProjectId','team_has_mail_queues','ChatQueues','team_has_whatsapp_queues','HopperHistories','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','password','options','database','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration'];(function(_0x1bba47,_0x19499a){var _0x47d3e2=function(_0x313ce7){while(--_0x313ce7){_0x1bba47['push'](_0x1bba47['shift']());}};_0x47d3e2(++_0x19499a);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0xe5b5[_0x3e478c];return _0x29ef89;};'use strict';var config=require(_0x5e5b('0x0'));var Sequelize=require(_0x5e5b('0x1'));var _=require(_0x5e5b('0x2'));var jstz=require(_0x5e5b('0x3'));var timezone=jstz[_0x5e5b('0x4')]();config[_0x5e5b('0x1')]=_[_0x5e5b('0x5')](config[_0x5e5b('0x1')],{'database':_0x5e5b('0x6'),'username':_0x5e5b('0x7'),'password':_0x5e5b('0x8'),'options':{'host':_0x5e5b('0x9'),'port':0xcea,'dialect':_0x5e5b('0xa'),'dialectOptions':{'charset':_0x5e5b('0xb')},'logging':![],'timezone':timezone[_0x5e5b('0xc')](),'define':{'charset':_0x5e5b('0xd'),'collate':_0x5e5b('0xe')}}});config[_0x5e5b('0xf')]=_[_0x5e5b('0x5')](config[_0x5e5b('0xf')],{'database':_0x5e5b('0x6'),'username':_0x5e5b('0x7'),'password':_0x5e5b('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x5e5b('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x5e5b('0xc')](),'define':{'charset':_0x5e5b('0xd'),'collate':_0x5e5b('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5e5b('0x1')]['database'],config['sequelize']['username'],config[_0x5e5b('0x1')][_0x5e5b('0x10')],config[_0x5e5b('0x1')][_0x5e5b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5e5b('0xf')][_0x5e5b('0x12')],config[_0x5e5b('0xf')]['username'],config[_0x5e5b('0xf')][_0x5e5b('0x10')],config['sequelizeHistory'][_0x5e5b('0x11')])};db['User']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x14'));db[_0x5e5b('0x15')]=db['sequelize'][_0x5e5b('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x5e5b('0x16')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x17'));db[_0x5e5b('0x18')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x19'));db[_0x5e5b('0x1a')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x1b'));db[_0x5e5b('0x1c')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x1d'));db[_0x5e5b('0x1e')]=db[_0x5e5b('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x5e5b('0x1f')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x20'));db[_0x5e5b('0x21')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x22'));db[_0x5e5b('0x23')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x5e5b('0x24')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x5e5b('0x25')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x26'));db[_0x5e5b('0x27')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x28'));db[_0x5e5b('0x29')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x2a'));db[_0x5e5b('0x2b')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x2c'));db[_0x5e5b('0x2d')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x2e'));db['UserVoiceQueueRt']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x2f'));db[_0x5e5b('0x30')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x31'));db['UserChatQueue']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x32'));db[_0x5e5b('0x33')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x34'));db[_0x5e5b('0x35')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x36'));db[_0x5e5b('0x37')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x38'));db['UserOpenchannelQueue']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x39'));db[_0x5e5b('0x3a')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x3b'));db[_0x5e5b('0x3c')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x3d'));db[_0x5e5b('0x3e')]=db['sequelize']['import'](_0x5e5b('0x3f'));db[_0x5e5b('0x40')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x41'));db['MailQueue']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x42'));db[_0x5e5b('0x43')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x44'));db[_0x5e5b('0x45')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x5e5b('0x46')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x47'));db['MailApplication']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x48'));db[_0x5e5b('0x49')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x4a'));db[_0x5e5b('0x4b')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x4c'));db['DashboardItem']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x4d'));db['FaxAccount']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/faxAccount/faxAccount.model');db[_0x5e5b('0x4e')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x4f'));db['FaxInteraction']=db['sequelize']['import'](_0x5e5b('0x50'));db['FaxMessage']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x51'));db[_0x5e5b('0x52')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x53'));db[_0x5e5b('0x54')]=db[_0x5e5b('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x5e5b('0x55')]=db['sequelize']['import']('../api/smsAccount/smsAccount.model');db[_0x5e5b('0x56')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x57'));db[_0x5e5b('0x58')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x59'));db['SmsMessage']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/smsMessage/smsMessage.model');db[_0x5e5b('0x5a')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x5b'));db[_0x5e5b('0x5c')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x5d'));db[_0x5e5b('0x5e')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x5f'));db[_0x5e5b('0x60')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x61'));db['OpenchannelMessage']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x5e5b('0x62')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x5e5b('0x63')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x5e5b('0x64')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x5e5b('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0x5e5b('0x65')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x5e5b('0x66')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x67'));db[_0x5e5b('0x68')]=db[_0x5e5b('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x5e5b('0x69')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x6a'));db['ChatGroup']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x6b'));db[_0x5e5b('0x6c')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x6d'));db[_0x5e5b('0x6e')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/cmCompany/cmCompany.model');db[_0x5e5b('0x6f')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x70'));db[_0x5e5b('0x71')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x72'));db[_0x5e5b('0x73')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x5e5b('0x74')]=db['sequelize'][_0x5e5b('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x5e5b('0x75')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x76'));db[_0x5e5b('0x77')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x78'));db[_0x5e5b('0x79')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/action/action.model');db[_0x5e5b('0x7a')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x7b'));db[_0x5e5b('0x7c')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x7d'));db['Disposition']=db['sequelize']['import'](_0x5e5b('0x7e'));db[_0x5e5b('0x7f')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x80'));db['Interval']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/interval/interval.model');db[_0x5e5b('0x81')]=db['sequelize']['import'](_0x5e5b('0x82'));db[_0x5e5b('0x83')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x84'));db[_0x5e5b('0x85')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x86'));db[_0x5e5b('0x87')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x88'));db[_0x5e5b('0x89')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x8a'));db[_0x5e5b('0x8b')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x8c'));db[_0x5e5b('0x8d')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x8e'));db['Trigger']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x8f'));db[_0x5e5b('0x90')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/variable/variable.model');db[_0x5e5b('0x91')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/integration/integration.model');db[_0x5e5b('0x92')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x93'));db[_0x5e5b('0x94')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x95'));db[_0x5e5b('0x96')]=db['sequelize'][_0x5e5b('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x5e5b('0x97')]=db[_0x5e5b('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x5e5b('0x98')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x99'));db['AnalyticFieldReport']=db['sequelize'][_0x5e5b('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x5e5b('0x9a')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x5e5b('0x9b')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x5e5b('0x9c')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0x9d'));db['SalesforceField']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x9e'));db[_0x5e5b('0x9f')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x5e5b('0xa0')]=db[_0x5e5b('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x5e5b('0xa1')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xa2'));db[_0x5e5b('0xa3')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xa4'));db[_0x5e5b('0xa5')]=db[_0x5e5b('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x5e5b('0xa6')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intDeskField/intDeskField.model');db[_0x5e5b('0xa7')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x5e5b('0xa8')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x5e5b('0xa9')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xaa'));db[_0x5e5b('0xab')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xac'));db[_0x5e5b('0xad')]=db['sequelize'][_0x5e5b('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x5e5b('0xae')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xaf'));db[_0x5e5b('0xb0')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xb1'));db[_0x5e5b('0xb2')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xb3'));db['FreshdeskField']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xb4'));db[_0x5e5b('0xb5')]=db['sequelize']['import'](_0x5e5b('0xb6'));db[_0x5e5b('0xb7')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xb8'));db[_0x5e5b('0xb9')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xba'));db[_0x5e5b('0xbb')]=db['sequelize'][_0x5e5b('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize']['import'](_0x5e5b('0xbc'));db[_0x5e5b('0xbd')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xbe'));db['Dynamics365Account']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x5e5b('0xbf')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xc0'));db[_0x5e5b('0xc1')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xc2'));db['FreshsalesAccount']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xc3'));db[_0x5e5b('0xc4')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xc5'));db['FreshsalesField']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xc6'));db[_0x5e5b('0x91')]=db['sequelize']['import'](_0x5e5b('0xc7'));db['Network']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xc8'));db['ChatQueueReport']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xc9'));db[_0x5e5b('0xca')]=db['sequelize'][_0x5e5b('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x5e5b('0xcb')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xcc'));db[_0x5e5b('0xcd')]=db['sequelize'][_0x5e5b('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x5e5b('0xce')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xcf'));db['SmsQueueReport']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xd0'));db['SquareReport']=db['sequelize']['import'](_0x5e5b('0xd1'));db['SquareDetailsReport']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xd2'));db[_0x5e5b('0xd3')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xd4'));db[_0x5e5b('0xd5')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/setting/setting.model');db[_0x5e5b('0xd6')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xd7'));db[_0x5e5b('0xd8')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xd9'));db[_0x5e5b('0xda')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xdb'));db['SquareMessage']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xdc'));db[_0x5e5b('0xdd')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xde'));db[_0x5e5b('0xdf')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xe0'));db['Campaign']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xe1'));db[_0x5e5b('0xe2')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xe3'));db[_0x5e5b('0xe4')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xe5'));db['Plugin']=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xe6'));db[_0x5e5b('0xe7')]=db[_0x5e5b('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xe8'));db[_0x5e5b('0xe9')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xea'));db[_0x5e5b('0xeb')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xec'));db['CmList']=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xed'));db[_0x5e5b('0xee')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xef'));db['UserProfile']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xf0'));db[_0x5e5b('0xf1')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xf2'));db[_0x5e5b('0xf3')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xf4'));db['UserNotification']=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xf5'));db[_0x5e5b('0xf6')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0xf7'));db[_0x5e5b('0xf8')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xf9'));db[_0x5e5b('0xfa')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0xfb'));db[_0x5e5b('0xfc')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x5e5b('0xfd')]=db[_0x5e5b('0x1')]['import'](_0x5e5b('0xfe'));db[_0x5e5b('0xff')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x100'));db[_0x5e5b('0x101')]=db['sequelize'][_0x5e5b('0x13')](_0x5e5b('0x102'));db[_0x5e5b('0x103')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x104'));db[_0x5e5b('0x105')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x106'));db[_0x5e5b('0x107')]=db['sequelize'][_0x5e5b('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x5e5b('0x108')]=db[_0x5e5b('0x1')][_0x5e5b('0x13')](_0x5e5b('0x109'));db[_0x5e5b('0x10a')][_0x5e5b('0x10b')](db[_0x5e5b('0x21')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db['VoiceRecording'],{'as':_0x5e5b('0x10d'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x10f')],{'as':_0x5e5b('0x110'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x18')],{'as':'Extensions','onDelete':_0x5e5b('0x111'),'hooks':!![]});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x74')],{'as':_0x5e5b('0x112'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x75')],{'as':_0x5e5b('0x113'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')]['hasMany'](db[_0x5e5b('0x77')],{'as':_0x5e5b('0x77'),'foreignKey':_0x5e5b('0x10e')});db['User'][_0x5e5b('0x10c')](db['OpenchannelInteraction'],{'as':_0x5e5b('0x114'),'foreignKey':_0x5e5b('0x10e')});db['User'][_0x5e5b('0x10c')](db[_0x5e5b('0x65')],{'as':_0x5e5b('0x115'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x58')],{'as':'SmsInteractions','foreignKey':_0x5e5b('0x10e')});db['User'][_0x5e5b('0x10c')](db[_0x5e5b('0x116')],{'as':_0x5e5b('0x117'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')][_0x5e5b('0x10c')](db[_0x5e5b('0x45')],{'as':_0x5e5b('0x118'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x10a')]['hasMany'](db[_0x5e5b('0xfa')],{'as':_0x5e5b('0x119'),'foreignKey':_0x5e5b('0x10e')});db['User'][_0x5e5b('0x10c')](db[_0x5e5b('0x11a')],{'as':_0x5e5b('0x11b'),'foreignKey':_0x5e5b('0x11c')});db[_0x5e5b('0x10a')][_0x5e5b('0x11d')](db['UserProfile'],{'as':_0x5e5b('0x11e'),'foreignKey':_0x5e5b('0x11f')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0x121')],{'as':_0x5e5b('0x122'),'through':_0x5e5b('0x123')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db['CmList'],{'as':_0x5e5b('0x124'),'through':'cm_user_has_lists'});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0xdd')],{'through':_0x5e5b('0x125')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db['MailInteraction'],{'as':_0x5e5b('0x118'),'through':_0x5e5b('0x126')});db['User']['belongsToMany'](db[_0x5e5b('0x65')],{'as':_0x5e5b('0x115'),'through':_0x5e5b('0x127')});db['User']['belongsToMany'](db['FaxInteraction'],{'as':_0x5e5b('0x117'),'through':_0x5e5b('0x128')});db[_0x5e5b('0x10a')]['belongsToMany'](db[_0x5e5b('0x58')],{'as':_0x5e5b('0x129'),'through':_0x5e5b('0x12a')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0x60')],{'as':'OpenchannelInteractions','through':_0x5e5b('0x12b')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0xfa')],{'as':_0x5e5b('0x119'),'through':_0x5e5b('0x12c')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0x1c')],{'as':_0x5e5b('0x12d'),'through':'UserVoiceQueue','required':![]});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0xee')],{'as':_0x5e5b('0x12e'),'through':'UserVoicePrefix','required':![]});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0x12f')],{'as':_0x5e5b('0x130'),'through':_0x5e5b('0x33'),'required':![]});db['User'][_0x5e5b('0x120')](db[_0x5e5b('0x69')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x5e5b('0x120')](db['FaxQueue'],{'as':_0x5e5b('0x131'),'through':_0x5e5b('0x35'),'required':![]});db[_0x5e5b('0x10a')]['belongsToMany'](db['SmsQueue'],{'as':_0x5e5b('0x132'),'through':_0x5e5b('0x37'),'required':![]});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0x62')],{'as':'OpenchannelQueues','through':_0x5e5b('0x133'),'required':![]});db[_0x5e5b('0x10a')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x5e5b('0x134'),'through':'UserWhatsappQueue','required':![]});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db['CmList'],{'through':_0x5e5b('0x135')});db['User']['belongsToMany'](db[_0x5e5b('0x63')],{'as':'ChatWebsites','through':_0x5e5b('0x136')});db[_0x5e5b('0x10a')]['belongsToMany'](db['FaxAccount'],{'as':_0x5e5b('0x137'),'through':'user_has_fax_accounts'});db[_0x5e5b('0x10a')]['belongsToMany'](db[_0x5e5b('0x40')],{'as':_0x5e5b('0x138'),'through':_0x5e5b('0x139')});db[_0x5e5b('0x10a')]['belongsToMany'](db[_0x5e5b('0x5c')],{'as':'OpenchannelAccounts','through':_0x5e5b('0x13a')});db['User'][_0x5e5b('0x120')](db[_0x5e5b('0x55')],{'as':'SmsAccounts','through':_0x5e5b('0x13b')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0xf6')],{'as':_0x5e5b('0x13c'),'through':_0x5e5b('0x13d')});db[_0x5e5b('0x10a')][_0x5e5b('0x120')](db[_0x5e5b('0xd8')],{'as':'SquareProjects','through':_0x5e5b('0x13e')});db[_0x5e5b('0x15')]['hasMany'](db[_0x5e5b('0x18')],{'as':'SpiedAgents','onDelete':_0x5e5b('0x111'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x5e5b('0x10c')](db['VoiceExtension'],{'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x18')]['hasMany'](db[_0x5e5b('0x18')],{'as':_0x5e5b('0x13f'),'onDelete':_0x5e5b('0x111')});db['VoiceMusicOnHold'][_0x5e5b('0x120')](db[_0x5e5b('0x89')],{'as':'Sounds','through':_0x5e5b('0x140')});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db[_0x5e5b('0x10f')],{'as':_0x5e5b('0x141'),'foreignKey':_0x5e5b('0x142')});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db[_0x5e5b('0x71')],{'as':_0x5e5b('0x143'),'foreignKey':'VoiceQueueId'});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db['CmHopperFinal'],{'as':_0x5e5b('0x112'),'foreignKey':_0x5e5b('0x142')});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db[_0x5e5b('0x75')],{'as':'HopperHistories','foreignKey':_0x5e5b('0x142')});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db['ReportAgentPreview'],{'as':_0x5e5b('0x77'),'foreignKey':'VoiceQueueId'});db[_0x5e5b('0x1c')][_0x5e5b('0x10c')](db['CmHopperBlack'],{'as':_0x5e5b('0x144'),'foreignKey':_0x5e5b('0x142')});db[_0x5e5b('0x1c')]['hasMany'](db['JscriptySessionReport'],{'as':_0x5e5b('0x145'),'foreignKey':_0x5e5b('0x142')});db[_0x5e5b('0x1c')][_0x5e5b('0x11d')](db['Trunk'],{'as':_0x5e5b('0x146'),'foreignKey':'TrunkId'});db[_0x5e5b('0x1c')]['belongsTo'](db[_0x5e5b('0x146')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x5e5b('0x1c')][_0x5e5b('0x11d')](db['Interval'],{'as':_0x5e5b('0x147'),'foreignKey':'IntervalId'});db[_0x5e5b('0x1c')][_0x5e5b('0x11d')](db['Pause'],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db['VoiceQueue']['belongsToMany'](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x124'),'through':_0x5e5b('0x14b')});db[_0x5e5b('0x1c')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x30')});db['VoiceQueue'][_0x5e5b('0x120')](db['Team'],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x5e5b('0x1c')][_0x5e5b('0x120')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x14d'),'through':'voice_queues_has_cm_blacklists'});db[_0x5e5b('0x1e')]['belongsTo'](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x10a'),'foreignKey':'UserId'});db[_0x5e5b('0x1f')][_0x5e5b('0x11d')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x5e5b('0x21')][_0x5e5b('0x10c')](db[_0x5e5b('0x23')],{'as':'Messages','onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x14e'),'sourceKey':_0x5e5b('0x14f')});db[_0x5e5b('0x23')][_0x5e5b('0x11d')](db['VoiceMail'],{'foreignKey':_0x5e5b('0x14e'),'targetKey':_0x5e5b('0x14f')});db[_0x5e5b('0x24')][_0x5e5b('0x10c')](db[_0x5e5b('0x29')],{'as':_0x5e5b('0x150'),'foreignKey':_0x5e5b('0x151'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x5e5b('0x27')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x5e5b('0x24')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':'User','foreignKey':_0x5e5b('0x10e')});db['VoiceCallReport']['belongsTo'](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x3c')]['belongsTo'](db[_0x5e5b('0x40')],{'as':_0x5e5b('0x40'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x5e5b('0x11d')](db[_0x5e5b('0x40')],{'as':_0x5e5b('0x40'),'foreignKey':_0x5e5b('0x154')});db[_0x5e5b('0x40')][_0x5e5b('0x10b')](db['MailServerIn'],{'as':_0x5e5b('0x155'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x40')][_0x5e5b('0x10b')](db[_0x5e5b('0x3e')],{'as':_0x5e5b('0x156'),'onDelete':'cascade'});db['MailAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':_0x5e5b('0x158'),'foreignKey':'MailAccountId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x40')][_0x5e5b('0x10c')](db[_0x5e5b('0x7c')],{'as':'Answers','foreignKey':_0x5e5b('0x154')});db['MailAccount']['hasMany'](db[_0x5e5b('0x46')],{'as':_0x5e5b('0x159'),'foreignKey':_0x5e5b('0x154')});db['MailAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x45')],{'as':_0x5e5b('0x15a')});db[_0x5e5b('0x40')][_0x5e5b('0x10c')](db[_0x5e5b('0x15b')],{'as':_0x5e5b('0x13f')});db[_0x5e5b('0x40')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':_0x5e5b('0x15c')});db['MailAccount'][_0x5e5b('0x11d')](db['Template'],{'as':_0x5e5b('0x8d'),'foreignKey':_0x5e5b('0x15d')});db[_0x5e5b('0x40')][_0x5e5b('0x11d')](db['Pause'],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db[_0x5e5b('0x40')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x139')});db[_0x5e5b('0x12f')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x33')});db[_0x5e5b('0x12f')]['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':'Teams'});db['MailInteraction']['hasMany'](db[_0x5e5b('0x46')],{'as':_0x5e5b('0x159'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x15e')});db[_0x5e5b('0x45')][_0x5e5b('0x11d')](db[_0x5e5b('0x40')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x154')});db['MailInteraction'][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':'ContactId'});db[_0x5e5b('0x45')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x160'),'foreignKey':'UserId'});db[_0x5e5b('0x45')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':'mail_interaction_has_tags','as':_0x5e5b('0x161')});db[_0x5e5b('0x45')][_0x5e5b('0x120')](db['Tag'],{'through':_0x5e5b('0x162'),'as':'ThroughTags'});db[_0x5e5b('0x45')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0x5e5b('0x15e')});db[_0x5e5b('0x46')][_0x5e5b('0x10c')](db[_0x5e5b('0xe4')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x10a')});db[_0x5e5b('0x46')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'onDelete':'cascade','as':_0x5e5b('0x152')});db[_0x5e5b('0x46')][_0x5e5b('0x11d')](db[_0x5e5b('0x45')],{'as':'Interaction','foreignKey':_0x5e5b('0x15e')});db[_0x5e5b('0x46')][_0x5e5b('0x11d')](db['MailAccount'],{'as':_0x5e5b('0x15f'),'foreignKey':'MailAccountId'});db[_0x5e5b('0x46')][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'as':_0x5e5b('0x63'),'foreignKey':_0x5e5b('0x163')});db[_0x5e5b('0x46')][_0x5e5b('0x11d')](db[_0x5e5b('0x68')],{'as':_0x5e5b('0x68'),'foreignKey':_0x5e5b('0x164')});db[_0x5e5b('0x15b')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':'restrict'});db['MailApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x12f')],{'onDelete':_0x5e5b('0x165')});db['MailApplication']['belongsTo'](db[_0x5e5b('0x40')],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x15b')][_0x5e5b('0x11d')](db[_0x5e5b('0x147')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x15b')][_0x5e5b('0x11d')](db[_0x5e5b('0x8b')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x167')});db['MailQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x40')],{});db['MailQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x49')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x49')]['belongsTo'](db[_0x5e5b('0x45')],{});db[_0x5e5b('0x49')][_0x5e5b('0x11d')](db[_0x5e5b('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0x5e5b('0x10a')],{});db[_0x5e5b('0x49')][_0x5e5b('0x11d')](db[_0x5e5b('0x12f')],{});db[_0x5e5b('0x4b')][_0x5e5b('0x10c')](db[_0x5e5b('0x168')],{'as':'Items','onDelete':_0x5e5b('0x111')});db['FaxAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':_0x5e5b('0x158'),'foreignKey':'FaxAccountId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x169')]['hasMany'](db['CannedAnswer'],{'as':_0x5e5b('0x16a'),'foreignKey':_0x5e5b('0x16b')});db[_0x5e5b('0x169')][_0x5e5b('0x10c')](db['FaxInteraction'],{'as':_0x5e5b('0x15a')});db[_0x5e5b('0x169')][_0x5e5b('0x10c')](db[_0x5e5b('0x4e')],{'as':_0x5e5b('0x13f')});db[_0x5e5b('0x169')][_0x5e5b('0x10c')](db[_0x5e5b('0x18')],{'as':'Exntensions','onDelete':_0x5e5b('0x111')});db['FaxAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x16c')],{'as':'Messages'});db[_0x5e5b('0x169')][_0x5e5b('0x11d')](db[_0x5e5b('0x146')],{'as':_0x5e5b('0x146')});db[_0x5e5b('0x169')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x169')]['belongsTo'](db[_0x5e5b('0x81')],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db[_0x5e5b('0x169')][_0x5e5b('0x120')](db['User'],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x16d')});db[_0x5e5b('0x4e')]['belongsTo'](db['User'],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x4e')][_0x5e5b('0x11d')](db[_0x5e5b('0x52')],{'onDelete':'restrict'});db['FaxApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x169')],{'onDelete':_0x5e5b('0x165')});db['FaxApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x8b')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x167')});db[_0x5e5b('0x116')][_0x5e5b('0x10c')](db['FaxMessage'],{'as':_0x5e5b('0x159'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x16e')});db[_0x5e5b('0x116')][_0x5e5b('0x11d')](db['FaxAccount'],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x16b')});db[_0x5e5b('0x116')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x116')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x160'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x116')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':'fax_interaction_has_tags','as':_0x5e5b('0x161')});db[_0x5e5b('0x116')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x16f'),'as':_0x5e5b('0x170')});db[_0x5e5b('0x116')][_0x5e5b('0x120')](db['User'],{'as':_0x5e5b('0x171'),'through':_0x5e5b('0x128'),'foreignKey':'FaxInteractionId'});db[_0x5e5b('0x16c')]['belongsTo'](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x10a')});db[_0x5e5b('0x16c')]['belongsTo'](db[_0x5e5b('0x116')],{'as':'Interaction','foreignKey':_0x5e5b('0x16e')});db['FaxMessage']['belongsTo'](db[_0x5e5b('0x6f')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152')});db[_0x5e5b('0x16c')][_0x5e5b('0x11d')](db[_0x5e5b('0xe4')],{'as':_0x5e5b('0xe4'),'foreignKey':'AttachmentId'});db[_0x5e5b('0x16c')][_0x5e5b('0x11d')](db[_0x5e5b('0x169')],{'as':_0x5e5b('0x15f'),'foreignKey':'FaxAccountId'});db[_0x5e5b('0x52')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x35')});db[_0x5e5b('0x52')]['belongsToMany'](db['Team'],{'through':_0x5e5b('0x172'),'as':_0x5e5b('0x173')});db['FaxQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x169')],{});db[_0x5e5b('0x54')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x54')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x54')][_0x5e5b('0x11d')](db[_0x5e5b('0x116')],{});db[_0x5e5b('0x54')][_0x5e5b('0x11d')](db['FaxMessage'],{});db['FaxQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{});db['FaxQueueReport']['belongsTo'](db['FaxQueue'],{});db[_0x5e5b('0x55')][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x55')][_0x5e5b('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x5e5b('0x55')][_0x5e5b('0x10c')](db[_0x5e5b('0x175')],{'as':'Messages','foreignKey':_0x5e5b('0x176')});db[_0x5e5b('0x55')]['hasMany'](db[_0x5e5b('0x58')],{'as':_0x5e5b('0x15a')});db['SmsAccount']['hasMany'](db[_0x5e5b('0x56')],{'as':'Applications'});db[_0x5e5b('0x55')]['belongsTo'](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db['SmsAccount']['belongsTo'](db[_0x5e5b('0x81')],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db['SmsAccount'][_0x5e5b('0x120')](db['User'],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x13b')});db[_0x5e5b('0x56')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x56')][_0x5e5b('0x11d')](db[_0x5e5b('0x5a')],{'onDelete':_0x5e5b('0x165')});db['SmsApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x55')],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x56')]['belongsTo'](db[_0x5e5b('0x147')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x166')});db['SmsApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x8b')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x167')});db['SmsInteraction']['hasMany'](db[_0x5e5b('0x175')],{'as':_0x5e5b('0x159'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x177')});db['SmsInteraction'][_0x5e5b('0x11d')](db[_0x5e5b('0x55')],{'as':_0x5e5b('0x15f'),'foreignKey':'SmsAccountId'});db[_0x5e5b('0x58')]['belongsTo'](db['CmContact'],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x58')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':'Owner','foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x58')]['belongsToMany'](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x178'),'as':'Tags'});db[_0x5e5b('0x58')][_0x5e5b('0x120')](db['Tag'],{'through':_0x5e5b('0x178'),'as':_0x5e5b('0x170')});db[_0x5e5b('0x58')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':'Users','through':_0x5e5b('0x12a'),'foreignKey':_0x5e5b('0x177')});db[_0x5e5b('0x175')]['belongsTo'](db['User'],{'as':_0x5e5b('0x10a')});db[_0x5e5b('0x175')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152')});db[_0x5e5b('0x175')][_0x5e5b('0x11d')](db[_0x5e5b('0x58')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x179'),'foreignKey':'SmsInteractionId'});db[_0x5e5b('0x175')][_0x5e5b('0x11d')](db[_0x5e5b('0x55')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x176')});db['SmsQueue'][_0x5e5b('0x120')](db['User'],{'as':'Agents','through':_0x5e5b('0x37'),'foreignKey':_0x5e5b('0x17a')});db[_0x5e5b('0x5a')]['belongsToMany'](db[_0x5e5b('0xdd')],{'through':_0x5e5b('0x17b'),'as':_0x5e5b('0x173')});db[_0x5e5b('0x5c')][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':'Dispositions','foreignKey':_0x5e5b('0x17c'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x5c')]['hasMany'](db[_0x5e5b('0x7c')],{'as':_0x5e5b('0x16a'),'foreignKey':_0x5e5b('0x17c')});db['OpenchannelAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x60')],{'as':_0x5e5b('0x15a'),'foreignKey':_0x5e5b('0x17c')});db['OpenchannelAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x17d')],{'as':_0x5e5b('0x159'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x5e5b('0x10c')](db['OpenchannelApplication'],{'as':_0x5e5b('0x13f'),'foreignKey':_0x5e5b('0x17c')});db[_0x5e5b('0x5c')]['belongsTo'](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x5c')][_0x5e5b('0x11d')](db[_0x5e5b('0x81')],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db[_0x5e5b('0x5c')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x13a')});db[_0x5e5b('0x5e')]['belongsTo'](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x5e')][_0x5e5b('0x11d')](db[_0x5e5b('0x62')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x17e')});db[_0x5e5b('0x5e')][_0x5e5b('0x11d')](db[_0x5e5b('0x5c')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x17c')});db[_0x5e5b('0x5e')]['belongsTo'](db['Interval'],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x5e')]['belongsTo'](db[_0x5e5b('0x8b')],{'onDelete':'restrict','foreignKey':_0x5e5b('0x167')});db[_0x5e5b('0x60')]['hasMany'](db[_0x5e5b('0x17d')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x5e5b('0x60')][_0x5e5b('0x11d')](db[_0x5e5b('0x5c')],{'as':_0x5e5b('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0x5e5b('0x60')]['belongsTo'](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x60')][_0x5e5b('0x11d')](db['User'],{'as':_0x5e5b('0x160'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0x60')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x17f'),'as':'Tags'});db[_0x5e5b('0x60')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x17f'),'as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x171'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x5e5b('0x17d')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x111'),'as':'User'});db[_0x5e5b('0x17d')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152')});db[_0x5e5b('0x17d')][_0x5e5b('0x11d')](db['OpenchannelInteraction'],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x179'),'foreignKey':_0x5e5b('0x180')});db[_0x5e5b('0x17d')][_0x5e5b('0x11d')](db[_0x5e5b('0xe4')],{'as':_0x5e5b('0xe4'),'foreignKey':'AttachmentId'});db[_0x5e5b('0x17d')][_0x5e5b('0x11d')](db[_0x5e5b('0x5c')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x17c')});db[_0x5e5b('0x62')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x133'),'foreignKey':_0x5e5b('0x17e')});db[_0x5e5b('0x62')]['belongsToMany'](db[_0x5e5b('0xdd')],{'through':_0x5e5b('0x181'),'as':_0x5e5b('0x173')});db[_0x5e5b('0x63')][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':_0x5e5b('0x158'),'foreignKey':_0x5e5b('0x163'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x63')]['hasMany'](db[_0x5e5b('0x7c')],{'as':'Answers','foreignKey':_0x5e5b('0x163')});db['ChatWebsite']['hasMany'](db[_0x5e5b('0x6c')],{'as':_0x5e5b('0x182')});db[_0x5e5b('0x63')][_0x5e5b('0x10c')](db[_0x5e5b('0x65')],{'as':'Interactions'});db['ChatWebsite'][_0x5e5b('0x10c')](db[_0x5e5b('0x183')],{'as':'Applications'});db[_0x5e5b('0x63')][_0x5e5b('0x10c')](db[_0x5e5b('0x66')],{'as':_0x5e5b('0x159')});db['ChatWebsite'][_0x5e5b('0x11d')](db['CmList'],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x63')][_0x5e5b('0x11d')](db[_0x5e5b('0x147')],{'as':'Interval','foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x63')][_0x5e5b('0x11d')](db['MailAccount'],{'as':_0x5e5b('0x40'),'foreignKey':_0x5e5b('0x154')});db['ChatWebsite'][_0x5e5b('0x11d')](db['Pause'],{'as':_0x5e5b('0x148'),'foreignKey':_0x5e5b('0x149')});db[_0x5e5b('0x63')]['belongsToMany'](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':'user_has_chat_websites'});db[_0x5e5b('0x64')][_0x5e5b('0x11d')](db['OpenchannelAccount'],{});db[_0x5e5b('0x64')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':'ListId'});db[_0x5e5b('0x64')][_0x5e5b('0x11d')](db['CmContact'],{'as':_0x5e5b('0x152'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x60')],{});db[_0x5e5b('0x64')][_0x5e5b('0x11d')](db[_0x5e5b('0x17d')],{});db[_0x5e5b('0x64')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{});db[_0x5e5b('0x64')]['belongsTo'](db['OpenchannelQueue'],{});db['ChatApplication'][_0x5e5b('0x11d')](db['User'],{'as':_0x5e5b('0x184'),'foreignKey':_0x5e5b('0x10e'),'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x183')][_0x5e5b('0x11d')](db[_0x5e5b('0x69')],{'as':_0x5e5b('0x185'),'foreignKey':_0x5e5b('0x186'),'onDelete':_0x5e5b('0x165')});db['ChatApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'as':_0x5e5b('0x187'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x5e5b('0x183')][_0x5e5b('0x11d')](db[_0x5e5b('0x8b')],{'onDelete':_0x5e5b('0x165'),'foreignKey':_0x5e5b('0x167')});db['ChatInteraction'][_0x5e5b('0x10c')](db[_0x5e5b('0x66')],{'as':_0x5e5b('0x159'),'onDelete':'cascade','foreignKey':_0x5e5b('0x188')});db[_0x5e5b('0x65')][_0x5e5b('0x11d')](db['ChatWebsite'],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x163')});db['ChatInteraction']['belongsTo'](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db['ChatInteraction'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':'Owner','foreignKey':'UserId'});db[_0x5e5b('0x65')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x189'),'as':_0x5e5b('0x161')});db['ChatInteraction'][_0x5e5b('0x120')](db['Tag'],{'through':_0x5e5b('0x189'),'as':'ThroughTags'});db[_0x5e5b('0x65')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x171'),'through':_0x5e5b('0x127'),'foreignKey':_0x5e5b('0x188')});db['ChatMessage'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x10a')});db[_0x5e5b('0x66')][_0x5e5b('0x11d')](db['CmContact'],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x66')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0x5e5b('0x179'),'foreignKey':'ChatInteractionId'});db[_0x5e5b('0x66')][_0x5e5b('0x11d')](db[_0x5e5b('0xe4')],{'as':'Attachment','foreignKey':_0x5e5b('0x18a')});db['ChatMessage'][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'as':'Account','foreignKey':_0x5e5b('0x163')});db[_0x5e5b('0x68')][_0x5e5b('0x10c')](db[_0x5e5b('0xe4')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x5e5b('0x111'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x5e5b('0x6f')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x68')][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'as':'Account','foreignKey':_0x5e5b('0x163')});db[_0x5e5b('0x69')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x18b'),'hooks':!![]});db[_0x5e5b('0x69')][_0x5e5b('0x120')](db[_0x5e5b('0xdd')],{'through':_0x5e5b('0x18c'),'as':_0x5e5b('0x173')});db[_0x5e5b('0x121')][_0x5e5b('0x10c')](db[_0x5e5b('0xca')],{'as':_0x5e5b('0x159'),'foreignKey':_0x5e5b('0x18d'),'onDelete':_0x5e5b('0x111')});db['ChatGroup'][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':'Members','through':_0x5e5b('0x123')});db[_0x5e5b('0x6c')][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'as':_0x5e5b('0x187'),'foreignKey':_0x5e5b('0x163')});db[_0x5e5b('0x6e')][_0x5e5b('0x10c')](db['CmContact'],{'as':_0x5e5b('0x18e'),'foreignKey':'CompanyId'});db['CmContact'][_0x5e5b('0x10c')](db[_0x5e5b('0x71')],{'as':_0x5e5b('0x143'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db[_0x5e5b('0x74')],{'as':_0x5e5b('0x112'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db[_0x5e5b('0x75')],{'as':'HopperHistories','foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db[_0x5e5b('0x77')],{'as':_0x5e5b('0x77'),'foreignKey':'ContactId'});db[_0x5e5b('0x6f')]['hasMany'](db[_0x5e5b('0xce')],{'as':_0x5e5b('0x145'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db[_0x5e5b('0x60')],{'as':_0x5e5b('0x114'),'foreignKey':_0x5e5b('0x153'),'onDelete':'restrict'});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db['ChatInteraction'],{'as':_0x5e5b('0x115'),'foreignKey':_0x5e5b('0x153'),'onDelete':'restrict'});db['CmContact'][_0x5e5b('0x10c')](db['SmsInteraction'],{'as':_0x5e5b('0x129'),'foreignKey':_0x5e5b('0x153'),'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db[_0x5e5b('0x116')],{'as':'FaxInteractions','foreignKey':_0x5e5b('0x153'),'onDelete':'restrict'});db[_0x5e5b('0x6f')][_0x5e5b('0x10c')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x5e5b('0x6f')][_0x5e5b('0x11d')](db[_0x5e5b('0x6e')],{'as':_0x5e5b('0x18f'),'foreignKey':_0x5e5b('0x190')});db[_0x5e5b('0x6f')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':'ListId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x6f')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x171'),'through':_0x5e5b('0x191')});db[_0x5e5b('0x6f')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'as':'Tags','through':_0x5e5b('0x192')});db['CmContact']['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0x5e5b('0x170')});db['CmHopper']['belongsTo'](db[_0x5e5b('0x6f')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x71')]['belongsTo'](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x184'),'foreignKey':'UserId'});db[_0x5e5b('0x71')][_0x5e5b('0x11d')](db[_0x5e5b('0x1c')],{'as':_0x5e5b('0x185'),'foreignKey':_0x5e5b('0x142'),'onDelete':'cascade'});db['CmHopper'][_0x5e5b('0x11d')](db[_0x5e5b('0x193')],{'as':_0x5e5b('0x193'),'foreignKey':_0x5e5b('0x194'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x71')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x160'),'foreignKey':_0x5e5b('0x195')});db['CmHopperBlack'][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':'ContactId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x73')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':_0x5e5b('0x15c'),'onDelete':'cascade'});db[_0x5e5b('0x73')]['belongsTo'](db[_0x5e5b('0x1c')],{'as':_0x5e5b('0x185'),'foreignKey':_0x5e5b('0x142'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x73')][_0x5e5b('0x11d')](db['Campaign'],{'as':_0x5e5b('0x193'),'foreignKey':_0x5e5b('0x194'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0x7a')][_0x5e5b('0x10c')](db[_0x5e5b('0x7f')],{'as':{'plural':'All','singular':_0x5e5b('0x196')},'foreignKey':_0x5e5b('0x197'),'onDelete':'cascade','hooks':!![]});db[_0x5e5b('0x7a')][_0x5e5b('0x10c')](db[_0x5e5b('0x7f')],{'as':{'plural':_0x5e5b('0x198'),'singular':'OneAny'},'foreignKey':_0x5e5b('0x199'),'onDelete':_0x5e5b('0x111'),'hooks':!![]});db[_0x5e5b('0x7a')][_0x5e5b('0x10c')](db['Action'],{'as':'Actions','foreignKey':_0x5e5b('0x19a'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0x5e5b('0x10c')](db['Disposition'],{'as':_0x5e5b('0x158'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0x5e5b('0x147')][_0x5e5b('0x10c')](db['Interval'],{'as':_0x5e5b('0x19b'),'foreignKey':_0x5e5b('0x166'),'onDelete':_0x5e5b('0x111'),'hooks':!![],'required':![]});db[_0x5e5b('0x147')][_0x5e5b('0x10c')](db[_0x5e5b('0x18')],{'as':_0x5e5b('0x19c'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x5e5b('0x147')][_0x5e5b('0x10c')](db[_0x5e5b('0x15b')],{'as':_0x5e5b('0x19d'),'foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x147')]['hasMany'](db[_0x5e5b('0x183')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x5e5b('0x147')][_0x5e5b('0x10c')](db['FaxApplication'],{'as':_0x5e5b('0x19e'),'foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x147')][_0x5e5b('0x10c')](db[_0x5e5b('0x56')],{'as':_0x5e5b('0x19f'),'foreignKey':_0x5e5b('0x166')});db[_0x5e5b('0x87')][_0x5e5b('0x11d')](db['MailAccount'],{});db[_0x5e5b('0x87')][_0x5e5b('0x11d')](db[_0x5e5b('0x96')],{'foreignKey':_0x5e5b('0x1a0')});db[_0x5e5b('0x87')][_0x5e5b('0x11d')](db[_0x5e5b('0x94')],{'foreignKey':_0x5e5b('0x1a1')});db[_0x5e5b('0x89')]['belongsToMany'](db[_0x5e5b('0x1a')],{'as':'Mohs','through':_0x5e5b('0x140'),'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0x8b')][_0x5e5b('0x120')](db[_0x5e5b('0x6f')],{'through':_0x5e5b('0x192')});db['Tag'][_0x5e5b('0x120')](db[_0x5e5b('0x65')],{'through':_0x5e5b('0x189')});db[_0x5e5b('0x8b')][_0x5e5b('0x120')](db[_0x5e5b('0x45')],{'through':_0x5e5b('0x162')});db[_0x5e5b('0x8b')][_0x5e5b('0x120')](db[_0x5e5b('0x58')],{'through':'sms_interaction_has_tags'});db[_0x5e5b('0x8b')][_0x5e5b('0x120')](db[_0x5e5b('0x116')],{'through':_0x5e5b('0x16f')});db[_0x5e5b('0x8b')][_0x5e5b('0x120')](db[_0x5e5b('0x60')],{'through':'openchannel_interaction_has_tags'});db[_0x5e5b('0x8b')]['belongsToMany'](db[_0x5e5b('0xfa')],{'through':'whatsapp_interaction_has_tags'});db[_0x5e5b('0x1a2')][_0x5e5b('0x10c')](db[_0x5e5b('0x7f')],{'as':{'plural':'AllConditions','singular':_0x5e5b('0x1a3')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x5e5b('0x1a2')]['hasMany'](db[_0x5e5b('0x7f')],{'as':{'plural':_0x5e5b('0x1a4'),'singular':_0x5e5b('0x1a5')},'foreignKey':_0x5e5b('0x1a6'),'onDelete':_0x5e5b('0x111'),'hooks':!![]});db[_0x5e5b('0x1a2')]['hasMany'](db[_0x5e5b('0x1a7')],{'as':'Actions','foreignKey':_0x5e5b('0x1a8'),'onDelete':_0x5e5b('0x111'),'hooks':!![]});db[_0x5e5b('0x94')][_0x5e5b('0x10c')](db[_0x5e5b('0x1a9')],{'as':'Fields','onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x5e5b('0x96')][_0x5e5b('0x10c')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1a0')});db[_0x5e5b('0x98')][_0x5e5b('0x10c')](db[_0x5e5b('0x1a9')],{'as':_0x5e5b('0x1aa'),'onDelete':_0x5e5b('0x111'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x5e5b('0x11d')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x5e5b('0x9b')][_0x5e5b('0x10c')](db['SalesforceConfiguration'],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0x9c')][_0x5e5b('0x10c')](db['SalesforceField'],{'as':'Subjects','onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0x9c')][_0x5e5b('0x10c')](db[_0x5e5b('0x1ae')],{'as':_0x5e5b('0x1af'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0x9c')][_0x5e5b('0x10c')](db[_0x5e5b('0x1ae')],{'as':_0x5e5b('0x1aa'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0x9c')][_0x5e5b('0x11d')](db[_0x5e5b('0x9b')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0x1ae')]['hasMany'](db['SalesforceField'],{'as':_0x5e5b('0x1b2'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0x1ae')]['hasMany'](db['SalesforceField'],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0x1ae')][_0x5e5b('0x10c')](db[_0x5e5b('0x1ae')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0x1ae')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0x9f')]['hasMany'](db[_0x5e5b('0xa0')],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xa0')][_0x5e5b('0x10c')](db[_0x5e5b('0xa1')],{'as':_0x5e5b('0x1b6'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xa0')][_0x5e5b('0x10c')](db[_0x5e5b('0xa1')],{'as':_0x5e5b('0x1af'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xa0')][_0x5e5b('0x10c')](db['SugarcrmField'],{'as':_0x5e5b('0x1aa'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xa0')]['belongsTo'](db[_0x5e5b('0x9f')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xa1')][_0x5e5b('0x10c')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xa1')][_0x5e5b('0x10c')](db[_0x5e5b('0xa1')],{'as':_0x5e5b('0x1b3'),'foreignKey':'DescriptionId'});db['SugarcrmField']['hasMany'](db[_0x5e5b('0xa1')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xa1')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':'VariableId'});db['DeskAccount'][_0x5e5b('0x10c')](db['DeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x5e5b('0xa5')][_0x5e5b('0x10c')](db[_0x5e5b('0xa6')],{'as':_0x5e5b('0x1b6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x5e5b('0xa5')][_0x5e5b('0x10c')](db['DeskField'],{'as':_0x5e5b('0x1af'),'onDelete':_0x5e5b('0x111'),'foreignKey':'DescriptionId'});db[_0x5e5b('0xa5')][_0x5e5b('0x10c')](db[_0x5e5b('0xa6')],{'as':_0x5e5b('0x1aa'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b1')});db['DeskConfiguration'][_0x5e5b('0x11d')](db[_0x5e5b('0xa3')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xa5')][_0x5e5b('0x120')](db['Tag'],{'through':_0x5e5b('0x1b7')});db['DeskField'][_0x5e5b('0x10c')](db[_0x5e5b('0xa6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x5e5b('0xa6')]['hasMany'](db[_0x5e5b('0xa6')],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xa6')][_0x5e5b('0x10c')](db[_0x5e5b('0xa6')],{'as':_0x5e5b('0x1b4'),'foreignKey':'FieldId'});db[_0x5e5b('0xa6')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':'Variable','foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0xa7')][_0x5e5b('0x10c')](db['ZohoConfiguration'],{'as':_0x5e5b('0x1ab'),'onDelete':'cascade','foreignKey':_0x5e5b('0x1ac')});db['ZohoConfiguration']['hasMany'](db[_0x5e5b('0xa9')],{'as':_0x5e5b('0x1b6'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xa8')]['hasMany'](db[_0x5e5b('0xa9')],{'as':_0x5e5b('0x1af'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xa8')][_0x5e5b('0x10c')](db[_0x5e5b('0xa9')],{'as':_0x5e5b('0x1aa'),'onDelete':'cascade','foreignKey':_0x5e5b('0x1b1')});db['ZohoConfiguration'][_0x5e5b('0x11d')](db[_0x5e5b('0xa7')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xa9')][_0x5e5b('0x10c')](db[_0x5e5b('0xa9')],{'as':_0x5e5b('0x1b2'),'foreignKey':_0x5e5b('0x1ad')});db['ZohoField'][_0x5e5b('0x10c')](db[_0x5e5b('0xa9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x5e5b('0xa9')][_0x5e5b('0x10c')](db['ZohoField'],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xa9')][_0x5e5b('0x11d')](db['Variable'],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0xab')][_0x5e5b('0x10c')](db['ZendeskConfiguration'],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ac')});db['ZendeskConfiguration'][_0x5e5b('0x10c')](db[_0x5e5b('0xae')],{'as':'Subjects','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xad')][_0x5e5b('0x10c')](db[_0x5e5b('0xae')],{'as':_0x5e5b('0x1af'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xad')][_0x5e5b('0x10c')](db[_0x5e5b('0xae')],{'as':'Fields','foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xad')][_0x5e5b('0x11d')](db[_0x5e5b('0xab')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xad')]['belongsToMany'](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x1b8')});db[_0x5e5b('0xae')][_0x5e5b('0x10c')](db[_0x5e5b('0xae')],{'as':'Subject','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xae')][_0x5e5b('0x10c')](db['ZendeskField'],{'as':_0x5e5b('0x1b3'),'foreignKey':'DescriptionId'});db[_0x5e5b('0xae')][_0x5e5b('0x10c')](db[_0x5e5b('0xae')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db['ZendeskField']['belongsTo'](db['Variable'],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0xb0')]['hasMany'](db[_0x5e5b('0xb2')],{'as':_0x5e5b('0x1ab'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x5e5b('0x10c')](db[_0x5e5b('0x1b9')],{'as':_0x5e5b('0x1b6'),'onDelete':'cascade','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xb2')]['hasMany'](db[_0x5e5b('0x1b9')],{'as':'Descriptions','onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xb2')][_0x5e5b('0x10c')](db[_0x5e5b('0x1b9')],{'as':_0x5e5b('0x1aa'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xb2')][_0x5e5b('0x11d')](db[_0x5e5b('0xb0')],{'as':'Account','foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xb2')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x1ba')});db[_0x5e5b('0x1b9')]['hasMany'](db[_0x5e5b('0x1b9')],{'as':_0x5e5b('0x1b2'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0x1b9')][_0x5e5b('0x10c')](db['FreshdeskField'],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0x1b9')]['hasMany'](db[_0x5e5b('0x1b9')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0x1b9')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':'VariableId'});db[_0x5e5b('0xb5')][_0x5e5b('0x10c')](db[_0x5e5b('0xb7')],{'as':'Configurations','onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xb7')][_0x5e5b('0x10c')](db[_0x5e5b('0xb9')],{'as':_0x5e5b('0x1b6'),'foreignKey':'SubjectId'});db[_0x5e5b('0xb7')][_0x5e5b('0x10c')](db[_0x5e5b('0xb9')],{'as':'Descriptions','foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xb7')]['hasMany'](db['VtigerField'],{'as':'Fields','foreignKey':_0x5e5b('0x1b1')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xb9')][_0x5e5b('0x10c')](db['VtigerField'],{'as':'Subject','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xb9')]['hasMany'](db[_0x5e5b('0xb9')],{'as':_0x5e5b('0x1b3'),'foreignKey':'DescriptionId'});db[_0x5e5b('0xb9')]['hasMany'](db[_0x5e5b('0xb9')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xb9')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0xbb')][_0x5e5b('0x10c')](db[_0x5e5b('0x1bb')],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':'AccountId'});db[_0x5e5b('0x1bb')][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':'Subjects','foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0x1bb')][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':_0x5e5b('0x1af'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0x1bb')][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':_0x5e5b('0x1aa'),'foreignKey':_0x5e5b('0x1b1')});db['ServicenowConfiguration'][_0x5e5b('0x11d')](db[_0x5e5b('0xbb')],{'as':_0x5e5b('0x15f'),'foreignKey':'AccountId'});db[_0x5e5b('0xbd')][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':_0x5e5b('0x1b2'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xbd')][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db['ServicenowField'][_0x5e5b('0x10c')](db[_0x5e5b('0xbd')],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xbd')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db['Dynamics365Account']['hasMany'](db[_0x5e5b('0xbf')],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0xbf')][_0x5e5b('0x10c')](db['Dynamics365Field'],{'as':_0x5e5b('0x1b6'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1ad')});db[_0x5e5b('0xbf')][_0x5e5b('0x10c')](db[_0x5e5b('0xc1')],{'as':_0x5e5b('0x1af'),'onDelete':_0x5e5b('0x111'),'foreignKey':'DescriptionId'});db[_0x5e5b('0xbf')][_0x5e5b('0x10c')](db[_0x5e5b('0xc1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x5e5b('0xbf')]['belongsTo'](db['Dynamics365Account'],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1ac')});db['Dynamics365Field'][_0x5e5b('0x10c')](db[_0x5e5b('0xc1')],{'as':_0x5e5b('0x1b2'),'foreignKey':'SubjectId'});db[_0x5e5b('0xc1')][_0x5e5b('0x10c')](db['Dynamics365Field'],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xc1')][_0x5e5b('0x10c')](db['Dynamics365Field'],{'as':_0x5e5b('0x1b4'),'foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xc1')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db[_0x5e5b('0x1bc')][_0x5e5b('0x10c')](db['FreshsalesConfiguration'],{'as':_0x5e5b('0x1ab'),'onDelete':_0x5e5b('0x111'),'foreignKey':'AccountId'});db[_0x5e5b('0xc4')]['hasMany'](db[_0x5e5b('0x1bd')],{'as':_0x5e5b('0x1b6'),'foreignKey':'SubjectId'});db[_0x5e5b('0xc4')][_0x5e5b('0x10c')](db[_0x5e5b('0x1bd')],{'as':_0x5e5b('0x1af'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0xc4')]['hasMany'](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x5e5b('0x1b1')});db[_0x5e5b('0xc4')]['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x5e5b('0x1ac')});db[_0x5e5b('0x1bd')][_0x5e5b('0x10c')](db[_0x5e5b('0x1bd')],{'as':_0x5e5b('0x1b2'),'foreignKey':'SubjectId'});db[_0x5e5b('0x1bd')][_0x5e5b('0x10c')](db['FreshsalesField'],{'as':_0x5e5b('0x1b3'),'foreignKey':_0x5e5b('0x1b0')});db[_0x5e5b('0x1bd')][_0x5e5b('0x10c')](db[_0x5e5b('0x1bd')],{'as':_0x5e5b('0x1b4'),'foreignKey':'FieldId'});db[_0x5e5b('0x1bd')][_0x5e5b('0x11d')](db[_0x5e5b('0x90')],{'as':_0x5e5b('0x90'),'foreignKey':_0x5e5b('0x1b5')});db['ChatQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{});db[_0x5e5b('0x1be')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db['ChatQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x1be')]['belongsTo'](db[_0x5e5b('0x65')],{});db[_0x5e5b('0x1be')]['belongsTo'](db['ChatMessage'],{});db['ChatQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{});db['ChatQueueReport']['belongsTo'](db[_0x5e5b('0x69')],{});db['ChatInternalMessage'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':'cascade','foreignKey':_0x5e5b('0x1bf')});db['ChatInternalMessage'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':_0x5e5b('0x111'),'foreignKey':'ToId'});db[_0x5e5b('0xce')][_0x5e5b('0x10c')](db['JscriptyQuestionReport'],{'foreignKey':_0x5e5b('0x1c0'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0xce')][_0x5e5b('0x10c')](db['JscriptyAnswerReport'],{'foreignKey':_0x5e5b('0x1c0'),'onDelete':'cascade'});db[_0x5e5b('0x1c1')][_0x5e5b('0x11d')](db['SmsAccount'],{});db[_0x5e5b('0x1c1')][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':'ListId'});db[_0x5e5b('0x1c1')][_0x5e5b('0x11d')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db[_0x5e5b('0x1c1')][_0x5e5b('0x11d')](db[_0x5e5b('0x58')],{});db[_0x5e5b('0x1c1')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x5e5b('0x10a')],{});db[_0x5e5b('0x1c1')][_0x5e5b('0x11d')](db[_0x5e5b('0x5a')],{});db[_0x5e5b('0xd3')][_0x5e5b('0x10c')](db[_0x5e5b('0xce')],{'foreignKey':_0x5e5b('0x1c2')});db['JscriptyProject']['hasMany'](db[_0x5e5b('0xcd')],{'foreignKey':_0x5e5b('0x1c2')});db['JscriptyProject'][_0x5e5b('0x10c')](db[_0x5e5b('0xcb')],{'foreignKey':_0x5e5b('0x1c2')});db[_0x5e5b('0xd8')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':'Users','through':_0x5e5b('0x13e')});db[_0x5e5b('0xdd')]['belongsToMany'](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x125')});db[_0x5e5b('0xdd')][_0x5e5b('0x120')](db[_0x5e5b('0x1c')],{'through':_0x5e5b('0x105'),'as':'VoiceQueues'});db[_0x5e5b('0xdd')][_0x5e5b('0x120')](db[_0x5e5b('0x12f')],{'through':_0x5e5b('0x1c3'),'as':_0x5e5b('0x130')});db[_0x5e5b('0xdd')][_0x5e5b('0x120')](db[_0x5e5b('0x69')],{'through':'team_has_chat_queues','as':_0x5e5b('0x1c4')});db['Team']['belongsToMany'](db[_0x5e5b('0x52')],{'through':_0x5e5b('0x172'),'as':'FaxQueues'});db[_0x5e5b('0xdd')][_0x5e5b('0x120')](db[_0x5e5b('0x5a')],{'through':_0x5e5b('0x17b'),'as':'SmsQueues'});db['Team']['belongsToMany'](db[_0x5e5b('0x62')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x5e5b('0xdd')][_0x5e5b('0x120')](db[_0x5e5b('0x101')],{'through':_0x5e5b('0x1c5'),'as':_0x5e5b('0x134')});db['Team'][_0x5e5b('0x120')](db[_0x5e5b('0xee')],{'through':'TeamVoicePrefix','as':_0x5e5b('0x12e')});db['Campaign']['hasMany'](db[_0x5e5b('0x71')],{'as':'Hoppers','foreignKey':_0x5e5b('0x194')});db[_0x5e5b('0x193')][_0x5e5b('0x10c')](db['CmHopperFinal'],{'as':_0x5e5b('0x112'),'foreignKey':_0x5e5b('0x194')});db[_0x5e5b('0x193')][_0x5e5b('0x10c')](db[_0x5e5b('0x75')],{'as':_0x5e5b('0x1c6'),'foreignKey':_0x5e5b('0x194')});db['Campaign'][_0x5e5b('0x10c')](db[_0x5e5b('0x73')],{'as':'HopperBlacks','foreignKey':_0x5e5b('0x194')});db['Campaign'][_0x5e5b('0x11d')](db[_0x5e5b('0x146')],{'as':'Trunk','foreignKey':_0x5e5b('0x1c7')});db[_0x5e5b('0x193')]['belongsTo'](db[_0x5e5b('0x146')],{'as':'TrunkBackup','foreignKey':_0x5e5b('0x1c8')});db[_0x5e5b('0x193')][_0x5e5b('0x11d')](db[_0x5e5b('0x147')],{'as':'Interval','foreignKey':_0x5e5b('0x166')});db['Campaign'][_0x5e5b('0x11d')](db[_0x5e5b('0xd8')],{'as':_0x5e5b('0xd8'),'foreignKey':_0x5e5b('0x1c9')});db['Campaign'][_0x5e5b('0x120')](db[_0x5e5b('0x14a')],{'as':_0x5e5b('0x124'),'through':_0x5e5b('0x1ca')});db[_0x5e5b('0x193')]['belongsToMany'](db['CmList'],{'as':_0x5e5b('0x14d'),'through':'campaigns_has_cm_blacklists'});db[_0x5e5b('0xe4')][_0x5e5b('0x11d')](db[_0x5e5b('0x68')],{'as':_0x5e5b('0x68'),'foreignKey':_0x5e5b('0x164')});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db[_0x5e5b('0x46')],{});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db[_0x5e5b('0x45')],{});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db[_0x5e5b('0x40')],{'foreignKey':_0x5e5b('0x1cc'),'as':_0x5e5b('0x1cd')});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1ce'),'as':_0x5e5b('0x1cf')});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':_0x5e5b('0x1d1')});db['MailTransferReport'][_0x5e5b('0x11d')](db['MailQueue'],{'foreignKey':_0x5e5b('0x1d2'),'as':_0x5e5b('0x1d3')});db[_0x5e5b('0x1cb')][_0x5e5b('0x11d')](db['MailAccount'],{'foreignKey':_0x5e5b('0x1d4'),'as':_0x5e5b('0x1d5')});db['ChatTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x66')],{});db[_0x5e5b('0xe7')][_0x5e5b('0x11d')](db[_0x5e5b('0x65')],{});db['ChatTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x63')],{'foreignKey':_0x5e5b('0x1d6'),'as':'FromAccount'});db[_0x5e5b('0xe7')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1ce'),'as':'FromAgent'});db[_0x5e5b('0xe7')]['belongsTo'](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':_0x5e5b('0x1d1')});db[_0x5e5b('0xe7')]['belongsTo'](db[_0x5e5b('0x69')],{'foreignKey':_0x5e5b('0x1d7'),'as':_0x5e5b('0x1d3')});db['ChatTransferReport']['belongsTo'](db[_0x5e5b('0x63')],{'foreignKey':'ToChatWebsiteId','as':_0x5e5b('0x1d5')});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db[_0x5e5b('0x16c')],{});db['FaxTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x116')],{});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db[_0x5e5b('0x169')],{'foreignKey':_0x5e5b('0x1d9'),'as':_0x5e5b('0x1cd')});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1ce'),'as':_0x5e5b('0x1cf')});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':'ToAgent'});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db[_0x5e5b('0x52')],{'foreignKey':_0x5e5b('0x1da'),'as':_0x5e5b('0x1d3')});db[_0x5e5b('0x1d8')][_0x5e5b('0x11d')](db['FaxAccount'],{'foreignKey':_0x5e5b('0x1db'),'as':_0x5e5b('0x1d5')});db['OpenchannelTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x17d')],{});db[_0x5e5b('0xe9')]['belongsTo'](db[_0x5e5b('0x60')],{});db[_0x5e5b('0xe9')]['belongsTo'](db[_0x5e5b('0x5c')],{'foreignKey':_0x5e5b('0x1dc'),'as':_0x5e5b('0x1cd')});db[_0x5e5b('0xe9')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':'FromUserId','as':_0x5e5b('0x1cf')});db[_0x5e5b('0xe9')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':'ToAgent'});db[_0x5e5b('0xe9')]['belongsTo'](db[_0x5e5b('0x62')],{'foreignKey':_0x5e5b('0x1dd'),'as':'ToQueue'});db[_0x5e5b('0xe9')][_0x5e5b('0x11d')](db['OpenchannelAccount'],{'foreignKey':_0x5e5b('0x1de'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x5e5b('0x175')],{});db[_0x5e5b('0xeb')]['belongsTo'](db[_0x5e5b('0x58')],{});db[_0x5e5b('0xeb')][_0x5e5b('0x11d')](db[_0x5e5b('0x55')],{'foreignKey':_0x5e5b('0x1df'),'as':_0x5e5b('0x1cd')});db[_0x5e5b('0xeb')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1ce'),'as':_0x5e5b('0x1cf')});db[_0x5e5b('0xeb')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':'ToAgent'});db[_0x5e5b('0xeb')][_0x5e5b('0x11d')](db[_0x5e5b('0x5a')],{'foreignKey':_0x5e5b('0x1e0'),'as':_0x5e5b('0x1d3')});db[_0x5e5b('0xeb')]['belongsTo'](db[_0x5e5b('0x55')],{'foreignKey':'ToSmsAccountId','as':_0x5e5b('0x1d5')});db[_0x5e5b('0x14a')][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':'Dispositions','foreignKey':_0x5e5b('0x15c'),'onDelete':'cascade'});db['CmList'][_0x5e5b('0x10c')](db['CmCustomField'],{'as':_0x5e5b('0x1e1'),'foreignKey':'ListId'});db[_0x5e5b('0x14a')][_0x5e5b('0x10c')](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x18e'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x14a')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x14a')][_0x5e5b('0x10c')](db[_0x5e5b('0x75')],{'as':_0x5e5b('0x113'),'foreignKey':_0x5e5b('0x15c')});db[_0x5e5b('0x14a')][_0x5e5b('0x10c')](db[_0x5e5b('0x77')],{'as':_0x5e5b('0x77'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x5e5b('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x5e5b('0x14a')][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x135')});db[_0x5e5b('0xee')][_0x5e5b('0x10c')](db[_0x5e5b('0x18')],{'as':_0x5e5b('0x19c'),'onDelete':_0x5e5b('0x111')});db['VoicePrefix'][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':'Agents','through':_0x5e5b('0x108')});db[_0x5e5b('0xee')]['belongsToMany'](db[_0x5e5b('0xdd')],{'through':_0x5e5b('0x107'),'as':'Teams'});db[_0x5e5b('0x11e')][_0x5e5b('0x10c')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x171'),'foreignKey':_0x5e5b('0x11f')});db[_0x5e5b('0x11e')][_0x5e5b('0x10c')](db[_0x5e5b('0xf1')],{'as':_0x5e5b('0x1e2'),'foreignKey':_0x5e5b('0x11f'),'onDelete':_0x5e5b('0x111')});db[_0x5e5b('0xf1')]['hasMany'](db[_0x5e5b('0xf3')],{'as':_0x5e5b('0x1e3'),'foreignKey':'sectionId','onDelete':_0x5e5b('0x111')});db['WhatsappAccount'][_0x5e5b('0x10c')](db[_0x5e5b('0x157')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':_0x5e5b('0x111')});db[_0x5e5b('0xf6')]['hasMany'](db[_0x5e5b('0x7c')],{'as':'Answers','foreignKey':_0x5e5b('0x1e4')});db[_0x5e5b('0xf6')][_0x5e5b('0x10c')](db[_0x5e5b('0xfc')],{'as':_0x5e5b('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x5e5b('0xf6')][_0x5e5b('0x10c')](db[_0x5e5b('0xfa')],{'as':'Interactions'});db[_0x5e5b('0xf6')][_0x5e5b('0x10c')](db[_0x5e5b('0xf8')],{'as':'Applications'});db[_0x5e5b('0xf6')][_0x5e5b('0x11d')](db['CmList'],{'as':_0x5e5b('0x174'),'foreignKey':_0x5e5b('0x15c')});db['WhatsappAccount'][_0x5e5b('0x11d')](db[_0x5e5b('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x5e5b('0x149')});db['WhatsappAccount'][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x5e5b('0x11d')](db[_0x5e5b('0x101')],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0xf8')][_0x5e5b('0x11d')](db['WhatsappAccount'],{'onDelete':_0x5e5b('0x165')});db[_0x5e5b('0xf8')][_0x5e5b('0x11d')](db[_0x5e5b('0x147')],{'onDelete':_0x5e5b('0x165'),'foreignKey':'IntervalId'});db[_0x5e5b('0xf8')][_0x5e5b('0x11d')](db[_0x5e5b('0x8b')],{'onDelete':_0x5e5b('0x165'),'foreignKey':'TagId'});db[_0x5e5b('0xfa')][_0x5e5b('0x10c')](db[_0x5e5b('0xfc')],{'as':_0x5e5b('0x159'),'onDelete':_0x5e5b('0x111'),'foreignKey':_0x5e5b('0x1e5')});db[_0x5e5b('0xfa')][_0x5e5b('0x11d')](db[_0x5e5b('0xf6')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x5e5b('0xfa')][_0x5e5b('0x11d')](db['CmContact'],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db['WhatsappInteraction'][_0x5e5b('0x11d')](db['User'],{'as':_0x5e5b('0x160'),'foreignKey':_0x5e5b('0x10e')});db[_0x5e5b('0xfa')][_0x5e5b('0x120')](db[_0x5e5b('0x8b')],{'through':_0x5e5b('0x1e6'),'as':_0x5e5b('0x161')});db[_0x5e5b('0xfa')][_0x5e5b('0x120')](db['Tag'],{'through':_0x5e5b('0x1e6'),'as':_0x5e5b('0x170')});db[_0x5e5b('0xfa')][_0x5e5b('0x120')](db['User'],{'as':_0x5e5b('0x171'),'through':_0x5e5b('0x12c'),'foreignKey':_0x5e5b('0x1e5')});db[_0x5e5b('0xfc')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x10a')});db[_0x5e5b('0xfc')]['belongsTo'](db[_0x5e5b('0x6f')],{'onDelete':_0x5e5b('0x111'),'as':_0x5e5b('0x152')});db[_0x5e5b('0xfc')][_0x5e5b('0x11d')](db[_0x5e5b('0xfa')],{'onDelete':'cascade','as':_0x5e5b('0x179'),'foreignKey':_0x5e5b('0x1e5')});db[_0x5e5b('0xfc')][_0x5e5b('0x11d')](db[_0x5e5b('0xf6')],{'as':_0x5e5b('0x15f'),'foreignKey':_0x5e5b('0x1e4')});db[_0x5e5b('0xfd')][_0x5e5b('0x11d')](db[_0x5e5b('0xf6')],{});db['WhatsappQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x14a')],{'as':'List','foreignKey':_0x5e5b('0x15c')});db['WhatsappQueueReport']['belongsTo'](db[_0x5e5b('0x6f')],{'as':_0x5e5b('0x152'),'foreignKey':_0x5e5b('0x153')});db['WhatsappQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0xfa')],{});db['WhatsappQueueReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x101')],{});db['WhatsappQueueReport'][_0x5e5b('0x11d')](db['WhatsappMessage'],{});db[_0x5e5b('0xfd')]['belongsTo'](db['User'],{});db['WhatsappTransferReport'][_0x5e5b('0x11d')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0xfa')],{});db['WhatsappTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0xf6')],{'foreignKey':_0x5e5b('0x1e7'),'as':_0x5e5b('0x1cd')});db[_0x5e5b('0xff')][_0x5e5b('0x11d')](db[_0x5e5b('0xf6')],{'foreignKey':_0x5e5b('0x1e8'),'as':_0x5e5b('0x1d5')});db['WhatsappTransferReport'][_0x5e5b('0x11d')](db[_0x5e5b('0x101')],{'foreignKey':_0x5e5b('0x1e9'),'as':'ToQueue'});db['WhatsappTransferReport']['belongsTo'](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1ce'),'as':'FromAgent'});db[_0x5e5b('0xff')][_0x5e5b('0x11d')](db[_0x5e5b('0x10a')],{'foreignKey':_0x5e5b('0x1d0'),'as':_0x5e5b('0x1d1')});db['WhatsappQueue'][_0x5e5b('0x120')](db[_0x5e5b('0x10a')],{'as':_0x5e5b('0x14c'),'through':_0x5e5b('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x5e5b('0x101')][_0x5e5b('0x120')](db[_0x5e5b('0xdd')],{'through':'team_has_whatsapp_queues','as':_0x5e5b('0x173')});module[_0x5e5b('0x1ea')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../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','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0xa75b,0x170));var _0xba75=function(_0x5a6f1e,_0xe6c4b5){_0x5a6f1e=_0x5a6f1e-0x0;var _0x253f16=_0xa75b[_0x5a6f1e];return _0x253f16;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d70fea4..ee45395 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd1c=['\x20body=%s','format','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','remoteAddress','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./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/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','/api/pm2','/apidoc','root','/www','static','join','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','newPassword','apiKey','lastName','phone','fax','clientId','clientSecret','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','path','express','express-winston','./errors','./config/environment','api','auth','safeTemplate','use','logger','body'];(function(_0x5881b9,_0x220184){var _0x3aa53e=function(_0x533e51){while(--_0x533e51){_0x5881b9['push'](_0x5881b9['shift']());}};_0x3aa53e(++_0x220184);}(_0xbd1c,0x144));var _0xcbd1=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xbd1c[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var path=require(_0xcbd1('0x0'));var express=require(_0xcbd1('0x1'));var ewinston=require(_0xcbd1('0x2'));var util=require('util');var errors=require(_0xcbd1('0x3'));var config=require(_0xcbd1('0x4'));var logger=require('./config/logger')(_0xcbd1('0x5'));var authLogger=require('./config/logger')(_0xcbd1('0x6'));var safeTemplate=require('./safe-template')[_0xcbd1('0x7')];exports['default']=function(_0x22b9e5){_0x22b9e5[_0xcbd1('0x8')](ewinston[_0xcbd1('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x111094,_0x30ea74){var _0x113da9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x111094[_0xcbd1('0xa')])){_0x113da9+=_0xcbd1('0xb');var _0x1b1615=_0x111094[_0xcbd1('0xa')];maskSensitiveData(_0x1b1615);}return safeTemplate(util[_0xcbd1('0xc')](_0x113da9,_0x111094['method'],_0x111094[_0xcbd1('0xd')]['x-forwarded-for']?_0x111094[_0xcbd1('0xd')][_0xcbd1('0xe')]:_0x111094[_0xcbd1('0xf')]['remoteAddress']||_0x111094['ip'],_0x111094[_0xcbd1('0x10')],_0x30ea74[_0xcbd1('0x11')],_0x30ea74[_0xcbd1('0x12')],_0x111094[_0xcbd1('0x13')]?_0x111094['user']['id']:null,_0x111094['user']?_0x111094['user'][_0xcbd1('0x14')]:null,_0x111094['user']?_0x111094[_0xcbd1('0x13')][_0xcbd1('0x15')]:null,_0x1b1615?util[_0xcbd1('0x16')](_0x1b1615,![],null):''));}}));_0x22b9e5[_0xcbd1('0x8')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5af81f,_0x194632){var _0x420937=_0xcbd1('0x17');if(_0x5af81f[_0xcbd1('0xa')]&&_0x5af81f['body'][_0xcbd1('0x18')]&&_0x5af81f[_0xcbd1('0xa')][_0xcbd1('0x19')]){_0x420937=_0xcbd1('0x1a');}return util['format'](_0x420937,_0x5af81f[_0xcbd1('0x1b')],_0x5af81f['headers']['x-forwarded-for']?_0x5af81f[_0xcbd1('0xd')]['x-forwarded-for']:_0x5af81f['connection'][_0xcbd1('0x1c')]||_0x5af81f['ip'],_0x5af81f['url'],_0x194632['statusCode'],_0x194632[_0xcbd1('0x12')],_0x5af81f[_0xcbd1('0x13')]?_0x5af81f[_0xcbd1('0x13')]['id']:null,_0x5af81f[_0xcbd1('0x13')]?_0x5af81f[_0xcbd1('0x13')]['name']:null,_0x5af81f[_0xcbd1('0x13')]?_0x5af81f[_0xcbd1('0x13')][_0xcbd1('0x15')]:null,_0x5af81f[_0xcbd1('0xa')]&&_0x5af81f[_0xcbd1('0xa')]['device']?_0x5af81f[_0xcbd1('0xa')][_0xcbd1('0x18')]:'other',_0x5af81f[_0xcbd1('0xa')]&&_0x5af81f[_0xcbd1('0xa')][_0xcbd1('0x19')]?_0x5af81f[_0xcbd1('0xa')][_0xcbd1('0x19')]:'',_0x5af81f[_0xcbd1('0xa')]&&_0x5af81f['body'][_0xcbd1('0x1d')]?_0x5af81f[_0xcbd1('0xa')][_0xcbd1('0x1d')]:'');},'ignoreRoute':function(_0xa89b6){var _0xa1cc90=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xa1cc90['test'](_0xa89b6[_0xcbd1('0x10')]);}}));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x1e'),require(_0xcbd1('0x1f')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x20'),require(_0xcbd1('0x21')));_0x22b9e5[_0xcbd1('0x8')]('/api/voice/contexts',require(_0xcbd1('0x22')));_0x22b9e5['use'](_0xcbd1('0x23'),require(_0xcbd1('0x24')));_0x22b9e5['use']('/api/voice/mohs',require(_0xcbd1('0x25')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x26'),require(_0xcbd1('0x27')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x28'),require(_0xcbd1('0x29')));_0x22b9e5['use'](_0xcbd1('0x2a'),require(_0xcbd1('0x2b')));_0x22b9e5[_0xcbd1('0x8')]('/api/voice/mails',require(_0xcbd1('0x2c')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x2d'),require(_0xcbd1('0x2e')));_0x22b9e5['use']('/api/voice/calls/reports',require(_0xcbd1('0x2f')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x30'),require(_0xcbd1('0x31')));_0x22b9e5['use'](_0xcbd1('0x32'),require(_0xcbd1('0x33')));_0x22b9e5[_0xcbd1('0x8')]('/api/voice/queues/reports',require(_0xcbd1('0x34')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x35'),require('./api/memberReport'));_0x22b9e5['use'](_0xcbd1('0x36'),require('./api/trunk'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x37'),require(_0xcbd1('0x38')));_0x22b9e5['use'](_0xcbd1('0x39'),require(_0xcbd1('0x3a')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x3b'),require(_0xcbd1('0x3c')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x3d'),require(_0xcbd1('0x3e')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x3f'),require(_0xcbd1('0x40')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x41'),require(_0xcbd1('0x42')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x43'),require(_0xcbd1('0x44')));_0x22b9e5['use']('/api/mail/applications',require('./api/mailApplication'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x45'),require('./api/mailQueueReport'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x46'),require(_0xcbd1('0x47')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x48'),require(_0xcbd1('0x49')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x4a'),require(_0xcbd1('0x4b')));_0x22b9e5['use'](_0xcbd1('0x4c'),require(_0xcbd1('0x4d')));_0x22b9e5['use'](_0xcbd1('0x4e'),require(_0xcbd1('0x4f')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x50'),require(_0xcbd1('0x51')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x52'),require(_0xcbd1('0x53')));_0x22b9e5[_0xcbd1('0x8')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x54'),require(_0xcbd1('0x55')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x56'),require(_0xcbd1('0x57')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x58'),require(_0xcbd1('0x59')));_0x22b9e5['use'](_0xcbd1('0x5a'),require(_0xcbd1('0x5b')));_0x22b9e5['use'](_0xcbd1('0x5c'),require(_0xcbd1('0x5d')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x5e'),require('./api/openchannelAccount'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x5f'),require('./api/openchannelApplication'));_0x22b9e5['use'](_0xcbd1('0x60'),require('./api/openchannelInteraction'));_0x22b9e5['use'](_0xcbd1('0x61'),require('./api/openchannelMessage'));_0x22b9e5[_0xcbd1('0x8')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x22b9e5['use'](_0xcbd1('0x62'),require(_0xcbd1('0x63')));_0x22b9e5[_0xcbd1('0x8')]('/api/openchannel/reports/queue',require(_0xcbd1('0x64')));_0x22b9e5['use'](_0xcbd1('0x65'),require(_0xcbd1('0x66')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x67'),require(_0xcbd1('0x68')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x69'),require('./api/chatMessage'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x6a'),require(_0xcbd1('0x6b')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x6c'),require(_0xcbd1('0x6d')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x6e'),require(_0xcbd1('0x6f')));_0x22b9e5[_0xcbd1('0x8')]('/api/chat/proactive_actions',require(_0xcbd1('0x70')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x71'),require('./api/cmCompany'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x72'),require(_0xcbd1('0x73')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x74'),require(_0xcbd1('0x75')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x76'),require('./api/cmHopperBlack'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x77'),require(_0xcbd1('0x78')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x79'),require(_0xcbd1('0x7a')));_0x22b9e5['use'](_0xcbd1('0x7b'),require(_0xcbd1('0x7c')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x7d'),require(_0xcbd1('0x7e')));_0x22b9e5['use'](_0xcbd1('0x7f'),require(_0xcbd1('0x80')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x81'),require(_0xcbd1('0x82')));_0x22b9e5['use']('/api/dispositions',require(_0xcbd1('0x83')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x84'),require(_0xcbd1('0x85')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x86'),require(_0xcbd1('0x87')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x88'),require(_0xcbd1('0x89')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x8a'),require(_0xcbd1('0x8b')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x8c'),require('./api/voiceQueuesLog'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x8d'),require('./api/schedule'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x8e'),require(_0xcbd1('0x8f')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x90'),require('./api/tag'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x91'),require(_0xcbd1('0x92')));_0x22b9e5[_0xcbd1('0x8')]('/api/triggers',require(_0xcbd1('0x93')));_0x22b9e5['use'](_0xcbd1('0x94'),require(_0xcbd1('0x95')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x96'),require(_0xcbd1('0x97')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x98'),require('./api/integrationReport'));_0x22b9e5['use'](_0xcbd1('0x99'),require(_0xcbd1('0x9a')));_0x22b9e5['use'](_0xcbd1('0x9b'),require(_0xcbd1('0x9c')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x9d'),require(_0xcbd1('0x9e')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x9f'),require(_0xcbd1('0xa0')));_0x22b9e5['use'](_0xcbd1('0xa1'),require(_0xcbd1('0xa2')));_0x22b9e5['use'](_0xcbd1('0xa3'),require(_0xcbd1('0xa4')));_0x22b9e5['use'](_0xcbd1('0xa5'),require(_0xcbd1('0xa6')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xa7'),require(_0xcbd1('0xa8')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/salesforce/fields',require(_0xcbd1('0xa9')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xaa'),require(_0xcbd1('0xab')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xac'),require(_0xcbd1('0xad')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xae'),require(_0xcbd1('0xaf')));_0x22b9e5['use'](_0xcbd1('0xb0'),require(_0xcbd1('0xb1')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xb2'),require('./api/intDeskConfiguration'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xb3'),require('./api/intDeskField'));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/zoho/accounts',require(_0xcbd1('0xb4')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xb5'),require(_0xcbd1('0xb6')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/zoho/fields',require(_0xcbd1('0xb7')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xb8'),require(_0xcbd1('0xb9')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xba'),require('./api/intZendeskConfiguration'));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/zendesk/fields',require(_0xcbd1('0xbb')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/freshdesk/accounts',require(_0xcbd1('0xbc')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xbd'),require(_0xcbd1('0xbe')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xbf'),require(_0xcbd1('0xc0')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xc1'),require('./api/intVtigerAccount'));_0x22b9e5['use'](_0xcbd1('0xc2'),require(_0xcbd1('0xc3')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xc4'),require(_0xcbd1('0xc5')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/servicenow/configurations',require(_0xcbd1('0xc6')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/servicenow/fields',require(_0xcbd1('0xc7')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xc8'),require(_0xcbd1('0xc9')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xca'),require(_0xcbd1('0xcb')));_0x22b9e5['use']('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/freshsales/accounts',require(_0xcbd1('0xcc')));_0x22b9e5[_0xcbd1('0x8')]('/api/integrations/freshsales/configurations',require(_0xcbd1('0xcd')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xce'),require(_0xcbd1('0xcf')));_0x22b9e5[_0xcbd1('0x8')]('/api/networks',require(_0xcbd1('0xd0')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xd1'),require('./api/chatQueueReport'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xd2'),require(_0xcbd1('0xd3')));_0x22b9e5['use'](_0xcbd1('0xd4'),require(_0xcbd1('0xd5')));_0x22b9e5['use'](_0xcbd1('0xd6'),require('./api/jscriptyQuestionReport'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xd7'),require(_0xcbd1('0xd8')));_0x22b9e5[_0xcbd1('0x8')]('/api/sms/reports/queue',require(_0xcbd1('0xd9')));_0x22b9e5['use'](_0xcbd1('0xda'),require(_0xcbd1('0xdb')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xdc'),require(_0xcbd1('0xdd')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xde'),require(_0xcbd1('0xdf')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xe0'),require(_0xcbd1('0xe1')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xe2'),require(_0xcbd1('0xe3')));_0x22b9e5[_0xcbd1('0x8')]('/api/square/projects',require(_0xcbd1('0xe4')));_0x22b9e5[_0xcbd1('0x8')]('/api/square/recordings',require(_0xcbd1('0xe5')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xe6'),require(_0xcbd1('0xe7')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xe8'),require('./api/team'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xe9'),require(_0xcbd1('0xea')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xeb'),require(_0xcbd1('0xec')));_0x22b9e5['use'](_0xcbd1('0xed'),require(_0xcbd1('0xee')));_0x22b9e5['use'](_0xcbd1('0xef'),require(_0xcbd1('0xf0')));_0x22b9e5[_0xcbd1('0x8')]('/api/plugins',require(_0xcbd1('0xf1')));_0x22b9e5['use'](_0xcbd1('0xf2'),require(_0xcbd1('0xf3')));_0x22b9e5[_0xcbd1('0x8')]('/api/chat/reports/transfer',require(_0xcbd1('0xf4')));_0x22b9e5[_0xcbd1('0x8')]('/api/fax/reports/transfer',require(_0xcbd1('0xf5')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xf6'),require(_0xcbd1('0xf7')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xf8'),require(_0xcbd1('0xf9')));_0x22b9e5['use'](_0xcbd1('0xfa'),require(_0xcbd1('0xfb')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xfc'),require('./api/voicePrefix'));_0x22b9e5[_0xcbd1('0x8')]('/api/userProfiles',require(_0xcbd1('0xfd')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0xfe'),require(_0xcbd1('0xff')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x100'),require(_0xcbd1('0x101')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x102'),require(_0xcbd1('0x103')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x104'),require('./api/whatsappAccount'));_0x22b9e5[_0xcbd1('0x8')]('/api/whatsapp/applications',require(_0xcbd1('0x105')));_0x22b9e5['use'](_0xcbd1('0x106'),require(_0xcbd1('0x107')));_0x22b9e5[_0xcbd1('0x8')]('/api/whatsapp/messages',require(_0xcbd1('0x108')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x109'),require('./api/whatsappQueueReport'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x10a'),require(_0xcbd1('0x10b')));_0x22b9e5[_0xcbd1('0x8')]('/api/whatsapp/queues',require(_0xcbd1('0x10c')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x10d'),require(_0xcbd1('0x10e')));_0x22b9e5[_0xcbd1('0x8')]('/api/realtime',require('./api/realtime'));_0x22b9e5['use']('/api/auth/local',require('./api/authLocal'));_0x22b9e5['use'](_0xcbd1('0x10f'),require(_0xcbd1('0x110')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x111'),require(_0xcbd1('0x112')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x113'),require(_0xcbd1('0x114')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x115'),require(_0xcbd1('0x116')));_0x22b9e5[_0xcbd1('0x8')]('/api/version',require('./api/version'));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x117'),require(_0xcbd1('0x118')));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x119'),require('./api/pm2'));_0x22b9e5['use']('/api/webbar',require('./api/webbar'));_0x22b9e5['use'](_0xcbd1('0x11a'),express['static'](path['join'](config[_0xcbd1('0x11b')],_0xcbd1('0x11a'))));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x11c'),express[_0xcbd1('0x11d')](path[_0xcbd1('0x11e')](config[_0xcbd1('0x11b')],_0xcbd1('0x11c'))));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x11f'),express[_0xcbd1('0x11d')](path[_0xcbd1('0x11e')](config['root'],_0xcbd1('0x11f'))));_0x22b9e5[_0xcbd1('0x8')](_0xcbd1('0x120'),express[_0xcbd1('0x11d')](path['join'](config[_0xcbd1('0x11b')],_0xcbd1('0x121'),_0xcbd1('0x122'))));_0x22b9e5['use']('/plugins',express['static'](path[_0xcbd1('0x11e')](config[_0xcbd1('0x11b')],_0xcbd1('0x123'))));_0x22b9e5[_0xcbd1('0x124')](_0xcbd1('0x125'))[_0xcbd1('0x126')](errors[0x194]);_0x22b9e5[_0xcbd1('0x124')]('/*')[_0xcbd1('0x126')](function(_0x4d3931,_0xef693d){_0xef693d[_0xcbd1('0x127')](path[_0xcbd1('0x128')](_0x22b9e5['get'](_0xcbd1('0x129'))+_0xcbd1('0x12a')));});};var sensitiveFields=['username','password',_0xcbd1('0x12b'),_0xcbd1('0x12c'),'firstName',_0xcbd1('0x12d'),'street',_0xcbd1('0x12e'),'mobile',_0xcbd1('0x12f'),'email',_0xcbd1('0x130'),_0xcbd1('0x131'),'securityToken',_0xcbd1('0x132'),_0xcbd1('0x133'),'tenantId',_0xcbd1('0x134'),_0xcbd1('0x135'),_0xcbd1('0x136'),_0xcbd1('0x137'),'authToken',_0xcbd1('0x138'),_0xcbd1('0x139'),_0xcbd1('0x13a'),_0xcbd1('0x13b'),_0xcbd1('0x13c'),'exten','vidaooApiKey',_0xcbd1('0x13d'),_0xcbd1('0x13e'),_0xcbd1('0x13f'),_0xcbd1('0x140'),_0xcbd1('0x141'),'user',_0xcbd1('0x142'),_0xcbd1('0x143'),_0xcbd1('0x144'),'dsn',_0xcbd1('0x145'),_0xcbd1('0x146'),_0xcbd1('0x147')];function maskSensitiveData(_0x23369d){var _0x5ad9d5=/(?!^)[\s\S](?!$)/g;if(!_[_0xcbd1('0x148')](_0x23369d))return;for(var _0x4d5c6a in _0x23369d){if(_[_0xcbd1('0x149')](_0x23369d[_0x4d5c6a])){for(var _0x289998=0x0;_0x289998<_0x23369d[_0x4d5c6a][_0xcbd1('0x14a')];_0x289998++){maskSensitiveData(_0x23369d[_0x4d5c6a][_0x289998]);}}else if(_[_0xcbd1('0x148')](_0x23369d[_0x4d5c6a])){maskSensitiveData(_0x23369d[_0x4d5c6a]);}else if(_[_0xcbd1('0x14b')](_0x23369d[_0x4d5c6a])){_0x23369d[_0x4d5c6a]=_0x23369d[_0x4d5c6a][_0xcbd1('0x14c')](/{{{/g,'@@{')[_0xcbd1('0x14c')](/}}}/g,_0xcbd1('0x14d'))['replace'](/{{/g,'@{')[_0xcbd1('0x14c')](/}}/g,'}@');if(_[_0xcbd1('0x14e')](sensitiveFields,_0x4d5c6a)){_0x23369d[_0x4d5c6a]=_0x23369d[_0x4d5c6a][_0xcbd1('0x14c')](_0x5ad9d5,'*');}}}} \ No newline at end of file +var _0x4330=['./safe-template','safeTemplate','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','responseTime','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','statusCode','device','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','/api/conditions','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/tag','/api/templates','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/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/voice/prefixes','./api/voicePrefix','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','join','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','get','route','sendFile','resolve','appPath','username','newPassword','firstName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','isString','@@{','replace','}@@','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth'];(function(_0x5946de,_0xc96606){var _0x4c729a=function(_0x2012ce){while(--_0x2012ce){_0x5946de['push'](_0x5946de['shift']());}};_0x4c729a(++_0xc96606);}(_0x4330,0x13d));var _0x0433=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4330[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x0433('0x0'));var path=require(_0x0433('0x1'));var express=require(_0x0433('0x2'));var ewinston=require(_0x0433('0x3'));var util=require(_0x0433('0x4'));var errors=require(_0x0433('0x5'));var config=require(_0x0433('0x6'));var logger=require(_0x0433('0x7'))(_0x0433('0x8'));var authLogger=require(_0x0433('0x7'))(_0x0433('0x9'));var safeTemplate=require(_0x0433('0xa'))[_0x0433('0xb')];exports[_0x0433('0xc')]=function(_0x5751fa){_0x5751fa['use'](ewinston[_0x0433('0xd')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x35c08c,_0x404a22){var _0x220a36=_0x0433('0xe');if(!_['isEmpty'](_0x35c08c[_0x0433('0xf')])){_0x220a36+=_0x0433('0x10');var _0x23566e=_0x35c08c[_0x0433('0xf')];maskSensitiveData(_0x23566e);}return safeTemplate(util[_0x0433('0x11')](_0x220a36,_0x35c08c[_0x0433('0x12')],_0x35c08c['headers'][_0x0433('0x13')]?_0x35c08c[_0x0433('0x14')][_0x0433('0x13')]:_0x35c08c[_0x0433('0x15')]['remoteAddress']||_0x35c08c['ip'],_0x35c08c['url'],_0x404a22['statusCode'],_0x404a22[_0x0433('0x16')],_0x35c08c[_0x0433('0x17')]?_0x35c08c[_0x0433('0x17')]['id']:null,_0x35c08c['user']?_0x35c08c[_0x0433('0x17')][_0x0433('0x18')]:null,_0x35c08c[_0x0433('0x17')]?_0x35c08c[_0x0433('0x17')][_0x0433('0x19')]:null,_0x23566e?util[_0x0433('0x1a')](_0x23566e,![],null):''));}}));_0x5751fa[_0x0433('0x1b')](ewinston[_0x0433('0xd')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x33ef87,_0x4334ef){var _0x39159a=_0x0433('0x1c');if(_0x33ef87['body']&&_0x33ef87[_0x0433('0xf')]['device']&&_0x33ef87['body'][_0x0433('0x1d')]){_0x39159a=_0x0433('0x1e');}return util[_0x0433('0x11')](_0x39159a,_0x33ef87['method'],_0x33ef87[_0x0433('0x14')][_0x0433('0x13')]?_0x33ef87[_0x0433('0x14')][_0x0433('0x13')]:_0x33ef87['connection'][_0x0433('0x1f')]||_0x33ef87['ip'],_0x33ef87[_0x0433('0x20')],_0x4334ef[_0x0433('0x21')],_0x4334ef[_0x0433('0x16')],_0x33ef87[_0x0433('0x17')]?_0x33ef87['user']['id']:null,_0x33ef87['user']?_0x33ef87['user'][_0x0433('0x18')]:null,_0x33ef87[_0x0433('0x17')]?_0x33ef87[_0x0433('0x17')][_0x0433('0x19')]:null,_0x33ef87[_0x0433('0xf')]&&_0x33ef87[_0x0433('0xf')][_0x0433('0x22')]?_0x33ef87[_0x0433('0xf')][_0x0433('0x22')]:_0x0433('0x23'),_0x33ef87[_0x0433('0xf')]&&_0x33ef87['body'][_0x0433('0x1d')]?_0x33ef87[_0x0433('0xf')]['agent_id']:'',_0x33ef87['body']&&_0x33ef87[_0x0433('0xf')][_0x0433('0x24')]?_0x33ef87[_0x0433('0xf')][_0x0433('0x24')]:'');},'ignoreRoute':function(_0x14cf16){var _0x18b840=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x18b840[_0x0433('0x25')](_0x14cf16[_0x0433('0x20')]);}}));_0x5751fa[_0x0433('0x1b')](_0x0433('0x26'),require('./api/user'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x27'),require(_0x0433('0x28')));_0x5751fa['use'](_0x0433('0x29'),require(_0x0433('0x2a')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x2b'),require(_0x0433('0x2c')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x2d'),require(_0x0433('0x2e')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x2f'),require(_0x0433('0x30')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x31'),require(_0x0433('0x32')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x33'),require('./api/screenRecording'));_0x5751fa[_0x0433('0x1b')]('/api/voice/mails',require(_0x0433('0x34')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x35'),require('./api/voiceMailMessage'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x36'),require('./api/voiceCallReport'));_0x5751fa[_0x0433('0x1b')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x37'),require('./api/voiceAgentReport'));_0x5751fa['use'](_0x0433('0x38'),require(_0x0433('0x39')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x3a'),require('./api/memberReport'));_0x5751fa['use'](_0x0433('0x3b'),require(_0x0433('0x3c')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x3d'),require('./api/voiceTransferReport'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x3e'),require(_0x0433('0x3f')));_0x5751fa['use'](_0x0433('0x40'),require(_0x0433('0x41')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x42'),require(_0x0433('0x43')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x44'),require('./api/mailSubstatus'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x45'),require(_0x0433('0x46')));_0x5751fa['use'](_0x0433('0x47'),require(_0x0433('0x48')));_0x5751fa[_0x0433('0x1b')]('/api/mail/applications',require('./api/mailApplication'));_0x5751fa[_0x0433('0x1b')]('/api/mail/reports/queue',require(_0x0433('0x49')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x4a'),require('./api/dashboard'));_0x5751fa['use'](_0x0433('0x4b'),require(_0x0433('0x4c')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x4d'),require(_0x0433('0x4e')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x4f'),require('./api/faxApplication'));_0x5751fa[_0x0433('0x1b')]('/api/fax/interactions',require(_0x0433('0x50')));_0x5751fa[_0x0433('0x1b')]('/api/fax/messages',require(_0x0433('0x51')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x52'),require(_0x0433('0x53')));_0x5751fa['use']('/api/fax/reports/queue',require(_0x0433('0x54')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x55'),require(_0x0433('0x56')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x57'),require(_0x0433('0x58')));_0x5751fa['use']('/api/sms/interactions',require(_0x0433('0x59')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x5a'),require('./api/smsMessage'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x5b'),require(_0x0433('0x5c')));_0x5751fa[_0x0433('0x1b')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x5d'),require(_0x0433('0x5e')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x5f'),require(_0x0433('0x60')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x61'),require(_0x0433('0x62')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x63'),require('./api/openchannelQueue'));_0x5751fa['use'](_0x0433('0x64'),require(_0x0433('0x65')));_0x5751fa[_0x0433('0x1b')]('/api/openchannel/reports/queue',require(_0x0433('0x66')));_0x5751fa['use'](_0x0433('0x67'),require(_0x0433('0x68')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x69'),require(_0x0433('0x6a')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x6b'),require('./api/chatMessage'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x6c'),require(_0x0433('0x6d')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x6e'),require(_0x0433('0x6f')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x70'),require(_0x0433('0x71')));_0x5751fa['use'](_0x0433('0x72'),require(_0x0433('0x73')));_0x5751fa['use'](_0x0433('0x74'),require(_0x0433('0x75')));_0x5751fa['use']('/api/cm/contacts',require(_0x0433('0x76')));_0x5751fa['use']('/api/cm/hopper',require(_0x0433('0x77')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x78'),require(_0x0433('0x79')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x7a'),require(_0x0433('0x7b')));_0x5751fa['use'](_0x0433('0x7c'),require(_0x0433('0x7d')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x7e'),require(_0x0433('0x7f')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x80'),require('./api/action'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x81'),require(_0x0433('0x82')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x83'),require('./api/cannedAnswer'));_0x5751fa[_0x0433('0x1b')]('/api/dispositions',require('./api/disposition'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x84'),require('./api/condition'));_0x5751fa[_0x0433('0x1b')]('/api/intervals',require('./api/interval'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x85'),require(_0x0433('0x86')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x87'),require('./api/cdr'));_0x5751fa['use'](_0x0433('0x88'),require('./api/voiceQueuesLog'));_0x5751fa['use'](_0x0433('0x89'),require(_0x0433('0x8a')));_0x5751fa[_0x0433('0x1b')]('/api/sounds',require('./api/sound'));_0x5751fa[_0x0433('0x1b')]('/api/tags',require(_0x0433('0x8b')));_0x5751fa['use'](_0x0433('0x8c'),require('./api/template'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x8d'),require(_0x0433('0x8e')));_0x5751fa[_0x0433('0x1b')]('/api/variables',require(_0x0433('0x8f')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x90'),require('./api/integration'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x91'),require(_0x0433('0x92')));_0x5751fa['use'](_0x0433('0x93'),require(_0x0433('0x94')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x95'),require(_0x0433('0x96')));_0x5751fa[_0x0433('0x1b')]('/api/analytics/extracted_reports',require(_0x0433('0x97')));_0x5751fa['use']('/api/analytics/metrics',require(_0x0433('0x98')));_0x5751fa[_0x0433('0x1b')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x5751fa[_0x0433('0x1b')](_0x0433('0x99'),require(_0x0433('0x9a')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x9b'),require(_0x0433('0x9c')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x9d'),require(_0x0433('0x9e')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/salesforce/fields',require(_0x0433('0x9f')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa0'),require(_0x0433('0xa1')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa2'),require(_0x0433('0xa3')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa4'),require(_0x0433('0xa5')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa6'),require(_0x0433('0xa7')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa8'),require('./api/intDeskConfiguration'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xa9'),require(_0x0433('0xaa')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xab'),require('./api/intZohoConfiguration'));_0x5751fa[_0x0433('0x1b')]('/api/integrations/zoho/fields',require(_0x0433('0xac')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/zendesk/accounts',require(_0x0433('0xad')));_0x5751fa['use'](_0x0433('0xae'),require(_0x0433('0xaf')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xb0'),require(_0x0433('0xb1')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xb2'),require('./api/intFreshdeskAccount'));_0x5751fa['use']('/api/integrations/freshdesk/configurations',require(_0x0433('0xb3')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xb4'),require(_0x0433('0xb5')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xb6'),require(_0x0433('0xb7')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/vtiger/configurations',require(_0x0433('0xb8')));_0x5751fa['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x5751fa['use'](_0x0433('0xb9'),require(_0x0433('0xba')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xbb'),require(_0x0433('0xbc')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xbd'),require(_0x0433('0xbe')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xbf'),require(_0x0433('0xc0')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xc1'),require('./api/intDynamics365Field'));_0x5751fa[_0x0433('0x1b')]('/api/integrations/freshsales/accounts',require(_0x0433('0xc2')));_0x5751fa[_0x0433('0x1b')]('/api/integrations/freshsales/configurations',require(_0x0433('0xc3')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xc4'),require(_0x0433('0xc5')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xc6'),require(_0x0433('0xc7')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xc8'),require(_0x0433('0xc9')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xca'),require(_0x0433('0xcb')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xcc'),require(_0x0433('0xcd')));_0x5751fa[_0x0433('0x1b')]('/api/jscripty/questions/reports',require(_0x0433('0xce')));_0x5751fa[_0x0433('0x1b')]('/api/jscripty/sessions/reports',require(_0x0433('0xcf')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xd0'),require('./api/smsQueueReport'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xd1'),require(_0x0433('0xd2')));_0x5751fa['use'](_0x0433('0xd3'),require('./api/squareReportDetail'));_0x5751fa[_0x0433('0x1b')]('/api/jscripty/projects',require(_0x0433('0xd4')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xd5'),require(_0x0433('0xd6')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xd7'),require(_0x0433('0xd8')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xd9'),require('./api/squareProject'));_0x5751fa[_0x0433('0x1b')]('/api/square/recordings',require('./api/squareRecording'));_0x5751fa['use'](_0x0433('0xda'),require(_0x0433('0xdb')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xdc'),require(_0x0433('0xdd')));_0x5751fa['use'](_0x0433('0xde'),require(_0x0433('0xdf')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xe0'),require(_0x0433('0xe1')));_0x5751fa['use'](_0x0433('0xe2'),require(_0x0433('0xe3')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xe4'),require(_0x0433('0xe5')));_0x5751fa['use'](_0x0433('0xe6'),require(_0x0433('0xe7')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xe8'),require(_0x0433('0xe9')));_0x5751fa['use'](_0x0433('0xea'),require(_0x0433('0xeb')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xec'),require(_0x0433('0xed')));_0x5751fa['use'](_0x0433('0xee'),require(_0x0433('0xef')));_0x5751fa['use'](_0x0433('0xf0'),require(_0x0433('0xf1')));_0x5751fa[_0x0433('0x1b')]('/api/cm/lists',require('./api/cmList'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xf2'),require(_0x0433('0xf3')));_0x5751fa[_0x0433('0x1b')]('/api/userProfiles',require('./api/userProfile'));_0x5751fa['use']('/api/userProfile/sections',require(_0x0433('0xf4')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xf5'),require('./api/userProfileResource'));_0x5751fa[_0x0433('0x1b')]('/api/userNotifications',require('./api/userNotification'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xf6'),require('./api/whatsappAccount'));_0x5751fa[_0x0433('0x1b')]('/api/whatsapp/applications',require(_0x0433('0xf7')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xf8'),require('./api/whatsappInteraction'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xf9'),require(_0x0433('0xfa')));_0x5751fa['use']('/api/whatsapp/reports/queue',require(_0x0433('0xfb')));_0x5751fa[_0x0433('0x1b')](_0x0433('0xfc'),require('./api/whatsappTransferReport'));_0x5751fa['use'](_0x0433('0xfd'),require('./api/whatsappQueue'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xfe'),require('./api/cloudProvider'));_0x5751fa[_0x0433('0x1b')](_0x0433('0xff'),require(_0x0433('0x100')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x101'),require(_0x0433('0x102')));_0x5751fa['use'](_0x0433('0x103'),require(_0x0433('0x104')));_0x5751fa[_0x0433('0x1b')]('/api/auth/activedirectory',require(_0x0433('0x105')));_0x5751fa['use'](_0x0433('0x106'),require(_0x0433('0x107')));_0x5751fa[_0x0433('0x1b')]('/api/rpc',require(_0x0433('0x108')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x109'),require(_0x0433('0x10a')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x10b'),require(_0x0433('0x10c')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x10d'),require(_0x0433('0x10e')));_0x5751fa[_0x0433('0x1b')](_0x0433('0x10f'),require(_0x0433('0x110')));_0x5751fa['use'](_0x0433('0x111'),express[_0x0433('0x112')](path['join'](config[_0x0433('0x113')],_0x0433('0x111'))));_0x5751fa[_0x0433('0x1b')]('/www',express[_0x0433('0x112')](path[_0x0433('0x114')](config['root'],_0x0433('0x115'))));_0x5751fa[_0x0433('0x1b')](_0x0433('0x116'),express['static'](path[_0x0433('0x114')](config[_0x0433('0x113')],_0x0433('0x116'))));_0x5751fa[_0x0433('0x1b')](_0x0433('0x117'),express[_0x0433('0x112')](path[_0x0433('0x114')](config['root'],'snippet',_0x0433('0x118'))));_0x5751fa[_0x0433('0x1b')](_0x0433('0x119'),express[_0x0433('0x112')](path[_0x0433('0x114')](config[_0x0433('0x113')],_0x0433('0x11a'))));_0x5751fa['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0433('0x11b')](errors[0x194]);_0x5751fa[_0x0433('0x11c')]('/*')['get'](function(_0x2aae5f,_0x12f2bd){_0x12f2bd[_0x0433('0x11d')](path[_0x0433('0x11e')](_0x5751fa['get'](_0x0433('0x11f'))+'/index.html'));});};var sensitiveFields=[_0x0433('0x120'),'password',_0x0433('0x121'),'apiKey',_0x0433('0x122'),'lastName',_0x0433('0x123'),_0x0433('0x124'),_0x0433('0x125'),_0x0433('0x126'),_0x0433('0x127'),_0x0433('0x128'),_0x0433('0x129'),_0x0433('0x12a'),_0x0433('0x12b'),_0x0433('0x12c'),'tenantId',_0x0433('0x12d'),'channelSecret',_0x0433('0x12e'),_0x0433('0x12f'),_0x0433('0x130'),_0x0433('0x131'),_0x0433('0x132'),_0x0433('0x133'),_0x0433('0x134'),_0x0433('0x135'),_0x0433('0x136'),_0x0433('0x137'),'clientEmail',_0x0433('0x138'),_0x0433('0x139'),_0x0433('0x13a'),'key',_0x0433('0x17'),_0x0433('0x13b'),'accountSid',_0x0433('0x13c'),_0x0433('0x13d'),_0x0433('0x13e'),_0x0433('0x13f'),_0x0433('0x140')];function maskSensitiveData(_0xdc21c7){var _0x4f99ad=/(?!^)[\s\S](?!$)/g;if(!_[_0x0433('0x141')](_0xdc21c7))return;for(var _0x37bea4 in _0xdc21c7){if(_[_0x0433('0x142')](_0xdc21c7[_0x37bea4])){for(var _0x1fcce1=0x0;_0x1fcce1<_0xdc21c7[_0x37bea4]['length'];_0x1fcce1++){maskSensitiveData(_0xdc21c7[_0x37bea4][_0x1fcce1]);}}else if(_['isPlainObject'](_0xdc21c7[_0x37bea4])){maskSensitiveData(_0xdc21c7[_0x37bea4]);}else if(_[_0x0433('0x143')](_0xdc21c7[_0x37bea4])){_0xdc21c7[_0x37bea4]=_0xdc21c7[_0x37bea4]['replace'](/{{{/g,_0x0433('0x144'))[_0x0433('0x145')](/}}}/g,_0x0433('0x146'))[_0x0433('0x145')](/{{/g,'@{')[_0x0433('0x145')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x37bea4)){_0xdc21c7[_0x37bea4]=_0xdc21c7[_0x37bea4][_0x0433('0x145')](_0x4f99ad,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 77b7cce..a7fb1da 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f06=['merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen'];(function(_0x597858,_0x1a459e){var _0x1e37c9=function(_0x32361a){while(--_0x32361a){_0x597858['push'](_0x597858['shift']());}};_0x1e37c9(++_0x1a459e);}(_0x4f06,0x83));var _0x64f0=function(_0xcca50b,_0x115cf5){_0xcca50b=_0xcca50b-0x0;var _0x35d52a=_0x4f06[_0xcca50b];return _0x35d52a;};'use strict';var jayson=require(_0x64f0('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x64f0('0x1'));exports[_0x64f0('0x2')]=function(){return new BPromise(function(_0x543ae6,_0x53a323){var _0x1dc254={};_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x4')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x5')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x6')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x7')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x8')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x9')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0xa')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0xb')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0xc')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1dc254=_['merge'](_0x1dc254,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0xd')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0xe')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0xf')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x10')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x11')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x12')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x13')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x14')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/faxApplication/faxApplication.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/faxInteraction/faxInteraction.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x15')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x16')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x17')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x18')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/smsInteraction/smsInteraction.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x19')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x1a')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x1b')));_0x1dc254=_['merge'](_0x1dc254,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x1c')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x1d')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x1e')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x1f')));_0x1dc254=_['merge'](_0x1dc254,require('../api/chatMessage/chatMessage.rpc'));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x20')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x21')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x22')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x23')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1dc254=_['merge'](_0x1dc254,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x24')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x25')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x26')));_0x1dc254=_['merge'](_0x1dc254,require('../api/template/template.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x27')));_0x1dc254=_['merge'](_0x1dc254,require('../api/variable/variable.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x28')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x29')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2a')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2b')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2c')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2d')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2e')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x2f')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x30')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x31')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/squareReport/squareReport.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/setting/setting.rpc'));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x32')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x33')));_0x1dc254=_['merge'](_0x1dc254,require(_0x64f0('0x34')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x35')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x36')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/attachment/attachment.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x37')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x38')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x39')));_0x1dc254=_[_0x64f0('0x3')](_0x1dc254,require(_0x64f0('0x3a')));var _0x569e6f=jayson[_0x64f0('0x3b')](_0x1dc254)['http']();var _0x2318ba=config[_0x64f0('0x3c')][_0x64f0('0x3d')]||config[_0x64f0('0x3d')]+0x1;var _0x4764ac=config['rpc']['ip']||_0x64f0('0x3e');_0x569e6f['on']('error',function(_0x27d51e){return _0x53a323(_0x27d51e);});_0x569e6f[_0x64f0('0x2')](_0x2318ba,_0x4764ac,function(){console[_0x64f0('0x3f')](_0x64f0('0x40'),_0x4764ac,_0x2318ba);require(_0x64f0('0x41'))['default']();return _0x543ae6(_0x64f0('0x42')+_0x4764ac+':'+_0x2318ba);});});}; \ No newline at end of file +var _0x2218=['../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.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/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x2218,0x1e7));var _0x8221=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0x2218[_0x38c632];return _0x12737e;};'use strict';var jayson=require(_0x8221('0x0'));var BPromise=require(_0x8221('0x1'));var _=require(_0x8221('0x2'));var config=require('../config/environment');exports[_0x8221('0x3')]=function(){return new BPromise(function(_0x551f0e,_0x997f05){var _0x51b327={};_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x5')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x6')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x7')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x8')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x9')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0xa')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0xb')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/memberReport/memberReport.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0xc')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0xd')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0xe')));_0x51b327=_['merge'](_0x51b327,require('../api/mailServerIn/mailServerIn.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0xf')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x10')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x11')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x12')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x13')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x14')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x15')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x16')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x17')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x18')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x19')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x1a')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x1b')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x1c')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x1d')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x1e')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x1f')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x20')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x21')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x22')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x23')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x24')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/cmHopper/cmHopper.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x25')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x26')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x27')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x28')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/interval/interval.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x29')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2a')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2b')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2c')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2d')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2e')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x2f')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x30')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x31')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x32')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x33')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x34')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x35')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x36')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x37')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x38')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x39')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x3a')));_0x51b327=_['merge'](_0x51b327,require('../api/setting/setting.rpc'));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x3b')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x3c')));_0x51b327=_['merge'](_0x51b327,require('../api/squareRecording/squareRecording.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x3d')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/campaign/campaign.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x3e')));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x3f')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x40')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x51b327=_['merge'](_0x51b327,require(_0x8221('0x41')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require(_0x8221('0x42')));_0x51b327=_[_0x8221('0x4')](_0x51b327,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3f7fe0=jayson[_0x8221('0x43')](_0x51b327)[_0x8221('0x44')]();var _0x2f3fe3=config[_0x8221('0x45')][_0x8221('0x46')]||config[_0x8221('0x46')]+0x1;var _0x3a9af1=config[_0x8221('0x45')]['ip']||_0x8221('0x47');_0x3f7fe0['on'](_0x8221('0x48'),function(_0x44028f){return _0x997f05(_0x44028f);});_0x3f7fe0[_0x8221('0x3')](_0x2f3fe3,_0x3a9af1,function(){console[_0x8221('0x49')](_0x8221('0x4a'),_0x3a9af1,_0x2f3fe3);require('../config/triggers')['default']();return _0x551f0e(_0x8221('0x4b')+_0x3a9af1+':'+_0x2f3fe3);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 9224adc..4371b68 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x4a67f5,_0x1f89fd){var _0x2934bb=function(_0x58f8b8){while(--_0x58f8b8){_0x4a67f5['push'](_0x4a67f5['shift']());}};_0x2934bb(++_0x1f89fd);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file +var _0x93e9=['string','map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}'];(function(_0x279db8,_0x9d9cff){var _0x39033d=function(_0x47b60d){while(--_0x47b60d){_0x279db8['push'](_0x279db8['shift']());}};_0x39033d(++_0x9d9cff);}(_0x93e9,0xcc));var _0x993e=function(_0x51ba7c,_0x3dfabd){_0x51ba7c=_0x51ba7c-0x0;var _0x43704b=_0x93e9[_0x51ba7c];return _0x43704b;};var _=require(_0x993e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xcf3bfd){return _0xcf3bfd==='{{'?_0x993e('0x1'):_0x993e('0x2');}function safeTemplate(_0x43b7b0){var _0x2a63eb=_0x43b7b0;if(typeof _0x43b7b0===_0x993e('0x3')){_0x2a63eb=_0x43b7b0['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x43b7b0)){_0x2a63eb=_0x43b7b0[_0x993e('0x4')](function(_0x255045){return safeTemplate(_0x255045);});}else if(_[_0x993e('0x5')](_0x43b7b0)){_0x2a63eb=Object[_0x993e('0x6')](_0x43b7b0)[_0x993e('0x7')](function(_0x2366d9,_0x12ac94){_0x2366d9[_0x12ac94]=safeTemplate(_0x43b7b0[_0x12ac94]);return _0x2366d9;},{});}return _0x2a63eb;}module[_0x993e('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index dfb8431..a112692 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 _0x5031=['util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','sendRequest','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','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','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports'];(function(_0x5ec5af,_0x462d57){var _0x4d5caf=function(_0x3ca914){while(--_0x3ca914){_0x5ec5af['push'](_0x5ec5af['shift']());}};_0x4d5caf(++_0x462d57);}(_0x5031,0x144));var _0x1503=function(_0x1e2e61,_0x315809){_0x1e2e61=_0x1e2e61-0x0;var _0x2d1017=_0x5031[_0x1e2e61];return _0x2d1017;};'use strict';var util=require(_0x1503('0x0'));var _=require(_0x1503('0x1'));var EventEmitter=require(_0x1503('0x2'))[_0x1503('0x3')];var AGIReply=require(_0x1503('0x4'));var AGIError=require('./error');function AGIChannel(_0x58700c){var _0x45836d=this,_0x29353e=new AGIReply(),_0x175a7e=![],_0x15bcbe={};EventEmitter[_0x1503('0x5')](_0x45836d);_0x58700c[_0x1503('0x6')](_0x1503('0x7'));_0x58700c[_0x1503('0x8')](0x8*0x3c*0x3c*0x3e8);_0x29353e[_0x1503('0x6')]('utf8');_0x29353e['on'](_0x1503('0x9'),function(_0x2dddb6){for(var _0x4f9f5e in _0x2dddb6){_0x45836d[_0x4f9f5e]=_0x2dddb6[_0x4f9f5e];}_0x45836d[_0x1503('0xa')](_0x1503('0xb'));});_0x29353e['on'](_0x1503('0xc'),function(_0xef165d){if(_0xef165d[_0x1503('0xd')]()==_0x1503('0xe')){_0x45836d[_0x1503('0xa')](_0x1503('0xe'));return;}if(_0xef165d[_0x1503('0xf')](0x0,0xb)==_0x1503('0x10')){_0x175a7e=!![];}if(_0x175a7e){_0x15bcbe['rx']+=_0xef165d+'\x0a';if(_0xef165d['search'](_0x1503('0x11'))!=-0x1){_0x175a7e=![];}}else{_0x15bcbe['rx']=_0xef165d;}if(_0x175a7e){return;}if(typeof _0x15bcbe['cb']==_0x1503('0x12')){var _0x178564=_0x15bcbe['rx']['substring'](0x0,0x3),_0x3431be=null,_0x3fd873=null;_0x178564=parseInt(_0x178564);if(isNaN(_0x178564)){_0x15bcbe['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1503('0x13')});return;}if(_0x178564!=0xc8){_0x15bcbe['cb'](null,{'code':_0x178564,'result':-0x1,'extra':'KO'});return;}_0x3431be=_0x15bcbe['rx'][_0x1503('0xf')](0x4)[_0x1503('0x14')](_0x1503('0x15'),'');if(_0x3431be[_0x1503('0x16')]('\x20')!=-0x1){_0x3431be=_0x3431be[_0x1503('0x17')](0x0,_0x3431be[_0x1503('0x16')]('\x20'));}if(_[_0x1503('0x18')](_0x3431be,'-1')){_0x3431be=parseInt(_0x3431be);}_0x3fd873=_0x15bcbe['rx'][_0x1503('0x19')]('\x20');if(_0x3fd873[_0x1503('0x1a')]==0x3){_0x3fd873=_0x3fd873[0x2][_0x1503('0xf')](0x1,_0x3fd873[0x2][_0x1503('0x1a')]-0x1);}else if(_0x3fd873[_0x1503('0x1a')]>0x3){var _0x33dae9=/\((.+)\)/;var _0x350563=_0x15bcbe['rx'][_0x1503('0x1b')](_0x33dae9);if(_0x350563){_0x3fd873=_0x350563[0x1];}else{_0x3fd873=null;}}else{_0x3fd873=null;}_0x15bcbe['cb'](null,{'code':_0x178564,'result':_0x3431be,'extra':_0x3fd873});}});_0x58700c['on'](_0x1503('0x1c'),function(_0x3dc3c5){_0x45836d[_0x1503('0xa')]('error',new AGIError(_0x1503('0x1d'),_0x3dc3c5[_0x1503('0x1e')]));});_0x58700c['on'](_0x1503('0x1f'),function(){_0x45836d[_0x1503('0xa')](_0x1503('0x1f'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x58700c['on']('timeout',function(){_0x45836d['emit']('timeout',new AGIError(_0x1503('0x20')));_0x58700c[_0x1503('0x21')]();});_0x58700c[_0x1503('0x22')](_0x29353e);this[_0x1503('0x23')]=function(_0x5d0e02,_0xcf9963){var _0x5d0e02=_0x5d0e02||'',_0xcf9963=typeof _0xcf9963==_0x1503('0x12')?_0xcf9963:new Function();_0x15bcbe={'tx':_0x5d0e02,'rx':'','cb':_0xcf9963};_0x58700c[_0x1503('0x24')](_0x5d0e02+'\x0a');},this[_0x1503('0x1f')]=function(){_0x58700c[_0x1503('0x21')]();};}util[_0x1503('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x1503('0x26')]['sendRequest']=function(_0x292097){return this['command'][_0x1503('0x27')](this,_0x292097);};AGIChannel[_0x1503('0x26')][_0x1503('0x28')]=function(){return this[_0x1503('0x29')]('ANSWER');};AGIChannel[_0x1503('0x26')][_0x1503('0x2a')]=function(_0x1116b0,_0x322b6e,_0x366d14){_0x1116b0=_0x1116b0===undefined?_0x1503('0x2b'):_0x1116b0;_0x322b6e=_0x322b6e===undefined?'5':_0x322b6e;_0x366d14=_0x366d14===undefined?'1':_0x366d14;return this['sendRequest'](util[_0x1503('0x2c')](_0x1503('0x2d'),_0x1116b0,_0x322b6e*0x3e8,_0x366d14));};AGIChannel[_0x1503('0x26')][_0x1503('0x2e')]=function(_0x339a11){_0x339a11=_0x339a11||_0x1503('0x2f');return this[_0x1503('0x29')](util[_0x1503('0x2c')](_0x1503('0x30'),_0x339a11));};AGIChannel[_0x1503('0x26')]['exec']=function(_0xf5bddd,_0x1ea152){if(_[_0x1503('0x31')](_0x1ea152)){return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0xf5bddd,_0x1ea152[_0x1503('0x32')](',')));}return this['sendRequest'](util['format'](_0x1503('0x33'),_0xf5bddd,_0x1ea152));};AGIChannel[_0x1503('0x26')][_0x1503('0x34')]=function(_0x2220bf){return this['sendRequest'](util[_0x1503('0x2c')]('SET\x20CONTEXT\x20%s',_0x2220bf));};AGIChannel[_0x1503('0x26')][_0x1503('0x35')]=function(_0x20ef3c){return this[_0x1503('0x29')](util['format'](_0x1503('0x36'),_0x20ef3c));};AGIChannel[_0x1503('0x26')]['setPriority']=function(_0x3f3782){return this[_0x1503('0x29')](util['format'](_0x1503('0x37'),_0x3f3782));};AGIChannel[_0x1503('0x26')][_0x1503('0xe')]=function(){return this[_0x1503('0x29')]('HANGUP');};AGIChannel[_0x1503('0x26')][_0x1503('0x38')]=function(_0xee0742,_0x401ab5){var _0x146915=_['isBoolean'](_0x401ab5)||_[_0x1503('0x39')](_0x401ab5)?_0x401ab5[_0x1503('0x3a')]():_0x401ab5;return this['sendRequest'](util[_0x1503('0x2c')](_0x1503('0x3b'),_0xee0742,_0x146915?_0x146915[_0x1503('0x3a')]()[_0x1503('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1e4fc6,_0x19b41e){return this[_0x1503('0x29')](util[_0x1503('0x2c')](_0x1503('0x3c'),_0x1e4fc6,_0x19b41e));};AGIChannel[_0x1503('0x26')][_0x1503('0x3d')]=function(_0xbf77a5,_0x410a38){return this[_0x1503('0x29')](util[_0x1503('0x2c')](_0x1503('0x3e'),_0xbf77a5,_0x410a38));};AGIChannel[_0x1503('0x26')][_0x1503('0x3f')]=function(_0x264e54,_0x22ff43){return this['sendRequest'](util['format'](_0x1503('0x40'),_0x264e54,_0x22ff43));};AGIChannel[_0x1503('0x26')][_0x1503('0x41')]=function(_0x399f2d,_0x2b2bf3,_0x1978be){_0x2b2bf3=_0x2b2bf3||this['extension'];_0x1978be=_0x1978be||0x1;this['setContext'](_0x399f2d);this[_0x1503('0x35')](_0x2b2bf3);this[_0x1503('0x42')](_0x1978be);return this['noop'](util[_0x1503('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x399f2d,_0x2b2bf3,_0x1978be));};AGIChannel[_0x1503('0x26')][_0x1503('0x43')]=function(_0x501340){return this['sendRequest'](util[_0x1503('0x2c')](_0x1503('0x44'),_0x501340));};AGIChannel['prototype'][_0x1503('0x45')]=function(_0x504163,_0x5bfa96,_0x25ae6f,_0x5dccd1,_0x3e9fbe,_0x2efb4f){_0x5bfa96=_0x5bfa96||_0x1503('0x46');_0x25ae6f=_0x25ae6f||'';_0x5dccd1=_0x5dccd1===undefined?-0x1:_0x5dccd1==='-1'?-0x1:_0x5dccd1*0x3e8;_0x3e9fbe=_0x3e9fbe===undefined?'':'s='+_0x3e9fbe;_0x2efb4f=_0x2efb4f?_0x1503('0x47'):'';return this[_0x1503('0x29')](util[_0x1503('0x2c')](_0x1503('0x48'),_0x504163,_0x5bfa96,_0x25ae6f,_0x5dccd1,_0x2efb4f,_0x3e9fbe));};AGIChannel['prototype']['streamFile']=function(_0xaae80c,_0x266764){_0x266764=_0x266764||'';return this['sendRequest'](util[_0x1503('0x2c')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xaae80c,_0x266764));};AGIChannel[_0x1503('0x26')][_0x1503('0x49')]=function(_0x715d0f){return this[_0x1503('0x4a')](_0x1503('0x4b'),_0x715d0f);};AGIChannel[_0x1503('0x26')][_0x1503('0x4c')]=function(_0x552ed2){return this[_0x1503('0x4a')](_0x1503('0x4d'),_0x552ed2);};AGIChannel[_0x1503('0x26')][_0x1503('0x1c')]=function(_0x7ebe4a,_0xd968c1){this[_0x1503('0x2e')](util[_0x1503('0x2c')](_0x1503('0x4e'),_0x7ebe4a['id'],_0x7ebe4a[_0x1503('0x4f')],_0xd968c1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1503('0x50')]=AGIChannel; \ No newline at end of file +var _0xb288=['ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','destroy','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','format','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait'];(function(_0x566a69,_0x1ddac7){var _0x532c1a=function(_0x114646){while(--_0x114646){_0x566a69['push'](_0x566a69['shift']());}};_0x532c1a(++_0x1ddac7);}(_0xb288,0x1b3));var _0x8b28=function(_0x384bf6,_0x3eb599){_0x384bf6=_0x384bf6-0x0;var _0x10e7ef=_0xb288[_0x384bf6];return _0x10e7ef;};'use strict';var util=require(_0x8b28('0x0'));var _=require(_0x8b28('0x1'));var EventEmitter=require(_0x8b28('0x2'))['EventEmitter'];var AGIReply=require(_0x8b28('0x3'));var AGIError=require(_0x8b28('0x4'));function AGIChannel(_0x2e17f7){var _0x3a8574=this,_0x443864=new AGIReply(),_0x8a325b=![],_0x49477f={};EventEmitter[_0x8b28('0x5')](_0x3a8574);_0x2e17f7[_0x8b28('0x6')](_0x8b28('0x7'));_0x2e17f7[_0x8b28('0x8')](0x8*0x3c*0x3c*0x3e8);_0x443864['setEncoding'](_0x8b28('0x7'));_0x443864['on']('headers',function(_0x36c8b2){for(var _0x5a3b56 in _0x36c8b2){_0x3a8574[_0x5a3b56]=_0x36c8b2[_0x5a3b56];}_0x3a8574[_0x8b28('0x9')](_0x8b28('0xa'));});_0x443864['on'](_0x8b28('0xb'),function(_0x28f309){if(_0x28f309[_0x8b28('0xc')]()==_0x8b28('0xd')){_0x3a8574[_0x8b28('0x9')](_0x8b28('0xd'));return;}if(_0x28f309[_0x8b28('0xe')](0x0,0xb)=='520-Invalid'){_0x8a325b=!![];}if(_0x8a325b){_0x49477f['rx']+=_0x28f309+'\x0a';if(_0x28f309['search'](_0x8b28('0xf'))!=-0x1){_0x8a325b=![];}}else{_0x49477f['rx']=_0x28f309;}if(_0x8a325b){return;}if(typeof _0x49477f['cb']==_0x8b28('0x10')){var _0x4618d0=_0x49477f['rx'][_0x8b28('0xe')](0x0,0x3),_0x97887b=null,_0x58875e=null;_0x4618d0=parseInt(_0x4618d0);if(isNaN(_0x4618d0)){_0x49477f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8b28('0x11')});return;}if(_0x4618d0!=0xc8){_0x49477f['cb'](null,{'code':_0x4618d0,'result':-0x1,'extra':'KO'});return;}_0x97887b=_0x49477f['rx']['substring'](0x4)[_0x8b28('0x12')](_0x8b28('0x13'),'');if(_0x97887b['indexOf']('\x20')!=-0x1){_0x97887b=_0x97887b['substr'](0x0,_0x97887b['indexOf']('\x20'));}if(_['startsWith'](_0x97887b,'-1')){_0x97887b=parseInt(_0x97887b);}_0x58875e=_0x49477f['rx']['split']('\x20');if(_0x58875e[_0x8b28('0x14')]==0x3){_0x58875e=_0x58875e[0x2][_0x8b28('0xe')](0x1,_0x58875e[0x2][_0x8b28('0x14')]-0x1);}else if(_0x58875e[_0x8b28('0x14')]>0x3){var _0x3daf05=/\((.+)\)/;var _0x1b8f6d=_0x49477f['rx'][_0x8b28('0x15')](_0x3daf05);if(_0x1b8f6d){_0x58875e=_0x1b8f6d[0x1];}else{_0x58875e=null;}}else{_0x58875e=null;}_0x49477f['cb'](null,{'code':_0x4618d0,'result':_0x97887b,'extra':_0x58875e});}});_0x2e17f7['on']('error',function(_0x4102ac){_0x3a8574['emit'](_0x8b28('0x16'),new AGIError(_0x8b28('0x17'),_0x4102ac['code']));});_0x2e17f7['on'](_0x8b28('0x18'),function(){_0x3a8574[_0x8b28('0x9')](_0x8b28('0x18'),new AGIError(_0x8b28('0x19')));});_0x2e17f7['on'](_0x8b28('0x1a'),function(){_0x3a8574[_0x8b28('0x9')](_0x8b28('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2e17f7['destroy']();});_0x2e17f7[_0x8b28('0x1b')](_0x443864);this[_0x8b28('0x1c')]=function(_0x40d653,_0x4f6345){var _0x40d653=_0x40d653||'',_0x4f6345=typeof _0x4f6345==_0x8b28('0x10')?_0x4f6345:new Function();_0x49477f={'tx':_0x40d653,'rx':'','cb':_0x4f6345};_0x2e17f7[_0x8b28('0x1d')](_0x40d653+'\x0a');},this[_0x8b28('0x18')]=function(){_0x2e17f7[_0x8b28('0x1e')]();};}util[_0x8b28('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x8b28('0x20')]=function(_0x568d56){return this[_0x8b28('0x1c')][_0x8b28('0x21')](this,_0x568d56);};AGIChannel[_0x8b28('0x22')][_0x8b28('0x23')]=function(){return this[_0x8b28('0x20')](_0x8b28('0x24'));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x25')]=function(_0x269487,_0x1c4488,_0xac84c3){_0x269487=_0x269487===undefined?_0x8b28('0x26'):_0x269487;_0x1c4488=_0x1c4488===undefined?'5':_0x1c4488;_0xac84c3=_0xac84c3===undefined?'1':_0xac84c3;return this[_0x8b28('0x20')](util['format'](_0x8b28('0x27'),_0x269487,_0x1c4488*0x3e8,_0xac84c3));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x28')]=function(_0x37dc79){_0x37dc79=_0x37dc79||'NO\x20MESSAGE';return this[_0x8b28('0x20')](util['format']('VERBOSE\x20\x22%s\x22',_0x37dc79));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x29')]=function(_0x45ce5f,_0x2f768c){if(_['isArray'](_0x2f768c)){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x2b'),_0x45ce5f,_0x2f768c['join'](',')));}return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x2b'),_0x45ce5f,_0x2f768c));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x2c')]=function(_0x38fdca){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x2d'),_0x38fdca));};AGIChannel['prototype'][_0x8b28('0x2e')]=function(_0x431fb4){return this['sendRequest'](util[_0x8b28('0x2a')](_0x8b28('0x2f'),_0x431fb4));};AGIChannel['prototype'][_0x8b28('0x30')]=function(_0x3f255d){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x31'),_0x3f255d));};AGIChannel[_0x8b28('0x22')]['hangup']=function(){return this[_0x8b28('0x20')](_0x8b28('0x32'));};AGIChannel[_0x8b28('0x22')]['setVariable']=function(_0x1ff4fb,_0x1c2ded){var _0x11a08f=_['isBoolean'](_0x1c2ded)||_[_0x8b28('0x33')](_0x1c2ded)?_0x1c2ded[_0x8b28('0x34')]():_0x1c2ded;return this[_0x8b28('0x20')](util[_0x8b28('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1ff4fb,_0x11a08f?_0x11a08f[_0x8b28('0x34')]()[_0x8b28('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x35')]=function(_0x165714,_0x82eaae){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x36'),_0x165714,_0x82eaae));};AGIChannel['prototype'][_0x8b28('0x37')]=function(_0x2e1490,_0x1d8042){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x38'),_0x2e1490,_0x1d8042));};AGIChannel['prototype'][_0x8b28('0x39')]=function(_0x37763b,_0x2e1a0d){return this[_0x8b28('0x20')](util['format'](_0x8b28('0x3a'),_0x37763b,_0x2e1a0d));};AGIChannel['prototype'][_0x8b28('0x3b')]=function(_0x5322de,_0x1ca916,_0x45c459){_0x1ca916=_0x1ca916||this['extension'];_0x45c459=_0x45c459||0x1;this['setContext'](_0x5322de);this['setExtension'](_0x1ca916);this[_0x8b28('0x30')](_0x45c459);return this[_0x8b28('0x28')](util[_0x8b28('0x2a')](_0x8b28('0x3c'),_0x5322de,_0x1ca916,_0x45c459));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x3d')]=function(_0x357acb){return this[_0x8b28('0x20')](util[_0x8b28('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x357acb));};AGIChannel[_0x8b28('0x22')][_0x8b28('0x3e')]=function(_0x5b54a4,_0x323bfe,_0x21f404,_0x35dc6a,_0xea9cd2,_0x4cf016){_0x323bfe=_0x323bfe||'wav';_0x21f404=_0x21f404||'';_0x35dc6a=_0x35dc6a===undefined?-0x1:_0x35dc6a==='-1'?-0x1:_0x35dc6a*0x3e8;_0xea9cd2=_0xea9cd2===undefined?'':'s='+_0xea9cd2;_0x4cf016=_0x4cf016?_0x8b28('0x3f'):'';return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x40'),_0x5b54a4,_0x323bfe,_0x21f404,_0x35dc6a,_0x4cf016,_0xea9cd2));};AGIChannel['prototype'][_0x8b28('0x41')]=function(_0x5c8181,_0x57d543){_0x57d543=_0x57d543||'';return this[_0x8b28('0x20')](util[_0x8b28('0x2a')](_0x8b28('0x42'),_0x5c8181,_0x57d543));};AGIChannel[_0x8b28('0x22')]['agi']=function(_0x31270f){return this[_0x8b28('0x29')](_0x8b28('0x43'),_0x31270f);};AGIChannel['prototype'][_0x8b28('0x44')]=function(_0xac2e3e){return this[_0x8b28('0x29')]('WAIT',_0xac2e3e);};AGIChannel[_0x8b28('0x22')][_0x8b28('0x16')]=function(_0x77139b,_0x38186a){this['noop'](util[_0x8b28('0x2a')](_0x8b28('0x45'),_0x77139b['id'],_0x77139b[_0x8b28('0x46')],_0x38186a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8b28('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 748fad8..cd60c57 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 _0x0db0=['apply','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x2775af,_0x404eb0){var _0x40e341=function(_0x3d20e4){while(--_0x3d20e4){_0x2775af['push'](_0x2775af['shift']());}};_0x40e341(++_0x404eb0);}(_0x0db0,0x10b));var _0x00db=function(_0x746739,_0x289561){_0x746739=_0x746739-0x0;var _0x4b7447=_0x0db0[_0x746739];return _0x4b7447;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x00db('0x0'),'E_AGI_ARGUMENT_PORT':_0x00db('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x00db('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x00db('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x00db('0x4'),'E_AGI_SOCKET_ERROR':_0x00db('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x00db('0x6'),'E_AGI_COMMAND_EMPTY':_0x00db('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x00db('0x8'),'E_AGI_IVR_ENTRY':_0x00db('0x9')};function AGIError(_0x442de0){var _0x442de0=_0x442de0||null,_0x1481bb=_0x1481bb||[],_0x443e52=0x1,_0x145f54='';if(!error[_0x442de0]){_0x442de0=_0x00db('0xa');}_0x1481bb['push'](error[_0x442de0]);while(arguments[_0x443e52]){_0x1481bb[_0x00db('0xb')](arguments[_0x443e52]);_0x443e52++;}_0x145f54=util[_0x00db('0xc')][_0x00db('0xd')](util,_0x1481bb);this['message']=_0x145f54;this['name']=_0x442de0;}module['exports']=AGIError; \ No newline at end of file +var _0x3ea6=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x2bc501,_0x13aa6d){var _0xb54923=function(_0x46c7f4){while(--_0x46c7f4){_0x2bc501['push'](_0x2bc501['shift']());}};_0xb54923(++_0x13aa6d);}(_0x3ea6,0x136));var _0x63ea=function(_0x53287e,_0x12a492){_0x53287e=_0x53287e-0x0;var _0x165e26=_0x3ea6[_0x53287e];return _0x165e26;};'use strict';var util=require(_0x63ea('0x0'));var error={'E_AGI_UNDEFINED':_0x63ea('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x63ea('0x2'),'E_AGI_SERVER_CLOSE':_0x63ea('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x63ea('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x63ea('0x5'),'E_AGI_SOCKET_ERROR':_0x63ea('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x63ea('0x7'),'E_AGI_COMMAND_EMPTY':_0x63ea('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x63ea('0x9')};function AGIError(_0x22f7c5){var _0x22f7c5=_0x22f7c5||null,_0x7d5f60=_0x7d5f60||[],_0x3a85ad=0x1,_0x145f86='';if(!error[_0x22f7c5]){_0x22f7c5=_0x63ea('0xa');}_0x7d5f60[_0x63ea('0xb')](error[_0x22f7c5]);while(arguments[_0x3a85ad]){_0x7d5f60[_0x63ea('0xb')](arguments[_0x3a85ad]);_0x3a85ad++;}_0x145f86=util[_0x63ea('0xc')]['apply'](util,_0x7d5f60);this['message']=_0x145f86;this[_0x63ea('0xd')]=_0x22f7c5;}module[_0x63ea('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index a22066e..fb0405f 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 _0x11ee=['no\x20edge/s\x20available','condition','split','agicommand','target','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','edges','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11ee,0xae));var _0xe11e=function(_0x309a5e,_0x1ec246){_0x309a5e=_0x309a5e-0x0;var _0x1d21f1=_0x11ee[_0x309a5e];return _0x1d21f1;};'use strict';var _=require(_0xe11e('0x0'));var logger=require('../../../config/logger')(_0xe11e('0x1'));var verticesWithRetry=['menu','getdigits',_0xe11e('0x2')];var Graph=function(){this['vertices']={};this['edges']={};this[_0xe11e('0x3')]=0x0;};Graph[_0xe11e('0x4')][_0xe11e('0x5')]=function(_0x31e6af){this[_0xe11e('0x6')][_0x31e6af['id']]=_0x31e6af;this[_0xe11e('0x7')][_0x31e6af['id']]=[];};Graph['prototype']['addEdge']=function(_0x3831c4,_0x4dd04a,_0x5be557){this[_0xe11e('0x7')][_0x3831c4]['push']({'target':_0x4dd04a,'condition':_0x5be557});this[_0xe11e('0x3')]+=0x1;};Graph[_0xe11e('0x4')]['size']=function(){return _['size'](this[_0xe11e('0x6')]);};Graph['prototype'][_0xe11e('0x8')]=function(){return this[_0xe11e('0x3')];};Graph[_0xe11e('0x4')][_0xe11e('0x9')]=function(_0x44cbb9){return this[_0xe11e('0x6')][_0x44cbb9];};Graph[_0xe11e('0x4')][_0xe11e('0xa')]=function(_0x41981f,_0x2f82ae){if(!this[_0xe11e('0x6')][_0x41981f]){return logger[_0xe11e('0xb')](_0xe11e('0xc'));}var _0x2cb2a0=_0x2f82ae(this['vertices'][_0x41981f]);if(!_0x2cb2a0){return logger['info'](_0xe11e('0xd'));}if(this[_0xe11e('0x7')][_0x41981f][_0xe11e('0xe')]===0x0){return logger['info'](_0xe11e('0xf'));}for(var _0x513091=0x0,_0x45fd8d=[],_0x27577b=![];_0x513091\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','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','addEdge','source','value','getSquareProject','then','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','root','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','toString','[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'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x7311,0x112));var _0x1731=function(_0x1ff77b,_0x391cc7){_0x1ff77b=_0x1ff77b-0x0;var _0x4e31ff=_0x7311[_0x1ff77b];return _0x4e31ff;};'use strict';var parser=require('xml2json');var _=require(_0x1731('0x0'));var syncho=require(_0x1731('0x1'));var util=require(_0x1731('0x2'));var moment=require(_0x1731('0x3'));var config=require(_0x1731('0x4'));var logger=require(_0x1731('0x5'))(_0x1731('0x6'));var utilLicense=require(_0x1731('0x7'));var rpc=require('./rpc');var mailRpc=require(_0x1731('0x8'));var Graph=require(_0x1731('0x9'));var Vertices=require(_0x1731('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1731('0x6')]=_[_0x1731('0xb')](config[_0x1731('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x298c58){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x298c58);agiHandler(_0x298c58);}catch(_0x163c00){logger[_0x1731('0xc')](_0x163c00[_0x1731('0xd')]);}});});}function listeningHandler(){console[_0x1731('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1731('0x6')]['port']);logger[_0x1731('0xf')](util[_0x1731('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x1731('0x6')][_0x1731('0x11')]));}function errorHandler(_0x400e6a){if(_0x400e6a&&_0x400e6a[_0x1731('0x12')]&&_0x400e6a[_0x1731('0x13')]){logger[_0x1731('0xc')](util[_0x1731('0x10')]('[%s]\x20%s',_0x400e6a['name'],_0x400e6a[_0x1731('0x13')]));}else{logger[_0x1731('0xc')](util[_0x1731('0x10')](_0x1731('0x14'),_0x400e6a[_0x1731('0xd')]));}}function closeHandler(){logger[_0x1731('0xf')](util['format'](_0x1731('0x15'),this[_0x1731('0x16')],this[_0x1731('0x17')],this[_0x1731('0x18')],this[_0x1731('0x19')],this[_0x1731('0x1a')]));try{createSquareReport(this);}catch(_0x2d4e95){logger[_0x1731('0xc')](_0x2d4e95[_0x1731('0xd')]);}}function timeoutHandler(){logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x1b'),this[_0x1731('0x16')],this['calleridname'],this['callerid'],this[_0x1731('0x19')],this[_0x1731('0x1a')]));}function hangupHandler(){logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x1c'),this[_0x1731('0x16')],this[_0x1731('0x17')],this[_0x1731('0x18')],this['dnid'],this['uniqueid']));this[_0x1731('0x1d')]=!![];}function getRoot(_0x2c22e7){return parser[_0x1731('0x1e')](_0x2c22e7,{'object':!![]})[_0x1731('0x1f')]['root'];}function addVertex(_0x15d32a,_0x5a8ccd,_0x16c05d){_0x5a8ccd[_0x1731('0x20')]=_0x16c05d;if(_0x5a8ccd[_0x1731('0x21')](_0x1731('0x22'))){_0x5a8ccd[_0x1731('0x23')]=parseInt(_0x5a8ccd[_0x1731('0x22')],0xa);}_0x15d32a[_0x1731('0x24')](_[_0x1731('0x25')](_0x5a8ccd,_0x1731('0x26')));}function initGraph(_0x5e13f,_0x3c5bd9){var _0x2b2fda=new Graph();for(var _0x3b0261 in _0x5e13f){if(_0x5e13f[_0x1731('0x21')](_0x3b0261)){if(_['isArray'](_0x5e13f[_0x3b0261])){for(var _0x154d40=0x0;_0x154d40<_0x5e13f[_0x3b0261][_0x1731('0x27')];_0x154d40+=0x1){addVertex(_0x2b2fda,_0x5e13f[_0x3b0261][_0x154d40],_0x3b0261);}}else{addVertex(_0x2b2fda,_0x5e13f[_0x3b0261],_0x3b0261);}}}for(var _0x1a8022=0x0;_0x1a8022<_0x3c5bd9[_0x1731('0x27')];_0x1a8022+=0x1){if(_0x3c5bd9[_0x1a8022]['source']&&_0x3c5bd9[_0x1a8022][_0x1731('0x28')]){_0x2b2fda[_0x1731('0x29')](_0x3c5bd9[_0x1a8022][_0x1731('0x2a')],_0x3c5bd9[_0x1a8022][_0x1731('0x28')],_0x3c5bd9[_0x1a8022][_0x1731('0x2b')]);}}return _0x2b2fda;}function getSquareProject(_0x2d71b0,_0x1e6333){rpc[_0x1731('0x2c')](_0x2d71b0)[_0x1731('0x2d')](function(_0x170423){_0x1e6333(null,_0x170423);})['catch'](function(_0x5357a3){_0x1e6333(null,_0x5357a3);});}function createSquareReport(_0x1d4325,_0x1f434e){rpc['createSquareReport'](_0x1d4325)[_0x1731('0x2d')](function(_0x30ea0b){if(_0x1f434e){_0x1f434e(null,_0x30ea0b);}})['catch'](function(_0x46ead2){if(_0x1f434e){_0x1f434e(null,_0x46ead2);}});}function setChannelVariables(_0x3e249e){for(var _0x132c6b in _0x3e249e){if(_0x3e249e[_0x1731('0x21')](_0x132c6b)){if(_0x132c6b['indexOf']('agi_')===0x0){_0x3e249e[_0x132c6b[_0x1731('0x2e')](0x4)]=_0x3e249e[_0x132c6b];delete _0x3e249e[_0x132c6b];}}}}function getLogFromObject(_0x31d916){return util['inspect'](_0x31d916,{'showHidden':![],'depth':null});}function agiHandler(_0x5d18ab){var _0x56d338,_0x4a5166,_0x54165c,_0x2b0c9b,_0x4697a9;logger[_0x1731('0x2f')]('variables',JSON[_0x1731('0x30')](_0x5d18ab,null,0x2));logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x31'),_0x5d18ab[_0x1731('0x16')],_0x5d18ab[_0x1731('0x17')],_0x5d18ab['callerid'],_0x5d18ab[_0x1731('0x19')],_0x5d18ab['uniqueid']));_0x5d18ab['on'](_0x1731('0xc'),errorHandler);_0x5d18ab['on'](_0x1731('0x32'),closeHandler);_0x5d18ab['on'](_0x1731('0x33'),timeoutHandler);_0x5d18ab['evtHangup']=![];_0x5d18ab['on'](_0x1731('0x34'),hangupHandler);var _0x2dc764=getSquareProject[_0x1731('0x35')](null,_0x5d18ab[_0x1731('0x16')]);if(_0x2dc764){if(_0x2dc764[_0x1731('0x36')]){_0x56d338=getRoot(_0x2dc764[_0x1731('0x36')]);if(_0x56d338&&_0x56d338[_0x1731('0x37')]){logger[_0x1731('0x2f')](_0x1731('0x38'),JSON['stringify'](_0x56d338,null,0x2));_0x5d18ab['joinAt']=moment()[_0x1731('0x10')](_0x1731('0x39'));_0x4a5166=initGraph(_['omit'](_0x56d338,_0x1731('0x26')),_0x56d338[_0x1731('0x26')]);_0x54165c=new Vertices(_0x5d18ab,rpc,mailRpc);logger[_0x1731('0xf')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5d18ab[_0x1731('0x16')],_0x5d18ab[_0x1731('0x17')],_0x5d18ab[_0x1731('0x18')],_0x5d18ab[_0x1731('0x19')],_0x5d18ab[_0x1731('0x1a')]));_0x4a5166[_0x1731('0x3a')](_0x56d338['start']['id'],function(_0x108f91){try{_0x108f91=_0x54165c['clear'](_0x108f91);logger[_0x1731('0x2f')]('vertex',JSON['stringify'](_0x108f91,null,0x2));if(_0x108f91[_0x1731('0x20')]==='gotoc'){logger['info'](_0x1731('0x3b'));_0x5d18ab[_0x1731('0x3c')]=_0x108f91[_0x1731('0x3c')]||_0x5d18ab[_0x1731('0x3c')];_0x5d18ab['extension']=_0x108f91[_0x1731('0x3d')];_0x5d18ab['priority']=_0x108f91[_0x1731('0x3e')]?_0x108f91[_0x1731('0x3e')]-0x1:0x1;return null;}else if(_0x108f91&&_0x54165c[_0x108f91[_0x1731('0x20')]]){_0x4697a9=_0x54165c[_0x108f91[_0x1731('0x20')]](_0x108f91);logger[_0x1731('0xf')](_0x1731('0x3f'),JSON['stringify'](_0x4697a9,null,0x2));if(_0x4697a9&&_0x4697a9[_0x1731('0x40')]===AGI_CODE_SUCCESS&&_0x4697a9[_0x1731('0x41')]!==AGI_RESULT_ERROR&&!_0x5d18ab[_0x1731('0x1d')]){logger[_0x1731('0x2f')](_0x1731('0x3f'),getLogFromObject(_0x4697a9));return _[_0x1731('0x42')](_0x4697a9[_0x1731('0x41')])?null:_0x4697a9['result']['toString']();}else{logger[_0x1731('0xc')](_0x1731('0x3f'),getLogFromObject(_0x4697a9));return null;}}else{logger['error'](_0x1731('0x43'));return null;}}catch(_0x2d8d3f){logger['error'](_0x2d8d3f[_0x1731('0xd')]);return null;}});if(_0x56d338[_0x1731('0x44')]){logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x45'),_0x5d18ab[_0x1731('0x16')],_0x5d18ab[_0x1731('0x17')],_0x5d18ab[_0x1731('0x18')],_0x5d18ab['dnid'],_0x5d18ab[_0x1731('0x1a')]));_0x4a5166[_0x1731('0x3a')](_0x56d338[_0x1731('0x44')]['id'],function(_0x3cab6c){try{_0x3cab6c=_0x54165c[_0x1731('0x46')](_0x3cab6c);logger[_0x1731('0x2f')]('vertex',JSON[_0x1731('0x30')](_0x3cab6c,null,0x2));if(_0x3cab6c&&_0x54165c[_0x3cab6c[_0x1731('0x20')]]){_0x4697a9=_0x54165c[_0x3cab6c[_0x1731('0x20')]](_0x3cab6c);if(_0x4697a9){logger[_0x1731('0x2f')](_0x1731('0x3f'),getLogFromObject(_0x4697a9));return _[_0x1731('0x42')](_0x4697a9[_0x1731('0x41')])?null:_0x4697a9[_0x1731('0x41')][_0x1731('0x47')]();}else{logger['error'](_0x1731('0x3f'),getLogFromObject(_0x4697a9));return null;}}else{logger[_0x1731('0xc')](_0x1731('0x43'));return null;}}catch(_0x2d2bcc){logger['error'](_0x2d2bcc['stack']);return null;}});}logger[_0x1731('0xf')](util['format'](_0x1731('0x48'),_0x5d18ab[_0x1731('0x16')],_0x5d18ab[_0x1731('0x17')],_0x5d18ab[_0x1731('0x18')],_0x5d18ab[_0x1731('0x19')],_0x5d18ab[_0x1731('0x1a')]));logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x49'),_0x5d18ab['context'],_0x5d18ab[_0x1731('0x3d')],parseInt(_0x5d18ab['priority'],0xa)+0x1));_0x5d18ab[_0x1731('0x4a')](_0x5d18ab['context'],_0x5d18ab[_0x1731('0x3d')],parseInt(_0x5d18ab[_0x1731('0x3e')],0xa)+0x1);_0x5d18ab[_0x1731('0x32')]();}}else{logger[_0x1731('0xc')](util[_0x1731('0x10')](_0x1731('0x4b'),_0x5d18ab[_0x1731('0x16')]));_0x5d18ab[_0x1731('0x4a')](_0x5d18ab[_0x1731('0x3c')],_0x5d18ab[_0x1731('0x3d')],parseInt(_0x5d18ab[_0x1731('0x3e')],0xa)+0x1);_0x5d18ab[_0x1731('0x32')]();}}else{logger[_0x1731('0xc')](util[_0x1731('0x10')](_0x1731('0x4c'),_0x5d18ab[_0x1731('0x16')]));_0x5d18ab[_0x1731('0x4a')](_0x5d18ab[_0x1731('0x3c')],_0x5d18ab[_0x1731('0x3d')],parseInt(_0x5d18ab[_0x1731('0x3e')],0xa)+0x1);_0x5d18ab[_0x1731('0x32')]();}}function main(){var _0x4590f6;return utilLicense['getLicense']()[_0x1731('0x2d')](function(_0x265680){if(_0x265680){if(_0x265680[_0x1731('0x4d')]){if(_0x265680[_0x1731('0x4e')]&&_0x265680[_0x1731('0x4e')]>0x0){logger[_0x1731('0xf')](util[_0x1731('0x10')](_0x1731('0x4f'),_0x265680[_0x1731('0x4e')]));_0x4590f6=_0x265680['callysquare'];}else{logger[_0x1731('0xf')](_0x1731('0x50'));}}else{logger['info'](_0x1731('0x51'));_0x4590f6=-0x1;}}})[_0x1731('0x52')](function(_0x5e6b4b){logger[_0x1731('0xc')](_0x1731('0x53'),_0x5e6b4b[_0x1731('0xd')]);})['finally'](function(){var _0x18c59c=require(_0x1731('0x54'))(config[_0x1731('0x6')][_0x1731('0x11')],config[_0x1731('0x6')]['ip'],_0x4590f6);_0x18c59c['on']('error',errorHandler);_0x18c59c['on'](_0x1731('0x55'),listeningHandler);_0x18c59c['on'](_0x1731('0x56'),connectionHandler);_0x18c59c['on'](_0x1731('0x32'),closeHandler);});}main(); \ No newline at end of file +var _0x8838=['stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','start','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','clear','vertex','[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','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json','lodash','syncho','../../config/license/util','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','info','arg_1','callerid','uniqueid','error','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','root','agicommand','retry','maxRetry','omit','mxCell','isArray','length','addEdge','source','target','value','getSquareProject','then','catch','createSquareReport','hasOwnProperty','indexOf','substring','inspect','debug'];(function(_0x42eff3,_0x333292){var _0x11d9ed=function(_0x173adb){while(--_0x173adb){_0x42eff3['push'](_0x42eff3['shift']());}};_0x11d9ed(++_0x333292);}(_0x8838,0x79));var _0x8883=function(_0xde51d2,_0x55f27a){_0xde51d2=_0xde51d2-0x0;var _0x375969=_0x8838[_0xde51d2];return _0x375969;};'use strict';var parser=require(_0x8883('0x0'));var _=require(_0x8883('0x1'));var syncho=require(_0x8883('0x2'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require('../../config/logger')('agi');var utilLicense=require(_0x8883('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x8883('0x4'));var Graph=require(_0x8883('0x5'));var Vertices=require(_0x8883('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8883('0x7')]=_[_0x8883('0x8')](config[_0x8883('0x7')],{'ip':_0x8883('0x9'),'port':0x11dd});function connectionHandler(_0x2758c7){process[_0x8883('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2758c7);agiHandler(_0x2758c7);}catch(_0x52b3b4){logger['error'](_0x52b3b4[_0x8883('0xb')]);}});});}function listeningHandler(){console[_0x8883('0xc')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8883('0x7')][_0x8883('0xd')]);logger['info'](util[_0x8883('0xe')](_0x8883('0xf'),config['agi']['ip'],config[_0x8883('0x7')][_0x8883('0xd')]));}function errorHandler(_0x547ce2){if(_0x547ce2&&_0x547ce2[_0x8883('0x10')]&&_0x547ce2[_0x8883('0x11')]){logger['error'](util[_0x8883('0xe')]('[%s]\x20%s',_0x547ce2[_0x8883('0x10')],_0x547ce2[_0x8883('0x11')]));}else{logger['error'](util['format']('[ERROR]\x20%s',_0x547ce2['stack']));}}function closeHandler(){logger[_0x8883('0x12')](util[_0x8883('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8883('0x13')],this['calleridname'],this[_0x8883('0x14')],this['dnid'],this[_0x8883('0x15')]));try{createSquareReport(this);}catch(_0x15270e){logger[_0x8883('0x16')](_0x15270e[_0x8883('0xb')]);}}function timeoutHandler(){logger[_0x8883('0x12')](util[_0x8883('0xe')](_0x8883('0x17'),this['arg_1'],this['calleridname'],this['callerid'],this[_0x8883('0x18')],this[_0x8883('0x15')]));}function hangupHandler(){logger[_0x8883('0x12')](util['format'](_0x8883('0x19'),this[_0x8883('0x13')],this[_0x8883('0x1a')],this[_0x8883('0x14')],this[_0x8883('0x18')],this[_0x8883('0x15')]));this[_0x8883('0x1b')]=!![];}function getRoot(_0x262ae4){return parser['toJson'](_0x262ae4,{'object':!![]})['mxGraphModel'][_0x8883('0x1c')];}function addVertex(_0x3432e1,_0x327717,_0x42db22){_0x327717[_0x8883('0x1d')]=_0x42db22;if(_0x327717['hasOwnProperty'](_0x8883('0x1e'))){_0x327717[_0x8883('0x1f')]=parseInt(_0x327717['retry'],0xa);}_0x3432e1['addVertex'](_[_0x8883('0x20')](_0x327717,_0x8883('0x21')));}function initGraph(_0x267dbf,_0x301079){var _0x393aa4=new Graph();for(var _0x43ddfe in _0x267dbf){if(_0x267dbf['hasOwnProperty'](_0x43ddfe)){if(_[_0x8883('0x22')](_0x267dbf[_0x43ddfe])){for(var _0x1457e1=0x0;_0x1457e1<_0x267dbf[_0x43ddfe][_0x8883('0x23')];_0x1457e1+=0x1){addVertex(_0x393aa4,_0x267dbf[_0x43ddfe][_0x1457e1],_0x43ddfe);}}else{addVertex(_0x393aa4,_0x267dbf[_0x43ddfe],_0x43ddfe);}}}for(var _0x48d972=0x0;_0x48d972<_0x301079[_0x8883('0x23')];_0x48d972+=0x1){if(_0x301079[_0x48d972]['source']&&_0x301079[_0x48d972]['target']){_0x393aa4[_0x8883('0x24')](_0x301079[_0x48d972][_0x8883('0x25')],_0x301079[_0x48d972][_0x8883('0x26')],_0x301079[_0x48d972][_0x8883('0x27')]);}}return _0x393aa4;}function getSquareProject(_0x36e4cb,_0x43c65b){rpc[_0x8883('0x28')](_0x36e4cb)[_0x8883('0x29')](function(_0xfa7445){_0x43c65b(null,_0xfa7445);})[_0x8883('0x2a')](function(_0x5b7835){_0x43c65b(null,_0x5b7835);});}function createSquareReport(_0x532514,_0x2e03e1){rpc[_0x8883('0x2b')](_0x532514)['then'](function(_0x636f07){if(_0x2e03e1){_0x2e03e1(null,_0x636f07);}})[_0x8883('0x2a')](function(_0x556d76){if(_0x2e03e1){_0x2e03e1(null,_0x556d76);}});}function setChannelVariables(_0x35372a){for(var _0x247080 in _0x35372a){if(_0x35372a[_0x8883('0x2c')](_0x247080)){if(_0x247080[_0x8883('0x2d')]('agi_')===0x0){_0x35372a[_0x247080[_0x8883('0x2e')](0x4)]=_0x35372a[_0x247080];delete _0x35372a[_0x247080];}}}}function getLogFromObject(_0x4b06a6){return util[_0x8883('0x2f')](_0x4b06a6,{'showHidden':![],'depth':null});}function agiHandler(_0x24a80f){var _0x5556c2,_0xd4c2ee,_0xce5ee7,_0x2e661e,_0xe8353c;logger[_0x8883('0x30')]('variables',JSON[_0x8883('0x31')](_0x24a80f,null,0x2));logger['info'](util[_0x8883('0xe')](_0x8883('0x32'),_0x24a80f[_0x8883('0x13')],_0x24a80f[_0x8883('0x1a')],_0x24a80f[_0x8883('0x14')],_0x24a80f[_0x8883('0x18')],_0x24a80f[_0x8883('0x15')]));_0x24a80f['on'](_0x8883('0x16'),errorHandler);_0x24a80f['on'](_0x8883('0x33'),closeHandler);_0x24a80f['on'](_0x8883('0x34'),timeoutHandler);_0x24a80f['evtHangup']=![];_0x24a80f['on']('hangup',hangupHandler);var _0x3ac30d=getSquareProject['sync'](null,_0x24a80f[_0x8883('0x13')]);if(_0x3ac30d){if(_0x3ac30d[_0x8883('0x35')]){_0x5556c2=getRoot(_0x3ac30d[_0x8883('0x35')]);if(_0x5556c2&&_0x5556c2['start']){logger[_0x8883('0x30')]('root',JSON[_0x8883('0x31')](_0x5556c2,null,0x2));_0x24a80f[_0x8883('0x36')]=moment()[_0x8883('0xe')](_0x8883('0x37'));_0xd4c2ee=initGraph(_[_0x8883('0x20')](_0x5556c2,'mxCell'),_0x5556c2[_0x8883('0x21')]);_0xce5ee7=new Vertices(_0x24a80f,rpc,mailRpc);logger[_0x8883('0x12')](util[_0x8883('0xe')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x24a80f[_0x8883('0x13')],_0x24a80f[_0x8883('0x1a')],_0x24a80f['callerid'],_0x24a80f[_0x8883('0x18')],_0x24a80f[_0x8883('0x15')]));_0xd4c2ee[_0x8883('0x38')](_0x5556c2[_0x8883('0x39')]['id'],function(_0x258e56){try{_0x258e56=_0xce5ee7['clear'](_0x258e56);logger[_0x8883('0x30')]('vertex',JSON['stringify'](_0x258e56,null,0x2));if(_0x258e56[_0x8883('0x1d')]===_0x8883('0x3a')){logger[_0x8883('0x12')](_0x8883('0x3b'));_0x24a80f['context']=_0x258e56[_0x8883('0x3c')]||_0x24a80f[_0x8883('0x3c')];_0x24a80f[_0x8883('0x3d')]=_0x258e56[_0x8883('0x3d')];_0x24a80f[_0x8883('0x3e')]=_0x258e56['priority']?_0x258e56[_0x8883('0x3e')]-0x1:0x1;return null;}else if(_0x258e56&&_0xce5ee7[_0x258e56[_0x8883('0x1d')]]){_0xe8353c=_0xce5ee7[_0x258e56[_0x8883('0x1d')]](_0x258e56);logger[_0x8883('0x12')](_0x8883('0x3f'),JSON[_0x8883('0x31')](_0xe8353c,null,0x2));if(_0xe8353c&&_0xe8353c[_0x8883('0x40')]===AGI_CODE_SUCCESS&&_0xe8353c[_0x8883('0x41')]!==AGI_RESULT_ERROR&&!_0x24a80f['evtHangup']){logger[_0x8883('0x30')]('response',getLogFromObject(_0xe8353c));return _[_0x8883('0x42')](_0xe8353c[_0x8883('0x41')])?null:_0xe8353c[_0x8883('0x41')][_0x8883('0x43')]();}else{logger[_0x8883('0x16')](_0x8883('0x3f'),getLogFromObject(_0xe8353c));return null;}}else{logger[_0x8883('0x16')](_0x8883('0x44'));return null;}}catch(_0x413a06){logger[_0x8883('0x16')](_0x413a06[_0x8883('0xb')]);return null;}});if(_0x5556c2['finally']){logger[_0x8883('0x12')](util[_0x8883('0xe')](_0x8883('0x45'),_0x24a80f['arg_1'],_0x24a80f[_0x8883('0x1a')],_0x24a80f[_0x8883('0x14')],_0x24a80f[_0x8883('0x18')],_0x24a80f[_0x8883('0x15')]));_0xd4c2ee[_0x8883('0x38')](_0x5556c2[_0x8883('0x46')]['id'],function(_0x5bd0b9){try{_0x5bd0b9=_0xce5ee7[_0x8883('0x47')](_0x5bd0b9);logger['debug'](_0x8883('0x48'),JSON[_0x8883('0x31')](_0x5bd0b9,null,0x2));if(_0x5bd0b9&&_0xce5ee7[_0x5bd0b9['agicommand']]){_0xe8353c=_0xce5ee7[_0x5bd0b9[_0x8883('0x1d')]](_0x5bd0b9);if(_0xe8353c){logger[_0x8883('0x30')](_0x8883('0x3f'),getLogFromObject(_0xe8353c));return _[_0x8883('0x42')](_0xe8353c['result'])?null:_0xe8353c[_0x8883('0x41')]['toString']();}else{logger[_0x8883('0x16')](_0x8883('0x3f'),getLogFromObject(_0xe8353c));return null;}}else{logger['error'](_0x8883('0x44'));return null;}}catch(_0x542a1e){logger[_0x8883('0x16')](_0x542a1e[_0x8883('0xb')]);return null;}});}logger[_0x8883('0x12')](util['format'](_0x8883('0x49'),_0x24a80f['arg_1'],_0x24a80f[_0x8883('0x1a')],_0x24a80f[_0x8883('0x14')],_0x24a80f[_0x8883('0x18')],_0x24a80f[_0x8883('0x15')]));logger['info'](util['format'](_0x8883('0x4a'),_0x24a80f[_0x8883('0x3c')],_0x24a80f['extension'],parseInt(_0x24a80f['priority'],0xa)+0x1));_0x24a80f[_0x8883('0x4b')](_0x24a80f['context'],_0x24a80f[_0x8883('0x3d')],parseInt(_0x24a80f[_0x8883('0x3e')],0xa)+0x1);_0x24a80f[_0x8883('0x33')]();}}else{logger['error'](util['format'](_0x8883('0x4c'),_0x24a80f[_0x8883('0x13')]));_0x24a80f[_0x8883('0x4b')](_0x24a80f[_0x8883('0x3c')],_0x24a80f[_0x8883('0x3d')],parseInt(_0x24a80f[_0x8883('0x3e')],0xa)+0x1);_0x24a80f[_0x8883('0x33')]();}}else{logger[_0x8883('0x16')](util['format']('Project\x20%s\x20not\x20found',_0x24a80f['arg_1']));_0x24a80f[_0x8883('0x4b')](_0x24a80f[_0x8883('0x3c')],_0x24a80f['extension'],parseInt(_0x24a80f['priority'],0xa)+0x1);_0x24a80f[_0x8883('0x33')]();}}function main(){var _0x340313;return utilLicense[_0x8883('0x4d')]()[_0x8883('0x29')](function(_0x9e1f24){if(_0x9e1f24){if(_0x9e1f24[_0x8883('0x4e')]){if(_0x9e1f24[_0x8883('0x4f')]&&_0x9e1f24[_0x8883('0x4f')]>0x0){logger[_0x8883('0x12')](util[_0x8883('0xe')](_0x8883('0x50'),_0x9e1f24[_0x8883('0x4f')]));_0x340313=_0x9e1f24[_0x8883('0x4f')];}else{logger[_0x8883('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x8883('0x12')](_0x8883('0x51'));_0x340313=-0x1;}}})[_0x8883('0x2a')](function(_0x41d1d3){logger[_0x8883('0x16')]('[LICENSE]',_0x41d1d3[_0x8883('0xb')]);})['finally'](function(){var _0x41649e=require(_0x8883('0x52'))(config[_0x8883('0x7')][_0x8883('0xd')],config[_0x8883('0x7')]['ip'],_0x340313);_0x41649e['on']('error',errorHandler);_0x41649e['on'](_0x8883('0x53'),listeningHandler);_0x41649e['on'](_0x8883('0x54'),connectionHandler);_0x41649e['on'](_0x8883('0x33'),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 a5ce5ea..2177d48 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 _0x8e51=['error','result','sendMailMessage','SendMail','bluebird','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e51,0x107));var _0x18e5=function(_0x1f5c77,_0x2b4959){_0x1f5c77=_0x1f5c77-0x0;var _0x4ea1b1=_0x8e51[_0x1f5c77];return _0x4ea1b1;};'use strict';var BPromise=require(_0x18e5('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x18e5('0x1')]({'port':0x232b});function request(_0x1a377b,_0x272450){return new BPromise(function(_0x77e54c,_0x161bca){return client['request'](_0x1a377b,_0x272450)[_0x18e5('0x2')](function(_0x11d16f){if(_0x11d16f[_0x18e5('0x3')]){return _0x161bca(_0x11d16f[_0x18e5('0x3')]['message']);}else{return _0x77e54c(_0x11d16f[_0x18e5('0x4')]);}})['catch'](function(_0x9ac6ed){return _0x161bca(_0x9ac6ed);});});}exports[_0x18e5('0x5')]=function(_0x2aa835,_0x2a1cfb){return request(_0x18e5('0x6'),{'account':_0x2aa835,'message':_0x2a1cfb});}; \ No newline at end of file +var _0xb970=['client','http','request','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x2cc73c,_0x179063){var _0x4a9046=function(_0x4b1262){while(--_0x4b1262){_0x2cc73c['push'](_0x2cc73c['shift']());}};_0x4a9046(++_0x179063);}(_0xb970,0x1c2));var _0x0b97=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0xb970[_0x459b74];return _0x46cb16;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x0b97('0x0')][_0x0b97('0x1')]({'port':0x232b});function request(_0x495f2a,_0x241746){return new BPromise(function(_0x5a095d,_0x56484f){return client[_0x0b97('0x2')](_0x495f2a,_0x241746)[_0x0b97('0x3')](function(_0x59bd66){if(_0x59bd66[_0x0b97('0x4')]){return _0x56484f(_0x59bd66[_0x0b97('0x4')][_0x0b97('0x5')]);}else{return _0x5a095d(_0x59bd66[_0x0b97('0x6')]);}})[_0x0b97('0x7')](function(_0x30e2ba){return _0x56484f(_0x30e2ba);});});}exports[_0x0b97('0x8')]=function(_0x5a5fb4,_0x41d4c2){return request(_0x0b97('0x9'),{'account':_0x5a5fb4,'message':_0x41d4c2});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 256295e..dd3ed5a 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 _0xad13=['split','slice','trim','emit','headers','line','exports','util','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody','indexOf','substring','length'];(function(_0x1cff0c,_0x4c95d6){var _0x3040a5=function(_0x5858eb){while(--_0x5858eb){_0x1cff0c['push'](_0x1cff0c['shift']());}};_0x3040a5(++_0x4c95d6);}(_0xad13,0x79));var _0x3ad1=function(_0x48a1ee,_0x4354fe){_0x48a1ee=_0x48a1ee-0x0;var _0x5ce1d3=_0xad13[_0x48a1ee];return _0x5ce1d3;};'use strict';var util=require(_0x3ad1('0x0'));var Transform=require('stream')[_0x3ad1('0x1')];function AGIReply(_0x201a15){Transform[_0x3ad1('0x2')](this,_0x201a15);this[_0x3ad1('0x3')]='';this['_inBody']=![];}util[_0x3ad1('0x4')](AGIReply,Transform);AGIReply[_0x3ad1('0x5')][_0x3ad1('0x6')]=function(_0x2453ba,_0x14bf17,_0x416e30){var _0x42ab5c='\x0a',_0x23ed63=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x44fd50=-0x1,_0x313ad9=-0x1,_0x4d27b0='',_0x2429f4=0x0,_0x241492='',_0x4611bb='';this[_0x3ad1('0x3')]+=_0x2453ba[_0x3ad1('0x7')]();_0x241492=this['_localBuffer'];if(!this[_0x3ad1('0x8')]){_0x2429f4=0x0;while(_0x23ed63[_0x2429f4]){while((_0x313ad9=_0x241492[_0x3ad1('0x9')](_0x23ed63[_0x2429f4]))!=-0x1){_0x4d27b0=_0x23ed63[_0x2429f4];_0x4611bb=_0x241492[_0x3ad1('0xa')](0x0,_0x313ad9);_0x241492=_0x241492[_0x3ad1('0xa')](_0x313ad9+_0x4d27b0[_0x3ad1('0xb')]);var _0x3bcab7=_0x4611bb[_0x3ad1('0xc')](_0x42ab5c),_0x52581c=0x0,_0x5a431a={},_0x142957='',_0x42f6a0='',_0x4544c0=-0x1;while(_0x3bcab7[_0x52581c]){_0x4544c0=_0x3bcab7[_0x52581c]['indexOf'](':');if(_0x4544c0!=-0x1){_0x142957=_0x3bcab7[_0x52581c][_0x3ad1('0xd')](0x0,_0x4544c0)['trim']();_0x42f6a0=_0x3bcab7[_0x52581c][_0x3ad1('0xd')](_0x4544c0+0x1)[_0x3ad1('0xe')]();if(_0x142957[_0x3ad1('0xb')]>0x0){_0x5a431a[_0x142957]=_0x42f6a0;}}else{}_0x52581c++;}this[_0x3ad1('0xf')](_0x3ad1('0x10'),_0x5a431a);this[_0x3ad1('0x8')]=!![];}_0x2429f4++;}this[_0x3ad1('0x3')]=_0x241492;}else{while((_0x44fd50=_0x241492[_0x3ad1('0x9')](_0x42ab5c))!=-0x1){_0x4611bb=_0x241492[_0x3ad1('0xa')](0x0,_0x44fd50);this[_0x3ad1('0xf')](_0x3ad1('0x11'),_0x4611bb);_0x241492=_0x241492[_0x3ad1('0xa')](_0x44fd50+_0x42ab5c['length']);}this[_0x3ad1('0x3')]=_0x241492;}_0x416e30();};module[_0x3ad1('0x12')]=AGIReply; \ No newline at end of file +var _0xbaf3=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','exports','util','stream','Transform','_localBuffer','_inBody','inherits','_transform'];(function(_0x459adb,_0x8677e8){var _0x1a5e74=function(_0x36b6ba){while(--_0x36b6ba){_0x459adb['push'](_0x459adb['shift']());}};_0x1a5e74(++_0x8677e8);}(_0xbaf3,0x1df));var _0x3baf=function(_0x271ebd,_0x1c24ac){_0x271ebd=_0x271ebd-0x0;var _0x313e1d=_0xbaf3[_0x271ebd];return _0x313e1d;};'use strict';var util=require(_0x3baf('0x0'));var Transform=require(_0x3baf('0x1'))[_0x3baf('0x2')];function AGIReply(_0x1baf7f){Transform['call'](this,_0x1baf7f);this[_0x3baf('0x3')]='';this[_0x3baf('0x4')]=![];}util[_0x3baf('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x3baf('0x6')]=function(_0x331ece,_0x228d33,_0x38bc65){var _0xdfda72='\x0a',_0x518d8d=['\x0a\x0a',_0x3baf('0x7')],_0x2775d0=-0x1,_0x514868=-0x1,_0x430daf='',_0x11ca2a=0x0,_0x5abaab='',_0x319090='';this[_0x3baf('0x3')]+=_0x331ece[_0x3baf('0x8')]();_0x5abaab=this[_0x3baf('0x3')];if(!this[_0x3baf('0x4')]){_0x11ca2a=0x0;while(_0x518d8d[_0x11ca2a]){while((_0x514868=_0x5abaab[_0x3baf('0x9')](_0x518d8d[_0x11ca2a]))!=-0x1){_0x430daf=_0x518d8d[_0x11ca2a];_0x319090=_0x5abaab[_0x3baf('0xa')](0x0,_0x514868);_0x5abaab=_0x5abaab[_0x3baf('0xa')](_0x514868+_0x430daf[_0x3baf('0xb')]);var _0x121658=_0x319090[_0x3baf('0xc')](_0xdfda72),_0x2adc3e=0x0,_0x1529bd={},_0x1b2540='',_0x130549='',_0x497bc5=-0x1;while(_0x121658[_0x2adc3e]){_0x497bc5=_0x121658[_0x2adc3e][_0x3baf('0x9')](':');if(_0x497bc5!=-0x1){_0x1b2540=_0x121658[_0x2adc3e][_0x3baf('0xd')](0x0,_0x497bc5)[_0x3baf('0xe')]();_0x130549=_0x121658[_0x2adc3e][_0x3baf('0xd')](_0x497bc5+0x1)[_0x3baf('0xe')]();if(_0x1b2540[_0x3baf('0xb')]>0x0){_0x1529bd[_0x1b2540]=_0x130549;}}else{}_0x2adc3e++;}this[_0x3baf('0xf')](_0x3baf('0x10'),_0x1529bd);this[_0x3baf('0x4')]=!![];}_0x11ca2a++;}this[_0x3baf('0x3')]=_0x5abaab;}else{while((_0x2775d0=_0x5abaab['indexOf'](_0xdfda72))!=-0x1){_0x319090=_0x5abaab[_0x3baf('0xa')](0x0,_0x2775d0);this[_0x3baf('0xf')]('line',_0x319090);_0x5abaab=_0x5abaab['substring'](_0x2775d0+_0xdfda72[_0x3baf('0xb')]);}this[_0x3baf('0x3')]=_0x5abaab;}_0x38bc65();};module[_0x3baf('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index fc8dd98..5ec4150 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 _0x4ced=['LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','CreateCmContact','getPauseById'];(function(_0x3b99be,_0xf4a41e){var _0x26b350=function(_0x358dd0){while(--_0x358dd0){_0x3b99be['push'](_0x3b99be['shift']());}};_0x26b350(++_0xf4a41e);}(_0x4ced,0x12d));var _0xd4ce=function(_0x59e1c3,_0x35ab2e){_0x59e1c3=_0x59e1c3-0x0;var _0x27e3c9=_0x4ced[_0x59e1c3];return _0x27e3c9;};'use strict';var BPromise=require(_0xd4ce('0x0'));var moment=require(_0xd4ce('0x1'));var _=require(_0xd4ce('0x2'));var util=require(_0xd4ce('0x3'));var jayson=require(_0xd4ce('0x4'));var client=jayson['client'][_0xd4ce('0x5')]({'port':0x2329});function request(_0x27c008,_0x5484a7){return new BPromise(function(_0x1e8094,_0x3c84f8){return client[_0xd4ce('0x6')](_0x27c008,_0x5484a7)[_0xd4ce('0x7')](function(_0x11c62c){if(_0x11c62c[_0xd4ce('0x8')]){return _0x3c84f8(_0x11c62c['error'][_0xd4ce('0x9')]);}else{return _0x1e8094(_0x11c62c[_0xd4ce('0xa')]);}})[_0xd4ce('0xb')](function(_0x3ff119){return _0x3c84f8(_0x3ff119);});});}exports[_0xd4ce('0xc')]=function(_0x182a1b){return request(_0xd4ce('0xd'),{'options':{'raw':![],'where':{'name':_0x182a1b},'attributes':['production']}});};exports[_0xd4ce('0xe')]=function(_0x11affd){return request(_0xd4ce('0xf'),{'options':{'raw':![],'where':{'id':_0x11affd},'include':[{'model':'MailServerOut','as':_0xd4ce('0x10')}],'attributes':['id',_0xd4ce('0x11'),_0xd4ce('0x12')]}});};exports[_0xd4ce('0x13')]=function(_0x2277eb){return request(_0xd4ce('0xd'),{'options':{'where':{'id':_0x2277eb},'attributes':[_0xd4ce('0x11')]}});};exports[_0xd4ce('0x14')]=function(_0x529ef6){return request(_0xd4ce('0x15'),{'options':{'where':{'id':_0x529ef6},'attributes':[_0xd4ce('0x11')]}});};exports['getVariableById']=function(_0x599fb5){return request(_0xd4ce('0x16'),{'options':{'where':{'id':_0x599fb5},'attributes':[_0xd4ce('0x11')]}});};exports[_0xd4ce('0x17')]=function(_0x3fe46c){return request(_0xd4ce('0x18'),{'options':{'where':{'id':_0x3fe46c},'attributes':['dsn']}});};exports[_0xd4ce('0x19')]=function(_0x22430a){return request(_0xd4ce('0x1a'),{'options':{'where':{'id':_0x22430a},'attributes':['name']}});};exports[_0xd4ce('0x1b')]=function(_0x26994f){return request(_0xd4ce('0x1c'),{'options':{'where':{'id':_0x26994f},'attributes':[_0xd4ce('0x11')]}});};exports[_0xd4ce('0x1d')]=function(_0x3ba85a){return request(_0xd4ce('0x1e'),{'options':{'where':{'id':_0x3ba85a},'attributes':[_0xd4ce('0x1f')]}});};exports[_0xd4ce('0x20')]=function(_0x185080){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x185080},'include':[{'model':_0xd4ce('0x21'),'as':_0xd4ce('0x22')}]}});};exports[_0xd4ce('0x23')]=function(_0xd66e32){return request('ShowSmsAccount',{'options':{'where':{'id':_0xd66e32},'attributes':['id',_0xd4ce('0x11')]}});};exports[_0xd4ce('0x24')]=function(_0x4dabbc){return request(_0xd4ce('0x25'),{'body':_0x4dabbc});};exports[_0xd4ce('0x26')]=function(_0x127c90){return request(_0xd4ce('0x27'),{'body':_0x127c90});};exports[_0xd4ce('0x28')]=function(_0x5e52ad){return request(_0xd4ce('0x29'),{'body':_[_0xd4ce('0x2a')](_0x5e52ad,{'project_name':_0x5e52ad[_0xd4ce('0x2b')],'prev_project_name':_0x5e52ad[_0xd4ce('0x2c')]||'','is_subproject':_0x5e52ad[_0xd4ce('0x2c')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xd4ce('0x2d')]=function(_0x139122){return request(_0xd4ce('0x2e'),{'body':_0x139122});};exports[_0xd4ce('0x2f')]=function(_0xe93e3a){return request(_0xd4ce('0x30'),{'body':_0xe93e3a});};exports['createCmContact']=function(_0x1a56b5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1a56b5[_0xd4ce('0x31')],'ListId':_0x1a56b5[_0xd4ce('0x32')]}}})[_0xd4ce('0x7')](function(_0x25114a){if(_0x25114a){return _0x25114a;}return request(_0xd4ce('0x33'),{'body':_0x1a56b5});});};exports[_0xd4ce('0x34')]=function(_0x5f48ec){return request('ShowPause',{'options':{'where':{'id':_0x5f48ec},'attributes':['name']}});};exports['agentLogin']=function(_0x4f1ea1,_0x286a6e){return request(_0xd4ce('0x35'),{'body':{'interface':_0x286a6e},'options':{'where':_0x4f1ea1}});};exports[_0xd4ce('0x36')]=function(_0x1fc684,_0xd25624,_0x34aac5){return request(_0xd4ce('0x37'),{'body':{'type':_0xd25624,'uniqueid':_0x34aac5},'options':{'where':_0x1fc684}});};exports['agentUnpause']=function(_0x3b77c7){return request(_0xd4ce('0x38'),{'body':{},'options':{'where':_0x3b77c7}});};exports[_0xd4ce('0x39')]=function(_0x570284){return request(_0xd4ce('0x3a'),{'body':{},'options':{'where':_0x570284}});}; \ No newline at end of file +var _0x2779=['createCmContact','ShowCmHopper','phone','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','message','getSquareProject','ShowSquareProject','production','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage'];(function(_0x52a6f1,_0x4e1742){var _0x2c2c21=function(_0x5eec8d){while(--_0x5eec8d){_0x52a6f1['push'](_0x52a6f1['shift']());}};_0x2c2c21(++_0x4e1742);}(_0x2779,0xe3));var _0x9277=function(_0x590713,_0x478b91){_0x590713=_0x590713-0x0;var _0x159772=_0x2779[_0x590713];return _0x159772;};'use strict';var BPromise=require(_0x9277('0x0'));var moment=require(_0x9277('0x1'));var _=require(_0x9277('0x2'));var util=require(_0x9277('0x3'));var jayson=require(_0x9277('0x4'));var client=jayson[_0x9277('0x5')][_0x9277('0x6')]({'port':0x2329});function request(_0x445737,_0x40c5f9){return new BPromise(function(_0x127e19,_0x951867){return client['request'](_0x445737,_0x40c5f9)[_0x9277('0x7')](function(_0x25a2bf){if(_0x25a2bf['error']){return _0x951867(_0x25a2bf[_0x9277('0x8')][_0x9277('0x9')]);}else{return _0x127e19(_0x25a2bf['result']);}})['catch'](function(_0x3126d4){return _0x951867(_0x3126d4);});});}exports[_0x9277('0xa')]=function(_0x59f017){return request(_0x9277('0xb'),{'options':{'raw':![],'where':{'name':_0x59f017},'attributes':[_0x9277('0xc')]}});};exports['getMailAccountById']=function(_0x43319b){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x43319b},'include':[{'model':_0x9277('0xd'),'as':'Smtp'}],'attributes':['id',_0x9277('0xe'),_0x9277('0xf')]}});};exports[_0x9277('0x10')]=function(_0x1504b9){return request(_0x9277('0xb'),{'options':{'where':{'id':_0x1504b9},'attributes':[_0x9277('0xe')]}});};exports[_0x9277('0x11')]=function(_0x19f377){return request(_0x9277('0x12'),{'options':{'where':{'id':_0x19f377},'attributes':[_0x9277('0xe')]}});};exports['getVariableById']=function(_0x55d915){return request('ShowVariable',{'options':{'where':{'id':_0x55d915},'attributes':[_0x9277('0xe')]}});};exports['getSquareOdbcById']=function(_0x54048f){return request(_0x9277('0x13'),{'options':{'where':{'id':_0x54048f},'attributes':[_0x9277('0x14')]}});};exports['getUserById']=function(_0x29b6af){return request('ShowUser',{'options':{'where':{'id':_0x29b6af},'attributes':[_0x9277('0xe')]}});};exports[_0x9277('0x15')]=function(_0x1dd85f){return request(_0x9277('0x16'),{'options':{'where':{'id':_0x1dd85f},'attributes':[_0x9277('0xe')]}});};exports[_0x9277('0x17')]=function(_0x4ff15d){return request(_0x9277('0x18'),{'options':{'where':{'id':_0x4ff15d},'attributes':[_0x9277('0x19')]}});};exports[_0x9277('0x1a')]=function(_0x28848){return request(_0x9277('0x1b'),{'options':{'raw':![],'where':{'id':_0x28848},'include':[{'model':_0x9277('0x1c'),'as':_0x9277('0x1d')}]}});};exports[_0x9277('0x1e')]=function(_0x3831bb){return request(_0x9277('0x1f'),{'options':{'where':{'id':_0x3831bb},'attributes':['id',_0x9277('0xe')]}});};exports[_0x9277('0x20')]=function(_0x38fdfe){return request('CreateSmsMessage',{'body':_0x38fdfe});};exports['createSquareDetailsReport']=function(_0x368be1){return request(_0x9277('0x21'),{'body':_0x368be1});};exports['createSquareReport']=function(_0x41d551){return request(_0x9277('0x22'),{'body':_[_0x9277('0x23')](_0x41d551,{'project_name':_0x41d551[_0x9277('0x24')],'prev_project_name':_0x41d551[_0x9277('0x25')]||'','is_subproject':_0x41d551[_0x9277('0x25')]?!![]:![],'leaveAt':moment()[_0x9277('0x26')](_0x9277('0x27'))})});};exports[_0x9277('0x28')]=function(_0xb7253b){return request(_0x9277('0x29'),{'body':_0xb7253b});};exports['createSquareMessage']=function(_0x3167ee){return request(_0x9277('0x2a'),{'body':_0x3167ee});};exports[_0x9277('0x2b')]=function(_0x15f17b){return request(_0x9277('0x2c'),{'options':{'raw':![],'where':{'phone':_0x15f17b[_0x9277('0x2d')],'ListId':_0x15f17b['ListId']}}})[_0x9277('0x7')](function(_0x423f72){if(_0x423f72){return _0x423f72;}return request('CreateCmContact',{'body':_0x15f17b});});};exports[_0x9277('0x2e')]=function(_0x3f848f){return request('ShowPause',{'options':{'where':{'id':_0x3f848f},'attributes':[_0x9277('0xe')]}});};exports[_0x9277('0x2f')]=function(_0x4d2ac9,_0xca8c22){return request(_0x9277('0x30'),{'body':{'interface':_0xca8c22},'options':{'where':_0x4d2ac9}});};exports[_0x9277('0x31')]=function(_0x245e16,_0x48a116,_0x5c1f82){return request(_0x9277('0x32'),{'body':{'type':_0x48a116,'uniqueid':_0x5c1f82},'options':{'where':_0x245e16}});};exports[_0x9277('0x33')]=function(_0x42fa04){return request(_0x9277('0x34'),{'body':{},'options':{'where':_0x42fa04}});};exports['agentLogout']=function(_0xa1ce7a){return request(_0x9277('0x35'),{'body':{},'options':{'where':_0xa1ce7a}});}; \ 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 ed059e9..1fdd87e 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 _0x5d17=['./polly','./lex'];(function(_0x2ddf0c,_0x134849){var _0x1cb3d2=function(_0x35251c){while(--_0x35251c){_0x2ddf0c['push'](_0x2ddf0c['shift']());}};_0x1cb3d2(++_0x134849);}(_0x5d17,0x114));var _0x75d1=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0x5d17[_0xd4ec0c];return _0x580218;};var polly=require(_0x75d1('0x0'));var lex=require(_0x75d1('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0dd6=['exports'];(function(_0x58b6a8,_0x307021){var _0xc566dc=function(_0x59bd76){while(--_0x59bd76){_0x58b6a8['push'](_0x58b6a8['shift']());}};_0xc566dc(++_0x307021);}(_0x0dd6,0xca));var _0x60dd=function(_0x3c7010,_0x23716a){_0x3c7010=_0x3c7010-0x0;var _0x4e03a7=_0x0dd6[_0x3c7010];return _0x4e03a7;};var polly=require('./polly');var lex=require('./lex');module[_0x60dd('0x0')]={'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 3972aa4..a1c0338 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 _0xe706=['exports','./lib/api'];(function(_0x582727,_0x392b4f){var _0x399ebc=function(_0x6df72d){while(--_0x6df72d){_0x582727['push'](_0x582727['shift']());}};_0x399ebc(++_0x392b4f);}(_0xe706,0xa3));var _0x6e70=function(_0x39a7b3,_0x9c5210){_0x39a7b3=_0x39a7b3-0x0;var _0x1e25e2=_0xe706[_0x39a7b3];return _0x1e25e2;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file +var _0x2dae=['./lib/api'];(function(_0x545c2c,_0x56ad06){var _0x17553f=function(_0x238364){while(--_0x238364){_0x545c2c['push'](_0x545c2c['shift']());}};_0x17553f(++_0x56ad06);}(_0x2dae,0xc3));var _0xe2da=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x2dae[_0xf48cce];return _0x2a5c38;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ 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 ad35232..1fc486a 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(_0x41ace2,_0x331a91){var _0x5659cf=function(_0x3f5341){while(--_0x3f5341){_0x41ace2['push'](_0x41ace2['shift']());}};_0x5659cf(++_0x331a91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x878414,_0x187b20){var _0x2615b8=function(_0x265117){while(--_0x265117){_0x878414['push'](_0x878414['shift']());}};_0x2615b8(++_0x187b20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 e6a47a9..f9e1513 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 _0xe865=['exports','./lib/api'];(function(_0x426634,_0x1bbe11){var _0x1570f1=function(_0x538b7e){while(--_0x538b7e){_0x426634['push'](_0x426634['shift']());}};_0x1570f1(++_0x1bbe11);}(_0xe865,0x1ad));var _0x5e86=function(_0x312ff8,_0x5d7167){_0x312ff8=_0x312ff8-0x0;var _0x4e144b=_0xe865[_0x312ff8];return _0x4e144b;};'use strict';var polly=require(_0x5e86('0x0'));module[_0x5e86('0x1')]=function(_0x2bc0eb,_0x560f0f,_0x24dabb,_0x162e6b,_0xb0fbe9,_0x22d3e4,_0x1b6686){return polly(_0x2bc0eb,_0x560f0f,_0x24dabb,_0x162e6b,_0xb0fbe9,_0x22d3e4,_0x1b6686);}; \ No newline at end of file +var _0x2d93=['exports'];(function(_0x1829c7,_0x34b9e0){var _0x2a76b6=function(_0x29cd21){while(--_0x29cd21){_0x1829c7['push'](_0x1829c7['shift']());}};_0x2a76b6(++_0x34b9e0);}(_0x2d93,0x1b7));var _0x32d9=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x2d93[_0xfcbcb8];return _0x1b1f97;};'use strict';var polly=require('./lib/api');module[_0x32d9('0x0')]=function(_0x4efaa6,_0x3bc15a,_0x3af3e9,_0x5c914c,_0x5bf044,_0x11ab0b,_0x3ddcc8){return polly(_0x4efaa6,_0x3bc15a,_0x3af3e9,_0x5c914c,_0x5bf044,_0x11ab0b,_0x3ddcc8);}; \ 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 29e7b0f..cc24332 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 _0xbfbb=['synthesizeSpeech','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','aws-sdk'];(function(_0x1fca80,_0x527187){var _0x5ab676=function(_0x1af7c6){while(--_0x1af7c6){_0x1fca80['push'](_0x1fca80['shift']());}};_0x5ab676(++_0x527187);}(_0xbfbb,0x116));var _0xbbfb=function(_0x1b3679,_0x397e24){_0x1b3679=_0x1b3679-0x0;var _0x557c0c=_0xbfbb[_0x1b3679];return _0x557c0c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xbbfb('0x0'));var rs=require('randomstring');var AWS=require(_0xbbfb('0x1'));function pollyResult(_0x5367f6,_0xc8d3b4,_0x2323f0){return new BPromise(function(_0x323995,_0x20b439){_0x5367f6[_0xbbfb('0x2')](_0xc8d3b4,function(_0x4238db,_0x11bd3e){if(_0x4238db){_0x20b439(_0x4238db);}else if(_0x11bd3e){if(_0x11bd3e['AudioStream']instanceof Buffer){fs['writeFile'](_0x2323f0,_0x11bd3e['AudioStream'],function(_0x1ac6c5){if(_0x1ac6c5){_0x20b439(_0x1ac6c5);}else{_0x323995();}});}else{_0x20b439(new Error(_0xbbfb('0x3')));}}else{_0x20b439(new Error(_0xbbfb('0x4')));}});});}module[_0xbbfb('0x5')]=function(_0x53a407,_0x4d1ce1,_0x31f9ed,_0x3b42dc,_0x503e78,_0x1ff171,_0x2dd732){var _0x227aad=new AWS[(_0xbbfb('0x6'))]({'accessKeyId':_0x53a407,'secretAccessKey':_0x4d1ce1,'region':_0x31f9ed});var _0x56cbe6={'Text':_0x503e78,'TextType':_0x1ff171||'text','OutputFormat':_0xbbfb('0x7'),'VoiceId':_0x3b42dc};return pollyResult(_0x227aad,_0x56cbe6,_0x2dd732);}; \ No newline at end of file +var _0x293c=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','synthesizeSpeech','AudioStream'];(function(_0x13677c,_0x319e61){var _0x2614e7=function(_0x336f8a){while(--_0x336f8a){_0x13677c['push'](_0x13677c['shift']());}};_0x2614e7(++_0x319e61);}(_0x293c,0x146));var _0xc293=function(_0x3ffcbd,_0x10a013){_0x3ffcbd=_0x3ffcbd-0x0;var _0x28b919=_0x293c[_0x3ffcbd];return _0x28b919;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xc293('0x0'));var rs=require(_0xc293('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x292031,_0x2028d1,_0x1a988e){return new BPromise(function(_0x5bcaa4,_0x2f7974){_0x292031[_0xc293('0x2')](_0x2028d1,function(_0x106a22,_0x1e8344){if(_0x106a22){_0x2f7974(_0x106a22);}else if(_0x1e8344){if(_0x1e8344[_0xc293('0x3')]instanceof Buffer){fs[_0xc293('0x4')](_0x1a988e,_0x1e8344[_0xc293('0x3')],function(_0x50e6d2){if(_0x50e6d2){_0x2f7974(_0x50e6d2);}else{_0x5bcaa4();}});}else{_0x2f7974(new Error(_0xc293('0x5')));}}else{_0x2f7974(new Error(_0xc293('0x6')));}});});}module[_0xc293('0x7')]=function(_0x351211,_0x20c69d,_0x5177a0,_0x11139a,_0x462941,_0x326a4e,_0xd9b607){var _0x7d861e=new AWS[(_0xc293('0x8'))]({'accessKeyId':_0x351211,'secretAccessKey':_0x20c69d,'region':_0x5177a0});var _0x1b8b96={'Text':_0x462941,'TextType':_0x326a4e||_0xc293('0x9'),'OutputFormat':_0xc293('0xa'),'VoiceId':_0x11139a};return pollyResult(_0x7d861e,_0x1b8b96,_0xd9b607);}; \ 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 393bbed..5ca9dc3 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 _0x2d96=['./lib/api'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x2d96,0x1af));var _0x62d9=function(_0x36587f,_0xc9fe3d){_0x36587f=_0x36587f-0x0;var _0x8978d2=_0x2d96[_0x36587f];return _0x8978d2;};'use strict';var asr=require(_0x62d9('0x0'));module['exports']=function(_0x505dab,_0x29b276,_0x48a01f,_0x4b482e){return asr(_0x505dab,_0x29b276,_0x48a01f);}; \ No newline at end of file +var _0xc0da=['./lib/api'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xc0da,0x8b));var _0xac0d=function(_0x41146c,_0x2a4671){_0x41146c=_0x41146c-0x0;var _0x3defe2=_0xc0da[_0x41146c];return _0x3defe2;};'use strict';var asr=require(_0xac0d('0x0'));module['exports']=function(_0x3840dc,_0x38c5e5,_0x5511cc,_0x1a6024){return asr(_0x3840dc,_0x38c5e5,_0x5511cc);}; \ 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 83d84fc..1a97646 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 _0x0ba7=['8000','url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','/v1/speech:recognize?key=','LINEAR16'];(function(_0x159c39,_0x3aae72){var _0x3122e4=function(_0x4ef38e){while(--_0x4ef38e){_0x159c39['push'](_0x159c39['shift']());}};_0x3122e4(++_0x3aae72);}(_0x0ba7,0x16d));var _0x70ba=function(_0x89137a,_0xa69a3f){_0x89137a=_0x89137a-0x0;var _0x51e6ad=_0x0ba7[_0x89137a];return _0x51e6ad;};'use strict';var url=require(_0x70ba('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x70ba('0x1');module[_0x70ba('0x2')]=function(_0xadfc69,_0x42d93c,_0x5e5368){return new BPromise(function(_0x319ca9,_0x3e20ab){var _0x3cb2e3;if(typeof _0xadfc69!==_0x70ba('0x3')||_0xadfc69[_0x70ba('0x4')]===0x0){return _0x3e20ab(_0x70ba('0x5'));}if(typeof _0x42d93c!==_0x70ba('0x3')||_0x42d93c[_0x70ba('0x4')]===0x0){return _0x3e20ab(_0x70ba('0x6'));}if(typeof _0x5e5368!==_0x70ba('0x7')&&(typeof _0x5e5368!==_0x70ba('0x3')||_0x5e5368[_0x70ba('0x4')]===0x0)){return _0x3e20ab(_0x70ba('0x8'));}try{_0x3cb2e3=fs[_0x70ba('0x9')](_0xadfc69)[_0x70ba('0xa')]('base64');}catch(_0x38f104){return _0x3e20ab(_0x38f104);}return _0x319ca9({'method':'POST','uri':host+_0x70ba('0xb')+_0x42d93c,'body':{'config':{'encoding':_0x70ba('0xc'),'sampleRateHertz':_0x70ba('0xd'),'languageCode':_0x5e5368},'audio':{'content':_0x3cb2e3}},'json':!![]});});}; \ No newline at end of file +var _0x2904=['bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url'];(function(_0x4e1a41,_0xb80cd){var _0x30ebb5=function(_0x341495){while(--_0x341495){_0x4e1a41['push'](_0x4e1a41['shift']());}};_0x30ebb5(++_0xb80cd);}(_0x2904,0x137));var _0x4290=function(_0xffb91e,_0x59badb){_0xffb91e=_0xffb91e-0x0;var _0x301f51=_0x2904[_0xffb91e];return _0x301f51;};'use strict';var url=require(_0x4290('0x0'));var BPromise=require(_0x4290('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4290('0x2')]=function(_0x511133,_0x30c1c2,_0x3d09c0){return new BPromise(function(_0x155538,_0x3d1cdd){var _0x1d9270;if(typeof _0x511133!=='string'||_0x511133[_0x4290('0x3')]===0x0){return _0x3d1cdd(_0x4290('0x4'));}if(typeof _0x30c1c2!==_0x4290('0x5')||_0x30c1c2['length']===0x0){return _0x3d1cdd(_0x4290('0x6'));}if(typeof _0x3d09c0!=='undefined'&&(typeof _0x3d09c0!=='string'||_0x3d09c0[_0x4290('0x3')]===0x0)){return _0x3d1cdd('lang\x20should\x20be\x20a\x20string');}try{_0x1d9270=fs[_0x4290('0x7')](_0x511133)[_0x4290('0x8')]('base64');}catch(_0xca467e){return _0x3d1cdd(_0xca467e);}return _0x155538({'method':_0x4290('0x9'),'uri':host+_0x4290('0xa')+_0x30c1c2,'body':{'config':{'encoding':_0x4290('0xb'),'sampleRateHertz':_0x4290('0xc'),'languageCode':_0x3d09c0},'audio':{'content':_0x1d9270}},'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 906f9c7..6838924 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 _0x16e7=['./asr','exports'];(function(_0x428a5f,_0x56c9cf){var _0x1a591b=function(_0x2f47d4){while(--_0x2f47d4){_0x428a5f['push'](_0x428a5f['shift']());}};_0x1a591b(++_0x56c9cf);}(_0x16e7,0xe0));var _0x716e=function(_0x1c20ed,_0x5c4c13){_0x1c20ed=_0x1c20ed-0x0;var _0x3fe93d=_0x16e7[_0x1c20ed];return _0x3fe93d;};var asr=require(_0x716e('0x0'));module[_0x716e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xdfea=['./asr'];(function(_0xd66a16,_0x51bc10){var _0x37881e=function(_0x1e4d0f){while(--_0x1e4d0f){_0xd66a16['push'](_0xd66a16['shift']());}};_0x37881e(++_0x51bc10);}(_0xdfea,0x1c6));var _0xadfe=function(_0x31bc01,_0x39d325){_0x31bc01=_0x31bc01-0x0;var _0x52300f=_0xdfea[_0x31bc01];return _0x52300f;};var asr=require(_0xadfe('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 66b3e48..c22939d 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 _0x9dd6=['request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','finish','info','finish\x20download\x20file','close','unlink','pipe','end','https:','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','get','error'];(function(_0x234941,_0x44c408){var _0x203458=function(_0x1d47ca){while(--_0x1d47ca){_0x234941['push'](_0x234941['shift']());}};_0x203458(++_0x44c408);}(_0x9dd6,0x185));var _0x69dd=function(_0x338f47,_0x371391){_0x338f47=_0x338f47-0x0;var _0x3ee2be=_0x9dd6[_0x338f47];return _0x3ee2be;};'use strict';var apiai=require(_0x69dd('0x0'));var BPromise=require(_0x69dd('0x1'));var dialogflow=require(_0x69dd('0x2'));var fs=require('fs');var http=require(_0x69dd('0x3'));var https=require(_0x69dd('0x4'));var md5=require('md5');var path=require(_0x69dd('0x5'));var querystring=require(_0x69dd('0x6'));var rp=require(_0x69dd('0x7'));var rs=require('randomstring');var sox=require(_0x69dd('0x8'));var tts=require(_0x69dd('0x9'));var urlParse=require(_0x69dd('0xa'))[_0x69dd('0xb')];var util=require(_0x69dd('0xc'));var aws=require(_0x69dd('0xd'));var google=require(_0x69dd('0xe'));var sestek=require(_0x69dd('0xf'));var tilde=require('./tilde');var logger=require(_0x69dd('0x10'))('agi');var ISPEECH_API=_0x69dd('0x11');function downloadFile(_0x70a92f,_0x3aea23){return new BPromise(function(_0x46909b,_0xa061ad){var _0x83a146=urlParse(_0x70a92f);var _0xbb53f2=_0x83a146[_0x69dd('0x12')]==='https:'?https:http;var _0x2591df={'host':_0x83a146[_0x69dd('0x13')],'path':_0x83a146[_0x69dd('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0xbb53f2[_0x69dd('0x14')](_0x2591df,function(_0x2c6361){if(_0x2c6361['statusCode']!==0xc8){logger[_0x69dd('0x15')](_0x69dd('0x16')+_0x70a92f+_0x69dd('0x17')+_0x2c6361['statusCode']+'\x20('+_0x2c6361[_0x69dd('0x18')]+')');_0xa061ad(new Error('request\x20to\x20'+_0x70a92f+_0x69dd('0x17')+_0x2c6361[_0x69dd('0x19')]+'\x20('+_0x2c6361[_0x69dd('0x18')]+')'));return;}var _0x5ed7a7=fs['createWriteStream'](_0x3aea23);_0x5ed7a7['on'](_0x69dd('0x1a'),function(){logger[_0x69dd('0x1b')](_0x69dd('0x1c'));_0x5ed7a7[_0x69dd('0x1d')](_0x46909b);});_0x5ed7a7['on']('error',function(_0x3cc1b9){fs[_0x69dd('0x1e')](_0x3aea23);logger[_0x69dd('0x15')]('download\x20error',_0x3cc1b9);_0xa061ad(_0x3cc1b9);});_0x2c6361[_0x69dd('0x1f')](_0x5ed7a7);})['on'](_0x69dd('0x15'),function(_0xd9586b){logger[_0x69dd('0x15')](_0xd9586b);_0xa061ad(_0xd9586b);})[_0x69dd('0x20')]();});}function uploadFile(_0x22296d){return new BPromise(function(_0x2e9eaa,_0xe0b172){var _0x4aeb46=urlParse(_0x22296d);var _0x4fa55d=_0x4aeb46['protocol']===_0x69dd('0x21')?https:http;var _0x68f803={'host':_0x4aeb46[_0x69dd('0x13')],'path':_0x4aeb46[_0x69dd('0x5')],'headers':{'user-agent':_0x69dd('0x22')}};_0x4fa55d[_0x69dd('0x14')](_0x68f803,function(_0x4dc659){if(_0x4dc659[_0x69dd('0x19')]!==0xc8){_0xe0b172(new Error(_0x69dd('0x16')+_0x22296d+_0x69dd('0x17')+_0x4dc659['statusCode']+'\x20('+_0x4dc659[_0x69dd('0x18')]+')'));return;}var _0x53a2d4='';_0x4dc659['on'](_0x69dd('0x23'),function(_0x2f1ed6){_0x53a2d4+=_0x2f1ed6;});_0x4dc659['on'](_0x69dd('0x20'),function(){_0x2e9eaa(_0x53a2d4);});})['on'](_0x69dd('0x15'),function(_0x445c94){_0xe0b172(_0x445c94);})['end']();});}function convertFile(_0x2262ce,_0x5c9fcc){return new BPromise(function(_0x4240e3,_0x137c27){var _0x35b47d=sox['transcode'](_0x2262ce,_0x5c9fcc,{'sampleRate':0x1f40,'format':_0x69dd('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35b47d['on'](_0x69dd('0x15'),function(_0x465196){logger[_0x69dd('0x15')](_0x69dd('0x25'),_0x465196);_0x137c27(_0x465196);});_0x35b47d['on'](_0x69dd('0x20'),function(){logger[_0x69dd('0x1b')](_0x69dd('0x26'));_0x4240e3();});_0x35b47d['start']();});}function base64Decode(_0x358335,_0x28d0e4){var _0x214cc8=path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a'));fs[_0x69dd('0x2b')](_0x214cc8,_0x358335,_0x69dd('0x2c'));return convertFile(_0x214cc8,_0x28d0e4)[_0x69dd('0x2d')](function(){try{fs[_0x69dd('0x1e')](_0x214cc8);fs[_0x69dd('0x2e')](_0x28d0e4,_0x69dd('0x2f'));}catch(_0x2cc42f){logger[_0x69dd('0x15')](_0x2cc42f);}return _0x28d0e4[_0x69dd('0x30')]('.')[0x0];});}function base64Encode(_0x3f9a56){var _0x44b55e=fs[_0x69dd('0x31')](_0x3f9a56);return new Buffer(_0x44b55e)[_0x69dd('0x32')]('base64');}exports[_0x69dd('0x33')]=function(_0x41b9a4,_0x433002,_0x280262,_0x201c2c,_0x47bad9,_0x33a850){var _0x320a2a,_0x16bd26;var _0x571341='https://texttospeech.googleapis.com/v1/';var _0x2f4530='?key='+_0x41b9a4;var _0x5575ce={};if(_0x433002===_0x69dd('0x34')){_0x5575ce[_0x69dd('0x35')]={'ssml':_0x280262};}else{_0x5575ce['input']={'text':_0x280262};};_0x5575ce['voice']={'languageCode':_0x201c2c,'ssmlGender':_0x47bad9};_0x5575ce[_0x69dd('0x36')]={'audioEncoding':_0x69dd('0x37'),'sampleRateHertz':0x1f40};var _0x4b28fb={'url':_0x571341+_0x69dd('0x38')+_0x2f4530,'method':_0x69dd('0x39'),'json':!![],'body':_0x5575ce};return rp(_0x4b28fb)['then'](function(_0x3e2e27){return new BPromise(function(_0x103034,_0x319d97){_0x320a2a=path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs['generate'](0x4)+_0x69dd('0x3a'));var _0xaa9bff=Buffer[_0x69dd('0x3b')](_0x3e2e27[_0x69dd('0x3c')],_0x69dd('0x2c'));return fs[_0x69dd('0x3d')](_0x320a2a,_0xaa9bff,function(_0x93a71f){_0x319d97(_0x93a71f);},function(_0x9ef1d2){fs[_0x69dd('0x2e')](_0x320a2a,_0x69dd('0x2f'));_0x103034(_0x9ef1d2);});});})[_0x69dd('0x2d')](function(_0x34d45e){_0x16bd26=path['resolve'](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a'));return convertFile(_0x320a2a,_0x16bd26);})[_0x69dd('0x2d')](function(){try{fs[_0x69dd('0x1e')](_0x320a2a);fs[_0x69dd('0x2e')](_0x16bd26,_0x69dd('0x2f'));}catch(_0x593791){logger[_0x69dd('0x15')](_0x593791);}logger[_0x69dd('0x1b')](_0x69dd('0x3e'),_0x16bd26['split']('.')[0x0]);return _0x16bd26[_0x69dd('0x30')]('.')[0x0];});};exports[_0x69dd('0x3f')]=function(_0x138e63,_0x28ceea){var _0x28ee24=_0x69dd('0x40');var _0x279fc7,_0x563772;var _0x2865b1;var _0x5030e1={'encoding':_0x69dd('0x41'),'method':_0x69dd('0x39'),'timeout':0x2710,'url':_0x28ee24,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x69dd('0x42')]([[[_0x69dd('0x43'),JSON[_0x69dd('0x42')]([_0x138e63,_0x28ceea||'en',![],_0x69dd('0x44')]),null,_0x69dd('0x45')]]]))};return rp(_0x5030e1)[_0x69dd('0x2d')](function(_0x2b40b6){try{_0x2865b1=eval(_0x2b40b6[_0x69dd('0x46')](0x5))[0x0][0x2];}catch(_0x574ad4){throw new Error(_0x69dd('0x47')+_0x2b40b6[_0x69dd('0x23')]);}if(!_0x2865b1){if(_0x138e63[_0x69dd('0x48')]>0xc8){throw new Error(_0x69dd('0x49'));}else{throw new Error(_0x69dd('0x4a')+_0x28ceea+_0x69dd('0x4b'));}}try{_0x2865b1=eval(_0x2865b1)[0x0];}catch(_0x3ee660){throw new Error(_0x69dd('0x47')+res[_0x69dd('0x23')]);}const _0x2d17ad=_0x2865b1;_0x279fc7=path['resolve'](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x3a'));fs[_0x69dd('0x2b')](_0x279fc7,_0x2865b1,{'encoding':_0x69dd('0x2c')});_0x563772=path['resolve'](__dirname,'tmp',rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a'));return convertFile(_0x279fc7,_0x563772);})['then'](function(){try{fs['unlink'](_0x279fc7);fs[_0x69dd('0x2e')](_0x563772,_0x69dd('0x2f'));}catch(_0x54c280){logger[_0x69dd('0x15')](_0x54c280);}logger[_0x69dd('0x1b')]('goggleTTS\x20path',_0x563772[_0x69dd('0x30')]('.')[0x0]);return _0x563772[_0x69dd('0x30')]('.')[0x0];});};exports[_0x69dd('0x4c')]=function(_0x2a6bde,_0x750017,_0x10316b){return google['asr'](_0x2a6bde,_0x750017,_0x10316b)[_0x69dd('0x2d')](function(_0x440e43){logger[_0x69dd('0x1b')](_0x440e43[_0x69dd('0x4d')]);return rp(_0x440e43);})[_0x69dd('0x2d')](function(_0x529e78){var _0x16e80e='';var _0x1d8c20=0x0;try{fs[_0x69dd('0x1e')](_0x2a6bde);}catch(_0x813a98){logger[_0x69dd('0x15')](_0x813a98);}if(_0x529e78&&_0x529e78[_0x69dd('0x4e')]){_0x16e80e=_0x529e78[_0x69dd('0x4e')][_0x69dd('0x4f')](function(_0x466c13){return _0x466c13&&_0x466c13[_0x69dd('0x50')][0x0]&&_0x466c13[_0x69dd('0x50')][0x0][_0x69dd('0x51')]?_0x466c13[_0x69dd('0x50')][0x0][_0x69dd('0x51')]:'';})[_0x69dd('0x52')]('\x0a');_0x1d8c20=_0x529e78[_0x69dd('0x4e')][_0x69dd('0x4f')](function(_0x12d37a){return _0x12d37a&&_0x12d37a[_0x69dd('0x50')][0x0]&&_0x12d37a[_0x69dd('0x50')][0x0][_0x69dd('0x53')]?_0x12d37a['alternatives'][0x0][_0x69dd('0x53')]:0x0;})[_0x69dd('0x52')]('\x0a');}logger['info'](_0x69dd('0x54'),_0x16e80e);logger[_0x69dd('0x1b')](_0x69dd('0x55'),_0x1d8c20);return{'transcript':_0x16e80e,'confidence':_0x1d8c20};})['catch'](function(_0xcab2db){logger['error'](_0x69dd('0x56'),_0xcab2db[_0x69dd('0x19')],_0xcab2db[_0x69dd('0x57')],_0xcab2db[_0x69dd('0x58')]);});};exports[_0x69dd('0x59')]=function(_0x25b308,_0x3580ed,_0x43191e,_0x4449ac){var _0x4ca90e=apiai(_0x3580ed,{'language':_0x4449ac||'en'});return _0x4ca90e[_0x69dd('0x5a')](_0x43191e,{'sessionId':md5(_0x25b308)})['then'](function(_0xc7a4a3){logger[_0x69dd('0x1b')](JSON[_0x69dd('0x42')](_0xc7a4a3));return{'source':_0xc7a4a3[_0x69dd('0x5b')]['source'],'resolvedQuery':_0xc7a4a3['result'][_0x69dd('0x5c')],'action':_0xc7a4a3[_0x69dd('0x5b')]['action'],'actionIncomplete':_0xc7a4a3[_0x69dd('0x5b')]['actionIncomplete'],'speech':_0xc7a4a3[_0x69dd('0x5b')][_0x69dd('0x5d')][_0x69dd('0x5e')],'score':_0xc7a4a3[_0x69dd('0x5b')][_0x69dd('0x5f')],'statusCode':_0xc7a4a3[_0x69dd('0x60')][_0x69dd('0x61')],'endConversation':_0xc7a4a3[_0x69dd('0x5b')][_0x69dd('0x62')][_0x69dd('0x63')]||![],'isFallbackIntent':_0xc7a4a3[_0x69dd('0x5b')][_0x69dd('0x62')][_0x69dd('0x64')]};});};exports[_0x69dd('0x65')]=function(_0x518b25,_0x1203c9,_0xa6caa5,_0x2b3d71,_0xc418ae,_0x49c62b){var _0x93550f=_0x2b3d71[_0x69dd('0x66')](/\\n/g,'\x0a');var _0x547bc4={'credentials':{'private_key':_0x93550f,'client_email':_0xa6caa5}};var _0xc22779=new dialogflow[(_0x69dd('0x67'))](_0x547bc4);var _0x230c6c=_0xc22779['sessionPath'](_0x1203c9,md5(_0x518b25));var _0x32c058={'session':_0x230c6c,'queryInput':{'text':{'text':_0xc418ae,'languageCode':_0x49c62b}}};return _0xc22779[_0x69dd('0x68')](_0x32c058)[_0x69dd('0x2d')](function(_0x3153e8){if(_0x3153e8&&_0x3153e8[_0x69dd('0x48')]){logger[_0x69dd('0x1b')](_0x69dd('0x69'),JSON[_0x69dd('0x42')](_0x3153e8));var _0xbe4091=_0x3153e8[0x0];if(_0xbe4091){var _0x18bd48={'action':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x6b')],'allRequiredParamsPresent':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x6c')],'endConversation':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x6d')]&&_0xbe4091[_0x69dd('0x6a')]['diagnosticInfo']['fields']?_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x6d')]['fields'][_0x69dd('0x6e')]['boolValue']:![],'fulfillmentText':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x6f')],'intentName':_0xbe4091['queryResult']['intent'][_0x69dd('0x57')],'intentDisplayName':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x70')]['displayName'],'isFallbackIntent':_0xbe4091[_0x69dd('0x6a')]['intent'][_0x69dd('0x71')],'languageCode':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x72')],'queryText':_0xbe4091[_0x69dd('0x6a')][_0x69dd('0x73')],'responseId':_0xbe4091[_0x69dd('0x74')],'score':_0xbe4091['queryResult'][_0x69dd('0x75')],'speech':_0xbe4091['queryResult'][_0x69dd('0x6f')],'providerResponse':JSON[_0x69dd('0x42')](_0x3153e8)};return _0x18bd48;}}});};exports[_0x69dd('0x76')]=function(_0x524451,_0x1a20e2,_0x4e2a83,_0x16366b){return tilde['asr'](_0x524451,_0x1a20e2,_0x4e2a83,_0x16366b)[_0x69dd('0x2d')](function(_0x1f17be){try{fs['unlink'](_0x524451);}catch(_0x2ea2c9){logger[_0x69dd('0x15')](_0x2ea2c9);}logger[_0x69dd('0x1b')](_0x69dd('0x77'),_0x1f17be['transcript']);logger[_0x69dd('0x1b')](_0x69dd('0x78'),_0x1f17be['confidence']);return _0x1f17be;});};exports[_0x69dd('0x79')]=function(_0x4f8fe5,_0x1ce1db,_0x94d13a,_0x1ac13f,_0x111bed,_0x71469f){var _0x6d9d00=path[_0x69dd('0x27')](__dirname,'tmp',rs[_0x69dd('0x29')](0x4)+_0x69dd('0x3a'));var _0x4ebc3d;return aws[_0x69dd('0x7a')](_0x4f8fe5,_0x1ce1db,_0x94d13a,_0x1ac13f,_0x111bed,_0x71469f,_0x6d9d00)[_0x69dd('0x2d')](function(){_0x4ebc3d=path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a'));return convertFile(_0x6d9d00,_0x4ebc3d);})[_0x69dd('0x2d')](function(){try{fs[_0x69dd('0x1e')](_0x6d9d00);fs[_0x69dd('0x2e')](_0x4ebc3d,_0x69dd('0x2f'));}catch(_0x8ac2c4){logger['error'](_0x8ac2c4);}return _0x4ebc3d['split']('.')[0x0];});};exports[_0x69dd('0x7b')]=function(_0x26d9cb,_0x537c36,_0xfa6940,_0x8644d7,_0x3b92f1,_0x3d6cee){return aws['lex'](_0x26d9cb,_0x537c36,_0xfa6940,_0x8644d7,_0x3b92f1,_0x3d6cee)[_0x69dd('0x2d')](function(_0x2ba8be){logger['info'](JSON[_0x69dd('0x42')](_0x2ba8be));return _0x2ba8be;});};exports[_0x69dd('0x7c')]=function(_0x37560f,_0x128701,_0x729cbe,_0x88f0a7){var _0x2ec4c3=util[_0x69dd('0x7d')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x37560f,encodeURIComponent(_0x128701),_0x729cbe,_0x88f0a7);var _0x61efd9=path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x3a'));var _0x7af170;return downloadFile(_0x2ec4c3,_0x61efd9)[_0x69dd('0x2d')](function(){_0x7af170=path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a'));return convertFile(_0x61efd9,_0x7af170);})[_0x69dd('0x2d')](function(){try{fs['unlink'](_0x61efd9);fs[_0x69dd('0x2e')](_0x7af170,_0x69dd('0x2f'));}catch(_0x141d03){logger[_0x69dd('0x15')](_0x141d03);}return _0x7af170[_0x69dd('0x30')]('.')[0x0];});};exports['ispeechASR']=function(_0x1dbc36,_0x58a550,_0x1ccfa3,_0x24a765){var _0x51e396=util[_0x69dd('0x7d')](_0x69dd('0x7e'),ISPEECH_API,_0x58a550,_0x1ccfa3,base64Encode(_0x1dbc36),_0x24a765?util[_0x69dd('0x7d')](_0x69dd('0x7f'),encodeURIComponent(_0x24a765)):_0x69dd('0x80'));return uploadFile(_0x51e396)[_0x69dd('0x2d')](function(_0x52659d){return querystring[_0x69dd('0xb')](_0x52659d);});};exports['sestekNDA']=function(_0x133c7b,_0x531554){return sestek[_0x69dd('0x81')](_0x133c7b,_0x531554)[_0x69dd('0x2d')](function(_0x26ad85){logger[_0x69dd('0x1b')](JSON[_0x69dd('0x42')](_0x26ad85));var _0x12cf30={'speech':_0x26ad85[_0x69dd('0x82')],'action':_0x26ad85[_0x69dd('0x83')]?_0x26ad85['channelData'][_0x69dd('0x84')]:undefined,'actiondata':_0x26ad85[_0x69dd('0x83')]?_0x26ad85[_0x69dd('0x83')][_0x69dd('0x85')]:undefined};if(_0x26ad85[_0x69dd('0x83')]&&_0x26ad85[_0x69dd('0x83')][_0x69dd('0x86')]){return base64Decode(_0x26ad85[_0x69dd('0x83')][_0x69dd('0x86')][_0x69dd('0x87')],path[_0x69dd('0x27')](__dirname,_0x69dd('0x28'),rs[_0x69dd('0x29')](0x4)+_0x69dd('0x2a')))['then'](function(_0x1e3f66){_0x12cf30['audiofile']=_0x1e3f66;return _0x12cf30;});}return _0x12cf30;});};exports[_0x69dd('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xc973=['info','finish\x20download\x20file','unlink','download\x20error','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','jQ1olc','stringify','null','slice','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','asr','uri','results','alternatives','transcript','map','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','resolvedQuery','action','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','request-promise','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish'];(function(_0x495f3c,_0x592bbe){var _0x4b97ee=function(_0x10d268){while(--_0x10d268){_0x495f3c['push'](_0x495f3c['shift']());}};_0x4b97ee(++_0x592bbe);}(_0xc973,0x181));var _0x3c97=function(_0x5a3ba4,_0x2d39f7){_0x5a3ba4=_0x5a3ba4-0x0;var _0x3e1f7f=_0xc973[_0x5a3ba4];return _0x3e1f7f;};'use strict';var apiai=require(_0x3c97('0x0'));var BPromise=require(_0x3c97('0x1'));var dialogflow=require(_0x3c97('0x2'));var fs=require('fs');var http=require(_0x3c97('0x3'));var https=require(_0x3c97('0x4'));var md5=require('md5');var path=require(_0x3c97('0x5'));var querystring=require(_0x3c97('0x6'));var rp=require(_0x3c97('0x7'));var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x3c97('0x8'))[_0x3c97('0x9')];var util=require(_0x3c97('0xa'));var aws=require(_0x3c97('0xb'));var google=require(_0x3c97('0xc'));var sestek=require(_0x3c97('0xd'));var tilde=require('./tilde');var logger=require(_0x3c97('0xe'))(_0x3c97('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x33146b,_0x4f7fc8){return new BPromise(function(_0x56fcd7,_0x38b1ca){var _0x2c2762=urlParse(_0x33146b);var _0x14d0cd=_0x2c2762[_0x3c97('0x10')]===_0x3c97('0x11')?https:http;var _0xa83f3f={'host':_0x2c2762[_0x3c97('0x12')],'path':_0x2c2762[_0x3c97('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x14d0cd[_0x3c97('0x13')](_0xa83f3f,function(_0x232fed){if(_0x232fed[_0x3c97('0x14')]!==0xc8){logger[_0x3c97('0x15')](_0x3c97('0x16')+_0x33146b+_0x3c97('0x17')+_0x232fed[_0x3c97('0x14')]+'\x20('+_0x232fed[_0x3c97('0x18')]+')');_0x38b1ca(new Error(_0x3c97('0x16')+_0x33146b+'\x20failed,\x20status\x20code\x20=\x20'+_0x232fed['statusCode']+'\x20('+_0x232fed[_0x3c97('0x18')]+')'));return;}var _0x58c707=fs['createWriteStream'](_0x4f7fc8);_0x58c707['on'](_0x3c97('0x19'),function(){logger[_0x3c97('0x1a')](_0x3c97('0x1b'));_0x58c707['close'](_0x56fcd7);});_0x58c707['on'](_0x3c97('0x15'),function(_0xbdfe1f){fs[_0x3c97('0x1c')](_0x4f7fc8);logger['error'](_0x3c97('0x1d'),_0xbdfe1f);_0x38b1ca(_0xbdfe1f);});_0x232fed['pipe'](_0x58c707);})['on'](_0x3c97('0x15'),function(_0x1028ec){logger['error'](_0x1028ec);_0x38b1ca(_0x1028ec);})[_0x3c97('0x1e')]();});}function uploadFile(_0x2b5e68){return new BPromise(function(_0x5648c0,_0x3c14d1){var _0x3252ad=urlParse(_0x2b5e68);var _0x7696ab=_0x3252ad['protocol']===_0x3c97('0x11')?https:http;var _0x550d5f={'host':_0x3252ad[_0x3c97('0x12')],'path':_0x3252ad[_0x3c97('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x7696ab[_0x3c97('0x13')](_0x550d5f,function(_0x10b8f5){if(_0x10b8f5['statusCode']!==0xc8){_0x3c14d1(new Error('request\x20to\x20'+_0x2b5e68+'\x20failed,\x20status\x20code\x20=\x20'+_0x10b8f5[_0x3c97('0x14')]+'\x20('+_0x10b8f5[_0x3c97('0x18')]+')'));return;}var _0x56240a='';_0x10b8f5['on']('data',function(_0x4e2014){_0x56240a+=_0x4e2014;});_0x10b8f5['on'](_0x3c97('0x1e'),function(){_0x5648c0(_0x56240a);});})['on'](_0x3c97('0x15'),function(_0x234306){_0x3c14d1(_0x234306);})['end']();});}function convertFile(_0x5f4ff1,_0x1b963a){return new BPromise(function(_0x55276f,_0x852d7f){var _0x216467=sox[_0x3c97('0x1f')](_0x5f4ff1,_0x1b963a,{'sampleRate':0x1f40,'format':_0x3c97('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x216467['on'](_0x3c97('0x15'),function(_0x2ba72b){logger[_0x3c97('0x15')](_0x3c97('0x21'),_0x2ba72b);_0x852d7f(_0x2ba72b);});_0x216467['on'](_0x3c97('0x1e'),function(){logger[_0x3c97('0x1a')](_0x3c97('0x22'));_0x55276f();});_0x216467[_0x3c97('0x23')]();});}function base64Decode(_0x14dbe2,_0x54792d){var _0x38b638=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs[_0x3c97('0x26')](0x4)+_0x3c97('0x27'));fs[_0x3c97('0x28')](_0x38b638,_0x14dbe2,'base64');return convertFile(_0x38b638,_0x54792d)[_0x3c97('0x29')](function(){try{fs[_0x3c97('0x1c')](_0x38b638);fs[_0x3c97('0x2a')](_0x54792d,_0x3c97('0x2b'));}catch(_0x37eb89){logger[_0x3c97('0x15')](_0x37eb89);}return _0x54792d['split']('.')[0x0];});}function base64Encode(_0x107cd7){var _0x11db82=fs[_0x3c97('0x2c')](_0x107cd7);return new Buffer(_0x11db82)['toString'](_0x3c97('0x2d'));}exports[_0x3c97('0x2e')]=function(_0x4140aa,_0x4ca426,_0xdbb330,_0x2ea51a,_0x629e23,_0x1d5dae){var _0x25cc91,_0x1568ab;var _0x33622d=_0x3c97('0x2f');var _0x2aa90c=_0x3c97('0x30')+_0x4140aa;var _0x3587fd={};if(_0x4ca426==='ssml'){_0x3587fd[_0x3c97('0x31')]={'ssml':_0xdbb330};}else{_0x3587fd['input']={'text':_0xdbb330};};_0x3587fd[_0x3c97('0x32')]={'languageCode':_0x2ea51a,'ssmlGender':_0x629e23};_0x3587fd['audioConfig']={'audioEncoding':_0x3c97('0x33'),'sampleRateHertz':0x1f40};var _0x283e0b={'url':_0x33622d+_0x3c97('0x34')+_0x2aa90c,'method':_0x3c97('0x35'),'json':!![],'body':_0x3587fd};return rp(_0x283e0b)[_0x3c97('0x29')](function(_0x3bfe73){return new BPromise(function(_0xa522e9,_0x4e4041){_0x25cc91=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs[_0x3c97('0x26')](0x4)+_0x3c97('0x36'));var _0x1ced13=Buffer[_0x3c97('0x37')](_0x3bfe73[_0x3c97('0x38')],_0x3c97('0x2d'));return fs[_0x3c97('0x39')](_0x25cc91,_0x1ced13,function(_0x40d4a7){_0x4e4041(_0x40d4a7);},function(_0x4239a5){fs[_0x3c97('0x2a')](_0x25cc91,'777');_0xa522e9(_0x4239a5);});});})[_0x3c97('0x29')](function(_0x460b9c){_0x1568ab=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x25cc91,_0x1568ab);})[_0x3c97('0x29')](function(){try{fs['unlink'](_0x25cc91);fs['chmodSync'](_0x1568ab,_0x3c97('0x2b'));}catch(_0x4c12ab){logger[_0x3c97('0x15')](_0x4c12ab);}logger[_0x3c97('0x1a')](_0x3c97('0x3a'),_0x1568ab['split']('.')[0x0]);return _0x1568ab[_0x3c97('0x3b')]('.')[0x0];});};exports[_0x3c97('0x3c')]=function(_0x462c2d,_0x3b949d){var _0x36b69c=_0x3c97('0x3d');var _0x4c9ef8,_0x141012;var _0x4665fb;var _0x338b5a={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x36b69c,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x3c97('0x3e'),JSON[_0x3c97('0x3f')]([_0x462c2d,_0x3b949d||'en',![],_0x3c97('0x40')]),null,'generic']]]))};return rp(_0x338b5a)[_0x3c97('0x29')](function(_0x4bb462){try{_0x4665fb=eval(_0x4bb462[_0x3c97('0x41')](0x5))[0x0][0x2];}catch(_0x52acd5){throw new Error('parse\x20response\x20failed:\x0a'+_0x4bb462[_0x3c97('0x42')]);}if(!_0x4665fb){if(_0x462c2d[_0x3c97('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x3c97('0x44')+_0x3b949d+_0x3c97('0x45'));}}try{_0x4665fb=eval(_0x4665fb)[0x0];}catch(_0x5666d2){throw new Error(_0x3c97('0x46')+res[_0x3c97('0x42')]);}const _0x1c6d94=_0x4665fb;_0x4c9ef8=path['resolve'](__dirname,_0x3c97('0x25'),rs['generate'](0x4)+_0x3c97('0x36'));fs['writeFileSync'](_0x4c9ef8,_0x4665fb,{'encoding':_0x3c97('0x2d')});_0x141012=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs[_0x3c97('0x26')](0x4)+_0x3c97('0x27'));return convertFile(_0x4c9ef8,_0x141012);})[_0x3c97('0x29')](function(){try{fs['unlink'](_0x4c9ef8);fs[_0x3c97('0x2a')](_0x141012,'777');}catch(_0x5382b6){logger[_0x3c97('0x15')](_0x5382b6);}logger[_0x3c97('0x1a')]('goggleTTS\x20path',_0x141012[_0x3c97('0x3b')]('.')[0x0]);return _0x141012[_0x3c97('0x3b')]('.')[0x0];});};exports[_0x3c97('0x47')]=function(_0x41ce3c,_0x40d725,_0x42342f){return google[_0x3c97('0x48')](_0x41ce3c,_0x40d725,_0x42342f)[_0x3c97('0x29')](function(_0x328425){logger[_0x3c97('0x1a')](_0x328425[_0x3c97('0x49')]);return rp(_0x328425);})['then'](function(_0x3f8c43){var _0x922a15='';var _0x497e29=0x0;try{fs[_0x3c97('0x1c')](_0x41ce3c);}catch(_0x175f28){logger[_0x3c97('0x15')](_0x175f28);}if(_0x3f8c43&&_0x3f8c43[_0x3c97('0x4a')]){_0x922a15=_0x3f8c43[_0x3c97('0x4a')]['map'](function(_0x3627ef){return _0x3627ef&&_0x3627ef[_0x3c97('0x4b')][0x0]&&_0x3627ef[_0x3c97('0x4b')][0x0][_0x3c97('0x4c')]?_0x3627ef[_0x3c97('0x4b')][0x0]['transcript']:'';})['join']('\x0a');_0x497e29=_0x3f8c43['results'][_0x3c97('0x4d')](function(_0x54454b){return _0x54454b&&_0x54454b['alternatives'][0x0]&&_0x54454b[_0x3c97('0x4b')][0x0][_0x3c97('0x4e')]?_0x54454b[_0x3c97('0x4b')][0x0][_0x3c97('0x4e')]:0x0;})[_0x3c97('0x4f')]('\x0a');}logger[_0x3c97('0x1a')](_0x3c97('0x50'),_0x922a15);logger[_0x3c97('0x1a')](_0x3c97('0x51'),_0x497e29);return{'transcript':_0x922a15,'confidence':_0x497e29};})[_0x3c97('0x52')](function(_0x228629){logger[_0x3c97('0x15')](_0x3c97('0x53'),_0x228629[_0x3c97('0x14')],_0x228629[_0x3c97('0x54')],_0x228629[_0x3c97('0x55')]);});};exports['googleDialogflow']=function(_0x951b94,_0x519291,_0x4f1142,_0x25d444){var _0x15a15c=apiai(_0x519291,{'language':_0x25d444||'en'});return _0x15a15c[_0x3c97('0x56')](_0x4f1142,{'sessionId':md5(_0x951b94)})[_0x3c97('0x29')](function(_0xaed79f){logger[_0x3c97('0x1a')](JSON[_0x3c97('0x3f')](_0xaed79f));return{'source':_0xaed79f[_0x3c97('0x57')]['source'],'resolvedQuery':_0xaed79f[_0x3c97('0x57')][_0x3c97('0x58')],'action':_0xaed79f['result'][_0x3c97('0x59')],'actionIncomplete':_0xaed79f[_0x3c97('0x57')]['actionIncomplete'],'speech':_0xaed79f[_0x3c97('0x57')][_0x3c97('0x5a')][_0x3c97('0x5b')],'score':_0xaed79f[_0x3c97('0x57')]['score'],'statusCode':_0xaed79f[_0x3c97('0x5c')][_0x3c97('0x5d')],'endConversation':_0xaed79f[_0x3c97('0x57')][_0x3c97('0x5e')][_0x3c97('0x5f')]||![],'isFallbackIntent':_0xaed79f[_0x3c97('0x57')]['metadata'][_0x3c97('0x60')]};});};exports['googleDialogflowV2']=function(_0xb39513,_0x1603ca,_0x2ff5af,_0x932b62,_0x536d70,_0x452192){var _0x419329=_0x932b62['replace'](/\\n/g,'\x0a');var _0x353511={'credentials':{'private_key':_0x419329,'client_email':_0x2ff5af}};var _0xb65501=new dialogflow[(_0x3c97('0x61'))](_0x353511);var _0x1daa8e=_0xb65501[_0x3c97('0x62')](_0x1603ca,md5(_0xb39513));var _0xb8a8e7={'session':_0x1daa8e,'queryInput':{'text':{'text':_0x536d70,'languageCode':_0x452192}}};return _0xb65501[_0x3c97('0x63')](_0xb8a8e7)[_0x3c97('0x29')](function(_0x42d964){if(_0x42d964&&_0x42d964[_0x3c97('0x43')]){logger[_0x3c97('0x1a')](_0x3c97('0x64'),JSON[_0x3c97('0x3f')](_0x42d964));var _0x111f77=_0x42d964[0x0];if(_0x111f77){var _0x320933={'action':_0x111f77['queryResult'][_0x3c97('0x59')],'allRequiredParamsPresent':_0x111f77[_0x3c97('0x65')][_0x3c97('0x66')],'endConversation':_0x111f77[_0x3c97('0x65')][_0x3c97('0x67')]&&_0x111f77[_0x3c97('0x65')][_0x3c97('0x67')][_0x3c97('0x68')]?_0x111f77['queryResult']['diagnosticInfo']['fields'][_0x3c97('0x69')][_0x3c97('0x6a')]:![],'fulfillmentText':_0x111f77[_0x3c97('0x65')][_0x3c97('0x6b')],'intentName':_0x111f77['queryResult'][_0x3c97('0x6c')][_0x3c97('0x54')],'intentDisplayName':_0x111f77[_0x3c97('0x65')][_0x3c97('0x6c')]['displayName'],'isFallbackIntent':_0x111f77[_0x3c97('0x65')]['intent'][_0x3c97('0x6d')],'languageCode':_0x111f77[_0x3c97('0x65')][_0x3c97('0x6e')],'queryText':_0x111f77['queryResult'][_0x3c97('0x6f')],'responseId':_0x111f77[_0x3c97('0x70')],'score':_0x111f77[_0x3c97('0x65')][_0x3c97('0x71')],'speech':_0x111f77[_0x3c97('0x65')][_0x3c97('0x6b')],'providerResponse':JSON[_0x3c97('0x3f')](_0x42d964)};return _0x320933;}}});};exports[_0x3c97('0x72')]=function(_0x55f55b,_0x158db5,_0x40450d,_0x252ca3){return tilde['asr'](_0x55f55b,_0x158db5,_0x40450d,_0x252ca3)[_0x3c97('0x29')](function(_0xe70e85){try{fs[_0x3c97('0x1c')](_0x55f55b);}catch(_0x1bc279){logger[_0x3c97('0x15')](_0x1bc279);}logger[_0x3c97('0x1a')](_0x3c97('0x73'),_0xe70e85[_0x3c97('0x4c')]);logger[_0x3c97('0x1a')](_0x3c97('0x74'),_0xe70e85[_0x3c97('0x4e')]);return _0xe70e85;});};exports[_0x3c97('0x75')]=function(_0x32f205,_0x5b5799,_0x421207,_0x3bf1a9,_0x440c6d,_0x404612){var _0x117fd0=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs['generate'](0x4)+_0x3c97('0x36'));var _0x34ae22;return aws[_0x3c97('0x76')](_0x32f205,_0x5b5799,_0x421207,_0x3bf1a9,_0x440c6d,_0x404612,_0x117fd0)['then'](function(){_0x34ae22=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs['generate'](0x4)+_0x3c97('0x27'));return convertFile(_0x117fd0,_0x34ae22);})['then'](function(){try{fs[_0x3c97('0x1c')](_0x117fd0);fs[_0x3c97('0x2a')](_0x34ae22,_0x3c97('0x2b'));}catch(_0xfa2496){logger[_0x3c97('0x15')](_0xfa2496);}return _0x34ae22[_0x3c97('0x3b')]('.')[0x0];});};exports[_0x3c97('0x77')]=function(_0x21d342,_0x3401ac,_0x2f4743,_0xb4385f,_0x4e62ec,_0x18e086){return aws[_0x3c97('0x78')](_0x21d342,_0x3401ac,_0x2f4743,_0xb4385f,_0x4e62ec,_0x18e086)['then'](function(_0x5a7f6a){logger[_0x3c97('0x1a')](JSON[_0x3c97('0x3f')](_0x5a7f6a));return _0x5a7f6a;});};exports[_0x3c97('0x79')]=function(_0x588026,_0x3a1da9,_0x3a271c,_0x233cb2){var _0x1b54dd=util['format'](_0x3c97('0x7a'),ISPEECH_API,_0x588026,encodeURIComponent(_0x3a1da9),_0x3a271c,_0x233cb2);var _0x2a38c5=path['resolve'](__dirname,_0x3c97('0x25'),rs[_0x3c97('0x26')](0x4)+_0x3c97('0x36'));var _0x18ca8f;return downloadFile(_0x1b54dd,_0x2a38c5)[_0x3c97('0x29')](function(){_0x18ca8f=path[_0x3c97('0x24')](__dirname,_0x3c97('0x25'),rs[_0x3c97('0x26')](0x4)+'.wav');return convertFile(_0x2a38c5,_0x18ca8f);})['then'](function(){try{fs['unlink'](_0x2a38c5);fs[_0x3c97('0x2a')](_0x18ca8f,_0x3c97('0x2b'));}catch(_0x6eee60){logger[_0x3c97('0x15')](_0x6eee60);}return _0x18ca8f[_0x3c97('0x3b')]('.')[0x0];});};exports[_0x3c97('0x7b')]=function(_0x5584af,_0x5eeb18,_0x34e9a8,_0x1a01d8){var _0x491b18=util[_0x3c97('0x7c')](_0x3c97('0x7d'),ISPEECH_API,_0x5eeb18,_0x34e9a8,base64Encode(_0x5584af),_0x1a01d8?util[_0x3c97('0x7c')]('model=%s',encodeURIComponent(_0x1a01d8)):_0x3c97('0x7e'));return uploadFile(_0x491b18)[_0x3c97('0x29')](function(_0x264a04){return querystring[_0x3c97('0x9')](_0x264a04);});};exports[_0x3c97('0x7f')]=function(_0x53c7d4,_0x309ee8){return sestek[_0x3c97('0x80')](_0x53c7d4,_0x309ee8)[_0x3c97('0x29')](function(_0x4ace96){logger[_0x3c97('0x1a')](JSON[_0x3c97('0x3f')](_0x4ace96));var _0x135904={'speech':_0x4ace96[_0x3c97('0x81')],'action':_0x4ace96[_0x3c97('0x82')]?_0x4ace96[_0x3c97('0x82')][_0x3c97('0x83')]:undefined,'actiondata':_0x4ace96[_0x3c97('0x82')]?_0x4ace96[_0x3c97('0x82')][_0x3c97('0x84')]:undefined};if(_0x4ace96[_0x3c97('0x82')]&&_0x4ace96[_0x3c97('0x82')][_0x3c97('0x85')]){return base64Decode(_0x4ace96[_0x3c97('0x82')][_0x3c97('0x85')][_0x3c97('0x86')],path[_0x3c97('0x24')](__dirname,'tmp',rs[_0x3c97('0x26')](0x4)+_0x3c97('0x27')))[_0x3c97('0x29')](function(_0x41770b){_0x135904[_0x3c97('0x87')]=_0x41770b;return _0x135904;});}return _0x135904;});};exports[_0x3c97('0x88')]=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 9699cef..8624e98 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 _0x9896=['./nda','exports'];(function(_0x416a0a,_0x24f91f){var _0x574c9f=function(_0x44b83e){while(--_0x44b83e){_0x416a0a['push'](_0x416a0a['shift']());}};_0x574c9f(++_0x24f91f);}(_0x9896,0x16e));var _0x6989=function(_0xde48e0,_0x1f2cea){_0xde48e0=_0xde48e0-0x0;var _0x54ce59=_0x9896[_0xde48e0];return _0x54ce59;};var nda=require(_0x6989('0x0'));module[_0x6989('0x1')]={'nda':nda}; \ No newline at end of file +var _0xa693=['exports','./nda'];(function(_0x43821b,_0x5705bf){var _0x1cbaf1=function(_0x25adc7){while(--_0x25adc7){_0x43821b['push'](_0x43821b['shift']());}};_0x1cbaf1(++_0x5705bf);}(_0xa693,0xf5));var _0x3a69=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0xa693[_0x582274];return _0x8f14d3;};var nda=require(_0x3a69('0x0'));module[_0x3a69('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 026eb96..7a8cbe1 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 _0xf12a=['CustomAction','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','/token','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','callerid','dnid','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action'];(function(_0x2f6b35,_0x3932a9){var _0x4e286e=function(_0x2490f7){while(--_0x2490f7){_0x2f6b35['push'](_0x2f6b35['shift']());}};_0x4e286e(++_0x3932a9);}(_0xf12a,0x8e));var _0xaf12=function(_0x245e0e,_0xcab6db){_0x245e0e=_0x245e0e-0x0;var _0xafcff4=_0xf12a[_0x245e0e];return _0xafcff4;};'use strict';var rp=require(_0xaf12('0x0'));var url=require(_0xaf12('0x1'));var logger=require(_0xaf12('0x2'))(_0xaf12('0x3'));module[_0xaf12('0x4')]=function(_0x205455,_0x193278){var _0x4a3a62={'method':'POST','uri':url[_0xaf12('0x5')](_0x193278['ndauth_url'],_0xaf12('0x6')),'form':{'grant_type':'password','username':_0x193278[_0xaf12('0x7')],'password':_0x193278['password']},'json':!![]};return rp(_0x4a3a62)[_0xaf12('0x8')](function(_0x418c64){var _0x3b6626={'method':_0xaf12('0x9'),'uri':url[_0xaf12('0x5')](_0x193278[_0xaf12('0xa')],_0xaf12('0xb')),'body':{'type':_0x193278[_0xaf12('0xc')]||'message','channelId':_0xaf12('0xd'),'conversation':{'id':_0x205455['uniqueid']},'from':{'id':_0x205455[_0xaf12('0xe')],'name':_0x205455['calleridname']},'recipient':{'id':_0x205455[_0xaf12('0xf')],'name':_0x205455['extension']},'text':_0x193278['text'],'channelData':{}},'headers':{'Authorization':_0xaf12('0x10')+_0x418c64[_0xaf12('0x11')]},'json':!![]};if(_0x193278[_0xaf12('0x12')]){_0x3b6626[_0xaf12('0x13')][_0xaf12('0x14')][_0xaf12('0x15')]=_0x193278[_0xaf12('0x12')];}if(_0x193278[_0xaf12('0x16')]=='1'){_0x3b6626[_0xaf12('0x13')][_0xaf12('0x14')][_0xaf12('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaf12('0x18')};}if(_0x193278[_0xaf12('0x19')]){_0x3b6626[_0xaf12('0x13')][_0xaf12('0x14')][_0xaf12('0x1a')]=_0x193278[_0xaf12('0x19')];if(_0x193278['custom_action_data']){_0x3b6626[_0xaf12('0x13')][_0xaf12('0x14')]['CustomActionData']=_0x193278['custom_action_data'];}}logger['info'](JSON[_0xaf12('0x1b')](_0x3b6626));return rp(_0x3b6626);});}; \ No newline at end of file +var _0x81d5=['/token','password','then','POST','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','custom_action','custom_action_data','info','stringify','request-promise','url','agi','exports','ndauth_url'];(function(_0x24ce89,_0x58a864){var _0x398b2c=function(_0xa28bf9){while(--_0xa28bf9){_0x24ce89['push'](_0x24ce89['shift']());}};_0x398b2c(++_0x58a864);}(_0x81d5,0x1ab));var _0x581d=function(_0x5e1f3b,_0x59aae2){_0x5e1f3b=_0x5e1f3b-0x0;var _0x315e5f=_0x81d5[_0x5e1f3b];return _0x315e5f;};'use strict';var rp=require(_0x581d('0x0'));var url=require(_0x581d('0x1'));var logger=require('../../../../../config/logger')(_0x581d('0x2'));module[_0x581d('0x3')]=function(_0x2fe463,_0x9fb336){var _0x477e28={'method':'POST','uri':url['resolve'](_0x9fb336[_0x581d('0x4')],_0x581d('0x5')),'form':{'grant_type':_0x581d('0x6'),'username':_0x9fb336['username'],'password':_0x9fb336[_0x581d('0x6')]},'json':!![]};return rp(_0x477e28)[_0x581d('0x7')](function(_0x43124c){var _0x497368={'method':_0x581d('0x8'),'uri':url['resolve'](_0x9fb336['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x9fb336[_0x581d('0x9')]||_0x581d('0xa'),'channelId':_0x581d('0xb'),'conversation':{'id':_0x2fe463[_0x581d('0xc')]},'from':{'id':_0x2fe463[_0x581d('0xd')],'name':_0x2fe463['calleridname']},'recipient':{'id':_0x2fe463[_0x581d('0xe')],'name':_0x2fe463[_0x581d('0xf')]},'text':_0x9fb336[_0x581d('0x10')],'channelData':{}},'headers':{'Authorization':_0x581d('0x11')+_0x43124c[_0x581d('0x12')]},'json':!![]};if(_0x9fb336[_0x581d('0x13')]){_0x497368[_0x581d('0x14')][_0x581d('0x15')][_0x581d('0x16')]=_0x9fb336[_0x581d('0x13')];}if(_0x9fb336['ndagenerate_audio']=='1'){_0x497368[_0x581d('0x14')][_0x581d('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x9fb336['custom_action']){_0x497368['body'][_0x581d('0x15')]['CustomAction']=_0x9fb336[_0x581d('0x17')];if(_0x9fb336[_0x581d('0x18')]){_0x497368['body'][_0x581d('0x15')]['CustomActionData']=_0x9fb336[_0x581d('0x18')];}}logger[_0x581d('0x19')](JSON[_0x581d('0x1a')](_0x497368));return rp(_0x497368);});}; \ 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 97157a3..fc4fbce 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 _0xf064=['./lib/api','exports'];(function(_0x1e31a6,_0x5989e5){var _0x5a700c=function(_0x2d3b81){while(--_0x2d3b81){_0x1e31a6['push'](_0x1e31a6['shift']());}};_0x5a700c(++_0x5989e5);}(_0xf064,0xcc));var _0x4f06=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xf064[_0x7b5cdd];return _0x3a29ae;};'use strict';var asr=require(_0x4f06('0x0'));module[_0x4f06('0x1')]=function(_0x254c45,_0x5c8a22,_0xdb2faf,_0x2f507a){return asr(_0x254c45,_0x5c8a22,_0xdb2faf,_0x2f507a);}; \ No newline at end of file +var _0x062b=['./lib/api','exports'];(function(_0x5e8cff,_0x3c5f9b){var _0x4b3a61=function(_0x250eff){while(--_0x250eff){_0x5e8cff['push'](_0x5e8cff['shift']());}};_0x4b3a61(++_0x3c5f9b);}(_0x062b,0x1de));var _0xb062=function(_0x44a0ad,_0x405fff){_0x44a0ad=_0x44a0ad-0x0;var _0x6b12b=_0x062b[_0x44a0ad];return _0x6b12b;};'use strict';var asr=require(_0xb062('0x0'));module[_0xb062('0x1')]=function(_0x49ab85,_0x1fe3ca,_0x489a98,_0x419875){return asr(_0x49ab85,_0x1fe3ca,_0x489a98,_0x419875);}; \ 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 a488cdf..bfbb97e 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 _0xe9ee=['agi','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','stringify','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','moment','crypto'];(function(_0x2752f3,_0x416dff){var _0x38d1a3=function(_0x513d65){while(--_0x513d65){_0x2752f3['push'](_0x2752f3['shift']());}};_0x38d1a3(++_0x416dff);}(_0xe9ee,0x9d));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xee9e('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xee9e('0x1'));var crypto=require(_0xee9e('0x2'));var logger=require('../../../../../../config/logger')(_0xee9e('0x3'));module['exports']=function(_0x381da0,_0x256cf7,_0x25e116,_0x510c15){return new BPromise(function(_0x3df93f,_0xce3ad){logger['info'](_0xee9e('0x4'),_0x510c15||_0xee9e('0x5'));var _0x49a27a=new WebSocket(_0x510c15||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3adf45='';var _0x2ca89d='0';var _0x4410bb='1';var _0x1ae02b=_0xee9e('0x6');function _0x117b9b(_0x51b3c9){var _0x2a304a=crypto[_0xee9e('0x7')](_0xee9e('0x8'));_0x2a304a[_0xee9e('0x9')](_0x51b3c9);return _0x2a304a[_0xee9e('0xa')](_0xee9e('0xb'));}function _0xda1c8b(){try{logger['info'](_0xee9e('0xc'));var _0x2eddc5=moment()[_0xee9e('0xd')]();var _0x1061cb=_0x117b9b(_0x2eddc5+_0x256cf7+_0x25e116);_0x49a27a[_0xee9e('0xe')](JSON['stringify']({'appID':_0x256cf7,'timestamp':_0x2eddc5,'appKey':_0x1061cb}));var _0x302ea5=fs[_0xee9e('0xf')](_0x381da0);_0x302ea5['on'](_0xee9e('0x10'),function(_0x147794){_0x49a27a[_0xee9e('0xe')](_0x147794);});_0x302ea5['on']('close',function(){_0x49a27a[_0xee9e('0xe')](_0xee9e('0x11'));});}catch(_0x266975){logger[_0xee9e('0x12')](_0xee9e('0x13'),JSON['stringify'](_0x266975));_0x49a27a[_0xee9e('0x14')]();}}function _0x3c000d(_0x3c3f35){try{if(_0x3c3f35){var _0x8cd5e1=JSON[_0xee9e('0x15')](_0x3c3f35);switch(_0x8cd5e1[_0xee9e('0x16')]){case 0x0:if(_0x8cd5e1[_0xee9e('0x17')]){if(_0x8cd5e1['result'][_0xee9e('0x18')]){logger[_0xee9e('0x19')](_0xee9e('0x1a'),JSON['stringify'](_0x8cd5e1[_0xee9e('0x17')][_0xee9e('0x1b')]));_0x3adf45=_0x8cd5e1[_0xee9e('0x17')][_0xee9e('0x1b')][0x0]['transcript'];_0x2ca89d=_0x8cd5e1[_0xee9e('0x17')][_0xee9e('0x1b')][0x0][_0xee9e('0x1c')];_0x4410bb='0';_0x1ae02b=_0xee9e('0x1d');_0x49a27a[_0xee9e('0x14')]();}}break;case 0x1:logger['info'](_0xee9e('0x6'));_0x4410bb='1';_0x1ae02b=_0xee9e('0x6');break;case 0x2:logger[_0xee9e('0x19')](_0xee9e('0x1e'));_0x4410bb='2';_0x1ae02b=_0xee9e('0x1e');break;case 0x9:logger[_0xee9e('0x19')](_0xee9e('0x1f'));_0x4410bb='9';_0x1ae02b=_0xee9e('0x1f');break;case 0xa:logger[_0xee9e('0x19')](_0xee9e('0x20'));_0x4410bb='10';_0x1ae02b=_0xee9e('0x20');break;case 0xb:logger[_0xee9e('0x19')](_0xee9e('0x21'));_0x4410bb='11';_0x1ae02b=_0xee9e('0x21');}}}catch(_0x3a1c34){logger[_0xee9e('0x12')](_0xee9e('0x22'),JSON[_0xee9e('0x23')](_0x3a1c34));_0x49a27a[_0xee9e('0x14')]();}}function _0x2bf648(){logger[_0xee9e('0x19')]('Close\x20Tilde\x20ASR\x20socket');_0x3df93f({'transcript':_0x3adf45,'confidence':_0x2ca89d,'status':_0x4410bb,'status_message':_0x1ae02b});}function _0xb00d2f(_0x26aa24){logger[_0xee9e('0x12')](_0xee9e('0x24'));if(!_['isNil'](_0x26aa24)){logger[_0xee9e('0x12')](_[_0xee9e('0x25')](_0x26aa24)?JSON[_0xee9e('0x23')](_0x26aa24):_0x26aa24);}}_0x49a27a['on'](_0xee9e('0x26'),_0xda1c8b);_0x49a27a['on'](_0xee9e('0x27'),_0x3c000d);_0x49a27a['on']('close',_0x2bf648);_0x49a27a['on'](_0xee9e('0x12'),_0xb00d2f);});}; \ No newline at end of file +var _0xe4d1=['likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','unix','send','stringify','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','result','final','hypotheses','transcript'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0xe4d1,0x14f));var _0x1e4d=function(_0x422e02,_0xcbc35a){_0x422e02=_0x422e02-0x0;var _0x310f72=_0xe4d1[_0x422e02];return _0x310f72;};'use strict';var BPromise=require(_0x1e4d('0x0'));var _=require(_0x1e4d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1e4d('0x2'));var crypto=require(_0x1e4d('0x3'));var logger=require(_0x1e4d('0x4'))('agi');module[_0x1e4d('0x5')]=function(_0x21acaf,_0x5a8c48,_0xd639d5,_0x4dc017){return new BPromise(function(_0x347449,_0x4cb5e2){logger[_0x1e4d('0x6')](_0x1e4d('0x7'),_0x4dc017||_0x1e4d('0x8'));var _0x5ebcf0=new WebSocket(_0x4dc017||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3db2ba='';var _0x24a542='0';var _0xa8b8fc='1';var _0x28e54a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x50d370(_0x301491){var _0x2c60ff=crypto[_0x1e4d('0x9')](_0x1e4d('0xa'));_0x2c60ff[_0x1e4d('0xb')](_0x301491);return _0x2c60ff[_0x1e4d('0xc')](_0x1e4d('0xd'));}function _0x3b2282(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x1d2366=moment()[_0x1e4d('0xe')]();var _0x2824de=_0x50d370(_0x1d2366+_0x5a8c48+_0xd639d5);_0x5ebcf0[_0x1e4d('0xf')](JSON[_0x1e4d('0x10')]({'appID':_0x5a8c48,'timestamp':_0x1d2366,'appKey':_0x2824de}));var _0x5e269b=fs['createReadStream'](_0x21acaf);_0x5e269b['on']('data',function(_0xb0cd51){_0x5ebcf0[_0x1e4d('0xf')](_0xb0cd51);});_0x5e269b['on'](_0x1e4d('0x11'),function(){_0x5ebcf0[_0x1e4d('0xf')](_0x1e4d('0x12'));});}catch(_0x1ebf27){logger['error'](_0x1e4d('0x13'),JSON[_0x1e4d('0x10')](_0x1ebf27));_0x5ebcf0[_0x1e4d('0x14')]();}}function _0x472cc3(_0x39d837){try{if(_0x39d837){var _0x4363ac=JSON['parse'](_0x39d837);switch(_0x4363ac['status']){case 0x0:if(_0x4363ac[_0x1e4d('0x15')]){if(_0x4363ac[_0x1e4d('0x15')][_0x1e4d('0x16')]){logger[_0x1e4d('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0x1e4d('0x10')](_0x4363ac[_0x1e4d('0x15')][_0x1e4d('0x17')]));_0x3db2ba=_0x4363ac['result'][_0x1e4d('0x17')][0x0][_0x1e4d('0x18')];_0x24a542=_0x4363ac[_0x1e4d('0x15')][_0x1e4d('0x17')][0x0][_0x1e4d('0x19')];_0xa8b8fc='0';_0x28e54a=_0x1e4d('0x1a');_0x5ebcf0['terminate']();}}break;case 0x1:logger[_0x1e4d('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0xa8b8fc='1';_0x28e54a=_0x1e4d('0x1b');break;case 0x2:logger[_0x1e4d('0x6')](_0x1e4d('0x1c'));_0xa8b8fc='2';_0x28e54a=_0x1e4d('0x1c');break;case 0x9:logger['info'](_0x1e4d('0x1d'));_0xa8b8fc='9';_0x28e54a='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x1e4d('0x6')](_0x1e4d('0x1e'));_0xa8b8fc='10';_0x28e54a=_0x1e4d('0x1e');break;case 0xb:logger[_0x1e4d('0x6')](_0x1e4d('0x1f'));_0xa8b8fc='11';_0x28e54a=_0x1e4d('0x1f');}}}catch(_0x209745){logger[_0x1e4d('0x20')](_0x1e4d('0x21'),JSON[_0x1e4d('0x10')](_0x209745));_0x5ebcf0[_0x1e4d('0x14')]();}}function _0x132c3b(){logger['info'](_0x1e4d('0x22'));_0x347449({'transcript':_0x3db2ba,'confidence':_0x24a542,'status':_0xa8b8fc,'status_message':_0x28e54a});}function _0x17d8b9(_0x2fd2d1){logger[_0x1e4d('0x20')](_0x1e4d('0x23'));if(!_[_0x1e4d('0x24')](_0x2fd2d1)){logger['error'](_[_0x1e4d('0x25')](_0x2fd2d1)?JSON[_0x1e4d('0x10')](_0x2fd2d1):_0x2fd2d1);}}_0x5ebcf0['on'](_0x1e4d('0x26'),_0x3b2282);_0x5ebcf0['on'](_0x1e4d('0x27'),_0x472cc3);_0x5ebcf0['on'](_0x1e4d('0x11'),_0x132c3b);_0x5ebcf0['on'](_0x1e4d('0x20'),_0x17d8b9);});}; \ 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 8a01fb2..96ee897 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 _0x4c7c=['./asr','exports'];(function(_0x23ca9f,_0x5aca10){var _0x3d7307=function(_0x247352){while(--_0x247352){_0x23ca9f['push'](_0x23ca9f['shift']());}};_0x3d7307(++_0x5aca10);}(_0x4c7c,0x194));var _0xc4c7=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x4c7c[_0x1e6659];return _0x4d16e4;};var asr=require(_0xc4c7('0x0'));module[_0xc4c7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6f28=['./asr'];(function(_0x5e47e5,_0x5b282d){var _0x36003b=function(_0xe54d1d){while(--_0xe54d1d){_0x5e47e5['push'](_0x5e47e5['shift']());}};_0x36003b(++_0x5b282d);}(_0x6f28,0x17c));var _0x86f2=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x6f28[_0x290fa6];return _0x47f1f3;};var asr=require(_0x86f2('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c23e1ff..78c1555 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 _0xdd7a=['E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','E_AGI_SERVER_CLOSE','exports','net','events','EventEmitter','./error','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','error'];(function(_0x32a2dd,_0x27a8e7){var _0x418ac4=function(_0x74b038){while(--_0x74b038){_0x32a2dd['push'](_0x32a2dd['shift']());}};_0x418ac4(++_0x27a8e7);}(_0xdd7a,0x105));var _0xadd7=function(_0x2c96df,_0x3527bf){_0x2c96df=_0x2c96df-0x0;var _0x1bdca0=_0xdd7a[_0x2c96df];return _0x1bdca0;};'use strict';var util=require('util');var net=require(_0xadd7('0x0'));var EventEmitter=require(_0xadd7('0x1'))[_0xadd7('0x2')];var AGIError=require(_0xadd7('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x52976f,_0x1c7265,_0x502582){var _0x1f17e7=this,_0x52976f=_0x52976f||0x11dd,_0x1c7265=_0x1c7265||_0xadd7('0x4'),_0x54039d=null,_0x4f9e5e=0x0;EventEmitter['call'](_0x1f17e7);function _0x341b01(){if(!_0x52976f){_0x1f17e7[_0xadd7('0x5')]('error',new AGIError(_0xadd7('0x6')));return![];}_0x54039d=net[_0xadd7('0x7')]();_0x54039d[_0xadd7('0x8')](_0x52976f,_0x1c7265);_0x54039d['on'](_0xadd7('0x9'),function(){_0x1f17e7['emit'](_0xadd7('0x9'));});_0x54039d['on']('connection',function(_0x1ee64e){_0x54039d[_0xadd7('0xa')](function(_0x250acf,_0x435edd){if(_0x250acf){_0x1f17e7[_0xadd7('0x5')](_0xadd7('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x250acf));}else if(_0x502582&&_0x502582<0x0){_0x1f17e7[_0xadd7('0x5')](_0xadd7('0xb'),new AGIError(_0xadd7('0xc')));_0x1ee64e[_0xadd7('0xd')]();}else if(_0x502582&&_0x502582>0x0&&_0x502582<_0x435edd){_0x4f9e5e+=0x1;_0x1f17e7[_0xadd7('0x5')](_0xadd7('0xb'),new AGIError(_0xadd7('0xe'),_0x4f9e5e));_0x1ee64e[_0xadd7('0xd')]();}else{var _0x39a9d1=new AGIChannel(_0x1ee64e);_0x39a9d1['on'](_0xadd7('0xf'),function(){_0x1f17e7[_0xadd7('0x5')](_0xadd7('0x10'),_0x39a9d1);});}});});_0x54039d['on'](_0xadd7('0xb'),function(_0x1fd3a4){_0x1f17e7[_0xadd7('0x5')](_0xadd7('0xb'),new AGIError(_0xadd7('0x11'),_0x1fd3a4[_0xadd7('0x12')]));});_0x54039d['on']('close',function(){_0x1f17e7['emit']('close',new AGIError(_0xadd7('0x13')));});}process['nextTick'](function(){_0x341b01();});};util['inherits'](AGIServer,EventEmitter);module[_0xadd7('0x14')]=function(_0x2d175b,_0x3a0447,_0x4cd7a3){return new AGIServer(_0x2d175b,_0x3a0447,_0x4cd7a3);}; \ No newline at end of file +var _0x760e=['exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','emit','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x2dbe49,_0x53ecd3){var _0x411d2e=function(_0x293722){while(--_0x293722){_0x2dbe49['push'](_0x2dbe49['shift']());}};_0x411d2e(++_0x53ecd3);}(_0x760e,0x171));var _0xe760=function(_0x525951,_0x15e549){_0x525951=_0x525951-0x0;var _0xd16b2f=_0x760e[_0x525951];return _0xd16b2f;};'use strict';var util=require(_0xe760('0x0'));var net=require(_0xe760('0x1'));var EventEmitter=require(_0xe760('0x2'))[_0xe760('0x3')];var AGIError=require(_0xe760('0x4'));var AGIChannel=require(_0xe760('0x5'));var AGIServer=function(_0x9d3855,_0x78cdee,_0x5213fe){var _0x534fa3=this,_0x9d3855=_0x9d3855||0x11dd,_0x78cdee=_0x78cdee||_0xe760('0x6'),_0x5749f3=null,_0xe43756=0x0;EventEmitter[_0xe760('0x7')](_0x534fa3);function _0x41b007(){if(!_0x9d3855){_0x534fa3['emit'](_0xe760('0x8'),new AGIError(_0xe760('0x9')));return![];}_0x5749f3=net[_0xe760('0xa')]();_0x5749f3['listen'](_0x9d3855,_0x78cdee);_0x5749f3['on'](_0xe760('0xb'),function(){_0x534fa3['emit'](_0xe760('0xb'));});_0x5749f3['on'](_0xe760('0xc'),function(_0x51aeb0){_0x5749f3[_0xe760('0xd')](function(_0x26c915,_0x246d8e){if(_0x26c915){_0x534fa3['emit'](_0xe760('0x8'),new AGIError(_0xe760('0xe'),_0x26c915));}else if(_0x5213fe&&_0x5213fe<0x0){_0x534fa3['emit']('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x51aeb0[_0xe760('0xf')]();}else if(_0x5213fe&&_0x5213fe>0x0&&_0x5213fe<_0x246d8e){_0xe43756+=0x1;_0x534fa3['emit'](_0xe760('0x8'),new AGIError(_0xe760('0x10'),_0xe43756));_0x51aeb0[_0xe760('0xf')]();}else{var _0x5603fc=new AGIChannel(_0x51aeb0);_0x5603fc['on'](_0xe760('0x11'),function(){_0x534fa3[_0xe760('0x12')]('connection',_0x5603fc);});}});});_0x5749f3['on']('error',function(_0x185ff7){_0x534fa3[_0xe760('0x12')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x185ff7['code']));});_0x5749f3['on'](_0xe760('0x13'),function(){_0x534fa3[_0xe760('0x12')](_0xe760('0x13'),new AGIError(_0xe760('0x14')));});}process[_0xe760('0x15')](function(){_0x41b007();});};util['inherits'](AGIServer,EventEmitter);module[_0xe760('0x16')]=function(_0x7f218a,_0x2825fd,_0x165ca3){return new AGIServer(_0x7f218a,_0x2825fd,_0x165ca3);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 70a7b85..ad183d2 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 _0xe4de=['%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','languageCode','en-US','MALE','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','text','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','isEmpty','%s.%s','setVariable','split','extra','toString','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','DIAL','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','toLowerCase','macro','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','subject','service','host','secure','authentication','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','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','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','replaceAll','exports','path','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','priority','file','createSquareMessage','createCmContact','isNil','callback_','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin'];(function(_0x571730,_0x15b1cf){var _0x7d1e45=function(_0x40f1ec){while(--_0x40f1ec){_0x571730['push'](_0x571730['shift']());}};_0x7d1e45(++_0x15b1cf);}(_0xe4de,0x16e));var _0xee4d=function(_0x401937,_0x54e515){_0x401937=_0x401937-0x0;var _0x495c99=_0xe4de[_0x401937];return _0x495c99;};'use strict';var fs=require('fs');var path=require(_0xee4d('0x0'));var util=require(_0xee4d('0x1'));var _=require(_0xee4d('0x2'));var sh=require(_0xee4d('0x3'));var odbc=require('odbc')();var rs=require(_0xee4d('0x4'));var moment=require(_0xee4d('0x5'));var Mustache=require(_0xee4d('0x6'));var rp=require(_0xee4d('0x7'));var logger=require(_0xee4d('0x8'))(_0xee4d('0x9'));var config=require('../../config/environment');var scripts=require(_0xee4d('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xee4d('0xb'),_0xee4d('0xc')];var verticesWithRetry=[_0xee4d('0xd'),_0xee4d('0xe'),_0xee4d('0xf')];var AGIVertices=function(_0x51c990,_0x55ccb1,_0x2bd93c){this[_0xee4d('0x10')]=_0x51c990;this[_0xee4d('0x11')]=_0x55ccb1;this[_0xee4d('0x12')]=_0x2bd93c;};AGIVertices[_0xee4d('0x13')][_0xee4d('0x14')]=function(_0x50f1a9,_0x1ca1aa){this['rpc'][_0xee4d('0x15')](_0x50f1a9)['then'](function(_0x492870){_0x1ca1aa(null,_0x492870?_0x492870[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0x2ea665){_0x1ca1aa(_0x2ea665);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x18')]=function(_0x2cde79,_0x9eef25){this[_0xee4d('0x11')][_0xee4d('0x19')](_0x2cde79)[_0xee4d('0x1a')](function(_0x96f4ef){_0x9eef25(null,_0x96f4ef?_0x96f4ef[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0x31179c){_0x9eef25(_0x31179c);});};AGIVertices['prototype']['getSquareProject']=function(_0x543d93,_0x441640){this[_0xee4d('0x11')]['getSquareProjectById'](_0x543d93)[_0xee4d('0x1a')](function(_0x3afb4e){_0x441640(null,_0x3afb4e?_0x3afb4e[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0x260efc){_0x441640(_0x260efc);});};AGIVertices[_0xee4d('0x13')]['getSquareOdbc']=function(_0x76cad1,_0x5f2172){this['rpc'][_0xee4d('0x1b')](_0x76cad1)[_0xee4d('0x1a')](function(_0x30b382){_0x5f2172(null,_0x30b382?_0x30b382[_0xee4d('0x1c')]:![]);})[_0xee4d('0x17')](function(_0x36d3e3){_0x5f2172(_0x36d3e3);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x1d')]=function(_0x207d64,_0x3964ac){this[_0xee4d('0x11')][_0xee4d('0x1e')](_0x207d64)[_0xee4d('0x1a')](function(_0x29d448){_0x3964ac(null,_0x29d448?_0x29d448[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0xb0cf51){_0x3964ac(_0xb0cf51);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x1f')]=function(_0x12b7b9,_0xcb602d){this[_0xee4d('0x11')][_0xee4d('0x20')](_0x12b7b9)[_0xee4d('0x1a')](function(_0x3d7964){_0xcb602d(null,_0x3d7964?_0x3d7964[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0xc66113){_0xcb602d(_0xc66113);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x21')]=function(_0x213fab,_0x1a1318){var _0x4e6e1c=this;this[_0xee4d('0x11')][_0xee4d('0x22')](_0x213fab)['then'](function(_0x91b9c6){_0x1a1318(null,_0x91b9c6?_0x4e6e1c['getSoundPath'](_0x91b9c6[_0xee4d('0x23')]):![]);})[_0xee4d('0x17')](function(_0x20c44d){_0x1a1318(_0x20c44d);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x24')]=function(_0x589b5d,_0xb5f741){this[_0xee4d('0x11')][_0xee4d('0x25')](_0x589b5d)[_0xee4d('0x1a')](function(_0x542a10){_0xb5f741(null,_0x542a10?_0x542a10:![]);})['catch'](function(_0x3e8b66){_0xb5f741(_0x3e8b66);});};AGIVertices['prototype'][_0xee4d('0x26')]=function(_0x226dde,_0x3fa025,_0x60c4ef){this[_0xee4d('0x12')][_0xee4d('0x26')](_0x226dde,_0x3fa025)['then'](function(){_0x60c4ef(null);})[_0xee4d('0x17')](function(_0x366c50){_0x60c4ef(_0x366c50);});};AGIVertices['prototype'][_0xee4d('0x27')]=function(_0x29bf20,_0x18f22c){this[_0xee4d('0x11')][_0xee4d('0x28')](_0x29bf20)[_0xee4d('0x1a')](function(_0x54e378){if(_0x54e378){if(_0x54e378['IntervalId']){_0x18f22c(null,[_0x54e378[_0xee4d('0x29')]]);}else{_0x18f22c(null,_[_0xee4d('0x2a')](_0x54e378[_0xee4d('0x2b')],_0xee4d('0x29')));}}else{_0x18f22c(null,![]);}})[_0xee4d('0x17')](function(_0x4831dd){_0x18f22c(_0x4831dd);});};AGIVertices['prototype'][_0xee4d('0x2c')]=function(_0x5e9ea1){return util[_0xee4d('0x2d')](_0xee4d('0x2e'),FILES_PATH,_0x5e9ea1);};AGIVertices[_0xee4d('0x13')][_0xee4d('0x2f')]=function(_0x5b136a,_0x4d7a88,_0x35ba51){odbc[_0xee4d('0x30')](_0x5b136a,function(_0x49adec){if(_0x49adec){logger[_0xee4d('0x31')](_0xee4d('0x32'),_0x49adec);_0x35ba51(_0x49adec);}else{logger[_0xee4d('0x33')](_0xee4d('0x34'));odbc['query'](_0x4d7a88,function(_0xec1fd4,_0x17fc2b){if(_0xec1fd4){logger['info']('Error\x20executing\x20query\x20%s',_0x4d7a88);_0x35ba51(_0xec1fd4);}else{logger[_0xee4d('0x33')]('Query\x20executed\x20correctly\x20%s',_0x4d7a88);odbc[_0xee4d('0x35')](function(_0x571326){if(_0x571326){logger[_0xee4d('0x31')](_0xee4d('0x36'),_0x571326);}_0x35ba51(null,_0x17fc2b);});}});}});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x37')]=function(_0x385920,_0x5f8f8f){this[_0xee4d('0x11')][_0xee4d('0x38')](_0x385920)['then'](function(_0x5cb859){_0x5f8f8f(null,_0x5cb859?_0x5cb859:![]);})['catch'](function(_0x85fc2a){_0x5f8f8f(_0x85fc2a);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x39')]=function(_0x140be7,_0xa6e0aa){this[_0xee4d('0x11')]['createSmsMessage'](_0x140be7)[_0xee4d('0x1a')](function(_0x4d9859){_0xa6e0aa(null,_0x4d9859);})[_0xee4d('0x17')](function(_0x3a2ace){_0xa6e0aa(_0x3a2ace);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x3a')]=function(_0x5a3e7b,_0x6804b1,_0x2d8720){this[_0xee4d('0x11')]['createSquareDetailsReport']({'uniqueid':this[_0xee4d('0x10')][_0xee4d('0x3b')],'node':_0x5a3e7b[_0xee4d('0x3c')],'application':_0x5a3e7b[_0xee4d('0x3d')],'data':_0x6804b1||null,'project_name':this[_0xee4d('0x10')][_0xee4d('0x3e')],'callerid':this[_0xee4d('0x10')][_0xee4d('0x3f')]})['then'](function(_0xcb8f6b){if(_0x2d8720){_0x2d8720(null,_0xcb8f6b);}})[_0xee4d('0x17')](function(_0x73cf9){if(_0x2d8720){_0x2d8720(_0x73cf9);}});};AGIVertices[_0xee4d('0x13')]['createSquareRecording']=function(_0x5f255e,_0x1670ac,_0x477478,_0x2c1810){this[_0xee4d('0x11')][_0xee4d('0x40')]({'uniqueid':this[_0xee4d('0x10')][_0xee4d('0x3b')],'callerid':this[_0xee4d('0x10')][_0xee4d('0x3f')],'calleridname':this[_0xee4d('0x10')][_0xee4d('0x41')],'context':this[_0xee4d('0x10')]['context'],'extension':this['channel']['extension'],'priority':this[_0xee4d('0x10')][_0xee4d('0x42')],'accountcode':this[_0xee4d('0x10')]['accountcode'],'dnid':this[_0xee4d('0x10')]['dnid'],'projectName':this[_0xee4d('0x10')][_0xee4d('0x3e')],'saveName':_0x1670ac,'filename':_0x5f255e[_0xee4d('0x43')]||_0x1670ac,'savePath':_0x477478})['then'](function(_0x1939c4){_0x2c1810(null,_0x1939c4);})['catch'](function(_0x258909){_0x2c1810(_0x258909);});};AGIVertices[_0xee4d('0x13')]['createSquareMessage']=function(_0x1be590,_0x10808f,_0x5083bd,_0x562f6f,_0x236ea8){this['rpc'][_0xee4d('0x44')]({'uniqueid':this[_0xee4d('0x10')][_0xee4d('0x3b')],'body':_0x1be590,'direction':_0x10808f,'providerName':_0x5083bd,'providerResponse':_0x562f6f})[_0xee4d('0x1a')](function(_0xb3e0ca){if(_0x236ea8){_0x236ea8(null,_0xb3e0ca);}})[_0xee4d('0x17')](function(_0x19432d){if(_0x236ea8){_0x236ea8(_0x19432d);}});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x45')]=function(_0x405837,_0x5d3ba6){this[_0xee4d('0x11')][_0xee4d('0x45')]({'firstName':_['isEmpty'](_0x405837['name'])||_[_0xee4d('0x46')](_0x405837[_0xee4d('0x16')])?_0xee4d('0x47')+Math['random']():_0x405837[_0xee4d('0x16')],'lastName':_['isEmpty'](_0x405837[_0xee4d('0x48')])||_[_0xee4d('0x46')](_0x405837[_0xee4d('0x48')])?null:_0x405837[_0xee4d('0x48')],'phone':_0x405837['phone'],'ListId':_0x405837[_0xee4d('0x49')],'scheduledat':_0x405837[_0xee4d('0x4a')],'callbackUniqueid':this[_0xee4d('0x10')][_0xee4d('0x3b')],'tags':'callback','description':_0xee4d('0x4b')+_0x405837['scheduledAt']['toString'](),'priority':_0x405837[_0xee4d('0x4c')]})['then'](function(_0x5d4f5e){_0x5d3ba6(null,_0x5d4f5e);})[_0xee4d('0x17')](function(_0x38ed48){_0x5d3ba6(_0x38ed48);});};AGIVertices['prototype'][_0xee4d('0x4d')]=function(_0x48cffb,_0x426365){this['rpc'][_0xee4d('0x4e')](_0x48cffb)[_0xee4d('0x1a')](function(_0x18bd86){_0x426365(null,_0x18bd86?_0x18bd86[_0xee4d('0x16')]:![]);})[_0xee4d('0x17')](function(_0x507ca0){_0x426365(_0x507ca0);});};AGIVertices[_0xee4d('0x13')]['agentPause']=function(_0x2dcf5b,_0x5889f7,_0x536e0d){var _0x47b197={'role':_0xee4d('0x4f')};_0x47b197[_0x2dcf5b]=this[_0xee4d('0x10')][_0xee4d('0x3f')];this[_0xee4d('0x11')][_0xee4d('0x50')](_0x47b197,_0x5889f7,this[_0xee4d('0x10')][_0xee4d('0x3b')])[_0xee4d('0x1a')](function(_0x4786c9){_0x536e0d(null,_[_0xee4d('0x46')](_0x4786c9)?![]:!![]);})[_0xee4d('0x17')](function(_0x503b09){logger['error'](_0x503b09);_0x536e0d(null,![]);});};AGIVertices['prototype'][_0xee4d('0x51')]=function(_0x21f3e8,_0x2e66a6){var _0x1a54d3={'role':_0xee4d('0x4f')};_0x1a54d3[_0x21f3e8]=this['channel'][_0xee4d('0x3f')];this[_0xee4d('0x11')][_0xee4d('0x51')](_0x1a54d3)[_0xee4d('0x1a')](function(_0x327f5f){_0x2e66a6(null,_[_0xee4d('0x46')](_0x327f5f)?![]:!![]);})[_0xee4d('0x17')](function(_0x5b74cc){logger[_0xee4d('0x31')](_0x5b74cc);_0x2e66a6(null,![]);});};AGIVertices[_0xee4d('0x13')]['agentLogout']=function(_0x20cf32,_0x144aec){var _0x545373={'role':_0xee4d('0x4f')};_0x545373[_0x20cf32]=this[_0xee4d('0x10')][_0xee4d('0x3f')];this[_0xee4d('0x11')][_0xee4d('0x52')](_0x545373)[_0xee4d('0x1a')](function(_0x3da9a2){_0x144aec(null,_[_0xee4d('0x46')](_0x3da9a2)?![]:!![]);})['catch'](function(_0x136d94){logger[_0xee4d('0x31')](_0x136d94);_0x144aec(null,![]);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x53')]=function(_0x2c1ce3,_0x219fdc){var _0x130f68={'role':'agent'};_0x130f68[_0x2c1ce3]=this['channel'][_0xee4d('0x3f')];var _0x206ee5=_0x2c1ce3!='internal'?util[_0xee4d('0x2d')](_0xee4d('0x54'),_0xee4d('0x55'),this[_0xee4d('0x10')][_0xee4d('0x3f')]):undefined;this[_0xee4d('0x11')]['agentLogin'](_0x130f68,_0x206ee5)[_0xee4d('0x1a')](function(_0x7a8ae8){_0x219fdc(null,_['isNil'](_0x7a8ae8)?![]:!![]);})['catch'](function(_0x27e517){logger[_0xee4d('0x31')](_0x27e517);_0x219fdc(null,![]);});};AGIVertices[_0xee4d('0x13')]['shellCommand']=function(_0x44d888,_0x41b658){sh[_0xee4d('0x56')](_[_0xee4d('0x57')](_0x44d888),function(_0x150ba0,_0x29b35d){var _0x2dabc3=_0x29b35d[_0xee4d('0x58')](/(\r\n|\n|\r)/gm,'');_0x41b658(null,_0x2dabc3);});};AGIVertices[_0xee4d('0x13')]['googleCloudTTS']=function(_0x5a8e53,_0x4ff445){scripts[_0xee4d('0x59')](_0x5a8e53['apiKey'],_0x5a8e53[_0xee4d('0x5a')]||'text',_0x5a8e53['text'],_0x5a8e53[_0xee4d('0x5b')]||_0xee4d('0x5c'),_0x5a8e53['ssmlGender']||_0xee4d('0x5d'),_0x5a8e53['audioEncoding']||_0xee4d('0x5e'))[_0xee4d('0x1a')](function(_0x16d608){_0x4ff445(null,_0x16d608);})['catch'](function(_0x10df2f){_0x4ff445(_0x10df2f);});};AGIVertices['prototype'][_0xee4d('0x5f')]=function(_0x4d0ed6,_0x1e2d9a){scripts[_0xee4d('0x5f')](_0x4d0ed6['text'],_0x4d0ed6['google_tts_language']||'en',0x1)['then'](function(_0x3165b8){_0x1e2d9a(null,_0x3165b8);})[_0xee4d('0x17')](function(_0x51d741){_0x1e2d9a(_0x51d741);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x60')]=function(_0x595755,_0x4fa6e3){var _0x468a8b={'uri':_0x595755[_0xee4d('0x61')],'method':_0x595755[_0xee4d('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x595755[_0xee4d('0x63')])===_0xee4d('0x64')&&parseInt(_0x595755[_0xee4d('0x63')])>=0x1?parseInt(_0x595755[_0xee4d('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xee4d('0x65')]([_0xee4d('0x66'),_0xee4d('0x67')],_0x468a8b[_0xee4d('0x62')]['toUpperCase']())){try{_0x468a8b['body']=_0x595755[_0xee4d('0xc')]?JSON['parse'](_0x595755[_0xee4d('0xc')]):{};}catch(_0x45e3c8){logger[_0xee4d('0x31')](_0xee4d('0x68'),_0x45e3c8);}}try{_0x468a8b['headers']=_0x595755[_0xee4d('0xb')]?JSON[_0xee4d('0x69')](_0x595755[_0xee4d('0xb')]):{};}catch(_0x3aadea){logger[_0xee4d('0x31')](_0xee4d('0x6a'),_0x3aadea);}if(_0x595755[_0xee4d('0x6b')]){try{var _0x364f04=require(_0x595755['computedVariables'])[_0xee4d('0x6c')](this,_0x468a8b);_0x468a8b[_0xee4d('0x6d')]=Mustache[_0xee4d('0x6e')](_0x595755[_0xee4d('0x61')],_0x364f04,{},['$$','$$']);if(_0x468a8b[_0xee4d('0x6f')]){_0x468a8b[_0xee4d('0x6f')]=JSON[_0xee4d('0x69')](Mustache['render'](JSON['stringify'](_0x468a8b[_0xee4d('0x6f')]),_0x364f04,{},['$$','$$']));}if(_0x468a8b['body']){_0x468a8b[_0xee4d('0x70')]=JSON[_0xee4d('0x69')](Mustache[_0xee4d('0x6e')](JSON[_0xee4d('0x71')](_0x468a8b[_0xee4d('0x70')]),_0x364f04,{},['$$','$$']));}}catch(_0x143812){logger[_0xee4d('0x31')](_0xee4d('0x72'),_0x143812);}}rp(_0x468a8b)['then'](function(_0x4faf63){var _0x25441d={'statusCode':_0x4faf63[_0xee4d('0x73')]||0xc8,'statusMessage':_0x4faf63[_0xee4d('0x74')]||'OK','headers':_0x4faf63[_0xee4d('0x6f')]||{},'body':_0x4faf63[_0xee4d('0x70')]||{}};_0x4fa6e3(null,_0x25441d);})['catch'](function(_0x109514){var _0x81db04={'statusCode':_0x109514[_0xee4d('0x73')]||0x1f4,'statusMessage':_0x109514[_0xee4d('0x75')]||_0xee4d('0x76'),'headers':_0x109514[_0xee4d('0x77')]['headers']||{},'body':_0x109514[_0xee4d('0x77')]['body']||{}};_0x4fa6e3(null,_0x81db04);});};AGIVertices[_0xee4d('0x13')]['googleDialogflow']=function(_0x322f81,_0x154844){scripts[_0xee4d('0x78')](this['channel'][_0xee4d('0x3b')],_0x322f81[_0xee4d('0x79')],_0x322f81[_0xee4d('0x7a')],_0x322f81[_0xee4d('0x7b')]||'en')[_0xee4d('0x1a')](function(_0xa58271){_0x154844(null,_0xa58271);})[_0xee4d('0x17')](function(_0x32883a){_0x154844(_0x32883a);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x7c')]=function(_0x57912e,_0x3c9492){scripts[_0xee4d('0x7c')](this[_0xee4d('0x10')][_0xee4d('0x3b')],_0x57912e[_0xee4d('0x7d')],_0x57912e[_0xee4d('0x7e')],_0x57912e[_0xee4d('0x7f')],_0x57912e[_0xee4d('0x7a')],_0x57912e[_0xee4d('0x80')]||'en')[_0xee4d('0x1a')](function(_0x58537a){_0x3c9492(null,_0x58537a);})[_0xee4d('0x17')](function(_0x5680ba){_0x3c9492(_0x5680ba);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x81')]=function(_0x1c7da3,_0x2ba2c6){scripts[_0xee4d('0x81')](this[_0xee4d('0x10')],_0x1c7da3)[_0xee4d('0x1a')](function(_0x26bd92){_0x2ba2c6(null,_0x26bd92);})['catch'](function(_0x1d08af){_0x2ba2c6(_0x1d08af);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x82')]=function(_0x457b5a,_0x2b1b1e){scripts[_0xee4d('0x82')](_0x457b5a[_0xee4d('0x79')],_0x457b5a[_0xee4d('0x7a')],_0x457b5a[_0xee4d('0x83')]||_0xee4d('0x5c'),_0x457b5a['speed'])[_0xee4d('0x1a')](function(_0x393d86){_0x2b1b1e(null,_0x393d86);})[_0xee4d('0x17')](function(_0x3fae39){_0x2b1b1e(_0x3fae39);});};AGIVertices[_0xee4d('0x13')]['ispeechASR']=function(_0x2b699a,_0x885666,_0x1c4dc6){scripts[_0xee4d('0x84')](_0x885666,_0x2b699a[_0xee4d('0x79')],_0x2b699a[_0xee4d('0x85')]||'en-US',this[_0xee4d('0x86')](_0x2b699a[_0xee4d('0x87')])?_0x2b699a['model']:undefined)[_0xee4d('0x1a')](function(_0x488732){_0x1c4dc6(null,_0x488732);})['catch'](function(_0x2a1d4d){_0x1c4dc6(_0x2a1d4d);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x88')]=function(_0x38802f,_0x563a22){scripts[_0xee4d('0x88')](_0x38802f[_0xee4d('0x89')],_0x38802f[_0xee4d('0x8a')],_0x38802f[_0xee4d('0x8b')],_0x38802f['aws_polly_voice']||_0xee4d('0x8c'),_0x38802f[_0xee4d('0x7a')],_0x38802f[_0xee4d('0x8d')]||_0xee4d('0x7a'))[_0xee4d('0x1a')](function(_0x329f47){_0x563a22(null,_0x329f47);})[_0xee4d('0x17')](function(_0x34f04f){_0x563a22(_0x34f04f);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x8e')]=function(_0x10bb3a,_0xd979fb){scripts[_0xee4d('0x8e')](this[_0xee4d('0x10')]['uniqueid'],_0x10bb3a[_0xee4d('0x89')],_0x10bb3a[_0xee4d('0x8a')],_0x10bb3a[_0xee4d('0x8f')],_0x10bb3a[_0xee4d('0x7a')],_0x10bb3a['aws_bot_name'])[_0xee4d('0x1a')](function(_0x406416){_0xd979fb(null,_0x406416);})[_0xee4d('0x17')](function(_0x2f171b){_0xd979fb(_0x2f171b);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x90')]=function(_0x401594,_0x151dc8,_0x509a03){scripts[_0xee4d('0x90')](_0x151dc8,_0x401594['key'],_0x401594[_0xee4d('0x91')]||_0xee4d('0x5c'))[_0xee4d('0x1a')](function(_0x353c11){_0x509a03(null,_0x353c11);})[_0xee4d('0x17')](function(_0x57a990){_0x509a03(_0x57a990);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x92')]=function(_0x558619,_0x2e9f38,_0x2fb22d){scripts['tildeASR'](_0x2e9f38,_0x558619[_0xee4d('0x93')],_0x558619[_0xee4d('0x94')],_0x558619[_0xee4d('0x6d')])[_0xee4d('0x1a')](function(_0x2c78eb){_0x2fb22d(null,_0x2c78eb);})[_0xee4d('0x17')](function(_0x4f2380){_0x2fb22d(_0x4f2380);});};AGIVertices[_0xee4d('0x13')][_0xee4d('0x95')]=function(_0xa73856){var _0x270f10=_[_0xee4d('0x65')](verticesWithRetry,_0xa73856[_0xee4d('0x3d')])?_0xa73856:_[_0xee4d('0x96')](_0xa73856);for(var _0x5f0efd in _0x270f10){if(_0x270f10[_0xee4d('0x97')](_0x5f0efd)){if(_0x270f10[_0x5f0efd]&&_[_0xee4d('0x98')](_0x270f10[_0x5f0efd])){if(_[_0xee4d('0x65')](recursiveMapAttributes,_0x5f0efd)){_0x270f10[_0x5f0efd]=this[_0xee4d('0x99')](_0x270f10[_0x5f0efd]);}else{_0x270f10[_0x5f0efd]=this[_0xee4d('0x9a')](_0x270f10[_0x5f0efd]);}}}}return _0x270f10;};AGIVertices[_0xee4d('0x13')][_0xee4d('0x9b')]=function(_0x51bc21){for(var _0x4e563c in _0x51bc21){if(_0x51bc21[_0xee4d('0x97')](_0x4e563c)){if(_[_0xee4d('0x9c')](_0x51bc21[_0x4e563c])){this[_0xee4d('0x9b')](_0x51bc21[_0x4e563c]);}else if(_[_0xee4d('0x9d')](_0x51bc21[_0x4e563c])){for(var _0x3bdbcb=0x0;_0x3bdbcb<_0x51bc21[_0x4e563c][_0xee4d('0x9e')];_0x3bdbcb++){this[_0xee4d('0x9b')](_0x51bc21[_0x4e563c][_0x3bdbcb]);}}else if(_[_0xee4d('0x98')](_0x51bc21[_0x4e563c])){_0x51bc21[_0x4e563c]=this['replaceAllVariables'](_0x51bc21[_0x4e563c]);}}}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x9f')]=function(_0x3a74dc,_0x7de13a){for(var _0x2a28ef in _0x3a74dc){if(_0x3a74dc['hasOwnProperty'](_0x2a28ef)){if(_[_0xee4d('0x9c')](_0x3a74dc[_0x2a28ef])){if(!_[_0xee4d('0xa0')](_0x3a74dc[_0x2a28ef])){this[_0xee4d('0x9f')](_0x3a74dc[_0x2a28ef],util[_0xee4d('0x2d')]('%s.%s',_0x7de13a,_0x2a28ef));}}else if(_[_0xee4d('0x9d')](_0x3a74dc[_0x2a28ef])){for(var _0x48a96d=0x0;_0x48a96d<_0x3a74dc[_0x2a28ef][_0xee4d('0x9e')];_0x48a96d++){this[_0xee4d('0x9f')](_0x3a74dc[_0x2a28ef][_0x48a96d],util[_0xee4d('0x2d')](_0xee4d('0xa1'),_0x7de13a,_0x2a28ef+'['+_0x48a96d+']'));}}else{if(!_['isNil'](_0x3a74dc[_0x2a28ef])){this['channel'][_0xee4d('0xa2')](util['format'](_0xee4d('0xa1'),_0x7de13a,_0x2a28ef),_0x3a74dc[_0x2a28ef]);}}}}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x99')]=function(_0x2b3c97){try{var _0xe2cfd1=JSON['parse'](_0x2b3c97);this['recursiveNodeIndex'](_0xe2cfd1);return JSON[_0xee4d('0x71')](_0xe2cfd1);}catch(_0x29c426){return this[_0xee4d('0x9a')](_0x2b3c97);}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x9a')]=function(_0x5b379e){var _0x3e58e7=_0x5b379e[_0xee4d('0xa3')]('{');for(var _0x289e40=0x1;_0x289e40<_0x3e58e7[_0xee4d('0x9e')];_0x289e40+=0x1){var _0x343b39=_0x3e58e7[_0x289e40]['split']('}');if(_0x343b39[_0xee4d('0x9e')]>0x1){_0x5b379e=_0x5b379e['replaceAll']('{'+_0x343b39[0x0]+'}',this['channel'][_0xee4d('0x14')](_0x343b39[0x0])[_0xee4d('0xa4')]||_0x343b39[0x0]);}}if(_0x3e58e7[_0xee4d('0x9e')]===0x1){return _0x5b379e[_0xee4d('0xa5')]();}return this[_0xee4d('0x9a')](_0x5b379e);};AGIVertices[_0xee4d('0x13')]['getAndSetVariable']=function(_0xb652e0,_0x11259f){var _0x45f86b=this[_0xee4d('0x10')][_0xee4d('0x14')](_0xb652e0);if(_0x45f86b[_0xee4d('0xa6')]===-0x1){return _0x45f86b;}logger[_0xee4d('0x33')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x11259f,_0x45f86b['extra']));return this[_0xee4d('0x10')][_0xee4d('0xa2')](_0x11259f,_0x45f86b['extra']);};AGIVertices[_0xee4d('0x13')][_0xee4d('0x86')]=function(_0xa5433c){return _0xa5433c&&_0xa5433c!=='0'&&_0xa5433c!=='-1'&&_0xa5433c!=='';};AGIVertices[_0xee4d('0x13')][_0xee4d('0xa7')]=function(_0x3a5dea){this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x3a5dea,'-');_0x3a5dea[_0xee4d('0xa8')]=_0x3a5dea[_0xee4d('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xee4d('0x13')][_0xee4d('0xa9')]=function(_0x20c5e9){logger[_0xee4d('0x33')](util['format'](_0xee4d('0xaa'),_0x20c5e9['label']));if(!this[_0xee4d('0x86')](_0x20c5e9[_0xee4d('0x7a')])){return this[_0xee4d('0x10')]['noop']('no\x20text\x20configured');}var _0x2890fc='\x22'+_0x20c5e9['text']+'\x22';if(this[_0xee4d('0x86')](_0x20c5e9['options'])){_0x2890fc+=','+_0x20c5e9[_0xee4d('0x77')];}var _0x46aec8=this[_0xee4d('0x10')]['exec'](_0xee4d('0xab'),_0x2890fc);if(_0x46aec8[_0xee4d('0xa6')]===-0x1){return _0x46aec8;}return this['channel']['noop'](util[_0xee4d('0x2d')](_0xee4d('0xac'),_0x2890fc));};AGIVertices[_0xee4d('0x13')]['mrcprecog']=function(_0x2e9505){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0xad'),_0x2e9505['label']));if(!this[_0xee4d('0x86')](_0x2e9505[_0xee4d('0xae')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xb0'));}var _0x170eab=_0x2e9505[_0xee4d('0xae')];if(this['isConfigured'](_0x2e9505[_0xee4d('0x77')])){_0x170eab+=','+_0x2e9505[_0xee4d('0x77')];}var _0x26995a=this[_0xee4d('0x10')][_0xee4d('0x56')]('MRCPRecog',_0x170eab);if(_0x26995a['result']===-0x1){return _0x26995a;}var _0x45615d=this[_0xee4d('0xb1')](_0xee4d('0xb2'),_0xee4d('0xb3'));if(_0x45615d[_0xee4d('0xa6')]===-0x1){return _0x45615d;}var _0x27a7b7=this[_0xee4d('0xb1')](_0xee4d('0xb4'),'MRCP_RECOG_TRANSCRIPT');if(_0x27a7b7[_0xee4d('0xa6')]===-0x1){return _0x27a7b7;}var _0x189fba=this[_0xee4d('0xb1')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x189fba[_0xee4d('0xa6')]===-0x1){return _0x189fba;}return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xb5'),_0x170eab));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x9')]=function(_0x4ee4c4){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4ee4c4[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0x9')]([_0x4ee4c4['command'],_0x4ee4c4['args']]);};AGIVertices[_0xee4d('0x13')][_0xee4d('0xb6')]=function(_0xf081d0){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0xb7'),_0xf081d0[_0xee4d('0x3c')]));if(this['isConfigured'](_0xf081d0[_0xee4d('0x63')])){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xf081d0[_0xee4d('0x63')]));var _0x5df210=this[_0xee4d('0x10')][_0xee4d('0xb8')](_0xf081d0[_0xee4d('0x63')]);if(_0x5df210[_0xee4d('0xa6')]===-0x1){return _0x5df210;}}return this['channel']['answer']();};AGIVertices['prototype'][_0xee4d('0xb9')]=function(_0x16ce56){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0xba'),_0x16ce56[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x16ce56['list_id'])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x16ce56,_0xee4d('0xbb'));}_0x16ce56[_0xee4d('0x4a')]=moment();if(this[_0xee4d('0x86')](_0x16ce56[_0xee4d('0xbc')])){_0x16ce56[_0xee4d('0x4a')]=moment()[_0xee4d('0xbd')](_0x16ce56[_0xee4d('0xbc')],_0xee4d('0xbe'));}if(!this[_0xee4d('0x86')](_0x16ce56[_0xee4d('0x4c')])){_0x16ce56['callback_priority']=0x2;}this[_0xee4d('0x45')]['sync'](this,_0x16ce56);return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x16ce56[_0xee4d('0xbf')],_0x16ce56[_0xee4d('0x49')],_0x16ce56['scheduledAt']));};AGIVertices[_0xee4d('0x13')][_0xee4d('0xc0')]=function(_0x4fabee){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0xc1'),_0x4fabee['label']));var _0x1e0f15=this[_0xee4d('0x10')][_0xee4d('0x56')](_0x4fabee[_0xee4d('0xc2')],_0x4fabee[_0xee4d('0x77')]);if(_0x1e0f15[_0xee4d('0xa6')]===-0x1){return _0x1e0f15;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xc3'),_0x4fabee['application'],_0x4fabee[_0xee4d('0x77')]));};AGIVertices[_0xee4d('0x13')]['lumenvoxtts']=function(_0x5041f7){logger['info'](util['format'](_0xee4d('0xc4'),_0x5041f7['label']));if(!this['isConfigured'](_0x5041f7[_0xee4d('0x7a')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')]('no\x20text\x20configured');}var _0x49701d='\x22'+_0x5041f7['text']+'\x22';if(this[_0xee4d('0x86')](_0x5041f7[_0xee4d('0x77')])){_0x49701d+=','+_0x5041f7['options'];}var _0x40545e=this[_0xee4d('0x10')]['exec'](_0xee4d('0xab'),_0x49701d);if(_0x40545e[_0xee4d('0xa6')]===-0x1){return _0x40545e;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0xac'),_0x49701d));};AGIVertices['prototype'][_0xee4d('0xc5')]=function(_0x18c1df){logger[_0xee4d('0x33')](util['format'](_0xee4d('0xc6'),_0x18c1df['label']));if(!this['isConfigured'](_0x18c1df[_0xee4d('0x7a')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xc7'));}var _0x3d80c0='\x22'+_0x18c1df[_0xee4d('0x7a')]+'\x22';if(this[_0xee4d('0x86')](_0x18c1df['options'])){_0x3d80c0+=','+_0x18c1df[_0xee4d('0x77')];}var _0x53c8b6=this[_0xee4d('0x10')][_0xee4d('0x56')](_0xee4d('0xab'),_0x3d80c0);if(_0x53c8b6[_0xee4d('0xa6')]===-0x1){return _0x53c8b6;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x3d80c0));};AGIVertices[_0xee4d('0x13')]['lumenvoxasr']=function(_0x4cab6f){logger['info'](util[_0xee4d('0x2d')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x4cab6f[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x4cab6f[_0xee4d('0xae')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xb0'));}var _0x3c4d90=_0x4cab6f[_0xee4d('0xae')];if(this[_0xee4d('0x86')](_0x4cab6f['options'])){_0x3c4d90+=','+_0x4cab6f[_0xee4d('0x77')];}var _0x5087ad=this[_0xee4d('0x10')]['exec'](_0xee4d('0xc8'),_0x3c4d90);if(_0x5087ad[_0xee4d('0xa6')]===-0x1){return _0x5087ad;}var _0x313c8b=this[_0xee4d('0xb1')](_0xee4d('0xb2'),_0xee4d('0xc9'));if(_0x313c8b[_0xee4d('0xa6')]===-0x1){return _0x313c8b;}var _0x1ab344=this[_0xee4d('0xb1')](_0xee4d('0xb4'),_0xee4d('0xca'));if(_0x1ab344[_0xee4d('0xa6')]===-0x1){return _0x1ab344;}var _0x514be4=this[_0xee4d('0xb1')]('RECOG_INSTANCE()',_0xee4d('0xcb'));if(_0x514be4['result']===-0x1){return _0x514be4;}return this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')](_0xee4d('0xb5'),_0x3c4d90));};AGIVertices[_0xee4d('0x13')][_0xee4d('0xcc')]=function(_0x25c6d3){logger[_0xee4d('0x33')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x25c6d3[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x25c6d3['grammar'])){return this[_0xee4d('0x10')][_0xee4d('0xaf')]('no\x20grammar\x20configured');}var _0x51dfd0=_0x25c6d3['grammar'];if(this['isConfigured'](_0x25c6d3[_0xee4d('0x77')])){_0x51dfd0+=','+_0x25c6d3['options'];}var _0x7983da=this['channel']['exec']('MRCPRecog',_0x51dfd0);if(_0x7983da[_0xee4d('0xa6')]===-0x1){return _0x7983da;}var _0x1bd0d0=this[_0xee4d('0xb1')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x1bd0d0['result']===-0x1){return _0x1bd0d0;}var _0xea93b=this[_0xee4d('0xb1')](_0xee4d('0xb4'),_0xee4d('0xcd'));if(_0xea93b['result']===-0x1){return _0xea93b;}var _0xf4e0a0=this[_0xee4d('0xb1')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0xf4e0a0['result']===-0x1){return _0xf4e0a0;}return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xb5'),_0x51dfd0));};AGIVertices[_0xee4d('0x13')]['database']=function(_0x542e67){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0xce'),_0x542e67[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x542e67['odbc_id'])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x542e67,_0xee4d('0xcf'));}var _0x1d8901=this['getSquareOdbc'][_0xee4d('0x6c')](this,_0x542e67[_0xee4d('0xd0')]);if(!_0x1d8901){return this['channel']['error'](_0x542e67,_0xee4d('0xd1'));}if(!this[_0xee4d('0x86')](_0x542e67[_0xee4d('0xd2')])){return this['channel'][_0xee4d('0x31')](_0x542e67,_0xee4d('0xd3'));}var _0x337a14=_0x542e67[_0xee4d('0xd2')][_0xee4d('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xd4'),_0x337a14));var _0x553de4=this['getQueryOdbc'][_0xee4d('0x6c')](this,_0x1d8901,_0x337a14);this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x542e67,_0x337a14);if(!this['isConfigured'](_0x542e67[_0xee4d('0xd5')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xd6'));}var _0x2e61a8=this[_0xee4d('0x14')][_0xee4d('0x6c')](this,_0x542e67[_0xee4d('0xd5')]);if(!_0x2e61a8){return this[_0xee4d('0x10')]['error'](_0x542e67,_0xee4d('0xd7'));}var _0x216d4a=this;_0x553de4['forEach'](function(_0x3956ce,_0x38ae22){Object['keys'](_0x3956ce)['forEach'](function(_0x1f7fb9){_0x216d4a[_0xee4d('0x10')][_0xee4d('0xa2')](util[_0xee4d('0x2d')]('%s[%s][%s]',_0x2e61a8,_0x38ae22,_0x1f7fb9),_0x3956ce[_0x1f7fb9]);});});this['channel'][_0xee4d('0xa2')](util[_0xee4d('0x2d')](_0xee4d('0xd8'),_0x2e61a8),_0x553de4[_0xee4d('0x9e')]);return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xd9'),_0x2e61a8));};AGIVertices[_0xee4d('0x13')][_0xee4d('0xda')]=function(_0x4c54f2){logger[_0xee4d('0xdb')](util[_0xee4d('0x2d')](_0xee4d('0xdc'),_0x4c54f2[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x4c54f2[_0xee4d('0xdd')])){return this[_0xee4d('0x10')]['error'](_0x4c54f2,_0xee4d('0xde'));}var _0x134c9b=this['getUser'][_0xee4d('0x6c')](this,_0x4c54f2[_0xee4d('0xdd')]);if(!_0x134c9b){return this[_0xee4d('0x10')]['error'](_0x4c54f2,_0xee4d('0xdf'));}var _0x519305=this[_0xee4d('0x10')]['exec']('DIAL',[util[_0xee4d('0x2d')](_0xee4d('0xe0'),_0x134c9b),_0x4c54f2[_0xee4d('0x63')],_0x4c54f2[_0xee4d('0xe1')],_0x4c54f2[_0xee4d('0x61')]]);if(_0x519305['result']===-0x1){return _0x519305;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xe2'),'DIAL'));};AGIVertices['prototype'][_0xee4d('0xe3')]=function(_0x5030be){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0xe4'),_0x5030be[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x5030be[_0xee4d('0x79')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xe5'));}if(!this['isConfigured'](_0x5030be[_0xee4d('0x7a')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')]('no\x20text\x20configured');}this[_0xee4d('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x5030be);this[_0xee4d('0x44')](_0x5030be[_0xee4d('0x7a')],'in','','');this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xe6'),_0x5030be['text']));var _0x58f25d=this[_0xee4d('0x78')][_0xee4d('0x6c')](this,_0x5030be);if(_0x58f25d){for(var _0xfd0ac8 in _0x58f25d){if(_0x58f25d['hasOwnProperty'](_0xfd0ac8)){this[_0xee4d('0x10')][_0xee4d('0xa2')](util['format'](_0xee4d('0xe7'),_0xfd0ac8[_0xee4d('0xe8')]()),_0x58f25d[_0xfd0ac8]);}}this[_0xee4d('0x44')](_0x58f25d[_0xee4d('0xe9')],_0xee4d('0xea'),_0xee4d('0xe3'),'');return this['channel']['noop'](util[_0xee4d('0x2d')](_0xee4d('0xeb'),_0x58f25d[_0xee4d('0xe9')]));}return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x5030be,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xee4d('0x13')]['dialogflowV2']=function(_0x5bcac6){logger['info'](util['format'](_0xee4d('0xec'),_0x5bcac6['label']));if(!this['isConfigured'](_0x5bcac6[_0xee4d('0x7d')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xed'));}if(!this['isConfigured'](_0x5bcac6[_0xee4d('0x7e')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xee'));}if(!this[_0xee4d('0x86')](_0x5bcac6[_0xee4d('0x7f')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xef'));}if(!this[_0xee4d('0x86')](_0x5bcac6[_0xee4d('0x80')])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0xf0'));}if(!this[_0xee4d('0x86')](_0x5bcac6['text'])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xc7'));}this['channel'][_0xee4d('0xf1')]=!![];this[_0xee4d('0x3a')](_0x5bcac6);this[_0xee4d('0x44')](_0x5bcac6[_0xee4d('0x7a')],'in','','');this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0xf2'),_0x5bcac6[_0xee4d('0x7a')]));var _0x56b79a=this[_0xee4d('0x7c')]['sync'](this,_0x5bcac6);if(_0x56b79a){for(var _0x30fb4e in _0x56b79a){if(_0x56b79a[_0xee4d('0x97')](_0x30fb4e)){if(_0x30fb4e!==_0xee4d('0xf3')){this['channel'][_0xee4d('0xa2')](util['format'](_0xee4d('0xe7'),_0x30fb4e[_0xee4d('0xe8')]()),_0x56b79a[_0x30fb4e]);}}}this['createSquareMessage'](_0x56b79a['speech'],_0xee4d('0xea'),_0xee4d('0xf4'),_0x56b79a[_0xee4d('0xf3')]);return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xf5'),_0x56b79a[_0xee4d('0xe9')]));}return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x5bcac6,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xee4d('0x13')][_0xee4d('0xf6')]=function(_0x1c9419){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1c9419['label']));if(!this[_0xee4d('0x86')](_0x1c9419[_0xee4d('0xf7')])){return this['channel'][_0xee4d('0xaf')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xee4d('0x86')](_0x1c9419['username'])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0xf8'));}if(!this['isConfigured'](_0x1c9419[_0xee4d('0xf9')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xfa'));}if(!this[_0xee4d('0x86')](_0x1c9419[_0xee4d('0xfb')])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0xc7'));}this[_0xee4d('0x10')][_0xee4d('0xf1')]=!![];this['createSquareDetailsReport'](_0x1c9419);this[_0xee4d('0x44')](_0x1c9419[_0xee4d('0x7a')],'in','','');this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xfc'),_0x1c9419['text']));var _0x50709d=this[_0xee4d('0x81')][_0xee4d('0x6c')](this,_0x1c9419);if(_0x50709d){for(var _0x5e59f9 in _0x50709d){if(_0x50709d[_0xee4d('0x97')](_0x5e59f9)){this[_0xee4d('0x10')][_0xee4d('0xa2')](util[_0xee4d('0x2d')](_0xee4d('0xfd'),_0x5e59f9[_0xee4d('0xe8')]()),_0x50709d[_0x5e59f9]);}}this[_0xee4d('0x44')](_0x50709d['speech'],_0xee4d('0xea'),'sesteknda','');if(_0x50709d[_0xee4d('0xfe')]){this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xff'),_0x50709d['audiofile']));var _0x3e3351=this[_0xee4d('0x10')]['streamFile'](_0x50709d['audiofile']);try{fs[_0xee4d('0x100')](_0x50709d[_0xee4d('0xfe')]+'.wav');}catch(_0x4a6b75){logger[_0xee4d('0x31')](_0x4a6b75);}return _0x3e3351;}else{return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x101'),_0x50709d[_0xee4d('0xe9')]));}}return this['channel'][_0xee4d('0x31')](_0x1c9419,_0xee4d('0x102'));};AGIVertices['prototype']['end']=function(_0x2ca1cf){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2ca1cf[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x103'));};AGIVertices[_0xee4d('0x13')]['ext_dial']=function(_0x1d2271){logger[_0xee4d('0x33')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1d2271[_0xee4d('0x3c')]));var _0xab141c='';if(_0x1d2271[_0xee4d('0x104')]){if(!this[_0xee4d('0x86')](_0x1d2271['trunk_id'])){return this['channel'][_0xee4d('0x31')](_0x1d2271,'no\x20trunk\x20selected');}else{var _0x6212ef=parseInt(_0x1d2271[_0xee4d('0x104')],0xa);if(isNaN(_0x6212ef)){_0xab141c=_0x1d2271[_0xee4d('0x104')];}else{_0xab141c=this[_0xee4d('0x1f')]['sync'](this,_0x1d2271['trunk_id']);if(!_0xab141c){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x1d2271,_0xee4d('0x105'));}}}}else if(_0x1d2271[_0xee4d('0x106')]){_0xab141c=_0x1d2271[_0xee4d('0x106')];}else{return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x1d2271,_0xee4d('0x107'));}var _0x269e19=this[_0xee4d('0x10')][_0xee4d('0x56')](_0xee4d('0x108'),[util[_0xee4d('0x2d')](_0xee4d('0x109'),_0xab141c,_0x1d2271[_0xee4d('0xbf')]),_0x1d2271['timeout'],_0x1d2271[_0xee4d('0xe1')],_0x1d2271['url']]);if(_0x269e19[_0xee4d('0xa6')]===-0x1){return _0x269e19;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xe2'),_0xee4d('0x108')));};AGIVertices['prototype'][_0xee4d('0x10a')]=function(_0x872987){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x872987[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x10a'));};AGIVertices['prototype']['getdigits']=function(_0x2b0b60){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x10b'),_0x2b0b60[_0xee4d('0x3c')]));if(_0x2b0b60[_0xee4d('0xa8')]===0x0){return this[_0xee4d('0xa7')](_0x2b0b60);}_0x2b0b60['retry']-=0x1;if(!this[_0xee4d('0x86')](_0x2b0b60['file_id'])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x2b0b60,'no\x20file\x20audio\x20selected');}var _0x2739ed=this['getSound']['sync'](this,_0x2b0b60[_0xee4d('0x10c')]);if(!_0x2739ed){return this[_0xee4d('0x10')]['error'](_0x2b0b60,_0xee4d('0x10d'));}if(!this[_0xee4d('0x86')](_0x2b0b60['variable_id'])){return this[_0xee4d('0x10')][_0xee4d('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5513fb=this[_0xee4d('0x10')][_0xee4d('0x10e')](_0x2739ed,_0x2b0b60[_0xee4d('0x10f')],_0x2b0b60[_0xee4d('0x110')]);var _0x4e11c8=_0x5513fb['result']?_0x5513fb[_0xee4d('0xa6')]['toString']():'';logger[_0xee4d('0x33')](_0xee4d('0x111'),JSON['stringify'](_0x5513fb));if(_0x5513fb[_0xee4d('0xa6')]===-0x1){this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x2b0b60,_0x4e11c8);return _0x5513fb;}else if(_0x5513fb[_0xee4d('0xa4')]===_0xee4d('0x63')){_0x5513fb[_0xee4d('0xa6')]=_0x4e11c8[_0xee4d('0x9e')]>=parseInt(_0x2b0b60[_0xee4d('0x112')])?'x':'i';}else{_0x5513fb['result']=_0x4e11c8['length']>=parseInt(_0x2b0b60[_0xee4d('0x112')])&&_0x4e11c8[_0xee4d('0x9e')]<=parseInt(_0x2b0b60[_0xee4d('0x110')])?'x':'i';}var _0x1cafbe=this['getVariable'][_0xee4d('0x6c')](this,_0x2b0b60['variable_id']);if(!_0x1cafbe){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x2b0b60,'no\x20variable\x20found');}this[_0xee4d('0x10')][_0xee4d('0xa2')](_0x1cafbe,_0x4e11c8);if(this[_0xee4d('0x86')](_0x2b0b60['hiddendigitsnum'])){var _0x27644a=parseInt(_0x2b0b60[_0xee4d('0x113')],0xa);var _0x1b8d51=rs[_0xee4d('0x114')]({'charset':'*','length':_0x27644a});var _0x4dea50=_0x4e11c8['length'];if(_0x4dea50>0x0){if(_0x4dea50>_0x27644a){this[_0xee4d('0x3a')]['sync'](this,_0x2b0b60,_0x2b0b60['hiddendigitspos']===_0xee4d('0x115')?_0x1b8d51+_0x4e11c8[_0xee4d('0x116')](_0x27644a):_0x4e11c8[_0xee4d('0x116')](0x0,_0x4dea50-_0x27644a)+_0x1b8d51);}else{this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x2b0b60,rs[_0xee4d('0x114')]({'charset':'*','length':_0x4dea50}));}}else{this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x2b0b60,'');}}else{this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x2b0b60,_0x4e11c8);}return _0x5513fb;};AGIVertices[_0xee4d('0x13')][_0xee4d('0xf')]=function(_0x1c62ef){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x117'),_0x1c62ef[_0xee4d('0x3c')]));return this['getdigits'](_0x1c62ef);};AGIVertices['prototype'][_0xee4d('0x118')]=function(_0x3d6afb){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x119'),_0x3d6afb[_0xee4d('0x3c')]));this['createSquareDetailsReport']['sync'](this,_0x3d6afb,_0x3d6afb[_0xee4d('0x11a')]);return this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')](_0xee4d('0x11b'),_0x3d6afb[_0xee4d('0x11a')]));};AGIVertices[_0xee4d('0x13')]['awspolly']=function(_0x2e2dcf){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x11c'),_0x2e2dcf[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x2e2dcf[_0xee4d('0x89')])||!this['isConfigured'](_0x2e2dcf['aws_secret_access_key'])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0x11d'));}if(!this['isConfigured'](_0x2e2dcf['text'])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0xc7'));}this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x2e2dcf['text']));var _0x4a3254=this[_0xee4d('0x88')]['sync'](this,_0x2e2dcf);if(_0x4a3254){this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x11e'),_0x4a3254));var _0x2b1bff=this[_0xee4d('0x10')][_0xee4d('0x11f')](_0x4a3254);try{fs[_0xee4d('0x100')](_0x4a3254+_0xee4d('0x120'));}catch(_0x5d7426){logger[_0xee4d('0x31')](_0x5d7426);}return _0x2b1bff;}return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x2e2dcf,_0xee4d('0x121'));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x122')]=function(_0x2d9c8f){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x123'),_0x2d9c8f[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x2d9c8f[_0xee4d('0x89')])||!this['isConfigured'](_0x2d9c8f[_0xee4d('0x8a')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x11d'));}if(!this[_0xee4d('0x86')](_0x2d9c8f[_0xee4d('0x124')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x125'));}if(!this['isConfigured'](_0x2d9c8f[_0xee4d('0x7a')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xc7'));}this['channel'][_0xee4d('0xf1')]=!![];this[_0xee4d('0x3a')](_0x2d9c8f);this['createSquareMessage'](_0x2d9c8f[_0xee4d('0x7a')],'in','','');this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2d9c8f[_0xee4d('0x7a')]));var _0x27a982=this[_0xee4d('0x8e')][_0xee4d('0x6c')](this,_0x2d9c8f);if(_0x27a982){for(var _0x453c9e in _0x27a982){if(_0x27a982[_0xee4d('0x97')](_0x453c9e)&&_[_0xee4d('0x98')](_0x27a982[_0x453c9e])){this[_0xee4d('0x10')]['setVariable'](util[_0xee4d('0x2d')](_0xee4d('0x126'),_0x453c9e[_0xee4d('0xe8')]()),_0x27a982[_0x453c9e]);}}if(_[_0xee4d('0x46')](_0x27a982[_0xee4d('0x75')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0x127'));}else{this[_0xee4d('0x44')](_0x27a982['message'],_0xee4d('0xea'),_0xee4d('0x128'),'');return this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x27a982[_0xee4d('0x75')]));}}return this['channel'][_0xee4d('0x31')](_0x2d9c8f,_0xee4d('0x129'));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x12a')]=function(_0x56445d){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x12b'),_0x56445d[_0xee4d('0x3c')],_0x56445d['timeout']));if(!this[_0xee4d('0x86')](_0x56445d[_0xee4d('0x79')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xe5'));}var _0x22f31b=_0xee4d('0x12c');var _0x3d13e7=util[_0xee4d('0x2d')](_0xee4d('0x12d'),FILES_PATH,rs[_0xee4d('0x114')](0x4));var _0x1d3558=util[_0xee4d('0x2d')](_0xee4d('0xa1'),_0x3d13e7,_0x22f31b);var _0x11a430=!![];if(_0x56445d['beep']===_0xee4d('0x12e')){_0x11a430=![];}var _0x27d878=this[_0xee4d('0x10')][_0xee4d('0x12f')](_0x3d13e7,_0x22f31b,_0x56445d[_0xee4d('0x130')],_0x56445d['timeout'],undefined,_0x11a430);if(_0x27d878['result']!==-0x1){this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x131'),_0x1d3558));var _0x307e71=this['googleASR']['sync'](this,_0x56445d,_0x1d3558);if(_0x307e71){for(var _0x23ea78 in _0x307e71){if(_0x307e71[_0xee4d('0x97')](_0x23ea78)){this[_0xee4d('0x10')][_0xee4d('0xa2')](util[_0xee4d('0x2d')](_0xee4d('0x132'),_0x23ea78[_0xee4d('0xe8')]()),_0x307e71[_0x23ea78]);}}return this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')]('GoogleASR\x20Result\x20%s',JSON[_0xee4d('0x71')](_0x307e71)));}}return _0x27d878;};AGIVertices['prototype'][_0xee4d('0x133')]=function(_0x193bd7){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x193bd7[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x193bd7['appid'])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x134'));}if(!this[_0xee4d('0x86')](_0x193bd7[_0xee4d('0x94')])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0x135'));}var _0x745b3d=_0xee4d('0x12c');var _0x1f3907=util[_0xee4d('0x2d')](_0xee4d('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x2d6cc0=util[_0xee4d('0x2d')](_0xee4d('0xa1'),_0x1f3907,_0x745b3d);var _0x4c5898=!![];if(_0x193bd7[_0xee4d('0x136')]==='NOBEEP'){_0x4c5898=![];}var _0x2fec49=this[_0xee4d('0x10')]['recordFile'](_0x1f3907,_0x745b3d,_0x193bd7[_0xee4d('0x130')],_0x193bd7[_0xee4d('0x63')],undefined,_0x4c5898);if(_0x2fec49[_0xee4d('0xa6')]!==-0x1){this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x137'),_0x2d6cc0));var _0x2b64d0=this[_0xee4d('0x92')][_0xee4d('0x6c')](this,_0x193bd7,_0x2d6cc0);if(_0x2b64d0){for(var _0x5883c1 in _0x2b64d0){if(_0x2b64d0[_0xee4d('0x97')](_0x5883c1)){this[_0xee4d('0x10')]['setVariable'](util[_0xee4d('0x2d')]('TILDE_ASR_%s',_0x5883c1[_0xee4d('0xe8')]()),_0x2b64d0[_0x5883c1]);}}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x138'),JSON[_0xee4d('0x71')](_0x2b64d0)));}}return _0x2fec49;};AGIVertices[_0xee4d('0x13')][_0xee4d('0x139')]=function(_0x51fb13){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x13a'),_0x51fb13[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0x13b')](_0x51fb13['context'],_0x51fb13[_0xee4d('0x13c')],_0x51fb13[_0xee4d('0x42')]);};AGIVertices['prototype']['gotoif']=function(_0x4847a1){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x13d'),_0x4847a1[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x4847a1[_0xee4d('0x13e')])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x4847a1,'no\x20condition\x20configured');}try{var _0x2cd0c9=eval(_0x4847a1['condition'])?_0xee4d('0x13f'):_0xee4d('0x140');this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4847a1[_0xee4d('0x13e')],_0x2cd0c9));return{'code':0xc8,'result':_0x2cd0c9};}catch(_0x31a038){return{'code':0xc8,'result':_0xee4d('0x140')};}};AGIVertices['prototype'][_0xee4d('0x141')]=function(_0x157ce3){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x142'),_0x157ce3[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x157ce3['interval_id'])){return this['channel']['error'](_0x157ce3,_0xee4d('0x143'));}var _0xd3d097=this[_0xee4d('0x27')][_0xee4d('0x6c')](this,_0x157ce3[_0xee4d('0x144')]);if(!_0xd3d097){return this['channel'][_0xee4d('0x31')](_0x157ce3,_0xee4d('0x145'));}for(var _0x3a24ed=0x0;_0x3a24ed<_0xd3d097[_0xee4d('0x9e')];_0x3a24ed+=0x1){var _0x75bfe5=this[_0xee4d('0x10')][_0xee4d('0x14')](util['format'](_0xee4d('0x146'),_0xd3d097[_0x3a24ed]));if(_0x75bfe5['result']===-0x1){return _0x75bfe5;}logger[_0xee4d('0x33')](util['format']('IFTIME\x20%s\x20%s',_0xd3d097[_0x3a24ed],_0x75bfe5[_0xee4d('0xa4')]));if(_0x75bfe5[_0xee4d('0xa4')]==='true'){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x147'),_0xd3d097[_0x3a24ed],_0xee4d('0x13f')));this['channel']['noop'](util[_0xee4d('0x2d')](_0xee4d('0x147'),_0xd3d097[_0x3a24ed],_0xee4d('0x13f')));return{'code':0xc8,'result':_0xee4d('0x13f')};}else{logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x147'),_0xd3d097[_0x3a24ed],_0xee4d('0x140')));this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x147'),_0xd3d097[_0x3a24ed],'false'));}}return{'code':0xc8,'result':_0xee4d('0x140')};};AGIVertices['prototype']['hangup']=function(_0x5c978e){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x148'),_0x5c978e[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0x149')]();};AGIVertices[_0xee4d('0x13')]['ispeechasr']=function(_0x1cacaf){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1cacaf[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x1cacaf[_0xee4d('0x79')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xe5'));}var _0x41c018=_0xee4d('0x12c');var _0x2025c5=util[_0xee4d('0x2d')](_0xee4d('0x12d'),FILES_PATH,rs[_0xee4d('0x114')](0x4));var _0x5cd971=util[_0xee4d('0x2d')]('%s.%s',_0x2025c5,_0x41c018);var _0x3dbb9a=!![];if(_0x1cacaf['beep']===_0xee4d('0x12e')){_0x3dbb9a=![];}var _0x231ac5=this[_0xee4d('0x10')][_0xee4d('0x12f')](_0x2025c5,_0x41c018,_0x1cacaf[_0xee4d('0x130')],_0x1cacaf[_0xee4d('0x63')],undefined,_0x3dbb9a);if(_0x231ac5[_0xee4d('0xa6')]!==-0x1){this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x14a'),_0x5cd971));var _0x1c15fa=this['ispeechASR'][_0xee4d('0x6c')](this,_0x1cacaf,_0x5cd971);if(_0x1c15fa){for(var _0x5a85b1 in _0x1c15fa){if(_0x1c15fa[_0xee4d('0x97')](_0x5a85b1)){this[_0xee4d('0x10')][_0xee4d('0xa2')](util[_0xee4d('0x2d')]('ISPEECH_ASR_%s',_0x5a85b1[_0xee4d('0xe8')]()),_0x1c15fa[_0x5a85b1]);}}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('IspeechASR\x20Result\x20%s',JSON[_0xee4d('0x71')](_0x1c15fa)));}}return _0x231ac5;};AGIVertices[_0xee4d('0x13')][_0xee4d('0x14b')]=function(_0x24b49e){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x14c'),_0x24b49e[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x24b49e[_0xee4d('0x79')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xe5'));}if(!this[_0xee4d('0x86')](_0x24b49e['text'])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0xc7'));}this['channel'][_0xee4d('0xaf')](util['format'](_0xee4d('0x14d'),_0x24b49e['text']));var _0x2fae28=this['ispeechTTS'][_0xee4d('0x6c')](this,_0x24b49e);if(_0x2fae28){this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')]('ispeech\x20%s\x20file\x20created',_0x2fae28));var _0x3fb4d5=this['channel'][_0xee4d('0x11f')](_0x2fae28,_0x24b49e[_0xee4d('0x130')]);try{fs[_0xee4d('0x100')](_0x2fae28+_0xee4d('0x120'));}catch(_0x2eb69c){logger[_0xee4d('0x31')](_0x2eb69c);}return _0x3fb4d5;}return this['channel'][_0xee4d('0x31')](_0x24b49e,_0xee4d('0x14e'));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x14f')]=function(_0x166da6){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x150'),_0x166da6[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x166da6[_0xee4d('0x151')])){return this[_0xee4d('0x10')]['error'](_0x166da6,_0xee4d('0x152'));}logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x153'),this['channel'][_0xee4d('0x3f')],_0x166da6[_0xee4d('0x151')]));var _0x3b76a6=this[_0xee4d('0x53')][_0xee4d('0x6c')](this,_0x166da6[_0xee4d('0x151')]);if(_0x3b76a6){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x154'),this['channel'][_0xee4d('0x3f')],_0x166da6[_0xee4d('0x151')]));this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x154'),this[_0xee4d('0x10')]['callerid'],_0x166da6[_0xee4d('0x151')]));return{'code':0xc8,'result':_0xee4d('0x155')};}else{logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x156'),this['channel'][_0xee4d('0x3f')],_0x166da6[_0xee4d('0x151')]));this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0x156'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x166da6[_0xee4d('0x151')]));return{'code':0xc8,'result':_0xee4d('0x157')};}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x158')]=function(_0x3b7a2b){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x159'),_0x3b7a2b[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x3b7a2b[_0xee4d('0x151')])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x3b7a2b,_0xee4d('0x152'));}logger['info'](util['format'](_0xee4d('0x153'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x3b7a2b['findBy']));var _0x5f33a8=this[_0xee4d('0x52')][_0xee4d('0x6c')](this,_0x3b7a2b['findBy']);if(_0x5f33a8){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x154'),this['channel'][_0xee4d('0x3f')],_0x3b7a2b[_0xee4d('0x151')]));this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xee4d('0x10')]['callerid'],_0x3b7a2b['findBy']));return{'code':0xc8,'result':_0xee4d('0x155')};}else{logger[_0xee4d('0x33')](util['format'](_0xee4d('0x156'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x3b7a2b[_0xee4d('0x151')]));this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xee4d('0x10')]['callerid'],_0x3b7a2b[_0xee4d('0x151')]));return{'code':0xc8,'result':_0xee4d('0x157')};}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x15a')]=function(_0x115ea6){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x15b'),_0x115ea6[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x115ea6['operation'])){return this['channel'][_0xee4d('0x31')](_0x115ea6,_0xee4d('0x15c'));}this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')](_0xee4d('0x15d'),_0x115ea6[_0xee4d('0x15e')]));var _0x3d6380=eval(_0x115ea6[_0xee4d('0x15e')]);if(!this[_0xee4d('0x86')](_0x115ea6[_0xee4d('0xd5')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xd6'));}var _0x3dd852=this[_0xee4d('0x14')][_0xee4d('0x6c')](this,_0x115ea6[_0xee4d('0xd5')]);if(!_0x3dd852){return this[_0xee4d('0x10')]['error'](_0x115ea6,_0xee4d('0xd7'));}if(_[_0xee4d('0x9d')](_0x3d6380)){var _0x6e6e32=this;_0x3d6380[_0xee4d('0x15f')](function(_0x235b31,_0x39b0e6){_0x6e6e32[_0xee4d('0x10')][_0xee4d('0xa2')](util[_0xee4d('0x2d')](_0xee4d('0x160'),_0x3dd852,_0x39b0e6),_0x235b31);});return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x161'),_0x3dd852));}else{return this[_0xee4d('0x10')][_0xee4d('0xa2')](_0x3dd852,_0x3d6380);}};AGIVertices[_0xee4d('0x13')][_0xee4d('0xd')]=function(_0x32ef73){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x32ef73[_0xee4d('0x3c')]));if(_0x32ef73[_0xee4d('0xa8')]===0x0){return this[_0xee4d('0xa7')](_0x32ef73);}_0x32ef73[_0xee4d('0xa8')]-=0x1;if(!this[_0xee4d('0x86')](_0x32ef73[_0xee4d('0x10c')])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x32ef73,_0xee4d('0x162'));}var _0x54d231=this[_0xee4d('0x21')][_0xee4d('0x6c')](this,_0x32ef73[_0xee4d('0x10c')]);if(!_0x54d231){return this['channel']['error'](_0x32ef73,_0xee4d('0x10d'));}var _0x5270b3=this['channel']['getData'](_0x54d231,_0x32ef73[_0xee4d('0x10f')],_0x32ef73[_0xee4d('0x163')]);var _0x30525e=_0x5270b3[_0xee4d('0xa6')];if(_0x5270b3[_0xee4d('0xa6')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x32ef73,'-1');return _0x5270b3;}else if(_0x5270b3[_0xee4d('0xa4')]===_0xee4d('0x63')){_0x5270b3['result']=_0x5270b3[_0xee4d('0xa6')][_0xee4d('0x9e')]>0x0?_0x5270b3['result']:'t';}else if(_[_0xee4d('0xa0')](_0x5270b3[_0xee4d('0xa6')])){_0x5270b3[_0xee4d('0xa6')]='#';_0x30525e='#';}if(!this[_0xee4d('0x86')](_0x32ef73[_0xee4d('0xd5')])){this['channel'][_0xee4d('0xaf')](_0xee4d('0xd6'));}else{var _0x3504c8=this['getVariable']['sync'](this,_0x32ef73['variable_id']);if(!_0x3504c8){return this['channel'][_0xee4d('0x31')](_0x32ef73,_0xee4d('0xd7'));}this[_0xee4d('0x10')]['setVariable'](_0x3504c8,_0x30525e);}this['createSquareDetailsReport'][_0xee4d('0x6c')](this,_0x32ef73,_0x30525e);return _0x5270b3;};AGIVertices[_0xee4d('0x13')][_0xee4d('0xaf')]=function(_0x1678fc){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x164'),_0x1678fc[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0x1678fc[_0xee4d('0x165')]||_0x1678fc[_0xee4d('0x3c')]);};AGIVertices['prototype'][_0xee4d('0x166')]=function(_0x20fea7){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x167'),_0x20fea7[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x20fea7[_0xee4d('0x151')])){return this[_0xee4d('0x10')]['error'](_0x20fea7,_0xee4d('0x152'));}logger[_0xee4d('0x33')](util['format'](_0xee4d('0x153'),this['channel'][_0xee4d('0x3f')],_0x20fea7[_0xee4d('0x151')]));var _0x21600e=this[_0xee4d('0x4d')][_0xee4d('0x6c')](this,_0x20fea7['pause_id']);var _0x34f334=this['agentPause']['sync'](this,_0x20fea7[_0xee4d('0x151')],_0x21600e);if(_0x34f334){logger['info'](util['format'](_0xee4d('0x154'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x20fea7[_0xee4d('0x151')]));this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x154'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x20fea7[_0xee4d('0x151')]));return{'code':0xc8,'result':_0xee4d('0x155')};}else{logger['info'](util['format'](_0xee4d('0x156'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x20fea7[_0xee4d('0x151')]));this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0x154'),this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x20fea7[_0xee4d('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xee4d('0x13')][_0xee4d('0x168')]=function(_0x1014d3){logger['info'](util[_0xee4d('0x2d')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1014d3[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x1014d3[_0xee4d('0x10c')])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x1014d3,_0xee4d('0x162'));}var _0x113499=this['getSound'][_0xee4d('0x6c')](this,_0x1014d3[_0xee4d('0x10c')]);if(!_0x113499){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x1014d3,'no\x20file\x20audio\x20found');}var _0x50b036=this[_0xee4d('0x10')][_0xee4d('0x56')]('PLAYBACK',[_0x113499,_0x1014d3[_0xee4d('0xe1')]]);if(_0x50b036[_0xee4d('0xa6')]===-0x1){return _0x50b036;}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xc3'),_0xee4d('0x169'),_0x113499));};AGIVertices['prototype']['queue']=function(_0x211585){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x16a'),_0x211585[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x211585[_0xee4d('0x16b')])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x211585,_0xee4d('0x16c'));}var _0x1cbd65='';var _0x301e82=parseInt(_0x211585[_0xee4d('0x16b')],0xa);if(isNaN(_0x301e82)){_0x1cbd65=_0x211585[_0xee4d('0x16b')];}else{_0x1cbd65=this[_0xee4d('0x18')][_0xee4d('0x6c')](this,_0x211585[_0xee4d('0x16b')]);if(!_0x1cbd65){return this[_0xee4d('0x10')]['error'](_0x211585,'no\x20queue\x20found');}}var _0x4f9263='';if(this[_0xee4d('0x86')](_0x211585[_0xee4d('0x10c')])){var _0x59da89=this[_0xee4d('0x21')]['sync'](this,_0x211585[_0xee4d('0x10c')]);if(_0x59da89){_0x4f9263=_0x59da89;}}this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x211585,_0x1cbd65);if(_0x211585[_0xee4d('0xe1')]['indexOf']('x')<0x0){_0x211585[_0xee4d('0xe1')]+='x';}if(_0x211585['opts']['indexOf']('X')<0x0){_0x211585[_0xee4d('0xe1')]+='X';}this[_0xee4d('0x10')]['setVariable']('XMCS-QUEUE',_0x1cbd65?_0x1cbd65[_0xee4d('0x16d')]():'');var _0x4753c5=this['channel'][_0xee4d('0x56')]('QUEUE',[_0x1cbd65,_0x211585[_0xee4d('0xe1')],_0x211585[_0xee4d('0x61')],_0x4f9263,_0x211585[_0xee4d('0x63')],_0x211585[_0xee4d('0x9')],_0x211585[_0xee4d('0x16e')],_0x211585['gosub'],'',_0x211585[_0xee4d('0x16f')]]);if(_0x4753c5[_0xee4d('0xa6')]===-0x1){return _0x4753c5;}return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xc3'),_0xee4d('0x170'),_0x1cbd65));};AGIVertices[_0xee4d('0x13')]['record']=function(_0x1da04e){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x171'),_0x1da04e[_0xee4d('0x3c')]));var _0x3fb85f=_0x1da04e['recordingFormat']||'wav';var _0x880ac9=util[_0xee4d('0x2d')](_0xee4d('0x172'),this[_0xee4d('0x10')][_0xee4d('0x3b')],rs[_0xee4d('0x114')](0x5));var _0x7f8a71=util['format'](_0xee4d('0x173'),FILES_PATH,_0x880ac9,_0x3fb85f);var _0x3a2dc6=util[_0xee4d('0x2d')](_0xee4d('0x12d'),FILES_PATH,_0x880ac9);this[_0xee4d('0x40')][_0xee4d('0x6c')](this,_0x1da04e,_0x880ac9,_0x7f8a71);this['channel'][_0xee4d('0xa2')](_0xee4d('0x174'),_0x880ac9);logger['info'](_0xee4d('0x175'),_0x3a2dc6,_0x3fb85f,_0x1da04e[_0xee4d('0x176')],_0x1da04e[_0xee4d('0x63')]);return this['channel'][_0xee4d('0x12f')](_0x3a2dc6,_0x3fb85f,_0x1da04e[_0xee4d('0x176')],_0x1da04e[_0xee4d('0x63')],undefined,!![]);};AGIVertices[_0xee4d('0x13')][_0xee4d('0x177')]=function(_0x4d51be){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x4d51be[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x4d51be['url'])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x178'));}var _0x462127=this['restAPI'][_0xee4d('0x6c')](this,_0x4d51be);logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Response:',util['inspect'](_0x462127,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4d51be['variable_id'])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x179'));}var _0x6f5510=this[_0xee4d('0x14')][_0xee4d('0x6c')](this,_0x4d51be[_0xee4d('0xd5')]);if(!_0x6f5510){return this['channel']['error'](_0x4d51be,_0xee4d('0xd7'));}this['channel'][_0xee4d('0xa2')](util[_0xee4d('0x2d')](_0xee4d('0x17a'),_0x6f5510),_0x462127[_0xee4d('0x73')]?_0x462127[_0xee4d('0x73')]:'200');this['channel']['setVariable'](util[_0xee4d('0x2d')]('%s_STATUS_MESSAGE',_0x6f5510),_0x462127[_0xee4d('0x74')]?_0x462127['statusMessage']:'OK');if(_0x462127[_0xee4d('0x70')]){try{this[_0xee4d('0x9f')](_0x462127[_0xee4d('0x70')],_0x6f5510);}catch(_0x243f2c){logger[_0xee4d('0x31')](util[_0xee4d('0x2d')](_0xee4d('0x17b'),_0x6f5510));}}return this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0xd9'),_0x6f5510));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x17c')]=function(_0x56f0e5){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x17d'),_0x56f0e5['label']));return this[_0xee4d('0x10')][_0xee4d('0x17e')](_0x56f0e5[_0xee4d('0x17f')][_0xee4d('0x58')](/\s+/g,''),_0x56f0e5['escape_digits']);};AGIVertices['prototype'][_0xee4d('0x180')]=function(_0x535c0f){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x181'),_0x535c0f['label']));return this[_0xee4d('0x10')]['sayNumber'](_0x535c0f[_0xee4d('0x64')][_0xee4d('0x58')](/\s+/g,''),_0x535c0f[_0xee4d('0x176')]);};AGIVertices[_0xee4d('0x13')]['sayphonetic']=function(_0x29319f){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x182'),_0x29319f[_0xee4d('0x3c')]));return this[_0xee4d('0x10')][_0xee4d('0x183')](_0x29319f[_0xee4d('0x7a')],_0x29319f[_0xee4d('0x176')]);};AGIVertices[_0xee4d('0x13')][_0xee4d('0x184')]=function(_0x31543a){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x185'),_0x31543a[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x31543a[_0xee4d('0x186')])){return this['channel'][_0xee4d('0xaf')](_0xee4d('0x187'));}var _0x2ab3d1=this[_0xee4d('0x24')]['sync'](this,_0x31543a[_0xee4d('0x186')]);if(!_0x2ab3d1||!_0x2ab3d1[_0xee4d('0x188')]){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x31543a,_0xee4d('0x189'));}var _0x2afcb3={'from':util[_0xee4d('0x2d')]('\x22%s\x22\x20<%s>',_0x2ab3d1[_0xee4d('0x16')],_0x2ab3d1['email']||_0x2ab3d1[_0xee4d('0x188')]['user']),'to':_0x31543a['to']||'','cc':_0x31543a['cc']||'','bcc':_0x31543a['bcc']||'','subject':_0x31543a[_0xee4d('0x18a')],'html':_0x31543a[_0xee4d('0x7a')],'text':_0x31543a[_0xee4d('0x7a')]};var _0x14f7ca={'tls':{'rejectUnauthorized':![]}};if(_0x2ab3d1[_0xee4d('0x188')]['service']){_0x14f7ca['service']=_0x2ab3d1['Smtp'][_0xee4d('0x18b')];}else{_0x14f7ca[_0xee4d('0x18c')]=_0x2ab3d1[_0xee4d('0x188')][_0xee4d('0x18c')];_0x14f7ca['port']=_0x2ab3d1[_0xee4d('0x188')]['port'];_0x14f7ca[_0xee4d('0x18d')]=_0x2ab3d1[_0xee4d('0x188')][_0xee4d('0x18d')];}if(_0x2ab3d1[_0xee4d('0x188')][_0xee4d('0x18e')]){_0x14f7ca['auth']={'user':_0x2ab3d1[_0xee4d('0x188')][_0xee4d('0x18f')],'pass':_0x2ab3d1[_0xee4d('0x188')][_0xee4d('0x190')]};}if(this[_0xee4d('0x86')](_0x31543a[_0xee4d('0x191')])){}logger['debug'](_0xee4d('0x192'),JSON[_0xee4d('0x71')](_0x2afcb3));this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x31543a,_0x31543a[_0xee4d('0x186')]);this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x193'),_0x2ab3d1[_0xee4d('0x16')]));this['sendMailMessage'][_0xee4d('0x6c')](this,_0x14f7ca,_0x2afcb3);return this[_0xee4d('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xee4d('0x13')][_0xee4d('0x194')]=function(_0x2db63e){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x195'),_0x2db63e['label']));return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x196'));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x197')]=function(_0x35ccc4){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x35ccc4[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x35ccc4[_0xee4d('0x198')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x199'));}var _0x198ed3=this[_0xee4d('0x37')][_0xee4d('0x6c')](this,_0x35ccc4[_0xee4d('0x198')]);if(!_0x198ed3){return this['channel'][_0xee4d('0x31')](_0x35ccc4,_0xee4d('0x19a'));}var _0x5f47ab={'body':_0x35ccc4[_0xee4d('0x19b')],'phone':_0x35ccc4['to']||'','SmsAccountId':_0x198ed3['id']};logger[_0xee4d('0xdb')](_0xee4d('0x19c'),JSON[_0xee4d('0x71')](_0x5f47ab));this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x35ccc4,_0x35ccc4[_0xee4d('0x198')]);this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x19d'),_0x198ed3[_0xee4d('0x16')]));this[_0xee4d('0x39')][_0xee4d('0x6c')](this,_0x5f47ab);return this['channel'][_0xee4d('0xaf')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xee4d('0x19e')]=function(_0x237a9a){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x237a9a[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x237a9a[_0xee4d('0xd5')])){return this[_0xee4d('0x10')]['error'](_0x237a9a,_0xee4d('0x19f'));}var _0x332290=this[_0xee4d('0x14')]['sync'](this,_0x237a9a[_0xee4d('0xd5')]);if(!_0x332290){return this['channel'][_0xee4d('0x31')](_0x237a9a,'no\x20variable\x20found');}return this[_0xee4d('0x10')][_0xee4d('0xa2')](_0x332290,_0x237a9a[_0xee4d('0x1a0')]);};AGIVertices[_0xee4d('0x13')][_0xee4d('0x1a1')]=function(_0x25a369){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x1a2'),_0x25a369[_0xee4d('0x3c')]));this[_0xee4d('0x10')][_0xee4d('0xaf')]('START\x20CALLY\x20SQUARE');if(_0x25a369['answer']===_0xee4d('0x1a3')){this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x1a4'));return this['channel'][_0xee4d('0xb6')]();}return this['channel'][_0xee4d('0xaf')](_0xee4d('0x1a5'));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x1a6')]=function(_0x4dad0f){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x1a7'),_0x4dad0f[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x4dad0f['project_id'])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x4dad0f,_0xee4d('0x1a8'));}var _0x2eb745=this[_0xee4d('0x1a9')][_0xee4d('0x6c')](this,_0x4dad0f[_0xee4d('0x1aa')]);if(!this[_0xee4d('0x86')](_0x2eb745)){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x4dad0f,util[_0xee4d('0x2d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x4dad0f[_0xee4d('0x1aa')]));}if(_0x2eb745===this[_0xee4d('0x10')][_0xee4d('0x3e')]){return this['channel'][_0xee4d('0x31')](_0x4dad0f,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0x4dad0f,_0x2eb745);var _0x1bea6b=this[_0xee4d('0x10')][_0xee4d('0x56')](_0xee4d('0x1ab'),util['format'](_0xee4d('0x1ac'),config[_0xee4d('0x9')]['host']||'127.0.0.1',_0x2eb745,this['channel'][_0xee4d('0x3e')]));if(_0x1bea6b['result']===-0x1){return _0x1bea6b;}return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0xc3'),'AGI',_0x2eb745));};AGIVertices['prototype'][_0xee4d('0x1ad')]=function(_0xd2f8ed){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x1ae'),_0xd2f8ed[_0xee4d('0x3c')]));var _0x43738e=this[_0xee4d('0x1af')]['sync'](this,_0xd2f8ed['command']);this[_0xee4d('0x3a')][_0xee4d('0x6c')](this,_0xd2f8ed,_0xd2f8ed['command']);if(this['isConfigured'](_0xd2f8ed[_0xee4d('0xd5')])){var _0x2c05d3=this[_0xee4d('0x14')][_0xee4d('0x6c')](this,_0xd2f8ed[_0xee4d('0xd5')]);if(_0x2c05d3){this[_0xee4d('0x10')][_0xee4d('0xa2')](_0x2c05d3,_0x43738e);return this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x1b0'),_0xd2f8ed[_0xee4d('0x1b1')],_0x2c05d3));}}return this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')](_0xee4d('0x1b2'),_0xd2f8ed[_0xee4d('0x1b1')]));};AGIVertices['prototype'][_0xee4d('0x1b3')]=function(_0x16da9c){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x1b4'),_0x16da9c[_0xee4d('0x3c')]));_0x16da9c[_0xee4d('0x7a')]=_0x16da9c[_0xee4d('0x7a')][_0xee4d('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x16da9c[_0xee4d('0x1b5')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0x1b6'));}if(!this[_0xee4d('0x86')](_0x16da9c[_0xee4d('0x7a')])){return this[_0xee4d('0x10')][_0xee4d('0xaf')](_0xee4d('0xc7'));}this[_0xee4d('0x10')][_0xee4d('0xaf')](util['format'](_0xee4d('0x1b7'),_0x16da9c[_0xee4d('0x7a')]));var _0x41df58=this['googleCloudTTS'][_0xee4d('0x6c')](this,_0x16da9c);if(_0x41df58){this['channel'][_0xee4d('0xaf')](util['format'](_0xee4d('0x1b8'),_0x41df58));var _0xa9050c=this[_0xee4d('0x10')][_0xee4d('0x11f')](_0x41df58);try{fs['unlink'](_0x41df58+'.wav');}catch(_0x2ac0e8){logger[_0xee4d('0x31')](_0x2ac0e8);}return _0xa9050c;}return this[_0xee4d('0x10')]['error'](_0x16da9c,_0xee4d('0x1b9'));};AGIVertices['prototype'][_0xee4d('0x1ba')]=function(_0x44c3ab){logger[_0xee4d('0x33')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x44c3ab[_0xee4d('0x3c')]));_0x44c3ab[_0xee4d('0x7a')]=_0x44c3ab[_0xee4d('0x7a')][_0xee4d('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x44c3ab[_0xee4d('0x7a')])){return this[_0xee4d('0x10')]['noop'](_0xee4d('0xc7'));}this['channel'][_0xee4d('0xaf')](util[_0xee4d('0x2d')](_0xee4d('0x1bb'),_0x44c3ab[_0xee4d('0x7a')]));var _0x3e214b=this[_0xee4d('0x5f')]['sync'](this,_0x44c3ab);if(_0x3e214b){this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('Google\x20TTS\x20%s\x20file\x20created',_0x3e214b));var _0x146fd7=this[_0xee4d('0x10')][_0xee4d('0x11f')](_0x3e214b);try{fs['unlink'](_0x3e214b+'.wav');}catch(_0x5b613b){logger[_0xee4d('0x31')](_0x5b613b);}return _0x146fd7;}return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x44c3ab,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xee4d('0x13')]['unpause']=function(_0x8a5987){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')](_0xee4d('0x1bc'),_0x8a5987[_0xee4d('0x3c')]));if(!this[_0xee4d('0x86')](_0x8a5987['findBy'])){return this[_0xee4d('0x10')][_0xee4d('0x31')](_0x8a5987,_0xee4d('0x152'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x8a5987[_0xee4d('0x151')]));var _0x2c9eaf=this[_0xee4d('0x51')][_0xee4d('0x6c')](this,_0x8a5987[_0xee4d('0x151')]);if(_0x2c9eaf){logger['info'](util[_0xee4d('0x2d')](_0xee4d('0x154'),this[_0xee4d('0x10')]['callerid'],_0x8a5987['findBy']));this[_0xee4d('0x10')]['noop'](util[_0xee4d('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x8a5987[_0xee4d('0x151')]));return{'code':0xc8,'result':_0xee4d('0x155')};}else{logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xee4d('0x10')][_0xee4d('0x3f')],_0x8a5987[_0xee4d('0x151')]));this[_0xee4d('0x10')][_0xee4d('0xaf')](util[_0xee4d('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xee4d('0x3f')],_0x8a5987[_0xee4d('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xee4d('0x13')]['voicemail']=function(_0xaa2094){logger[_0xee4d('0x33')](util['format'](_0xee4d('0x1bd'),_0xaa2094['label']));var _0x1cd665=this[_0xee4d('0x10')][_0xee4d('0x56')](_0xee4d('0x1be'),[_0xaa2094['mailbox'],_0xaa2094['options']]);if(_0x1cd665['result']===-0x1){return _0x1cd665;}return this['channel']['noop'](util[_0xee4d('0x2d')](_0xee4d('0xc3'),_0xee4d('0x1be'),_0xaa2094['mailbox']));};AGIVertices[_0xee4d('0x13')][_0xee4d('0x1bf')]=function(_0x5dd183){logger[_0xee4d('0x33')](util[_0xee4d('0x2d')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5dd183[_0xee4d('0x3c')]));if(!this['isConfigured'](_0x5dd183[_0xee4d('0xd5')])){return this['channel']['error'](_0x5dd183,_0xee4d('0x19f'));}var _0x22ad2b=this[_0xee4d('0x14')][_0xee4d('0x6c')](this,_0x5dd183['variable_id']);if(!_0x22ad2b){return this['channel']['error'](_0x5dd183,'no\x20variable\x20found');}var _0x2a15d5=this[_0xee4d('0x10')][_0xee4d('0x14')](_0x22ad2b);return{'code':0xc8,'result':_0x2a15d5['extra']?_0x2a15d5[_0xee4d('0xa4')]:'-'};};String[_0xee4d('0x13')][_0xee4d('0x1c0')]=function(_0x552192,_0x56b762){return this[_0xee4d('0xa3')](_0x552192)['join'](_0x56b762);};module[_0xee4d('0x1c1')]=AGIVertices; \ No newline at end of file +var _0x62cf=['IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','intKey','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','gosub','record','%s_%s','createSquareRecording','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','service','host','port','secure','authentication','auth','user','pass','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','googleCloudTTS','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','path','lodash','odbc','randomstring','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','getVoiceQueueById','name','then','catch','getSquareOdbc','dsn','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','LOCAL','shellCommand','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','headers','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','isString','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','length','isPlainObject','%s.%s','isArray','saveRestApiResult','setVariable','split','extra','toString','getAndSetVariable','retry','mrcpsynth','noop','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','replace','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','out','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','maxRetry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','wav','GOOGLE_ASR_%s','tildeasr','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)'];(function(_0x1d591e,_0x5f80a){var _0x4cb2d4=function(_0x5f0224){while(--_0x5f0224){_0x1d591e['push'](_0x1d591e['shift']());}};_0x4cb2d4(++_0x5f80a);}(_0x62cf,0x81));var _0xf62c=function(_0x28bc97,_0x6ef00b){_0x28bc97=_0x28bc97-0x0;var _0x53184d=_0x62cf[_0x28bc97];return _0x53184d;};'use strict';var fs=require('fs');var path=require(_0xf62c('0x0'));var util=require('util');var _=require(_0xf62c('0x1'));var sh=require('shelljs');var odbc=require(_0xf62c('0x2'))();var rs=require(_0xf62c('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0xf62c('0x4'));var logger=require(_0xf62c('0x5'))(_0xf62c('0x6'));var config=require(_0xf62c('0x7'));var scripts=require(_0xf62c('0x8'));var FILES_PATH=_0xf62c('0x9');var recursiveMapAttributes=[_0xf62c('0xa'),_0xf62c('0xb')];var verticesWithRetry=[_0xf62c('0xc'),'getdigits',_0xf62c('0xd')];var AGIVertices=function(_0x4e0655,_0x34fdf0,_0x8038ed){this[_0xf62c('0xe')]=_0x4e0655;this[_0xf62c('0xf')]=_0x34fdf0;this[_0xf62c('0x10')]=_0x8038ed;};AGIVertices[_0xf62c('0x11')][_0xf62c('0x12')]=function(_0x1d52e9,_0x3b1b62){this[_0xf62c('0xf')][_0xf62c('0x13')](_0x1d52e9)['then'](function(_0x298b20){_0x3b1b62(null,_0x298b20?_0x298b20['name']:![]);})['catch'](function(_0x5a62bd){_0x3b1b62(_0x5a62bd);});};AGIVertices[_0xf62c('0x11')]['getVoiceQueue']=function(_0x4767bf,_0xc52899){this['rpc'][_0xf62c('0x14')](_0x4767bf)['then'](function(_0x265253){_0xc52899(null,_0x265253?_0x265253[_0xf62c('0x15')]:![]);})['catch'](function(_0x3c748a){_0xc52899(_0x3c748a);});};AGIVertices[_0xf62c('0x11')]['getSquareProject']=function(_0x29aece,_0x14b26e){this[_0xf62c('0xf')]['getSquareProjectById'](_0x29aece)[_0xf62c('0x16')](function(_0xc7da63){_0x14b26e(null,_0xc7da63?_0xc7da63[_0xf62c('0x15')]:![]);})[_0xf62c('0x17')](function(_0x32a7c3){_0x14b26e(_0x32a7c3);});};AGIVertices['prototype'][_0xf62c('0x18')]=function(_0xad689c,_0x359c25){this['rpc']['getSquareOdbcById'](_0xad689c)[_0xf62c('0x16')](function(_0x3c3624){_0x359c25(null,_0x3c3624?_0x3c3624[_0xf62c('0x19')]:![]);})[_0xf62c('0x17')](function(_0x23bf2b){_0x359c25(_0x23bf2b);});};AGIVertices['prototype']['getUser']=function(_0x5dc7ec,_0x11fda3){this[_0xf62c('0xf')][_0xf62c('0x1a')](_0x5dc7ec)[_0xf62c('0x16')](function(_0x34bf70){_0x11fda3(null,_0x34bf70?_0x34bf70[_0xf62c('0x15')]:![]);})['catch'](function(_0x33b572){_0x11fda3(_0x33b572);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1b')]=function(_0x53015c,_0x4f22be){this['rpc']['getTrunkById'](_0x53015c)[_0xf62c('0x16')](function(_0x5c4e52){_0x4f22be(null,_0x5c4e52?_0x5c4e52[_0xf62c('0x15')]:![]);})['catch'](function(_0x2e2e54){_0x4f22be(_0x2e2e54);});};AGIVertices['prototype'][_0xf62c('0x1c')]=function(_0x41c49f,_0x439f48){var _0x1763a3=this;this[_0xf62c('0xf')]['getSoundById'](_0x41c49f)[_0xf62c('0x16')](function(_0x1d441a){_0x439f48(null,_0x1d441a?_0x1763a3[_0xf62c('0x1d')](_0x1d441a[_0xf62c('0x1e')]):![]);})[_0xf62c('0x17')](function(_0x20fdff){_0x439f48(_0x20fdff);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1f')]=function(_0x19b820,_0x1862eb){this['rpc'][_0xf62c('0x20')](_0x19b820)[_0xf62c('0x16')](function(_0x56ec5f){_0x1862eb(null,_0x56ec5f?_0x56ec5f:![]);})[_0xf62c('0x17')](function(_0x5926c5){_0x1862eb(_0x5926c5);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x21')]=function(_0x515292,_0x5e7590,_0x3c21c9){this[_0xf62c('0x10')]['sendMailMessage'](_0x515292,_0x5e7590)[_0xf62c('0x16')](function(){_0x3c21c9(null);})['catch'](function(_0x396211){_0x3c21c9(_0x396211);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x22')]=function(_0x471816,_0x59dd09){this['rpc'][_0xf62c('0x23')](_0x471816)['then'](function(_0x190fdb){if(_0x190fdb){if(_0x190fdb['IntervalId']){_0x59dd09(null,[_0x190fdb[_0xf62c('0x24')]]);}else{_0x59dd09(null,_[_0xf62c('0x25')](_0x190fdb[_0xf62c('0x26')],_0xf62c('0x24')));}}else{_0x59dd09(null,![]);}})['catch'](function(_0x29ae19){_0x59dd09(_0x29ae19);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1d')]=function(_0x459b09){return util['format'](_0xf62c('0x27'),FILES_PATH,_0x459b09);};AGIVertices[_0xf62c('0x11')]['getQueryOdbc']=function(_0x21e5ed,_0x80749a,_0x1a151c){odbc[_0xf62c('0x28')](_0x21e5ed,function(_0x35ebb5){if(_0x35ebb5){logger[_0xf62c('0x29')](_0xf62c('0x2a'),_0x35ebb5);_0x1a151c(_0x35ebb5);}else{logger[_0xf62c('0x2b')](_0xf62c('0x2c'));odbc[_0xf62c('0x2d')](_0x80749a,function(_0x2d4f5f,_0x3380c6){if(_0x2d4f5f){logger[_0xf62c('0x2b')](_0xf62c('0x2e'),_0x80749a);_0x1a151c(_0x2d4f5f);}else{logger[_0xf62c('0x2b')](_0xf62c('0x2f'),_0x80749a);odbc[_0xf62c('0x30')](function(_0x367d17){if(_0x367d17){logger[_0xf62c('0x29')](_0xf62c('0x31'),_0x367d17);}_0x1a151c(null,_0x3380c6);});}});}});};AGIVertices['prototype'][_0xf62c('0x32')]=function(_0x4617bd,_0x18c174){this[_0xf62c('0xf')]['getSmsAccountById'](_0x4617bd)[_0xf62c('0x16')](function(_0x38d197){_0x18c174(null,_0x38d197?_0x38d197:![]);})[_0xf62c('0x17')](function(_0x10bc4c){_0x18c174(_0x10bc4c);});};AGIVertices[_0xf62c('0x11')]['createSmsMessage']=function(_0x5e62ff,_0x3c980e){this['rpc'][_0xf62c('0x33')](_0x5e62ff)[_0xf62c('0x16')](function(_0xcb4519){_0x3c980e(null,_0xcb4519);})['catch'](function(_0x22f082){_0x3c980e(_0x22f082);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x34')]=function(_0x3a550c,_0x9b84ed,_0x1a5c12){this['rpc'][_0xf62c('0x34')]({'uniqueid':this['channel'][_0xf62c('0x35')],'node':_0x3a550c[_0xf62c('0x36')],'application':_0x3a550c[_0xf62c('0x37')],'data':_0x9b84ed||null,'project_name':this[_0xf62c('0xe')][_0xf62c('0x38')],'callerid':this[_0xf62c('0xe')][_0xf62c('0x39')]})[_0xf62c('0x16')](function(_0x4999a3){if(_0x1a5c12){_0x1a5c12(null,_0x4999a3);}})['catch'](function(_0x119ee4){if(_0x1a5c12){_0x1a5c12(_0x119ee4);}});};AGIVertices[_0xf62c('0x11')]['createSquareRecording']=function(_0x4d3bb5,_0x347da0,_0x580ea2,_0x3fd57a){this[_0xf62c('0xf')]['createSquareRecording']({'uniqueid':this[_0xf62c('0xe')]['uniqueid'],'callerid':this[_0xf62c('0xe')]['callerid'],'calleridname':this[_0xf62c('0xe')]['calleridname'],'context':this[_0xf62c('0xe')][_0xf62c('0x3a')],'extension':this[_0xf62c('0xe')][_0xf62c('0x3b')],'priority':this['channel'][_0xf62c('0x3c')],'accountcode':this[_0xf62c('0xe')][_0xf62c('0x3d')],'dnid':this[_0xf62c('0xe')][_0xf62c('0x3e')],'projectName':this['channel'][_0xf62c('0x38')],'saveName':_0x347da0,'filename':_0x4d3bb5[_0xf62c('0x3f')]||_0x347da0,'savePath':_0x580ea2})[_0xf62c('0x16')](function(_0x145deb){_0x3fd57a(null,_0x145deb);})[_0xf62c('0x17')](function(_0x3daa9f){_0x3fd57a(_0x3daa9f);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x40')]=function(_0x4da2b9,_0x236d87,_0x24e405,_0x501461,_0x112ddf){this['rpc']['createSquareMessage']({'uniqueid':this[_0xf62c('0xe')][_0xf62c('0x35')],'body':_0x4da2b9,'direction':_0x236d87,'providerName':_0x24e405,'providerResponse':_0x501461})['then'](function(_0x12b72f){if(_0x112ddf){_0x112ddf(null,_0x12b72f);}})['catch'](function(_0x237589){if(_0x112ddf){_0x112ddf(_0x237589);}});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x41')]=function(_0x134e17,_0x4c5d0){this[_0xf62c('0xf')][_0xf62c('0x41')]({'firstName':_[_0xf62c('0x42')](_0x134e17[_0xf62c('0x15')])||_[_0xf62c('0x43')](_0x134e17[_0xf62c('0x15')])?_0xf62c('0x44')+Math[_0xf62c('0x45')]():_0x134e17['name'],'lastName':_[_0xf62c('0x42')](_0x134e17[_0xf62c('0x46')])||_[_0xf62c('0x43')](_0x134e17['lastName'])?null:_0x134e17[_0xf62c('0x46')],'phone':_0x134e17[_0xf62c('0x47')],'ListId':_0x134e17[_0xf62c('0x48')],'scheduledat':_0x134e17['scheduledAt'],'callbackUniqueid':this[_0xf62c('0xe')]['uniqueid'],'tags':_0xf62c('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x134e17[_0xf62c('0x4a')]['toString'](),'priority':_0x134e17[_0xf62c('0x4b')]})[_0xf62c('0x16')](function(_0x67d482){_0x4c5d0(null,_0x67d482);})['catch'](function(_0x4b8117){_0x4c5d0(_0x4b8117);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x4c')]=function(_0xb91ad0,_0x142ede){this[_0xf62c('0xf')][_0xf62c('0x4d')](_0xb91ad0)[_0xf62c('0x16')](function(_0x4289f5){_0x142ede(null,_0x4289f5?_0x4289f5[_0xf62c('0x15')]:![]);})[_0xf62c('0x17')](function(_0x200611){_0x142ede(_0x200611);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x4e')]=function(_0x3fb2a5,_0x25003a,_0xbfe971){var _0x4a6833={'role':_0xf62c('0x4f')};_0x4a6833[_0x3fb2a5]=this['channel'][_0xf62c('0x39')];this[_0xf62c('0xf')][_0xf62c('0x4e')](_0x4a6833,_0x25003a,this[_0xf62c('0xe')][_0xf62c('0x35')])[_0xf62c('0x16')](function(_0x3a57a8){_0xbfe971(null,_[_0xf62c('0x43')](_0x3a57a8)?![]:!![]);})[_0xf62c('0x17')](function(_0x9e3341){logger[_0xf62c('0x29')](_0x9e3341);_0xbfe971(null,![]);});};AGIVertices[_0xf62c('0x11')]['agentUnpause']=function(_0x29371e,_0x2e0b24){var _0x4a59a0={'role':_0xf62c('0x4f')};_0x4a59a0[_0x29371e]=this[_0xf62c('0xe')][_0xf62c('0x39')];this['rpc'][_0xf62c('0x50')](_0x4a59a0)['then'](function(_0x2cb3c3){_0x2e0b24(null,_[_0xf62c('0x43')](_0x2cb3c3)?![]:!![]);})['catch'](function(_0x4cb330){logger[_0xf62c('0x29')](_0x4cb330);_0x2e0b24(null,![]);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x51')]=function(_0x5ebc7e,_0x5dd75c){var _0x50a518={'role':_0xf62c('0x4f')};_0x50a518[_0x5ebc7e]=this[_0xf62c('0xe')][_0xf62c('0x39')];this[_0xf62c('0xf')][_0xf62c('0x51')](_0x50a518)[_0xf62c('0x16')](function(_0x340e72){_0x5dd75c(null,_[_0xf62c('0x43')](_0x340e72)?![]:!![]);})[_0xf62c('0x17')](function(_0x31218e){logger[_0xf62c('0x29')](_0x31218e);_0x5dd75c(null,![]);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x52')]=function(_0x4ba340,_0x26d55f){var _0x18f8d4={'role':_0xf62c('0x4f')};_0x18f8d4[_0x4ba340]=this[_0xf62c('0xe')][_0xf62c('0x39')];var _0x4a29c8=_0x4ba340!='internal'?util[_0xf62c('0x53')]('%s/%s@from-sip/n',_0xf62c('0x54'),this['channel'][_0xf62c('0x39')]):undefined;this[_0xf62c('0xf')]['agentLogin'](_0x18f8d4,_0x4a29c8)['then'](function(_0x438443){_0x26d55f(null,_[_0xf62c('0x43')](_0x438443)?![]:!![]);})[_0xf62c('0x17')](function(_0x2e2c7e){logger['error'](_0x2e2c7e);_0x26d55f(null,![]);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x55')]=function(_0x3670d9,_0x2ffba0){sh['exec'](_['trim'](_0x3670d9),function(_0x18d27b,_0x17ae5d){var _0x476ddc=_0x17ae5d['replace'](/(\r\n|\n|\r)/gm,'');_0x2ffba0(null,_0x476ddc);});};AGIVertices[_0xf62c('0x11')]['googleCloudTTS']=function(_0x3b50d2,_0x2e45a3){scripts['googleCloudTTS'](_0x3b50d2[_0xf62c('0x56')],_0x3b50d2[_0xf62c('0x57')]||_0xf62c('0x58'),_0x3b50d2['text'],_0x3b50d2[_0xf62c('0x59')]||_0xf62c('0x5a'),_0x3b50d2[_0xf62c('0x5b')]||'MALE',_0x3b50d2[_0xf62c('0x5c')]||_0xf62c('0x5d'))[_0xf62c('0x16')](function(_0x5ae906){_0x2e45a3(null,_0x5ae906);})[_0xf62c('0x17')](function(_0x2684ce){_0x2e45a3(_0x2684ce);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x5e')]=function(_0x3b3282,_0x192f5e){scripts[_0xf62c('0x5e')](_0x3b3282['text'],_0x3b3282['google_tts_language']||'en',0x1)[_0xf62c('0x16')](function(_0x3079b3){_0x192f5e(null,_0x3079b3);})[_0xf62c('0x17')](function(_0x1bc9dc){_0x192f5e(_0x1bc9dc);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x5f')]=function(_0x4d5ca0,_0x258b31){var _0x3d136e={'uri':_0x4d5ca0[_0xf62c('0x60')],'method':_0x4d5ca0['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4d5ca0[_0xf62c('0x61')])===_0xf62c('0x62')&&parseInt(_0x4d5ca0[_0xf62c('0x61')])>=0x1?parseInt(_0x4d5ca0[_0xf62c('0x61')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xf62c('0x63')],_0x3d136e[_0xf62c('0x64')][_0xf62c('0x65')]())){try{_0x3d136e[_0xf62c('0x66')]=_0x4d5ca0['rawBody']?JSON[_0xf62c('0x67')](_0x4d5ca0[_0xf62c('0xb')]):{};}catch(_0x406f21){logger[_0xf62c('0x29')](_0xf62c('0x68'),_0x406f21);}}try{_0x3d136e['headers']=_0x4d5ca0[_0xf62c('0xa')]?JSON['parse'](_0x4d5ca0[_0xf62c('0xa')]):{};}catch(_0x435ab7){logger[_0xf62c('0x29')](_0xf62c('0x69'),_0x435ab7);}if(_0x4d5ca0[_0xf62c('0x6a')]){try{var _0x1b1cde=require(_0x4d5ca0[_0xf62c('0x6a')])[_0xf62c('0x6b')](this,_0x3d136e);_0x3d136e['uri']=Mustache[_0xf62c('0x6c')](_0x4d5ca0[_0xf62c('0x60')],_0x1b1cde,{},['$$','$$']);if(_0x3d136e['headers']){_0x3d136e['headers']=JSON['parse'](Mustache[_0xf62c('0x6c')](JSON['stringify'](_0x3d136e['headers']),_0x1b1cde,{},['$$','$$']));}if(_0x3d136e[_0xf62c('0x66')]){_0x3d136e[_0xf62c('0x66')]=JSON['parse'](Mustache[_0xf62c('0x6c')](JSON[_0xf62c('0x6d')](_0x3d136e[_0xf62c('0x66')]),_0x1b1cde,{},['$$','$$']));}}catch(_0x3c13f5){logger[_0xf62c('0x29')](_0xf62c('0x6e'),_0x3c13f5);}}rp(_0x3d136e)['then'](function(_0x31ca52){var _0x58d86e={'statusCode':_0x31ca52[_0xf62c('0x6f')]||0xc8,'statusMessage':_0x31ca52[_0xf62c('0x70')]||'OK','headers':_0x31ca52['headers']||{},'body':_0x31ca52[_0xf62c('0x66')]||{}};_0x258b31(null,_0x58d86e);})['catch'](function(_0x3d8525){var _0x41a415={'statusCode':_0x3d8525[_0xf62c('0x6f')]||0x1f4,'statusMessage':_0x3d8525[_0xf62c('0x71')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x3d8525['options'][_0xf62c('0x72')]||{},'body':_0x3d8525[_0xf62c('0x73')][_0xf62c('0x66')]||{}};_0x258b31(null,_0x41a415);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x74')]=function(_0x3a65fa,_0x12f6dc){scripts[_0xf62c('0x74')](this[_0xf62c('0xe')][_0xf62c('0x35')],_0x3a65fa[_0xf62c('0x75')],_0x3a65fa[_0xf62c('0x58')],_0x3a65fa[_0xf62c('0x76')]||'en')[_0xf62c('0x16')](function(_0x706bb2){_0x12f6dc(null,_0x706bb2);})[_0xf62c('0x17')](function(_0x51cbfa){_0x12f6dc(_0x51cbfa);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x77')]=function(_0x32a4df,_0x101ccb){scripts['googleDialogflowV2'](this[_0xf62c('0xe')][_0xf62c('0x35')],_0x32a4df[_0xf62c('0x78')],_0x32a4df[_0xf62c('0x79')],_0x32a4df[_0xf62c('0x7a')],_0x32a4df[_0xf62c('0x58')],_0x32a4df[_0xf62c('0x7b')]||'en')[_0xf62c('0x16')](function(_0x4283e3){_0x101ccb(null,_0x4283e3);})['catch'](function(_0x35ed32){_0x101ccb(_0x35ed32);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x7c')]=function(_0x1cd5e6,_0x556579){scripts[_0xf62c('0x7c')](this[_0xf62c('0xe')],_0x1cd5e6)['then'](function(_0x256d40){_0x556579(null,_0x256d40);})['catch'](function(_0x5c18f4){_0x556579(_0x5c18f4);});};AGIVertices[_0xf62c('0x11')]['ispeechTTS']=function(_0x458e61,_0xdaa04d){scripts[_0xf62c('0x7d')](_0x458e61[_0xf62c('0x75')],_0x458e61[_0xf62c('0x58')],_0x458e61[_0xf62c('0x7e')]||_0xf62c('0x5a'),_0x458e61[_0xf62c('0x7f')])[_0xf62c('0x16')](function(_0x522378){_0xdaa04d(null,_0x522378);})[_0xf62c('0x17')](function(_0x4a7c4d){_0xdaa04d(_0x4a7c4d);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x80')]=function(_0x2b208b,_0x5ac8f5,_0x5cc04d){scripts[_0xf62c('0x80')](_0x5ac8f5,_0x2b208b[_0xf62c('0x75')],_0x2b208b[_0xf62c('0x81')]||_0xf62c('0x5a'),this[_0xf62c('0x82')](_0x2b208b['model'])?_0x2b208b['model']:undefined)[_0xf62c('0x16')](function(_0x4f0c40){_0x5cc04d(null,_0x4f0c40);})[_0xf62c('0x17')](function(_0x42e21c){_0x5cc04d(_0x42e21c);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x83')]=function(_0x2c1330,_0x7a95a1){scripts[_0xf62c('0x83')](_0x2c1330[_0xf62c('0x84')],_0x2c1330[_0xf62c('0x85')],_0x2c1330[_0xf62c('0x86')],_0x2c1330[_0xf62c('0x87')]||'Amy',_0x2c1330['text'],_0x2c1330[_0xf62c('0x88')]||_0xf62c('0x58'))[_0xf62c('0x16')](function(_0x526a6d){_0x7a95a1(null,_0x526a6d);})[_0xf62c('0x17')](function(_0x287cc9){_0x7a95a1(_0x287cc9);});};AGIVertices['prototype']['awsLex']=function(_0x480e4b,_0x3aa188){scripts[_0xf62c('0x89')](this[_0xf62c('0xe')][_0xf62c('0x35')],_0x480e4b[_0xf62c('0x84')],_0x480e4b[_0xf62c('0x85')],_0x480e4b['aws_lex_region'],_0x480e4b[_0xf62c('0x58')],_0x480e4b[_0xf62c('0x8a')])['then'](function(_0x43c22a){_0x3aa188(null,_0x43c22a);})[_0xf62c('0x17')](function(_0x32dd6b){_0x3aa188(_0x32dd6b);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x8b')]=function(_0x48f854,_0x15f466,_0x47aeed){scripts[_0xf62c('0x8b')](_0x15f466,_0x48f854[_0xf62c('0x75')],_0x48f854[_0xf62c('0x8c')]||'en-US')[_0xf62c('0x16')](function(_0x28a421){_0x47aeed(null,_0x28a421);})[_0xf62c('0x17')](function(_0x50a0b8){_0x47aeed(_0x50a0b8);});};AGIVertices[_0xf62c('0x11')][_0xf62c('0x8d')]=function(_0x45e819,_0x43d284,_0x3ea296){scripts[_0xf62c('0x8d')](_0x43d284,_0x45e819[_0xf62c('0x8e')],_0x45e819['appsecret'],_0x45e819['uri'])['then'](function(_0x193a61){_0x3ea296(null,_0x193a61);})[_0xf62c('0x17')](function(_0x15eb29){_0x3ea296(_0x15eb29);});};AGIVertices['prototype'][_0xf62c('0x8f')]=function(_0x130f02){var _0xf3bca3=_['includes'](verticesWithRetry,_0x130f02[_0xf62c('0x37')])?_0x130f02:_[_0xf62c('0x90')](_0x130f02);for(var _0x2e5839 in _0xf3bca3){if(_0xf3bca3['hasOwnProperty'](_0x2e5839)){if(_0xf3bca3[_0x2e5839]&&_[_0xf62c('0x91')](_0xf3bca3[_0x2e5839])){if(_[_0xf62c('0x92')](recursiveMapAttributes,_0x2e5839)){_0xf3bca3[_0x2e5839]=this[_0xf62c('0x93')](_0xf3bca3[_0x2e5839]);}else{_0xf3bca3[_0x2e5839]=this[_0xf62c('0x94')](_0xf3bca3[_0x2e5839]);}}}}return _0xf3bca3;};AGIVertices['prototype'][_0xf62c('0x95')]=function(_0x1b4958){for(var _0x531f6f in _0x1b4958){if(_0x1b4958[_0xf62c('0x96')](_0x531f6f)){if(_['isPlainObject'](_0x1b4958[_0x531f6f])){this[_0xf62c('0x95')](_0x1b4958[_0x531f6f]);}else if(_['isArray'](_0x1b4958[_0x531f6f])){for(var _0x493a13=0x0;_0x493a13<_0x1b4958[_0x531f6f][_0xf62c('0x97')];_0x493a13++){this[_0xf62c('0x95')](_0x1b4958[_0x531f6f][_0x493a13]);}}else if(_[_0xf62c('0x91')](_0x1b4958[_0x531f6f])){_0x1b4958[_0x531f6f]=this[_0xf62c('0x94')](_0x1b4958[_0x531f6f]);}}}};AGIVertices[_0xf62c('0x11')]['saveRestApiResult']=function(_0x2d5ed1,_0x225248){for(var _0x24ec72 in _0x2d5ed1){if(_0x2d5ed1[_0xf62c('0x96')](_0x24ec72)){if(_[_0xf62c('0x98')](_0x2d5ed1[_0x24ec72])){if(!_[_0xf62c('0x42')](_0x2d5ed1[_0x24ec72])){this['saveRestApiResult'](_0x2d5ed1[_0x24ec72],util[_0xf62c('0x53')](_0xf62c('0x99'),_0x225248,_0x24ec72));}}else if(_[_0xf62c('0x9a')](_0x2d5ed1[_0x24ec72])){for(var _0x45d000=0x0;_0x45d000<_0x2d5ed1[_0x24ec72]['length'];_0x45d000++){this[_0xf62c('0x9b')](_0x2d5ed1[_0x24ec72][_0x45d000],util[_0xf62c('0x53')]('%s.%s',_0x225248,_0x24ec72+'['+_0x45d000+']'));}}else{if(!_['isNil'](_0x2d5ed1[_0x24ec72])){this['channel'][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0x99'),_0x225248,_0x24ec72),_0x2d5ed1[_0x24ec72]);}}}}};AGIVertices['prototype'][_0xf62c('0x93')]=function(_0x33d5ce){try{var _0x2e974e=JSON[_0xf62c('0x67')](_0x33d5ce);this[_0xf62c('0x95')](_0x2e974e);return JSON['stringify'](_0x2e974e);}catch(_0x237914){return this[_0xf62c('0x94')](_0x33d5ce);}};AGIVertices[_0xf62c('0x11')]['replaceAllVariables']=function(_0x1ff58e){var _0x370f38=_0x1ff58e[_0xf62c('0x9d')]('{');for(var _0x5418d2=0x1;_0x5418d2<_0x370f38[_0xf62c('0x97')];_0x5418d2+=0x1){var _0x349861=_0x370f38[_0x5418d2][_0xf62c('0x9d')]('}');if(_0x349861[_0xf62c('0x97')]>0x1){_0x1ff58e=_0x1ff58e['replaceAll']('{'+_0x349861[0x0]+'}',this[_0xf62c('0xe')]['getVariable'](_0x349861[0x0])[_0xf62c('0x9e')]||_0x349861[0x0]);}}if(_0x370f38[_0xf62c('0x97')]===0x1){return _0x1ff58e[_0xf62c('0x9f')]();}return this[_0xf62c('0x94')](_0x1ff58e);};AGIVertices[_0xf62c('0x11')][_0xf62c('0xa0')]=function(_0x565d01,_0x22a998){var _0x2ca8c9=this[_0xf62c('0xe')]['getVariable'](_0x565d01);if(_0x2ca8c9['result']===-0x1){return _0x2ca8c9;}logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x22a998,_0x2ca8c9[_0xf62c('0x9e')]));return this['channel'][_0xf62c('0x9c')](_0x22a998,_0x2ca8c9[_0xf62c('0x9e')]);};AGIVertices[_0xf62c('0x11')]['isConfigured']=function(_0x379f4f){return _0x379f4f&&_0x379f4f!=='0'&&_0x379f4f!=='-1'&&_0x379f4f!=='';};AGIVertices[_0xf62c('0x11')]['maxRetry']=function(_0x10a117){this['createSquareDetailsReport']['sync'](this,_0x10a117,'-');_0x10a117[_0xf62c('0xa1')]=_0x10a117['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xf62c('0xa2')]=function(_0x35a7cd){logger['info'](util[_0xf62c('0x53')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x35a7cd[_0xf62c('0x36')]));if(!this['isConfigured'](_0x35a7cd[_0xf62c('0x58')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xa4'));}var _0xd0b2af='\x22'+_0x35a7cd[_0xf62c('0x58')]+'\x22';if(this[_0xf62c('0x82')](_0x35a7cd[_0xf62c('0x73')])){_0xd0b2af+=','+_0x35a7cd[_0xf62c('0x73')];}var _0x4a1e46=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0xa6'),_0xd0b2af);if(_0x4a1e46['result']===-0x1){return _0x4a1e46;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('Executed\x20command\x20MRCPSynth\x20%s',_0xd0b2af));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xa7')]=function(_0x12cce0){logger[_0xf62c('0x2b')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x12cce0[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x12cce0[_0xf62c('0xa8')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xa9'));}var _0x9fbcc2=_0x12cce0[_0xf62c('0xa8')];if(this[_0xf62c('0x82')](_0x12cce0[_0xf62c('0x73')])){_0x9fbcc2+=','+_0x12cce0[_0xf62c('0x73')];}var _0x2fbd49=this['channel']['exec'](_0xf62c('0xaa'),_0x9fbcc2);if(_0x2fbd49[_0xf62c('0xab')]===-0x1){return _0x2fbd49;}var _0x5a7b1e=this['getAndSetVariable'](_0xf62c('0xac'),_0xf62c('0xad'));if(_0x5a7b1e[_0xf62c('0xab')]===-0x1){return _0x5a7b1e;}var _0xebb3dc=this[_0xf62c('0xa0')](_0xf62c('0xae'),'MRCP_RECOG_TRANSCRIPT');if(_0xebb3dc[_0xf62c('0xab')]===-0x1){return _0xebb3dc;}var _0x37beec=this[_0xf62c('0xa0')](_0xf62c('0xaf'),_0xf62c('0xb0'));if(_0x37beec[_0xf62c('0xab')]===-0x1){return _0x37beec;}return this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0xb1'),_0x9fbcc2));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x6')]=function(_0x4f5ccf){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xb2'),_0x4f5ccf['label']));return this[_0xf62c('0xe')]['agi']([_0x4f5ccf['command'],_0x4f5ccf['args']]);};AGIVertices['prototype'][_0xf62c('0xb3')]=function(_0x190d28){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xb4'),_0x190d28['label']));if(this['isConfigured'](_0x190d28[_0xf62c('0x61')])){logger['info'](util[_0xf62c('0x53')](_0xf62c('0xb5'),_0x190d28[_0xf62c('0x61')]));var _0x4e765a=this[_0xf62c('0xe')]['wait'](_0x190d28[_0xf62c('0x61')]);if(_0x4e765a[_0xf62c('0xab')]===-0x1){return _0x4e765a;}}return this[_0xf62c('0xe')][_0xf62c('0xb3')]();};AGIVertices[_0xf62c('0x11')][_0xf62c('0x49')]=function(_0x1c5823){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xb6'),_0x1c5823[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x1c5823[_0xf62c('0x48')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x1c5823,_0xf62c('0xb7'));}_0x1c5823[_0xf62c('0x4a')]=moment();if(this['isConfigured'](_0x1c5823[_0xf62c('0xb8')])){_0x1c5823[_0xf62c('0x4a')]=moment()[_0xf62c('0xb9')](_0x1c5823[_0xf62c('0xb8')],_0xf62c('0xba'));}if(!this[_0xf62c('0x82')](_0x1c5823['callback_priority'])){_0x1c5823[_0xf62c('0x4b')]=0x2;}this[_0xf62c('0x41')]['sync'](this,_0x1c5823);return this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0xbb'),_0x1c5823[_0xf62c('0x47')],_0x1c5823[_0xf62c('0x48')],_0x1c5823['scheduledAt']));};AGIVertices['prototype'][_0xf62c('0xbc')]=function(_0x39cafa){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xbd'),_0x39cafa[_0xf62c('0x36')]));var _0x456559=this['channel'][_0xf62c('0xa5')](_0x39cafa[_0xf62c('0xbe')],_0x39cafa[_0xf62c('0x73')]);if(_0x456559[_0xf62c('0xab')]===-0x1){return _0x456559;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util['format'](_0xf62c('0xbf'),_0x39cafa[_0xf62c('0xbe')],_0x39cafa[_0xf62c('0x73')]));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xc0')]=function(_0x51abfc){logger['info'](util[_0xf62c('0x53')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x51abfc[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x51abfc[_0xf62c('0x58')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xa4'));}var _0x41842a='\x22'+_0x51abfc[_0xf62c('0x58')]+'\x22';if(this['isConfigured'](_0x51abfc['options'])){_0x41842a+=','+_0x51abfc['options'];}var _0x1d798c=this['channel']['exec']('MRCPSynth',_0x41842a);if(_0x1d798c[_0xf62c('0xab')]===-0x1){return _0x1d798c;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xc1'),_0x41842a));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xc2')]=function(_0x16321b){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xc3'),_0x16321b[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x16321b[_0xf62c('0x58')])){return this[_0xf62c('0xe')]['noop']('no\x20text\x20configured');}var _0x3163df='\x22'+_0x16321b[_0xf62c('0x58')]+'\x22';if(this[_0xf62c('0x82')](_0x16321b[_0xf62c('0x73')])){_0x3163df+=','+_0x16321b[_0xf62c('0x73')];}var _0x5cf937=this['channel'][_0xf62c('0xa5')](_0xf62c('0xa6'),_0x3163df);if(_0x5cf937['result']===-0x1){return _0x5cf937;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xc1'),_0x3163df));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xc4')]=function(_0x1ea5c3){logger['info'](util[_0xf62c('0x53')](_0xf62c('0xc5'),_0x1ea5c3['label']));if(!this[_0xf62c('0x82')](_0x1ea5c3[_0xf62c('0xa8')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xa9'));}var _0x201bbb=_0x1ea5c3[_0xf62c('0xa8')];if(this['isConfigured'](_0x1ea5c3['options'])){_0x201bbb+=','+_0x1ea5c3[_0xf62c('0x73')];}var _0x596016=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0xaa'),_0x201bbb);if(_0x596016['result']===-0x1){return _0x596016;}var _0x2314bf=this[_0xf62c('0xa0')](_0xf62c('0xac'),_0xf62c('0xc6'));if(_0x2314bf[_0xf62c('0xab')]===-0x1){return _0x2314bf;}var _0x2d49de=this[_0xf62c('0xa0')]('RECOG_INPUT()',_0xf62c('0xc7'));if(_0x2d49de[_0xf62c('0xab')]===-0x1){return _0x2d49de;}var _0x4cf58e=this[_0xf62c('0xa0')]('RECOG_INSTANCE()',_0xf62c('0xc8'));if(_0x4cf58e[_0xf62c('0xab')]===-0x1){return _0x4cf58e;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xb1'),_0x201bbb));};AGIVertices['prototype'][_0xf62c('0xc9')]=function(_0x161654){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xca'),_0x161654[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x161654[_0xf62c('0xa8')])){return this[_0xf62c('0xe')]['noop'](_0xf62c('0xa9'));}var _0x3b62e8=_0x161654[_0xf62c('0xa8')];if(this[_0xf62c('0x82')](_0x161654[_0xf62c('0x73')])){_0x3b62e8+=','+_0x161654[_0xf62c('0x73')];}var _0x4e9641=this['channel'][_0xf62c('0xa5')](_0xf62c('0xaa'),_0x3b62e8);if(_0x4e9641[_0xf62c('0xab')]===-0x1){return _0x4e9641;}var _0x2452be=this[_0xf62c('0xa0')](_0xf62c('0xac'),_0xf62c('0xcb'));if(_0x2452be[_0xf62c('0xab')]===-0x1){return _0x2452be;}var _0x2e22ad=this[_0xf62c('0xa0')](_0xf62c('0xae'),_0xf62c('0xcc'));if(_0x2e22ad['result']===-0x1){return _0x2e22ad;}var _0x4d1e95=this['getAndSetVariable'](_0xf62c('0xaf'),_0xf62c('0xcd'));if(_0x4d1e95[_0xf62c('0xab')]===-0x1){return _0x4d1e95;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xb1'),_0x3b62e8));};AGIVertices['prototype'][_0xf62c('0xce')]=function(_0x4c26a8){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xcf'),_0x4c26a8[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x4c26a8[_0xf62c('0xd0')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x4c26a8,_0xf62c('0xd1'));}var _0x4b2a00=this['getSquareOdbc'][_0xf62c('0x6b')](this,_0x4c26a8[_0xf62c('0xd0')]);if(!_0x4b2a00){return this[_0xf62c('0xe')]['error'](_0x4c26a8,_0xf62c('0xd2'));}if(!this[_0xf62c('0x82')](_0x4c26a8[_0xf62c('0x2d')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x4c26a8,'no\x20query\x20configured');}var _0x37928c=_0x4c26a8[_0xf62c('0x2d')][_0xf62c('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xf62c('0xa3')](util['format'](_0xf62c('0xd4'),_0x37928c));var _0xd236ba=this[_0xf62c('0xd5')][_0xf62c('0x6b')](this,_0x4b2a00,_0x37928c);this['createSquareDetailsReport'][_0xf62c('0x6b')](this,_0x4c26a8,_0x37928c);if(!this[_0xf62c('0x82')](_0x4c26a8['variable_id'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xd6'));}var _0xd0488e=this[_0xf62c('0x12')]['sync'](this,_0x4c26a8[_0xf62c('0xd7')]);if(!_0xd0488e){return this['channel'][_0xf62c('0x29')](_0x4c26a8,'no\x20variable\x20found');}var _0x5d7f3f=this;_0xd236ba[_0xf62c('0xd8')](function(_0x27c11d,_0x24d880){Object[_0xf62c('0xd9')](_0x27c11d)[_0xf62c('0xd8')](function(_0x42212f){_0x5d7f3f[_0xf62c('0xe')][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0xda'),_0xd0488e,_0x24d880,_0x42212f),_0x27c11d[_0x42212f]);});});this['channel'][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0xdb'),_0xd0488e),_0xd236ba[_0xf62c('0x97')]);return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xdc'),_0xd0488e));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xdd')]=function(_0x28c30a){logger[_0xf62c('0xde')](util[_0xf62c('0x53')](_0xf62c('0xdf'),_0x28c30a['label']));if(!this[_0xf62c('0x82')](_0x28c30a[_0xf62c('0xe0')])){return this[_0xf62c('0xe')]['error'](_0x28c30a,'no\x20user\x20selected');}var _0xe7c6b=this[_0xf62c('0xe1')][_0xf62c('0x6b')](this,_0x28c30a['sip_id']);if(!_0xe7c6b){return this[_0xf62c('0xe')]['error'](_0x28c30a,_0xf62c('0xe2'));}var _0x162a4d=this[_0xf62c('0xe')][_0xf62c('0xa5')]('DIAL',[util['format'](_0xf62c('0xe3'),_0xe7c6b),_0x28c30a[_0xf62c('0x61')],_0x28c30a[_0xf62c('0xe4')],_0x28c30a[_0xf62c('0x60')]]);if(_0x162a4d[_0xf62c('0xab')]===-0x1){return _0x162a4d;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xe5'),_0xf62c('0xe6')));};AGIVertices[_0xf62c('0x11')][_0xf62c('0xe7')]=function(_0x240412){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xe8'),_0x240412[_0xf62c('0x36')]));if(!this['isConfigured'](_0x240412[_0xf62c('0x75')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xe9'));}if(!this[_0xf62c('0x82')](_0x240412['text'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xa4'));}this[_0xf62c('0xe')][_0xf62c('0xea')]=!![];this[_0xf62c('0x34')](_0x240412);this['createSquareMessage'](_0x240412[_0xf62c('0x58')],'in','','');this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xeb'),_0x240412['text']));var _0x3e3fd9=this[_0xf62c('0x74')][_0xf62c('0x6b')](this,_0x240412);if(_0x3e3fd9){for(var _0x483fa1 in _0x3e3fd9){if(_0x3e3fd9[_0xf62c('0x96')](_0x483fa1)){this[_0xf62c('0xe')][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0xec'),_0x483fa1[_0xf62c('0x65')]()),_0x3e3fd9[_0x483fa1]);}}this['createSquareMessage'](_0x3e3fd9[_0xf62c('0xed')],'out',_0xf62c('0xe7'),'');return this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0xee'),_0x3e3fd9[_0xf62c('0xed')]));}return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x240412,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xf62c('0x11')][_0xf62c('0xef')]=function(_0x539e48){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0xf0'),_0x539e48[_0xf62c('0x36')]));if(!this['isConfigured'](_0x539e48['dialogflowV2_project_id'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xf1'));}if(!this['isConfigured'](_0x539e48[_0xf62c('0x79')])){return this['channel'][_0xf62c('0xa3')]('no\x20client_email\x20configured');}if(!this[_0xf62c('0x82')](_0x539e48[_0xf62c('0x7a')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xf2'));}if(!this[_0xf62c('0x82')](_0x539e48[_0xf62c('0x7b')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xf3'));}if(!this[_0xf62c('0x82')](_0x539e48[_0xf62c('0x58')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20text\x20configured');}this['channel'][_0xf62c('0xea')]=!![];this[_0xf62c('0x34')](_0x539e48);this[_0xf62c('0x40')](_0x539e48['text'],'in','','');this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xf4'),_0x539e48[_0xf62c('0x58')]));var _0x27e3fb=this[_0xf62c('0x77')]['sync'](this,_0x539e48);if(_0x27e3fb){for(var _0x3a7ea4 in _0x27e3fb){if(_0x27e3fb[_0xf62c('0x96')](_0x3a7ea4)){if(_0x3a7ea4!==_0xf62c('0xf5')){this[_0xf62c('0xe')][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0xec'),_0x3a7ea4[_0xf62c('0x65')]()),_0x27e3fb[_0x3a7ea4]);}}}this[_0xf62c('0x40')](_0x27e3fb[_0xf62c('0xed')],'out',_0xf62c('0xef'),_0x27e3fb['providerResponse']);return this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xf6'),_0x27e3fb['speech']));}return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x539e48,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xf62c('0xf7')]=function(_0x1dc6aa){logger[_0xf62c('0x2b')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1dc6aa['label']));if(!this[_0xf62c('0x82')](_0x1dc6aa[_0xf62c('0xf8')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xf9'));}if(!this[_0xf62c('0x82')](_0x1dc6aa[_0xf62c('0xfa')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x1dc6aa[_0xf62c('0xfb')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xfc'));}if(!this[_0xf62c('0x82')](_0x1dc6aa[_0xf62c('0xfd')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20text\x20configured');}this[_0xf62c('0xe')][_0xf62c('0xea')]=!![];this[_0xf62c('0x34')](_0x1dc6aa);this[_0xf62c('0x40')](_0x1dc6aa[_0xf62c('0x58')],'in','','');this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')]('Trying\x20SestekNDA:\x20%s',_0x1dc6aa[_0xf62c('0x58')]));var _0x28ffde=this['sestekNDA']['sync'](this,_0x1dc6aa);if(_0x28ffde){for(var _0x4e5e08 in _0x28ffde){if(_0x28ffde[_0xf62c('0x96')](_0x4e5e08)){this['channel'][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0xfe'),_0x4e5e08[_0xf62c('0x65')]()),_0x28ffde[_0x4e5e08]);}}this[_0xf62c('0x40')](_0x28ffde['speech'],_0xf62c('0xff'),_0xf62c('0xf7'),'');if(_0x28ffde[_0xf62c('0x100')]){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x28ffde[_0xf62c('0x100')]));var _0x2cec1c=this[_0xf62c('0xe')][_0xf62c('0x101')](_0x28ffde[_0xf62c('0x100')]);try{fs['unlink'](_0x28ffde['audiofile']+_0xf62c('0x102'));}catch(_0x4c41ba){logger['error'](_0x4c41ba);}return _0x2cec1c;}else{return this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0x103'),_0x28ffde[_0xf62c('0xed')]));}}return this['channel']['error'](_0x1dc6aa,_0xf62c('0x104'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x105')]=function(_0x5d0590){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5d0590['label']));return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x105'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x106')]=function(_0x51bf2b){logger['info'](util[_0xf62c('0x53')](_0xf62c('0x107'),_0x51bf2b[_0xf62c('0x36')]));var _0x133ed6='';if(_0x51bf2b[_0xf62c('0x108')]){if(!this[_0xf62c('0x82')](_0x51bf2b[_0xf62c('0x108')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x51bf2b,_0xf62c('0x109'));}else{var _0x4a8c06=parseInt(_0x51bf2b[_0xf62c('0x108')],0xa);if(isNaN(_0x4a8c06)){_0x133ed6=_0x51bf2b[_0xf62c('0x108')];}else{_0x133ed6=this[_0xf62c('0x1b')][_0xf62c('0x6b')](this,_0x51bf2b[_0xf62c('0x108')]);if(!_0x133ed6){return this['channel'][_0xf62c('0x29')](_0x51bf2b,_0xf62c('0x10a'));}}}}else if(_0x51bf2b[_0xf62c('0x10b')]){_0x133ed6=_0x51bf2b[_0xf62c('0x10b')];}else{return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x51bf2b,_0xf62c('0x109'));}var _0xe44aa0=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0xe6'),[util['format']('SIP/%s/%s',_0x133ed6,_0x51bf2b['phone']),_0x51bf2b[_0xf62c('0x61')],_0x51bf2b[_0xf62c('0xe4')],_0x51bf2b['url']]);if(_0xe44aa0[_0xf62c('0xab')]===-0x1){return _0xe44aa0;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('Executed\x20command\x20%s',_0xf62c('0xe6')));};AGIVertices['prototype'][_0xf62c('0x10c')]=function(_0x5a7d50){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x10d'),_0x5a7d50['label']));return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x10c'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x10e')]=function(_0x179818){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x179818[_0xf62c('0x36')]));if(_0x179818[_0xf62c('0xa1')]===0x0){return this[_0xf62c('0x10f')](_0x179818);}_0x179818['retry']-=0x1;if(!this[_0xf62c('0x82')](_0x179818['file_id'])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x179818,_0xf62c('0x110'));}var _0x518514=this[_0xf62c('0x1c')][_0xf62c('0x6b')](this,_0x179818[_0xf62c('0x111')]);if(!_0x518514){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x179818,_0xf62c('0x112'));}if(!this[_0xf62c('0x82')](_0x179818[_0xf62c('0xd7')])){return this['channel'][_0xf62c('0x29')](_0xf62c('0xd6'));}var _0x39974c=this[_0xf62c('0xe')][_0xf62c('0x113')](_0x518514,_0x179818[_0xf62c('0x114')],_0x179818[_0xf62c('0x115')]);var _0x45bf49=_0x39974c[_0xf62c('0xab')]?_0x39974c[_0xf62c('0xab')][_0xf62c('0x9f')]():'';logger[_0xf62c('0x2b')]('test',JSON[_0xf62c('0x6d')](_0x39974c));if(_0x39974c[_0xf62c('0xab')]===-0x1){this[_0xf62c('0x34')]['sync'](this,_0x179818,_0x45bf49);return _0x39974c;}else if(_0x39974c[_0xf62c('0x9e')]===_0xf62c('0x61')){_0x39974c[_0xf62c('0xab')]=_0x45bf49['length']>=parseInt(_0x179818['mindigit'])?'x':'i';}else{_0x39974c[_0xf62c('0xab')]=_0x45bf49['length']>=parseInt(_0x179818[_0xf62c('0x116')])&&_0x45bf49[_0xf62c('0x97')]<=parseInt(_0x179818[_0xf62c('0x115')])?'x':'i';}var _0x5b4125=this[_0xf62c('0x12')]['sync'](this,_0x179818[_0xf62c('0xd7')]);if(!_0x5b4125){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x179818,_0xf62c('0x117'));}this[_0xf62c('0xe')]['setVariable'](_0x5b4125,_0x45bf49);if(this[_0xf62c('0x82')](_0x179818[_0xf62c('0x118')])){var _0x52c15c=parseInt(_0x179818[_0xf62c('0x118')],0xa);var _0x3fe051=rs[_0xf62c('0x119')]({'charset':'*','length':_0x52c15c});var _0x510f58=_0x45bf49[_0xf62c('0x97')];if(_0x510f58>0x0){if(_0x510f58>_0x52c15c){this['createSquareDetailsReport'][_0xf62c('0x6b')](this,_0x179818,_0x179818[_0xf62c('0x11a')]===_0xf62c('0x11b')?_0x3fe051+_0x45bf49['substr'](_0x52c15c):_0x45bf49['substr'](0x0,_0x510f58-_0x52c15c)+_0x3fe051);}else{this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x179818,rs[_0xf62c('0x119')]({'charset':'*','length':_0x510f58}));}}else{this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x179818,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x179818,_0x45bf49);}return _0x39974c;};AGIVertices[_0xf62c('0x11')][_0xf62c('0xd')]=function(_0x5125e2){logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x11c'),_0x5125e2['label']));return this[_0xf62c('0x10e')](_0x5125e2);};AGIVertices[_0xf62c('0x11')]['goal']=function(_0x1e4cc3){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x11d'),_0x1e4cc3['label']));this[_0xf62c('0x34')]['sync'](this,_0x1e4cc3,_0x1e4cc3[_0xf62c('0x11e')]);return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('GOAL\x20%s',_0x1e4cc3[_0xf62c('0x11e')]));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x11f')]=function(_0x17290e){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x17290e['label']));if(!this[_0xf62c('0x82')](_0x17290e['aws_access_key_id'])||!this['isConfigured'](_0x17290e[_0xf62c('0x85')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x120'));}if(!this[_0xf62c('0x82')](_0x17290e[_0xf62c('0x58')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xa4'));}this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x121'),_0x17290e[_0xf62c('0x58')]));var _0x3a8345=this[_0xf62c('0x83')][_0xf62c('0x6b')](this,_0x17290e);if(_0x3a8345){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x122'),_0x3a8345));var _0x11a949=this[_0xf62c('0xe')]['streamFile'](_0x3a8345);try{fs[_0xf62c('0x123')](_0x3a8345+_0xf62c('0x102'));}catch(_0x1dfd99){logger[_0xf62c('0x29')](_0x1dfd99);}return _0x11a949;}return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x17290e,_0xf62c('0x124'));};AGIVertices[_0xf62c('0x11')]['awslex']=function(_0x406b83){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x406b83[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x406b83[_0xf62c('0x84')])||!this[_0xf62c('0x82')](_0x406b83['aws_secret_access_key'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x406b83[_0xf62c('0x8a')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x125'));}if(!this[_0xf62c('0x82')](_0x406b83[_0xf62c('0x58')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xa4'));}this['channel'][_0xf62c('0xea')]=!![];this[_0xf62c('0x34')](_0x406b83);this[_0xf62c('0x40')](_0x406b83[_0xf62c('0x58')],'in','','');this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x126'),_0x406b83[_0xf62c('0x58')]));var _0xa6071=this[_0xf62c('0x89')]['sync'](this,_0x406b83);if(_0xa6071){for(var _0xa08f23 in _0xa6071){if(_0xa6071[_0xf62c('0x96')](_0xa08f23)&&_[_0xf62c('0x91')](_0xa6071[_0xa08f23])){this[_0xf62c('0xe')][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0x127'),_0xa08f23[_0xf62c('0x65')]()),_0xa6071[_0xa08f23]);}}if(_['isNil'](_0xa6071['message'])){return this[_0xf62c('0xe')]['noop'](_0xf62c('0x128'));}else{this[_0xf62c('0x40')](_0xa6071[_0xf62c('0x71')],_0xf62c('0xff'),_0xf62c('0x129'),'');return this[_0xf62c('0xe')][_0xf62c('0xa3')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0xa6071['message']));}}return this['channel'][_0xf62c('0x29')](_0x406b83,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xf62c('0x11')][_0xf62c('0x12a')]=function(_0x5c3be4){logger[_0xf62c('0x2b')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5c3be4[_0xf62c('0x36')],_0x5c3be4[_0xf62c('0x61')]));if(!this[_0xf62c('0x82')](_0x5c3be4['key'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xe9'));}var _0x3a8734=_0xf62c('0x12b');var _0x317580=util[_0xf62c('0x53')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x2f9d03=util[_0xf62c('0x53')](_0xf62c('0x99'),_0x317580,_0x3a8734);var _0x731b78=!![];if(_0x5c3be4['beep']==='NOBEEP'){_0x731b78=![];}var _0x598850=this[_0xf62c('0xe')]['recordFile'](_0x317580,_0x3a8734,_0x5c3be4['intKey'],_0x5c3be4[_0xf62c('0x61')],undefined,_0x731b78);if(_0x598850[_0xf62c('0xab')]!==-0x1){this[_0xf62c('0xe')]['noop'](util['format']('google\x20%s\x20file\x20created',_0x2f9d03));var _0x4d6017=this['googleASR'][_0xf62c('0x6b')](this,_0x5c3be4,_0x2f9d03);if(_0x4d6017){for(var _0x2dcd52 in _0x4d6017){if(_0x4d6017[_0xf62c('0x96')](_0x2dcd52)){this[_0xf62c('0xe')]['setVariable'](util[_0xf62c('0x53')](_0xf62c('0x12c'),_0x2dcd52['toUpperCase']()),_0x4d6017[_0x2dcd52]);}}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x4d6017)));}}return _0x598850;};AGIVertices[_0xf62c('0x11')][_0xf62c('0x12d')]=function(_0x370f98){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x370f98[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x370f98[_0xf62c('0x8e')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20appid\x20configured');}if(!this[_0xf62c('0x82')](_0x370f98[_0xf62c('0x12e')])){return this[_0xf62c('0xe')]['noop'](_0xf62c('0x12f'));}var _0x4cce2c=_0xf62c('0x12b');var _0x418a56=util[_0xf62c('0x53')](_0xf62c('0x130'),FILES_PATH,rs['generate'](0x4));var _0x4fef6c=util[_0xf62c('0x53')](_0xf62c('0x99'),_0x418a56,_0x4cce2c);var _0x37b7f6=!![];if(_0x370f98[_0xf62c('0x131')]==='NOBEEP'){_0x37b7f6=![];}var _0x5215ac=this[_0xf62c('0xe')][_0xf62c('0x132')](_0x418a56,_0x4cce2c,_0x370f98['intKey'],_0x370f98[_0xf62c('0x61')],undefined,_0x37b7f6);if(_0x5215ac[_0xf62c('0xab')]!==-0x1){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x133'),_0x4fef6c));var _0x5b9456=this[_0xf62c('0x8d')]['sync'](this,_0x370f98,_0x4fef6c);if(_0x5b9456){for(var _0x551497 in _0x5b9456){if(_0x5b9456[_0xf62c('0x96')](_0x551497)){this[_0xf62c('0xe')][_0xf62c('0x9c')](util['format'](_0xf62c('0x134'),_0x551497['toUpperCase']()),_0x5b9456[_0x551497]);}}return this['channel']['noop'](util['format'](_0xf62c('0x135'),JSON[_0xf62c('0x6d')](_0x5b9456)));}}return _0x5215ac;};AGIVertices[_0xf62c('0x11')][_0xf62c('0x136')]=function(_0x434b2d){logger['info'](util['format'](_0xf62c('0x137'),_0x434b2d['label']));return this[_0xf62c('0xe')][_0xf62c('0x138')](_0x434b2d[_0xf62c('0x3a')],_0x434b2d['extension'],_0x434b2d[_0xf62c('0x3c')]);};AGIVertices[_0xf62c('0x11')][_0xf62c('0x139')]=function(_0x518659){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x518659['label']));if(!this['isConfigured'](_0x518659[_0xf62c('0x13a')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x518659,_0xf62c('0x13b'));}try{var _0x4cfc86=eval(_0x518659[_0xf62c('0x13a')])?'true':_0xf62c('0x13c');this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x13d'),_0x518659[_0xf62c('0x13a')],_0x4cfc86));return{'code':0xc8,'result':_0x4cfc86};}catch(_0x35f11a){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf62c('0x11')][_0xf62c('0x13e')]=function(_0x33f5ef){logger['info'](util['format'](_0xf62c('0x13f'),_0x33f5ef[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x33f5ef[_0xf62c('0x140')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x33f5ef,_0xf62c('0x141'));}var _0x34b869=this['getIntervals']['sync'](this,_0x33f5ef[_0xf62c('0x140')]);if(!_0x34b869){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x33f5ef,_0xf62c('0x142'));}for(var _0x4ee2e9=0x0;_0x4ee2e9<_0x34b869[_0xf62c('0x97')];_0x4ee2e9+=0x1){var _0x4c2a4f=this['channel'][_0xf62c('0x12')](util[_0xf62c('0x53')](_0xf62c('0x143'),_0x34b869[_0x4ee2e9]));if(_0x4c2a4f[_0xf62c('0xab')]===-0x1){return _0x4c2a4f;}logger['info'](util[_0xf62c('0x53')](_0xf62c('0x144'),_0x34b869[_0x4ee2e9],_0x4c2a4f['extra']));if(_0x4c2a4f[_0xf62c('0x9e')]===_0xf62c('0x145')){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x144'),_0x34b869[_0x4ee2e9],'true'));this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')]('IFTIME\x20%s\x20%s',_0x34b869[_0x4ee2e9],_0xf62c('0x145')));return{'code':0xc8,'result':_0xf62c('0x145')};}else{logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x144'),_0x34b869[_0x4ee2e9],_0xf62c('0x13c')));this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')]('IFTIME\x20%s\x20%s',_0x34b869[_0x4ee2e9],_0xf62c('0x13c')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xf62c('0x11')][_0xf62c('0x146')]=function(_0x20cd46){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x147'),_0x20cd46[_0xf62c('0x36')]));return this['channel'][_0xf62c('0x146')]();};AGIVertices['prototype'][_0xf62c('0x148')]=function(_0x516868){logger['info'](util[_0xf62c('0x53')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x516868[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x516868[_0xf62c('0x75')])){return this['channel'][_0xf62c('0xa3')](_0xf62c('0xe9'));}var _0x2b5610='wav';var _0x2be634=util[_0xf62c('0x53')](_0xf62c('0x130'),FILES_PATH,rs[_0xf62c('0x119')](0x4));var _0x3819b9=util[_0xf62c('0x53')](_0xf62c('0x99'),_0x2be634,_0x2b5610);var _0x2f4c81=!![];if(_0x516868[_0xf62c('0x131')]===_0xf62c('0x149')){_0x2f4c81=![];}var _0x1caeb8=this[_0xf62c('0xe')]['recordFile'](_0x2be634,_0x2b5610,_0x516868[_0xf62c('0x14a')],_0x516868[_0xf62c('0x61')],undefined,_0x2f4c81);if(_0x1caeb8[_0xf62c('0xab')]!==-0x1){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('ispeech\x20%s\x20file\x20created',_0x3819b9));var _0xb83c93=this[_0xf62c('0x80')]['sync'](this,_0x516868,_0x3819b9);if(_0xb83c93){for(var _0x3a3829 in _0xb83c93){if(_0xb83c93[_0xf62c('0x96')](_0x3a3829)){this['channel'][_0xf62c('0x9c')](util['format']('ISPEECH_ASR_%s',_0x3a3829[_0xf62c('0x65')]()),_0xb83c93[_0x3a3829]);}}return this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x14b'),JSON[_0xf62c('0x6d')](_0xb83c93)));}}return _0x1caeb8;};AGIVertices[_0xf62c('0x11')]['ispeechtts']=function(_0x3ba097){logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x14c'),_0x3ba097[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x3ba097[_0xf62c('0x75')])){return this[_0xf62c('0xe')]['noop'](_0xf62c('0xe9'));}if(!this[_0xf62c('0x82')](_0x3ba097[_0xf62c('0x58')])){return this[_0xf62c('0xe')]['noop'](_0xf62c('0xa4'));}this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x14d'),_0x3ba097[_0xf62c('0x58')]));var _0x5cbfca=this[_0xf62c('0x7d')][_0xf62c('0x6b')](this,_0x3ba097);if(_0x5cbfca){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x14e'),_0x5cbfca));var _0x2387f3=this[_0xf62c('0xe')]['streamFile'](_0x5cbfca,_0x3ba097[_0xf62c('0x14a')]);try{fs[_0xf62c('0x123')](_0x5cbfca+_0xf62c('0x102'));}catch(_0x40dcdf){logger[_0xf62c('0x29')](_0x40dcdf);}return _0x2387f3;}return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x3ba097,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x50697b){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x14f'),_0x50697b[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x50697b[_0xf62c('0x150')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x50697b,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf62c('0x53')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf62c('0xe')][_0xf62c('0x39')],_0x50697b[_0xf62c('0x150')]));var _0x56cd23=this['agentLogin']['sync'](this,_0x50697b[_0xf62c('0x150')]);if(_0x56cd23){logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x151'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x50697b[_0xf62c('0x150')]));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x151'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x50697b[_0xf62c('0x150')]));return{'code':0xc8,'result':_0xf62c('0x152')};}else{logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf62c('0xe')][_0xf62c('0x39')],_0x50697b['findBy']));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x153'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x50697b[_0xf62c('0x150')]));return{'code':0xc8,'result':_0xf62c('0x154')};}};AGIVertices[_0xf62c('0x11')][_0xf62c('0x155')]=function(_0x1313f5){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1313f5['label']));if(!this['isConfigured'](_0x1313f5[_0xf62c('0x150')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x1313f5,_0xf62c('0x156'));}logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x157'),this[_0xf62c('0xe')]['callerid'],_0x1313f5[_0xf62c('0x150')]));var _0x4229bd=this[_0xf62c('0x51')][_0xf62c('0x6b')](this,_0x1313f5[_0xf62c('0x150')]);if(_0x4229bd){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x151'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x1313f5[_0xf62c('0x150')]));this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0x151'),this['channel'][_0xf62c('0x39')],_0x1313f5[_0xf62c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x153'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x1313f5['findBy']));this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf62c('0xe')][_0xf62c('0x39')],_0x1313f5[_0xf62c('0x150')]));return{'code':0xc8,'result':_0xf62c('0x154')};}};AGIVertices[_0xf62c('0x11')][_0xf62c('0x158')]=function(_0xb1cdae){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xb1cdae[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0xb1cdae[_0xf62c('0x159')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0xb1cdae,_0xf62c('0x15a'));}this[_0xf62c('0xe')][_0xf62c('0xa3')](util['format'](_0xf62c('0x15b'),_0xb1cdae['operation']));var _0x365b82=eval(_0xb1cdae[_0xf62c('0x159')]);if(!this[_0xf62c('0x82')](_0xb1cdae['variable_id'])){return this['channel']['noop'](_0xf62c('0xd6'));}var _0x32e424=this[_0xf62c('0x12')][_0xf62c('0x6b')](this,_0xb1cdae[_0xf62c('0xd7')]);if(!_0x32e424){return this[_0xf62c('0xe')]['error'](_0xb1cdae,_0xf62c('0x117'));}if(_[_0xf62c('0x9a')](_0x365b82)){var _0xb92fec=this;_0x365b82[_0xf62c('0xd8')](function(_0xe46df6,_0x4cbcc0){_0xb92fec[_0xf62c('0xe')][_0xf62c('0x9c')](util[_0xf62c('0x53')](_0xf62c('0x15c'),_0x32e424,_0x4cbcc0),_0xe46df6);});return this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x15d'),_0x32e424));}else{return this[_0xf62c('0xe')][_0xf62c('0x9c')](_0x32e424,_0x365b82);}};AGIVertices['prototype'][_0xf62c('0xc')]=function(_0x520dc7){logger['info'](util['format'](_0xf62c('0x15e'),_0x520dc7[_0xf62c('0x36')]));if(_0x520dc7[_0xf62c('0xa1')]===0x0){return this['maxRetry'](_0x520dc7);}_0x520dc7['retry']-=0x1;if(!this[_0xf62c('0x82')](_0x520dc7['file_id'])){return this['channel'][_0xf62c('0x29')](_0x520dc7,_0xf62c('0x110'));}var _0x4470be=this[_0xf62c('0x1c')][_0xf62c('0x6b')](this,_0x520dc7[_0xf62c('0x111')]);if(!_0x4470be){return this['channel'][_0xf62c('0x29')](_0x520dc7,_0xf62c('0x112'));}var _0x10a627=this[_0xf62c('0xe')][_0xf62c('0x113')](_0x4470be,_0x520dc7[_0xf62c('0x114')],_0x520dc7[_0xf62c('0x15f')]);var _0x2ea51a=_0x10a627['result'];if(_0x10a627[_0xf62c('0xab')]===-0x1){this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x520dc7,'-1');return _0x10a627;}else if(_0x10a627['extra']===_0xf62c('0x61')){_0x10a627[_0xf62c('0xab')]=_0x10a627[_0xf62c('0xab')][_0xf62c('0x97')]>0x0?_0x10a627[_0xf62c('0xab')]:'t';}else if(_['isEmpty'](_0x10a627[_0xf62c('0xab')])){_0x10a627[_0xf62c('0xab')]='#';_0x2ea51a='#';}if(!this[_0xf62c('0x82')](_0x520dc7[_0xf62c('0xd7')])){this[_0xf62c('0xe')]['noop'](_0xf62c('0xd6'));}else{var _0x5cfe8b=this[_0xf62c('0x12')][_0xf62c('0x6b')](this,_0x520dc7[_0xf62c('0xd7')]);if(!_0x5cfe8b){return this[_0xf62c('0xe')]['error'](_0x520dc7,_0xf62c('0x117'));}this[_0xf62c('0xe')][_0xf62c('0x9c')](_0x5cfe8b,_0x2ea51a);}this['createSquareDetailsReport'][_0xf62c('0x6b')](this,_0x520dc7,_0x2ea51a);return _0x10a627;};AGIVertices[_0xf62c('0x11')][_0xf62c('0xa3')]=function(_0x495897){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x160'),_0x495897['label']));return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0x495897[_0xf62c('0x161')]||_0x495897[_0xf62c('0x36')]);};AGIVertices[_0xf62c('0x11')]['pause']=function(_0x580b3e){logger['info'](util[_0xf62c('0x53')](_0xf62c('0x162'),_0x580b3e['label']));if(!this[_0xf62c('0x82')](_0x580b3e[_0xf62c('0x150')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x580b3e,_0xf62c('0x156'));}logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x157'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x580b3e['findBy']));var _0x321330=this[_0xf62c('0x4c')]['sync'](this,_0x580b3e[_0xf62c('0x163')]);var _0x4ee522=this['agentPause'][_0xf62c('0x6b')](this,_0x580b3e[_0xf62c('0x150')],_0x321330);if(_0x4ee522){logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x151'),this['channel'][_0xf62c('0x39')],_0x580b3e[_0xf62c('0x150')]));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x151'),this['channel'][_0xf62c('0x39')],_0x580b3e[_0xf62c('0x150')]));return{'code':0xc8,'result':_0xf62c('0x152')};}else{logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf62c('0xe')][_0xf62c('0x39')],_0x580b3e['findBy']));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x151'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x580b3e[_0xf62c('0x150')]));return{'code':0xc8,'result':_0xf62c('0x154')};}};AGIVertices[_0xf62c('0x11')][_0xf62c('0x164')]=function(_0x141613){logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x165'),_0x141613[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x141613[_0xf62c('0x111')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x141613,_0xf62c('0x110'));}var _0x54c8e7=this[_0xf62c('0x1c')][_0xf62c('0x6b')](this,_0x141613[_0xf62c('0x111')]);if(!_0x54c8e7){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x141613,_0xf62c('0x112'));}var _0x3e7ad9=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0x166'),[_0x54c8e7,_0x141613[_0xf62c('0xe4')]]);if(_0x3e7ad9[_0xf62c('0xab')]===-0x1){return _0x3e7ad9;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xbf'),'PLAYBACK',_0x54c8e7));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x167')]=function(_0x5c4aa0){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5c4aa0['label']));if(!this[_0xf62c('0x82')](_0x5c4aa0[_0xf62c('0x168')])){return this[_0xf62c('0xe')]['error'](_0x5c4aa0,_0xf62c('0x169'));}var _0x1e0c48='';var _0x58f3df=parseInt(_0x5c4aa0['queue_id'],0xa);if(isNaN(_0x58f3df)){_0x1e0c48=_0x5c4aa0[_0xf62c('0x168')];}else{_0x1e0c48=this['getVoiceQueue']['sync'](this,_0x5c4aa0[_0xf62c('0x168')]);if(!_0x1e0c48){return this['channel'][_0xf62c('0x29')](_0x5c4aa0,_0xf62c('0x16a'));}}var _0x34df7f='';if(this['isConfigured'](_0x5c4aa0['file_id'])){var _0x266783=this[_0xf62c('0x1c')][_0xf62c('0x6b')](this,_0x5c4aa0[_0xf62c('0x111')]);if(_0x266783){_0x34df7f=_0x266783;}}this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x5c4aa0,_0x1e0c48);if(_0x5c4aa0[_0xf62c('0xe4')][_0xf62c('0x16b')]('x')<0x0){_0x5c4aa0[_0xf62c('0xe4')]+='x';}if(_0x5c4aa0[_0xf62c('0xe4')][_0xf62c('0x16b')]('X')<0x0){_0x5c4aa0[_0xf62c('0xe4')]+='X';}this[_0xf62c('0xe')][_0xf62c('0x9c')]('XMCS-QUEUE',_0x1e0c48?_0x1e0c48[_0xf62c('0x16c')]():'');var _0x1a4773=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0x16d'),[_0x1e0c48,_0x5c4aa0['opts'],_0x5c4aa0[_0xf62c('0x60')],_0x34df7f,_0x5c4aa0[_0xf62c('0x61')],_0x5c4aa0[_0xf62c('0x6')],_0x5c4aa0['macro'],_0x5c4aa0[_0xf62c('0x16e')],'',_0x5c4aa0['position']]);if(_0x1a4773[_0xf62c('0xab')]===-0x1){return _0x1a4773;}return this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')](_0xf62c('0xbf'),_0xf62c('0x16d'),_0x1e0c48));};AGIVertices['prototype'][_0xf62c('0x16f')]=function(_0xd0d0c7){logger[_0xf62c('0x2b')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xd0d0c7[_0xf62c('0x36')]));var _0x4bf95f=_0xd0d0c7['recordingFormat']||_0xf62c('0x12b');var _0x12acc3=util[_0xf62c('0x53')](_0xf62c('0x170'),this[_0xf62c('0xe')][_0xf62c('0x35')],rs[_0xf62c('0x119')](0x5));var _0x4c5e3b=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x12acc3,_0x4bf95f);var _0x508e3e=util[_0xf62c('0x53')](_0xf62c('0x130'),FILES_PATH,_0x12acc3);this[_0xf62c('0x171')][_0xf62c('0x6b')](this,_0xd0d0c7,_0x12acc3,_0x4c5e3b);this['channel'][_0xf62c('0x9c')](_0xf62c('0x172'),_0x12acc3);logger[_0xf62c('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x508e3e,_0x4bf95f,_0xd0d0c7['escape_digits'],_0xd0d0c7['timeout']);return this[_0xf62c('0xe')][_0xf62c('0x132')](_0x508e3e,_0x4bf95f,_0xd0d0c7[_0xf62c('0x173')],_0xd0d0c7[_0xf62c('0x61')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x3d018a){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x174'),_0x3d018a[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x3d018a['url'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20url\x20configured');}var _0x545f95=this[_0xf62c('0x5f')][_0xf62c('0x6b')](this,_0x3d018a);logger['info'](util[_0xf62c('0x53')](_0xf62c('0x175'),util[_0xf62c('0x176')](_0x545f95,{'showHidden':![],'depth':null})));if(!this[_0xf62c('0x82')](_0x3d018a[_0xf62c('0xd7')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x46a3ef=this[_0xf62c('0x12')]['sync'](this,_0x3d018a[_0xf62c('0xd7')]);if(!_0x46a3ef){return this['channel'][_0xf62c('0x29')](_0x3d018a,_0xf62c('0x117'));}this[_0xf62c('0xe')]['setVariable'](util[_0xf62c('0x53')](_0xf62c('0x177'),_0x46a3ef),_0x545f95[_0xf62c('0x6f')]?_0x545f95['statusCode']:_0xf62c('0x178'));this[_0xf62c('0xe')][_0xf62c('0x9c')](util['format'](_0xf62c('0x179'),_0x46a3ef),_0x545f95[_0xf62c('0x70')]?_0x545f95['statusMessage']:'OK');if(_0x545f95[_0xf62c('0x66')]){try{this['saveRestApiResult'](_0x545f95[_0xf62c('0x66')],_0x46a3ef);}catch(_0x46a1da){logger[_0xf62c('0x29')](util[_0xf62c('0x53')](_0xf62c('0x17a'),_0x46a3ef));}}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xdc'),_0x46a3ef));};AGIVertices['prototype'][_0xf62c('0x17b')]=function(_0x307924){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x17c'),_0x307924[_0xf62c('0x36')]));return this[_0xf62c('0xe')][_0xf62c('0x17d')](_0x307924[_0xf62c('0x17e')][_0xf62c('0xd3')](/\s+/g,''),_0x307924['escape_digits']);};AGIVertices[_0xf62c('0x11')][_0xf62c('0x17f')]=function(_0x5dd63a){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x180'),_0x5dd63a[_0xf62c('0x36')]));return this[_0xf62c('0xe')][_0xf62c('0x181')](_0x5dd63a[_0xf62c('0x62')]['replace'](/\s+/g,''),_0x5dd63a[_0xf62c('0x173')]);};AGIVertices[_0xf62c('0x11')]['sayphonetic']=function(_0x26af72){logger['info'](util[_0xf62c('0x53')](_0xf62c('0x182'),_0x26af72[_0xf62c('0x36')]));return this[_0xf62c('0xe')]['sayPhonetic'](_0x26af72[_0xf62c('0x58')],_0x26af72[_0xf62c('0x173')]);};AGIVertices[_0xf62c('0x11')][_0xf62c('0x183')]=function(_0x56a8c4){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x184'),_0x56a8c4[_0xf62c('0x36')]));if(!this['isConfigured'](_0x56a8c4[_0xf62c('0x185')])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x186'));}var _0x2365a4=this[_0xf62c('0x1f')][_0xf62c('0x6b')](this,_0x56a8c4[_0xf62c('0x185')]);if(!_0x2365a4||!_0x2365a4[_0xf62c('0x187')]){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x56a8c4,_0xf62c('0x188'));}var _0x5a518e={'from':util[_0xf62c('0x53')](_0xf62c('0x189'),_0x2365a4[_0xf62c('0x15')],_0x2365a4[_0xf62c('0x18a')]||_0x2365a4[_0xf62c('0x187')]['user']),'to':_0x56a8c4['to']||'','cc':_0x56a8c4['cc']||'','bcc':_0x56a8c4[_0xf62c('0x18b')]||'','subject':_0x56a8c4['subject'],'html':_0x56a8c4[_0xf62c('0x58')],'text':_0x56a8c4[_0xf62c('0x58')]};var _0x2dc438={'tls':{'rejectUnauthorized':![]}};if(_0x2365a4[_0xf62c('0x187')][_0xf62c('0x18c')]){_0x2dc438[_0xf62c('0x18c')]=_0x2365a4['Smtp'][_0xf62c('0x18c')];}else{_0x2dc438[_0xf62c('0x18d')]=_0x2365a4[_0xf62c('0x187')]['host'];_0x2dc438[_0xf62c('0x18e')]=_0x2365a4['Smtp'][_0xf62c('0x18e')];_0x2dc438[_0xf62c('0x18f')]=_0x2365a4[_0xf62c('0x187')][_0xf62c('0x18f')];}if(_0x2365a4[_0xf62c('0x187')][_0xf62c('0x190')]){_0x2dc438[_0xf62c('0x191')]={'user':_0x2365a4[_0xf62c('0x187')][_0xf62c('0x192')],'pass':_0x2365a4[_0xf62c('0x187')][_0xf62c('0x193')]};}if(this[_0xf62c('0x82')](_0x56a8c4['template_id'])){}logger[_0xf62c('0xde')]('sendMail\x20message',JSON['stringify'](_0x5a518e));this['createSquareDetailsReport'][_0xf62c('0x6b')](this,_0x56a8c4,_0x56a8c4[_0xf62c('0x185')]);this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x194'),_0x2365a4['name']));this['sendMailMessage']['sync'](this,_0x2dc438,_0x5a518e);return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x195'));};AGIVertices[_0xf62c('0x11')]['sendFax']=function(_0xba5e7d){logger['info'](util[_0xf62c('0x53')](_0xf62c('0x196'),_0xba5e7d['label']));return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x197'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x198')]=function(_0x1fa7f9){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x199'),_0x1fa7f9['label']));if(!this[_0xf62c('0x82')](_0x1fa7f9['sms_account_id'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x19a'));}var _0x3170f2=this[_0xf62c('0x32')]['sync'](this,_0x1fa7f9[_0xf62c('0x19b')]);if(!_0x3170f2){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x1fa7f9,_0xf62c('0x19c'));}var _0x19a2b9={'body':_0x1fa7f9[_0xf62c('0x19d')],'phone':_0x1fa7f9['to']||'','SmsAccountId':_0x3170f2['id']};logger[_0xf62c('0xde')](_0xf62c('0x19e'),JSON['stringify'](_0x19a2b9));this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x1fa7f9,_0x1fa7f9[_0xf62c('0x19b')]);this[_0xf62c('0xe')][_0xf62c('0xa3')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3170f2[_0xf62c('0x15')]));this[_0xf62c('0x33')]['sync'](this,_0x19a2b9);return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x19f'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1a0')]=function(_0x247c71){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1a1'),_0x247c71[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x247c71[_0xf62c('0xd7')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x247c71,_0xf62c('0x1a2'));}var _0x3fcf29=this['getVariable'][_0xf62c('0x6b')](this,_0x247c71[_0xf62c('0xd7')]);if(!_0x3fcf29){return this[_0xf62c('0xe')]['error'](_0x247c71,_0xf62c('0x117'));}return this[_0xf62c('0xe')][_0xf62c('0x9c')](_0x3fcf29,_0x247c71[_0xf62c('0x1a3')]);};AGIVertices['prototype'][_0xf62c('0x1a4')]=function(_0x1763ce){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1a5'),_0x1763ce['label']));this['channel'][_0xf62c('0xa3')](_0xf62c('0x1a6'));if(_0x1763ce[_0xf62c('0xb3')]===_0xf62c('0x1a7')){this['channel'][_0xf62c('0xa3')](_0xf62c('0x1a8'));return this[_0xf62c('0xe')][_0xf62c('0xb3')]();}return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0x1a9'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1aa')]=function(_0x40d7b7){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1ab'),_0x40d7b7[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x40d7b7[_0xf62c('0x1ac')])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x40d7b7,_0xf62c('0x1ad'));}var _0x5e173a=this[_0xf62c('0x1ae')][_0xf62c('0x6b')](this,_0x40d7b7[_0xf62c('0x1ac')]);if(!this['isConfigured'](_0x5e173a)){return this[_0xf62c('0xe')]['error'](_0x40d7b7,util[_0xf62c('0x53')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x40d7b7['project_id']));}if(_0x5e173a===this[_0xf62c('0xe')][_0xf62c('0x38')]){return this['channel'][_0xf62c('0x29')](_0x40d7b7,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x40d7b7,_0x5e173a);var _0x445d08=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0x1af'),util[_0xf62c('0x53')](_0xf62c('0x1b0'),config['agi'][_0xf62c('0x18d')]||'127.0.0.1',_0x5e173a,this[_0xf62c('0xe')][_0xf62c('0x38')]));if(_0x445d08[_0xf62c('0xab')]===-0x1){return _0x445d08;}return this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')]('Executed\x20command\x20%s\x20%s',_0xf62c('0x1af'),_0x5e173a));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1b1')]=function(_0x299236){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1b2'),_0x299236[_0xf62c('0x36')]));var _0x52bfbc=this[_0xf62c('0x55')]['sync'](this,_0x299236[_0xf62c('0x1b3')]);this[_0xf62c('0x34')][_0xf62c('0x6b')](this,_0x299236,_0x299236[_0xf62c('0x1b3')]);if(this[_0xf62c('0x82')](_0x299236[_0xf62c('0xd7')])){var _0x11c642=this[_0xf62c('0x12')][_0xf62c('0x6b')](this,_0x299236[_0xf62c('0xd7')]);if(_0x11c642){this['channel'][_0xf62c('0x9c')](_0x11c642,_0x52bfbc);return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x1b4'),_0x299236['command'],_0x11c642));}}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x1b5'),_0x299236[_0xf62c('0x1b3')]));};AGIVertices['prototype'][_0xf62c('0x1b6')]=function(_0x455cf7){logger['info'](util[_0xf62c('0x53')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x455cf7[_0xf62c('0x36')]));_0x455cf7[_0xf62c('0x58')]=_0x455cf7['text'][_0xf62c('0xd3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf62c('0x82')](_0x455cf7[_0xf62c('0x56')])){return this[_0xf62c('0xe')]['noop']('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x455cf7[_0xf62c('0x58')])){return this['channel'][_0xf62c('0xa3')]('no\x20text\x20configured');}this['channel'][_0xf62c('0xa3')](util[_0xf62c('0x53')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x455cf7[_0xf62c('0x58')]));var _0x1723d8=this[_0xf62c('0x1b7')][_0xf62c('0x6b')](this,_0x455cf7);if(_0x1723d8){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x1b8'),_0x1723d8));var _0x4aef22=this[_0xf62c('0xe')][_0xf62c('0x101')](_0x1723d8);try{fs['unlink'](_0x1723d8+_0xf62c('0x102'));}catch(_0x162def){logger['error'](_0x162def);}return _0x4aef22;}return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x455cf7,_0xf62c('0x1b9'));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1ba')]=function(_0x50a62e){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1bb'),_0x50a62e[_0xf62c('0x36')]));_0x50a62e[_0xf62c('0x58')]=_0x50a62e['text'][_0xf62c('0xd3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf62c('0x82')](_0x50a62e['text'])){return this[_0xf62c('0xe')][_0xf62c('0xa3')](_0xf62c('0xa4'));}this[_0xf62c('0xe')]['noop'](util[_0xf62c('0x53')]('Trying\x20Google\x20TTS\x20%s',_0x50a62e[_0xf62c('0x58')]));var _0x16742f=this[_0xf62c('0x5e')][_0xf62c('0x6b')](this,_0x50a62e);if(_0x16742f){this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x1bc'),_0x16742f));var _0x31595d=this[_0xf62c('0xe')][_0xf62c('0x101')](_0x16742f);try{fs[_0xf62c('0x123')](_0x16742f+_0xf62c('0x102'));}catch(_0x1e4b9e){logger[_0xf62c('0x29')](_0x1e4b9e);}return _0x31595d;}return this[_0xf62c('0xe')]['error'](_0x50a62e,_0xf62c('0x1bd'));};AGIVertices['prototype']['unpause']=function(_0x5886d7){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5886d7[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x5886d7['findBy'])){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x5886d7,'no\x20find\x20by\x20configured');}logger[_0xf62c('0x2b')](util['format'](_0xf62c('0x157'),this[_0xf62c('0xe')][_0xf62c('0x39')],_0x5886d7[_0xf62c('0x150')]));var _0x423817=this[_0xf62c('0x50')][_0xf62c('0x6b')](this,_0x5886d7[_0xf62c('0x150')]);if(_0x423817){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf62c('0xe')][_0xf62c('0x39')],_0x5886d7['findBy']));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0x151'),this['channel'][_0xf62c('0x39')],_0x5886d7[_0xf62c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x153'),this['channel'][_0xf62c('0x39')],_0x5886d7['findBy']));this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x5886d7['findBy']));return{'code':0xc8,'result':_0xf62c('0x154')};}};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1be')]=function(_0x201592){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1bf'),_0x201592['label']));var _0x2a6e31=this[_0xf62c('0xe')][_0xf62c('0xa5')](_0xf62c('0x1c0'),[_0x201592[_0xf62c('0x1c1')],_0x201592[_0xf62c('0x73')]]);if(_0x2a6e31[_0xf62c('0xab')]===-0x1){return _0x2a6e31;}return this[_0xf62c('0xe')][_0xf62c('0xa3')](util[_0xf62c('0x53')](_0xf62c('0xbf'),_0xf62c('0x1c0'),_0x201592[_0xf62c('0x1c1')]));};AGIVertices[_0xf62c('0x11')][_0xf62c('0x1c2')]=function(_0x2b588a){logger[_0xf62c('0x2b')](util[_0xf62c('0x53')](_0xf62c('0x1c3'),_0x2b588a[_0xf62c('0x36')]));if(!this[_0xf62c('0x82')](_0x2b588a['variable_id'])){return this['channel']['error'](_0x2b588a,'no\x20variable\x20selected');}var _0x4013bd=this[_0xf62c('0x12')]['sync'](this,_0x2b588a['variable_id']);if(!_0x4013bd){return this[_0xf62c('0xe')][_0xf62c('0x29')](_0x2b588a,_0xf62c('0x117'));}var _0x2b94cf=this['channel'][_0xf62c('0x12')](_0x4013bd);return{'code':0xc8,'result':_0x2b94cf[_0xf62c('0x9e')]?_0x2b94cf[_0xf62c('0x9e')]:'-'};};String[_0xf62c('0x11')][_0xf62c('0x1c4')]=function(_0x550153,_0x22f2c1){return this[_0xf62c('0x9d')](_0x550153)['join'](_0x22f2c1);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index dce88c2..66a5c91 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 _0xf9b3=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','error','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x4094a9,_0x1606ee){var _0x46347d=function(_0x4e886c){while(--_0x4e886c){_0x4094a9['push'](_0x4094a9['shift']());}};_0x46347d(++_0x1606ee);}(_0xf9b3,0xbe));var _0x3f9b=function(_0x54d280,_0x1e10ff){_0x54d280=_0x54d280-0x0;var _0x39cfb4=_0xf9b3[_0x54d280];return _0x39cfb4;};'use strict';var util=require('util');var _=require(_0x3f9b('0x0'));var moment=require(_0x3f9b('0x1'));var ami=require(_0x3f9b('0x2'));var logger=require(_0x3f9b('0x3'))(_0x3f9b('0x4'));var RpcUser=require(_0x3f9b('0x5'));var RpcVoiceAgentReport=require(_0x3f9b('0x6'));function Acw(_0x4423d8){this[_0x3f9b('0x7')]=_0x4423d8['voiceQueues'];this[_0x3f9b('0x8')]=_0x4423d8[_0x3f9b('0x8')];this[_0x3f9b('0x9')]=_0x4423d8[_0x3f9b('0x9')];this['channels']={};ami['on'](_0x3f9b('0xa'),this['syncAgentConnect'][_0x3f9b('0xb')](this));ami['on'](_0x3f9b('0xc'),this[_0x3f9b('0xd')]['bind'](this));ami['on'](_0x3f9b('0xe'),this[_0x3f9b('0xf')][_0x3f9b('0xb')](this));ami['on']('agentringnoanswer',this[_0x3f9b('0x10')][_0x3f9b('0xb')](this));ami['on']('attendedtransfer',this[_0x3f9b('0x11')]['bind'](this));ami['on'](_0x3f9b('0x12'),this[_0x3f9b('0x13')][_0x3f9b('0xb')](this));ami['on'](_0x3f9b('0x14'),this['syncAgentConnectPreview'][_0x3f9b('0xb')](this));}function getDiff(_0x2e7aba){var _0x141f87=moment()['milliseconds'](0x0);var _0x3d1afb=moment(_0x2e7aba)[_0x3f9b('0x15')](0x0);return _0x141f87[_0x3f9b('0x16')](_0x3d1afb,_0x3f9b('0x17'));}Acw[_0x3f9b('0x18')][_0x3f9b('0x19')]=function(_0x3ce897){try{var _0x55cae9=this;var _0x30d950=this['channels'][_0x3ce897]['interface'];var _0x4af1b3=this[_0x3f9b('0x1a')][_0x3ce897][_0x3f9b('0x1b')];var _0x3e2b4c=this['voiceQueues'][_0x4af1b3];var _0x15f873=![];var _0x55ce21=_0x3f9b('0x1c');if(_0x3e2b4c[_0x3f9b('0x1d')]){if(_0x3e2b4c[_0x3f9b('0x1e')][_0x3f9b('0x1f')]){_0x15f873=!![];_0x55ce21=_0x3e2b4c[_0x3f9b('0x1e')]['name'];}}ami[_0x3f9b('0x20')]({'action':_0x3f9b('0x21'),'interface':_0x30d950,'paused':!![],'reason':_0x55ce21})[_0x3f9b('0x22')](function(_0x40edd2){if(_0x55cae9[_0x3f9b('0x8')][_0x30d950]){return RpcUser[_0x3f9b('0x23')](_0x55cae9[_0x3f9b('0x8')][_0x30d950]['id'])['then'](function(_0xf4a60f){if(_0xf4a60f&&!_0xf4a60f['voicePause']){logger[_0x3f9b('0x24')](_0x3f9b('0x25'),_0x3ce897,_0x30d950,_0x4af1b3);var _0x596ee2=_0x55cae9[_0x3f9b('0x1a')][_0x3ce897][_0x3f9b('0x26')]&&_0x55cae9[_0x3f9b('0x1a')][_0x3ce897][_0x3f9b('0x27')]?_0x55cae9[_0x3f9b('0x1a')][_0x3ce897][_0x3f9b('0x27')]:_0x3ce897;return RpcUser[_0x3f9b('0x28')](_0x55cae9[_0x3f9b('0x8')][_0x30d950],_0x55ce21,_0x596ee2)['then'](function(_0x31ce0d){if(!_0x15f873){_0x55cae9[_0x3f9b('0x9')][_0x30d950]={};logger[_0x3f9b('0x24')](_0x3f9b('0x29'),_0x3ce897,_0x55cae9[_0x3f9b('0x7')][_0x4af1b3][_0x3f9b('0x2a')],_0x30d950,_0x4af1b3);_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2b')]=setTimeout(_0x55cae9[_0x3f9b('0x2c')][_0x3f9b('0xb')](_0x55cae9,_0x30d950),_0x55cae9[_0x3f9b('0x7')][_0x4af1b3]['acwTimeout']*0x3e8);_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2d')]=moment()[_0x3f9b('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2f')]=_0x3ce897;_0x55cae9[_0x3f9b('0x9')][_0x30d950]['queue']=_0x4af1b3;_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x30')]=function(){var _0x3371d2=getDiff(_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2d')]);clearTimeout(_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2b')]);_0x55cae9['timers'][_0x30d950]['timer']=![];RpcVoiceAgentReport[_0x3f9b('0x31')]({'acwtime':_0x3371d2},_0x55cae9[_0x3f9b('0x9')][_0x30d950][_0x3f9b('0x2f')],_0x30d950)[_0x3f9b('0x22')](function(_0x1bd740){logger['info'](_0x3f9b('0x32'),_0x3ce897,_0x3371d2,_0x1bd740);})[_0x3f9b('0x33')](function(_0x151b9c){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3ce897,_0x151b9c);});delete _0x55cae9[_0x3f9b('0x9')][_0x30d950];};}});}else{logger[_0x3f9b('0x24')](_0x3f9b('0x34'),_0x3ce897,_0x30d950,_0x4af1b3);}});}})['catch'](function(_0x679c7){logger['error'](_0x3f9b('0x29'),_0x3ce897,_0x55cae9['voiceQueues'][_0x4af1b3][_0x3f9b('0x2a')],_0x30d950,_0x4af1b3);})[_0x3f9b('0x35')](function(){delete _0x55cae9[_0x3f9b('0x1a')][_0x3ce897];});}catch(_0x3bcf73){logger['error'](_0x3f9b('0x36'),_0x3bcf73[_0x3f9b('0x37')]);}};Acw['prototype'][_0x3f9b('0x2c')]=function(_0x128bd4){try{var _0x4e76ba=this;if(_0x4e76ba['timers'][_0x128bd4]){_0x4e76ba[_0x3f9b('0x9')][_0x128bd4][_0x3f9b('0x2b')]=![];var _0x28c05a=_0x4e76ba[_0x3f9b('0x9')][_0x128bd4][_0x3f9b('0x2f')];var _0x371ce0=_0x4e76ba['timers'][_0x128bd4][_0x3f9b('0x1b')];var _0x515550=_0x4e76ba[_0x3f9b('0x7')][_0x371ce0]['acwTimeout'];logger['info'](_0x3f9b('0x38'),_0x28c05a,_0x128bd4);RpcUser[_0x3f9b('0x39')](this['agents'][_0x128bd4]);RpcVoiceAgentReport['update']({'acwtime':_0x515550,'agentacw':!![]},_0x28c05a,_0x128bd4)['then'](function(_0x2a183a){logger['info'](_0x3f9b('0x32'),_0x28c05a,_0x515550,_0x2a183a);})[_0x3f9b('0x33')](function(_0x3f0213){logger[_0x3f9b('0x3a')](_0x3f9b('0x3b'),_0x28c05a,_0x3f0213);});}else{logger['error'](_0x3f9b('0x3c'),_0x128bd4);if(_0x4e76ba['timers']){logger[_0x3f9b('0x24')]('[ACW][TIMERS]',JSON[_0x3f9b('0x3d')](_0x4e76ba['timers']));}}}catch(_0x3d7d92){logger[_0x3f9b('0x3a')](_0x3f9b('0x3e'),_0x3d7d92['message']);}};Acw[_0x3f9b('0x18')][_0x3f9b('0x3f')]=function(_0x528504){try{if(this[_0x3f9b('0x7')][_0x528504[_0x3f9b('0x1b')]]&&(this[_0x3f9b('0x7')][_0x528504[_0x3f9b('0x1b')]][_0x3f9b('0x4')]||this[_0x3f9b('0x7')][_0x528504['queue']][_0x3f9b('0x1d')])){if(this[_0x3f9b('0x8')][_0x528504[_0x3f9b('0x40')]]){this[_0x3f9b('0x1a')][_0x528504[_0x3f9b('0x2f')]]={'queue':_0x528504[_0x3f9b('0x1b')],'interface':_0x528504[_0x3f9b('0x40')],'destlinkedid':_0x528504['destlinkedid']};}}}catch(_0x3858b4){logger[_0x3f9b('0x3a')](_0x3f9b('0x41'),_0x3858b4[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')][_0x3f9b('0x42')]=function(_0x527fa5){try{if(this[_0x3f9b('0x7')][_0x527fa5[_0x3f9b('0x1b')]]&&(this[_0x3f9b('0x7')][_0x527fa5[_0x3f9b('0x1b')]][_0x3f9b('0x4')]||this[_0x3f9b('0x7')][_0x527fa5[_0x3f9b('0x1b')]][_0x3f9b('0x1d')])){if(this[_0x3f9b('0x8')][_0x527fa5['interface']]){this[_0x3f9b('0x1a')][_0x527fa5['uniqueid']]={'queue':_0x527fa5[_0x3f9b('0x1b')],'interface':_0x527fa5['interface']};}}}catch(_0xc945c){logger[_0x3f9b('0x3a')](_0x3f9b('0x43'),_0xc945c[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')][_0x3f9b('0xd')]=function(_0xe02866){try{if(this[_0x3f9b('0x1a')][_0xe02866[_0x3f9b('0x2f')]]&&_[_0x3f9b('0x44')](this[_0x3f9b('0x1a')][_0xe02866[_0x3f9b('0x2f')]][_0x3f9b('0x26')])){logger[_0x3f9b('0x24')](_0x3f9b('0x45'),_0xe02866['uniqueid']);this[_0x3f9b('0x19')](_0xe02866[_0x3f9b('0x2f')]);}else if(this[_0x3f9b('0x1a')][_0xe02866['linkedid']]&&_['isUndefined'](this['channels'][_0xe02866['linkedid']][_0x3f9b('0x26')])){logger[_0x3f9b('0x24')](_0x3f9b('0x46'),_0xe02866['linkedid']);this[_0x3f9b('0x19')](_0xe02866[_0x3f9b('0x47')]);}}catch(_0x505d03){logger[_0x3f9b('0x3a')](_0x3f9b('0x48'),_0x505d03[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')][_0x3f9b('0xf')]=function(_0x43cabb){try{if(this[_0x3f9b('0x1a')][_0x43cabb[_0x3f9b('0x2f')]]&&this[_0x3f9b('0x1a')][_0x43cabb['uniqueid']][_0x3f9b('0x26')]){logger[_0x3f9b('0x24')](_0x3f9b('0x49'),_0x43cabb[_0x3f9b('0x2f')]);this['startAcw'](_0x43cabb[_0x3f9b('0x2f')]);}else if(this[_0x3f9b('0x1a')][_0x43cabb[_0x3f9b('0x47')]]&&this['channels'][_0x43cabb[_0x3f9b('0x47')]]['attended']){logger[_0x3f9b('0x24')](_0x3f9b('0x4a'),_0x43cabb[_0x3f9b('0x47')]);this[_0x3f9b('0x19')](_0x43cabb[_0x3f9b('0x47')]);}}catch(_0x1a4d5f){logger[_0x3f9b('0x3a')]('[ACW][syncHangup]\x20%s',_0x1a4d5f[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')][_0x3f9b('0x11')]=function(_0x8c0eb2){try{if(!_[_0x3f9b('0x4b')](this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4c')]])){this[_0x3f9b('0x19')](_0x8c0eb2[_0x3f9b('0x4c')]);if(this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4d')]]){this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4d')]][_0x3f9b('0x26')]=!![];this['channels'][_0x8c0eb2['transfertargetuniqueid']]=this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4d')]];delete this['channels'][_0x8c0eb2[_0x3f9b('0x4d')]];}}else if(!_['isNil'](this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4e')]])){this[_0x3f9b('0x19')](_0x8c0eb2[_0x3f9b('0x4e')]);if(this['channels'][_0x8c0eb2[_0x3f9b('0x4f')]]){this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4f')]][_0x3f9b('0x26')]=!![];this[_0x3f9b('0x1a')][_0x8c0eb2['transfereeuniqueid']]=this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4f')]];delete this[_0x3f9b('0x1a')][_0x8c0eb2[_0x3f9b('0x4f')]];}}}catch(_0x4cbd7e){logger['error'](_0x3f9b('0x50'),_0x4cbd7e[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')]['syncBlindTransfer']=function(_0x4b776f){try{if(this[_0x3f9b('0x1a')][_0x4b776f[_0x3f9b('0x51')]]){logger[_0x3f9b('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x3f9b('0x3d')](_0x4b776f[_0x3f9b('0x51')]));this[_0x3f9b('0x19')](_0x4b776f[_0x3f9b('0x51')]);}else if(this[_0x3f9b('0x1a')][_0x4b776f[_0x3f9b('0x52')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x3f9b('0x3d')](_0x4b776f[_0x3f9b('0x52')]));this[_0x3f9b('0x19')](_0x4b776f[_0x3f9b('0x52')]);}}catch(_0x4f6aee){logger[_0x3f9b('0x3a')]('[ACW][syncBlindTransfer]\x20%s',_0x4f6aee[_0x3f9b('0x37')]);}};Acw[_0x3f9b('0x18')][_0x3f9b('0x10')]=function(_0x45b801){try{if(this['voiceQueues'][_0x45b801[_0x3f9b('0x1b')]]&&this[_0x3f9b('0x7')][_0x45b801[_0x3f9b('0x1b')]][_0x3f9b('0x53')]===_0x3f9b('0x54')){if(this[_0x3f9b('0x8')][_0x45b801[_0x3f9b('0x40')]]){logger['info'](_0x3f9b('0x55'),_0x45b801[_0x3f9b('0x2f')],_0x45b801[_0x3f9b('0x40')],_0x45b801['queue']);return RpcUser[_0x3f9b('0x28')](this[_0x3f9b('0x8')][_0x45b801['interface']],_0x3f9b('0x56'),_0x45b801['uniqueid']);}}}catch(_0x448b99){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x448b99[_0x3f9b('0x37')]);}};module[_0x3f9b('0x57')]=Acw; \ No newline at end of file +var _0xf3c1=['moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','util','lodash'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf3c1,0x1ea));var _0x1f3c=function(_0x581181,_0x2dbd7f){_0x581181=_0x581181-0x0;var _0xc95075=_0xf3c1[_0x581181];return _0xc95075;};'use strict';var util=require(_0x1f3c('0x0'));var _=require(_0x1f3c('0x1'));var moment=require(_0x1f3c('0x2'));var ami=require('../ami');var logger=require(_0x1f3c('0x3'))(_0x1f3c('0x4'));var RpcUser=require(_0x1f3c('0x5'));var RpcVoiceAgentReport=require(_0x1f3c('0x6'));function Acw(_0x370491){this['voiceQueues']=_0x370491[_0x1f3c('0x7')];this['agents']=_0x370491[_0x1f3c('0x8')];this[_0x1f3c('0x9')]=_0x370491[_0x1f3c('0x9')];this[_0x1f3c('0xa')]={};ami['on']('agentconnect',this[_0x1f3c('0xb')]['bind'](this));ami['on'](_0x1f3c('0xc'),this['syncHangupRequest'][_0x1f3c('0xd')](this));ami['on'](_0x1f3c('0xe'),this[_0x1f3c('0xf')]['bind'](this));ami['on']('agentringnoanswer',this[_0x1f3c('0x10')][_0x1f3c('0xd')](this));ami['on'](_0x1f3c('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x1f3c('0x12'),this[_0x1f3c('0x13')][_0x1f3c('0xd')](this));ami['on'](_0x1f3c('0x14'),this[_0x1f3c('0x15')][_0x1f3c('0xd')](this));}function getDiff(_0x5b44ac){var _0x545af=moment()[_0x1f3c('0x16')](0x0);var _0x47bfe4=moment(_0x5b44ac)[_0x1f3c('0x16')](0x0);return _0x545af[_0x1f3c('0x17')](_0x47bfe4,_0x1f3c('0x18'));}Acw['prototype']['startAcw']=function(_0x22a7e2){try{var _0x57507e=this;var _0x3dfee9=this[_0x1f3c('0xa')][_0x22a7e2][_0x1f3c('0x19')];var _0x476e00=this[_0x1f3c('0xa')][_0x22a7e2][_0x1f3c('0x1a')];var _0x17d6f3=this[_0x1f3c('0x7')][_0x476e00];var _0x178d6a=![];var _0x1cead=_0x1f3c('0x1b');if(_0x17d6f3['mandatoryDisposition']){if(_0x17d6f3[_0x1f3c('0x1c')]['name']){_0x178d6a=!![];_0x1cead=_0x17d6f3[_0x1f3c('0x1c')][_0x1f3c('0x1d')];}}ami[_0x1f3c('0x1e')]({'action':_0x1f3c('0x1f'),'interface':_0x3dfee9,'paused':!![],'reason':_0x1cead})[_0x1f3c('0x20')](function(_0x24f208){if(_0x57507e[_0x1f3c('0x8')][_0x3dfee9]){return RpcUser[_0x1f3c('0x21')](_0x57507e['agents'][_0x3dfee9]['id'])['then'](function(_0x48215c){if(_0x48215c&&!_0x48215c['voicePause']){logger[_0x1f3c('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x22a7e2,_0x3dfee9,_0x476e00);var _0x151cd3=_0x57507e[_0x1f3c('0xa')][_0x22a7e2][_0x1f3c('0x23')]&&_0x57507e[_0x1f3c('0xa')][_0x22a7e2][_0x1f3c('0x24')]?_0x57507e[_0x1f3c('0xa')][_0x22a7e2][_0x1f3c('0x24')]:_0x22a7e2;return RpcUser['savePause'](_0x57507e[_0x1f3c('0x8')][_0x3dfee9],_0x1cead,_0x151cd3)['then'](function(_0x2110f2){if(!_0x178d6a){_0x57507e['timers'][_0x3dfee9]={};logger['info'](_0x1f3c('0x25'),_0x22a7e2,_0x57507e[_0x1f3c('0x7')][_0x476e00]['acwTimeout'],_0x3dfee9,_0x476e00);_0x57507e[_0x1f3c('0x9')][_0x3dfee9]['timer']=setTimeout(_0x57507e[_0x1f3c('0x26')][_0x1f3c('0xd')](_0x57507e,_0x3dfee9),_0x57507e['voiceQueues'][_0x476e00][_0x1f3c('0x27')]*0x3e8);_0x57507e['timers'][_0x3dfee9][_0x1f3c('0x28')]=moment()[_0x1f3c('0x29')](_0x1f3c('0x2a'));_0x57507e[_0x1f3c('0x9')][_0x3dfee9][_0x1f3c('0x2b')]=_0x22a7e2;_0x57507e[_0x1f3c('0x9')][_0x3dfee9][_0x1f3c('0x1a')]=_0x476e00;_0x57507e['timers'][_0x3dfee9][_0x1f3c('0x2c')]=function(){var _0x683bed=getDiff(_0x57507e[_0x1f3c('0x9')][_0x3dfee9]['lastPauseAt']);clearTimeout(_0x57507e['timers'][_0x3dfee9][_0x1f3c('0x2d')]);_0x57507e['timers'][_0x3dfee9][_0x1f3c('0x2d')]=![];RpcVoiceAgentReport[_0x1f3c('0x2e')]({'acwtime':_0x683bed},_0x57507e[_0x1f3c('0x9')][_0x3dfee9]['uniqueid'],_0x3dfee9)[_0x1f3c('0x20')](function(_0xb14a55){logger[_0x1f3c('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x22a7e2,_0x683bed,_0xb14a55);})[_0x1f3c('0x2f')](function(_0x135e06){logger[_0x1f3c('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x22a7e2,_0x135e06);});delete _0x57507e[_0x1f3c('0x9')][_0x3dfee9];};}});}else{logger[_0x1f3c('0x22')](_0x1f3c('0x31'),_0x22a7e2,_0x3dfee9,_0x476e00);}});}})[_0x1f3c('0x2f')](function(_0x494da7){logger[_0x1f3c('0x30')](_0x1f3c('0x25'),_0x22a7e2,_0x57507e[_0x1f3c('0x7')][_0x476e00][_0x1f3c('0x27')],_0x3dfee9,_0x476e00);})[_0x1f3c('0x32')](function(){delete _0x57507e[_0x1f3c('0xa')][_0x22a7e2];});}catch(_0x57edab){logger[_0x1f3c('0x30')](_0x1f3c('0x33'),_0x57edab[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')][_0x1f3c('0x26')]=function(_0x80f037){try{var _0x2fbfc7=this;if(_0x2fbfc7['timers'][_0x80f037]){_0x2fbfc7[_0x1f3c('0x9')][_0x80f037][_0x1f3c('0x2d')]=![];var _0x4e437b=_0x2fbfc7['timers'][_0x80f037][_0x1f3c('0x2b')];var _0x36f7b=_0x2fbfc7[_0x1f3c('0x9')][_0x80f037][_0x1f3c('0x1a')];var _0x483e6a=_0x2fbfc7[_0x1f3c('0x7')][_0x36f7b][_0x1f3c('0x27')];logger[_0x1f3c('0x22')](_0x1f3c('0x36'),_0x4e437b,_0x80f037);RpcUser['saveUnpause'](this[_0x1f3c('0x8')][_0x80f037]);RpcVoiceAgentReport[_0x1f3c('0x2e')]({'acwtime':_0x483e6a,'agentacw':!![]},_0x4e437b,_0x80f037)[_0x1f3c('0x20')](function(_0x18f86f){logger[_0x1f3c('0x22')](_0x1f3c('0x37'),_0x4e437b,_0x483e6a,_0x18f86f);})[_0x1f3c('0x2f')](function(_0x43589f){logger[_0x1f3c('0x30')](_0x1f3c('0x38'),_0x4e437b,_0x43589f);});}else{logger[_0x1f3c('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x80f037);if(_0x2fbfc7[_0x1f3c('0x9')]){logger[_0x1f3c('0x22')](_0x1f3c('0x39'),JSON[_0x1f3c('0x3a')](_0x2fbfc7[_0x1f3c('0x9')]));}}}catch(_0x5be28e){logger[_0x1f3c('0x30')]('[ACW][STOP]\x20%s',_0x5be28e[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')]['syncAgentConnect']=function(_0x12bc64){try{if(this[_0x1f3c('0x7')][_0x12bc64[_0x1f3c('0x1a')]]&&(this[_0x1f3c('0x7')][_0x12bc64['queue']][_0x1f3c('0x4')]||this[_0x1f3c('0x7')][_0x12bc64[_0x1f3c('0x1a')]][_0x1f3c('0x3b')])){if(this[_0x1f3c('0x8')][_0x12bc64[_0x1f3c('0x19')]]){this[_0x1f3c('0xa')][_0x12bc64[_0x1f3c('0x2b')]]={'queue':_0x12bc64['queue'],'interface':_0x12bc64['interface'],'destlinkedid':_0x12bc64['destlinkedid']};}}}catch(_0xf20f37){logger['error'](_0x1f3c('0x3c'),_0xf20f37[_0x1f3c('0x34')]);}};Acw['prototype'][_0x1f3c('0x15')]=function(_0x20f66c){try{if(this[_0x1f3c('0x7')][_0x20f66c[_0x1f3c('0x1a')]]&&(this[_0x1f3c('0x7')][_0x20f66c[_0x1f3c('0x1a')]][_0x1f3c('0x4')]||this[_0x1f3c('0x7')][_0x20f66c[_0x1f3c('0x1a')]]['mandatoryDisposition'])){if(this[_0x1f3c('0x8')][_0x20f66c[_0x1f3c('0x19')]]){this[_0x1f3c('0xa')][_0x20f66c[_0x1f3c('0x2b')]]={'queue':_0x20f66c['queue'],'interface':_0x20f66c[_0x1f3c('0x19')]};}}}catch(_0xb51200){logger[_0x1f3c('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0xb51200[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')][_0x1f3c('0x3d')]=function(_0x30f8d4){try{if(this['channels'][_0x30f8d4[_0x1f3c('0x2b')]]&&_[_0x1f3c('0x3e')](this[_0x1f3c('0xa')][_0x30f8d4[_0x1f3c('0x2b')]][_0x1f3c('0x23')])){logger['info'](_0x1f3c('0x3f'),_0x30f8d4[_0x1f3c('0x2b')]);this['startAcw'](_0x30f8d4[_0x1f3c('0x2b')]);}else if(this[_0x1f3c('0xa')][_0x30f8d4[_0x1f3c('0x40')]]&&_['isUndefined'](this[_0x1f3c('0xa')][_0x30f8d4[_0x1f3c('0x40')]][_0x1f3c('0x23')])){logger[_0x1f3c('0x22')](_0x1f3c('0x41'),_0x30f8d4[_0x1f3c('0x40')]);this['startAcw'](_0x30f8d4['linkedid']);}}catch(_0x2e5195){logger[_0x1f3c('0x30')](_0x1f3c('0x42'),_0x2e5195[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')][_0x1f3c('0xf')]=function(_0x57f83e){try{if(this[_0x1f3c('0xa')][_0x57f83e['uniqueid']]&&this[_0x1f3c('0xa')][_0x57f83e[_0x1f3c('0x2b')]][_0x1f3c('0x23')]){logger['info'](_0x1f3c('0x43'),_0x57f83e[_0x1f3c('0x2b')]);this[_0x1f3c('0x44')](_0x57f83e[_0x1f3c('0x2b')]);}else if(this['channels'][_0x57f83e[_0x1f3c('0x40')]]&&this[_0x1f3c('0xa')][_0x57f83e['linkedid']]['attended']){logger[_0x1f3c('0x22')](_0x1f3c('0x45'),_0x57f83e[_0x1f3c('0x40')]);this[_0x1f3c('0x44')](_0x57f83e['linkedid']);}}catch(_0xc0bbab){logger[_0x1f3c('0x30')]('[ACW][syncHangup]\x20%s',_0xc0bbab[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')]['syncAttendedTransfer']=function(_0x4011b3){try{if(!_[_0x1f3c('0x46')](this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x47')]])){this[_0x1f3c('0x44')](_0x4011b3[_0x1f3c('0x47')]);if(this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x48')]]){this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x48')]][_0x1f3c('0x23')]=!![];this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x49')]]=this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x48')]];delete this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x48')]];}}else if(!_['isNil'](this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x49')]])){this[_0x1f3c('0x44')](_0x4011b3[_0x1f3c('0x49')]);if(this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x4a')]]){this[_0x1f3c('0xa')][_0x4011b3['origtransfereruniqueid']][_0x1f3c('0x23')]=!![];this['channels'][_0x4011b3[_0x1f3c('0x47')]]=this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x4a')]];delete this[_0x1f3c('0xa')][_0x4011b3[_0x1f3c('0x4a')]];}}}catch(_0x23a3e5){logger['error'](_0x1f3c('0x4b'),_0x23a3e5[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')][_0x1f3c('0x13')]=function(_0x3bdc6c){try{if(this['channels'][_0x3bdc6c['transfereruniqueid']]){logger[_0x1f3c('0x22')](_0x1f3c('0x4c'),JSON[_0x1f3c('0x3a')](_0x3bdc6c['transfereruniqueid']));this[_0x1f3c('0x44')](_0x3bdc6c[_0x1f3c('0x4d')]);}else if(this[_0x1f3c('0xa')][_0x3bdc6c['transfererlinkedid']]){logger['info'](_0x1f3c('0x4e'),JSON[_0x1f3c('0x3a')](_0x3bdc6c[_0x1f3c('0x4f')]));this[_0x1f3c('0x44')](_0x3bdc6c[_0x1f3c('0x4f')]);}}catch(_0x20c015){logger[_0x1f3c('0x30')](_0x1f3c('0x50'),_0x20c015[_0x1f3c('0x34')]);}};Acw[_0x1f3c('0x35')]['syncAgentRingNoAnswer']=function(_0x57a696){try{if(this[_0x1f3c('0x7')][_0x57a696['queue']]&&this['voiceQueues'][_0x57a696[_0x1f3c('0x1a')]]['autopause']===_0x1f3c('0x51')){if(this[_0x1f3c('0x8')][_0x57a696[_0x1f3c('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x57a696['uniqueid'],_0x57a696[_0x1f3c('0x19')],_0x57a696['queue']);return RpcUser['savePause'](this[_0x1f3c('0x8')][_0x57a696[_0x1f3c('0x19')]],'Auto-Pause',_0x57a696['uniqueid']);}}}catch(_0x2578f8){logger[_0x1f3c('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x2578f8['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index cec1066..5b0f003 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x1f5184,_0x4b7b70){var _0x492736=function(_0x2d1ac9){while(--_0x2d1ac9){_0x1f5184['push'](_0x1f5184['shift']());}};_0x492736(++_0x4b7b70);}(_0x0b0e,0x187));var _0xe0b0=function(_0x434543,_0x2fd498){_0x434543=_0x434543-0x0;var _0x3e6749=_0x0b0e[_0x434543];return _0x3e6749;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x1e5bd1,_0x25de74){var _0x2f37d3=function(_0x4163cd){while(--_0x4163cd){_0x1e5bd1['push'](_0x1e5bd1['shift']());}};_0x2f37d3(++_0x25de74);}(_0xb10b,0x12a));var _0xbb10=function(_0xee1455,_0x24b625){_0xee1455=_0xee1455-0x0;var _0x395717=_0xb10b[_0xee1455];return _0x395717;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3a75f0f..8d162eb 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x45595c,_0x35641d){var _0x37c5c3=function(_0x3948df){while(--_0x3948df){_0x45595c['push'](_0x45595c['shift']());}};_0x37c5c3(++_0x35641d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x447a8b,_0x2cd629){_0x447a8b=_0x447a8b-0x0;var _0x267a80=_0xb43b[_0x447a8b];return _0x267a80;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x258150,_0x3c6757){var _0x26be3b=function(_0x5caf58){while(--_0x5caf58){_0x258150['push'](_0x258150['shift']());}};_0x26be3b(++_0x3c6757);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5f71701..e5177d1 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x531f=['active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','queue','exports','util','lodash','moment','isNil','string','name','Contact','lastName','number','phone'];(function(_0xba96b0,_0x36e8f8){var _0xdad969=function(_0x5226b4){while(--_0x5226b4){_0xba96b0['push'](_0xba96b0['shift']());}};_0xdad969(++_0x36e8f8);}(_0x531f,0x1da));var _0xf531=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0x531f[_0x5311a1];return _0x2acb9f;};'use strict';var util=require(_0xf531('0x0'));var _=require(_0xf531('0x1'));var moment=require(_0xf531('0x2'));function checkNameSurname(_0x5f5267,_0x1c984f,_0x23b95d){var _0x241ce1='';if(!_[_0xf531('0x3')](_0x1c984f)&&'string'===typeof _0x1c984f){_0x241ce1+=_0x1c984f;}if(!_[_0xf531('0x3')](_0x23b95d)&&_0xf531('0x4')===typeof _0x23b95d){_0x241ce1+='\x20'+_0x23b95d;}if(_0x241ce1!==''){return _0x241ce1;}return _0x5f5267;}function Action(_0xeba31,_0x32b64c,_0x3cb6f6){this['voiceQueue']=_0xeba31;this['uniqueid']=_0x3cb6f6||undefined;this[_0xf531('0x5')]=checkNameSurname(_0x32b64c[_0xf531('0x6')]['phone'],_0x32b64c['Contact']['firstName'],_0x32b64c[_0xf531('0x6')][_0xf531('0x7')]);this[_0xf531('0x8')]=_0x32b64c[_0xf531('0x6')][_0xf531('0x9')];this['queue']=_0xeba31['name'];this[_0xf531('0xa')]=_0x32b64c[_0xf531('0xa')]||![];this['type']=_0xeba31[_0xf531('0xb')];this[_0xf531('0xc')]=_0xeba31[_0xf531('0xc')]||0x3;this[_0xf531('0xd')]=_0x32b64c[_0xf531('0xd')];this[_0xf531('0xe')]=_0x32b64c['countbusyretry'];this[_0xf531('0xf')]=_0x32b64c[_0xf531('0xf')];this[_0xf531('0x10')]=_0x32b64c[_0xf531('0x10')];this[_0xf531('0x11')]=_0x32b64c[_0xf531('0x11')];this[_0xf531('0x12')]=_0x32b64c[_0xf531('0x12')];this['countabandonedretry']=_0x32b64c['countabandonedretry'];this[_0xf531('0x13')]=_0x32b64c[_0xf531('0x13')];this[_0xf531('0x14')]=_0x32b64c[_0xf531('0x14')];this['ContactId']=_0x32b64c['ContactId'];this[_0xf531('0x15')]=_0x32b64c[_0xf531('0x15')];this[_0xf531('0x16')]=_0x32b64c[_0xf531('0x16')];this[_0xf531('0x17')]=_0x32b64c[_0xf531('0x17')];this[_0xf531('0x18')]=_0x32b64c[_0xf531('0x18')];this[_0xf531('0x19')]=_0x32b64c['id'];this[_0xf531('0x1a')]=_0x32b64c[_0xf531('0x6')][_0xf531('0x1b')]||'';this['starttime']=moment()[_0xf531('0x1c')](_0xf531('0x1d'));this[_0xf531('0x1e')]=_0x32b64c['callback'];this[_0xf531('0x1f')]=_0x32b64c[_0xf531('0x1f')];this[_0xf531('0x20')]=_0x32b64c[_0xf531('0x20')];this[_0xf531('0x21')]=_0x32b64c['recallme'];this[_0xf531('0x22')]='';this[_0xf531('0x23')]='';}Action[_0xf531('0x24')][_0xf531('0x25')]=function(){return util['format'](_0xf531('0x26'),this['name'],this[_0xf531('0x27')][_0xf531('0x28')]>0x0?this[_0xf531('0x8')]['substring'](this[_0xf531('0x27')]['dialCutDigit']):this[_0xf531('0x8')]);};Action[_0xf531('0x24')][_0xf531('0x29')]=function(){return this[_0xf531('0x2a')];};module[_0xf531('0x2b')]=Action; \ No newline at end of file +var _0xc5ef=['VoiceQueueId','idHopper','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','Contact','phone','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5ef,0x1b6));var _0xfc5e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xc5ef[_0x1a36a5];return _0x746243;};'use strict';var util=require(_0xfc5e('0x0'));var _=require(_0xfc5e('0x1'));var moment=require(_0xfc5e('0x2'));function checkNameSurname(_0x36e5f9,_0x4cf8a0,_0x5ef71a){var _0x52d7d5='';if(!_[_0xfc5e('0x3')](_0x4cf8a0)&&_0xfc5e('0x4')===typeof _0x4cf8a0){_0x52d7d5+=_0x4cf8a0;}if(!_[_0xfc5e('0x3')](_0x5ef71a)&&'string'===typeof _0x5ef71a){_0x52d7d5+='\x20'+_0x5ef71a;}if(_0x52d7d5!==''){return _0x52d7d5;}return _0x36e5f9;}function Action(_0x5d84d0,_0x40bba6,_0x539123){this['voiceQueue']=_0x5d84d0;this[_0xfc5e('0x5')]=_0x539123||undefined;this['name']=checkNameSurname(_0x40bba6[_0xfc5e('0x6')][_0xfc5e('0x7')],_0x40bba6[_0xfc5e('0x6')]['firstName'],_0x40bba6[_0xfc5e('0x6')][_0xfc5e('0x8')]);this['number']=_0x40bba6['Contact'][_0xfc5e('0x7')];this[_0xfc5e('0x9')]=_0x5d84d0[_0xfc5e('0xa')];this['active']=_0x40bba6[_0xfc5e('0xb')]||![];this[_0xfc5e('0xc')]=_0x5d84d0[_0xfc5e('0xc')];this[_0xfc5e('0xd')]=_0x5d84d0[_0xfc5e('0xd')]||0x3;this[_0xfc5e('0xe')]=_0x40bba6[_0xfc5e('0xe')];this['countbusyretry']=_0x40bba6[_0xfc5e('0xf')];this['countcongestionretry']=_0x40bba6[_0xfc5e('0x10')];this[_0xfc5e('0x11')]=_0x40bba6[_0xfc5e('0x11')];this[_0xfc5e('0x12')]=_0x40bba6['countnosuchnumberretry'];this['countdropretry']=_0x40bba6['countdropretry'];this[_0xfc5e('0x13')]=_0x40bba6['countabandonedretry'];this[_0xfc5e('0x14')]=_0x40bba6[_0xfc5e('0x14')];this[_0xfc5e('0x15')]=_0x40bba6[_0xfc5e('0x15')];this[_0xfc5e('0x16')]=_0x40bba6['ContactId'];this['ListId']=_0x40bba6['ListId'];this[_0xfc5e('0x17')]=_0x40bba6[_0xfc5e('0x17')];this['VoiceQueueId']=_0x40bba6[_0xfc5e('0x18')];this['CampaignId']=_0x40bba6['CampaignId'];this[_0xfc5e('0x19')]=_0x40bba6['id'];this['ContactFirstName']=_0x40bba6['Contact'][_0xfc5e('0x1a')]||'';this[_0xfc5e('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xfc5e('0x1c')]=_0x40bba6['callback'];this[_0xfc5e('0x1d')]=_0x40bba6[_0xfc5e('0x1d')];this[_0xfc5e('0x1e')]=_0x40bba6['callbackat'];this[_0xfc5e('0x1f')]=_0x40bba6[_0xfc5e('0x1f')];this[_0xfc5e('0x20')]='';this[_0xfc5e('0x21')]='';}Action[_0xfc5e('0x22')]['getCaller']=function(){return util[_0xfc5e('0x23')](_0xfc5e('0x24'),this['name'],this[_0xfc5e('0x25')][_0xfc5e('0x26')]>0x0?this[_0xfc5e('0x27')]['substring'](this[_0xfc5e('0x25')]['dialCutDigit']):this[_0xfc5e('0x27')]);};Action['prototype'][_0xfc5e('0x28')]=function(){return this[_0xfc5e('0x9')];};module[_0xfc5e('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 59ce1e0..adc0c85 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ee=['YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','queue','membername','reason','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','responsetime','answertime','endtime'];(function(_0x4f3dee,_0x46bb90){var _0x291aad=function(_0x3ca8f5){while(--_0x3ca8f5){_0x4f3dee['push'](_0x4f3dee['shift']());}};_0x291aad(++_0x46bb90);}(_0xd2ee,0x1a7));var _0xed2e=function(_0x3a2ce7,_0x598c55){_0x3a2ce7=_0x3a2ce7-0x0;var _0x672124=_0xd2ee[_0x3a2ce7];return _0x672124;};'use strict';var util=require(_0xed2e('0x0'));var _=require(_0xed2e('0x1'));var moment=require('moment');function getSeconds(_0x1a183b,_0x5bcc59){var _0x588f7c=moment(_0x1a183b)['milliseconds'](0x0);var _0x18cbe4=moment(_0x5bcc59)[_0xed2e('0x2')](0x0);return _0x588f7c[_0xed2e('0x3')](_0x18cbe4,_0xed2e('0x4'));}function AgentComplete(_0x5b0602,_0x32da38){this[_0xed2e('0x5')]=0x4;this['statedesc']=_0xed2e('0x6');this[_0xed2e('0x7')]=_0x5b0602[_0xed2e('0x7')];this[_0xed2e('0x8')]=_0x5b0602['type'];this[_0xed2e('0x9')]=_0x5b0602[_0xed2e('0x8')]===_0xed2e('0xa')?'queue':_0x5b0602[_0xed2e('0x8')];this[_0xed2e('0xb')]=_0x5b0602[_0xed2e('0xb')];this['countcongestionretry']=_0x5b0602['countcongestionretry'];this['countnoanswerretry']=_0x5b0602['countnoanswerretry'];this[_0xed2e('0xc')]=_0x5b0602[_0xed2e('0xb')]+_0x5b0602[_0xed2e('0xd')]+_0x5b0602[_0xed2e('0xe')]+_0x5b0602['countnosuchnumberretry']+_0x5b0602[_0xed2e('0xf')]+_0x5b0602[_0xed2e('0x10')]+_0x5b0602['countmachineretry']+_0x5b0602[_0xed2e('0x11')];this[_0xed2e('0x12')]=_0x5b0602[_0xed2e('0x12')];this[_0xed2e('0xf')]=_0x5b0602[_0xed2e('0xf')];this[_0xed2e('0x10')]=_0x5b0602[_0xed2e('0x10')];this[_0xed2e('0x13')]=_0x5b0602[_0xed2e('0x13')];this[_0xed2e('0x11')]=_0x5b0602['countagentrejectretry'];this[_0xed2e('0x14')]=_0x32da38['uniqueid'];this[_0xed2e('0x15')]=_0x5b0602[_0xed2e('0x16')];this[_0xed2e('0x17')]=_0x5b0602['number'];this['starttime']=_0x5b0602['starttime'];this[_0xed2e('0x18')]=_0x5b0602['responsetime'];this[_0xed2e('0x19')]=_0x5b0602[_0xed2e('0x19')];this[_0xed2e('0x1a')]=moment()['format'](_0xed2e('0x1b'));this[_0xed2e('0x1c')]=getSeconds(_0x5b0602[_0xed2e('0x18')],_0x5b0602[_0xed2e('0x1d')]);this[_0xed2e('0x1e')]=getSeconds(_0x5b0602['answertime'],_0x5b0602['responsetime']);this[_0xed2e('0x1f')]=getSeconds(this[_0xed2e('0x1a')],_0x5b0602[_0xed2e('0x19')]);this['queue']=_0x32da38[_0xed2e('0x20')];this[_0xed2e('0x21')]=_0x32da38[_0xed2e('0x21')];this['reason']=_0x32da38[_0xed2e('0x22')];this['callback']=_0x5b0602['callback'];this[_0xed2e('0x23')]=_0x5b0602[_0xed2e('0x23')];this[_0xed2e('0x24')]=_0x5b0602[_0xed2e('0x24')];this['recallme']=_0x5b0602['recallme'];this[_0xed2e('0x25')]=_0x5b0602[_0xed2e('0x25')];this[_0xed2e('0x26')]=_0x5b0602[_0xed2e('0x26')];this[_0xed2e('0x27')]=_0x5b0602[_0xed2e('0x27')];this[_0xed2e('0x28')]=_0x5b0602[_0xed2e('0x28')];this[_0xed2e('0x29')]=_0x5b0602['CampaignId'];this[_0xed2e('0x2a')]=_0x5b0602[_0xed2e('0x2a')]||'';this[_0xed2e('0x2b')]=_0x5b0602[_0xed2e('0x2b')]||'';}module[_0xed2e('0x2c')]=AgentComplete; \ No newline at end of file +var _0xd947=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x396883,_0x5851ff){var _0x3b64d4=function(_0x3f271f){while(--_0x3f271f){_0x396883['push'](_0x396883['shift']());}};_0x3b64d4(++_0x5851ff);}(_0xd947,0x130));var _0x7d94=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd947[_0x432682];return _0x463d05;};'use strict';var util=require(_0x7d94('0x0'));var _=require(_0x7d94('0x1'));var moment=require(_0x7d94('0x2'));function getSeconds(_0x23e479,_0x5a7b66){var _0x5d7377=moment(_0x23e479)[_0x7d94('0x3')](0x0);var _0x58731c=moment(_0x5a7b66)[_0x7d94('0x3')](0x0);return _0x5d7377[_0x7d94('0x4')](_0x58731c,'seconds');}function AgentComplete(_0x394b04,_0x152fe8){this['state']=0x4;this[_0x7d94('0x5')]=_0x7d94('0x6');this['scheduledat']=_0x394b04[_0x7d94('0x7')];this[_0x7d94('0x8')]=_0x394b04[_0x7d94('0x8')];this[_0x7d94('0x9')]=_0x394b04[_0x7d94('0x8')]===_0x7d94('0xa')?_0x7d94('0xb'):_0x394b04['type'];this[_0x7d94('0xc')]=_0x394b04[_0x7d94('0xc')];this['countcongestionretry']=_0x394b04[_0x7d94('0xd')];this['countnoanswerretry']=_0x394b04[_0x7d94('0xe')];this[_0x7d94('0xf')]=_0x394b04[_0x7d94('0xc')]+_0x394b04[_0x7d94('0xd')]+_0x394b04[_0x7d94('0xe')]+_0x394b04[_0x7d94('0x10')]+_0x394b04[_0x7d94('0x11')]+_0x394b04[_0x7d94('0x12')]+_0x394b04[_0x7d94('0x13')]+_0x394b04[_0x7d94('0x14')];this[_0x7d94('0x10')]=_0x394b04[_0x7d94('0x10')];this[_0x7d94('0x11')]=_0x394b04[_0x7d94('0x11')];this[_0x7d94('0x12')]=_0x394b04[_0x7d94('0x12')];this[_0x7d94('0x13')]=_0x394b04['countmachineretry'];this['countagentrejectretry']=_0x394b04[_0x7d94('0x14')];this[_0x7d94('0x15')]=_0x152fe8[_0x7d94('0x15')];this[_0x7d94('0x16')]=_0x394b04['name'];this[_0x7d94('0x17')]=_0x394b04['number'];this[_0x7d94('0x18')]=_0x394b04[_0x7d94('0x18')];this[_0x7d94('0x19')]=_0x394b04[_0x7d94('0x19')];this['answertime']=_0x394b04['answertime'];this[_0x7d94('0x1a')]=moment()[_0x7d94('0x1b')](_0x7d94('0x1c'));this[_0x7d94('0x1d')]=getSeconds(_0x394b04[_0x7d94('0x19')],_0x394b04['starttime']);this[_0x7d94('0x1e')]=getSeconds(_0x394b04['answertime'],_0x394b04[_0x7d94('0x19')]);this[_0x7d94('0x1f')]=getSeconds(this[_0x7d94('0x1a')],_0x394b04['answertime']);this[_0x7d94('0xb')]=_0x152fe8[_0x7d94('0xb')];this[_0x7d94('0x20')]=_0x152fe8['membername'];this[_0x7d94('0x21')]=_0x152fe8[_0x7d94('0x21')];this[_0x7d94('0x22')]=_0x394b04[_0x7d94('0x22')];this[_0x7d94('0x23')]=_0x394b04[_0x7d94('0x23')];this[_0x7d94('0x24')]=_0x394b04[_0x7d94('0x24')];this['recallme']=_0x394b04[_0x7d94('0x25')];this[_0x7d94('0x26')]=_0x394b04[_0x7d94('0x26')];this[_0x7d94('0x27')]=_0x394b04[_0x7d94('0x27')];this[_0x7d94('0x28')]=_0x394b04[_0x7d94('0x28')];this[_0x7d94('0x29')]=_0x394b04['VoiceQueueId'];this[_0x7d94('0x2a')]=_0x394b04[_0x7d94('0x2a')];this[_0x7d94('0x2b')]=_0x394b04[_0x7d94('0x2b')]||'';this['originatecalleridname']=_0x394b04[_0x7d94('0x2c')]||'';}module[_0x7d94('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a277032..3071b05 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc492=['calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue'];(function(_0x5ecfc0,_0x2b1d77){var _0x2f0385=function(_0x1f5593){while(--_0x1f5593){_0x5ecfc0['push'](_0x5ecfc0['shift']());}};_0x2f0385(++_0x2b1d77);}(_0xc492,0xd7));var _0x2c49=function(_0x28495b,_0x215e6d){_0x28495b=_0x28495b-0x0;var _0xc87320=_0xc492[_0x28495b];return _0xc87320;};'use strict';var util=require(_0x2c49('0x0'));var _=require(_0x2c49('0x1'));var moment=require(_0x2c49('0x2'));function getSeconds(_0x5c2d08,_0x57cde2){var _0x37eda4=moment(_0x5c2d08)['milliseconds'](0x0);var _0x4c9b2d=moment(_0x57cde2)[_0x2c49('0x3')](0x0);return _0x37eda4[_0x2c49('0x4')](_0x4c9b2d,'seconds');}function Final(_0x1165e3){this['uniqueid']=_0x1165e3[_0x2c49('0x5')];this[_0x2c49('0x6')]=_0x1165e3['scheduledat'];this[_0x2c49('0x7')]=_0x1165e3[_0x2c49('0x7')];this[_0x2c49('0x8')]=_0x1165e3[_0x2c49('0x7')]===_0x2c49('0x9')?'queue':_0x1165e3[_0x2c49('0x7')];this['countbusyretry']=_0x1165e3['countbusyretry'];this['countcongestionretry']=_0x1165e3['countcongestionretry'];this[_0x2c49('0xa')]=_0x1165e3['countnoanswerretry'];this[_0x2c49('0xb')]=_0x1165e3[_0x2c49('0xc')]+_0x1165e3['countcongestionretry']+_0x1165e3[_0x2c49('0xa')]+_0x1165e3[_0x2c49('0xd')]+_0x1165e3[_0x2c49('0xe')]+_0x1165e3[_0x2c49('0xf')]+_0x1165e3[_0x2c49('0x10')]+_0x1165e3[_0x2c49('0x11')];this['countnosuchnumberretry']=_0x1165e3[_0x2c49('0xd')];this[_0x2c49('0xe')]=_0x1165e3[_0x2c49('0xe')];this[_0x2c49('0xf')]=_0x1165e3[_0x2c49('0xf')];this['countmachineretry']=_0x1165e3[_0x2c49('0x10')];this[_0x2c49('0x11')]=_0x1165e3[_0x2c49('0x11')];this[_0x2c49('0x12')]=_0x1165e3[_0x2c49('0x12')];this[_0x2c49('0x13')]=_0x1165e3[_0x2c49('0x13')];this[_0x2c49('0x14')]=_0x1165e3[_0x2c49('0x14')];this[_0x2c49('0x15')]=_0x1165e3['starttime'];this[_0x2c49('0x16')]=_0x1165e3[_0x2c49('0x16')];this[_0x2c49('0x17')]=_0x1165e3[_0x2c49('0x16')];this['ringtime']=_0x1165e3[_0x2c49('0x18')]||0x0;this['holdtime']=_0x1165e3[_0x2c49('0x19')]||0x0;this[_0x2c49('0x1a')]=_0x1165e3['talktime']||0x0;this['callback']=_0x1165e3[_0x2c49('0x1b')];this[_0x2c49('0x1c')]=_0x1165e3[_0x2c49('0x1c')];this[_0x2c49('0x1d')]=_0x1165e3[_0x2c49('0x1d')];this[_0x2c49('0x1e')]=_0x1165e3[_0x2c49('0x1e')];this[_0x2c49('0x1f')]=_0x1165e3[_0x2c49('0x1f')];this['ListId']=_0x1165e3[_0x2c49('0x20')];this[_0x2c49('0x21')]=_0x1165e3[_0x2c49('0x21')];this[_0x2c49('0x22')]=_0x1165e3['VoiceQueueId'];this[_0x2c49('0x23')]=_0x1165e3[_0x2c49('0x23')];this[_0x2c49('0x24')]=_0x1165e3[_0x2c49('0x24')]||'';this['originatecalleridname']=_0x1165e3[_0x2c49('0x25')]||'';}module[_0x2c49('0x26')]=Final; \ No newline at end of file +var _0xfd7b=['countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry'];(function(_0x46d84a,_0x130941){var _0x1d5080=function(_0x5a6531){while(--_0x5a6531){_0x46d84a['push'](_0x46d84a['shift']());}};_0x1d5080(++_0x130941);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xfd7b[_0x999b85];return _0x1d7124;};'use strict';var util=require('util');var _=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));function getSeconds(_0x3138e8,_0x27db01){var _0x1ea39e=moment(_0x3138e8)[_0xbfd7('0x2')](0x0);var _0xb348ee=moment(_0x27db01)[_0xbfd7('0x2')](0x0);return _0x1ea39e[_0xbfd7('0x3')](_0xb348ee,_0xbfd7('0x4'));}function Final(_0x10a705){this[_0xbfd7('0x5')]=_0x10a705[_0xbfd7('0x5')];this['scheduledat']=_0x10a705[_0xbfd7('0x6')];this['type']=_0x10a705[_0xbfd7('0x7')];this['campaigntype']=_0x10a705[_0xbfd7('0x7')]===_0xbfd7('0x8')?_0xbfd7('0x9'):_0x10a705[_0xbfd7('0x7')];this['countbusyretry']=_0x10a705[_0xbfd7('0xa')];this[_0xbfd7('0xb')]=_0x10a705['countcongestionretry'];this['countnoanswerretry']=_0x10a705[_0xbfd7('0xc')];this[_0xbfd7('0xd')]=_0x10a705[_0xbfd7('0xa')]+_0x10a705[_0xbfd7('0xb')]+_0x10a705[_0xbfd7('0xc')]+_0x10a705['countnosuchnumberretry']+_0x10a705[_0xbfd7('0xe')]+_0x10a705['countabandonedretry']+_0x10a705[_0xbfd7('0xf')]+_0x10a705['countagentrejectretry'];this['countnosuchnumberretry']=_0x10a705[_0xbfd7('0x10')];this[_0xbfd7('0xe')]=_0x10a705[_0xbfd7('0xe')];this[_0xbfd7('0x11')]=_0x10a705['countabandonedretry'];this['countmachineretry']=_0x10a705['countmachineretry'];this[_0xbfd7('0x12')]=_0x10a705[_0xbfd7('0x12')];this[_0xbfd7('0x9')]=_0x10a705[_0xbfd7('0x9')];this[_0xbfd7('0x13')]=_0x10a705[_0xbfd7('0x13')];this[_0xbfd7('0x14')]=_0x10a705[_0xbfd7('0x14')];this[_0xbfd7('0x15')]=_0x10a705['starttime'];this['responsetime']=_0x10a705[_0xbfd7('0x16')];this[_0xbfd7('0x17')]=_0x10a705['responsetime'];this['ringtime']=_0x10a705[_0xbfd7('0x18')]||0x0;this['holdtime']=_0x10a705['holdtime']||0x0;this[_0xbfd7('0x19')]=_0x10a705['talktime']||0x0;this[_0xbfd7('0x1a')]=_0x10a705[_0xbfd7('0x1a')];this[_0xbfd7('0x1b')]=_0x10a705[_0xbfd7('0x1b')];this['callbackat']=_0x10a705[_0xbfd7('0x1c')];this[_0xbfd7('0x1d')]=_0x10a705[_0xbfd7('0x1d')];this[_0xbfd7('0x1e')]=_0x10a705[_0xbfd7('0x1e')];this[_0xbfd7('0x1f')]=_0x10a705['ListId'];this[_0xbfd7('0x20')]=_0x10a705[_0xbfd7('0x20')];this[_0xbfd7('0x21')]=_0x10a705['VoiceQueueId'];this[_0xbfd7('0x22')]=_0x10a705[_0xbfd7('0x22')];this[_0xbfd7('0x23')]=_0x10a705[_0xbfd7('0x23')]||'';this[_0xbfd7('0x24')]=_0x10a705['originatecalleridname']||'';}module[_0xbfd7('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3822e67..f5fd485 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc93b=['number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name'];(function(_0x1c313b,_0x191e68){var _0x4a1ce8=function(_0x23f976){while(--_0x23f976){_0x1c313b['push'](_0x1c313b['shift']());}};_0x4a1ce8(++_0x191e68);}(_0xc93b,0x186));var _0xbc93=function(_0x494986,_0x4debb8){_0x494986=_0x494986-0x0;var _0x1c805b=_0xc93b[_0x494986];return _0x1c805b;};'use strict';var util=require(_0xbc93('0x0'));var _=require('lodash');var moment=require(_0xbc93('0x1'));function getSeconds(_0x213397,_0x55890f){var _0x4e3900=moment(_0x213397)[_0xbc93('0x2')](0x0);var _0x3de956=moment(_0x55890f)[_0xbc93('0x2')](0x0);return _0x4e3900[_0xbc93('0x3')](_0x3de956,_0xbc93('0x4'));}function Hangup(_0x241b46,_0x5f330e){this[_0xbc93('0x5')]=0x4;this[_0xbc93('0x6')]=_0xbc93('0x7');this[_0xbc93('0x8')]=_0x241b46[_0xbc93('0x8')];this[_0xbc93('0x9')]=_0x241b46[_0xbc93('0x9')];this[_0xbc93('0xa')]=_0x241b46[_0xbc93('0x9')]===_0xbc93('0xb')?'queue':_0x241b46[_0xbc93('0x9')];this[_0xbc93('0xc')]=_0x241b46[_0xbc93('0xc')];this['countcongestionretry']=_0x241b46[_0xbc93('0xd')];this[_0xbc93('0xe')]=_0x241b46[_0xbc93('0xe')];this[_0xbc93('0xf')]=_0x241b46[_0xbc93('0xc')]+_0x241b46['countcongestionretry']+_0x241b46[_0xbc93('0xe')]+_0x241b46[_0xbc93('0x10')]+_0x241b46['countdropretry']+_0x241b46[_0xbc93('0x11')]+_0x241b46[_0xbc93('0x12')]+_0x241b46[_0xbc93('0x13')];this[_0xbc93('0x10')]=_0x241b46[_0xbc93('0x10')];this[_0xbc93('0x14')]=_0x241b46[_0xbc93('0x14')];this[_0xbc93('0x11')]=_0x241b46[_0xbc93('0x11')];this[_0xbc93('0x12')]=_0x241b46[_0xbc93('0x12')];this[_0xbc93('0x13')]=_0x241b46[_0xbc93('0x13')];this['uniqueid']=_0x5f330e[_0xbc93('0x15')];this[_0xbc93('0x16')]=_0x241b46[_0xbc93('0x17')];this['calleridnum']=_0x241b46[_0xbc93('0x18')];this[_0xbc93('0x19')]=_0x241b46[_0xbc93('0x19')];this[_0xbc93('0x1a')]=_0x241b46['responsetime'];this['endtime']=moment()[_0xbc93('0x1b')](_0xbc93('0x1c'));this[_0xbc93('0x1d')]=getSeconds(_0x241b46[_0xbc93('0x1a')],_0x241b46[_0xbc93('0x19')]);this[_0xbc93('0x1e')]=0x0;this[_0xbc93('0x1f')]=getSeconds(this[_0xbc93('0x20')],_0x241b46[_0xbc93('0x1a')]);this['queue']=_0x241b46[_0xbc93('0x21')];this[_0xbc93('0x22')]=_0xbc93('0x23');this[_0xbc93('0x24')]=_0x5f330e[_0xbc93('0x25')];this[_0xbc93('0x26')]=_0x241b46['callback'];this[_0xbc93('0x27')]=_0x241b46[_0xbc93('0x27')];this[_0xbc93('0x28')]=_0x241b46[_0xbc93('0x28')];this['recallme']=_0x241b46[_0xbc93('0x29')];this['ContactId']=_0x241b46['ContactId'];this['ListId']=_0x241b46[_0xbc93('0x2a')];this[_0xbc93('0x2b')]=_0x241b46[_0xbc93('0x2b')];this['VoiceQueueId']=_0x241b46['VoiceQueueId'];this[_0xbc93('0x2c')]=_0x241b46[_0xbc93('0x2c')];}module[_0xbc93('0x2d')]=Hangup; \ No newline at end of file +var _0x8782=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','statedesc','Answer','scheduledat','type'];(function(_0x5592f1,_0x3a9b6c){var _0x4ead16=function(_0xc64561){while(--_0xc64561){_0x5592f1['push'](_0x5592f1['shift']());}};_0x4ead16(++_0x3a9b6c);}(_0x8782,0xf4));var _0x2878=function(_0x1f29a8,_0x15ee9b){_0x1f29a8=_0x1f29a8-0x0;var _0xc62ab7=_0x8782[_0x1f29a8];return _0xc62ab7;};'use strict';var util=require(_0x2878('0x0'));var _=require(_0x2878('0x1'));var moment=require(_0x2878('0x2'));function getSeconds(_0x2fb28d,_0x5eca03){var _0x1a071a=moment(_0x2fb28d)[_0x2878('0x3')](0x0);var _0x115fba=moment(_0x5eca03)[_0x2878('0x3')](0x0);return _0x1a071a['diff'](_0x115fba,'seconds');}function Hangup(_0x15a92b,_0x4f5d61){this['state']=0x4;this[_0x2878('0x4')]=_0x2878('0x5');this[_0x2878('0x6')]=_0x15a92b['scheduledat'];this[_0x2878('0x7')]=_0x15a92b[_0x2878('0x7')];this['campaigntype']=_0x15a92b[_0x2878('0x7')]===_0x2878('0x8')?_0x2878('0x9'):_0x15a92b[_0x2878('0x7')];this[_0x2878('0xa')]=_0x15a92b[_0x2878('0xa')];this[_0x2878('0xb')]=_0x15a92b['countcongestionretry'];this[_0x2878('0xc')]=_0x15a92b[_0x2878('0xc')];this[_0x2878('0xd')]=_0x15a92b[_0x2878('0xa')]+_0x15a92b['countcongestionretry']+_0x15a92b[_0x2878('0xc')]+_0x15a92b['countnosuchnumberretry']+_0x15a92b[_0x2878('0xe')]+_0x15a92b[_0x2878('0xf')]+_0x15a92b[_0x2878('0x10')]+_0x15a92b[_0x2878('0x11')];this[_0x2878('0x12')]=_0x15a92b[_0x2878('0x12')];this[_0x2878('0xe')]=_0x15a92b[_0x2878('0xe')];this['countabandonedretry']=_0x15a92b[_0x2878('0xf')];this['countmachineretry']=_0x15a92b['countmachineretry'];this[_0x2878('0x11')]=_0x15a92b['countagentrejectretry'];this['uniqueid']=_0x4f5d61[_0x2878('0x13')];this['calleridname']=_0x15a92b[_0x2878('0x14')];this['calleridnum']=_0x15a92b[_0x2878('0x15')];this[_0x2878('0x16')]=_0x15a92b[_0x2878('0x16')];this[_0x2878('0x17')]=_0x15a92b[_0x2878('0x17')];this[_0x2878('0x18')]=moment()[_0x2878('0x19')](_0x2878('0x1a'));this[_0x2878('0x1b')]=getSeconds(_0x15a92b[_0x2878('0x17')],_0x15a92b[_0x2878('0x16')]);this[_0x2878('0x1c')]=0x0;this[_0x2878('0x1d')]=getSeconds(this[_0x2878('0x18')],_0x15a92b[_0x2878('0x17')]);this[_0x2878('0x9')]=_0x15a92b[_0x2878('0x9')];this['membername']=_0x2878('0x1e');this['reason']=_0x4f5d61[_0x2878('0x1f')];this[_0x2878('0x20')]=_0x15a92b[_0x2878('0x20')];this['callbackuniqueid']=_0x15a92b[_0x2878('0x21')];this[_0x2878('0x22')]=_0x15a92b['callbackat'];this['recallme']=_0x15a92b[_0x2878('0x23')];this[_0x2878('0x24')]=_0x15a92b[_0x2878('0x24')];this[_0x2878('0x25')]=_0x15a92b[_0x2878('0x25')];this[_0x2878('0x26')]=_0x15a92b[_0x2878('0x26')];this[_0x2878('0x27')]=_0x15a92b[_0x2878('0x27')];this[_0x2878('0x28')]=_0x15a92b[_0x2878('0x28')];}module[_0x2878('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 3e0cdc4..377f285 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb497=['milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb497,0x9f));var _0x7b49=function(_0x58ef50,_0x5a6342){_0x58ef50=_0x58ef50-0x0;var _0xaeb82c=_0xb497[_0x58ef50];return _0xaeb82c;};'use strict';var util=require(_0x7b49('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x208a6c,_0x5d16a1){var _0x1e2869=moment(_0x208a6c)[_0x7b49('0x1')](0x0);var _0x18d5a1=moment(_0x5d16a1)[_0x7b49('0x1')](0x0);return _0x1e2869[_0x7b49('0x2')](_0x18d5a1,_0x7b49('0x3'));}function History(_0x474d05){this['uniqueid']=_0x474d05[_0x7b49('0x4')];this[_0x7b49('0x5')]=_0x474d05[_0x7b49('0x5')]||undefined;this[_0x7b49('0x6')]=_0x474d05['type'];this['campaigntype']=_0x474d05[_0x7b49('0x6')]===_0x7b49('0x7')?_0x7b49('0x8'):_0x474d05['type'];this[_0x7b49('0x9')]=_0x474d05[_0x7b49('0x9')];this['countcongestionretry']=_0x474d05[_0x7b49('0xa')];this[_0x7b49('0xb')]=_0x474d05[_0x7b49('0xb')];this[_0x7b49('0xc')]=_0x474d05[_0x7b49('0x9')]+_0x474d05[_0x7b49('0xa')]+_0x474d05[_0x7b49('0xb')]+_0x474d05['countnosuchnumberretry']+_0x474d05[_0x7b49('0xd')]+_0x474d05[_0x7b49('0xe')]+_0x474d05[_0x7b49('0xf')]+_0x474d05[_0x7b49('0x10')];this[_0x7b49('0x11')]=_0x474d05[_0x7b49('0x11')];this[_0x7b49('0xd')]=_0x474d05[_0x7b49('0xd')];this[_0x7b49('0xe')]=_0x474d05['countabandonedretry'];this['countmachineretry']=_0x474d05[_0x7b49('0xf')];this['countagentrejectretry']=_0x474d05[_0x7b49('0x10')];this[_0x7b49('0x8')]=_0x474d05[_0x7b49('0x8')];this[_0x7b49('0x12')]=_0x474d05[_0x7b49('0x13')];this[_0x7b49('0x14')]=_0x474d05[_0x7b49('0x15')];this[_0x7b49('0x16')]=_0x474d05['starttime'];this[_0x7b49('0x17')]=_0x474d05[_0x7b49('0x17')];this[_0x7b49('0x18')]=_0x474d05[_0x7b49('0x17')];this[_0x7b49('0x19')]=getSeconds(_0x474d05[_0x7b49('0x17')],_0x474d05[_0x7b49('0x16')]);this[_0x7b49('0x1a')]=0x0;this[_0x7b49('0x1b')]=0x0;this[_0x7b49('0x1c')]=_0x474d05['callback'];this[_0x7b49('0x1d')]=_0x474d05[_0x7b49('0x1d')];this[_0x7b49('0x1e')]=_0x474d05['callbackat'];this[_0x7b49('0x1f')]=_0x474d05[_0x7b49('0x1f')];this[_0x7b49('0x20')]=_0x474d05[_0x7b49('0x20')];this[_0x7b49('0x21')]=_0x474d05[_0x7b49('0x21')];this['UserId']=_0x474d05[_0x7b49('0x22')];this[_0x7b49('0x23')]=_0x474d05['VoiceQueueId'];this['CampaignId']=_0x474d05[_0x7b49('0x24')];this['originatecalleridnum']=_0x474d05[_0x7b49('0x25')]||'';this[_0x7b49('0x26')]=_0x474d05[_0x7b49('0x26')]||'';}module[_0x7b49('0x27')]=History; \ No newline at end of file +var _0x14f5=['queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x14f5,0x118));var _0x514f=function(_0x340c00,_0x3fe680){_0x340c00=_0x340c00-0x0;var _0x19154d=_0x14f5[_0x340c00];return _0x19154d;};'use strict';var util=require(_0x514f('0x0'));var _=require(_0x514f('0x1'));var moment=require('moment');function getSeconds(_0x4c7f4e,_0x594197){var _0x41380a=moment(_0x4c7f4e)[_0x514f('0x2')](0x0);var _0x4f8465=moment(_0x594197)[_0x514f('0x2')](0x0);return _0x41380a[_0x514f('0x3')](_0x4f8465,_0x514f('0x4'));}function History(_0x42aba){this[_0x514f('0x5')]=_0x42aba[_0x514f('0x5')];this[_0x514f('0x6')]=_0x42aba[_0x514f('0x6')]||undefined;this[_0x514f('0x7')]=_0x42aba[_0x514f('0x7')];this['campaigntype']=_0x42aba[_0x514f('0x7')]==='outbound'?'queue':_0x42aba[_0x514f('0x7')];this[_0x514f('0x8')]=_0x42aba['countbusyretry'];this[_0x514f('0x9')]=_0x42aba[_0x514f('0x9')];this[_0x514f('0xa')]=_0x42aba[_0x514f('0xa')];this[_0x514f('0xb')]=_0x42aba['countbusyretry']+_0x42aba[_0x514f('0x9')]+_0x42aba[_0x514f('0xa')]+_0x42aba[_0x514f('0xc')]+_0x42aba[_0x514f('0xd')]+_0x42aba[_0x514f('0xe')]+_0x42aba['countmachineretry']+_0x42aba[_0x514f('0xf')];this[_0x514f('0xc')]=_0x42aba['countnosuchnumberretry'];this[_0x514f('0xd')]=_0x42aba[_0x514f('0xd')];this[_0x514f('0xe')]=_0x42aba[_0x514f('0xe')];this['countmachineretry']=_0x42aba['countmachineretry'];this[_0x514f('0xf')]=_0x42aba[_0x514f('0xf')];this[_0x514f('0x10')]=_0x42aba['queue'];this[_0x514f('0x11')]=_0x42aba[_0x514f('0x12')];this[_0x514f('0x13')]=_0x42aba['number'];this[_0x514f('0x14')]=_0x42aba[_0x514f('0x14')];this[_0x514f('0x15')]=_0x42aba[_0x514f('0x15')];this[_0x514f('0x16')]=_0x42aba[_0x514f('0x15')];this[_0x514f('0x17')]=getSeconds(_0x42aba[_0x514f('0x15')],_0x42aba[_0x514f('0x14')]);this[_0x514f('0x18')]=0x0;this['talktime']=0x0;this[_0x514f('0x19')]=_0x42aba[_0x514f('0x19')];this['callbackuniqueid']=_0x42aba[_0x514f('0x1a')];this[_0x514f('0x1b')]=_0x42aba[_0x514f('0x1b')];this['recallme']=_0x42aba[_0x514f('0x1c')];this[_0x514f('0x1d')]=_0x42aba[_0x514f('0x1d')];this['ListId']=_0x42aba[_0x514f('0x1e')];this[_0x514f('0x1f')]=_0x42aba[_0x514f('0x1f')];this[_0x514f('0x20')]=_0x42aba[_0x514f('0x20')];this['CampaignId']=_0x42aba[_0x514f('0x21')];this[_0x514f('0x22')]=_0x42aba[_0x514f('0x22')]||'';this['originatecalleridname']=_0x42aba[_0x514f('0x23')]||'';}module[_0x514f('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 91c89e4..a02ddd3 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 _0x0eaa=['outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty','\x22%s\x22\x20<%s>','error','stack','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','talking','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','[actions]','clearZombieChannels','isNil','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','active','SIP/%s','status','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','uniqueid','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countglobal','countnoanswerretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','minutes','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','channel','syncQueueMember','actionid','stateinterface','locked','rrmemory','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','Action','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','checkDialMethod','handlePower','dialPowerLevel','predictive','booked','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','\x5cw{0,','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','not_inuse','dialOrderByScheduledAt','checkIsBlackList','Contact.phone','[getContactDialer2]','dialLimitQueue','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','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','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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','message','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x5da68b,_0x16711d){_0x5da68b=_0x5da68b-0x0;var _0x5e7393=_0x0eaa[_0x5da68b];return _0x5e7393;};'use strict';var util=require(_0xa0ea('0x0'));var _=require(_0xa0ea('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xa0ea('0x2'));var rr=require('rr');var md5=require(_0xa0ea('0x3'));var Redis=require('ioredis');var ut=require(_0xa0ea('0x4'));var config=require(_0xa0ea('0x5'));var logger=require(_0xa0ea('0x6'))(_0xa0ea('0x7'));var loggerBooked=require(_0xa0ea('0x6'))('booked');var loggerPredictive=require(_0xa0ea('0x6'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0xa0ea('0x8'));var loggerSyncQueueSummary=require(_0xa0ea('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0xa0ea('0x9')]=_[_0xa0ea('0xa')](config[_0xa0ea('0x9')],{'host':_0xa0ea('0xb'),'port':0x18eb});var io=require(_0xa0ea('0xc'))(new Redis(config['redis']));var cmHopper=require(_0xa0ea('0xd'));var cmHopperHistory=require(_0xa0ea('0xe'));var cmHopperBlack=require(_0xa0ea('0xf'));var voiceQueueRt=require(_0xa0ea('0x10'));var Action=require('./action');var History=require(_0xa0ea('0x11'));var Final=require(_0xa0ea('0x12'));var AgentComplete=require(_0xa0ea('0x13'));var QueueCallerAbandon=require(_0xa0ea('0x14'));var Hangup=require(_0xa0ea('0x15'));var ipAgi=process['env'][_0xa0ea('0x16')]||_0xa0ea('0x17');var strategy={'rrmemory':'rrmemory','roundrobin':_0xa0ea('0x18')};var Sequence=function(){};Sequence[_0xa0ea('0x19')][_0xa0ea('0x1a')]=function(_0x264561){this['tail']=this[_0xa0ea('0x1b')]?this[_0xa0ea('0x1b')][_0xa0ea('0x1c')](_0x264561):_0x264561();};function Dialer(_0x130156,_0x10d8f9){this[_0xa0ea('0x1d')]=new Sequence();this[_0xa0ea('0x1e')]=_0x10d8f9;this[_0xa0ea('0x1f')]=_0x130156[_0xa0ea('0x1f')];this[_0xa0ea('0x20')]=_0x130156['campaigns'];this['agents']=_0x130156[_0xa0ea('0x21')];this[_0xa0ea('0x22')]=_0x130156[_0xa0ea('0x22')];this[_0xa0ea('0x23')]=config[_0xa0ea('0x23')]||0x2;this[_0xa0ea('0x24')]={};this[_0xa0ea('0x25')]={};this['contactsId']={};this[_0xa0ea('0x26')]={};this[_0xa0ea('0x27')]={};this[_0xa0ea('0x28')]={};this['startProgressive']={};this[_0xa0ea('0x29')]={};this[_0xa0ea('0x2a')]={};this[_0xa0ea('0x2b')]={};ami['on'](_0xa0ea('0x2c'),this[_0xa0ea('0x2d')][_0xa0ea('0x2e')](this));ami['on']('queuecallerabandon',this[_0xa0ea('0x2f')]['bind'](this));ami['on']('originateresponse',this[_0xa0ea('0x30')][_0xa0ea('0x2e')](this));ami['on'](_0xa0ea('0x31'),this['syncAgentComplete'][_0xa0ea('0x2e')](this));ami['on']('custom:queuesummary',this[_0xa0ea('0x32')][_0xa0ea('0x2e')](this));ami['on'](_0xa0ea('0x33'),this[_0xa0ea('0x34')][_0xa0ea('0x2e')](this));ami['on'](_0xa0ea('0x35'),this[_0xa0ea('0x36')][_0xa0ea('0x2e')](this));ami['on'](_0xa0ea('0x37'),this[_0xa0ea('0x38')]['bind'](this));ami['on'](_0xa0ea('0x39'),this['syncQueueMember'][_0xa0ea('0x2e')](this));ami['on'](_0xa0ea('0x3a'),this[_0xa0ea('0x3b')][_0xa0ea('0x2e')](this));this[_0xa0ea('0x3c')]();this[_0xa0ea('0x3d')]();}function isNotNull(_0x4e9748){return _0x4e9748!==null&&!_[_0xa0ea('0x3e')](_0x4e9748);}function checkIsLoggedIn(_0x5903ff,_0x210ce3){return function(){if(_0x210ce3<=0x0){_0x5903ff['message']=_0xa0ea('0x3f');throw _0x5903ff[_0xa0ea('0x40')]+_0xa0ea('0x41');}};}function isActive(_0x497142){return _0x497142;}function checkIsActive(_0x15f839,_0x37a5b3){return function(){if(!isActive(_0x37a5b3)){_0x15f839['message']=_0xa0ea('0x42');throw _0x15f839[_0xa0ea('0x40')]+_0xa0ea('0x43');}};}function checkInterval(_0x4e8975){return function(){if(!isNotNull(_0x4e8975['Interval'])){_0x4e8975[_0xa0ea('0x44')]=_0xa0ea('0x45');throw _0x4e8975[_0xa0ea('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4e8975[_0xa0ea('0x46')][_0xa0ea('0x47')])){_0x4e8975[_0xa0ea('0x44')]=_0xa0ea('0x45');throw _0x4e8975[_0xa0ea('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x4e8975[_0xa0ea('0x46')]['Intervals']))){_0x4e8975[_0xa0ea('0x44')]=_0xa0ea('0x45');throw _0x4e8975[_0xa0ea('0x40')]+_0xa0ea('0x48');}};}function msgResponse(_0x628464,_0x4bc386,_0x1d2664){return{'action':_0x628464,'response':_0x4bc386,'message':_0x1d2664,'stack':_0x1d2664};}function myreject(_0x39bad8){return function(_0x430388){return _0x39bad8(msgResponse(_0xa0ea('0x49'),_0xa0ea('0x4a'),JSON[_0xa0ea('0x4b')](_0x430388)));};}function getSeconds(_0x2cdb36,_0x1813c4){var _0x43faa3=moment(_0x2cdb36)[_0xa0ea('0x4c')](0x0);var _0x5ef5b1=moment(_0x1813c4)[_0xa0ea('0x4c')](0x0);return _0x43faa3['diff'](_0x5ef5b1,_0xa0ea('0x4d'));}function emit(_0x5ad92c,_0x461655,_0x5b8159){io['to'](_0x5ad92c)[_0xa0ea('0x4e')](_0x461655,_0x5b8159);}function emitVoiceQueueSummary(_0x2a6aff){if(_0x2a6aff[_0xa0ea('0x4f')]===_0xa0ea('0x50')){var _0x4b6d57={'id':_0x2a6aff['id'],'name':_0x2a6aff[_0xa0ea('0x40')],'strategy':_0x2a6aff[_0xa0ea('0x51')],'answered':_0x2a6aff[_0xa0ea('0x52')],'available':_0x2a6aff[_0xa0ea('0x53')],'loggedIn':_0x2a6aff[_0xa0ea('0x54')],'pTalking':_0x2a6aff[_0xa0ea('0x55')],'sumBillable':_0x2a6aff[_0xa0ea('0x56')],'sumDuration':_0x2a6aff[_0xa0ea('0x57')],'sumHoldTime':_0x2a6aff[_0xa0ea('0x58')]||0x0,'talking':_0x2a6aff['talking'],'total':_0x2a6aff[_0xa0ea('0x59')],'type':_0x2a6aff['type'],'unmanaged':_0x2a6aff[_0xa0ea('0x5a')],'abandoned':_0x2a6aff[_0xa0ea('0x5b')],'waiting':_0x2a6aff[_0xa0ea('0x5c')],'loggedInDb':_0x2a6aff[_0xa0ea('0x5d')],'dialActive':_0x2a6aff[_0xa0ea('0x5e')],'dialMethod':_0x2a6aff[_0xa0ea('0x5f')],'dialOriginateCallerIdName':_0x2a6aff[_0xa0ea('0x60')],'dialOriginateCallerIdNumber':_0x2a6aff[_0xa0ea('0x61')],'dialOriginateTimeout':_0x2a6aff[_0xa0ea('0x62')],'dialPrefix':_0x2a6aff[_0xa0ea('0x63')],'outboundAnswerAgiCallsDay':_0x2a6aff[_0xa0ea('0x64')],'outboundAnswerCallsDay':_0x2a6aff[_0xa0ea('0x65')],'outboundBlacklistCallsDay':_0x2a6aff[_0xa0ea('0x66')],'outboundBusyCallsDay':_0x2a6aff[_0xa0ea('0x67')],'outboundCongestionCallsDay':_0x2a6aff[_0xa0ea('0x68')],'outboundDropCallsDayACS':_0x2a6aff['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2a6aff[_0xa0ea('0x69')],'outboundDropCallsDayTimeout':_0x2a6aff['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2a6aff[_0xa0ea('0x6a')],'outboundNoSuchCallsDay':_0x2a6aff['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2a6aff['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2a6aff['outboundReCallsDay'],'outboundRejectCallsDay':_0x2a6aff['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2a6aff[_0xa0ea('0x6b')],'predictiveIntervalAnsweredCalls':_0x2a6aff[_0xa0ea('0x6c')],'predictiveIntervalAvgHoldtime':_0x2a6aff['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2a6aff[_0xa0ea('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x2a6aff[_0xa0ea('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x2a6aff[_0xa0ea('0x6f')],'predictiveIntervalErlangCalls':_0x2a6aff['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x2a6aff['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2a6aff['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2a6aff[_0xa0ea('0x70')],'predictiveIntervalPauses':_0x2a6aff[_0xa0ea('0x71')],'predictiveIntervalAvailable':_0x2a6aff[_0xa0ea('0x72')],'predictiveIntervalTotalCalls':_0x2a6aff[_0xa0ea('0x73')],'message':_0x2a6aff[_0xa0ea('0x44')],'originated':_0x2a6aff[_0xa0ea('0x74')],'erlangCalls':_0x2a6aff[_0xa0ea('0x75')],'erlangCallToSecond':_0x2a6aff[_0xa0ea('0x76')],'erlangAbandonmentRate':_0x2a6aff[_0xa0ea('0x77')],'erlangBusyFactor':_0x2a6aff[_0xa0ea('0x78')],'startPredictive':_0x2a6aff[_0xa0ea('0x28')],'startProgressive':_0x2a6aff[_0xa0ea('0x79')]};if(_0x2a6aff['Trunk']){_0x4b6d57[_0xa0ea('0x7a')]={'id':_0x2a6aff[_0xa0ea('0x7a')]['id'],'name':_0x2a6aff[_0xa0ea('0x7a')][_0xa0ea('0x40')],'active':_0x2a6aff['Trunk']['active'],'callerid':_0x2a6aff[_0xa0ea('0x7a')][_0xa0ea('0x7b')]};}if(_0x2a6aff[_0xa0ea('0x46')]){_0x4b6d57[_0xa0ea('0x46')]={'id':_0x2a6aff[_0xa0ea('0x46')]['id'],'name':_0x2a6aff[_0xa0ea('0x46')][_0xa0ea('0x40')]};}var _0x361210=md5(JSON[_0xa0ea('0x4b')](_0x4b6d57));if(_0x2a6aff[_0xa0ea('0x3')]!==_0x361210){_0x2a6aff['md5']=_0x361210;emit(util[_0xa0ea('0x7c')](_0xa0ea('0x7d'),_0x4b6d57[_0xa0ea('0x40')]),_0xa0ea('0x7e'),_0x4b6d57);}}}function emitCampaignSummary(_0x1f5cc7){if(_0x1f5cc7[_0xa0ea('0x4f')]===_0xa0ea('0x7f')){emit(util['format'](_0xa0ea('0x80'),_0x1f5cc7[_0xa0ea('0x40')]),'campaign:save',_0x1f5cc7);}}function checkGetDataPredictive(_0x1e4113){if(isNotNull(_0x1e4113)&&!_['isEmpty'](_0x1e4113)){loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x82'));loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x83'),_0x1e4113[_0xa0ea('0x73')]);loggerPredictive['info'](_0xa0ea('0x84'),_0x1e4113['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa0ea('0x81')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4113[_0xa0ea('0x6f')]);loggerPredictive[_0xa0ea('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4113[_0xa0ea('0x6e')]);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x85'),_0x1e4113['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xa0ea('0x81')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4113[_0xa0ea('0x6d')]);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x86'));if(_0x1e4113[_0xa0ea('0x73')]>0x0){if(!_[_0xa0ea('0x3e')](_0x1e4113['predictiveIntervalAvgTalktime'])&&_0x1e4113[_0xa0ea('0x6d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xa0ea('0x3e')](_0x1e4113[_0xa0ea('0x87')])&&_0x1e4113[_0xa0ea('0x87')]>0x0){return!![];}loggerPredictive['info'](_0xa0ea('0x88'));}else{loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x89'));}}else{loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x8a'));}return![];}function mergeDataErlangB(_0xf4bf41){return function(_0x163c69){loggerPredictive[_0xa0ea('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x8b'),_0x163c69[_0xa0ea('0x75')]);loggerPredictive['info'](_0xa0ea('0x8c'),_0x163c69['erlangCallToSecond']);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x8d'),_0x163c69[_0xa0ea('0x77')]);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x8e'),_0x163c69['erlangBusyFactor']);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x8d'),_0x163c69[_0xa0ea('0x77')]);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x86'));_[_0xa0ea('0x8f')](_0xf4bf41,_0x163c69);};}function getDiff(_0x4d2ec3){var _0x20b03f=moment()[_0xa0ea('0x4c')](0x0);var _0x3428d0=moment(_0x4d2ec3)['milliseconds'](0x0);return _0x20b03f[_0xa0ea('0x90')](_0x3428d0,_0xa0ea('0x4d'));}function ifInterval(_0x36cf60,_0x1693df){if(_[_0xa0ea('0x3e')](_0x1693df)){return![];}return getDiff(_0x1693df)<_0x36cf60*0x3c;}function freeVariablesPredictive(_0x2f94a5){if(isNotNull(_0x2f94a5)){if(!_[_0xa0ea('0x3e')](_0x2f94a5[_0xa0ea('0x79')])){_0x2f94a5['startProgressive']=undefined;loggerPredictive['info'](_0x2f94a5['name'],_0xa0ea('0x91'));}if(!_['isUndefined'](_0x2f94a5[_0xa0ea('0x28')])){_0x2f94a5[_0xa0ea('0x28')]=undefined;loggerPredictive[_0xa0ea('0x81')](_0x2f94a5[_0xa0ea('0x40')],_0xa0ea('0x92'));}if(!_['isUndefined'](_0x2f94a5[_0xa0ea('0x93')])){clearInterval(_0x2f94a5[_0xa0ea('0x93')]);_0x2f94a5[_0xa0ea('0x93')]=undefined;loggerPredictive[_0xa0ea('0x81')](_0x2f94a5['name'],_0xa0ea('0x94'));}}}function erlangb(_0x17fcdb,_0x4bb97f){if(_0x4bb97f===0x0){return 0x0;}var _0x145630=0x1;for(var _0x557ffb=0x1;_0x557ffb<=_0x4bb97f;_0x557ffb+=0x1){_0x145630=0x1+_0x145630*_0x557ffb/_0x17fcdb;}return 0x1/_0x145630;}function isVoiceQueueOutbound(_0x5f2444){return _0x5f2444===_0xa0ea('0x50');}function isNotPreview(_0x4a6167){return _0x4a6167!==_0xa0ea('0x1e');}function isCampaignIvr(_0x6f5039){return _0x6f5039==='ivr';}function getCallerId(_0xdc05d,_0x1d57e8,_0x27ceab){if(!_[_0xa0ea('0x3e')](_0x27ceab)&&typeof _0x27ceab===_0xa0ea('0x95')&&!_[_0xa0ea('0x96')](_0x27ceab)){if(!_['isUndefined'](_0x1d57e8)&&typeof _0x1d57e8===_0xa0ea('0x95')&&!_[_0xa0ea('0x96')](_0x1d57e8)){return util[_0xa0ea('0x7c')](_0xa0ea('0x97'),_0x1d57e8,_0x27ceab);}return util[_0xa0ea('0x7c')](_0xa0ea('0x97'),_0x27ceab,_0x27ceab);}if(!_['isUndefined'](_0xdc05d)&&typeof _0xdc05d==='string'&&!_[_0xa0ea('0x96')](_0xdc05d)){return _0xdc05d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x294b0,_0x403ce7){return function(_0x454f3d){freeVariablesPredictive(_0x403ce7);emitVoiceQueueSummary(_0x403ce7);emitCampaignSummary(_0x403ce7);loggerSyncQueueSummary[_0xa0ea('0x98')](_0x294b0,util['inspect'](_0x454f3d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x408f7e,_0x3ac7d7){return function(_0x1c1ec5){loggerPredictive[_0xa0ea('0x98')](_0x3ac7d7['name'],_0x408f7e);loggerPredictive[_0xa0ea('0x98')](_0x1c1ec5[_0xa0ea('0x99')]);freeVariablesPredictive(_0x3ac7d7);};}function loggerCatch(_0x7acc0e){return function(_0x43df39){logger[_0xa0ea('0x98')](_0x7acc0e,util[_0xa0ea('0x9a')](_0x43df39,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x265b7d){return _0x265b7d&&!_[_0xa0ea('0x3e')](_0x265b7d)&&_0x265b7d['length']>0x0;}function decremetOriginate(_0xba8c3a){if(!_[_0xa0ea('0x3e')](_0xba8c3a)&&_0xba8c3a!==null){if(typeof _0xba8c3a[_0xa0ea('0x74')]!==_0xa0ea('0x9b')){if(_0xba8c3a[_0xa0ea('0x74')]>0x0){_0xba8c3a[_0xa0ea('0x74')]-=0x1;}else{logger[_0xa0ea('0x98')](_0xa0ea('0x9c'));}}}else{logger[_0xa0ea('0x98')](_0xa0ea('0x9d'));}}function checkContactLowerLimitOriginate(_0x3d7ae3,_0x3999f3,_0x43cd1a){if(_0x3999f3>_0x43cd1a){for(var _0x160e07=0x0;_0x160e07<_0x3999f3-_0x43cd1a;_0x160e07+=0x1){decremetOriginate(_0x3d7ae3);}}}function loggerGetContactDialer(_0x3bc080,_0x5dd65f,_0x25ca11){return function(_0x14e7fd){checkContactLowerLimitOriginate(_0x5dd65f,_0x25ca11,0x0);logger[_0xa0ea('0x98')](_0x3bc080,util['inspect'](_0x14e7fd,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x24ed85){return function(_0x2156f1){if(isNotNull(_0x2156f1)&&isNotNull(_0x2156f1[0x0])){if(_0x2156f1[0x0]['contactsRescheduled']>0x0){_0x24ed85['message']=_0xa0ea('0x9e');logger[_0xa0ea('0x81')](_0xa0ea('0x9f')+_0x24ed85[_0xa0ea('0x40')],_0x2156f1[0x0]['contactsRescheduled'],_0xa0ea('0xa0'));}else{_0x24ed85[_0xa0ea('0x44')]=_0xa0ea('0xa1');logger['info']('[getContactDialer2][Empty]'+_0x24ed85['name']);}}};}function notSendMessagesQueue(_0x52d210){if(_0x52d210[_0xa0ea('0xa2')]){freeVariablesPredictive(_0x52d210);if(_0x52d210[_0xa0ea('0x74')]===0x0&&_0x52d210[_0xa0ea('0xa3')]===0x0&&_0x52d210[_0xa0ea('0x5c')]===0x0&&(_0x52d210[_0xa0ea('0x55')]||0x0)===0x0){_0x52d210[_0xa0ea('0xa2')]=![];_0x52d210[_0xa0ea('0x53')]=0x0;_0x52d210['message']=_0xa0ea('0x42');loggerSyncQueueSummary[_0xa0ea('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x52d210[_0xa0ea('0x40')],_0xa0ea('0xa4'));}else{_0x52d210[_0xa0ea('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa0ea('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x52d210[_0xa0ea('0x40')],_0xa0ea('0xa5'));}emitVoiceQueueSummary(_0x52d210);}}function notSendMessagesCampaign(_0x3808e9){if(_0x3808e9['sendMessageOneNotActive']){if(_0x3808e9['originated']===0x0){_0x3808e9[_0xa0ea('0xa2')]=![];_0x3808e9['message']=_0xa0ea('0x42');loggerSyncQueueSummary[_0xa0ea('0x98')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3808e9[_0xa0ea('0x40')],'is\x20not\x20active');}else{_0x3808e9[_0xa0ea('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa0ea('0x98')](_0xa0ea('0xa6'),_0x3808e9[_0xa0ea('0x40')],'is\x20disactive');}emitCampaignSummary(_0x3808e9);}}function createObjHistory(_0x4b91f9,_0x28b7b8,_0x194ab9,_0x1970a0,_0xa68044){_0x4b91f9[_0xa0ea('0x44')]=_0x194ab9;var _0x22756c=new Action(_0x4b91f9,_0x28b7b8);var _0x9bd54f=new History(_0x22756c);_0x9bd54f[_0xa0ea('0xa7')]=_0x1970a0;_0x9bd54f[_0xa0ea('0xa8')]=_0xa68044;_0x9bd54f[_0xa0ea('0xa9')]=_0x22756c['starttime'];return _0x9bd54f;}Dialer[_0xa0ea('0x19')][_0xa0ea('0x3d')]=function(){var _0xd169f9=this;setInterval(function(){_0xd169f9['clearZombieChannels'](_0xd169f9[_0xa0ea('0x26')],'[uniqueid]');_0xd169f9['clearZombieChannels'](_0xd169f9[_0xa0ea('0x25')],_0xa0ea('0xaa'));},0x32c8);};Dialer[_0xa0ea('0x19')][_0xa0ea('0xab')]=function(_0x4a6d66,_0x45c8a0){var _0x46a2b8=this;for(var _0x23c77b in _0x4a6d66){if(typeof _0x4a6d66[_0x23c77b]!==_0xa0ea('0x9b')){this[_0xa0ea('0x1d')][_0xa0ea('0x1a')](function(){if(!_[_0xa0ea('0xac')](_0x4a6d66[_0x23c77b])){return ami['Action']({'action':'status','channel':_0x4a6d66[_0x23c77b]['channel']})[_0xa0ea('0xad')](function(_0x4831e0){if(_0x4831e0[_0xa0ea('0x44')]===_0xa0ea('0xae')){setTimeout(function(){if(_0x4a6d66[_0x23c77b]&&_0x4a6d66[_0x23c77b][_0xa0ea('0x4f')]!=='ivr'){_0x46a2b8[_0xa0ea('0xaf')](_0x46a2b8[_0xa0ea('0x1f')][_0x4a6d66[_0x23c77b][_0xa0ea('0xb0')]]);logger[_0xa0ea('0x98')](_0xa0ea('0xb1'),_0x45c8a0,_0x23c77b,_0x4a6d66[_0x23c77b][_0xa0ea('0xb0')]);delete _0x4a6d66[_0x23c77b];}if(_0x4a6d66[_0x23c77b]&&_0x4a6d66[_0x23c77b][_0xa0ea('0x4f')]===_0xa0ea('0x7f')){_0x46a2b8[_0xa0ea('0xaf')](_0x46a2b8[_0xa0ea('0x20')][_0x4a6d66[_0x23c77b][_0xa0ea('0xb0')]]);logger[_0xa0ea('0x98')]('[Dialer][checkChannel][ivr]',_0x45c8a0,_0x23c77b,_0x4a6d66[_0x23c77b][_0xa0ea('0xb0')]);delete _0x4a6d66[_0x23c77b];}},0x2328);}});}});}}};Dialer[_0xa0ea('0x19')][_0xa0ea('0xb2')]=function(_0x1dfd64){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopper[_0xa0ea('0xb2')](_0x1dfd64))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xb5')));};Dialer[_0xa0ea('0x19')]['checkIsBlackList']=function(_0x3769ae){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopperBlack['checkIsBlackList'](_0x3769ae))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xb6')));};Dialer[_0xa0ea('0x19')]['checkIsBlackListIvr']=function(_0x14b90f){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopperBlack[_0xa0ea('0xb7')](_0x14b90f))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xb8')));};Dialer['prototype'][_0xa0ea('0xb9')]=function(_0x4bdda1){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopperHistory[_0xa0ea('0xba')](_0x4bdda1))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xbb')));};Dialer[_0xa0ea('0x19')]['rescheduleContact']=function(_0x132c4a){return BPromise['resolve']()['then'](cmHopper[_0xa0ea('0xbc')](_0x132c4a))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xbd')));};Dialer['prototype'][_0xa0ea('0xbe')]=function(_0x16ebac,_0x4a0956,_0x2165ec){return BPromise['resolve']()[_0xa0ea('0xb4')](cmHopper[_0xa0ea('0xbe')](_0x16ebac,_0x4a0956,_0x2165ec))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xbf')));};Dialer[_0xa0ea('0x19')][_0xa0ea('0xc0')]=function(_0x120ad1,_0x2e930d,_0x4c4b6e,_0x20402d,_0x507bdc){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopper[_0xa0ea('0xc0')](_0x120ad1,_0x2e930d,_0x4c4b6e,_0x20402d))['catch'](function(_0x505059){_0x507bdc[_0xa0ea('0xc1')]-=_0x4c4b6e;_0x507bdc[_0xa0ea('0xc1')]=_0x507bdc[_0xa0ea('0xc1')]>0x0?_0x507bdc[_0xa0ea('0xc1')]:0x0;loggerCatch(_0xa0ea('0xc2'))(_0x505059);});};Dialer[_0xa0ea('0x19')][_0xa0ea('0xc3')]=function(_0x2c523b,_0x362a72,_0x3ea039,_0x2cc50b){return BPromise['resolve']()[_0xa0ea('0xb4')](cmHopper[_0xa0ea('0xc3')](_0x2c523b,_0x362a72,_0x3ea039))[_0xa0ea('0xad')](function(_0xdf7c56){_0x2cc50b['temp']-=_0x362a72;_0x2cc50b[_0xa0ea('0xc1')]=_0x2cc50b[_0xa0ea('0xc1')]>0x0?_0x2cc50b['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xdf7c56);});};Dialer[_0xa0ea('0x19')][_0xa0ea('0xc4')]=function(_0x464fcd){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](voiceQueueRt['getVoiceQueueRtPauses'](_0x464fcd))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xc5')));};Dialer[_0xa0ea('0x19')][_0xa0ea('0xc6')]=function(_0x9d359b){return BPromise[_0xa0ea('0xb3')]()['then'](cmHopper[_0xa0ea('0xc6')](_0x9d359b))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xc7')));};Dialer[_0xa0ea('0x19')][_0xa0ea('0xc8')]=function(_0x1ba484){return BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](cmHopperHistory[_0xa0ea('0xc8')](_0x1ba484))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xc9')));};Dialer[_0xa0ea('0x19')][_0xa0ea('0xaf')]=function(_0x5a2490){if(!_[_0xa0ea('0x3e')](_0x5a2490)&&_0x5a2490!==null){if(typeof _0x5a2490[_0xa0ea('0x74')]!==_0xa0ea('0x9b')){if(_0x5a2490[_0xa0ea('0x74')]>0x0){_0x5a2490['originated']-=0x1;}else{logger[_0xa0ea('0x98')](_0xa0ea('0xca'));}}}else{logger[_0xa0ea('0x98')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xa0ea('0xcb')]=function(_0x424891,_0x4c29eb){var _0x2d4bd4=this;return function(_0x1e9fe1){_0x2d4bd4['updateOriginated'](_0x4c29eb);logger[_0xa0ea('0x98')](_0x424891,util[_0xa0ea('0x9a')](_0x1e9fe1,{'showHidden':![],'depth':null}));};};Dialer[_0xa0ea('0x19')]['emptyContact']=function(_0x52278f,_0x217c4e,_0x268e8e){var _0xc4c796={'state':0x19,'statedesc':_0xa0ea('0xcc')};this['updateOriginated'](_0x217c4e);this[_0xa0ea('0xcd')](_[_0xa0ea('0x8f')](_0xc4c796,_[_0xa0ea('0xce')](_0x268e8e,[_0xa0ea('0xcf'),'ListId',_0xa0ea('0xd0'),_0xa0ea('0xd1'),_0xa0ea('0xd2')])),_0xa0ea('0xd3'),'[emptyContact]');logger[_0xa0ea('0x98')](_0x52278f);};Dialer['prototype'][_0xa0ea('0xd4')]=function(_0x472b5c){return _0x472b5c===_0xa0ea('0xd5');};Dialer[_0xa0ea('0x19')]['isTrunkReachable']=function(_0x4a6cea){return!_[_0xa0ea('0x3e')](_0x4a6cea)&&_0x4a6cea&&!_[_0xa0ea('0x3e')](_0x4a6cea[_0xa0ea('0x40')])&&!_[_0xa0ea('0x3e')](_0x4a6cea[_0xa0ea('0xd6')])&&_0x4a6cea[_0xa0ea('0xd6')]&&(this[_0xa0ea('0x22')][util['format'](_0xa0ea('0xd7'),_0x4a6cea[_0xa0ea('0x40')])][_0xa0ea('0xd8')]===_0xa0ea('0xd9')||this['trunks'][util['format'](_0xa0ea('0xd7'),_0x4a6cea['name'])][_0xa0ea('0xd8')]===_0xa0ea('0xda'));};Dialer[_0xa0ea('0x19')][_0xa0ea('0xcd')]=function(_0x13b7a4,_0x2d81fe,_0x344b5f){this[_0xa0ea('0xc8')](_0x13b7a4)[_0xa0ea('0xad')](loggerCatch(_0x2d81fe));this[_0xa0ea('0xc6')](_0x13b7a4)['catch'](loggerCatch(_0x344b5f));};Dialer[_0xa0ea('0x19')][_0xa0ea('0x38')]=function(_0x40a6b7){var _0x1ece57=this[_0xa0ea('0x26')][_0x40a6b7['uniqueid']];var _0x5197cb;if(!_['isNil'](_0x40a6b7)&&!_[_0xa0ea('0xac')](_0x40a6b7[_0xa0ea('0xdb')])&&!_[_0xa0ea('0xac')](_0x40a6b7[_0xa0ea('0xdb')][_0xa0ea('0xdc')])&&_0x40a6b7['exten']===_0xa0ea('0xdd')&&_0x1ece57){if(_0x1ece57[_0xa0ea('0x4f')]!==_0xa0ea('0x7f')&&this['voiceQueues'][_0x1ece57[_0xa0ea('0xb0')]]['dialAMDActive']&&_0x40a6b7[_0xa0ea('0xde')]===_0xa0ea('0xdf')){delete this[_0xa0ea('0x26')][_0x40a6b7['uniqueid']];this['updateOriginated'](this[_0xa0ea('0x1f')][_0x1ece57['queue']]);this[_0xa0ea('0x1f')][_0x1ece57[_0xa0ea('0xb0')]][_0xa0ea('0x65')]+=0x1;this[_0xa0ea('0x1f')][_0x1ece57[_0xa0ea('0xb0')]][_0xa0ea('0x64')]+=0x1;_0x5197cb=new Hangup(_0x1ece57,_0x40a6b7);_0x5197cb[_0xa0ea('0xa7')]=0x12;_0x5197cb[_0xa0ea('0xa8')]=_0xa0ea('0xe0');_0x5197cb[_0xa0ea('0xe1')]=_0xa0ea('0xe2');ami[_0xa0ea('0x4e')](_0xa0ea('0xe3'),ut[_0xa0ea('0xe4')](_0x5197cb,_0xa0ea('0xe5')));this[_0xa0ea('0xcd')](_0x5197cb,_0xa0ea('0xe6'),'[syncHangupInAMD]');}if(_0x1ece57[_0xa0ea('0x4f')]!==_0xa0ea('0x7f')&&this[_0xa0ea('0x1f')][_0x1ece57['queue']][_0xa0ea('0xe7')]&&_0x40a6b7[_0xa0ea('0xde')]===_0xa0ea('0xe8')){var _0x27eae5=this;return new BPromise(function(_0x15feb7,_0x2f4496){delete _0x27eae5[_0xa0ea('0x26')][_0x40a6b7[_0xa0ea('0xe9')]];_0x27eae5[_0xa0ea('0xaf')](_0x27eae5[_0xa0ea('0x1f')][_0x1ece57[_0xa0ea('0xb0')]]);_0x27eae5[_0xa0ea('0x1f')][_0x1ece57['queue']][_0xa0ea('0x65')]+=0x1;_0x27eae5[_0xa0ea('0x1f')][_0x1ece57[_0xa0ea('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3dd477=_0x27eae5[_0xa0ea('0x1f')][_0x1ece57['queue']];var _0x3ea6fd=new Hangup(_0x1ece57,_0x40a6b7);_0x3ea6fd[_0xa0ea('0xa7')]=0x13;_0x3ea6fd[_0xa0ea('0xa8')]='Machine';_0x3ea6fd[_0xa0ea('0xe1')]='AMD';_0x3ea6fd['countmachineretry']+=0x1;_0x3ea6fd['countglobal']+=0x1;_0x3ea6fd[_0xa0ea('0xe5')]=!![];ami['emit'](_0xa0ea('0xe3'),ut['buildObj'](_0x3ea6fd,_0xa0ea('0xe5')));_0x27eae5[_0xa0ea('0xc8')](_0x3ea6fd)['catch'](loggerCatch(_0xa0ea('0xea')));if(_0x3ea6fd[_0xa0ea('0xeb')]+_0x3ea6fd[_0xa0ea('0xec')]+_0x3ea6fd['countnoanswerretry']+_0x3ea6fd[_0xa0ea('0xed')]+_0x3ea6fd[_0xa0ea('0xee')]+_0x3ea6fd['countabandonedretry']+_0x3ea6fd[_0xa0ea('0xef')]+_0x3ea6fd['countagentrejectretry']>=_0x3dd477['dialGlobalMaxRetry']){_0x27eae5[_0xa0ea('0xf0')](_0x3ea6fd,_0x15feb7,_0x2f4496,_0xa0ea('0xf1'));}else{if(_0x3ea6fd['countmachineretry']>=_0x3dd477[_0xa0ea('0xf2')]){_0x27eae5[_0xa0ea('0xf3')](_0x3ea6fd,_0x15feb7,_0x2f4496,_0xa0ea('0xf4'));}else{_0x27eae5[_0xa0ea('0xbc')]({'active':![],'countmachineretry':_0x3ea6fd['countmachineretry'],'scheduledat':moment()[_0xa0ea('0xf5')](_0x3dd477[_0xa0ea('0xf6')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ea6fd[_0xa0ea('0xcf')],'ListId':_0x3ea6fd[_0xa0ea('0xf7')],'VoiceQueueId':_0x3ea6fd[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x3ea6fd[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xf8')));_0x15feb7({'reschedule':0x1});}}});}if(_0x1ece57['type']===_0xa0ea('0x7f')&&this[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]]['dialAMDActive']&&_0x40a6b7[_0xa0ea('0xde')]==='HANGUP'){delete this['uniqueId'][_0x40a6b7[_0xa0ea('0xe9')]];this[_0xa0ea('0xaf')](this[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]]);_0x5197cb=new Hangup(_0x1ece57,_0x40a6b7);_0x5197cb['state']=0x12;_0x5197cb[_0xa0ea('0xa8')]=_0xa0ea('0xe0');_0x5197cb[_0xa0ea('0xe1')]=_0xa0ea('0xe2');ami['emit'](_0xa0ea('0xe3'),ut[_0xa0ea('0xe4')](_0x5197cb,'amd'));this['saveInDb'](_0x5197cb,_0xa0ea('0xf9'),_0xa0ea('0xfa'));}if(_0x1ece57['type']==='ivr'&&this[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]][_0xa0ea('0xe7')]&&_0x40a6b7[_0xa0ea('0xde')]===_0xa0ea('0xe8')){var _0x27eae5=this;return new BPromise(function(_0x39e4ad,_0x2f2522){delete _0x27eae5[_0xa0ea('0x26')][_0x40a6b7[_0xa0ea('0xe9')]];_0x27eae5[_0xa0ea('0xaf')](_0x27eae5[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]]);_0x27eae5[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x27eae5[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]][_0xa0ea('0x64')]+=0x1;var _0x2ca1dd=_0x27eae5[_0xa0ea('0x20')][_0x1ece57[_0xa0ea('0xb0')]];var _0x2fd538=new Hangup(_0x1ece57,_0x40a6b7);_0x2fd538[_0xa0ea('0xa7')]=0x13;_0x2fd538[_0xa0ea('0xa8')]=_0xa0ea('0xfb');_0x2fd538['membername']=_0xa0ea('0xe2');_0x2fd538[_0xa0ea('0xef')]+=0x1;_0x2fd538[_0xa0ea('0xfc')]+=0x1;_0x2fd538[_0xa0ea('0xe5')]=!![];ami['emit'](_0xa0ea('0xe3'),ut['buildObj'](_0x2fd538,_0xa0ea('0xe5')));_0x27eae5[_0xa0ea('0xc8')](_0x2fd538)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xea')));if(_0x2fd538['countbusyretry']+_0x2fd538[_0xa0ea('0xec')]+_0x2fd538[_0xa0ea('0xfd')]+_0x2fd538['countnosuchnumberretry']+_0x2fd538[_0xa0ea('0xee')]+_0x2fd538[_0xa0ea('0xfe')]+_0x2fd538[_0xa0ea('0xef')]+_0x2fd538[_0xa0ea('0xff')]>=_0x2ca1dd[_0xa0ea('0x100')]){_0x27eae5['stateGlobal'](_0x2fd538,_0x39e4ad,_0x2f2522,_0xa0ea('0xf1'));}else{if(_0x2fd538['countmachineretry']>=_0x2ca1dd[_0xa0ea('0xf2')]){_0x27eae5[_0xa0ea('0xf3')](_0x2fd538,_0x39e4ad,_0x2f2522,_0xa0ea('0xf4'));}else{_0x27eae5['rescheduleContact']({'active':![],'countmachineretry':_0x2fd538[_0xa0ea('0xef')],'scheduledat':moment()['add'](_0x2ca1dd[_0xa0ea('0xf6')],_0xa0ea('0x101'))['format'](_0xa0ea('0x102')),'ContactId':_0x2fd538[_0xa0ea('0xcf')],'ListId':_0x2fd538['ListId'],'VoiceQueueId':_0x2fd538['VoiceQueueId']||undefined,'CampaignId':_0x2fd538[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xf8')));_0x39e4ad({'reschedule':0x1});}}});}}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x34')]=function(_0xd3e62b){var _0x3982f2=this[_0xa0ea('0x26')][_0xd3e62b[_0xa0ea('0xe9')]];var _0x24ea6a=this;var _0x2108d9;if(_0x3982f2&&_0x3982f2[_0xa0ea('0x4f')]===_0xa0ea('0x7f')){delete this[_0xa0ea('0x26')][_0xd3e62b[_0xa0ea('0xe9')]];this[_0xa0ea('0xaf')](this['campaigns'][_0x3982f2['queue']]);this[_0xa0ea('0x20')][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x103')]+=0x1;_0x2108d9=new Hangup(_0x3982f2,_0xd3e62b);this['createHistory'](_0x2108d9)['catch'](loggerCatch(_0xa0ea('0x104')));this['moveContactManagedDialer'](_0x2108d9)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x105')));}if(_0x3982f2&&_0x3982f2[_0xa0ea('0x4f')]!==_0xa0ea('0x7f')&&isNotNull(this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x106')])){delete this[_0xa0ea('0x26')][_0xd3e62b[_0xa0ea('0xe9')]];this[_0xa0ea('0xaf')](this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]]);this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x65')]+=0x1;this['voiceQueues'][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x64')]+=0x1;_0x2108d9=new Hangup(_0x3982f2,_0xd3e62b);_0x2108d9['state']=0x10;_0x2108d9[_0xa0ea('0xa8')]=_0xa0ea('0x107');_0x2108d9[_0xa0ea('0xe1')]=_0xa0ea('0x108');this[_0xa0ea('0xc8')](_0x2108d9)[_0xa0ea('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x2108d9)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3982f2&&_0x3982f2[_0xa0ea('0x4f')]!==_0xa0ea('0x7f')&&!isNotNull(this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x106')])){delete this[_0xa0ea('0x26')][_0xd3e62b[_0xa0ea('0xe9')]];this[_0xa0ea('0xaf')](this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]]);this[_0xa0ea('0x1f')][_0x3982f2[_0xa0ea('0xb0')]][_0xa0ea('0x6b')]+=0x1;_0x2108d9=new Hangup(_0x3982f2,_0xd3e62b);_0x2108d9[_0xa0ea('0xa7')]=0xc;_0x2108d9[_0xa0ea('0xa8')]=_0xd3e62b[_0xa0ea('0x109')];_0x2108d9[_0xa0ea('0xe1')]=_0xa0ea('0x10a');this[_0xa0ea('0xc8')](_0x2108d9)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x104')));this['moveContactManagedDialer'](_0x2108d9)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x105')));}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x10b')]=function(_0x31e706){var _0x29f833=this[_0xa0ea('0x26')][_0x31e706['uniqueid']];var _0xb523a4=this;if(this['voiceQueues'][_0x31e706['queue']]){if(_0x29f833&&_0x29f833[_0xa0ea('0x4f')]!==_0xa0ea('0x7f')){delete this[_0xa0ea('0x26')][_0x31e706[_0xa0ea('0xe9')]];this[_0xa0ea('0x1f')][_0x31e706[_0xa0ea('0xb0')]][_0xa0ea('0x65')]+=0x1;var _0x3f474a=new AgentComplete(_0x29f833,_0x31e706);if(_0x31e706[_0xa0ea('0x10c')]===_0xa0ea('0x10d')){_0x3f474a[_0xa0ea('0x10e')]=this[_0xa0ea('0x1f')][_0x31e706[_0xa0ea('0xb0')]][_0xa0ea('0x10f')]&&this['voiceQueues'][_0x31e706[_0xa0ea('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0xa0ea('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xa0ea('0xc8')](_0x3f474a)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x110')));this[_0xa0ea('0xc6')](_0x3f474a)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x111')));}}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x2d')]=function(_0x4a36c7){if(this[_0xa0ea('0x1f')][_0x4a36c7[_0xa0ea('0xb0')]]){if(this[_0xa0ea('0x26')][_0x4a36c7[_0xa0ea('0xe9')]]&&this[_0xa0ea('0x26')][_0x4a36c7[_0xa0ea('0xe9')]][_0xa0ea('0x4f')]!==_0xa0ea('0x7f')){this[_0xa0ea('0xaf')](this[_0xa0ea('0x1f')][_0x4a36c7[_0xa0ea('0xb0')]]);this[_0xa0ea('0x26')][_0x4a36c7['uniqueid']][_0xa0ea('0x112')]=moment()['format'](_0xa0ea('0x102'));}}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x113')]=function(_0x49a3f4){this['createHistory'](_0x49a3f4)['catch'](loggerCatch(_0xa0ea('0x110')));this[_0xa0ea('0xc6')](_0x49a3f4)[_0xa0ea('0xad')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xa0ea('0x19')]['syncQueueCallerAbandon']=function(_0x3071cd){var _0x326758=this[_0xa0ea('0x26')][_0x3071cd[_0xa0ea('0xe9')]];var _0x3eea3c=this;if(this[_0xa0ea('0x1f')][_0x3071cd['queue']]){if(_0x326758&&_0x326758[_0xa0ea('0x4f')]!=='ivr'){delete this[_0xa0ea('0x26')][_0x3071cd['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x3071cd[_0xa0ea('0xb0')]]);_0x326758[_0xa0ea('0x114')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2f9d00=new QueueCallerAbandon(_0x326758,_0x3071cd);if(getSeconds(_0x326758[_0xa0ea('0x114')],_0x326758[_0xa0ea('0x115')])>=_0x326758['dialQueueTimeout']){this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x6f')]+=0x1;this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x116')]+=0x1;this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2f9d00[_0xa0ea('0xa7')]=0xa;_0x2f9d00[_0xa0ea('0xa8')]=_0xa0ea('0x117');_0x2f9d00[_0xa0ea('0x118')]=_0xa0ea('0x119');_0x2f9d00[_0xa0ea('0x10e')]=this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x10f')]?moment()[_0xa0ea('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2f9d00['countdropretry']+=0x1;_0x2f9d00[_0xa0ea('0xfc')]+=0x1;if(_0x2f9d00[_0xa0ea('0xee')]>=this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x11a')]){this['queueCallerAbandonCreateState'](_0x2f9d00);}else{this[_0xa0ea('0xbc')]({'active':![],'countdropretry':_0x2f9d00['countdropretry'],'scheduledat':moment()[_0xa0ea('0xf5')](this['voiceQueues'][_0x3071cd[_0xa0ea('0xb0')]]['dialDropRetryFrequency'],_0xa0ea('0x101'))[_0xa0ea('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x326758[_0xa0ea('0xcf')],'ListId':_0x326758[_0xa0ea('0xf7')],'VoiceQueueId':_0x326758[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x326758[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch('[rescheduleContact][Drop]'));var _0x72bb9a=new History(_0x2f9d00);_0x72bb9a[_0xa0ea('0xa7')]=0xa;_0x72bb9a[_0xa0ea('0xa8')]=_0xa0ea('0x117');_0x72bb9a[_0xa0ea('0x11b')]=moment()['format'](_0xa0ea('0x102'));_0x72bb9a[_0xa0ea('0xa9')]=_0x72bb9a['starttime'];_0x72bb9a[_0xa0ea('0x11c')]=_0x2f9d00['calleridname'];_0x72bb9a[_0xa0ea('0x11d')]=_0x2f9d00[_0xa0ea('0x11d')];this[_0xa0ea('0xc8')](_0x72bb9a)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x11e')));}}else{this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x6e')]+=0x1;this[_0xa0ea('0x1f')][_0x3071cd[_0xa0ea('0xb0')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2f9d00[_0xa0ea('0xa7')]=0xb;_0x2f9d00[_0xa0ea('0xa8')]=_0xa0ea('0x11f');_0x2f9d00[_0xa0ea('0x118')]=_0xa0ea('0x120');_0x2f9d00[_0xa0ea('0xfe')]+=0x1;_0x2f9d00[_0xa0ea('0xfc')]+=0x1;if(_0x2f9d00[_0xa0ea('0xfe')]>=this['voiceQueues'][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x121')]){this[_0xa0ea('0x113')](_0x2f9d00);}else{this[_0xa0ea('0xbc')]({'active':![],'countabandonedretry':_0x2f9d00[_0xa0ea('0xfe')],'scheduledat':moment()[_0xa0ea('0xf5')](this['voiceQueues'][_0x3071cd[_0xa0ea('0xb0')]][_0xa0ea('0x122')],'minutes')[_0xa0ea('0x7c')](_0xa0ea('0x102')),'ContactId':_0x326758[_0xa0ea('0xcf')],'ListId':_0x326758[_0xa0ea('0xf7')],'VoiceQueueId':_0x326758['VoiceQueueId']||undefined,'CampaignId':_0x326758[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x123')));var _0x72bb9a=new History(_0x2f9d00);_0x72bb9a['state']=0xb;_0x72bb9a['statedesc']=_0xa0ea('0x11f');_0x72bb9a[_0xa0ea('0x11b')]=moment()['format'](_0xa0ea('0x102'));_0x72bb9a['endtime']=_0x72bb9a[_0xa0ea('0x11b')];_0x72bb9a[_0xa0ea('0x11c')]=_0x2f9d00['calleridname'];_0x72bb9a[_0xa0ea('0x11d')]=_0x2f9d00[_0xa0ea('0x11d')];this[_0xa0ea('0xc8')](_0x72bb9a)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xa0ea('0x19')]['syncNewExten']=function(_0x1d1aa3){if(this[_0xa0ea('0x25')][_0x1d1aa3['uniqueid']]){this[_0xa0ea('0x25')][_0x1d1aa3['uniqueid']][_0xa0ea('0x124')]=_0x1d1aa3[_0xa0ea('0x124')];}if(this[_0xa0ea('0x26')][_0x1d1aa3[_0xa0ea('0xe9')]]){this['uniqueId'][_0x1d1aa3[_0xa0ea('0xe9')]]['channel']=_0x1d1aa3['channel'];}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x125')]=function(_0x158679){if(strategy[this[_0xa0ea('0x1f')][this[_0xa0ea('0x25')][_0x158679['actionid']][_0xa0ea('0xb0')]][_0xa0ea('0x51')]]===_0xa0ea('0x18')){if(this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]]&&_[_0xa0ea('0xac')](this[_0xa0ea('0x25')][_0x158679['actionid']]['locked'])&&_0x158679[_0xa0ea('0xd8')]==='1'&&_0x158679['paused']==='0'){if(this[_0xa0ea('0x21')][_0x158679[_0xa0ea('0x127')]]){if(!this[_0xa0ea('0x21')][_0x158679['stateinterface']][_0xa0ea('0x128')]){this[_0xa0ea('0x21')][_0x158679[_0xa0ea('0x127')]][_0xa0ea('0x128')]=!![];this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]][_0xa0ea('0x128')]=!![];this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]][_0xa0ea('0x127')]=_0x158679[_0xa0ea('0x127')];}}}}else if((strategy[this[_0xa0ea('0x1f')][this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]][_0xa0ea('0xb0')]][_0xa0ea('0x51')]]||_0xa0ea('0x129'))===_0xa0ea('0x129')){if(this['actions'][_0x158679[_0xa0ea('0x126')]]){if(this[_0xa0ea('0x21')][_0x158679[_0xa0ea('0x127')]]){this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]][_0xa0ea('0x127')]=_0x158679[_0xa0ea('0x127')];if(_[_0xa0ea('0xac')](this[_0xa0ea('0x2a')][this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]]['queue']])){this[_0xa0ea('0x2a')][this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]=[];}this['queueBooked'][this['actions'][_0x158679[_0xa0ea('0x126')]]['queue']][_0xa0ea('0x12a')](_['merge'](_[_0xa0ea('0xce')](this[_0xa0ea('0x25')][_0x158679[_0xa0ea('0x126')]],[_0xa0ea('0x12b'),_0xa0ea('0x127')]),{'status':_0x158679['status'],'paused':_0x158679[_0xa0ea('0x12c')]}));}}}};function unlockQueueStatus(_0x3954a6,_0x2c322a){setTimeout(function(){if(_[_0xa0ea('0x3e')](_0x3954a6[_0xa0ea('0x12d')])){loggerBooked[_0xa0ea('0x98')]('[unlockQueueStatus][undefined]',_0x2c322a);}_0x3954a6[_0xa0ea('0x12d')]=!![];loggerBooked[_0xa0ea('0x81')](_0xa0ea('0x12e'),_0x2c322a,JSON[_0xa0ea('0x4b')](_[_0xa0ea('0xce')](_0x3954a6,[_0xa0ea('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xa0ea('0x19')]['syncQueueStatusComplete']=function(_0x4bbb50){var _0xe6d4d0=this;var _0x3d4950=_0xe6d4d0[_0xa0ea('0x1f')][_0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]];if(strategy[this['voiceQueues'][this['actions'][_0x4bbb50['actionid']]['queue']]['strategy']]===_0xa0ea('0x18')){if(this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]]&&this['actions'][_0x4bbb50['actionid']][_0xa0ea('0x127')]){this[_0xa0ea('0x1e')]['run'](this['actions'][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0x12b')],this['actions'][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0x127')])[_0xa0ea('0xad')](function(_0x55859f){logger[_0xa0ea('0x98')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xa0ea('0x9a')](_0x55859f,{'showHidden':![],'depth':null}));})['finally'](function(){_0xe6d4d0[_0xa0ea('0xaf')](_0xe6d4d0[_0xa0ea('0x1f')][_0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]]['queue']]);_0xe6d4d0[_0xa0ea('0x21')][_0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50['actionid']][_0xa0ea('0x127')]]['locked']=![];delete _0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50['actionid']];unlockQueueStatus(_0x3d4950);});}else{this[_0xa0ea('0xaf')](this[_0xa0ea('0x1f')][this['actions'][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]);this[_0xa0ea('0xbc')]({'active':![],'ContactId':this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xcf')],'ListId':this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xf7')],'VoiceQueueId':this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xd1')]||undefined,'CampaignId':this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]]['CampaignId']||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x12f')));delete this['actions'][_0x4bbb50[_0xa0ea('0x126')]];unlockQueueStatus(_0x3d4950);}}else if((strategy[this[_0xa0ea('0x1f')][this[_0xa0ea('0x25')][_0x4bbb50['actionid']][_0xa0ea('0xb0')]][_0xa0ea('0x51')]]||_0xa0ea('0x129'))===_0xa0ea('0x129')){var _0x5a1552;if(this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]]&&!_[_0xa0ea('0x96')](this[_0xa0ea('0x2a')][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]])){if(this[_0xa0ea('0x2b')][_0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50['actionid']][_0xa0ea('0xb0')]]){this[_0xa0ea('0x2b')][_0xe6d4d0[_0xa0ea('0x25')][_0x4bbb50['actionid']][_0xa0ea('0xb0')]]=this['queueBookedRR'][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]?this[_0xa0ea('0x2b')][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]:this[_0xa0ea('0x2a')][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]?this['queueBooked'][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]['_rr']||0x0:0x0;}this['queueBooked'][this['actions'][_0x4bbb50[_0xa0ea('0x126')]][_0xa0ea('0xb0')]]['_rr']=this[_0xa0ea('0x2b')][this[_0xa0ea('0x25')][_0x4bbb50[_0xa0ea('0x126')]]['queue']];for(var _0x425e5c=0x0;_0x425e5c=0x0;})[_0xa0ea('0xad')](myreject(_0x58252e)));}}else{_0x3920c4[_0xa0ea('0x12a')](ami[_0xa0ea('0x150')]({'action':'command','command':util[_0xa0ea('0x7c')](_0xa0ea('0x151'),_0x59a69c,!_[_0xa0ea('0x3e')](config[_0xa0ea('0x147')][_0x2a3dd2])?_0x2a3dd2:'')})[_0xa0ea('0xb4')](function(_0x570ddf){return _0x570ddf[_0xa0ea('0x14d')]['indexOf'](_0xa0ea('0x14f'))>=0x0;})[_0xa0ea('0xad')](myreject(_0x58252e)));}BPromise[_0xa0ea('0x152')](_0x3920c4)['then'](function(_0x2965cc){var _0x4720b1=_[_0xa0ea('0x153')](_0x2965cc);if(_0x4720b1){return _0x91ff13(_0x4720b1);}else{_0x205e3e[_0xa0ea('0x44')]=_0xa7a5e3?_0xa0ea('0x154'):_0xa0ea('0x155');return _0x58252e(msgResponse(_0xa0ea('0x156'),'Failure','Global:\x20'+_0xa7a5e3+'\x20'+_0x548e45+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa0ea('0x9a')](_0x59a69c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2a3dd2));}})[_0xa0ea('0xad')](function(_0x1af255){return _0x58252e(msgResponse(_0xa0ea('0x143'),_0xa0ea('0x144'),JSON[_0xa0ea('0x4b')](_0x1af255)));});});};Dialer['prototype'][_0xa0ea('0x157')]=function(_0x125b4f){var _0x5a0038=this;return function(){switch(_0x125b4f[_0xa0ea('0x5f')]){case'progressive':freeVariablesPredictive(_0x125b4f);_0x5a0038[_0xa0ea('0x158')](_0x125b4f,0x1);break;case'power':freeVariablesPredictive(_0x125b4f);_0x5a0038[_0xa0ea('0x158')](_0x125b4f,_0x125b4f[_0xa0ea('0x159')]);break;case'predictive':_0x5a0038[_0xa0ea('0x15a')](_0x125b4f);break;case _0xa0ea('0x15b'):freeVariablesPredictive(_0x125b4f);_0x5a0038[_0xa0ea('0x158')](_0x125b4f,0x1);break;default:freeVariablesPredictive(_0x125b4f);logger['error'](_0xa0ea('0x15c'),_0x125b4f['name'],'method\x20not\x20recognized');}};};Dialer[_0xa0ea('0x19')][_0xa0ea('0x15d')]=function(_0x5c3997){var _0x3b5484=this;return function(){_0x3b5484[_0xa0ea('0x15e')](_0x5c3997);};};Dialer[_0xa0ea('0x19')][_0xa0ea('0x32')]=function(_0x59ae1e){var _0x450da7=this;if(isNotPreview(_0x59ae1e[_0xa0ea('0x5f')])){if(isVoiceQueueOutbound(_0x59ae1e[_0xa0ea('0x4f')])&&isActive(_0x59ae1e[_0xa0ea('0x5e')])){_0x59ae1e[_0xa0ea('0xa2')]=!![];BPromise[_0xa0ea('0xb3')]()[_0xa0ea('0xb4')](checkIsLoggedIn(_0x59ae1e,_0x59ae1e['loggedIn']))['then'](checkIsActive(_0x59ae1e,_0x59ae1e['dialActive']))[_0xa0ea('0xb4')](checkInterval(_0x59ae1e))[_0xa0ea('0xb4')](_0x450da7[_0xa0ea('0x13d')](_0x59ae1e))[_0xa0ea('0xb4')](_0x450da7[_0xa0ea('0x141')](_0x59ae1e[_0xa0ea('0x15f')],_0x59ae1e['dialTimezone'],_0x59ae1e[_0xa0ea('0x40')],_0x59ae1e))['then'](_0x450da7[_0xa0ea('0x142')](_0x59ae1e[_0xa0ea('0x46')],_0x59ae1e[_0xa0ea('0x160')],_0x59ae1e[_0xa0ea('0x40')],_0x59ae1e))['then'](_0x450da7[_0xa0ea('0x157')](_0x59ae1e))[_0xa0ea('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x59ae1e));}else{notSendMessagesQueue(_0x59ae1e);}}else{freeVariablesPredictive(_0x59ae1e);}};Dialer[_0xa0ea('0x19')]['syncCampaigns']=function(){var _0x57df17=this;var _0x26b6a2;for(var _0x58dd22 in this[_0xa0ea('0x20')]){if(typeof this[_0xa0ea('0x20')][_0x58dd22]!==_0xa0ea('0x9b')){_0x26b6a2=this['campaigns'][_0x58dd22];if(isCampaignIvr(_0x26b6a2[_0xa0ea('0x4f')])&&isActive(_0x26b6a2[_0xa0ea('0xd6')])){_0x26b6a2[_0xa0ea('0xa2')]=!![];BPromise['resolve']()[_0xa0ea('0xb4')](checkIsActive(_0x26b6a2,_0x26b6a2[_0xa0ea('0xd6')]))[_0xa0ea('0xb4')](checkInterval(_0x26b6a2))['then'](_0x57df17[_0xa0ea('0x13d')](_0x26b6a2))['then'](_0x57df17[_0xa0ea('0x141')](_0x26b6a2[_0xa0ea('0x15f')],_0x26b6a2[_0xa0ea('0x160')],_0x26b6a2[_0xa0ea('0x40')],_0x26b6a2))[_0xa0ea('0xb4')](_0x57df17['checkIfTimeIntervals'](_0x26b6a2[_0xa0ea('0x46')],_0x26b6a2[_0xa0ea('0x160')],_0x26b6a2[_0xa0ea('0x40')],_0x26b6a2))['then'](_0x57df17[_0xa0ea('0x15d')](_0x26b6a2))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x26b6a2));}else{notSendMessagesCampaign(_0x26b6a2);}}}};function getCallerIdRandom(_0x36670d,_0x544c62){var _0x2f191b;var _0x2a091e;var _0x41e132;if(_0x544c62<=0x0){_0x544c62=0x1;}_0x2f191b=new RegExp(_0xa0ea('0x161')+_0x544c62+'}$');_0x2a091e=Math['pow'](0xa,_0x544c62-0x1);_0x41e132=Math['pow'](0xa,_0x544c62)-0x1;return util[_0xa0ea('0x7c')]('%s',_['replace'](_0x36670d,_0x2f191b,_[_0xa0ea('0x162')](_0x2a091e,_0x41e132)));}function extractCalleridName(_0x318d5f){var _0x3ca2a4=_0x318d5f[_0xa0ea('0x163')](/"(.*?)"/);return _0x3ca2a4?_0x3ca2a4[0x1]:_0x318d5f;}function extractCalleridNumber(_0x27341a){var _0x1507d4=_0x27341a[_0xa0ea('0x163')](/<(.*?)>/);return _0x1507d4?_0x1507d4[0x1]:_0x27341a;}Dialer[_0xa0ea('0x19')][_0xa0ea('0x164')]=function(_0x404f6c,_0x5c96f9){var _0x482a33=this;var _0x7ded2c=uuid['v4']();this[_0xa0ea('0x25')][_0x7ded2c]=new Action(_0x404f6c,_0x5c96f9,_0x7ded2c);return new BPromise(function(_0x2006aa,_0x12b183){if(_[_0xa0ea('0x3e')](_0x404f6c)&&typeof _0x404f6c!==_0xa0ea('0x165')){return _0x12b183(msgResponse(_0xa0ea('0x166'),_0xa0ea('0x144'),'voiceQueue\x20is\x20undefine'));}if(_[_0xa0ea('0x3e')](_0x5c96f9[_0xa0ea('0x167')]['phone'])||_0x5c96f9[_0xa0ea('0x167')][_0xa0ea('0x168')]===null){return _0x12b183(msgResponse(_0xa0ea('0x166'),'Failure',_0xa0ea('0x169')));}var _0x5c7aa0={'XMD-CALLERID':_0x482a33['actions'][_0x7ded2c][_0xa0ea('0x16a')](),'XMD-AGI':_0x404f6c['dialQueueProject']?util[_0xa0ea('0x7c')](_0xa0ea('0x16b'),ipAgi,_0x404f6c[_0xa0ea('0x106')]):_0xa0ea('0x16c'),'XMD-AGIAFTER':_0x404f6c['dialQueueProject2']?util[_0xa0ea('0x7c')](_0xa0ea('0x16b'),ipAgi,_0x404f6c[_0xa0ea('0x10f')]):_0xa0ea('0x16c'),'XMD-QUEUE':_0x404f6c[_0xa0ea('0x4f')]==='outbound'?util[_0xa0ea('0x7c')]('\x22%s,%s%s,,,%s\x22',_0x404f6c['name'],_0x404f6c[_0xa0ea('0x16d')]||'',_0x404f6c[_0xa0ea('0x16e')]?'c':'',_0x404f6c[_0xa0ea('0x16f')]||0x3):'NONE','XMD-CONTACTID':_0x5c96f9[_0xa0ea('0xcf')],'XMD-CDRTYPE':_0xa0ea('0x7'),'CALLERID(all)':_0x482a33[_0xa0ea('0x25')][_0x7ded2c][_0xa0ea('0x16a')](),'XMD-AMD':_0x404f6c['dialAMDActive']?_0xa0ea('0x170'):_0xa0ea('0x16c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x404f6c[_0xa0ea('0xe7')]){_0x5c7aa0['XMD-AMDINITIALSILENCE']=_0x404f6c[_0xa0ea('0x171')]||0x9c4;_0x5c7aa0['XMD-AMDGREETING']=_0x404f6c[_0xa0ea('0x172')]||0x5dc;_0x5c7aa0[_0xa0ea('0x173')]=_0x404f6c[_0xa0ea('0x174')]||0x320;_0x5c7aa0[_0xa0ea('0x175')]=_0x404f6c[_0xa0ea('0x176')]||0x1388;_0x5c7aa0['XMD-AMDMINWORDLENGTH']=_0x404f6c[_0xa0ea('0x177')]||0x64;_0x5c7aa0['XMD-AMDBETWEENWORDSSILENCE']=_0x404f6c[_0xa0ea('0x178')]||0x32;_0x5c7aa0['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x404f6c[_0xa0ea('0x179')]||0x3;_0x5c7aa0[_0xa0ea('0x17a')]=_0x404f6c[_0xa0ea('0x17b')]||0x100;_0x5c7aa0[_0xa0ea('0x17c')]=_0x404f6c[_0xa0ea('0x17d')]||0x1388;}if(_0x404f6c['type']==='outbound'){_0x5c7aa0[_0xa0ea('0x17e')]=_0x5c96f9[_0xa0ea('0xd1')];}else{_0x5c7aa0['XMD-CAMPAIGNID']=_0x5c96f9[_0xa0ea('0xd2')];}for(var _0x5bcf58 in _0x5c96f9[_0xa0ea('0x167')]){if(typeof _0x5c96f9[_0xa0ea('0x167')][_0x5bcf58]!=='undefined'){if(isNotNull(_0x5c96f9[_0xa0ea('0x167')][_0x5bcf58])&&_0x5bcf58!=='id'&&_0x5bcf58!=='tags'&&_0x5bcf58!==_0xa0ea('0x17f')&&_0x5bcf58!==_0xa0ea('0x180')){_0x5c7aa0[util[_0xa0ea('0x7c')]('%s%s',_0xa0ea('0x181'),_[_0xa0ea('0x182')](_0x5bcf58))]=_0x5c96f9[_0xa0ea('0x167')][_0x5bcf58];}}}var _0xc69271=_0x482a33[_0xa0ea('0x13e')](_0x404f6c[_0xa0ea('0x7a')])?getCallerId(_0x404f6c[_0xa0ea('0x7a')][_0xa0ea('0x7b')],_0x404f6c[_0xa0ea('0x60')],_0x404f6c[_0xa0ea('0x183')]>0x0?getCallerIdRandom(_0x404f6c[_0xa0ea('0x61')],_0x404f6c[_0xa0ea('0x183')]):_0x404f6c[_0xa0ea('0x61')]):getCallerId(_[_0xa0ea('0xac')](_0x404f6c[_0xa0ea('0x13f')])?_0x404f6c['Trunk'][_0xa0ea('0x7b')]:_0x404f6c['TrunkBackup'][_0xa0ea('0x7b')],_0x404f6c[_0xa0ea('0x60')],_0x404f6c[_0xa0ea('0x183')]>0x0?getCallerIdRandom(_0x404f6c['dialOriginateCallerIdNumber'],_0x404f6c['dialRandomLastDigitCallerIdNumber']):_0x404f6c[_0xa0ea('0x61')]);if(_0xc69271){_0x5c7aa0[_0xa0ea('0x184')]=_0x482a33['actions'][_0x7ded2c]['originatecalleridname']=extractCalleridName(_0xc69271);_0x5c7aa0[_0xa0ea('0x185')]=_0x482a33[_0xa0ea('0x25')][_0x7ded2c][_0xa0ea('0x186')]=extractCalleridNumber(_0xc69271);}return ami[_0xa0ea('0x150')]({'actionid':_0x7ded2c,'action':_0xa0ea('0x166'),'channel':_0x482a33[_0xa0ea('0x13e')](_0x404f6c[_0xa0ea('0x7a')])?util[_0xa0ea('0x7c')]('SIP/%s/%s%s',_0x404f6c[_0xa0ea('0x7a')]['name'],isNotNull(_0x404f6c[_0xa0ea('0x63')])?_0x404f6c[_0xa0ea('0x63')][_0xa0ea('0x187')]()||'':'',_0x404f6c[_0xa0ea('0x188')]>0x0?_0x5c96f9[_0xa0ea('0x167')][_0xa0ea('0x168')][_0xa0ea('0x189')](_0x404f6c[_0xa0ea('0x188')]):_0x5c96f9[_0xa0ea('0x167')]['phone']):util[_0xa0ea('0x7c')]('SIP/%s/%s%s',_[_0xa0ea('0xac')](_0x404f6c[_0xa0ea('0x13f')])?_0x404f6c[_0xa0ea('0x7a')][_0xa0ea('0x40')]:_0x404f6c[_0xa0ea('0x13f')][_0xa0ea('0x40')],isNotNull(_0x404f6c[_0xa0ea('0x63')])?_0x404f6c[_0xa0ea('0x63')]['trim']()||'':'',_0x404f6c[_0xa0ea('0x188')]>0x0?_0x5c96f9[_0xa0ea('0x167')][_0xa0ea('0x168')]['substring'](_0x404f6c[_0xa0ea('0x188')]):_0x5c96f9[_0xa0ea('0x167')][_0xa0ea('0x168')]),'callerid':_0xc69271,'Exten':_0xa0ea('0xdd'),'Context':'from-sip','Priority':'1','variable':_0x5c7aa0,'timeout':(_0x404f6c[_0xa0ea('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x7ded2c})[_0xa0ea('0xb4')](function(_0x3657ed){return _0x2006aa(_0x3657ed);})[_0xa0ea('0xad')](function(_0x2a7772){_0x404f6c[_0xa0ea('0x18a')]+=0x1;var _0x3beb94=new History(_0x482a33[_0xa0ea('0x25')][_0x7ded2c]);logger[_0xa0ea('0x98')](util[_0xa0ea('0x7c')]('[originateError]:\x20%s',JSON[_0xa0ea('0x4b')](_0x2a7772)));_0x3beb94[_0xa0ea('0xa7')]=0xe;_0x3beb94[_0xa0ea('0xa8')]=_0xa0ea('0x18b');_0x3beb94[_0xa0ea('0x11b')]=moment()[_0xa0ea('0x7c')](_0xa0ea('0x102'));_0x3beb94[_0xa0ea('0xa9')]=_0x3beb94[_0xa0ea('0x11b')];_0x482a33[_0xa0ea('0xc8')](_0x3beb94)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x18c')));_0x482a33[_0xa0ea('0xc6')](_0x3beb94)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x18c')))[_0xa0ea('0x1c')](function(){delete _0x482a33[_0xa0ea('0x25')][_0x7ded2c];return _0x12b183(msgResponse(_0xa0ea('0x166'),_0xa0ea('0x4a'),'originate\x20action\x20Error'));});});});};Dialer[_0xa0ea('0x19')][_0xa0ea('0x30')]=function(_0x4382f2){var _0x94ed49=this[_0xa0ea('0x25')][_0x4382f2[_0xa0ea('0x126')]];if(_0x94ed49){delete this[_0xa0ea('0x25')][_0x4382f2['actionid']];_0x94ed49['responsetime']=moment()['format'](_0xa0ea('0x102'));var _0x3f7887=_0x94ed49[_0xa0ea('0x4f')]===_0xa0ea('0x7f')?this['campaigns'][_0x94ed49[_0xa0ea('0xb0')]]:this[_0xa0ea('0x1f')][_0x94ed49['getQueue']()];if(!this[_0xa0ea('0xd4')](_0x4382f2[_0xa0ea('0x18d')])){this[_0xa0ea('0xaf')](_0x3f7887);return this[_0xa0ea('0x18e')](_0x94ed49,_0x3f7887,_0x4382f2)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x18f')));}this['uniqueId'][_0x4382f2[_0xa0ea('0xe9')]]=_0x94ed49;}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x190')]=function(_0x14fe15,_0x59d232,_0x44df53){var _0x182ead=new History(_0x59d232);if(_0x182ead[_0xa0ea('0xeb')]+_0x182ead[_0xa0ea('0xec')]+_0x182ead[_0xa0ea('0xfd')]+_0x182ead[_0xa0ea('0xed')]+_0x182ead[_0xa0ea('0xee')]+_0x182ead[_0xa0ea('0xfe')]+_0x182ead['countmachineretry']+_0x182ead[_0xa0ea('0xff')]>=_0x44df53[_0xa0ea('0x100')]-0x1){return!![];}switch(_0x14fe15){case 0x3:if(_0x182ead[_0xa0ea('0xfd')]>=_0x44df53['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countnoanswerretry':_0x182ead[_0xa0ea('0xfd')]+=0x1,'scheduledat':moment()[_0xa0ea('0xf5')](_0x44df53[_0xa0ea('0x191')],_0xa0ea('0x101'))[_0xa0ea('0x7c')](_0xa0ea('0x102')),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead[_0xa0ea('0xf7')],'VoiceQueueId':_0x182ead['VoiceQueueId']||undefined,'CampaignId':_0x182ead[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x192')));break;case 0x5:if(_0x182ead[_0xa0ea('0xeb')]>=_0x44df53[_0xa0ea('0x193')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countbusyretry':_0x182ead[_0xa0ea('0xeb')]+=0x1,'scheduledat':moment()[_0xa0ea('0xf5')](_0x44df53[_0xa0ea('0x194')],_0xa0ea('0x101'))[_0xa0ea('0x7c')](_0xa0ea('0x102')),'ContactId':_0x182ead['ContactId'],'ListId':_0x182ead['ListId'],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead['CampaignId']||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x195')));break;case 0x8:if(_0x182ead['countcongestionretry']>=_0x44df53[_0xa0ea('0x196')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countcongestionretry':_0x182ead[_0xa0ea('0xec')]+=0x1,'scheduledat':moment()[_0xa0ea('0xf5')](_0x44df53[_0xa0ea('0x197')],_0xa0ea('0x101'))[_0xa0ea('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead[_0xa0ea('0xf7')],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead['CampaignId']||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x198')));break;case 0x0:if(_0x182ead[_0xa0ea('0xed')]>=_0x44df53[_0xa0ea('0x199')]-0x1){return!![];}else{this[_0xa0ea('0xbc')]({'active':![],'countnosuchnumberretry':_0x182ead['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x44df53[_0xa0ea('0x19a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x182ead['ContactId'],'ListId':_0x182ead[_0xa0ea('0xf7')],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead[_0xa0ea('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x182ead[_0xa0ea('0xee')]>=_0x44df53[_0xa0ea('0x11a')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countdropretry':_0x182ead[_0xa0ea('0xee')]+=0x1,'scheduledat':moment()['add'](_0x44df53[_0xa0ea('0x19b')],_0xa0ea('0x101'))[_0xa0ea('0x7c')](_0xa0ea('0x102')),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead['ListId'],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x19c')));break;case 0xb:if(_0x182ead[_0xa0ea('0xfe')]>=_0x44df53[_0xa0ea('0x121')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countabandonedretry':_0x182ead['countabandonedretry']+=0x1,'scheduledat':moment()[_0xa0ea('0xf5')](_0x44df53[_0xa0ea('0x122')],_0xa0ea('0x101'))['format'](_0xa0ea('0x102')),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead['ListId'],'VoiceQueueId':_0x182ead['VoiceQueueId']||undefined,'CampaignId':_0x182ead[_0xa0ea('0xd2')]||undefined})['catch'](loggerCatch(_0xa0ea('0x123')));break;case 0x13:if(_0x182ead['countmachineretry']>=_0x44df53[_0xa0ea('0xf2')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countmachineretry':_0x182ead['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x44df53[_0xa0ea('0xf6')],_0xa0ea('0x101'))[_0xa0ea('0x7c')](_0xa0ea('0x102')),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead[_0xa0ea('0xf7')],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xf8')));break;case 0x14:if(_0x182ead[_0xa0ea('0xff')]>=_0x44df53[_0xa0ea('0x19d')]-0x1){return!![];}this[_0xa0ea('0xbc')]({'active':![],'countagentrejectretry':_0x182ead[_0xa0ea('0xff')]+=0x1,'scheduledat':moment()['add'](_0x44df53[_0xa0ea('0x19e')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x182ead[_0xa0ea('0xcf')],'ListId':_0x182ead[_0xa0ea('0xf7')],'VoiceQueueId':_0x182ead[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x182ead['CampaignId']||undefined})['catch'](loggerCatch(_0xa0ea('0x19f')));break;default:return!![];}};Dialer[_0xa0ea('0x19')]['callProgressDetecting']=function(_0x530b3f,_0x336640,_0x1f718b){var _0x31eff6=this;var _0xb4e878=new History(_0x530b3f);return new BPromise(function(_0x4e65fe,_0x4f67bc){if(_['isUndefined'](_0x336640)&&typeof _0x336640!==_0xa0ea('0x165')){return _0x4f67bc(msgResponse(_0xa0ea('0x1a0'),_0xa0ea('0x144'),_0xa0ea('0x1a1')));}if(_['isUndefined'](_0x1f718b)&&typeof _0x1f718b!==_0xa0ea('0x165')){return _0x4f67bc(msgResponse(_0xa0ea('0x1a0'),_0xa0ea('0x144'),_0xa0ea('0x1a2')));}switch(_0x1f718b[_0xa0ea('0x10c')]){case'0':_0x336640[_0xa0ea('0x1a3')]+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0x0;_0xb4e878[_0xa0ea('0xa8')]='NoSuchNumber';_0xb4e878['countnosuchnumberretry']+=0x1;_0xb4e878['countglobal']+=0x1;ami[_0xa0ea('0x4e')](_0xa0ea('0x1a4'),ut[_0xa0ea('0xe4')](_0x530b3f,_0xa0ea('0x1a5')));_0x31eff6['createHistory'](_0xb4e878)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xea')));if(_0x31eff6['checkRetriveMax'](0x0,_0x530b3f,_0x336640)){if(_0xb4e878[_0xa0ea('0xed')]>=_0x336640[_0xa0ea('0x199')]){_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1a6'));}else{_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1a6'));}}break;case'3':_0x336640[_0xa0ea('0x6a')]+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0x3;_0xb4e878['statedesc']=_0xa0ea('0x1a7');_0xb4e878[_0xa0ea('0xfd')]+=0x1;_0xb4e878[_0xa0ea('0xfc')]+=0x1;ami[_0xa0ea('0x4e')](_0xa0ea('0x1a8'),ut[_0xa0ea('0xe4')](_0x530b3f,_0xa0ea('0x1a9')));_0x31eff6[_0xa0ea('0xc8')](_0xb4e878)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1aa')));if(_0x31eff6[_0xa0ea('0x190')](0x3,_0x530b3f,_0x336640)){if(_0xb4e878[_0xa0ea('0xfd')]>=_0x336640[_0xa0ea('0x1ab')]){_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1ac'));}else{_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x336640[_0xa0ea('0x67')]+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0x5;_0xb4e878[_0xa0ea('0xa8')]='Busy';_0xb4e878[_0xa0ea('0xeb')]+=0x1;_0xb4e878['countglobal']+=0x1;ami['emit'](_0xa0ea('0x1ad'),ut[_0xa0ea('0xe4')](_0x530b3f,_0xa0ea('0x1ae')));_0x31eff6[_0xa0ea('0xc8')](_0xb4e878)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1af')));if(_0x31eff6[_0xa0ea('0x190')](0x5,_0x530b3f,_0x336640)){if(_0xb4e878['countbusyretry']>=_0x336640[_0xa0ea('0x193')]){_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1b0'));}else{_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1b0'));}}break;case'8':_0x336640[_0xa0ea('0x68')]+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0x8;_0xb4e878['statedesc']=_0xa0ea('0x1b1');_0xb4e878['countcongestionretry']+=0x1;_0xb4e878[_0xa0ea('0xfc')]+=0x1;ami['emit'](_0xa0ea('0x1b2'),ut[_0xa0ea('0xe4')](_0x530b3f,_0xa0ea('0x1b3')));_0x31eff6['createHistory'](_0xb4e878)['catch'](loggerCatch(_0xa0ea('0x1b4')));if(_0x31eff6[_0xa0ea('0x190')](0x8,_0x530b3f,_0x336640)){if(_0xb4e878[_0xa0ea('0xec')]>=_0x336640[_0xa0ea('0x196')]){_0x31eff6['createStateFinal'](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1b5'));}else{_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1b5'));}}break;case'11':_0x336640['outboundAbandonedCallsDay']+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0xb;_0xb4e878['statedesc']=_0xa0ea('0x11f');_0xb4e878[_0xa0ea('0xfe')]+=0x1;_0xb4e878['countglobal']+=0x1;_0x31eff6[_0xa0ea('0xc8')](_0xb4e878)[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1b6')));if(_0x31eff6['checkRetriveMax'](0xb,_0x530b3f,_0x336640)){if(_0xb4e878[_0xa0ea('0xfe')]>=_0x336640[_0xa0ea('0x121')]){_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,'reason\x2011\x20abandoned');}else{_0x31eff6['stateGlobal'](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1b7'));}}break;case'20':_0x336640['outboundRejectCallsDay']+=0x1;_0xb4e878[_0xa0ea('0xa7')]=0x14;_0xb4e878['statedesc']='AgentReject';_0xb4e878[_0xa0ea('0xff')]+=0x1;_0xb4e878[_0xa0ea('0xfc')]+=0x1;ami[_0xa0ea('0x4e')](_0xa0ea('0x1b8'),ut['buildObj'](_0x530b3f,_0xa0ea('0x1b9')));_0x31eff6[_0xa0ea('0xc8')](_0xb4e878)['catch'](loggerCatch(_0xa0ea('0x1ba')));if(_0x31eff6['checkRetriveMax'](0x14,_0x530b3f,_0x336640)){if(_0xb4e878[_0xa0ea('0xff')]>=_0x336640[_0xa0ea('0x19d')]){_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,'reason\x2020\x20agentreject');}else{_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0xa0ea('0x1bb'));}}break;default:_0x336640[_0xa0ea('0x6b')]+=0x1;_0xb4e878['state']=0xc;_0xb4e878['statedesc']=_0x1f718b[_0xa0ea('0x10c')];_0x31eff6[_0xa0ea('0xc8')](_0xb4e878)['catch'](loggerCatch(_0xa0ea('0x1bc')));if(_0x31eff6[_0xa0ea('0x190')](_0x1f718b[_0xa0ea('0x10c')],_0x530b3f,_0x336640)){if(_0xb4e878['countbusyretry']+_0xb4e878[_0xa0ea('0xec')]+_0xb4e878[_0xa0ea('0xfd')]+_0xb4e878[_0xa0ea('0xed')]+_0xb4e878['countdropretry']+_0xb4e878[_0xa0ea('0xfe')]+_0xb4e878[_0xa0ea('0xef')]+_0xb4e878[_0xa0ea('0xff')]>=_0x336640[_0xa0ea('0x100')]){_0x31eff6[_0xa0ea('0xf0')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0x1f718b[_0xa0ea('0x10c')]);}else{_0x31eff6[_0xa0ea('0xf3')](_0xb4e878,_0x4e65fe,_0x4f67bc,_0x1f718b[_0xa0ea('0x10c')]);}}}});};Dialer['prototype'][_0xa0ea('0xf0')]=function(_0xf680cf,_0x268b73,_0x259480,_0x467fdf){var _0x144279=new Final(_0xf680cf);_0x144279[_0xa0ea('0xa7')]=0xf;_0x144279[_0xa0ea('0xa8')]=_0xa0ea('0x1bd');this[_0xa0ea('0xf3')](_0x144279,_0x268b73,_0x259480,_0x467fdf);};Dialer['prototype']['createStateFinal']=function(_0x3079d2,_0x40e54c,_0x47173e,_0xf24b3d){this[_0xa0ea('0xc6')](_0x3079d2)[_0xa0ea('0xb4')](function(){return _0x40e54c(msgResponse('[callProgressDetecting]',_0xa0ea('0xd5'),_0xf24b3d));})[_0xa0ea('0xad')](function(){return _0x47173e(msgResponse(_0xa0ea('0x1be'),_0xa0ea('0x144'),_0xa0ea('0x1bf')));});};Dialer[_0xa0ea('0x19')][_0xa0ea('0x15a')]=function(_0x245f1b){var _0x31c20a=_0x245f1b[_0xa0ea('0x1c0')]/0x64;var _0x4c64af=_0x245f1b[_0xa0ea('0x116')]/(_0x245f1b[_0xa0ea('0x116')]+_0x245f1b['outboundAnswerCallsDay']);var _0x196de1=Math[_0xa0ea('0x1c1')](_0x245f1b[_0xa0ea('0x72')]*(_0x245f1b[_0xa0ea('0x1c2')]/0x64));var _0x11dfe5=Math[_0xa0ea('0x1c1')](_0x245f1b['predictiveIntervalAvailable']*(_0x245f1b[_0xa0ea('0x1c3')]/0x64));var _0x17aae4=_0x245f1b['available']+_0x245f1b['talking'];var _0x51c70e=Math[_0xa0ea('0x1c4')](_0x245f1b['erlangCalls']*_0x245f1b[_0xa0ea('0x77')]*_0x245f1b[_0xa0ea('0x1c5')]*_0x245f1b[_0xa0ea('0x70')]);if(_['isUndefined'](_0x245f1b[_0xa0ea('0x79')])){if(!_[_0xa0ea('0x3e')](_0x245f1b[_0xa0ea('0x28')])){_0x245f1b[_0xa0ea('0x28')]=undefined;loggerPredictive['error'](_0xa0ea('0x1c6'),_0xa0ea('0x1c7'));}if(!_[_0xa0ea('0x3e')](_0x245f1b['handlePredictive'])){loggerPredictive[_0xa0ea('0x98')](_0xa0ea('0x1c6'),_0xa0ea('0x1c8'));clearInterval(_0x245f1b['handlePredictive']);_0x245f1b[_0xa0ea('0x93')]=undefined;}_0x245f1b[_0xa0ea('0x79')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa0ea('0x81')](_0x245f1b[_0xa0ea('0x40')],_0xa0ea('0x1c9'),_0x245f1b[_0xa0ea('0x79')]);this[_0xa0ea('0x158')](_0x245f1b,0x1);}else if(ifInterval(_0x245f1b[_0xa0ea('0x1ca')],_0x245f1b[_0xa0ea('0x79')])){this[_0xa0ea('0x158')](_0x245f1b,0x1);loggerPredictiveCalls['info'](_0xa0ea('0x1cb'),_0x245f1b[_0xa0ea('0x79')],_0x245f1b[_0xa0ea('0x40')]);_0x245f1b[_0xa0ea('0x75')]=0x0;_0x245f1b[_0xa0ea('0x1cc')]=0x0;}else if(_0x31c20a<_0x4c64af&&_0x245f1b[_0xa0ea('0x1cd')]===_0xa0ea('0x1ce')){freeVariablesPredictive(_0x245f1b);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x1cf'),'Dropped\x20calls\x20day',_0x4c64af,_0xa0ea('0x79'),_0x245f1b['name']);}else if(_0x51c70e<_0x245f1b['predictiveIntervalErlangCallsDroppedCalls']&&_0x245f1b[_0xa0ea('0x1cd')]===_0xa0ea('0x1ce')){freeVariablesPredictive(_0x245f1b);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x1d0'),_0xa0ea('0x1d1'),_0x51c70e,_0xa0ea('0x1d2'),_0x245f1b[_0xa0ea('0x1cc')],_0xa0ea('0x79'),_0x245f1b['name']);}else if(!ifInterval(_0x245f1b['dialPredictiveInterval'],_0x245f1b['startProgressive'])&&_['isUndefined'](_0x245f1b[_0xa0ea('0x28')])&&!_[_0xa0ea('0x3e')](_0x245f1b[_0xa0ea('0x79')])){_0x245f1b['startPredictive']=moment()[_0xa0ea('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa0ea('0x81')](_0x245f1b[_0xa0ea('0x40')],'started\x20in\x20predictive\x20at',_0x245f1b[_0xa0ea('0x28')]);this['averageHandleTime'](_0x245f1b[_0xa0ea('0x1ca')])[_0xa0ea('0xb4')](this[_0xa0ea('0x1d3')](_0x245f1b))[_0xa0ea('0xb4')](mergeDataErlangB(_0x245f1b))[_0xa0ea('0xb4')](this[_0xa0ea('0x1d4')](_0x245f1b))[_0xa0ea('0xad')](loggerCatchPredictive(_0xa0ea('0x1d5'),_0x245f1b));}else if(!ifInterval(_0x245f1b[_0xa0ea('0x1ca')],_0x245f1b[_0xa0ea('0x28')])){_0x245f1b['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x245f1b[_0xa0ea('0x28')]=moment()['format'](_0xa0ea('0x102'));loggerPredictive['info'](_0x245f1b[_0xa0ea('0x40')],'recalculate\x20predictive\x20at',_0x245f1b[_0xa0ea('0x28')]);clearInterval(_0x245f1b[_0xa0ea('0x93')]);_0x245f1b[_0xa0ea('0x93')]=undefined;this['averageHandleTime'](_0x245f1b[_0xa0ea('0x1ca')])[_0xa0ea('0xb4')](this[_0xa0ea('0x1d3')](_0x245f1b))['then'](mergeDataErlangB(_0x245f1b))[_0xa0ea('0xb4')](this[_0xa0ea('0x1d4')](_0x245f1b))[_0xa0ea('0xad')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x245f1b));}else if(_0x245f1b['predictiveIntervalAvailable']&&_0x17aae4<_0x245f1b[_0xa0ea('0x72')]-_0x11dfe5){freeVariablesPredictive(_0x245f1b);loggerPredictive[_0xa0ea('0x81')](_0x245f1b[_0xa0ea('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x17aae4,')\x20are\x20less\x20than\x20threshold\x20(',_0x245f1b[_0xa0ea('0x72')],'-',_0x11dfe5,'=',_0x245f1b[_0xa0ea('0x72')]-_0x11dfe5,')');}else if(_0x245f1b[_0xa0ea('0x72')]&&_0x17aae4>_0x245f1b[_0xa0ea('0x72')]+_0x196de1){freeVariablesPredictive(_0x245f1b);loggerPredictive['info'](_0x245f1b[_0xa0ea('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x17aae4,_0xa0ea('0x1d6'),_0x245f1b[_0xa0ea('0x72')],'+',_0x196de1,'=',_0x245f1b['predictiveIntervalAvailable']+_0x196de1,')');}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x1d3')]=function(_0xe5bca4){var _0x3e4f35=this;return function(_0x5c457a){return new BPromise(function(_0x15be38,_0x511b02){_[_0xa0ea('0x8f')](_0xe5bca4,_0x5c457a[0x0]);if(checkGetDataPredictive(_0x5c457a[0x0])){var _0x267b7a=_0xe5bca4[_0xa0ea('0x72')]=_0xe5bca4[_0xa0ea('0xa3')]+_0xe5bca4[_0xa0ea('0x53')];var _0x304cf6=_0xe5bca4[_0xa0ea('0x1ca')]*0x3c;var _0x3fbc62=_0x5c457a[0x0][_0xa0ea('0x6d')]+_0x5c457a[0x0][_0xa0ea('0x87')];var _0x384441=(_0x5c457a[0x0]['predictiveIntervalAnsweredCalls']+_0x5c457a[0x0][_0xa0ea('0x6f')]+_0x5c457a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5c457a[0x0][_0xa0ea('0x73')];_0xe5bca4[_0xa0ea('0x1c5')]=_0x384441>0x0?_0x384441:0x1;switch(_0xe5bca4['dialPredictiveOptimization']){case'dropRate':var _0x268506=_0xe5bca4[_0xa0ea('0x1c0')]/0x64;return _0x3e4f35[_0xa0ea('0x1d7')](_0x267b7a,_0x304cf6,_0x3fbc62,_0x384441,_0x268506)[_0xa0ea('0xb4')](function(_0x43cb91){return _0x15be38(_0x43cb91);});case _0xa0ea('0x1d8'):var _0x45cdc5=_0xe5bca4[_0xa0ea('0x1c0')]/0x64;return _0x3e4f35[_0xa0ea('0x1d9')](_0x267b7a,_0x304cf6,_0x3fbc62,_0x384441,_0x45cdc5)[_0xa0ea('0xb4')](function(_0x30cafd){return _0x15be38(_0x30cafd);});default:return _0x511b02(msgResponse(_0xa0ea('0x1da'),_0xa0ea('0x144'),'Unknown\x20Predictive'));}}else{return _0x511b02(msgResponse('[getDataPredictive]','Failure',_0xa0ea('0x1db')));}});};};Dialer['prototype'][_0xa0ea('0x1dc')]=function(_0x438aef){var _0x364712=this;return function(_0xb14757){return new BPromise(function(_0x440d64,_0x5f300e){_['merge'](_0x438aef,_0xb14757[0x0]);if(checkGetDataPredictive(_0xb14757[0x0])){loggerPredictive[_0xa0ea('0x81')](JSON[_0xa0ea('0x4b')](_0xb14757[0x0]));if(_0x438aef[_0xa0ea('0x1cd')]===_0xa0ea('0x1ce')){return _0x364712[_0xa0ea('0xc4')](_0x438aef['id'])[_0xa0ea('0xb4')](function(_0x50395e){var _0x360753=_0x438aef['loggedIn']-_0x50395e[0x0][_0xa0ea('0x1dd')];var _0x532ad0=_0x438aef[_0xa0ea('0x1ca')]*0x3c;var _0x2a6bb2=_0xb14757[0x0]['predictiveIntervalAvgTalktime']+_0xb14757[0x0]['predictiveIntervalAvgHoldtime'];var _0x24ee50=(_0xb14757[0x0]['predictiveIntervalAnsweredCalls']+_0xb14757[0x0][_0xa0ea('0x6f')]+_0xb14757[0x0][_0xa0ea('0x6e')])/_0xb14757[0x0][_0xa0ea('0x73')];var _0x198dab=_0x438aef['dialPredictiveOptimizationPercentage']/0x64;_0x438aef['predictiveIntervalPauses']=_0x50395e[0x0][_0xa0ea('0x1dd')]||0x0;_0x438aef[_0xa0ea('0x1c5')]=_0x24ee50>0x0?_0x24ee50:0x1;return _0x364712[_0xa0ea('0x1d7')](_0x360753,_0x532ad0,_0x2a6bb2,_0x24ee50,_0x198dab);})[_0xa0ea('0xb4')](function(_0xbe009e){return _0x440d64(_0xbe009e);})['catch'](function(_0x1eb21d){return _0x5f300e(msgResponse(_0xa0ea('0x1de'),'Failure',JSON[_0xa0ea('0x4b')](_0x1eb21d)));});}if(_0x438aef['dialPredictiveOptimization']===_0xa0ea('0x1d8')){return _0x364712[_0xa0ea('0xc4')](_0x438aef['id'])[_0xa0ea('0xb4')](function(_0xaa7e53){var _0x42b137=_0x438aef[_0xa0ea('0x54')]-_0xaa7e53[0x0][_0xa0ea('0x1dd')];var _0x8b56ca=_0x438aef[_0xa0ea('0x1ca')]*0x3c;var _0x59ba6b=_0xb14757[0x0][_0xa0ea('0x6d')]+_0xb14757[0x0]['predictiveIntervalAvgHoldtime'];var _0x9c0d93=(_0xb14757[0x0][_0xa0ea('0x6c')]+_0xb14757[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xb14757[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xb14757[0x0][_0xa0ea('0x73')];var _0x18de3b=_0x438aef[_0xa0ea('0x1c0')]/0x64;_0x438aef[_0xa0ea('0x71')]=_0xaa7e53[0x0][_0xa0ea('0x1dd')]||0x0;_0x438aef['predictiveIntervalHitRate']=_0x9c0d93>0x0?_0x9c0d93:0x1;return _0x364712[_0xa0ea('0x1d9')](_0x42b137,_0x8b56ca,_0x59ba6b,_0x9c0d93,_0x18de3b);})[_0xa0ea('0xb4')](function(_0x360aa1){return _0x440d64(_0x360aa1);})['catch'](function(_0xa953ba){return _0x5f300e(msgResponse(_0xa0ea('0x1de'),_0xa0ea('0x144'),JSON['stringify'](_0xa953ba)));});}}else{return _0x5f300e(msgResponse(_0xa0ea('0x1da'),_0xa0ea('0x144'),'check\x20failure'));}});};};Dialer[_0xa0ea('0x19')]['startMethodPredictive']=function(_0x381340){var _0x345c1f=this;return function(){var _0x15fe1f=0x0;var _0x5bffe6=Math[_0xa0ea('0x1c4')](_0x381340[_0xa0ea('0x76')]*0x3e8);if(_0x5bffe6>0x0){_0x5bffe6=_0x5bffe6<0x64?0x64:_0x5bffe6;loggerPredictive[_0xa0ea('0x81')](_0x381340['name'],_0xa0ea('0x1df'),_0x5bffe6,_0xa0ea('0x4c'));_0x381340[_0xa0ea('0x93')]=setInterval(function(){_0x345c1f[_0xa0ea('0x93')](_0x381340);loggerPredictiveCalls[_0xa0ea('0x81')](_0xa0ea('0x1e0'),_0x15fe1f+=0x1);},_0x5bffe6);}else{loggerPredictive[_0xa0ea('0x81')](_0x381340[_0xa0ea('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xa0ea('0x1e1')]=function(_0x52b45f,_0x1c8bdf){var _0x2db37d=this;return function(_0xc1cef3){if(_[_0xa0ea('0x96')](_0xc1cef3)){if(_['isNil'](_0x1c8bdf[_0xa0ea('0xd0')])||!_0x1c8bdf[_0xa0ea('0x1e2')]){if(_0x52b45f['dialMethod']==='booked'){_0x52b45f[_0xa0ea('0x12d')]=_[_0xa0ea('0x3e')](_0x52b45f[_0xa0ea('0x12d')])?!![]:_0x52b45f['queueStatusComplete'];var _0x1b13c6=uuid['v4']();_0x2db37d[_0xa0ea('0x25')][_0x1b13c6]=new Action(_0x52b45f,_0x1c8bdf,_0x1b13c6);loggerBooked[_0xa0ea('0x81')]('[booked][checkContactBlack]',_0x1b13c6,'queueStatusComplete:\x20',JSON[_0xa0ea('0x4b')](_0x52b45f[_0xa0ea('0x12d')]),_0xa0ea('0x1e3'),_0x52b45f['name']);if(_0x52b45f[_0xa0ea('0x12d')]){_0x52b45f[_0xa0ea('0x12d')]=![];_0x2db37d[_0xa0ea('0x2a')][_0x2db37d[_0xa0ea('0x25')][_0x1b13c6][_0xa0ea('0xb0')]]=[];ami[_0xa0ea('0x150')]({'actionid':_0x1b13c6,'action':'queuestatus','queue':_0x52b45f[_0xa0ea('0x40')]})[_0xa0ea('0xad')](function(){_0x2db37d[_0xa0ea('0xaf')](_0x52b45f);_0x2db37d[_0xa0ea('0xbc')]({'active':![],'ContactId':_0x2db37d[_0xa0ea('0x25')][_0x1b13c6][_0xa0ea('0xcf')],'ListId':_0x2db37d['actions'][_0x1b13c6]['ListId'],'VoiceQueueId':_0x2db37d[_0xa0ea('0x25')][_0x1b13c6][_0xa0ea('0xd1')]||undefined,'CampaignId':_0x2db37d['actions'][_0x1b13c6]['CampaignId']||undefined})[_0xa0ea('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2db37d[_0xa0ea('0x25')][_0x1b13c6];});}else{loggerBooked[_0xa0ea('0x81')](_0xa0ea('0x1e4'),JSON[_0xa0ea('0x4b')](_0x52b45f[_0xa0ea('0x12d')]),_0xa0ea('0x1e3'),_0x52b45f[_0xa0ea('0x40')]);_0x2db37d[_0xa0ea('0xaf')](_0x52b45f);_0x2db37d[_0xa0ea('0xbc')]({'active':![],'ContactId':_0x2db37d['actions'][_0x1b13c6]['ContactId'],'ListId':_0x2db37d[_0xa0ea('0x25')][_0x1b13c6][_0xa0ea('0xf7')],'VoiceQueueId':_0x2db37d[_0xa0ea('0x25')][_0x1b13c6]['VoiceQueueId']||undefined,'CampaignId':_0x2db37d[_0xa0ea('0x25')][_0x1b13c6]['CampaignId']||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1e5')));delete _0x2db37d[_0xa0ea('0x25')][_0x1b13c6];}}else{return _0x2db37d[_0xa0ea('0x164')](_0x52b45f,_0x1c8bdf);}}else{if(getDiff(_0x1c8bdf[_0xa0ea('0x1e6')])<_0x52b45f[_0xa0ea('0x1e7')]*0x3c){if(_0x1c8bdf['Agent']&&!_0x1c8bdf['Agent'][_0xa0ea('0x1e8')]){_0x2db37d[_0xa0ea('0x1e')][_0xa0ea('0x136')](_0x1c8bdf['id'])[_0xa0ea('0x1c')](function(){_0x2db37d[_0xa0ea('0xaf')](_0x52b45f);});}else{_0x2db37d['unlockContact']({'active':![]},_0x1c8bdf['id'],0x1)[_0xa0ea('0x1c')](function(){_0x2db37d[_0xa0ea('0xaf')](_0x52b45f);});}}else{_0x52b45f[_0xa0ea('0x1e9')]+=0x1;_0x2db37d[_0xa0ea('0xaf')](_0x52b45f);if(_0x52b45f[_0xa0ea('0x1ea')]){_0x2db37d[_0xa0ea('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c8bdf['ContactId'],'ListId':_0x1c8bdf[_0xa0ea('0xf7')],'VoiceQueueId':_0x1c8bdf[_0xa0ea('0xd1')]||undefined,'CampaignId':_0x1c8bdf[_0xa0ea('0xd2')]||undefined})[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1eb')));_0x2db37d[_0xa0ea('0xc8')](createObjHistory(_0x52b45f,_0x1c8bdf,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0x1ec')));}else{_0x2db37d[_0xa0ea('0xcd')](createObjHistory(_0x52b45f,_0x1c8bdf,_0xa0ea('0x1ed'),0x16,_0xa0ea('0x1ee')),_0xa0ea('0x1ef'),_0xa0ea('0x1f0'));}}}}else{_0x52b45f[_0xa0ea('0x66')]+=0x1;_0x2db37d[_0xa0ea('0xcd')](createObjHistory(_0x52b45f,_0x1c8bdf,_0xa0ea('0x1f1'),0xd,_0xa0ea('0x1f2')),'[Originate][historyBlacklist]',_0xa0ea('0x1f3'));throw _0xa0ea('0x1f4');}};};Dialer['prototype']['handleIvr']=function(_0x1b65eb){var _0xf1ed4e=this;var _0x2e5a42=_0x1b65eb[_0xa0ea('0x1f5')]-_0x1b65eb['originated']-_0x1b65eb[_0xa0ea('0xc1')];emitCampaignSummary(_0x1b65eb);if(_0x2e5a42>0x0){if(_0x2e5a42>this[_0xa0ea('0x23')]){_0x2e5a42=this[_0xa0ea('0x23')];}_0x1b65eb[_0xa0ea('0xc1')]+=_0x2e5a42;this['getContactDialerIvr'](_0x1b65eb['id'],_0x2e5a42,_0x1b65eb['dialOrderByScheduledAt'],_0x1b65eb)['then'](function(_0x4243e6){_0x1b65eb['temp']-=_0x2e5a42;_0x1b65eb[_0xa0ea('0xc1')]=_0x1b65eb[_0xa0ea('0xc1')]>0x0?_0x1b65eb[_0xa0ea('0xc1')]:0x0;if(!checkContactEmpty(_0x4243e6)){_0x1b65eb[_0xa0ea('0x44')]=_0xa0ea('0xa1');logger[_0xa0ea('0x81')](_0xa0ea('0x1f6')+_0x1b65eb[_0xa0ea('0x40')]);}else{_0x1b65eb['originated']+=_0x4243e6['length'];_0x1b65eb[_0xa0ea('0x44')]=_0xa0ea('0x1f7');for(var _0x4abbb5=0x0;_0x4abbb5<_0x4243e6[_0xa0ea('0x130')];_0x4abbb5+=0x1){_0x1b65eb[_0xa0ea('0x1f8')]+=0x1;if(_[_0xa0ea('0xac')](_0x4243e6[_0x4abbb5])||_[_0xa0ea('0xac')](_0x4243e6[_0x4abbb5][_0xa0ea('0x167')])||_['isNil'](_0x4243e6[_0x4abbb5][_0xa0ea('0x167')][_0xa0ea('0x168')])){_0xf1ed4e[_0xa0ea('0x1f9')](_0xa0ea('0x1fa'),_0x1b65eb,_0x4243e6[_0x4abbb5]);}else{_0xf1ed4e[_0xa0ea('0xb7')](_[_0xa0ea('0xce')](_0x4243e6[_0x4abbb5],[_0xa0ea('0xd2'),'Contact.phone']))[_0xa0ea('0xb4')](_0xf1ed4e['checkContactBlack'](_0x1b65eb,_0x4243e6[_0x4abbb5]))[_0xa0ea('0xad')](_0xf1ed4e[_0xa0ea('0xcb')](_0xa0ea('0x1fb'),_0x1b65eb));}}}})[_0xa0ea('0xad')](loggerGetContactDialer('[getContactCampaign2]',_0x1b65eb,_0x2e5a42));}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x158')]=function(_0x38b3ba,_0x59ec6d){var _0x13dfc7=this;var _0xedee35=[];var _0x50302c=_0x59ec6d>=0x1?_0x59ec6d:0x1;if(_0x38b3ba['dialMethod']===_0xa0ea('0x15b')){_0x50302c=0x1;}var _0x9ad344=Math[_0xa0ea('0x1c4')](_0x38b3ba[_0xa0ea('0x53')]*_0x50302c)-_0x38b3ba[_0xa0ea('0x74')]-_0x38b3ba[_0xa0ea('0xc1')];emitVoiceQueueSummary(_0x38b3ba);if(_0x38b3ba['dialLimitQueue']>0x0){var _0x472cf7=_0x38b3ba['dialLimitQueue']-_0x38b3ba[_0xa0ea('0x74')]-_0x38b3ba['talking']-_0x38b3ba[_0xa0ea('0xc1')]-_0x38b3ba[_0xa0ea('0x55')];if(_0x9ad344>_0x472cf7){_0x9ad344=_0x472cf7;}}if(_0x9ad344>0x0){if(_0x38b3ba['dialMethod']===_0xa0ea('0x15b')){_0x9ad344=0x1;}if(_0x9ad344>this[_0xa0ea('0x23')]){_0x9ad344=this[_0xa0ea('0x23')];}_0x38b3ba['temp']+=_0x9ad344;for(var _0x3ea34e in this[_0xa0ea('0x21')]){if(typeof this[_0xa0ea('0x21')][_0x3ea34e]!==_0xa0ea('0x9b')){if(this['agents'][_0x3ea34e][_0xa0ea('0xa7')]===_0xa0ea('0x1fc')&&this['agents'][_0x3ea34e][_0xa0ea('0xd8')]===_0xa0ea('0xd9')){_0xedee35['push'](this[_0xa0ea('0x21')][_0x3ea34e]['id']);}}}this[_0xa0ea('0xc0')](_0x38b3ba['id'],_0xedee35,_0x9ad344,_0x38b3ba[_0xa0ea('0x1fd')],_0x38b3ba)['then'](function(_0x3b4f06){_0x38b3ba['temp']-=_0x9ad344;_0x38b3ba[_0xa0ea('0xc1')]=_0x38b3ba[_0xa0ea('0xc1')]>0x0?_0x38b3ba['temp']:0x0;if(!checkContactEmpty(_0x3b4f06)){_0x13dfc7[_0xa0ea('0xb2')](_0x38b3ba)[_0xa0ea('0xb4')](sendMessageReschedule(_0x38b3ba))[_0xa0ea('0xad')](loggerCatch(_0xa0ea('0xb5')));}else{_0x38b3ba['originated']+=_0x3b4f06[_0xa0ea('0x130')];_0x38b3ba[_0xa0ea('0x44')]=_0x38b3ba[_0xa0ea('0x5f')]===_0xa0ea('0x15b')?_0xa0ea('0x170'):_0xa0ea('0x1f7');for(var _0x1ff811=0x0;_0x1ff811<_0x3b4f06[_0xa0ea('0x130')];_0x1ff811+=0x1){if(_[_0xa0ea('0xac')](_0x3b4f06[_0x1ff811])||_[_0xa0ea('0xac')](_0x3b4f06[_0x1ff811][_0xa0ea('0x167')])||_[_0xa0ea('0xac')](_0x3b4f06[_0x1ff811][_0xa0ea('0x167')][_0xa0ea('0x168')])){_0x13dfc7[_0xa0ea('0x1f9')](_0xa0ea('0x1fa'),_0x38b3ba,_0x3b4f06[_0x1ff811]);}else{_0x13dfc7[_0xa0ea('0x1fe')](_[_0xa0ea('0xce')](_0x3b4f06[_0x1ff811],['VoiceQueueId',_0xa0ea('0x1ff')]))[_0xa0ea('0xb4')](_0x13dfc7[_0xa0ea('0x1e1')](_0x38b3ba,_0x3b4f06[_0x1ff811]))[_0xa0ea('0xad')](_0x13dfc7[_0xa0ea('0xcb')](_0xa0ea('0x1fa'),_0x38b3ba));}}}})[_0xa0ea('0xad')](loggerGetContactDialer(_0xa0ea('0x200'),_0x38b3ba,_0x9ad344));}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x93')]=function(_0x556f13){if(_0x556f13[_0xa0ea('0x201')]>0x0){var _0x2f9542=_0x556f13[_0xa0ea('0x201')]-_0x556f13['originated']-_0x556f13[_0xa0ea('0xa3')];if(_0x2f9542>0x0){this['tryOriginatePredictive'](_0x556f13);}else{loggerPredictiveCalls[_0xa0ea('0x81')](_0xa0ea('0x202'));}}else{this[_0xa0ea('0x203')](_0x556f13);}};Dialer[_0xa0ea('0x19')][_0xa0ea('0x203')]=function(_0x297974){var _0x7ff8d7=this;var _0x72a371=[];_0x297974[_0xa0ea('0x74')]+=0x1;for(var _0x4c55b2 in this[_0xa0ea('0x21')]){if(typeof this[_0xa0ea('0x21')][_0x4c55b2]!=='undefined'){if(this[_0xa0ea('0x21')][_0x4c55b2][_0xa0ea('0xa7')]==='not_inuse'&&this['agents'][_0x4c55b2][_0xa0ea('0xd8')]===_0xa0ea('0xd9')){_0x72a371[_0xa0ea('0x12a')](this[_0xa0ea('0x21')][_0x4c55b2]['id']);}}}this[_0xa0ea('0xc0')](_0x297974['id'],_0x72a371,0x1,_0x297974[_0xa0ea('0x1fd')],_0x297974)['then'](function(_0xe74a65){if(!checkContactEmpty(_0xe74a65)){checkContactLowerLimitOriginate(_0x297974,0x1,0x0);_0x7ff8d7[_0xa0ea('0xb2')](_0x297974)['then'](sendMessageReschedule(_0x297974))[_0xa0ea('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x297974['message']=_0xa0ea('0x1f7');if(_['isNil'](_0xe74a65[0x0])||_[_0xa0ea('0xac')](_0xe74a65[0x0][_0xa0ea('0x167')])||_[_0xa0ea('0xac')](_0xe74a65[0x0][_0xa0ea('0x167')][_0xa0ea('0x168')])){_0x7ff8d7[_0xa0ea('0x1f9')]('[actionOriginate]\x20',_0x297974,_0xe74a65[0x0]);}else{_0x7ff8d7['checkIsBlackList'](_['pick'](_0xe74a65[0x0],[_0xa0ea('0xd1'),_0xa0ea('0x1ff')]))['then'](_0x7ff8d7['checkContactBlack'](_0x297974,_0xe74a65[0x0]))[_0xa0ea('0xad')](_0x7ff8d7[_0xa0ea('0xcb')](_0xa0ea('0x204'),_0x297974));}}})[_0xa0ea('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0x297974,0x1));emitVoiceQueueSummary(_0x297974);};Dialer[_0xa0ea('0x19')][_0xa0ea('0x1d7')]=function(_0x5b2143,_0x6ea110,_0x250916,_0x571c9a,_0xd2ab99,_0x563654){loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x205'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b2143);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x206'),_0x6ea110);loggerPredictive[_0xa0ea('0x81')]('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',_0x250916);loggerPredictive['info'](_0xa0ea('0x207'),_0x571c9a);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd2ab99);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x86'));return new BPromise(function(_0x5b25e2,_0xc24aed){if(_0x5b2143<=0x0||isNaN(_0x5b2143)){return _0xc24aed(msgResponse(_0xa0ea('0x208'),_0xa0ea('0x4a'),_0xa0ea('0x209')+_0x5b2143));}if(_0x250916<=0x0||isNaN(_0x250916)){return _0xc24aed(msgResponse(_0xa0ea('0x208'),_0xa0ea('0x4a'),'Ts\x20=\x20'+_0x250916));}if(_0x571c9a<=0x0||isNaN(_0x571c9a)){return _0xc24aed(msgResponse(_0xa0ea('0x208'),_0xa0ea('0x4a'),_0xa0ea('0x20a')+_0x571c9a));}if(_0x6ea110<=0x0||isNaN(_0x6ea110)){return _0xc24aed(msgResponse(_0xa0ea('0x208'),_0xa0ea('0x4a'),_0xa0ea('0x20b')+_0x6ea110));}if(_0xd2ab99<=0x0||isNaN(_0xd2ab99)){return _0xc24aed(msgResponse(_0xa0ea('0x208'),_0xa0ea('0x4a'),_0xa0ea('0x20c')+_0xd2ab99));}_0x563654=_0x563654||0x0;var _0x4b0746=0x1/_0x250916;var _0x1b8abf=0x0;var _0x39a15e=0x0;var _0x58c6f5=0x0;var _0x3f664a=0x0;for(var _0x4e8d59=0x0;_0x58c6f5<_0xd2ab99;_0x4e8d59+=0x1){_0x39a15e=_0x4e8d59/_0x6ea110;_0x1b8abf=(_0x571c9a*_0x39a15e+_0x563654)/_0x4b0746;_0x58c6f5=erlangb(_0x1b8abf,_0x5b2143);_0x3f664a=_0x1b8abf/_0x5b2143*(0x1-erlangb(_0x1b8abf,_0x5b2143));}return _0x5b25e2({'erlangCalls':_0x4e8d59,'erlangCallToSecond':_0x6ea110/_0x4e8d59,'erlangAbandonmentRate':_0x58c6f5,'erlangBusyFactor':_0x3f664a});});};Dialer[_0xa0ea('0x19')][_0xa0ea('0x1d9')]=function(_0x5438e0,_0x37fa46,_0x145882,_0x2f8174,_0x15327d,_0x531291){loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x20d'));loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x20e'),_0x5438e0);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37fa46);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x20f'),_0x145882);loggerPredictive['info'](_0xa0ea('0x207'),_0x2f8174);loggerPredictive[_0xa0ea('0x81')](_0xa0ea('0x210'),_0x15327d);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x22b55c,_0x595d){if(_0x5438e0<=0x0||isNaN(_0x5438e0)){return _0x595d(msgResponse(_0xa0ea('0x211'),_0xa0ea('0x4a'),_0xa0ea('0x209')+_0x5438e0));}if(_0x145882<=0x0||isNaN(_0x145882)){return _0x595d(msgResponse(_0xa0ea('0x211'),'Error',_0xa0ea('0x212')+_0x145882));}if(_0x2f8174<=0x0||isNaN(_0x2f8174)){return _0x595d(msgResponse('[busyFactor]',_0xa0ea('0x4a'),_0xa0ea('0x20a')+_0x2f8174));}if(_0x37fa46<=0x0||isNaN(_0x37fa46)){return _0x595d(msgResponse('[busyFactor]','Error',_0xa0ea('0x20b')+_0x37fa46));}if(_0x15327d<=0x0||isNaN(_0x15327d)){return _0x595d(msgResponse('[busyFactor]',_0xa0ea('0x4a'),_0xa0ea('0x213')+_0x15327d));}_0x531291=_0x531291||0x0;var _0x495c36=0x1/_0x145882;var _0xea208a=0x0;var _0x5b85c8=0x0;var _0x3c293a=0x0;var _0x1af08a=0x0;for(var _0x4d8329=0x0;_0x1af08a<_0x15327d;_0x4d8329+=0x1){_0x5b85c8=_0x4d8329/_0x37fa46;_0xea208a=(_0x2f8174*_0x5b85c8+_0x531291)/_0x495c36;_0x3c293a=erlangb(_0xea208a,_0x5438e0);_0x1af08a=_0xea208a/_0x5438e0*(0x1-erlangb(_0xea208a,_0x5438e0));}return _0x22b55c({'erlangCalls':_0x4d8329,'erlangCallToSecond':_0x37fa46/_0x4d8329,'erlangAbandonmentRate':_0x3c293a,'erlangBusyFactor':_0x1af08a});});};module[_0xa0ea('0x214')]=Dialer; \ No newline at end of file +var _0x6b61=['channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','state','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countbusyretry','countnosuchnumberretry','reason19\x20machine....','reason\x2019\x20machine....','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','minutes','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','strategy','locked','paused','stateinterface','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','isArray','push','command','iftime\x20%s,%s','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','finally','originate\x20action\x20Error','getQueue','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','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','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalTotalCalls','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','syncQueueSummary','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumHoldTime','talking','type','abandoned','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','sequence','isNil','Action','status'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x6b61,0x16a));var _0x16b6=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x6b61[_0x1cd674];return _0x27928f;};'use strict';var util=require(_0x16b6('0x0'));var _=require('lodash');var BPromise=require(_0x16b6('0x1'));var uuid=require(_0x16b6('0x2'));var moment=require(_0x16b6('0x3'));var rr=require('rr');var md5=require(_0x16b6('0x4'));var Redis=require(_0x16b6('0x5'));var ut=require(_0x16b6('0x6'));var config=require(_0x16b6('0x7'));var logger=require(_0x16b6('0x8'))('dialer');var loggerBooked=require(_0x16b6('0x8'))(_0x16b6('0x9'));var loggerPredictive=require('../../../config/logger')(_0x16b6('0xa'));var loggerPredictiveCalls=require(_0x16b6('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x16b6('0x8'))(_0x16b6('0xb'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x16b6('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x16b6('0xd'))(new Redis(config[_0x16b6('0xc')]));var cmHopper=require(_0x16b6('0xe'));var cmHopperHistory=require(_0x16b6('0xf'));var cmHopperBlack=require(_0x16b6('0x10'));var voiceQueueRt=require(_0x16b6('0x11'));var Action=require(_0x16b6('0x12'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x16b6('0x13'));var Hangup=require(_0x16b6('0x14'));var ipAgi=process[_0x16b6('0x15')][_0x16b6('0x16')]||_0x16b6('0x17');var strategy={'rrmemory':_0x16b6('0x18'),'roundrobin':_0x16b6('0x19')};var Sequence=function(){};Sequence['prototype'][_0x16b6('0x1a')]=function(_0x581b5a){this['tail']=this['tail']?this['tail']['finally'](_0x581b5a):_0x581b5a();};function Dialer(_0x4833a0,_0xf6ec42){this['sequence']=new Sequence();this['preview']=_0xf6ec42;this['voiceQueues']=_0x4833a0[_0x16b6('0x1b')];this[_0x16b6('0x1c')]=_0x4833a0[_0x16b6('0x1c')];this[_0x16b6('0x1d')]=_0x4833a0[_0x16b6('0x1d')];this[_0x16b6('0x1e')]=_0x4833a0[_0x16b6('0x1e')];this[_0x16b6('0x1f')]=config[_0x16b6('0x1f')]||0x2;this['channels']={};this[_0x16b6('0x20')]={};this['contactsId']={};this[_0x16b6('0x21')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x16b6('0x22')]={};this[_0x16b6('0x23')]={};this[_0x16b6('0x24')]={};this[_0x16b6('0x25')]={};ami['on'](_0x16b6('0x26'),this[_0x16b6('0x27')][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x29'),this['syncQueueCallerAbandon'][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x2a'),this['syncOriginateResponse'][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x2b'),this['syncAgentComplete'][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x2c'),this['syncQueueSummary'][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x2d'),this['syncHangup'][_0x16b6('0x28')](this));ami['on'](_0x16b6('0x2e'),this[_0x16b6('0x2f')][_0x16b6('0x28')](this));ami['on']('varset',this[_0x16b6('0x30')]['bind'](this));ami['on'](_0x16b6('0x31'),this['syncQueueMember'][_0x16b6('0x28')](this));ami['on']('queuestatuscomplete',this[_0x16b6('0x32')][_0x16b6('0x28')](this));this[_0x16b6('0x33')]();this[_0x16b6('0x34')]();}function isNotNull(_0x4e3191){return _0x4e3191!==null&&!_['isUndefined'](_0x4e3191);}function checkIsLoggedIn(_0x278a8c,_0x45b632){return function(){if(_0x45b632<=0x0){_0x278a8c[_0x16b6('0x35')]=_0x16b6('0x36');throw _0x278a8c[_0x16b6('0x37')]+_0x16b6('0x38');}};}function isActive(_0xe2cb73){return _0xe2cb73;}function checkIsActive(_0x25840b,_0x1c870e){return function(){if(!isActive(_0x1c870e)){_0x25840b['message']=_0x16b6('0x39');throw _0x25840b[_0x16b6('0x37')]+_0x16b6('0x3a');}};}function checkInterval(_0x1224b8){return function(){if(!isNotNull(_0x1224b8[_0x16b6('0x3b')])){_0x1224b8[_0x16b6('0x35')]='INTERVAL_IS_NULL';throw _0x1224b8[_0x16b6('0x37')]+_0x16b6('0x3c');}if(!isNotNull(_0x1224b8['Interval'][_0x16b6('0x3d')])){_0x1224b8['message']=_0x16b6('0x3e');throw _0x1224b8[_0x16b6('0x37')]+_0x16b6('0x3c');}if(!isNotNull(_[_0x16b6('0x3f')](_0x1224b8[_0x16b6('0x3b')][_0x16b6('0x3d')]))){_0x1224b8[_0x16b6('0x35')]=_0x16b6('0x3e');throw _0x1224b8[_0x16b6('0x37')]+_0x16b6('0x3c');}};}function msgResponse(_0x12de4b,_0xcbf35f,_0x1dab40){return{'action':_0x12de4b,'response':_0xcbf35f,'message':_0x1dab40,'stack':_0x1dab40};}function myreject(_0x3197de){return function(_0x2b8501){return _0x3197de(msgResponse(_0x16b6('0x40'),_0x16b6('0x41'),JSON[_0x16b6('0x42')](_0x2b8501)));};}function getSeconds(_0x5a8be3,_0x540d28){var _0x71e904=moment(_0x5a8be3)[_0x16b6('0x43')](0x0);var _0x216d95=moment(_0x540d28)[_0x16b6('0x43')](0x0);return _0x71e904['diff'](_0x216d95,_0x16b6('0x44'));}function emit(_0x3b99e7,_0x5c7ee2,_0x386f9d){io['to'](_0x3b99e7)[_0x16b6('0x45')](_0x5c7ee2,_0x386f9d);}function emitVoiceQueueSummary(_0xa53482){if(_0xa53482['type']===_0x16b6('0x46')){var _0x56e1d7={'id':_0xa53482['id'],'name':_0xa53482[_0x16b6('0x37')],'strategy':_0xa53482['strategy'],'answered':_0xa53482[_0x16b6('0x47')],'available':_0xa53482[_0x16b6('0x48')],'loggedIn':_0xa53482[_0x16b6('0x49')],'pTalking':_0xa53482[_0x16b6('0x4a')],'sumBillable':_0xa53482['sumBillable'],'sumDuration':_0xa53482['sumDuration'],'sumHoldTime':_0xa53482[_0x16b6('0x4b')]||0x0,'talking':_0xa53482[_0x16b6('0x4c')],'total':_0xa53482['total'],'type':_0xa53482[_0x16b6('0x4d')],'unmanaged':_0xa53482['unmanaged'],'abandoned':_0xa53482[_0x16b6('0x4e')],'waiting':_0xa53482['waiting'],'loggedInDb':_0xa53482['loggedInDb'],'dialActive':_0xa53482[_0x16b6('0x4f')],'dialMethod':_0xa53482['dialMethod'],'dialOriginateCallerIdName':_0xa53482[_0x16b6('0x50')],'dialOriginateCallerIdNumber':_0xa53482[_0x16b6('0x51')],'dialOriginateTimeout':_0xa53482[_0x16b6('0x52')],'dialPrefix':_0xa53482[_0x16b6('0x53')],'outboundAnswerAgiCallsDay':_0xa53482[_0x16b6('0x54')],'outboundAnswerCallsDay':_0xa53482[_0x16b6('0x55')],'outboundBlacklistCallsDay':_0xa53482[_0x16b6('0x56')],'outboundBusyCallsDay':_0xa53482[_0x16b6('0x57')],'outboundCongestionCallsDay':_0xa53482[_0x16b6('0x58')],'outboundDropCallsDayACS':_0xa53482[_0x16b6('0x59')],'outboundDropCallsDayCallersExit':_0xa53482[_0x16b6('0x5a')],'outboundDropCallsDayTimeout':_0xa53482[_0x16b6('0x5b')],'outboundNoAnswerCallsDay':_0xa53482[_0x16b6('0x5c')],'outboundNoSuchCallsDay':_0xa53482[_0x16b6('0x5d')],'outboundOriginateFailureCallsDay':_0xa53482[_0x16b6('0x5e')],'outboundReCallsDay':_0xa53482[_0x16b6('0x5f')],'outboundRejectCallsDay':_0xa53482[_0x16b6('0x60')],'outboundUnknownCallsDay':_0xa53482[_0x16b6('0x61')],'predictiveIntervalAnsweredCalls':_0xa53482['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xa53482['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xa53482['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xa53482[_0x16b6('0x62')],'predictiveIntervalDroppedCallsTimeout':_0xa53482['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xa53482['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xa53482[_0x16b6('0x63')],'predictiveIntervalHitRate':_0xa53482[_0x16b6('0x64')],'predictiveIntervalMultiplicativeFactor':_0xa53482['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xa53482[_0x16b6('0x65')],'predictiveIntervalAvailable':_0xa53482[_0x16b6('0x66')],'predictiveIntervalTotalCalls':_0xa53482['predictiveIntervalTotalCalls'],'message':_0xa53482[_0x16b6('0x35')],'originated':_0xa53482[_0x16b6('0x67')],'erlangCalls':_0xa53482[_0x16b6('0x68')],'erlangCallToSecond':_0xa53482['erlangCallToSecond'],'erlangAbandonmentRate':_0xa53482[_0x16b6('0x69')],'erlangBusyFactor':_0xa53482[_0x16b6('0x6a')],'startPredictive':_0xa53482[_0x16b6('0x6b')],'startProgressive':_0xa53482['startProgressive']};if(_0xa53482[_0x16b6('0x6c')]){_0x56e1d7['Trunk']={'id':_0xa53482[_0x16b6('0x6c')]['id'],'name':_0xa53482[_0x16b6('0x6c')][_0x16b6('0x37')],'active':_0xa53482[_0x16b6('0x6c')][_0x16b6('0x6d')],'callerid':_0xa53482['Trunk'][_0x16b6('0x6e')]};}if(_0xa53482[_0x16b6('0x3b')]){_0x56e1d7[_0x16b6('0x3b')]={'id':_0xa53482['Interval']['id'],'name':_0xa53482[_0x16b6('0x3b')][_0x16b6('0x37')]};}var _0x53d2ca=md5(JSON[_0x16b6('0x42')](_0x56e1d7));if(_0xa53482[_0x16b6('0x4')]!==_0x53d2ca){_0xa53482['md5']=_0x53d2ca;emit(util['format'](_0x16b6('0x6f'),_0x56e1d7[_0x16b6('0x37')]),_0x16b6('0x70'),_0x56e1d7);}}}function emitCampaignSummary(_0x12e72b){if(_0x12e72b[_0x16b6('0x4d')]===_0x16b6('0x71')){emit(util[_0x16b6('0x72')]('campaign:ivr:%s',_0x12e72b[_0x16b6('0x37')]),_0x16b6('0x73'),_0x12e72b);}}function checkGetDataPredictive(_0x5a5006){if(isNotNull(_0x5a5006)&&!_[_0x16b6('0x3f')](_0x5a5006)){loggerPredictive[_0x16b6('0x74')](_0x16b6('0x75'));loggerPredictive[_0x16b6('0x74')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a5006['predictiveIntervalTotalCalls']);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x76'),_0x5a5006[_0x16b6('0x77')]);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x78'),_0x5a5006[_0x16b6('0x79')]);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x7a'),_0x5a5006[_0x16b6('0x62')]);loggerPredictive['info'](_0x16b6('0x7b'),_0x5a5006[_0x16b6('0x7c')]);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x7d'),_0x5a5006[_0x16b6('0x7e')]);loggerPredictive['info'](_0x16b6('0x7f'));if(_0x5a5006['predictiveIntervalTotalCalls']>0x0){if(!_[_0x16b6('0x80')](_0x5a5006[_0x16b6('0x7e')])&&_0x5a5006[_0x16b6('0x7e')]>0x0){return!![];}loggerPredictive[_0x16b6('0x74')](_0x16b6('0x81'));if(!_['isUndefined'](_0x5a5006[_0x16b6('0x7c')])&&_0x5a5006[_0x16b6('0x7c')]>0x0){return!![];}loggerPredictive[_0x16b6('0x74')](_0x16b6('0x82'));}else{loggerPredictive[_0x16b6('0x74')](_0x16b6('0x83'));}}else{loggerPredictive[_0x16b6('0x74')](_0x16b6('0x84'));}return![];}function mergeDataErlangB(_0x31c6b6){return function(_0x314403){loggerPredictive[_0x16b6('0x74')](_0x16b6('0x85'));loggerPredictive[_0x16b6('0x74')](_0x16b6('0x86'),_0x314403[_0x16b6('0x68')]);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x87'),_0x314403[_0x16b6('0x88')]);loggerPredictive[_0x16b6('0x74')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x314403[_0x16b6('0x69')]);loggerPredictive[_0x16b6('0x74')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x314403[_0x16b6('0x6a')]);loggerPredictive[_0x16b6('0x74')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x314403[_0x16b6('0x69')]);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x7f'));_[_0x16b6('0x89')](_0x31c6b6,_0x314403);};}function getDiff(_0x4bc42b){var _0x4c70d4=moment()[_0x16b6('0x43')](0x0);var _0xe59cc5=moment(_0x4bc42b)[_0x16b6('0x43')](0x0);return _0x4c70d4[_0x16b6('0x8a')](_0xe59cc5,_0x16b6('0x44'));}function ifInterval(_0x57ad91,_0x2491a4){if(_[_0x16b6('0x80')](_0x2491a4)){return![];}return getDiff(_0x2491a4)<_0x57ad91*0x3c;}function freeVariablesPredictive(_0x3f26a0){if(isNotNull(_0x3f26a0)){if(!_[_0x16b6('0x80')](_0x3f26a0[_0x16b6('0x22')])){_0x3f26a0[_0x16b6('0x22')]=undefined;loggerPredictive[_0x16b6('0x74')](_0x3f26a0[_0x16b6('0x37')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x16b6('0x80')](_0x3f26a0[_0x16b6('0x6b')])){_0x3f26a0[_0x16b6('0x6b')]=undefined;loggerPredictive[_0x16b6('0x74')](_0x3f26a0[_0x16b6('0x37')],_0x16b6('0x8b'));}if(!_['isUndefined'](_0x3f26a0['handlePredictive'])){clearInterval(_0x3f26a0[_0x16b6('0x8c')]);_0x3f26a0['handlePredictive']=undefined;loggerPredictive[_0x16b6('0x74')](_0x3f26a0[_0x16b6('0x37')],_0x16b6('0x8d'));}}}function erlangb(_0x474623,_0x2bf2da){if(_0x2bf2da===0x0){return 0x0;}var _0x348fa8=0x1;for(var _0x26c2c3=0x1;_0x26c2c3<=_0x2bf2da;_0x26c2c3+=0x1){_0x348fa8=0x1+_0x348fa8*_0x26c2c3/_0x474623;}return 0x1/_0x348fa8;}function isVoiceQueueOutbound(_0x2273aa){return _0x2273aa===_0x16b6('0x46');}function isNotPreview(_0x21d9e6){return _0x21d9e6!==_0x16b6('0x8e');}function isCampaignIvr(_0x3e099a){return _0x3e099a===_0x16b6('0x71');}function getCallerId(_0x4b1912,_0x5a53c7,_0x55e2f6){if(!_['isUndefined'](_0x55e2f6)&&typeof _0x55e2f6==='string'&&!_[_0x16b6('0x3f')](_0x55e2f6)){if(!_[_0x16b6('0x80')](_0x5a53c7)&&typeof _0x5a53c7==='string'&&!_[_0x16b6('0x3f')](_0x5a53c7)){return util['format']('\x22%s\x22\x20<%s>',_0x5a53c7,_0x55e2f6);}return util[_0x16b6('0x72')](_0x16b6('0x8f'),_0x55e2f6,_0x55e2f6);}if(!_[_0x16b6('0x80')](_0x4b1912)&&typeof _0x4b1912===_0x16b6('0x90')&&!_[_0x16b6('0x3f')](_0x4b1912)){return _0x4b1912;}return _0x16b6('0x91');}function loggerCatchQueueSummary(_0x53a85e,_0x4bbcb8){return function(_0x506b0f){freeVariablesPredictive(_0x4bbcb8);emitVoiceQueueSummary(_0x4bbcb8);emitCampaignSummary(_0x4bbcb8);loggerSyncQueueSummary[_0x16b6('0x92')](_0x53a85e,util[_0x16b6('0x93')](_0x506b0f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x17035a,_0x541a5c){return function(_0x398e6f){loggerPredictive[_0x16b6('0x92')](_0x541a5c[_0x16b6('0x37')],_0x17035a);loggerPredictive['error'](_0x398e6f['stack']);freeVariablesPredictive(_0x541a5c);};}function loggerCatch(_0x14cea1){return function(_0x18193f){logger[_0x16b6('0x92')](_0x14cea1,util[_0x16b6('0x93')](_0x18193f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x8eeb1){return _0x8eeb1&&!_[_0x16b6('0x80')](_0x8eeb1)&&_0x8eeb1['length']>0x0;}function decremetOriginate(_0x1589ae){if(!_[_0x16b6('0x80')](_0x1589ae)&&_0x1589ae!==null){if(typeof _0x1589ae['originated']!==_0x16b6('0x94')){if(_0x1589ae[_0x16b6('0x67')]>0x0){_0x1589ae[_0x16b6('0x67')]-=0x1;}else{logger['error'](_0x16b6('0x95'));}}}else{logger[_0x16b6('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x419e42,_0x50bfaf,_0x53f6d3){if(_0x50bfaf>_0x53f6d3){for(var _0x3f86d1=0x0;_0x3f86d1<_0x50bfaf-_0x53f6d3;_0x3f86d1+=0x1){decremetOriginate(_0x419e42);}}}function loggerGetContactDialer(_0x1ee3e6,_0x19785d,_0xcfe195){return function(_0x194997){checkContactLowerLimitOriginate(_0x19785d,_0xcfe195,0x0);logger[_0x16b6('0x92')](_0x1ee3e6,util[_0x16b6('0x93')](_0x194997,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xa30560){return function(_0x593b0f){if(isNotNull(_0x593b0f)&&isNotNull(_0x593b0f[0x0])){if(_0x593b0f[0x0][_0x16b6('0x96')]>0x0){_0xa30560[_0x16b6('0x35')]=_0x16b6('0x97');logger['info'](_0x16b6('0x98')+_0xa30560[_0x16b6('0x37')],_0x593b0f[0x0][_0x16b6('0x96')],'contacts');}else{_0xa30560[_0x16b6('0x35')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x16b6('0x74')]('[getContactDialer2][Empty]'+_0xa30560[_0x16b6('0x37')]);}}};}function notSendMessagesQueue(_0x253997){if(_0x253997['sendMessageOneNotActive']){freeVariablesPredictive(_0x253997);if(_0x253997['originated']===0x0&&_0x253997[_0x16b6('0x4c')]===0x0&&_0x253997[_0x16b6('0x99')]===0x0&&(_0x253997[_0x16b6('0x4a')]||0x0)===0x0){_0x253997['sendMessageOneNotActive']=![];_0x253997[_0x16b6('0x48')]=0x0;_0x253997[_0x16b6('0x35')]=_0x16b6('0x39');loggerSyncQueueSummary[_0x16b6('0x92')](_0x16b6('0x9a'),_0x253997[_0x16b6('0x37')],_0x16b6('0x9b'));}else{_0x253997[_0x16b6('0x35')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x16b6('0x92')](_0x16b6('0x9a'),_0x253997[_0x16b6('0x37')],_0x16b6('0x9c'));}emitVoiceQueueSummary(_0x253997);}}function notSendMessagesCampaign(_0xf68b98){if(_0xf68b98[_0x16b6('0x9d')]){if(_0xf68b98[_0x16b6('0x67')]===0x0){_0xf68b98[_0x16b6('0x9d')]=![];_0xf68b98['message']=_0x16b6('0x39');loggerSyncQueueSummary['error'](_0x16b6('0x9e'),_0xf68b98[_0x16b6('0x37')],'is\x20not\x20active');}else{_0xf68b98[_0x16b6('0x35')]=_0x16b6('0x9f');loggerSyncQueueSummary[_0x16b6('0x92')](_0x16b6('0x9e'),_0xf68b98[_0x16b6('0x37')],_0x16b6('0x9c'));}emitCampaignSummary(_0xf68b98);}}function createObjHistory(_0x41c184,_0x2f34bb,_0x3649dd,_0x300f32,_0x17d075){_0x41c184[_0x16b6('0x35')]=_0x3649dd;var _0xb2a704=new Action(_0x41c184,_0x2f34bb);var _0xd253f9=new History(_0xb2a704);_0xd253f9['state']=_0x300f32;_0xd253f9[_0x16b6('0xa0')]=_0x17d075;_0xd253f9[_0x16b6('0xa1')]=_0xb2a704[_0x16b6('0xa2')];return _0xd253f9;}Dialer[_0x16b6('0xa3')][_0x16b6('0x34')]=function(){var _0x417935=this;setInterval(function(){_0x417935['clearZombieChannels'](_0x417935[_0x16b6('0x21')],_0x16b6('0xa4'));_0x417935[_0x16b6('0xa5')](_0x417935[_0x16b6('0x20')],'[actions]');},0x32c8);};Dialer['prototype'][_0x16b6('0xa5')]=function(_0x2563cc,_0x2dfaad){var _0x14dac0=this;for(var _0x14b476 in _0x2563cc){if(typeof _0x2563cc[_0x14b476]!==_0x16b6('0x94')){this[_0x16b6('0xa6')][_0x16b6('0x1a')](function(){if(!_[_0x16b6('0xa7')](_0x2563cc[_0x14b476])){return ami[_0x16b6('0xa8')]({'action':_0x16b6('0xa9'),'channel':_0x2563cc[_0x14b476][_0x16b6('0xaa')]})['catch'](function(_0x1ad3be){if(_0x1ad3be['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x2563cc[_0x14b476]&&_0x2563cc[_0x14b476]['type']!==_0x16b6('0x71')){_0x14dac0[_0x16b6('0xab')](_0x14dac0[_0x16b6('0x1b')][_0x2563cc[_0x14b476][_0x16b6('0xac')]]);logger[_0x16b6('0x92')](_0x16b6('0xad'),_0x2dfaad,_0x14b476,_0x2563cc[_0x14b476][_0x16b6('0xac')]);delete _0x2563cc[_0x14b476];}if(_0x2563cc[_0x14b476]&&_0x2563cc[_0x14b476][_0x16b6('0x4d')]===_0x16b6('0x71')){_0x14dac0['updateOriginated'](_0x14dac0[_0x16b6('0x1c')][_0x2563cc[_0x14b476][_0x16b6('0xac')]]);logger['error'](_0x16b6('0xae'),_0x2dfaad,_0x14b476,_0x2563cc[_0x14b476]['queue']);delete _0x2563cc[_0x14b476];}},0x2328);}});}});}}};Dialer[_0x16b6('0xa3')][_0x16b6('0xaf')]=function(_0x1923ed){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopper['countReScheduled'](_0x1923ed))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xb3')));};Dialer[_0x16b6('0xa3')][_0x16b6('0xb4')]=function(_0x503ef7){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopperBlack[_0x16b6('0xb4')](_0x503ef7))['catch'](loggerCatch(_0x16b6('0xb5')));};Dialer[_0x16b6('0xa3')]['checkIsBlackListIvr']=function(_0x3c5e96){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopperBlack[_0x16b6('0xb6')](_0x3c5e96))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xb7')));};Dialer[_0x16b6('0xa3')][_0x16b6('0xb8')]=function(_0x3449fb){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopperHistory['avgHandleTime'](_0x3449fb))['catch'](loggerCatch(_0x16b6('0xb9')));};Dialer['prototype'][_0x16b6('0xba')]=function(_0x3f0e0c){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopper[_0x16b6('0xba')](_0x3f0e0c))[_0x16b6('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x16b6('0xbb')]=function(_0x346b47,_0x47bfe0,_0x508d79){return BPromise[_0x16b6('0xb0')]()['then'](cmHopper[_0x16b6('0xbb')](_0x346b47,_0x47bfe0,_0x508d79))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xbc')));};Dialer[_0x16b6('0xa3')]['getContactDialer']=function(_0x1d27df,_0x4ce897,_0x1ae121,_0x47d11d,_0x2d4208){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopper[_0x16b6('0xbd')](_0x1d27df,_0x4ce897,_0x1ae121,_0x47d11d))['catch'](function(_0xe3fc5b){_0x2d4208[_0x16b6('0xbe')]-=_0x1ae121;_0x2d4208['temp']=_0x2d4208['temp']>0x0?_0x2d4208[_0x16b6('0xbe')]:0x0;loggerCatch('[getContactDialer]\x20')(_0xe3fc5b);});};Dialer[_0x16b6('0xa3')][_0x16b6('0xbf')]=function(_0x224359,_0x1ca77a,_0x118986,_0x4c6902){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](cmHopper[_0x16b6('0xbf')](_0x224359,_0x1ca77a,_0x118986))[_0x16b6('0xb2')](function(_0x57fd1a){_0x4c6902[_0x16b6('0xbe')]-=_0x1ca77a;_0x4c6902[_0x16b6('0xbe')]=_0x4c6902[_0x16b6('0xbe')]>0x0?_0x4c6902[_0x16b6('0xbe')]:0x0;loggerCatch(_0x16b6('0xc0'))(_0x57fd1a);});};Dialer[_0x16b6('0xa3')][_0x16b6('0xc1')]=function(_0x11ff4c){return BPromise[_0x16b6('0xb0')]()[_0x16b6('0xb1')](voiceQueueRt['getVoiceQueueRtPauses'](_0x11ff4c))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xc2')));};Dialer[_0x16b6('0xa3')]['moveContactManagedDialer']=function(_0x5ecf76){return BPromise['resolve']()[_0x16b6('0xb1')](cmHopper[_0x16b6('0xc3')](_0x5ecf76))[_0x16b6('0xb2')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x16b6('0xc4')]=function(_0x13485c){return BPromise['resolve']()['then'](cmHopperHistory[_0x16b6('0xc4')](_0x13485c))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xc5')));};Dialer[_0x16b6('0xa3')]['updateOriginated']=function(_0x5083b8){if(!_[_0x16b6('0x80')](_0x5083b8)&&_0x5083b8!==null){if(typeof _0x5083b8['originated']!=='undefined'){if(_0x5083b8[_0x16b6('0x67')]>0x0){_0x5083b8['originated']-=0x1;}else{logger[_0x16b6('0x92')](_0x16b6('0xc6'));}}}else{logger[_0x16b6('0x92')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x16b6('0xa3')][_0x16b6('0xc7')]=function(_0x16c748,_0x432889){var _0x45060b=this;return function(_0x5da4bd){_0x45060b[_0x16b6('0xab')](_0x432889);logger['error'](_0x16c748,util[_0x16b6('0x93')](_0x5da4bd,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x16b6('0xc8')]=function(_0x4e9145,_0x1070c9,_0xc6c97d){var _0x4b61be={'state':0x19,'statedesc':'notFound'};this[_0x16b6('0xab')](_0x1070c9);this[_0x16b6('0xc9')](_[_0x16b6('0x89')](_0x4b61be,_['pick'](_0xc6c97d,['ContactId',_0x16b6('0xca'),_0x16b6('0xcb'),_0x16b6('0xcc'),_0x16b6('0xcd')])),'[emptyContact][createHistory]',_0x16b6('0xce'));logger[_0x16b6('0x92')](_0x4e9145);};Dialer['prototype'][_0x16b6('0xcf')]=function(_0x20578a){return _0x20578a===_0x16b6('0xd0');};Dialer[_0x16b6('0xa3')]['isTrunkReachable']=function(_0x2488c8){return!_[_0x16b6('0x80')](_0x2488c8)&&_0x2488c8&&!_[_0x16b6('0x80')](_0x2488c8[_0x16b6('0x37')])&&!_[_0x16b6('0x80')](_0x2488c8[_0x16b6('0x6d')])&&_0x2488c8['active']&&(this[_0x16b6('0x1e')][util[_0x16b6('0x72')](_0x16b6('0xd1'),_0x2488c8['name'])]['status']===_0x16b6('0xd2')||this[_0x16b6('0x1e')][util[_0x16b6('0x72')](_0x16b6('0xd1'),_0x2488c8['name'])]['status']===_0x16b6('0xd3'));};Dialer[_0x16b6('0xa3')][_0x16b6('0xc9')]=function(_0xc55019,_0x519c1b,_0x5a0229){this['createHistory'](_0xc55019)[_0x16b6('0xb2')](loggerCatch(_0x519c1b));this['moveContactManagedDialer'](_0xc55019)[_0x16b6('0xb2')](loggerCatch(_0x5a0229));};Dialer[_0x16b6('0xa3')][_0x16b6('0x30')]=function(_0x102755){var _0x488ddd=this[_0x16b6('0x21')][_0x102755[_0x16b6('0xd4')]];var _0x2e229f;if(!_[_0x16b6('0xa7')](_0x102755)&&!_[_0x16b6('0xa7')](_0x102755[_0x16b6('0xd5')])&&!_[_0x16b6('0xa7')](_0x102755[_0x16b6('0xd5')][_0x16b6('0xd6')])&&_0x102755[_0x16b6('0xd7')]===_0x16b6('0xd8')&&_0x488ddd){if(_0x488ddd[_0x16b6('0x4d')]!=='ivr'&&this[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0xd9')]&&_0x102755[_0x16b6('0xda')]==='HANGUP'){delete this[_0x16b6('0x21')][_0x102755[_0x16b6('0xd4')]];this[_0x16b6('0xab')](this[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]]);this[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]]['outboundAnswerCallsDay']+=0x1;this[_0x16b6('0x1b')][_0x488ddd['queue']][_0x16b6('0x54')]+=0x1;_0x2e229f=new Hangup(_0x488ddd,_0x102755);_0x2e229f['state']=0x12;_0x2e229f[_0x16b6('0xa0')]='HangupInAMD';_0x2e229f[_0x16b6('0xdb')]=_0x16b6('0xdc');ami[_0x16b6('0x45')](_0x16b6('0xdd'),ut[_0x16b6('0xde')](_0x2e229f,_0x16b6('0xdf')));this['saveInDb'](_0x2e229f,_0x16b6('0xe0'),_0x16b6('0xe1'));}if(_0x488ddd[_0x16b6('0x4d')]!==_0x16b6('0x71')&&this[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0xd9')]&&_0x102755[_0x16b6('0xda')]==='MACHINE'){var _0x552a51=this;return new BPromise(function(_0x2b44c7,_0x3e94f6){delete _0x552a51['uniqueId'][_0x102755[_0x16b6('0xd4')]];_0x552a51['updateOriginated'](_0x552a51[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]]);_0x552a51[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0x55')]+=0x1;_0x552a51[_0x16b6('0x1b')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0x54')]+=0x1;var _0x262b13=_0x552a51[_0x16b6('0x1b')][_0x488ddd['queue']];var _0x4086ec=new Hangup(_0x488ddd,_0x102755);_0x4086ec[_0x16b6('0xe2')]=0x13;_0x4086ec['statedesc']=_0x16b6('0xe3');_0x4086ec['membername']=_0x16b6('0xdc');_0x4086ec[_0x16b6('0xe4')]+=0x1;_0x4086ec[_0x16b6('0xe5')]+=0x1;_0x4086ec['amd']=!![];ami['emit'](_0x16b6('0xdd'),ut[_0x16b6('0xde')](_0x4086ec,_0x16b6('0xdf')));_0x552a51['createHistory'](_0x4086ec)['catch'](loggerCatch(_0x16b6('0xe6')));if(_0x4086ec['countbusyretry']+_0x4086ec[_0x16b6('0xe7')]+_0x4086ec[_0x16b6('0xe8')]+_0x4086ec['countnosuchnumberretry']+_0x4086ec[_0x16b6('0xe9')]+_0x4086ec[_0x16b6('0xea')]+_0x4086ec[_0x16b6('0xe4')]+_0x4086ec[_0x16b6('0xeb')]>=_0x262b13['dialGlobalMaxRetry']){_0x552a51[_0x16b6('0xec')](_0x4086ec,_0x2b44c7,_0x3e94f6,'reason19\x20machine....');}else{if(_0x4086ec[_0x16b6('0xe4')]>=_0x262b13[_0x16b6('0xed')]){_0x552a51[_0x16b6('0xee')](_0x4086ec,_0x2b44c7,_0x3e94f6,'reason\x2019\x20machine....');}else{_0x552a51[_0x16b6('0xba')]({'active':![],'countmachineretry':_0x4086ec[_0x16b6('0xe4')],'scheduledat':moment()[_0x16b6('0xef')](_0x262b13[_0x16b6('0xf0')],'minutes')['format'](_0x16b6('0xf1')),'ContactId':_0x4086ec[_0x16b6('0xf2')],'ListId':_0x4086ec[_0x16b6('0xca')],'VoiceQueueId':_0x4086ec[_0x16b6('0xcc')]||undefined,'CampaignId':_0x4086ec['CampaignId']||undefined})[_0x16b6('0xb2')](loggerCatch('[rescheduleContact][Machine]'));_0x2b44c7({'reschedule':0x1});}}});}if(_0x488ddd['type']==='ivr'&&this[_0x16b6('0x1c')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0xd9')]&&_0x102755[_0x16b6('0xda')]==='HANGUP'){delete this['uniqueId'][_0x102755[_0x16b6('0xd4')]];this[_0x16b6('0xab')](this['campaigns'][_0x488ddd[_0x16b6('0xac')]]);_0x2e229f=new Hangup(_0x488ddd,_0x102755);_0x2e229f[_0x16b6('0xe2')]=0x12;_0x2e229f[_0x16b6('0xa0')]=_0x16b6('0xf3');_0x2e229f[_0x16b6('0xdb')]=_0x16b6('0xdc');ami['emit'](_0x16b6('0xdd'),ut['buildObj'](_0x2e229f,_0x16b6('0xdf')));this[_0x16b6('0xc9')](_0x2e229f,_0x16b6('0xf4'),_0x16b6('0xf5'));}if(_0x488ddd['type']==='ivr'&&this[_0x16b6('0x1c')][_0x488ddd['queue']][_0x16b6('0xd9')]&&_0x102755[_0x16b6('0xda')]===_0x16b6('0xf6')){var _0x552a51=this;return new BPromise(function(_0x4812c0,_0x12f4cc){delete _0x552a51['uniqueId'][_0x102755[_0x16b6('0xd4')]];_0x552a51['updateOriginated'](_0x552a51[_0x16b6('0x1c')][_0x488ddd[_0x16b6('0xac')]]);_0x552a51[_0x16b6('0x1c')][_0x488ddd[_0x16b6('0xac')]][_0x16b6('0x55')]+=0x1;_0x552a51['campaigns'][_0x488ddd['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x541637=_0x552a51[_0x16b6('0x1c')][_0x488ddd[_0x16b6('0xac')]];var _0x5fd758=new Hangup(_0x488ddd,_0x102755);_0x5fd758['state']=0x13;_0x5fd758[_0x16b6('0xa0')]=_0x16b6('0xe3');_0x5fd758['membername']=_0x16b6('0xdc');_0x5fd758[_0x16b6('0xe4')]+=0x1;_0x5fd758[_0x16b6('0xe5')]+=0x1;_0x5fd758['amd']=!![];ami[_0x16b6('0x45')](_0x16b6('0xdd'),ut[_0x16b6('0xde')](_0x5fd758,_0x16b6('0xdf')));_0x552a51[_0x16b6('0xc4')](_0x5fd758)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xe6')));if(_0x5fd758[_0x16b6('0xf7')]+_0x5fd758[_0x16b6('0xe7')]+_0x5fd758[_0x16b6('0xe8')]+_0x5fd758[_0x16b6('0xf8')]+_0x5fd758[_0x16b6('0xe9')]+_0x5fd758[_0x16b6('0xea')]+_0x5fd758[_0x16b6('0xe4')]+_0x5fd758[_0x16b6('0xeb')]>=_0x541637['dialGlobalMaxRetry']){_0x552a51[_0x16b6('0xec')](_0x5fd758,_0x4812c0,_0x12f4cc,_0x16b6('0xf9'));}else{if(_0x5fd758[_0x16b6('0xe4')]>=_0x541637['dialMachineMaxRetry']){_0x552a51[_0x16b6('0xee')](_0x5fd758,_0x4812c0,_0x12f4cc,_0x16b6('0xfa'));}else{_0x552a51[_0x16b6('0xba')]({'active':![],'countmachineretry':_0x5fd758[_0x16b6('0xe4')],'scheduledat':moment()[_0x16b6('0xef')](_0x541637['dialMachineRetryFrequency'],'minutes')['format'](_0x16b6('0xf1')),'ContactId':_0x5fd758[_0x16b6('0xf2')],'ListId':_0x5fd758['ListId'],'VoiceQueueId':_0x5fd758[_0x16b6('0xcc')]||undefined,'CampaignId':_0x5fd758[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xfb')));_0x4812c0({'reschedule':0x1});}}});}}};Dialer[_0x16b6('0xa3')][_0x16b6('0xfc')]=function(_0x1c7408){var _0x1c2463=this['uniqueId'][_0x1c7408[_0x16b6('0xd4')]];var _0x4ddfc0=this;var _0x28ca1e;if(_0x1c2463&&_0x1c2463[_0x16b6('0x4d')]===_0x16b6('0x71')){delete this[_0x16b6('0x21')][_0x1c7408['uniqueid']];this[_0x16b6('0xab')](this['campaigns'][_0x1c2463[_0x16b6('0xac')]]);this[_0x16b6('0x1c')][_0x1c2463[_0x16b6('0xac')]][_0x16b6('0xfd')]+=0x1;_0x28ca1e=new Hangup(_0x1c2463,_0x1c7408);this[_0x16b6('0xc4')](_0x28ca1e)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xfe')));this[_0x16b6('0xc3')](_0x28ca1e)['catch'](loggerCatch(_0x16b6('0xff')));}if(_0x1c2463&&_0x1c2463[_0x16b6('0x4d')]!==_0x16b6('0x71')&&isNotNull(this['voiceQueues'][_0x1c2463[_0x16b6('0xac')]]['dialQueueProject'])){delete this[_0x16b6('0x21')][_0x1c7408[_0x16b6('0xd4')]];this[_0x16b6('0xab')](this[_0x16b6('0x1b')][_0x1c2463[_0x16b6('0xac')]]);this['voiceQueues'][_0x1c2463[_0x16b6('0xac')]][_0x16b6('0x55')]+=0x1;this[_0x16b6('0x1b')][_0x1c2463[_0x16b6('0xac')]]['outboundAnswerAgiCallsDay']+=0x1;_0x28ca1e=new Hangup(_0x1c2463,_0x1c7408);_0x28ca1e[_0x16b6('0xe2')]=0x10;_0x28ca1e[_0x16b6('0xa0')]=_0x16b6('0x100');_0x28ca1e[_0x16b6('0xdb')]='AGI';this['createHistory'](_0x28ca1e)[_0x16b6('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x16b6('0xc3')](_0x28ca1e)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1c2463&&_0x1c2463[_0x16b6('0x4d')]!==_0x16b6('0x71')&&!isNotNull(this[_0x16b6('0x1b')][_0x1c2463[_0x16b6('0xac')]][_0x16b6('0x101')])){delete this[_0x16b6('0x21')][_0x1c7408[_0x16b6('0xd4')]];this[_0x16b6('0xab')](this['voiceQueues'][_0x1c2463[_0x16b6('0xac')]]);this['voiceQueues'][_0x1c2463[_0x16b6('0xac')]][_0x16b6('0x61')]+=0x1;_0x28ca1e=new Hangup(_0x1c2463,_0x1c7408);_0x28ca1e[_0x16b6('0xe2')]=0xc;_0x28ca1e[_0x16b6('0xa0')]=_0x1c7408[_0x16b6('0x102')];_0x28ca1e[_0x16b6('0xdb')]=_0x16b6('0x103');this[_0x16b6('0xc4')](_0x28ca1e)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xfe')));this[_0x16b6('0xc3')](_0x28ca1e)[_0x16b6('0xb2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x16b6('0xa3')][_0x16b6('0x104')]=function(_0x343774){var _0xb30ab3=this[_0x16b6('0x21')][_0x343774[_0x16b6('0xd4')]];var _0x5c76fe=this;if(this[_0x16b6('0x1b')][_0x343774['queue']]){if(_0xb30ab3&&_0xb30ab3[_0x16b6('0x4d')]!==_0x16b6('0x71')){delete this['uniqueId'][_0x343774['uniqueid']];this[_0x16b6('0x1b')][_0x343774[_0x16b6('0xac')]][_0x16b6('0x55')]+=0x1;var _0x54ef65=new AgentComplete(_0xb30ab3,_0x343774);if(_0x343774[_0x16b6('0x105')]==='agent'){_0x54ef65['agiafterat']=this['voiceQueues'][_0x343774[_0x16b6('0xac')]][_0x16b6('0x106')]&&this[_0x16b6('0x1b')][_0x343774[_0x16b6('0xac')]][_0x16b6('0x107')]?moment()[_0x16b6('0x72')](_0x16b6('0xf1')):undefined;}this[_0x16b6('0xc4')](_0x54ef65)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x108')));this[_0x16b6('0xc3')](_0x54ef65)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x109')));}}};Dialer[_0x16b6('0xa3')][_0x16b6('0x27')]=function(_0x243ff7){if(this[_0x16b6('0x1b')][_0x243ff7[_0x16b6('0xac')]]){if(this['uniqueId'][_0x243ff7[_0x16b6('0xd4')]]&&this[_0x16b6('0x21')][_0x243ff7[_0x16b6('0xd4')]][_0x16b6('0x4d')]!==_0x16b6('0x71')){this['updateOriginated'](this[_0x16b6('0x1b')][_0x243ff7[_0x16b6('0xac')]]);this[_0x16b6('0x21')][_0x243ff7['uniqueid']][_0x16b6('0x10a')]=moment()['format'](_0x16b6('0xf1'));}}};Dialer['prototype'][_0x16b6('0x10b')]=function(_0x3ec683){this[_0x16b6('0xc4')](_0x3ec683)['catch'](loggerCatch(_0x16b6('0x108')));this[_0x16b6('0xc3')](_0x3ec683)[_0x16b6('0xb2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x16b6('0xa3')][_0x16b6('0x10c')]=function(_0x1e831a){var _0x4781b9=this[_0x16b6('0x21')][_0x1e831a[_0x16b6('0xd4')]];var _0x25e863=this;if(this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]]){if(_0x4781b9&&_0x4781b9['type']!==_0x16b6('0x71')){delete this[_0x16b6('0x21')][_0x1e831a[_0x16b6('0xd4')]];this['updateOriginated'](this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]]);_0x4781b9['droptime']=moment()[_0x16b6('0x72')](_0x16b6('0xf1'));var _0x4b1268=new QueueCallerAbandon(_0x4781b9,_0x1e831a);if(getSeconds(_0x4781b9[_0x16b6('0x10d')],_0x4781b9[_0x16b6('0x10e')])>=_0x4781b9['dialQueueTimeout']){this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]][_0x16b6('0x79')]+=0x1;this['voiceQueues'][_0x1e831a[_0x16b6('0xac')]][_0x16b6('0x5b')]+=0x1;this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4b1268[_0x16b6('0xe2')]=0xa;_0x4b1268['statedesc']=_0x16b6('0x10f');_0x4b1268[_0x16b6('0x110')]=_0x16b6('0x111');_0x4b1268[_0x16b6('0x112')]=this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]]['dialQueueProject2']?moment()['format'](_0x16b6('0xf1')):undefined;_0x4b1268['countdropretry']+=0x1;_0x4b1268[_0x16b6('0xe5')]+=0x1;if(_0x4b1268[_0x16b6('0xe9')]>=this['voiceQueues'][_0x1e831a['queue']][_0x16b6('0x113')]){this[_0x16b6('0x10b')](_0x4b1268);}else{this[_0x16b6('0xba')]({'active':![],'countdropretry':_0x4b1268[_0x16b6('0xe9')],'scheduledat':moment()[_0x16b6('0xef')](this[_0x16b6('0x1b')][_0x1e831a['queue']]['dialDropRetryFrequency'],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x4781b9[_0x16b6('0xf2')],'ListId':_0x4781b9[_0x16b6('0xca')],'VoiceQueueId':_0x4781b9[_0x16b6('0xcc')]||undefined,'CampaignId':_0x4781b9[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x115')));var _0xee3090=new History(_0x4b1268);_0xee3090[_0x16b6('0xe2')]=0xa;_0xee3090[_0x16b6('0xa0')]=_0x16b6('0x10f');_0xee3090[_0x16b6('0xa2')]=moment()[_0x16b6('0x72')](_0x16b6('0xf1'));_0xee3090[_0x16b6('0xa1')]=_0xee3090[_0x16b6('0xa2')];_0xee3090['calleridname']=_0x4b1268[_0x16b6('0x116')];_0xee3090['calleridnum']=_0x4b1268['calleridnum'];this[_0x16b6('0xc4')](_0xee3090)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x117')));}}else{this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]][_0x16b6('0x62')]+=0x1;this['voiceQueues'][_0x1e831a['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x4b1268[_0x16b6('0xe2')]=0xb;_0x4b1268[_0x16b6('0xa0')]=_0x16b6('0x118');_0x4b1268[_0x16b6('0x110')]=_0x16b6('0x119');_0x4b1268[_0x16b6('0xea')]+=0x1;_0x4b1268[_0x16b6('0xe5')]+=0x1;if(_0x4b1268[_0x16b6('0xea')]>=this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]][_0x16b6('0x11a')]){this[_0x16b6('0x10b')](_0x4b1268);}else{this[_0x16b6('0xba')]({'active':![],'countabandonedretry':_0x4b1268[_0x16b6('0xea')],'scheduledat':moment()[_0x16b6('0xef')](this[_0x16b6('0x1b')][_0x1e831a[_0x16b6('0xac')]]['dialAbandonedRetryFrequency'],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x4781b9[_0x16b6('0xf2')],'ListId':_0x4781b9[_0x16b6('0xca')],'VoiceQueueId':_0x4781b9['VoiceQueueId']||undefined,'CampaignId':_0x4781b9[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x11b')));var _0xee3090=new History(_0x4b1268);_0xee3090[_0x16b6('0xe2')]=0xb;_0xee3090[_0x16b6('0xa0')]=_0x16b6('0x118');_0xee3090[_0x16b6('0xa2')]=moment()[_0x16b6('0x72')](_0x16b6('0xf1'));_0xee3090[_0x16b6('0xa1')]=_0xee3090[_0x16b6('0xa2')];_0xee3090[_0x16b6('0x116')]=_0x4b1268[_0x16b6('0x116')];_0xee3090[_0x16b6('0x11c')]=_0x4b1268[_0x16b6('0x11c')];this[_0x16b6('0xc4')](_0xee3090)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x11d')));}}}}};Dialer[_0x16b6('0xa3')]['syncNewExten']=function(_0x47330d){if(this[_0x16b6('0x20')][_0x47330d['uniqueid']]){this[_0x16b6('0x20')][_0x47330d['uniqueid']]['channel']=_0x47330d[_0x16b6('0xaa')];}if(this[_0x16b6('0x21')][_0x47330d[_0x16b6('0xd4')]]){this[_0x16b6('0x21')][_0x47330d['uniqueid']][_0x16b6('0xaa')]=_0x47330d[_0x16b6('0xaa')];}};Dialer['prototype'][_0x16b6('0x11e')]=function(_0x5c0781){if(strategy[this['voiceQueues'][this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]]['queue']][_0x16b6('0x120')]]===_0x16b6('0x19')){if(this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]]&&_[_0x16b6('0xa7')](this[_0x16b6('0x20')][_0x5c0781['actionid']][_0x16b6('0x121')])&&_0x5c0781['status']==='1'&&_0x5c0781[_0x16b6('0x122')]==='0'){if(this[_0x16b6('0x1d')][_0x5c0781[_0x16b6('0x123')]]){if(!this[_0x16b6('0x1d')][_0x5c0781[_0x16b6('0x123')]][_0x16b6('0x121')]){this['agents'][_0x5c0781[_0x16b6('0x123')]][_0x16b6('0x121')]=!![];this['actions'][_0x5c0781['actionid']]['locked']=!![];this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]][_0x16b6('0x123')]=_0x5c0781[_0x16b6('0x123')];}}}}else if((strategy[this[_0x16b6('0x1b')][this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]][_0x16b6('0xac')]]['strategy']]||_0x16b6('0x18'))===_0x16b6('0x18')){if(this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]]){if(this['agents'][_0x5c0781[_0x16b6('0x123')]]){this['actions'][_0x5c0781[_0x16b6('0x11f')]][_0x16b6('0x123')]=_0x5c0781[_0x16b6('0x123')];if(_['isNil'](this[_0x16b6('0x24')][this[_0x16b6('0x20')][_0x5c0781['actionid']][_0x16b6('0xac')]])){this[_0x16b6('0x24')][this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]]['queue']]=[];}this[_0x16b6('0x24')][this[_0x16b6('0x20')][_0x5c0781[_0x16b6('0x11f')]][_0x16b6('0xac')]]['push'](_[_0x16b6('0x89')](_[_0x16b6('0x124')](this[_0x16b6('0x20')][_0x5c0781['actionid']],[_0x16b6('0x125'),_0x16b6('0x123')]),{'status':_0x5c0781[_0x16b6('0xa9')],'paused':_0x5c0781[_0x16b6('0x122')]}));}}}};function unlockQueueStatus(_0x746464,_0x5796e8){setTimeout(function(){if(_['isUndefined'](_0x746464[_0x16b6('0x126')])){loggerBooked['error'](_0x16b6('0x127'),_0x5796e8);}_0x746464[_0x16b6('0x126')]=!![];loggerBooked[_0x16b6('0x74')](_0x16b6('0x128'),_0x5796e8,JSON[_0x16b6('0x42')](_[_0x16b6('0x124')](_0x746464,[_0x16b6('0x37'),_0x16b6('0x126')])));},0x1f3);}Dialer[_0x16b6('0xa3')][_0x16b6('0x32')]=function(_0xc8473a){var _0x4bef45=this;var _0x3d9778=_0x4bef45[_0x16b6('0x1b')][_0x4bef45[_0x16b6('0x20')][_0xc8473a['actionid']][_0x16b6('0xac')]];if(strategy[this[_0x16b6('0x1b')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]]['queue']][_0x16b6('0x120')]]==='roundrobin'){if(this['actions'][_0xc8473a['actionid']]&&this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0x123')]){this[_0x16b6('0x8e')][_0x16b6('0x129')](this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]]['idHopper'],this['actions'][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0x123')])['catch'](function(_0x5216b1){logger['error'](_0x16b6('0x12a'),util[_0x16b6('0x93')](_0x5216b1,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4bef45[_0x16b6('0xab')](_0x4bef45[_0x16b6('0x1b')][_0x4bef45[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]);_0x4bef45[_0x16b6('0x1d')][_0x4bef45[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0x123')]][_0x16b6('0x121')]=![];delete _0x4bef45[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]];unlockQueueStatus(_0x3d9778);});}else{this[_0x16b6('0xab')](this[_0x16b6('0x1b')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xf2')],'ListId':this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xca')],'VoiceQueueId':this['actions'][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xcc')]||undefined,'CampaignId':this['actions'][_0xc8473a[_0x16b6('0x11f')]]['CampaignId']||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x12b')));delete this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]];unlockQueueStatus(_0x3d9778);}}else if((strategy[this['voiceQueues'][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]][_0x16b6('0x120')]]||_0x16b6('0x18'))===_0x16b6('0x18')){var _0x2ef94f;if(this['actions'][_0xc8473a[_0x16b6('0x11f')]]&&!_[_0x16b6('0x3f')](this['queueBooked'][this[_0x16b6('0x20')][_0xc8473a['actionid']]['queue']])){if(this[_0x16b6('0x25')][_0x4bef45[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]){this[_0x16b6('0x25')][_0x4bef45[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]=this[_0x16b6('0x25')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]]['queue']]?this[_0x16b6('0x25')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]:this['queueBooked'][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]?this[_0x16b6('0x24')][this['actions'][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]]['_rr']||0x0:0x0;}this[_0x16b6('0x24')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]][_0x16b6('0xac')]][_0x16b6('0x12c')]=this[_0x16b6('0x25')][this[_0x16b6('0x20')][_0xc8473a[_0x16b6('0x11f')]]['queue']];for(var _0x5ae800=0x0;_0x5ae800=0x0;})[_0x16b6('0xb2')](myreject(_0x3d25fe)));}}else{_0x59b4ff[_0x16b6('0x141')](ami['Action']({'action':_0x16b6('0x142'),'command':util[_0x16b6('0x72')](_0x16b6('0x143'),_0x4681c5,!_[_0x16b6('0x80')](config[_0x16b6('0x13f')][_0x51168b])?_0x51168b:'')})[_0x16b6('0xb1')](function(_0x4652de){return _0x4652de[_0x16b6('0x144')][_0x16b6('0x145')]('true')>=0x0;})[_0x16b6('0xb2')](myreject(_0x3d25fe)));}BPromise[_0x16b6('0x146')](_0x59b4ff)['then'](function(_0x524400){var _0xe785cb=_[_0x16b6('0x147')](_0x524400);if(_0xe785cb){return _0x55afc9(_0xe785cb);}else{_0x415e00[_0x16b6('0x35')]=_0x392165?_0x16b6('0x148'):'INTERVAL_IS_OVERTIME';return _0x3d25fe(msgResponse(_0x16b6('0x149'),_0x16b6('0x13d'),_0x16b6('0x14a')+_0x392165+'\x20'+_0x1978f8+_0x16b6('0x14b')+util[_0x16b6('0x93')](_0x4681c5,{'showHidden':![],'depth':null})+_0x16b6('0x14c')+_0x51168b));}})['catch'](function(_0x31c106){return _0x3d25fe(msgResponse(_0x16b6('0x13b'),_0x16b6('0x13d'),JSON['stringify'](_0x31c106)));});});};Dialer[_0x16b6('0xa3')][_0x16b6('0x14d')]=function(_0x41ad7f){var _0x2520f8=this;return function(){switch(_0x41ad7f[_0x16b6('0x14e')]){case _0x16b6('0x14f'):freeVariablesPredictive(_0x41ad7f);_0x2520f8[_0x16b6('0x150')](_0x41ad7f,0x1);break;case _0x16b6('0x151'):freeVariablesPredictive(_0x41ad7f);_0x2520f8['handlePower'](_0x41ad7f,_0x41ad7f[_0x16b6('0x152')]);break;case _0x16b6('0xa'):_0x2520f8['predictive'](_0x41ad7f);break;case _0x16b6('0x9'):freeVariablesPredictive(_0x41ad7f);_0x2520f8[_0x16b6('0x150')](_0x41ad7f,0x1);break;default:freeVariablesPredictive(_0x41ad7f);logger[_0x16b6('0x92')](_0x16b6('0x153'),_0x41ad7f['name'],_0x16b6('0x154'));}};};Dialer[_0x16b6('0xa3')][_0x16b6('0x155')]=function(_0x23da5e){var _0xc6fd47=this;return function(){_0xc6fd47[_0x16b6('0x156')](_0x23da5e);};};Dialer['prototype'][_0x16b6('0xb')]=function(_0x263798){var _0x46a48a=this;if(isNotPreview(_0x263798['dialMethod'])){if(isVoiceQueueOutbound(_0x263798[_0x16b6('0x4d')])&&isActive(_0x263798[_0x16b6('0x4f')])){_0x263798[_0x16b6('0x9d')]=!![];BPromise['resolve']()[_0x16b6('0xb1')](checkIsLoggedIn(_0x263798,_0x263798['loggedIn']))[_0x16b6('0xb1')](checkIsActive(_0x263798,_0x263798[_0x16b6('0x4f')]))[_0x16b6('0xb1')](checkInterval(_0x263798))[_0x16b6('0xb1')](_0x46a48a[_0x16b6('0x135')](_0x263798))[_0x16b6('0xb1')](_0x46a48a[_0x16b6('0x13a')](_0x263798[_0x16b6('0x157')],_0x263798[_0x16b6('0x158')],_0x263798[_0x16b6('0x37')],_0x263798))['then'](_0x46a48a[_0x16b6('0x159')](_0x263798[_0x16b6('0x3b')],_0x263798[_0x16b6('0x158')],_0x263798['name'],_0x263798))[_0x16b6('0xb1')](_0x46a48a[_0x16b6('0x14d')](_0x263798))[_0x16b6('0xb2')](loggerCatchQueueSummary(_0x16b6('0x15a'),_0x263798));}else{notSendMessagesQueue(_0x263798);}}else{freeVariablesPredictive(_0x263798);}};Dialer[_0x16b6('0xa3')][_0x16b6('0x134')]=function(){var _0x1b1473=this;var _0x2cbff6;for(var _0x26bd57 in this[_0x16b6('0x1c')]){if(typeof this[_0x16b6('0x1c')][_0x26bd57]!==_0x16b6('0x94')){_0x2cbff6=this[_0x16b6('0x1c')][_0x26bd57];if(isCampaignIvr(_0x2cbff6[_0x16b6('0x4d')])&&isActive(_0x2cbff6[_0x16b6('0x6d')])){_0x2cbff6[_0x16b6('0x9d')]=!![];BPromise[_0x16b6('0xb0')]()['then'](checkIsActive(_0x2cbff6,_0x2cbff6[_0x16b6('0x6d')]))[_0x16b6('0xb1')](checkInterval(_0x2cbff6))[_0x16b6('0xb1')](_0x1b1473[_0x16b6('0x135')](_0x2cbff6))[_0x16b6('0xb1')](_0x1b1473[_0x16b6('0x13a')](_0x2cbff6[_0x16b6('0x157')],_0x2cbff6[_0x16b6('0x158')],_0x2cbff6[_0x16b6('0x37')],_0x2cbff6))[_0x16b6('0xb1')](_0x1b1473[_0x16b6('0x159')](_0x2cbff6[_0x16b6('0x3b')],_0x2cbff6[_0x16b6('0x158')],_0x2cbff6[_0x16b6('0x37')],_0x2cbff6))[_0x16b6('0xb1')](_0x1b1473[_0x16b6('0x155')](_0x2cbff6))[_0x16b6('0xb2')](loggerCatchQueueSummary('[syncCampaigns]',_0x2cbff6));}else{notSendMessagesCampaign(_0x2cbff6);}}}};function getCallerIdRandom(_0x16e6b5,_0x44124a){var _0x24c4ea;var _0x232854;var _0x49bc52;if(_0x44124a<=0x0){_0x44124a=0x1;}_0x24c4ea=new RegExp(_0x16b6('0x15b')+_0x44124a+'}$');_0x232854=Math[_0x16b6('0x15c')](0xa,_0x44124a-0x1);_0x49bc52=Math[_0x16b6('0x15c')](0xa,_0x44124a)-0x1;return util['format']('%s',_[_0x16b6('0x15d')](_0x16e6b5,_0x24c4ea,_[_0x16b6('0x15e')](_0x232854,_0x49bc52)));}function extractCalleridName(_0x5d23c5){var _0x29ae65=_0x5d23c5['match'](/"(.*?)"/);return _0x29ae65?_0x29ae65[0x1]:_0x5d23c5;}function extractCalleridNumber(_0xa4cbab){var _0x1df197=_0xa4cbab[_0x16b6('0x15f')](/<(.*?)>/);return _0x1df197?_0x1df197[0x1]:_0xa4cbab;}Dialer[_0x16b6('0xa3')][_0x16b6('0x160')]=function(_0x340ff8,_0x39ffbf){var _0x21fa9e=this;var _0x16d278=uuid['v4']();this['actions'][_0x16d278]=new Action(_0x340ff8,_0x39ffbf,_0x16d278);return new BPromise(function(_0x594545,_0x516d83){if(_[_0x16b6('0x80')](_0x340ff8)&&typeof _0x340ff8!==_0x16b6('0x161')){return _0x516d83(msgResponse('originate',_0x16b6('0x13d'),_0x16b6('0x162')));}if(_[_0x16b6('0x80')](_0x39ffbf[_0x16b6('0x163')][_0x16b6('0x164')])||_0x39ffbf[_0x16b6('0x163')][_0x16b6('0x164')]===null){return _0x516d83(msgResponse(_0x16b6('0x165'),_0x16b6('0x13d'),'contact\x20is\x20undefine'));}var _0x7ccdb5={'XMD-CALLERID':_0x21fa9e[_0x16b6('0x20')][_0x16d278][_0x16b6('0x166')](),'XMD-AGI':_0x340ff8[_0x16b6('0x101')]?util['format'](_0x16b6('0x167'),ipAgi,_0x340ff8[_0x16b6('0x101')]):_0x16b6('0x168'),'XMD-AGIAFTER':_0x340ff8['dialQueueProject2']?util[_0x16b6('0x72')](_0x16b6('0x167'),ipAgi,_0x340ff8['dialQueueProject2']):'NONE','XMD-QUEUE':_0x340ff8['type']===_0x16b6('0x46')?util[_0x16b6('0x72')](_0x16b6('0x169'),_0x340ff8[_0x16b6('0x37')],_0x340ff8[_0x16b6('0x16a')]||'',_0x340ff8['dialAgiAfterHangupAgent']?'c':'',_0x340ff8[_0x16b6('0x16b')]||0x3):_0x16b6('0x168'),'XMD-CONTACTID':_0x39ffbf['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x21fa9e[_0x16b6('0x20')][_0x16d278][_0x16b6('0x166')](),'XMD-AMD':_0x340ff8['dialAMDActive']?_0x16b6('0x16c'):_0x16b6('0x168'),'XMD-DESTINATION':_0x16b6('0xd8')};if(_0x340ff8[_0x16b6('0xd9')]){_0x7ccdb5[_0x16b6('0x16d')]=_0x340ff8[_0x16b6('0x16e')]||0x9c4;_0x7ccdb5[_0x16b6('0x16f')]=_0x340ff8[_0x16b6('0x170')]||0x5dc;_0x7ccdb5[_0x16b6('0x171')]=_0x340ff8[_0x16b6('0x172')]||0x320;_0x7ccdb5[_0x16b6('0x173')]=_0x340ff8[_0x16b6('0x174')]||0x1388;_0x7ccdb5['XMD-AMDMINWORDLENGTH']=_0x340ff8[_0x16b6('0x175')]||0x64;_0x7ccdb5[_0x16b6('0x176')]=_0x340ff8[_0x16b6('0x177')]||0x32;_0x7ccdb5[_0x16b6('0x178')]=_0x340ff8[_0x16b6('0x179')]||0x3;_0x7ccdb5[_0x16b6('0x17a')]=_0x340ff8[_0x16b6('0x17b')]||0x100;_0x7ccdb5['XMD-AMDMAXIMUMWORDLENGTH']=_0x340ff8['dialAMDMaximumWordLength']||0x1388;}if(_0x340ff8[_0x16b6('0x4d')]===_0x16b6('0x46')){_0x7ccdb5[_0x16b6('0x17c')]=_0x39ffbf['VoiceQueueId'];}else{_0x7ccdb5['XMD-CAMPAIGNID']=_0x39ffbf['CampaignId'];}for(var _0x5352e6 in _0x39ffbf[_0x16b6('0x163')]){if(typeof _0x39ffbf[_0x16b6('0x163')][_0x5352e6]!=='undefined'){if(isNotNull(_0x39ffbf['Contact'][_0x5352e6])&&_0x5352e6!=='id'&&_0x5352e6!==_0x16b6('0x17d')&&_0x5352e6!==_0x16b6('0x17e')&&_0x5352e6!==_0x16b6('0x17f')){_0x7ccdb5[util[_0x16b6('0x72')](_0x16b6('0x180'),_0x16b6('0x181'),_[_0x16b6('0x182')](_0x5352e6))]=_0x39ffbf['Contact'][_0x5352e6];}}}var _0x2427ba=_0x21fa9e[_0x16b6('0x136')](_0x340ff8[_0x16b6('0x6c')])?getCallerId(_0x340ff8['Trunk'][_0x16b6('0x6e')],_0x340ff8[_0x16b6('0x50')],_0x340ff8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x340ff8[_0x16b6('0x51')],_0x340ff8[_0x16b6('0x183')]):_0x340ff8['dialOriginateCallerIdNumber']):getCallerId(_[_0x16b6('0xa7')](_0x340ff8['TrunkBackup'])?_0x340ff8[_0x16b6('0x6c')][_0x16b6('0x6e')]:_0x340ff8[_0x16b6('0x137')][_0x16b6('0x6e')],_0x340ff8['dialOriginateCallerIdName'],_0x340ff8[_0x16b6('0x183')]>0x0?getCallerIdRandom(_0x340ff8[_0x16b6('0x51')],_0x340ff8[_0x16b6('0x183')]):_0x340ff8[_0x16b6('0x51')]);if(_0x2427ba){_0x7ccdb5['XMD-ORIGINATECALLERIDNAME']=_0x21fa9e[_0x16b6('0x20')][_0x16d278][_0x16b6('0x184')]=extractCalleridName(_0x2427ba);_0x7ccdb5[_0x16b6('0x185')]=_0x21fa9e['actions'][_0x16d278][_0x16b6('0x186')]=extractCalleridNumber(_0x2427ba);}return ami['Action']({'actionid':_0x16d278,'action':_0x16b6('0x165'),'channel':_0x21fa9e['isTrunkReachable'](_0x340ff8['Trunk'])?util[_0x16b6('0x72')](_0x16b6('0x187'),_0x340ff8['Trunk'][_0x16b6('0x37')],isNotNull(_0x340ff8[_0x16b6('0x53')])?_0x340ff8[_0x16b6('0x53')][_0x16b6('0x188')]()||'':'',_0x340ff8[_0x16b6('0x189')]>0x0?_0x39ffbf[_0x16b6('0x163')]['phone'][_0x16b6('0x18a')](_0x340ff8['dialCutDigit']):_0x39ffbf[_0x16b6('0x163')][_0x16b6('0x164')]):util[_0x16b6('0x72')](_0x16b6('0x187'),_[_0x16b6('0xa7')](_0x340ff8[_0x16b6('0x137')])?_0x340ff8[_0x16b6('0x6c')][_0x16b6('0x37')]:_0x340ff8['TrunkBackup'][_0x16b6('0x37')],isNotNull(_0x340ff8[_0x16b6('0x53')])?_0x340ff8[_0x16b6('0x53')]['trim']()||'':'',_0x340ff8[_0x16b6('0x189')]>0x0?_0x39ffbf['Contact'][_0x16b6('0x164')][_0x16b6('0x18a')](_0x340ff8[_0x16b6('0x189')]):_0x39ffbf[_0x16b6('0x163')][_0x16b6('0x164')]),'callerid':_0x2427ba,'Exten':_0x16b6('0xd8'),'Context':_0x16b6('0x18b'),'Priority':'1','variable':_0x7ccdb5,'timeout':(_0x340ff8[_0x16b6('0x52')]||0x1e)*0x3e8,'async':!![],'channelid':_0x16d278})[_0x16b6('0xb1')](function(_0x2c273c){return _0x594545(_0x2c273c);})[_0x16b6('0xb2')](function(_0x46ee91){_0x340ff8[_0x16b6('0x5e')]+=0x1;var _0x29a2f8=new History(_0x21fa9e[_0x16b6('0x20')][_0x16d278]);logger[_0x16b6('0x92')](util[_0x16b6('0x72')](_0x16b6('0x18c'),JSON[_0x16b6('0x42')](_0x46ee91)));_0x29a2f8[_0x16b6('0xe2')]=0xe;_0x29a2f8[_0x16b6('0xa0')]=_0x16b6('0x18d');_0x29a2f8['starttime']=moment()[_0x16b6('0x72')](_0x16b6('0xf1'));_0x29a2f8[_0x16b6('0xa1')]=_0x29a2f8['starttime'];_0x21fa9e[_0x16b6('0xc4')](_0x29a2f8)['catch'](loggerCatch('[originate][error]'));_0x21fa9e[_0x16b6('0xc3')](_0x29a2f8)[_0x16b6('0xb2')](loggerCatch('[originate][error]'))[_0x16b6('0x18e')](function(){delete _0x21fa9e[_0x16b6('0x20')][_0x16d278];return _0x516d83(msgResponse(_0x16b6('0x165'),'Error',_0x16b6('0x18f')));});});});};Dialer[_0x16b6('0xa3')]['syncOriginateResponse']=function(_0x54ee5a){var _0x57f13a=this[_0x16b6('0x20')][_0x54ee5a['actionid']];if(_0x57f13a){delete this[_0x16b6('0x20')][_0x54ee5a[_0x16b6('0x11f')]];_0x57f13a[_0x16b6('0x10e')]=moment()[_0x16b6('0x72')]('YYYY-MM-DD\x20HH:mm:ss');var _0x24133a=_0x57f13a['type']==='ivr'?this[_0x16b6('0x1c')][_0x57f13a[_0x16b6('0xac')]]:this[_0x16b6('0x1b')][_0x57f13a[_0x16b6('0x190')]()];if(!this[_0x16b6('0xcf')](_0x54ee5a['response'])){this[_0x16b6('0xab')](_0x24133a);return this['callProgressDetecting'](_0x57f13a,_0x24133a,_0x54ee5a)[_0x16b6('0xb2')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x16b6('0x21')][_0x54ee5a[_0x16b6('0xd4')]]=_0x57f13a;}};Dialer[_0x16b6('0xa3')]['checkRetriveMax']=function(_0x2a7680,_0x21d2c3,_0x2c131d){var _0x752045=new History(_0x21d2c3);if(_0x752045[_0x16b6('0xf7')]+_0x752045[_0x16b6('0xe7')]+_0x752045[_0x16b6('0xe8')]+_0x752045[_0x16b6('0xf8')]+_0x752045[_0x16b6('0xe9')]+_0x752045[_0x16b6('0xea')]+_0x752045[_0x16b6('0xe4')]+_0x752045[_0x16b6('0xeb')]>=_0x2c131d[_0x16b6('0x191')]-0x1){return!![];}switch(_0x2a7680){case 0x3:if(_0x752045[_0x16b6('0xe8')]>=_0x2c131d[_0x16b6('0x192')]-0x1){return!![];}this[_0x16b6('0xba')]({'active':![],'countnoanswerretry':_0x752045[_0x16b6('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x2c131d[_0x16b6('0x193')],'minutes')[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x194')));break;case 0x5:if(_0x752045['countbusyretry']>=_0x2c131d[_0x16b6('0x195')]-0x1){return!![];}this[_0x16b6('0xba')]({'active':![],'countbusyretry':_0x752045['countbusyretry']+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0x196')],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045['ContactId'],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x197')));break;case 0x8:if(_0x752045[_0x16b6('0xe7')]>=_0x2c131d[_0x16b6('0x198')]-0x1){return!![];}this[_0x16b6('0xba')]({'active':![],'countcongestionretry':_0x752045[_0x16b6('0xe7')]+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0x199')],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045['ListId'],'VoiceQueueId':_0x752045['VoiceQueueId']||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x19a')));break;case 0x0:if(_0x752045[_0x16b6('0xf8')]>=_0x2c131d[_0x16b6('0x19b')]-0x1){return!![];}else{this[_0x16b6('0xba')]({'active':![],'countnosuchnumberretry':_0x752045[_0x16b6('0xf8')]+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0x19c')],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045['VoiceQueueId']||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x19d')));}break;case 0xa:if(_0x752045['countdropretry']>=_0x2c131d[_0x16b6('0x113')]-0x1){return!![];}this[_0x16b6('0xba')]({'active':![],'countdropretry':_0x752045[_0x16b6('0xe9')]+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d['dialDropRetryFrequency'],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x115')));break;case 0xb:if(_0x752045['countabandonedretry']>=_0x2c131d['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x16b6('0xba')]({'active':![],'countabandonedretry':_0x752045['countabandonedretry']+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0x19e')],'minutes')[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x11b')));break;case 0x13:if(_0x752045[_0x16b6('0xe4')]>=_0x2c131d['dialMachineMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x752045[_0x16b6('0xe4')]+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0xf0')],_0x16b6('0x114'))[_0x16b6('0x72')](_0x16b6('0xf1')),'ContactId':_0x752045['ContactId'],'ListId':_0x752045[_0x16b6('0xca')],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045[_0x16b6('0xcd')]||undefined})['catch'](loggerCatch(_0x16b6('0xfb')));break;case 0x14:if(_0x752045[_0x16b6('0xeb')]>=_0x2c131d[_0x16b6('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x752045[_0x16b6('0xeb')]+=0x1,'scheduledat':moment()[_0x16b6('0xef')](_0x2c131d[_0x16b6('0x1a0')],_0x16b6('0x114'))[_0x16b6('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x752045[_0x16b6('0xf2')],'ListId':_0x752045['ListId'],'VoiceQueueId':_0x752045[_0x16b6('0xcc')]||undefined,'CampaignId':_0x752045['CampaignId']||undefined})[_0x16b6('0xb2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x16b6('0xa3')][_0x16b6('0x1a1')]=function(_0x369677,_0x4e129a,_0x2cb7f1){var _0x877de5=this;var _0x8dd076=new History(_0x369677);return new BPromise(function(_0x4a3ecd,_0x507a55){if(_['isUndefined'](_0x4e129a)&&typeof _0x4e129a!=='object'){return _0x507a55(msgResponse(_0x16b6('0x1a2'),_0x16b6('0x13d'),_0x16b6('0x1a3')));}if(_[_0x16b6('0x80')](_0x2cb7f1)&&typeof _0x2cb7f1!==_0x16b6('0x161')){return _0x507a55(msgResponse(_0x16b6('0x1a2'),_0x16b6('0x13d'),_0x16b6('0x1a4')));}switch(_0x2cb7f1[_0x16b6('0x105')]){case'0':_0x4e129a[_0x16b6('0x5d')]+=0x1;_0x8dd076[_0x16b6('0xe2')]=0x0;_0x8dd076[_0x16b6('0xa0')]=_0x16b6('0x1a5');_0x8dd076[_0x16b6('0xf8')]+=0x1;_0x8dd076[_0x16b6('0xe5')]+=0x1;ami[_0x16b6('0x45')]('custom:agentnosuchnumber',ut['buildObj'](_0x369677,_0x16b6('0x1a6')));_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xe6')));if(_0x877de5[_0x16b6('0x1a7')](0x0,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xf8')]>=_0x4e129a[_0x16b6('0x19b')]){_0x877de5[_0x16b6('0xee')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1a8'));}else{_0x877de5[_0x16b6('0xec')](_0x8dd076,_0x4a3ecd,_0x507a55,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4e129a[_0x16b6('0x5c')]+=0x1;_0x8dd076['state']=0x3;_0x8dd076[_0x16b6('0xa0')]=_0x16b6('0x1a9');_0x8dd076[_0x16b6('0xe8')]+=0x1;_0x8dd076[_0x16b6('0xe5')]+=0x1;ami['emit'](_0x16b6('0x1aa'),ut[_0x16b6('0xde')](_0x369677,_0x16b6('0x1ab')));_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1ac')));if(_0x877de5[_0x16b6('0x1a7')](0x3,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xe8')]>=_0x4e129a[_0x16b6('0x192')]){_0x877de5['createStateFinal'](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1ad'));}else{_0x877de5[_0x16b6('0xec')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1ad'));}}break;case'5':_0x4e129a[_0x16b6('0x57')]+=0x1;_0x8dd076[_0x16b6('0xe2')]=0x5;_0x8dd076[_0x16b6('0xa0')]=_0x16b6('0x1ae');_0x8dd076['countbusyretry']+=0x1;_0x8dd076['countglobal']+=0x1;ami[_0x16b6('0x45')](_0x16b6('0x1af'),ut['buildObj'](_0x369677,_0x16b6('0x1b0')));_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1b1')));if(_0x877de5['checkRetriveMax'](0x5,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xf7')]>=_0x4e129a['dialBusyMaxRetry']){_0x877de5[_0x16b6('0xee')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1b2'));}else{_0x877de5['stateGlobal'](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1b2'));}}break;case'8':_0x4e129a[_0x16b6('0x58')]+=0x1;_0x8dd076['state']=0x8;_0x8dd076[_0x16b6('0xa0')]=_0x16b6('0x1b3');_0x8dd076[_0x16b6('0xe7')]+=0x1;_0x8dd076[_0x16b6('0xe5')]+=0x1;ami['emit'](_0x16b6('0x1b4'),ut[_0x16b6('0xde')](_0x369677,'congestion'));_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1b5')));if(_0x877de5[_0x16b6('0x1a7')](0x8,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xe7')]>=_0x4e129a[_0x16b6('0x198')]){_0x877de5['createStateFinal'](_0x8dd076,_0x4a3ecd,_0x507a55,'reason\x208\x20congestion');}else{_0x877de5[_0x16b6('0xec')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1b6'));}}break;case'11':_0x4e129a[_0x16b6('0x1b7')]+=0x1;_0x8dd076[_0x16b6('0xe2')]=0xb;_0x8dd076['statedesc']=_0x16b6('0x118');_0x8dd076[_0x16b6('0xea')]+=0x1;_0x8dd076[_0x16b6('0xe5')]+=0x1;_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x11d')));if(_0x877de5[_0x16b6('0x1a7')](0xb,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xea')]>=_0x4e129a[_0x16b6('0x11a')]){_0x877de5[_0x16b6('0xee')](_0x8dd076,_0x4a3ecd,_0x507a55,'reason\x2011\x20abandoned');}else{_0x877de5[_0x16b6('0xec')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1b8'));}}break;case'20':_0x4e129a[_0x16b6('0x60')]+=0x1;_0x8dd076[_0x16b6('0xe2')]=0x14;_0x8dd076[_0x16b6('0xa0')]=_0x16b6('0x1b9');_0x8dd076[_0x16b6('0xeb')]+=0x1;_0x8dd076[_0x16b6('0xe5')]+=0x1;ami['emit'](_0x16b6('0x1ba'),ut['buildObj'](_0x369677,_0x16b6('0x1bb')));_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x877de5[_0x16b6('0x1a7')](0x14,_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xeb')]>=_0x4e129a[_0x16b6('0x19f')]){_0x877de5[_0x16b6('0xee')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1bc'));}else{_0x877de5['stateGlobal'](_0x8dd076,_0x4a3ecd,_0x507a55,_0x16b6('0x1bc'));}}break;default:_0x4e129a[_0x16b6('0x61')]+=0x1;_0x8dd076[_0x16b6('0xe2')]=0xc;_0x8dd076[_0x16b6('0xa0')]=_0x2cb7f1[_0x16b6('0x105')];_0x877de5[_0x16b6('0xc4')](_0x8dd076)[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1bd')));if(_0x877de5[_0x16b6('0x1a7')](_0x2cb7f1[_0x16b6('0x105')],_0x369677,_0x4e129a)){if(_0x8dd076[_0x16b6('0xf7')]+_0x8dd076['countcongestionretry']+_0x8dd076[_0x16b6('0xe8')]+_0x8dd076['countnosuchnumberretry']+_0x8dd076['countdropretry']+_0x8dd076[_0x16b6('0xea')]+_0x8dd076[_0x16b6('0xe4')]+_0x8dd076[_0x16b6('0xeb')]>=_0x4e129a[_0x16b6('0x191')]){_0x877de5[_0x16b6('0xec')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x2cb7f1[_0x16b6('0x105')]);}else{_0x877de5[_0x16b6('0xee')](_0x8dd076,_0x4a3ecd,_0x507a55,_0x2cb7f1[_0x16b6('0x105')]);}}}});};Dialer[_0x16b6('0xa3')][_0x16b6('0xec')]=function(_0x49b45e,_0x2bf49a,_0x1d29d9,_0x15c125){var _0x36e498=new Final(_0x49b45e);_0x36e498[_0x16b6('0xe2')]=0xf;_0x36e498[_0x16b6('0xa0')]=_0x16b6('0x1be');this[_0x16b6('0xee')](_0x36e498,_0x2bf49a,_0x1d29d9,_0x15c125);};Dialer[_0x16b6('0xa3')]['createStateFinal']=function(_0x20c490,_0x4814d9,_0x2ed1d9,_0x137c98){this[_0x16b6('0xc3')](_0x20c490)['then'](function(){return _0x4814d9(msgResponse(_0x16b6('0x1a2'),_0x16b6('0xd0'),_0x137c98));})[_0x16b6('0xb2')](function(){return _0x2ed1d9(msgResponse(_0x16b6('0x1bf'),_0x16b6('0x13d'),_0x16b6('0x1c0')));});};Dialer['prototype'][_0x16b6('0xa')]=function(_0x2d5f23){var _0x3687b5=_0x2d5f23[_0x16b6('0x1c1')]/0x64;var _0x350a1d=_0x2d5f23[_0x16b6('0x5b')]/(_0x2d5f23[_0x16b6('0x5b')]+_0x2d5f23[_0x16b6('0x55')]);var _0x1afc05=Math['round'](_0x2d5f23[_0x16b6('0x66')]*(_0x2d5f23['predictiveIntervalMaxThreshold']/0x64));var _0x416884=Math[_0x16b6('0x1c2')](_0x2d5f23[_0x16b6('0x66')]*(_0x2d5f23[_0x16b6('0x1c3')]/0x64));var _0x1a3bcf=_0x2d5f23[_0x16b6('0x48')]+_0x2d5f23[_0x16b6('0x4c')];var _0x5c0bd8=Math[_0x16b6('0x1c4')](_0x2d5f23[_0x16b6('0x68')]*_0x2d5f23[_0x16b6('0x69')]*_0x2d5f23['predictiveIntervalHitRate']*_0x2d5f23[_0x16b6('0x1c5')]);if(_[_0x16b6('0x80')](_0x2d5f23[_0x16b6('0x22')])){if(!_['isUndefined'](_0x2d5f23['startPredictive'])){_0x2d5f23['startPredictive']=undefined;loggerPredictive[_0x16b6('0x92')](_0x16b6('0x1c6'),_0x16b6('0x1c7'));}if(!_[_0x16b6('0x80')](_0x2d5f23[_0x16b6('0x8c')])){loggerPredictive['error'](_0x16b6('0x1c6'),_0x16b6('0x1c8'));clearInterval(_0x2d5f23['handlePredictive']);_0x2d5f23[_0x16b6('0x8c')]=undefined;}_0x2d5f23['startProgressive']=moment()[_0x16b6('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x16b6('0x74')](_0x2d5f23['name'],_0x16b6('0x1c9'),_0x2d5f23['startProgressive']);this[_0x16b6('0x150')](_0x2d5f23,0x1);}else if(ifInterval(_0x2d5f23[_0x16b6('0x1ca')],_0x2d5f23['startProgressive'])){this[_0x16b6('0x150')](_0x2d5f23,0x1);loggerPredictiveCalls[_0x16b6('0x74')](_0x16b6('0x1cb'),_0x2d5f23[_0x16b6('0x22')],_0x2d5f23[_0x16b6('0x37')]);_0x2d5f23[_0x16b6('0x68')]=0x0;_0x2d5f23[_0x16b6('0x63')]=0x0;}else if(_0x3687b5<_0x350a1d&&_0x2d5f23[_0x16b6('0x1cc')]===_0x16b6('0x1cd')){freeVariablesPredictive(_0x2d5f23);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x1ce'),_0x16b6('0x1cf'),_0x350a1d,_0x16b6('0x22'),_0x2d5f23[_0x16b6('0x37')]);}else if(_0x5c0bd8<_0x2d5f23[_0x16b6('0x63')]&&_0x2d5f23['dialPredictiveOptimization']===_0x16b6('0x1cd')){freeVariablesPredictive(_0x2d5f23);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x1d0'),_0x16b6('0x1d1'),_0x5c0bd8,'Drop\x20in\x20this\x20interval',_0x2d5f23[_0x16b6('0x63')],'startProgressive',_0x2d5f23['name']);}else if(!ifInterval(_0x2d5f23['dialPredictiveInterval'],_0x2d5f23['startProgressive'])&&_['isUndefined'](_0x2d5f23[_0x16b6('0x6b')])&&!_[_0x16b6('0x80')](_0x2d5f23['startProgressive'])){_0x2d5f23[_0x16b6('0x6b')]=moment()[_0x16b6('0x72')](_0x16b6('0xf1'));loggerPredictive[_0x16b6('0x74')](_0x2d5f23['name'],_0x16b6('0x1d2'),_0x2d5f23[_0x16b6('0x6b')]);this[_0x16b6('0xb8')](_0x2d5f23[_0x16b6('0x1ca')])['then'](this[_0x16b6('0x1d3')](_0x2d5f23))[_0x16b6('0xb1')](mergeDataErlangB(_0x2d5f23))[_0x16b6('0xb1')](this[_0x16b6('0x1d4')](_0x2d5f23))[_0x16b6('0xb2')](loggerCatchPredictive(_0x16b6('0x1d5'),_0x2d5f23));}else if(!ifInterval(_0x2d5f23[_0x16b6('0x1ca')],_0x2d5f23[_0x16b6('0x6b')])){_0x2d5f23['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2d5f23['startPredictive']=moment()[_0x16b6('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x16b6('0x74')](_0x2d5f23['name'],_0x16b6('0x1d6'),_0x2d5f23['startPredictive']);clearInterval(_0x2d5f23[_0x16b6('0x8c')]);_0x2d5f23['handlePredictive']=undefined;this[_0x16b6('0xb8')](_0x2d5f23[_0x16b6('0x1ca')])['then'](this['getDataPredictive'](_0x2d5f23))[_0x16b6('0xb1')](mergeDataErlangB(_0x2d5f23))[_0x16b6('0xb1')](this[_0x16b6('0x1d4')](_0x2d5f23))[_0x16b6('0xb2')](loggerCatchPredictive(_0x16b6('0x1d7'),_0x2d5f23));}else if(_0x2d5f23[_0x16b6('0x66')]&&_0x1a3bcf<_0x2d5f23['predictiveIntervalAvailable']-_0x416884){freeVariablesPredictive(_0x2d5f23);loggerPredictive['info'](_0x2d5f23[_0x16b6('0x37')],_0x16b6('0x1d8'),_0x1a3bcf,_0x16b6('0x1d9'),_0x2d5f23['predictiveIntervalAvailable'],'-',_0x416884,'=',_0x2d5f23[_0x16b6('0x66')]-_0x416884,')');}else if(_0x2d5f23[_0x16b6('0x66')]&&_0x1a3bcf>_0x2d5f23[_0x16b6('0x66')]+_0x1afc05){freeVariablesPredictive(_0x2d5f23);loggerPredictive['info'](_0x2d5f23['name'],_0x16b6('0x1d8'),_0x1a3bcf,_0x16b6('0x1da'),_0x2d5f23[_0x16b6('0x66')],'+',_0x1afc05,'=',_0x2d5f23[_0x16b6('0x66')]+_0x1afc05,')');}};Dialer[_0x16b6('0xa3')][_0x16b6('0x1d3')]=function(_0x29cf27){var _0x805a8b=this;return function(_0x2baf97){return new BPromise(function(_0xebd4d3,_0x57b4a2){_['merge'](_0x29cf27,_0x2baf97[0x0]);if(checkGetDataPredictive(_0x2baf97[0x0])){var _0x4fe1c8=_0x29cf27[_0x16b6('0x66')]=_0x29cf27[_0x16b6('0x4c')]+_0x29cf27['available'];var _0x16d64d=_0x29cf27[_0x16b6('0x1ca')]*0x3c;var _0x1380ab=_0x2baf97[0x0][_0x16b6('0x7e')]+_0x2baf97[0x0][_0x16b6('0x7c')];var _0x573a42=(_0x2baf97[0x0][_0x16b6('0x77')]+_0x2baf97[0x0][_0x16b6('0x79')]+_0x2baf97[0x0][_0x16b6('0x62')])/_0x2baf97[0x0]['predictiveIntervalTotalCalls'];_0x29cf27[_0x16b6('0x64')]=_0x573a42>0x0?_0x573a42:0x1;switch(_0x29cf27[_0x16b6('0x1cc')]){case _0x16b6('0x1cd'):var _0x3bc579=_0x29cf27[_0x16b6('0x1c1')]/0x64;return _0x805a8b[_0x16b6('0x1db')](_0x4fe1c8,_0x16d64d,_0x1380ab,_0x573a42,_0x3bc579)['then'](function(_0x5836d3){return _0xebd4d3(_0x5836d3);});case'agentBusyFactor':var _0x55d39f=_0x29cf27[_0x16b6('0x1c1')]/0x64;return _0x805a8b[_0x16b6('0x1dc')](_0x4fe1c8,_0x16d64d,_0x1380ab,_0x573a42,_0x55d39f)[_0x16b6('0xb1')](function(_0x3b4902){return _0xebd4d3(_0x3b4902);});default:return _0x57b4a2(msgResponse(_0x16b6('0x1dd'),_0x16b6('0x13d'),_0x16b6('0x1de')));}}else{return _0x57b4a2(msgResponse('[getDataPredictive]',_0x16b6('0x13d'),_0x16b6('0x1df')));}});};};Dialer[_0x16b6('0xa3')]['getDataPredictiveOld']=function(_0x338687){var _0x3c9aa8=this;return function(_0x4fa472){return new BPromise(function(_0x24a4ad,_0x2f9aa3){_[_0x16b6('0x89')](_0x338687,_0x4fa472[0x0]);if(checkGetDataPredictive(_0x4fa472[0x0])){loggerPredictive[_0x16b6('0x74')](JSON[_0x16b6('0x42')](_0x4fa472[0x0]));if(_0x338687[_0x16b6('0x1cc')]==='dropRate'){return _0x3c9aa8[_0x16b6('0xc1')](_0x338687['id'])[_0x16b6('0xb1')](function(_0x14ef09){var _0x309a47=_0x338687[_0x16b6('0x49')]-_0x14ef09[0x0][_0x16b6('0x1e0')];var _0x330349=_0x338687[_0x16b6('0x1ca')]*0x3c;var _0x1a6271=_0x4fa472[0x0][_0x16b6('0x7e')]+_0x4fa472[0x0]['predictiveIntervalAvgHoldtime'];var _0x2129c6=(_0x4fa472[0x0]['predictiveIntervalAnsweredCalls']+_0x4fa472[0x0][_0x16b6('0x79')]+_0x4fa472[0x0][_0x16b6('0x62')])/_0x4fa472[0x0][_0x16b6('0x1e1')];var _0x35fb4c=_0x338687[_0x16b6('0x1c1')]/0x64;_0x338687[_0x16b6('0x65')]=_0x14ef09[0x0][_0x16b6('0x1e0')]||0x0;_0x338687[_0x16b6('0x64')]=_0x2129c6>0x0?_0x2129c6:0x1;return _0x3c9aa8[_0x16b6('0x1db')](_0x309a47,_0x330349,_0x1a6271,_0x2129c6,_0x35fb4c);})[_0x16b6('0xb1')](function(_0x48a6ca){return _0x24a4ad(_0x48a6ca);})[_0x16b6('0xb2')](function(_0x5b9e44){return _0x2f9aa3(msgResponse(_0x16b6('0x1e2'),_0x16b6('0x13d'),JSON[_0x16b6('0x42')](_0x5b9e44)));});}if(_0x338687[_0x16b6('0x1cc')]===_0x16b6('0x1e3')){return _0x3c9aa8[_0x16b6('0xc1')](_0x338687['id'])[_0x16b6('0xb1')](function(_0x3c6613){var _0x1a37dd=_0x338687[_0x16b6('0x49')]-_0x3c6613[0x0][_0x16b6('0x1e0')];var _0x4ab62f=_0x338687[_0x16b6('0x1ca')]*0x3c;var _0x11f361=_0x4fa472[0x0][_0x16b6('0x7e')]+_0x4fa472[0x0][_0x16b6('0x7c')];var _0x20ca8d=(_0x4fa472[0x0][_0x16b6('0x77')]+_0x4fa472[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4fa472[0x0][_0x16b6('0x62')])/_0x4fa472[0x0][_0x16b6('0x1e1')];var _0x52606b=_0x338687[_0x16b6('0x1c1')]/0x64;_0x338687[_0x16b6('0x65')]=_0x3c6613[0x0][_0x16b6('0x1e0')]||0x0;_0x338687[_0x16b6('0x64')]=_0x20ca8d>0x0?_0x20ca8d:0x1;return _0x3c9aa8[_0x16b6('0x1dc')](_0x1a37dd,_0x4ab62f,_0x11f361,_0x20ca8d,_0x52606b);})[_0x16b6('0xb1')](function(_0x48014e){return _0x24a4ad(_0x48014e);})['catch'](function(_0x1b3f80){return _0x2f9aa3(msgResponse(_0x16b6('0x1e2'),_0x16b6('0x13d'),JSON[_0x16b6('0x42')](_0x1b3f80)));});}}else{return _0x2f9aa3(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x16b6('0xa3')][_0x16b6('0x1d4')]=function(_0x2e7b00){var _0x6624c1=this;return function(){var _0x1ad08f=0x0;var _0x12cf4b=Math[_0x16b6('0x1c4')](_0x2e7b00[_0x16b6('0x88')]*0x3e8);if(_0x12cf4b>0x0){_0x12cf4b=_0x12cf4b<0x64?0x64:_0x12cf4b;loggerPredictive[_0x16b6('0x74')](_0x2e7b00[_0x16b6('0x37')],_0x16b6('0x1e4'),_0x12cf4b,_0x16b6('0x43'));_0x2e7b00[_0x16b6('0x8c')]=setInterval(function(){_0x6624c1[_0x16b6('0x8c')](_0x2e7b00);loggerPredictiveCalls['info'](_0x16b6('0x1e5'),_0x1ad08f+=0x1);},_0x12cf4b);}else{loggerPredictive[_0x16b6('0x74')](_0x2e7b00[_0x16b6('0x37')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x16b6('0xa3')][_0x16b6('0x1e6')]=function(_0x531423,_0x32c269){var _0x5257b4=this;return function(_0x246348){if(_[_0x16b6('0x3f')](_0x246348)){if(_[_0x16b6('0xa7')](_0x32c269[_0x16b6('0xcb')])||!_0x32c269['recallme']){if(_0x531423[_0x16b6('0x14e')]==='booked'){_0x531423['queueStatusComplete']=_[_0x16b6('0x80')](_0x531423[_0x16b6('0x126')])?!![]:_0x531423[_0x16b6('0x126')];var _0x421306=uuid['v4']();_0x5257b4[_0x16b6('0x20')][_0x421306]=new Action(_0x531423,_0x32c269,_0x421306);loggerBooked['info'](_0x16b6('0x1e7'),_0x421306,'queueStatusComplete:\x20',JSON[_0x16b6('0x42')](_0x531423[_0x16b6('0x126')]),'Queue:\x20',_0x531423[_0x16b6('0x37')]);if(_0x531423[_0x16b6('0x126')]){_0x531423[_0x16b6('0x126')]=![];_0x5257b4[_0x16b6('0x24')][_0x5257b4[_0x16b6('0x20')][_0x421306][_0x16b6('0xac')]]=[];ami[_0x16b6('0xa8')]({'actionid':_0x421306,'action':'queuestatus','queue':_0x531423[_0x16b6('0x37')]})['catch'](function(){_0x5257b4['updateOriginated'](_0x531423);_0x5257b4['rescheduleContact']({'active':![],'ContactId':_0x5257b4['actions'][_0x421306][_0x16b6('0xf2')],'ListId':_0x5257b4[_0x16b6('0x20')][_0x421306][_0x16b6('0xca')],'VoiceQueueId':_0x5257b4[_0x16b6('0x20')][_0x421306][_0x16b6('0xcc')]||undefined,'CampaignId':_0x5257b4['actions'][_0x421306][_0x16b6('0xcd')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5257b4[_0x16b6('0x20')][_0x421306];});}else{loggerBooked[_0x16b6('0x74')](_0x16b6('0x1e8'),JSON[_0x16b6('0x42')](_0x531423[_0x16b6('0x126')]),'Queue:\x20',_0x531423[_0x16b6('0x37')]);_0x5257b4[_0x16b6('0xab')](_0x531423);_0x5257b4[_0x16b6('0xba')]({'active':![],'ContactId':_0x5257b4[_0x16b6('0x20')][_0x421306][_0x16b6('0xf2')],'ListId':_0x5257b4[_0x16b6('0x20')][_0x421306][_0x16b6('0xca')],'VoiceQueueId':_0x5257b4[_0x16b6('0x20')][_0x421306]['VoiceQueueId']||undefined,'CampaignId':_0x5257b4[_0x16b6('0x20')][_0x421306]['CampaignId']||undefined})[_0x16b6('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5257b4['actions'][_0x421306];}}else{return _0x5257b4[_0x16b6('0x160')](_0x531423,_0x32c269);}}else{if(getDiff(_0x32c269[_0x16b6('0x1e9')])<_0x531423['dialRecallMeTimeout']*0x3c){if(_0x32c269['Agent']&&!_0x32c269[_0x16b6('0x1ea')][_0x16b6('0x1eb')]){_0x5257b4[_0x16b6('0x8e')][_0x16b6('0x129')](_0x32c269['id'])[_0x16b6('0x18e')](function(){_0x5257b4['updateOriginated'](_0x531423);});}else{_0x5257b4[_0x16b6('0xbb')]({'active':![]},_0x32c269['id'],0x1)[_0x16b6('0x18e')](function(){_0x5257b4[_0x16b6('0xab')](_0x531423);});}}else{_0x531423['outboundReCallsDay']+=0x1;_0x5257b4[_0x16b6('0xab')](_0x531423);if(_0x531423[_0x16b6('0x1ec')]){_0x5257b4[_0x16b6('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x32c269[_0x16b6('0xf2')],'ListId':_0x32c269[_0x16b6('0xca')],'VoiceQueueId':_0x32c269[_0x16b6('0xcc')]||undefined,'CampaignId':_0x32c269[_0x16b6('0xcd')]||undefined})[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1ed')));_0x5257b4[_0x16b6('0xc4')](createObjHistory(_0x531423,_0x32c269,_0x16b6('0x1ee'),0x17,_0x16b6('0x1ef')))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0x1f0')));}else{_0x5257b4[_0x16b6('0xc9')](createObjHistory(_0x531423,_0x32c269,_0x16b6('0x1f1'),0x16,_0x16b6('0x1f2')),_0x16b6('0x1f3'),_0x16b6('0x1f4'));}}}}else{_0x531423['outboundBlacklistCallsDay']+=0x1;_0x5257b4['saveInDb'](createObjHistory(_0x531423,_0x32c269,_0x16b6('0x1f5'),0xd,_0x16b6('0x1f6')),_0x16b6('0x1f7'),_0x16b6('0x1f8'));throw _0x16b6('0x1f9');}};};Dialer['prototype'][_0x16b6('0x156')]=function(_0x5163fb){var _0x51d5e2=this;var _0x3a3f51=_0x5163fb[_0x16b6('0x1fa')]-_0x5163fb[_0x16b6('0x67')]-_0x5163fb[_0x16b6('0xbe')];emitCampaignSummary(_0x5163fb);if(_0x3a3f51>0x0){if(_0x3a3f51>this[_0x16b6('0x1f')]){_0x3a3f51=this[_0x16b6('0x1f')];}_0x5163fb[_0x16b6('0xbe')]+=_0x3a3f51;this[_0x16b6('0xbf')](_0x5163fb['id'],_0x3a3f51,_0x5163fb[_0x16b6('0x1fb')],_0x5163fb)['then'](function(_0x2324b2){_0x5163fb[_0x16b6('0xbe')]-=_0x3a3f51;_0x5163fb[_0x16b6('0xbe')]=_0x5163fb[_0x16b6('0xbe')]>0x0?_0x5163fb['temp']:0x0;if(!checkContactEmpty(_0x2324b2)){_0x5163fb[_0x16b6('0x35')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x16b6('0x1fc')+_0x5163fb[_0x16b6('0x37')]);}else{_0x5163fb[_0x16b6('0x67')]+=_0x2324b2[_0x16b6('0x12d')];_0x5163fb[_0x16b6('0x35')]='RUNNING';for(var _0x5bd7c2=0x0;_0x5bd7c2<_0x2324b2[_0x16b6('0x12d')];_0x5bd7c2+=0x1){_0x5163fb[_0x16b6('0x1fd')]+=0x1;if(_[_0x16b6('0xa7')](_0x2324b2[_0x5bd7c2])||_[_0x16b6('0xa7')](_0x2324b2[_0x5bd7c2]['Contact'])||_['isNil'](_0x2324b2[_0x5bd7c2][_0x16b6('0x163')][_0x16b6('0x164')])){_0x51d5e2[_0x16b6('0xc8')](_0x16b6('0x1fe'),_0x5163fb,_0x2324b2[_0x5bd7c2]);}else{_0x51d5e2[_0x16b6('0xb6')](_[_0x16b6('0x124')](_0x2324b2[_0x5bd7c2],[_0x16b6('0xcd'),_0x16b6('0x1ff')]))[_0x16b6('0xb1')](_0x51d5e2['checkContactBlack'](_0x5163fb,_0x2324b2[_0x5bd7c2]))[_0x16b6('0xb2')](_0x51d5e2[_0x16b6('0xc7')](_0x16b6('0x200'),_0x5163fb));}}}})[_0x16b6('0xb2')](loggerGetContactDialer(_0x16b6('0x201'),_0x5163fb,_0x3a3f51));}};Dialer['prototype'][_0x16b6('0x150')]=function(_0x416176,_0x28cdfe){var _0x556854=this;var _0x5a88b3=[];var _0x4d7fb5=_0x28cdfe>=0x1?_0x28cdfe:0x1;if(_0x416176[_0x16b6('0x14e')]===_0x16b6('0x9')){_0x4d7fb5=0x1;}var _0x1660a9=Math[_0x16b6('0x1c4')](_0x416176[_0x16b6('0x48')]*_0x4d7fb5)-_0x416176['originated']-_0x416176[_0x16b6('0xbe')];emitVoiceQueueSummary(_0x416176);if(_0x416176[_0x16b6('0x202')]>0x0){var _0x588540=_0x416176[_0x16b6('0x202')]-_0x416176[_0x16b6('0x67')]-_0x416176[_0x16b6('0x4c')]-_0x416176[_0x16b6('0xbe')]-_0x416176['pTalking'];if(_0x1660a9>_0x588540){_0x1660a9=_0x588540;}}if(_0x1660a9>0x0){if(_0x416176['dialMethod']===_0x16b6('0x9')){_0x1660a9=0x1;}if(_0x1660a9>this['maxNumberOriginate']){_0x1660a9=this['maxNumberOriginate'];}_0x416176[_0x16b6('0xbe')]+=_0x1660a9;for(var _0x496905 in this[_0x16b6('0x1d')]){if(typeof this[_0x16b6('0x1d')][_0x496905]!=='undefined'){if(this['agents'][_0x496905]['state']===_0x16b6('0x203')&&this[_0x16b6('0x1d')][_0x496905]['status']==='reachable'){_0x5a88b3[_0x16b6('0x141')](this[_0x16b6('0x1d')][_0x496905]['id']);}}}this[_0x16b6('0xbd')](_0x416176['id'],_0x5a88b3,_0x1660a9,_0x416176[_0x16b6('0x1fb')],_0x416176)[_0x16b6('0xb1')](function(_0x374025){_0x416176[_0x16b6('0xbe')]-=_0x1660a9;_0x416176[_0x16b6('0xbe')]=_0x416176[_0x16b6('0xbe')]>0x0?_0x416176[_0x16b6('0xbe')]:0x0;if(!checkContactEmpty(_0x374025)){_0x556854[_0x16b6('0xaf')](_0x416176)[_0x16b6('0xb1')](sendMessageReschedule(_0x416176))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xb3')));}else{_0x416176[_0x16b6('0x67')]+=_0x374025[_0x16b6('0x12d')];_0x416176['message']=_0x416176[_0x16b6('0x14e')]===_0x16b6('0x9')?_0x16b6('0x16c'):'RUNNING';for(var _0x52de64=0x0;_0x52de64<_0x374025[_0x16b6('0x12d')];_0x52de64+=0x1){if(_[_0x16b6('0xa7')](_0x374025[_0x52de64])||_[_0x16b6('0xa7')](_0x374025[_0x52de64]['Contact'])||_['isNil'](_0x374025[_0x52de64]['Contact'][_0x16b6('0x164')])){_0x556854['emptyContact'](_0x16b6('0x1fe'),_0x416176,_0x374025[_0x52de64]);}else{_0x556854[_0x16b6('0xb4')](_[_0x16b6('0x124')](_0x374025[_0x52de64],[_0x16b6('0xcc'),'Contact.phone']))['then'](_0x556854[_0x16b6('0x1e6')](_0x416176,_0x374025[_0x52de64]))[_0x16b6('0xb2')](_0x556854[_0x16b6('0xc7')](_0x16b6('0x1fe'),_0x416176));}}}})['catch'](loggerGetContactDialer(_0x16b6('0x204'),_0x416176,_0x1660a9));}};Dialer[_0x16b6('0xa3')][_0x16b6('0x8c')]=function(_0xb4038b){if(_0xb4038b['dialLimitQueue']>0x0){var _0xb6f856=_0xb4038b[_0x16b6('0x202')]-_0xb4038b[_0x16b6('0x67')]-_0xb4038b[_0x16b6('0x4c')];if(_0xb6f856>0x0){this[_0x16b6('0x205')](_0xb4038b);}else{loggerPredictiveCalls[_0x16b6('0x74')]('[handlePredictive][limitChannel]');}}else{this[_0x16b6('0x205')](_0xb4038b);}};Dialer[_0x16b6('0xa3')][_0x16b6('0x205')]=function(_0x2f0154){var _0x1404d8=this;var _0x1ad380=[];_0x2f0154[_0x16b6('0x67')]+=0x1;for(var _0x57eb7a in this['agents']){if(typeof this[_0x16b6('0x1d')][_0x57eb7a]!==_0x16b6('0x94')){if(this[_0x16b6('0x1d')][_0x57eb7a][_0x16b6('0xe2')]==='not_inuse'&&this[_0x16b6('0x1d')][_0x57eb7a][_0x16b6('0xa9')]==='reachable'){_0x1ad380[_0x16b6('0x141')](this['agents'][_0x57eb7a]['id']);}}}this[_0x16b6('0xbd')](_0x2f0154['id'],_0x1ad380,0x1,_0x2f0154[_0x16b6('0x1fb')],_0x2f0154)['then'](function(_0x4f06f5){if(!checkContactEmpty(_0x4f06f5)){checkContactLowerLimitOriginate(_0x2f0154,0x1,0x0);_0x1404d8[_0x16b6('0xaf')](_0x2f0154)[_0x16b6('0xb1')](sendMessageReschedule(_0x2f0154))[_0x16b6('0xb2')](loggerCatch(_0x16b6('0xb3')));}else{_0x2f0154[_0x16b6('0x35')]='RUNNING';if(_[_0x16b6('0xa7')](_0x4f06f5[0x0])||_[_0x16b6('0xa7')](_0x4f06f5[0x0][_0x16b6('0x163')])||_[_0x16b6('0xa7')](_0x4f06f5[0x0]['Contact']['phone'])){_0x1404d8['emptyContact'](_0x16b6('0x1fe'),_0x2f0154,_0x4f06f5[0x0]);}else{_0x1404d8[_0x16b6('0xb4')](_[_0x16b6('0x124')](_0x4f06f5[0x0],['VoiceQueueId',_0x16b6('0x1ff')]))[_0x16b6('0xb1')](_0x1404d8[_0x16b6('0x1e6')](_0x2f0154,_0x4f06f5[0x0]))[_0x16b6('0xb2')](_0x1404d8[_0x16b6('0xc7')](_0x16b6('0x206'),_0x2f0154));}}})[_0x16b6('0xb2')](loggerGetContactDialer(_0x16b6('0x207'),_0x2f0154,0x1));emitVoiceQueueSummary(_0x2f0154);};Dialer[_0x16b6('0xa3')]['abandonmentRate']=function(_0x2d2ac3,_0x5317f1,_0x349e47,_0x2c2d66,_0x9fa7eb,_0xc9ed1c){loggerPredictive[_0x16b6('0x74')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x16b6('0x74')](_0x16b6('0x208'),_0x2d2ac3);loggerPredictive[_0x16b6('0x74')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5317f1);loggerPredictive[_0x16b6('0x74')]('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',_0x349e47);loggerPredictive[_0x16b6('0x74')]('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',_0x2c2d66);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x209'),_0x9fa7eb);loggerPredictive[_0x16b6('0x74')]('---------------------------');return new BPromise(function(_0x3598e3,_0x9e32f){if(_0x2d2ac3<=0x0||isNaN(_0x2d2ac3)){return _0x9e32f(msgResponse(_0x16b6('0x20a'),_0x16b6('0x41'),_0x16b6('0x20b')+_0x2d2ac3));}if(_0x349e47<=0x0||isNaN(_0x349e47)){return _0x9e32f(msgResponse(_0x16b6('0x20a'),_0x16b6('0x41'),_0x16b6('0x20c')+_0x349e47));}if(_0x2c2d66<=0x0||isNaN(_0x2c2d66)){return _0x9e32f(msgResponse(_0x16b6('0x20a'),_0x16b6('0x41'),'p\x20=\x20'+_0x2c2d66));}if(_0x5317f1<=0x0||isNaN(_0x5317f1)){return _0x9e32f(msgResponse(_0x16b6('0x20a'),'Error',_0x16b6('0x20d')+_0x5317f1));}if(_0x9fa7eb<=0x0||isNaN(_0x9fa7eb)){return _0x9e32f(msgResponse(_0x16b6('0x20a'),_0x16b6('0x41'),'Amax\x20=\x20'+_0x9fa7eb));}_0xc9ed1c=_0xc9ed1c||0x0;var _0x4de38a=0x1/_0x349e47;var _0x286cda=0x0;var _0x419037=0x0;var _0x5ab723=0x0;var _0x4b6f42=0x0;for(var _0x28fafa=0x0;_0x5ab723<_0x9fa7eb;_0x28fafa+=0x1){_0x419037=_0x28fafa/_0x5317f1;_0x286cda=(_0x2c2d66*_0x419037+_0xc9ed1c)/_0x4de38a;_0x5ab723=erlangb(_0x286cda,_0x2d2ac3);_0x4b6f42=_0x286cda/_0x2d2ac3*(0x1-erlangb(_0x286cda,_0x2d2ac3));}return _0x3598e3({'erlangCalls':_0x28fafa,'erlangCallToSecond':_0x5317f1/_0x28fafa,'erlangAbandonmentRate':_0x5ab723,'erlangBusyFactor':_0x4b6f42});});};Dialer['prototype'][_0x16b6('0x1dc')]=function(_0xe7e589,_0x117788,_0x2a10a4,_0x5b83cd,_0x574e67,_0x1f8c4f){loggerPredictive[_0x16b6('0x74')](_0x16b6('0x20e'));loggerPredictive[_0x16b6('0x74')]('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',_0xe7e589);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x20f'),_0x117788);loggerPredictive['info'](_0x16b6('0x210'),_0x2a10a4);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x211'),_0x5b83cd);loggerPredictive[_0x16b6('0x74')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x574e67);loggerPredictive[_0x16b6('0x74')](_0x16b6('0x7f'));return new BPromise(function(_0x553de4,_0x5a1c2c){if(_0xe7e589<=0x0||isNaN(_0xe7e589)){return _0x5a1c2c(msgResponse(_0x16b6('0x212'),_0x16b6('0x41'),_0x16b6('0x20b')+_0xe7e589));}if(_0x2a10a4<=0x0||isNaN(_0x2a10a4)){return _0x5a1c2c(msgResponse(_0x16b6('0x212'),_0x16b6('0x41'),_0x16b6('0x20c')+_0x2a10a4));}if(_0x5b83cd<=0x0||isNaN(_0x5b83cd)){return _0x5a1c2c(msgResponse('[busyFactor]',_0x16b6('0x41'),_0x16b6('0x213')+_0x5b83cd));}if(_0x117788<=0x0||isNaN(_0x117788)){return _0x5a1c2c(msgResponse(_0x16b6('0x212'),'Error','interval\x20=\x20'+_0x117788));}if(_0x574e67<=0x0||isNaN(_0x574e67)){return _0x5a1c2c(msgResponse(_0x16b6('0x212'),_0x16b6('0x41'),'Umin\x20=\x20'+_0x574e67));}_0x1f8c4f=_0x1f8c4f||0x0;var _0x1642d0=0x1/_0x2a10a4;var _0x107644=0x0;var _0x5ce6eb=0x0;var _0x466443=0x0;var _0x1f3fc9=0x0;for(var _0x587fd5=0x0;_0x1f3fc9<_0x574e67;_0x587fd5+=0x1){_0x5ce6eb=_0x587fd5/_0x117788;_0x107644=(_0x5b83cd*_0x5ce6eb+_0x1f8c4f)/_0x1642d0;_0x466443=erlangb(_0x107644,_0xe7e589);_0x1f3fc9=_0x107644/_0xe7e589*(0x1-erlangb(_0x107644,_0xe7e589));}return _0x553de4({'erlangCalls':_0x587fd5,'erlangCallToSecond':_0x117788/_0x587fd5,'erlangAbandonmentRate':_0x466443,'erlangBusyFactor':_0x1f3fc9});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 25c035d..67dc826 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdc0=['number','starttime','responsetime','droptime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum'];(function(_0x1c37cb,_0x214f8e){var _0x2c221e=function(_0x66fcc5){while(--_0x66fcc5){_0x1c37cb['push'](_0x1c37cb['shift']());}};_0x2c221e(++_0x214f8e);}(_0xbdc0,0x133));var _0x0bdc=function(_0x3f82b5,_0xf5d617){_0x3f82b5=_0x3f82b5-0x0;var _0x2f72ab=_0xbdc0[_0x3f82b5];return _0x2f72ab;};'use strict';var util=require('util');var _=require(_0x0bdc('0x0'));var moment=require(_0x0bdc('0x1'));function getSeconds(_0x50d272,_0x4999d4){var _0x4e1f6d=moment(_0x50d272)['milliseconds'](0x0);var _0x211880=moment(_0x4999d4)[_0x0bdc('0x2')](0x0);return _0x4e1f6d[_0x0bdc('0x3')](_0x211880,'seconds');}function QueueCallerAbandon(_0x418add,_0x6f2ef7){this['scheduledat']=_0x418add['scheduledat'];this[_0x0bdc('0x4')]=_0x418add[_0x0bdc('0x4')];this[_0x0bdc('0x5')]=_0x418add[_0x0bdc('0x4')]===_0x0bdc('0x6')?_0x0bdc('0x7'):_0x418add[_0x0bdc('0x4')];this[_0x0bdc('0x8')]=_0x418add[_0x0bdc('0x8')];this[_0x0bdc('0x9')]=_0x418add[_0x0bdc('0x9')];this[_0x0bdc('0xa')]=_0x418add[_0x0bdc('0xa')];this[_0x0bdc('0xb')]=_0x418add[_0x0bdc('0x8')]+_0x418add[_0x0bdc('0x9')]+_0x418add[_0x0bdc('0xa')]+_0x418add[_0x0bdc('0xc')]+_0x418add[_0x0bdc('0xd')]+_0x418add[_0x0bdc('0xe')]+_0x418add[_0x0bdc('0xf')]+_0x418add['countagentrejectretry'];this[_0x0bdc('0xc')]=_0x418add[_0x0bdc('0xc')];this[_0x0bdc('0xd')]=_0x418add[_0x0bdc('0xd')];this[_0x0bdc('0xe')]=_0x418add['countabandonedretry'];this[_0x0bdc('0xf')]=_0x418add[_0x0bdc('0xf')];this[_0x0bdc('0x10')]=_0x418add['countagentrejectretry'];this[_0x0bdc('0x11')]=_0x6f2ef7[_0x0bdc('0x11')];this[_0x0bdc('0x12')]=_0x418add[_0x0bdc('0x13')];this[_0x0bdc('0x14')]=_0x418add[_0x0bdc('0x15')];this['starttime']=_0x418add[_0x0bdc('0x16')];this['responsetime']=_0x418add[_0x0bdc('0x17')];this[_0x0bdc('0x18')]=_0x418add[_0x0bdc('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x418add[_0x0bdc('0x17')],_0x418add[_0x0bdc('0x16')]);this[_0x0bdc('0x19')]=getSeconds(this['droptime'],_0x418add['responsetime']);this[_0x0bdc('0x1a')]=0x0;this[_0x0bdc('0x7')]=_0x6f2ef7[_0x0bdc('0x7')];this['membername']=_0x6f2ef7[_0x0bdc('0x1b')];this['reason']=_0x6f2ef7[_0x0bdc('0x1c')];this['callback']=_0x418add[_0x0bdc('0x1d')];this[_0x0bdc('0x1e')]=_0x418add[_0x0bdc('0x1e')];this[_0x0bdc('0x1f')]=_0x418add['callbackat'];this['recallme']=_0x418add[_0x0bdc('0x20')];this[_0x0bdc('0x21')]=_0x418add[_0x0bdc('0x21')];this[_0x0bdc('0x22')]=_0x418add[_0x0bdc('0x22')];this['UserId']=_0x418add[_0x0bdc('0x23')];this[_0x0bdc('0x24')]=_0x418add[_0x0bdc('0x24')];this[_0x0bdc('0x25')]=_0x418add[_0x0bdc('0x25')];this[_0x0bdc('0x26')]=_0x418add[_0x0bdc('0x26')]||'';this[_0x0bdc('0x27')]=_0x418add[_0x0bdc('0x27')]||'';}module[_0x0bdc('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xe953=['callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','droptime','responsetime','holdtime','queue','membername','reason','callback','callbackuniqueid'];(function(_0x2af0f9,_0x52a09a){var _0x11fb1b=function(_0x22c658){while(--_0x22c658){_0x2af0f9['push'](_0x2af0f9['shift']());}};_0x11fb1b(++_0x52a09a);}(_0xe953,0xf9));var _0x3e95=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xe953[_0x454018];return _0x24697d;};'use strict';var util=require(_0x3e95('0x0'));var _=require(_0x3e95('0x1'));var moment=require(_0x3e95('0x2'));function getSeconds(_0x4ab01c,_0x8dbd4f){var _0x1762e9=moment(_0x4ab01c)[_0x3e95('0x3')](0x0);var _0x30e34e=moment(_0x8dbd4f)[_0x3e95('0x3')](0x0);return _0x1762e9[_0x3e95('0x4')](_0x30e34e,_0x3e95('0x5'));}function QueueCallerAbandon(_0x57fc59,_0x4ec1b2){this[_0x3e95('0x6')]=_0x57fc59['scheduledat'];this[_0x3e95('0x7')]=_0x57fc59['type'];this[_0x3e95('0x8')]=_0x57fc59[_0x3e95('0x7')]==='outbound'?'queue':_0x57fc59[_0x3e95('0x7')];this['countbusyretry']=_0x57fc59[_0x3e95('0x9')];this['countcongestionretry']=_0x57fc59['countcongestionretry'];this[_0x3e95('0xa')]=_0x57fc59[_0x3e95('0xa')];this[_0x3e95('0xb')]=_0x57fc59['countbusyretry']+_0x57fc59[_0x3e95('0xc')]+_0x57fc59[_0x3e95('0xa')]+_0x57fc59[_0x3e95('0xd')]+_0x57fc59[_0x3e95('0xe')]+_0x57fc59[_0x3e95('0xf')]+_0x57fc59['countmachineretry']+_0x57fc59[_0x3e95('0x10')];this[_0x3e95('0xd')]=_0x57fc59[_0x3e95('0xd')];this['countdropretry']=_0x57fc59[_0x3e95('0xe')];this[_0x3e95('0xf')]=_0x57fc59[_0x3e95('0xf')];this[_0x3e95('0x11')]=_0x57fc59[_0x3e95('0x11')];this[_0x3e95('0x10')]=_0x57fc59[_0x3e95('0x10')];this['uniqueid']=_0x4ec1b2[_0x3e95('0x12')];this[_0x3e95('0x13')]=_0x57fc59[_0x3e95('0x14')];this['calleridnum']=_0x57fc59[_0x3e95('0x15')];this[_0x3e95('0x16')]=_0x57fc59[_0x3e95('0x16')];this['responsetime']=_0x57fc59['responsetime'];this[_0x3e95('0x17')]=_0x57fc59['droptime'];this['endtime']=this[_0x3e95('0x17')];this['ringtime']=getSeconds(_0x57fc59[_0x3e95('0x18')],_0x57fc59[_0x3e95('0x16')]);this[_0x3e95('0x19')]=getSeconds(this['droptime'],_0x57fc59[_0x3e95('0x18')]);this['talktime']=0x0;this[_0x3e95('0x1a')]=_0x4ec1b2[_0x3e95('0x1a')];this[_0x3e95('0x1b')]=_0x4ec1b2['connectedlinename'];this['reason']=_0x4ec1b2[_0x3e95('0x1c')];this['callback']=_0x57fc59[_0x3e95('0x1d')];this[_0x3e95('0x1e')]=_0x57fc59['callbackuniqueid'];this[_0x3e95('0x1f')]=_0x57fc59['callbackat'];this[_0x3e95('0x20')]=_0x57fc59[_0x3e95('0x20')];this[_0x3e95('0x21')]=_0x57fc59[_0x3e95('0x21')];this[_0x3e95('0x22')]=_0x57fc59[_0x3e95('0x22')];this[_0x3e95('0x23')]=_0x57fc59[_0x3e95('0x23')];this['VoiceQueueId']=_0x57fc59['VoiceQueueId'];this[_0x3e95('0x24')]=_0x57fc59[_0x3e95('0x24')];this['originatecalleridnum']=_0x57fc59[_0x3e95('0x25')]||'';this[_0x3e95('0x26')]=_0x57fc59[_0x3e95('0x26')]||'';}module[_0x3e95('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 9e7240e..ef0029f 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(_0x54d6a8,_0xc7baae){var _0x4ff991=function(_0x4713e7){while(--_0x4713e7){_0x54d6a8['push'](_0x54d6a8['shift']());}};_0x4ff991(++_0xc7baae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x4f4f2a,_0x3a26fb){var _0x128ac9=function(_0x1ab19){while(--_0x1ab19){_0x4f4f2a['push'](_0x4f4f2a['shift']());}};_0x128ac9(++_0x3a26fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 20d6d13..1691b98 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 _0x1775=['../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','channelstate','channelstatedesc','value','operation','status','filename','remotestationid','pagestransferred','transferrate','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','calleridnum','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var _=require(_0x5177('0x0'));var BPromise=require(_0x5177('0x1'));var uuid=require(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var path=require(_0x5177('0x4'));var tiff2pdf=require(_0x5177('0x5'));var gs=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var ami=require(_0x5177('0x9'));var rpcDb=require(_0x5177('0xa'));var Channel=require(_0x5177('0xb'));var ut=require(_0x5177('0xc'));var Action=require(_0x5177('0xd'));var faxAccount=require(_0x5177('0xe'));var attachment=require(_0x5177('0xf'));var faxMessage=require(_0x5177('0x10'));function Fax(_0x3ce288){this[_0x5177('0x11')]={};this[_0x5177('0x12')]=_0x3ce288[_0x5177('0x12')];this[_0x5177('0x13')]=_0x3ce288['trunks'];this['actions']={};ami['on'](_0x5177('0x14'),this[_0x5177('0x15')][_0x5177('0x16')](this));ami['on'](_0x5177('0x17'),this[_0x5177('0x18')]['bind'](this));ami['on'](_0x5177('0x19'),this[_0x5177('0x1a')][_0x5177('0x16')](this));ami['on'](_0x5177('0x1b'),this[_0x5177('0x1c')][_0x5177('0x16')](this));ami['on'](_0x5177('0x1d'),this[_0x5177('0x1e')][_0x5177('0x16')](this));ami['on'](_0x5177('0x1f'),this[_0x5177('0x20')][_0x5177('0x16')](this));ami['on'](_0x5177('0x21'),this[_0x5177('0x22')][_0x5177('0x16')](this));ami['on'](_0x5177('0x23'),this[_0x5177('0x24')][_0x5177('0x16')](this));}Fax[_0x5177('0x25')]['syncNewchannel']=function(_0x288e3f){if(_0x288e3f[_0x5177('0x26')]===_0x5177('0x27')){for(var _0x1b4102 in this['faxAccounts']){if(this[_0x5177('0x12')][_0x5177('0x28')](_0x1b4102)){if(_0x288e3f[_0x5177('0x29')]===this['faxAccounts'][_0x1b4102][_0x5177('0x2a')]){this['channels'][_0x288e3f[_0x5177('0x2b')]]={};this[_0x5177('0x11')][_0x288e3f[_0x5177('0x2b')]][_0x5177('0x2c')]=_0x288e3f[_0x5177('0x2c')];this[_0x5177('0x11')][_0x288e3f[_0x5177('0x2b')]]['id']=this[_0x5177('0x12')][_0x1b4102]['id'];this[_0x5177('0x11')][_0x288e3f[_0x5177('0x2b')]][_0x5177('0x2d')]=this[_0x5177('0x12')][_0x1b4102]['name'];logger[_0x5177('0x2e')](_0x288e3f['uniqueid'],_0x5177('0x2f'));}}}}if(this[_0x5177('0x30')][_0x288e3f[_0x5177('0x2b')]]){this[_0x5177('0x11')][_0x288e3f['uniqueid']]={};this[_0x5177('0x11')][_0x288e3f['uniqueid']]['channel']=_0x288e3f[_0x5177('0x2c')];logger[_0x5177('0x2e')](_0x288e3f['uniqueid'],_0x5177('0x2f'));}};Fax['prototype'][_0x5177('0x18')]=function(_0x1cbd29){if(this['channels'][_0x1cbd29[_0x5177('0x2b')]]){for(var _0x2554ec in _0x1cbd29[_0x5177('0x31')]){if(_0x1cbd29[_0x5177('0x31')][_0x5177('0x28')](_0x2554ec)){this[_0x5177('0x11')][_0x1cbd29['uniqueid']][_0x2554ec]=_0x1cbd29['value'];}}}};Fax[_0x5177('0x25')][_0x5177('0x1a')]=function(_0x7dae59){if(this[_0x5177('0x11')][_0x7dae59[_0x5177('0x2b')]]){this[_0x5177('0x11')][_0x7dae59[_0x5177('0x2b')]][_0x5177('0x32')]=_0x7dae59['channelstate'];this[_0x5177('0x11')][_0x7dae59[_0x5177('0x2b')]]['channelstatedesc']=_0x7dae59[_0x5177('0x33')];}};Fax['prototype'][_0x5177('0x1c')]=function(_0x1a2c46){if(this[_0x5177('0x11')][_0x1a2c46['uniqueid']]){for(var _0x4f70df in _0x1a2c46[_0x5177('0x31')]){if(_0x1a2c46[_0x5177('0x31')][_0x5177('0x28')](_0x4f70df)){this[_0x5177('0x11')][_0x1a2c46[_0x5177('0x2b')]][_0x4f70df]=_0x1a2c46[_0x5177('0x34')];}}}};Fax[_0x5177('0x25')][_0x5177('0x1e')]=function(_0x513095){if(this[_0x5177('0x11')][_0x513095[_0x5177('0x2b')]]){this['channels'][_0x513095[_0x5177('0x2b')]][_0x5177('0x35')]=_0x513095[_0x5177('0x35')];this[_0x5177('0x11')][_0x513095[_0x5177('0x2b')]][_0x5177('0x36')]=_0x513095['status'];this[_0x5177('0x11')][_0x513095[_0x5177('0x2b')]][_0x5177('0x2a')]=_0x513095[_0x5177('0x2a')];this[_0x5177('0x11')][_0x513095[_0x5177('0x2b')]][_0x5177('0x37')]=_0x513095['filename'];logger[_0x5177('0x2e')](_0x513095[_0x5177('0x2b')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x5177('0x20')]=function(_0x188cec){var _0x22365a=this;if(this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]]){var _0x1ea3be=this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]]['id'];this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]][_0x5177('0x38')]=_0x188cec[_0x5177('0x38')];this[_0x5177('0x11')][_0x188cec['uniqueid']][_0x5177('0x39')]=_0x188cec[_0x5177('0x39')];this['channels'][_0x188cec[_0x5177('0x2b')]]['localstationid']=_0x188cec[_0x5177('0x2a')];this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]]['resolution']=_0x188cec['resolution'];this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]][_0x5177('0x3a')]=_0x188cec[_0x5177('0x3a')];this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]][_0x5177('0x37')]=_0x188cec[_0x5177('0x37')];this['channels'][_0x188cec[_0x5177('0x2b')]]['calleridnum']=_0x188cec['calleridnum'];if(this[_0x5177('0x11')][_0x188cec[_0x5177('0x2b')]]['pagestransferred']>0x0){tiff2pdf(_0x188cec[_0x5177('0x37')],'/var/opt/motion2/server/files/attachments/',function(_0x4aae02){logger[_0x5177('0x2e')](_0x188cec[_0x5177('0x2b')],_0x5177('0x3b'),_0x4aae02[_0x5177('0x3c')]);attachment[_0x5177('0x3d')]({'name':path[_0x5177('0x3e')](_0x188cec[_0x5177('0x37')])['name'],'basename':path['parse'](_0x188cec[_0x5177('0x37')])['name']+_0x5177('0x3f'),'type':_0x5177('0x40')})[_0x5177('0x41')](function(_0x3ed103){faxAccount['notify'](_0x1ea3be,{'from':_0x188cec[_0x5177('0x42')],'mapKey':_0x5177('0x8'),'body':path[_0x5177('0x3e')](_0x188cec[_0x5177('0x37')])[_0x5177('0x2d')]+_0x5177('0x3f'),'AttachmentId':_0x3ed103['id']})[_0x5177('0x43')](function(_0xa24b4d){logger[_0x5177('0x44')](_0x188cec[_0x5177('0x2b')],_0x5177('0x45'),JSON['stringify'](_0xa24b4d));});})[_0x5177('0x43')](function(_0x481bda){logger['error'](_0x188cec['uniqueid'],_0x5177('0x46'),JSON[_0x5177('0x47')](_0x481bda));});});}logger['info'](_0x188cec[_0x5177('0x2b')],_0x5177('0x46'));}};Fax[_0x5177('0x25')]['syncOriginateResponse']=function(_0x1d4ae4){if(this['actions'][_0x1d4ae4['uniqueid']]){_['merge'](this[_0x5177('0x11')][_0x1d4ae4[_0x5177('0x2b')]],_[_0x5177('0x48')](_0x1d4ae4,['response','reason']));}};function updateStatus(_0x42b827){if(_0x42b827['AttachmentId']){faxMessage[_0x5177('0x49')](_0x42b827[_0x5177('0x4a')],{'failMessage':_0x5177('0x4b')})[_0x5177('0x41')](function(_0x84233c){ut[_0x5177('0x4c')](_0x5177('0x4d'),_0x84233c);})[_0x5177('0x43')](function(_0x26c878){ut[_0x5177('0x4c')](_0x5177('0x4e'),_0x26c878);});}else{ut[_0x5177('0x4c')](_0x5177('0x4f'));}}Fax['prototype']['updateStatus']=function(_0x29ff0f,_0x5d5016,_0x649c6f){var _0x49aba9=this;var _0x1414b5={};if(_0x5d5016){_0x1414b5={'read':_0x5d5016};}else{_0x1414b5={'failMessage':_0x649c6f};}if(this[_0x5177('0x30')][_0x29ff0f][_0x5177('0x4a')]){faxMessage['update'](this['actions'][_0x29ff0f][_0x5177('0x4a')],_0x1414b5)[_0x5177('0x41')](function(_0x2eb560){ut[_0x5177('0x4c')]('[Fax][Message][Updated]',_0x2eb560);})['catch'](function(_0x3f0e89){ut[_0x5177('0x4c')](_0x5177('0x50'),_0x3f0e89);})[_0x5177('0x51')](function(){delete _0x49aba9['channels'][_0x29ff0f];delete _0x49aba9[_0x5177('0x30')][_0x29ff0f];});}else{ut[_0x5177('0x4c')](_0x5177('0x52'));delete this['channels'][_0x29ff0f];delete this[_0x5177('0x30')][_0x29ff0f];}};Fax[_0x5177('0x25')][_0x5177('0x22')]=function(_0x49e3e3){var _0x975408=this;if(this['channels'][_0x49e3e3[_0x5177('0x2b')]]){if(this[_0x5177('0x30')][_0x49e3e3[_0x5177('0x2b')]]){this['channels'][_0x49e3e3[_0x5177('0x2b')]]['id']=this[_0x5177('0x30')][_0x49e3e3[_0x5177('0x2b')]]['id'];this[_0x5177('0x11')][_0x49e3e3[_0x5177('0x2b')]][_0x5177('0x2d')]=this[_0x5177('0x30')][_0x49e3e3[_0x5177('0x2b')]]['name'];}logger['info'](_0x49e3e3['uniqueid'],this[_0x5177('0x30')][_0x49e3e3[_0x5177('0x2b')]]?_0x5177('0x53'):_0x5177('0x54'),JSON[_0x5177('0x47')](this[_0x5177('0x11')][_0x49e3e3['uniqueid']]));if(this['actions'][_0x49e3e3[_0x5177('0x2b')]]){if(this[_0x5177('0x11')][_0x49e3e3[_0x5177('0x2b')]][_0x5177('0x55')]>0x0&&this[_0x5177('0x11')][_0x49e3e3[_0x5177('0x2b')]][_0x5177('0x1d')]===_0x5177('0x56')){this[_0x5177('0x57')](_0x49e3e3['uniqueid'],!![]);}else{this[_0x5177('0x57')](_0x49e3e3[_0x5177('0x2b')],![],this['channels'][_0x49e3e3[_0x5177('0x2b')]][_0x5177('0x58')]?'SENDING\x20FAILED:\x20'+this[_0x5177('0x11')][_0x49e3e3[_0x5177('0x2b')]][_0x5177('0x58')]:'SENDING\x20FAILED');}}}};Fax[_0x5177('0x25')][_0x5177('0x59')]=function(_0x5f5bd5){var _0x52a6c2=this;return new BPromise(function(_0x102c27,_0x4f76d7){_0x52a6c2[_0x5177('0x5a')](_0x5f5bd5,_0x52a6c2['faxAccounts'][_0x5f5bd5[_0x5177('0x5b')]])[_0x5177('0x41')](function(_0x5a8ada){ut[_0x5177('0x4c')](_0x5177('0x5c'),_0x5a8ada);_0x102c27(ut[_0x5177('0x3c')](_0x5177('0x5d')));})[_0x5177('0x43')](function(_0x2bf11b){ut[_0x5177('0x4c')]('[Fax][execOriginate][failure]',_0x2bf11b);updateStatus(_0x5f5bd5);_0x4f76d7(ut[_0x5177('0x3c')]('Fax\x20failed'));});});};Fax['prototype'][_0x5177('0x5e')]=function(_0x37ecd7){var _0x4eca5c=this;return new BPromise(function(_0x23e0e6,_0xa889bd){var _0x43abdd=_0x4eca5c[_0x5177('0x5f')](_0x4eca5c[_0x5177('0x12')][_0x37ecd7[_0x5177('0x5b')]][_0x5177('0x60')],_0x37ecd7);if(_0x43abdd[_0x5177('0x61')]){_0x23e0e6(ut['message']('Trunk\x20Reachable'));}else{_0xa889bd(ut[_0x5177('0x3c')](_0x43abdd[_0x5177('0x3c')]));}});};function originate(_0x260475,_0x2d24b3,_0x3de0b5){return new BPromise(function(_0x3dd58f,_0x4fc289){if(_0x3de0b5){var _0x3692b2=util[_0x5177('0x62')](_0x5177('0x63'),path[_0x5177('0x3e')](_0x260475['path'])[_0x5177('0x2d')],_0x260475[_0x5177('0x4')]);gs[_0x5177('0x64')](_0x3692b2)[_0x5177('0x41')](function(){_0x260475[_0x5177('0x4')]=util['format'](_0x5177('0x65'),path['parse'](_0x260475[_0x5177('0x4')])[_0x5177('0x66')],path['parse'](_0x260475[_0x5177('0x4')])[_0x5177('0x2d')]);_0x2d24b3[_0x5177('0x67')]=_0x260475[_0x5177('0x4')];ut['logger'](_0x5177('0x68'),'');ami[_0x5177('0x69')](ut[_0x5177('0x6a')](_0x260475,_0x2d24b3))[_0x5177('0x41')](function(_0x50485e){_0x3dd58f(_0x50485e);})[_0x5177('0x43')](function(_0x17456b){_0x4fc289(_0x17456b);});})[_0x5177('0x43')](function(_0x4c8a15){_0x4fc289(_0x4c8a15);});}else{ami['Action'](ut[_0x5177('0x6a')](_0x260475,_0x2d24b3))[_0x5177('0x41')](function(_0x3f42a5){_0x3dd58f(_0x3f42a5);})[_0x5177('0x43')](function(_0xb2aca2){_0x4fc289(_0xb2aca2);});}});}Fax[_0x5177('0x25')][_0x5177('0x5a')]=function(_0x17ad3b,_0x83d5af){var _0x515cc8=this;return new BPromise(function(_0x48388a,_0x597a84){var _0x290315=uuid['v4']();var _0x4a546e=ut[_0x5177('0x6b')](_0x17ad3b,_0x83d5af);_0x515cc8[_0x5177('0x30')][_0x290315]=new Action(_0x290315,_0x83d5af,_0x17ad3b);var _0x56c1aa=_0x515cc8[_0x5177('0x30')][_0x290315];if(path[_0x5177('0x3e')](_0x17ad3b['path'])[_0x5177('0x6c')]===_0x5177('0x3f')){originate(_0x56c1aa,_0x4a546e,!![])[_0x5177('0x41')](function(_0x4fce32){_0x48388a(_0x4fce32);})[_0x5177('0x43')](function(_0x484762){_0x597a84(_0x484762);});}else{originate(_0x56c1aa,_0x4a546e,![])[_0x5177('0x41')](function(_0x45b7ae){_0x48388a(_0x45b7ae);})['catch'](function(_0xe5a705){_0x597a84(_0xe5a705);});}});};Fax[_0x5177('0x25')]['isTrunkReachable']=function(_0x5f0141){return!_[_0x5177('0x6d')](_0x5f0141)&&!_['isNil'](_0x5f0141[_0x5177('0x2d')])&&!_[_0x5177('0x6d')](_0x5f0141['active'])&&_0x5f0141[_0x5177('0x6e')]&&!_[_0x5177('0x6d')](this[_0x5177('0x13')][util[_0x5177('0x62')](_0x5177('0x6f'),_0x5f0141[_0x5177('0x2d')])])&&!_[_0x5177('0x6d')](this[_0x5177('0x13')][util['format'](_0x5177('0x6f'),_0x5f0141['name'])][_0x5177('0x36')])&&(this[_0x5177('0x13')][util[_0x5177('0x62')](_0x5177('0x6f'),_0x5f0141['name'])][_0x5177('0x36')]===_0x5177('0x70')||this['trunks'][util[_0x5177('0x62')](_0x5177('0x6f'),_0x5f0141['name'])][_0x5177('0x36')]==='unmonitored');};Fax[_0x5177('0x25')]['checkTrunk']=function(_0x55fa0a,_0x5cd8a1){if(!this[_0x5177('0x71')](_0x55fa0a)){ut[_0x5177('0x4c')](_0x5177('0x72'),_['isNil'](_0x55fa0a)?'':_0x55fa0a[_0x5177('0x2d')]+_0x5177('0x73'));return{'isValid':![],'message':_0x5177('0x74')};}if(_[_0x5177('0x6d')](_0x5cd8a1[_0x5177('0x8')])){ut['logger'](_0x5177('0x75'),JSON[_0x5177('0x47')](_0x5cd8a1));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x5177('0x6d')](_0x5cd8a1['path'])){ut[_0x5177('0x4c')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x5177('0x47')](_0x5cd8a1));return{'isValid':![],'message':_0x5177('0x76')};}return{'isValid':!![],'message':_0x5177('0x77')};};module[_0x5177('0x78')]=Fax; \ No newline at end of file +var _0x3266=['uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','then','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','status','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird'];(function(_0x4afa69,_0x2d7c8e){var _0xebfd0f=function(_0x52ea70){while(--_0x52ea70){_0x4afa69['push'](_0x4afa69['shift']());}};_0xebfd0f(++_0x2d7c8e);}(_0x3266,0x6a));var _0x6326=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x3266[_0x2fee96];return _0x2e6ad1;};'use strict';var util=require(_0x6326('0x0'));var _=require(_0x6326('0x1'));var BPromise=require(_0x6326('0x2'));var uuid=require(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var path=require(_0x6326('0x5'));var tiff2pdf=require(_0x6326('0x6'));var gs=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('fax');var ami=require(_0x6326('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x6326('0xa'));var ut=require(_0x6326('0xb'));var Action=require(_0x6326('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6326('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2af571){this[_0x6326('0xe')]={};this[_0x6326('0xf')]=_0x2af571[_0x6326('0xf')];this[_0x6326('0x10')]=_0x2af571['trunks'];this[_0x6326('0x11')]={};ami['on'](_0x6326('0x12'),this[_0x6326('0x13')][_0x6326('0x14')](this));ami['on'](_0x6326('0x15'),this[_0x6326('0x16')][_0x6326('0x14')](this));ami['on'](_0x6326('0x17'),this[_0x6326('0x18')][_0x6326('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0x6326('0x14')](this));ami['on'](_0x6326('0x19'),this['syncFaxStatus'][_0x6326('0x14')](this));ami['on']('receivefax',this[_0x6326('0x1a')][_0x6326('0x14')](this));ami['on'](_0x6326('0x1b'),this[_0x6326('0x1c')][_0x6326('0x14')](this));ami['on'](_0x6326('0x1d'),this['syncOriginateResponse'][_0x6326('0x14')](this));}Fax['prototype']['syncNewchannel']=function(_0x55dd9f){if(_0x55dd9f['context']==='from-voip-provider'){for(var _0x58e960 in this[_0x6326('0xf')]){if(this[_0x6326('0xf')][_0x6326('0x1e')](_0x58e960)){if(_0x55dd9f['exten']===this['faxAccounts'][_0x58e960][_0x6326('0x1f')]){this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]]={};this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]][_0x6326('0x21')]=_0x55dd9f[_0x6326('0x21')];this['channels'][_0x55dd9f[_0x6326('0x20')]]['id']=this['faxAccounts'][_0x58e960]['id'];this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]][_0x6326('0x22')]=this[_0x6326('0xf')][_0x58e960][_0x6326('0x22')];logger[_0x6326('0x23')](_0x55dd9f[_0x6326('0x20')],_0x6326('0x24'));}}}}if(this[_0x6326('0x11')][_0x55dd9f[_0x6326('0x20')]]){this[_0x6326('0xe')][_0x55dd9f['uniqueid']]={};this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]]['channel']=_0x55dd9f['channel'];logger['info'](_0x55dd9f[_0x6326('0x20')],'\x20syncNewchannel\x20');}};Fax[_0x6326('0x25')][_0x6326('0x16')]=function(_0x5a907f){if(this[_0x6326('0xe')][_0x5a907f[_0x6326('0x20')]]){for(var _0xb68fec in _0x5a907f[_0x6326('0x26')]){if(_0x5a907f[_0x6326('0x26')][_0x6326('0x1e')](_0xb68fec)){this[_0x6326('0xe')][_0x5a907f[_0x6326('0x20')]][_0xb68fec]=_0x5a907f[_0x6326('0x27')];}}}};Fax[_0x6326('0x25')][_0x6326('0x18')]=function(_0x2a8873){if(this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]){this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]['channelstate']=_0x2a8873[_0x6326('0x28')];this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]['channelstatedesc']=_0x2a8873[_0x6326('0x29')];}};Fax['prototype']['syncNewExten']=function(_0xfb6b62){if(this[_0x6326('0xe')][_0xfb6b62[_0x6326('0x20')]]){for(var _0x103b1c in _0xfb6b62[_0x6326('0x26')]){if(_0xfb6b62[_0x6326('0x26')][_0x6326('0x1e')](_0x103b1c)){this[_0x6326('0xe')][_0xfb6b62[_0x6326('0x20')]][_0x103b1c]=_0xfb6b62[_0x6326('0x27')];}}}};Fax[_0x6326('0x25')][_0x6326('0x2a')]=function(_0x55aa3b){if(this[_0x6326('0xe')][_0x55aa3b[_0x6326('0x20')]]){this['channels'][_0x55aa3b[_0x6326('0x20')]][_0x6326('0x2b')]=_0x55aa3b[_0x6326('0x2b')];this['channels'][_0x55aa3b[_0x6326('0x20')]]['status']=_0x55aa3b['status'];this[_0x6326('0xe')][_0x55aa3b[_0x6326('0x20')]][_0x6326('0x1f')]=_0x55aa3b['localstationid'];this[_0x6326('0xe')][_0x55aa3b['uniqueid']][_0x6326('0x2c')]=_0x55aa3b['filename'];logger[_0x6326('0x23')](_0x55aa3b[_0x6326('0x20')],_0x6326('0x2d'));}};Fax[_0x6326('0x25')][_0x6326('0x1a')]=function(_0x207fb1){var _0x4f6c8a=this;if(this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]]){var _0x489f05=this[_0x6326('0xe')][_0x207fb1['uniqueid']]['id'];this['channels'][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2e')]=_0x207fb1[_0x6326('0x2e')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2f')]=_0x207fb1['pagestransferred'];this['channels'][_0x207fb1[_0x6326('0x20')]]['localstationid']=_0x207fb1[_0x6326('0x1f')];this['channels'][_0x207fb1[_0x6326('0x20')]][_0x6326('0x30')]=_0x207fb1[_0x6326('0x30')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x31')]=_0x207fb1[_0x6326('0x31')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2c')]=_0x207fb1[_0x6326('0x2c')];this['channels'][_0x207fb1[_0x6326('0x20')]]['calleridnum']=_0x207fb1[_0x6326('0x32')];if(this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2f')]>0x0){tiff2pdf(_0x207fb1['filename'],_0x6326('0x33'),function(_0x255a70){logger['info'](_0x207fb1[_0x6326('0x20')],_0x6326('0x34'),_0x255a70[_0x6326('0x35')]);attachment[_0x6326('0x36')]({'name':path['parse'](_0x207fb1[_0x6326('0x2c')])[_0x6326('0x22')],'basename':path[_0x6326('0x37')](_0x207fb1[_0x6326('0x2c')])[_0x6326('0x22')]+_0x6326('0x38'),'type':_0x6326('0x39')})['then'](function(_0x2f6a90){faxAccount[_0x6326('0x3a')](_0x489f05,{'from':_0x207fb1[_0x6326('0x32')],'mapKey':_0x6326('0x3b'),'body':path['parse'](_0x207fb1[_0x6326('0x2c')])['name']+_0x6326('0x38'),'AttachmentId':_0x2f6a90['id']})[_0x6326('0x3c')](function(_0x119559){logger[_0x6326('0x3d')](_0x207fb1[_0x6326('0x20')],'\x20notify\x20',JSON[_0x6326('0x3e')](_0x119559));});})['catch'](function(_0x5e0e2f){logger[_0x6326('0x3d')](_0x207fb1[_0x6326('0x20')],'\x20receiveFax\x20',JSON[_0x6326('0x3e')](_0x5e0e2f));});});}logger[_0x6326('0x23')](_0x207fb1[_0x6326('0x20')],_0x6326('0x3f'));}};Fax[_0x6326('0x25')]['syncOriginateResponse']=function(_0x4af0ee){if(this[_0x6326('0x11')][_0x4af0ee[_0x6326('0x20')]]){_[_0x6326('0x40')](this[_0x6326('0xe')][_0x4af0ee[_0x6326('0x20')]],_[_0x6326('0x41')](_0x4af0ee,[_0x6326('0x42'),'reason']));}};function updateStatus(_0x1b5f5b){if(_0x1b5f5b[_0x6326('0x43')]){faxMessage[_0x6326('0x44')](_0x1b5f5b[_0x6326('0x43')],{'failMessage':_0x6326('0x45')})['then'](function(_0x189bef){ut['logger'](_0x6326('0x46'),_0x189bef);})[_0x6326('0x3c')](function(_0x585dec){ut[_0x6326('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x585dec);});}else{ut[_0x6326('0x47')](_0x6326('0x48'));}}Fax[_0x6326('0x25')][_0x6326('0x49')]=function(_0x58731d,_0x42c8bc,_0xbe6b3e){var _0x5c3641=this;var _0x39f3b1={};if(_0x42c8bc){_0x39f3b1={'read':_0x42c8bc};}else{_0x39f3b1={'failMessage':_0xbe6b3e};}if(this[_0x6326('0x11')][_0x58731d][_0x6326('0x43')]){faxMessage['update'](this[_0x6326('0x11')][_0x58731d][_0x6326('0x43')],_0x39f3b1)['then'](function(_0x16e606){ut['logger'](_0x6326('0x4a'),_0x16e606);})[_0x6326('0x3c')](function(_0x3e9825){ut[_0x6326('0x47')](_0x6326('0x4b'),_0x3e9825);})[_0x6326('0x4c')](function(){delete _0x5c3641[_0x6326('0xe')][_0x58731d];delete _0x5c3641['actions'][_0x58731d];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x6326('0xe')][_0x58731d];delete this['actions'][_0x58731d];}};Fax[_0x6326('0x25')][_0x6326('0x1c')]=function(_0xcae454){var _0x35c648=this;if(this[_0x6326('0xe')][_0xcae454['uniqueid']]){if(this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]){this['channels'][_0xcae454[_0x6326('0x20')]]['id']=this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]['id'];this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]][_0x6326('0x22')]=this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]][_0x6326('0x22')];}logger[_0x6326('0x23')](_0xcae454['uniqueid'],this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]?_0x6326('0x4d'):_0x6326('0x4e'),JSON['stringify'](this['channels'][_0xcae454[_0x6326('0x20')]]));if(this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]){if(this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]]['faxpages']>0x0&&this['channels'][_0xcae454[_0x6326('0x20')]][_0x6326('0x19')]===_0x6326('0x4f')){this[_0x6326('0x49')](_0xcae454['uniqueid'],!![]);}else{this[_0x6326('0x49')](_0xcae454[_0x6326('0x20')],![],this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]][_0x6326('0x50')]?_0x6326('0x51')+this['channels'][_0xcae454[_0x6326('0x20')]]['faxstatusstring']:_0x6326('0x52'));}}}};Fax[_0x6326('0x25')]['send']=function(_0x14d66c){var _0x56fb58=this;return new BPromise(function(_0x222e39,_0x3b6de7){_0x56fb58[_0x6326('0x53')](_0x14d66c,_0x56fb58[_0x6326('0xf')][_0x14d66c[_0x6326('0x54')]])[_0x6326('0x55')](function(_0xa2928e){ut[_0x6326('0x47')]('[Fax][execOriginate][success]',_0xa2928e);_0x222e39(ut[_0x6326('0x35')](_0x6326('0x56')));})[_0x6326('0x3c')](function(_0x5ade98){ut[_0x6326('0x47')]('[Fax][execOriginate][failure]',_0x5ade98);updateStatus(_0x14d66c);_0x3b6de7(ut[_0x6326('0x35')](_0x6326('0x57')));});});};Fax[_0x6326('0x25')][_0x6326('0x58')]=function(_0x3894cf){var _0x4f0305=this;return new BPromise(function(_0x468e7d,_0x564332){var _0x4ae3a9=_0x4f0305[_0x6326('0x59')](_0x4f0305[_0x6326('0xf')][_0x3894cf[_0x6326('0x54')]][_0x6326('0x5a')],_0x3894cf);if(_0x4ae3a9['isValid']){_0x468e7d(ut['message']('Trunk\x20Reachable'));}else{_0x564332(ut['message'](_0x4ae3a9[_0x6326('0x35')]));}});};function originate(_0x5044ab,_0x303fef,_0x5f6273){return new BPromise(function(_0x54730e,_0x4c1d7e){if(_0x5f6273){var _0x5401cf=util[_0x6326('0x5b')]('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[_0x6326('0x37')](_0x5044ab['path'])['name'],_0x5044ab['path']);gs['execute'](_0x5401cf)[_0x6326('0x55')](function(){_0x5044ab['path']=util[_0x6326('0x5b')](_0x6326('0x5c'),path['parse'](_0x5044ab[_0x6326('0x5')])['dir'],path[_0x6326('0x37')](_0x5044ab[_0x6326('0x5')])[_0x6326('0x22')]);_0x303fef[_0x6326('0x5d')]=_0x5044ab[_0x6326('0x5')];ut[_0x6326('0x47')](_0x6326('0x5e'),'');ami[_0x6326('0x5f')](ut[_0x6326('0x60')](_0x5044ab,_0x303fef))[_0x6326('0x55')](function(_0x22d139){_0x54730e(_0x22d139);})[_0x6326('0x3c')](function(_0x3bc5f3){_0x4c1d7e(_0x3bc5f3);});})[_0x6326('0x3c')](function(_0x34e30f){_0x4c1d7e(_0x34e30f);});}else{ami[_0x6326('0x5f')](ut[_0x6326('0x60')](_0x5044ab,_0x303fef))['then'](function(_0x5a7e91){_0x54730e(_0x5a7e91);})['catch'](function(_0x4839bf){_0x4c1d7e(_0x4839bf);});}});}Fax[_0x6326('0x25')]['execOriginate']=function(_0x5d9796,_0x571e38){var _0x5a6b0c=this;return new BPromise(function(_0x565706,_0x5a1a9f){var _0xe845d6=uuid['v4']();var _0x5d664c=ut['addVariables'](_0x5d9796,_0x571e38);_0x5a6b0c[_0x6326('0x11')][_0xe845d6]=new Action(_0xe845d6,_0x571e38,_0x5d9796);var _0x2bfc43=_0x5a6b0c[_0x6326('0x11')][_0xe845d6];if(path['parse'](_0x5d9796[_0x6326('0x5')])[_0x6326('0x61')]===_0x6326('0x38')){originate(_0x2bfc43,_0x5d664c,!![])[_0x6326('0x55')](function(_0x3e9477){_0x565706(_0x3e9477);})['catch'](function(_0x3bff09){_0x5a1a9f(_0x3bff09);});}else{originate(_0x2bfc43,_0x5d664c,![])['then'](function(_0x5c2e68){_0x565706(_0x5c2e68);})[_0x6326('0x3c')](function(_0x4fa150){_0x5a1a9f(_0x4fa150);});}});};Fax['prototype']['isTrunkReachable']=function(_0x491f2e){return!_['isNil'](_0x491f2e)&&!_['isNil'](_0x491f2e['name'])&&!_[_0x6326('0x62')](_0x491f2e[_0x6326('0x63')])&&_0x491f2e[_0x6326('0x63')]&&!_[_0x6326('0x62')](this['trunks'][util['format']('SIP/%s',_0x491f2e[_0x6326('0x22')])])&&!_[_0x6326('0x62')](this['trunks'][util[_0x6326('0x5b')]('SIP/%s',_0x491f2e['name'])][_0x6326('0x64')])&&(this[_0x6326('0x10')][util[_0x6326('0x5b')](_0x6326('0x65'),_0x491f2e[_0x6326('0x22')])][_0x6326('0x64')]===_0x6326('0x66')||this['trunks'][util['format']('SIP/%s',_0x491f2e[_0x6326('0x22')])]['status']==='unmonitored');};Fax[_0x6326('0x25')][_0x6326('0x59')]=function(_0x53bbc3,_0x1fa91d){if(!this['isTrunkReachable'](_0x53bbc3)){ut['logger'](_0x6326('0x67'),_[_0x6326('0x62')](_0x53bbc3)?'':_0x53bbc3['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x6326('0x68')};}if(_[_0x6326('0x62')](_0x1fa91d[_0x6326('0x3b')])){ut[_0x6326('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x1fa91d));return{'isValid':![],'message':_0x6326('0x69')};}if(_[_0x6326('0x62')](_0x1fa91d[_0x6326('0x5')])){ut[_0x6326('0x47')](_0x6326('0x6a'),JSON[_0x6326('0x3e')](_0x1fa91d));return{'isValid':![],'message':_0x6326('0x6b')};}return{'isValid':!![],'message':_0x6326('0x6c')};};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 555a16a..22b53c2 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 _0x8e9e=['lodash','../rpc/faxAccount','error','inspect','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x8e9e,0x167));var _0xe8e9=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x8e9e[_0x45b29d];return _0x32d74;};'use strict';var util=require(_0xe8e9('0x0'));var BPromise=require(_0xe8e9('0x1'));var logger=require(_0xe8e9('0x2'))(_0xe8e9('0x3'));var _=require(_0xe8e9('0x4'));var faxAccount=require(_0xe8e9('0x5'));function loggerCatch(_0xc81870){return function(_0x2b1f8b){logger[_0xe8e9('0x6')](_0xc81870,util[_0xe8e9('0x7')](_0x2b1f8b,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x36cbff,_0x12f562){return BPromise['resolve']()[_0xe8e9('0x8')](faxAccount['notify'](_0x36cbff,_0x12f562))[_0xe8e9('0x9')](loggerCatch(_0xe8e9('0xa')));}; \ No newline at end of file +var _0x4702=['../../../config/logger','lodash','../rpc/faxAccount','error','inspect','resolve','then','catch','util'];(function(_0x3d4bde,_0x5c27ab){var _0x1d032d=function(_0x31edc8){while(--_0x31edc8){_0x3d4bde['push'](_0x3d4bde['shift']());}};_0x1d032d(++_0x5c27ab);}(_0x4702,0xf2));var _0x2470=function(_0x1759ac,_0x48072e){_0x1759ac=_0x1759ac-0x0;var _0x13f985=_0x4702[_0x1759ac];return _0x13f985;};'use strict';var util=require(_0x2470('0x0'));var BPromise=require('bluebird');var logger=require(_0x2470('0x1'))('preview');var _=require(_0x2470('0x2'));var faxAccount=require(_0x2470('0x3'));function loggerCatch(_0x44d251){return function(_0x34a838){logger[_0x2470('0x4')](_0x44d251,util[_0x2470('0x5')](_0x34a838,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x52588d,_0x352163){return BPromise[_0x2470('0x6')]()[_0x2470('0x7')](faxAccount['notify'](_0x52588d,_0x352163))[_0x2470('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 e0e2fa8..85c5f29 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 _0xee68=['exec','execute','info','Exec\x20gs','bluebird','child_process'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0xee68,0x196));var _0x8ee6=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xee68[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x8ee6('0x0'));var exec=require(_0x8ee6('0x1'))[_0x8ee6('0x2')];exports[_0x8ee6('0x3')]=function(_0x2d6e3f){return new BPromise(function(_0x385f32,_0xaffdc6){exec(_0x2d6e3f,function(_0x3d22e0,_0x189c3b,_0x12cbef){logger[_0x8ee6('0x4')](_0x8ee6('0x5'),_0x189c3b);if(_0x3d22e0){logger[_0x8ee6('0x4')](_0x8ee6('0x5'),'\x20Error\x20:',util['inspect'](_0x3d22e0,{'showHidden':![],'depth':null}),_0x189c3b,_0x12cbef);_0xaffdc6(_0x3d22e0);}_0x385f32(_0x189c3b);});});}; \ No newline at end of file +var _0x0e62=['info','\x20Error\x20:','inspect','util','../../../../config/logger','child_process','exec','execute','Exec\x20gs'];(function(_0x416c8c,_0x2eec32){var _0x54097f=function(_0x36e6e0){while(--_0x36e6e0){_0x416c8c['push'](_0x416c8c['shift']());}};_0x54097f(++_0x2eec32);}(_0x0e62,0xd2));var _0x20e6=function(_0x5decb9,_0x8952fc){_0x5decb9=_0x5decb9-0x0;var _0x323e53=_0x0e62[_0x5decb9];return _0x323e53;};'use strict';var util=require(_0x20e6('0x0'));var logger=require(_0x20e6('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x20e6('0x2'))[_0x20e6('0x3')];exports[_0x20e6('0x4')]=function(_0x14a16b){return new BPromise(function(_0x263ab5,_0x31f2fa){exec(_0x14a16b,function(_0xfe5765,_0x305093,_0x3261ad){logger['info'](_0x20e6('0x5'),_0x305093);if(_0xfe5765){logger[_0x20e6('0x6')](_0x20e6('0x5'),_0x20e6('0x7'),util[_0x20e6('0x8')](_0xfe5765,{'showHidden':![],'depth':null}),_0x305093,_0x3261ad);_0x31f2fa(_0xfe5765);}_0x263ab5(_0x305093);});});}; \ 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 66796e1..d075f8b 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 _0x09b4=['faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','format','\x22%s\x22','modem','gateway'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09b4,0x1d3));var _0x409b=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x09b4[_0x1beef3];return _0x5af964;};'use strict';var util=require('util');var _=require(_0x409b('0x0'));var moment=require(_0x409b('0x1'));var logger=require(_0x409b('0x2'))(_0x409b('0x3'));exports[_0x409b('0x4')]=function(_0x4b5e1b){return{'message':_0x4b5e1b};};exports[_0x409b('0x5')]=function(_0x3dc90b,_0x431d80){logger[_0x409b('0x6')](_0x3dc90b,util['inspect'](_0x431d80,{'showHidden':![],'depth':null}));};exports[_0x409b('0x7')]=function(_0x4f10a1,_0x2d6e8a){var _0x30072b={'XMF-ECM':_0x2d6e8a['ecm'],'XMF-HEADERINFO':_0x2d6e8a[_0x409b('0x8')],'XMF-MINRATE':_0x2d6e8a['minrate'],'XMF-MAXRATE':_0x2d6e8a['maxrate'],'XMF-MODEM':util[_0x409b('0x9')](_0x409b('0xa'),_0x2d6e8a[_0x409b('0xb')]),'XMF-GATEWAY':_0x2d6e8a[_0x409b('0xc')],'XMF-FAXDETECT':_0x2d6e8a[_0x409b('0xd')],'XMF-T38TIMEOUT':_0x2d6e8a[_0x409b('0xe')],'XMF-LOCALSTATIONID':_0x2d6e8a['localstationid'],'XMF-PATH':_0x4f10a1[_0x409b('0xf')]};return _0x30072b;};exports[_0x409b('0x10')]=function(_0x1f2e1d,_0x9e19e0){return{'actionid':_0x1f2e1d[_0x409b('0x11')],'action':_0x409b('0x12'),'channel':_0x1f2e1d[_0x409b('0x13')],'Exten':_0x409b('0x14'),'Context':_0x409b('0x15'),'Priority':'1','callerid':util[_0x409b('0x9')](_0x409b('0x16'),_0x1f2e1d['headerinfo']?_0x1f2e1d[_0x409b('0x8')]:'',_0x1f2e1d[_0x409b('0x17')]),'variable':_0x9e19e0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f2e1d[_0x409b('0x11')]};}; \ No newline at end of file +var _0x69a4=['localstationid','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','inspect','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout'];(function(_0x62e0e1,_0x17ba9c){var _0x5117ec=function(_0xca9440){while(--_0xca9440){_0x62e0e1['push'](_0x62e0e1['shift']());}};_0x5117ec(++_0x17ba9c);}(_0x69a4,0x157));var _0x469a=function(_0x375031,_0x2db0fe){_0x375031=_0x375031-0x0;var _0x1baa09=_0x69a4[_0x375031];return _0x1baa09;};'use strict';var util=require(_0x469a('0x0'));var _=require(_0x469a('0x1'));var moment=require(_0x469a('0x2'));var logger=require(_0x469a('0x3'))(_0x469a('0x4'));exports[_0x469a('0x5')]=function(_0x290c6c){return{'message':_0x290c6c};};exports[_0x469a('0x6')]=function(_0x2547fa,_0xdbeabd){logger['info'](_0x2547fa,util[_0x469a('0x7')](_0xdbeabd,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x51a503,_0xb84f55){var _0x57b918={'XMF-ECM':_0xb84f55[_0x469a('0x8')],'XMF-HEADERINFO':_0xb84f55[_0x469a('0x9')],'XMF-MINRATE':_0xb84f55[_0x469a('0xa')],'XMF-MAXRATE':_0xb84f55['maxrate'],'XMF-MODEM':util[_0x469a('0xb')](_0x469a('0xc'),_0xb84f55[_0x469a('0xd')]),'XMF-GATEWAY':_0xb84f55[_0x469a('0xe')],'XMF-FAXDETECT':_0xb84f55[_0x469a('0xf')],'XMF-T38TIMEOUT':_0xb84f55[_0x469a('0x10')],'XMF-LOCALSTATIONID':_0xb84f55[_0x469a('0x11')],'XMF-PATH':_0x51a503['path']};return _0x57b918;};exports[_0x469a('0x12')]=function(_0x3b0c2b,_0x3820c8){return{'actionid':_0x3b0c2b[_0x469a('0x13')],'action':_0x469a('0x14'),'channel':_0x3b0c2b[_0x469a('0x15')],'Exten':'xcally-motion-fax','Context':_0x469a('0x16'),'Priority':'1','callerid':util[_0x469a('0xb')](_0x469a('0x17'),_0x3b0c2b[_0x469a('0x9')]?_0x3b0c2b[_0x469a('0x9')]:'',_0x3b0c2b['localstationid']),'variable':_0x3820c8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3b0c2b['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ac13998..fe5e08f 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 _0x691a=['getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','bluebird','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts'];(function(_0x1ea034,_0x476985){var _0x2a16c1=function(_0x2d8a2c){while(--_0x2d8a2c){_0x1ea034['push'](_0x1ea034['shift']());}};_0x2a16c1(++_0x476985);}(_0x691a,0x176));var _0xa691=function(_0x524712,_0x6e862d){_0x524712=_0x524712-0x0;var _0x3c8123=_0x691a[_0x524712];return _0x3c8123;};'use strict';var BPromise=require(_0xa691('0x0'));var util=require('util');var moment=require('moment');var server=require(_0xa691('0x1'));var Realtime=require(_0xa691('0x2'));var Report=require('./report');var Acw=require(_0xa691('0x3'));var Trigger=require(_0xa691('0x4'));var Dialer=require(_0xa691('0x5'));var Preview=require(_0xa691('0x6'));var Fax=require(_0xa691('0x7'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xa691('0x8'));var trunk=require(_0xa691('0x9'));var trigger=require(_0xa691('0xa'));var template=require(_0xa691('0xb'));var cmHopperHistory=require(_0xa691('0xc'));var campaign=require(_0xa691('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa691('0xe'));var zendesk=require(_0xa691('0xf'));var salesforce=require(_0xa691('0x10'));var sugarcrm=require(_0xa691('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xa691('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xa691('0x13'));var dynamics365=require(_0xa691('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(_0xa691('0x15'))(_0xa691('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa691('0x17')](_0xa691('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa691('0x17')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa691('0x19')]()['then'](user[_0xa691('0x1a')]())['then'](realtime[_0xa691('0x1b')]())[_0xa691('0x1c')](user[_0xa691('0x1d')]())['then'](realtime[_0xa691('0x1e')]())[_0xa691('0x1c')](trunk[_0xa691('0x1f')]())[_0xa691('0x1c')](realtime[_0xa691('0x20')]())[_0xa691('0x1c')](voiceQueue['getVoiceQueues']())['then'](realtime['initVoiceQueues']())[_0xa691('0x1c')](trigger['getTriggers']())['then'](realtime['initTriggers']())['then'](template[_0xa691('0x21')]())[_0xa691('0x1c')](realtime['initTemplates']())[_0xa691('0x1c')](zendesk[_0xa691('0x22')]())[_0xa691('0x1c')](realtime[_0xa691('0x23')]())['then'](salesforce[_0xa691('0x24')]())[_0xa691('0x1c')](realtime[_0xa691('0x25')]())['then'](sugarcrm[_0xa691('0x26')]())[_0xa691('0x1c')](realtime[_0xa691('0x27')]())[_0xa691('0x1c')](freshdesk[_0xa691('0x28')]())['then'](realtime[_0xa691('0x29')]())[_0xa691('0x1c')](desk[_0xa691('0x2a')]())[_0xa691('0x1c')](realtime[_0xa691('0x2b')]())['then'](zoho[_0xa691('0x2c')]())['then'](realtime[_0xa691('0x2d')]())['then'](vtiger[_0xa691('0x2e')]())[_0xa691('0x1c')](realtime['initVtigerAccounts']())['then'](freshsales[_0xa691('0x2f')]())[_0xa691('0x1c')](realtime[_0xa691('0x30')]())[_0xa691('0x1c')](servicenow[_0xa691('0x31')]())[_0xa691('0x1c')](realtime[_0xa691('0x32')]())['then'](dynamics365[_0xa691('0x33')]())[_0xa691('0x1c')](realtime[_0xa691('0x34')]())[_0xa691('0x1c')](campaign[_0xa691('0x35')]())[_0xa691('0x1c')](realtime[_0xa691('0x36')]())['then'](voiceExtension[_0xa691('0x37')]())[_0xa691('0x1c')](realtime['initVoiceExtensions']())[_0xa691('0x1c')](faxAccount[_0xa691('0x38')]())[_0xa691('0x1c')](realtime[_0xa691('0x39')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xa691('0x19')]()[_0xa691('0x1c')](voiceQueueReport[_0xa691('0x3a')]())[_0xa691('0x1c')](realtime[_0xa691('0x3b')]())[_0xa691('0x1c')](cmHopperHistory[_0xa691('0x3c')]())[_0xa691('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0xa691('0x1c')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xa691('0x3d')]())[_0xa691('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xa691('0x3e')]())['catch'](function(_0x451dad){logger[_0xa691('0x3f')](_0xa691('0x40'),util[_0xa691('0x41')](_0x451dad,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa691('0x42')](realtime,preview,fax)[_0xa691('0x1c')](function(_0x1b255a){return initRealtime();})[_0xa691('0x1c')](function(){return initParams();})['then'](function(){report[_0xa691('0x43')]();setInterval(initRealtime,0x1388);})[_0xa691('0x44')](function(_0x2a24de){logger[_0xa691('0x3f')](_0xa691('0x45'),util[_0xa691('0x41')](_0x2a24de,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x6a27=['./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','getAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','sync','bluebird','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign'];(function(_0x3bb5d7,_0x2c9a83){var _0x2aae62=function(_0x355de5){while(--_0x355de5){_0x3bb5d7['push'](_0x3bb5d7['shift']());}};_0x2aae62(++_0x2c9a83);}(_0x6a27,0x152));var _0x76a2=function(_0x455109,_0x12eed4){_0x455109=_0x455109-0x0;var _0x153e30=_0x6a27[_0x455109];return _0x153e30;};'use strict';var BPromise=require(_0x76a2('0x0'));var util=require(_0x76a2('0x1'));var moment=require(_0x76a2('0x2'));var server=require(_0x76a2('0x3'));var Realtime=require(_0x76a2('0x4'));var Report=require(_0x76a2('0x5'));var Acw=require('./acw');var Trigger=require(_0x76a2('0x6'));var Dialer=require(_0x76a2('0x7'));var Preview=require(_0x76a2('0x8'));var Fax=require('./fax');var user=require(_0x76a2('0x9'));var voiceQueue=require(_0x76a2('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x76a2('0xb'));var trunk=require(_0x76a2('0xc'));var trigger=require(_0x76a2('0xd'));var template=require(_0x76a2('0xe'));var cmHopperHistory=require(_0x76a2('0xf'));var campaign=require(_0x76a2('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x76a2('0x11'));var zendesk=require(_0x76a2('0x12'));var salesforce=require(_0x76a2('0x13'));var sugarcrm=require(_0x76a2('0x14'));var freshdesk=require(_0x76a2('0x15'));var desk=require(_0x76a2('0x16'));var zoho=require(_0x76a2('0x17'));var vtiger=require(_0x76a2('0x18'));var freshsales=require(_0x76a2('0x19'));var servicenow=require(_0x76a2('0x1a'));var dynamics365=require(_0x76a2('0x1b'));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(_0x76a2('0x1c'))(_0x76a2('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x76a2('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x76a2('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x76a2('0x1f')]()[_0x76a2('0x20')](user[_0x76a2('0x21')]())['then'](realtime['initAgents']())[_0x76a2('0x20')](user['getTelephones']())[_0x76a2('0x20')](realtime[_0x76a2('0x22')]())[_0x76a2('0x20')](trunk[_0x76a2('0x23')]())[_0x76a2('0x20')](realtime['initTrunks']())[_0x76a2('0x20')](voiceQueue[_0x76a2('0x24')]())[_0x76a2('0x20')](realtime[_0x76a2('0x25')]())[_0x76a2('0x20')](trigger[_0x76a2('0x26')]())['then'](realtime[_0x76a2('0x27')]())[_0x76a2('0x20')](template[_0x76a2('0x28')]())['then'](realtime['initTemplates']())[_0x76a2('0x20')](zendesk[_0x76a2('0x29')]())['then'](realtime[_0x76a2('0x2a')]())['then'](salesforce[_0x76a2('0x2b')]())[_0x76a2('0x20')](realtime[_0x76a2('0x2c')]())[_0x76a2('0x20')](sugarcrm[_0x76a2('0x2d')]())[_0x76a2('0x20')](realtime['initSugarcrmAccounts']())[_0x76a2('0x20')](freshdesk[_0x76a2('0x2e')]())[_0x76a2('0x20')](realtime[_0x76a2('0x2f')]())[_0x76a2('0x20')](desk[_0x76a2('0x30')]())[_0x76a2('0x20')](realtime[_0x76a2('0x31')]())[_0x76a2('0x20')](zoho['getZohoAccounts']())[_0x76a2('0x20')](realtime[_0x76a2('0x32')]())['then'](vtiger['getVtigerAccounts']())[_0x76a2('0x20')](realtime[_0x76a2('0x33')]())[_0x76a2('0x20')](freshsales[_0x76a2('0x34')]())[_0x76a2('0x20')](realtime[_0x76a2('0x35')]())[_0x76a2('0x20')](servicenow['getServicenowAccounts']())['then'](realtime[_0x76a2('0x36')]())[_0x76a2('0x20')](dynamics365['getDynamics365Accounts']())[_0x76a2('0x20')](realtime[_0x76a2('0x37')]())[_0x76a2('0x20')](campaign[_0x76a2('0x38')]())[_0x76a2('0x20')](realtime[_0x76a2('0x39')]())[_0x76a2('0x20')](voiceExtension[_0x76a2('0x3a')]())[_0x76a2('0x20')](realtime['initVoiceExtensions']())[_0x76a2('0x20')](faxAccount[_0x76a2('0x3b')]())['then'](realtime[_0x76a2('0x3c')]())[_0x76a2('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x76a2('0x1f')]()[_0x76a2('0x20')](voiceQueueReport['getVoiceQueueReports']())[_0x76a2('0x20')](realtime[_0x76a2('0x3d')]())[_0x76a2('0x20')](cmHopperHistory[_0x76a2('0x3e')]())['then'](realtime[_0x76a2('0x3f')]())['then'](cmHopperHistory[_0x76a2('0x40')]())[_0x76a2('0x20')](realtime[_0x76a2('0x41')]())[_0x76a2('0x20')](voiceCallReport['getVoiceCallReports']())[_0x76a2('0x20')](realtime[_0x76a2('0x42')]())[_0x76a2('0x43')](function(_0x52c99c){logger[_0x76a2('0x44')](_0x76a2('0x45'),util['inspect'](_0x52c99c,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x76a2('0x20')](function(_0x8073aa){return initRealtime();})[_0x76a2('0x20')](function(){return initParams();})[_0x76a2('0x20')](function(){report[_0x76a2('0x46')]();setInterval(initRealtime,0x1388);})[_0x76a2('0x43')](function(_0x5c853f){logger[_0x76a2('0x44')]('[index.js][main]',util['inspect'](_0x5c853f,{'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 c3e3b91..4bfb151 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 _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x2dfc99,_0x1fbaa2){var _0x488781=function(_0x30e9a5){while(--_0x30e9a5){_0x2dfc99['push'](_0x2dfc99['shift']());}};_0x488781(++_0x1fbaa2);}(_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 moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d8e90b3..cba078f 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 _0x00bb=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00bb,0xea));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'use strict';function Campaign(_0x12f701){this['id']=_0x12f701['id']||0x0;this[_0xb00b('0x0')]=_0x12f701[_0xb00b('0x0')]||'';this[_0xb00b('0x1')]=_0x12f701[_0xb00b('0x1')]||_0xb00b('0x2');this[_0xb00b('0x3')]=0x0;this[_0xb00b('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xb00b('0x5')]=0x0;this[_0xb00b('0x6')]='';this[_0xb00b('0x7')]=!![];this[_0xb00b('0x8')]=_0x12f701['active'];this[_0xb00b('0x9')]=_0x12f701[_0xb00b('0x9')];this[_0xb00b('0xa')]=_0x12f701[_0xb00b('0xa')]||null;this['dialGlobalInterval']=_0x12f701['dialGlobalInterval']?_0x12f701[_0xb00b('0xb')]:null;this['dialOriginateCallerIdName']=_0x12f701[_0xb00b('0xc')];this[_0xb00b('0xd')]=_0x12f701[_0xb00b('0xd')];this[_0xb00b('0xe')]=_0x12f701[_0xb00b('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x12f701['dialCongestionMaxRetry'];this[_0xb00b('0xf')]=_0x12f701[_0xb00b('0xf')];this[_0xb00b('0x10')]=_0x12f701[_0xb00b('0x10')];this[_0xb00b('0x11')]=_0x12f701[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x12f701[_0xb00b('0x12')];this[_0xb00b('0x13')]=_0x12f701[_0xb00b('0x13')];this[_0xb00b('0x14')]=_0x12f701['dialGlobalMaxRetry'];this[_0xb00b('0x15')]=_0x12f701[_0xb00b('0x15')]||0x3;this[_0xb00b('0x16')]=_0x12f701[_0xb00b('0x16')]||0x96;this[_0xb00b('0x17')]=_0x12f701['dialDropMaxRetry']||0x3;this[_0xb00b('0x18')]=_0x12f701[_0xb00b('0x18')]||0x96;this[_0xb00b('0x19')]=_0x12f701[_0xb00b('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x12f701[_0xb00b('0x1a')]||0x96;this[_0xb00b('0x1b')]=_0x12f701[_0xb00b('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x12f701[_0xb00b('0x1c')]||0x96;this[_0xb00b('0x1d')]=_0x12f701['dialAgentRejectMaxRetry']||0x3;this[_0xb00b('0x1e')]=_0x12f701[_0xb00b('0x1e')]||0x96;this[_0xb00b('0x1f')]=_0x12f701[_0xb00b('0x1f')]||_0xb00b('0x20');this[_0xb00b('0x21')]=_0x12f701[_0xb00b('0x21')]||undefined;this[_0xb00b('0x22')]=_0x12f701[_0xb00b('0x22')]||undefined;this[_0xb00b('0x23')]=_0x12f701['dialCutDigit']||undefined;this[_0xb00b('0x24')]=_0x12f701[_0xb00b('0x24')]?_0x12f701['TrunkBackup']:undefined;this['Trunk']=_0x12f701[_0xb00b('0x25')]?_0x12f701['Trunk']:undefined;this[_0xb00b('0x26')]=_0x12f701[_0xb00b('0x26')]?_0x12f701[_0xb00b('0x26')]:undefined;this[_0xb00b('0x27')]=_0x12f701[_0xb00b('0x27')]?_0x12f701['SquareProject']:undefined;this[_0xb00b('0x28')]=_0x12f701[_0xb00b('0x27')]?_0x12f701[_0xb00b('0x27')][_0xb00b('0x0')]:undefined;this['dialAMDActive']=_0x12f701[_0xb00b('0x29')]||![];this[_0xb00b('0x2a')]=_0x12f701[_0xb00b('0x2a')];this[_0xb00b('0x2b')]=_0x12f701[_0xb00b('0x2b')];this[_0xb00b('0x2c')]=_0x12f701[_0xb00b('0x2c')];this[_0xb00b('0x2d')]=_0x12f701['dialAMDTotalAnalysisTime'];this[_0xb00b('0x2e')]=_0x12f701[_0xb00b('0x2e')];this['dialAMDBetweenWordsSilence']=_0x12f701[_0xb00b('0x2f')];this[_0xb00b('0x30')]=_0x12f701[_0xb00b('0x30')];this[_0xb00b('0x31')]=_0x12f701['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x12f701[_0xb00b('0x32')];}module[_0xb00b('0x33')]=Campaign; \ No newline at end of file +var _0x191c=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x191c,0x150));var _0xc191=function(_0xd18b8c,_0x1d099c){_0xd18b8c=_0xd18b8c-0x0;var _0x4bfea0=_0x191c[_0xd18b8c];return _0x4bfea0;};'use strict';function Campaign(_0x397a91){this['id']=_0x397a91['id']||0x0;this['name']=_0x397a91[_0xc191('0x0')]||'';this['type']=_0x397a91[_0xc191('0x1')]||_0xc191('0x2');this[_0xc191('0x3')]=0x0;this[_0xc191('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0xc191('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xc191('0x6')]=_0x397a91[_0xc191('0x6')];this[_0xc191('0x7')]=_0x397a91[_0xc191('0x7')];this[_0xc191('0x8')]=_0x397a91[_0xc191('0x8')]||null;this[_0xc191('0x9')]=_0x397a91[_0xc191('0x9')]?_0x397a91['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x397a91[_0xc191('0xa')];this[_0xc191('0xb')]=_0x397a91['dialOriginateCallerIdNumber'];this[_0xc191('0xc')]=_0x397a91[_0xc191('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x397a91[_0xc191('0xd')];this['dialCongestionRetryFrequency']=_0x397a91['dialCongestionRetryFrequency'];this[_0xc191('0xe')]=_0x397a91[_0xc191('0xe')];this[_0xc191('0xf')]=_0x397a91['dialBusyRetryFrequency'];this[_0xc191('0x10')]=_0x397a91[_0xc191('0x10')];this[_0xc191('0x11')]=_0x397a91[_0xc191('0x11')];this[_0xc191('0x12')]=_0x397a91['dialGlobalMaxRetry'];this[_0xc191('0x13')]=_0x397a91[_0xc191('0x13')]||0x3;this[_0xc191('0x14')]=_0x397a91[_0xc191('0x14')]||0x96;this[_0xc191('0x15')]=_0x397a91[_0xc191('0x15')]||0x3;this[_0xc191('0x16')]=_0x397a91[_0xc191('0x16')]||0x96;this[_0xc191('0x17')]=_0x397a91[_0xc191('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x397a91['dialAbandonedRetryFrequency']||0x96;this[_0xc191('0x18')]=_0x397a91[_0xc191('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x397a91['dialMachineRetryFrequency']||0x96;this[_0xc191('0x19')]=_0x397a91[_0xc191('0x19')]||0x3;this[_0xc191('0x1a')]=_0x397a91['dialAgentRejectRetryFrequency']||0x96;this[_0xc191('0x1b')]=_0x397a91[_0xc191('0x1b')]||'DESC';this[_0xc191('0x1c')]=_0x397a91[_0xc191('0x1c')]||undefined;this[_0xc191('0x1d')]=_0x397a91['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xc191('0x1e')]=_0x397a91[_0xc191('0x1e')]||undefined;this[_0xc191('0x1f')]=_0x397a91[_0xc191('0x1f')]?_0x397a91[_0xc191('0x1f')]:undefined;this[_0xc191('0x20')]=_0x397a91[_0xc191('0x20')]?_0x397a91[_0xc191('0x20')]:undefined;this[_0xc191('0x21')]=_0x397a91[_0xc191('0x21')]?_0x397a91[_0xc191('0x21')]:undefined;this[_0xc191('0x22')]=_0x397a91[_0xc191('0x22')]?_0x397a91['SquareProject']:undefined;this['dialQueueProject']=_0x397a91[_0xc191('0x22')]?_0x397a91[_0xc191('0x22')]['name']:undefined;this[_0xc191('0x23')]=_0x397a91['dialAMDActive']||![];this[_0xc191('0x24')]=_0x397a91[_0xc191('0x24')];this[_0xc191('0x25')]=_0x397a91[_0xc191('0x25')];this['dialAMDAfterGreetingSilence']=_0x397a91[_0xc191('0x26')];this[_0xc191('0x27')]=_0x397a91[_0xc191('0x27')];this[_0xc191('0x28')]=_0x397a91['dialAMDMinWordLength'];this[_0xc191('0x29')]=_0x397a91['dialAMDBetweenWordsSilence'];this[_0xc191('0x2a')]=_0x397a91[_0xc191('0x2a')];this[_0xc191('0x2b')]=_0x397a91[_0xc191('0x2b')];this[_0xc191('0x2c')]=_0x397a91[_0xc191('0x2c')];}module[_0xc191('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 27bab99..82d9d19 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 _0x151b=['starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0xe047c6,_0x5c1e04){var _0x25c691=function(_0x4571e2){while(--_0x4571e2){_0xe047c6['push'](_0xe047c6['shift']());}};_0x25c691(++_0x5c1e04);}(_0x151b,0x152));var _0xb151=function(_0x29c986,_0xf5d25e){_0x29c986=_0x29c986-0x0;var _0x201b96=_0x151b[_0x29c986];return _0x201b96;};'use strict';function Channel(){this[_0xb151('0x0')]=null;this[_0xb151('0x1')]='';this[_0xb151('0x2')]='';this[_0xb151('0x3')]=0x0;this[_0xb151('0x4')]='';this[_0xb151('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xb151('0x6')]=0x0;this['context']='';this[_0xb151('0x7')]=0x0;this[_0xb151('0x8')]=0x0;this[_0xb151('0x9')]=0x0;this['answered']=![];this[_0xb151('0xa')]=null;this[_0xb151('0xb')]=null;this['unmanaged']=![];this[_0xb151('0xc')]=![];this[_0xb151('0xd')]='';this['lastdata']='';this[_0xb151('0xe')]=0x0;this[_0xb151('0xf')]=0x0;this['holdtime']=0x0;this[_0xb151('0x10')]=null;this[_0xb151('0x11')]=null;this[_0xb151('0x12')]=null;this[_0xb151('0x13')]=![];this[_0xb151('0x14')]=null;this['queue']=null;this[_0xb151('0x15')]=[];this[_0xb151('0x16')]=undefined;this[_0xb151('0x17')]=undefined;this[_0xb151('0x18')]=undefined;this[_0xb151('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x1131=['transferconnectedlinenum','transferType','exports','channel','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitorFilename','queue','monitors'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0x1131,0x71));var _0x1113=function(_0x26eead,_0x821bc8){_0x26eead=_0x26eead-0x0;var _0x24e4ac=_0x1131[_0x26eead];return _0x24e4ac;};'use strict';function Channel(){this['starttime']=null;this[_0x1113('0x0')]='';this['destinationchannel']='';this['calleridnum']=0x0;this['calleridname']='';this[_0x1113('0x1')]=undefined;this[_0x1113('0x2')]=undefined;this[_0x1113('0x3')]=0x0;this[_0x1113('0x4')]='';this[_0x1113('0x5')]=0x0;this[_0x1113('0x6')]=0x0;this['exten']=0x0;this[_0x1113('0x7')]=![];this['answertime']=null;this[_0x1113('0x8')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x1113('0x9')]='';this[_0x1113('0xa')]='';this[_0x1113('0xb')]=0x0;this[_0x1113('0xc')]=0x0;this[_0x1113('0xd')]=0x0;this[_0x1113('0xe')]=null;this[_0x1113('0xf')]=null;this['disposition']=null;this['monitor']=![];this[_0x1113('0x10')]=null;this[_0x1113('0x11')]=null;this[_0x1113('0x12')]=[];this['transfercalleridnum']=undefined;this[_0x1113('0x13')]=undefined;this[_0x1113('0x14')]=undefined;this['mohtime']=0x0;}module[_0x1113('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6644400..1850cf7 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 _0x4bc5=['tokenSecret','type','Configurations','name','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x4bc5,0x14d));var _0x54bc=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x4bc5[_0x1589dd];return _0x1bddd1;};'use strict';function DeskAccount(_0x3ceee0){this['id']=_0x3ceee0['id']||0x0;this[_0x54bc('0x0')]=_0x3ceee0[_0x54bc('0x0')]||'';this['username']=_0x3ceee0['username']||'';this[_0x54bc('0x1')]=_0x3ceee0[_0x54bc('0x1')]||'';this[_0x54bc('0x2')]=_0x3ceee0[_0x54bc('0x2')]||'';this[_0x54bc('0x3')]=_0x3ceee0[_0x54bc('0x3')]||'';this[_0x54bc('0x4')]=_0x3ceee0[_0x54bc('0x4')]||'';this[_0x54bc('0x5')]=_0x3ceee0[_0x54bc('0x5')]||'';this[_0x54bc('0x6')]=_0x3ceee0[_0x54bc('0x6')]||'';this[_0x54bc('0x7')]=_0x3ceee0[_0x54bc('0x7')]||'';this[_0x54bc('0x8')]=_0x3ceee0[_0x54bc('0x8')]||'';this['serverUrl']=_0x3ceee0['serverUrl']||'';this[_0x54bc('0x9')]=_0x3ceee0[_0x54bc('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xcaa6=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x49e759,_0x2f0a0f){var _0x46641f=function(_0xa2df3f){while(--_0xa2df3f){_0x49e759['push'](_0x49e759['shift']());}};_0x46641f(++_0x2f0a0f);}(_0xcaa6,0x1ca));var _0x6caa=function(_0x140505,_0x5b19e2){_0x140505=_0x140505-0x0;var _0x592ece=_0xcaa6[_0x140505];return _0x592ece;};'use strict';function DeskAccount(_0x232af6){this['id']=_0x232af6['id']||0x0;this[_0x6caa('0x0')]=_0x232af6[_0x6caa('0x0')]||'';this[_0x6caa('0x1')]=_0x232af6['username']||'';this['remoteUri']=_0x232af6[_0x6caa('0x2')]||'';this[_0x6caa('0x3')]=_0x232af6[_0x6caa('0x3')]||'';this[_0x6caa('0x4')]=_0x232af6[_0x6caa('0x4')]||'';this[_0x6caa('0x5')]=_0x232af6[_0x6caa('0x5')]||'';this['consumerSecret']=_0x232af6[_0x6caa('0x6')]||'';this[_0x6caa('0x7')]=_0x232af6[_0x6caa('0x7')]||'';this['tokenSecret']=_0x232af6[_0x6caa('0x8')]||'';this[_0x6caa('0x9')]=_0x232af6[_0x6caa('0x9')]||'';this[_0x6caa('0xa')]=_0x232af6[_0x6caa('0xa')]||'';this[_0x6caa('0xb')]=_0x232af6[_0x6caa('0xb')]||{};}module[_0x6caa('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 584b0de..c18aeec 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 _0xb4e6=['tenantId','clientId','clientSecret','Configurations','name','username','password','remoteUri'];(function(_0x35d1d8,_0x39d08c){var _0x9eb7a2=function(_0x109c6b){while(--_0x109c6b){_0x35d1d8['push'](_0x35d1d8['shift']());}};_0x9eb7a2(++_0x39d08c);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xb4e6[_0x113e32];return _0x4ff939;};'use strict';function Dynamics365Account(_0x54acd0){this['id']=_0x54acd0['id']||0x0;this['name']=_0x54acd0[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x54acd0[_0x6b4e('0x1')]||'';this[_0x6b4e('0x2')]=_0x54acd0[_0x6b4e('0x2')]||'';this[_0x6b4e('0x3')]=_0x54acd0[_0x6b4e('0x3')]||'';this['tenantId']=_0x54acd0[_0x6b4e('0x4')]||'';this[_0x6b4e('0x5')]=_0x54acd0[_0x6b4e('0x5')]||'';this['clientSecret']=_0x54acd0[_0x6b4e('0x6')]||{};this['serverUrl']=_0x54acd0['serverUrl']||'';this[_0x6b4e('0x7')]=_0x54acd0['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb688=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x47eaab,_0x2c5a34){var _0x2b7fd6=function(_0x22d1ba){while(--_0x22d1ba){_0x47eaab['push'](_0x47eaab['shift']());}};_0x2b7fd6(++_0x2c5a34);}(_0xb688,0xcf));var _0x8b68=function(_0x17d6b1,_0x1a9dc0){_0x17d6b1=_0x17d6b1-0x0;var _0x23dcc1=_0xb688[_0x17d6b1];return _0x23dcc1;};'use strict';function Dynamics365Account(_0x185590){this['id']=_0x185590['id']||0x0;this[_0x8b68('0x0')]=_0x185590[_0x8b68('0x0')]||'';this[_0x8b68('0x1')]=_0x185590[_0x8b68('0x1')]||'';this[_0x8b68('0x2')]=_0x185590[_0x8b68('0x2')]||'';this['remoteUri']=_0x185590[_0x8b68('0x3')]||'';this[_0x8b68('0x4')]=_0x185590[_0x8b68('0x4')]||'';this[_0x8b68('0x5')]=_0x185590['clientId']||'';this[_0x8b68('0x6')]=_0x185590['clientSecret']||{};this[_0x8b68('0x7')]=_0x185590[_0x8b68('0x7')]||'';this[_0x8b68('0x8')]=_0x185590[_0x8b68('0x8')]||{};}module[_0x8b68('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 85a4fb1..201338e 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 _0x5d65=['exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','tech','SIP','Trunk','ListId','key'];(function(_0x4d1da9,_0x3f2faf){var _0x5335f8=function(_0x35e507){while(--_0x35e507){_0x4d1da9['push'](_0x4d1da9['shift']());}};_0x5335f8(++_0x3f2faf);}(_0x5d65,0xc4));var _0x55d6=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x5d65[_0x256b72];return _0x2183e3;};'use strict';function FaxAccount(_0x263a47){this['id']=_0x263a47['id']||0x0;this['name']=_0x263a47[_0x55d6('0x0')]||'';this[_0x55d6('0x1')]=_0x263a47[_0x55d6('0x1')];this[_0x55d6('0x2')]=_0x263a47[_0x55d6('0x2')];this[_0x55d6('0x3')]=_0x263a47[_0x55d6('0x3')];this[_0x55d6('0x4')]=_0x263a47['localstationid'];this['minrate']=_0x263a47['minrate']||0x960;this['maxrate']=_0x263a47[_0x55d6('0x5')]||0x3840;this['modem']=_0x263a47[_0x55d6('0x6')]||'v17,v27,v29';this[_0x55d6('0x7')]=_0x263a47[_0x55d6('0x7')]||'no';this[_0x55d6('0x8')]=_0x263a47['faxdetect']||'no';this['t38timeout']=_0x263a47['t38timeout']||0x1388;this[_0x55d6('0x9')]=_0x263a47[_0x55d6('0x9')]||_0x55d6('0xa');this['Trunk']=_0x263a47['Trunk']?_0x263a47[_0x55d6('0xb')]:undefined;this[_0x55d6('0xc')]=_0x263a47[_0x55d6('0xc')];this[_0x55d6('0xd')]=_0x263a47[_0x55d6('0xd')];}module[_0x55d6('0xe')]=FaxAccount; \ No newline at end of file +var _0x9cb0=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x5d0680,_0x10c11d){var _0x1ef1dc=function(_0x471840){while(--_0x471840){_0x5d0680['push'](_0x5d0680['shift']());}};_0x1ef1dc(++_0x10c11d);}(_0x9cb0,0xb1));var _0x09cb=function(_0x4c0405,_0x1d263c){_0x4c0405=_0x4c0405-0x0;var _0x125158=_0x9cb0[_0x4c0405];return _0x125158;};'use strict';function FaxAccount(_0x2b5069){this['id']=_0x2b5069['id']||0x0;this[_0x09cb('0x0')]=_0x2b5069['name']||'';this[_0x09cb('0x1')]=_0x2b5069[_0x09cb('0x1')];this['ecm']=_0x2b5069[_0x09cb('0x2')];this[_0x09cb('0x3')]=_0x2b5069['headerinfo'];this[_0x09cb('0x4')]=_0x2b5069['localstationid'];this[_0x09cb('0x5')]=_0x2b5069[_0x09cb('0x5')]||0x960;this['maxrate']=_0x2b5069[_0x09cb('0x6')]||0x3840;this[_0x09cb('0x7')]=_0x2b5069[_0x09cb('0x7')]||_0x09cb('0x8');this[_0x09cb('0x9')]=_0x2b5069[_0x09cb('0x9')]||'no';this[_0x09cb('0xa')]=_0x2b5069[_0x09cb('0xa')]||'no';this[_0x09cb('0xb')]=_0x2b5069[_0x09cb('0xb')]||0x1388;this['tech']=_0x2b5069[_0x09cb('0xc')]||_0x09cb('0xd');this[_0x09cb('0xe')]=_0x2b5069[_0x09cb('0xe')]?_0x2b5069[_0x09cb('0xe')]:undefined;this['ListId']=_0x2b5069[_0x09cb('0xf')];this['key']=_0x2b5069[_0x09cb('0x10')];}module[_0x09cb('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3361ba9..85c296f 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 _0x61fb=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x22bc00,_0x59c8b2){var _0x152a02=function(_0x1b1ce9){while(--_0x1b1ce9){_0x22bc00['push'](_0x22bc00['shift']());}};_0x152a02(++_0x59c8b2);}(_0x61fb,0x16d));var _0xb61f=function(_0x30dbb0,_0x59a6b7){_0x30dbb0=_0x30dbb0-0x0;var _0x7512b8=_0x61fb[_0x30dbb0];return _0x7512b8;};'use strict';function FreshdeskAccount(_0xa128b6){this['id']=_0xa128b6['id']||0x0;this['name']=_0xa128b6[_0xb61f('0x0')]||'';this[_0xb61f('0x1')]=_0xa128b6[_0xb61f('0x1')]||'';this[_0xb61f('0x2')]=_0xa128b6['token']||'';this[_0xb61f('0x3')]=_0xa128b6[_0xb61f('0x3')]||'';this['serverUrl']=_0xa128b6[_0xb61f('0x4')]||'';this[_0xb61f('0x5')]=_0xa128b6['Configurations']||{};}module[_0xb61f('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xb39b=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb39b,0x84));var _0xbb39=function(_0x316675,_0x5eb1e1){_0x316675=_0x316675-0x0;var _0x50d3fb=_0xb39b[_0x316675];return _0x50d3fb;};'use strict';function FreshdeskAccount(_0x481436){this['id']=_0x481436['id']||0x0;this[_0xbb39('0x0')]=_0x481436[_0xbb39('0x0')]||'';this[_0xbb39('0x1')]=_0x481436[_0xbb39('0x1')]||'';this[_0xbb39('0x2')]=_0x481436[_0xbb39('0x3')]||'';this[_0xbb39('0x4')]=_0x481436['remoteUri']||'';this[_0xbb39('0x5')]=_0x481436[_0xbb39('0x5')]||'';this[_0xbb39('0x6')]=_0x481436['Configurations']||{};}module[_0xbb39('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1d6703d..564dd4c 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 _0x16d8=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x2e7d1f,_0x4ebc9e){var _0x462b13=function(_0x3ba091){while(--_0x3ba091){_0x2e7d1f['push'](_0x2e7d1f['shift']());}};_0x462b13(++_0x4ebc9e);}(_0x16d8,0xa3));var _0x816d=function(_0x51e801,_0x13b437){_0x51e801=_0x51e801-0x0;var _0x1f3121=_0x16d8[_0x51e801];return _0x1f3121;};'use strict';function FreshsalesAccount(_0x3dbdf3){this['id']=_0x3dbdf3['id']||0x0;this[_0x816d('0x0')]=_0x3dbdf3[_0x816d('0x0')]||'';this[_0x816d('0x1')]=_0x3dbdf3[_0x816d('0x1')]||'';this[_0x816d('0x2')]=_0x3dbdf3[_0x816d('0x3')]||'';this[_0x816d('0x4')]=_0x3dbdf3[_0x816d('0x4')]||'';this[_0x816d('0x5')]=_0x3dbdf3['serverUrl']||'';this[_0x816d('0x6')]=_0x3dbdf3['Configurations']||{};}module[_0x816d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xad68=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xad68,0x100));var _0x8ad6=function(_0x4f33ff,_0x4cc52d){_0x4f33ff=_0x4f33ff-0x0;var _0x40e19c=_0xad68[_0x4f33ff];return _0x40e19c;};'use strict';function FreshsalesAccount(_0x4b0bca){this['id']=_0x4b0bca['id']||0x0;this['name']=_0x4b0bca[_0x8ad6('0x0')]||'';this[_0x8ad6('0x1')]=_0x4b0bca['username']||'';this['apiKey']=_0x4b0bca[_0x8ad6('0x2')]||'';this[_0x8ad6('0x3')]=_0x4b0bca[_0x8ad6('0x3')]||'';this[_0x8ad6('0x4')]=_0x4b0bca[_0x8ad6('0x4')]||'';this[_0x8ad6('0x5')]=_0x4b0bca[_0x8ad6('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 1200ac0..78d1709 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 _0x2638=['calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','connectedlinenum','connectedlinename','accountcode','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','type','inbound'];(function(_0x451cd2,_0x24f0ad){var _0x26fa82=function(_0x16f300){while(--_0x16f300){_0x451cd2['push'](_0x451cd2['shift']());}};_0x26fa82(++_0x24f0ad);}(_0x2638,0xc4));var _0x8263=function(_0x2d9d42,_0x46bb08){_0x2d9d42=_0x2d9d42-0x0;var _0x325e9f=_0x2638[_0x2d9d42];return _0x325e9f;};'use strict';function QueueReport(){this[_0x8263('0x0')]=_0x8263('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x8263('0x2')]='';this[_0x8263('0x3')]='';this[_0x8263('0x4')]=null;this[_0x8263('0x5')]=null;this['position']=0x1;this[_0x8263('0x6')]=0x1;this[_0x8263('0x7')]=![];this[_0x8263('0x8')]=null;this[_0x8263('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x8263('0xa')]=![];this['queuecallerexitAt']=null;this[_0x8263('0xb')]=0x1;this['channel']='';this[_0x8263('0xc')]='';this[_0x8263('0xd')]='';this[_0x8263('0xe')]='';this['context']='';this['exten']='';this[_0x8263('0xf')]='';this[_0x8263('0x10')]=0x0;this[_0x8263('0x11')]=![];this[_0x8263('0x12')]='';this['motionChannel']=_0x8263('0x13');this[_0x8263('0x14')]=0x0;this[_0x8263('0x15')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xbb11=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','lastAssignedTo','motionChannel','voice','mohtime','variables','type','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x194722,_0x524c0f){var _0x2b722b=function(_0x164b5b){while(--_0x164b5b){_0x194722['push'](_0x194722['shift']());}};_0x2b722b(++_0x524c0f);}(_0xbb11,0x1e9));var _0x1bb1=function(_0x50fdc8,_0x4b25a0){_0x50fdc8=_0x50fdc8-0x0;var _0x554038=_0xbb11[_0x50fdc8];return _0x554038;};'use strict';function QueueReport(){this[_0x1bb1('0x0')]='inbound';this[_0x1bb1('0x1')]='';this[_0x1bb1('0x2')]='';this['calleridname']='';this['queue']='';this[_0x1bb1('0x3')]=null;this[_0x1bb1('0x4')]=null;this['position']=0x1;this[_0x1bb1('0x5')]=0x1;this[_0x1bb1('0x6')]=![];this[_0x1bb1('0x7')]=null;this[_0x1bb1('0x8')]=![];this[_0x1bb1('0x9')]=null;this[_0x1bb1('0xa')]=![];this[_0x1bb1('0xb')]=null;this[_0x1bb1('0xc')]=0x1;this[_0x1bb1('0xd')]='';this[_0x1bb1('0xe')]='';this[_0x1bb1('0xf')]='';this[_0x1bb1('0x10')]='';this[_0x1bb1('0x11')]='';this[_0x1bb1('0x12')]='';this[_0x1bb1('0x13')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x1bb1('0x14')]='';this[_0x1bb1('0x15')]=_0x1bb1('0x16');this[_0x1bb1('0x17')]=0x0;this[_0x1bb1('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 7f75b92..bd3ad02 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 _0xfd53=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x491ac0,_0x3e46b6){var _0x589733=function(_0x3d2c66){while(--_0x3d2c66){_0x491ac0['push'](_0x491ac0['shift']());}};_0x589733(++_0x3e46b6);}(_0xfd53,0x1d9));var _0x3fd5=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xfd53[_0x47a349];return _0x18ab75;};'use strict';function SalesforceAccount(_0x35e598){this['id']=_0x35e598['id']||0x0;this[_0x3fd5('0x0')]=_0x35e598[_0x3fd5('0x0')]||'';this[_0x3fd5('0x1')]=_0x35e598['username']||'';this[_0x3fd5('0x2')]=_0x35e598['remoteUri']||'';this[_0x3fd5('0x3')]=_0x35e598[_0x3fd5('0x3')]||'';this[_0x3fd5('0x4')]=_0x35e598['clientId']||'';this[_0x3fd5('0x5')]=_0x35e598[_0x3fd5('0x5')]||'';this['securityToken']=_0x35e598[_0x3fd5('0x6')]||'';this[_0x3fd5('0x7')]=_0x35e598[_0x3fd5('0x7')]||_0x3fd5('0x8');this[_0x3fd5('0x9')]=_0x35e598[_0x3fd5('0x9')]||'';this[_0x3fd5('0xa')]=_0x35e598[_0x3fd5('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xc8be=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','integrationTab'];(function(_0x1a0b5b,_0x7ce148){var _0x2ace4f=function(_0x4da838){while(--_0x4da838){_0x1a0b5b['push'](_0x1a0b5b['shift']());}};_0x2ace4f(++_0x7ce148);}(_0xc8be,0x66));var _0xec8b=function(_0x4fe362,_0x162247){_0x4fe362=_0x4fe362-0x0;var _0x1b51e2=_0xc8be[_0x4fe362];return _0x1b51e2;};'use strict';function SalesforceAccount(_0x37ec4a){this['id']=_0x37ec4a['id']||0x0;this['name']=_0x37ec4a[_0xec8b('0x0')]||'';this[_0xec8b('0x1')]=_0x37ec4a[_0xec8b('0x1')]||'';this[_0xec8b('0x2')]=_0x37ec4a['remoteUri']||'';this[_0xec8b('0x3')]=_0x37ec4a['password']||'';this[_0xec8b('0x4')]=_0x37ec4a['clientId']||'';this[_0xec8b('0x5')]=_0x37ec4a[_0xec8b('0x5')]||'';this['securityToken']=_0x37ec4a[_0xec8b('0x6')]||'';this['type']=_0x37ec4a['type']||_0xec8b('0x7');this[_0xec8b('0x8')]=_0x37ec4a[_0xec8b('0x8')]||'';this[_0xec8b('0x9')]=_0x37ec4a[_0xec8b('0x9')]||{};}module[_0xec8b('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 209b34e..e759d62 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 _0x1aa5=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x49ab67,_0x48c509){var _0x568127=function(_0x53b3fa){while(--_0x53b3fa){_0x49ab67['push'](_0x49ab67['shift']());}};_0x568127(++_0x48c509);}(_0x1aa5,0x16a));var _0x51aa=function(_0x522f3f,_0x1a478f){_0x522f3f=_0x522f3f-0x0;var _0x416ae1=_0x1aa5[_0x522f3f];return _0x416ae1;};'use strict';function ServicenowAccount(_0x1092e9){this['id']=_0x1092e9['id']||0x0;this['name']=_0x1092e9[_0x51aa('0x0')]||'';this[_0x51aa('0x1')]=_0x1092e9['username']||'';this[_0x51aa('0x2')]=_0x1092e9['password']||'';this[_0x51aa('0x3')]=_0x1092e9['remoteUri']||'';this[_0x51aa('0x4')]=_0x1092e9[_0x51aa('0x4')]||'';this[_0x51aa('0x5')]=_0x1092e9['Configurations']||{};}module[_0x51aa('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf1f1=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xf1f1,0x10c));var _0x1f1f=function(_0x17388a,_0x1031f4){_0x17388a=_0x17388a-0x0;var _0x4371d6=_0xf1f1[_0x17388a];return _0x4371d6;};'use strict';function ServicenowAccount(_0x3bf4e8){this['id']=_0x3bf4e8['id']||0x0;this[_0x1f1f('0x0')]=_0x3bf4e8[_0x1f1f('0x0')]||'';this[_0x1f1f('0x1')]=_0x3bf4e8['username']||'';this[_0x1f1f('0x2')]=_0x3bf4e8[_0x1f1f('0x2')]||'';this[_0x1f1f('0x3')]=_0x3bf4e8[_0x1f1f('0x3')]||'';this[_0x1f1f('0x4')]=_0x3bf4e8['serverUrl']||'';this['Configurations']=_0x3bf4e8[_0x1f1f('0x5')]||{};}module[_0x1f1f('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 96cf4ec..abde90d 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 _0xed0a=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x49a055,_0x1314ef){var _0x49fe80=function(_0x4e03dd){while(--_0x4e03dd){_0x49a055['push'](_0x49a055['shift']());}};_0x49fe80(++_0x1314ef);}(_0xed0a,0x97));var _0xaed0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xed0a[_0x20a584];return _0x4b41a8;};'use strict';function SugarcrmAccount(_0x5c3c44){this['id']=_0x5c3c44['id']||0x0;this[_0xaed0('0x0')]=_0x5c3c44[_0xaed0('0x0')]||'';this['username']=_0x5c3c44[_0xaed0('0x1')]||'';this[_0xaed0('0x2')]=_0x5c3c44[_0xaed0('0x2')]||'';this[_0xaed0('0x3')]=_0x5c3c44[_0xaed0('0x3')]||'';this[_0xaed0('0x4')]=_0x5c3c44[_0xaed0('0x4')]||'';this[_0xaed0('0x5')]=_0x5c3c44[_0xaed0('0x5')]||{};}module[_0xaed0('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0ae6=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x61e3a6,_0xbc2fe8){var _0xd637c8=function(_0x48221f){while(--_0x48221f){_0x61e3a6['push'](_0x61e3a6['shift']());}};_0xd637c8(++_0xbc2fe8);}(_0x0ae6,0xea));var _0x60ae=function(_0x56961e,_0x5c4a8b){_0x56961e=_0x56961e-0x0;var _0x5bc7a1=_0x0ae6[_0x56961e];return _0x5bc7a1;};'use strict';function SugarcrmAccount(_0x145337){this['id']=_0x145337['id']||0x0;this[_0x60ae('0x0')]=_0x145337['name']||'';this['username']=_0x145337[_0x60ae('0x1')]||'';this['password']=_0x145337['password']||'';this[_0x60ae('0x2')]=_0x145337[_0x60ae('0x2')]||'';this['serverUrl']=_0x145337[_0x60ae('0x3')]||'';this[_0x60ae('0x4')]=_0x145337['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 0921321..ece86b7 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 _0x9101=['name','accountcode','state','status','address','exports'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x9101,0x9c));var _0x1910=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x9101[_0x2c7618];return _0x5ce3f0;};'use strict';function Telephone(_0x300254){this['id']=_0x300254['id']||0x0;this[_0x1910('0x0')]=_0x300254['name']||'';this[_0x1910('0x1')]=_0x300254[_0x1910('0x1')]||'';this[_0x1910('0x2')]='unknown';this['stateTime']=0x0;this[_0x1910('0x3')]='unknown';this[_0x1910('0x4')]='';}module[_0x1910('0x5')]=Telephone; \ No newline at end of file +var _0x5aba=['accountcode','state','stateTime','status','unknown'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5aba,0x69));var _0xa5ab=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x5aba[_0x2d364e];return _0x1b9312;};'use strict';function Telephone(_0x1c1a98){this['id']=_0x1c1a98['id']||0x0;this['name']=_0x1c1a98['name']||'';this[_0xa5ab('0x0')]=_0x1c1a98['accountcode']||'';this[_0xa5ab('0x1')]='unknown';this[_0xa5ab('0x2')]=0x0;this[_0xa5ab('0x3')]=_0xa5ab('0x4');this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index e58a8f0..d4b9100 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x24b04a,_0x584602){var _0x576778=function(_0x251197){while(--_0x251197){_0x24b04a['push'](_0x24b04a['shift']());}};_0x576778(++_0x584602);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e9e76,_0x3cb685){_0x5e9e76=_0x5e9e76-0x0;var _0x2bc580=_0xb10b[_0x5e9e76];return _0x2bc580;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x302efe,_0x558844){var _0x3ac6b0=function(_0x583147){while(--_0x583147){_0x302efe['push'](_0x302efe['shift']());}};_0x3ac6b0(++_0x558844);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 d6a8b94..4c27330 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x135b3e,_0x361495){var _0x323ec6=function(_0x1bf7ff){while(--_0x1bf7ff){_0x135b3e['push'](_0x135b3e['shift']());}};_0x323ec6(++_0x361495);}(_0x14a0,0x8e));var _0x014a=function(_0x4e10bc,_0x53b3d3){_0x4e10bc=_0x4e10bc-0x0;var _0x4e5e13=_0x14a0[_0x4e10bc];return _0x4e5e13;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x1d263a,_0xdc5a22){var _0x370f50=function(_0x1275ad){while(--_0x1275ad){_0x1d263a['push'](_0x1d263a['shift']());}};_0x370f50(++_0xdc5a22);}(_0x757a,0xde));var _0xa757=function(_0x84f3a0,_0x2d5fa5){_0x84f3a0=_0x84f3a0-0x0;var _0x401047=_0x757a[_0x84f3a0];return _0x401047;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index ad1bd79..3fdabba 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 _0xc830=['host','port','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','registry','split'];(function(_0x347f62,_0x549036){var _0xb3bfdc=function(_0x301c13){while(--_0x301c13){_0x347f62['push'](_0x347f62['shift']());}};_0xb3bfdc(++_0x549036);}(_0xc830,0x159));var _0x0c83=function(_0x57596d,_0xf09e85){_0x57596d=_0x57596d-0x0;var _0x5990eb=_0xc830[_0x57596d];return _0x5990eb;};'use strict';function Trunk(_0x105083){this['id']=_0x105083['id']||0x0;this[_0x0c83('0x0')]=_0x105083[_0x0c83('0x0')]||![];this['name']=_0x105083[_0x0c83('0x1')]||'';this[_0x0c83('0x2')]=_0x0c83('0x3');this[_0x0c83('0x4')]=0x0;this['status']='unknown';this['registry']=_0x105083[_0x0c83('0x5')]&&_0x105083[_0x0c83('0x5')]['indexOf'](':')?_0x105083['registry'][_0x0c83('0x6')](':')[0x0]:'';this[_0x0c83('0x7')]='';this[_0x0c83('0x8')]='';this['domain']='';this[_0x0c83('0x9')]='';this[_0x0c83('0xa')]='';this[_0x0c83('0xb')]='unknown';this[_0x0c83('0xc')]='';this[_0x0c83('0xd')]='';this[_0x0c83('0xe')]=_0x105083['defaultuser']||'';}module[_0x0c83('0xf')]=Trunk; \ No newline at end of file +var _0x4df9=['host','port','domain','domainport','stateRegistry','address','defaultuser','exports','active','name','state','unknown','status','registry'];(function(_0x24c11b,_0x32b86c){var _0x34c54e=function(_0x403644){while(--_0x403644){_0x24c11b['push'](_0x24c11b['shift']());}};_0x34c54e(++_0x32b86c);}(_0x4df9,0x1f2));var _0x94df=function(_0xb27c02,_0xb2623e){_0xb27c02=_0xb27c02-0x0;var _0xf5d1a0=_0x4df9[_0xb27c02];return _0xf5d1a0;};'use strict';function Trunk(_0x36277b){this['id']=_0x36277b['id']||0x0;this[_0x94df('0x0')]=_0x36277b[_0x94df('0x0')]||![];this[_0x94df('0x1')]=_0x36277b['name']||'';this[_0x94df('0x2')]=_0x94df('0x3');this['stateTime']=0x0;this[_0x94df('0x4')]=_0x94df('0x3');this[_0x94df('0x5')]=_0x36277b[_0x94df('0x5')]&&_0x36277b['registry']['indexOf'](':')?_0x36277b['registry']['split'](':')[0x0]:'';this[_0x94df('0x6')]='';this[_0x94df('0x7')]='';this[_0x94df('0x8')]='';this[_0x94df('0x9')]='';this['refresh']='';this[_0x94df('0xa')]=_0x94df('0x3');this['registrationtime']='';this[_0x94df('0xb')]='';this[_0x94df('0xc')]=_0x36277b['defaultuser']||'';}module[_0x94df('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index a442813..deb8cc9 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 _0x85f5=['exports','exten','recordingFormat'];(function(_0x8892f9,_0x30cd1a){var _0x274459=function(_0x561ebc){while(--_0x561ebc){_0x8892f9['push'](_0x8892f9['shift']());}};_0x274459(++_0x30cd1a);}(_0x85f5,0x7f));var _0x585f=function(_0x32f38b,_0x1b4fc7){_0x32f38b=_0x32f38b-0x0;var _0x15ec9b=_0x85f5[_0x32f38b];return _0x15ec9b;};'use strict';function voiceExtension(_0x2e1d01){this['id']=_0x2e1d01['id']||0x0;this[_0x585f('0x0')]=_0x2e1d01[_0x585f('0x0')]||'';this[_0x585f('0x1')]=_0x2e1d01[_0x585f('0x1')]||'none';this['mandatoryDisposition']=_0x2e1d01['mandatoryDisposition']||![];}module[_0x585f('0x2')]=voiceExtension; \ No newline at end of file +var _0x73de=['exten','none','mandatoryDisposition','exports'];(function(_0x33642b,_0x1f8e98){var _0x5a46a0=function(_0x1995b2){while(--_0x1995b2){_0x33642b['push'](_0x33642b['shift']());}};_0x5a46a0(++_0x1f8e98);}(_0x73de,0x194));var _0xe73d=function(_0x5f1b87,_0xd76e68){_0x5f1b87=_0x5f1b87-0x0;var _0x1d8152=_0x73de[_0x5f1b87];return _0x1d8152;};'use strict';function voiceExtension(_0xb5a8e1){this['id']=_0xb5a8e1['id']||0x0;this['exten']=_0xb5a8e1[_0xe73d('0x0')]||'';this['recordingFormat']=_0xb5a8e1['recordingFormat']||_0xe73d('0x1');this[_0xe73d('0x2')]=_0xb5a8e1['mandatoryDisposition']||![];}module[_0xe73d('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 e385607..3ff8bbb 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 _0x10bd=['talking','answered','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x10bd,0xe2));var _0xd10b=function(_0x1c232f,_0x1f498c){_0x1c232f=_0x1c232f-0x0;var _0x3e0882=_0x10bd[_0x1c232f];return _0x3e0882;};'use strict';var statusDesc=[_0xd10b('0x0'),_0xd10b('0x1'),_0xd10b('0x2'),_0xd10b('0x3'),_0xd10b('0x4'),_0xd10b('0x5'),_0xd10b('0x6'),_0xd10b('0x7'),_0xd10b('0x8')];var monitorFormat={'wav':_0xd10b('0x9'),'wav49':_0xd10b('0xa'),'gsm':'gsm'};var strategy={'rrmemory':_0xd10b('0xb'),'roundrobin':_0xd10b('0xc')};function VoiceQueue(_0x48cb10){this['id']=_0x48cb10['id']||0x0;this[_0xd10b('0xd')]=_0x48cb10[_0xd10b('0xd')]||'';this[_0xd10b('0xe')]=_0x48cb10[_0xd10b('0xe')]||'';this[_0xd10b('0xf')]=_0x48cb10['type']||_0xd10b('0x10');this[_0xd10b('0x11')]=0x0;this[_0xd10b('0x12')]=0x0;this['total']=0x0;this[_0xd10b('0x13')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xd10b('0x14')]=0x0;this[_0xd10b('0x15')]=0x0;this['abandoned']=0x0;this[_0xd10b('0x16')]=0x0;this[_0xd10b('0x17')]=0x0;this[_0xd10b('0x18')]=_0x48cb10[_0xd10b('0x18')]||![];this[_0xd10b('0x19')]=_0x48cb10[_0xd10b('0x19')]||0xa;this[_0xd10b('0x1a')]=_0x48cb10[_0xd10b('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this[_0xd10b('0x1b')]='';this['originated']=0x0;this['temp']=0x0;this['dialTimezone']=_0x48cb10[_0xd10b('0x1c')]||null;this[_0xd10b('0x1d')]=_0x48cb10[_0xd10b('0x1d')]?_0x48cb10[_0xd10b('0x1d')]:null;this[_0xd10b('0x1e')]=_0x48cb10[_0xd10b('0x1e')];this[_0xd10b('0x1f')]=_0x48cb10[_0xd10b('0x1f')]||_0xd10b('0x20');this[_0xd10b('0x21')]=_0x48cb10[_0xd10b('0x21')]||0x0;this[_0xd10b('0x22')]=_0x48cb10['dialLimitQueue']||0x0;this[_0xd10b('0x23')]=_0x48cb10['dialPowerLevel']||0x1;this[_0xd10b('0x24')]=_0x48cb10['dialPredictiveOptimization']||_0xd10b('0x25');this[_0xd10b('0x26')]=_0x48cb10['dialPredictiveOptimizationPercentage']||0.03;this[_0xd10b('0x27')]=_0x48cb10[_0xd10b('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x48cb10['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x48cb10[_0xd10b('0x28')]||_0xd10b('0x29');this[_0xd10b('0x2a')]=_0x48cb10[_0xd10b('0x2a')]||0x1e;this[_0xd10b('0x2b')]=_0x48cb10[_0xd10b('0x2b')]||'tTxX';this['dialQueueTimeout']=_0x48cb10[_0xd10b('0x2c')]||0x3;this[_0xd10b('0x2d')]=_0x48cb10[_0xd10b('0x2d')]||undefined;this[_0xd10b('0x2e')]=_0x48cb10['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x48cb10[_0xd10b('0x2f')]||0x96;this[_0xd10b('0x30')]=_0x48cb10['dialBusyMaxRetry']||0x3;this[_0xd10b('0x31')]=_0x48cb10['dialBusyRetryFrequency']||0x96;this[_0xd10b('0x32')]=_0x48cb10[_0xd10b('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x48cb10[_0xd10b('0x33')]||0x96;this[_0xd10b('0x34')]=_0x48cb10[_0xd10b('0x34')]||0x3;this[_0xd10b('0x35')]=_0x48cb10[_0xd10b('0x35')]||0x96;this[_0xd10b('0x36')]=_0x48cb10['dialDropMaxRetry']||0x3;this[_0xd10b('0x37')]=_0x48cb10['dialDropRetryFrequency']||0x96;this[_0xd10b('0x38')]=_0x48cb10['dialAbandonedMaxRetry']||0x3;this[_0xd10b('0x39')]=_0x48cb10[_0xd10b('0x39')]||0x96;this[_0xd10b('0x3a')]=_0x48cb10[_0xd10b('0x3a')]||0x3;this[_0xd10b('0x3b')]=_0x48cb10[_0xd10b('0x3b')]||0x96;this[_0xd10b('0x3c')]=_0x48cb10['dialAgentRejectMaxRetry']||0x3;this[_0xd10b('0x3d')]=_0x48cb10[_0xd10b('0x3d')]||0x96;this[_0xd10b('0x3e')]=_0x48cb10[_0xd10b('0x3e')]||0x4;this['Trunk']=_0x48cb10[_0xd10b('0x3f')]?_0x48cb10[_0xd10b('0x3f')]:undefined;this[_0xd10b('0x40')]=_0x48cb10[_0xd10b('0x40')]?_0x48cb10['TrunkBackup']:undefined;this['dialPrefix']=_0x48cb10[_0xd10b('0x41')]||undefined;this[_0xd10b('0x42')]=_0x48cb10[_0xd10b('0x42')]?_0x48cb10[_0xd10b('0x42')]:undefined;this[_0xd10b('0x43')]=_0x48cb10[_0xd10b('0x43')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x48cb10['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xd10b('0x44')]=_0x48cb10[_0xd10b('0x44')]||undefined;this[_0xd10b('0x45')]=strategy[_0x48cb10['strategy']]||_0xd10b('0xb');this[_0xd10b('0x46')]=!![];this['dialAMDActive']=_0x48cb10[_0xd10b('0x47')]||![];this[_0xd10b('0x48')]=_0x48cb10[_0xd10b('0x48')];this[_0xd10b('0x49')]=_0x48cb10[_0xd10b('0x49')];this[_0xd10b('0x4a')]=_0x48cb10[_0xd10b('0x4a')];this['dialAMDTotalAnalysisTime']=_0x48cb10[_0xd10b('0x4b')];this[_0xd10b('0x4c')]=_0x48cb10[_0xd10b('0x4c')];this[_0xd10b('0x4d')]=_0x48cb10['dialAMDBetweenWordsSilence'];this[_0xd10b('0x4e')]=_0x48cb10[_0xd10b('0x4e')];this[_0xd10b('0x4f')]=_0x48cb10[_0xd10b('0x4f')];this[_0xd10b('0x50')]=_0x48cb10[_0xd10b('0x50')];this[_0xd10b('0x51')]=0x0;this['pTalking']=0x0;this[_0xd10b('0x52')]=_0x48cb10['timeout'];this[_0xd10b('0x53')]=0x0;this[_0xd10b('0x54')]=0x0;this[_0xd10b('0x55')]=0x0;this[_0xd10b('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xd10b('0x57')]=0x0;this[_0xd10b('0x58')]=0x0;this[_0xd10b('0x59')]=0x0;this[_0xd10b('0x5a')]=0x0;this[_0xd10b('0x5b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xd10b('0x5c')]=0x0;this[_0xd10b('0x5d')]=0x0;this[_0xd10b('0x5e')]=undefined;this[_0xd10b('0x5f')]=undefined;this[_0xd10b('0x60')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xd10b('0x61')]=0x0;this[_0xd10b('0x62')]=0x0;this[_0xd10b('0x63')]=0x0;this[_0xd10b('0x64')]=0x0;this[_0xd10b('0x65')]=0x0;this[_0xd10b('0x66')]=0x0;this[_0xd10b('0x67')]=0x0;this[_0xd10b('0x68')]=_0x48cb10[_0xd10b('0x69')]||0x14;this[_0xd10b('0x6a')]=_0x48cb10['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xd10b('0x6b')]=0x0;this[_0xd10b('0x6c')]=0x0;this[_0xd10b('0x6d')]=0x1;this[_0xd10b('0x6e')]=0x0;this[_0xd10b('0x6f')]=0x0;this[_0xd10b('0x70')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x48cb10[_0xd10b('0x71')]||0x1e;this[_0xd10b('0x72')]=_0x48cb10['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x48cb10[_0xd10b('0x73')]||![];this['dialQueueProject2']=_0x48cb10[_0xd10b('0x74')]||undefined;this[_0xd10b('0x75')]=_0x48cb10[_0xd10b('0x75')]||![];this['dialAgiAfterHangupAgent']=_0x48cb10[_0xd10b('0x76')]||![];this[_0xd10b('0xe')]=monitorFormat[_0x48cb10['monitor_format']]?monitorFormat[_0x48cb10['monitor_format']]:undefined;this[_0xd10b('0x77')]=_0x48cb10[_0xd10b('0x77')]||![];this['mandatoryDispositionPause']=_0x48cb10['mandatoryDispositionPause']?_0x48cb10[_0xd10b('0x78')]:undefined;}module[_0xd10b('0x79')]=VoiceQueue; \ No newline at end of file +var _0xafa1=['loggedIn','available','acw','autopause','sendMessageOneNotActive','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned'];(function(_0x5d5caf,_0x3b16cf){var _0x60bea0=function(_0x2f1026){while(--_0x2f1026){_0x5d5caf['push'](_0x5d5caf['shift']());}};_0x60bea0(++_0x3b16cf);}(_0xafa1,0x14e));var _0x1afa=function(_0x559a98,_0x28c39b){_0x559a98=_0x559a98-0x0;var _0x22810a=_0xafa1[_0x559a98];return _0x22810a;};'use strict';var statusDesc=[_0x1afa('0x0'),_0x1afa('0x1'),'inuse',_0x1afa('0x2'),'invalid','unavailable',_0x1afa('0x3'),_0x1afa('0x4'),_0x1afa('0x5')];var monitorFormat={'wav':_0x1afa('0x6'),'wav49':_0x1afa('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x1afa('0x8'),'roundrobin':_0x1afa('0x9')};function VoiceQueue(_0x36cca4){this['id']=_0x36cca4['id']||0x0;this['name']=_0x36cca4['name']||'';this[_0x1afa('0xa')]=_0x36cca4['monitor_format']||'';this[_0x1afa('0xb')]=_0x36cca4[_0x1afa('0xb')]||_0x1afa('0xc');this[_0x1afa('0xd')]=0x0;this['talking']=0x0;this[_0x1afa('0xe')]=0x0;this[_0x1afa('0xf')]=0x0;this[_0x1afa('0x10')]=0x0;this[_0x1afa('0x11')]=0x0;this['sumBillable']=0x0;this[_0x1afa('0x12')]=0x0;this[_0x1afa('0x13')]=0x0;this[_0x1afa('0x14')]=0x0;this[_0x1afa('0x15')]=0x0;this[_0x1afa('0x16')]=_0x36cca4[_0x1afa('0x16')]||![];this['acwTimeout']=_0x36cca4['acwTimeout']||0xa;this[_0x1afa('0x17')]=_0x36cca4[_0x1afa('0x17')]||'no';this[_0x1afa('0x18')]=!![];this['message']='';this['originated']=0x0;this['temp']=0x0;this[_0x1afa('0x19')]=_0x36cca4['dialTimezone']||null;this['dialGlobalInterval']=_0x36cca4['dialGlobalInterval']?_0x36cca4[_0x1afa('0x1a')]:null;this[_0x1afa('0x1b')]=_0x36cca4[_0x1afa('0x1b')];this[_0x1afa('0x1c')]=_0x36cca4['dialMethod']||_0x1afa('0x1d');this[_0x1afa('0x1e')]=_0x36cca4[_0x1afa('0x1e')]||0x0;this['dialLimitQueue']=_0x36cca4[_0x1afa('0x1f')]||0x0;this[_0x1afa('0x20')]=_0x36cca4['dialPowerLevel']||0x1;this[_0x1afa('0x21')]=_0x36cca4['dialPredictiveOptimization']||_0x1afa('0x22');this['dialPredictiveOptimizationPercentage']=_0x36cca4[_0x1afa('0x23')]||0.03;this[_0x1afa('0x24')]=_0x36cca4[_0x1afa('0x24')]||0x258;this[_0x1afa('0x25')]=_0x36cca4[_0x1afa('0x25')]||_0x1afa('0x26');this[_0x1afa('0x27')]=_0x36cca4['dialOriginateCallerIdNumber']||_0x1afa('0x26');this['dialOriginateTimeout']=_0x36cca4[_0x1afa('0x28')]||0x1e;this['dialQueueOptions']=_0x36cca4[_0x1afa('0x29')]||_0x1afa('0x2a');this[_0x1afa('0x2b')]=_0x36cca4[_0x1afa('0x2b')]||0x3;this[_0x1afa('0x2c')]=_0x36cca4[_0x1afa('0x2c')]||undefined;this[_0x1afa('0x2d')]=_0x36cca4['dialCongestionMaxRetry']||0x3;this[_0x1afa('0x2e')]=_0x36cca4['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x36cca4[_0x1afa('0x2f')]||0x3;this[_0x1afa('0x30')]=_0x36cca4[_0x1afa('0x30')]||0x96;this[_0x1afa('0x31')]=_0x36cca4['dialNoAnswerMaxRetry']||0x3;this[_0x1afa('0x32')]=_0x36cca4[_0x1afa('0x32')]||0x96;this[_0x1afa('0x33')]=_0x36cca4[_0x1afa('0x33')]||0x3;this[_0x1afa('0x34')]=_0x36cca4[_0x1afa('0x34')]||0x96;this[_0x1afa('0x35')]=_0x36cca4[_0x1afa('0x35')]||0x3;this[_0x1afa('0x36')]=_0x36cca4['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x36cca4[_0x1afa('0x37')]||0x3;this[_0x1afa('0x38')]=_0x36cca4[_0x1afa('0x38')]||0x96;this['dialMachineMaxRetry']=_0x36cca4[_0x1afa('0x39')]||0x3;this[_0x1afa('0x3a')]=_0x36cca4[_0x1afa('0x3a')]||0x96;this[_0x1afa('0x3b')]=_0x36cca4[_0x1afa('0x3b')]||0x3;this[_0x1afa('0x3c')]=_0x36cca4[_0x1afa('0x3c')]||0x96;this[_0x1afa('0x3d')]=_0x36cca4['dialGlobalMaxRetry']||0x4;this[_0x1afa('0x3e')]=_0x36cca4[_0x1afa('0x3e')]?_0x36cca4[_0x1afa('0x3e')]:undefined;this[_0x1afa('0x3f')]=_0x36cca4['TrunkBackup']?_0x36cca4[_0x1afa('0x3f')]:undefined;this[_0x1afa('0x40')]=_0x36cca4[_0x1afa('0x40')]||undefined;this[_0x1afa('0x41')]=_0x36cca4['Interval']?_0x36cca4[_0x1afa('0x41')]:undefined;this[_0x1afa('0x42')]=_0x36cca4[_0x1afa('0x42')]||_0x1afa('0x43');this[_0x1afa('0x44')]=_0x36cca4[_0x1afa('0x44')]||undefined;this[_0x1afa('0x45')]=_0x36cca4['dialCutDigit']||undefined;this[_0x1afa('0x46')]=strategy[_0x36cca4['strategy']]||_0x1afa('0x8');this['queueStatusComplete']=!![];this[_0x1afa('0x47')]=_0x36cca4[_0x1afa('0x47')]||![];this['dialAMDInitialSilence']=_0x36cca4[_0x1afa('0x48')];this[_0x1afa('0x49')]=_0x36cca4[_0x1afa('0x49')];this[_0x1afa('0x4a')]=_0x36cca4[_0x1afa('0x4a')];this[_0x1afa('0x4b')]=_0x36cca4[_0x1afa('0x4b')];this[_0x1afa('0x4c')]=_0x36cca4[_0x1afa('0x4c')];this[_0x1afa('0x4d')]=_0x36cca4['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x36cca4[_0x1afa('0x4e')];this[_0x1afa('0x4f')]=_0x36cca4[_0x1afa('0x4f')];this[_0x1afa('0x50')]=_0x36cca4[_0x1afa('0x50')];this[_0x1afa('0x51')]=0x0;this['pTalking']=0x0;this[_0x1afa('0x52')]=_0x36cca4[_0x1afa('0x52')];this[_0x1afa('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x1afa('0x54')]=0x0;this[_0x1afa('0x55')]=0x0;this[_0x1afa('0x56')]=0x0;this[_0x1afa('0x57')]=0x0;this[_0x1afa('0x58')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x1afa('0x59')]=0x0;this[_0x1afa('0x5a')]=0x0;this[_0x1afa('0x5b')]=0x0;this[_0x1afa('0x5c')]=0x0;this[_0x1afa('0x5d')]=0x0;this['startProgressive']=undefined;this[_0x1afa('0x5e')]=undefined;this[_0x1afa('0x5f')]=undefined;this[_0x1afa('0x60')]=1.05;this[_0x1afa('0x61')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x1afa('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x1afa('0x63')]=0x0;this[_0x1afa('0x64')]=0x0;this[_0x1afa('0x65')]=0x0;this[_0x1afa('0x66')]=_0x36cca4[_0x1afa('0x67')]||0x14;this[_0x1afa('0x68')]=_0x36cca4[_0x1afa('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x1afa('0x69')]=0x0;this[_0x1afa('0x6a')]=0x1;this[_0x1afa('0x6b')]=0x0;this[_0x1afa('0x6c')]=0x0;this[_0x1afa('0x6d')]=0x0;this['erlangBusyFactor']=0x0;this[_0x1afa('0x6e')]=_0x36cca4[_0x1afa('0x6e')]||0x1e;this[_0x1afa('0x6f')]=_0x36cca4[_0x1afa('0x6f')]||![];this[_0x1afa('0x70')]=!!_0x36cca4['dialPreviewAutoRecallMe']||![];this[_0x1afa('0x71')]=_0x36cca4['dialQueueProject2']||undefined;this[_0x1afa('0x72')]=_0x36cca4[_0x1afa('0x72')]||![];this[_0x1afa('0x73')]=_0x36cca4['dialAgiAfterHangupAgent']||![];this[_0x1afa('0xa')]=monitorFormat[_0x36cca4['monitor_format']]?monitorFormat[_0x36cca4[_0x1afa('0xa')]]:undefined;this[_0x1afa('0x74')]=_0x36cca4[_0x1afa('0x74')]||![];this[_0x1afa('0x75')]=_0x36cca4['mandatoryDispositionPause']?_0x36cca4[_0x1afa('0x75')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2027003..ffbf7dc 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 _0x79e1=['remoteUri','serverUrl','Configurations','exports','name','accessKey'];(function(_0xe3d215,_0x21cf4b){var _0x446d9a=function(_0xac7654){while(--_0xac7654){_0xe3d215['push'](_0xe3d215['shift']());}};_0x446d9a(++_0x21cf4b);}(_0x79e1,0x1b4));var _0x179e=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0x79e1[_0x37c07d];return _0x10dadc;};'use strict';function VtigerAccount(_0x4ca904){this['id']=_0x4ca904['id']||0x0;this[_0x179e('0x0')]=_0x4ca904[_0x179e('0x0')]||'';this['username']=_0x4ca904['username']||'';this[_0x179e('0x1')]=_0x4ca904['accessKey']||'';this[_0x179e('0x2')]=_0x4ca904[_0x179e('0x2')]||'';this[_0x179e('0x3')]=_0x4ca904[_0x179e('0x3')]||'';this[_0x179e('0x4')]=_0x4ca904[_0x179e('0x4')]||{};}module[_0x179e('0x5')]=VtigerAccount; \ No newline at end of file +var _0xb565=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xb565,0xde));var _0x5b56=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xb565[_0x3a8db5];return _0x2c03cd;};'use strict';function VtigerAccount(_0x352a3d){this['id']=_0x352a3d['id']||0x0;this[_0x5b56('0x0')]=_0x352a3d[_0x5b56('0x0')]||'';this[_0x5b56('0x1')]=_0x352a3d[_0x5b56('0x1')]||'';this[_0x5b56('0x2')]=_0x352a3d[_0x5b56('0x2')]||'';this[_0x5b56('0x3')]=_0x352a3d[_0x5b56('0x3')]||'';this[_0x5b56('0x4')]=_0x352a3d[_0x5b56('0x4')]||'';this[_0x5b56('0x5')]=_0x352a3d[_0x5b56('0x5')]||{};}module[_0x5b56('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 664bc20..f42c538 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 _0x50f8=['Configurations','exports','name','password','token','remoteUri','authType','type','serverUrl'];(function(_0x3a50ae,_0x4a505b){var _0x3a16f4=function(_0x508359){while(--_0x508359){_0x3a50ae['push'](_0x3a50ae['shift']());}};_0x3a16f4(++_0x4a505b);}(_0x50f8,0x107));var _0x850f=function(_0x587cc1,_0x5d9744){_0x587cc1=_0x587cc1-0x0;var _0x3a5c36=_0x50f8[_0x587cc1];return _0x3a5c36;};'use strict';function ZendeskAccount(_0x43612b){this['id']=_0x43612b['id']||0x0;this[_0x850f('0x0')]=_0x43612b['name']||'';this['username']=_0x43612b['username']||'';this['password']=_0x43612b[_0x850f('0x1')]||'';this[_0x850f('0x2')]=_0x43612b[_0x850f('0x2')]||'';this[_0x850f('0x3')]=_0x43612b[_0x850f('0x3')]||'';this[_0x850f('0x4')]=_0x43612b[_0x850f('0x4')]||'';this['type']=_0x43612b[_0x850f('0x5')]||'integrationTab';this[_0x850f('0x6')]=_0x43612b[_0x850f('0x6')]||'';this['Configurations']=_0x43612b[_0x850f('0x7')]||{};}module[_0x850f('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x06af=['name','username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations','exports'];(function(_0x238e7c,_0x46ee86){var _0x128a39=function(_0x54b983){while(--_0x54b983){_0x238e7c['push'](_0x238e7c['shift']());}};_0x128a39(++_0x46ee86);}(_0x06af,0x78));var _0xf06a=function(_0x29e924,_0xb895f6){_0x29e924=_0x29e924-0x0;var _0x28e658=_0x06af[_0x29e924];return _0x28e658;};'use strict';function ZendeskAccount(_0x708fc7){this['id']=_0x708fc7['id']||0x0;this[_0xf06a('0x0')]=_0x708fc7[_0xf06a('0x0')]||'';this['username']=_0x708fc7[_0xf06a('0x1')]||'';this[_0xf06a('0x2')]=_0x708fc7[_0xf06a('0x2')]||'';this['token']=_0x708fc7[_0xf06a('0x3')]||'';this['remoteUri']=_0x708fc7[_0xf06a('0x4')]||'';this[_0xf06a('0x5')]=_0x708fc7[_0xf06a('0x5')]||'';this['type']=_0x708fc7['type']||_0xf06a('0x6');this['serverUrl']=_0x708fc7[_0xf06a('0x7')]||'';this[_0xf06a('0x8')]=_0x708fc7[_0xf06a('0x8')]||{};}module[_0xf06a('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index a8ce504..7afb055 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 _0xa9a5=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x263aed,_0x129aee){var _0x57156d=function(_0x413856){while(--_0x413856){_0x263aed['push'](_0x263aed['shift']());}};_0x57156d(++_0x129aee);}(_0xa9a5,0x1b4));var _0x5a9a=function(_0x54f15f,_0x4eb28d){_0x54f15f=_0x54f15f-0x0;var _0x1e93c0=_0xa9a5[_0x54f15f];return _0x1e93c0;};'use strict';function ZohoAccount(_0x34715f){this['id']=_0x34715f['id']||0x0;this['name']=_0x34715f[_0x5a9a('0x0')]||'';this[_0x5a9a('0x1')]=_0x34715f[_0x5a9a('0x1')]||'';this[_0x5a9a('0x2')]=_0x34715f['host']||'';this[_0x5a9a('0x3')]=_0x34715f['zone']||'';this[_0x5a9a('0x4')]=_0x34715f['clientId']||'';this[_0x5a9a('0x5')]=_0x34715f[_0x5a9a('0x5')]||'';this['serverUrl']=_0x34715f[_0x5a9a('0x6')]||'';this[_0x5a9a('0x7')]=_0x34715f[_0x5a9a('0x7')]||'';this[_0x5a9a('0x8')]=_0x34715f['refreshToken']||'';this[_0x5a9a('0x9')]=_0x34715f[_0x5a9a('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x2ace=['refreshToken','Configurations','exports','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x3f1dc0,_0xb9887a){var _0x284171=function(_0x5eae22){while(--_0x5eae22){_0x3f1dc0['push'](_0x3f1dc0['shift']());}};_0x284171(++_0xb9887a);}(_0x2ace,0xc1));var _0xe2ac=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x2ace[_0x2e0ffa];return _0x24d627;};'use strict';function ZohoAccount(_0x442649){this['id']=_0x442649['id']||0x0;this['name']=_0x442649['name']||'';this[_0xe2ac('0x0')]=_0x442649[_0xe2ac('0x0')]||'';this[_0xe2ac('0x1')]=_0x442649['host']||'';this[_0xe2ac('0x2')]=_0x442649[_0xe2ac('0x2')]||'';this['clientId']=_0x442649[_0xe2ac('0x3')]||'';this['clientSecret']=_0x442649[_0xe2ac('0x4')]||'';this[_0xe2ac('0x5')]=_0x442649[_0xe2ac('0x5')]||'';this[_0xe2ac('0x6')]=_0x442649[_0xe2ac('0x6')]||'';this[_0xe2ac('0x7')]=_0x442649[_0xe2ac('0x7')]||'';this[_0xe2ac('0x8')]=_0x442649[_0xe2ac('0x8')]||{};}module[_0xe2ac('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 558f44f..019329a 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 _0xcfc7=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','util','lodash','moment','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','Agent','channelAgent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcfc7,0x1be));var _0x7cfc=function(_0x7a319d,_0x235959){_0x7a319d=_0x7a319d-0x0;var _0x5c6b4e=_0xcfc7[_0x7a319d];return _0x5c6b4e;};'use strict';var util=require(_0x7cfc('0x0'));var _=require(_0x7cfc('0x1'));var moment=require(_0x7cfc('0x2'));function checkNameSurname(_0x483aac,_0x5799da,_0x41e58d){var _0x12edc3='';if(!_['isNil'](_0x5799da)&&_0x7cfc('0x3')===typeof _0x5799da){_0x12edc3+=_0x5799da;}if(!_['isNil'](_0x41e58d)&&_0x7cfc('0x3')===typeof _0x41e58d){_0x12edc3+='\x20'+_0x41e58d;}if(_0x12edc3!==''){return _0x12edc3;}return _0x483aac;}function Action(_0x58fbdd,_0x2bf271,_0x773c6,_0x35726a,_0x3c7beb){this[_0x7cfc('0x4')]=_0x773c6||undefined;this[_0x7cfc('0x5')]=_0x58fbdd['id'];this['queue']=_0x2bf271[_0x7cfc('0x6')];this['type']=_0x2bf271[_0x7cfc('0x7')];this[_0x7cfc('0x8')]=_0x7cfc('0x9');this[_0x7cfc('0xa')]=![];this['membername']=_['isNil'](_0x58fbdd[_0x7cfc('0xb')])?undefined:_0x58fbdd[_0x7cfc('0xb')][_0x7cfc('0x6')];this[_0x7cfc('0xc')]=this[_0x7cfc('0xd')]?util['format'](_0x7cfc('0xe'),this['membername']):_0x35726a||undefined;this['calleridname']=checkNameSurname(_0x58fbdd[_0x7cfc('0xf')][_0x7cfc('0x10')],_0x58fbdd[_0x7cfc('0xf')][_0x7cfc('0x11')],_0x58fbdd[_0x7cfc('0xf')][_0x7cfc('0x12')]);this['active']=_0x58fbdd[_0x7cfc('0x13')]||![];this[_0x7cfc('0x14')]=_0x58fbdd[_0x7cfc('0xf')][_0x7cfc('0x10')];this[_0x7cfc('0x15')]=_0x58fbdd[_0x7cfc('0x15')];this['countbusyretry']=_0x58fbdd['countbusyretry']||0x0;this['countcongestionretry']=_0x58fbdd[_0x7cfc('0x16')]||0x0;this['countnoanswerretry']=_0x58fbdd[_0x7cfc('0x17')]||0x0;this[_0x7cfc('0x18')]=(_0x58fbdd[_0x7cfc('0x19')]||0x0)+(_0x58fbdd['countcongestionretry']||0x0)+(_0x58fbdd[_0x7cfc('0x17')]||0x0)+(_0x58fbdd[_0x7cfc('0x1a')]||0x0)+(_0x58fbdd[_0x7cfc('0x1b')]||0x0)+(_0x58fbdd[_0x7cfc('0x1c')]||0x0)+(_0x58fbdd[_0x7cfc('0x1d')]||0x0)+(_0x58fbdd['countagentrejectretry']||0x0);this[_0x7cfc('0x1a')]=_0x58fbdd[_0x7cfc('0x1a')]||0x0;this[_0x7cfc('0x1b')]=_0x58fbdd[_0x7cfc('0x1b')]||0x0;this['countabandonedretry']=_0x58fbdd[_0x7cfc('0x1c')]||0x0;this[_0x7cfc('0x1d')]=_0x58fbdd[_0x7cfc('0x1d')]||0x0;this[_0x7cfc('0x1e')]=_0x58fbdd['countagentrejectretry']||0x0;this[_0x7cfc('0x1f')]=_0x58fbdd[_0x7cfc('0x1f')];this[_0x7cfc('0x20')]=_0x58fbdd[_0x7cfc('0x20')];this['callbackat']=_0x58fbdd[_0x7cfc('0x21')];this[_0x7cfc('0x22')]=_0x58fbdd['recallme'];this[_0x7cfc('0x23')]=_0x58fbdd[_0x7cfc('0x23')];this[_0x7cfc('0x24')]=_0x58fbdd[_0x7cfc('0x24')];this['UserId']=_['isNil'](_0x58fbdd[_0x7cfc('0xb')])?_0x58fbdd['UserId']:_0x58fbdd[_0x7cfc('0xb')]['id'];this[_0x7cfc('0x25')]=_0x58fbdd[_0x7cfc('0x25')];this[_0x7cfc('0x26')]='';this[_0x7cfc('0x27')]='';}Action['prototype'][_0x7cfc('0x28')]=function(){return util['format'](_0x7cfc('0x29'),this[_0x7cfc('0x2a')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x7f39=['countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x5880d8,_0x30b0a5){var _0x88264a=function(_0x5ec626){while(--_0x5ec626){_0x5880d8['push'](_0x5880d8['shift']());}};_0x88264a(++_0x30b0a5);}(_0x7f39,0x13d));var _0x97f3=function(_0x2ac2de,_0x109a1e){_0x2ac2de=_0x2ac2de-0x0;var _0xf453a1=_0x7f39[_0x2ac2de];return _0xf453a1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x97f3('0x0'));function checkNameSurname(_0x43fc7f,_0x332d89,_0xb60430){var _0x8a82f9='';if(!_['isNil'](_0x332d89)&&_0x97f3('0x1')===typeof _0x332d89){_0x8a82f9+=_0x332d89;}if(!_[_0x97f3('0x2')](_0xb60430)&&_0x97f3('0x1')===typeof _0xb60430){_0x8a82f9+='\x20'+_0xb60430;}if(_0x8a82f9!==''){return _0x8a82f9;}return _0x43fc7f;}function Action(_0x1bebe8,_0x18e8cd,_0x3d0275,_0x265916,_0x4d9ca0){this[_0x97f3('0x3')]=_0x3d0275||undefined;this[_0x97f3('0x4')]=_0x1bebe8['id'];this[_0x97f3('0x5')]=_0x18e8cd[_0x97f3('0x6')];this['type']=_0x18e8cd[_0x97f3('0x7')];this[_0x97f3('0x8')]=_0x97f3('0x5');this['dialAnswer']=![];this[_0x97f3('0x9')]=_[_0x97f3('0x2')](_0x1bebe8[_0x97f3('0xa')])?undefined:_0x1bebe8[_0x97f3('0xa')]['name'];this[_0x97f3('0xb')]=this[_0x97f3('0x9')]?util[_0x97f3('0xc')](_0x97f3('0xd'),this[_0x97f3('0x9')]):_0x265916||undefined;this['calleridname']=checkNameSurname(_0x1bebe8[_0x97f3('0xe')][_0x97f3('0xf')],_0x1bebe8[_0x97f3('0xe')][_0x97f3('0x10')],_0x1bebe8[_0x97f3('0xe')][_0x97f3('0x11')]);this[_0x97f3('0x12')]=_0x1bebe8['active']||![];this[_0x97f3('0x13')]=_0x1bebe8['Contact'][_0x97f3('0xf')];this['scheduledat']=_0x1bebe8[_0x97f3('0x14')];this['countbusyretry']=_0x1bebe8[_0x97f3('0x15')]||0x0;this[_0x97f3('0x16')]=_0x1bebe8['countcongestionretry']||0x0;this[_0x97f3('0x17')]=_0x1bebe8[_0x97f3('0x17')]||0x0;this[_0x97f3('0x18')]=(_0x1bebe8[_0x97f3('0x15')]||0x0)+(_0x1bebe8[_0x97f3('0x16')]||0x0)+(_0x1bebe8[_0x97f3('0x17')]||0x0)+(_0x1bebe8[_0x97f3('0x19')]||0x0)+(_0x1bebe8[_0x97f3('0x1a')]||0x0)+(_0x1bebe8[_0x97f3('0x1b')]||0x0)+(_0x1bebe8[_0x97f3('0x1c')]||0x0)+(_0x1bebe8[_0x97f3('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1bebe8['countnosuchnumberretry']||0x0;this[_0x97f3('0x1a')]=_0x1bebe8[_0x97f3('0x1a')]||0x0;this[_0x97f3('0x1b')]=_0x1bebe8[_0x97f3('0x1b')]||0x0;this[_0x97f3('0x1c')]=_0x1bebe8[_0x97f3('0x1c')]||0x0;this[_0x97f3('0x1d')]=_0x1bebe8['countagentrejectretry']||0x0;this[_0x97f3('0x1e')]=_0x1bebe8[_0x97f3('0x1e')];this[_0x97f3('0x1f')]=_0x1bebe8[_0x97f3('0x1f')];this[_0x97f3('0x20')]=_0x1bebe8['callbackat'];this[_0x97f3('0x21')]=_0x1bebe8[_0x97f3('0x21')];this[_0x97f3('0x22')]=_0x1bebe8['ContactId'];this[_0x97f3('0x23')]=_0x1bebe8[_0x97f3('0x23')];this[_0x97f3('0x24')]=_['isNil'](_0x1bebe8['Agent'])?_0x1bebe8['UserId']:_0x1bebe8['Agent']['id'];this[_0x97f3('0x25')]=_0x1bebe8[_0x97f3('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x97f3('0x26')][_0x97f3('0x27')]=function(){return util[_0x97f3('0xc')](_0x97f3('0x28'),this['calleridname'],this[_0x97f3('0x29')]);};module[_0x97f3('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 84430b4..20cc4b9 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 _0xa630=['[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','unlockAgent','activeContact','ANSWER','responsetime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','buildObj','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','NOANSWER','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','[originated][increment]','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','variables','keys','variable','addVariable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangBusyFactor','startPredictive','Trunk','name','callerid','Interval','stringify','md5','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','message','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','campaignsPreview','clockClearZombieChannels','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','[RecallMe]','catch','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal'];(function(_0x267719,_0x209ab4){var _0xca801e=function(_0x2e41fc){while(--_0x2e41fc){_0x267719['push'](_0x267719['shift']());}};_0xca801e(++_0x209ab4);}(_0xa630,0xbe));var _0x0a63=function(_0x2c48e9,_0x7cd9a8){_0x2c48e9=_0x2c48e9-0x0;var _0x46f8b6=_0xa630[_0x2c48e9];return _0x46f8b6;};'use strict';var util=require(_0x0a63('0x0'));var _=require(_0x0a63('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x0a63('0x2'));var md5=require('md5');var Redis=require(_0x0a63('0x3'));var config=require('../../../config/environment');var logger=require(_0x0a63('0x4'))(_0x0a63('0x5'));var loggerAction=require(_0x0a63('0x4'))(_0x0a63('0x6'));var ami=require(_0x0a63('0x7'));var rpcDb=require('./rpcDb');var Action=require(_0x0a63('0x8'));var ut=require(_0x0a63('0x9'));config[_0x0a63('0xa')]=_[_0x0a63('0xb')](config[_0x0a63('0xa')],{'host':_0x0a63('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a63('0xa')]));var Sequence=function(){};Sequence[_0x0a63('0xd')][_0x0a63('0xe')]=function(_0x218142){this[_0x0a63('0xf')]=this[_0x0a63('0xf')]?this[_0x0a63('0xf')][_0x0a63('0x10')](_0x218142):_0x218142();};function Preview(_0x258511){this[_0x0a63('0x11')]=new Sequence();this['campaignsPreview']=_0x258511[_0x0a63('0x12')];this[_0x0a63('0x13')]=_0x258511[_0x0a63('0x13')];this[_0x0a63('0x14')]={};this['agents']=_0x258511[_0x0a63('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x0a63('0x16'),this[_0x0a63('0x17')][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x19'),this[_0x0a63('0x1a')][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x1b'),this[_0x0a63('0x1c')]['bind'](this));ami['on'](_0x0a63('0x1d'),this['syncDialEnd'][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x1e'),this[_0x0a63('0x1f')][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x20'),this[_0x0a63('0x21')][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x22'),this[_0x0a63('0x23')][_0x0a63('0x18')](this));ami['on'](_0x0a63('0x24'),this['syncBlindTransfer']['bind'](this));this[_0x0a63('0x25')](this['campaignsPreview']);}function emit(_0x2fc87c,_0x5937df,_0x58513d){io['to'](_0x2fc87c)[_0x0a63('0x26')](_0x5937df,_0x58513d);}function emitCampaignPreview(_0x145625){if(_0x145625[_0x0a63('0x27')]==='outbound'){var _0x398a16={'id':_0x145625['id'],'name':_0x145625['name'],'strategy':_0x145625[_0x0a63('0x28')],'answered':_0x145625[_0x0a63('0x29')],'available':_0x145625[_0x0a63('0x2a')],'loggedIn':_0x145625[_0x0a63('0x2b')],'pTalking':_0x145625[_0x0a63('0x2c')],'sumBillable':_0x145625[_0x0a63('0x2d')],'sumDuration':_0x145625[_0x0a63('0x2e')],'sumHoldTime':_0x145625[_0x0a63('0x2f')]||0x0,'talking':_0x145625['talking'],'total':_0x145625['total'],'type':_0x145625['type'],'unmanaged':_0x145625['unmanaged'],'abandoned':_0x145625[_0x0a63('0x30')],'waiting':_0x145625['waiting'],'loggedInDb':_0x145625['loggedInDb'],'dialActive':_0x145625[_0x0a63('0x31')],'dialMethod':_0x145625[_0x0a63('0x32')],'dialOriginateCallerIdName':_0x145625[_0x0a63('0x33')],'dialOriginateCallerIdNumber':_0x145625[_0x0a63('0x34')],'dialOriginateTimeout':_0x145625['dialOriginateTimeout'],'dialPrefix':_0x145625[_0x0a63('0x35')],'outboundAnswerAgiCallsDay':_0x145625[_0x0a63('0x36')],'outboundAnswerCallsDay':_0x145625[_0x0a63('0x37')],'outboundBlacklistCallsDay':_0x145625['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x145625[_0x0a63('0x38')],'outboundCongestionCallsDay':_0x145625[_0x0a63('0x39')],'outboundDropCallsDayACS':_0x145625[_0x0a63('0x3a')],'outboundDropCallsDayCallersExit':_0x145625[_0x0a63('0x3b')],'outboundDropCallsDayTimeout':_0x145625[_0x0a63('0x3c')],'outboundNoAnswerCallsDay':_0x145625[_0x0a63('0x3d')],'outboundNoSuchCallsDay':_0x145625[_0x0a63('0x3e')],'outboundOriginateFailureCallsDay':_0x145625[_0x0a63('0x3f')],'outboundReCallsDay':_0x145625['outboundReCallsDay'],'outboundRejectCallsDay':_0x145625[_0x0a63('0x40')],'outboundUnknownCallsDay':_0x145625['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x145625[_0x0a63('0x41')],'predictiveIntervalAnsweredCalls':_0x145625[_0x0a63('0x42')],'predictiveIntervalAvgHoldtime':_0x145625[_0x0a63('0x43')],'predictiveIntervalAvgTalktime':_0x145625[_0x0a63('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x145625[_0x0a63('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x145625['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x145625[_0x0a63('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x145625[_0x0a63('0x47')],'predictiveIntervalHitRate':_0x145625[_0x0a63('0x48')],'predictiveIntervalMultiplicativeFactor':_0x145625[_0x0a63('0x49')],'predictiveIntervalPauses':_0x145625['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x145625[_0x0a63('0x4a')],'predictiveIntervalTotalCalls':_0x145625[_0x0a63('0x4b')],'message':_0x145625['message'],'originated':_0x145625['originated'],'erlangCalls':_0x145625[_0x0a63('0x4c')],'erlangCallToSecond':_0x145625['erlangCallToSecond'],'erlangAbandonmentRate':_0x145625['erlangAbandonmentRate'],'erlangBusyFactor':_0x145625[_0x0a63('0x4d')],'startPredictive':_0x145625[_0x0a63('0x4e')],'startProgressive':_0x145625['startProgressive']};if(_0x145625[_0x0a63('0x4f')]){_0x398a16[_0x0a63('0x4f')]={'id':_0x145625[_0x0a63('0x4f')]['id'],'name':_0x145625[_0x0a63('0x4f')][_0x0a63('0x50')],'active':_0x145625['Trunk']['active'],'callerid':_0x145625[_0x0a63('0x4f')][_0x0a63('0x51')]};}if(_0x145625[_0x0a63('0x52')]){_0x398a16[_0x0a63('0x52')]={'id':_0x145625[_0x0a63('0x52')]['id'],'name':_0x145625[_0x0a63('0x52')]['name']};}var _0x307fe2=md5(JSON[_0x0a63('0x53')](_0x398a16));if(_0x145625['md5']!==_0x307fe2){_0x145625[_0x0a63('0x54')]=_0x307fe2;emit(util['format']('voice:queue:%s',_0x398a16[_0x0a63('0x50')]),_0x0a63('0x55'),_0x398a16);}}}function emitVoiceQueueChannelRemove(_0xdc602c){logger['info'](_0x0a63('0x56'),JSON[_0x0a63('0x53')](_0xdc602c));emit(util[_0x0a63('0x57')](_0x0a63('0x58'),_0xdc602c[_0x0a63('0x50')]),_0x0a63('0x59'),_0xdc602c);io[_0x0a63('0x26')]('voice_queue_presence:remove',_0xdc602c);}function notSendMessagesQueue(_0x368454){if(_0x368454[_0x0a63('0x5a')]){if(_0x368454[_0x0a63('0x5b')]===0x0&&_0x368454['pTalking']===0x0){_0x368454['sendMessageOneNotActive']=![];_0x368454[_0x0a63('0x2a')]=0x0;_0x368454['paused']=0x0;_0x368454[_0x0a63('0x5c')]=_0x0a63('0x5d');ut[_0x0a63('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x368454[_0x0a63('0x50')]+_0x0a63('0x5f'));}else{_0x368454[_0x0a63('0x5c')]=_0x0a63('0x60');ut['logger'](_0x0a63('0x61'),_0x368454[_0x0a63('0x50')]+_0x0a63('0x62'));}emitCampaignPreview(_0x368454);}}Preview[_0x0a63('0xd')][_0x0a63('0x25')]=function(){var _0x38cfe4=this;setInterval(function(){_0x38cfe4['syncCampaigns']();},0x7cf);};Preview[_0x0a63('0xd')][_0x0a63('0x63')]=function(){var _0x347a0b=this[_0x0a63('0x64')];this[_0x0a63('0x65')]+=0x1;for(var _0x2482ca in _0x347a0b){if(_0x347a0b[_0x0a63('0x66')](_0x2482ca)&&(_0x347a0b[_0x2482ca][_0x0a63('0x32')]===_0x0a63('0x5')||_0x347a0b[_0x2482ca][_0x0a63('0x32')]===_0x0a63('0x67'))&&_0x347a0b[_0x2482ca][_0x0a63('0x27')]===_0x0a63('0x68')){if(this[_0x0a63('0x65')]>0x7){this[_0x0a63('0x65')]=0x0;this[_0x0a63('0x69')]();}}if(_0x347a0b[_0x0a63('0x66')](_0x2482ca)&&_0x347a0b[_0x2482ca][_0x0a63('0x32')]==='preview'&&_0x347a0b[_0x2482ca][_0x0a63('0x27')]==='outbound'){if(_0x347a0b[_0x2482ca]['dialActive']){this[_0x0a63('0x6a')](_0x347a0b[_0x2482ca]);if(_0x347a0b[_0x2482ca][_0x0a63('0x6b')])this[_0x0a63('0x6c')](_0x347a0b[_0x2482ca]);}else{notSendMessagesQueue(_0x347a0b[_0x2482ca]);}}}};Preview[_0x0a63('0xd')][_0x0a63('0x6d')]=function(_0x9c89ed){var _0x397624=this;this[_0x0a63('0x11')][_0x0a63('0xe')](function(){if(!_[_0x0a63('0x6e')](_0x397624[_0x0a63('0x14')][_0x9c89ed])){loggerAction[_0x0a63('0x6f')](_0x0a63('0x70'),_0x9c89ed,_0x0a63('0x71'),_0x397624[_0x0a63('0x14')][_0x9c89ed][_0x0a63('0x72')],_0x0a63('0x73'),JSON[_0x0a63('0x53')](_0x397624[_0x0a63('0x64')][_0x397624[_0x0a63('0x14')][_0x9c89ed]['queue']][_0x0a63('0x5b')]),_0x0a63('0x74'),JSON['stringify'](_0x397624['campaignsPreview'][_0x397624['actions'][_0x9c89ed]['queue']][_0x0a63('0x2c')]),JSON[_0x0a63('0x53')](_0x397624['actions'][_0x9c89ed][_0x0a63('0x75')]),JSON['stringify'](_[_0x0a63('0x76')](_0x397624[_0x0a63('0x14')][_0x9c89ed],['contactId','UserId','VoiceQueueId',_0x0a63('0x77')])));return ami[_0x0a63('0x78')]({'action':_0x0a63('0x79'),'channel':_0x397624[_0x0a63('0x14')][_0x9c89ed][_0x0a63('0x7a')]})['catch'](function(_0x1d6008){if(_0x1d6008[_0x0a63('0x5c')]===_0x0a63('0x7b')){setTimeout(function(){if(_0x397624[_0x0a63('0x14')][_0x9c89ed]){ut[_0x0a63('0x7c')](_0x397624['campaignsPreview'][_0x397624[_0x0a63('0x14')][_0x9c89ed][_0x0a63('0x72')]],_0x0a63('0x7d'));if(_0x397624[_0x0a63('0x14')][_0x9c89ed]['dialAnswer']===!![]){ut[_0x0a63('0x7e')](_0x397624[_0x0a63('0x64')][_0x397624[_0x0a63('0x14')][_0x9c89ed][_0x0a63('0x72')]],_0x0a63('0x7d'));ut[_0x0a63('0x7f')]('[Dialer][checkChannel][pTalking][Preview]'+_0x9c89ed,_0x397624[_0x0a63('0x14')][_0x9c89ed][_0x0a63('0x72')]);}ut[_0x0a63('0x7f')](_0x0a63('0x80')+_0x9c89ed,_0x397624['actions'][_0x9c89ed]['queue']);delete _0x397624[_0x0a63('0x14')][_0x9c89ed];}},0x2328);}});}});};Preview[_0x0a63('0xd')][_0x0a63('0x69')]=function(){var _0x2f32ae=this;loggerAction[_0x0a63('0x6f')]('[action]',_['size'](this['actions']));for(var _0x42c1bb in this['actions']){if(_0x2f32ae[_0x0a63('0x14')][_0x0a63('0x66')](_0x42c1bb)){_0x2f32ae[_0x0a63('0x6d')](_0x42c1bb);}}};Preview['prototype']['recallMe']=function(_0x2d63c6){var _0x226279=this;rpcDb[_0x0a63('0x81')](_0x2d63c6['id'],ut[_0x0a63('0x82')](this[_0x0a63('0x15')]))[_0x0a63('0x83')](function(_0x21502e){if(!_[_0x0a63('0x6e')](_0x21502e)){for(var _0xe454ef=0x0;_0xe454ef<_0x21502e[_0x0a63('0x84')];_0xe454ef+=0x1){if(ut[_0x0a63('0x85')](_0x21502e[_0xe454ef][_0x0a63('0x86')])<_0x2d63c6[_0x0a63('0x87')]*0x3c){if(_0x21502e[_0xe454ef][_0x0a63('0x88')]&&!_0x21502e[_0xe454ef]['Agent']['voicePause']){_0x226279[_0x0a63('0x89')](_0x21502e[_0xe454ef]['id'])[_0x0a63('0x83')](ut['logger2'](_0x0a63('0x8a')))[_0x0a63('0x8b')](ut['logger2'](_0x0a63('0x8a')));}else{rpcDb[_0x0a63('0x8c')](_0x21502e[_0xe454ef]['id']);}}else{var _0x5e5495=new Action(_0x21502e[_0xe454ef],_0x2d63c6);_0x5e5495['starttime']=moment()[_0x0a63('0x57')](_0x0a63('0x8d'));_0x2d63c6[_0x0a63('0x8e')]+=0x1;ut['logCustomer'](_0x5e5495,0x17,_0x0a63('0x8f'));if(_0x2d63c6[_0x0a63('0x90')]){rpcDb[_0x0a63('0x91')](ut[_0x0a63('0x92')](_0x21502e[_0xe454ef]));rpcDb[_0x0a63('0x93')](_0x5e5495,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x0a63('0x94')](_0x5e5495,0x16,_0x0a63('0x95'));rpcDb[_0x0a63('0x93')](_0x5e5495,_0x0a63('0x96'));rpcDb[_0x0a63('0x97')](_0x5e5495,_0x0a63('0x96'));}}}}})[_0x0a63('0x8b')](ut['logger2'](_0x0a63('0x98')));};Preview[_0x0a63('0xd')][_0x0a63('0x6a')]=function(_0x1155f1){_0x1155f1[_0x0a63('0x5a')]=!![];if(ut[_0x0a63('0x99')](_0x1155f1[_0x0a63('0x2b')])){_0x1155f1[_0x0a63('0x5c')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x1155f1[_0x0a63('0x31')])){_0x1155f1[_0x0a63('0x5c')]=_0x0a63('0x5d');}else if(!this[_0x0a63('0x9a')](_0x1155f1[_0x0a63('0x4f')])){if(!this['isTrunkReachable'](_0x1155f1[_0x0a63('0x9b')])){_0x1155f1[_0x0a63('0x5c')]=_0x0a63('0x9c');}else{_0x1155f1[_0x0a63('0x5c')]=_0x0a63('0x9d');}}else{_0x1155f1[_0x0a63('0x5c')]=_0x0a63('0x9d');}emitCampaignPreview(_0x1155f1);};Preview[_0x0a63('0xd')][_0x0a63('0x9e')]=function(_0x35083d,_0x4acde8,_0x485969){var _0x25276f=this;var _0x5f33b2=this[_0x0a63('0x14')][_0x4acde8];var _0x34d88a=this['campaignsPreview'][_0x5f33b2['queue']];var _0x480acb;if(_0x34d88a){switch(_0x485969){case'1':_0x34d88a[_0x0a63('0x3e')]+=0x1;_0x5f33b2[_0x0a63('0x9f')]+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut[_0x0a63('0x94')](_0x5f33b2,0x0,_0x0a63('0xa2'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x5f33b2,_0x0a63('0xa3')));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xa4'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a['dialGlobalMaxRetry']){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,'Global');rpcDb['createCustomerFinal'](_0x480acb,_0x0a63('0xa6'));}else{if(_0x5f33b2['countnosuchnumberretry']>=_0x34d88a[_0x0a63('0xa7')]){rpcDb[_0x0a63('0x97')](_0x5f33b2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x0a63('0xa8')](ut['scheduledAt'](_0x5f33b2,_0x0a63('0x9f'),_0x34d88a['dialNoSuchNumberRetryFrequency']),_0x5f33b2[_0x0a63('0xa9')],_0x5f33b2[_0x0a63('0xaa')]);}}delete this[_0x0a63('0x14')][_0x35083d['linkedid']];break;case _0x0a63('0xab'):var _0x2df35e=moment()[_0x0a63('0x57')](_0x0a63('0x8d'));_0x5f33b2[_0x0a63('0xac')]=_0x2df35e;_0x5f33b2['answertime']=_0x2df35e;_0x5f33b2['dialAnswer']=!![];_0x34d88a['pTalking']+=0x1;logger[_0x0a63('0x6f')]('[syncHangup][talking][increment]',_0x5f33b2[_0x0a63('0xad')],_0x0a63('0xae'),_0x34d88a[_0x0a63('0x50')],_0x0a63('0x74'),_0x34d88a['pTalking']);ami[_0x0a63('0x26')](_0x0a63('0xaf'),ut['buildObj'](_0x5f33b2,_0x0a63('0xb0'),this[_0x0a63('0x64')][_0x5f33b2[_0x0a63('0x72')]]));if(_0x34d88a[_0x0a63('0xb1')]){ami[_0x0a63('0x26')]('custom:agentConnectPreview',ut[_0x0a63('0xb2')](_0x5f33b2));}break;case'16':ami[_0x0a63('0x26')](_0x0a63('0xb3'),ut['buildObj'](_0x5f33b2,'complete',this['campaignsPreview'][_0x5f33b2[_0x0a63('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x0a63('0xb4')](_0x5f33b2,_0x0a63('0xb5')));_0x34d88a[_0x0a63('0x37')]+=0x1;_0x34d88a[_0x0a63('0xb6')]+=0x1;_0x34d88a[_0x0a63('0x29')]+=0x1;ut[_0x0a63('0x7e')](_0x34d88a,_0x0a63('0xb7'));_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut['logCustomer'](_0x5f33b2,0x4,_0x0a63('0xb8'));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xb9'));rpcDb[_0x0a63('0x97')](_0x5f33b2,_0x0a63('0xba'));rpcDb[_0x0a63('0xbb')](_0x5f33b2);_0x34d88a['sumDuration']+=_0x5f33b2['talktime'];_0x34d88a[_0x0a63('0x2d')]+=_0x5f33b2[_0x0a63('0xbc')];logger[_0x0a63('0x6f')](_0x0a63('0xbd'),_0x5f33b2['uniqueid'],_0x0a63('0xae'),_0x34d88a['name'],_0x0a63('0x74'),_0x34d88a[_0x0a63('0x2c')]);delete this[_0x0a63('0x14')][_0x35083d[_0x0a63('0xbe')]];break;case'BUSY':_0x34d88a[_0x0a63('0x38')]+=0x1;_0x5f33b2[_0x0a63('0xbf')]+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut['logCustomer'](_0x5f33b2,0x5,'Busy');ami[_0x0a63('0x26')]('custom:agentbusy',ut[_0x0a63('0xb4')](_0x5f33b2,_0x0a63('0xc0')));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xc1'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a['dialGlobalMaxRetry']){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb[_0x0a63('0x97')](_0x480acb,_0x0a63('0xc3'));}else{if(_0x5f33b2[_0x0a63('0xbf')]>=_0x34d88a[_0x0a63('0xc4')]){rpcDb[_0x0a63('0x97')](_0x5f33b2,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a63('0xa8')](ut[_0x0a63('0xc5')](_0x5f33b2,_0x0a63('0xbf'),_0x34d88a[_0x0a63('0xc6')]),_0x5f33b2['unlockAgent'],_0x5f33b2[_0x0a63('0xaa')]);}}break;case _0x0a63('0xc7'):_0x34d88a[_0x0a63('0x3d')]+=0x1;_0x5f33b2['countnoanswerretry']+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut[_0x0a63('0x94')](_0x5f33b2,0x3,'NoAnswer');ami[_0x0a63('0x26')](_0x0a63('0xc8'),ut[_0x0a63('0xb4')](_0x5f33b2,_0x0a63('0xc9')));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xca'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb[_0x0a63('0x97')](_0x480acb,_0x0a63('0xcc'));}else{if(_0x5f33b2[_0x0a63('0xcd')]>=_0x34d88a[_0x0a63('0xce')]){rpcDb[_0x0a63('0x97')](_0x5f33b2,_0x0a63('0xca'));}else{rpcDb['rescheduleContact'](ut[_0x0a63('0xc5')](_0x5f33b2,'countnoanswerretry',_0x34d88a[_0x0a63('0xcf')]),_0x5f33b2[_0x0a63('0xa9')],_0x5f33b2['activeContact']);}}break;case _0x0a63('0xd0'):_0x34d88a[_0x0a63('0x39')]+=0x1;_0x5f33b2[_0x0a63('0xd1')]+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut[_0x0a63('0x94')](_0x5f33b2,0x8,_0x0a63('0xd2'));ami[_0x0a63('0x26')](_0x0a63('0xd3'),ut['buildObj'](_0x5f33b2,_0x0a63('0xd4')));rpcDb['createCustomerHistory'](_0x5f33b2,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb['createCustomerFinal'](_0x480acb,_0x0a63('0xd5'));}else{if(_0x5f33b2['countcongestionretry']>=_0x34d88a['dialCongestionMaxRetry']){rpcDb[_0x0a63('0x97')](_0x5f33b2,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x0a63('0xc5')](_0x5f33b2,_0x0a63('0xd1'),_0x34d88a[_0x0a63('0xc6')]),_0x5f33b2[_0x0a63('0xa9')],_0x5f33b2['activeContact']);}}break;case _0x0a63('0xd6'):_0x34d88a['outboundRejectCallsDay']+=0x1;_0x5f33b2[_0x0a63('0xd7')]+=0x1;_0x5f33b2['countglobal']=ut[_0x0a63('0xa1')](_0x5f33b2);ut['logCustomer'](_0x5f33b2,0x14,_0x0a63('0xd8'));ami[_0x0a63('0x26')](_0x0a63('0xd9'),ut[_0x0a63('0xb4')](_0x5f33b2,_0x0a63('0xda')));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xdb'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut['cloneAction'](_0x5f33b2,0x14,_0x0a63('0xd8'));rpcDb['createCustomerFinal'](_0x480acb,_0x0a63('0xdc'));}else{if(_0x5f33b2[_0x0a63('0xd7')]>=_0x34d88a[_0x0a63('0xdd')]){rpcDb[_0x0a63('0x97')](_0x5f33b2,_0x0a63('0xdc'));}else{rpcDb['rescheduleContact'](ut[_0x0a63('0xc5')](_0x5f33b2,_0x0a63('0xd7'),_0x34d88a[_0x0a63('0xde')]),_0x5f33b2[_0x0a63('0xa9')],_0x5f33b2['activeContact']);}}break;case _0x0a63('0xdf'):_0x34d88a[_0x0a63('0x41')]+=0x1;_0x5f33b2['countabandonedretry']+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut['logCustomer'](_0x5f33b2,0xb,_0x0a63('0xe0'));rpcDb[_0x0a63('0x93')](_0x5f33b2,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb[_0x0a63('0x97')](_0x480acb,_0x0a63('0xe1'));}else{if(_0x5f33b2[_0x0a63('0xe2')]>=_0x34d88a[_0x0a63('0xe3')]){rpcDb['createCustomerFinal'](_0x5f33b2,_0x0a63('0xe1'));}else{rpcDb[_0x0a63('0xa8')](ut['scheduledAt'](_0x5f33b2,_0x0a63('0xe4'),_0x34d88a[_0x0a63('0xe5')]),_0x5f33b2[_0x0a63('0xa9')],_0x5f33b2[_0x0a63('0xaa')]);}}break;case'18':_0x34d88a[_0x0a63('0xe6')]+=0x1;_0x5f33b2['countmachineretry']+=0x1;_0x5f33b2['countglobal']=ut[_0x0a63('0xa1')](_0x5f33b2);ut[_0x0a63('0x94')](_0x5f33b2,0x12,_0x35083d[_0x0a63('0xe7')]||_0x35083d['dialstatus']);ami['emit'](_0x0a63('0xe8'),ut['buildObj'](_0x5f33b2,'amd'));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xe9'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut['cloneAction'](_0x5f33b2,0xf,'Global');rpcDb[_0x0a63('0x97')](_0x480acb,_0x0a63('0xe9'));}else{rpcDb['createCustomerFinal'](_0x5f33b2,_0x0a63('0xe9'));}delete this[_0x0a63('0x14')][_0x35083d[_0x0a63('0xbe')]];break;case'19':_0x34d88a['outboundUnknownCallsDay']+=0x1;_0x5f33b2[_0x0a63('0xa0')]=ut[_0x0a63('0xa1')](_0x5f33b2);ut['logCustomer'](_0x5f33b2,0x13,_0x35083d[_0x0a63('0xe7')]||_0x35083d[_0x0a63('0xea')]);ami[_0x0a63('0x26')](_0x0a63('0xe8'),ut[_0x0a63('0xb4')](_0x5f33b2,_0x0a63('0xeb')));rpcDb[_0x0a63('0x93')](_0x5f33b2,_0x0a63('0xec'));if(ut[_0x0a63('0xa1')](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut[_0x0a63('0xa5')](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb[_0x0a63('0x97')](_0x480acb,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x0a63('0x97')](_0x5f33b2,_0x0a63('0xec'));}delete this[_0x0a63('0x14')][_0x35083d[_0x0a63('0xbe')]];break;default:if(_0x5f33b2[_0x0a63('0x75')]){ut['decrementTalkink'](_0x34d88a,_0x0a63('0xed'));ut['loggerError'](_0x0a63('0xee')+_0x34d88a['name'],_0x35083d);}_0x34d88a['outboundUnknownCallsDay']+=0x1;_0x5f33b2['countglobal']=ut[_0x0a63('0xa1')](_0x5f33b2);ut[_0x0a63('0x94')](_0x5f33b2,0xc,_0x35083d['cause-txt']||_0x35083d[_0x0a63('0xea')]);rpcDb['createCustomerHistory'](_0x5f33b2,_0x0a63('0xef'));if(ut['totalGlobal'](_0x5f33b2)>=_0x34d88a[_0x0a63('0xcb')]){_0x480acb=ut['cloneAction'](_0x5f33b2,0xf,_0x0a63('0xc2'));rpcDb[_0x0a63('0x97')](_0x480acb,_0x0a63('0xf0'));}else{rpcDb[_0x0a63('0x97')](_0x5f33b2,_0x0a63('0xf0'));}delete this[_0x0a63('0x14')][_0x35083d[_0x0a63('0xbe')]];}if(!(_0x5f33b2['dialAnswer']&&_0x485969==='16')){ut['updateOriginated'](_0x34d88a,_0x0a63('0xf1'));logger[_0x0a63('0x6f')](_0x0a63('0xf2'),_0x5f33b2[_0x0a63('0xad')],_0x0a63('0xae'),_0x34d88a['name'],_0x0a63('0x73'),_0x34d88a['originated']);}if(_0x485969!==_0x0a63('0xab')){delete this[_0x0a63('0x14')][_0x35083d[_0x0a63('0xbe')]];delete this['actions'][_0x35083d[_0x0a63('0xf3')]];}}};Preview['prototype'][_0x0a63('0xf4')]=function(_0x427188,_0x12a8cd,_0x4d6476){if(_[_0x0a63('0xf5')](_0x12a8cd)&&_0x0a63('0xf6')!==typeof _0x12a8cd){return;}if(_[_0x0a63('0xf5')](_0x4d6476)&&_0x0a63('0xf6')!==typeof _0x4d6476){return;}switch(_0x4d6476[_0x0a63('0xf7')]){case'0':ut[_0x0a63('0xf8')](_0x427188,0x0,'NoSuchNumber');rpcDb[_0x0a63('0xf9')](_0x427188,_0x0a63('0xfa'));break;case'3':ut[_0x0a63('0xf8')](_0x427188,0x3,'NoAnswer');rpcDb[_0x0a63('0xf9')](_0x427188,_0x0a63('0xfb'));break;case'5':ut['logAgent'](_0x427188,0x5,_0x0a63('0xfc'));rpcDb[_0x0a63('0xf9')](_0x427188,_0x0a63('0xfd'));break;case'8':ut[_0x0a63('0xf8')](_0x427188,0x8,_0x0a63('0xd2'));rpcDb[_0x0a63('0xf9')](_0x427188,_0x0a63('0xfe'));break;case'22':ut[_0x0a63('0xf8')](_0x427188,0x16,'AnswerAGI');rpcDb[_0x0a63('0xf9')](_0x427188,_0x0a63('0xff'));break;default:ut[_0x0a63('0xf8')](_0x427188,0xc,_0x4d6476[_0x0a63('0xf7')]);rpcDb[_0x0a63('0xf9')](_0x427188,'[callProgressDetectingAgent][logCongestion]');}ut[_0x0a63('0x7c')](_0x12a8cd,_0x0a63('0x100'));logger[_0x0a63('0x6f')](_0x0a63('0x101'),_0x427188[_0x0a63('0xad')],_0x0a63('0xae'),_0x12a8cd['name'],'originated:\x20',_0x12a8cd[_0x0a63('0x5b')]);delete this['actions'][_0x427188['uniqueid']];};Preview[_0x0a63('0xd')][_0x0a63('0x102')]=function(_0x49e374,_0x2d6918,_0x85bc7d,_0x2827ba,_0x1e6ce9){var _0x2f3999=this;return new BPromise(function(_0x2d9cca,_0x2fac62){if(_[_0x0a63('0x6e')](_0x2d6918)||_[_0x0a63('0x6e')](_0x2d6918[_0x0a63('0x103')])||_['isNil'](_0x2d6918[_0x0a63('0x103')][_0x0a63('0x104')])||_[_0x0a63('0x6e')](_0x2d6918[_0x0a63('0x105')])){_0x2fac62(ut['message'](_0x0a63('0x106'),_0x2827ba,_0x1e6ce9));return;}var _0x35becd=uuid['v4']();var _0x5d98e2=_0x2f3999[_0x0a63('0x64')][_0x2d6918[_0x0a63('0x71')][_0x0a63('0x50')]];var _0x495c5e=_0x85bc7d?_0x2f3999[_0x0a63('0x15')][_0x85bc7d]['id']:undefined;_0x2f3999[_0x0a63('0x14')][_0x35becd]=new Action(_0x2d6918,_0x5d98e2,_0x35becd,_0x85bc7d,_0x495c5e);var _0x304326=_0x2f3999[_0x0a63('0x14')][_0x35becd];_0x304326[_0x0a63('0xa9')]=_0x2827ba;_0x304326[_0x0a63('0xaa')]=_0x1e6ce9;_0x304326['lookAgent']=_0x85bc7d;if(_[_0x0a63('0x107')](_0x49e374)){_0x2f3999[_0x0a63('0x108')](_0x304326,_0x5d98e2,_0x2d6918,_0x85bc7d)[_0x0a63('0x83')](function(_0x2dc71a){logger[_0x0a63('0x6f')](_0x0a63('0x109'),'Queue:\x20'+_0x304326[_0x0a63('0x72')]+_0x0a63('0x10a')+_0x304326[_0x0a63('0x10b')],JSON['stringify'](_0x2dc71a));ami[_0x0a63('0x26')](_0x0a63('0x10c'),ut[_0x0a63('0xb4')](_0x304326,_0x0a63('0x10d'),_0x2f3999['campaignsPreview'][_0x304326[_0x0a63('0x72')]]));_0x2d9cca(ut[_0x0a63('0x5c')]('Calling'));})[_0x0a63('0x8b')](function(_0x36114e){ut[_0x0a63('0x5e')]('[Preview][execCall][failure]',_0x36114e);_0x2fac62(ut[_0x0a63('0x5c')](_0x0a63('0x10e'),_0x2827ba,_0x1e6ce9));});}else{_0x5d98e2[_0x0a63('0x10f')]+=0x1;ut[_0x0a63('0x110')](_0x304326);rpcDb['createHistory'](_0x304326,_0x0a63('0x111'));delete _0x2f3999['actions'][_0x35becd];_0x2fac62(ut[_0x0a63('0x5c')](_0x0a63('0x112'),_0x2827ba,_0x1e6ce9));}});};Preview[_0x0a63('0xd')]['isTrunkReachable']=function(_0x34de1c){return!_['isNil'](_0x34de1c)&&!_['isNil'](_0x34de1c[_0x0a63('0x50')])&&!_['isNil'](_0x34de1c[_0x0a63('0x113')])&&_0x34de1c[_0x0a63('0x113')]&&!_[_0x0a63('0x6e')](this[_0x0a63('0x13')][util[_0x0a63('0x57')](_0x0a63('0x114'),_0x34de1c['name'])])&&!_[_0x0a63('0x6e')](this[_0x0a63('0x13')][util[_0x0a63('0x57')](_0x0a63('0x114'),_0x34de1c[_0x0a63('0x50')])][_0x0a63('0x79')])&&(this[_0x0a63('0x13')][util[_0x0a63('0x57')](_0x0a63('0x114'),_0x34de1c[_0x0a63('0x50')])][_0x0a63('0x79')]===_0x0a63('0x115')||this[_0x0a63('0x13')][util[_0x0a63('0x57')](_0x0a63('0x114'),_0x34de1c[_0x0a63('0x50')])][_0x0a63('0x79')]===_0x0a63('0x116'));};Preview[_0x0a63('0xd')][_0x0a63('0x89')]=function(_0x5df424,_0x136618){var _0x590930=this;return new BPromise(function(_0x78b19f,_0x490556){_0x590930[_0x0a63('0x117')](_0x5df424,_0x136618)[_0x0a63('0x83')](function(_0x1f4881){_0x78b19f(_['pick'](_0x1f4881,['message']));})[_0x0a63('0x8b')](function(_0x526f8f){if(_0x526f8f[_0x0a63('0x118')]){rpcDb[_0x0a63('0x119')](_0x5df424);}if(_0x526f8f[_0x0a63('0x113')]){rpcDb['disableContact'](_0x5df424);}_0x490556(_[_0x0a63('0x76')](_0x526f8f,['message']));});});};Preview[_0x0a63('0xd')][_0x0a63('0x117')]=function(_0x135fc4,_0x279a38){var _0x53e677=this;return new BPromise(function(_0x372bf7,_0x4ff767){var _0xa3cfd5,_0x3f1428;rpcDb[_0x0a63('0x11a')](_0x135fc4)[_0x0a63('0x83')](function(_0x2e6dd3){if(!_[_0x0a63('0x6e')](_0x2e6dd3[0x0])){_0x3f1428=_0x2e6dd3[0x0][_0x0a63('0x11b')]?![]:!![];_0xa3cfd5=_0x2e6dd3[0x0][_0x0a63('0x11b')]?!![]:![];_0xa3cfd5=_0x279a38?!![]:_0xa3cfd5;}var _0xf94da0=_0x53e677[_0x0a63('0x11c')](_0x2e6dd3);if(_0xf94da0['isValid']){rpcDb[_0x0a63('0x11d')](_[_0x0a63('0x76')](_0x2e6dd3[0x0],['VoiceQueueId',_0x0a63('0x11e')]))['then'](function(_0x670e91){_0x53e677[_0x0a63('0x102')](_0x670e91,_0x2e6dd3[0x0],_0x279a38,_0x3f1428,_0xa3cfd5)[_0x0a63('0x83')](function(_0x4fa910){_0x372bf7(_0x4fa910);})[_0x0a63('0x8b')](function(_0x1f9ca6){_0x4ff767(_0x1f9ca6);});})[_0x0a63('0x8b')](function(_0xfd34d4){ut[_0x0a63('0x5e')]('[Preview][checkIsBlackList]',_0xfd34d4);_0x4ff767(ut['message'](_0x0a63('0x11f'),_0x3f1428,_0xa3cfd5));});}else{_0x4ff767(ut[_0x0a63('0x5c')](_0xf94da0[_0x0a63('0x5c')],_0x3f1428,_0xa3cfd5));}})['catch'](function(_0x2ca8a9){ut[_0x0a63('0x5e')](_0x0a63('0x120'),_0x2ca8a9);_0x4ff767(ut[_0x0a63('0x5c')](_0x0a63('0x11f'),![],!![]));});});};Preview[_0x0a63('0xd')][_0x0a63('0x11c')]=function(_0x584cbc){if(_[_0x0a63('0x6e')](_0x584cbc)||_[_0x0a63('0x107')](_0x584cbc)||!_['isNil'](_0x584cbc[0x0]['Agent'])&&_[_0x0a63('0x6e')](_0x584cbc[0x0][_0x0a63('0x88')][_0x0a63('0x50')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x584cbc);return{'isValid':![],'message':_0x0a63('0x121')};}var _0x2d40a2=this[_0x0a63('0x64')][_0x584cbc[0x0]['Queue']['name']];_0x2d40a2[_0x0a63('0x5c')]=_0x0a63('0x9d');if(_[_0x0a63('0x6e')](_0x2d40a2)){ut['logger'](_0x0a63('0x122'),_0x2d40a2);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x0a63('0x9a')](_0x2d40a2[_0x0a63('0x4f')])){ut['logger'](_0x0a63('0x123'),_0x0a63('0x124')+_0x2d40a2[_0x0a63('0x50')]+_0x0a63('0x125'));if(!this[_0x0a63('0x9a')](_0x2d40a2['TrunkBackup'])){ut[_0x0a63('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2d40a2[_0x0a63('0x50')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x0a63('0x126')};}}if(!ut[_0x0a63('0x127')](_0x2d40a2[_0x0a63('0x31')])){ut[_0x0a63('0x5e')](_0x0a63('0x128'),_0x2d40a2[_0x0a63('0x50')]+_0x0a63('0x129'));return{'isValid':![],'message':_0x0a63('0x124')+_0x2d40a2[_0x0a63('0x50')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0a63('0x12a')};};Preview[_0x0a63('0xd')]['execCall']=function(_0x276050,_0x2ffef0,_0x63755e,_0xf9a532){var _0x547032=this;return new BPromise(function(_0x392c07,_0x523a7e){var _0x58fc99=_0x276050[_0x0a63('0xad')];var _0x38f1d7=_0x547032[_0x0a63('0x9a')](_0x2ffef0[_0x0a63('0x4f')])?util[_0x0a63('0x57')](_0x0a63('0x12b'),_0x2ffef0['Trunk'][_0x0a63('0x50')],_[_0x0a63('0x6e')](_0x2ffef0[_0x0a63('0x35')])?'':_0x2ffef0[_0x0a63('0x35')][_0x0a63('0x12c')]()||'',_0x2ffef0['dialCutDigit']>0x0?_0x63755e[_0x0a63('0x103')][_0x0a63('0x104')][_0x0a63('0x12d')](_0x2ffef0[_0x0a63('0x12e')]):_0x63755e['Contact'][_0x0a63('0x104')]):util['format'](_0x0a63('0x12b'),_['isNil'](_0x2ffef0[_0x0a63('0x9b')])?_0x2ffef0[_0x0a63('0x4f')][_0x0a63('0x50')]:_0x2ffef0['TrunkBackup'][_0x0a63('0x50')],_[_0x0a63('0x6e')](_0x2ffef0[_0x0a63('0x35')])?'':_0x2ffef0['dialPrefix'][_0x0a63('0x12c')]()||'',_0x2ffef0[_0x0a63('0x12e')]>0x0?_0x63755e[_0x0a63('0x103')][_0x0a63('0x104')][_0x0a63('0x12d')](_0x2ffef0[_0x0a63('0x12e')]):_0x63755e[_0x0a63('0x103')][_0x0a63('0x104')]);var _0x1251df=_0x547032[_0x0a63('0x9a')](_0x2ffef0[_0x0a63('0x4f')])?ut['getCallerId'](_0x2ffef0[_0x0a63('0x4f')][_0x0a63('0x51')],_0x2ffef0['dialOriginateCallerIdName'],_0x2ffef0[_0x0a63('0x12f')]>0x0?ut['getCallerIdRandom'](_0x2ffef0[_0x0a63('0x34')],_0x2ffef0[_0x0a63('0x12f')]):_0x2ffef0[_0x0a63('0x34')]):ut[_0x0a63('0x130')](_[_0x0a63('0x6e')](_0x2ffef0[_0x0a63('0x9b')])?_0x2ffef0[_0x0a63('0x4f')][_0x0a63('0x51')]:_0x2ffef0[_0x0a63('0x9b')]['callerid'],_0x2ffef0[_0x0a63('0x33')],_0x2ffef0[_0x0a63('0x12f')]>0x0?ut[_0x0a63('0x131')](_0x2ffef0[_0x0a63('0x34')],_0x2ffef0[_0x0a63('0x12f')]):_0x2ffef0[_0x0a63('0x34')]);if(_0x1251df){_0x276050[_0x0a63('0x132')]=ut[_0x0a63('0x133')](_0x1251df);_0x276050['originatecalleridnum']=ut[_0x0a63('0x134')](_0x1251df);}var _0x28e34e=ut['addVariables'](_0x2ffef0,_0x63755e,_0x38f1d7,_0x1251df,_0x58fc99,_0x276050);_[_0x0a63('0x135')](_0x276050,ut[_0x0a63('0x136')](_0x28e34e));_0x276050['starttime']=moment()[_0x0a63('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut['variablesAction'](_0x276050,_0x2ffef0,_0x28e34e,_0x276050[_0x0a63('0xaa')],_0xf9a532))[_0x0a63('0x83')](function(_0xfe9f3d){_0x2ffef0['originated']+=0x1;logger['info'](_0x0a63('0x137'),_0x58fc99,_0x0a63('0xae'),_0x2ffef0[_0x0a63('0x50')],_0x0a63('0x73'),_0x2ffef0['originated']);_0x392c07(_0xfe9f3d);})[_0x0a63('0x8b')](function(_0x340389){ut[_0x0a63('0xf8')](_0x276050,0xe,'OriginateError');rpcDb[_0x0a63('0xf9')](_0x276050,'[originateFailure][logOriginateFailure]');_0x523a7e(_0x340389);});});};Preview[_0x0a63('0xd')][_0x0a63('0x1f')]=function(_0x5d7b3d){if(this['actions'][_0x5d7b3d[_0x0a63('0xbe')]]){this[_0x0a63('0x14')][_0x5d7b3d['linkedid']][_0x0a63('0x7a')]=_0x5d7b3d[_0x0a63('0x7a')];}};Preview[_0x0a63('0xd')][_0x0a63('0x17')]=function(_0x1db9db){var _0x434e20=this;var _0x52b861=this[_0x0a63('0x14')][_0x1db9db[_0x0a63('0x138')]];if(_0x52b861){if(_0x52b861[_0x0a63('0x139')]&&this[_0x0a63('0x15')][_0x52b861[_0x0a63('0x139')]]){ut[_0x0a63('0x13a')](_0x52b861,this[_0x0a63('0x15')][_0x52b861[_0x0a63('0x139')]][_0x0a63('0x50')],this['agents'][_0x52b861[_0x0a63('0x139')]]['id']);}var _0x52c170=_[_0x0a63('0x13b')](_0x52b861);_0x52c170[_0x0a63('0xac')]=moment()['format'](_0x0a63('0x8d'));var _0x578422=_0x434e20[_0x0a63('0x64')][_0x52b861['queue']];if(ut[_0x0a63('0x13c')](_0x1db9db[_0x0a63('0x13d')])){if(_0x52b861['unlockAgent']){rpcDb['unlockContact'](_0x52b861[_0x0a63('0x10b')]);}if(_0x52b861['activeContact']){rpcDb[_0x0a63('0x8c')](_0x52b861['idContact']);}ami[_0x0a63('0x26')](_0x0a63('0x13e'),ut[_0x0a63('0xb4')](_0x52b861,_0x0a63('0x13f'),this[_0x0a63('0x64')][_0x52b861['queue']]));this['callProgressDetectingAgent'](_0x52c170,_0x578422,_0x1db9db);}else{_0x52b861[_0x0a63('0x140')]=moment()[_0x0a63('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x0a63('0xf8')](_0x52c170,0x4,'Answer');rpcDb['createAgentHistory'](_0x52c170,_0x0a63('0x141'));}}};Preview[_0x0a63('0xd')]['syncHangup']=function(_0x1f6d7d){var _0x49a5bc=this;var _0x47095b=this[_0x0a63('0x14')][_0x1f6d7d[_0x0a63('0xbe')]];var _0x587823;if(_0x47095b){_0x587823=this[_0x0a63('0x64')][_0x47095b[_0x0a63('0x72')]];logger['info'](_0x0a63('0x142'),_0x1f6d7d[_0x0a63('0xbe')],_0x0a63('0xae'),_0x587823[_0x0a63('0x50')],_0x0a63('0x74'),_0x587823[_0x0a63('0x2c')]);}if(this[_0x0a63('0x14')][_0x1f6d7d[_0x0a63('0xbe')]]&&_0x1f6d7d[_0x0a63('0xbe')]!==_0x1f6d7d['uniqueid']){if(_0x1f6d7d[_0x0a63('0x143')]==='16'&&this[_0x0a63('0x14')][_0x1f6d7d['linkedid']][_0x0a63('0x75')]){this[_0x0a63('0x9e')](_0x1f6d7d,_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d[_0x0a63('0x143')]);}else if(this['actions'][_0x1f6d7d['linkedid']][_0x0a63('0x75')]){logger['info'](_0x0a63('0x144'),_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d['cause'],_0x0a63('0xae'),_0x587823[_0x0a63('0x50')],'pTalking:\x20',_0x587823[_0x0a63('0x2c')]);this[_0x0a63('0x9e')](_0x1f6d7d,_0x1f6d7d['linkedid'],_0x1f6d7d[_0x0a63('0x143')]);}}else if(_0x47095b&&_[_0x0a63('0x6e')](_0x47095b[_0x0a63('0x145')])&&_0x587823[_0x0a63('0x146')]&&_0x1f6d7d[_0x0a63('0xbe')]===_0x1f6d7d[_0x0a63('0xad')]&&_[_0x0a63('0x6e')](_0x1f6d7d[_0x0a63('0xf7')])&&_0x1f6d7d[_0x0a63('0x143')]==='16'&&_0x1f6d7d[_0x0a63('0x147')]==='6'&&_[_0x0a63('0xf5')](_0x47095b[_0x0a63('0x148')])){if(_0x47095b[_0x0a63('0xa9')]){rpcDb['unlockContact'](_0x47095b[_0x0a63('0x10b')]);}if(_0x47095b[_0x0a63('0xaa')]){rpcDb[_0x0a63('0x8c')](_0x47095b[_0x0a63('0x10b')]);}_0x1f6d7d[_0x0a63('0xf7')]='22';this[_0x0a63('0xf4')](_0x47095b,_0x587823,_0x1f6d7d);}else if(_0x47095b&&_0x47095b[_0x0a63('0x148')]){if(_0x1f6d7d[_0x0a63('0x143')]==='16'&&this[_0x0a63('0x14')][_0x1f6d7d['linkedid']][_0x0a63('0x75')]){logger[_0x0a63('0x6f')](_0x0a63('0x149'),_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d['cause'],_0x0a63('0xae'),_0x587823[_0x0a63('0x50')],'pTalking:\x20',_0x587823['pTalking']);this['callProgressDetectingCustomer'](_0x1f6d7d,_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d[_0x0a63('0x143')]);}else if(this[_0x0a63('0x14')][_0x1f6d7d[_0x0a63('0xbe')]][_0x0a63('0x75')]){logger['info'](_0x0a63('0x144'),_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d[_0x0a63('0x143')],_0x0a63('0xae'),_0x587823[_0x0a63('0x50')],'pTalking:\x20',_0x587823[_0x0a63('0x2c')]);this[_0x0a63('0x9e')](_0x1f6d7d,_0x1f6d7d[_0x0a63('0xbe')],_0x1f6d7d['cause']);}}};Preview['prototype'][_0x0a63('0x14a')]=function(_0x39db5f){if(this[_0x0a63('0x14')][_0x39db5f[_0x0a63('0xf3')]]&&_0x39db5f[_0x0a63('0xf3')]!==_0x39db5f['destuniqueid']){this[_0x0a63('0x9e')](_0x39db5f,_0x39db5f[_0x0a63('0xf3')],_0x39db5f[_0x0a63('0xea')]);}};Preview[_0x0a63('0xd')][_0x0a63('0x1c')]=function(_0x5d48bd){if(this[_0x0a63('0x14')][_0x5d48bd[_0x0a63('0xbe')]]&&_0x5d48bd[_0x0a63('0xbe')]!==_0x5d48bd['uniqueid']&&!this['actions'][_0x5d48bd[_0x0a63('0xbe')]][_0x0a63('0x75')]){if(_0x5d48bd[_0x0a63('0x143')]==='1'){this[_0x0a63('0x9e')](_0x5d48bd,_0x5d48bd[_0x0a63('0xbe')],_0x5d48bd['cause']);}}};Preview['prototype']['addVariable']=function(_0x399edb,_0x50478c,_0x31db12){if(this[_0x0a63('0x14')][_0x399edb]){if(_['isNil'](this['actions'][_0x399edb][_0x0a63('0x14b')])){this[_0x0a63('0x14')][_0x399edb]['variables']={};}this[_0x0a63('0x14')][_0x399edb][_0x0a63('0x14b')][_0x50478c]=_0x31db12;}};Preview[_0x0a63('0xd')]['syncVarSet']=function(_0x52f729){try{if(!_['isNil'](_0x52f729)){if(ut['filterKey'](_[_0x0a63('0x14c')](_0x52f729[_0x0a63('0x14d')])[0x0])){this[_0x0a63('0x14e')](_0x52f729[_0x0a63('0xad')],_[_0x0a63('0x14c')](_0x52f729[_0x0a63('0x14d')])[0x0],_0x52f729['value']);}}}catch(_0x37fa44){logger[_0x0a63('0x14f')](_0x0a63('0x150'),util[_0x0a63('0x151')](_0x37fa44,{'showHidden':![],'depth':null}));}};Preview[_0x0a63('0xd')][_0x0a63('0x23')]=function(_0x1f12af){if(_0x1f12af){if(this[_0x0a63('0x14')][_0x1f12af[_0x0a63('0x152')]]){this['actions'][_0x1f12af[_0x0a63('0x152')]]['transfer']=!![];}}};Preview['prototype'][_0x0a63('0x153')]=function(_0x5b110b){if(_0x5b110b){if(this[_0x0a63('0x14')][_0x5b110b['transfererlinkedid']]){this['actions'][_0x5b110b[_0x0a63('0x154')]][_0x0a63('0x148')]=!![];}}};module[_0x0a63('0x155')]=Preview; \ No newline at end of file +var _0x84e7=['answered','available','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','outbound','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','Queue','originated:\x20','queue','pTalking:\x20','UserId','VoiceQueueId','ListId','Action','channel','catch','message','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','loggedIn','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','createCustomerHistory','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','emit','custom:agentconnect','buildObj','connect','acw','custom:agentcomplete','complete','outboundAnswerCallsDay','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','custom:agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','dialAnswer','updateOriginated','destlinkedid','isUndefined','object','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','idContact','called','[Preview][execCall][failure]','logBlacklist','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','rejected','callProgressDetectingAgent','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','reason','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','variables','filterKey','variable','addVariable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','name','strategy'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x84e7,0x122));var _0x784e=function(_0xf05833,_0x1a245a){_0xf05833=_0xf05833-0x0;var _0x30deb4=_0x84e7[_0xf05833];return _0x30deb4;};'use strict';var util=require('util');var _=require(_0x784e('0x0'));var BPromise=require(_0x784e('0x1'));var uuid=require('uuid');var moment=require(_0x784e('0x2'));var md5=require(_0x784e('0x3'));var Redis=require('ioredis');var config=require(_0x784e('0x4'));var logger=require(_0x784e('0x5'))(_0x784e('0x6'));var loggerAction=require(_0x784e('0x5'))(_0x784e('0x7'));var ami=require(_0x784e('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x784e('0x9'));var ut=require('./util/util');config[_0x784e('0xa')]=_[_0x784e('0xb')](config['redis'],{'host':_0x784e('0xc'),'port':0x18eb});var io=require(_0x784e('0xd'))(new Redis(config[_0x784e('0xa')]));var Sequence=function(){};Sequence[_0x784e('0xe')]['enqueue']=function(_0x4ae056){this[_0x784e('0xf')]=this[_0x784e('0xf')]?this[_0x784e('0xf')][_0x784e('0x10')](_0x4ae056):_0x4ae056();};function Preview(_0x5389cd){this[_0x784e('0x11')]=new Sequence();this[_0x784e('0x12')]=_0x5389cd[_0x784e('0x13')];this[_0x784e('0x14')]=_0x5389cd[_0x784e('0x14')];this[_0x784e('0x15')]={};this['agents']=_0x5389cd[_0x784e('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x784e('0x17'),this[_0x784e('0x18')][_0x784e('0x19')](this));ami['on'](_0x784e('0x1a'),this[_0x784e('0x1b')][_0x784e('0x19')](this));ami['on'](_0x784e('0x1c'),this[_0x784e('0x1d')][_0x784e('0x19')](this));ami['on']('dialend',this['syncDialEnd'][_0x784e('0x19')](this));ami['on'](_0x784e('0x1e'),this[_0x784e('0x1f')][_0x784e('0x19')](this));ami['on'](_0x784e('0x20'),this[_0x784e('0x21')][_0x784e('0x19')](this));ami['on']('attendedtransfer',this[_0x784e('0x22')][_0x784e('0x19')](this));ami['on'](_0x784e('0x23'),this[_0x784e('0x24')][_0x784e('0x19')](this));this[_0x784e('0x25')](this[_0x784e('0x12')]);}function emit(_0x5e9b46,_0x5add8f,_0x12aacb){io['to'](_0x5e9b46)['emit'](_0x5add8f,_0x12aacb);}function emitCampaignPreview(_0x2a304c){if(_0x2a304c[_0x784e('0x26')]==='outbound'){var _0x544a1b={'id':_0x2a304c['id'],'name':_0x2a304c[_0x784e('0x27')],'strategy':_0x2a304c[_0x784e('0x28')],'answered':_0x2a304c[_0x784e('0x29')],'available':_0x2a304c[_0x784e('0x2a')],'loggedIn':_0x2a304c['loggedIn'],'pTalking':_0x2a304c['pTalking'],'sumBillable':_0x2a304c['sumBillable'],'sumDuration':_0x2a304c[_0x784e('0x2b')],'sumHoldTime':_0x2a304c[_0x784e('0x2c')]||0x0,'talking':_0x2a304c['talking'],'total':_0x2a304c[_0x784e('0x2d')],'type':_0x2a304c['type'],'unmanaged':_0x2a304c[_0x784e('0x2e')],'abandoned':_0x2a304c['abandoned'],'waiting':_0x2a304c[_0x784e('0x2f')],'loggedInDb':_0x2a304c[_0x784e('0x30')],'dialActive':_0x2a304c[_0x784e('0x31')],'dialMethod':_0x2a304c[_0x784e('0x32')],'dialOriginateCallerIdName':_0x2a304c['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2a304c[_0x784e('0x33')],'dialOriginateTimeout':_0x2a304c[_0x784e('0x34')],'dialPrefix':_0x2a304c[_0x784e('0x35')],'outboundAnswerAgiCallsDay':_0x2a304c[_0x784e('0x36')],'outboundAnswerCallsDay':_0x2a304c['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2a304c[_0x784e('0x37')],'outboundBusyCallsDay':_0x2a304c[_0x784e('0x38')],'outboundCongestionCallsDay':_0x2a304c['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2a304c['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2a304c[_0x784e('0x39')],'outboundDropCallsDayTimeout':_0x2a304c[_0x784e('0x3a')],'outboundNoAnswerCallsDay':_0x2a304c[_0x784e('0x3b')],'outboundNoSuchCallsDay':_0x2a304c[_0x784e('0x3c')],'outboundOriginateFailureCallsDay':_0x2a304c[_0x784e('0x3d')],'outboundReCallsDay':_0x2a304c[_0x784e('0x3e')],'outboundRejectCallsDay':_0x2a304c[_0x784e('0x3f')],'outboundUnknownCallsDay':_0x2a304c[_0x784e('0x40')],'outboundAbandonedCallsDay':_0x2a304c[_0x784e('0x41')],'predictiveIntervalAnsweredCalls':_0x2a304c[_0x784e('0x42')],'predictiveIntervalAvgHoldtime':_0x2a304c[_0x784e('0x43')],'predictiveIntervalAvgTalktime':_0x2a304c[_0x784e('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x2a304c[_0x784e('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x2a304c[_0x784e('0x46')],'predictiveIntervalErlangCalls':_0x2a304c[_0x784e('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x2a304c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2a304c[_0x784e('0x48')],'predictiveIntervalMultiplicativeFactor':_0x2a304c['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2a304c[_0x784e('0x49')],'predictiveIntervalAvailable':_0x2a304c[_0x784e('0x4a')],'predictiveIntervalTotalCalls':_0x2a304c[_0x784e('0x4b')],'message':_0x2a304c['message'],'originated':_0x2a304c[_0x784e('0x4c')],'erlangCalls':_0x2a304c['erlangCalls'],'erlangCallToSecond':_0x2a304c[_0x784e('0x4d')],'erlangAbandonmentRate':_0x2a304c[_0x784e('0x4e')],'erlangBusyFactor':_0x2a304c['erlangBusyFactor'],'startPredictive':_0x2a304c[_0x784e('0x4f')],'startProgressive':_0x2a304c[_0x784e('0x50')]};if(_0x2a304c['Trunk']){_0x544a1b['Trunk']={'id':_0x2a304c[_0x784e('0x51')]['id'],'name':_0x2a304c[_0x784e('0x51')][_0x784e('0x27')],'active':_0x2a304c[_0x784e('0x51')][_0x784e('0x52')],'callerid':_0x2a304c['Trunk'][_0x784e('0x53')]};}if(_0x2a304c[_0x784e('0x54')]){_0x544a1b['Interval']={'id':_0x2a304c[_0x784e('0x54')]['id'],'name':_0x2a304c['Interval']['name']};}var _0x582355=md5(JSON[_0x784e('0x55')](_0x544a1b));if(_0x2a304c[_0x784e('0x3')]!==_0x582355){_0x2a304c['md5']=_0x582355;emit(util[_0x784e('0x56')](_0x784e('0x57'),_0x544a1b[_0x784e('0x27')]),_0x784e('0x58'),_0x544a1b);}}}function emitVoiceQueueChannelRemove(_0x1351ef){logger[_0x784e('0x59')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x1351ef));emit(util[_0x784e('0x56')](_0x784e('0x57'),_0x1351ef['name']),'voice_queue_channel:remove',_0x1351ef);io['emit'](_0x784e('0x5a'),_0x1351ef);}function notSendMessagesQueue(_0x1facf9){if(_0x1facf9['sendMessageOneNotActive']){if(_0x1facf9[_0x784e('0x4c')]===0x0&&_0x1facf9[_0x784e('0x5b')]===0x0){_0x1facf9[_0x784e('0x5c')]=![];_0x1facf9['available']=0x0;_0x1facf9[_0x784e('0x5d')]=0x0;_0x1facf9['message']=_0x784e('0x5e');ut['logger'](_0x784e('0x5f'),_0x1facf9[_0x784e('0x27')]+'\x20is\x20not\x20active');}else{_0x1facf9['message']=_0x784e('0x60');ut[_0x784e('0x61')](_0x784e('0x5f'),_0x1facf9['name']+_0x784e('0x62'));}emitCampaignPreview(_0x1facf9);}}Preview[_0x784e('0xe')][_0x784e('0x25')]=function(){var _0x1e90bb=this;setInterval(function(){_0x1e90bb['syncCampaigns']();},0x7cf);};Preview[_0x784e('0xe')][_0x784e('0x63')]=function(){var _0x48d0f0=this['campaignsPreview'];this[_0x784e('0x64')]+=0x1;for(var _0x39cf7a in _0x48d0f0){if(_0x48d0f0[_0x784e('0x65')](_0x39cf7a)&&(_0x48d0f0[_0x39cf7a][_0x784e('0x32')]===_0x784e('0x6')||_0x48d0f0[_0x39cf7a]['dialMethod']==='booked')&&_0x48d0f0[_0x39cf7a]['type']===_0x784e('0x66')){if(this[_0x784e('0x64')]>0x7){this[_0x784e('0x64')]=0x0;this[_0x784e('0x67')]();}}if(_0x48d0f0[_0x784e('0x65')](_0x39cf7a)&&_0x48d0f0[_0x39cf7a]['dialMethod']==='preview'&&_0x48d0f0[_0x39cf7a]['type']===_0x784e('0x66')){if(_0x48d0f0[_0x39cf7a][_0x784e('0x31')]){this['setMessage'](_0x48d0f0[_0x39cf7a]);if(_0x48d0f0[_0x39cf7a][_0x784e('0x68')])this[_0x784e('0x69')](_0x48d0f0[_0x39cf7a]);}else{notSendMessagesQueue(_0x48d0f0[_0x39cf7a]);}}}};Preview['prototype'][_0x784e('0x6a')]=function(_0x329925){var _0x2c6db8=this;this[_0x784e('0x11')][_0x784e('0x6b')](function(){if(!_[_0x784e('0x6c')](_0x2c6db8[_0x784e('0x15')][_0x329925])){loggerAction[_0x784e('0x59')]('[clearZombieChannels][talking]',_0x329925,_0x784e('0x6d'),_0x2c6db8[_0x784e('0x15')][_0x329925]['queue'],_0x784e('0x6e'),JSON[_0x784e('0x55')](_0x2c6db8[_0x784e('0x12')][_0x2c6db8[_0x784e('0x15')][_0x329925][_0x784e('0x6f')]][_0x784e('0x4c')]),_0x784e('0x70'),JSON[_0x784e('0x55')](_0x2c6db8[_0x784e('0x12')][_0x2c6db8[_0x784e('0x15')][_0x329925]['queue']][_0x784e('0x5b')]),JSON[_0x784e('0x55')](_0x2c6db8['actions'][_0x329925]['dialAnswer']),JSON[_0x784e('0x55')](_['pick'](_0x2c6db8[_0x784e('0x15')][_0x329925],['contactId',_0x784e('0x71'),_0x784e('0x72'),_0x784e('0x73')])));return ami[_0x784e('0x74')]({'action':'status','channel':_0x2c6db8['actions'][_0x329925][_0x784e('0x75')]})[_0x784e('0x76')](function(_0x45e724){if(_0x45e724[_0x784e('0x77')]===_0x784e('0x78')){setTimeout(function(){if(_0x2c6db8['actions'][_0x329925]){ut['updateOriginated'](_0x2c6db8[_0x784e('0x12')][_0x2c6db8[_0x784e('0x15')][_0x329925]['queue']],_0x784e('0x79'));if(_0x2c6db8[_0x784e('0x15')][_0x329925]['dialAnswer']===!![]){ut[_0x784e('0x7a')](_0x2c6db8[_0x784e('0x12')][_0x2c6db8[_0x784e('0x15')][_0x329925][_0x784e('0x6f')]],'[clearZombieChannel]');ut['loggerError'](_0x784e('0x7b')+_0x329925,_0x2c6db8['actions'][_0x329925]['queue']);}ut[_0x784e('0x7c')](_0x784e('0x7d')+_0x329925,_0x2c6db8[_0x784e('0x15')][_0x329925][_0x784e('0x6f')]);delete _0x2c6db8[_0x784e('0x15')][_0x329925];}},0x2328);}});}});};Preview[_0x784e('0xe')][_0x784e('0x67')]=function(){var _0x4795bd=this;loggerAction[_0x784e('0x59')](_0x784e('0x7e'),_['size'](this['actions']));for(var _0x5bf567 in this[_0x784e('0x15')]){if(_0x4795bd[_0x784e('0x15')][_0x784e('0x65')](_0x5bf567)){_0x4795bd[_0x784e('0x6a')](_0x5bf567);}}};Preview[_0x784e('0xe')]['recallMe']=function(_0x3d0b7d){var _0x37a152=this;rpcDb[_0x784e('0x7f')](_0x3d0b7d['id'],ut[_0x784e('0x80')](this['agents']))[_0x784e('0x81')](function(_0x5bccc1){if(!_[_0x784e('0x6c')](_0x5bccc1)){for(var _0x191cda=0x0;_0x191cda<_0x5bccc1[_0x784e('0x82')];_0x191cda+=0x1){if(ut[_0x784e('0x83')](_0x5bccc1[_0x191cda][_0x784e('0x84')])<_0x3d0b7d[_0x784e('0x85')]*0x3c){if(_0x5bccc1[_0x191cda]['Agent']&&!_0x5bccc1[_0x191cda][_0x784e('0x86')]['voicePause']){_0x37a152[_0x784e('0x87')](_0x5bccc1[_0x191cda]['id'])[_0x784e('0x81')](ut[_0x784e('0x88')](_0x784e('0x89')))[_0x784e('0x76')](ut[_0x784e('0x88')](_0x784e('0x89')));}else{rpcDb[_0x784e('0x8a')](_0x5bccc1[_0x191cda]['id']);}}else{var _0x40375d=new Action(_0x5bccc1[_0x191cda],_0x3d0b7d);_0x40375d[_0x784e('0x8b')]=moment()[_0x784e('0x56')](_0x784e('0x8c'));_0x3d0b7d[_0x784e('0x3e')]+=0x1;ut[_0x784e('0x8d')](_0x40375d,0x17,_0x784e('0x8e'));if(_0x3d0b7d[_0x784e('0x8f')]){rpcDb[_0x784e('0x90')](ut[_0x784e('0x91')](_0x5bccc1[_0x191cda]));rpcDb['createCustomerHistory'](_0x40375d,_0x784e('0x92'));}else{ut['logCustomer'](_0x40375d,0x16,_0x784e('0x93'));rpcDb['createCustomerHistory'](_0x40375d,_0x784e('0x94'));rpcDb[_0x784e('0x95')](_0x40375d,_0x784e('0x94'));}}}}})[_0x784e('0x76')](ut[_0x784e('0x88')]('[getContactRecallMe]'));};Preview[_0x784e('0xe')][_0x784e('0x96')]=function(_0x3bf073){_0x3bf073['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x3bf073[_0x784e('0x97')])){_0x3bf073[_0x784e('0x77')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x3bf073['dialActive'])){_0x3bf073[_0x784e('0x77')]=_0x784e('0x5e');}else if(!this[_0x784e('0x98')](_0x3bf073[_0x784e('0x51')])){if(!this[_0x784e('0x98')](_0x3bf073['TrunkBackup'])){_0x3bf073[_0x784e('0x77')]=_0x784e('0x99');}else{_0x3bf073[_0x784e('0x77')]=_0x784e('0x9a');}}else{_0x3bf073[_0x784e('0x77')]=_0x784e('0x9a');}emitCampaignPreview(_0x3bf073);};Preview[_0x784e('0xe')][_0x784e('0x9b')]=function(_0x540a58,_0x57902e,_0x8d1f52){var _0x3012b0=this;var _0x5dfc9e=this[_0x784e('0x15')][_0x57902e];var _0x1479ba=this[_0x784e('0x12')][_0x5dfc9e[_0x784e('0x6f')]];var _0x59bb5a;if(_0x1479ba){switch(_0x8d1f52){case'1':_0x1479ba[_0x784e('0x3c')]+=0x1;_0x5dfc9e[_0x784e('0x9c')]+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut[_0x784e('0x9e')](_0x5dfc9e);ut['logCustomer'](_0x5dfc9e,0x0,'NoSuchNumber');ami['emit'](_0x784e('0x9f'),ut['buildObj'](_0x5dfc9e,'nosuchnumber'));rpcDb[_0x784e('0xa0')](_0x5dfc9e,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,'Global');rpcDb['createCustomerFinal'](_0x59bb5a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5dfc9e[_0x784e('0x9c')]>=_0x1479ba[_0x784e('0xa3')]){rpcDb['createCustomerFinal'](_0x5dfc9e,_0x784e('0xa4'));}else{rpcDb[_0x784e('0xa5')](ut[_0x784e('0xa6')](_0x5dfc9e,_0x784e('0x9c'),_0x1479ba[_0x784e('0xa7')]),_0x5dfc9e['unlockAgent'],_0x5dfc9e[_0x784e('0xa8')]);}}delete this[_0x784e('0x15')][_0x540a58['linkedid']];break;case _0x784e('0xa9'):var _0x234b1b=moment()[_0x784e('0x56')](_0x784e('0x8c'));_0x5dfc9e['responsetime']=_0x234b1b;_0x5dfc9e[_0x784e('0xaa')]=_0x234b1b;_0x5dfc9e['dialAnswer']=!![];_0x1479ba[_0x784e('0x5b')]+=0x1;logger[_0x784e('0x59')](_0x784e('0xab'),_0x5dfc9e['uniqueid'],_0x784e('0xac'),_0x1479ba[_0x784e('0x27')],_0x784e('0x70'),_0x1479ba['pTalking']);ami[_0x784e('0xad')](_0x784e('0xae'),ut[_0x784e('0xaf')](_0x5dfc9e,_0x784e('0xb0'),this[_0x784e('0x12')][_0x5dfc9e['queue']]));if(_0x1479ba[_0x784e('0xb1')]){ami[_0x784e('0xad')]('custom:agentConnectPreview',ut['buildAcw'](_0x5dfc9e));}break;case'16':ami[_0x784e('0xad')](_0x784e('0xb2'),ut[_0x784e('0xaf')](_0x5dfc9e,'complete',this[_0x784e('0x12')][_0x5dfc9e[_0x784e('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0x784e('0xaf')](_0x5dfc9e,_0x784e('0xb3')));_0x1479ba[_0x784e('0xb4')]+=0x1;_0x1479ba[_0x784e('0x2d')]+=0x1;_0x1479ba[_0x784e('0x29')]+=0x1;ut['decrementTalkink'](_0x1479ba,'[16]');_0x5dfc9e[_0x784e('0x9d')]=ut['totalGlobal'](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0x4,_0x784e('0xb5'));rpcDb[_0x784e('0xa0')](_0x5dfc9e,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x784e('0x95')](_0x5dfc9e,_0x784e('0xb6'));rpcDb[_0x784e('0xb7')](_0x5dfc9e);_0x1479ba[_0x784e('0x2b')]+=_0x5dfc9e[_0x784e('0xb8')];_0x1479ba[_0x784e('0xb9')]+=_0x5dfc9e[_0x784e('0xb8')];logger[_0x784e('0x59')](_0x784e('0xba'),_0x5dfc9e[_0x784e('0xbb')],_0x784e('0xac'),_0x1479ba[_0x784e('0x27')],_0x784e('0x70'),_0x1479ba[_0x784e('0x5b')]);delete this[_0x784e('0x15')][_0x540a58[_0x784e('0xbc')]];break;case _0x784e('0xbd'):_0x1479ba[_0x784e('0x38')]+=0x1;_0x5dfc9e[_0x784e('0xbe')]+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut[_0x784e('0x9e')](_0x5dfc9e);ut['logCustomer'](_0x5dfc9e,0x5,_0x784e('0xbf'));ami[_0x784e('0xad')](_0x784e('0xc0'),ut[_0x784e('0xaf')](_0x5dfc9e,_0x784e('0xc1')));rpcDb[_0x784e('0xa0')](_0x5dfc9e,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba['dialGlobalMaxRetry']){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,'Global');rpcDb['createCustomerFinal'](_0x59bb5a,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5dfc9e[_0x784e('0xbe')]>=_0x1479ba[_0x784e('0xc2')]){rpcDb[_0x784e('0x95')](_0x5dfc9e,_0x784e('0xc3'));}else{rpcDb[_0x784e('0xa5')](ut[_0x784e('0xa6')](_0x5dfc9e,'countbusyretry',_0x1479ba[_0x784e('0xc4')]),_0x5dfc9e[_0x784e('0xc5')],_0x5dfc9e[_0x784e('0xa8')]);}}break;case'NOANSWER':_0x1479ba[_0x784e('0x3b')]+=0x1;_0x5dfc9e[_0x784e('0xc6')]+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut[_0x784e('0x9e')](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0x3,_0x784e('0xc7'));ami[_0x784e('0xad')]('custom:agentnoanswer',ut['buildObj'](_0x5dfc9e,_0x784e('0xc8')));rpcDb[_0x784e('0xa0')](_0x5dfc9e,_0x784e('0xc9'));if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,_0x784e('0xca'));rpcDb[_0x784e('0x95')](_0x59bb5a,_0x784e('0xcb'));}else{if(_0x5dfc9e[_0x784e('0xc6')]>=_0x1479ba['dialNoAnswerMaxRetry']){rpcDb[_0x784e('0x95')](_0x5dfc9e,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x784e('0xa6')](_0x5dfc9e,_0x784e('0xc6'),_0x1479ba[_0x784e('0xcc')]),_0x5dfc9e[_0x784e('0xc5')],_0x5dfc9e['activeContact']);}}break;case _0x784e('0xcd'):_0x1479ba[_0x784e('0xce')]+=0x1;_0x5dfc9e[_0x784e('0xcf')]+=0x1;_0x5dfc9e['countglobal']=ut[_0x784e('0x9e')](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0x8,_0x784e('0xd0'));ami[_0x784e('0xad')](_0x784e('0xd1'),ut[_0x784e('0xaf')](_0x5dfc9e,_0x784e('0xd2')));rpcDb[_0x784e('0xa0')](_0x5dfc9e,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba['dialGlobalMaxRetry']){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,_0x784e('0xca'));rpcDb[_0x784e('0x95')](_0x59bb5a,_0x784e('0xd3'));}else{if(_0x5dfc9e[_0x784e('0xcf')]>=_0x1479ba['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x5dfc9e,_0x784e('0xd4'));}else{rpcDb[_0x784e('0xa5')](ut[_0x784e('0xa6')](_0x5dfc9e,_0x784e('0xcf'),_0x1479ba[_0x784e('0xc4')]),_0x5dfc9e[_0x784e('0xc5')],_0x5dfc9e[_0x784e('0xa8')]);}}break;case'CANCEL':_0x1479ba[_0x784e('0x3f')]+=0x1;_0x5dfc9e['countagentrejectretry']+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut['totalGlobal'](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0x14,'AgentReject');ami[_0x784e('0xad')](_0x784e('0xd5'),ut[_0x784e('0xaf')](_0x5dfc9e,'agentreject'));rpcDb['createCustomerHistory'](_0x5dfc9e,'[syncHangupRequest][logAgentReject]');if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0x14,_0x784e('0xd6'));rpcDb[_0x784e('0x95')](_0x59bb5a,_0x784e('0xd7'));}else{if(_0x5dfc9e[_0x784e('0xd8')]>=_0x1479ba[_0x784e('0xd9')]){rpcDb[_0x784e('0x95')](_0x5dfc9e,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x784e('0xa5')](ut['scheduledAt'](_0x5dfc9e,_0x784e('0xd8'),_0x1479ba[_0x784e('0xda')]),_0x5dfc9e[_0x784e('0xc5')],_0x5dfc9e[_0x784e('0xa8')]);}}break;case _0x784e('0xdb'):_0x1479ba['outboundAbandonedCallsDay']+=0x1;_0x5dfc9e[_0x784e('0xdc')]+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut['totalGlobal'](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0xb,_0x784e('0xdd'));rpcDb[_0x784e('0xa0')](_0x5dfc9e,_0x784e('0xde'));if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,_0x784e('0xca'));rpcDb[_0x784e('0x95')](_0x59bb5a,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5dfc9e[_0x784e('0xdf')]>=_0x1479ba['dialAbandonedMaxRety']){rpcDb[_0x784e('0x95')](_0x5dfc9e,_0x784e('0xde'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5dfc9e,_0x784e('0xdc'),_0x1479ba['dialAbandonedRetryFrequency']),_0x5dfc9e[_0x784e('0xc5')],_0x5dfc9e[_0x784e('0xa8')]);}}break;case'18':_0x1479ba[_0x784e('0x40')]+=0x1;_0x5dfc9e['countmachineretry']+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut[_0x784e('0x9e')](_0x5dfc9e);ut['logCustomer'](_0x5dfc9e,0x12,_0x540a58[_0x784e('0xe0')]||_0x540a58[_0x784e('0xe1')]);ami[_0x784e('0xad')](_0x784e('0xe2'),ut[_0x784e('0xaf')](_0x5dfc9e,'amd'));rpcDb['createCustomerHistory'](_0x5dfc9e,_0x784e('0xe3'));if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,'Global');rpcDb[_0x784e('0x95')](_0x59bb5a,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x784e('0x95')](_0x5dfc9e,_0x784e('0xe3'));}delete this[_0x784e('0x15')][_0x540a58['linkedid']];break;case'19':_0x1479ba[_0x784e('0x40')]+=0x1;_0x5dfc9e['countglobal']=ut[_0x784e('0x9e')](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0x13,_0x540a58[_0x784e('0xe0')]||_0x540a58[_0x784e('0xe1')]);ami[_0x784e('0xad')](_0x784e('0xe2'),ut[_0x784e('0xaf')](_0x5dfc9e,_0x784e('0xe4')));rpcDb[_0x784e('0xa0')](_0x5dfc9e,_0x784e('0xe5'));if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut['cloneAction'](_0x5dfc9e,0xf,_0x784e('0xca'));rpcDb[_0x784e('0x95')](_0x59bb5a,_0x784e('0xe5'));}else{rpcDb[_0x784e('0x95')](_0x5dfc9e,_0x784e('0xe5'));}delete this[_0x784e('0x15')][_0x540a58[_0x784e('0xbc')]];break;default:if(_0x5dfc9e['dialAnswer']){ut[_0x784e('0x7a')](_0x1479ba,_0x784e('0xe6'));ut[_0x784e('0x7c')](_0x784e('0xe7')+_0x1479ba['name'],_0x540a58);}_0x1479ba[_0x784e('0x40')]+=0x1;_0x5dfc9e[_0x784e('0x9d')]=ut[_0x784e('0x9e')](_0x5dfc9e);ut[_0x784e('0x8d')](_0x5dfc9e,0xc,_0x540a58[_0x784e('0xe0')]||_0x540a58[_0x784e('0xe1')]);rpcDb[_0x784e('0xa0')](_0x5dfc9e,_0x784e('0xe8'));if(ut[_0x784e('0x9e')](_0x5dfc9e)>=_0x1479ba[_0x784e('0xa1')]){_0x59bb5a=ut[_0x784e('0xa2')](_0x5dfc9e,0xf,'Global');rpcDb[_0x784e('0x95')](_0x59bb5a,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x784e('0x95')](_0x5dfc9e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x784e('0x15')][_0x540a58[_0x784e('0xbc')]];}if(!(_0x5dfc9e[_0x784e('0xe9')]&&_0x8d1f52==='16')){ut[_0x784e('0xea')](_0x1479ba,'[callProgressDetectingCustomer]');logger[_0x784e('0x59')]('[originated][decrement][callProgressDetectingCustomer]',_0x5dfc9e['uniqueid'],_0x784e('0xac'),_0x1479ba[_0x784e('0x27')],_0x784e('0x6e'),_0x1479ba['originated']);}if(_0x8d1f52!==_0x784e('0xa9')){delete this[_0x784e('0x15')][_0x540a58[_0x784e('0xbc')]];delete this[_0x784e('0x15')][_0x540a58[_0x784e('0xeb')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x243b34,_0x2b82aa,_0x1c5ea1){if(_[_0x784e('0xec')](_0x2b82aa)&&_0x784e('0xed')!==typeof _0x2b82aa){return;}if(_['isUndefined'](_0x1c5ea1)&&_0x784e('0xed')!==typeof _0x1c5ea1){return;}switch(_0x1c5ea1['reason']){case'0':ut[_0x784e('0xee')](_0x243b34,0x0,_0x784e('0xef'));rpcDb[_0x784e('0xf0')](_0x243b34,_0x784e('0xf1'));break;case'3':ut['logAgent'](_0x243b34,0x3,_0x784e('0xc7'));rpcDb[_0x784e('0xf0')](_0x243b34,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x784e('0xee')](_0x243b34,0x5,'Busy');rpcDb[_0x784e('0xf0')](_0x243b34,_0x784e('0xf2'));break;case'8':ut['logAgent'](_0x243b34,0x8,_0x784e('0xd0'));rpcDb[_0x784e('0xf0')](_0x243b34,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x784e('0xee')](_0x243b34,0x16,_0x784e('0xf3'));rpcDb['createAgentHistory'](_0x243b34,_0x784e('0xf4'));break;default:ut[_0x784e('0xee')](_0x243b34,0xc,_0x1c5ea1['reason']);rpcDb[_0x784e('0xf0')](_0x243b34,'[callProgressDetectingAgent][logCongestion]');}ut[_0x784e('0xea')](_0x2b82aa,_0x784e('0xf5'));logger[_0x784e('0x59')](_0x784e('0xf6'),_0x243b34['uniqueid'],_0x784e('0xac'),_0x2b82aa[_0x784e('0x27')],_0x784e('0x6e'),_0x2b82aa[_0x784e('0x4c')]);delete this[_0x784e('0x15')][_0x243b34[_0x784e('0xbb')]];};Preview[_0x784e('0xe')][_0x784e('0xf7')]=function(_0xffa37e,_0x2a5836,_0x1c35eb,_0x2b181a,_0x4047b2){var _0xad53cf=this;return new BPromise(function(_0x45e45f,_0x5f4e77){if(_[_0x784e('0x6c')](_0x2a5836)||_[_0x784e('0x6c')](_0x2a5836[_0x784e('0xf8')])||_['isNil'](_0x2a5836[_0x784e('0xf8')][_0x784e('0xf9')])||_[_0x784e('0x6c')](_0x2a5836[_0x784e('0x72')])){_0x5f4e77(ut[_0x784e('0x77')](_0x784e('0xfa'),_0x2b181a,_0x4047b2));return;}var _0x2e95fb=uuid['v4']();var _0x1e4772=_0xad53cf[_0x784e('0x12')][_0x2a5836[_0x784e('0x6d')][_0x784e('0x27')]];var _0x50785a=_0x1c35eb?_0xad53cf[_0x784e('0x16')][_0x1c35eb]['id']:undefined;_0xad53cf[_0x784e('0x15')][_0x2e95fb]=new Action(_0x2a5836,_0x1e4772,_0x2e95fb,_0x1c35eb,_0x50785a);var _0x4f060f=_0xad53cf[_0x784e('0x15')][_0x2e95fb];_0x4f060f[_0x784e('0xc5')]=_0x2b181a;_0x4f060f[_0x784e('0xa8')]=_0x4047b2;_0x4f060f[_0x784e('0xfb')]=_0x1c35eb;if(_[_0x784e('0xfc')](_0xffa37e)){_0xad53cf['execCall'](_0x4f060f,_0x1e4772,_0x2a5836,_0x1c35eb)[_0x784e('0x81')](function(_0x28af51){logger['info']('[Preview][execCall][success]',_0x784e('0xfd')+_0x4f060f[_0x784e('0x6f')]+'\x20IdHopper:\x20'+_0x4f060f[_0x784e('0xfe')],JSON[_0x784e('0x55')](_0x28af51));ami[_0x784e('0xad')]('custom:agentcalled',ut[_0x784e('0xaf')](_0x4f060f,_0x784e('0xff'),_0xad53cf[_0x784e('0x12')][_0x4f060f['queue']]));_0x45e45f(ut[_0x784e('0x77')]('Calling'));})[_0x784e('0x76')](function(_0x1c5b22){ut[_0x784e('0x61')](_0x784e('0x100'),_0x1c5b22);_0x5f4e77(ut[_0x784e('0x77')]('Call\x20failed',_0x2b181a,_0x4047b2));});}else{_0x1e4772[_0x784e('0x37')]+=0x1;ut[_0x784e('0x101')](_0x4f060f);rpcDb['createHistory'](_0x4f060f,'[Blacklist][error]');delete _0xad53cf[_0x784e('0x15')][_0x2e95fb];_0x5f4e77(ut[_0x784e('0x77')](_0x784e('0x102'),_0x2b181a,_0x4047b2));}});};Preview[_0x784e('0xe')]['isTrunkReachable']=function(_0x30dd61){return!_['isNil'](_0x30dd61)&&!_[_0x784e('0x6c')](_0x30dd61[_0x784e('0x27')])&&!_[_0x784e('0x6c')](_0x30dd61[_0x784e('0x52')])&&_0x30dd61[_0x784e('0x52')]&&!_[_0x784e('0x6c')](this['trunks'][util[_0x784e('0x56')](_0x784e('0x103'),_0x30dd61[_0x784e('0x27')])])&&!_['isNil'](this[_0x784e('0x14')][util[_0x784e('0x56')](_0x784e('0x103'),_0x30dd61['name'])][_0x784e('0x104')])&&(this['trunks'][util[_0x784e('0x56')](_0x784e('0x103'),_0x30dd61['name'])][_0x784e('0x104')]===_0x784e('0x105')||this[_0x784e('0x14')][util['format'](_0x784e('0x103'),_0x30dd61[_0x784e('0x27')])][_0x784e('0x104')]===_0x784e('0x106'));};Preview[_0x784e('0xe')]['run']=function(_0x5314c3,_0x3d954d){var _0x4f3a3b=this;return new BPromise(function(_0x2a3d00,_0x5a4dd5){_0x4f3a3b[_0x784e('0x107')](_0x5314c3,_0x3d954d)[_0x784e('0x81')](function(_0x510172){_0x2a3d00(_[_0x784e('0x108')](_0x510172,[_0x784e('0x77')]));})[_0x784e('0x76')](function(_0x3c1140){if(_0x3c1140[_0x784e('0x109')]){rpcDb[_0x784e('0x10a')](_0x5314c3);}if(_0x3c1140[_0x784e('0x52')]){rpcDb['disableContact'](_0x5314c3);}_0x5a4dd5(_[_0x784e('0x108')](_0x3c1140,[_0x784e('0x77')]));});});};Preview[_0x784e('0xe')]['execRun']=function(_0x2b9e9e,_0x5f5391){var _0x363db9=this;return new BPromise(function(_0x20f070,_0x1bbfc3){var _0x3d742d,_0x51e83b;rpcDb[_0x784e('0x10b')](_0x2b9e9e)['then'](function(_0x669375){if(!_[_0x784e('0x6c')](_0x669375[0x0])){_0x51e83b=_0x669375[0x0][_0x784e('0x10c')]?![]:!![];_0x3d742d=_0x669375[0x0][_0x784e('0x10c')]?!![]:![];_0x3d742d=_0x5f5391?!![]:_0x3d742d;}var _0x22174e=_0x363db9[_0x784e('0x10d')](_0x669375);if(_0x22174e[_0x784e('0x10e')]){rpcDb[_0x784e('0x10f')](_['pick'](_0x669375[0x0],[_0x784e('0x72'),_0x784e('0x110')]))['then'](function(_0x355f0f){_0x363db9[_0x784e('0xf7')](_0x355f0f,_0x669375[0x0],_0x5f5391,_0x51e83b,_0x3d742d)[_0x784e('0x81')](function(_0x24d06e){_0x20f070(_0x24d06e);})['catch'](function(_0x3d8b97){_0x1bbfc3(_0x3d8b97);});})['catch'](function(_0x450e85){ut['logger'](_0x784e('0x111'),_0x450e85);_0x1bbfc3(ut['message']('Call\x20unsuccessful',_0x51e83b,_0x3d742d));});}else{_0x1bbfc3(ut[_0x784e('0x77')](_0x22174e[_0x784e('0x77')],_0x51e83b,_0x3d742d));}})[_0x784e('0x76')](function(_0x2536aa){ut[_0x784e('0x61')]('[Preview][getContactPreview]',_0x2536aa);_0x1bbfc3(ut[_0x784e('0x77')](_0x784e('0x112'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x12fe54){if(_['isNil'](_0x12fe54)||_['isEmpty'](_0x12fe54)||!_[_0x784e('0x6c')](_0x12fe54[0x0][_0x784e('0x86')])&&_[_0x784e('0x6c')](_0x12fe54[0x0]['Agent'][_0x784e('0x27')])){ut['logger'](_0x784e('0x113'),_0x12fe54);return{'isValid':![],'message':_0x784e('0x114')};}var _0x10ca42=this[_0x784e('0x12')][_0x12fe54[0x0]['Queue'][_0x784e('0x27')]];_0x10ca42[_0x784e('0x77')]=_0x784e('0x9a');if(_[_0x784e('0x6c')](_0x10ca42)){ut[_0x784e('0x61')]('[Preview][validateContact][Empty\x20Campaign]',_0x10ca42);return{'isValid':![],'message':_0x784e('0x115')};}if(!this[_0x784e('0x98')](_0x10ca42[_0x784e('0x51')])){ut['logger'](_0x784e('0x116'),_0x784e('0x117')+_0x10ca42[_0x784e('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x10ca42[_0x784e('0x118')])){ut[_0x784e('0x61')](_0x784e('0x116'),_0x10ca42[_0x784e('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x10ca42['dialActive'])){ut[_0x784e('0x61')](_0x784e('0x119'),_0x10ca42[_0x784e('0x27')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x10ca42[_0x784e('0x27')]+_0x784e('0x11a')};}return{'isValid':!![],'message':_0x784e('0x11b')};};Preview['prototype'][_0x784e('0x11c')]=function(_0x307f0f,_0x282047,_0x1b4633,_0x540618){var _0x2b8e81=this;return new BPromise(function(_0xceaf97,_0x39ed4d){var _0x578889=_0x307f0f[_0x784e('0xbb')];var _0xefc535=_0x2b8e81[_0x784e('0x98')](_0x282047[_0x784e('0x51')])?util[_0x784e('0x56')](_0x784e('0x11d'),_0x282047[_0x784e('0x51')][_0x784e('0x27')],_[_0x784e('0x6c')](_0x282047[_0x784e('0x35')])?'':_0x282047[_0x784e('0x35')]['trim']()||'',_0x282047['dialCutDigit']>0x0?_0x1b4633[_0x784e('0xf8')][_0x784e('0xf9')]['substring'](_0x282047[_0x784e('0x11e')]):_0x1b4633[_0x784e('0xf8')][_0x784e('0xf9')]):util[_0x784e('0x56')](_0x784e('0x11d'),_[_0x784e('0x6c')](_0x282047['TrunkBackup'])?_0x282047[_0x784e('0x51')][_0x784e('0x27')]:_0x282047[_0x784e('0x118')][_0x784e('0x27')],_['isNil'](_0x282047['dialPrefix'])?'':_0x282047[_0x784e('0x35')][_0x784e('0x11f')]()||'',_0x282047[_0x784e('0x11e')]>0x0?_0x1b4633[_0x784e('0xf8')]['phone'][_0x784e('0x120')](_0x282047[_0x784e('0x11e')]):_0x1b4633[_0x784e('0xf8')][_0x784e('0xf9')]);var _0x6380dd=_0x2b8e81['isTrunkReachable'](_0x282047[_0x784e('0x51')])?ut[_0x784e('0x121')](_0x282047[_0x784e('0x51')][_0x784e('0x53')],_0x282047[_0x784e('0x122')],_0x282047[_0x784e('0x123')]>0x0?ut[_0x784e('0x124')](_0x282047[_0x784e('0x33')],_0x282047[_0x784e('0x123')]):_0x282047[_0x784e('0x33')]):ut[_0x784e('0x121')](_[_0x784e('0x6c')](_0x282047[_0x784e('0x118')])?_0x282047[_0x784e('0x51')][_0x784e('0x53')]:_0x282047[_0x784e('0x118')]['callerid'],_0x282047['dialOriginateCallerIdName'],_0x282047[_0x784e('0x123')]>0x0?ut[_0x784e('0x124')](_0x282047[_0x784e('0x33')],_0x282047[_0x784e('0x123')]):_0x282047['dialOriginateCallerIdNumber']);if(_0x6380dd){_0x307f0f[_0x784e('0x125')]=ut[_0x784e('0x126')](_0x6380dd);_0x307f0f[_0x784e('0x127')]=ut[_0x784e('0x128')](_0x6380dd);}var _0x3fe9ce=ut[_0x784e('0x129')](_0x282047,_0x1b4633,_0xefc535,_0x6380dd,_0x578889,_0x307f0f);_[_0x784e('0x12a')](_0x307f0f,ut[_0x784e('0x12b')](_0x3fe9ce));_0x307f0f[_0x784e('0x8b')]=moment()[_0x784e('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x784e('0x74')](ut[_0x784e('0x12c')](_0x307f0f,_0x282047,_0x3fe9ce,_0x307f0f[_0x784e('0xa8')],_0x540618))[_0x784e('0x81')](function(_0x1b57ac){_0x282047['originated']+=0x1;logger[_0x784e('0x59')](_0x784e('0x12d'),_0x578889,'\x20Queue',_0x282047['name'],_0x784e('0x6e'),_0x282047[_0x784e('0x4c')]);_0xceaf97(_0x1b57ac);})['catch'](function(_0x2ade01){ut[_0x784e('0xee')](_0x307f0f,0xe,_0x784e('0x12e'));rpcDb[_0x784e('0xf0')](_0x307f0f,_0x784e('0x12f'));_0x39ed4d(_0x2ade01);});});};Preview[_0x784e('0xe')][_0x784e('0x1f')]=function(_0x14f194){if(this[_0x784e('0x15')][_0x14f194[_0x784e('0xbc')]]){this[_0x784e('0x15')][_0x14f194['linkedid']]['channel']=_0x14f194[_0x784e('0x75')];}};Preview[_0x784e('0xe')][_0x784e('0x18')]=function(_0x4ff8d9){var _0x4dbc98=this;var _0x377558=this[_0x784e('0x15')][_0x4ff8d9[_0x784e('0x130')]];if(_0x377558){if(_0x377558[_0x784e('0xfb')]&&this[_0x784e('0x16')][_0x377558[_0x784e('0xfb')]]){ut['logLookAgent'](_0x377558,this[_0x784e('0x16')][_0x377558['lookAgent']][_0x784e('0x27')],this[_0x784e('0x16')][_0x377558['lookAgent']]['id']);}var _0xcb6a12=_[_0x784e('0x131')](_0x377558);_0xcb6a12['responsetime']=moment()['format'](_0x784e('0x8c'));var _0x361170=_0x4dbc98['campaignsPreview'][_0x377558[_0x784e('0x6f')]];if(ut[_0x784e('0x132')](_0x4ff8d9[_0x784e('0x133')])){if(_0x377558['unlockAgent']){rpcDb[_0x784e('0x10a')](_0x377558[_0x784e('0xfe')]);}if(_0x377558['activeContact']){rpcDb[_0x784e('0x8a')](_0x377558[_0x784e('0xfe')]);}ami[_0x784e('0xad')]('custom:agentringnoanswer',ut['buildObj'](_0x377558,_0x784e('0x134'),this[_0x784e('0x12')][_0x377558[_0x784e('0x6f')]]));this[_0x784e('0x135')](_0xcb6a12,_0x361170,_0x4ff8d9);}else{_0x377558[_0x784e('0x8b')]=moment()[_0x784e('0x56')](_0x784e('0x8c'));ut['logAgent'](_0xcb6a12,0x4,'Answer');rpcDb['createAgentHistory'](_0xcb6a12,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x784e('0xe')][_0x784e('0x1b')]=function(_0x3d25a0){var _0xf3f593=this;var _0x63719c=this['actions'][_0x3d25a0[_0x784e('0xbc')]];var _0x4a768a;if(_0x63719c){_0x4a768a=this[_0x784e('0x12')][_0x63719c[_0x784e('0x6f')]];logger[_0x784e('0x59')](_0x784e('0x136'),_0x3d25a0[_0x784e('0xbc')],'\x20Queue',_0x4a768a[_0x784e('0x27')],_0x784e('0x70'),_0x4a768a['pTalking']);}if(this['actions'][_0x3d25a0['linkedid']]&&_0x3d25a0[_0x784e('0xbc')]!==_0x3d25a0[_0x784e('0xbb')]){if(_0x3d25a0[_0x784e('0x137')]==='16'&&this[_0x784e('0x15')][_0x3d25a0[_0x784e('0xbc')]][_0x784e('0xe9')]){this['callProgressDetectingCustomer'](_0x3d25a0,_0x3d25a0['linkedid'],_0x3d25a0[_0x784e('0x137')]);}else if(this[_0x784e('0x15')][_0x3d25a0['linkedid']][_0x784e('0xe9')]){logger['info'](_0x784e('0x138'),_0x3d25a0[_0x784e('0xbc')],_0x3d25a0[_0x784e('0x137')],'\x20Queue',_0x4a768a[_0x784e('0x27')],_0x784e('0x70'),_0x4a768a[_0x784e('0x5b')]);this[_0x784e('0x9b')](_0x3d25a0,_0x3d25a0[_0x784e('0xbc')],_0x3d25a0[_0x784e('0x137')]);}}else if(_0x63719c&&_['isNil'](_0x63719c['statedesc'])&&_0x4a768a[_0x784e('0x139')]&&_0x3d25a0[_0x784e('0xbc')]===_0x3d25a0[_0x784e('0xbb')]&&_[_0x784e('0x6c')](_0x3d25a0[_0x784e('0x13a')])&&_0x3d25a0[_0x784e('0x137')]==='16'&&_0x3d25a0['channelstate']==='6'&&_[_0x784e('0xec')](_0x63719c[_0x784e('0x13b')])){if(_0x63719c['unlockAgent']){rpcDb[_0x784e('0x10a')](_0x63719c['idContact']);}if(_0x63719c[_0x784e('0xa8')]){rpcDb[_0x784e('0x8a')](_0x63719c[_0x784e('0xfe')]);}_0x3d25a0[_0x784e('0x13a')]='22';this[_0x784e('0x135')](_0x63719c,_0x4a768a,_0x3d25a0);}else if(_0x63719c&&_0x63719c[_0x784e('0x13b')]){if(_0x3d25a0[_0x784e('0x137')]==='16'&&this[_0x784e('0x15')][_0x3d25a0['linkedid']][_0x784e('0xe9')]){logger[_0x784e('0x59')](_0x784e('0x13c'),_0x3d25a0[_0x784e('0xbc')],_0x3d25a0[_0x784e('0x137')],'\x20Queue',_0x4a768a[_0x784e('0x27')],'pTalking:\x20',_0x4a768a['pTalking']);this[_0x784e('0x9b')](_0x3d25a0,_0x3d25a0[_0x784e('0xbc')],_0x3d25a0[_0x784e('0x137')]);}else if(this[_0x784e('0x15')][_0x3d25a0[_0x784e('0xbc')]][_0x784e('0xe9')]){logger['info'](_0x784e('0x138'),_0x3d25a0[_0x784e('0xbc')],_0x3d25a0[_0x784e('0x137')],_0x784e('0xac'),_0x4a768a[_0x784e('0x27')],_0x784e('0x70'),_0x4a768a['pTalking']);this[_0x784e('0x9b')](_0x3d25a0,_0x3d25a0[_0x784e('0xbc')],_0x3d25a0['cause']);}}};Preview['prototype'][_0x784e('0x13d')]=function(_0xc8ffee){if(this[_0x784e('0x15')][_0xc8ffee[_0x784e('0xeb')]]&&_0xc8ffee[_0x784e('0xeb')]!==_0xc8ffee[_0x784e('0x13e')]){this[_0x784e('0x9b')](_0xc8ffee,_0xc8ffee['destlinkedid'],_0xc8ffee['dialstatus']);}};Preview[_0x784e('0xe')][_0x784e('0x1d')]=function(_0x4605d5){if(this[_0x784e('0x15')][_0x4605d5[_0x784e('0xbc')]]&&_0x4605d5[_0x784e('0xbc')]!==_0x4605d5[_0x784e('0xbb')]&&!this['actions'][_0x4605d5['linkedid']][_0x784e('0xe9')]){if(_0x4605d5[_0x784e('0x137')]==='1'){this[_0x784e('0x9b')](_0x4605d5,_0x4605d5['linkedid'],_0x4605d5[_0x784e('0x137')]);}}};Preview['prototype']['addVariable']=function(_0x172bf5,_0x790a83,_0x275686){if(this[_0x784e('0x15')][_0x172bf5]){if(_[_0x784e('0x6c')](this[_0x784e('0x15')][_0x172bf5][_0x784e('0x13f')])){this[_0x784e('0x15')][_0x172bf5][_0x784e('0x13f')]={};}this[_0x784e('0x15')][_0x172bf5]['variables'][_0x790a83]=_0x275686;}};Preview['prototype']['syncVarSet']=function(_0x432bc6){try{if(!_[_0x784e('0x6c')](_0x432bc6)){if(ut[_0x784e('0x140')](_['keys'](_0x432bc6[_0x784e('0x141')])[0x0])){this[_0x784e('0x142')](_0x432bc6['uniqueid'],_[_0x784e('0x143')](_0x432bc6['variable'])[0x0],_0x432bc6[_0x784e('0x144')]);}}}catch(_0xe67790){logger[_0x784e('0x145')](_0x784e('0x146'),util[_0x784e('0x147')](_0xe67790,{'showHidden':![],'depth':null}));}};Preview[_0x784e('0xe')][_0x784e('0x22')]=function(_0x1eda10){if(_0x1eda10){if(this[_0x784e('0x15')][_0x1eda10[_0x784e('0x148')]]){this[_0x784e('0x15')][_0x1eda10[_0x784e('0x148')]]['transfer']=!![];}}};Preview[_0x784e('0xe')][_0x784e('0x24')]=function(_0x136b77){if(_0x136b77){if(this['actions'][_0x136b77[_0x784e('0x149')]]){this[_0x784e('0x15')][_0x136b77[_0x784e('0x149')]]['transfer']=!![];}}};module[_0x784e('0x14a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index abb06ec..3182b57 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 _0xc46c=['resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','catch','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect'];(function(_0x2f92c9,_0x406ea2){var _0x12925f=function(_0x4066ce){while(--_0x4066ce){_0x2f92c9['push'](_0x2f92c9['shift']());}};_0x12925f(++_0x406ea2);}(_0xc46c,0xf9));var _0xcc46=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0xc46c[_0x1f4b18];return _0xde3957;};'use strict';var util=require(_0xcc46('0x0'));var BPromise=require(_0xcc46('0x1'));var logger=require(_0xcc46('0x2'))(_0xcc46('0x3'));var _=require('lodash');var cmHopper=require(_0xcc46('0x4'));var cmHopperFinal=require(_0xcc46('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xcc46('0x6'));var voiceQueueRt=require(_0xcc46('0x7'));var agentReportPreview=require(_0xcc46('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4ed56c){return function(_0x1dfd0f){logger[_0xcc46('0x9')](_0x4ed56c,util[_0xcc46('0xa')](_0x1dfd0f,{'showHidden':![],'depth':null}));};}function create(_0x125fa4){return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](cmHopperHistory[_0xcc46('0xd')](_0x125fa4))['catch'](loggerCatch(_0xcc46('0xe')));}function createAgent(_0x3c5f3d){return BPromise['resolve']()[_0xcc46('0xc')](agentReportPreview[_0xcc46('0xd')](_0x3c5f3d))['catch'](loggerCatch(_0xcc46('0xe')));}function moveContact(_0x2bc4af){return BPromise['resolve']()[_0xcc46('0xc')](cmHopper[_0xcc46('0xf')](_0x2bc4af,!![]))['catch'](loggerCatch(_0xcc46('0x10')));}exports['checkIsBlackList']=function(_0x1f49da){return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](cmHopperBlack[_0xcc46('0x11')](_0x1f49da))[_0xcc46('0x12')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xcc46('0x13')]=function(_0x4ecd73){return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](cmHopper['getContactPreview'](_0x4ecd73))['catch'](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x274604,_0x2906be){create(_0x274604)[_0xcc46('0x12')](loggerCatch(_0x2906be));moveContact(_0x274604)[_0xcc46('0x12')](loggerCatch(_0x2906be));};exports[_0xcc46('0x14')]=function(_0x32ec5f,_0x227ce8){createAgent(_0x32ec5f)[_0xcc46('0x12')](loggerCatch(_0x227ce8));};exports['createCustomerHistory']=function(_0x5d4c62,_0x3d2607){create(_0x5d4c62)['catch'](loggerCatch(_0x3d2607));};exports[_0xcc46('0x15')]=function(_0x1252e1,_0x1122bd){moveContact(_0x1252e1)['catch'](loggerCatch(_0x1122bd));};exports[_0xcc46('0x16')]=function(_0x4f0039,_0x19d53d,_0x4535e2){if(_0x19d53d){_0x4f0039[_0xcc46('0x17')]=null;}if(_0x4535e2){_0x4f0039[_0xcc46('0x18')]=![];}return BPromise[_0xcc46('0xb')]()['then'](cmHopper['rescheduleContact'](_0x4f0039))[_0xcc46('0x12')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xcc46('0x19')]=function(_0x43fe3e){return BPromise[_0xcc46('0xb')]()['then'](cmHopper[_0xcc46('0x19')](_0x43fe3e))[_0xcc46('0x12')](loggerCatch(_0xcc46('0x1a')));};exports['unlockContact']=function(_0x48e74d){return BPromise['resolve']()[_0xcc46('0xc')](cmHopper[_0xcc46('0x1b')]({'UserId':null},_0x48e74d,0x1))[_0xcc46('0x12')](loggerCatch(_0xcc46('0x1c')));};exports[_0xcc46('0x1d')]=function(_0x224b3b){return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](cmHopper[_0xcc46('0x1b')]({'active':![]},_0x224b3b,0x1))[_0xcc46('0x12')](loggerCatch(_0xcc46('0x1e')));};exports[_0xcc46('0x1f')]=function(_0x4ce130){var _0x2ede9b={};_0x2ede9b[_0xcc46('0x20')]=_0x4ce130[_0xcc46('0x20')];_0x2ede9b[_0xcc46('0x21')]=_0x4ce130[_0xcc46('0x21')];_0x2ede9b['calleridnum']=_0x4ce130[_0xcc46('0x22')];_0x2ede9b['calleridname']=_0x4ce130[_0xcc46('0x23')];_0x2ede9b[_0xcc46('0x24')]=_0x4ce130['queue'];_0x2ede9b['queuecallerjoinAt']=_0x4ce130['answertime'];_0x2ede9b['queuecallerleaveAt']=_0x4ce130[_0xcc46('0x25')];_0x2ede9b['queuecallercomplete']=0x1;_0x2ede9b[_0xcc46('0x26')]=_0x4ce130[_0xcc46('0x27')];_0x2ede9b[_0xcc46('0x28')]=_0x4ce130[_0xcc46('0x29')];_0x2ede9b[_0xcc46('0x2a')]='from-sip';_0x2ede9b['exten']=_0xcc46('0x2b');_0x2ede9b['holdtime']=0x0;_0x2ede9b[_0xcc46('0x2c')]=0x1;_0x2ede9b[_0xcc46('0x2d')]=_0x4ce130[_0xcc46('0x29')];_0x2ede9b[_0xcc46('0x2e')]=_0xcc46('0x2f');return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](voiceQueueReport[_0xcc46('0x30')](_0x2ede9b))[_0xcc46('0x12')](loggerCatch(_0xcc46('0x31')));};exports['getContactRecallMe']=function(_0x3204ae,_0xea99c2){return BPromise[_0xcc46('0xb')]()['then'](cmHopper['getContactRecallMe'](_0x3204ae,_0xea99c2))[_0xcc46('0x12')](loggerCatch(_0xcc46('0x32')));};exports[_0xcc46('0x33')]=function(_0x1c0d49){return BPromise[_0xcc46('0xb')]()[_0xcc46('0xc')](cmHopper[_0xcc46('0x16')](_0x1c0d49,!![],!![]))[_0xcc46('0x12')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x324b=['[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x36d2ef,_0x74bbe){var _0x5e3ecd=function(_0x5185fb){while(--_0x5185fb){_0x36d2ef['push'](_0x36d2ef['shift']());}};_0x5e3ecd(++_0x74bbe);}(_0x324b,0x195));var _0xb324=function(_0x462f33,_0x45533e){_0x462f33=_0x462f33-0x0;var _0x1e9e7a=_0x324b[_0x462f33];return _0x1e9e7a;};'use strict';var util=require(_0xb324('0x0'));var BPromise=require(_0xb324('0x1'));var logger=require(_0xb324('0x2'))(_0xb324('0x3'));var _=require(_0xb324('0x4'));var cmHopper=require(_0xb324('0x5'));var cmHopperFinal=require(_0xb324('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xb324('0x7'));var agentReportPreview=require(_0xb324('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x307512){return function(_0xeba544){logger[_0xb324('0x9')](_0x307512,util['inspect'](_0xeba544,{'showHidden':![],'depth':null}));};}function create(_0x28b057){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](cmHopperHistory[_0xb324('0xc')](_0x28b057))[_0xb324('0xd')](loggerCatch(_0xb324('0xe')));}function createAgent(_0x48c3c6){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](agentReportPreview[_0xb324('0xc')](_0x48c3c6))['catch'](loggerCatch(_0xb324('0xe')));}function moveContact(_0x4aad30){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](cmHopper[_0xb324('0xf')](_0x4aad30,!![]))[_0xb324('0xd')](loggerCatch(_0xb324('0x10')));}exports[_0xb324('0x11')]=function(_0x11ca3d){return BPromise[_0xb324('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0x11ca3d))['catch'](loggerCatch(_0xb324('0x12')));};exports[_0xb324('0x13')]=function(_0x19e0d8){return BPromise[_0xb324('0xa')]()['then'](cmHopper[_0xb324('0x13')](_0x19e0d8))[_0xb324('0xd')](loggerCatch(_0xb324('0x14')));};exports['createHistory']=function(_0xb6c0b8,_0x10036b){create(_0xb6c0b8)['catch'](loggerCatch(_0x10036b));moveContact(_0xb6c0b8)[_0xb324('0xd')](loggerCatch(_0x10036b));};exports[_0xb324('0x15')]=function(_0x497134,_0x2a8ecd){createAgent(_0x497134)[_0xb324('0xd')](loggerCatch(_0x2a8ecd));};exports[_0xb324('0x16')]=function(_0x5daadc,_0x17dd31){create(_0x5daadc)['catch'](loggerCatch(_0x17dd31));};exports['createCustomerFinal']=function(_0x3272dd,_0x59d6c1){moveContact(_0x3272dd)[_0xb324('0xd')](loggerCatch(_0x59d6c1));};exports[_0xb324('0x17')]=function(_0x5e67ba,_0x133943,_0x4aec9b){if(_0x133943){_0x5e67ba['UserId']=null;}if(_0x4aec9b){_0x5e67ba[_0xb324('0x18')]=![];}return BPromise[_0xb324('0xa')]()['then'](cmHopper['rescheduleContact'](_0x5e67ba))[_0xb324('0xd')](loggerCatch(_0xb324('0x19')));};exports[_0xb324('0x1a')]=function(_0x3668e1){return BPromise['resolve']()[_0xb324('0xb')](cmHopper[_0xb324('0x1a')](_0x3668e1))[_0xb324('0xd')](loggerCatch(_0xb324('0x1b')));};exports[_0xb324('0x1c')]=function(_0x40e5d6){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](cmHopper[_0xb324('0x1c')]({'UserId':null},_0x40e5d6,0x1))[_0xb324('0xd')](loggerCatch(_0xb324('0x1d')));};exports[_0xb324('0x1e')]=function(_0x5668ef){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](cmHopper[_0xb324('0x1c')]({'active':![]},_0x5668ef,0x1))[_0xb324('0xd')](loggerCatch(_0xb324('0x1f')));};exports['crateCustomerReportQueue']=function(_0x27e3a7){var _0x6bd880={};_0x6bd880[_0xb324('0x20')]=_0x27e3a7[_0xb324('0x20')];_0x6bd880[_0xb324('0x21')]=_0x27e3a7[_0xb324('0x21')];_0x6bd880[_0xb324('0x22')]=_0x27e3a7['calleridnum'];_0x6bd880[_0xb324('0x23')]=_0x27e3a7[_0xb324('0x23')];_0x6bd880[_0xb324('0x24')]=_0x27e3a7[_0xb324('0x24')];_0x6bd880['queuecallerjoinAt']=_0x27e3a7['answertime'];_0x6bd880[_0xb324('0x25')]=_0x27e3a7[_0xb324('0x26')];_0x6bd880[_0xb324('0x27')]=0x1;_0x6bd880[_0xb324('0x28')]=_0x27e3a7[_0xb324('0x29')];_0x6bd880['connectedlinename']=_0x27e3a7[_0xb324('0x2a')];_0x6bd880[_0xb324('0x2b')]='from-sip';_0x6bd880[_0xb324('0x2c')]='xcally-motion-preview';_0x6bd880[_0xb324('0x2d')]=0x0;_0x6bd880['assigned']=0x1;_0x6bd880[_0xb324('0x2e')]=_0x27e3a7['membername'];_0x6bd880[_0xb324('0x2f')]=_0xb324('0x30');return BPromise['resolve']()[_0xb324('0xb')](voiceQueueReport[_0xb324('0x31')](_0x6bd880))[_0xb324('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xb324('0x32')]=function(_0x3cf243,_0x3d0c36){return BPromise['resolve']()['then'](cmHopper[_0xb324('0x32')](_0x3cf243,_0x3d0c36))['catch'](loggerCatch(_0xb324('0x33')));};exports[_0xb324('0x34')]=function(_0x5d8346){return BPromise[_0xb324('0xa')]()[_0xb324('0xb')](cmHopper['rescheduleContact'](_0x5d8346,!![],!![]))['catch'](loggerCatch(_0xb324('0x35')));}; \ 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 2f8ec72..9829686 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 _0x7b6e=['seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','starttime','membername','UserId','logCustomer','state','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','active','add','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','filterKey','idContact','type','campaigntype','dialAnswer','calleridname','scheduledat','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','preview','env','XCALLY_IP_AGI','milliseconds','diff'];(function(_0x17e91d,_0x3937b5){var _0x139c39=function(_0x17952a){while(--_0x17952a){_0x17e91d['push'](_0x17e91d['shift']());}};_0x139c39(++_0x3937b5);}(_0x7b6e,0x89));var _0xe7b6=function(_0x31bad1,_0x163160){_0x31bad1=_0x31bad1-0x0;var _0x30c64e=_0x7b6e[_0x31bad1];return _0x30c64e;};'use strict';var util=require('util');var _=require(_0xe7b6('0x0'));var moment=require(_0xe7b6('0x1'));var logger=require('../../../../config/logger')(_0xe7b6('0x2'));var ipAgi=process[_0xe7b6('0x3')][_0xe7b6('0x4')]||'127.0.0.1';function getSeconds(_0x1e2b5b,_0x33d7c8){var _0x30dfce=moment(_0x1e2b5b)['milliseconds'](0x0);var _0xfea7e=moment(_0x33d7c8)[_0xe7b6('0x5')](0x0);return _0x30dfce[_0xe7b6('0x6')](_0xfea7e,_0xe7b6('0x7'));}exports[_0xe7b6('0x8')]=function(_0x41ae8e){return function(_0x1e08ef){logger['error'](_0x41ae8e,util[_0xe7b6('0x9')](_0x1e08ef,{'showHidden':![],'depth':null}));};};exports[_0xe7b6('0xa')]=function(_0x352dfd,_0x2e6801){logger[_0xe7b6('0xb')](_0x352dfd,util['inspect'](_0x2e6801,{'showHidden':![],'depth':null}));};exports[_0xe7b6('0xc')]=function(_0x2a5983,_0x134bd1){logger[_0xe7b6('0xd')](_0x2a5983,util[_0xe7b6('0x9')](_0x134bd1,{'showHidden':![],'depth':null}));};exports[_0xe7b6('0xe')]=function(_0x5228d5){return function(_0x5117d4){logger[_0xe7b6('0xb')](_0x5228d5,util['inspect'](_0x5117d4,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4c32bb,_0x498c5c,_0xf770e7){return{'message':_0x4c32bb,'unlock':_0x498c5c,'active':_0xf770e7};};exports[_0xe7b6('0xf')]=function(_0x53605b,_0xe97c46,_0x4c9669){if(!_[_0xe7b6('0x10')](_0x4c9669)&&_0xe7b6('0x11')===typeof _0x4c9669&&!_[_0xe7b6('0x12')](_0x4c9669)){if(!_[_0xe7b6('0x10')](_0xe97c46)&&_0xe7b6('0x11')===typeof _0xe97c46&&!_[_0xe7b6('0x12')](_0xe97c46)){return util[_0xe7b6('0x13')](_0xe7b6('0x14'),_0xe97c46,_0x4c9669);}return util[_0xe7b6('0x13')]('\x22%s\x22\x20<%s>',_0x4c9669,_0x4c9669);}if(!_['isUndefined'](_0x53605b)&&_0xe7b6('0x11')===typeof _0x53605b&&!_[_0xe7b6('0x12')](_0x53605b)){return _0x53605b;}return _0xe7b6('0x15');};exports[_0xe7b6('0x16')]=function(_0x4e30ca){if(_[_0xe7b6('0x17')](_0x4e30ca)){return![];}return _0x4e30ca;};exports[_0xe7b6('0x18')]=function(_0x4057da,_0x3477d9,_0x532efa,_0x5eedcf,_0x2e1610,_0x2998cd){var _0x2daf35={'XMD-QUEUE':_0x3477d9[_0xe7b6('0x19')]?_0x3477d9[_0xe7b6('0x19')][_0xe7b6('0x1a')]:'','XMD-CALLERID':_0x5eedcf,'XMD-CALLERID-PREVIEW':_0x2998cd?util[_0xe7b6('0x13')](_0xe7b6('0x14'),_0x2998cd['calleridname'],_0x2998cd[_0xe7b6('0x1b')]):_0x5eedcf,'XMD-DIALID':_0x2e1610,'XMD-CONTACTID':_0x3477d9['ContactId'],'XMD-CDRTYPE':_0xe7b6('0x1c'),'CALLERID(all)':_0x5eedcf,'XMD-VOICEQUEUEID':_0x3477d9[_0xe7b6('0x1d')],'XMD-DIALCHANNEL':_0x532efa,'XMD-DIALTIMEOUT':_0x4057da[_0xe7b6('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x4057da[_0xe7b6('0x1f')]?'g':'',_['isEmpty'](_0x4057da[_0xe7b6('0x20')])?'':_0xe7b6('0x21')),'XMD-DIALURL':_0x4057da[_0xe7b6('0x22')]||'','XMD-AGI':_0x4057da[_0xe7b6('0x23')]?util['format'](_0xe7b6('0x24'),ipAgi,_0x4057da[_0xe7b6('0x23')]):_0xe7b6('0x25'),'XMD-AGIAFTER':_0x4057da['dialQueueProject2']?util[_0xe7b6('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4057da['dialQueueProject2']):_0xe7b6('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x2998cd?_0x2998cd[_0xe7b6('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x2998cd?_0x2998cd[_0xe7b6('0x27')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xe7b6('0x28')};if(!_[_0xe7b6('0x12')](_0x4057da['monitor_format'])){_0x2daf35[util[_0xe7b6('0x13')]('%s',_0xe7b6('0x29'))]=_0x4057da[_0xe7b6('0x20')];_0x2daf35[util[_0xe7b6('0x13')]('%s',_0xe7b6('0x2a'))]=_0x2e1610;}if(_0x3477d9&&_0x3477d9[_0xe7b6('0x2b')]){for(var _0x20d925 in _0x3477d9[_0xe7b6('0x2b')]){if(_0x3477d9[_0xe7b6('0x2b')][_0xe7b6('0x2c')](_0x20d925)){if(!_['isNil'](_0x3477d9[_0xe7b6('0x2b')][_0x20d925])&&_0x20d925!=='id'&&_0x20d925!==_0xe7b6('0x2d')&&_0x20d925!==_0xe7b6('0x2e')&&_0x20d925!=='updatedAt'){_0x2daf35[util[_0xe7b6('0x13')](_0xe7b6('0x2f'),_0xe7b6('0x30'),_[_0xe7b6('0x31')](_0x20d925))]=_0x3477d9[_0xe7b6('0x2b')][_0x20d925];}}}}return _0x2daf35;};exports[_0xe7b6('0x32')]=function(_0x507897){var _0x146cb6={};for(var _0x53107c in _0x507897){if(_0x507897[_0xe7b6('0x2c')](_0x53107c)){_0x146cb6[util[_0xe7b6('0x13')]('%s',_[_0xe7b6('0x33')](_0x53107c))]=_0x507897[_0x53107c];}}return{'variables':_0x146cb6};};exports[_0xe7b6('0x34')]=function(_0x34b565,_0x34cde7){if(!_[_0xe7b6('0x17')](_0x34b565)){if(_0x34b565[_0xe7b6('0x2c')](_0xe7b6('0x35'))){if(_0x34b565['originated']>0x0){_0x34b565[_0xe7b6('0x35')]-=0x1;}else{logger['error'](_0xe7b6('0x36'),_0x34cde7);}}}else{logger[_0xe7b6('0xd')](_0xe7b6('0x37'),_0x34cde7);}};exports[_0xe7b6('0x38')]=function(_0x2de249){var _0x58f4ea=moment()[_0xe7b6('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2de249['state']=0xd;_0x2de249[_0xe7b6('0x39')]='Blacklist';_0x2de249['starttime']=_0x58f4ea;_0x2de249['responsetime']=_0x58f4ea;_0x2de249[_0xe7b6('0x3a')]=_0x58f4ea;};exports[_0xe7b6('0x3b')]=function(_0xb8bd6c,_0x42ae7d,_0x49f45a){var _0x1f80de=moment()[_0xe7b6('0x13')](_0xe7b6('0x3c'));_0xb8bd6c['state']=_0x42ae7d;_0xb8bd6c[_0xe7b6('0x39')]=_0x49f45a;_0xb8bd6c[_0xe7b6('0x3d')]=_0x1f80de;_0xb8bd6c[_0xe7b6('0x3e')]=getSeconds(_0xb8bd6c[_0xe7b6('0x3d')],_0xb8bd6c[_0xe7b6('0x3f')]);};exports['logLookAgent']=function(_0x55e2f1,_0x409c11,_0x32dae3){_0x55e2f1[_0xe7b6('0x40')]=_0x409c11;_0x55e2f1[_0xe7b6('0x41')]=_0x32dae3;};exports[_0xe7b6('0x42')]=function(_0x5af286,_0x9271c0,_0x162fe0){var _0xc8bb20=moment()[_0xe7b6('0x13')](_0xe7b6('0x3c'));_0x5af286[_0xe7b6('0x43')]=_0x9271c0;_0x5af286['statedesc']=_0x162fe0;_0x5af286[_0xe7b6('0x3d')]=_0x5af286[_0xe7b6('0x3d')]?_0x5af286['responsetime']:_0xc8bb20;_0x5af286[_0xe7b6('0x3a')]=_0x5af286[_0xe7b6('0x3a')]?_0x5af286[_0xe7b6('0x3a')]:_0xc8bb20;_0x5af286[_0xe7b6('0x3e')]=getSeconds(_0x5af286[_0xe7b6('0x3d')]||0x0,_0x5af286[_0xe7b6('0x3f')]||0x0);_0x5af286[_0xe7b6('0x44')]=_0x5af286[_0xe7b6('0x45')]?getSeconds(_0x5af286[_0xe7b6('0x3a')],_0x5af286['answertime']):0x0;};exports[_0xe7b6('0x46')]=function(_0x411f3e){return _0x411f3e===_0xe7b6('0x47');};exports[_0xe7b6('0x48')]=function(_0x2a81a8,_0x51c068,_0x10557e,_0xc1a2a8,_0x10bc03){var _0x251c84=_0xc1a2a8?'RECALL':_0x2a81a8['calleridname'];_0x251c84=_0x10bc03?_0xe7b6('0x49'):_0x251c84;return{'actionid':_0x2a81a8[_0xe7b6('0x4a')],'action':_0xe7b6('0x4b'),'channel':_0x2a81a8[_0xe7b6('0x4c')],'callerid':util[_0xe7b6('0x13')](_0xe7b6('0x14'),_0x251c84,_0x2a81a8[_0xe7b6('0x1b')]),'Exten':_0xe7b6('0x4d'),'Context':'from-sip','Priority':'1','variable':_0x10557e,'timeout':(_0x51c068[_0xe7b6('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2a81a8['uniqueid']};};exports[_0xe7b6('0x4f')]=function(_0x3dec43){return _0x3dec43[_0xe7b6('0x50')]+_0x3dec43['countcongestionretry']+_0x3dec43[_0xe7b6('0x51')]+_0x3dec43[_0xe7b6('0x52')]+_0x3dec43[_0xe7b6('0x53')];};exports['cloneAction']=function(_0x4f37dc){var _0x2949c=_[_0xe7b6('0x54')](_0x4f37dc);_0x2949c[_0xe7b6('0x43')]=0xf;_0x2949c[_0xe7b6('0x39')]='Global';return _0x2949c;};exports[_0xe7b6('0x55')]=function(_0x23595e,_0x3fde69,_0x32f242){var _0x2a1fb7={};_0x2a1fb7[_0x3fde69]=_0x23595e[_0x3fde69];_0x2a1fb7[_0xe7b6('0x56')]=![];_0x2a1fb7['scheduledat']=moment()[_0xe7b6('0x57')](_0x32f242,'minutes')[_0xe7b6('0x13')](_0xe7b6('0x3c'));_0x2a1fb7['ContactId']=_0x23595e[_0xe7b6('0x58')];_0x2a1fb7[_0xe7b6('0x59')]=_0x23595e['ListId'];_0x2a1fb7[_0xe7b6('0x1d')]=_0x23595e[_0xe7b6('0x1d')]||undefined;return _0x2a1fb7;};exports[_0xe7b6('0x5a')]=function(_0x5b3679,_0x3b608c){if(!_[_0xe7b6('0x17')](_0x5b3679)){if(_0x5b3679['pTalking']>0x0){_0x5b3679[_0xe7b6('0x5b')]-=0x1;}else{logger['error'](_0x3b608c,_0xe7b6('0x5c'));}}else{logger[_0xe7b6('0xd')](_0x3b608c,_0xe7b6('0x5d'));}};exports[_0xe7b6('0x5e')]=function(_0x564749){if(_0x564749<=0x0){return!![];}return![];};exports[_0xe7b6('0x5f')]=function(_0x173e24,_0x2a6ef3,_0x5ea401){_0x173e24['lastevent']=_0x2a6ef3;_0x173e24[_0xe7b6('0x1a')]=_0x173e24[_0xe7b6('0x60')];_0x173e24[_0xe7b6('0x61')]=_0x173e24[_0xe7b6('0x4c')];_0x173e24['motionChannel']=_0xe7b6('0x62');if(_0x5ea401){_0x173e24[_0xe7b6('0x63')]=_0x5ea401['mandatoryDisposition'];}return _0x173e24;};exports[_0xe7b6('0x64')]=function(_0x21d0c5){var _0x3cee16={};_0x3cee16[_0xe7b6('0x60')]=_0x21d0c5[_0xe7b6('0x60')];_0x3cee16['interface']=_0x21d0c5['channelAgent'];_0x3cee16[_0xe7b6('0x4a')]=_0x21d0c5['uniqueid'];return _0x3cee16;};exports[_0xe7b6('0x65')]=function(_0x4f07e9){var _0x1dbbd4=[];for(var _0x18e5c1 in _0x4f07e9){if(_0x4f07e9['hasOwnProperty'](_0x18e5c1)){if(!_[_0xe7b6('0x17')](_0x4f07e9[_0x18e5c1])&&_0x4f07e9[_0x18e5c1][_0xe7b6('0x43')]===_0xe7b6('0x66')&&_0x4f07e9[_0x18e5c1][_0xe7b6('0x67')]===_0xe7b6('0x68')){_0x1dbbd4[_0xe7b6('0x69')](_0x4f07e9[_0x18e5c1]['id']);}}}return _0x1dbbd4;};exports[_0xe7b6('0x6a')]=function(_0x2c7bf3){var _0x327360=moment()[_0xe7b6('0x5')](0x0);var _0x28f0b7=moment(_0x2c7bf3)[_0xe7b6('0x5')](0x0);return _0x327360['diff'](_0x28f0b7,_0xe7b6('0x7'));};exports['createBody']=function(_0x553696){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x553696[_0xe7b6('0x58')],'ListId':_0x553696[_0xe7b6('0x59')],'VoiceQueueId':_0x553696[_0xe7b6('0x1d')]||undefined,'CampaignId':_0x553696['CampaignId']||undefined};};exports[_0xe7b6('0x6b')]=function(_0x2e2ed3){if(_0x2e2ed3===_0xe7b6('0x4a')||_0x2e2ed3===_0xe7b6('0x6c')||_0x2e2ed3===_0xe7b6('0x60')||_0x2e2ed3===_0xe7b6('0x6d')||_0x2e2ed3===_0xe7b6('0x6e')||_0x2e2ed3===_0xe7b6('0x6f')||_0x2e2ed3==='membername'||_0x2e2ed3===_0xe7b6('0x4c')||_0x2e2ed3===_0xe7b6('0x70')||_0x2e2ed3===_0xe7b6('0x56')||_0x2e2ed3===_0xe7b6('0x1b')||_0x2e2ed3===_0xe7b6('0x71')||_0x2e2ed3===_0xe7b6('0x50')||_0x2e2ed3===_0xe7b6('0x72')||_0x2e2ed3===_0xe7b6('0x51')||_0x2e2ed3==='countglobal'||_0x2e2ed3===_0xe7b6('0x73')||_0x2e2ed3===_0xe7b6('0x74')||_0x2e2ed3===_0xe7b6('0x75')||_0x2e2ed3===_0xe7b6('0x76')||_0x2e2ed3===_0xe7b6('0x58')||_0x2e2ed3==='ListId'||_0x2e2ed3===_0xe7b6('0x41')||_0x2e2ed3===_0xe7b6('0x1d')||_0x2e2ed3===_0xe7b6('0x77')||_0x2e2ed3==='xmd-voicequeueid'||_0x2e2ed3==='xmd-queue'||_0x2e2ed3===_0xe7b6('0x78')||_0x2e2ed3==='xmd-listid'||_0x2e2ed3==='xmd-dialurl'||_0x2e2ed3===_0xe7b6('0x79')||_0x2e2ed3===_0xe7b6('0x7a')||_0x2e2ed3===_0xe7b6('0x7b')||_0x2e2ed3===_0xe7b6('0x7c')||_0x2e2ed3===_0xe7b6('0x7d')||_0x2e2ed3===_0xe7b6('0x7e')||_0x2e2ed3===_0xe7b6('0x7f')||_0x2e2ed3===_0xe7b6('0x80')||_0x2e2ed3==='xmd-agi'||_0x2e2ed3===_0xe7b6('0x81')||_0x2e2ed3==='rtpaudioqosbridged'||_0x2e2ed3===_0xe7b6('0x82')||_0x2e2ed3==='rtpaudioqosjitterbridged'||_0x2e2ed3===_0xe7b6('0x83')||_0x2e2ed3===_0xe7b6('0x84')||_0x2e2ed3===_0xe7b6('0x85')||_0x2e2ed3===_0xe7b6('0x86')||_0x2e2ed3===_0xe7b6('0x81')||_0x2e2ed3===_0xe7b6('0x87')||_0x2e2ed3===_0xe7b6('0x82')||_0x2e2ed3==='rtpaudioqosjitterbridged'||_0x2e2ed3===_0xe7b6('0x83')||_0x2e2ed3===_0xe7b6('0x84')||_0x2e2ed3==='rtpaudioqosrtt'||_0x2e2ed3==='rtpaudioqosrttbridged'||_0x2e2ed3==='bridgepeer'||_0x2e2ed3===_0xe7b6('0x88')||_0x2e2ed3===_0xe7b6('0x43')||_0x2e2ed3===_0xe7b6('0x39')){return![];}return!![];};exports[_0xe7b6('0x89')]=function(_0x4bc4a7,_0x3c9f55){var _0x1f533f,_0x5ddb8b,_0x52fac0;if(_0x3c9f55<=0x0){_0x3c9f55=0x1;}_0x1f533f=new RegExp('\x5cw{0,'+_0x3c9f55+'}$');_0x5ddb8b=Math['pow'](0xa,_0x3c9f55-0x1);_0x52fac0=Math[_0xe7b6('0x8a')](0xa,_0x3c9f55)-0x1;return util[_0xe7b6('0x13')]('%s',_[_0xe7b6('0x8b')](_0x4bc4a7,_0x1f533f,_[_0xe7b6('0x8c')](_0x5ddb8b,_0x52fac0)));};exports[_0xe7b6('0x8d')]=function(_0x374a1f){var _0x1bf7d7=_0x374a1f[_0xe7b6('0x8e')](/"(.*?)"/);return _0x1bf7d7?_0x1bf7d7[0x1]:_0x374a1f;};exports[_0xe7b6('0x8f')]=function(_0x2bec0b){var _0x3051fb=_0x2bec0b['match'](/<(.*?)>/);return _0x3051fb?_0x3051fb[0x1]:_0x2bec0b;}; \ No newline at end of file +var _0x5567=['extractCalleridNumber','match','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','loggerError','error','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','reachable','getDiff','createBody','ListId','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countcongestionretry','countglobal','callback','callbackat','recallme','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','pow','replace','random','extractCalleridName'];(function(_0x584ca3,_0x498aaa){var _0x1d26a0=function(_0x2e2531){while(--_0x2e2531){_0x584ca3['push'](_0x584ca3['shift']());}};_0x1d26a0(++_0x498aaa);}(_0x5567,0x19d));var _0x7556=function(_0x1455cf,_0x227ec7){_0x1455cf=_0x1455cf-0x0;var _0x1da0cb=_0x5567[_0x1455cf];return _0x1da0cb;};'use strict';var util=require('util');var _=require(_0x7556('0x0'));var moment=require(_0x7556('0x1'));var logger=require('../../../../config/logger')(_0x7556('0x2'));var ipAgi=process['env'][_0x7556('0x3')]||_0x7556('0x4');function getSeconds(_0xce3853,_0x16ab47){var _0x5058c6=moment(_0xce3853)[_0x7556('0x5')](0x0);var _0x4f3f1f=moment(_0x16ab47)[_0x7556('0x5')](0x0);return _0x5058c6[_0x7556('0x6')](_0x4f3f1f,_0x7556('0x7'));}exports[_0x7556('0x8')]=function(_0x35edb2){return function(_0x320f48){logger['error'](_0x35edb2,util[_0x7556('0x9')](_0x320f48,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5c4d05,_0x2b9785){logger['info'](_0x5c4d05,util[_0x7556('0x9')](_0x2b9785,{'showHidden':![],'depth':null}));};exports[_0x7556('0xa')]=function(_0x373d1b,_0x24a4b7){logger[_0x7556('0xb')](_0x373d1b,util['inspect'](_0x24a4b7,{'showHidden':![],'depth':null}));};exports[_0x7556('0xc')]=function(_0x499716){return function(_0x49986e){logger['info'](_0x499716,util[_0x7556('0x9')](_0x49986e,{'showHidden':![],'depth':null}));};};exports[_0x7556('0xd')]=function(_0x429ce6,_0x35033c,_0x3e43cf){return{'message':_0x429ce6,'unlock':_0x35033c,'active':_0x3e43cf};};exports[_0x7556('0xe')]=function(_0x2f3e93,_0x38b488,_0x481dc0){if(!_[_0x7556('0xf')](_0x481dc0)&&'string'===typeof _0x481dc0&&!_[_0x7556('0x10')](_0x481dc0)){if(!_[_0x7556('0xf')](_0x38b488)&&_0x7556('0x11')===typeof _0x38b488&&!_[_0x7556('0x10')](_0x38b488)){return util['format']('\x22%s\x22\x20<%s>',_0x38b488,_0x481dc0);}return util[_0x7556('0x12')](_0x7556('0x13'),_0x481dc0,_0x481dc0);}if(!_['isUndefined'](_0x2f3e93)&&_0x7556('0x11')===typeof _0x2f3e93&&!_[_0x7556('0x10')](_0x2f3e93)){return _0x2f3e93;}return _0x7556('0x14');};exports[_0x7556('0x15')]=function(_0x4479c0){if(_[_0x7556('0x16')](_0x4479c0)){return![];}return _0x4479c0;};exports[_0x7556('0x17')]=function(_0x3e5971,_0xa1f897,_0xccf928,_0x1907c5,_0x293e43,_0x3c64a4){var _0x1f6a5f={'XMD-QUEUE':_0xa1f897[_0x7556('0x18')]?_0xa1f897[_0x7556('0x18')][_0x7556('0x19')]:'','XMD-CALLERID':_0x1907c5,'XMD-CALLERID-PREVIEW':_0x3c64a4?util['format']('\x22%s\x22\x20<%s>',_0x3c64a4[_0x7556('0x1a')],_0x3c64a4[_0x7556('0x1b')]):_0x1907c5,'XMD-DIALID':_0x293e43,'XMD-CONTACTID':_0xa1f897[_0x7556('0x1c')],'XMD-CDRTYPE':_0x7556('0x1d'),'CALLERID(all)':_0x1907c5,'XMD-VOICEQUEUEID':_0xa1f897[_0x7556('0x1e')],'XMD-DIALCHANNEL':_0xccf928,'XMD-DIALTIMEOUT':_0x3e5971[_0x7556('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x7556('0x12')](_0x7556('0x20'),_0x3e5971[_0x7556('0x21')]?'g':'',_[_0x7556('0x10')](_0x3e5971['monitor_format'])?'':_0x7556('0x22')),'XMD-DIALURL':_0x3e5971[_0x7556('0x23')]||'','XMD-AGI':_0x3e5971[_0x7556('0x24')]?util['format'](_0x7556('0x25'),ipAgi,_0x3e5971[_0x7556('0x24')]):'NONE','XMD-AGIAFTER':_0x3e5971[_0x7556('0x21')]?util[_0x7556('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3e5971[_0x7556('0x21')]):_0x7556('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x3c64a4?_0x3c64a4[_0x7556('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x3c64a4?_0x3c64a4[_0x7556('0x28')]:'','XMD-DESTINATION':_0x7556('0x29'),'SIPADDHEADER':_0x7556('0x2a')};if(!_[_0x7556('0x10')](_0x3e5971[_0x7556('0x2b')])){_0x1f6a5f[util[_0x7556('0x12')]('%s',_0x7556('0x2c'))]=_0x3e5971[_0x7556('0x2b')];_0x1f6a5f[util[_0x7556('0x12')]('%s',_0x7556('0x2d'))]=_0x293e43;}if(_0xa1f897&&_0xa1f897['Contact']){for(var _0x3bf45c in _0xa1f897['Contact']){if(_0xa1f897['Contact']['hasOwnProperty'](_0x3bf45c)){if(!_[_0x7556('0x16')](_0xa1f897['Contact'][_0x3bf45c])&&_0x3bf45c!=='id'&&_0x3bf45c!==_0x7556('0x2e')&&_0x3bf45c!==_0x7556('0x2f')&&_0x3bf45c!==_0x7556('0x30')){_0x1f6a5f[util['format'](_0x7556('0x31'),_0x7556('0x32'),_[_0x7556('0x33')](_0x3bf45c))]=_0xa1f897['Contact'][_0x3bf45c];}}}}return _0x1f6a5f;};exports[_0x7556('0x34')]=function(_0x4b8d34){var _0x595b5e={};for(var _0x3f54f2 in _0x4b8d34){if(_0x4b8d34[_0x7556('0x35')](_0x3f54f2)){_0x595b5e[util[_0x7556('0x12')]('%s',_[_0x7556('0x36')](_0x3f54f2))]=_0x4b8d34[_0x3f54f2];}}return{'variables':_0x595b5e};};exports[_0x7556('0x37')]=function(_0x40393b,_0x1c9c1e){if(!_[_0x7556('0x16')](_0x40393b)){if(_0x40393b[_0x7556('0x35')](_0x7556('0x38'))){if(_0x40393b[_0x7556('0x38')]>0x0){_0x40393b[_0x7556('0x38')]-=0x1;}else{logger[_0x7556('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1c9c1e);}}}else{logger[_0x7556('0xb')](_0x7556('0x39'),_0x1c9c1e);}};exports[_0x7556('0x3a')]=function(_0x1b439c){var _0x1b2512=moment()[_0x7556('0x12')](_0x7556('0x3b'));_0x1b439c[_0x7556('0x3c')]=0xd;_0x1b439c['statedesc']=_0x7556('0x3d');_0x1b439c[_0x7556('0x3e')]=_0x1b2512;_0x1b439c[_0x7556('0x3f')]=_0x1b2512;_0x1b439c[_0x7556('0x40')]=_0x1b2512;};exports[_0x7556('0x41')]=function(_0x311e27,_0x523c7a,_0x3b2006){var _0x228f2b=moment()['format'](_0x7556('0x3b'));_0x311e27[_0x7556('0x3c')]=_0x523c7a;_0x311e27[_0x7556('0x42')]=_0x3b2006;_0x311e27['responsetime']=_0x228f2b;_0x311e27[_0x7556('0x43')]=getSeconds(_0x311e27[_0x7556('0x3f')],_0x311e27[_0x7556('0x3e')]);};exports[_0x7556('0x44')]=function(_0x23d082,_0xaaabb,_0x125621){_0x23d082[_0x7556('0x45')]=_0xaaabb;_0x23d082[_0x7556('0x46')]=_0x125621;};exports['logCustomer']=function(_0x440a8f,_0xd3734d,_0x38b5a7){var _0x4e07e3=moment()[_0x7556('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x440a8f[_0x7556('0x3c')]=_0xd3734d;_0x440a8f[_0x7556('0x42')]=_0x38b5a7;_0x440a8f[_0x7556('0x3f')]=_0x440a8f[_0x7556('0x3f')]?_0x440a8f[_0x7556('0x3f')]:_0x4e07e3;_0x440a8f[_0x7556('0x40')]=_0x440a8f[_0x7556('0x40')]?_0x440a8f[_0x7556('0x40')]:_0x4e07e3;_0x440a8f[_0x7556('0x43')]=getSeconds(_0x440a8f[_0x7556('0x3f')]||0x0,_0x440a8f[_0x7556('0x3e')]||0x0);_0x440a8f[_0x7556('0x47')]=_0x440a8f[_0x7556('0x48')]?getSeconds(_0x440a8f[_0x7556('0x40')],_0x440a8f['answertime']):0x0;};exports[_0x7556('0x49')]=function(_0x451647){return _0x451647===_0x7556('0x4a');};exports[_0x7556('0x4b')]=function(_0x110856,_0x5afefc,_0x3d4f31,_0x315683,_0x4fef57){var _0x5809a4=_0x315683?'RECALL':_0x110856['calleridname'];_0x5809a4=_0x4fef57?_0x7556('0x4c'):_0x5809a4;return{'actionid':_0x110856[_0x7556('0x4d')],'action':_0x7556('0x4e'),'channel':_0x110856[_0x7556('0x4f')],'callerid':util[_0x7556('0x12')](_0x7556('0x13'),_0x5809a4,_0x110856['calleridnum']),'Exten':_0x7556('0x29'),'Context':'from-sip','Priority':'1','variable':_0x3d4f31,'timeout':(_0x5afefc[_0x7556('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x110856[_0x7556('0x4d')]};};exports['totalGlobal']=function(_0x26dfeb){return _0x26dfeb[_0x7556('0x51')]+_0x26dfeb['countcongestionretry']+_0x26dfeb[_0x7556('0x52')]+_0x26dfeb[_0x7556('0x53')]+_0x26dfeb[_0x7556('0x54')];};exports[_0x7556('0x55')]=function(_0x64cce){var _0x5d5b22=_['clone'](_0x64cce);_0x5d5b22[_0x7556('0x3c')]=0xf;_0x5d5b22[_0x7556('0x42')]=_0x7556('0x56');return _0x5d5b22;};exports[_0x7556('0x57')]=function(_0x3e71f9,_0x4fcff7,_0x1cef61){var _0x161a1a={};_0x161a1a[_0x4fcff7]=_0x3e71f9[_0x4fcff7];_0x161a1a['active']=![];_0x161a1a[_0x7556('0x58')]=moment()[_0x7556('0x59')](_0x1cef61,_0x7556('0x5a'))['format'](_0x7556('0x3b'));_0x161a1a[_0x7556('0x1c')]=_0x3e71f9[_0x7556('0x1c')];_0x161a1a['ListId']=_0x3e71f9['ListId'];_0x161a1a[_0x7556('0x1e')]=_0x3e71f9['VoiceQueueId']||undefined;return _0x161a1a;};exports['decrementTalkink']=function(_0x1740aa,_0xfd8090){if(!_[_0x7556('0x16')](_0x1740aa)){if(_0x1740aa[_0x7556('0x5b')]>0x0){_0x1740aa[_0x7556('0x5b')]-=0x1;}else{logger[_0x7556('0xb')](_0xfd8090,_0x7556('0x5c'));}}else{logger[_0x7556('0xb')](_0xfd8090,_0x7556('0x5d'));}};exports[_0x7556('0x5e')]=function(_0x269d45){if(_0x269d45<=0x0){return!![];}return![];};exports['buildObj']=function(_0x391ccd,_0x3120d5,_0x2e8e1d){_0x391ccd['lastevent']=_0x3120d5;_0x391ccd[_0x7556('0x19')]=_0x391ccd[_0x7556('0x5f')];_0x391ccd['interface']=_0x391ccd[_0x7556('0x4f')];_0x391ccd[_0x7556('0x60')]=_0x7556('0x61');if(_0x2e8e1d){_0x391ccd[_0x7556('0x62')]=_0x2e8e1d['mandatoryDisposition'];}return _0x391ccd;};exports[_0x7556('0x63')]=function(_0x31c20d){var _0x501d03={};_0x501d03['queue']=_0x31c20d['queue'];_0x501d03[_0x7556('0x64')]=_0x31c20d[_0x7556('0x4f')];_0x501d03['uniqueid']=_0x31c20d['uniqueid'];return _0x501d03;};exports[_0x7556('0x65')]=function(_0x43ec02){var _0x4df8d4=[];for(var _0x5159eb in _0x43ec02){if(_0x43ec02[_0x7556('0x35')](_0x5159eb)){if(!_[_0x7556('0x16')](_0x43ec02[_0x5159eb])&&_0x43ec02[_0x5159eb][_0x7556('0x3c')]==='not_inuse'&&_0x43ec02[_0x5159eb]['status']===_0x7556('0x66')){_0x4df8d4['push'](_0x43ec02[_0x5159eb]['id']);}}}return _0x4df8d4;};exports[_0x7556('0x67')]=function(_0xd7bb06){var _0x19602a=moment()['milliseconds'](0x0);var _0x365e9c=moment(_0xd7bb06)[_0x7556('0x5')](0x0);return _0x19602a[_0x7556('0x6')](_0x365e9c,'seconds');};exports[_0x7556('0x68')]=function(_0x2136af){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2136af[_0x7556('0x1c')],'ListId':_0x2136af[_0x7556('0x69')],'VoiceQueueId':_0x2136af['VoiceQueueId']||undefined,'CampaignId':_0x2136af[_0x7556('0x6a')]||undefined};};exports[_0x7556('0x6b')]=function(_0x4bc0b0){if(_0x4bc0b0===_0x7556('0x4d')||_0x4bc0b0===_0x7556('0x6c')||_0x4bc0b0===_0x7556('0x5f')||_0x4bc0b0==='type'||_0x4bc0b0===_0x7556('0x6d')||_0x4bc0b0===_0x7556('0x6e')||_0x4bc0b0==='membername'||_0x4bc0b0===_0x7556('0x4f')||_0x4bc0b0===_0x7556('0x1a')||_0x4bc0b0==='active'||_0x4bc0b0==='calleridnum'||_0x4bc0b0===_0x7556('0x58')||_0x4bc0b0===_0x7556('0x51')||_0x4bc0b0===_0x7556('0x6f')||_0x4bc0b0===_0x7556('0x52')||_0x4bc0b0===_0x7556('0x70')||_0x4bc0b0===_0x7556('0x71')||_0x4bc0b0==='callbackuniqueid'||_0x4bc0b0===_0x7556('0x72')||_0x4bc0b0===_0x7556('0x73')||_0x4bc0b0===_0x7556('0x1c')||_0x4bc0b0===_0x7556('0x69')||_0x4bc0b0===_0x7556('0x46')||_0x4bc0b0==='VoiceQueueId'||_0x4bc0b0==='sipcallid'||_0x4bc0b0==='xmd-voicequeueid'||_0x4bc0b0==='xmd-queue'||_0x4bc0b0==='xmd-phone'||_0x4bc0b0===_0x7556('0x74')||_0x4bc0b0===_0x7556('0x75')||_0x4bc0b0===_0x7556('0x76')||_0x4bc0b0==='xmd-dialoptions'||_0x4bc0b0==='xmd-dialid'||_0x4bc0b0==='xmd-dialchannel'||_0x4bc0b0===_0x7556('0x77')||_0x4bc0b0===_0x7556('0x78')||_0x4bc0b0===_0x7556('0x79')||_0x4bc0b0===_0x7556('0x7a')||_0x4bc0b0===_0x7556('0x7b')||_0x4bc0b0===_0x7556('0x7c')||_0x4bc0b0==='rtpaudioqosbridged'||_0x4bc0b0===_0x7556('0x7d')||_0x4bc0b0===_0x7556('0x7e')||_0x4bc0b0===_0x7556('0x7f')||_0x4bc0b0===_0x7556('0x80')||_0x4bc0b0==='rtpaudioqosrtt'||_0x4bc0b0===_0x7556('0x81')||_0x4bc0b0===_0x7556('0x7c')||_0x4bc0b0===_0x7556('0x82')||_0x4bc0b0===_0x7556('0x7d')||_0x4bc0b0===_0x7556('0x7e')||_0x4bc0b0===_0x7556('0x7f')||_0x4bc0b0==='rtpaudioqoslossbridged'||_0x4bc0b0==='rtpaudioqosrtt'||_0x4bc0b0===_0x7556('0x81')||_0x4bc0b0==='bridgepeer'||_0x4bc0b0==='bridgepvtcallid'||_0x4bc0b0===_0x7556('0x3c')||_0x4bc0b0==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2f859b,_0x57924d){var _0x3be5b0,_0x1ab9f9,_0x172747;if(_0x57924d<=0x0){_0x57924d=0x1;}_0x3be5b0=new RegExp('\x5cw{0,'+_0x57924d+'}$');_0x1ab9f9=Math[_0x7556('0x83')](0xa,_0x57924d-0x1);_0x172747=Math[_0x7556('0x83')](0xa,_0x57924d)-0x1;return util[_0x7556('0x12')]('%s',_[_0x7556('0x84')](_0x2f859b,_0x3be5b0,_[_0x7556('0x85')](_0x1ab9f9,_0x172747)));};exports[_0x7556('0x86')]=function(_0x10d687){var _0x5b9980=_0x10d687['match'](/"(.*?)"/);return _0x5b9980?_0x5b9980[0x1]:_0x10d687;};exports[_0x7556('0x87')]=function(_0x335184){var _0x4451a1=_0x335184[_0x7556('0x88')](/<(.*?)>/);return _0x4451a1?_0x4451a1[0x1]:_0x335184;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a5c7c81..1bfba51 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 _0xeaf6=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x2a1027,_0x4be601){var _0x142e1e=function(_0x5c890a){while(--_0x5c890a){_0x2a1027['push'](_0x2a1027['shift']());}};_0x142e1e(++_0x4be601);}(_0xeaf6,0x145));var _0x6eaf=function(_0x1db1f2,_0x238fb1){_0x1db1f2=_0x1db1f2-0x0;var _0x530e85=_0xeaf6[_0x1db1f2];return _0x530e85;};'use strict';exports[_0x6eaf('0x0')]={'queue':{'type':_0x6eaf('0x1'),'required':!![]},'interface':{'type':_0x6eaf('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x6eaf('0x2'),'required':![]},'paused':{'type':_0x6eaf('0x3'),'required':![]}};exports[_0x6eaf('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0x6eaf('0x1'),'required':!![]},'paused':{'type':_0x6eaf('0x3')},'reason':{'type':_0x6eaf('0x1'),'required':![]}};exports[_0x6eaf('0x5')]={'module':{'type':_0x6eaf('0x1'),'required':![]}};exports[_0x6eaf('0x6')]={'uniqueid':{'type':_0x6eaf('0x1'),'required':!![]}};exports[_0x6eaf('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6eaf('0x1')},'format':{'type':_0x6eaf('0x1')},'mixmonitorid':{'type':_0x6eaf('0x1')}};exports[_0x6eaf('0x8')]={'uniqueid':{'type':_0x6eaf('0x1'),'required':!![]}};exports[_0x6eaf('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x6eaf('0x1'),'required':!![]},'context':{'type':_0x6eaf('0x1')}}; \ No newline at end of file +var _0x8407=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queuepause','reload','voicequeuechannel'];(function(_0x34b553,_0x809998){var _0x3e983b=function(_0x5ad224){while(--_0x5ad224){_0x34b553['push'](_0x34b553['shift']());}};_0x3e983b(++_0x809998);}(_0x8407,0xe2));var _0x7840=function(_0x1c73a8,_0x2e6aab){_0x1c73a8=_0x1c73a8-0x0;var _0x34931c=_0x8407[_0x1c73a8];return _0x34931c;};'use strict';exports[_0x7840('0x0')]={'queue':{'type':_0x7840('0x1'),'required':!![]},'interface':{'type':_0x7840('0x1'),'required':!![]},'membername':{'type':_0x7840('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7840('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7840('0x1'),'required':!![]}};exports[_0x7840('0x3')]={'interface':{'type':_0x7840('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x7840('0x1'),'required':![]}};exports[_0x7840('0x4')]={'module':{'type':_0x7840('0x1'),'required':![]}};exports[_0x7840('0x5')]={'uniqueid':{'type':_0x7840('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x7840('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x7840('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x7840('0x6')]={'uniqueid':{'type':_0x7840('0x1'),'required':!![]}};exports[_0x7840('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7840('0x1'),'required':!![]},'context':{'type':_0x7840('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 47ac1d9..35e9ff4 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 _0x30d2=['triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','interface','hasOwnProperty','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','total','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isNil','isUndefined','initTelephones','telephones','length','initTrunks','trunks','initTriggers','zendeskAccounts','initFreshdeskAccounts','initDeskAccounts','vtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','answered','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','moment','../model/agent','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues'];(function(_0x1d9ee2,_0x25f1b5){var _0x4a9541=function(_0x5e1d10){while(--_0x5e1d10){_0x1d9ee2['push'](_0x1d9ee2['shift']());}};_0x4a9541(++_0x25f1b5);}(_0x30d2,0x19a));var _0x230d=function(_0x5dc755,_0x3254d0){_0x5dc755=_0x5dc755-0x0;var _0x24ce81=_0x30d2[_0x5dc755];return _0x24ce81;};'use strict';var BPromise=require(_0x230d('0x0'));var util=require(_0x230d('0x1'));var _=require('lodash');var moment=require(_0x230d('0x2'));var Agent=require(_0x230d('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x230d('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x230d('0x5'));var Campaign=require(_0x230d('0x6'));var VoiceExtension=require(_0x230d('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x230d('0x8'));var ZohoAccount=require(_0x230d('0x9'));var DeskAccount=require(_0x230d('0xa'));var VtigerAccount=require(_0x230d('0xb'));var ServicenowAccount=require(_0x230d('0xc'));var Dynamics365Account=require(_0x230d('0xd'));var FreshsalesAccount=require(_0x230d('0xe'));var FaxAccount=require(_0x230d('0xf'));var Realtime=function(){this[_0x230d('0x10')]={};this['telephones']={};this['trunks']={};this[_0x230d('0x11')]={};this[_0x230d('0x12')]={};this[_0x230d('0x13')]={};this[_0x230d('0x14')]={};this[_0x230d('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x230d('0x16')]={};this[_0x230d('0x17')]={};this[_0x230d('0x18')]={};this[_0x230d('0x19')]={};this['timers']={};this[_0x230d('0x1a')]={};this['zendeskAccounts']={};this[_0x230d('0x1b')]={};this[_0x230d('0x1c')]={};this[_0x230d('0x1d')]={};this[_0x230d('0x1e')]={};this[_0x230d('0x1f')]={};this['vtigerAccounts']={};this[_0x230d('0x20')]={};this[_0x230d('0x21')]={};this[_0x230d('0x22')]={};this[_0x230d('0x23')]={};};function freeIsNotKey(_0x25edbd,_0x53f362,_0xac603b){var _0x2b4065=_['mapKeys'](_0x25edbd,function(_0x5db223,_0x485f1e){return _0x5db223[_0xac603b];});for(var _0x16c2d1 in _0x53f362){if(_0x53f362['hasOwnProperty'](_0x16c2d1)){if(!_0x2b4065[_0x16c2d1]){delete _0x53f362[_0x16c2d1];}}}}function freeIsNotKeySip(_0x9b3157,_0xee60f6){var _0x2d0505=_[_0x230d('0x24')](_0x9b3157,function(_0x4cb5a9,_0x23fe00){return util[_0x230d('0x25')](_0x230d('0x26'),_0x4cb5a9[_0x230d('0x27')]);});for(var _0x59fd8e in _0xee60f6){if(_0xee60f6['hasOwnProperty'](_0x59fd8e)){if(!_0x2d0505[_0x59fd8e]){delete _0xee60f6[_0x59fd8e];}}}}function freeIsNotKeyAgent(_0x1a315c,_0x1343a8){var _0x200325=_[_0x230d('0x24')](_0x1a315c,function(_0x31f6c8,_0x1f5773){var _0x5cd9db=_['isNil'](_0x31f6c8[_0x230d('0x28')])?util[_0x230d('0x25')](_0x230d('0x26'),_0x31f6c8[_0x230d('0x27')]):_0x31f6c8[_0x230d('0x28')];return _0x5cd9db;});for(var _0xb46c15 in _0x1343a8){if(_0x1343a8[_0x230d('0x29')](_0xb46c15)){if(!_0x200325[_0xb46c15]){delete _0x1343a8[_0xb46c15];}}}}function clearVoiceCallReports(_0x3ecc05){_0x3ecc05['total']=0x0;_0x3ecc05['answered']=0x0;_0x3ecc05[_0x230d('0x2a')]=0x0;_0x3ecc05[_0x230d('0x2b')]=0x0;_0x3ecc05[_0x230d('0x2c')]=0x0;}function clearCampaigns(_0x42e199){if(!_['isEmpty'](_0x42e199)){for(var _0x49b28d in _0x42e199){if(_0x42e199[_0x230d('0x29')](_0x49b28d)){_0x42e199[_0x49b28d][_0x230d('0x2d')]=0x0;_0x42e199[_0x49b28d][_0x230d('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x33b84c){if(!_[_0x230d('0x2f')](_0x33b84c)){for(var _0x28243b in _0x33b84c){if(_0x33b84c['hasOwnProperty'](_0x28243b)){_0x33b84c[_0x28243b][_0x230d('0x30')]=0x0;_0x33b84c[_0x28243b]['answered']=0x0;_0x33b84c[_0x28243b]['unmanaged']=0x0;_0x33b84c[_0x28243b]['abandoned']=0x0;_0x33b84c[_0x28243b][_0x230d('0x2a')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x2b')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x2c')]=0x0;_0x33b84c[_0x28243b]['outboundAnswerAgiCallsDay']=0x0;_0x33b84c[_0x28243b][_0x230d('0x31')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x32')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x33')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x34')]=0x0;_0x33b84c[_0x28243b]['outboundUnknownCallsDay']=0x0;_0x33b84c[_0x28243b][_0x230d('0x35')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x36')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x37')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x38')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x39')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x3a')]=0x0;_0x33b84c[_0x28243b][_0x230d('0x3b')]=0x0;_0x33b84c[_0x28243b]['outboundAnswerCallsDay']=0x0;_0x33b84c[_0x28243b][_0x230d('0x3c')]=!![];}}}}Realtime[_0x230d('0x3d')][_0x230d('0x3e')]=function(_0x235602,_0x41a868){for(var _0xfdc521 in _0x41a868){if(_0x235602['hasOwnProperty'](_0xfdc521)){_0x235602[_0xfdc521]=_0x41a868[_0xfdc521];}}};Realtime['prototype'][_0x230d('0x3f')]=function(){var _0x1efeb3=this;return function(_0x103459){if(_0x103459){freeIsNotKeyAgent(_0x103459,_0x1efeb3[_0x230d('0x10')]);for(var _0x324733=0x0,_0x590735={},_0x3be266={};_0x324733<_0x103459['length'];_0x324733+=0x1){_0x590735=_0x103459[_0x324733];var _0x33afb9=_[_0x230d('0x40')](_0x590735[_0x230d('0x28')])?util[_0x230d('0x25')]('SIP/%s',_0x590735[_0x230d('0x27')]):_0x590735[_0x230d('0x28')];if(_[_0x230d('0x41')](_0x1efeb3[_0x230d('0x10')][_0x33afb9])){_0x1efeb3[_0x230d('0x10')][_0x33afb9]=new Agent(_0x590735);}else{_0x1efeb3[_0x230d('0x3e')](_0x1efeb3[_0x230d('0x10')][_0x33afb9],_0x590735);}}}return _0x1efeb3[_0x230d('0x10')];};};Realtime['prototype'][_0x230d('0x42')]=function(){var _0x2ba61e=this;return function(_0x551ed3){if(_0x551ed3){freeIsNotKeySip(_0x551ed3,_0x2ba61e[_0x230d('0x43')]);for(var _0x5b1815=0x0,_0x3c380a={},_0x2d205b={};_0x5b1815<_0x551ed3[_0x230d('0x44')];_0x5b1815+=0x1){_0x3c380a=_0x551ed3[_0x5b1815];if(_[_0x230d('0x41')](_0x2ba61e[_0x230d('0x43')][util[_0x230d('0x25')](_0x230d('0x26'),_0x3c380a[_0x230d('0x27')])])){_0x2ba61e[_0x230d('0x43')][util[_0x230d('0x25')](_0x230d('0x26'),_0x3c380a[_0x230d('0x27')])]=new Telephone(_0x3c380a);}else{_0x2ba61e[_0x230d('0x3e')](_0x2ba61e[_0x230d('0x43')][util[_0x230d('0x25')](_0x230d('0x26'),_0x3c380a[_0x230d('0x27')])],_0x3c380a);}}}return _0x2ba61e[_0x230d('0x43')];};};Realtime[_0x230d('0x3d')][_0x230d('0x45')]=function(){var _0x462b7e=this;return function(_0x31a32f){if(_0x31a32f){freeIsNotKeySip(_0x31a32f,_0x462b7e[_0x230d('0x46')]);for(var _0x1a189d=0x0,_0x11e62f={},_0x1732e9={};_0x1a189d<_0x31a32f[_0x230d('0x44')];_0x1a189d+=0x1){_0x11e62f=_0x31a32f[_0x1a189d];if(_[_0x230d('0x41')](_0x462b7e[_0x230d('0x46')][util[_0x230d('0x25')](_0x230d('0x26'),_0x11e62f['name'])])){_0x462b7e[_0x230d('0x46')][util['format']('SIP/%s',_0x11e62f[_0x230d('0x27')])]=new Trunk(_0x11e62f);}else{_0x462b7e[_0x230d('0x3e')](_0x462b7e['trunks'][util[_0x230d('0x25')](_0x230d('0x26'),_0x11e62f['name'])],_0x11e62f);}}}return _0x462b7e[_0x230d('0x46')];};};Realtime[_0x230d('0x3d')]['initVoiceQueues']=function(){var _0x4e8661=this;return function(_0x302631){if(_0x302631){freeIsNotKey(_0x302631,_0x4e8661[_0x230d('0x11')],_0x230d('0x27'));for(var _0x3e8d6d=0x0,_0x331e9f={},_0x3db183={};_0x3e8d6d<_0x302631[_0x230d('0x44')];_0x3e8d6d+=0x1){_0x331e9f=_0x302631[_0x3e8d6d];if(_[_0x230d('0x41')](_0x4e8661[_0x230d('0x11')][_0x331e9f[_0x230d('0x27')]])){_0x4e8661[_0x230d('0x11')][_0x331e9f['name']]=new VoiceQueue(_0x331e9f);}else{_0x4e8661[_0x230d('0x3e')](_0x4e8661['voiceQueues'][_0x331e9f[_0x230d('0x27')]],_0x331e9f);}}}return _0x4e8661['voiceQueues'];};};Realtime[_0x230d('0x3d')][_0x230d('0x47')]=function(){var _0x6bce81=this;return function(_0x145da0){if(_0x145da0){freeIsNotKey(_0x145da0,_0x6bce81[_0x230d('0x12')],'id');for(var _0x3e5df8=0x0,_0x267e5a={},_0x53cfaa={};_0x3e5df8<_0x145da0[_0x230d('0x44')];_0x3e5df8+=0x1){_0x267e5a=_0x145da0[_0x3e5df8];if(_[_0x230d('0x41')](_0x6bce81[_0x230d('0x12')][_0x267e5a['id']])){_0x6bce81[_0x230d('0x12')][_0x267e5a['id']]=new Trigger(_0x267e5a);}else{_0x6bce81[_0x230d('0x3e')](_0x6bce81[_0x230d('0x12')][_0x267e5a['id']],_0x267e5a);}}}return _0x6bce81['triggers'];};};Realtime[_0x230d('0x3d')]['initTemplates']=function(){var _0x27504b=this;return function(_0x5a65e7){if(_0x5a65e7){freeIsNotKey(_0x5a65e7,_0x27504b['templates'],'id');for(var _0xdfee0d=0x0,_0x3a3ec0={},_0x329c1e={};_0xdfee0d<_0x5a65e7[_0x230d('0x44')];_0xdfee0d+=0x1){_0x3a3ec0=_0x5a65e7[_0xdfee0d];if(_[_0x230d('0x41')](_0x27504b['templates'][_0x3a3ec0['id']])){_0x27504b['templates'][_0x3a3ec0['id']]=new Template(_0x3a3ec0);}else{_0x27504b[_0x230d('0x3e')](_0x27504b[_0x230d('0x14')][_0x3a3ec0['id']],_0x3a3ec0);}}}return _0x27504b[_0x230d('0x14')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x52b5f9=this;return function(_0x7754c3){if(_0x7754c3){freeIsNotKey(_0x7754c3,_0x52b5f9[_0x230d('0x48')],'id');for(var _0xa35108=0x0,_0x5515ee={},_0x136a50={};_0xa35108<_0x7754c3['length'];_0xa35108+=0x1){_0x5515ee=_0x7754c3[_0xa35108];if(_[_0x230d('0x41')](_0x52b5f9[_0x230d('0x48')][_0x5515ee['id']])){_0x52b5f9['zendeskAccounts'][_0x5515ee['id']]=new ZendeskAccount(_0x5515ee);}else{_0x52b5f9['mergeFromDatabase'](_0x52b5f9[_0x230d('0x48')][_0x5515ee['id']],_0x5515ee);}}}return _0x52b5f9[_0x230d('0x48')];};};Realtime[_0x230d('0x3d')]['initSalesforceAccounts']=function(){var _0x3c80e1=this;return function(_0x1bbb4f){if(_0x1bbb4f){freeIsNotKey(_0x1bbb4f,_0x3c80e1['salesforceAccounts'],'id');for(var _0x4d665d=0x0,_0x28d87b={},_0x5141c9={};_0x4d665d<_0x1bbb4f[_0x230d('0x44')];_0x4d665d+=0x1){_0x28d87b=_0x1bbb4f[_0x4d665d];if(_[_0x230d('0x41')](_0x3c80e1['salesforceAccounts'][_0x28d87b['id']])){_0x3c80e1[_0x230d('0x1b')][_0x28d87b['id']]=new SalesforceAccount(_0x28d87b);}else{_0x3c80e1[_0x230d('0x3e')](_0x3c80e1[_0x230d('0x1b')][_0x28d87b['id']],_0x28d87b);}}}return _0x3c80e1[_0x230d('0x1b')];};};Realtime[_0x230d('0x3d')][_0x230d('0x49')]=function(){var _0x3455a7=this;return function(_0x4abc3a){if(_0x4abc3a){freeIsNotKey(_0x4abc3a,_0x3455a7[_0x230d('0x1d')],'id');for(var _0x5f37a0=0x0,_0x4da267={},_0x3ad641={};_0x5f37a0<_0x4abc3a['length'];_0x5f37a0+=0x1){_0x4da267=_0x4abc3a[_0x5f37a0];if(_[_0x230d('0x41')](_0x3455a7[_0x230d('0x1d')][_0x4da267['id']])){_0x3455a7['freshdeskAccounts'][_0x4da267['id']]=new FreshdeskAccount(_0x4da267);}else{_0x3455a7[_0x230d('0x3e')](_0x3455a7[_0x230d('0x1d')][_0x4da267['id']],_0x4da267);}}}return _0x3455a7['freshdeskAccounts'];};};Realtime[_0x230d('0x3d')]['initZohoAccounts']=function(){var _0x2e283a=this;return function(_0x3d2851){if(_0x3d2851){freeIsNotKey(_0x3d2851,_0x2e283a[_0x230d('0x1e')],'id');for(var _0xdcfcaf=0x0,_0x24d263={},_0x1b87f0={};_0xdcfcaf<_0x3d2851['length'];_0xdcfcaf+=0x1){_0x24d263=_0x3d2851[_0xdcfcaf];if(_[_0x230d('0x41')](_0x2e283a[_0x230d('0x1e')][_0x24d263['id']])){_0x2e283a['zohoAccounts'][_0x24d263['id']]=new ZohoAccount(_0x24d263);}else{_0x2e283a[_0x230d('0x3e')](_0x2e283a['zohoAccounts'][_0x24d263['id']],_0x24d263);}}}return _0x2e283a['zohoAccounts'];};};Realtime[_0x230d('0x3d')][_0x230d('0x4a')]=function(){var _0x311c6a=this;return function(_0x452250){if(_0x452250){freeIsNotKey(_0x452250,_0x311c6a[_0x230d('0x1f')],'id');for(var _0x1cc904=0x0,_0xcf00e6={},_0x5a2da1={};_0x1cc904<_0x452250[_0x230d('0x44')];_0x1cc904+=0x1){_0xcf00e6=_0x452250[_0x1cc904];if(_[_0x230d('0x41')](_0x311c6a[_0x230d('0x1f')][_0xcf00e6['id']])){_0x311c6a[_0x230d('0x1f')][_0xcf00e6['id']]=new DeskAccount(_0xcf00e6);}else{_0x311c6a[_0x230d('0x3e')](_0x311c6a[_0x230d('0x1f')][_0xcf00e6['id']],_0xcf00e6);}}}return _0x311c6a[_0x230d('0x1f')];};};Realtime[_0x230d('0x3d')]['initSugarcrmAccounts']=function(){var _0x2efdec=this;return function(_0x6b5b93){if(_0x6b5b93){freeIsNotKey(_0x6b5b93,_0x2efdec[_0x230d('0x1c')],'id');for(var _0x1a0fbe=0x0,_0x9376ef={},_0x2ceccf={};_0x1a0fbe<_0x6b5b93[_0x230d('0x44')];_0x1a0fbe+=0x1){_0x9376ef=_0x6b5b93[_0x1a0fbe];if(_['isUndefined'](_0x2efdec[_0x230d('0x1c')][_0x9376ef['id']])){_0x2efdec[_0x230d('0x1c')][_0x9376ef['id']]=new SugarcrmAccount(_0x9376ef);}else{_0x2efdec[_0x230d('0x3e')](_0x2efdec[_0x230d('0x1c')][_0x9376ef['id']],_0x9376ef);}}}return _0x2efdec[_0x230d('0x1c')];};};Realtime[_0x230d('0x3d')]['initVtigerAccounts']=function(){var _0x279d5e=this;return function(_0x432f36){if(_0x432f36){freeIsNotKey(_0x432f36,_0x279d5e['vtigerAccounts'],'id');for(var _0x484cb7=0x0,_0x275a1a={},_0xa9be5c={};_0x484cb7<_0x432f36[_0x230d('0x44')];_0x484cb7+=0x1){_0x275a1a=_0x432f36[_0x484cb7];if(_[_0x230d('0x41')](_0x279d5e[_0x230d('0x4b')][_0x275a1a['id']])){_0x279d5e['vtigerAccounts'][_0x275a1a['id']]=new VtigerAccount(_0x275a1a);}else{_0x279d5e[_0x230d('0x3e')](_0x279d5e[_0x230d('0x4b')][_0x275a1a['id']],_0x275a1a);}}}return _0x279d5e[_0x230d('0x4b')];};};Realtime[_0x230d('0x3d')]['initServicenowAccounts']=function(){var _0x15955b=this;return function(_0x48f084){if(_0x48f084){freeIsNotKey(_0x48f084,_0x15955b[_0x230d('0x20')],'id');for(var _0x1886c5=0x0,_0x24db46={},_0x3eb564={};_0x1886c5<_0x48f084[_0x230d('0x44')];_0x1886c5+=0x1){_0x24db46=_0x48f084[_0x1886c5];if(_[_0x230d('0x41')](_0x15955b[_0x230d('0x20')][_0x24db46['id']])){_0x15955b[_0x230d('0x20')][_0x24db46['id']]=new ServicenowAccount(_0x24db46);}else{_0x15955b['mergeFromDatabase'](_0x15955b[_0x230d('0x20')][_0x24db46['id']],_0x24db46);}}}return _0x15955b['servicenowAccounts'];};};Realtime[_0x230d('0x3d')][_0x230d('0x4c')]=function(){var _0x250396=this;return function(_0x23b06b){if(_0x23b06b){freeIsNotKey(_0x23b06b,_0x250396[_0x230d('0x21')],'id');for(var _0x4d94be=0x0,_0x3aaac1={},_0x2b3175={};_0x4d94be<_0x23b06b['length'];_0x4d94be+=0x1){_0x3aaac1=_0x23b06b[_0x4d94be];if(_['isUndefined'](_0x250396['dynamics365Accounts'][_0x3aaac1['id']])){_0x250396[_0x230d('0x21')][_0x3aaac1['id']]=new Dynamics365Account(_0x3aaac1);}else{_0x250396[_0x230d('0x3e')](_0x250396['dynamics365Accounts'][_0x3aaac1['id']],_0x3aaac1);}}}return _0x250396[_0x230d('0x21')];};};Realtime[_0x230d('0x3d')][_0x230d('0x4d')]=function(){var _0x491bdb=this;return function(_0x1e38db){if(_0x1e38db){freeIsNotKey(_0x1e38db,_0x491bdb[_0x230d('0x22')],'id');for(var _0x4c2ead=0x0,_0x5c3a55={},_0x64a010={};_0x4c2ead<_0x1e38db[_0x230d('0x44')];_0x4c2ead+=0x1){_0x5c3a55=_0x1e38db[_0x4c2ead];if(_['isUndefined'](_0x491bdb[_0x230d('0x22')][_0x5c3a55['id']])){_0x491bdb[_0x230d('0x22')][_0x5c3a55['id']]=new FreshsalesAccount(_0x5c3a55);}else{_0x491bdb[_0x230d('0x3e')](_0x491bdb[_0x230d('0x22')][_0x5c3a55['id']],_0x5c3a55);}}}return _0x491bdb['freshsalesAccounts'];};};Realtime[_0x230d('0x3d')][_0x230d('0x4e')]=function(){var _0x50e7d8=this;return function(_0x4817b4){for(var _0xfe2a4b=0x0;_0xfe2a4b<_0x4817b4[_0x230d('0x44')];_0xfe2a4b+=0x1){_[_0x230d('0x4f')](_0x50e7d8[_0x230d('0x11')][_0x4817b4[_0xfe2a4b][_0x230d('0x27')]],_0x4817b4[_0xfe2a4b]);}return _0x50e7d8[_0x230d('0x11')];};};Realtime['prototype'][_0x230d('0x50')]=function(){var _0x2bb9c7=this;return function(_0x4cbfa8){clearVoiceQueues(_0x2bb9c7['voiceQueues']);if(_0x4cbfa8){_0x4cbfa8=_['groupBy'](_0x4cbfa8,_0x230d('0x51'));for(var _0x398475 in _0x4cbfa8){if(_0x4cbfa8[_0x230d('0x29')](_0x398475)){var _0x123b2e={};for(var _0xbd0bd=0x0;_0xbd0bd<_0x4cbfa8[_0x398475]['length'];_0xbd0bd+=0x1){var _0x50b5f9=_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x52')];if(_0x2bb9c7[_0x230d('0x11')][_0x50b5f9]){if(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x53')]){_0x2bb9c7['voiceQueues'][_0x50b5f9][_0x230d('0x54')]+=0x1;}if(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x55')]){_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x56')]+=0x1;}_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x2a')]+=moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x57')])[_0x230d('0x58')](moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x59')]),_0x230d('0x5a'))||0x0;if(_0xbd0bd===_0x4cbfa8[_0x398475][_0x230d('0x44')]-0x1){_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x2b')]+=moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x5b')]||_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x5c')]||_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x5d')])[_0x230d('0x58')](moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x59')]),'seconds')||0x0;_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x30')]+=0x1;if(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x5e')]){_0x2bb9c7[_0x230d('0x11')][_0x50b5f9]['answered']+=0x1;_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x2c')]+=moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x5b')])[_0x230d('0x58')](moment(_0x4cbfa8[_0x398475][_0xbd0bd][_0x230d('0x57')]),_0x230d('0x5a'))||0x0;}}else{_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x2b')]+=_0x2bb9c7[_0x230d('0x11')][_0x50b5f9][_0x230d('0x2a')]||0x0;}}}}}}return _0x2bb9c7[_0x230d('0x11')];};};Realtime[_0x230d('0x3d')][_0x230d('0x5f')]=function(){var _0x23f72f=this;return function(_0x48b22d){clearVoiceCallReports(_0x23f72f[_0x230d('0x15')]);if(_0x48b22d){for(var _0x43db19=0x0;_0x43db19<_0x48b22d[_0x230d('0x44')];_0x43db19+=0x1){_0x23f72f[_0x230d('0x15')][_0x230d('0x30')]+=0x1;_0x23f72f[_0x230d('0x15')]['sumDuration']+=_0x48b22d[_0x43db19][_0x230d('0x60')];if(_0x48b22d[_0x43db19][_0x230d('0x61')]===_0x230d('0x62')){_0x23f72f[_0x230d('0x15')][_0x230d('0x63')]+=0x1;_0x23f72f[_0x230d('0x15')][_0x230d('0x2a')]+=_0x48b22d[_0x43db19][_0x230d('0x60')]-_0x48b22d[_0x43db19][_0x230d('0x64')]||0x0;_0x23f72f['outbound'][_0x230d('0x2c')]+=_0x48b22d[_0x43db19]['billableseconds'];}}}return _0x23f72f['outbound'];};};Realtime[_0x230d('0x3d')][_0x230d('0x65')]=function(){var _0x2c3472=this;return function(_0xb50de6){if(_0xb50de6){freeIsNotKey(_0xb50de6,_0x2c3472[_0x230d('0x13')],_0x230d('0x27'));for(var _0x41f588=0x0,_0x1c9b6c={};_0x41f588<_0xb50de6['length'];_0x41f588+=0x1){_0x1c9b6c=_0xb50de6[_0x41f588];if(_[_0x230d('0x41')](_0x2c3472[_0x230d('0x13')][_0x1c9b6c[_0x230d('0x27')]])){_0x2c3472[_0x230d('0x13')][_0x1c9b6c[_0x230d('0x27')]]=new Campaign(_0x1c9b6c);}else{_0x2c3472[_0x230d('0x3e')](_0x2c3472[_0x230d('0x13')][_0x1c9b6c[_0x230d('0x27')]],_0x1c9b6c);_0x2c3472[_0x230d('0x13')][_0x1c9b6c['name']][_0x230d('0x66')]=_0x1c9b6c['SquareProject']?_0x1c9b6c[_0x230d('0x67')][_0x230d('0x27')]:undefined;}}}return _0x2c3472[_0x230d('0x13')];};};Realtime[_0x230d('0x3d')][_0x230d('0x68')]=function(){var _0x294e11=this;return function(_0x5e60f2){if(_0x5e60f2){freeIsNotKey(_0x5e60f2,_0x294e11[_0x230d('0x16')],'id');for(var _0x3b4c38=0x0,_0x1eac3a={};_0x3b4c38<_0x5e60f2[_0x230d('0x44')];_0x3b4c38+=0x1){_0x1eac3a=_0x5e60f2[_0x3b4c38];if(_[_0x230d('0x41')](_0x294e11[_0x230d('0x16')][_0x1eac3a['id']])){_0x294e11[_0x230d('0x16')][_0x1eac3a['id']]=new VoiceExtension(_0x1eac3a);}else{_0x294e11[_0x230d('0x3e')](_0x294e11['voiceExtensions'][_0x1eac3a['id']],_0x1eac3a);}}}return _0x294e11['voiceExtensions'];};};Realtime['prototype'][_0x230d('0x69')]=function(){var _0x2946c4=this;return function(_0x2f8025){clearCampaigns(_0x2946c4['campaigns']);for(var _0x3d5a53=0x0;_0x3d5a53<_0x2f8025[_0x230d('0x44')];_0x3d5a53+=0x1){_[_0x230d('0x4f')](_0x2946c4[_0x230d('0x13')][_0x2f8025[_0x3d5a53][_0x230d('0x27')]],_0x2f8025[_0x3d5a53]);}return _0x2946c4['campaigns'];};};Realtime[_0x230d('0x3d')]['initFaxAccounts']=function(){var _0x5e7cc9=this;return function(_0x6d678f){if(_0x6d678f){freeIsNotKey(_0x6d678f,_0x5e7cc9[_0x230d('0x23')],'id');for(var _0x357388=0x0,_0x22a893={},_0x22d8d4={};_0x357388<_0x6d678f[_0x230d('0x44')];_0x357388+=0x1){_0x22a893=_0x6d678f[_0x357388];if(_[_0x230d('0x41')](_0x5e7cc9[_0x230d('0x23')][_0x22a893['id']])){_0x5e7cc9['faxAccounts'][_0x22a893['id']]=new FaxAccount(_0x22a893);}else{_0x5e7cc9[_0x230d('0x3e')](_0x5e7cc9[_0x230d('0x23')][_0x22a893['id']],_0x22a893);}}}return _0x5e7cc9[_0x230d('0x23')];};};module[_0x230d('0x6a')]=Realtime; \ No newline at end of file +var _0xc451=['queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','outbound','voiceExtensions','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt'];(function(_0x302622,_0x4c605b){var _0x1ea958=function(_0x3851f2){while(--_0x3851f2){_0x302622['push'](_0x302622['shift']());}};_0x1ea958(++_0x4c605b);}(_0xc451,0x1d1));var _0x1c45=function(_0x196760,_0x2b709a){_0x196760=_0x196760-0x0;var _0x3b8edc=_0xc451[_0x196760];return _0x3b8edc;};'use strict';var BPromise=require(_0x1c45('0x0'));var util=require(_0x1c45('0x1'));var _=require(_0x1c45('0x2'));var moment=require(_0x1c45('0x3'));var Agent=require(_0x1c45('0x4'));var Telephone=require(_0x1c45('0x5'));var Trunk=require(_0x1c45('0x6'));var VoiceQueue=require(_0x1c45('0x7'));var Trigger=require('../model/trigger');var Template=require(_0x1c45('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x1c45('0x9'));var ZendeskAccount=require(_0x1c45('0xa'));var SalesforceAccount=require(_0x1c45('0xb'));var FreshdeskAccount=require(_0x1c45('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x1c45('0xd'));var DeskAccount=require(_0x1c45('0xe'));var VtigerAccount=require(_0x1c45('0xf'));var ServicenowAccount=require(_0x1c45('0x10'));var Dynamics365Account=require(_0x1c45('0x11'));var FreshsalesAccount=require(_0x1c45('0x12'));var FaxAccount=require(_0x1c45('0x13'));var Realtime=function(){this[_0x1c45('0x14')]={};this['telephones']={};this[_0x1c45('0x15')]={};this[_0x1c45('0x16')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0x1c45('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1c45('0x18')]={};this[_0x1c45('0x19')]={};this[_0x1c45('0x1a')]={};this['outboundChannels']={};this['timers']={};this[_0x1c45('0x1b')]={};this[_0x1c45('0x1c')]={};this[_0x1c45('0x1d')]={};this[_0x1c45('0x1e')]={};this[_0x1c45('0x1f')]={};this[_0x1c45('0x20')]={};this[_0x1c45('0x21')]={};this[_0x1c45('0x22')]={};this[_0x1c45('0x23')]={};this[_0x1c45('0x24')]={};this[_0x1c45('0x25')]={};this[_0x1c45('0x26')]={};};function freeIsNotKey(_0x2d5d68,_0x3f8dd0,_0x3d3f24){var _0x1e6fd4=_[_0x1c45('0x27')](_0x2d5d68,function(_0x10044a,_0x223dc3){return _0x10044a[_0x3d3f24];});for(var _0xa8f37b in _0x3f8dd0){if(_0x3f8dd0[_0x1c45('0x28')](_0xa8f37b)){if(!_0x1e6fd4[_0xa8f37b]){delete _0x3f8dd0[_0xa8f37b];}}}}function freeIsNotKeySip(_0x1bcf86,_0x3d9ebc){var _0x1a3f12=_[_0x1c45('0x27')](_0x1bcf86,function(_0x3d7753,_0x9bf8bb){return util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x3d7753[_0x1c45('0x2b')]);});for(var _0x35a6a4 in _0x3d9ebc){if(_0x3d9ebc[_0x1c45('0x28')](_0x35a6a4)){if(!_0x1a3f12[_0x35a6a4]){delete _0x3d9ebc[_0x35a6a4];}}}}function freeIsNotKeyAgent(_0x4a1cbd,_0x32949b){var _0x47ec5e=_[_0x1c45('0x27')](_0x4a1cbd,function(_0x2e8f78,_0x17506e){var _0x99b0ea=_[_0x1c45('0x2c')](_0x2e8f78[_0x1c45('0x2d')])?util[_0x1c45('0x29')]('SIP/%s',_0x2e8f78[_0x1c45('0x2b')]):_0x2e8f78[_0x1c45('0x2d')];return _0x99b0ea;});for(var _0x3d6fc0 in _0x32949b){if(_0x32949b[_0x1c45('0x28')](_0x3d6fc0)){if(!_0x47ec5e[_0x3d6fc0]){delete _0x32949b[_0x3d6fc0];}}}}function clearVoiceCallReports(_0x46383e){_0x46383e[_0x1c45('0x2e')]=0x0;_0x46383e[_0x1c45('0x2f')]=0x0;_0x46383e[_0x1c45('0x30')]=0x0;_0x46383e[_0x1c45('0x31')]=0x0;_0x46383e[_0x1c45('0x32')]=0x0;}function clearCampaigns(_0x886e3f){if(!_[_0x1c45('0x33')](_0x886e3f)){for(var _0x4de722 in _0x886e3f){if(_0x886e3f[_0x1c45('0x28')](_0x4de722)){_0x886e3f[_0x4de722][_0x1c45('0x34')]=0x0;_0x886e3f[_0x4de722][_0x1c45('0x35')]=0x0;}}}}function clearVoiceQueues(_0x434542){if(!_['isEmpty'](_0x434542)){for(var _0x20f668 in _0x434542){if(_0x434542['hasOwnProperty'](_0x20f668)){_0x434542[_0x20f668][_0x1c45('0x2e')]=0x0;_0x434542[_0x20f668]['answered']=0x0;_0x434542[_0x20f668][_0x1c45('0x36')]=0x0;_0x434542[_0x20f668][_0x1c45('0x37')]=0x0;_0x434542[_0x20f668]['sumHoldTime']=0x0;_0x434542[_0x20f668][_0x1c45('0x31')]=0x0;_0x434542[_0x20f668][_0x1c45('0x32')]=0x0;_0x434542[_0x20f668][_0x1c45('0x38')]=0x0;_0x434542[_0x20f668][_0x1c45('0x39')]=0x0;_0x434542[_0x20f668][_0x1c45('0x3a')]=0x0;_0x434542[_0x20f668][_0x1c45('0x3b')]=0x0;_0x434542[_0x20f668][_0x1c45('0x3c')]=0x0;_0x434542[_0x20f668][_0x1c45('0x3d')]=0x0;_0x434542[_0x20f668]['outboundDropCallsDayTimeout']=0x0;_0x434542[_0x20f668][_0x1c45('0x3e')]=0x0;_0x434542[_0x20f668][_0x1c45('0x3f')]=0x0;_0x434542[_0x20f668][_0x1c45('0x40')]=0x0;_0x434542[_0x20f668][_0x1c45('0x41')]=0x0;_0x434542[_0x20f668][_0x1c45('0x42')]=0x0;_0x434542[_0x20f668][_0x1c45('0x38')]=0x0;_0x434542[_0x20f668]['outboundAnswerCallsDay']=0x0;_0x434542[_0x20f668][_0x1c45('0x43')]=!![];}}}}Realtime[_0x1c45('0x44')][_0x1c45('0x45')]=function(_0x4a7d2f,_0x237108){for(var _0x359f00 in _0x237108){if(_0x4a7d2f[_0x1c45('0x28')](_0x359f00)){_0x4a7d2f[_0x359f00]=_0x237108[_0x359f00];}}};Realtime[_0x1c45('0x44')][_0x1c45('0x46')]=function(){var _0x2742e9=this;return function(_0x5bf129){if(_0x5bf129){freeIsNotKeyAgent(_0x5bf129,_0x2742e9[_0x1c45('0x14')]);for(var _0x4b47ff=0x0,_0x4e193c={},_0x32e1fa={};_0x4b47ff<_0x5bf129[_0x1c45('0x47')];_0x4b47ff+=0x1){_0x4e193c=_0x5bf129[_0x4b47ff];var _0x2282bb=_[_0x1c45('0x2c')](_0x4e193c[_0x1c45('0x2d')])?util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x4e193c['name']):_0x4e193c[_0x1c45('0x2d')];if(_[_0x1c45('0x48')](_0x2742e9['agents'][_0x2282bb])){_0x2742e9['agents'][_0x2282bb]=new Agent(_0x4e193c);}else{_0x2742e9[_0x1c45('0x45')](_0x2742e9['agents'][_0x2282bb],_0x4e193c);}}}return _0x2742e9[_0x1c45('0x14')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x49')]=function(){var _0x31d719=this;return function(_0x2ecd9a){if(_0x2ecd9a){freeIsNotKeySip(_0x2ecd9a,_0x31d719[_0x1c45('0x4a')]);for(var _0x35de4b=0x0,_0x4ca4fa={},_0x2e888b={};_0x35de4b<_0x2ecd9a[_0x1c45('0x47')];_0x35de4b+=0x1){_0x4ca4fa=_0x2ecd9a[_0x35de4b];if(_[_0x1c45('0x48')](_0x31d719[_0x1c45('0x4a')][util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x4ca4fa[_0x1c45('0x2b')])])){_0x31d719['telephones'][util[_0x1c45('0x29')]('SIP/%s',_0x4ca4fa[_0x1c45('0x2b')])]=new Telephone(_0x4ca4fa);}else{_0x31d719['mergeFromDatabase'](_0x31d719[_0x1c45('0x4a')][util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x4ca4fa['name'])],_0x4ca4fa);}}}return _0x31d719[_0x1c45('0x4a')];};};Realtime['prototype'][_0x1c45('0x4b')]=function(){var _0x424584=this;return function(_0x445d76){if(_0x445d76){freeIsNotKeySip(_0x445d76,_0x424584[_0x1c45('0x15')]);for(var _0x47f5f9=0x0,_0x5b0409={},_0x27d1d6={};_0x47f5f9<_0x445d76[_0x1c45('0x47')];_0x47f5f9+=0x1){_0x5b0409=_0x445d76[_0x47f5f9];if(_[_0x1c45('0x48')](_0x424584[_0x1c45('0x15')][util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x5b0409[_0x1c45('0x2b')])])){_0x424584['trunks'][util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x5b0409[_0x1c45('0x2b')])]=new Trunk(_0x5b0409);}else{_0x424584[_0x1c45('0x45')](_0x424584[_0x1c45('0x15')][util[_0x1c45('0x29')](_0x1c45('0x2a'),_0x5b0409[_0x1c45('0x2b')])],_0x5b0409);}}}return _0x424584[_0x1c45('0x15')];};};Realtime['prototype'][_0x1c45('0x4c')]=function(){var _0x22a0d9=this;return function(_0x51d71d){if(_0x51d71d){freeIsNotKey(_0x51d71d,_0x22a0d9[_0x1c45('0x16')],_0x1c45('0x2b'));for(var _0x4b26f8=0x0,_0x2e56ab={},_0x421fea={};_0x4b26f8<_0x51d71d[_0x1c45('0x47')];_0x4b26f8+=0x1){_0x2e56ab=_0x51d71d[_0x4b26f8];if(_[_0x1c45('0x48')](_0x22a0d9[_0x1c45('0x16')][_0x2e56ab['name']])){_0x22a0d9[_0x1c45('0x16')][_0x2e56ab[_0x1c45('0x2b')]]=new VoiceQueue(_0x2e56ab);}else{_0x22a0d9[_0x1c45('0x45')](_0x22a0d9[_0x1c45('0x16')][_0x2e56ab['name']],_0x2e56ab);}}}return _0x22a0d9[_0x1c45('0x16')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x4d')]=function(){var _0x5ea412=this;return function(_0x1859c6){if(_0x1859c6){freeIsNotKey(_0x1859c6,_0x5ea412[_0x1c45('0x4e')],'id');for(var _0xe60ad5=0x0,_0x54133b={},_0x508f02={};_0xe60ad5<_0x1859c6[_0x1c45('0x47')];_0xe60ad5+=0x1){_0x54133b=_0x1859c6[_0xe60ad5];if(_['isUndefined'](_0x5ea412[_0x1c45('0x4e')][_0x54133b['id']])){_0x5ea412[_0x1c45('0x4e')][_0x54133b['id']]=new Trigger(_0x54133b);}else{_0x5ea412[_0x1c45('0x45')](_0x5ea412['triggers'][_0x54133b['id']],_0x54133b);}}}return _0x5ea412['triggers'];};};Realtime[_0x1c45('0x44')][_0x1c45('0x4f')]=function(){var _0x4decf1=this;return function(_0xd2b0f8){if(_0xd2b0f8){freeIsNotKey(_0xd2b0f8,_0x4decf1[_0x1c45('0x50')],'id');for(var _0x161883=0x0,_0x237f50={},_0x303880={};_0x161883<_0xd2b0f8[_0x1c45('0x47')];_0x161883+=0x1){_0x237f50=_0xd2b0f8[_0x161883];if(_[_0x1c45('0x48')](_0x4decf1[_0x1c45('0x50')][_0x237f50['id']])){_0x4decf1[_0x1c45('0x50')][_0x237f50['id']]=new Template(_0x237f50);}else{_0x4decf1[_0x1c45('0x45')](_0x4decf1[_0x1c45('0x50')][_0x237f50['id']],_0x237f50);}}}return _0x4decf1[_0x1c45('0x50')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x51')]=function(){var _0x337abc=this;return function(_0xa0285){if(_0xa0285){freeIsNotKey(_0xa0285,_0x337abc[_0x1c45('0x1c')],'id');for(var _0x54197c=0x0,_0x1e5c3e={},_0x289a55={};_0x54197c<_0xa0285['length'];_0x54197c+=0x1){_0x1e5c3e=_0xa0285[_0x54197c];if(_[_0x1c45('0x48')](_0x337abc['zendeskAccounts'][_0x1e5c3e['id']])){_0x337abc[_0x1c45('0x1c')][_0x1e5c3e['id']]=new ZendeskAccount(_0x1e5c3e);}else{_0x337abc[_0x1c45('0x45')](_0x337abc[_0x1c45('0x1c')][_0x1e5c3e['id']],_0x1e5c3e);}}}return _0x337abc[_0x1c45('0x1c')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x52')]=function(){var _0x71f2e2=this;return function(_0x41c76b){if(_0x41c76b){freeIsNotKey(_0x41c76b,_0x71f2e2[_0x1c45('0x1d')],'id');for(var _0x1a559a=0x0,_0x3740b5={},_0x1a7efc={};_0x1a559a<_0x41c76b[_0x1c45('0x47')];_0x1a559a+=0x1){_0x3740b5=_0x41c76b[_0x1a559a];if(_['isUndefined'](_0x71f2e2[_0x1c45('0x1d')][_0x3740b5['id']])){_0x71f2e2[_0x1c45('0x1d')][_0x3740b5['id']]=new SalesforceAccount(_0x3740b5);}else{_0x71f2e2[_0x1c45('0x45')](_0x71f2e2[_0x1c45('0x1d')][_0x3740b5['id']],_0x3740b5);}}}return _0x71f2e2[_0x1c45('0x1d')];};};Realtime[_0x1c45('0x44')]['initFreshdeskAccounts']=function(){var _0x157fcf=this;return function(_0x270d95){if(_0x270d95){freeIsNotKey(_0x270d95,_0x157fcf['freshdeskAccounts'],'id');for(var _0x2b1b8a=0x0,_0x312308={},_0x5f36ca={};_0x2b1b8a<_0x270d95[_0x1c45('0x47')];_0x2b1b8a+=0x1){_0x312308=_0x270d95[_0x2b1b8a];if(_[_0x1c45('0x48')](_0x157fcf['freshdeskAccounts'][_0x312308['id']])){_0x157fcf[_0x1c45('0x1f')][_0x312308['id']]=new FreshdeskAccount(_0x312308);}else{_0x157fcf[_0x1c45('0x45')](_0x157fcf[_0x1c45('0x1f')][_0x312308['id']],_0x312308);}}}return _0x157fcf[_0x1c45('0x1f')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x53')]=function(){var _0x2b0b21=this;return function(_0x387c71){if(_0x387c71){freeIsNotKey(_0x387c71,_0x2b0b21[_0x1c45('0x20')],'id');for(var _0x981d6a=0x0,_0x36f73e={},_0xd5c316={};_0x981d6a<_0x387c71[_0x1c45('0x47')];_0x981d6a+=0x1){_0x36f73e=_0x387c71[_0x981d6a];if(_[_0x1c45('0x48')](_0x2b0b21[_0x1c45('0x20')][_0x36f73e['id']])){_0x2b0b21['zohoAccounts'][_0x36f73e['id']]=new ZohoAccount(_0x36f73e);}else{_0x2b0b21[_0x1c45('0x45')](_0x2b0b21['zohoAccounts'][_0x36f73e['id']],_0x36f73e);}}}return _0x2b0b21[_0x1c45('0x20')];};};Realtime['prototype'][_0x1c45('0x54')]=function(){var _0x5e814d=this;return function(_0x2d22fd){if(_0x2d22fd){freeIsNotKey(_0x2d22fd,_0x5e814d['deskAccounts'],'id');for(var _0x169e38=0x0,_0x428d0d={},_0x39e4d8={};_0x169e38<_0x2d22fd['length'];_0x169e38+=0x1){_0x428d0d=_0x2d22fd[_0x169e38];if(_[_0x1c45('0x48')](_0x5e814d[_0x1c45('0x21')][_0x428d0d['id']])){_0x5e814d[_0x1c45('0x21')][_0x428d0d['id']]=new DeskAccount(_0x428d0d);}else{_0x5e814d[_0x1c45('0x45')](_0x5e814d[_0x1c45('0x21')][_0x428d0d['id']],_0x428d0d);}}}return _0x5e814d['deskAccounts'];};};Realtime[_0x1c45('0x44')][_0x1c45('0x55')]=function(){var _0x3bc7a2=this;return function(_0x2ea705){if(_0x2ea705){freeIsNotKey(_0x2ea705,_0x3bc7a2['sugarcrmAccounts'],'id');for(var _0x15ec47=0x0,_0x2d1af3={},_0x46e638={};_0x15ec47<_0x2ea705[_0x1c45('0x47')];_0x15ec47+=0x1){_0x2d1af3=_0x2ea705[_0x15ec47];if(_['isUndefined'](_0x3bc7a2[_0x1c45('0x1e')][_0x2d1af3['id']])){_0x3bc7a2[_0x1c45('0x1e')][_0x2d1af3['id']]=new SugarcrmAccount(_0x2d1af3);}else{_0x3bc7a2[_0x1c45('0x45')](_0x3bc7a2[_0x1c45('0x1e')][_0x2d1af3['id']],_0x2d1af3);}}}return _0x3bc7a2[_0x1c45('0x1e')];};};Realtime[_0x1c45('0x44')]['initVtigerAccounts']=function(){var _0x493233=this;return function(_0x5951df){if(_0x5951df){freeIsNotKey(_0x5951df,_0x493233[_0x1c45('0x22')],'id');for(var _0x2ba964=0x0,_0x4fa536={},_0x241acc={};_0x2ba964<_0x5951df[_0x1c45('0x47')];_0x2ba964+=0x1){_0x4fa536=_0x5951df[_0x2ba964];if(_[_0x1c45('0x48')](_0x493233[_0x1c45('0x22')][_0x4fa536['id']])){_0x493233['vtigerAccounts'][_0x4fa536['id']]=new VtigerAccount(_0x4fa536);}else{_0x493233[_0x1c45('0x45')](_0x493233[_0x1c45('0x22')][_0x4fa536['id']],_0x4fa536);}}}return _0x493233['vtigerAccounts'];};};Realtime[_0x1c45('0x44')][_0x1c45('0x56')]=function(){var _0x23da1b=this;return function(_0x245db9){if(_0x245db9){freeIsNotKey(_0x245db9,_0x23da1b[_0x1c45('0x23')],'id');for(var _0x55d924=0x0,_0x27d3af={},_0x58cf07={};_0x55d924<_0x245db9[_0x1c45('0x47')];_0x55d924+=0x1){_0x27d3af=_0x245db9[_0x55d924];if(_[_0x1c45('0x48')](_0x23da1b[_0x1c45('0x23')][_0x27d3af['id']])){_0x23da1b[_0x1c45('0x23')][_0x27d3af['id']]=new ServicenowAccount(_0x27d3af);}else{_0x23da1b[_0x1c45('0x45')](_0x23da1b[_0x1c45('0x23')][_0x27d3af['id']],_0x27d3af);}}}return _0x23da1b['servicenowAccounts'];};};Realtime[_0x1c45('0x44')][_0x1c45('0x57')]=function(){var _0x2aaee2=this;return function(_0x385042){if(_0x385042){freeIsNotKey(_0x385042,_0x2aaee2['dynamics365Accounts'],'id');for(var _0x4a40b0=0x0,_0x24bc41={},_0x47612f={};_0x4a40b0<_0x385042[_0x1c45('0x47')];_0x4a40b0+=0x1){_0x24bc41=_0x385042[_0x4a40b0];if(_[_0x1c45('0x48')](_0x2aaee2['dynamics365Accounts'][_0x24bc41['id']])){_0x2aaee2[_0x1c45('0x24')][_0x24bc41['id']]=new Dynamics365Account(_0x24bc41);}else{_0x2aaee2['mergeFromDatabase'](_0x2aaee2[_0x1c45('0x24')][_0x24bc41['id']],_0x24bc41);}}}return _0x2aaee2['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x4a4b1d=this;return function(_0x15d852){if(_0x15d852){freeIsNotKey(_0x15d852,_0x4a4b1d['freshsalesAccounts'],'id');for(var _0x1ee54e=0x0,_0x227f1d={},_0x381156={};_0x1ee54e<_0x15d852[_0x1c45('0x47')];_0x1ee54e+=0x1){_0x227f1d=_0x15d852[_0x1ee54e];if(_[_0x1c45('0x48')](_0x4a4b1d[_0x1c45('0x25')][_0x227f1d['id']])){_0x4a4b1d['freshsalesAccounts'][_0x227f1d['id']]=new FreshsalesAccount(_0x227f1d);}else{_0x4a4b1d[_0x1c45('0x45')](_0x4a4b1d[_0x1c45('0x25')][_0x227f1d['id']],_0x227f1d);}}}return _0x4a4b1d[_0x1c45('0x25')];};};Realtime['prototype'][_0x1c45('0x58')]=function(){var _0x58338c=this;return function(_0x84a4ad){for(var _0x5b1ba3=0x0;_0x5b1ba3<_0x84a4ad[_0x1c45('0x47')];_0x5b1ba3+=0x1){_[_0x1c45('0x59')](_0x58338c[_0x1c45('0x16')][_0x84a4ad[_0x5b1ba3][_0x1c45('0x2b')]],_0x84a4ad[_0x5b1ba3]);}return _0x58338c[_0x1c45('0x16')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x5a')]=function(){var _0x226f68=this;return function(_0x55357e){clearVoiceQueues(_0x226f68['voiceQueues']);if(_0x55357e){_0x55357e=_['groupBy'](_0x55357e,_0x1c45('0x5b'));for(var _0x482179 in _0x55357e){if(_0x55357e['hasOwnProperty'](_0x482179)){var _0x416612={};for(var _0x57ef51=0x0;_0x57ef51<_0x55357e[_0x482179][_0x1c45('0x47')];_0x57ef51+=0x1){var _0x4c26fc=_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x5c')];if(_0x226f68[_0x1c45('0x16')][_0x4c26fc]){if(_0x55357e[_0x482179][_0x57ef51]['queuecallerexit']){_0x226f68[_0x1c45('0x16')][_0x4c26fc][_0x1c45('0x36')]+=0x1;}if(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x5d')]){_0x226f68['voiceQueues'][_0x4c26fc][_0x1c45('0x37')]+=0x1;}_0x226f68['voiceQueues'][_0x4c26fc][_0x1c45('0x30')]+=moment(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x5e')])[_0x1c45('0x5f')](moment(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x60')]),_0x1c45('0x61'))||0x0;if(_0x57ef51===_0x55357e[_0x482179][_0x1c45('0x47')]-0x1){_0x226f68['voiceQueues'][_0x4c26fc][_0x1c45('0x31')]+=moment(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x62')]||_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x63')]||_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x64')])[_0x1c45('0x5f')](moment(_0x55357e[_0x482179][_0x57ef51]['queuecallerjoinAt']),_0x1c45('0x61'))||0x0;_0x226f68['voiceQueues'][_0x4c26fc][_0x1c45('0x2e')]+=0x1;if(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x65')]){_0x226f68[_0x1c45('0x16')][_0x4c26fc][_0x1c45('0x2f')]+=0x1;_0x226f68[_0x1c45('0x16')][_0x4c26fc][_0x1c45('0x32')]+=moment(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x62')])['diff'](moment(_0x55357e[_0x482179][_0x57ef51][_0x1c45('0x5e')]),'seconds')||0x0;}}else{_0x226f68['voiceQueues'][_0x4c26fc]['sumDuration']+=_0x226f68['voiceQueues'][_0x4c26fc][_0x1c45('0x30')]||0x0;}}}}}}return _0x226f68[_0x1c45('0x16')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x66')]=function(){var _0x31bca0=this;return function(_0x246c43){clearVoiceCallReports(_0x31bca0[_0x1c45('0x17')]);if(_0x246c43){for(var _0x38714e=0x0;_0x38714e<_0x246c43[_0x1c45('0x47')];_0x38714e+=0x1){_0x31bca0[_0x1c45('0x17')][_0x1c45('0x2e')]+=0x1;_0x31bca0[_0x1c45('0x17')][_0x1c45('0x31')]+=_0x246c43[_0x38714e][_0x1c45('0x67')];if(_0x246c43[_0x38714e][_0x1c45('0x68')]===_0x1c45('0x69')){_0x31bca0[_0x1c45('0x17')]['answered']+=0x1;_0x31bca0[_0x1c45('0x17')][_0x1c45('0x30')]+=_0x246c43[_0x38714e][_0x1c45('0x67')]-_0x246c43[_0x38714e]['billableseconds']||0x0;_0x31bca0[_0x1c45('0x17')][_0x1c45('0x32')]+=_0x246c43[_0x38714e][_0x1c45('0x6a')];}}}return _0x31bca0[_0x1c45('0x17')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x6b')]=function(){var _0x3b171c=this;return function(_0x1e0c3b){if(_0x1e0c3b){freeIsNotKey(_0x1e0c3b,_0x3b171c[_0x1c45('0x6c')],_0x1c45('0x2b'));for(var _0x12adc4=0x0,_0xcc68d2={};_0x12adc4<_0x1e0c3b[_0x1c45('0x47')];_0x12adc4+=0x1){_0xcc68d2=_0x1e0c3b[_0x12adc4];if(_['isUndefined'](_0x3b171c[_0x1c45('0x6c')][_0xcc68d2[_0x1c45('0x2b')]])){_0x3b171c[_0x1c45('0x6c')][_0xcc68d2[_0x1c45('0x2b')]]=new Campaign(_0xcc68d2);}else{_0x3b171c[_0x1c45('0x45')](_0x3b171c[_0x1c45('0x6c')][_0xcc68d2[_0x1c45('0x2b')]],_0xcc68d2);_0x3b171c['campaigns'][_0xcc68d2['name']][_0x1c45('0x6d')]=_0xcc68d2[_0x1c45('0x6e')]?_0xcc68d2[_0x1c45('0x6e')][_0x1c45('0x2b')]:undefined;}}}return _0x3b171c[_0x1c45('0x6c')];};};Realtime[_0x1c45('0x44')]['initVoiceExtensions']=function(){var _0x16a5d5=this;return function(_0x38e94c){if(_0x38e94c){freeIsNotKey(_0x38e94c,_0x16a5d5[_0x1c45('0x18')],'id');for(var _0x1dbfbd=0x0,_0x377ac4={};_0x1dbfbd<_0x38e94c[_0x1c45('0x47')];_0x1dbfbd+=0x1){_0x377ac4=_0x38e94c[_0x1dbfbd];if(_['isUndefined'](_0x16a5d5[_0x1c45('0x18')][_0x377ac4['id']])){_0x16a5d5[_0x1c45('0x18')][_0x377ac4['id']]=new VoiceExtension(_0x377ac4);}else{_0x16a5d5[_0x1c45('0x45')](_0x16a5d5['voiceExtensions'][_0x377ac4['id']],_0x377ac4);}}}return _0x16a5d5[_0x1c45('0x18')];};};Realtime[_0x1c45('0x44')]['initCampaignHopperHistory']=function(){var _0x2aa954=this;return function(_0x3fa9dd){clearCampaigns(_0x2aa954['campaigns']);for(var _0xd673ee=0x0;_0xd673ee<_0x3fa9dd[_0x1c45('0x47')];_0xd673ee+=0x1){_['merge'](_0x2aa954['campaigns'][_0x3fa9dd[_0xd673ee][_0x1c45('0x2b')]],_0x3fa9dd[_0xd673ee]);}return _0x2aa954[_0x1c45('0x6c')];};};Realtime[_0x1c45('0x44')][_0x1c45('0x6f')]=function(){var _0xc66dd5=this;return function(_0x2e290d){if(_0x2e290d){freeIsNotKey(_0x2e290d,_0xc66dd5[_0x1c45('0x26')],'id');for(var _0x56e0dd=0x0,_0x509856={},_0x391a7b={};_0x56e0dd<_0x2e290d[_0x1c45('0x47')];_0x56e0dd+=0x1){_0x509856=_0x2e290d[_0x56e0dd];if(_[_0x1c45('0x48')](_0xc66dd5[_0x1c45('0x26')][_0x509856['id']])){_0xc66dd5[_0x1c45('0x26')][_0x509856['id']]=new FaxAccount(_0x509856);}else{_0xc66dd5[_0x1c45('0x45')](_0xc66dd5[_0x1c45('0x26')][_0x509856['id']],_0x509856);}}}return _0xc66dd5[_0x1c45('0x26')];};};module[_0x1c45('0x70')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index a2c15e1..db1c5c6 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 _0x5873=['accountcode','name','isNil','interface','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','voiceCallReport','destination','type','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','monitor','monitors','length','monitorFilename','filename','createdAt','exten','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','voiceAgentReport','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','voiceQueueReport','bind','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find'];(function(_0x2fe476,_0x23e932){var _0x295281=function(_0x327aa3){while(--_0x327aa3){_0x2fe476['push'](_0x2fe476['shift']());}};_0x295281(++_0x23e932);}(_0x5873,0x144));var _0x3587=function(_0x2e38d3,_0x392642){_0x2e38d3=_0x2e38d3-0x0;var _0x2cd2a9=_0x5873[_0x2e38d3];return _0x2cd2a9;};'use strict';var _=require(_0x3587('0x0'));var moment=require('moment');var util=require(_0x3587('0x1'));var config=require(_0x3587('0x2'));var ami=require(_0x3587('0x3'));var RpcVoiceAgentReport=require(_0x3587('0x4'));var RpcVoiceCallReport=require(_0x3587('0x5'));var RpcVoiceDialReport=require(_0x3587('0x6'));var RpcMemberReport=require(_0x3587('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x3587('0x8'));var RpcVoiceTransferReport=require(_0x3587('0x9'));var VoiceQueueReport=require(_0x3587('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3587('0xb'));var VoiceDialReport=require(_0x3587('0xc'));var UserReport=require('./userReport');function Report(_0x503d2e){this[_0x3587('0xd')]=_0x503d2e;this[_0x3587('0xe')]=_0x503d2e['agents'];this[_0x3587('0xf')]=_0x503d2e[_0x3587('0xf')];}Report[_0x3587('0x10')]['sync']=function(_0x9368aa){var _0x3bd30e=new VoiceQueueReport(this[_0x3587('0xd')]);var _0x50ec71=new VoiceAgentReport(this[_0x3587('0xd')]);var _0x290210=new VoiceDialReport(this['realtime']);var _0x12507d=new VoiceCallReport(this[_0x3587('0xd')]);var _0x4e76da=new UserReport(this[_0x3587('0xd')]);if(config[_0x3587('0x11')]&&config['xdr'][_0x3587('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x3587('0x13')]['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x3587('0x14')](this));ami['on'](_0x3587('0x15'),this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this[_0x3587('0x16')]['bind'](this));ami['on'](_0x3587('0x17'),this[_0x3587('0x18')][_0x3587('0x14')](this));ami['on'](_0x3587('0x19'),this['attendedTransfer'][_0x3587('0x14')](this));}};Report[_0x3587('0x10')][_0x3587('0x1a')]=function(_0x221793){var _0x18a884;_0x18a884=_[_0x3587('0x1b')](this[_0x3587('0xe')],function(_0x228066){return _0x228066[_0x3587('0x1c')]==_0x221793||_0x228066[_0x3587('0x1d')]==_0x221793;});if(_[_0x3587('0x1e')](_0x18a884)){var _0x3bc776=_[_0x3587('0x1b')](this[_0x3587('0xf')],function(_0x47c576){return _0x47c576[_0x3587('0x1c')]==_0x221793||_0x47c576[_0x3587('0x1d')]==_0x221793;});if(_0x3bc776){_0x18a884=_[_0x3587('0x1b')](this[_0x3587('0xe')],function(_0xd14f18){return _0xd14f18[_0x3587('0x1f')]==util[_0x3587('0x20')](_0x3587('0x21'),_0x3bc776[_0x3587('0x1d')]);});}}return _0x18a884;};Report[_0x3587('0x10')]['voiceQueueReport']=function(_0x11802a){for(var _0x3f19ca=0x0;_0x3f19ca<_0x11802a['length'];_0x3f19ca+=0x1){var _0xdd070a=this['findAgent'](_0x11802a[_0x3f19ca][_0x3587('0x22')]);if(_0xdd070a){_0x11802a[_0x3f19ca][_0x3587('0x1c')]=_0xdd070a['accountcode'];_0x11802a[_0x3f19ca][_0x3587('0x23')]=!![];_0x11802a[_0x3f19ca][_0x3587('0x24')]=_0xdd070a[_0x3587('0x1d')];_0x11802a[_0x3f19ca][_0x3587('0x1f')]=_[_0x3587('0x1e')](_0xdd070a['interface'])?util[_0x3587('0x20')](_0x3587('0x21'),_0xdd070a[_0x3587('0x1d')]):_0xdd070a[_0x3587('0x1f')];if(_0x11802a[_0x3f19ca][_0x3587('0x25')]){_0x11802a[_0x3f19ca][_0x3587('0x26')]=moment()[_0x3587('0x20')](_0x3587('0x27'));}if(_0x11802a[_0x3f19ca][_0x3587('0x28')]){_0x11802a[_0x3f19ca][_0x3587('0x29')]=moment()[_0x3587('0x20')](_0x3587('0x27'));}RpcMemberReport[_0x3587('0x13')](_0x11802a[_0x3f19ca]);}RpcVoiceQueueReport[_0x3587('0x2a')](_0x11802a[_0x3f19ca]);}};function extractCalleridNumber(_0x5ade86){var _0x273e0b=_0x5ade86['match'](/<(.*?)>/);return _0x273e0b?_0x273e0b[0x1]:_0x5ade86;}Report[_0x3587('0x10')][_0x3587('0x2b')]=function(_0x3b95b4){_0x3b95b4['destination']=_0x3b95b4[_0x3587('0x2c')]||_0x3b95b4['exten'];if(_0x3b95b4[_0x3587('0x2d')]=='dialer'){_0x3b95b4[_0x3587('0x2e')]=_0x3587('0x2f');_0x3b95b4[_0x3587('0x30')]=_0x3b95b4[_0x3587('0x2f')];if(_0x3b95b4[_0x3587('0x31')]=='from-voip-provider'){_0x3b95b4[_0x3587('0x1c')]='';_0x3b95b4[_0x3587('0x2c')]=extractCalleridNumber(_0x3b95b4['callerid']);}else if(_0x3b95b4[_0x3587('0x31')]==_0x3587('0x32')){if(_0x3b95b4[_0x3587('0x2c')]==_0x3587('0x33')){_0x3b95b4[_0x3587('0x2c')]=extractCalleridNumber(_0x3b95b4[_0x3587('0x34')]);_0x3b95b4[_0x3587('0x35')]=_0x3b95b4['originatecalleridnum'];_0x3b95b4[_0x3587('0x36')]=[_0x3b95b4[_0x3587('0x37')],_0x3b95b4[_0x3587('0x37')]=_0x3b95b4['destinationchannel']][0x0];_0x3b95b4[_0x3587('0x38')]=_0x3b95b4[_0x3587('0x34')];}else{_0x3b95b4[_0x3587('0x2c')]=_0x3b95b4[_0x3587('0x35')];_0x3b95b4[_0x3587('0x35')]=_0x3b95b4['originatecalleridnum'];if(_0x3b95b4[_0x3587('0x39')]==_0x3587('0x3a')){_0x3b95b4[_0x3587('0x1c')]=_0x3b95b4[_0x3587('0x22')];}else{_0x3b95b4[_0x3587('0x1c')]='';}}}}else{_0x3b95b4[_0x3587('0x38')]=util[_0x3587('0x20')](_0x3587('0x3b'),_0x3b95b4[_0x3587('0x3c')],_0x3b95b4[_0x3587('0x35')]);}if(RpcVoiceTransferReport[_0x3587('0x3d')][_0x3b95b4['linkedid']]){var _0x561ce8=RpcVoiceTransferReport[_0x3587('0x3d')][_0x3b95b4['linkedid']];_0x561ce8[_0x3587('0x3e')]=_0x3b95b4[_0x3587('0x3f')];RpcVoiceTransferReport[_0x3587('0x18')](_0x561ce8);delete RpcVoiceTransferReport[_0x3587('0x3d')][_0x3b95b4[_0x3587('0x40')]];}RpcVoiceCallReport[_0x3587('0x2a')](_0x3b95b4);if(_0x3b95b4[_0x3587('0x41')]){for(var _0x2f4e6f=0x0;_0x2f4e6f<_0x3b95b4[_0x3587('0x42')][_0x3587('0x43')];_0x2f4e6f+=0x1){_0x3b95b4[_0x3587('0x44')]=_0x3b95b4['monitors'][_0x2f4e6f][_0x3587('0x45')];_0x3b95b4[_0x3587('0x46')]=_0x3b95b4[_0x3587('0x42')][_0x2f4e6f][_0x3587('0x46')];if(_0x3b95b4[_0x3587('0x47')]==_0x3587('0x33')){_0x3b95b4['calleridnum']=_0x3b95b4[_0x3587('0x22')];_0x3b95b4[_0x3587('0x3c')]=_0x3b95b4['connectedlinename'];_0x3b95b4[_0x3587('0x22')]=_0x3b95b4[_0x3587('0x1c')];_0x3b95b4[_0x3587('0x48')]=_0x3b95b4[_0x3587('0x49')];_0x3b95b4[_0x3587('0x47')]=_0x3b95b4[_0x3587('0x4a')];}else if(_0x3b95b4[_0x3587('0x47')]==_0x3587('0x4b')){_0x3b95b4[_0x3587('0x35')]=_0x3b95b4[_0x3587('0x2c')];_0x3b95b4[_0x3587('0x47')]=_0x3b95b4[_0x3587('0x4a')];}RpcVoiceRecording[_0x3587('0x2a')](_0x3b95b4);}}};Report['prototype'][_0x3587('0x4c')]=function(_0x427aa4){if(_['isArray'](_0x427aa4)){_0x427aa4[_0x3587('0x4d')](function(_0x577921){RpcVoiceAgentReport[_0x3587('0x2a')](_0x577921);});}else{RpcVoiceAgentReport[_0x3587('0x2a')](_0x427aa4);}};Report['prototype'][_0x3587('0x16')]=function(_0x538573){RpcVoiceDialReport[_0x3587('0x2a')](_0x538573);var _0x29332e;var _0x1cdd0b;var _0x2d42b5=_0x538573[_0x3587('0x37')];if(_[_0x3587('0x4e')](_0x2d42b5,_0x3587('0x4f'))){_0x1cdd0b=_0x2d42b5[_0x3587('0x50')](_0x2d42b5[_0x3587('0x51')]('/')+0x1,_0x2d42b5[_0x3587('0x51')]('@'));_0x29332e=_[_0x3587('0x1b')](this['agents'],function(_0x358448){return _0x358448[_0x3587('0x52')]==_0x1cdd0b||_0x358448[_0x3587('0x53')]==_0x1cdd0b||_0x358448[_0x3587('0x1c')]==_0x1cdd0b;});}else{_0x1cdd0b=_0x2d42b5[_0x3587('0x50')](_0x2d42b5[_0x3587('0x51')]('/')+0x1,_0x2d42b5[_0x3587('0x54')]('-'));_0x29332e=this[_0x3587('0x1a')](_0x1cdd0b);}if(_0x29332e){_0x538573[_0x3587('0x1f')]=_['isNil'](_0x29332e[_0x3587('0x1f')])?util[_0x3587('0x20')]('SIP/%s',_0x29332e[_0x3587('0x1d')]):_0x29332e[_0x3587('0x1f')];_0x538573[_0x3587('0x49')]=_0x29332e['name'];_0x538573[_0x3587('0x1c')]=_0x29332e['accountcode'];RpcMemberReport[_0x3587('0x16')](_0x538573);}};Report[_0x3587('0x10')][_0x3587('0x18')]=function(_0xef0988){RpcVoiceTransferReport['transfers'][_0xef0988[_0x3587('0x55')]]=_0xef0988;};Report[_0x3587('0x10')][_0x3587('0x56')]=function(_0x46a3f1){RpcVoiceTransferReport[_0x3587('0x56')](_0x46a3f1);};module[_0x3587('0x57')]=Report; \ No newline at end of file +var _0x5fcc=['originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitors','length','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','isNil','transfererlinkedid','exports','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','SIP/%s','prototype','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum'];(function(_0x273964,_0x367a32){var _0x41346a=function(_0x379e3c){while(--_0x379e3c){_0x273964['push'](_0x273964['shift']());}};_0x41346a(++_0x367a32);}(_0x5fcc,0x11e));var _0xc5fc=function(_0x1ae885,_0x4e4b72){_0x1ae885=_0x1ae885-0x0;var _0x354a46=_0x5fcc[_0x1ae885];return _0x354a46;};'use strict';var _=require('lodash');var moment=require(_0xc5fc('0x0'));var util=require(_0xc5fc('0x1'));var config=require(_0xc5fc('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xc5fc('0x3'));var RpcVoiceCallReport=require(_0xc5fc('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xc5fc('0x5'));var RpcVoiceQueueReport=require(_0xc5fc('0x6'));var RpcVoiceRecording=require(_0xc5fc('0x7'));var RpcVoiceTransferReport=require(_0xc5fc('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xc5fc('0x9'));var VoiceDialReport=require(_0xc5fc('0xa'));var UserReport=require(_0xc5fc('0xb'));function Report(_0x15091f){this[_0xc5fc('0xc')]=_0x15091f;this[_0xc5fc('0xd')]=_0x15091f[_0xc5fc('0xd')];this[_0xc5fc('0xe')]=_0x15091f[_0xc5fc('0xe')];}Report['prototype']['sync']=function(_0x3147f9){var _0x2fd032=new VoiceQueueReport(this[_0xc5fc('0xc')]);var _0x32086a=new VoiceAgentReport(this[_0xc5fc('0xc')]);var _0x3b9680=new VoiceDialReport(this[_0xc5fc('0xc')]);var _0x43799c=new VoiceCallReport(this['realtime']);var _0x2430ca=new UserReport(this[_0xc5fc('0xc')]);if(config[_0xc5fc('0xf')]&&config[_0xc5fc('0xf')][_0xc5fc('0x10')]){ami['on'](_0xc5fc('0x11'),this[_0xc5fc('0x12')]['bind'](this));ami['on'](_0xc5fc('0x13'),this['voiceCallReport'][_0xc5fc('0x14')](this));ami['on'](_0xc5fc('0x15'),this[_0xc5fc('0x16')][_0xc5fc('0x14')](this));ami['on'](_0xc5fc('0x17'),this[_0xc5fc('0x18')]['bind'](this));ami['on'](_0xc5fc('0x19'),this['blindTransfer'][_0xc5fc('0x14')](this));ami['on'](_0xc5fc('0x1a'),this[_0xc5fc('0x1b')][_0xc5fc('0x14')](this));}};Report['prototype'][_0xc5fc('0x1c')]=function(_0x44cad1){var _0x401999;_0x401999=_[_0xc5fc('0x1d')](this['agents'],function(_0x2b0800){return _0x2b0800[_0xc5fc('0x1e')]==_0x44cad1||_0x2b0800[_0xc5fc('0x1f')]==_0x44cad1;});if(_['isNil'](_0x401999)){var _0x2142a6=_[_0xc5fc('0x1d')](this[_0xc5fc('0xe')],function(_0x3f869b){return _0x3f869b[_0xc5fc('0x1e')]==_0x44cad1||_0x3f869b['name']==_0x44cad1;});if(_0x2142a6){_0x401999=_['find'](this[_0xc5fc('0xd')],function(_0x4a186e){return _0x4a186e[_0xc5fc('0x20')]==util['format'](_0xc5fc('0x21'),_0x2142a6[_0xc5fc('0x1f')]);});}}return _0x401999;};Report[_0xc5fc('0x22')][_0xc5fc('0x12')]=function(_0x4e37a2){for(var _0x4c75c0=0x0;_0x4c75c0<_0x4e37a2['length'];_0x4c75c0+=0x1){var _0x58ac17=this[_0xc5fc('0x1c')](_0x4e37a2[_0x4c75c0][_0xc5fc('0x23')]);if(_0x58ac17){_0x4e37a2[_0x4c75c0][_0xc5fc('0x1e')]=_0x58ac17[_0xc5fc('0x1e')];_0x4e37a2[_0x4c75c0][_0xc5fc('0x24')]=!![];_0x4e37a2[_0x4c75c0][_0xc5fc('0x25')]=_0x58ac17[_0xc5fc('0x1f')];_0x4e37a2[_0x4c75c0]['interface']=_['isNil'](_0x58ac17[_0xc5fc('0x20')])?util['format'](_0xc5fc('0x21'),_0x58ac17['name']):_0x58ac17[_0xc5fc('0x20')];if(_0x4e37a2[_0x4c75c0][_0xc5fc('0x26')]){_0x4e37a2[_0x4c75c0][_0xc5fc('0x27')]=moment()[_0xc5fc('0x28')](_0xc5fc('0x29'));}if(_0x4e37a2[_0x4c75c0][_0xc5fc('0x2a')]){_0x4e37a2[_0x4c75c0][_0xc5fc('0x2b')]=moment()['format'](_0xc5fc('0x29'));}RpcMemberReport[_0xc5fc('0x12')](_0x4e37a2[_0x4c75c0]);}RpcVoiceQueueReport[_0xc5fc('0x2c')](_0x4e37a2[_0x4c75c0]);}};function extractCalleridNumber(_0x5ee668){var _0x419145=_0x5ee668[_0xc5fc('0x2d')](/<(.*?)>/);return _0x419145?_0x419145[0x1]:_0x5ee668;}Report['prototype'][_0xc5fc('0x2e')]=function(_0x429772){_0x429772['destination']=_0x429772[_0xc5fc('0x2f')]||_0x429772[_0xc5fc('0x30')];if(_0x429772['type']=='dialer'){_0x429772[_0xc5fc('0x31')]=_0xc5fc('0x32');_0x429772[_0xc5fc('0x33')]=_0x429772[_0xc5fc('0x32')];if(_0x429772[_0xc5fc('0x34')]==_0xc5fc('0x35')){_0x429772[_0xc5fc('0x1e')]='';_0x429772['destination']=extractCalleridNumber(_0x429772[_0xc5fc('0x36')]);}else if(_0x429772['context']==_0xc5fc('0x37')){if(_0x429772[_0xc5fc('0x2f')]=='xcally-motion-preview'){_0x429772[_0xc5fc('0x2f')]=extractCalleridNumber(_0x429772[_0xc5fc('0x38')]);_0x429772[_0xc5fc('0x39')]=_0x429772[_0xc5fc('0x3a')];_0x429772[_0xc5fc('0x3b')]=[_0x429772['channel'],_0x429772[_0xc5fc('0x3c')]=_0x429772['destinationchannel']][0x0];_0x429772[_0xc5fc('0x36')]=_0x429772[_0xc5fc('0x38')];}else{_0x429772['destination']=_0x429772[_0xc5fc('0x39')];_0x429772[_0xc5fc('0x39')]=_0x429772['originatecalleridnum'];if(_0x429772[_0xc5fc('0x3d')]==_0xc5fc('0x3e')){_0x429772[_0xc5fc('0x1e')]=_0x429772['connectedlinenum'];}else{_0x429772[_0xc5fc('0x1e')]='';}}}}else{_0x429772[_0xc5fc('0x36')]=util['format']('\x22%s\x22\x20<%s>',_0x429772[_0xc5fc('0x3f')],_0x429772['calleridnum']);}if(RpcVoiceTransferReport[_0xc5fc('0x40')][_0x429772[_0xc5fc('0x41')]]){var _0x54d5a8=RpcVoiceTransferReport[_0xc5fc('0x40')][_0x429772['linkedid']];_0x54d5a8[_0xc5fc('0x42')]=_0x429772[_0xc5fc('0x43')];RpcVoiceTransferReport[_0xc5fc('0x44')](_0x54d5a8);delete RpcVoiceTransferReport[_0xc5fc('0x40')][_0x429772[_0xc5fc('0x41')]];}RpcVoiceCallReport[_0xc5fc('0x2c')](_0x429772);if(_0x429772['monitor']){for(var _0x24ec0a=0x0;_0x24ec0a<_0x429772[_0xc5fc('0x45')][_0xc5fc('0x46')];_0x24ec0a+=0x1){_0x429772['monitorFilename']=_0x429772[_0xc5fc('0x45')][_0x24ec0a][_0xc5fc('0x47')];_0x429772[_0xc5fc('0x48')]=_0x429772[_0xc5fc('0x45')][_0x24ec0a]['createdAt'];if(_0x429772[_0xc5fc('0x30')]=='xcally-motion-preview'){_0x429772['calleridnum']=_0x429772['connectedlinenum'];_0x429772[_0xc5fc('0x3f')]=_0x429772[_0xc5fc('0x49')];_0x429772[_0xc5fc('0x23')]=_0x429772[_0xc5fc('0x1e')];_0x429772[_0xc5fc('0x49')]=_0x429772[_0xc5fc('0x4a')];_0x429772[_0xc5fc('0x30')]=_0x429772[_0xc5fc('0x3a')];}else if(_0x429772[_0xc5fc('0x30')]==_0xc5fc('0x4b')){_0x429772[_0xc5fc('0x39')]=_0x429772[_0xc5fc('0x2f')];_0x429772[_0xc5fc('0x30')]=_0x429772['originatecalleridnum'];}RpcVoiceRecording['create'](_0x429772);}}};Report[_0xc5fc('0x22')][_0xc5fc('0x16')]=function(_0x5644aa){if(_['isArray'](_0x5644aa)){_0x5644aa[_0xc5fc('0x4c')](function(_0x52677d){RpcVoiceAgentReport[_0xc5fc('0x2c')](_0x52677d);});}else{RpcVoiceAgentReport['create'](_0x5644aa);}};Report[_0xc5fc('0x22')][_0xc5fc('0x18')]=function(_0x4934e4){RpcVoiceDialReport['create'](_0x4934e4);var _0x4d26b2;var _0x19cc78;var _0x14139b=_0x4934e4['channel'];if(_[_0xc5fc('0x4d')](_0x14139b,_0xc5fc('0x4e'))){_0x19cc78=_0x14139b[_0xc5fc('0x4f')](_0x14139b[_0xc5fc('0x50')]('/')+0x1,_0x14139b[_0xc5fc('0x50')]('@'));_0x4d26b2=_[_0xc5fc('0x1d')](this[_0xc5fc('0xd')],function(_0xdbf6f3){return _0xdbf6f3['mobile']==_0x19cc78||_0xdbf6f3[_0xc5fc('0x51')]==_0x19cc78||_0xdbf6f3[_0xc5fc('0x1e')]==_0x19cc78;});}else{_0x19cc78=_0x14139b[_0xc5fc('0x4f')](_0x14139b[_0xc5fc('0x50')]('/')+0x1,_0x14139b[_0xc5fc('0x52')]('-'));_0x4d26b2=this['findAgent'](_0x19cc78);}if(_0x4d26b2){_0x4934e4[_0xc5fc('0x20')]=_[_0xc5fc('0x53')](_0x4d26b2[_0xc5fc('0x20')])?util[_0xc5fc('0x28')]('SIP/%s',_0x4d26b2[_0xc5fc('0x1f')]):_0x4d26b2['interface'];_0x4934e4[_0xc5fc('0x4a')]=_0x4d26b2[_0xc5fc('0x1f')];_0x4934e4[_0xc5fc('0x1e')]=_0x4d26b2[_0xc5fc('0x1e')];RpcMemberReport[_0xc5fc('0x18')](_0x4934e4);}};Report[_0xc5fc('0x22')][_0xc5fc('0x44')]=function(_0x8b7278){RpcVoiceTransferReport[_0xc5fc('0x40')][_0x8b7278[_0xc5fc('0x54')]]=_0x8b7278;};Report[_0xc5fc('0x22')][_0xc5fc('0x1b')]=function(_0x3d3a71){RpcVoiceTransferReport[_0xc5fc('0x1b')](_0x3d3a71);};module[_0xc5fc('0x55')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index cb5c653..b1727b9 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc1b=['[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','toNumber','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','startsWith','substring','indexOf','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','util','../../../config/environment','ami','../ami','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','actionSipShowRegistry','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','prototype','syncRealtimeShow','then','isNotNull','isUndefined','emit','username','state','debug','find','stateRegistry','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','[userReport][registry]','info'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0xcc1b,0x1bf));var _0xbcc1=function(_0x1d0a92,_0x5e5bb0){_0x1d0a92=_0x1d0a92-0x0;var _0x5ab706=_0xcc1b[_0x1d0a92];return _0x5ab706;};'use strict';var _=require(_0xbcc1('0x0'));var moment=require('moment');var util=require(_0xbcc1('0x1'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xbcc1('0x2'));var logger=require('../../../config/logger')(_0xbcc1('0x3'));var ami=require(_0xbcc1('0x4'));config[_0xbcc1('0x5')]=_['defaults'](config[_0xbcc1('0x5')],{'host':_0xbcc1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbcc1('0x5')]));function UserReport(_0x561b4e){this[_0xbcc1('0x7')]=_0x561b4e[_0xbcc1('0x7')];this[_0xbcc1('0x8')]=_0x561b4e['agents'];this[_0xbcc1('0x9')]=_0x561b4e[_0xbcc1('0x9')];ami['on'](_0xbcc1('0xa'),this[_0xbcc1('0xb')]['bind'](this));ami['on'](_0xbcc1('0xc'),this[_0xbcc1('0xb')][_0xbcc1('0xd')](this));ami['on'](_0xbcc1('0xe'),this[_0xbcc1('0xf')][_0xbcc1('0xd')](this));ami['on'](_0xbcc1('0x10'),this[_0xbcc1('0x11')][_0xbcc1('0xd')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xbcc1('0x12')]()['then'](ami[_0xbcc1('0x13')]())['catch'](function(_0x35545d){logger[_0xbcc1('0x14')]('[userReport][sipshowregistry]',util[_0xbcc1('0x15')](_0x35545d,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xbcc1('0x12')]()['then'](ami[_0xbcc1('0x16')]())['catch'](function(_0x3f830a){logger[_0xbcc1('0x14')](_0xbcc1('0x17'),util[_0xbcc1('0x15')](_0x3f830a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xbcc1('0x12')]()['then'](ami['actionSipPeerStatus']())['catch'](function(_0xa235a6){logger['error']('[userReport][sippeerstatus]',util[_0xbcc1('0x15')](_0xa235a6,{'showHidden':![],'depth':null}));});}UserReport[_0xbcc1('0x18')][_0xbcc1('0x19')]=function(){setInterval(function(){BPromise[_0xbcc1('0x12')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0xbcc1('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0xbcc1('0x18')][_0xbcc1('0x1b')]=function(_0x218d20){return _0x218d20!==null&&!_[_0xbcc1('0x1c')](_0x218d20);};UserReport[_0xbcc1('0x18')][_0xbcc1('0x1d')]=function(_0x3401b7,_0x11992b,_0xf31d24){io['to'](_0x3401b7)[_0xbcc1('0x1d')](_0x11992b,_0xf31d24);};UserReport[_0xbcc1('0x18')]['syncRegistry']=function(_0x2ed9f5){try{if(this[_0xbcc1('0x1b')](_0x2ed9f5)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x2ed9f5[_0xbcc1('0x1e')],_0x2ed9f5[_0xbcc1('0x1f')]);logger[_0xbcc1('0x20')]('[userReport][registry]',util[_0xbcc1('0x15')](_0x2ed9f5,{'showHidden':![],'depth':null}));var _0x5804da=_[_0xbcc1('0x21')](this[_0xbcc1('0x7')],{'defaultuser':_0x2ed9f5['username']});if(_0x5804da){_0x2ed9f5[_0xbcc1('0x22')]=_0x2ed9f5[_0xbcc1('0x1f')];_[_0xbcc1('0x23')](_0x5804da,_['omit'](_0x2ed9f5,[_0xbcc1('0x24'),_0xbcc1('0x25'),_0xbcc1('0x1e'),_0xbcc1('0x1f')]));logger[_0xbcc1('0x20')](_0xbcc1('0x26'),util[_0xbcc1('0x15')](_0x5804da,{'showHidden':![],'depth':null}));this['emit'](util[_0xbcc1('0x27')]('trunk:%s',_0x5804da[_0xbcc1('0x28')]),'trunk:save',_0x5804da);}}}catch(_0x5d2d11){logger[_0xbcc1('0x14')](_0xbcc1('0x29'),util[_0xbcc1('0x15')](_0x5d2d11,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xbcc1('0xf')]=function(_0x3610ec){try{if(this[_0xbcc1('0x1b')](_0x3610ec)){logger[_0xbcc1('0x2a')](_0xbcc1('0x2b'),_0x3610ec[_0xbcc1('0x2c')],_0x3610ec['state']);logger[_0xbcc1('0x20')](_0xbcc1('0x2d'),util[_0xbcc1('0x15')](_0x3610ec,{'showHidden':![],'depth':null}));if(this['agents'][_0x3610ec[_0xbcc1('0x2c')]]){if(!this[_0xbcc1('0x8')][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x2e')]||_0x3610ec[_0xbcc1('0x1f')][_0xbcc1('0x2f')]()==_0xbcc1('0x30')){this[_0xbcc1('0x8')][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x2e')]=![];if(this[_0xbcc1('0x8')][_0x3610ec['device']][_0xbcc1('0x1f')]!==_0x3610ec[_0xbcc1('0x1f')]['toLowerCase']()){this[_0xbcc1('0x8')][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x31')]=_['toNumber'](moment()[_0xbcc1('0x27')]('x'));}this['agents'][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x1f')]=_0x3610ec[_0xbcc1('0x1f')]['toLowerCase']();this[_0xbcc1('0x8')][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x32')](_0x3610ec);}}else if(this['telephones'][_0x3610ec[_0xbcc1('0x2c')]]){if(this['telephones'][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x1f')]!==_0x3610ec[_0xbcc1('0x1f')][_0xbcc1('0x2f')]()){this[_0xbcc1('0x9')][_0x3610ec['device']][_0xbcc1('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0xbcc1('0x9')][_0x3610ec['device']][_0xbcc1('0x1f')]=_0x3610ec[_0xbcc1('0x1f')][_0xbcc1('0x2f')]();logger[_0xbcc1('0x20')](_0xbcc1('0x33'),util[_0xbcc1('0x15')](this[_0xbcc1('0x9')][_0x3610ec[_0xbcc1('0x2c')]],{'showHidden':![],'depth':null}));this[_0xbcc1('0x1d')](util['format'](_0xbcc1('0x34'),this[_0xbcc1('0x9')][_0x3610ec[_0xbcc1('0x2c')]][_0xbcc1('0x28')]),_0xbcc1('0x35'),this[_0xbcc1('0x9')][_0x3610ec[_0xbcc1('0x2c')]]);}else if(this[_0xbcc1('0x7')][_0x3610ec[_0xbcc1('0x2c')]]){if(this[_0xbcc1('0x7')][_0x3610ec['device']][_0xbcc1('0x1f')]!==_0x3610ec[_0xbcc1('0x1f')][_0xbcc1('0x2f')]()){this[_0xbcc1('0x7')][_0x3610ec['device']]['stateTime']=_[_0xbcc1('0x36')](moment()[_0xbcc1('0x27')]('x'));}this[_0xbcc1('0x7')][_0x3610ec['device']]['state']=_0x3610ec['state'][_0xbcc1('0x2f')]();logger[_0xbcc1('0x20')](_0xbcc1('0x37'),util['inspect'](this[_0xbcc1('0x7')][_0x3610ec[_0xbcc1('0x2c')]],{'showHidden':![],'depth':null}));this[_0xbcc1('0x1d')](util['format'](_0xbcc1('0x38'),this['trunks'][_0x3610ec[_0xbcc1('0x2c')]]['name']),_0xbcc1('0x39'),this[_0xbcc1('0x7')][_0x3610ec['device']]);}else if(_[_0xbcc1('0x3a')](_0x3610ec[_0xbcc1('0x2c')],'Local')){var _0x12dc97=_0x3610ec[_0xbcc1('0x2c')];var _0x568726=_0x12dc97[_0xbcc1('0x3b')](_0x12dc97['indexOf']('/')+0x1,_0x12dc97[_0xbcc1('0x3c')]('@'));var _0x437270=_[_0xbcc1('0x21')](this['agents'],function(_0xc230ef){return _0xc230ef['mobile']==_0x568726||_0xc230ef[_0xbcc1('0x3d')]==_0x568726||_0xc230ef['accountcode']==_0x568726;});if(_0x437270){if(_0x437270[_0xbcc1('0x1f')]!==_0x3610ec[_0xbcc1('0x1f')][_0xbcc1('0x2f')]()){_0x437270['stateTime']=_[_0xbcc1('0x36')](moment()[_0xbcc1('0x27')]('x'));}_0x437270[_0xbcc1('0x1f')]=_0x3610ec['state'][_0xbcc1('0x2f')]();_0x437270[_0xbcc1('0x2e')]=!![];_0x437270['updateStatusRealtime'](_0x3610ec);}}}}catch(_0x29ae0f){logger[_0xbcc1('0x14')](_0xbcc1('0x2d'),util[_0xbcc1('0x15')](_0x29ae0f,{'showHidden':![],'depth':null}));}};UserReport[_0xbcc1('0x18')][_0xbcc1('0x11')]=function(_0xabff7c){try{if(this['isNotNull'](_0xabff7c)&&this[_0xbcc1('0x1b')](_0xabff7c[_0xbcc1('0x10')])){logger[_0xbcc1('0x2a')](_0xbcc1('0x3e'),_0xabff7c[_0xbcc1('0x3f')],_0xabff7c['address'],_0xabff7c[_0xbcc1('0x10')]);logger[_0xbcc1('0x20')](_0xbcc1('0x40'),util['inspect'](_0xabff7c,{'showHidden':![],'depth':null}));if(this[_0xbcc1('0x8')][_0xabff7c[_0xbcc1('0x3f')]]){if(!this['agents'][_0xabff7c['peer']]['local']||_0xabff7c['peerstatus']['toLowerCase']()==_0xbcc1('0x41')){this[_0xbcc1('0x8')][_0xabff7c[_0xbcc1('0x3f')]]['local']=![];this[_0xbcc1('0x8')][_0xabff7c[_0xbcc1('0x3f')]]['status']=_0xabff7c['peerstatus'][_0xbcc1('0x2f')]();this['agents'][_0xabff7c['peer']][_0xbcc1('0x42')]=_0xabff7c[_0xbcc1('0x42')];this[_0xbcc1('0x8')][_0xabff7c['peer']]['updateStatusRealtime'](_0xabff7c);}}else if(this[_0xbcc1('0x9')][_0xabff7c[_0xbcc1('0x3f')]]){this['telephones'][_0xabff7c[_0xbcc1('0x3f')]][_0xbcc1('0x43')]=_0xabff7c[_0xbcc1('0x10')][_0xbcc1('0x2f')]();this[_0xbcc1('0x9')][_0xabff7c['peer']][_0xbcc1('0x42')]=_0xabff7c['address'];logger['debug'](_0xbcc1('0x44'),util[_0xbcc1('0x15')](this['telephones'][_0xabff7c[_0xbcc1('0x3f')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xbcc1('0x34'),this[_0xbcc1('0x9')][_0xabff7c[_0xbcc1('0x3f')]][_0xbcc1('0x28')]),_0xbcc1('0x35'),this[_0xbcc1('0x9')][_0xabff7c['peer']]);}else if(this['trunks'][_0xabff7c[_0xbcc1('0x3f')]]){this[_0xbcc1('0x7')][_0xabff7c[_0xbcc1('0x3f')]][_0xbcc1('0x43')]=_0xabff7c['peerstatus'][_0xbcc1('0x2f')]();this[_0xbcc1('0x7')][_0xabff7c['peer']][_0xbcc1('0x42')]=_0xabff7c[_0xbcc1('0x42')];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xbcc1('0x15')](this[_0xbcc1('0x7')][_0xabff7c[_0xbcc1('0x3f')]],{'showHidden':![],'depth':null}));this[_0xbcc1('0x1d')](util[_0xbcc1('0x27')](_0xbcc1('0x38'),this['trunks'][_0xabff7c[_0xbcc1('0x3f')]][_0xbcc1('0x28')]),_0xbcc1('0x39'),this[_0xbcc1('0x7')][_0xabff7c[_0xbcc1('0x3f')]]);}}}catch(_0x2638f1){logger[_0xbcc1('0x14')](_0xbcc1('0x40'),util['inspect'](_0x2638f1,{'showHidden':![],'depth':null}));}};module[_0xbcc1('0x45')]=UserReport; \ No newline at end of file +var _0x6d63=['local','stateTime','toNumber','updateStatusRealtime','telephones','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','trunk:%s','trunk:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','trunks','agents','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse'];(function(_0x4830d5,_0x3555c8){var _0x4857f6=function(_0x2249b1){while(--_0x2249b1){_0x4830d5['push'](_0x4830d5['shift']());}};_0x4857f6(++_0x3555c8);}(_0x6d63,0xb2));var _0x36d6=function(_0x3be414,_0x35e652){_0x3be414=_0x3be414-0x0;var _0xa47a04=_0x6d63[_0x3be414];return _0xa47a04;};'use strict';var _=require('lodash');var moment=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var Redis=require(_0x36d6('0x2'));var BPromise=require(_0x36d6('0x3'));var config=require(_0x36d6('0x4'));var logger=require(_0x36d6('0x5'))(_0x36d6('0x6'));var ami=require(_0x36d6('0x7'));config[_0x36d6('0x8')]=_['defaults'](config[_0x36d6('0x8')],{'host':_0x36d6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36d6('0x8')]));function UserReport(_0x2d6773){this[_0x36d6('0xa')]=_0x2d6773['trunks'];this['agents']=_0x2d6773[_0x36d6('0xb')];this['telephones']=_0x2d6773['telephones'];ami['on'](_0x36d6('0xc'),this[_0x36d6('0xd')][_0x36d6('0xe')](this));ami['on'](_0x36d6('0xf'),this[_0x36d6('0xd')][_0x36d6('0xe')](this));ami['on'](_0x36d6('0x10'),this[_0x36d6('0x11')][_0x36d6('0xe')](this));ami['on'](_0x36d6('0x12'),this[_0x36d6('0x13')][_0x36d6('0xe')](this));return this[_0x36d6('0x14')]();}function showSipRegistrations(){Promise[_0x36d6('0x15')]()[_0x36d6('0x16')](ami['actionSipShowRegistry']())[_0x36d6('0x17')](function(_0x328db1){logger[_0x36d6('0x18')](_0x36d6('0x19'),util['inspect'](_0x328db1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x36d6('0x16')](ami['actionDeviceStateList']())[_0x36d6('0x17')](function(_0x683ab6){logger[_0x36d6('0x18')]('[userReport][devicestatelist]',util[_0x36d6('0x1a')](_0x683ab6,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x36d6('0x15')]()['then'](ami[_0x36d6('0x1b')]())[_0x36d6('0x17')](function(_0x56eded){logger['error'](_0x36d6('0x1c'),util[_0x36d6('0x1a')](_0x56eded,{'showHidden':![],'depth':null}));});}UserReport[_0x36d6('0x1d')][_0x36d6('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0x36d6('0x16')](showSipRegistrations())[_0x36d6('0x16')](listDeviceStates())[_0x36d6('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x36d6('0x1d')]['isNotNull']=function(_0x43e805){return _0x43e805!==null&&!_[_0x36d6('0x1e')](_0x43e805);};UserReport[_0x36d6('0x1d')][_0x36d6('0x1f')]=function(_0x2a1c24,_0x648b4a,_0x1e77cf){io['to'](_0x2a1c24)[_0x36d6('0x1f')](_0x648b4a,_0x1e77cf);};UserReport['prototype'][_0x36d6('0xd')]=function(_0xdb8dfd){try{if(this[_0x36d6('0x20')](_0xdb8dfd)){logger[_0x36d6('0x21')](_0x36d6('0x22'),_0xdb8dfd[_0x36d6('0x23')],_0xdb8dfd[_0x36d6('0x24')]);logger[_0x36d6('0x25')](_0x36d6('0x26'),util[_0x36d6('0x1a')](_0xdb8dfd,{'showHidden':![],'depth':null}));var _0x6b7e50=_[_0x36d6('0x27')](this['trunks'],{'defaultuser':_0xdb8dfd['username']});if(_0x6b7e50){_0xdb8dfd['stateRegistry']=_0xdb8dfd[_0x36d6('0x24')];_['merge'](_0x6b7e50,_[_0x36d6('0x28')](_0xdb8dfd,['event',_0x36d6('0x29'),_0x36d6('0x23'),_0x36d6('0x24')]));logger['debug'](_0x36d6('0x2a'),util[_0x36d6('0x1a')](_0x6b7e50,{'showHidden':![],'depth':null}));this[_0x36d6('0x1f')](util[_0x36d6('0x2b')]('trunk:%s',_0x6b7e50[_0x36d6('0x2c')]),'trunk:save',_0x6b7e50);}}}catch(_0x1bb449){logger[_0x36d6('0x18')](_0x36d6('0x26'),util[_0x36d6('0x1a')](_0x1bb449,{'showHidden':![],'depth':null}));}};UserReport[_0x36d6('0x1d')]['syncDeviceState']=function(_0x833b84){try{if(this[_0x36d6('0x20')](_0x833b84)){logger[_0x36d6('0x21')](_0x36d6('0x2d'),_0x833b84[_0x36d6('0x2e')],_0x833b84[_0x36d6('0x24')]);logger[_0x36d6('0x25')](_0x36d6('0x2f'),util['inspect'](_0x833b84,{'showHidden':![],'depth':null}));if(this[_0x36d6('0xb')][_0x833b84[_0x36d6('0x2e')]]){if(!this[_0x36d6('0xb')][_0x833b84[_0x36d6('0x2e')]]['local']||_0x833b84[_0x36d6('0x24')][_0x36d6('0x30')]()==_0x36d6('0x31')){this[_0x36d6('0xb')][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x32')]=![];if(this[_0x36d6('0xb')][_0x833b84['device']][_0x36d6('0x24')]!==_0x833b84[_0x36d6('0x24')][_0x36d6('0x30')]()){this[_0x36d6('0xb')][_0x833b84['device']][_0x36d6('0x33')]=_[_0x36d6('0x34')](moment()['format']('x'));}this['agents'][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x24')]=_0x833b84[_0x36d6('0x24')][_0x36d6('0x30')]();this[_0x36d6('0xb')][_0x833b84['device']][_0x36d6('0x35')](_0x833b84);}}else if(this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]]){if(this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x24')]!==_0x833b84['state'][_0x36d6('0x30')]()){this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x33')]=_[_0x36d6('0x34')](moment()[_0x36d6('0x2b')]('x'));}this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]]['state']=_0x833b84[_0x36d6('0x24')]['toLowerCase']();logger[_0x36d6('0x25')](_0x36d6('0x37'),util['inspect'](this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]],{'showHidden':![],'depth':null}));this[_0x36d6('0x1f')](util[_0x36d6('0x2b')](_0x36d6('0x38'),this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]]['name']),_0x36d6('0x39'),this[_0x36d6('0x36')][_0x833b84[_0x36d6('0x2e')]]);}else if(this['trunks'][_0x833b84[_0x36d6('0x2e')]]){if(this[_0x36d6('0xa')][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x24')]!==_0x833b84[_0x36d6('0x24')][_0x36d6('0x30')]()){this['trunks'][_0x833b84[_0x36d6('0x2e')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0x36d6('0xa')][_0x833b84['device']][_0x36d6('0x24')]=_0x833b84['state']['toLowerCase']();logger[_0x36d6('0x25')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x36d6('0xa')][_0x833b84[_0x36d6('0x2e')]],{'showHidden':![],'depth':null}));this[_0x36d6('0x1f')](util['format'](_0x36d6('0x3a'),this[_0x36d6('0xa')][_0x833b84[_0x36d6('0x2e')]][_0x36d6('0x2c')]),_0x36d6('0x3b'),this['trunks'][_0x833b84['device']]);}else if(_[_0x36d6('0x3c')](_0x833b84[_0x36d6('0x2e')],_0x36d6('0x3d'))){var _0x344f7a=_0x833b84[_0x36d6('0x2e')];var _0x5b8199=_0x344f7a[_0x36d6('0x3e')](_0x344f7a['indexOf']('/')+0x1,_0x344f7a[_0x36d6('0x3f')]('@'));var _0x5d9df7=_[_0x36d6('0x27')](this[_0x36d6('0xb')],function(_0x4c2553){return _0x4c2553[_0x36d6('0x40')]==_0x5b8199||_0x4c2553[_0x36d6('0x41')]==_0x5b8199||_0x4c2553[_0x36d6('0x42')]==_0x5b8199;});if(_0x5d9df7){if(_0x5d9df7[_0x36d6('0x24')]!==_0x833b84['state'][_0x36d6('0x30')]()){_0x5d9df7[_0x36d6('0x33')]=_[_0x36d6('0x34')](moment()[_0x36d6('0x2b')]('x'));}_0x5d9df7[_0x36d6('0x24')]=_0x833b84[_0x36d6('0x24')][_0x36d6('0x30')]();_0x5d9df7[_0x36d6('0x32')]=!![];_0x5d9df7[_0x36d6('0x35')](_0x833b84);}}}}catch(_0x17ba4e){logger[_0x36d6('0x18')](_0x36d6('0x2f'),util[_0x36d6('0x1a')](_0x17ba4e,{'showHidden':![],'depth':null}));}};UserReport[_0x36d6('0x1d')][_0x36d6('0x13')]=function(_0x4144a8){try{if(this[_0x36d6('0x20')](_0x4144a8)&&this['isNotNull'](_0x4144a8['peerstatus'])){logger['info'](_0x36d6('0x43'),_0x4144a8[_0x36d6('0x44')],_0x4144a8[_0x36d6('0x45')],_0x4144a8['peerstatus']);logger[_0x36d6('0x25')](_0x36d6('0x46'),util[_0x36d6('0x1a')](_0x4144a8,{'showHidden':![],'depth':null}));if(this[_0x36d6('0xb')][_0x4144a8[_0x36d6('0x44')]]){if(!this[_0x36d6('0xb')][_0x4144a8['peer']][_0x36d6('0x32')]||_0x4144a8[_0x36d6('0x12')][_0x36d6('0x30')]()==_0x36d6('0x47')){this['agents'][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x32')]=![];this[_0x36d6('0xb')][_0x4144a8['peer']][_0x36d6('0x48')]=_0x4144a8[_0x36d6('0x12')][_0x36d6('0x30')]();this['agents'][_0x4144a8['peer']][_0x36d6('0x45')]=_0x4144a8['address'];this['agents'][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x35')](_0x4144a8);}}else if(this['telephones'][_0x4144a8[_0x36d6('0x44')]]){this['telephones'][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x48')]=_0x4144a8[_0x36d6('0x12')][_0x36d6('0x30')]();this[_0x36d6('0x36')][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x45')]=_0x4144a8[_0x36d6('0x45')];logger[_0x36d6('0x25')](_0x36d6('0x49'),util[_0x36d6('0x1a')](this[_0x36d6('0x36')][_0x4144a8['peer']],{'showHidden':![],'depth':null}));this[_0x36d6('0x1f')](util[_0x36d6('0x2b')](_0x36d6('0x38'),this[_0x36d6('0x36')][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x2c')]),'telephone:save',this[_0x36d6('0x36')][_0x4144a8[_0x36d6('0x44')]]);}else if(this[_0x36d6('0xa')][_0x4144a8['peer']]){this[_0x36d6('0xa')][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x48')]=_0x4144a8[_0x36d6('0x12')]['toLowerCase']();this[_0x36d6('0xa')][_0x4144a8['peer']][_0x36d6('0x45')]=_0x4144a8[_0x36d6('0x45')];logger[_0x36d6('0x25')](_0x36d6('0x4a'),util['inspect'](this[_0x36d6('0xa')][_0x4144a8[_0x36d6('0x44')]],{'showHidden':![],'depth':null}));this[_0x36d6('0x1f')](util[_0x36d6('0x2b')](_0x36d6('0x3a'),this[_0x36d6('0xa')][_0x4144a8[_0x36d6('0x44')]][_0x36d6('0x2c')]),_0x36d6('0x3b'),this[_0x36d6('0xa')][_0x4144a8['peer']]);}}}catch(_0x173ba0){logger['error'](_0x36d6('0x46'),util[_0x36d6('0x1a')](_0x173ba0,{'showHidden':![],'depth':null}));}};module[_0x36d6('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 12dd6e2..801ed6f 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x454226,_0x430efe){var _0x1b2024=function(_0x33f44f){while(--_0x33f44f){_0x454226['push'](_0x454226['shift']());}};_0x1b2024(++_0x430efe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x510f3a,_0x27d50e){var _0x48ddda=function(_0x223988){while(--_0x223988){_0x510f3a['push'](_0x510f3a['shift']());}};_0x48ddda(++_0x27d50e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 2bb2587..eb4e5b4 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc359=['[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][hangup]\x20event:','cause-txt','answertime','holdtime','billableseconds','omit','length','user:agentcomplete','resolve','undefined','getSettings','stopRecordingOnTransfer','then','Action','catch','StopMixMonitor','finally','blindTransfers','outbound','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transferType','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','moment','path','ioredis','../../../config/environment','ami','../model/channel','set','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','name','user:agentconnect','connectedlinenum','error','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','disposition','toNumber','channelstate','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','diff','connectedlinename','destinationchannel','UserId','membername','routealias'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0xc359,0x1d9));var _0x9c35=function(_0x33b259,_0x2036be){_0x33b259=_0x33b259-0x0;var _0xf95548=_0xc359[_0x33b259];return _0xf95548;};'use strict';var _=require('lodash');var moment=require(_0x9c35('0x0'));var util=require('util');var path=require(_0x9c35('0x1'));var Redis=require(_0x9c35('0x2'));var config=require(_0x9c35('0x3'));var logger=require('../../../config/logger')(_0x9c35('0x4'));var ami=require('../ami');var Channel=require(_0x9c35('0x5'));var RpcSetting=require('../rpc/setting');var applications=[_0x9c35('0x6'),'queue','agi','dial','playback',_0x9c35('0x7')];var dispositions=[_0x9c35('0x8'),_0x9c35('0x9'),_0x9c35('0x9'),_0x9c35('0x8'),_0x9c35('0x8'),'NO\x20ANSWER',_0x9c35('0xa'),_0x9c35('0xb'),'FAILED','FAILED','FAILED'];config[_0x9c35('0xc')]=_['defaults'](config[_0x9c35('0xc')],{'host':_0x9c35('0xd'),'port':0x18eb});var io=require(_0x9c35('0xe'))(new Redis(config['redis']));function VoiceCallReport(_0x24210f){this[_0x9c35('0xf')]=_0x24210f[_0x9c35('0xf')];this[_0x9c35('0x10')]=_0x24210f[_0x9c35('0x10')];this['blindTransfers']={};ami['on'](_0x9c35('0x11'),this[_0x9c35('0x12')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x14'),this[_0x9c35('0x12')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x15'),this[_0x9c35('0x16')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x17'),this[_0x9c35('0x18')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x19'),this[_0x9c35('0x1a')][_0x9c35('0x13')](this));ami['on']('hangup',this[_0x9c35('0x1b')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x1c'),this[_0x9c35('0x1d')]['bind'](this));ami['on'](_0x9c35('0x1e'),this[_0x9c35('0x1f')][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x20'),this[_0x9c35('0x21')]['bind'](this));ami['on'](_0x9c35('0x22'),this['syncMusicOnHoldStart'][_0x9c35('0x13')](this));ami['on'](_0x9c35('0x23'),this[_0x9c35('0x24')][_0x9c35('0x13')](this));try{logger[_0x9c35('0x25')](_0x9c35('0x26'));ami[_0x9c35('0x27')]();}catch(_0x52aa95){logger['error'](_0x9c35('0x28'),util[_0x9c35('0x29')](_0x52aa95,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9c35('0x2a')][_0x9c35('0x2b')]=function(_0x50a509){return _0x50a509!==null&&!_[_0x9c35('0x2c')](_0x50a509);};VoiceCallReport['prototype'][_0x9c35('0x2d')]=function(_0x4bf0ea,_0x5d924a,_0x39cd10){io['to'](_0x4bf0ea)[_0x9c35('0x2d')](_0x5d924a,_0x39cd10);};VoiceCallReport[_0x9c35('0x2a')]['syncNewCallerId']=function(_0x3bfdfd){try{if(this['isNotNull'](_0x3bfdfd)){logger[_0x9c35('0x25')](_0x9c35('0x2e'),_0x3bfdfd[_0x9c35('0x2f')],_0x3bfdfd[_0x9c35('0x30')],_0x3bfdfd[_0x9c35('0x31')]);logger['debug'](_0x9c35('0x32'),_0x3bfdfd[_0x9c35('0x2f')],util['inspect'](_0x3bfdfd,{'showHidden':![],'depth':null}));if(_0x3bfdfd[_0x9c35('0x2f')]===_0x3bfdfd[_0x9c35('0x33')]){if(!_[_0x9c35('0x2c')](this[_0x9c35('0xf')][_0x3bfdfd[_0x9c35('0x2f')]])){_['merge'](this[_0x9c35('0xf')][_0x3bfdfd[_0x9c35('0x2f')]],_[_0x9c35('0x34')](_0x3bfdfd,_[_0x9c35('0x35')](this[_0x9c35('0xf')][_0x3bfdfd[_0x9c35('0x2f')]])));}}if(_0x3bfdfd['context']===_0x9c35('0x36')){if(this['agents'][_0x3bfdfd[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]){if(_0x3bfdfd[_0x9c35('0x39')]==_0x9c35('0x3a')){this[_0x9c35('0x10')][_0x3bfdfd['channel'][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3b')]=_0x3bfdfd['connectedlinenum'];this['emit'](util[_0x9c35('0x3c')]('user:%s',this['agents'][_0x3bfdfd['channel'][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3d')]),_0x9c35('0x3e'),{'destaccountcode':this[_0x9c35('0x10')][_0x3bfdfd[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3bfdfd[_0x9c35('0x3f')]});}}}}}catch(_0x168d1c){logger[_0x9c35('0x40')](_0x9c35('0x41'),_0x3bfdfd['uniqueid'],util[_0x9c35('0x29')](_0x168d1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c35('0x2a')][_0x9c35('0x16')]=function(_0x7397f6){try{if(this[_0x9c35('0x2b')](_0x7397f6)){logger[_0x9c35('0x42')](_0x9c35('0x43'),_0x7397f6['uniqueid'],util['inspect'](_0x7397f6,{'showHidden':![],'depth':null}));if(_0x7397f6['uniqueid']===_0x7397f6[_0x9c35('0x33')]&&_0x7397f6['channel']!=_0x9c35('0x44')){if(_['isUndefined'](this['channels'][_0x7397f6[_0x9c35('0x2f')]])){logger[_0x9c35('0x25')](_0x9c35('0x45'),_0x7397f6[_0x9c35('0x2f')],_0x7397f6[_0x9c35('0x46')],_0x7397f6[_0x9c35('0x39')]);this[_0x9c35('0xf')][_0x7397f6['uniqueid']]=new Channel();this[_0x9c35('0xf')][_0x7397f6['uniqueid']][_0x9c35('0x47')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x7397f6['uniqueid']][_0x9c35('0x48')]=dispositions[_[_0x9c35('0x49')](_0x7397f6[_0x9c35('0x4a')])];_[_0x9c35('0x4b')](this['channels'][_0x7397f6[_0x9c35('0x2f')]],_[_0x9c35('0x34')](_0x7397f6,_[_0x9c35('0x35')](this['channels'][_0x7397f6[_0x9c35('0x2f')]])));if(_0x7397f6[_0x9c35('0x46')]===_0x9c35('0x36')){if(this[_0x9c35('0x10')][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]){if(_[_0x9c35('0x2c')](this[_0x9c35('0x10')][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3b')])){this['agents'][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3b')]=_0x7397f6[_0x9c35('0x39')];logger[_0x9c35('0x42')](_0x9c35('0x4c'),_0x7397f6[_0x9c35('0x2f')],util[_0x9c35('0x29')]({'id':this[_0x9c35('0x10')][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9c35('0x10')][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x4d')],'destconnectedlinenum':_0x7397f6[_0x9c35('0x39')]},{'showHidden':![],'depth':null}));this[_0x9c35('0x2d')](util[_0x9c35('0x3c')](_0x9c35('0x4e'),this[_0x9c35('0x10')][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['name']),_0x9c35('0x3e'),{'id':this['agents'][_0x7397f6[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9c35('0x10')][_0x7397f6['channel'][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x4d')],'destconnectedlinenum':_0x7397f6[_0x9c35('0x39')]});}}}}}}}catch(_0x5dbcea){logger[_0x9c35('0x40')](_0x9c35('0x4f'),_0x7397f6['uniqueid'],util[_0x9c35('0x29')](_0x5dbcea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9c35('0x12')]=function(_0x33c76c){try{if(this[_0x9c35('0x2b')](_0x33c76c)){logger[_0x9c35('0x42')](_0x9c35('0x50'),_0x33c76c[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x33c76c,{'showHidden':![],'depth':null}));if(_0x33c76c[_0x9c35('0x2f')]===_0x33c76c[_0x9c35('0x33')]&&_0x33c76c['exten']!='h'&&_0x33c76c[_0x9c35('0x37')]!=_0x9c35('0x44')){_0x33c76c[_0x9c35('0x51')]=_0x33c76c['application']['toLowerCase']();_0x33c76c[_0x9c35('0x52')]=_0x33c76c[_0x9c35('0x53')]&&_0x33c76c['appdata'][_0x9c35('0x54')](_0x9c35('0x55'))?_0x33c76c[_0x9c35('0x53')]:(_0x33c76c[_0x9c35('0x53')]||_0x33c76c[_0x9c35('0x52')])[_0x9c35('0x56')]();logger['info'](_0x9c35('0x57'),_0x33c76c['uniqueid'],_0x33c76c[_0x9c35('0x51')],_0x33c76c[_0x9c35('0x52')]);if(_[_0x9c35('0x2c')](this['channels'][_0x33c76c[_0x9c35('0x2f')]])){this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]]=new Channel();this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]][_0x9c35('0x47')]=_0x33c76c['duration']?moment()['subtract'](moment[_0x9c35('0x58')](_0x33c76c[_0x9c35('0x58')])[_0x9c35('0x59')](),'seconds')[_0x9c35('0x3c')](_0x9c35('0x5a')):moment()[_0x9c35('0x3c')](_0x9c35('0x5a'));this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]][_0x9c35('0x48')]='NO\x20ANSWER';}_['merge'](this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]],_['pick'](_0x33c76c,_[_0x9c35('0x35')](this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]])));if(_[_0x9c35('0x5b')](applications,_0x33c76c[_0x9c35('0x51')])){this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]][_0x9c35('0x5c')]=_0x33c76c[_0x9c35('0x51')];this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]][_0x9c35('0x5d')]=_0x33c76c[_0x9c35('0x52')];if(_0x33c76c[_0x9c35('0x51')]===_0x9c35('0x6')&&_[_0x9c35('0x54')](_0x33c76c[_0x9c35('0x52')][_0x9c35('0x56')](),_0x9c35('0x5e'))){var _0x1ac83b=_0x33c76c[_0x9c35('0x52')][_0x9c35('0x38')]('=');var _0x2092d4=_0x1ac83b[0x0][_0x9c35('0x56')]()[_0x9c35('0x5f')](/cdr\((.*)\)/);if(_0x2092d4){this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]][_0x2092d4[0x1]]=_0x1ac83b[0x1];}}else if(_0x33c76c['application']===_0x9c35('0x60')){this[_0x9c35('0xf')][_0x33c76c[_0x9c35('0x2f')]]['queue']=_0x33c76c[_0x9c35('0x52')]['split'](',')[0x0];}}}}}catch(_0x3f66d2){logger[_0x9c35('0x40')](_0x9c35('0x61'),_0x33c76c[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x3f66d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c35('0x2a')]['syncNewState']=function(_0x6c36b8){try{if(this[_0x9c35('0x2b')](_0x6c36b8)){logger[_0x9c35('0x25')](_0x9c35('0x62'),_0x6c36b8['uniqueid'],_0x6c36b8[_0x9c35('0x33')],_0x6c36b8[_0x9c35('0x30')],_0x6c36b8['calleridnum']);logger['debug'](_0x9c35('0x63'),_0x6c36b8[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x6c36b8,{'showHidden':![],'depth':null}));if(_0x6c36b8[_0x9c35('0x2f')]!==_0x6c36b8[_0x9c35('0x33')]){if(this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]){if(_0x6c36b8[_0x9c35('0x4a')]==='6'){if(!this['channels'][_0x6c36b8[_0x9c35('0x33')]]['answered']){var _0xc815e=moment();this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]['answered']=!![];this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]['answertime']=_0xc815e[_0x9c35('0x3c')](_0x9c35('0x5a'));if(this[_0x9c35('0xf')][_0x6c36b8['linkedid']][_0x9c35('0x47')]){this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]['holdtime']=_0xc815e[_0x9c35('0x64')](this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x47')],'seconds');}}this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x33')]=_0x6c36b8[_0x9c35('0x2f')];if(_0x6c36b8[_0x9c35('0x31')]!==_0x9c35('0x3a')){this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x3f')]=_0x6c36b8['calleridnum'];}this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x65')]=_0x6c36b8[_0x9c35('0x30')];this['channels'][_0x6c36b8['linkedid']][_0x9c35('0x66')]=_0x6c36b8[_0x9c35('0x37')];this['channels'][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x48')]=dispositions[_[_0x9c35('0x49')](_0x6c36b8[_0x9c35('0x4a')])];if(this[_0x9c35('0x10')][_0x6c36b8['channel'][_0x9c35('0x38')]('-')[0x0]]){this['channels'][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x67')]=this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'];this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]['membername']=this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3d')];}}}}else{if(this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x2f')]]){if(_0x6c36b8[_0x9c35('0x4a')]==='6'){if(this['agents'][_0x6c36b8['channel'][_0x9c35('0x38')]('-')[0x0]]){this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x2f')]][_0x9c35('0x67')]=this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'];this[_0x9c35('0xf')][_0x6c36b8['uniqueid']][_0x9c35('0x68')]=this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3d')];}}}}if(_0x6c36b8['channelstate']==='6'&&_0x6c36b8['context']===_0x9c35('0x36')){if(this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]){this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['destconnectedlinenum']=_0x6c36b8[_0x9c35('0x39')];var _0x306eab,_0x470ba5;if(this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x2f')]]){_0x306eab=this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x2f')]]['routealias'];_0x470ba5=this['channels'][_0x6c36b8[_0x9c35('0x2f')]][_0x9c35('0x60')];}else if(this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]){_0x306eab=this['channels'][_0x6c36b8[_0x9c35('0x33')]][_0x9c35('0x69')];_0x470ba5=this[_0x9c35('0xf')][_0x6c36b8[_0x9c35('0x33')]]['queue'];}logger[_0x9c35('0x42')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x6c36b8[_0x9c35('0x2f')],util[_0x9c35('0x29')]({'id':this['agents'][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x6c36b8[_0x9c35('0x39')],'routealias':_0x306eab,'queue':_0x470ba5||undefined},{'showHidden':![],'depth':null}));this[_0x9c35('0x2d')](util[_0x9c35('0x3c')](_0x9c35('0x4e'),this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x3d')]),_0x9c35('0x3e'),{'id':this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x9c35('0x10')][_0x6c36b8[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x6c36b8[_0x9c35('0x39')],'routealias':_0x306eab,'queue':_0x470ba5||undefined});}}}}catch(_0x264ca5){logger['error'](_0x9c35('0x6a'),_0x6c36b8[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x264ca5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c35('0x2a')][_0x9c35('0x6b')]=function(_0x539c2f,_0x408c43){try{if(this[_0x9c35('0xf')][_0x539c2f]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x539c2f,_0x408c43);this['channels'][_0x539c2f][_0x9c35('0x6c')]=!![];if(_[_0x9c35('0x6d')](_0x408c43,'.wav49')){_0x408c43=_0x408c43[_0x9c35('0x6e')](_0x9c35('0x6f'),_0x9c35('0x70'));}this['channels'][_0x539c2f][_0x9c35('0x71')]=_0x408c43;var _0x268b54=_[_0x9c35('0x72')](this['channels'][_0x539c2f][_0x9c35('0x73')],{'filename':_0x408c43});if(_[_0x9c35('0x74')](_0x268b54)){this[_0x9c35('0xf')][_0x539c2f]['monitors'][_0x9c35('0x75')]({'filename':_0x408c43,'createdAt':moment()[_0x9c35('0x3c')](_0x9c35('0x5a')),'mixmonitorid':'','status':_0x9c35('0x76')});}}}catch(_0x4167c6){logger['error'](_0x9c35('0x77'),_0x539c2f,util['inspect'](_0x4167c6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9c35('0x2a')][_0x9c35('0x1a')]=function(_0x1aac5f){try{if(this[_0x9c35('0x2b')](_0x1aac5f)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x1aac5f[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x1aac5f,{'showHidden':![],'depth':null}));if(this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x2f')]]&&_0x1aac5f['channel']!=_0x9c35('0x44')){if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')])){if(this['isNotNull'](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x79')])){logger[_0x9c35('0x25')](_0x9c35('0x7a'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0x6b')](_0x1aac5f['uniqueid'],_0x1aac5f[_0x9c35('0x7b')]);}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x7c')])){logger[_0x9c35('0x25')](_0x9c35('0x7d'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f['uniqueid']][_0x9c35('0x31')]=_0x1aac5f[_0x9c35('0x7b')];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x7e')])){logger[_0x9c35('0x25')](_0x9c35('0x7f'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x2f')]][_0x9c35('0x80')]=_0x1aac5f[_0x9c35('0x7b')];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x81')])){logger[_0x9c35('0x25')](_0x9c35('0x82'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x2f')]][_0x9c35('0x83')]=_0x1aac5f[_0x9c35('0x7b')];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')]['xmd-queue'])){logger[_0x9c35('0x25')](_0x9c35('0x84'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')][_0x9c35('0x38')](',')[0x0]);this['channels'][_0x1aac5f[_0x9c35('0x2f')]][_0x9c35('0x60')]=_0x1aac5f[_0x9c35('0x7b')]['split'](',')[0x0];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')]['xmd-originatecalleridnum'])){logger[_0x9c35('0x25')](_0x9c35('0x85'),_0x1aac5f['uniqueid'],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f['uniqueid']][_0x9c35('0x86')]=_0x1aac5f[_0x9c35('0x7b')];}else if(this['isNotNull'](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x87')])){logger[_0x9c35('0x25')](_0x9c35('0x88'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f['value']);this['channels'][_0x1aac5f[_0x9c35('0x2f')]]['destination']=_0x1aac5f['value'];}else if(this['isNotNull'](_0x1aac5f['variable']['xmd-callerid-preview'])){logger[_0x9c35('0x25')](_0x9c35('0x89'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x2f')]]['calleridpreview']=_0x1aac5f[_0x9c35('0x7b')];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x8a')])){logger[_0x9c35('0x25')](_0x9c35('0x8b'),_0x1aac5f['uniqueid'],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x2f')]][_0x9c35('0x60')]=_0x1aac5f[_0x9c35('0x7b')];}else if(this[_0x9c35('0x2b')](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x8c')])){logger[_0x9c35('0x25')](_0x9c35('0x8d'),_0x1aac5f[_0x9c35('0x2f')],_0x1aac5f[_0x9c35('0x7b')]);this['channels'][_0x1aac5f[_0x9c35('0x2f')]][_0x9c35('0x8e')]=_0x1aac5f[_0x9c35('0x7b')];}}}else if(this['isNotNull'](_0x1aac5f[_0x9c35('0x78')][_0x9c35('0x79')])){if(_0x1aac5f['value']){var _0x5966ce=path[_0x9c35('0x8f')](_0x1aac5f[_0x9c35('0x7b')])['name'];logger[_0x9c35('0x25')](_0x9c35('0x7a'),_0x5966ce,_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0x6b')](_0x5966ce,_0x1aac5f[_0x9c35('0x7b')]);}}else if(this['channels'][_0x1aac5f[_0x9c35('0x33')]]){if(this[_0x9c35('0x2b')](_0x1aac5f['variable'])){if(this[_0x9c35('0x2b')](_0x1aac5f['variable'][_0x9c35('0x8c')])){logger[_0x9c35('0x25')](_0x9c35('0x8d'),_0x1aac5f[_0x9c35('0x33')],_0x1aac5f[_0x9c35('0x7b')]);this[_0x9c35('0xf')][_0x1aac5f[_0x9c35('0x33')]]['sipcalllinkedid']=_0x1aac5f[_0x9c35('0x7b')];}}}}}catch(_0x4112df){logger['error']('[%s][voiceCallReport][varset]',_0x1aac5f[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x4112df,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9c35('0x1b')]=function(_0x13eb51){try{if(this[_0x9c35('0x2b')](_0x13eb51)){logger[_0x9c35('0x42')](_0x9c35('0x90'),_0x13eb51[_0x9c35('0x2f')],util[_0x9c35('0x29')](_0x13eb51,{'showHidden':![],'depth':null}));if(this[_0x9c35('0xf')][_0x13eb51['uniqueid']]){logger[_0x9c35('0x25')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x13eb51['uniqueid'],_0x13eb51[_0x9c35('0x91')]);var _0x471019=moment();this[_0x9c35('0xf')][_0x13eb51['uniqueid']]['endtime']=_0x471019[_0x9c35('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x13eb51[_0x9c35('0x2f')]][_0x9c35('0x58')]=_0x471019[_0x9c35('0x64')](this[_0x9c35('0xf')][_0x13eb51[_0x9c35('0x2f')]]['starttime'],_0x9c35('0x59'));if(this[_0x9c35('0xf')][_0x13eb51[_0x9c35('0x2f')]]['answered']){this[_0x9c35('0xf')][_0x13eb51[_0x9c35('0x2f')]]['billableseconds']=_0x471019['diff'](this['channels'][_0x13eb51[_0x9c35('0x2f')]][_0x9c35('0x92')],_0x9c35('0x59'));this['channels'][_0x13eb51[_0x9c35('0x2f')]][_0x9c35('0x93')]=this['channels'][_0x13eb51[_0x9c35('0x2f')]][_0x9c35('0x58')]-this[_0x9c35('0xf')][_0x13eb51['uniqueid']][_0x9c35('0x94')];}if(_0x13eb51[_0x9c35('0x46')]==='from-sip'){if(this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]){this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')]['split']('-')[0x0]]=_[_0x9c35('0x95')](this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]],[_0x9c35('0x3b')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x13eb51[_0x9c35('0x2f')],util[_0x9c35('0x29')]({'id':this[_0x9c35('0x10')][_0x13eb51['channel'][_0x9c35('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x4d')]},{'showHidden':![],'depth':null}));this[_0x9c35('0x2d')](util[_0x9c35('0x3c')]('user:%s',this[_0x9c35('0x10')][_0x13eb51['channel'][_0x9c35('0x38')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x9c35('0x10')][_0x13eb51[_0x9c35('0x37')][_0x9c35('0x38')]('-')[0x0]][_0x9c35('0x4d')]});for(var _0x42ee39=0x0;_0x42ee390x0?_0xbc639c:0x0;this[_0xd350('0x15')][_0x2f3ce8['queue']]['talking']=this[_0xd350('0x15')][_0x2f3ce8[_0xd350('0x69')]][_0xd350('0x34')]>_[_0xd350('0x6f')](_0x2f3ce8[_0xd350('0x71')])?_['toNumber'](_0x2f3ce8[_0xd350('0x71')]):this[_0xd350('0x15')][_0x2f3ce8['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0xd350('0x15')][_0x2f3ce8[_0xd350('0x69')]],_0xd350('0x18'));}logger['debug'](_0xd350('0x72'),util[_0xd350('0x41')](this[_0xd350('0x15')][_0x2f3ce8[_0xd350('0x69')]],{'showHidden':![],'depth':null}));ami[_0xd350('0x45')](_0xd350('0x73'),this[_0xd350('0x15')][_0x2f3ce8[_0xd350('0x69')]]);}}}catch(_0xd8075b){logger[_0xd350('0x3f')](_0xd350('0x67'),util[_0xd350('0x41')](_0xd8075b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x1b')]=function(_0x554557){logger[_0xd350('0x47')](_0xd350('0x74'),util['inspect'](_0x554557,{'showHidden':![],'depth':null}));this[_0xd350('0x66')]=!![];};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x1d')]=function(_0xb806d5){try{if(this[_0xd350('0x62')](_0xb806d5)){logger[_0xd350('0x47')](_0xd350('0x75'),_0xb806d5['uniqueid'],util[_0xd350('0x41')](_0xb806d5,{'showHidden':![],'depth':null}));if(_[_0xd350('0x63')](this[_0xd350('0x11')][_0xb806d5[_0xd350('0x4a')]]))this['queueReports'][_0xb806d5[_0xd350('0x4a')]]=[];if(_[_0xd350('0x63')](this['channels'][_0xb806d5[_0xd350('0x4a')]]))this[_0xd350('0x13')][_0xb806d5[_0xd350('0x4a')]]={};var _0x253bdd=new QueueReport();_0x253bdd[_0xd350('0x4d')]=_0xb806d5[_0xd350('0x69')];_0x253bdd['type']=this[_0xd350('0x15')][_0x253bdd[_0xd350('0x4d')]]&&this['voiceQueues'][_0x253bdd[_0xd350('0x4d')]][_0xd350('0x52')]?this[_0xd350('0x15')][_0x253bdd['name']][_0xd350('0x52')]||_0xd350('0x53'):_0xd350('0x53');_0x253bdd[_0xd350('0x69')]=_0xb806d5['queue'];_0x253bdd[_0xd350('0x76')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));_0x253bdd[_0xd350('0x78')]=_0xb806d5[_0xd350('0x78')];_0x253bdd['count']=_0xb806d5[_0xd350('0x79')];_0x253bdd['uniqueid']=_0xb806d5[_0xd350('0x4a')];_0x253bdd['routealias']=this[_0xd350('0x13')][_0xb806d5['uniqueid']][_0xd350('0x7a')];logger['info'](_0xd350('0x7b'),_0x253bdd[_0xd350('0x4d')],_0x253bdd['type']);_[_0xd350('0x7c')](_0x253bdd,_[_0xd350('0x7d')](_0xb806d5,_['keys'](_0x253bdd)));this[_0xd350('0x11')][_0xb806d5[_0xd350('0x4a')]][_0xd350('0x7e')](_0x253bdd);this[_0xd350('0x13')][_0xb806d5[_0xd350('0x4a')]]=_0x253bdd;this[_0xd350('0x46')](_0x253bdd,_0xd350('0x1c'));}}catch(_0x1f6f4c){logger[_0xd350('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0xb806d5[_0xd350('0x4a')],util[_0xd350('0x41')](_0x1f6f4c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x7f')]=function(_0x47a43a){try{if(this[_0xd350('0x62')](_0x47a43a)){logger[_0xd350('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x47a43a['uniqueid'],util['inspect'](_0x47a43a,{'showHidden':![],'depth':null}));if(this[_0xd350('0x11')][_0x47a43a[_0xd350('0x4a')]]){var _0x853cfa=_['last'](this['queueReports'][_0x47a43a[_0xd350('0x4a')]]);_0x853cfa['queuecallercomplete']=![];_0x853cfa[_0xd350('0x80')]=null;_0x853cfa[_0xd350('0x81')]=_0x47a43a[_0xd350('0x81')];_0x853cfa[_0xd350('0x82')]=_0x47a43a[_0xd350('0x82')];_0x853cfa[_0xd350('0x83')]=!![];_0x853cfa['queuecallerabandonAt']=moment()[_0xd350('0x4b')](_0xd350('0x77'));_0x853cfa['queuecallerexitreason']=_0xd350('0x84');_0x853cfa[_0xd350('0x85')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x853cfa[_0xd350('0x4d')],_0x853cfa[_0xd350('0x52')]);this['channels'][_0x47a43a[_0xd350('0x4a')]]=_0x853cfa;this[_0xd350('0x44')](_0x853cfa,_0xd350('0x83'));}}}catch(_0x11f057){logger[_0xd350('0x3f')](_0xd350('0x86'),_0x47a43a[_0xd350('0x4a')],util[_0xd350('0x41')](_0x11f057,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x87')]=function(_0x4bbfc3){try{if(this[_0xd350('0x62')](_0x4bbfc3)){logger[_0xd350('0x47')]('[%s][voiceQueueReport][queuecallerleave]',_0x4bbfc3[_0xd350('0x4a')],util[_0xd350('0x41')](_0x4bbfc3,{'showHidden':![],'depth':null}));if(this[_0xd350('0x11')][_0x4bbfc3['uniqueid']]){var _0x449f3d=_['last'](this[_0xd350('0x11')][_0x4bbfc3[_0xd350('0x4a')]]);_0x449f3d[_0xd350('0x88')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));_0x449f3d[_0xd350('0x89')]=_0x4bbfc3[_0xd350('0x89')];_0x449f3d['connectedlinename']=_0x4bbfc3['connectedlinename'];logger['info'](_0xd350('0x8a'),_0x449f3d[_0xd350('0x4d')],_0x449f3d[_0xd350('0x52')],_0x4bbfc3['connectedlinenum'],_0x4bbfc3[_0xd350('0x8b')]);this[_0xd350('0x13')][_0x4bbfc3[_0xd350('0x4a')]]=_0x449f3d;this[_0xd350('0x46')](_0x449f3d,_0xd350('0x1e'));}}}catch(_0x1d19d6){logger[_0xd350('0x3f')](_0xd350('0x8c'),_0x4bbfc3['uniqueid'],util['inspect'](_0x1d19d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x22')]=function(_0x4d9710){try{if(this[_0xd350('0x62')](_0x4d9710)){logger['debug'](_0xd350('0x8d'),_0x4d9710[_0xd350('0x4a')],util[_0xd350('0x41')](_0x4d9710,{'showHidden':![],'depth':null}));if(this[_0xd350('0x11')][_0x4d9710[_0xd350('0x4a')]]){var _0x5b0c63=_['last'](this[_0xd350('0x11')][_0x4d9710[_0xd350('0x4a')]]);_0x5b0c63[_0xd350('0x8e')]=!![];_0x5b0c63['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xd350('0x6b')](_0xd350('0x8f'),_0x5b0c63[_0xd350('0x4d')],_0x5b0c63['type']);}}}catch(_0x554f10){logger[_0xd350('0x3f')](_0xd350('0x8d'),_0x4d9710['uniqueid'],util[_0xd350('0x41')](_0x554f10,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x41a55a){try{if(this[_0xd350('0x62')](_0x41a55a)){logger[_0xd350('0x47')](_0xd350('0x90'),_0x41a55a[_0xd350('0x4a')],util[_0xd350('0x41')](_0x41a55a,{'showHidden':![],'depth':null}));if(this[_0xd350('0x11')][_0x41a55a[_0xd350('0x4a')]]){var _0x5b54e9=_['last'](this['queueReports'][_0x41a55a['uniqueid']]);_0x5b54e9['queuecallerabandon']=![];_0x5b54e9[_0xd350('0x91')]=null;_0x5b54e9[_0xd350('0x92')]=!![];_0x5b54e9[_0xd350('0x85')]=_0x41a55a[_0xd350('0x93')];_0x5b54e9[_0xd350('0x81')]=_0x41a55a[_0xd350('0x81')];_0x5b54e9['queuecallercomplete']=!![];_0x5b54e9['queuecallerexit']=![];_0x5b54e9[_0xd350('0x94')]=null;if(!_0x5b54e9['transfer']){if(_0x41a55a['reason']==_0xd350('0x95')){_0x5b54e9[_0xd350('0x96')]='COMPLETED';logger[_0xd350('0x6b')](_0xd350('0x97'),_0x5b54e9[_0xd350('0x4d')],_0x5b54e9[_0xd350('0x52')]);}else{if(_[_0xd350('0x98')](_0x41a55a[_0xd350('0x3b')]['toLowerCase'](),_0xd350('0x99'))){if(this['queueReports'][_0x41a55a[_0xd350('0x9a')]]){var _0x831667=_[_0xd350('0x9b')](this[_0xd350('0x11')][_0x41a55a[_0xd350('0x9a')]]);_0x831667['queuecallercomplete']=![];_0x831667[_0xd350('0x9c')]=!![];_0x831667[_0xd350('0x94')]=moment(_0x5b54e9[_0xd350('0x76')])[_0xd350('0x9d')](_0x41a55a['holdtime'],_0xd350('0x9e'))['format'](_0xd350('0x77'));_0x831667['queuecallerexitreason']=_0xd350('0x9f');_0x831667[_0xd350('0x95')]=!![];_0x831667[_0xd350('0xa0')]=_0xd350('0xa1');_0x831667[_0xd350('0xa2')]=_0x41a55a[_0xd350('0xa3')];_0x831667['transferuniqueid']=_0x41a55a[_0xd350('0x4a')];logger[_0xd350('0x6b')](_0xd350('0xa4'),_0x831667[_0xd350('0x4d')],_0x831667['type']);var _0x416a00=this[_0xd350('0x11')][_0x41a55a[_0xd350('0x9a')]];this[_0xd350('0x11')][_0x41a55a[_0xd350('0x9a')]]=this['queueReports'][_0x41a55a[_0xd350('0x4a')]];this[_0xd350('0x11')][_0x41a55a[_0xd350('0x4a')]]=_0x416a00;}}else{_0x5b54e9[_0xd350('0x96')]=_0xd350('0xa5')+_0x41a55a[_0xd350('0xa6')]['toUpperCase']();logger[_0xd350('0x6b')](_0xd350('0xa7'),_0x5b54e9[_0xd350('0x4d')],_0x5b54e9[_0xd350('0x52')],_0x5b54e9[_0xd350('0x96')]);}}}this[_0xd350('0x13')][_0x41a55a[_0xd350('0x4a')]]=_0x5b54e9;this[_0xd350('0x44')](_0x5b54e9,_0xd350('0x1f'));}}}catch(_0xce22f){logger[_0xd350('0x3f')](_0xd350('0x90'),_0x41a55a['uniqueid'],util[_0xd350('0x41')](_0xce22f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x24')]=function(_0x706de0){try{if(this[_0xd350('0x62')](_0x706de0)){logger[_0xd350('0x47')]('[%s][voiceQueueReport][varset]',_0x706de0[_0xd350('0x4a')],util[_0xd350('0x41')](_0x706de0,{'showHidden':![],'depth':null}));this['addVariable'](_0x706de0[_0xd350('0x4a')],_['keys'](_0x706de0['variable'])[0x0],_0x706de0[_0xd350('0xa8')]);if(this[_0xd350('0x11')][_0x706de0['uniqueid']]){var _0x409879=_[_0xd350('0x9b')](this[_0xd350('0x11')][_0x706de0['uniqueid']]);if(_0x409879){if(this[_0xd350('0x62')](_0x706de0[_0xd350('0xa9')])&&this['isNotNull'](_0x706de0[_0xd350('0xa9')][_0xd350('0xaa')])){switch(_0x706de0[_0xd350('0xa8')]){case _0xd350('0xab'):_0x409879[_0xd350('0x9c')]=![];_0x409879[_0xd350('0x94')]=null;break;case _0xd350('0xac'):_0x409879[_0xd350('0xad')]=_0xd350('0xae');_0x409879[_0xd350('0x9c')]=!![];_0x409879[_0xd350('0x94')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));_0x409879['queuecallerleaveAt']=moment()['format'](_0xd350('0x77'));logger[_0xd350('0x47')](_0xd350('0xaf'),_0x706de0[_0xd350('0x4a')],util[_0xd350('0x41')](_0x409879,{'showHidden':![],'depth':null}));ami[_0xd350('0x45')](_0xd350('0xb0'),_0x409879);break;default:_0x409879['queuecallerexit']=!![];_0x409879[_0xd350('0x94')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x409879[_0xd350('0x88')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));}_0x409879[_0xd350('0x83')]=![];_0x409879[_0xd350('0x91')]=null;_0x409879[_0xd350('0x96')]=_0x706de0[_0xd350('0xa8')];this[_0xd350('0x13')][_0x706de0[_0xd350('0x4a')]]=_0x409879;this[_0xd350('0x44')](_0x409879,_0xd350('0x23'));}else if(this[_0xd350('0x62')](_0x706de0[_0xd350('0xa9')])&&this[_0xd350('0x62')](_0x706de0[_0xd350('0xa9')]['queueposition'])){if(!_0x409879[_0xd350('0x83')]){_0x409879[_0xd350('0x9c')]=!![];_0x409879[_0xd350('0x94')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));_0x409879[_0xd350('0x96')]='EXITWITHKEY';_0x409879[_0xd350('0x88')]=moment()[_0xd350('0x4b')](_0xd350('0x77'));this['channels'][_0x706de0[_0xd350('0x4a')]]=_0x409879;}}logger[_0xd350('0x6b')](_0xd350('0xb1'),_0x706de0[_0xd350('0x4a')],_0x409879['name'],_0x409879['type'],_['keys'](_0x706de0[_0xd350('0xa9')])[0x0],_0x706de0[_0xd350('0xa8')]);_0x409879['variables']=this[_0xd350('0x17')][_0x706de0[_0xd350('0x4a')]];}}}}catch(_0x4a9c83){logger['error'](_0xd350('0xb2'),_0x706de0[_0xd350('0x4a')],util[_0xd350('0x41')](_0x4a9c83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0xb3')]=function(_0x47ae91,_0x3c0595,_0x5ec2da){var _0x59b12b=['rtpaudioqos',_0xd350('0xb4'),_0xd350('0xb5'),'rtpaudioqosjitterbridged',_0xd350('0xb6'),_0xd350('0xb7'),_0xd350('0xb8'),_0xd350('0xb9'),_0xd350('0xba'),'sipuri','bridgepeer',_0xd350('0xbb'),_0xd350('0xbc'),_0xd350('0xbd'),_0xd350('0xbe'),'memberlastcall',_0xd350('0x93'),'memberpenalty',_0xd350('0xbf')];if(!_['isNil'](_0x3c0595)&&!_[_0xd350('0xc0')](_0x59b12b,_0x3c0595)){if(_['isUndefined'](this[_0xd350('0x17')][_0x47ae91])){this[_0xd350('0x17')][_0x47ae91]={};}this['variables'][_0x47ae91][_0x3c0595]=_0x5ec2da;}};VoiceQueueReport[_0xd350('0xc')][_0xd350('0x26')]=function(_0x2ece17){try{if(this[_0xd350('0x62')](_0x2ece17)){logger[_0xd350('0x47')](_0xd350('0xc1'),_0x2ece17[_0xd350('0x4a')],util['inspect'](_0x2ece17,{'showHidden':![],'depth':null}));if(this[_0xd350('0x11')][_0x2ece17[_0xd350('0x4a')]]){for(var _0x933a25=0x0,_0x23ce4={};_0x933a250x0?_0x1074df:0x0;this[_0x60e2('0x13')][_0x2722a0['queue']][_0x60e2('0x6f')]=this[_0x60e2('0x13')][_0x2722a0['queue']][_0x60e2('0x6f')]>_['toNumber'](_0x2722a0[_0x60e2('0x6e')])?_[_0x60e2('0x6c')](_0x2722a0[_0x60e2('0x6e')]):this[_0x60e2('0x13')][_0x2722a0[_0x60e2('0x68')]][_0x60e2('0x6f')];this[_0x60e2('0x4f')](this[_0x60e2('0x13')][_0x2722a0['queue']],'queuesummary');}logger[_0x60e2('0x45')](_0x60e2('0x70'),util['inspect'](this[_0x60e2('0x13')][_0x2722a0[_0x60e2('0x68')]],{'showHidden':![],'depth':null}));ami[_0x60e2('0x43')]('custom:queuesummary',this[_0x60e2('0x13')][_0x2722a0[_0x60e2('0x68')]]);}}}catch(_0x3dc29f){logger[_0x60e2('0x3d')](_0x60e2('0x66'),util[_0x60e2('0x3c')](_0x3dc29f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')]['syncQueueSummaryComplete']=function(_0x5a6374){logger['debug'](_0x60e2('0x71'),util[_0x60e2('0x3c')](_0x5a6374,{'showHidden':![],'depth':null}));this[_0x60e2('0x14')]=!![];};VoiceQueueReport['prototype'][_0x60e2('0x1b')]=function(_0x36e645){try{if(this['isNotNull'](_0x36e645)){logger['debug'](_0x60e2('0x72'),_0x36e645[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x36e645,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x60e2('0xf')][_0x36e645[_0x60e2('0x47')]]))this[_0x60e2('0xf')][_0x36e645[_0x60e2('0x47')]]=[];if(_[_0x60e2('0x60')](this[_0x60e2('0x11')][_0x36e645[_0x60e2('0x47')]]))this[_0x60e2('0x11')][_0x36e645[_0x60e2('0x47')]]={};var _0xd54861=new QueueReport();_0xd54861[_0x60e2('0x4a')]=_0x36e645[_0x60e2('0x68')];_0xd54861[_0x60e2('0x73')]=this[_0x60e2('0x13')][_0xd54861[_0x60e2('0x4a')]]&&this[_0x60e2('0x13')][_0xd54861['name']][_0x60e2('0x73')]?this[_0x60e2('0x13')][_0xd54861[_0x60e2('0x4a')]][_0x60e2('0x73')]||_0x60e2('0x74'):_0x60e2('0x74');_0xd54861[_0x60e2('0x68')]=_0x36e645[_0x60e2('0x68')];_0xd54861[_0x60e2('0x75')]=moment()[_0x60e2('0x48')](_0x60e2('0x76'));_0xd54861[_0x60e2('0x77')]=_0x36e645['position'];_0xd54861[_0x60e2('0x78')]=_0x36e645[_0x60e2('0x78')];_0xd54861['uniqueid']=_0x36e645[_0x60e2('0x47')];_0xd54861[_0x60e2('0x79')]=this[_0x60e2('0x11')][_0x36e645[_0x60e2('0x47')]][_0x60e2('0x79')];logger[_0x60e2('0x69')](_0x60e2('0x7a'),_0xd54861[_0x60e2('0x4a')],_0xd54861[_0x60e2('0x73')]);_['merge'](_0xd54861,_['pick'](_0x36e645,_['keys'](_0xd54861)));this[_0x60e2('0xf')][_0x36e645[_0x60e2('0x47')]]['push'](_0xd54861);this['channels'][_0x36e645[_0x60e2('0x47')]]=_0xd54861;this[_0x60e2('0x44')](_0xd54861,'queuecallerjoin');}}catch(_0x47d377){logger[_0x60e2('0x3d')](_0x60e2('0x72'),_0x36e645[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x47d377,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')]['syncQueueCallerAbandon']=function(_0x12ee3a){try{if(this[_0x60e2('0x5f')](_0x12ee3a)){logger[_0x60e2('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x12ee3a[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x12ee3a,{'showHidden':![],'depth':null}));if(this[_0x60e2('0xf')][_0x12ee3a[_0x60e2('0x47')]]){var _0x109e2c=_[_0x60e2('0x7b')](this['queueReports'][_0x12ee3a[_0x60e2('0x47')]]);_0x109e2c[_0x60e2('0x7c')]=![];_0x109e2c[_0x60e2('0x7d')]=null;_0x109e2c[_0x60e2('0x7e')]=_0x12ee3a[_0x60e2('0x7e')];_0x109e2c[_0x60e2('0x7f')]=_0x12ee3a[_0x60e2('0x7f')];_0x109e2c[_0x60e2('0x1c')]=!![];_0x109e2c['queuecallerabandonAt']=moment()[_0x60e2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x109e2c['queuecallerexitreason']=_0x60e2('0x80');_0x109e2c['lastAssignedTo']=null;logger[_0x60e2('0x69')](_0x60e2('0x81'),_0x109e2c[_0x60e2('0x4a')],_0x109e2c[_0x60e2('0x73')]);this[_0x60e2('0x11')][_0x12ee3a[_0x60e2('0x47')]]=_0x109e2c;this['emitVoiceQueueChannelRemove'](_0x109e2c,_0x60e2('0x1c'));}}}catch(_0x10f1d8){logger[_0x60e2('0x3d')](_0x60e2('0x82'),_0x12ee3a['uniqueid'],util[_0x60e2('0x3c')](_0x10f1d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60e2('0x1e')]=function(_0x24a30a){try{if(this['isNotNull'](_0x24a30a)){logger[_0x60e2('0x45')](_0x60e2('0x83'),_0x24a30a[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x24a30a,{'showHidden':![],'depth':null}));if(this[_0x60e2('0xf')][_0x24a30a['uniqueid']]){var _0x2c99e5=_[_0x60e2('0x7b')](this[_0x60e2('0xf')][_0x24a30a[_0x60e2('0x47')]]);_0x2c99e5['queuecallerleaveAt']=moment()[_0x60e2('0x48')](_0x60e2('0x76'));_0x2c99e5[_0x60e2('0x84')]=_0x24a30a['connectedlinenum'];_0x2c99e5['connectedlinename']=_0x24a30a[_0x60e2('0x85')];logger[_0x60e2('0x69')](_0x60e2('0x86'),_0x2c99e5[_0x60e2('0x4a')],_0x2c99e5[_0x60e2('0x73')],_0x24a30a[_0x60e2('0x84')],_0x24a30a['connectedlinename']);this[_0x60e2('0x11')][_0x24a30a[_0x60e2('0x47')]]=_0x2c99e5;this['emitVoiceQueueChannelSave'](_0x2c99e5,_0x60e2('0x1d'));}}}catch(_0x4578c1){logger[_0x60e2('0x3d')](_0x60e2('0x83'),_0x24a30a[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x4578c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')][_0x60e2('0x87')]=function(_0x43de18){try{if(this['isNotNull'](_0x43de18)){logger['debug'](_0x60e2('0x88'),_0x43de18[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x43de18,{'showHidden':![],'depth':null}));if(this[_0x60e2('0xf')][_0x43de18[_0x60e2('0x47')]]){var _0x150926=_[_0x60e2('0x7b')](this['queueReports'][_0x43de18['uniqueid']]);_0x150926[_0x60e2('0x7c')]=!![];_0x150926[_0x60e2('0x89')]=_0x60e2('0x8a');logger[_0x60e2('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x150926[_0x60e2('0x4a')],_0x150926[_0x60e2('0x73')]);}}}catch(_0x36fe1c){logger[_0x60e2('0x3d')](_0x60e2('0x88'),_0x43de18[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x36fe1c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')][_0x60e2('0x20')]=function(_0x32a091){try{if(this['isNotNull'](_0x32a091)){logger[_0x60e2('0x45')](_0x60e2('0x8b'),_0x32a091[_0x60e2('0x47')],util['inspect'](_0x32a091,{'showHidden':![],'depth':null}));if(this[_0x60e2('0xf')][_0x32a091['uniqueid']]){var _0x13e1ba=_[_0x60e2('0x7b')](this[_0x60e2('0xf')][_0x32a091[_0x60e2('0x47')]]);_0x13e1ba[_0x60e2('0x1c')]=![];_0x13e1ba[_0x60e2('0x8c')]=null;_0x13e1ba[_0x60e2('0x8d')]=!![];_0x13e1ba[_0x60e2('0x8e')]=_0x32a091[_0x60e2('0x8f')];_0x13e1ba[_0x60e2('0x7e')]=_0x32a091[_0x60e2('0x7e')];_0x13e1ba[_0x60e2('0x7c')]=!![];_0x13e1ba['queuecallerexit']=![];_0x13e1ba[_0x60e2('0x90')]=null;if(!_0x13e1ba[_0x60e2('0x91')]){if(_0x32a091[_0x60e2('0x92')]==_0x60e2('0x91')){_0x13e1ba[_0x60e2('0x89')]='COMPLETED';logger['info'](_0x60e2('0x93'),_0x13e1ba[_0x60e2('0x4a')],_0x13e1ba[_0x60e2('0x73')]);}else{if(_[_0x60e2('0x94')](_0x32a091[_0x60e2('0x38')]['toLowerCase'](),'local/')){if(this[_0x60e2('0xf')][_0x32a091[_0x60e2('0x95')]]){var _0x56a5de=_['last'](this[_0x60e2('0xf')][_0x32a091[_0x60e2('0x95')]]);_0x56a5de[_0x60e2('0x7c')]=![];_0x56a5de[_0x60e2('0x96')]=!![];_0x56a5de[_0x60e2('0x90')]=moment(_0x13e1ba[_0x60e2('0x75')])[_0x60e2('0x97')](_0x32a091['holdtime'],_0x60e2('0x98'))['format'](_0x60e2('0x76'));_0x56a5de[_0x60e2('0x89')]=_0x60e2('0x99');_0x56a5de['transfer']=!![];_0x56a5de[_0x60e2('0x9a')]=_0x60e2('0x9b');_0x56a5de[_0x60e2('0x9c')]=_0x32a091['destexten'];_0x56a5de[_0x60e2('0x9d')]=_0x32a091[_0x60e2('0x47')];logger[_0x60e2('0x69')](_0x60e2('0x9e'),_0x56a5de['name'],_0x56a5de['type']);var _0x44948e=this[_0x60e2('0xf')][_0x32a091[_0x60e2('0x95')]];this[_0x60e2('0xf')][_0x32a091[_0x60e2('0x95')]]=this[_0x60e2('0xf')][_0x32a091['uniqueid']];this['queueReports'][_0x32a091[_0x60e2('0x47')]]=_0x44948e;}}else{_0x13e1ba[_0x60e2('0x89')]=_0x60e2('0x9f')+_0x32a091[_0x60e2('0x92')]['toUpperCase']();logger[_0x60e2('0x69')](_0x60e2('0xa0'),_0x13e1ba[_0x60e2('0x4a')],_0x13e1ba[_0x60e2('0x73')],_0x13e1ba[_0x60e2('0x89')]);}}}this[_0x60e2('0x11')][_0x32a091['uniqueid']]=_0x13e1ba;this[_0x60e2('0x41')](_0x13e1ba,_0x60e2('0x1f'));}}}catch(_0x3a9e70){logger[_0x60e2('0x3d')](_0x60e2('0x8b'),_0x32a091[_0x60e2('0x47')],util['inspect'](_0x3a9e70,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')][_0x60e2('0xa1')]=function(_0x111340){try{if(this[_0x60e2('0x5f')](_0x111340)){logger[_0x60e2('0x45')](_0x60e2('0xa2'),_0x111340[_0x60e2('0x47')],util['inspect'](_0x111340,{'showHidden':![],'depth':null}));this[_0x60e2('0xa3')](_0x111340[_0x60e2('0x47')],_['keys'](_0x111340[_0x60e2('0xa4')])[0x0],_0x111340['value']);if(this[_0x60e2('0xf')][_0x111340[_0x60e2('0x47')]]){var _0x11799f=_[_0x60e2('0x7b')](this[_0x60e2('0xf')][_0x111340[_0x60e2('0x47')]]);if(_0x11799f){if(this['isNotNull'](_0x111340[_0x60e2('0xa4')])&&this[_0x60e2('0x5f')](_0x111340['variable'][_0x60e2('0xa5')])){switch(_0x111340[_0x60e2('0xa6')]){case _0x60e2('0xa7'):_0x11799f[_0x60e2('0x96')]=![];_0x11799f[_0x60e2('0x90')]=null;break;case _0x60e2('0xa8'):_0x11799f[_0x60e2('0xa9')]=_0x60e2('0xaa');_0x11799f[_0x60e2('0x96')]=!![];_0x11799f['queuecallerexitAt']=moment()['format'](_0x60e2('0x76'));_0x11799f['queuecallerleaveAt']=moment()[_0x60e2('0x48')](_0x60e2('0x76'));logger[_0x60e2('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x111340['uniqueid'],util[_0x60e2('0x3c')](_0x11799f,{'showHidden':![],'depth':null}));ami[_0x60e2('0x43')](_0x60e2('0xab'),_0x11799f);break;default:_0x11799f[_0x60e2('0x96')]=!![];_0x11799f['queuecallerexitAt']=moment()[_0x60e2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x11799f[_0x60e2('0xac')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x11799f['queuecallerabandon']=![];_0x11799f['queuecallerabandonAt']=null;_0x11799f[_0x60e2('0x89')]=_0x111340[_0x60e2('0xa6')];this[_0x60e2('0x11')][_0x111340[_0x60e2('0x47')]]=_0x11799f;this['emitVoiceQueueChannelRemove'](_0x11799f,'varset');}else if(this[_0x60e2('0x5f')](_0x111340['variable'])&&this[_0x60e2('0x5f')](_0x111340[_0x60e2('0xa4')][_0x60e2('0xad')])){if(!_0x11799f[_0x60e2('0x1c')]){_0x11799f['queuecallerexit']=!![];_0x11799f['queuecallerexitAt']=moment()['format'](_0x60e2('0x76'));_0x11799f[_0x60e2('0x89')]=_0x60e2('0xae');_0x11799f['queuecallerleaveAt']=moment()[_0x60e2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x60e2('0x11')][_0x111340['uniqueid']]=_0x11799f;}}logger[_0x60e2('0x69')](_0x60e2('0xaf'),_0x111340['uniqueid'],_0x11799f['name'],_0x11799f[_0x60e2('0x73')],_[_0x60e2('0xb0')](_0x111340[_0x60e2('0xa4')])[0x0],_0x111340[_0x60e2('0xa6')]);_0x11799f[_0x60e2('0x16')]=this[_0x60e2('0x16')][_0x111340[_0x60e2('0x47')]];}}}}catch(_0x2962bc){logger[_0x60e2('0x3d')](_0x60e2('0xa2'),_0x111340[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x2962bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60e2('0x33')][_0x60e2('0xa3')]=function(_0x3d7cb7,_0x35b40a,_0x3a84d4){var _0x47c975=['rtpaudioqos',_0x60e2('0xb1'),'rtpaudioqosjitter',_0x60e2('0xb2'),_0x60e2('0xb3'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0x60e2('0xb4'),'sipuri','bridgepeer',_0x60e2('0xb5'),'membercalls',_0x60e2('0xb6'),_0x60e2('0xb7'),_0x60e2('0xb8'),_0x60e2('0x8f'),_0x60e2('0xb9'),_0x60e2('0xba')];if(!_[_0x60e2('0xbb')](_0x35b40a)&&!_['includes'](_0x47c975,_0x35b40a)){if(_['isUndefined'](this[_0x60e2('0x16')][_0x3d7cb7])){this['variables'][_0x3d7cb7]={};}this[_0x60e2('0x16')][_0x3d7cb7][_0x35b40a]=_0x3a84d4;}};VoiceQueueReport[_0x60e2('0x33')][_0x60e2('0x22')]=function(_0x1d405a){try{if(this[_0x60e2('0x5f')](_0x1d405a)){logger['debug'](_0x60e2('0xbc'),_0x1d405a[_0x60e2('0x47')],util[_0x60e2('0x3c')](_0x1d405a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1d405a[_0x60e2('0x47')]]){for(var _0x1d7212=0x0,_0x85db5a={};_0x1d7212=0x0?moment(_0x30faab[_0x76ed('0x1b')])[_0x76ed('0xf')](_0x30faab[_0x76ed('0x1a')],_0x76ed('0x11')):null,'data1':_0x76ed('0x1c'),'data2':_0x30faab[_0x76ed('0x17')],'data3':_0x30faab[_0x76ed('0x14')],'data4':_0x30faab[_0x76ed('0x1d')]||null,'role':_0x76ed('0x16'),'internal':_0x30faab[_0x76ed('0x17')]?_[_0x76ed('0x18')](_0x30faab[_0x76ed('0x17')]):undefined,'uniqueid':_0x30faab[_0x76ed('0x1e')]},'log':_0x76ed('0x8')});}; \ No newline at end of file +var _0xc02c=['TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','accountcode','uniqueid','membername','starttime','endtime','outbound','dialstring','toNumber','moment','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s'];(function(_0x5474b7,_0x1830aa){var _0x2f37a1=function(_0x52f6d2){while(--_0x52f6d2){_0x5474b7['push'](_0x5474b7['shift']());}};_0x2f37a1(++_0x1830aa);}(_0xc02c,0xdb));var _0xcc02=function(_0x570a96,_0x25ae40){_0x570a96=_0x570a96-0x0;var _0x4167ff=_0xc02c[_0x570a96];return _0x4167ff;};'use strict';var moment=require(_0xcc02('0x0'));var _=require('lodash');var util=require(_0xcc02('0x1'));var client=require(_0xcc02('0x2'));exports['voiceQueueReport']=function(_0xd2453b){var _0xcefaae=_0xd2453b[_0xcc02('0x3')]||_0xd2453b[_0xcc02('0x4')];return client[_0xcc02('0x5')](_0xcc02('0x6'),{'body':{'channel':_0xcc02('0x7'),'membername':_0xd2453b[_0xcc02('0x8')],'interface':_[_0xcc02('0x9')](_0xd2453b[_0xcc02('0xa')])?util[_0xcc02('0xb')](_0xcc02('0xc'),_0xd2453b['lastAssignedTo']):_0xd2453b[_0xcc02('0xa')],'type':_0xcc02('0xd'),'enterAt':_0xd2453b[_0xcc02('0xe')],'exitAt':_0xcefaae,'duration':moment(_0xcefaae)[_0xcc02('0xf')](_0xd2453b['queuecallerleaveAt'],_0xcc02('0x10')),'data1':_0xcc02('0x11'),'data2':_0xd2453b[_0xcc02('0x12')],'data3':_0xd2453b[_0xcc02('0x13')],'data4':null,'data5':_0xd2453b[_0xcc02('0x14')],'role':'agent','internal':_0xd2453b[_0xcc02('0x15')]?_['toNumber'](_0xd2453b[_0xcc02('0x15')]):undefined,'uniqueid':_0xd2453b[_0xcc02('0x16')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x5b80a5){return client['Request'](_0xcc02('0x6'),{'body':{'channel':'voice','membername':_0x5b80a5[_0xcc02('0x17')],'interface':_0x5b80a5[_0xcc02('0xa')],'type':'TALKING','enterAt':_0x5b80a5[_0xcc02('0x18')],'exitAt':_0x5b80a5[_0xcc02('0x19')],'duration':moment(_0x5b80a5[_0xcc02('0x19')])['diff'](_0x5b80a5['starttime'],'seconds')>=0x0?moment(_0x5b80a5[_0xcc02('0x19')])[_0xcc02('0xf')](_0x5b80a5['starttime'],_0xcc02('0x10')):null,'data1':_0xcc02('0x1a'),'data2':_0x5b80a5[_0xcc02('0x15')],'data3':_0x5b80a5[_0xcc02('0x13')],'data4':_0x5b80a5[_0xcc02('0x1b')]||null,'role':'agent','internal':_0x5b80a5[_0xcc02('0x15')]?_[_0xcc02('0x1c')](_0x5b80a5[_0xcc02('0x15')]):undefined,'uniqueid':_0x5b80a5['uniqueid']},'log':_0xcc02('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c1eb250..a5274f4 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 _0x12fd=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0xa07ccc,_0x28a6dd){var _0x3cc3b4=function(_0x39ab1a){while(--_0x39ab1a){_0xa07ccc['push'](_0xa07ccc['shift']());}};_0x3cc3b4(++_0x28a6dd);}(_0x12fd,0x199));var _0xd12f=function(_0x2d20b0,_0x201224){_0x2d20b0=_0x2d20b0-0x0;var _0x34ba1b=_0x12fd[_0x2d20b0];return _0x34ba1b;};'use strict';var client=require(_0xd12f('0x0'));exports[_0xd12f('0x1')]=function(){return client[_0xd12f('0x2')](_0xd12f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd12f('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xdb51=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2df172,_0x10868d){var _0x5045fd=function(_0x361097){while(--_0x361097){_0x2df172['push'](_0x2df172['shift']());}};_0x5045fd(++_0x10868d);}(_0xdb51,0x145));var _0x1db5=function(_0xc47532,_0x1ecff3){_0xc47532=_0xc47532-0x0;var _0x2fc846=_0xdb51[_0xc47532];return _0x2fc846;};'use strict';var client=require(_0x1db5('0x0'));exports[_0x1db5('0x1')]=function(){return client[_0x1db5('0x2')](_0x1db5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1db5('0x4')]},'log':_0x1db5('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 8079bb5..cd11696 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 _0x689b=['getTemplates','Request','GetTemplate','../client'];(function(_0x5e9c33,_0x44554c){var _0x1a248e=function(_0x55172f){while(--_0x55172f){_0x5e9c33['push'](_0x5e9c33['shift']());}};_0x1a248e(++_0x44554c);}(_0x689b,0xeb));var _0xb689=function(_0x29aba9,_0x51a553){_0x29aba9=_0x29aba9-0x0;var _0x1fe223=_0x689b[_0x29aba9];return _0x1fe223;};'use strict';var client=require(_0xb689('0x0'));exports[_0xb689('0x1')]=function(_0x22e57f){return function(_0x1390c1){return client[_0xb689('0x2')](_0xb689('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0xb689('0x3')});};}; \ No newline at end of file +var _0xa503=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0xa503,0x143));var _0x3a50=function(_0x33211e,_0x5c2377){_0x33211e=_0x33211e-0x0;var _0x3a7723=_0xa503[_0x33211e];return _0x3a7723;};'use strict';var client=require(_0x3a50('0x0'));exports[_0x3a50('0x1')]=function(_0x58bd8d){return function(_0x3fb8eb){return client[_0x3a50('0x2')](_0x3a50('0x3'),{'options':{'raw':!![],'attributes':['id',_0x3a50('0x4'),'html']},'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 95ce37e..19109cc 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 _0x494b=['action','data1','data3','data4','data5','data7','GetTrigger','getTriggers','Request','name','channel','status','AllConditions','field','value','Condition','Action'];(function(_0x43469e,_0x4e69d6){var _0xcefd2a=function(_0x8ded6f){while(--_0x8ded6f){_0x43469e['push'](_0x43469e['shift']());}};_0xcefd2a(++_0x4e69d6);}(_0x494b,0x128));var _0xb494=function(_0x3903ef,_0x30063f){_0x3903ef=_0x3903ef-0x0;var _0x5a340b=_0x494b[_0x3903ef];return _0x5a340b;};'use strict';var client=require('../client');exports[_0xb494('0x0')]=function(_0x275a94){return function(_0x17d892){return client[_0xb494('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xb494('0x2'),_0xb494('0x3'),_0xb494('0x4')],'include':[{'model':'Condition','as':_0xb494('0x5'),'attributes':['id',_0xb494('0x6'),'operator',_0xb494('0x7')]},{'model':_0xb494('0x8'),'as':'AnyConditions','attributes':['id','field','operator','value']},{'model':_0xb494('0x9'),'as':'Actions','attributes':['id',_0xb494('0xa'),_0xb494('0xb'),'data2',_0xb494('0xc'),_0xb494('0xd'),_0xb494('0xe'),'data6',_0xb494('0xf')]}]},'log':_0xb494('0x10')});};}; \ No newline at end of file +var _0x4928=['Condition','AllConditions','AnyConditions','field','operator','value','Action','Actions','action','data1','data4','data6','data7','../client','GetTrigger','name','channel','status'];(function(_0xeeca9f,_0x114254){var _0x557fdd=function(_0xcd9893){while(--_0xcd9893){_0xeeca9f['push'](_0xeeca9f['shift']());}};_0x557fdd(++_0x114254);}(_0x4928,0x151));var _0x8492=function(_0x1a4817,_0x563509){_0x1a4817=_0x1a4817-0x0;var _0x5d8856=_0x4928[_0x1a4817];return _0x5d8856;};'use strict';var client=require(_0x8492('0x0'));exports['getTriggers']=function(_0xf2e2d2){return function(_0x442459){return client['Request'](_0x8492('0x1'),{'options':{'raw':![],'attributes':['id',_0x8492('0x2'),_0x8492('0x3'),_0x8492('0x4')],'include':[{'model':_0x8492('0x5'),'as':_0x8492('0x6'),'attributes':['id','field','operator','value']},{'model':_0x8492('0x5'),'as':_0x8492('0x7'),'attributes':['id',_0x8492('0x8'),_0x8492('0x9'),_0x8492('0xa')]},{'model':_0x8492('0xb'),'as':_0x8492('0xc'),'attributes':['id',_0x8492('0xd'),_0x8492('0xe'),'data2','data3',_0x8492('0xf'),'data5',_0x8492('0x10'),_0x8492('0x11')]}]},'log':_0x8492('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5076180..7300f54 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 _0x9305=['registry','defaultuser','../client','getTrunks','GetTrunk','name'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9305,0x1e2));var _0x5930=function(_0x257a0,_0x42d2b4){_0x257a0=_0x257a0-0x0;var _0x8a44ed=_0x9305[_0x257a0];return _0x8a44ed;};'use strict';var client=require(_0x5930('0x0'));exports[_0x5930('0x1')]=function(_0x454dee){return function(_0x226303){return client['Request'](_0x5930('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5930('0x3'),_0x5930('0x4'),_0x5930('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x2fc2=['defaultuser','../client','Request','GetTrunk','name','registry'];(function(_0x223af8,_0x58016f){var _0x4699f=function(_0x69fb6f){while(--_0x69fb6f){_0x223af8['push'](_0x223af8['shift']());}};_0x4699f(++_0x58016f);}(_0x2fc2,0x193));var _0x22fc=function(_0x395f27,_0x312782){_0x395f27=_0x395f27-0x0;var _0x418034=_0x2fc2[_0x395f27];return _0x418034;};'use strict';var client=require(_0x22fc('0x0'));exports['getTrunks']=function(_0x4e5d83){return function(_0x36c268){return client[_0x22fc('0x1')](_0x22fc('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x22fc('0x3'),_0x22fc('0x4'),_0x22fc('0x5')]},'log':_0x22fc('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index bf005c1..7c18665 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x242c60,_0x534dd2){var _0x30dc0b=function(_0x8ea5a4){while(--_0x8ea5a4){_0x242c60['push'](_0x242c60['shift']());}};_0x30dc0b(++_0x534dd2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe706,0xa3));var _0x6e70=function(_0x21b037,_0x1f310a){_0x21b037=_0x21b037-0x0;var _0x20556c=_0xe706[_0x21b037];return _0x20556c;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 941cc95..879a8c0 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 _0xac1a=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x54ef86,_0x27f169){var _0x4378be=function(_0x5082a7){while(--_0x5082a7){_0x54ef86['push'](_0x54ef86['shift']());}};_0x4378be(++_0x27f169);}(_0xac1a,0x97));var _0xaac1=function(_0x56554c,_0x4f6445){_0x56554c=_0x56554c-0x0;var _0x113cc1=_0xac1a[_0x56554c];return _0x113cc1;};'use strict';var client=require(_0xaac1('0x0'));exports['create']=function(_0x185598){return client[_0xaac1('0x1')](_0xaac1('0x2'),{'body':_0x185598,'log':_0xaac1('0x2')});};exports[_0xaac1('0x3')]=function(_0x2a1d92,_0x4f46a0,_0x812480){return client['Request'](_0xaac1('0x4'),{'body':_0x2a1d92,'options':{'where':{'uniqueid':_0x4f46a0,'interface':_0x812480,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xa82c=['update','UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x49d38f,_0x4a450a){var _0xbe12a7=function(_0x3cca2b){while(--_0x3cca2b){_0x49d38f['push'](_0x49d38f['shift']());}};_0xbe12a7(++_0x4a450a);}(_0xa82c,0xca));var _0xca82=function(_0x1a23cc,_0x2c914b){_0x1a23cc=_0x1a23cc-0x0;var _0x45a2d3=_0xa82c[_0x1a23cc];return _0x45a2d3;};'use strict';var client=require('../client');exports[_0xca82('0x0')]=function(_0x58ea08){return client[_0xca82('0x1')](_0xca82('0x2'),{'body':_0x58ea08,'log':_0xca82('0x2')});};exports[_0xca82('0x3')]=function(_0x13fd19,_0x456c8d,_0x9ff81a){return client[_0xca82('0x1')](_0xca82('0x4'),{'body':_0x13fd19,'options':{'where':{'uniqueid':_0x456c8d,'interface':_0x9ff81a,'agentcomplete':!![]}},'log':_0xca82('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 648498a..6ac0108 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 _0xa648=['../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','lodash'];(function(_0x31ad9e,_0x2c0b83){var _0x422adb=function(_0x935001){while(--_0x935001){_0x31ad9e['push'](_0x31ad9e['shift']());}};_0x422adb(++_0x2c0b83);}(_0xa648,0x11b));var _0x8a64=function(_0x35f375,_0x5e0366){_0x35f375=_0x35f375-0x0;var _0xf65981=_0xa648[_0x35f375];return _0xf65981;};'use strict';var moment=require(_0x8a64('0x0'));var util=require(_0x8a64('0x1'));var _=require(_0x8a64('0x2'));var client=require(_0x8a64('0x3'));exports[_0x8a64('0x4')]=function(_0x3f9be6){return client[_0x8a64('0x5')]('CreateVoiceCallReport',{'body':_[_0x8a64('0x6')](_0x3f9be6,{'source':_0x3f9be6[_0x8a64('0x7')],'destinationcontext':_0x3f9be6[_0x8a64('0x8')],'callerid':_0x3f9be6[_0x8a64('0x9')],'amaflags':_0x8a64('0xa')}),'log':_0x8a64('0xb')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x8a64('0x5')](_0x8a64('0xc'),{'options':{'where':{'type':[_0x8a64('0xd')],'createdAt':{'$between':[moment()[_0x8a64('0xe')]('day')[_0x8a64('0xf')](_0x8a64('0x10')),moment()[_0x8a64('0x11')]('day')['format'](_0x8a64('0x10'))]}},'attributes':[_0x8a64('0x12'),_0x8a64('0x13'),_0x8a64('0x14'),'billableseconds']},'log':_0x8a64('0x15')});};}; \ No newline at end of file +var _0xb965=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xb965,0x180));var _0x5b96=function(_0x40a10e,_0x17bea7){_0x40a10e=_0x40a10e-0x0;var _0x5c2612=_0xb965[_0x40a10e];return _0x5c2612;};'use strict';var moment=require(_0x5b96('0x0'));var util=require('util');var _=require(_0x5b96('0x1'));var client=require(_0x5b96('0x2'));exports['create']=function(_0xdd8d2a){return client[_0x5b96('0x3')](_0x5b96('0x4'),{'body':_[_0x5b96('0x5')](_0xdd8d2a,{'source':_0xdd8d2a[_0x5b96('0x6')],'destinationcontext':_0xdd8d2a[_0x5b96('0x7')],'callerid':_0xdd8d2a[_0x5b96('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x5b96('0x4')});};exports[_0x5b96('0x9')]=function(){return function(){return client['Request'](_0x5b96('0xa'),{'options':{'where':{'type':[_0x5b96('0xb')],'createdAt':{'$between':[moment()[_0x5b96('0xc')](_0x5b96('0xd'))[_0x5b96('0xe')](_0x5b96('0xf')),moment()[_0x5b96('0x10')]('day')[_0x5b96('0xe')](_0x5b96('0xf'))]}},'attributes':[_0x5b96('0x11'),_0x5b96('0x12'),_0x5b96('0x13'),_0x5b96('0x14')]},'log':_0x5b96('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d8b2835..4706729 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 _0x0667=['CreateVoiceDialReport','../client','Request'];(function(_0x346e40,_0x2b4674){var _0xde609=function(_0x7a2396){while(--_0x7a2396){_0x346e40['push'](_0x346e40['shift']());}};_0xde609(++_0x2b4674);}(_0x0667,0xac));var _0x7066=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0667[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x7066('0x0'));exports['create']=function(_0x3819a8){return client[_0x7066('0x1')](_0x7066('0x2'),{'body':_0x3819a8,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x1d6a=['../client','create','CreateVoiceDialReport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1d6a,0xa5));var _0xa1d6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1d6a[_0xfae23b];return _0x200640;};'use strict';var client=require(_0xa1d6('0x0'));exports[_0xa1d6('0x1')]=function(_0x5338ea){return client['Request'](_0xa1d6('0x2'),{'body':_0x5338ea,'log':_0xa1d6('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ac5cb31..1b402b1 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 _0x2fe3=['../client','getVoiceExtensions','exten'];(function(_0x4ebf12,_0x596662){var _0x46328d=function(_0x396bab){while(--_0x396bab){_0x4ebf12['push'](_0x4ebf12['shift']());}};_0x46328d(++_0x596662);}(_0x2fe3,0x87));var _0x32fe=function(_0x432186,_0x6c106){_0x432186=_0x432186-0x0;var _0x5d90de=_0x2fe3[_0x432186];return _0x5d90de;};'use strict';var client=require(_0x32fe('0x0'));exports[_0x32fe('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x32fe('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x32fe('0x1')});};}; \ No newline at end of file +var _0x263f=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x263f,0x182));var _0xf263=function(_0x2165f8,_0x140863){_0x2165f8=_0x2165f8-0x0;var _0x53f7f9=_0x263f[_0x2165f8];return _0x53f7f9;};'use strict';var client=require(_0xf263('0x0'));exports[_0xf263('0x1')]=function(){return function(){return client[_0xf263('0x2')](_0xf263('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf263('0x4'),_0xf263('0x5')],'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 d5f741a..b599274 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 _0xb39f=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','name','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb39f,0x1e6));var _0xfb39=function(_0x1f9a5e,_0x268165){_0x1f9a5e=_0x1f9a5e-0x0;var _0x3d1ad9=_0xb39f[_0x1f9a5e];return _0x3d1ad9;};'use strict';var client=require(_0xfb39('0x0'));exports[_0xfb39('0x1')]=function(){return function(){return client[_0xfb39('0x2')](_0xfb39('0x3'),{'options':{'raw':![],'attributes':['id','name','acw','acwTimeout',_0xfb39('0x4'),'monitor_format',_0xfb39('0x5'),_0xfb39('0x6'),'dialMethod',_0xfb39('0x7'),_0xfb39('0x8'),_0xfb39('0x9'),_0xfb39('0xa'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xfb39('0xb'),_0xfb39('0xc'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xfb39('0xd'),_0xfb39('0xe'),_0xfb39('0xf'),_0xfb39('0x10'),_0xfb39('0x11'),'dialNoAnswerMaxRetry',_0xfb39('0x12'),_0xfb39('0x13'),_0xfb39('0x14'),_0xfb39('0x15'),_0xfb39('0x16'),'dialCheckDuplicateType','dialAMDActive',_0xfb39('0x17'),_0xfb39('0x18'),_0xfb39('0x19'),'dialAMDTotalAnalysisTime',_0xfb39('0x1a'),_0xfb39('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0xfb39('0x1c'),_0xfb39('0x1d'),_0xfb39('0x1e'),'dialRecallInQueue','dialOrderByScheduledAt',_0xfb39('0x1f'),_0xfb39('0x20'),_0xfb39('0x21'),_0xfb39('0x22'),_0xfb39('0x23'),'dialRandomLastDigitCallerIdNumber',_0xfb39('0x24'),_0xfb39('0x25'),_0xfb39('0x26'),_0xfb39('0x27'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0xfb39('0x28'),_0xfb39('0x29'),_0xfb39('0x2a'),_0xfb39('0x2b'),_0xfb39('0x2c'),'mandatoryDisposition',_0xfb39('0x2d'),_0xfb39('0x2e'),_0xfb39('0x2f')],'include':[{'model':_0xfb39('0x30'),'as':_0xfb39('0x30'),'attributes':['id','name','callerid',_0xfb39('0x31')]},{'model':_0xfb39('0x32'),'as':'mandatoryDispositionPause','attributes':['id',_0xfb39('0x33')]},{'model':_0xfb39('0x30'),'as':_0xfb39('0x34'),'attributes':['id','name','callerid',_0xfb39('0x31')]},{'model':'Interval','as':_0xfb39('0x35'),'attributes':['id',_0xfb39('0x33')],'include':[{'model':_0xfb39('0x35'),'as':_0xfb39('0x36'),'attributes':['id',_0xfb39('0x33'),_0xfb39('0x37')]}]}]},'log':_0xfb39('0x1')});};}; \ No newline at end of file +var _0x4489=['strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2'];(function(_0x312b89,_0x3ed2c2){var _0x5c0d3e=function(_0x3fd0ae){while(--_0x3fd0ae){_0x312b89['push'](_0x312b89['shift']());}};_0x5c0d3e(++_0x3ed2c2);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9448('0x0'));exports[_0x9448('0x1')]=function(){return function(){return client['Request'](_0x9448('0x2'),{'options':{'raw':![],'attributes':['id',_0x9448('0x3'),_0x9448('0x4'),_0x9448('0x5'),'autopause','monitor_format','type','dialActive','dialMethod',_0x9448('0x6'),'dialLimitQueue',_0x9448('0x7'),'dialPredictiveOptimization',_0x9448('0x8'),_0x9448('0x9'),_0x9448('0xa'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0x9448('0xb'),_0x9448('0xc'),_0x9448('0xd'),_0x9448('0xe'),_0x9448('0xf'),'dialBusyRetryFrequency',_0x9448('0x10'),_0x9448('0x11'),_0x9448('0x12'),_0x9448('0x13'),_0x9448('0x14'),_0x9448('0x15'),_0x9448('0x16'),_0x9448('0x17'),'dialAMDInitialSilence',_0x9448('0x18'),'dialAMDAfterGreetingSilence',_0x9448('0x19'),_0x9448('0x1a'),'dialAMDBetweenWordsSilence',_0x9448('0x1b'),_0x9448('0x1c'),_0x9448('0x1d'),_0x9448('0x1e'),_0x9448('0x1f'),_0x9448('0x20'),_0x9448('0x21'),_0x9448('0x22'),'dialAgiAfterHangupClient',_0x9448('0x23'),'monitor_format',_0x9448('0x24'),_0x9448('0x25'),_0x9448('0x26'),_0x9448('0x27'),_0x9448('0x28'),_0x9448('0x29'),_0x9448('0x2a'),_0x9448('0x2b'),_0x9448('0x2c'),_0x9448('0x2d'),'dialMachineRetryFrequency',_0x9448('0x2e'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x9448('0x2f'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe'],'include':[{'model':'Trunk','as':_0x9448('0x30'),'attributes':['id','name',_0x9448('0x31'),_0x9448('0x32')]},{'model':_0x9448('0x33'),'as':'mandatoryDispositionPause','attributes':['id',_0x9448('0x3')]},{'model':_0x9448('0x30'),'as':_0x9448('0x34'),'attributes':['id',_0x9448('0x3'),_0x9448('0x31'),_0x9448('0x32')]},{'model':'Interval','as':'Interval','attributes':['id',_0x9448('0x3')],'include':[{'model':_0x9448('0x35'),'as':_0x9448('0x36'),'attributes':['id',_0x9448('0x3'),_0x9448('0x37')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index da1073d..d902692 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(_0x3564b8,_0x261291){var _0x453bec=function(_0x4c9fd3){while(--_0x4c9fd3){_0x3564b8['push'](_0x3564b8['shift']());}};_0x453bec(++_0x261291);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x2b35dc,_0xd6d323){var _0x4ac263=function(_0x184cdd){while(--_0x184cdd){_0x2b35dc['push'](_0x2b35dc['shift']());}};_0x4ac263(++_0xd6d323);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 793382f..7905d9b 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 _0x253e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x4a9aae,_0x38096f){var _0xbc523b=function(_0x32d513){while(--_0x32d513){_0x4a9aae['push'](_0x4a9aae['shift']());}};_0xbc523b(++_0x38096f);}(_0x253e,0x1aa));var _0xe253=function(_0x2eafc9,_0x395383){_0x2eafc9=_0x2eafc9-0x0;var _0x490e15=_0x253e[_0x2eafc9];return _0x490e15;};'use strict';var client=require('../client');exports[_0xe253('0x0')]=function(_0x2928aa){return function(){return client[_0xe253('0x1')](_0xe253('0x2'),{'options':{'where':{'VoiceQueueId':_0x2928aa,'paused':!![]},'raw':!![]},'log':_0xe253('0x0')});};}; \ No newline at end of file +var _0x0d43=['Request','getVoiceQueueRtPauses'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x0d43,0x133));var _0x30d4=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x0d43[_0x146a85];return _0x1b59bf;};'use strict';var client=require('../client');exports[_0x30d4('0x0')]=function(_0xda7b0c){return function(){return client[_0x30d4('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xda7b0c,'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 46a2b52..79d2150 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(_0x5bd2ff,_0x52e1a3){var _0x3f9bbd=function(_0x1e6a1b){while(--_0x1e6a1b){_0x5bd2ff['push'](_0x5bd2ff['shift']());}};_0x3f9bbd(++_0x52e1a3);}(_0x7a54,0x106));var _0x47a5=function(_0x3a550b,_0x35abbf){_0x3a550b=_0x3a550b-0x0;var _0x5a76de=_0x7a54[_0x3a550b];return _0x5a76de;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3d8a94,_0x4294a4){var _0x20d4c8=function(_0x665503){while(--_0x665503){_0x3d8a94['push'](_0x3d8a94['shift']());}};_0x20d4c8(++_0x4294a4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 17fa0d5..bef1c1c 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 _0xb2ec=['origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','blind','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','isexternal'];(function(_0x1d83d9,_0x595e3e){var _0x208b45=function(_0x5ddee3){while(--_0x5ddee3){_0x1d83d9['push'](_0x1d83d9['shift']());}};_0x208b45(++_0x595e3e);}(_0xb2ec,0x1f1));var _0xcb2e=function(_0x2cfdd2,_0x2a5214){_0x2cfdd2=_0x2cfdd2-0x0;var _0xf53e8=_0xb2ec[_0x2cfdd2];return _0xf53e8;};'use strict';var client=require(_0xcb2e('0x0'));exports[_0xcb2e('0x1')]={};exports[_0xcb2e('0x2')]=function(_0x54dfb6){return client[_0xcb2e('0x3')](_0xcb2e('0x4'),{'body':{'result':_0x54dfb6['result'],'transfererchannel':_0x54dfb6[_0xcb2e('0x5')],'transferercalleridnum':_0x54dfb6[_0xcb2e('0x6')],'transferercalleridname':_0x54dfb6[_0xcb2e('0x7')],'transfererconnectedlinenum':_0x54dfb6[_0xcb2e('0x8')],'transfererconnectedlinename':_0x54dfb6[_0xcb2e('0x9')],'transfereraccountcode':_0x54dfb6[_0xcb2e('0xa')],'transferercontext':_0x54dfb6[_0xcb2e('0xb')],'transfererexten':_0x54dfb6[_0xcb2e('0xc')],'transfererlinkedid':_0x54dfb6[_0xcb2e('0xd')],'transfereechannel':_0x54dfb6['transfereechannel'],'transfereecalleridnum':_0x54dfb6[_0xcb2e('0xe')],'transfereecalleridname':_0x54dfb6[_0xcb2e('0xf')],'transfereeconnectedlinenum':_0x54dfb6[_0xcb2e('0x10')],'transfereeconnectedlinename':_0x54dfb6[_0xcb2e('0x11')],'transfereeaccountcode':_0x54dfb6[_0xcb2e('0x12')],'transfereecontext':_0x54dfb6[_0xcb2e('0x13')],'transfereeexten':_0x54dfb6[_0xcb2e('0x14')],'transfereelinkedid':_0x54dfb6['transfereelinkedid'],'isexternal':_0x54dfb6['isexternal'],'context':_0x54dfb6['context'],'extension':_0x54dfb6['extension'],'type':_0xcb2e('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3ec0d6){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3ec0d6[_0xcb2e('0x16')],'transfererchannel':_0x3ec0d6[_0xcb2e('0x17')],'transferercalleridnum':_0x3ec0d6[_0xcb2e('0x18')],'transferercalleridname':_0x3ec0d6['origtransferercalleridname'],'transfererconnectedlinenum':_0x3ec0d6[_0xcb2e('0x19')],'transfererconnectedlinename':_0x3ec0d6['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3ec0d6[_0xcb2e('0x1a')],'transferercontext':_0x3ec0d6[_0xcb2e('0x1b')],'transfererexten':_0x3ec0d6[_0xcb2e('0x1c')],'transfererlinkedid':_0x3ec0d6['origtransfererlinkedid'],'transfereechannel':_0x3ec0d6[_0xcb2e('0x1d')],'transfereecalleridnum':_0x3ec0d6['transfertargetcalleridnum'],'transfereecalleridname':_0x3ec0d6[_0xcb2e('0x1e')],'transfereeconnectedlinenum':_0x3ec0d6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3ec0d6[_0xcb2e('0x1f')],'transfereeaccountcode':_0x3ec0d6[_0xcb2e('0x20')],'transfereecontext':_0x3ec0d6['transfertargetcontext'],'transfereeexten':_0x3ec0d6[_0xcb2e('0x21')],'transfereelinkedid':_0x3ec0d6['transfertargetlinkedid'],'isexternal':_0x3ec0d6[_0xcb2e('0x22')],'context':_0x3ec0d6[_0xcb2e('0x23')],'extension':_0x3ec0d6[_0xcb2e('0x24')],'type':_0xcb2e('0x25')},'log':_0xcb2e('0x4')});}; \ No newline at end of file +var _0xb50d=['attended','blindTransfer','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten'];(function(_0x1ccdba,_0x5c9fd4){var _0x590544=function(_0x21c72c){while(--_0x21c72c){_0x1ccdba['push'](_0x1ccdba['shift']());}};_0x590544(++_0x5c9fd4);}(_0xb50d,0x198));var _0xdb50=function(_0x5133b6,_0x2263ea){_0x5133b6=_0x5133b6-0x0;var _0x56d11e=_0xb50d[_0x5133b6];return _0x56d11e;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xdb50('0x0')]=function(_0x3cd470){return client['Request'](_0xdb50('0x1'),{'body':{'result':_0x3cd470['result'],'transfererchannel':_0x3cd470['transfererchannel'],'transferercalleridnum':_0x3cd470[_0xdb50('0x2')],'transferercalleridname':_0x3cd470[_0xdb50('0x3')],'transfererconnectedlinenum':_0x3cd470[_0xdb50('0x4')],'transfererconnectedlinename':_0x3cd470[_0xdb50('0x5')],'transfereraccountcode':_0x3cd470[_0xdb50('0x6')],'transferercontext':_0x3cd470['transferercontext'],'transfererexten':_0x3cd470[_0xdb50('0x7')],'transfererlinkedid':_0x3cd470[_0xdb50('0x8')],'transfereechannel':_0x3cd470[_0xdb50('0x9')],'transfereecalleridnum':_0x3cd470[_0xdb50('0xa')],'transfereecalleridname':_0x3cd470[_0xdb50('0xb')],'transfereeconnectedlinenum':_0x3cd470[_0xdb50('0xc')],'transfereeconnectedlinename':_0x3cd470[_0xdb50('0xd')],'transfereeaccountcode':_0x3cd470[_0xdb50('0xe')],'transfereecontext':_0x3cd470[_0xdb50('0xf')],'transfereeexten':_0x3cd470[_0xdb50('0x10')],'transfereelinkedid':_0x3cd470[_0xdb50('0x11')],'isexternal':_0x3cd470[_0xdb50('0x12')],'context':_0x3cd470['context'],'extension':_0x3cd470[_0xdb50('0x13')],'type':_0xdb50('0x14')},'log':_0xdb50('0x1')});};exports[_0xdb50('0x15')]=function(_0x16042f){return client[_0xdb50('0x16')](_0xdb50('0x1'),{'body':{'result':_0x16042f['result'],'transfererchannel':_0x16042f[_0xdb50('0x17')],'transferercalleridnum':_0x16042f[_0xdb50('0x18')],'transferercalleridname':_0x16042f[_0xdb50('0x19')],'transfererconnectedlinenum':_0x16042f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x16042f[_0xdb50('0x1a')],'transfereraccountcode':_0x16042f[_0xdb50('0x1b')],'transferercontext':_0x16042f[_0xdb50('0x1c')],'transfererexten':_0x16042f['secondtransfererexten'],'transfererlinkedid':_0x16042f['origtransfererlinkedid'],'transfereechannel':_0x16042f[_0xdb50('0x1d')],'transfereecalleridnum':_0x16042f[_0xdb50('0x1e')],'transfereecalleridname':_0x16042f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x16042f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x16042f[_0xdb50('0x1f')],'transfereeaccountcode':_0x16042f['transfertargetaccountcode'],'transfereecontext':_0x16042f[_0xdb50('0x20')],'transfereeexten':_0x16042f[_0xdb50('0x21')],'transfereelinkedid':_0x16042f[_0xdb50('0x22')],'isexternal':_0x16042f[_0xdb50('0x12')],'context':_0x16042f['origtransferercontext'],'extension':_0x16042f[_0xdb50('0x23')],'type':_0xdb50('0x24')},'log':_0xdb50('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index ab0569d..bc904de 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 _0x5e0e=['moment','../../../config/environment','../properties','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','catch','message','error','command','then','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','undefined','values','voicechannel','find','channels','uniqueid','channel','format','%s.%s','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','map','resolve','StopMixMonitor','filename','wav','StopMixMonitor\x20Success','queueChannels','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird'];(function(_0x1e1741,_0xca8a72){var _0x24582d=function(_0x15c341){while(--_0x15c341){_0x1e1741['push'](_0x1e1741['shift']());}};_0x24582d(++_0xca8a72);}(_0x5e0e,0x89));var _0xe5e0=function(_0x3ce4a5,_0x50bc4b){_0x3ce4a5=_0x3ce4a5-0x0;var _0x3f5809=_0x5e0e[_0x3ce4a5];return _0x3f5809;};'use strict';var _=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var jayson=require('jayson/promise');var schema=require(_0xe5e0('0x2'));var BPromise=require(_0xe5e0('0x3'));var moment=require(_0xe5e0('0x4'));var config=require(_0xe5e0('0x5'));var properties=require(_0xe5e0('0x6'));var ami=require('../ami');exports[_0xe5e0('0x7')]=function(_0x52407b,_0x239262,_0x3e564e){return new BPromise(function(_0x2ff9ac,_0x1a4c51){var _0xa91224={'QueuePause':function(_0x156c30){return new Promise(function(_0x59a81f,_0x4059cf){var _0x29199a=util['format'](_0xe5e0('0x8'),_0xe5e0('0x9'),_0x156c30[_0xe5e0('0xa')]);if(_0x52407b[_0xe5e0('0xb')]&&_0x52407b[_0xe5e0('0xb')][_0x29199a]&&_0x52407b[_0xe5e0('0xb')][_0x29199a][_0xe5e0('0xc')]){_0x52407b[_0xe5e0('0xb')][_0x29199a][_0xe5e0('0xd')]();}if(_0x52407b[_0xe5e0('0xe')][_0x29199a]){_0x52407b[_0xe5e0('0xe')][_0x29199a][_0xe5e0('0xf')]({'statePause':_0x156c30[_0xe5e0('0x10')]?!![]:![]});}_0x59a81f({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x5cabeb){var _0x43638e=this;return new Promise(function(_0x1100cc,_0x24f33d){if(ami[_0xe5e0('0x11')]()==![]){return _0x24f33d(_0x43638e['error'](0x1f4,[config[_0xe5e0('0x12')]['ip'],config[_0xe5e0('0x12')][_0xe5e0('0x13')],_0xe5e0('0x14')][_0xe5e0('0x15')]('\x20')));}_0x5cabeb=_[_0xe5e0('0x16')](_0x5cabeb,_[_0xe5e0('0x17')](properties[_0xe5e0('0x18')]));_0x5cabeb[_0xe5e0('0x19')]='Reload';return ami[_0xe5e0('0x1a')](_0x5cabeb)['then'](function(_0x417077){_0x1100cc({'code':0xc8,'message':_0x417077['message']});})[_0xe5e0('0x1b')](function(_0x150c3a){_0x24f33d(_0x43638e['error'](0x1f5,_0x150c3a[_0xe5e0('0x1c')]));});});},'Command':function(_0x4a7ea4){var _0xa81bd4=this;return new Promise(function(_0xce7366,_0x3a2480){if(ami[_0xe5e0('0x11')]()==![]){return _0x3a2480(_0xa81bd4[_0xe5e0('0x1d')](0x1f4,[config[_0xe5e0('0x12')]['ip'],config[_0xe5e0('0x12')][_0xe5e0('0x13')],_0xe5e0('0x14')][_0xe5e0('0x15')]('\x20')));}_0x4a7ea4=_[_0xe5e0('0x16')](_0x4a7ea4,_0xe5e0('0x1e'));_0x4a7ea4[_0xe5e0('0x19')]='Command';return ami['Action'](_0x4a7ea4)[_0xe5e0('0x1f')](function(_0x228368){_0xce7366({'code':0xc8,'message':_0x228368[_0xe5e0('0x20')]});})[_0xe5e0('0x1b')](function(_0x3596ca){_0x3a2480(_0xa81bd4[_0xe5e0('0x1d')](0x1f5,_0x3596ca[_0xe5e0('0x1c')]));});});},'VoiceQueues':function(_0x48071c){return new Promise(function(_0xf45724,_0x5df2be){var _0x332c4e=[];for(var _0x6f21de in _0x52407b[_0xe5e0('0x21')]){if(_0x52407b[_0xe5e0('0x21')][_0xe5e0('0x22')](_0x6f21de)){var _0x4867f2=_0x52407b['voiceQueues'][_0x6f21de];var _0x25fe90={'id':_0x4867f2['id'],'name':_0x4867f2['name'],'strategy':_0x4867f2[_0xe5e0('0x23')],'answered':_0x4867f2[_0xe5e0('0x24')],'available':_0x4867f2[_0xe5e0('0x25')],'loggedIn':_0x4867f2[_0xe5e0('0x26')],'pTalking':_0x4867f2[_0xe5e0('0x27')],'sumBillable':_0x4867f2[_0xe5e0('0x28')],'sumDuration':_0x4867f2['sumDuration'],'sumHoldTime':_0x4867f2[_0xe5e0('0x29')]||0x0,'talking':_0x4867f2['talking'],'total':_0x4867f2[_0xe5e0('0x2a')],'type':_0x4867f2[_0xe5e0('0x2b')],'unmanaged':_0x4867f2[_0xe5e0('0x2c')],'abandoned':_0x4867f2['abandoned'],'waiting':_0x4867f2[_0xe5e0('0x2d')],'loggedInDb':_0x4867f2[_0xe5e0('0x2e')]};if(_0x4867f2[_0xe5e0('0x2b')]===_0xe5e0('0x2f')){_0x25fe90[_0xe5e0('0x30')]=_0x4867f2['dialActive'];_0x25fe90[_0xe5e0('0x31')]=_0x4867f2[_0xe5e0('0x31')];_0x25fe90[_0xe5e0('0x32')]=_0x4867f2[_0xe5e0('0x32')];_0x25fe90['dialOriginateCallerIdNumber']=_0x4867f2[_0xe5e0('0x33')];_0x25fe90[_0xe5e0('0x34')]=_0x4867f2[_0xe5e0('0x34')];_0x25fe90[_0xe5e0('0x35')]=_0x4867f2[_0xe5e0('0x35')];_0x25fe90[_0xe5e0('0x36')]=_0x4867f2[_0xe5e0('0x36')];_0x25fe90[_0xe5e0('0x37')]=_0x4867f2[_0xe5e0('0x37')];_0x25fe90[_0xe5e0('0x38')]=_0x4867f2[_0xe5e0('0x38')];_0x25fe90[_0xe5e0('0x39')]=_0x4867f2[_0xe5e0('0x39')];_0x25fe90[_0xe5e0('0x3a')]=_0x4867f2[_0xe5e0('0x3a')];_0x25fe90[_0xe5e0('0x3b')]=_0x4867f2['outboundCongestionCallsDay'];_0x25fe90['outboundDropCallsDayACS']=_0x4867f2[_0xe5e0('0x3c')];_0x25fe90[_0xe5e0('0x3d')]=_0x4867f2[_0xe5e0('0x3d')];_0x25fe90['outboundDropCallsDayTimeout']=_0x4867f2[_0xe5e0('0x3e')];_0x25fe90[_0xe5e0('0x3f')]=_0x4867f2[_0xe5e0('0x3f')];_0x25fe90['outboundNoSuchCallsDay']=_0x4867f2[_0xe5e0('0x40')];_0x25fe90[_0xe5e0('0x41')]=_0x4867f2[_0xe5e0('0x41')];_0x25fe90[_0xe5e0('0x42')]=_0x4867f2['outboundReCallsDay'];_0x25fe90[_0xe5e0('0x43')]=_0x4867f2['outboundRejectCallsDay'];_0x25fe90[_0xe5e0('0x44')]=_0x4867f2['outboundUnknownCallsDay'];_0x25fe90[_0xe5e0('0x45')]=_0x4867f2['predictiveIntervalAnsweredCalls'];_0x25fe90[_0xe5e0('0x46')]=_0x4867f2[_0xe5e0('0x46')];_0x25fe90['predictiveIntervalAvgTalktime']=_0x4867f2[_0xe5e0('0x47')];_0x25fe90[_0xe5e0('0x48')]=_0x4867f2[_0xe5e0('0x48')];_0x25fe90[_0xe5e0('0x49')]=_0x4867f2[_0xe5e0('0x49')];_0x25fe90[_0xe5e0('0x4a')]=_0x4867f2[_0xe5e0('0x4a')];_0x25fe90[_0xe5e0('0x4b')]=_0x4867f2[_0xe5e0('0x4b')];_0x25fe90[_0xe5e0('0x4c')]=_0x4867f2[_0xe5e0('0x4c')];_0x25fe90['predictiveIntervalMultiplicativeFactor']=_0x4867f2[_0xe5e0('0x4d')];_0x25fe90[_0xe5e0('0x4e')]=_0x4867f2[_0xe5e0('0x4e')];_0x25fe90[_0xe5e0('0x4f')]=_0x4867f2[_0xe5e0('0x4f')];_0x25fe90['predictiveIntervalTotalCalls']=_0x4867f2[_0xe5e0('0x50')];_0x25fe90[_0xe5e0('0x1c')]=_0x4867f2[_0xe5e0('0x1c')];_0x25fe90[_0xe5e0('0x51')]=_0x4867f2['originated'];_0x25fe90[_0xe5e0('0x52')]=_0x4867f2[_0xe5e0('0x52')];_0x25fe90[_0xe5e0('0x53')]=_0x4867f2[_0xe5e0('0x53')];_0x25fe90[_0xe5e0('0x54')]=_0x4867f2['erlangAbandonmentRate'];_0x25fe90[_0xe5e0('0x55')]=_0x4867f2['erlangBusyFactor'];_0x25fe90['startPredictive']=_0x4867f2[_0xe5e0('0x56')];_0x25fe90[_0xe5e0('0x57')]=_0x4867f2[_0xe5e0('0x57')];}if(_0x4867f2[_0xe5e0('0x58')]){_0x25fe90[_0xe5e0('0x58')]={'id':_0x4867f2['Trunk']['id'],'name':_0x4867f2[_0xe5e0('0x58')][_0xe5e0('0xa')],'active':_0x4867f2['Trunk']['active'],'callerid':_0x4867f2[_0xe5e0('0x58')][_0xe5e0('0x59')]};}if(_0x4867f2[_0xe5e0('0x5a')]){_0x25fe90[_0xe5e0('0x5a')]={'id':_0x4867f2[_0xe5e0('0x5a')]['id'],'name':_0x4867f2['Interval'][_0xe5e0('0xa')]};}_0x332c4e[_0xe5e0('0x5b')](_0x25fe90);}}_0xf45724({'count':_0x332c4e[_0xe5e0('0x5c')],'rows':_0x332c4e});});},'UpdateVoiceQueue':function(_0x56994a){return new Promise(function(_0x3b86e1,_0x21b731){var _0x12ba02=_['find'](_0x52407b['voiceQueues'],{'id':parseInt(_0x56994a['id'])});var _0x43df1d=_['omit'](_0x56994a,['id']);if(_0x12ba02){for(var _0x3084ff in _0x43df1d){if(typeof _0x43df1d[_0x3084ff]!==_0xe5e0('0x5d')&&typeof _0x12ba02[_0x3084ff]!==_0xe5e0('0x5d')){_0x12ba02[_0x3084ff]=_0x43df1d[_0x3084ff];}}_0x3b86e1(_0x12ba02);}else{_0x21b731();}});},'VoiceChannels':function(_0x160803){return new Promise(function(_0x183e81,_0x2138ae){var _0x38fd91=_[_0xe5e0('0x5e')](_0x52407b['channels']);_0x183e81({'count':_0x38fd91['length'],'rows':_0x38fd91});});},'VoiceChannelMixMonitor':function(_0x552a9e){var _0x314ee7=this;return new Promise(function(_0x4fd77b,_0x494257){if(ami['isConnected']()==![]){return _0x494257(_0x314ee7['error'](0x1f4,[config['asterisk']['ip'],config[_0xe5e0('0x12')]['username'],_0xe5e0('0x14')]['join']('\x20')));}var _0x47974f=schema(properties[_0xe5e0('0x5f')])[_0xe5e0('0x2')](_0x552a9e);if(_0x47974f['length']>0x0){return _0x494257(_0x314ee7['error'](0x1f4,_['map'](_0x47974f,_0xe5e0('0x1c'))[_0xe5e0('0x15')](',\x20')));}var _0x3836cb=_[_0xe5e0('0x60')](_0x52407b[_0xe5e0('0x61')],{'uniqueid':_0x552a9e[_0xe5e0('0x62')]});if(_0x3836cb&&_0x3836cb[_0xe5e0('0x63')]){var _0x530d10=util[_0xe5e0('0x64')](_0xe5e0('0x65'),_0x552a9e['filename']||_0x552a9e[_0xe5e0('0x62')],_0x552a9e[_0xe5e0('0x64')]||'wav');return ami[_0xe5e0('0x1a')]({'action':_0xe5e0('0x66'),'channel':_0x3836cb[_0xe5e0('0x63')],'file':_0x530d10,'options':_0xe5e0('0x67')})[_0xe5e0('0x1f')](function(_0x38e40){var _0x4cfdd1=_[_0xe5e0('0x60')](_0x3836cb[_0xe5e0('0x68')],{'filename':_0xe5e0('0x69')+_0x530d10[_0xe5e0('0x6a')]()});if(_[_0xe5e0('0x6b')](_0x4cfdd1)){_0x3836cb['monitors'][_0xe5e0('0x5b')]({'filename':_0xe5e0('0x69')+_0x530d10['toLowerCase'](),'createdAt':moment()[_0xe5e0('0x64')](_0xe5e0('0x6c')),'mixmonitorid':_0x38e40[_0xe5e0('0x6d')],'status':_0xe5e0('0x6e')});}else{_0x4cfdd1[_0xe5e0('0x6d')]=_0x38e40[_0xe5e0('0x6d')];_0x4cfdd1[_0xe5e0('0x6f')]=_0xe5e0('0x6e');}_0x4fd77b({'code':0xc8,'message':[_0x552a9e[_0xe5e0('0x62')],_0xe5e0('0x70'),_0x38e40['mixmonitorid']][_0xe5e0('0x15')]('\x20'),'mixmonitorid':_0x38e40[_0xe5e0('0x6d')]});})['catch'](function(_0x44d6bd){_0x494257(_0x314ee7[_0xe5e0('0x1d')](0x1f5,[_0x552a9e[_0xe5e0('0x62')],_0x44d6bd[_0xe5e0('0x1c')][_0xe5e0('0x6a')]()][_0xe5e0('0x15')]('\x20')));});}else{return _0x494257(_0x314ee7[_0xe5e0('0x1d')](0x1f5,_0xe5e0('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x12e5a3){var _0x38c0e8=this;return new Promise(function(_0x21f7ed,_0x37c521){if(ami[_0xe5e0('0x11')]()==![]){return _0x37c521(_0x38c0e8[_0xe5e0('0x1d')](0x1f4,[config[_0xe5e0('0x12')]['ip'],config[_0xe5e0('0x12')][_0xe5e0('0x13')],'ami\x20disconnected'][_0xe5e0('0x15')]('\x20')));}var _0xe7caf6=schema(properties[_0xe5e0('0x5f')])['validate'](_0x12e5a3);if(_0xe7caf6[_0xe5e0('0x5c')]>0x0){return _0x37c521(_0x38c0e8[_0xe5e0('0x1d')](0x1f4,_[_0xe5e0('0x72')](_0xe7caf6,_0xe5e0('0x1c'))[_0xe5e0('0x15')](',\x20')));}var _0x13932c=_[_0xe5e0('0x60')](_0x52407b[_0xe5e0('0x61')],{'uniqueid':_0x12e5a3[_0xe5e0('0x62')]});if(_0x13932c){return BPromise[_0xe5e0('0x73')]()[_0xe5e0('0x1f')](function(){if(_0x13932c['channel']){return ami[_0xe5e0('0x1a')]({'action':_0xe5e0('0x74'),'channel':_0x13932c[_0xe5e0('0x63')],'mixmonitorid':_0x12e5a3[_0xe5e0('0x6d')]})[_0xe5e0('0x1b')](function(_0x5b15fc){});}})[_0xe5e0('0x1f')](function(){if(_0x13932c['destinationchannel']){return ami[_0xe5e0('0x1a')]({'action':_0xe5e0('0x74'),'channel':_0x13932c['destinationchannel'],'mixmonitorid':_0x12e5a3[_0xe5e0('0x6d')]})[_0xe5e0('0x1b')](function(_0x596990){});}})[_0xe5e0('0x1f')](function(_0x312293){var _0x24f370=_[_0xe5e0('0x60')](_0x13932c[_0xe5e0('0x68')],{'mixmonitorid':_0x12e5a3['mixmonitorid']});if(_0x24f370){_0x24f370[_0xe5e0('0x6f')]='stop';}})[_0xe5e0('0x1f')](function(){var _0x52106a=util[_0xe5e0('0x64')](_0xe5e0('0x65'),_0x12e5a3[_0xe5e0('0x75')]||_0x12e5a3[_0xe5e0('0x62')],_0x12e5a3[_0xe5e0('0x64')]||_0xe5e0('0x76'));var _0x17fb65=_[_0xe5e0('0x60')](_0x13932c['monitors'],{'filename':_0xe5e0('0x69')+_0x52106a[_0xe5e0('0x6a')]()});if(_0x17fb65){_0x17fb65[_0xe5e0('0x6f')]='stop';}})[_0xe5e0('0x1f')](function(){_0x21f7ed({'code':0xc8,'message':[_0x12e5a3[_0xe5e0('0x62')],_0xe5e0('0x77')]['join']('\x20')});})['catch'](function(_0x3803d8){_0x37c521(_0x38c0e8[_0xe5e0('0x1d')](0x1f5,[_0x12e5a3[_0xe5e0('0x62')],_0x3803d8[_0xe5e0('0x1c')]['toLowerCase']()][_0xe5e0('0x15')]('\x20')));});}else{return _0x37c521(_0x38c0e8['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x4d4908){return new Promise(function(_0xd0bb59,_0x41df32){var _0x49a874=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0x78')]);_0xd0bb59({'count':_0x49a874[_0xe5e0('0x5c')],'rows':_0x49a874});});},'VoiceQueuesChannel':function(_0x214df7){var _0x16cfe1=this;return new Promise(function(_0x16ac31,_0x1e3281){var _0x105b24=schema(properties['voicequeuechannel'])[_0xe5e0('0x2')](_0x214df7);if(_0x105b24[_0xe5e0('0x5c')]>0x0){return _0x1e3281(_0x16cfe1[_0xe5e0('0x1d')](0x1f4,_['map'](_0x105b24,_0xe5e0('0x1c'))[_0xe5e0('0x15')](',\x20')));}var _0x5cdbbf=_['find'](_0x52407b['queueChannels'],{'uniqueid':_0x214df7[_0xe5e0('0x62')]});if(_0x5cdbbf){_0x16ac31(_0x5cdbbf);}else{return _0x1e3281(_0x16cfe1[_0xe5e0('0x1d')](0x1f5,_0xe5e0('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x296d5c){var _0x394a7f=this;return new Promise(function(_0x34caa4,_0xc140c9){if(ami[_0xe5e0('0x11')]()==![]){return _0xc140c9(_0x394a7f['error'](0x1f4,[config['asterisk']['ip'],config[_0xe5e0('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x58dcef=schema(properties['voicequeuechannelhangup'])[_0xe5e0('0x2')](_0x296d5c);if(_0x58dcef['length']>0x0){return _0xc140c9(_0x394a7f[_0xe5e0('0x1d')](0x1f4,_[_0xe5e0('0x72')](_0x58dcef,_0xe5e0('0x1c'))['join'](',\x20')));}var _0x261a5a=_[_0xe5e0('0x60')](_0x52407b[_0xe5e0('0x78')],{'uniqueid':_0x296d5c['uniqueid']});if(_0x261a5a&&_0x261a5a[_0xe5e0('0x63')]){return ami[_0xe5e0('0x1a')]({'action':_0xe5e0('0x79'),'channel':_0x261a5a[_0xe5e0('0x63')]})['then'](function(_0x12d9f5){_0x34caa4({'code':0xc8,'message':[_0x296d5c[_0xe5e0('0x62')],_0x12d9f5[_0xe5e0('0x1c')]['toLowerCase']()][_0xe5e0('0x15')]('\x20')});})[_0xe5e0('0x1b')](function(_0x135bad){_0xc140c9(_0x394a7f[_0xe5e0('0x1d')](0x1f5,[_0x296d5c[_0xe5e0('0x62')],_0x135bad['message'][_0xe5e0('0x6a')]()]['join']('\x20')));});}else{return _0xc140c9(_0x394a7f[_0xe5e0('0x1d')](0x1f5,_0xe5e0('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x44aa4f){var _0x5a9b7a=this;return new Promise(function(_0x5365d7,_0x3ddad0){if(ami['isConnected']()==![]){return _0x3ddad0(_0x5a9b7a[_0xe5e0('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xe5e0('0x12')][_0xe5e0('0x13')],_0xe5e0('0x14')][_0xe5e0('0x15')]('\x20')));}var _0xa5b53d=schema(properties['voicequeuechannelredirect'])[_0xe5e0('0x2')](_0x44aa4f);if(_0xa5b53d[_0xe5e0('0x5c')]>0x0){return _0x3ddad0(_0x5a9b7a['error'](0x1f4,_[_0xe5e0('0x72')](_0xa5b53d,_0xe5e0('0x1c'))[_0xe5e0('0x15')](',\x20')));}var _0x520691=_['find'](_0x52407b[_0xe5e0('0x78')],{'uniqueid':_0x44aa4f[_0xe5e0('0x62')]});if(_0x520691&&_0x520691[_0xe5e0('0x63')]){return ami[_0xe5e0('0x1a')]({'action':_0xe5e0('0x7a'),'channel':_0x520691[_0xe5e0('0x63')],'exten':_0x44aa4f[_0xe5e0('0x7b')],'context':_0x44aa4f[_0xe5e0('0x7c')]||_0x520691['context'],'priority':0x1})[_0xe5e0('0x1f')](function(_0x4b8620){_0x5365d7({'code':0xc8,'message':[_0x44aa4f[_0xe5e0('0x62')],_0x4b8620['message']['toLowerCase']()][_0xe5e0('0x15')]('\x20')});})[_0xe5e0('0x1b')](function(_0x3ab8ca){_0x3ddad0(_0x5a9b7a[_0xe5e0('0x1d')](0x1f5,[_0x44aa4f['uniqueid'],_0x3ab8ca[_0xe5e0('0x1c')][_0xe5e0('0x6a')]()]['join']('\x20')));});}else{return _0x3ddad0(_0x5a9b7a[_0xe5e0('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x39f0fc){return new Promise(function(_0x309012,_0x59c32f){var _0x3fb1c3=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0xe')]);_0x309012({'count':_0x3fb1c3['length'],'rows':_0x3fb1c3});});},'Telephones':function(_0x47b2e7){return new Promise(function(_0x27ae6a,_0x56eac2){var _0x272856=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0x7d')]);_0x27ae6a({'count':_0x272856[_0xe5e0('0x5c')],'rows':_0x272856});});},'Trunks':function(_0x2233d6){return new Promise(function(_0x430b70,_0x26e9dc){var _0x3ecced=_['values'](_0x52407b['trunks']);_0x430b70({'count':_0x3ecced[_0xe5e0('0x5c')],'rows':_0x3ecced});});},'OutboundChannels':function(_0x57c295){return new Promise(function(_0x24cbd1,_0x3e719e){var _0x4c47e7=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0x7e')]);_0x24cbd1({'count':_0x4c47e7[_0xe5e0('0x5c')],'rows':_0x4c47e7});});},'Outbound':function(_0x42523b){return new Promise(function(_0x282fb6,_0x1c1318){_0x282fb6(_0x52407b[_0xe5e0('0x2f')]);});},'Campaigns':function(_0x25991a){return new Promise(function(_0x5b2c5d,_0x491dd3){var _0x5d5bd4=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0x7f')]);_0x5b2c5d({'count':_0x5d5bd4[_0xe5e0('0x5c')],'rows':_0x5d5bd4});});},'VoiceQueuesPreview':function(_0x4fcf7e){var _0x520e3c=this;return new Promise(function(_0x102ea7,_0x1d9a34){_0x239262[_0xe5e0('0x80')](_0x4fcf7e['id'])[_0xe5e0('0x1f')](function(_0x54b7c2){_0x102ea7({'code':0xc8,'message':_0x54b7c2[_0xe5e0('0x1c')]});})[_0xe5e0('0x1b')](function(_0x28da71){_0x1d9a34(_0x520e3c[_0xe5e0('0x1d')](0x1f4,_0x28da71[_0xe5e0('0x1c')]));});});},'EventManager':function(_0x1a558f){var _0x3280ed=this;return new Promise(function(_0x31023a,_0x2bf02c){if(!_0x1a558f[_0xe5e0('0x81')]){return _0x2bf02c(_0x3280ed[_0xe5e0('0x1d')](0x1f4,_0xe5e0('0x82')));}ami[_0xe5e0('0x83')](_0xe5e0('0x84')+_0x1a558f[_0xe5e0('0x81')],_0x1a558f['message']);_0x31023a({'code':0xc8,'message':_0x1a558f});});},'FaxAccounts':function(_0x2f7df8){return new Promise(function(_0x54922c,_0x35fbd6){var _0x568aca=_[_0xe5e0('0x5e')](_0x52407b[_0xe5e0('0x85')]);_0x54922c({'count':_0x568aca[_0xe5e0('0x5c')],'rows':_0x568aca});});},'SendFax':function(_0x36231d){var _0x6989a6=this;return new Promise(function(_0x524ab0,_0x411720){_0x3e564e[_0xe5e0('0x86')](_0x36231d)['then'](function(_0x3a20e4){_0x524ab0({'code':0xc8,'message':_0x3a20e4[_0xe5e0('0x1c')]});})['catch'](function(_0xb6b336){_0x411720(_0x6989a6['error'](0x1f4,_0xb6b336['message']));});});},'CheckAfterSend':function(_0x56f40a){var _0x58ca90=this;return new Promise(function(_0x2794b0,_0x371ef5){_0x3e564e[_0xe5e0('0x87')](_0x56f40a)[_0xe5e0('0x1f')](function(_0x597cdd){_0x2794b0({'code':0xc8,'message':_0x597cdd[_0xe5e0('0x1c')]});})['catch'](function(_0xc922ac){_0x371ef5(_0x58ca90['error'](0x1f4,_0xc922ac[_0xe5e0('0x1c')]));});});}};var _0x5bfaf0=jayson[_0xe5e0('0x88')](_0xa91224)[_0xe5e0('0x89')]();_0x5bfaf0['on'](_0xe5e0('0x1d'),function(_0xc804a2){return _0x1a4c51(_0xc804a2);});_0x5bfaf0['listen'](0x232a,_0xe5e0('0x8a'),function(){console[_0xe5e0('0x8b')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2ff9ac(_0xe5e0('0x8c')+0x232a);});});}; \ No newline at end of file +var _0xffd6=['%s.%s','filename','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','Event\x20name\x20mandatory','emit','event','checkAfterSend','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','moment','../../../config/environment','../properties','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','pick','command','Command','content','error','voiceQueues','hasOwnProperty','strategy','answered','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','catch','voicechannel','resolve','StopMixMonitor','destinationchannel','stop'];(function(_0xf80f6c,_0x5bc3bf){var _0x25e5b5=function(_0x1245e5){while(--_0x1245e5){_0xf80f6c['push'](_0xf80f6c['shift']());}};_0x25e5b5(++_0x5bc3bf);}(_0xffd6,0x97));var _0x6ffd=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xffd6[_0x4bb581];return _0x316bf5;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var jayson=require(_0x6ffd('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x6ffd('0x3'));var config=require(_0x6ffd('0x4'));var properties=require(_0x6ffd('0x5'));var ami=require('../ami');exports[_0x6ffd('0x6')]=function(_0x173979,_0x3b8a46,_0x2949a4){return new BPromise(function(_0x561055,_0x122b71){var _0xeefe34={'QueuePause':function(_0x2445a0){return new Promise(function(_0x1fbbe6,_0x1d8b50){var _0x4a9f85=util[_0x6ffd('0x7')](_0x6ffd('0x8'),'SIP',_0x2445a0[_0x6ffd('0x9')]);if(_0x173979[_0x6ffd('0xa')]&&_0x173979[_0x6ffd('0xa')][_0x4a9f85]&&_0x173979[_0x6ffd('0xa')][_0x4a9f85][_0x6ffd('0xb')]){_0x173979[_0x6ffd('0xa')][_0x4a9f85][_0x6ffd('0xc')]();}if(_0x173979['agents'][_0x4a9f85]){_0x173979[_0x6ffd('0xd')][_0x4a9f85][_0x6ffd('0xe')]({'statePause':_0x2445a0['pause']?!![]:![]});}_0x1fbbe6({'code':0xc8,'message':_0x6ffd('0xf')});});},'Reload':function(_0x2ec8a5){var _0x24e55b=this;return new Promise(function(_0x1a00d9,_0x584df1){if(ami[_0x6ffd('0x10')]()==![]){return _0x584df1(_0x24e55b['error'](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}_0x2ec8a5=_['pick'](_0x2ec8a5,_[_0x6ffd('0x15')](properties[_0x6ffd('0x16')]));_0x2ec8a5[_0x6ffd('0x17')]=_0x6ffd('0x18');return ami[_0x6ffd('0x19')](_0x2ec8a5)[_0x6ffd('0x1a')](function(_0x3f38e7){_0x1a00d9({'code':0xc8,'message':_0x3f38e7[_0x6ffd('0x1b')]});})['catch'](function(_0x11a609){_0x584df1(_0x24e55b['error'](0x1f5,_0x11a609['message']));});});},'Command':function(_0x2f5ec4){var _0x359d09=this;return new Promise(function(_0x50aaa2,_0x34c3c1){if(ami[_0x6ffd('0x10')]()==![]){return _0x34c3c1(_0x359d09['error'](0x1f4,[config['asterisk']['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],'ami\x20disconnected'][_0x6ffd('0x14')]('\x20')));}_0x2f5ec4=_[_0x6ffd('0x1c')](_0x2f5ec4,_0x6ffd('0x1d'));_0x2f5ec4['action']=_0x6ffd('0x1e');return ami[_0x6ffd('0x19')](_0x2f5ec4)['then'](function(_0x356c9c){_0x50aaa2({'code':0xc8,'message':_0x356c9c[_0x6ffd('0x1f')]});})['catch'](function(_0x31fb22){_0x34c3c1(_0x359d09[_0x6ffd('0x20')](0x1f5,_0x31fb22[_0x6ffd('0x1b')]));});});},'VoiceQueues':function(_0x5d353a){return new Promise(function(_0x46631e,_0x3e5726){var _0x46b03f=[];for(var _0x4ae7ac in _0x173979[_0x6ffd('0x21')]){if(_0x173979['voiceQueues'][_0x6ffd('0x22')](_0x4ae7ac)){var _0x43269c=_0x173979['voiceQueues'][_0x4ae7ac];var _0x520258={'id':_0x43269c['id'],'name':_0x43269c[_0x6ffd('0x9')],'strategy':_0x43269c[_0x6ffd('0x23')],'answered':_0x43269c[_0x6ffd('0x24')],'available':_0x43269c['available'],'loggedIn':_0x43269c['loggedIn'],'pTalking':_0x43269c[_0x6ffd('0x25')],'sumBillable':_0x43269c['sumBillable'],'sumDuration':_0x43269c[_0x6ffd('0x26')],'sumHoldTime':_0x43269c[_0x6ffd('0x27')]||0x0,'talking':_0x43269c['talking'],'total':_0x43269c[_0x6ffd('0x28')],'type':_0x43269c[_0x6ffd('0x29')],'unmanaged':_0x43269c[_0x6ffd('0x2a')],'abandoned':_0x43269c[_0x6ffd('0x2b')],'waiting':_0x43269c[_0x6ffd('0x2c')],'loggedInDb':_0x43269c[_0x6ffd('0x2d')]};if(_0x43269c[_0x6ffd('0x29')]===_0x6ffd('0x2e')){_0x520258[_0x6ffd('0x2f')]=_0x43269c[_0x6ffd('0x2f')];_0x520258[_0x6ffd('0x30')]=_0x43269c[_0x6ffd('0x30')];_0x520258[_0x6ffd('0x31')]=_0x43269c['dialOriginateCallerIdName'];_0x520258['dialOriginateCallerIdNumber']=_0x43269c['dialOriginateCallerIdNumber'];_0x520258[_0x6ffd('0x32')]=_0x43269c[_0x6ffd('0x32')];_0x520258[_0x6ffd('0x33')]=_0x43269c[_0x6ffd('0x33')];_0x520258[_0x6ffd('0x34')]=_0x43269c[_0x6ffd('0x34')];_0x520258[_0x6ffd('0x35')]=_0x43269c[_0x6ffd('0x35')];_0x520258[_0x6ffd('0x36')]=_0x43269c[_0x6ffd('0x36')];_0x520258[_0x6ffd('0x37')]=_0x43269c[_0x6ffd('0x37')];_0x520258[_0x6ffd('0x38')]=_0x43269c['outboundBusyCallsDay'];_0x520258[_0x6ffd('0x39')]=_0x43269c[_0x6ffd('0x39')];_0x520258[_0x6ffd('0x3a')]=_0x43269c[_0x6ffd('0x3a')];_0x520258['outboundDropCallsDayCallersExit']=_0x43269c[_0x6ffd('0x3b')];_0x520258['outboundDropCallsDayTimeout']=_0x43269c['outboundDropCallsDayTimeout'];_0x520258[_0x6ffd('0x3c')]=_0x43269c[_0x6ffd('0x3c')];_0x520258[_0x6ffd('0x3d')]=_0x43269c[_0x6ffd('0x3d')];_0x520258['outboundOriginateFailureCallsDay']=_0x43269c[_0x6ffd('0x3e')];_0x520258['outboundReCallsDay']=_0x43269c[_0x6ffd('0x3f')];_0x520258[_0x6ffd('0x40')]=_0x43269c[_0x6ffd('0x40')];_0x520258[_0x6ffd('0x41')]=_0x43269c[_0x6ffd('0x41')];_0x520258['predictiveIntervalAnsweredCalls']=_0x43269c['predictiveIntervalAnsweredCalls'];_0x520258[_0x6ffd('0x42')]=_0x43269c['predictiveIntervalAvgHoldtime'];_0x520258[_0x6ffd('0x43')]=_0x43269c[_0x6ffd('0x43')];_0x520258[_0x6ffd('0x44')]=_0x43269c[_0x6ffd('0x44')];_0x520258[_0x6ffd('0x45')]=_0x43269c[_0x6ffd('0x45')];_0x520258['predictiveIntervalErlangCalls']=_0x43269c[_0x6ffd('0x46')];_0x520258[_0x6ffd('0x47')]=_0x43269c[_0x6ffd('0x47')];_0x520258[_0x6ffd('0x48')]=_0x43269c['predictiveIntervalHitRate'];_0x520258[_0x6ffd('0x49')]=_0x43269c['predictiveIntervalMultiplicativeFactor'];_0x520258[_0x6ffd('0x4a')]=_0x43269c[_0x6ffd('0x4a')];_0x520258[_0x6ffd('0x4b')]=_0x43269c['predictiveIntervalAvailable'];_0x520258[_0x6ffd('0x4c')]=_0x43269c[_0x6ffd('0x4c')];_0x520258[_0x6ffd('0x1b')]=_0x43269c[_0x6ffd('0x1b')];_0x520258[_0x6ffd('0x4d')]=_0x43269c[_0x6ffd('0x4d')];_0x520258[_0x6ffd('0x4e')]=_0x43269c['erlangCalls'];_0x520258['erlangCallToSecond']=_0x43269c['erlangCallToSecond'];_0x520258[_0x6ffd('0x4f')]=_0x43269c[_0x6ffd('0x4f')];_0x520258['erlangBusyFactor']=_0x43269c[_0x6ffd('0x50')];_0x520258[_0x6ffd('0x51')]=_0x43269c[_0x6ffd('0x51')];_0x520258[_0x6ffd('0x52')]=_0x43269c['startProgressive'];}if(_0x43269c[_0x6ffd('0x53')]){_0x520258[_0x6ffd('0x53')]={'id':_0x43269c[_0x6ffd('0x53')]['id'],'name':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x9')],'active':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x54')],'callerid':_0x43269c[_0x6ffd('0x53')][_0x6ffd('0x55')]};}if(_0x43269c[_0x6ffd('0x56')]){_0x520258[_0x6ffd('0x56')]={'id':_0x43269c['Interval']['id'],'name':_0x43269c['Interval']['name']};}_0x46b03f[_0x6ffd('0x57')](_0x520258);}}_0x46631e({'count':_0x46b03f[_0x6ffd('0x58')],'rows':_0x46b03f});});},'UpdateVoiceQueue':function(_0x5dc5d2){return new Promise(function(_0x1440b,_0x44af15){var _0x22c1ba=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x21')],{'id':parseInt(_0x5dc5d2['id'])});var _0x57e547=_[_0x6ffd('0x5a')](_0x5dc5d2,['id']);if(_0x22c1ba){for(var _0x28e9a1 in _0x57e547){if(typeof _0x57e547[_0x28e9a1]!==_0x6ffd('0x5b')&&typeof _0x22c1ba[_0x28e9a1]!=='undefined'){_0x22c1ba[_0x28e9a1]=_0x57e547[_0x28e9a1];}}_0x1440b(_0x22c1ba);}else{_0x44af15();}});},'VoiceChannels':function(_0x2bf7c3){return new Promise(function(_0x15bc35,_0x2f8dfb){var _0xc513d4=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0x5d')]);_0x15bc35({'count':_0xc513d4['length'],'rows':_0xc513d4});});},'VoiceChannelMixMonitor':function(_0x41e064){var _0x883689=this;return new Promise(function(_0x43ecce,_0xbb803b){if(ami[_0x6ffd('0x10')]()==![]){return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],_0x6ffd('0x13')]['join']('\x20')));}var _0x5bd96d=schema(properties['voicechannel'])[_0x6ffd('0x5e')](_0x41e064);if(_0x5bd96d['length']>0x0){return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f4,_[_0x6ffd('0x5f')](_0x5bd96d,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x4c77bb=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x5d')],{'uniqueid':_0x41e064[_0x6ffd('0x60')]});if(_0x4c77bb&&_0x4c77bb['channel']){var _0x1197cc=util[_0x6ffd('0x7')]('%s.%s',_0x41e064['filename']||_0x41e064[_0x6ffd('0x60')],_0x41e064[_0x6ffd('0x7')]||_0x6ffd('0x61'));return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x62'),'channel':_0x4c77bb[_0x6ffd('0x63')],'file':_0x1197cc,'options':_0x6ffd('0x64')})['then'](function(_0x1e5834){var _0x2c7c7f=_[_0x6ffd('0x59')](_0x4c77bb['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x1197cc[_0x6ffd('0x65')]()});if(_[_0x6ffd('0x66')](_0x2c7c7f)){_0x4c77bb[_0x6ffd('0x67')][_0x6ffd('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x1197cc[_0x6ffd('0x65')](),'createdAt':moment()[_0x6ffd('0x7')](_0x6ffd('0x68')),'mixmonitorid':_0x1e5834[_0x6ffd('0x69')],'status':_0x6ffd('0x6a')});}else{_0x2c7c7f[_0x6ffd('0x69')]=_0x1e5834['mixmonitorid'];_0x2c7c7f[_0x6ffd('0x6b')]=_0x6ffd('0x6a');}_0x43ecce({'code':0xc8,'message':[_0x41e064[_0x6ffd('0x60')],_0x6ffd('0x6c'),_0x1e5834[_0x6ffd('0x69')]]['join']('\x20'),'mixmonitorid':_0x1e5834[_0x6ffd('0x69')]});})[_0x6ffd('0x6d')](function(_0x380730){_0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f5,[_0x41e064[_0x6ffd('0x60')],_0x380730['message'][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0xbb803b(_0x883689[_0x6ffd('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3ba9c5){var _0x20992c=this;return new Promise(function(_0x5284d5,_0x42ce2a){if(ami['isConnected']()==![]){return _0x42ce2a(_0x20992c[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config['asterisk'][_0x6ffd('0x12')],'ami\x20disconnected'][_0x6ffd('0x14')]('\x20')));}var _0x186f1e=schema(properties[_0x6ffd('0x6e')])[_0x6ffd('0x5e')](_0x3ba9c5);if(_0x186f1e[_0x6ffd('0x58')]>0x0){return _0x42ce2a(_0x20992c['error'](0x1f4,_[_0x6ffd('0x5f')](_0x186f1e,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x34d94f=_['find'](_0x173979[_0x6ffd('0x5d')],{'uniqueid':_0x3ba9c5[_0x6ffd('0x60')]});if(_0x34d94f){return BPromise[_0x6ffd('0x6f')]()['then'](function(){if(_0x34d94f[_0x6ffd('0x63')]){return ami['Action']({'action':_0x6ffd('0x70'),'channel':_0x34d94f['channel'],'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]})[_0x6ffd('0x6d')](function(_0xb618ef){});}})[_0x6ffd('0x1a')](function(){if(_0x34d94f['destinationchannel']){return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x70'),'channel':_0x34d94f[_0x6ffd('0x71')],'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]})[_0x6ffd('0x6d')](function(_0xe2ddf1){});}})[_0x6ffd('0x1a')](function(_0x255432){var _0x3c9f20=_[_0x6ffd('0x59')](_0x34d94f[_0x6ffd('0x67')],{'mixmonitorid':_0x3ba9c5[_0x6ffd('0x69')]});if(_0x3c9f20){_0x3c9f20[_0x6ffd('0x6b')]=_0x6ffd('0x72');}})[_0x6ffd('0x1a')](function(){var _0x261262=util[_0x6ffd('0x7')](_0x6ffd('0x73'),_0x3ba9c5[_0x6ffd('0x74')]||_0x3ba9c5[_0x6ffd('0x60')],_0x3ba9c5[_0x6ffd('0x7')]||_0x6ffd('0x61'));var _0x2f9e47=_[_0x6ffd('0x59')](_0x34d94f[_0x6ffd('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x261262[_0x6ffd('0x65')]()});if(_0x2f9e47){_0x2f9e47['status']=_0x6ffd('0x72');}})[_0x6ffd('0x1a')](function(){_0x5284d5({'code':0xc8,'message':[_0x3ba9c5[_0x6ffd('0x60')],_0x6ffd('0x75')][_0x6ffd('0x14')]('\x20')});})[_0x6ffd('0x6d')](function(_0x40507f){_0x42ce2a(_0x20992c['error'](0x1f5,[_0x3ba9c5[_0x6ffd('0x60')],_0x40507f[_0x6ffd('0x1b')][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0x42ce2a(_0x20992c[_0x6ffd('0x20')](0x1f5,_0x6ffd('0x76')));}});},'VoiceQueuesChannels':function(_0x222636){return new Promise(function(_0x43b6b1,_0x291b2f){var _0x36f3c3=_['values'](_0x173979[_0x6ffd('0x77')]);_0x43b6b1({'count':_0x36f3c3[_0x6ffd('0x58')],'rows':_0x36f3c3});});},'VoiceQueuesChannel':function(_0x18ac12){var _0x3b546c=this;return new Promise(function(_0x1ed2bc,_0x33b1f6){var _0x4a0bbd=schema(properties['voicequeuechannel'])[_0x6ffd('0x5e')](_0x18ac12);if(_0x4a0bbd[_0x6ffd('0x58')]>0x0){return _0x33b1f6(_0x3b546c['error'](0x1f4,_[_0x6ffd('0x5f')](_0x4a0bbd,'message')[_0x6ffd('0x14')](',\x20')));}var _0x54f72d=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x18ac12['uniqueid']});if(_0x54f72d){_0x1ed2bc(_0x54f72d);}else{return _0x33b1f6(_0x3b546c[_0x6ffd('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x45af9e){var _0x1232ce=this;return new Promise(function(_0x554f1f,_0x90a593){if(ami[_0x6ffd('0x10')]()==![]){return _0x90a593(_0x1232ce[_0x6ffd('0x20')](0x1f4,[config['asterisk']['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}var _0x214023=schema(properties[_0x6ffd('0x78')])[_0x6ffd('0x5e')](_0x45af9e);if(_0x214023[_0x6ffd('0x58')]>0x0){return _0x90a593(_0x1232ce['error'](0x1f4,_[_0x6ffd('0x5f')](_0x214023,_0x6ffd('0x1b'))['join'](',\x20')));}var _0x49fbf0=_['find'](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x45af9e[_0x6ffd('0x60')]});if(_0x49fbf0&&_0x49fbf0[_0x6ffd('0x63')]){return ami[_0x6ffd('0x19')]({'action':_0x6ffd('0x79'),'channel':_0x49fbf0[_0x6ffd('0x63')]})[_0x6ffd('0x1a')](function(_0x1ab7de){_0x554f1f({'code':0xc8,'message':[_0x45af9e['uniqueid'],_0x1ab7de[_0x6ffd('0x1b')][_0x6ffd('0x65')]()]['join']('\x20')});})[_0x6ffd('0x6d')](function(_0x32c1f2){_0x90a593(_0x1232ce[_0x6ffd('0x20')](0x1f5,[_0x45af9e[_0x6ffd('0x60')],_0x32c1f2['message']['toLowerCase']()][_0x6ffd('0x14')]('\x20')));});}else{return _0x90a593(_0x1232ce['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3e89d6){var _0x2f2e5d=this;return new Promise(function(_0x2e8b9f,_0x976c59){if(ami[_0x6ffd('0x10')]()==![]){return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f4,[config[_0x6ffd('0x11')]['ip'],config[_0x6ffd('0x11')][_0x6ffd('0x12')],_0x6ffd('0x13')][_0x6ffd('0x14')]('\x20')));}var _0x298891=schema(properties['voicequeuechannelredirect'])['validate'](_0x3e89d6);if(_0x298891[_0x6ffd('0x58')]>0x0){return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f4,_[_0x6ffd('0x5f')](_0x298891,_0x6ffd('0x1b'))[_0x6ffd('0x14')](',\x20')));}var _0x560ae8=_[_0x6ffd('0x59')](_0x173979[_0x6ffd('0x77')],{'uniqueid':_0x3e89d6[_0x6ffd('0x60')]});if(_0x560ae8&&_0x560ae8[_0x6ffd('0x63')]){return ami['Action']({'action':_0x6ffd('0x7a'),'channel':_0x560ae8[_0x6ffd('0x63')],'exten':_0x3e89d6['exten'],'context':_0x3e89d6[_0x6ffd('0x7b')]||_0x560ae8[_0x6ffd('0x7b')],'priority':0x1})[_0x6ffd('0x1a')](function(_0x2cee1b){_0x2e8b9f({'code':0xc8,'message':[_0x3e89d6[_0x6ffd('0x60')],_0x2cee1b[_0x6ffd('0x1b')]['toLowerCase']()][_0x6ffd('0x14')]('\x20')});})['catch'](function(_0x4ad447){_0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f5,[_0x3e89d6[_0x6ffd('0x60')],_0x4ad447['message'][_0x6ffd('0x65')]()][_0x6ffd('0x14')]('\x20')));});}else{return _0x976c59(_0x2f2e5d[_0x6ffd('0x20')](0x1f5,_0x6ffd('0x76')));}});},'Agents':function(_0x4d01d7){return new Promise(function(_0x39e2fc,_0x1112a0){var _0x34fccf=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0xd')]);_0x39e2fc({'count':_0x34fccf[_0x6ffd('0x58')],'rows':_0x34fccf});});},'Telephones':function(_0x5848fd){return new Promise(function(_0x181745,_0x153f2d){var _0x54546a=_[_0x6ffd('0x5c')](_0x173979[_0x6ffd('0x7c')]);_0x181745({'count':_0x54546a[_0x6ffd('0x58')],'rows':_0x54546a});});},'Trunks':function(_0x275eaa){return new Promise(function(_0x47fdd5,_0x1c1e9b){var _0x1edbf8=_['values'](_0x173979[_0x6ffd('0x7d')]);_0x47fdd5({'count':_0x1edbf8[_0x6ffd('0x58')],'rows':_0x1edbf8});});},'OutboundChannels':function(_0x512f27){return new Promise(function(_0x59dcd4,_0x5e70ef){var _0x2464fd=_['values'](_0x173979[_0x6ffd('0x7e')]);_0x59dcd4({'count':_0x2464fd['length'],'rows':_0x2464fd});});},'Outbound':function(_0x4b8dca){return new Promise(function(_0x1ab496,_0x24df0d){_0x1ab496(_0x173979['outbound']);});},'Campaigns':function(_0x59ad20){return new Promise(function(_0x55f4a4,_0x33750a){var _0x256aa2=_[_0x6ffd('0x5c')](_0x173979['campaigns']);_0x55f4a4({'count':_0x256aa2[_0x6ffd('0x58')],'rows':_0x256aa2});});},'VoiceQueuesPreview':function(_0x31ca67){var _0x3e6be2=this;return new Promise(function(_0x1e98c2,_0x3d5e90){_0x3b8a46['run'](_0x31ca67['id'])[_0x6ffd('0x1a')](function(_0x13cf8e){_0x1e98c2({'code':0xc8,'message':_0x13cf8e['message']});})['catch'](function(_0x123b4d){_0x3d5e90(_0x3e6be2[_0x6ffd('0x20')](0x1f4,_0x123b4d[_0x6ffd('0x1b')]));});});},'EventManager':function(_0x558b5a){var _0x48a82a=this;return new Promise(function(_0x52e939,_0x3e097c){if(!_0x558b5a['event']){return _0x3e097c(_0x48a82a[_0x6ffd('0x20')](0x1f4,_0x6ffd('0x7f')));}ami[_0x6ffd('0x80')]('custom:'+_0x558b5a[_0x6ffd('0x81')],_0x558b5a[_0x6ffd('0x1b')]);_0x52e939({'code':0xc8,'message':_0x558b5a});});},'FaxAccounts':function(_0x3a6c19){return new Promise(function(_0x23a188,_0x2a854b){var _0x971a0a=_[_0x6ffd('0x5c')](_0x173979['faxAccounts']);_0x23a188({'count':_0x971a0a[_0x6ffd('0x58')],'rows':_0x971a0a});});},'SendFax':function(_0x2e480a){var _0x43b2ae=this;return new Promise(function(_0x55fda9,_0x13243c){_0x2949a4['send'](_0x2e480a)[_0x6ffd('0x1a')](function(_0x21c369){_0x55fda9({'code':0xc8,'message':_0x21c369[_0x6ffd('0x1b')]});})[_0x6ffd('0x6d')](function(_0x395401){_0x13243c(_0x43b2ae[_0x6ffd('0x20')](0x1f4,_0x395401['message']));});});},'CheckAfterSend':function(_0x383ecc){var _0x33fe0f=this;return new Promise(function(_0x405c03,_0x39a35c){_0x2949a4[_0x6ffd('0x82')](_0x383ecc)[_0x6ffd('0x1a')](function(_0x4d2072){_0x405c03({'code':0xc8,'message':_0x4d2072[_0x6ffd('0x1b')]});})[_0x6ffd('0x6d')](function(_0x17cb7e){_0x39a35c(_0x33fe0f[_0x6ffd('0x20')](0x1f4,_0x17cb7e[_0x6ffd('0x1b')]));});});}};var _0x80235a=jayson['server'](_0xeefe34)['http']();_0x80235a['on'](_0x6ffd('0x20'),function(_0x2f447f){return _0x122b71(_0x2f447f);});_0x80235a['listen'](0x232a,_0x6ffd('0x83'),function(){console['log'](_0x6ffd('0x84'),0x232a);return _0x561055('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index dee9eb5..1abbfeb 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 _0x4ea3=['toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','name','trigger:%s','action'];(function(_0x13ea49,_0x4cea37){var _0x11cb06=function(_0x2614a1){while(--_0x2614a1){_0x13ea49['push'](_0x13ea49['shift']());}};_0x11cb06(++_0x4cea37);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x34ea('0x0'));var BPromise=require(_0x34ea('0x1'));var Redis=require(_0x34ea('0x2'));var util=require(_0x34ea('0x3'));var config=require('../../../../config/environment');var logger=require(_0x34ea('0x4'))('trigger');var cmContactRpc=require(_0x34ea('0x5'));config['redis']=_['defaults'](config[_0x34ea('0x6')],{'host':_0x34ea('0x7'),'port':0x18eb});var io=require(_0x34ea('0x8'))(new Redis(config[_0x34ea('0x6')]));function emit(_0x40434e,_0x18b461,_0x22b09e,_0x5bec7c,_0x341727){logger[_0x34ea('0x9')](_0x34ea('0xa'),_0x40434e,_0x18b461['id'],_0x22b09e,_0x5bec7c,JSON['stringify'](_0x341727));io['to'](_0x22b09e)[_0x34ea('0xb')](_0x5bec7c,_0x341727);}exports[_0x34ea('0xc')]=function(_0x5126de,_0x4a76b1,_0x5bd8b6,_0x346287){var _0x167667,_0x58bb0d;var _0x11229e={};var _0x29a5c8=Number(_0x5bd8b6[_0x34ea('0xd')]);var _0x233b11=_0x5bd8b6[_0x34ea('0xe')]?Boolean(Number(_0x5bd8b6[_0x34ea('0xe')])):![];var _0x37e1b4;var _0x36af43=![];if(!_[_0x34ea('0xf')](_0x5bd8b6[_0x34ea('0x10')])){if(_0x5bd8b6[_0x34ea('0x10')]=='1')_0x36af43=!![];}if(!_0x36af43){if(_0x346287['xmd-contactid']){_0x11229e['id']=_0x346287[_0x34ea('0x11')];}}if(!_0x11229e['id']){_0x11229e[_0x34ea('0x12')]=_0x29a5c8;_0x37e1b4=_0x5bd8b6[_0x34ea('0x13')]&&_0x5bd8b6[_0x34ea('0x13')]!=='0'?_0x5bd8b6[_0x34ea('0x13')]['split'](','):[_0x34ea('0x14')];_0x11229e[_0x34ea('0x15')]=_[_0x34ea('0x16')](_0x37e1b4,function(_0x305576){var _0x5f420f={};_0x5f420f[_0x305576]=_0x346287[_0x34ea('0x17')]?_0x346287[_0x34ea('0x18')]:_0x346287[_0x34ea('0x19')];return _0x5f420f;});}var _0x5340a4=['id',_0x34ea('0x1a'),_0x34ea('0x1b'),_0x34ea('0x14'),_0x34ea('0x1c'),'fax',_0x34ea('0x12'),_0x34ea('0x1d'),_0x34ea('0x1e'),_0x34ea('0x1f')];var _0x4fc1a2=_['union'](_0x5340a4,_0x37e1b4);BPromise[_0x34ea('0x20')]()[_0x34ea('0x21')](cmContactRpc[_0x34ea('0x22')]({'attributes':_0x4fc1a2,'where':_0x11229e}))['then'](function(_0x5197a2){_0x58bb0d=_0x5197a2;if(!_[_0x34ea('0x23')](_0x58bb0d)){if(_0x58bb0d[_0x34ea('0x24')]===0x1){_0x167667=_0x58bb0d[0x0];logger[_0x34ea('0x9')](_0x34ea('0x25'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_0x167667['id']);}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_[_0x34ea('0x16')](_0x58bb0d,'id')[_0x34ea('0x27')](','));}return;}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x346287['uniqueid'],_0x4a76b1['id']);var _0x564d1b={'ListId':_0x29a5c8};var _0x142709=_0x5bd8b6[_0x34ea('0x28')]&&_0x5bd8b6[_0x34ea('0x28')]!=='0'?_0x5bd8b6[_0x34ea('0x28')]:'phone';if(_0x233b11){logger[_0x34ea('0x9')](_0x34ea('0x29'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_['isNil'](_0x346287['routeId'])?_0x346287['calleridnum']:_0x346287['destcalleridnum'];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b[_0x34ea('0x1a')]=_0x346287[_0x34ea('0x2a')]&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287['calleridname']:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287[_0x34ea('0x2d')]&&_0x346287[_0x34ea('0x2d')]!==_0x34ea('0x2b')?_0x346287['destcalleridname']:_0x34ea('0x2c');}return BPromise[_0x34ea('0x20')]()['then'](cmContactRpc[_0x34ea('0x2e')](_0x564d1b))['then'](function(_0x1392b6){_0x167667=_0x1392b6;_0x58bb0d[_0x34ea('0x2f')](_0x1392b6);if(_0x167667){logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x346287['uniqueid'],_0x4a76b1['id'],_0x167667['id']);}return;});}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_[_0x34ea('0xf')](_0x346287['routeId'])?_0x346287[_0x34ea('0x19')]:_0x346287[_0x34ea('0x18')];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b['firstName']=_0x346287['calleridname']&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2a')]:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287['destcalleridname']&&_0x346287['destcalleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2d')]:'Unknown';}_0x167667=_0x564d1b;_0x58bb0d[_0x34ea('0x2f')](_0x564d1b);return;}}})[_0x34ea('0x21')](function(){if(_0x5126de){emit(_0x346287[_0x34ea('0x26')],_0x4a76b1,util[_0x34ea('0x30')](_0x34ea('0x31'),_0x5126de[_0x34ea('0x32')]),util['format'](_0x34ea('0x33'),_0x5bd8b6[_0x34ea('0x34')][_0x34ea('0x35')]()),{'evt':_[_0x34ea('0x36')](_0x346287,{'autoCreate':_0x233b11}),'contact':_0x167667===undefined?{}:_0x167667,'contacts':_0x58bb0d['length']===0x0?undefined:_0x58bb0d});}});}; \ No newline at end of file +var _0xac31=['mobile','fax','ListId','createdAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','info','[CM][%s][%s]\x20Contact\x20not\x20found','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName'];(function(_0x3a70f0,_0xfcc97){var _0x1d69b9=function(_0x390971){while(--_0x390971){_0x3a70f0['push'](_0x3a70f0['shift']());}};_0x1d69b9(++_0xfcc97);}(_0xac31,0xca));var _0x1ac3=function(_0x58c585,_0x52d5d8){_0x58c585=_0x58c585-0x0;var _0x540bd3=_0xac31[_0x58c585];return _0x540bd3;};'use strict';var _=require(_0x1ac3('0x0'));var BPromise=require(_0x1ac3('0x1'));var Redis=require(_0x1ac3('0x2'));var util=require(_0x1ac3('0x3'));var config=require(_0x1ac3('0x4'));var logger=require(_0x1ac3('0x5'))(_0x1ac3('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1ac3('0x7')]=_[_0x1ac3('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1ac3('0x9'))(new Redis(config[_0x1ac3('0x7')]));function emit(_0x2bf9b1,_0x1be223,_0x157604,_0x57893c,_0x2d17de){logger['info'](_0x1ac3('0xa'),_0x2bf9b1,_0x1be223['id'],_0x157604,_0x57893c,JSON[_0x1ac3('0xb')](_0x2d17de));io['to'](_0x157604)[_0x1ac3('0xc')](_0x57893c,_0x2d17de);}exports['exec']=function(_0xa26c88,_0x1e2642,_0x3e835b,_0x24f0d2){var _0x2a8dc7,_0x422d19;var _0x4b5c92={};var _0x3b38fc=Number(_0x3e835b[_0x1ac3('0xd')]);var _0x2eeabf=_0x3e835b[_0x1ac3('0xe')]?Boolean(Number(_0x3e835b['data2'])):![];var _0x88ed7c;var _0x37d426=![];if(!_[_0x1ac3('0xf')](_0x3e835b[_0x1ac3('0x10')])){if(_0x3e835b['data5']=='1')_0x37d426=!![];}if(!_0x37d426){if(_0x24f0d2[_0x1ac3('0x11')]){_0x4b5c92['id']=_0x24f0d2[_0x1ac3('0x11')];}}if(!_0x4b5c92['id']){_0x4b5c92['ListId']=_0x3b38fc;_0x88ed7c=_0x3e835b[_0x1ac3('0x12')]&&_0x3e835b[_0x1ac3('0x12')]!=='0'?_0x3e835b[_0x1ac3('0x12')]['split'](','):[_0x1ac3('0x13')];_0x4b5c92[_0x1ac3('0x14')]=_[_0x1ac3('0x15')](_0x88ed7c,function(_0x541744){var _0x195683={};_0x195683[_0x541744]=_0x24f0d2['routeId']?_0x24f0d2[_0x1ac3('0x16')]:_0x24f0d2[_0x1ac3('0x17')];return _0x195683;});}var _0x20091d=['id',_0x1ac3('0x18'),_0x1ac3('0x19'),'phone',_0x1ac3('0x1a'),_0x1ac3('0x1b'),_0x1ac3('0x1c'),_0x1ac3('0x1d'),'scheduledAt','updatedAt'];var _0x2879d8=_[_0x1ac3('0x1e')](_0x20091d,_0x88ed7c);BPromise[_0x1ac3('0x1f')]()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x21')]({'attributes':_0x2879d8,'where':_0x4b5c92}))[_0x1ac3('0x20')](function(_0x23b767){_0x422d19=_0x23b767;if(!_[_0x1ac3('0x22')](_0x422d19)){if(_0x422d19[_0x1ac3('0x23')]===0x1){_0x2a8dc7=_0x422d19[0x0];logger['info'](_0x1ac3('0x24'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}else{logger['info'](_0x1ac3('0x26'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_['map'](_0x422d19,'id')[_0x1ac3('0x27')](','));}return;}else{logger[_0x1ac3('0x28')](_0x1ac3('0x29'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);var _0x10db3d={'ListId':_0x3b38fc};var _0x565a0f=_0x3e835b['data4']&&_0x3e835b['data4']!=='0'?_0x3e835b['data4']:'phone';if(_0x2eeabf){logger[_0x1ac3('0x28')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2['destcalleridnum'];if(_[_0x1ac3('0xf')](_0x24f0d2['routeId'])){_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2['destcalleridname']&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2e')]:_0x1ac3('0x2d');}return BPromise['resolve']()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x2f')](_0x10db3d))[_0x1ac3('0x20')](function(_0x294513){_0x2a8dc7=_0x294513;_0x422d19[_0x1ac3('0x30')](_0x294513);if(_0x2a8dc7){logger['info'](_0x1ac3('0x31'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}return;});}else{logger[_0x1ac3('0x28')](_0x1ac3('0x32'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2['routeId'])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2[_0x1ac3('0x16')];if(_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])){_0x10db3d['firstName']=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2e')]&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2['destcalleridname']:_0x1ac3('0x2d');}_0x2a8dc7=_0x10db3d;_0x422d19[_0x1ac3('0x30')](_0x10db3d);return;}}})['then'](function(){if(_0xa26c88){emit(_0x24f0d2[_0x1ac3('0x25')],_0x1e2642,util[_0x1ac3('0x33')](_0x1ac3('0x34'),_0xa26c88[_0x1ac3('0x35')]),util[_0x1ac3('0x33')](_0x1ac3('0x36'),_0x3e835b[_0x1ac3('0x37')][_0x1ac3('0x38')]()),{'evt':_['merge'](_0x24f0d2,{'autoCreate':_0x2eeabf}),'contact':_0x2a8dc7===undefined?{}:_0x2a8dc7,'contacts':_0x422d19[_0x1ac3('0x23')]===0x0?undefined:_0x422d19});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index bebf1eb..1c9d0b9 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 _0x16d2=['contactmanager','motionbar','browser','data1','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','data3','format','user:%s','action','toLowerCase','name','trigger:%s','exec','integration','accounts','queue','routeId','urlforward','script','parse','checkTrigger','motionChannel','AllConditions','every','checkConditions','channel','AnyConditions','some','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','voice','checkTriggers','interface','status','merge','variables','length'];(function(_0x3d2799,_0x58c640){var _0x305e71=function(_0x5095bf){while(--_0x5095bf){_0x3d2799['push'](_0x3d2799['shift']());}};_0x305e71(++_0x58c640);}(_0x16d2,0x123));var _0x216d=function(_0xee405c,_0x135503){_0xee405c=_0xee405c-0x0;var _0x12a589=_0x16d2[_0xee405c];return _0x12a589;};'use strict';var util=require(_0x216d('0x0'));var _=require(_0x216d('0x1'));var url=require(_0x216d('0x2'));var Mustache=require(_0x216d('0x3'));var Redis=require(_0x216d('0x4'));var urlforward=require(_0x216d('0x5'));var integration=require(_0x216d('0x6'));var cmContact=require(_0x216d('0x7'));var script=require(_0x216d('0x8'));var config=require('../../../config/environment');var logger=require(_0x216d('0x9'))(_0x216d('0xa'));var ami=require(_0x216d('0xb'));config[_0x216d('0xc')]=_[_0x216d('0xd')](config[_0x216d('0xc')],{'host':_0x216d('0xe'),'port':0x18eb});var io=require(_0x216d('0xf'))(new Redis(config['redis']));var operators={'equals':function(_0x22c7b3,_0x1aeb55){return _0x22c7b3==_0x1aeb55;},'not_equals':function(_0x35abcf,_0x227c46){return _0x35abcf!=_0x227c46;}};var barAndWebActions=[_0x216d('0x10'),_0x216d('0x2'),'winapp'];function Trigger(_0x7ca9c9){this['triggers']=_0x7ca9c9[_0x216d('0x11')];this[_0x216d('0x12')]=_0x7ca9c9[_0x216d('0x12')];this[_0x216d('0x13')]=_0x7ca9c9[_0x216d('0x13')];this[_0x216d('0x14')]=_0x7ca9c9['templates'];this[_0x216d('0x15')]=_0x7ca9c9['voiceExtensions'];this[_0x216d('0x16')]=_0x7ca9c9[_0x216d('0x16')];this['freshdeskAccounts']=_0x7ca9c9[_0x216d('0x17')];this[_0x216d('0x18')]=_0x7ca9c9['salesforceAccounts'];this[_0x216d('0x19')]=_0x7ca9c9['sugarcrmAccounts'];this[_0x216d('0x1a')]=_0x7ca9c9[_0x216d('0x1a')];this[_0x216d('0x1b')]=_0x7ca9c9[_0x216d('0x1b')];this[_0x216d('0x1c')]=_0x7ca9c9[_0x216d('0x1c')];this[_0x216d('0x1d')]=_0x7ca9c9[_0x216d('0x1d')];this[_0x216d('0x1e')]=_0x7ca9c9['dynamics365Accounts'];this[_0x216d('0x1f')]=_0x7ca9c9['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x216d('0x16')],'salesforce':this[_0x216d('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x216d('0x19')],'zoho':this[_0x216d('0x1a')],'desk':this['deskAccounts'],'vtiger':this[_0x216d('0x1c')],'dynamics365':this[_0x216d('0x1e')],'freshsales':this[_0x216d('0x1f')],'servicenow':this[_0x216d('0x1d')]};ami['on']('custom:agentcalled',this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x22'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on']('custom:agentringnoanswer',this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x23'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on']('custom:agentnosuchnumber',this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this['syncCustomEvent']['bind'](this));ami['on'](_0x216d('0x25'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x26'),this[_0x216d('0x20')]['bind'](this));ami['on']('custom:amd',this[_0x216d('0x20')]['bind'](this));ami['on'](_0x216d('0x27'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x28'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x29'),this[_0x216d('0x2a')][_0x216d('0x21')](this));ami['on'](_0x216d('0x2b'),this[_0x216d('0x2a')][_0x216d('0x21')](this));ami['on'](_0x216d('0x2c'),this['syncAgentDial'][_0x216d('0x21')](this));ami['on'](_0x216d('0x2d'),this[_0x216d('0x20')]['bind'](this));ami['on'](_0x216d('0x2e'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x2f'),this['syncCustomEvent'][_0x216d('0x21')](this));ami['on'](_0x216d('0x30'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x31'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x32'),this[_0x216d('0x20')][_0x216d('0x21')](this));ami['on'](_0x216d('0x33'),this['syncCustomEvent'][_0x216d('0x21')](this));}Trigger[_0x216d('0x34')][_0x216d('0x35')]=function(_0x5a0ef7,_0x5b70e0,_0x2e86f9){logger['info'](_0x5a0ef7,_0x5b70e0,JSON[_0x216d('0x36')](_0x2e86f9));io['to'](_0x5a0ef7)['emit'](_0x5b70e0,_0x2e86f9);};Trigger['prototype'][_0x216d('0x20')]=function(_0xbf4639){var _0x1e5ad0=_[_0x216d('0x37')](_0xbf4639);if(typeof _0x1e5ad0['motionChannel']==='undefined'){_0x1e5ad0['motionChannel']=_0x216d('0x38');}this[_0x216d('0x39')](_0x1e5ad0);};Trigger['prototype'][_0x216d('0x2a')]=function(_0x2e334b){if(this['agents'][_0x2e334b[_0x216d('0x3a')]]){this[_0x216d('0x20')](_0x2e334b);}};Trigger[_0x216d('0x34')][_0x216d('0x39')]=function(_0x56ce8a){var _0x2e857e;for(var _0x35cb6e in this[_0x216d('0x11')]){if(this['triggers']['hasOwnProperty'](_0x35cb6e)){if(this[_0x216d('0x11')][_0x35cb6e][_0x216d('0x3b')]){_0x2e857e=this['checkTrigger'](this[_0x216d('0x11')][_0x35cb6e],_0x56ce8a);if(_0x2e857e){_[_0x216d('0x3c')](_0x56ce8a,_0x56ce8a[_0x216d('0x3d')]);for(var _0x47f796=0x0,_0x2c3e44,_0x3519ab,_0x13d787;_0x47f7960x0){_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 _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x5fc3[_0x2dc96f];return _0xd012da;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index eab51b4..1c34d69 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 _0x9923=['Subjects','Descriptions','/systemusers(','ticketType','phonecall','phonecalls','/contacts(','callDirection','queue','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','remoteUri','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','bluebird','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','POST','clientId','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','customField','idField','indexOf','incidents','assign','getString'];(function(_0x4c189e,_0x2b703e){var _0x3dfbaf=function(_0x54f6d7){while(--_0x54f6d7){_0x4c189e['push'](_0x4c189e['shift']());}};_0x3dfbaf(++_0x2b703e);}(_0x9923,0xf1));var _0x3992=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x9923[_0x3430aa];return _0x2ac5c;};'use strict';var _=require('lodash');var BPromise=require(_0x3992('0x0'));var rp=require('request-promise');var util=require(_0x3992('0x1'));var intUtil=require(_0x3992('0x2'));var md5=require('md5');var Redis=require(_0x3992('0x3'));var logger=require(_0x3992('0x4'))(_0x3992('0x5'));var config=require(_0x3992('0x6'));config[_0x3992('0x7')]=_['defaults'](config['redis'],{'host':_0x3992('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x2a6a5a,_0x2050ee,_0x3f98f4){var _0x4ee1a0={'method':_0x3992('0x9'),'uri':_0x2050ee,'form':{'client_id':_0x2a6a5a[_0x3992('0xa')],'resource':_0x2a6a5a['remoteUri'],'username':_0x2a6a5a['username'],'password':_0x2a6a5a[_0x3992('0xb')],'grant_type':_0x3992('0xb'),'client_secret':_0x2a6a5a[_0x3992('0xc')]},'json':!![]};return rp(_0x4ee1a0)[_0x3992('0xd')](function(_0x26b6b2){return _0x26b6b2[_0x3992('0xe')];})[_0x3992('0xf')](function(_0x5424cd){logger['error']('['+[_0x3f98f4['toUpperCase']()]+_0x3992('0x10'));return _0x5424cd[_0x3992('0x11')];});}function getUser(_0x4a2369,_0x504a1a,_0x1f7279,_0x1600b1,_0x5a10d5,_0x171c9d){return new BPromise(function(_0xb32cf6,_0x59aa0f){return getAuthToken(_0x504a1a,_0x1600b1,_0x171c9d)[_0x3992('0xd')](function(_0x11f330){var _0x4dd642={'method':'GET','uri':_0x5a10d5+_0x3992('0x12'),'headers':{'Authorization':_0x3992('0x13')+_0x11f330,'OData-Version':'4.0'},'json':!![]};return rp(_0x4dd642);})['then'](function(_0x41193c){var _0x5f5787=_0x41193c[_0x3992('0x14')];var _0x4a935c=![];var _0x1530ff=null;if(!_[_0x3992('0x15')](_0x1f7279)){if(intUtil[_0x3992('0x16')](_0x1f7279[_0x3992('0x17')])){_0x4a2369[_0x3992('0x18')]=_0x1f7279['email'];for(_0x1530ff=0x0;_0x1530ff<_0x5f5787[_0x3992('0x19')];_0x1530ff++){if(_0x5f5787[_0x1530ff][_0x3992('0x1a')]===_0x1f7279['email']&&!_0x5f5787[_0x1530ff][_0x3992('0x1b')]){_0x4a935c=!![];logger[_0x3992('0x1c')]('['+[_0x171c9d[_0x3992('0x1d')]()]+_0x3992('0x1e')+_0x5f5787[_0x1530ff][_0x3992('0x1f')]+'!');_0x4a2369[_0x3992('0x20')]=_0x5f5787[_0x1530ff][_0x3992('0x1f')];}}}}if(!_0x4a935c){logger[_0x3992('0x1c')]('['+[_0x171c9d[_0x3992('0x1d')]()]+_0x3992('0x21'));_0x4a2369[_0x3992('0x18')]=_0x504a1a[_0x3992('0x22')];for(_0x1530ff=0x0;_0x1530ff<_0x5f5787[_0x3992('0x19')];_0x1530ff++){if(_0x5f5787[_0x1530ff]['internalemailaddress']===_0x504a1a[_0x3992('0x22')]){_0x4a2369[_0x3992('0x20')]=_0x5f5787[_0x1530ff][_0x3992('0x1f')];}}}_0xb32cf6(_0x4a2369);})[_0x3992('0xf')](function(_0x1c8d98){_0x59aa0f(_0x1c8d98[_0x3992('0x11')]);});});}function createEndUser(_0x3a2fd6,_0x4bd82f,_0x2126a9,_0x250582,_0x32f078,_0x555f9d){return new BPromise(function(_0x1c71ac,_0x55a3a4){return getAuthToken(_0x4bd82f,_0x2126a9,_0x555f9d)['then'](function(_0x7430ca){var _0xd578e0=_0x555f9d[_0x3992('0x23')]()===_0x3992('0x24')?_0x32f078['destcalleridnum']:_0x32f078['calleridnum'];var _0x5735e6={'method':'POST','uri':_0x250582+'contacts','body':{'telephone1':_0xd578e0,'fullname':_0xd578e0,'firstname':_0xd578e0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3a2fd6['userId']+')'},'headers':{'Authorization':_0x3992('0x13')+_0x7430ca,'OData-Version':_0x3992('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5735e6);})['then'](function(_0x360da6){var _0x26f45f=_0x360da6[_0x3992('0x26')][_0x3992('0x27')];var _0x255909=_0x26f45f[_0x3992('0x28')](_0x26f45f[_0x3992('0x29')]('(')+0x1,_0x26f45f[_0x3992('0x29')](')'));_0x3a2fd6[_0x3992('0x2a')]=_0x255909;_0x1c71ac(_0x3a2fd6);})['catch'](function(_0xf92b7b){_0x55a3a4(_0xf92b7b[_0x3992('0x11')]);});});}function getEndUser(_0x5ca771,_0x595d1a,_0x512ff9,_0x58a12d,_0x38d079,_0x437fb4){return new BPromise(function(_0x536899,_0x4fde7c){var _0x571236=_0x437fb4[_0x3992('0x23')]()===_0x3992('0x24')?_0x38d079[_0x3992('0x2b')]:_0x38d079[_0x3992('0x2c')];return getAuthToken(_0x595d1a,_0x512ff9,_0x437fb4)['then'](function(_0xf0443){var _0x23aa7e={'method':_0x3992('0x2d'),'uri':_0x58a12d+_0x3992('0x2e')+_0x571236[_0x3992('0x2f')]('+',_0x3992('0x30'))+'\x27','headers':{'Authorization':_0x3992('0x13')+_0xf0443,'If-None-Match':null,'OData-Version':_0x3992('0x25')},'json':!![]};return rp(_0x23aa7e);})[_0x3992('0xd')](function(_0x1b5830){var _0x56cc9c=null;if(_0x1b5830){var _0x2afe11=_0x1b5830['value'];var _0x258f75=![];for(_0x56cc9c=0x0;_0x56cc9c<_0x2afe11[_0x3992('0x19')];_0x56cc9c++){if(_0x2afe11[_0x56cc9c][_0x3992('0x31')]===_0x571236){_0x258f75=!![];_0x5ca771[_0x3992('0x2a')]=_0x2afe11[_0x56cc9c]['contactid'];}}if(_0x258f75){_0x536899(_0x5ca771);}else{return createEndUser(_0x5ca771,_0x595d1a,_0x512ff9,_0x58a12d,_0x38d079,_0x437fb4)[_0x3992('0xd')](function(_0x15b146){logger[_0x3992('0x1c')]('['+[_0x437fb4[_0x3992('0x1d')]()]+']\x20Enduser\x20created!',_0x15b146[_0x3992('0x2a')]);_0x536899(_0x15b146);});}}else{return createEndUser(_0x5ca771,_0x595d1a,_0x512ff9,_0x58a12d,_0x38d079,_0x437fb4)[_0x3992('0xd')](function(_0x2cbf37){logger[_0x3992('0x1c')]('['+[_0x437fb4['toUpperCase']()]+_0x3992('0x32'),_0x2cbf37[_0x3992('0x2a')]);_0x536899(_0x2cbf37);});}});});}function getCustomFields(_0x116b5b,_0x4ee8b3,_0x4a79e8){var _0x496578={};if(_0x116b5b[_0x3992('0x19')]>0x0){_[_0x3992('0x33')](_0x116b5b,function(_0x27906c){if(_[_0x3992('0x34')]([_0x3992('0x35'),_0x3992('0x36')],_0x27906c[_0x3992('0x37')])&&_0x27906c['nameField']&&!_0x27906c[_0x3992('0x38')]){var _0x5474c8=_0x27906c[_0x3992('0x39')]['toLowerCase']();var _0x297ce2=_0x5474c8[_0x3992('0x28')](0x0,_0x5474c8[_0x3992('0x3a')]('_'));var _0x48d8fc=_0x5474c8['substring'](_0x5474c8[_0x3992('0x3a')]('_')+0x1);if(_0x297ce2===_0x4a79e8){_0x496578[_0x48d8fc]=_0x27906c['content'];}}});}return _0x496578;}function getTicket(_0x2b7fed,_0x4e3552,_0x1b5f44,_0x1ec454,_0x437893,_0xd22037,_0x54796a){return new BPromise(function(_0x2edf7e,_0x23baa8){var _0x487288;return getAuthToken(_0x4e3552,_0x1b5f44,_0x54796a)[_0x3992('0xd')](function(_0x3e336d){if(_0xd22037['ticketType']==='incident'){_0x487288={'method':_0x3992('0x9'),'uri':_0x1ec454+_0x3992('0x3b'),'body':Object[_0x3992('0x3c')]({},{'title':intUtil[_0x3992('0x3d')](_0xd22037[_0x3992('0x3e')],_0x437893,'\x20'),'description':intUtil[_0x3992('0x3d')](_0xd22037[_0x3992('0x3f')],_0x437893,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x2b7fed['enduserId']+')','ownerid@odata.bind':_0x3992('0x40')+_0x2b7fed[_0x3992('0x20')]+')','caseorigincode':'1'},getCustomFields(_0xd22037['Fields'],_0x437893,_0xd22037[_0x3992('0x41')])),'headers':{'Authorization':_0x3992('0x13')+_0x3e336d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xd22037[_0x3992('0x41')]===_0x3992('0x42')){_0x487288={'method':'POST','uri':_0x1ec454+_0x3992('0x43'),'body':Object[_0x3992('0x3c')]({},{'subject':intUtil['getString'](_0xd22037[_0x3992('0x3e')],_0x437893,'\x20'),'phonenumber':String(_0x437893[_0x3992('0x2c')]),'description':intUtil['getString'](_0xd22037[_0x3992('0x3f')],_0x437893,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3992('0x44')+_0x2b7fed['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x2b7fed[_0x3992('0x20')]+')','directioncode':_0x2b7fed[_0x3992('0x45')]===_0x3992('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x3992('0x40')+_0x2b7fed['userId']+')','participationtypemask':_0x2b7fed['callDirection']===_0x3992('0x46')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2b7fed[_0x3992('0x2a')]+')','participationtypemask':_0x2b7fed[_0x3992('0x45')]===_0x3992('0x46')?0x1:0x2}]},getCustomFields(_0xd22037[_0x3992('0x47')],_0x437893,_0xd22037[_0x3992('0x41')])),'headers':{'Authorization':_0x3992('0x13')+_0x3e336d,'OData-Version':_0x3992('0x25')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x487288);})[_0x3992('0xd')](function(_0x215f1b){var _0x27617f=_0x215f1b['headers'][_0x3992('0x27')];var _0x4e7993=_0x27617f[_0x3992('0x28')](_0x27617f[_0x3992('0x29')]('(')+0x1,_0x27617f['lastIndexOf'](')'));_0x2b7fed[_0x3992('0x48')]=_0x4e7993;_0x2edf7e(_0x2b7fed);})['catch'](function(_0x115d91){_0x23baa8(_0x115d91['message']);});});}function emit(_0x78161,_0x5b2db6,_0x1a2262,_0x5c99f1){var _0x283a38={'uri':util['format'](_0x3992('0x49'),_0x78161,_0x1a2262,_0x5c99f1)};io['to'](util['format'](_0x3992('0x4a'),_0x5b2db6))['emit'](_0x3992('0x4b'),_0x283a38);}exports['cs']=function(_0x273e38,_0x148536,_0x3b2ac1,_0x15cc65,_0x218a25,_0x15e057,_0xb15696,_0x41f23){var _0x58d533={};_0x15e057['remoteUri']=intUtil[_0x3992('0x4c')](_0x15e057['remoteUri']);_0x15e057[_0x3992('0x4d')]=intUtil['stripTrailingSlash'](_0x15e057[_0x3992('0x4d')]);_0x58d533['callDirection']=_0x41f23===_0x3992('0x46')||_0x41f23===_0x3992('0x4e')?_0x3992('0x46'):_0x3992('0x24');var _0x1d9ee1=util[_0x3992('0x4f')]('%s/api/data/v9.0/',_0x15e057[_0x3992('0x50')]);var _0x31da45=util['format'](_0x3992('0x51'),_0x15e057[_0x3992('0x52')]);var _0x2311d4=util[_0x3992('0x4f')](_0x3992('0x53'),_0x15e057[_0x3992('0x4d')],_0x148536[_0x3992('0x54')],md5(_0x148536['uniqueid']));if(_0x218a25&&_0x218a25[_0x3992('0x55')]){logger[_0x3992('0x1c')](_0x3992('0x56'),_0x3992('0x57'));_0x148536['recordingURL']=_0x2311d4;}else if(_0xb15696&&_0xb15696[_0x3992('0x58')]&&_0xb15696[_0x3992('0x58')]!==_0x3992('0x59')){logger[_0x3992('0x1c')](_0x3992('0x5a'),_0x3992('0x57'));_0x148536[_0x3992('0x5b')]=_0x2311d4;}else{_0x148536[_0x3992('0x5b')]='';}return getUser(_0x58d533,_0x15e057,_0x15cc65,_0x31da45,_0x1d9ee1,_0x41f23)[_0x3992('0xd')](function(_0x205201){logger[_0x3992('0x1c')]('['+_0x41f23['toUpperCase']()+_0x3992('0x5c'),_0x205201['userId']);logger['info']('['+_0x41f23['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x205201[_0x3992('0x18')]);return getEndUser(_0x205201,_0x15e057,_0x31da45,_0x1d9ee1,_0x148536,_0x41f23);})['then'](function(_0x527cf4){logger['info']('['+_0x41f23[_0x3992('0x1d')]()+_0x3992('0x5d'),_0x527cf4[_0x3992('0x2a')]);logger['info']('['+_0x41f23['toUpperCase']()+_0x3992('0x5e'),_0x148536[_0x3992('0x2c')]);return getTicket(_0x527cf4,_0x15e057,_0x31da45,_0x1d9ee1,_0x148536,_0x3b2ac1,_0x41f23);})[_0x3992('0xd')](function(_0xe08e08){logger[_0x3992('0x1c')](util[_0x3992('0x4f')]('['+_0x41f23[_0x3992('0x1d')]()+_0x3992('0x5f'),_0x3b2ac1['ticketType'],_0xe08e08[_0x3992('0x48')]));logger[_0x3992('0x1c')](util[_0x3992('0x4f')]('['+_0x41f23[_0x3992('0x1d')]()+_0x3992('0x60'),_0x41f23));if(_0x41f23!==_0x3992('0x4e')){logger['info']('['+_0x41f23[_0x3992('0x1d')]()+']',_0x3992('0x61'));emit(_0x15e057[_0x3992('0x50')],_0x15cc65[_0x3992('0x62')],_0x3b2ac1['ticketType'],_0xe08e08[_0x3992('0x48')]);}})[_0x3992('0xf')](function(_0x51b7ba){logger[_0x3992('0x63')]('['+_0x41f23[_0x3992('0x1d')]()+_0x3992('0x64'),util['inspect'](_0x51b7ba,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa55c=['outbound','destcalleridnum','contacts','/systemusers(','userId','headers','odata-entityid','enduserId','toLowerCase','calleridnum','replace','value','contactid',']\x20Enduser\x20Created!','forEach','includes','string','picklist','nameField','idField','substring','indexOf','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','lastIndexOf','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','message'];(function(_0x5323ad,_0x1df035){var _0x5254e7=function(_0x4e6213){while(--_0x4e6213){_0x5323ad['push'](_0x5323ad['shift']());}};_0x5254e7(++_0x1df035);}(_0xa55c,0x1cb));var _0xca55=function(_0x3d971b,_0x16fe5d){_0x3d971b=_0x3d971b-0x0;var _0x152a35=_0xa55c[_0x3d971b];return _0x152a35;};'use strict';var _=require(_0xca55('0x0'));var BPromise=require(_0xca55('0x1'));var rp=require('request-promise');var util=require(_0xca55('0x2'));var intUtil=require(_0xca55('0x3'));var md5=require(_0xca55('0x4'));var Redis=require(_0xca55('0x5'));var logger=require(_0xca55('0x6'))(_0xca55('0x7'));var config=require(_0xca55('0x8'));config['redis']=_[_0xca55('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xca55('0xa'))(new Redis(config[_0xca55('0xb')]));function getAuthToken(_0x26ed25,_0x416e3c,_0xf14ec6){var _0x92abc0={'method':_0xca55('0xc'),'uri':_0x416e3c,'form':{'client_id':_0x26ed25[_0xca55('0xd')],'resource':_0x26ed25[_0xca55('0xe')],'username':_0x26ed25[_0xca55('0xf')],'password':_0x26ed25[_0xca55('0x10')],'grant_type':_0xca55('0x10'),'client_secret':_0x26ed25[_0xca55('0x11')]},'json':!![]};return rp(_0x92abc0)[_0xca55('0x12')](function(_0x279313){return _0x279313['access_token'];})[_0xca55('0x13')](function(_0x4116c3){logger[_0xca55('0x14')]('['+[_0xf14ec6[_0xca55('0x15')]()]+_0xca55('0x16'));return _0x4116c3['message'];});}function getUser(_0x4b5d33,_0x73109e,_0x11e2f0,_0x1de062,_0x5bfffa,_0x270619){return new BPromise(function(_0x329fd2,_0x517a9d){return getAuthToken(_0x73109e,_0x1de062,_0x270619)[_0xca55('0x12')](function(_0x4469e2){var _0x121c35={'method':_0xca55('0x17'),'uri':_0x5bfffa+_0xca55('0x18'),'headers':{'Authorization':_0xca55('0x19')+_0x4469e2,'OData-Version':_0xca55('0x1a')},'json':!![]};return rp(_0x121c35);})[_0xca55('0x12')](function(_0x3e44a9){var _0x5c2de7=_0x3e44a9['value'];var _0xa392d1=![];var _0x2e80a7=null;if(!_[_0xca55('0x1b')](_0x11e2f0)){if(intUtil[_0xca55('0x1c')](_0x11e2f0[_0xca55('0x1d')])){_0x4b5d33['userEmail']=_0x11e2f0[_0xca55('0x1d')];for(_0x2e80a7=0x0;_0x2e80a7<_0x5c2de7[_0xca55('0x1e')];_0x2e80a7++){if(_0x5c2de7[_0x2e80a7][_0xca55('0x1f')]===_0x11e2f0[_0xca55('0x1d')]&&!_0x5c2de7[_0x2e80a7][_0xca55('0x20')]){_0xa392d1=!![];logger[_0xca55('0x21')]('['+[_0x270619[_0xca55('0x15')]()]+']\x20Agent\x20found\x20'+_0x5c2de7[_0x2e80a7]['systemuserid']+'!');_0x4b5d33['userId']=_0x5c2de7[_0x2e80a7]['systemuserid'];}}}}if(!_0xa392d1){logger[_0xca55('0x21')]('['+[_0x270619[_0xca55('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4b5d33['userEmail']=_0x73109e['username'];for(_0x2e80a7=0x0;_0x2e80a7<_0x5c2de7[_0xca55('0x1e')];_0x2e80a7++){if(_0x5c2de7[_0x2e80a7]['internalemailaddress']===_0x73109e[_0xca55('0xf')]){_0x4b5d33['userId']=_0x5c2de7[_0x2e80a7][_0xca55('0x22')];}}}_0x329fd2(_0x4b5d33);})[_0xca55('0x13')](function(_0x251ae5){_0x517a9d(_0x251ae5[_0xca55('0x23')]);});});}function createEndUser(_0x20e720,_0x17f18c,_0x27f8c8,_0x11293b,_0x4f74c5,_0x3afb81){return new BPromise(function(_0x209251,_0x3b64f3){return getAuthToken(_0x17f18c,_0x27f8c8,_0x3afb81)['then'](function(_0x2e6eb9){var _0x3133de=_0x3afb81['toLowerCase']()===_0xca55('0x24')?_0x4f74c5[_0xca55('0x25')]:_0x4f74c5['calleridnum'];var _0x26b16f={'method':_0xca55('0xc'),'uri':_0x11293b+_0xca55('0x26'),'body':{'telephone1':_0x3133de,'fullname':_0x3133de,'firstname':_0x3133de,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xca55('0x27')+_0x20e720[_0xca55('0x28')]+')'},'headers':{'Authorization':_0xca55('0x19')+_0x2e6eb9,'OData-Version':_0xca55('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x26b16f);})[_0xca55('0x12')](function(_0x5f4a9c){var _0x2c4480=_0x5f4a9c[_0xca55('0x29')][_0xca55('0x2a')];var _0x28441c=_0x2c4480['substring'](_0x2c4480['lastIndexOf']('(')+0x1,_0x2c4480['lastIndexOf'](')'));_0x20e720[_0xca55('0x2b')]=_0x28441c;_0x209251(_0x20e720);})[_0xca55('0x13')](function(_0x21772c){_0x3b64f3(_0x21772c[_0xca55('0x23')]);});});}function getEndUser(_0x51ab80,_0x521631,_0x5d6c4b,_0x588eff,_0x5b1ada,_0x5a9ca6){return new BPromise(function(_0x1f8ec6,_0x493ce6){var _0x3770ce=_0x5a9ca6[_0xca55('0x2c')]()===_0xca55('0x24')?_0x5b1ada[_0xca55('0x25')]:_0x5b1ada[_0xca55('0x2d')];return getAuthToken(_0x521631,_0x5d6c4b,_0x5a9ca6)['then'](function(_0x16ed75){var _0x413b9e={'method':_0xca55('0x17'),'uri':_0x588eff+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x3770ce[_0xca55('0x2e')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x16ed75,'If-None-Match':null,'OData-Version':_0xca55('0x1a')},'json':!![]};return rp(_0x413b9e);})[_0xca55('0x12')](function(_0x138ab9){var _0x5d1cf0=null;if(_0x138ab9){var _0x5a4574=_0x138ab9[_0xca55('0x2f')];var _0x146d66=![];for(_0x5d1cf0=0x0;_0x5d1cf0<_0x5a4574[_0xca55('0x1e')];_0x5d1cf0++){if(_0x5a4574[_0x5d1cf0]['telephone1']===_0x3770ce){_0x146d66=!![];_0x51ab80['enduserId']=_0x5a4574[_0x5d1cf0][_0xca55('0x30')];}}if(_0x146d66){_0x1f8ec6(_0x51ab80);}else{return createEndUser(_0x51ab80,_0x521631,_0x5d6c4b,_0x588eff,_0x5b1ada,_0x5a9ca6)[_0xca55('0x12')](function(_0x564781){logger[_0xca55('0x21')]('['+[_0x5a9ca6['toUpperCase']()]+']\x20Enduser\x20created!',_0x564781['enduserId']);_0x1f8ec6(_0x564781);});}}else{return createEndUser(_0x51ab80,_0x521631,_0x5d6c4b,_0x588eff,_0x5b1ada,_0x5a9ca6)[_0xca55('0x12')](function(_0xb90f8f){logger[_0xca55('0x21')]('['+[_0x5a9ca6[_0xca55('0x15')]()]+_0xca55('0x31'),_0xb90f8f[_0xca55('0x2b')]);_0x1f8ec6(_0xb90f8f);});}});});}function getCustomFields(_0x29afd5,_0xe46d55,_0x584a45){var _0x16d0a8={};if(_0x29afd5[_0xca55('0x1e')]>0x0){_[_0xca55('0x32')](_0x29afd5,function(_0x3e08bd){if(_[_0xca55('0x33')]([_0xca55('0x34'),_0xca55('0x35')],_0x3e08bd['type'])&&_0x3e08bd[_0xca55('0x36')]&&!_0x3e08bd['customField']){var _0x26491b=_0x3e08bd[_0xca55('0x37')][_0xca55('0x2c')]();var _0x464ff7=_0x26491b[_0xca55('0x38')](0x0,_0x26491b[_0xca55('0x39')]('_'));var _0x579cbd=_0x26491b[_0xca55('0x38')](_0x26491b[_0xca55('0x39')]('_')+0x1);if(_0x464ff7===_0x584a45){_0x16d0a8[_0x579cbd]=_0x3e08bd['content'];}}});}return _0x16d0a8;}function getTicket(_0x4055cf,_0x262068,_0xe0eb80,_0x5e1351,_0x1f13a4,_0x340d1d,_0x4417f1){return new BPromise(function(_0x5000c4,_0x27f1aa){var _0x4244b0;return getAuthToken(_0x262068,_0xe0eb80,_0x4417f1)[_0xca55('0x12')](function(_0x4740ad){if(_0x340d1d[_0xca55('0x3a')]===_0xca55('0x3b')){_0x4244b0={'method':'POST','uri':_0x5e1351+_0xca55('0x3c'),'body':Object[_0xca55('0x3d')]({},{'title':intUtil[_0xca55('0x3e')](_0x340d1d['Subjects'],_0x1f13a4,'\x20'),'description':intUtil[_0xca55('0x3e')](_0x340d1d[_0xca55('0x3f')],_0x1f13a4,'\x0a'),'customerid_contact@odata.bind':_0xca55('0x40')+_0x4055cf[_0xca55('0x2b')]+')','ownerid@odata.bind':_0xca55('0x27')+_0x4055cf[_0xca55('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x340d1d[_0xca55('0x41')],_0x1f13a4,_0x340d1d['ticketType'])),'headers':{'Authorization':_0xca55('0x19')+_0x4740ad,'OData-Version':_0xca55('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x340d1d[_0xca55('0x3a')]===_0xca55('0x42')){_0x4244b0={'method':'POST','uri':_0x5e1351+_0xca55('0x43'),'body':Object[_0xca55('0x3d')]({},{'subject':intUtil[_0xca55('0x3e')](_0x340d1d['Subjects'],_0x1f13a4,'\x20'),'phonenumber':String(_0x1f13a4[_0xca55('0x2d')]),'description':intUtil['getString'](_0x340d1d[_0xca55('0x3f')],_0x1f13a4,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x4055cf[_0xca55('0x2b')]+')','ownerid@odata.bind':_0xca55('0x27')+_0x4055cf[_0xca55('0x28')]+')','directioncode':_0x4055cf['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xca55('0x27')+_0x4055cf[_0xca55('0x28')]+')','participationtypemask':_0x4055cf[_0xca55('0x44')]===_0xca55('0x45')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x4055cf[_0xca55('0x2b')]+')','participationtypemask':_0x4055cf[_0xca55('0x44')]===_0xca55('0x45')?0x1:0x2}]},getCustomFields(_0x340d1d[_0xca55('0x41')],_0x1f13a4,_0x340d1d[_0xca55('0x3a')])),'headers':{'Authorization':_0xca55('0x19')+_0x4740ad,'OData-Version':_0xca55('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4244b0);})[_0xca55('0x12')](function(_0x2766b1){var _0x3a7d07=_0x2766b1[_0xca55('0x29')]['odata-entityid'];var _0x4dc5aa=_0x3a7d07['substring'](_0x3a7d07[_0xca55('0x46')]('(')+0x1,_0x3a7d07[_0xca55('0x46')](')'));_0x4055cf[_0xca55('0x47')]=_0x4dc5aa;_0x5000c4(_0x4055cf);})['catch'](function(_0x46db14){_0x27f1aa(_0x46db14['message']);});});}function emit(_0x53be65,_0x1e32d8,_0x41b439,_0x14921a){var _0x1dc340={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x53be65,_0x41b439,_0x14921a)};io['to'](util[_0xca55('0x48')](_0xca55('0x49'),_0x1e32d8))[_0xca55('0x4a')](_0xca55('0x4b'),_0x1dc340);}exports['cs']=function(_0x395a8b,_0x590a69,_0x2f4665,_0x53f5da,_0x673c8b,_0x297c75,_0xc8491,_0x20a3f9){var _0x3f246b={};_0x297c75['remoteUri']=intUtil[_0xca55('0x4c')](_0x297c75[_0xca55('0xe')]);_0x297c75[_0xca55('0x4d')]=intUtil[_0xca55('0x4c')](_0x297c75[_0xca55('0x4d')]);_0x3f246b[_0xca55('0x44')]=_0x20a3f9===_0xca55('0x45')||_0x20a3f9===_0xca55('0x4e')?_0xca55('0x45'):_0xca55('0x24');var _0x4e5762=util[_0xca55('0x48')](_0xca55('0x4f'),_0x297c75[_0xca55('0xe')]);var _0x4bf73e=util[_0xca55('0x48')](_0xca55('0x50'),_0x297c75[_0xca55('0x51')]);var _0x82a224=util[_0xca55('0x48')](_0xca55('0x52'),_0x297c75[_0xca55('0x4d')],_0x590a69[_0xca55('0x53')],md5(_0x590a69['uniqueid']));if(_0x673c8b&&_0x673c8b[_0xca55('0x54')]){logger[_0xca55('0x21')](_0xca55('0x55'),'Recording\x20is\x20enabled!');_0x590a69[_0xca55('0x56')]=_0x82a224;}else if(_0xc8491&&_0xc8491[_0xca55('0x57')]&&_0xc8491[_0xca55('0x57')]!=='none'){logger[_0xca55('0x21')](_0xca55('0x58'),_0xca55('0x59'));_0x590a69[_0xca55('0x56')]=_0x82a224;}else{_0x590a69[_0xca55('0x56')]='';}return getUser(_0x3f246b,_0x297c75,_0x53f5da,_0x4bf73e,_0x4e5762,_0x20a3f9)[_0xca55('0x12')](function(_0x4694f2){logger[_0xca55('0x21')]('['+_0x20a3f9[_0xca55('0x15')]()+_0xca55('0x5a'),_0x4694f2[_0xca55('0x28')]);logger['info']('['+_0x20a3f9[_0xca55('0x15')]()+_0xca55('0x5b'),_0x4694f2[_0xca55('0x5c')]);return getEndUser(_0x4694f2,_0x297c75,_0x4bf73e,_0x4e5762,_0x590a69,_0x20a3f9);})['then'](function(_0x57cdcc){logger[_0xca55('0x21')]('['+_0x20a3f9[_0xca55('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x57cdcc[_0xca55('0x2b')]);logger[_0xca55('0x21')]('['+_0x20a3f9[_0xca55('0x15')]()+_0xca55('0x5d'),_0x590a69[_0xca55('0x2d')]);return getTicket(_0x57cdcc,_0x297c75,_0x4bf73e,_0x4e5762,_0x590a69,_0x2f4665,_0x20a3f9);})['then'](function(_0x291bdd){logger[_0xca55('0x21')](util[_0xca55('0x48')]('['+_0x20a3f9['toUpperCase']()+_0xca55('0x5e'),_0x2f4665['ticketType'],_0x291bdd[_0xca55('0x47')]));logger['info'](util[_0xca55('0x48')]('['+_0x20a3f9['toUpperCase']()+_0xca55('0x5f'),_0x20a3f9));if(_0x20a3f9!==_0xca55('0x4e')){logger['info']('['+_0x20a3f9[_0xca55('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x297c75['remoteUri'],_0x53f5da[_0xca55('0x60')],_0x2f4665[_0xca55('0x3a')],_0x291bdd[_0xca55('0x47')]);}})['catch'](function(_0x48c22a){logger[_0xca55('0x14')]('['+_0x20a3f9['toUpperCase']()+_0xca55('0x61'),util[_0xca55('0x62')](_0x48c22a,{'showHidden':!![],'depth':null}));});}; \ 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 ced386f..ddb67f1 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 _0x3c2d=['content','picklist','push','variable','variableName','Variable','idField','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','toString','base64','debug','stringify','map','includes','string','type','nameField','customField','toLowerCase'];(function(_0x1d4663,_0x17cb51){var _0x581eb5=function(_0x3106ac){while(--_0x3106ac){_0x1d4663['push'](_0x1d4663['shift']());}};_0x581eb5(++_0x17cb51);}(_0x3c2d,0x1de));var _0xd3c2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3c2d[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var rp=require(_0xd3c2('0x0'));var md5=require(_0xd3c2('0x1'));var util=require(_0xd3c2('0x2'));var Redis=require(_0xd3c2('0x3'));var intUtil=require('./util');var config=require(_0xd3c2('0x4'));var logger=require(_0xd3c2('0x5'))(_0xd3c2('0x6'));config[_0xd3c2('0x7')]=_[_0xd3c2('0x8')](config['redis'],{'host':_0xd3c2('0x9'),'port':0x18eb});var io=require(_0xd3c2('0xa'))(new Redis(config[_0xd3c2('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xd3c2('0xb')};function emit(_0x3bcb58,_0x3526db,_0x54faf3){io['to'](_0x3bcb58)['emit'](_0x3526db,_0x54faf3);}function getTicket(_0x413702,_0x12458f,_0x21f18e,_0x5421ab,_0x56ca74){logger[_0xd3c2('0xc')](_0xd3c2('0xd'));var _0x543b9a=_[_0xd3c2('0xe')]({'responder_id':_0x12458f['id'],'requester_id':_0x21f18e['id'],'name':util[_0xd3c2('0xf')](_0xd3c2('0x10'),_0x56ca74[_0xd3c2('0x11')]),'phone':_0x56ca74[_0xd3c2('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd3c2('0x13')](_0x5421ab['Subjects'],_0x56ca74,'\x20'),'description':intUtil[_0xd3c2('0x13')](_0x5421ab[_0xd3c2('0x14')],_0x56ca74,'
'),'tags':getTags(_0x5421ab[_0xd3c2('0x15')],_0xd3c2('0x16'))},getCustomFields(_0x5421ab['Fields'],_0x56ca74));_0x543b9a['custom_fields']=_[_0xd3c2('0x17')](_[_0xd3c2('0x18')](_0x543b9a[_0xd3c2('0x19')],'id'),'value');return request({'uri':util[_0xd3c2('0xf')](_0xd3c2('0x1a'),_0x413702[_0xd3c2('0x1b')]),'method':_0xd3c2('0x1c'),'body':_0x543b9a})[_0xd3c2('0x1d')](function(_0x215f4a){logger['info'](_0xd3c2('0x1e'));return _0x215f4a;});}function getUser(_0x2f6aac,_0x56e542){if(intUtil[_0xd3c2('0x1f')](_0x56e542)){return request({'uri':util[_0xd3c2('0xf')](_0xd3c2('0x20'),_0x2f6aac[_0xd3c2('0x1b')]),'qs':{'email':_0x56e542}})['then'](function(_0x4332a0){if(_0x4332a0['length']){logger[_0xd3c2('0xc')]('Agent\x20found!');return _['find'](_0x4332a0,function(_0x1cb422){return _0x1cb422[_0xd3c2('0x21')][_0xd3c2('0x22')]===_0x56e542;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xd3c2('0x23'),_0x2f6aac[_0xd3c2('0x1b')])})[_0xd3c2('0x1d')](function(_0x3ba436){logger[_0xd3c2('0xc')](_0xd3c2('0x24'));return _0x3ba436;});}});}else{logger['info'](_0xd3c2('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2f6aac['remoteUri'])})['then'](function(_0x5c5658){logger['info'](_0xd3c2('0x24'));return _0x5c5658;});}}function getEndUser(_0x5cec9b,_0x1a0810,_0xcdcd12){logger[_0xd3c2('0xc')](_0xd3c2('0x26'),_0xcdcd12);return request({'uri':util[_0xd3c2('0xf')](_0xd3c2('0x27'),_0x5cec9b['remoteUri']),'qs':{'phone':_0xcdcd12}})[_0xd3c2('0x1d')](function(_0x27bd82){if(_0x27bd82[_0xd3c2('0x28')]){logger[_0xd3c2('0xc')](_0xd3c2('0x29'));return _[_0xd3c2('0x2a')](_0x27bd82,{'phone':_0xcdcd12});}else{logger[_0xd3c2('0xc')](_0xd3c2('0x2b'));return request({'uri':util[_0xd3c2('0xf')]('%s/api/v2/contacts',_0x5cec9b[_0xd3c2('0x1b')]),'method':_0xd3c2('0x1c'),'body':{'name':_0x1a0810,'phone':_0xcdcd12}})[_0xd3c2('0x1d')](function(_0x49d5db){logger[_0xd3c2('0xc')]('Enduser\x20created.');return _0x49d5db;});}});}function getAuth(_0x496afe){return util[_0xd3c2('0xf')](_0xd3c2('0x2c'),new Buffer(_0x496afe['apiKey']+':X')[_0xd3c2('0x2d')](_0xd3c2('0x2e')));}function request(_0x2cf6a1){logger[_0xd3c2('0x2f')]('[HTTP]',JSON[_0xd3c2('0x30')](_0x2cf6a1));return rp(_[_0xd3c2('0x8')](_0x2cf6a1,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xc8691f,_0x258edc){var _0x5375b0=[];if(_0xc8691f&&_0xc8691f[_0xd3c2('0x28')]>0x0){_0x5375b0=_[_0xd3c2('0x31')](_0xc8691f,_0x258edc);}return _0x5375b0;}function getCustomFields(_0x4b43fe,_0x7f12d2){var _0x4506a0=[];var _0x2d4108={'custom_fields':[]};if(_0x4b43fe['length']>0x0){_['forEach'](_0x4b43fe,function(_0x11aadf){if(_[_0xd3c2('0x32')]([_0xd3c2('0x33'),'picklist'],_0x11aadf[_0xd3c2('0x34')])&&_0x11aadf[_0xd3c2('0x35')]&&!_0x11aadf[_0xd3c2('0x36')]){_0x2d4108[_0x11aadf[_0xd3c2('0x35')][_0xd3c2('0x37')]()]=_0x11aadf[_0xd3c2('0x38')][_0xd3c2('0x2d')]();}else if(_[_0xd3c2('0x32')]([_0xd3c2('0x33'),_0xd3c2('0x39')],_0x11aadf[_0xd3c2('0x34')])&&_0x11aadf['idField']&&_0x11aadf[_0xd3c2('0x36')]){_0x2d4108[_0xd3c2('0x19')][_0xd3c2('0x3a')]({'id':_0x11aadf['idField'],'value':_0x11aadf['content'][_0xd3c2('0x2d')]()});}else if(_0x11aadf['type']===_0xd3c2('0x3b')&&_0x11aadf['variableName']&&_0x11aadf['idField']&&_0x11aadf[_0xd3c2('0x36')]){_0x7f12d2[_0x11aadf[_0xd3c2('0x3c')]]&&_0x2d4108[_0xd3c2('0x19')][_0xd3c2('0x3a')]({'id':_0x11aadf['idField'],'value':_0x7f12d2[_0x11aadf['variableName']][_0xd3c2('0x2d')]()});}else if(_0x11aadf['type']==='customVariable'&&_0x11aadf[_0xd3c2('0x3d')]&&_0x11aadf[_0xd3c2('0x3d')][_0xd3c2('0x16')]&&_0x11aadf[_0xd3c2('0x3e')]&&_0x11aadf[_0xd3c2('0x36')]){_0x7f12d2[_0x11aadf[_0xd3c2('0x3d')][_0xd3c2('0x16')][_0xd3c2('0x37')]()]&&_0x2d4108['custom_fields']['push']({'id':_0x11aadf[_0xd3c2('0x3e')],'value':_0x7f12d2[_0x11aadf['Variable'][_0xd3c2('0x16')]['toLowerCase']()][_0xd3c2('0x2d')]()});}});}return _0x2d4108;}exports[_0xd3c2('0x3f')]=function(_0xd8493,_0x2d0b49,_0x133963,_0x213e17,_0x386e41,_0x18fbae){var _0x5edeb4,_0x5931df;_0x18fbae[_0xd3c2('0x1b')]=intUtil[_0xd3c2('0x40')](_0x18fbae[_0xd3c2('0x1b')]);_0x18fbae[_0xd3c2('0x41')]=intUtil[_0xd3c2('0x40')](_0x18fbae[_0xd3c2('0x41')]);if(_0x386e41&&_0x386e41[_0xd3c2('0x42')]){logger[_0xd3c2('0xc')](_0xd3c2('0x43'),_0xd3c2('0x44'));_0x2d0b49['recordingURL']=util[_0xd3c2('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18fbae[_0xd3c2('0x41')],_0x2d0b49[_0xd3c2('0x45')],md5(_0x2d0b49[_0xd3c2('0x45')]));}else{_0x2d0b49[_0xd3c2('0x46')]='';}headers[_0xd3c2('0x47')]=getAuth(_0x18fbae);return getUser(_0x18fbae,_0x213e17[_0xd3c2('0x22')])[_0xd3c2('0x1d')](function(_0xb9fe2b){_0x5edeb4=_0xb9fe2b;logger['info']('The\x20User\x20ID\x20is:',_0x5edeb4['id']);return getEndUser(_0x18fbae,_0x2d0b49[_0xd3c2('0x11')],_0x2d0b49[_0xd3c2('0x12')]);})[_0xd3c2('0x1d')](function(_0x190e6e){_0x5931df=_0x190e6e;logger[_0xd3c2('0xc')](_0xd3c2('0x48'),_0x5931df['id']);return getTicket(_0x18fbae,_0x5edeb4,_0x5931df,_0x133963,_0x2d0b49);})[_0xd3c2('0x1d')](function(_0x5347c2){if(_0x5347c2&&_0x5347c2['id']){logger[_0xd3c2('0xc')](_0xd3c2('0x1e'));logger['info'](_0xd3c2('0x49'),_0x5347c2['id']);logger[_0xd3c2('0xc')](_0xd3c2('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd3c2('0xf')](_0xd3c2('0x4a'),_0x213e17['name']),_0xd3c2('0x4b'),{'uri':util[_0xd3c2('0xf')](_0xd3c2('0x4c'),_0x18fbae[_0xd3c2('0x1b')],_0x5347c2['id'])});}})['catch'](function(_0x230bcb){logger[_0xd3c2('0x4d')](_0xd3c2('0x43'),JSON['stringify'](_0x230bcb));});};exports['outbound']=function(_0x148747,_0xb2879b,_0x4ec938,_0x3f5c4b,_0x3ac2fb,_0x4003c0,_0x87ab3b){var _0x309b6e,_0x3557a5;_0x4003c0[_0xd3c2('0x1b')]=intUtil['stripTrailingSlash'](_0x4003c0['remoteUri']);_0x4003c0['serverUrl']=intUtil[_0xd3c2('0x40')](_0x4003c0['serverUrl']);if(_0x87ab3b&&_0x87ab3b['recordingFormat']&&_0x87ab3b[_0xd3c2('0x4e')]!==_0xd3c2('0x4f')){logger[_0xd3c2('0xc')](_0xd3c2('0x50'),_0xd3c2('0x44'));_0xb2879b[_0xd3c2('0x46')]=util[_0xd3c2('0xf')](_0xd3c2('0x51'),_0x4003c0[_0xd3c2('0x41')],_0xb2879b[_0xd3c2('0x45')],md5(_0xb2879b['uniqueid']));}headers['Authorization']=getAuth(_0x4003c0);return getUser(_0x4003c0,_0x3f5c4b['email'])['then'](function(_0x2abd59){_0x309b6e=_0x2abd59;logger[_0xd3c2('0xc')]('The\x20User\x20ID\x20is:',_0x309b6e['id']);return getEndUser(_0x4003c0,_0xb2879b[_0xd3c2('0x52')],_0xb2879b[_0xd3c2('0x53')]);})[_0xd3c2('0x1d')](function(_0x2800eb){_0x3557a5=_0x2800eb;logger[_0xd3c2('0xc')](_0xd3c2('0x48'),_0x3557a5['id']);return getTicket(_0x4003c0,_0x309b6e,_0x3557a5,_0x4ec938,_0xb2879b);})[_0xd3c2('0x1d')](function(_0x21ade1){if(_0x21ade1&&_0x21ade1['id']){logger[_0xd3c2('0xc')](_0xd3c2('0x1e'));logger[_0xd3c2('0xc')](_0xd3c2('0x49'),_0x21ade1['id']);logger[_0xd3c2('0xc')](_0xd3c2('0x50'),_0xd3c2('0x54'));emit(util[_0xd3c2('0xf')]('user:%s',_0x3f5c4b[_0xd3c2('0x16')]),_0xd3c2('0x4b'),{'uri':util[_0xd3c2('0xf')](_0xd3c2('0x4c'),_0x4003c0[_0xd3c2('0x1b')],_0x21ade1['id'])});}})['catch'](function(_0x4bb59b){logger['error'](_0xd3c2('0x50'),JSON[_0xd3c2('0x30')](_0x4bb59b));});};exports[_0xd3c2('0x55')]=function(_0x470da5,_0x7af6a0,_0x5252d4,_0x10286e,_0x5bacac,_0x377fd4){var _0x32fe6f,_0x37610d;_0x377fd4[_0xd3c2('0x1b')]=intUtil[_0xd3c2('0x40')](_0x377fd4[_0xd3c2('0x1b')]);_0x377fd4[_0xd3c2('0x41')]=intUtil['stripTrailingSlash'](_0x377fd4[_0xd3c2('0x41')]);if(_0x5bacac&&_0x5bacac['monitor_format']){logger[_0xd3c2('0xc')]('['+_0x7af6a0[_0xd3c2('0x56')][_0xd3c2('0x57')]()+']',_0xd3c2('0x44'));_0x7af6a0[_0xd3c2('0x46')]=util[_0xd3c2('0xf')](_0xd3c2('0x51'),_0x377fd4['serverUrl'],_0x7af6a0['uniqueid'],md5(_0x7af6a0['uniqueid']));}else{_0x7af6a0['recordingURL']='';}headers[_0xd3c2('0x47')]=getAuth(_0x377fd4);return getUser(_0x377fd4,'')[_0xd3c2('0x1d')](function(_0x156d34){_0x32fe6f=_0x156d34;logger[_0xd3c2('0xc')](_0xd3c2('0x58'),_0x32fe6f['id']);return getEndUser(_0x377fd4,_0x7af6a0[_0xd3c2('0x11')],_0x7af6a0[_0xd3c2('0x12')]);})['then'](function(_0x410d8d){_0x37610d=_0x410d8d;logger[_0xd3c2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x37610d['id']);return getTicket(_0x377fd4,_0x32fe6f,_0x37610d,_0x5252d4,_0x7af6a0);})[_0xd3c2('0x1d')](function(_0x39a78b){if(_0x39a78b){logger[_0xd3c2('0xc')]('Ticket\x20created!');logger[_0xd3c2('0xc')](_0xd3c2('0x49'),_0x39a78b['id']);}})['catch'](function(_0x3cc2e0){logger[_0xd3c2('0x4d')]('['+_0x7af6a0[_0xd3c2('0x56')][_0xd3c2('0x57')]()+']',JSON[_0xd3c2('0x30')](_0x3cc2e0));});}; \ No newline at end of file +var _0x4890=['calleridname','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','mapValues','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','map','string','picklist','type','toLowerCase','includes','idField','content','variable','variableName','customField','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','info','Creating\x20new\x20ticket...','merge','format'];(function(_0x286254,_0x27c996){var _0x49bfa1=function(_0x417989){while(--_0x417989){_0x286254['push'](_0x286254['shift']());}};_0x49bfa1(++_0x27c996);}(_0x4890,0xfa));var _0x0489=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x4890[_0x4a29a9];return _0x386570;};'use strict';var _=require(_0x0489('0x0'));var rp=require(_0x0489('0x1'));var md5=require(_0x0489('0x2'));var util=require(_0x0489('0x3'));var Redis=require(_0x0489('0x4'));var intUtil=require(_0x0489('0x5'));var config=require(_0x0489('0x6'));var logger=require(_0x0489('0x7'))(_0x0489('0x8'));config[_0x0489('0x9')]=_[_0x0489('0xa')](config[_0x0489('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x0489('0xb'),'Accept':_0x0489('0xb')};function emit(_0x266873,_0x4ec8d4,_0x5d9dbb){io['to'](_0x266873)[_0x0489('0xc')](_0x4ec8d4,_0x5d9dbb);}function getTicket(_0x20d65e,_0x12dd08,_0x40ecb8,_0x1ca9e0,_0x3e14d1){logger[_0x0489('0xd')](_0x0489('0xe'));var _0x2a94d1=_[_0x0489('0xf')]({'responder_id':_0x12dd08['id'],'requester_id':_0x40ecb8['id'],'name':util[_0x0489('0x10')]('Caller\x20-\x20%s',_0x3e14d1[_0x0489('0x11')]),'phone':_0x3e14d1[_0x0489('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0489('0x13')](_0x1ca9e0[_0x0489('0x14')],_0x3e14d1,'\x20'),'description':intUtil[_0x0489('0x13')](_0x1ca9e0['Descriptions'],_0x3e14d1,_0x0489('0x15')),'tags':getTags(_0x1ca9e0[_0x0489('0x16')],'name')},getCustomFields(_0x1ca9e0[_0x0489('0x17')],_0x3e14d1));_0x2a94d1[_0x0489('0x18')]=_[_0x0489('0x19')](_['keyBy'](_0x2a94d1['custom_fields'],'id'),'value');return request({'uri':util[_0x0489('0x10')](_0x0489('0x1a'),_0x20d65e[_0x0489('0x1b')]),'method':_0x0489('0x1c'),'body':_0x2a94d1})[_0x0489('0x1d')](function(_0x33d3bf){logger[_0x0489('0xd')](_0x0489('0x1e'));return _0x33d3bf;});}function getUser(_0xfb00a0,_0x4fc885){if(intUtil[_0x0489('0x1f')](_0x4fc885)){return request({'uri':util[_0x0489('0x10')](_0x0489('0x20'),_0xfb00a0[_0x0489('0x1b')]),'qs':{'email':_0x4fc885}})['then'](function(_0x5443d2){if(_0x5443d2[_0x0489('0x21')]){logger[_0x0489('0xd')](_0x0489('0x22'));return _['find'](_0x5443d2,function(_0x50cf0d){return _0x50cf0d['contact'][_0x0489('0x23')]===_0x4fc885;});}else{logger[_0x0489('0xd')](_0x0489('0x24'));return request({'uri':util['format']('%s/api/v2/agents/me',_0xfb00a0[_0x0489('0x1b')])})['then'](function(_0x1eafd6){logger[_0x0489('0xd')](_0x0489('0x25'));return _0x1eafd6;});}});}else{logger[_0x0489('0xd')](_0x0489('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0xfb00a0['remoteUri'])})[_0x0489('0x1d')](function(_0x5562c0){logger[_0x0489('0xd')](_0x0489('0x25'));return _0x5562c0;});}}function getEndUser(_0x4896e0,_0x2181e6,_0x500a4f){logger[_0x0489('0xd')](_0x0489('0x27'),_0x500a4f);return request({'uri':util[_0x0489('0x10')](_0x0489('0x28'),_0x4896e0[_0x0489('0x1b')]),'qs':{'phone':_0x500a4f}})[_0x0489('0x1d')](function(_0x438bfc){if(_0x438bfc[_0x0489('0x21')]){logger[_0x0489('0xd')](_0x0489('0x29'));return _[_0x0489('0x2a')](_0x438bfc,{'phone':_0x500a4f});}else{logger[_0x0489('0xd')](_0x0489('0x2b'));return request({'uri':util[_0x0489('0x10')](_0x0489('0x28'),_0x4896e0[_0x0489('0x1b')]),'method':_0x0489('0x1c'),'body':{'name':_0x2181e6,'phone':_0x500a4f}})[_0x0489('0x1d')](function(_0x4ae58c){logger[_0x0489('0xd')](_0x0489('0x2c'));return _0x4ae58c;});}});}function getAuth(_0x2d794a){return util[_0x0489('0x10')]('Basic\x20%s',new Buffer(_0x2d794a[_0x0489('0x2d')]+':X')[_0x0489('0x2e')](_0x0489('0x2f')));}function request(_0xabbee5){logger[_0x0489('0x30')](_0x0489('0x31'),JSON[_0x0489('0x32')](_0xabbee5));return rp(_[_0x0489('0xa')](_0xabbee5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3093a1,_0x55b40a){var _0x126b68=[];if(_0x3093a1&&_0x3093a1[_0x0489('0x21')]>0x0){_0x126b68=_[_0x0489('0x33')](_0x3093a1,_0x55b40a);}return _0x126b68;}function getCustomFields(_0x4dac24,_0x500bd8){var _0x231eba=[];var _0x508408={'custom_fields':[]};if(_0x4dac24[_0x0489('0x21')]>0x0){_['forEach'](_0x4dac24,function(_0x5e3807){if(_['includes']([_0x0489('0x34'),_0x0489('0x35')],_0x5e3807[_0x0489('0x36')])&&_0x5e3807['nameField']&&!_0x5e3807['customField']){_0x508408[_0x5e3807['nameField'][_0x0489('0x37')]()]=_0x5e3807['content'][_0x0489('0x2e')]();}else if(_[_0x0489('0x38')]([_0x0489('0x34'),_0x0489('0x35')],_0x5e3807['type'])&&_0x5e3807[_0x0489('0x39')]&&_0x5e3807['customField']){_0x508408['custom_fields']['push']({'id':_0x5e3807[_0x0489('0x39')],'value':_0x5e3807[_0x0489('0x3a')][_0x0489('0x2e')]()});}else if(_0x5e3807[_0x0489('0x36')]===_0x0489('0x3b')&&_0x5e3807[_0x0489('0x3c')]&&_0x5e3807[_0x0489('0x39')]&&_0x5e3807[_0x0489('0x3d')]){_0x500bd8[_0x5e3807['variableName']]&&_0x508408['custom_fields'][_0x0489('0x3e')]({'id':_0x5e3807[_0x0489('0x39')],'value':_0x500bd8[_0x5e3807['variableName']][_0x0489('0x2e')]()});}else if(_0x5e3807[_0x0489('0x36')]===_0x0489('0x3f')&&_0x5e3807[_0x0489('0x40')]&&_0x5e3807['Variable'][_0x0489('0x41')]&&_0x5e3807[_0x0489('0x39')]&&_0x5e3807[_0x0489('0x3d')]){_0x500bd8[_0x5e3807['Variable'][_0x0489('0x41')][_0x0489('0x37')]()]&&_0x508408[_0x0489('0x18')][_0x0489('0x3e')]({'id':_0x5e3807[_0x0489('0x39')],'value':_0x500bd8[_0x5e3807[_0x0489('0x40')][_0x0489('0x41')]['toLowerCase']()][_0x0489('0x2e')]()});}});}return _0x508408;}exports[_0x0489('0x42')]=function(_0x5e23a5,_0x231579,_0x5894df,_0x4c4ffe,_0x409a38,_0x45cd4b){var _0x1efbce,_0x3489c5;_0x45cd4b[_0x0489('0x1b')]=intUtil[_0x0489('0x43')](_0x45cd4b[_0x0489('0x1b')]);_0x45cd4b[_0x0489('0x44')]=intUtil[_0x0489('0x43')](_0x45cd4b[_0x0489('0x44')]);if(_0x409a38&&_0x409a38['monitor_format']){logger['info'](_0x0489('0x45'),_0x0489('0x46'));_0x231579[_0x0489('0x47')]=util[_0x0489('0x10')](_0x0489('0x48'),_0x45cd4b['serverUrl'],_0x231579['uniqueid'],md5(_0x231579[_0x0489('0x49')]));}else{_0x231579[_0x0489('0x47')]='';}headers[_0x0489('0x4a')]=getAuth(_0x45cd4b);return getUser(_0x45cd4b,_0x4c4ffe[_0x0489('0x23')])[_0x0489('0x1d')](function(_0x3d7021){_0x1efbce=_0x3d7021;logger['info']('The\x20User\x20ID\x20is:',_0x1efbce['id']);return getEndUser(_0x45cd4b,_0x231579[_0x0489('0x11')],_0x231579[_0x0489('0x12')]);})['then'](function(_0x41b7bc){_0x3489c5=_0x41b7bc;logger[_0x0489('0xd')](_0x0489('0x4b'),_0x3489c5['id']);return getTicket(_0x45cd4b,_0x1efbce,_0x3489c5,_0x5894df,_0x231579);})[_0x0489('0x1d')](function(_0x2c03bf){if(_0x2c03bf&&_0x2c03bf['id']){logger[_0x0489('0xd')]('Ticket\x20created!');logger['info'](_0x0489('0x4c'),_0x2c03bf['id']);logger[_0x0489('0xd')](_0x0489('0x45'),_0x0489('0x4d'));emit(util[_0x0489('0x10')]('user:%s',_0x4c4ffe[_0x0489('0x41')]),_0x0489('0x4e'),{'uri':util[_0x0489('0x10')](_0x0489('0x4f'),_0x45cd4b['remoteUri'],_0x2c03bf['id'])});}})[_0x0489('0x50')](function(_0x357f14){logger[_0x0489('0x51')](_0x0489('0x45'),JSON['stringify'](_0x357f14));});};exports['outbound']=function(_0x561f27,_0x26098a,_0x70ae4b,_0x2490ca,_0x12ad2d,_0x3e8d11,_0x218ca3){var _0x5ab7de,_0x578ffc;_0x3e8d11[_0x0489('0x1b')]=intUtil[_0x0489('0x43')](_0x3e8d11[_0x0489('0x1b')]);_0x3e8d11['serverUrl']=intUtil['stripTrailingSlash'](_0x3e8d11[_0x0489('0x44')]);if(_0x218ca3&&_0x218ca3[_0x0489('0x52')]&&_0x218ca3['recordingFormat']!==_0x0489('0x53')){logger[_0x0489('0xd')](_0x0489('0x54'),_0x0489('0x46'));_0x26098a[_0x0489('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e8d11[_0x0489('0x44')],_0x26098a['uniqueid'],md5(_0x26098a[_0x0489('0x49')]));}headers[_0x0489('0x4a')]=getAuth(_0x3e8d11);return getUser(_0x3e8d11,_0x2490ca[_0x0489('0x23')])['then'](function(_0x2cb712){_0x5ab7de=_0x2cb712;logger['info'](_0x0489('0x55'),_0x5ab7de['id']);return getEndUser(_0x3e8d11,_0x26098a['destcalleridname'],_0x26098a['destcalleridnum']);})[_0x0489('0x1d')](function(_0x3961e3){_0x578ffc=_0x3961e3;logger['info'](_0x0489('0x4b'),_0x578ffc['id']);return getTicket(_0x3e8d11,_0x5ab7de,_0x578ffc,_0x70ae4b,_0x26098a);})[_0x0489('0x1d')](function(_0x3c2b3f){if(_0x3c2b3f&&_0x3c2b3f['id']){logger[_0x0489('0xd')]('Ticket\x20created!');logger[_0x0489('0xd')](_0x0489('0x4c'),_0x3c2b3f['id']);logger['info'](_0x0489('0x54'),_0x0489('0x4d'));emit(util[_0x0489('0x10')]('user:%s',_0x2490ca[_0x0489('0x41')]),'trigger:browser:url',{'uri':util[_0x0489('0x10')](_0x0489('0x4f'),_0x3e8d11[_0x0489('0x1b')],_0x3c2b3f['id'])});}})[_0x0489('0x50')](function(_0x12bb94){logger[_0x0489('0x51')]('[OUTBOUND]',JSON[_0x0489('0x32')](_0x12bb94));});};exports['unmanaged']=function(_0x238c59,_0x337b4a,_0x2ad44c,_0x16a4e9,_0x4d651d,_0x473ee2){var _0x17eb21,_0x14ad42;_0x473ee2[_0x0489('0x1b')]=intUtil[_0x0489('0x43')](_0x473ee2[_0x0489('0x1b')]);_0x473ee2[_0x0489('0x44')]=intUtil['stripTrailingSlash'](_0x473ee2[_0x0489('0x44')]);if(_0x4d651d&&_0x4d651d[_0x0489('0x56')]){logger[_0x0489('0xd')]('['+_0x337b4a['lastevent'][_0x0489('0x57')]()+']',_0x0489('0x46'));_0x337b4a[_0x0489('0x47')]=util['format'](_0x0489('0x48'),_0x473ee2[_0x0489('0x44')],_0x337b4a['uniqueid'],md5(_0x337b4a[_0x0489('0x49')]));}else{_0x337b4a[_0x0489('0x47')]='';}headers[_0x0489('0x4a')]=getAuth(_0x473ee2);return getUser(_0x473ee2,'')[_0x0489('0x1d')](function(_0x49dbad){_0x17eb21=_0x49dbad;logger[_0x0489('0xd')](_0x0489('0x55'),_0x17eb21['id']);return getEndUser(_0x473ee2,_0x337b4a['calleridname'],_0x337b4a['calleridnum']);})[_0x0489('0x1d')](function(_0x163f22){_0x14ad42=_0x163f22;logger[_0x0489('0xd')](_0x0489('0x4b'),_0x14ad42['id']);return getTicket(_0x473ee2,_0x17eb21,_0x14ad42,_0x2ad44c,_0x337b4a);})['then'](function(_0x4e71cb){if(_0x4e71cb){logger[_0x0489('0xd')]('Ticket\x20created!');logger[_0x0489('0xd')](_0x0489('0x4c'),_0x4e71cb['id']);}})[_0x0489('0x50')](function(_0xd7a05){logger['error']('['+_0x337b4a[_0x0489('0x58')]['toUpperCase']()+']',JSON[_0x0489('0x32')](_0xd7a05));});}; \ 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 7781e5d..e6edae6 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 _0x736b=['agentEmail','length','userId','Admin\x20selected','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list'];(function(_0x1d8598,_0x290465){var _0x33cbf4=function(_0x870a75){while(--_0x870a75){_0x1d8598['push'](_0x1d8598['shift']());}};_0x33cbf4(++_0x290465);}(_0x736b,0x1d4));var _0xb736=function(_0x5a80a8,_0x1d960e){_0x5a80a8=_0x5a80a8-0x0;var _0x2feaca=_0x736b[_0x5a80a8];return _0x2feaca;};'use strict';var _=require(_0xb736('0x0'));var rp=require(_0xb736('0x1'));var md5=require(_0xb736('0x2'));var util=require(_0xb736('0x3'));var moment=require(_0xb736('0x4'));var Promise=require(_0xb736('0x5'));var Redis=require(_0xb736('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xb736('0x7'))(_0xb736('0x8'));config[_0xb736('0x9')]=_[_0xb736('0xa')](config['redis'],{'host':_0xb736('0xb'),'port':0x18eb});var io=require(_0xb736('0xc'))(new Redis(config[_0xb736('0x9')]));function getAdminId(_0x1b0b9b,_0x2553a2,_0x46db8a,_0x743439){return new Promise(function(_0x447c1f,_0x386e34){var _0x589527=![];var _0x15d495={'method':_0xb736('0xd'),'uri':_0x743439+'/api/selector/owners','json':!![]};_0x15d495[_0xb736('0xe')]=_0x46db8a;logger[_0xb736('0xf')](_0xb736('0x10'));return rp(_0x15d495)[_0xb736('0x11')](function(_0x15ee73){if(_0x15ee73){var _0x58e938=_0x15ee73[_0xb736('0x12')];var _0x56a802=null;for(_0x56a802=0x0;_0x56a802<_0x58e938['length'];_0x56a802++){if(_0x58e938[_0x56a802][_0xb736('0x13')]===_0x1b0b9b[_0xb736('0x14')]){_0x1b0b9b[_0xb736('0x15')]=_0x58e938[_0x56a802]['id'];_0x589527=!![];}}if(_0x589527){logger['info'](_0xb736('0x16'),_0x1b0b9b[_0xb736('0x15')]);_0x447c1f(_0x1b0b9b);}else{_0x386e34({'statusCode':0x194,'message':_0xb736('0x17')});}}else{_0x386e34({'statusCode':0x194,'message':_0xb736('0x17')});}})[_0xb736('0x18')](function(_0xa1069){logger[_0xb736('0x19')]('['+[_0x2553a2[_0xb736('0x1a')]()]+']',_0xa1069[_0xb736('0x1b')]);_0x386e34(_0xa1069);});});}function getUser(_0x1a9e80,_0x32c1ad,_0x2ddb2d){return function(_0xef1065){return new Promise(function(_0x5ce7b8,_0x44bdbe){var _0x1a6c9c={'method':'GET','uri':_0x2ddb2d+_0xb736('0x1c'),'json':!![]};_0x1a6c9c[_0xb736('0xe')]=_0x32c1ad;logger[_0xb736('0xf')](_0xb736('0x1d'));return rp(_0x1a6c9c)[_0xb736('0x11')](function(_0x387efd){if(_0x387efd){var _0x3f4504=_0x387efd[_0xb736('0x12')];var _0x5587a1=![];var _0x2404b9=null;if(_0xef1065[_0xb736('0x1e')]!==null){logger[_0xb736('0xf')]('Getting\x20user\x20with\x20email',_0xef1065[_0xb736('0x1e')]);_0xef1065['userEmail']=_0xef1065[_0xb736('0x1e')];for(_0x2404b9=0x0;_0x2404b9<_0x3f4504[_0xb736('0x1f')];_0x2404b9++){if(_0x3f4504[_0x2404b9]['email']===_0xef1065[_0xb736('0x1e')]){_0x5587a1=!![];_0xef1065['userId']=_0x3f4504[_0x2404b9]['id'];logger[_0xb736('0xf')]('User\x20found:',_0xef1065[_0xb736('0x20')]);}}}if(!_0x5587a1){logger[_0xb736('0xf')](_0xb736('0x21'));_0xef1065['userEmail']=_0xef1065[_0xb736('0x14')];_0xef1065[_0xb736('0x20')]=_0xef1065[_0xb736('0x15')];_0x5587a1=!![];}if(_0x5587a1){_0x5ce7b8(_0xef1065);}else{_0x44bdbe({'statusCode':0x194,'message':_0xb736('0x17')});}}else{_0x44bdbe({'statusCode':0x194,'message':_0xb736('0x17')});}})['catch'](function(_0x356eb5){logger[_0xb736('0x19')]('['+[_0x1a9e80[_0xb736('0x1a')]()]+']',_0x356eb5['message']);_0x44bdbe(_0x356eb5);});});};}function searchContact(_0x24cdd0,_0x291577,_0x57f572,_0x436367){return new Promise(function(_0x43ec0b,_0x16d1ec){var _0x1d8ee3={'method':_0xb736('0xd'),'headers':_0x291577,'uri':_0x24cdd0+'/api/lookup?q='+_0x436367+'&f='+_0x57f572+'&entities=contact','json':!![]};rp(_0x1d8ee3)[_0xb736('0x11')](function(_0x4bccd2){var _0x2b3855=_['find'](_0x4bccd2[_0xb736('0x22')][_0xb736('0x22')],[_0x57f572,_0x436367]);_0x43ec0b(_0x2b3855);})[_0xb736('0x18')](function(_0x3c978b){_0x16d1ec(_0x3c978b);});});}function getEndUser(_0x366be4,_0x257488,_0x205b25){return function(_0x5a6af8){return new Promise(function(_0x122765,_0x4c3844){logger['info'](util[_0xb736('0x23')](_0xb736('0x24'),_0x5a6af8[_0xb736('0x25')]));searchContact(_0x205b25,_0x257488,'mobile_number',_0x5a6af8['contactNumber'])['then'](function(_0x37ea25){if(_0x37ea25){_0x5a6af8['endUserId']=_0x37ea25['id'];logger['info'](_0xb736('0x26'),_0x5a6af8[_0xb736('0x27')]);return _0x122765(_0x5a6af8);}searchContact(_0x205b25,_0x257488,'work_number',_0x5a6af8[_0xb736('0x25')])[_0xb736('0x11')](function(_0x456e06){if(_0x456e06){_0x5a6af8[_0xb736('0x27')]=_0x456e06['id'];logger['info'](_0xb736('0x28'),_0x5a6af8[_0xb736('0x27')]);return _0x122765(_0x5a6af8);}createEndUser(_0x5a6af8,_0x366be4,_0x257488,_0x205b25)['then'](function(_0x2574ba){logger[_0xb736('0xf')](_0xb736('0x29'),_0x2574ba[_0xb736('0x27')]);return _0x122765(_0x2574ba);});});})[_0xb736('0x18')](function(_0x36ed4d){_0x4c3844(_0x36ed4d);});});};}function createEndUser(_0x4445ef,_0x2b5795,_0x2ccdba,_0x5adb28){return new Promise(function(_0x125f15,_0x1c866f){var _0x37c5a7=moment();var _0x55eefd={'method':'POST','uri':_0x5adb28+_0xb736('0x2a'),'body':{'contact':{'last_name':_0x4445ef[_0xb736('0x25')],'work_number':_0x4445ef[_0xb736('0x25')],'mobile_number':_0x4445ef[_0xb736('0x25')],'owner_id':_0x4445ef[_0xb736('0x20')],'created_at':_0x37c5a7[_0xb736('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x55eefd[_0xb736('0xe')]=_0x2ccdba;logger[_0xb736('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x55eefd)[_0xb736('0x11')](function(_0x2c7cb9){_0x4445ef['endUserId']=_0x2c7cb9[_0xb736('0x2b')]['id'];_0x125f15(_0x4445ef);})['catch'](function(_0xa0ab5a){logger['error']('['+[_0x2b5795['toUpperCase']()]+']',_0xa0ab5a[_0xb736('0x1b')]);_0x1c866f(_0xa0ab5a[_0xb736('0x1b')]);});});}function getTicket(_0x46e453,_0x3dbf85,_0x4ee6db,_0x35f1a2,_0x1c3e3a){return function(_0x31ddad){logger[_0xb736('0xf')](_0xb736('0x2c'));return new Promise(function(_0x371542,_0x442a48){var _0x117935=moment();var _0x1c7af9={'method':_0xb736('0x2d'),'uri':_0x4ee6db+_0xb736('0x2e'),'body':{'title':intUtil[_0xb736('0x2f')](_0x35f1a2[_0xb736('0x30')],_0x1c3e3a,'\x20'),'description':intUtil['getString'](_0x35f1a2[_0xb736('0x31')],_0x1c3e3a,'\x0a'),'owner_id':_0x31ddad['userId'],'creater_id':_0x31ddad[_0xb736('0x15')],'targetable_id':_0x31ddad[_0xb736('0x27')],'targetable_type':_0xb736('0x32'),'created_at':_0x117935[_0xb736('0x23')](_0xb736('0x33')),'due_date':_0x117935[_0xb736('0x34')](0x1e,'m')[_0xb736('0x23')](_0xb736('0x33'))},'json':!![]};_0x1c7af9[_0xb736('0xe')]=_0x3dbf85;return rp(_0x1c7af9)[_0xb736('0x11')](function(_0x39df3c){_0x31ddad[_0xb736('0x35')]=_0x39df3c['task']['id'];logger[_0xb736('0xf')](_0xb736('0x36'),_0x31ddad[_0xb736('0x35')]);_0x371542(_0x31ddad);})[_0xb736('0x18')](function(_0x2eaee9){logger[_0xb736('0x19')]('['+[_0x46e453[_0xb736('0x1a')]()]+']',_0x2eaee9[_0xb736('0x1b')]);_0x442a48(_0x2eaee9['message']);});});};}function emit(_0x7a3f82,_0xf14e5e,_0x1b0577){var _0x1c9b4e={'uri':_0x7a3f82+_0xb736('0x37')+_0x1b0577};io['to'](util[_0xb736('0x23')](_0xb736('0x38'),_0xf14e5e))[_0xb736('0x39')](_0xb736('0x3a'),_0x1c9b4e);}exports['cs']=function(_0x4954c3,_0x3ea15f,_0x4db4fa,_0x5d0a18,_0x56f862,_0x1db9b1,_0x53c6e2,_0x52138b){var _0x115672={};var _0x1fb3f6={'Authorization':'Token\x20token='+_0x1db9b1[_0xb736('0x3b')]};_0x1db9b1[_0xb736('0x3c')]=intUtil[_0xb736('0x3d')](_0x1db9b1['remoteUri']);_0x1db9b1['serverUrl']=intUtil[_0xb736('0x3d')](_0x1db9b1['serverUrl']);var _0x24b0f2=_0x1db9b1['remoteUri'];_0x115672[_0xb736('0x14')]=_0x1db9b1['username'];_0x115672[_0xb736('0x25')]=_0x52138b[_0xb736('0x3e')]()==='outbound'?_0x3ea15f[_0xb736('0x3f')]:_0x3ea15f[_0xb736('0x40')];_0x115672['callDirection']=_0x52138b===_0xb736('0x41')||_0x52138b===_0xb736('0x42')?_0xb736('0x41'):_0xb736('0x43');if(_0x5d0a18){_0x115672['agentEmail']=_0x5d0a18[_0xb736('0x13')];}var _0x497db5=util['format'](_0xb736('0x44'),_0x1db9b1[_0xb736('0x45')],_0x3ea15f[_0xb736('0x46')],md5(_0x3ea15f[_0xb736('0x46')]));if(_0x56f862&&_0x56f862[_0xb736('0x47')]){logger['info'](_0xb736('0x48'),_0xb736('0x49'));_0x3ea15f['recordingURL']=_0x497db5;}else if(_0x53c6e2&&_0x53c6e2[_0xb736('0x4a')]&&_0x53c6e2[_0xb736('0x4a')]!==_0xb736('0x4b')){logger[_0xb736('0xf')](_0xb736('0x4c'),_0xb736('0x49'));_0x3ea15f[_0xb736('0x4d')]=_0x497db5;}else{_0x3ea15f[_0xb736('0x4d')]='';}return getAdminId(_0x115672,_0x52138b,_0x1fb3f6,_0x24b0f2)['then'](getUser(_0x52138b,_0x1fb3f6,_0x24b0f2))[_0xb736('0x11')](getEndUser(_0x52138b,_0x1fb3f6,_0x24b0f2))[_0xb736('0x11')](getTicket(_0x52138b,_0x1fb3f6,_0x24b0f2,_0x4db4fa,_0x3ea15f))['then'](function(_0x406bdc){logger['info'](util[_0xb736('0x23')](_0xb736('0x4e'),_0x406bdc[_0xb736('0x35')]));if(_0x52138b!==_0xb736('0x42')){logger[_0xb736('0xf')]('['+[_0x52138b[_0xb736('0x1a')]()]+']',_0xb736('0x4f'));emit(_0x24b0f2,_0x5d0a18[_0xb736('0x50')],_0x406bdc[_0xb736('0x27')]);}})[_0xb736('0x18')](function(_0x3fd07f){logger[_0xb736('0x19')]('['+[_0x52138b[_0xb736('0x1a')]()]+_0xb736('0x51'),util[_0xb736('0x52')](_0x3fd07f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9f2c=['../../../../config/environment','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','error','message','GET','/api/lookup?q=','&f=','contacts','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','Contact','add','ticketId','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util'];(function(_0x4db299,_0x3194d7){var _0xbeae9b=function(_0x426649){while(--_0x426649){_0x4db299['push'](_0x4db299['shift']());}};_0xbeae9b(++_0x3194d7);}(_0x9f2c,0x135));var _0xc9f2=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0x9f2c[_0xc144be];return _0x4ffd89;};'use strict';var _=require(_0xc9f2('0x0'));var rp=require(_0xc9f2('0x1'));var md5=require(_0xc9f2('0x2'));var util=require('util');var moment=require(_0xc9f2('0x3'));var Promise=require(_0xc9f2('0x4'));var Redis=require(_0xc9f2('0x5'));var intUtil=require(_0xc9f2('0x6'));var config=require(_0xc9f2('0x7'));var logger=require('../../../../config/logger')('freshsales');config[_0xc9f2('0x8')]=_['defaults'](config[_0xc9f2('0x8')],{'host':_0xc9f2('0x9'),'port':0x18eb});var io=require(_0xc9f2('0xa'))(new Redis(config[_0xc9f2('0x8')]));function getAdminId(_0x3ed4f6,_0x2221f3,_0x1f58b3,_0x584e15){return new Promise(function(_0x1aab65,_0x359c04){var _0x364c24=![];var _0xb2d68d={'method':'GET','uri':_0x584e15+_0xc9f2('0xb'),'json':!![]};_0xb2d68d[_0xc9f2('0xc')]=_0x1f58b3;logger[_0xc9f2('0xd')](_0xc9f2('0xe'));return rp(_0xb2d68d)[_0xc9f2('0xf')](function(_0x90d69f){if(_0x90d69f){var _0x1679ea=_0x90d69f[_0xc9f2('0x10')];var _0x471ed6=null;for(_0x471ed6=0x0;_0x471ed6<_0x1679ea['length'];_0x471ed6++){if(_0x1679ea[_0x471ed6][_0xc9f2('0x11')]===_0x3ed4f6['adminEmail']){_0x3ed4f6[_0xc9f2('0x12')]=_0x1679ea[_0x471ed6]['id'];_0x364c24=!![];}}if(_0x364c24){logger[_0xc9f2('0xd')](_0xc9f2('0x13'),_0x3ed4f6['adminId']);_0x1aab65(_0x3ed4f6);}else{_0x359c04({'statusCode':0x194,'message':_0xc9f2('0x14')});}}else{_0x359c04({'statusCode':0x194,'message':_0xc9f2('0x14')});}})[_0xc9f2('0x15')](function(_0x9f46d8){logger['error']('['+[_0x2221f3[_0xc9f2('0x16')]()]+']',_0x9f46d8['message']);_0x359c04(_0x9f46d8);});});}function getUser(_0x4ca4ae,_0x1ec731,_0x33fae0){return function(_0x39bb3d){return new Promise(function(_0x5634c7,_0x18d687){var _0x41b17e={'method':'GET','uri':_0x33fae0+_0xc9f2('0xb'),'json':!![]};_0x41b17e[_0xc9f2('0xc')]=_0x1ec731;logger[_0xc9f2('0xd')](_0xc9f2('0x17'));return rp(_0x41b17e)[_0xc9f2('0xf')](function(_0x2bc830){if(_0x2bc830){var _0x4e74ff=_0x2bc830[_0xc9f2('0x10')];var _0x59721d=![];var _0x4e42ae=null;if(_0x39bb3d[_0xc9f2('0x18')]!==null){logger[_0xc9f2('0xd')](_0xc9f2('0x19'),_0x39bb3d[_0xc9f2('0x18')]);_0x39bb3d[_0xc9f2('0x1a')]=_0x39bb3d[_0xc9f2('0x18')];for(_0x4e42ae=0x0;_0x4e42ae<_0x4e74ff[_0xc9f2('0x1b')];_0x4e42ae++){if(_0x4e74ff[_0x4e42ae][_0xc9f2('0x11')]===_0x39bb3d[_0xc9f2('0x18')]){_0x59721d=!![];_0x39bb3d[_0xc9f2('0x1c')]=_0x4e74ff[_0x4e42ae]['id'];logger[_0xc9f2('0xd')](_0xc9f2('0x1d'),_0x39bb3d[_0xc9f2('0x1c')]);}}}if(!_0x59721d){logger['info'](_0xc9f2('0x1e'));_0x39bb3d['userEmail']=_0x39bb3d['adminEmail'];_0x39bb3d[_0xc9f2('0x1c')]=_0x39bb3d[_0xc9f2('0x12')];_0x59721d=!![];}if(_0x59721d){_0x5634c7(_0x39bb3d);}else{_0x18d687({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x18d687({'statusCode':0x194,'message':_0xc9f2('0x14')});}})[_0xc9f2('0x15')](function(_0x37288f){logger[_0xc9f2('0x1f')]('['+[_0x4ca4ae['toUpperCase']()]+']',_0x37288f[_0xc9f2('0x20')]);_0x18d687(_0x37288f);});});};}function searchContact(_0x1781c1,_0x50b9c4,_0x582946,_0x1d510e){return new Promise(function(_0x3700d7,_0x376c46){var _0xd65973={'method':_0xc9f2('0x21'),'headers':_0x50b9c4,'uri':_0x1781c1+_0xc9f2('0x22')+_0x1d510e+_0xc9f2('0x23')+_0x582946+'&entities=contact','json':!![]};rp(_0xd65973)[_0xc9f2('0xf')](function(_0x5544bc){var _0x142e74=_['find'](_0x5544bc[_0xc9f2('0x24')][_0xc9f2('0x24')],[_0x582946,_0x1d510e]);_0x3700d7(_0x142e74);})[_0xc9f2('0x15')](function(_0x57ca85){_0x376c46(_0x57ca85);});});}function getEndUser(_0x3c9644,_0x55c3e4,_0x44eee7){return function(_0x972b76){return new Promise(function(_0x5e7a93,_0x56e921){logger[_0xc9f2('0xd')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x972b76['contactNumber']));searchContact(_0x44eee7,_0x55c3e4,_0xc9f2('0x25'),_0x972b76[_0xc9f2('0x26')])[_0xc9f2('0xf')](function(_0x5b6f5d){if(_0x5b6f5d){_0x972b76[_0xc9f2('0x27')]=_0x5b6f5d['id'];logger['info'](_0xc9f2('0x28'),_0x972b76[_0xc9f2('0x27')]);return _0x5e7a93(_0x972b76);}searchContact(_0x44eee7,_0x55c3e4,'work_number',_0x972b76['contactNumber'])[_0xc9f2('0xf')](function(_0x5a7254){if(_0x5a7254){_0x972b76[_0xc9f2('0x27')]=_0x5a7254['id'];logger[_0xc9f2('0xd')](_0xc9f2('0x29'),_0x972b76[_0xc9f2('0x27')]);return _0x5e7a93(_0x972b76);}createEndUser(_0x972b76,_0x3c9644,_0x55c3e4,_0x44eee7)[_0xc9f2('0xf')](function(_0x30f527){logger[_0xc9f2('0xd')](_0xc9f2('0x2a'),_0x30f527['endUserId']);return _0x5e7a93(_0x30f527);});});})[_0xc9f2('0x15')](function(_0x255e3f){_0x56e921(_0x255e3f);});});};}function createEndUser(_0x56ab75,_0xd5df60,_0x493ae9,_0x245e67){return new Promise(function(_0x4aa8fb,_0x3e7069){var _0x1946dd=moment();var _0x476aa5={'method':'POST','uri':_0x245e67+_0xc9f2('0x2b'),'body':{'contact':{'last_name':_0x56ab75[_0xc9f2('0x26')],'work_number':_0x56ab75[_0xc9f2('0x26')],'mobile_number':_0x56ab75['contactNumber'],'owner_id':_0x56ab75[_0xc9f2('0x1c')],'created_at':_0x1946dd[_0xc9f2('0x2c')](_0xc9f2('0x2d'))}},'json':!![]};_0x476aa5[_0xc9f2('0xc')]=_0x493ae9;logger[_0xc9f2('0xd')](_0xc9f2('0x2e'));return rp(_0x476aa5)[_0xc9f2('0xf')](function(_0x2b064c){_0x56ab75[_0xc9f2('0x27')]=_0x2b064c['contact']['id'];_0x4aa8fb(_0x56ab75);})[_0xc9f2('0x15')](function(_0x59f662){logger[_0xc9f2('0x1f')]('['+[_0xd5df60[_0xc9f2('0x16')]()]+']',_0x59f662[_0xc9f2('0x20')]);_0x3e7069(_0x59f662[_0xc9f2('0x20')]);});});}function getTicket(_0x534b60,_0x5c3f77,_0x663cb4,_0x23ae0c,_0x4ea1ae){return function(_0x1f78d2){logger[_0xc9f2('0xd')](_0xc9f2('0x2f'));return new Promise(function(_0x1826c7,_0x254695){var _0x359d9d=moment();var _0x1f9956={'method':_0xc9f2('0x30'),'uri':_0x663cb4+_0xc9f2('0x31'),'body':{'title':intUtil[_0xc9f2('0x32')](_0x23ae0c['Subjects'],_0x4ea1ae,'\x20'),'description':intUtil[_0xc9f2('0x32')](_0x23ae0c[_0xc9f2('0x33')],_0x4ea1ae,'\x0a'),'owner_id':_0x1f78d2[_0xc9f2('0x1c')],'creater_id':_0x1f78d2[_0xc9f2('0x12')],'targetable_id':_0x1f78d2[_0xc9f2('0x27')],'targetable_type':_0xc9f2('0x34'),'created_at':_0x359d9d['format'](_0xc9f2('0x2d')),'due_date':_0x359d9d[_0xc9f2('0x35')](0x1e,'m')[_0xc9f2('0x2c')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1f9956[_0xc9f2('0xc')]=_0x5c3f77;return rp(_0x1f9956)['then'](function(_0x281a84){_0x1f78d2[_0xc9f2('0x36')]=_0x281a84['task']['id'];logger[_0xc9f2('0xd')](_0xc9f2('0x37'),_0x1f78d2[_0xc9f2('0x36')]);_0x1826c7(_0x1f78d2);})[_0xc9f2('0x15')](function(_0x507579){logger[_0xc9f2('0x1f')]('['+[_0x534b60[_0xc9f2('0x16')]()]+']',_0x507579[_0xc9f2('0x20')]);_0x254695(_0x507579[_0xc9f2('0x20')]);});});};}function emit(_0x346a99,_0x1bff8d,_0x2ba089){var _0xf05204={'uri':_0x346a99+'/contacts/'+_0x2ba089};io['to'](util[_0xc9f2('0x2c')](_0xc9f2('0x38'),_0x1bff8d))['emit'](_0xc9f2('0x39'),_0xf05204);}exports['cs']=function(_0x4bc427,_0x7048,_0x27b326,_0x5ed969,_0x332d4a,_0x47867a,_0x4681cd,_0x1b1606){var _0x7adb7c={};var _0x16a619={'Authorization':_0xc9f2('0x3a')+_0x47867a[_0xc9f2('0x3b')]};_0x47867a[_0xc9f2('0x3c')]=intUtil[_0xc9f2('0x3d')](_0x47867a[_0xc9f2('0x3c')]);_0x47867a[_0xc9f2('0x3e')]=intUtil[_0xc9f2('0x3d')](_0x47867a[_0xc9f2('0x3e')]);var _0x83e87a=_0x47867a['remoteUri'];_0x7adb7c['adminEmail']=_0x47867a['username'];_0x7adb7c[_0xc9f2('0x26')]=_0x1b1606['toLowerCase']()==='outbound'?_0x7048[_0xc9f2('0x3f')]:_0x7048[_0xc9f2('0x40')];_0x7adb7c[_0xc9f2('0x41')]=_0x1b1606===_0xc9f2('0x42')||_0x1b1606==='unmanaged'?_0xc9f2('0x42'):'outbound';if(_0x5ed969){_0x7adb7c[_0xc9f2('0x18')]=_0x5ed969[_0xc9f2('0x11')];}var _0x5e7230=util[_0xc9f2('0x2c')](_0xc9f2('0x43'),_0x47867a[_0xc9f2('0x3e')],_0x7048[_0xc9f2('0x44')],md5(_0x7048['uniqueid']));if(_0x332d4a&&_0x332d4a[_0xc9f2('0x45')]){logger['info'](_0xc9f2('0x46'),'Recording\x20is\x20enabled!');_0x7048['recordingURL']=_0x5e7230;}else if(_0x4681cd&&_0x4681cd[_0xc9f2('0x47')]&&_0x4681cd[_0xc9f2('0x47')]!==_0xc9f2('0x48')){logger[_0xc9f2('0xd')](_0xc9f2('0x49'),_0xc9f2('0x4a'));_0x7048['recordingURL']=_0x5e7230;}else{_0x7048['recordingURL']='';}return getAdminId(_0x7adb7c,_0x1b1606,_0x16a619,_0x83e87a)[_0xc9f2('0xf')](getUser(_0x1b1606,_0x16a619,_0x83e87a))[_0xc9f2('0xf')](getEndUser(_0x1b1606,_0x16a619,_0x83e87a))[_0xc9f2('0xf')](getTicket(_0x1b1606,_0x16a619,_0x83e87a,_0x27b326,_0x7048))[_0xc9f2('0xf')](function(_0x2c953e){logger[_0xc9f2('0xd')](util[_0xc9f2('0x2c')](_0xc9f2('0x4b'),_0x2c953e['ticketId']));if(_0x1b1606!=='unmanaged'){logger[_0xc9f2('0xd')]('['+[_0x1b1606[_0xc9f2('0x16')]()]+']',_0xc9f2('0x4c'));emit(_0x83e87a,_0x5ed969[_0xc9f2('0x4d')],_0x2c953e[_0xc9f2('0x27')]);}})[_0xc9f2('0x15')](function(_0x3d0fd5){logger['error']('['+[_0x1b1606[_0xc9f2('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc9f2('0x4e')](_0x3d0fd5,{'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 df255a1..7abd74e 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 _0x1375=['%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','zoho','desk','dynamics365','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format'];(function(_0x58ff1d,_0x3c89bb){var _0x9512ff=function(_0x225ff5){while(--_0x225ff5){_0x58ff1d['push'](_0x58ff1d['shift']());}};_0x9512ff(++_0x3c89bb);}(_0x1375,0x15f));var _0x5137=function(_0x4984a0,_0x409802){_0x4984a0=_0x4984a0-0x0;var _0x43a629=_0x1375[_0x4984a0];return _0x43a629;};'use strict';var _=require('lodash');var util=require(_0x5137('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x5137('0x1'));var sugarcrm=require(_0x5137('0x2'));var freshdesk=require(_0x5137('0x3'));var zoho=require(_0x5137('0x4'));var desk=require('./desk');var vtiger=require(_0x5137('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x5137('0x6'));var freshsales=require(_0x5137('0x7'));var integrations=[_0x5137('0x8'),_0x5137('0x9'),'sugarcrm','freshdesk',_0x5137('0xa'),_0x5137('0xb'),'vtiger',_0x5137('0xc'),'freshsales',_0x5137('0xd')];exports[_0x5137('0xe')]=function(_0x3c591e,_0x190152,_0x46d5f0,_0x908e99,_0x1c2dcd,_0x45d55f){if(_0x46d5f0){if(_[_0x5137('0xf')](integrations,_0x3c591e[_0x5137('0x10')][_0x5137('0x11')]())){try{var _0x193981=null;var _0x4052e5='';var _0x328ec3=_0x46d5f0[_0x3c591e[_0x5137('0x10')][_0x5137('0x11')]()];if(_0x328ec3){var _0x47b647=_0x328ec3[_0x3c591e['data2']];if(_0x47b647){var _0x42b9ae=_[_0x5137('0x12')](_0x47b647[_0x5137('0x13')],{'id':parseInt(_0x3c591e[_0x5137('0x14')],0xa)});if(_0x42b9ae){if(_0x908e99){if(_0x1c2dcd&&_0x190152['queue']){_0x4052e5=_0x5137('0x15');}else if(_0x190152['routeId']){_0x4052e5=_0x5137('0x16');}else{console[_0x5137('0x17')](_0x5137('0x18'),_0x190152);}}else{_0x4052e5=_0x5137('0x19');}switch(_0x3c591e[_0x5137('0x10')][_0x5137('0x11')]()){case'zendesk':zendesk[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case _0x5137('0x9'):salesforce[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case'sugarcrm':sugarcrm[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case _0x5137('0x1a'):freshdesk[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case'zoho':zoho[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case _0x5137('0xb'):desk[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case'vtiger':vtiger[_0x4052e5](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f);break;case _0x5137('0x1b'):freshsales['cs'](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f,_0x4052e5);break;case _0x5137('0xd'):servicenow['cs'](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f,_0x4052e5);break;case'dynamics365':dynamics365['cs'](_0x3c591e,_0x190152,_0x42b9ae,_0x908e99,_0x1c2dcd,_0x47b647,_0x45d55f,_0x4052e5);break;default:console[_0x5137('0x17')](_0x5137('0x1c'));}}else{_0x193981=require(_0x5137('0x1d'))(_0x3c591e[_0x5137('0x10')][_0x5137('0x11')]());_0x193981[_0x5137('0x1e')](_0x5137('0x1f'),util['format'](_0x5137('0x20'),_0x3c591e[_0x5137('0x10')][_0x5137('0x11')](),_0x3c591e[_0x5137('0x14')]));}}else{_0x193981=require('../../../../config/logger')(_0x3c591e[_0x5137('0x10')]['toLowerCase']());_0x193981[_0x5137('0x1e')](_0x5137('0x1f'),util[_0x5137('0x21')](_0x5137('0x22'),_0x3c591e[_0x5137('0x10')]['toLowerCase'](),_0x3c591e['data2']));}}else{}}catch(_0xf66d77){console['error'](_0xf66d77);}}}}; \ No newline at end of file +var _0xeedb=['./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','desk','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk'];(function(_0x4a5294,_0x5c82e4){var _0x53d0a0=function(_0x1d394b){while(--_0x1d394b){_0x4a5294['push'](_0x4a5294['shift']());}};_0x53d0a0(++_0x5c82e4);}(_0xeedb,0x159));var _0xbeed=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeedb[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xbeed('0x0'));var util=require('util');var zendesk=require(_0xbeed('0x1'));var salesforce=require(_0xbeed('0x2'));var sugarcrm=require(_0xbeed('0x3'));var freshdesk=require(_0xbeed('0x4'));var zoho=require(_0xbeed('0x5'));var desk=require(_0xbeed('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xbeed('0x7'));var dynamics365=require(_0xbeed('0x8'));var freshsales=require(_0xbeed('0x9'));var integrations=[_0xbeed('0xa'),_0xbeed('0xb'),'sugarcrm',_0xbeed('0xc'),_0xbeed('0xd'),'desk','vtiger',_0xbeed('0xe'),_0xbeed('0xf'),_0xbeed('0x10')];exports['exec']=function(_0xc7d0b7,_0x5adab3,_0x93512f,_0x12cf50,_0x397f83,_0x53a577){if(_0x93512f){if(_[_0xbeed('0x11')](integrations,_0xc7d0b7['data1']['toLowerCase']())){try{var _0x5c4928=null;var _0x34d612='';var _0x1ab954=_0x93512f[_0xc7d0b7[_0xbeed('0x12')][_0xbeed('0x13')]()];if(_0x1ab954){var _0x26fe6c=_0x1ab954[_0xc7d0b7[_0xbeed('0x14')]];if(_0x26fe6c){var _0x2672eb=_[_0xbeed('0x15')](_0x26fe6c[_0xbeed('0x16')],{'id':parseInt(_0xc7d0b7[_0xbeed('0x17')],0xa)});if(_0x2672eb){if(_0x12cf50){if(_0x397f83&&_0x5adab3[_0xbeed('0x18')]){_0x34d612=_0xbeed('0x18');}else if(_0x5adab3['routeId']){_0x34d612='outbound';}else{console[_0xbeed('0x19')](_0xbeed('0x1a'),_0x5adab3);}}else{_0x34d612='unmanaged';}switch(_0xc7d0b7[_0xbeed('0x12')][_0xbeed('0x13')]()){case _0xbeed('0xa'):zendesk[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case _0xbeed('0xb'):salesforce[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case'sugarcrm':sugarcrm[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case'freshdesk':freshdesk[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case _0xbeed('0xd'):zoho[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case _0xbeed('0x1b'):desk[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case'vtiger':vtiger[_0x34d612](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577);break;case _0xbeed('0xf'):freshsales['cs'](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577,_0x34d612);break;case _0xbeed('0x10'):servicenow['cs'](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577,_0x34d612);break;case _0xbeed('0xe'):dynamics365['cs'](_0xc7d0b7,_0x5adab3,_0x2672eb,_0x12cf50,_0x397f83,_0x26fe6c,_0x53a577,_0x34d612);break;default:console['log'](_0xbeed('0x1c'));}}else{_0x5c4928=require(_0xbeed('0x1d'))(_0xc7d0b7[_0xbeed('0x12')][_0xbeed('0x13')]());_0x5c4928[_0xbeed('0x1e')]('[EXEC]',util[_0xbeed('0x1f')](_0xbeed('0x20'),_0xc7d0b7[_0xbeed('0x12')]['toLowerCase'](),_0xc7d0b7['data3']));}}else{_0x5c4928=require(_0xbeed('0x1d'))(_0xc7d0b7[_0xbeed('0x12')][_0xbeed('0x13')]());_0x5c4928[_0xbeed('0x1e')](_0xbeed('0x21'),util[_0xbeed('0x1f')](_0xbeed('0x22'),_0xc7d0b7['data1'][_0xbeed('0x13')](),_0xc7d0b7[_0xbeed('0x14')]));}}else{}}catch(_0x1fb547){console[_0xbeed('0x1e')](_0x1fb547);}}}}; \ 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 f8a3dd2..02ce34b 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 _0x6227=['idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','salesforce','defaults','localhost','socket.io-emitter','redis','emit','getString','Descriptions','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','ticketType','Case','ContactId','account','AccountId','leadId','info','sobject','isNil','validateEmail','User','execute','length','find','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','Contact','first','Phone','attributes','type','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','upperFirst','create','includes','string','picklist'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x6227,0xad));var _0x7622=function(_0x191975,_0x29420f){_0x191975=_0x191975-0x0;var _0xf99757=_0x6227[_0x191975];return _0xf99757;};'use strict';var _=require('lodash');var rp=require(_0x7622('0x0'));var moment=require(_0x7622('0x1'));var BPromise=require(_0x7622('0x2'));var md5=require(_0x7622('0x3'));var jsforce=require(_0x7622('0x4'));var util=require(_0x7622('0x5'));var Redis=require(_0x7622('0x6'));var intUtil=require('./util');var config=require(_0x7622('0x7'));var logger=require('../../../../config/logger')(_0x7622('0x8'));config['redis']=_[_0x7622('0x9')](config['redis'],{'host':_0x7622('0xa'),'port':0x18eb});var io=require(_0x7622('0xb'))(new Redis(config[_0x7622('0xc')]));function emit(_0x3d6c23,_0x1913b0,_0x259faf){io['to'](_0x3d6c23)[_0x7622('0xd')](_0x1913b0,_0x259faf);}function getTicket(_0xddcd8c,_0x5e0fa9,_0xa220ff,_0x5a99bb,_0x5bf9d1,_0x53f992,_0x46d2c5,_0x21c455){var _0x5a4a5d=Object['assign']({},{'OwnerId':_0x5e0fa9['id'],'Subject':intUtil[_0x7622('0xe')](_0x5a99bb['Subjects'],_0x5bf9d1,'\x20'),'Description':intUtil[_0x7622('0xe')](_0x5a99bb[_0x7622('0xf')],_0x5bf9d1,'\x0a')},getCustomFields(_0x53f992,_0x5bf9d1));if(_0xa220ff){if(_0x5a99bb['ticketType']==='Task'){_0x5a4a5d[_0x7622('0x10')]=moment[_0x7622('0x11')]();_0x5a4a5d[_0x7622('0x12')]=![];_0x5a4a5d['IsRecurrence']=![];if(_0xa220ff[_0x7622('0x13')]===_0x7622('0x14')||_0xa220ff[_0x7622('0x13')]===_0x7622('0x15')){_0x5a4a5d[_0x7622('0x16')]=_0xa220ff['id'];}else if(_0xa220ff[_0x7622('0x13')]==='account'){_0x5a4a5d['WhatId']=_0xa220ff['id'];}}else if(_0x5a99bb[_0x7622('0x17')]===_0x7622('0x18')){if(_0xa220ff[_0x7622('0x13')]===_0x7622('0x14')){_0x5a4a5d[_0x7622('0x19')]=_0xa220ff['id'];}else if(_0xa220ff[_0x7622('0x13')]===_0x7622('0x1a')){_0x5a4a5d[_0x7622('0x1b')]=_0xa220ff['id'];}else if(_0xa220ff['endUserType']==='lead'&&_0x5a99bb[_0x7622('0x1c')]){_0x5a4a5d[_0x5a99bb[_0x7622('0x1c')]]=_0xa220ff['id'];}else{logger[_0x7622('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x46d2c5[_0x7622('0x1e')](_0x5a99bb[_0x7622('0x17')])['create'](_0x5a4a5d);}function getUser(_0x578696,_0x12d238,_0x4db8d6){if(!_[_0x7622('0x1f')](_0x12d238)&&intUtil[_0x7622('0x20')](_0x12d238)){var _0x5935c6={'Email':_0x12d238};var _0x39a108={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4db8d6[_0x7622('0x1e')](_0x7622('0x21'))['find'](_0x5935c6,_0x39a108)[_0x7622('0x22')]()['then'](function(_0x4b46fb){if(_0x4b46fb[_0x7622('0x23')]){var _0x3bf3d9=_[_0x7622('0x24')](_0x4b46fb,function(_0x468b81){return _0x468b81['Email']===_0x12d238;});if(_0x3bf3d9){logger[_0x7622('0x1d')]('Agent\x20%s\x20found.',_0x12d238);return BPromise[_0x7622('0x25')]({'id':_0x3bf3d9['Id'],'name':_0x3bf3d9[_0x7622('0x26')]});}}else{logger[_0x7622('0x1d')](_0x7622('0x27'),_0x12d238);return _0x4db8d6[_0x7622('0x28')]()['then'](function(_0x31ddc6){return BPromise[_0x7622('0x25')]({'id':_0x31ddc6[_0x7622('0x29')],'name':_0x31ddc6[_0x7622('0x2a')]});});}});}else{logger[_0x7622('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x12d238);return _0x4db8d6[_0x7622('0x28')]()['then'](function(_0x1f846a){return BPromise[_0x7622('0x25')]({'id':_0x1f846a[_0x7622('0x29')],'name':_0x1f846a['display_name']});});}}function getEndUser(_0x5c898f,_0x5e790e,_0x4e81ad,_0x405b30,_0x4d15e3){var _0x2025c6={'$or':{'Phone':_0x405b30}};var _0x5bcc5c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x7622('0x2b')](function(){logger['info'](_0x7622('0x2c'),_0x405b30,_0x5e790e[_0x7622('0x2d')]);switch(_0x5e790e[_0x7622('0x2d')]){case _0x7622('0x2e'):var _0x558a19=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e['additionalSearchContact']){var _0x34d999={};_0x34d999[_0x5e790e['additionalSearchContact']]=_0x405b30;_[_0x7622('0x30')](_0x558a19[_0x7622('0x31')],_0x34d999);}return _0x4d15e3['sobject']('Contact')['find'](_0x558a19,_0x5bcc5c)[_0x7622('0x22')]()[_0x7622('0x2b')](function(_0x895690){if(_0x895690&&_0x895690[_0x7622('0x23')]){return _0x895690;}else{var _0x35f7f0=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e[_0x7622('0x32')]){var _0x4a2000={};_0x4a2000[_0x5e790e[_0x7622('0x32')]]=_0x405b30;_[_0x7622('0x30')](_0x35f7f0[_0x7622('0x31')],_0x4a2000);}return _0x4d15e3[_0x7622('0x1e')](_0x7622('0x33'))[_0x7622('0x24')](_0x35f7f0,_0x5bcc5c);}});case _0x7622('0x34'):var _0x3c4658=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e[_0x7622('0x35')]){var _0x34d999={};_0x34d999[_0x5e790e['additionalSearchAccount']]=_0x405b30;_[_0x7622('0x30')](_0x3c4658[_0x7622('0x31')],_0x34d999);}return _0x4d15e3[_0x7622('0x1e')](_0x7622('0x36'))['find'](_0x3c4658,_0x5bcc5c)[_0x7622('0x22')]()[_0x7622('0x2b')](function(_0x2f2d88){if(_0x2f2d88&&_0x2f2d88[_0x7622('0x23')]){return _0x2f2d88;}else{var _0x1e21b8=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e[_0x7622('0x37')]){var _0x55a385={};_0x55a385[_0x5e790e[_0x7622('0x37')]]=_0x405b30;_[_0x7622('0x30')](_0x1e21b8[_0x7622('0x31')],_0x55a385);}return _0x4d15e3[_0x7622('0x1e')]('Contact')[_0x7622('0x24')](_0x1e21b8,_0x5bcc5c)['then'](function(_0x38f686){if(_0x38f686&&_0x38f686[_0x7622('0x23')]){return _0x38f686;}else{var _0x2ef568=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e['additionalSearchLead']){var _0x295ef8={};_0x295ef8[_0x5e790e[_0x7622('0x32')]]=_0x405b30;_['merge'](_0x2ef568['$or'],_0x295ef8);}return _0x4d15e3[_0x7622('0x1e')](_0x7622('0x33'))[_0x7622('0x24')](_0x2ef568,_0x5bcc5c);}});}});case _0x7622('0x14'):var _0x558a19=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e[_0x7622('0x37')]){var _0x34d999={};_0x34d999[_0x5e790e[_0x7622('0x37')]]=_0x405b30;_[_0x7622('0x30')](_0x558a19[_0x7622('0x31')],_0x34d999);}return _0x4d15e3[_0x7622('0x1e')](_0x7622('0x38'))[_0x7622('0x24')](_0x558a19,_0x5bcc5c)['execute']();case _0x7622('0x15'):var _0x2c8c23=_[_0x7622('0x2f')](_0x2025c6);if(_0x5e790e[_0x7622('0x32')]){var _0x34d999={};_0x34d999[_0x5e790e['additionalSearchLead']]=_0x405b30;_[_0x7622('0x30')](_0x2c8c23[_0x7622('0x31')],_0x34d999);}return _0x4d15e3[_0x7622('0x1e')]('Lead')[_0x7622('0x24')](_0x2c8c23,_0x5bcc5c);case _0x7622('0x1a'):var _0x3c4658=_['cloneDeep'](_0x2025c6);if(_0x5e790e[_0x7622('0x35')]){var _0x34d999={};_0x34d999[_0x5e790e[_0x7622('0x35')]]=_0x405b30;_[_0x7622('0x30')](_0x3c4658[_0x7622('0x31')],_0x34d999);}return _0x4d15e3[_0x7622('0x1e')]('Account')[_0x7622('0x24')](_0x3c4658,_0x5bcc5c);default:return null;}})[_0x7622('0x2b')](function(_0x59584b){if(_0x59584b&&_0x59584b[_0x7622('0x23')]){var _0x42d377=_[_0x7622('0x39')](_0x59584b);if(_0x42d377){return BPromise['resolve']({'id':_0x42d377['Id'],'name':_0x42d377[_0x7622('0x26')],'phone':_0x42d377[_0x7622('0x3a')],'endUserType':_0x42d377[_0x7622('0x3b')][_0x7622('0x3c')]['toLowerCase']()});}}})[_0x7622('0x2b')](function(_0x3786b3){if(_0x3786b3){logger['info'](_0x7622('0x3d'),_0x3786b3[_0x7622('0x13')],_0x405b30);return BPromise['resolve'](_0x3786b3);}else{logger[_0x7622('0x1d')](_0x7622('0x3e'),_0x405b30);var _0x7682ee={'Phone':_0x405b30};if(_0x5e790e[_0x7622('0x3f')]){if(_0x5e790e['moduleCreate']===_0x7622('0x14')){logger[_0x7622('0x1d')](_0x7622('0x40'),_0x405b30,_0x5e790e[_0x7622('0x3f')]);_0x7682ee[_0x7622('0x41')]=_0x4e81ad!==_0x7622('0x42')?_0x4e81ad:util[_0x7622('0x43')](_0x7622('0x44'),_0x405b30);}else if(_0x5e790e[_0x7622('0x3f')]==='lead'){logger['info'](_0x7622('0x40'),_0x405b30,_0x5e790e[_0x7622('0x3f')]);_0x7682ee['LastName']=_0x4e81ad!==_0x7622('0x42')?_0x4e81ad:util[_0x7622('0x43')](_0x7622('0x44'),_0x405b30);_0x7682ee[_0x7622('0x45')]='No\x20Company';}else if(_0x5e790e[_0x7622('0x3f')]==='account'){logger[_0x7622('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x405b30,_0x5e790e[_0x7622('0x3f')]);_0x7682ee['Name']=_0x4e81ad!==_0x7622('0x42')?_0x4e81ad:util['format'](_0x7622('0x44'),_0x405b30);}else{return null;}}return _0x4d15e3['sobject'](_[_0x7622('0x46')](_0x5e790e[_0x7622('0x3f')]))[_0x7622('0x47')](_0x7682ee)[_0x7622('0x2b')](function(_0x288615){return BPromise['resolve']({'id':_0x288615['id'],'endUserType':_0x5e790e['moduleCreate']});});}});}function getCustomFields(_0x2d27ef,_0x338eee){var _0x2c42f7={};if(_0x2d27ef['length']>0x0){_['forEach'](_0x2d27ef,function(_0x4f8788){if(_[_0x7622('0x48')]([_0x7622('0x49'),_0x7622('0x4a')],_0x4f8788[_0x7622('0x3c')])&&_0x4f8788[_0x7622('0x4b')]){_0x2c42f7[_0x4f8788[_0x7622('0x4b')]]=_0x4f8788[_0x7622('0x4c')][_0x7622('0x4d')]();}else if(_0x4f8788[_0x7622('0x3c')]===_0x7622('0x4e')&&_0x4f8788[_0x7622('0x4f')]&&_0x4f8788[_0x7622('0x4b')]){_0x338eee[_0x4f8788[_0x7622('0x4f')]]&&(_0x2c42f7[_0x4f8788[_0x7622('0x4b')]]=_0x338eee[_0x4f8788[_0x7622('0x4f')]]['toString']());}else if(_0x4f8788['type']===_0x7622('0x50')&&_0x4f8788[_0x7622('0x51')]&&_0x4f8788[_0x7622('0x51')][_0x7622('0x52')]&&_0x4f8788['idField']){_0x338eee[_0x4f8788[_0x7622('0x51')][_0x7622('0x52')][_0x7622('0x53')]()]&&(_0x2c42f7[_0x4f8788['idField']]=_0x338eee[_0x4f8788['Variable'][_0x7622('0x52')][_0x7622('0x53')]()][_0x7622('0x4d')]());}});}return _0x2c42f7;}function getConnection(_0x12cbf2){var _0x154675=_0x12cbf2[_0x7622('0x54')][_0x7622('0x55')](_0x12cbf2['securityToken']);var _0xa54838=new jsforce[(_0x7622('0x56'))]({'oauth2':{'loginUrl':_0x12cbf2[_0x7622('0x57')]||'https://login.salesforce.com','clientId':_0x12cbf2[_0x7622('0x58')],'clientSecret':_0x12cbf2[_0x7622('0x59')]}});return _0xa54838['login'](_0x12cbf2[_0x7622('0x5a')],_0x154675)[_0x7622('0x2b')](function(){logger[_0x7622('0x1d')](_0x7622('0x5b'));return _0xa54838;});}exports[_0x7622('0x5c')]=function(_0x583b2e,_0x20ad81,_0x1515e9,_0x6dfefc,_0x19db31,_0x22c2f6){var _0x57d423,_0x4875a0,_0x4391d1,_0x279f9b;_0x22c2f6[_0x7622('0x5d')]=intUtil[_0x7622('0x5e')](_0x22c2f6[_0x7622('0x5d')]);_0x22c2f6[_0x7622('0x57')]=intUtil[_0x7622('0x5e')](_0x22c2f6[_0x7622('0x57')]);if(_0x19db31&&_0x19db31[_0x7622('0x5f')]){logger['info'](_0x7622('0x60'),_0x7622('0x61'));_0x20ad81['recordingURL']=util['format'](_0x7622('0x62'),_0x22c2f6[_0x7622('0x5d')],_0x20ad81[_0x7622('0x63')],md5(_0x20ad81[_0x7622('0x63')]));}else{_0x20ad81[_0x7622('0x64')]='';}return getConnection(_0x22c2f6)['then'](function(_0x3aa87d){_0x279f9b=_0x3aa87d;return getUser(_0x22c2f6,_0x6dfefc[_0x7622('0x65')],_0x279f9b);})[_0x7622('0x2b')](function(_0x95df61){_0x57d423=_0x95df61;return getEndUser(_0x22c2f6,_0x1515e9,_0x20ad81['calleridname'],_0x20ad81[_0x7622('0x66')],_0x279f9b);})['then'](function(_0x3b4270){_0x4875a0=_0x3b4270;return getTicket(_0x22c2f6,_0x57d423,_0x4875a0,_0x1515e9,_0x20ad81,_0x1515e9[_0x7622('0x67')],_0x279f9b,_0x7622('0x5c'));})[_0x7622('0x2b')](function(_0x29de2f){_0x4391d1=_0x29de2f;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x4391d1['id']);logger[_0x7622('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4391d1['id'],_0x6dfefc['name'],_0x22c2f6[_0x7622('0x3c')]);switch(_0x22c2f6[_0x7622('0x3c')]){case _0x7622('0x68'):emit(util[_0x7622('0x43')](_0x7622('0x69'),_0x6dfefc['name']),_0x7622('0x6a'),{'recordId':_0x4391d1['id']});break;case'newTab':emit(util[_0x7622('0x43')]('user:%s',_0x6dfefc[_0x7622('0x52')]),_0x7622('0x6b'),{'uri':util[_0x7622('0x43')](_0x7622('0x6c'),_0x279f9b['instanceUrl'],_0x4391d1['id'])});break;default:logger[_0x7622('0x6d')](_0x7622('0x6e'));}})[_0x7622('0x6f')](function(_0x335535){logger[_0x7622('0x6d')]('[QUEUE]',_0x335535);});};exports[_0x7622('0x70')]=function(_0x5e9976,_0x156722,_0x97c4fd,_0x5ee8e1,_0x4cd76b,_0x51db37,_0x8601a4){var _0xdc6922,_0x4e823c,_0x4df8c4,_0x32355c;_0x51db37[_0x7622('0x5d')]=intUtil[_0x7622('0x5e')](_0x51db37['serverUrl']);_0x51db37[_0x7622('0x57')]=intUtil[_0x7622('0x5e')](_0x51db37[_0x7622('0x57')]);if(_0x8601a4&&_0x8601a4[_0x7622('0x71')]&&_0x8601a4['recordingFormat']!=='none'){logger[_0x7622('0x1d')](_0x7622('0x72'),_0x7622('0x61'));_0x156722[_0x7622('0x64')]=util[_0x7622('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51db37[_0x7622('0x5d')],_0x156722['uniqueid'],md5(_0x156722[_0x7622('0x63')]));}return getConnection(_0x51db37)[_0x7622('0x2b')](function(_0x62370c){_0x32355c=_0x62370c;return getUser(_0x51db37,_0x5ee8e1['email'],_0x32355c);})[_0x7622('0x2b')](function(_0x28664e){_0xdc6922=_0x28664e;return getEndUser(_0x51db37,_0x97c4fd,_0x156722[_0x7622('0x73')],_0x156722['destcalleridnum'],_0x32355c);})[_0x7622('0x2b')](function(_0x1999ed){_0x4e823c=_0x1999ed;return getTicket(_0x51db37,_0xdc6922,_0x4e823c,_0x97c4fd,_0x156722,_0x97c4fd[_0x7622('0x67')],_0x32355c,'outbound');})['then'](function(_0x1f3a1c){_0x4df8c4=_0x1f3a1c;logger[_0x7622('0x1d')](_0x7622('0x74'),_0x4df8c4['id']);logger[_0x7622('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4df8c4['id'],_0x5ee8e1[_0x7622('0x52')],_0x51db37[_0x7622('0x3c')]);switch(_0x51db37[_0x7622('0x3c')]){case _0x7622('0x68'):emit(util[_0x7622('0x43')](_0x7622('0x69'),_0x5ee8e1[_0x7622('0x52')]),'trigger:salesforce:display',{'recordId':_0x4df8c4['id']});break;case _0x7622('0x75'):emit(util[_0x7622('0x43')](_0x7622('0x69'),_0x5ee8e1[_0x7622('0x52')]),_0x7622('0x6b'),{'uri':util['format'](_0x7622('0x6c'),_0x32355c[_0x7622('0x76')],_0x4df8c4['id'])});break;default:logger[_0x7622('0x6d')](_0x7622('0x72'),_0x7622('0x77'));}})[_0x7622('0x6f')](function(_0x576890){logger[_0x7622('0x6d')](_0x7622('0x72'),_0x576890);});};exports['unmanaged']=function(_0x5f5943,_0x2397f,_0x2d0ad2,_0x23c790,_0x5f5436,_0x374304){var _0x7e026e,_0x16f781,_0x275670,_0x585640;_0x374304[_0x7622('0x5d')]=intUtil['stripTrailingSlash'](_0x374304['serverUrl']);_0x374304[_0x7622('0x57')]=intUtil[_0x7622('0x5e')](_0x374304['remoteUri']);if(_0x5f5436&&_0x5f5436[_0x7622('0x5f')]){logger[_0x7622('0x1d')]('['+_0x2397f[_0x7622('0x78')][_0x7622('0x79')]()+']',_0x7622('0x61'));_0x2397f['recordingURL']=util[_0x7622('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x374304[_0x7622('0x5d')],_0x2397f[_0x7622('0x63')],md5(_0x2397f[_0x7622('0x63')]));}else{_0x2397f['recordingURL']='';}return getConnection(_0x374304)[_0x7622('0x2b')](function(_0x59889a){_0x585640=_0x59889a;if(!_[_0x7622('0x1f')](_0x23c790)){return getUser(_0x374304,_0x23c790[_0x7622('0x52')],_0x585640);}else{return getUser(_0x374304,null,_0x585640);}})[_0x7622('0x2b')](function(_0x7ed8e4){_0x7e026e=_0x7ed8e4;return getEndUser(_0x374304,_0x2d0ad2,_0x2397f[_0x7622('0x7a')],_0x2397f[_0x7622('0x66')],_0x585640);})[_0x7622('0x2b')](function(_0x265c4d){_0x16f781=_0x265c4d;return getTicket(_0x374304,_0x7e026e,_0x16f781,_0x2d0ad2,_0x2397f,_0x2d0ad2[_0x7622('0x67')],_0x585640);})[_0x7622('0x2b')](function(_0x1d8ee6){_0x275670=_0x1d8ee6;logger[_0x7622('0x1d')]('['+_0x2397f[_0x7622('0x78')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x275670['id']);logger[_0x7622('0x1d')]('['+_0x2397f['lastevent'][_0x7622('0x79')]()+_0x7622('0x7b'),_0x374304[_0x7622('0x3c')]);})[_0x7622('0x6f')](function(_0x1c89dd){logger[_0x7622('0x6d')]('['+_0x2397f['lastevent'][_0x7622('0x79')]()+']',_0x1c89dd);});}; \ No newline at end of file +var _0x7d7b=['moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','length','additionalSearchLead','$or','Lead','additionalSearchAccount','Account','contact','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','create','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','calleridname','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','../../../../config/environment','salesforce','defaults','redis','socket.io-emitter','emit','Subjects','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','find','execute','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','user_id'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0x7d7b,0x1ac));var _0xb7d7=function(_0x273d9e,_0x2aba6c){_0x273d9e=_0x273d9e-0x0;var _0x37f715=_0x7d7b[_0x273d9e];return _0x37f715;};'use strict';var _=require('lodash');var rp=require(_0xb7d7('0x0'));var moment=require(_0xb7d7('0x1'));var BPromise=require(_0xb7d7('0x2'));var md5=require(_0xb7d7('0x3'));var jsforce=require('jsforce');var util=require(_0xb7d7('0x4'));var Redis=require(_0xb7d7('0x5'));var intUtil=require('./util');var config=require(_0xb7d7('0x6'));var logger=require('../../../../config/logger')(_0xb7d7('0x7'));config['redis']=_[_0xb7d7('0x8')](config[_0xb7d7('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb7d7('0xa'))(new Redis(config['redis']));function emit(_0x8ee536,_0x1a4cec,_0x46a73f){io['to'](_0x8ee536)[_0xb7d7('0xb')](_0x1a4cec,_0x46a73f);}function getTicket(_0x149c46,_0xc0f8a8,_0x41549b,_0x117ffd,_0x24edbd,_0xc00d24,_0x5449ac,_0x58aade){var _0x238f49=Object['assign']({},{'OwnerId':_0xc0f8a8['id'],'Subject':intUtil['getString'](_0x117ffd[_0xb7d7('0xc')],_0x24edbd,'\x20'),'Description':intUtil['getString'](_0x117ffd['Descriptions'],_0x24edbd,'\x0a')},getCustomFields(_0xc00d24,_0x24edbd));if(_0x41549b){if(_0x117ffd[_0xb7d7('0xd')]===_0xb7d7('0xe')){_0x238f49[_0xb7d7('0xf')]=moment[_0xb7d7('0x10')]();_0x238f49['IsReminderSet']=![];_0x238f49[_0xb7d7('0x11')]=![];if(_0x41549b[_0xb7d7('0x12')]==='contact'||_0x41549b['endUserType']===_0xb7d7('0x13')){_0x238f49[_0xb7d7('0x14')]=_0x41549b['id'];}else if(_0x41549b[_0xb7d7('0x12')]===_0xb7d7('0x15')){_0x238f49['WhatId']=_0x41549b['id'];}}else if(_0x117ffd[_0xb7d7('0xd')]==='Case'){if(_0x41549b[_0xb7d7('0x12')]==='contact'){_0x238f49['ContactId']=_0x41549b['id'];}else if(_0x41549b[_0xb7d7('0x12')]===_0xb7d7('0x15')){_0x238f49[_0xb7d7('0x16')]=_0x41549b['id'];}else if(_0x41549b[_0xb7d7('0x12')]===_0xb7d7('0x13')&&_0x117ffd[_0xb7d7('0x17')]){_0x238f49[_0x117ffd[_0xb7d7('0x17')]]=_0x41549b['id'];}else{logger[_0xb7d7('0x18')](_0xb7d7('0x19'));}}}return _0x5449ac[_0xb7d7('0x1a')](_0x117ffd['ticketType'])['create'](_0x238f49);}function getUser(_0x1eb2e5,_0x4d0466,_0x24cbbe){if(!_[_0xb7d7('0x1b')](_0x4d0466)&&intUtil['validateEmail'](_0x4d0466)){var _0x905ec9={'Email':_0x4d0466};var _0x7eca37={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x24cbbe['sobject']('User')[_0xb7d7('0x1c')](_0x905ec9,_0x7eca37)[_0xb7d7('0x1d')]()['then'](function(_0x112a55){if(_0x112a55['length']){var _0x17333e=_[_0xb7d7('0x1c')](_0x112a55,function(_0x4a53ba){return _0x4a53ba['Email']===_0x4d0466;});if(_0x17333e){logger[_0xb7d7('0x18')]('Agent\x20%s\x20found.',_0x4d0466);return BPromise[_0xb7d7('0x1e')]({'id':_0x17333e['Id'],'name':_0x17333e['Name']});}}else{logger['info'](_0xb7d7('0x1f'),_0x4d0466);return _0x24cbbe[_0xb7d7('0x20')]()[_0xb7d7('0x21')](function(_0x4828f7){return BPromise[_0xb7d7('0x1e')]({'id':_0x4828f7['user_id'],'name':_0x4828f7[_0xb7d7('0x22')]});});}});}else{logger['info'](_0xb7d7('0x1f'),_0x4d0466);return _0x24cbbe['identity']()[_0xb7d7('0x21')](function(_0x53bc20){return BPromise[_0xb7d7('0x1e')]({'id':_0x53bc20[_0xb7d7('0x23')],'name':_0x53bc20['display_name']});});}}function getEndUser(_0x59ba66,_0x31fe1f,_0x173236,_0x442a73,_0x251431){var _0x484676={'$or':{'Phone':_0x442a73}};var _0xe8e221={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb7d7('0x1e')]()[_0xb7d7('0x21')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x442a73,_0x31fe1f[_0xb7d7('0x24')]);switch(_0x31fe1f['moduleSearch']){case _0xb7d7('0x25'):var _0x10af4f=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f[_0xb7d7('0x27')]){var _0x4ee663={};_0x4ee663[_0x31fe1f[_0xb7d7('0x27')]]=_0x442a73;_[_0xb7d7('0x28')](_0x10af4f['$or'],_0x4ee663);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x29'))[_0xb7d7('0x1c')](_0x10af4f,_0xe8e221)[_0xb7d7('0x1d')]()[_0xb7d7('0x21')](function(_0xdfb4e3){if(_0xdfb4e3&&_0xdfb4e3[_0xb7d7('0x2a')]){return _0xdfb4e3;}else{var _0x5d363f=_['cloneDeep'](_0x484676);if(_0x31fe1f[_0xb7d7('0x2b')]){var _0xec40b3={};_0xec40b3[_0x31fe1f['additionalSearchLead']]=_0x442a73;_['merge'](_0x5d363f[_0xb7d7('0x2c')],_0xec40b3);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x2d'))[_0xb7d7('0x1c')](_0x5d363f,_0xe8e221);}});case'account_contact_lead':var _0x23d3a5=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f[_0xb7d7('0x2e')]){var _0x4ee663={};_0x4ee663[_0x31fe1f[_0xb7d7('0x2e')]]=_0x442a73;_['merge'](_0x23d3a5[_0xb7d7('0x2c')],_0x4ee663);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x2f'))[_0xb7d7('0x1c')](_0x23d3a5,_0xe8e221)[_0xb7d7('0x1d')]()['then'](function(_0x3ee9ea){if(_0x3ee9ea&&_0x3ee9ea[_0xb7d7('0x2a')]){return _0x3ee9ea;}else{var _0x567ed0=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f[_0xb7d7('0x27')]){var _0xb997a3={};_0xb997a3[_0x31fe1f[_0xb7d7('0x27')]]=_0x442a73;_[_0xb7d7('0x28')](_0x567ed0['$or'],_0xb997a3);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x29'))[_0xb7d7('0x1c')](_0x567ed0,_0xe8e221)[_0xb7d7('0x21')](function(_0x135480){if(_0x135480&&_0x135480[_0xb7d7('0x2a')]){return _0x135480;}else{var _0x4d9b95=_['cloneDeep'](_0x484676);if(_0x31fe1f[_0xb7d7('0x2b')]){var _0x2ded1b={};_0x2ded1b[_0x31fe1f[_0xb7d7('0x2b')]]=_0x442a73;_[_0xb7d7('0x28')](_0x4d9b95[_0xb7d7('0x2c')],_0x2ded1b);}return _0x251431[_0xb7d7('0x1a')]('Lead')['find'](_0x4d9b95,_0xe8e221);}});}});case _0xb7d7('0x30'):var _0x10af4f=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f[_0xb7d7('0x27')]){var _0x4ee663={};_0x4ee663[_0x31fe1f['additionalSearchContact']]=_0x442a73;_[_0xb7d7('0x28')](_0x10af4f['$or'],_0x4ee663);}return _0x251431['sobject']('Contact')['find'](_0x10af4f,_0xe8e221)[_0xb7d7('0x1d')]();case _0xb7d7('0x13'):var _0x3f2f89=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f['additionalSearchLead']){var _0x4ee663={};_0x4ee663[_0x31fe1f[_0xb7d7('0x2b')]]=_0x442a73;_[_0xb7d7('0x28')](_0x3f2f89[_0xb7d7('0x2c')],_0x4ee663);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x2d'))['find'](_0x3f2f89,_0xe8e221);case _0xb7d7('0x15'):var _0x23d3a5=_[_0xb7d7('0x26')](_0x484676);if(_0x31fe1f['additionalSearchAccount']){var _0x4ee663={};_0x4ee663[_0x31fe1f[_0xb7d7('0x2e')]]=_0x442a73;_['merge'](_0x23d3a5['$or'],_0x4ee663);}return _0x251431[_0xb7d7('0x1a')](_0xb7d7('0x2f'))[_0xb7d7('0x1c')](_0x23d3a5,_0xe8e221);default:return null;}})[_0xb7d7('0x21')](function(_0xcf2140){if(_0xcf2140&&_0xcf2140[_0xb7d7('0x2a')]){var _0x4fbc20=_[_0xb7d7('0x31')](_0xcf2140);if(_0x4fbc20){return BPromise['resolve']({'id':_0x4fbc20['Id'],'name':_0x4fbc20[_0xb7d7('0x32')],'phone':_0x4fbc20[_0xb7d7('0x33')],'endUserType':_0x4fbc20[_0xb7d7('0x34')][_0xb7d7('0x35')][_0xb7d7('0x36')]()});}}})[_0xb7d7('0x21')](function(_0x432049){if(_0x432049){logger[_0xb7d7('0x18')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x432049[_0xb7d7('0x12')],_0x442a73);return BPromise[_0xb7d7('0x1e')](_0x432049);}else{logger[_0xb7d7('0x18')](_0xb7d7('0x37'),_0x442a73);var _0x87ba8d={'Phone':_0x442a73};if(_0x31fe1f[_0xb7d7('0x38')]){if(_0x31fe1f['moduleCreate']===_0xb7d7('0x30')){logger[_0xb7d7('0x18')](_0xb7d7('0x39'),_0x442a73,_0x31fe1f[_0xb7d7('0x38')]);_0x87ba8d[_0xb7d7('0x3a')]=_0x173236!==_0xb7d7('0x3b')?_0x173236:util[_0xb7d7('0x3c')]('Caller\x20-\x20%s',_0x442a73);}else if(_0x31fe1f[_0xb7d7('0x38')]===_0xb7d7('0x13')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x442a73,_0x31fe1f[_0xb7d7('0x38')]);_0x87ba8d['LastName']=_0x173236!==_0xb7d7('0x3b')?_0x173236:util[_0xb7d7('0x3c')](_0xb7d7('0x3d'),_0x442a73);_0x87ba8d[_0xb7d7('0x3e')]='No\x20Company';}else if(_0x31fe1f['moduleCreate']===_0xb7d7('0x15')){logger[_0xb7d7('0x18')](_0xb7d7('0x39'),_0x442a73,_0x31fe1f[_0xb7d7('0x38')]);_0x87ba8d[_0xb7d7('0x32')]=_0x173236!==''?_0x173236:util[_0xb7d7('0x3c')](_0xb7d7('0x3d'),_0x442a73);}else{return null;}}return _0x251431[_0xb7d7('0x1a')](_[_0xb7d7('0x3f')](_0x31fe1f[_0xb7d7('0x38')]))[_0xb7d7('0x40')](_0x87ba8d)[_0xb7d7('0x21')](function(_0x53fb02){return BPromise[_0xb7d7('0x1e')]({'id':_0x53fb02['id'],'endUserType':_0x31fe1f[_0xb7d7('0x38')]});});}});}function getCustomFields(_0xf66593,_0x353d4f){var _0x456903={};if(_0xf66593[_0xb7d7('0x2a')]>0x0){_['forEach'](_0xf66593,function(_0x7c112e){if(_['includes']([_0xb7d7('0x41'),_0xb7d7('0x42')],_0x7c112e[_0xb7d7('0x35')])&&_0x7c112e['idField']){_0x456903[_0x7c112e[_0xb7d7('0x43')]]=_0x7c112e[_0xb7d7('0x44')][_0xb7d7('0x45')]();}else if(_0x7c112e[_0xb7d7('0x35')]===_0xb7d7('0x46')&&_0x7c112e[_0xb7d7('0x47')]&&_0x7c112e[_0xb7d7('0x43')]){_0x353d4f[_0x7c112e['variableName']]&&(_0x456903[_0x7c112e[_0xb7d7('0x43')]]=_0x353d4f[_0x7c112e[_0xb7d7('0x47')]]['toString']());}else if(_0x7c112e[_0xb7d7('0x35')]==='customVariable'&&_0x7c112e[_0xb7d7('0x48')]&&_0x7c112e['Variable'][_0xb7d7('0x49')]&&_0x7c112e[_0xb7d7('0x43')]){_0x353d4f[_0x7c112e[_0xb7d7('0x48')][_0xb7d7('0x49')][_0xb7d7('0x36')]()]&&(_0x456903[_0x7c112e[_0xb7d7('0x43')]]=_0x353d4f[_0x7c112e[_0xb7d7('0x48')][_0xb7d7('0x49')][_0xb7d7('0x36')]()][_0xb7d7('0x45')]());}});}return _0x456903;}function getConnection(_0x3cb6c3){var _0x46de84=_0x3cb6c3['password'][_0xb7d7('0x4a')](_0x3cb6c3[_0xb7d7('0x4b')]);var _0x1f73b9=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3cb6c3['remoteUri']||_0xb7d7('0x4c'),'clientId':_0x3cb6c3[_0xb7d7('0x4d')],'clientSecret':_0x3cb6c3[_0xb7d7('0x4e')]}});return _0x1f73b9['login'](_0x3cb6c3[_0xb7d7('0x4f')],_0x46de84)['then'](function(){logger[_0xb7d7('0x18')](_0xb7d7('0x50'));return _0x1f73b9;});}exports['queue']=function(_0x2a79cd,_0x13fb7e,_0x24be25,_0x1e1b19,_0x50b9f0,_0x2c952a){var _0x34bf3d,_0x23a7f9,_0x31baae,_0x369f90;_0x2c952a[_0xb7d7('0x51')]=intUtil['stripTrailingSlash'](_0x2c952a['serverUrl']);_0x2c952a[_0xb7d7('0x52')]=intUtil[_0xb7d7('0x53')](_0x2c952a['remoteUri']);if(_0x50b9f0&&_0x50b9f0[_0xb7d7('0x54')]){logger[_0xb7d7('0x18')](_0xb7d7('0x55'),_0xb7d7('0x56'));_0x13fb7e['recordingURL']=util[_0xb7d7('0x3c')](_0xb7d7('0x57'),_0x2c952a['serverUrl'],_0x13fb7e[_0xb7d7('0x58')],md5(_0x13fb7e[_0xb7d7('0x58')]));}else{_0x13fb7e[_0xb7d7('0x59')]='';}return getConnection(_0x2c952a)[_0xb7d7('0x21')](function(_0x1283ab){_0x369f90=_0x1283ab;return getUser(_0x2c952a,_0x1e1b19[_0xb7d7('0x5a')],_0x369f90);})[_0xb7d7('0x21')](function(_0x351463){_0x34bf3d=_0x351463;return getEndUser(_0x2c952a,_0x24be25,_0x13fb7e['calleridname'],_0x13fb7e[_0xb7d7('0x5b')],_0x369f90);})[_0xb7d7('0x21')](function(_0x14d698){_0x23a7f9=_0x14d698;return getTicket(_0x2c952a,_0x34bf3d,_0x23a7f9,_0x24be25,_0x13fb7e,_0x24be25['Fields'],_0x369f90,_0xb7d7('0x5c'));})['then'](function(_0x1cd3b3){_0x31baae=_0x1cd3b3;logger['info'](_0xb7d7('0x5d'),_0x31baae['id']);logger[_0xb7d7('0x18')](_0xb7d7('0x5e'),_0x31baae['id'],_0x1e1b19[_0xb7d7('0x49')],_0x2c952a[_0xb7d7('0x35')]);switch(_0x2c952a[_0xb7d7('0x35')]){case _0xb7d7('0x5f'):emit(util['format'](_0xb7d7('0x60'),_0x1e1b19[_0xb7d7('0x49')]),'trigger:salesforce:display',{'recordId':_0x31baae['id']});break;case'newTab':emit(util['format'](_0xb7d7('0x60'),_0x1e1b19[_0xb7d7('0x49')]),_0xb7d7('0x61'),{'uri':util[_0xb7d7('0x3c')](_0xb7d7('0x62'),_0x369f90[_0xb7d7('0x63')],_0x31baae['id'])});break;default:logger['error'](_0xb7d7('0x64'));}})[_0xb7d7('0x65')](function(_0x39bfed){logger[_0xb7d7('0x66')](_0xb7d7('0x55'),_0x39bfed);});};exports['outbound']=function(_0x58b536,_0x23b289,_0x23301c,_0x7aa60b,_0x2d4695,_0x284162,_0x176b32){var _0x2f1e1f,_0xa278e2,_0x529c53,_0x285eb5;_0x284162[_0xb7d7('0x51')]=intUtil['stripTrailingSlash'](_0x284162[_0xb7d7('0x51')]);_0x284162['remoteUri']=intUtil['stripTrailingSlash'](_0x284162['remoteUri']);if(_0x176b32&&_0x176b32[_0xb7d7('0x67')]&&_0x176b32[_0xb7d7('0x67')]!==_0xb7d7('0x68')){logger[_0xb7d7('0x18')](_0xb7d7('0x69'),'Recording\x20is\x20enabled!');_0x23b289['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x284162[_0xb7d7('0x51')],_0x23b289[_0xb7d7('0x58')],md5(_0x23b289[_0xb7d7('0x58')]));}return getConnection(_0x284162)[_0xb7d7('0x21')](function(_0x12723d){_0x285eb5=_0x12723d;return getUser(_0x284162,_0x7aa60b[_0xb7d7('0x5a')],_0x285eb5);})[_0xb7d7('0x21')](function(_0x4feaa5){_0x2f1e1f=_0x4feaa5;return getEndUser(_0x284162,_0x23301c,_0x23b289[_0xb7d7('0x6a')],_0x23b289['destcalleridnum'],_0x285eb5);})['then'](function(_0xf53eb6){_0xa278e2=_0xf53eb6;return getTicket(_0x284162,_0x2f1e1f,_0xa278e2,_0x23301c,_0x23b289,_0x23301c[_0xb7d7('0x6b')],_0x285eb5,_0xb7d7('0x6c'));})[_0xb7d7('0x21')](function(_0x1f1f57){_0x529c53=_0x1f1f57;logger[_0xb7d7('0x18')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x529c53['id']);logger[_0xb7d7('0x18')](_0xb7d7('0x6d'),_0x529c53['id'],_0x7aa60b[_0xb7d7('0x49')],_0x284162['type']);switch(_0x284162[_0xb7d7('0x35')]){case'integrationTab':emit(util[_0xb7d7('0x3c')](_0xb7d7('0x60'),_0x7aa60b[_0xb7d7('0x49')]),'trigger:salesforce:display',{'recordId':_0x529c53['id']});break;case'newTab':emit(util[_0xb7d7('0x3c')](_0xb7d7('0x60'),_0x7aa60b[_0xb7d7('0x49')]),_0xb7d7('0x61'),{'uri':util[_0xb7d7('0x3c')](_0xb7d7('0x62'),_0x285eb5[_0xb7d7('0x63')],_0x529c53['id'])});break;default:logger['error'](_0xb7d7('0x69'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xb7d7('0x65')](function(_0xe23642){logger['error'](_0xb7d7('0x69'),_0xe23642);});};exports[_0xb7d7('0x6e')]=function(_0x58677c,_0x1d3856,_0x26b3e7,_0x1dbcfe,_0x36fde1,_0x4193d6){var _0x477898,_0x4f4761,_0x18611f,_0x227d9e;_0x4193d6[_0xb7d7('0x51')]=intUtil[_0xb7d7('0x53')](_0x4193d6[_0xb7d7('0x51')]);_0x4193d6[_0xb7d7('0x52')]=intUtil[_0xb7d7('0x53')](_0x4193d6['remoteUri']);if(_0x36fde1&&_0x36fde1[_0xb7d7('0x54')]){logger[_0xb7d7('0x18')]('['+_0x1d3856[_0xb7d7('0x6f')]['toUpperCase']()+']',_0xb7d7('0x56'));_0x1d3856['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4193d6['serverUrl'],_0x1d3856[_0xb7d7('0x58')],md5(_0x1d3856[_0xb7d7('0x58')]));}else{_0x1d3856[_0xb7d7('0x59')]='';}return getConnection(_0x4193d6)[_0xb7d7('0x21')](function(_0x4d3cb0){_0x227d9e=_0x4d3cb0;if(!_['isNil'](_0x1dbcfe)){return getUser(_0x4193d6,_0x1dbcfe['name'],_0x227d9e);}else{return getUser(_0x4193d6,null,_0x227d9e);}})['then'](function(_0x2b532d){_0x477898=_0x2b532d;return getEndUser(_0x4193d6,_0x26b3e7,_0x1d3856[_0xb7d7('0x70')],_0x1d3856[_0xb7d7('0x5b')],_0x227d9e);})['then'](function(_0x4d3ace){_0x4f4761=_0x4d3ace;return getTicket(_0x4193d6,_0x477898,_0x4f4761,_0x26b3e7,_0x1d3856,_0x26b3e7['Fields'],_0x227d9e);})[_0xb7d7('0x21')](function(_0xf45655){_0x18611f=_0xf45655;logger[_0xb7d7('0x18')]('['+_0x1d3856[_0xb7d7('0x6f')][_0xb7d7('0x71')]()+_0xb7d7('0x72'),_0x18611f['id']);logger['info']('['+_0x1d3856[_0xb7d7('0x6f')][_0xb7d7('0x71')]()+_0xb7d7('0x73'),_0x4193d6[_0xb7d7('0x35')]);})['catch'](function(_0x49c6ab){logger[_0xb7d7('0x66')]('['+_0x1d3856[_0xb7d7('0x6f')]['toUpperCase']()+']',_0x49c6ab);});}; \ 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 9f60f95..a8d20bb 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 _0x2960=['inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2960,0x71));var _0x0296=function(_0x36072d,_0x24f414){_0x36072d=_0x36072d-0x0;var _0x32a52c=_0x2960[_0x36072d];return _0x32a52c;};'use strict';var _=require(_0x0296('0x0'));var Promise=require(_0x0296('0x1'));var rp=require(_0x0296('0x2'));var util=require(_0x0296('0x3'));var md5=require('md5');var Redis=require(_0x0296('0x4'));var intUtil=require(_0x0296('0x5'));var config=require('../../../../config/environment');var logger=require(_0x0296('0x6'))(_0x0296('0x7'));config[_0x0296('0x8')]=_['defaults'](config[_0x0296('0x8')],{'host':_0x0296('0x9'),'port':0x18eb});var io=require(_0x0296('0xa'))(new Redis(config[_0x0296('0x8')]));function getAdminUser(_0x32866e,_0xef53d8,_0x21451f,_0x41281d,_0x254b59,_0x3931f8){return new Promise(function(_0x15bc6b,_0x5208e5){var _0x35a05e={'method':_0x0296('0xb'),'uri':_0x41281d+_0x0296('0xc')+'&'+_0x254b59+'&'+_0x3931f8,'auth':_0xef53d8,'json':!![]};return rp(_0x35a05e)[_0x0296('0xd')](function(_0x4ce87b){if(_0x4ce87b[_0x0296('0xe')][_0x0296('0xf')]>0x0){_0x21451f[_0x0296('0x10')]=_0x4ce87b[_0x0296('0xe')][0x0][_0x0296('0x11')];}logger['info']('['+[_0x32866e[_0x0296('0x12')]()]+'],\x20getAdminUser\x20crm',_0x21451f);_0x15bc6b(_0x21451f);})[_0x0296('0x13')](function(_0x1072bc){logger[_0x0296('0x14')]('['+[_0x32866e[_0x0296('0x12')]()]+']',_0x1072bc[_0x0296('0x15')]);_0x5208e5(_0x1072bc[_0x0296('0x15')]);});});}function getUser(_0x5230a7,_0x2607ee,_0x3551f9,_0x3c00f3,_0x318891){return function(_0x16b263){logger[_0x0296('0x16')]('['+[_0x5230a7[_0x0296('0x12')]()]+_0x0296('0x17'),_0x16b263);return new Promise(function(_0x5973a2,_0x7e058a){if(intUtil[_0x0296('0x18')](_0x16b263['userEmail'])){var _0x4fd537={'method':_0x0296('0xb'),'uri':_0x3551f9+_0x0296('0x19')+_0x16b263[_0x0296('0x1a')]+'&'+_0x3c00f3+'&'+_0x318891,'auth':_0x2607ee,'json':!![]};logger[_0x0296('0x16')]('['+[_0x5230a7[_0x0296('0x12')]()]+_0x0296('0x1b'),_0x4fd537);return rp(_0x4fd537)['then'](function(_0x50b727){logger[_0x0296('0x16')]('['+[_0x5230a7['toUpperCase']()]+_0x0296('0x1c'),_0x50b727);if(_0x50b727[_0x0296('0xe')]['length']>0x0&&String(_0x50b727['result'][0x0][_0x0296('0x1d')])===_0x0296('0x1e')){_0x16b263[_0x0296('0x1f')]=_0x50b727['result'][0x0]['sys_id'];}else{_0x16b263['userId']=_0x16b263['adminId'];_0x16b263[_0x0296('0x1a')]=_0x16b263['adminEmail'];}logger[_0x0296('0x16')]('['+[_0x5230a7[_0x0296('0x12')]()]+_0x0296('0x20'),_0x16b263);_0x5973a2(_0x16b263);})[_0x0296('0x13')](function(_0x4ade44){logger['error']('['+[_0x5230a7[_0x0296('0x12')]()]+']',_0x4ade44[_0x0296('0x15')]);_0x7e058a(_0x4ade44[_0x0296('0x15')]);});}else{logger[_0x0296('0x16')]('['+[_0x5230a7[_0x0296('0x12')]()]+_0x0296('0x21'));_0x16b263[_0x0296('0x1f')]=_0x16b263[_0x0296('0x10')];_0x16b263[_0x0296('0x1a')]=_0x16b263[_0x0296('0x22')];_0x5973a2(_0x16b263);}});};}function createEndUser(_0x1557b9,_0x201057,_0x18d9d7,_0x3ecb68,_0x100d3a){logger['info']('['+[_0x1557b9['toUpperCase']()]+_0x0296('0x23'),_0x18d9d7);return new Promise(function(_0x48b9db,_0x34a135){var _0xc07578={'method':'POST','uri':_0x3ecb68+'sys_user?'+_0x100d3a,'body':{'user_name':_0x18d9d7[_0x0296('0x24')],'roles':_0x0296('0x25'),'first_name':_0x18d9d7['endUserNumber'],'active':_0x0296('0x1e'),'date_format':_0x0296('0x26'),'phone':_0x18d9d7['endUserNumber']},'auth':_0x201057,'json':!![]};return rp(_0xc07578)[_0x0296('0xd')](function(_0x381be3){logger[_0x0296('0x16')]('['+[_0x1557b9[_0x0296('0x12')]()]+_0x0296('0x27'),_0x381be3[_0x0296('0xe')]);_0x18d9d7[_0x0296('0x28')]=_0x381be3[_0x0296('0xe')][_0x0296('0x11')];_0x48b9db(_0x18d9d7);})[_0x0296('0x13')](function(_0x5404fa){logger[_0x0296('0x14')]('['+[_0x1557b9[_0x0296('0x12')]()]+']',_0x5404fa['message']);_0x34a135(_0x5404fa['message']);});});}function getEndUser(_0x5535c0,_0x300a5a,_0x1e62e9,_0x37f499,_0x51d83a){return function(_0x16eb83){logger[_0x0296('0x16')]('['+[_0x5535c0[_0x0296('0x12')]()]+_0x0296('0x29'),_0x16eb83);return new Promise(function(_0x157b53,_0x383bf5){var _0x53961e={'method':'GET','uri':_0x1e62e9+_0x0296('0x2a')+_0x16eb83[_0x0296('0x24')]+'&'+_0x37f499+'&'+_0x51d83a,'auth':_0x300a5a,'json':!![]};return rp(_0x53961e)['then'](function(_0x75740d){if(_0x75740d[_0x0296('0xe')][_0x0296('0xf')]>0x0){_0x16eb83['endUserId']=_0x75740d[_0x0296('0xe')][0x0][_0x0296('0x11')];logger[_0x0296('0x16')]('['+[_0x5535c0[_0x0296('0x12')]()]+'],\x20getEndUser\x20crm',_0x16eb83);_0x157b53(_0x16eb83);}else{return createEndUser(_0x5535c0,_0x300a5a,_0x16eb83,_0x1e62e9,_0x37f499)[_0x0296('0xd')](function(_0x7af4bd){logger[_0x0296('0x16')]('['+[_0x5535c0[_0x0296('0x12')]()]+'],\x20createEndUser\x20crm',_0x7af4bd);_0x157b53(_0x7af4bd);});}})['catch'](function(_0x5057ae){logger[_0x0296('0x14')]('['+[_0x5535c0['toUpperCase']()]+']',_0x5057ae[_0x0296('0x15')]);_0x383bf5(_0x5057ae[_0x0296('0x15')]);});});};}function getCustomFields(_0x2d127b,_0x222387){var _0x156491={};if(_0x2d127b[_0x0296('0xf')]>0x0){_[_0x0296('0x2b')](_0x2d127b,function(_0x33e224){if(_[_0x0296('0x2c')]([_0x0296('0x2d'),_0x0296('0x2e')],_0x33e224[_0x0296('0x2f')])&&_0x33e224[_0x0296('0x30')]&&!_0x33e224['customField']){_0x156491[_0x33e224[_0x0296('0x30')][_0x0296('0x31')]()]=_0x33e224[_0x0296('0x32')][_0x0296('0x33')]();}else if(_[_0x0296('0x2c')](['string','picklist'],_0x33e224[_0x0296('0x2f')])&&_0x33e224[_0x0296('0x34')]&&_0x33e224[_0x0296('0x35')]){_0x156491[_0x33e224[_0x0296('0x34')]['toLowerCase']()]=_0x33e224[_0x0296('0x32')][_0x0296('0x33')]();}else if(_0x33e224['type']===_0x0296('0x36')&&_0x33e224['variableName']&&_0x33e224[_0x0296('0x34')]&&_0x33e224[_0x0296('0x35')]){_0x156491[_0x33e224[_0x0296('0x34')]['toLowerCase']()]=_0x222387[_0x33e224[_0x0296('0x37')]]['toString']();}else if(_0x33e224['type']===_0x0296('0x38')&&_0x33e224[_0x0296('0x39')]&&_0x33e224[_0x0296('0x39')][_0x0296('0x3a')]&&_0x33e224['idField']&&_0x33e224[_0x0296('0x35')]){_0x156491[_0x33e224[_0x0296('0x34')]['toLowerCase']()]=_0x222387[_0x33e224[_0x0296('0x39')]['name'][_0x0296('0x31')]()][_0x0296('0x33')]();}});}return _0x156491;}function getTicket(_0x16470f,_0x9bd188,_0xa19203,_0x282e2f,_0x54a721,_0x4f78b3){return function(_0x5649fc){logger[_0x0296('0x16')]('['+[_0x16470f[_0x0296('0x12')]()]+_0x0296('0x3b'),_0x5649fc);return new Promise(function(_0x58c641,_0x131708){var _0x3f76a8=_0x16470f[_0x0296('0x31')]()===_0x0296('0x3c')?_0x5649fc['userId']:_0x5649fc['endUserId'];var _0x2273c4={'method':_0x0296('0x3d'),'uri':_0xa19203+'incident'+'?'+_0x4f78b3,'body':Object[_0x0296('0x3e')]({},{'active':'true','caller_id':_0x3f76a8,'assigned_to':_0x5649fc[_0x0296('0x1f')],'short_description':intUtil[_0x0296('0x3f')](_0x282e2f[_0x0296('0x40')],_0x54a721,'\x20'),'description':intUtil[_0x0296('0x3f')](_0x282e2f[_0x0296('0x41')],_0x54a721,'\x0a')},getCustomFields(_0x282e2f['Fields'],_0x54a721)),'auth':_0x9bd188,'json':!![]};return rp(_0x2273c4)[_0x0296('0xd')](function(_0x2482c0){logger[_0x0296('0x16')]('['+[_0x16470f[_0x0296('0x12')]()]+_0x0296('0x42'),_0x2482c0[_0x0296('0xe')]);_0x5649fc[_0x0296('0x43')]=_0x2482c0[_0x0296('0xe')][_0x0296('0x11')];_0x5649fc[_0x0296('0x44')]=_0x2482c0['result'][_0x0296('0x45')];logger[_0x0296('0x16')]('['+[_0x16470f[_0x0296('0x12')]()]+_0x0296('0x46'),_0x5649fc);_0x58c641(_0x5649fc);})[_0x0296('0x13')](function(_0x337d03){logger['error']('['+[_0x16470f[_0x0296('0x12')]()]+']',_0x337d03['message']);_0x131708(_0x337d03[_0x0296('0x15')]);});});};}function createRemoteTag(_0xdc2f1c,_0x13d53f,_0x250281,_0xe0a010){return new Promise(function(_0x50967c,_0x311710){var _0x2e6f0c={'method':'POST','uri':_0x250281+_0x0296('0x47')+'?'+_0xe0a010,'body':{'short_description':_0xdc2f1c,'global':!![],'active':!![],'name':_0xdc2f1c},'auth':_0x13d53f,'json':!![]};return rp(_0x2e6f0c)[_0x0296('0xd')](function(_0x17472f){var _0x371807=_0x17472f[_0x0296('0xe')][_0x0296('0x11')];_0x50967c(_0x371807);});});}function getRemoteTag(_0x6ae4be,_0x168eab,_0x2996d2,_0x16da0e,_0x575b8e){return new Promise(function(_0x11a545,_0x1882db){var _0x51dc50={'method':_0x0296('0xb'),'uri':_0x2996d2+_0x0296('0x47')+_0x0296('0x48')+_0x6ae4be+'&'+_0x16da0e,'auth':_0x168eab,'json':!![]};return rp(_0x51dc50)[_0x0296('0xd')](function(_0x1f1d46){if(_0x1f1d46['result']['length']>0x0){var _0x4dfe25=_0x1f1d46['result'][0x0][_0x0296('0x11')];_0x11a545(_0x4dfe25);}else{return createRemoteTag(_0x6ae4be,_0x168eab,_0x2996d2,_0x16da0e)[_0x0296('0xd')](function(_0x233172){_0x11a545(_0x233172);});}});});}function assignTagToIncident(_0x3a1be3,_0x2a3807,_0x5f3c4c,_0x1750f6,_0x37b3c3){return new Promise(function(_0x504ef9,_0x431400){var _0x1c94aa={'method':_0x0296('0x3d'),'uri':_0x5f3c4c+_0x0296('0x49')+'?'+_0x37b3c3,'body':{'label':_0x3a1be3,'table':_0x0296('0x4a'),'id_type':'Incident','table_key':_0x1750f6[_0x0296('0x43')],'title':_0x0296('0x4b')+_0x1750f6['ticketNumber'],'id_display':_0x1750f6[_0x0296('0x44')]},'auth':_0x2a3807,'json':!![]};return rp(_0x1c94aa)['then'](function(_0x1b2679){_0x504ef9();})['catch'](function(){_0x504ef9();});});}function manageTags(_0x52230d,_0x3d5730,_0x432eda,_0x377d01,_0x132354,_0x328273,_0x306975){return new Promise(function(_0x3ce144,_0x681e8f){var _0x58f619=[];_0x3d5730['forEach'](function(_0x274e54){_0x58f619['push'](getRemoteTag(_0x274e54,_0x432eda,_0x377d01,_0x328273,_0x306975));});return Promise[_0x0296('0x4c')](_0x58f619)['then'](function(_0x25a1ea){if(_0x25a1ea[_0x0296('0xf')]){logger[_0x0296('0x16')]('['+[_0x52230d['toUpperCase']()]+_0x0296('0x4d'),_0x25a1ea);var _0x1076c3=[];_0x25a1ea[_0x0296('0x2b')](function(_0x3c3631){_0x1076c3[_0x0296('0x4e')](assignTagToIncident(_0x3c3631,_0x432eda,_0x377d01,_0x132354,_0x328273));});return Promise[_0x0296('0x4c')](_0x1076c3)['then'](function(){_0x3ce144();})['catch'](function(){_0x3ce144();});}else{_0x3ce144();}});});}function getTags(_0x29a670,_0x16a857,_0x4af965,_0x50920c,_0x14194d,_0x269865){return function(_0x31941d){return new Promise(function(_0x3138cd,_0x43c429){var _0x2758ed=[];var _0x4a48f8=_0x50920c[_0x0296('0x4f')];if(_0x4a48f8&&_0x4a48f8['length']>0x0){_0x2758ed=_[_0x0296('0x50')](_0x4a48f8,_0x0296('0x3a'));}if(_0x2758ed[_0x0296('0xf')]>0x0){return manageTags(_0x29a670,_0x2758ed,_0x16a857,_0x4af965,_0x31941d,_0x14194d,_0x269865)[_0x0296('0xd')](function(){_0x3138cd(_0x31941d);});}else{_0x3138cd(_0x31941d);}});};}function emit(_0x98a2e,_0x4b47db,_0x2c1b76){var _0x17e6ba=_0x0296('0x51')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x0296('0x52')+'%255EORDERBYDESCnumber';var _0x369ef3={'uri':_0x98a2e+_0x0296('0x53')+_0x2c1b76+_0x17e6ba};io['to'](util[_0x0296('0x54')](_0x0296('0x55'),_0x4b47db))[_0x0296('0x56')](_0x0296('0x57'),_0x369ef3);}exports['cs']=function(_0x40e74a,_0x2c6ffc,_0x43c0e0,_0x26c919,_0x529e70,_0x375db4,_0x53cca1,_0x4b38f9){var _0x2a4767={};var _0x37de28={'user':_0x375db4[_0x0296('0x58')],'pass':_0x375db4[_0x0296('0x59')]};var _0x5f2058=_0x0296('0x5a');var _0x8d0c59='sysparm_display_value=true';_0x375db4[_0x0296('0x5b')]=intUtil[_0x0296('0x5c')](_0x375db4[_0x0296('0x5b')]);_0x375db4[_0x0296('0x5d')]=intUtil[_0x0296('0x5c')](_0x375db4['serverUrl']);var _0x5d0254=util[_0x0296('0x54')](_0x0296('0x5e'),_0x375db4[_0x0296('0x5b')]);_0x2a4767[_0x0296('0x1a')]=!_['isNil'](_0x26c919)?_0x26c919[_0x0296('0x5f')]:null;_0x2a4767['adminEmail']=_0x375db4['email'];_0x2a4767[_0x0296('0x24')]=_0x4b38f9['toLowerCase']()==='outbound'?_0x2c6ffc[_0x0296('0x60')]:_0x2c6ffc[_0x0296('0x61')];_0x2a4767['callDirection']=_0x4b38f9===_0x0296('0x62')||_0x4b38f9===_0x0296('0x63')?'queue':_0x0296('0x3c');var _0x35daaa=util['format'](_0x0296('0x64'),_0x375db4[_0x0296('0x5d')],_0x2c6ffc['uniqueid'],md5(_0x2c6ffc[_0x0296('0x65')]));if(_0x529e70&&_0x529e70[_0x0296('0x66')]){logger[_0x0296('0x16')](_0x0296('0x67'),_0x0296('0x68'));_0x2c6ffc[_0x0296('0x69')]=_0x35daaa;}else if(_0x53cca1&&_0x53cca1['recordingFormat']&&_0x53cca1['recordingFormat']!==_0x0296('0x6a')){logger['info'](_0x0296('0x6b'),_0x0296('0x68'));_0x2c6ffc[_0x0296('0x69')]=_0x35daaa;}else{_0x2c6ffc[_0x0296('0x69')]='';}return getAdminUser(_0x4b38f9,_0x37de28,_0x2a4767,_0x5d0254,_0x8d0c59,_0x5f2058)['then'](getUser(_0x4b38f9,_0x37de28,_0x5d0254,_0x8d0c59,_0x5f2058))[_0x0296('0xd')](getEndUser(_0x4b38f9,_0x37de28,_0x5d0254,_0x8d0c59,_0x5f2058))['then'](getTicket(_0x4b38f9,_0x37de28,_0x5d0254,_0x43c0e0,_0x2c6ffc,_0x8d0c59))['then'](function(_0x156c4d){logger['info'](util[_0x0296('0x54')](_0x0296('0x6c'),_0x156c4d['ticketId']));logger[_0x0296('0x16')](util[_0x0296('0x54')](_0x0296('0x6d'),_0x4b38f9));if(_0x4b38f9!==_0x0296('0x63')){logger['info']('['+[_0x4b38f9['toUpperCase']()]+']',_0x0296('0x6e'));emit(_0x375db4[_0x0296('0x5b')],_0x26c919[_0x0296('0x3a')],_0x156c4d[_0x0296('0x43')]);}})[_0x0296('0x13')](function(_0x13141d){logger[_0x0296('0x14')]('['+[_0x4b38f9[_0x0296('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x0296('0x6f')](_0x13141d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2bb4=['Variable','name','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','endUserId','],\x20getEndUser\x20input\x20crm','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variableName'];(function(_0x109be3,_0x467363){var _0x2b7592=function(_0x4c878a){while(--_0x4c878a){_0x109be3['push'](_0x109be3['shift']());}};_0x2b7592(++_0x467363);}(_0x2bb4,0x1d3));var _0x42bb=function(_0x18141b,_0x45c769){_0x18141b=_0x18141b-0x0;var _0x474c30=_0x2bb4[_0x18141b];return _0x474c30;};'use strict';var _=require(_0x42bb('0x0'));var Promise=require(_0x42bb('0x1'));var rp=require('request-promise');var util=require(_0x42bb('0x2'));var md5=require(_0x42bb('0x3'));var Redis=require(_0x42bb('0x4'));var intUtil=require('./util');var config=require(_0x42bb('0x5'));var logger=require('../../../../config/logger')(_0x42bb('0x6'));config[_0x42bb('0x7')]=_[_0x42bb('0x8')](config['redis'],{'host':_0x42bb('0x9'),'port':0x18eb});var io=require(_0x42bb('0xa'))(new Redis(config[_0x42bb('0x7')]));function getAdminUser(_0x4de3e4,_0x5298b2,_0xce0696,_0x41edbb,_0x4e8a6e,_0x531014){return new Promise(function(_0x47a071,_0x324502){var _0x318612={'method':_0x42bb('0xb'),'uri':_0x41edbb+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4e8a6e+'&'+_0x531014,'auth':_0x5298b2,'json':!![]};return rp(_0x318612)['then'](function(_0x4ccf8d){if(_0x4ccf8d[_0x42bb('0xc')]['length']>0x0){_0xce0696['adminId']=_0x4ccf8d['result'][0x0][_0x42bb('0xd')];}logger[_0x42bb('0xe')]('['+[_0x4de3e4[_0x42bb('0xf')]()]+_0x42bb('0x10'),_0xce0696);_0x47a071(_0xce0696);})[_0x42bb('0x11')](function(_0x2aa9e7){logger[_0x42bb('0x12')]('['+[_0x4de3e4['toUpperCase']()]+']',_0x2aa9e7[_0x42bb('0x13')]);_0x324502(_0x2aa9e7[_0x42bb('0x13')]);});});}function getUser(_0x38fc6c,_0x19ca4e,_0x131a6d,_0x3a9c0a,_0x125e00){return function(_0x595432){logger[_0x42bb('0xe')]('['+[_0x38fc6c[_0x42bb('0xf')]()]+'],\x20getUser\x20input\x20crm',_0x595432);return new Promise(function(_0x3224d8,_0x34e185){if(intUtil[_0x42bb('0x14')](_0x595432['userEmail'])){var _0x3e57a3={'method':_0x42bb('0xb'),'uri':_0x131a6d+'sys_user?sysparm_query=email%3D'+_0x595432['userEmail']+'&'+_0x3a9c0a+'&'+_0x125e00,'auth':_0x19ca4e,'json':!![]};logger[_0x42bb('0xe')]('['+[_0x38fc6c['toUpperCase']()]+_0x42bb('0x15'),_0x3e57a3);return rp(_0x3e57a3)[_0x42bb('0x16')](function(_0x404c73){logger[_0x42bb('0xe')]('['+[_0x38fc6c['toUpperCase']()]+_0x42bb('0x17'),_0x404c73);if(_0x404c73[_0x42bb('0xc')]['length']>0x0&&String(_0x404c73[_0x42bb('0xc')][0x0][_0x42bb('0x18')])===_0x42bb('0x19')){_0x595432[_0x42bb('0x1a')]=_0x404c73[_0x42bb('0xc')][0x0][_0x42bb('0xd')];}else{_0x595432[_0x42bb('0x1a')]=_0x595432['adminId'];_0x595432[_0x42bb('0x1b')]=_0x595432[_0x42bb('0x1c')];}logger[_0x42bb('0xe')]('['+[_0x38fc6c[_0x42bb('0xf')]()]+_0x42bb('0x1d'),_0x595432);_0x3224d8(_0x595432);})[_0x42bb('0x11')](function(_0x35563f){logger['error']('['+[_0x38fc6c[_0x42bb('0xf')]()]+']',_0x35563f[_0x42bb('0x13')]);_0x34e185(_0x35563f[_0x42bb('0x13')]);});}else{logger[_0x42bb('0xe')]('['+[_0x38fc6c['toUpperCase']()]+_0x42bb('0x1e'));_0x595432[_0x42bb('0x1a')]=_0x595432[_0x42bb('0x1f')];_0x595432[_0x42bb('0x1b')]=_0x595432[_0x42bb('0x1c')];_0x3224d8(_0x595432);}});};}function createEndUser(_0x479da2,_0x51dc28,_0x386e23,_0x3d4738,_0x2a4679){logger[_0x42bb('0xe')]('['+[_0x479da2[_0x42bb('0xf')]()]+_0x42bb('0x20'),_0x386e23);return new Promise(function(_0x3c6b77,_0x4ba1ca){var _0x23aeec={'method':_0x42bb('0x21'),'uri':_0x3d4738+_0x42bb('0x22')+_0x2a4679,'body':{'user_name':_0x386e23[_0x42bb('0x23')],'roles':_0x42bb('0x24'),'first_name':_0x386e23[_0x42bb('0x23')],'active':'true','date_format':'System','phone':_0x386e23[_0x42bb('0x23')]},'auth':_0x51dc28,'json':!![]};return rp(_0x23aeec)[_0x42bb('0x16')](function(_0x37a5cb){logger[_0x42bb('0xe')]('['+[_0x479da2[_0x42bb('0xf')]()]+'],\x20EndUser\x20schema',_0x37a5cb[_0x42bb('0xc')]);_0x386e23[_0x42bb('0x25')]=_0x37a5cb[_0x42bb('0xc')]['sys_id'];_0x3c6b77(_0x386e23);})['catch'](function(_0x226d79){logger[_0x42bb('0x12')]('['+[_0x479da2['toUpperCase']()]+']',_0x226d79[_0x42bb('0x13')]);_0x4ba1ca(_0x226d79[_0x42bb('0x13')]);});});}function getEndUser(_0x1ad63a,_0x421c81,_0xa42a04,_0x218758,_0x265e0f){return function(_0x3373c5){logger[_0x42bb('0xe')]('['+[_0x1ad63a[_0x42bb('0xf')]()]+_0x42bb('0x26'),_0x3373c5);return new Promise(function(_0x2a599e,_0x4e048a){var _0x50834b={'method':_0x42bb('0xb'),'uri':_0xa42a04+'sys_user?sysparm_query=phone%3D'+_0x3373c5[_0x42bb('0x23')]+'&'+_0x218758+'&'+_0x265e0f,'auth':_0x421c81,'json':!![]};return rp(_0x50834b)[_0x42bb('0x16')](function(_0x4483d0){if(_0x4483d0[_0x42bb('0xc')][_0x42bb('0x27')]>0x0){_0x3373c5[_0x42bb('0x25')]=_0x4483d0['result'][0x0][_0x42bb('0xd')];logger['info']('['+[_0x1ad63a[_0x42bb('0xf')]()]+_0x42bb('0x28'),_0x3373c5);_0x2a599e(_0x3373c5);}else{return createEndUser(_0x1ad63a,_0x421c81,_0x3373c5,_0xa42a04,_0x218758)[_0x42bb('0x16')](function(_0x128d9e){logger[_0x42bb('0xe')]('['+[_0x1ad63a[_0x42bb('0xf')]()]+_0x42bb('0x29'),_0x128d9e);_0x2a599e(_0x128d9e);});}})['catch'](function(_0x2f0eb3){logger[_0x42bb('0x12')]('['+[_0x1ad63a[_0x42bb('0xf')]()]+']',_0x2f0eb3['message']);_0x4e048a(_0x2f0eb3['message']);});});};}function getCustomFields(_0x1f36ca,_0x31611f){var _0x1a944f={};if(_0x1f36ca[_0x42bb('0x27')]>0x0){_[_0x42bb('0x2a')](_0x1f36ca,function(_0x122099){if(_['includes']([_0x42bb('0x2b'),_0x42bb('0x2c')],_0x122099[_0x42bb('0x2d')])&&_0x122099['nameField']&&!_0x122099['customField']){_0x1a944f[_0x122099[_0x42bb('0x2e')][_0x42bb('0x2f')]()]=_0x122099[_0x42bb('0x30')][_0x42bb('0x31')]();}else if(_['includes'](['string',_0x42bb('0x2c')],_0x122099[_0x42bb('0x2d')])&&_0x122099[_0x42bb('0x32')]&&_0x122099[_0x42bb('0x33')]){_0x1a944f[_0x122099[_0x42bb('0x32')][_0x42bb('0x2f')]()]=_0x122099['content'][_0x42bb('0x31')]();}else if(_0x122099[_0x42bb('0x2d')]==='variable'&&_0x122099[_0x42bb('0x34')]&&_0x122099['idField']&&_0x122099[_0x42bb('0x33')]){_0x1a944f[_0x122099[_0x42bb('0x32')][_0x42bb('0x2f')]()]=_0x31611f[_0x122099[_0x42bb('0x34')]]['toString']();}else if(_0x122099[_0x42bb('0x2d')]==='customVariable'&&_0x122099[_0x42bb('0x35')]&&_0x122099['Variable'][_0x42bb('0x36')]&&_0x122099[_0x42bb('0x32')]&&_0x122099[_0x42bb('0x33')]){_0x1a944f[_0x122099[_0x42bb('0x32')][_0x42bb('0x2f')]()]=_0x31611f[_0x122099[_0x42bb('0x35')][_0x42bb('0x36')][_0x42bb('0x2f')]()][_0x42bb('0x31')]();}});}return _0x1a944f;}function getTicket(_0x24f072,_0x53eb94,_0x33e954,_0x25c2c9,_0x555d2c,_0x3dbe70){return function(_0x500a01){logger[_0x42bb('0xe')]('['+[_0x24f072[_0x42bb('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x500a01);return new Promise(function(_0x26e6e0,_0x252202){var _0x22caf7=_0x24f072[_0x42bb('0x2f')]()==='outbound'?_0x500a01[_0x42bb('0x1a')]:_0x500a01[_0x42bb('0x25')];var _0x24fb0e={'method':'POST','uri':_0x33e954+_0x42bb('0x37')+'?'+_0x3dbe70,'body':Object['assign']({},{'active':'true','caller_id':_0x22caf7,'assigned_to':_0x500a01[_0x42bb('0x1a')],'short_description':intUtil[_0x42bb('0x38')](_0x25c2c9[_0x42bb('0x39')],_0x555d2c,'\x20'),'description':intUtil[_0x42bb('0x38')](_0x25c2c9[_0x42bb('0x3a')],_0x555d2c,'\x0a')},getCustomFields(_0x25c2c9[_0x42bb('0x3b')],_0x555d2c)),'auth':_0x53eb94,'json':!![]};return rp(_0x24fb0e)[_0x42bb('0x16')](function(_0x88dbca){logger['info']('['+[_0x24f072[_0x42bb('0xf')]()]+_0x42bb('0x3c'),_0x88dbca[_0x42bb('0xc')]);_0x500a01['ticketId']=_0x88dbca[_0x42bb('0xc')][_0x42bb('0xd')];_0x500a01[_0x42bb('0x3d')]=_0x88dbca[_0x42bb('0xc')][_0x42bb('0x3e')];logger['info']('['+[_0x24f072[_0x42bb('0xf')]()]+_0x42bb('0x3f'),_0x500a01);_0x26e6e0(_0x500a01);})[_0x42bb('0x11')](function(_0xdc066a){logger[_0x42bb('0x12')]('['+[_0x24f072[_0x42bb('0xf')]()]+']',_0xdc066a['message']);_0x252202(_0xdc066a[_0x42bb('0x13')]);});});};}function createRemoteTag(_0x252185,_0x57a61c,_0x1acd7a,_0xd62afc){return new Promise(function(_0x48d3a7,_0x23bb00){var _0x255b45={'method':_0x42bb('0x21'),'uri':_0x1acd7a+_0x42bb('0x40')+'?'+_0xd62afc,'body':{'short_description':_0x252185,'global':!![],'active':!![],'name':_0x252185},'auth':_0x57a61c,'json':!![]};return rp(_0x255b45)[_0x42bb('0x16')](function(_0x11cf9b){var _0x28352c=_0x11cf9b[_0x42bb('0xc')][_0x42bb('0xd')];_0x48d3a7(_0x28352c);});});}function getRemoteTag(_0x298189,_0x88a04e,_0x1f7b00,_0xcbd37a,_0x24a74b){return new Promise(function(_0x315d0d,_0x195f21){var _0x2ceb09={'method':'GET','uri':_0x1f7b00+_0x42bb('0x40')+_0x42bb('0x41')+_0x298189+'&'+_0xcbd37a,'auth':_0x88a04e,'json':!![]};return rp(_0x2ceb09)['then'](function(_0x78139e){if(_0x78139e[_0x42bb('0xc')][_0x42bb('0x27')]>0x0){var _0x129b0b=_0x78139e[_0x42bb('0xc')][0x0][_0x42bb('0xd')];_0x315d0d(_0x129b0b);}else{return createRemoteTag(_0x298189,_0x88a04e,_0x1f7b00,_0xcbd37a)[_0x42bb('0x16')](function(_0x4fd81f){_0x315d0d(_0x4fd81f);});}});});}function assignTagToIncident(_0x498e5e,_0x1ebf37,_0xdcd21f,_0x55c445,_0x3ba5f5){return new Promise(function(_0x10f96d,_0x5628f9){var _0x51e777={'method':'POST','uri':_0xdcd21f+_0x42bb('0x42')+'?'+_0x3ba5f5,'body':{'label':_0x498e5e,'table':_0x42bb('0x37'),'id_type':_0x42bb('0x43'),'table_key':_0x55c445[_0x42bb('0x44')],'title':'Incident\x20-\x20'+_0x55c445[_0x42bb('0x3d')],'id_display':_0x55c445[_0x42bb('0x3d')]},'auth':_0x1ebf37,'json':!![]};return rp(_0x51e777)['then'](function(_0x3e6858){_0x10f96d();})[_0x42bb('0x11')](function(){_0x10f96d();});});}function manageTags(_0xe1f4cf,_0x446677,_0x59e4e9,_0x5a7afc,_0x294664,_0x2263c2,_0x519642){return new Promise(function(_0x530c5b,_0x19f77d){var _0x4ac596=[];_0x446677[_0x42bb('0x2a')](function(_0x3b193f){_0x4ac596[_0x42bb('0x45')](getRemoteTag(_0x3b193f,_0x59e4e9,_0x5a7afc,_0x2263c2,_0x519642));});return Promise[_0x42bb('0x46')](_0x4ac596)[_0x42bb('0x16')](function(_0x4c9533){if(_0x4c9533[_0x42bb('0x27')]){logger[_0x42bb('0xe')]('['+[_0xe1f4cf[_0x42bb('0xf')]()]+_0x42bb('0x47'),_0x4c9533);var _0x4b2967=[];_0x4c9533[_0x42bb('0x2a')](function(_0x52527f){_0x4b2967[_0x42bb('0x45')](assignTagToIncident(_0x52527f,_0x59e4e9,_0x5a7afc,_0x294664,_0x2263c2));});return Promise[_0x42bb('0x46')](_0x4b2967)[_0x42bb('0x16')](function(){_0x530c5b();})[_0x42bb('0x11')](function(){_0x530c5b();});}else{_0x530c5b();}});});}function getTags(_0x2b15f4,_0x2ed3cf,_0x27067d,_0x4567a2,_0x583c21,_0x2cb873){return function(_0x45eb27){return new Promise(function(_0x2042d8,_0x5b2ab5){var _0x205c62=[];var _0x27ad87=_0x4567a2[_0x42bb('0x48')];if(_0x27ad87&&_0x27ad87[_0x42bb('0x27')]>0x0){_0x205c62=_[_0x42bb('0x49')](_0x27ad87,'name');}if(_0x205c62[_0x42bb('0x27')]>0x0){return manageTags(_0x2b15f4,_0x205c62,_0x2ed3cf,_0x27067d,_0x45eb27,_0x583c21,_0x2cb873)['then'](function(){_0x2042d8(_0x45eb27);});}else{_0x2042d8(_0x45eb27);}});};}function emit(_0x79e192,_0x4ab7ee,_0x320cef){var _0x456f52=_0x42bb('0x4a')+_0x42bb('0x4b')+_0x42bb('0x4c')+_0x42bb('0x4d');var _0x1952cc={'uri':_0x79e192+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x320cef+_0x456f52};io['to'](util[_0x42bb('0x4e')](_0x42bb('0x4f'),_0x4ab7ee))['emit']('trigger:browser:url',_0x1952cc);}exports['cs']=function(_0x1501f3,_0x7e2f1c,_0x54e7ab,_0x3dd305,_0x2ddffe,_0x4bfb74,_0x46d882,_0x517f8b){var _0x3202f8={};var _0x16a757={'user':_0x4bfb74[_0x42bb('0x50')],'pass':_0x4bfb74['password']};var _0x5595f3=_0x42bb('0x51');var _0x58e406=_0x42bb('0x52');_0x4bfb74['remoteUri']=intUtil['stripTrailingSlash'](_0x4bfb74[_0x42bb('0x53')]);_0x4bfb74['serverUrl']=intUtil[_0x42bb('0x54')](_0x4bfb74[_0x42bb('0x55')]);var _0x4b5d6d=util[_0x42bb('0x4e')](_0x42bb('0x56'),_0x4bfb74[_0x42bb('0x53')]);_0x3202f8[_0x42bb('0x1b')]=!_[_0x42bb('0x57')](_0x3dd305)?_0x3dd305[_0x42bb('0x58')]:null;_0x3202f8[_0x42bb('0x1c')]=_0x4bfb74['email'];_0x3202f8[_0x42bb('0x23')]=_0x517f8b[_0x42bb('0x2f')]()===_0x42bb('0x59')?_0x7e2f1c[_0x42bb('0x5a')]:_0x7e2f1c[_0x42bb('0x5b')];_0x3202f8[_0x42bb('0x5c')]=_0x517f8b===_0x42bb('0x5d')||_0x517f8b===_0x42bb('0x5e')?_0x42bb('0x5d'):'outbound';var _0x5296e3=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb74[_0x42bb('0x55')],_0x7e2f1c[_0x42bb('0x5f')],md5(_0x7e2f1c[_0x42bb('0x5f')]));if(_0x2ddffe&&_0x2ddffe[_0x42bb('0x60')]){logger['info']('[QUEUE]',_0x42bb('0x61'));_0x7e2f1c[_0x42bb('0x62')]=_0x5296e3;}else if(_0x46d882&&_0x46d882[_0x42bb('0x63')]&&_0x46d882[_0x42bb('0x63')]!==_0x42bb('0x64')){logger[_0x42bb('0xe')]('[OUTBOUND]',_0x42bb('0x61'));_0x7e2f1c['recordingURL']=_0x5296e3;}else{_0x7e2f1c[_0x42bb('0x62')]='';}return getAdminUser(_0x517f8b,_0x16a757,_0x3202f8,_0x4b5d6d,_0x58e406,_0x5595f3)[_0x42bb('0x16')](getUser(_0x517f8b,_0x16a757,_0x4b5d6d,_0x58e406,_0x5595f3))[_0x42bb('0x16')](getEndUser(_0x517f8b,_0x16a757,_0x4b5d6d,_0x58e406,_0x5595f3))[_0x42bb('0x16')](getTicket(_0x517f8b,_0x16a757,_0x4b5d6d,_0x54e7ab,_0x7e2f1c,_0x58e406))[_0x42bb('0x16')](function(_0x4efffe){logger[_0x42bb('0xe')](util[_0x42bb('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4efffe[_0x42bb('0x44')]));logger['info'](util['format'](_0x42bb('0x65'),_0x517f8b));if(_0x517f8b!==_0x42bb('0x5e')){logger[_0x42bb('0xe')]('['+[_0x517f8b[_0x42bb('0xf')]()]+']',_0x42bb('0x66'));emit(_0x4bfb74[_0x42bb('0x53')],_0x3dd305[_0x42bb('0x36')],_0x4efffe['ticketId']);}})[_0x42bb('0x11')](function(_0xe16037){logger[_0x42bb('0x12')]('['+[_0x517f8b['toUpperCase']()]+_0x42bb('0x67'),util['inspect'](_0xe16037,{'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 4d833ee..c8c5cca 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 _0x7418=['uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','Fields','Outbound','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','nameField','customField','content','string','custom_fields','push','type','customVariable','Variable','toLowerCase','login','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0x7418,0x110));var _0x8741=function(_0x82d4df,_0x2777e1){_0x82d4df=_0x82d4df-0x0;var _0x10958b=_0x7418[_0x82d4df];return _0x10958b;};'use strict';var _=require(_0x8741('0x0'));var rp=require(_0x8741('0x1'));var BPromise=require('bluebird');var md5=require(_0x8741('0x2'));var util=require(_0x8741('0x3'));var Redis=require(_0x8741('0x4'));var intUtil=require(_0x8741('0x5'));var config=require(_0x8741('0x6'));var logger=require(_0x8741('0x7'))(_0x8741('0x8'));config[_0x8741('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8741('0xa'))(new Redis(config[_0x8741('0x9')]));var def={'method':_0x8741('0xb'),'json':!![]};function emit(_0x318352,_0x1aa722,_0xaf61e9){io['to'](_0x318352)[_0x8741('0xc')](_0x1aa722,_0xaf61e9);}function getTicket(_0xcf3b48,_0x433ae6,_0x3ec24a,_0x359335,_0x426abe,_0xefa35d,_0x1f80c3,_0x1a65b6){logger[_0x8741('0xd')](_0x8741('0xe'));var _0x11e149=new Date();var _0x35f854=[{'name':_0x8741('0xf'),'value':intUtil['getString'](_0x359335[_0x8741('0x10')],_0x426abe,'\x20')},{'name':_0x8741('0x11'),'value':_0x433ae6['id']},{'name':'created_by','value':_0x433ae6['id']},{'name':_0x8741('0x12'),'value':intUtil[_0x8741('0x13')](_0x359335[_0x8741('0x14')],_0x426abe,'\x0a')},{'name':'date_start','value':_0x11e149[_0x8741('0x15')]()[_0x8741('0x16')](0x0,0x13)[_0x8741('0x17')]('T','\x20')},{'name':_0x8741('0x18'),'value':'0'},{'name':_0x8741('0x19'),'value':'15'},{'name':_0x8741('0x1a'),'value':_0x3ec24a['id']},{'name':'parent_type','value':_0x8741('0x1b')},{'name':_0x8741('0x1c'),'value':_0x3ec24a[_0x8741('0xf')]},{'name':_0x8741('0x1d'),'value':_0x1a65b6}];if(_0xefa35d[_0x8741('0x1e')]){_[_0x8741('0x1f')](_0xefa35d,function(_0x40246d){if(_0x426abe[_0x40246d[_0x8741('0x20')]]){_0x35f854['push']({'name':_0x40246d[_0x8741('0x21')],'value':_0x426abe[_0x40246d[_0x8741('0x20')]]});}});}return request({'form':{'method':_0x8741('0x22'),'input_type':_0x8741('0x23'),'response_type':_0x8741('0x23'),'rest_data':JSON[_0x8741('0x24')]({'session':_0x1f80c3['id'],'module_name':_0x8741('0x25'),'name_value_list':_0x35f854})}});}function getAuth(_0x555697){return util[_0x8741('0x26')](_0x8741('0x27'),new Buffer(_0x555697[_0x8741('0x28')]+':X')[_0x8741('0x29')]('base64'));}function getServerInfo(_0x56ac86){return request({'form':{'method':_0x8741('0x2a'),'input_type':_0x8741('0x23'),'response_type':'JSON','rest_data':JSON[_0x8741('0x24')]({'session':_0x56ac86['id']})}});}function getUser(_0x3df787,_0x12c439,_0x32696f){if(!_[_0x8741('0x2b')](_0x12c439)){logger[_0x8741('0xd')](_0x8741('0x2c'),_0x12c439);return request({'form':{'method':_0x8741('0x2d'),'input_type':_0x8741('0x23'),'response_type':_0x8741('0x23'),'rest_data':JSON['stringify']({'session':_0x32696f['id'],'module_name':_0x8741('0x2e'),'query':util[_0x8741('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x12c439),'order_by':'','offset':'0','select_fields':['id',_0x8741('0xf'),_0x8741('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8741('0x30')](function(_0x248f52){if(_0x248f52[_0x8741('0x31')][_0x8741('0x1e')]){var _0x20fb86=_[_0x8741('0x32')](_0x248f52['entry_list'],function(_0x38a7b4){return _0x38a7b4['name_value_list']['user_name'][_0x8741('0x33')]===_0x12c439;});if(_0x20fb86){logger[_0x8741('0xd')](_0x8741('0x34'));return BPromise[_0x8741('0x35')]({'id':_0x20fb86[_0x8741('0x36')]['id'][_0x8741('0x33')],'name':_0x20fb86[_0x8741('0x36')][_0x8741('0xf')][_0x8741('0x33')]});}}logger[_0x8741('0xd')](_0x8741('0x37'));return BPromise['resolve']({'id':_0x32696f[_0x8741('0x36')]['user_id'][_0x8741('0x33')],'name':_0x32696f[_0x8741('0x36')][_0x8741('0x2f')][_0x8741('0x33')]});});}else{logger[_0x8741('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x8741('0x35')]({'id':_0x32696f[_0x8741('0x36')][_0x8741('0x38')][_0x8741('0x33')],'name':_0x32696f[_0x8741('0x36')]['user_name']['value']});}}function getEndUser(_0x348483,_0x293ec6,_0xd9a750,_0x7a3d1){logger[_0x8741('0xd')](_0x8741('0x39'),_0xd9a750);return request({'form':{'method':_0x8741('0x2d'),'input_type':_0x8741('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x7a3d1['id'],'module_name':_0x8741('0x1b'),'query':util['format'](_0x8741('0x3a'),_0xd9a750),'order_by':'','offset':'0','select_fields':['id',_0x8741('0xf'),_0x8741('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8741('0x30')](function(_0x41c17a){if(_0x41c17a[_0x8741('0x31')][_0x8741('0x1e')]){var _0x1eea52=_[_0x8741('0x32')](_0x41c17a[_0x8741('0x31')],function(_0x2c4f4){return _0x2c4f4[_0x8741('0x36')][_0x8741('0x3b')][_0x8741('0x33')]===_0xd9a750;});if(_0x1eea52){logger[_0x8741('0xd')]('Enduser\x20found!');return BPromise[_0x8741('0x35')]({'id':_0x1eea52['name_value_list']['id']['value'],'name':_0x1eea52['name_value_list']['name'][_0x8741('0x33')],'phone':_0x1eea52['name_value_list'][_0x8741('0x3b')][_0x8741('0x33')]});}}else{logger[_0x8741('0xd')](_0x8741('0x3c'));return request({'form':{'method':_0x8741('0x22'),'input_type':'JSON','response_type':_0x8741('0x23'),'rest_data':JSON[_0x8741('0x24')]({'session':_0x7a3d1['id'],'module_name':_0x8741('0x1b'),'name_value_list':[{'name':_0x8741('0x3d'),'value':_0x293ec6!==_0x8741('0x3e')?_0x293ec6:util[_0x8741('0x26')](_0x8741('0x3f'),_0xd9a750)},{'name':_0x8741('0x3b'),'value':_0xd9a750}]})}})[_0x8741('0x30')](function(_0x5569d3){logger['info'](_0x8741('0x40'));return BPromise['resolve']({'id':_0x5569d3['id'],'name':_0x5569d3[_0x8741('0x31')][_0x8741('0x3d')][_0x8741('0x33')],'phone':_0x5569d3['entry_list'][_0x8741('0x3b')][_0x8741('0x33')]});});}});}function request(_0xbd10f3){logger[_0x8741('0x41')]('[HTTP]',JSON[_0x8741('0x24')](_0xbd10f3));return rp(_[_0x8741('0x42')](def,_0xbd10f3));}function getTags(_0x245164,_0x5ca32d){var _0x26222a=[];if(_0x245164&&_0x245164[_0x8741('0x1e')]>0x0){_0x26222a=_[_0x8741('0x43')](_0x245164,_0x5ca32d);}return _0x26222a;}function getCustomFields(_0x3486c9,_0x245d00){var _0x5ddba1=[];var _0x2103a2={'custom_fields':[]};if(_0x3486c9['length']>0x0){_[_0x8741('0x1f')](_0x3486c9,function(_0xd9826b){if(_0xd9826b['type']==='string'&&_0xd9826b[_0x8741('0x44')]&&!_0xd9826b[_0x8741('0x45')]){_0x2103a2[_0xd9826b[_0x8741('0x44')]['toLowerCase']()]=_0xd9826b[_0x8741('0x46')][_0x8741('0x29')]();}else if(_0xd9826b['type']===_0x8741('0x47')&&_0xd9826b['idField']&&_0xd9826b[_0x8741('0x45')]){_0x2103a2[_0x8741('0x48')][_0x8741('0x49')]({'id':_0xd9826b[_0x8741('0x21')],'value':_0xd9826b['content']['toString']()});}else if(_0xd9826b['type']==='variable'&&_0xd9826b['variableName']&&_0xd9826b[_0x8741('0x21')]&&_0xd9826b[_0x8741('0x45')]){_0x245d00[_0xd9826b[_0x8741('0x20')]]&&_0x2103a2['custom_fields']['push']({'id':_0xd9826b[_0x8741('0x21')],'value':_0x245d00[_0xd9826b[_0x8741('0x20')]]['toString']()});}else if(_0xd9826b[_0x8741('0x4a')]===_0x8741('0x4b')&&_0xd9826b[_0x8741('0x4c')]&&_0xd9826b[_0x8741('0x4c')]['name']&&_0xd9826b['idField']&&_0xd9826b[_0x8741('0x45')]){_0x245d00[_0xd9826b[_0x8741('0x4c')]['name'][_0x8741('0x4d')]()]&&_0x2103a2[_0x8741('0x48')][_0x8741('0x49')]({'id':_0xd9826b[_0x8741('0x21')],'value':_0x245d00[_0xd9826b[_0x8741('0x4c')][_0x8741('0xf')][_0x8741('0x4d')]()][_0x8741('0x29')]()});}});}return _0x2103a2;}function getConnection(_0xd5c0c6){return request({'method':_0x8741('0xb'),'form':{'method':_0x8741('0x4e'),'input_type':_0x8741('0x23'),'response_type':_0x8741('0x23'),'rest_data':JSON[_0x8741('0x24')]({'user_auth':{'user_name':_0xd5c0c6['username'],'password':_0xd5c0c6['password'],'encryption':'PLAIN'},'application':_0x8741('0x4f')})}})[_0x8741('0x30')](function(_0x45f383){var _0x22c6ba=_0x45f383;if(_0x22c6ba['id']){def[_0x8741('0x50')]=_0x22c6ba['id'];return BPromise['resolve'](_0x22c6ba);}else{throw new Error(util[_0x8741('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0xd5c0c6['id']));}});}function setRelationship(_0x193a47,_0x310daa,_0x1539d5,_0x289bd8){return request({'form':{'method':_0x8741('0x51'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8741('0x24')]({'session':_0x193a47['id'],'module_name':_0x8741('0x25'),'module_id':_0x1539d5['id'],'link_field_name':_0x289bd8,'related_ids':[_0x310daa['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8741('0x52')]=function(_0x27bf2a,_0x23370a,_0x91f9e1,_0x3efccb,_0x4abe41,_0x5f437e){var _0x2bdff0,_0x220e6e,_0x4525d0,_0x56f867;_0x5f437e[_0x8741('0x53')]=intUtil[_0x8741('0x54')](_0x5f437e[_0x8741('0x53')]);_0x5f437e['serverUrl']=intUtil['stripTrailingSlash'](_0x5f437e[_0x8741('0x55')]);def[_0x8741('0x56')]=util[_0x8741('0x26')](_0x8741('0x57'),_0x5f437e[_0x8741('0x53')]);if(_0x4abe41&&_0x4abe41['monitor_format']){logger['info'](_0x8741('0x58'),'Recording\x20is\x20enabled!');_0x23370a[_0x8741('0x59')]=util[_0x8741('0x26')](_0x8741('0x5a'),_0x5f437e[_0x8741('0x55')],_0x23370a[_0x8741('0x5b')],md5(_0x23370a[_0x8741('0x5b')]));}else{_0x23370a[_0x8741('0x59')]='';}return getConnection(_0x5f437e)[_0x8741('0x30')](function(_0x17b5c0){_0x56f867=_0x17b5c0;return getUser(_0x5f437e,_0x3efccb[_0x8741('0xf')],_0x56f867);})[_0x8741('0x30')](function(_0x3ba3c0){_0x2bdff0=_0x3ba3c0;logger[_0x8741('0xd')](_0x8741('0x5c'),_0x2bdff0['id']);return getEndUser(_0x5f437e,_0x23370a[_0x8741('0x5d')],_0x23370a[_0x8741('0x5e')],_0x56f867);})['then'](function(_0x23aac8){_0x220e6e=_0x23aac8;logger[_0x8741('0xd')]('The\x20Enduser\x20ID\x20is:',_0x220e6e['id']);return getTicket(_0x5f437e,_0x2bdff0,_0x220e6e,_0x91f9e1,_0x23370a,_0x91f9e1['Fields'],_0x56f867,_0x8741('0x5f'));})['then'](function(_0x78757e){_0x4525d0=_0x78757e;logger[_0x8741('0xd')](_0x8741('0x60'));logger[_0x8741('0xd')](_0x8741('0x61'),_0x4525d0['id']);return setRelationship(_0x56f867,_0x2bdff0,_0x4525d0,_0x8741('0x62'));})[_0x8741('0x30')](function(){return setRelationship(_0x56f867,_0x220e6e,_0x4525d0,_0x8741('0x63'));})[_0x8741('0x30')](function(){return getServerInfo(_0x56f867);})[_0x8741('0x30')](function(_0x16da3b){var _0x4e4ea1=parseInt(_0x16da3b[_0x8741('0x64')][_0x8741('0x65')](0x0));var _0xdb6d30=util['format'](_0x8741('0x66'),_0x5f437e[_0x8741('0x53')],_0x4525d0['id']);if(_0x4e4ea1>0x6){_0xdb6d30=util['format'](_0x8741('0x67'),_0x5f437e['remoteUri'],_0x4525d0['id']);}logger[_0x8741('0xd')](_0x8741('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8741('0x26')]('user:%s',_0x3efccb[_0x8741('0xf')]),_0x8741('0x68'),{'uri':_0xdb6d30});})['catch'](function(_0x2cd574){logger[_0x8741('0x69')](_0x8741('0x58'),JSON[_0x8741('0x24')](_0x2cd574));});};exports['outbound']=function(_0x4acc7a,_0x1e7409,_0x1b22df,_0x10aa80,_0x1f2889,_0x3fddda,_0x2dc1c5){var _0x532ca8,_0x59f27f,_0x546c2f,_0x451482;_0x3fddda[_0x8741('0x53')]=intUtil['stripTrailingSlash'](_0x3fddda['remoteUri']);_0x3fddda[_0x8741('0x55')]=intUtil[_0x8741('0x54')](_0x3fddda[_0x8741('0x55')]);def[_0x8741('0x56')]=util[_0x8741('0x26')]('%s/service/v4_1/rest.php',_0x3fddda[_0x8741('0x53')]);if(_0x2dc1c5&&_0x2dc1c5[_0x8741('0x6a')]&&_0x2dc1c5[_0x8741('0x6a')]!==_0x8741('0x6b')){logger[_0x8741('0xd')]('[OUTBOUND]',_0x8741('0x6c'));_0x1e7409[_0x8741('0x59')]=util[_0x8741('0x26')](_0x8741('0x5a'),_0x3fddda[_0x8741('0x55')],_0x1e7409['uniqueid'],md5(_0x1e7409['uniqueid']));}return getConnection(_0x3fddda)['then'](function(_0x5c7f3d){_0x451482=_0x5c7f3d;return getUser(_0x3fddda,_0x10aa80['name'],_0x451482);})[_0x8741('0x30')](function(_0x1da468){_0x532ca8=_0x1da468;logger['info'](_0x8741('0x5c'),_0x532ca8['id']);return getEndUser(_0x3fddda,_0x1e7409[_0x8741('0x6d')],_0x1e7409['destcalleridnum'],_0x451482);})[_0x8741('0x30')](function(_0x5093c5){_0x59f27f=_0x5093c5;logger[_0x8741('0xd')]('The\x20Enduser\x20ID\x20is:',_0x59f27f['id']);return getTicket(_0x3fddda,_0x532ca8,_0x59f27f,_0x1b22df,_0x1e7409,_0x1b22df[_0x8741('0x6e')],_0x451482,_0x8741('0x6f'));})['then'](function(_0x310955){_0x546c2f=_0x310955;logger[_0x8741('0xd')](_0x8741('0x60'));logger[_0x8741('0xd')]('The\x20Ticket\x20ID\x20is:',_0x546c2f['id']);return setRelationship(_0x451482,_0x532ca8,_0x546c2f,_0x8741('0x62'));})[_0x8741('0x30')](function(){return setRelationship(_0x451482,_0x59f27f,_0x546c2f,_0x8741('0x63'));})[_0x8741('0x30')](function(){return getServerInfo(_0x451482);})[_0x8741('0x30')](function(_0x24e795){var _0x55ea27=parseInt(_0x24e795[_0x8741('0x64')][_0x8741('0x65')](0x0));var _0x470ce6=util[_0x8741('0x26')](_0x8741('0x66'),_0x3fddda[_0x8741('0x53')],_0x546c2f['id']);if(_0x55ea27>0x6){_0x470ce6=util[_0x8741('0x26')](_0x8741('0x67'),_0x3fddda[_0x8741('0x53')],_0x546c2f['id']);}logger['info'](_0x8741('0x70'),_0x8741('0x71'));emit(util[_0x8741('0x26')](_0x8741('0x72'),_0x10aa80[_0x8741('0xf')]),_0x8741('0x68'),{'uri':_0x470ce6});})['catch'](function(_0x2ab5e9){logger[_0x8741('0x69')](_0x8741('0x70'),JSON[_0x8741('0x24')](_0x2ab5e9));});};exports[_0x8741('0x73')]=function(_0x45dad5,_0x4bb464,_0x447c72,_0x9e4ec6,_0x306603,_0x52066f){var _0x52b8e3,_0x3a74d1,_0x202bf4,_0x2e10d4;_0x52066f['remoteUri']=intUtil[_0x8741('0x54')](_0x52066f[_0x8741('0x53')]);_0x52066f[_0x8741('0x55')]=intUtil[_0x8741('0x54')](_0x52066f[_0x8741('0x55')]);def[_0x8741('0x56')]=util['format'](_0x8741('0x57'),_0x52066f[_0x8741('0x53')]);if(_0x306603&&_0x306603[_0x8741('0x74')]){logger[_0x8741('0xd')]('['+_0x4bb464[_0x8741('0x75')][_0x8741('0x76')]()+']',_0x8741('0x6c'));_0x4bb464[_0x8741('0x59')]=util['format'](_0x8741('0x5a'),_0x52066f[_0x8741('0x55')],_0x4bb464['uniqueid'],md5(_0x4bb464[_0x8741('0x5b')]));}else{_0x4bb464[_0x8741('0x59')]='';}return getConnection(_0x52066f)[_0x8741('0x30')](function(_0x4258a7){_0x2e10d4=_0x4258a7;if(!_[_0x8741('0x2b')](_0x9e4ec6)){return getUser(_0x52066f,_0x9e4ec6[_0x8741('0xf')],_0x2e10d4);}else{return getUser(_0x52066f,null,_0x2e10d4);}})['then'](function(_0x46aa42){_0x52b8e3=_0x46aa42;logger[_0x8741('0xd')]('The\x20User\x20ID\x20is:',_0x52b8e3['id']);return getEndUser(_0x52066f,_0x4bb464['calleridname'],_0x4bb464['calleridnum'],_0x2e10d4);})['then'](function(_0x2ff8f2){_0x3a74d1=_0x2ff8f2;logger[_0x8741('0xd')](_0x8741('0x77'),_0x3a74d1['id']);return getTicket(_0x52066f,_0x52b8e3,_0x3a74d1,_0x447c72,_0x4bb464,_0x447c72[_0x8741('0x6e')],_0x2e10d4,'Inbound');})[_0x8741('0x30')](function(_0x386537){_0x202bf4=_0x386537;logger[_0x8741('0xd')](_0x8741('0x60'));logger[_0x8741('0xd')](_0x8741('0x61'),_0x202bf4['id']);return setRelationship(_0x2e10d4,_0x52b8e3,_0x202bf4,_0x8741('0x62'));})[_0x8741('0x30')](function(){return setRelationship(_0x2e10d4,_0x3a74d1,_0x202bf4,_0x8741('0x63'));})['then'](function(){return getServerInfo(_0x2e10d4);})[_0x8741('0x78')](function(_0x8a4c8a){logger[_0x8741('0x69')]('['+_0x4bb464[_0x8741('0x75')][_0x8741('0x76')]()+']',JSON[_0x8741('0x24')](_0x8a4c8a));});}; \ No newline at end of file +var _0x22be=['toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','push','idField','JSON','stringify','Basic\x20%s','toString','isNil','Getting\x20agent\x20with\x20name','Employees','format','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','set_entry','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','custom_fields','content','variable','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','uri','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','contacts','[OUTBOUND]','error','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','Descriptions','date_start'];(function(_0x5f2af8,_0x5e49d9){var _0x4a757b=function(_0x2e6ab2){while(--_0x2e6ab2){_0x5f2af8['push'](_0x5f2af8['shift']());}};_0x4a757b(++_0x5e49d9);}(_0x22be,0x151));var _0xe22b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x22be[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe22b('0x0'));var rp=require(_0xe22b('0x1'));var BPromise=require('bluebird');var md5=require(_0xe22b('0x2'));var util=require(_0xe22b('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe22b('0x4'));var config=require(_0xe22b('0x5'));var logger=require(_0xe22b('0x6'))(_0xe22b('0x7'));config[_0xe22b('0x8')]=_[_0xe22b('0x9')](config[_0xe22b('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe22b('0x8')]));var def={'method':_0xe22b('0xa'),'json':!![]};function emit(_0x15caed,_0x337cb4,_0x5671af){io['to'](_0x15caed)[_0xe22b('0xb')](_0x337cb4,_0x5671af);}function getTicket(_0xfe5ed1,_0xf09b0f,_0x16d0e0,_0x567cb5,_0x1338c1,_0xa080d6,_0x3581b7,_0x42a796){logger[_0xe22b('0xc')](_0xe22b('0xd'));var _0xb0f53b=new Date();var _0x5c1814=[{'name':_0xe22b('0xe'),'value':intUtil[_0xe22b('0xf')](_0x567cb5['Subjects'],_0x1338c1,'\x20')},{'name':_0xe22b('0x10'),'value':_0xf09b0f['id']},{'name':_0xe22b('0x11'),'value':_0xf09b0f['id']},{'name':'description','value':intUtil[_0xe22b('0xf')](_0x567cb5[_0xe22b('0x12')],_0x1338c1,'\x0a')},{'name':_0xe22b('0x13'),'value':_0xb0f53b[_0xe22b('0x14')]()[_0xe22b('0x15')](0x0,0x13)[_0xe22b('0x16')]('T','\x20')},{'name':_0xe22b('0x17'),'value':'0'},{'name':_0xe22b('0x18'),'value':'15'},{'name':_0xe22b('0x19'),'value':_0x16d0e0['id']},{'name':_0xe22b('0x1a'),'value':_0xe22b('0x1b')},{'name':'parent_name','value':_0x16d0e0[_0xe22b('0xe')]},{'name':_0xe22b('0x1c'),'value':_0x42a796}];if(_0xa080d6[_0xe22b('0x1d')]){_[_0xe22b('0x1e')](_0xa080d6,function(_0x28dc9f){if(_0x1338c1[_0x28dc9f[_0xe22b('0x1f')]]){_0x5c1814[_0xe22b('0x20')]({'name':_0x28dc9f[_0xe22b('0x21')],'value':_0x1338c1[_0x28dc9f[_0xe22b('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xe22b('0x22'),'response_type':_0xe22b('0x22'),'rest_data':JSON[_0xe22b('0x23')]({'session':_0x3581b7['id'],'module_name':'Calls','name_value_list':_0x5c1814})}});}function getAuth(_0x16ff8a){return util['format'](_0xe22b('0x24'),new Buffer(_0x16ff8a['apiKey']+':X')[_0xe22b('0x25')]('base64'));}function getServerInfo(_0x189a7d){return request({'form':{'method':'get_server_info','input_type':_0xe22b('0x22'),'response_type':_0xe22b('0x22'),'rest_data':JSON[_0xe22b('0x23')]({'session':_0x189a7d['id']})}});}function getUser(_0x578784,_0x4cb08b,_0x1912b0){if(!_[_0xe22b('0x26')](_0x4cb08b)){logger['info'](_0xe22b('0x27'),_0x4cb08b);return request({'form':{'method':'get_entry_list','input_type':_0xe22b('0x22'),'response_type':_0xe22b('0x22'),'rest_data':JSON[_0xe22b('0x23')]({'session':_0x1912b0['id'],'module_name':_0xe22b('0x28'),'query':util[_0xe22b('0x29')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4cb08b),'order_by':'','offset':'0','select_fields':['id',_0xe22b('0xe'),_0xe22b('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe22b('0x2b')](function(_0x38b541){if(_0x38b541['entry_list'][_0xe22b('0x1d')]){var _0x2531cb=_['find'](_0x38b541[_0xe22b('0x2c')],function(_0x575432){return _0x575432[_0xe22b('0x2d')][_0xe22b('0x2a')][_0xe22b('0x2e')]===_0x4cb08b;});if(_0x2531cb){logger[_0xe22b('0xc')](_0xe22b('0x2f'));return BPromise[_0xe22b('0x30')]({'id':_0x2531cb[_0xe22b('0x2d')]['id']['value'],'name':_0x2531cb[_0xe22b('0x2d')][_0xe22b('0xe')]['value']});}}logger[_0xe22b('0xc')](_0xe22b('0x31'));return BPromise[_0xe22b('0x30')]({'id':_0x1912b0['name_value_list'][_0xe22b('0x32')]['value'],'name':_0x1912b0[_0xe22b('0x2d')][_0xe22b('0x2a')][_0xe22b('0x2e')]});});}else{logger[_0xe22b('0xc')](_0xe22b('0x33'));return BPromise[_0xe22b('0x30')]({'id':_0x1912b0[_0xe22b('0x2d')]['user_id']['value'],'name':_0x1912b0['name_value_list'][_0xe22b('0x2a')][_0xe22b('0x2e')]});}}function getEndUser(_0x4f32dc,_0x1346cc,_0x5bac0a,_0x1824c4){logger[_0xe22b('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5bac0a);return request({'form':{'method':_0xe22b('0x34'),'input_type':_0xe22b('0x22'),'response_type':'JSON','rest_data':JSON[_0xe22b('0x23')]({'session':_0x1824c4['id'],'module_name':'Contacts','query':util[_0xe22b('0x29')](_0xe22b('0x35'),_0x5bac0a),'order_by':'','offset':'0','select_fields':['id','name',_0xe22b('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x25f89a){if(_0x25f89a[_0xe22b('0x2c')]['length']){var _0x1c0237=_[_0xe22b('0x37')](_0x25f89a[_0xe22b('0x2c')],function(_0x27ac15){return _0x27ac15[_0xe22b('0x2d')]['phone_home'][_0xe22b('0x2e')]===_0x5bac0a;});if(_0x1c0237){logger[_0xe22b('0xc')](_0xe22b('0x38'));return BPromise[_0xe22b('0x30')]({'id':_0x1c0237[_0xe22b('0x2d')]['id'][_0xe22b('0x2e')],'name':_0x1c0237[_0xe22b('0x2d')]['name'][_0xe22b('0x2e')],'phone':_0x1c0237[_0xe22b('0x2d')][_0xe22b('0x36')][_0xe22b('0x2e')]});}}else{logger[_0xe22b('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe22b('0x39'),'input_type':_0xe22b('0x22'),'response_type':'JSON','rest_data':JSON[_0xe22b('0x23')]({'session':_0x1824c4['id'],'module_name':_0xe22b('0x1b'),'name_value_list':[{'name':_0xe22b('0x3a'),'value':_0x1346cc!==_0xe22b('0x3b')?_0x1346cc:util[_0xe22b('0x29')]('Caller\x20-\x20%s',_0x5bac0a)},{'name':'phone_home','value':_0x5bac0a}]})}})[_0xe22b('0x2b')](function(_0x188034){logger['info'](_0xe22b('0x3c'));return BPromise[_0xe22b('0x30')]({'id':_0x188034['id'],'name':_0x188034[_0xe22b('0x2c')][_0xe22b('0x3a')][_0xe22b('0x2e')],'phone':_0x188034[_0xe22b('0x2c')][_0xe22b('0x36')][_0xe22b('0x2e')]});});}});}function request(_0x51d21d){logger[_0xe22b('0x3d')](_0xe22b('0x3e'),JSON[_0xe22b('0x23')](_0x51d21d));return rp(_[_0xe22b('0x3f')](def,_0x51d21d));}function getTags(_0x34a07e,_0xd26c10){var _0x2b7c39=[];if(_0x34a07e&&_0x34a07e[_0xe22b('0x1d')]>0x0){_0x2b7c39=_[_0xe22b('0x40')](_0x34a07e,_0xd26c10);}return _0x2b7c39;}function getCustomFields(_0x149276,_0x4b1fbf){var _0x3086e5=[];var _0x39874e={'custom_fields':[]};if(_0x149276['length']>0x0){_[_0xe22b('0x1e')](_0x149276,function(_0x1afc82){if(_0x1afc82[_0xe22b('0x41')]===_0xe22b('0x42')&&_0x1afc82['nameField']&&!_0x1afc82[_0xe22b('0x43')]){_0x39874e[_0x1afc82[_0xe22b('0x44')][_0xe22b('0x45')]()]=_0x1afc82['content'][_0xe22b('0x25')]();}else if(_0x1afc82[_0xe22b('0x41')]===_0xe22b('0x42')&&_0x1afc82[_0xe22b('0x21')]&&_0x1afc82[_0xe22b('0x43')]){_0x39874e[_0xe22b('0x46')][_0xe22b('0x20')]({'id':_0x1afc82['idField'],'value':_0x1afc82[_0xe22b('0x47')][_0xe22b('0x25')]()});}else if(_0x1afc82[_0xe22b('0x41')]===_0xe22b('0x48')&&_0x1afc82['variableName']&&_0x1afc82['idField']&&_0x1afc82[_0xe22b('0x43')]){_0x4b1fbf[_0x1afc82[_0xe22b('0x1f')]]&&_0x39874e[_0xe22b('0x46')]['push']({'id':_0x1afc82[_0xe22b('0x21')],'value':_0x4b1fbf[_0x1afc82[_0xe22b('0x1f')]]['toString']()});}else if(_0x1afc82[_0xe22b('0x41')]===_0xe22b('0x49')&&_0x1afc82[_0xe22b('0x4a')]&&_0x1afc82[_0xe22b('0x4a')]['name']&&_0x1afc82[_0xe22b('0x21')]&&_0x1afc82[_0xe22b('0x43')]){_0x4b1fbf[_0x1afc82[_0xe22b('0x4a')][_0xe22b('0xe')][_0xe22b('0x45')]()]&&_0x39874e[_0xe22b('0x46')]['push']({'id':_0x1afc82[_0xe22b('0x21')],'value':_0x4b1fbf[_0x1afc82[_0xe22b('0x4a')][_0xe22b('0xe')][_0xe22b('0x45')]()][_0xe22b('0x25')]()});}});}return _0x39874e;}function getConnection(_0x1734c9){return request({'method':_0xe22b('0xa'),'form':{'method':_0xe22b('0x4b'),'input_type':_0xe22b('0x22'),'response_type':_0xe22b('0x22'),'rest_data':JSON[_0xe22b('0x23')]({'user_auth':{'user_name':_0x1734c9[_0xe22b('0x4c')],'password':_0x1734c9['password'],'encryption':'PLAIN'},'application':_0xe22b('0x4d')})}})[_0xe22b('0x2b')](function(_0x386b14){var _0x3a2f27=_0x386b14;if(_0x3a2f27['id']){def[_0xe22b('0x4e')]=_0x3a2f27['id'];return BPromise[_0xe22b('0x30')](_0x3a2f27);}else{throw new Error(util[_0xe22b('0x29')]('Account\x20%d\x20is\x20not\x20valid',_0x1734c9['id']));}});}function setRelationship(_0x5ae5fb,_0xc37e3a,_0x5b645a,_0x568812){return request({'form':{'method':_0xe22b('0x4f'),'input_type':_0xe22b('0x22'),'response_type':_0xe22b('0x22'),'rest_data':JSON[_0xe22b('0x23')]({'session':_0x5ae5fb['id'],'module_name':_0xe22b('0x50'),'module_id':_0x5b645a['id'],'link_field_name':_0x568812,'related_ids':[_0xc37e3a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe22b('0x51')]=function(_0x557c05,_0x446b8a,_0x4eaffe,_0x1d942f,_0x8c783b,_0x18d6f6){var _0x25cfa1,_0x23bce6,_0x1ddab7,_0x3ea22c;_0x18d6f6[_0xe22b('0x52')]=intUtil[_0xe22b('0x53')](_0x18d6f6[_0xe22b('0x52')]);_0x18d6f6['serverUrl']=intUtil[_0xe22b('0x53')](_0x18d6f6[_0xe22b('0x54')]);def['uri']=util[_0xe22b('0x29')](_0xe22b('0x55'),_0x18d6f6['remoteUri']);if(_0x8c783b&&_0x8c783b[_0xe22b('0x56')]){logger[_0xe22b('0xc')](_0xe22b('0x57'),'Recording\x20is\x20enabled!');_0x446b8a[_0xe22b('0x58')]=util['format'](_0xe22b('0x59'),_0x18d6f6['serverUrl'],_0x446b8a['uniqueid'],md5(_0x446b8a[_0xe22b('0x5a')]));}else{_0x446b8a['recordingURL']='';}return getConnection(_0x18d6f6)[_0xe22b('0x2b')](function(_0x1c3b42){_0x3ea22c=_0x1c3b42;return getUser(_0x18d6f6,_0x1d942f['name'],_0x3ea22c);})[_0xe22b('0x2b')](function(_0xddd553){_0x25cfa1=_0xddd553;logger['info'](_0xe22b('0x5b'),_0x25cfa1['id']);return getEndUser(_0x18d6f6,_0x446b8a['calleridname'],_0x446b8a['calleridnum'],_0x3ea22c);})['then'](function(_0x90b6a4){_0x23bce6=_0x90b6a4;logger[_0xe22b('0xc')](_0xe22b('0x5c'),_0x23bce6['id']);return getTicket(_0x18d6f6,_0x25cfa1,_0x23bce6,_0x4eaffe,_0x446b8a,_0x4eaffe[_0xe22b('0x5d')],_0x3ea22c,'Inbound');})[_0xe22b('0x2b')](function(_0x2d89b5){_0x1ddab7=_0x2d89b5;logger['info'](_0xe22b('0x5e'));logger[_0xe22b('0xc')](_0xe22b('0x5f'),_0x1ddab7['id']);return setRelationship(_0x3ea22c,_0x25cfa1,_0x1ddab7,_0xe22b('0x60'));})[_0xe22b('0x2b')](function(){return setRelationship(_0x3ea22c,_0x23bce6,_0x1ddab7,'contacts');})[_0xe22b('0x2b')](function(){return getServerInfo(_0x3ea22c);})['then'](function(_0x13f6f1){var _0x3df5f=parseInt(_0x13f6f1[_0xe22b('0x61')][_0xe22b('0x62')](0x0));var _0x5234b1=util[_0xe22b('0x29')](_0xe22b('0x63'),_0x18d6f6[_0xe22b('0x52')],_0x1ddab7['id']);if(_0x3df5f>0x6){_0x5234b1=util['format'](_0xe22b('0x64'),_0x18d6f6[_0xe22b('0x52')],_0x1ddab7['id']);}logger[_0xe22b('0xc')](_0xe22b('0x57'),_0xe22b('0x65'));emit(util[_0xe22b('0x29')](_0xe22b('0x66'),_0x1d942f[_0xe22b('0xe')]),_0xe22b('0x67'),{'uri':_0x5234b1});})[_0xe22b('0x68')](function(_0x5923c4){logger['error'](_0xe22b('0x57'),JSON['stringify'](_0x5923c4));});};exports[_0xe22b('0x69')]=function(_0x2d648c,_0x24b8ef,_0x2bef61,_0x36fcb8,_0x46a10b,_0x16e6e1,_0x3df2a5){var _0x1c3eb7,_0x36b49b,_0x47d1b2,_0x2659d2;_0x16e6e1[_0xe22b('0x52')]=intUtil[_0xe22b('0x53')](_0x16e6e1[_0xe22b('0x52')]);_0x16e6e1['serverUrl']=intUtil['stripTrailingSlash'](_0x16e6e1['serverUrl']);def[_0xe22b('0x6a')]=util[_0xe22b('0x29')](_0xe22b('0x55'),_0x16e6e1['remoteUri']);if(_0x3df2a5&&_0x3df2a5[_0xe22b('0x6b')]&&_0x3df2a5[_0xe22b('0x6b')]!==_0xe22b('0x6c')){logger['info']('[OUTBOUND]',_0xe22b('0x6d'));_0x24b8ef[_0xe22b('0x58')]=util[_0xe22b('0x29')](_0xe22b('0x59'),_0x16e6e1[_0xe22b('0x54')],_0x24b8ef[_0xe22b('0x5a')],md5(_0x24b8ef[_0xe22b('0x5a')]));}return getConnection(_0x16e6e1)['then'](function(_0x1fe8fd){_0x2659d2=_0x1fe8fd;return getUser(_0x16e6e1,_0x36fcb8[_0xe22b('0xe')],_0x2659d2);})[_0xe22b('0x2b')](function(_0x4448a7){_0x1c3eb7=_0x4448a7;logger[_0xe22b('0xc')](_0xe22b('0x5b'),_0x1c3eb7['id']);return getEndUser(_0x16e6e1,_0x24b8ef[_0xe22b('0x6e')],_0x24b8ef[_0xe22b('0x6f')],_0x2659d2);})['then'](function(_0x39a005){_0x36b49b=_0x39a005;logger[_0xe22b('0xc')](_0xe22b('0x5c'),_0x36b49b['id']);return getTicket(_0x16e6e1,_0x1c3eb7,_0x36b49b,_0x2bef61,_0x24b8ef,_0x2bef61[_0xe22b('0x5d')],_0x2659d2,'Outbound');})['then'](function(_0x1f3ad9){_0x47d1b2=_0x1f3ad9;logger[_0xe22b('0xc')](_0xe22b('0x5e'));logger[_0xe22b('0xc')](_0xe22b('0x5f'),_0x47d1b2['id']);return setRelationship(_0x2659d2,_0x1c3eb7,_0x47d1b2,_0xe22b('0x60'));})[_0xe22b('0x2b')](function(){return setRelationship(_0x2659d2,_0x36b49b,_0x47d1b2,_0xe22b('0x70'));})['then'](function(){return getServerInfo(_0x2659d2);})[_0xe22b('0x2b')](function(_0x6ea315){var _0x2c150=parseInt(_0x6ea315[_0xe22b('0x61')][_0xe22b('0x62')](0x0));var _0x596af7=util[_0xe22b('0x29')](_0xe22b('0x63'),_0x16e6e1['remoteUri'],_0x47d1b2['id']);if(_0x2c150>0x6){_0x596af7=util[_0xe22b('0x29')](_0xe22b('0x64'),_0x16e6e1['remoteUri'],_0x47d1b2['id']);}logger[_0xe22b('0xc')](_0xe22b('0x71'),_0xe22b('0x65'));emit(util[_0xe22b('0x29')](_0xe22b('0x66'),_0x36fcb8[_0xe22b('0xe')]),'trigger:browser:url',{'uri':_0x596af7});})['catch'](function(_0x5ce634){logger[_0xe22b('0x72')](_0xe22b('0x71'),JSON['stringify'](_0x5ce634));});};exports[_0xe22b('0x73')]=function(_0x1c8d32,_0x5bb637,_0x391ebe,_0x3f16af,_0x287e13,_0x13432c){var _0x1005f4,_0x48a42b,_0x4da34c,_0x38a5cc;_0x13432c['remoteUri']=intUtil[_0xe22b('0x53')](_0x13432c[_0xe22b('0x52')]);_0x13432c[_0xe22b('0x54')]=intUtil[_0xe22b('0x53')](_0x13432c[_0xe22b('0x54')]);def['uri']=util[_0xe22b('0x29')](_0xe22b('0x55'),_0x13432c[_0xe22b('0x52')]);if(_0x287e13&&_0x287e13['monitor_format']){logger['info']('['+_0x5bb637[_0xe22b('0x74')][_0xe22b('0x75')]()+']',_0xe22b('0x6d'));_0x5bb637[_0xe22b('0x58')]=util[_0xe22b('0x29')](_0xe22b('0x59'),_0x13432c['serverUrl'],_0x5bb637[_0xe22b('0x5a')],md5(_0x5bb637['uniqueid']));}else{_0x5bb637[_0xe22b('0x58')]='';}return getConnection(_0x13432c)[_0xe22b('0x2b')](function(_0x4f35ac){_0x38a5cc=_0x4f35ac;if(!_['isNil'](_0x3f16af)){return getUser(_0x13432c,_0x3f16af[_0xe22b('0xe')],_0x38a5cc);}else{return getUser(_0x13432c,null,_0x38a5cc);}})[_0xe22b('0x2b')](function(_0x1ba836){_0x1005f4=_0x1ba836;logger[_0xe22b('0xc')](_0xe22b('0x5b'),_0x1005f4['id']);return getEndUser(_0x13432c,_0x5bb637[_0xe22b('0x76')],_0x5bb637['calleridnum'],_0x38a5cc);})[_0xe22b('0x2b')](function(_0x480579){_0x48a42b=_0x480579;logger['info'](_0xe22b('0x5c'),_0x48a42b['id']);return getTicket(_0x13432c,_0x1005f4,_0x48a42b,_0x391ebe,_0x5bb637,_0x391ebe[_0xe22b('0x5d')],_0x38a5cc,'Inbound');})[_0xe22b('0x2b')](function(_0x4be295){_0x4da34c=_0x4be295;logger[_0xe22b('0xc')](_0xe22b('0x5e'));logger[_0xe22b('0xc')](_0xe22b('0x5f'),_0x4da34c['id']);return setRelationship(_0x38a5cc,_0x1005f4,_0x4da34c,_0xe22b('0x60'));})[_0xe22b('0x2b')](function(){return setRelationship(_0x38a5cc,_0x48a42b,_0x4da34c,_0xe22b('0x70'));})[_0xe22b('0x2b')](function(){return getServerInfo(_0x38a5cc);})[_0xe22b('0x68')](function(_0x20222a){logger[_0xe22b('0x72')]('['+_0x5bb637[_0xe22b('0x74')][_0xe22b('0x75')]()+']',JSON[_0xe22b('0x23')](_0x20222a));});}; \ 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 e8569d6..c7072d9 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 _0xaca3=['getString','length','sortBy','string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','keyType','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','isNil','lodash','util'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0xaca3,0x1f2));var _0x3aca=function(_0x1ee321,_0x260dbc){_0x1ee321=_0x1ee321-0x0;var _0x4dafc3=_0xaca3[_0x1ee321];return _0x4dafc3;};'use strict';var _=require(_0x3aca('0x0'));var util=require(_0x3aca('0x1'));exports[_0x3aca('0x2')]=function(_0x1f1119,_0x421fc0,_0x3a8219){var _0x5b738f=[];if(_0x1f1119[_0x3aca('0x3')]>0x0){var _0x479c1d=_[_0x3aca('0x4')](_0x1f1119,['id']);for(var _0x2ef7d9=0x0;_0x2ef7d9<_0x479c1d[_0x3aca('0x3')];_0x2ef7d9++){var _0xbf858=_0x479c1d[_0x2ef7d9];if(_0xbf858['type']===_0x3aca('0x5')){_0x5b738f[_0x3aca('0x6')](_0xbf858['content']);}else if(_0xbf858[_0x3aca('0x7')]===_0x3aca('0x8')&&_0xbf858['variableName']){_0x421fc0[_0xbf858['variableName']]&&_0x5b738f['push'](_0x421fc0[_0xbf858[_0x3aca('0x9')]][_0x3aca('0xa')]());}else if(_0xbf858[_0x3aca('0x7')]===_0x3aca('0xb')&&_0xbf858[_0x3aca('0xc')]&&_0xbf858[_0x3aca('0xc')][_0x3aca('0xd')]){_0x421fc0[_0xbf858[_0x3aca('0xc')][_0x3aca('0xd')][_0x3aca('0xe')]()]&&_0x5b738f[_0x3aca('0x6')](_0x421fc0[_0xbf858[_0x3aca('0xc')]['name'][_0x3aca('0xe')]()][_0x3aca('0xa')]());}else if(_0xbf858[_0x3aca('0x7')]===_0x3aca('0xf')){if(_0xbf858['keyType']===_0x3aca('0x5')&&_0xbf858[_0x3aca('0x10')]){_0x5b738f[_0x3aca('0x6')](util[_0x3aca('0x11')]('%s:\x20%s',_0xbf858[_0x3aca('0x10')],_0xbf858['keyContent']));}else if(_0xbf858[_0x3aca('0x12')]===_0x3aca('0x8')&&_0xbf858[_0x3aca('0x9')]&&_0xbf858['key']){_0x421fc0[_0xbf858[_0x3aca('0x9')]]&&_0x5b738f[_0x3aca('0x6')](util['format']('%s:\x20%s',_0xbf858['key'],_0x421fc0[_0xbf858['variableName']]));}else if(_0xbf858[_0x3aca('0x12')]==='customVariable'&&_0xbf858[_0x3aca('0xc')]&&_0xbf858[_0x3aca('0xc')][_0x3aca('0xd')]&&_0xbf858[_0x3aca('0x10')]){_0x421fc0[_0xbf858[_0x3aca('0xc')][_0x3aca('0xd')]['toLowerCase']()]&&_0x5b738f['push'](util[_0x3aca('0x11')](_0x3aca('0x13'),_0xbf858['key'],_0x421fc0[_0xbf858[_0x3aca('0xc')]['name'][_0x3aca('0xe')]()]));}}}}return _0x5b738f[_0x3aca('0x14')](_0x3a8219);};exports[_0x3aca('0x15')]=function(_0x543165){var _0x301912=_0x543165['slice'](-0x1);if(_0x301912==='/'){_0x543165=_0x543165[_0x3aca('0x16')](0x0,_0x543165[_0x3aca('0x17')](_0x301912));}return _0x543165;};exports['validateEmail']=function(_0x44c3a0){if(!_[_0x3aca('0x18')](_0x44c3a0)&&_0x44c3a0!==''){var _0x2573d7=/^(([^<>()\[\]\\.,;:\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 _0x2573d7['test'](String(_0x44c3a0)[_0x3aca('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x3a92=['type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','keyContent','keyType','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','sortBy','length'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0x3a92,0x1a6));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23a9('0x0'));var util=require('util');exports['getString']=function(_0x3cd25f,_0x1cba81,_0x3d7a2b){var _0x1d9aff=[];if(_0x3cd25f['length']>0x0){var _0x37aa30=_[_0x23a9('0x1')](_0x3cd25f,['id']);for(var _0x1a0308=0x0;_0x1a0308<_0x37aa30[_0x23a9('0x2')];_0x1a0308++){var _0x55788e=_0x37aa30[_0x1a0308];if(_0x55788e[_0x23a9('0x3')]===_0x23a9('0x4')){_0x1d9aff[_0x23a9('0x5')](_0x55788e['content']);}else if(_0x55788e[_0x23a9('0x3')]===_0x23a9('0x6')&&_0x55788e[_0x23a9('0x7')]){_0x1cba81[_0x55788e[_0x23a9('0x7')]]&&_0x1d9aff['push'](_0x1cba81[_0x55788e[_0x23a9('0x7')]][_0x23a9('0x8')]());}else if(_0x55788e[_0x23a9('0x3')]===_0x23a9('0x9')&&_0x55788e[_0x23a9('0xa')]&&_0x55788e[_0x23a9('0xa')]['name']){_0x1cba81[_0x55788e['Variable'][_0x23a9('0xb')][_0x23a9('0xc')]()]&&_0x1d9aff[_0x23a9('0x5')](_0x1cba81[_0x55788e[_0x23a9('0xa')][_0x23a9('0xb')]['toLowerCase']()][_0x23a9('0x8')]());}else if(_0x55788e[_0x23a9('0x3')]===_0x23a9('0xd')){if(_0x55788e['keyType']===_0x23a9('0x4')&&_0x55788e[_0x23a9('0xe')]){_0x1d9aff[_0x23a9('0x5')](util[_0x23a9('0xf')]('%s:\x20%s',_0x55788e[_0x23a9('0xe')],_0x55788e[_0x23a9('0x10')]));}else if(_0x55788e[_0x23a9('0x11')]==='variable'&&_0x55788e[_0x23a9('0x7')]&&_0x55788e[_0x23a9('0xe')]){_0x1cba81[_0x55788e[_0x23a9('0x7')]]&&_0x1d9aff[_0x23a9('0x5')](util[_0x23a9('0xf')](_0x23a9('0x12'),_0x55788e['key'],_0x1cba81[_0x55788e['variableName']]));}else if(_0x55788e['keyType']==='customVariable'&&_0x55788e[_0x23a9('0xa')]&&_0x55788e[_0x23a9('0xa')][_0x23a9('0xb')]&&_0x55788e[_0x23a9('0xe')]){_0x1cba81[_0x55788e[_0x23a9('0xa')][_0x23a9('0xb')][_0x23a9('0xc')]()]&&_0x1d9aff[_0x23a9('0x5')](util[_0x23a9('0xf')]('%s:\x20%s',_0x55788e[_0x23a9('0xe')],_0x1cba81[_0x55788e[_0x23a9('0xa')][_0x23a9('0xb')][_0x23a9('0xc')]()]));}}}}return _0x1d9aff[_0x23a9('0x13')](_0x3d7a2b);};exports[_0x23a9('0x14')]=function(_0x11b243){var _0x31438b=_0x11b243[_0x23a9('0x15')](-0x1);if(_0x31438b==='/'){_0x11b243=_0x11b243['substring'](0x0,_0x11b243[_0x23a9('0x16')](_0x31438b));}return _0x11b243;};exports[_0x23a9('0x17')]=function(_0x22ea76){if(!_[_0x23a9('0x18')](_0x22ea76)&&_0x22ea76!==''){var _0x51bd2e=/^(([^<>()\[\]\\.,;:\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 _0x51bd2e['test'](String(_0x22ea76)['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 273f3be..8b57850 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +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(_0x46cd04,_0x32f2da){var _0x108808=function(_0x13bb96){while(--_0x13bb96){_0x46cd04['push'](_0x46cd04['shift']());}};_0x108808(++_0x32f2da);}(_0xe706,0xa3));var _0x6e70=function(_0x469d01,_0x18c899){_0x469d01=_0x469d01-0x0;var _0x5078d3=_0xe706[_0x469d01];return _0x5078d3;};'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 47234c4..631269a 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 _0xad9a=['%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','emit','application/json','info','remoteUri','POST','Tags','name','Subjects','Descriptions','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','custom_fields','variable','variableName','Variable','push','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...'];(function(_0x419444,_0x18bc85){var _0x3a28b1=function(_0x4c785a){while(--_0x4c785a){_0x419444['push'](_0x419444['shift']());}};_0x3a28b1(++_0x18bc85);}(_0xad9a,0x171));var _0xaad9=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xad9a[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xaad9('0x0'));var rp=require(_0xaad9('0x1'));var md5=require(_0xaad9('0x2'));var util=require(_0xaad9('0x3'));var Redis=require('ioredis');var intUtil=require(_0xaad9('0x4'));var config=require(_0xaad9('0x5'));var logger=require(_0xaad9('0x6'))('zendesk');config['redis']=_['defaults'](config[_0xaad9('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaad9('0x7')]));function emit(_0x464bcc,_0x4ce2f2,_0x57b752){io['to'](_0x464bcc)[_0xaad9('0x8')](_0x4ce2f2,_0x57b752);}var headers={'Content-Type':_0xaad9('0x9'),'Accept':_0xaad9('0x9')};function getTicket(_0xb20888,_0x381a25,_0x5025e3,_0x3e9db3,_0x156416){logger[_0xaad9('0xa')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0xb20888[_0xaad9('0xb')]),'method':_0xaad9('0xc'),'body':{'ticket':_['merge']({'requester_id':_0x5025e3['id'],'submitter_id':_0x381a25?_0x381a25['id']:undefined,'assignee_id':_0x381a25?_0x381a25['id']:undefined,'tags':getTags(_0x3e9db3[_0xaad9('0xd')],_0xaad9('0xe')),'subject':intUtil['getString'](_0x3e9db3[_0xaad9('0xf')],_0x156416,'\x20'),'description':intUtil['getString'](_0x3e9db3[_0xaad9('0x10')],_0x156416,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaad9('0x11')](_0x3e9db3[_0xaad9('0x10')],_0x156416,'\x0a')}},getCustomFields(_0x3e9db3[_0xaad9('0x12')],_0x156416))}})[_0xaad9('0x13')](function(_0x4a1382){logger[_0xaad9('0xa')](_0xaad9('0x14'));return _0x4a1382[_0xaad9('0x15')];});}function getUser(_0xd3c2a9,_0x7fcefd){if(intUtil[_0xaad9('0x16')](_0x7fcefd)){logger['info'](_0xaad9('0x17'),_0x7fcefd);return request({'uri':util['format']('%s/search.json',_0xd3c2a9['remoteUri']),'qs':{'query':util[_0xaad9('0x18')](_0xaad9('0x19'),_0x7fcefd)}})['then'](function(_0x1fc15c){if(_0x1fc15c[_0xaad9('0x1a')]){logger[_0xaad9('0xa')](_0xaad9('0x1b'));return _[_0xaad9('0x1c')](_0x1fc15c[_0xaad9('0x1d')],{'email':_0x7fcefd,'role':_0xaad9('0x1e')});}else{logger['info'](_0xaad9('0x1f'));return request({'uri':util[_0xaad9('0x18')](_0xaad9('0x20'),_0xd3c2a9[_0xaad9('0xb')])})[_0xaad9('0x13')](function(_0x2a3db5){logger[_0xaad9('0xa')](_0xaad9('0x21'));return _0x2a3db5[_0xaad9('0x22')];});}});}else{logger[_0xaad9('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xaad9('0x18')](_0xaad9('0x20'),_0xd3c2a9['remoteUri'])})[_0xaad9('0x13')](function(_0xd2865f){logger['info']('Admin\x20account\x20selected.');return _0xd2865f[_0xaad9('0x22')];});}}function getEndUser(_0x4c41d1,_0x5ec22d,_0xb55e05){logger['info'](_0xaad9('0x23'),_0xb55e05);return request({'uri':util[_0xaad9('0x18')](_0xaad9('0x24'),_0x4c41d1[_0xaad9('0xb')]),'qs':{'query':util[_0xaad9('0x18')](_0xaad9('0x25'),_0xb55e05)}})[_0xaad9('0x13')](function(_0x287d39){var _0x426f29;if(_0x287d39['results']['length']){_0x287d39[_0xaad9('0x1d')]=_[_0xaad9('0x26')](_0x287d39[_0xaad9('0x1d')],{'suspended':![],'role':_0xaad9('0x27')});if(_0x287d39[_0xaad9('0x1d')][_0xaad9('0x28')]){_0x426f29=_[_0xaad9('0x29')](_0x287d39[_0xaad9('0x1d')]);}}if(_0x426f29){logger[_0xaad9('0xa')](_0xaad9('0x2a'));return _0x426f29;}else{logger[_0xaad9('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xaad9('0x18')](_0xaad9('0x2b'),_0x4c41d1[_0xaad9('0xb')]),'method':'POST','body':{'user':{'role':_0xaad9('0x27'),'name':util[_0xaad9('0x18')](_0xaad9('0x2c'),_0x5ec22d||_0xb55e05),'phone':_0xb55e05}}})[_0xaad9('0x13')](function(_0x4a372f){logger['info'](_0xaad9('0x2d'));return _0x4a372f['user'];});}});}function getAuth(_0x528e53){var _0x12c529;if(_0x528e53[_0xaad9('0x2e')]===_0xaad9('0x2f')){_0x12c529=util['format'](_0xaad9('0x30'),_0x528e53['username'],_0x528e53['password']);}else if(_0x528e53[_0xaad9('0x2e')]===_0xaad9('0x31')){_0x12c529=util['format'](_0xaad9('0x32'),_0x528e53[_0xaad9('0x33')],_0x528e53[_0xaad9('0x31')]);}return util[_0xaad9('0x18')](_0xaad9('0x34'),new Buffer(_0x12c529)[_0xaad9('0x35')](_0xaad9('0x36')));}function request(_0x415442){logger[_0xaad9('0x37')](_0xaad9('0x38'),JSON[_0xaad9('0x39')](_0x415442));return rp(_['defaults'](_0x415442,{'method':_0xaad9('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x415584,_0x2815c6){var _0x8b358c=[];if(_0x415584&&_0x415584[_0xaad9('0x28')]>0x0){_0x8b358c=_[_0xaad9('0x3b')](_0x415584,_0x2815c6);}return _0x8b358c;}function getCustomFields(_0x3ce427,_0x386aac){var _0x1f6dc3=[];var _0xac67b4={'custom_fields':[]};if(_0x3ce427[_0xaad9('0x28')]>0x0){_[_0xaad9('0x3c')](_0x3ce427,function(_0xb561a3){if(_[_0xaad9('0x3d')]([_0xaad9('0x3e'),_0xaad9('0x3f')],_0xb561a3[_0xaad9('0x40')])&&_0xb561a3['nameField']&&!_0xb561a3[_0xaad9('0x41')]){_0xac67b4[_0xb561a3[_0xaad9('0x42')][_0xaad9('0x43')]()]=_0xb561a3[_0xaad9('0x44')][_0xaad9('0x35')]();}else if(_[_0xaad9('0x3d')]([_0xaad9('0x3e'),_0xaad9('0x3f')],_0xb561a3[_0xaad9('0x40')])&&_0xb561a3[_0xaad9('0x45')]&&_0xb561a3[_0xaad9('0x41')]){_0xac67b4[_0xaad9('0x46')]['push']({'id':_0xb561a3[_0xaad9('0x45')],'value':_0xb561a3[_0xaad9('0x44')][_0xaad9('0x35')]()});}else if(_0xb561a3[_0xaad9('0x40')]===_0xaad9('0x47')&&_0xb561a3[_0xaad9('0x48')]&&_0xb561a3[_0xaad9('0x45')]&&_0xb561a3[_0xaad9('0x41')]){_0x386aac[_0xb561a3[_0xaad9('0x48')]]&&_0xac67b4[_0xaad9('0x46')]['push']({'id':_0xb561a3[_0xaad9('0x45')],'value':_0x386aac[_0xb561a3['variableName']]['toString']()});}else if(_0xb561a3[_0xaad9('0x40')]==='customVariable'&&_0xb561a3[_0xaad9('0x49')]&&_0xb561a3['Variable'][_0xaad9('0xe')]&&_0xb561a3['idField']&&_0xb561a3[_0xaad9('0x41')]){_0x386aac[_0xb561a3['Variable'][_0xaad9('0xe')][_0xaad9('0x43')]()]&&_0xac67b4[_0xaad9('0x46')][_0xaad9('0x4a')]({'id':_0xb561a3['idField'],'value':_0x386aac[_0xb561a3['Variable']['name']['toLowerCase']()][_0xaad9('0x35')]()});}});}return _0xac67b4;}exports['queue']=function(_0xcd38cd,_0x336af2,_0x50767b,_0x55fbea,_0x5d403d,_0x2467f9){var _0x59b6f3,_0xf350c;_0x2467f9[_0xaad9('0xb')]=intUtil[_0xaad9('0x4b')](_0x2467f9['remoteUri']);_0x2467f9['serverUrl']=intUtil['stripTrailingSlash'](_0x2467f9['serverUrl']);if(_0x5d403d&&_0x5d403d[_0xaad9('0x4c')]){logger['info']('[QUEUE]',_0xaad9('0x4d'));_0x336af2[_0xaad9('0x4e')]=util['format'](_0xaad9('0x4f'),_0x2467f9['serverUrl'],_0x336af2[_0xaad9('0x50')],md5(_0x336af2[_0xaad9('0x50')]));}else{_0x336af2[_0xaad9('0x4e')]='';}headers[_0xaad9('0x51')]=getAuth(_0x2467f9);return getUser(_0x2467f9,_0x55fbea[_0xaad9('0x52')])['then'](function(_0x308a0c){_0x59b6f3=_0x308a0c;logger[_0xaad9('0xa')](_0xaad9('0x53'),_0x59b6f3['id']);return getEndUser(_0x2467f9,_0x336af2[_0xaad9('0x54')],_0x336af2[_0xaad9('0x55')]);})[_0xaad9('0x13')](function(_0x569982){_0xf350c=_0x569982;logger[_0xaad9('0xa')](_0xaad9('0x56'),_0xf350c['id']);return getTicket(_0x2467f9,_0x59b6f3,_0xf350c,_0x50767b,_0x336af2);})[_0xaad9('0x13')](function(_0x4475f2){if(_0x4475f2){logger['info'](_0xaad9('0x57'),_0x4475f2['id']);switch(_0x2467f9[_0xaad9('0x40')]){case _0xaad9('0x58'):logger['info'](_0xaad9('0x59'),_0xaad9('0x5a'));return request({'uri':util[_0xaad9('0x18')](_0xaad9('0x5b'),_0x2467f9['remoteUri'],_0x59b6f3['id'],_0x4475f2['id']),'method':_0xaad9('0xc')});case _0xaad9('0x5c'):logger[_0xaad9('0xa')](_0xaad9('0x59'),_0xaad9('0x5d'));emit(util['format'](_0xaad9('0x5e'),_0x55fbea[_0xaad9('0xe')]),_0xaad9('0x5f'),{'uri':util[_0xaad9('0x18')](_0xaad9('0x60'),_0x2467f9[_0xaad9('0xb')][_0xaad9('0x61')](_0xaad9('0x62'),''),_0x4475f2['id'])});break;default:logger[_0xaad9('0x63')](_0xaad9('0x59'),_0xaad9('0x64'));}}})[_0xaad9('0x65')](function(_0xca71ac){logger[_0xaad9('0x63')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0xca71ac,{'showHidden':!![],'depth':null}));});};exports[_0xaad9('0x66')]=function(_0xa414d3,_0x455453,_0x147437,_0x52fd28,_0x7d41a3,_0x353877,_0x4f9005){var _0x1466ee,_0x3fb1e6;_0x353877[_0xaad9('0xb')]=intUtil[_0xaad9('0x4b')](_0x353877[_0xaad9('0xb')]);_0x353877[_0xaad9('0x67')]=intUtil['stripTrailingSlash'](_0x353877['serverUrl']);if(_0x4f9005&&_0x4f9005['recordingFormat']&&_0x4f9005[_0xaad9('0x68')]!==_0xaad9('0x69')){logger['info']('[OUTBOUND]',_0xaad9('0x4d'));_0x455453[_0xaad9('0x4e')]=util[_0xaad9('0x18')](_0xaad9('0x4f'),_0x353877['serverUrl'],_0x455453[_0xaad9('0x50')],md5(_0x455453[_0xaad9('0x50')]));}headers['Authorization']=getAuth(_0x353877);return getUser(_0x353877,_0x52fd28[_0xaad9('0x52')])['then'](function(_0x17d344){_0x1466ee=_0x17d344;logger[_0xaad9('0xa')]('The\x20User\x20ID\x20is:',_0x1466ee['id']);return getEndUser(_0x353877,_0x455453[_0xaad9('0x6a')],_0x455453[_0xaad9('0x6b')]);})[_0xaad9('0x13')](function(_0x349969){_0x3fb1e6=_0x349969;logger[_0xaad9('0xa')](_0xaad9('0x56'),_0x3fb1e6['id']);return getTicket(_0x353877,_0x1466ee,_0x3fb1e6,_0x147437,_0x455453);})[_0xaad9('0x13')](function(_0x58a956){if(_0x58a956){logger[_0xaad9('0xa')](_0xaad9('0x57'),_0x58a956['id']);switch(_0x353877['type']){case'integrationTab':logger[_0xaad9('0xa')](_0xaad9('0x6c'),_0xaad9('0x5a'));return request({'uri':util['format'](_0xaad9('0x5b'),_0x353877['remoteUri'],_0x1466ee['id'],_0x58a956['id']),'method':'POST'});case _0xaad9('0x5c'):logger[_0xaad9('0xa')](_0xaad9('0x6c'),_0xaad9('0x5d'));emit(util[_0xaad9('0x18')](_0xaad9('0x5e'),_0x52fd28['name']),_0xaad9('0x5f'),{'uri':util[_0xaad9('0x18')](_0xaad9('0x60'),_0x353877[_0xaad9('0xb')][_0xaad9('0x61')](_0xaad9('0x62'),''),_0x58a956['id'])});break;default:logger[_0xaad9('0x63')]('[OUTBOUND]',_0xaad9('0x64'));}}})['catch'](function(_0xd087be){logger[_0xaad9('0x63')](_0xaad9('0x6d'),util[_0xaad9('0x6e')](_0xd087be,{'showHidden':!![],'depth':null}));});};exports[_0xaad9('0x6f')]=function(_0x427156,_0x2a548b,_0x456d1f,_0x34aa34,_0x1b26f7,_0x36956f){var _0x5056e7,_0x19e4ba;_0x36956f[_0xaad9('0xb')]=intUtil[_0xaad9('0x4b')](_0x36956f[_0xaad9('0xb')]);_0x36956f[_0xaad9('0x67')]=intUtil['stripTrailingSlash'](_0x36956f[_0xaad9('0x67')]);if(_0x1b26f7&&_0x1b26f7['monitor_format']){logger[_0xaad9('0xa')]('['+_0x2a548b[_0xaad9('0x70')][_0xaad9('0x71')]()+']',_0xaad9('0x4d'));_0x2a548b[_0xaad9('0x4e')]=util[_0xaad9('0x18')](_0xaad9('0x4f'),_0x36956f['serverUrl'],_0x2a548b[_0xaad9('0x50')],md5(_0x2a548b['uniqueid']));}else{_0x2a548b['recordingURL']='';}headers[_0xaad9('0x51')]=getAuth(_0x36956f);return getUser(_0x36956f)['then'](function(_0x37694f){_0x5056e7=_0x37694f;logger[_0xaad9('0xa')](_0xaad9('0x53'),_0x5056e7['id']);return getEndUser(_0x36956f,_0x2a548b[_0xaad9('0x54')],_0x2a548b['calleridnum']);})['then'](function(_0x4ea1a6){_0x19e4ba=_0x4ea1a6;logger[_0xaad9('0xa')](_0xaad9('0x56'),_0x19e4ba['id']);return getTicket(_0x36956f,_0x5056e7,_0x19e4ba,_0x456d1f,_0x2a548b);})[_0xaad9('0x13')](function(_0x13075d){if(_0x13075d){logger['info'](_0xaad9('0x57'),_0x13075d['id']);}})[_0xaad9('0x65')](function(_0x3d6c1d){logger[_0xaad9('0x63')]('['+_0x2a548b[_0xaad9('0x70')][_0xaad9('0x71')]()+']'+_0xaad9('0x72'),util[_0xaad9('0x6e')](_0x3d6c1d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2ec9=['outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','defaults','redis','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Fields','then','ticket','validateEmail','count','Agent\x20found!','find','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','authType','password','username','token','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','picklist','nameField','customField','toLowerCase','content','string','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect'];(function(_0xae2fac,_0x528479){var _0x37a3b3=function(_0x25c4e1){while(--_0x25c4e1){_0xae2fac['push'](_0xae2fac['shift']());}};_0x37a3b3(++_0x528479);}(_0x2ec9,0x7d));var _0x92ec=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x2ec9[_0x1f9f5f];return _0x51d649;};'use strict';var _=require(_0x92ec('0x0'));var rp=require(_0x92ec('0x1'));var md5=require(_0x92ec('0x2'));var util=require('util');var Redis=require(_0x92ec('0x3'));var intUtil=require(_0x92ec('0x4'));var config=require('../../../../config/environment');var logger=require(_0x92ec('0x5'))('zendesk');config['redis']=_[_0x92ec('0x6')](config[_0x92ec('0x7')],{'host':_0x92ec('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x92ec('0x7')]));function emit(_0x5cc1ee,_0x10d19a,_0x570c45){io['to'](_0x5cc1ee)['emit'](_0x10d19a,_0x570c45);}var headers={'Content-Type':_0x92ec('0x9'),'Accept':_0x92ec('0x9')};function getTicket(_0x58f711,_0xf18cc5,_0x2effd5,_0x4c4a96,_0x4c0781){logger[_0x92ec('0xa')](_0x92ec('0xb'));return request({'uri':util[_0x92ec('0xc')](_0x92ec('0xd'),_0x58f711[_0x92ec('0xe')]),'method':_0x92ec('0xf'),'body':{'ticket':_[_0x92ec('0x10')]({'requester_id':_0x2effd5['id'],'submitter_id':_0xf18cc5?_0xf18cc5['id']:undefined,'assignee_id':_0xf18cc5?_0xf18cc5['id']:undefined,'tags':getTags(_0x4c4a96['Tags'],_0x92ec('0x11')),'subject':intUtil['getString'](_0x4c4a96['Subjects'],_0x4c0781,'\x20'),'description':intUtil[_0x92ec('0x12')](_0x4c4a96[_0x92ec('0x13')],_0x4c0781,'\x0a'),'comment':{'public':![],'body':intUtil[_0x92ec('0x12')](_0x4c4a96[_0x92ec('0x13')],_0x4c0781,'\x0a')}},getCustomFields(_0x4c4a96[_0x92ec('0x14')],_0x4c0781))}})[_0x92ec('0x15')](function(_0x47dfff){logger[_0x92ec('0xa')]('Ticket\x20created!');return _0x47dfff[_0x92ec('0x16')];});}function getUser(_0x23a8a8,_0x53ce90){if(intUtil[_0x92ec('0x17')](_0x53ce90)){logger[_0x92ec('0xa')]('Getting\x20agent\x20with\x20email',_0x53ce90);return request({'uri':util[_0x92ec('0xc')]('%s/search.json',_0x23a8a8[_0x92ec('0xe')]),'qs':{'query':util[_0x92ec('0xc')]('type:user\x20role:agent\x20email:%s',_0x53ce90)}})['then'](function(_0xf2dc44){if(_0xf2dc44[_0x92ec('0x18')]){logger[_0x92ec('0xa')](_0x92ec('0x19'));return _[_0x92ec('0x1a')](_0xf2dc44[_0x92ec('0x1b')],{'email':_0x53ce90,'role':_0x92ec('0x1c')});}else{logger[_0x92ec('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x92ec('0xc')](_0x92ec('0x1d'),_0x23a8a8[_0x92ec('0xe')])})[_0x92ec('0x15')](function(_0x1dbdbd){logger['info']('Admin\x20account\x20selected.');return _0x1dbdbd[_0x92ec('0x1e')];});}});}else{logger[_0x92ec('0xa')](_0x92ec('0x1f'));return request({'uri':util[_0x92ec('0xc')](_0x92ec('0x1d'),_0x23a8a8[_0x92ec('0xe')])})['then'](function(_0x5a15f6){logger['info']('Admin\x20account\x20selected.');return _0x5a15f6['user'];});}}function getEndUser(_0x22f013,_0x1425a3,_0x240a14){logger[_0x92ec('0xa')](_0x92ec('0x20'),_0x240a14);return request({'uri':util[_0x92ec('0xc')](_0x92ec('0x21'),_0x22f013[_0x92ec('0xe')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x240a14)}})[_0x92ec('0x15')](function(_0xb61a42){var _0x969ede;if(_0xb61a42[_0x92ec('0x1b')][_0x92ec('0x22')]){_0xb61a42[_0x92ec('0x1b')]=_[_0x92ec('0x23')](_0xb61a42[_0x92ec('0x1b')],{'suspended':![],'role':_0x92ec('0x24')});if(_0xb61a42[_0x92ec('0x1b')][_0x92ec('0x22')]){_0x969ede=_[_0x92ec('0x25')](_0xb61a42['results']);}}if(_0x969ede){logger['info'](_0x92ec('0x26'));return _0x969ede;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x92ec('0xc')](_0x92ec('0x27'),_0x22f013['remoteUri']),'method':_0x92ec('0xf'),'body':{'user':{'role':_0x92ec('0x24'),'name':util[_0x92ec('0xc')](_0x92ec('0x28'),_0x1425a3||_0x240a14),'phone':_0x240a14}}})['then'](function(_0x2b0393){logger[_0x92ec('0xa')]('Enduser\x20created.');return _0x2b0393[_0x92ec('0x1e')];});}});}function getAuth(_0x14cd56){var _0x5d05b8;if(_0x14cd56[_0x92ec('0x29')]===_0x92ec('0x2a')){_0x5d05b8=util[_0x92ec('0xc')]('%s:%s',_0x14cd56[_0x92ec('0x2b')],_0x14cd56['password']);}else if(_0x14cd56[_0x92ec('0x29')]===_0x92ec('0x2c')){_0x5d05b8=util['format']('%s/token:%s',_0x14cd56['username'],_0x14cd56['token']);}return util[_0x92ec('0xc')]('Basic\x20%s',new Buffer(_0x5d05b8)[_0x92ec('0x2d')](_0x92ec('0x2e')));}function request(_0x3cbf85){logger[_0x92ec('0x2f')](_0x92ec('0x30'),JSON[_0x92ec('0x31')](_0x3cbf85));return rp(_[_0x92ec('0x6')](_0x3cbf85,{'method':_0x92ec('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x38947b,_0x15abcd){var _0x2a1231=[];if(_0x38947b&&_0x38947b[_0x92ec('0x22')]>0x0){_0x2a1231=_['map'](_0x38947b,_0x15abcd);}return _0x2a1231;}function getCustomFields(_0x37bb6d,_0x39f6ff){var _0x345eda=[];var _0xf19d99={'custom_fields':[]};if(_0x37bb6d[_0x92ec('0x22')]>0x0){_[_0x92ec('0x33')](_0x37bb6d,function(_0xffd9c4){if(_[_0x92ec('0x34')](['string',_0x92ec('0x35')],_0xffd9c4['type'])&&_0xffd9c4[_0x92ec('0x36')]&&!_0xffd9c4[_0x92ec('0x37')]){_0xf19d99[_0xffd9c4['nameField'][_0x92ec('0x38')]()]=_0xffd9c4[_0x92ec('0x39')]['toString']();}else if(_['includes']([_0x92ec('0x3a'),_0x92ec('0x35')],_0xffd9c4[_0x92ec('0x3b')])&&_0xffd9c4[_0x92ec('0x3c')]&&_0xffd9c4[_0x92ec('0x37')]){_0xf19d99[_0x92ec('0x3d')][_0x92ec('0x3e')]({'id':_0xffd9c4['idField'],'value':_0xffd9c4['content']['toString']()});}else if(_0xffd9c4[_0x92ec('0x3b')]===_0x92ec('0x3f')&&_0xffd9c4['variableName']&&_0xffd9c4[_0x92ec('0x3c')]&&_0xffd9c4[_0x92ec('0x37')]){_0x39f6ff[_0xffd9c4[_0x92ec('0x40')]]&&_0xf19d99[_0x92ec('0x3d')]['push']({'id':_0xffd9c4[_0x92ec('0x3c')],'value':_0x39f6ff[_0xffd9c4[_0x92ec('0x40')]][_0x92ec('0x2d')]()});}else if(_0xffd9c4[_0x92ec('0x3b')]===_0x92ec('0x41')&&_0xffd9c4[_0x92ec('0x42')]&&_0xffd9c4['Variable'][_0x92ec('0x11')]&&_0xffd9c4['idField']&&_0xffd9c4[_0x92ec('0x37')]){_0x39f6ff[_0xffd9c4['Variable'][_0x92ec('0x11')][_0x92ec('0x38')]()]&&_0xf19d99['custom_fields'][_0x92ec('0x3e')]({'id':_0xffd9c4['idField'],'value':_0x39f6ff[_0xffd9c4['Variable'][_0x92ec('0x11')][_0x92ec('0x38')]()][_0x92ec('0x2d')]()});}});}return _0xf19d99;}exports[_0x92ec('0x43')]=function(_0x350466,_0x1b2def,_0x5b8f37,_0x139aa5,_0x25d09b,_0x4adf2c){var _0x4d4cda,_0x8e9f30;_0x4adf2c['remoteUri']=intUtil[_0x92ec('0x44')](_0x4adf2c['remoteUri']);_0x4adf2c['serverUrl']=intUtil[_0x92ec('0x44')](_0x4adf2c['serverUrl']);if(_0x25d09b&&_0x25d09b[_0x92ec('0x45')]){logger[_0x92ec('0xa')](_0x92ec('0x46'),'Recording\x20is\x20enabled!');_0x1b2def[_0x92ec('0x47')]=util[_0x92ec('0xc')](_0x92ec('0x48'),_0x4adf2c[_0x92ec('0x49')],_0x1b2def[_0x92ec('0x4a')],md5(_0x1b2def[_0x92ec('0x4a')]));}else{_0x1b2def[_0x92ec('0x47')]='';}headers[_0x92ec('0x4b')]=getAuth(_0x4adf2c);return getUser(_0x4adf2c,_0x139aa5[_0x92ec('0x4c')])['then'](function(_0x2f436d){_0x4d4cda=_0x2f436d;logger[_0x92ec('0xa')](_0x92ec('0x4d'),_0x4d4cda['id']);return getEndUser(_0x4adf2c,_0x1b2def[_0x92ec('0x4e')],_0x1b2def['calleridnum']);})['then'](function(_0x5eb172){_0x8e9f30=_0x5eb172;logger[_0x92ec('0xa')](_0x92ec('0x4f'),_0x8e9f30['id']);return getTicket(_0x4adf2c,_0x4d4cda,_0x8e9f30,_0x5b8f37,_0x1b2def);})[_0x92ec('0x15')](function(_0x25311d){if(_0x25311d){logger['info'](_0x92ec('0x50'),_0x25311d['id']);switch(_0x4adf2c[_0x92ec('0x3b')]){case'integrationTab':logger['info'](_0x92ec('0x46'),_0x92ec('0x51'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4adf2c[_0x92ec('0xe')],_0x4d4cda['id'],_0x25311d['id']),'method':'POST'});case _0x92ec('0x52'):logger[_0x92ec('0xa')](_0x92ec('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x92ec('0xc')]('user:%s',_0x139aa5[_0x92ec('0x11')]),'trigger:browser:url',{'uri':util[_0x92ec('0xc')](_0x92ec('0x53'),_0x4adf2c[_0x92ec('0xe')][_0x92ec('0x54')](_0x92ec('0x55'),''),_0x25311d['id'])});break;default:logger['error'](_0x92ec('0x46'),_0x92ec('0x56'));}}})[_0x92ec('0x57')](function(_0x4f0e26){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x92ec('0x58')](_0x4f0e26,{'showHidden':!![],'depth':null}));});};exports[_0x92ec('0x59')]=function(_0x2cad9e,_0x21c8ee,_0x39b0ef,_0x46112f,_0x24b354,_0x266914,_0x1ebc6d){var _0x375ef2,_0x4f70a7;_0x266914[_0x92ec('0xe')]=intUtil[_0x92ec('0x44')](_0x266914[_0x92ec('0xe')]);_0x266914['serverUrl']=intUtil[_0x92ec('0x44')](_0x266914[_0x92ec('0x49')]);if(_0x1ebc6d&&_0x1ebc6d[_0x92ec('0x5a')]&&_0x1ebc6d[_0x92ec('0x5a')]!==_0x92ec('0x5b')){logger[_0x92ec('0xa')](_0x92ec('0x5c'),'Recording\x20is\x20enabled!');_0x21c8ee[_0x92ec('0x47')]=util[_0x92ec('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x266914[_0x92ec('0x49')],_0x21c8ee['uniqueid'],md5(_0x21c8ee[_0x92ec('0x4a')]));}headers['Authorization']=getAuth(_0x266914);return getUser(_0x266914,_0x46112f[_0x92ec('0x4c')])[_0x92ec('0x15')](function(_0x15832a){_0x375ef2=_0x15832a;logger[_0x92ec('0xa')](_0x92ec('0x4d'),_0x375ef2['id']);return getEndUser(_0x266914,_0x21c8ee[_0x92ec('0x5d')],_0x21c8ee[_0x92ec('0x5e')]);})[_0x92ec('0x15')](function(_0x5a9ccc){_0x4f70a7=_0x5a9ccc;logger[_0x92ec('0xa')](_0x92ec('0x4f'),_0x4f70a7['id']);return getTicket(_0x266914,_0x375ef2,_0x4f70a7,_0x39b0ef,_0x21c8ee);})[_0x92ec('0x15')](function(_0x1c02be){if(_0x1c02be){logger[_0x92ec('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1c02be['id']);switch(_0x266914[_0x92ec('0x3b')]){case _0x92ec('0x5f'):logger['info'](_0x92ec('0x5c'),_0x92ec('0x51'));return request({'uri':util[_0x92ec('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x266914[_0x92ec('0xe')],_0x375ef2['id'],_0x1c02be['id']),'method':_0x92ec('0xf')});case'newTab':logger[_0x92ec('0xa')]('[OUTBOUND]',_0x92ec('0x60'));emit(util[_0x92ec('0xc')](_0x92ec('0x61'),_0x46112f[_0x92ec('0x11')]),_0x92ec('0x62'),{'uri':util['format'](_0x92ec('0x53'),_0x266914[_0x92ec('0xe')][_0x92ec('0x54')](_0x92ec('0x55'),''),_0x1c02be['id'])});break;default:logger[_0x92ec('0x63')](_0x92ec('0x5c'),_0x92ec('0x56'));}}})[_0x92ec('0x57')](function(_0x120ee2){logger[_0x92ec('0x63')](_0x92ec('0x64'),util[_0x92ec('0x58')](_0x120ee2,{'showHidden':!![],'depth':null}));});};exports[_0x92ec('0x65')]=function(_0x4a4dc5,_0x641935,_0x2fdbfe,_0x1d1fcd,_0x5c2a96,_0x4ff871){var _0x36cabc,_0x18b24b;_0x4ff871[_0x92ec('0xe')]=intUtil[_0x92ec('0x44')](_0x4ff871[_0x92ec('0xe')]);_0x4ff871['serverUrl']=intUtil['stripTrailingSlash'](_0x4ff871[_0x92ec('0x49')]);if(_0x5c2a96&&_0x5c2a96[_0x92ec('0x45')]){logger['info']('['+_0x641935[_0x92ec('0x66')][_0x92ec('0x67')]()+']',_0x92ec('0x68'));_0x641935['recordingURL']=util[_0x92ec('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ff871['serverUrl'],_0x641935[_0x92ec('0x4a')],md5(_0x641935[_0x92ec('0x4a')]));}else{_0x641935['recordingURL']='';}headers[_0x92ec('0x4b')]=getAuth(_0x4ff871);return getUser(_0x4ff871)[_0x92ec('0x15')](function(_0x33bd44){_0x36cabc=_0x33bd44;logger[_0x92ec('0xa')]('The\x20User\x20ID\x20is:',_0x36cabc['id']);return getEndUser(_0x4ff871,_0x641935[_0x92ec('0x4e')],_0x641935[_0x92ec('0x69')]);})[_0x92ec('0x15')](function(_0x292a2f){_0x18b24b=_0x292a2f;logger[_0x92ec('0xa')](_0x92ec('0x4f'),_0x18b24b['id']);return getTicket(_0x4ff871,_0x36cabc,_0x18b24b,_0x2fdbfe,_0x641935);})[_0x92ec('0x15')](function(_0x9ad427){if(_0x9ad427){logger[_0x92ec('0xa')](_0x92ec('0x50'),_0x9ad427['id']);}})['catch'](function(_0x15d0b0){logger[_0x92ec('0x63')]('['+_0x641935[_0x92ec('0x66')]['toUpperCase']()+']'+_0x92ec('0x6a'),util[_0x92ec('0x58')](_0x15d0b0,{'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 5d9e570..0820e8f 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 _0xbde2=['name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','details','Error:\x20','log','CREATE\x20ERROR','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','lead','Leads','nothing','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','complete','connect','Call_Result','rejected','Rejected','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','SUCCESS','err','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','serverUrl','recordingFormat','none','email','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','toUpperCase','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable'];(function(_0x110d67,_0x35e549){var _0x2058f9=function(_0x1b1b48){while(--_0x1b1b48){_0x110d67['push'](_0x110d67['shift']());}};_0x2058f9(++_0x35e549);}(_0xbde2,0x7a));var _0x2bde=function(_0x3837ff,_0x1bbaa9){_0x3837ff=_0x3837ff-0x0;var _0x425708=_0xbde2[_0x3837ff];return _0x425708;};'use strict';var _=require('lodash');var rp=require(_0x2bde('0x0'));var md5=require(_0x2bde('0x1'));var util=require(_0x2bde('0x2'));var intUtil=require('./util');var moment=require(_0x2bde('0x3'));var Redis=require(_0x2bde('0x4'));var BPromise=require(_0x2bde('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2bde('0x6'))(_0x2bde('0x7'));config[_0x2bde('0x8')]=_[_0x2bde('0x9')](config['redis'],{'host':_0x2bde('0xa'),'port':0x18eb});var io=require(_0x2bde('0xb'))(new Redis(config[_0x2bde('0x8')]));function emit(_0x3ddbc4,_0x343cba,_0x27eda4){io['to'](_0x3ddbc4)['emit'](_0x343cba,_0x27eda4);}function request(_0x5cc171){logger['debug'](_0x2bde('0xc'),JSON[_0x2bde('0xd')](_0x5cc171));return rp(_0x5cc171);}function getCustomFields(_0xbbdbc9,_0x57c636){var _0x16ca0a={};if(_0xbbdbc9[_0x2bde('0xe')]>0x0){_[_0x2bde('0xf')](_0xbbdbc9,function(_0x1abbe2){if(_[_0x2bde('0x10')]([_0x2bde('0x11'),'picklist'],_0x1abbe2[_0x2bde('0x12')])&&_0x1abbe2['idField']){_0x16ca0a[_0x1abbe2[_0x2bde('0x13')]]=_0x1abbe2[_0x2bde('0x14')][_0x2bde('0x15')]();}else if(_0x1abbe2[_0x2bde('0x12')]===_0x2bde('0x16')&&_0x1abbe2[_0x2bde('0x17')]&&_0x1abbe2[_0x2bde('0x13')]&&_0x57c636[_0x1abbe2[_0x2bde('0x17')]]){_0x16ca0a[_0x1abbe2[_0x2bde('0x13')]]=_0x57c636[_0x1abbe2[_0x2bde('0x17')]][_0x2bde('0x15')]();}else if(_0x1abbe2[_0x2bde('0x12')]===_0x2bde('0x18')&&_0x1abbe2[_0x2bde('0x19')]&&_0x1abbe2['Variable']['name']&&_0x1abbe2[_0x2bde('0x13')]&&_0x57c636[_0x1abbe2[_0x2bde('0x19')][_0x2bde('0x1a')][_0x2bde('0x1b')]()]){_0x16ca0a[_0x1abbe2['idField']]=_0x57c636[_0x1abbe2[_0x2bde('0x19')][_0x2bde('0x1a')][_0x2bde('0x1b')]()][_0x2bde('0x15')]();}});}return _0x16ca0a;}function getName(_0x1b10a4){if(_0x1b10a4[_0x2bde('0x1c')]('\x20')>0x0){var _0x1dcdd6=_0x1b10a4[_0x2bde('0x1d')](/ (.+)/);if(_0x1dcdd6[0x1]){return _0x1dcdd6;}}return[_0x1b10a4,_0x1b10a4];}var accountsTokens={};function getAccessToken(_0x58e640){return new Promise(function(_0xe302eb,_0x4f3b68){if(!_['isNil'](accountsTokens[_0x58e640['id']])&&!_[_0x2bde('0x1e')](accountsTokens[_0x58e640['id']][_0x2bde('0x1f')])){if(moment()[_0x2bde('0x20')](accountsTokens[_0x58e640['id']]['expires_in'])){_0xe302eb(accountsTokens[_0x58e640['id']][_0x2bde('0x1f')]);}}var _0x945537;switch(_0x58e640[_0x2bde('0x21')]){case'US':_0x945537='https://accounts.zoho.com';break;case'AU':_0x945537=_0x2bde('0x22');break;case'EU':_0x945537=_0x2bde('0x23');break;case'IN':_0x945537=_0x2bde('0x24');break;case'CN':_0x945537='https://accounts.zoho.com.cn';break;default:_0x945537='https://accounts.zoho.eu';break;}var _0x591aea={'method':'POST','uri':_0x945537+_0x2bde('0x25'),'qs':{'refresh_token':_0x58e640['refreshToken'],'client_id':_0x58e640[_0x2bde('0x26')],'client_secret':_0x58e640[_0x2bde('0x27')],'grant_type':_0x2bde('0x28')},'json':!![]};return rp(_0x591aea)[_0x2bde('0x29')](function(_0x4d7371){accountsTokens[_0x58e640['id']]={'access_token':_0x4d7371[_0x2bde('0x1f')],'expires_in':moment()[_0x2bde('0x2a')](_0x4d7371[_0x2bde('0x2b')],'seconds')};_0xe302eb(_0x4d7371[_0x2bde('0x1f')]);})[_0x2bde('0x2c')](function(_0x2962e4){logger[_0x2bde('0x2d')](_0x2bde('0x2e'),_0x2962e4[_0x2bde('0x2f')]);_0x4f3b68(_0x2962e4);});});}function getUser(_0x2b1eb6,_0x4d668f,_0x2e359e,_0x5ed025){logger[_0x2bde('0x30')](_0x2bde('0x31'));return request({'method':_0x2bde('0x32'),'uri':util[_0x2bde('0x33')](_0x2bde('0x34'),_0x4d668f),'qs':{'type':_0x2bde('0x35')},'headers':{'Authorization':_0x2bde('0x36')+_0x2b1eb6},'json':!![]})[_0x2bde('0x29')](function(_0x58549a){if(_0x58549a['users']){var _0x2e74d4=-0x1;if(_[_0x2bde('0x37')](_0x58549a[_0x2bde('0x38')])){if(!_[_0x2bde('0x1e')](_0x5ed025)){_0x2e74d4=_[_0x2bde('0x39')](_0x58549a[_0x2bde('0x38')],function(_0x3fb990){return _0x3fb990['email']===_0x5ed025;});}if(_0x2e74d4>=0x0){logger['info'](_0x2bde('0x3a'));}else{logger[_0x2bde('0x30')]('Using\x20the\x20admin\x20account!');_0x2e74d4=_[_0x2bde('0x39')](_0x58549a[_0x2bde('0x38')],function(_0x24ef3f){return _0x24ef3f[_0x2bde('0x3b')]['name']===_0x2bde('0x3c');});}return _0x58549a[_0x2bde('0x38')][_0x2e74d4];}else{if(_0x58549a[_0x2bde('0x3d')][_0x2bde('0x3b')][_0x2bde('0x1a')]===_0x2bde('0x3c')){logger['info'](_0x2bde('0x3e'));user=_0x58549a['user'];return user;}else{logger[_0x2bde('0x2d')](_0x2bde('0x3f'),JSON[_0x2bde('0xd')](_0x58549a));throw new Error(_0x2bde('0x40')+JSON['stringify'](_0x58549a));}}}else{logger[_0x2bde('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x2bde('0xd')](_0x58549a));throw new Error(_0x2bde('0x40')+JSON[_0x2bde('0xd')](_0x58549a));}})['catch'](function(_0x5785aa){console[_0x2bde('0x2d')](_0x5785aa);});}function getZohoUser(_0x312d05,_0x55c734){return new BPromise(function(_0xd8fe1e,_0x56f1f5){request(_0x312d05)[_0x2bde('0x29')](function(_0x5e3a1e){var _0x2f445d=null;if(_0x5e3a1e){_0x2f445d=_0x5e3a1e[_0x2bde('0x41')][0x0];_0x2f445d[_0x2bde('0x42')]=_0x55c734;}_0xd8fe1e(_0x2f445d);})['catch'](function(_0x347b62){_0x56f1f5(_0x347b62);});});}function createEndUser(_0x55f948,_0x59379f,_0x25d3e5,_0x44e08b,_0x207004,_0x2eb55a){var _0x25d3e5=getName(_0x25d3e5);return request({'method':_0x2bde('0x43'),'uri':_0x2bde('0x44')+_0x59379f+_0x2bde('0x45')+_[_0x2bde('0x46')](_0x2eb55a[_0x2bde('0x47')])+'s','body':{'data':[{'Last_Name':_0x25d3e5[0x1],'First_Name':_0x25d3e5[0x0],'Phone':_0x44e08b,'Owner':{'name':!_['isNil'](_0x207004[_0x2bde('0x48')]['name'])?_0x207004['role'][_0x2bde('0x1a')]:!_['isNil'](_0x207004[_0x2bde('0x49')])?_0x207004['first_name']+'\x20'+_0x207004[_0x2bde('0x4a')]:_0x207004['last_name'],'id':_0x207004['id']}}]},'headers':{'Authorization':_0x2bde('0x36')+_0x55f948},'json':!![]})[_0x2bde('0x29')](function(_0x4aaaed){if(_0x4aaaed&&_0x4aaaed[_0x2bde('0x41')][0x0]['code']==='SUCCESS'){var _0x78f6a4=_0x4aaaed['data'][0x0][_0x2bde('0x4b')];_0x78f6a4[_0x2bde('0x42')]=_['startCase'](_0x2eb55a['moduleCreate'])+'s';return _0x78f6a4;}logger[_0x2bde('0x2d')](_0x2bde('0x3f'),JSON[_0x2bde('0xd')](data));throw new Error(_0x2bde('0x4c')+JSON[_0x2bde('0xd')](data));})[_0x2bde('0x2c')](function(_0x4bb371){console[_0x2bde('0x4d')](_0x2bde('0x4e'),_0x4bb371);});}function getEndUser(_0x41165e,_0x162097,_0x515501,_0x41aaf9,_0x1d5a50,_0x23382e,_0xbeef77){var _0x8becb4={'method':_0x2bde('0x32'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x41165e},'json':!![]};switch(_0xbeef77['moduleSearch']){case'contact_lead':_0x8becb4[_0x2bde('0x4f')]=_0x2bde('0x44')+_0x162097+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1d5a50+'))';return getZohoUser(_0x8becb4,_0x2bde('0x50'))['then'](function(_0x1a103c){if(_0x1a103c)return _0x1a103c;_0x8becb4[_0x2bde('0x4f')]=_0x2bde('0x44')+_0x162097+_0x2bde('0x51')+_0x1d5a50+'))';return getZohoUser(_0x8becb4,'Leads')[_0x2bde('0x29')](function(_0x39cf8e){if(_0x39cf8e)return _0x39cf8e;if(_0xbeef77['moduleCreate']!='nothing'){return createEndUser(_0x41165e,_0x162097,_0x41aaf9,_0x1d5a50,_0x23382e,_0xbeef77);}else{return{};}});});break;case _0x2bde('0x52'):_0x8becb4['uri']='https://www.zohoapis.'+_0x162097+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1d5a50+'))';return getZohoUser(_0x8becb4,_0x2bde('0x50'))[_0x2bde('0x29')](function(_0x12da4b){if(_0x12da4b)return _0x12da4b;if(_0xbeef77['moduleCreate']!='nothing'){return createEndUser(_0x41165e,_0x162097,_0x41aaf9,_0x1d5a50,_0x23382e,_0xbeef77);}else{return{};}});break;case _0x2bde('0x53'):_0x8becb4['uri']=_0x2bde('0x44')+_0x162097+_0x2bde('0x51')+_0x1d5a50+'))';return getZohoUser(_0x8becb4,_0x2bde('0x54'))[_0x2bde('0x29')](function(_0x402441){if(_0x402441)return _0x402441;if(_0xbeef77['moduleCreate']!=_0x2bde('0x55')){return createEndUser(_0x41165e,_0x162097,_0x41aaf9,_0x1d5a50,_0x23382e,_0xbeef77);}else{return{};}});break;}}function getCall(_0x2e1b27,_0x453c37,_0x17b8b7,_0x493f71,_0x547562,_0x410b3e,_0x209cdb,_0x561c45){logger[_0x2bde('0x30')]('Creating\x20new\x20call...');var _0x2a8502={};_0x2a8502[_0x2bde('0x56')]={'name':!_[_0x2bde('0x1e')](_0x493f71['role'][_0x2bde('0x1a')])&&!_[_0x2bde('0x1e')](_0x493f71[_0x2bde('0x3b')][_0x2bde('0x1a')])&&_0x493f71['profile'][_0x2bde('0x1a')]===_0x2bde('0x57')?_0x493f71[_0x2bde('0x48')]['name']:!_['isNil'](_0x493f71[_0x2bde('0x49')])?_0x493f71['first_name']+'\x20'+_0x493f71['last_name']:_0x493f71[_0x2bde('0x4a')],'id':_0x493f71['id']};_0x2a8502[_0x2bde('0x58')]=intUtil[_0x2bde('0x59')](_0x410b3e[_0x2bde('0x5a')],_0x209cdb,'\x20');_0x2a8502[_0x2bde('0x5b')]=intUtil[_0x2bde('0x59')](_0x410b3e[_0x2bde('0x5c')],_0x209cdb,'\x0a');if(_0x547562['enduserType']===_0x2bde('0x50')){_0x2a8502[_0x2bde('0x5d')]={'name':!_[_0x2bde('0x1e')](_0x547562[_0x2bde('0x5e')])?_0x547562[_0x2bde('0x5e')]:!_[_0x2bde('0x1e')](_0x547562[_0x2bde('0x5f')])?_0x547562[_0x2bde('0x5f')]+'\x20'+_0x547562[_0x2bde('0x60')]:_0x547562[_0x2bde('0x60')],'id':_0x547562['id']};}if(_0x547562[_0x2bde('0x42')]===_0x2bde('0x54')){_0x2a8502[_0x2bde('0x61')]={'name':!_[_0x2bde('0x1e')](_0x547562[_0x2bde('0x5e')])?_0x547562[_0x2bde('0x5e')]:!_[_0x2bde('0x1e')](_0x547562[_0x2bde('0x5f')])?_0x547562['First_Name']+'\x20'+_0x547562[_0x2bde('0x60')]:_0x547562['Last_Name'],'id':_0x547562['id']};_0x2a8502['$se_module']=_[_0x2bde('0x46')](_0x547562[_0x2bde('0x42')]);}if(_0x209cdb[_0x2bde('0x62')]){_0x2a8502[_0x2bde('0x63')]=moment[_0x2bde('0x64')](parseInt(_0x209cdb[_0x2bde('0x62')])*0x3e8)['format']('mm:ss');}else if(_0x209cdb['answertime']&&_0x209cdb['endtime']){_0x2a8502[_0x2bde('0x63')]=moment['utc'](moment(_0x209cdb[_0x2bde('0x65')],_0x2bde('0x66'))['diff'](moment(_0x209cdb['starttime'],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x2bde('0x67'));}switch(_0x209cdb[_0x2bde('0x68')]){case'called':_0x2a8502['Call_Result']='Called';break;case _0x2bde('0x69'):case _0x2bde('0x6a'):_0x2a8502[_0x2bde('0x6b')]='Answered';break;case _0x2bde('0x6c'):_0x2a8502[_0x2bde('0x6b')]=_0x2bde('0x6d');break;case'abandoned':_0x2a8502[_0x2bde('0x6b')]='Abandoned';break;case _0x2bde('0x6e'):_0x2a8502[_0x2bde('0x6b')]=_0x2bde('0x6f');default:}_0x2a8502[_0x2bde('0x70')]=(_0x561c45===_0x2bde('0x71')?moment(_0x209cdb['starttime'])[_0x2bde('0x33')](_0x2bde('0x66')):moment(_0x209cdb[_0x2bde('0x72')])[_0x2bde('0x33')](_0x2bde('0x66')))||moment()[_0x2bde('0x33')](_0x2bde('0x66'));_0x2a8502[_0x2bde('0x73')]=_0x561c45||_0x2bde('0x74');_0x2a8502=_[_0x2bde('0x75')](_0x2a8502,getCustomFields(_0x410b3e['Fields'],_0x209cdb));return request({'method':'POST','uri':_0x2bde('0x44')+_0x453c37+'/crm/v2/Calls','headers':{'Authorization':_0x2bde('0x36')+_0x2e1b27},'body':{'data':[_0x2a8502]},'json':!![]})[_0x2bde('0x29')](function(_0x2e25e9){if(_0x2e25e9&&_0x2e25e9[_0x2bde('0x41')][0x0]['code']===_0x2bde('0x76')){logger['info']('Call\x20created!');return{'id':_0x2e25e9['data'][0x0][_0x2bde('0x4b')]['id']};}})[_0x2bde('0x2c')](function(_0xd24d97){logger['info'](_0x2bde('0x77'),_0xd24d97[_0x2bde('0x2f')]);console['log'](_0x2bde('0x77'),_0xd24d97);});}exports['queue']=function(_0x21957e,_0x5e9c0d,_0x15e353,_0x255e6a,_0x3ef6d0,_0x8a7c6e){var _0x4a5a17,_0x3abb6d,_0x5c4272;_0x8a7c6e[_0x2bde('0x78')]=intUtil[_0x2bde('0x79')](_0x8a7c6e['host']);_0x8a7c6e['serverUrl']=intUtil[_0x2bde('0x79')](_0x8a7c6e['serverUrl']);if(_0x3ef6d0&&_0x3ef6d0[_0x2bde('0x7a')]){logger['info'](_0x2bde('0x7b'),_0x2bde('0x7c'));_0x5e9c0d[_0x2bde('0x7d')]=_0x8a7c6e['serverUrl']+_0x2bde('0x7e')+_0x5e9c0d[_0x2bde('0x7f')]+_0x2bde('0x80')+md5(_0x5e9c0d[_0x2bde('0x7f')]);}else{_0x5e9c0d[_0x2bde('0x7d')]='';}var _0x3cd972=_0x8a7c6e[_0x2bde('0x78')]===_0x2bde('0x81')?'eu':_0x2bde('0x82');return getAccessToken(_0x8a7c6e)[_0x2bde('0x29')](function(_0x1d1bfc){_0x5c4272=_0x1d1bfc;return getUser(_0x5c4272,_0x3cd972,_0x8a7c6e,_0x255e6a['email']);})[_0x2bde('0x29')](function(_0x594c96){_0x4a5a17=_0x594c96;logger[_0x2bde('0x30')](_0x2bde('0x83'),_0x4a5a17['id']);return getEndUser(_0x5c4272,_0x3cd972,_0x8a7c6e,_0x5e9c0d['calleridname'],_0x5e9c0d[_0x2bde('0x84')],_0x4a5a17,_0x15e353);})[_0x2bde('0x29')](function(_0x4cc5be){_0x3abb6d=_0x4cc5be;return getCall(_0x5c4272,_0x3cd972,_0x8a7c6e,_0x4a5a17,_0x3abb6d,_0x15e353,_0x5e9c0d,_0x2bde('0x74'));})[_0x2bde('0x29')](function(_0x413e08){if(_0x413e08){logger[_0x2bde('0x30')](_0x2bde('0x85'),_0x413e08['id']);logger[_0x2bde('0x30')](_0x2bde('0x7b'),_0x2bde('0x86'));emit(util[_0x2bde('0x33')]('user:%s',_0x255e6a[_0x2bde('0x1a')]),_0x2bde('0x87'),{'uri':_0x2bde('0x88')+_0x8a7c6e[_0x2bde('0x78')]+_0x2bde('0x89')+_0x413e08['id']});}})[_0x2bde('0x2c')](function(_0x422fd3){logger[_0x2bde('0x2d')](_0x2bde('0x7b'),JSON['stringify'](_0x422fd3));});};exports['outbound']=function(_0x2f0ab1,_0x26c620,_0x21c2aa,_0x1b8583,_0x48d66b,_0x1c1c35,_0x945c19){var _0x17c7b8,_0x413d7d,_0x4cf9fd;_0x1c1c35[_0x2bde('0x78')]=intUtil[_0x2bde('0x79')](_0x1c1c35[_0x2bde('0x78')]);_0x1c1c35['serverUrl']=intUtil[_0x2bde('0x79')](_0x1c1c35[_0x2bde('0x8a')]);if(_0x945c19&&_0x945c19[_0x2bde('0x8b')]&&_0x945c19[_0x2bde('0x8b')]!==_0x2bde('0x8c')){logger[_0x2bde('0x30')]('[OUTBOUND]',_0x2bde('0x7c'));_0x26c620['recordingURL']=_0x1c1c35[_0x2bde('0x8a')]+_0x2bde('0x7e')+_0x26c620[_0x2bde('0x7f')]+_0x2bde('0x80')+md5(_0x26c620['uniqueid']);}var _0x2513df=_0x1c1c35['host']==='zoho.eu'?'eu':_0x2bde('0x82');return getAccessToken(_0x1c1c35)['then'](function(_0x341fb3){_0x4cf9fd=_0x341fb3;return getUser(_0x4cf9fd,_0x2513df,_0x1c1c35,_0x1b8583[_0x2bde('0x8d')]);})[_0x2bde('0x29')](function(_0x1663db){_0x17c7b8=_0x1663db;logger[_0x2bde('0x30')]('The\x20User\x20ID\x20is:',_0x17c7b8['id']);return getEndUser(_0x4cf9fd,_0x2513df,_0x1c1c35,_0x26c620[_0x2bde('0x8e')],_0x26c620[_0x2bde('0x8f')],_0x17c7b8,_0x21c2aa);})['then'](function(_0x2f96cd){_0x413d7d=_0x2f96cd;return getCall(_0x4cf9fd,_0x2513df,_0x1c1c35,_0x17c7b8,_0x413d7d,_0x21c2aa,_0x26c620,_0x2bde('0x90'));})[_0x2bde('0x29')](function(_0xab88ca){if(_0xab88ca){logger[_0x2bde('0x30')](_0x2bde('0x85'),_0xab88ca['id']);logger[_0x2bde('0x30')]('[OUTBOUND]',_0x2bde('0x86'));emit(util[_0x2bde('0x33')]('user:%s',_0x1b8583[_0x2bde('0x1a')]),_0x2bde('0x87'),{'uri':_0x2bde('0x88')+_0x1c1c35['host']+_0x2bde('0x89')+_0xab88ca['id']});}})[_0x2bde('0x2c')](function(_0x204d0f){logger[_0x2bde('0x2d')](_0x2bde('0x91'),JSON[_0x2bde('0xd')](_0x204d0f));});};exports[_0x2bde('0x92')]=function(_0x453ced,_0x131c31,_0x42ae31,_0x1d16e0,_0x5d6d96,_0x40211a){var _0x524f87,_0x2d0a57,_0x18c4f5;_0x40211a[_0x2bde('0x78')]=intUtil[_0x2bde('0x79')](_0x40211a['host']);_0x40211a[_0x2bde('0x8a')]=intUtil['stripTrailingSlash'](_0x40211a[_0x2bde('0x8a')]);if(_0x5d6d96&&_0x5d6d96[_0x2bde('0x7a')]){logger[_0x2bde('0x30')]('['+_0x131c31[_0x2bde('0x68')][_0x2bde('0x93')]()+']',_0x2bde('0x7c'));_0x131c31['recordingURL']=_0x40211a['serverUrl']+_0x2bde('0x7e')+_0x131c31[_0x2bde('0x7f')]+_0x2bde('0x80')+md5(_0x131c31[_0x2bde('0x7f')]);}else{_0x131c31[_0x2bde('0x7d')]='';}var _0x6cfd2a=_0x40211a[_0x2bde('0x78')]===_0x2bde('0x81')?'eu':'com';return getAccessToken(_0x40211a)[_0x2bde('0x29')](function(_0x54437c){_0x18c4f5=_0x54437c;return getUser(_0x18c4f5,_0x6cfd2a,_0x40211a);})[_0x2bde('0x29')](function(_0x3703c5){_0x524f87=_0x3703c5;logger[_0x2bde('0x30')]('The\x20User\x20ID\x20is:',_0x524f87['id']);return getEndUser(_0x18c4f5,_0x6cfd2a,_0x40211a,_0x131c31['calleridname'],_0x131c31[_0x2bde('0x84')],_0x524f87,_0x42ae31);})[_0x2bde('0x29')](function(_0x55602){_0x2d0a57=_0x55602;return getCall(_0x18c4f5,_0x6cfd2a,_0x40211a,_0x524f87,_0x2d0a57,_0x42ae31,_0x131c31,_0x2bde('0x74'));})[_0x2bde('0x29')](function(_0x5407d5){if(_0x5407d5){logger[_0x2bde('0x30')](_0x2bde('0x85'),_0x5407d5['id']);}})['catch'](function(_0x18a483){logger[_0x2bde('0x2d')]('['+_0x131c31[_0x2bde('0x68')]['toUpperCase']()+']',JSON[_0x2bde('0xd')](_0x18a483));});}; \ No newline at end of file +var _0xab9e=['GET','format','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','moduleSearch','contact_lead','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','uri','lead','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','data','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','[OUTBOUND]','unmanaged','toUpperCase','calleridnum','The\x20Call\x20ID\x20is:','lodash','request-promise','./util','ioredis','../../../../config/logger','zoho','redis','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','type','variableName','toString','Variable','name','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xab9e,0x6e));var _0xeab9=function(_0x2fc1d5,_0xc47979){_0x2fc1d5=_0x2fc1d5-0x0;var _0x1125a4=_0xab9e[_0x2fc1d5];return _0x1125a4;};'use strict';var _=require(_0xeab9('0x0'));var rp=require(_0xeab9('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0xeab9('0x2'));var moment=require('moment');var Redis=require(_0xeab9('0x3'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xeab9('0x4'))(_0xeab9('0x5'));config[_0xeab9('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xeab9('0x7'))(new Redis(config[_0xeab9('0x6')]));function emit(_0xa08be0,_0x3b4e24,_0x260ac2){io['to'](_0xa08be0)['emit'](_0x3b4e24,_0x260ac2);}function request(_0x2eb704){logger[_0xeab9('0x8')](_0xeab9('0x9'),JSON[_0xeab9('0xa')](_0x2eb704));return rp(_0x2eb704);}function getCustomFields(_0x593272,_0x4f55fd){var _0x28ee4e={};if(_0x593272[_0xeab9('0xb')]>0x0){_[_0xeab9('0xc')](_0x593272,function(_0x21c577){if(_[_0xeab9('0xd')]([_0xeab9('0xe'),_0xeab9('0xf')],_0x21c577['type'])&&_0x21c577[_0xeab9('0x10')]){_0x28ee4e[_0x21c577[_0xeab9('0x10')]]=_0x21c577[_0xeab9('0x11')]['toString']();}else if(_0x21c577[_0xeab9('0x12')]==='variable'&&_0x21c577[_0xeab9('0x13')]&&_0x21c577[_0xeab9('0x10')]&&_0x4f55fd[_0x21c577[_0xeab9('0x13')]]){_0x28ee4e[_0x21c577[_0xeab9('0x10')]]=_0x4f55fd[_0x21c577['variableName']][_0xeab9('0x14')]();}else if(_0x21c577['type']==='customVariable'&&_0x21c577[_0xeab9('0x15')]&&_0x21c577['Variable'][_0xeab9('0x16')]&&_0x21c577[_0xeab9('0x10')]&&_0x4f55fd[_0x21c577[_0xeab9('0x15')][_0xeab9('0x16')]['toLowerCase']()]){_0x28ee4e[_0x21c577[_0xeab9('0x10')]]=_0x4f55fd[_0x21c577[_0xeab9('0x15')][_0xeab9('0x16')]['toLowerCase']()][_0xeab9('0x14')]();}});}return _0x28ee4e;}function getName(_0x3c4f19){if(_0x3c4f19[_0xeab9('0x17')]('\x20')>0x0){var _0x38dcf2=_0x3c4f19[_0xeab9('0x18')](/ (.+)/);if(_0x38dcf2[0x1]){return _0x38dcf2;}}return[_0x3c4f19,_0x3c4f19];}var accountsTokens={};function getAccessToken(_0x2f7f65){return new Promise(function(_0x303e6d,_0x5dca88){if(!_[_0xeab9('0x19')](accountsTokens[_0x2f7f65['id']])&&!_[_0xeab9('0x19')](accountsTokens[_0x2f7f65['id']][_0xeab9('0x1a')])){if(moment()['isBefore'](accountsTokens[_0x2f7f65['id']][_0xeab9('0x1b')])){_0x303e6d(accountsTokens[_0x2f7f65['id']][_0xeab9('0x1a')]);}}var _0x74ce1e;switch(_0x2f7f65[_0xeab9('0x1c')]){case'US':_0x74ce1e=_0xeab9('0x1d');break;case'AU':_0x74ce1e='https://accounts.zoho.com.au';break;case'EU':_0x74ce1e='https://accounts.zoho.eu';break;case'IN':_0x74ce1e=_0xeab9('0x1e');break;case'CN':_0x74ce1e=_0xeab9('0x1f');break;default:_0x74ce1e=_0xeab9('0x20');break;}var _0x51e655={'method':_0xeab9('0x21'),'uri':_0x74ce1e+_0xeab9('0x22'),'qs':{'refresh_token':_0x2f7f65[_0xeab9('0x23')],'client_id':_0x2f7f65['clientId'],'client_secret':_0x2f7f65[_0xeab9('0x24')],'grant_type':_0xeab9('0x25')},'json':!![]};return rp(_0x51e655)['then'](function(_0x601a1f){accountsTokens[_0x2f7f65['id']]={'access_token':_0x601a1f['access_token'],'expires_in':moment()[_0xeab9('0x26')](_0x601a1f[_0xeab9('0x1b')],_0xeab9('0x27'))};_0x303e6d(_0x601a1f[_0xeab9('0x1a')]);})[_0xeab9('0x28')](function(_0x13f6eb){logger[_0xeab9('0x29')](_0xeab9('0x2a'),_0x13f6eb[_0xeab9('0x2b')]);_0x5dca88(_0x13f6eb);});});}function getUser(_0x4580b7,_0x38d1cf,_0x4cf8ab,_0x39b3d3){logger[_0xeab9('0x2c')]('Search\x20user');return request({'method':_0xeab9('0x2d'),'uri':util[_0xeab9('0x2e')]('https://www.zohoapis.%s/crm/v2/users',_0x38d1cf),'qs':{'type':_0xeab9('0x2f')},'headers':{'Authorization':_0xeab9('0x30')+_0x4580b7},'json':!![]})[_0xeab9('0x31')](function(_0x838194){if(_0x838194[_0xeab9('0x32')]){var _0x31b192=-0x1;if(_[_0xeab9('0x33')](_0x838194[_0xeab9('0x32')])){if(!_[_0xeab9('0x19')](_0x39b3d3)){_0x31b192=_[_0xeab9('0x34')](_0x838194[_0xeab9('0x32')],function(_0x4341e2){return _0x4341e2[_0xeab9('0x35')]===_0x39b3d3;});}if(_0x31b192>=0x0){logger[_0xeab9('0x2c')]('Agent\x20found!');}else{logger[_0xeab9('0x2c')](_0xeab9('0x36'));_0x31b192=_[_0xeab9('0x34')](_0x838194['users'],function(_0x2d0cb9){return _0x2d0cb9[_0xeab9('0x37')]['name']===_0xeab9('0x38');});}return _0x838194['users'][_0x31b192];}else{if(_0x838194[_0xeab9('0x39')]['profile'][_0xeab9('0x16')]==='Administrator'){logger[_0xeab9('0x2c')](_0xeab9('0x36'));user=_0x838194['user'];return user;}else{logger[_0xeab9('0x29')](_0xeab9('0x3a'),JSON[_0xeab9('0xa')](_0x838194));throw new Error(_0xeab9('0x3b')+JSON[_0xeab9('0xa')](_0x838194));}}}else{logger[_0xeab9('0x29')]('The\x20failing\x20result\x20is',JSON[_0xeab9('0xa')](_0x838194));throw new Error(_0xeab9('0x3b')+JSON['stringify'](_0x838194));}})[_0xeab9('0x28')](function(_0x113160){console[_0xeab9('0x29')](_0x113160);});}function getZohoUser(_0x547cb3,_0x466ada){return new BPromise(function(_0x58147e,_0x3b5e60){request(_0x547cb3)[_0xeab9('0x31')](function(_0x5252e2){var _0x4cf0f3=null;if(_0x5252e2){_0x4cf0f3=_0x5252e2['data'][0x0];_0x4cf0f3[_0xeab9('0x3c')]=_0x466ada;}_0x58147e(_0x4cf0f3);})[_0xeab9('0x28')](function(_0x34aa2f){_0x3b5e60(_0x34aa2f);});});}function createEndUser(_0x248203,_0x339de1,_0xc8bfb6,_0x5cf836,_0x78942b,_0x40c8e8){var _0xc8bfb6=getName(_0xc8bfb6);return request({'method':_0xeab9('0x21'),'uri':_0xeab9('0x3d')+_0x339de1+_0xeab9('0x3e')+_[_0xeab9('0x3f')](_0x40c8e8['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xc8bfb6[0x1],'First_Name':_0xc8bfb6[0x0],'Phone':_0x5cf836,'Owner':{'name':!_[_0xeab9('0x19')](_0x78942b[_0xeab9('0x40')]['name'])?_0x78942b[_0xeab9('0x40')][_0xeab9('0x16')]:!_['isNil'](_0x78942b['first_name'])?_0x78942b[_0xeab9('0x41')]+'\x20'+_0x78942b[_0xeab9('0x42')]:_0x78942b['last_name'],'id':_0x78942b['id']}}]},'headers':{'Authorization':_0xeab9('0x30')+_0x248203},'json':!![]})[_0xeab9('0x31')](function(_0x337a6f){if(_0x337a6f&&_0x337a6f['data'][0x0][_0xeab9('0x43')]===_0xeab9('0x44')){var _0x342ad4=_0x337a6f['data'][0x0][_0xeab9('0x45')];_0x342ad4['enduserType']=_['startCase'](_0x40c8e8[_0xeab9('0x46')])+'s';return _0x342ad4;}logger['error'](_0xeab9('0x3a'),JSON[_0xeab9('0xa')](data));throw new Error(_0xeab9('0x47')+JSON[_0xeab9('0xa')](data));})['catch'](function(_0x501f65){console[_0xeab9('0x48')]('CREATE\x20ERROR',_0x501f65);});}function getEndUser(_0x500ad9,_0x5efd99,_0x4f71ba,_0x262f7f,_0x1d26da,_0x46d814,_0x241e5d){var _0x44000a={'method':_0xeab9('0x2d'),'uri':'','headers':{'Authorization':_0xeab9('0x30')+_0x500ad9},'json':!![]};switch(_0x241e5d[_0xeab9('0x49')]){case _0xeab9('0x4a'):_0x44000a['uri']=_0xeab9('0x3d')+_0x5efd99+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1d26da+'))';return getZohoUser(_0x44000a,_0xeab9('0x4b'))[_0xeab9('0x31')](function(_0x548cca){if(_0x548cca)return _0x548cca;_0x44000a['uri']=_0xeab9('0x3d')+_0x5efd99+_0xeab9('0x4c')+_0x1d26da+'))';return getZohoUser(_0x44000a,'Leads')[_0xeab9('0x31')](function(_0x31a56c){if(_0x31a56c)return _0x31a56c;if(_0x241e5d[_0xeab9('0x46')]!=_0xeab9('0x4d')){return createEndUser(_0x500ad9,_0x5efd99,_0x262f7f,_0x1d26da,_0x46d814,_0x241e5d);}else{return{};}});});break;case _0xeab9('0x4e'):_0x44000a[_0xeab9('0x4f')]=_0xeab9('0x3d')+_0x5efd99+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1d26da+'))';return getZohoUser(_0x44000a,_0xeab9('0x4b'))[_0xeab9('0x31')](function(_0x5445b3){if(_0x5445b3)return _0x5445b3;if(_0x241e5d[_0xeab9('0x46')]!='nothing'){return createEndUser(_0x500ad9,_0x5efd99,_0x262f7f,_0x1d26da,_0x46d814,_0x241e5d);}else{return{};}});break;case _0xeab9('0x50'):_0x44000a['uri']=_0xeab9('0x3d')+_0x5efd99+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1d26da+'))';return getZohoUser(_0x44000a,'Leads')[_0xeab9('0x31')](function(_0x5cca8e){if(_0x5cca8e)return _0x5cca8e;if(_0x241e5d[_0xeab9('0x46')]!=_0xeab9('0x4d')){return createEndUser(_0x500ad9,_0x5efd99,_0x262f7f,_0x1d26da,_0x46d814,_0x241e5d);}else{return{};}});break;}}function getCall(_0x377984,_0x556ee5,_0x252d55,_0xfb38c8,_0x32e8f4,_0x23d842,_0x4551b5,_0xa11561){logger[_0xeab9('0x2c')]('Creating\x20new\x20call...');var _0x544a3f={};_0x544a3f[_0xeab9('0x51')]={'name':!_[_0xeab9('0x19')](_0xfb38c8['role'][_0xeab9('0x16')])&&!_[_0xeab9('0x19')](_0xfb38c8[_0xeab9('0x37')][_0xeab9('0x16')])&&_0xfb38c8[_0xeab9('0x37')][_0xeab9('0x16')]===_0xeab9('0x52')?_0xfb38c8[_0xeab9('0x40')][_0xeab9('0x16')]:!_[_0xeab9('0x19')](_0xfb38c8['first_name'])?_0xfb38c8[_0xeab9('0x41')]+'\x20'+_0xfb38c8['last_name']:_0xfb38c8['last_name'],'id':_0xfb38c8['id']};_0x544a3f[_0xeab9('0x53')]=intUtil[_0xeab9('0x54')](_0x23d842[_0xeab9('0x55')],_0x4551b5,'\x20');_0x544a3f[_0xeab9('0x56')]=intUtil[_0xeab9('0x54')](_0x23d842[_0xeab9('0x57')],_0x4551b5,'\x0a');if(_0x32e8f4['enduserType']===_0xeab9('0x4b')){_0x544a3f[_0xeab9('0x58')]={'name':!_['isNil'](_0x32e8f4[_0xeab9('0x59')])?_0x32e8f4[_0xeab9('0x59')]:!_[_0xeab9('0x19')](_0x32e8f4[_0xeab9('0x5a')])?_0x32e8f4[_0xeab9('0x5a')]+'\x20'+_0x32e8f4['Last_Name']:_0x32e8f4[_0xeab9('0x5b')],'id':_0x32e8f4['id']};}if(_0x32e8f4[_0xeab9('0x3c')]===_0xeab9('0x5c')){_0x544a3f[_0xeab9('0x5d')]={'name':!_[_0xeab9('0x19')](_0x32e8f4['Full_Name'])?_0x32e8f4['Full_Name']:!_[_0xeab9('0x19')](_0x32e8f4[_0xeab9('0x5a')])?_0x32e8f4[_0xeab9('0x5a')]+'\x20'+_0x32e8f4[_0xeab9('0x5b')]:_0x32e8f4[_0xeab9('0x5b')],'id':_0x32e8f4['id']};_0x544a3f[_0xeab9('0x5e')]=_[_0xeab9('0x3f')](_0x32e8f4[_0xeab9('0x3c')]);}if(_0x4551b5[_0xeab9('0x5f')]){_0x544a3f[_0xeab9('0x60')]=moment[_0xeab9('0x61')](parseInt(_0x4551b5[_0xeab9('0x5f')])*0x3e8)['format'](_0xeab9('0x62'));}else if(_0x4551b5[_0xeab9('0x63')]&&_0x4551b5[_0xeab9('0x64')]){_0x544a3f['Call_Duration']=moment[_0xeab9('0x61')](moment(_0x4551b5[_0xeab9('0x64')],_0xeab9('0x65'))[_0xeab9('0x66')](moment(_0x4551b5[_0xeab9('0x67')],_0xeab9('0x65'))))[_0xeab9('0x2e')]('mm:ss');}switch(_0x4551b5[_0xeab9('0x68')]){case _0xeab9('0x69'):_0x544a3f[_0xeab9('0x6a')]='Called';break;case _0xeab9('0x6b'):case _0xeab9('0x6c'):_0x544a3f[_0xeab9('0x6a')]=_0xeab9('0x6d');break;case _0xeab9('0x6e'):_0x544a3f['Call_Result']=_0xeab9('0x6f');break;case _0xeab9('0x70'):_0x544a3f[_0xeab9('0x6a')]=_0xeab9('0x71');break;case'timeout':_0x544a3f[_0xeab9('0x6a')]=_0xeab9('0x72');default:}_0x544a3f[_0xeab9('0x73')]=(_0xa11561===_0xeab9('0x74')?moment(_0x4551b5['starttime'])['format'](_0xeab9('0x65')):moment(_0x4551b5[_0xeab9('0x75')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xeab9('0x2e')](_0xeab9('0x65'));_0x544a3f[_0xeab9('0x76')]=_0xa11561||_0xeab9('0x77');_0x544a3f=_[_0xeab9('0x78')](_0x544a3f,getCustomFields(_0x23d842[_0xeab9('0x79')],_0x4551b5));return request({'method':_0xeab9('0x21'),'uri':_0xeab9('0x3d')+_0x556ee5+_0xeab9('0x7a'),'headers':{'Authorization':_0xeab9('0x30')+_0x377984},'body':{'data':[_0x544a3f]},'json':!![]})[_0xeab9('0x31')](function(_0x4ebf49){if(_0x4ebf49&&_0x4ebf49['data'][0x0][_0xeab9('0x43')]==='SUCCESS'){logger[_0xeab9('0x2c')](_0xeab9('0x7b'));return{'id':_0x4ebf49[_0xeab9('0x7c')][0x0][_0xeab9('0x45')]['id']};}})[_0xeab9('0x28')](function(_0x29d9bc){logger[_0xeab9('0x2c')](_0xeab9('0x7d'),_0x29d9bc['stack']);console[_0xeab9('0x48')](_0xeab9('0x7d'),_0x29d9bc);});}exports[_0xeab9('0x7e')]=function(_0x569789,_0x1a8a56,_0x5da851,_0x3259c2,_0x3f344a,_0x2a6183){var _0x43482f,_0x441b5e,_0x311a09;_0x2a6183[_0xeab9('0x7f')]=intUtil[_0xeab9('0x80')](_0x2a6183[_0xeab9('0x7f')]);_0x2a6183[_0xeab9('0x81')]=intUtil[_0xeab9('0x80')](_0x2a6183[_0xeab9('0x81')]);if(_0x3f344a&&_0x3f344a[_0xeab9('0x82')]){logger[_0xeab9('0x2c')](_0xeab9('0x83'),'Recording\x20is\x20enabled!');_0x1a8a56[_0xeab9('0x84')]=_0x2a6183[_0xeab9('0x81')]+_0xeab9('0x85')+_0x1a8a56[_0xeab9('0x86')]+_0xeab9('0x87')+md5(_0x1a8a56[_0xeab9('0x86')]);}else{_0x1a8a56[_0xeab9('0x84')]='';}var _0x38627a=_0x2a6183[_0xeab9('0x7f')]===_0xeab9('0x88')?'eu':_0xeab9('0x89');return getAccessToken(_0x2a6183)['then'](function(_0x2c0037){_0x311a09=_0x2c0037;return getUser(_0x311a09,_0x38627a,_0x2a6183,_0x3259c2['email']);})[_0xeab9('0x31')](function(_0x2daf12){_0x43482f=_0x2daf12;logger[_0xeab9('0x2c')](_0xeab9('0x8a'),_0x43482f['id']);return getEndUser(_0x311a09,_0x38627a,_0x2a6183,_0x1a8a56[_0xeab9('0x8b')],_0x1a8a56['calleridnum'],_0x43482f,_0x5da851);})[_0xeab9('0x31')](function(_0x419d5d){_0x441b5e=_0x419d5d;return getCall(_0x311a09,_0x38627a,_0x2a6183,_0x43482f,_0x441b5e,_0x5da851,_0x1a8a56,'Inbound');})[_0xeab9('0x31')](function(_0x8cebaa){if(_0x8cebaa){logger[_0xeab9('0x2c')]('The\x20Call\x20ID\x20is:',_0x8cebaa['id']);logger[_0xeab9('0x2c')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeab9('0x2e')]('user:%s',_0x3259c2[_0xeab9('0x16')]),_0xeab9('0x8c'),{'uri':_0xeab9('0x8d')+_0x2a6183[_0xeab9('0x7f')]+_0xeab9('0x8e')+_0x8cebaa['id']});}})[_0xeab9('0x28')](function(_0x4208c1){logger[_0xeab9('0x29')](_0xeab9('0x83'),JSON[_0xeab9('0xa')](_0x4208c1));});};exports['outbound']=function(_0x1d59ef,_0x4d485d,_0x36a100,_0x59a365,_0x463234,_0x1ca371,_0x2d93bc){var _0x16a070,_0x6fd724,_0x5c5e05;_0x1ca371[_0xeab9('0x7f')]=intUtil[_0xeab9('0x80')](_0x1ca371['host']);_0x1ca371['serverUrl']=intUtil[_0xeab9('0x80')](_0x1ca371[_0xeab9('0x81')]);if(_0x2d93bc&&_0x2d93bc['recordingFormat']&&_0x2d93bc[_0xeab9('0x8f')]!==_0xeab9('0x90')){logger[_0xeab9('0x2c')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4d485d['recordingURL']=_0x1ca371[_0xeab9('0x81')]+_0xeab9('0x85')+_0x4d485d[_0xeab9('0x86')]+_0xeab9('0x87')+md5(_0x4d485d[_0xeab9('0x86')]);}var _0x194fd4=_0x1ca371[_0xeab9('0x7f')]==='zoho.eu'?'eu':_0xeab9('0x89');return getAccessToken(_0x1ca371)[_0xeab9('0x31')](function(_0x4f2470){_0x5c5e05=_0x4f2470;return getUser(_0x5c5e05,_0x194fd4,_0x1ca371,_0x59a365['email']);})['then'](function(_0x1ec0ab){_0x16a070=_0x1ec0ab;logger[_0xeab9('0x2c')](_0xeab9('0x8a'),_0x16a070['id']);return getEndUser(_0x5c5e05,_0x194fd4,_0x1ca371,_0x4d485d[_0xeab9('0x91')],_0x4d485d[_0xeab9('0x92')],_0x16a070,_0x36a100);})[_0xeab9('0x31')](function(_0x11b6fe){_0x6fd724=_0x11b6fe;return getCall(_0x5c5e05,_0x194fd4,_0x1ca371,_0x16a070,_0x6fd724,_0x36a100,_0x4d485d,_0xeab9('0x93'));})[_0xeab9('0x31')](function(_0x552da9){if(_0x552da9){logger[_0xeab9('0x2c')]('The\x20Call\x20ID\x20is:',_0x552da9['id']);logger['info']('[OUTBOUND]',_0xeab9('0x94'));emit(util[_0xeab9('0x2e')](_0xeab9('0x95'),_0x59a365[_0xeab9('0x16')]),_0xeab9('0x8c'),{'uri':'https://crm.'+_0x1ca371[_0xeab9('0x7f')]+_0xeab9('0x8e')+_0x552da9['id']});}})[_0xeab9('0x28')](function(_0xaeaf01){logger[_0xeab9('0x29')](_0xeab9('0x96'),JSON[_0xeab9('0xa')](_0xaeaf01));});};exports[_0xeab9('0x97')]=function(_0x44a7da,_0x3fd66b,_0x417b8d,_0x3e3bfb,_0x2a0260,_0x64f46c){var _0x545775,_0x5eb0b7,_0x33159c;_0x64f46c[_0xeab9('0x7f')]=intUtil['stripTrailingSlash'](_0x64f46c[_0xeab9('0x7f')]);_0x64f46c[_0xeab9('0x81')]=intUtil[_0xeab9('0x80')](_0x64f46c[_0xeab9('0x81')]);if(_0x2a0260&&_0x2a0260[_0xeab9('0x82')]){logger[_0xeab9('0x2c')]('['+_0x3fd66b[_0xeab9('0x68')][_0xeab9('0x98')]()+']','Recording\x20is\x20enabled!');_0x3fd66b[_0xeab9('0x84')]=_0x64f46c[_0xeab9('0x81')]+'/api/voice/recordings/'+_0x3fd66b[_0xeab9('0x86')]+_0xeab9('0x87')+md5(_0x3fd66b[_0xeab9('0x86')]);}else{_0x3fd66b[_0xeab9('0x84')]='';}var _0x4e99e1=_0x64f46c[_0xeab9('0x7f')]===_0xeab9('0x88')?'eu':'com';return getAccessToken(_0x64f46c)['then'](function(_0x2126fd){_0x33159c=_0x2126fd;return getUser(_0x33159c,_0x4e99e1,_0x64f46c);})[_0xeab9('0x31')](function(_0x303ded){_0x545775=_0x303ded;logger['info']('The\x20User\x20ID\x20is:',_0x545775['id']);return getEndUser(_0x33159c,_0x4e99e1,_0x64f46c,_0x3fd66b[_0xeab9('0x8b')],_0x3fd66b[_0xeab9('0x99')],_0x545775,_0x417b8d);})['then'](function(_0x5a8468){_0x5eb0b7=_0x5a8468;return getCall(_0x33159c,_0x4e99e1,_0x64f46c,_0x545775,_0x5eb0b7,_0x417b8d,_0x3fd66b,_0xeab9('0x77'));})[_0xeab9('0x31')](function(_0xe5720a){if(_0xe5720a){logger[_0xeab9('0x2c')](_0xeab9('0x9a'),_0xe5720a['id']);}})[_0xeab9('0x28')](function(_0x1d98aa){logger[_0xeab9('0x29')]('['+_0x3fd66b[_0xeab9('0x68')][_0xeab9('0x98')]()+']',JSON[_0xeab9('0xa')](_0x1d98aa));});}; \ 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 c041776..c94d5ac 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 _0x42b6=['data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2','Script'];(function(_0x28ed67,_0x324137){var _0x1dcd95=function(_0x34a3e9){while(--_0x34a3e9){_0x28ed67['push'](_0x28ed67['shift']());}};_0x1dcd95(++_0x324137);}(_0x42b6,0x6e));var _0x642b=function(_0x5c1aa3,_0x453061){_0x5c1aa3=_0x5c1aa3-0x0;var _0x55b103=_0x42b6[_0x5c1aa3];return _0x55b103;};'use strict';var util=require(_0x642b('0x0'));var sh=require(_0x642b('0x1'));var Mustache=require(_0x642b('0x2'));var logger=require('../../../../config/logger')(_0x642b('0x3'));exports[_0x642b('0x4')]=function(_0x701467,_0xa7e4e4){var _0x543919=_0x701467['data2']?_0x701467[_0x642b('0x5')]:_0x642b('0x6');var _0x281808=_0x701467[_0x642b('0x7')]?Mustache[_0x642b('0x8')](_0x701467[_0x642b('0x7')],_0xa7e4e4):_0xa7e4e4;sh['exec'](_0x281808,function(_0x7b4117,_0x507b36,_0x2b7d36){if(_0x7b4117!==0x0){logger['error'](util[_0x642b('0x9')](_0x642b('0xa'),_0x543919,_0x281808,_0x7b4117,_0x2b7d36));}else{logger[_0x642b('0xb')](util[_0x642b('0x9')](_0x642b('0xc'),_0x543919,_0x281808,_0x507b36));}});}; \ No newline at end of file +var _0x1ef9=['data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','../../../../config/logger','trigger','exec'];(function(_0x555808,_0x34f558){var _0x3dccfa=function(_0x5512b9){while(--_0x5512b9){_0x555808['push'](_0x555808['shift']());}};_0x3dccfa(++_0x34f558);}(_0x1ef9,0x19f));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x91ef('0x0'));var sh=require(_0x91ef('0x1'));var Mustache=require('mustache');var logger=require(_0x91ef('0x2'))(_0x91ef('0x3'));exports[_0x91ef('0x4')]=function(_0x5a8433,_0x11130c){var _0x23261d=_0x5a8433[_0x91ef('0x5')]?_0x5a8433[_0x91ef('0x5')]:_0x91ef('0x6');var _0x26c0c5=_0x5a8433[_0x91ef('0x7')]?Mustache['render'](_0x5a8433[_0x91ef('0x7')],_0x11130c):_0x11130c;sh[_0x91ef('0x4')](_0x26c0c5,function(_0xf563e9,_0x38cbda,_0x4b94b5){if(_0xf563e9!==0x0){logger[_0x91ef('0x8')](util[_0x91ef('0x9')](_0x91ef('0xa'),_0x23261d,_0x26c0c5,_0xf563e9,_0x4b94b5));}else{logger[_0x91ef('0xb')](util[_0x91ef('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x23261d,_0x26c0c5,_0x38cbda));}});}; \ 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 3f1fd3a..fc39a4b 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 _0xa171=['data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data2','number','headers','data6','parse','error','stack','GET','DELETE','POST','PUT'];(function(_0x426090,_0x259c2e){var _0x4d025f=function(_0x20e015){while(--_0x20e015){_0x426090['push'](_0x426090['shift']());}};_0x4d025f(++_0x259c2e);}(_0xa171,0x72));var _0x1a17=function(_0x51a023,_0x40ff38){_0x51a023=_0x51a023-0x0;var _0x1dfe91=_0xa171[_0x51a023];return _0x1dfe91;};'use strict';var rp=require('request-promise');var util=require(_0x1a17('0x0'));var _=require(_0x1a17('0x1'));var Mustache=require(_0x1a17('0x2'));var logger=require(_0x1a17('0x3'))('trigger');exports[_0x1a17('0x4')]=function(_0x8d753e,_0x5e3cc2){var _0x115518,_0x2c0309;var _0x670d4f={'method':_0x8d753e[_0x1a17('0x5')][_0x1a17('0x6')](),'uri':Mustache['render'](_0x8d753e[_0x1a17('0x7')],_0x5e3cc2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x8d753e['data5'])===_0x1a17('0x8')&&parseInt(_0x8d753e['data5'])>=0x1&&parseInt(_0x8d753e['data5'])<=0xa?parseInt(_0x8d753e['data5'])*0x3e8:0x5*0x3e8};try{_0x670d4f[_0x1a17('0x9')]=_0x8d753e[_0x1a17('0xa')]?JSON[_0x1a17('0xb')](Mustache['render'](_0x8d753e[_0x1a17('0xa')],_0x5e3cc2)):{};}catch(_0x205524){logger[_0x1a17('0xc')](_0x205524[_0x1a17('0xd')]);}switch(_0x8d753e['data1'][_0x1a17('0x6')]()){case _0x1a17('0xe'):case _0x1a17('0xf'):_0x115518=null;_0x670d4f['qs']=_0x5e3cc2;break;case _0x1a17('0x10'):case _0x1a17('0x11'):if(_0x8d753e[_0x1a17('0x12')]){try{_0x115518=JSON[_0x1a17('0xb')](Mustache['render'](_0x8d753e[_0x1a17('0x12')],_0x5e3cc2));_0x670d4f[_0x1a17('0x13')]=_0x115518;}catch(_0x21cc34){logger[_0x1a17('0xc')](_0x21cc34[_0x1a17('0xd')]);logger['error'](_0x1a17('0x14'));}}else{_0x115518=_0x5e3cc2;_0x670d4f[_0x1a17('0x13')]=_0x115518;}break;}logger[_0x1a17('0x15')](util[_0x1a17('0x16')](_0x1a17('0x17'),_0x8d753e[_0x1a17('0x5')],_0x8d753e[_0x1a17('0x7')],JSON['stringify'](_0x670d4f)));rp(_0x670d4f)[_0x1a17('0x18')](function(_0x2198e4){_0x115518=!_[_0x1a17('0x19')](_0x115518)?_0x1a17('0x1a')+_0x115518:'';_0x2c0309=typeof _0x2198e4[_0x1a17('0x13')]==='object'?JSON[_0x1a17('0x1b')](_0x2198e4[_0x1a17('0x13')]):_0x2198e4[_0x1a17('0x13')];logger[_0x1a17('0x15')](util[_0x1a17('0x16')](_0x1a17('0x1c'),_0x8d753e[_0x1a17('0x5')],_0x8d753e[_0x1a17('0x7')],_0x2198e4[_0x1a17('0x1d')],_0x2c0309));})['catch'](function(_0x48aa88){logger[_0x1a17('0xc')](util['format'](_0x1a17('0x1e'),_0x8d753e[_0x1a17('0x5')],_0x8d753e['data2'],_0x48aa88['statusCode'],_0x48aa88[_0x1a17('0x1f')],_0x48aa88[_0x1a17('0x20')]));});}; \ No newline at end of file +var _0x35e8=['toUpperCase','GET','DELETE','POST','PUT','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','data2','then','isNil','object','stringify','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','lodash','mustache','exec','render','data5','number','data6','error','stack'];(function(_0x25383c,_0x5e6e90){var _0x16e041=function(_0x1b94d2){while(--_0x1b94d2){_0x25383c['push'](_0x25383c['shift']());}};_0x16e041(++_0x5e6e90);}(_0x35e8,0x79));var _0x835e=function(_0x6782ee,_0x3f5c75){_0x6782ee=_0x6782ee-0x0;var _0x5c93b3=_0x35e8[_0x6782ee];return _0x5c93b3;};'use strict';var rp=require(_0x835e('0x0'));var util=require(_0x835e('0x1'));var _=require(_0x835e('0x2'));var Mustache=require(_0x835e('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0x835e('0x4')]=function(_0x16da60,_0x14c3e3){var _0x418310,_0x530291;var _0x1a7abe={'method':_0x16da60['data1']['toUpperCase'](),'uri':Mustache[_0x835e('0x5')](_0x16da60['data2'],_0x14c3e3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x16da60[_0x835e('0x6')])===_0x835e('0x7')&&parseInt(_0x16da60[_0x835e('0x6')])>=0x1&&parseInt(_0x16da60[_0x835e('0x6')])<=0xa?parseInt(_0x16da60[_0x835e('0x6')])*0x3e8:0x5*0x3e8};try{_0x1a7abe['headers']=_0x16da60[_0x835e('0x8')]?JSON['parse'](Mustache['render'](_0x16da60['data6'],_0x14c3e3)):{};}catch(_0x1cc802){logger[_0x835e('0x9')](_0x1cc802[_0x835e('0xa')]);}switch(_0x16da60['data1'][_0x835e('0xb')]()){case _0x835e('0xc'):case _0x835e('0xd'):_0x418310=null;_0x1a7abe['qs']=_0x14c3e3;break;case _0x835e('0xe'):case _0x835e('0xf'):if(_0x16da60['data7']){try{_0x418310=JSON[_0x835e('0x10')](Mustache[_0x835e('0x5')](_0x16da60['data7'],_0x14c3e3));_0x1a7abe['body']=_0x418310;}catch(_0x5f5166){logger['error'](_0x5f5166[_0x835e('0xa')]);logger['error'](_0x835e('0x11'));}}else{_0x418310=_0x14c3e3;_0x1a7abe[_0x835e('0x12')]=_0x418310;}break;}logger['info'](util['format'](_0x835e('0x13'),_0x16da60[_0x835e('0x14')],_0x16da60[_0x835e('0x15')],JSON['stringify'](_0x1a7abe)));rp(_0x1a7abe)[_0x835e('0x16')](function(_0x4114d6){_0x418310=!_[_0x835e('0x17')](_0x418310)?',\x20request\x20body:\x20'+_0x418310:'';_0x530291=typeof _0x4114d6['body']===_0x835e('0x18')?JSON[_0x835e('0x19')](_0x4114d6[_0x835e('0x12')]):_0x4114d6[_0x835e('0x12')];logger[_0x835e('0x1a')](util[_0x835e('0x1b')](_0x835e('0x1c'),_0x16da60['data1'],_0x16da60[_0x835e('0x15')],_0x4114d6[_0x835e('0x1d')],_0x530291));})[_0x835e('0x1e')](function(_0x3c8c44){logger['error'](util[_0x835e('0x1b')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x16da60[_0x835e('0x14')],_0x16da60[_0x835e('0x15')],_0x3c8c44[_0x835e('0x1d')],_0x3c8c44[_0x835e('0x1f')],_0x3c8c44[_0x835e('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b5e35b2..5ae0eee 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 _0x5ad1=['routing','Request','request','then','debug','rpc','error','message','result','bluebird','../../config/logger'];(function(_0x54c188,_0x5c4a61){var _0x14d5eb=function(_0x552c2d){while(--_0x552c2d){_0x54c188['push'](_0x54c188['shift']());}};_0x14d5eb(++_0x5c4a61);}(_0x5ad1,0xf0));var _0x15ad=function(_0x78b610,_0x4b4d30){_0x78b610=_0x78b610-0x0;var _0x53b08a=_0x5ad1[_0x78b610];return _0x53b08a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x15ad('0x0'));var logger=require(_0x15ad('0x1'))(_0x15ad('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x15ad('0x3')]=function(_0x4c406a,_0x5ba97d){return new BPromise(function(_0x5dd5e5,_0x3fd41b){return client[_0x15ad('0x4')](_0x4c406a,_0x5ba97d)[_0x15ad('0x5')](function(_0xa87684){logger[_0x15ad('0x6')](_0x15ad('0x7'),_0x15ad('0x2'),_0x4c406a,_0x5ba97d,_0xa87684);if(_0xa87684[_0x15ad('0x8')]){logger[_0x15ad('0x8')](_0x15ad('0x7'),_0x15ad('0x2'),_0x4c406a,_0xa87684[_0x15ad('0x8')]['message'],_0x5ba97d);return _0x3fd41b(_0xa87684['error'][_0x15ad('0x9')]);}else{return _0x5dd5e5(_0xa87684[_0x15ad('0xa')]);}})['catch'](function(_0x51328e){logger[_0x15ad('0x8')](_0x15ad('0x7'),_0x15ad('0x2'),_0x4c406a,_0x51328e,_0x5ba97d);return _0x3fd41b(_0x51328e);});});};module['exports']=client; \ No newline at end of file +var _0xaf4c=['rpc','error','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','debug'];(function(_0x44327c,_0x2bf584){var _0x195df5=function(_0x146246){while(--_0x146246){_0x44327c['push'](_0x44327c['shift']());}};_0x195df5(++_0x2bf584);}(_0xaf4c,0x13d));var _0xcaf4=function(_0x1bcdaf,_0x1fb327){_0x1bcdaf=_0x1bcdaf-0x0;var _0x797e6=_0xaf4c[_0x1bcdaf];return _0x797e6;};'use strict';var jayson=require(_0xcaf4('0x0'));var BPromise=require(_0xcaf4('0x1'));var logger=require('../../config/logger')(_0xcaf4('0x2'));var client=jayson[_0xcaf4('0x3')][_0xcaf4('0x4')]({'port':0x2329});client[_0xcaf4('0x5')]=function(_0x52d0a4,_0x274e4e){return new BPromise(function(_0x31bdb7,_0x35d9b2){return client[_0xcaf4('0x6')](_0x52d0a4,_0x274e4e)['then'](function(_0x11768f){logger[_0xcaf4('0x7')](_0xcaf4('0x8'),_0xcaf4('0x2'),_0x52d0a4,_0x274e4e,_0x11768f);if(_0x11768f[_0xcaf4('0x9')]){logger[_0xcaf4('0x9')](_0xcaf4('0x8'),_0xcaf4('0x2'),_0x52d0a4,_0x11768f['error']['message'],_0x274e4e);return _0x35d9b2(_0x11768f[_0xcaf4('0x9')]['message']);}else{return _0x31bdb7(_0x11768f[_0xcaf4('0xa')]);}})[_0xcaf4('0xb')](function(_0x1758f9){logger[_0xcaf4('0x9')]('rpc',_0xcaf4('0x2'),_0x52d0a4,_0x1758f9,_0x274e4e);return _0x35d9b2(_0x1758f9);});});};module[_0xcaf4('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 0228a41..8183d8b 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 _0x57ef=['./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','./server','./realtime'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x57ef,0xdb));var _0xf57e=function(_0x31fe33,_0xfd0565){_0x31fe33=_0x31fe33-0x0;var _0xcf440b=_0x57ef[_0x31fe33];return _0xcf440b;};'use strict';var BPromise=require('bluebird');var server=require(_0xf57e('0x0'));var Realtime=require(_0xf57e('0x1'));var EmailChannel=require(_0xf57e('0x2'));var mailAccount=require(_0xf57e('0x3'));var setting=require(_0xf57e('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf57e('0x5')]()[_0xf57e('0x6')](mailAccount['getMailAccounts']())[_0xf57e('0x6')](realtime[_0xf57e('0x7')]())[_0xf57e('0x6')](function(){email[_0xf57e('0x8')](realtime[_0xf57e('0x9')]);return realtime;});}function main(){return server[_0xf57e('0xa')](realtime,email)[_0xf57e('0x6')](function(){return initRealtime();})[_0xf57e('0x6')](function(){return setting['getSettings']();})[_0xf57e('0x6')](function(_0x4601c7){return setInterval(initRealtime,_0x4601c7[_0xf57e('0xb')]*0x3e8);})[_0xf57e('0xc')](function(_0x12f46e){console['log'](_0x12f46e);});}main(); \ No newline at end of file +var _0x4732=['loginMailFrequency','catch','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts','then','mailAccounts','listen','getSettings'];(function(_0x36e72c,_0x27cb96){var _0x55e99d=function(_0x53a87c){while(--_0x53a87c){_0x36e72c['push'](_0x36e72c['shift']());}};_0x55e99d(++_0x27cb96);}(_0x4732,0xf1));var _0x2473=function(_0x381a28,_0x4eb359){_0x381a28=_0x381a28-0x0;var _0x5e572d=_0x4732[_0x381a28];return _0x5e572d;};'use strict';var BPromise=require(_0x2473('0x0'));var server=require('./server');var Realtime=require(_0x2473('0x1'));var EmailChannel=require(_0x2473('0x2'));var mailAccount=require(_0x2473('0x3'));var setting=require(_0x2473('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x2473('0x5')]()['then'](mailAccount[_0x2473('0x6')]())[_0x2473('0x7')](realtime['initMailAccounts']())[_0x2473('0x7')](function(){email['refresh'](realtime[_0x2473('0x8')]);return realtime;});}function main(){return server[_0x2473('0x9')](realtime,email)[_0x2473('0x7')](function(){return initRealtime();})[_0x2473('0x7')](function(){return setting[_0x2473('0xa')]();})['then'](function(_0x4df4c1){return setInterval(initRealtime,_0x4df4c1[_0x2473('0xb')]*0x3e8);})[_0x2473('0xc')](function(_0x19b084){console[_0x2473('0xd')](_0x19b084);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 74fce1c..b71bbaa 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 _0xf61f=['verify','then','verified','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','active','Imap','status','messageStatus','isNil','mailAccount:update','refresh','hasOwnProperty','email','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','sendMail','send','Smtp'];(function(_0x1b6bad,_0x2c9ef8){var _0x5ad5bc=function(_0x1ebe32){while(--_0x1ebe32){_0x1b6bad['push'](_0x1b6bad['shift']());}};_0x5ad5bc(++_0x2c9ef8);}(_0xf61f,0x18c));var _0xff61=function(_0x37b529,_0x6724e7){_0x37b529=_0x37b529-0x0;var _0x116152=_0xf61f[_0x37b529];return _0x116152;};'use strict';var _=require(_0xff61('0x0'));var moment=require('moment');var BPromise=require(_0xff61('0x1'));var md5=require(_0xff61('0x2'));var Redis=require('ioredis');var config=require(_0xff61('0x3'));var logger=require(_0xff61('0x4'))('email');config[_0xff61('0x5')]=_[_0xff61('0x6')](config[_0xff61('0x5')],{'host':_0xff61('0x7'),'port':0x18eb});var io=require(_0xff61('0x8'))(new Redis(config[_0xff61('0x5')]));var EmailImap=require(_0xff61('0x9'));var EmailSmtp=require(_0xff61('0xa'));var mailAccount=require(_0xff61('0xb'));var md5Accounts={};function EmailChannel(_0x201de4){logger[_0xff61('0xc')](_0xff61('0xd'));this[_0xff61('0xe')]=_0x201de4['mailAccounts'];this[_0xff61('0xf')]={};this[_0xff61('0x10')]=new EmailSmtp();}EmailChannel[_0xff61('0x11')][_0xff61('0x12')]=function(_0xf5a430){var _0x3476d2=this[_0xff61('0xe')][_0xf5a430];var _0xa7aa60={'id':_0x3476d2['id'],'name':_0x3476d2['name'],'key':_0x3476d2['key'],'active':_0x3476d2[_0xff61('0x13')],'Imap':{'status':_0x3476d2[_0xff61('0x14')][_0xff61('0x15')],'messageStatus':_0x3476d2['Imap'][_0xff61('0x16')],'total':_0x3476d2[_0xff61('0x14')]['total']}};if(_[_0xff61('0x17')](md5Accounts[_0xf5a430])){md5Accounts[_0xf5a430]={};}var _0x45e6ef=md5(JSON['stringify'](_0xa7aa60));if(md5Accounts[_0xf5a430][_0xff61('0x2')]!==_0x45e6ef){md5Accounts[_0xf5a430][_0xff61('0x2')]=_0x45e6ef;io[_0xff61('0x12')](_0xff61('0x18'),_0xa7aa60);}};EmailChannel[_0xff61('0x11')][_0xff61('0x19')]=function(_0x16ae83){for(var _0x27b194 in _0x16ae83){if(_0x16ae83[_0xff61('0x1a')](_0x27b194)){if(_0x16ae83[_0x27b194][_0xff61('0x14')]&&_0x16ae83[_0x27b194][_0xff61('0x13')]){var _0xdc9a5d=_0x16ae83[_0x27b194]['Imap'];if(!this[_0xff61('0xf')][_0xff61('0x1a')](_0xdc9a5d['id'])){this[_0xff61('0xf')][_0xdc9a5d['id']]=new EmailImap(_0xdc9a5d,_0x16ae83[_0x27b194][_0xff61('0x1b')]);this[_0xff61('0xf')][_0xdc9a5d['id']]['on']('box',this[_0xff61('0x1c')][_0xff61('0x1d')](this,_0x27b194));this[_0xff61('0xf')][_0xdc9a5d['id']]['on']('email',this[_0xff61('0x1e')][_0xff61('0x1d')](this,_0x27b194));this['imapAccounts'][_0xdc9a5d['id']]['on'](_0xff61('0x1f'),this['handleImapEnd'][_0xff61('0x1d')](this,_0x27b194));this[_0xff61('0xf')][_0xdc9a5d['id']]['on'](_0xff61('0x20'),this[_0xff61('0x21')][_0xff61('0x1d')](this,_0x27b194));}}else{if(_[_0xff61('0x17')](this[_0xff61('0xe')][_0x27b194]['Imap'])){this[_0xff61('0xe')][_0x27b194][_0xff61('0x14')]={};}this[_0xff61('0xe')][_0x27b194][_0xff61('0x14')]['status']=_0xff61('0x22');this['mailAccounts'][_0x27b194][_0xff61('0x14')][_0xff61('0x16')]='';this[_0xff61('0x12')](_0x27b194);}}}};EmailChannel[_0xff61('0x11')][_0xff61('0x1c')]=function(_0x3a8d0f,_0x5904aa){if(this[_0xff61('0xe')][_0x3a8d0f]){this[_0xff61('0xe')][_0x3a8d0f]['Imap'][_0xff61('0x15')]=_0xff61('0x23');this[_0xff61('0xe')][_0x3a8d0f][_0xff61('0x14')][_0xff61('0x16')]=_0x5904aa[_0xff61('0x24')];if(_0x5904aa['messages']){this[_0xff61('0xe')][_0x3a8d0f]['Imap']['total']=_0x5904aa[_0xff61('0x25')]['total'];}return this[_0xff61('0x12')](_0x3a8d0f);}};EmailChannel[_0xff61('0x11')][_0xff61('0x1e')]=function(_0x10b6cb,_0x50aba4){logger[_0xff61('0xc')](_0xff61('0x26'),_0x50aba4[_0xff61('0x27')],_0x50aba4[_0xff61('0x28')],_0x50aba4[_0xff61('0x29')],_0x10b6cb);if(this[_0xff61('0xe')][_0x10b6cb]){return mailAccount[_0xff61('0x2a')](_0x10b6cb,_0x50aba4)['then'](function(_0x19985e){if(_0x19985e){logger['info'](_0xff61('0x2b'));}})[_0xff61('0x2c')](function(_0x4c50cc){logger[_0xff61('0x20')](_0xff61('0x2d'),JSON[_0xff61('0x2e')](_0x4c50cc));});}};EmailChannel['prototype'][_0xff61('0x2f')]=function(_0x2fd45e){if(this[_0xff61('0xe')][_0x2fd45e]&&this[_0xff61('0xe')][_0x2fd45e][_0xff61('0x14')]){if(this[_0xff61('0xf')][this['mailAccounts'][_0x2fd45e]['Imap']['id']]){delete this[_0xff61('0xf')][this['mailAccounts'][_0x2fd45e][_0xff61('0x14')]['id']];}this[_0xff61('0xe')][_0x2fd45e]['Imap'][_0xff61('0x30')]=moment();this[_0xff61('0x12')](_0x2fd45e);}};EmailChannel[_0xff61('0x11')][_0xff61('0x21')]=function(_0x621ed,_0x33322c){if(this['mailAccounts'][_0x621ed]){this[_0xff61('0xe')][_0x621ed][_0xff61('0x14')][_0xff61('0x15')]='error';this[_0xff61('0xe')][_0x621ed][_0xff61('0x14')]['messageStatus']=_0x33322c;return this[_0xff61('0x12')](_0x621ed);}};EmailChannel['prototype'][_0xff61('0x31')]=function(_0x20cb41,_0x1e9a61){return this[_0xff61('0x10')][_0xff61('0x32')](_0x20cb41,_0x1e9a61);};EmailChannel[_0xff61('0x11')]['verifySmtp']=function(_0x33b4a3){var _0x460fea=this;if(this['mailAccounts'][_0x33b4a3['id']]){if(_[_0xff61('0x17')](this[_0xff61('0xe')][_0x33b4a3['id']]['Smtp'])){this[_0xff61('0xe')][_0x33b4a3['id']][_0xff61('0x33')]={};}this[_0xff61('0xe')][_0x33b4a3['id']][_0xff61('0x33')][_0xff61('0x30')]=moment();return new BPromise(function(_0x48fe4e,_0x4abe25){return _0x460fea[_0xff61('0x10')][_0xff61('0x34')](_0x33b4a3)[_0xff61('0x35')](function(_0x173f75){_0x460fea['mailAccounts'][_0x33b4a3['id']]['Smtp'][_0xff61('0x15')]=_0xff61('0x36');_0x460fea[_0xff61('0xe')][_0x33b4a3['id']][_0xff61('0x33')][_0xff61('0x16')]='';_0x460fea[_0xff61('0x12')](_0x33b4a3['id']);_0x48fe4e(_0x173f75);})[_0xff61('0x2c')](function(_0x11513c){_0x460fea[_0xff61('0xe')][_0x33b4a3['id']][_0xff61('0x33')][_0xff61('0x15')]=_0xff61('0x20');_0x460fea['mailAccounts'][_0x33b4a3['id']][_0xff61('0x33')]['messageStatus']=_0x11513c;_0x460fea[_0xff61('0x12')](_0x33b4a3['id']);_0x4abe25(_0x11513c);});});}return this[_0xff61('0x10')][_0xff61('0x34')](_0x33b4a3);};module[_0xff61('0x37')]=EmailChannel; \ No newline at end of file +var _0x65e5=['end','handleImapEnd','error','handleImapError','disabled','messages','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','smtp','send','verifySmtp','Smtp','lastSync','verify','then','verified','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x65e5,0x87));var _0x565e=function(_0x3c9fec,_0x40d887){_0x3c9fec=_0x3c9fec-0x0;var _0x24fce4=_0x65e5[_0x3c9fec];return _0x24fce4;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x565e('0x0'));var md5=require(_0x565e('0x1'));var Redis=require(_0x565e('0x2'));var config=require(_0x565e('0x3'));var logger=require(_0x565e('0x4'))(_0x565e('0x5'));config[_0x565e('0x6')]=_[_0x565e('0x7')](config[_0x565e('0x6')],{'host':_0x565e('0x8'),'port':0x18eb});var io=require(_0x565e('0x9'))(new Redis(config[_0x565e('0x6')]));var EmailImap=require(_0x565e('0xa'));var EmailSmtp=require(_0x565e('0xb'));var mailAccount=require(_0x565e('0xc'));var md5Accounts={};function EmailChannel(_0x113d5b){logger[_0x565e('0xd')](_0x565e('0xe'));this[_0x565e('0xf')]=_0x113d5b['mailAccounts'];this[_0x565e('0x10')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x565e('0x11')][_0x565e('0x12')]=function(_0x3249a7){var _0x4d37b3=this['mailAccounts'][_0x3249a7];var _0x210c70={'id':_0x4d37b3['id'],'name':_0x4d37b3[_0x565e('0x13')],'key':_0x4d37b3[_0x565e('0x14')],'active':_0x4d37b3[_0x565e('0x15')],'Imap':{'status':_0x4d37b3[_0x565e('0x16')][_0x565e('0x17')],'messageStatus':_0x4d37b3[_0x565e('0x16')][_0x565e('0x18')],'total':_0x4d37b3[_0x565e('0x16')][_0x565e('0x19')]}};if(_[_0x565e('0x1a')](md5Accounts[_0x3249a7])){md5Accounts[_0x3249a7]={};}var _0x26a9b1=md5(JSON['stringify'](_0x210c70));if(md5Accounts[_0x3249a7][_0x565e('0x1')]!==_0x26a9b1){md5Accounts[_0x3249a7][_0x565e('0x1')]=_0x26a9b1;io[_0x565e('0x12')](_0x565e('0x1b'),_0x210c70);}};EmailChannel['prototype'][_0x565e('0x1c')]=function(_0x29646f){for(var _0x277a60 in _0x29646f){if(_0x29646f[_0x565e('0x1d')](_0x277a60)){if(_0x29646f[_0x277a60][_0x565e('0x16')]&&_0x29646f[_0x277a60][_0x565e('0x15')]){var _0x5a226b=_0x29646f[_0x277a60][_0x565e('0x16')];if(!this['imapAccounts'][_0x565e('0x1d')](_0x5a226b['id'])){this[_0x565e('0x10')][_0x5a226b['id']]=new EmailImap(_0x5a226b,_0x29646f[_0x277a60][_0x565e('0x5')]);this[_0x565e('0x10')][_0x5a226b['id']]['on']('box',this[_0x565e('0x1e')][_0x565e('0x1f')](this,_0x277a60));this[_0x565e('0x10')][_0x5a226b['id']]['on'](_0x565e('0x5'),this[_0x565e('0x20')]['bind'](this,_0x277a60));this[_0x565e('0x10')][_0x5a226b['id']]['on'](_0x565e('0x21'),this[_0x565e('0x22')][_0x565e('0x1f')](this,_0x277a60));this[_0x565e('0x10')][_0x5a226b['id']]['on'](_0x565e('0x23'),this[_0x565e('0x24')]['bind'](this,_0x277a60));}}else{if(_[_0x565e('0x1a')](this[_0x565e('0xf')][_0x277a60]['Imap'])){this[_0x565e('0xf')][_0x277a60][_0x565e('0x16')]={};}this['mailAccounts'][_0x277a60][_0x565e('0x16')][_0x565e('0x17')]=_0x565e('0x25');this['mailAccounts'][_0x277a60][_0x565e('0x16')]['messageStatus']='';this['emit'](_0x277a60);}}}};EmailChannel[_0x565e('0x11')][_0x565e('0x1e')]=function(_0xa84fc2,_0x75681d){if(this['mailAccounts'][_0xa84fc2]){this['mailAccounts'][_0xa84fc2][_0x565e('0x16')][_0x565e('0x17')]='connected';this['mailAccounts'][_0xa84fc2]['Imap'][_0x565e('0x18')]=_0x75681d[_0x565e('0x13')];if(_0x75681d[_0x565e('0x26')]){this[_0x565e('0xf')][_0xa84fc2][_0x565e('0x16')]['total']=_0x75681d[_0x565e('0x26')]['total'];}return this[_0x565e('0x12')](_0xa84fc2);}};EmailChannel['prototype'][_0x565e('0x20')]=function(_0x1021e0,_0x5760bb){logger[_0x565e('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5760bb[_0x565e('0x27')],_0x5760bb[_0x565e('0x28')],_0x5760bb[_0x565e('0x29')],_0x1021e0);if(this['mailAccounts'][_0x1021e0]){return mailAccount[_0x565e('0x2a')](_0x1021e0,_0x5760bb)['then'](function(_0x1910f8){if(_0x1910f8){logger[_0x565e('0xd')](_0x565e('0x2b'));}})[_0x565e('0x2c')](function(_0x239cea){logger[_0x565e('0x23')](_0x565e('0x2d'),JSON[_0x565e('0x2e')](_0x239cea));});}};EmailChannel[_0x565e('0x11')][_0x565e('0x22')]=function(_0x10e12a){if(this['mailAccounts'][_0x10e12a]&&this['mailAccounts'][_0x10e12a][_0x565e('0x16')]){if(this[_0x565e('0x10')][this[_0x565e('0xf')][_0x10e12a][_0x565e('0x16')]['id']]){delete this[_0x565e('0x10')][this['mailAccounts'][_0x10e12a][_0x565e('0x16')]['id']];}this[_0x565e('0xf')][_0x10e12a]['Imap']['lastSync']=moment();this[_0x565e('0x12')](_0x10e12a);}};EmailChannel[_0x565e('0x11')][_0x565e('0x24')]=function(_0x3b7a6a,_0x307c7e){if(this[_0x565e('0xf')][_0x3b7a6a]){this['mailAccounts'][_0x3b7a6a][_0x565e('0x16')]['status']=_0x565e('0x23');this[_0x565e('0xf')][_0x3b7a6a][_0x565e('0x16')]['messageStatus']=_0x307c7e;return this[_0x565e('0x12')](_0x3b7a6a);}};EmailChannel['prototype'][_0x565e('0x2f')]=function(_0x55b756,_0x10325){return this[_0x565e('0x30')][_0x565e('0x31')](_0x55b756,_0x10325);};EmailChannel[_0x565e('0x11')][_0x565e('0x32')]=function(_0x8f9f8d){var _0x9cafe9=this;if(this[_0x565e('0xf')][_0x8f9f8d['id']]){if(_[_0x565e('0x1a')](this[_0x565e('0xf')][_0x8f9f8d['id']][_0x565e('0x33')])){this[_0x565e('0xf')][_0x8f9f8d['id']][_0x565e('0x33')]={};}this[_0x565e('0xf')][_0x8f9f8d['id']][_0x565e('0x33')][_0x565e('0x34')]=moment();return new BPromise(function(_0x1622cd,_0x1059c3){return _0x9cafe9[_0x565e('0x30')][_0x565e('0x35')](_0x8f9f8d)[_0x565e('0x36')](function(_0x152172){_0x9cafe9['mailAccounts'][_0x8f9f8d['id']][_0x565e('0x33')][_0x565e('0x17')]=_0x565e('0x37');_0x9cafe9[_0x565e('0xf')][_0x8f9f8d['id']][_0x565e('0x33')][_0x565e('0x18')]='';_0x9cafe9[_0x565e('0x12')](_0x8f9f8d['id']);_0x1622cd(_0x152172);})[_0x565e('0x2c')](function(_0x14b1f0){_0x9cafe9[_0x565e('0xf')][_0x8f9f8d['id']]['Smtp']['status']=_0x565e('0x23');_0x9cafe9[_0x565e('0xf')][_0x8f9f8d['id']][_0x565e('0x33')][_0x565e('0x18')]=_0x14b1f0;_0x9cafe9[_0x565e('0x12')](_0x8f9f8d['id']);_0x1059c3(_0x14b1f0);});});}return this[_0x565e('0x30')][_0x565e('0x35')](_0x8f9f8d);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 283d050..157a9da 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 _0x9e68=['handleFetchMessage','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','lodash','randomstring','mailparser','simpleParser','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length'];(function(_0x4d390d,_0x2587e5){var _0x16ca5c=function(_0x274d71){while(--_0x274d71){_0x4d390d['push'](_0x4d390d['shift']());}};_0x16ca5c(++_0x2587e5);}(_0x9e68,0x16b));var _0x89e6=function(_0xa854e0,_0x542b6a){_0xa854e0=_0xa854e0-0x0;var _0x27eabb=_0x9e68[_0xa854e0];return _0x27eabb;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require('imap');var _=require(_0x89e6('0x0'));var rs=require(_0x89e6('0x1'));var simpleParser=require(_0x89e6('0x2'))[_0x89e6('0x3')];var Iconv=require('iconv')[_0x89e6('0x4')];var EventEmitter=require('events')[_0x89e6('0x5')];var utils=require(_0x89e6('0x6'));var logger=require(_0x89e6('0x7'))(_0x89e6('0x8'));function EmailImap(_0x3785f6,_0x2a2d4e){this[_0x89e6('0x9')]='INBOX';this[_0x89e6('0xa')]=this['getAccount'](_0x3785f6,_0x2a2d4e);this[_0x89e6('0xb')]=new Imap(this[_0x89e6('0xa')]);this[_0x89e6('0xb')][_0x89e6('0xc')](_0x89e6('0xd'),this[_0x89e6('0xe')][_0x89e6('0xf')](this));this[_0x89e6('0xb')]['once'](_0x89e6('0x10'),this['handleEnd']['bind'](this));this[_0x89e6('0xb')]['on'](_0x89e6('0x11'),this[_0x89e6('0x12')]['bind'](this));this[_0x89e6('0xb')][_0x89e6('0x13')]();}util[_0x89e6('0x14')](EmailImap,EventEmitter);EmailImap[_0x89e6('0x15')]['getAccount']=function(_0xc14aea,_0x495a9c){var _0x2ab3ea={'connTimeout':_0xc14aea[_0x89e6('0x16')]?_0xc14aea[_0x89e6('0x16')]*0x3e8:0x2710,'authTimeout':_0xc14aea[_0x89e6('0x17')]?_0xc14aea[_0x89e6('0x17')]*0x3e8:0x1388};if(_['isNil'](_0xc14aea[_0x89e6('0x18')])){if(_0xc14aea[_0x89e6('0x19')]){_0x2ab3ea[_0x89e6('0x1a')]=_0xc14aea[_0x89e6('0x1a')];_0x2ab3ea[_0x89e6('0x1b')]=_0xc14aea['password'];}_0x2ab3ea[_0x89e6('0x1c')]=_0xc14aea['host'];_0x2ab3ea[_0x89e6('0x1d')]=_0xc14aea[_0x89e6('0x1d')]||0x3e1;if(_0xc14aea['tls']){_0x2ab3ea[_0x89e6('0x1e')]=!![];}else{_0x2ab3ea['tls']=![];_0x2ab3ea[_0x89e6('0x1f')]=_0x89e6('0x20');}}else{_0x2ab3ea[_0x89e6('0x1a')]=_0xc14aea[_0x89e6('0x1a')];_0x2ab3ea[_0x89e6('0x1b')]=_0xc14aea[_0x89e6('0x1b')];_0x2ab3ea['host']=utils[_0x89e6('0x21')](_0xc14aea[_0x89e6('0x18')]);_0x2ab3ea[_0x89e6('0x1d')]=0x3e1;_0x2ab3ea[_0x89e6('0x1e')]=!![];}_0x2ab3ea['email']=_0x495a9c||_0xc14aea[_0x89e6('0x1a')]||_0x89e6('0x22');return _0x2ab3ea;};EmailImap[_0x89e6('0x15')][_0x89e6('0xe')]=function(){this['imap'][_0x89e6('0x23')](this[_0x89e6('0x9')],![],this[_0x89e6('0x24')]['bind'](this));};EmailImap[_0x89e6('0x15')][_0x89e6('0x24')]=function(_0x587ed5,_0x2ceffd){if(_0x587ed5){this[_0x89e6('0x12')](_0x587ed5,!![]);}else{this[_0x89e6('0x25')]('box',_0x2ceffd);this[_0x89e6('0x26')]();}};EmailImap['prototype'][_0x89e6('0x27')]=function(_0x319320){if(_0x319320){this[_0x89e6('0x12')](_0x319320,!![]);}else{this[_0x89e6('0xb')]['end']();}};EmailImap[_0x89e6('0x15')][_0x89e6('0x26')]=function(){this[_0x89e6('0xb')]['search']([_0x89e6('0x28')],this[_0x89e6('0x29')][_0x89e6('0xf')](this));};EmailImap[_0x89e6('0x15')][_0x89e6('0x29')]=function(_0xeba841,_0x526f35){if(_0xeba841){this[_0x89e6('0x12')](_0xeba841,!![]);}else{if(_0x526f35[_0x89e6('0x2a')]){try{var _0x1b56f1=this[_0x89e6('0xb')]['fetch'](_0x526f35,{'bodies':'','markSeen':!![]});_0x1b56f1['on']('message',this[_0x89e6('0x2b')][_0x89e6('0xf')](this));_0x1b56f1[_0x89e6('0xc')](_0x89e6('0x11'),this['handleFetchError'][_0x89e6('0xf')](this));_0x1b56f1[_0x89e6('0xc')](_0x89e6('0x10'),this[_0x89e6('0x2c')][_0x89e6('0xf')](this));}catch(_0x1f1a8d){logger[_0x89e6('0x11')](_0x1f1a8d);}}else{this['imap'][_0x89e6('0x2d')](!![],this['handleCloseBox'][_0x89e6('0xf')](this));}}};EmailImap[_0x89e6('0x15')][_0x89e6('0x2b')]=function(_0x3b8f72,_0x5c0ca4){_0x3b8f72['on']('body',this[_0x89e6('0x2e')][_0x89e6('0xf')](this));_0x3b8f72['once'](_0x89e6('0x2f'),this[_0x89e6('0x30')]['bind'](this));_0x3b8f72[_0x89e6('0xc')](_0x89e6('0x10'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x2ac1c5,_0x541e45){simpleParser(_0x2ac1c5,{'Iconv':Iconv},this[_0x89e6('0x31')][_0x89e6('0xf')](this));};EmailImap[_0x89e6('0x15')][_0x89e6('0x30')]=function(_0x3aaa13){};EmailImap[_0x89e6('0x15')][_0x89e6('0x32')]=function(){};EmailImap[_0x89e6('0x15')]['handleSimpleParser']=function(_0x3618d1,_0x528af4){if(_0x3618d1){logger[_0x89e6('0x11')](_0x3618d1);}else{var _0x27d96d=this;utils[_0x89e6('0x33')](this[_0x89e6('0xa')],_0x528af4,function(_0x44e82b){_0x27d96d[_0x89e6('0x25')](_0x89e6('0x8'),_0x44e82b);});}};EmailImap[_0x89e6('0x15')][_0x89e6('0x2c')]=function(){this[_0x89e6('0xb')][_0x89e6('0x2d')](!![],this['handleCloseBox'][_0x89e6('0xf')](this));};EmailImap[_0x89e6('0x15')][_0x89e6('0x34')]=function(_0x5a29be){this[_0x89e6('0x12')](_0x5a29be);this[_0x89e6('0xb')][_0x89e6('0x2d')](!![],this[_0x89e6('0x27')][_0x89e6('0xf')](this));};EmailImap[_0x89e6('0x15')][_0x89e6('0x35')]=function(){this[_0x89e6('0x25')](_0x89e6('0x10'));};EmailImap[_0x89e6('0x15')][_0x89e6('0x12')]=function(_0x39f01c,_0x3aab92){logger[_0x89e6('0x11')]('handleError',this[_0x89e6('0xa')][_0x89e6('0x8')],JSON[_0x89e6('0x36')](_0x39f01c));var _0x44ba39='';if(_0x39f01c){if(_0x39f01c[_0x89e6('0x37')]){_0x44ba39=_0x39f01c[_0x89e6('0x37')];}else{for(var _0x196a85 in _0x39f01c){if(_0x39f01c[_0x89e6('0x38')](_0x196a85)){_0x44ba39+=_[_0x89e6('0x39')](_0x196a85)+':\x20'+_0x39f01c[_0x196a85]+'\x0a';}}}}if(_0x3aab92){this[_0x89e6('0xb')][_0x89e6('0x10')]();}else{this['emit'](_0x89e6('0x11'),_0x44ba39);this[_0x89e6('0x25')](_0x89e6('0x10'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xae2c=['getHost','service','port','handleOpenBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','emit','handleEnd','stringify','textCode','upperFirst','path','imap','lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','end','error','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','tls','autotls','required'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xae2c,0x94));var _0xcae2=function(_0x46c15d,_0x4af413){_0x46c15d=_0x46c15d-0x0;var _0x3c6c14=_0xae2c[_0x46c15d];return _0x3c6c14;};'use strict';var fs=require('fs');var path=require(_0xcae2('0x0'));var util=require('util');var Imap=require(_0xcae2('0x1'));var _=require(_0xcae2('0x2'));var rs=require('randomstring');var simpleParser=require(_0xcae2('0x3'))['simpleParser'];var Iconv=require(_0xcae2('0x4'))[_0xcae2('0x5')];var EventEmitter=require(_0xcae2('0x6'))[_0xcae2('0x7')];var utils=require(_0xcae2('0x8'));var logger=require(_0xcae2('0x9'))(_0xcae2('0xa'));function EmailImap(_0x296c30,_0x33bce5){this[_0xcae2('0xb')]=_0xcae2('0xc');this[_0xcae2('0xd')]=this[_0xcae2('0xe')](_0x296c30,_0x33bce5);this['imap']=new Imap(this[_0xcae2('0xd')]);this[_0xcae2('0x1')][_0xcae2('0xf')](_0xcae2('0x10'),this[_0xcae2('0x11')]['bind'](this));this['imap'][_0xcae2('0xf')](_0xcae2('0x12'),this['handleEnd']['bind'](this));this[_0xcae2('0x1')]['on'](_0xcae2('0x13'),this[_0xcae2('0x14')][_0xcae2('0x15')](this));this['imap'][_0xcae2('0x16')]();}util[_0xcae2('0x17')](EmailImap,EventEmitter);EmailImap[_0xcae2('0x18')][_0xcae2('0xe')]=function(_0x293ce0,_0xc46017){var _0x213633={'connTimeout':_0x293ce0[_0xcae2('0x19')]?_0x293ce0['connTimeout']*0x3e8:0x2710,'authTimeout':_0x293ce0[_0xcae2('0x1a')]?_0x293ce0[_0xcae2('0x1a')]*0x3e8:0x1388};if(_[_0xcae2('0x1b')](_0x293ce0['service'])){if(_0x293ce0[_0xcae2('0x1c')]){_0x213633[_0xcae2('0x1d')]=_0x293ce0[_0xcae2('0x1d')];_0x213633['password']=_0x293ce0[_0xcae2('0x1e')];}_0x213633[_0xcae2('0x1f')]=_0x293ce0[_0xcae2('0x1f')];_0x213633['port']=_0x293ce0['port']||0x3e1;if(_0x293ce0[_0xcae2('0x20')]){_0x213633[_0xcae2('0x20')]=!![];}else{_0x213633[_0xcae2('0x20')]=![];_0x213633[_0xcae2('0x21')]=_0xcae2('0x22');}}else{_0x213633['user']=_0x293ce0[_0xcae2('0x1d')];_0x213633[_0xcae2('0x1e')]=_0x293ce0[_0xcae2('0x1e')];_0x213633[_0xcae2('0x1f')]=utils[_0xcae2('0x23')](_0x293ce0[_0xcae2('0x24')]);_0x213633[_0xcae2('0x25')]=0x3e1;_0x213633[_0xcae2('0x20')]=!![];}_0x213633['email']=_0xc46017||_0x293ce0[_0xcae2('0x1d')]||'anonymous@xcally.com';return _0x213633;};EmailImap[_0xcae2('0x18')]['handleReady']=function(){this[_0xcae2('0x1')]['openBox'](this[_0xcae2('0xb')],![],this['handleOpenBox'][_0xcae2('0x15')](this));};EmailImap[_0xcae2('0x18')][_0xcae2('0x26')]=function(_0x4a827f,_0x12c614){if(_0x4a827f){this[_0xcae2('0x14')](_0x4a827f,!![]);}else{this['emit'](_0xcae2('0x27'),_0x12c614);this[_0xcae2('0x28')]();}};EmailImap[_0xcae2('0x18')][_0xcae2('0x29')]=function(_0x3dbe51){if(_0x3dbe51){this[_0xcae2('0x14')](_0x3dbe51,!![]);}else{this[_0xcae2('0x1')][_0xcae2('0x12')]();}};EmailImap[_0xcae2('0x18')][_0xcae2('0x28')]=function(){this[_0xcae2('0x1')]['search']([_0xcae2('0x2a')],this[_0xcae2('0x2b')]['bind'](this));};EmailImap[_0xcae2('0x18')][_0xcae2('0x2b')]=function(_0x22e2fb,_0x1aad15){if(_0x22e2fb){this[_0xcae2('0x14')](_0x22e2fb,!![]);}else{if(_0x1aad15[_0xcae2('0x2c')]){try{var _0x290aad=this[_0xcae2('0x1')][_0xcae2('0x2d')](_0x1aad15,{'bodies':'','markSeen':!![]});_0x290aad['on'](_0xcae2('0x2e'),this[_0xcae2('0x2f')][_0xcae2('0x15')](this));_0x290aad[_0xcae2('0xf')](_0xcae2('0x13'),this[_0xcae2('0x30')][_0xcae2('0x15')](this));_0x290aad[_0xcae2('0xf')]('end',this[_0xcae2('0x31')][_0xcae2('0x15')](this));}catch(_0x5365ed){logger[_0xcae2('0x13')](_0x5365ed);}}else{this[_0xcae2('0x1')][_0xcae2('0x32')](!![],this[_0xcae2('0x29')][_0xcae2('0x15')](this));}}};EmailImap[_0xcae2('0x18')]['handleFetchMessage']=function(_0x3ce91e,_0x900498){_0x3ce91e['on'](_0xcae2('0x33'),this['handleMessageBody']['bind'](this));_0x3ce91e[_0xcae2('0xf')](_0xcae2('0x34'),this['handleMessageAttributes'][_0xcae2('0x15')](this));_0x3ce91e[_0xcae2('0xf')]('end',this['handleMessageEnd'][_0xcae2('0x15')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x41c5b8,_0x407485){simpleParser(_0x41c5b8,{'Iconv':Iconv},this[_0xcae2('0x35')][_0xcae2('0x15')](this));};EmailImap['prototype'][_0xcae2('0x36')]=function(_0xe134ac){};EmailImap['prototype'][_0xcae2('0x37')]=function(){};EmailImap[_0xcae2('0x18')]['handleSimpleParser']=function(_0x1b06dd,_0x20ab63){if(_0x1b06dd){logger[_0xcae2('0x13')](_0x1b06dd);}else{var _0xe30c7c=this;utils['parser'](this[_0xcae2('0xd')],_0x20ab63,function(_0x48fe99){_0xe30c7c[_0xcae2('0x38')](_0xcae2('0xa'),_0x48fe99);});}};EmailImap[_0xcae2('0x18')][_0xcae2('0x31')]=function(){this['imap'][_0xcae2('0x32')](!![],this[_0xcae2('0x29')][_0xcae2('0x15')](this));};EmailImap[_0xcae2('0x18')][_0xcae2('0x30')]=function(_0xfd23c9){this['handleError'](_0xfd23c9);this[_0xcae2('0x1')][_0xcae2('0x32')](!![],this[_0xcae2('0x29')][_0xcae2('0x15')](this));};EmailImap[_0xcae2('0x18')][_0xcae2('0x39')]=function(){this[_0xcae2('0x38')]('end');};EmailImap['prototype']['handleError']=function(_0x44ca7a,_0x2c8a06){logger['error']('handleError',this[_0xcae2('0xd')][_0xcae2('0xa')],JSON[_0xcae2('0x3a')](_0x44ca7a));var _0x14f19c='';if(_0x44ca7a){if(_0x44ca7a['textCode']){_0x14f19c=_0x44ca7a[_0xcae2('0x3b')];}else{for(var _0x227512 in _0x44ca7a){if(_0x44ca7a['hasOwnProperty'](_0x227512)){_0x14f19c+=_[_0xcae2('0x3c')](_0x227512)+':\x20'+_0x44ca7a[_0x227512]+'\x0a';}}}}if(_0x2c8a06){this['imap'][_0xcae2('0x12')]();}else{this[_0xcae2('0x38')]('error',_0x14f19c);this['emit'](_0xcae2('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index acd996b..96ef193 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 _0x93d6=['createTransport','use','sendMail','verify','toString','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x4a3948,_0x2e13a9){var _0x54c0a4=function(_0x7c577f){while(--_0x7c577f){_0x4a3948['push'](_0x4a3948['shift']());}};_0x54c0a4(++_0x2e13a9);}(_0x93d6,0xb6));var _0x693d=function(_0xfa80f4,_0x927ed6){_0xfa80f4=_0xfa80f4-0x0;var _0x5f5766=_0x93d6[_0xfa80f4];return _0x5f5766;};'use strict';var nodemailer=require(_0x693d('0x0'));var BPromise=require(_0x693d('0x1'));var inlineBase64=require(_0x693d('0x2'));function EmailSmtp(){}EmailSmtp[_0x693d('0x3')][_0x693d('0x4')]=function(_0x2f12b5,_0x266b16){return new BPromise(function(_0x3667e7,_0x6fe46d){var _0xd1cb25=nodemailer[_0x693d('0x5')](_0x2f12b5);_0xd1cb25[_0x693d('0x6')]('compile',inlineBase64());_0xd1cb25[_0x693d('0x7')](_0x266b16,function(_0x5636b5,_0x5845c2){if(_0x5636b5){_0x6fe46d(_0x5636b5['toString']());}else{_0x3667e7(_0x5845c2);}});});};EmailSmtp['prototype']['verify']=function(_0x49bd3e){return new BPromise(function(_0x1247dc,_0x4537df){var _0x38a2e1=nodemailer[_0x693d('0x5')](_0x49bd3e);_0x38a2e1[_0x693d('0x8')](function(_0x55ce43,_0x261ce0){if(_0x55ce43){_0x4537df(_0x55ce43[_0x693d('0x9')]());}else{if(_0x261ce0){_0x1247dc(_0x261ce0);}else{_0x4537df('Not\x20verifired');}}});});};module[_0x693d('0xa')]=EmailSmtp; \ No newline at end of file +var _0x69f1=['send','createTransport','use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','prototype'];(function(_0x2ad357,_0x4243fb){var _0x7bdb81=function(_0x7bfa49){while(--_0x7bfa49){_0x2ad357['push'](_0x2ad357['shift']());}};_0x7bdb81(++_0x4243fb);}(_0x69f1,0xda));var _0x169f=function(_0x3d5f94,_0x1cbe3b){_0x3d5f94=_0x3d5f94-0x0;var _0x3b47a3=_0x69f1[_0x3d5f94];return _0x3b47a3;};'use strict';var nodemailer=require(_0x169f('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x169f('0x1')][_0x169f('0x2')]=function(_0x49a3d1,_0x4da21f){return new BPromise(function(_0x52be73,_0x4e159b){var _0x369d5a=nodemailer[_0x169f('0x3')](_0x49a3d1);_0x369d5a[_0x169f('0x4')]('compile',inlineBase64());_0x369d5a[_0x169f('0x5')](_0x4da21f,function(_0x3b75d1,_0x368918){if(_0x3b75d1){_0x4e159b(_0x3b75d1[_0x169f('0x6')]());}else{_0x52be73(_0x368918);}});});};EmailSmtp[_0x169f('0x1')][_0x169f('0x7')]=function(_0x399c7f){return new BPromise(function(_0xb8b070,_0x101a29){var _0x39b51c=nodemailer[_0x169f('0x3')](_0x399c7f);_0x39b51c['verify'](function(_0x196999,_0x1cf955){if(_0x196999){_0x101a29(_0x196999[_0x169f('0x6')]());}else{if(_0x1cf955){_0xb8b070(_0x1cf955);}else{_0x101a29(_0x169f('0x8'));}}});});};module[_0x169f('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 49396e8..2f531d5 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 _0x79d7=['Data','getHost','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','head','address','generate','@xcally.com','name','substring','indexOf','split','length','join','Anonymous','value','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x568423['slice'](0x0,-0x1)[_0x779d('0x10')]('\x20'):_0x5213d7[_0x779d('0xb')];}return _0x779d('0x11');}function getLastName(_0x409ab5){var _0x279153=_[_0x779d('0x7')](_0x409ab5['value']);if(_0x279153&&_0x279153[_0x779d('0xb')]){var _0x1028c6=_0x279153[_0x779d('0xb')][_0x779d('0xe')](/\s+/);return _0x1028c6[_0x779d('0xf')]>0x1?_0x1028c6['pop']():'';}return'';}function getMails(_0x26dfa2,_0x1e5744){var _0x3755c6='';for(var _0x4cc248=0x0;_0x4cc248<_0x1e5744[_0x779d('0x12')][_0x779d('0xf')];_0x4cc248+=0x1){if(_0x1e5744[_0x779d('0x12')][_0x4cc248][_0x779d('0x8')]!==_0x26dfa2){if(!_[_0x779d('0x13')](_0x3755c6)){_0x3755c6+=',';}_0x3755c6+=_0x1e5744[_0x779d('0x12')][_0x4cc248][_0x779d('0xb')]||_0x1e5744[_0x779d('0x12')][_0x4cc248][_0x779d('0x8')]||'';_0x3755c6+='\x20<';_0x3755c6+=_0x1e5744[_0x779d('0x12')][_0x4cc248][_0x779d('0x8')]?_0x1e5744[_0x779d('0x12')][_0x4cc248][_0x779d('0x8')]:'anonymous'+random[_0x779d('0x9')](0x6)+'@xcally.com';_0x3755c6+='>';}}return _0x3755c6;}function parseEmail(_0x2e81b9,_0x4d0f40,_0x75103){if(_0x4d0f40[_0x779d('0x14')]){var _0xffa3e=/)<[^<]*)*<\/script>/gi;while(_0xffa3e[_0x779d('0x15')](_0x4d0f40['html'])){_0x4d0f40[_0x779d('0x14')]=_0x4d0f40[_0x779d('0x14')][_0x779d('0x16')](_0xffa3e,'');}if(_0x4d0f40[_0x779d('0x14')][_0x779d('0x17')](_0x779d('0x18'))){var _0x2fca0a=[];_0x4d0f40[_0x779d('0x19')][_0x779d('0x1a')](_0x347af8=>{_0x2fca0a['push'](_0x347af8[_0x779d('0x1b')]);});var _0x58e397=/]+>/g;var _0x5d7ab5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3d5b8d=_0x4d0f40[_0x779d('0x14')]['replace'](_0x5d7ab5,_0x779d('0x1c'));var _0x842638=_0x3d5b8d[_0x779d('0x16')](_0x58e397,'_IMG');for(let _0x581a4e=0x0;_0x581a4e<_0x2fca0a[_0x779d('0xf')];_0x581a4e++){var _0x3e825a=_0x842638[_0x779d('0x16')](_0x779d('0x1d'),_0x779d('0x1e')+_0x2fca0a[_0x581a4e]+'\x20]');_0x842638=_0x3e825a;}_0x4d0f40[_0x779d('0x14')]=_0x842638;}_0x75103[_0x779d('0x1f')]=_0x4d0f40[_0x779d('0x14')];}else{_0x75103[_0x779d('0x1f')]=_0x4d0f40[_0x779d('0x20')];}if(_0x75103[_0x779d('0x1f')]){_0x75103[_0x779d('0x1f')]=_0x75103[_0x779d('0x1f')][_0x779d('0x16')](/0x0){var _0x42e580=['Auto-Submitted:\x20auto-replied',_0x779d('0x31'),_0x779d('0x32')];for(var _0x1c3fd0=0x0;_0x1c3fd0<_0x4d0f40[_0x779d('0x30')][_0x779d('0xf')];_0x1c3fd0++){var _0x38813f=_[_0x779d('0xd')](_0x42e580,_0x4d0f40['headerLines'][_0x1c3fd0][_0x779d('0x33')]);if(_0x38813f>=0x0){_0x75103['isAutoreply']=!![];}}}return _0x75103;}exports[_0x779d('0x34')]=function(_0xa9c221,_0x1aea19,_0x5ec808){var _0x50c33b={'from':getAddress(_0x1aea19[_0x779d('0x35')]),'firstName':getFirstName(_0x1aea19['from']),'lastName':getLastName(_0x1aea19['from']),'mapKey':_0x779d('0x6'),'message':{'from':getMails(_0xa9c221['email'],_0x1aea19[_0x779d('0x35')]),'to':_0xa9c221['email'],'cc':'','subject':_0x1aea19[_0x779d('0x36')]||'','messageId':_0x1aea19['messageId'],'inReplyTo':_0x1aea19[_0x779d('0x37')],'sentAt':moment(_0x1aea19[_0x779d('0x38')])[_0x779d('0x39')](_0x779d('0x3a')),'attach':![],'attachments':[]}};if(!_0x1aea19[_0x779d('0x14')]&&!_0x1aea19[_0x779d('0x20')]){var _0x40a57c=_[_0x779d('0x3b')](_0x1aea19[_0x779d('0x19')],{'contentType':_0x779d('0x3c')});if(_0x40a57c[_0x779d('0xf')]){logger['info'](util[_0x779d('0x39')](_0x779d('0x3d'),_0x1aea19['messageId']));tnef['parseBuffer'](_[_0x779d('0x3e')](_0x40a57c)[_0x779d('0x2d')],function(_0x482251,_0x26d4a4){if(_0x26d4a4){_0x1aea19[_0x779d('0x14')]=_0x26d4a4[_0x779d('0x3f')]||'

Empty\x20message

';if(_0x26d4a4[_0x779d('0x40')]){for(var _0x22942b=0x0;_0x22942b<_0x26d4a4[_0x779d('0x40')][_0x779d('0xf')];_0x22942b++){var _0x259a08=_0x26d4a4[_0x779d('0x40')][_0x22942b];_0x50c33b[_0x779d('0x23')][_0x779d('0x19')][_0x779d('0x2e')]({'filename':_0x259a08[_0x779d('0x41')],'content':Buffer[_0x779d('0x35')](_0x259a08[_0x779d('0x42')])});}}}_0x5ec808(parseEmail(_0xa9c221,_0x1aea19,_0x50c33b));});}else{_0x1aea19['html']='

Empty\x20message

';_0x5ec808(parseEmail(_0xa9c221,_0x1aea19,_0x50c33b));}}else{_0x5ec808(parseEmail(_0xa9c221,_0x1aea19,_0x50c33b));}};exports[_0x779d('0x43')]=function(_0x4382e4){switch(_0x4382e4){case'gmail':return'imap.gmail.com';case _0x779d('0x44'):return _0x779d('0x45');case _0x779d('0x46'):return _0x779d('0x47');case _0x779d('0x48'):return'outlook.office365.com';}return _0x779d('0x49');}; \ No newline at end of file +var _0xaa56=['originTo','isEmpty','originCc','bcc','attachments','attach','type','attachment','attachment-','format','%s-%s','root','server/files/attachments/','content','push','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','@xcally.com','value','name','substring','indexOf','split','length','slice','join','pop','anonymous','html','test','replace','includes','','body','0x1?_0x22280f[_0x6aa5('0x11')](0x0,-0x1)[_0x6aa5('0x12')]('\x20'):_0x1d1f37['name'];}return'Anonymous';}function getLastName(_0x4fd441){var _0x2be804=_[_0x6aa5('0x7')](_0x4fd441[_0x6aa5('0xb')]);if(_0x2be804&&_0x2be804['name']){var _0x140bd0=_0x2be804[_0x6aa5('0xc')]['split'](/\s+/);return _0x140bd0[_0x6aa5('0x10')]>0x1?_0x140bd0[_0x6aa5('0x13')]():'';}return'';}function getMails(_0x223e7e,_0xff6da7){var _0x5ca1f3='';for(var _0x5e5951=0x0;_0x5e5951<_0xff6da7[_0x6aa5('0xb')]['length'];_0x5e5951+=0x1){if(_0xff6da7[_0x6aa5('0xb')][_0x5e5951][_0x6aa5('0x8')]!==_0x223e7e){if(!_['isEmpty'](_0x5ca1f3)){_0x5ca1f3+=',';}_0x5ca1f3+=_0xff6da7['value'][_0x5e5951][_0x6aa5('0xc')]||_0xff6da7[_0x6aa5('0xb')][_0x5e5951][_0x6aa5('0x8')]||'';_0x5ca1f3+='\x20<';_0x5ca1f3+=_0xff6da7['value'][_0x5e5951][_0x6aa5('0x8')]?_0xff6da7['value'][_0x5e5951][_0x6aa5('0x8')]:_0x6aa5('0x14')+random[_0x6aa5('0x9')](0x6)+_0x6aa5('0xa');_0x5ca1f3+='>';}}return _0x5ca1f3;}function parseEmail(_0x4c30ae,_0x2faeb8,_0x32b070){if(_0x2faeb8[_0x6aa5('0x15')]){var _0x3aeaed=/)<[^<]*)*<\/script>/gi;while(_0x3aeaed[_0x6aa5('0x16')](_0x2faeb8['html'])){_0x2faeb8[_0x6aa5('0x15')]=_0x2faeb8['html'][_0x6aa5('0x17')](_0x3aeaed,'');}if(_0x2faeb8['html'][_0x6aa5('0x18')](_0x6aa5('0x19'))){var _0x4c13f9=[];_0x2faeb8['attachments'][_0x6aa5('0x1a')](_0x4631f7=>{_0x4c13f9['push'](_0x4631f7[_0x6aa5('0x1b')]);});var _0xfdc370=/]+>/g;var _0x3be2ac=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4c39b2=_0x2faeb8[_0x6aa5('0x15')][_0x6aa5('0x17')](_0x3be2ac,'_SRC');var _0x40c595=_0x4c39b2['replace'](_0xfdc370,'_IMG');for(let _0x3d4fd9=0x0;_0x3d4fd9<_0x4c13f9[_0x6aa5('0x10')];_0x3d4fd9++){var _0x122e92=_0x40c595['replace'](_0x6aa5('0x1c'),'\x20[Attachment:\x20'+_0x4c13f9[_0x3d4fd9]+_0x6aa5('0x1d'));_0x40c595=_0x122e92;}_0x2faeb8['html']=_0x40c595;}_0x32b070['body']=_0x2faeb8[_0x6aa5('0x15')];}else{_0x32b070[_0x6aa5('0x1e')]=_0x2faeb8['textAsHtml'];}if(_0x32b070[_0x6aa5('0x1e')]){_0x32b070[_0x6aa5('0x1e')]=_0x32b070[_0x6aa5('0x1e')][_0x6aa5('0x17')](/0x0){var _0x150339=[_0x6aa5('0x31'),_0x6aa5('0x32'),_0x6aa5('0x33')];for(var _0x2a4fb1=0x0;_0x2a4fb1<_0x2faeb8['headerLines'][_0x6aa5('0x10')];_0x2a4fb1++){var _0x25596b=_['indexOf'](_0x150339,_0x2faeb8[_0x6aa5('0x30')][_0x2a4fb1][_0x6aa5('0x34')]);if(_0x25596b>=0x0){_0x32b070['isAutoreply']=!![];}}}return _0x32b070;}exports[_0x6aa5('0x35')]=function(_0xac783a,_0x1fd652,_0x2e3a5e){var _0x420898={'from':getAddress(_0x1fd652[_0x6aa5('0x36')]),'firstName':getFirstName(_0x1fd652[_0x6aa5('0x36')]),'lastName':getLastName(_0x1fd652[_0x6aa5('0x36')]),'mapKey':_0x6aa5('0x5'),'message':{'from':getMails(_0xac783a['email'],_0x1fd652[_0x6aa5('0x36')]),'to':_0xac783a['email'],'cc':'','subject':_0x1fd652[_0x6aa5('0x37')]||'','messageId':_0x1fd652[_0x6aa5('0x38')],'inReplyTo':_0x1fd652['inReplyTo'],'sentAt':moment(_0x1fd652[_0x6aa5('0x39')])['format'](_0x6aa5('0x3a')),'attach':![],'attachments':[]}};if(!_0x1fd652[_0x6aa5('0x15')]&&!_0x1fd652[_0x6aa5('0x3b')]){var _0xc67b6f=_[_0x6aa5('0x3c')](_0x1fd652[_0x6aa5('0x25')],{'contentType':_0x6aa5('0x3d')});if(_0xc67b6f[_0x6aa5('0x10')]){logger[_0x6aa5('0x3e')](util[_0x6aa5('0x2a')](_0x6aa5('0x3f'),_0x1fd652['messageId']));tnef[_0x6aa5('0x40')](_[_0x6aa5('0x41')](_0xc67b6f)[_0x6aa5('0x2e')],function(_0x7b2f2,_0x330790){if(_0x330790){_0x1fd652[_0x6aa5('0x15')]=_0x330790[_0x6aa5('0x42')]||_0x6aa5('0x43');if(_0x330790[_0x6aa5('0x44')]){for(var _0xb8766=0x0;_0xb8766<_0x330790[_0x6aa5('0x44')][_0x6aa5('0x10')];_0xb8766++){var _0x41d594=_0x330790[_0x6aa5('0x44')][_0xb8766];_0x420898['message']['attachments'][_0x6aa5('0x2f')]({'filename':_0x41d594[_0x6aa5('0x45')],'content':Buffer[_0x6aa5('0x36')](_0x41d594[_0x6aa5('0x46')])});}}}_0x2e3a5e(parseEmail(_0xac783a,_0x1fd652,_0x420898));});}else{_0x1fd652[_0x6aa5('0x15')]=_0x6aa5('0x43');_0x2e3a5e(parseEmail(_0xac783a,_0x1fd652,_0x420898));}}else{_0x2e3a5e(parseEmail(_0xac783a,_0x1fd652,_0x420898));}};exports['getHost']=function(_0x93632b){switch(_0x93632b){case'gmail':return _0x6aa5('0x47');case _0x6aa5('0x48'):return'imap.mail.yahoo.com';case _0x6aa5('0x49'):return _0x6aa5('0x4a');case _0x6aa5('0x4b'):return _0x6aa5('0x4c');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e6a8c38..745ee5d 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 _0xfbae=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x3cc8b9,_0x5c95f9){var _0x44d63f=function(_0x4d1f32){while(--_0x4d1f32){_0x3cc8b9['push'](_0x3cc8b9['shift']());}};_0x44d63f(++_0x5c95f9);}(_0xfbae,0xcd));var _0xefba=function(_0x516ca2,_0x2a7336){_0x516ca2=_0x516ca2-0x0;var _0x4fedcd=_0xfbae[_0x516ca2];return _0x4fedcd;};'use strict';var _=require(_0xefba('0x0'));function MailAccount(_0x22672f){this['id']=_0x22672f['id']||0x0;this[_0xefba('0x1')]=_0x22672f['name']||_0xefba('0x2');this[_0xefba('0x3')]=_0x22672f[_0xefba('0x3')]||_0xefba('0x4');this[_0xefba('0x5')]=_0x22672f[_0xefba('0x5')]||![];this[_0xefba('0x6')]=_0x22672f[_0xefba('0x6')]||[];this['Smtp']=_0x22672f[_0xefba('0x7')]||[];}module[_0xefba('0x8')]=MailAccount; \ No newline at end of file +var _0x9c91=['lodash','name','key','SERV','active','Smtp','exports'];(function(_0x46f5ca,_0xecad5){var _0x57b513=function(_0x1ae6f1){while(--_0x1ae6f1){_0x46f5ca['push'](_0x46f5ca['shift']());}};_0x57b513(++_0xecad5);}(_0x9c91,0xf5));var _0x19c9=function(_0x363ae5,_0x16321a){_0x363ae5=_0x363ae5-0x0;var _0x3a204c=_0x9c91[_0x363ae5];return _0x3a204c;};'use strict';var _=require(_0x19c9('0x0'));function MailAccount(_0x5c8158){this['id']=_0x5c8158['id']||0x0;this[_0x19c9('0x1')]=_0x5c8158[_0x19c9('0x1')]||'Service';this[_0x19c9('0x2')]=_0x5c8158[_0x19c9('0x2')]||_0x19c9('0x3');this[_0x19c9('0x4')]=_0x5c8158[_0x19c9('0x4')]||![];this['Imap']=_0x5c8158['Imap']||[];this[_0x19c9('0x5')]=_0x5c8158[_0x19c9('0x5')]||[];}module[_0x19c9('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d37bdbb..aba06ef 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 _0xa54e=['merge','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length','isUndefined'];(function(_0x2e92b3,_0x2729d0){var _0x6f4a13=function(_0x3631e6){while(--_0x3631e6){_0x2e92b3['push'](_0x2e92b3['shift']());}};_0x6f4a13(++_0x2729d0);}(_0xa54e,0x173));var _0xea54=function(_0x3b5e02,_0x535469){_0x3b5e02=_0x3b5e02-0x0;var _0x59464c=_0xa54e[_0x3b5e02];return _0x59464c;};'use strict';var _=require(_0xea54('0x0'));var MailAccount=require(_0xea54('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x779fdf,_0x178f7d,_0x5d1f71){var _0x3e6eb5=_[_0xea54('0x2')](_0x779fdf,function(_0x3d3652,_0x10019c){return _0x3d3652[_0x5d1f71];});for(var _0x5da234 in _0x178f7d){if(_0x178f7d[_0xea54('0x3')](_0x5da234)){if(!_0x3e6eb5[_0x5da234]){delete _0x178f7d[_0x5da234];}}}}Realtime[_0xea54('0x4')]['mergeFromDatabase']=function(_0x506c0a,_0x1f4710){for(var _0x44d6a1 in _0x1f4710){if(_0x506c0a['hasOwnProperty'](_0x44d6a1)){_0x506c0a[_0x44d6a1]=_0x1f4710[_0x44d6a1];}}};Realtime[_0xea54('0x4')][_0xea54('0x5')]=function(){var _0x399ca9=this;return function(_0x343f5e){if(_0x343f5e){freeIsNotKey(_0x343f5e,_0x399ca9[_0xea54('0x6')],'id');for(var _0x3466c6=0x0,_0x26fd28={},_0x10fd82={};_0x3466c6<_0x343f5e[_0xea54('0x7')];_0x3466c6+=0x1){_0x26fd28=_0x343f5e[_0x3466c6];if(_[_0xea54('0x8')](_0x399ca9[_0xea54('0x6')][_0x26fd28['id']])){_0x399ca9[_0xea54('0x6')][_0x26fd28['id']]=new MailAccount(_0x26fd28);}else{_[_0xea54('0x9')](_0x399ca9[_0xea54('0x6')][_0x26fd28['id']],_0x26fd28);}}}return _0x399ca9[_0xea54('0x6')];};};module['exports']=Realtime; \ No newline at end of file +var _0xfb6a=['lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','exports'];(function(_0x3ff321,_0x2c66d9){var _0x4b78aa=function(_0x40c09e){while(--_0x40c09e){_0x3ff321['push'](_0x3ff321['shift']());}};_0x4b78aa(++_0x2c66d9);}(_0xfb6a,0xd8));var _0xafb6=function(_0x208cf0,_0x486665){_0x208cf0=_0x208cf0-0x0;var _0x372d0d=_0xfb6a[_0x208cf0];return _0x372d0d;};'use strict';var _=require(_0xafb6('0x0'));var MailAccount=require(_0xafb6('0x1'));var Realtime=function(){this[_0xafb6('0x2')]={};};function freeIsNotKey(_0x2c1c25,_0x3f01bb,_0x362782){var _0x143421=_['mapKeys'](_0x2c1c25,function(_0xa04073,_0x163bd1){return _0xa04073[_0x362782];});for(var _0x108066 in _0x3f01bb){if(_0x3f01bb[_0xafb6('0x3')](_0x108066)){if(!_0x143421[_0x108066]){delete _0x3f01bb[_0x108066];}}}}Realtime[_0xafb6('0x4')][_0xafb6('0x5')]=function(_0x18a324,_0x25e332){for(var _0x4d0f73 in _0x25e332){if(_0x18a324[_0xafb6('0x3')](_0x4d0f73)){_0x18a324[_0x4d0f73]=_0x25e332[_0x4d0f73];}}};Realtime[_0xafb6('0x4')][_0xafb6('0x6')]=function(){var _0x13dcb2=this;return function(_0xb5926a){if(_0xb5926a){freeIsNotKey(_0xb5926a,_0x13dcb2['mailAccounts'],'id');for(var _0x469406=0x0,_0x4b0d20={},_0x454262={};_0x469406<_0xb5926a[_0xafb6('0x7')];_0x469406+=0x1){_0x4b0d20=_0xb5926a[_0x469406];if(_['isUndefined'](_0x13dcb2[_0xafb6('0x2')][_0x4b0d20['id']])){_0x13dcb2[_0xafb6('0x2')][_0x4b0d20['id']]=new MailAccount(_0x4b0d20);}else{_['merge'](_0x13dcb2['mailAccounts'][_0x4b0d20['id']],_0x4b0d20);}}}return _0x13dcb2['mailAccounts'];};};module[_0xafb6('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 143f28f..f850858 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 _0xb35d=['service','email','active','ListId','TemplateId','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name'];(function(_0x17d4ec,_0x187cae){var _0x13e1e1=function(_0x361294){while(--_0x361294){_0x17d4ec['push'](_0x17d4ec['shift']());}};_0x13e1e1(++_0x187cae);}(_0xb35d,0x14b));var _0xdb35=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xb35d[_0x344adc];return _0x4014b2;};'use strict';var client=require(_0xdb35('0x0'));exports[_0xdb35('0x1')]=function(){return function(){return client[_0xdb35('0x2')](_0xdb35('0x3'),{'options':{'attributes':['id',_0xdb35('0x4'),_0xdb35('0x5'),_0xdb35('0x6'),_0xdb35('0x7'),'key',_0xdb35('0x8'),_0xdb35('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xdb35('0xa')},{'model':_0xdb35('0xb'),'as':_0xdb35('0xc')}]},'log':_0xdb35('0xd')});};};exports[_0xdb35('0xe')]=function(_0x3d7707,_0x151753){return client['Request'](_0xdb35('0xf'),{'account':{'id':_0x3d7707},'body':_0x151753,'log':_0xdb35('0xf')});}; \ No newline at end of file +var _0x0913=['NotifyMailAccount','../client','getMailAccounts','email','active','key','ListId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0913,0x1a5));var _0x3091=function(_0x193ddf,_0x18ca53){_0x193ddf=_0x193ddf-0x0;var _0x2faec5=_0x0913[_0x193ddf];return _0x2faec5;};'use strict';var client=require(_0x3091('0x0'));exports[_0x3091('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name','service',_0x3091('0x2'),_0x3091('0x3'),_0x3091('0x4'),_0x3091('0x5'),'TemplateId'],'raw':![],'include':[{'model':_0x3091('0x6'),'as':_0x3091('0x7')},{'model':_0x3091('0x8'),'as':_0x3091('0x9')}]},'log':_0x3091('0xa')});};};exports['notify']=function(_0x1558ff,_0x20ff27){return client['Request']('NotifyMailAccount',{'account':{'id':_0x1558ff},'body':_0x20ff27,'log':_0x3091('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 478ea30..b9dcf00 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 _0xee70=['../client','getSettings','Request'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xee70,0x6f));var _0x0ee7=function(_0xa2ed10,_0x52f61f){_0xa2ed10=_0xa2ed10-0x0;var _0x24c28c=_0xee70[_0xa2ed10];return _0x24c28c;};'use strict';var client=require(_0x0ee7('0x0'));exports[_0x0ee7('0x1')]=function(){return client[_0x0ee7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x78ee=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x6c8be1,_0x54d52e){var _0x3d223d=function(_0x2fd208){while(--_0x2fd208){_0x6c8be1['push'](_0x6c8be1['shift']());}};_0x3d223d(++_0x54d52e);}(_0x78ee,0x19c));var _0xe78e=function(_0x1a087f,_0x1ce616){_0x1a087f=_0x1a087f-0x0;var _0x506003=_0x78ee[_0x1a087f];return _0x506003;};'use strict';var client=require(_0xe78e('0x0'));exports[_0xe78e('0x1')]=function(){return client[_0xe78e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe78e('0x3')]},'log':_0xe78e('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index fbf6f89..b3d9ff0 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 108b1f8..7993de4 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 _0xf34f=['listen','socket.io','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express','sticky-session','ioredis','timeout'];(function(_0x300dbb,_0xd7fd5b){var _0x1a4120=function(_0x10d5d0){while(--_0x10d5d0){_0x300dbb['push'](_0x300dbb['shift']());}};_0x1a4120(++_0xd7fd5b);}(_0xf34f,0x1c8));var _0xff34=function(_0x337775,_0x4c87f5){_0x337775=_0x337775-0x0;var _0x59131d=_0xf34f[_0x337775];return _0x59131d;};'use strict';var _=require(_0xff34('0x0'));var http=require(_0xff34('0x1'));var express=require(_0xff34('0x2'));var sticky=require(_0xff34('0x3'));var Redis=require(_0xff34('0x4'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xff34('0x5')]=0xdbba0;if(sticky[_0xff34('0x6')](server,config['port'])){var socketio=require(_0xff34('0x7'))(server,{'transports':['websocket',_0xff34('0x8')]});config[_0xff34('0x9')]=_[_0xff34('0xa')](config['redis'],{'host':_0xff34('0xb'),'port':0x18eb});socketio[_0xff34('0xc')](require(_0xff34('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xff34('0x9')])}));require(_0xff34('0xe'))[_0xff34('0xf')]();require(_0xff34('0x10'))[_0xff34('0xf')](socketio);require('../../config/express')['default'](app);require(_0xff34('0x11'))['default'](app);}else{server[_0xff34('0x12')](_0xff34('0x13'),function(){console['log'](_0xff34('0x14'),config[_0xff34('0x15')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xe005=['sticky-session','ioredis','createServer','timeout','listen','socket.io','polling','redis','defaults','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','listening','log','port','exports','lodash','http','express'];(function(_0x2fa315,_0x255e42){var _0x3cb2d9=function(_0x124303){while(--_0x124303){_0x2fa315['push'](_0x2fa315['shift']());}};_0x3cb2d9(++_0x255e42);}(_0xe005,0xb5));var _0x5e00=function(_0x36ae53,_0x535fbb){_0x36ae53=_0x36ae53-0x0;var _0x2498a1=_0xe005[_0x36ae53];return _0x2498a1;};'use strict';var _=require(_0x5e00('0x0'));var http=require(_0x5e00('0x1'));var express=require(_0x5e00('0x2'));var sticky=require(_0x5e00('0x3'));var Redis=require(_0x5e00('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0x5e00('0x5')](app);server[_0x5e00('0x6')]=0xdbba0;if(sticky[_0x5e00('0x7')](server,config['port'])){var socketio=require(_0x5e00('0x8'))(server,{'transports':['websocket',_0x5e00('0x9')]});config[_0x5e00('0xa')]=_[_0x5e00('0xb')](config[_0x5e00('0xa')],{'host':_0x5e00('0xc'),'port':0x18eb});socketio[_0x5e00('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x5e00('0xa')]),'subClient':new Redis(config[_0x5e00('0xa')])}));require(_0x5e00('0xe'))['default']();require(_0x5e00('0xf'))[_0x5e00('0x10')](socketio);require(_0x5e00('0x11'))[_0x5e00('0x10')](app);require(_0x5e00('0x12'))[_0x5e00('0x10')](app);}else{server['once'](_0x5e00('0x13'),function(){console[_0x5e00('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x5e00('0x15')]);});}exports=module[_0x5e00('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 67f3fbd..a101a17 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 _0x288b=['../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','exports','bluebird'];(function(_0x503c55,_0x4c3f9c){var _0x18ee27=function(_0x3d8c58){while(--_0x3d8c58){_0x503c55['push'](_0x503c55['shift']());}};_0x18ee27(++_0x4c3f9c);}(_0x288b,0x110));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb288('0x0'));var logger=require(_0xb288('0x1'))(_0xb288('0x2'));var client=jayson[_0xb288('0x3')][_0xb288('0x4')]({'port':0x2329});client[_0xb288('0x5')]=function(_0x56d7ec,_0x19c14d){return new BPromise(function(_0x5b6e02,_0x5558b8){return client[_0xb288('0x6')](_0x56d7ec,_0x19c14d)[_0xb288('0x7')](function(_0x4e341a){logger[_0xb288('0x8')](_0xb288('0x9'),_0xb288('0x2'),_0x56d7ec,_0x19c14d,_0x4e341a);if(_0x4e341a[_0xb288('0xa')]){logger[_0xb288('0xa')](_0xb288('0x9'),_0xb288('0x2'),_0x56d7ec,_0x4e341a['error'][_0xb288('0xb')],_0x19c14d);return _0x5558b8(_0x4e341a[_0xb288('0xa')][_0xb288('0xb')]);}else{return _0x5b6e02(_0x4e341a['result']);}})['catch'](function(_0x352410){logger['error'](_0xb288('0x9'),_0xb288('0x2'),_0x56d7ec,_0x352410,_0x19c14d);return _0x5558b8(_0x352410);});});};module[_0xb288('0xc')]=client; \ No newline at end of file +var _0x2403=['error','message','result','catch','jayson/promise','../../config/logger','routing','client','http','request','then','rpc'];(function(_0x19b9dc,_0x342159){var _0x43280f=function(_0x437b09){while(--_0x437b09){_0x19b9dc['push'](_0x19b9dc['shift']());}};_0x43280f(++_0x342159);}(_0x2403,0xac));var _0x3240=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2403[_0x40a045];return _0x1a687c;};'use strict';var jayson=require(_0x3240('0x0'));var BPromise=require('bluebird');var logger=require(_0x3240('0x1'))(_0x3240('0x2'));var client=jayson[_0x3240('0x3')][_0x3240('0x4')]({'port':0x2329});client['Request']=function(_0x3936c5,_0x31ce3c){return new BPromise(function(_0x50e1f2,_0x405065){return client[_0x3240('0x5')](_0x3936c5,_0x31ce3c)[_0x3240('0x6')](function(_0x11fed4){logger['debug'](_0x3240('0x7'),_0x3240('0x2'),_0x3936c5,_0x31ce3c,_0x11fed4);if(_0x11fed4[_0x3240('0x8')]){logger[_0x3240('0x8')]('rpc',_0x3240('0x2'),_0x3936c5,_0x11fed4[_0x3240('0x8')][_0x3240('0x9')],_0x31ce3c);return _0x405065(_0x11fed4[_0x3240('0x8')][_0x3240('0x9')]);}else{return _0x50e1f2(_0x11fed4[_0x3240('0xa')]);}})[_0x3240('0xb')](function(_0x3a9ef5){logger[_0x3240('0x8')]('rpc',_0x3240('0x2'),_0x3936c5,_0x3a9ef5,_0x31ce3c);return _0x405065(_0x3a9ef5);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index be19617..976efe0 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 _0x26e4=['./server','./realtime','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','bluebird'];(function(_0x448dc2,_0x5e492c){var _0x2df566=function(_0x439219){while(--_0x439219){_0x448dc2['push'](_0x448dc2['shift']());}};_0x2df566(++_0x5e492c);}(_0x26e4,0x16b));var _0x426e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x26e4[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x426e('0x0'));var server=require(_0x426e('0x1'));var Realtime=require(_0x426e('0x2'));var user=require(_0x426e('0x3'));var interval=require(_0x426e('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x426e('0x5'));var mailQueue=require(_0x426e('0x6'));var faxQueue=require(_0x426e('0x7'));var whatsappQueue=require(_0x426e('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x426e('0x9')]()['then'](user[_0x426e('0xa')]())[_0x426e('0xb')](realtime[_0x426e('0xc')]())['then'](interval[_0x426e('0xd')]())['then'](realtime[_0x426e('0xe')]())[_0x426e('0xb')](openchannelQueue[_0x426e('0xf')]())[_0x426e('0xb')](realtime[_0x426e('0x10')]())['then'](chatQueue['getChatQueues']())[_0x426e('0xb')](realtime[_0x426e('0x11')]())[_0x426e('0xb')](smsQueue[_0x426e('0x12')]())[_0x426e('0xb')](realtime[_0x426e('0x13')]())[_0x426e('0xb')](mailQueue[_0x426e('0x14')]())[_0x426e('0xb')](realtime[_0x426e('0x15')]())[_0x426e('0xb')](faxQueue[_0x426e('0x16')]())['then'](realtime['initFaxQueues']())[_0x426e('0xb')](whatsappQueue[_0x426e('0x17')]())[_0x426e('0xb')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x426e('0x18')](realtime)[_0x426e('0xb')](function(_0xed341f){return initRealtime();})[_0x426e('0xb')](function(_0x51a3ac){return setInterval(initRealtime,0x1388);})[_0x426e('0x19')](function(_0x5cc7b2){console['log'](_0x5cc7b2);});}main(); \ No newline at end of file +var _0x7239=['initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','bluebird','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','getOpenchannelQueues'];(function(_0x12c31a,_0x50c74d){var _0xba6a2a=function(_0x4dc6bc){while(--_0x4dc6bc){_0x12c31a['push'](_0x12c31a['shift']());}};_0xba6a2a(++_0x50c74d);}(_0x7239,0x93));var _0x9723=function(_0x20d7e6,_0x93160c){_0x20d7e6=_0x20d7e6-0x0;var _0x390786=_0x7239[_0x20d7e6];return _0x390786;};'use strict';var BPromise=require(_0x9723('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0x9723('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x9723('0x2'));var chatQueue=require(_0x9723('0x3'));var smsQueue=require(_0x9723('0x4'));var mailQueue=require(_0x9723('0x5'));var faxQueue=require(_0x9723('0x6'));var whatsappQueue=require(_0x9723('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9723('0x8')]()['then'](user[_0x9723('0x9')]())[_0x9723('0xa')](realtime[_0x9723('0xb')]())[_0x9723('0xa')](interval[_0x9723('0xc')]())['then'](realtime['initIntervals']())[_0x9723('0xa')](openchannelQueue[_0x9723('0xd')]())[_0x9723('0xa')](realtime[_0x9723('0xe')]())[_0x9723('0xa')](chatQueue[_0x9723('0xf')]())[_0x9723('0xa')](realtime[_0x9723('0x10')]())[_0x9723('0xa')](smsQueue[_0x9723('0x11')]())[_0x9723('0xa')](realtime['initSmsQueues']())[_0x9723('0xa')](mailQueue[_0x9723('0x12')]())[_0x9723('0xa')](realtime['initMailQueues']())[_0x9723('0xa')](faxQueue[_0x9723('0x13')]())[_0x9723('0xa')](realtime[_0x9723('0x14')]())[_0x9723('0xa')](whatsappQueue[_0x9723('0x15')]())[_0x9723('0xa')](realtime[_0x9723('0x16')]())[_0x9723('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x9723('0xa')](function(_0x49f862){return initRealtime();})['then'](function(_0x2d5c1b){return setInterval(initRealtime,0x1388);})['catch'](function(_0x599176){console['log'](_0x599176);});}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 47c972d..98fa184 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x338391,_0x4d5e84){var _0x363e1c=function(_0x15f7f6){while(--_0x15f7f6){_0x338391['push'](_0x338391['shift']());}};_0x363e1c(++_0x4d5e84);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x5fc3[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3621bc,_0x361df2){var _0x325038=function(_0x4eff9d){while(--_0x4eff9d){_0x3621bc['push'](_0x3621bc['shift']());}};_0x325038(++_0x361df2);}(_0x7a54,0x106));var _0x47a5=function(_0x28f75c,_0x4d9795){_0x28f75c=_0x28f75c-0x0;var _0x266efb=_0x7a54[_0x28f75c];return _0x266efb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index f82eb9d..78a0ac2 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 _0x38ba=['request','then','error','message','result','sendMailMessage','SendMail','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x38ba,0x8e));var _0xa38b=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0x38ba[_0x53b8e0];return _0x10630c;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xa38b('0x0')][_0xa38b('0x1')]({'port':0x232b});function request(_0x249860,_0x24efaf){return new BPromise(function(_0x17833f,_0x4078a3){return client[_0xa38b('0x2')](_0x249860,_0x24efaf)[_0xa38b('0x3')](function(_0x4268ac){if(_0x4268ac['error']){return _0x4078a3(_0x4268ac[_0xa38b('0x4')][_0xa38b('0x5')]);}else{return _0x17833f(_0x4268ac[_0xa38b('0x6')]);}})['catch'](function(_0x524f9b){return _0x4078a3(_0x524f9b);});});}exports[_0xa38b('0x7')]=function(_0x434883,_0x47cc97){return request(_0xa38b('0x8'),{'account':_0x434883,'message':_0x47cc97});}; \ No newline at end of file +var _0xd8ba=['sendMailMessage','bluebird','jayson/promise','client','http','request','message','result','catch'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xd8ba,0x76));var _0xad8b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd8ba[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xad8b('0x0'));var jayson=require(_0xad8b('0x1'));var client=jayson[_0xad8b('0x2')][_0xad8b('0x3')]({'port':0x232b});function request(_0x234f85,_0x2ee541){return new BPromise(function(_0x32828c,_0x45ef80){return client[_0xad8b('0x4')](_0x234f85,_0x2ee541)['then'](function(_0x472bdb){if(_0x472bdb['error']){return _0x45ef80(_0x472bdb['error'][_0xad8b('0x5')]);}else{return _0x32828c(_0x472bdb[_0xad8b('0x6')]);}})[_0xad8b('0x7')](function(_0x5a1a46){return _0x45ef80(_0x5a1a46);});});}exports[_0xad8b('0x8')]=function(_0xa14efa,_0x235900){return request('SendMail',{'account':_0xa14efa,'message':_0x235900});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 1db35c2..8581df0 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 _0x1ebd=['faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','format','stringify','user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','unknown'];(function(_0x19ccaf,_0x45220e){var _0x235ab7=function(_0x49518a){while(--_0x49518a){_0x19ccaf['push'](_0x19ccaf['shift']());}};_0x235ab7(++_0x45220e);}(_0x1ebd,0x64));var _0xd1eb=function(_0x2064b6,_0x2cdc42){_0x2064b6=_0x2064b6-0x0;var _0x1a7afe=_0x1ebd[_0x2064b6];return _0x1a7afe;};'use strict';var _=require(_0xd1eb('0x0'));var moment=require(_0xd1eb('0x1'));var md5=require(_0xd1eb('0x2'));var Redis=require('ioredis');var config=require(_0xd1eb('0x3'));config[_0xd1eb('0x4')]=_[_0xd1eb('0x5')](config[_0xd1eb('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd1eb('0x4')]));function Agent(_0x169a73){this['id']=_0x169a73['id']||0x0;this['name']=_0x169a73[_0xd1eb('0x6')]||'';this[_0xd1eb('0x7')]=_0x169a73[_0xd1eb('0x7')]||!![];this['voicePause']=_0x169a73[_0xd1eb('0x8')]||![];this[_0xd1eb('0x9')]=_0x169a73[_0xd1eb('0x9')]||![];this[_0xd1eb('0xa')]=_0x169a73[_0xd1eb('0xa')]||![];this[_0xd1eb('0xb')]=_0x169a73['faxPause']||![];this[_0xd1eb('0xc')]=_0x169a73[_0xd1eb('0xc')]||![];this[_0xd1eb('0xd')]=_0x169a73['openchannelPause']||![];this[_0xd1eb('0xe')]='unknown';this[_0xd1eb('0xf')]=0x0;this[_0xd1eb('0x10')]=_0x169a73[_0xd1eb('0x10')]||0x0;this[_0xd1eb('0x11')]=0x0;this[_0xd1eb('0x12')]='unknown';this[_0xd1eb('0x13')]=0x0;this[_0xd1eb('0x14')]=_0x169a73[_0xd1eb('0x14')]||0x0;this[_0xd1eb('0x15')]=0x0;this[_0xd1eb('0x16')]=_0xd1eb('0x17');this[_0xd1eb('0x18')]=0x0;this[_0xd1eb('0x19')]=_0x169a73['faxCapacity']||0x0;this[_0xd1eb('0x1a')]=0x0;this[_0xd1eb('0x1b')]=_0xd1eb('0x17');this[_0xd1eb('0x1c')]=0x0;this[_0xd1eb('0x1d')]=_0x169a73[_0xd1eb('0x1d')]||0x0;this[_0xd1eb('0x1e')]=0x0;this[_0xd1eb('0x1f')]=_0xd1eb('0x17');this[_0xd1eb('0x20')]=0x0;this[_0xd1eb('0x21')]=_0x169a73[_0xd1eb('0x21')]||0x0;this[_0xd1eb('0x22')]=0x0;this[_0xd1eb('0x23')]=_0xd1eb('0x17');this[_0xd1eb('0x24')]=0x0;this[_0xd1eb('0x25')]=_0x169a73[_0xd1eb('0x25')]||0x0;this[_0xd1eb('0x26')]=0x0;this[_0xd1eb('0x27')]=![];this[_0xd1eb('0x28')]=undefined;this['md5']='';this[_0xd1eb('0x29')]();}Agent[_0xd1eb('0x2a')]['getChannelStatus']=function(_0x1c921f){if(this[_0x1c921f+_0xd1eb('0x2b')]>0x0){if(this[_0x1c921f+_0xd1eb('0x2c')]>0x0&&this[_0x1c921f+'CurrentCapacity']>=this[_0x1c921f+_0xd1eb('0x2c')]){return _0xd1eb('0x2d');}else{return _0xd1eb('0x2e');}}else{return _0xd1eb('0x2f');}};Agent[_0xd1eb('0x2a')][_0xd1eb('0x29')]=function(){var _0x5cb2bb=[_0xd1eb('0x30'),_0xd1eb('0x31'),_0xd1eb('0x32'),_0xd1eb('0x33'),_0xd1eb('0x34'),'whatsapp'];for(var _0x39d12b=0x0;_0x39d12b<_0x5cb2bb[_0xd1eb('0x35')];_0x39d12b+=0x1){var _0x459750=this[_0xd1eb('0x36')](_0x5cb2bb[_0x39d12b]);if(this[_0x5cb2bb[_0x39d12b]+_0xd1eb('0x37')]!==_0x459750){this[_0x5cb2bb[_0x39d12b]+_0xd1eb('0x38')]=_[_0xd1eb('0x39')](moment()[_0xd1eb('0x3a')]('x'));}this[_0x5cb2bb[_0x39d12b]+_0xd1eb('0x37')]=_0x459750;}var _0x18d5c5={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xd1eb('0x8')],'chatPause':this[_0xd1eb('0x9')],'mailPause':this[_0xd1eb('0xa')],'smsPause':this[_0xd1eb('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xd1eb('0xe')],'chatStatusTime':this[_0xd1eb('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xd1eb('0x11')],'mailStatus':this[_0xd1eb('0x12')],'mailStatusTime':this[_0xd1eb('0x13')],'mailCapacity':this[_0xd1eb('0x14')],'mailCurrentCapacity':this[_0xd1eb('0x15')],'faxStatus':this[_0xd1eb('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xd1eb('0x19')],'faxCurrentCapacity':this[_0xd1eb('0x1a')],'smsStatus':this[_0xd1eb('0x1b')],'smsStatusTime':this[_0xd1eb('0x1c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xd1eb('0x1e')],'whatsappStatus':this[_0xd1eb('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xd1eb('0x22')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xd1eb('0x24')],'openchannelCapacity':this[_0xd1eb('0x25')],'openchannelCurrentCapacity':this[_0xd1eb('0x26')],'busy':this[_0xd1eb('0x27')],'busyQueue':this[_0xd1eb('0x28')]};var _0x20d477=md5(JSON[_0xd1eb('0x3b')](_0x18d5c5));if(this['md5']!==_0x20d477){this[_0xd1eb('0x2')]=_0x20d477;io['emit'](_0xd1eb('0x3c'),_0x18d5c5);}};module[_0xd1eb('0x3d')]=Agent; \ No newline at end of file +var _0x4689=['working','mail','chat','openchannel','fax','whatsapp','length','Status','format','faxStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports','lodash','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4689,0xf9));var _0x9468=function(_0x1ca86a,_0x4a4862){_0x1ca86a=_0x1ca86a-0x0;var _0x1bd480=_0x4689[_0x1ca86a];return _0x1bd480;};'use strict';var _=require(_0x9468('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x9468('0x1'));var config=require(_0x9468('0x2'));config[_0x9468('0x3')]=_['defaults'](config[_0x9468('0x3')],{'host':_0x9468('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9468('0x3')]));function Agent(_0x1b8268){this['id']=_0x1b8268['id']||0x0;this[_0x9468('0x5')]=_0x1b8268[_0x9468('0x5')]||'';this[_0x9468('0x6')]=_0x1b8268[_0x9468('0x6')]||!![];this[_0x9468('0x7')]=_0x1b8268[_0x9468('0x7')]||![];this['chatPause']=_0x1b8268[_0x9468('0x8')]||![];this['mailPause']=_0x1b8268[_0x9468('0x9')]||![];this[_0x9468('0xa')]=_0x1b8268[_0x9468('0xa')]||![];this['smsPause']=_0x1b8268[_0x9468('0xb')]||![];this[_0x9468('0xc')]=_0x1b8268['openchannelPause']||![];this[_0x9468('0xd')]='unknown';this[_0x9468('0xe')]=0x0;this[_0x9468('0xf')]=_0x1b8268[_0x9468('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x9468('0x10');this[_0x9468('0x11')]=0x0;this[_0x9468('0x12')]=_0x1b8268[_0x9468('0x12')]||0x0;this[_0x9468('0x13')]=0x0;this[_0x9468('0x14')]=_0x9468('0x10');this['faxStatusTime']=0x0;this[_0x9468('0x15')]=_0x1b8268[_0x9468('0x15')]||0x0;this[_0x9468('0x16')]=0x0;this[_0x9468('0x17')]='unknown';this[_0x9468('0x18')]=0x0;this['smsCapacity']=_0x1b8268[_0x9468('0x19')]||0x0;this[_0x9468('0x1a')]=0x0;this[_0x9468('0x1b')]=_0x9468('0x10');this[_0x9468('0x1c')]=0x0;this[_0x9468('0x1d')]=_0x1b8268['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this[_0x9468('0x1e')]=0x0;this[_0x9468('0x1f')]=_0x1b8268['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x9468('0x20')]=![];this[_0x9468('0x21')]=undefined;this[_0x9468('0x22')]='';this[_0x9468('0x23')]();}Agent[_0x9468('0x24')][_0x9468('0x25')]=function(_0x5d6ca0){if(this[_0x5d6ca0+_0x9468('0x26')]>0x0){if(this[_0x5d6ca0+_0x9468('0x27')]>0x0&&this[_0x5d6ca0+_0x9468('0x26')]>=this[_0x5d6ca0+_0x9468('0x27')]){return _0x9468('0x28');}else{return _0x9468('0x29');}}else{return'idle';}};Agent[_0x9468('0x24')][_0x9468('0x23')]=function(){var _0x5713df=[_0x9468('0x2a'),_0x9468('0x2b'),_0x9468('0x2c'),_0x9468('0x2d'),'sms',_0x9468('0x2e')];for(var _0x2f349c=0x0;_0x2f349c<_0x5713df[_0x9468('0x2f')];_0x2f349c+=0x1){var _0x2d3584=this[_0x9468('0x25')](_0x5713df[_0x2f349c]);if(this[_0x5713df[_0x2f349c]+_0x9468('0x30')]!==_0x2d3584){this[_0x5713df[_0x2f349c]+'StatusTime']=_['toNumber'](moment()[_0x9468('0x31')]('x'));}this[_0x5713df[_0x2f349c]+'Status']=_0x2d3584;}var _0x4066fa={'id':this['id'],'name':this['name'],'online':this[_0x9468('0x6')],'voicePause':this[_0x9468('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0x9468('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x9468('0xa')],'openchannelPause':this[_0x9468('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x9468('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x9468('0x11')],'mailCapacity':this[_0x9468('0x12')],'mailCurrentCapacity':this[_0x9468('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x9468('0x32')],'faxCapacity':this[_0x9468('0x15')],'faxCurrentCapacity':this[_0x9468('0x16')],'smsStatus':this[_0x9468('0x17')],'smsStatusTime':this[_0x9468('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x9468('0x1b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x9468('0x1d')],'whatsappCurrentCapacity':this[_0x9468('0x33')],'openchannelStatus':this[_0x9468('0x34')],'openchannelStatusTime':this[_0x9468('0x1e')],'openchannelCapacity':this[_0x9468('0x1f')],'openchannelCurrentCapacity':this[_0x9468('0x35')],'busy':this['busy'],'busyQueue':this[_0x9468('0x21')]};var _0x18f2e4=md5(JSON[_0x9468('0x36')](_0x4066fa));if(this['md5']!==_0x18f2e4){this[_0x9468('0x22')]=_0x18f2e4;io[_0x9468('0x37')](_0x9468('0x38'),_0x4066fa);}};module[_0x9468('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f2147ff..92bf3d5 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 _0x5ae3=['ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','map','Agents','_rr','prototype','paused','length','online','chatPause','available','loggedIn','stringify','format','chat:queue:%s','emit','chat_queue:save','md5','util'];(function(_0x174af8,_0x4416b5){var _0x56b0a1=function(_0x5f3472){while(--_0x5f3472){_0x174af8['push'](_0x174af8['shift']());}};_0x56b0a1(++_0x4416b5);}(_0x5ae3,0x16a));var _0x35ae=function(_0x5230d9,_0x4c0f31){_0x5230d9=_0x5230d9-0x0;var _0xce5af8=_0x5ae3[_0x5230d9];return _0xce5af8;};'use strict';var _=require('lodash');var md5=require(_0x35ae('0x0'));var util=require(_0x35ae('0x1'));var Redis=require(_0x35ae('0x2'));var config=require(_0x35ae('0x3'));config[_0x35ae('0x4')]=_[_0x35ae('0x5')](config[_0x35ae('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35ae('0x4')]));function ChatQueue(_0x40e5b8){this['id']=_0x40e5b8['id']||0x0;this[_0x35ae('0x6')]=_0x40e5b8[_0x35ae('0x6')]||'';this[_0x35ae('0x7')]=_0x40e5b8['timeout']||0xa;this[_0x35ae('0x8')]=_0x40e5b8[_0x35ae('0x8')]||_0x35ae('0x9');this['Agents']=_0x40e5b8['Agents'];this['mapAgentsId']={};this[_0x35ae('0xa')]=0x0;this[_0x35ae('0x0')]='';this['updateRouting']();this[_0x35ae('0xb')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x2d8dd8=this[_0x35ae('0xc')]['_rr'];this[_0x35ae('0xc')]=_[_0x35ae('0xd')](this[_0x35ae('0xe')],'id');this['mapAgentsId'][_0x35ae('0xf')]=_0x2d8dd8;};ChatQueue[_0x35ae('0x10')][_0x35ae('0xb')]=function(){this['loggedIn']=0x0;this[_0x35ae('0x11')]=0x0;for(var _0x1b01d6=0x0;_0x1b01d6=0x0?this['available']:0x0;var _0x43bd0d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x35ae('0x16')],'name':this['name'],'paused':this[_0x35ae('0x11')],'waiting':this[_0x35ae('0xa')]};var _0x40a9e9=md5(JSON[_0x35ae('0x17')](_0x43bd0d));if(this[_0x35ae('0x0')]!==_0x40a9e9){this[_0x35ae('0x0')]=_0x40a9e9;io['to'](util[_0x35ae('0x18')](_0x35ae('0x19'),_0x43bd0d[_0x35ae('0x6')]))[_0x35ae('0x1a')](_0x35ae('0x1b'),_0x43bd0d);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xc72a=['socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xc72a,0x90));var _0xac72=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0xc72a[_0x539533];return _0x3942f3;};'use strict';var _=require(_0xac72('0x0'));var md5=require(_0xac72('0x1'));var util=require(_0xac72('0x2'));var Redis=require('ioredis');var config=require(_0xac72('0x3'));config[_0xac72('0x4')]=_[_0xac72('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac72('0x6'))(new Redis(config[_0xac72('0x4')]));function ChatQueue(_0x1be0fc){this['id']=_0x1be0fc['id']||0x0;this['name']=_0x1be0fc[_0xac72('0x7')]||'';this[_0xac72('0x8')]=_0x1be0fc[_0xac72('0x8')]||0xa;this[_0xac72('0x9')]=_0x1be0fc[_0xac72('0x9')]||_0xac72('0xa');this['Agents']=_0x1be0fc[_0xac72('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xac72('0x1')]='';this[_0xac72('0xc')]();this[_0xac72('0xd')]();}ChatQueue[_0xac72('0xe')][_0xac72('0xc')]=function(){var _0x19a34e=this[_0xac72('0xf')]['_rr'];this['mapAgentsId']=_[_0xac72('0x10')](this[_0xac72('0xb')],'id');this[_0xac72('0xf')][_0xac72('0x11')]=_0x19a34e;};ChatQueue[_0xac72('0xe')][_0xac72('0xd')]=function(){this[_0xac72('0x12')]=0x0;this[_0xac72('0x13')]=0x0;for(var _0x44d207=0x0;_0x44d207=0x0?this[_0xac72('0x17')]:0x0;var _0x551fb0={'id':this['id'],'available':this['available'],'loggedIn':this[_0xac72('0x12')],'name':this[_0xac72('0x7')],'paused':this['paused'],'waiting':this[_0xac72('0x18')]};var _0x118fc9=md5(JSON[_0xac72('0x19')](_0x551fb0));if(this[_0xac72('0x1')]!==_0x118fc9){this[_0xac72('0x1')]=_0x118fc9;io['to'](util[_0xac72('0x1a')](_0xac72('0x1b'),_0x551fb0['name']))[_0xac72('0x1c')]('chat_queue:save',_0x551fb0);}};module[_0xac72('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1637804..9c5dc4f 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 _0x3e69=['lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','name','exports'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x3e69,0x70));var _0x93e6=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x3e69[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x93e6('0x0'));var md5=require('md5');var util=require(_0x93e6('0x1'));var Redis=require(_0x93e6('0x2'));var config=require(_0x93e6('0x3'));config[_0x93e6('0x4')]=_['defaults'](config[_0x93e6('0x4')],{'host':_0x93e6('0x5'),'port':0x18eb});var io=require(_0x93e6('0x6'))(new Redis(config[_0x93e6('0x4')]));function FaxQueue(_0x114cee){this['id']=_0x114cee['id']||0x0;this['name']=_0x114cee['name']||'';this[_0x93e6('0x7')]=_0x114cee['timeout']||0xa;this[_0x93e6('0x8')]=_0x114cee[_0x93e6('0x8')]||_0x93e6('0x9');this[_0x93e6('0xa')]=_0x114cee['Agents'];this[_0x93e6('0xb')]={};this[_0x93e6('0xc')]=0x0;this[_0x93e6('0xd')]='';this[_0x93e6('0xe')]();this[_0x93e6('0xf')]();}FaxQueue['prototype'][_0x93e6('0xe')]=function(){var _0x18f09a=this[_0x93e6('0xb')]['_rr'];this[_0x93e6('0xb')]=_[_0x93e6('0x10')](this[_0x93e6('0xa')],'id');this[_0x93e6('0xb')][_0x93e6('0x11')]=_0x18f09a;};FaxQueue['prototype'][_0x93e6('0xf')]=function(){this[_0x93e6('0x12')]=0x0;this[_0x93e6('0x13')]=0x0;for(var _0xae5365=0x0;_0xae5365=0x0?this['available']:0x0;var _0x5b8d48={'id':this['id'],'available':this[_0x93e6('0x16')],'loggedIn':this[_0x93e6('0x12')],'name':this['name'],'paused':this[_0x93e6('0x13')],'waiting':this[_0x93e6('0xc')]};var _0x3cedf5=md5(JSON[_0x93e6('0x17')](_0x5b8d48));if(this[_0x93e6('0xd')]!==_0x3cedf5){this['md5']=_0x3cedf5;io['to'](util[_0x93e6('0x18')](_0x93e6('0x19'),_0x5b8d48[_0x93e6('0x1a')]))['emit']('fax_queue:save',_0x5b8d48);}};module[_0x93e6('0x1b')]=FaxQueue; \ No newline at end of file +var _0x5ce3=['faxPause','available','format','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','defaults','localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','loggedIn','paused','length'];(function(_0x2211b2,_0x3c32a7){var _0x1ff209=function(_0x9193ae){while(--_0x9193ae){_0x2211b2['push'](_0x2211b2['shift']());}};_0x1ff209(++_0x3c32a7);}(_0x5ce3,0xa8));var _0x35ce=function(_0x4180c6,_0x642cf3){_0x4180c6=_0x4180c6-0x0;var _0xe0e5aa=_0x5ce3[_0x4180c6];return _0xe0e5aa;};'use strict';var _=require(_0x35ce('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x35ce('0x1'));var config=require(_0x35ce('0x2'));config['redis']=_[_0x35ce('0x3')](config['redis'],{'host':_0x35ce('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35ce('0x5')]));function FaxQueue(_0x47cc9e){this['id']=_0x47cc9e['id']||0x0;this[_0x35ce('0x6')]=_0x47cc9e[_0x35ce('0x6')]||'';this[_0x35ce('0x7')]=_0x47cc9e[_0x35ce('0x7')]||0xa;this[_0x35ce('0x8')]=_0x47cc9e[_0x35ce('0x8')]||_0x35ce('0x9');this[_0x35ce('0xa')]=_0x47cc9e[_0x35ce('0xa')];this[_0x35ce('0xb')]={};this[_0x35ce('0xc')]=0x0;this[_0x35ce('0xd')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x35ce('0xe')][_0x35ce('0xf')]=function(){var _0x420e3b=this['mapAgentsId'][_0x35ce('0x10')];this[_0x35ce('0xb')]=_[_0x35ce('0x11')](this[_0x35ce('0xa')],'id');this[_0x35ce('0xb')]['_rr']=_0x420e3b;};FaxQueue[_0x35ce('0xe')]['updateRealtime']=function(){this[_0x35ce('0x12')]=0x0;this[_0x35ce('0x13')]=0x0;for(var _0x35653e=0x0;_0x35653e=0x0?this['available']:0x0;var _0x3b5fe2={'id':this['id'],'available':this[_0x35ce('0x16')],'loggedIn':this[_0x35ce('0x12')],'name':this[_0x35ce('0x6')],'paused':this[_0x35ce('0x13')],'waiting':this['waiting']};var _0x3967ff=md5(JSON['stringify'](_0x3b5fe2));if(this[_0x35ce('0xd')]!==_0x3967ff){this[_0x35ce('0xd')]=_0x3967ff;io['to'](util[_0x35ce('0x17')]('fax:queue:%s',_0x3b5fe2[_0x35ce('0x6')]))[_0x35ce('0x18')](_0x35ce('0x19'),_0x3b5fe2);}};module[_0x35ce('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 cda81f8..5157203 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 _0x051c=['exports','name','Intervals'];(function(_0x58608a,_0x1c4b3e){var _0xa267b6=function(_0x174c53){while(--_0x174c53){_0x58608a['push'](_0x58608a['shift']());}};_0xa267b6(++_0x1c4b3e);}(_0x051c,0xa3));var _0xc051=function(_0x5cb896,_0x44a1b0){_0x5cb896=_0x5cb896-0x0;var _0x50836b=_0x051c[_0x5cb896];return _0x50836b;};'use strict';function Interval(_0x20e1b8){this['id']=_0x20e1b8['id']||0x0;this[_0xc051('0x0')]=_0x20e1b8[_0xc051('0x0')]||'';this[_0xc051('0x1')]=_0x20e1b8['Intervals']||{};}module[_0xc051('0x2')]=Interval; \ No newline at end of file +var _0x4299=['exports','name','Intervals'];(function(_0xdabd61,_0x102ada){var _0x5a75a2=function(_0x2f8155){while(--_0x2f8155){_0xdabd61['push'](_0xdabd61['shift']());}};_0x5a75a2(++_0x102ada);}(_0x4299,0x9a));var _0x9429=function(_0x49b919,_0x28591f){_0x49b919=_0x49b919-0x0;var _0x2b2403=_0x4299[_0x49b919];return _0x2b2403;};'use strict';function Interval(_0x504ce3){this['id']=_0x504ce3['id']||0x0;this[_0x9429('0x0')]=_0x504ce3[_0x9429('0x0')]||'';this[_0x9429('0x1')]=_0x504ce3[_0x9429('0x1')]||{};}module[_0x9429('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index ddc3860..be7cc0c 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 _0x3423=['format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify'];(function(_0xcdd805,_0x47b630){var _0x48ddbe=function(_0xaaa651){while(--_0xaaa651){_0xcdd805['push'](_0xcdd805['shift']());}};_0x48ddbe(++_0x47b630);}(_0x3423,0x1d5));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var md5=require(_0x3342('0x1'));var util=require(_0x3342('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3342('0x3')]=_[_0x3342('0x4')](config[_0x3342('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0xbbf43c){this['id']=_0xbbf43c['id']||0x0;this['name']=_0xbbf43c[_0x3342('0x5')]||'';this['timeout']=_0xbbf43c[_0x3342('0x6')]||0xa;this['strategy']=_0xbbf43c[_0x3342('0x7')]||_0x3342('0x8');this[_0x3342('0x9')]=_0xbbf43c[_0x3342('0x9')];this[_0x3342('0xa')]={};this[_0x3342('0xb')]=0x0;this[_0x3342('0x1')]='';this[_0x3342('0xc')]();this[_0x3342('0xd')]();}MailQueue[_0x3342('0xe')][_0x3342('0xc')]=function(){var _0x2d1dfa=this[_0x3342('0xa')][_0x3342('0xf')];this['mapAgentsId']=_[_0x3342('0x10')](this[_0x3342('0x9')],'id');this[_0x3342('0xa')][_0x3342('0xf')]=_0x2d1dfa;};MailQueue[_0x3342('0xe')][_0x3342('0xd')]=function(){this[_0x3342('0x11')]=0x0;this[_0x3342('0x12')]=0x0;for(var _0x13d8fb=0x0;_0x13d8fb=0x0?this[_0x3342('0x16')]:0x0;var _0xa430d1={'id':this['id'],'available':this[_0x3342('0x16')],'loggedIn':this[_0x3342('0x11')],'name':this[_0x3342('0x5')],'paused':this[_0x3342('0x12')],'waiting':this[_0x3342('0xb')]};var _0x5e2eb9=md5(JSON[_0x3342('0x17')](_0xa430d1));if(this[_0x3342('0x1')]!==_0x5e2eb9){this['md5']=_0x5e2eb9;io['to'](util[_0x3342('0x18')](_0x3342('0x19'),_0xa430d1['name']))[_0x3342('0x1a')](_0x3342('0x1b'),_0xa430d1);}};module[_0x3342('0x1c')]=MailQueue; \ No newline at end of file +var _0xf490=['stringify','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','available','waiting'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf490,0x1a4));var _0x0f49=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0xf490[_0x86c6cb];return _0x1b1592;};'use strict';var _=require(_0x0f49('0x0'));var md5=require(_0x0f49('0x1'));var util=require(_0x0f49('0x2'));var Redis=require('ioredis');var config=require(_0x0f49('0x3'));config[_0x0f49('0x4')]=_['defaults'](config['redis'],{'host':_0x0f49('0x5'),'port':0x18eb});var io=require(_0x0f49('0x6'))(new Redis(config[_0x0f49('0x4')]));function MailQueue(_0x47cfd3){this['id']=_0x47cfd3['id']||0x0;this[_0x0f49('0x7')]=_0x47cfd3[_0x0f49('0x7')]||'';this[_0x0f49('0x8')]=_0x47cfd3[_0x0f49('0x8')]||0xa;this[_0x0f49('0x9')]=_0x47cfd3[_0x0f49('0x9')]||'beepall';this[_0x0f49('0xa')]=_0x47cfd3[_0x0f49('0xa')];this[_0x0f49('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x0f49('0xc')][_0x0f49('0xd')]=function(){var _0x538f99=this[_0x0f49('0xb')][_0x0f49('0xe')];this['mapAgentsId']=_[_0x0f49('0xf')](this['Agents'],'id');this[_0x0f49('0xb')][_0x0f49('0xe')]=_0x538f99;};MailQueue[_0x0f49('0xc')][_0x0f49('0x10')]=function(){this[_0x0f49('0x11')]=0x0;this[_0x0f49('0x12')]=0x0;for(var _0x527f3d=0x0;_0x527f3d=0x0?this[_0x0f49('0x14')]:0x0;var _0x38a0f3={'id':this['id'],'available':this[_0x0f49('0x14')],'loggedIn':this[_0x0f49('0x11')],'name':this[_0x0f49('0x7')],'paused':this[_0x0f49('0x12')],'waiting':this[_0x0f49('0x15')]};var _0x1d1afd=md5(JSON[_0x0f49('0x16')](_0x38a0f3));if(this[_0x0f49('0x1')]!==_0x1d1afd){this[_0x0f49('0x1')]=_0x1d1afd;io['to'](util['format']('mail:queue:%s',_0x38a0f3[_0x0f49('0x7')]))[_0x0f49('0x17')](_0x0f49('0x18'),_0x38a0f3);}};module[_0x0f49('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7c8ef21..ff1d996 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7a54,0x106));var _0x47a5=function(_0x5dda57,_0x249eab){_0x5dda57=_0x5dda57-0x0;var _0x785cf5=_0x7a54[_0x5dda57];return _0x785cf5;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x518461,_0x1e9876){_0x518461=_0x518461-0x0;var _0x21d4ad=_0x7a54[_0x518461];return _0x21d4ad;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('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 bd5741c..002ef25 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 _0x2dae=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','waiting','format','sms:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5'];(function(_0x538588,_0x2b5049){var _0x117764=function(_0x3974cf){while(--_0x3974cf){_0x538588['push'](_0x538588['shift']());}};_0x117764(++_0x2b5049);}(_0x2dae,0xc3));var _0xe2da=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x2dae[_0x3474ac];return _0x5345ec;};'use strict';var _=require(_0xe2da('0x0'));var md5=require('md5');var util=require(_0xe2da('0x1'));var Redis=require(_0xe2da('0x2'));var config=require(_0xe2da('0x3'));config[_0xe2da('0x4')]=_[_0xe2da('0x5')](config['redis'],{'host':_0xe2da('0x6'),'port':0x18eb});var io=require(_0xe2da('0x7'))(new Redis(config[_0xe2da('0x4')]));function SmsQueue(_0x28cf6b){this['id']=_0x28cf6b['id']||0x0;this['name']=_0x28cf6b[_0xe2da('0x8')]||'';this[_0xe2da('0x9')]=_0x28cf6b[_0xe2da('0x9')]||0xa;this[_0xe2da('0xa')]=_0x28cf6b[_0xe2da('0xa')]||_0xe2da('0xb');this[_0xe2da('0xc')]=_0x28cf6b[_0xe2da('0xc')];this[_0xe2da('0xd')]={};this['waiting']=0x0;this[_0xe2da('0xe')]='';this[_0xe2da('0xf')]();this[_0xe2da('0x10')]();}SmsQueue[_0xe2da('0x11')][_0xe2da('0xf')]=function(){var _0x44ec3e=this[_0xe2da('0xd')][_0xe2da('0x12')];this['mapAgentsId']=_[_0xe2da('0x13')](this['Agents'],'id');this[_0xe2da('0xd')][_0xe2da('0x12')]=_0x44ec3e;};SmsQueue[_0xe2da('0x11')][_0xe2da('0x10')]=function(){this[_0xe2da('0x14')]=0x0;this[_0xe2da('0x15')]=0x0;for(var _0x295a86=0x0;_0x295a86=0x0?this[_0xe2da('0x18')]:0x0;var _0x1f7d33={'id':this['id'],'available':this[_0xe2da('0x18')],'loggedIn':this[_0xe2da('0x14')],'name':this[_0xe2da('0x8')],'paused':this['paused'],'waiting':this[_0xe2da('0x19')]};var _0x2e16b2=md5(JSON['stringify'](_0x1f7d33));if(this[_0xe2da('0xe')]!==_0x2e16b2){this[_0xe2da('0xe')]=_0x2e16b2;io['to'](util[_0xe2da('0x1a')](_0xe2da('0x1b'),_0x1f7d33[_0xe2da('0x8')]))[_0xe2da('0x1c')]('sms_queue:save',_0x1f7d33);}};module[_0xe2da('0x1d')]=SmsQueue; \ No newline at end of file +var _0xa74d=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms_queue:save','exports','md5'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa74d,0x1cf));var _0xda74=function(_0x44731a,_0x3417bb){_0x44731a=_0x44731a-0x0;var _0x5541bd=_0xa74d[_0x44731a];return _0x5541bd;};'use strict';var _=require('lodash');var md5=require(_0xda74('0x0'));var util=require(_0xda74('0x1'));var Redis=require(_0xda74('0x2'));var config=require(_0xda74('0x3'));config[_0xda74('0x4')]=_[_0xda74('0x5')](config['redis'],{'host':_0xda74('0x6'),'port':0x18eb});var io=require(_0xda74('0x7'))(new Redis(config[_0xda74('0x4')]));function SmsQueue(_0x3f65e4){this['id']=_0x3f65e4['id']||0x0;this[_0xda74('0x8')]=_0x3f65e4[_0xda74('0x8')]||'';this[_0xda74('0x9')]=_0x3f65e4[_0xda74('0x9')]||0xa;this['strategy']=_0x3f65e4[_0xda74('0xa')]||'beepall';this['Agents']=_0x3f65e4[_0xda74('0xb')];this[_0xda74('0xc')]={};this['waiting']=0x0;this[_0xda74('0x0')]='';this[_0xda74('0xd')]();this[_0xda74('0xe')]();}SmsQueue[_0xda74('0xf')][_0xda74('0xd')]=function(){var _0x2bb855=this[_0xda74('0xc')][_0xda74('0x10')];this['mapAgentsId']=_[_0xda74('0x11')](this[_0xda74('0xb')],'id');this[_0xda74('0xc')]['_rr']=_0x2bb855;};SmsQueue[_0xda74('0xf')][_0xda74('0xe')]=function(){this[_0xda74('0x12')]=0x0;this[_0xda74('0x13')]=0x0;for(var _0x447135=0x0;_0x447135=0x0?this[_0xda74('0x17')]:0x0;var _0xd22576={'id':this['id'],'available':this[_0xda74('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xda74('0x8')],'paused':this[_0xda74('0x13')],'waiting':this[_0xda74('0x18')]};var _0x2b6770=md5(JSON[_0xda74('0x19')](_0xd22576));if(this[_0xda74('0x0')]!==_0x2b6770){this[_0xda74('0x0')]=_0x2b6770;io['to'](util[_0xda74('0x1a')]('sms:queue:%s',_0xd22576['name']))['emit'](_0xda74('0x1b'),_0xd22576);}};module[_0xda74('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 b254ee0..865c49e 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 _0x09af=['waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','whatsappPause','paused','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x51ee01,_0x4f6c70){var _0x1497bc=function(_0x4b5a80){while(--_0x4b5a80){_0x51ee01['push'](_0x51ee01['shift']());}};_0x1497bc(++_0x4f6c70);}(_0x09af,0x144));var _0xf09a=function(_0xcff1ca,_0x3e847f){_0xcff1ca=_0xcff1ca-0x0;var _0xb25f86=_0x09af[_0xcff1ca];return _0xb25f86;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xf09a('0x0'));var Redis=require(_0xf09a('0x1'));var config=require(_0xf09a('0x2'));config[_0xf09a('0x3')]=_[_0xf09a('0x4')](config[_0xf09a('0x3')],{'host':_0xf09a('0x5'),'port':0x18eb});var io=require(_0xf09a('0x6'))(new Redis(config[_0xf09a('0x3')]));function WhatsappQueue(_0x2da08d){this['id']=_0x2da08d['id']||0x0;this['name']=_0x2da08d[_0xf09a('0x7')]||'';this[_0xf09a('0x8')]=_0x2da08d[_0xf09a('0x8')]||0xa;this[_0xf09a('0x9')]=_0x2da08d[_0xf09a('0x9')]||'beepall';this[_0xf09a('0xa')]=_0x2da08d[_0xf09a('0xa')];this[_0xf09a('0xb')]={};this[_0xf09a('0xc')]=0x0;this[_0xf09a('0xd')]='';this[_0xf09a('0xe')]();this[_0xf09a('0xf')]();}WhatsappQueue[_0xf09a('0x10')]['updateRouting']=function(){var _0x7ac3cf=this[_0xf09a('0xb')]['_rr'];this[_0xf09a('0xb')]=_['map'](this[_0xf09a('0xa')],'id');this[_0xf09a('0xb')][_0xf09a('0x11')]=_0x7ac3cf;};WhatsappQueue[_0xf09a('0x10')][_0xf09a('0xf')]=function(){this[_0xf09a('0x12')]=0x0;this['paused']=0x0;for(var _0x56eaf4=0x0;_0x56eaf4=0x0?this[_0xf09a('0x17')]:0x0;var _0x2d9f94={'id':this['id'],'available':this[_0xf09a('0x17')],'loggedIn':this[_0xf09a('0x12')],'name':this[_0xf09a('0x7')],'paused':this['paused'],'waiting':this[_0xf09a('0xc')]};var _0x3cd269=md5(JSON[_0xf09a('0x18')](_0x2d9f94));if(this[_0xf09a('0xd')]!==_0x3cd269){this['md5']=_0x3cd269;io['to'](util['format'](_0xf09a('0x19'),_0x2d9f94['name']))[_0xf09a('0x1a')](_0xf09a('0x1b'),_0x2d9f94);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x577a=['beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','map','loggedIn','paused','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x577a,0xf2));var _0xa577=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x577a[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xa577('0x0'));var md5=require('md5');var util=require(_0xa577('0x1'));var Redis=require(_0xa577('0x2'));var config=require(_0xa577('0x3'));config['redis']=_[_0xa577('0x4')](config[_0xa577('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa577('0x6'))(new Redis(config[_0xa577('0x5')]));function WhatsappQueue(_0x41a50a){this['id']=_0x41a50a['id']||0x0;this[_0xa577('0x7')]=_0x41a50a[_0xa577('0x7')]||'';this[_0xa577('0x8')]=_0x41a50a[_0xa577('0x8')]||0xa;this[_0xa577('0x9')]=_0x41a50a['strategy']||_0xa577('0xa');this[_0xa577('0xb')]=_0x41a50a[_0xa577('0xb')];this[_0xa577('0xc')]={};this['waiting']=0x0;this[_0xa577('0xd')]='';this[_0xa577('0xe')]();this[_0xa577('0xf')]();}WhatsappQueue[_0xa577('0x10')][_0xa577('0xe')]=function(){var _0x488bc7=this[_0xa577('0xc')]['_rr'];this[_0xa577('0xc')]=_[_0xa577('0x11')](this[_0xa577('0xb')],'id');this[_0xa577('0xc')]['_rr']=_0x488bc7;};WhatsappQueue['prototype'][_0xa577('0xf')]=function(){this[_0xa577('0x12')]=0x0;this[_0xa577('0x13')]=0x0;for(var _0x386c6d=0x0;_0x386c6d=0x0?this[_0xa577('0x15')]:0x0;var _0x695282={'id':this['id'],'available':this[_0xa577('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa577('0x16')]};var _0x4b7f2f=md5(JSON[_0xa577('0x17')](_0x695282));if(this[_0xa577('0xd')]!==_0x4b7f2f){this[_0xa577('0xd')]=_0x4b7f2f;io['to'](util[_0xa577('0x18')](_0xa577('0x19'),_0x695282[_0xa577('0x7')]))[_0xa577('0x1a')]('whatsapp_queue:save',_0x695282);}};module[_0xa577('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8831958..52188ba 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x3ef314,_0x575605){var _0x549a76=function(_0x589fa7){while(--_0x589fa7){_0x3ef314['push'](_0x3ef314['shift']());}};_0x549a76(++_0x575605);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e13fe,_0x339218){_0x5e13fe=_0x5e13fe-0x0;var _0x26f143=_0xb10b[_0x5e13fe];return _0x26f143;};'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 99ad498..d553281 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 _0xcae2=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x168eae,_0xa7a51){var _0x4c52d2=function(_0x171918){while(--_0x171918){_0x168eae['push'](_0x168eae['shift']());}};_0x4c52d2(++_0xa7a51);}(_0xcae2,0x18e));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x2cae('0x0'));exports[_0x2cae('0x1')]=function(_0x573b17,_0x5b815a){return client[_0x2cae('0x2')](_0x2cae('0x3'),{'body':_0x5b815a,'options':{'where':{'id':_0x573b17}},'log':_0x2cae('0x4')});};exports[_0x2cae('0x5')]=function(_0x21403d,_0x4d98bf){return client[_0x2cae('0x2')](_0x2cae('0x6'),{'body':_0x4d98bf,'options':{'where':{'id':_0x21403d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xfb60=['AddTagsToChatInteraction','addTagsToChatInteraction','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb60,0x1ac));var _0x0fb6=function(_0x2f75b0,_0x524e4c){_0x2f75b0=_0x2f75b0-0x0;var _0x544044=_0xfb60[_0x2f75b0];return _0x544044;};'use strict';var client=require('../client');exports['update']=function(_0x355fcf,_0x293809){return client[_0x0fb6('0x0')](_0x0fb6('0x1'),{'body':_0x293809,'options':{'where':{'id':_0x355fcf}},'log':_0x0fb6('0x2')});};exports[_0x0fb6('0x3')]=function(_0x4d376c,_0x5cc58d){return client[_0x0fb6('0x0')](_0x0fb6('0x4'),{'body':_0x5cc58d,'options':{'where':{'id':_0x4d376c}},'log':_0x0fb6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ca4666b..366886b 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 _0x528e=['create','Request','CreateChatMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x528e,0x1bb));var _0xe528=function(_0xe92fd1,_0x4f4e3f){_0xe92fd1=_0xe92fd1-0x0;var _0x2e0ece=_0x528e[_0xe92fd1];return _0x2e0ece;};'use strict';var client=require(_0xe528('0x0'));exports[_0xe528('0x1')]=function(_0x334688){return client[_0xe528('0x2')](_0xe528('0x3'),{'body':_0x334688,'log':'createChatMessage'});}; \ No newline at end of file +var _0x3120=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x29ad5f,_0x1b620a){var _0x227747=function(_0x39de32){while(--_0x39de32){_0x29ad5f['push'](_0x29ad5f['shift']());}};_0x227747(++_0x1b620a);}(_0x3120,0x79));var _0x0312=function(_0xcfb474,_0x5016ab){_0xcfb474=_0xcfb474-0x0;var _0x5b175d=_0x3120[_0xcfb474];return _0x5b175d;};'use strict';var client=require(_0x0312('0x0'));exports[_0x0312('0x1')]=function(_0x5d84fe){return client[_0x0312('0x2')](_0x0312('0x3'),{'body':_0x5d84fe,'log':_0x0312('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5f6e5a1..184d80e 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 _0x63b6=['online','../client','getChatQueues','Request','name','strategy','Agents'];(function(_0x3e1c11,_0x4deb55){var _0x398723=function(_0x4f7bf8){while(--_0x4f7bf8){_0x3e1c11['push'](_0x3e1c11['shift']());}};_0x398723(++_0x4deb55);}(_0x63b6,0x127));var _0x663b=function(_0x59aec7,_0x4e7e3e){_0x59aec7=_0x59aec7-0x0;var _0x34cac3=_0x63b6[_0x59aec7];return _0x34cac3;};'use strict';var client=require(_0x663b('0x0'));exports[_0x663b('0x1')]=function(){return function(){return client[_0x663b('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x663b('0x3'),'timeout',_0x663b('0x4')],'include':[{'model':'User','as':_0x663b('0x5'),'attributes':['id',_0x663b('0x3'),_0x663b('0x6'),'chatPause']}]},'log':_0x663b('0x1')});};}; \ No newline at end of file +var _0x04e7=['Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x04e7,0x121));var _0x704e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x04e7[_0x1ae5ab];return _0x1ce001;};'use strict';var client=require(_0x704e('0x0'));exports[_0x704e('0x1')]=function(){return function(){return client[_0x704e('0x2')](_0x704e('0x3'),{'options':{'raw':![],'attributes':['id',_0x704e('0x4'),_0x704e('0x5'),_0x704e('0x6')],'include':[{'model':_0x704e('0x7'),'as':_0x704e('0x8'),'attributes':['id',_0x704e('0x4'),_0x704e('0x9'),_0x704e('0xa')]}]},'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 5f86312..76eb423 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 _0xc6d8=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0xc6d8[_0x20b29c];return _0x20d81b;};'use strict';var client=require(_0x8c6d('0x0'));exports['create']=function(_0x170f12){return client['Request'](_0x8c6d('0x1'),{'body':_0x170f12,'log':'CreateChatQueueReport'});};exports[_0x8c6d('0x2')]=function(_0x4fa8a4,_0x5b6b04){return client[_0x8c6d('0x3')](_0x8c6d('0x4'),{'body':_0x5b6b04,'options':{'where':{'uniqueid':_0x4fa8a4},'order':[['id',_0x8c6d('0x5')]],'limit':0x1},'log':_0x8c6d('0x4')});}; \ No newline at end of file +var _0x27bf=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0x283675,_0x3bcaf5){var _0x47a53d=function(_0x577db1){while(--_0x577db1){_0x283675['push'](_0x283675['shift']());}};_0x47a53d(++_0x3bcaf5);}(_0x27bf,0x117));var _0xf27b=function(_0x22aa99,_0x201cc5){_0x22aa99=_0x22aa99-0x0;var _0x4066d3=_0x27bf[_0x22aa99];return _0x4066d3;};'use strict';var client=require(_0xf27b('0x0'));exports[_0xf27b('0x1')]=function(_0x2227af){return client[_0xf27b('0x2')](_0xf27b('0x3'),{'body':_0x2227af,'log':_0xf27b('0x3')});};exports[_0xf27b('0x4')]=function(_0x2ff64c,_0x339bb9){return client[_0xf27b('0x2')](_0xf27b('0x5'),{'body':_0x339bb9,'options':{'where':{'uniqueid':_0x2ff64c},'order':[['id','DESC']],'limit':0x1},'log':_0xf27b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index c856465..96633eb 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(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x7a54,0x106));var _0x47a5=function(_0x50a16b,_0xbbc8d1){_0x50a16b=_0x50a16b-0x0;var _0xb156c4=_0x7a54[_0x50a16b];return _0xb156c4;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4e51d0,_0x5df0c6){var _0x2638f3=function(_0x56a250){while(--_0x56a250){_0x4e51d0['push'](_0x4e51d0['shift']());}};_0x2638f3(++_0x5df0c6);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 6152862..b2d8d66 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 _0x2923=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x2923,0xd3));var _0x3292=function(_0x577e2c,_0x3a1aff){_0x577e2c=_0x577e2c-0x0;var _0x3bd990=_0x2923[_0x577e2c];return _0x3bd990;};'use strict';var client=require(_0x3292('0x0'));exports[_0x3292('0x1')]=function(_0x1035fc){return client[_0x3292('0x2')](_0x3292('0x3'),{'body':_0x1035fc,'log':_0x3292('0x4')});}; \ No newline at end of file +var _0x6ce9=['create','CreateFaxMessage'];(function(_0x17ea3e,_0x11596b){var _0x309068=function(_0x4c9437){while(--_0x4c9437){_0x17ea3e['push'](_0x17ea3e['shift']());}};_0x309068(++_0x11596b);}(_0x6ce9,0x1d4));var _0x96ce=function(_0x255341,_0x313192){_0x255341=_0x255341-0x0;var _0x70afee=_0x6ce9[_0x255341];return _0x70afee;};'use strict';var client=require('../client');exports[_0x96ce('0x0')]=function(_0xe71d7e){return client['Request'](_0x96ce('0x1'),{'body':_0xe71d7e,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 7205f7b..b7fe070 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 _0xa9ba=['strategy','User','Agents','online','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x5dadb9,_0x2510ae){var _0x5d6abe=function(_0xfe3201){while(--_0xfe3201){_0x5dadb9['push'](_0x5dadb9['shift']());}};_0x5d6abe(++_0x2510ae);}(_0xa9ba,0xd3));var _0xaa9b=function(_0x5b4bf6,_0x3289ba){_0x5b4bf6=_0x5b4bf6-0x0;var _0x4c5de0=_0xa9ba[_0x5b4bf6];return _0x4c5de0;};'use strict';var client=require('../client');exports[_0xaa9b('0x0')]=function(){return function(){return client[_0xaa9b('0x1')](_0xaa9b('0x2'),{'options':{'raw':![],'attributes':['id',_0xaa9b('0x3'),_0xaa9b('0x4'),_0xaa9b('0x5')],'include':[{'model':_0xaa9b('0x6'),'as':_0xaa9b('0x7'),'attributes':['id',_0xaa9b('0x3'),_0xaa9b('0x8'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x8398=['name','timeout','strategy','User','Agents','getFaxQueues','../client','Request'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x8398,0xfe));var _0x8839=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x8398[_0x29d915];return _0x160f86;};'use strict';var client=require(_0x8839('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x8839('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x8839('0x2'),_0x8839('0x3'),_0x8839('0x4')],'include':[{'model':_0x8839('0x5'),'as':_0x8839('0x6'),'attributes':['id',_0x8839('0x2'),'online','faxPause']}]},'log':_0x8839('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index adc615d..8814b04 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 _0x4096=['create','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x137345,_0x490971){var _0x1e4d1a=function(_0x45c13a){while(--_0x45c13a){_0x137345['push'](_0x137345['shift']());}};_0x1e4d1a(++_0x490971);}(_0x4096,0x137));var _0x6409=function(_0x25d625,_0x2228a7){_0x25d625=_0x25d625-0x0;var _0x3c6649=_0x4096[_0x25d625];return _0x3c6649;};'use strict';var client=require(_0x6409('0x0'));exports[_0x6409('0x1')]=function(_0x5682af){return client['Request'](_0x6409('0x2'),{'body':_0x5682af,'log':_0x6409('0x2')});};exports[_0x6409('0x3')]=function(_0x46a009,_0x40c3f7){return client['Request'](_0x6409('0x4'),{'body':_0x40c3f7,'options':{'where':{'uniqueid':_0x46a009},'order':[['id',_0x6409('0x5')]],'limit':0x1},'log':_0x6409('0x4')});}; \ No newline at end of file +var _0x4f00=['UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport','update','Request'];(function(_0xd341b,_0x3100ba){var _0x86bd5a=function(_0x325140){while(--_0x325140){_0xd341b['push'](_0xd341b['shift']());}};_0x86bd5a(++_0x3100ba);}(_0x4f00,0x191));var _0x04f0=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4f00[_0x4e9628];return _0x27bc8c;};'use strict';var client=require(_0x04f0('0x0'));exports[_0x04f0('0x1')]=function(_0xe8d377){return client['Request']('CreateFaxQueueReport',{'body':_0xe8d377,'log':_0x04f0('0x2')});};exports[_0x04f0('0x3')]=function(_0x2509df,_0x230b8a){return client[_0x04f0('0x4')](_0x04f0('0x5'),{'body':_0x230b8a,'options':{'where':{'uniqueid':_0x2509df},'order':[['id',_0x04f0('0x6')]],'limit':0x1},'log':_0x04f0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6195c42..1c9797a 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 _0x3c6c=['GetInterval','Intervals','name','interval','../client','getIntervals','Request'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x3c6c,0xc8));var _0xc3c6=function(_0x41deca,_0x94bff5){_0x41deca=_0x41deca-0x0;var _0x1434ae=_0x3c6c[_0x41deca];return _0x1434ae;};'use strict';var client=require(_0xc3c6('0x0'));exports[_0xc3c6('0x1')]=function(){return function(){return client[_0xc3c6('0x2')](_0xc3c6('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xc3c6('0x4'),'attributes':['id',_0xc3c6('0x5'),_0xc3c6('0x6')]}]},'log':_0xc3c6('0x1')});};}; \ No newline at end of file +var _0xe508=['GetInterval','Interval','Intervals','name','../client','getIntervals'];(function(_0x48a8db,_0x495a7b){var _0x4ec17d=function(_0x140bb8){while(--_0x140bb8){_0x48a8db['push'](_0x48a8db['shift']());}};_0x4ec17d(++_0x495a7b);}(_0xe508,0x6a));var _0x8e50=function(_0x2b7b91,_0x137388){_0x2b7b91=_0x2b7b91-0x0;var _0x2eae8f=_0xe508[_0x2b7b91];return _0x2eae8f;};'use strict';var client=require(_0x8e50('0x0'));exports[_0x8e50('0x1')]=function(){return function(){return client['Request'](_0x8e50('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x8e50('0x3'),'as':_0x8e50('0x4'),'attributes':['id',_0x8e50('0x5'),'interval']}]},'log':_0x8e50('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 9b5b2c4..9de18b4 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 _0x5464=['update','Request','updateMailInteraction','AddTagsToMailInteraction','../client'];(function(_0x2a6984,_0x961708){var _0xaf1d0c=function(_0x501d2d){while(--_0x501d2d){_0x2a6984['push'](_0x2a6984['shift']());}};_0xaf1d0c(++_0x961708);}(_0x5464,0x15d));var _0x4546=function(_0x12e4c5,_0x567d22){_0x12e4c5=_0x12e4c5-0x0;var _0x1ccf13=_0x5464[_0x12e4c5];return _0x1ccf13;};'use strict';var client=require(_0x4546('0x0'));exports[_0x4546('0x1')]=function(_0x159e14,_0x4f33fd){return client[_0x4546('0x2')]('UpdateMailInteraction',{'body':_0x4f33fd,'options':{'where':{'id':_0x159e14}},'log':_0x4546('0x3')});};exports['addTags']=function(_0x320c4d,_0x396a1d){return client[_0x4546('0x2')](_0x4546('0x4'),{'body':_0x396a1d,'options':{'where':{'id':_0x320c4d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x1a37=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0x516c03,_0x4bc914){var _0x211289=function(_0x3de78d){while(--_0x3de78d){_0x516c03['push'](_0x516c03['shift']());}};_0x211289(++_0x4bc914);}(_0x1a37,0xb4));var _0x71a3=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x1a37[_0xa8883];return _0x479426;};'use strict';var client=require(_0x71a3('0x0'));exports[_0x71a3('0x1')]=function(_0x32781b,_0x28e254){return client[_0x71a3('0x2')](_0x71a3('0x3'),{'body':_0x28e254,'options':{'where':{'id':_0x32781b}},'log':_0x71a3('0x4')});};exports[_0x71a3('0x5')]=function(_0x29c54f,_0x100181){return client['Request'](_0x71a3('0x6'),{'body':_0x100181,'options':{'where':{'id':_0x29c54f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 4e3a06d..f24d68c 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 _0x9938=['CreateMailMessage','createMailMessage','../client','create'];(function(_0x22d1ef,_0x4a5152){var _0x47c5a3=function(_0x9a2c48){while(--_0x9a2c48){_0x22d1ef['push'](_0x22d1ef['shift']());}};_0x47c5a3(++_0x4a5152);}(_0x9938,0x1b2));var _0x8993=function(_0x57ad0a,_0x4239a2){_0x57ad0a=_0x57ad0a-0x0;var _0x464545=_0x9938[_0x57ad0a];return _0x464545;};'use strict';var client=require(_0x8993('0x0'));exports[_0x8993('0x1')]=function(_0x266331){return client['Request'](_0x8993('0x2'),{'body':_0x266331,'log':_0x8993('0x3')});}; \ No newline at end of file +var _0x8d70=['create','Request','CreateMailMessage'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x8d70,0x105));var _0x08d7=function(_0x58bf1a,_0x1b2e9a){_0x58bf1a=_0x58bf1a-0x0;var _0x9f456f=_0x8d70[_0x58bf1a];return _0x9f456f;};'use strict';var client=require('../client');exports[_0x08d7('0x0')]=function(_0x5421e3){return client[_0x08d7('0x1')](_0x08d7('0x2'),{'body':_0x5421e3,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index aaf7ebb..b79bcc7 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 _0x9a21=['Agents','online','../client','getMailQueues','name','strategy','User'];(function(_0x20491f,_0x52adc4){var _0x20fe5d=function(_0x5bd9cb){while(--_0x5bd9cb){_0x20491f['push'](_0x20491f['shift']());}};_0x20fe5d(++_0x52adc4);}(_0x9a21,0x12f));var _0x19a2=function(_0x25c7c0,_0x458d5b){_0x25c7c0=_0x25c7c0-0x0;var _0x559913=_0x9a21[_0x25c7c0];return _0x559913;};'use strict';var client=require(_0x19a2('0x0'));exports[_0x19a2('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x19a2('0x2'),'timeout',_0x19a2('0x3')],'include':[{'model':_0x19a2('0x4'),'as':_0x19a2('0x5'),'attributes':['id',_0x19a2('0x2'),_0x19a2('0x6'),'mailPause']}]},'log':_0x19a2('0x1')});};}; \ No newline at end of file +var _0x22b9=['name','timeout','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x17d80b,_0x4a3c14){var _0x20945a=function(_0x398294){while(--_0x398294){_0x17d80b['push'](_0x17d80b['shift']());}};_0x20945a(++_0x4a3c14);}(_0x22b9,0x8c));var _0x922b=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x22b9[_0x1d24eb];return _0x1dc576;};'use strict';var client=require(_0x922b('0x0'));exports[_0x922b('0x1')]=function(){return function(){return client[_0x922b('0x2')](_0x922b('0x3'),{'options':{'raw':![],'attributes':['id',_0x922b('0x4'),_0x922b('0x5'),'strategy'],'include':[{'model':'User','as':_0x922b('0x6'),'attributes':['id','name',_0x922b('0x7'),_0x922b('0x8')]}]},'log':_0x922b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2bfe297..3eb10ac 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 _0x02d4=['CreateMailQueueReport','UpdateMailQueueReport','DESC','create','Request'];(function(_0x44182b,_0x33ccea){var _0x1c1e60=function(_0x42fe96){while(--_0x42fe96){_0x44182b['push'](_0x44182b['shift']());}};_0x1c1e60(++_0x33ccea);}(_0x02d4,0x80));var _0x402d=function(_0x93d54b,_0x325f4c){_0x93d54b=_0x93d54b-0x0;var _0x58ce45=_0x02d4[_0x93d54b];return _0x58ce45;};'use strict';var client=require('../client');exports[_0x402d('0x0')]=function(_0x4dfe3f){return client[_0x402d('0x1')](_0x402d('0x2'),{'body':_0x4dfe3f,'log':'CreateMailQueueReport'});};exports['update']=function(_0x3e4602,_0x5b5e61){return client[_0x402d('0x1')](_0x402d('0x3'),{'body':_0x5b5e61,'options':{'where':{'uniqueid':_0x3e4602},'order':[['id',_0x402d('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x046c=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x046c,0x1af));var _0xc046=function(_0x512738,_0x52ef6b){_0x512738=_0x512738-0x0;var _0x1bdb2b=_0x046c[_0x512738];return _0x1bdb2b;};'use strict';var client=require(_0xc046('0x0'));exports[_0xc046('0x1')]=function(_0x51ddf1){return client[_0xc046('0x2')](_0xc046('0x3'),{'body':_0x51ddf1,'log':'CreateMailQueueReport'});};exports[_0xc046('0x4')]=function(_0x49a5ba,_0x9939e){return client[_0xc046('0x2')]('UpdateMailQueueReport',{'body':_0x9939e,'options':{'where':{'uniqueid':_0x49a5ba},'order':[['id',_0xc046('0x5')]],'limit':0x1},'log':_0xc046('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 62aff11..8e11ff2 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 _0x6ca6=['Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x3736ef,_0x3d7e1b){var _0x5b9898=function(_0x226d1e){while(--_0x226d1e){_0x3736ef['push'](_0x3736ef['shift']());}};_0x5b9898(++_0x3d7e1b);}(_0x6ca6,0xdb));var _0x66ca=function(_0x1d719b,_0x2605c0){_0x1d719b=_0x1d719b-0x0;var _0x5d045b=_0x6ca6[_0x1d719b];return _0x5d045b;};'use strict';var client=require(_0x66ca('0x0'));exports[_0x66ca('0x1')]=function(_0x788721,_0x13ac65){return client['Request'](_0x66ca('0x2'),{'body':_0x13ac65,'options':{'where':{'id':_0x788721}},'log':_0x66ca('0x3')});};exports[_0x66ca('0x4')]=function(_0x5886c3,_0x42bafb){return client[_0x66ca('0x5')](_0x66ca('0x6'),{'body':_0x42bafb,'options':{'where':{'id':_0x5886c3}},'log':_0x66ca('0x7')});}; \ No newline at end of file +var _0xec8d=['addTags','AddTagsToOpenchannelInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xec8d,0x1be));var _0xdec8=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xec8d[_0x18546c];return _0x46ef43;};'use strict';var client=require(_0xdec8('0x0'));exports['update']=function(_0x5311cb,_0x1cad58){return client[_0xdec8('0x1')](_0xdec8('0x2'),{'body':_0x1cad58,'options':{'where':{'id':_0x5311cb}},'log':_0xdec8('0x3')});};exports[_0xdec8('0x4')]=function(_0xeaff8d,_0xc2d0ba){return client[_0xdec8('0x1')](_0xdec8('0x5'),{'body':_0xc2d0ba,'options':{'where':{'id':_0xeaff8d}},'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 175a791..a47a097 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 _0x3bac=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x3bac,0x135));var _0xc3ba=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x3bac[_0x46401e];return _0x447cba;};'use strict';var client=require(_0xc3ba('0x0'));exports[_0xc3ba('0x1')]=function(_0x659dfd){return client[_0xc3ba('0x2')](_0xc3ba('0x3'),{'body':_0x659dfd,'log':_0xc3ba('0x4')});}; \ No newline at end of file +var _0xaab8=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x536cd5,_0x3abed6){var _0x4f1657=function(_0x3f1e34){while(--_0x3f1e34){_0x536cd5['push'](_0x536cd5['shift']());}};_0x4f1657(++_0x3abed6);}(_0xaab8,0x1c3));var _0x8aab=function(_0x35841b,_0xed9311){_0x35841b=_0x35841b-0x0;var _0x22362b=_0xaab8[_0x35841b];return _0x22362b;};'use strict';var client=require(_0x8aab('0x0'));exports[_0x8aab('0x1')]=function(_0x4c79ea){return client[_0x8aab('0x2')](_0x8aab('0x3'),{'body':_0x4c79ea,'log':_0x8aab('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ad67290..c1b6a16 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 _0x51a8=['online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','timeout','User','Agents','name'];(function(_0x5bdd88,_0x2aca33){var _0x4580c4=function(_0x319ae5){while(--_0x319ae5){_0x5bdd88['push'](_0x5bdd88['shift']());}};_0x4580c4(++_0x2aca33);}(_0x51a8,0xec));var _0x851a=function(_0x4b6c1e,_0x37ae51){_0x4b6c1e=_0x4b6c1e-0x0;var _0x185178=_0x51a8[_0x4b6c1e];return _0x185178;};'use strict';var client=require(_0x851a('0x0'));exports[_0x851a('0x1')]=function(){return function(){return client['Request'](_0x851a('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x851a('0x3'),'strategy'],'include':[{'model':_0x851a('0x4'),'as':_0x851a('0x5'),'attributes':['id',_0x851a('0x6'),_0x851a('0x7'),_0x851a('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xa108=['online','getOpenchannelQueues','Request','name','timeout','strategy','User'];(function(_0x341808,_0x15a210){var _0x51084c=function(_0x542285){while(--_0x542285){_0x341808['push'](_0x341808['shift']());}};_0x51084c(++_0x15a210);}(_0xa108,0x1c8));var _0x8a10=function(_0xe8c98e,_0x1f8fc1){_0xe8c98e=_0xe8c98e-0x0;var _0x692262=_0xa108[_0xe8c98e];return _0x692262;};'use strict';var client=require('../client');exports[_0x8a10('0x0')]=function(){return function(){return client[_0x8a10('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x8a10('0x2'),_0x8a10('0x3'),_0x8a10('0x4')],'include':[{'model':_0x8a10('0x5'),'as':'Agents','attributes':['id',_0x8a10('0x2'),_0x8a10('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5327610..869135c 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 _0x6de8=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6de8,0x126));var _0x86de=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0x6de8[_0xd2e2ab];return _0x1703a2;};'use strict';var client=require('../client');exports[_0x86de('0x0')]=function(_0x548f42){return client['Request'](_0x86de('0x1'),{'body':_0x548f42,'log':_0x86de('0x1')});};exports[_0x86de('0x2')]=function(_0x26f37f,_0x1b3659){return client[_0x86de('0x3')](_0x86de('0x4'),{'body':_0x1b3659,'options':{'where':{'uniqueid':_0x26f37f},'order':[['id',_0x86de('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xd178=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x4c200c,_0xf014ce){var _0x53a6fd=function(_0x1a1d2d){while(--_0x1a1d2d){_0x4c200c['push'](_0x4c200c['shift']());}};_0x53a6fd(++_0xf014ce);}(_0xd178,0xb5));var _0x8d17=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xd178[_0x3b5250];return _0xc844a1;};'use strict';var client=require('../client');exports[_0x8d17('0x0')]=function(_0x3db3dc){return client[_0x8d17('0x1')](_0x8d17('0x2'),{'body':_0x3db3dc,'log':_0x8d17('0x2')});};exports['update']=function(_0x21f342,_0xf7b8a0){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0xf7b8a0,'options':{'where':{'uniqueid':_0x21f342},'order':[['id',_0x8d17('0x3')]],'limit':0x1},'log':_0x8d17('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index e00a798..c33d392 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 _0xe132=['Request','UpdateSmsInteraction','updateSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x120d91,_0xb942a2){var _0x5a7d0c=function(_0x1dd172){while(--_0x1dd172){_0x120d91['push'](_0x120d91['shift']());}};_0x5a7d0c(++_0xb942a2);}(_0xe132,0x162));var _0x2e13=function(_0x3a2f25,_0xf12456){_0x3a2f25=_0x3a2f25-0x0;var _0x189529=_0xe132[_0x3a2f25];return _0x189529;};'use strict';var client=require(_0x2e13('0x0'));exports['update']=function(_0x151220,_0x709f57){return client[_0x2e13('0x1')](_0x2e13('0x2'),{'body':_0x709f57,'options':{'where':{'id':_0x151220}},'log':_0x2e13('0x3')});};exports['addTags']=function(_0x1ae6a9,_0x3f01fe){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3f01fe,'options':{'where':{'id':_0x1ae6a9}},'log':_0x2e13('0x4')});}; \ No newline at end of file +var _0xe35c=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x45b964,_0x8be795){var _0x28efb2=function(_0x546dc9){while(--_0x546dc9){_0x45b964['push'](_0x45b964['shift']());}};_0x28efb2(++_0x8be795);}(_0xe35c,0x146));var _0xce35=function(_0x5b1aee,_0x5794c6){_0x5b1aee=_0x5b1aee-0x0;var _0x2cd8fa=_0xe35c[_0x5b1aee];return _0x2cd8fa;};'use strict';var client=require(_0xce35('0x0'));exports[_0xce35('0x1')]=function(_0x2acb85,_0x1041ae){return client[_0xce35('0x2')](_0xce35('0x3'),{'body':_0x1041ae,'options':{'where':{'id':_0x2acb85}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x17648a,_0x4a005b){return client[_0xce35('0x2')](_0xce35('0x4'),{'body':_0x4a005b,'options':{'where':{'id':_0x17648a}},'log':_0xce35('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 58138f6..8adceaf 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 _0xc9c7=['CreateSmsMessage','createSmsMessage','Request'];(function(_0x35ef7a,_0x2b3df3){var _0x3e1c56=function(_0x38b48f){while(--_0x38b48f){_0x35ef7a['push'](_0x35ef7a['shift']());}};_0x3e1c56(++_0x2b3df3);}(_0xc9c7,0x1a3));var _0x7c9c=function(_0x4eab14,_0x45f942){_0x4eab14=_0x4eab14-0x0;var _0x12f538=_0xc9c7[_0x4eab14];return _0x12f538;};'use strict';var client=require('../client');exports['create']=function(_0x4e1dc9){return client[_0x7c9c('0x0')](_0x7c9c('0x1'),{'body':_0x4e1dc9,'log':_0x7c9c('0x2')});}; \ No newline at end of file +var _0xa481=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x4e924a,_0x523aa1){var _0x41a6d9=function(_0x32969c){while(--_0x32969c){_0x4e924a['push'](_0x4e924a['shift']());}};_0x41a6d9(++_0x523aa1);}(_0xa481,0x143));var _0x1a48=function(_0x2c289f,_0x513491){_0x2c289f=_0x2c289f-0x0;var _0x4b3cf1=_0xa481[_0x2c289f];return _0x4b3cf1;};'use strict';var client=require(_0x1a48('0x0'));exports[_0x1a48('0x1')]=function(_0x335069){return client[_0x1a48('0x2')](_0x1a48('0x3'),{'body':_0x335069,'log':_0x1a48('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 2149225..a1e0e6b 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x360874,_0x40a146){var _0x2e5c49=function(_0x229a15){while(--_0x229a15){_0x360874['push'](_0x360874['shift']());}};_0x2e5c49(++_0x40a146);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x2952d3,_0x1152d0){var _0x1b20e4=function(_0x315375){while(--_0x315375){_0x2952d3['push'](_0x2952d3['shift']());}};_0x1b20e4(++_0x1152d0);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a2dc441..52d5232 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4239bd,_0x1f310b){var _0x21f061=function(_0xbe0bca){while(--_0xbe0bca){_0x4239bd['push'](_0x4239bd['shift']());}};_0x21f061(++_0x1f310b);}(_0x008c,0x188));var _0xc008=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0x008c[_0x43db86];return _0x27bda2;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x44c36f,_0x1f93f6){var _0x1e1c7a=function(_0x267646){while(--_0x267646){_0x44c36f['push'](_0x44c36f['shift']());}};_0x1e1c7a(++_0x1f93f6);}(_0x70e0,0x17b));var _0x070e=function(_0x424884,_0x1ed543){_0x424884=_0x424884-0x0;var _0x16fd32=_0x70e0[_0x424884];return _0x16fd32;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8db554c..d69fcce 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(_0x34caef,_0x433250){var _0x4b90a4=function(_0x4b9856){while(--_0x4b9856){_0x34caef['push'](_0x34caef['shift']());}};_0x4b90a4(++_0x433250);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x5791cf,_0x57be9d){var _0x47b073=function(_0x3e5974){while(--_0x3e5974){_0x5791cf['push'](_0x5791cf['shift']());}};_0x47b073(++_0x57be9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 66b273b..6bb23f0 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 _0x4873=['update','Request','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x39c236,_0x57e9f5){var _0x140762=function(_0xde216c){while(--_0xde216c){_0x39c236['push'](_0x39c236['shift']());}};_0x140762(++_0x57e9f5);}(_0x4873,0x1df));var _0x3487=function(_0x2d41fb,_0x2d82a2){_0x2d41fb=_0x2d41fb-0x0;var _0x339b8a=_0x4873[_0x2d41fb];return _0x339b8a;};'use strict';var client=require(_0x3487('0x0'));exports[_0x3487('0x1')]=function(_0x332e18,_0x4ca7ad){return client[_0x3487('0x2')]('UpdateWhatsappInteraction',{'body':_0x4ca7ad,'options':{'where':{'id':_0x332e18}},'log':'updateWhatsappInteraction'});};exports[_0x3487('0x3')]=function(_0xbc64e7,_0x54ff70){return client[_0x3487('0x2')](_0x3487('0x4'),{'body':_0x54ff70,'options':{'where':{'id':_0xbc64e7}},'log':_0x3487('0x5')});}; \ No newline at end of file +var _0xfc17=['Request','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x141453,_0x50213a){var _0x6a1657=function(_0x47a111){while(--_0x47a111){_0x141453['push'](_0x141453['shift']());}};_0x6a1657(++_0x50213a);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x208972,_0x27ccef){_0x208972=_0x208972-0x0;var _0x594d0b=_0xfc17[_0x208972];return _0x594d0b;};'use strict';var client=require(_0x7fc1('0x0'));exports[_0x7fc1('0x1')]=function(_0x29db51,_0x3de7bf){return client['Request'](_0x7fc1('0x2'),{'body':_0x3de7bf,'options':{'where':{'id':_0x29db51}},'log':_0x7fc1('0x3')});};exports[_0x7fc1('0x4')]=function(_0x1f6079,_0x44101d){return client[_0x7fc1('0x5')]('AddTagsToWhatsappInteraction',{'body':_0x44101d,'options':{'where':{'id':_0x1f6079}},'log':_0x7fc1('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6ae8f78..c264913 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 _0x0b71=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0b71,0xef));var _0x10b7=function(_0x29a4fb,_0x537211){_0x29a4fb=_0x29a4fb-0x0;var _0x20d5cf=_0x0b71[_0x29a4fb];return _0x20d5cf;};'use strict';var client=require(_0x10b7('0x0'));exports[_0x10b7('0x1')]=function(_0x588f66){return client[_0x10b7('0x2')](_0x10b7('0x3'),{'body':_0x588f66,'log':_0x10b7('0x4')});}; \ No newline at end of file +var _0x0641=['createWhatsappMessage','../client','create','Request'];(function(_0x3533c4,_0x29c304){var _0x3de17c=function(_0x182ab8){while(--_0x182ab8){_0x3533c4['push'](_0x3533c4['shift']());}};_0x3de17c(++_0x29c304);}(_0x0641,0x1c5));var _0x1064=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0x0641[_0x41930d];return _0x455ade;};'use strict';var client=require(_0x1064('0x0'));exports[_0x1064('0x1')]=function(_0x39b46d){return client[_0x1064('0x2')]('CreateWhatsappMessage',{'body':_0x39b46d,'log':_0x1064('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f1fea78..e517154 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 _0x3b3f=['getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','../client'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x3b3f,0x77));var _0xf3b3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3b3f[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0xf3b3('0x0'));exports[_0xf3b3('0x1')]=function(){return function(){return client[_0xf3b3('0x2')](_0xf3b3('0x3'),{'options':{'raw':![],'attributes':['id',_0xf3b3('0x4'),'timeout',_0xf3b3('0x5')],'include':[{'model':_0xf3b3('0x6'),'as':_0xf3b3('0x7'),'attributes':['id',_0xf3b3('0x4'),_0xf3b3('0x8'),_0xf3b3('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xd28c=['Request','GetWhatsappQueue','name','timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x1d30e4,_0x5e44c7){var _0x416b9e=function(_0x461f04){while(--_0x461f04){_0x1d30e4['push'](_0x1d30e4['shift']());}};_0x416b9e(++_0x5e44c7);}(_0xd28c,0x1d4));var _0xcd28=function(_0xe10627,_0x3a236b){_0xe10627=_0xe10627-0x0;var _0x333537=_0xd28c[_0xe10627];return _0x333537;};'use strict';var client=require(_0xcd28('0x0'));exports[_0xcd28('0x1')]=function(){return function(){return client[_0xcd28('0x2')](_0xcd28('0x3'),{'options':{'raw':![],'attributes':['id',_0xcd28('0x4'),_0xcd28('0x5'),'strategy'],'include':[{'model':_0xcd28('0x6'),'as':_0xcd28('0x7'),'attributes':['id',_0xcd28('0x4'),_0xcd28('0x8'),_0xcd28('0x9')]}]},'log':_0xcd28('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 56918cd..19917ea 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 _0xa8a1=['create','Request','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1d74b4,_0xa4ed99){var _0x4857f0=function(_0x279516){while(--_0x279516){_0x1d74b4['push'](_0x1d74b4['shift']());}};_0x4857f0(++_0xa4ed99);}(_0xa8a1,0x1d9));var _0x1a8a=function(_0x523e06,_0x7c7dda){_0x523e06=_0x523e06-0x0;var _0x2ae22c=_0xa8a1[_0x523e06];return _0x2ae22c;};'use strict';var client=require(_0x1a8a('0x0'));exports[_0x1a8a('0x1')]=function(_0x5216cb){return client[_0x1a8a('0x2')]('CreateWhatsappQueueReport',{'body':_0x5216cb,'log':'CreateWhatsappQueueReport'});};exports[_0x1a8a('0x3')]=function(_0x3f6fad,_0x421404){return client['Request'](_0x1a8a('0x4'),{'body':_0x421404,'options':{'where':{'uniqueid':_0x3f6fad},'order':[['id',_0x1a8a('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x7746=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x7746,0xc7));var _0x6774=function(_0x502905,_0x1ab50a){_0x502905=_0x502905-0x0;var _0xfcdbbe=_0x7746[_0x502905];return _0xfcdbbe;};'use strict';var client=require(_0x6774('0x0'));exports[_0x6774('0x1')]=function(_0x20c5d4){return client[_0x6774('0x2')](_0x6774('0x3'),{'body':_0x20c5d4,'log':_0x6774('0x3')});};exports[_0x6774('0x4')]=function(_0x907226,_0x3be2b5){return client['Request'](_0x6774('0x5'),{'body':_0x3be2b5,'options':{'where':{'uniqueid':_0x907226},'order':[['id',_0x6774('0x6')]],'limit':0x1},'log':_0x6774('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 d05b329..6200701 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 _0x74bd=['lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','format','rules','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate'];(function(_0x5c76ac,_0x28211a){var _0x345ae4=function(_0x7685e5){while(--_0x7685e5){_0x5c76ac['push'](_0x5c76ac['shift']());}};_0x345ae4(++_0x28211a);}(_0x74bd,0x131));var _0xd74b=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x74bd[_0x7538c5];return _0x8b56be;};'use strict';var schema=require(_0xd74b('0x0'));var _=require(_0xd74b('0x1'));var util=require(_0xd74b('0x2'));var seqqueue=require(_0xd74b('0x3'));var logger=require(_0xd74b('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xd74b('0x5')},'timeout':{'type':'number','message':_0xd74b('0x6')}});function writeLog(_0x16fb58,_0x251dd8,_0x190d8c){return logger[_0xd74b('0x7')](util['format'](_0xd74b('0x8'),_0x16fb58,_0x251dd8['name'],_0x190d8c));}function handleFindAgent(_0x1b4d2e){return function(_0x24e61f){return _0x24e61f[_0xd74b('0x9')][_0xd74b('0xa')]()===_0x1b4d2e[_0xd74b('0xa')]();};}exports[_0xd74b('0xb')]=function(_0x38d516,_0x5223ab,_0x51c41f,_0xa4541){return function(_0x33ee5e){try{var _0x273772={'name':_0x5223ab[0x0],'timeout':_0x5223ab[0x1]};var _0x210f0d=queue[_0xd74b('0x0')](_0x273772,{'typecast':!![]});if(_0x210f0d[_0xd74b('0xc')]){logger[_0xd74b('0xd')](_0xd74b('0xe'),_0x38d516,_[_0xd74b('0xf')](_0x210f0d,_0xd74b('0x10'))[_0xd74b('0x11')](',\x20'));_0x33ee5e[_0xd74b('0x12')]();}else{var _0x2fcf4e=_[_0xd74b('0x13')](_0x51c41f[_0xd74b('0x14')],handleFindAgent(_0x273772['name']));if(_0x2fcf4e){var _0x11ae1b=(_0x273772[_0xd74b('0x15')]||0xa)*0x3e8;var _0x26cce8,_0x4d9601;var _0x2cb301=seqqueue['createQueue'](_0x11ae1b);_0x2cb301['id']=_0x38d516;_0x2cb301[_0xd74b('0x16')]=_0x11ae1b;_0x2cb301[_0xd74b('0x17')]=_0xa4541[_0xd74b('0x17')];writeLog(_0x38d516,_0x2fcf4e,util[_0xd74b('0x18')]('START:%s',_0x11ae1b));_0x51c41f[_0xd74b('0x19')][_0x38d516]['on']('end',function(){logger[_0xd74b('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x38d516);clearTimeout(_0x4d9601);_0x4d9601=undefined;_0x2cb301[_0xd74b('0x1a')]();if(_0x51c41f[_0xd74b('0x19')][_0x38d516]){delete _0x51c41f[_0xd74b('0x19')][_0x38d516];}_0x33ee5e[_0xd74b('0x12')]();});_0x51c41f[_0xd74b('0x19')][_0x38d516]['on'](_0xd74b('0x1b'),function(){if(_0x51c41f[_0xd74b('0x19')][_0x38d516]){delete _0x51c41f['rules'][_0x38d516];}});_0x4d9601=setTimeout(function(){logger[_0xd74b('0x7')](_0xd74b('0x1c'),_0x38d516);clearTimeout(_0x4d9601);_0x2cb301['close']();_0x33ee5e['next']();},_0x11ae1b);strategy[_0xd74b('0x1d')](_0x2cb301,_0x2fcf4e,_0x51c41f,_0xa4541);}else{logger[_0xd74b('0xd')](_0xd74b('0x1e'),_0x38d516,_0x273772[_0xd74b('0x9')]);_0x33ee5e['stop']();}}}catch(_0x203f08){console[_0xd74b('0x1f')](_0x203f08);logger['error'](_0xd74b('0x20'),_0x38d516,_0x203f08[_0xd74b('0x21')]);_0x33ee5e[_0xd74b('0x12')]();}};}; \ No newline at end of file +var _0x8920=['consequence','length','[%s][AGENT]\x20%s','map','message','find','timeout','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue','../../../../config/logger','./strategy','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase'];(function(_0xed1e68,_0x4bf5de){var _0x1eeb67=function(_0x4061ec){while(--_0x4061ec){_0xed1e68['push'](_0xed1e68['shift']());}};_0x1eeb67(++_0x4bf5de);}(_0x8920,0xf6));var _0x0892=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8920[_0x5b644e];return _0x49c6bf;};'use strict';var schema=require(_0x0892('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x0892('0x1'));var logger=require(_0x0892('0x2'))('routing');var strategy=require(_0x0892('0x3'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0892('0x4'),'message':_0x0892('0x5')}});function writeLog(_0x3ae923,_0x2638af,_0x23e593){return logger[_0x0892('0x6')](util[_0x0892('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x3ae923,_0x2638af[_0x0892('0x8')],_0x23e593));}function handleFindAgent(_0x12aedd){return function(_0x6e242d){return _0x6e242d[_0x0892('0x8')][_0x0892('0x9')]()===_0x12aedd[_0x0892('0x9')]();};}exports[_0x0892('0xa')]=function(_0x43c16b,_0x296e61,_0x2c2c53,_0x563b3d){return function(_0x149a04){try{var _0x138157={'name':_0x296e61[0x0],'timeout':_0x296e61[0x1]};var _0x58903f=queue[_0x0892('0x0')](_0x138157,{'typecast':!![]});if(_0x58903f[_0x0892('0xb')]){logger['error'](_0x0892('0xc'),_0x43c16b,_[_0x0892('0xd')](_0x58903f,_0x0892('0xe'))['join'](',\x20'));_0x149a04['stop']();}else{var _0x3717a6=_[_0x0892('0xf')](_0x2c2c53['agents'],handleFindAgent(_0x138157[_0x0892('0x8')]));if(_0x3717a6){var _0x3b8910=(_0x138157[_0x0892('0x10')]||0xa)*0x3e8;var _0x2c6e24,_0xb734cc;var _0x7f79b0=seqqueue['createQueue'](_0x3b8910);_0x7f79b0['id']=_0x43c16b;_0x7f79b0[_0x0892('0x11')]=_0x3b8910;_0x7f79b0['channel']=_0x563b3d[_0x0892('0x12')];writeLog(_0x43c16b,_0x3717a6,util[_0x0892('0x7')]('START:%s',_0x3b8910));_0x2c2c53[_0x0892('0x13')][_0x43c16b]['on'](_0x0892('0x14'),function(){logger[_0x0892('0x6')](_0x0892('0x15'),_0x43c16b);clearTimeout(_0xb734cc);_0xb734cc=undefined;_0x7f79b0[_0x0892('0x16')]();if(_0x2c2c53[_0x0892('0x13')][_0x43c16b]){delete _0x2c2c53[_0x0892('0x13')][_0x43c16b];}_0x149a04[_0x0892('0x17')]();});_0x2c2c53[_0x0892('0x13')][_0x43c16b]['on']('complete',function(){if(_0x2c2c53[_0x0892('0x13')][_0x43c16b]){delete _0x2c2c53['rules'][_0x43c16b];}});_0xb734cc=setTimeout(function(){logger[_0x0892('0x6')](_0x0892('0x18'),_0x43c16b);clearTimeout(_0xb734cc);_0x7f79b0['close']();_0x149a04[_0x0892('0x19')]();},_0x3b8910);strategy[_0x0892('0x1a')](_0x7f79b0,_0x3717a6,_0x2c2c53,_0x563b3d);}else{logger[_0x0892('0x1b')](_0x0892('0x1c'),_0x43c16b,_0x138157[_0x0892('0x8')]);_0x149a04[_0x0892('0x17')]();}}}catch(_0x100d3b){console[_0x0892('0x1d')](_0x100d3b);logger['error'](_0x0892('0x1e'),_0x43c16b,_0x100d3b[_0x0892('0x1f')]);_0x149a04['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index b549443..061a396 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 _0xd186=['isEmpty','body','getMustacheRender','Message','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','providerName','amazonlex','then','dialogState','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created'];(function(_0x23a51b,_0x49f2b0){var _0x9e31c=function(_0x573151){while(--_0x573151){_0x23a51b['push'](_0x23a51b['shift']());}};_0x9e31c(++_0x49f2b0);}(_0xd186,0xd8));var _0x6d18=function(_0x1e9606,_0x53ade4){_0x1e9606=_0x1e9606-0x0;var _0x26319d=_0xd186[_0x1e9606];return _0x26319d;};'use strict';var _=require(_0x6d18('0x0'));var moment=require(_0x6d18('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6d18('0x2'));var logger=require(_0x6d18('0x3'))(_0x6d18('0x4'));var rpc={'chatMessage':require(_0x6d18('0x5')),'openchannelMessage':require(_0x6d18('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6d18('0x7')),'faxMessage':require(_0x6d18('0x8')),'whatsappMessage':require(_0x6d18('0x9'))};exports[_0x6d18('0xa')]=function(_0x42194b,_0x552516){return function(_0x53df51){try{if(!_['isNil'](this[_0x6d18('0xb')][_0x6d18('0xc')])){logger[_0x6d18('0xd')](_0x6d18('0xe'),_0x42194b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x53df51[_0x6d18('0xf')]();}var _0x50f666={'ContactId':this[_0x6d18('0x10')]['id'],'sentAt':moment()[_0x6d18('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x6d18('0x12')]===_0x6d18('0x13')||this[_0x6d18('0x12')]===_0x6d18('0x14')){_0x50f666[_0x6d18('0x15')]=this[_0x6d18('0xb')]['phone'];}var _0x428aea=this['channel'];if(_0x428aea===_0x6d18('0x16')){_0x50f666[_0x6d18('0x17')]=this[_0x6d18('0x18')]['id'];}else{_0x50f666[_[_0x6d18('0x19')](_0x428aea)+_0x6d18('0x1a')]=this[_0x6d18('0x18')]['id'];}_0x50f666[_[_0x6d18('0x19')](_0x428aea)+_0x6d18('0x1b')]=this[_0x6d18('0xb')]['id'];if(this['interaction'][_0x6d18('0x1c')]){var _0x121d62=_0x552516[0x4];if(!_[_0x6d18('0x1d')](_0x121d62)){_0x50f666[_0x6d18('0x1e')]=utils[_0x6d18('0x1f')](_0x121d62,this);return rpc[_0x428aea+_0x6d18('0x20')][_0x6d18('0x21')](_0x50f666)['then'](function(_0x210d37){logger['info'](_0x6d18('0xe'),_0x42194b,_0x50f666[_0x6d18('0x1e')]);})[_0x6d18('0x22')](function(_0x10fcf4){logger[_0x6d18('0x23')](_0x6d18('0xe'),_0x42194b,JSON[_0x6d18('0x24')](_0x10fcf4));})[_0x6d18('0x25')](function(){logger[_0x6d18('0xd')](_0x6d18('0x26'),_0x42194b);_0x53df51[_0x6d18('0x27')]();});}else{logger[_0x6d18('0xd')](_0x6d18('0x28'),_0x42194b);_0x53df51[_0x6d18('0x27')]();}}else{var _0x2b8975=this;var _0x2449ac=new AWS[(_0x6d18('0x29'))]({'accessKeyId':_0x552516[0x0],'secretAccessKey':_0x552516[0x1],'region':_0x552516[0x2]});var _0xdc83a5={'botAlias':_0x6d18('0x2a'),'botName':_0x552516[0x3],'inputText':this['message'][_0x6d18('0x1e')],'userId':this[_0x6d18('0x12')]+':'+this['interaction']['id']['toString']()};_0x2449ac[_0x6d18('0x2b')](_0xdc83a5,function(_0x206b30,_0x3e8b43){if(_0x206b30){logger[_0x6d18('0x23')](_0x6d18('0xe'),_0x42194b,_0x206b30[_0x6d18('0x2c')]);_0x53df51[_0x6d18('0xf')]();}else if(_0x3e8b43&&_0x3e8b43['message']){_0x2b8975[_0x6d18('0x1e')]['amazonlex']=_0x3e8b43;_0x50f666[_0x6d18('0x1e')]=_0x3e8b43[_0x6d18('0x2c')];_0x50f666[_0x6d18('0x2d')]=_0x6d18('0x2e');_0x50f666['providerResponse']=JSON['stringify'](_0x3e8b43);return rpc[_0x428aea+_0x6d18('0x20')]['create'](_0x50f666)[_0x6d18('0x2f')](function(_0x4ffc4e){logger['info'](_0x6d18('0xe'),_0x42194b,_0x50f666['body']);if(_0x3e8b43[_0x6d18('0x30')]=='Failed'){_0x53df51['next']();}else{_0x53df51[_0x6d18('0x27')]();}})[_0x6d18('0x22')](function(_0x598237){logger[_0x6d18('0x23')](_0x6d18('0xe'),_0x42194b,JSON[_0x6d18('0x24')](_0x598237));_0x53df51['next']();});}else{_0x53df51['next']();}});}}catch(_0x321523){logger[_0x6d18('0x23')](_0x6d18('0xe'),_0x42194b,JSON['stringify'](_0x321523));_0x53df51[_0x6d18('0x27')]();}};}; \ No newline at end of file +var _0xbeed=['message','postText','amazonlex','providerName','providerResponse','dialogState','catch','stringify','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','chat','account','upperFirst','AccountId','created','isEmpty','body','Message','create','then','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST'];(function(_0x3fc49f,_0x310514){var _0x438502=function(_0x5c5c4d){while(--_0x5c5c4d){_0x3fc49f['push'](_0x3fc49f['shift']());}};_0x438502(++_0x310514);}(_0xbeed,0x1f2));var _0xdbee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbeed[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdbee('0x0'));var moment=require(_0xdbee('0x1'));var AWS=require(_0xdbee('0x2'));var utils=require(_0xdbee('0x3'));var logger=require(_0xdbee('0x4'))(_0xdbee('0x5'));var rpc={'chatMessage':require(_0xdbee('0x6')),'openchannelMessage':require(_0xdbee('0x7')),'mailMessage':require(_0xdbee('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdbee('0x9')),'whatsappMessage':require(_0xdbee('0xa'))};exports[_0xdbee('0xb')]=function(_0x42576f,_0x4b5c99){return function(_0x41fdf1){try{if(!_[_0xdbee('0xc')](this[_0xdbee('0xd')][_0xdbee('0xe')])){logger[_0xdbee('0xf')](_0xdbee('0x10'),_0x42576f,_0xdbee('0x11'));return _0x41fdf1[_0xdbee('0x12')]();}var _0x35fe0b={'ContactId':this[_0xdbee('0x13')]['id'],'sentAt':moment()[_0xdbee('0x14')](_0xdbee('0x15')),'direction':_0xdbee('0x16')};if(this[_0xdbee('0x17')]==='sms'||this[_0xdbee('0x17')]===_0xdbee('0x18')){_0x35fe0b['phone']=this[_0xdbee('0xd')]['phone'];}var _0x449bf3=this[_0xdbee('0x17')];if(_0x449bf3===_0xdbee('0x19')){_0x35fe0b['ChatWebsiteId']=this[_0xdbee('0x1a')]['id'];}else{_0x35fe0b[_[_0xdbee('0x1b')](_0x449bf3)+_0xdbee('0x1c')]=this[_0xdbee('0x1a')]['id'];}_0x35fe0b[_[_0xdbee('0x1b')](_0x449bf3)+'InteractionId']=this[_0xdbee('0xd')]['id'];if(this[_0xdbee('0xd')][_0xdbee('0x1d')]){var _0x1f159d=_0x4b5c99[0x4];if(!_[_0xdbee('0x1e')](_0x1f159d)){_0x35fe0b[_0xdbee('0x1f')]=utils['getMustacheRender'](_0x1f159d,this);return rpc[_0x449bf3+_0xdbee('0x20')][_0xdbee('0x21')](_0x35fe0b)[_0xdbee('0x22')](function(_0x15f22e){logger['info']('[%s][AMAZONLEX]\x20%s',_0x42576f,_0x35fe0b[_0xdbee('0x1f')]);})['catch'](function(_0x1a3879){logger[_0xdbee('0x23')](_0xdbee('0x10'),_0x42576f,JSON['stringify'](_0x1a3879));})['finally'](function(){logger[_0xdbee('0xf')](_0xdbee('0x24'),_0x42576f);_0x41fdf1['stop']();});}else{logger[_0xdbee('0xf')](_0xdbee('0x25'),_0x42576f);_0x41fdf1[_0xdbee('0x26')]();}}else{var _0x7aaf7=this;var _0x5c452c=new AWS[(_0xdbee('0x27'))]({'accessKeyId':_0x4b5c99[0x0],'secretAccessKey':_0x4b5c99[0x1],'region':_0x4b5c99[0x2]});var _0x264572={'botAlias':_0xdbee('0x28'),'botName':_0x4b5c99[0x3],'inputText':this[_0xdbee('0x29')][_0xdbee('0x1f')],'userId':this[_0xdbee('0x17')]+':'+this[_0xdbee('0xd')]['id']['toString']()};_0x5c452c[_0xdbee('0x2a')](_0x264572,function(_0x347f5d,_0x1c483a){if(_0x347f5d){logger[_0xdbee('0x23')](_0xdbee('0x10'),_0x42576f,_0x347f5d[_0xdbee('0x29')]);_0x41fdf1[_0xdbee('0x12')]();}else if(_0x1c483a&&_0x1c483a[_0xdbee('0x29')]){_0x7aaf7[_0xdbee('0x1f')][_0xdbee('0x2b')]=_0x1c483a;_0x35fe0b[_0xdbee('0x1f')]=_0x1c483a['message'];_0x35fe0b[_0xdbee('0x2c')]=_0xdbee('0x2b');_0x35fe0b[_0xdbee('0x2d')]=JSON['stringify'](_0x1c483a);return rpc[_0x449bf3+_0xdbee('0x20')][_0xdbee('0x21')](_0x35fe0b)[_0xdbee('0x22')](function(_0x1e883c){logger['info'](_0xdbee('0x10'),_0x42576f,_0x35fe0b[_0xdbee('0x1f')]);if(_0x1c483a[_0xdbee('0x2e')]=='Failed'){_0x41fdf1['next']();}else{_0x41fdf1[_0xdbee('0x26')]();}})[_0xdbee('0x2f')](function(_0x59f68f){logger['error']('[%s][AMAZONLEX]\x20%s',_0x42576f,JSON[_0xdbee('0x30')](_0x59f68f));_0x41fdf1[_0xdbee('0x12')]();});}else{_0x41fdf1[_0xdbee('0x12')]();}});}}catch(_0x16b72e){logger[_0xdbee('0x23')](_0xdbee('0x10'),_0x42576f,JSON['stringify'](_0x16b72e));_0x41fdf1[_0xdbee('0x26')]();}};}; \ 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 bf9699c..3b19553 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 _0x4a01=['autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','html','replace','','headers','auto-replied','All','auto_reply','then','messageId','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve'];(function(_0x49dd26,_0x9e5a5d){var _0x45f549=function(_0x8a8d93){while(--_0x8a8d93){_0x49dd26['push'](_0x49dd26['shift']());}};_0x45f549(++_0x9e5a5d);}(_0x4a01,0x131));var _0x14a0=function(_0x518458,_0x5059e9){_0x518458=_0x518458-0x0;var _0x3d775d=_0x4a01[_0x518458];return _0x3d775d;};'use strict';var _=require('lodash');var moment=require(_0x14a0('0x0'));var utils=require(_0x14a0('0x1'));var logger=require(_0x14a0('0x2'))(_0x14a0('0x3'));var rpc={'chatMessage':require(_0x14a0('0x4')),'openchannelMessage':require(_0x14a0('0x5')),'mailMessage':require(_0x14a0('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x14a0('0x7')),'chatInteraction':require(_0x14a0('0x8')),'openchannelInteraction':require(_0x14a0('0x9')),'mailInteraction':require(_0x14a0('0xa')),'smsInteraction':require(_0x14a0('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x14a0('0xc'))};var mailRpc=require(_0x14a0('0xd'));exports[_0x14a0('0xe')]=function(_0x3b31f7,_0x315892,_0x392de1,_0x5531cb){return function(_0x1bbefd){try{var _0x48203f=this[_0x14a0('0xf')];if(_0x48203f===_0x14a0('0x10')&&_0x5531cb[_0x14a0('0x11')][_0x14a0('0x12')]){logger[_0x14a0('0x13')](_0x14a0('0x14'),_0x3b31f7,_0x14a0('0x15'));return _0x1bbefd[_0x14a0('0x16')]();}if(_0x315892[0x0]==='1'&&(_[_0x14a0('0x17')](this['interaction'][_0x14a0('0x18')])||!this[_0x14a0('0x19')]['created'])){logger[_0x14a0('0x13')](_0x14a0('0x14'),_0x3b31f7,'Autoreply\x20already\x20sent');return _0x1bbefd['next']();}if(_0x315892[0x0]==='2'&&this[_0x14a0('0x19')]['autoreplyExecuted']){logger[_0x14a0('0x13')](_0x14a0('0x1a'),_0x3b31f7,_0x14a0('0x1b'));return _0x1bbefd['next']();}var _0x8a18f9={'ContactId':this['contact']['id'],'sentAt':moment()[_0x14a0('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x14a0('0x1d')};if(this[_0x14a0('0xf')]===_0x14a0('0x10')){_0x8a18f9[_0x14a0('0x11')]=utils[_0x14a0('0x1e')](_0x315892[0x2],this);}else{_0x8a18f9['body']=utils[_0x14a0('0x1e')](_0x315892[0x1],this);}if(this[_0x14a0('0x1f')]){_0x8a18f9['to']=this[_0x14a0('0x1f')][_0x14a0('0x20')]||'';if(this['channel']===_0x14a0('0x10')&&_0x315892[0x1]==='1'){_0x8a18f9['cc']=this['message']['cc']||'';}_0x8a18f9[_0x14a0('0x20')]=this[_0x14a0('0x1f')]['to']||'';_0x8a18f9[_0x14a0('0x21')]=this[_0x14a0('0x1f')]['phone']||'';_0x8a18f9[_0x14a0('0x22')]=!![];if(this[_0x14a0('0x1f')]['subject']){_0x8a18f9[_0x14a0('0x23')]='';_0x8a18f9[_0x14a0('0x23')]+=_[_0x14a0('0x24')](this[_0x14a0('0x1f')][_0x14a0('0x23')],'Re:')?'':_0x14a0('0x25');_0x8a18f9[_0x14a0('0x23')]+=this[_0x14a0('0x1f')][_0x14a0('0x23')];}}if(this['channel']==='chat'){_0x8a18f9[_0x14a0('0x26')]=this[_0x14a0('0x27')]['id'];}else{_0x8a18f9[_[_0x14a0('0x28')](this[_0x14a0('0xf')])+_0x14a0('0x29')]=this['account']['id'];}_0x8a18f9[_[_0x14a0('0x28')](this[_0x14a0('0xf')])+'InteractionId']=this[_0x14a0('0x19')]['id'];var _0x16a044=this[_0x14a0('0x19')];if(rpc[this[_0x14a0('0xf')]+'Message']){if(this[_0x14a0('0xf')]===_0x14a0('0x10')){var _0xbcfc2c={'tls':{'rejectUnauthorized':![]}};if(this[_0x14a0('0x27')][_0x14a0('0x2a')][_0x14a0('0x2b')]){_0xbcfc2c[_0x14a0('0x2b')]=this[_0x14a0('0x27')][_0x14a0('0x2a')][_0x14a0('0x2b')];}else{_0xbcfc2c[_0x14a0('0x2c')]=this[_0x14a0('0x27')][_0x14a0('0x2a')][_0x14a0('0x2c')];_0xbcfc2c[_0x14a0('0x2d')]=this[_0x14a0('0x27')][_0x14a0('0x2a')][_0x14a0('0x2d')];_0xbcfc2c[_0x14a0('0x2e')]=this['account'][_0x14a0('0x2a')]['secure'];}if(this['account'][_0x14a0('0x2a')][_0x14a0('0x2f')]){_0xbcfc2c[_0x14a0('0x30')]={'user':this['account'][_0x14a0('0x2a')][_0x14a0('0x31')],'pass':this['account']['Smtp']['pass']};}_0x8a18f9[_0x14a0('0x32')]=this[_0x14a0('0x1f')]['messageId'];_0x8a18f9[_0x14a0('0x33')]=''+_[_0x14a0('0x34')](_0x8a18f9[_0x14a0('0x11')],_0x14a0('0x35'),_0x14a0('0x36'))+_0x14a0('0x37');_0x8a18f9[_0x14a0('0x38')]={'Auto-Submitted':_0x14a0('0x39'),'X-Auto-Response-Suppress':_0x14a0('0x3a'),'Precedence':_0x14a0('0x3b')};return mailRpc['sendMailMessage'](_0xbcfc2c,_0x8a18f9)[_0x14a0('0x3c')](function(_0x1c9465){logger[_0x14a0('0x13')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3b31f7);_0x8a18f9[_0x14a0('0x3d')]=_0x1c9465['message']['messageId'];return rpc[_0x48203f+_0x14a0('0x3e')][_0x14a0('0x3f')](_0x8a18f9);})['then'](function(_0x15e02f){logger[_0x14a0('0x13')](_0x14a0('0x14'),_0x3b31f7,JSON[_0x14a0('0x40')](_0x15e02f));})[_0x14a0('0x41')](function(_0x107e13){logger[_0x14a0('0x42')](_0x14a0('0x43'),_0x3b31f7,JSON[_0x14a0('0x40')](_0x107e13));})[_0x14a0('0x44')](function(){Promise[_0x14a0('0x45')]()[_0x14a0('0x3c')](function(){if(_0x315892[0x0]!=='2'||_0x16a044[_0x14a0('0x46')])return;return rpc[_0x48203f+'Interaction'][_0x14a0('0x47')](_0x16a044['id'],{'autoreplyExecuted':!![]})[_0x14a0('0x3c')](function(_0x1a0c1f){logger[_0x14a0('0x13')](_0x14a0('0x1a'),_0x3b31f7,JSON[_0x14a0('0x40')](_0x1a0c1f));})['catch'](function(_0xc8ae0b){logger[_0x14a0('0x42')](_0x14a0('0x48'),_0x3b31f7,JSON[_0x14a0('0x40')](_0xc8ae0b));});})['then'](function(){_0x1bbefd[_0x14a0('0x16')]();});});}else{return rpc[this['channel']+_0x14a0('0x3e')]['create'](_0x8a18f9)[_0x14a0('0x3c')](function(_0x5aa541){logger[_0x14a0('0x13')](_0x14a0('0x14'),_0x3b31f7,_0x8a18f9['body']);})[_0x14a0('0x41')](function(_0x3d102b){logger[_0x14a0('0x42')](_0x14a0('0x14'),_0x3b31f7,JSON[_0x14a0('0x40')](_0x3d102b));})[_0x14a0('0x44')](function(){Promise[_0x14a0('0x45')]()[_0x14a0('0x3c')](function(){if(_0x315892[0x0]!=='2'||_0x16a044['autoreplyExecuted'])return;return rpc[_0x48203f+_0x14a0('0x49')][_0x14a0('0x47')](_0x16a044['id'],{'autoreplyExecuted':!![]})[_0x14a0('0x3c')](function(_0x495e90){logger[_0x14a0('0x13')](_0x14a0('0x1a'),_0x3b31f7,JSON[_0x14a0('0x40')](_0x495e90));})[_0x14a0('0x41')](function(_0xca288e){logger['error'](_0x14a0('0x48'),_0x3b31f7,JSON['stringify'](_0xca288e));});})[_0x14a0('0x3c')](function(){_0x1bbefd[_0x14a0('0x16')]();});});}}}catch(_0x45d297){logger[_0x14a0('0x42')]('[%s][AUTOREPLY]\x20%s',_0x3b31f7,JSON[_0x14a0('0x40')](_0x45d297));_0x1bbefd[_0x14a0('0x4a')]();}};}; \ No newline at end of file +var _0xe38e=['chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','service','host','port','Smtp','secure','authentication','auth','pass','html','','';_0x40c160[_0xee38('0x3a')]={'Auto-Submitted':_0xee38('0x3b'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0xee38('0x3c')](_0x1e23cf,_0x40c160)[_0xee38('0x3d')](function(_0x4671a6){logger['info'](_0xee38('0x3e'),_0x4b0649);_0x40c160['messageId']=_0x4671a6['message'][_0xee38('0x3f')];return rpc[_0x1a67ac+_0xee38('0x2d')]['create'](_0x40c160);})['then'](function(_0x3f34f8){logger[_0xee38('0x14')](_0xee38('0x18'),_0x4b0649,JSON['stringify'](_0x3f34f8));})[_0xee38('0x40')](function(_0x5a4b43){logger[_0xee38('0x41')](_0xee38('0x42'),_0x4b0649,JSON[_0xee38('0x43')](_0x5a4b43));})[_0xee38('0x44')](function(){Promise[_0xee38('0x45')]()['then'](function(){if(_0x1f7bca[0x0]!=='2'||_0x3f234b[_0xee38('0x46')])return;return rpc[_0x1a67ac+_0xee38('0x47')][_0xee38('0x48')](_0x3f234b['id'],{'autoreplyExecuted':!![]})[_0xee38('0x3d')](function(_0x414cdd){logger[_0xee38('0x14')](_0xee38('0x1a'),_0x4b0649,JSON[_0xee38('0x43')](_0x414cdd));})['catch'](function(_0x5d86dc){logger[_0xee38('0x41')](_0xee38('0x49'),_0x4b0649,JSON['stringify'](_0x5d86dc));});})[_0xee38('0x3d')](function(){_0x50edd8[_0xee38('0x19')]();});});}else{return rpc[this[_0xee38('0x10')]+'Message'][_0xee38('0x4a')](_0x40c160)[_0xee38('0x3d')](function(_0x10dbb0){logger[_0xee38('0x14')](_0xee38('0x18'),_0x4b0649,_0x40c160[_0xee38('0x12')]);})[_0xee38('0x40')](function(_0xa2e8bb){logger[_0xee38('0x41')](_0xee38('0x18'),_0x4b0649,JSON[_0xee38('0x43')](_0xa2e8bb));})['finally'](function(){Promise[_0xee38('0x45')]()[_0xee38('0x3d')](function(){if(_0x1f7bca[0x0]!=='2'||_0x3f234b[_0xee38('0x46')])return;return rpc[_0x1a67ac+'Interaction'][_0xee38('0x48')](_0x3f234b['id'],{'autoreplyExecuted':!![]})[_0xee38('0x3d')](function(_0x1ea44e){logger[_0xee38('0x14')](_0xee38('0x1a'),_0x4b0649,JSON['stringify'](_0x1ea44e));})['catch'](function(_0x138d3c){logger['error'](_0xee38('0x49'),_0x4b0649,JSON[_0xee38('0x43')](_0x138d3c));});})[_0xee38('0x3d')](function(){_0x50edd8[_0xee38('0x19')]();});});}}}catch(_0x5e98ef){logger[_0xee38('0x41')](_0xee38('0x18'),_0x4b0649,JSON[_0xee38('0x43')](_0x5e98ef));_0x50edd8[_0xee38('0x4b')]();}};}; \ 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 6bcc6ae..3ded22c 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 _0xbf43=['../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf43,0x107));var _0x3bf4=function(_0x134776,_0xeeac10){_0x134776=_0x134776-0x0;var _0x142ccc=_0xbf43[_0x134776];return _0x142ccc;};'use strict';var moment=require(_0x3bf4('0x0'));var logger=require(_0x3bf4('0x1'))('routing');var rpc={'chatInteraction':require(_0x3bf4('0x2')),'openchannelInteraction':require(_0x3bf4('0x3')),'smsInteraction':require(_0x3bf4('0x4')),'mailInteraction':require(_0x3bf4('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x3bf4('0x6'))};exports[_0x3bf4('0x7')]=function(_0x152b9c,_0x5a3c36,_0x500c11,_0x117f55){return function(_0x4a250d){try{logger[_0x3bf4('0x8')](_0x3bf4('0x9'),_0x152b9c,_0x5a3c36[0x0]);var _0x3abb6b={'closed':0x1,'closedAt':moment()[_0x3bf4('0xa')](_0x3bf4('0xb')),'closeReason':_0x3bf4('0xc'),'disposition':_0x5a3c36[0x0]};if(rpc[_0x117f55[_0x3bf4('0xd')]+_0x3bf4('0xe')]){rpc[_0x117f55[_0x3bf4('0xd')]+_0x3bf4('0xe')][_0x3bf4('0xf')](_0x117f55['interaction']['id'],_0x3abb6b)[_0x3bf4('0x10')](function(_0x7260d1){logger[_0x3bf4('0x8')](_0x3bf4('0x11'),_0x152b9c,_0x117f55[_0x3bf4('0x12')]['id']);})[_0x3bf4('0x13')](function(_0x4d7e75){logger[_0x3bf4('0x14')](_0x3bf4('0x15'),_0x152b9c,JSON[_0x3bf4('0x16')](_0x4d7e75));})['finally'](function(){_0x4a250d[_0x3bf4('0x17')]();});}}catch(_0x49a63b){logger[_0x3bf4('0x14')](_0x3bf4('0x15'),_0x152b9c,JSON[_0x3bf4('0x16')](_0x49a63b));_0x4a250d[_0x3bf4('0x17')]();}};}; \ No newline at end of file +var _0xcc85=['interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','finally','stop','error','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update'];(function(_0x5c5e0b,_0x305609){var _0x36f2cf=function(_0x170cb6){while(--_0x170cb6){_0x5c5e0b['push'](_0x5c5e0b['shift']());}};_0x36f2cf(++_0x305609);}(_0xcc85,0x183));var _0x5cc8=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0xcc85[_0xb875ee];return _0x4c7f3a;};'use strict';var moment=require('moment');var logger=require(_0x5cc8('0x0'))(_0x5cc8('0x1'));var rpc={'chatInteraction':require(_0x5cc8('0x2')),'openchannelInteraction':require(_0x5cc8('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x5cc8('0x4')),'whatsappInteraction':require(_0x5cc8('0x5'))};exports['consequence']=function(_0x126af2,_0x3eef26,_0x18c5c5,_0x43f93c){return function(_0xa1dd4c){try{logger[_0x5cc8('0x6')](_0x5cc8('0x7'),_0x126af2,_0x3eef26[0x0]);var _0x4825c7={'closed':0x1,'closedAt':moment()[_0x5cc8('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x5cc8('0x9'),'disposition':_0x3eef26[0x0]};if(rpc[_0x43f93c[_0x5cc8('0xa')]+_0x5cc8('0xb')]){rpc[_0x43f93c[_0x5cc8('0xa')]+_0x5cc8('0xb')][_0x5cc8('0xc')](_0x43f93c[_0x5cc8('0xd')]['id'],_0x4825c7)['then'](function(_0x3263a4){logger[_0x5cc8('0x6')](_0x5cc8('0xe'),_0x126af2,_0x43f93c['interaction']['id']);})[_0x5cc8('0xf')](function(_0x412ca8){logger['error'](_0x5cc8('0x10'),_0x126af2,JSON['stringify'](_0x412ca8));})[_0x5cc8('0x11')](function(){_0xa1dd4c[_0x5cc8('0x12')]();});}}catch(_0xaeb283){logger[_0x5cc8('0x13')](_0x5cc8('0x10'),_0x126af2,JSON['stringify'](_0xaeb283));_0xa1dd4c[_0x5cc8('0x12')]();}};}; \ 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 cb6773d..d5f5633 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 _0xc962=['speech','providerName','providerResponse','metadata','endConversation','error','next','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','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!','textRequest','message','dialogflow','result','fulfillment'];(function(_0x1db51d,_0x12b986){var _0xcf9d61=function(_0x435c39){while(--_0x435c39){_0x1db51d['push'](_0x1db51d['shift']());}};_0xcf9d61(++_0x12b986);}(_0xc962,0x6d));var _0x2c96=function(_0x4d4f15,_0x594087){_0x4d4f15=_0x4d4f15-0x0;var _0x20f496=_0xc962[_0x4d4f15];return _0x20f496;};'use strict';var _=require(_0x2c96('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0x2c96('0x1'));var logger=require(_0x2c96('0x2'))(_0x2c96('0x3'));var rpc={'chatMessage':require(_0x2c96('0x4')),'openchannelMessage':require(_0x2c96('0x5')),'mailMessage':require(_0x2c96('0x6')),'smsMessage':require(_0x2c96('0x7')),'faxMessage':require(_0x2c96('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2c96('0x9')]=function(_0x2df446,_0x1f9859){return function(_0x17a493){try{if(!_[_0x2c96('0xa')](this[_0x2c96('0xb')][_0x2c96('0xc')])){logger[_0x2c96('0xd')](_0x2c96('0xe'),_0x2df446,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x17a493['next']();}var _0x238c6b={'ContactId':this[_0x2c96('0xf')]['id'],'sentAt':moment()[_0x2c96('0x10')](_0x2c96('0x11')),'direction':_0x2c96('0x12')};if(this[_0x2c96('0x13')]==='sms'||this['channel']===_0x2c96('0x14')){_0x238c6b[_0x2c96('0x15')]=this[_0x2c96('0xb')][_0x2c96('0x15')];}var _0x188e75=this[_0x2c96('0x13')];if(_0x188e75===_0x2c96('0x16')){_0x238c6b['ChatWebsiteId']=this['account']['id'];}else{_0x238c6b[_['upperFirst'](_0x188e75)+_0x2c96('0x17')]=this[_0x2c96('0x18')]['id'];}_0x238c6b[_['upperFirst'](_0x188e75)+_0x2c96('0x19')]=this[_0x2c96('0xb')]['id'];if(this['interaction'][_0x2c96('0x1a')]){var _0x3232c0=_0x1f9859[0x2];if(!_[_0x2c96('0x1b')](_0x3232c0)){_0x238c6b[_0x2c96('0x1c')]=utils[_0x2c96('0x1d')](_0x3232c0,this);return rpc[_0x188e75+_0x2c96('0x1e')][_0x2c96('0x1f')](_0x238c6b)[_0x2c96('0x20')](function(_0x3fde3e){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2df446,_0x238c6b[_0x2c96('0x1c')]);})[_0x2c96('0x21')](function(_0x4001a9){logger['error'](_0x2c96('0xe'),_0x2df446,JSON[_0x2c96('0x22')](_0x4001a9));})[_0x2c96('0x23')](function(){logger['info'](_0x2c96('0x24'),_0x2df446);_0x17a493[_0x2c96('0x25')]();});}else{logger['info'](_0x2c96('0x26'),_0x2df446);_0x17a493[_0x2c96('0x25')]();}}else{var _0x361e42=this;var _0x14daf1=apiai(_0x1f9859[0x0],{'language':_0x1f9859[0x1]||'en'});return _0x14daf1[_0x2c96('0x27')](this[_0x2c96('0x28')][_0x2c96('0x1c')],{'sessionId':md5(this['interaction']['id'])})[_0x2c96('0x20')](function(_0x58933c){_0x361e42['body'][_0x2c96('0x29')]=_0x58933c;_0x238c6b['body']=_0x58933c[_0x2c96('0x2a')][_0x2c96('0x2b')][_0x2c96('0x2c')];_0x238c6b[_0x2c96('0x2d')]='dialogflow';_0x238c6b[_0x2c96('0x2e')]=JSON[_0x2c96('0x22')](_0x58933c);return rpc[_0x188e75+'Message'][_0x2c96('0x1f')](_0x238c6b)[_0x2c96('0x20')](function(_0x200951){logger[_0x2c96('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x2df446,_0x238c6b[_0x2c96('0x1c')]);if(_0x58933c[_0x2c96('0x2a')][_0x2c96('0x2f')][_0x2c96('0x30')]){_0x17a493['next']();}else{_0x17a493[_0x2c96('0x25')]();}})[_0x2c96('0x21')](function(_0x5eea2f){logger[_0x2c96('0x31')]('[%s][DIALOGFLOW]\x20%s',_0x2df446,JSON[_0x2c96('0x22')](_0x5eea2f));_0x17a493[_0x2c96('0x32')]();});})[_0x2c96('0x21')](function(_0x363da9){logger[_0x2c96('0x31')](_0x2c96('0xe'),_0x2df446,_0x363da9[_0x2c96('0x28')]);_0x17a493[_0x2c96('0x32')]();});}}catch(_0x5b73c3){logger[_0x2c96('0x31')](_0x2c96('0xe'),_0x2df446,JSON[_0x2c96('0x22')](_0x5b73c3));_0x17a493['stop']();}};}; \ No newline at end of file +var _0x2178=['../../rpc/whatsappMessage','consequence','isNil','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','interaction','created','isEmpty','body','getMustacheRender','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','speech','providerName','providerResponse','metadata','endConversation','next','catch','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2178,0x1b0));var _0x8217=function(_0x2ac42c,_0x400eff){_0x2ac42c=_0x2ac42c-0x0;var _0x29b7f3=_0x2178[_0x2ac42c];return _0x29b7f3;};'use strict';var _=require(_0x8217('0x0'));var moment=require('moment');var apiai=require(_0x8217('0x1'));var md5=require(_0x8217('0x2'));var utils=require(_0x8217('0x3'));var logger=require('../../../../config/logger')(_0x8217('0x4'));var rpc={'chatMessage':require(_0x8217('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8217('0x6')),'smsMessage':require(_0x8217('0x7')),'faxMessage':require(_0x8217('0x8')),'whatsappMessage':require(_0x8217('0x9'))};exports[_0x8217('0xa')]=function(_0x6938ca,_0x1100c8){return function(_0x1cddd1){try{if(!_[_0x8217('0xb')](this['interaction']['UserId'])){logger[_0x8217('0xc')](_0x8217('0xd'),_0x6938ca,_0x8217('0xe'));return _0x1cddd1['next']();}var _0xe4d46c={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x8217('0xf')),'direction':_0x8217('0x10')};if(this[_0x8217('0x11')]===_0x8217('0x12')||this[_0x8217('0x11')]===_0x8217('0x13')){_0xe4d46c[_0x8217('0x14')]=this['interaction']['phone'];}var _0x5e0350=this[_0x8217('0x11')];if(_0x5e0350===_0x8217('0x15')){_0xe4d46c[_0x8217('0x16')]=this[_0x8217('0x17')]['id'];}else{_0xe4d46c[_['upperFirst'](_0x5e0350)+_0x8217('0x18')]=this[_0x8217('0x17')]['id'];}_0xe4d46c[_[_0x8217('0x19')](_0x5e0350)+'InteractionId']=this[_0x8217('0x1a')]['id'];if(this[_0x8217('0x1a')][_0x8217('0x1b')]){var _0x2bba07=_0x1100c8[0x2];if(!_[_0x8217('0x1c')](_0x2bba07)){_0xe4d46c[_0x8217('0x1d')]=utils[_0x8217('0x1e')](_0x2bba07,this);return rpc[_0x5e0350+'Message'][_0x8217('0x1f')](_0xe4d46c)[_0x8217('0x20')](function(_0x5a46c2){logger[_0x8217('0xc')](_0x8217('0xd'),_0x6938ca,_0xe4d46c['body']);})['catch'](function(_0x4c196a){logger[_0x8217('0x21')](_0x8217('0xd'),_0x6938ca,JSON[_0x8217('0x22')](_0x4c196a));})[_0x8217('0x23')](function(){logger['info'](_0x8217('0x24'),_0x6938ca);_0x1cddd1[_0x8217('0x25')]();});}else{logger[_0x8217('0xc')](_0x8217('0x26'),_0x6938ca);_0x1cddd1[_0x8217('0x25')]();}}else{var _0x2931d5=this;var _0x564edc=apiai(_0x1100c8[0x0],{'language':_0x1100c8[0x1]||'en'});return _0x564edc[_0x8217('0x27')](this[_0x8217('0x28')]['body'],{'sessionId':md5(this[_0x8217('0x1a')]['id'])})[_0x8217('0x20')](function(_0x2c2f00){_0x2931d5[_0x8217('0x1d')][_0x8217('0x29')]=_0x2c2f00;_0xe4d46c[_0x8217('0x1d')]=_0x2c2f00['result']['fulfillment'][_0x8217('0x2a')];_0xe4d46c[_0x8217('0x2b')]=_0x8217('0x29');_0xe4d46c[_0x8217('0x2c')]=JSON[_0x8217('0x22')](_0x2c2f00);return rpc[_0x5e0350+'Message'][_0x8217('0x1f')](_0xe4d46c)[_0x8217('0x20')](function(_0x292504){logger[_0x8217('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x6938ca,_0xe4d46c[_0x8217('0x1d')]);if(_0x2c2f00['result'][_0x8217('0x2d')][_0x8217('0x2e')]){_0x1cddd1[_0x8217('0x2f')]();}else{_0x1cddd1[_0x8217('0x25')]();}})['catch'](function(_0x12834e){logger[_0x8217('0x21')](_0x8217('0xd'),_0x6938ca,JSON[_0x8217('0x22')](_0x12834e));_0x1cddd1[_0x8217('0x2f')]();});})[_0x8217('0x30')](function(_0x38d858){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x6938ca,_0x38d858[_0x8217('0x28')]);_0x1cddd1[_0x8217('0x2f')]();});}}catch(_0x344221){logger['error'](_0x8217('0xd'),_0x6938ca,JSON[_0x8217('0x22')](_0x344221));_0x1cddd1[_0x8217('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index a7e4df8..3635831 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 _0xdc85=['create','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','info','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','name','displayName','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message'];(function(_0x5ae319,_0x1bc8c2){var _0x47fe59=function(_0x4501e9){while(--_0x4501e9){_0x5ae319['push'](_0x5ae319['shift']());}};_0x47fe59(++_0x1bc8c2);}(_0xdc85,0x1b1));var _0x5dc8=function(_0x3a9f98,_0x3abc15){_0x3a9f98=_0x3a9f98-0x0;var _0x376b9c=_0xdc85[_0x3a9f98];return _0x376b9c;};'use strict';var _=require(_0x5dc8('0x0'));var dialogflow=require(_0x5dc8('0x1'));var md5=require(_0x5dc8('0x2'));var moment=require(_0x5dc8('0x3'));var Promise=require(_0x5dc8('0x4'));var logger=require(_0x5dc8('0x5'))(_0x5dc8('0x6'));var utils=require(_0x5dc8('0x7'));var rpc={'chatMessage':require(_0x5dc8('0x8')),'openchannelMessage':require(_0x5dc8('0x9')),'mailMessage':require(_0x5dc8('0xa')),'smsMessage':require(_0x5dc8('0xb')),'faxMessage':require(_0x5dc8('0xc')),'whatsappMessage':require(_0x5dc8('0xd'))};function createMessage(_0x31df2c,_0x2b6cad,_0x27f656,_0x32f790){return new Promise(function(_0x264165,_0x2b8a26){var _0x10d35a=_[_0x5dc8('0xe')](_0x27f656);_0x10d35a[_0x5dc8('0xf')]=_0x32f790;return rpc[_0x2b6cad+_0x5dc8('0x10')][_0x5dc8('0x11')](_0x10d35a)['then'](function(){logger['info'](_0x5dc8('0x12'),_0x31df2c,_0x10d35a[_0x5dc8('0xf')]);_0x264165();})['catch'](function(_0x3a250f){logger[_0x5dc8('0x13')](_0x5dc8('0x12'),_0x31df2c,JSON[_0x5dc8('0x14')](_0x3a250f));_0x2b8a26(_0x3a250f);});});}exports[_0x5dc8('0x15')]=function(_0x780a10,_0xbbb790){return function(_0x4764e1){try{if(!_[_0x5dc8('0x16')](this[_0x5dc8('0x17')][_0x5dc8('0x18')])){logger[_0x5dc8('0x19')](_0x5dc8('0x12'),_0x780a10,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4764e1[_0x5dc8('0x1a')]();}var _0x29228d={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5dc8('0x1b')](_0x5dc8('0x1c')),'direction':_0x5dc8('0x1d')};if(this[_0x5dc8('0x1e')]===_0x5dc8('0x1f')||this[_0x5dc8('0x1e')]==='whatsapp'){_0x29228d['phone']=this['interaction'][_0x5dc8('0x20')];}var _0x20ebeb=this[_0x5dc8('0x1e')];if(_0x20ebeb===_0x5dc8('0x21')){_0x29228d[_0x5dc8('0x22')]=this[_0x5dc8('0x23')]['id'];}else{_0x29228d[_['upperFirst'](_0x20ebeb)+_0x5dc8('0x24')]=this[_0x5dc8('0x23')]['id'];}_0x29228d[_[_0x5dc8('0x25')](_0x20ebeb)+'InteractionId']=this[_0x5dc8('0x17')]['id'];if(this[_0x5dc8('0x17')][_0x5dc8('0x26')]){var _0x6ce162=_0xbbb790[0x4];if(!_[_0x5dc8('0x27')](_0x6ce162)){_0x29228d[_0x5dc8('0xf')]=utils[_0x5dc8('0x28')](_0x6ce162,this);return rpc[_0x20ebeb+_0x5dc8('0x10')][_0x5dc8('0x11')](_0x29228d)['then'](function(_0x596a50){logger[_0x5dc8('0x19')](_0x5dc8('0x12'),_0x780a10,_0x29228d['body']);})[_0x5dc8('0x29')](function(_0x523180){logger[_0x5dc8('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x780a10,JSON[_0x5dc8('0x14')](_0x523180));})[_0x5dc8('0x2a')](function(){logger[_0x5dc8('0x19')](_0x5dc8('0x2b'),_0x780a10);_0x4764e1[_0x5dc8('0x2c')]();});}else{logger[_0x5dc8('0x19')](_0x5dc8('0x2d'),_0x780a10);_0x4764e1[_0x5dc8('0x2c')]();}}else{var _0x8812db=this;var _0x39d43b=_0xbbb790[0x2][_0x5dc8('0x2e')](/\\n/g,'\x0a');var _0x1487b7={'credentials':{'private_key':_0x39d43b,'client_email':_0xbbb790[0x1]}};var _0x4a1819=new dialogflow[(_0x5dc8('0x2f'))](_0x1487b7);var _0x219ba9=_0x4a1819[_0x5dc8('0x30')](_0xbbb790[0x0],md5(_0x8812db[_0x5dc8('0x17')]['id']));var _0x1efbe4={'session':_0x219ba9,'queryInput':{'text':{'text':_0x8812db[_0x5dc8('0x31')][_0x5dc8('0xf')],'languageCode':_0xbbb790[0x3]||'en'}}};return _0x4a1819[_0x5dc8('0x32')](_0x1efbe4)[_0x5dc8('0x33')](function(_0x4edf73){if(_0x4edf73&&_0x4edf73[_0x5dc8('0x34')]){_0x8812db['body'][_0x5dc8('0x35')]=_0x4edf73;var _0x1898ce=_0x4edf73[0x0];var _0x14989c=_0x1898ce['queryResult']['diagnosticInfo']&&_0x1898ce[_0x5dc8('0x36')][_0x5dc8('0x37')][_0x5dc8('0x38')]?_0x1898ce[_0x5dc8('0x36')]['diagnosticInfo'][_0x5dc8('0x38')][_0x5dc8('0x39')]['boolValue']:![];_0x8812db[_0x5dc8('0xf')]['DIALOGFLOWV2_ACTION']=_0x1898ce['queryResult'][_0x5dc8('0x3a')];_0x8812db[_0x5dc8('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x1898ce['queryResult'][_0x5dc8('0x3b')];_0x8812db[_0x5dc8('0xf')][_0x5dc8('0x3c')]=_0x1898ce[_0x5dc8('0x36')][_0x5dc8('0x37')]&&_0x1898ce[_0x5dc8('0x36')][_0x5dc8('0x37')][_0x5dc8('0x38')]?_0x1898ce[_0x5dc8('0x36')][_0x5dc8('0x37')][_0x5dc8('0x38')]['end_conversation'][_0x5dc8('0x3d')]:![];_0x8812db[_0x5dc8('0xf')][_0x5dc8('0x3e')]=_0x1898ce[_0x5dc8('0x36')]['intent'][_0x5dc8('0x3f')];_0x8812db['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x1898ce[_0x5dc8('0x36')]['intent'][_0x5dc8('0x40')];_0x8812db[_0x5dc8('0xf')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x1898ce['queryResult'][_0x5dc8('0x41')][_0x5dc8('0x42')];_0x8812db[_0x5dc8('0xf')][_0x5dc8('0x43')]=_0x1898ce[_0x5dc8('0x36')][_0x5dc8('0x44')];_0x8812db[_0x5dc8('0xf')][_0x5dc8('0x45')]=_0x1898ce['queryResult'][_0x5dc8('0x46')];_0x8812db[_0x5dc8('0xf')][_0x5dc8('0x47')]=_0x1898ce[_0x5dc8('0x36')]['intentDetectionConfidence'];_0x29228d['providerName']=_0x5dc8('0x35');_0x29228d[_0x5dc8('0x48')]=JSON[_0x5dc8('0x14')](_0x4edf73);var _0x484b8e=[];for(var _0x5d1652=0x0;_0x5d1652<_0x4edf73['length'];_0x5d1652++){var _0x3c7728=_0x4edf73[_0x5d1652];if(_0x3c7728&&_0x3c7728['queryResult']&&_0x3c7728[_0x5dc8('0x36')][_0x5dc8('0x49')]){_0x484b8e['push'](createMessage(_0x780a10,_0x20ebeb,_0x29228d,_0x3c7728[_0x5dc8('0x36')]['fulfillmentText']));}}return Promise[_0x5dc8('0x4a')](_0x484b8e)[_0x5dc8('0x33')](function(){if(_0x14989c){_0x4764e1['next']();}else{_0x4764e1[_0x5dc8('0x2c')]();}})[_0x5dc8('0x29')](function(_0x3ba873){logger[_0x5dc8('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x780a10,JSON[_0x5dc8('0x14')](_0x3ba873));_0x4764e1[_0x5dc8('0x1a')]();});}})[_0x5dc8('0x29')](function(_0x1ce50c){logger[_0x5dc8('0x13')](_0x5dc8('0x12'),_0x780a10,_0x1ce50c['message']);_0x4764e1['next']();});}}catch(_0x255131){logger[_0x5dc8('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x780a10,JSON[_0x5dc8('0x14')](_0x255131));_0x4764e1[_0x5dc8('0x2c')]();}};}; \ No newline at end of file +var _0xfd7b=['finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','name','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','next','message','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','interaction','UserId','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','InteractionId','created','isEmpty','getMustacheRender','Message','stringify'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xfd7b,0x1df));var _0xbfd7=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xfd7b[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require('lodash');var dialogflow=require(_0xbfd7('0x0'));var md5=require(_0xbfd7('0x1'));var moment=require(_0xbfd7('0x2'));var Promise=require(_0xbfd7('0x3'));var logger=require(_0xbfd7('0x4'))(_0xbfd7('0x5'));var utils=require(_0xbfd7('0x6'));var rpc={'chatMessage':require(_0xbfd7('0x7')),'openchannelMessage':require(_0xbfd7('0x8')),'mailMessage':require(_0xbfd7('0x9')),'smsMessage':require(_0xbfd7('0xa')),'faxMessage':require(_0xbfd7('0xb')),'whatsappMessage':require(_0xbfd7('0xc'))};function createMessage(_0x5f3067,_0x38b1ef,_0x48f2aa,_0x33dab1){return new Promise(function(_0x5cee3d,_0x3cf120){var _0x2e69a5=_[_0xbfd7('0xd')](_0x48f2aa);_0x2e69a5[_0xbfd7('0xe')]=_0x33dab1;return rpc[_0x38b1ef+'Message'][_0xbfd7('0xf')](_0x2e69a5)[_0xbfd7('0x10')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5f3067,_0x2e69a5[_0xbfd7('0xe')]);_0x5cee3d();})[_0xbfd7('0x11')](function(_0x45d052){logger[_0xbfd7('0x12')](_0xbfd7('0x13'),_0x5f3067,JSON['stringify'](_0x45d052));_0x3cf120(_0x45d052);});});}exports[_0xbfd7('0x14')]=function(_0x534d66,_0x28566c){return function(_0x4e9bd7){try{if(!_['isNil'](this[_0xbfd7('0x15')][_0xbfd7('0x16')])){logger[_0xbfd7('0x17')](_0xbfd7('0x13'),_0x534d66,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4e9bd7['next']();}var _0x48f4a4={'ContactId':this[_0xbfd7('0x18')]['id'],'sentAt':moment()[_0xbfd7('0x19')](_0xbfd7('0x1a')),'direction':_0xbfd7('0x1b')};if(this[_0xbfd7('0x1c')]===_0xbfd7('0x1d')||this[_0xbfd7('0x1c')]===_0xbfd7('0x1e')){_0x48f4a4[_0xbfd7('0x1f')]=this['interaction']['phone'];}var _0x1c60ac=this[_0xbfd7('0x1c')];if(_0x1c60ac==='chat'){_0x48f4a4['ChatWebsiteId']=this[_0xbfd7('0x20')]['id'];}else{_0x48f4a4[_['upperFirst'](_0x1c60ac)+'AccountId']=this[_0xbfd7('0x20')]['id'];}_0x48f4a4[_['upperFirst'](_0x1c60ac)+_0xbfd7('0x21')]=this[_0xbfd7('0x15')]['id'];if(this[_0xbfd7('0x15')][_0xbfd7('0x22')]){var _0x59d8de=_0x28566c[0x4];if(!_[_0xbfd7('0x23')](_0x59d8de)){_0x48f4a4[_0xbfd7('0xe')]=utils[_0xbfd7('0x24')](_0x59d8de,this);return rpc[_0x1c60ac+_0xbfd7('0x25')][_0xbfd7('0xf')](_0x48f4a4)[_0xbfd7('0x10')](function(_0x51b13d){logger[_0xbfd7('0x17')](_0xbfd7('0x13'),_0x534d66,_0x48f4a4[_0xbfd7('0xe')]);})['catch'](function(_0x301b51){logger[_0xbfd7('0x12')](_0xbfd7('0x13'),_0x534d66,JSON[_0xbfd7('0x26')](_0x301b51));})[_0xbfd7('0x27')](function(){logger['info'](_0xbfd7('0x28'),_0x534d66);_0x4e9bd7[_0xbfd7('0x29')]();});}else{logger[_0xbfd7('0x17')](_0xbfd7('0x2a'),_0x534d66);_0x4e9bd7[_0xbfd7('0x29')]();}}else{var _0x303060=this;var _0x378428=_0x28566c[0x2]['replace'](/\\n/g,'\x0a');var _0x164383={'credentials':{'private_key':_0x378428,'client_email':_0x28566c[0x1]}};var _0x2f83a0=new dialogflow['SessionsClient'](_0x164383);var _0x2971ea=_0x2f83a0[_0xbfd7('0x2b')](_0x28566c[0x0],md5(_0x303060[_0xbfd7('0x15')]['id']));var _0x14c55d={'session':_0x2971ea,'queryInput':{'text':{'text':_0x303060['message'][_0xbfd7('0xe')],'languageCode':_0x28566c[0x3]||'en'}}};return _0x2f83a0[_0xbfd7('0x2c')](_0x14c55d)[_0xbfd7('0x10')](function(_0x489365){if(_0x489365&&_0x489365[_0xbfd7('0x2d')]){_0x303060['body'][_0xbfd7('0x2e')]=_0x489365;var _0x5065db=_0x489365[0x0];var _0xb1ff27=_0x5065db[_0xbfd7('0x2f')]['diagnosticInfo']&&_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x30')]['fields']?_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x30')][_0xbfd7('0x31')]['end_conversation'][_0xbfd7('0x32')]:![];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x33')]=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x34')];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x35')]=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x36')];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x37')]=_0x5065db['queryResult'][_0xbfd7('0x30')]&&_0x5065db['queryResult']['diagnosticInfo'][_0xbfd7('0x31')]?_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x30')][_0xbfd7('0x31')][_0xbfd7('0x38')][_0xbfd7('0x32')]:![];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x39')]=_0x5065db['queryResult']['intent'][_0xbfd7('0x3a')];_0x303060[_0xbfd7('0xe')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x3b')]['displayName'];_0x303060['body'][_0xbfd7('0x3c')]=_0x5065db[_0xbfd7('0x2f')]['intent'][_0xbfd7('0x3d')];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x3e')]=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x3f')];_0x303060['body'][_0xbfd7('0x40')]=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x41')];_0x303060[_0xbfd7('0xe')][_0xbfd7('0x42')]=_0x5065db[_0xbfd7('0x2f')][_0xbfd7('0x43')];_0x48f4a4[_0xbfd7('0x44')]='dialogflowV2';_0x48f4a4[_0xbfd7('0x45')]=JSON['stringify'](_0x489365);var _0x483719=[];for(var _0x184adb=0x0;_0x184adb<_0x489365[_0xbfd7('0x2d')];_0x184adb++){var _0x11c208=_0x489365[_0x184adb];if(_0x11c208&&_0x11c208[_0xbfd7('0x2f')]&&_0x11c208[_0xbfd7('0x2f')][_0xbfd7('0x46')]){_0x483719['push'](createMessage(_0x534d66,_0x1c60ac,_0x48f4a4,_0x11c208[_0xbfd7('0x2f')]['fulfillmentText']));}}return Promise[_0xbfd7('0x47')](_0x483719)[_0xbfd7('0x10')](function(){if(_0xb1ff27){_0x4e9bd7[_0xbfd7('0x48')]();}else{_0x4e9bd7[_0xbfd7('0x29')]();}})[_0xbfd7('0x11')](function(_0x37c9d3){logger[_0xbfd7('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x534d66,JSON[_0xbfd7('0x26')](_0x37c9d3));_0x4e9bd7[_0xbfd7('0x48')]();});}})[_0xbfd7('0x11')](function(_0x1d2248){logger[_0xbfd7('0x12')](_0xbfd7('0x13'),_0x534d66,_0x1d2248[_0xbfd7('0x49')]);_0x4e9bd7['next']();});}}catch(_0x33f004){logger[_0xbfd7('0x12')](_0xbfd7('0x13'),_0x534d66,JSON['stringify'](_0x33f004));_0x4e9bd7['stop']();}};}; \ 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 50ff0c6..39f2603 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 _0x3f01=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f01,0x90));var _0x13f0=function(_0x3c349c,_0x22221c){_0x3c349c=_0x3c349c-0x0;var _0x40c356=_0x3f01[_0x3c349c];return _0x40c356;};'use strict';var schema=require(_0x13f0('0x0'));var _=require(_0x13f0('0x1'));var htmlToText=require(_0x13f0('0x2'));var utils=require('./utils');var logger=require(_0x13f0('0x3'))(_0x13f0('0x4'));var gotoif=schema({'condition':{'type':_0x13f0('0x5'),'required':!![],'message':_0x13f0('0x6')},'priorityTrue':{'type':_0x13f0('0x7'),'message':_0x13f0('0x8')},'priorityFalse':{'type':_0x13f0('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x3e54d2,_0x5d2502){return function(_0x16867a){try{var _0x3ecb2a={'condition':htmlToText[_0x13f0('0x9')](utils[_0x13f0('0xa')](_0x5d2502[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d2502[0x1],'priorityFalse':_0x5d2502[0x2]};var _0x3c142f=gotoif[_0x13f0('0x0')](_0x3ecb2a,{'typecast':!![]});if(_0x3c142f['length']){logger[_0x13f0('0xb')](_0x13f0('0xc'),_0x3e54d2,_[_0x13f0('0xd')](_0x3c142f,_0x13f0('0xe'))[_0x13f0('0xf')](',\x20'));_0x16867a[_0x13f0('0x10')]();}else{try{var _0x174f5d=eval('('+_0x3ecb2a[_0x13f0('0x11')]+')');var _0x2eda01=_0x174f5d?_0x3ecb2a['priorityTrue']:_0x3ecb2a[_0x13f0('0x12')];logger[_0x13f0('0x13')](_0x13f0('0x14'),_0x3e54d2,_0x3ecb2a[_0x13f0('0x11')],_0x174f5d,_0x2eda01||_0x13f0('0x15'));if(_0x2eda01){var _0x1a95ec=_[_0x13f0('0x16')](_0x16867a[_0x13f0('0x17')](),{'p':_0x2eda01});if(_0x1a95ec>=0x0){logger[_0x13f0('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3e54d2,_0x2eda01||'next',_0x1a95ec);_0x16867a[_0x13f0('0x15')](_0x1a95ec);}else{logger[_0x13f0('0x13')](_0x13f0('0x18'),_0x3e54d2,_0x2eda01||_0x13f0('0x15'));_0x16867a[_0x13f0('0x10')]();}}else{_0x16867a['next']();}}catch(_0x51cf4f){logger[_0x13f0('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3e54d2,_0x51cf4f[_0x13f0('0xe')]);_0x16867a[_0x13f0('0x10')]();}}}catch(_0x5a3ff6){logger['error'](_0x13f0('0xc'),_0x3e54d2,JSON[_0x13f0('0x19')](_0x5a3ff6));_0x16867a[_0x13f0('0x10')]();}};}; \ No newline at end of file +var _0xa081=['[%s][GOTOIF]\x20%s','message','join','stop','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xa081,0x1d0));var _0x1a08=function(_0x43658c,_0x3a1420){_0x43658c=_0x43658c-0x0;var _0x5a8978=_0xa081[_0x43658c];return _0x5a8978;};'use strict';var schema=require(_0x1a08('0x0'));var _=require(_0x1a08('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x1a08('0x2'));var logger=require(_0x1a08('0x3'))(_0x1a08('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x1a08('0x5')},'priorityTrue':{'type':_0x1a08('0x6'),'message':_0x1a08('0x7')},'priorityFalse':{'type':_0x1a08('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x1a08('0x8')]=function(_0x1f4d0d,_0x26ff5f){return function(_0x12d6e2){try{var _0x3d29fa={'condition':htmlToText['fromString'](utils[_0x1a08('0x9')](_0x26ff5f[0x0],this),{'wordwrap':![]})[_0x1a08('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x26ff5f[0x1],'priorityFalse':_0x26ff5f[0x2]};var _0x4d3ea5=gotoif['validate'](_0x3d29fa,{'typecast':!![]});if(_0x4d3ea5['length']){logger['error'](_0x1a08('0xb'),_0x1f4d0d,_['map'](_0x4d3ea5,_0x1a08('0xc'))[_0x1a08('0xd')](',\x20'));_0x12d6e2[_0x1a08('0xe')]();}else{try{var _0x66939b=eval('('+_0x3d29fa['condition']+')');var _0x336f3c=_0x66939b?_0x3d29fa[_0x1a08('0xf')]:_0x3d29fa['priorityFalse'];logger['info'](_0x1a08('0x10'),_0x1f4d0d,_0x3d29fa[_0x1a08('0x11')],_0x66939b,_0x336f3c||_0x1a08('0x12'));if(_0x336f3c){var _0x229f8b=_[_0x1a08('0x13')](_0x12d6e2[_0x1a08('0x14')](),{'p':_0x336f3c});if(_0x229f8b>=0x0){logger['info'](_0x1a08('0x15'),_0x1f4d0d,_0x336f3c||'next',_0x229f8b);_0x12d6e2[_0x1a08('0x12')](_0x229f8b);}else{logger[_0x1a08('0x16')](_0x1a08('0x17'),_0x1f4d0d,_0x336f3c||_0x1a08('0x12'));_0x12d6e2['stop']();}}else{_0x12d6e2[_0x1a08('0x12')]();}}catch(_0xd2e045){logger[_0x1a08('0x18')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1f4d0d,_0xd2e045[_0x1a08('0xc')]);_0x12d6e2['stop']();}}}catch(_0x1cef60){logger[_0x1a08('0x18')]('[%s][GOTOIF]\x20%s',_0x1f4d0d,JSON['stringify'](_0x1cef60));_0x12d6e2[_0x1a08('0xe')]();}};}; \ 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 029f0fb..ae6e2d1 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 _0x1181=['validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','stop','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify'];(function(_0x150b28,_0x1be963){var _0x5bf2d5=function(_0x83500f){while(--_0x83500f){_0x150b28['push'](_0x150b28['shift']());}};_0x5bf2d5(++_0x1be963);}(_0x1181,0x1ee));var _0x1118=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x1181[_0x333714];return _0x4c211e;};'use strict';var schema=require(_0x1118('0x0'));var _=require(_0x1118('0x1'));var logger=require(_0x1118('0x2'))(_0x1118('0x3'));var gotop=schema({'priority':{'type':_0x1118('0x4'),'required':!![],'message':_0x1118('0x5')}});exports[_0x1118('0x6')]=function(_0x43003e,_0x907b47){return function(_0x27fd21){try{var _0x1fc6bd={'priority':_0x907b47[0x0]};var _0x19cb3d=gotop[_0x1118('0x0')](_0x1fc6bd,{'typecast':!![]});if(_0x19cb3d[_0x1118('0x7')]){logger[_0x1118('0x8')](_0x1118('0x9'),_0x43003e,_[_0x1118('0xa')](_0x19cb3d,'message')['join'](',\x20'));_0x27fd21[_0x1118('0xb')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x43003e,_0x1fc6bd[_0x1118('0xc')]);if(_0x1fc6bd[_0x1118('0xc')]){var _0xdc3877=_[_0x1118('0xd')](_0x27fd21[_0x1118('0xe')](),{'p':_0x1fc6bd['priority']});if(_0xdc3877>=0x0){logger[_0x1118('0xf')](_0x1118('0x10'),_0x43003e,_0x1fc6bd[_0x1118('0xc')]||'next',_0xdc3877);_0x27fd21[_0x1118('0x11')](_0xdc3877);}else{logger[_0x1118('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x43003e,_0x1fc6bd['priority']||'next');_0x27fd21['stop']();}}else{_0x27fd21[_0x1118('0x11')]();}}}catch(_0x3db844){logger[_0x1118('0x8')](_0x1118('0x9'),_0x43003e,JSON[_0x1118('0x12')](_0x3db844));_0x27fd21[_0x1118('0xb')]();}};}; \ No newline at end of file +var _0xce7f=['validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','map','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','info','next','[%s][GOTOP]\x20%s','stringify'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0xce7f,0x1b0));var _0xfce7=function(_0x6b942a,_0x311643){_0x6b942a=_0x6b942a-0x0;var _0x22129d=_0xce7f[_0x6b942a];return _0x22129d;};'use strict';var schema=require(_0xfce7('0x0'));var _=require(_0xfce7('0x1'));var logger=require(_0xfce7('0x2'))(_0xfce7('0x3'));var gotop=schema({'priority':{'type':_0xfce7('0x4'),'required':!![],'message':_0xfce7('0x5')}});exports[_0xfce7('0x6')]=function(_0x5617a0,_0x5d260c){return function(_0x2f7c0f){try{var _0xecd2c={'priority':_0x5d260c[0x0]};var _0x3f82aa=gotop[_0xfce7('0x0')](_0xecd2c,{'typecast':!![]});if(_0x3f82aa['length']){logger[_0xfce7('0x7')]('[%s][GOTOP]\x20%s',_0x5617a0,_[_0xfce7('0x8')](_0x3f82aa,'message')[_0xfce7('0x9')](',\x20'));_0x2f7c0f[_0xfce7('0xa')]();}else{logger['info'](_0xfce7('0xb'),_0x5617a0,_0xecd2c[_0xfce7('0xc')]);if(_0xecd2c['priority']){var _0xdf96fa=_[_0xfce7('0xd')](_0x2f7c0f['rules'](),{'p':_0xecd2c['priority']});if(_0xdf96fa>=0x0){logger[_0xfce7('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5617a0,_0xecd2c[_0xfce7('0xc')]||_0xfce7('0xf'),_0xdf96fa);_0x2f7c0f[_0xfce7('0xf')](_0xdf96fa);}else{logger[_0xfce7('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5617a0,_0xecd2c[_0xfce7('0xc')]||'next');_0x2f7c0f[_0xfce7('0xa')]();}}else{_0x2f7c0f['next']();}}}catch(_0x5de903){logger[_0xfce7('0x7')](_0xfce7('0x10'),_0x5617a0,JSON[_0xfce7('0x11')](_0x5de903));_0x2f7c0f[_0xfce7('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 e01d06a..5ad8cf2 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 _0x757c=['AccountId','upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0xdfe866,_0x2e1ba1){var _0x39f106=function(_0x45b204){while(--_0x45b204){_0xdfe866['push'](_0xdfe866['shift']());}};_0x39f106(++_0x2e1ba1);}(_0x757c,0x191));var _0xc757=function(_0x2df680,_0x197df2){_0x2df680=_0x2df680-0x0;var _0x54df0a=_0x757c[_0x2df680];return _0x54df0a;};'use strict';var _=require(_0xc757('0x0'));var utils=require(_0xc757('0x1'));var logger=require('../../../../config/logger')(_0xc757('0x2'));var rpc={'chatMessage':require(_0xc757('0x3')),'openchannelMessage':require(_0xc757('0x4')),'mailMessage':require(_0xc757('0x5')),'smsMessage':require(_0xc757('0x6')),'faxMessage':require(_0xc757('0x7')),'whatsappMessage':require(_0xc757('0x8'))};exports['consequence']=function(_0x4b5aec,_0x29a0b0){return function(_0x4b5a4f){try{var _0x4fff5d={'body':utils[_0xc757('0x9')](_0x29a0b0[0x0],this),'ContactId':this[_0xc757('0xa')]['id']};if(this[_0xc757('0xb')]===_0xc757('0xc')){_0x4fff5d[_0xc757('0xd')]=this[_0xc757('0xe')]['id'];}else{_0x4fff5d[_['upperFirst'](this['channel'])+_0xc757('0xf')]=this['account']['id'];}_0x4fff5d[_[_0xc757('0x10')](this['channel'])+_0xc757('0x11')]=this['interaction']['id'];if(rpc[this[_0xc757('0xb')]+_0xc757('0x12')]){return rpc[this[_0xc757('0xb')]+_0xc757('0x12')][_0xc757('0x13')](_0x4fff5d)['then'](function(_0x193a20){logger[_0xc757('0x14')](_0xc757('0x15'),_0x4b5aec,_0x4fff5d['body']);_0x4b5a4f['next']();})[_0xc757('0x16')](function(_0x195691){logger[_0xc757('0x17')](_0xc757('0x15'),_0x4b5aec,JSON[_0xc757('0x18')](_0x195691));_0x4b5a4f['stop']();});}}catch(_0x2bd583){logger[_0xc757('0x17')](_0xc757('0x15'),_0x4b5aec,JSON['stringify'](_0x2bd583));_0x4b5a4f[_0xc757('0x19')]();}};}; \ No newline at end of file +var _0xe8f9=['upperFirst','InteractionId','Message','create','then','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','AccountId'];(function(_0x54b23e,_0x2935e5){var _0x18a67a=function(_0x10a3f5){while(--_0x10a3f5){_0x54b23e['push'](_0x54b23e['shift']());}};_0x18a67a(++_0x2935e5);}(_0xe8f9,0x73));var _0x9e8f=function(_0x447730,_0x151c13){_0x447730=_0x447730-0x0;var _0x2f8683=_0xe8f9[_0x447730];return _0x2f8683;};'use strict';var _=require('lodash');var utils=require(_0x9e8f('0x0'));var logger=require(_0x9e8f('0x1'))(_0x9e8f('0x2'));var rpc={'chatMessage':require(_0x9e8f('0x3')),'openchannelMessage':require(_0x9e8f('0x4')),'mailMessage':require(_0x9e8f('0x5')),'smsMessage':require(_0x9e8f('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9e8f('0x7'))};exports[_0x9e8f('0x8')]=function(_0x4bafc3,_0x441602){return function(_0x44472c){try{var _0x3a1288={'body':utils[_0x9e8f('0x9')](_0x441602[0x0],this),'ContactId':this['contact']['id']};if(this[_0x9e8f('0xa')]===_0x9e8f('0xb')){_0x3a1288[_0x9e8f('0xc')]=this[_0x9e8f('0xd')]['id'];}else{_0x3a1288[_['upperFirst'](this[_0x9e8f('0xa')])+_0x9e8f('0xe')]=this[_0x9e8f('0xd')]['id'];}_0x3a1288[_[_0x9e8f('0xf')](this[_0x9e8f('0xa')])+_0x9e8f('0x10')]=this['interaction']['id'];if(rpc[this[_0x9e8f('0xa')]+_0x9e8f('0x11')]){return rpc[this[_0x9e8f('0xa')]+_0x9e8f('0x11')][_0x9e8f('0x12')](_0x3a1288)[_0x9e8f('0x13')](function(_0x396575){logger['info'](_0x9e8f('0x14'),_0x4bafc3,_0x3a1288[_0x9e8f('0x15')]);_0x44472c['next']();})[_0x9e8f('0x16')](function(_0x3f0ffc){logger[_0x9e8f('0x17')]('[%s][MESSAGE]\x20%s',_0x4bafc3,JSON[_0x9e8f('0x18')](_0x3f0ffc));_0x44472c[_0x9e8f('0x19')]();});}}catch(_0x66f60a){logger['error'](_0x9e8f('0x14'),_0x4bafc3,JSON[_0x9e8f('0x18')](_0x66f60a));_0x44472c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 5882005..fba96b0 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 _0xfcf7=['getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcf7,0x113));var _0x7fcf=function(_0x200776,_0x22e01e){_0x200776=_0x200776-0x0;var _0x5a1d6e=_0xfcf7[_0x200776];return _0x5a1d6e;};'use strict';var utils=require(_0x7fcf('0x0'));var logger=require(_0x7fcf('0x1'))('routing');exports[_0x7fcf('0x2')]=function(_0x1d6017,_0xad53b2){return function(_0x4a181a){try{logger[_0x7fcf('0x3')](_0x7fcf('0x4'),_0x1d6017,utils[_0x7fcf('0x5')](_0xad53b2[0x0],this));_0x4a181a[_0x7fcf('0x6')]();}catch(_0x240d1c){logger[_0x7fcf('0x7')](_0x7fcf('0x4'),_0x1d6017,JSON[_0x7fcf('0x8')](_0x240d1c));_0x4a181a[_0x7fcf('0x9')]();}};}; \ No newline at end of file +var _0x4906=['error','./utils','routing','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x458d53,_0x1ff710){var _0x1a20db=function(_0x38a82a){while(--_0x38a82a){_0x458d53['push'](_0x458d53['shift']());}};_0x1a20db(++_0x1ff710);}(_0x4906,0x85));var _0x6490=function(_0x51a9d9,_0x4ce079){_0x51a9d9=_0x51a9d9-0x0;var _0x19afa2=_0x4906[_0x51a9d9];return _0x19afa2;};'use strict';var utils=require(_0x6490('0x0'));var logger=require('../../../../config/logger')(_0x6490('0x1'));exports['consequence']=function(_0x179ee9,_0x31215c){return function(_0x2cb480){try{logger[_0x6490('0x2')](_0x6490('0x3'),_0x179ee9,utils[_0x6490('0x4')](_0x31215c[0x0],this));_0x2cb480['next']();}catch(_0x3e5f05){logger[_0x6490('0x5')](_0x6490('0x3'),_0x179ee9,JSON['stringify'](_0x3e5f05));_0x2cb480['stop']();}};}; \ 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 7542ec9..683bfe4 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 _0x325b=['routing','./strategy','redis','localhost','queue_id','account','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','moment','ioredis'];(function(_0x299035,_0x138f8c){var _0x33e230=function(_0x1e7a45){while(--_0x1e7a45){_0x299035['push'](_0x299035['shift']());}};_0x33e230(++_0x138f8c);}(_0x325b,0x8b));var _0xb325=function(_0x3d0041,_0x2766b8){_0x3d0041=_0x3d0041-0x0;var _0x35b0ac=_0x325b[_0x3d0041];return _0x35b0ac;};'use strict';var schema=require(_0xb325('0x0'));var _=require(_0xb325('0x1'));var util=require(_0xb325('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xb325('0x3'));var Redis=require(_0xb325('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb325('0x5'));var strategy=require(_0xb325('0x6'));config[_0xb325('0x7')]=_['defaults'](config['redis'],{'host':_0xb325('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb325('0x7')]));var attributes=['id',_0xb325('0x9'),_0xb325('0xa'),_0xb325('0xb'),_0xb325('0xc'),_0xb325('0xd')];function emit(_0xb008cb,_0x237201,_0x468dd8){io['to'](_0xb008cb)[_0xb325('0xe')](_0x237201,_0x468dd8);}function emitChannelQueueInteraction(_0x1d8ef4,_0x1b5240,_0x380bea,_0x448767,_0x530b95,_0x1a89b5,_0xff2cc3,_0x3d0e2d){var _0x1ee42f=_['clone'](_0x380bea);_0x1ee42f[_0xb325('0x9')]=_0x3d0e2d;_0x1ee42f[_0xb325('0xb')]=_0x1b5240;_0x1ee42f['account']=_0x448767;_0x1ee42f['id']=_0x530b95;if(_0x1a89b5){_0xff2cc3[util[_0xb325('0xf')](_0xb325('0x10'),_0x1d8ef4)][_0x530b95]=_[_0xb325('0x11')](_0x1ee42f,attributes);}else{delete _0xff2cc3[util[_0xb325('0xf')]('%sQueuesWaitingInteractions',_0x1d8ef4)][_0x530b95];}emit(util[_0xb325('0xf')](_0xb325('0x12'),_0x1d8ef4,_0x1b5240),util[_0xb325('0xf')](_0xb325('0x13'),_0x1d8ef4,_0x1a89b5?_0xb325('0x14'):_0xb325('0x15')),_[_0xb325('0x11')](_0x1ee42f,attributes));}var rpc={'openchannelQueueReport':require(_0xb325('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb325('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xb325('0x18')),'whatsappQueueReport':require(_0xb325('0x19'))};var queue=schema({'name':{'type':_0xb325('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb325('0x1b'),'message':_0xb325('0x1c')}});function startRouting(_0x345647,_0x28fcce,_0x4105c5,_0x259a34){if(_0x345647&&_0x28fcce&&_0x4105c5){_0x28fcce[_0xb325('0x1d')]+=0x1;var _0x214b30={'uniqueid':_0x345647,'from':_0x4105c5[_0xb325('0x1e')]?_0x4105c5[_0xb325('0x1e')]['from']:'','joinAt':moment()['format'](_0xb325('0x1f')),'ContactId':_0x4105c5[_0xb325('0x20')]?_0x4105c5[_0xb325('0x20')]['id']:null,'ListId':_0x4105c5[_0xb325('0x21')]?_0x4105c5[_0xb325('0x21')]['id']:null};_0x214b30[_[_0xb325('0x22')](_0x4105c5[_0xb325('0x23')])+'QueueId']=_0x28fcce['id']||null;_0x214b30[_[_0xb325('0x22')](_0x4105c5[_0xb325('0x23')])+_0xb325('0x24')]=_0x4105c5[_0xb325('0x25')]?_0x4105c5[_0xb325('0x25')]['id']:null;_0x214b30[_[_0xb325('0x22')](_0x4105c5['channel'])+_0xb325('0x26')]=_0x4105c5[_0xb325('0x27')]?_0x4105c5[_0xb325('0x27')]['id']:null;_0x214b30[_['upperFirst'](_0x4105c5[_0xb325('0x23')])+(_0x4105c5[_0xb325('0x23')]!==_0xb325('0x28')?_0xb325('0x29'):_0xb325('0x2a'))]=_0x4105c5[_0xb325('0xa')]?_0x4105c5[_0xb325('0xa')]['id']:null;logger['info'](util[_0xb325('0xf')](_0xb325('0x2b'),_0x345647,_0x28fcce[_0xb325('0x2c')]));emitChannelQueueInteraction(_0x4105c5['channel'],_0x28fcce[_0xb325('0x2c')],_0x214b30,_0x4105c5[_0xb325('0xa')][_0xb325('0x2c')],_0x4105c5[_0xb325('0x27')]['id'],!![],_0x259a34,_0x28fcce['id']);if(rpc[_0x4105c5[_0xb325('0x23')]+_0xb325('0x2d')]){return rpc[_0x4105c5['channel']+'QueueReport'][_0xb325('0x2e')](_0x214b30)[_0xb325('0x2f')](function(_0x50d786){logger['error'](_0xb325('0x30'));});}}}function stopRouting(_0xf1881f,_0xf22340,_0x4dccf9,_0x343301){if(_0xf1881f&&_0xf22340){_0xf22340['waiting']-=0x1;var _0x51cef6={'leaveAt':moment()[_0xb325('0xf')](_0xb325('0x1f')),'acceptAt':moment()[_0xb325('0xf')](_0xb325('0x1f')),'reason':_0xb325('0x31')};logger[_0xb325('0x32')](util['format'](_0xb325('0x33'),_0xf1881f,_0xf22340['name']));emitChannelQueueInteraction(_0x4dccf9[_0xb325('0x23')],_0xf22340['name'],_0x4dccf9[_0xb325('0x1e')],_0x4dccf9[_0xb325('0xa')][_0xb325('0x2c')],_0x4dccf9['message']['id'],![],_0x343301,_0xf22340['id']);if(rpc[_0x4dccf9[_0xb325('0x23')]+'QueueReport']){return rpc[_0x4dccf9[_0xb325('0x23')]+_0xb325('0x2d')]['update'](_0xf1881f,_0x51cef6)[_0xb325('0x2f')](function(_0x3b3554){logger['error'](_0xb325('0x34'));});}}}function endRouting(_0x1c7c64,_0x34e20e,_0x7ab8e0,_0x384c71){if(_0x1c7c64&&_0x34e20e){_0x34e20e[_0xb325('0x1d')]-=0x1;var _0x515c86={'leaveAt':moment()[_0xb325('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb325('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb325('0x35')};logger[_0xb325('0x32')](util['format'](_0xb325('0x36'),_0x1c7c64,_0x34e20e[_0xb325('0x2c')]));emitChannelQueueInteraction(_0x7ab8e0[_0xb325('0x23')],_0x34e20e['name'],_0x7ab8e0[_0xb325('0x1e')],_0x7ab8e0[_0xb325('0xa')]['name'],_0x7ab8e0[_0xb325('0x27')]['id'],![],_0x384c71);if(rpc[_0x7ab8e0[_0xb325('0x23')]+'QueueReport']){return rpc[_0x7ab8e0[_0xb325('0x23')]+'QueueReport']['update'](_0x1c7c64,_0x515c86)[_0xb325('0x2f')](function(_0x300a1d){logger['error'](_0xb325('0x34'));});}}}function handleFindQueue(_0x5cc563){return function(_0xfe5f7c){return _0xfe5f7c[_0xb325('0x2c')][_0xb325('0x37')]()===_0x5cc563['toLowerCase']();};}exports['consequence']=function(_0x313348,_0x59ce24,_0x4b98a5,_0x57fe41){return function(_0x5114db){try{var _0xede08a={'name':_0x59ce24[0x0],'timeout':_0x59ce24[0x1]};var _0x1a7c23=queue[_0xb325('0x0')](_0xede08a,{'typecast':!![]});if(_0x1a7c23[_0xb325('0x38')]){logger['error'](_0xb325('0x39'),_0x313348,_[_0xb325('0x3a')](_0x1a7c23,'message')['join'](',\x20'));_0x5114db[_0xb325('0x3b')]();}else{var _0x5250f7=_[_0xb325('0x3c')](_0x4b98a5[_0x57fe41[_0xb325('0x23')]+'Queues'],handleFindQueue(_0xede08a[_0xb325('0x2c')]));if(_0x5250f7){startRouting(_0x313348,_0x5250f7,_0x57fe41,_0x4b98a5);var _0x21ecf1=(_0x5250f7[_0xb325('0x35')]||0xa)*0x3e8;var _0x329318=(_0xede08a['timeout']||0x14)*0x3e8;var _0x22491b,_0x24b912;if(_0x21ecf1>_0x329318){_0x329318=_0x21ecf1;}var _0x1a5b07=seqqueue[_0xb325('0x3d')](_0x21ecf1);_0x1a5b07['id']=_0x313348;_0x1a5b07[_0xb325('0x3e')]=_0x21ecf1;_0x1a5b07[_0xb325('0x3f')]=_0x329318;_0x1a5b07['channel']=_0x57fe41[_0xb325('0x23')];_0x4b98a5[_0xb325('0x40')][_0x313348]['on'](_0xb325('0x41'),function(){logger['info'](_0xb325('0x42'),_0x313348);stopRouting(_0x313348,_0x5250f7,_0x57fe41,_0x4b98a5);clearTimeout(_0x22491b);_0x22491b=undefined;_0x1a5b07[_0xb325('0x43')](!![]);if(_0x4b98a5[_0xb325('0x40')][_0x313348]){delete _0x4b98a5[_0xb325('0x40')][_0x313348];}_0x5114db[_0xb325('0x3b')]();});_0x4b98a5[_0xb325('0x40')][_0x313348]['on']('complete',function(){if(_0x4b98a5['rules'][_0x313348]){delete _0x4b98a5[_0xb325('0x40')][_0x313348];}});_0x22491b=setTimeout(function(){logger[_0xb325('0x32')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x313348);endRouting(_0x313348,_0x5250f7,_0x57fe41,_0x4b98a5);clearTimeout(_0x22491b);_0x1a5b07[_0xb325('0x43')](!![]);_0x5114db['next']();},_0x329318);switch(_0x5250f7[_0xb325('0x44')]){case'rrmemory':strategy['rrmemory'](_0x1a5b07,_0x5250f7,_0x4b98a5,_0x57fe41);break;default:strategy[_0xb325('0x45')](_0x1a5b07,_0x5250f7,_0x4b98a5,_0x57fe41);}}else{logger['error'](_0xb325('0x46'),_0x313348,_0xede08a[_0xb325('0x2c')]);_0x5114db['stop']();}}}catch(_0x2573d1){console['log'](_0x2573d1);logger['error']('[%s][QUEUE]\x20%s',_0x313348,_0x2573d1[_0xb325('0x47')]);_0x5114db[_0xb325('0x3b')]();}};}; \ No newline at end of file +var _0x2fe2=['update','update\x20queue\x20report','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','log','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','queue_id','account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]'];(function(_0x10fa77,_0x263175){var _0x113822=function(_0x284035){while(--_0x284035){_0x10fa77['push'](_0x10fa77['shift']());}};_0x113822(++_0x263175);}(_0x2fe2,0xae));var _0x22fe=function(_0x59fbee,_0x107300){_0x59fbee=_0x59fbee-0x0;var _0x107fd4=_0x2fe2[_0x59fbee];return _0x107fd4;};'use strict';var schema=require(_0x22fe('0x0'));var _=require('lodash');var util=require(_0x22fe('0x1'));var seqqueue=require(_0x22fe('0x2'));var moment=require(_0x22fe('0x3'));var Redis=require('ioredis');var config=require(_0x22fe('0x4'));var logger=require(_0x22fe('0x5'))(_0x22fe('0x6'));var strategy=require('./strategy');config[_0x22fe('0x7')]=_['defaults'](config[_0x22fe('0x7')],{'host':_0x22fe('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x22fe('0x9'),_0x22fe('0xa'),_0x22fe('0xb'),'from',_0x22fe('0xc')];function emit(_0x556615,_0x2a700a,_0x56ba85){io['to'](_0x556615)[_0x22fe('0xd')](_0x2a700a,_0x56ba85);}function emitChannelQueueInteraction(_0xcc03db,_0x39ea13,_0x4a468a,_0x2e6208,_0x388a25,_0x207477,_0xced69f,_0x463057){var _0x7bc261=_[_0x22fe('0xe')](_0x4a468a);_0x7bc261[_0x22fe('0x9')]=_0x463057;_0x7bc261[_0x22fe('0xb')]=_0x39ea13;_0x7bc261[_0x22fe('0xa')]=_0x2e6208;_0x7bc261['id']=_0x388a25;if(_0x207477){_0xced69f[util[_0x22fe('0xf')](_0x22fe('0x10'),_0xcc03db)][_0x388a25]=_['pick'](_0x7bc261,attributes);}else{delete _0xced69f[util[_0x22fe('0xf')](_0x22fe('0x10'),_0xcc03db)][_0x388a25];}emit(util[_0x22fe('0xf')]('%s:queue:%s',_0xcc03db,_0x39ea13),util[_0x22fe('0xf')](_0x22fe('0x11'),_0xcc03db,_0x207477?'save':_0x22fe('0x12')),_['pick'](_0x7bc261,attributes));}var rpc={'openchannelQueueReport':require(_0x22fe('0x13')),'mailQueueReport':require(_0x22fe('0x14')),'chatQueueReport':require(_0x22fe('0x15')),'smsQueueReport':require(_0x22fe('0x16')),'faxQueueReport':require(_0x22fe('0x17')),'whatsappQueueReport':require(_0x22fe('0x18'))};var queue=schema({'name':{'type':_0x22fe('0x19'),'required':!![],'message':_0x22fe('0x1a')},'timeout':{'type':'number','message':_0x22fe('0x1b')}});function startRouting(_0x474dd7,_0x53098e,_0x516bf2,_0x2314ed){if(_0x474dd7&&_0x53098e&&_0x516bf2){_0x53098e[_0x22fe('0x1c')]+=0x1;var _0x4394eb={'uniqueid':_0x474dd7,'from':_0x516bf2[_0x22fe('0x1d')]?_0x516bf2[_0x22fe('0x1d')][_0x22fe('0x1e')]:'','joinAt':moment()['format'](_0x22fe('0x1f')),'ContactId':_0x516bf2[_0x22fe('0x20')]?_0x516bf2['contact']['id']:null,'ListId':_0x516bf2[_0x22fe('0x21')]?_0x516bf2[_0x22fe('0x21')]['id']:null};_0x4394eb[_[_0x22fe('0x22')](_0x516bf2[_0x22fe('0x23')])+_0x22fe('0x24')]=_0x53098e['id']||null;_0x4394eb[_['upperFirst'](_0x516bf2[_0x22fe('0x23')])+_0x22fe('0x25')]=_0x516bf2[_0x22fe('0x26')]?_0x516bf2[_0x22fe('0x26')]['id']:null;_0x4394eb[_[_0x22fe('0x22')](_0x516bf2[_0x22fe('0x23')])+_0x22fe('0x27')]=_0x516bf2[_0x22fe('0x28')]?_0x516bf2[_0x22fe('0x28')]['id']:null;_0x4394eb[_['upperFirst'](_0x516bf2[_0x22fe('0x23')])+(_0x516bf2[_0x22fe('0x23')]!=='chat'?_0x22fe('0x29'):'WebsiteId')]=_0x516bf2[_0x22fe('0xa')]?_0x516bf2[_0x22fe('0xa')]['id']:null;logger['info'](util[_0x22fe('0xf')](_0x22fe('0x2a'),_0x474dd7,_0x53098e['name']));emitChannelQueueInteraction(_0x516bf2[_0x22fe('0x23')],_0x53098e[_0x22fe('0x2b')],_0x4394eb,_0x516bf2[_0x22fe('0xa')][_0x22fe('0x2b')],_0x516bf2[_0x22fe('0x28')]['id'],!![],_0x2314ed,_0x53098e['id']);if(rpc[_0x516bf2['channel']+_0x22fe('0x2c')]){return rpc[_0x516bf2['channel']+_0x22fe('0x2c')][_0x22fe('0x2d')](_0x4394eb)[_0x22fe('0x2e')](function(_0x75a3a8){logger[_0x22fe('0x2f')](_0x22fe('0x30'));});}}}function stopRouting(_0x2fa6a6,_0x3334fb,_0x1b1c0b,_0xd3ccbf){if(_0x2fa6a6&&_0x3334fb){_0x3334fb[_0x22fe('0x1c')]-=0x1;var _0x32ae2c={'leaveAt':moment()[_0x22fe('0xf')](_0x22fe('0x1f')),'acceptAt':moment()['format'](_0x22fe('0x1f')),'reason':_0x22fe('0x31')};logger['info'](util['format'](_0x22fe('0x32'),_0x2fa6a6,_0x3334fb[_0x22fe('0x2b')]));emitChannelQueueInteraction(_0x1b1c0b['channel'],_0x3334fb['name'],_0x1b1c0b[_0x22fe('0x1d')],_0x1b1c0b[_0x22fe('0xa')][_0x22fe('0x2b')],_0x1b1c0b[_0x22fe('0x28')]['id'],![],_0xd3ccbf,_0x3334fb['id']);if(rpc[_0x1b1c0b[_0x22fe('0x23')]+_0x22fe('0x2c')]){return rpc[_0x1b1c0b['channel']+'QueueReport'][_0x22fe('0x33')](_0x2fa6a6,_0x32ae2c)[_0x22fe('0x2e')](function(_0x2ee70e){logger[_0x22fe('0x2f')](_0x22fe('0x34'));});}}}function endRouting(_0xd312ac,_0x59ebaa,_0x2cebfe,_0x447e65){if(_0xd312ac&&_0x59ebaa){_0x59ebaa[_0x22fe('0x1c')]-=0x1;var _0x23ce62={'leaveAt':moment()[_0x22fe('0xf')](_0x22fe('0x1f')),'exitAt':moment()[_0x22fe('0xf')](_0x22fe('0x1f')),'reason':_0x22fe('0x35')};logger[_0x22fe('0x36')](util[_0x22fe('0xf')](_0x22fe('0x37'),_0xd312ac,_0x59ebaa[_0x22fe('0x2b')]));emitChannelQueueInteraction(_0x2cebfe['channel'],_0x59ebaa[_0x22fe('0x2b')],_0x2cebfe[_0x22fe('0x1d')],_0x2cebfe[_0x22fe('0xa')][_0x22fe('0x2b')],_0x2cebfe[_0x22fe('0x28')]['id'],![],_0x447e65);if(rpc[_0x2cebfe[_0x22fe('0x23')]+_0x22fe('0x2c')]){return rpc[_0x2cebfe['channel']+'QueueReport'][_0x22fe('0x33')](_0xd312ac,_0x23ce62)[_0x22fe('0x2e')](function(_0x5b3f25){logger['error'](_0x22fe('0x34'));});}}}function handleFindQueue(_0x2d78dd){return function(_0x3cf45d){return _0x3cf45d[_0x22fe('0x2b')]['toLowerCase']()===_0x2d78dd[_0x22fe('0x38')]();};}exports[_0x22fe('0x39')]=function(_0x599f42,_0x5404b8,_0x4a44d0,_0x5ce218){return function(_0x4dbb34){try{var _0x215ac8={'name':_0x5404b8[0x0],'timeout':_0x5404b8[0x1]};var _0x1d622d=queue['validate'](_0x215ac8,{'typecast':!![]});if(_0x1d622d['length']){logger[_0x22fe('0x2f')](_0x22fe('0x3a'),_0x599f42,_['map'](_0x1d622d,_0x22fe('0x28'))[_0x22fe('0x3b')](',\x20'));_0x4dbb34['stop']();}else{var _0x500e37=_[_0x22fe('0x3c')](_0x4a44d0[_0x5ce218[_0x22fe('0x23')]+_0x22fe('0x3d')],handleFindQueue(_0x215ac8['name']));if(_0x500e37){startRouting(_0x599f42,_0x500e37,_0x5ce218,_0x4a44d0);var _0x3d7feb=(_0x500e37[_0x22fe('0x35')]||0xa)*0x3e8;var _0x297ad0=(_0x215ac8[_0x22fe('0x35')]||0x14)*0x3e8;var _0x51773a,_0x2a89b4;if(_0x3d7feb>_0x297ad0){_0x297ad0=_0x3d7feb;}var _0x124da0=seqqueue[_0x22fe('0x3e')](_0x3d7feb);_0x124da0['id']=_0x599f42;_0x124da0['atimeout']=_0x3d7feb;_0x124da0[_0x22fe('0x3f')]=_0x297ad0;_0x124da0[_0x22fe('0x23')]=_0x5ce218[_0x22fe('0x23')];_0x4a44d0[_0x22fe('0x40')][_0x599f42]['on'](_0x22fe('0x41'),function(){logger[_0x22fe('0x36')](_0x22fe('0x42'),_0x599f42);stopRouting(_0x599f42,_0x500e37,_0x5ce218,_0x4a44d0);clearTimeout(_0x51773a);_0x51773a=undefined;_0x124da0[_0x22fe('0x43')](!![]);if(_0x4a44d0[_0x22fe('0x40')][_0x599f42]){delete _0x4a44d0[_0x22fe('0x40')][_0x599f42];}_0x4dbb34['stop']();});_0x4a44d0[_0x22fe('0x40')][_0x599f42]['on']('complete',function(){if(_0x4a44d0[_0x22fe('0x40')][_0x599f42]){delete _0x4a44d0[_0x22fe('0x40')][_0x599f42];}});_0x51773a=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x599f42);endRouting(_0x599f42,_0x500e37,_0x5ce218,_0x4a44d0);clearTimeout(_0x51773a);_0x124da0['close'](!![]);_0x4dbb34[_0x22fe('0x44')]();},_0x297ad0);switch(_0x500e37['strategy']){case _0x22fe('0x45'):strategy[_0x22fe('0x45')](_0x124da0,_0x500e37,_0x4a44d0,_0x5ce218);break;default:strategy[_0x22fe('0x46')](_0x124da0,_0x500e37,_0x4a44d0,_0x5ce218);}}else{logger['error'](_0x22fe('0x47'),_0x599f42,_0x215ac8[_0x22fe('0x2b')]);_0x4dbb34[_0x22fe('0x48')]();}}}catch(_0x5d5b11){console[_0x22fe('0x49')](_0x5d5b11);logger[_0x22fe('0x2f')](_0x22fe('0x3a'),_0x599f42,_0x5d5b11[_0x22fe('0x4a')]);_0x4dbb34[_0x22fe('0x48')]();}};}; \ 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 0190c45..5a5e2a0 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 _0xb55f=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','showNotification','notificationId','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','agent','realtime','routing','squeue','push','bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents'];(function(_0x1ebffe,_0x184696){var _0x353e6d=function(_0x23c583){while(--_0x23c583){_0x1ebffe['push'](_0x1ebffe['shift']());}};_0x353e6d(++_0x184696);}(_0xb55f,0xad));var _0xfb55=function(_0x3796d4,_0x5d57bd){_0x3796d4=_0x3796d4-0x0;var _0x1ab0e8=_0xb55f[_0x3796d4];return _0x1ab0e8;};'use strict';var _=require(_0xfb55('0x0'));var uuid=require('uuid');var util=require(_0xfb55('0x1'));var logger=require(_0xfb55('0x2'))('routing');var Agent=function(_0x57e078,_0x5d214f,_0x2607eb,_0x3c6a1c){this['notificationId']=uuid['v4']();this['squeue']=_0x57e078;this[_0xfb55('0x3')]=_0x5d214f;this[_0xfb55('0x4')]=_0x2607eb;this[_0xfb55('0x5')]=_0x3c6a1c;this[_0xfb55('0x6')][_0xfb55('0x7')](this['handleRun'][_0xfb55('0x8')](this),this[_0xfb55('0x9')][_0xfb55('0x8')](this));this[_0xfb55('0x6')]['on'](_0xfb55('0xa'),this[_0xfb55('0x9')][_0xfb55('0x8')](this));this[_0xfb55('0x6')]['on'](_0xfb55('0xb'),this[_0xfb55('0xc')][_0xfb55('0x8')](this));};Agent['prototype']['push']=function(){this['squeue'][_0xfb55('0x7')](this[_0xfb55('0xd')][_0xfb55('0x8')](this),this[_0xfb55('0x9')][_0xfb55('0x8')](this));};Agent[_0xfb55('0xe')][_0xfb55('0xc')]=function(){this[_0xfb55('0x9')](!![]);};Agent[_0xfb55('0xe')][_0xfb55('0xd')]=function(_0x3bd901){logger[_0xfb55('0xf')](_0xfb55('0x10'),this[_0xfb55('0x6')]['id'],this[_0xfb55('0x3')]['id']);if(_[_0xfb55('0x11')](this['realtime'][_0xfb55('0x12')][this['agent']['id']])){logger[_0xfb55('0xf')](_0xfb55('0x13'),this[_0xfb55('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0xfb55('0x8')](this),0x3e8);}else{if(this[_0xfb55('0x5')]['forcedOwnership']||util['isAgentAvailable'](this[_0xfb55('0x6')]['id'],this['realtime']['agents'][this[_0xfb55('0x3')]['id']],this[_0xfb55('0x6')][_0xfb55('0x14')],![])){this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']][_0xfb55('0x15')]=!![];this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']]['busyQueue']=undefined;util[_0xfb55('0x16')](this[_0xfb55('0x17')],this[_0xfb55('0x6')]['id'],this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']],null,this[_0xfb55('0x5')]);util[_0xfb55('0x18')](this['squeue']['id'],this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']],_0xfb55('0x19')+(this[_0xfb55('0x5')][_0xfb55('0x1a')]?':FORCED':''));}else{logger[_0xfb55('0xf')](_0xfb55('0x1b'),this[_0xfb55('0x6')]['id'],this[_0xfb55('0x3')]['id']);setTimeout(this[_0xfb55('0x7')][_0xfb55('0x8')](this),0x3e8);}}};Agent[_0xfb55('0xe')][_0xfb55('0x9')]=function(_0x3a16a1){if(_[_0xfb55('0x11')](this[_0xfb55('0x4')][_0xfb55('0x12')][this['agent']['id']])){return logger[_0xfb55('0xf')](_0xfb55('0x13'),this[_0xfb55('0x6')]['id'],this[_0xfb55('0x3')]['id']);}else{logger[_0xfb55('0xf')](_0xfb55('0x1c'),this[_0xfb55('0x6')]['id'],this['agent']['id']);util['hideNotification'](this[_0xfb55('0x17')],this['squeue']['id'],this[_0xfb55('0x4')][_0xfb55('0x12')][this['agent']['id']],null,this[_0xfb55('0x5')]);this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']][_0xfb55('0x15')]=![];this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']][_0xfb55('0x1d')]=undefined;util[_0xfb55('0x18')](this[_0xfb55('0x6')]['id'],this[_0xfb55('0x4')][_0xfb55('0x12')][this[_0xfb55('0x3')]['id']],_0x3a16a1?_0xfb55('0x1e'):_0xfb55('0x1f'));}if(!_0x3a16a1){setTimeout(this[_0xfb55('0x7')][_0xfb55('0x8')](this),0x3e8);}};function agent(_0x325ff5,_0x18f14b,_0x2013b2,_0x2436a4){return new Agent(_0x325ff5,_0x18f14b,_0x2013b2,_0x2436a4);}module['exports']=agent; \ No newline at end of file +var _0x85ed=['./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','isAgentAvailable','agents','busy','busyQueue','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid'];(function(_0x31daaa,_0xf8dbab){var _0x5dd9a6=function(_0xd5aabd){while(--_0xd5aabd){_0x31daaa['push'](_0x31daaa['shift']());}};_0x5dd9a6(++_0xf8dbab);}(_0x85ed,0xbe));var _0xd85e=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x85ed[_0xcd0918];return _0x250704;};'use strict';var _=require(_0xd85e('0x0'));var uuid=require(_0xd85e('0x1'));var util=require(_0xd85e('0x2'));var logger=require(_0xd85e('0x3'))(_0xd85e('0x4'));var Agent=function(_0x364703,_0x4e40a7,_0x22ec21,_0x1e27c1){this[_0xd85e('0x5')]=uuid['v4']();this[_0xd85e('0x6')]=_0x364703;this[_0xd85e('0x7')]=_0x4e40a7;this[_0xd85e('0x8')]=_0x22ec21;this[_0xd85e('0x4')]=_0x1e27c1;this[_0xd85e('0x6')][_0xd85e('0x9')](this[_0xd85e('0xa')]['bind'](this),this[_0xd85e('0xb')][_0xd85e('0xc')](this));this['squeue']['on'](_0xd85e('0xd'),this['handleTimeout'][_0xd85e('0xc')](this));this[_0xd85e('0x6')]['on'](_0xd85e('0xe'),this[_0xd85e('0xf')]['bind'](this));};Agent[_0xd85e('0x10')][_0xd85e('0x9')]=function(){this[_0xd85e('0x6')][_0xd85e('0x9')](this[_0xd85e('0xa')][_0xd85e('0xc')](this),this[_0xd85e('0xb')]['bind'](this));};Agent[_0xd85e('0x10')][_0xd85e('0xf')]=function(){this[_0xd85e('0xb')](!![]);};Agent[_0xd85e('0x10')][_0xd85e('0xa')]=function(_0x41bd7e){logger[_0xd85e('0x11')](_0xd85e('0x12'),this[_0xd85e('0x6')]['id'],this[_0xd85e('0x7')]['id']);if(_[_0xd85e('0x13')](this[_0xd85e('0x8')]['agents'][this[_0xd85e('0x7')]['id']])){logger[_0xd85e('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd85e('0x6')]['id'],this[_0xd85e('0x7')]['id']);setTimeout(this[_0xd85e('0x9')][_0xd85e('0xc')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xd85e('0x14')](this[_0xd85e('0x6')]['id'],this[_0xd85e('0x8')][_0xd85e('0x15')][this['agent']['id']],this['squeue']['channel'],![])){this[_0xd85e('0x8')][_0xd85e('0x15')][this[_0xd85e('0x7')]['id']][_0xd85e('0x16')]=!![];this[_0xd85e('0x8')][_0xd85e('0x15')][this[_0xd85e('0x7')]['id']][_0xd85e('0x17')]=undefined;util['showNotification'](this['notificationId'],this[_0xd85e('0x6')]['id'],this[_0xd85e('0x8')][_0xd85e('0x15')][this[_0xd85e('0x7')]['id']],null,this[_0xd85e('0x4')]);util[_0xd85e('0x18')](this[_0xd85e('0x6')]['id'],this[_0xd85e('0x8')][_0xd85e('0x15')][this[_0xd85e('0x7')]['id']],'RINGING'+(this['routing'][_0xd85e('0x19')]?':FORCED':''));}else{logger[_0xd85e('0x11')](_0xd85e('0x1a'),this[_0xd85e('0x6')]['id'],this[_0xd85e('0x7')]['id']);setTimeout(this[_0xd85e('0x9')][_0xd85e('0xc')](this),0x3e8);}}};Agent[_0xd85e('0x10')][_0xd85e('0xb')]=function(_0x41afee){if(_[_0xd85e('0x13')](this['realtime']['agents'][this[_0xd85e('0x7')]['id']])){return logger[_0xd85e('0x11')](_0xd85e('0x1b'),this['squeue']['id'],this['agent']['id']);}else{logger['info'](_0xd85e('0x1c'),this['squeue']['id'],this[_0xd85e('0x7')]['id']);util[_0xd85e('0x1d')](this[_0xd85e('0x5')],this['squeue']['id'],this[_0xd85e('0x8')]['agents'][this['agent']['id']],null,this[_0xd85e('0x4')]);this[_0xd85e('0x8')]['agents'][this[_0xd85e('0x7')]['id']]['busy']=![];this[_0xd85e('0x8')]['agents'][this[_0xd85e('0x7')]['id']]['busyQueue']=undefined;util[_0xd85e('0x18')](this[_0xd85e('0x6')]['id'],this['realtime']['agents'][this[_0xd85e('0x7')]['id']],_0x41afee?_0xd85e('0x1e'):_0xd85e('0x1f'));}if(!_0x41afee){setTimeout(this[_0xd85e('0x9')][_0xd85e('0xc')](this),0x3e8);}};function agent(_0x59ae78,_0x2e95dc,_0x1343b0,_0x21d7fe){return new Agent(_0x59ae78,_0x2e95dc,_0x1343b0,_0x21d7fe);}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 86134ce..e401bee 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 _0xed1f=['info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','drained','prototype','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','busyQueue','name','showNotification'];(function(_0x41f96b,_0x553c69){var _0x101610=function(_0x430be8){while(--_0x430be8){_0x41f96b['push'](_0x41f96b['shift']());}};_0x101610(++_0x553c69);}(_0xed1f,0x6a));var _0xfed1=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xed1f[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0xfed1('0x0'));var uuid=require(_0xfed1('0x1'));var util=require(_0xfed1('0x2'));var logger=require(_0xfed1('0x3'))(_0xfed1('0x4'));var Beepall=function(_0x25f345,_0x1dd614,_0xa68587,_0x2209b3){this[_0xfed1('0x5')]=uuid['v4']();this[_0xfed1('0x6')]=_0x25f345;this[_0xfed1('0x7')]=_0x1dd614;this[_0xfed1('0x8')]=_0xa68587;this[_0xfed1('0x4')]=_0x2209b3;this[_0xfed1('0x6')][_0xfed1('0x9')](this[_0xfed1('0xa')][_0xfed1('0xb')](this),this['handleTimeout'][_0xfed1('0xb')](this));this[_0xfed1('0x6')]['on']('timeout',this[_0xfed1('0xc')][_0xfed1('0xb')](this));this['squeue']['on'](_0xfed1('0xd'),this['handleDrained'][_0xfed1('0xb')](this));};Beepall[_0xfed1('0xe')]['push']=function(){this['squeue'][_0xfed1('0x9')](this[_0xfed1('0xa')]['bind'](this),this[_0xfed1('0xc')]['bind'](this));};Beepall['prototype'][_0xfed1('0xf')]=function(_0x397af9){this['handleTimeout'](!![]);};Beepall[_0xfed1('0xe')]['handleRun']=function(_0x4cd9d1){var _0xde25db=!![];if(!_[_0xfed1('0x10')](this[_0xfed1('0x7')])&&!_[_0xfed1('0x10')](this['queue'][_0xfed1('0x11')])&&this['queue'][_0xfed1('0x11')][_0xfed1('0x12')]>0x0){for(var _0x489a0f=0x0,_0x3d0517;_0x489a0f0x0){for(var _0x1f2702=0x0,_0x576197;_0x1f27020x0&&_0x1f3d6d[_0x37fe4e+_0x17ee('0x25')]>=_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]){writeLog(_0x1425e5,_0x1f3d6d,_0x37fe4e['toUpperCase']()+_0x17ee('0x26'));return![];}}return!![];};exports[_0x17ee('0x27')]=function(_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c){return sendNotification(!![],_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c);};exports[_0x17ee('0x28')]=function(_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba){return sendNotification(![],_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba);};exports[_0x17ee('0x29')]=writeLog; \ No newline at end of file +var _0x1261=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','emit','format','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save'];(function(_0xb7a7a4,_0xba57e5){var _0x546849=function(_0x5e6383){while(--_0x5e6383){_0xb7a7a4['push'](_0xb7a7a4['shift']());}};_0x546849(++_0xba57e5);}(_0x1261,0x144));var _0x1126=function(_0x1a97cb,_0x3e174c){_0x1a97cb=_0x1a97cb-0x0;var _0x4ab190=_0x1261[_0x1a97cb];return _0x4ab190;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var utils=require(_0x1126('0x1'));var Mustache=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var config=require(_0x1126('0x4'));var logger=require(_0x1126('0x5'))(_0x1126('0x6'));config[_0x1126('0x7')]=_[_0x1126('0x8')](config[_0x1126('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1126('0x7')]));function emit(_0x907180,_0x4f239c,_0x17e5f0){io['to'](_0x907180)[_0x1126('0x9')](_0x4f239c,_0x17e5f0);}function sendNotification(_0x245be9,_0x3abb0b,_0x2d9033,_0x59cfa1,_0x3f09ac,_0x18dbe6){io['to'](util[_0x1126('0xa')]('user:%s',_0x59cfa1[_0x1126('0xb')]))['emit']('user:save',_0x59cfa1);var _0x15c071=_0x18dbe6||{};var _0x561b93=_0x2d9033[_0x1126('0xc')]('.');var _0x1b364a={'uniqueid':_0x3abb0b,'channel':_0x561b93[0x0],'id':_0x561b93[0x1],'title':_0x561b93[0x0]+_0x1126('0xd'),'interactionId':_0x561b93[0x2],'queue':_0x3f09ac?_0x3f09ac[_0x1126('0xb')]:null,'sound':_0x15c071[_0x1126('0xe')][_0x1126('0xf')],'shake':_0x15c071[_0x1126('0xe')][_0x1126('0x10')]};try{if(!_0x15c071[_0x1126('0x11')]){_0x15c071['body']={};}if(_0x3f09ac){_0x15c071['body'][_0x1126('0x12')]=_0x3f09ac;}else if(_0x15c071[_0x1126('0x11')][_0x1126('0x12')]){delete _0x15c071['body'][_0x1126('0x12')];}_0x1b364a['msg']=utils[_0x1126('0x13')](_0x15c071[_0x1126('0xe')][_0x1126('0x14')],_0x15c071);}catch(_0x4e1c97){_0x1b364a[_0x1126('0x15')]=_0x1126('0x16');logger['error'](util['format'](_0x1126('0x17'),_0x3abb0b,_0x4e1c97[_0x1126('0x18')]));}io['to'](util['format']('user:%s',_0x59cfa1[_0x1126('0xb')]))['emit'](util[_0x1126('0xa')](_0x1126('0x19'),_0x245be9?_0x1126('0x1a'):'remove'),_0x1b364a);}function writeLog(_0x2a08ba,_0x49d209,_0x56efeb){return logger[_0x1126('0x1b')](util[_0x1126('0xa')](_0x1126('0x1c'),_0x2a08ba,_0x49d209[_0x1126('0xb')],_0x56efeb));}exports['isAgentAvailable']=function(_0x29ab60,_0x477e6a,_0x48a08d,_0x2175fa){if(_0x477e6a['busy']){writeLog(_0x29ab60,_0x477e6a,'BUSY');return![];}if(!_0x477e6a['online']){writeLog(_0x29ab60,_0x477e6a,_0x1126('0x1d'));return![];}if(_0x477e6a[_0x48a08d+_0x1126('0x1e')]){writeLog(_0x29ab60,_0x477e6a,_0x1126('0x1f'));return![];}if(_0x2175fa&&_0x477e6a[_0x1126('0x20')](_0x48a08d+_0x1126('0x21'))&&_0x477e6a[_0x1126('0x20')](_0x48a08d+_0x1126('0x22'))){if(_0x477e6a[_0x48a08d+_0x1126('0x21')]>0x0&&_0x477e6a[_0x48a08d+'CurrentCapacity']>=_0x477e6a[_0x48a08d+_0x1126('0x21')]){writeLog(_0x29ab60,_0x477e6a,_0x48a08d[_0x1126('0x23')]()+_0x1126('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x541bc9,_0xeb7d89,_0x39bf0e,_0x55e195,_0x2fb797){return sendNotification(!![],_0x541bc9,_0xeb7d89,_0x39bf0e,_0x55e195,_0x2fb797);};exports[_0x1126('0x25')]=function(_0x4a334a,_0x3fa694,_0x4bf807,_0xc62460,_0x4bd50b){return sendNotification(![],_0x4a334a,_0x3fa694,_0x4bf807,_0xc62460,_0x4bd50b);};exports[_0x1126('0x26')]=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 ab400b1..01ece27 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 _0xbfda=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim'];(function(_0x1230f6,_0x334699){var _0x964bc=function(_0x553c6b){while(--_0x553c6b){_0x1230f6['push'](_0x1230f6['shift']());}};_0x964bc(++_0x334699);}(_0xbfda,0x1dc));var _0xabfd=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0xbfda[_0x57d671];return _0x450dfe;};'use strict';var schema=require(_0xabfd('0x0'));var sh=require(_0xabfd('0x1'));var _=require(_0xabfd('0x2'));var utils=require('./utils');var logger=require(_0xabfd('0x3'))('routing');var system=schema({'command':{'type':_0xabfd('0x4'),'required':!![],'message':_0xabfd('0x5')}});exports[_0xabfd('0x6')]=function(_0x3818ef,_0x48aff0){return function(_0x11d89e){try{var _0x4c306b={'command':_0x48aff0[0x0]};var _0x1dbf70=system['validate'](_0x4c306b,{'typecast':!![]});if(_0x1dbf70[_0xabfd('0x7')]){logger['error'](_0xabfd('0x8'),_0x3818ef,_[_0xabfd('0x9')](_0x1dbf70,_0xabfd('0xa'))[_0xabfd('0xb')](',\x20'));logger[_0xabfd('0xc')](_0xabfd('0xd'),_0x3818ef);_0x11d89e['next']();}else{var _0x3d3448=this;var _0xfef859=utils[_0xabfd('0xe')](_0x48aff0[0x0],this);logger[_0xabfd('0xc')](_0xabfd('0xf'),_0x3818ef,_0xfef859);sh[_0xabfd('0x10')](_[_0xabfd('0x11')](_0xfef859),function(_0x2a7795,_0x24cb9c){logger[_0xabfd('0xc')](_0xabfd('0x12'),_0x3818ef,_0x2a7795);if(_0x2a7795==0x0){var _0x2a257e=_0x24cb9c[_0xabfd('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x48aff0[0x1])||_[_0xabfd('0x14')](_0x48aff0[0x1])){logger[_0xabfd('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x3818ef);_0x3d3448[_0xabfd('0x15')][_0x48aff0[0x1]]=_0x2a257e;}else{logger[_0xabfd('0xc')](_0xabfd('0x16'),_0x3818ef,_0x48aff0[0x1],_0x2a257e);_0x3d3448[_0xabfd('0x15')][_0x48aff0[0x1]]=_0x2a257e;}}_0x11d89e[_0xabfd('0x17')]();});}}catch(_0x53856f){logger[_0xabfd('0x18')](_0xabfd('0x8'),_0x3818ef,_[_0xabfd('0x19')](_0x53856f)?JSON['stringify'](_0x53856f):_0x53856f);logger[_0xabfd('0xc')](_0xabfd('0xd'),_0x3818ef);_0x11d89e[_0xabfd('0x17')]();}};}; \ No newline at end of file +var _0xa575=['[%s][SYSTEM]\x20commnad:\x20%s','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','next'];(function(_0x32633e,_0x3a581a){var _0x1f6d30=function(_0x20ca4d){while(--_0x20ca4d){_0x32633e['push'](_0x32633e['shift']());}};_0x1f6d30(++_0x3a581a);}(_0xa575,0x150));var _0x5a57=function(_0xb09590,_0x1655da){_0xb09590=_0xb09590-0x0;var _0x2f1100=_0xa575[_0xb09590];return _0x2f1100;};'use strict';var schema=require(_0x5a57('0x0'));var sh=require('shelljs');var _=require(_0x5a57('0x1'));var utils=require(_0x5a57('0x2'));var logger=require('../../../../config/logger')(_0x5a57('0x3'));var system=schema({'command':{'type':_0x5a57('0x4'),'required':!![],'message':_0x5a57('0x5')}});exports[_0x5a57('0x6')]=function(_0x1e6053,_0x45efe1){return function(_0x5b5d0f){try{var _0x11a1c6={'command':_0x45efe1[0x0]};var _0xf9690b=system['validate'](_0x11a1c6,{'typecast':!![]});if(_0xf9690b[_0x5a57('0x7')]){logger[_0x5a57('0x8')](_0x5a57('0x9'),_0x1e6053,_[_0x5a57('0xa')](_0xf9690b,_0x5a57('0xb'))[_0x5a57('0xc')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e6053);_0x5b5d0f[_0x5a57('0xd')]();}else{var _0x4baa77=this;var _0x507249=utils['getMustacheRender'](_0x45efe1[0x0],this);logger['info'](_0x5a57('0xe'),_0x1e6053,_0x507249);sh['exec'](_[_0x5a57('0xf')](_0x507249),function(_0x392dd3,_0x57ae80){logger[_0x5a57('0x10')](_0x5a57('0x11'),_0x1e6053,_0x392dd3);if(_0x392dd3==0x0){var _0xa69b45=_0x57ae80[_0x5a57('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x45efe1[0x1])||_[_0x5a57('0x13')](_0x45efe1[0x1])){logger['info'](_0x5a57('0x14'),_0x1e6053);_0x4baa77[_0x5a57('0x15')][_0x45efe1[0x1]]=_0xa69b45;}else{logger['info'](_0x5a57('0x16'),_0x1e6053,_0x45efe1[0x1],_0xa69b45);_0x4baa77[_0x5a57('0x15')][_0x45efe1[0x1]]=_0xa69b45;}}_0x5b5d0f[_0x5a57('0xd')]();});}}catch(_0x3ffdd7){logger[_0x5a57('0x8')](_0x5a57('0x9'),_0x1e6053,_['isObject'](_0x3ffdd7)?JSON[_0x5a57('0x17')](_0x3ffdd7):_0x3ffdd7);logger['info'](_0x5a57('0x18'),_0x1e6053);_0x5b5d0f[_0x5a57('0xd')]();}};}; \ 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 3153ac0..d73b218 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 _0xaff2=['validate','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','next','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','consequence'];(function(_0x3b8bb3,_0x29136d){var _0x420eb8=function(_0x36379c){while(--_0x36379c){_0x3b8bb3['push'](_0x3b8bb3['shift']());}};_0x420eb8(++_0x29136d);}(_0xaff2,0x156));var _0x2aff=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xaff2[_0x1d80be];return _0xf9a4f3;};'use strict';var schema=require('validate');var _=require(_0x2aff('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x2aff('0x1')),'smsInteraction':require(_0x2aff('0x2')),'mailInteraction':require(_0x2aff('0x3')),'faxInteraction':require(_0x2aff('0x4')),'whatsappInteraction':require(_0x2aff('0x5'))};var logger=require(_0x2aff('0x6'))('routing');var tag=schema({'tag':{'type':_0x2aff('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x2aff('0x8')]=function(_0x487472,_0x3f84e4,_0x9c8765,_0x456763){return function(_0x4d4770){try{var _0x5763cd={'tag':_0x3f84e4[0x0]};var _0x36cd6e=tag[_0x2aff('0x9')](_0x5763cd,{'typecast':!![]});if(_0x36cd6e[_0x2aff('0xa')]){logger[_0x2aff('0xb')](_0x2aff('0xc'),_0x487472,_[_0x2aff('0xd')](_0x36cd6e,_0x2aff('0xe'))[_0x2aff('0xf')](',\x20'));logger[_0x2aff('0x10')](_0x2aff('0x11'),_0x487472);_0x4d4770['next']();}else{var _0x4f5115={'ids':[_0x3f84e4[0x0]]};if(rpc[_0x456763[_0x2aff('0x12')]+'Interaction']){rpc[_0x456763[_0x2aff('0x12')]+_0x2aff('0x13')]['addTags'](_0x456763[_0x2aff('0x14')]['id'],_0x4f5115)[_0x2aff('0x15')](function(_0x3560b6){logger[_0x2aff('0x10')](_0x2aff('0x16'),_0x487472,_0x3f84e4[0x1],_0x456763[_0x2aff('0x12')],_0x456763[_0x2aff('0x14')]['id']);})[_0x2aff('0x17')](function(_0x13c3c7){logger[_0x2aff('0xb')]('[%s][TAG]\x20%s',_0x487472,JSON[_0x2aff('0x18')](_0x13c3c7));logger[_0x2aff('0x10')](_0x2aff('0x11'),_0x487472);})[_0x2aff('0x19')](function(){_0x4d4770['next']();});}}}catch(_0x42b2f8){logger[_0x2aff('0xb')]('[%s][TAG]\x20%s',_0x487472,_['isObject'](_0x42b2f8)?JSON['stringify'](_0x42b2f8):_0x42b2f8);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x487472);_0x4d4770[_0x2aff('0x1a')]();}};}; \ No newline at end of file +var _0xefbd=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x11eb1f,_0x826f0b){var _0x2121e9=function(_0x5b84a9){while(--_0x5b84a9){_0x11eb1f['push'](_0x11eb1f['shift']());}};_0x2121e9(++_0x826f0b);}(_0xefbd,0xa5));var _0xdefb=function(_0x5a5087,_0x22acdd){_0x5a5087=_0x5a5087-0x0;var _0x27ce9a=_0xefbd[_0x5a5087];return _0x27ce9a;};'use strict';var schema=require(_0xdefb('0x0'));var _=require(_0xdefb('0x1'));var rpc={'chatInteraction':require(_0xdefb('0x2')),'openchannelInteraction':require(_0xdefb('0x3')),'smsInteraction':require(_0xdefb('0x4')),'mailInteraction':require(_0xdefb('0x5')),'faxInteraction':require(_0xdefb('0x6')),'whatsappInteraction':require(_0xdefb('0x7'))};var logger=require(_0xdefb('0x8'))(_0xdefb('0x9'));var tag=schema({'tag':{'type':_0xdefb('0xa'),'required':!![],'message':_0xdefb('0xb')}});exports[_0xdefb('0xc')]=function(_0x162822,_0x409a3d,_0x2668f0,_0x13d833){return function(_0x17ec93){try{var _0x438b2e={'tag':_0x409a3d[0x0]};var _0x231649=tag[_0xdefb('0x0')](_0x438b2e,{'typecast':!![]});if(_0x231649['length']){logger[_0xdefb('0xd')]('[%s][TAG]\x20%s',_0x162822,_['map'](_0x231649,_0xdefb('0xe'))[_0xdefb('0xf')](',\x20'));logger[_0xdefb('0x10')](_0xdefb('0x11'),_0x162822);_0x17ec93[_0xdefb('0x12')]();}else{var _0x2ff2ee={'ids':[_0x409a3d[0x0]]};if(rpc[_0x13d833['channel']+_0xdefb('0x13')]){rpc[_0x13d833[_0xdefb('0x14')]+_0xdefb('0x13')][_0xdefb('0x15')](_0x13d833[_0xdefb('0x16')]['id'],_0x2ff2ee)[_0xdefb('0x17')](function(_0x59cd6e){logger[_0xdefb('0x10')](_0xdefb('0x18'),_0x162822,_0x409a3d[0x1],_0x13d833[_0xdefb('0x14')],_0x13d833[_0xdefb('0x16')]['id']);})[_0xdefb('0x19')](function(_0x4c6177){logger[_0xdefb('0xd')](_0xdefb('0x1a'),_0x162822,JSON[_0xdefb('0x1b')](_0x4c6177));logger['info'](_0xdefb('0x11'),_0x162822);})['finally'](function(){_0x17ec93[_0xdefb('0x12')]();});}}}catch(_0x4e3ac6){logger[_0xdefb('0xd')](_0xdefb('0x1a'),_0x162822,_[_0xdefb('0x1c')](_0x4e3ac6)?JSON[_0xdefb('0x1b')](_0x4e3ac6):_0x4e3ac6);logger[_0xdefb('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x162822);_0x17ec93[_0xdefb('0x12')]();}};}; \ 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 b407078..d8bb07c 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x5b5200,_0x442ce6){var _0x508cea=function(_0x4939b3){while(--_0x4939b3){_0x5b5200['push'](_0x5b5200['shift']());}};_0x508cea(++_0x442ce6);}(_0xe706,0xa3));var _0x6e70=function(_0x2a7f29,_0x2c89dc){_0x2a7f29=_0x2a7f29-0x0;var _0x38924b=_0xe706[_0x2a7f29];return _0x38924b;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5f37d5,_0x548dba){var _0x48eb1c=function(_0x376540){while(--_0x376540){_0x5f37d5['push'](_0x5f37d5['shift']());}};_0x48eb1c(++_0x548dba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 6228413..73e3222 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 _0x2802=['../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','channel','push','slice','dialogflow','appdata','dialogflowv2','split','tag','TagId','format','./interval','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','values','chatQueues','name','paused','mailQueues','available','openchannelQueues','loggedIn','waiting','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport'];(function(_0x816b95,_0x3aac55){var _0x3d9e41=function(_0x5c78f6){while(--_0x5c78f6){_0x816b95['push'](_0x816b95['shift']());}};_0x3d9e41(++_0x3aac55);}(_0x2802,0x118));var _0x2280=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x2802[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var path=require(_0x2280('0x2'));var fs=require('fs');var jayson=require(_0x2280('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x2280('0x4'));var logger=require(_0x2280('0x5'))(_0x2280('0x6'));var rpc={'openchannelQueueReport':require(_0x2280('0x7')),'mailQueueReport':require(_0x2280('0x8')),'chatQueueReport':require(_0x2280('0x9')),'smsQueueReport':require(_0x2280('0xa')),'faxQueueReport':require(_0x2280('0xb')),'whatsappQueueReport':require(_0x2280('0xc'))};var RuleEngine=require(_0x2280('0xd'));function getId(_0x117ea7,_0x5bbdec,_0x39b5fe){return util['format'](_0x2280('0xe'),_0x117ea7,_0x5bbdec||0x0,_0x39b5fe||0x0);}function getIntervals(_0x3aca59,_0x1f3bc8){var _0x2bc34d=[];if(!_[_0x2280('0xf')](_0x1f3bc8[_0x2280('0x10')])&&!_['isNil'](_0x3aca59[_0x1f3bc8[_0x2280('0x10')]])&&!_[_0x2280('0xf')](_0x3aca59[_0x1f3bc8[_0x2280('0x10')]][_0x2280('0x11')])){_0x2bc34d=_['map'](_0x3aca59[_0x1f3bc8['IntervalId']][_0x2280('0x11')],_0x2280('0x12'));}else if(!_[_0x2280('0xf')](_0x1f3bc8[_0x2280('0x12')])){_0x2bc34d=[_0x1f3bc8[_0x2280('0x12')]];}return _0x2bc34d;}exports[_0x2280('0x13')]=function(_0x55fab4){_0x55fab4[_0x2280('0x14')]={};return new BPromise(function(_0x79ccba,_0x47621c){var _0x17535a={'Start':function(_0x114203){var _0x7ed80c=this;return new Promise(function(_0x22c2a7,_0x26e8de){if(_0x114203){try{var _0x380682=[];var _0x3353fb=getId(_0x114203['channel'],_0x114203['message']?_0x114203[_0x2280('0x15')]['id']:0x0,_0x114203['interaction']?_0x114203[_0x2280('0x16')]['id']:0x0);if(_0x114203[_0x2280('0x17')]&&_[_0x2280('0x18')](_0x114203['applications'])&&_0x114203[_0x2280('0x17')][_0x2280('0x19')]){for(var _0x181c2a=0x0;_0x181c2a<_0x114203[_0x2280('0x17')][_0x2280('0x19')];_0x181c2a+=0x1){var _0x5eec79=_0x114203[_0x2280('0x17')][_0x181c2a];if(fs[_0x2280('0x1a')](path[_0x2280('0x1b')](__dirname,_0x2280('0x17'),_0x5eec79[_0x2280('0x1c')]+_0x2280('0x1d')))){var _0x5dd4ec=[];switch(_0x5eec79[_0x2280('0x1c')][_0x2280('0x1e')]()){case _0x2280('0x1f'):var _0x381366=_0x5eec79['appdata']['split'](',');if(_0x114203[_0x2280('0x20')]==='mail'){_0x5dd4ec[_0x2280('0x21')](_0x381366[0x0]);_0x5dd4ec[_0x2280('0x21')](_0x381366[0x1]);_0x5dd4ec[_0x2280('0x21')](_0x381366[_0x2280('0x22')](0x2,_0x381366['length'])[_0x2280('0x1b')](','));}else{_0x5dd4ec[_0x2280('0x21')](_0x381366[0x0]);_0x5dd4ec[_0x2280('0x21')](_0x381366[_0x2280('0x22')](0x1,_0x381366[_0x2280('0x19')])[_0x2280('0x1b')](','));}break;case _0x2280('0x23'):var _0x4940f6=_0x5eec79[_0x2280('0x24')]['split'](',');_0x5dd4ec[_0x2280('0x21')](_0x4940f6[0x0]);_0x5dd4ec[_0x2280('0x21')](_0x4940f6[0x1]);_0x5dd4ec[_0x2280('0x21')](_0x4940f6[_0x2280('0x22')](0x2,_0x4940f6['length'])[_0x2280('0x1b')](','));break;case _0x2280('0x25'):var _0x20e032=_0x5eec79[_0x2280('0x24')][_0x2280('0x26')](',');_0x5dd4ec[_0x2280('0x21')](_0x20e032[0x0]);_0x5dd4ec['push'](_0x20e032[0x1]);_0x5dd4ec['push'](_0x20e032[0x2]);_0x5dd4ec['push'](_0x20e032[0x3]);_0x5dd4ec[_0x2280('0x21')](_0x20e032[_0x2280('0x22')](0x4,_0x20e032[_0x2280('0x19')])[_0x2280('0x1b')](','));break;case'amazonlex':var _0x26ca4a=_0x5eec79[_0x2280('0x24')]['split'](',');_0x5dd4ec['push'](_0x26ca4a[0x0]);_0x5dd4ec['push'](_0x26ca4a[0x1]);_0x5dd4ec[_0x2280('0x21')](_0x26ca4a[0x2]);_0x5dd4ec[_0x2280('0x21')](_0x26ca4a[0x3]);_0x5dd4ec[_0x2280('0x21')](_0x26ca4a[_0x2280('0x22')](0x4,_0x26ca4a[_0x2280('0x19')])[_0x2280('0x1b')](','));break;case _0x2280('0x15'):_0x5dd4ec[_0x2280('0x21')](_0x5eec79[_0x2280('0x24')]);break;case _0x2280('0x27'):_0x5dd4ec[_0x2280('0x21')](_0x5eec79[_0x2280('0x28')]);_0x5dd4ec[_0x2280('0x21')](_0x5eec79[_0x2280('0x24')]);break;default:_0x5dd4ec=_[_0x2280('0xf')](_0x5eec79[_0x2280('0x24')])?[]:_0x5eec79['appdata'][_0x2280('0x26')](',');}var _0x33c1f9={'id':util[_0x2280('0x29')]('%s:%s:%s',_0x3353fb,_0x5eec79['id'],_0x5eec79[_0x2280('0x1c')]),'condition':require(_0x2280('0x2a'))[_0x2280('0x2b')](_0x3353fb,getIntervals(_0x55fab4['intervals'],_0x5eec79),_0x55fab4),'consequence':require(_0x2280('0x2c')+_0x5eec79[_0x2280('0x1c')])[_0x2280('0x2d')](_0x3353fb,_0x5dd4ec,_0x55fab4,_0x114203),'p':_0x5eec79[_0x2280('0x2e')]||0x0};logger['info'](_0x2280('0x2f'),_0x33c1f9['id'],_0x2280('0x30'),getIntervals(_0x55fab4[_0x2280('0x31')],_0x5eec79)['join'](_0x2280('0x32')));_0x380682[_0x2280('0x21')](_0x33c1f9);}else{logger[_0x2280('0x33')](_0x2280('0x34'),path[_0x2280('0x1b')](__dirname,_0x2280('0x17'),_0x5eec79['app']+_0x2280('0x1d')));}}_0x55fab4['rules'][_0x3353fb]=new RuleEngine(_0x380682);_0x55fab4[_0x2280('0x14')][_0x3353fb][_0x2280('0x35')](_0x114203,function(_0x2f172a){logger[_0x2280('0x36')]('Applications\x20executed',JSON[_0x2280('0x37')](_0x2f172a[_0x2280('0x38')]));if(_0x55fab4['rules'][_0x3353fb]){_0x55fab4['rules'][_0x3353fb][_0x2280('0x39')](_0x2280('0x3a'));}});return _0x22c2a7({'code':0xc8,'message':_0x114203});}else{logger[_0x2280('0x36')](_0x2280('0x3b'));return _0x22c2a7({'code':0xc8,'message':_0x114203});}}catch(_0xca7c29){logger[_0x2280('0x33')](_0xca7c29[_0x2280('0x3c')]);return _0x26e8de(_0x7ed80c[_0x2280('0x33')](0x1f4,_0xca7c29));}}return _0x26e8de(_0x2280('0x3d'));});},'AcceptMessage':function(_0x3056c6){var _0x1f6b92=this;return new Promise(function(_0x1d3f3c,_0x1484bd){if(_0x3056c6[_0x2280('0x3e')]&&_0x3056c6['agent']['id']){if(_0x55fab4['agents'][_0x3056c6[_0x2280('0x3e')]['id']]){_0x55fab4[_0x2280('0x3f')][_0x3056c6['agent']['id']][_0x2280('0x40')]=![];_0x55fab4[_0x2280('0x3f')][_0x3056c6['agent']['id']][_0x2280('0x41')]=undefined;}}if(_0x3056c6[_0x2280('0x15')]&&_0x3056c6[_0x2280('0x15')]['id']){try{var _0x5ea23a=getId(_0x3056c6[_0x2280('0x20')],_0x3056c6['message']?_0x3056c6[_0x2280('0x15')]['id']:0x0,_0x3056c6[_0x2280('0x16')]?_0x3056c6[_0x2280('0x16')]['id']:0x0);if(_0x55fab4[_0x2280('0x14')][_0x5ea23a]){_0x55fab4[_0x2280('0x14')][_0x5ea23a]['emit']('end');if(rpc[_0x3056c6[_0x2280('0x20')]+'QueueReport']){rpc[_0x3056c6[_0x2280('0x20')]+_0x2280('0x42')][_0x2280('0x43')](_0x5ea23a,{'UserId':_0x3056c6[_0x2280('0x15')][_0x2280('0x44')]})[_0x2280('0x45')](function(_0x2b3ddd){logger[_0x2280('0x33')](_0x2280('0x46'));});}}return _0x1d3f3c({'code':0xc8,'message':_0x3056c6});}catch(_0x5ec5ef){logger[_0x2280('0x33')](_0x5ec5ef['stack']);return _0x1484bd(_0x1f6b92[_0x2280('0x33')](0x1f4,_0x5ec5ef));}}logger[_0x2280('0x33')](_0x2280('0x47'));return _0x1484bd(_0x1f6b92[_0x2280('0x33')](0x1f4,_0x2280('0x47')));});},'RejectMessage':function(_0x4f4b7d){var _0x11ccce=this;return new Promise(function(_0x52bdbf,_0x50e2d9){if(_0x4f4b7d[_0x2280('0x3e')]&&_0x4f4b7d[_0x2280('0x3e')]['id']){try{if(_0x55fab4[_0x2280('0x3f')][_0x4f4b7d[_0x2280('0x3e')]['id']]){_0x55fab4[_0x2280('0x3f')][_0x4f4b7d['agent']['id']][_0x2280('0x40')]=![];_0x55fab4[_0x2280('0x3f')][_0x4f4b7d[_0x2280('0x3e')]['id']][_0x2280('0x41')]=undefined;}return _0x52bdbf({'code':0xc8,'message':_0x4f4b7d});}catch(_0x25422e){logger[_0x2280('0x33')](_0x25422e['stack']);return _0x50e2d9(_0x11ccce[_0x2280('0x33')](0x1f4,_0x25422e));}}logger['error'](_0x2280('0x47'));return _0x50e2d9(_0x11ccce[_0x2280('0x33')](0x1f4,_0x2280('0x47')));});},'AbandonInteraction':function(_0xc4f3c3){var _0x4a9283=this;return new Promise(function(_0xf5971,_0x1c1b53){if(_0xc4f3c3[_0x2280('0x20')]&&_0xc4f3c3[_0x2280('0x16')]&&_0xc4f3c3['interaction']['id']){try{var _0x2b86a7=getId(_0xc4f3c3[_0x2280('0x20')],_0xc4f3c3[_0x2280('0x15')]?_0xc4f3c3[_0x2280('0x15')]['id']:0x0,_0xc4f3c3[_0x2280('0x16')]?_0xc4f3c3[_0x2280('0x16')]['id']:0x0);if(_0x55fab4[_0x2280('0x14')][_0x2b86a7]){_0x55fab4[_0x2280('0x14')][_0x2b86a7][_0x2280('0x39')](_0x2280('0x48'));}return _0xf5971({'code':0xc8,'message':_0xc4f3c3});}catch(_0x4ca94b){logger[_0x2280('0x33')](_0x4ca94b[_0x2280('0x3c')]);return _0x1c1b53(_0x4a9283['error'](0x1f4,_0x4ca94b));}}logger[_0x2280('0x33')](_0x2280('0x47'));return _0x1c1b53(_0x4a9283['error'](0x1f4,_0x2280('0x47')));});},'AgentCapacity':function(_0x59c379){var _0x465acd=this;return new Promise(function(_0x265275,_0x3e38db){if(_0x55fab4[_0x2280('0x3f')][_0x2280('0x49')](_0x59c379['id'])){for(var _0x285d5b in _0x59c379[_0x2280('0x4a')]){if(_0x59c379[_0x2280('0x4a')][_0x2280('0x49')](_0x285d5b)){if(_0x55fab4['agents'][_0x59c379['id']]['hasOwnProperty'](_0x285d5b+'CurrentCapacity')){_0x55fab4[_0x2280('0x3f')][_0x59c379['id']][_0x285d5b+'CurrentCapacity']=parseInt(_0x59c379[_0x2280('0x4a')][_0x285d5b],0xa);}}}_0x55fab4['agents'][_0x59c379['id']][_0x2280('0x4b')]();return _0x265275({'code':0xc8,'message':_0x55fab4[_0x2280('0x3f')][_0x59c379['id']]});}else{return _0x3e38db(_0x465acd[_0x2280('0x33')](0x1f4,_0x2280('0x4c')));}});},'Agents':function(_0x18c90f){return new Promise(function(_0x79f9e4,_0x381bb8){var _0x4f8809=_[_0x2280('0x4d')](_0x55fab4[_0x2280('0x3f')]);_0x79f9e4({'count':_0x4f8809[_0x2280('0x19')],'rows':_0x4f8809});});},'ChatQueues':function(_0x416e73){return new Promise(function(_0x48d7d0,_0x472cad){var _0xade1ce=[];for(var _0x22f679 in _0x55fab4[_0x2280('0x4e')]){if(_0x55fab4[_0x2280('0x4e')][_0x2280('0x49')](_0x22f679)){var _0x3e2416=_0x55fab4[_0x2280('0x4e')][_0x22f679];var _0xca45fd={'id':_0x3e2416['id'],'available':_0x3e2416['available'],'loggedIn':_0x3e2416['loggedIn'],'name':_0x3e2416[_0x2280('0x4f')],'paused':_0x3e2416[_0x2280('0x50')],'waiting':_0x3e2416['waiting']};_0xade1ce[_0x2280('0x21')](_0xca45fd);}}_0x48d7d0({'count':_0xade1ce['length'],'rows':_0xade1ce});});},'MailQueues':function(_0x4e0a3e){return new Promise(function(_0x508afe,_0x4919e5){var _0x541fed=[];for(var _0x5db6ab in _0x55fab4[_0x2280('0x51')]){if(_0x55fab4[_0x2280('0x51')]['hasOwnProperty'](_0x5db6ab)){var _0x4d3e11=_0x55fab4[_0x2280('0x51')][_0x5db6ab];var _0x4fd50b={'id':_0x4d3e11['id'],'available':_0x4d3e11[_0x2280('0x52')],'loggedIn':_0x4d3e11['loggedIn'],'name':_0x4d3e11[_0x2280('0x4f')],'paused':_0x4d3e11[_0x2280('0x50')],'waiting':_0x4d3e11['waiting']};_0x541fed[_0x2280('0x21')](_0x4fd50b);}}_0x508afe({'count':_0x541fed['length'],'rows':_0x541fed});});},'OpenchannelQueues':function(_0x50bb83){return new Promise(function(_0x2e0f22,_0x52c7f8){var _0x1a0373=[];for(var _0x319594 in _0x55fab4[_0x2280('0x53')]){if(_0x55fab4[_0x2280('0x53')]['hasOwnProperty'](_0x319594)){var _0x45761d=_0x55fab4[_0x2280('0x53')][_0x319594];var _0x5cecfb={'id':_0x45761d['id'],'available':_0x45761d[_0x2280('0x52')],'loggedIn':_0x45761d[_0x2280('0x54')],'name':_0x45761d[_0x2280('0x4f')],'paused':_0x45761d[_0x2280('0x50')],'waiting':_0x45761d[_0x2280('0x55')]};_0x1a0373['push'](_0x5cecfb);}}_0x2e0f22({'count':_0x1a0373[_0x2280('0x19')],'rows':_0x1a0373});});},'SmsQueues':function(_0x5ca66d){return new Promise(function(_0x5e7575,_0x2005a3){var _0x1ab557=[];for(var _0x3fcf57 in _0x55fab4[_0x2280('0x56')]){if(_0x55fab4[_0x2280('0x56')][_0x2280('0x49')](_0x3fcf57)){var _0x44ff98=_0x55fab4[_0x2280('0x56')][_0x3fcf57];var _0xd19860={'id':_0x44ff98['id'],'available':_0x44ff98['available'],'loggedIn':_0x44ff98[_0x2280('0x54')],'name':_0x44ff98[_0x2280('0x4f')],'paused':_0x44ff98['paused'],'waiting':_0x44ff98[_0x2280('0x55')]};_0x1ab557['push'](_0xd19860);}}_0x5e7575({'count':_0x1ab557[_0x2280('0x19')],'rows':_0x1ab557});});},'FaxQueues':function(_0x2f9653){return new Promise(function(_0x5d160f,_0x474945){var _0x25c22e=[];for(var _0x80bd4e in _0x55fab4[_0x2280('0x57')]){if(_0x55fab4['faxQueues'][_0x2280('0x49')](_0x80bd4e)){var _0x522280=_0x55fab4[_0x2280('0x57')][_0x80bd4e];var _0x49605a={'id':_0x522280['id'],'available':_0x522280[_0x2280('0x52')],'loggedIn':_0x522280[_0x2280('0x54')],'name':_0x522280[_0x2280('0x4f')],'paused':_0x522280[_0x2280('0x50')],'waiting':_0x522280[_0x2280('0x55')]};_0x25c22e['push'](_0x49605a);}}_0x5d160f({'count':_0x25c22e[_0x2280('0x19')],'rows':_0x25c22e});});},'WhatsappQueues':function(_0x21877f){return new Promise(function(_0x3abbda,_0x5370e8){var _0x2bf5fe=[];for(var _0x143e93 in _0x55fab4['whatsappQueues']){if(_0x55fab4['whatsappQueues']['hasOwnProperty'](_0x143e93)){var _0x28f2a7=_0x55fab4[_0x2280('0x58')][_0x143e93];var _0x12b6be={'id':_0x28f2a7['id'],'available':_0x28f2a7['available'],'loggedIn':_0x28f2a7[_0x2280('0x54')],'name':_0x28f2a7[_0x2280('0x4f')],'paused':_0x28f2a7['paused'],'waiting':_0x28f2a7['waiting']};_0x2bf5fe[_0x2280('0x21')](_0x12b6be);}}_0x3abbda({'count':_0x2bf5fe[_0x2280('0x19')],'rows':_0x2bf5fe});});},'ChatQueuesWaitingInteractions':function(_0x1349b2){return new Promise(function(_0x185db9,_0x3acc31){var _0x5e0f15=_['values'](_0x55fab4['chatQueuesWaitingInteractions']);_0x185db9({'count':_0x5e0f15['length'],'rows':_0x5e0f15});});},'MailQueuesWaitingInteractions':function(_0x5403ad){return new Promise(function(_0x528055,_0x18ea1c){var _0x32734a=_[_0x2280('0x4d')](_0x55fab4[_0x2280('0x59')]);_0x528055({'count':_0x32734a[_0x2280('0x19')],'rows':_0x32734a});});},'OpenchannelQueuesWaitingInteractions':function(_0x54f622){return new Promise(function(_0x387ce1,_0x417e0a){var _0x1917c8=_[_0x2280('0x4d')](_0x55fab4[_0x2280('0x5a')]);_0x387ce1({'count':_0x1917c8[_0x2280('0x19')],'rows':_0x1917c8});});},'SmsQueuesWaitingInteractions':function(_0x22d86e){return new Promise(function(_0x563082,_0x1df4c8){var _0x1c90b5=_[_0x2280('0x4d')](_0x55fab4[_0x2280('0x5b')]);_0x563082({'count':_0x1c90b5[_0x2280('0x19')],'rows':_0x1c90b5});});},'FaxQueuesWaitingInteractions':function(_0x1c0d62){return new Promise(function(_0x28f454,_0x46d22d){var _0x42df4e=_[_0x2280('0x4d')](_0x55fab4['faxQueuesWaitingInteractions']);_0x28f454({'count':_0x42df4e['length'],'rows':_0x42df4e});});},'WhatsappQueuesWaitingInteractions':function(_0x3a8876){return new Promise(function(_0x5b79d1,_0x3fd341){var _0x55246c=_[_0x2280('0x4d')](_0x55fab4['whatsappQueuesWaitingInteractions']);_0x5b79d1({'count':_0x55246c['length'],'rows':_0x55246c});});}};var _0x12035c=jayson[_0x2280('0x5c')](_0x17535a)[_0x2280('0x5d')]();_0x12035c['on'](_0x2280('0x33'),function(_0x3c03c8){logger['error'](JSON[_0x2280('0x37')](_0x3c03c8));return _0x47621c(_0x3c03c8);});_0x12035c[_0x2280('0x13')](0x232c,'127.0.0.1',function(){console[_0x2280('0x5e')](_0x2280('0x5f'),0x232c);return _0x79ccba('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x10d0=['busy','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','error','routing\x20is\x20empty','agent','agents'];(function(_0x2a52bc,_0x18f2dc){var _0x1d8d55=function(_0x50cdf7){while(--_0x50cdf7){_0x2a52bc['push'](_0x2a52bc['shift']());}};_0x1d8d55(++_0x18f2dc);}(_0x10d0,0x13c));var _0x010d=function(_0x4b35b6,_0x101958){_0x4b35b6=_0x4b35b6-0x0;var _0x26df33=_0x10d0[_0x4b35b6];return _0x26df33;};'use strict';var _=require(_0x010d('0x0'));var util=require(_0x010d('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x010d('0x2'));var BPromise=require('bluebird');var uuid=require(_0x010d('0x3'));var config=require('../../../config/environment');var logger=require(_0x010d('0x4'))(_0x010d('0x5'));var rpc={'openchannelQueueReport':require(_0x010d('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x010d('0x7')),'smsQueueReport':require(_0x010d('0x8')),'faxQueueReport':require(_0x010d('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x010d('0xa'));function getId(_0x19a106,_0x2f9013,_0x2483ca){return util[_0x010d('0xb')](_0x010d('0xc'),_0x19a106,_0x2f9013||0x0,_0x2483ca||0x0);}function getIntervals(_0x282aad,_0x5e8f75){var _0x2460eb=[];if(!_['isNil'](_0x5e8f75[_0x010d('0xd')])&&!_[_0x010d('0xe')](_0x282aad[_0x5e8f75[_0x010d('0xd')]])&&!_[_0x010d('0xe')](_0x282aad[_0x5e8f75[_0x010d('0xd')]][_0x010d('0xf')])){_0x2460eb=_[_0x010d('0x10')](_0x282aad[_0x5e8f75['IntervalId']][_0x010d('0xf')],'interval');}else if(!_[_0x010d('0xe')](_0x5e8f75[_0x010d('0x11')])){_0x2460eb=[_0x5e8f75[_0x010d('0x11')]];}return _0x2460eb;}exports[_0x010d('0x12')]=function(_0x1e8fd5){_0x1e8fd5[_0x010d('0x13')]={};return new BPromise(function(_0x59f22b,_0x5cb293){var _0x38ec46={'Start':function(_0x5df8ce){var _0x516f08=this;return new Promise(function(_0x56741d,_0x589a75){if(_0x5df8ce){try{var _0x16b86d=[];var _0x589f2f=getId(_0x5df8ce[_0x010d('0x14')],_0x5df8ce[_0x010d('0x15')]?_0x5df8ce[_0x010d('0x15')]['id']:0x0,_0x5df8ce[_0x010d('0x16')]?_0x5df8ce[_0x010d('0x16')]['id']:0x0);if(_0x5df8ce['applications']&&_[_0x010d('0x17')](_0x5df8ce[_0x010d('0x18')])&&_0x5df8ce[_0x010d('0x18')]['length']){for(var _0x548bf1=0x0;_0x548bf1<_0x5df8ce['applications'][_0x010d('0x19')];_0x548bf1+=0x1){var _0x4c0ff9=_0x5df8ce[_0x010d('0x18')][_0x548bf1];if(fs['existsSync'](path[_0x010d('0x1a')](__dirname,_0x010d('0x18'),_0x4c0ff9['app']+_0x010d('0x1b')))){var _0x351333=[];switch(_0x4c0ff9[_0x010d('0x1c')][_0x010d('0x1d')]()){case _0x010d('0x1e'):var _0x500efa=_0x4c0ff9[_0x010d('0x1f')][_0x010d('0x20')](',');if(_0x5df8ce['channel']===_0x010d('0x21')){_0x351333[_0x010d('0x22')](_0x500efa[0x0]);_0x351333[_0x010d('0x22')](_0x500efa[0x1]);_0x351333[_0x010d('0x22')](_0x500efa['slice'](0x2,_0x500efa[_0x010d('0x19')])[_0x010d('0x1a')](','));}else{_0x351333['push'](_0x500efa[0x0]);_0x351333['push'](_0x500efa[_0x010d('0x23')](0x1,_0x500efa[_0x010d('0x19')])['join'](','));}break;case _0x010d('0x24'):var _0x32fc8b=_0x4c0ff9[_0x010d('0x1f')][_0x010d('0x20')](',');_0x351333[_0x010d('0x22')](_0x32fc8b[0x0]);_0x351333[_0x010d('0x22')](_0x32fc8b[0x1]);_0x351333['push'](_0x32fc8b[_0x010d('0x23')](0x2,_0x32fc8b['length'])[_0x010d('0x1a')](','));break;case _0x010d('0x25'):var _0x139bed=_0x4c0ff9['appdata'][_0x010d('0x20')](',');_0x351333['push'](_0x139bed[0x0]);_0x351333[_0x010d('0x22')](_0x139bed[0x1]);_0x351333[_0x010d('0x22')](_0x139bed[0x2]);_0x351333['push'](_0x139bed[0x3]);_0x351333[_0x010d('0x22')](_0x139bed[_0x010d('0x23')](0x4,_0x139bed['length'])[_0x010d('0x1a')](','));break;case _0x010d('0x26'):var _0x54b1d6=_0x4c0ff9[_0x010d('0x1f')][_0x010d('0x20')](',');_0x351333['push'](_0x54b1d6[0x0]);_0x351333['push'](_0x54b1d6[0x1]);_0x351333[_0x010d('0x22')](_0x54b1d6[0x2]);_0x351333[_0x010d('0x22')](_0x54b1d6[0x3]);_0x351333['push'](_0x54b1d6['slice'](0x4,_0x54b1d6[_0x010d('0x19')])['join'](','));break;case'message':_0x351333[_0x010d('0x22')](_0x4c0ff9[_0x010d('0x1f')]);break;case'tag':_0x351333[_0x010d('0x22')](_0x4c0ff9[_0x010d('0x27')]);_0x351333['push'](_0x4c0ff9[_0x010d('0x1f')]);break;default:_0x351333=_[_0x010d('0xe')](_0x4c0ff9[_0x010d('0x1f')])?[]:_0x4c0ff9[_0x010d('0x1f')]['split'](',');}var _0x1554e8={'id':util[_0x010d('0xb')]('%s:%s:%s',_0x589f2f,_0x4c0ff9['id'],_0x4c0ff9[_0x010d('0x1c')]),'condition':require(_0x010d('0x28'))[_0x010d('0x29')](_0x589f2f,getIntervals(_0x1e8fd5[_0x010d('0x2a')],_0x4c0ff9),_0x1e8fd5),'consequence':require(_0x010d('0x2b')+_0x4c0ff9[_0x010d('0x1c')])[_0x010d('0x2c')](_0x589f2f,_0x351333,_0x1e8fd5,_0x5df8ce),'p':_0x4c0ff9[_0x010d('0x2d')]||0x0};logger[_0x010d('0x2e')](_0x010d('0x2f'),_0x1554e8['id'],_0x010d('0x30'),getIntervals(_0x1e8fd5[_0x010d('0x2a')],_0x4c0ff9)[_0x010d('0x1a')](_0x010d('0x31')));_0x16b86d['push'](_0x1554e8);}else{logger['error'](_0x010d('0x32'),path['join'](__dirname,_0x010d('0x18'),_0x4c0ff9[_0x010d('0x1c')]+_0x010d('0x1b')));}}_0x1e8fd5[_0x010d('0x13')][_0x589f2f]=new RuleEngine(_0x16b86d);_0x1e8fd5[_0x010d('0x13')][_0x589f2f][_0x010d('0x33')](_0x5df8ce,function(_0x189afa){logger[_0x010d('0x2e')]('Applications\x20executed',JSON[_0x010d('0x34')](_0x189afa[_0x010d('0x35')]));if(_0x1e8fd5[_0x010d('0x13')][_0x589f2f]){_0x1e8fd5[_0x010d('0x13')][_0x589f2f][_0x010d('0x36')](_0x010d('0x37'));}});return _0x56741d({'code':0xc8,'message':_0x5df8ce});}else{logger[_0x010d('0x2e')]('No\x20applications\x20to\x20execute');return _0x56741d({'code':0xc8,'message':_0x5df8ce});}}catch(_0x5a24bb){logger['error'](_0x5a24bb['stack']);return _0x589a75(_0x516f08[_0x010d('0x38')](0x1f4,_0x5a24bb));}}return _0x589a75(_0x010d('0x39'));});},'AcceptMessage':function(_0x7cef98){var _0x29248f=this;return new Promise(function(_0x500b97,_0x153410){if(_0x7cef98['agent']&&_0x7cef98[_0x010d('0x3a')]['id']){if(_0x1e8fd5[_0x010d('0x3b')][_0x7cef98[_0x010d('0x3a')]['id']]){_0x1e8fd5[_0x010d('0x3b')][_0x7cef98[_0x010d('0x3a')]['id']][_0x010d('0x3c')]=![];_0x1e8fd5[_0x010d('0x3b')][_0x7cef98[_0x010d('0x3a')]['id']]['busyQueue']=undefined;}}if(_0x7cef98[_0x010d('0x15')]&&_0x7cef98[_0x010d('0x15')]['id']){try{var _0x4b8418=getId(_0x7cef98[_0x010d('0x14')],_0x7cef98[_0x010d('0x15')]?_0x7cef98[_0x010d('0x15')]['id']:0x0,_0x7cef98[_0x010d('0x16')]?_0x7cef98[_0x010d('0x16')]['id']:0x0);if(_0x1e8fd5[_0x010d('0x13')][_0x4b8418]){_0x1e8fd5[_0x010d('0x13')][_0x4b8418][_0x010d('0x36')](_0x010d('0x3d'));if(rpc[_0x7cef98['channel']+_0x010d('0x3e')]){rpc[_0x7cef98[_0x010d('0x14')]+_0x010d('0x3e')]['update'](_0x4b8418,{'UserId':_0x7cef98[_0x010d('0x15')][_0x010d('0x3f')]})[_0x010d('0x40')](function(_0x3adbab){logger[_0x010d('0x38')](_0x010d('0x41'));});}}return _0x500b97({'code':0xc8,'message':_0x7cef98});}catch(_0x5d8805){logger[_0x010d('0x38')](_0x5d8805[_0x010d('0x42')]);return _0x153410(_0x29248f[_0x010d('0x38')](0x1f4,_0x5d8805));}}logger[_0x010d('0x38')](_0x010d('0x43'));return _0x153410(_0x29248f[_0x010d('0x38')](0x1f4,_0x010d('0x43')));});},'RejectMessage':function(_0x4e929f){var _0x5229a8=this;return new Promise(function(_0x10689f,_0x43dad0){if(_0x4e929f[_0x010d('0x3a')]&&_0x4e929f[_0x010d('0x3a')]['id']){try{if(_0x1e8fd5[_0x010d('0x3b')][_0x4e929f['agent']['id']]){_0x1e8fd5[_0x010d('0x3b')][_0x4e929f[_0x010d('0x3a')]['id']][_0x010d('0x3c')]=![];_0x1e8fd5[_0x010d('0x3b')][_0x4e929f[_0x010d('0x3a')]['id']]['busyQueue']=undefined;}return _0x10689f({'code':0xc8,'message':_0x4e929f});}catch(_0x1a214d){logger[_0x010d('0x38')](_0x1a214d[_0x010d('0x42')]);return _0x43dad0(_0x5229a8[_0x010d('0x38')](0x1f4,_0x1a214d));}}logger[_0x010d('0x38')](_0x010d('0x43'));return _0x43dad0(_0x5229a8[_0x010d('0x38')](0x1f4,_0x010d('0x43')));});},'AbandonInteraction':function(_0x21dcde){var _0x16f964=this;return new Promise(function(_0x354bf2,_0x2dae6a){if(_0x21dcde['channel']&&_0x21dcde[_0x010d('0x16')]&&_0x21dcde[_0x010d('0x16')]['id']){try{var _0x448ab8=getId(_0x21dcde[_0x010d('0x14')],_0x21dcde['message']?_0x21dcde['message']['id']:0x0,_0x21dcde[_0x010d('0x16')]?_0x21dcde[_0x010d('0x16')]['id']:0x0);if(_0x1e8fd5[_0x010d('0x13')][_0x448ab8]){_0x1e8fd5[_0x010d('0x13')][_0x448ab8][_0x010d('0x36')](_0x010d('0x3d'));}return _0x354bf2({'code':0xc8,'message':_0x21dcde});}catch(_0x523fce){logger[_0x010d('0x38')](_0x523fce[_0x010d('0x42')]);return _0x2dae6a(_0x16f964[_0x010d('0x38')](0x1f4,_0x523fce));}}logger[_0x010d('0x38')](_0x010d('0x43'));return _0x2dae6a(_0x16f964[_0x010d('0x38')](0x1f4,_0x010d('0x43')));});},'AgentCapacity':function(_0x4de434){var _0x35ae2f=this;return new Promise(function(_0x29bfe2,_0x5f12cd){if(_0x1e8fd5['agents'][_0x010d('0x44')](_0x4de434['id'])){for(var _0x54c4db in _0x4de434[_0x010d('0x45')]){if(_0x4de434[_0x010d('0x45')][_0x010d('0x44')](_0x54c4db)){if(_0x1e8fd5[_0x010d('0x3b')][_0x4de434['id']][_0x010d('0x44')](_0x54c4db+'CurrentCapacity')){_0x1e8fd5[_0x010d('0x3b')][_0x4de434['id']][_0x54c4db+_0x010d('0x46')]=parseInt(_0x4de434[_0x010d('0x45')][_0x54c4db],0xa);}}}_0x1e8fd5[_0x010d('0x3b')][_0x4de434['id']][_0x010d('0x47')]();return _0x29bfe2({'code':0xc8,'message':_0x1e8fd5[_0x010d('0x3b')][_0x4de434['id']]});}else{return _0x5f12cd(_0x35ae2f['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4ea7d7){return new Promise(function(_0x77fb39,_0x2f1cd2){var _0x43386e=_[_0x010d('0x48')](_0x1e8fd5[_0x010d('0x3b')]);_0x77fb39({'count':_0x43386e[_0x010d('0x19')],'rows':_0x43386e});});},'ChatQueues':function(_0x5910b9){return new Promise(function(_0xfbf1a,_0x420728){var _0x12fb04=[];for(var _0x309d29 in _0x1e8fd5[_0x010d('0x49')]){if(_0x1e8fd5[_0x010d('0x49')][_0x010d('0x44')](_0x309d29)){var _0x494c5c=_0x1e8fd5[_0x010d('0x49')][_0x309d29];var _0x1bda51={'id':_0x494c5c['id'],'available':_0x494c5c[_0x010d('0x4a')],'loggedIn':_0x494c5c[_0x010d('0x4b')],'name':_0x494c5c[_0x010d('0x4c')],'paused':_0x494c5c[_0x010d('0x4d')],'waiting':_0x494c5c[_0x010d('0x4e')]};_0x12fb04['push'](_0x1bda51);}}_0xfbf1a({'count':_0x12fb04[_0x010d('0x19')],'rows':_0x12fb04});});},'MailQueues':function(_0x291fcb){return new Promise(function(_0x5d2a9b,_0x9c3c7d){var _0x5c11f0=[];for(var _0x19b757 in _0x1e8fd5[_0x010d('0x4f')]){if(_0x1e8fd5['mailQueues'][_0x010d('0x44')](_0x19b757)){var _0x5ecde6=_0x1e8fd5[_0x010d('0x4f')][_0x19b757];var _0xbc60f2={'id':_0x5ecde6['id'],'available':_0x5ecde6[_0x010d('0x4a')],'loggedIn':_0x5ecde6[_0x010d('0x4b')],'name':_0x5ecde6[_0x010d('0x4c')],'paused':_0x5ecde6['paused'],'waiting':_0x5ecde6['waiting']};_0x5c11f0['push'](_0xbc60f2);}}_0x5d2a9b({'count':_0x5c11f0[_0x010d('0x19')],'rows':_0x5c11f0});});},'OpenchannelQueues':function(_0x12e761){return new Promise(function(_0x1e66da,_0x131b71){var _0x1b79a5=[];for(var _0x11f9f9 in _0x1e8fd5['openchannelQueues']){if(_0x1e8fd5[_0x010d('0x50')][_0x010d('0x44')](_0x11f9f9)){var _0x593a9c=_0x1e8fd5[_0x010d('0x50')][_0x11f9f9];var _0x590a32={'id':_0x593a9c['id'],'available':_0x593a9c['available'],'loggedIn':_0x593a9c[_0x010d('0x4b')],'name':_0x593a9c[_0x010d('0x4c')],'paused':_0x593a9c[_0x010d('0x4d')],'waiting':_0x593a9c['waiting']};_0x1b79a5[_0x010d('0x22')](_0x590a32);}}_0x1e66da({'count':_0x1b79a5[_0x010d('0x19')],'rows':_0x1b79a5});});},'SmsQueues':function(_0x3e457b){return new Promise(function(_0x4e5bad,_0x310941){var _0xa362f=[];for(var _0x14734f in _0x1e8fd5[_0x010d('0x51')]){if(_0x1e8fd5[_0x010d('0x51')]['hasOwnProperty'](_0x14734f)){var _0x3d99b2=_0x1e8fd5['smsQueues'][_0x14734f];var _0x904c72={'id':_0x3d99b2['id'],'available':_0x3d99b2[_0x010d('0x4a')],'loggedIn':_0x3d99b2[_0x010d('0x4b')],'name':_0x3d99b2[_0x010d('0x4c')],'paused':_0x3d99b2[_0x010d('0x4d')],'waiting':_0x3d99b2[_0x010d('0x4e')]};_0xa362f[_0x010d('0x22')](_0x904c72);}}_0x4e5bad({'count':_0xa362f['length'],'rows':_0xa362f});});},'FaxQueues':function(_0xbe31cb){return new Promise(function(_0x4a2608,_0x203297){var _0x2f4252=[];for(var _0x1ca65c in _0x1e8fd5['faxQueues']){if(_0x1e8fd5[_0x010d('0x52')]['hasOwnProperty'](_0x1ca65c)){var _0x3c62e2=_0x1e8fd5[_0x010d('0x52')][_0x1ca65c];var _0x31476f={'id':_0x3c62e2['id'],'available':_0x3c62e2['available'],'loggedIn':_0x3c62e2[_0x010d('0x4b')],'name':_0x3c62e2[_0x010d('0x4c')],'paused':_0x3c62e2[_0x010d('0x4d')],'waiting':_0x3c62e2[_0x010d('0x4e')]};_0x2f4252[_0x010d('0x22')](_0x31476f);}}_0x4a2608({'count':_0x2f4252[_0x010d('0x19')],'rows':_0x2f4252});});},'WhatsappQueues':function(_0x4a42dd){return new Promise(function(_0x73e00b,_0x47f04d){var _0x5d655b=[];for(var _0x2362ab in _0x1e8fd5[_0x010d('0x53')]){if(_0x1e8fd5[_0x010d('0x53')]['hasOwnProperty'](_0x2362ab)){var _0x7cbca4=_0x1e8fd5[_0x010d('0x53')][_0x2362ab];var _0x5e274c={'id':_0x7cbca4['id'],'available':_0x7cbca4['available'],'loggedIn':_0x7cbca4[_0x010d('0x4b')],'name':_0x7cbca4[_0x010d('0x4c')],'paused':_0x7cbca4[_0x010d('0x4d')],'waiting':_0x7cbca4[_0x010d('0x4e')]};_0x5d655b[_0x010d('0x22')](_0x5e274c);}}_0x73e00b({'count':_0x5d655b[_0x010d('0x19')],'rows':_0x5d655b});});},'ChatQueuesWaitingInteractions':function(_0x34d835){return new Promise(function(_0x4d47cd,_0x24d1f9){var _0x2f331d=_['values'](_0x1e8fd5[_0x010d('0x54')]);_0x4d47cd({'count':_0x2f331d[_0x010d('0x19')],'rows':_0x2f331d});});},'MailQueuesWaitingInteractions':function(_0x1f16a0){return new Promise(function(_0x595844,_0x20e959){var _0x24240d=_['values'](_0x1e8fd5[_0x010d('0x55')]);_0x595844({'count':_0x24240d[_0x010d('0x19')],'rows':_0x24240d});});},'OpenchannelQueuesWaitingInteractions':function(_0x64b6a5){return new Promise(function(_0x26aae1,_0x4739a2){var _0x405273=_[_0x010d('0x48')](_0x1e8fd5[_0x010d('0x56')]);_0x26aae1({'count':_0x405273[_0x010d('0x19')],'rows':_0x405273});});},'SmsQueuesWaitingInteractions':function(_0x42aba1){return new Promise(function(_0x482aa4,_0x194074){var _0x552cf9=_[_0x010d('0x48')](_0x1e8fd5[_0x010d('0x57')]);_0x482aa4({'count':_0x552cf9['length'],'rows':_0x552cf9});});},'FaxQueuesWaitingInteractions':function(_0x55130d){return new Promise(function(_0x4e4ecd,_0x48818f){var _0x348811=_[_0x010d('0x48')](_0x1e8fd5[_0x010d('0x58')]);_0x4e4ecd({'count':_0x348811[_0x010d('0x19')],'rows':_0x348811});});},'WhatsappQueuesWaitingInteractions':function(_0x5d7e5f){return new Promise(function(_0x519eb5,_0x1b8ad6){var _0x294ff3=_[_0x010d('0x48')](_0x1e8fd5[_0x010d('0x59')]);_0x519eb5({'count':_0x294ff3[_0x010d('0x19')],'rows':_0x294ff3});});}};var _0x40fc70=jayson[_0x010d('0x5a')](_0x38ec46)[_0x010d('0x5b')]();_0x40fc70['on'](_0x010d('0x38'),function(_0x67fb5){logger[_0x010d('0x38')](JSON[_0x010d('0x34')](_0x67fb5));return _0x5cb293(_0x67fb5);});_0x40fc70[_0x010d('0x12')](0x232c,'127.0.0.1',function(){console[_0x010d('0x5c')](_0x010d('0x5d'),0x232c);return _0x59f22b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 4da8555..dfb1293 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 _0xe51a=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','then','indexOf','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','catch','stop','util','bluebird','jayson/promise','routing','client','http','request','error','message','condition','rules','info'];(function(_0x31fc49,_0x428879){var _0x2b75ef=function(_0xb55e25){while(--_0xb55e25){_0x31fc49['push'](_0x31fc49['shift']());}};_0x2b75ef(++_0x428879);}(_0xe51a,0x1bf));var _0xae51=function(_0x4b38c4,_0x19d545){_0x4b38c4=_0x4b38c4-0x0;var _0x2015a4=_0xe51a[_0x4b38c4];return _0x2015a4;};'use strict';var util=require(_0xae51('0x0'));var BPromise=require(_0xae51('0x1'));var jayson=require(_0xae51('0x2'));var _=require('lodash');var logger=require('../../../config/logger')(_0xae51('0x3'));var client=jayson[_0xae51('0x4')][_0xae51('0x5')]({'port':0x232a});function request(_0x2e3a99,_0x31b02e){return new BPromise(function(_0x4f58c1,_0x1faf5a){return client[_0xae51('0x6')](_0x2e3a99,_0x31b02e)['then'](function(_0x14588d){if(_0x14588d['error']){return _0x1faf5a(_0x14588d[_0xae51('0x7')][_0xae51('0x8')]);}else{return _0x4f58c1(_0x14588d['result']);}})['catch'](function(_0x1a4a72){return _0x1faf5a(_0x1a4a72);});});}exports[_0xae51('0x9')]=function(_0x1a841a,_0x4bde72,_0x37feaa){return function(_0x4ca21c){if(_0x37feaa[_0xae51('0xa')]&&!_0x37feaa[_0xae51('0xa')][_0x1a841a]){logger[_0xae51('0xb')](_0xae51('0xc'),_0x1a841a);return _0x4ca21c['stop']();}var _0x33d0b4=[];for(var _0x2ea4f4=0x0;_0x2ea4f4<_0x4bde72[_0xae51('0xd')];_0x2ea4f4+=0x1){_0x33d0b4[_0xae51('0xe')](request('Command',{'command':util[_0xae51('0xf')](_0xae51('0x10'),_0x4bde72[_0x2ea4f4])})[_0xae51('0x11')](function(_0x2009d6){return _0x2009d6&&_0x2009d6[_0xae51('0x8')]&&_0x2009d6['message'][_0xae51('0x12')]('true')>=0x0?!![]:![];})['catch'](function(_0x571087){logger[_0xae51('0x7')](_0xae51('0x13'),_0x1a841a,_0x4bde72[_0x2ea4f4]);}));}BPromise['all'](_0x33d0b4)[_0xae51('0x11')](function(_0x4539a1){var _0x4039e6=_[_0xae51('0x14')](_0x4539a1);logger[_0xae51('0xb')](_0xae51('0x15'),_0x1a841a,_0x4bde72[_0xae51('0x16')](_0xae51('0x17')),_0x4039e6);_0x4ca21c[_0xae51('0x18')](_0x4039e6);})[_0xae51('0x19')](function(_0x21ba26){console['log'](_0x21ba26);logger[_0xae51('0x7')](_0xae51('0x15'),_0x1a841a,_0x4bde72[_0xae51('0x16')](_0xae51('0x17')),_0x21ba26['stack']);_0x4ca21c[_0xae51('0x1a')]();});};}; \ No newline at end of file +var _0x13bf=['routing','client','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0x4075e1,_0x552d7a){var _0x1617c1=function(_0x5e65d8){while(--_0x5e65d8){_0x4075e1['push'](_0x4075e1['shift']());}};_0x1617c1(++_0x552d7a);}(_0x13bf,0xfb));var _0xf13b=function(_0x1a696d,_0x521c30){_0x1a696d=_0x1a696d-0x0;var _0x18fb1a=_0x13bf[_0x1a696d];return _0x18fb1a;};'use strict';var util=require(_0xf13b('0x0'));var BPromise=require(_0xf13b('0x1'));var jayson=require(_0xf13b('0x2'));var _=require(_0xf13b('0x3'));var logger=require(_0xf13b('0x4'))(_0xf13b('0x5'));var client=jayson[_0xf13b('0x6')][_0xf13b('0x7')]({'port':0x232a});function request(_0x205b72,_0x42aa9a){return new BPromise(function(_0xc1eec0,_0x266679){return client[_0xf13b('0x8')](_0x205b72,_0x42aa9a)['then'](function(_0x20fc55){if(_0x20fc55[_0xf13b('0x9')]){return _0x266679(_0x20fc55[_0xf13b('0x9')][_0xf13b('0xa')]);}else{return _0xc1eec0(_0x20fc55[_0xf13b('0xb')]);}})[_0xf13b('0xc')](function(_0x50ebd2){return _0x266679(_0x50ebd2);});});}exports[_0xf13b('0xd')]=function(_0x1172cb,_0x3e89c4,_0x4d5824){return function(_0xc13cc0){if(_0x4d5824[_0xf13b('0xe')]&&!_0x4d5824[_0xf13b('0xe')][_0x1172cb]){logger[_0xf13b('0xf')](_0xf13b('0x10'),_0x1172cb);return _0xc13cc0[_0xf13b('0x11')]();}var _0x12caa7=[];for(var _0x10f688=0x0;_0x10f688<_0x3e89c4['length'];_0x10f688+=0x1){_0x12caa7[_0xf13b('0x12')](request(_0xf13b('0x13'),{'command':util['format'](_0xf13b('0x14'),_0x3e89c4[_0x10f688])})[_0xf13b('0x15')](function(_0x1199f0){return _0x1199f0&&_0x1199f0[_0xf13b('0xa')]&&_0x1199f0['message'][_0xf13b('0x16')](_0xf13b('0x17'))>=0x0?!![]:![];})[_0xf13b('0xc')](function(_0x3475e6){logger['error'](_0xf13b('0x18'),_0x1172cb,_0x3e89c4[_0x10f688]);}));}BPromise['all'](_0x12caa7)[_0xf13b('0x15')](function(_0xca0422){var _0x3dc1db=_[_0xf13b('0x19')](_0xca0422);logger[_0xf13b('0xf')](_0xf13b('0x1a'),_0x1172cb,_0x3e89c4[_0xf13b('0x1b')](_0xf13b('0x1c')),_0x3dc1db);_0xc13cc0[_0xf13b('0x1d')](_0x3dc1db);})[_0xf13b('0xc')](function(_0x50e5d3){console[_0xf13b('0x1e')](_0x50e5d3);logger['error'](_0xf13b('0x1a'),_0x1172cb,_0x3e89c4[_0xf13b('0x1b')](_0xf13b('0x1c')),_0x50e5d3[_0xf13b('0x1f')]);_0xc13cc0['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 3421b1c..f83ce76 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 _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x2bd491,_0x2058ab){var _0x385c13=function(_0x2090c6){while(--_0x2090c6){_0x2bd491['push'](_0x2bd491['shift']());}};_0x385c13(++_0x2058ab);}(_0x2f68,0x9a));var _0x82f6=function(_0x351ece,_0x13807e){_0x351ece=_0x351ece-0x0;var _0x57c3cb=_0x2f68[_0x351ece];return _0x57c3cb;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file +var _0x6b20=['includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','error','queuecallerabandon','forIn'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6b20,0xd1));var _0x06b2=function(_0x88d953,_0x2576ce){_0x88d953=_0x88d953-0x0;var _0xbee18b=_0x6b20[_0x88d953];return _0xbee18b;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x2d5e24,_0x54947c){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x4'),_0x2d5e24['uniqueid'],_0x2d5e24[_0x06b2('0x5')],_0x2d5e24[_0x06b2('0x6')],_0x2d5e24[_0x06b2('0x7')],_0x2d5e24[_0x06b2('0x8')],_0x2d5e24[_0x06b2('0x9')],_0x2d5e24[_0x06b2('0xa')],_0x2d5e24[_0x06b2('0xb')]));if(_0x2d5e24['queue']){utils[_0x06b2('0xc')](_0x2d5e24[_0x06b2('0x6')])[_0x06b2('0xd')](function(_0x58538a){if(_0x58538a){_0x2d5e24[_0x06b2('0xe')]=_0x58538a['type'];_0x2d5e24[_0x06b2('0xf')]=_0x2d5e24['agentcomplete']?_0x58538a['acw']:![];_0x2d5e24[_0x06b2('0x10')]=_0x2d5e24[_0x06b2('0xf')]?_0x58538a['acwTimeout']:0x0;}utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);});}else{utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);}if(_0x54947c){delete transfers[_0x2d5e24[_0x06b2('0x13')]];}else{delete agents[_0x2d5e24[_0x06b2('0x14')]];}}exports[_0x06b2('0x15')]=function(_0x926bf6){try{utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x926bf6);agents[_0x926bf6[_0x06b2('0x14')]]=_0x926bf6;agents[_0x926bf6['destuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x1a');agents[_0x926bf6[_0x06b2('0x14')]]['connectedlinenum']=null;agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x1b')]=null;utils['info'](util[_0x06b2('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x926bf6['uniqueid'],agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x7')],_0x926bf6[_0x06b2('0x14')]));}catch(_0x2182f3){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x2182f3);}};exports[_0x06b2('0x1c')]=function(_0xe28985){try{if(!_[_0x06b2('0x1d')](agents[_0xe28985[_0x06b2('0x14')]])){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0xe28985);utils[_0x06b2('0x2')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0xe28985[_0x06b2('0x13')],agents[_0xe28985[_0x06b2('0x14')]]['membername'],_0xe28985[_0x06b2('0x14')]));agents[_0xe28985['destuniqueid']][_0x06b2('0x1c')]=!![];agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x1f')]=utils['now']();agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x20');agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x21')]='timeout';agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x22')]=_0xe28985[_0x06b2('0x23')]?parseInt(_0xe28985[_0x06b2('0x23')])/0x3e8:0x0;agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x24')]=0x0;unanswered['push'](_0xe28985[_0x06b2('0x14')]);}}catch(_0x2a3228){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0x2a3228);}};exports[_0x06b2('0x26')]=function(_0x51698b){try{_[_0x06b2('0x27')](agents,function(_0x32eeea,_0x1637c2){if(_0x32eeea[_0x06b2('0x13')]==_0x51698b[_0x06b2('0x13')]&&!_[_0x06b2('0x28')](unanswered,_0x32eeea[_0x06b2('0x14')])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x51698b);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2a'),_0x51698b[_0x06b2('0x13')],_0x32eeea[_0x06b2('0x7')],_0x32eeea['destuniqueid']));_0x32eeea['agentringnoanswer']=!![];_0x32eeea[_0x06b2('0x1f')]=utils[_0x06b2('0x19')]();_0x32eeea[_0x06b2('0xb')]='abandoned';_0x32eeea[_0x06b2('0x21')]=_0x06b2('0x2b');_0x32eeea[_0x06b2('0x22')]=_0x51698b[_0x06b2('0x22')];_0x32eeea[_0x06b2('0x24')]=0x0;writeDB(_0x32eeea);}});}catch(_0x27f172){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x27f172);}};exports['agentconnect']=function(_0x268780){try{if(agents[_0x268780[_0x06b2('0x14')]]){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x268780);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2d'),_0x268780[_0x06b2('0x13')],agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x7')],_0x268780[_0x06b2('0x14')]));agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x2e')]=utils['now']();agents[_0x268780[_0x06b2('0x14')]]['connectedlinenum']=_0x268780['connectedlinenum'];agents[_0x268780[_0x06b2('0x14')]]['connectedlinename']=_0x268780[_0x06b2('0x1b')];agents[_0x268780['destuniqueid']][_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x2f');_['forIn'](agents,function(_0x404eab,_0xee3ec6){if(_0x404eab[_0x06b2('0x14')]!=_0x268780[_0x06b2('0x14')]&&_0x404eab[_0x06b2('0x13')]==_0x268780[_0x06b2('0x13')]){_0x404eab['talktime']=0x0;_0x404eab[_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];_0x404eab['agentringnoanswer']=!![];_0x404eab['agentringnoanswerAt']=utils[_0x06b2('0x19')]();_0x404eab[_0x06b2('0xb')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x21')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x31')]=_0x268780[_0x06b2('0x14')];_0x404eab[_0x06b2('0x32')]=_0x268780[_0x06b2('0x7')];writeDB(_0x404eab);}});}}catch(_0x117bf4){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x117bf4);}};exports[_0x06b2('0x33')]=function(_0x190781){try{if(!_[_0x06b2('0x1d')](agents[_0x190781[_0x06b2('0x14')]])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0x190781);utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x190781[_0x06b2('0x13')],agents[_0x190781[_0x06b2('0x14')]]['membername'],_0x190781[_0x06b2('0x14')]));agents[_0x190781[_0x06b2('0x14')]]['agentcomplete']=!![];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')]=utils['now']();agents[_0x190781['destuniqueid']]['talktime']=utils[_0x06b2('0x36')](agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')],agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x2e')]);agents[_0x190781['destuniqueid']]['reason']=_0x190781[_0x06b2('0x21')];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x37');writeDB(agents[_0x190781[_0x06b2('0x14')]]);}}catch(_0xc18216){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0xc18216);}};exports[_0x06b2('0x38')]=function(_0x146c5c){try{if(!_[_0x06b2('0x1d')](agents[_0x146c5c['transfereruniqueid']])){utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x39'),_0x146c5c[_0x06b2('0x13')]),_0x146c5c);utils['info'](util[_0x06b2('0x3')](_0x06b2('0x3a'),_0x146c5c[_0x06b2('0x13')],agents[_0x146c5c[_0x06b2('0x3b')]]['membername'],agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')]));agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3c')]=!![];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3d')]=_0x06b2('0x3e');agents[_0x146c5c[_0x06b2('0x3b')]]['transferexten']=_0x146c5c[_0x06b2('0x3f')];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x40')]=agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')];}}catch(_0x2f75a0){utils['error'](util['format'](_0x06b2('0x39'),_0x146c5c['uniqueid']),_0x2f75a0);}};exports['attendedtransfer']=function(_0x2daf62){try{utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x41'),_0x2daf62[_0x06b2('0x42')]),_0x2daf62);if(_0x2daf62[_0x06b2('0x42')]==_0x2daf62[_0x06b2('0x43')]){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x44')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x45'),_0x2daf62['origtransfereruniqueid'],agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x7')]));agents[_0x2daf62[_0x06b2('0x44')]]['transfer']=!![];agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x44')]]['transferexten']=_0x2daf62['origtransfererexten'];agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x40')]=_0x2daf62['origtransfereruniqueid'];}if(_0x2daf62['transfereeuniqueid']&&agents[_0x2daf62[_0x06b2('0x47')]]){agents[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x48')]=0x1;transfers[_0x2daf62[_0x06b2('0x47')]]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x47')]]);transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x44')]]['calleridnum'];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x4a')]=agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x4a')];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x22')]=0x0;transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x48')]=0x2;}}else if(_0x2daf62[_0x06b2('0x44')]==_0x2daf62['secondtransfererlinkedid']){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x42')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2daf62[_0x06b2('0x42')],agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x7')]));agents[_0x2daf62['origtransfereruniqueid']][_0x06b2('0x3c')]=!![];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4b')]=_0x2daf62[_0x06b2('0x4c')];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x40')]=_0x2daf62['secondtransfereruniqueid'];}if(_0x2daf62['transfertargetuniqueid']&&agents[_0x2daf62['transfertargetuniqueid']]){agents[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x48')]=0x1;transfers[_0x2daf62['transfertargetuniqueid']]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x4d')]]);transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x9')];transfers[_0x2daf62['transfertargetuniqueid']]['calleridname']=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4a')];transfers[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]]['holdtime']=0x0;transfers[_0x2daf62[_0x06b2('0x4d')]]['agententerreason']=0x2;}}}catch(_0x4023b0){utils[_0x06b2('0x25')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]',_0x2daf62[_0x06b2('0x42')]),_0x4023b0);}};exports[_0x06b2('0x4e')]=function(_0x461c4d){try{utils['debug'](util[_0x06b2('0x3')]('[%s][agents][hangup]',_0x461c4d[_0x06b2('0x13')]),_0x461c4d);if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]===_0x06b2('0x20')){if(_0x461c4d[_0x06b2('0x4f')]==='21'){agents[_0x461c4d['uniqueid']][_0x06b2('0x21')]=_0x06b2('0x50');agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]='rejected';}utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],agents[_0x461c4d['uniqueid']][_0x06b2('0x7')],agents[_0x461c4d['uniqueid']][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);var _0x38647d=unanswered['indexOf'](_0x461c4d[_0x06b2('0x13')]);if(_0x38647d>-0x1){unanswered[_0x06b2('0x52')](_0x38647d,0x1);}}if(transfers[_0x461c4d[_0x06b2('0x13')]]){transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](transfers[_0x461c4d['uniqueid']][_0x06b2('0x35')],transfers[_0x461c4d['uniqueid']]['agentconnectAt']);transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]='agent';transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils['info'](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],transfers[_0x461c4d['uniqueid']]['membername'],transfers[_0x461c4d['uniqueid']][_0x06b2('0x21')],transfers[_0x461c4d['uniqueid']][_0x06b2('0xb')]));writeDB(transfers[_0x461c4d[_0x06b2('0x13')]],!![]);}if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]){agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](agents[_0x461c4d['uniqueid']]['agentcompleteAt'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]);agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]=agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x3c')]?'transfer':'agent';agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x461c4d[_0x06b2('0x13')],agents[_0x461c4d['uniqueid']]['membername'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);}}catch(_0x3fa469){utils['error'](util['format']('[%s][agents][hangup]',_0x461c4d['uniqueid']),_0x3fa469);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3005646..0331c2c 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 _0xe76f=['localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','./utils','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','linkedid','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','isNil','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','ANSWERED','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','[%s][calls][attendedtransfer]','origtransfereruniqueid'];(function(_0x486c14,_0x22542d){var _0x1d3ff9=function(_0x3150ef){while(--_0x3150ef){_0x486c14['push'](_0x486c14['shift']());}};_0x1d3ff9(++_0x22542d);}(_0xe76f,0x1e9));var _0xfe76=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xe76f[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfe76('0x0'));var transfers=require('./transfers.controller');var dispositions=[_0xfe76('0x1'),_0xfe76('0x2'),_0xfe76('0x2'),'NO\x20ANSWER',_0xfe76('0x1'),_0xfe76('0x1'),'ANSWERED',_0xfe76('0x3'),_0xfe76('0x2'),_0xfe76('0x2'),_0xfe76('0x2')];var channels={};function writeDB(_0x20adc5){var _0x5924b0;if(transfers[_0xfe76('0x4')][_0x20adc5[_0xfe76('0x5')]]){_0x5924b0=_0x20adc5['uniqueid'];_0x20adc5['uniqueid']=transfers[_0xfe76('0x4')][_0x20adc5[_0xfe76('0x5')]][_0xfe76('0x6')];}utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x9'),_0x20adc5[_0xfe76('0x5')],_0x20adc5[_0xfe76('0xa')],_0x20adc5[_0xfe76('0xb')],_0x20adc5[_0xfe76('0xc')],_0x20adc5[_0xfe76('0xd')],_0x20adc5[_0xfe76('0xe')],_0x20adc5['connectedlinenum'],_0x20adc5[_0xfe76('0xf')]));if(_0x20adc5[_0xfe76('0x10')]){utils[_0xfe76('0x11')](_0x20adc5['accountcode'])[_0xfe76('0x12')](function(_0xbfc081){if(_0xbfc081){_0x20adc5[_0xfe76('0x13')]=_0xbfc081['id'];}utils[_0xfe76('0x14')](_0xfe76('0x15'),_0x20adc5);});}else{utils[_0xfe76('0x14')](_0xfe76('0x15'),_0x20adc5);}if(channels[_0x20adc5[_0xfe76('0x5')]]){delete channels[_0x20adc5[_0xfe76('0x5')]];}else if(_0x5924b0&&channels[_0x5924b0]){delete transfers['blinds'][_0x5924b0];delete channels[_0x5924b0];}}exports['newchannel']=function(_0x304c1f){try{utils[_0xfe76('0x16')](util[_0xfe76('0x8')]('[%s][calls][newchannel]',_0x304c1f[_0xfe76('0x5')]),_0x304c1f);if(_0x304c1f[_0xfe76('0x5')]==_0x304c1f[_0xfe76('0x17')]&&_0x304c1f['channel']!='OutgoingSpoolFailed'){utils[_0xfe76('0x7')](util[_0xfe76('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x304c1f[_0xfe76('0x5')],_0x304c1f['context'],_0x304c1f[_0xfe76('0x18')]));channels[_0x304c1f[_0xfe76('0x5')]]={'uniqueid':_0x304c1f[_0xfe76('0x5')],'accountcode':_0x304c1f[_0xfe76('0x10')],'source':_0x304c1f[_0xfe76('0xe')],'destination':_0x304c1f[_0xfe76('0x18')],'destinationcontext':_0x304c1f['context'],'channel':_0x304c1f[_0xfe76('0xa')],'starttime':utils[_0xfe76('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfe76('0x1'),'amaflags':_0xfe76('0x1a')};}}catch(_0x3f2f58){utils[_0xfe76('0x1b')](util[_0xfe76('0x8')](_0xfe76('0x1c'),_0x304c1f['uniqueid']),_0x3f2f58);}};exports['newstate']=function(_0x46e06e){try{utils[_0xfe76('0x16')](util[_0xfe76('0x8')]('[%s][calls][newstate]',_0x46e06e[_0xfe76('0x5')]),_0x46e06e);if(!_['isNil'](channels[_0x46e06e[_0xfe76('0x5')]])&&_0x46e06e['channelstate']==0x6){utils[_0xfe76('0x7')](util['format'](_0xfe76('0x1d'),_0x46e06e[_0xfe76('0x5')],_0x46e06e[_0xfe76('0x1e')],_0x46e06e[_0xfe76('0xa')]));if(_['isNil'](channels[_0x46e06e[_0xfe76('0x5')]][_0xfe76('0x1f')])){channels[_0x46e06e[_0xfe76('0x5')]][_0xfe76('0x1f')]=utils['now']();}}else if(!_[_0xfe76('0x20')](channels[_0x46e06e[_0xfe76('0x17')]])&&_0x46e06e[_0xfe76('0x21')]==0x6&&_0x46e06e[_0xfe76('0x1e')]!=_0xfe76('0x22')){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x23'),_0x46e06e[_0xfe76('0x5')],_0x46e06e[_0xfe76('0x17')],_0x46e06e['context'],_0x46e06e[_0xfe76('0xa')]));channels[_0x46e06e[_0xfe76('0x17')]]['accountcode']=_0x46e06e[_0xfe76('0x10')];channels[_0x46e06e[_0xfe76('0x17')]]['destinationchannel']=_0x46e06e[_0xfe76('0xa')];if(_[_0xfe76('0x20')](channels[_0x46e06e[_0xfe76('0x17')]][_0xfe76('0x24')])){channels[_0x46e06e[_0xfe76('0x17')]][_0xfe76('0x24')]=utils['now']();}channels[_0x46e06e[_0xfe76('0x17')]]['disposition']=dispositions[_[_0xfe76('0x25')](_0x46e06e[_0xfe76('0x21')])]||_0xfe76('0x26');}}catch(_0x2e524d){utils['error'](util['format'](_0xfe76('0x27'),_0x46e06e[_0xfe76('0x5')]),_0x2e524d);}};exports['hangup']=function(_0x290a48){try{if(!_[_0xfe76('0x20')](channels[_0x290a48[_0xfe76('0x5')]])){utils[_0xfe76('0x16')](util[_0xfe76('0x8')](_0xfe76('0x28'),_0x290a48[_0xfe76('0x5')]),_0x290a48);if(_[_0xfe76('0x20')](channels[_0x290a48[_0xfe76('0x5')]][_0xfe76('0x29')])){channels[_0x290a48['uniqueid']][_0xfe76('0x29')]=_0x290a48[_0xfe76('0x2a')]+'\x20<'+_0x290a48[_0xfe76('0xe')]+'>';}utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x2b'),_0x290a48[_0xfe76('0x5')],channels[_0x290a48[_0xfe76('0x5')]][_0xfe76('0x29')],_0x290a48[_0xfe76('0x2c')]));channels[_0x290a48[_0xfe76('0x5')]][_0xfe76('0x2d')]=utils[_0xfe76('0x19')]();channels[_0x290a48['uniqueid']][_0xfe76('0x2e')]=utils[_0xfe76('0x2f')](channels[_0x290a48[_0xfe76('0x5')]]['endtime'],channels[_0x290a48[_0xfe76('0x5')]][_0xfe76('0x30')]);channels[_0x290a48['uniqueid']]['billableseconds']=channels[_0x290a48[_0xfe76('0x5')]]['answertime']?utils[_0xfe76('0x2f')](channels[_0x290a48['uniqueid']][_0xfe76('0x2d')],channels[_0x290a48['uniqueid']][_0xfe76('0x24')]):0x0;writeDB(channels[_0x290a48[_0xfe76('0x5')]]);}}catch(_0x19ec0c){utils[_0xfe76('0x1b')](util[_0xfe76('0x8')](_0xfe76('0x28'),_0x290a48[_0xfe76('0x5')]),_0x19ec0c);}};exports['attendedtransfer']=function(_0x24320a){try{if(!_[_0xfe76('0x20')](channels[_0x24320a['localtwolinkedid']])){utils[_0xfe76('0x16')](util['format'](_0xfe76('0x31'),_0x24320a[_0xfe76('0x32')]),_0x24320a);if(channels[_0x24320a[_0xfe76('0x33')]][_0xfe76('0xa')]==_0x24320a[_0xfe76('0x34')]){utils[_0xfe76('0x7')](util[_0xfe76('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x24320a['origtransfereruniqueid'],_0x24320a[_0xfe76('0x33')],_0x24320a['secondtransfererchannel']));channels[_0x24320a[_0xfe76('0x33')]][_0xfe76('0x35')]=_0x24320a[_0xfe76('0x36')];channels[_0x24320a[_0xfe76('0x33')]][_0xfe76('0x37')]='_attended';}else if(channels[_0x24320a[_0xfe76('0x33')]]['channel']=_0x24320a[_0xfe76('0x38')]){utils['info'](util['format'](_0xfe76('0x39'),_0x24320a[_0xfe76('0x32')],_0x24320a[_0xfe76('0x33')],_0x24320a[_0xfe76('0x3a')]));channels[_0x24320a[_0xfe76('0x33')]][_0xfe76('0x35')]=_0x24320a[_0xfe76('0x3a')];channels[_0x24320a[_0xfe76('0x33')]]['userfield']='_attended';}}}catch(_0x34b7ec){utils[_0xfe76('0x1b')](util[_0xfe76('0x8')](_0xfe76('0x31'),_0x24320a[_0xfe76('0x32')]),_0x34b7ec);}};exports[_0xfe76('0x3b')]=function(_0x27df65){try{if(!_['isNil'](channels[_0x27df65[_0xfe76('0x5')]])){utils[_0xfe76('0x16')](util[_0xfe76('0x8')](_0xfe76('0x3c'),_0x27df65[_0xfe76('0x5')]),_0x27df65);channels[_0x27df65[_0xfe76('0x5')]][_0xfe76('0x3d')]=utils[_0xfe76('0x19')]();utils[_0xfe76('0x7')](util[_0xfe76('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x27df65['uniqueid'],channels[_0x27df65['uniqueid']][_0xfe76('0x3d')]));}}catch(_0x42062d){utils[_0xfe76('0x1b')](util[_0xfe76('0x8')](_0xfe76('0x3c'),_0x27df65[_0xfe76('0x5')]),_0x42062d);}};exports['musiconholdstop']=function(_0x4f20ba){try{if(!_[_0xfe76('0x20')](channels[_0x4f20ba[_0xfe76('0x5')]])){utils[_0xfe76('0x16')](util[_0xfe76('0x8')](_0xfe76('0x3e'),_0x4f20ba[_0xfe76('0x5')]),_0x4f20ba);if(!_[_0xfe76('0x20')](channels[_0x4f20ba['uniqueid']][_0xfe76('0x3d')])){channels[_0x4f20ba[_0xfe76('0x5')]]['mohtime']+=utils[_0xfe76('0x2f')](utils['now'](),channels[_0x4f20ba['uniqueid']][_0xfe76('0x3d')]);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4f20ba[_0xfe76('0x5')],channels[_0x4f20ba[_0xfe76('0x5')]][_0xfe76('0x3f')]));delete channels[_0x4f20ba['uniqueid']]['musiconholdstartAt'];}}}catch(_0x40efde){utils['error'](util['format']('[%s][calls][musiconholdstop]',_0x4f20ba[_0xfe76('0x5')]),_0x40efde);}};exports[_0xfe76('0x40')]=function(_0x566577){try{if(!_[_0xfe76('0x20')](channels[_0x566577[_0xfe76('0x5')]])){utils['debug'](util['format']('[%s][calls][varset]',_0x566577[_0xfe76('0x5')]),_0x566577);if(!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')][_0xfe76('0x42')])){utils[_0xfe76('0x7')](util['format'](_0xfe76('0x43'),_0x566577['uniqueid'],_0x566577['value']));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x44')]=_0x566577['value'];}if(!_['isNil'](_0x566577[_0xfe76('0x41')][_0xfe76('0x45')])){utils[_0xfe76('0x7')](util['format'](_0xfe76('0x46'),_0x566577[_0xfe76('0x5')],_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x48')]=_0x566577['value'];channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x29')]='\x22'+_0x566577[_0xfe76('0x47')]+_0xfe76('0x49')+_0x566577[_0xfe76('0x47')]+'>';}if(!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')]['xmd-callerid-preview'])||!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')][_0xfe76('0x4a')])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x4b'),_0x566577['uniqueid'],!_['isNil'](_0x566577[_0xfe76('0x41')][_0xfe76('0x4c')])?'xmd-callerid-preview':_0xfe76('0x4a'),_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]]['callerid']=_0x566577[_0xfe76('0x47')];}if(!_['isNil'](_0x566577['variable']['xmd-queue'])||!_[_0xfe76('0x20')](_0x566577['variable']['xmcs-queue'])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x4b'),_0x566577[_0xfe76('0x5')],!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')]['xmd-queue'])?_0xfe76('0x4d'):_0xfe76('0x4e'),_0x566577['value']));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x4f')]=_0xfe76('0x50');channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x51')]=_0x566577['value'];channels[_0x566577[_0xfe76('0x5')]]['queue']=!![];}if(!_['isNil'](_0x566577[_0xfe76('0x41')][_0xfe76('0x52')])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x53'),_0x566577[_0xfe76('0x5')],_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]]['ContactId']=_0x566577[_0xfe76('0x47')];}if(!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')][_0xfe76('0x54')])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x566577[_0xfe76('0x5')],_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x55')]=_0x566577['value'];}if(!_[_0xfe76('0x20')](_0x566577[_0xfe76('0x41')][_0xfe76('0x56')])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x57'),_0x566577[_0xfe76('0x5')],_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x58')]=_0x566577['value'];}if(!_['isNil'](_0x566577['variable']['sipcallid'])){utils[_0xfe76('0x7')](util[_0xfe76('0x8')](_0xfe76('0x59'),_0x566577[_0xfe76('0x5')],_0x566577[_0xfe76('0x47')]));channels[_0x566577[_0xfe76('0x5')]][_0xfe76('0x5a')]=_0x566577[_0xfe76('0x47')];}}}catch(_0x4f2d26){utils['error'](util[_0xfe76('0x8')](_0xfe76('0x5b'),_0x566577[_0xfe76('0x5')]),_0x4f2d26);}};exports[_0xfe76('0x5c')]=function(_0x356f30){try{if(!_[_0xfe76('0x20')](channels[_0x356f30['uniqueid']])){utils[_0xfe76('0x16')](util[_0xfe76('0x8')](_0xfe76('0x5d'),_0x356f30['uniqueid']),_0x356f30);utils['info'](util[_0xfe76('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x356f30['uniqueid'],_0x356f30[_0xfe76('0x5e')],_0x356f30[_0xfe76('0x5f')]));if(_0x356f30['application'][_0xfe76('0x60')]()==_0xfe76('0x61')&&_[_0xfe76('0x62')](_0x356f30[_0xfe76('0x5f')][_0xfe76('0x60')](),_0xfe76('0x63'))){var _0x11f4d7=_0x356f30[_0xfe76('0x5f')][_0xfe76('0x64')]('=');var _0x3d2dd8=_0x11f4d7[0x0][_0xfe76('0x65')](_0x11f4d7[0x0][_0xfe76('0x66')]('(')+0x1,_0x11f4d7[0x0][_0xfe76('0x66')](')'));var _0x18dc90=_0x11f4d7[0x1];channels[_0x356f30['uniqueid']][_0x3d2dd8]=_0x18dc90;}if(!_[_0xfe76('0x67')]([_0xfe76('0x68'),_0xfe76('0x69'),_0xfe76('0x6a'),_0xfe76('0x61'),_0xfe76('0x6b')],_0x356f30['application'][_0xfe76('0x60')]())){channels[_0x356f30[_0xfe76('0x5')]]['lastapplication']=_0x356f30[_0xfe76('0x5e')];channels[_0x356f30['uniqueid']]['lastdata']=_0x356f30['appdata'];}}}catch(_0x2de44a){utils[_0xfe76('0x1b')](util['format'](_0xfe76('0x5d'),_0x356f30['uniqueid']),_0x2de44a);}}; \ No newline at end of file +var _0xc1ff=['[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','value','xmd-callerid-preview','xmd-callerid','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','appdata','cdr','split','substring','lastIndexOf','includes','hangup','execif','gotoif','toLowerCase','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','channel','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]\x20mohtime:%s'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xc1ff,0x97));var _0xfc1f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1ff[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfc1f('0x0'));var util=require(_0xfc1f('0x1'));var utils=require('./utils');var transfers=require(_0xfc1f('0x2'));var dispositions=[_0xfc1f('0x3'),_0xfc1f('0x4'),_0xfc1f('0x4'),_0xfc1f('0x3'),_0xfc1f('0x3'),'NO\x20ANSWER',_0xfc1f('0x5'),_0xfc1f('0x6'),_0xfc1f('0x4'),_0xfc1f('0x4'),_0xfc1f('0x4')];var channels={};function writeDB(_0x15374f){var _0x568495;if(transfers[_0xfc1f('0x7')][_0x15374f['uniqueid']]){_0x568495=_0x15374f[_0xfc1f('0x8')];_0x15374f['uniqueid']=transfers['blinds'][_0x15374f[_0xfc1f('0x8')]][_0xfc1f('0x9')];}utils[_0xfc1f('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x15374f['uniqueid'],_0x15374f['channel'],_0x15374f[_0xfc1f('0xb')],_0x15374f[_0xfc1f('0xc')],_0x15374f[_0xfc1f('0xd')],_0x15374f[_0xfc1f('0xe')],_0x15374f[_0xfc1f('0xf')],_0x15374f[_0xfc1f('0x10')]));if(_0x15374f[_0xfc1f('0x11')]){utils[_0xfc1f('0x12')](_0x15374f[_0xfc1f('0x11')])['then'](function(_0x2ff439){if(_0x2ff439){_0x15374f[_0xfc1f('0x13')]=_0x2ff439['id'];}utils[_0xfc1f('0x14')](_0xfc1f('0x15'),_0x15374f);});}else{utils[_0xfc1f('0x14')]('CreateVoiceCallReport',_0x15374f);}if(channels[_0x15374f[_0xfc1f('0x8')]]){delete channels[_0x15374f['uniqueid']];}else if(_0x568495&&channels[_0x568495]){delete transfers['blinds'][_0x568495];delete channels[_0x568495];}}exports[_0xfc1f('0x16')]=function(_0x38a3b5){try{utils['debug'](util[_0xfc1f('0x17')](_0xfc1f('0x18'),_0x38a3b5[_0xfc1f('0x8')]),_0x38a3b5);if(_0x38a3b5[_0xfc1f('0x8')]==_0x38a3b5[_0xfc1f('0x19')]&&_0x38a3b5['channel']!=_0xfc1f('0x1a')){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x38a3b5[_0xfc1f('0x8')],_0x38a3b5[_0xfc1f('0x1b')],_0x38a3b5[_0xfc1f('0x1c')]));channels[_0x38a3b5[_0xfc1f('0x8')]]={'uniqueid':_0x38a3b5['uniqueid'],'accountcode':_0x38a3b5['accountcode'],'source':_0x38a3b5['calleridnum'],'destination':_0x38a3b5['exten'],'destinationcontext':_0x38a3b5[_0xfc1f('0x1b')],'channel':_0x38a3b5[_0xfc1f('0x1d')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfc1f('0x3'),'amaflags':_0xfc1f('0x1e')};}}catch(_0x1e8617){utils[_0xfc1f('0x1f')](util[_0xfc1f('0x17')](_0xfc1f('0x18'),_0x38a3b5['uniqueid']),_0x1e8617);}};exports[_0xfc1f('0x20')]=function(_0x548c4a){try{utils[_0xfc1f('0x21')](util[_0xfc1f('0x17')]('[%s][calls][newstate]',_0x548c4a['uniqueid']),_0x548c4a);if(!_[_0xfc1f('0x22')](channels[_0x548c4a[_0xfc1f('0x8')]])&&_0x548c4a[_0xfc1f('0x23')]==0x6){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x24'),_0x548c4a[_0xfc1f('0x8')],_0x548c4a[_0xfc1f('0x1b')],_0x548c4a[_0xfc1f('0x1d')]));if(_['isNil'](channels[_0x548c4a[_0xfc1f('0x8')]][_0xfc1f('0x25')])){channels[_0x548c4a[_0xfc1f('0x8')]][_0xfc1f('0x25')]=utils[_0xfc1f('0x26')]();}}else if(!_['isNil'](channels[_0x548c4a['linkedid']])&&_0x548c4a[_0xfc1f('0x23')]==0x6&&_0x548c4a[_0xfc1f('0x1b')]!='transfer'){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x27'),_0x548c4a[_0xfc1f('0x8')],_0x548c4a[_0xfc1f('0x19')],_0x548c4a[_0xfc1f('0x1b')],_0x548c4a[_0xfc1f('0x1d')]));channels[_0x548c4a['linkedid']][_0xfc1f('0x11')]=_0x548c4a[_0xfc1f('0x11')];channels[_0x548c4a[_0xfc1f('0x19')]]['destinationchannel']=_0x548c4a[_0xfc1f('0x1d')];if(_[_0xfc1f('0x22')](channels[_0x548c4a[_0xfc1f('0x19')]][_0xfc1f('0x28')])){channels[_0x548c4a['linkedid']][_0xfc1f('0x28')]=utils[_0xfc1f('0x26')]();}channels[_0x548c4a[_0xfc1f('0x19')]][_0xfc1f('0x29')]=dispositions[_[_0xfc1f('0x2a')](_0x548c4a[_0xfc1f('0x23')])]||_0xfc1f('0x5');}}catch(_0x19f6b8){utils[_0xfc1f('0x1f')](util[_0xfc1f('0x17')](_0xfc1f('0x2b'),_0x548c4a[_0xfc1f('0x8')]),_0x19f6b8);}};exports['hangup']=function(_0x41d784){try{if(!_[_0xfc1f('0x22')](channels[_0x41d784['uniqueid']])){utils['debug'](util[_0xfc1f('0x17')](_0xfc1f('0x2c'),_0x41d784[_0xfc1f('0x8')]),_0x41d784);if(_[_0xfc1f('0x22')](channels[_0x41d784['uniqueid']][_0xfc1f('0x2d')])){channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x2d')]=_0x41d784[_0xfc1f('0x2e')]+'\x20<'+_0x41d784[_0xfc1f('0xe')]+'>';}utils[_0xfc1f('0xa')](util['format'](_0xfc1f('0x2f'),_0x41d784[_0xfc1f('0x8')],channels[_0x41d784[_0xfc1f('0x8')]]['callerid'],_0x41d784[_0xfc1f('0x30')]));channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x31')]=utils[_0xfc1f('0x26')]();channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x32')]=utils['diffTime'](channels[_0x41d784[_0xfc1f('0x8')]]['endtime'],channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x33')]);channels[_0x41d784[_0xfc1f('0x8')]]['billableseconds']=channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x28')]?utils[_0xfc1f('0x34')](channels[_0x41d784[_0xfc1f('0x8')]][_0xfc1f('0x31')],channels[_0x41d784['uniqueid']][_0xfc1f('0x28')]):0x0;writeDB(channels[_0x41d784[_0xfc1f('0x8')]]);}}catch(_0x1d0dc5){utils[_0xfc1f('0x1f')](util[_0xfc1f('0x17')](_0xfc1f('0x2c'),_0x41d784[_0xfc1f('0x8')]),_0x1d0dc5);}};exports[_0xfc1f('0x35')]=function(_0x1f9c49){try{if(!_['isNil'](channels[_0x1f9c49['localtwolinkedid']])){utils['debug'](util[_0xfc1f('0x17')](_0xfc1f('0x36'),_0x1f9c49[_0xfc1f('0x37')]),_0x1f9c49);if(channels[_0x1f9c49['localtwolinkedid']][_0xfc1f('0x1d')]==_0x1f9c49['transfereechannel']){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x38'),_0x1f9c49[_0xfc1f('0x37')],_0x1f9c49[_0xfc1f('0x39')],_0x1f9c49[_0xfc1f('0x3a')]));channels[_0x1f9c49['localtwolinkedid']][_0xfc1f('0x3b')]=_0x1f9c49['secondtransfererchannel'];channels[_0x1f9c49[_0xfc1f('0x39')]]['userfield']=_0xfc1f('0x3c');}else if(channels[_0x1f9c49[_0xfc1f('0x39')]][_0xfc1f('0x1d')]=_0x1f9c49[_0xfc1f('0x3d')]){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x38'),_0x1f9c49[_0xfc1f('0x37')],_0x1f9c49[_0xfc1f('0x39')],_0x1f9c49[_0xfc1f('0x3e')]));channels[_0x1f9c49[_0xfc1f('0x39')]][_0xfc1f('0x3b')]=_0x1f9c49[_0xfc1f('0x3e')];channels[_0x1f9c49[_0xfc1f('0x39')]][_0xfc1f('0x3f')]=_0xfc1f('0x3c');}}}catch(_0x33e12e){utils[_0xfc1f('0x1f')](util['format'](_0xfc1f('0x36'),_0x1f9c49['origtransfereruniqueid']),_0x33e12e);}};exports[_0xfc1f('0x40')]=function(_0x3f1655){try{if(!_[_0xfc1f('0x22')](channels[_0x3f1655[_0xfc1f('0x8')]])){utils[_0xfc1f('0x21')](util[_0xfc1f('0x17')](_0xfc1f('0x41'),_0x3f1655[_0xfc1f('0x8')]),_0x3f1655);channels[_0x3f1655[_0xfc1f('0x8')]][_0xfc1f('0x42')]=utils['now']();utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x43'),_0x3f1655[_0xfc1f('0x8')],channels[_0x3f1655[_0xfc1f('0x8')]][_0xfc1f('0x42')]));}}catch(_0x4debcf){utils[_0xfc1f('0x1f')](util[_0xfc1f('0x17')](_0xfc1f('0x41'),_0x3f1655[_0xfc1f('0x8')]),_0x4debcf);}};exports['musiconholdstop']=function(_0x271226){try{if(!_[_0xfc1f('0x22')](channels[_0x271226['uniqueid']])){utils[_0xfc1f('0x21')](util[_0xfc1f('0x17')]('[%s][calls][musiconholdstop]',_0x271226['uniqueid']),_0x271226);if(!_[_0xfc1f('0x22')](channels[_0x271226['uniqueid']]['musiconholdstartAt'])){channels[_0x271226['uniqueid']]['mohtime']+=utils[_0xfc1f('0x34')](utils[_0xfc1f('0x26')](),channels[_0x271226[_0xfc1f('0x8')]]['musiconholdstartAt']);utils['info'](util[_0xfc1f('0x17')](_0xfc1f('0x44'),_0x271226['uniqueid'],channels[_0x271226['uniqueid']]['mohtime']));delete channels[_0x271226[_0xfc1f('0x8')]][_0xfc1f('0x42')];}}}catch(_0x34841f){utils['error'](util['format'](_0xfc1f('0x45'),_0x271226[_0xfc1f('0x8')]),_0x34841f);}};exports[_0xfc1f('0x46')]=function(_0x2cf28d){try{if(!_[_0xfc1f('0x22')](channels[_0x2cf28d[_0xfc1f('0x8')]])){utils['debug'](util['format']('[%s][calls][varset]',_0x2cf28d[_0xfc1f('0x8')]),_0x2cf28d);if(!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x48')])){utils[_0xfc1f('0xa')](util['format'](_0xfc1f('0x49'),_0x2cf28d[_0xfc1f('0x8')],_0x2cf28d['value']));channels[_0x2cf28d[_0xfc1f('0x8')]]['source']=_0x2cf28d['value'];}if(!_['isNil'](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x4a')])){utils['info'](util[_0xfc1f('0x17')](_0xfc1f('0x4b'),_0x2cf28d[_0xfc1f('0x8')],_0x2cf28d['value']));channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x4c')]=_0x2cf28d['value'];channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x2d')]='\x22'+_0x2cf28d['value']+_0xfc1f('0x4d')+_0x2cf28d[_0xfc1f('0x4e')]+'>';}if(!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x4f')])||!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x50')])){utils['info'](util[_0xfc1f('0x17')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2cf28d[_0xfc1f('0x8')],!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x4f')])?_0xfc1f('0x4f'):'xmd-callerid',_0x2cf28d['value']));channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x2d')]=_0x2cf28d[_0xfc1f('0x4e')];}if(!_[_0xfc1f('0x22')](_0x2cf28d['variable']['xmd-queue'])||!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x51')])){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2cf28d['uniqueid'],!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')]['xmd-queue'])?'xmd-queue':'xmcs-queue',_0x2cf28d[_0xfc1f('0x4e')]));channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x52')]='Queue';channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x53')]=_0x2cf28d['value'];channels[_0x2cf28d[_0xfc1f('0x8')]]['queue']=!![];}if(!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')][_0xfc1f('0x54')])){utils[_0xfc1f('0xa')](util['format'](_0xfc1f('0x55'),_0x2cf28d[_0xfc1f('0x8')],_0x2cf28d[_0xfc1f('0x4e')]));channels[_0x2cf28d[_0xfc1f('0x8')]][_0xfc1f('0x56')]=_0x2cf28d[_0xfc1f('0x4e')];}if(!_[_0xfc1f('0x22')](_0x2cf28d['variable'][_0xfc1f('0x57')])){utils['info'](util[_0xfc1f('0x17')](_0xfc1f('0x58'),_0x2cf28d['uniqueid'],_0x2cf28d['value']));channels[_0x2cf28d['uniqueid']][_0xfc1f('0x59')]=_0x2cf28d[_0xfc1f('0x4e')];}if(!_[_0xfc1f('0x22')](_0x2cf28d[_0xfc1f('0x47')]['outboundrouteid'])){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x5a'),_0x2cf28d[_0xfc1f('0x8')],_0x2cf28d[_0xfc1f('0x4e')]));channels[_0x2cf28d['uniqueid']][_0xfc1f('0x5b')]=_0x2cf28d[_0xfc1f('0x4e')];}if(!_[_0xfc1f('0x22')](_0x2cf28d['variable'][_0xfc1f('0x5c')])){utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x5d'),_0x2cf28d[_0xfc1f('0x8')],_0x2cf28d[_0xfc1f('0x4e')]));channels[_0x2cf28d[_0xfc1f('0x8')]]['sipcallid']=_0x2cf28d[_0xfc1f('0x4e')];}}}catch(_0x151eb1){utils['error'](util['format'](_0xfc1f('0x5e'),_0x2cf28d[_0xfc1f('0x8')]),_0x151eb1);}};exports[_0xfc1f('0x5f')]=function(_0x20c777){try{if(!_[_0xfc1f('0x22')](channels[_0x20c777[_0xfc1f('0x8')]])){utils[_0xfc1f('0x21')](util[_0xfc1f('0x17')](_0xfc1f('0x60'),_0x20c777['uniqueid']),_0x20c777);utils[_0xfc1f('0xa')](util[_0xfc1f('0x17')](_0xfc1f('0x61'),_0x20c777['uniqueid'],_0x20c777[_0xfc1f('0x62')],_0x20c777['appdata']));if(_0x20c777[_0xfc1f('0x62')]['toLowerCase']()==_0xfc1f('0x63')&&_['startsWith'](_0x20c777[_0xfc1f('0x64')]['toLowerCase'](),_0xfc1f('0x65'))){var _0x2aae23=_0x20c777[_0xfc1f('0x64')][_0xfc1f('0x66')]('=');var _0x4e3cbc=_0x2aae23[0x0][_0xfc1f('0x67')](_0x2aae23[0x0][_0xfc1f('0x68')]('(')+0x1,_0x2aae23[0x0][_0xfc1f('0x68')](')'));var _0x51707c=_0x2aae23[0x1];channels[_0x20c777[_0xfc1f('0x8')]][_0x4e3cbc]=_0x51707c;}if(!_[_0xfc1f('0x69')]([_0xfc1f('0x6a'),'noop',_0xfc1f('0x6b'),'set',_0xfc1f('0x6c')],_0x20c777[_0xfc1f('0x62')][_0xfc1f('0x6d')]())){channels[_0x20c777['uniqueid']][_0xfc1f('0x52')]=_0x20c777[_0xfc1f('0x62')];channels[_0x20c777['uniqueid']][_0xfc1f('0x53')]=_0x20c777[_0xfc1f('0x64')];}}}catch(_0x1b3f70){utils[_0xfc1f('0x1f')](util[_0xfc1f('0x17')](_0xfc1f('0x60'),_0x20c777['uniqueid']),_0x1b3f70);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8314240..b910e43 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 _0xc998=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','error','[core]\x20error','close','[core]\x20close','./utils'];(function(_0x3c6ce2,_0x1baca1){var _0x2de3cb=function(_0x167aa6){while(--_0x167aa6){_0x3c6ce2['push'](_0x3c6ce2['shift']());}};_0x2de3cb(++_0x1baca1);}(_0xc998,0x1b7));var _0x8c99=function(_0x38c132,_0x49a5dd){_0x38c132=_0x38c132-0x0;var _0x453df9=_0xc998[_0x38c132];return _0x453df9;};'use strict';var utils=require(_0x8c99('0x0'));exports[_0x8c99('0x1')]=function(){utils[_0x8c99('0x2')](_0x8c99('0x3'));};exports[_0x8c99('0x4')]=function(){utils['info'](_0x8c99('0x5'));};exports['fullybooted']=function(){utils[_0x8c99('0x2')]('[core]\x20fullybooted');};exports[_0x8c99('0x6')]=function(_0x1c4267){utils[_0x8c99('0x6')](_0x8c99('0x7'),_0x1c4267);};exports[_0x8c99('0x8')]=function(){utils[_0x8c99('0x2')](_0x8c99('0x9'));};exports['managerevent']=function(_0xb89f29){}; \ No newline at end of file +var _0xdff0=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close'];(function(_0x7aadec,_0x5aec90){var _0x199714=function(_0x377bf9){while(--_0x377bf9){_0x7aadec['push'](_0x7aadec['shift']());}};_0x199714(++_0x5aec90);}(_0xdff0,0x1da));var _0x0dff=function(_0x29c563,_0x4dcced){_0x29c563=_0x29c563-0x0;var _0xedb2fa=_0xdff0[_0x29c563];return _0xedb2fa;};'use strict';var utils=require(_0x0dff('0x0'));exports[_0x0dff('0x1')]=function(){utils[_0x0dff('0x2')](_0x0dff('0x3'));};exports[_0x0dff('0x4')]=function(){utils[_0x0dff('0x2')]('[core]\x20shutdown');};exports[_0x0dff('0x5')]=function(){utils[_0x0dff('0x2')](_0x0dff('0x6'));};exports[_0x0dff('0x7')]=function(_0x4a6d49){utils[_0x0dff('0x7')](_0x0dff('0x8'),_0x4a6d49);};exports['close']=function(){utils[_0x0dff('0x2')](_0x0dff('0x9'));};exports[_0x0dff('0xa')]=function(_0x5937d7){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 2f8e62f..e554c6f 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 _0x9406=['billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr(routeid)','error','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','diffTime','endtime'];(function(_0x347ead,_0x101b67){var _0x25ac57=function(_0x2ec0a7){while(--_0x2ec0a7){_0x347ead['push'](_0x347ead['shift']());}};_0x25ac57(++_0x101b67);}(_0x9406,0x1cd));var _0x6940=function(_0x283152,_0x468a35){_0x283152=_0x283152-0x0;var _0x6cb80d=_0x9406[_0x283152];return _0x6cb80d;};'use strict';var _=require('lodash');var util=require(_0x6940('0x0'));var utils=require(_0x6940('0x1'));var dials={};function writeDB(_0x59039a){utils[_0x6940('0x2')](util[_0x6940('0x3')](_0x6940('0x4'),_0x59039a[_0x6940('0x5')],_0x59039a[_0x6940('0x6')],_0x59039a[_0x6940('0x7')],_0x59039a[_0x6940('0x8')],_0x59039a[_0x6940('0x9')],_0x59039a[_0x6940('0xa')]));utils['request']('CreateVoiceDialReport',_0x59039a);delete dials[_0x59039a[_0x6940('0x5')]];}exports['newexten']=function(_0x2c59f7){try{utils[_0x6940('0xb')](util[_0x6940('0x3')](_0x6940('0xc'),_0x2c59f7[_0x6940('0x5')]),_0x2c59f7);utils[_0x6940('0x2')](util['format'](_0x6940('0xd'),_0x2c59f7[_0x6940('0x5')],_0x2c59f7[_0x6940('0xe')],_0x2c59f7['appdata']));if(_0x2c59f7['application'][_0x6940('0xf')]()=='set'&&_[_0x6940('0x10')](_0x2c59f7[_0x6940('0x11')][_0x6940('0xf')](),_0x6940('0x12'))){var _0x37534b=_0x2c59f7[_0x6940('0x11')]['split']('=');dials[_0x2c59f7[_0x6940('0x5')]]={'routeId':_0x37534b[0x1]};}}catch(_0x2f7a56){utils[_0x6940('0x13')](util['format']('[%s][dials][newexten]',_0x2c59f7[_0x6940('0x5')]),_0x2f7a56);}};exports['varset']=function(_0x4a0818){try{utils[_0x6940('0xb')](util['format']('[%s][dials][varset]',_0x4a0818[_0x6940('0x5')]),_0x4a0818);if(!_[_0x6940('0x14')](_0x4a0818[_0x6940('0x15')][_0x6940('0x16')])){utils['info'](util[_0x6940('0x3')](_0x6940('0x17'),_0x4a0818[_0x6940('0x5')],_0x4a0818[_0x6940('0x18')]));dials[_0x4a0818[_0x6940('0x5')]]={'routeId':_0x4a0818[_0x6940('0x18')]};}}catch(_0x262bf9){utils['error'](util[_0x6940('0x3')](_0x6940('0x19'),_0x4a0818[_0x6940('0x5')]),_0x262bf9);}};exports[_0x6940('0x1a')]=function(_0x360895){try{if(!_[_0x6940('0x14')](dials[_0x360895[_0x6940('0x5')]])){utils[_0x6940('0xb')](util['format'](_0x6940('0x1b'),_0x360895['uniqueid']),_0x360895);dials[_0x360895[_0x6940('0x5')]]=_[_0x6940('0x1c')](dials[_0x360895['uniqueid']],_0x360895);dials[_0x360895[_0x6940('0x5')]][_0x6940('0x1d')]=utils[_0x6940('0x1e')]();dials[_0x360895[_0x6940('0x5')]]['lastevent']=_0x6940('0x1f');utils[_0x6940('0x2')](util[_0x6940('0x3')](_0x6940('0x20'),_0x360895[_0x6940('0x5')],dials[_0x360895[_0x6940('0x5')]][_0x6940('0x1d')]));}}catch(_0x24c2bd){utils[_0x6940('0x13')](util[_0x6940('0x3')](_0x6940('0x1b'),_0x360895[_0x6940('0x5')]),_0x24c2bd);}};exports[_0x6940('0x21')]=function(_0x46fff5){try{if(!_[_0x6940('0x14')](dials[_0x46fff5[_0x6940('0x5')]])){utils[_0x6940('0xb')](util['format'](_0x6940('0x22'),_0x46fff5[_0x6940('0x5')]),_0x46fff5);dials[_0x46fff5[_0x6940('0x5')]][_0x6940('0xa')]=_0x46fff5[_0x6940('0xa')];if(_0x46fff5[_0x6940('0xa')]=='ANSWER'){dials[_0x46fff5['uniqueid']]=_[_0x6940('0x1c')](dials[_0x46fff5[_0x6940('0x5')]],_0x46fff5);dials[_0x46fff5[_0x6940('0x5')]][_0x6940('0x23')]=utils['now']();dials[_0x46fff5[_0x6940('0x5')]][_0x6940('0x24')]=_0x6940('0x25');utils[_0x6940('0x2')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x46fff5[_0x6940('0x5')],_0x46fff5['dialstatus'],dials[_0x46fff5['uniqueid']][_0x6940('0x23')]));}else{utils[_0x6940('0x2')](util['format'](_0x6940('0x26'),_0x46fff5['uniqueid'],_0x46fff5['dialstatus']));}}}catch(_0x1e0fe6){utils[_0x6940('0x13')](util[_0x6940('0x3')](_0x6940('0x22'),_0x46fff5[_0x6940('0x5')]),_0x1e0fe6);}};exports[_0x6940('0x27')]=function(_0xbd2fcd){try{if(!_[_0x6940('0x14')](dials[_0xbd2fcd['uniqueid']])){utils[_0x6940('0xb')](util['format'](_0x6940('0x28'),_0xbd2fcd[_0x6940('0x5')]),_0xbd2fcd);utils[_0x6940('0x2')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xbd2fcd[_0x6940('0x5')],_0xbd2fcd['calleridnum'],_0xbd2fcd[_0x6940('0x29')],_0xbd2fcd[_0x6940('0x2a')]));dials[_0xbd2fcd[_0x6940('0x5')]]=_['assign'](dials[_0xbd2fcd[_0x6940('0x5')]],{'endtime':utils[_0x6940('0x1e')](),'lastevent':'complete'});dials[_0xbd2fcd['uniqueid']]['duration']=utils[_0x6940('0x2b')](dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x2c')],dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x1d')]);dials[_0xbd2fcd[_0x6940('0x5')]]['holdtime']=utils[_0x6940('0x2b')](dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x23')]||dials[_0xbd2fcd['uniqueid']][_0x6940('0x2c')],dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x1d')]);dials[_0xbd2fcd['uniqueid']][_0x6940('0x2d')]=dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x23')]?utils['diffTime'](dials[_0xbd2fcd[_0x6940('0x5')]][_0x6940('0x2c')],dials[_0xbd2fcd['uniqueid']][_0x6940('0x23')]):0x0;writeDB(dials[_0xbd2fcd[_0x6940('0x5')]]);}}catch(_0x1bb20c){utils[_0x6940('0x13')](util[_0x6940('0x3')](_0x6940('0x28'),_0xbd2fcd[_0x6940('0x5')]),_0x1bb20c);}}; \ No newline at end of file +var _0x6f9d=['connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','[%s][dials][newexten]','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','debug','isNil','variable','outboundrouteid','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','assign','answertime','now','connect','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum'];(function(_0xd42d18,_0x1278fb){var _0x48f4df=function(_0x5dc132){while(--_0x5dc132){_0xd42d18['push'](_0xd42d18['shift']());}};_0x48f4df(++_0x1278fb);}(_0x6f9d,0x88));var _0xd6f9=function(_0x3beb4e,_0x2d1a69){_0x3beb4e=_0x3beb4e-0x0;var _0xd40198=_0x6f9d[_0x3beb4e];return _0xd40198;};'use strict';var _=require(_0xd6f9('0x0'));var util=require(_0xd6f9('0x1'));var utils=require(_0xd6f9('0x2'));var dials={};function writeDB(_0x19fbc3){utils[_0xd6f9('0x3')](util[_0xd6f9('0x4')](_0xd6f9('0x5'),_0x19fbc3['uniqueid'],_0x19fbc3['channel'],_0x19fbc3[_0xd6f9('0x6')],_0x19fbc3[_0xd6f9('0x7')],_0x19fbc3[_0xd6f9('0x8')],_0x19fbc3[_0xd6f9('0x9')]));utils[_0xd6f9('0xa')](_0xd6f9('0xb'),_0x19fbc3);delete dials[_0x19fbc3[_0xd6f9('0xc')]];}exports['newexten']=function(_0x33c8b8){try{utils['debug'](util[_0xd6f9('0x4')](_0xd6f9('0xd'),_0x33c8b8['uniqueid']),_0x33c8b8);utils[_0xd6f9('0x3')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x33c8b8['uniqueid'],_0x33c8b8['application'],_0x33c8b8['appdata']));if(_0x33c8b8[_0xd6f9('0xe')][_0xd6f9('0xf')]()==_0xd6f9('0x10')&&_[_0xd6f9('0x11')](_0x33c8b8['appdata'][_0xd6f9('0xf')](),_0xd6f9('0x12'))){var _0x3c906d=_0x33c8b8['appdata'][_0xd6f9('0x13')]('=');dials[_0x33c8b8[_0xd6f9('0xc')]]={'routeId':_0x3c906d[0x1]};}}catch(_0x330f64){utils[_0xd6f9('0x14')](util[_0xd6f9('0x4')](_0xd6f9('0xd'),_0x33c8b8[_0xd6f9('0xc')]),_0x330f64);}};exports['varset']=function(_0x4a75cc){try{utils[_0xd6f9('0x15')](util['format']('[%s][dials][varset]',_0x4a75cc[_0xd6f9('0xc')]),_0x4a75cc);if(!_[_0xd6f9('0x16')](_0x4a75cc[_0xd6f9('0x17')][_0xd6f9('0x18')])){utils[_0xd6f9('0x3')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4a75cc[_0xd6f9('0xc')],_0x4a75cc[_0xd6f9('0x19')]));dials[_0x4a75cc[_0xd6f9('0xc')]]={'routeId':_0x4a75cc[_0xd6f9('0x19')]};}}catch(_0x4361ce){utils[_0xd6f9('0x14')](util[_0xd6f9('0x4')](_0xd6f9('0x1a'),_0x4a75cc[_0xd6f9('0xc')]),_0x4361ce);}};exports[_0xd6f9('0x1b')]=function(_0x45c5bf){try{if(!_['isNil'](dials[_0x45c5bf[_0xd6f9('0xc')]])){utils[_0xd6f9('0x15')](util[_0xd6f9('0x4')](_0xd6f9('0x1c'),_0x45c5bf[_0xd6f9('0xc')]),_0x45c5bf);dials[_0x45c5bf[_0xd6f9('0xc')]]=_['assign'](dials[_0x45c5bf['uniqueid']],_0x45c5bf);dials[_0x45c5bf['uniqueid']][_0xd6f9('0x1d')]=utils['now']();dials[_0x45c5bf[_0xd6f9('0xc')]]['lastevent']=_0xd6f9('0x1e');utils[_0xd6f9('0x3')](util[_0xd6f9('0x4')](_0xd6f9('0x1f'),_0x45c5bf['uniqueid'],dials[_0x45c5bf[_0xd6f9('0xc')]]['starttime']));}}catch(_0x11c953){utils[_0xd6f9('0x14')](util['format']('[%s][dials][dialbegin]',_0x45c5bf[_0xd6f9('0xc')]),_0x11c953);}};exports[_0xd6f9('0x20')]=function(_0x18d40b){try{if(!_[_0xd6f9('0x16')](dials[_0x18d40b[_0xd6f9('0xc')]])){utils[_0xd6f9('0x15')](util[_0xd6f9('0x4')]('[%s][dials][dialend]',_0x18d40b[_0xd6f9('0xc')]),_0x18d40b);dials[_0x18d40b[_0xd6f9('0xc')]]['dialstatus']=_0x18d40b['dialstatus'];if(_0x18d40b[_0xd6f9('0x9')]==_0xd6f9('0x21')){dials[_0x18d40b[_0xd6f9('0xc')]]=_[_0xd6f9('0x22')](dials[_0x18d40b[_0xd6f9('0xc')]],_0x18d40b);dials[_0x18d40b['uniqueid']][_0xd6f9('0x23')]=utils[_0xd6f9('0x24')]();dials[_0x18d40b['uniqueid']]['lastevent']=_0xd6f9('0x25');utils[_0xd6f9('0x3')](util[_0xd6f9('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x18d40b[_0xd6f9('0xc')],_0x18d40b[_0xd6f9('0x9')],dials[_0x18d40b['uniqueid']][_0xd6f9('0x23')]));}else{utils[_0xd6f9('0x3')](util[_0xd6f9('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x18d40b['uniqueid'],_0x18d40b[_0xd6f9('0x9')]));}}}catch(_0x3e4b5a){utils['error'](util[_0xd6f9('0x4')](_0xd6f9('0x26'),_0x18d40b['uniqueid']),_0x3e4b5a);}};exports[_0xd6f9('0x27')]=function(_0x2104e2){try{if(!_['isNil'](dials[_0x2104e2[_0xd6f9('0xc')]])){utils['debug'](util[_0xd6f9('0x4')](_0xd6f9('0x28'),_0x2104e2[_0xd6f9('0xc')]),_0x2104e2);utils['info'](util[_0xd6f9('0x4')](_0xd6f9('0x29'),_0x2104e2[_0xd6f9('0xc')],_0x2104e2[_0xd6f9('0x7')],_0x2104e2['calleridname'],_0x2104e2['cause-txt']));dials[_0x2104e2[_0xd6f9('0xc')]]=_[_0xd6f9('0x22')](dials[_0x2104e2[_0xd6f9('0xc')]],{'endtime':utils[_0xd6f9('0x24')](),'lastevent':_0xd6f9('0x2a')});dials[_0x2104e2['uniqueid']][_0xd6f9('0x2b')]=utils[_0xd6f9('0x2c')](dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x2d')],dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x1d')]);dials[_0x2104e2['uniqueid']][_0xd6f9('0x2e')]=utils[_0xd6f9('0x2c')](dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x23')]||dials[_0x2104e2[_0xd6f9('0xc')]]['endtime'],dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x1d')]);dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x2f')]=dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x23')]?utils['diffTime'](dials[_0x2104e2[_0xd6f9('0xc')]][_0xd6f9('0x2d')],dials[_0x2104e2[_0xd6f9('0xc')]]['answertime']):0x0;writeDB(dials[_0x2104e2[_0xd6f9('0xc')]]);}}catch(_0x313aa5){utils['error'](util[_0xd6f9('0x4')](_0xd6f9('0x28'),_0x2104e2['uniqueid']),_0x313aa5);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3cbcd10..bf8f01f 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 _0x8a69=['newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','asterisk','port','username','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a69,0x11e));var _0x98a6=function(_0x25bf27,_0x8eb520){_0x25bf27=_0x25bf27-0x0;var _0x26744e=_0x8a69[_0x25bf27];return _0x26744e;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x98a6('0x0'));var util=require(_0x98a6('0x1'));var ami=new AsteriskManager(config[_0x98a6('0x2')][_0x98a6('0x3')],config['asterisk']['ip'],config[_0x98a6('0x2')][_0x98a6('0x4')],config['asterisk']['password'],!![]);ami['keepConnected']();if(config[_0x98a6('0x5')]&&config[_0x98a6('0x5')][_0x98a6('0x6')]){utils[_0x98a6('0x7')](_0x98a6('0x8'));}else{var agents=require(_0x98a6('0x9'));var calls=require(_0x98a6('0xa'));var queues=require(_0x98a6('0xb'));var recordings=require(_0x98a6('0xc'));var members=require('./members.controller');var dials=require(_0x98a6('0xd'));var transfers=require(_0x98a6('0xe'));var core=require('./core.controller');ami['on'](_0x98a6('0xf'),core[_0x98a6('0xf')]);ami['on']('shutdown',core[_0x98a6('0x10')]);ami['on'](_0x98a6('0x11'),core[_0x98a6('0x11')]);ami['on']('error',core[_0x98a6('0x12')]);ami['on'](_0x98a6('0x13'),core['close']);ami['on'](_0x98a6('0x14'),core[_0x98a6('0x14')]);ami['on'](_0x98a6('0x15'),function(_0x16178){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')]('[%s][index][devicestatechange]',_0x16178[_0x98a6('0x18')]),_0x16178);members[_0x98a6('0x15')](_0x16178);}catch(_0xec2ea0){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x19'),_0x16178[_0x98a6('0x18')]),_0xec2ea0);}});ami['on'](_0x98a6('0x1a'),function(_0x21e3a2){try{utils['debug'](util[_0x98a6('0x17')](_0x98a6('0x1b'),_0x21e3a2['uniqueid']),_0x21e3a2);agents[_0x98a6('0x1a')](_0x21e3a2);}catch(_0x1000bf){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x1b'),_0x21e3a2[_0x98a6('0x1c')]),_0x1000bf);}});ami['on'](_0x98a6('0x1d'),function(_0x3e6d26){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')]('[%s][index][agentringnoanswer]',_0x3e6d26[_0x98a6('0x1c')]),_0x3e6d26);agents[_0x98a6('0x1d')](_0x3e6d26);}catch(_0x3d1266){utils[_0x98a6('0x12')](util[_0x98a6('0x17')]('[%s][index][agentringnoanswer]',_0x3e6d26[_0x98a6('0x1c')]),_0x3d1266);}});ami['on']('agentconnect',function(_0x5efe12){try{utils['debug'](util[_0x98a6('0x17')]('[%s][index][agentconnect]',_0x5efe12['uniqueid']),_0x5efe12);agents['agentconnect'](_0x5efe12);queues[_0x98a6('0x1e')](_0x5efe12);}catch(_0xb422f){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x1f'),_0x5efe12[_0x98a6('0x1c')]),_0xb422f);}});ami['on'](_0x98a6('0x20'),function(_0x27815b){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x21'),_0x27815b[_0x98a6('0x1c')]),_0x27815b);agents['agentcomplete'](_0x27815b);queues['agentcomplete'](_0x27815b);members[_0x98a6('0x20')](_0x27815b);}catch(_0x2e2e30){utils[_0x98a6('0x12')](util['format']('[%s][index][agentcomplete]',_0x27815b['uniqueid']),_0x2e2e30);}});ami['on'](_0x98a6('0x22'),function(_0x511296){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')]('[%s][index][queuecallerabandon]',_0x511296[_0x98a6('0x1c')]),_0x511296);agents[_0x98a6('0x22')](_0x511296);queues[_0x98a6('0x22')](_0x511296);}catch(_0xec6853){utils[_0x98a6('0x12')](util['format'](_0x98a6('0x23'),_0x511296[_0x98a6('0x1c')]),_0xec6853);}});ami['on'](_0x98a6('0x24'),function(_0x2104b1){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x25'),_0x2104b1[_0x98a6('0x1c')]),_0x2104b1);queues[_0x98a6('0x24')](_0x2104b1);recordings[_0x98a6('0x24')](_0x2104b1);}catch(_0x5c6d7a){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x25'),_0x2104b1[_0x98a6('0x1c')]),_0x5c6d7a);}});ami['on'](_0x98a6('0x26'),function(_0x1a730f){try{utils['debug'](util[_0x98a6('0x17')](_0x98a6('0x27'),_0x1a730f[_0x98a6('0x1c')]),_0x1a730f);queues[_0x98a6('0x26')](_0x1a730f);}catch(_0x4862ea){utils[_0x98a6('0x12')](util[_0x98a6('0x17')]('[%s][index][queuecallerleave]',_0x1a730f[_0x98a6('0x1c')]),_0x4862ea);}});ami['on']('musiconholdstart',function(_0xb19176){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x28'),_0xb19176[_0x98a6('0x1c')]),_0xb19176);queues[_0x98a6('0x29')](_0xb19176);calls[_0x98a6('0x29')](_0xb19176);}catch(_0x526be5){utils['error'](util[_0x98a6('0x17')](_0x98a6('0x28'),_0xb19176[_0x98a6('0x1c')]),_0x526be5);}});ami['on']('musiconholdstop',function(_0x188d81){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x2a'),_0x188d81[_0x98a6('0x1c')]),_0x188d81);queues[_0x98a6('0x2b')](_0x188d81);calls[_0x98a6('0x2b')](_0x188d81);}catch(_0x560041){utils[_0x98a6('0x12')](util[_0x98a6('0x17')]('[%s][index][musiconholdstop]',_0x188d81[_0x98a6('0x1c')]),_0x560041);}});ami['on'](_0x98a6('0x2c'),function(_0x5640c3){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x2d'),_0x5640c3[_0x98a6('0x1c')]),_0x5640c3);calls[_0x98a6('0x2c')](_0x5640c3);recordings['newstate'](_0x5640c3);}catch(_0x2f27e7){utils[_0x98a6('0x12')](util[_0x98a6('0x17')]('[%s][index][newstate]',_0x5640c3[_0x98a6('0x1c')]),_0x2f27e7);}});ami['on'](_0x98a6('0x2e'),function(_0x2a60c6){try{utils['debug'](util['format'](_0x98a6('0x2f'),_0x2a60c6[_0x98a6('0x1c')]),_0x2a60c6);calls[_0x98a6('0x2e')](_0x2a60c6);recordings[_0x98a6('0x2e')](_0x2a60c6);dials[_0x98a6('0x2e')](_0x2a60c6);agents[_0x98a6('0x2e')](_0x2a60c6);queues['hangup'](_0x2a60c6);}catch(_0x3213ab){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x2f'),_0x2a60c6[_0x98a6('0x1c')]),_0x3213ab);}});ami['on'](_0x98a6('0x30'),function(_0x58d6b4){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x31'),_0x58d6b4[_0x98a6('0x1c')]),_0x58d6b4);members['cdr'](_0x58d6b4);}catch(_0x3a044a){utils[_0x98a6('0x12')](util['format'](_0x98a6('0x31'),_0x58d6b4[_0x98a6('0x1c')]),_0x3a044a);}});ami['on']('blindtransfer',function(_0xd27dd6){try{utils['debug'](util[_0x98a6('0x17')](_0x98a6('0x32'),_0xd27dd6[_0x98a6('0x1c')]),_0xd27dd6);queues[_0x98a6('0x33')](_0xd27dd6);agents[_0x98a6('0x33')](_0xd27dd6);transfers[_0x98a6('0x33')](_0xd27dd6);}catch(_0x39d737){utils[_0x98a6('0x12')](util['format'](_0x98a6('0x32'),_0xd27dd6[_0x98a6('0x1c')]),_0x39d737);}});ami['on'](_0x98a6('0x34'),function(_0x5b06e5){try{utils['debug'](util[_0x98a6('0x17')]('[%s][index][attendedtransfer]',_0x5b06e5[_0x98a6('0x35')]),_0x5b06e5);queues[_0x98a6('0x34')](_0x5b06e5);transfers[_0x98a6('0x34')](_0x5b06e5);agents['attendedtransfer'](_0x5b06e5);calls['attendedtransfer'](_0x5b06e5);}catch(_0x3e6dd2){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x36'),_0x5b06e5[_0x98a6('0x35')]),_0x3e6dd2);}});ami['on'](_0x98a6('0x37'),function(_0x2b2ab3){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x38'),_0x2b2ab3[_0x98a6('0x1c')]),_0x2b2ab3);queues['varset'](_0x2b2ab3);recordings[_0x98a6('0x37')](_0x2b2ab3);calls[_0x98a6('0x37')](_0x2b2ab3);dials[_0x98a6('0x37')](_0x2b2ab3);}catch(_0x33a041){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x38'),_0x2b2ab3['uniqueid']),_0x33a041);}});ami['on'](_0x98a6('0x39'),function(_0xeebe5){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x3a'),_0xeebe5['uniqueid']),_0xeebe5);calls[_0x98a6('0x39')](_0xeebe5);recordings['newexten'](_0xeebe5);dials[_0x98a6('0x39')](_0xeebe5);}catch(_0x2515e8){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x3a'),_0xeebe5[_0x98a6('0x1c')]),_0x2515e8);}});ami['on'](_0x98a6('0x3b'),function(_0x581926){try{utils[_0x98a6('0x16')](util['format'](_0x98a6('0x3c'),_0x581926[_0x98a6('0x1c')]),_0x581926);calls[_0x98a6('0x3b')](_0x581926);recordings[_0x98a6('0x3b')](_0x581926);}catch(_0x35454c){utils[_0x98a6('0x12')](util['format']('[%s][index][newchannel]',_0x581926[_0x98a6('0x1c')]),_0x35454c);}});ami['on']('dialbegin',function(_0x57541b){try{utils[_0x98a6('0x16')](util[_0x98a6('0x17')](_0x98a6('0x3d'),_0x57541b['uniqueid']),_0x57541b);dials[_0x98a6('0x3e')](_0x57541b);}catch(_0xfb2c1f){utils['error'](util[_0x98a6('0x17')](_0x98a6('0x3f'),_0x57541b[_0x98a6('0x1c')]),_0xfb2c1f);}});ami['on'](_0x98a6('0x40'),function(_0x2d472f){try{utils['debug'](util[_0x98a6('0x17')](_0x98a6('0x41'),_0x2d472f['uniqueid']),_0x2d472f);dials[_0x98a6('0x40')](_0x2d472f);}catch(_0x3fc47c){utils[_0x98a6('0x12')](util[_0x98a6('0x17')](_0x98a6('0x41'),_0x2d472f[_0x98a6('0x1c')]),_0x3fc47c);}});} \ No newline at end of file +var _0x49ba=['[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','username','password','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x49ba,0x174));var _0xa49b=function(_0x219e5d,_0x219cd3){_0x219e5d=_0x219e5d-0x0;var _0x1e071b=_0x49ba[_0x219e5d];return _0x1e071b;};var AsteriskManager=require(_0xa49b('0x0'));var config=require(_0xa49b('0x1'));var utils=require(_0xa49b('0x2'));var util=require(_0xa49b('0x3'));var ami=new AsteriskManager(config['asterisk'][_0xa49b('0x4')],config[_0xa49b('0x5')]['ip'],config['asterisk'][_0xa49b('0x6')],config['asterisk'][_0xa49b('0x7')],!![]);ami['keepConnected']();if(config[_0xa49b('0x8')]&&config[_0xa49b('0x8')][_0xa49b('0x9')]){utils[_0xa49b('0xa')](_0xa49b('0xb'));}else{var agents=require(_0xa49b('0xc'));var calls=require('./calls.controller');var queues=require(_0xa49b('0xd'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xa49b('0xe'));var transfers=require(_0xa49b('0xf'));var core=require(_0xa49b('0x10'));ami['on'](_0xa49b('0x11'),core['connect']);ami['on'](_0xa49b('0x12'),core[_0xa49b('0x12')]);ami['on'](_0xa49b('0x13'),core[_0xa49b('0x13')]);ami['on'](_0xa49b('0x14'),core[_0xa49b('0x14')]);ami['on'](_0xa49b('0x15'),core[_0xa49b('0x15')]);ami['on'](_0xa49b('0x16'),core['managerevent']);ami['on'](_0xa49b('0x17'),function(_0x57bdff){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x1a'),_0x57bdff[_0xa49b('0x1b')]),_0x57bdff);members[_0xa49b('0x17')](_0x57bdff);}catch(_0x318018){utils['error'](util[_0xa49b('0x19')](_0xa49b('0x1a'),_0x57bdff[_0xa49b('0x1b')]),_0x318018);}});ami['on'](_0xa49b('0x1c'),function(_0x20d401){try{utils[_0xa49b('0x18')](util['format'](_0xa49b('0x1d'),_0x20d401['uniqueid']),_0x20d401);agents['agentcalled'](_0x20d401);}catch(_0x283c50){utils['error'](util[_0xa49b('0x19')](_0xa49b('0x1d'),_0x20d401['uniqueid']),_0x283c50);}});ami['on'](_0xa49b('0x1e'),function(_0x1c89ee){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x1f'),_0x1c89ee[_0xa49b('0x20')]),_0x1c89ee);agents['agentringnoanswer'](_0x1c89ee);}catch(_0x3e8379){utils[_0xa49b('0x14')](util['format'](_0xa49b('0x1f'),_0x1c89ee[_0xa49b('0x20')]),_0x3e8379);}});ami['on'](_0xa49b('0x21'),function(_0x58633d){try{utils[_0xa49b('0x18')](util['format'](_0xa49b('0x22'),_0x58633d[_0xa49b('0x20')]),_0x58633d);agents[_0xa49b('0x21')](_0x58633d);queues[_0xa49b('0x21')](_0x58633d);}catch(_0x4f174c){utils['error'](util[_0xa49b('0x19')](_0xa49b('0x22'),_0x58633d['uniqueid']),_0x4f174c);}});ami['on'](_0xa49b('0x23'),function(_0x5183d7){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x24'),_0x5183d7[_0xa49b('0x20')]),_0x5183d7);agents[_0xa49b('0x23')](_0x5183d7);queues[_0xa49b('0x23')](_0x5183d7);members[_0xa49b('0x23')](_0x5183d7);}catch(_0xd43af1){utils[_0xa49b('0x14')](util['format'](_0xa49b('0x24'),_0x5183d7[_0xa49b('0x20')]),_0xd43af1);}});ami['on'](_0xa49b('0x25'),function(_0x6a97e3){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x26'),_0x6a97e3[_0xa49b('0x20')]),_0x6a97e3);agents[_0xa49b('0x25')](_0x6a97e3);queues[_0xa49b('0x25')](_0x6a97e3);}catch(_0x361f21){utils['error'](util[_0xa49b('0x19')](_0xa49b('0x26'),_0x6a97e3[_0xa49b('0x20')]),_0x361f21);}});ami['on']('queuecallerjoin',function(_0xcc42fa){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x27'),_0xcc42fa['uniqueid']),_0xcc42fa);queues[_0xa49b('0x28')](_0xcc42fa);recordings[_0xa49b('0x28')](_0xcc42fa);}catch(_0x5dcba0){utils['error'](util[_0xa49b('0x19')](_0xa49b('0x27'),_0xcc42fa['uniqueid']),_0x5dcba0);}});ami['on'](_0xa49b('0x29'),function(_0x581710){try{utils[_0xa49b('0x18')](util['format']('[%s][index][queuecallerleave]',_0x581710['uniqueid']),_0x581710);queues['queuecallerleave'](_0x581710);}catch(_0x31c068){utils['error'](util['format'](_0xa49b('0x2a'),_0x581710[_0xa49b('0x20')]),_0x31c068);}});ami['on']('musiconholdstart',function(_0x39ae22){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')]('[%s][index][musiconholdstart]',_0x39ae22[_0xa49b('0x20')]),_0x39ae22);queues[_0xa49b('0x2b')](_0x39ae22);calls['musiconholdstart'](_0x39ae22);}catch(_0x54e06b){utils[_0xa49b('0x14')](util['format'](_0xa49b('0x2c'),_0x39ae22['uniqueid']),_0x54e06b);}});ami['on']('musiconholdstop',function(_0x386cab){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x2d'),_0x386cab[_0xa49b('0x20')]),_0x386cab);queues['musiconholdstop'](_0x386cab);calls[_0xa49b('0x2e')](_0x386cab);}catch(_0xf09aef){utils['error'](util['format']('[%s][index][musiconholdstop]',_0x386cab[_0xa49b('0x20')]),_0xf09aef);}});ami['on'](_0xa49b('0x2f'),function(_0x42f803){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x30'),_0x42f803[_0xa49b('0x20')]),_0x42f803);calls[_0xa49b('0x2f')](_0x42f803);recordings[_0xa49b('0x2f')](_0x42f803);}catch(_0x1383ec){utils[_0xa49b('0x14')](util['format'](_0xa49b('0x30'),_0x42f803[_0xa49b('0x20')]),_0x1383ec);}});ami['on'](_0xa49b('0x31'),function(_0x44000d){try{utils[_0xa49b('0x18')](util['format'](_0xa49b('0x32'),_0x44000d[_0xa49b('0x20')]),_0x44000d);calls[_0xa49b('0x31')](_0x44000d);recordings[_0xa49b('0x31')](_0x44000d);dials['hangup'](_0x44000d);agents[_0xa49b('0x31')](_0x44000d);queues[_0xa49b('0x31')](_0x44000d);}catch(_0x1f8bbd){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x32'),_0x44000d[_0xa49b('0x20')]),_0x1f8bbd);}});ami['on'](_0xa49b('0x33'),function(_0x328de5){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x34'),_0x328de5[_0xa49b('0x20')]),_0x328de5);members['cdr'](_0x328de5);}catch(_0x18cc34){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x34'),_0x328de5[_0xa49b('0x20')]),_0x18cc34);}});ami['on'](_0xa49b('0x35'),function(_0xf6443b){try{utils[_0xa49b('0x18')](util['format'](_0xa49b('0x36'),_0xf6443b['uniqueid']),_0xf6443b);queues[_0xa49b('0x35')](_0xf6443b);agents[_0xa49b('0x35')](_0xf6443b);transfers['blindtransfer'](_0xf6443b);}catch(_0x20fada){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x36'),_0xf6443b[_0xa49b('0x20')]),_0x20fada);}});ami['on']('attendedtransfer',function(_0x47dd7a){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x37'),_0x47dd7a[_0xa49b('0x38')]),_0x47dd7a);queues[_0xa49b('0x39')](_0x47dd7a);transfers[_0xa49b('0x39')](_0x47dd7a);agents[_0xa49b('0x39')](_0x47dd7a);calls[_0xa49b('0x39')](_0x47dd7a);}catch(_0x49f1ce){utils['error'](util['format'](_0xa49b('0x37'),_0x47dd7a[_0xa49b('0x38')]),_0x49f1ce);}});ami['on'](_0xa49b('0x3a'),function(_0x29a62a){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x3b'),_0x29a62a['uniqueid']),_0x29a62a);queues[_0xa49b('0x3a')](_0x29a62a);recordings[_0xa49b('0x3a')](_0x29a62a);calls[_0xa49b('0x3a')](_0x29a62a);dials[_0xa49b('0x3a')](_0x29a62a);}catch(_0x2b0a1e){utils[_0xa49b('0x14')](util[_0xa49b('0x19')]('[%s][index][varset]',_0x29a62a[_0xa49b('0x20')]),_0x2b0a1e);}});ami['on'](_0xa49b('0x3c'),function(_0x1ece9b){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x3d'),_0x1ece9b[_0xa49b('0x20')]),_0x1ece9b);calls[_0xa49b('0x3c')](_0x1ece9b);recordings['newexten'](_0x1ece9b);dials[_0xa49b('0x3c')](_0x1ece9b);}catch(_0x295f68){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x3d'),_0x1ece9b['uniqueid']),_0x295f68);}});ami['on'](_0xa49b('0x3e'),function(_0xdf0b6c){try{utils[_0xa49b('0x18')](util[_0xa49b('0x19')](_0xa49b('0x3f'),_0xdf0b6c[_0xa49b('0x20')]),_0xdf0b6c);calls[_0xa49b('0x3e')](_0xdf0b6c);recordings['newchannel'](_0xdf0b6c);}catch(_0x1b696f){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x3f'),_0xdf0b6c['uniqueid']),_0x1b696f);}});ami['on']('dialbegin',function(_0x3b7b73){try{utils[_0xa49b('0x18')](util['format'](_0xa49b('0x40'),_0x3b7b73[_0xa49b('0x20')]),_0x3b7b73);dials[_0xa49b('0x41')](_0x3b7b73);}catch(_0x2f683c){utils[_0xa49b('0x14')](util[_0xa49b('0x19')](_0xa49b('0x42'),_0x3b7b73[_0xa49b('0x20')]),_0x2f683c);}});ami['on'](_0xa49b('0x43'),function(_0x510227){try{utils['debug'](util[_0xa49b('0x19')](_0xa49b('0x44'),_0x510227['uniqueid']),_0x510227);dials[_0xa49b('0x43')](_0x510227);}catch(_0x2179b7){utils[_0xa49b('0x14')](util[_0xa49b('0x19')]('[%s][index][dialend]',_0x510227[_0xa49b('0x20')]),_0x2179b7);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index de99813..caeef82 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 _0x14ee=['exitAt','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','[%s][members][cdr]','lodash','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','isNil'];(function(_0x51dc46,_0xd254f6){var _0x158721=function(_0x2602e5){while(--_0x2602e5){_0x51dc46['push'](_0x51dc46['shift']());}};_0x158721(++_0xd254f6);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe14e('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xe14e('0x1'),_0xe14e('0x2')];function writeDB(_0x9df8cf){utils[_0xe14e('0x3')](util[_0xe14e('0x4')](_0xe14e('0x5'),_0x9df8cf[_0xe14e('0x6')],_0x9df8cf[_0xe14e('0x7')],_0x9df8cf['channel'],_0x9df8cf['data2'],_0x9df8cf['membername'],_0x9df8cf[_0xe14e('0x8')]));if(_0x9df8cf[_0xe14e('0x7')]){utils[_0xe14e('0x9')](_0x9df8cf[_0xe14e('0x7')])[_0xe14e('0xa')](function(_0x120659){if(_0x120659){_0x9df8cf[_0xe14e('0xb')]=_0x120659[_0xe14e('0xc')];_0x9df8cf[_0xe14e('0xd')]=_0x120659[_0xe14e('0xd')];utils[_0xe14e('0xe')](_0xe14e('0xf'),_0x9df8cf);}else{utils[_0xe14e('0x10')](_0x9df8cf[_0xe14e('0x7')][_0xe14e('0x11')]('/')[0x1])['then'](function(_0x3b661d){if(_0x3b661d){_0x9df8cf[_0xe14e('0xb')]=_0x3b661d['name'];_0x9df8cf[_0xe14e('0xd')]=_0x3b661d['internal'];utils[_0xe14e('0xe')](_0xe14e('0xf'),_0x9df8cf);}});}})[_0xe14e('0x12')](function(_0x3fac03){utils[_0xe14e('0x13')](util[_0xe14e('0x4')](_0xe14e('0x14'),_0x9df8cf['uniqueid']),_0x3fac03);});}delete members[_0x9df8cf[_0xe14e('0x7')]];}function startsWith(_0xa298aa,_0x4c35fd){return _[_0xe14e('0x15')](_0xa298aa,function(_0x40684c){return _[_0xe14e('0x16')](_0x4c35fd,_0x40684c);});}exports[_0xe14e('0x17')]=function(_0x425be5){try{utils[_0xe14e('0x18')](util[_0xe14e('0x4')](_0xe14e('0x19'),members[_0x425be5[_0xe14e('0x1a')]]?members[_0x425be5['device']]['uniqueid']:_0x425be5[_0xe14e('0x1a')]),_0x425be5);utils[_0xe14e('0x3')](util['format'](_0xe14e('0x1b'),members[_0x425be5[_0xe14e('0x1a')]]?members[_0x425be5[_0xe14e('0x1a')]]['uniqueid']:_0x425be5[_0xe14e('0x1a')],_0x425be5[_0xe14e('0x1c')],_0x425be5[_0xe14e('0x1a')]));switch(_0x425be5[_0xe14e('0x1c')]){case _0xe14e('0x1d'):case _0xe14e('0x1e'):if(!startsWith(exclude,_0x425be5[_0xe14e('0x1a')])){members[_0x425be5[_0xe14e('0x1a')]]={'channel':_0xe14e('0x1f'),'interface':_0x425be5[_0xe14e('0x1a')],'type':'TALKING','enterAt':utils[_0xe14e('0x20')](),'role':_0xe14e('0x21')};}break;case'NOT_INUSE':if(!_[_0xe14e('0x22')](members[_0x425be5[_0xe14e('0x1a')]])){members[_0x425be5[_0xe14e('0x1a')]][_0xe14e('0x23')]=utils['now']();members[_0x425be5[_0xe14e('0x1a')]][_0xe14e('0x24')]=utils[_0xe14e('0x25')](members[_0x425be5[_0xe14e('0x1a')]][_0xe14e('0x23')],members[_0x425be5['device']]['enterAt']);if(members[_0x425be5[_0xe14e('0x1a')]][_0xe14e('0x6')]){writeDB(members[_0x425be5[_0xe14e('0x1a')]]);}}break;default:break;}}catch(_0x4e752){utils[_0xe14e('0x13')](util[_0xe14e('0x4')](_0xe14e('0x19'),members[_0x425be5[_0xe14e('0x1a')]]?members[_0x425be5[_0xe14e('0x1a')]][_0xe14e('0x6')]:_0x425be5[_0xe14e('0x1a')]),_0x4e752);}};exports[_0xe14e('0x26')]=function(_0x48121c){try{if(!_['isNil'](members[_0x48121c[_0xe14e('0x7')]])){utils[_0xe14e('0x18')](util['format'](_0xe14e('0x27'),_0x48121c['uniqueid']),_0x48121c);utils[_0xe14e('0x3')](util['format'](_0xe14e('0x28'),_0x48121c[_0xe14e('0x6')],_0x48121c[_0xe14e('0x7')],_0x48121c[_0xe14e('0x29')]));members[_0x48121c[_0xe14e('0x7')]]=_[_0xe14e('0x2a')](members[_0x48121c['interface']],{'data4':_0x48121c[_0xe14e('0x29')],'uniqueid':_0x48121c[_0xe14e('0x6')]});}}catch(_0x327510){utils[_0xe14e('0x13')](util['format'](_0xe14e('0x27'),_0x48121c[_0xe14e('0x6')]),_0x327510);}};exports[_0xe14e('0x2b')]=function(_0x31a2eb){try{utils[_0xe14e('0x18')](util['format']('[%s][members][cdr]',_0x31a2eb[_0xe14e('0x6')]),_0x31a2eb);if(_0x31a2eb['channel']){var _0x4418d3=_0x31a2eb['channel'][_0xe14e('0x11')]('-')[0x0];if(!_['isNil'](members[_0x4418d3])){members[_0x4418d3]=_[_0xe14e('0x2a')](members[_0x4418d3],{'data1':members[_0x4418d3]['data1']||_0x31a2eb[_0xe14e('0x8')],'data2':members[_0x4418d3][_0xe14e('0x2c')]||_0x31a2eb[_0xe14e('0x2d')],'data3':members[_0x4418d3][_0xe14e('0x2e')]||_0x31a2eb[_0xe14e('0x2f')],'uniqueid':members[_0x4418d3][_0xe14e('0x6')]||_0x31a2eb[_0xe14e('0x6')]});utils[_0xe14e('0x3')](util[_0xe14e('0x4')](_0xe14e('0x30'),_0x31a2eb[_0xe14e('0x6')],members[_0x4418d3]['data1'],members[_0x4418d3]['data2'],members[_0x4418d3][_0xe14e('0x2e')]));if(members[_0x4418d3][_0xe14e('0x23')]){writeDB(members[_0x4418d3]);}}}if(_0x31a2eb[_0xe14e('0x31')]){var _0x2d89c3=_0x31a2eb['destinationchannel']['split']('-')[0x0];if(!_[_0xe14e('0x22')](members[_0x2d89c3])){members[_0x2d89c3]=_[_0xe14e('0x2a')](members[_0x2d89c3],{'data1':members[_0x2d89c3][_0xe14e('0x32')]||_0x31a2eb[_0xe14e('0x8')],'data2':members[_0x2d89c3][_0xe14e('0x2c')]||_0x31a2eb[_0xe14e('0x2d')],'data3':members[_0x2d89c3]['data3']||_0x31a2eb[_0xe14e('0x2f')],'uniqueid':members[_0x2d89c3][_0xe14e('0x6')]||_0x31a2eb[_0xe14e('0x6')]});utils[_0xe14e('0x3')](util[_0xe14e('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x31a2eb[_0xe14e('0x6')],members[_0x2d89c3][_0xe14e('0x32')],members[_0x2d89c3][_0xe14e('0x2c')],members[_0x2d89c3][_0xe14e('0x2e')]));if(members[_0x2d89c3][_0xe14e('0x23')]){writeDB(members[_0x2d89c3]);}}}}catch(_0x3a7fb9){utils[_0xe14e('0x13')](util[_0xe14e('0x4')](_0xe14e('0x33'),_0x31a2eb[_0xe14e('0x6')]),_0x3a7fb9);}}; \ No newline at end of file +var _0x6f5c=['device','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','error','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','channel','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]'];(function(_0x21c67c,_0x899396){var _0x3ec5d1=function(_0x460157){while(--_0x460157){_0x21c67c['push'](_0x21c67c['shift']());}};_0x3ec5d1(++_0x899396);}(_0x6f5c,0x7a));var _0xc6f5=function(_0x564512,_0x44e36f){_0x564512=_0x564512-0x0;var _0x4d5703=_0x6f5c[_0x564512];return _0x4d5703;};'use strict';var _=require(_0xc6f5('0x0'));var util=require(_0xc6f5('0x1'));var utils=require(_0xc6f5('0x2'));var members={};var exclude=[_0xc6f5('0x3'),'Queue:'];function writeDB(_0x5d1389){utils[_0xc6f5('0x4')](util[_0xc6f5('0x5')](_0xc6f5('0x6'),_0x5d1389[_0xc6f5('0x7')],_0x5d1389[_0xc6f5('0x8')],_0x5d1389['channel'],_0x5d1389[_0xc6f5('0x9')],_0x5d1389[_0xc6f5('0xa')],_0x5d1389[_0xc6f5('0xb')]));if(_0x5d1389[_0xc6f5('0x8')]){utils[_0xc6f5('0xc')](_0x5d1389[_0xc6f5('0x8')])[_0xc6f5('0xd')](function(_0x204428){if(_0x204428){_0x5d1389[_0xc6f5('0xa')]=_0x204428[_0xc6f5('0xe')];_0x5d1389[_0xc6f5('0xf')]=_0x204428['internal'];utils[_0xc6f5('0x10')](_0xc6f5('0x11'),_0x5d1389);}else{utils[_0xc6f5('0x12')](_0x5d1389[_0xc6f5('0x8')][_0xc6f5('0x13')]('/')[0x1])[_0xc6f5('0xd')](function(_0x4fa622){if(_0x4fa622){_0x5d1389[_0xc6f5('0xa')]=_0x4fa622[_0xc6f5('0xe')];_0x5d1389['internal']=_0x4fa622[_0xc6f5('0xf')];utils[_0xc6f5('0x10')](_0xc6f5('0x11'),_0x5d1389);}});}})['catch'](function(_0x44d55d){utils['error'](util['format'](_0xc6f5('0x14'),_0x5d1389['uniqueid']),_0x44d55d);});}delete members[_0x5d1389[_0xc6f5('0x8')]];}function startsWith(_0x2e404e,_0x4c904c){return _['some'](_0x2e404e,function(_0x5e98c5){return _[_0xc6f5('0x15')](_0x4c904c,_0x5e98c5);});}exports[_0xc6f5('0x16')]=function(_0x5f5d41){try{utils[_0xc6f5('0x17')](util[_0xc6f5('0x5')](_0xc6f5('0x18'),members[_0x5f5d41['device']]?members[_0x5f5d41[_0xc6f5('0x19')]][_0xc6f5('0x7')]:_0x5f5d41[_0xc6f5('0x19')]),_0x5f5d41);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5f5d41[_0xc6f5('0x19')]]?members[_0x5f5d41['device']][_0xc6f5('0x7')]:_0x5f5d41[_0xc6f5('0x19')],_0x5f5d41[_0xc6f5('0x1a')],_0x5f5d41['device']));switch(_0x5f5d41['state']){case _0xc6f5('0x1b'):case _0xc6f5('0x1c'):if(!startsWith(exclude,_0x5f5d41[_0xc6f5('0x19')])){members[_0x5f5d41['device']]={'channel':_0xc6f5('0x1d'),'interface':_0x5f5d41[_0xc6f5('0x19')],'type':_0xc6f5('0x1e'),'enterAt':utils['now'](),'role':_0xc6f5('0x1f')};}break;case _0xc6f5('0x20'):if(!_[_0xc6f5('0x21')](members[_0x5f5d41[_0xc6f5('0x19')]])){members[_0x5f5d41[_0xc6f5('0x19')]][_0xc6f5('0x22')]=utils['now']();members[_0x5f5d41['device']]['duration']=utils['diffTime'](members[_0x5f5d41['device']][_0xc6f5('0x22')],members[_0x5f5d41[_0xc6f5('0x19')]]['enterAt']);if(members[_0x5f5d41['device']]['uniqueid']){writeDB(members[_0x5f5d41['device']]);}}break;default:break;}}catch(_0x549847){utils[_0xc6f5('0x23')](util[_0xc6f5('0x5')](_0xc6f5('0x18'),members[_0x5f5d41[_0xc6f5('0x19')]]?members[_0x5f5d41[_0xc6f5('0x19')]][_0xc6f5('0x7')]:_0x5f5d41[_0xc6f5('0x19')]),_0x549847);}};exports[_0xc6f5('0x24')]=function(_0x5b1c3c){try{if(!_[_0xc6f5('0x21')](members[_0x5b1c3c[_0xc6f5('0x8')]])){utils[_0xc6f5('0x17')](util[_0xc6f5('0x5')](_0xc6f5('0x25'),_0x5b1c3c['uniqueid']),_0x5b1c3c);utils[_0xc6f5('0x4')](util[_0xc6f5('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x5b1c3c[_0xc6f5('0x7')],_0x5b1c3c[_0xc6f5('0x8')],_0x5b1c3c[_0xc6f5('0x26')]));members[_0x5b1c3c['interface']]=_[_0xc6f5('0x27')](members[_0x5b1c3c[_0xc6f5('0x8')]],{'data4':_0x5b1c3c[_0xc6f5('0x26')],'uniqueid':_0x5b1c3c[_0xc6f5('0x7')]});}}catch(_0x59164c){utils[_0xc6f5('0x23')](util['format'](_0xc6f5('0x25'),_0x5b1c3c[_0xc6f5('0x7')]),_0x59164c);}};exports[_0xc6f5('0x28')]=function(_0x3eae38){try{utils[_0xc6f5('0x17')](util[_0xc6f5('0x5')](_0xc6f5('0x29'),_0x3eae38[_0xc6f5('0x7')]),_0x3eae38);if(_0x3eae38[_0xc6f5('0x2a')]){var _0x571235=_0x3eae38[_0xc6f5('0x2a')]['split']('-')[0x0];if(!_[_0xc6f5('0x21')](members[_0x571235])){members[_0x571235]=_[_0xc6f5('0x27')](members[_0x571235],{'data1':members[_0x571235][_0xc6f5('0x2b')]||_0x3eae38[_0xc6f5('0xb')],'data2':members[_0x571235]['data2']||_0x3eae38[_0xc6f5('0x2c')],'data3':members[_0x571235][_0xc6f5('0x2d')]||_0x3eae38['destination'],'uniqueid':members[_0x571235][_0xc6f5('0x7')]||_0x3eae38[_0xc6f5('0x7')]});utils['info'](util[_0xc6f5('0x5')](_0xc6f5('0x2e'),_0x3eae38[_0xc6f5('0x7')],members[_0x571235][_0xc6f5('0x2b')],members[_0x571235][_0xc6f5('0x9')],members[_0x571235]['data3']));if(members[_0x571235][_0xc6f5('0x22')]){writeDB(members[_0x571235]);}}}if(_0x3eae38[_0xc6f5('0x2f')]){var _0x3cabce=_0x3eae38[_0xc6f5('0x2f')][_0xc6f5('0x13')]('-')[0x0];if(!_[_0xc6f5('0x21')](members[_0x3cabce])){members[_0x3cabce]=_[_0xc6f5('0x27')](members[_0x3cabce],{'data1':members[_0x3cabce][_0xc6f5('0x2b')]||_0x3eae38[_0xc6f5('0xb')],'data2':members[_0x3cabce][_0xc6f5('0x9')]||_0x3eae38[_0xc6f5('0x2c')],'data3':members[_0x3cabce][_0xc6f5('0x2d')]||_0x3eae38[_0xc6f5('0x30')],'uniqueid':members[_0x3cabce][_0xc6f5('0x7')]||_0x3eae38[_0xc6f5('0x7')]});utils['info'](util[_0xc6f5('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3eae38[_0xc6f5('0x7')],members[_0x3cabce][_0xc6f5('0x2b')],members[_0x3cabce][_0xc6f5('0x9')],members[_0x3cabce][_0xc6f5('0x2d')]));if(members[_0x3cabce][_0xc6f5('0x22')]){writeDB(members[_0x3cabce]);}}}}catch(_0x2eafcd){utils[_0xc6f5('0x23')](util[_0xc6f5('0x5')](_0xc6f5('0x29'),_0x3eae38[_0xc6f5('0x7')]),_0x2eafcd);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a53129b..983497f 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 _0x1b9c=['ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','agentcomplete','assigned','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x1b9c,0xe9));var _0xc1b9=function(_0x4b50c8,_0x239003){_0x4b50c8=_0x4b50c8-0x0;var _0x2664f1=_0x1b9c[_0x4b50c8];return _0x2664f1;};'use strict';var _=require(_0xc1b9('0x0'));var util=require('util');var utils=require(_0xc1b9('0x1'));var queues={};function writeDB(_0x4ace27){utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4ace27['uniqueid'],_0x4ace27[_0xc1b9('0x4')],_0x4ace27['queue'],_0x4ace27[_0xc1b9('0x5')],_0x4ace27[_0xc1b9('0x6')],_0x4ace27[_0xc1b9('0x7')],_0x4ace27['queuecallerexitreason']));if(_0x4ace27[_0xc1b9('0x8')]){utils[_0xc1b9('0x9')](_0x4ace27['queue'])[_0xc1b9('0xa')](function(_0x2bbd30){if(_0x2bbd30){_0x4ace27[_0xc1b9('0xb')]=_0x2bbd30[_0xc1b9('0xb')];}utils[_0xc1b9('0xc')](_0xc1b9('0xd'),_0x4ace27);});}else{utils[_0xc1b9('0xc')](_0xc1b9('0xd'),_0x4ace27);}if(_0x4ace27[_0xc1b9('0xe')]){delete queues[_0x4ace27['transfereduniqueid']];}else{delete queues[_0x4ace27['uniqueid']];}}exports[_0xc1b9('0xf')]=function(_0x3838e2){try{utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')]('[%s][queues][queuecallerjoin]',_0x3838e2[_0xc1b9('0x11')]),_0x3838e2);utils['info'](util[_0xc1b9('0x3')](_0xc1b9('0x12'),_0x3838e2[_0xc1b9('0x11')],_0x3838e2['queue'],_0x3838e2[_0xc1b9('0x13')]));queues[_0x3838e2['uniqueid']]=_[_0xc1b9('0x14')](_0x3838e2,{'originalposition':_0x3838e2[_0xc1b9('0x13')],'queuecallerjoinAt':utils[_0xc1b9('0x15')](),'mohtime':0x0});}catch(_0x5b5c87){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')]('[%s][queues][queuecallerjoin]',_0x3838e2[_0xc1b9('0x11')]),_0x5b5c87);}};exports[_0xc1b9('0x17')]=function(_0x12cd3d){try{if(!_[_0xc1b9('0x18')](queues[_0x12cd3d[_0xc1b9('0x11')]])){utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')](_0xc1b9('0x19'),_0x12cd3d[_0xc1b9('0x11')]),_0x12cd3d);if(queues[_0x12cd3d[_0xc1b9('0x11')]]['queuecallerleaveAt']){if(!queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0x1a')]&&!queues[_0x12cd3d['uniqueid']][_0xc1b9('0x1b')]){queues[_0x12cd3d['uniqueid']][_0xc1b9('0x1c')]=!![];queues[_0x12cd3d['uniqueid']][_0xc1b9('0x1d')]=utils['now']();queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0x1e')]='COMPLETEDBYAGENT';}utils['info'](util[_0xc1b9('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x12cd3d[_0xc1b9('0x11')],queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0x1f')],queues[_0x12cd3d['uniqueid']][_0xc1b9('0x1e')]));writeDB(queues[_0x12cd3d[_0xc1b9('0x11')]]);}else if(queues[_0x12cd3d[_0xc1b9('0x11')]]['transfereduniqueid']){utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x20'),_0x12cd3d[_0xc1b9('0x11')],queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0x1f')],queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0xe')]));queues[queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0xe')]]=queues[_0x12cd3d[_0xc1b9('0x11')]];queues[queues[_0x12cd3d[_0xc1b9('0x11')]][_0xc1b9('0xe')]][_0xc1b9('0x21')]=0x2;delete queues[_0x12cd3d[_0xc1b9('0x11')]];}}}catch(_0x359446){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')](_0xc1b9('0x19'),_0x12cd3d['uniqueid']),_0x359446);}};exports['varset']=function(_0x46173d){try{utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')](_0xc1b9('0x22'),_0x46173d[_0xc1b9('0x11')]),_0x46173d);if(!_['isNil'](_0x46173d[_0xc1b9('0x23')][_0xc1b9('0x24')])&&_0x46173d[_0xc1b9('0x25')][_0xc1b9('0x26')]()!==_0xc1b9('0x27')){if(!_[_0xc1b9('0x18')](queues[_0x46173d['uniqueid']])){queues[_0x46173d['uniqueid']][_0xc1b9('0x1a')]=![];queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x28')]=null;queues[_0x46173d['uniqueid']][_0xc1b9('0x1b')]=!![];queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x29')]=utils[_0xc1b9('0x15')]();queues[_0x46173d['uniqueid']][_0xc1b9('0x1e')]=_0x46173d[_0xc1b9('0x25')][_0xc1b9('0x26')]();utils['info'](util['format'](_0xc1b9('0x2a'),_0x46173d[_0xc1b9('0x11')],queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1f')],_0x46173d[_0xc1b9('0x25')],queues[_0x46173d[_0xc1b9('0x11')]]['queuecallerexitreason']));writeDB(queues[_0x46173d[_0xc1b9('0x11')]]);}}else if(!_[_0xc1b9('0x18')](_0x46173d[_0xc1b9('0x23')]['queueposition'])){if(!_[_0xc1b9('0x18')](queues[_0x46173d[_0xc1b9('0x11')]])&&!queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1a')]){queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1a')]=![];queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x28')]=null;queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1b')]=!![];queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x29')]=utils[_0xc1b9('0x15')]();queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1e')]=_0xc1b9('0x2b');utils[_0xc1b9('0x2')](util['format'](_0xc1b9('0x2c'),_0x46173d[_0xc1b9('0x11')],queues[_0x46173d[_0xc1b9('0x11')]][_0xc1b9('0x1f')],_0x46173d[_0xc1b9('0x25')],queues[_0x46173d[_0xc1b9('0x11')]]['queuecallerexitreason']));}}}catch(_0x3e2ca3){utils['error'](util[_0xc1b9('0x3')](_0xc1b9('0x22'),_0x46173d[_0xc1b9('0x11')]),_0x3e2ca3);}};exports[_0xc1b9('0x1a')]=function(_0x4cade8){try{if(!_[_0xc1b9('0x18')](queues[_0x4cade8[_0xc1b9('0x11')]])){utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')](_0xc1b9('0x2d'),_0x4cade8[_0xc1b9('0x11')]),_0x4cade8);queues[_0x4cade8[_0xc1b9('0x11')]]['queuecallerexit']=![];queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x29')]=null;queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x1a')]=!![];queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x28')]=utils['now']();queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x1e')]=_0xc1b9('0x2e');utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x2f'),_0x4cade8[_0xc1b9('0x11')],queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x1f')],queues[_0x4cade8[_0xc1b9('0x11')]][_0xc1b9('0x1e')]));}}catch(_0x1b44bb){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')]('[%s][queues][queuecallerabandon]',_0x4cade8[_0xc1b9('0x11')]),_0x1b44bb);}};exports['queuecallerleave']=function(_0x130b6c){try{if(!_[_0xc1b9('0x18')](queues[_0x130b6c[_0xc1b9('0x11')]])){utils[_0xc1b9('0x10')](util['format'](_0xc1b9('0x30'),_0x130b6c[_0xc1b9('0x11')]),_0x130b6c);utils['info'](util['format'](_0xc1b9('0x31'),_0x130b6c[_0xc1b9('0x11')],queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x1f')],_0x130b6c['connectedlinenum'],_0x130b6c[_0xc1b9('0x32')]));queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x33')]=!![];queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x34')]=utils['now']();queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x35')]=utils[_0xc1b9('0x36')](queues[_0x130b6c[_0xc1b9('0x11')]]['queuecallerleaveAt'],queues[_0x130b6c[_0xc1b9('0x11')]]['queuecallerjoinAt']);queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x13')]=_0x130b6c[_0xc1b9('0x13')];queues[_0x130b6c['uniqueid']][_0xc1b9('0x37')]=_0x130b6c[_0xc1b9('0x37')];queues[_0x130b6c[_0xc1b9('0x11')]][_0xc1b9('0x38')]=_0x130b6c[_0xc1b9('0x38')];queues[_0x130b6c['uniqueid']][_0xc1b9('0x32')]=_0x130b6c[_0xc1b9('0x32')];}}catch(_0x4514a2){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')]('[%s][queues][queuecallerleave]',_0x130b6c[_0xc1b9('0x11')]),_0x4514a2);}};exports[_0xc1b9('0x39')]=function(_0x61882f){try{if(!_[_0xc1b9('0x18')](queues[_0x61882f['uniqueid']])){utils[_0xc1b9('0x10')](util['format'](_0xc1b9('0x3a'),_0x61882f[_0xc1b9('0x11')]),_0x61882f);utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x61882f['uniqueid'],queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x1f')],_0x61882f[_0xc1b9('0x3b')],_0x61882f[_0xc1b9('0x3c')]));queues[_0x61882f['uniqueid']][_0xc1b9('0x1a')]=![];queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x1a')]=![];queues[_0x61882f['uniqueid']][_0xc1b9('0x28')]=null;queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x1b')]=![];queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x1e')]=null;queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x29')]=null;queues[_0x61882f[_0xc1b9('0x11')]]['assigned']=!![];queues[_0x61882f['uniqueid']][_0xc1b9('0x7')]=_0x61882f[_0xc1b9('0x3c')];queues[_0x61882f[_0xc1b9('0x11')]][_0xc1b9('0x5')]=_0x61882f[_0xc1b9('0x3b')];}}catch(_0x312458){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')](_0xc1b9('0x3a'),_0x61882f[_0xc1b9('0x11')]),_0x312458);}};exports[_0xc1b9('0x3d')]=function(_0x530a1d){try{if(!_['isNil'](queues[_0x530a1d[_0xc1b9('0x11')]])){if(queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x34')]){utils['debug'](util[_0xc1b9('0x3')]('[%s][queues][agentcomplete]',_0x530a1d['uniqueid']),_0x530a1d);queues[_0x530a1d[_0xc1b9('0x11')]]['queuecallerabandon']=![];queues[_0x530a1d['uniqueid']][_0xc1b9('0x1a')]=![];queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x28')]=null;queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1b')]=![];queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x29')]=null;queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x3e')]=!![];queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x5')]=_0x530a1d['membername'];queues[_0x530a1d[_0xc1b9('0x11')]]['queuecallercomplete']=!![];queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1d')]=utils[_0xc1b9('0x15')]();if(_0x530a1d['reason']=='transfer'){if(!queues[_0x530a1d['uniqueid']][_0xc1b9('0x3f')]){queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1e')]=_0xc1b9('0x40');}}else{queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1e')]=_0xc1b9('0x41')+_0x530a1d['reason'][_0xc1b9('0x26')]();}utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x42'),_0x530a1d[_0xc1b9('0x11')],queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1f')],_0x530a1d[_0xc1b9('0x3b')],queues[_0x530a1d[_0xc1b9('0x11')]][_0xc1b9('0x1e')]));writeDB(queues[_0x530a1d[_0xc1b9('0x11')]]);}}}catch(_0x52e0bf){utils[_0xc1b9('0x16')](util['format'](_0xc1b9('0x43'),_0x530a1d[_0xc1b9('0x11')]),_0x52e0bf);}};exports[_0xc1b9('0x44')]=function(_0x24ace2){try{if(!_['isNil'](queues[_0x24ace2['transfereeuniqueid']])){utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')](_0xc1b9('0x45'),_0x24ace2['uniqueid']),_0x24ace2);queues[_0x24ace2[_0xc1b9('0x46')]]['transfer']=!![];queues[_0x24ace2[_0xc1b9('0x46')]][_0xc1b9('0x47')]=_0xc1b9('0x48');queues[_0x24ace2[_0xc1b9('0x46')]][_0xc1b9('0x49')]=_0x24ace2['extension'];queues[_0x24ace2[_0xc1b9('0x46')]][_0xc1b9('0x4a')]=_0x24ace2[_0xc1b9('0x46')];queues[_0x24ace2[_0xc1b9('0x46')]][_0xc1b9('0x1e')]=_0xc1b9('0x4b');utils[_0xc1b9('0x2')](util['format'](_0xc1b9('0x4c'),_0x24ace2[_0xc1b9('0x11')],queues[_0x24ace2[_0xc1b9('0x46')]][_0xc1b9('0x1f')],_0x24ace2['transfereeuniqueid'],_0x24ace2[_0xc1b9('0x4d')]));}}catch(_0x6d9644){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')]('[%s][queues][blindtransfer]',_0x24ace2[_0xc1b9('0x11')]),_0x6d9644);}};exports[_0xc1b9('0x4e')]=function(_0x31aa0c){try{utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')]('[%s][queues][attendedtransfer]',_0x31aa0c[_0xc1b9('0x4f')]),_0x31aa0c);if(_0x31aa0c[_0xc1b9('0x4f')]==_0x31aa0c[_0xc1b9('0x50')]){if(!_[_0xc1b9('0x18')](queues[_0x31aa0c[_0xc1b9('0x51')]])){utils[_0xc1b9('0x2')](util['format'](_0xc1b9('0x52'),_0x31aa0c['origtransfereruniqueid'],queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x1f')],_0x31aa0c[_0xc1b9('0x53')]));queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x3f')]=!![];queues[_0x31aa0c['secondtransfererlinkedid']]['transfertype']=_0xc1b9('0x54');queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x49')]=_0x31aa0c[_0xc1b9('0x53')];queues[_0x31aa0c['secondtransfererlinkedid']][_0xc1b9('0x4a')]=_0x31aa0c['origtransfereruniqueid'];queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x1e')]=_0xc1b9('0x55');}if(!_[_0xc1b9('0x18')](queues[_0x31aa0c[_0xc1b9('0x50')]])){if(_0x31aa0c[_0xc1b9('0x56')]&&queues[_0x31aa0c[_0xc1b9('0x56')]]){queues[_0x31aa0c[_0xc1b9('0x56')]]['queuecallerenterreason']=0x1;queues[_0x31aa0c[_0xc1b9('0x46')]]=_[_0xc1b9('0x57')](queues[_0x31aa0c[_0xc1b9('0x56')]]);queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0xe')]=_0x31aa0c[_0xc1b9('0x58')];queues[_0x31aa0c['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0x6')]=queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x6')];queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0x59')]=queues[_0x31aa0c[_0xc1b9('0x51')]][_0xc1b9('0x59')];queues[_0x31aa0c[_0xc1b9('0x46')]]['queuecallerjoinAt']=utils[_0xc1b9('0x15')]();queues[_0x31aa0c['transfereeuniqueid']][_0xc1b9('0x34')]=utils[_0xc1b9('0x15')]();queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0x35')]=0x0;queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0x5a')]=0x0;utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x31aa0c[_0xc1b9('0x4f')],queues[_0x31aa0c[_0xc1b9('0x46')]][_0xc1b9('0x1f')],queues[_0x31aa0c[_0xc1b9('0x46')]]['calleridnum'],queues[_0x31aa0c['transfereeuniqueid']][_0xc1b9('0x59')]));}else{utils[_0xc1b9('0x2')](util['format'](_0xc1b9('0x5b'),_0x31aa0c['origtransfereruniqueid'],queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x1f')],_0x31aa0c[_0xc1b9('0x51')]));queues[_0x31aa0c['origtransfererlinkedid']]['transfereduniqueid']=_0x31aa0c[_0xc1b9('0x51')];}}}else if(_0x31aa0c[_0xc1b9('0x5c')]==_0x31aa0c[_0xc1b9('0x51')]){if(!_[_0xc1b9('0x18')](queues[_0x31aa0c[_0xc1b9('0x50')]])){utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x5d'),_0x31aa0c[_0xc1b9('0x4f')],queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x1f')],_0x31aa0c['secondtransfereruniqueid'],_0x31aa0c[_0xc1b9('0x5e')]));queues[_0x31aa0c[_0xc1b9('0x50')]]['transfer']=!![];queues[_0x31aa0c['origtransfererlinkedid']][_0xc1b9('0x47')]='ATTENDED';queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x49')]=_0x31aa0c[_0xc1b9('0x5e')];queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x4a')]=_0x31aa0c['secondtransfereruniqueid'];queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x1e')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x31aa0c['secondtransfererlinkedid']])){if(_0x31aa0c[_0xc1b9('0x5f')]&&queues[_0x31aa0c[_0xc1b9('0x5f')]]){queues[_0x31aa0c[_0xc1b9('0x5f')]][_0xc1b9('0x21')]=0x1;queues[_0x31aa0c[_0xc1b9('0x58')]]=_['clone'](queues[_0x31aa0c[_0xc1b9('0x5f')]]);queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0xe')]=_0x31aa0c[_0xc1b9('0x58')];queues[_0x31aa0c['transfertargetuniqueid']][_0xc1b9('0x21')]=0x2;queues[_0x31aa0c['transfertargetuniqueid']]['calleridnum']=queues[_0x31aa0c[_0xc1b9('0x50')]]['calleridnum'];queues[_0x31aa0c['transfertargetuniqueid']][_0xc1b9('0x59')]=queues[_0x31aa0c[_0xc1b9('0x50')]][_0xc1b9('0x59')];queues[_0x31aa0c['transfertargetuniqueid']][_0xc1b9('0x60')]=utils[_0xc1b9('0x15')]();queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0x34')]=utils[_0xc1b9('0x15')]();queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0x35')]=0x0;queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0x5a')]=0x0;utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x61'),_0x31aa0c['origtransfereruniqueid'],queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0x1f')],queues[_0x31aa0c[_0xc1b9('0x58')]][_0xc1b9('0xe')],queues[_0x31aa0c['transfertargetuniqueid']]['calleridnum'],queues[_0x31aa0c[_0xc1b9('0x58')]]['calleridname']));}else{utils[_0xc1b9('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x31aa0c[_0xc1b9('0x4f')],queues[_0x31aa0c[_0xc1b9('0x51')]]['name'],_0x31aa0c['origtransfererlinkedid']));queues[_0x31aa0c['secondtransfererlinkedid']]['transfereduniqueid']=_0x31aa0c[_0xc1b9('0x50')];}}}}catch(_0x2bf477){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')](_0xc1b9('0x62'),_0x31aa0c[_0xc1b9('0x4f')]),_0x2bf477);}};exports[_0xc1b9('0x63')]=function(_0x20a13f){try{if(!_[_0xc1b9('0x18')](queues[_0x20a13f['uniqueid']])){utils[_0xc1b9('0x10')](util['format'](_0xc1b9('0x64'),_0x20a13f[_0xc1b9('0x11')]),_0x20a13f);queues[_0x20a13f['uniqueid']]['musiconholdstartAt']=utils[_0xc1b9('0x15')]();utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x65'),_0x20a13f[_0xc1b9('0x11')],queues[_0x20a13f[_0xc1b9('0x11')]][_0xc1b9('0x1f')],queues[_0x20a13f[_0xc1b9('0x11')]][_0xc1b9('0x66')]));}}catch(_0x430146){utils['error'](util[_0xc1b9('0x3')](_0xc1b9('0x64'),_0x20a13f[_0xc1b9('0x11')]),_0x430146);}};exports[_0xc1b9('0x67')]=function(_0x33a262){try{if(!_['isNil'](queues[_0x33a262[_0xc1b9('0x11')]])){if(!_[_0xc1b9('0x18')](queues[_0x33a262[_0xc1b9('0x11')]]['musiconholdstartAt'])){utils[_0xc1b9('0x10')](util[_0xc1b9('0x3')](_0xc1b9('0x68'),_0x33a262[_0xc1b9('0x11')]),_0x33a262);queues[_0x33a262[_0xc1b9('0x11')]]['mohtime']+=utils[_0xc1b9('0x36')](utils[_0xc1b9('0x15')](),queues[_0x33a262['uniqueid']][_0xc1b9('0x66')]);utils[_0xc1b9('0x2')](util[_0xc1b9('0x3')](_0xc1b9('0x69'),_0x33a262[_0xc1b9('0x11')],queues[_0x33a262[_0xc1b9('0x11')]][_0xc1b9('0x1f')],queues[_0x33a262[_0xc1b9('0x11')]][_0xc1b9('0x5a')]));delete queues[_0x33a262[_0xc1b9('0x11')]][_0xc1b9('0x66')];}}}catch(_0x5669f1){utils[_0xc1b9('0x16')](util[_0xc1b9('0x3')]('[%s][queues][musiconholdstop]',_0x33a262[_0xc1b9('0x11')]),_0x5669f1);}}; \ No newline at end of file +var _0x5459=['transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','calleridnum','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer'];(function(_0xefb84d,_0x272af0){var _0x2667d9=function(_0x3b444d){while(--_0x3b444d){_0xefb84d['push'](_0xefb84d['shift']());}};_0x2667d9(++_0x272af0);}(_0x5459,0x8e));var _0x9545=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5459[_0x432682];return _0x463d05;};'use strict';var _=require(_0x9545('0x0'));var util=require('util');var utils=require(_0x9545('0x1'));var queues={};function writeDB(_0x2aaaf6){utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x4'),_0x2aaaf6[_0x9545('0x5')],_0x2aaaf6[_0x9545('0x6')],_0x2aaaf6[_0x9545('0x7')],_0x2aaaf6[_0x9545('0x8')],_0x2aaaf6['calleridnum'],_0x2aaaf6[_0x9545('0x9')],_0x2aaaf6[_0x9545('0xa')]));if(_0x2aaaf6[_0x9545('0x7')]){utils[_0x9545('0xb')](_0x2aaaf6[_0x9545('0x7')])[_0x9545('0xc')](function(_0x2e0617){if(_0x2e0617){_0x2aaaf6['type']=_0x2e0617['type'];}utils[_0x9545('0xd')](_0x9545('0xe'),_0x2aaaf6);});}else{utils[_0x9545('0xd')]('CreateVoiceQueueReport',_0x2aaaf6);}if(_0x2aaaf6[_0x9545('0xf')]){delete queues[_0x2aaaf6[_0x9545('0xf')]];}else{delete queues[_0x2aaaf6[_0x9545('0x5')]];}}exports[_0x9545('0x10')]=function(_0x55efad){try{utils[_0x9545('0x11')](util[_0x9545('0x3')]('[%s][queues][queuecallerjoin]',_0x55efad['uniqueid']),_0x55efad);utils['info'](util[_0x9545('0x3')](_0x9545('0x12'),_0x55efad[_0x9545('0x5')],_0x55efad[_0x9545('0x7')],_0x55efad[_0x9545('0x13')]));queues[_0x55efad[_0x9545('0x5')]]=_['assign'](_0x55efad,{'originalposition':_0x55efad[_0x9545('0x13')],'queuecallerjoinAt':utils[_0x9545('0x14')](),'mohtime':0x0});}catch(_0x3377c4){utils[_0x9545('0x15')](util[_0x9545('0x3')](_0x9545('0x16'),_0x55efad[_0x9545('0x5')]),_0x3377c4);}};exports[_0x9545('0x17')]=function(_0x54263d){try{if(!_[_0x9545('0x18')](queues[_0x54263d[_0x9545('0x5')]])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x19'),_0x54263d['uniqueid']),_0x54263d);if(queues[_0x54263d[_0x9545('0x5')]][_0x9545('0x1a')]){if(!queues[_0x54263d['uniqueid']][_0x9545('0x1b')]&&!queues[_0x54263d[_0x9545('0x5')]][_0x9545('0x1c')]){queues[_0x54263d[_0x9545('0x5')]][_0x9545('0x1d')]=!![];queues[_0x54263d['uniqueid']]['queuecallercompleteAt']=utils[_0x9545('0x14')]();queues[_0x54263d['uniqueid']][_0x9545('0xa')]=_0x9545('0x1e');}utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x1f'),_0x54263d[_0x9545('0x5')],queues[_0x54263d['uniqueid']][_0x9545('0x20')],queues[_0x54263d[_0x9545('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x54263d[_0x9545('0x5')]]);}else if(queues[_0x54263d['uniqueid']][_0x9545('0xf')]){utils['info'](util[_0x9545('0x3')](_0x9545('0x21'),_0x54263d['uniqueid'],queues[_0x54263d[_0x9545('0x5')]]['name'],queues[_0x54263d[_0x9545('0x5')]]['transfereduniqueid']));queues[queues[_0x54263d[_0x9545('0x5')]][_0x9545('0xf')]]=queues[_0x54263d[_0x9545('0x5')]];queues[queues[_0x54263d[_0x9545('0x5')]][_0x9545('0xf')]][_0x9545('0x22')]=0x2;delete queues[_0x54263d[_0x9545('0x5')]];}}}catch(_0x136065){utils['error'](util[_0x9545('0x3')](_0x9545('0x19'),_0x54263d['uniqueid']),_0x136065);}};exports[_0x9545('0x23')]=function(_0x3745ca){try{utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x24'),_0x3745ca['uniqueid']),_0x3745ca);if(!_[_0x9545('0x18')](_0x3745ca[_0x9545('0x25')][_0x9545('0x26')])&&_0x3745ca[_0x9545('0x27')][_0x9545('0x28')]()!==_0x9545('0x29')){if(!_['isNil'](queues[_0x3745ca[_0x9545('0x5')]])){queues[_0x3745ca[_0x9545('0x5')]]['queuecallerabandon']=![];queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x2a')]=null;queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x1c')]=!![];queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x2b')]=utils[_0x9545('0x14')]();queues[_0x3745ca[_0x9545('0x5')]]['queuecallerexitreason']=_0x3745ca['value']['toUpperCase']();utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x2c'),_0x3745ca[_0x9545('0x5')],queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x20')],_0x3745ca['value'],queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0xa')]));writeDB(queues[_0x3745ca['uniqueid']]);}}else if(!_[_0x9545('0x18')](_0x3745ca[_0x9545('0x25')]['queueposition'])){if(!_[_0x9545('0x18')](queues[_0x3745ca['uniqueid']])&&!queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x1b')]){queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x1b')]=![];queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x2a')]=null;queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x1c')]=!![];queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0x2b')]=utils['now']();queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0xa')]=_0x9545('0x2d');utils[_0x9545('0x2')](util['format'](_0x9545('0x2e'),_0x3745ca['uniqueid'],queues[_0x3745ca[_0x9545('0x5')]]['name'],_0x3745ca[_0x9545('0x27')],queues[_0x3745ca[_0x9545('0x5')]][_0x9545('0xa')]));}}}catch(_0x1bf266){utils[_0x9545('0x15')](util[_0x9545('0x3')](_0x9545('0x24'),_0x3745ca['uniqueid']),_0x1bf266);}};exports[_0x9545('0x1b')]=function(_0x55ef3b){try{if(!_['isNil'](queues[_0x55ef3b[_0x9545('0x5')]])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x2f'),_0x55ef3b[_0x9545('0x5')]),_0x55ef3b);queues[_0x55ef3b['uniqueid']][_0x9545('0x1c')]=![];queues[_0x55ef3b[_0x9545('0x5')]][_0x9545('0x2b')]=null;queues[_0x55ef3b[_0x9545('0x5')]][_0x9545('0x1b')]=!![];queues[_0x55ef3b[_0x9545('0x5')]]['queuecallerabandonAt']=utils[_0x9545('0x14')]();queues[_0x55ef3b[_0x9545('0x5')]][_0x9545('0xa')]=_0x9545('0x30');utils[_0x9545('0x2')](util['format'](_0x9545('0x31'),_0x55ef3b['uniqueid'],queues[_0x55ef3b['uniqueid']][_0x9545('0x20')],queues[_0x55ef3b[_0x9545('0x5')]][_0x9545('0xa')]));}}catch(_0x1e7e71){utils[_0x9545('0x15')](util[_0x9545('0x3')](_0x9545('0x2f'),_0x55ef3b[_0x9545('0x5')]),_0x1e7e71);}};exports[_0x9545('0x32')]=function(_0x334d00){try{if(!_[_0x9545('0x18')](queues[_0x334d00['uniqueid']])){utils['debug'](util[_0x9545('0x3')](_0x9545('0x33'),_0x334d00[_0x9545('0x5')]),_0x334d00);utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x34'),_0x334d00[_0x9545('0x5')],queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x20')],_0x334d00['connectedlinenum'],_0x334d00['connectedlinename']));queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x32')]=!![];queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x1a')]=utils[_0x9545('0x14')]();queues[_0x334d00['uniqueid']]['holdtime']=utils[_0x9545('0x35')](queues[_0x334d00['uniqueid']][_0x9545('0x1a')],queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x36')]);queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x13')]=_0x334d00['position'];queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x37')]=_0x334d00['count'];queues[_0x334d00[_0x9545('0x5')]][_0x9545('0x38')]=_0x334d00[_0x9545('0x38')];queues[_0x334d00['uniqueid']][_0x9545('0x39')]=_0x334d00[_0x9545('0x39')];}}catch(_0x1bceb4){utils['error'](util[_0x9545('0x3')](_0x9545('0x33'),_0x334d00['uniqueid']),_0x1bceb4);}};exports[_0x9545('0x3a')]=function(_0x319bd2){try{if(!_[_0x9545('0x18')](queues[_0x319bd2[_0x9545('0x5')]])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x3b'),_0x319bd2['uniqueid']),_0x319bd2);utils[_0x9545('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x319bd2[_0x9545('0x5')],queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0x20')],_0x319bd2[_0x9545('0x3c')],_0x319bd2[_0x9545('0x3d')]));queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0x1b')]=![];queues[_0x319bd2['uniqueid']][_0x9545('0x1b')]=![];queues[_0x319bd2['uniqueid']][_0x9545('0x2a')]=null;queues[_0x319bd2[_0x9545('0x5')]]['queuecallerexit']=![];queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0xa')]=null;queues[_0x319bd2['uniqueid']][_0x9545('0x2b')]=null;queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0x3e')]=!![];queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0x9')]=_0x319bd2[_0x9545('0x3d')];queues[_0x319bd2[_0x9545('0x5')]][_0x9545('0x8')]=_0x319bd2[_0x9545('0x3c')];}}catch(_0x2f3ad5){utils['error'](util[_0x9545('0x3')](_0x9545('0x3b'),_0x319bd2['uniqueid']),_0x2f3ad5);}};exports[_0x9545('0x3f')]=function(_0x34dff2){try{if(!_[_0x9545('0x18')](queues[_0x34dff2['uniqueid']])){if(queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x1a')]){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x40'),_0x34dff2['uniqueid']),_0x34dff2);queues[_0x34dff2[_0x9545('0x5')]]['queuecallerabandon']=![];queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x1b')]=![];queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x2a')]=null;queues[_0x34dff2['uniqueid']][_0x9545('0x1c')]=![];queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x2b')]=null;queues[_0x34dff2[_0x9545('0x5')]]['assigned']=!![];queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x8')]=_0x34dff2['membername'];queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x1d')]=!![];queues[_0x34dff2[_0x9545('0x5')]]['queuecallercompleteAt']=utils[_0x9545('0x14')]();if(_0x34dff2['reason']==_0x9545('0x41')){if(!queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x41')]){queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0xa')]=_0x9545('0x42');}}else{queues[_0x34dff2[_0x9545('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x34dff2[_0x9545('0x43')][_0x9545('0x28')]();}utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x44'),_0x34dff2[_0x9545('0x5')],queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0x20')],_0x34dff2[_0x9545('0x3c')],queues[_0x34dff2[_0x9545('0x5')]][_0x9545('0xa')]));writeDB(queues[_0x34dff2[_0x9545('0x5')]]);}}}catch(_0x2634c0){utils['error'](util['format'](_0x9545('0x40'),_0x34dff2[_0x9545('0x5')]),_0x2634c0);}};exports[_0x9545('0x45')]=function(_0x82dc85){try{if(!_[_0x9545('0x18')](queues[_0x82dc85[_0x9545('0x46')]])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x47'),_0x82dc85['uniqueid']),_0x82dc85);queues[_0x82dc85[_0x9545('0x46')]]['transfer']=!![];queues[_0x82dc85['transfereeuniqueid']][_0x9545('0x48')]=_0x9545('0x49');queues[_0x82dc85[_0x9545('0x46')]][_0x9545('0x4a')]=_0x82dc85[_0x9545('0x4b')];queues[_0x82dc85[_0x9545('0x46')]][_0x9545('0x4c')]=_0x82dc85[_0x9545('0x46')];queues[_0x82dc85[_0x9545('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x4d'),_0x82dc85[_0x9545('0x5')],queues[_0x82dc85[_0x9545('0x46')]][_0x9545('0x20')],_0x82dc85['transfereeuniqueid'],_0x82dc85[_0x9545('0x4b')]));}}catch(_0x32e4a7){utils[_0x9545('0x15')](util[_0x9545('0x3')](_0x9545('0x47'),_0x82dc85['uniqueid']),_0x32e4a7);}};exports[_0x9545('0x4e')]=function(_0x36407b){try{utils[_0x9545('0x11')](util['format'](_0x9545('0x4f'),_0x36407b[_0x9545('0x50')]),_0x36407b);if(_0x36407b[_0x9545('0x50')]==_0x36407b['origtransfererlinkedid']){if(!_[_0x9545('0x18')](queues[_0x36407b[_0x9545('0x51')]])){utils[_0x9545('0x2')](util['format'](_0x9545('0x52'),_0x36407b[_0x9545('0x50')],queues[_0x36407b[_0x9545('0x51')]][_0x9545('0x20')],_0x36407b[_0x9545('0x53')]));queues[_0x36407b[_0x9545('0x51')]][_0x9545('0x41')]=!![];queues[_0x36407b[_0x9545('0x51')]][_0x9545('0x48')]=_0x9545('0x54');queues[_0x36407b['secondtransfererlinkedid']][_0x9545('0x4a')]=_0x36407b[_0x9545('0x53')];queues[_0x36407b['secondtransfererlinkedid']][_0x9545('0x4c')]=_0x36407b[_0x9545('0x50')];queues[_0x36407b[_0x9545('0x51')]][_0x9545('0xa')]=_0x9545('0x55');}if(!_[_0x9545('0x18')](queues[_0x36407b[_0x9545('0x56')]])){if(_0x36407b['transfereelinkedid']&&queues[_0x36407b[_0x9545('0x57')]]){queues[_0x36407b[_0x9545('0x57')]][_0x9545('0x22')]=0x1;queues[_0x36407b[_0x9545('0x46')]]=_[_0x9545('0x58')](queues[_0x36407b['transfereelinkedid']]);queues[_0x36407b['transfereeuniqueid']]['transfereduniqueid']=_0x36407b['transfertargetuniqueid'];queues[_0x36407b[_0x9545('0x46')]][_0x9545('0x22')]=0x2;queues[_0x36407b[_0x9545('0x46')]]['calleridnum']=queues[_0x36407b[_0x9545('0x51')]]['calleridnum'];queues[_0x36407b[_0x9545('0x46')]][_0x9545('0x59')]=queues[_0x36407b[_0x9545('0x51')]][_0x9545('0x59')];queues[_0x36407b[_0x9545('0x46')]]['queuecallerjoinAt']=utils[_0x9545('0x14')]();queues[_0x36407b[_0x9545('0x46')]]['queuecallerleaveAt']=utils['now']();queues[_0x36407b[_0x9545('0x46')]][_0x9545('0x5a')]=0x0;queues[_0x36407b[_0x9545('0x46')]][_0x9545('0x5b')]=0x0;utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x5c'),_0x36407b[_0x9545('0x50')],queues[_0x36407b['transfereeuniqueid']][_0x9545('0x20')],queues[_0x36407b[_0x9545('0x46')]]['calleridnum'],queues[_0x36407b[_0x9545('0x46')]][_0x9545('0x59')]));}else{utils['info'](util[_0x9545('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x36407b[_0x9545('0x50')],queues[_0x36407b[_0x9545('0x56')]]['name'],_0x36407b[_0x9545('0x51')]));queues[_0x36407b[_0x9545('0x56')]][_0x9545('0xf')]=_0x36407b[_0x9545('0x51')];}}}else if(_0x36407b[_0x9545('0x5d')]==_0x36407b[_0x9545('0x51')]){if(!_['isNil'](queues[_0x36407b[_0x9545('0x56')]])){utils[_0x9545('0x2')](util['format'](_0x9545('0x5e'),_0x36407b[_0x9545('0x50')],queues[_0x36407b[_0x9545('0x56')]]['name'],_0x36407b[_0x9545('0x5d')],_0x36407b[_0x9545('0x5f')]));queues[_0x36407b[_0x9545('0x56')]][_0x9545('0x41')]=!![];queues[_0x36407b['origtransfererlinkedid']]['transfertype']=_0x9545('0x54');queues[_0x36407b[_0x9545('0x56')]][_0x9545('0x4a')]=_0x36407b[_0x9545('0x5f')];queues[_0x36407b[_0x9545('0x56')]][_0x9545('0x4c')]=_0x36407b[_0x9545('0x5d')];queues[_0x36407b[_0x9545('0x56')]][_0x9545('0xa')]=_0x9545('0x55');}if(!_[_0x9545('0x18')](queues[_0x36407b[_0x9545('0x51')]])){if(_0x36407b[_0x9545('0x60')]&&queues[_0x36407b[_0x9545('0x60')]]){queues[_0x36407b['transfertargetlinkedid']][_0x9545('0x22')]=0x1;queues[_0x36407b['transfertargetuniqueid']]=_[_0x9545('0x58')](queues[_0x36407b['transfertargetlinkedid']]);queues[_0x36407b['transfertargetuniqueid']][_0x9545('0xf')]=_0x36407b[_0x9545('0x61')];queues[_0x36407b[_0x9545('0x61')]]['queuecallerenterreason']=0x2;queues[_0x36407b[_0x9545('0x61')]][_0x9545('0x62')]=queues[_0x36407b[_0x9545('0x56')]][_0x9545('0x62')];queues[_0x36407b[_0x9545('0x61')]][_0x9545('0x59')]=queues[_0x36407b[_0x9545('0x56')]][_0x9545('0x59')];queues[_0x36407b[_0x9545('0x61')]]['queuecallerjoinAt']=utils['now']();queues[_0x36407b[_0x9545('0x61')]]['queuecallerleaveAt']=utils[_0x9545('0x14')]();queues[_0x36407b[_0x9545('0x61')]]['holdtime']=0x0;queues[_0x36407b[_0x9545('0x61')]][_0x9545('0x5b')]=0x0;utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x63'),_0x36407b[_0x9545('0x50')],queues[_0x36407b[_0x9545('0x61')]]['name'],queues[_0x36407b[_0x9545('0x61')]][_0x9545('0xf')],queues[_0x36407b[_0x9545('0x61')]]['calleridnum'],queues[_0x36407b['transfertargetuniqueid']][_0x9545('0x59')]));}else{utils[_0x9545('0x2')](util[_0x9545('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x36407b['origtransfereruniqueid'],queues[_0x36407b[_0x9545('0x51')]][_0x9545('0x20')],_0x36407b[_0x9545('0x56')]));queues[_0x36407b[_0x9545('0x51')]][_0x9545('0xf')]=_0x36407b[_0x9545('0x56')];}}}}catch(_0x133447){utils['error'](util[_0x9545('0x3')](_0x9545('0x4f'),_0x36407b['origtransfereruniqueid']),_0x133447);}};exports[_0x9545('0x64')]=function(_0x48c907){try{if(!_[_0x9545('0x18')](queues[_0x48c907[_0x9545('0x5')]])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x65'),_0x48c907[_0x9545('0x5')]),_0x48c907);queues[_0x48c907['uniqueid']][_0x9545('0x66')]=utils[_0x9545('0x14')]();utils[_0x9545('0x2')](util[_0x9545('0x3')](_0x9545('0x67'),_0x48c907['uniqueid'],queues[_0x48c907[_0x9545('0x5')]][_0x9545('0x20')],queues[_0x48c907[_0x9545('0x5')]][_0x9545('0x66')]));}}catch(_0x4445b8){utils[_0x9545('0x15')](util[_0x9545('0x3')]('[%s][queues][musiconholdstart]',_0x48c907[_0x9545('0x5')]),_0x4445b8);}};exports[_0x9545('0x68')]=function(_0x88cd56){try{if(!_[_0x9545('0x18')](queues[_0x88cd56[_0x9545('0x5')]])){if(!_[_0x9545('0x18')](queues[_0x88cd56[_0x9545('0x5')]][_0x9545('0x66')])){utils[_0x9545('0x11')](util[_0x9545('0x3')](_0x9545('0x69'),_0x88cd56[_0x9545('0x5')]),_0x88cd56);queues[_0x88cd56['uniqueid']]['mohtime']+=utils[_0x9545('0x35')](utils[_0x9545('0x14')](),queues[_0x88cd56['uniqueid']][_0x9545('0x66')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x88cd56[_0x9545('0x5')],queues[_0x88cd56['uniqueid']][_0x9545('0x20')],queues[_0x88cd56[_0x9545('0x5')]]['mohtime']));delete queues[_0x88cd56[_0x9545('0x5')]]['musiconholdstartAt'];}}}catch(_0x293395){utils[_0x9545('0x15')](util['format']('[%s][queues][musiconholdstop]',_0x88cd56[_0x9545('0x5')]),_0x293395);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d416cef..997dd3b 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 _0x2f4e=['lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','accountcode','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','monitors','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x2f4e,0x7c));var _0xe2f4=function(_0x5d2514,_0x21f57e){_0x5d2514=_0x5d2514-0x0;var _0x25062b=_0x2f4e[_0x5d2514];return _0x25062b;};'use strict';var _=require(_0xe2f4('0x0'));var util=require(_0xe2f4('0x1'));var utils=require(_0xe2f4('0x2'));var recordings={};function writeDB(_0x13f6c2){utils[_0xe2f4('0x3')](util[_0xe2f4('0x4')](_0xe2f4('0x5'),_0x13f6c2[_0xe2f4('0x6')]));if(_0x13f6c2['accountcode']){utils[_0xe2f4('0x7')](_0x13f6c2['accountcode'])[_0xe2f4('0x8')](function(_0x268333){if(_0x268333){_0x13f6c2[_0xe2f4('0x9')]=_0x268333['name'];_0x13f6c2[_0xe2f4('0xa')]=_0x268333['id'];}utils[_0xe2f4('0xb')](_0xe2f4('0xc'),_0x13f6c2);});}else{utils['request']('CreateVoiceRecording',_0x13f6c2);}}exports[_0xe2f4('0xd')]=function(_0x5e1de3){try{utils[_0xe2f4('0xe')](util['format'](_0xe2f4('0xf'),_0x5e1de3[_0xe2f4('0x6')]),_0x5e1de3);if(_0x5e1de3['uniqueid']==_0x5e1de3[_0xe2f4('0x10')]){utils[_0xe2f4('0x3')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5e1de3['uniqueid'],_0x5e1de3[_0xe2f4('0x11')],_0x5e1de3['exten']));recordings[_0x5e1de3[_0xe2f4('0x6')]]={'uniqueid':_0x5e1de3[_0xe2f4('0x6')],'accountcode':_0x5e1de3[_0xe2f4('0x12')],'exten':_0x5e1de3[_0xe2f4('0x13')],'context':_0x5e1de3['context'],'channel':_0x5e1de3[_0xe2f4('0x14')],'monitors':[]};}}catch(_0x1fda11){utils[_0xe2f4('0x15')](util['format'](_0xe2f4('0xf'),_0x5e1de3['uniqueid']),_0x1fda11);}};exports[_0xe2f4('0x16')]=function(_0x1e607e){try{utils['debug'](util[_0xe2f4('0x4')](_0xe2f4('0x17'),_0x1e607e[_0xe2f4('0x6')]),_0x1e607e);if(!_['isNil'](recordings[_0x1e607e['uniqueid']])&&_0x1e607e[_0xe2f4('0x18')]==0x6){utils[_0xe2f4('0x3')](util[_0xe2f4('0x4')](_0xe2f4('0x19'),_0x1e607e['uniqueid'],_0x1e607e['context'],_0x1e607e['channel']));}else if(!_[_0xe2f4('0x1a')](recordings[_0x1e607e[_0xe2f4('0x10')]])&&_0x1e607e['channelstate']==0x6&&_0x1e607e[_0xe2f4('0x11')]!=_0xe2f4('0x1b')){utils[_0xe2f4('0x3')](util['format'](_0xe2f4('0x1c'),_0x1e607e[_0xe2f4('0x6')],_0x1e607e[_0xe2f4('0x10')],_0x1e607e[_0xe2f4('0x11')],_0x1e607e[_0xe2f4('0x14')]));recordings[_0x1e607e['linkedid']][_0xe2f4('0x12')]=_0x1e607e[_0xe2f4('0x12')];}}catch(_0x27622a){utils[_0xe2f4('0x15')](util[_0xe2f4('0x4')](_0xe2f4('0x17'),_0x1e607e[_0xe2f4('0x6')]),_0x27622a);}};exports[_0xe2f4('0x1d')]=function(_0x1e9a37){try{if(!_[_0xe2f4('0x1a')](_0x1e9a37[_0xe2f4('0x1e')])&&!_[_0xe2f4('0x1a')](_0x1e9a37[_0xe2f4('0x1e')][_0xe2f4('0x1f')])){utils['debug'](util[_0xe2f4('0x4')](_0xe2f4('0x20'),_0x1e9a37[_0xe2f4('0x6')]),_0x1e9a37);utils[_0xe2f4('0x3')](util['format'](_0xe2f4('0x21'),_0x1e9a37[_0xe2f4('0x6')],_0x1e9a37[_0xe2f4('0x1e')],_0x1e9a37[_0xe2f4('0x22')]));if(_[_0xe2f4('0x23')](_0x1e9a37['value'],_0xe2f4('0x24'))){_0x1e9a37['value']=_0x1e9a37['value']['replace']('.wav49',_0xe2f4('0x25'));}if(recordings[_0x1e9a37[_0xe2f4('0x10')]]){var _0x12e429=_[_0xe2f4('0x26')](recordings[_0x1e9a37[_0xe2f4('0x10')]]['monitors'],{'value':_0x1e9a37[_0xe2f4('0x22')]});if(_[_0xe2f4('0x1a')](_0x12e429)){recordings[_0x1e9a37[_0xe2f4('0x10')]]['monitors']['push']({'value':_0x1e9a37['value']});}}}}catch(_0x477187){utils[_0xe2f4('0x15')](util[_0xe2f4('0x4')](_0xe2f4('0x20'),_0x1e9a37['uniqueid']),_0x477187);}};exports[_0xe2f4('0x27')]=function(_0x1ddb89){try{if(!_[_0xe2f4('0x1a')](recordings[_0x1ddb89[_0xe2f4('0x6')]])){utils[_0xe2f4('0xe')](util[_0xe2f4('0x4')](_0xe2f4('0x28'),_0x1ddb89[_0xe2f4('0x6')]),_0x1ddb89);utils[_0xe2f4('0x3')](util[_0xe2f4('0x4')](_0xe2f4('0x29'),_0x1ddb89['uniqueid'],_0x1ddb89[_0xe2f4('0x2a')],_0x1ddb89[_0xe2f4('0x2b')],_0x1ddb89[_0xe2f4('0x2c')]));recordings[_0x1ddb89[_0xe2f4('0x6')]]['calleridnum']=_0x1ddb89[_0xe2f4('0x2a')];recordings[_0x1ddb89[_0xe2f4('0x6')]]['calleridname']=_0x1ddb89[_0xe2f4('0x2b')];recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x2d')]=_0x1ddb89[_0xe2f4('0x2d')];recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x2e')]=_0x1ddb89[_0xe2f4('0x2e')];if(recordings[_0x1ddb89[_0xe2f4('0x6')]]['type']==_0xe2f4('0x2f')&&recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x12')]){recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x2d')]=recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x12')];recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x2e')]='';}recordings[_0x1ddb89[_0xe2f4('0x6')]][_0xe2f4('0x30')]['forEach'](function(_0x27edac){var _0x23e281=_['clone'](recordings[_0x1ddb89['uniqueid']]);_0x23e281[_0xe2f4('0x22')]=_0x27edac['value'];writeDB(_0x23e281);});delete recordings[_0x1ddb89[_0xe2f4('0x6')]];}}catch(_0x23bc5c){utils['error'](util[_0xe2f4('0x4')](_0xe2f4('0x28'),_0x1ddb89[_0xe2f4('0x6')]),_0x23bc5c);}};exports['newexten']=function(_0x5a4ef0){try{if(!_['isNil'](recordings[_0x5a4ef0[_0xe2f4('0x6')]])){utils['debug'](util[_0xe2f4('0x4')]('[%s][recordings][newexten]',_0x5a4ef0[_0xe2f4('0x6')]),_0x5a4ef0);utils[_0xe2f4('0x3')](util[_0xe2f4('0x4')](_0xe2f4('0x31'),_0x5a4ef0[_0xe2f4('0x6')],_0x5a4ef0[_0xe2f4('0x32')],_0x5a4ef0[_0xe2f4('0x33')]));if(_0x5a4ef0[_0xe2f4('0x32')][_0xe2f4('0x34')]()==_0xe2f4('0x35')&&_[_0xe2f4('0x36')](_0x5a4ef0[_0xe2f4('0x33')][_0xe2f4('0x34')](),'cdr')){var _0x37ce56=_0x5a4ef0[_0xe2f4('0x33')][_0xe2f4('0x37')]('=');var _0x11b672=_0x37ce56[0x0][_0xe2f4('0x38')](_0x37ce56[0x0][_0xe2f4('0x39')]('(')+0x1,_0x37ce56[0x0][_0xe2f4('0x39')](')'));var _0x2cc22b=_0x37ce56[0x1];recordings[_0x5a4ef0[_0xe2f4('0x6')]][_0x11b672]=_0x2cc22b;}}}catch(_0x1896bf){utils[_0xe2f4('0x15')](util[_0xe2f4('0x4')](_0xe2f4('0x3a'),_0x5a4ef0[_0xe2f4('0x6')]),_0x1896bf);}};exports['queuecallerjoin']=function(_0x55bfcc){try{if(!_['isNil'](recordings[_0x55bfcc[_0xe2f4('0x6')]])){utils['debug'](util[_0xe2f4('0x4')](_0xe2f4('0x3b'),_0x55bfcc[_0xe2f4('0x6')]),_0x55bfcc);utils['info'](util[_0xe2f4('0x4')](_0xe2f4('0x3c'),_0x55bfcc['uniqueid'],_0x55bfcc[_0xe2f4('0x3d')]));recordings[_0x55bfcc[_0xe2f4('0x6')]]['queue']=_0x55bfcc[_0xe2f4('0x3d')];}}catch(_0xf93789){utils['error'](util[_0xe2f4('0x4')](_0xe2f4('0x3b'),_0x55bfcc[_0xe2f4('0x6')]),_0xf93789);}}; \ No newline at end of file +var _0x7ff4=['[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','isNil','transfer','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0x7ff4,0x6f));var _0x47ff=function(_0x272873,_0x1a122c){_0x272873=_0x272873-0x0;var _0x47ccbf=_0x7ff4[_0x272873];return _0x47ccbf;};'use strict';var _=require(_0x47ff('0x0'));var util=require(_0x47ff('0x1'));var utils=require(_0x47ff('0x2'));var recordings={};function writeDB(_0x140dac){utils[_0x47ff('0x3')](util[_0x47ff('0x4')](_0x47ff('0x5'),_0x140dac[_0x47ff('0x6')]));if(_0x140dac[_0x47ff('0x7')]){utils[_0x47ff('0x8')](_0x140dac[_0x47ff('0x7')])[_0x47ff('0x9')](function(_0x482821){if(_0x482821){_0x140dac[_0x47ff('0xa')]=_0x482821[_0x47ff('0xb')];_0x140dac[_0x47ff('0xc')]=_0x482821['id'];}utils[_0x47ff('0xd')](_0x47ff('0xe'),_0x140dac);});}else{utils['request'](_0x47ff('0xe'),_0x140dac);}}exports[_0x47ff('0xf')]=function(_0x2a4a11){try{utils[_0x47ff('0x10')](util['format'](_0x47ff('0x11'),_0x2a4a11[_0x47ff('0x6')]),_0x2a4a11);if(_0x2a4a11[_0x47ff('0x6')]==_0x2a4a11[_0x47ff('0x12')]){utils[_0x47ff('0x3')](util[_0x47ff('0x4')](_0x47ff('0x13'),_0x2a4a11[_0x47ff('0x6')],_0x2a4a11[_0x47ff('0x14')],_0x2a4a11[_0x47ff('0x15')]));recordings[_0x2a4a11[_0x47ff('0x6')]]={'uniqueid':_0x2a4a11['uniqueid'],'accountcode':_0x2a4a11['accountcode'],'exten':_0x2a4a11['exten'],'context':_0x2a4a11['context'],'channel':_0x2a4a11['channel'],'monitors':[]};}}catch(_0x4d19a3){utils[_0x47ff('0x16')](util[_0x47ff('0x4')](_0x47ff('0x11'),_0x2a4a11['uniqueid']),_0x4d19a3);}};exports[_0x47ff('0x17')]=function(_0x3ff238){try{utils[_0x47ff('0x10')](util[_0x47ff('0x4')](_0x47ff('0x18'),_0x3ff238[_0x47ff('0x6')]),_0x3ff238);if(!_['isNil'](recordings[_0x3ff238[_0x47ff('0x6')]])&&_0x3ff238[_0x47ff('0x19')]==0x6){utils[_0x47ff('0x3')](util[_0x47ff('0x4')](_0x47ff('0x1a'),_0x3ff238[_0x47ff('0x6')],_0x3ff238[_0x47ff('0x14')],_0x3ff238[_0x47ff('0x1b')]));}else if(!_[_0x47ff('0x1c')](recordings[_0x3ff238[_0x47ff('0x12')]])&&_0x3ff238['channelstate']==0x6&&_0x3ff238[_0x47ff('0x14')]!=_0x47ff('0x1d')){utils[_0x47ff('0x3')](util[_0x47ff('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3ff238[_0x47ff('0x6')],_0x3ff238[_0x47ff('0x12')],_0x3ff238[_0x47ff('0x14')],_0x3ff238[_0x47ff('0x1b')]));recordings[_0x3ff238[_0x47ff('0x12')]][_0x47ff('0x7')]=_0x3ff238[_0x47ff('0x7')];}}catch(_0x3acdde){utils[_0x47ff('0x16')](util[_0x47ff('0x4')](_0x47ff('0x18'),_0x3ff238['uniqueid']),_0x3acdde);}};exports['varset']=function(_0x465286){try{if(!_['isNil'](_0x465286[_0x47ff('0x1e')])&&!_['isNil'](_0x465286[_0x47ff('0x1e')][_0x47ff('0x1f')])){utils[_0x47ff('0x10')](util[_0x47ff('0x4')](_0x47ff('0x20'),_0x465286[_0x47ff('0x6')]),_0x465286);utils[_0x47ff('0x3')](util['format'](_0x47ff('0x21'),_0x465286[_0x47ff('0x6')],_0x465286[_0x47ff('0x1e')],_0x465286['value']));if(_[_0x47ff('0x22')](_0x465286[_0x47ff('0x23')],_0x47ff('0x24'))){_0x465286[_0x47ff('0x23')]=_0x465286[_0x47ff('0x23')][_0x47ff('0x25')](_0x47ff('0x24'),_0x47ff('0x26'));}if(recordings[_0x465286[_0x47ff('0x12')]]){var _0x411c64=_['find'](recordings[_0x465286['linkedid']][_0x47ff('0x27')],{'value':_0x465286[_0x47ff('0x23')]});if(_[_0x47ff('0x1c')](_0x411c64)){recordings[_0x465286[_0x47ff('0x12')]]['monitors'][_0x47ff('0x28')]({'value':_0x465286[_0x47ff('0x23')]});}}}}catch(_0x30f025){utils[_0x47ff('0x16')](util[_0x47ff('0x4')](_0x47ff('0x20'),_0x465286[_0x47ff('0x6')]),_0x30f025);}};exports[_0x47ff('0x29')]=function(_0x22dc3a){try{if(!_[_0x47ff('0x1c')](recordings[_0x22dc3a[_0x47ff('0x6')]])){utils[_0x47ff('0x10')](util[_0x47ff('0x4')](_0x47ff('0x2a'),_0x22dc3a[_0x47ff('0x6')]),_0x22dc3a);utils['info'](util['format'](_0x47ff('0x2b'),_0x22dc3a['uniqueid'],_0x22dc3a[_0x47ff('0x2c')],_0x22dc3a[_0x47ff('0x2d')],_0x22dc3a[_0x47ff('0x2e')]));recordings[_0x22dc3a[_0x47ff('0x6')]][_0x47ff('0x2c')]=_0x22dc3a[_0x47ff('0x2c')];recordings[_0x22dc3a['uniqueid']][_0x47ff('0x2d')]=_0x22dc3a['calleridname'];recordings[_0x22dc3a[_0x47ff('0x6')]][_0x47ff('0x2f')]=_0x22dc3a[_0x47ff('0x2f')];recordings[_0x22dc3a['uniqueid']]['connectedlinename']=_0x22dc3a['connectedlinename'];if(recordings[_0x22dc3a[_0x47ff('0x6')]]['type']==_0x47ff('0x30')&&recordings[_0x22dc3a[_0x47ff('0x6')]][_0x47ff('0x7')]){recordings[_0x22dc3a[_0x47ff('0x6')]]['connectedlinenum']=recordings[_0x22dc3a['uniqueid']]['accountcode'];recordings[_0x22dc3a[_0x47ff('0x6')]]['connectedlinename']='';}recordings[_0x22dc3a[_0x47ff('0x6')]][_0x47ff('0x27')]['forEach'](function(_0x1eadc8){var _0x22e30a=_['clone'](recordings[_0x22dc3a['uniqueid']]);_0x22e30a[_0x47ff('0x23')]=_0x1eadc8[_0x47ff('0x23')];writeDB(_0x22e30a);});delete recordings[_0x22dc3a[_0x47ff('0x6')]];}}catch(_0x1f2954){utils['error'](util['format'](_0x47ff('0x2a'),_0x22dc3a[_0x47ff('0x6')]),_0x1f2954);}};exports[_0x47ff('0x31')]=function(_0x430fbc){try{if(!_[_0x47ff('0x1c')](recordings[_0x430fbc[_0x47ff('0x6')]])){utils['debug'](util[_0x47ff('0x4')](_0x47ff('0x32'),_0x430fbc[_0x47ff('0x6')]),_0x430fbc);utils[_0x47ff('0x3')](util[_0x47ff('0x4')](_0x47ff('0x33'),_0x430fbc['uniqueid'],_0x430fbc[_0x47ff('0x34')],_0x430fbc[_0x47ff('0x35')]));if(_0x430fbc['application']['toLowerCase']()==_0x47ff('0x36')&&_[_0x47ff('0x37')](_0x430fbc[_0x47ff('0x35')][_0x47ff('0x38')](),_0x47ff('0x39'))){var _0x2109a5=_0x430fbc[_0x47ff('0x35')][_0x47ff('0x3a')]('=');var _0x370fd2=_0x2109a5[0x0][_0x47ff('0x3b')](_0x2109a5[0x0][_0x47ff('0x3c')]('(')+0x1,_0x2109a5[0x0][_0x47ff('0x3c')](')'));var _0x36e3cb=_0x2109a5[0x1];recordings[_0x430fbc[_0x47ff('0x6')]][_0x370fd2]=_0x36e3cb;}}}catch(_0x51e90d){utils['error'](util[_0x47ff('0x4')](_0x47ff('0x32'),_0x430fbc['uniqueid']),_0x51e90d);}};exports['queuecallerjoin']=function(_0x57ca31){try{if(!_[_0x47ff('0x1c')](recordings[_0x57ca31['uniqueid']])){utils['debug'](util[_0x47ff('0x4')]('[%s][recordings][queuecallerjoin]',_0x57ca31[_0x47ff('0x6')]),_0x57ca31);utils[_0x47ff('0x3')](util['format'](_0x47ff('0x3d'),_0x57ca31[_0x47ff('0x6')],_0x57ca31[_0x47ff('0x3e')]));recordings[_0x57ca31['uniqueid']]['queue']=_0x57ca31['queue'];}}catch(_0x2e2748){utils[_0x47ff('0x16')](util[_0x47ff('0x4')](_0x47ff('0x3f'),_0x57ca31['uniqueid']),_0x2e2748);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b75c49a..9befa3f 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 _0x5360=['origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','error','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','origtransferercontext'];(function(_0x585ec8,_0x56598f){var _0x704a8c=function(_0x330b5c){while(--_0x330b5c){_0x585ec8['push'](_0x585ec8['shift']());}};_0x704a8c(++_0x56598f);}(_0x5360,0x179));var _0x0536=function(_0x30fddd,_0x5662bf){_0x30fddd=_0x30fddd-0x0;var _0x5b62f7=_0x5360[_0x30fddd];return _0x5b62f7;};'use strict';var _=require('lodash');var util=require(_0x0536('0x0'));var utils=require(_0x0536('0x1'));function writeDB(_0x4bbf30){utils[_0x0536('0x2')](util[_0x0536('0x3')](_0x0536('0x4'),_0x4bbf30[_0x0536('0x5')]===_0x0536('0x6')?_0x4bbf30[_0x0536('0x7')]:_0x4bbf30['uniqueid'],_0x4bbf30[_0x0536('0x5')]));utils['request'](_0x0536('0x8'),_0x4bbf30);}exports[_0x0536('0x9')]={};exports[_0x0536('0xa')]=function(_0xb8fc07){try{utils[_0x0536('0xb')](util[_0x0536('0x3')]('[%s][transfers][blindtransfer]',_0xb8fc07[_0x0536('0xc')]),_0xb8fc07);utils[_0x0536('0x2')](util['format'](_0x0536('0xd'),_0xb8fc07[_0x0536('0xc')],_0xb8fc07[_0x0536('0xe')],_0xb8fc07[_0x0536('0xf')],_0xb8fc07['transfereecalleridnum'],_0xb8fc07[_0x0536('0x10')]));_0xb8fc07[_0x0536('0x5')]=_0x0536('0x11');exports['blinds'][_0xb8fc07[_0x0536('0x12')]]=_0xb8fc07;writeDB(_0xb8fc07);}catch(_0x56658e){utils['error'](util[_0x0536('0x3')](_0x0536('0x13'),_0xb8fc07[_0x0536('0xc')]),_0x56658e);}};exports[_0x0536('0x14')]=function(_0x9b42a2){try{utils[_0x0536('0xb')](util[_0x0536('0x3')](_0x0536('0x15'),_0x9b42a2[_0x0536('0x7')]),_0x9b42a2);utils[_0x0536('0x2')](util[_0x0536('0x3')](_0x0536('0x16'),_0x9b42a2[_0x0536('0x7')],_0x9b42a2[_0x0536('0x17')],_0x9b42a2[_0x0536('0x18')],_0x9b42a2[_0x0536('0x19')],_0x9b42a2[_0x0536('0x1a')]));_0x9b42a2=_[_0x0536('0x1b')](_0x9b42a2,{'transfererchannel':_0x9b42a2[_0x0536('0x1c')],'transferercalleridnum':_0x9b42a2[_0x0536('0x17')],'transferercalleridname':_0x9b42a2[_0x0536('0x18')],'transfererconnectedlinenum':_0x9b42a2[_0x0536('0x1d')],'transfererconnectedlinename':_0x9b42a2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x9b42a2['origtransfereraccountcode'],'transferercontext':_0x9b42a2[_0x0536('0x1e')],'transfererexten':_0x9b42a2['secondtransfererexten'],'transfererlinkedid':_0x9b42a2[_0x0536('0x1f')],'context':_0x9b42a2[_0x0536('0x20')],'extension':_0x9b42a2[_0x0536('0x21')],'type':_0x0536('0x6')});if(_[_0x0536('0x22')](_0x9b42a2[_0x0536('0x23')])){_0x9b42a2=_[_0x0536('0x1b')](_0x9b42a2,{'transfereechannel':_0x9b42a2[_0x0536('0x24')],'transfereecalleridnum':_0x9b42a2[_0x0536('0x19')],'transfereecalleridname':_0x9b42a2[_0x0536('0x1a')],'transfereeconnectedlinenum':_0x9b42a2[_0x0536('0x25')],'transfereeconnectedlinename':_0x9b42a2[_0x0536('0x26')],'transfereeaccountcode':_0x9b42a2['transfertargetaccountcode'],'transfereecontext':_0x9b42a2[_0x0536('0x27')],'transfereeexten':_0x9b42a2['transfertargetexten'],'transfereelinkedid':_0x9b42a2['transfertargetlinkedid']});}writeDB(_0x9b42a2);}catch(_0x56bc45){utils[_0x0536('0x28')](util['format']('[%s][transfers][attendedtransfer]',_0x9b42a2[_0x0536('0x7')]),_0x56bc45);}}; \ No newline at end of file +var _0xf97b=['lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid'];(function(_0x41d1aa,_0x5553e6){var _0x5a3971=function(_0x4343b3){while(--_0x4343b3){_0x41d1aa['push'](_0x41d1aa['shift']());}};_0x5a3971(++_0x5553e6);}(_0xf97b,0x168));var _0xbf97=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf97b[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xbf97('0x0'));var util=require('util');var utils=require(_0xbf97('0x1'));function writeDB(_0xaf46a0){utils['info'](util[_0xbf97('0x2')](_0xbf97('0x3'),_0xaf46a0[_0xbf97('0x4')]===_0xbf97('0x5')?_0xaf46a0[_0xbf97('0x6')]:_0xaf46a0['uniqueid'],_0xaf46a0['type']));utils[_0xbf97('0x7')]('CreateVoiceTransferReport',_0xaf46a0);}exports[_0xbf97('0x8')]={};exports[_0xbf97('0x9')]=function(_0x1aadb1){try{utils[_0xbf97('0xa')](util['format']('[%s][transfers][blindtransfer]',_0x1aadb1[_0xbf97('0xb')]),_0x1aadb1);utils['info'](util[_0xbf97('0x2')](_0xbf97('0xc'),_0x1aadb1['uniqueid'],_0x1aadb1[_0xbf97('0xd')],_0x1aadb1[_0xbf97('0xe')],_0x1aadb1['transfereecalleridnum'],_0x1aadb1[_0xbf97('0xf')]));_0x1aadb1[_0xbf97('0x4')]=_0xbf97('0x10');exports['blinds'][_0x1aadb1[_0xbf97('0x11')]]=_0x1aadb1;writeDB(_0x1aadb1);}catch(_0x567f15){utils[_0xbf97('0x12')](util[_0xbf97('0x2')](_0xbf97('0x13'),_0x1aadb1[_0xbf97('0xb')]),_0x567f15);}};exports[_0xbf97('0x14')]=function(_0x17e6a0){try{utils[_0xbf97('0xa')](util[_0xbf97('0x2')](_0xbf97('0x15'),_0x17e6a0[_0xbf97('0x6')]),_0x17e6a0);utils['info'](util[_0xbf97('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x17e6a0[_0xbf97('0x6')],_0x17e6a0['origtransferercalleridnum'],_0x17e6a0[_0xbf97('0x16')],_0x17e6a0['transfertargetcalleridnum'],_0x17e6a0[_0xbf97('0x17')]));_0x17e6a0=_[_0xbf97('0x18')](_0x17e6a0,{'transfererchannel':_0x17e6a0[_0xbf97('0x19')],'transferercalleridnum':_0x17e6a0['origtransferercalleridnum'],'transferercalleridname':_0x17e6a0[_0xbf97('0x16')],'transfererconnectedlinenum':_0x17e6a0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x17e6a0[_0xbf97('0x1a')],'transfereraccountcode':_0x17e6a0[_0xbf97('0x1b')],'transferercontext':_0x17e6a0[_0xbf97('0x1c')],'transfererexten':_0x17e6a0[_0xbf97('0x1d')],'transfererlinkedid':_0x17e6a0['origtransfererlinkedid'],'context':_0x17e6a0[_0xbf97('0x1e')],'extension':_0x17e6a0[_0xbf97('0x1f')],'type':_0xbf97('0x5')});if(_[_0xbf97('0x20')](_0x17e6a0[_0xbf97('0x21')])){_0x17e6a0=_['assign'](_0x17e6a0,{'transfereechannel':_0x17e6a0['transfertargetchannel'],'transfereecalleridnum':_0x17e6a0[_0xbf97('0x22')],'transfereecalleridname':_0x17e6a0[_0xbf97('0x17')],'transfereeconnectedlinenum':_0x17e6a0[_0xbf97('0x23')],'transfereeconnectedlinename':_0x17e6a0[_0xbf97('0x24')],'transfereeaccountcode':_0x17e6a0[_0xbf97('0x25')],'transfereecontext':_0x17e6a0['transfertargetcontext'],'transfereeexten':_0x17e6a0[_0xbf97('0x26')],'transfereelinkedid':_0x17e6a0[_0xbf97('0x27')]});}writeDB(_0x17e6a0);}catch(_0x16fa39){utils[_0xbf97('0x12')](util[_0xbf97('0x2')]('[%s][transfers][attendedtransfer]',_0x17e6a0[_0xbf97('0x6')]),_0x16fa39);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c001b4b..0459364 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 _0x0db8=['length','getUserByInternal','notfound','catch','[utils][getUserByInternal]','getUserByInterface','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','seconds','now','isAfter','isBefore','bluebird','moment','util','client','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x383579,_0x2b3d5c){var _0x20b1dd=function(_0x25f376){while(--_0x25f376){_0x383579['push'](_0x383579['shift']());}};_0x20b1dd(++_0x2b3d5c);}(_0x0db8,0x1cd));var _0x80db=function(_0x3b834f,_0x34977a){_0x3b834f=_0x3b834f-0x0;var _0x41f4ff=_0x0db8[_0x3b834f];return _0x41f4ff;};'use strict';var BPromise=require(_0x80db('0x0'));var jayson=require('jayson/promise');var moment=require(_0x80db('0x1'));var util=require(_0x80db('0x2'));var client=jayson[_0x80db('0x3')][_0x80db('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x80db('0x5')]=function(_0x23227c,_0x5f3bcc){logger['info'](_0x23227c,_0x5f3bcc?util[_0x80db('0x6')](_0x5f3bcc,{'showHidden':![],'depth':null}):'');};exports[_0x80db('0x7')]=function(_0x423ecf,_0x58abba){logger[_0x80db('0x7')](_0x423ecf,_0x58abba?util[_0x80db('0x6')](_0x58abba,{'showHidden':![],'depth':null}):'');};exports[_0x80db('0x8')]=function(_0x336795,_0x276940){logger[_0x80db('0x8')](_0x336795,_0x276940?util[_0x80db('0x6')](_0x276940,{'showHidden':![],'depth':null}):'');};exports[_0x80db('0x9')]=function(_0x4c6499,_0x50f1f7){return client[_0x80db('0x9')](_0x4c6499,{'body':_0x50f1f7})[_0x80db('0xa')](function(_0x21b3c9){logger[_0x80db('0x7')]('[utils][request]\x20name:%s',_0x4c6499,_0x21b3c9?util[_0x80db('0x6')](_0x21b3c9,{'showHidden':![],'depth':null}):'');})['catch'](function(_0xac7ccc){logger[_0x80db('0x8')](_0x80db('0xb'),_0x4c6499,_0xac7ccc?util[_0x80db('0x6')](_0xac7ccc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x8b3342){return client[_0x80db('0x9')](_0x80db('0xc'),{'options':{'raw':!![],'attributes':['id',_0x80db('0xd'),_0x80db('0xe'),_0x80db('0xf')],'where':_0x8b3342,'limit':0x1}})[_0x80db('0xa')](function(_0x1dcb2f){logger['debug'](_0x80db('0x10'),JSON[_0x80db('0x11')](_0x8b3342),_0x1dcb2f?util[_0x80db('0x6')](_0x1dcb2f,{'showHidden':![],'depth':null}):'');return _0x1dcb2f[_0x80db('0x12')][_0x80db('0x13')]?_0x1dcb2f['result'][0x0]:null;});}exports[_0x80db('0x14')]=function(_0x36ffe6){return new BPromise(function(_0x3765d8,_0x56d7bf){if(_0x36ffe6){return getUser({'internal':_0x36ffe6})[_0x80db('0xa')](function(_0xab0b0a){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x36ffe6,_0xab0b0a?'found':_0x80db('0x15'));return _0x3765d8(_0xab0b0a);})[_0x80db('0x16')](function(_0x10abe9){logger[_0x80db('0x8')](_0x80db('0x17'),_0x10abe9?util['inspect'](_0x10abe9,{'showHidden':![],'depth':null}):'');return _0x3765d8(null);});}return _0x3765d8(null);});};exports[_0x80db('0x18')]=function(_0x81a7f){return new BPromise(function(_0x1bfaef,_0x4bf177){if(_0x81a7f){return getUser({'interface':_0x81a7f})['then'](function(_0x36d74f){logger[_0x80db('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x81a7f,_0x36d74f?_0x80db('0x19'):'notfound');return _0x1bfaef(_0x36d74f);})[_0x80db('0x16')](function(_0x5372f8){logger[_0x80db('0x8')](_0x80db('0x1a'),_0x5372f8?util[_0x80db('0x6')](_0x5372f8,{'showHidden':![],'depth':null}):'');return _0x1bfaef(null);});}return _0x1bfaef(null);});};exports[_0x80db('0x1b')]=function(_0x49876f){return new BPromise(function(_0xd390c,_0x52cc9b){if(_0x49876f){return getUser({'name':_0x49876f})[_0x80db('0xa')](function(_0x18a0b7){logger[_0x80db('0x5')](_0x80db('0x1c'),_0x49876f,_0x18a0b7?_0x80db('0x19'):_0x80db('0x15'));return _0xd390c(_0x18a0b7);})[_0x80db('0x16')](function(_0x128ee4){logger[_0x80db('0x8')](_0x80db('0x1d'),_0x128ee4?util[_0x80db('0x6')](_0x128ee4,{'showHidden':![],'depth':null}):'');return _0xd390c(null);});}return _0xd390c(null);});};exports[_0x80db('0x1e')]=function(_0x5da430){return new BPromise(function(_0x10ffaa,_0x5838fb){if(_0x5da430){return client[_0x80db('0x9')](_0x80db('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x80db('0xe'),'type',_0x80db('0x20'),_0x80db('0x21')],'where':{'name':_0x5da430},'limit':0x1}})['then'](function(_0x37e6a9){logger[_0x80db('0x7')](_0x80db('0x22'),_0x5da430,_0x37e6a9?util[_0x80db('0x6')](_0x37e6a9,{'showHidden':![],'depth':null}):'');logger[_0x80db('0x5')](_0x80db('0x23'),_0x5da430,_0x37e6a9?'found':'notfound');return _0x10ffaa(_0x37e6a9[_0x80db('0x12')][_0x80db('0x13')]?_0x37e6a9[_0x80db('0x12')][0x0]:null);})['catch'](function(_0x223ee3){logger[_0x80db('0x8')](_0x80db('0x24'),_0x223ee3?util[_0x80db('0x6')](_0x223ee3,{'showHidden':![],'depth':null}):'');return _0x10ffaa(null);});}return _0x10ffaa(null);});};exports['addTime']=function(_0x5379b8,_0x24f705){return moment(_0x5379b8)[_0x80db('0x25')](_0x24f705,'seconds')[_0x80db('0x26')](_0x80db('0x27'));};exports[_0x80db('0x28')]=function(_0x177c6e,_0x1d046b){return moment(_0x177c6e)[_0x80db('0x29')](_0x1d046b,'seconds')['format'](_0x80db('0x27'));};exports[_0x80db('0x2a')]=function(_0x3ebcc3,_0x216320){return moment(_0x3ebcc3)[_0x80db('0x2b')](moment(_0x216320),_0x80db('0x2c'));};exports['sumTime']=function(_0x541923,_0x58c97c){return parseInt(_0x541923,0xa)+parseInt(_0x58c97c,0xa);};exports[_0x80db('0x2d')]=function(){return moment()['format'](_0x80db('0x27'));};exports[_0x80db('0x2e')]=function(_0x5058ef,_0x18d231){if(_0x18d231){return moment(_0x5058ef)[_0x80db('0x2e')](_0x18d231);}return!![];};exports['isBefore']=function(_0x2a3cf2,_0xc9de){if(_0xc9de){return moment(_0x2a3cf2)[_0x80db('0x2f')](_0xc9de);}else if(_0x2a3cf2){return!![];}return![];}; \ No newline at end of file +var _0xd579=['add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','notfound','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime'];(function(_0x1b9e70,_0x55954f){var _0x4d87f7=function(_0x45db16){while(--_0x45db16){_0x1b9e70['push'](_0x1b9e70['shift']());}};_0x4d87f7(++_0x55954f);}(_0xd579,0x1e9));var _0x9d57=function(_0x5a6bb2,_0x2836f3){_0x5a6bb2=_0x5a6bb2-0x0;var _0x54efc6=_0xd579[_0x5a6bb2];return _0x54efc6;};'use strict';var BPromise=require(_0x9d57('0x0'));var jayson=require(_0x9d57('0x1'));var moment=require('moment');var util=require(_0x9d57('0x2'));var client=jayson[_0x9d57('0x3')][_0x9d57('0x4')]({'port':0x2329});var logger=require(_0x9d57('0x5'))(_0x9d57('0x6'));exports[_0x9d57('0x7')]=function(_0x3a1bf8,_0xc0a16a){logger[_0x9d57('0x7')](_0x3a1bf8,_0xc0a16a?util[_0x9d57('0x8')](_0xc0a16a,{'showHidden':![],'depth':null}):'');};exports[_0x9d57('0x9')]=function(_0x14fd23,_0x380731){logger[_0x9d57('0x9')](_0x14fd23,_0x380731?util[_0x9d57('0x8')](_0x380731,{'showHidden':![],'depth':null}):'');};exports[_0x9d57('0xa')]=function(_0x2b8c99,_0x26a525){logger['error'](_0x2b8c99,_0x26a525?util[_0x9d57('0x8')](_0x26a525,{'showHidden':![],'depth':null}):'');};exports[_0x9d57('0xb')]=function(_0x44d8b4,_0x557a64){return client[_0x9d57('0xb')](_0x44d8b4,{'body':_0x557a64})[_0x9d57('0xc')](function(_0xce000){logger[_0x9d57('0x9')](_0x9d57('0xd'),_0x44d8b4,_0xce000?util[_0x9d57('0x8')](_0xce000,{'showHidden':![],'depth':null}):'');})[_0x9d57('0xe')](function(_0x581832){logger[_0x9d57('0xa')](_0x9d57('0xd'),_0x44d8b4,_0x581832?util['inspect'](_0x581832,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2cb568){return client[_0x9d57('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x9d57('0xf'),_0x9d57('0x10')],'where':_0x2cb568,'limit':0x1}})[_0x9d57('0xc')](function(_0x5463a9){logger[_0x9d57('0x9')](_0x9d57('0x11'),JSON['stringify'](_0x2cb568),_0x5463a9?util['inspect'](_0x5463a9,{'showHidden':![],'depth':null}):'');return _0x5463a9[_0x9d57('0x12')][_0x9d57('0x13')]?_0x5463a9[_0x9d57('0x12')][0x0]:null;});}exports[_0x9d57('0x14')]=function(_0x58f46b){return new BPromise(function(_0x1a97df,_0x33ca42){if(_0x58f46b){return getUser({'internal':_0x58f46b})[_0x9d57('0xc')](function(_0x5d7e8e){logger[_0x9d57('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x58f46b,_0x5d7e8e?_0x9d57('0x15'):_0x9d57('0x16'));return _0x1a97df(_0x5d7e8e);})['catch'](function(_0x39632c){logger[_0x9d57('0xa')]('[utils][getUserByInternal]',_0x39632c?util[_0x9d57('0x8')](_0x39632c,{'showHidden':![],'depth':null}):'');return _0x1a97df(null);});}return _0x1a97df(null);});};exports['getUserByInterface']=function(_0x58b536){return new BPromise(function(_0x3e0fd7,_0x43bb17){if(_0x58b536){return getUser({'interface':_0x58b536})[_0x9d57('0xc')](function(_0x2ed82a){logger[_0x9d57('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x58b536,_0x2ed82a?_0x9d57('0x15'):_0x9d57('0x16'));return _0x3e0fd7(_0x2ed82a);})[_0x9d57('0xe')](function(_0x387568){logger[_0x9d57('0xa')](_0x9d57('0x17'),_0x387568?util[_0x9d57('0x8')](_0x387568,{'showHidden':![],'depth':null}):'');return _0x3e0fd7(null);});}return _0x3e0fd7(null);});};exports['getUserByName']=function(_0xefb58f){return new BPromise(function(_0x3015bb,_0xedd654){if(_0xefb58f){return getUser({'name':_0xefb58f})[_0x9d57('0xc')](function(_0x295292){logger[_0x9d57('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0xefb58f,_0x295292?_0x9d57('0x15'):'notfound');return _0x3015bb(_0x295292);})[_0x9d57('0xe')](function(_0x2f0522){logger['error']('[utils][getUserByName]',_0x2f0522?util[_0x9d57('0x8')](_0x2f0522,{'showHidden':![],'depth':null}):'');return _0x3015bb(null);});}return _0x3015bb(null);});};exports[_0x9d57('0x18')]=function(_0x41a6ee){return new BPromise(function(_0x24d179,_0x5e42d9){if(_0x41a6ee){return client[_0x9d57('0xb')](_0x9d57('0x19'),{'options':{'raw':!![],'attributes':['id',_0x9d57('0xf'),'type',_0x9d57('0x1a'),_0x9d57('0x1b')],'where':{'name':_0x41a6ee},'limit':0x1}})[_0x9d57('0xc')](function(_0x10187e){logger[_0x9d57('0x9')](_0x9d57('0x1c'),_0x41a6ee,_0x10187e?util['inspect'](_0x10187e,{'showHidden':![],'depth':null}):'');logger[_0x9d57('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x41a6ee,_0x10187e?_0x9d57('0x15'):_0x9d57('0x16'));return _0x24d179(_0x10187e[_0x9d57('0x12')][_0x9d57('0x13')]?_0x10187e[_0x9d57('0x12')][0x0]:null);})['catch'](function(_0x12364f){logger[_0x9d57('0xa')](_0x9d57('0x1d'),_0x12364f?util[_0x9d57('0x8')](_0x12364f,{'showHidden':![],'depth':null}):'');return _0x24d179(null);});}return _0x24d179(null);});};exports[_0x9d57('0x1e')]=function(_0x2e44ff,_0x244572){return moment(_0x2e44ff)[_0x9d57('0x1f')](_0x244572,'seconds')[_0x9d57('0x20')](_0x9d57('0x21'));};exports['subtractTime']=function(_0x100a38,_0x5b5fbc){return moment(_0x100a38)[_0x9d57('0x22')](_0x5b5fbc,_0x9d57('0x23'))[_0x9d57('0x20')](_0x9d57('0x21'));};exports[_0x9d57('0x24')]=function(_0x2b892e,_0xcf9aa3){return moment(_0x2b892e)['diff'](moment(_0xcf9aa3),_0x9d57('0x23'));};exports['sumTime']=function(_0x353999,_0x363bd7){return parseInt(_0x353999,0xa)+parseInt(_0x363bd7,0xa);};exports[_0x9d57('0x25')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9d57('0x26')]=function(_0x39cc88,_0x2bab06){if(_0x2bab06){return moment(_0x39cc88)[_0x9d57('0x26')](_0x2bab06);}return!![];};exports[_0x9d57('0x27')]=function(_0x306c37,_0xa93c1f){if(_0xa93c1f){return moment(_0x306c37)[_0x9d57('0x27')](_0xa93c1f);}else if(_0x306c37){return!![];}return![];}; \ No newline at end of file